From: Andrea Amorese Date: Tue, 25 Jan 2022 10:44:54 +0000 (+0100) Subject: Built motion from commit d105db35.|2.5.49 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=270b0279f8f236d6008d7395ea34f936ee40f8b8;p=motion2.git Built motion from commit d105db35.|2.5.49 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f21b277..abdfe22 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-25T09:59:05.689Z", + "time": "2022-01-25T10:23:52.583Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ebf5fec..82df492 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-25T09:59:05.689Z", + "time": "2022-01-25T10:23:52.583Z", "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 0a899ad..ae8c4cd 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 _0x4783=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','browser','bot'];(function(_0x5f3736,_0x35393c){var _0x54f265=function(_0x587a2c){while(--_0x587a2c){_0x5f3736['push'](_0x5f3736['shift']());}};_0x54f265(++_0x35393c);}(_0x4783,0xce));var _0x3478=function(_0xd9abf4,_0x2e5f77){_0xd9abf4=_0xd9abf4-0x0;var _0x528afd=_0x4783[_0xd9abf4];return _0x528afd;};'use strict';var Sequelize=require('sequelize');module[_0x3478('0x0')]={'name':{'type':Sequelize[_0x3478('0x1')],'get':function(_0xd0e824){return this[_0x3478('0x2')](_0x3478('0x3'));}},'action':{'type':Sequelize[_0x3478('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x3478('0x5'),_0x3478('0x6'),_0x3478('0x7'),'urlForward',_0x3478('0x8'),_0x3478('0x9'),_0x3478('0xa')]],'msg':_0x3478('0xb')}},'comment':_0x3478('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x3478('0x4')](0x1000),'comment':_0x3478('0xc')},'data3':{'type':Sequelize[_0x3478('0x4')](0x1000),'comment':_0x3478('0xd')},'data4':{'type':Sequelize[_0x3478('0x4')](0x1000),'comments':_0x3478('0xe')},'data5':{'type':Sequelize[_0x3478('0x4')](0x1000),'comments':_0x3478('0xf')},'data6':{'type':Sequelize[_0x3478('0x4')],'comments':_0x3478('0x10')},'data7':{'type':Sequelize[_0x3478('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x0b16=['VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','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)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x0b16,0x8f));var _0x60b1=function(_0x536ade,_0x3d4574){_0x536ade=_0x536ade-0x0;var _0x39925f=_0x0b16[_0x536ade];return _0x39925f;};'use strict';var Sequelize=require(_0x60b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x60b1('0x1')],'get':function(_0x1acf85){return this[_0x60b1('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x60b1('0x3'),_0x60b1('0x4'),_0x60b1('0x5'),_0x60b1('0x6'),_0x60b1('0x7'),'browser',_0x60b1('0x8'),_0x60b1('0x9')]],'msg':_0x60b1('0xa')}},'comment':_0x60b1('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x60b1('0xb')},'data2':{'type':Sequelize[_0x60b1('0xc')](0x1000),'comment':_0x60b1('0xd')},'data3':{'type':Sequelize[_0x60b1('0xc')](0x1000),'comment':_0x60b1('0xe')},'data4':{'type':Sequelize[_0x60b1('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x60b1('0xc')](0x1000),'comments':_0x60b1('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x60b1('0x10')},'data7':{'type':Sequelize[_0x60b1('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index e49bd2d..1e5127c 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 _0x0a9f=['reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply'];(function(_0x1a49b7,_0x23ebc0){var _0x50c937=function(_0x4e5a00){while(--_0x4e5a00){_0x1a49b7['push'](_0x1a49b7['shift']());}};_0x50c937(++_0x23ebc0);}(_0x0a9f,0xee));var _0xf0a9=function(_0x3d9b8c,_0x1accd9){_0x3d9b8c=_0x3d9b8c-0x0;var _0x5afdbc=_0x0a9f[_0x3d9b8c];return _0x5afdbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0a9('0x0'));var zipdir=require(_0xf0a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0a9('0x2'));var moment=require('moment');var BPromise=require(_0xf0a9('0x3'));var Mustache=require(_0xf0a9('0x4'));var util=require(_0xf0a9('0x5'));var path=require(_0xf0a9('0x6'));var sox=require(_0xf0a9('0x7'));var csv=require('to-csv');var ejs=require(_0xf0a9('0x8'));var fs=require('fs');var fs_extra=require(_0xf0a9('0x9'));var _=require('lodash');var squel=require(_0xf0a9('0xa'));var crypto=require('crypto');var jsforce=require(_0xf0a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf0a9('0xc'));var querystring=require('querystring');var Papa=require(_0xf0a9('0xd'));var Redis=require('ioredis');var authService=require(_0xf0a9('0xe'));var qs=require(_0xf0a9('0xf'));var as=require(_0xf0a9('0x10'));var hardwareService=require(_0xf0a9('0x11'));var logger=require('../../config/logger')(_0xf0a9('0x12'));var utils=require(_0xf0a9('0x13'));var config=require(_0xf0a9('0x14'));var licenseUtil=require(_0xf0a9('0x15'));var db=require(_0xf0a9('0x16'))['db'];function respondWithStatusCode(_0x509199,_0x18b9dd){_0x18b9dd=_0x18b9dd||0xcc;return function(_0x3e2769){if(_0x3e2769){return _0x509199[_0xf0a9('0x17')](_0x18b9dd);}return _0x509199[_0xf0a9('0x18')](_0x18b9dd)[_0xf0a9('0x19')]();};}function respondWithResult(_0x3434d2,_0x25a372){_0x25a372=_0x25a372||0xc8;return function(_0x21247a){if(_0x21247a){return _0x3434d2[_0xf0a9('0x18')](_0x25a372)[_0xf0a9('0x1a')](_0x21247a);}};}function respondWithFilteredResult(_0x21bb83,_0x38e7b4){return function(_0x39f784){if(_0x39f784){var _0x1dddbd=typeof _0x38e7b4[_0xf0a9('0x1b')]==='undefined'&&typeof _0x38e7b4['limit']==='undefined';var _0x544a31=_0x39f784[_0xf0a9('0x1c')];var _0x589450=_0x1dddbd?0x0:_0x38e7b4[_0xf0a9('0x1b')];var _0x28c035=_0x1dddbd?_0x39f784['count']:_0x38e7b4[_0xf0a9('0x1b')]+_0x38e7b4['limit'];var _0x8c9e03;if(_0x28c035>=_0x544a31){_0x28c035=_0x544a31;_0x8c9e03=0xc8;}else{_0x8c9e03=0xce;}_0x21bb83['status'](_0x8c9e03);return _0x21bb83[_0xf0a9('0x1d')](_0xf0a9('0x1e'),_0x589450+'-'+_0x28c035+'/'+_0x544a31)[_0xf0a9('0x1a')](_0x39f784);}return null;};}function patchUpdates(_0x21da55){return function(_0x16ef78){try{jsonpatch[_0xf0a9('0x1f')](_0x16ef78,_0x21da55,!![]);}catch(_0x141ad9){return BPromise[_0xf0a9('0x20')](_0x141ad9);}return _0x16ef78[_0xf0a9('0x21')]();};}function saveUpdates(_0x3f01ea,_0x3e3ed5){return function(_0x1f4543){if(_0x1f4543){return _0x1f4543[_0xf0a9('0x22')](_0x3f01ea)[_0xf0a9('0x23')](function(_0x5d716a){return _0x5d716a;});}return null;};}function removeEntity(_0x522a73,_0x3ea695){return function(_0x139654){if(_0x139654){return _0x139654[_0xf0a9('0x24')]()['then'](function(){_0x522a73[_0xf0a9('0x18')](0xcc)[_0xf0a9('0x19')]();});}};}function handleEntityNotFound(_0x1d06e5,_0x1de86a){return function(_0x4a58e6){if(!_0x4a58e6){_0x1d06e5['sendStatus'](0x194);}return _0x4a58e6;};}function handleError(_0x414a9e,_0x50fcee){_0x50fcee=_0x50fcee||0x1f4;return function(_0x5a6f6d){logger['error'](_0x5a6f6d[_0xf0a9('0x25')]);if(_0x5a6f6d[_0xf0a9('0x26')]){delete _0x5a6f6d[_0xf0a9('0x26')];}_0x414a9e[_0xf0a9('0x18')](_0x50fcee)[_0xf0a9('0x27')](_0x5a6f6d);};}exports[_0xf0a9('0x22')]=function(_0xfa291,_0x1e1b4e){if(_0xfa291[_0xf0a9('0x28')]['id']){delete _0xfa291['body']['id'];}return db[_0xf0a9('0x29')][_0xf0a9('0x2a')]({'where':{'id':_0xfa291[_0xf0a9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1e1b4e,null))[_0xf0a9('0x23')](saveUpdates(_0xfa291[_0xf0a9('0x28')],null))[_0xf0a9('0x23')](respondWithResult(_0x1e1b4e,null))[_0xf0a9('0x2c')](handleError(_0x1e1b4e,null));};exports['destroy']=function(_0x359100,_0x4f72ba){return db[_0xf0a9('0x29')]['find']({'where':{'id':_0x359100[_0xf0a9('0x2b')]['id']}})[_0xf0a9('0x23')](handleEntityNotFound(_0x4f72ba,null))[_0xf0a9('0x23')](removeEntity(_0x4f72ba,null))[_0xf0a9('0x2c')](handleError(_0x4f72ba,null));}; \ No newline at end of file +var _0xff53=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','body','Action','find','catch','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service'];(function(_0x426fcf,_0x5b7ca1){var _0x4780ce=function(_0x3de76c){while(--_0x3de76c){_0x426fcf['push'](_0x426fcf['shift']());}};_0x4780ce(++_0x5b7ca1);}(_0xff53,0xa2));var _0x3ff5=function(_0x5d688a,_0x10f4a4){_0x5d688a=_0x5d688a-0x0;var _0x34d1a8=_0xff53[_0x5d688a];return _0x34d1a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ff5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ff5('0x1'));var rp=require(_0x3ff5('0x2'));var moment=require(_0x3ff5('0x3'));var BPromise=require(_0x3ff5('0x4'));var Mustache=require(_0x3ff5('0x5'));var util=require('util');var path=require(_0x3ff5('0x6'));var sox=require('sox');var csv=require(_0x3ff5('0x7'));var ejs=require(_0x3ff5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3ff5('0x9'));var crypto=require(_0x3ff5('0xa'));var jsforce=require(_0x3ff5('0xb'));var deskjs=require(_0x3ff5('0xc'));var toCsv=require(_0x3ff5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3ff5('0xd'));var qs=require(_0x3ff5('0xe'));var as=require(_0x3ff5('0xf'));var hardwareService=require(_0x3ff5('0x10'));var logger=require('../../config/logger')(_0x3ff5('0x11'));var utils=require('../../config/utils');var config=require(_0x3ff5('0x12'));var licenseUtil=require(_0x3ff5('0x13'));var db=require(_0x3ff5('0x14'))['db'];function respondWithStatusCode(_0x21a939,_0x19a7c5){_0x19a7c5=_0x19a7c5||0xcc;return function(_0x5d42d8){if(_0x5d42d8){return _0x21a939['sendStatus'](_0x19a7c5);}return _0x21a939[_0x3ff5('0x15')](_0x19a7c5)[_0x3ff5('0x16')]();};}function respondWithResult(_0x298047,_0x1377dd){_0x1377dd=_0x1377dd||0xc8;return function(_0x2bb974){if(_0x2bb974){return _0x298047[_0x3ff5('0x15')](_0x1377dd)[_0x3ff5('0x17')](_0x2bb974);}};}function respondWithFilteredResult(_0x443973,_0x58467a){return function(_0x2cb5c7){if(_0x2cb5c7){var _0x480838=typeof _0x58467a[_0x3ff5('0x18')]===_0x3ff5('0x19')&&typeof _0x58467a[_0x3ff5('0x1a')]===_0x3ff5('0x19');var _0x5f4451=_0x2cb5c7[_0x3ff5('0x1b')];var _0x1d9175=_0x480838?0x0:_0x58467a[_0x3ff5('0x18')];var _0x52ce31=_0x480838?_0x2cb5c7[_0x3ff5('0x1b')]:_0x58467a['offset']+_0x58467a[_0x3ff5('0x1a')];var _0x540397;if(_0x52ce31>=_0x5f4451){_0x52ce31=_0x5f4451;_0x540397=0xc8;}else{_0x540397=0xce;}_0x443973[_0x3ff5('0x15')](_0x540397);return _0x443973[_0x3ff5('0x1c')](_0x3ff5('0x1d'),_0x1d9175+'-'+_0x52ce31+'/'+_0x5f4451)[_0x3ff5('0x17')](_0x2cb5c7);}return null;};}function patchUpdates(_0x122078){return function(_0x589673){try{jsonpatch[_0x3ff5('0x1e')](_0x589673,_0x122078,!![]);}catch(_0x11b3f3){return BPromise[_0x3ff5('0x1f')](_0x11b3f3);}return _0x589673['save']();};}function saveUpdates(_0x5116ce,_0x29f313){return function(_0x401b00){if(_0x401b00){return _0x401b00[_0x3ff5('0x20')](_0x5116ce)[_0x3ff5('0x21')](function(_0x4827f5){return _0x4827f5;});}return null;};}function removeEntity(_0x298ae3,_0x5c6cdf){return function(_0x358ce1){if(_0x358ce1){return _0x358ce1[_0x3ff5('0x22')]()[_0x3ff5('0x21')](function(){_0x298ae3[_0x3ff5('0x15')](0xcc)[_0x3ff5('0x16')]();});}};}function handleEntityNotFound(_0x3eb1b6,_0x4125ef){return function(_0x497f19){if(!_0x497f19){_0x3eb1b6[_0x3ff5('0x23')](0x194);}return _0x497f19;};}function handleError(_0x58ff45,_0x4ab94a){_0x4ab94a=_0x4ab94a||0x1f4;return function(_0x50da58){logger[_0x3ff5('0x24')](_0x50da58['stack']);if(_0x50da58[_0x3ff5('0x25')]){delete _0x50da58[_0x3ff5('0x25')];}_0x58ff45[_0x3ff5('0x15')](_0x4ab94a)[_0x3ff5('0x26')](_0x50da58);};}exports[_0x3ff5('0x20')]=function(_0x549dfe,_0x576bc9){if(_0x549dfe['body']['id']){delete _0x549dfe[_0x3ff5('0x27')]['id'];}return db[_0x3ff5('0x28')][_0x3ff5('0x29')]({'where':{'id':_0x549dfe['params']['id']}})[_0x3ff5('0x21')](handleEntityNotFound(_0x576bc9,null))[_0x3ff5('0x21')](saveUpdates(_0x549dfe[_0x3ff5('0x27')],null))[_0x3ff5('0x21')](respondWithResult(_0x576bc9,null))[_0x3ff5('0x2a')](handleError(_0x576bc9,null));};exports[_0x3ff5('0x22')]=function(_0x12e4bf,_0x1e0e30){return db[_0x3ff5('0x28')][_0x3ff5('0x29')]({'where':{'id':_0x12e4bf[_0x3ff5('0x2b')]['id']}})[_0x3ff5('0x21')](handleEntityNotFound(_0x1e0e30,null))[_0x3ff5('0x21')](removeEntity(_0x1e0e30,null))[_0x3ff5('0x2a')](handleError(_0x1e0e30,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5a7aefa..9ff1478 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 _0xa96d=['api','moment','request-promise','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x3c42ff,_0x45ee1f){var _0x4c0f6d=function(_0x3ec265){while(--_0x3ec265){_0x3c42ff['push'](_0x3c42ff['shift']());}};_0x4c0f6d(++_0x45ee1f);}(_0xa96d,0xa3));var _0xda96=function(_0x17e75e,_0x24753e){_0x17e75e=_0x17e75e-0x0;var _0x25f451=_0xa96d[_0x17e75e];return _0x25f451;};'use strict';var _=require(_0xda96('0x0'));var util=require(_0xda96('0x1'));var logger=require('../../config/logger')(_0xda96('0x2'));var moment=require(_0xda96('0x3'));var BPromise=require('bluebird');var rp=require(_0xda96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda96('0x5'));var config=require('../../config/environment');var attributes=require(_0xda96('0x6'));module[_0xda96('0x7')]=function(_0x28eb71,_0x5f0868){return _0x28eb71[_0xda96('0x8')](_0xda96('0x9'),attributes,{'tableName':_0xda96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbba0=['exports','tools_actions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x36f4df,_0x12e0d1){var _0x382372=function(_0x50692b){while(--_0x50692b){_0x36f4df['push'](_0x36f4df['shift']());}};_0x382372(++_0x12e0d1);}(_0xbba0,0x7a));var _0x0bba=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xbba0[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0x0bba('0x0'));var logger=require(_0x0bba('0x1'))(_0x0bba('0x2'));var moment=require(_0x0bba('0x3'));var BPromise=require(_0x0bba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bba('0x5'));var rimraf=require(_0x0bba('0x6'));var config=require(_0x0bba('0x7'));var attributes=require('./action.attributes');module[_0x0bba('0x8')]=function(_0x475485,_0xc05b09){return _0x475485['define']('Action',attributes,{'tableName':_0x0bba('0x9'),'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 a2ca7ee..656ad0d 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7217,0x19e));var _0x7721=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7217[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 83fb497..cc3c7f8 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 _0x7bf9=['./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x7bf9,0xe8));var _0x97bf=function(_0x3272f6,_0x449bee){_0x3272f6=_0x3272f6-0x0;var _0x3fe947=_0x7bf9[_0x3272f6];return _0x3fe947;};'use strict';var multer=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var path=require(_0x97bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x97bf('0x3'));var router=express[_0x97bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x97bf('0x5'));var interaction=require(_0x97bf('0x6'));var config=require(_0x97bf('0x7'));var controller=require(_0x97bf('0x8'));router[_0x97bf('0x9')](_0x97bf('0xa'),auth[_0x97bf('0xb')](),controller[_0x97bf('0xc')]);router[_0x97bf('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x97bf('0xe')]=router; \ No newline at end of file +var _0x68eb=['./action.controller','update','delete','isAuthenticated','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x42f241,_0x37e7ab){var _0x34a50c=function(_0x1f3bfd){while(--_0x1f3bfd){_0x42f241['push'](_0x42f241['shift']());}};_0x34a50c(++_0x37e7ab);}(_0x68eb,0x126));var _0xb68e=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x68eb[_0x2cacef];return _0x289ba6;};'use strict';var multer=require('multer');var util=require(_0xb68e('0x0'));var path=require(_0xb68e('0x1'));var timeout=require(_0xb68e('0x2'));var express=require('express');var router=express[_0xb68e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb68e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb68e('0x5'));var controller=require(_0xb68e('0x6'));router['put']('/:id',auth['isAuthenticated'](),controller[_0xb68e('0x7')]);router[_0xb68e('0x8')]('/:id',auth[_0xb68e('0x9')](),controller['destroy']);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 60faae0..efa4154 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2331fd,_0x13723f){var _0x233162=function(_0x23ad02){while(--_0x23ad02){_0x2331fd['push'](_0x2331fd['shift']());}};_0x233162(++_0x13723f);}(_0xabce,0x103));var _0xeabc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xabce[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x41efef,_0x19810a){var _0x51e449=function(_0x1703a8){while(--_0x1703a8){_0x41efef['push'](_0x41efef['shift']());}};_0x51e449(++_0x19810a);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f562d05..5ca0907 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 _0x7b1a=['IS\x20EMPTY','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','get','CustomReports','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','parentKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7b1a,0x166));var _0xa7b1=function(_0x46cd24,_0x2419ca){_0x46cd24=_0x46cd24-0x0;var _0x5623a3=_0x7b1a[_0x46cd24];return _0x5623a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7b1('0x0'));var zipdir=require(_0xa7b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7b1('0x2'));var moment=require(_0xa7b1('0x3'));var BPromise=require(_0xa7b1('0x4'));var Mustache=require(_0xa7b1('0x5'));var util=require('util');var path=require(_0xa7b1('0x6'));var sox=require(_0xa7b1('0x7'));var csv=require(_0xa7b1('0x8'));var ejs=require(_0xa7b1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7b1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7b1('0xb'));var jsforce=require(_0xa7b1('0xc'));var deskjs=require(_0xa7b1('0xd'));var toCsv=require(_0xa7b1('0x8'));var querystring=require('querystring');var Papa=require(_0xa7b1('0xe'));var Redis=require(_0xa7b1('0xf'));var authService=require(_0xa7b1('0x10'));var qs=require(_0xa7b1('0x11'));var as=require(_0xa7b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7b1('0x13'))(_0xa7b1('0x14'));var utils=require('../../config/utils');var config=require(_0xa7b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xa7b1('0x16'))[_0xa7b1('0x17')];function respondWithStatusCode(_0x64fee7,_0x276704){_0x276704=_0x276704||0xcc;return function(_0x684b3e){if(_0x684b3e){return _0x64fee7['sendStatus'](_0x276704);}return _0x64fee7[_0xa7b1('0x18')](_0x276704)[_0xa7b1('0x19')]();};}function respondWithResult(_0x4f241b,_0xba137f){_0xba137f=_0xba137f||0xc8;return function(_0x15071c){if(_0x15071c){return _0x4f241b[_0xa7b1('0x18')](_0xba137f)['json'](_0x15071c);}};}function respondWithFilteredResult(_0x1e8317,_0x454ff3){return function(_0x450978){if(_0x450978){var _0x145e59=typeof _0x454ff3[_0xa7b1('0x1a')]===_0xa7b1('0x1b')&&typeof _0x454ff3[_0xa7b1('0x1c')]===_0xa7b1('0x1b');var _0x269523=_0x450978[_0xa7b1('0x1d')];var _0xef3b8b=_0x145e59?0x0:_0x454ff3[_0xa7b1('0x1a')];var _0xbaa89c=_0x145e59?_0x450978['count']:_0x454ff3['offset']+_0x454ff3[_0xa7b1('0x1c')];var _0x3b2cd5;if(_0xbaa89c>=_0x269523){_0xbaa89c=_0x269523;_0x3b2cd5=0xc8;}else{_0x3b2cd5=0xce;}_0x1e8317[_0xa7b1('0x18')](_0x3b2cd5);return _0x1e8317[_0xa7b1('0x1e')]('Content-Range',_0xef3b8b+'-'+_0xbaa89c+'/'+_0x269523)[_0xa7b1('0x1f')](_0x450978);}return null;};}function patchUpdates(_0x4a53ba){return function(_0x594649){try{jsonpatch[_0xa7b1('0x20')](_0x594649,_0x4a53ba,!![]);}catch(_0x321535){return BPromise[_0xa7b1('0x21')](_0x321535);}return _0x594649['save']();};}function saveUpdates(_0x934d42,_0x2a9acb){return function(_0x5887f1){if(_0x5887f1){return _0x5887f1[_0xa7b1('0x22')](_0x934d42)[_0xa7b1('0x23')](function(_0x484bcd){return _0x484bcd;});}return null;};}function removeEntity(_0x2ddbc0,_0x54b59c){return function(_0x506873){if(_0x506873){return _0x506873['destroy']()[_0xa7b1('0x23')](function(){var _0xfe4df0=_0x506873[_0xa7b1('0x24')]({'plain':!![]});var _0x5755d1=_0xa7b1('0x25');return db['UserProfileResource'][_0xa7b1('0x26')]({'where':{'type':_0x5755d1,'resourceId':_0xfe4df0['id']}})[_0xa7b1('0x23')](function(){return _0x506873;});})[_0xa7b1('0x23')](function(){_0x2ddbc0[_0xa7b1('0x18')](0xcc)[_0xa7b1('0x19')]();});}};}function handleEntityNotFound(_0xc76372,_0x5d9993){return function(_0x5754ac){if(!_0x5754ac){_0xc76372[_0xa7b1('0x27')](0x194);}return _0x5754ac;};}function handleError(_0x24a151,_0x150735){_0x150735=_0x150735||0x1f4;return function(_0x31cd43){logger['error'](_0x31cd43[_0xa7b1('0x28')]);if(_0x31cd43[_0xa7b1('0x29')]){delete _0x31cd43['name'];}_0x24a151[_0xa7b1('0x18')](_0x150735)[_0xa7b1('0x2a')](_0x31cd43);};}exports[_0xa7b1('0x2b')]=function(_0x5cb24a,_0x204f84){var _0x369db2={},_0x40c3a3={},_0x38f642={'count':0x0,'rows':[]};var _0x5bd5f3=_[_0xa7b1('0x2c')](db[_0xa7b1('0x2d')]['rawAttributes'],function(_0x1aa3f3){return{'name':_0x1aa3f3[_0xa7b1('0x2e')],'type':_0x1aa3f3['type'][_0xa7b1('0x2f')]};});_0x40c3a3[_0xa7b1('0x30')]=_[_0xa7b1('0x2c')](_0x5bd5f3,_0xa7b1('0x29'));_0x40c3a3[_0xa7b1('0x31')]=_[_0xa7b1('0x32')](_0x5cb24a[_0xa7b1('0x31')]);_0x40c3a3[_0xa7b1('0x33')]=_[_0xa7b1('0x34')](_0x40c3a3['model'],_0x40c3a3[_0xa7b1('0x31')]);_0x369db2[_0xa7b1('0x35')]=_[_0xa7b1('0x34')](_0x40c3a3[_0xa7b1('0x30')],qs[_0xa7b1('0x36')](_0x5cb24a[_0xa7b1('0x31')]['fields']));_0x369db2[_0xa7b1('0x35')]=_0x369db2[_0xa7b1('0x35')][_0xa7b1('0x37')]?_0x369db2[_0xa7b1('0x35')]:_0x40c3a3[_0xa7b1('0x30')];if(!_0x5cb24a[_0xa7b1('0x31')]['hasOwnProperty'](_0xa7b1('0x38'))){_0x369db2[_0xa7b1('0x1c')]=qs[_0xa7b1('0x1c')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x1c')]);_0x369db2[_0xa7b1('0x1a')]=qs[_0xa7b1('0x1a')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x1a')]);}_0x369db2[_0xa7b1('0x39')]=qs[_0xa7b1('0x3a')](_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x3a')]);_0x369db2[_0xa7b1('0x3b')]=qs[_0xa7b1('0x33')](_[_0xa7b1('0x3c')](_0x5cb24a[_0xa7b1('0x31')],_0x40c3a3[_0xa7b1('0x33')]),_0x5bd5f3);if(_0x5cb24a['query'][_0xa7b1('0x3d')]){_0x369db2[_0xa7b1('0x3b')]=_['merge'](_0x369db2['where'],{'$or':_[_0xa7b1('0x2c')](_0x5bd5f3,function(_0x4c16b1){if(_0x4c16b1[_0xa7b1('0x3e')]!==_0xa7b1('0x3f')){var _0x97cec8={};_0x97cec8[_0x4c16b1[_0xa7b1('0x29')]]={'$like':'%'+_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x3d')]+'%'};return _0x97cec8;}})});}_0x369db2=_['merge']({},_0x369db2,_0x5cb24a[_0xa7b1('0x40')]);var _0x1becfb={'where':_0x369db2[_0xa7b1('0x3b')]};return db[_0xa7b1('0x2d')]['count'](_0x1becfb)[_0xa7b1('0x23')](function(_0x13e328){_0x38f642['count']=_0x13e328;if(_0x5cb24a[_0xa7b1('0x31')][_0xa7b1('0x41')]){_0x369db2[_0xa7b1('0x42')]=[{'all':!![]}];}return db[_0xa7b1('0x2d')][_0xa7b1('0x43')](_0x369db2);})[_0xa7b1('0x23')](function(_0x5c8c95){_0x38f642[_0xa7b1('0x44')]=_0x5c8c95;return _0x38f642;})[_0xa7b1('0x23')](respondWithFilteredResult(_0x204f84,_0x369db2))['catch'](handleError(_0x204f84,null));};exports[_0xa7b1('0x45')]=function(_0x5246f1,_0x114f52){var _0x465b94={'raw':![],'where':{'id':_0x5246f1['params']['id']}},_0x3c1431={};_0x3c1431[_0xa7b1('0x30')]=_[_0xa7b1('0x32')](db[_0xa7b1('0x2d')][_0xa7b1('0x46')]);_0x3c1431[_0xa7b1('0x31')]=_['keys'](_0x5246f1[_0xa7b1('0x31')]);_0x3c1431[_0xa7b1('0x33')]=_[_0xa7b1('0x34')](_0x3c1431[_0xa7b1('0x30')],_0x3c1431[_0xa7b1('0x31')]);_0x465b94[_0xa7b1('0x35')]=_['intersection'](_0x3c1431[_0xa7b1('0x30')],qs[_0xa7b1('0x36')](_0x5246f1[_0xa7b1('0x31')][_0xa7b1('0x36')]));_0x465b94[_0xa7b1('0x35')]=_0x465b94[_0xa7b1('0x35')][_0xa7b1('0x37')]?_0x465b94[_0xa7b1('0x35')]:_0x3c1431[_0xa7b1('0x30')];if(_0x5246f1['query'][_0xa7b1('0x41')]){_0x465b94[_0xa7b1('0x42')]=[{'all':!![]}];}_0x465b94=_['merge']({},_0x465b94,_0x5246f1['options']);return db[_0xa7b1('0x2d')][_0xa7b1('0x47')](_0x465b94)[_0xa7b1('0x23')](handleEntityNotFound(_0x114f52,null))[_0xa7b1('0x23')](respondWithResult(_0x114f52,null))[_0xa7b1('0x48')](handleError(_0x114f52,null));};exports[_0xa7b1('0x49')]=function(_0x3fd07e,_0x7a9cd4){return db[_0xa7b1('0x2d')][_0xa7b1('0x49')](_0x3fd07e['body'],{})[_0xa7b1('0x23')](function(_0x46beb8){var _0xb95add=_0x3fd07e[_0xa7b1('0x4a')][_0xa7b1('0x24')]({'plain':!![]});if(!_0xb95add)throw new Error(_0xa7b1('0x4b'));if(_0xb95add[_0xa7b1('0x4c')]===_0xa7b1('0x4a')){var _0x42c097=_0x46beb8[_0xa7b1('0x24')]({'plain':!![]});var _0x28188f='Reports';return db[_0xa7b1('0x4d')]['find']({'where':{'name':_0x28188f,'userProfileId':_0xb95add[_0xa7b1('0x4e')]},'raw':!![]})[_0xa7b1('0x23')](function(_0x32d6aa){if(_0x32d6aa&&_0x32d6aa['autoAssociation']===0x0){return db[_0xa7b1('0x4f')]['create']({'name':_0x42c097[_0xa7b1('0x29')],'resourceId':_0x42c097['id'],'type':_0xa7b1('0x25'),'sectionId':_0x32d6aa['id']},{})['then'](function(){return _0x46beb8;});}else{return _0x46beb8;}})[_0xa7b1('0x48')](function(_0x2924a2){logger[_0xa7b1('0x50')](_0xa7b1('0x51'),_0x2924a2);throw _0x2924a2;});}return _0x46beb8;})[_0xa7b1('0x23')](respondWithResult(_0x7a9cd4,0xc9))[_0xa7b1('0x48')](handleError(_0x7a9cd4,null));};exports[_0xa7b1('0x22')]=function(_0x5f26ba,_0x3af4f5){if(_0x5f26ba['body']['id']){delete _0x5f26ba[_0xa7b1('0x52')]['id'];}return db[_0xa7b1('0x2d')][_0xa7b1('0x47')]({'where':{'id':_0x5f26ba[_0xa7b1('0x53')]['id']}})[_0xa7b1('0x23')](handleEntityNotFound(_0x3af4f5,null))['then'](saveUpdates(_0x5f26ba[_0xa7b1('0x52')],null))['then'](respondWithResult(_0x3af4f5,null))[_0xa7b1('0x48')](handleError(_0x3af4f5,null));};exports[_0xa7b1('0x26')]=function(_0x3426db,_0x5874a8){return db[_0xa7b1('0x2d')][_0xa7b1('0x47')]({'where':{'id':_0x3426db[_0xa7b1('0x53')]['id']}})[_0xa7b1('0x23')](handleEntityNotFound(_0x5874a8,null))[_0xa7b1('0x23')](removeEntity(_0x5874a8,null))['catch'](handleError(_0x5874a8,null));};exports[_0xa7b1('0x54')]=function(_0x44513b,_0x28b467){var _0x126f3f=0xa;var _0x95887c=[_0xa7b1('0x55'),'left_join',_0xa7b1('0x56'),_0xa7b1('0x57')];var _0x6cda33={'SUM':_0xa7b1('0x58'),'COUNT':_0xa7b1('0x59'),'COUNT DISTINCT':_0xa7b1('0x5a'),'MAX':_0xa7b1('0x5b'),'MIN':'MIN(%s)','AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0x41ca68={'SEC_TO_TIME':_0xa7b1('0x5f'),'DATE':_0xa7b1('0x60'),'HOUR':_0xa7b1('0x61'),'ROUND':_0xa7b1('0x62'),'UNIX_TIMESTAMP':_0xa7b1('0x63')};var _0x3118f9=function(_0x57bcd1){return!_[_0xa7b1('0x64')](['IS\x20NULL',_0xa7b1('0x65'),'IS\x20EMPTY',_0xa7b1('0x66')],_0x57bcd1);};var _0x4590b9=function(_0x3e4853){if(!_0x3e4853||!_0x3e4853[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x1b55c8='(',_0x28398d=0x0;_0x28398d<_0x3e4853['rules'][_0xa7b1('0x37')];_0x28398d+=0x1){_0x28398d>0x0&&(_0x1b55c8+='\x20'+_0x3e4853[_0xa7b1('0x68')]+'\x20');_0x1b55c8+=_0x3e4853[_0xa7b1('0x67')][_0x28398d]['group']?_0x4590b9(_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x69')]):_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6a')]+'\x20'+_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6b')]+(_0x3118f9(_0x3e4853['rules'][_0x28398d]['condition'])?'\x20'+_0x3e4853[_0xa7b1('0x67')][_0x28398d][_0xa7b1('0x6c')]:'');}return _0x1b55c8+')';};var _0x54594e={'where':{'id':_0x44513b[_0xa7b1('0x53')]['id']}},_0x25bfd7,_0x5b939d,_0x506dc8,_0x2c76a3,_0xe6f017;_0x54594e=_[_0xa7b1('0x6d')]({},_0x54594e,_0x44513b[_0xa7b1('0x40')]);return db['AnalyticCustomReport'][_0xa7b1('0x47')](_0x54594e)['then'](function(_0x5161be){if(_0x5161be){_0x25bfd7=_0x5161be;return _0x5161be[_0xa7b1('0x6e')]();}return null;})['then'](function(_0x1a23b6){if(_0x1a23b6){if(!_0x1a23b6['length']){throw new db[(_0xa7b1('0x6f'))][(_0xa7b1('0x70'))](_0xa7b1('0x71'),0x193);}_0x5b939d=_0x1a23b6;return db[_0xa7b1('0x72')]['findAll']({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x279e08){if(_0x279e08){_0x506dc8=_[_0xa7b1('0x73')](_0x279e08,'id');var _0x4b3398;var _0x5d95a6=squel[_0xa7b1('0x74')]();_0x5d95a6[_0xa7b1('0x75')](_0x25bfd7[_0xa7b1('0x76')]);for(var _0x320d29=0x0;_0x320d29<_0x5b939d[_0xa7b1('0x37')];_0x320d29+=0x1){_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x77')]?_0x506dc8[_0x5b939d[_0x320d29][_0xa7b1('0x77')]][_0xa7b1('0x78')]:_0x5b939d[_0x320d29][_0xa7b1('0x6a')];_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x6cda33[_0x5b939d[_0x320d29]['function']],'%s',_0x4b3398):_0x4b3398;_0x4b3398=_0x5b939d[_0x320d29][_0xa7b1('0x7b')]?_[_0xa7b1('0x7a')](_0x41ca68[_0x5b939d[_0x320d29]['format']],'%s',_0x4b3398):_0x4b3398;if(_0x5b939d[_0x320d29]['groupBy']){_0x5d95a6[_0xa7b1('0x69')](_0x4b3398);}_0x5b939d[_0x320d29]['orderBy']&&_0x5d95a6[_0xa7b1('0x39')](_0x4b3398,_0x5b939d[_0x320d29][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x5d95a6[_0xa7b1('0x6a')](_0x4b3398,_0x5b939d[_0x320d29][_0xa7b1('0x7e')]||_0x4b3398);}if(_0x25bfd7[_0xa7b1('0x7f')]){_0x25bfd7[_0xa7b1('0x7f')]=JSON['parse'](_0x25bfd7['joins']);for(var _0x27d603=0x0;_0x27d603<_0x25bfd7[_0xa7b1('0x7f')]['length'];_0x27d603+=0x1){if(_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x3e')]&&_[_0xa7b1('0x64')](_0x95887c,_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x3e')])&&_0x25bfd7['joins'][_0x27d603]['parentKey']&&_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x80')]&&_0x25bfd7['joins'][_0x27d603][_0xa7b1('0x81')]){_0x5d95a6[_0x25bfd7['joins'][_0x27d603][_0xa7b1('0x3e')]](_0x25bfd7[_0xa7b1('0x7f')][_0x27d603]['foreignTable'],null,util[_0xa7b1('0x7b')]('%s.%s\x20=\x20%s.%s',_0x25bfd7[_0xa7b1('0x76')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x82')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603][_0xa7b1('0x80')],_0x25bfd7[_0xa7b1('0x7f')][_0x27d603]['foreignKey']));}}}if(_0x25bfd7[_0xa7b1('0x83')]){_0x25bfd7['conditions']=JSON[_0xa7b1('0x84')](_0x25bfd7[_0xa7b1('0x83')]);_0x5d95a6[_0xa7b1('0x3b')](_0x4590b9(_0x25bfd7[_0xa7b1('0x83')][_0xa7b1('0x69')]));}_0xe6f017=_0x5d95a6['clone']();_0x5d95a6[_0xa7b1('0x1c')](_0x126f3f);_0x5d95a6[_0xa7b1('0x1a')](0x0);logger[_0xa7b1('0x85')](_0xa7b1('0x86'),_0x5d95a6['toString']());return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x5d95a6[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')][_0xa7b1('0x8a')]});}})['then'](respondWithResult(_0x28b467,null))['catch'](handleError(_0x28b467,null));};function runReport(_0x54f767,_0x394327,_0x5a2eea){var _0x359a4e=_0x394327[_0xa7b1('0x29')];var _0x5cef26=0xa;var _0x21d20a=['join',_0xa7b1('0x8b'),_0xa7b1('0x56'),_0xa7b1('0x57')];var _0x3f5ce4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa7b1('0x5b'),'MIN':_0xa7b1('0x8c'),'AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':_0xa7b1('0x8d'),'GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0xd730e0={'SEC_TO_TIME':_0xa7b1('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa7b1('0x63')};var _0x144bc9=function(_0x2c7aff){return!_[_0xa7b1('0x64')]([_0xa7b1('0x8e'),'IS\x20NOT\x20NULL',_0xa7b1('0x8f'),_0xa7b1('0x66')],_0x2c7aff);};var _0x46e582=function(_0xe20752){if(!_0xe20752||!_0xe20752[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x1c20eb='(',_0x5d2efc=0x0;_0x5d2efc<_0xe20752[_0xa7b1('0x67')][_0xa7b1('0x37')];_0x5d2efc+=0x1){_0x5d2efc>0x0&&(_0x1c20eb+='\x20'+_0xe20752[_0xa7b1('0x68')]+'\x20');_0x1c20eb+=_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x69')]?_0x46e582(_0xe20752[_0xa7b1('0x67')][_0x5d2efc]['group']):_0xe20752[_0xa7b1('0x67')][_0x5d2efc]['field']+'\x20'+_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x6b')]+(_0x144bc9(_0xe20752[_0xa7b1('0x67')][_0x5d2efc][_0xa7b1('0x6b')])?'\x20'+_0xe20752['rules'][_0x5d2efc]['value']:'');}return _0x1c20eb+')';};var _0x2b9d4d={'where':{'id':_0x54f767['id']}},_0x5578d7,_0x38060e,_0x52da47,_0x2f7d33,_0x51647e;_0x2b9d4d=_['merge']({},_0x2b9d4d,_0x5a2eea);return db[_0xa7b1('0x2d')][_0xa7b1('0x47')](_0x2b9d4d)[_0xa7b1('0x23')](function(_0x5e5980){if(_0x5e5980){_0x5578d7=_0x5e5980;return _0x5e5980[_0xa7b1('0x6e')]();}return null;})['then'](function(_0x37f072){if(_0x37f072){if(!_0x37f072['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xa7b1('0x71'),0x193);}_0x38060e=_0x37f072;return db[_0xa7b1('0x72')][_0xa7b1('0x43')]({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x5a8e29){if(_0x5a8e29){_0x52da47=_[_0xa7b1('0x73')](_0x5a8e29,'id');var _0x12c477;var _0x187468=squel[_0xa7b1('0x74')]();_0x187468['from'](_0x5578d7[_0xa7b1('0x76')]);for(var _0x135825=0x0;_0x135825<_0x38060e[_0xa7b1('0x37')];_0x135825+=0x1){_0x12c477=_0x38060e[_0x135825]['MetricId']?_0x52da47[_0x38060e[_0x135825][_0xa7b1('0x77')]][_0xa7b1('0x78')]:_0x38060e[_0x135825][_0xa7b1('0x6a')];_0x12c477=_0x38060e[_0x135825][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x3f5ce4[_0x38060e[_0x135825][_0xa7b1('0x79')]],'%s',_0x12c477):_0x12c477;_0x12c477=_0x38060e[_0x135825][_0xa7b1('0x7b')]?_[_0xa7b1('0x7a')](_0xd730e0[_0x38060e[_0x135825][_0xa7b1('0x7b')]],'%s',_0x12c477):_0x12c477;if(_0x38060e[_0x135825][_0xa7b1('0x90')]){_0x187468[_0xa7b1('0x69')](_0x12c477);}_0x38060e[_0x135825]['orderBy']&&_0x187468[_0xa7b1('0x39')](_0x12c477,_0x38060e[_0x135825][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x187468[_0xa7b1('0x6a')](_0x12c477,_0x38060e[_0x135825][_0xa7b1('0x7e')]||_0x12c477);}if(_0x5578d7[_0xa7b1('0x7f')]){_0x5578d7['joins']=JSON[_0xa7b1('0x84')](_0x5578d7[_0xa7b1('0x7f')]);for(var _0x2b08cc=0x0;_0x2b08cc<_0x5578d7['joins'][_0xa7b1('0x37')];_0x2b08cc+=0x1){if(_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x3e')]&&_[_0xa7b1('0x64')](_0x21d20a,_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x3e')])&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x82')]&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc]['foreignTable']&&_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x81')]){_0x187468[_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc]['type']](_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x80')],null,util[_0xa7b1('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5578d7['table'],_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x82')],_0x5578d7['joins'][_0x2b08cc][_0xa7b1('0x80')],_0x5578d7[_0xa7b1('0x7f')][_0x2b08cc][_0xa7b1('0x81')]));}}}if(_0x5578d7[_0xa7b1('0x83')]){_0x5578d7[_0xa7b1('0x83')]=JSON[_0xa7b1('0x84')](_0x5578d7[_0xa7b1('0x83')]);_0x187468[_0xa7b1('0x3b')](_0x46e582(_0x5578d7[_0xa7b1('0x83')][_0xa7b1('0x69')]));}_0x51647e=_0x187468[_0xa7b1('0x91')]();_0x187468[_0xa7b1('0x1c')](_0x5cef26);_0x187468[_0xa7b1('0x1a')](0x0);return;}})[_0xa7b1('0x23')](function(){if(_0x394327[_0xa7b1('0x92')]===_0xa7b1('0x93')){return null;}var _0x396dcf=_['merge'](_0x394327,{'name':_0x394327[_0xa7b1('0x94')]||_0x394327['name']||_0x5578d7[_0xa7b1('0x29')],'basename':_0x359a4e,'savename':util[_0xa7b1('0x7b')](_0xa7b1('0x95'),_0x394327[_0xa7b1('0x29')]||_0x5578d7[_0xa7b1('0x29')],require(_0xa7b1('0x96'))[_0xa7b1('0x97')](0x4),_0x394327[_0xa7b1('0x92')]||_0xa7b1('0x98')),'reportId':_0x5578d7['id'],'reportType':_0xa7b1('0x99')});return db[_0xa7b1('0x9a')][_0xa7b1('0x49')](_0x396dcf,{'raw':!![]});})[_0xa7b1('0x23')](function(_0x1a60ec){if(_0x5578d7[_0xa7b1('0x76')]===_0xa7b1('0x9b')){_0x51647e[_0xa7b1('0x3b')](_0x5578d7[_0xa7b1('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x394327[_0xa7b1('0x9c')],_0x394327[_0xa7b1('0x9d')]);}else{_0x51647e[_0xa7b1('0x3b')](_0x5578d7[_0xa7b1('0x76')]+_0xa7b1('0x9e'),_0x394327[_0xa7b1('0x9c')],_0x394327[_0xa7b1('0x9d')]);}if(_0x1a60ec){logger[_0xa7b1('0x9f')]('Run\x20Query:',_0x51647e[_0xa7b1('0x88')]());require(_0xa7b1('0xa0'))['fork'](path[_0xa7b1('0x55')](__dirname,_0xa7b1('0xa1'),_0x1a60ec[_0xa7b1('0x92')]),[_0x1a60ec['id'],_0x51647e[_0xa7b1('0x88')](),path[_0xa7b1('0x55')](__dirname,_0xa7b1('0xa2'),_0x1a60ec[_0xa7b1('0xa3')]),_0x359a4e]);return _0x1a60ec;}else{var _0x1f3350=squel[_0xa7b1('0x74')]();_0x1f3350[_0xa7b1('0x75')]('('+_0x51647e[_0xa7b1('0x88')]()+')',_0xa7b1('0xa4'));_0x1f3350['field'](_0xa7b1('0xa5'),_0xa7b1('0x1d'));_0x51647e[_0xa7b1('0x1c')](_0x394327[_0xa7b1('0x1c')]||_0x5cef26);_0x51647e[_0xa7b1('0x1a')](_0x394327['offset']||0x0);return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x1f3350['toString'](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')][_0xa7b1('0x8a')]})['then'](function(_0x162e2f){if(!_0x162e2f[_0xa7b1('0x37')]){_0x2f7d33=0x0;}else{_0x2f7d33=_0x162e2f[0x0][_0xa7b1('0x1d')]||0x0;}return dbH[_0xa7b1('0x87')][_0xa7b1('0x31')](_0x51647e[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')]['QueryTypes'][_0xa7b1('0x8a')]});})['then'](function(_0xc9ea53){return{'rows':_0xc9ea53||[],'count':_0x2f7d33};});}});}exports['run']=function(_0x523a60,_0x108508){return runReport(_0x523a60[_0xa7b1('0x53')],_0x523a60['query'],_0x523a60[_0xa7b1('0x40')])[_0xa7b1('0x23')](respondWithResult(_0x108508,null))[_0xa7b1('0x48')](handleError(_0x108508,null));};exports[_0xa7b1('0xa6')]=runReport;exports[_0xa7b1('0x31')]=function(_0x4fca20,_0x85486a){var _0x402e8b=0xa;var _0x588c99=[_0xa7b1('0x55'),_0xa7b1('0x8b'),_0xa7b1('0x56'),'cross_join'];var _0x12ab41={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa7b1('0x5b'),'MIN':_0xa7b1('0x8c'),'AVG':_0xa7b1('0x5c'),'GROUP_CONCAT':_0xa7b1('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa7b1('0x5e')};var _0x1da675={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa7b1('0x60'),'HOUR':_0xa7b1('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1a848a=function(_0x49ddc5){return!_[_0xa7b1('0x64')]([_0xa7b1('0x8e'),_0xa7b1('0x65'),_0xa7b1('0x8f'),'IS\x20NOT\x20EMPTY'],_0x49ddc5);};var _0x55a82d=function(_0x4c6f16){if(!_0x4c6f16||!_0x4c6f16[_0xa7b1('0x67')][_0xa7b1('0x37')]){return'';}for(var _0x3c7447='(',_0x1264ad=0x0;_0x1264ad<_0x4c6f16[_0xa7b1('0x67')][_0xa7b1('0x37')];_0x1264ad+=0x1){_0x1264ad>0x0&&(_0x3c7447+='\x20'+_0x4c6f16[_0xa7b1('0x68')]+'\x20');_0x3c7447+=_0x4c6f16['rules'][_0x1264ad][_0xa7b1('0x69')]?_0x55a82d(_0x4c6f16[_0xa7b1('0x67')][_0x1264ad][_0xa7b1('0x69')]):_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['field']+'\x20'+_0x4c6f16['rules'][_0x1264ad][_0xa7b1('0x6b')]+(_0x1a848a(_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['condition'])?'\x20'+_0x4c6f16[_0xa7b1('0x67')][_0x1264ad]['value']:'');}return _0x3c7447+')';};var _0x11ed39={'where':{'id':_0x4fca20[_0xa7b1('0x53')]['id']}},_0x1a607d,_0x18782c,_0xfe2b8c,_0x526e0e,_0x55dfbb;_0x11ed39=_[_0xa7b1('0x6d')]({},_0x11ed39,_0x4fca20['options']);return db[_0xa7b1('0x2d')]['find'](_0x11ed39)[_0xa7b1('0x23')](function(_0x3d10c9){if(_0x3d10c9){_0x1a607d=_0x3d10c9;return _0x3d10c9['getFields']();}return null;})[_0xa7b1('0x23')](function(_0x20ef87){if(_0x20ef87){if(!_0x20ef87[_0xa7b1('0x37')]){throw new db[(_0xa7b1('0x6f'))][(_0xa7b1('0x70'))](_0xa7b1('0x71'),0x193);}_0x18782c=_0x20ef87;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xa7b1('0x23')](function(_0x188507){if(_0x188507){_0xfe2b8c=_[_0xa7b1('0x73')](_0x188507,'id');var _0x4feb33;var _0x3c84ad=squel['select']();_0x3c84ad['from'](_0x1a607d[_0xa7b1('0x76')]);for(var _0x408e0b=0x0;_0x408e0b<_0x18782c['length'];_0x408e0b+=0x1){_0x4feb33=_0x18782c[_0x408e0b][_0xa7b1('0x77')]?_0xfe2b8c[_0x18782c[_0x408e0b]['MetricId']][_0xa7b1('0x78')]:_0x18782c[_0x408e0b]['field'];_0x4feb33=_0x18782c[_0x408e0b][_0xa7b1('0x79')]?_[_0xa7b1('0x7a')](_0x12ab41[_0x18782c[_0x408e0b][_0xa7b1('0x79')]],'%s',_0x4feb33):_0x4feb33;_0x4feb33=_0x18782c[_0x408e0b]['format']?_['replace'](_0x1da675[_0x18782c[_0x408e0b][_0xa7b1('0x7b')]],'%s',_0x4feb33):_0x4feb33;if(_0x18782c[_0x408e0b][_0xa7b1('0x90')]){_0x3c84ad[_0xa7b1('0x69')](_0x4feb33);}_0x18782c[_0x408e0b][_0xa7b1('0x7c')]&&_0x3c84ad[_0xa7b1('0x39')](_0x4feb33,_0x18782c[_0x408e0b][_0xa7b1('0x7c')]===_0xa7b1('0x7d')?![]:!![]);_0x3c84ad[_0xa7b1('0x6a')](_0x4feb33,_0x18782c[_0x408e0b][_0xa7b1('0x7e')]||_0x4feb33);}if(_0x1a607d[_0xa7b1('0x7f')]){_0x1a607d[_0xa7b1('0x7f')]=JSON['parse'](_0x1a607d[_0xa7b1('0x7f')]);for(var _0xf8d3c4=0x0;_0xf8d3c4<_0x1a607d[_0xa7b1('0x7f')][_0xa7b1('0x37')];_0xf8d3c4+=0x1){if(_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['type']&&_[_0xa7b1('0x64')](_0x588c99,_0x1a607d['joins'][_0xf8d3c4][_0xa7b1('0x3e')])&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['parentKey']&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4]['foreignTable']&&_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x81')]){_0x3c84ad[_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x3e')]](_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a607d['table'],_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x82')],_0x1a607d[_0xa7b1('0x7f')][_0xf8d3c4][_0xa7b1('0x80')],_0x1a607d['joins'][_0xf8d3c4][_0xa7b1('0x81')]));}}}if(_0x1a607d['conditions']){_0x1a607d[_0xa7b1('0x83')]=JSON['parse'](_0x1a607d['conditions']);_0x3c84ad[_0xa7b1('0x3b')](_0x55a82d(_0x1a607d['conditions'][_0xa7b1('0x69')]));}_0x55dfbb=_0x3c84ad[_0xa7b1('0x91')]();_0x3c84ad[_0xa7b1('0x1c')](_0x402e8b);_0x3c84ad[_0xa7b1('0x1a')](0x0);logger[_0xa7b1('0x85')](_0xa7b1('0x86'),_0x3c84ad[_0xa7b1('0x88')]());return dbH[_0xa7b1('0x87')]['query'](_0x3c84ad[_0xa7b1('0x88')](),{'type':dbH[_0xa7b1('0x87')][_0xa7b1('0x89')]['SELECT']});}})[_0xa7b1('0x23')](function(){return{'sql':_0x55dfbb[_0xa7b1('0x88')]()};})[_0xa7b1('0x23')](respondWithResult(_0x85486a,null))['catch'](handleError(_0x85486a,null));}; \ No newline at end of file +var _0xb607=['table','MetricId','replace','function','format','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','select','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT','run','SUM(%s)','metric','debug','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','AnalyticCustomReport','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from'];(function(_0x254883,_0x105ddd){var _0x2099fd=function(_0x2718d5){while(--_0x2718d5){_0x254883['push'](_0x254883['shift']());}};_0x2099fd(++_0x105ddd);}(_0xb607,0x178));var _0x7b60=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb607[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b60('0x1'));var rp=require(_0x7b60('0x2'));var moment=require(_0x7b60('0x3'));var BPromise=require(_0x7b60('0x4'));var Mustache=require(_0x7b60('0x5'));var util=require(_0x7b60('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7b60('0x7'));var ejs=require(_0x7b60('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7b60('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b60('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7b60('0x7'));var querystring=require(_0x7b60('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b60('0xc'));var qs=require(_0x7b60('0xd'));var as=require(_0x7b60('0xe'));var hardwareService=require(_0x7b60('0xf'));var logger=require(_0x7b60('0x10'))(_0x7b60('0x11'));var utils=require(_0x7b60('0x12'));var config=require(_0x7b60('0x13'));var licenseUtil=require(_0x7b60('0x14'));var db=require(_0x7b60('0x15'))['db'];var dbH=require(_0x7b60('0x15'))[_0x7b60('0x16')];function respondWithStatusCode(_0x5d3934,_0x111b68){_0x111b68=_0x111b68||0xcc;return function(_0x555f55){if(_0x555f55){return _0x5d3934[_0x7b60('0x17')](_0x111b68);}return _0x5d3934[_0x7b60('0x18')](_0x111b68)[_0x7b60('0x19')]();};}function respondWithResult(_0x28d049,_0xbb33ff){_0xbb33ff=_0xbb33ff||0xc8;return function(_0x1c1e09){if(_0x1c1e09){return _0x28d049[_0x7b60('0x18')](_0xbb33ff)['json'](_0x1c1e09);}};}function respondWithFilteredResult(_0x2b5d37,_0x3a9d61){return function(_0x50d739){if(_0x50d739){var _0x2ebbd7=typeof _0x3a9d61[_0x7b60('0x1a')]==='undefined'&&typeof _0x3a9d61[_0x7b60('0x1b')]===_0x7b60('0x1c');var _0x5d2008=_0x50d739[_0x7b60('0x1d')];var _0x74f79e=_0x2ebbd7?0x0:_0x3a9d61['offset'];var _0x54a73e=_0x2ebbd7?_0x50d739[_0x7b60('0x1d')]:_0x3a9d61[_0x7b60('0x1a')]+_0x3a9d61[_0x7b60('0x1b')];var _0x1da469;if(_0x54a73e>=_0x5d2008){_0x54a73e=_0x5d2008;_0x1da469=0xc8;}else{_0x1da469=0xce;}_0x2b5d37[_0x7b60('0x18')](_0x1da469);return _0x2b5d37[_0x7b60('0x1e')](_0x7b60('0x1f'),_0x74f79e+'-'+_0x54a73e+'/'+_0x5d2008)[_0x7b60('0x20')](_0x50d739);}return null;};}function patchUpdates(_0x58d600){return function(_0x50dc54){try{jsonpatch[_0x7b60('0x21')](_0x50dc54,_0x58d600,!![]);}catch(_0x4818c8){return BPromise['reject'](_0x4818c8);}return _0x50dc54[_0x7b60('0x22')]();};}function saveUpdates(_0x833464,_0xd247fb){return function(_0x2cbbec){if(_0x2cbbec){return _0x2cbbec[_0x7b60('0x23')](_0x833464)[_0x7b60('0x24')](function(_0x323d0c){return _0x323d0c;});}return null;};}function removeEntity(_0x491b10,_0x225dd7){return function(_0x5e6f86){if(_0x5e6f86){return _0x5e6f86[_0x7b60('0x25')]()['then'](function(){var _0x271582=_0x5e6f86['get']({'plain':!![]});var _0x4ec8d1=_0x7b60('0x26');return db[_0x7b60('0x27')][_0x7b60('0x25')]({'where':{'type':_0x4ec8d1,'resourceId':_0x271582['id']}})[_0x7b60('0x24')](function(){return _0x5e6f86;});})[_0x7b60('0x24')](function(){_0x491b10[_0x7b60('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edf11,_0x2225a7){return function(_0x5b3793){if(!_0x5b3793){_0x5edf11[_0x7b60('0x17')](0x194);}return _0x5b3793;};}function handleError(_0x203798,_0xde6d14){_0xde6d14=_0xde6d14||0x1f4;return function(_0x18f615){logger[_0x7b60('0x28')](_0x18f615[_0x7b60('0x29')]);if(_0x18f615[_0x7b60('0x2a')]){delete _0x18f615[_0x7b60('0x2a')];}_0x203798['status'](_0xde6d14)[_0x7b60('0x2b')](_0x18f615);};}exports[_0x7b60('0x2c')]=function(_0x4d5d42,_0x2ccef1){var _0x4e4bcb={},_0xdcae58={},_0x1a6981={'count':0x0,'rows':[]};var _0x4171a2=_[_0x7b60('0x2d')](db['AnalyticCustomReport'][_0x7b60('0x2e')],function(_0x5788be){return{'name':_0x5788be['fieldName'],'type':_0x5788be[_0x7b60('0x2f')]['key']};});_0xdcae58['model']=_['map'](_0x4171a2,_0x7b60('0x2a'));_0xdcae58[_0x7b60('0x30')]=_[_0x7b60('0x31')](_0x4d5d42[_0x7b60('0x30')]);_0xdcae58[_0x7b60('0x32')]=_[_0x7b60('0x33')](_0xdcae58[_0x7b60('0x34')],_0xdcae58[_0x7b60('0x30')]);_0x4e4bcb['attributes']=_[_0x7b60('0x33')](_0xdcae58[_0x7b60('0x34')],qs['fields'](_0x4d5d42['query'][_0x7b60('0x35')]));_0x4e4bcb[_0x7b60('0x36')]=_0x4e4bcb['attributes'][_0x7b60('0x37')]?_0x4e4bcb[_0x7b60('0x36')]:_0xdcae58[_0x7b60('0x34')];if(!_0x4d5d42[_0x7b60('0x30')][_0x7b60('0x38')](_0x7b60('0x39'))){_0x4e4bcb[_0x7b60('0x1b')]=qs[_0x7b60('0x1b')](_0x4d5d42['query'][_0x7b60('0x1b')]);_0x4e4bcb[_0x7b60('0x1a')]=qs[_0x7b60('0x1a')](_0x4d5d42[_0x7b60('0x30')]['offset']);}_0x4e4bcb['order']=qs[_0x7b60('0x3a')](_0x4d5d42[_0x7b60('0x30')]['sort']);_0x4e4bcb[_0x7b60('0x3b')]=qs[_0x7b60('0x32')](_[_0x7b60('0x3c')](_0x4d5d42[_0x7b60('0x30')],_0xdcae58[_0x7b60('0x32')]),_0x4171a2);if(_0x4d5d42[_0x7b60('0x30')]['filter']){_0x4e4bcb[_0x7b60('0x3b')]=_[_0x7b60('0x3d')](_0x4e4bcb[_0x7b60('0x3b')],{'$or':_[_0x7b60('0x2d')](_0x4171a2,function(_0x4393ff){if(_0x4393ff['type']!==_0x7b60('0x3e')){var _0x554f5c={};_0x554f5c[_0x4393ff[_0x7b60('0x2a')]]={'$like':'%'+_0x4d5d42['query']['filter']+'%'};return _0x554f5c;}})});}_0x4e4bcb=_[_0x7b60('0x3d')]({},_0x4e4bcb,_0x4d5d42[_0x7b60('0x3f')]);var _0xdd0b39={'where':_0x4e4bcb[_0x7b60('0x3b')]};return db['AnalyticCustomReport'][_0x7b60('0x1d')](_0xdd0b39)[_0x7b60('0x24')](function(_0x129aa0){_0x1a6981['count']=_0x129aa0;if(_0x4d5d42['query'][_0x7b60('0x40')]){_0x4e4bcb[_0x7b60('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x7b60('0x42')](_0x4e4bcb);})[_0x7b60('0x24')](function(_0xaf8f5a){_0x1a6981['rows']=_0xaf8f5a;return _0x1a6981;})['then'](respondWithFilteredResult(_0x2ccef1,_0x4e4bcb))[_0x7b60('0x43')](handleError(_0x2ccef1,null));};exports[_0x7b60('0x44')]=function(_0x6c129a,_0x592dce){var _0x436209={'raw':![],'where':{'id':_0x6c129a['params']['id']}},_0x2b9188={};_0x2b9188[_0x7b60('0x34')]=_['keys'](db[_0x7b60('0x45')][_0x7b60('0x2e')]);_0x2b9188[_0x7b60('0x30')]=_[_0x7b60('0x31')](_0x6c129a[_0x7b60('0x30')]);_0x2b9188['filters']=_[_0x7b60('0x33')](_0x2b9188[_0x7b60('0x34')],_0x2b9188[_0x7b60('0x30')]);_0x436209[_0x7b60('0x36')]=_[_0x7b60('0x33')](_0x2b9188[_0x7b60('0x34')],qs[_0x7b60('0x35')](_0x6c129a[_0x7b60('0x30')][_0x7b60('0x35')]));_0x436209[_0x7b60('0x36')]=_0x436209[_0x7b60('0x36')]['length']?_0x436209[_0x7b60('0x36')]:_0x2b9188['model'];if(_0x6c129a[_0x7b60('0x30')]['includeAll']){_0x436209['include']=[{'all':!![]}];}_0x436209=_[_0x7b60('0x3d')]({},_0x436209,_0x6c129a[_0x7b60('0x3f')]);return db['AnalyticCustomReport'][_0x7b60('0x46')](_0x436209)['then'](handleEntityNotFound(_0x592dce,null))[_0x7b60('0x24')](respondWithResult(_0x592dce,null))['catch'](handleError(_0x592dce,null));};exports['create']=function(_0x264e2b,_0x551a57){return db[_0x7b60('0x45')][_0x7b60('0x47')](_0x264e2b[_0x7b60('0x48')],{})[_0x7b60('0x24')](function(_0x52d094){var _0x1b9b5c=_0x264e2b[_0x7b60('0x49')][_0x7b60('0x4a')]({'plain':!![]});if(!_0x1b9b5c)throw new Error(_0x7b60('0x4b'));if(_0x1b9b5c[_0x7b60('0x4c')]===_0x7b60('0x49')){var _0x442637=_0x52d094[_0x7b60('0x4a')]({'plain':!![]});var _0x12c263=_0x7b60('0x4d');return db[_0x7b60('0x4e')][_0x7b60('0x46')]({'where':{'name':_0x12c263,'userProfileId':_0x1b9b5c[_0x7b60('0x4f')]},'raw':!![]})[_0x7b60('0x24')](function(_0x59de9b){if(_0x59de9b&&_0x59de9b[_0x7b60('0x50')]===0x0){return db[_0x7b60('0x27')][_0x7b60('0x47')]({'name':_0x442637['name'],'resourceId':_0x442637['id'],'type':_0x7b60('0x26'),'sectionId':_0x59de9b['id']},{})[_0x7b60('0x24')](function(){return _0x52d094;});}else{return _0x52d094;}})[_0x7b60('0x43')](function(_0x662dcb){logger[_0x7b60('0x28')](_0x7b60('0x51'),_0x662dcb);throw _0x662dcb;});}return _0x52d094;})['then'](respondWithResult(_0x551a57,0xc9))[_0x7b60('0x43')](handleError(_0x551a57,null));};exports[_0x7b60('0x23')]=function(_0x2f9736,_0x4f510b){if(_0x2f9736[_0x7b60('0x48')]['id']){delete _0x2f9736['body']['id'];}return db['AnalyticCustomReport'][_0x7b60('0x46')]({'where':{'id':_0x2f9736[_0x7b60('0x52')]['id']}})[_0x7b60('0x24')](handleEntityNotFound(_0x4f510b,null))['then'](saveUpdates(_0x2f9736['body'],null))[_0x7b60('0x24')](respondWithResult(_0x4f510b,null))['catch'](handleError(_0x4f510b,null));};exports[_0x7b60('0x25')]=function(_0x3373d8,_0x4705a6){return db[_0x7b60('0x45')][_0x7b60('0x46')]({'where':{'id':_0x3373d8[_0x7b60('0x52')]['id']}})[_0x7b60('0x24')](handleEntityNotFound(_0x4705a6,null))[_0x7b60('0x24')](removeEntity(_0x4705a6,null))[_0x7b60('0x43')](handleError(_0x4705a6,null));};exports[_0x7b60('0x53')]=function(_0x1dea45,_0x14b7b3){var _0x207fcf=0xa;var _0x1ca0fa=[_0x7b60('0x54'),_0x7b60('0x55'),_0x7b60('0x56'),_0x7b60('0x57')];var _0x28bb7c={'SUM':'SUM(%s)','COUNT':_0x7b60('0x58'),'COUNT DISTINCT':_0x7b60('0x59'),'MAX':'MAX(%s)','MIN':_0x7b60('0x5a'),'AVG':_0x7b60('0x5b'),'GROUP_CONCAT':_0x7b60('0x5c'),'GROUP_CONCAT ASC':_0x7b60('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x172ab9={'SEC_TO_TIME':_0x7b60('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7b60('0x5f'),'ROUND':_0x7b60('0x60'),'UNIX_TIMESTAMP':_0x7b60('0x61')};var _0x1cc656=function(_0x28f461){return!_[_0x7b60('0x62')]([_0x7b60('0x63'),'IS\x20NOT\x20NULL',_0x7b60('0x64'),'IS\x20NOT\x20EMPTY'],_0x28f461);};var _0x5c8ac8=function(_0x448bc8){if(!_0x448bc8||!_0x448bc8[_0x7b60('0x65')]['length']){return'';}for(var _0x509495='(',_0x36e4ed=0x0;_0x36e4ed<_0x448bc8[_0x7b60('0x65')][_0x7b60('0x37')];_0x36e4ed+=0x1){_0x36e4ed>0x0&&(_0x509495+='\x20'+_0x448bc8[_0x7b60('0x66')]+'\x20');_0x509495+=_0x448bc8[_0x7b60('0x65')][_0x36e4ed][_0x7b60('0x67')]?_0x5c8ac8(_0x448bc8[_0x7b60('0x65')][_0x36e4ed][_0x7b60('0x67')]):_0x448bc8['rules'][_0x36e4ed][_0x7b60('0x68')]+'\x20'+_0x448bc8['rules'][_0x36e4ed][_0x7b60('0x69')]+(_0x1cc656(_0x448bc8[_0x7b60('0x65')][_0x36e4ed][_0x7b60('0x69')])?'\x20'+_0x448bc8['rules'][_0x36e4ed][_0x7b60('0x6a')]:'');}return _0x509495+')';};var _0x363483={'where':{'id':_0x1dea45[_0x7b60('0x52')]['id']}},_0x458bfd,_0x43001f,_0x42b322,_0x137fae,_0xfe861b;_0x363483=_[_0x7b60('0x3d')]({},_0x363483,_0x1dea45[_0x7b60('0x3f')]);return db[_0x7b60('0x45')][_0x7b60('0x46')](_0x363483)[_0x7b60('0x24')](function(_0x4e5e20){if(_0x4e5e20){_0x458bfd=_0x4e5e20;return _0x4e5e20[_0x7b60('0x6b')]();}return null;})[_0x7b60('0x24')](function(_0x33053b){if(_0x33053b){if(!_0x33053b[_0x7b60('0x37')]){throw new db['Sequelize'][(_0x7b60('0x6c'))](_0x7b60('0x6d'),0x193);}_0x43001f=_0x33053b;return db[_0x7b60('0x6e')][_0x7b60('0x42')]({'raw':!![]});}return null;})[_0x7b60('0x24')](function(_0x3e9a73){if(_0x3e9a73){_0x42b322=_[_0x7b60('0x6f')](_0x3e9a73,'id');var _0x1ab738;var _0x48a716=squel['select']();_0x48a716[_0x7b60('0x70')](_0x458bfd[_0x7b60('0x71')]);for(var _0x4f050e=0x0;_0x4f050e<_0x43001f[_0x7b60('0x37')];_0x4f050e+=0x1){_0x1ab738=_0x43001f[_0x4f050e][_0x7b60('0x72')]?_0x42b322[_0x43001f[_0x4f050e][_0x7b60('0x72')]]['metric']:_0x43001f[_0x4f050e][_0x7b60('0x68')];_0x1ab738=_0x43001f[_0x4f050e]['function']?_[_0x7b60('0x73')](_0x28bb7c[_0x43001f[_0x4f050e][_0x7b60('0x74')]],'%s',_0x1ab738):_0x1ab738;_0x1ab738=_0x43001f[_0x4f050e][_0x7b60('0x75')]?_[_0x7b60('0x73')](_0x172ab9[_0x43001f[_0x4f050e][_0x7b60('0x75')]],'%s',_0x1ab738):_0x1ab738;if(_0x43001f[_0x4f050e][_0x7b60('0x76')]){_0x48a716['group'](_0x1ab738);}_0x43001f[_0x4f050e]['orderBy']&&_0x48a716[_0x7b60('0x77')](_0x1ab738,_0x43001f[_0x4f050e][_0x7b60('0x78')]===_0x7b60('0x79')?![]:!![]);_0x48a716[_0x7b60('0x68')](_0x1ab738,_0x43001f[_0x4f050e][_0x7b60('0x7a')]||_0x1ab738);}if(_0x458bfd[_0x7b60('0x7b')]){_0x458bfd['joins']=JSON[_0x7b60('0x7c')](_0x458bfd[_0x7b60('0x7b')]);for(var _0x5aa450=0x0;_0x5aa450<_0x458bfd['joins'][_0x7b60('0x37')];_0x5aa450+=0x1){if(_0x458bfd[_0x7b60('0x7b')][_0x5aa450]['type']&&_[_0x7b60('0x62')](_0x1ca0fa,_0x458bfd['joins'][_0x5aa450][_0x7b60('0x2f')])&&_0x458bfd[_0x7b60('0x7b')][_0x5aa450][_0x7b60('0x7d')]&&_0x458bfd['joins'][_0x5aa450][_0x7b60('0x7e')]&&_0x458bfd[_0x7b60('0x7b')][_0x5aa450]['foreignKey']){_0x48a716[_0x458bfd['joins'][_0x5aa450][_0x7b60('0x2f')]](_0x458bfd['joins'][_0x5aa450]['foreignTable'],null,util[_0x7b60('0x75')](_0x7b60('0x7f'),_0x458bfd[_0x7b60('0x71')],_0x458bfd[_0x7b60('0x7b')][_0x5aa450][_0x7b60('0x7d')],_0x458bfd[_0x7b60('0x7b')][_0x5aa450]['foreignTable'],_0x458bfd[_0x7b60('0x7b')][_0x5aa450][_0x7b60('0x80')]));}}}if(_0x458bfd[_0x7b60('0x81')]){_0x458bfd[_0x7b60('0x81')]=JSON[_0x7b60('0x7c')](_0x458bfd[_0x7b60('0x81')]);_0x48a716[_0x7b60('0x3b')](_0x5c8ac8(_0x458bfd[_0x7b60('0x81')][_0x7b60('0x67')]));}_0xfe861b=_0x48a716[_0x7b60('0x82')]();_0x48a716['limit'](_0x207fcf);_0x48a716[_0x7b60('0x1a')](0x0);logger['debug'](_0x7b60('0x83'),_0x48a716[_0x7b60('0x84')]());return dbH[_0x7b60('0x85')]['query'](_0x48a716[_0x7b60('0x84')](),{'type':dbH[_0x7b60('0x85')]['QueryTypes']['SELECT']});}})[_0x7b60('0x24')](respondWithResult(_0x14b7b3,null))[_0x7b60('0x43')](handleError(_0x14b7b3,null));};function runReport(_0x4f6042,_0x401f02,_0x504fea){var _0x383832=_0x401f02[_0x7b60('0x2a')];var _0x10c693=0xa;var _0x301167=[_0x7b60('0x54'),_0x7b60('0x55'),_0x7b60('0x56'),_0x7b60('0x57')];var _0x4d416c={'SUM':'SUM(%s)','COUNT':_0x7b60('0x58'),'COUNT DISTINCT':_0x7b60('0x59'),'MAX':_0x7b60('0x86'),'MIN':_0x7b60('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7b60('0x87')};var _0xe6bf40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7b60('0x5f'),'ROUND':_0x7b60('0x60'),'UNIX_TIMESTAMP':_0x7b60('0x61')};var _0x303541=function(_0x5540f9){return!_[_0x7b60('0x62')]([_0x7b60('0x63'),_0x7b60('0x88'),_0x7b60('0x64'),_0x7b60('0x89')],_0x5540f9);};var _0x2bf3e7=function(_0x275426){if(!_0x275426||!_0x275426[_0x7b60('0x65')]['length']){return'';}for(var _0x42d5db='(',_0x374932=0x0;_0x374932<_0x275426[_0x7b60('0x65')][_0x7b60('0x37')];_0x374932+=0x1){_0x374932>0x0&&(_0x42d5db+='\x20'+_0x275426[_0x7b60('0x66')]+'\x20');_0x42d5db+=_0x275426[_0x7b60('0x65')][_0x374932][_0x7b60('0x67')]?_0x2bf3e7(_0x275426['rules'][_0x374932][_0x7b60('0x67')]):_0x275426[_0x7b60('0x65')][_0x374932][_0x7b60('0x68')]+'\x20'+_0x275426['rules'][_0x374932]['condition']+(_0x303541(_0x275426[_0x7b60('0x65')][_0x374932][_0x7b60('0x69')])?'\x20'+_0x275426[_0x7b60('0x65')][_0x374932][_0x7b60('0x6a')]:'');}return _0x42d5db+')';};var _0x4c7972={'where':{'id':_0x4f6042['id']}},_0x2d71a5,_0x58fed3,_0x2b9bf7,_0x29f014,_0x19fe68;_0x4c7972=_[_0x7b60('0x3d')]({},_0x4c7972,_0x504fea);return db[_0x7b60('0x45')]['find'](_0x4c7972)[_0x7b60('0x24')](function(_0xc5e61e){if(_0xc5e61e){_0x2d71a5=_0xc5e61e;return _0xc5e61e[_0x7b60('0x6b')]();}return null;})[_0x7b60('0x24')](function(_0x538132){if(_0x538132){if(!_0x538132[_0x7b60('0x37')]){throw new db[(_0x7b60('0x8a'))][(_0x7b60('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x58fed3=_0x538132;return db['AnalyticMetric'][_0x7b60('0x42')]({'raw':!![]});}return null;})[_0x7b60('0x24')](function(_0x5a1089){if(_0x5a1089){_0x2b9bf7=_[_0x7b60('0x6f')](_0x5a1089,'id');var _0x32b00b;var _0x495047=squel[_0x7b60('0x8b')]();_0x495047[_0x7b60('0x70')](_0x2d71a5[_0x7b60('0x71')]);for(var _0x87c52e=0x0;_0x87c52e<_0x58fed3[_0x7b60('0x37')];_0x87c52e+=0x1){_0x32b00b=_0x58fed3[_0x87c52e]['MetricId']?_0x2b9bf7[_0x58fed3[_0x87c52e][_0x7b60('0x72')]]['metric']:_0x58fed3[_0x87c52e][_0x7b60('0x68')];_0x32b00b=_0x58fed3[_0x87c52e][_0x7b60('0x74')]?_[_0x7b60('0x73')](_0x4d416c[_0x58fed3[_0x87c52e][_0x7b60('0x74')]],'%s',_0x32b00b):_0x32b00b;_0x32b00b=_0x58fed3[_0x87c52e][_0x7b60('0x75')]?_[_0x7b60('0x73')](_0xe6bf40[_0x58fed3[_0x87c52e]['format']],'%s',_0x32b00b):_0x32b00b;if(_0x58fed3[_0x87c52e]['groupBy']){_0x495047[_0x7b60('0x67')](_0x32b00b);}_0x58fed3[_0x87c52e]['orderBy']&&_0x495047[_0x7b60('0x77')](_0x32b00b,_0x58fed3[_0x87c52e][_0x7b60('0x78')]===_0x7b60('0x79')?![]:!![]);_0x495047[_0x7b60('0x68')](_0x32b00b,_0x58fed3[_0x87c52e][_0x7b60('0x7a')]||_0x32b00b);}if(_0x2d71a5['joins']){_0x2d71a5['joins']=JSON[_0x7b60('0x7c')](_0x2d71a5[_0x7b60('0x7b')]);for(var _0x533969=0x0;_0x533969<_0x2d71a5[_0x7b60('0x7b')][_0x7b60('0x37')];_0x533969+=0x1){if(_0x2d71a5[_0x7b60('0x7b')][_0x533969]['type']&&_[_0x7b60('0x62')](_0x301167,_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x2f')])&&_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x7d')]&&_0x2d71a5['joins'][_0x533969][_0x7b60('0x7e')]&&_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x80')]){_0x495047[_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x2f')]](_0x2d71a5['joins'][_0x533969][_0x7b60('0x7e')],null,util[_0x7b60('0x75')](_0x7b60('0x7f'),_0x2d71a5[_0x7b60('0x71')],_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x7d')],_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x7e')],_0x2d71a5[_0x7b60('0x7b')][_0x533969][_0x7b60('0x80')]));}}}if(_0x2d71a5[_0x7b60('0x81')]){_0x2d71a5[_0x7b60('0x81')]=JSON[_0x7b60('0x7c')](_0x2d71a5['conditions']);_0x495047[_0x7b60('0x3b')](_0x2bf3e7(_0x2d71a5[_0x7b60('0x81')][_0x7b60('0x67')]));}_0x19fe68=_0x495047[_0x7b60('0x82')]();_0x495047['limit'](_0x10c693);_0x495047[_0x7b60('0x1a')](0x0);return;}})[_0x7b60('0x24')](function(){if(_0x401f02[_0x7b60('0x8c')]===_0x7b60('0x8d')){return null;}var _0x537ae8=_[_0x7b60('0x3d')](_0x401f02,{'name':_0x401f02['fullPath']||_0x401f02['name']||_0x2d71a5['name'],'basename':_0x383832,'savename':util[_0x7b60('0x75')](_0x7b60('0x8e'),_0x401f02[_0x7b60('0x2a')]||_0x2d71a5['name'],require(_0x7b60('0x8f'))[_0x7b60('0x90')](0x4),_0x401f02[_0x7b60('0x8c')]||_0x7b60('0x91')),'reportId':_0x2d71a5['id'],'reportType':_0x7b60('0x92')});return db[_0x7b60('0x93')][_0x7b60('0x47')](_0x537ae8,{'raw':!![]});})[_0x7b60('0x24')](function(_0x1557d4){if(_0x2d71a5[_0x7b60('0x71')]===_0x7b60('0x94')){_0x19fe68[_0x7b60('0x3b')](_0x2d71a5[_0x7b60('0x71')]+_0x7b60('0x95'),_0x401f02['startDate'],_0x401f02[_0x7b60('0x96')]);}else{_0x19fe68[_0x7b60('0x3b')](_0x2d71a5['table']+_0x7b60('0x97'),_0x401f02[_0x7b60('0x98')],_0x401f02[_0x7b60('0x96')]);}if(_0x1557d4){logger['info'](_0x7b60('0x99'),_0x19fe68[_0x7b60('0x84')]());require('child_process')['fork'](path[_0x7b60('0x54')](__dirname,'../../components/export/',_0x1557d4['output']),[_0x1557d4['id'],_0x19fe68[_0x7b60('0x84')](),path[_0x7b60('0x54')](__dirname,_0x7b60('0x9a'),_0x1557d4['savename']),_0x383832]);return _0x1557d4;}else{var _0x141650=squel['select']();_0x141650[_0x7b60('0x70')]('('+_0x19fe68['toString']()+')',_0x7b60('0x9b'));_0x141650['field'](_0x7b60('0x9c'),_0x7b60('0x1d'));_0x19fe68['limit'](_0x401f02[_0x7b60('0x1b')]||_0x10c693);_0x19fe68[_0x7b60('0x1a')](_0x401f02['offset']||0x0);return dbH[_0x7b60('0x85')]['query'](_0x141650[_0x7b60('0x84')](),{'type':dbH[_0x7b60('0x85')][_0x7b60('0x9d')][_0x7b60('0x9e')]})[_0x7b60('0x24')](function(_0x282f81){if(!_0x282f81['length']){_0x29f014=0x0;}else{_0x29f014=_0x282f81[0x0][_0x7b60('0x1d')]||0x0;}return dbH[_0x7b60('0x85')][_0x7b60('0x30')](_0x19fe68['toString'](),{'type':dbH[_0x7b60('0x85')]['QueryTypes'][_0x7b60('0x9e')]});})[_0x7b60('0x24')](function(_0x2552a7){return{'rows':_0x2552a7||[],'count':_0x29f014};});}});}exports[_0x7b60('0x9f')]=function(_0x224898,_0x6baaf){return runReport(_0x224898['params'],_0x224898[_0x7b60('0x30')],_0x224898[_0x7b60('0x3f')])[_0x7b60('0x24')](respondWithResult(_0x6baaf,null))[_0x7b60('0x43')](handleError(_0x6baaf,null));};exports['runReport']=runReport;exports['query']=function(_0xd3b204,_0x5219c1){var _0xfc1eed=0xa;var _0x10c525=[_0x7b60('0x54'),_0x7b60('0x55'),_0x7b60('0x56'),'cross_join'];var _0x22fdf3={'SUM':_0x7b60('0xa0'),'COUNT':_0x7b60('0x58'),'COUNT DISTINCT':_0x7b60('0x59'),'MAX':_0x7b60('0x86'),'MIN':_0x7b60('0x5a'),'AVG':_0x7b60('0x5b'),'GROUP_CONCAT':_0x7b60('0x5c'),'GROUP_CONCAT ASC':_0x7b60('0x5d'),'GROUP_CONCAT DESC':_0x7b60('0x87')};var _0x308608={'SEC_TO_TIME':_0x7b60('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7b60('0x5f'),'ROUND':_0x7b60('0x60'),'UNIX_TIMESTAMP':_0x7b60('0x61')};var _0x27564e=function(_0x59bfaa){return!_[_0x7b60('0x62')](['IS\x20NULL',_0x7b60('0x88'),_0x7b60('0x64'),_0x7b60('0x89')],_0x59bfaa);};var _0x573025=function(_0x55fcd8){if(!_0x55fcd8||!_0x55fcd8[_0x7b60('0x65')][_0x7b60('0x37')]){return'';}for(var _0x440b1e='(',_0x36b80f=0x0;_0x36b80f<_0x55fcd8[_0x7b60('0x65')][_0x7b60('0x37')];_0x36b80f+=0x1){_0x36b80f>0x0&&(_0x440b1e+='\x20'+_0x55fcd8[_0x7b60('0x66')]+'\x20');_0x440b1e+=_0x55fcd8[_0x7b60('0x65')][_0x36b80f][_0x7b60('0x67')]?_0x573025(_0x55fcd8[_0x7b60('0x65')][_0x36b80f]['group']):_0x55fcd8[_0x7b60('0x65')][_0x36b80f][_0x7b60('0x68')]+'\x20'+_0x55fcd8[_0x7b60('0x65')][_0x36b80f][_0x7b60('0x69')]+(_0x27564e(_0x55fcd8[_0x7b60('0x65')][_0x36b80f][_0x7b60('0x69')])?'\x20'+_0x55fcd8[_0x7b60('0x65')][_0x36b80f]['value']:'');}return _0x440b1e+')';};var _0x5e75f0={'where':{'id':_0xd3b204['params']['id']}},_0x81e1f8,_0x2e8937,_0x312452,_0x54d3aa,_0xf43515;_0x5e75f0=_[_0x7b60('0x3d')]({},_0x5e75f0,_0xd3b204[_0x7b60('0x3f')]);return db[_0x7b60('0x45')][_0x7b60('0x46')](_0x5e75f0)[_0x7b60('0x24')](function(_0xdfee26){if(_0xdfee26){_0x81e1f8=_0xdfee26;return _0xdfee26[_0x7b60('0x6b')]();}return null;})[_0x7b60('0x24')](function(_0x5a8919){if(_0x5a8919){if(!_0x5a8919['length']){throw new db[(_0x7b60('0x8a'))][(_0x7b60('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2e8937=_0x5a8919;return db[_0x7b60('0x6e')][_0x7b60('0x42')]({'raw':!![]});}return null;})['then'](function(_0xc2a870){if(_0xc2a870){_0x312452=_[_0x7b60('0x6f')](_0xc2a870,'id');var _0x39a763;var _0x4affc2=squel[_0x7b60('0x8b')]();_0x4affc2[_0x7b60('0x70')](_0x81e1f8[_0x7b60('0x71')]);for(var _0x16a3e8=0x0;_0x16a3e8<_0x2e8937[_0x7b60('0x37')];_0x16a3e8+=0x1){_0x39a763=_0x2e8937[_0x16a3e8][_0x7b60('0x72')]?_0x312452[_0x2e8937[_0x16a3e8]['MetricId']][_0x7b60('0xa1')]:_0x2e8937[_0x16a3e8][_0x7b60('0x68')];_0x39a763=_0x2e8937[_0x16a3e8][_0x7b60('0x74')]?_['replace'](_0x22fdf3[_0x2e8937[_0x16a3e8][_0x7b60('0x74')]],'%s',_0x39a763):_0x39a763;_0x39a763=_0x2e8937[_0x16a3e8][_0x7b60('0x75')]?_[_0x7b60('0x73')](_0x308608[_0x2e8937[_0x16a3e8][_0x7b60('0x75')]],'%s',_0x39a763):_0x39a763;if(_0x2e8937[_0x16a3e8][_0x7b60('0x76')]){_0x4affc2['group'](_0x39a763);}_0x2e8937[_0x16a3e8][_0x7b60('0x78')]&&_0x4affc2[_0x7b60('0x77')](_0x39a763,_0x2e8937[_0x16a3e8][_0x7b60('0x78')]==='DESC'?![]:!![]);_0x4affc2[_0x7b60('0x68')](_0x39a763,_0x2e8937[_0x16a3e8][_0x7b60('0x7a')]||_0x39a763);}if(_0x81e1f8['joins']){_0x81e1f8[_0x7b60('0x7b')]=JSON[_0x7b60('0x7c')](_0x81e1f8[_0x7b60('0x7b')]);for(var _0x367e9b=0x0;_0x367e9b<_0x81e1f8['joins']['length'];_0x367e9b+=0x1){if(_0x81e1f8[_0x7b60('0x7b')][_0x367e9b][_0x7b60('0x2f')]&&_['includes'](_0x10c525,_0x81e1f8[_0x7b60('0x7b')][_0x367e9b]['type'])&&_0x81e1f8[_0x7b60('0x7b')][_0x367e9b][_0x7b60('0x7d')]&&_0x81e1f8[_0x7b60('0x7b')][_0x367e9b][_0x7b60('0x7e')]&&_0x81e1f8['joins'][_0x367e9b]['foreignKey']){_0x4affc2[_0x81e1f8[_0x7b60('0x7b')][_0x367e9b]['type']](_0x81e1f8[_0x7b60('0x7b')][_0x367e9b][_0x7b60('0x7e')],null,util['format'](_0x7b60('0x7f'),_0x81e1f8['table'],_0x81e1f8[_0x7b60('0x7b')][_0x367e9b][_0x7b60('0x7d')],_0x81e1f8['joins'][_0x367e9b]['foreignTable'],_0x81e1f8[_0x7b60('0x7b')][_0x367e9b]['foreignKey']));}}}if(_0x81e1f8[_0x7b60('0x81')]){_0x81e1f8[_0x7b60('0x81')]=JSON[_0x7b60('0x7c')](_0x81e1f8[_0x7b60('0x81')]);_0x4affc2['where'](_0x573025(_0x81e1f8[_0x7b60('0x81')][_0x7b60('0x67')]));}_0xf43515=_0x4affc2['clone']();_0x4affc2[_0x7b60('0x1b')](_0xfc1eed);_0x4affc2[_0x7b60('0x1a')](0x0);logger[_0x7b60('0xa2')](_0x7b60('0x83'),_0x4affc2[_0x7b60('0x84')]());return dbH['sequelize'][_0x7b60('0x30')](_0x4affc2[_0x7b60('0x84')](),{'type':dbH['sequelize'][_0x7b60('0x9d')][_0x7b60('0x9e')]});}})[_0x7b60('0x24')](function(){return{'sql':_0xf43515[_0x7b60('0x84')]()};})[_0x7b60('0x24')](respondWithResult(_0x5219c1,null))[_0x7b60('0x43')](handleError(_0x5219c1,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 07a3480..7c15d4b 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 _0x9865=['rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x109333,_0x5ce132){var _0x7eb389=function(_0x55b2fd){while(--_0x55b2fd){_0x109333['push'](_0x109333['shift']());}};_0x7eb389(++_0x5ce132);}(_0x9865,0x119));var _0x5986=function(_0x269c57,_0x3a16cf){_0x269c57=_0x269c57-0x0;var _0x48053b=_0x9865[_0x269c57];return _0x48053b;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require('moment');var BPromise=require(_0x5986('0x4'));var rp=require(_0x5986('0x5'));var fs=require('fs');var path=require(_0x5986('0x6'));var rimraf=require(_0x5986('0x7'));var config=require(_0x5986('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x5986('0x9')]=function(_0x56a54d,_0x3df583){return _0x56a54d['define'](_0x5986('0xa'),attributes,{'tableName':_0x5986('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0833=['../../config/logger','bluebird','request-promise','path','../../config/environment','define','AnalyticCustomReport','lodash','util'];(function(_0x24fca2,_0x5857d8){var _0x5edea5=function(_0x5049e0){while(--_0x5049e0){_0x24fca2['push'](_0x24fca2['shift']());}};_0x5edea5(++_0x5857d8);}(_0x0833,0x193));var _0x3083=function(_0xf4bb0d,_0x250351){_0xf4bb0d=_0xf4bb0d-0x0;var _0x255382=_0x0833[_0xf4bb0d];return _0x255382;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var logger=require(_0x3083('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3083('0x3'));var rp=require(_0x3083('0x4'));var fs=require('fs');var path=require(_0x3083('0x5'));var rimraf=require('rimraf');var config=require(_0x3083('0x6'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x2af34b,_0x1faae5){return _0x2af34b[_0x3083('0x7')](_0x3083('0x8'),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 f2af540..bc4c487 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 _0x8c5e=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8c5e,0xb9));var _0xe8c5=function(_0x1baf26,_0x28cc75){_0x1baf26=_0x1baf26-0x0;var _0x275a68=_0x8c5e[_0x1baf26];return _0x275a68;};'use strict';var _=require(_0xe8c5('0x0'));var util=require(_0xe8c5('0x1'));var moment=require(_0xe8c5('0x2'));var BPromise=require(_0xe8c5('0x3'));var rs=require(_0xe8c5('0x4'));var fs=require('fs');var Redis=require(_0xe8c5('0x5'));var db=require(_0xe8c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8c5('0x7'))('rpc');var config=require(_0xe8c5('0x8'));var jayson=require(_0xe8c5('0x9'));var client=jayson[_0xe8c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xad7d4c,_0x299b87,_0x12ca68){return new BPromise(function(_0x209192,_0x4d045f){return client[_0xe8c5('0xb')](_0xad7d4c,_0x12ca68)[_0xe8c5('0xc')](function(_0x1801c6){logger['info'](_0xe8c5('0xd'),_0x299b87,_0xe8c5('0xe'));logger['debug'](_0xe8c5('0xf'),_0x299b87,_0xe8c5('0xe'),JSON[_0xe8c5('0x10')](_0x1801c6));if(_0x1801c6[_0xe8c5('0x11')]){if(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x12')]===0x1f4){logger[_0xe8c5('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x299b87,_0x1801c6[_0xe8c5('0x11')]['message']);return _0x4d045f(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);}logger[_0xe8c5('0x11')](_0xe8c5('0xd'),_0x299b87,_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);return _0x209192(_0x1801c6[_0xe8c5('0x11')][_0xe8c5('0x13')]);}else{logger['info'](_0xe8c5('0xd'),_0x299b87,_0xe8c5('0xe'));_0x209192(_0x1801c6[_0xe8c5('0x14')][_0xe8c5('0x13')]);}})['catch'](function(_0x263ae6){logger[_0xe8c5('0x11')](_0xe8c5('0xd'),_0x299b87,_0x263ae6);_0x4d045f(_0x263ae6);});});} \ No newline at end of file +var _0x584a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1971de,_0x32d201){var _0x3e5070=function(_0x154df3){while(--_0x154df3){_0x1971de['push'](_0x1971de['shift']());}};_0x3e5070(++_0x32d201);}(_0x584a,0xa8));var _0xa584=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x584a[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require(_0xa584('0x3'));var rs=require(_0xa584('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa584('0x5'))['db'];var utils=require(_0xa584('0x6'));var logger=require(_0xa584('0x7'))(_0xa584('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa584('0x9')][_0xa584('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f0828,_0x56c38d,_0x39db38){return new BPromise(function(_0x48e414,_0x2ffdae){return client['request'](_0x6f0828,_0x39db38)[_0xa584('0xb')](function(_0x84b7d0){logger[_0xa584('0xc')](_0xa584('0xd'),_0x56c38d,_0xa584('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x56c38d,_0xa584('0xe'),JSON[_0xa584('0xf')](_0x84b7d0));if(_0x84b7d0[_0xa584('0x10')]){if(_0x84b7d0[_0xa584('0x10')][_0xa584('0x11')]===0x1f4){logger[_0xa584('0x10')](_0xa584('0xd'),_0x56c38d,_0x84b7d0['error'][_0xa584('0x12')]);return _0x2ffdae(_0x84b7d0[_0xa584('0x10')][_0xa584('0x12')]);}logger[_0xa584('0x10')](_0xa584('0xd'),_0x56c38d,_0x84b7d0[_0xa584('0x10')][_0xa584('0x12')]);return _0x48e414(_0x84b7d0['error'][_0xa584('0x12')]);}else{logger[_0xa584('0xc')](_0xa584('0xd'),_0x56c38d,_0xa584('0xe'));_0x48e414(_0x84b7d0[_0xa584('0x13')][_0xa584('0x12')]);}})[_0xa584('0x14')](function(_0x541d59){logger[_0xa584('0x10')](_0xa584('0xd'),_0x56c38d,_0x541d59);_0x2ffdae(_0x541d59);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2159bf0..f86e3da 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 _0x35a2=['post','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x345829,_0x5f4b7d){var _0x43ec1e=function(_0x5a93eb){while(--_0x5a93eb){_0x345829['push'](_0x345829['shift']());}};_0x43ec1e(++_0x5f4b7d);}(_0x35a2,0xdd));var _0x235a=function(_0x21535f,_0xebb00c){_0x21535f=_0x21535f-0x0;var _0x1ca658=_0x35a2[_0x21535f];return _0x1ca658;};'use strict';var multer=require(_0x235a('0x0'));var util=require(_0x235a('0x1'));var path=require(_0x235a('0x2'));var timeout=require(_0x235a('0x3'));var express=require(_0x235a('0x4'));var router=express[_0x235a('0x5')]();var fs_extra=require(_0x235a('0x6'));var auth=require(_0x235a('0x7'));var interaction=require(_0x235a('0x8'));var config=require(_0x235a('0x9'));var controller=require(_0x235a('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x235a('0xb')]('/:id',auth[_0x235a('0xc')](),controller['show']);router['get'](_0x235a('0xd'),auth[_0x235a('0xc')](),controller[_0x235a('0xe')]);router[_0x235a('0xb')](_0x235a('0xf'),auth['isAuthenticated'](),controller[_0x235a('0x10')]);router[_0x235a('0xb')](_0x235a('0x11'),auth[_0x235a('0xc')](),controller[_0x235a('0x12')]);router[_0x235a('0x13')]('/',auth[_0x235a('0xc')](),controller[_0x235a('0x14')]);router['put'](_0x235a('0x15'),auth[_0x235a('0xc')](),controller['update']);router[_0x235a('0x16')](_0x235a('0x15'),auth[_0x235a('0xc')](),controller['destroy']);module[_0x235a('0x17')]=router; \ No newline at end of file +var _0x2613=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','post','create','update','delete','destroy'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x2613,0x1e3));var _0x3261=function(_0x246746,_0x50853d){_0x246746=_0x246746-0x0;var _0x5d3c33=_0x2613[_0x246746];return _0x5d3c33;};'use strict';var multer=require(_0x3261('0x0'));var util=require(_0x3261('0x1'));var path=require('path');var timeout=require(_0x3261('0x2'));var express=require(_0x3261('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3261('0x4'));var interaction=require(_0x3261('0x5'));var config=require(_0x3261('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3261('0x7')]);router[_0x3261('0x8')](_0x3261('0x9'),auth[_0x3261('0xa')](),controller[_0x3261('0xb')]);router[_0x3261('0x8')](_0x3261('0xc'),auth[_0x3261('0xa')](),controller[_0x3261('0xd')]);router['get'](_0x3261('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x3261('0x8')](_0x3261('0xf'),auth[_0x3261('0xa')](),controller['query']);router[_0x3261('0x10')]('/',auth[_0x3261('0xa')](),controller[_0x3261('0x11')]);router['put'](_0x3261('0x9'),auth[_0x3261('0xa')](),controller[_0x3261('0x12')]);router[_0x3261('0x13')](_0x3261('0x9'),auth[_0x3261('0xa')](),controller[_0x3261('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7616839..a087320 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x4a36d1,_0x136a98){var _0x448b2e=function(_0x4702f5){while(--_0x4702f5){_0x4a36d1['push'](_0x4a36d1['shift']());}};_0x448b2e(++_0x136a98);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3a04e2,_0x30acc0){_0x3a04e2=_0x3a04e2-0x0;var _0x258fe8=_0x3f8a[_0x3a04e2];return _0x258fe8;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2eb2[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'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 a46c6cd..48bbef9 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x57b318,_0x6a293b){var _0x422950=function(_0x550d71){while(--_0x550d71){_0x57b318['push'](_0x57b318['shift']());}};_0x422950(++_0x6a293b);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ac992,_0x37c877){_0x2ac992=_0x2ac992-0x0;var _0x223c9d=_0x5fab[_0x2ac992];return _0x223c9d;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file +var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x42a27f,_0x46485e){var _0x50eb0c=function(_0x36bf52){while(--_0x36bf52){_0x42a27f['push'](_0x42a27f['shift']());}};_0x50eb0c(++_0x46485e);}(_0x5fab,0x177));var _0xb5fa=function(_0x1c0261,_0xbe62af){_0x1c0261=_0x1c0261-0x0;var _0x1f81d0=_0x5fab[_0x1c0261];return _0x1f81d0;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5568f20..5177ee0 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 _0xc33d=['path','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xc33d,0xcc));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc33('0x0'));var util=require('util');var logger=require(_0xdc33('0x1'))(_0xdc33('0x2'));var moment=require(_0xdc33('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc33('0x4'));var fs=require('fs');var path=require(_0xdc33('0x5'));var rimraf=require('rimraf');var config=require(_0xdc33('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0xdc33('0x7')]=function(_0x24c1c7,_0x5de3da){return _0x24c1c7[_0xdc33('0x8')](_0xdc33('0x9'),attributes,{'tableName':_0xdc33('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b2=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a225c,_0x10eb34){var _0x5d1c4f=function(_0x2cc795){while(--_0x2cc795){_0x4a225c['push'](_0x4a225c['shift']());}};_0x5d1c4f(++_0x10eb34);}(_0xc9b2,0x1d7));var _0x2c9b=function(_0x53d3b8,_0x25f3ac){_0x53d3b8=_0x53d3b8-0x0;var _0x3ed0c2=_0xc9b2[_0x53d3b8];return _0x3ed0c2;};'use strict';var _=require(_0x2c9b('0x0'));var util=require(_0x2c9b('0x1'));var logger=require(_0x2c9b('0x2'))(_0x2c9b('0x3'));var moment=require(_0x2c9b('0x4'));var BPromise=require(_0x2c9b('0x5'));var rp=require(_0x2c9b('0x6'));var fs=require('fs');var path=require(_0x2c9b('0x7'));var rimraf=require(_0x2c9b('0x8'));var config=require(_0x2c9b('0x9'));var attributes=require(_0x2c9b('0xa'));module['exports']=function(_0x44c22c,_0x4a8394){return _0x44c22c[_0x2c9b('0xb')](_0x2c9b('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index cd3b5a8..9269ba9 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 _0x222b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0xa65c05,_0x3cd2cf){var _0x476c4a=function(_0x291b73){while(--_0x291b73){_0xa65c05['push'](_0xa65c05['shift']());}};_0x476c4a(++_0x3cd2cf);}(_0x222b,0xfc));var _0xb222=function(_0x2332e1,_0x433415){_0x2332e1=_0x2332e1-0x0;var _0x2c3bda=_0x222b[_0x2332e1];return _0x2c3bda;};'use strict';var _=require(_0xb222('0x0'));var util=require(_0xb222('0x1'));var moment=require('moment');var BPromise=require(_0xb222('0x2'));var rs=require(_0xb222('0x3'));var fs=require('fs');var Redis=require(_0xb222('0x4'));var db=require(_0xb222('0x5'))['db'];var utils=require(_0xb222('0x6'));var logger=require(_0xb222('0x7'))(_0xb222('0x8'));var config=require(_0xb222('0x9'));var jayson=require(_0xb222('0xa'));var client=jayson[_0xb222('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x329639,_0x4989a0,_0x5c4d59){return new BPromise(function(_0x470918,_0x42264b){return client['request'](_0x329639,_0x5c4d59)[_0xb222('0xc')](function(_0x1af154){logger['info'](_0xb222('0xd'),_0x4989a0,_0xb222('0xe'));logger[_0xb222('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4989a0,_0xb222('0xe'),JSON[_0xb222('0x10')](_0x1af154));if(_0x1af154[_0xb222('0x11')]){if(_0x1af154[_0xb222('0x11')][_0xb222('0x12')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4989a0,_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);return _0x42264b(_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);}logger['error'](_0xb222('0xd'),_0x4989a0,_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);return _0x470918(_0x1af154[_0xb222('0x11')][_0xb222('0x13')]);}else{logger[_0xb222('0x14')](_0xb222('0xd'),_0x4989a0,'request\x20sent');_0x470918(_0x1af154[_0xb222('0x15')][_0xb222('0x13')]);}})[_0xb222('0x16')](function(_0x475b07){logger[_0xb222('0x11')](_0xb222('0xd'),_0x4989a0,_0x475b07);_0x42264b(_0x475b07);});});} \ No newline at end of file +var _0x2303=['info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x1bc25c,_0x15104a){var _0x37fb35=function(_0x11c97b){while(--_0x11c97b){_0x1bc25c['push'](_0x1bc25c['shift']());}};_0x37fb35(++_0x15104a);}(_0x2303,0x1d8));var _0x3230=function(_0xb8ead3,_0x37dccf){_0xb8ead3=_0xb8ead3-0x0;var _0x4bc946=_0x2303[_0xb8ead3];return _0x4bc946;};'use strict';var _=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var moment=require(_0x3230('0x2'));var BPromise=require(_0x3230('0x3'));var rs=require(_0x3230('0x4'));var fs=require('fs');var Redis=require(_0x3230('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3230('0x6'));var logger=require(_0x3230('0x7'))(_0x3230('0x8'));var config=require(_0x3230('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3230('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1011b1,_0x1f0608,_0x494b15){return new BPromise(function(_0x2b5b19,_0x55487b){return client[_0x3230('0xb')](_0x1011b1,_0x494b15)['then'](function(_0x5b0cae){logger[_0x3230('0xc')](_0x3230('0xd'),_0x1f0608,'request\x20sent');logger[_0x3230('0xe')](_0x3230('0xf'),_0x1f0608,_0x3230('0x10'),JSON[_0x3230('0x11')](_0x5b0cae));if(_0x5b0cae[_0x3230('0x12')]){if(_0x5b0cae['error'][_0x3230('0x13')]===0x1f4){logger[_0x3230('0x12')](_0x3230('0xd'),_0x1f0608,_0x5b0cae['error'][_0x3230('0x14')]);return _0x55487b(_0x5b0cae[_0x3230('0x12')][_0x3230('0x14')]);}logger[_0x3230('0x12')](_0x3230('0xd'),_0x1f0608,_0x5b0cae[_0x3230('0x12')][_0x3230('0x14')]);return _0x2b5b19(_0x5b0cae['error'][_0x3230('0x14')]);}else{logger[_0x3230('0xc')](_0x3230('0xd'),_0x1f0608,'request\x20sent');_0x2b5b19(_0x5b0cae['result'][_0x3230('0x14')]);}})[_0x3230('0x15')](function(_0x4354e0){logger[_0x3230('0x12')](_0x3230('0xd'),_0x1f0608,_0x4354e0);_0x55487b(_0x4354e0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 646ec0a..fbd0064 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 _0x5a59=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a59,0xb6));var _0x95a5=function(_0x13ee72,_0x5f0bb6){_0x13ee72=_0x13ee72-0x0;var _0x5d3d3d=_0x5a59[_0x13ee72];return _0x5d3d3d;};'use strict';var multer=require(_0x95a5('0x0'));var util=require('util');var path=require(_0x95a5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95a5('0x2')]();var fs_extra=require(_0x95a5('0x3'));var auth=require(_0x95a5('0x4'));var interaction=require(_0x95a5('0x5'));var config=require(_0x95a5('0x6'));var controller=require(_0x95a5('0x7'));router[_0x95a5('0x8')]('/',auth[_0x95a5('0x9')](),controller['index']);router[_0x95a5('0x8')](_0x95a5('0xa'),auth[_0x95a5('0x9')](),controller[_0x95a5('0xb')]);router[_0x95a5('0x8')](_0x95a5('0xc'),auth[_0x95a5('0x9')](),controller[_0x95a5('0xd')]);router[_0x95a5('0x8')](_0x95a5('0xe'),auth[_0x95a5('0x9')](),controller['run']);router[_0x95a5('0x8')](_0x95a5('0xf'),auth[_0x95a5('0x9')](),controller[_0x95a5('0x10')]);router[_0x95a5('0x11')]('/',auth['isAuthenticated'](),controller[_0x95a5('0x12')]);router[_0x95a5('0x13')](_0x95a5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x95a5('0x14')](_0x95a5('0xa'),auth[_0x95a5('0x9')](),controller[_0x95a5('0x15')]);module[_0x95a5('0x16')]=router; \ No newline at end of file +var _0xa7ad=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','update'];(function(_0x59aeb3,_0x32f513){var _0x3c6521=function(_0x1129b2){while(--_0x1129b2){_0x59aeb3['push'](_0x59aeb3['shift']());}};_0x3c6521(++_0x32f513);}(_0xa7ad,0x168));var _0xda7a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xa7ad[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0xda7a('0x0'));var util=require(_0xda7a('0x1'));var path=require('path');var timeout=require(_0xda7a('0x2'));var express=require(_0xda7a('0x3'));var router=express[_0xda7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda7a('0x5'));var interaction=require(_0xda7a('0x6'));var config=require('../../config/environment');var controller=require(_0xda7a('0x7'));router[_0xda7a('0x8')]('/',auth[_0xda7a('0x9')](),controller['index']);router[_0xda7a('0x8')](_0xda7a('0xa'),auth[_0xda7a('0x9')](),controller[_0xda7a('0xb')]);router[_0xda7a('0x8')](_0xda7a('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0xda7a('0x8')](_0xda7a('0xd'),auth[_0xda7a('0x9')](),controller[_0xda7a('0xe')]);router['get'](_0xda7a('0xf'),auth[_0xda7a('0x9')](),controller[_0xda7a('0x10')]);router['post']('/',auth[_0xda7a('0x9')](),controller['create']);router['put'](_0xda7a('0xa'),auth[_0xda7a('0x9')](),controller[_0xda7a('0x11')]);router[_0xda7a('0x12')](_0xda7a('0xa'),auth[_0xda7a('0x9')](),controller[_0xda7a('0x13')]);module[_0xda7a('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 3048998..bed7a5d 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 _0xbef2=['ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x280a6b,_0x3fcc0f){var _0x54f242=function(_0x3975d3){while(--_0x3975d3){_0x280a6b['push'](_0x280a6b['shift']());}};_0x54f242(++_0x3fcc0f);}(_0xbef2,0xa5));var _0x2bef=function(_0x536d72,_0x21e536){_0x536d72=_0x536d72-0x0;var _0x1df130=_0xbef2[_0x536d72];return _0x1df130;};'use strict';var Sequelize=require(_0x2bef('0x0'));var moment=require('moment');module[_0x2bef('0x1')]={'name':{'type':Sequelize[_0x2bef('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2bef('0x3')](_0x2bef('0x4'),'pdf',_0x2bef('0x5')),'allowNull':![],'defaultValue':_0x2bef('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2bef('0x6')]},'endDate':{'type':Sequelize[_0x2bef('0x6')]},'status':{'type':Sequelize[_0x2bef('0x2')],'defaultValue':_0x2bef('0x7')},'type':{'type':Sequelize[_0x2bef('0x3')](_0x2bef('0x8'),_0x2bef('0x9')),'allowNull':![],'defaultValue':_0x2bef('0x8')},'reportId':{'type':Sequelize[_0x2bef('0xa')](0xb)[_0x2bef('0xb')]},'reportType':{'type':Sequelize[_0x2bef('0x2')]}}; \ No newline at end of file +var _0xc6e3=['manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','csv','DATE','Loading'];(function(_0x459ca1,_0x1b1228){var _0x31ce3c=function(_0x15585c){while(--_0x15585c){_0x459ca1['push'](_0x459ca1['shift']());}};_0x31ce3c(++_0x1b1228);}(_0xc6e3,0x93));var _0x3c6e=function(_0x34644a,_0x3e97c6){_0x34644a=_0x34644a-0x0;var _0x3a153f=_0xc6e3[_0x34644a];return _0x3a153f;};'use strict';var Sequelize=require(_0x3c6e('0x0'));var moment=require('moment');module[_0x3c6e('0x1')]={'name':{'type':Sequelize[_0x3c6e('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3c6e('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3c6e('0x3')]('csv',_0x3c6e('0x4'),_0x3c6e('0x5')),'allowNull':![],'defaultValue':_0x3c6e('0x6')},'savename':{'type':Sequelize[_0x3c6e('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3c6e('0x7')]},'endDate':{'type':Sequelize[_0x3c6e('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x3c6e('0x8')},'type':{'type':Sequelize[_0x3c6e('0x3')](_0x3c6e('0x9'),_0x3c6e('0xa')),'allowNull':![],'defaultValue':_0x3c6e('0x9')},'reportId':{'type':Sequelize[_0x3c6e('0xb')](0xb)[_0x3c6e('0xc')]},'reportType':{'type':Sequelize[_0x3c6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 3cb9a72..cecb898 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 _0x4a81=['fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','end','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x2301b4,_0x2ef5b0){var _0x12da2b=function(_0xee491e){while(--_0xee491e){_0x2301b4['push'](_0x2301b4['shift']());}};_0x12da2b(++_0x2ef5b0);}(_0x4a81,0x1b6));var _0x14a8=function(_0x1d2db6,_0x122a80){_0x1d2db6=_0x1d2db6-0x0;var _0x56c5cf=_0x4a81[_0x1d2db6];return _0x56c5cf;};'use strict';var emlformat=require(_0x14a8('0x0'));var rimraf=require(_0x14a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14a8('0x2'));var rp=require(_0x14a8('0x3'));var moment=require('moment');var BPromise=require(_0x14a8('0x4'));var Mustache=require(_0x14a8('0x5'));var util=require(_0x14a8('0x6'));var path=require(_0x14a8('0x7'));var sox=require(_0x14a8('0x8'));var csv=require('to-csv');var ejs=require(_0x14a8('0x9'));var fs=require('fs');var fs_extra=require(_0x14a8('0xa'));var _=require(_0x14a8('0xb'));var squel=require('squel');var crypto=require(_0x14a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x14a8('0xd'));var toCsv=require(_0x14a8('0xe'));var querystring=require(_0x14a8('0xf'));var Papa=require(_0x14a8('0x10'));var Redis=require(_0x14a8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14a8('0x12'));var as=require(_0x14a8('0x13'));var hardwareService=require(_0x14a8('0x14'));var logger=require(_0x14a8('0x15'))(_0x14a8('0x16'));var utils=require(_0x14a8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x426d8b,_0x26de95){_0x26de95=_0x26de95||0xcc;return function(_0x3c63d8){if(_0x3c63d8){return _0x426d8b[_0x14a8('0x18')](_0x26de95);}return _0x426d8b[_0x14a8('0x19')](_0x26de95)['end']();};}function respondWithResult(_0x1fe8b5,_0x594e02){_0x594e02=_0x594e02||0xc8;return function(_0x4b2b4e){if(_0x4b2b4e){return _0x1fe8b5[_0x14a8('0x19')](_0x594e02)[_0x14a8('0x1a')](_0x4b2b4e);}};}function respondWithFilteredResult(_0xbaffcc,_0x38865c){return function(_0x3272c1){if(_0x3272c1){var _0x38874f=typeof _0x38865c['offset']===_0x14a8('0x1b')&&typeof _0x38865c['limit']===_0x14a8('0x1b');var _0x9bf079=_0x3272c1[_0x14a8('0x1c')];var _0x42b17c=_0x38874f?0x0:_0x38865c[_0x14a8('0x1d')];var _0x40b227=_0x38874f?_0x3272c1[_0x14a8('0x1c')]:_0x38865c[_0x14a8('0x1d')]+_0x38865c['limit'];var _0x252043;if(_0x40b227>=_0x9bf079){_0x40b227=_0x9bf079;_0x252043=0xc8;}else{_0x252043=0xce;}_0xbaffcc[_0x14a8('0x19')](_0x252043);return _0xbaffcc[_0x14a8('0x1e')](_0x14a8('0x1f'),_0x42b17c+'-'+_0x40b227+'/'+_0x9bf079)['json'](_0x3272c1);}return null;};}function patchUpdates(_0x52a282){return function(_0x458683){try{jsonpatch[_0x14a8('0x20')](_0x458683,_0x52a282,!![]);}catch(_0x5b4156){return BPromise[_0x14a8('0x21')](_0x5b4156);}return _0x458683[_0x14a8('0x22')]();};}function saveUpdates(_0x470b92,_0x16ce61){return function(_0x43c7cf){if(_0x43c7cf){return _0x43c7cf[_0x14a8('0x23')](_0x470b92)['then'](function(_0xa0954){return _0xa0954;});}return null;};}function removeEntity(_0x4ca6e9,_0x1a5969){return function(_0x30de37){if(_0x30de37){return _0x30de37[_0x14a8('0x24')]()[_0x14a8('0x25')](function(){var _0x20275e=_0x30de37[_0x14a8('0x26')]({'plain':!![]});var _0x1e2b64=_0x14a8('0x27');return db[_0x14a8('0x28')][_0x14a8('0x24')]({'where':{'type':_0x1e2b64,'resourceId':_0x20275e['id']}})[_0x14a8('0x25')](function(){return _0x30de37;});})[_0x14a8('0x25')](function(){_0x4ca6e9[_0x14a8('0x19')](0xcc)[_0x14a8('0x29')]();});}};}function handleEntityNotFound(_0x2a4799,_0x23fea3){return function(_0x1e8d91){if(!_0x1e8d91){_0x2a4799['sendStatus'](0x194);}return _0x1e8d91;};}function handleError(_0x2c2931,_0x38b2e5){_0x38b2e5=_0x38b2e5||0x1f4;return function(_0x3072b8){logger['error'](_0x3072b8[_0x14a8('0x2a')]);if(_0x3072b8['name']){delete _0x3072b8[_0x14a8('0x2b')];}_0x2c2931['status'](_0x38b2e5)[_0x14a8('0x2c')](_0x3072b8);};}exports[_0x14a8('0x2d')]=function(_0x5339e3,_0x4e70c9){var _0x195f82={},_0x14fdf3={},_0x4a5a58={'count':0x0,'rows':[]};var _0x5bedb2=_[_0x14a8('0x2e')](db[_0x14a8('0x2f')][_0x14a8('0x30')],function(_0x5e7c3b){return{'name':_0x5e7c3b[_0x14a8('0x31')],'type':_0x5e7c3b[_0x14a8('0x32')]['key']};});_0x14fdf3[_0x14a8('0x33')]=_['map'](_0x5bedb2,_0x14a8('0x2b'));_0x14fdf3[_0x14a8('0x34')]=_[_0x14a8('0x35')](_0x5339e3['query']);_0x14fdf3[_0x14a8('0x36')]=_[_0x14a8('0x37')](_0x14fdf3[_0x14a8('0x33')],_0x14fdf3[_0x14a8('0x34')]);_0x195f82[_0x14a8('0x38')]=_['intersection'](_0x14fdf3[_0x14a8('0x33')],qs[_0x14a8('0x39')](_0x5339e3['query'][_0x14a8('0x39')]));_0x195f82[_0x14a8('0x38')]=_0x195f82[_0x14a8('0x38')]['length']?_0x195f82[_0x14a8('0x38')]:_0x14fdf3[_0x14a8('0x33')];if(!_0x5339e3[_0x14a8('0x34')][_0x14a8('0x3a')](_0x14a8('0x3b'))){_0x195f82[_0x14a8('0x3c')]=qs[_0x14a8('0x3c')](_0x5339e3[_0x14a8('0x34')]['limit']);_0x195f82['offset']=qs[_0x14a8('0x1d')](_0x5339e3[_0x14a8('0x34')][_0x14a8('0x1d')]);}_0x195f82[_0x14a8('0x3d')]=qs[_0x14a8('0x3e')](_0x5339e3[_0x14a8('0x34')][_0x14a8('0x3e')]);_0x195f82['where']=qs[_0x14a8('0x36')](_['pick'](_0x5339e3['query'],_0x14fdf3['filters']),_0x5bedb2);if(_0x5339e3[_0x14a8('0x34')]['filter']){_0x195f82[_0x14a8('0x3f')]=_[_0x14a8('0x40')](_0x195f82[_0x14a8('0x3f')],{'$or':_[_0x14a8('0x2e')](_0x5bedb2,function(_0x727302){if(_0x727302[_0x14a8('0x32')]!==_0x14a8('0x41')){var _0xb45ee5={};_0xb45ee5[_0x727302[_0x14a8('0x2b')]]={'$like':'%'+_0x5339e3[_0x14a8('0x34')][_0x14a8('0x42')]+'%'};return _0xb45ee5;}})});}_0x195f82=_[_0x14a8('0x40')]({},_0x195f82,_0x5339e3[_0x14a8('0x43')]);var _0x501f70={'where':_0x195f82['where']};return db['AnalyticExtractedReport'][_0x14a8('0x1c')](_0x501f70)[_0x14a8('0x25')](function(_0x2c28d6){_0x4a5a58[_0x14a8('0x1c')]=_0x2c28d6;if(_0x5339e3[_0x14a8('0x34')]['includeAll']){_0x195f82[_0x14a8('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x14a8('0x45')](_0x195f82);})[_0x14a8('0x25')](function(_0x15122d){_0x4a5a58[_0x14a8('0x46')]=_0x15122d;return _0x4a5a58;})[_0x14a8('0x25')](respondWithFilteredResult(_0x4e70c9,_0x195f82))['catch'](handleError(_0x4e70c9,null));};exports[_0x14a8('0x47')]=function(_0x29b11d,_0x3c384e){var _0x28ed6e={'raw':!![],'where':{'id':_0x29b11d[_0x14a8('0x48')]['id']}},_0x1d49ca={};_0x1d49ca[_0x14a8('0x33')]=_['keys'](db[_0x14a8('0x2f')][_0x14a8('0x30')]);_0x1d49ca[_0x14a8('0x34')]=_[_0x14a8('0x35')](_0x29b11d[_0x14a8('0x34')]);_0x1d49ca[_0x14a8('0x36')]=_[_0x14a8('0x37')](_0x1d49ca['model'],_0x1d49ca[_0x14a8('0x34')]);_0x28ed6e[_0x14a8('0x38')]=_[_0x14a8('0x37')](_0x1d49ca[_0x14a8('0x33')],qs[_0x14a8('0x39')](_0x29b11d[_0x14a8('0x34')][_0x14a8('0x39')]));_0x28ed6e[_0x14a8('0x38')]=_0x28ed6e[_0x14a8('0x38')][_0x14a8('0x49')]?_0x28ed6e[_0x14a8('0x38')]:_0x1d49ca['model'];if(_0x29b11d[_0x14a8('0x34')][_0x14a8('0x4a')]){_0x28ed6e[_0x14a8('0x44')]=[{'all':!![]}];}_0x28ed6e=_[_0x14a8('0x40')]({},_0x28ed6e,_0x29b11d[_0x14a8('0x43')]);return db['AnalyticExtractedReport'][_0x14a8('0x4b')](_0x28ed6e)[_0x14a8('0x25')](handleEntityNotFound(_0x3c384e,null))[_0x14a8('0x25')](respondWithResult(_0x3c384e,null))[_0x14a8('0x4c')](handleError(_0x3c384e,null));};exports[_0x14a8('0x4d')]=function(_0x57c88d,_0x4086b6){return db['AnalyticExtractedReport']['create'](_0x57c88d[_0x14a8('0x4e')],{})['then'](function(_0x57e4bb){var _0x36b5c2=_0x57c88d['user'][_0x14a8('0x26')]({'plain':!![]});if(!_0x36b5c2)throw new Error(_0x14a8('0x4f'));if(_0x36b5c2[_0x14a8('0x50')]===_0x14a8('0x51')){var _0x50d80d=_0x57e4bb['get']({'plain':!![]});var _0x4ef635=_0x14a8('0x27');return db[_0x14a8('0x52')][_0x14a8('0x4b')]({'where':{'name':_0x4ef635,'userProfileId':_0x36b5c2[_0x14a8('0x53')]},'raw':!![]})['then'](function(_0x645536){if(_0x645536&&_0x645536[_0x14a8('0x54')]===0x0){return db[_0x14a8('0x28')][_0x14a8('0x4d')]({'name':_0x50d80d['name'],'resourceId':_0x50d80d['id'],'type':_0x645536['name'],'sectionId':_0x645536['id']},{})[_0x14a8('0x25')](function(){return _0x57e4bb;});}else{return _0x57e4bb;}})['catch'](function(_0x306a21){logger[_0x14a8('0x55')](_0x14a8('0x56'),_0x306a21);throw _0x306a21;});}return _0x57e4bb;})[_0x14a8('0x25')](respondWithResult(_0x4086b6,0xc9))[_0x14a8('0x4c')](handleError(_0x4086b6,null));};exports['update']=function(_0x57b348,_0x597a25){if(_0x57b348[_0x14a8('0x4e')]['id']){delete _0x57b348[_0x14a8('0x4e')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x57b348[_0x14a8('0x48')]['id']}})[_0x14a8('0x25')](handleEntityNotFound(_0x597a25,null))['then'](saveUpdates(_0x57b348[_0x14a8('0x4e')],null))[_0x14a8('0x25')](respondWithResult(_0x597a25,null))[_0x14a8('0x4c')](handleError(_0x597a25,null));};exports[_0x14a8('0x24')]=function(_0x5e0033,_0x99eb09){return db[_0x14a8('0x2f')][_0x14a8('0x4b')]({'where':{'id':_0x5e0033[_0x14a8('0x48')]['id']}})[_0x14a8('0x25')](handleEntityNotFound(_0x99eb09,null))[_0x14a8('0x25')](removeEntity(_0x99eb09,null))['catch'](handleError(_0x99eb09,null));};exports[_0x14a8('0x57')]=function(_0x39ab3,_0x3ea510,_0x20583b){return db[_0x14a8('0x2f')][_0x14a8('0x4b')]({'where':{'id':_0x39ab3[_0x14a8('0x48')]['id']},'attributes':['name','basename',_0x14a8('0x58'),_0x14a8('0x59')],'raw':!![]})[_0x14a8('0x25')](handleEntityNotFound(_0x3ea510,null))['then'](function(_0x226b15){if(_0x226b15){if(!fs[_0x14a8('0x5a')](path[_0x14a8('0x5b')](config[_0x14a8('0x5c')],_0x14a8('0x5d'),_0x226b15['savename']))){throw new db[(_0x14a8('0x5e'))]['ValidationError'](_0x14a8('0x5f'));}if(_0x39ab3[_0x14a8('0x34')]['exists']){return _0x3ea510['sendStatus'](0xc8);}return _0x3ea510[_0x14a8('0x57')](path[_0x14a8('0x5b')](config[_0x14a8('0x5c')],_0x14a8('0x5d'),_0x226b15[_0x14a8('0x58')]),util[_0x14a8('0x60')](_0x14a8('0x61'),_0x226b15[_0x14a8('0x62')]||_0x226b15[_0x14a8('0x2b')],_0x226b15[_0x14a8('0x59')]['toLowerCase']()));}})[_0x14a8('0x4c')](handleError(_0x3ea510,null));}; \ No newline at end of file +var _0x4517=['show','params','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','autoAssociation','update','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','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/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','AnalyticExtractedReport','include','findAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4517,0x79));var _0x7451=function(_0x23a0d7,_0x5ddcc5){_0x23a0d7=_0x23a0d7-0x0;var _0x37930b=_0x4517[_0x23a0d7];return _0x37930b;};'use strict';var emlformat=require(_0x7451('0x0'));var rimraf=require(_0x7451('0x1'));var zipdir=require(_0x7451('0x2'));var jsonpatch=require(_0x7451('0x3'));var rp=require('request-promise');var moment=require(_0x7451('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7451('0x5'));var util=require(_0x7451('0x6'));var path=require(_0x7451('0x7'));var sox=require(_0x7451('0x8'));var csv=require(_0x7451('0x9'));var ejs=require(_0x7451('0xa'));var fs=require('fs');var fs_extra=require(_0x7451('0xb'));var _=require(_0x7451('0xc'));var squel=require(_0x7451('0xd'));var crypto=require(_0x7451('0xe'));var jsforce=require(_0x7451('0xf'));var deskjs=require(_0x7451('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7451('0x11'));var Redis=require(_0x7451('0x12'));var authService=require(_0x7451('0x13'));var qs=require(_0x7451('0x14'));var as=require(_0x7451('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7451('0x16'))('api');var utils=require(_0x7451('0x17'));var config=require(_0x7451('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7451('0x19'))['db'];function respondWithStatusCode(_0x2908c1,_0x5aa648){_0x5aa648=_0x5aa648||0xcc;return function(_0x7f96b6){if(_0x7f96b6){return _0x2908c1[_0x7451('0x1a')](_0x5aa648);}return _0x2908c1['status'](_0x5aa648)[_0x7451('0x1b')]();};}function respondWithResult(_0x21dd7a,_0x5c8db7){_0x5c8db7=_0x5c8db7||0xc8;return function(_0x3f79be){if(_0x3f79be){return _0x21dd7a['status'](_0x5c8db7)[_0x7451('0x1c')](_0x3f79be);}};}function respondWithFilteredResult(_0x2df7f6,_0xafb212){return function(_0x2ea5c3){if(_0x2ea5c3){var _0x4b25a3=typeof _0xafb212['offset']===_0x7451('0x1d')&&typeof _0xafb212[_0x7451('0x1e')]===_0x7451('0x1d');var _0x1e8ee7=_0x2ea5c3[_0x7451('0x1f')];var _0x4dfa1c=_0x4b25a3?0x0:_0xafb212['offset'];var _0x168b0e=_0x4b25a3?_0x2ea5c3['count']:_0xafb212['offset']+_0xafb212[_0x7451('0x1e')];var _0x22d2e4;if(_0x168b0e>=_0x1e8ee7){_0x168b0e=_0x1e8ee7;_0x22d2e4=0xc8;}else{_0x22d2e4=0xce;}_0x2df7f6[_0x7451('0x20')](_0x22d2e4);return _0x2df7f6[_0x7451('0x21')](_0x7451('0x22'),_0x4dfa1c+'-'+_0x168b0e+'/'+_0x1e8ee7)[_0x7451('0x1c')](_0x2ea5c3);}return null;};}function patchUpdates(_0x425856){return function(_0x374c19){try{jsonpatch[_0x7451('0x23')](_0x374c19,_0x425856,!![]);}catch(_0x1fd3e5){return BPromise[_0x7451('0x24')](_0x1fd3e5);}return _0x374c19[_0x7451('0x25')]();};}function saveUpdates(_0x1bb9ce,_0x1275f4){return function(_0x41c2d3){if(_0x41c2d3){return _0x41c2d3['update'](_0x1bb9ce)[_0x7451('0x26')](function(_0x4e20dc){return _0x4e20dc;});}return null;};}function removeEntity(_0x7cf217,_0x2ed397){return function(_0x5c16fc){if(_0x5c16fc){return _0x5c16fc[_0x7451('0x27')]()['then'](function(){var _0x3fbc25=_0x5c16fc['get']({'plain':!![]});var _0x2ff685=_0x7451('0x28');return db[_0x7451('0x29')][_0x7451('0x27')]({'where':{'type':_0x2ff685,'resourceId':_0x3fbc25['id']}})[_0x7451('0x26')](function(){return _0x5c16fc;});})['then'](function(){_0x7cf217['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x357664,_0x5a007c){return function(_0x51904a){if(!_0x51904a){_0x357664[_0x7451('0x1a')](0x194);}return _0x51904a;};}function handleError(_0x44a17e,_0xbdb78e){_0xbdb78e=_0xbdb78e||0x1f4;return function(_0x34cb0e){logger[_0x7451('0x2a')](_0x34cb0e[_0x7451('0x2b')]);if(_0x34cb0e['name']){delete _0x34cb0e[_0x7451('0x2c')];}_0x44a17e['status'](_0xbdb78e)[_0x7451('0x2d')](_0x34cb0e);};}exports[_0x7451('0x2e')]=function(_0x3f0fcd,_0x4fb03c){var _0x4deb7e={},_0xa20b04={},_0x48b2fa={'count':0x0,'rows':[]};var _0x26dff5=_['map'](db['AnalyticExtractedReport'][_0x7451('0x2f')],function(_0x3070e){return{'name':_0x3070e[_0x7451('0x30')],'type':_0x3070e['type']['key']};});_0xa20b04['model']=_[_0x7451('0x31')](_0x26dff5,_0x7451('0x2c'));_0xa20b04[_0x7451('0x32')]=_[_0x7451('0x33')](_0x3f0fcd[_0x7451('0x32')]);_0xa20b04['filters']=_[_0x7451('0x34')](_0xa20b04[_0x7451('0x35')],_0xa20b04['query']);_0x4deb7e['attributes']=_[_0x7451('0x34')](_0xa20b04[_0x7451('0x35')],qs[_0x7451('0x36')](_0x3f0fcd['query']['fields']));_0x4deb7e['attributes']=_0x4deb7e[_0x7451('0x37')][_0x7451('0x38')]?_0x4deb7e[_0x7451('0x37')]:_0xa20b04[_0x7451('0x35')];if(!_0x3f0fcd['query'][_0x7451('0x39')]('nolimit')){_0x4deb7e[_0x7451('0x1e')]=qs[_0x7451('0x1e')](_0x3f0fcd[_0x7451('0x32')][_0x7451('0x1e')]);_0x4deb7e[_0x7451('0x3a')]=qs['offset'](_0x3f0fcd[_0x7451('0x32')][_0x7451('0x3a')]);}_0x4deb7e[_0x7451('0x3b')]=qs['sort'](_0x3f0fcd['query'][_0x7451('0x3c')]);_0x4deb7e[_0x7451('0x3d')]=qs[_0x7451('0x3e')](_[_0x7451('0x3f')](_0x3f0fcd[_0x7451('0x32')],_0xa20b04[_0x7451('0x3e')]),_0x26dff5);if(_0x3f0fcd[_0x7451('0x32')]['filter']){_0x4deb7e[_0x7451('0x3d')]=_[_0x7451('0x40')](_0x4deb7e[_0x7451('0x3d')],{'$or':_[_0x7451('0x31')](_0x26dff5,function(_0x3f6e1c){if(_0x3f6e1c[_0x7451('0x41')]!==_0x7451('0x42')){var _0x3e6f4c={};_0x3e6f4c[_0x3f6e1c[_0x7451('0x2c')]]={'$like':'%'+_0x3f0fcd[_0x7451('0x32')][_0x7451('0x43')]+'%'};return _0x3e6f4c;}})});}_0x4deb7e=_[_0x7451('0x40')]({},_0x4deb7e,_0x3f0fcd['options']);var _0x2a85d4={'where':_0x4deb7e[_0x7451('0x3d')]};return db[_0x7451('0x44')][_0x7451('0x1f')](_0x2a85d4)[_0x7451('0x26')](function(_0x1727c9){_0x48b2fa[_0x7451('0x1f')]=_0x1727c9;if(_0x3f0fcd[_0x7451('0x32')]['includeAll']){_0x4deb7e[_0x7451('0x45')]=[{'all':!![]}];}return db[_0x7451('0x44')][_0x7451('0x46')](_0x4deb7e);})['then'](function(_0x3206a0){_0x48b2fa['rows']=_0x3206a0;return _0x48b2fa;})[_0x7451('0x26')](respondWithFilteredResult(_0x4fb03c,_0x4deb7e))['catch'](handleError(_0x4fb03c,null));};exports[_0x7451('0x47')]=function(_0x43297a,_0x535558){var _0x126506={'raw':!![],'where':{'id':_0x43297a[_0x7451('0x48')]['id']}},_0x20a410={};_0x20a410[_0x7451('0x35')]=_['keys'](db['AnalyticExtractedReport'][_0x7451('0x2f')]);_0x20a410[_0x7451('0x32')]=_[_0x7451('0x33')](_0x43297a[_0x7451('0x32')]);_0x20a410[_0x7451('0x3e')]=_['intersection'](_0x20a410[_0x7451('0x35')],_0x20a410[_0x7451('0x32')]);_0x126506[_0x7451('0x37')]=_['intersection'](_0x20a410[_0x7451('0x35')],qs['fields'](_0x43297a[_0x7451('0x32')][_0x7451('0x36')]));_0x126506[_0x7451('0x37')]=_0x126506[_0x7451('0x37')][_0x7451('0x38')]?_0x126506[_0x7451('0x37')]:_0x20a410[_0x7451('0x35')];if(_0x43297a[_0x7451('0x32')]['includeAll']){_0x126506[_0x7451('0x45')]=[{'all':!![]}];}_0x126506=_['merge']({},_0x126506,_0x43297a[_0x7451('0x49')]);return db[_0x7451('0x44')]['find'](_0x126506)[_0x7451('0x26')](handleEntityNotFound(_0x535558,null))[_0x7451('0x26')](respondWithResult(_0x535558,null))[_0x7451('0x4a')](handleError(_0x535558,null));};exports[_0x7451('0x4b')]=function(_0x4cf712,_0x46c6f5){return db[_0x7451('0x44')][_0x7451('0x4b')](_0x4cf712[_0x7451('0x4c')],{})['then'](function(_0x386d1a){var _0x1e6e6b=_0x4cf712['user']['get']({'plain':!![]});if(!_0x1e6e6b)throw new Error(_0x7451('0x4d'));if(_0x1e6e6b[_0x7451('0x4e')]==='user'){var _0x2b2a6e=_0x386d1a[_0x7451('0x4f')]({'plain':!![]});var _0x3b6948='ExtractedReports';return db[_0x7451('0x50')][_0x7451('0x51')]({'where':{'name':_0x3b6948,'userProfileId':_0x1e6e6b['userProfileId']},'raw':!![]})[_0x7451('0x26')](function(_0x51d2f6){if(_0x51d2f6&&_0x51d2f6[_0x7451('0x52')]===0x0){return db['UserProfileResource'][_0x7451('0x4b')]({'name':_0x2b2a6e[_0x7451('0x2c')],'resourceId':_0x2b2a6e['id'],'type':_0x51d2f6[_0x7451('0x2c')],'sectionId':_0x51d2f6['id']},{})[_0x7451('0x26')](function(){return _0x386d1a;});}else{return _0x386d1a;}})[_0x7451('0x4a')](function(_0x4dc2f3){logger[_0x7451('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dc2f3);throw _0x4dc2f3;});}return _0x386d1a;})[_0x7451('0x26')](respondWithResult(_0x46c6f5,0xc9))[_0x7451('0x4a')](handleError(_0x46c6f5,null));};exports[_0x7451('0x53')]=function(_0x387eee,_0x12f1b9){if(_0x387eee[_0x7451('0x4c')]['id']){delete _0x387eee[_0x7451('0x4c')]['id'];}return db[_0x7451('0x44')][_0x7451('0x51')]({'where':{'id':_0x387eee[_0x7451('0x48')]['id']}})[_0x7451('0x26')](handleEntityNotFound(_0x12f1b9,null))[_0x7451('0x26')](saveUpdates(_0x387eee['body'],null))[_0x7451('0x26')](respondWithResult(_0x12f1b9,null))[_0x7451('0x4a')](handleError(_0x12f1b9,null));};exports[_0x7451('0x27')]=function(_0x550516,_0xb72ba4){return db[_0x7451('0x44')][_0x7451('0x51')]({'where':{'id':_0x550516[_0x7451('0x48')]['id']}})[_0x7451('0x26')](handleEntityNotFound(_0xb72ba4,null))[_0x7451('0x26')](removeEntity(_0xb72ba4,null))[_0x7451('0x4a')](handleError(_0xb72ba4,null));};exports[_0x7451('0x54')]=function(_0x47486f,_0x171178,_0x591330){return db[_0x7451('0x44')][_0x7451('0x51')]({'where':{'id':_0x47486f[_0x7451('0x48')]['id']},'attributes':[_0x7451('0x2c'),_0x7451('0x55'),_0x7451('0x56'),'output'],'raw':!![]})[_0x7451('0x26')](handleEntityNotFound(_0x171178,null))[_0x7451('0x26')](function(_0x584f29){if(_0x584f29){if(!fs[_0x7451('0x57')](path[_0x7451('0x58')](config[_0x7451('0x59')],_0x7451('0x5a'),_0x584f29['savename']))){throw new db[(_0x7451('0x5b'))]['ValidationError'](_0x7451('0x5c'));}if(_0x47486f['query'][_0x7451('0x5d')]){return _0x171178[_0x7451('0x1a')](0xc8);}return _0x171178[_0x7451('0x54')](path[_0x7451('0x58')](config['root'],_0x7451('0x5a'),_0x584f29[_0x7451('0x56')]),util['format']('%s.%s',_0x584f29[_0x7451('0x55')]||_0x584f29[_0x7451('0x2c')],_0x584f29[_0x7451('0x5e')][_0x7451('0x5f')]()));}})[_0x7451('0x4a')](handleError(_0x171178,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 32d55bf..fe65f70 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 _0xff16=['moment','bluebird','request-promise','../../config/environment','define','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xff16,0x84));var _0x6ff1=function(_0xf6aae8,_0x671881){_0xf6aae8=_0xf6aae8-0x0;var _0xc27a8e=_0xff16[_0xf6aae8];return _0xc27a8e;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var logger=require(_0x6ff1('0x2'))('api');var moment=require(_0x6ff1('0x3'));var BPromise=require(_0x6ff1('0x4'));var rp=require(_0x6ff1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ff1('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x57b799,_0x34c857){return _0x57b799[_0x6ff1('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x6ff1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d7b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x472348,_0x4bf379){var _0x17c458=function(_0x3db407){while(--_0x3db407){_0x472348['push'](_0x472348['shift']());}};_0x17c458(++_0x4bf379);}(_0x9d7b,0x102));var _0xb9d7=function(_0x233724,_0x563069){_0x233724=_0x233724-0x0;var _0x498a3d=_0x9d7b[_0x233724];return _0x498a3d;};'use strict';var _=require(_0xb9d7('0x0'));var util=require('util');var logger=require(_0xb9d7('0x1'))(_0xb9d7('0x2'));var moment=require(_0xb9d7('0x3'));var BPromise=require(_0xb9d7('0x4'));var rp=require(_0xb9d7('0x5'));var fs=require('fs');var path=require(_0xb9d7('0x6'));var rimraf=require(_0xb9d7('0x7'));var config=require(_0xb9d7('0x8'));var attributes=require(_0xb9d7('0x9'));module[_0xb9d7('0xa')]=function(_0x18ff46,_0x2b618f){return _0x18ff46['define'](_0xb9d7('0xb'),attributes,{'tableName':_0xb9d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index b25c144..76d4545 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 _0xe6fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xe6fa,0x154));var _0xae6f=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0xe6fa[_0x3bf1e0];return _0x5a9ded;};'use strict';var _=require(_0xae6f('0x0'));var util=require(_0xae6f('0x1'));var moment=require('moment');var BPromise=require(_0xae6f('0x2'));var rs=require(_0xae6f('0x3'));var fs=require('fs');var Redis=require(_0xae6f('0x4'));var db=require(_0xae6f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae6f('0x6'))(_0xae6f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae6f('0x8')][_0xae6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d124,_0x555526,_0x23c5cb){return new BPromise(function(_0x324df9,_0x1ec178){return client[_0xae6f('0xa')](_0x16d124,_0x23c5cb)[_0xae6f('0xb')](function(_0xd163b9){logger[_0xae6f('0xc')](_0xae6f('0xd'),_0x555526,_0xae6f('0xe'));logger['debug'](_0xae6f('0xf'),_0x555526,_0xae6f('0xe'),JSON[_0xae6f('0x10')](_0xd163b9));if(_0xd163b9[_0xae6f('0x11')]){if(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x12')]===0x1f4){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x1ec178(_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);}logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0xd163b9[_0xae6f('0x11')][_0xae6f('0x13')]);return _0x324df9(_0xd163b9['error'][_0xae6f('0x13')]);}else{logger['info'](_0xae6f('0xd'),_0x555526,'request\x20sent');_0x324df9(_0xd163b9['result'][_0xae6f('0x13')]);}})['catch'](function(_0x262cdd){logger[_0xae6f('0x11')](_0xae6f('0xd'),_0x555526,_0x262cdd);_0x1ec178(_0x262cdd);});});} \ No newline at end of file +var _0x17bb=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x38ff6e,_0x2a9286){var _0x4b462b=function(_0x435763){while(--_0x435763){_0x38ff6e['push'](_0x38ff6e['shift']());}};_0x4b462b(++_0x2a9286);}(_0x17bb,0x17a));var _0xb17b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x17bb[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xb17b('0x0'));var util=require('util');var moment=require(_0xb17b('0x1'));var BPromise=require(_0xb17b('0x2'));var rs=require(_0xb17b('0x3'));var fs=require('fs');var Redis=require(_0xb17b('0x4'));var db=require(_0xb17b('0x5'))['db'];var utils=require(_0xb17b('0x6'));var logger=require(_0xb17b('0x7'))(_0xb17b('0x8'));var config=require('../../config/environment');var jayson=require(_0xb17b('0x9'));var client=jayson['client'][_0xb17b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459f70,_0x3a685f,_0x24f899){return new BPromise(function(_0xdfd48f,_0x379d23){return client['request'](_0x459f70,_0x24f899)[_0xb17b('0xb')](function(_0xe92d6){logger[_0xb17b('0xc')](_0xb17b('0xd'),_0x3a685f,_0xb17b('0xe'));logger[_0xb17b('0xf')](_0xb17b('0x10'),_0x3a685f,_0xb17b('0xe'),JSON['stringify'](_0xe92d6));if(_0xe92d6['error']){if(_0xe92d6[_0xb17b('0x11')][_0xb17b('0x12')]===0x1f4){logger[_0xb17b('0x11')](_0xb17b('0xd'),_0x3a685f,_0xe92d6[_0xb17b('0x11')]['message']);return _0x379d23(_0xe92d6['error'][_0xb17b('0x13')]);}logger[_0xb17b('0x11')](_0xb17b('0xd'),_0x3a685f,_0xe92d6['error'][_0xb17b('0x13')]);return _0xdfd48f(_0xe92d6[_0xb17b('0x11')]['message']);}else{logger[_0xb17b('0xc')](_0xb17b('0xd'),_0x3a685f,'request\x20sent');_0xdfd48f(_0xe92d6[_0xb17b('0x14')]['message']);}})['catch'](function(_0x5dfe29){logger[_0xb17b('0x11')](_0xb17b('0xd'),_0x3a685f,_0x5dfe29);_0x379d23(_0x5dfe29);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 274f916..731b19b 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 _0xc2dd=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','/:id','show','get','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x3d6f21,_0x757536){var _0x1e1421=function(_0x83f673){while(--_0x83f673){_0x3d6f21['push'](_0x3d6f21['shift']());}};_0x1e1421(++_0x757536);}(_0xc2dd,0xea));var _0xdc2d=function(_0x3cef1d,_0x43d39e){_0x3cef1d=_0x3cef1d-0x0;var _0x5b8d25=_0xc2dd[_0x3cef1d];return _0x5b8d25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc2d('0x0'));var timeout=require(_0xdc2d('0x1'));var express=require(_0xdc2d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc2d('0x3'));var interaction=require(_0xdc2d('0x4'));var config=require('../../config/environment');var controller=require(_0xdc2d('0x5'));router['get']('/',auth[_0xdc2d('0x6')](),controller['index']);router['get'](_0xdc2d('0x7'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0x8')]);router[_0xdc2d('0x9')](_0xdc2d('0xa'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xb')]);router[_0xdc2d('0xc')]('/',auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xd')]);router[_0xdc2d('0xe')](_0xdc2d('0x7'),auth[_0xdc2d('0x6')](),controller[_0xdc2d('0xf')]);router[_0xdc2d('0x10')](_0xdc2d('0x7'),auth['isAuthenticated'](),controller[_0xdc2d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x92b3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update','destroy','exports','multer'];(function(_0x5c3bf7,_0xa5cffa){var _0x29231b=function(_0xc9d963){while(--_0xc9d963){_0x5c3bf7['push'](_0x5c3bf7['shift']());}};_0x29231b(++_0xa5cffa);}(_0x92b3,0x113));var _0x392b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x92b3[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x392b('0x0'));var util=require(_0x392b('0x1'));var path=require(_0x392b('0x2'));var timeout=require(_0x392b('0x3'));var express=require(_0x392b('0x4'));var router=express[_0x392b('0x5')]();var fs_extra=require(_0x392b('0x6'));var auth=require(_0x392b('0x7'));var interaction=require(_0x392b('0x8'));var config=require(_0x392b('0x9'));var controller=require(_0x392b('0xa'));router[_0x392b('0xb')]('/',auth[_0x392b('0xc')](),controller[_0x392b('0xd')]);router['get'](_0x392b('0xe'),auth['isAuthenticated'](),controller[_0x392b('0xf')]);router[_0x392b('0xb')]('/:id/download',auth[_0x392b('0xc')](),controller[_0x392b('0x10')]);router[_0x392b('0x11')]('/',auth[_0x392b('0xc')](),controller[_0x392b('0x12')]);router[_0x392b('0x13')](_0x392b('0xe'),auth[_0x392b('0xc')](),controller[_0x392b('0x14')]);router['delete']('/:id',auth[_0x392b('0xc')](),controller[_0x392b('0x15')]);module[_0x392b('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3caa0b8..f80481e 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 _0x0ee6=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x30cc80,_0xf1b9f){var _0x478d83=function(_0x391bd7){while(--_0x391bd7){_0x30cc80['push'](_0x30cc80['shift']());}};_0x478d83(++_0xf1b9f);}(_0x0ee6,0x6e));var _0x60ee=function(_0x57e08f,_0x275d98){_0x57e08f=_0x57e08f-0x0;var _0x43e004=_0x0ee6[_0x57e08f];return _0x43e004;};'use strict';var Sequelize=require(_0x60ee('0x0'));module[_0x60ee('0x1')]={'field':{'type':Sequelize[_0x60ee('0x2')]},'alias':{'type':Sequelize[_0x60ee('0x3')]},'function':{'type':Sequelize[_0x60ee('0x3')]},'format':{'type':Sequelize[_0x60ee('0x3')]},'groupBy':{'type':Sequelize[_0x60ee('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6cd1=['exports','TEXT','STRING','sequelize'];(function(_0x3f7abd,_0x387a0a){var _0xd60c0b=function(_0x483db7){while(--_0x483db7){_0x3f7abd['push'](_0x3f7abd['shift']());}};_0xd60c0b(++_0x387a0a);}(_0x6cd1,0x1bb));var _0x16cd=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x6cd1[_0x126fb9];return _0xc8a3b1;};'use strict';var Sequelize=require(_0x16cd('0x0'));module[_0x16cd('0x1')]={'field':{'type':Sequelize[_0x16cd('0x2')]},'alias':{'type':Sequelize[_0x16cd('0x3')]},'function':{'type':Sequelize[_0x16cd('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 230848f..73ca636 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 _0xd088=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xd088,0x160));var _0x8d08=function(_0x25d4eb,_0xaeebee){_0x25d4eb=_0x25d4eb-0x0;var _0x130fa1=_0xd088[_0x25d4eb];return _0x130fa1;};'use strict';var emlformat=require(_0x8d08('0x0'));var rimraf=require(_0x8d08('0x1'));var zipdir=require(_0x8d08('0x2'));var jsonpatch=require(_0x8d08('0x3'));var rp=require(_0x8d08('0x4'));var moment=require('moment');var BPromise=require(_0x8d08('0x5'));var Mustache=require('mustache');var util=require(_0x8d08('0x6'));var path=require('path');var sox=require(_0x8d08('0x7'));var csv=require(_0x8d08('0x8'));var ejs=require(_0x8d08('0x9'));var fs=require('fs');var fs_extra=require(_0x8d08('0xa'));var _=require('lodash');var squel=require(_0x8d08('0xb'));var crypto=require(_0x8d08('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d08('0x8'));var querystring=require(_0x8d08('0xd'));var Papa=require(_0x8d08('0xe'));var Redis=require('ioredis');var authService=require(_0x8d08('0xf'));var qs=require(_0x8d08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d08('0x11'));var logger=require(_0x8d08('0x12'))('api');var utils=require(_0x8d08('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8d08('0x14'));var db=require(_0x8d08('0x15'))['db'];function respondWithStatusCode(_0x4ae45a,_0x58ff03){_0x58ff03=_0x58ff03||0xcc;return function(_0x4caee0){if(_0x4caee0){return _0x4ae45a[_0x8d08('0x16')](_0x58ff03);}return _0x4ae45a[_0x8d08('0x17')](_0x58ff03)[_0x8d08('0x18')]();};}function respondWithResult(_0x1267b2,_0x111973){_0x111973=_0x111973||0xc8;return function(_0x242828){if(_0x242828){return _0x1267b2[_0x8d08('0x17')](_0x111973)[_0x8d08('0x19')](_0x242828);}};}function respondWithFilteredResult(_0x26c765,_0x47bafb){return function(_0x635def){if(_0x635def){var _0x57da0a=typeof _0x47bafb[_0x8d08('0x1a')]===_0x8d08('0x1b')&&typeof _0x47bafb[_0x8d08('0x1c')]===_0x8d08('0x1b');var _0xb41fdc=_0x635def['count'];var _0x2f302e=_0x57da0a?0x0:_0x47bafb[_0x8d08('0x1a')];var _0x2262b0=_0x57da0a?_0x635def[_0x8d08('0x1d')]:_0x47bafb[_0x8d08('0x1a')]+_0x47bafb['limit'];var _0xa97325;if(_0x2262b0>=_0xb41fdc){_0x2262b0=_0xb41fdc;_0xa97325=0xc8;}else{_0xa97325=0xce;}_0x26c765[_0x8d08('0x17')](_0xa97325);return _0x26c765[_0x8d08('0x1e')]('Content-Range',_0x2f302e+'-'+_0x2262b0+'/'+_0xb41fdc)['json'](_0x635def);}return null;};}function patchUpdates(_0x2f2e2d){return function(_0x27b310){try{jsonpatch[_0x8d08('0x1f')](_0x27b310,_0x2f2e2d,!![]);}catch(_0x25909d){return BPromise[_0x8d08('0x20')](_0x25909d);}return _0x27b310[_0x8d08('0x21')]();};}function saveUpdates(_0x36a531,_0x3d0468){return function(_0x4fc35e){if(_0x4fc35e){return _0x4fc35e[_0x8d08('0x22')](_0x36a531)[_0x8d08('0x23')](function(_0x15c3d7){return _0x15c3d7;});}return null;};}function removeEntity(_0x34708a,_0x3e18ce){return function(_0x105c87){if(_0x105c87){return _0x105c87['destroy']()['then'](function(){_0x34708a[_0x8d08('0x17')](0xcc)[_0x8d08('0x18')]();});}};}function handleEntityNotFound(_0x189b1a,_0x60c2ff){return function(_0x267e13){if(!_0x267e13){_0x189b1a[_0x8d08('0x16')](0x194);}return _0x267e13;};}function handleError(_0x289b83,_0x4ea363){_0x4ea363=_0x4ea363||0x1f4;return function(_0x5bdc00){logger[_0x8d08('0x24')](_0x5bdc00[_0x8d08('0x25')]);if(_0x5bdc00[_0x8d08('0x26')]){delete _0x5bdc00['name'];}_0x289b83[_0x8d08('0x17')](_0x4ea363)['send'](_0x5bdc00);};}exports[_0x8d08('0x27')]=function(_0x1b889e,_0x54c223){var _0x35c9d1={},_0x3da13c={},_0x1fc124={'count':0x0,'rows':[]};var _0x3948f0=_[_0x8d08('0x28')](db[_0x8d08('0x29')][_0x8d08('0x2a')],function(_0x229e1b){return{'name':_0x229e1b[_0x8d08('0x2b')],'type':_0x229e1b[_0x8d08('0x2c')][_0x8d08('0x2d')]};});_0x3da13c['model']=_[_0x8d08('0x28')](_0x3948f0,_0x8d08('0x26'));_0x3da13c['query']=_[_0x8d08('0x2e')](_0x1b889e[_0x8d08('0x2f')]);_0x3da13c[_0x8d08('0x30')]=_[_0x8d08('0x31')](_0x3da13c[_0x8d08('0x32')],_0x3da13c[_0x8d08('0x2f')]);_0x35c9d1[_0x8d08('0x33')]=_['intersection'](_0x3da13c[_0x8d08('0x32')],qs[_0x8d08('0x34')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x34')]));_0x35c9d1['attributes']=_0x35c9d1[_0x8d08('0x33')][_0x8d08('0x35')]?_0x35c9d1['attributes']:_0x3da13c[_0x8d08('0x32')];if(!_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x36')]('nolimit')){_0x35c9d1['limit']=qs['limit'](_0x1b889e[_0x8d08('0x2f')]['limit']);_0x35c9d1['offset']=qs[_0x8d08('0x1a')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x1a')]);}_0x35c9d1[_0x8d08('0x37')]=qs[_0x8d08('0x38')](_0x1b889e[_0x8d08('0x2f')][_0x8d08('0x38')]);_0x35c9d1[_0x8d08('0x39')]=qs[_0x8d08('0x30')](_[_0x8d08('0x3a')](_0x1b889e[_0x8d08('0x2f')],_0x3da13c[_0x8d08('0x30')]),_0x3948f0);if(_0x1b889e['query']['filter']){_0x35c9d1[_0x8d08('0x39')]=_[_0x8d08('0x3b')](_0x35c9d1[_0x8d08('0x39')],{'$or':_[_0x8d08('0x28')](_0x3948f0,function(_0x55bbcb){if(_0x55bbcb[_0x8d08('0x2c')]!==_0x8d08('0x3c')){var _0x3ef918={};_0x3ef918[_0x55bbcb[_0x8d08('0x26')]]={'$like':'%'+_0x1b889e['query'][_0x8d08('0x3d')]+'%'};return _0x3ef918;}})});}_0x35c9d1=_['merge']({},_0x35c9d1,_0x1b889e[_0x8d08('0x3e')]);var _0x35e1c5={'where':_0x35c9d1[_0x8d08('0x39')]};return db['AnalyticFieldReport'][_0x8d08('0x1d')](_0x35e1c5)[_0x8d08('0x23')](function(_0x320d65){_0x1fc124[_0x8d08('0x1d')]=_0x320d65;if(_0x1b889e['query'][_0x8d08('0x3f')]){_0x35c9d1[_0x8d08('0x40')]=[{'all':!![]}];}return db[_0x8d08('0x29')][_0x8d08('0x41')](_0x35c9d1);})[_0x8d08('0x23')](function(_0x92a21c){_0x1fc124[_0x8d08('0x42')]=_0x92a21c;return _0x1fc124;})['then'](respondWithFilteredResult(_0x54c223,_0x35c9d1))[_0x8d08('0x43')](handleError(_0x54c223,null));};exports[_0x8d08('0x44')]=function(_0x3720e8,_0x263884){var _0x3fe79b={'raw':![],'where':{'id':_0x3720e8[_0x8d08('0x45')]['id']}},_0x1bda65={};_0x1bda65[_0x8d08('0x32')]=_[_0x8d08('0x2e')](db[_0x8d08('0x29')][_0x8d08('0x2a')]);_0x1bda65[_0x8d08('0x2f')]=_[_0x8d08('0x2e')](_0x3720e8[_0x8d08('0x2f')]);_0x1bda65[_0x8d08('0x30')]=_[_0x8d08('0x31')](_0x1bda65['model'],_0x1bda65[_0x8d08('0x2f')]);_0x3fe79b[_0x8d08('0x33')]=_[_0x8d08('0x31')](_0x1bda65[_0x8d08('0x32')],qs[_0x8d08('0x34')](_0x3720e8[_0x8d08('0x2f')]['fields']));_0x3fe79b['attributes']=_0x3fe79b['attributes'][_0x8d08('0x35')]?_0x3fe79b[_0x8d08('0x33')]:_0x1bda65['model'];if(_0x3720e8[_0x8d08('0x2f')][_0x8d08('0x3f')]){_0x3fe79b[_0x8d08('0x40')]=[{'all':!![]}];}_0x3fe79b=_['merge']({},_0x3fe79b,_0x3720e8[_0x8d08('0x3e')]);return db['AnalyticFieldReport']['find'](_0x3fe79b)[_0x8d08('0x23')](handleEntityNotFound(_0x263884,null))['then'](respondWithResult(_0x263884,null))['catch'](handleError(_0x263884,null));};exports[_0x8d08('0x46')]=function(_0x4ec950,_0x5b694a){return db['AnalyticFieldReport'][_0x8d08('0x46')](_0x4ec950[_0x8d08('0x47')],{})[_0x8d08('0x23')](respondWithResult(_0x5b694a,0xc9))['catch'](handleError(_0x5b694a,null));};exports[_0x8d08('0x48')]=function(_0x2e00a5,_0x4c3eb8){return db[_0x8d08('0x29')][_0x8d08('0x48')](_0x2e00a5[_0x8d08('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4c3eb8,0xc9))[_0x8d08('0x43')](handleError(_0x4c3eb8,null));};exports[_0x8d08('0x22')]=function(_0x31f81a,_0x10ebe3){if(_0x31f81a[_0x8d08('0x47')]['id']){delete _0x31f81a[_0x8d08('0x47')]['id'];}return db[_0x8d08('0x29')][_0x8d08('0x49')]({'where':{'id':_0x31f81a[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0x10ebe3,null))[_0x8d08('0x23')](saveUpdates(_0x31f81a[_0x8d08('0x47')],null))['then'](respondWithResult(_0x10ebe3,null))[_0x8d08('0x43')](handleError(_0x10ebe3,null));};exports[_0x8d08('0x4a')]=function(_0x153e34,_0x120e8a){return db[_0x8d08('0x29')][_0x8d08('0x49')]({'where':{'id':_0x153e34[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0x120e8a,null))[_0x8d08('0x23')](removeEntity(_0x120e8a,null))[_0x8d08('0x43')](handleError(_0x120e8a,null));};exports[_0x8d08('0x4b')]=function(_0x3e1484,_0x16df7b){return db['AnalyticFieldReport'][_0x8d08('0x4a')]({'where':{'id':_0x3e1484['query'][_0x8d08('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8d08('0x23')](respondWithResult(_0x16df7b,0xcc))[_0x8d08('0x43')](handleError(_0x16df7b,null));};exports[_0x8d08('0x4d')]=function(_0x19152d,_0xd1629e,_0x18e922){return db[_0x8d08('0x4e')]['findOne']({'where':{'id':_0x19152d[_0x8d08('0x45')]['id']}})[_0x8d08('0x23')](handleEntityNotFound(_0xd1629e,null))['then'](function(_0xd1c8f9){if(_0xd1c8f9){return db[_0x8d08('0x4f')][_0x8d08('0x50')](function(_0x416bb9){return db['AnalyticFieldReport'][_0x8d08('0x4a')]({'where':{'CustomReportId':_0x19152d['params']['id']},'transaction':_0x416bb9})[_0x8d08('0x23')](function(_0x18a94b){var _0x240db8=_['map'](_0x19152d[_0x8d08('0x47')],function(_0x345b46){delete _0x345b46['id'];_0x345b46[_0x8d08('0x51')]=_0x19152d['params']['id'];return _0x345b46;});return db['AnalyticFieldReport'][_0x8d08('0x48')](_0x240db8,{'transaction':_0x416bb9});});})['then'](function(){return db['AnalyticFieldReport'][_0x8d08('0x41')]({'where':{'CustomReportId':_0x19152d[_0x8d08('0x45')]['id']}});});}})[_0x8d08('0x23')](respondWithResult(_0xd1629e,null))[_0x8d08('0x43')](handleError(_0xd1629e,null));}; \ No newline at end of file +var _0xf966=['fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','params','create','body','bulkCreate','update','find','destroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf966,0x151));var _0x6f96=function(_0x2f8b88,_0x1b1a27){_0x2f8b88=_0x2f8b88-0x0;var _0x29d0cc=_0xf966[_0x2f8b88];return _0x29d0cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f96('0x0'));var zipdir=require(_0x6f96('0x1'));var jsonpatch=require(_0x6f96('0x2'));var rp=require(_0x6f96('0x3'));var moment=require('moment');var BPromise=require(_0x6f96('0x4'));var Mustache=require('mustache');var util=require(_0x6f96('0x5'));var path=require('path');var sox=require(_0x6f96('0x6'));var csv=require(_0x6f96('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f96('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f96('0x9'));var deskjs=require(_0x6f96('0xa'));var toCsv=require(_0x6f96('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f96('0xb'));var authService=require(_0x6f96('0xc'));var qs=require(_0x6f96('0xd'));var as=require(_0x6f96('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f96('0xf'));var utils=require('../../config/utils');var config=require(_0x6f96('0x10'));var licenseUtil=require(_0x6f96('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a796a,_0x4abce7){_0x4abce7=_0x4abce7||0xcc;return function(_0x234eac){if(_0x234eac){return _0x3a796a[_0x6f96('0x12')](_0x4abce7);}return _0x3a796a[_0x6f96('0x13')](_0x4abce7)['end']();};}function respondWithResult(_0x258630,_0x47d879){_0x47d879=_0x47d879||0xc8;return function(_0x5187e6){if(_0x5187e6){return _0x258630['status'](_0x47d879)[_0x6f96('0x14')](_0x5187e6);}};}function respondWithFilteredResult(_0x58503f,_0xdb9a5e){return function(_0x1778e6){if(_0x1778e6){var _0x2f358d=typeof _0xdb9a5e[_0x6f96('0x15')]===_0x6f96('0x16')&&typeof _0xdb9a5e['limit']==='undefined';var _0x243b63=_0x1778e6[_0x6f96('0x17')];var _0x34b0cb=_0x2f358d?0x0:_0xdb9a5e['offset'];var _0x35da36=_0x2f358d?_0x1778e6[_0x6f96('0x17')]:_0xdb9a5e[_0x6f96('0x15')]+_0xdb9a5e['limit'];var _0x37b9a8;if(_0x35da36>=_0x243b63){_0x35da36=_0x243b63;_0x37b9a8=0xc8;}else{_0x37b9a8=0xce;}_0x58503f[_0x6f96('0x13')](_0x37b9a8);return _0x58503f[_0x6f96('0x18')](_0x6f96('0x19'),_0x34b0cb+'-'+_0x35da36+'/'+_0x243b63)['json'](_0x1778e6);}return null;};}function patchUpdates(_0x4de1f2){return function(_0x2dcd91){try{jsonpatch['apply'](_0x2dcd91,_0x4de1f2,!![]);}catch(_0x61c65d){return BPromise[_0x6f96('0x1a')](_0x61c65d);}return _0x2dcd91['save']();};}function saveUpdates(_0x4d6023,_0x59fdf7){return function(_0x471769){if(_0x471769){return _0x471769['update'](_0x4d6023)[_0x6f96('0x1b')](function(_0x8d9a39){return _0x8d9a39;});}return null;};}function removeEntity(_0x359951,_0x25b2c1){return function(_0x5e02e0){if(_0x5e02e0){return _0x5e02e0['destroy']()[_0x6f96('0x1b')](function(){_0x359951['status'](0xcc)[_0x6f96('0x1c')]();});}};}function handleEntityNotFound(_0x48782c,_0x516a24){return function(_0x44b2f6){if(!_0x44b2f6){_0x48782c[_0x6f96('0x12')](0x194);}return _0x44b2f6;};}function handleError(_0x4ac8b0,_0x2dc4cd){_0x2dc4cd=_0x2dc4cd||0x1f4;return function(_0x50f415){logger[_0x6f96('0x1d')](_0x50f415[_0x6f96('0x1e')]);if(_0x50f415[_0x6f96('0x1f')]){delete _0x50f415[_0x6f96('0x1f')];}_0x4ac8b0['status'](_0x2dc4cd)[_0x6f96('0x20')](_0x50f415);};}exports['index']=function(_0x31f6e7,_0x26e628){var _0xbaa9f4={},_0x1c35c9={},_0x3c5c69={'count':0x0,'rows':[]};var _0x544b38=_[_0x6f96('0x21')](db['AnalyticFieldReport'][_0x6f96('0x22')],function(_0xec1fb2){return{'name':_0xec1fb2[_0x6f96('0x23')],'type':_0xec1fb2[_0x6f96('0x24')][_0x6f96('0x25')]};});_0x1c35c9[_0x6f96('0x26')]=_['map'](_0x544b38,_0x6f96('0x1f'));_0x1c35c9[_0x6f96('0x27')]=_[_0x6f96('0x28')](_0x31f6e7['query']);_0x1c35c9[_0x6f96('0x29')]=_[_0x6f96('0x2a')](_0x1c35c9['model'],_0x1c35c9[_0x6f96('0x27')]);_0xbaa9f4['attributes']=_[_0x6f96('0x2a')](_0x1c35c9['model'],qs[_0x6f96('0x2b')](_0x31f6e7[_0x6f96('0x27')][_0x6f96('0x2b')]));_0xbaa9f4[_0x6f96('0x2c')]=_0xbaa9f4[_0x6f96('0x2c')][_0x6f96('0x2d')]?_0xbaa9f4[_0x6f96('0x2c')]:_0x1c35c9['model'];if(!_0x31f6e7['query'][_0x6f96('0x2e')](_0x6f96('0x2f'))){_0xbaa9f4[_0x6f96('0x30')]=qs['limit'](_0x31f6e7[_0x6f96('0x27')]['limit']);_0xbaa9f4['offset']=qs[_0x6f96('0x15')](_0x31f6e7[_0x6f96('0x27')][_0x6f96('0x15')]);}_0xbaa9f4['order']=qs[_0x6f96('0x31')](_0x31f6e7[_0x6f96('0x27')][_0x6f96('0x31')]);_0xbaa9f4['where']=qs[_0x6f96('0x29')](_[_0x6f96('0x32')](_0x31f6e7[_0x6f96('0x27')],_0x1c35c9[_0x6f96('0x29')]),_0x544b38);if(_0x31f6e7['query'][_0x6f96('0x33')]){_0xbaa9f4[_0x6f96('0x34')]=_['merge'](_0xbaa9f4[_0x6f96('0x34')],{'$or':_['map'](_0x544b38,function(_0x2b8734){if(_0x2b8734[_0x6f96('0x24')]!==_0x6f96('0x35')){var _0x1425d8={};_0x1425d8[_0x2b8734[_0x6f96('0x1f')]]={'$like':'%'+_0x31f6e7['query'][_0x6f96('0x33')]+'%'};return _0x1425d8;}})});}_0xbaa9f4=_[_0x6f96('0x36')]({},_0xbaa9f4,_0x31f6e7[_0x6f96('0x37')]);var _0x133d01={'where':_0xbaa9f4[_0x6f96('0x34')]};return db['AnalyticFieldReport'][_0x6f96('0x17')](_0x133d01)[_0x6f96('0x1b')](function(_0x453ce3){_0x3c5c69['count']=_0x453ce3;if(_0x31f6e7['query'][_0x6f96('0x38')]){_0xbaa9f4[_0x6f96('0x39')]=[{'all':!![]}];}return db[_0x6f96('0x3a')][_0x6f96('0x3b')](_0xbaa9f4);})[_0x6f96('0x1b')](function(_0x149937){_0x3c5c69[_0x6f96('0x3c')]=_0x149937;return _0x3c5c69;})[_0x6f96('0x1b')](respondWithFilteredResult(_0x26e628,_0xbaa9f4))[_0x6f96('0x3d')](handleError(_0x26e628,null));};exports[_0x6f96('0x3e')]=function(_0x64c66a,_0x3dee6b){var _0x38d32d={'raw':![],'where':{'id':_0x64c66a[_0x6f96('0x3f')]['id']}},_0x10744d={};_0x10744d[_0x6f96('0x26')]=_['keys'](db[_0x6f96('0x3a')][_0x6f96('0x22')]);_0x10744d[_0x6f96('0x27')]=_[_0x6f96('0x28')](_0x64c66a[_0x6f96('0x27')]);_0x10744d[_0x6f96('0x29')]=_['intersection'](_0x10744d[_0x6f96('0x26')],_0x10744d[_0x6f96('0x27')]);_0x38d32d[_0x6f96('0x2c')]=_[_0x6f96('0x2a')](_0x10744d[_0x6f96('0x26')],qs[_0x6f96('0x2b')](_0x64c66a[_0x6f96('0x27')][_0x6f96('0x2b')]));_0x38d32d[_0x6f96('0x2c')]=_0x38d32d[_0x6f96('0x2c')][_0x6f96('0x2d')]?_0x38d32d[_0x6f96('0x2c')]:_0x10744d[_0x6f96('0x26')];if(_0x64c66a[_0x6f96('0x27')]['includeAll']){_0x38d32d[_0x6f96('0x39')]=[{'all':!![]}];}_0x38d32d=_[_0x6f96('0x36')]({},_0x38d32d,_0x64c66a['options']);return db[_0x6f96('0x3a')]['find'](_0x38d32d)[_0x6f96('0x1b')](handleEntityNotFound(_0x3dee6b,null))[_0x6f96('0x1b')](respondWithResult(_0x3dee6b,null))[_0x6f96('0x3d')](handleError(_0x3dee6b,null));};exports[_0x6f96('0x40')]=function(_0x7fc3df,_0x5aac52){return db['AnalyticFieldReport'][_0x6f96('0x40')](_0x7fc3df[_0x6f96('0x41')],{})['then'](respondWithResult(_0x5aac52,0xc9))['catch'](handleError(_0x5aac52,null));};exports[_0x6f96('0x42')]=function(_0x28658b,_0x544618){return db['AnalyticFieldReport'][_0x6f96('0x42')](_0x28658b['body'],{'raw':![],'individualHooks':!![]})[_0x6f96('0x1b')](respondWithResult(_0x544618,0xc9))[_0x6f96('0x3d')](handleError(_0x544618,null));};exports[_0x6f96('0x43')]=function(_0x326d00,_0x41441b){if(_0x326d00[_0x6f96('0x41')]['id']){delete _0x326d00['body']['id'];}return db[_0x6f96('0x3a')][_0x6f96('0x44')]({'where':{'id':_0x326d00[_0x6f96('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41441b,null))[_0x6f96('0x1b')](saveUpdates(_0x326d00[_0x6f96('0x41')],null))[_0x6f96('0x1b')](respondWithResult(_0x41441b,null))['catch'](handleError(_0x41441b,null));};exports[_0x6f96('0x45')]=function(_0xda6146,_0xabcbc1){return db[_0x6f96('0x3a')][_0x6f96('0x44')]({'where':{'id':_0xda6146['params']['id']}})[_0x6f96('0x1b')](handleEntityNotFound(_0xabcbc1,null))['then'](removeEntity(_0xabcbc1,null))[_0x6f96('0x3d')](handleError(_0xabcbc1,null));};exports['bulkDestroy']=function(_0x1b4e6e,_0x1e6ca7){return db[_0x6f96('0x3a')]['destroy']({'where':{'id':_0x1b4e6e['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x6f96('0x1b')](respondWithResult(_0x1e6ca7,0xcc))['catch'](handleError(_0x1e6ca7,null));};exports[_0x6f96('0x46')]=function(_0x5b197b,_0x4dea9e,_0x3d2868){return db[_0x6f96('0x47')][_0x6f96('0x48')]({'where':{'id':_0x5b197b['params']['id']}})[_0x6f96('0x1b')](handleEntityNotFound(_0x4dea9e,null))[_0x6f96('0x1b')](function(_0x4d912c){if(_0x4d912c){return db[_0x6f96('0x49')][_0x6f96('0x4a')](function(_0x1e0f55){return db['AnalyticFieldReport'][_0x6f96('0x45')]({'where':{'CustomReportId':_0x5b197b[_0x6f96('0x3f')]['id']},'transaction':_0x1e0f55})[_0x6f96('0x1b')](function(_0x5e2163){var _0x4c62ca=_[_0x6f96('0x21')](_0x5b197b[_0x6f96('0x41')],function(_0x5a2522){delete _0x5a2522['id'];_0x5a2522[_0x6f96('0x4b')]=_0x5b197b[_0x6f96('0x3f')]['id'];return _0x5a2522;});return db['AnalyticFieldReport']['bulkCreate'](_0x4c62ca,{'transaction':_0x1e0f55});});})['then'](function(){return db[_0x6f96('0x3a')][_0x6f96('0x3b')]({'where':{'CustomReportId':_0x5b197b[_0x6f96('0x3f')]['id']}});});}})[_0x6f96('0x1b')](respondWithResult(_0x4dea9e,null))[_0x6f96('0x3d')](handleError(_0x4dea9e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 46d870a..f82990c 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 _0x40f1=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x327fb0,_0x387a15){var _0x13b762=function(_0x24d37a){while(--_0x24d37a){_0x327fb0['push'](_0x327fb0['shift']());}};_0x13b762(++_0x387a15);}(_0x40f1,0x1c4));var _0x140f=function(_0x6889c0,_0x1d2088){_0x6889c0=_0x6889c0-0x0;var _0x241175=_0x40f1[_0x6889c0];return _0x241175;};'use strict';var _=require(_0x140f('0x0'));var util=require(_0x140f('0x1'));var logger=require(_0x140f('0x2'))(_0x140f('0x3'));var moment=require(_0x140f('0x4'));var BPromise=require('bluebird');var rp=require(_0x140f('0x5'));var fs=require('fs');var path=require(_0x140f('0x6'));var rimraf=require(_0x140f('0x7'));var config=require(_0x140f('0x8'));var attributes=require(_0x140f('0x9'));module[_0x140f('0xa')]=function(_0x5a9772,_0x197585){return _0x5a9772[_0x140f('0xb')](_0x140f('0xc'),attributes,{'tableName':_0x140f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2010=['exports','define','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x230e37,_0x1658c1){var _0x56d4fb=function(_0x32b96f){while(--_0x32b96f){_0x230e37['push'](_0x230e37['shift']());}};_0x56d4fb(++_0x1658c1);}(_0x2010,0x10b));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0201('0x0'));var util=require('util');var logger=require(_0x0201('0x1'))(_0x0201('0x2'));var moment=require(_0x0201('0x3'));var BPromise=require(_0x0201('0x4'));var rp=require(_0x0201('0x5'));var fs=require('fs');var path=require(_0x0201('0x6'));var rimraf=require('rimraf');var config=require(_0x0201('0x7'));var attributes=require(_0x0201('0x8'));module[_0x0201('0x9')]=function(_0x3c47af,_0x354876){return _0x3c47af[_0x0201('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x0201('0xb'),'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 53f68a2..a5c6a32 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 _0x33a7=['jayson/promise','client','http','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x113c43,_0x171537){var _0x25a1ac=function(_0x5544b2){while(--_0x5544b2){_0x113c43['push'](_0x113c43['shift']());}};_0x25a1ac(++_0x171537);}(_0x33a7,0x162));var _0x733a=function(_0x1ab313,_0x12bccc){_0x1ab313=_0x1ab313-0x0;var _0x2d73f4=_0x33a7[_0x1ab313];return _0x2d73f4;};'use strict';var _=require(_0x733a('0x0'));var util=require(_0x733a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x733a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x733a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x733a('0x4'));var config=require(_0x733a('0x5'));var jayson=require(_0x733a('0x6'));var client=jayson[_0x733a('0x7')][_0x733a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42ea39,_0x197587,_0x2ffd59){return new BPromise(function(_0x30ecdc,_0x3bfe5f){return client['request'](_0x42ea39,_0x2ffd59)['then'](function(_0x5472b9){logger[_0x733a('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x197587,_0x733a('0xa'));logger['debug'](_0x733a('0xb'),_0x197587,_0x733a('0xa'),JSON[_0x733a('0xc')](_0x5472b9));if(_0x5472b9[_0x733a('0xd')]){if(_0x5472b9['error'][_0x733a('0xe')]===0x1f4){logger['error'](_0x733a('0xf'),_0x197587,_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);return _0x3bfe5f(_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);}logger[_0x733a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x197587,_0x5472b9[_0x733a('0xd')]['message']);return _0x30ecdc(_0x5472b9[_0x733a('0xd')][_0x733a('0x10')]);}else{logger[_0x733a('0x9')](_0x733a('0xf'),_0x197587,'request\x20sent');_0x30ecdc(_0x5472b9[_0x733a('0x11')][_0x733a('0x10')]);}})['catch'](function(_0x65c413){logger['error'](_0x733a('0xf'),_0x197587,_0x65c413);_0x3bfe5f(_0x65c413);});});} \ No newline at end of file +var _0x1c69=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x1c69,0x8e));var _0x91c6=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x1c69[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x91c6('0x0'));var util=require(_0x91c6('0x1'));var moment=require(_0x91c6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91c6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x91c6('0x4'));var logger=require('../../config/logger')(_0x91c6('0x5'));var config=require(_0x91c6('0x6'));var jayson=require(_0x91c6('0x7'));var client=jayson[_0x91c6('0x8')][_0x91c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x251fac,_0x4eb0d5,_0x5c241c){return new BPromise(function(_0x20ed6a,_0x2fc93c){return client[_0x91c6('0xa')](_0x251fac,_0x5c241c)[_0x91c6('0xb')](function(_0x3ffbfb){logger[_0x91c6('0xc')](_0x91c6('0xd'),_0x4eb0d5,_0x91c6('0xe'));logger[_0x91c6('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4eb0d5,_0x91c6('0xe'),JSON[_0x91c6('0x10')](_0x3ffbfb));if(_0x3ffbfb['error']){if(_0x3ffbfb[_0x91c6('0x11')][_0x91c6('0x12')]===0x1f4){logger[_0x91c6('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4eb0d5,_0x3ffbfb[_0x91c6('0x11')]['message']);return _0x2fc93c(_0x3ffbfb[_0x91c6('0x11')]['message']);}logger['error'](_0x91c6('0xd'),_0x4eb0d5,_0x3ffbfb[_0x91c6('0x11')][_0x91c6('0x13')]);return _0x20ed6a(_0x3ffbfb[_0x91c6('0x11')][_0x91c6('0x13')]);}else{logger[_0x91c6('0xc')](_0x91c6('0xd'),_0x4eb0d5,'request\x20sent');_0x20ed6a(_0x3ffbfb[_0x91c6('0x14')][_0x91c6('0x13')]);}})[_0x91c6('0x15')](function(_0x39fa0d){logger[_0x91c6('0x11')](_0x91c6('0xd'),_0x4eb0d5,_0x39fa0d);_0x2fc93c(_0x39fa0d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a65aeb3..938fee1 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(_0x55f0a3,_0x3b326d){var _0x1c87cb=function(_0x7cd297){while(--_0x7cd297){_0x55f0a3['push'](_0x55f0a3['shift']());}};_0x1c87cb(++_0x3b326d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x2efc77,_0x5fa8bc){var _0x298dec=function(_0xd6bdb4){while(--_0xd6bdb4){_0x2efc77['push'](_0x2efc77['shift']());}};_0x298dec(++_0x5fa8bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 1451c32..cfe9aa7 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 _0xfc4c=['STRING','TEXT','sequelize','exports'];(function(_0x29a522,_0x4b440b){var _0x196807=function(_0x56eb39){while(--_0x56eb39){_0x29a522['push'](_0x29a522['shift']());}};_0x196807(++_0x4b440b);}(_0xfc4c,0xca));var _0xcfc4=function(_0x3712ba,_0xad3b36){_0x3712ba=_0x3712ba-0x0;var _0x149dcc=_0xfc4c[_0x3712ba];return _0x149dcc;};'use strict';var Sequelize=require(_0xcfc4('0x0'));module[_0xcfc4('0x1')]={'name':{'type':Sequelize[_0xcfc4('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcfc4('0x2')]},'metric':{'type':Sequelize[_0xcfc4('0x3')]},'description':{'type':Sequelize[_0xcfc4('0x2')]}}; \ No newline at end of file +var _0x33d2=['exports','STRING','TEXT','sequelize'];(function(_0x3d9d61,_0x418402){var _0x459b28=function(_0x242efd){while(--_0x242efd){_0x3d9d61['push'](_0x3d9d61['shift']());}};_0x459b28(++_0x418402);}(_0x33d2,0x7f));var _0x233d=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0x33d2[_0x321df4];return _0x50d06c;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'name':{'type':Sequelize[_0x233d('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x233d('0x2')]},'metric':{'type':Sequelize[_0x233d('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 23914d4..59088f1 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x144f18,_0x39c0ae){var _0x49ef67=function(_0x44b1a4){while(--_0x44b1a4){_0x144f18['push'](_0x144f18['shift']());}};_0x49ef67(++_0x39c0ae);}(_0x008c,0x188));var _0xc008=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0x008c[_0x568496];return _0x26c5c1;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x5ddc26,_0x440414){var _0x490987=function(_0x435f33){while(--_0x435f33){_0x5ddc26['push'](_0x5ddc26['shift']());}};_0x490987(++_0x440414);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 10fdbae..5edb2cf 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 _0x1c9a=['define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x365dbe,_0x4d3979){var _0xaa71bb=function(_0x4a0951){while(--_0x4a0951){_0x365dbe['push'](_0x365dbe['shift']());}};_0xaa71bb(++_0x4d3979);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0xf98ccf,_0x5b3b82){_0xf98ccf=_0xf98ccf-0x0;var _0xdd41b4=_0x1c9a[_0xf98ccf];return _0xdd41b4;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var logger=require('../../config/logger')(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var rp=require(_0xa1c9('0x5'));var fs=require('fs');var path=require(_0xa1c9('0x6'));var rimraf=require('rimraf');var config=require(_0xa1c9('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xa1c9('0x8')]=function(_0xdd22bf,_0x237862){return _0xdd22bf[_0xa1c9('0x9')](_0xa1c9('0xa'),attributes,{'tableName':_0xa1c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99fb=['bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticMetric','lodash','../../config/logger','api','moment'];(function(_0x3aeea6,_0xdba2af){var _0x353a0b=function(_0x1d0f56){while(--_0x1d0f56){_0x3aeea6['push'](_0x3aeea6['shift']());}};_0x353a0b(++_0xdba2af);}(_0x99fb,0x92));var _0xb99f=function(_0x12a0a,_0x3f5ec7){_0x12a0a=_0x12a0a-0x0;var _0x177d18=_0x99fb[_0x12a0a];return _0x177d18;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var logger=require(_0xb99f('0x1'))(_0xb99f('0x2'));var moment=require(_0xb99f('0x3'));var BPromise=require(_0xb99f('0x4'));var rp=require(_0xb99f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb99f('0x6'));var config=require(_0xb99f('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xb99f('0x8')]=function(_0x1f4c29,_0xd9eac9){return _0x1f4c29['define'](_0xb99f('0x9'),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 321af44..4e295ae 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 _0xdd5b=['randomstring','ioredis','../../config/utils','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0xdd5b,0x174));var _0xbdd5=function(_0x530c78,_0x3e9345){_0x530c78=_0x530c78-0x0;var _0x155f17=_0xdd5b[_0x530c78];return _0x155f17;};'use strict';var _=require(_0xbdd5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdd5('0x1'));var rs=require(_0xbdd5('0x2'));var fs=require('fs');var Redis=require(_0xbdd5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdd5('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbdd5('0x5'));var client=jayson[_0xbdd5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a43f9,_0x59912f,_0x554c2d){return new BPromise(function(_0x4b0767,_0x1ec6f4){return client['request'](_0x2a43f9,_0x554c2d)[_0xbdd5('0x7')](function(_0x918acc){logger[_0xbdd5('0x8')](_0xbdd5('0x9'),_0x59912f,_0xbdd5('0xa'));logger[_0xbdd5('0xb')](_0xbdd5('0xc'),_0x59912f,_0xbdd5('0xa'),JSON['stringify'](_0x918acc));if(_0x918acc[_0xbdd5('0xd')]){if(_0x918acc[_0xbdd5('0xd')][_0xbdd5('0xe')]===0x1f4){logger[_0xbdd5('0xd')](_0xbdd5('0x9'),_0x59912f,_0x918acc['error'][_0xbdd5('0xf')]);return _0x1ec6f4(_0x918acc[_0xbdd5('0xd')]['message']);}logger[_0xbdd5('0xd')](_0xbdd5('0x9'),_0x59912f,_0x918acc['error']['message']);return _0x4b0767(_0x918acc[_0xbdd5('0xd')][_0xbdd5('0xf')]);}else{logger[_0xbdd5('0x8')](_0xbdd5('0x9'),_0x59912f,_0xbdd5('0xa'));_0x4b0767(_0x918acc['result'][_0xbdd5('0xf')]);}})[_0xbdd5('0x10')](function(_0x137df8){logger[_0xbdd5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x59912f,_0x137df8);_0x1ec6f4(_0x137df8);});});} \ No newline at end of file +var _0x5052=['util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x5052,0x110));var _0x2505=function(_0x35ef7a,_0x2b3df3){_0x35ef7a=_0x35ef7a-0x0;var _0x3e1c56=_0x5052[_0x35ef7a];return _0x3e1c56;};'use strict';var _=require(_0x2505('0x0'));var util=require(_0x2505('0x1'));var moment=require('moment');var BPromise=require(_0x2505('0x2'));var rs=require(_0x2505('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2505('0x5'))(_0x2505('0x6'));var config=require(_0x2505('0x7'));var jayson=require(_0x2505('0x8'));var client=jayson[_0x2505('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35cd9b,_0x25183a,_0x4d2629){return new BPromise(function(_0x25cce1,_0x322db1){return client[_0x2505('0xa')](_0x35cd9b,_0x4d2629)[_0x2505('0xb')](function(_0x352818){logger[_0x2505('0xc')](_0x2505('0xd'),_0x25183a,_0x2505('0xe'));logger['debug'](_0x2505('0xf'),_0x25183a,_0x2505('0xe'),JSON['stringify'](_0x352818));if(_0x352818[_0x2505('0x10')]){if(_0x352818[_0x2505('0x10')][_0x2505('0x11')]===0x1f4){logger[_0x2505('0x10')](_0x2505('0xd'),_0x25183a,_0x352818[_0x2505('0x10')][_0x2505('0x12')]);return _0x322db1(_0x352818[_0x2505('0x10')][_0x2505('0x12')]);}logger[_0x2505('0x10')](_0x2505('0xd'),_0x25183a,_0x352818['error'][_0x2505('0x12')]);return _0x25cce1(_0x352818[_0x2505('0x10')][_0x2505('0x12')]);}else{logger[_0x2505('0xc')](_0x2505('0xd'),_0x25183a,_0x2505('0xe'));_0x25cce1(_0x352818[_0x2505('0x13')]['message']);}})[_0x2505('0x14')](function(_0x18e262){logger[_0x2505('0x10')](_0x2505('0xd'),_0x25183a,_0x18e262);_0x322db1(_0x18e262);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 23ac396..4f41746 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 _0xb1d3=['./analyticMetric.controller','get','isAuthenticated','/:id','show','post','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3616e6,_0x2cb828){var _0x9de004=function(_0x548b53){while(--_0x548b53){_0x3616e6['push'](_0x3616e6['shift']());}};_0x9de004(++_0x2cb828);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x2e5b20,_0x3dc933){_0x2e5b20=_0x2e5b20-0x0;var _0x459287=_0xb1d3[_0x2e5b20];return _0x459287;};'use strict';var multer=require(_0x3b1d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b1d('0x1'));var router=express[_0x3b1d('0x2')]();var fs_extra=require(_0x3b1d('0x3'));var auth=require(_0x3b1d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3b1d('0x5'));var controller=require(_0x3b1d('0x6'));router[_0x3b1d('0x7')]('/',auth[_0x3b1d('0x8')](),controller['index']);router['get'](_0x3b1d('0x9'),auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xa')]);router[_0x3b1d('0xb')]('/',auth[_0x3b1d('0x8')](),controller['create']);router['put'](_0x3b1d('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xc')]);module[_0x3b1d('0xd')]=router; \ No newline at end of file +var _0x23f4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','delete','destroy','util'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x23f4,0x1ee));var _0x423f=function(_0x35d2bf,_0x2eb83f){_0x35d2bf=_0x35d2bf-0x0;var _0x5e2f9d=_0x23f4[_0x35d2bf];return _0x5e2f9d;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0xc')]('/',auth[_0x423f('0x9')](),controller['create']);router['put']('/:id',auth[_0x423f('0x9')](),controller['update']);router[_0x423f('0xd')](_0x423f('0xa'),auth[_0x423f('0x9')](),controller[_0x423f('0xe')]);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 f73a5dc..3ed4445 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 _0x3dc0=['exports','TEXT','sequelize'];(function(_0x550606,_0x477571){var _0xd825d1=function(_0x1b2e0e){while(--_0x1b2e0e){_0x550606['push'](_0x550606['shift']());}};_0xd825d1(++_0x477571);}(_0x3dc0,0x104));var _0x03dc=function(_0x4fe167,_0x2bc589){_0x4fe167=_0x4fe167-0x0;var _0x57ec01=_0x3dc0[_0x4fe167];return _0x57ec01;};'use strict';var Sequelize=require(_0x03dc('0x0'));module[_0x03dc('0x1')]={'tree':{'type':Sequelize[_0x03dc('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0c2e=['sequelize','exports'];(function(_0x306412,_0x275c67){var _0x3ce1da=function(_0x5c6fe9){while(--_0x5c6fe9){_0x306412['push'](_0x306412['shift']());}};_0x3ce1da(++_0x275c67);}(_0x0c2e,0xc8));var _0xe0c2=function(_0x4c82d3,_0x5aa853){_0x4c82d3=_0x4c82d3-0x0;var _0x226061=_0x0c2e[_0x4c82d3];return _0x226061;};'use strict';var Sequelize=require(_0xe0c2('0x0'));module[_0xe0c2('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 47bd41d..3ae90af 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 _0x8eba=['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','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x47828e,_0x2ee73e){var _0x6d642c=function(_0x1a7cb2){while(--_0x1a7cb2){_0x47828e['push'](_0x47828e['shift']());}};_0x6d642c(++_0x2ee73e);}(_0x8eba,0x173));var _0xa8eb=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0x8eba[_0x5976f8];return _0x179715;};'use strict';var emlformat=require(_0xa8eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8eb('0x1'));var jsonpatch=require(_0xa8eb('0x2'));var rp=require(_0xa8eb('0x3'));var moment=require(_0xa8eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa8eb('0x5'));var path=require(_0xa8eb('0x6'));var sox=require(_0xa8eb('0x7'));var csv=require(_0xa8eb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8eb('0x9'));var _=require(_0xa8eb('0xa'));var squel=require(_0xa8eb('0xb'));var crypto=require(_0xa8eb('0xc'));var jsforce=require(_0xa8eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa8eb('0x8'));var querystring=require(_0xa8eb('0xe'));var Papa=require(_0xa8eb('0xf'));var Redis=require(_0xa8eb('0x10'));var authService=require(_0xa8eb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8eb('0x12'));var hardwareService=require(_0xa8eb('0x13'));var logger=require(_0xa8eb('0x14'))(_0xa8eb('0x15'));var utils=require(_0xa8eb('0x16'));var config=require(_0xa8eb('0x17'));var licenseUtil=require(_0xa8eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28431c,_0x3996dc){_0x3996dc=_0x3996dc||0xcc;return function(_0x26c5b6){if(_0x26c5b6){return _0x28431c[_0xa8eb('0x19')](_0x3996dc);}return _0x28431c[_0xa8eb('0x1a')](_0x3996dc)[_0xa8eb('0x1b')]();};}function respondWithResult(_0x46b5ae,_0x50970b){_0x50970b=_0x50970b||0xc8;return function(_0x28f917){if(_0x28f917){return _0x46b5ae['status'](_0x50970b)['json'](_0x28f917);}};}function respondWithFilteredResult(_0x38b717,_0x136a94){return function(_0x5bbc11){if(_0x5bbc11){var _0x23b53d=typeof _0x136a94[_0xa8eb('0x1c')]==='undefined'&&typeof _0x136a94[_0xa8eb('0x1d')]===_0xa8eb('0x1e');var _0x15580d=_0x5bbc11[_0xa8eb('0x1f')];var _0x1e1184=_0x23b53d?0x0:_0x136a94[_0xa8eb('0x1c')];var _0x20cbd0=_0x23b53d?_0x5bbc11[_0xa8eb('0x1f')]:_0x136a94[_0xa8eb('0x1c')]+_0x136a94[_0xa8eb('0x1d')];var _0x2a388d;if(_0x20cbd0>=_0x15580d){_0x20cbd0=_0x15580d;_0x2a388d=0xc8;}else{_0x2a388d=0xce;}_0x38b717['status'](_0x2a388d);return _0x38b717['set'](_0xa8eb('0x20'),_0x1e1184+'-'+_0x20cbd0+'/'+_0x15580d)[_0xa8eb('0x21')](_0x5bbc11);}return null;};}function patchUpdates(_0x3033b4){return function(_0x424d1a){try{jsonpatch[_0xa8eb('0x22')](_0x424d1a,_0x3033b4,!![]);}catch(_0x35084d){return BPromise['reject'](_0x35084d);}return _0x424d1a[_0xa8eb('0x23')]();};}function saveUpdates(_0x3934d5,_0x2e0bf3){return function(_0x48d37a){if(_0x48d37a){return _0x48d37a[_0xa8eb('0x24')](_0x3934d5)[_0xa8eb('0x25')](function(_0x32aa54){return _0x32aa54;});}return null;};}function removeEntity(_0x230ce1,_0x28aa0f){return function(_0x1a1cb3){if(_0x1a1cb3){return _0x1a1cb3[_0xa8eb('0x26')]()[_0xa8eb('0x25')](function(){_0x230ce1[_0xa8eb('0x1a')](0xcc)[_0xa8eb('0x1b')]();});}};}function handleEntityNotFound(_0x104baf,_0x1fefbc){return function(_0x2a160a){if(!_0x2a160a){_0x104baf[_0xa8eb('0x19')](0x194);}return _0x2a160a;};}function handleError(_0x3f9c3c,_0x566b12){_0x566b12=_0x566b12||0x1f4;return function(_0x46dbcd){logger[_0xa8eb('0x27')](_0x46dbcd[_0xa8eb('0x28')]);if(_0x46dbcd[_0xa8eb('0x29')]){delete _0x46dbcd['name'];}_0x3f9c3c['status'](_0x566b12)['send'](_0x46dbcd);};}exports[_0xa8eb('0x2a')]=function(_0x54319d,_0x4344d3){var _0x2302f7={},_0x1d0853={},_0x27cc25={'count':0x0,'rows':[]};var _0x27a1b0=_[_0xa8eb('0x2b')](db[_0xa8eb('0x2c')][_0xa8eb('0x2d')],function(_0x522684){return{'name':_0x522684[_0xa8eb('0x2e')],'type':_0x522684[_0xa8eb('0x2f')][_0xa8eb('0x30')]};});_0x1d0853[_0xa8eb('0x31')]=_['map'](_0x27a1b0,_0xa8eb('0x29'));_0x1d0853[_0xa8eb('0x32')]=_[_0xa8eb('0x33')](_0x54319d[_0xa8eb('0x32')]);_0x1d0853[_0xa8eb('0x34')]=_[_0xa8eb('0x35')](_0x1d0853[_0xa8eb('0x31')],_0x1d0853[_0xa8eb('0x32')]);_0x2302f7[_0xa8eb('0x36')]=_[_0xa8eb('0x35')](_0x1d0853[_0xa8eb('0x31')],qs[_0xa8eb('0x37')](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x37')]));_0x2302f7[_0xa8eb('0x36')]=_0x2302f7[_0xa8eb('0x36')]['length']?_0x2302f7[_0xa8eb('0x36')]:_0x1d0853[_0xa8eb('0x31')];if(!_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x38')](_0xa8eb('0x39'))){_0x2302f7['limit']=qs['limit'](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x1d')]);_0x2302f7['offset']=qs[_0xa8eb('0x1c')](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x1c')]);}_0x2302f7[_0xa8eb('0x3a')]=qs['sort'](_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3b')]);_0x2302f7[_0xa8eb('0x3c')]=qs[_0xa8eb('0x34')](_['pick'](_0x54319d[_0xa8eb('0x32')],_0x1d0853[_0xa8eb('0x34')]),_0x27a1b0);if(_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3d')]){_0x2302f7[_0xa8eb('0x3c')]=_[_0xa8eb('0x3e')](_0x2302f7[_0xa8eb('0x3c')],{'$or':_['map'](_0x27a1b0,function(_0xc72997){if(_0xc72997[_0xa8eb('0x2f')]!==_0xa8eb('0x3f')){var _0x33e208={};_0x33e208[_0xc72997[_0xa8eb('0x29')]]={'$like':'%'+_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x3d')]+'%'};return _0x33e208;}})});}_0x2302f7=_[_0xa8eb('0x3e')]({},_0x2302f7,_0x54319d['options']);var _0x1090b4={'where':_0x2302f7[_0xa8eb('0x3c')]};return db['AnalyticTreeReport'][_0xa8eb('0x1f')](_0x1090b4)['then'](function(_0x53c87b){_0x27cc25[_0xa8eb('0x1f')]=_0x53c87b;if(_0x54319d[_0xa8eb('0x32')][_0xa8eb('0x40')]){_0x2302f7[_0xa8eb('0x41')]=[{'all':!![]}];}return db[_0xa8eb('0x2c')][_0xa8eb('0x42')](_0x2302f7);})[_0xa8eb('0x25')](function(_0x14f0a3){_0x27cc25[_0xa8eb('0x43')]=_0x14f0a3;return _0x27cc25;})[_0xa8eb('0x25')](respondWithFilteredResult(_0x4344d3,_0x2302f7))[_0xa8eb('0x44')](handleError(_0x4344d3,null));};exports[_0xa8eb('0x45')]=function(_0x22a7ac,_0x3b3b7c){var _0x51d8fa={'raw':!![],'where':{'id':_0x22a7ac['params']['id']}},_0x3b3688={};_0x3b3688[_0xa8eb('0x31')]=_['keys'](db['AnalyticTreeReport'][_0xa8eb('0x2d')]);_0x3b3688[_0xa8eb('0x32')]=_['keys'](_0x22a7ac[_0xa8eb('0x32')]);_0x3b3688[_0xa8eb('0x34')]=_[_0xa8eb('0x35')](_0x3b3688[_0xa8eb('0x31')],_0x3b3688[_0xa8eb('0x32')]);_0x51d8fa[_0xa8eb('0x36')]=_['intersection'](_0x3b3688['model'],qs[_0xa8eb('0x37')](_0x22a7ac[_0xa8eb('0x32')][_0xa8eb('0x37')]));_0x51d8fa[_0xa8eb('0x36')]=_0x51d8fa['attributes'][_0xa8eb('0x46')]?_0x51d8fa[_0xa8eb('0x36')]:_0x3b3688[_0xa8eb('0x31')];if(_0x22a7ac['query'][_0xa8eb('0x40')]){_0x51d8fa[_0xa8eb('0x41')]=[{'all':!![]}];}_0x51d8fa=_[_0xa8eb('0x3e')]({},_0x51d8fa,_0x22a7ac[_0xa8eb('0x47')]);return db[_0xa8eb('0x2c')]['find'](_0x51d8fa)[_0xa8eb('0x25')](handleEntityNotFound(_0x3b3b7c,null))[_0xa8eb('0x25')](respondWithResult(_0x3b3b7c,null))[_0xa8eb('0x44')](handleError(_0x3b3b7c,null));};exports[_0xa8eb('0x48')]=function(_0x338425,_0x3699ff){return db[_0xa8eb('0x2c')][_0xa8eb('0x48')](_0x338425[_0xa8eb('0x49')],{})[_0xa8eb('0x25')](respondWithResult(_0x3699ff,0xc9))[_0xa8eb('0x44')](handleError(_0x3699ff,null));};exports[_0xa8eb('0x24')]=function(_0x80847f,_0x484878){if(_0x80847f['body']['id']){delete _0x80847f[_0xa8eb('0x49')]['id'];}return db[_0xa8eb('0x2c')][_0xa8eb('0x4a')]({'where':{'id':_0x80847f[_0xa8eb('0x4b')]['id']}})[_0xa8eb('0x25')](handleEntityNotFound(_0x484878,null))[_0xa8eb('0x25')](saveUpdates(_0x80847f[_0xa8eb('0x49')],null))[_0xa8eb('0x25')](respondWithResult(_0x484878,null))[_0xa8eb('0x44')](handleError(_0x484878,null));};exports[_0xa8eb('0x26')]=function(_0x1bdbb5,_0x179232){return db[_0xa8eb('0x2c')][_0xa8eb('0x4a')]({'where':{'id':_0x1bdbb5[_0xa8eb('0x4b')]['id']}})[_0xa8eb('0x25')](handleEntityNotFound(_0x179232,null))[_0xa8eb('0x25')](removeEntity(_0x179232,null))[_0xa8eb('0x44')](handleError(_0x179232,null));}; \ No newline at end of file +var _0x0bcf=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','create','body','params','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs','squel','crypto'];(function(_0x193979,_0x287848){var _0x5b69ab=function(_0x5e5b8e){while(--_0x5e5b8e){_0x193979['push'](_0x193979['shift']());}};_0x5b69ab(++_0x287848);}(_0x0bcf,0x11e));var _0xf0bc=function(_0xad7d4c,_0x23ad4a){_0xad7d4c=_0xad7d4c-0x0;var _0xcf0feb=_0x0bcf[_0xad7d4c];return _0xcf0feb;};'use strict';var emlformat=require(_0xf0bc('0x0'));var rimraf=require(_0xf0bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0bc('0x2'));var rp=require('request-promise');var moment=require(_0xf0bc('0x3'));var BPromise=require(_0xf0bc('0x4'));var Mustache=require('mustache');var util=require(_0xf0bc('0x5'));var path=require('path');var sox=require(_0xf0bc('0x6'));var csv=require('to-csv');var ejs=require(_0xf0bc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf0bc('0x8'));var crypto=require(_0xf0bc('0x9'));var jsforce=require(_0xf0bc('0xa'));var deskjs=require(_0xf0bc('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf0bc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0bc('0xd'));var qs=require(_0xf0bc('0xe'));var as=require(_0xf0bc('0xf'));var hardwareService=require(_0xf0bc('0x10'));var logger=require(_0xf0bc('0x11'))(_0xf0bc('0x12'));var utils=require('../../config/utils');var config=require(_0xf0bc('0x13'));var licenseUtil=require(_0xf0bc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f4cf7,_0x6f10eb){_0x6f10eb=_0x6f10eb||0xcc;return function(_0x511291){if(_0x511291){return _0x2f4cf7[_0xf0bc('0x15')](_0x6f10eb);}return _0x2f4cf7[_0xf0bc('0x16')](_0x6f10eb)[_0xf0bc('0x17')]();};}function respondWithResult(_0x5dd0db,_0x2c738f){_0x2c738f=_0x2c738f||0xc8;return function(_0x5e5f48){if(_0x5e5f48){return _0x5dd0db[_0xf0bc('0x16')](_0x2c738f)[_0xf0bc('0x18')](_0x5e5f48);}};}function respondWithFilteredResult(_0x51d383,_0x5e82d8){return function(_0x5401b5){if(_0x5401b5){var _0x4583a1=typeof _0x5e82d8[_0xf0bc('0x19')]===_0xf0bc('0x1a')&&typeof _0x5e82d8[_0xf0bc('0x1b')]==='undefined';var _0x324dfc=_0x5401b5[_0xf0bc('0x1c')];var _0x38de6a=_0x4583a1?0x0:_0x5e82d8[_0xf0bc('0x19')];var _0x664a72=_0x4583a1?_0x5401b5[_0xf0bc('0x1c')]:_0x5e82d8[_0xf0bc('0x19')]+_0x5e82d8['limit'];var _0x780942;if(_0x664a72>=_0x324dfc){_0x664a72=_0x324dfc;_0x780942=0xc8;}else{_0x780942=0xce;}_0x51d383[_0xf0bc('0x16')](_0x780942);return _0x51d383[_0xf0bc('0x1d')](_0xf0bc('0x1e'),_0x38de6a+'-'+_0x664a72+'/'+_0x324dfc)['json'](_0x5401b5);}return null;};}function patchUpdates(_0x5ba691){return function(_0x587f9e){try{jsonpatch[_0xf0bc('0x1f')](_0x587f9e,_0x5ba691,!![]);}catch(_0x59373a){return BPromise[_0xf0bc('0x20')](_0x59373a);}return _0x587f9e[_0xf0bc('0x21')]();};}function saveUpdates(_0x4007dd,_0x34147b){return function(_0x2440e3){if(_0x2440e3){return _0x2440e3[_0xf0bc('0x22')](_0x4007dd)['then'](function(_0x5866f4){return _0x5866f4;});}return null;};}function removeEntity(_0x4ec230,_0x3a4ca3){return function(_0xaa7cf4){if(_0xaa7cf4){return _0xaa7cf4[_0xf0bc('0x23')]()[_0xf0bc('0x24')](function(){_0x4ec230['status'](0xcc)[_0xf0bc('0x17')]();});}};}function handleEntityNotFound(_0x14fc80,_0xedb2ef){return function(_0x518683){if(!_0x518683){_0x14fc80[_0xf0bc('0x15')](0x194);}return _0x518683;};}function handleError(_0x19945c,_0x258813){_0x258813=_0x258813||0x1f4;return function(_0x21752f){logger[_0xf0bc('0x25')](_0x21752f[_0xf0bc('0x26')]);if(_0x21752f['name']){delete _0x21752f[_0xf0bc('0x27')];}_0x19945c[_0xf0bc('0x16')](_0x258813)[_0xf0bc('0x28')](_0x21752f);};}exports[_0xf0bc('0x29')]=function(_0x138ea5,_0x2e81fe){var _0x33608f={},_0x536f58={},_0x455e0a={'count':0x0,'rows':[]};var _0x50b3a8=_[_0xf0bc('0x2a')](db[_0xf0bc('0x2b')][_0xf0bc('0x2c')],function(_0x136f44){return{'name':_0x136f44[_0xf0bc('0x2d')],'type':_0x136f44[_0xf0bc('0x2e')][_0xf0bc('0x2f')]};});_0x536f58[_0xf0bc('0x30')]=_[_0xf0bc('0x2a')](_0x50b3a8,_0xf0bc('0x27'));_0x536f58[_0xf0bc('0x31')]=_[_0xf0bc('0x32')](_0x138ea5['query']);_0x536f58[_0xf0bc('0x33')]=_['intersection'](_0x536f58[_0xf0bc('0x30')],_0x536f58[_0xf0bc('0x31')]);_0x33608f[_0xf0bc('0x34')]=_[_0xf0bc('0x35')](_0x536f58[_0xf0bc('0x30')],qs[_0xf0bc('0x36')](_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x36')]));_0x33608f['attributes']=_0x33608f[_0xf0bc('0x34')][_0xf0bc('0x37')]?_0x33608f[_0xf0bc('0x34')]:_0x536f58[_0xf0bc('0x30')];if(!_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x38')](_0xf0bc('0x39'))){_0x33608f[_0xf0bc('0x1b')]=qs['limit'](_0x138ea5['query'][_0xf0bc('0x1b')]);_0x33608f[_0xf0bc('0x19')]=qs[_0xf0bc('0x19')](_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x19')]);}_0x33608f[_0xf0bc('0x3a')]=qs[_0xf0bc('0x3b')](_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x3b')]);_0x33608f['where']=qs[_0xf0bc('0x33')](_['pick'](_0x138ea5[_0xf0bc('0x31')],_0x536f58[_0xf0bc('0x33')]),_0x50b3a8);if(_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x3c')]){_0x33608f[_0xf0bc('0x3d')]=_[_0xf0bc('0x3e')](_0x33608f[_0xf0bc('0x3d')],{'$or':_[_0xf0bc('0x2a')](_0x50b3a8,function(_0xe5e867){if(_0xe5e867['type']!=='VIRTUAL'){var _0x168be1={};_0x168be1[_0xe5e867[_0xf0bc('0x27')]]={'$like':'%'+_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x3c')]+'%'};return _0x168be1;}})});}_0x33608f=_[_0xf0bc('0x3e')]({},_0x33608f,_0x138ea5[_0xf0bc('0x3f')]);var _0x52c474={'where':_0x33608f['where']};return db[_0xf0bc('0x2b')][_0xf0bc('0x1c')](_0x52c474)['then'](function(_0x55ef79){_0x455e0a[_0xf0bc('0x1c')]=_0x55ef79;if(_0x138ea5[_0xf0bc('0x31')][_0xf0bc('0x40')]){_0x33608f[_0xf0bc('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xf0bc('0x42')](_0x33608f);})[_0xf0bc('0x24')](function(_0x1740bf){_0x455e0a[_0xf0bc('0x43')]=_0x1740bf;return _0x455e0a;})['then'](respondWithFilteredResult(_0x2e81fe,_0x33608f))[_0xf0bc('0x44')](handleError(_0x2e81fe,null));};exports[_0xf0bc('0x45')]=function(_0x51514a,_0x1cd733){var _0x5dc5d7={'raw':!![],'where':{'id':_0x51514a['params']['id']}},_0x3a544c={};_0x3a544c[_0xf0bc('0x30')]=_[_0xf0bc('0x32')](db[_0xf0bc('0x2b')][_0xf0bc('0x2c')]);_0x3a544c[_0xf0bc('0x31')]=_[_0xf0bc('0x32')](_0x51514a[_0xf0bc('0x31')]);_0x3a544c[_0xf0bc('0x33')]=_[_0xf0bc('0x35')](_0x3a544c[_0xf0bc('0x30')],_0x3a544c[_0xf0bc('0x31')]);_0x5dc5d7[_0xf0bc('0x34')]=_[_0xf0bc('0x35')](_0x3a544c[_0xf0bc('0x30')],qs['fields'](_0x51514a[_0xf0bc('0x31')][_0xf0bc('0x36')]));_0x5dc5d7[_0xf0bc('0x34')]=_0x5dc5d7['attributes']['length']?_0x5dc5d7[_0xf0bc('0x34')]:_0x3a544c['model'];if(_0x51514a[_0xf0bc('0x31')]['includeAll']){_0x5dc5d7[_0xf0bc('0x41')]=[{'all':!![]}];}_0x5dc5d7=_[_0xf0bc('0x3e')]({},_0x5dc5d7,_0x51514a['options']);return db[_0xf0bc('0x2b')]['find'](_0x5dc5d7)[_0xf0bc('0x24')](handleEntityNotFound(_0x1cd733,null))[_0xf0bc('0x24')](respondWithResult(_0x1cd733,null))['catch'](handleError(_0x1cd733,null));};exports['create']=function(_0x374b75,_0x5b7964){return db[_0xf0bc('0x2b')][_0xf0bc('0x46')](_0x374b75[_0xf0bc('0x47')],{})[_0xf0bc('0x24')](respondWithResult(_0x5b7964,0xc9))[_0xf0bc('0x44')](handleError(_0x5b7964,null));};exports[_0xf0bc('0x22')]=function(_0x2a0742,_0x27931c){if(_0x2a0742[_0xf0bc('0x47')]['id']){delete _0x2a0742[_0xf0bc('0x47')]['id'];}return db[_0xf0bc('0x2b')]['find']({'where':{'id':_0x2a0742[_0xf0bc('0x48')]['id']}})[_0xf0bc('0x24')](handleEntityNotFound(_0x27931c,null))['then'](saveUpdates(_0x2a0742['body'],null))[_0xf0bc('0x24')](respondWithResult(_0x27931c,null))[_0xf0bc('0x44')](handleError(_0x27931c,null));};exports[_0xf0bc('0x23')]=function(_0x209e63,_0x54165f){return db[_0xf0bc('0x2b')][_0xf0bc('0x49')]({'where':{'id':_0x209e63[_0xf0bc('0x48')]['id']}})['then'](handleEntityNotFound(_0x54165f,null))[_0xf0bc('0x24')](removeEntity(_0x54165f,null))[_0xf0bc('0x44')](handleError(_0x54165f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 58d29d6..b3b1dc1 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 _0xfec6=['util','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','lodash'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0xfec6,0x1a7));var _0x6fec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfec6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6fec('0x0'));var util=require(_0x6fec('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6fec('0x2'));var fs=require('fs');var path=require(_0x6fec('0x3'));var rimraf=require(_0x6fec('0x4'));var config=require(_0x6fec('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5985d3,_0x3409f5){return _0x5985d3[_0x6fec('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x6fec('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52d1=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird'];(function(_0x485028,_0x5c92ba){var _0x474eef=function(_0x47f2e9){while(--_0x47f2e9){_0x485028['push'](_0x485028['shift']());}};_0x474eef(++_0x5c92ba);}(_0x52d1,0x97));var _0x152d=function(_0xf5815c,_0x363fbc){_0xf5815c=_0xf5815c-0x0;var _0x2dfed8=_0x52d1[_0xf5815c];return _0x2dfed8;};'use strict';var _=require(_0x152d('0x0'));var util=require(_0x152d('0x1'));var logger=require(_0x152d('0x2'))('api');var moment=require(_0x152d('0x3'));var BPromise=require(_0x152d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x152d('0x5'));var rimraf=require(_0x152d('0x6'));var config=require(_0x152d('0x7'));var attributes=require(_0x152d('0x8'));module['exports']=function(_0x4dd758,_0x18bef2){return _0x4dd758[_0x152d('0x9')](_0x152d('0xa'),attributes,{'tableName':_0x152d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 86bf38a..e2b30cd 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 _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(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0xadb5,0xad));var _0x5adb=function(_0x5051dc,_0x37ac45){_0x5051dc=_0x5051dc-0x0;var _0x4b06cf=_0xadb5[_0x5051dc];return _0x4b06cf;};'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 +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1c5453,_0x303ca5){_0x1c5453=_0x1c5453-0x0;var _0x23ba82=_0x7a54[_0x1c5453];return _0x23ba82;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7c54e03..c6c556a 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 _0x1dfd=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x38caad,_0x1c732e){var _0x3e3dba=function(_0x48ce69){while(--_0x48ce69){_0x38caad['push'](_0x38caad['shift']());}};_0x3e3dba(++_0x1c732e);}(_0x1dfd,0xe7));var _0xd1df=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1dfd[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xd1df('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd1df('0x1'));var router=express[_0xd1df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd1df('0x3'));var interaction=require(_0xd1df('0x4'));var config=require(_0xd1df('0x5'));var controller=require(_0xd1df('0x6'));router[_0xd1df('0x7')]('/',auth[_0xd1df('0x8')](),controller[_0xd1df('0x9')]);router[_0xd1df('0x7')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0xb')]);router[_0xd1df('0xc')]('/',auth[_0xd1df('0x8')](),controller['create']);router[_0xd1df('0xd')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0xe')]);router[_0xd1df('0xf')](_0xd1df('0xa'),auth[_0xd1df('0x8')](),controller[_0xd1df('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa9ec=['fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x3e1926,_0x11e729){var _0x5517e9=function(_0x5cc4b0){while(--_0x5cc4b0){_0x3e1926['push'](_0x3e1926['shift']());}};_0x5517e9(++_0x11e729);}(_0xa9ec,0x18b));var _0xca9e=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0xa9ec[_0x5da27f];return _0x54a3fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xca9e('0x0'));var timeout=require(_0xca9e('0x1'));var express=require(_0xca9e('0x2'));var router=express[_0xca9e('0x3')]();var fs_extra=require(_0xca9e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xca9e('0x5'));var config=require('../../config/environment');var controller=require(_0xca9e('0x6'));router[_0xca9e('0x7')]('/',auth[_0xca9e('0x8')](),controller[_0xca9e('0x9')]);router[_0xca9e('0x7')](_0xca9e('0xa'),auth[_0xca9e('0x8')](),controller[_0xca9e('0xb')]);router[_0xca9e('0xc')]('/',auth['isAuthenticated'](),controller[_0xca9e('0xd')]);router[_0xca9e('0xe')]('/:id',auth[_0xca9e('0x8')](),controller[_0xca9e('0xf')]);router[_0xca9e('0x10')](_0xca9e('0xa'),auth['isAuthenticated'](),controller[_0xca9e('0x11')]);module[_0xca9e('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 72e836b..0cc7b91 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 _0xb458=['STRING','sequelize','exports'];(function(_0x32f8a2,_0x49c502){var _0x258cca=function(_0x1040e4){while(--_0x1040e4){_0x32f8a2['push'](_0x32f8a2['shift']());}};_0x258cca(++_0x49c502);}(_0xb458,0x103));var _0x8b45=function(_0x1f5048,_0x35594a){_0x1f5048=_0x1f5048-0x0;var _0x4f17fd=_0xb458[_0x1f5048];return _0x4f17fd;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5ed2=['sequelize','STRING'];(function(_0x149456,_0x34c3db){var _0x13cb53=function(_0xc5b251){while(--_0xc5b251){_0x149456['push'](_0x149456['shift']());}};_0x13cb53(++_0x34c3db);}(_0x5ed2,0x114));var _0x25ed=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0x5ed2[_0x4d3a9b];return _0x1b5471;};'use strict';var Sequelize=require(_0x25ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x25ed('0x1')]},'basename':{'type':Sequelize[_0x25ed('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c76cbeb..5d0cbaa 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 _0x7710=['basename','filename','type','findOne','join','root','server/files/attachments/','download','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','Content-Range','json','apply','update','then','destroy','sendStatus','name','map','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','show','params','rawAttributes','find','get','omit','body','create','catch','file','originalname'];(function(_0x271026,_0x40c532){var _0x6366a1=function(_0x5c770b){while(--_0x5c770b){_0x271026['push'](_0x271026['shift']());}};_0x6366a1(++_0x40c532);}(_0x7710,0x1dc));var _0x0771=function(_0x2debdf,_0x14c17){_0x2debdf=_0x2debdf-0x0;var _0xdee766=_0x7710[_0x2debdf];return _0xdee766;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0771('0x0'));var zipdir=require(_0x0771('0x1'));var jsonpatch=require(_0x0771('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0771('0x3'));var Mustache=require(_0x0771('0x4'));var util=require(_0x0771('0x5'));var path=require(_0x0771('0x6'));var sox=require(_0x0771('0x7'));var csv=require('to-csv');var ejs=require(_0x0771('0x8'));var fs=require('fs');var fs_extra=require(_0x0771('0x9'));var _=require(_0x0771('0xa'));var squel=require(_0x0771('0xb'));var crypto=require('crypto');var jsforce=require(_0x0771('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0771('0xd'));var querystring=require(_0x0771('0xe'));var Papa=require(_0x0771('0xf'));var Redis=require('ioredis');var authService=require(_0x0771('0x10'));var qs=require(_0x0771('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0771('0x12'));var logger=require('../../config/logger')(_0x0771('0x13'));var utils=require(_0x0771('0x14'));var config=require(_0x0771('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122ca6,_0x526737){_0x526737=_0x526737||0xcc;return function(_0xd34bb){if(_0xd34bb){return _0x122ca6['sendStatus'](_0x526737);}return _0x122ca6[_0x0771('0x16')](_0x526737)[_0x0771('0x17')]();};}function respondWithResult(_0x17733b,_0x233ed0){_0x233ed0=_0x233ed0||0xc8;return function(_0x4d453a){if(_0x4d453a){return _0x17733b['status'](_0x233ed0)['json'](_0x4d453a);}};}function respondWithFilteredResult(_0x20175c,_0x492205){return function(_0x4409bd){if(_0x4409bd){var _0x5461d2=typeof _0x492205[_0x0771('0x18')]==='undefined'&&typeof _0x492205['limit']===_0x0771('0x19');var _0x577aea=_0x4409bd[_0x0771('0x1a')];var _0x44a7ad=_0x5461d2?0x0:_0x492205[_0x0771('0x18')];var _0x1e27cb=_0x5461d2?_0x4409bd[_0x0771('0x1a')]:_0x492205[_0x0771('0x18')]+_0x492205['limit'];var _0x58ac2c;if(_0x1e27cb>=_0x577aea){_0x1e27cb=_0x577aea;_0x58ac2c=0xc8;}else{_0x58ac2c=0xce;}_0x20175c[_0x0771('0x16')](_0x58ac2c);return _0x20175c['set'](_0x0771('0x1b'),_0x44a7ad+'-'+_0x1e27cb+'/'+_0x577aea)[_0x0771('0x1c')](_0x4409bd);}return null;};}function patchUpdates(_0x3dd467){return function(_0x18f2a1){try{jsonpatch[_0x0771('0x1d')](_0x18f2a1,_0x3dd467,!![]);}catch(_0x1526e3){return BPromise['reject'](_0x1526e3);}return _0x18f2a1['save']();};}function saveUpdates(_0x2b8a24,_0x48aeb9){return function(_0x36ec1a){if(_0x36ec1a){return _0x36ec1a[_0x0771('0x1e')](_0x2b8a24)[_0x0771('0x1f')](function(_0x51e6f8){return _0x51e6f8;});}return null;};}function removeEntity(_0x1afead,_0x54869d){return function(_0x34b4fe){if(_0x34b4fe){return _0x34b4fe[_0x0771('0x20')]()[_0x0771('0x1f')](function(){_0x1afead[_0x0771('0x16')](0xcc)[_0x0771('0x17')]();});}};}function handleEntityNotFound(_0x30e6e4,_0x48a29d){return function(_0x3c802a){if(!_0x3c802a){_0x30e6e4[_0x0771('0x21')](0x194);}return _0x3c802a;};}function handleError(_0x412697,_0x4fbb8e){_0x4fbb8e=_0x4fbb8e||0x1f4;return function(_0x5ed17c){logger['error'](_0x5ed17c['stack']);if(_0x5ed17c['name']){delete _0x5ed17c[_0x0771('0x22')];}_0x412697[_0x0771('0x16')](_0x4fbb8e)['send'](_0x5ed17c);};}exports['index']=function(_0x55618d,_0x381cdf){var _0x500b9c={},_0x22c768={},_0x323ada={'count':0x0,'rows':[]};var _0x3fd35c=_[_0x0771('0x23')](db['Attachment']['rawAttributes'],function(_0xf61b71){return{'name':_0xf61b71['fieldName'],'type':_0xf61b71['type'][_0x0771('0x24')]};});_0x22c768[_0x0771('0x25')]=_['map'](_0x3fd35c,_0x0771('0x22'));_0x22c768['query']=_[_0x0771('0x26')](_0x55618d[_0x0771('0x27')]);_0x22c768['filters']=_[_0x0771('0x28')](_0x22c768['model'],_0x22c768[_0x0771('0x27')]);_0x500b9c[_0x0771('0x29')]=_[_0x0771('0x28')](_0x22c768[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x55618d[_0x0771('0x27')]['fields']));_0x500b9c[_0x0771('0x29')]=_0x500b9c['attributes'][_0x0771('0x2b')]?_0x500b9c[_0x0771('0x29')]:_0x22c768['model'];if(!_0x55618d[_0x0771('0x27')][_0x0771('0x2c')](_0x0771('0x2d'))){_0x500b9c[_0x0771('0x2e')]=qs['limit'](_0x55618d[_0x0771('0x27')][_0x0771('0x2e')]);_0x500b9c[_0x0771('0x18')]=qs[_0x0771('0x18')](_0x55618d['query'][_0x0771('0x18')]);}_0x500b9c[_0x0771('0x2f')]=qs[_0x0771('0x30')](_0x55618d[_0x0771('0x27')][_0x0771('0x30')]);_0x500b9c[_0x0771('0x31')]=qs[_0x0771('0x32')](_['pick'](_0x55618d[_0x0771('0x27')],_0x22c768['filters']),_0x3fd35c);if(_0x55618d['query']['filter']){_0x500b9c[_0x0771('0x31')]=_[_0x0771('0x33')](_0x500b9c['where'],{'$or':_[_0x0771('0x23')](_0x3fd35c,function(_0x2767e0){if(_0x2767e0['type']!==_0x0771('0x34')){var _0x1b013c={};_0x1b013c[_0x2767e0[_0x0771('0x22')]]={'$like':'%'+_0x55618d[_0x0771('0x27')]['filter']+'%'};return _0x1b013c;}})});}_0x500b9c=_[_0x0771('0x33')]({},_0x500b9c,_0x55618d[_0x0771('0x35')]);var _0x594865={'where':_0x500b9c[_0x0771('0x31')]};return db[_0x0771('0x36')]['count'](_0x594865)['then'](function(_0x8e6587){_0x323ada[_0x0771('0x1a')]=_0x8e6587;if(_0x55618d[_0x0771('0x27')][_0x0771('0x37')]){_0x500b9c[_0x0771('0x38')]=[{'all':!![]}];}return db[_0x0771('0x36')][_0x0771('0x39')](_0x500b9c);})[_0x0771('0x1f')](function(_0x1eda42){_0x323ada[_0x0771('0x3a')]=_0x1eda42;return _0x323ada;})[_0x0771('0x1f')](respondWithFilteredResult(_0x381cdf,_0x500b9c))['catch'](handleError(_0x381cdf,null));};exports[_0x0771('0x3b')]=function(_0x6e4a1a,_0x567fa5){var _0x4b7ea1={'raw':!![],'where':{'id':_0x6e4a1a[_0x0771('0x3c')]['id']}},_0x392f69={};_0x392f69[_0x0771('0x25')]=_['keys'](db[_0x0771('0x36')][_0x0771('0x3d')]);_0x392f69[_0x0771('0x27')]=_['keys'](_0x6e4a1a['query']);_0x392f69[_0x0771('0x32')]=_[_0x0771('0x28')](_0x392f69[_0x0771('0x25')],_0x392f69['query']);_0x4b7ea1[_0x0771('0x29')]=_[_0x0771('0x28')](_0x392f69[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x6e4a1a['query'][_0x0771('0x2a')]));_0x4b7ea1['attributes']=_0x4b7ea1[_0x0771('0x29')][_0x0771('0x2b')]?_0x4b7ea1[_0x0771('0x29')]:_0x392f69['model'];if(_0x6e4a1a[_0x0771('0x27')][_0x0771('0x37')]){_0x4b7ea1['include']=[{'all':!![]}];}_0x4b7ea1=_[_0x0771('0x33')]({},_0x4b7ea1,_0x6e4a1a[_0x0771('0x35')]);return db['Attachment']['find'](_0x4b7ea1)['then'](handleEntityNotFound(_0x567fa5,null))[_0x0771('0x1f')](respondWithResult(_0x567fa5,null))['catch'](handleError(_0x567fa5,null));};exports['clone']=function(_0x37b83e,_0x34e394){var _0x486296={'where':{'id':_0x37b83e[_0x0771('0x3c')]['id']}},_0x292ea5={};_0x292ea5[_0x0771('0x25')]=_[_0x0771('0x26')](db[_0x0771('0x36')]['rawAttributes']);_0x486296[_0x0771('0x29')]=_[_0x0771('0x28')](_0x292ea5[_0x0771('0x25')],qs[_0x0771('0x2a')](_0x37b83e['query'][_0x0771('0x2a')]));_0x486296['attributes']=_0x486296[_0x0771('0x29')][_0x0771('0x2b')]?_0x486296['attributes']:_0x292ea5[_0x0771('0x25')];if(_0x37b83e['query'][_0x0771('0x37')]){_0x486296['include']=[{'all':!![]}];}_0x486296=_[_0x0771('0x33')]({},_0x486296,_0x37b83e[_0x0771('0x35')]);return db['Attachment'][_0x0771('0x3e')](_0x486296)[_0x0771('0x1f')](handleEntityNotFound(_0x34e394,null))[_0x0771('0x1f')](function(_0x575cea){if(_0x575cea){var _0x2fea89=_0x575cea[_0x0771('0x3f')]({'plain':!![]});_0x2fea89=qs[_0x0771('0x40')](_0x2fea89,['id','createdAt','updatedAt']);_0x37b83e[_0x0771('0x41')]=_[_0x0771('0x40')](_0x37b83e[_0x0771('0x41')],['id','createdAt','updatedAt']);return db[_0x0771('0x36')][_0x0771('0x42')](_[_0x0771('0x33')](_0x2fea89,_0x37b83e[_0x0771('0x41')]),{'include':_0x37b83e[_0x0771('0x27')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0771('0x1f')](respondWithResult(_0x34e394,0xc9))['catch'](handleError(_0x34e394,null));};exports[_0x0771('0x1e')]=function(_0x523fa9,_0x3d0822){if(_0x523fa9['body']['id']){delete _0x523fa9[_0x0771('0x41')]['id'];}return db['Attachment'][_0x0771('0x3e')]({'where':{'id':_0x523fa9[_0x0771('0x3c')]['id']}})[_0x0771('0x1f')](handleEntityNotFound(_0x3d0822,null))[_0x0771('0x1f')](saveUpdates(_0x523fa9['body'],null))[_0x0771('0x1f')](respondWithResult(_0x3d0822,null))[_0x0771('0x43')](handleError(_0x3d0822,null));};exports[_0x0771('0x20')]=function(_0x17492b,_0x21fa8b){return db[_0x0771('0x36')]['find']({'where':{'id':_0x17492b[_0x0771('0x3c')]['id']}})[_0x0771('0x1f')](handleEntityNotFound(_0x21fa8b,null))[_0x0771('0x1f')](removeEntity(_0x21fa8b,null))['catch'](handleError(_0x21fa8b,null));};exports['create']=function(_0x28e096,_0x12a98f,_0x476906){_0x28e096['body'][_0x0771('0x22')]=_0x28e096[_0x0771('0x44')][_0x0771('0x45')];_0x28e096[_0x0771('0x41')][_0x0771('0x46')]=_0x28e096['file'][_0x0771('0x47')];_0x28e096[_0x0771('0x41')][_0x0771('0x48')]=_0x28e096[_0x0771('0x44')]['mimetype'];return db['Attachment']['create'](_0x28e096['body'])[_0x0771('0x1f')](respondWithResult(_0x12a98f,0xc9))[_0x0771('0x43')](handleError(_0x12a98f,null));};exports['download']=function(_0x3504cc,_0x49f31b,_0xdab3a8){return db['Attachment'][_0x0771('0x49')]({'where':{'id':_0x3504cc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x49f31b,null))[_0x0771('0x1f')](function(_0x13d2bc){if(_0x13d2bc){var _0x1cace6=_0x13d2bc['ChatOfflineMessageId']!==null;var _0x106627=path[_0x0771('0x4a')](config[_0x0771('0x4b')],_0x0771('0x4c'));if(_0x1cace6){_0x106627=path[_0x0771('0x4a')](_0x106627,'offline-chat/');}var _0x1afc69=path['join'](_0x106627,_0x13d2bc['basename']);return _0x49f31b[_0x0771('0x4d')](_0x1afc69);}})['catch'](handleError(_0x49f31b,null));}; \ No newline at end of file +var _0x752f=['omit','create','update','find','originalname','basename','file','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','include','clone','params','get','createdAt','updatedAt','body'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x752f,0x1d0));var _0xf752=function(_0xef7485,_0x5f49f3){_0xef7485=_0xef7485-0x0;var _0x172b32=_0x752f[_0xef7485];return _0x172b32;};'use strict';var emlformat=require(_0xf752('0x0'));var rimraf=require(_0xf752('0x1'));var zipdir=require(_0xf752('0x2'));var jsonpatch=require(_0xf752('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf752('0x4'));var util=require('util');var path=require(_0xf752('0x5'));var sox=require(_0xf752('0x6'));var csv=require(_0xf752('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf752('0x8'));var _=require('lodash');var squel=require(_0xf752('0x9'));var crypto=require(_0xf752('0xa'));var jsforce=require(_0xf752('0xb'));var deskjs=require(_0xf752('0xc'));var toCsv=require(_0xf752('0x7'));var querystring=require(_0xf752('0xd'));var Papa=require(_0xf752('0xe'));var Redis=require(_0xf752('0xf'));var authService=require(_0xf752('0x10'));var qs=require(_0xf752('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf752('0x12'));var logger=require('../../config/logger')(_0xf752('0x13'));var utils=require(_0xf752('0x14'));var config=require(_0xf752('0x15'));var licenseUtil=require(_0xf752('0x16'));var db=require(_0xf752('0x17'))['db'];function respondWithStatusCode(_0x2a46bb,_0x177f4c){_0x177f4c=_0x177f4c||0xcc;return function(_0x269482){if(_0x269482){return _0x2a46bb[_0xf752('0x18')](_0x177f4c);}return _0x2a46bb[_0xf752('0x19')](_0x177f4c)[_0xf752('0x1a')]();};}function respondWithResult(_0x187dc0,_0x221e38){_0x221e38=_0x221e38||0xc8;return function(_0x19fa3a){if(_0x19fa3a){return _0x187dc0[_0xf752('0x19')](_0x221e38)[_0xf752('0x1b')](_0x19fa3a);}};}function respondWithFilteredResult(_0x1c5954,_0x283f92){return function(_0x8d36d1){if(_0x8d36d1){var _0x4bdd55=typeof _0x283f92[_0xf752('0x1c')]===_0xf752('0x1d')&&typeof _0x283f92[_0xf752('0x1e')]===_0xf752('0x1d');var _0x2e4c0e=_0x8d36d1[_0xf752('0x1f')];var _0x2be10b=_0x4bdd55?0x0:_0x283f92['offset'];var _0x1bff14=_0x4bdd55?_0x8d36d1['count']:_0x283f92['offset']+_0x283f92['limit'];var _0x5c2a92;if(_0x1bff14>=_0x2e4c0e){_0x1bff14=_0x2e4c0e;_0x5c2a92=0xc8;}else{_0x5c2a92=0xce;}_0x1c5954[_0xf752('0x19')](_0x5c2a92);return _0x1c5954[_0xf752('0x20')](_0xf752('0x21'),_0x2be10b+'-'+_0x1bff14+'/'+_0x2e4c0e)[_0xf752('0x1b')](_0x8d36d1);}return null;};}function patchUpdates(_0x8a122f){return function(_0x12e1b6){try{jsonpatch[_0xf752('0x22')](_0x12e1b6,_0x8a122f,!![]);}catch(_0x40ba8d){return BPromise[_0xf752('0x23')](_0x40ba8d);}return _0x12e1b6['save']();};}function saveUpdates(_0x4a940d,_0x1b1efc){return function(_0x2b29af){if(_0x2b29af){return _0x2b29af['update'](_0x4a940d)[_0xf752('0x24')](function(_0x35eacd){return _0x35eacd;});}return null;};}function removeEntity(_0xba9e94,_0x492ac8){return function(_0x1cd1f0){if(_0x1cd1f0){return _0x1cd1f0[_0xf752('0x25')]()['then'](function(){_0xba9e94['status'](0xcc)[_0xf752('0x1a')]();});}};}function handleEntityNotFound(_0x2f713d,_0x4756a0){return function(_0x332ddc){if(!_0x332ddc){_0x2f713d[_0xf752('0x18')](0x194);}return _0x332ddc;};}function handleError(_0x1db281,_0x4e2ba6){_0x4e2ba6=_0x4e2ba6||0x1f4;return function(_0x34fc92){logger['error'](_0x34fc92[_0xf752('0x26')]);if(_0x34fc92[_0xf752('0x27')]){delete _0x34fc92[_0xf752('0x27')];}_0x1db281[_0xf752('0x19')](_0x4e2ba6)[_0xf752('0x28')](_0x34fc92);};}exports[_0xf752('0x29')]=function(_0x2bfae2,_0x357ea5){var _0x2b6ef7={},_0x3c1fe6={},_0x35fbd1={'count':0x0,'rows':[]};var _0x188d69=_[_0xf752('0x2a')](db[_0xf752('0x2b')][_0xf752('0x2c')],function(_0x42a3d1){return{'name':_0x42a3d1[_0xf752('0x2d')],'type':_0x42a3d1[_0xf752('0x2e')][_0xf752('0x2f')]};});_0x3c1fe6[_0xf752('0x30')]=_[_0xf752('0x2a')](_0x188d69,_0xf752('0x27'));_0x3c1fe6[_0xf752('0x31')]=_[_0xf752('0x32')](_0x2bfae2[_0xf752('0x31')]);_0x3c1fe6[_0xf752('0x33')]=_[_0xf752('0x34')](_0x3c1fe6['model'],_0x3c1fe6[_0xf752('0x31')]);_0x2b6ef7['attributes']=_[_0xf752('0x34')](_0x3c1fe6[_0xf752('0x30')],qs[_0xf752('0x35')](_0x2bfae2[_0xf752('0x31')][_0xf752('0x35')]));_0x2b6ef7[_0xf752('0x36')]=_0x2b6ef7[_0xf752('0x36')][_0xf752('0x37')]?_0x2b6ef7[_0xf752('0x36')]:_0x3c1fe6[_0xf752('0x30')];if(!_0x2bfae2[_0xf752('0x31')][_0xf752('0x38')](_0xf752('0x39'))){_0x2b6ef7[_0xf752('0x1e')]=qs[_0xf752('0x1e')](_0x2bfae2[_0xf752('0x31')][_0xf752('0x1e')]);_0x2b6ef7[_0xf752('0x1c')]=qs[_0xf752('0x1c')](_0x2bfae2[_0xf752('0x31')][_0xf752('0x1c')]);}_0x2b6ef7[_0xf752('0x3a')]=qs[_0xf752('0x3b')](_0x2bfae2[_0xf752('0x31')][_0xf752('0x3b')]);_0x2b6ef7[_0xf752('0x3c')]=qs[_0xf752('0x33')](_[_0xf752('0x3d')](_0x2bfae2[_0xf752('0x31')],_0x3c1fe6['filters']),_0x188d69);if(_0x2bfae2[_0xf752('0x31')][_0xf752('0x3e')]){_0x2b6ef7[_0xf752('0x3c')]=_[_0xf752('0x3f')](_0x2b6ef7[_0xf752('0x3c')],{'$or':_['map'](_0x188d69,function(_0x5dac53){if(_0x5dac53['type']!==_0xf752('0x40')){var _0x4dd379={};_0x4dd379[_0x5dac53['name']]={'$like':'%'+_0x2bfae2['query'][_0xf752('0x3e')]+'%'};return _0x4dd379;}})});}_0x2b6ef7=_[_0xf752('0x3f')]({},_0x2b6ef7,_0x2bfae2[_0xf752('0x41')]);var _0x5ed997={'where':_0x2b6ef7[_0xf752('0x3c')]};return db[_0xf752('0x2b')][_0xf752('0x1f')](_0x5ed997)[_0xf752('0x24')](function(_0x233767){_0x35fbd1[_0xf752('0x1f')]=_0x233767;if(_0x2bfae2[_0xf752('0x31')][_0xf752('0x42')]){_0x2b6ef7['include']=[{'all':!![]}];}return db[_0xf752('0x2b')][_0xf752('0x43')](_0x2b6ef7);})['then'](function(_0x4affaa){_0x35fbd1['rows']=_0x4affaa;return _0x35fbd1;})[_0xf752('0x24')](respondWithFilteredResult(_0x357ea5,_0x2b6ef7))[_0xf752('0x44')](handleError(_0x357ea5,null));};exports['show']=function(_0x1390b6,_0x326091){var _0x39d7f6={'raw':!![],'where':{'id':_0x1390b6['params']['id']}},_0x41b3fc={};_0x41b3fc[_0xf752('0x30')]=_['keys'](db[_0xf752('0x2b')][_0xf752('0x2c')]);_0x41b3fc[_0xf752('0x31')]=_['keys'](_0x1390b6[_0xf752('0x31')]);_0x41b3fc[_0xf752('0x33')]=_['intersection'](_0x41b3fc[_0xf752('0x30')],_0x41b3fc[_0xf752('0x31')]);_0x39d7f6[_0xf752('0x36')]=_[_0xf752('0x34')](_0x41b3fc[_0xf752('0x30')],qs[_0xf752('0x35')](_0x1390b6[_0xf752('0x31')]['fields']));_0x39d7f6[_0xf752('0x36')]=_0x39d7f6[_0xf752('0x36')][_0xf752('0x37')]?_0x39d7f6[_0xf752('0x36')]:_0x41b3fc['model'];if(_0x1390b6[_0xf752('0x31')][_0xf752('0x42')]){_0x39d7f6[_0xf752('0x45')]=[{'all':!![]}];}_0x39d7f6=_[_0xf752('0x3f')]({},_0x39d7f6,_0x1390b6['options']);return db[_0xf752('0x2b')]['find'](_0x39d7f6)[_0xf752('0x24')](handleEntityNotFound(_0x326091,null))[_0xf752('0x24')](respondWithResult(_0x326091,null))[_0xf752('0x44')](handleError(_0x326091,null));};exports[_0xf752('0x46')]=function(_0x7d7e1,_0x3bcd21){var _0x491c21={'where':{'id':_0x7d7e1[_0xf752('0x47')]['id']}},_0x44f988={};_0x44f988[_0xf752('0x30')]=_[_0xf752('0x32')](db['Attachment']['rawAttributes']);_0x491c21[_0xf752('0x36')]=_[_0xf752('0x34')](_0x44f988[_0xf752('0x30')],qs[_0xf752('0x35')](_0x7d7e1[_0xf752('0x31')][_0xf752('0x35')]));_0x491c21['attributes']=_0x491c21[_0xf752('0x36')][_0xf752('0x37')]?_0x491c21[_0xf752('0x36')]:_0x44f988['model'];if(_0x7d7e1[_0xf752('0x31')]['includeAll']){_0x491c21[_0xf752('0x45')]=[{'all':!![]}];}_0x491c21=_['merge']({},_0x491c21,_0x7d7e1[_0xf752('0x41')]);return db[_0xf752('0x2b')]['find'](_0x491c21)[_0xf752('0x24')](handleEntityNotFound(_0x3bcd21,null))[_0xf752('0x24')](function(_0x293b9d){if(_0x293b9d){var _0xe6b161=_0x293b9d[_0xf752('0x48')]({'plain':!![]});_0xe6b161=qs['omit'](_0xe6b161,['id',_0xf752('0x49'),_0xf752('0x4a')]);_0x7d7e1[_0xf752('0x4b')]=_[_0xf752('0x4c')](_0x7d7e1[_0xf752('0x4b')],['id',_0xf752('0x49'),_0xf752('0x4a')]);return db[_0xf752('0x2b')][_0xf752('0x4d')](_[_0xf752('0x3f')](_0xe6b161,_0x7d7e1[_0xf752('0x4b')]),{'include':_0x7d7e1[_0xf752('0x31')][_0xf752('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3bcd21,0xc9))[_0xf752('0x44')](handleError(_0x3bcd21,null));};exports[_0xf752('0x4e')]=function(_0x1aca68,_0x2fa97b){if(_0x1aca68['body']['id']){delete _0x1aca68[_0xf752('0x4b')]['id'];}return db[_0xf752('0x2b')][_0xf752('0x4f')]({'where':{'id':_0x1aca68[_0xf752('0x47')]['id']}})[_0xf752('0x24')](handleEntityNotFound(_0x2fa97b,null))['then'](saveUpdates(_0x1aca68[_0xf752('0x4b')],null))[_0xf752('0x24')](respondWithResult(_0x2fa97b,null))[_0xf752('0x44')](handleError(_0x2fa97b,null));};exports[_0xf752('0x25')]=function(_0xacbef7,_0x2f5251){return db[_0xf752('0x2b')][_0xf752('0x4f')]({'where':{'id':_0xacbef7[_0xf752('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f5251,null))[_0xf752('0x24')](removeEntity(_0x2f5251,null))['catch'](handleError(_0x2f5251,null));};exports[_0xf752('0x4d')]=function(_0x5c058b,_0x53ba86,_0x54bf11){_0x5c058b[_0xf752('0x4b')]['name']=_0x5c058b['file'][_0xf752('0x50')];_0x5c058b[_0xf752('0x4b')][_0xf752('0x51')]=_0x5c058b['file']['filename'];_0x5c058b['body'][_0xf752('0x2e')]=_0x5c058b[_0xf752('0x52')][_0xf752('0x53')];return db[_0xf752('0x2b')][_0xf752('0x4d')](_0x5c058b[_0xf752('0x4b')])[_0xf752('0x24')](respondWithResult(_0x53ba86,0xc9))[_0xf752('0x44')](handleError(_0x53ba86,null));};exports[_0xf752('0x54')]=function(_0x5ab901,_0x4a008a,_0xc91f58){return db[_0xf752('0x2b')][_0xf752('0x55')]({'where':{'id':_0x5ab901[_0xf752('0x47')]['id']},'raw':!![]})[_0xf752('0x24')](handleEntityNotFound(_0x4a008a,null))[_0xf752('0x24')](function(_0x24a1a3){if(_0x24a1a3){var _0x551095=_0x24a1a3[_0xf752('0x56')]!==null;var _0x141d6b=path[_0xf752('0x57')](config[_0xf752('0x58')],_0xf752('0x59'));if(_0x551095){_0x141d6b=path['join'](_0x141d6b,'offline-chat/');}var _0x9401d1=path[_0xf752('0x57')](_0x141d6b,_0x24a1a3[_0xf752('0x51')]);return _0x4a008a[_0xf752('0x54')](_0x9401d1);}})['catch'](handleError(_0x4a008a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 45cbe1a..3416596 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 _0xe335=['bluebird','request-promise','path','rimraf','define','Attachment','attachments','moment'];(function(_0x1a9bdf,_0x43130a){var _0x61a042=function(_0x13fdf5){while(--_0x13fdf5){_0x1a9bdf['push'](_0x1a9bdf['shift']());}};_0x61a042(++_0x43130a);}(_0xe335,0x1bf));var _0x5e33=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe335[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5e33('0x0'));var BPromise=require(_0x5e33('0x1'));var rp=require(_0x5e33('0x2'));var fs=require('fs');var path=require(_0x5e33('0x3'));var rimraf=require(_0x5e33('0x4'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module['exports']=function(_0x2f5bf2,_0x48bbba){return _0x2f5bf2[_0x5e33('0x5')](_0x5e33('0x6'),attributes,{'tableName':_0x5e33('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x822b=['Attachment','attachments','api','request-promise','path','rimraf','exports','define'];(function(_0x39a59f,_0x509fab){var _0x2f089f=function(_0x53f6b6){while(--_0x53f6b6){_0x39a59f['push'](_0x39a59f['shift']());}};_0x2f089f(++_0x509fab);}(_0x822b,0xba));var _0xb822=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x822b[_0x43aee5];return _0x76d1d0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb822('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb822('0x1'));var fs=require('fs');var path=require(_0xb822('0x2'));var rimraf=require(_0xb822('0x3'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0xb822('0x4')]=function(_0x4b25e3,_0x4a5d05){return _0x4b25e3[_0xb822('0x5')](_0xb822('0x6'),attributes,{'tableName':_0xb822('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index dabe13f..e508bc4 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 _0xe600=['code','message','catch','Attachment','create','options','raw','CreateAttachment','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x499873,_0x52cb2f){var _0x4ff4e7=function(_0x19c89d){while(--_0x19c89d){_0x499873['push'](_0x499873['shift']());}};_0x4ff4e7(++_0x52cb2f);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var moment=require('moment');var BPromise=require(_0x0e60('0x1'));var rs=require(_0x0e60('0x2'));var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require(_0x0e60('0x8'));var jayson=require(_0x0e60('0x9'));var client=jayson[_0x0e60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7563,_0x497a61,_0x6727dd){return new BPromise(function(_0x30eaed,_0x5ba123){return client[_0x0e60('0xb')](_0x1d7563,_0x6727dd)[_0x0e60('0xc')](function(_0x238537){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));logger['debug'](_0x0e60('0x10'),_0x497a61,_0x0e60('0xf'),JSON[_0x0e60('0x11')](_0x238537));if(_0x238537[_0x0e60('0x12')]){if(_0x238537[_0x0e60('0x12')][_0x0e60('0x13')]===0x1f4){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537['error'][_0x0e60('0x14')]);return _0x5ba123(_0x238537[_0x0e60('0x12')][_0x0e60('0x14')]);}logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537[_0x0e60('0x12')]['message']);return _0x30eaed(_0x238537[_0x0e60('0x12')]['message']);}else{logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));_0x30eaed(_0x238537['result'][_0x0e60('0x14')]);}})[_0x0e60('0x15')](function(_0xdb7760){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0xdb7760);_0x5ba123(_0xdb7760);});});}exports['CreateAttachment']=function(_0x992490){var _0x43a103=this;return new Promise(function(_0x599c1d,_0x17ab47){return db[_0x0e60('0x16')][_0x0e60('0x17')](_0x992490['body'],{'raw':_0x992490[_0x0e60('0x18')]?_0x992490['options'][_0x0e60('0x19')]===undefined?!![]:![]:!![]})[_0x0e60('0xc')](function(_0xb9f037){logger[_0x0e60('0xd')](_0x0e60('0x1a'),_0x992490);logger[_0x0e60('0x1b')](_0x0e60('0x1a'),_0x992490,JSON[_0x0e60('0x11')](_0xb9f037));_0x599c1d(_0xb9f037);})[_0x0e60('0x15')](function(_0x10f875){logger[_0x0e60('0x12')](_0x0e60('0x1a'),_0x10f875[_0x0e60('0x14')],_0x992490);_0x17ab47(_0x43a103[_0x0e60('0x12')](0x1f4,_0x10f875[_0x0e60('0x14')]));});});}; \ No newline at end of file +var _0xc997=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Attachment,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','CreateAttachment','Attachment','create','body','options','util','moment','bluebird','randomstring'];(function(_0x365d33,_0x451406){var _0x19e488=function(_0x401b36){while(--_0x401b36){_0x365d33['push'](_0x365d33['shift']());}};_0x19e488(++_0x451406);}(_0xc997,0x1ac));var _0x7c99=function(_0x392c41,_0x15de8e){_0x392c41=_0x392c41-0x0;var _0xece468=_0xc997[_0x392c41];return _0xece468;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var moment=require(_0x7c99('0x1'));var BPromise=require(_0x7c99('0x2'));var rs=require(_0x7c99('0x3'));var fs=require('fs');var Redis=require(_0x7c99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c99('0x5'));var logger=require(_0x7c99('0x6'))(_0x7c99('0x7'));var config=require(_0x7c99('0x8'));var jayson=require(_0x7c99('0x9'));var client=jayson[_0x7c99('0xa')][_0x7c99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36955c,_0x56bf58,_0x6d672){return new BPromise(function(_0x33fd86,_0x905c84){return client['request'](_0x36955c,_0x6d672)[_0x7c99('0xc')](function(_0x9f6f7c){logger['info'](_0x7c99('0xd'),_0x56bf58,'request\x20sent');logger[_0x7c99('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x56bf58,'request\x20sent',JSON[_0x7c99('0xf')](_0x9f6f7c));if(_0x9f6f7c[_0x7c99('0x10')]){if(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x11')]===0x1f4){logger[_0x7c99('0x10')](_0x7c99('0xd'),_0x56bf58,_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);return _0x905c84(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);}logger[_0x7c99('0x10')](_0x7c99('0xd'),_0x56bf58,_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);return _0x33fd86(_0x9f6f7c[_0x7c99('0x10')][_0x7c99('0x12')]);}else{logger[_0x7c99('0x13')](_0x7c99('0xd'),_0x56bf58,_0x7c99('0x14'));_0x33fd86(_0x9f6f7c[_0x7c99('0x15')][_0x7c99('0x12')]);}})['catch'](function(_0x2d80d4){logger['error']('Attachment,\x20%s,\x20%s',_0x56bf58,_0x2d80d4);_0x905c84(_0x2d80d4);});});}exports[_0x7c99('0x16')]=function(_0x133e96){var _0x7baa0b=this;return new Promise(function(_0x210669,_0x32306b){return db[_0x7c99('0x17')][_0x7c99('0x18')](_0x133e96[_0x7c99('0x19')],{'raw':_0x133e96[_0x7c99('0x1a')]?_0x133e96[_0x7c99('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7c99('0xc')](function(_0x3da4d6){logger[_0x7c99('0x13')]('CreateAttachment',_0x133e96);logger['debug']('CreateAttachment',_0x133e96,JSON['stringify'](_0x3da4d6));_0x210669(_0x3da4d6);})['catch'](function(_0x3023ec){logger[_0x7c99('0x10')]('CreateAttachment',_0x3023ec[_0x7c99('0x12')],_0x133e96);_0x32306b(_0x7baa0b[_0x7c99('0x10')](0x1f4,_0x3023ec[_0x7c99('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index cd51358..155fe06 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x170c0a,_0x5a6bbb){_0x170c0a=_0x170c0a-0x0;var _0x4658ee=_0xdb28[_0x170c0a];return _0x4658ee;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x51e91d,_0x40b035){_0x51e91d=_0x51e91d-0x0;var _0x1a42f2=_0xdb28[_0x51e91d];return _0x1a42f2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1929bd0..360327a 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 _0x0b6d=['error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','then','add','minutes','clearBlockUser','getLicense','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate'];(function(_0x9769c7,_0x58082a){var _0x2b769e=function(_0x4fc9b9){while(--_0x4fc9b9){_0x9769c7['push'](_0x9769c7['shift']());}};_0x2b769e(++_0x58082a);}(_0x0b6d,0x85));var _0xd0b6=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x0b6d[_0x45bf86];return _0x1f02b7;};'use strict';var passport=require(_0xd0b6('0x0'));var LocalStrategy=require(_0xd0b6('0x1'))[_0xd0b6('0x2')];var moment=require(_0xd0b6('0x3'));var ActiveDirectory=require(_0xd0b6('0x4'));var BPromise=require(_0xd0b6('0x5'));var util=require(_0xd0b6('0x6'));var db=require(_0xd0b6('0x7'))['db'];var authService=require(_0xd0b6('0x8'));var utils=require(_0xd0b6('0x9'));var config=require(_0xd0b6('0xa'));var logger=require('../../config/logger')(_0xd0b6('0xb'));function isActiveDirectoryConfigured(_0x597b97){var _0x447d5f=![];if(typeof _0x597b97[_0xd0b6('0xc')]!=='undefined'){_0x447d5f=_0x597b97['activedirectory'][_0xd0b6('0xd')]&&_0x597b97[_0xd0b6('0xc')][_0xd0b6('0xe')]&&_0x597b97['activedirectory'][_0xd0b6('0xf')];}return _0x447d5f;}function adAuthenticate(_0x1a2d52,_0x4849f2,_0x5ac927){return new BPromise(function(_0x95636e,_0x26fc82){try{var _0x167c00=new ActiveDirectory(_0x1a2d52);_0x167c00[_0xd0b6('0x10')](_0x4849f2,_0x5ac927,function(_0x393452,_0x15e167){if(_0x393452){logger[_0xd0b6('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x4849f2,util[_0xd0b6('0x12')](_0x393452,{'showHidden':![],'depth':null}));_0x26fc82(_0xd0b6('0x13'));}else if(!_0x15e167){logger['error'](_0xd0b6('0x14'),_0x4849f2);_0x26fc82(_0xd0b6('0x13'));}else{_0x95636e(_0x15e167);}});}catch(_0x2dda8d){_0x26fc82(_0x2dda8d);}});}function ActiveDirectoryAuthenticate(_0x50de6c,_0x2aded5,_0x4eeb7e,_0x4debab){var _0x4a7554,_0x3da1a3;if(!isActiveDirectoryConfigured(config)){logger[_0xd0b6('0x11')](_0xd0b6('0x15'),_0x2aded5);return _0x4debab(null,![],{'message':_0xd0b6('0x13')});}return db[_0xd0b6('0x16')][_0xd0b6('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd0b6('0x18')],'raw':!![]})['then'](function(_0x5587cb){_0x4a7554=_0x5587cb;if(!_0x4a7554[_0xd0b6('0x19')]){logger['error'](_0xd0b6('0x1a'),_0x2aded5);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x50de6c[_0xd0b6('0x17')]({'logging':!![],'attributes':['id',_0xd0b6('0x1b'),_0xd0b6('0x1c'),_0xd0b6('0x1d'),_0xd0b6('0x1e'),_0xd0b6('0x1f'),_0xd0b6('0x20'),_0xd0b6('0x21'),_0xd0b6('0x22')],'where':{'name':_0x2aded5,'role':{'$or':[_0xd0b6('0x23'),'user',_0xd0b6('0x24')]},'adSsoEnabled':!![]}});})[_0xd0b6('0x25')](function(_0x3b58e8){if(!_0x3b58e8||_0x3b58e8&&_0x3b58e8['name']!==_0x2aded5){throw new Error(_0xd0b6('0x13'));}_0x3da1a3=_0x3b58e8;var _0x53d41d=_0x3da1a3['name']+'@'+config[_0xd0b6('0xc')]['domain'];return adAuthenticate(config[_0xd0b6('0xc')],_0x53d41d,_0x4eeb7e);})['then'](function(_0x5d747e){if(_0x3da1a3['disabled']){throw new Error(_0xd0b6('0x13'));}if(_0x4a7554[_0xd0b6('0x18')]>0x0){if(_0x3da1a3['blocked']){if(moment(_0x3da1a3['blockedAt'])[_0xd0b6('0x26')](_0x4a7554[_0xd0b6('0x18')],_0xd0b6('0x27'))>moment()){throw new Error(_0xd0b6('0x13'));}return utils[_0xd0b6('0x28')](_0x3da1a3,0x0,![],null)['then'](function(){return utils[_0xd0b6('0x29')](_0x3da1a3);})[_0xd0b6('0x25')](function(){return _0x4debab(null,_0x3da1a3);});}else{return utils[_0xd0b6('0x29')](_0x3da1a3)[_0xd0b6('0x25')](function(){return _0x4debab(null,_0x3da1a3);});}}else{return utils[_0xd0b6('0x29')](_0x3da1a3)['then'](function(){return _0x4debab(null,_0x3da1a3);});}})['catch'](function(_0x261364){return _0x4debab(null,![],_0x261364);});}function handleError(_0xa30bfc,_0x55dc59,_0x390229){return _0xa30bfc[_0xd0b6('0x2a')](_0x55dc59||0x1f4)[_0xd0b6('0x2b')]({'message':_0x390229?_0x390229['message']||_0x390229:''});}exports[_0xd0b6('0x2c')]=function(_0x372d62,_0x2de3ff,_0x3c3102){passport[_0xd0b6('0x10')]('ad-login',function(_0x562e35,_0x20df32,_0x54029b){var _0x5ef76a=_0x562e35||_0x54029b;if(_0x5ef76a){return handleError(_0x2de3ff,0x191,_0x5ef76a);}if(!_0x20df32){return handleError(_0x2de3ff,0x194,{'message':_0xd0b6('0x2d')});}else{var _0x35a1e4={'payload':{'id':_0x20df32['id'],'role':_0x20df32[_0xd0b6('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0xd0b6('0x2e')](_0x35a1e4)[_0xd0b6('0x25')](function(_0x423b06){_0x2de3ff[_0xd0b6('0x2f')]({'id':_0x20df32['id'],'token':_0x423b06,'statusCall':'','isAlreadyLogged':_0x20df32['online']});});}})(_0x372d62,_0x2de3ff,_0x3c3102);};passport[_0xd0b6('0x30')]('ad-login',new LocalStrategy({'usernameField':_0xd0b6('0x1b'),'passwordField':'password'},function(_0x1d1029,_0x1c3935,_0x5bada3){return ActiveDirectoryAuthenticate(db[_0xd0b6('0x31')],_0x1d1029,_0x1c3935,_0x5bada3);})); \ No newline at end of file +var _0x7a88=['undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blockedAt','online','admin','user','agent','domain','minutes','clearBlockUser','getLicense','catch','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','use','User','passport-local','Strategy','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x1cb042,_0x13f77d){var _0x4498ea=function(_0x4e8093){while(--_0x4e8093){_0x1cb042['push'](_0x1cb042['shift']());}};_0x4498ea(++_0x13f77d);}(_0x7a88,0x194));var _0x87a8=function(_0x5676d3,_0x582062){_0x5676d3=_0x5676d3-0x0;var _0x573736=_0x7a88[_0x5676d3];return _0x573736;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x87a8('0x0'))[_0x87a8('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x87a8('0x2'));var util=require(_0x87a8('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0x87a8('0x4'));var utils=require(_0x87a8('0x5'));var config=require(_0x87a8('0x6'));var logger=require(_0x87a8('0x7'))(_0x87a8('0x8'));function isActiveDirectoryConfigured(_0x3dcd51){var _0x322c26=![];if(typeof _0x3dcd51[_0x87a8('0x9')]!==_0x87a8('0xa')){_0x322c26=_0x3dcd51[_0x87a8('0x9')][_0x87a8('0xb')]&&_0x3dcd51[_0x87a8('0x9')][_0x87a8('0xc')]&&_0x3dcd51[_0x87a8('0x9')]['domain'];}return _0x322c26;}function adAuthenticate(_0x38a803,_0x2182e1,_0xa8a5f8){return new BPromise(function(_0x5ec0e0,_0x8b05ad){try{var _0x2b7dcf=new ActiveDirectory(_0x38a803);_0x2b7dcf[_0x87a8('0xd')](_0x2182e1,_0xa8a5f8,function(_0x388dbe,_0x14a7f2){if(_0x388dbe){logger[_0x87a8('0xe')](_0x87a8('0xf'),_0x2182e1,util['inspect'](_0x388dbe,{'showHidden':![],'depth':null}));_0x8b05ad(_0x87a8('0x10'));}else if(!_0x14a7f2){logger['error'](_0x87a8('0x11'),_0x2182e1);_0x8b05ad('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5ec0e0(_0x14a7f2);}});}catch(_0x1379b5){_0x8b05ad(_0x1379b5);}});}function ActiveDirectoryAuthenticate(_0xd61ec,_0xe108d9,_0x3a5e69,_0x504bd0){var _0x36f831,_0x2a5995;if(!isActiveDirectoryConfigured(config)){logger[_0x87a8('0xe')](_0x87a8('0x12'),_0xe108d9);return _0x504bd0(null,![],{'message':_0x87a8('0x10')});}return db[_0x87a8('0x13')][_0x87a8('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x87a8('0x15')],'raw':!![]})[_0x87a8('0x16')](function(_0x47e011){_0x36f831=_0x47e011;if(!_0x36f831[_0x87a8('0x17')]){logger['error'](_0x87a8('0x18'),_0xe108d9);throw new Error(_0x87a8('0x10'));}return _0xd61ec[_0x87a8('0x14')]({'logging':!![],'attributes':['id',_0x87a8('0x19'),_0x87a8('0x1a'),_0x87a8('0x1b'),'role',_0x87a8('0x1c'),'blocked',_0x87a8('0x1d'),_0x87a8('0x1e')],'where':{'name':_0xe108d9,'role':{'$or':[_0x87a8('0x1f'),_0x87a8('0x20'),_0x87a8('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x2a4817){if(!_0x2a4817||_0x2a4817&&_0x2a4817[_0x87a8('0x19')]!==_0xe108d9){throw new Error(_0x87a8('0x10'));}_0x2a5995=_0x2a4817;var _0x104882=_0x2a5995[_0x87a8('0x19')]+'@'+config[_0x87a8('0x9')][_0x87a8('0x22')];return adAuthenticate(config[_0x87a8('0x9')],_0x104882,_0x3a5e69);})[_0x87a8('0x16')](function(_0x240dae){if(_0x2a5995[_0x87a8('0x1c')]){throw new Error(_0x87a8('0x10'));}if(_0x36f831[_0x87a8('0x15')]>0x0){if(_0x2a5995['blocked']){if(moment(_0x2a5995[_0x87a8('0x1d')])['add'](_0x36f831['blockDuration'],_0x87a8('0x23'))>moment()){throw new Error(_0x87a8('0x10'));}return utils[_0x87a8('0x24')](_0x2a5995,0x0,![],null)[_0x87a8('0x16')](function(){return utils[_0x87a8('0x25')](_0x2a5995);})['then'](function(){return _0x504bd0(null,_0x2a5995);});}else{return utils['getLicense'](_0x2a5995)[_0x87a8('0x16')](function(){return _0x504bd0(null,_0x2a5995);});}}else{return utils[_0x87a8('0x25')](_0x2a5995)[_0x87a8('0x16')](function(){return _0x504bd0(null,_0x2a5995);});}})[_0x87a8('0x26')](function(_0x10be25){return _0x504bd0(null,![],_0x10be25);});}function handleError(_0x454920,_0xc71485,_0x2dfa67){return _0x454920['status'](_0xc71485||0x1f4)[_0x87a8('0x27')]({'message':_0x2dfa67?_0x2dfa67['message']||_0x2dfa67:''});}exports[_0x87a8('0x28')]=function(_0x5d4f32,_0x2061c5,_0x21de6f){passport[_0x87a8('0xd')](_0x87a8('0x29'),function(_0x5ba283,_0x403895,_0x52f6bb){var _0x361489=_0x5ba283||_0x52f6bb;if(_0x361489){return handleError(_0x2061c5,0x191,_0x361489);}if(!_0x403895){return handleError(_0x2061c5,0x194,{'message':_0x87a8('0x2a')});}else{var _0x31750a={'payload':{'id':_0x403895['id'],'role':_0x403895[_0x87a8('0x2b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x31750a)[_0x87a8('0x16')](function(_0x228f98){_0x2061c5['json']({'id':_0x403895['id'],'token':_0x228f98,'statusCall':'','isAlreadyLogged':_0x403895['online']});});}})(_0x5d4f32,_0x2061c5,_0x21de6f);};passport[_0x87a8('0x2c')](_0x87a8('0x29'),new LocalStrategy({'usernameField':_0x87a8('0x19'),'passwordField':_0x87a8('0x1a')},function(_0x5a97d8,_0x551db6,_0x140993){return ActiveDirectoryAuthenticate(db[_0x87a8('0x2d')],_0x5a97d8,_0x551db6,_0x140993);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 4953318..2e1b123 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 _0x5c04=['exports','Router','./authActiveDirectory.controller','login'];(function(_0x1c2f24,_0x197a9f){var _0x466fc0=function(_0x3eabf7){while(--_0x3eabf7){_0x1c2f24['push'](_0x1c2f24['shift']());}};_0x466fc0(++_0x197a9f);}(_0x5c04,0x1dd));var _0x45c0=function(_0x5e9206,_0x6f1c7c){_0x5e9206=_0x5e9206-0x0;var _0xbb83d5=_0x5c04[_0x5e9206];return _0xbb83d5;};'use strict';var express=require('express');var router=express[_0x45c0('0x0')]();var controller=require(_0x45c0('0x1'));router['post']('/',controller[_0x45c0('0x2')]);module[_0x45c0('0x3')]=router; \ No newline at end of file +var _0x660e=['express','Router','login','exports'];(function(_0x1d7214,_0x2dd11a){var _0x313ebf=function(_0x3e920e){while(--_0x3e920e){_0x1d7214['push'](_0x1d7214['shift']());}};_0x313ebf(++_0x2dd11a);}(_0x660e,0xdc));var _0xe660=function(_0x315989,_0x48a7fd){_0x315989=_0x315989-0x0;var _0x23070c=_0x660e[_0x315989];return _0x23070c;};'use strict';var express=require(_0xe660('0x0'));var router=express[_0xe660('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xe660('0x2')]);module[_0xe660('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1b90e75..7a1f80e 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(_0x340598,_0x14454a){var _0x57d248=function(_0xcb2a04){while(--_0xcb2a04){_0x340598['push'](_0x340598['shift']());}};_0x57d248(++_0x14454a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d0609,_0x22ed5e){_0x5d0609=_0x5d0609-0x0;var _0xe4bafa=_0x7a54[_0x5d0609];return _0xe4bafa;};'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 cbf6941..dacec13 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 _0xb821=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../../components/auth/service','get'];(function(_0x28fe02,_0x1e6530){var _0x2aa7d7=function(_0x33e833){while(--_0x33e833){_0x28fe02['push'](_0x28fe02['shift']());}};_0x2aa7d7(++_0x1e6530);}(_0xb821,0xa7));var _0x1b82=function(_0x1a5c94,_0x16f4aa){_0x1a5c94=_0x1a5c94-0x0;var _0x589128=_0xb821[_0x1a5c94];return _0x589128;};'use strict';var express=require('express');var passport=require(_0x1b82('0x0'));var router=express[_0x1b82('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x1b82('0x2'));router['get']('/',controller['login']);router[_0x1b82('0x3')](_0x1b82('0x4'),controller[_0x1b82('0x5')],authService[_0x1b82('0x6')],userController['login'],authService[_0x1b82('0x7')]);module[_0x1b82('0x8')]=router; \ No newline at end of file +var _0xb1a4=['isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x53e888,_0x8a491){var _0x10d581=function(_0x4a6e5b){while(--_0x4a6e5b){_0x53e888['push'](_0x53e888['shift']());}};_0x10d581(++_0x8a491);}(_0xb1a4,0x12e));var _0x4b1a=function(_0x45aa1f,_0x4aa3d3){_0x45aa1f=_0x45aa1f-0x0;var _0x5ee9ca=_0xb1a4[_0x45aa1f];return _0x5ee9ca;};'use strict';var express=require(_0x4b1a('0x0'));var passport=require('passport');var router=express[_0x4b1a('0x1')]();var controller=require(_0x4b1a('0x2'));var userController=require(_0x4b1a('0x3'));var authService=require(_0x4b1a('0x4'));router[_0x4b1a('0x5')]('/',controller[_0x4b1a('0x6')]);router[_0x4b1a('0x5')](_0x4b1a('0x7'),controller['callback'],authService[_0x4b1a('0x8')],userController[_0x4b1a('0x6')],authService[_0x4b1a('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 74cd11c..6a57b14 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 _0xd1dc=['request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','The\x20user\x20is\x20blocked.\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://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','save','Password\x20reset!','use','util','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0xd1dc,0x17e));var _0xcd1d=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0xd1dc[_0x3b0e76];return _0x1e4af4;};'use strict';var util=require(_0xcd1d('0x0'));var passport=require('passport');var LocalStrategy=require(_0xcd1d('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xcd1d('0x2'));var moment=require(_0xcd1d('0x3'));var db=require(_0xcd1d('0x4'))['db'];var authService=require(_0xcd1d('0x5'));var utils=require(_0xcd1d('0x6'));var client=jayson[_0xcd1d('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x43e7e7,_0x4b69e3,_0x22fc6e,_0x2683e9){var _0x3ffd2c,_0x58d659;return db[_0xcd1d('0x8')][_0xcd1d('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xcd1d('0xa')],'raw':!![]})[_0xcd1d('0xb')](function(_0x1aed66){_0x3ffd2c=_0x1aed66;return _0x43e7e7[_0xcd1d('0x9')]({'attributes':['id','name',_0xcd1d('0xc'),_0xcd1d('0xd'),_0xcd1d('0xe'),_0xcd1d('0xf'),_0xcd1d('0x10'),'blockedAt',_0xcd1d('0x11')],'where':{'name':_0x4b69e3,'role':{'$or':[_0xcd1d('0x12'),_0xcd1d('0x13'),_0xcd1d('0x14')]}}});})[_0xcd1d('0xb')](function(_0x45e378){if(!_0x45e378||_0x45e378&&_0x45e378['name']!==_0x4b69e3){throw new Error(_0xcd1d('0x15'));}else{_0x58d659=_0x45e378;return _0x58d659;}})['then'](function(){_0x58d659['authenticate'](_0x22fc6e,function(_0x59c566,_0x22f85e){var _0x543590=_0x58d659[_0xcd1d('0x11')]+0x1;if(_0x59c566){return _0x2683e9(_0x59c566);}else if(!_0x22f85e){if(_0x58d659[_0xcd1d('0xf')]){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else if(_0x3ffd2c[_0xcd1d('0x16')]>0x0){if(_0x58d659[_0xcd1d('0x10')]){if(_0x3ffd2c[_0xcd1d('0xa')]>0x0){if(moment(_0x58d659['blockedAt'])[_0xcd1d('0x17')](_0x3ffd2c[_0xcd1d('0xa')],_0xcd1d('0x18'))>moment()){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x19')](_0x58d659,_0x543590,![],null)[_0xcd1d('0xb')](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}}else{return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}}else{if(_0x543590>=_0x3ffd2c[_0xcd1d('0x16')]){return utils[_0xcd1d('0x19')](_0x58d659,0x0,!![],moment())['then'](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}else{return utils[_0xcd1d('0x19')](_0x58d659,_0x543590,![],null)[_0xcd1d('0xb')](function(){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});});}}}else{return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}}else{if(_0x58d659['disabled']){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else if(_0x3ffd2c[_0xcd1d('0x16')]>0x0){if(_0x58d659[_0xcd1d('0x10')]){if(_0x3ffd2c[_0xcd1d('0xa')]>0x0){if(moment(_0x58d659['blockedAt'])['add'](_0x3ffd2c[_0xcd1d('0xa')],_0xcd1d('0x18'))>moment()){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x19')](_0x58d659,0x0,![],null)[_0xcd1d('0xb')](function(){return utils[_0xcd1d('0x1a')](_0x58d659);})[_0xcd1d('0xb')](function(){return _0x2683e9(null,_0x58d659);});}}else{return _0x2683e9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xcd1d('0x19')](_0x58d659,0x0,![],null)[_0xcd1d('0xb')](function(){return utils[_0xcd1d('0x1a')](_0x58d659);})[_0xcd1d('0xb')](function(){return _0x2683e9(null,_0x58d659);})[_0xcd1d('0x1b')](function(_0xd0dd37){return _0x2683e9(null,![],_0xd0dd37);});}}else{if(_0x58d659['blocked']){return _0x2683e9(null,![],{'message':_0xcd1d('0x15')});}else{return utils[_0xcd1d('0x1a')](_0x58d659)['then'](function(){return _0x2683e9(null,_0x58d659);});}}}});})[_0xcd1d('0x1b')](function(_0xd695db){return _0x2683e9(null,![],_0xd695db);});}function sendServiceMail(_0x199148){return db[_0xcd1d('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0xcd1d('0x1d'),_0xcd1d('0x1e')],'include':[{'model':db[_0xcd1d('0x1f')],'as':_0xcd1d('0x20'),'include':[{'model':db[_0xcd1d('0x21')],'as':'CloudProvider'}]}]})[_0xcd1d('0xb')](function(_0x29e062){if(!_0x29e062){throw new Error(_0xcd1d('0x22'));}var _0x160a56=_0x29e062[_0xcd1d('0x23')]();var _0x537776={'account':_0x160a56,'message':_[_0xcd1d('0x24')]({'from':util['format'](_0xcd1d('0x25'),_0x29e062['name'],_0x29e062['email']||_0x29e062[_0xcd1d('0x20')][_0xcd1d('0x13')])},_0x199148)};return client[_0xcd1d('0x26')]('SendMail',_0x537776);})[_0xcd1d('0xb')](function(_0x225da2){if(_0x225da2['error']){throw new Error(util[_0xcd1d('0x27')](_0xcd1d('0x28'),_0x225da2[_0xcd1d('0x29')][_0xcd1d('0x2a')]||JSON[_0xcd1d('0x2b')](_0x225da2[_0xcd1d('0x29')])));}return!![];});}function handleError(_0x33979a,_0x3b449a,_0x3da181){return _0x33979a[_0xcd1d('0x2c')](_0x3b449a||0x1f4)[_0xcd1d('0x2d')]({'message':_0x3da181?_0x3da181[_0xcd1d('0x2a')]||_0x3da181:''});}exports[_0xcd1d('0x2e')]=function(_0x2a9213,_0x3bcdfe,_0x58b872){passport[_0xcd1d('0x2f')](_0xcd1d('0x30'),function(_0x5e7ffe,_0x39763b,_0x2f3f32){var _0x2f531a=_0x5e7ffe||_0x2f3f32;if(_0x2f531a){return handleError(_0x3bcdfe,0x191,_0x2f531a);}if(!_0x39763b){return handleError(_0x3bcdfe,0x194,{'message':_0xcd1d('0x31')});}else{var _0x5bfcdc={'payload':{'id':_0x39763b['id'],'role':_0x39763b[_0xcd1d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xcd1d('0x32')](_0x5bfcdc)[_0xcd1d('0xb')](function(_0x94a685){_0x3bcdfe[_0xcd1d('0x33')]({'id':_0x39763b['id'],'token':_0x94a685,'statusCall':'','isAlreadyLogged':_0x39763b[_0xcd1d('0x34')]});});}})(_0x2a9213,_0x3bcdfe,_0x58b872);};exports[_0xcd1d('0x35')]=function(_0x645dab,_0x5be6b7){if(!_0x645dab['body'][_0xcd1d('0x1e')]){return handleError(_0x5be6b7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5142e9=rs[_0xcd1d('0x36')]();_0x645dab[_0xcd1d('0x37')]['email']=_0x645dab['body'][_0xcd1d('0x1e')][_0xcd1d('0x38')]()['toLowerCase']();var _0x408147;return db['Setting'][_0xcd1d('0x9')]({'where':{'id':0x1},'attributes':[_0xcd1d('0x16'),_0xcd1d('0xa')],'raw':!![]})[_0xcd1d('0xb')](function(_0xd71255){_0x408147=_0xd71255;return db['User'][_0xcd1d('0x39')]({'where':{'email':_0x645dab[_0xcd1d('0x37')][_0xcd1d('0x1e')]}});})[_0xcd1d('0xb')](function(_0x447870){if(!_0x447870){throw new Error(_0xcd1d('0x3a'));}if(_0x447870[_0xcd1d('0xf')]){throw new Error(_0xcd1d('0x3b'));}if(_0x447870[_0xcd1d('0x10')]){if(moment(_0x447870[_0xcd1d('0x3c')])[_0xcd1d('0x17')](_0x408147['blockDuration'],_0xcd1d('0x18'))>moment()){throw new Error(_0xcd1d('0x3d'));}else{_0x447870[_0xcd1d('0x10')]=![];_0x447870[_0xcd1d('0x3c')]=null;}}_0x447870[_0xcd1d('0x3e')]=_0x5142e9;_0x447870[_0xcd1d('0x3f')]=Date[_0xcd1d('0x40')]()+0x36ee80;return _0x447870['save']();})[_0xcd1d('0xb')](function(){return sendServiceMail({'to':_0x645dab['body'][_0xcd1d('0x1e')],'subject':_0xcd1d('0x41'),'text':_0xcd1d('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xcd1d('0x43')+_0x645dab[_0xcd1d('0x44')][_0xcd1d('0x45')]+'/reset/'+_0x5142e9+'\x0a\x0a'+_0xcd1d('0x46')});})['then'](function(){_0x5be6b7[_0xcd1d('0x2c')](0xc8)['send']({'message':_0xcd1d('0x47')});})[_0xcd1d('0x1b')](function(_0x384bad){return handleError(_0x5be6b7,0x1f4,_0x384bad);});};exports['reset']=function(_0x43e711,_0x17d7fe){return db[_0xcd1d('0x48')][_0xcd1d('0x39')]({'where':{'resetPasswordToken':_0x43e711[_0xcd1d('0x49')][_0xcd1d('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xcd1d('0xb')](function(_0x4cffde){if(!_0x4cffde){throw new Error(_0xcd1d('0x4b'));}return db['Setting'][_0xcd1d('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xcd1d('0x4c')]})[_0xcd1d('0xb')](function(_0x4a96e6){if(_0x4a96e6[_0xcd1d('0x4d')])authService[_0xcd1d('0x4e')](_0x43e711[_0xcd1d('0x37')][_0xcd1d('0xc')]);if(!_0x4a96e6['enforcePasswordHistory']||!_0x4cffde['previousPasswords'])return _0x4cffde;authService[_0xcd1d('0x4f')](_0x43e711[_0xcd1d('0x37')][_0xcd1d('0xc')],_0x4cffde[_0xcd1d('0x50')],_0x4a96e6[_0xcd1d('0x4c')]);return _0x4cffde;})[_0xcd1d('0xb')](function(){_0x4cffde[_0xcd1d('0xc')]=_0x43e711['body'][_0xcd1d('0xc')];_0x4cffde[_0xcd1d('0x3e')]=null;_0x4cffde[_0xcd1d('0x3f')]=null;return _0x4cffde[_0xcd1d('0x51')]();});})[_0xcd1d('0xb')](function(){_0x17d7fe[_0xcd1d('0x2c')](0xc8)[_0xcd1d('0x2d')]({'message':_0xcd1d('0x52')});})[_0xcd1d('0x1b')](function(_0x422dd1){return handleError(_0x17d7fe,0x1f4,_0x422dd1);});};passport[_0xcd1d('0x53')](_0xcd1d('0x30'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2d7fcb,_0x5147db,_0x5bd109){return localAuthenticate(db[_0xcd1d('0x48')],_0x2d7fcb,_0x5147db,_0x5bd109);})); \ No newline at end of file +var _0x81ff=['https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','resetPasswordExpires','Password\x20reset!','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'];(function(_0x146dd7,_0x4d877d){var _0x2af0bb=function(_0x2327bc){while(--_0x2327bc){_0x146dd7['push'](_0x146dd7['shift']());}};_0x2af0bb(++_0x4d877d);}(_0x81ff,0x18f));var _0xf81f=function(_0x19bbe0,_0x54f1c9){_0x19bbe0=_0x19bbe0-0x0;var _0x37eebc=_0x81ff[_0x19bbe0];return _0x37eebc;};'use strict';var util=require('util');var passport=require(_0xf81f('0x0'));var LocalStrategy=require('passport-local')[_0xf81f('0x1')];var jayson=require(_0xf81f('0x2'));var _=require(_0xf81f('0x3'));var rs=require('randomstring');var moment=require(_0xf81f('0x4'));var db=require(_0xf81f('0x5'))['db'];var authService=require(_0xf81f('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf81f('0x7')][_0xf81f('0x8')]({'port':0x232b});function localAuthenticate(_0x2f22f3,_0x5e58d5,_0x66240,_0x44df40){var _0x304cd8,_0x3feb15;return db[_0xf81f('0x9')][_0xf81f('0xa')]({'where':{'id':0x1},'attributes':[_0xf81f('0xb'),_0xf81f('0xc')],'raw':!![]})['then'](function(_0x4202cb){_0x304cd8=_0x4202cb;return _0x2f22f3[_0xf81f('0xa')]({'attributes':['id',_0xf81f('0xd'),_0xf81f('0xe'),'salt','role',_0xf81f('0xf'),_0xf81f('0x10'),_0xf81f('0x11'),_0xf81f('0x12')],'where':{'name':_0x5e58d5,'role':{'$or':[_0xf81f('0x13'),_0xf81f('0x14'),_0xf81f('0x15')]}}});})['then'](function(_0x449aae){if(!_0x449aae||_0x449aae&&_0x449aae[_0xf81f('0xd')]!==_0x5e58d5){throw new Error(_0xf81f('0x16'));}else{_0x3feb15=_0x449aae;return _0x3feb15;}})[_0xf81f('0x17')](function(){_0x3feb15['authenticate'](_0x66240,function(_0x58925e,_0x55d765){var _0x45588f=_0x3feb15[_0xf81f('0x12')]+0x1;if(_0x58925e){return _0x44df40(_0x58925e);}else if(!_0x55d765){if(_0x3feb15['disabled']){return _0x44df40(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x304cd8[_0xf81f('0xb')]>0x0){if(_0x3feb15[_0xf81f('0x10')]){if(_0x304cd8[_0xf81f('0xc')]>0x0){if(moment(_0x3feb15[_0xf81f('0x11')])['add'](_0x304cd8[_0xf81f('0xc')],_0xf81f('0x18'))>moment()){return _0x44df40(null,![],{'message':_0xf81f('0x16')});}else{return utils[_0xf81f('0x19')](_0x3feb15,_0x45588f,![],null)['then'](function(){return _0x44df40(null,![],{'message':_0xf81f('0x16')});});}}else{return _0x44df40(null,![],{'message':_0xf81f('0x16')});}}else{if(_0x45588f>=_0x304cd8[_0xf81f('0xb')]){return utils[_0xf81f('0x19')](_0x3feb15,0x0,!![],moment())['then'](function(){return _0x44df40(null,![],{'message':_0xf81f('0x16')});});}else{return utils[_0xf81f('0x19')](_0x3feb15,_0x45588f,![],null)[_0xf81f('0x17')](function(){return _0x44df40(null,![],{'message':_0xf81f('0x16')});});}}}else{return _0x44df40(null,![],{'message':_0xf81f('0x16')});}}else{if(_0x3feb15[_0xf81f('0xf')]){return _0x44df40(null,![],{'message':_0xf81f('0x16')});}else if(_0x304cd8[_0xf81f('0xb')]>0x0){if(_0x3feb15[_0xf81f('0x10')]){if(_0x304cd8[_0xf81f('0xc')]>0x0){if(moment(_0x3feb15[_0xf81f('0x11')])[_0xf81f('0x1a')](_0x304cd8[_0xf81f('0xc')],_0xf81f('0x18'))>moment()){return _0x44df40(null,![],{'message':_0xf81f('0x16')});}else{return utils['clearBlockUser'](_0x3feb15,0x0,![],null)[_0xf81f('0x17')](function(){return utils[_0xf81f('0x1b')](_0x3feb15);})[_0xf81f('0x17')](function(){return _0x44df40(null,_0x3feb15);});}}else{return _0x44df40(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf81f('0x19')](_0x3feb15,0x0,![],null)[_0xf81f('0x17')](function(){return utils['getLicense'](_0x3feb15);})[_0xf81f('0x17')](function(){return _0x44df40(null,_0x3feb15);})[_0xf81f('0x1c')](function(_0x487c38){return _0x44df40(null,![],_0x487c38);});}}else{if(_0x3feb15[_0xf81f('0x10')]){return _0x44df40(null,![],{'message':_0xf81f('0x16')});}else{return utils[_0xf81f('0x1b')](_0x3feb15)['then'](function(){return _0x44df40(null,_0x3feb15);});}}}});})[_0xf81f('0x1c')](function(_0x4e8aec){return _0x44df40(null,![],_0x4e8aec);});}function sendServiceMail(_0xc80fb2){return db[_0xf81f('0x1d')][_0xf81f('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xf81f('0xd'),'email'],'include':[{'model':db[_0xf81f('0x1f')],'as':_0xf81f('0x20'),'include':[{'model':db[_0xf81f('0x21')],'as':_0xf81f('0x21')}]}]})['then'](function(_0x1d1a74){if(!_0x1d1a74){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1460be=_0x1d1a74[_0xf81f('0x22')]();var _0x464126={'account':_0x1460be,'message':_[_0xf81f('0x23')]({'from':util[_0xf81f('0x24')](_0xf81f('0x25'),_0x1d1a74['name'],_0x1d1a74[_0xf81f('0x26')]||_0x1d1a74['Smtp'][_0xf81f('0x14')])},_0xc80fb2)};return client['request']('SendMail',_0x464126);})['then'](function(_0x18d6e9){if(_0x18d6e9[_0xf81f('0x27')]){throw new Error(util[_0xf81f('0x24')](_0xf81f('0x28'),_0x18d6e9[_0xf81f('0x27')][_0xf81f('0x29')]||JSON[_0xf81f('0x2a')](_0x18d6e9[_0xf81f('0x27')])));}return!![];});}function handleError(_0x590077,_0x4dd991,_0x46e212){return _0x590077[_0xf81f('0x2b')](_0x4dd991||0x1f4)['send']({'message':_0x46e212?_0x46e212[_0xf81f('0x29')]||_0x46e212:''});}exports[_0xf81f('0x2c')]=function(_0x3fc654,_0x3e27d8,_0x1c0b58){passport['authenticate'](_0xf81f('0x2d'),function(_0x242d31,_0x22ef37,_0x438006){var _0x3bdec6=_0x242d31||_0x438006;if(_0x3bdec6){return handleError(_0x3e27d8,0x191,_0x3bdec6);}if(!_0x22ef37){return handleError(_0x3e27d8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xf00bd1={'payload':{'id':_0x22ef37['id'],'role':_0x22ef37[_0xf81f('0x2e')]},'options':{'expiresIn':0x15180}};return authService[_0xf81f('0x2f')](_0xf00bd1)[_0xf81f('0x17')](function(_0x2901b7){_0x3e27d8[_0xf81f('0x30')]({'id':_0x22ef37['id'],'token':_0x2901b7,'statusCall':'','isAlreadyLogged':_0x22ef37[_0xf81f('0x31')]});});}})(_0x3fc654,_0x3e27d8,_0x1c0b58);};exports['forgot']=function(_0x157be9,_0x3aa7f6){if(!_0x157be9[_0xf81f('0x32')]['email']){return handleError(_0x3aa7f6,0x1f4,{'message':_0xf81f('0x33')});}var _0x357180=rs[_0xf81f('0x34')]();_0x157be9[_0xf81f('0x32')][_0xf81f('0x26')]=_0x157be9['body']['email'][_0xf81f('0x35')]()['toLowerCase']();var _0x2ed039;return db[_0xf81f('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x375928){_0x2ed039=_0x375928;return db['User'][_0xf81f('0x1e')]({'where':{'email':_0x157be9['body'][_0xf81f('0x26')]}});})[_0xf81f('0x17')](function(_0x2d8e04){if(!_0x2d8e04){throw new Error(_0xf81f('0x36'));}if(_0x2d8e04[_0xf81f('0xf')]){throw new Error(_0xf81f('0x37'));}if(_0x2d8e04[_0xf81f('0x10')]){if(moment(_0x2d8e04['blockedAt'])[_0xf81f('0x1a')](_0x2ed039['blockDuration'],_0xf81f('0x18'))>moment()){throw new Error(_0xf81f('0x38'));}else{_0x2d8e04[_0xf81f('0x10')]=![];_0x2d8e04[_0xf81f('0x11')]=null;}}_0x2d8e04[_0xf81f('0x39')]=_0x357180;_0x2d8e04['resetPasswordExpires']=Date[_0xf81f('0x3a')]()+0x36ee80;return _0x2d8e04[_0xf81f('0x3b')]();})[_0xf81f('0x17')](function(){return sendServiceMail({'to':_0x157be9[_0xf81f('0x32')][_0xf81f('0x26')],'subject':_0xf81f('0x3c'),'text':_0xf81f('0x3d')+_0xf81f('0x3e')+_0xf81f('0x3f')+_0x157be9[_0xf81f('0x40')]['host']+'/reset/'+_0x357180+'\x0a\x0a'+_0xf81f('0x41')});})[_0xf81f('0x17')](function(){_0x3aa7f6[_0xf81f('0x2b')](0xc8)[_0xf81f('0x42')]({'message':_0xf81f('0x43')});})[_0xf81f('0x1c')](function(_0x2dc278){return handleError(_0x3aa7f6,0x1f4,_0x2dc278);});};exports[_0xf81f('0x44')]=function(_0xc1d9a4,_0x1393bc){return db[_0xf81f('0x45')][_0xf81f('0x1e')]({'where':{'resetPasswordToken':_0xc1d9a4['params'][_0xf81f('0x46')],'resetPasswordExpires':{'$gt':Date[_0xf81f('0x3a')]()}}})[_0xf81f('0x17')](function(_0x14e776){if(!_0x14e776){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xf81f('0x9')][_0xf81f('0xa')]({'attributes':['id',_0xf81f('0x47'),_0xf81f('0x48'),_0xf81f('0x49')]})[_0xf81f('0x17')](function(_0x1a976e){if(_0x1a976e[_0xf81f('0x47')])authService[_0xf81f('0x4a')](_0xc1d9a4[_0xf81f('0x32')][_0xf81f('0xe')]);if(!_0x1a976e[_0xf81f('0x48')]||!_0x14e776['previousPasswords'])return _0x14e776;authService['validatePasswordHistory'](_0xc1d9a4['body']['password'],_0x14e776['previousPasswords'],_0x1a976e[_0xf81f('0x49')]);return _0x14e776;})['then'](function(){_0x14e776[_0xf81f('0xe')]=_0xc1d9a4[_0xf81f('0x32')][_0xf81f('0xe')];_0x14e776['resetPasswordToken']=null;_0x14e776[_0xf81f('0x4b')]=null;return _0x14e776['save']();});})[_0xf81f('0x17')](function(){_0x1393bc['status'](0xc8)['send']({'message':_0xf81f('0x4c')});})['catch'](function(_0x83d383){return handleError(_0x1393bc,0x1f4,_0x83d383);});};passport['use'](_0xf81f('0x2d'),new LocalStrategy({'usernameField':_0xf81f('0xd'),'passwordField':_0xf81f('0xe')},function(_0x5459b5,_0x534f88,_0x1ed815){return localAuthenticate(db['User'],_0x5459b5,_0x534f88,_0x1ed815);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index b16499e..ce3789d 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 _0x92f3=['post','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','login'];(function(_0x375337,_0x39cd14){var _0x46a420=function(_0x5cc043){while(--_0x5cc043){_0x375337['push'](_0x375337['shift']());}};_0x46a420(++_0x39cd14);}(_0x92f3,0x1aa));var _0x392f=function(_0x5b81f0,_0x2bb875){_0x5b81f0=_0x5b81f0-0x0;var _0xe01fef=_0x92f3[_0x5b81f0];return _0xe01fef;};'use strict';var express=require(_0x392f('0x0'));var router=express[_0x392f('0x1')]();var controller=require(_0x392f('0x2'));router['post']('/',controller[_0x392f('0x3')]);router[_0x392f('0x4')](_0x392f('0x5'),controller[_0x392f('0x6')]);router['post'](_0x392f('0x7'),controller[_0x392f('0x8')]);module[_0x392f('0x9')]=router; \ No newline at end of file +var _0x8783=['./authLocal.controller','login','post','forgot','/reset/:token','reset','Router'];(function(_0x3ee4bc,_0x55538c){var _0xd7e1d7=function(_0x245e80){while(--_0x245e80){_0x3ee4bc['push'](_0x3ee4bc['shift']());}};_0xd7e1d7(++_0x55538c);}(_0x8783,0xf4));var _0x3878=function(_0x4352a5,_0x211c5c){_0x4352a5=_0x4352a5-0x0;var _0xf3b07c=_0x8783[_0x4352a5];return _0xf3b07c;};'use strict';var express=require('express');var router=express[_0x3878('0x0')]();var controller=require(_0x3878('0x1'));router['post']('/',controller[_0x3878('0x2')]);router[_0x3878('0x3')]('/forgot',controller[_0x3878('0x4')]);router[_0x3878('0x3')](_0x3878('0x5'),controller[_0x3878('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 298c9f0..f974d1d 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 _0x5060=['exports','STRING','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5060,0x127));var _0x0506=function(_0x2cd657,_0x7943f6){_0x2cd657=_0x2cd657-0x0;var _0x5e1ac6=_0x5060[_0x2cd657];return _0x5e1ac6;};'use strict';var Sequelize=require(_0x0506('0x0'));module[_0x0506('0x1')]={'name':{'type':Sequelize[_0x0506('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0506('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0506('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd94b=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x369bae,_0xaed164){var _0x585cb8=function(_0x5947fd){while(--_0x5947fd){_0x369bae['push'](_0x369bae['shift']());}};_0x585cb8(++_0xaed164);}(_0xd94b,0x1b3));var _0xbd94=function(_0x2f9c17,_0x103d10){_0x2f9c17=_0x2f9c17-0x0;var _0x43d8a5=_0xd94b[_0x2f9c17];return _0x43d8a5;};'use strict';var Sequelize=require(_0xbd94('0x0'));module[_0xbd94('0x1')]={'name':{'type':Sequelize[_0xbd94('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xbd94('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbd94('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index d4533a7..0afe64d 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 _0x67c5=['offset','undefined','limit','count','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Automation','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','Condition','addConditions','ids','omit','findOne','length','getConditions','addActions','Action','getActions','pick','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x7bfa1b,_0xf2a59c){var _0x2126b2=function(_0x4ac0d6){while(--_0x4ac0d6){_0x7bfa1b['push'](_0x7bfa1b['shift']());}};_0x2126b2(++_0xf2a59c);}(_0x67c5,0x17a));var _0x567c=function(_0x346210,_0x58972f){_0x346210=_0x346210-0x0;var _0x8d7670=_0x67c5[_0x346210];return _0x8d7670;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x567c('0x0'));var zipdir=require(_0x567c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x567c('0x2'));var BPromise=require(_0x567c('0x3'));var Mustache=require(_0x567c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x567c('0x5'));var csv=require(_0x567c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x567c('0x7'));var _=require(_0x567c('0x8'));var squel=require(_0x567c('0x9'));var crypto=require(_0x567c('0xa'));var jsforce=require(_0x567c('0xb'));var deskjs=require(_0x567c('0xc'));var toCsv=require(_0x567c('0x6'));var querystring=require(_0x567c('0xd'));var Papa=require(_0x567c('0xe'));var Redis=require(_0x567c('0xf'));var authService=require(_0x567c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x567c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x567c('0x12'));var utils=require(_0x567c('0x13'));var config=require(_0x567c('0x14'));var licenseUtil=require(_0x567c('0x15'));var db=require(_0x567c('0x16'))['db'];function respondWithStatusCode(_0x3920bd,_0x292cfc){_0x292cfc=_0x292cfc||0xcc;return function(_0x535c28){if(_0x535c28){return _0x3920bd[_0x567c('0x17')](_0x292cfc);}return _0x3920bd[_0x567c('0x18')](_0x292cfc)[_0x567c('0x19')]();};}function respondWithResult(_0x16d328,_0x1aa58b){_0x1aa58b=_0x1aa58b||0xc8;return function(_0x83d558){if(_0x83d558){return _0x16d328['status'](_0x1aa58b)[_0x567c('0x1a')](_0x83d558);}};}function respondWithFilteredResult(_0x3717e5,_0x3073c3){return function(_0x5cc041){if(_0x5cc041){var _0x57b437=typeof _0x3073c3[_0x567c('0x1b')]===_0x567c('0x1c')&&typeof _0x3073c3[_0x567c('0x1d')]===_0x567c('0x1c');var _0x57c193=_0x5cc041[_0x567c('0x1e')];var _0x443fbd=_0x57b437?0x0:_0x3073c3[_0x567c('0x1b')];var _0x541121=_0x57b437?_0x5cc041[_0x567c('0x1e')]:_0x3073c3[_0x567c('0x1b')]+_0x3073c3[_0x567c('0x1d')];var _0xaeca4d;if(_0x541121>=_0x57c193){_0x541121=_0x57c193;_0xaeca4d=0xc8;}else{_0xaeca4d=0xce;}_0x3717e5[_0x567c('0x18')](_0xaeca4d);return _0x3717e5['set']('Content-Range',_0x443fbd+'-'+_0x541121+'/'+_0x57c193)[_0x567c('0x1a')](_0x5cc041);}return null;};}function patchUpdates(_0x59086e){return function(_0x44148c){try{jsonpatch['apply'](_0x44148c,_0x59086e,!![]);}catch(_0x3fa28f){return BPromise[_0x567c('0x1f')](_0x3fa28f);}return _0x44148c[_0x567c('0x20')]();};}function saveUpdates(_0x1e1c3b,_0x530719){return function(_0x6b47f1){if(_0x6b47f1){return _0x6b47f1['update'](_0x1e1c3b)[_0x567c('0x21')](function(_0x511aab){return _0x511aab;});}return null;};}function removeEntity(_0x110aea,_0x40f57c){return function(_0x3c0ccc){if(_0x3c0ccc){return _0x3c0ccc[_0x567c('0x22')]()[_0x567c('0x21')](function(){_0x110aea[_0x567c('0x18')](0xcc)[_0x567c('0x19')]();});}};}function handleEntityNotFound(_0x235e33,_0x2066aa){return function(_0x4dd87b){if(!_0x4dd87b){_0x235e33[_0x567c('0x17')](0x194);}return _0x4dd87b;};}function handleError(_0x4fb8d5,_0x3d02d4){_0x3d02d4=_0x3d02d4||0x1f4;return function(_0x313847){logger['error'](_0x313847[_0x567c('0x23')]);if(_0x313847[_0x567c('0x24')]){delete _0x313847['name'];}_0x4fb8d5[_0x567c('0x18')](_0x3d02d4)[_0x567c('0x25')](_0x313847);};}exports[_0x567c('0x26')]=function(_0x1f493a,_0x1f9327){var _0x3122d4={},_0x5a18c6={},_0x15784a={'count':0x0,'rows':[]};var _0xf874e8=_[_0x567c('0x27')](db['Automation'][_0x567c('0x28')],function(_0x342e96){return{'name':_0x342e96['fieldName'],'type':_0x342e96[_0x567c('0x29')]['key']};});_0x5a18c6['model']=_['map'](_0xf874e8,'name');_0x5a18c6[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x1f493a[_0x567c('0x2a')]);_0x5a18c6[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x5a18c6[_0x567c('0x2e')],_0x5a18c6['query']);_0x3122d4[_0x567c('0x2f')]=_[_0x567c('0x2d')](_0x5a18c6['model'],qs[_0x567c('0x30')](_0x1f493a[_0x567c('0x2a')][_0x567c('0x30')]));_0x3122d4[_0x567c('0x2f')]=_0x3122d4[_0x567c('0x2f')]['length']?_0x3122d4[_0x567c('0x2f')]:_0x5a18c6[_0x567c('0x2e')];if(!_0x1f493a[_0x567c('0x2a')][_0x567c('0x31')](_0x567c('0x32'))){_0x3122d4['limit']=qs['limit'](_0x1f493a['query'][_0x567c('0x1d')]);_0x3122d4[_0x567c('0x1b')]=qs['offset'](_0x1f493a[_0x567c('0x2a')][_0x567c('0x1b')]);}_0x3122d4[_0x567c('0x33')]=qs[_0x567c('0x34')](_0x1f493a[_0x567c('0x2a')][_0x567c('0x34')]);_0x3122d4[_0x567c('0x35')]=qs[_0x567c('0x2c')](_['pick'](_0x1f493a[_0x567c('0x2a')],_0x5a18c6['filters']),_0xf874e8);if(_0x1f493a['query'][_0x567c('0x36')]){_0x3122d4[_0x567c('0x35')]=_[_0x567c('0x37')](_0x3122d4[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0xf874e8,function(_0x165cdb){if(_0x165cdb[_0x567c('0x29')]!==_0x567c('0x38')){var _0x49c288={};_0x49c288[_0x165cdb[_0x567c('0x24')]]={'$like':'%'+_0x1f493a['query'][_0x567c('0x36')]+'%'};return _0x49c288;}})});}_0x3122d4=_[_0x567c('0x37')]({},_0x3122d4,_0x1f493a[_0x567c('0x39')]);var _0x354c80={'where':_0x3122d4[_0x567c('0x35')]};return db[_0x567c('0x3a')][_0x567c('0x1e')](_0x354c80)[_0x567c('0x21')](function(_0x7c64fb){_0x15784a[_0x567c('0x1e')]=_0x7c64fb;if(_0x1f493a[_0x567c('0x2a')][_0x567c('0x3b')]){_0x3122d4['include']=[{'all':!![]}];}return db[_0x567c('0x3a')][_0x567c('0x3c')](_0x3122d4);})[_0x567c('0x21')](function(_0x293163){_0x15784a[_0x567c('0x3d')]=_0x293163;return _0x15784a;})[_0x567c('0x21')](respondWithFilteredResult(_0x1f9327,_0x3122d4))[_0x567c('0x3e')](handleError(_0x1f9327,null));};exports[_0x567c('0x3f')]=function(_0x614051,_0x788ce9){var _0x397ea6={'raw':![],'where':{'id':_0x614051[_0x567c('0x40')]['id']}},_0x52a896={};_0x52a896['model']=_[_0x567c('0x2b')](db[_0x567c('0x3a')]['rawAttributes']);_0x52a896['query']=_[_0x567c('0x2b')](_0x614051[_0x567c('0x2a')]);_0x52a896[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x52a896['model'],_0x52a896[_0x567c('0x2a')]);_0x397ea6['attributes']=_[_0x567c('0x2d')](_0x52a896[_0x567c('0x2e')],qs[_0x567c('0x30')](_0x614051[_0x567c('0x2a')]['fields']));_0x397ea6[_0x567c('0x2f')]=_0x397ea6[_0x567c('0x2f')]['length']?_0x397ea6['attributes']:_0x52a896[_0x567c('0x2e')];if(_0x614051[_0x567c('0x2a')]['includeAll']){_0x397ea6[_0x567c('0x41')]=[{'all':!![]}];}_0x397ea6=_[_0x567c('0x37')]({},_0x397ea6,_0x614051['options']);return db['Automation'][_0x567c('0x42')](_0x397ea6)[_0x567c('0x21')](handleEntityNotFound(_0x788ce9,null))['then'](respondWithResult(_0x788ce9,null))[_0x567c('0x3e')](handleError(_0x788ce9,null));};exports['create']=function(_0xc3269a,_0x588cbc){return db[_0x567c('0x3a')][_0x567c('0x43')](_0xc3269a[_0x567c('0x44')],{})[_0x567c('0x21')](respondWithResult(_0x588cbc,0xc9))['catch'](handleError(_0x588cbc,null));};exports[_0x567c('0x45')]=function(_0x4267c1,_0x21feb1){if(_0x4267c1['body']['id']){delete _0x4267c1[_0x567c('0x44')]['id'];}return db[_0x567c('0x3a')]['find']({'where':{'id':_0x4267c1[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x21feb1,null))[_0x567c('0x21')](saveUpdates(_0x4267c1[_0x567c('0x44')],null))[_0x567c('0x21')](respondWithResult(_0x21feb1,null))['catch'](handleError(_0x21feb1,null));};exports[_0x567c('0x22')]=function(_0x4a1830,_0x39932c){return db[_0x567c('0x3a')]['find']({'where':{'id':_0x4a1830[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x39932c,null))[_0x567c('0x21')](removeEntity(_0x39932c,null))[_0x567c('0x3e')](handleError(_0x39932c,null));};exports['addConditions']=function(_0x5afbbf,_0x472d13,_0x32b8ef){return db[_0x567c('0x46')][_0x567c('0x42')]({'where':{'id':_0x5afbbf['params']['id']}})['then'](handleEntityNotFound(_0x472d13,null))[_0x567c('0x21')](function(_0x25f273){if(_0x25f273){return _0x25f273[_0x567c('0x47')](_0x5afbbf[_0x567c('0x44')][_0x567c('0x48')],_[_0x567c('0x49')](_0x5afbbf[_0x567c('0x44')],[_0x567c('0x48'),'id'])||{});}})[_0x567c('0x21')](respondWithResult(_0x472d13,null))['catch'](handleError(_0x472d13,null));};exports['getConditions']=function(_0x11fc73,_0x512d58,_0x762ed6){var _0x493a11={};var _0x1c057d={};var _0x31c388;var _0x47233a;return db[_0x567c('0x3a')][_0x567c('0x4a')]({'where':{'id':_0x11fc73['params']['id']}})['then'](handleEntityNotFound(_0x512d58,null))[_0x567c('0x21')](function(_0x29b939){if(_0x29b939){_0x31c388=_0x29b939;_0x1c057d[_0x567c('0x2e')]=_[_0x567c('0x2b')](db[_0x567c('0x46')][_0x567c('0x28')]);_0x1c057d[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x11fc73[_0x567c('0x2a')]);_0x1c057d['filters']=_[_0x567c('0x2d')](_0x1c057d[_0x567c('0x2e')],_0x1c057d['query']);_0x493a11[_0x567c('0x2f')]=_['intersection'](_0x1c057d[_0x567c('0x2e')],qs[_0x567c('0x30')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x30')]));_0x493a11['attributes']=_0x493a11['attributes'][_0x567c('0x4b')]?_0x493a11[_0x567c('0x2f')]:_0x1c057d['model'];_0x493a11[_0x567c('0x33')]=qs['sort'](_0x11fc73[_0x567c('0x2a')][_0x567c('0x34')]);_0x493a11[_0x567c('0x35')]=qs[_0x567c('0x2c')](_['pick'](_0x11fc73[_0x567c('0x2a')],_0x1c057d[_0x567c('0x2c')]));if(_0x11fc73[_0x567c('0x2a')][_0x567c('0x36')]){_0x493a11['where']=_['merge'](_0x493a11[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0x493a11[_0x567c('0x2f')],function(_0x19634f){var _0x503aea={};_0x503aea[_0x19634f]={'$like':'%'+_0x11fc73[_0x567c('0x2a')]['filter']+'%'};return _0x503aea;})});}_0x493a11=_[_0x567c('0x37')]({},_0x493a11,_0x11fc73[_0x567c('0x39')]);return _0x31c388[_0x567c('0x4c')](_0x493a11);}})[_0x567c('0x21')](function(_0x5c4c1f){if(_0x5c4c1f){_0x47233a=_0x5c4c1f[_0x567c('0x4b')];if(!_0x11fc73[_0x567c('0x2a')][_0x567c('0x31')](_0x567c('0x32'))){_0x493a11[_0x567c('0x1d')]=qs[_0x567c('0x1d')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x1d')]);_0x493a11[_0x567c('0x1b')]=qs[_0x567c('0x1b')](_0x11fc73[_0x567c('0x2a')][_0x567c('0x1b')]);}return _0x31c388['getConditions'](_0x493a11);}})['then'](function(_0x4f9a3b){if(_0x4f9a3b){return _0x4f9a3b?{'count':_0x47233a,'rows':_0x4f9a3b}:null;}})[_0x567c('0x21')](respondWithResult(_0x512d58,null))[_0x567c('0x3e')](handleError(_0x512d58,null));};exports[_0x567c('0x4d')]=function(_0x30f366,_0x83c4f4,_0x255830){return db[_0x567c('0x4e')][_0x567c('0x42')]({'where':{'id':_0x30f366[_0x567c('0x40')]['id']}})[_0x567c('0x21')](handleEntityNotFound(_0x83c4f4,null))[_0x567c('0x21')](function(_0x21ebb0){if(_0x21ebb0){return _0x21ebb0['addActions'](_0x30f366['body'][_0x567c('0x48')],_[_0x567c('0x49')](_0x30f366[_0x567c('0x44')],[_0x567c('0x48'),'id'])||{});}})[_0x567c('0x21')](respondWithResult(_0x83c4f4,null))[_0x567c('0x3e')](handleError(_0x83c4f4,null));};exports[_0x567c('0x4f')]=function(_0x557ce6,_0x434004,_0x53e8ce){var _0x83c3f2={};var _0x1cede7={};var _0x5ccf69;var _0x4674eb;return db[_0x567c('0x3a')][_0x567c('0x4a')]({'where':{'id':_0x557ce6[_0x567c('0x40')]['id']}})['then'](handleEntityNotFound(_0x434004,null))[_0x567c('0x21')](function(_0x2e83f9){if(_0x2e83f9){_0x5ccf69=_0x2e83f9;_0x1cede7[_0x567c('0x2e')]=_[_0x567c('0x2b')](db[_0x567c('0x4e')][_0x567c('0x28')]);_0x1cede7[_0x567c('0x2a')]=_[_0x567c('0x2b')](_0x557ce6['query']);_0x1cede7[_0x567c('0x2c')]=_[_0x567c('0x2d')](_0x1cede7[_0x567c('0x2e')],_0x1cede7[_0x567c('0x2a')]);_0x83c3f2[_0x567c('0x2f')]=_['intersection'](_0x1cede7[_0x567c('0x2e')],qs['fields'](_0x557ce6[_0x567c('0x2a')][_0x567c('0x30')]));_0x83c3f2[_0x567c('0x2f')]=_0x83c3f2[_0x567c('0x2f')][_0x567c('0x4b')]?_0x83c3f2['attributes']:_0x1cede7[_0x567c('0x2e')];_0x83c3f2[_0x567c('0x33')]=qs['sort'](_0x557ce6[_0x567c('0x2a')][_0x567c('0x34')]);_0x83c3f2[_0x567c('0x35')]=qs[_0x567c('0x2c')](_[_0x567c('0x50')](_0x557ce6[_0x567c('0x2a')],_0x1cede7[_0x567c('0x2c')]));if(_0x557ce6[_0x567c('0x2a')]['filter']){_0x83c3f2['where']=_['merge'](_0x83c3f2[_0x567c('0x35')],{'$or':_[_0x567c('0x27')](_0x83c3f2['attributes'],function(_0x210745){var _0x144f53={};_0x144f53[_0x210745]={'$like':'%'+_0x557ce6[_0x567c('0x2a')]['filter']+'%'};return _0x144f53;})});}_0x83c3f2=_[_0x567c('0x37')]({},_0x83c3f2,_0x557ce6[_0x567c('0x39')]);return _0x5ccf69[_0x567c('0x4f')](_0x83c3f2);}})[_0x567c('0x21')](function(_0x865bf6){if(_0x865bf6){_0x4674eb=_0x865bf6[_0x567c('0x4b')];if(!_0x557ce6[_0x567c('0x2a')]['hasOwnProperty'](_0x567c('0x32'))){_0x83c3f2['limit']=qs[_0x567c('0x1d')](_0x557ce6['query'][_0x567c('0x1d')]);_0x83c3f2[_0x567c('0x1b')]=qs[_0x567c('0x1b')](_0x557ce6[_0x567c('0x2a')][_0x567c('0x1b')]);}return _0x5ccf69['getActions'](_0x83c3f2);}})[_0x567c('0x21')](function(_0x22f103){if(_0x22f103){return _0x22f103?{'count':_0x4674eb,'rows':_0x22f103}:null;}})[_0x567c('0x21')](respondWithResult(_0x434004,null))[_0x567c('0x3e')](handleError(_0x434004,null));}; \ No newline at end of file +var _0xb755=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Automation','findAll','rows','catch','show','keys','include','create','body','find','params','addConditions','Condition','ids','omit','getConditions','order','Action','getActions','zip-dir','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','type','model','map'];(function(_0x32b279,_0x400c38){var _0x4b60cc=function(_0xda0f7b){while(--_0xda0f7b){_0x32b279['push'](_0x32b279['shift']());}};_0x4b60cc(++_0x400c38);}(_0xb755,0x103));var _0x5b75=function(_0x59720e,_0x69cdb2){_0x59720e=_0x59720e-0x0;var _0x28e909=_0xb755[_0x59720e];return _0x28e909;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b75('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b75('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b75('0x2'));var util=require(_0x5b75('0x3'));var path=require(_0x5b75('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5b75('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b75('0x6'));var squel=require('squel');var crypto=require(_0x5b75('0x7'));var jsforce=require(_0x5b75('0x8'));var deskjs=require(_0x5b75('0x9'));var toCsv=require(_0x5b75('0xa'));var querystring=require(_0x5b75('0xb'));var Papa=require(_0x5b75('0xc'));var Redis=require('ioredis');var authService=require(_0x5b75('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b75('0xe'));var logger=require(_0x5b75('0xf'))(_0x5b75('0x10'));var utils=require(_0x5b75('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x5b75('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e2e33,_0x37fe1c){_0x37fe1c=_0x37fe1c||0xcc;return function(_0x391c52){if(_0x391c52){return _0x3e2e33[_0x5b75('0x13')](_0x37fe1c);}return _0x3e2e33[_0x5b75('0x14')](_0x37fe1c)[_0x5b75('0x15')]();};}function respondWithResult(_0x2e843d,_0x36fb3a){_0x36fb3a=_0x36fb3a||0xc8;return function(_0x16f3fa){if(_0x16f3fa){return _0x2e843d[_0x5b75('0x14')](_0x36fb3a)[_0x5b75('0x16')](_0x16f3fa);}};}function respondWithFilteredResult(_0x2fb1e5,_0x4be2dd){return function(_0x312226){if(_0x312226){var _0x53501c=typeof _0x4be2dd[_0x5b75('0x17')]===_0x5b75('0x18')&&typeof _0x4be2dd[_0x5b75('0x19')]===_0x5b75('0x18');var _0x119a8b=_0x312226[_0x5b75('0x1a')];var _0x52e14e=_0x53501c?0x0:_0x4be2dd[_0x5b75('0x17')];var _0x1bb3d2=_0x53501c?_0x312226[_0x5b75('0x1a')]:_0x4be2dd['offset']+_0x4be2dd[_0x5b75('0x19')];var _0x2347c6;if(_0x1bb3d2>=_0x119a8b){_0x1bb3d2=_0x119a8b;_0x2347c6=0xc8;}else{_0x2347c6=0xce;}_0x2fb1e5[_0x5b75('0x14')](_0x2347c6);return _0x2fb1e5[_0x5b75('0x1b')]('Content-Range',_0x52e14e+'-'+_0x1bb3d2+'/'+_0x119a8b)[_0x5b75('0x16')](_0x312226);}return null;};}function patchUpdates(_0xbb3761){return function(_0x11416b){try{jsonpatch[_0x5b75('0x1c')](_0x11416b,_0xbb3761,!![]);}catch(_0x55feed){return BPromise[_0x5b75('0x1d')](_0x55feed);}return _0x11416b['save']();};}function saveUpdates(_0x145204,_0x5e4b3a){return function(_0x165357){if(_0x165357){return _0x165357[_0x5b75('0x1e')](_0x145204)[_0x5b75('0x1f')](function(_0x182b7b){return _0x182b7b;});}return null;};}function removeEntity(_0x4a4212,_0x195105){return function(_0x1df574){if(_0x1df574){return _0x1df574[_0x5b75('0x20')]()['then'](function(){_0x4a4212['status'](0xcc)[_0x5b75('0x15')]();});}};}function handleEntityNotFound(_0x51ead8,_0x4f458a){return function(_0x2a5687){if(!_0x2a5687){_0x51ead8[_0x5b75('0x13')](0x194);}return _0x2a5687;};}function handleError(_0x7a6818,_0x4e9276){_0x4e9276=_0x4e9276||0x1f4;return function(_0x1afc36){logger[_0x5b75('0x21')](_0x1afc36[_0x5b75('0x22')]);if(_0x1afc36[_0x5b75('0x23')]){delete _0x1afc36[_0x5b75('0x23')];}_0x7a6818[_0x5b75('0x14')](_0x4e9276)['send'](_0x1afc36);};}exports[_0x5b75('0x24')]=function(_0xdad734,_0x1298c0){var _0x423c38={},_0x9dfddc={},_0x15568b={'count':0x0,'rows':[]};var _0x7c0055=_['map'](db['Automation'][_0x5b75('0x25')],function(_0x29b614){return{'name':_0x29b614['fieldName'],'type':_0x29b614[_0x5b75('0x26')]['key']};});_0x9dfddc[_0x5b75('0x27')]=_[_0x5b75('0x28')](_0x7c0055,_0x5b75('0x23'));_0x9dfddc[_0x5b75('0x29')]=_['keys'](_0xdad734['query']);_0x9dfddc[_0x5b75('0x2a')]=_[_0x5b75('0x2b')](_0x9dfddc['model'],_0x9dfddc[_0x5b75('0x29')]);_0x423c38[_0x5b75('0x2c')]=_[_0x5b75('0x2b')](_0x9dfddc['model'],qs['fields'](_0xdad734[_0x5b75('0x29')][_0x5b75('0x2d')]));_0x423c38[_0x5b75('0x2c')]=_0x423c38['attributes'][_0x5b75('0x2e')]?_0x423c38[_0x5b75('0x2c')]:_0x9dfddc[_0x5b75('0x27')];if(!_0xdad734['query'][_0x5b75('0x2f')](_0x5b75('0x30'))){_0x423c38[_0x5b75('0x19')]=qs[_0x5b75('0x19')](_0xdad734['query'][_0x5b75('0x19')]);_0x423c38[_0x5b75('0x17')]=qs[_0x5b75('0x17')](_0xdad734[_0x5b75('0x29')]['offset']);}_0x423c38['order']=qs[_0x5b75('0x31')](_0xdad734[_0x5b75('0x29')][_0x5b75('0x31')]);_0x423c38[_0x5b75('0x32')]=qs[_0x5b75('0x2a')](_[_0x5b75('0x33')](_0xdad734[_0x5b75('0x29')],_0x9dfddc[_0x5b75('0x2a')]),_0x7c0055);if(_0xdad734[_0x5b75('0x29')][_0x5b75('0x34')]){_0x423c38[_0x5b75('0x32')]=_['merge'](_0x423c38[_0x5b75('0x32')],{'$or':_[_0x5b75('0x28')](_0x7c0055,function(_0x1453a7){if(_0x1453a7[_0x5b75('0x26')]!==_0x5b75('0x35')){var _0x32a3e0={};_0x32a3e0[_0x1453a7[_0x5b75('0x23')]]={'$like':'%'+_0xdad734['query']['filter']+'%'};return _0x32a3e0;}})});}_0x423c38=_[_0x5b75('0x36')]({},_0x423c38,_0xdad734[_0x5b75('0x37')]);var _0x27f545={'where':_0x423c38[_0x5b75('0x32')]};return db[_0x5b75('0x38')][_0x5b75('0x1a')](_0x27f545)[_0x5b75('0x1f')](function(_0x29b824){_0x15568b[_0x5b75('0x1a')]=_0x29b824;if(_0xdad734[_0x5b75('0x29')]['includeAll']){_0x423c38['include']=[{'all':!![]}];}return db[_0x5b75('0x38')][_0x5b75('0x39')](_0x423c38);})[_0x5b75('0x1f')](function(_0x45a1fa){_0x15568b[_0x5b75('0x3a')]=_0x45a1fa;return _0x15568b;})[_0x5b75('0x1f')](respondWithFilteredResult(_0x1298c0,_0x423c38))[_0x5b75('0x3b')](handleError(_0x1298c0,null));};exports[_0x5b75('0x3c')]=function(_0x17dc7d,_0x13bb60){var _0x5b9db9={'raw':![],'where':{'id':_0x17dc7d['params']['id']}},_0xb2978f={};_0xb2978f[_0x5b75('0x27')]=_[_0x5b75('0x3d')](db['Automation']['rawAttributes']);_0xb2978f[_0x5b75('0x29')]=_['keys'](_0x17dc7d[_0x5b75('0x29')]);_0xb2978f['filters']=_['intersection'](_0xb2978f['model'],_0xb2978f[_0x5b75('0x29')]);_0x5b9db9[_0x5b75('0x2c')]=_[_0x5b75('0x2b')](_0xb2978f[_0x5b75('0x27')],qs[_0x5b75('0x2d')](_0x17dc7d[_0x5b75('0x29')][_0x5b75('0x2d')]));_0x5b9db9[_0x5b75('0x2c')]=_0x5b9db9[_0x5b75('0x2c')][_0x5b75('0x2e')]?_0x5b9db9[_0x5b75('0x2c')]:_0xb2978f['model'];if(_0x17dc7d['query']['includeAll']){_0x5b9db9[_0x5b75('0x3e')]=[{'all':!![]}];}_0x5b9db9=_[_0x5b75('0x36')]({},_0x5b9db9,_0x17dc7d[_0x5b75('0x37')]);return db[_0x5b75('0x38')]['find'](_0x5b9db9)[_0x5b75('0x1f')](handleEntityNotFound(_0x13bb60,null))[_0x5b75('0x1f')](respondWithResult(_0x13bb60,null))[_0x5b75('0x3b')](handleError(_0x13bb60,null));};exports[_0x5b75('0x3f')]=function(_0x532c10,_0x2980bd){return db['Automation'][_0x5b75('0x3f')](_0x532c10[_0x5b75('0x40')],{})[_0x5b75('0x1f')](respondWithResult(_0x2980bd,0xc9))[_0x5b75('0x3b')](handleError(_0x2980bd,null));};exports[_0x5b75('0x1e')]=function(_0x43af6f,_0x38dae3){if(_0x43af6f[_0x5b75('0x40')]['id']){delete _0x43af6f[_0x5b75('0x40')]['id'];}return db[_0x5b75('0x38')]['find']({'where':{'id':_0x43af6f['params']['id']}})[_0x5b75('0x1f')](handleEntityNotFound(_0x38dae3,null))[_0x5b75('0x1f')](saveUpdates(_0x43af6f[_0x5b75('0x40')],null))[_0x5b75('0x1f')](respondWithResult(_0x38dae3,null))[_0x5b75('0x3b')](handleError(_0x38dae3,null));};exports[_0x5b75('0x20')]=function(_0x2e22ad,_0x4ccce6){return db[_0x5b75('0x38')][_0x5b75('0x41')]({'where':{'id':_0x2e22ad[_0x5b75('0x42')]['id']}})[_0x5b75('0x1f')](handleEntityNotFound(_0x4ccce6,null))['then'](removeEntity(_0x4ccce6,null))['catch'](handleError(_0x4ccce6,null));};exports[_0x5b75('0x43')]=function(_0x5c7ade,_0x4a8e07,_0x3b7b4a){return db[_0x5b75('0x44')][_0x5b75('0x41')]({'where':{'id':_0x5c7ade[_0x5b75('0x42')]['id']}})[_0x5b75('0x1f')](handleEntityNotFound(_0x4a8e07,null))['then'](function(_0x383531){if(_0x383531){return _0x383531[_0x5b75('0x43')](_0x5c7ade[_0x5b75('0x40')][_0x5b75('0x45')],_[_0x5b75('0x46')](_0x5c7ade[_0x5b75('0x40')],['ids','id'])||{});}})[_0x5b75('0x1f')](respondWithResult(_0x4a8e07,null))[_0x5b75('0x3b')](handleError(_0x4a8e07,null));};exports[_0x5b75('0x47')]=function(_0x34e850,_0x1b4d7e,_0x372869){var _0x7e5d06={};var _0x108e0f={};var _0x44e242;var _0x2ce7b6;return db['Automation']['findOne']({'where':{'id':_0x34e850[_0x5b75('0x42')]['id']}})[_0x5b75('0x1f')](handleEntityNotFound(_0x1b4d7e,null))['then'](function(_0x4d2dbd){if(_0x4d2dbd){_0x44e242=_0x4d2dbd;_0x108e0f[_0x5b75('0x27')]=_[_0x5b75('0x3d')](db[_0x5b75('0x44')][_0x5b75('0x25')]);_0x108e0f['query']=_[_0x5b75('0x3d')](_0x34e850[_0x5b75('0x29')]);_0x108e0f[_0x5b75('0x2a')]=_['intersection'](_0x108e0f[_0x5b75('0x27')],_0x108e0f[_0x5b75('0x29')]);_0x7e5d06[_0x5b75('0x2c')]=_[_0x5b75('0x2b')](_0x108e0f[_0x5b75('0x27')],qs[_0x5b75('0x2d')](_0x34e850[_0x5b75('0x29')][_0x5b75('0x2d')]));_0x7e5d06['attributes']=_0x7e5d06['attributes'][_0x5b75('0x2e')]?_0x7e5d06[_0x5b75('0x2c')]:_0x108e0f[_0x5b75('0x27')];_0x7e5d06[_0x5b75('0x48')]=qs[_0x5b75('0x31')](_0x34e850['query']['sort']);_0x7e5d06[_0x5b75('0x32')]=qs[_0x5b75('0x2a')](_[_0x5b75('0x33')](_0x34e850[_0x5b75('0x29')],_0x108e0f['filters']));if(_0x34e850['query'][_0x5b75('0x34')]){_0x7e5d06[_0x5b75('0x32')]=_[_0x5b75('0x36')](_0x7e5d06[_0x5b75('0x32')],{'$or':_[_0x5b75('0x28')](_0x7e5d06[_0x5b75('0x2c')],function(_0x5dfc0a){var _0x450c95={};_0x450c95[_0x5dfc0a]={'$like':'%'+_0x34e850[_0x5b75('0x29')]['filter']+'%'};return _0x450c95;})});}_0x7e5d06=_[_0x5b75('0x36')]({},_0x7e5d06,_0x34e850[_0x5b75('0x37')]);return _0x44e242[_0x5b75('0x47')](_0x7e5d06);}})[_0x5b75('0x1f')](function(_0x4fe037){if(_0x4fe037){_0x2ce7b6=_0x4fe037[_0x5b75('0x2e')];if(!_0x34e850[_0x5b75('0x29')][_0x5b75('0x2f')]('nolimit')){_0x7e5d06[_0x5b75('0x19')]=qs[_0x5b75('0x19')](_0x34e850[_0x5b75('0x29')][_0x5b75('0x19')]);_0x7e5d06[_0x5b75('0x17')]=qs[_0x5b75('0x17')](_0x34e850['query'][_0x5b75('0x17')]);}return _0x44e242[_0x5b75('0x47')](_0x7e5d06);}})[_0x5b75('0x1f')](function(_0x588411){if(_0x588411){return _0x588411?{'count':_0x2ce7b6,'rows':_0x588411}:null;}})[_0x5b75('0x1f')](respondWithResult(_0x1b4d7e,null))[_0x5b75('0x3b')](handleError(_0x1b4d7e,null));};exports['addActions']=function(_0x3cd313,_0x54655b,_0x3d9cdb){return db[_0x5b75('0x49')][_0x5b75('0x41')]({'where':{'id':_0x3cd313[_0x5b75('0x42')]['id']}})[_0x5b75('0x1f')](handleEntityNotFound(_0x54655b,null))[_0x5b75('0x1f')](function(_0x51665f){if(_0x51665f){return _0x51665f['addActions'](_0x3cd313[_0x5b75('0x40')][_0x5b75('0x45')],_['omit'](_0x3cd313['body'],[_0x5b75('0x45'),'id'])||{});}})[_0x5b75('0x1f')](respondWithResult(_0x54655b,null))[_0x5b75('0x3b')](handleError(_0x54655b,null));};exports[_0x5b75('0x4a')]=function(_0x2c1c10,_0x148e1c,_0x5c1ce5){var _0xd943b1={};var _0x4d9c12={};var _0x1c12fc;var _0x556109;return db[_0x5b75('0x38')]['findOne']({'where':{'id':_0x2c1c10['params']['id']}})['then'](handleEntityNotFound(_0x148e1c,null))[_0x5b75('0x1f')](function(_0x5327aa){if(_0x5327aa){_0x1c12fc=_0x5327aa;_0x4d9c12['model']=_[_0x5b75('0x3d')](db['Action'][_0x5b75('0x25')]);_0x4d9c12['query']=_[_0x5b75('0x3d')](_0x2c1c10[_0x5b75('0x29')]);_0x4d9c12[_0x5b75('0x2a')]=_[_0x5b75('0x2b')](_0x4d9c12['model'],_0x4d9c12[_0x5b75('0x29')]);_0xd943b1[_0x5b75('0x2c')]=_[_0x5b75('0x2b')](_0x4d9c12[_0x5b75('0x27')],qs[_0x5b75('0x2d')](_0x2c1c10[_0x5b75('0x29')][_0x5b75('0x2d')]));_0xd943b1[_0x5b75('0x2c')]=_0xd943b1[_0x5b75('0x2c')][_0x5b75('0x2e')]?_0xd943b1[_0x5b75('0x2c')]:_0x4d9c12['model'];_0xd943b1[_0x5b75('0x48')]=qs['sort'](_0x2c1c10[_0x5b75('0x29')]['sort']);_0xd943b1[_0x5b75('0x32')]=qs[_0x5b75('0x2a')](_[_0x5b75('0x33')](_0x2c1c10['query'],_0x4d9c12['filters']));if(_0x2c1c10['query'][_0x5b75('0x34')]){_0xd943b1[_0x5b75('0x32')]=_[_0x5b75('0x36')](_0xd943b1[_0x5b75('0x32')],{'$or':_[_0x5b75('0x28')](_0xd943b1[_0x5b75('0x2c')],function(_0x5b4155){var _0x464135={};_0x464135[_0x5b4155]={'$like':'%'+_0x2c1c10[_0x5b75('0x29')][_0x5b75('0x34')]+'%'};return _0x464135;})});}_0xd943b1=_[_0x5b75('0x36')]({},_0xd943b1,_0x2c1c10[_0x5b75('0x37')]);return _0x1c12fc[_0x5b75('0x4a')](_0xd943b1);}})[_0x5b75('0x1f')](function(_0x5473e3){if(_0x5473e3){_0x556109=_0x5473e3[_0x5b75('0x2e')];if(!_0x2c1c10[_0x5b75('0x29')]['hasOwnProperty'](_0x5b75('0x30'))){_0xd943b1[_0x5b75('0x19')]=qs['limit'](_0x2c1c10[_0x5b75('0x29')][_0x5b75('0x19')]);_0xd943b1[_0x5b75('0x17')]=qs[_0x5b75('0x17')](_0x2c1c10['query'][_0x5b75('0x17')]);}return _0x1c12fc[_0x5b75('0x4a')](_0xd943b1);}})[_0x5b75('0x1f')](function(_0xb319d8){if(_0xb319d8){return _0xb319d8?{'count':_0x556109,'rows':_0xb319d8}:null;}})[_0x5b75('0x1f')](respondWithResult(_0x148e1c,null))['catch'](handleError(_0x148e1c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index cbc46a9..55f19f6 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 _0xf758=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations','lodash','util'];(function(_0x5ebf85,_0x598413){var _0x5b175a=function(_0x3b213a){while(--_0x3b213a){_0x5ebf85['push'](_0x5ebf85['shift']());}};_0x5b175a(++_0x598413);}(_0xf758,0x16a));var _0x8f75=function(_0x1bef07,_0x2a4e64){_0x1bef07=_0x1bef07-0x0;var _0x29edf6=_0xf758[_0x1bef07];return _0x29edf6;};'use strict';var _=require(_0x8f75('0x0'));var util=require(_0x8f75('0x1'));var logger=require(_0x8f75('0x2'))(_0x8f75('0x3'));var moment=require(_0x8f75('0x4'));var BPromise=require(_0x8f75('0x5'));var rp=require(_0x8f75('0x6'));var fs=require('fs');var path=require(_0x8f75('0x7'));var rimraf=require('rimraf');var config=require(_0x8f75('0x8'));var attributes=require('./automation.attributes');module[_0x8f75('0x9')]=function(_0x37f4a3,_0x54bc88){return _0x37f4a3[_0x8f75('0xa')](_0x8f75('0xb'),attributes,{'tableName':_0x8f75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e70=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes'];(function(_0x55985,_0x4c6195){var _0x58979c=function(_0x1b6766){while(--_0x1b6766){_0x55985['push'](_0x55985['shift']());}};_0x58979c(++_0x4c6195);}(_0x1e70,0x163));var _0x01e7=function(_0x4f57fb,_0x2009d3){_0x4f57fb=_0x4f57fb-0x0;var _0x467fcd=_0x1e70[_0x4f57fb];return _0x467fcd;};'use strict';var _=require(_0x01e7('0x0'));var util=require(_0x01e7('0x1'));var logger=require(_0x01e7('0x2'))(_0x01e7('0x3'));var moment=require(_0x01e7('0x4'));var BPromise=require(_0x01e7('0x5'));var rp=require(_0x01e7('0x6'));var fs=require('fs');var path=require(_0x01e7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x01e7('0x8'));module[_0x01e7('0x9')]=function(_0x1b7b7c,_0x113c2d){return _0x1b7b7c[_0x01e7('0xa')](_0x01e7('0xb'),attributes,{'tableName':_0x01e7('0xc'),'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 69cf6c4..04d8b73 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 _0x8b35=['code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x5968df,_0xd6d0b9){var _0x522007=function(_0x435e5e){while(--_0x435e5e){_0x5968df['push'](_0x5968df['shift']());}};_0x522007(++_0xd6d0b9);}(_0x8b35,0x17a));var _0x58b3=function(_0x1b2282,_0x466aa0){_0x1b2282=_0x1b2282-0x0;var _0x161391=_0x8b35[_0x1b2282];return _0x161391;};'use strict';var _=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var moment=require(_0x58b3('0x2'));var BPromise=require(_0x58b3('0x3'));var rs=require(_0x58b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58b3('0x5'))['db'];var utils=require(_0x58b3('0x6'));var logger=require(_0x58b3('0x7'))(_0x58b3('0x8'));var config=require(_0x58b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58b3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d044,_0x5ec362,_0x503b78){return new BPromise(function(_0x126232,_0x46fda3){return client[_0x58b3('0xb')](_0x35d044,_0x503b78)[_0x58b3('0xc')](function(_0x446e8d){logger[_0x58b3('0xd')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'));logger[_0x58b3('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'),JSON[_0x58b3('0x10')](_0x446e8d));if(_0x446e8d[_0x58b3('0x11')]){if(_0x446e8d['error'][_0x58b3('0x12')]===0x1f4){logger['error'](_0x58b3('0x13'),_0x5ec362,_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);return _0x46fda3(_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);}logger[_0x58b3('0x11')](_0x58b3('0x13'),_0x5ec362,_0x446e8d['error'][_0x58b3('0x14')]);return _0x126232(_0x446e8d[_0x58b3('0x11')]['message']);}else{logger[_0x58b3('0xd')](_0x58b3('0x13'),_0x5ec362,'request\x20sent');_0x126232(_0x446e8d['result'][_0x58b3('0x14')]);}})[_0x58b3('0x15')](function(_0x38f6a7){logger[_0x58b3('0x11')]('Automation,\x20%s,\x20%s',_0x5ec362,_0x38f6a7);_0x46fda3(_0x38f6a7);});});} \ No newline at end of file +var _0x0598=['../../config/utils','jayson/promise','client','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x559fa5,_0x52cd62){var _0x496cb9=function(_0xda9589){while(--_0xda9589){_0x559fa5['push'](_0x559fa5['shift']());}};_0x496cb9(++_0x52cd62);}(_0x0598,0x92));var _0x8059=function(_0x3b45a8,_0x5e17a4){_0x3b45a8=_0x3b45a8-0x0;var _0x37cca9=_0x0598[_0x3b45a8];return _0x37cca9;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('Automation,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 38fb333..45c45a0 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 _0xff3c=['./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20960d,_0x240fcb){var _0x180201=function(_0xe7927d){while(--_0xe7927d){_0x20960d['push'](_0x20960d['shift']());}};_0x180201(++_0x240fcb);}(_0xff3c,0x179));var _0xcff3=function(_0x22dbbf,_0xec067a){_0x22dbbf=_0x22dbbf-0x0;var _0x5174fb=_0xff3c[_0x22dbbf];return _0x5174fb;};'use strict';var multer=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var path=require('path');var timeout=require(_0xcff3('0x2'));var express=require(_0xcff3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcff3('0x4'));var interaction=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var controller=require(_0xcff3('0x7'));router[_0xcff3('0x8')]('/',auth[_0xcff3('0x9')](),controller['index']);router['get'](_0xcff3('0xa'),auth['isAuthenticated'](),controller[_0xcff3('0xb')]);router['get'](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xd')]);router[_0xcff3('0x8')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcff3('0x10')]);router[_0xcff3('0x11')](_0xcff3('0xc'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x12')]);router[_0xcff3('0x11')](_0xcff3('0xe'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x13')]);router[_0xcff3('0x14')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller[_0xcff3('0x15')]);router[_0xcff3('0x16')](_0xcff3('0xa'),auth[_0xcff3('0x9')](),controller['destroy']);module[_0xcff3('0x17')]=router; \ No newline at end of file +var _0x425d=['addConditions','addActions','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x425d,0x1e0));var _0xd425=function(_0x4a2689,_0x314a16){_0x4a2689=_0x4a2689-0x0;var _0x463450=_0x425d[_0x4a2689];return _0x463450;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x9')](_0xd425('0x10'),auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x14')]);router[_0xd425('0x12')](_0xd425('0x10'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);router['put'](_0xd425('0xc'),auth[_0xd425('0xa')](),controller[_0xd425('0x16')]);router['delete'](_0xd425('0xc'),auth[_0xd425('0xa')](),controller[_0xd425('0x17')]);module[_0xd425('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3537aec..6c8f439 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 _0x0e31=['DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC'];(function(_0x5b2ca3,_0x364ad7){var _0x3f20e1=function(_0x524850){while(--_0x524850){_0x5b2ca3['push'](_0x5b2ca3['shift']());}};_0x3f20e1(++_0x364ad7);}(_0x0e31,0xab));var _0x10e3=function(_0xc02915,_0x48be3e){_0xc02915=_0xc02915-0x0;var _0x366bb0=_0x0e31[_0xc02915];return _0x366bb0;};'use strict';var Sequelize=require(_0x10e3('0x0'));module[_0x10e3('0x1')]={'name':{'type':Sequelize[_0x10e3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x10e3('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x10e3('0x4')},'description':{'type':Sequelize[_0x10e3('0x2')]},'active':{'type':Sequelize[_0x10e3('0x5')],'defaultValue':0x0,'comment':_0x10e3('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x10e3('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x10e3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x10e3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x10e3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x10e3('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x10e3('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x10e3('0x11'),_0x10e3('0x12'),_0x10e3('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x10e3('0x5')],'defaultValue':0x0,'comment':_0x10e3('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x10e3('0x8')](0x9)[_0x10e3('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x10e3('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x10e3('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x10e3('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x10e3('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x10e3('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x10e3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x10e3('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x10e3('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x10e3('0x8')](0x9)[_0x10e3('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x10e3('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x10e3('0x3')]('DESC',_0x10e3('0x1c')),'defaultValue':_0x10e3('0x1d')},'dialPrefix':{'type':Sequelize[_0x10e3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x10e3('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x10e3('0x8')](0x3)[_0x10e3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x10e3('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x10e3('0x8')](0x5)[_0x10e3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x10e3('0x27')}}; \ No newline at end of file +var _0xa282=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2cb92b,_0x40a4f8){var _0x28c3e4=function(_0x134448){while(--_0x134448){_0x2cb92b['push'](_0x2cb92b['shift']());}};_0x28c3e4(++_0x40a4f8);}(_0xa282,0x189));var _0x2a28=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa282[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x2a28('0x0'));module[_0x2a28('0x1')]={'name':{'type':Sequelize[_0x2a28('0x2')],'unique':_0x2a28('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a28('0x4')](_0x2a28('0x5')),'allowNull':![],'defaultValue':_0x2a28('0x5')},'description':{'type':Sequelize[_0x2a28('0x2')]},'active':{'type':Sequelize[_0x2a28('0x6')],'defaultValue':0x0,'comment':_0x2a28('0x7')},'limitCalls':{'type':Sequelize[_0x2a28('0x8')](0x4)[_0x2a28('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2a28('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a28('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2a28('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a28('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'comment':_0x2a28('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2a28('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2a28('0x2')],'defaultValue':_0x2a28('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x2a28('0x4')](_0x2a28('0x12'),'never',_0x2a28('0x13')),'defaultValue':_0x2a28('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2a28('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a28('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2a28('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a28('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a28('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a28('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2a28('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2a28('0x8')](0x9)[_0x2a28('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a28('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a28('0x4')](_0x2a28('0x1c'),_0x2a28('0x1d')),'defaultValue':_0x2a28('0x1c')},'dialPrefix':{'type':Sequelize[_0x2a28('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a28('0x1e')},'dialCutDigit':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a28('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2a28('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a28('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a28('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a28('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x2a28('0x8')](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2a28('0x8')](0x5)[_0x2a28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a28('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 7b485bc..0232e7d 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 _0x60d6=['sort','where','pick','filters','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','role','IvrCampaigns','getHoppers','findOne','CmHopper','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','phone','NOW()','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','ContactId','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xcda2bd,_0x3468e4){var _0x22231c=function(_0x2de648){while(--_0x2de648){_0xcda2bd['push'](_0xcda2bd['shift']());}};_0x22231c(++_0x3468e4);}(_0x60d6,0x15a));var _0x660d=function(_0x47f29d,_0x44cc72){_0x47f29d=_0x47f29d-0x0;var _0x240ae5=_0x60d6[_0x47f29d];return _0x240ae5;};'use strict';var emlformat=require(_0x660d('0x0'));var rimraf=require(_0x660d('0x1'));var zipdir=require(_0x660d('0x2'));var jsonpatch=require(_0x660d('0x3'));var rp=require(_0x660d('0x4'));var moment=require(_0x660d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x660d('0x6'));var path=require(_0x660d('0x7'));var sox=require(_0x660d('0x8'));var csv=require(_0x660d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x660d('0xa'));var _=require(_0x660d('0xb'));var squel=require(_0x660d('0xc'));var crypto=require(_0x660d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x660d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x660d('0xf'));var Papa=require('papaparse');var Redis=require(_0x660d('0x10'));var authService=require(_0x660d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x660d('0x12'));var hardwareService=require(_0x660d('0x13'));var logger=require(_0x660d('0x14'))(_0x660d('0x15'));var utils=require('../../config/utils');var config=require(_0x660d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x660d('0x17'))['db'];function respondWithStatusCode(_0x15b29e,_0x5f0021){_0x5f0021=_0x5f0021||0xcc;return function(_0x1ed416){if(_0x1ed416){return _0x15b29e[_0x660d('0x18')](_0x5f0021);}return _0x15b29e[_0x660d('0x19')](_0x5f0021)['end']();};}function respondWithResult(_0x4f6fa2,_0x56d1bb){_0x56d1bb=_0x56d1bb||0xc8;return function(_0x55253a){if(_0x55253a){return _0x4f6fa2[_0x660d('0x19')](_0x56d1bb)[_0x660d('0x1a')](_0x55253a);}};}function respondWithFilteredResult(_0x4291d1,_0x30e64b){return function(_0x15ad66){if(_0x15ad66){var _0x43e510=typeof _0x30e64b['offset']===_0x660d('0x1b')&&typeof _0x30e64b[_0x660d('0x1c')]===_0x660d('0x1b');var _0xe4a490=_0x15ad66[_0x660d('0x1d')];var _0x3c61d2=_0x43e510?0x0:_0x30e64b[_0x660d('0x1e')];var _0x3c17ec=_0x43e510?_0x15ad66['count']:_0x30e64b[_0x660d('0x1e')]+_0x30e64b[_0x660d('0x1c')];var _0x4963a7;if(_0x3c17ec>=_0xe4a490){_0x3c17ec=_0xe4a490;_0x4963a7=0xc8;}else{_0x4963a7=0xce;}_0x4291d1[_0x660d('0x19')](_0x4963a7);return _0x4291d1[_0x660d('0x1f')](_0x660d('0x20'),_0x3c61d2+'-'+_0x3c17ec+'/'+_0xe4a490)[_0x660d('0x1a')](_0x15ad66);}return null;};}function patchUpdates(_0x728c9c){return function(_0x50b11d){try{jsonpatch[_0x660d('0x21')](_0x50b11d,_0x728c9c,!![]);}catch(_0x49be76){return BPromise[_0x660d('0x22')](_0x49be76);}return _0x50b11d['save']();};}function saveUpdates(_0x208001,_0x25b2bb){return function(_0x332bbf){if(_0x332bbf){return _0x332bbf[_0x660d('0x23')](_0x208001)[_0x660d('0x24')](function(_0x2884b1){return _0x2884b1;});}return null;};}function removeEntity(_0x1a1d1d,_0x4ff61b){return function(_0xce8929){if(_0xce8929){return _0xce8929[_0x660d('0x25')]()['then'](function(){var _0xfbb51c=_0xce8929[_0x660d('0x26')]({'plain':!![]});var _0x1af633='IvrCampaigns';return db[_0x660d('0x27')][_0x660d('0x25')]({'where':{'type':_0x1af633,'resourceId':_0xfbb51c['id']}})[_0x660d('0x24')](function(){return _0xce8929;});})[_0x660d('0x24')](function(){_0x1a1d1d[_0x660d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b2ef,_0x12df73){return function(_0x2a7a15){if(!_0x2a7a15){_0x48b2ef[_0x660d('0x18')](0x194);}return _0x2a7a15;};}function handleError(_0x4c7540,_0x379b2a){_0x379b2a=_0x379b2a||0x1f4;return function(_0x1964a8){logger[_0x660d('0x28')](_0x1964a8[_0x660d('0x29')]);if(_0x1964a8['name']){delete _0x1964a8[_0x660d('0x2a')];}_0x4c7540[_0x660d('0x19')](_0x379b2a)[_0x660d('0x2b')](_0x1964a8);};}exports['index']=function(_0x1fe8ff,_0x4f1377){var _0x5b0df3={},_0x300044={},_0x427b9d={'count':0x0,'rows':[]};var _0x5075d4=_[_0x660d('0x2c')](db['Campaign'][_0x660d('0x2d')],function(_0x36cdbc){return{'name':_0x36cdbc[_0x660d('0x2e')],'type':_0x36cdbc[_0x660d('0x2f')][_0x660d('0x30')]};});_0x300044['model']=_[_0x660d('0x2c')](_0x5075d4,'name');_0x300044[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1fe8ff['query']);_0x300044['filters']=_[_0x660d('0x33')](_0x300044[_0x660d('0x34')],_0x300044[_0x660d('0x31')]);_0x5b0df3[_0x660d('0x35')]=_[_0x660d('0x33')](_0x300044[_0x660d('0x34')],qs['fields'](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x36')]));_0x5b0df3['attributes']=_0x5b0df3['attributes'][_0x660d('0x37')]?_0x5b0df3['attributes']:_0x300044[_0x660d('0x34')];if(!_0x1fe8ff[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x5b0df3[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x1c')]);_0x5b0df3[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x1e')]);}_0x5b0df3[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3b')]);_0x5b0df3[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x1fe8ff[_0x660d('0x31')],_0x300044[_0x660d('0x3e')]),_0x5075d4);if(_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3f')]){_0x5b0df3[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x5b0df3['where'],{'$or':_[_0x660d('0x2c')](_0x5075d4,function(_0x42e807){if(_0x42e807[_0x660d('0x2f')]!==_0x660d('0x41')){var _0x4c8e45={};_0x4c8e45[_0x42e807['name']]={'$like':'%'+_0x1fe8ff[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x4c8e45;}})});}_0x5b0df3=_[_0x660d('0x40')]({},_0x5b0df3,_0x1fe8ff[_0x660d('0x42')]);var _0x4c59a8={'where':_0x5b0df3[_0x660d('0x3c')]};return db[_0x660d('0x43')][_0x660d('0x1d')](_0x4c59a8)[_0x660d('0x24')](function(_0x4d4362){_0x427b9d[_0x660d('0x1d')]=_0x4d4362;if(_0x1fe8ff[_0x660d('0x31')][_0x660d('0x44')]){_0x5b0df3[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x43')][_0x660d('0x46')](_0x5b0df3);})[_0x660d('0x24')](function(_0x13053c){_0x427b9d['rows']=_0x13053c;return _0x427b9d;})[_0x660d('0x24')](respondWithFilteredResult(_0x4f1377,_0x5b0df3))[_0x660d('0x47')](handleError(_0x4f1377,null));};exports[_0x660d('0x48')]=function(_0x5e4707,_0x16dfad){var _0x21736a={'raw':![],'where':{'id':_0x5e4707['params']['id']}},_0xd230ff={};_0xd230ff[_0x660d('0x34')]=_['keys'](db[_0x660d('0x43')][_0x660d('0x2d')]);_0xd230ff['query']=_[_0x660d('0x32')](_0x5e4707[_0x660d('0x31')]);_0xd230ff[_0x660d('0x3e')]=_[_0x660d('0x33')](_0xd230ff[_0x660d('0x34')],_0xd230ff[_0x660d('0x31')]);_0x21736a[_0x660d('0x35')]=_[_0x660d('0x33')](_0xd230ff[_0x660d('0x34')],qs['fields'](_0x5e4707[_0x660d('0x31')][_0x660d('0x36')]));_0x21736a[_0x660d('0x35')]=_0x21736a[_0x660d('0x35')][_0x660d('0x37')]?_0x21736a[_0x660d('0x35')]:_0xd230ff[_0x660d('0x34')];if(_0x5e4707['query'][_0x660d('0x44')]){_0x21736a[_0x660d('0x45')]=[{'all':!![]}];}_0x21736a=_[_0x660d('0x40')]({},_0x21736a,_0x5e4707[_0x660d('0x42')]);return db[_0x660d('0x43')][_0x660d('0x49')](_0x21736a)[_0x660d('0x24')](handleEntityNotFound(_0x16dfad,null))['then'](respondWithResult(_0x16dfad,null))['catch'](handleError(_0x16dfad,null));};exports[_0x660d('0x4a')]=function(_0x4b53a6,_0x2a5d77){return db[_0x660d('0x43')][_0x660d('0x4a')](_0x4b53a6[_0x660d('0x4b')],{})[_0x660d('0x24')](function(_0x6bda16){var _0x2b3019=_0x4b53a6[_0x660d('0x4c')]['get']({'plain':!![]});if(!_0x2b3019)throw new Error(_0x660d('0x4d'));if(_0x2b3019['role']===_0x660d('0x4c')){var _0xd636b2=_0x6bda16[_0x660d('0x26')]({'plain':!![]});var _0x5f03c2='IvrCampaigns';return db[_0x660d('0x4e')][_0x660d('0x49')]({'where':{'name':_0x5f03c2,'userProfileId':_0x2b3019[_0x660d('0x4f')]},'raw':!![]})[_0x660d('0x24')](function(_0x3cd6be){if(_0x3cd6be&&_0x3cd6be[_0x660d('0x50')]===0x0){return db[_0x660d('0x27')]['create']({'name':_0xd636b2[_0x660d('0x2a')],'resourceId':_0xd636b2['id'],'type':_0x3cd6be[_0x660d('0x2a')],'sectionId':_0x3cd6be['id']},{})[_0x660d('0x24')](function(){return _0x6bda16;});}else{return _0x6bda16;}})[_0x660d('0x47')](function(_0x398c66){logger[_0x660d('0x28')](_0x660d('0x51'),_0x398c66);throw _0x398c66;});}return _0x6bda16;})[_0x660d('0x24')](respondWithResult(_0x2a5d77,0xc9))[_0x660d('0x47')](handleError(_0x2a5d77,null));};exports[_0x660d('0x52')]=function(_0x2642f3,_0x1aa685){var _0x4dc3d4={'where':{'id':_0x2642f3[_0x660d('0x53')]['id']}},_0x244823={};_0x244823[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x43')][_0x660d('0x2d')]);_0x4dc3d4['attributes']=_[_0x660d('0x33')](_0x244823[_0x660d('0x34')],qs[_0x660d('0x36')](_0x2642f3['query'][_0x660d('0x36')]));_0x4dc3d4[_0x660d('0x35')]=_0x4dc3d4[_0x660d('0x35')][_0x660d('0x37')]?_0x4dc3d4[_0x660d('0x35')]:_0x244823['model'];if(_0x2642f3[_0x660d('0x31')]['includeAll']){_0x4dc3d4[_0x660d('0x45')]=[{'all':!![]}];}_0x4dc3d4=_['merge']({},_0x4dc3d4,_0x2642f3[_0x660d('0x42')]);return db[_0x660d('0x43')][_0x660d('0x49')](_0x4dc3d4)['then'](handleEntityNotFound(_0x1aa685,null))[_0x660d('0x24')](function(_0x40c2f7){if(_0x40c2f7){var _0x40e0da=_0x40c2f7['get']({'plain':!![]});_0x40e0da=qs['omit'](_0x40e0da,['id',_0x660d('0x54'),_0x660d('0x55')]);_0x2642f3[_0x660d('0x4b')]=_['omit'](_0x2642f3[_0x660d('0x4b')],['id','createdAt','updatedAt']);return db[_0x660d('0x43')][_0x660d('0x4a')](_[_0x660d('0x40')](_0x40e0da,_0x2642f3['body']),{'include':_0x2642f3[_0x660d('0x31')][_0x660d('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x3d36d4){var _0x514b73=_0x2642f3[_0x660d('0x4c')][_0x660d('0x26')]({'plain':!![]});if(!_0x514b73)throw new Error(_0x660d('0x4d'));if(_0x514b73[_0x660d('0x56')]===_0x660d('0x4c')){var _0x24fbe3=_0x3d36d4[_0x660d('0x26')]({'plain':!![]});var _0x50610c=_0x660d('0x57');return db[_0x660d('0x4e')][_0x660d('0x49')]({'where':{'name':_0x50610c,'userProfileId':_0x514b73[_0x660d('0x4f')]},'raw':!![]})[_0x660d('0x24')](function(_0x666f1e){if(_0x666f1e&&_0x666f1e[_0x660d('0x50')]===0x0){return db[_0x660d('0x27')][_0x660d('0x4a')]({'name':_0x24fbe3[_0x660d('0x2a')],'resourceId':_0x24fbe3['id'],'type':_0x666f1e[_0x660d('0x2a')],'sectionId':_0x666f1e['id']},{})[_0x660d('0x24')](function(){return _0x3d36d4;});}else{return _0x3d36d4;}})[_0x660d('0x47')](function(_0x11e5a2){logger[_0x660d('0x28')](_0x660d('0x51'),_0x11e5a2);throw _0x11e5a2;});}return _0x3d36d4;});}})[_0x660d('0x24')](respondWithResult(_0x1aa685,0xc9))[_0x660d('0x47')](handleError(_0x1aa685,null));};exports[_0x660d('0x23')]=function(_0x18542c,_0x5be3fd){if(_0x18542c[_0x660d('0x4b')]['id']){delete _0x18542c['body']['id'];}return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x18542c[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x5be3fd,null))[_0x660d('0x24')](saveUpdates(_0x18542c[_0x660d('0x4b')],null))[_0x660d('0x24')](respondWithResult(_0x5be3fd,null))[_0x660d('0x47')](handleError(_0x5be3fd,null));};exports[_0x660d('0x25')]=function(_0x3b0b4c,_0x48050d){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x3b0b4c['params']['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x48050d,null))['then'](removeEntity(_0x48050d,null))[_0x660d('0x47')](handleError(_0x48050d,null));};exports[_0x660d('0x58')]=function(_0x5c5d1c,_0x1a76ab,_0xc22635){var _0x2e0f3b={'raw':!![],'where':{}};var _0x5f01cc={};var _0x5e06f0={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x5c5d1c[_0x660d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a76ab,null))[_0x660d('0x24')](function(_0x3743c2){if(_0x3743c2){_0x5f01cc['model']=_[_0x660d('0x32')](db[_0x660d('0x5a')][_0x660d('0x2d')]);_0x5f01cc['query']=_[_0x660d('0x32')](_0x5c5d1c[_0x660d('0x31')]);_0x5f01cc[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x5f01cc[_0x660d('0x34')],_0x5f01cc['query']);_0x2e0f3b[_0x660d('0x35')]=_[_0x660d('0x33')](_0x5f01cc[_0x660d('0x34')],qs[_0x660d('0x36')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x36')]));_0x2e0f3b[_0x660d('0x35')]=_0x2e0f3b[_0x660d('0x35')][_0x660d('0x37')]?_0x2e0f3b[_0x660d('0x35')]:_0x5f01cc[_0x660d('0x34')];if(!_0x5c5d1c[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x2e0f3b[_0x660d('0x1c')]=qs['limit'](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x1c')]);_0x2e0f3b[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x1e')]);}_0x2e0f3b[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x5c5d1c[_0x660d('0x31')][_0x660d('0x3b')]);_0x2e0f3b[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x5c5d1c[_0x660d('0x31')],_0x5f01cc[_0x660d('0x3e')]));_0x2e0f3b['where'][_0x660d('0x5b')]=_0x3743c2['id'];if(_0x5c5d1c['query'][_0x660d('0x3f')]){_0x2e0f3b[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x2e0f3b[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x2e0f3b['attributes'],function(_0x3fea98){var _0x1d345a={};_0x1d345a[_0x3fea98]={'$like':'%'+_0x5c5d1c[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x1d345a;})});}_0x2e0f3b=_[_0x660d('0x40')]({},_0x2e0f3b,_0x5c5d1c['options']);return db[_0x660d('0x5a')][_0x660d('0x1d')]({'where':_0x2e0f3b[_0x660d('0x3c')]})[_0x660d('0x24')](function(_0x1e0186){_0x5e06f0['count']=_0x1e0186;if(_0x5c5d1c[_0x660d('0x31')][_0x660d('0x44')]){_0x2e0f3b[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x5a')][_0x660d('0x46')](_0x2e0f3b);})[_0x660d('0x24')](function(_0x3ccc72){_0x5e06f0[_0x660d('0x5c')]=_0x3ccc72;return _0x5e06f0;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x1a76ab,_0x2e0f3b))[_0x660d('0x47')](handleError(_0x1a76ab,null));};exports['getHopperHistories']=function(_0x1a72a5,_0x24e5e0,_0x2c0f4a){var _0x35a253={'raw':!![],'where':{}};var _0x213f1b={};var _0x2f1035={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x1a72a5[_0x660d('0x53')]['id']}})['then'](handleEntityNotFound(_0x24e5e0,null))[_0x660d('0x24')](function(_0x5f57db){if(_0x5f57db){_0x213f1b[_0x660d('0x34')]=_['keys'](db[_0x660d('0x5d')]['rawAttributes']);_0x213f1b[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1a72a5[_0x660d('0x31')]);_0x213f1b[_0x660d('0x3e')]=_['intersection'](_0x213f1b[_0x660d('0x34')],_0x213f1b[_0x660d('0x31')]);_0x35a253[_0x660d('0x35')]=_[_0x660d('0x33')](_0x213f1b['model'],qs[_0x660d('0x36')](_0x1a72a5[_0x660d('0x31')][_0x660d('0x36')]));_0x35a253[_0x660d('0x35')]=_0x35a253[_0x660d('0x35')][_0x660d('0x37')]?_0x35a253['attributes']:_0x213f1b[_0x660d('0x34')];if(!_0x1a72a5[_0x660d('0x31')][_0x660d('0x38')](_0x660d('0x39'))){_0x35a253['limit']=qs['limit'](_0x1a72a5[_0x660d('0x31')]['limit']);_0x35a253['offset']=qs[_0x660d('0x1e')](_0x1a72a5['query'][_0x660d('0x1e')]);}_0x35a253[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x1a72a5[_0x660d('0x31')]['sort']);_0x35a253[_0x660d('0x3c')]=qs[_0x660d('0x3e')](_[_0x660d('0x3d')](_0x1a72a5['query'],_0x213f1b[_0x660d('0x3e')]));_0x35a253[_0x660d('0x3c')][_0x660d('0x5b')]=_0x5f57db['id'];if(_0x1a72a5[_0x660d('0x31')][_0x660d('0x3f')]){_0x35a253[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x35a253[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x35a253['attributes'],function(_0xeb84d5){var _0x509910={};_0x509910[_0xeb84d5]={'$like':'%'+_0x1a72a5[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x509910;})});}_0x35a253=_[_0x660d('0x40')]({},_0x35a253,_0x1a72a5[_0x660d('0x42')]);return db[_0x660d('0x5d')][_0x660d('0x1d')]({'where':_0x35a253['where']})[_0x660d('0x24')](function(_0x3e0833){_0x2f1035['count']=_0x3e0833;if(_0x1a72a5['query']['includeAll']){_0x35a253['include']=[{'all':!![]}];}return db[_0x660d('0x5d')]['findAll'](_0x35a253);})[_0x660d('0x24')](function(_0x267b83){_0x2f1035[_0x660d('0x5c')]=_0x267b83;return _0x2f1035;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x24e5e0,_0x35a253))['catch'](handleError(_0x24e5e0,null));};exports[_0x660d('0x5e')]=function(_0x566a0d,_0x52aa18,_0x1dd1d9){var _0x4b9cee={'raw':!![],'where':{}};var _0x287a41={};var _0x180fe1={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x566a0d['params']['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x52aa18,null))['then'](function(_0x1ba95d){if(_0x1ba95d){_0x287a41[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x5f')][_0x660d('0x2d')]);_0x287a41[_0x660d('0x31')]=_[_0x660d('0x32')](_0x566a0d['query']);_0x287a41[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x287a41[_0x660d('0x34')],_0x287a41[_0x660d('0x31')]);_0x4b9cee[_0x660d('0x35')]=_[_0x660d('0x33')](_0x287a41[_0x660d('0x34')],qs[_0x660d('0x36')](_0x566a0d[_0x660d('0x31')][_0x660d('0x36')]));_0x4b9cee[_0x660d('0x35')]=_0x4b9cee[_0x660d('0x35')]['length']?_0x4b9cee[_0x660d('0x35')]:_0x287a41[_0x660d('0x34')];if(!_0x566a0d['query'][_0x660d('0x38')]('nolimit')){_0x4b9cee[_0x660d('0x1c')]=qs['limit'](_0x566a0d[_0x660d('0x31')][_0x660d('0x1c')]);_0x4b9cee[_0x660d('0x1e')]=qs['offset'](_0x566a0d[_0x660d('0x31')]['offset']);}_0x4b9cee[_0x660d('0x3a')]=qs[_0x660d('0x3b')](_0x566a0d[_0x660d('0x31')]['sort']);_0x4b9cee['where']=qs['filters'](_['pick'](_0x566a0d[_0x660d('0x31')],_0x287a41[_0x660d('0x3e')]));_0x4b9cee['where']['CampaignId']=_0x1ba95d['id'];if(_0x566a0d[_0x660d('0x31')]['filter']){_0x4b9cee[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x4b9cee[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x4b9cee[_0x660d('0x35')],function(_0x1284be){var _0x372e35={};_0x372e35[_0x1284be]={'$like':'%'+_0x566a0d['query'][_0x660d('0x3f')]+'%'};return _0x372e35;})});}_0x4b9cee=_['merge']({},_0x4b9cee,_0x566a0d[_0x660d('0x42')]);return db[_0x660d('0x5f')][_0x660d('0x1d')]({'where':_0x4b9cee[_0x660d('0x3c')]})[_0x660d('0x24')](function(_0x130dd9){_0x180fe1['count']=_0x130dd9;if(_0x566a0d['query']['includeAll']){_0x4b9cee[_0x660d('0x45')]=[{'all':!![]}];}return db[_0x660d('0x5f')][_0x660d('0x46')](_0x4b9cee);})[_0x660d('0x24')](function(_0x43bebe){_0x180fe1[_0x660d('0x5c')]=_0x43bebe;return _0x180fe1;});}})['then'](respondWithFilteredResult(_0x52aa18,_0x4b9cee))['catch'](handleError(_0x52aa18,null));};exports[_0x660d('0x60')]=function(_0x1f151b,_0x3636c7,_0x3b8f4c){var _0x32e244={'raw':!![],'where':{}};var _0x2991a4={};var _0x2eccc4={'count':0x0,'rows':[]};return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x1f151b[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x3636c7,null))[_0x660d('0x24')](function(_0x546a72){if(_0x546a72){_0x2991a4['model']=_[_0x660d('0x32')](db[_0x660d('0x61')][_0x660d('0x2d')]);_0x2991a4[_0x660d('0x31')]=_[_0x660d('0x32')](_0x1f151b['query']);_0x2991a4[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x2991a4[_0x660d('0x34')],_0x2991a4['query']);_0x32e244['attributes']=_['intersection'](_0x2991a4[_0x660d('0x34')],qs[_0x660d('0x36')](_0x1f151b[_0x660d('0x31')]['fields']));_0x32e244[_0x660d('0x35')]=_0x32e244[_0x660d('0x35')][_0x660d('0x37')]?_0x32e244[_0x660d('0x35')]:_0x2991a4[_0x660d('0x34')];if(!_0x1f151b[_0x660d('0x31')][_0x660d('0x38')]('nolimit')){_0x32e244[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x1f151b[_0x660d('0x31')][_0x660d('0x1c')]);_0x32e244[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x1f151b[_0x660d('0x31')][_0x660d('0x1e')]);}_0x32e244['order']=qs['sort'](_0x1f151b['query'][_0x660d('0x3b')]);_0x32e244['where']=qs[_0x660d('0x3e')](_['pick'](_0x1f151b[_0x660d('0x31')],_0x2991a4[_0x660d('0x3e')]));_0x32e244[_0x660d('0x3c')][_0x660d('0x5b')]=_0x546a72['id'];if(_0x1f151b[_0x660d('0x31')][_0x660d('0x3f')]){_0x32e244['where']=_[_0x660d('0x40')](_0x32e244[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x32e244[_0x660d('0x35')],function(_0x26ee5f){var _0x202216={};_0x202216[_0x26ee5f]={'$like':'%'+_0x1f151b[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x202216;})});}_0x32e244=_[_0x660d('0x40')]({},_0x32e244,_0x1f151b[_0x660d('0x42')]);return db[_0x660d('0x61')][_0x660d('0x1d')]({'where':_0x32e244['where']})[_0x660d('0x24')](function(_0x2571a7){_0x2eccc4[_0x660d('0x1d')]=_0x2571a7;if(_0x1f151b[_0x660d('0x31')][_0x660d('0x44')]){_0x32e244[_0x660d('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x660d('0x46')](_0x32e244);})[_0x660d('0x24')](function(_0x1e0ca4){_0x2eccc4[_0x660d('0x5c')]=_0x1e0ca4;return _0x2eccc4;});}})[_0x660d('0x24')](respondWithFilteredResult(_0x3636c7,_0x32e244))[_0x660d('0x47')](handleError(_0x3636c7,null));};exports[_0x660d('0x62')]=function(_0x25743a,_0x3b7e16,_0x4b65a5){var _0x4a99de={};var _0x15307f={};var _0x3c6912;var _0x400d48;return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x25743a[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x3b7e16,null))[_0x660d('0x24')](function(_0x59fdfa){if(_0x59fdfa){_0x3c6912=_0x59fdfa;_0x15307f[_0x660d('0x34')]=_[_0x660d('0x32')](db[_0x660d('0x63')]['rawAttributes']);_0x15307f['query']=_[_0x660d('0x32')](_0x25743a[_0x660d('0x31')]);_0x15307f[_0x660d('0x3e')]=_[_0x660d('0x33')](_0x15307f['model'],_0x15307f[_0x660d('0x31')]);_0x4a99de[_0x660d('0x35')]=_[_0x660d('0x33')](_0x15307f[_0x660d('0x34')],qs['fields'](_0x25743a[_0x660d('0x31')][_0x660d('0x36')]));_0x4a99de[_0x660d('0x35')]=_0x4a99de['attributes'][_0x660d('0x37')]?_0x4a99de[_0x660d('0x35')]:_0x15307f['model'];_0x4a99de['order']=qs[_0x660d('0x3b')](_0x25743a[_0x660d('0x31')]['sort']);_0x4a99de[_0x660d('0x3c')]=qs[_0x660d('0x3e')](_['pick'](_0x25743a[_0x660d('0x31')],_0x15307f[_0x660d('0x3e')]));if(_0x25743a[_0x660d('0x31')][_0x660d('0x3f')]){_0x4a99de[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x4a99de[_0x660d('0x3c')],{'$or':_['map'](_0x4a99de[_0x660d('0x35')],function(_0x3a3247){var _0x427780={};_0x427780[_0x3a3247]={'$like':'%'+_0x25743a[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x427780;})});}_0x4a99de=_[_0x660d('0x40')]({},_0x4a99de,_0x25743a[_0x660d('0x42')]);return _0x3c6912[_0x660d('0x62')](_0x4a99de);}})[_0x660d('0x24')](function(_0x753063){if(_0x753063){_0x400d48=_0x753063['length'];if(!_0x25743a[_0x660d('0x31')][_0x660d('0x38')]('nolimit')){_0x4a99de[_0x660d('0x1c')]=qs['limit'](_0x25743a['query'][_0x660d('0x1c')]);_0x4a99de[_0x660d('0x1e')]=qs[_0x660d('0x1e')](_0x25743a['query'][_0x660d('0x1e')]);}return _0x3c6912[_0x660d('0x62')](_0x4a99de);}})['then'](function(_0x55a5c8){if(_0x55a5c8){return _0x55a5c8?{'count':_0x400d48,'rows':_0x55a5c8}:null;}})[_0x660d('0x24')](respondWithResult(_0x3b7e16,null))[_0x660d('0x47')](handleError(_0x3b7e16,null));};exports['addLists']=function(_0x45a297,_0xa5a3f9,_0x4ea987){var _0x3ceeb2,_0x211df8;return db['Campaign']['find']({'where':{'id':_0x45a297[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0xa5a3f9,null))[_0x660d('0x24')](function(_0x2b25bc){if(_0x2b25bc){_0x211df8=_0x2b25bc;return _0x2b25bc[_0x660d('0x64')](_0x45a297[_0x660d('0x4b')][_0x660d('0x65')],_[_0x660d('0x66')](_0x45a297[_0x660d('0x4b')],['ids','id'])||{});}return null;})[_0x660d('0x67')](function(_0x359ce7){var _0x129fb9;_0x3ceeb2=_0x359ce7||[];var _0xeda1f1=[];if(_0x359ce7){for(var _0x5d1596=0x0;_0x5d1596<_0x359ce7[_0x660d('0x37')];_0x5d1596+=0x1){var _0x500e27=_0x359ce7[_0x5d1596][_0x660d('0x26')]({'plain':!![]});_0x211df8[_0x660d('0x68')]=_0x45a297[_0x660d('0x4b')]['dialCheckDuplicateType']?_0x45a297[_0x660d('0x4b')]['dialCheckDuplicateType']:_0x211df8[_0x660d('0x68')];switch(_0x211df8['dialCheckDuplicateType']){case _0x660d('0x69'):_0x129fb9=squel[_0x660d('0x6a')]()[_0x660d('0x6b')](_0x660d('0x6c'))[_0x660d('0x6d')](['phone',_0x660d('0x6e'),'ContactId',_0x660d('0x6f'),'CampaignId',_0x660d('0x54'),'updatedAt'],squel[_0x660d('0x70')]()['field'](_0x660d('0x71'),_0x660d('0x71'))['field'](_0x660d('0x72'),'scheduledAt')[_0x660d('0x73')]('id','ContactId')['field'](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))[_0x660d('0x73')](_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')['from'](_0x660d('0x76'))[_0x660d('0x3c')](_0x660d('0x77'))[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')](_0x660d('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x660d('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x660d('0x7a')](_0x660d('0x7b'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')]()))['where'](_0x660d('0x7d'),squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x7e'))[_0x660d('0x7a')](_0x660d('0x6c'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297['params']['id'][_0x660d('0x75')]())))[_0x660d('0x75')]();break;case'onlyIfOpen':_0x129fb9=squel[_0x660d('0x6a')]()['into']('cm_hopper')[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x6e'),_0x660d('0x7f'),_0x660d('0x6f'),'CampaignId','createdAt',_0x660d('0x55')],squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')]('NOW()',_0x660d('0x6e'))['field']('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))['field'](_0x45a297['params']['id']['toString'](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')[_0x660d('0x7a')](_0x660d('0x76'))[_0x660d('0x3c')](_0x660d('0x77'))[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')](_0x660d('0x79'))[_0x660d('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x660d('0x70')]()[_0x660d('0x73')](_0x660d('0x7e'))['from'](_0x660d('0x6c'))[_0x660d('0x3c')](_0x660d('0x7c'),_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')]())))[_0x660d('0x75')]();break;default:_0x129fb9=squel[_0x660d('0x6a')]()['into']('cm_hopper')[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x6e'),'ContactId',_0x660d('0x6f'),_0x660d('0x5b'),_0x660d('0x54'),'updatedAt'],squel[_0x660d('0x70')]()['field'](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x6e'))['field']('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x500e27[_0x660d('0x74')]['toString'](),_0x660d('0x6f'))[_0x660d('0x73')](_0x45a297[_0x660d('0x53')]['id'][_0x660d('0x75')](),_0x660d('0x5b'))[_0x660d('0x73')](_0x660d('0x72'),_0x660d('0x54'))['field'](_0x660d('0x72'),_0x660d('0x55'))[_0x660d('0x7a')](_0x660d('0x76'))[_0x660d('0x3c')]('deletedAt\x20IS\x20NULL')[_0x660d('0x3c')](_0x660d('0x78'),_0x500e27[_0x660d('0x74')][_0x660d('0x75')]())['where'](_0x660d('0x79')))['toString']();}_0xeda1f1[_0x660d('0x80')](db['sequelize'][_0x660d('0x31')](_0x129fb9));}return BPromise[_0x660d('0x81')](_0xeda1f1);}})[_0x660d('0x24')](function(){return _0x3ceeb2;})[_0x660d('0x24')](respondWithResult(_0xa5a3f9,null))[_0x660d('0x47')](handleError(_0xa5a3f9,null));};exports[_0x660d('0x82')]=function(_0x381ba3,_0x172dab,_0x3cd39f){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x381ba3['params']['id']}})['then'](handleEntityNotFound(_0x172dab,null))[_0x660d('0x24')](function(_0x1f6136){if(_0x1f6136){return _0x1f6136[_0x660d('0x82')](_0x381ba3['query'][_0x660d('0x65')]);}})['then'](function(_0xea1627){if(_0xea1627){return db[_0x660d('0x5a')][_0x660d('0x25')]({'where':{'ListId':_0x381ba3[_0x660d('0x31')][_0x660d('0x65')],'CampaignId':_0x381ba3[_0x660d('0x53')]['id']}})[_0x660d('0x24')](function(){return _0xea1627;});}})[_0x660d('0x24')](respondWithStatusCode(_0x172dab,null))['catch'](handleError(_0x172dab,null));};exports[_0x660d('0x83')]=function(_0x2bb133,_0x2559a0,_0x5d649e){var _0x109c08={};var _0x5519ec={};var _0x966bc9;var _0x427050;return db[_0x660d('0x43')][_0x660d('0x59')]({'where':{'id':_0x2bb133[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x2559a0,null))['then'](function(_0x228ae3){if(_0x228ae3){_0x966bc9=_0x228ae3;_0x5519ec['model']=_[_0x660d('0x32')](db['CmList']['rawAttributes']);_0x5519ec['query']=_[_0x660d('0x32')](_0x2bb133[_0x660d('0x31')]);_0x5519ec['filters']=_['intersection'](_0x5519ec[_0x660d('0x34')],_0x5519ec[_0x660d('0x31')]);_0x109c08[_0x660d('0x35')]=_['intersection'](_0x5519ec[_0x660d('0x34')],qs[_0x660d('0x36')](_0x2bb133[_0x660d('0x31')][_0x660d('0x36')]));_0x109c08['attributes']=_0x109c08[_0x660d('0x35')][_0x660d('0x37')]?_0x109c08[_0x660d('0x35')]:_0x5519ec['model'];_0x109c08[_0x660d('0x3a')]=qs['sort'](_0x2bb133[_0x660d('0x31')][_0x660d('0x3b')]);_0x109c08[_0x660d('0x3c')]=qs['filters'](_[_0x660d('0x3d')](_0x2bb133['query'],_0x5519ec[_0x660d('0x3e')]));if(_0x2bb133['query'][_0x660d('0x3f')]){_0x109c08[_0x660d('0x3c')]=_[_0x660d('0x40')](_0x109c08[_0x660d('0x3c')],{'$or':_[_0x660d('0x2c')](_0x109c08[_0x660d('0x35')],function(_0x1d4970){var _0x2160d7={};_0x2160d7[_0x1d4970]={'$like':'%'+_0x2bb133[_0x660d('0x31')][_0x660d('0x3f')]+'%'};return _0x2160d7;})});}_0x109c08=_[_0x660d('0x40')]({},_0x109c08,_0x2bb133[_0x660d('0x42')]);return _0x966bc9['getBlackLists'](_0x109c08);}})[_0x660d('0x24')](function(_0xa6d668){if(_0xa6d668){_0x427050=_0xa6d668[_0x660d('0x37')];if(!_0x2bb133[_0x660d('0x31')]['hasOwnProperty'](_0x660d('0x39'))){_0x109c08[_0x660d('0x1c')]=qs[_0x660d('0x1c')](_0x2bb133['query']['limit']);_0x109c08[_0x660d('0x1e')]=qs['offset'](_0x2bb133[_0x660d('0x31')][_0x660d('0x1e')]);}return _0x966bc9['getBlackLists'](_0x109c08);}})[_0x660d('0x24')](function(_0x4bed0){if(_0x4bed0){return _0x4bed0?{'count':_0x427050,'rows':_0x4bed0}:null;}})[_0x660d('0x24')](respondWithResult(_0x2559a0,null))[_0x660d('0x47')](handleError(_0x2559a0,null));};exports[_0x660d('0x84')]=function(_0x5f1e00,_0x14aac2,_0x3d9f0d){var _0x532c8c,_0x5dd291;return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x5f1e00[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x14aac2,null))[_0x660d('0x24')](function(_0x5d50cc){if(_0x5d50cc){_0x5dd291=_0x5d50cc;return _0x5d50cc[_0x660d('0x84')](_0x5f1e00[_0x660d('0x4b')][_0x660d('0x65')],_['omit'](_0x5f1e00[_0x660d('0x4b')],[_0x660d('0x65'),'id'])||{});}return null;})[_0x660d('0x67')](function(_0x10288e){var _0x149bb9;_0x532c8c=_0x10288e||[];var _0x1cda67=[];if(_0x10288e){for(var _0xbcff1d=0x0;_0xbcff1d<_0x10288e[_0x660d('0x37')];_0xbcff1d+=0x1){var _0x25c45f=_0x10288e[_0xbcff1d][_0x660d('0x26')]({'plain':!![]});_0x149bb9=squel[_0x660d('0x6a')]()[_0x660d('0x6b')](_0x660d('0x85'))[_0x660d('0x6d')]([_0x660d('0x71'),_0x660d('0x7f'),_0x660d('0x6f'),_0x660d('0x5b'),_0x660d('0x54'),_0x660d('0x55')],squel['select']()[_0x660d('0x73')](_0x660d('0x71'),_0x660d('0x71'))[_0x660d('0x73')]('id',_0x660d('0x7f'))[_0x660d('0x73')](_0x25c45f[_0x660d('0x74')][_0x660d('0x75')](),_0x660d('0x6f'))[_0x660d('0x73')](_0x5f1e00['params']['id'][_0x660d('0x75')](),_0x660d('0x5b'))['field']('NOW()',_0x660d('0x54'))[_0x660d('0x73')](_0x660d('0x72'),'updatedAt')[_0x660d('0x7a')]('cm_contacts')[_0x660d('0x3c')]('deletedAt\x20IS\x20NULL')[_0x660d('0x3c')](_0x660d('0x78'),_0x25c45f[_0x660d('0x74')][_0x660d('0x75')]())[_0x660d('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x1cda67[_0x660d('0x80')](db[_0x660d('0x86')][_0x660d('0x31')](_0x149bb9));}return BPromise[_0x660d('0x81')](_0x1cda67);}})['then'](function(){return _0x532c8c;})['then'](respondWithResult(_0x14aac2,null))[_0x660d('0x47')](handleError(_0x14aac2,null));};exports['removeBlackLists']=function(_0x3e5607,_0x12c882,_0x50c6dc){return db[_0x660d('0x43')][_0x660d('0x49')]({'where':{'id':_0x3e5607[_0x660d('0x53')]['id']}})[_0x660d('0x24')](handleEntityNotFound(_0x12c882,null))[_0x660d('0x24')](function(_0x179e6e){if(_0x179e6e){return _0x179e6e['removeBlackLists'](_0x3e5607[_0x660d('0x31')][_0x660d('0x65')]);}})['then'](function(_0x23cccf){if(_0x23cccf){return db[_0x660d('0x61')][_0x660d('0x25')]({'where':{'ListId':_0x3e5607[_0x660d('0x31')][_0x660d('0x65')],'CampaignId':_0x3e5607[_0x660d('0x53')]['id']}})[_0x660d('0x24')](function(){return _0x23cccf;});}})[_0x660d('0x24')](respondWithStatusCode(_0x12c882,null))[_0x660d('0x47')](handleError(_0x12c882,null));}; \ No newline at end of file +var _0xf2c5=['count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','omit','ids','spread','dialCheckDuplicateType','insert','fromQuery','ContactId','ListId','select','phone','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','into','cm_hopper','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x5f2c2a,_0x255e24){var _0x13beb7=function(_0x2f53b7){while(--_0x2f53b7){_0x5f2c2a['push'](_0x5f2c2a['shift']());}};_0x13beb7(++_0x255e24);}(_0xf2c5,0x6a));var _0x5f2c=function(_0x317688,_0x9f44f7){_0x317688=_0x317688-0x0;var _0x4a2a48=_0xf2c5[_0x317688];return _0x4a2a48;};'use strict';var emlformat=require(_0x5f2c('0x0'));var rimraf=require(_0x5f2c('0x1'));var zipdir=require(_0x5f2c('0x2'));var jsonpatch=require(_0x5f2c('0x3'));var rp=require('request-promise');var moment=require(_0x5f2c('0x4'));var BPromise=require(_0x5f2c('0x5'));var Mustache=require(_0x5f2c('0x6'));var util=require(_0x5f2c('0x7'));var path=require(_0x5f2c('0x8'));var sox=require(_0x5f2c('0x9'));var csv=require('to-csv');var ejs=require(_0x5f2c('0xa'));var fs=require('fs');var fs_extra=require(_0x5f2c('0xb'));var _=require(_0x5f2c('0xc'));var squel=require(_0x5f2c('0xd'));var crypto=require(_0x5f2c('0xe'));var jsforce=require(_0x5f2c('0xf'));var deskjs=require(_0x5f2c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5f2c('0x11'));var Redis=require(_0x5f2c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5f2c('0x13'));var as=require(_0x5f2c('0x14'));var hardwareService=require(_0x5f2c('0x15'));var logger=require(_0x5f2c('0x16'))(_0x5f2c('0x17'));var utils=require(_0x5f2c('0x18'));var config=require(_0x5f2c('0x19'));var licenseUtil=require(_0x5f2c('0x1a'));var db=require(_0x5f2c('0x1b'))['db'];function respondWithStatusCode(_0x416f9a,_0x58df7c){_0x58df7c=_0x58df7c||0xcc;return function(_0x4847f5){if(_0x4847f5){return _0x416f9a[_0x5f2c('0x1c')](_0x58df7c);}return _0x416f9a[_0x5f2c('0x1d')](_0x58df7c)[_0x5f2c('0x1e')]();};}function respondWithResult(_0x214e79,_0x53bc68){_0x53bc68=_0x53bc68||0xc8;return function(_0x33def1){if(_0x33def1){return _0x214e79[_0x5f2c('0x1d')](_0x53bc68)[_0x5f2c('0x1f')](_0x33def1);}};}function respondWithFilteredResult(_0x298213,_0x33a95d){return function(_0xac0588){if(_0xac0588){var _0x48fb15=typeof _0x33a95d[_0x5f2c('0x20')]===_0x5f2c('0x21')&&typeof _0x33a95d[_0x5f2c('0x22')]===_0x5f2c('0x21');var _0x5dde5a=_0xac0588[_0x5f2c('0x23')];var _0x1249ac=_0x48fb15?0x0:_0x33a95d[_0x5f2c('0x20')];var _0x6df495=_0x48fb15?_0xac0588[_0x5f2c('0x23')]:_0x33a95d[_0x5f2c('0x20')]+_0x33a95d['limit'];var _0x324933;if(_0x6df495>=_0x5dde5a){_0x6df495=_0x5dde5a;_0x324933=0xc8;}else{_0x324933=0xce;}_0x298213[_0x5f2c('0x1d')](_0x324933);return _0x298213[_0x5f2c('0x24')](_0x5f2c('0x25'),_0x1249ac+'-'+_0x6df495+'/'+_0x5dde5a)[_0x5f2c('0x1f')](_0xac0588);}return null;};}function patchUpdates(_0x31d953){return function(_0x4790b9){try{jsonpatch[_0x5f2c('0x26')](_0x4790b9,_0x31d953,!![]);}catch(_0x2f3680){return BPromise['reject'](_0x2f3680);}return _0x4790b9[_0x5f2c('0x27')]();};}function saveUpdates(_0x389aaf,_0x417ba2){return function(_0x3af61c){if(_0x3af61c){return _0x3af61c[_0x5f2c('0x28')](_0x389aaf)[_0x5f2c('0x29')](function(_0x280182){return _0x280182;});}return null;};}function removeEntity(_0x2a316f,_0x26fca9){return function(_0x355bb9){if(_0x355bb9){return _0x355bb9[_0x5f2c('0x2a')]()[_0x5f2c('0x29')](function(){var _0x1eabdf=_0x355bb9[_0x5f2c('0x2b')]({'plain':!![]});var _0x414864=_0x5f2c('0x2c');return db[_0x5f2c('0x2d')]['destroy']({'where':{'type':_0x414864,'resourceId':_0x1eabdf['id']}})['then'](function(){return _0x355bb9;});})[_0x5f2c('0x29')](function(){_0x2a316f[_0x5f2c('0x1d')](0xcc)[_0x5f2c('0x1e')]();});}};}function handleEntityNotFound(_0x304937,_0x142085){return function(_0x2ee5af){if(!_0x2ee5af){_0x304937['sendStatus'](0x194);}return _0x2ee5af;};}function handleError(_0x38a3de,_0x5eb616){_0x5eb616=_0x5eb616||0x1f4;return function(_0x4587d8){logger[_0x5f2c('0x2e')](_0x4587d8[_0x5f2c('0x2f')]);if(_0x4587d8['name']){delete _0x4587d8[_0x5f2c('0x30')];}_0x38a3de[_0x5f2c('0x1d')](_0x5eb616)[_0x5f2c('0x31')](_0x4587d8);};}exports['index']=function(_0x4126a6,_0x1b269f){var _0x35207a={},_0x3b7803={},_0x42630d={'count':0x0,'rows':[]};var _0x58e3ce=_[_0x5f2c('0x32')](db[_0x5f2c('0x33')][_0x5f2c('0x34')],function(_0x25293e){return{'name':_0x25293e[_0x5f2c('0x35')],'type':_0x25293e[_0x5f2c('0x36')]['key']};});_0x3b7803['model']=_[_0x5f2c('0x32')](_0x58e3ce,_0x5f2c('0x30'));_0x3b7803[_0x5f2c('0x37')]=_[_0x5f2c('0x38')](_0x4126a6['query']);_0x3b7803[_0x5f2c('0x39')]=_[_0x5f2c('0x3a')](_0x3b7803['model'],_0x3b7803[_0x5f2c('0x37')]);_0x35207a[_0x5f2c('0x3b')]=_[_0x5f2c('0x3a')](_0x3b7803[_0x5f2c('0x3c')],qs['fields'](_0x4126a6['query'][_0x5f2c('0x3d')]));_0x35207a['attributes']=_0x35207a[_0x5f2c('0x3b')]['length']?_0x35207a['attributes']:_0x3b7803['model'];if(!_0x4126a6[_0x5f2c('0x37')][_0x5f2c('0x3e')](_0x5f2c('0x3f'))){_0x35207a[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0x4126a6[_0x5f2c('0x37')][_0x5f2c('0x22')]);_0x35207a[_0x5f2c('0x20')]=qs[_0x5f2c('0x20')](_0x4126a6['query'][_0x5f2c('0x20')]);}_0x35207a[_0x5f2c('0x40')]=qs[_0x5f2c('0x41')](_0x4126a6[_0x5f2c('0x37')][_0x5f2c('0x41')]);_0x35207a['where']=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0x4126a6['query'],_0x3b7803[_0x5f2c('0x39')]),_0x58e3ce);if(_0x4126a6['query'][_0x5f2c('0x43')]){_0x35207a[_0x5f2c('0x44')]=_[_0x5f2c('0x45')](_0x35207a['where'],{'$or':_[_0x5f2c('0x32')](_0x58e3ce,function(_0x3977e4){if(_0x3977e4[_0x5f2c('0x36')]!==_0x5f2c('0x46')){var _0x22830e={};_0x22830e[_0x3977e4[_0x5f2c('0x30')]]={'$like':'%'+_0x4126a6[_0x5f2c('0x37')][_0x5f2c('0x43')]+'%'};return _0x22830e;}})});}_0x35207a=_[_0x5f2c('0x45')]({},_0x35207a,_0x4126a6['options']);var _0x3652eb={'where':_0x35207a[_0x5f2c('0x44')]};return db[_0x5f2c('0x33')][_0x5f2c('0x23')](_0x3652eb)['then'](function(_0x24166f){_0x42630d[_0x5f2c('0x23')]=_0x24166f;if(_0x4126a6[_0x5f2c('0x37')][_0x5f2c('0x47')]){_0x35207a[_0x5f2c('0x48')]=[{'all':!![]}];}return db[_0x5f2c('0x33')][_0x5f2c('0x49')](_0x35207a);})[_0x5f2c('0x29')](function(_0x53978a){_0x42630d[_0x5f2c('0x4a')]=_0x53978a;return _0x42630d;})['then'](respondWithFilteredResult(_0x1b269f,_0x35207a))[_0x5f2c('0x4b')](handleError(_0x1b269f,null));};exports[_0x5f2c('0x4c')]=function(_0x4a6f6d,_0x1659d7){var _0x12373a={'raw':![],'where':{'id':_0x4a6f6d[_0x5f2c('0x4d')]['id']}},_0x36edcf={};_0x36edcf['model']=_['keys'](db[_0x5f2c('0x33')][_0x5f2c('0x34')]);_0x36edcf[_0x5f2c('0x37')]=_[_0x5f2c('0x38')](_0x4a6f6d[_0x5f2c('0x37')]);_0x36edcf[_0x5f2c('0x39')]=_[_0x5f2c('0x3a')](_0x36edcf['model'],_0x36edcf[_0x5f2c('0x37')]);_0x12373a['attributes']=_[_0x5f2c('0x3a')](_0x36edcf[_0x5f2c('0x3c')],qs[_0x5f2c('0x3d')](_0x4a6f6d[_0x5f2c('0x37')][_0x5f2c('0x3d')]));_0x12373a[_0x5f2c('0x3b')]=_0x12373a[_0x5f2c('0x3b')][_0x5f2c('0x4e')]?_0x12373a[_0x5f2c('0x3b')]:_0x36edcf['model'];if(_0x4a6f6d['query']['includeAll']){_0x12373a[_0x5f2c('0x48')]=[{'all':!![]}];}_0x12373a=_[_0x5f2c('0x45')]({},_0x12373a,_0x4a6f6d[_0x5f2c('0x4f')]);return db[_0x5f2c('0x33')][_0x5f2c('0x50')](_0x12373a)[_0x5f2c('0x29')](handleEntityNotFound(_0x1659d7,null))['then'](respondWithResult(_0x1659d7,null))[_0x5f2c('0x4b')](handleError(_0x1659d7,null));};exports[_0x5f2c('0x51')]=function(_0x547dee,_0x27eb89){return db[_0x5f2c('0x33')][_0x5f2c('0x51')](_0x547dee['body'],{})[_0x5f2c('0x29')](function(_0x202bad){var _0x11dca6=_0x547dee[_0x5f2c('0x52')][_0x5f2c('0x2b')]({'plain':!![]});if(!_0x11dca6)throw new Error(_0x5f2c('0x53'));if(_0x11dca6[_0x5f2c('0x54')]===_0x5f2c('0x52')){var _0xb5be7b=_0x202bad[_0x5f2c('0x2b')]({'plain':!![]});var _0x19741f=_0x5f2c('0x2c');return db[_0x5f2c('0x55')][_0x5f2c('0x50')]({'where':{'name':_0x19741f,'userProfileId':_0x11dca6['userProfileId']},'raw':!![]})[_0x5f2c('0x29')](function(_0x128286){if(_0x128286&&_0x128286[_0x5f2c('0x56')]===0x0){return db['UserProfileResource'][_0x5f2c('0x51')]({'name':_0xb5be7b['name'],'resourceId':_0xb5be7b['id'],'type':_0x128286[_0x5f2c('0x30')],'sectionId':_0x128286['id']},{})['then'](function(){return _0x202bad;});}else{return _0x202bad;}})['catch'](function(_0x1c87cd){logger['error'](_0x5f2c('0x57'),_0x1c87cd);throw _0x1c87cd;});}return _0x202bad;})['then'](respondWithResult(_0x27eb89,0xc9))['catch'](handleError(_0x27eb89,null));};exports[_0x5f2c('0x58')]=function(_0x7bc390,_0x459f9a){var _0x4ab171={'where':{'id':_0x7bc390[_0x5f2c('0x4d')]['id']}},_0x59076f={};_0x59076f[_0x5f2c('0x3c')]=_['keys'](db[_0x5f2c('0x33')]['rawAttributes']);_0x4ab171[_0x5f2c('0x3b')]=_[_0x5f2c('0x3a')](_0x59076f['model'],qs['fields'](_0x7bc390[_0x5f2c('0x37')][_0x5f2c('0x3d')]));_0x4ab171[_0x5f2c('0x3b')]=_0x4ab171[_0x5f2c('0x3b')][_0x5f2c('0x4e')]?_0x4ab171['attributes']:_0x59076f[_0x5f2c('0x3c')];if(_0x7bc390['query']['includeAll']){_0x4ab171[_0x5f2c('0x48')]=[{'all':!![]}];}_0x4ab171=_['merge']({},_0x4ab171,_0x7bc390[_0x5f2c('0x4f')]);return db[_0x5f2c('0x33')][_0x5f2c('0x50')](_0x4ab171)['then'](handleEntityNotFound(_0x459f9a,null))[_0x5f2c('0x29')](function(_0x59dfe3){if(_0x59dfe3){var _0x347f48=_0x59dfe3[_0x5f2c('0x2b')]({'plain':!![]});_0x347f48=qs['omit'](_0x347f48,['id',_0x5f2c('0x59'),'updatedAt']);_0x7bc390[_0x5f2c('0x5a')]=_['omit'](_0x7bc390[_0x5f2c('0x5a')],['id',_0x5f2c('0x59'),_0x5f2c('0x5b')]);return db[_0x5f2c('0x33')][_0x5f2c('0x51')](_['merge'](_0x347f48,_0x7bc390['body']),{'include':_0x7bc390[_0x5f2c('0x37')][_0x5f2c('0x47')]?[{'all':!![]}]:undefined})[_0x5f2c('0x29')](function(_0x49c723){var _0x1312b2=_0x7bc390['user'][_0x5f2c('0x2b')]({'plain':!![]});if(!_0x1312b2)throw new Error(_0x5f2c('0x53'));if(_0x1312b2[_0x5f2c('0x54')]===_0x5f2c('0x52')){var _0x16494e=_0x49c723[_0x5f2c('0x2b')]({'plain':!![]});var _0x3becdf=_0x5f2c('0x2c');return db[_0x5f2c('0x55')]['find']({'where':{'name':_0x3becdf,'userProfileId':_0x1312b2[_0x5f2c('0x5c')]},'raw':!![]})[_0x5f2c('0x29')](function(_0x42491e){if(_0x42491e&&_0x42491e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16494e[_0x5f2c('0x30')],'resourceId':_0x16494e['id'],'type':_0x42491e[_0x5f2c('0x30')],'sectionId':_0x42491e['id']},{})['then'](function(){return _0x49c723;});}else{return _0x49c723;}})[_0x5f2c('0x4b')](function(_0x1d2036){logger[_0x5f2c('0x2e')](_0x5f2c('0x57'),_0x1d2036);throw _0x1d2036;});}return _0x49c723;});}})[_0x5f2c('0x29')](respondWithResult(_0x459f9a,0xc9))[_0x5f2c('0x4b')](handleError(_0x459f9a,null));};exports[_0x5f2c('0x28')]=function(_0x3d6464,_0x3547a9){if(_0x3d6464[_0x5f2c('0x5a')]['id']){delete _0x3d6464[_0x5f2c('0x5a')]['id'];}return db[_0x5f2c('0x33')][_0x5f2c('0x50')]({'where':{'id':_0x3d6464[_0x5f2c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3547a9,null))[_0x5f2c('0x29')](saveUpdates(_0x3d6464[_0x5f2c('0x5a')],null))[_0x5f2c('0x29')](respondWithResult(_0x3547a9,null))['catch'](handleError(_0x3547a9,null));};exports[_0x5f2c('0x2a')]=function(_0x52c102,_0x47491b){return db['Campaign'][_0x5f2c('0x50')]({'where':{'id':_0x52c102[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x47491b,null))['then'](removeEntity(_0x47491b,null))['catch'](handleError(_0x47491b,null));};exports[_0x5f2c('0x5d')]=function(_0x531044,_0x505764,_0x184cfa){var _0x8ec60b={'raw':!![],'where':{}};var _0x482467={};var _0x2ea380={'count':0x0,'rows':[]};return db['Campaign'][_0x5f2c('0x5e')]({'where':{'id':_0x531044[_0x5f2c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x505764,null))[_0x5f2c('0x29')](function(_0x2f1c32){if(_0x2f1c32){_0x482467['model']=_[_0x5f2c('0x38')](db[_0x5f2c('0x5f')][_0x5f2c('0x34')]);_0x482467['query']=_[_0x5f2c('0x38')](_0x531044[_0x5f2c('0x37')]);_0x482467['filters']=_[_0x5f2c('0x3a')](_0x482467['model'],_0x482467['query']);_0x8ec60b['attributes']=_[_0x5f2c('0x3a')](_0x482467[_0x5f2c('0x3c')],qs[_0x5f2c('0x3d')](_0x531044[_0x5f2c('0x37')]['fields']));_0x8ec60b[_0x5f2c('0x3b')]=_0x8ec60b[_0x5f2c('0x3b')][_0x5f2c('0x4e')]?_0x8ec60b[_0x5f2c('0x3b')]:_0x482467[_0x5f2c('0x3c')];if(!_0x531044['query']['hasOwnProperty']('nolimit')){_0x8ec60b[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0x531044[_0x5f2c('0x37')][_0x5f2c('0x22')]);_0x8ec60b[_0x5f2c('0x20')]=qs['offset'](_0x531044['query']['offset']);}_0x8ec60b[_0x5f2c('0x40')]=qs[_0x5f2c('0x41')](_0x531044[_0x5f2c('0x37')]['sort']);_0x8ec60b['where']=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0x531044[_0x5f2c('0x37')],_0x482467[_0x5f2c('0x39')]));_0x8ec60b[_0x5f2c('0x44')][_0x5f2c('0x60')]=_0x2f1c32['id'];if(_0x531044[_0x5f2c('0x37')][_0x5f2c('0x43')]){_0x8ec60b['where']=_['merge'](_0x8ec60b['where'],{'$or':_['map'](_0x8ec60b[_0x5f2c('0x3b')],function(_0x249f10){var _0x22e8d9={};_0x22e8d9[_0x249f10]={'$like':'%'+_0x531044[_0x5f2c('0x37')][_0x5f2c('0x43')]+'%'};return _0x22e8d9;})});}_0x8ec60b=_['merge']({},_0x8ec60b,_0x531044[_0x5f2c('0x4f')]);return db[_0x5f2c('0x5f')][_0x5f2c('0x23')]({'where':_0x8ec60b[_0x5f2c('0x44')]})[_0x5f2c('0x29')](function(_0x27af64){_0x2ea380[_0x5f2c('0x23')]=_0x27af64;if(_0x531044[_0x5f2c('0x37')]['includeAll']){_0x8ec60b['include']=[{'all':!![]}];}return db[_0x5f2c('0x5f')][_0x5f2c('0x49')](_0x8ec60b);})[_0x5f2c('0x29')](function(_0x47dd6f){_0x2ea380[_0x5f2c('0x4a')]=_0x47dd6f;return _0x2ea380;});}})['then'](respondWithFilteredResult(_0x505764,_0x8ec60b))[_0x5f2c('0x4b')](handleError(_0x505764,null));};exports[_0x5f2c('0x61')]=function(_0x466b08,_0x5eccbb,_0x4f0925){var _0x18118a={'raw':!![],'where':{}};var _0x2273cb={};var _0x5067e9={'count':0x0,'rows':[]};return db[_0x5f2c('0x33')]['findOne']({'where':{'id':_0x466b08[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x5eccbb,null))[_0x5f2c('0x29')](function(_0x4a3909){if(_0x4a3909){_0x2273cb['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x2273cb[_0x5f2c('0x37')]=_['keys'](_0x466b08[_0x5f2c('0x37')]);_0x2273cb[_0x5f2c('0x39')]=_[_0x5f2c('0x3a')](_0x2273cb['model'],_0x2273cb[_0x5f2c('0x37')]);_0x18118a[_0x5f2c('0x3b')]=_[_0x5f2c('0x3a')](_0x2273cb[_0x5f2c('0x3c')],qs[_0x5f2c('0x3d')](_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x3d')]));_0x18118a['attributes']=_0x18118a[_0x5f2c('0x3b')][_0x5f2c('0x4e')]?_0x18118a['attributes']:_0x2273cb['model'];if(!_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x3e')]('nolimit')){_0x18118a[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x22')]);_0x18118a['offset']=qs[_0x5f2c('0x20')](_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x20')]);}_0x18118a[_0x5f2c('0x40')]=qs[_0x5f2c('0x41')](_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x41')]);_0x18118a['where']=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0x466b08[_0x5f2c('0x37')],_0x2273cb[_0x5f2c('0x39')]));_0x18118a[_0x5f2c('0x44')][_0x5f2c('0x60')]=_0x4a3909['id'];if(_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x43')]){_0x18118a[_0x5f2c('0x44')]=_[_0x5f2c('0x45')](_0x18118a[_0x5f2c('0x44')],{'$or':_[_0x5f2c('0x32')](_0x18118a['attributes'],function(_0x514da8){var _0x398e6b={};_0x398e6b[_0x514da8]={'$like':'%'+_0x466b08[_0x5f2c('0x37')]['filter']+'%'};return _0x398e6b;})});}_0x18118a=_['merge']({},_0x18118a,_0x466b08[_0x5f2c('0x4f')]);return db[_0x5f2c('0x62')][_0x5f2c('0x23')]({'where':_0x18118a[_0x5f2c('0x44')]})['then'](function(_0x35c0da){_0x5067e9[_0x5f2c('0x23')]=_0x35c0da;if(_0x466b08[_0x5f2c('0x37')][_0x5f2c('0x47')]){_0x18118a[_0x5f2c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x18118a);})[_0x5f2c('0x29')](function(_0x22309f){_0x5067e9[_0x5f2c('0x4a')]=_0x22309f;return _0x5067e9;});}})[_0x5f2c('0x29')](respondWithFilteredResult(_0x5eccbb,_0x18118a))['catch'](handleError(_0x5eccbb,null));};exports[_0x5f2c('0x63')]=function(_0x995460,_0x2cfa41,_0x3d622d){var _0x250ccb={'raw':!![],'where':{}};var _0x26a354={};var _0x139add={'count':0x0,'rows':[]};return db[_0x5f2c('0x33')]['findOne']({'where':{'id':_0x995460[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x2cfa41,null))[_0x5f2c('0x29')](function(_0x96396d){if(_0x96396d){_0x26a354[_0x5f2c('0x3c')]=_['keys'](db['CmHopperFinal'][_0x5f2c('0x34')]);_0x26a354[_0x5f2c('0x37')]=_[_0x5f2c('0x38')](_0x995460[_0x5f2c('0x37')]);_0x26a354[_0x5f2c('0x39')]=_['intersection'](_0x26a354[_0x5f2c('0x3c')],_0x26a354[_0x5f2c('0x37')]);_0x250ccb['attributes']=_['intersection'](_0x26a354[_0x5f2c('0x3c')],qs['fields'](_0x995460[_0x5f2c('0x37')][_0x5f2c('0x3d')]));_0x250ccb[_0x5f2c('0x3b')]=_0x250ccb[_0x5f2c('0x3b')][_0x5f2c('0x4e')]?_0x250ccb['attributes']:_0x26a354[_0x5f2c('0x3c')];if(!_0x995460['query'][_0x5f2c('0x3e')](_0x5f2c('0x3f'))){_0x250ccb[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0x995460[_0x5f2c('0x37')][_0x5f2c('0x22')]);_0x250ccb[_0x5f2c('0x20')]=qs['offset'](_0x995460[_0x5f2c('0x37')][_0x5f2c('0x20')]);}_0x250ccb[_0x5f2c('0x40')]=qs['sort'](_0x995460[_0x5f2c('0x37')]['sort']);_0x250ccb['where']=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0x995460[_0x5f2c('0x37')],_0x26a354[_0x5f2c('0x39')]));_0x250ccb[_0x5f2c('0x44')][_0x5f2c('0x60')]=_0x96396d['id'];if(_0x995460[_0x5f2c('0x37')][_0x5f2c('0x43')]){_0x250ccb[_0x5f2c('0x44')]=_[_0x5f2c('0x45')](_0x250ccb[_0x5f2c('0x44')],{'$or':_[_0x5f2c('0x32')](_0x250ccb['attributes'],function(_0x5bd134){var _0x2e1c96={};_0x2e1c96[_0x5bd134]={'$like':'%'+_0x995460[_0x5f2c('0x37')][_0x5f2c('0x43')]+'%'};return _0x2e1c96;})});}_0x250ccb=_[_0x5f2c('0x45')]({},_0x250ccb,_0x995460[_0x5f2c('0x4f')]);return db[_0x5f2c('0x64')][_0x5f2c('0x23')]({'where':_0x250ccb[_0x5f2c('0x44')]})[_0x5f2c('0x29')](function(_0xa7a0bc){_0x139add['count']=_0xa7a0bc;if(_0x995460[_0x5f2c('0x37')][_0x5f2c('0x47')]){_0x250ccb[_0x5f2c('0x48')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x250ccb);})['then'](function(_0x2d4437){_0x139add['rows']=_0x2d4437;return _0x139add;});}})[_0x5f2c('0x29')](respondWithFilteredResult(_0x2cfa41,_0x250ccb))[_0x5f2c('0x4b')](handleError(_0x2cfa41,null));};exports[_0x5f2c('0x65')]=function(_0x96969f,_0x2a519d,_0x1071ab){var _0x197e6b={'raw':!![],'where':{}};var _0x21c1b3={};var _0x37842b={'count':0x0,'rows':[]};return db[_0x5f2c('0x33')][_0x5f2c('0x5e')]({'where':{'id':_0x96969f[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x2a519d,null))['then'](function(_0x204687){if(_0x204687){_0x21c1b3['model']=_[_0x5f2c('0x38')](db[_0x5f2c('0x66')][_0x5f2c('0x34')]);_0x21c1b3[_0x5f2c('0x37')]=_[_0x5f2c('0x38')](_0x96969f[_0x5f2c('0x37')]);_0x21c1b3['filters']=_[_0x5f2c('0x3a')](_0x21c1b3['model'],_0x21c1b3[_0x5f2c('0x37')]);_0x197e6b[_0x5f2c('0x3b')]=_['intersection'](_0x21c1b3[_0x5f2c('0x3c')],qs[_0x5f2c('0x3d')](_0x96969f[_0x5f2c('0x37')]['fields']));_0x197e6b[_0x5f2c('0x3b')]=_0x197e6b['attributes'][_0x5f2c('0x4e')]?_0x197e6b[_0x5f2c('0x3b')]:_0x21c1b3[_0x5f2c('0x3c')];if(!_0x96969f[_0x5f2c('0x37')][_0x5f2c('0x3e')]('nolimit')){_0x197e6b[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0x96969f[_0x5f2c('0x37')][_0x5f2c('0x22')]);_0x197e6b[_0x5f2c('0x20')]=qs[_0x5f2c('0x20')](_0x96969f['query']['offset']);}_0x197e6b[_0x5f2c('0x40')]=qs[_0x5f2c('0x41')](_0x96969f[_0x5f2c('0x37')][_0x5f2c('0x41')]);_0x197e6b[_0x5f2c('0x44')]=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0x96969f['query'],_0x21c1b3[_0x5f2c('0x39')]));_0x197e6b[_0x5f2c('0x44')][_0x5f2c('0x60')]=_0x204687['id'];if(_0x96969f[_0x5f2c('0x37')][_0x5f2c('0x43')]){_0x197e6b[_0x5f2c('0x44')]=_['merge'](_0x197e6b[_0x5f2c('0x44')],{'$or':_[_0x5f2c('0x32')](_0x197e6b[_0x5f2c('0x3b')],function(_0x3de03b){var _0x26271b={};_0x26271b[_0x3de03b]={'$like':'%'+_0x96969f['query'][_0x5f2c('0x43')]+'%'};return _0x26271b;})});}_0x197e6b=_['merge']({},_0x197e6b,_0x96969f[_0x5f2c('0x4f')]);return db[_0x5f2c('0x66')][_0x5f2c('0x23')]({'where':_0x197e6b['where']})['then'](function(_0x2f4811){_0x37842b['count']=_0x2f4811;if(_0x96969f[_0x5f2c('0x37')]['includeAll']){_0x197e6b[_0x5f2c('0x48')]=[{'all':!![]}];}return db[_0x5f2c('0x66')][_0x5f2c('0x49')](_0x197e6b);})[_0x5f2c('0x29')](function(_0x21fd34){_0x37842b[_0x5f2c('0x4a')]=_0x21fd34;return _0x37842b;});}})[_0x5f2c('0x29')](respondWithFilteredResult(_0x2a519d,_0x197e6b))['catch'](handleError(_0x2a519d,null));};exports[_0x5f2c('0x67')]=function(_0xa988e4,_0x1c3bad,_0x5c0e93){var _0x15a961={};var _0x1ad0e7={};var _0x5eab88;var _0x229438;return db['Campaign'][_0x5f2c('0x5e')]({'where':{'id':_0xa988e4[_0x5f2c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c3bad,null))[_0x5f2c('0x29')](function(_0x33aced){if(_0x33aced){_0x5eab88=_0x33aced;_0x1ad0e7[_0x5f2c('0x3c')]=_[_0x5f2c('0x38')](db[_0x5f2c('0x68')][_0x5f2c('0x34')]);_0x1ad0e7[_0x5f2c('0x37')]=_['keys'](_0xa988e4[_0x5f2c('0x37')]);_0x1ad0e7[_0x5f2c('0x39')]=_['intersection'](_0x1ad0e7[_0x5f2c('0x3c')],_0x1ad0e7[_0x5f2c('0x37')]);_0x15a961[_0x5f2c('0x3b')]=_[_0x5f2c('0x3a')](_0x1ad0e7[_0x5f2c('0x3c')],qs[_0x5f2c('0x3d')](_0xa988e4['query'][_0x5f2c('0x3d')]));_0x15a961[_0x5f2c('0x3b')]=_0x15a961['attributes'][_0x5f2c('0x4e')]?_0x15a961[_0x5f2c('0x3b')]:_0x1ad0e7[_0x5f2c('0x3c')];_0x15a961[_0x5f2c('0x40')]=qs[_0x5f2c('0x41')](_0xa988e4[_0x5f2c('0x37')]['sort']);_0x15a961[_0x5f2c('0x44')]=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0xa988e4[_0x5f2c('0x37')],_0x1ad0e7[_0x5f2c('0x39')]));if(_0xa988e4[_0x5f2c('0x37')]['filter']){_0x15a961['where']=_[_0x5f2c('0x45')](_0x15a961[_0x5f2c('0x44')],{'$or':_[_0x5f2c('0x32')](_0x15a961[_0x5f2c('0x3b')],function(_0xef8b3e){var _0xfe4d73={};_0xfe4d73[_0xef8b3e]={'$like':'%'+_0xa988e4[_0x5f2c('0x37')][_0x5f2c('0x43')]+'%'};return _0xfe4d73;})});}_0x15a961=_['merge']({},_0x15a961,_0xa988e4[_0x5f2c('0x4f')]);return _0x5eab88[_0x5f2c('0x67')](_0x15a961);}})[_0x5f2c('0x29')](function(_0x5db64c){if(_0x5db64c){_0x229438=_0x5db64c[_0x5f2c('0x4e')];if(!_0xa988e4[_0x5f2c('0x37')][_0x5f2c('0x3e')](_0x5f2c('0x3f'))){_0x15a961['limit']=qs[_0x5f2c('0x22')](_0xa988e4[_0x5f2c('0x37')]['limit']);_0x15a961[_0x5f2c('0x20')]=qs[_0x5f2c('0x20')](_0xa988e4['query'][_0x5f2c('0x20')]);}return _0x5eab88[_0x5f2c('0x67')](_0x15a961);}})[_0x5f2c('0x29')](function(_0x2c1eab){if(_0x2c1eab){return _0x2c1eab?{'count':_0x229438,'rows':_0x2c1eab}:null;}})[_0x5f2c('0x29')](respondWithResult(_0x1c3bad,null))[_0x5f2c('0x4b')](handleError(_0x1c3bad,null));};exports['addLists']=function(_0x52af21,_0x396007,_0x197aa9){var _0x518f4b,_0x377084;return db['Campaign'][_0x5f2c('0x50')]({'where':{'id':_0x52af21[_0x5f2c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x396007,null))[_0x5f2c('0x29')](function(_0xb4b4a4){if(_0xb4b4a4){_0x377084=_0xb4b4a4;return _0xb4b4a4[_0x5f2c('0x69')](_0x52af21[_0x5f2c('0x5a')]['ids'],_[_0x5f2c('0x6a')](_0x52af21[_0x5f2c('0x5a')],[_0x5f2c('0x6b'),'id'])||{});}return null;})[_0x5f2c('0x6c')](function(_0x1fd746){var _0x4e10f2;_0x518f4b=_0x1fd746||[];var _0x383d92=[];if(_0x1fd746){for(var _0x5ed354=0x0;_0x5ed354<_0x1fd746[_0x5f2c('0x4e')];_0x5ed354+=0x1){var _0x124f47=_0x1fd746[_0x5ed354][_0x5f2c('0x2b')]({'plain':!![]});_0x377084[_0x5f2c('0x6d')]=_0x52af21['body'][_0x5f2c('0x6d')]?_0x52af21[_0x5f2c('0x5a')]['dialCheckDuplicateType']:_0x377084[_0x5f2c('0x6d')];switch(_0x377084[_0x5f2c('0x6d')]){case'always':_0x4e10f2=squel[_0x5f2c('0x6e')]()['into']('cm_hopper')[_0x5f2c('0x6f')](['phone','scheduledAt',_0x5f2c('0x70'),_0x5f2c('0x71'),'CampaignId',_0x5f2c('0x59'),_0x5f2c('0x5b')],squel[_0x5f2c('0x72')]()['field'](_0x5f2c('0x73'),_0x5f2c('0x73'))[_0x5f2c('0x74')](_0x5f2c('0x75'),_0x5f2c('0x76'))[_0x5f2c('0x74')]('id','ContactId')['field'](_0x124f47[_0x5f2c('0x77')][_0x5f2c('0x78')](),'ListId')[_0x5f2c('0x74')](_0x52af21['params']['id']['toString'](),_0x5f2c('0x60'))[_0x5f2c('0x74')](_0x5f2c('0x75'),_0x5f2c('0x59'))[_0x5f2c('0x74')]('NOW()',_0x5f2c('0x5b'))[_0x5f2c('0x79')](_0x5f2c('0x7a'))[_0x5f2c('0x44')](_0x5f2c('0x7b'))[_0x5f2c('0x44')](_0x5f2c('0x7c'),_0x124f47['CmListId'][_0x5f2c('0x78')]())[_0x5f2c('0x44')](_0x5f2c('0x7d'))[_0x5f2c('0x44')](_0x5f2c('0x7e'),squel[_0x5f2c('0x72')]()[_0x5f2c('0x74')](_0x5f2c('0x7f'))[_0x5f2c('0x79')](_0x5f2c('0x80'))[_0x5f2c('0x44')](_0x5f2c('0x81'),_0x52af21[_0x5f2c('0x4d')]['id'][_0x5f2c('0x78')]()))[_0x5f2c('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5f2c('0x74')]('COALESCE(phone,\x27\x27)')[_0x5f2c('0x79')]('cm_hopper')['where'](_0x5f2c('0x81'),_0x52af21[_0x5f2c('0x4d')]['id'][_0x5f2c('0x78')]())))[_0x5f2c('0x78')]();break;case'onlyIfOpen':_0x4e10f2=squel[_0x5f2c('0x6e')]()[_0x5f2c('0x82')](_0x5f2c('0x83'))[_0x5f2c('0x6f')]([_0x5f2c('0x73'),_0x5f2c('0x76'),'ContactId',_0x5f2c('0x71'),'CampaignId',_0x5f2c('0x59'),'updatedAt'],squel[_0x5f2c('0x72')]()[_0x5f2c('0x74')](_0x5f2c('0x73'),_0x5f2c('0x73'))[_0x5f2c('0x74')](_0x5f2c('0x75'),_0x5f2c('0x76'))['field']('id',_0x5f2c('0x70'))[_0x5f2c('0x74')](_0x124f47[_0x5f2c('0x77')][_0x5f2c('0x78')](),'ListId')['field'](_0x52af21['params']['id'][_0x5f2c('0x78')](),'CampaignId')['field'](_0x5f2c('0x75'),_0x5f2c('0x59'))['field'](_0x5f2c('0x75'),'updatedAt')[_0x5f2c('0x79')](_0x5f2c('0x7a'))[_0x5f2c('0x44')]('deletedAt\x20IS\x20NULL')[_0x5f2c('0x44')]('ListId\x20=\x20?',_0x124f47['CmListId'][_0x5f2c('0x78')]())[_0x5f2c('0x44')](_0x5f2c('0x7d'))[_0x5f2c('0x44')](_0x5f2c('0x7e'),squel[_0x5f2c('0x72')]()[_0x5f2c('0x74')](_0x5f2c('0x84'))[_0x5f2c('0x79')](_0x5f2c('0x83'))[_0x5f2c('0x44')](_0x5f2c('0x81'),_0x52af21[_0x5f2c('0x4d')]['id'][_0x5f2c('0x78')]())))[_0x5f2c('0x78')]();break;default:_0x4e10f2=squel[_0x5f2c('0x6e')]()[_0x5f2c('0x82')](_0x5f2c('0x83'))[_0x5f2c('0x6f')](['phone',_0x5f2c('0x76'),_0x5f2c('0x70'),'ListId','CampaignId',_0x5f2c('0x59'),_0x5f2c('0x5b')],squel[_0x5f2c('0x72')]()['field'](_0x5f2c('0x73'),_0x5f2c('0x73'))[_0x5f2c('0x74')](_0x5f2c('0x75'),'scheduledAt')[_0x5f2c('0x74')]('id',_0x5f2c('0x70'))[_0x5f2c('0x74')](_0x124f47[_0x5f2c('0x77')][_0x5f2c('0x78')](),_0x5f2c('0x71'))[_0x5f2c('0x74')](_0x52af21[_0x5f2c('0x4d')]['id'][_0x5f2c('0x78')](),'CampaignId')['field'](_0x5f2c('0x75'),_0x5f2c('0x59'))['field'](_0x5f2c('0x75'),_0x5f2c('0x5b'))[_0x5f2c('0x79')]('cm_contacts')[_0x5f2c('0x44')](_0x5f2c('0x7b'))[_0x5f2c('0x44')](_0x5f2c('0x7c'),_0x124f47[_0x5f2c('0x77')][_0x5f2c('0x78')]())[_0x5f2c('0x44')](_0x5f2c('0x7d')))[_0x5f2c('0x78')]();}_0x383d92[_0x5f2c('0x85')](db['sequelize']['query'](_0x4e10f2));}return BPromise[_0x5f2c('0x86')](_0x383d92);}})[_0x5f2c('0x29')](function(){return _0x518f4b;})[_0x5f2c('0x29')](respondWithResult(_0x396007,null))[_0x5f2c('0x4b')](handleError(_0x396007,null));};exports[_0x5f2c('0x87')]=function(_0x24c85f,_0x309166,_0x2d9832){return db[_0x5f2c('0x33')][_0x5f2c('0x50')]({'where':{'id':_0x24c85f['params']['id']}})['then'](handleEntityNotFound(_0x309166,null))['then'](function(_0x15b34b){if(_0x15b34b){return _0x15b34b[_0x5f2c('0x87')](_0x24c85f['query']['ids']);}})[_0x5f2c('0x29')](function(_0x5ad2fe){if(_0x5ad2fe){return db[_0x5f2c('0x5f')][_0x5f2c('0x2a')]({'where':{'ListId':_0x24c85f[_0x5f2c('0x37')][_0x5f2c('0x6b')],'CampaignId':_0x24c85f[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](function(){return _0x5ad2fe;});}})[_0x5f2c('0x29')](respondWithStatusCode(_0x309166,null))[_0x5f2c('0x4b')](handleError(_0x309166,null));};exports['getBlackLists']=function(_0xf21765,_0x1c71b9,_0x269a5a){var _0x2f10e7={};var _0x1ebb4c={};var _0x5f0bf8;var _0x49b3ef;return db['Campaign'][_0x5f2c('0x5e')]({'where':{'id':_0xf21765[_0x5f2c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c71b9,null))[_0x5f2c('0x29')](function(_0x5c7bcf){if(_0x5c7bcf){_0x5f0bf8=_0x5c7bcf;_0x1ebb4c[_0x5f2c('0x3c')]=_[_0x5f2c('0x38')](db['CmList'][_0x5f2c('0x34')]);_0x1ebb4c['query']=_[_0x5f2c('0x38')](_0xf21765[_0x5f2c('0x37')]);_0x1ebb4c[_0x5f2c('0x39')]=_[_0x5f2c('0x3a')](_0x1ebb4c[_0x5f2c('0x3c')],_0x1ebb4c['query']);_0x2f10e7[_0x5f2c('0x3b')]=_[_0x5f2c('0x3a')](_0x1ebb4c['model'],qs[_0x5f2c('0x3d')](_0xf21765[_0x5f2c('0x37')][_0x5f2c('0x3d')]));_0x2f10e7[_0x5f2c('0x3b')]=_0x2f10e7[_0x5f2c('0x3b')]['length']?_0x2f10e7[_0x5f2c('0x3b')]:_0x1ebb4c['model'];_0x2f10e7[_0x5f2c('0x40')]=qs['sort'](_0xf21765['query'][_0x5f2c('0x41')]);_0x2f10e7[_0x5f2c('0x44')]=qs[_0x5f2c('0x39')](_[_0x5f2c('0x42')](_0xf21765[_0x5f2c('0x37')],_0x1ebb4c[_0x5f2c('0x39')]));if(_0xf21765['query'][_0x5f2c('0x43')]){_0x2f10e7[_0x5f2c('0x44')]=_[_0x5f2c('0x45')](_0x2f10e7[_0x5f2c('0x44')],{'$or':_[_0x5f2c('0x32')](_0x2f10e7[_0x5f2c('0x3b')],function(_0x25d6ab){var _0x1597bb={};_0x1597bb[_0x25d6ab]={'$like':'%'+_0xf21765[_0x5f2c('0x37')][_0x5f2c('0x43')]+'%'};return _0x1597bb;})});}_0x2f10e7=_['merge']({},_0x2f10e7,_0xf21765[_0x5f2c('0x4f')]);return _0x5f0bf8['getBlackLists'](_0x2f10e7);}})[_0x5f2c('0x29')](function(_0x4fd11e){if(_0x4fd11e){_0x49b3ef=_0x4fd11e[_0x5f2c('0x4e')];if(!_0xf21765[_0x5f2c('0x37')][_0x5f2c('0x3e')](_0x5f2c('0x3f'))){_0x2f10e7[_0x5f2c('0x22')]=qs[_0x5f2c('0x22')](_0xf21765[_0x5f2c('0x37')]['limit']);_0x2f10e7[_0x5f2c('0x20')]=qs[_0x5f2c('0x20')](_0xf21765[_0x5f2c('0x37')][_0x5f2c('0x20')]);}return _0x5f0bf8[_0x5f2c('0x88')](_0x2f10e7);}})[_0x5f2c('0x29')](function(_0x5177e4){if(_0x5177e4){return _0x5177e4?{'count':_0x49b3ef,'rows':_0x5177e4}:null;}})['then'](respondWithResult(_0x1c71b9,null))[_0x5f2c('0x4b')](handleError(_0x1c71b9,null));};exports[_0x5f2c('0x89')]=function(_0x300da2,_0x1457f2,_0x41b995){var _0x361141,_0x28f2c3;return db[_0x5f2c('0x33')][_0x5f2c('0x50')]({'where':{'id':_0x300da2[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x1457f2,null))[_0x5f2c('0x29')](function(_0x51fceb){if(_0x51fceb){_0x28f2c3=_0x51fceb;return _0x51fceb['addBlackLists'](_0x300da2[_0x5f2c('0x5a')][_0x5f2c('0x6b')],_['omit'](_0x300da2[_0x5f2c('0x5a')],[_0x5f2c('0x6b'),'id'])||{});}return null;})['spread'](function(_0x2a542f){var _0x19d7bb;_0x361141=_0x2a542f||[];var _0x5c7408=[];if(_0x2a542f){for(var _0x2ef106=0x0;_0x2ef106<_0x2a542f[_0x5f2c('0x4e')];_0x2ef106+=0x1){var _0x2d7718=_0x2a542f[_0x2ef106][_0x5f2c('0x2b')]({'plain':!![]});_0x19d7bb=squel[_0x5f2c('0x6e')]()['into'](_0x5f2c('0x8a'))[_0x5f2c('0x6f')]([_0x5f2c('0x73'),_0x5f2c('0x70'),_0x5f2c('0x71'),_0x5f2c('0x60'),_0x5f2c('0x59'),_0x5f2c('0x5b')],squel[_0x5f2c('0x72')]()[_0x5f2c('0x74')](_0x5f2c('0x73'),'phone')[_0x5f2c('0x74')]('id',_0x5f2c('0x70'))[_0x5f2c('0x74')](_0x2d7718[_0x5f2c('0x77')][_0x5f2c('0x78')](),_0x5f2c('0x71'))[_0x5f2c('0x74')](_0x300da2[_0x5f2c('0x4d')]['id'][_0x5f2c('0x78')](),_0x5f2c('0x60'))[_0x5f2c('0x74')](_0x5f2c('0x75'),_0x5f2c('0x59'))[_0x5f2c('0x74')](_0x5f2c('0x75'),_0x5f2c('0x5b'))[_0x5f2c('0x79')](_0x5f2c('0x7a'))[_0x5f2c('0x44')]('deletedAt\x20IS\x20NULL')[_0x5f2c('0x44')](_0x5f2c('0x7c'),_0x2d7718[_0x5f2c('0x77')][_0x5f2c('0x78')]())[_0x5f2c('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x5f2c('0x78')]();_0x5c7408[_0x5f2c('0x85')](db[_0x5f2c('0x8b')][_0x5f2c('0x37')](_0x19d7bb));}return BPromise[_0x5f2c('0x86')](_0x5c7408);}})[_0x5f2c('0x29')](function(){return _0x361141;})['then'](respondWithResult(_0x1457f2,null))[_0x5f2c('0x4b')](handleError(_0x1457f2,null));};exports[_0x5f2c('0x8c')]=function(_0x441556,_0x2c85ff,_0x3bdb1f){return db[_0x5f2c('0x33')][_0x5f2c('0x50')]({'where':{'id':_0x441556[_0x5f2c('0x4d')]['id']}})[_0x5f2c('0x29')](handleEntityNotFound(_0x2c85ff,null))[_0x5f2c('0x29')](function(_0x2f9687){if(_0x2f9687){return _0x2f9687['removeBlackLists'](_0x441556[_0x5f2c('0x37')][_0x5f2c('0x6b')]);}})[_0x5f2c('0x29')](function(_0xa84fe1){if(_0xa84fe1){return db[_0x5f2c('0x66')]['destroy']({'where':{'ListId':_0x441556[_0x5f2c('0x37')][_0x5f2c('0x6b')],'CampaignId':_0x441556['params']['id']}})[_0x5f2c('0x29')](function(){return _0xa84fe1;});}})['then'](respondWithStatusCode(_0x2c85ff,null))['catch'](handleError(_0x2c85ff,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d7391b5..efd8773 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4bfaae,_0x163b72){var _0x305f09=function(_0x34105b){while(--_0x34105b){_0x4bfaae['push'](_0x4bfaae['shift']());}};_0x305f09(++_0x163b72);}(_0x7a54,0x106));var _0x47a5=function(_0x1b4e4f,_0x43b5a9){_0x1b4e4f=_0x1b4e4f-0x0;var _0x4b67dd=_0x7a54[_0x1b4e4f];return _0x4b67dd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x7a54,0x106));var _0x47a5=function(_0x42c3d2,_0x8329f1){_0x42c3d2=_0x42c3d2-0x0;var _0x325b8a=_0x7a54[_0x42c3d2];return _0x325b8a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 90595a9..4aeb47e 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 _0xe57e=['catch','GetCampaign','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x553646,_0x469ebf){var _0x3776fc=function(_0x538cb0){while(--_0x538cb0){_0x553646['push'](_0x553646['shift']());}};_0x3776fc(++_0x469ebf);}(_0xe57e,0xf2));var _0xee57=function(_0xb60cbf,_0x5c21e0){_0xb60cbf=_0xb60cbf-0x0;var _0x1f4aa3=_0xe57e[_0xb60cbf];return _0x1f4aa3;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var moment=require(_0xee57('0x1'));var BPromise=require(_0xee57('0x2'));var rs=require(_0xee57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee57('0x4'));var logger=require('../../config/logger')(_0xee57('0x5'));var config=require(_0xee57('0x6'));var jayson=require(_0xee57('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x408fef,_0x319905,_0x1ad277){return new BPromise(function(_0x342a62,_0x237efe){return client[_0xee57('0x8')](_0x408fef,_0x1ad277)[_0xee57('0x9')](function(_0x51db0c){logger['info'](_0xee57('0xa'),_0x319905,_0xee57('0xb'));logger[_0xee57('0xc')](_0xee57('0xd'),_0x319905,_0xee57('0xb'),JSON[_0xee57('0xe')](_0x51db0c));if(_0x51db0c[_0xee57('0xf')]){if(_0x51db0c['error']['code']===0x1f4){logger[_0xee57('0xf')](_0xee57('0xa'),_0x319905,_0x51db0c[_0xee57('0xf')][_0xee57('0x10')]);return _0x237efe(_0x51db0c[_0xee57('0xf')]['message']);}logger[_0xee57('0xf')]('Campaign,\x20%s,\x20%s',_0x319905,_0x51db0c[_0xee57('0xf')]['message']);return _0x342a62(_0x51db0c[_0xee57('0xf')]['message']);}else{logger['info'](_0xee57('0xa'),_0x319905,_0xee57('0xb'));_0x342a62(_0x51db0c[_0xee57('0x11')][_0xee57('0x10')]);}})['catch'](function(_0x40d08f){logger[_0xee57('0xf')]('Campaign,\x20%s,\x20%s',_0x319905,_0x40d08f);_0x237efe(_0x40d08f);});});}exports['GetCampaign']=function(_0x49656a){var _0x41e018=this;return new Promise(function(_0x558acc,_0x9a6461){return db[_0xee57('0x12')][_0xee57('0x13')]({'raw':_0x49656a[_0xee57('0x14')]?_0x49656a[_0xee57('0x14')][_0xee57('0x15')]===undefined?!![]:![]:!![],'where':_0x49656a['options']?_0x49656a[_0xee57('0x14')][_0xee57('0x16')]||null:null,'attributes':_0x49656a[_0xee57('0x14')]?_0x49656a['options']['attributes']||null:null,'limit':_0x49656a[_0xee57('0x14')]?_0x49656a['options'][_0xee57('0x17')]||null:null,'include':_0x49656a[_0xee57('0x14')]?_0x49656a['options'][_0xee57('0x18')]?_[_0xee57('0x19')](_0x49656a[_0xee57('0x14')][_0xee57('0x18')],function(_0x54a70b){return{'model':db[_0x54a70b[_0xee57('0x1a')]],'as':_0x54a70b['as'],'attributes':_0x54a70b[_0xee57('0x1b')],'include':_0x54a70b[_0xee57('0x18')]?_[_0xee57('0x19')](_0x54a70b[_0xee57('0x18')],function(_0x52d2f9){return{'model':db[_0x52d2f9[_0xee57('0x1a')]],'as':_0x52d2f9['as'],'attributes':_0x52d2f9[_0xee57('0x1b')],'include':_0x52d2f9['include']?_[_0xee57('0x19')](_0x52d2f9['include'],function(_0x5505c2){return{'model':db[_0x5505c2[_0xee57('0x1a')]],'as':_0x5505c2['as'],'attributes':_0x5505c2[_0xee57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xee57('0x9')](function(_0x2cb540){logger['info']('GetCampaign',_0x49656a);logger[_0xee57('0xc')]('GetCampaign',_0x49656a,JSON[_0xee57('0xe')](_0x2cb540));_0x558acc(_0x2cb540);})[_0xee57('0x1c')](function(_0x1c7079){logger[_0xee57('0xf')](_0xee57('0x1d'),_0x1c7079['message'],_0x49656a);_0x9a6461(_0x41e018[_0xee57('0xf')](0x1f4,_0x1c7079[_0xee57('0x10')]));});});}; \ No newline at end of file +var _0xcf95=['debug','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xcf95,0xa1));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5cf9('0x0'));var util=require(_0x5cf9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cf9('0x2'));var db=require(_0x5cf9('0x3'))['db'];var utils=require(_0x5cf9('0x4'));var logger=require(_0x5cf9('0x5'))('rpc');var config=require(_0x5cf9('0x6'));var jayson=require(_0x5cf9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c0c3a,_0x2d24df,_0x51acd7){return new BPromise(function(_0x26b0de,_0x233ccf){return client[_0x5cf9('0x8')](_0x1c0c3a,_0x51acd7)[_0x5cf9('0x9')](function(_0x435886){logger[_0x5cf9('0xa')](_0x5cf9('0xb'),_0x2d24df,_0x5cf9('0xc'));logger[_0x5cf9('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2d24df,_0x5cf9('0xc'),JSON[_0x5cf9('0xe')](_0x435886));if(_0x435886[_0x5cf9('0xf')]){if(_0x435886[_0x5cf9('0xf')]['code']===0x1f4){logger[_0x5cf9('0xf')](_0x5cf9('0xb'),_0x2d24df,_0x435886[_0x5cf9('0xf')][_0x5cf9('0x10')]);return _0x233ccf(_0x435886[_0x5cf9('0xf')][_0x5cf9('0x10')]);}logger[_0x5cf9('0xf')](_0x5cf9('0xb'),_0x2d24df,_0x435886['error'][_0x5cf9('0x10')]);return _0x26b0de(_0x435886[_0x5cf9('0xf')]['message']);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x2d24df,'request\x20sent');_0x26b0de(_0x435886[_0x5cf9('0x11')][_0x5cf9('0x10')]);}})[_0x5cf9('0x12')](function(_0x2f4d21){logger['error'](_0x5cf9('0xb'),_0x2d24df,_0x2f4d21);_0x233ccf(_0x2f4d21);});});}exports[_0x5cf9('0x13')]=function(_0x4ef361){var _0x48f233=this;return new Promise(function(_0x17e526,_0x1543d9){return db[_0x5cf9('0x14')][_0x5cf9('0x15')]({'raw':_0x4ef361[_0x5cf9('0x16')]?_0x4ef361['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ef361[_0x5cf9('0x16')]?_0x4ef361[_0x5cf9('0x16')][_0x5cf9('0x17')]||null:null,'attributes':_0x4ef361[_0x5cf9('0x16')]?_0x4ef361['options'][_0x5cf9('0x18')]||null:null,'limit':_0x4ef361[_0x5cf9('0x16')]?_0x4ef361[_0x5cf9('0x16')][_0x5cf9('0x19')]||null:null,'include':_0x4ef361['options']?_0x4ef361[_0x5cf9('0x16')][_0x5cf9('0x1a')]?_['map'](_0x4ef361[_0x5cf9('0x16')][_0x5cf9('0x1a')],function(_0x17d689){return{'model':db[_0x17d689[_0x5cf9('0x1b')]],'as':_0x17d689['as'],'attributes':_0x17d689[_0x5cf9('0x18')],'include':_0x17d689[_0x5cf9('0x1a')]?_[_0x5cf9('0x1c')](_0x17d689[_0x5cf9('0x1a')],function(_0x2bc8c6){return{'model':db[_0x2bc8c6['model']],'as':_0x2bc8c6['as'],'attributes':_0x2bc8c6[_0x5cf9('0x18')],'include':_0x2bc8c6['include']?_[_0x5cf9('0x1c')](_0x2bc8c6[_0x5cf9('0x1a')],function(_0x2831af){return{'model':db[_0x2831af[_0x5cf9('0x1b')]],'as':_0x2831af['as'],'attributes':_0x2831af[_0x5cf9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5cf9('0x9')](function(_0xac4c7e){logger[_0x5cf9('0xa')]('GetCampaign',_0x4ef361);logger[_0x5cf9('0xd')](_0x5cf9('0x13'),_0x4ef361,JSON[_0x5cf9('0xe')](_0xac4c7e));_0x17e526(_0xac4c7e);})['catch'](function(_0x57fde4){logger[_0x5cf9('0xf')]('GetCampaign',_0x57fde4[_0x5cf9('0x10')],_0x4ef361);_0x1543d9(_0x48f233[_0x5cf9('0xf')](0x1f4,_0x57fde4['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 1db82bb..aea0c42 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 _0x55c0=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x4798b0,_0x1570df){var _0x174a07=function(_0x7a72b5){while(--_0x7a72b5){_0x4798b0['push'](_0x4798b0['shift']());}};_0x174a07(++_0x1570df);}(_0x55c0,0x140));var _0x055c=function(_0x53ad5f,_0x165793){_0x53ad5f=_0x53ad5f-0x0;var _0x61e1da=_0x55c0[_0x53ad5f];return _0x61e1da;};'use strict';var multer=require(_0x055c('0x0'));var util=require('util');var path=require(_0x055c('0x1'));var timeout=require(_0x055c('0x2'));var express=require(_0x055c('0x3'));var router=express['Router']();var fs_extra=require(_0x055c('0x4'));var auth=require(_0x055c('0x5'));var interaction=require(_0x055c('0x6'));var config=require(_0x055c('0x7'));var controller=require(_0x055c('0x8'));router[_0x055c('0x9')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0xb')]);router[_0x055c('0x9')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0xd')]);router[_0x055c('0x9')](_0x055c('0xe'),auth[_0x055c('0xa')](),controller[_0x055c('0xf')]);router[_0x055c('0x9')](_0x055c('0x10'),auth[_0x055c('0xa')](),controller[_0x055c('0x11')]);router['get'](_0x055c('0x12'),auth[_0x055c('0xa')](),controller[_0x055c('0x13')]);router[_0x055c('0x9')](_0x055c('0x14'),auth[_0x055c('0xa')](),controller[_0x055c('0x15')]);router[_0x055c('0x9')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller['getLists']);router[_0x055c('0x9')]('/:id/blacklists',auth[_0x055c('0xa')](),controller[_0x055c('0x17')]);router[_0x055c('0x18')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0x19')]);router[_0x055c('0x18')](_0x055c('0x1a'),auth['isAuthenticated'](),controller[_0x055c('0x1b')]);router[_0x055c('0x18')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller['addLists']);router[_0x055c('0x18')](_0x055c('0x1c'),auth['isAuthenticated'](),controller[_0x055c('0x1d')]);router[_0x055c('0x1e')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0x1f')]);router[_0x055c('0x20')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0x21')]);router[_0x055c('0x20')](_0x055c('0x16'),auth[_0x055c('0xa')](),controller[_0x055c('0x22')]);router[_0x055c('0x20')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x055c('0x23')]);module[_0x055c('0x24')]=router; \ No newline at end of file +var _0xa96f=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer'];(function(_0xf3cbe3,_0x5e46d8){var _0x15f53b=function(_0x10d71b){while(--_0x10d71b){_0xf3cbe3['push'](_0xf3cbe3['shift']());}};_0x15f53b(++_0x5e46d8);}(_0xa96f,0x13a));var _0xfa96=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0xa96f[_0x21a2b3];return _0x4651a7;};'use strict';var multer=require(_0xfa96('0x0'));var util=require(_0xfa96('0x1'));var path=require(_0xfa96('0x2'));var timeout=require('connect-timeout');var express=require(_0xfa96('0x3'));var router=express[_0xfa96('0x4')]();var fs_extra=require(_0xfa96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa96('0x6'));var config=require(_0xfa96('0x7'));var controller=require(_0xfa96('0x8'));router[_0xfa96('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfa96('0x9')](_0xfa96('0xa'),auth[_0xfa96('0xb')](),controller['show']);router['get']('/:id/hoppers',auth[_0xfa96('0xb')](),controller[_0xfa96('0xc')]);router[_0xfa96('0x9')](_0xfa96('0xd'),auth['isAuthenticated'](),controller[_0xfa96('0xe')]);router['get'](_0xfa96('0xf'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x10')]);router[_0xfa96('0x9')](_0xfa96('0x11'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x12')]);router[_0xfa96('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xfa96('0x13')]);router[_0xfa96('0x9')]('/:id/blacklists',auth[_0xfa96('0xb')](),controller[_0xfa96('0x14')]);router[_0xfa96('0x15')]('/',auth['isAuthenticated'](),controller[_0xfa96('0x16')]);router['post'](_0xfa96('0x17'),auth[_0xfa96('0xb')](),controller['clone']);router['post'](_0xfa96('0x18'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x19')]);router['post'](_0xfa96('0x1a'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x1b')]);router[_0xfa96('0x1c')](_0xfa96('0xa'),auth['isAuthenticated'](),controller[_0xfa96('0x1d')]);router[_0xfa96('0x1e')](_0xfa96('0xa'),auth['isAuthenticated'](),controller[_0xfa96('0x1f')]);router['delete'](_0xfa96('0x18'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x20')]);router[_0xfa96('0x1e')](_0xfa96('0x1a'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x21')]);module[_0xfa96('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6e4e0b0..0ab8a79 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 _0x1b27=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0xce7822,_0x5d4996){var _0x1a24a7=function(_0x44b84f){while(--_0x44b84f){_0xce7822['push'](_0xce7822['shift']());}};_0x1a24a7(++_0x5d4996);}(_0x1b27,0x1d6));var _0x71b2=function(_0x2be841,_0xca59e6){_0x2be841=_0x2be841-0x0;var _0x20488d=_0x1b27[_0x2be841];return _0x20488d;};'use strict';var Sequelize=require(_0x71b2('0x0'));module[_0x71b2('0x1')]={'key':{'type':Sequelize[_0x71b2('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x71b2('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x71b2('0x2')]},'name':{'type':Sequelize[_0x71b2('0x4')],'get':function(){return this[_0x71b2('0x5')](_0x71b2('0x6'));}}}; \ No newline at end of file +var _0xbd23=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0xbd23,0x105));var _0x3bd2=function(_0x24609e,_0xb54b5f){_0x24609e=_0x24609e-0x0;var _0x458471=_0xbd23[_0x24609e];return _0x458471;};'use strict';var Sequelize=require('sequelize');module[_0x3bd2('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3bd2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3bd2('0x2')]},'name':{'type':Sequelize[_0x3bd2('0x3')],'get':function(){return this[_0x3bd2('0x4')](_0x3bd2('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 40461e8..ef89dc1 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 _0x1fa4=['sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','filter','merge','include','rows','catch','show','keys','length','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','error','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1fa4,0x19a));var _0x41fa=function(_0x395b50,_0x4e00d1){_0x395b50=_0x395b50-0x0;var _0x3b8e48=_0x1fa4[_0x395b50];return _0x3b8e48;};'use strict';var emlformat=require(_0x41fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41fa('0x2'));var moment=require('moment');var BPromise=require(_0x41fa('0x3'));var Mustache=require(_0x41fa('0x4'));var util=require('util');var path=require(_0x41fa('0x5'));var sox=require(_0x41fa('0x6'));var csv=require(_0x41fa('0x7'));var ejs=require(_0x41fa('0x8'));var fs=require('fs');var fs_extra=require(_0x41fa('0x9'));var _=require(_0x41fa('0xa'));var squel=require(_0x41fa('0xb'));var crypto=require(_0x41fa('0xc'));var jsforce=require(_0x41fa('0xd'));var deskjs=require(_0x41fa('0xe'));var toCsv=require(_0x41fa('0x7'));var querystring=require(_0x41fa('0xf'));var Papa=require(_0x41fa('0x10'));var Redis=require('ioredis');var authService=require(_0x41fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41fa('0x12'));var hardwareService=require(_0x41fa('0x13'));var logger=require(_0x41fa('0x14'))(_0x41fa('0x15'));var utils=require(_0x41fa('0x16'));var config=require(_0x41fa('0x17'));var licenseUtil=require(_0x41fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f4fb4,_0x5eaa65){_0x5eaa65=_0x5eaa65||0xcc;return function(_0x3466d3){if(_0x3466d3){return _0x3f4fb4[_0x41fa('0x19')](_0x5eaa65);}return _0x3f4fb4['status'](_0x5eaa65)[_0x41fa('0x1a')]();};}function respondWithResult(_0x2016e2,_0x4cbd16){_0x4cbd16=_0x4cbd16||0xc8;return function(_0x233b4b){if(_0x233b4b){return _0x2016e2['status'](_0x4cbd16)['json'](_0x233b4b);}};}function respondWithFilteredResult(_0x1aa38f,_0x4aea08){return function(_0x5b09db){if(_0x5b09db){var _0x34e0d5=typeof _0x4aea08[_0x41fa('0x1b')]===_0x41fa('0x1c')&&typeof _0x4aea08[_0x41fa('0x1d')]===_0x41fa('0x1c');var _0x310bc6=_0x5b09db[_0x41fa('0x1e')];var _0x1c888d=_0x34e0d5?0x0:_0x4aea08[_0x41fa('0x1b')];var _0x3ff97a=_0x34e0d5?_0x5b09db[_0x41fa('0x1e')]:_0x4aea08[_0x41fa('0x1b')]+_0x4aea08['limit'];var _0x4dc165;if(_0x3ff97a>=_0x310bc6){_0x3ff97a=_0x310bc6;_0x4dc165=0xc8;}else{_0x4dc165=0xce;}_0x1aa38f[_0x41fa('0x1f')](_0x4dc165);return _0x1aa38f[_0x41fa('0x20')](_0x41fa('0x21'),_0x1c888d+'-'+_0x3ff97a+'/'+_0x310bc6)['json'](_0x5b09db);}return null;};}function patchUpdates(_0x2b054c){return function(_0x1cba48){try{jsonpatch[_0x41fa('0x22')](_0x1cba48,_0x2b054c,!![]);}catch(_0x489926){return BPromise[_0x41fa('0x23')](_0x489926);}return _0x1cba48['save']();};}function saveUpdates(_0x2d7aaf,_0x580550){return function(_0x320b04){if(_0x320b04){return _0x320b04[_0x41fa('0x24')](_0x2d7aaf)['then'](function(_0x1727f9){return _0x1727f9;});}return null;};}function removeEntity(_0x4b06e6,_0x478304){return function(_0x3c6995){if(_0x3c6995){return _0x3c6995['destroy']()[_0x41fa('0x25')](function(){var _0xab281a=_0x3c6995[_0x41fa('0x26')]({'plain':!![]});var _0x369571=_0x41fa('0x27');return db[_0x41fa('0x28')][_0x41fa('0x29')]({'where':{'type':_0x369571,'resourceId':_0xab281a['id']}})['then'](function(){return _0x3c6995;});})[_0x41fa('0x25')](function(){_0x4b06e6[_0x41fa('0x1f')](0xcc)[_0x41fa('0x1a')]();});}};}function handleEntityNotFound(_0x4e42cb,_0x11913a){return function(_0x2914d7){if(!_0x2914d7){_0x4e42cb[_0x41fa('0x19')](0x194);}return _0x2914d7;};}function handleError(_0x52240d,_0x49bc79){_0x49bc79=_0x49bc79||0x1f4;return function(_0x4fa4c8){logger['error'](_0x4fa4c8[_0x41fa('0x2a')]);if(_0x4fa4c8[_0x41fa('0x2b')]){delete _0x4fa4c8[_0x41fa('0x2b')];}_0x52240d[_0x41fa('0x1f')](_0x49bc79)[_0x41fa('0x2c')](_0x4fa4c8);};}exports['index']=function(_0x124709,_0xd468c1){var _0x1f5566={},_0x383099={},_0x2061cc={'count':0x0,'rows':[]};var _0x5a9c0b=_[_0x41fa('0x2d')](db[_0x41fa('0x2e')][_0x41fa('0x2f')],function(_0x1e34f5){return{'name':_0x1e34f5[_0x41fa('0x30')],'type':_0x1e34f5[_0x41fa('0x31')][_0x41fa('0x32')]};});_0x383099[_0x41fa('0x33')]=_['map'](_0x5a9c0b,_0x41fa('0x2b'));_0x383099[_0x41fa('0x34')]=_['keys'](_0x124709[_0x41fa('0x34')]);_0x383099[_0x41fa('0x35')]=_[_0x41fa('0x36')](_0x383099['model'],_0x383099[_0x41fa('0x34')]);_0x1f5566[_0x41fa('0x37')]=_['intersection'](_0x383099[_0x41fa('0x33')],qs[_0x41fa('0x38')](_0x124709[_0x41fa('0x34')]['fields']));_0x1f5566[_0x41fa('0x37')]=_0x1f5566['attributes']['length']?_0x1f5566[_0x41fa('0x37')]:_0x383099[_0x41fa('0x33')];if(!_0x124709[_0x41fa('0x34')][_0x41fa('0x39')]('nolimit')){_0x1f5566['limit']=qs[_0x41fa('0x1d')](_0x124709[_0x41fa('0x34')][_0x41fa('0x1d')]);_0x1f5566[_0x41fa('0x1b')]=qs['offset'](_0x124709['query'][_0x41fa('0x1b')]);}_0x1f5566[_0x41fa('0x3a')]=qs[_0x41fa('0x3b')](_0x124709[_0x41fa('0x34')][_0x41fa('0x3b')]);_0x1f5566['where']=qs['filters'](_[_0x41fa('0x3c')](_0x124709['query'],_0x383099['filters']),_0x5a9c0b);if(_0x124709[_0x41fa('0x34')]['filter']){_0x1f5566['where']=_['merge'](_0x1f5566[_0x41fa('0x3d')],{'$or':[{'key':{'$like':'%'+_0x124709[_0x41fa('0x34')][_0x41fa('0x3e')]+'%'}},{'value':{'$like':'%'+_0x124709[_0x41fa('0x34')][_0x41fa('0x3e')]+'%'}}]});}_0x1f5566=_[_0x41fa('0x3f')]({},_0x1f5566,_0x124709['options']);var _0x3a85bc={'where':_0x1f5566[_0x41fa('0x3d')]};return db[_0x41fa('0x2e')][_0x41fa('0x1e')](_0x3a85bc)[_0x41fa('0x25')](function(_0x13dfd4){_0x2061cc[_0x41fa('0x1e')]=_0x13dfd4;if(_0x124709['query']['includeAll']){_0x1f5566[_0x41fa('0x40')]=[{'all':!![]}];}return db[_0x41fa('0x2e')]['findAll'](_0x1f5566);})[_0x41fa('0x25')](function(_0x4323a4){_0x2061cc[_0x41fa('0x41')]=_0x4323a4;return _0x2061cc;})['then'](respondWithFilteredResult(_0xd468c1,_0x1f5566))[_0x41fa('0x42')](handleError(_0xd468c1,null));};exports[_0x41fa('0x43')]=function(_0x3ed884,_0x1dd2ff){var _0x40100a={'raw':!![],'where':{'id':_0x3ed884['params']['id']}},_0x5ce64={};_0x5ce64['model']=_['keys'](db[_0x41fa('0x2e')][_0x41fa('0x2f')]);_0x5ce64['query']=_[_0x41fa('0x44')](_0x3ed884[_0x41fa('0x34')]);_0x5ce64[_0x41fa('0x35')]=_[_0x41fa('0x36')](_0x5ce64[_0x41fa('0x33')],_0x5ce64[_0x41fa('0x34')]);_0x40100a['attributes']=_[_0x41fa('0x36')](_0x5ce64[_0x41fa('0x33')],qs[_0x41fa('0x38')](_0x3ed884[_0x41fa('0x34')]['fields']));_0x40100a[_0x41fa('0x37')]=_0x40100a[_0x41fa('0x37')][_0x41fa('0x45')]?_0x40100a[_0x41fa('0x37')]:_0x5ce64[_0x41fa('0x33')];if(_0x3ed884[_0x41fa('0x34')][_0x41fa('0x46')]){_0x40100a[_0x41fa('0x40')]=[{'all':!![]}];}_0x40100a=_[_0x41fa('0x3f')]({},_0x40100a,_0x3ed884['options']);return db[_0x41fa('0x2e')][_0x41fa('0x47')](_0x40100a)['then'](handleEntityNotFound(_0x1dd2ff,null))['then'](respondWithResult(_0x1dd2ff,null))[_0x41fa('0x42')](handleError(_0x1dd2ff,null));};exports[_0x41fa('0x24')]=function(_0x55de8d,_0x51c522){if(_0x55de8d[_0x41fa('0x48')]['id']){delete _0x55de8d[_0x41fa('0x48')]['id'];}return db['CannedAnswer'][_0x41fa('0x47')]({'where':{'id':_0x55de8d[_0x41fa('0x49')]['id']}})[_0x41fa('0x25')](handleEntityNotFound(_0x51c522,null))['then'](saveUpdates(_0x55de8d[_0x41fa('0x48')],null))['then'](respondWithResult(_0x51c522,null))['catch'](handleError(_0x51c522,null));};exports[_0x41fa('0x29')]=function(_0x15d24e,_0x3fb80d){return db[_0x41fa('0x2e')][_0x41fa('0x47')]({'where':{'id':_0x15d24e[_0x41fa('0x49')]['id']}})['then'](handleEntityNotFound(_0x3fb80d,null))['then'](removeEntity(_0x3fb80d,null))['catch'](handleError(_0x3fb80d,null));};exports[_0x41fa('0x4a')]=function(_0x274ed2,_0x2a0b95){var _0x2cef07={'key':_0x274ed2[_0x41fa('0x48')][_0x41fa('0x32')]};if(_0x274ed2['body']['MailAccountId']){_0x2cef07[_0x41fa('0x4b')]=_0x274ed2[_0x41fa('0x48')]['MailAccountId'];}else if(_0x274ed2['body'][_0x41fa('0x4c')]){_0x2cef07['SmsAccountId']=_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4c')];}else if(_0x274ed2[_0x41fa('0x48')]['OpenchannelAccountId']){_0x2cef07[_0x41fa('0x4d')]=_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4d')];}else if(_0x274ed2[_0x41fa('0x48')][_0x41fa('0x4e')]){_0x2cef07[_0x41fa('0x4e')]=_0x274ed2['body'][_0x41fa('0x4e')];}return db[_0x41fa('0x2e')][_0x41fa('0x47')]({'where':_0x2cef07})[_0x41fa('0x25')](function(_0x50d12c){if(_0x50d12c){throw new db[(_0x41fa('0x4f'))][(_0x41fa('0x50'))](_0x41fa('0x51'));}return db['CannedAnswer'][_0x41fa('0x4a')](_0x274ed2[_0x41fa('0x48')]);})[_0x41fa('0x25')](function(_0x8906e9){var _0x3c5388=_0x274ed2[_0x41fa('0x52')][_0x41fa('0x26')]({'plain':!![]});if(!_0x3c5388)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5388[_0x41fa('0x53')]===_0x41fa('0x52')){var _0x35f857=_0x8906e9[_0x41fa('0x26')]({'plain':!![]});return db[_0x41fa('0x54')][_0x41fa('0x47')]({'where':{'name':_0x41fa('0x27'),'userProfileId':_0x3c5388['userProfileId']},'raw':!![]})[_0x41fa('0x25')](function(_0x12887b){if(_0x12887b&&_0x12887b[_0x41fa('0x55')]===0x0){return db['UserProfileResource'][_0x41fa('0x4a')]({'name':_0x35f857[_0x41fa('0x2b')],'resourceId':_0x35f857['id'],'type':_0x12887b[_0x41fa('0x2b')],'sectionId':_0x12887b['id']},{})[_0x41fa('0x25')](function(){return _0x8906e9;});}else{return _0x8906e9;}})[_0x41fa('0x42')](function(_0xec699c){logger[_0x41fa('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xec699c);throw _0xec699c;});}return _0x8906e9;})[_0x41fa('0x25')](respondWithResult(_0x2a0b95,0xc9))['catch'](handleError(_0x2a0b95,null));}; \ No newline at end of file +var _0x4df9=['name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','find','body','params','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack'];(function(_0x417e0a,_0x446db8){var _0x223dab=function(_0x56978c){while(--_0x56978c){_0x417e0a['push'](_0x417e0a['shift']());}};_0x223dab(++_0x446db8);}(_0x4df9,0x188));var _0x94df=function(_0x26f466,_0x10f4d1){_0x26f466=_0x26f466-0x0;var _0x13e44c=_0x4df9[_0x26f466];return _0x13e44c;};'use strict';var emlformat=require(_0x94df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94df('0x1'));var jsonpatch=require(_0x94df('0x2'));var rp=require(_0x94df('0x3'));var moment=require('moment');var BPromise=require(_0x94df('0x4'));var Mustache=require(_0x94df('0x5'));var util=require(_0x94df('0x6'));var path=require(_0x94df('0x7'));var sox=require(_0x94df('0x8'));var csv=require(_0x94df('0x9'));var ejs=require(_0x94df('0xa'));var fs=require('fs');var fs_extra=require(_0x94df('0xb'));var _=require(_0x94df('0xc'));var squel=require(_0x94df('0xd'));var crypto=require('crypto');var jsforce=require(_0x94df('0xe'));var deskjs=require(_0x94df('0xf'));var toCsv=require(_0x94df('0x9'));var querystring=require(_0x94df('0x10'));var Papa=require(_0x94df('0x11'));var Redis=require(_0x94df('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94df('0x13'));var logger=require(_0x94df('0x14'))('api');var utils=require(_0x94df('0x15'));var config=require(_0x94df('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x94df('0x17'))['db'];function respondWithStatusCode(_0x1cd813,_0x243d5f){_0x243d5f=_0x243d5f||0xcc;return function(_0x1f2f91){if(_0x1f2f91){return _0x1cd813[_0x94df('0x18')](_0x243d5f);}return _0x1cd813[_0x94df('0x19')](_0x243d5f)[_0x94df('0x1a')]();};}function respondWithResult(_0x4bd4e3,_0x89d832){_0x89d832=_0x89d832||0xc8;return function(_0x2fa201){if(_0x2fa201){return _0x4bd4e3[_0x94df('0x19')](_0x89d832)[_0x94df('0x1b')](_0x2fa201);}};}function respondWithFilteredResult(_0x3bf4e1,_0x42893c){return function(_0x5abfc8){if(_0x5abfc8){var _0x9c9698=typeof _0x42893c[_0x94df('0x1c')]===_0x94df('0x1d')&&typeof _0x42893c[_0x94df('0x1e')]==='undefined';var _0x5ac712=_0x5abfc8['count'];var _0x2ab380=_0x9c9698?0x0:_0x42893c[_0x94df('0x1c')];var _0x15c282=_0x9c9698?_0x5abfc8[_0x94df('0x1f')]:_0x42893c[_0x94df('0x1c')]+_0x42893c[_0x94df('0x1e')];var _0x41140e;if(_0x15c282>=_0x5ac712){_0x15c282=_0x5ac712;_0x41140e=0xc8;}else{_0x41140e=0xce;}_0x3bf4e1[_0x94df('0x19')](_0x41140e);return _0x3bf4e1[_0x94df('0x20')](_0x94df('0x21'),_0x2ab380+'-'+_0x15c282+'/'+_0x5ac712)[_0x94df('0x1b')](_0x5abfc8);}return null;};}function patchUpdates(_0x50e528){return function(_0x7e2c4e){try{jsonpatch['apply'](_0x7e2c4e,_0x50e528,!![]);}catch(_0x59ad41){return BPromise[_0x94df('0x22')](_0x59ad41);}return _0x7e2c4e[_0x94df('0x23')]();};}function saveUpdates(_0x43bce7,_0x45ed10){return function(_0x3b4c2c){if(_0x3b4c2c){return _0x3b4c2c[_0x94df('0x24')](_0x43bce7)[_0x94df('0x25')](function(_0x540270){return _0x540270;});}return null;};}function removeEntity(_0x5c6bb9,_0x23f290){return function(_0x715b2a){if(_0x715b2a){return _0x715b2a[_0x94df('0x26')]()[_0x94df('0x25')](function(){var _0x25b618=_0x715b2a[_0x94df('0x27')]({'plain':!![]});var _0x23769c='CannedAnswers';return db[_0x94df('0x28')][_0x94df('0x26')]({'where':{'type':_0x23769c,'resourceId':_0x25b618['id']}})[_0x94df('0x25')](function(){return _0x715b2a;});})['then'](function(){_0x5c6bb9[_0x94df('0x19')](0xcc)[_0x94df('0x1a')]();});}};}function handleEntityNotFound(_0x2f2fe4,_0x3e620a){return function(_0x3ea564){if(!_0x3ea564){_0x2f2fe4[_0x94df('0x18')](0x194);}return _0x3ea564;};}function handleError(_0x41df21,_0x4c8dd8){_0x4c8dd8=_0x4c8dd8||0x1f4;return function(_0x3c9315){logger[_0x94df('0x29')](_0x3c9315[_0x94df('0x2a')]);if(_0x3c9315[_0x94df('0x2b')]){delete _0x3c9315[_0x94df('0x2b')];}_0x41df21[_0x94df('0x19')](_0x4c8dd8)['send'](_0x3c9315);};}exports[_0x94df('0x2c')]=function(_0x5bac0c,_0x1cf972){var _0x2a4327={},_0x3d8c47={},_0x1dfe0d={'count':0x0,'rows':[]};var _0x4daf06=_[_0x94df('0x2d')](db[_0x94df('0x2e')][_0x94df('0x2f')],function(_0x92c6f){return{'name':_0x92c6f[_0x94df('0x30')],'type':_0x92c6f[_0x94df('0x31')][_0x94df('0x32')]};});_0x3d8c47[_0x94df('0x33')]=_[_0x94df('0x2d')](_0x4daf06,_0x94df('0x2b'));_0x3d8c47[_0x94df('0x34')]=_[_0x94df('0x35')](_0x5bac0c[_0x94df('0x34')]);_0x3d8c47[_0x94df('0x36')]=_[_0x94df('0x37')](_0x3d8c47[_0x94df('0x33')],_0x3d8c47[_0x94df('0x34')]);_0x2a4327[_0x94df('0x38')]=_[_0x94df('0x37')](_0x3d8c47[_0x94df('0x33')],qs[_0x94df('0x39')](_0x5bac0c['query'][_0x94df('0x39')]));_0x2a4327[_0x94df('0x38')]=_0x2a4327[_0x94df('0x38')][_0x94df('0x3a')]?_0x2a4327[_0x94df('0x38')]:_0x3d8c47[_0x94df('0x33')];if(!_0x5bac0c['query'][_0x94df('0x3b')](_0x94df('0x3c'))){_0x2a4327[_0x94df('0x1e')]=qs[_0x94df('0x1e')](_0x5bac0c[_0x94df('0x34')][_0x94df('0x1e')]);_0x2a4327[_0x94df('0x1c')]=qs['offset'](_0x5bac0c[_0x94df('0x34')][_0x94df('0x1c')]);}_0x2a4327[_0x94df('0x3d')]=qs[_0x94df('0x3e')](_0x5bac0c[_0x94df('0x34')]['sort']);_0x2a4327[_0x94df('0x3f')]=qs[_0x94df('0x36')](_[_0x94df('0x40')](_0x5bac0c['query'],_0x3d8c47[_0x94df('0x36')]),_0x4daf06);if(_0x5bac0c[_0x94df('0x34')][_0x94df('0x41')]){_0x2a4327[_0x94df('0x3f')]=_['merge'](_0x2a4327[_0x94df('0x3f')],{'$or':[{'key':{'$like':'%'+_0x5bac0c[_0x94df('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x5bac0c['query'][_0x94df('0x41')]+'%'}}]});}_0x2a4327=_['merge']({},_0x2a4327,_0x5bac0c[_0x94df('0x42')]);var _0xac77fe={'where':_0x2a4327[_0x94df('0x3f')]};return db[_0x94df('0x2e')][_0x94df('0x1f')](_0xac77fe)['then'](function(_0x1010a3){_0x1dfe0d[_0x94df('0x1f')]=_0x1010a3;if(_0x5bac0c[_0x94df('0x34')][_0x94df('0x43')]){_0x2a4327[_0x94df('0x44')]=[{'all':!![]}];}return db[_0x94df('0x2e')][_0x94df('0x45')](_0x2a4327);})[_0x94df('0x25')](function(_0x46758b){_0x1dfe0d[_0x94df('0x46')]=_0x46758b;return _0x1dfe0d;})['then'](respondWithFilteredResult(_0x1cf972,_0x2a4327))['catch'](handleError(_0x1cf972,null));};exports['show']=function(_0x907d3,_0x5f1e7b){var _0x5703e7={'raw':!![],'where':{'id':_0x907d3['params']['id']}},_0x531e41={};_0x531e41[_0x94df('0x33')]=_[_0x94df('0x35')](db[_0x94df('0x2e')]['rawAttributes']);_0x531e41[_0x94df('0x34')]=_['keys'](_0x907d3[_0x94df('0x34')]);_0x531e41[_0x94df('0x36')]=_[_0x94df('0x37')](_0x531e41[_0x94df('0x33')],_0x531e41[_0x94df('0x34')]);_0x5703e7['attributes']=_[_0x94df('0x37')](_0x531e41[_0x94df('0x33')],qs[_0x94df('0x39')](_0x907d3[_0x94df('0x34')]['fields']));_0x5703e7['attributes']=_0x5703e7[_0x94df('0x38')][_0x94df('0x3a')]?_0x5703e7['attributes']:_0x531e41[_0x94df('0x33')];if(_0x907d3['query'][_0x94df('0x43')]){_0x5703e7[_0x94df('0x44')]=[{'all':!![]}];}_0x5703e7=_['merge']({},_0x5703e7,_0x907d3['options']);return db[_0x94df('0x2e')][_0x94df('0x47')](_0x5703e7)[_0x94df('0x25')](handleEntityNotFound(_0x5f1e7b,null))[_0x94df('0x25')](respondWithResult(_0x5f1e7b,null))['catch'](handleError(_0x5f1e7b,null));};exports[_0x94df('0x24')]=function(_0x3fec46,_0x14f3a8){if(_0x3fec46[_0x94df('0x48')]['id']){delete _0x3fec46[_0x94df('0x48')]['id'];}return db[_0x94df('0x2e')][_0x94df('0x47')]({'where':{'id':_0x3fec46[_0x94df('0x49')]['id']}})[_0x94df('0x25')](handleEntityNotFound(_0x14f3a8,null))[_0x94df('0x25')](saveUpdates(_0x3fec46[_0x94df('0x48')],null))[_0x94df('0x25')](respondWithResult(_0x14f3a8,null))[_0x94df('0x4a')](handleError(_0x14f3a8,null));};exports[_0x94df('0x26')]=function(_0x131255,_0x57b671){return db[_0x94df('0x2e')][_0x94df('0x47')]({'where':{'id':_0x131255[_0x94df('0x49')]['id']}})[_0x94df('0x25')](handleEntityNotFound(_0x57b671,null))['then'](removeEntity(_0x57b671,null))[_0x94df('0x4a')](handleError(_0x57b671,null));};exports['create']=function(_0x194bef,_0xb874e9){var _0x4fa83c={'key':_0x194bef[_0x94df('0x48')][_0x94df('0x32')]};if(_0x194bef[_0x94df('0x48')][_0x94df('0x4b')]){_0x4fa83c[_0x94df('0x4b')]=_0x194bef['body'][_0x94df('0x4b')];}else if(_0x194bef[_0x94df('0x48')][_0x94df('0x4c')]){_0x4fa83c['SmsAccountId']=_0x194bef[_0x94df('0x48')][_0x94df('0x4c')];}else if(_0x194bef[_0x94df('0x48')][_0x94df('0x4d')]){_0x4fa83c[_0x94df('0x4d')]=_0x194bef[_0x94df('0x48')][_0x94df('0x4d')];}else if(_0x194bef[_0x94df('0x48')]['ChatWebsiteId']){_0x4fa83c[_0x94df('0x4e')]=_0x194bef[_0x94df('0x48')][_0x94df('0x4e')];}return db['CannedAnswer'][_0x94df('0x47')]({'where':_0x4fa83c})['then'](function(_0x35a203){if(_0x35a203){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x94df('0x2e')]['create'](_0x194bef[_0x94df('0x48')]);})[_0x94df('0x25')](function(_0x4427bc){var _0x5f3d8e=_0x194bef['user'][_0x94df('0x27')]({'plain':!![]});if(!_0x5f3d8e)throw new Error(_0x94df('0x4f'));if(_0x5f3d8e[_0x94df('0x50')]===_0x94df('0x51')){var _0x47fb66=_0x4427bc[_0x94df('0x27')]({'plain':!![]});return db[_0x94df('0x52')]['find']({'where':{'name':_0x94df('0x53'),'userProfileId':_0x5f3d8e[_0x94df('0x54')]},'raw':!![]})['then'](function(_0x1a0ddd){if(_0x1a0ddd&&_0x1a0ddd[_0x94df('0x55')]===0x0){return db[_0x94df('0x28')]['create']({'name':_0x47fb66[_0x94df('0x2b')],'resourceId':_0x47fb66['id'],'type':_0x1a0ddd[_0x94df('0x2b')],'sectionId':_0x1a0ddd['id']},{})[_0x94df('0x25')](function(){return _0x4427bc;});}else{return _0x4427bc;}})[_0x94df('0x4a')](function(_0x14637d){logger['error'](_0x94df('0x56'),_0x14637d);throw _0x14637d;});}return _0x4427bc;})[_0x94df('0x25')](respondWithResult(_0xb874e9,0xc9))['catch'](handleError(_0xb874e9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f003b30..886fc31 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 _0xfac4=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x2b0a9e,_0x4fd2bd){var _0x188644=function(_0x5de8ff){while(--_0x5de8ff){_0x2b0a9e['push'](_0x2b0a9e['shift']());}};_0x188644(++_0x4fd2bd);}(_0xfac4,0x8e));var _0x4fac=function(_0x34fa02,_0x39ae8e){_0x34fa02=_0x34fa02-0x0;var _0x5df5be=_0xfac4[_0x34fa02];return _0x5df5be;};'use strict';var _=require(_0x4fac('0x0'));var util=require('util');var logger=require(_0x4fac('0x1'))('api');var moment=require(_0x4fac('0x2'));var BPromise=require(_0x4fac('0x3'));var rp=require(_0x4fac('0x4'));var fs=require('fs');var path=require(_0x4fac('0x5'));var rimraf=require(_0x4fac('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fac('0x7'));module['exports']=function(_0x3ee32b,_0x19ca05){return _0x3ee32b[_0x4fac('0x8')]('CannedAnswer',attributes,{'tableName':_0x4fac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fac('0xa'),'collate':_0x4fac('0xb')});}; \ No newline at end of file +var _0xff8a=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xff8a,0x167));var _0xaff8=function(_0x3d9b55,_0x54c90d){_0x3d9b55=_0x3d9b55-0x0;var _0x488a43=_0xff8a[_0x3d9b55];return _0x488a43;};'use strict';var _=require(_0xaff8('0x0'));var util=require(_0xaff8('0x1'));var logger=require(_0xaff8('0x2'))(_0xaff8('0x3'));var moment=require(_0xaff8('0x4'));var BPromise=require(_0xaff8('0x5'));var rp=require(_0xaff8('0x6'));var fs=require('fs');var path=require(_0xaff8('0x7'));var rimraf=require(_0xaff8('0x8'));var config=require(_0xaff8('0x9'));var attributes=require(_0xaff8('0xa'));module['exports']=function(_0x5f156b,_0x28fc71){return _0x5f156b['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaff8('0xb'),'collate':_0xaff8('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b4742a9..e37db93 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(_0x4b6d20,_0x2a74ea){var _0x328d76=function(_0x26ab5a){while(--_0x26ab5a){_0x4b6d20['push'](_0x4b6d20['shift']());}};_0x328d76(++_0x2a74ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x5e4211,_0x282c96){var _0x27f5ea=function(_0x1c1bfa){while(--_0x1c1bfa){_0x5e4211['push'](_0x5e4211['shift']());}};_0x27f5ea(++_0x282c96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 2b1b273..a89abb6 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 _0x5ecf=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get'];(function(_0x568fd1,_0x48ba5d){var _0x1f0a37=function(_0xc56b5){while(--_0xc56b5){_0x568fd1['push'](_0x568fd1['shift']());}};_0x1f0a37(++_0x48ba5d);}(_0x5ecf,0xa0));var _0xf5ec=function(_0xcbb362,_0x25298d){_0xcbb362=_0xcbb362-0x0;var _0x40b347=_0x5ecf[_0xcbb362];return _0x40b347;};'use strict';var multer=require(_0xf5ec('0x0'));var util=require(_0xf5ec('0x1'));var path=require(_0xf5ec('0x2'));var timeout=require(_0xf5ec('0x3'));var express=require(_0xf5ec('0x4'));var router=express[_0xf5ec('0x5')]();var fs_extra=require(_0xf5ec('0x6'));var auth=require(_0xf5ec('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf5ec('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xf5ec('0x9')](),controller['index']);router[_0xf5ec('0xa')](_0xf5ec('0xb'),auth[_0xf5ec('0x9')](),controller[_0xf5ec('0xc')]);router[_0xf5ec('0xd')]('/',auth[_0xf5ec('0x9')](),controller['create']);router[_0xf5ec('0xe')](_0xf5ec('0xb'),auth['isAuthenticated'](),controller[_0xf5ec('0xf')]);router[_0xf5ec('0x10')](_0xf5ec('0xb'),auth[_0xf5ec('0x9')](),controller[_0xf5ec('0x11')]);module[_0xf5ec('0x12')]=router; \ No newline at end of file +var _0x4bf0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','multer','util','express'];(function(_0x1e1364,_0x124c56){var _0x5079d9=function(_0x379865){while(--_0x379865){_0x1e1364['push'](_0x1e1364['shift']());}};_0x5079d9(++_0x124c56);}(_0x4bf0,0x189));var _0x04bf=function(_0xae59e9,_0x1966ae){_0xae59e9=_0xae59e9-0x0;var _0x19dd95=_0x4bf0[_0xae59e9];return _0x19dd95;};'use strict';var multer=require(_0x04bf('0x0'));var util=require(_0x04bf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x04bf('0x2'));var router=express[_0x04bf('0x3')]();var fs_extra=require(_0x04bf('0x4'));var auth=require(_0x04bf('0x5'));var interaction=require(_0x04bf('0x6'));var config=require(_0x04bf('0x7'));var controller=require(_0x04bf('0x8'));router['get']('/',auth[_0x04bf('0x9')](),controller[_0x04bf('0xa')]);router[_0x04bf('0xb')](_0x04bf('0xc'),auth[_0x04bf('0x9')](),controller[_0x04bf('0xd')]);router[_0x04bf('0xe')]('/',auth['isAuthenticated'](),controller[_0x04bf('0xf')]);router['put'](_0x04bf('0xc'),auth[_0x04bf('0x9')](),controller['update']);router[_0x04bf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x04bf('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a935076..9316772 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 _0xbfa6=['sequelize','exports','STRING','INTEGER'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0xbfa6,0x1d0));var _0x6bfa=function(_0x481604,_0x276ff8){_0x481604=_0x481604-0x0;var _0x1ca4ed=_0xbfa6[_0x481604];return _0x1ca4ed;};'use strict';var Sequelize=require(_0x6bfa('0x0'));module[_0x6bfa('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6bfa('0x2')]},'dst':{'type':Sequelize[_0x6bfa('0x2')]},'dcontext':{'type':Sequelize[_0x6bfa('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6bfa('0x2')]},'lastapp':{'type':Sequelize[_0x6bfa('0x2')]},'lastdata':{'type':Sequelize[_0x6bfa('0x2')]},'duration':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6bfa('0x2')]},'amaflags':{'type':Sequelize[_0x6bfa('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6bfa('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x6bfa('0x2')]},'sequence':{'type':Sequelize[_0x6bfa('0x2')]},'peeraccount':{'type':Sequelize[_0x6bfa('0x2')]},'type':{'type':Sequelize[_0x6bfa('0x2')]},'tag':{'type':Sequelize[_0x6bfa('0x2')]}}; \ No newline at end of file +var _0xe148=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x3f9ec3,_0x3dfd37){var _0xe85b13=function(_0x10e8ed){while(--_0x10e8ed){_0x3f9ec3['push'](_0x3f9ec3['shift']());}};_0xe85b13(++_0x3dfd37);}(_0xe148,0x9e));var _0x8e14=function(_0x2a829f,_0x1b0c15){_0x2a829f=_0x2a829f-0x0;var _0x5737c3=_0xe148[_0x2a829f];return _0x5737c3;};'use strict';var Sequelize=require(_0x8e14('0x0'));module[_0x8e14('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x8e14('0x2')},'clid':{'type':Sequelize[_0x8e14('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8e14('0x3')]},'dcontext':{'type':Sequelize[_0x8e14('0x3')]},'channel':{'type':Sequelize[_0x8e14('0x3')]},'dstchannel':{'type':Sequelize[_0x8e14('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8e14('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8e14('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8e14('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8e14('0x3')]},'userfield':{'type':Sequelize[_0x8e14('0x3')]},'uniqueid':{'type':Sequelize[_0x8e14('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8e14('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8e14('0x3')]},'tag':{'type':Sequelize[_0x8e14('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index fdca4a1..0f09038 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 _0xdd0c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x45f42e,_0x417bb){var _0x5704b6=function(_0x4d1621){while(--_0x4d1621){_0x45f42e['push'](_0x45f42e['shift']());}};_0x5704b6(++_0x417bb);}(_0xdd0c,0x165));var _0xcdd0=function(_0x4a3185,_0x44080f){_0x4a3185=_0x4a3185-0x0;var _0x300bd6=_0xdd0c[_0x4a3185];return _0x300bd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={},_0xd6d64f={},_0x1bbe37={'count':0x0,'rows':[]};var _0x5b8635=_[_0xcdd0('0x2a')](db[_0xcdd0('0x2b')][_0xcdd0('0x2c')],function(_0x477d1a){return{'name':_0x477d1a[_0xcdd0('0x2d')],'type':_0x477d1a['type'][_0xcdd0('0x2e')]};});_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x2a')](_0x5b8635,'name');_0xd6d64f['query']=_[_0xcdd0('0x30')](_0x4074e0[_0xcdd0('0x31')]);_0xd6d64f[_0xcdd0('0x32')]=_['intersection'](_0xd6d64f[_0xcdd0('0x2f')],_0xd6d64f[_0xcdd0('0x31')]);_0x28084c['attributes']=_[_0xcdd0('0x33')](_0xd6d64f[_0xcdd0('0x2f')],qs[_0xcdd0('0x34')](_0x4074e0[_0xcdd0('0x31')]['fields']));_0x28084c[_0xcdd0('0x35')]=_0x28084c[_0xcdd0('0x35')]['length']?_0x28084c[_0xcdd0('0x35')]:_0xd6d64f[_0xcdd0('0x2f')];if(!_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x36')]('nolimit')){_0x28084c[_0xcdd0('0x1d')]=qs[_0xcdd0('0x1d')](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x1d')]);_0x28084c[_0xcdd0('0x1b')]=qs['offset'](_0x4074e0[_0xcdd0('0x31')]['offset']);}_0x28084c['order']=qs['sort'](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x37')]);_0x28084c[_0xcdd0('0x38')]=qs[_0xcdd0('0x32')](_[_0xcdd0('0x39')](_0x4074e0[_0xcdd0('0x31')],_0xd6d64f[_0xcdd0('0x32')]),_0x5b8635);if(_0x4074e0['query'][_0xcdd0('0x3a')]){_0x28084c[_0xcdd0('0x38')]=_[_0xcdd0('0x3b')](_0x28084c[_0xcdd0('0x38')],{'$or':_['map'](_0x5b8635,function(_0x4934a5){if(_0x4934a5[_0xcdd0('0x3c')]!==_0xcdd0('0x3d')){var _0x47a5f5={};_0x47a5f5[_0x4934a5[_0xcdd0('0x27')]]={'$like':'%'+_0x4074e0[_0xcdd0('0x31')]['filter']+'%'};return _0x47a5f5;}})});}_0x28084c=_[_0xcdd0('0x3b')]({},_0x28084c,_0x4074e0['options']);var _0x41ce22={'where':_0x28084c['where']};return db[_0xcdd0('0x2b')][_0xcdd0('0x1e')](_0x41ce22)[_0xcdd0('0x3e')](function(_0x271f47){_0x1bbe37['count']=_0x271f47;if(_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x28084c['include']=[{'all':!![]}];}return db[_0xcdd0('0x2b')][_0xcdd0('0x40')](_0x28084c);})[_0xcdd0('0x3e')](function(_0x27ce74){_0x1bbe37[_0xcdd0('0x41')]=_0x27ce74;return _0x1bbe37;})[_0xcdd0('0x3e')](respondWithFilteredResult(_0x49cfe0,_0x28084c))[_0xcdd0('0x42')](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x43')]=function(_0x375e89,_0xce8a50){var _0x5f0c94={'raw':!![],'where':{'id':_0x375e89['params']['id']}},_0x2718b3={};_0x2718b3['model']=_[_0xcdd0('0x30')](db['Cdr'][_0xcdd0('0x2c')]);_0x2718b3[_0xcdd0('0x31')]=_[_0xcdd0('0x30')](_0x375e89[_0xcdd0('0x31')]);_0x2718b3[_0xcdd0('0x32')]=_['intersection'](_0x2718b3[_0xcdd0('0x2f')],_0x2718b3['query']);_0x5f0c94['attributes']=_[_0xcdd0('0x33')](_0x2718b3[_0xcdd0('0x2f')],qs['fields'](_0x375e89['query']['fields']));_0x5f0c94[_0xcdd0('0x35')]=_0x5f0c94[_0xcdd0('0x35')][_0xcdd0('0x44')]?_0x5f0c94['attributes']:_0x2718b3[_0xcdd0('0x2f')];if(_0x375e89[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x5f0c94[_0xcdd0('0x45')]=[{'all':!![]}];}_0x5f0c94=_[_0xcdd0('0x3b')]({},_0x5f0c94,_0x375e89['options']);return db[_0xcdd0('0x2b')]['find'](_0x5f0c94)[_0xcdd0('0x3e')](handleEntityNotFound(_0xce8a50,null))[_0xcdd0('0x3e')](respondWithResult(_0xce8a50,null))[_0xcdd0('0x42')](handleError(_0xce8a50,null));};exports[_0xcdd0('0x46')]=function(_0x265cfb,_0x2fc567){return db[_0xcdd0('0x2b')][_0xcdd0('0x46')](_0x265cfb[_0xcdd0('0x47')],{})[_0xcdd0('0x3e')](respondWithResult(_0x2fc567,0xc9))[_0xcdd0('0x42')](handleError(_0x2fc567,null));};exports[_0xcdd0('0x23')]=function(_0x3afae8,_0x6c2cb8){if(_0x3afae8[_0xcdd0('0x47')]['id']){delete _0x3afae8['body']['id'];}return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x3afae8[_0xcdd0('0x49')]['id']}})[_0xcdd0('0x3e')](handleEntityNotFound(_0x6c2cb8,null))[_0xcdd0('0x3e')](saveUpdates(_0x3afae8[_0xcdd0('0x47')],null))[_0xcdd0('0x3e')](respondWithResult(_0x6c2cb8,null))[_0xcdd0('0x42')](handleError(_0x6c2cb8,null));};exports[_0xcdd0('0x24')]=function(_0x214cdd,_0x36156c){return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x214cdd[_0xcdd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x36156c,null))[_0xcdd0('0x3e')](removeEntity(_0x36156c,null))[_0xcdd0('0x42')](handleError(_0x36156c,null));};exports[_0xcdd0('0x4a')]=function(_0xc7370e,_0x46c578){return db[_0xcdd0('0x2b')][_0xcdd0('0x4a')]()['then'](respondWithResult(_0x46c578,null))[_0xcdd0('0x42')](handleError(_0x46c578,null));}; \ No newline at end of file +var _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0x2503aa,_0x4ea0db){var _0x44f5e2=function(_0x49ca0d){while(--_0x49ca0d){_0x2503aa['push'](_0x2503aa['shift']());}};_0x44f5e2(++_0x4ea0db);}(_0x826a,0x1aa));var _0xa826=function(_0x2a05a2,_0x3cc0e7){_0x2a05a2=_0x2a05a2-0x0;var _0x533dfb=_0x826a[_0x2a05a2];return _0x533dfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2d9464b..29b0b7e 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(_0xa6de94,_0x571d3e){var _0x5bc7ee=function(_0x21ad06){while(--_0x21ad06){_0xa6de94['push'](_0xa6de94['shift']());}};_0x5bc7ee(++_0x571d3e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x644fa9,_0x5e4b7b){var _0xb694c0=function(_0x25b5f1){while(--_0x25b5f1){_0x644fa9['push'](_0x644fa9['shift']());}};_0xb694c0(++_0x5e4b7b);}(_0x7a54,0x106));var _0x47a5=function(_0x3ac686,_0x51eb54){_0x3ac686=_0x3ac686-0x0;var _0x53dfb3=_0x7a54[_0x3ac686];return _0x53dfb3;};'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 b60e0ce..f55beea 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 _0x0c3f=['debug','error','message','info','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x20b53d,_0x49b4fe){var _0x1b7bcb=function(_0x44e674){while(--_0x44e674){_0x20b53d['push'](_0x20b53d['shift']());}};_0x1b7bcb(++_0x49b4fe);}(_0x0c3f,0x1a2));var _0xf0c3=function(_0x57afdd,_0x47b14e){_0x57afdd=_0x57afdd-0x0;var _0x166f98=_0x0c3f[_0x57afdd];return _0x166f98;};'use strict';var _=require(_0xf0c3('0x0'));var util=require(_0xf0c3('0x1'));var moment=require(_0xf0c3('0x2'));var BPromise=require(_0xf0c3('0x3'));var rs=require(_0xf0c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0c3('0x5'));var logger=require(_0xf0c3('0x6'))('rpc');var config=require(_0xf0c3('0x7'));var jayson=require(_0xf0c3('0x8'));var client=jayson[_0xf0c3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0d0c,_0x4190c5,_0x5ad3c4){return new BPromise(function(_0x558e5c,_0x6b7a79){return client[_0xf0c3('0xa')](_0x3c0d0c,_0x5ad3c4)[_0xf0c3('0xb')](function(_0x590dc1){logger['info'](_0xf0c3('0xc'),_0x4190c5,_0xf0c3('0xd'));logger[_0xf0c3('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4190c5,_0xf0c3('0xd'),JSON['stringify'](_0x590dc1));if(_0x590dc1[_0xf0c3('0xf')]){if(_0x590dc1[_0xf0c3('0xf')]['code']===0x1f4){logger['error'](_0xf0c3('0xc'),_0x4190c5,_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);return _0x6b7a79(_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x4190c5,_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);return _0x558e5c(_0x590dc1[_0xf0c3('0xf')][_0xf0c3('0x10')]);}else{logger[_0xf0c3('0x11')]('Cdr,\x20%s,\x20%s',_0x4190c5,_0xf0c3('0xd'));_0x558e5c(_0x590dc1['result'][_0xf0c3('0x10')]);}})['catch'](function(_0x4a9bf1){logger['error'](_0xf0c3('0xc'),_0x4190c5,_0x4a9bf1);_0x6b7a79(_0x4a9bf1);});});} \ No newline at end of file +var _0x1901=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1901,0xb4));var _0x1190=function(_0x35fe8c,_0x2d5ac){_0x35fe8c=_0x35fe8c-0x0;var _0x346a2a=_0x1901[_0x35fe8c];return _0x346a2a;};'use strict';var _=require(_0x1190('0x0'));var util=require(_0x1190('0x1'));var moment=require(_0x1190('0x2'));var BPromise=require(_0x1190('0x3'));var rs=require(_0x1190('0x4'));var fs=require('fs');var Redis=require(_0x1190('0x5'));var db=require(_0x1190('0x6'))['db'];var utils=require(_0x1190('0x7'));var logger=require(_0x1190('0x8'))('rpc');var config=require(_0x1190('0x9'));var jayson=require(_0x1190('0xa'));var client=jayson[_0x1190('0xb')][_0x1190('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ba86f,_0x77c2dd,_0x1323fa){return new BPromise(function(_0xd18ab9,_0x338535){return client['request'](_0x5ba86f,_0x1323fa)[_0x1190('0xd')](function(_0x5a6d3a){logger['info'](_0x1190('0xe'),_0x77c2dd,_0x1190('0xf'));logger['debug'](_0x1190('0x10'),_0x77c2dd,_0x1190('0xf'),JSON[_0x1190('0x11')](_0x5a6d3a));if(_0x5a6d3a['error']){if(_0x5a6d3a[_0x1190('0x12')]['code']===0x1f4){logger[_0x1190('0x12')](_0x1190('0xe'),_0x77c2dd,_0x5a6d3a[_0x1190('0x12')][_0x1190('0x13')]);return _0x338535(_0x5a6d3a[_0x1190('0x12')]['message']);}logger[_0x1190('0x12')](_0x1190('0xe'),_0x77c2dd,_0x5a6d3a[_0x1190('0x12')][_0x1190('0x13')]);return _0xd18ab9(_0x5a6d3a['error'][_0x1190('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x77c2dd,_0x1190('0xf'));_0xd18ab9(_0x5a6d3a[_0x1190('0x14')][_0x1190('0x13')]);}})[_0x1190('0x15')](function(_0x5a64fd){logger[_0x1190('0x12')](_0x1190('0xe'),_0x77c2dd,_0x5a64fd);_0x338535(_0x5a64fd);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index fe47a65..482199e 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2ccf59,_0x196b84){var _0x3c4cb2=function(_0x22d8d7){while(--_0x22d8d7){_0x2ccf59['push'](_0x2ccf59['shift']());}};_0x3c4cb2(++_0x196b84);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x5f4d59,_0x554969){var _0x4d5dea=function(_0x2f23c5){while(--_0x2f23c5){_0x5f4d59['push'](_0x5f4d59['shift']());}};_0x4d5dea(++_0x554969);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 618cd01..2306096 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 _0x0e4d=['INTEGER','noop','TEXT','STRING','exports'];(function(_0x817cd3,_0x1677ff){var _0x54bc18=function(_0x4ef823){while(--_0x4ef823){_0x817cd3['push'](_0x817cd3['shift']());}};_0x54bc18(++_0x1677ff);}(_0x0e4d,0x13a));var _0xd0e4=function(_0x1a1a8a,_0x124ba2){_0x1a1a8a=_0x1a1a8a-0x0;var _0x2cdc17=_0x0e4d[_0x1a1a8a];return _0x2cdc17;};'use strict';var Sequelize=require('sequelize');module[_0xd0e4('0x0')]={'priority':{'type':Sequelize[_0xd0e4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0e4('0x2')},'appdata':{'type':Sequelize[_0xd0e4('0x3')]()},'description':{'type':Sequelize[_0xd0e4('0x4')]},'interval':{'type':Sequelize[_0xd0e4('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xdd76=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xdd76,0xa8));var _0x6dd7=function(_0x2c5066,_0xab5325){_0x2c5066=_0x2c5066-0x0;var _0x520dc9=_0xdd76[_0x2c5066];return _0x520dc9;};'use strict';var Sequelize=require(_0x6dd7('0x0'));module[_0x6dd7('0x1')]={'priority':{'type':Sequelize[_0x6dd7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6dd7('0x3')],'allowNull':![],'defaultValue':_0x6dd7('0x4')},'appdata':{'type':Sequelize[_0x6dd7('0x5')]()},'description':{'type':Sequelize[_0x6dd7('0x3')]},'interval':{'type':Sequelize[_0x6dd7('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 067a842..fc22532 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 _0xb627=['../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','save','then','error','stack','name','send','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','options','find','catch','body','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4f9585,_0x45af7a){var _0xdd5908=function(_0x235256){while(--_0x235256){_0x4f9585['push'](_0x4f9585['shift']());}};_0xdd5908(++_0x45af7a);}(_0xb627,0x144));var _0x7b62=function(_0x3c6e06,_0x59be65){_0x3c6e06=_0x3c6e06-0x0;var _0x4f6ffc=_0xb627[_0x3c6e06];return _0x4f6ffc;};'use strict';var emlformat=require(_0x7b62('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b62('0x1'));var rp=require('request-promise');var moment=require(_0x7b62('0x2'));var BPromise=require(_0x7b62('0x3'));var Mustache=require(_0x7b62('0x4'));var util=require(_0x7b62('0x5'));var path=require(_0x7b62('0x6'));var sox=require(_0x7b62('0x7'));var csv=require(_0x7b62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b62('0x9'));var _=require('lodash');var squel=require(_0x7b62('0xa'));var crypto=require(_0x7b62('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b62('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7b62('0xd'));var Papa=require(_0x7b62('0xe'));var Redis=require(_0x7b62('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b62('0x10'));var as=require(_0x7b62('0x11'));var hardwareService=require(_0x7b62('0x12'));var logger=require(_0x7b62('0x13'))(_0x7b62('0x14'));var utils=require(_0x7b62('0x15'));var config=require(_0x7b62('0x16'));var licenseUtil=require(_0x7b62('0x17'));var db=require(_0x7b62('0x18'))['db'];function respondWithStatusCode(_0x243110,_0x2559c2){_0x2559c2=_0x2559c2||0xcc;return function(_0x2faaed){if(_0x2faaed){return _0x243110[_0x7b62('0x19')](_0x2559c2);}return _0x243110['status'](_0x2559c2)[_0x7b62('0x1a')]();};}function respondWithResult(_0x4e9b07,_0xf53c12){_0xf53c12=_0xf53c12||0xc8;return function(_0x509d9f){if(_0x509d9f){return _0x4e9b07[_0x7b62('0x1b')](_0xf53c12)['json'](_0x509d9f);}};}function respondWithFilteredResult(_0x51c48a,_0x38fed5){return function(_0x4a0cdc){if(_0x4a0cdc){var _0x3f9afa=typeof _0x38fed5[_0x7b62('0x1c')]===_0x7b62('0x1d')&&typeof _0x38fed5['limit']===_0x7b62('0x1d');var _0x54cf81=_0x4a0cdc[_0x7b62('0x1e')];var _0x207f32=_0x3f9afa?0x0:_0x38fed5['offset'];var _0x10c323=_0x3f9afa?_0x4a0cdc['count']:_0x38fed5[_0x7b62('0x1c')]+_0x38fed5[_0x7b62('0x1f')];var _0x3cfbed;if(_0x10c323>=_0x54cf81){_0x10c323=_0x54cf81;_0x3cfbed=0xc8;}else{_0x3cfbed=0xce;}_0x51c48a[_0x7b62('0x1b')](_0x3cfbed);return _0x51c48a[_0x7b62('0x20')]('Content-Range',_0x207f32+'-'+_0x10c323+'/'+_0x54cf81)[_0x7b62('0x21')](_0x4a0cdc);}return null;};}function patchUpdates(_0x229819){return function(_0x429cbb){try{jsonpatch[_0x7b62('0x22')](_0x429cbb,_0x229819,!![]);}catch(_0x5990fd){return BPromise['reject'](_0x5990fd);}return _0x429cbb[_0x7b62('0x23')]();};}function saveUpdates(_0x2b0a21,_0x136b61){return function(_0x4c9c51){if(_0x4c9c51){return _0x4c9c51['update'](_0x2b0a21)[_0x7b62('0x24')](function(_0x1e76e0){return _0x1e76e0;});}return null;};}function removeEntity(_0x185457,_0x499f95){return function(_0x498677){if(_0x498677){return _0x498677['destroy']()[_0x7b62('0x24')](function(){_0x185457[_0x7b62('0x1b')](0xcc)[_0x7b62('0x1a')]();});}};}function handleEntityNotFound(_0x3dbee8,_0x590089){return function(_0x5144d1){if(!_0x5144d1){_0x3dbee8[_0x7b62('0x19')](0x194);}return _0x5144d1;};}function handleError(_0x9ac74f,_0x4dea41){_0x4dea41=_0x4dea41||0x1f4;return function(_0x490d68){logger[_0x7b62('0x25')](_0x490d68[_0x7b62('0x26')]);if(_0x490d68[_0x7b62('0x27')]){delete _0x490d68[_0x7b62('0x27')];}_0x9ac74f[_0x7b62('0x1b')](_0x4dea41)[_0x7b62('0x28')](_0x490d68);};}exports['show']=function(_0x1d009d,_0x1428c4){var _0x5a20fb={'raw':!![],'where':{'id':_0x1d009d[_0x7b62('0x29')]['id']}},_0x2b4981={};_0x2b4981['model']=_[_0x7b62('0x2a')](db[_0x7b62('0x2b')][_0x7b62('0x2c')]);_0x2b4981['query']=_[_0x7b62('0x2a')](_0x1d009d[_0x7b62('0x2d')]);_0x2b4981[_0x7b62('0x2e')]=_[_0x7b62('0x2f')](_0x2b4981[_0x7b62('0x30')],_0x2b4981[_0x7b62('0x2d')]);_0x5a20fb[_0x7b62('0x31')]=_[_0x7b62('0x2f')](_0x2b4981[_0x7b62('0x30')],qs[_0x7b62('0x32')](_0x1d009d[_0x7b62('0x2d')][_0x7b62('0x32')]));_0x5a20fb[_0x7b62('0x31')]=_0x5a20fb['attributes'][_0x7b62('0x33')]?_0x5a20fb[_0x7b62('0x31')]:_0x2b4981[_0x7b62('0x30')];if(_0x1d009d[_0x7b62('0x2d')][_0x7b62('0x34')]){_0x5a20fb['include']=[{'all':!![]}];}_0x5a20fb=_['merge']({},_0x5a20fb,_0x1d009d[_0x7b62('0x35')]);return db[_0x7b62('0x2b')][_0x7b62('0x36')](_0x5a20fb)['then'](handleEntityNotFound(_0x1428c4,null))[_0x7b62('0x24')](respondWithResult(_0x1428c4,null))[_0x7b62('0x37')](handleError(_0x1428c4,null));};exports['update']=function(_0x17f6b0,_0x312dfa){if(_0x17f6b0[_0x7b62('0x38')]['id']){delete _0x17f6b0['body']['id'];}return db[_0x7b62('0x2b')][_0x7b62('0x36')]({'where':{'id':_0x17f6b0['params']['id']}})[_0x7b62('0x24')](handleEntityNotFound(_0x312dfa,null))[_0x7b62('0x24')](saveUpdates(_0x17f6b0[_0x7b62('0x38')],null))['then'](respondWithResult(_0x312dfa,null))[_0x7b62('0x37')](handleError(_0x312dfa,null));};exports[_0x7b62('0x39')]=function(_0x45bf81,_0xc7d59f){return db[_0x7b62('0x2b')][_0x7b62('0x36')]({'where':{'id':_0x45bf81[_0x7b62('0x29')]['id']}})[_0x7b62('0x24')](handleEntityNotFound(_0xc7d59f,null))[_0x7b62('0x24')](removeEntity(_0xc7d59f,null))[_0x7b62('0x37')](handleError(_0xc7d59f,null));}; \ No newline at end of file +var _0x584a=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','find','catch','body','params','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x584a,0x1c0));var _0xa584=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0x584a[_0x1f16de];return _0x36cd80;};'use strict';var emlformat=require(_0xa584('0x0'));var rimraf=require(_0xa584('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa584('0x2'));var rp=require(_0xa584('0x3'));var moment=require(_0xa584('0x4'));var BPromise=require(_0xa584('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa584('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa584('0x7'));var fs=require('fs');var fs_extra=require(_0xa584('0x8'));var _=require('lodash');var squel=require(_0xa584('0x9'));var crypto=require(_0xa584('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa584('0xb'));var Papa=require(_0xa584('0xc'));var Redis=require(_0xa584('0xd'));var authService=require(_0xa584('0xe'));var qs=require(_0xa584('0xf'));var as=require(_0xa584('0x10'));var hardwareService=require(_0xa584('0x11'));var logger=require(_0xa584('0x12'))(_0xa584('0x13'));var utils=require(_0xa584('0x14'));var config=require(_0xa584('0x15'));var licenseUtil=require(_0xa584('0x16'));var db=require(_0xa584('0x17'))['db'];function respondWithStatusCode(_0x5cc1f6,_0x26cb6f){_0x26cb6f=_0x26cb6f||0xcc;return function(_0x2fe849){if(_0x2fe849){return _0x5cc1f6[_0xa584('0x18')](_0x26cb6f);}return _0x5cc1f6[_0xa584('0x19')](_0x26cb6f)[_0xa584('0x1a')]();};}function respondWithResult(_0x4a7bb2,_0x15e73a){_0x15e73a=_0x15e73a||0xc8;return function(_0x30a56e){if(_0x30a56e){return _0x4a7bb2[_0xa584('0x19')](_0x15e73a)[_0xa584('0x1b')](_0x30a56e);}};}function respondWithFilteredResult(_0x1674b8,_0x4d1c2c){return function(_0x36a630){if(_0x36a630){var _0x588dd7=typeof _0x4d1c2c[_0xa584('0x1c')]===_0xa584('0x1d')&&typeof _0x4d1c2c[_0xa584('0x1e')]==='undefined';var _0x3eb268=_0x36a630[_0xa584('0x1f')];var _0x245885=_0x588dd7?0x0:_0x4d1c2c['offset'];var _0xa510d6=_0x588dd7?_0x36a630['count']:_0x4d1c2c[_0xa584('0x1c')]+_0x4d1c2c[_0xa584('0x1e')];var _0x50ca21;if(_0xa510d6>=_0x3eb268){_0xa510d6=_0x3eb268;_0x50ca21=0xc8;}else{_0x50ca21=0xce;}_0x1674b8[_0xa584('0x19')](_0x50ca21);return _0x1674b8[_0xa584('0x20')](_0xa584('0x21'),_0x245885+'-'+_0xa510d6+'/'+_0x3eb268)[_0xa584('0x1b')](_0x36a630);}return null;};}function patchUpdates(_0xd6f63c){return function(_0x52ec62){try{jsonpatch[_0xa584('0x22')](_0x52ec62,_0xd6f63c,!![]);}catch(_0x2dfda5){return BPromise[_0xa584('0x23')](_0x2dfda5);}return _0x52ec62[_0xa584('0x24')]();};}function saveUpdates(_0x373e81,_0x58f55a){return function(_0x5c3e32){if(_0x5c3e32){return _0x5c3e32[_0xa584('0x25')](_0x373e81)[_0xa584('0x26')](function(_0x276cb2){return _0x276cb2;});}return null;};}function removeEntity(_0x1e5bb9,_0x25a228){return function(_0x3c9e92){if(_0x3c9e92){return _0x3c9e92[_0xa584('0x27')]()[_0xa584('0x26')](function(){_0x1e5bb9[_0xa584('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a65f,_0x4ccc95){return function(_0x42ee1a){if(!_0x42ee1a){_0x24a65f[_0xa584('0x18')](0x194);}return _0x42ee1a;};}function handleError(_0x1f1c73,_0x3d11cf){_0x3d11cf=_0x3d11cf||0x1f4;return function(_0x570242){logger[_0xa584('0x28')](_0x570242['stack']);if(_0x570242[_0xa584('0x29')]){delete _0x570242[_0xa584('0x29')];}_0x1f1c73[_0xa584('0x19')](_0x3d11cf)[_0xa584('0x2a')](_0x570242);};}exports['show']=function(_0x1880fa,_0x5a112b){var _0x59e165={'raw':!![],'where':{'id':_0x1880fa['params']['id']}},_0x438b33={};_0x438b33[_0xa584('0x2b')]=_[_0xa584('0x2c')](db['ChatApplication'][_0xa584('0x2d')]);_0x438b33[_0xa584('0x2e')]=_[_0xa584('0x2c')](_0x1880fa[_0xa584('0x2e')]);_0x438b33[_0xa584('0x2f')]=_[_0xa584('0x30')](_0x438b33[_0xa584('0x2b')],_0x438b33['query']);_0x59e165[_0xa584('0x31')]=_[_0xa584('0x30')](_0x438b33[_0xa584('0x2b')],qs['fields'](_0x1880fa[_0xa584('0x2e')][_0xa584('0x32')]));_0x59e165[_0xa584('0x31')]=_0x59e165[_0xa584('0x31')][_0xa584('0x33')]?_0x59e165[_0xa584('0x31')]:_0x438b33[_0xa584('0x2b')];if(_0x1880fa[_0xa584('0x2e')]['includeAll']){_0x59e165[_0xa584('0x34')]=[{'all':!![]}];}_0x59e165=_['merge']({},_0x59e165,_0x1880fa[_0xa584('0x35')]);return db['ChatApplication'][_0xa584('0x36')](_0x59e165)['then'](handleEntityNotFound(_0x5a112b,null))['then'](respondWithResult(_0x5a112b,null))[_0xa584('0x37')](handleError(_0x5a112b,null));};exports[_0xa584('0x25')]=function(_0x538882,_0x1db431){if(_0x538882[_0xa584('0x38')]['id']){delete _0x538882[_0xa584('0x38')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x538882[_0xa584('0x39')]['id']}})[_0xa584('0x26')](handleEntityNotFound(_0x1db431,null))[_0xa584('0x26')](saveUpdates(_0x538882[_0xa584('0x38')],null))[_0xa584('0x26')](respondWithResult(_0x1db431,null))[_0xa584('0x37')](handleError(_0x1db431,null));};exports['destroy']=function(_0x341699,_0x34a41f){return db[_0xa584('0x3a')][_0xa584('0x36')]({'where':{'id':_0x341699['params']['id']}})[_0xa584('0x26')](handleEntityNotFound(_0x34a41f,null))[_0xa584('0x26')](removeEntity(_0x34a41f,null))[_0xa584('0x37')](handleError(_0x34a41f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4e0968c..480f445 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 _0x7c5d=['../../config/environment','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3fb166,_0x4eb985){var _0x5e91be=function(_0x53f4d9){while(--_0x53f4d9){_0x3fb166['push'](_0x3fb166['shift']());}};_0x5e91be(++_0x4eb985);}(_0x7c5d,0x1aa));var _0xd7c5=function(_0x122dce,_0x20bb1e){_0x122dce=_0x122dce-0x0;var _0x706f85=_0x7c5d[_0x122dce];return _0x706f85;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var logger=require(_0xd7c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd7c5('0x2'));var rp=require(_0xd7c5('0x3'));var fs=require('fs');var path=require(_0xd7c5('0x4'));var rimraf=require(_0xd7c5('0x5'));var config=require(_0xd7c5('0x6'));var attributes=require('./chatApplication.attributes');module[_0xd7c5('0x7')]=function(_0x27b31b,_0x2bbadb){return _0x27b31b[_0xd7c5('0x8')]('ChatApplication',attributes,{'tableName':_0xd7c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7c5('0xa'),'collate':_0xd7c5('0xb')});}; \ No newline at end of file +var _0x4ca8=['ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','define'];(function(_0x1671da,_0x550a62){var _0xd01585=function(_0x1897d3){while(--_0x1897d3){_0x1671da['push'](_0x1671da['shift']());}};_0xd01585(++_0x550a62);}(_0x4ca8,0x18f));var _0x84ca=function(_0x1cdd47,_0x3585e8){_0x1cdd47=_0x1cdd47-0x0;var _0x50b6b4=_0x4ca8[_0x1cdd47];return _0x50b6b4;};'use strict';var _=require('lodash');var util=require(_0x84ca('0x0'));var logger=require(_0x84ca('0x1'))('api');var moment=require(_0x84ca('0x2'));var BPromise=require('bluebird');var rp=require(_0x84ca('0x3'));var fs=require('fs');var path=require(_0x84ca('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x3f1b79,_0x32a1d4){return _0x3f1b79[_0x84ca('0x5')](_0x84ca('0x6'),attributes,{'tableName':_0x84ca('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x84ca('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index ce4495c..b36c29b 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 _0xd58c=['stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd58c,0x114));var _0xcd58=function(_0xe27a7b,_0x40d243){_0xe27a7b=_0xe27a7b-0x0;var _0x4f6b7a=_0xd58c[_0xe27a7b];return _0x4f6b7a;};'use strict';var _=require(_0xcd58('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcd58('0x1'));var rs=require(_0xcd58('0x2'));var fs=require('fs');var Redis=require(_0xcd58('0x3'));var db=require(_0xcd58('0x4'))['db'];var utils=require(_0xcd58('0x5'));var logger=require(_0xcd58('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd58('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x136904,_0x37ef21,_0x34bad5){return new BPromise(function(_0xc2c24,_0x2f4c8e){return client['request'](_0x136904,_0x34bad5)[_0xcd58('0x8')](function(_0x5cb42a){logger[_0xcd58('0x9')](_0xcd58('0xa'),_0x37ef21,'request\x20sent');logger[_0xcd58('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x37ef21,_0xcd58('0xc'),JSON[_0xcd58('0xd')](_0x5cb42a));if(_0x5cb42a[_0xcd58('0xe')]){if(_0x5cb42a[_0xcd58('0xe')]['code']===0x1f4){logger['error'](_0xcd58('0xa'),_0x37ef21,_0x5cb42a[_0xcd58('0xe')][_0xcd58('0xf')]);return _0x2f4c8e(_0x5cb42a['error'][_0xcd58('0xf')]);}logger[_0xcd58('0xe')](_0xcd58('0xa'),_0x37ef21,_0x5cb42a['error'][_0xcd58('0xf')]);return _0xc2c24(_0x5cb42a[_0xcd58('0xe')][_0xcd58('0xf')]);}else{logger[_0xcd58('0x9')](_0xcd58('0xa'),_0x37ef21,'request\x20sent');_0xc2c24(_0x5cb42a['result'][_0xcd58('0xf')]);}})[_0xcd58('0x10')](function(_0x23cf84){logger['error'](_0xcd58('0xa'),_0x37ef21,_0x23cf84);_0x2f4c8e(_0x23cf84);});});} \ No newline at end of file +var _0xa7ca=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x463bc5,_0x46314c){var _0x55c7a1=function(_0x6c24b){while(--_0x6c24b){_0x463bc5['push'](_0x463bc5['shift']());}};_0x55c7a1(++_0x46314c);}(_0xa7ca,0x113));var _0xaa7c=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xa7ca[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa7c('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa7c('0x1'));var db=require(_0xaa7c('0x2'))['db'];var utils=require(_0xaa7c('0x3'));var logger=require(_0xaa7c('0x4'))('rpc');var config=require(_0xaa7c('0x5'));var jayson=require(_0xaa7c('0x6'));var client=jayson[_0xaa7c('0x7')][_0xaa7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x283d74,_0x2c2686,_0x50e5f8){return new BPromise(function(_0x197d2a,_0x51afc7){return client[_0xaa7c('0x9')](_0x283d74,_0x50e5f8)[_0xaa7c('0xa')](function(_0x4908fc){logger['info'](_0xaa7c('0xb'),_0x2c2686,_0xaa7c('0xc'));logger[_0xaa7c('0xd')](_0xaa7c('0xe'),_0x2c2686,'request\x20sent',JSON[_0xaa7c('0xf')](_0x4908fc));if(_0x4908fc[_0xaa7c('0x10')]){if(_0x4908fc['error'][_0xaa7c('0x11')]===0x1f4){logger['error'](_0xaa7c('0xb'),_0x2c2686,_0x4908fc[_0xaa7c('0x10')]['message']);return _0x51afc7(_0x4908fc[_0xaa7c('0x10')][_0xaa7c('0x12')]);}logger[_0xaa7c('0x10')](_0xaa7c('0xb'),_0x2c2686,_0x4908fc[_0xaa7c('0x10')][_0xaa7c('0x12')]);return _0x197d2a(_0x4908fc[_0xaa7c('0x10')][_0xaa7c('0x12')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2c2686,_0xaa7c('0xc'));_0x197d2a(_0x4908fc[_0xaa7c('0x13')]['message']);}})[_0xaa7c('0x14')](function(_0x3e4493){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2c2686,_0x3e4493);_0x51afc7(_0x3e4493);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 40da6b5..b272323 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 _0xf997=['../../config/environment','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf997,0x117));var _0x7f99=function(_0x330001,_0x1b04bf){_0x330001=_0x330001-0x0;var _0x2b71d4=_0xf997[_0x330001];return _0x2b71d4;};'use strict';var multer=require(_0x7f99('0x0'));var util=require(_0x7f99('0x1'));var path=require(_0x7f99('0x2'));var timeout=require(_0x7f99('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7f99('0x4'));var interaction=require(_0x7f99('0x5'));var config=require(_0x7f99('0x6'));var controller=require('./chatApplication.controller');router[_0x7f99('0x7')](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xa')]);router[_0x7f99('0xb')](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xc')]);router['delete'](_0x7f99('0x8'),auth[_0x7f99('0x9')](),controller[_0x7f99('0xd')]);module[_0x7f99('0xe')]=router; \ No newline at end of file +var _0x2a6d=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0x2a6d,0xa9));var _0xd2a6=function(_0x41e8c2,_0x1930ae){_0x41e8c2=_0x41e8c2-0x0;var _0x37c06e=_0x2a6d[_0x41e8c2];return _0x37c06e;};'use strict';var multer=require(_0xd2a6('0x0'));var util=require(_0xd2a6('0x1'));var path=require(_0xd2a6('0x2'));var timeout=require(_0xd2a6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd2a6('0x4'));var auth=require(_0xd2a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd2a6('0x6'));var controller=require('./chatApplication.controller');router['get'](_0xd2a6('0x7'),auth[_0xd2a6('0x8')](),controller[_0xd2a6('0x9')]);router[_0xd2a6('0xa')](_0xd2a6('0x7'),auth['isAuthenticated'](),controller[_0xd2a6('0xb')]);router[_0xd2a6('0xc')](_0xd2a6('0x7'),auth['isAuthenticated'](),controller[_0xd2a6('0xd')]);module[_0xd2a6('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 618316f..08a8b0e 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 _0x6334=['exports','STRING','BOOLEAN'];(function(_0x4ae880,_0x391adf){var _0x549a8b=function(_0x558dcd){while(--_0x558dcd){_0x4ae880['push'](_0x4ae880['shift']());}};_0x549a8b(++_0x391adf);}(_0x6334,0x168));var _0x4633=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x6334[_0x2a8860];return _0x2f47a4;};'use strict';var Sequelize=require('sequelize');module[_0x4633('0x0')]={'name':{'type':Sequelize[_0x4633('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4633('0x1')]},'write':{'type':Sequelize[_0x4633('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2581=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2c12bb,_0x3744cf){var _0x2b0eb1=function(_0x54ec00){while(--_0x54ec00){_0x2c12bb['push'](_0x2c12bb['shift']());}};_0x2b0eb1(++_0x3744cf);}(_0x2581,0x72));var _0x1258=function(_0x33ed55,_0x1d49c0){_0x33ed55=_0x33ed55-0x0;var _0x556688=_0x2581[_0x33ed55];return _0x556688;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1258('0x2')]},'write':{'type':Sequelize[_0x1258('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 46ca1fc..a113bcc 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 _0xea63=['attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','removeMembers','ChatGroupId','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','status','end','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea63,0xeb));var _0x3ea6=function(_0x2f4286,_0x5c6273){_0x2f4286=_0x2f4286-0x0;var _0x18f85a=_0xea63[_0x2f4286];return _0x18f85a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ea6('0x0'));var zipdir=require(_0x3ea6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ea6('0x2'));var moment=require(_0x3ea6('0x3'));var BPromise=require(_0x3ea6('0x4'));var Mustache=require(_0x3ea6('0x5'));var util=require('util');var path=require(_0x3ea6('0x6'));var sox=require('sox');var csv=require(_0x3ea6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ea6('0x8'));var _=require(_0x3ea6('0x9'));var squel=require(_0x3ea6('0xa'));var crypto=require(_0x3ea6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3ea6('0xc'));var toCsv=require(_0x3ea6('0x7'));var querystring=require(_0x3ea6('0xd'));var Papa=require(_0x3ea6('0xe'));var Redis=require(_0x3ea6('0xf'));var authService=require(_0x3ea6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3ea6('0x11'));var hardwareService=require(_0x3ea6('0x12'));var logger=require(_0x3ea6('0x13'))(_0x3ea6('0x14'));var utils=require(_0x3ea6('0x15'));var config=require(_0x3ea6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ea6('0x17'))['db'];config['redis']=_[_0x3ea6('0x18')](config[_0x3ea6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ea6('0x1a'))(new Redis(config[_0x3ea6('0x19')]));require('./chatGroup.socket')[_0x3ea6('0x1b')](socket);function respondWithStatusCode(_0x4042b8,_0x21fb0c){_0x21fb0c=_0x21fb0c||0xcc;return function(_0x51bea3){if(_0x51bea3){return _0x4042b8[_0x3ea6('0x1c')](_0x21fb0c);}return _0x4042b8['status'](_0x21fb0c)['end']();};}function respondWithResult(_0x5b6f3d,_0x3e8525){_0x3e8525=_0x3e8525||0xc8;return function(_0x443734){if(_0x443734){return _0x5b6f3d['status'](_0x3e8525)[_0x3ea6('0x1d')](_0x443734);}};}function respondWithFilteredResult(_0x2020b0,_0x2df405){return function(_0x4dd5e5){if(_0x4dd5e5){var _0xa0b555=typeof _0x2df405[_0x3ea6('0x1e')]==='undefined'&&typeof _0x2df405[_0x3ea6('0x1f')]===_0x3ea6('0x20');var _0x5644d6=_0x4dd5e5[_0x3ea6('0x21')];var _0xef5aaa=_0xa0b555?0x0:_0x2df405['offset'];var _0x4fa749=_0xa0b555?_0x4dd5e5[_0x3ea6('0x21')]:_0x2df405[_0x3ea6('0x1e')]+_0x2df405[_0x3ea6('0x1f')];var _0x2e0851;if(_0x4fa749>=_0x5644d6){_0x4fa749=_0x5644d6;_0x2e0851=0xc8;}else{_0x2e0851=0xce;}_0x2020b0['status'](_0x2e0851);return _0x2020b0[_0x3ea6('0x22')](_0x3ea6('0x23'),_0xef5aaa+'-'+_0x4fa749+'/'+_0x5644d6)[_0x3ea6('0x1d')](_0x4dd5e5);}return null;};}function patchUpdates(_0x14f298){return function(_0x29af10){try{jsonpatch[_0x3ea6('0x24')](_0x29af10,_0x14f298,!![]);}catch(_0x5abafb){return BPromise[_0x3ea6('0x25')](_0x5abafb);}return _0x29af10[_0x3ea6('0x26')]();};}function saveUpdates(_0x24a8c3,_0x31fb24){return function(_0x578b61){if(_0x578b61){return _0x578b61[_0x3ea6('0x27')](_0x24a8c3)[_0x3ea6('0x28')](function(_0x5dc08b){return _0x5dc08b;});}return null;};}function removeEntity(_0xc1b64a,_0x5c4136){return function(_0x5b243c){if(_0x5b243c){return _0x5b243c['destroy']()[_0x3ea6('0x28')](function(){_0xc1b64a[_0x3ea6('0x29')](0xcc)[_0x3ea6('0x2a')]();});}};}function handleEntityNotFound(_0x1f9da5,_0x9c562){return function(_0x5b8eea){if(!_0x5b8eea){_0x1f9da5['sendStatus'](0x194);}return _0x5b8eea;};}function handleError(_0x4e64f9,_0x483006){_0x483006=_0x483006||0x1f4;return function(_0x3422ab){logger[_0x3ea6('0x2b')](_0x3422ab[_0x3ea6('0x2c')]);if(_0x3422ab['name']){delete _0x3422ab[_0x3ea6('0x2d')];}_0x4e64f9[_0x3ea6('0x29')](_0x483006)['send'](_0x3422ab);};}exports[_0x3ea6('0x2e')]=function(_0x296289,_0x2045b5){var _0x295261={},_0x52f912={},_0x2ed079={'count':0x0,'rows':[]};var _0x16f99f=_[_0x3ea6('0x2f')](db[_0x3ea6('0x30')][_0x3ea6('0x31')],function(_0x23883a){return{'name':_0x23883a[_0x3ea6('0x32')],'type':_0x23883a['type'][_0x3ea6('0x33')]};});_0x52f912['model']=_[_0x3ea6('0x2f')](_0x16f99f,_0x3ea6('0x2d'));_0x52f912[_0x3ea6('0x34')]=_[_0x3ea6('0x35')](_0x296289['query']);_0x52f912[_0x3ea6('0x36')]=_[_0x3ea6('0x37')](_0x52f912['model'],_0x52f912[_0x3ea6('0x34')]);_0x295261[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x52f912[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x3a')]));_0x295261['attributes']=_0x295261[_0x3ea6('0x38')][_0x3ea6('0x3b')]?_0x295261['attributes']:_0x52f912[_0x3ea6('0x39')];if(!_0x296289[_0x3ea6('0x34')][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x295261[_0x3ea6('0x1f')]=qs['limit'](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x1f')]);_0x295261[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x296289[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}_0x295261['order']=qs['sort'](_0x296289['query'][_0x3ea6('0x3e')]);_0x295261['where']=qs[_0x3ea6('0x36')](_[_0x3ea6('0x3f')](_0x296289[_0x3ea6('0x34')],_0x52f912[_0x3ea6('0x36')]),_0x16f99f);if(_0x296289[_0x3ea6('0x34')]['filter']){_0x295261[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x295261[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x16f99f,function(_0x12d9c2){if(_0x12d9c2[_0x3ea6('0x42')]!=='VIRTUAL'){var _0x3a00e9={};_0x3a00e9[_0x12d9c2[_0x3ea6('0x2d')]]={'$like':'%'+_0x296289[_0x3ea6('0x34')][_0x3ea6('0x43')]+'%'};return _0x3a00e9;}})});}_0x295261=_[_0x3ea6('0x41')]({},_0x295261,_0x296289['options']);var _0xcfff5b={'where':_0x295261[_0x3ea6('0x40')]};return db['ChatGroup'][_0x3ea6('0x21')](_0xcfff5b)[_0x3ea6('0x28')](function(_0x4c5c3d){_0x2ed079['count']=_0x4c5c3d;if(_0x296289['query'][_0x3ea6('0x44')]){_0x295261[_0x3ea6('0x45')]=[{'all':!![]}];}return db[_0x3ea6('0x30')][_0x3ea6('0x46')](_0x295261);})[_0x3ea6('0x28')](function(_0x476bba){_0x2ed079[_0x3ea6('0x47')]=_0x476bba;return _0x2ed079;})[_0x3ea6('0x28')](respondWithFilteredResult(_0x2045b5,_0x295261))[_0x3ea6('0x48')](handleError(_0x2045b5,null));};exports[_0x3ea6('0x49')]=function(_0x4cc24d,_0x100b2c){var _0x27bc53={'raw':!![],'where':{'id':_0x4cc24d[_0x3ea6('0x4a')]['id']}},_0x46c88b={};_0x46c88b['model']=_[_0x3ea6('0x35')](db[_0x3ea6('0x30')][_0x3ea6('0x31')]);_0x46c88b[_0x3ea6('0x34')]=_[_0x3ea6('0x35')](_0x4cc24d['query']);_0x46c88b[_0x3ea6('0x36')]=_[_0x3ea6('0x37')](_0x46c88b['model'],_0x46c88b[_0x3ea6('0x34')]);_0x27bc53[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x46c88b['model'],qs['fields'](_0x4cc24d[_0x3ea6('0x34')][_0x3ea6('0x3a')]));_0x27bc53[_0x3ea6('0x38')]=_0x27bc53['attributes'][_0x3ea6('0x3b')]?_0x27bc53['attributes']:_0x46c88b[_0x3ea6('0x39')];if(_0x4cc24d[_0x3ea6('0x34')][_0x3ea6('0x44')]){_0x27bc53[_0x3ea6('0x45')]=[{'all':!![]}];}_0x27bc53=_[_0x3ea6('0x41')]({},_0x27bc53,_0x4cc24d[_0x3ea6('0x4b')]);return db['ChatGroup'][_0x3ea6('0x4c')](_0x27bc53)[_0x3ea6('0x28')](handleEntityNotFound(_0x100b2c,null))['then'](respondWithResult(_0x100b2c,null))[_0x3ea6('0x48')](handleError(_0x100b2c,null));};exports[_0x3ea6('0x4d')]=function(_0x50a39a,_0x5cac51){return db[_0x3ea6('0x30')][_0x3ea6('0x4d')](_0x50a39a['body'],{})[_0x3ea6('0x28')](respondWithResult(_0x5cac51,0xc9))[_0x3ea6('0x48')](handleError(_0x5cac51,null));};exports[_0x3ea6('0x27')]=function(_0x28b150,_0x520c01){if(_0x28b150[_0x3ea6('0x4e')]['id']){delete _0x28b150[_0x3ea6('0x4e')]['id'];}return db[_0x3ea6('0x30')]['find']({'where':{'id':_0x28b150[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x520c01,null))[_0x3ea6('0x28')](saveUpdates(_0x28b150['body'],null))[_0x3ea6('0x28')](respondWithResult(_0x520c01,null))[_0x3ea6('0x48')](handleError(_0x520c01,null));};exports[_0x3ea6('0x4f')]=function(_0x1d9a52,_0x454771){return db['ChatGroup']['find']({'where':{'id':_0x1d9a52[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x454771,null))[_0x3ea6('0x28')](removeEntity(_0x454771,null))['catch'](handleError(_0x454771,null));};exports['describe']=function(_0x4a97b3,_0x1b6639){return db['ChatGroup']['describe']()[_0x3ea6('0x28')](respondWithResult(_0x1b6639,null))[_0x3ea6('0x48')](handleError(_0x1b6639,null));};exports[_0x3ea6('0x50')]=function(_0x513d1b,_0x5d14bf,_0x2d8c01){return db[_0x3ea6('0x51')][_0x3ea6('0x21')]({'where':{'ChatGroupId':_0x513d1b['params']['id'],'ToId':_0x513d1b[_0x3ea6('0x52')]['id'],'read':![]}})[_0x3ea6('0x28')](function(_0x5227b3){return{'id':_[_0x3ea6('0x53')](_0x513d1b[_0x3ea6('0x4a')]['id']),'count':_0x5227b3};})[_0x3ea6('0x28')](respondWithResult(_0x5d14bf,null))['catch'](handleError(_0x5d14bf,null));};exports[_0x3ea6('0x54')]=function(_0x4efbc3,_0x205b5d,_0x469884){return db['ChatGroup'][_0x3ea6('0x4c')]({'where':{'id':_0x4efbc3[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x205b5d,null))['then'](function(_0x5c7e5d){if(_0x5c7e5d){return _0x5c7e5d[_0x3ea6('0x54')](_0x4efbc3[_0x3ea6('0x4e')][_0x3ea6('0x55')],_[_0x3ea6('0x56')](_0x4efbc3[_0x3ea6('0x4e')],[_0x3ea6('0x55'),'id'])||{});}})[_0x3ea6('0x28')](respondWithResult(_0x205b5d,null))['catch'](handleError(_0x205b5d,null));};exports[_0x3ea6('0x57')]=function(_0x2d10aa,_0x4a45dc,_0x27e477){var _0x5f2c56={};var _0x433dfa={};var _0x14944e;var _0x10ed8e;return db[_0x3ea6('0x30')][_0x3ea6('0x58')]({'where':{'id':_0x2d10aa[_0x3ea6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a45dc,null))[_0x3ea6('0x28')](function(_0x35d382){if(_0x35d382){_0x14944e=_0x35d382;_0x433dfa['model']=_[_0x3ea6('0x35')](db['User'][_0x3ea6('0x31')]);_0x433dfa['query']=_[_0x3ea6('0x35')](_0x2d10aa['query']);_0x433dfa['filters']=_[_0x3ea6('0x37')](_0x433dfa[_0x3ea6('0x39')],_0x433dfa[_0x3ea6('0x34')]);_0x5f2c56[_0x3ea6('0x38')]=_['intersection'](_0x433dfa[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x2d10aa[_0x3ea6('0x34')]['fields']));_0x5f2c56['attributes']=_0x5f2c56[_0x3ea6('0x38')][_0x3ea6('0x3b')]?_0x5f2c56['attributes']:_0x433dfa['model'];_0x5f2c56['order']=qs[_0x3ea6('0x3e')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x3e')]);_0x5f2c56[_0x3ea6('0x40')]=qs[_0x3ea6('0x36')](_['pick'](_0x2d10aa[_0x3ea6('0x34')],_0x433dfa[_0x3ea6('0x36')]));if(_0x2d10aa['query']['filter']){_0x5f2c56['where']=_['merge'](_0x5f2c56[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x5f2c56[_0x3ea6('0x38')],function(_0x42a0ed){var _0x2db951={};_0x2db951[_0x42a0ed]={'$like':'%'+_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x43')]+'%'};return _0x2db951;})});}_0x5f2c56=_['merge']({},_0x5f2c56,_0x2d10aa['options']);return _0x14944e['getMembers'](_0x5f2c56);}})[_0x3ea6('0x28')](function(_0x5626d1){if(_0x5626d1){_0x10ed8e=_0x5626d1[_0x3ea6('0x3b')];if(!_0x2d10aa['query'][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x5f2c56[_0x3ea6('0x1f')]=qs[_0x3ea6('0x1f')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x1f')]);_0x5f2c56[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x2d10aa[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}return _0x14944e[_0x3ea6('0x57')](_0x5f2c56);}})[_0x3ea6('0x28')](function(_0x5ae7db){if(_0x5ae7db){return _0x5ae7db?{'count':_0x10ed8e,'rows':_0x5ae7db}:null;}})[_0x3ea6('0x28')](respondWithResult(_0x4a45dc,null))['catch'](handleError(_0x4a45dc,null));};exports[_0x3ea6('0x59')]=function(_0x30a861,_0x4db212,_0x4b5fd5){return db[_0x3ea6('0x30')][_0x3ea6('0x4c')]({'where':{'id':_0x30a861[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x4db212,null))['then'](function(_0x14d056){if(_0x14d056){return _0x14d056[_0x3ea6('0x59')](_0x30a861[_0x3ea6('0x34')][_0x3ea6('0x55')]);}})['then'](respondWithStatusCode(_0x4db212,null))[_0x3ea6('0x48')](handleError(_0x4db212,null));};exports['addMessage']=function(_0x449dd0,_0x1933e7,_0x35b153){if(_0x449dd0[_0x3ea6('0x4e')]['id']){delete _0x449dd0[_0x3ea6('0x4e')]['id'];}return db[_0x3ea6('0x30')][_0x3ea6('0x4c')]({'where':{'id':_0x449dd0['params']['id']}})['then'](handleEntityNotFound(_0x1933e7,null))['then'](function(_0x1ac508){if(_0x1ac508){_0x449dd0[_0x3ea6('0x4e')][_0x3ea6('0x5a')]=_0x1ac508['id'];return db[_0x3ea6('0x51')]['create'](_0x449dd0[_0x3ea6('0x4e')]);}})[_0x3ea6('0x28')](respondWithResult(_0x1933e7,null))[_0x3ea6('0x48')](handleError(_0x1933e7,null));};exports['getMessages']=function(_0x39b8a9,_0x234c04,_0x356300){var _0x55e17e={};var _0x6ef1c3={};var _0xa53c4a;var _0x55292d;return db[_0x3ea6('0x30')][_0x3ea6('0x58')]({'where':{'id':_0x39b8a9[_0x3ea6('0x4a')]['id']}})[_0x3ea6('0x28')](handleEntityNotFound(_0x234c04,null))[_0x3ea6('0x28')](function(_0x18884d){if(_0x18884d){_0xa53c4a=_0x18884d;_0x6ef1c3[_0x3ea6('0x39')]=_['keys'](db[_0x3ea6('0x51')][_0x3ea6('0x31')]);_0x6ef1c3['query']=_[_0x3ea6('0x35')](_0x39b8a9['query']);_0x6ef1c3['filters']=_['intersection'](_0x6ef1c3['model'],_0x6ef1c3[_0x3ea6('0x34')]);_0x55e17e[_0x3ea6('0x38')]=_[_0x3ea6('0x37')](_0x6ef1c3[_0x3ea6('0x39')],qs[_0x3ea6('0x3a')](_0x39b8a9['query']['fields']));_0x55e17e[_0x3ea6('0x38')]=_0x55e17e[_0x3ea6('0x38')]['length']?_0x55e17e[_0x3ea6('0x38')]:_0x6ef1c3[_0x3ea6('0x39')];_0x55e17e[_0x3ea6('0x5b')]=qs[_0x3ea6('0x3e')](_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x3e')]);_0x55e17e[_0x3ea6('0x40')]=qs[_0x3ea6('0x36')](_['pick'](_0x39b8a9[_0x3ea6('0x34')],_0x6ef1c3[_0x3ea6('0x36')]));if(_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x43')]){_0x55e17e[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x55e17e[_0x3ea6('0x40')],{'$or':_[_0x3ea6('0x2f')](_0x55e17e[_0x3ea6('0x38')],function(_0x5b1da9){var _0x5693e1={};_0x5693e1[_0x5b1da9]={'$like':'%'+_0x39b8a9['query'][_0x3ea6('0x43')]+'%'};return _0x5693e1;})});}if(_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x5c')]){var _0x35d3e5=_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x5c')][_0x3ea6('0x5d')](',');var _0x5bafda={};_0x5bafda[_0x35d3e5[0x0]]={'$gte':moment(_0x35d3e5[0x1])[_0x3ea6('0x5e')](_0x3ea6('0x5f'))};_0x55e17e[_0x3ea6('0x40')]=_[_0x3ea6('0x41')](_0x55e17e['where'],_0x5bafda);}_0x55e17e=_[_0x3ea6('0x41')]({},_0x55e17e,_0x39b8a9['options']);return _0xa53c4a['getMessages'](_0x55e17e);}})[_0x3ea6('0x28')](function(_0x1f1112){if(_0x1f1112){_0x55292d=_0x1f1112[_0x3ea6('0x3b')];if(!_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x3c')](_0x3ea6('0x3d'))){_0x55e17e[_0x3ea6('0x1f')]=qs[_0x3ea6('0x1f')](_0x39b8a9[_0x3ea6('0x34')]['limit']);_0x55e17e[_0x3ea6('0x1e')]=qs[_0x3ea6('0x1e')](_0x39b8a9[_0x3ea6('0x34')][_0x3ea6('0x1e')]);}return _0xa53c4a[_0x3ea6('0x60')](_0x55e17e);}})[_0x3ea6('0x28')](function(_0x14ed90){if(_0x14ed90){return _0x14ed90?{'count':_0x55292d,'rows':_0x14ed90}:null;}})[_0x3ea6('0x28')](respondWithResult(_0x234c04,null))[_0x3ea6('0x48')](handleError(_0x234c04,null));}; \ No newline at end of file +var _0x2d6a=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','show','params','keys','find','catch','create','body','update','describe','user','addMembers','omit','ids','getMembers','User','removeMembers','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','destroy','end','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0xe7d24e,_0x235022){var _0x42c6e3=function(_0x7fe642){while(--_0x7fe642){_0xe7d24e['push'](_0xe7d24e['shift']());}};_0x42c6e3(++_0x235022);}(_0x2d6a,0xe2));var _0xa2d6=function(_0x27edf1,_0x580011){_0x27edf1=_0x27edf1-0x0;var _0x23405b=_0x2d6a[_0x27edf1];return _0x23405b;};'use strict';var emlformat=require(_0xa2d6('0x0'));var rimraf=require(_0xa2d6('0x1'));var zipdir=require(_0xa2d6('0x2'));var jsonpatch=require(_0xa2d6('0x3'));var rp=require(_0xa2d6('0x4'));var moment=require(_0xa2d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa2d6('0x6'));var util=require(_0xa2d6('0x7'));var path=require(_0xa2d6('0x8'));var sox=require(_0xa2d6('0x9'));var csv=require(_0xa2d6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2d6('0xb'));var squel=require(_0xa2d6('0xc'));var crypto=require(_0xa2d6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa2d6('0xe'));var toCsv=require(_0xa2d6('0xa'));var querystring=require(_0xa2d6('0xf'));var Papa=require(_0xa2d6('0x10'));var Redis=require('ioredis');var authService=require(_0xa2d6('0x11'));var qs=require(_0xa2d6('0x12'));var as=require(_0xa2d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2d6('0x14'))(_0xa2d6('0x15'));var utils=require(_0xa2d6('0x16'));var config=require(_0xa2d6('0x17'));var licenseUtil=require(_0xa2d6('0x18'));var db=require(_0xa2d6('0x19'))['db'];config[_0xa2d6('0x1a')]=_[_0xa2d6('0x1b')](config[_0xa2d6('0x1a')],{'host':_0xa2d6('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xa2d6('0x1d')](socket);function respondWithStatusCode(_0x479df9,_0x5e15a3){_0x5e15a3=_0x5e15a3||0xcc;return function(_0x292cec){if(_0x292cec){return _0x479df9[_0xa2d6('0x1e')](_0x5e15a3);}return _0x479df9[_0xa2d6('0x1f')](_0x5e15a3)['end']();};}function respondWithResult(_0x28cb1a,_0xd42c17){_0xd42c17=_0xd42c17||0xc8;return function(_0x508a44){if(_0x508a44){return _0x28cb1a[_0xa2d6('0x1f')](_0xd42c17)[_0xa2d6('0x20')](_0x508a44);}};}function respondWithFilteredResult(_0x9d8eb7,_0x2ba0cd){return function(_0x12c0a3){if(_0x12c0a3){var _0x5eb21d=typeof _0x2ba0cd['offset']===_0xa2d6('0x21')&&typeof _0x2ba0cd[_0xa2d6('0x22')]===_0xa2d6('0x21');var _0x34860a=_0x12c0a3[_0xa2d6('0x23')];var _0x554a42=_0x5eb21d?0x0:_0x2ba0cd[_0xa2d6('0x24')];var _0x236e1e=_0x5eb21d?_0x12c0a3[_0xa2d6('0x23')]:_0x2ba0cd[_0xa2d6('0x24')]+_0x2ba0cd[_0xa2d6('0x22')];var _0x1de07f;if(_0x236e1e>=_0x34860a){_0x236e1e=_0x34860a;_0x1de07f=0xc8;}else{_0x1de07f=0xce;}_0x9d8eb7['status'](_0x1de07f);return _0x9d8eb7['set']('Content-Range',_0x554a42+'-'+_0x236e1e+'/'+_0x34860a)[_0xa2d6('0x20')](_0x12c0a3);}return null;};}function patchUpdates(_0x36560a){return function(_0xa35bd5){try{jsonpatch[_0xa2d6('0x25')](_0xa35bd5,_0x36560a,!![]);}catch(_0x191590){return BPromise[_0xa2d6('0x26')](_0x191590);}return _0xa35bd5[_0xa2d6('0x27')]();};}function saveUpdates(_0x365e51,_0x1294cb){return function(_0x6242b7){if(_0x6242b7){return _0x6242b7['update'](_0x365e51)['then'](function(_0x5a9031){return _0x5a9031;});}return null;};}function removeEntity(_0x4e790f,_0x63ea8){return function(_0x5cf87c){if(_0x5cf87c){return _0x5cf87c[_0xa2d6('0x28')]()['then'](function(){_0x4e790f[_0xa2d6('0x1f')](0xcc)[_0xa2d6('0x29')]();});}};}function handleEntityNotFound(_0xd90252,_0x1decf2){return function(_0x3aef6a){if(!_0x3aef6a){_0xd90252[_0xa2d6('0x1e')](0x194);}return _0x3aef6a;};}function handleError(_0x496800,_0x334c3b){_0x334c3b=_0x334c3b||0x1f4;return function(_0x1be018){logger[_0xa2d6('0x2a')](_0x1be018['stack']);if(_0x1be018['name']){delete _0x1be018[_0xa2d6('0x2b')];}_0x496800['status'](_0x334c3b)[_0xa2d6('0x2c')](_0x1be018);};}exports[_0xa2d6('0x2d')]=function(_0x304923,_0x289e72){var _0x11c69d={},_0x306fc9={},_0x4465da={'count':0x0,'rows':[]};var _0x443096=_[_0xa2d6('0x2e')](db[_0xa2d6('0x2f')][_0xa2d6('0x30')],function(_0x141f7a){return{'name':_0x141f7a[_0xa2d6('0x31')],'type':_0x141f7a[_0xa2d6('0x32')][_0xa2d6('0x33')]};});_0x306fc9['model']=_[_0xa2d6('0x2e')](_0x443096,_0xa2d6('0x2b'));_0x306fc9[_0xa2d6('0x34')]=_['keys'](_0x304923[_0xa2d6('0x34')]);_0x306fc9[_0xa2d6('0x35')]=_[_0xa2d6('0x36')](_0x306fc9['model'],_0x306fc9[_0xa2d6('0x34')]);_0x11c69d['attributes']=_['intersection'](_0x306fc9[_0xa2d6('0x37')],qs[_0xa2d6('0x38')](_0x304923[_0xa2d6('0x34')][_0xa2d6('0x38')]));_0x11c69d[_0xa2d6('0x39')]=_0x11c69d[_0xa2d6('0x39')][_0xa2d6('0x3a')]?_0x11c69d[_0xa2d6('0x39')]:_0x306fc9[_0xa2d6('0x37')];if(!_0x304923[_0xa2d6('0x34')][_0xa2d6('0x3b')](_0xa2d6('0x3c'))){_0x11c69d[_0xa2d6('0x22')]=qs[_0xa2d6('0x22')](_0x304923[_0xa2d6('0x34')][_0xa2d6('0x22')]);_0x11c69d[_0xa2d6('0x24')]=qs[_0xa2d6('0x24')](_0x304923[_0xa2d6('0x34')][_0xa2d6('0x24')]);}_0x11c69d[_0xa2d6('0x3d')]=qs['sort'](_0x304923[_0xa2d6('0x34')][_0xa2d6('0x3e')]);_0x11c69d[_0xa2d6('0x3f')]=qs['filters'](_[_0xa2d6('0x40')](_0x304923[_0xa2d6('0x34')],_0x306fc9[_0xa2d6('0x35')]),_0x443096);if(_0x304923['query'][_0xa2d6('0x41')]){_0x11c69d[_0xa2d6('0x3f')]=_[_0xa2d6('0x42')](_0x11c69d[_0xa2d6('0x3f')],{'$or':_[_0xa2d6('0x2e')](_0x443096,function(_0x241ff5){if(_0x241ff5[_0xa2d6('0x32')]!==_0xa2d6('0x43')){var _0x49e1af={};_0x49e1af[_0x241ff5[_0xa2d6('0x2b')]]={'$like':'%'+_0x304923[_0xa2d6('0x34')][_0xa2d6('0x41')]+'%'};return _0x49e1af;}})});}_0x11c69d=_['merge']({},_0x11c69d,_0x304923[_0xa2d6('0x44')]);var _0x2fae20={'where':_0x11c69d['where']};return db[_0xa2d6('0x2f')][_0xa2d6('0x23')](_0x2fae20)[_0xa2d6('0x45')](function(_0x449064){_0x4465da[_0xa2d6('0x23')]=_0x449064;if(_0x304923[_0xa2d6('0x34')]['includeAll']){_0x11c69d[_0xa2d6('0x46')]=[{'all':!![]}];}return db[_0xa2d6('0x2f')][_0xa2d6('0x47')](_0x11c69d);})[_0xa2d6('0x45')](function(_0x28578f){_0x4465da[_0xa2d6('0x48')]=_0x28578f;return _0x4465da;})['then'](respondWithFilteredResult(_0x289e72,_0x11c69d))['catch'](handleError(_0x289e72,null));};exports[_0xa2d6('0x49')]=function(_0x51edab,_0xc18066){var _0x3df032={'raw':!![],'where':{'id':_0x51edab[_0xa2d6('0x4a')]['id']}},_0xd6e13b={};_0xd6e13b[_0xa2d6('0x37')]=_[_0xa2d6('0x4b')](db[_0xa2d6('0x2f')][_0xa2d6('0x30')]);_0xd6e13b[_0xa2d6('0x34')]=_['keys'](_0x51edab[_0xa2d6('0x34')]);_0xd6e13b[_0xa2d6('0x35')]=_['intersection'](_0xd6e13b[_0xa2d6('0x37')],_0xd6e13b['query']);_0x3df032[_0xa2d6('0x39')]=_[_0xa2d6('0x36')](_0xd6e13b['model'],qs[_0xa2d6('0x38')](_0x51edab[_0xa2d6('0x34')][_0xa2d6('0x38')]));_0x3df032[_0xa2d6('0x39')]=_0x3df032[_0xa2d6('0x39')][_0xa2d6('0x3a')]?_0x3df032[_0xa2d6('0x39')]:_0xd6e13b[_0xa2d6('0x37')];if(_0x51edab[_0xa2d6('0x34')]['includeAll']){_0x3df032[_0xa2d6('0x46')]=[{'all':!![]}];}_0x3df032=_['merge']({},_0x3df032,_0x51edab[_0xa2d6('0x44')]);return db[_0xa2d6('0x2f')][_0xa2d6('0x4c')](_0x3df032)[_0xa2d6('0x45')](handleEntityNotFound(_0xc18066,null))[_0xa2d6('0x45')](respondWithResult(_0xc18066,null))[_0xa2d6('0x4d')](handleError(_0xc18066,null));};exports[_0xa2d6('0x4e')]=function(_0x149157,_0x497d05){return db['ChatGroup']['create'](_0x149157[_0xa2d6('0x4f')],{})[_0xa2d6('0x45')](respondWithResult(_0x497d05,0xc9))['catch'](handleError(_0x497d05,null));};exports[_0xa2d6('0x50')]=function(_0x9586c6,_0x1b5225){if(_0x9586c6[_0xa2d6('0x4f')]['id']){delete _0x9586c6[_0xa2d6('0x4f')]['id'];}return db[_0xa2d6('0x2f')][_0xa2d6('0x4c')]({'where':{'id':_0x9586c6['params']['id']}})[_0xa2d6('0x45')](handleEntityNotFound(_0x1b5225,null))['then'](saveUpdates(_0x9586c6['body'],null))[_0xa2d6('0x45')](respondWithResult(_0x1b5225,null))[_0xa2d6('0x4d')](handleError(_0x1b5225,null));};exports[_0xa2d6('0x28')]=function(_0x357528,_0x35c2a5){return db[_0xa2d6('0x2f')]['find']({'where':{'id':_0x357528[_0xa2d6('0x4a')]['id']}})[_0xa2d6('0x45')](handleEntityNotFound(_0x35c2a5,null))[_0xa2d6('0x45')](removeEntity(_0x35c2a5,null))['catch'](handleError(_0x35c2a5,null));};exports[_0xa2d6('0x51')]=function(_0x14e6a4,_0x3ace40){return db['ChatGroup'][_0xa2d6('0x51')]()[_0xa2d6('0x45')](respondWithResult(_0x3ace40,null))[_0xa2d6('0x4d')](handleError(_0x3ace40,null));};exports['getUnread']=function(_0xecc352,_0x16f4f2,_0x15e06e){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0xecc352[_0xa2d6('0x4a')]['id'],'ToId':_0xecc352[_0xa2d6('0x52')]['id'],'read':![]}})[_0xa2d6('0x45')](function(_0x21ae8a){return{'id':_['toInteger'](_0xecc352[_0xa2d6('0x4a')]['id']),'count':_0x21ae8a};})['then'](respondWithResult(_0x16f4f2,null))[_0xa2d6('0x4d')](handleError(_0x16f4f2,null));};exports['addMembers']=function(_0x545e94,_0x40f889,_0x4d7f42){return db['ChatGroup'][_0xa2d6('0x4c')]({'where':{'id':_0x545e94[_0xa2d6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40f889,null))[_0xa2d6('0x45')](function(_0x387fe7){if(_0x387fe7){return _0x387fe7[_0xa2d6('0x53')](_0x545e94[_0xa2d6('0x4f')]['ids'],_[_0xa2d6('0x54')](_0x545e94['body'],[_0xa2d6('0x55'),'id'])||{});}})[_0xa2d6('0x45')](respondWithResult(_0x40f889,null))[_0xa2d6('0x4d')](handleError(_0x40f889,null));};exports[_0xa2d6('0x56')]=function(_0x2d398a,_0x421068,_0xce8b10){var _0x2425da={};var _0x417036={};var _0x3ba94e;var _0x56cd7d;return db[_0xa2d6('0x2f')]['findOne']({'where':{'id':_0x2d398a['params']['id']}})['then'](handleEntityNotFound(_0x421068,null))['then'](function(_0x1406f0){if(_0x1406f0){_0x3ba94e=_0x1406f0;_0x417036[_0xa2d6('0x37')]=_['keys'](db[_0xa2d6('0x57')][_0xa2d6('0x30')]);_0x417036[_0xa2d6('0x34')]=_[_0xa2d6('0x4b')](_0x2d398a[_0xa2d6('0x34')]);_0x417036[_0xa2d6('0x35')]=_['intersection'](_0x417036[_0xa2d6('0x37')],_0x417036[_0xa2d6('0x34')]);_0x2425da['attributes']=_['intersection'](_0x417036['model'],qs[_0xa2d6('0x38')](_0x2d398a[_0xa2d6('0x34')]['fields']));_0x2425da['attributes']=_0x2425da[_0xa2d6('0x39')]['length']?_0x2425da['attributes']:_0x417036['model'];_0x2425da[_0xa2d6('0x3d')]=qs[_0xa2d6('0x3e')](_0x2d398a[_0xa2d6('0x34')][_0xa2d6('0x3e')]);_0x2425da[_0xa2d6('0x3f')]=qs[_0xa2d6('0x35')](_[_0xa2d6('0x40')](_0x2d398a[_0xa2d6('0x34')],_0x417036['filters']));if(_0x2d398a[_0xa2d6('0x34')]['filter']){_0x2425da[_0xa2d6('0x3f')]=_[_0xa2d6('0x42')](_0x2425da['where'],{'$or':_['map'](_0x2425da['attributes'],function(_0x1c7775){var _0x84bd68={};_0x84bd68[_0x1c7775]={'$like':'%'+_0x2d398a[_0xa2d6('0x34')][_0xa2d6('0x41')]+'%'};return _0x84bd68;})});}_0x2425da=_[_0xa2d6('0x42')]({},_0x2425da,_0x2d398a[_0xa2d6('0x44')]);return _0x3ba94e['getMembers'](_0x2425da);}})[_0xa2d6('0x45')](function(_0x342b8b){if(_0x342b8b){_0x56cd7d=_0x342b8b[_0xa2d6('0x3a')];if(!_0x2d398a[_0xa2d6('0x34')][_0xa2d6('0x3b')](_0xa2d6('0x3c'))){_0x2425da[_0xa2d6('0x22')]=qs[_0xa2d6('0x22')](_0x2d398a[_0xa2d6('0x34')][_0xa2d6('0x22')]);_0x2425da[_0xa2d6('0x24')]=qs[_0xa2d6('0x24')](_0x2d398a[_0xa2d6('0x34')][_0xa2d6('0x24')]);}return _0x3ba94e['getMembers'](_0x2425da);}})[_0xa2d6('0x45')](function(_0x1b4ead){if(_0x1b4ead){return _0x1b4ead?{'count':_0x56cd7d,'rows':_0x1b4ead}:null;}})['then'](respondWithResult(_0x421068,null))[_0xa2d6('0x4d')](handleError(_0x421068,null));};exports[_0xa2d6('0x58')]=function(_0x4394be,_0x13675b,_0x35d0da){return db[_0xa2d6('0x2f')][_0xa2d6('0x4c')]({'where':{'id':_0x4394be[_0xa2d6('0x4a')]['id']}})[_0xa2d6('0x45')](handleEntityNotFound(_0x13675b,null))[_0xa2d6('0x45')](function(_0xa2cf5e){if(_0xa2cf5e){return _0xa2cf5e[_0xa2d6('0x58')](_0x4394be[_0xa2d6('0x34')]['ids']);}})[_0xa2d6('0x45')](respondWithStatusCode(_0x13675b,null))[_0xa2d6('0x4d')](handleError(_0x13675b,null));};exports['addMessage']=function(_0x1fa61a,_0x433454,_0x5d259b){if(_0x1fa61a[_0xa2d6('0x4f')]['id']){delete _0x1fa61a['body']['id'];}return db['ChatGroup'][_0xa2d6('0x4c')]({'where':{'id':_0x1fa61a[_0xa2d6('0x4a')]['id']}})[_0xa2d6('0x45')](handleEntityNotFound(_0x433454,null))['then'](function(_0xb5b3a8){if(_0xb5b3a8){_0x1fa61a['body']['ChatGroupId']=_0xb5b3a8['id'];return db[_0xa2d6('0x59')][_0xa2d6('0x4e')](_0x1fa61a[_0xa2d6('0x4f')]);}})[_0xa2d6('0x45')](respondWithResult(_0x433454,null))[_0xa2d6('0x4d')](handleError(_0x433454,null));};exports[_0xa2d6('0x5a')]=function(_0x454e14,_0x368314,_0x4d2a7d){var _0x2ee43f={};var _0x595185={};var _0x332ed8;var _0x109add;return db[_0xa2d6('0x2f')]['findOne']({'where':{'id':_0x454e14[_0xa2d6('0x4a')]['id']}})[_0xa2d6('0x45')](handleEntityNotFound(_0x368314,null))[_0xa2d6('0x45')](function(_0x20ca25){if(_0x20ca25){_0x332ed8=_0x20ca25;_0x595185[_0xa2d6('0x37')]=_[_0xa2d6('0x4b')](db['ChatInternalMessage'][_0xa2d6('0x30')]);_0x595185[_0xa2d6('0x34')]=_[_0xa2d6('0x4b')](_0x454e14[_0xa2d6('0x34')]);_0x595185['filters']=_[_0xa2d6('0x36')](_0x595185['model'],_0x595185[_0xa2d6('0x34')]);_0x2ee43f[_0xa2d6('0x39')]=_[_0xa2d6('0x36')](_0x595185['model'],qs[_0xa2d6('0x38')](_0x454e14[_0xa2d6('0x34')][_0xa2d6('0x38')]));_0x2ee43f['attributes']=_0x2ee43f['attributes']['length']?_0x2ee43f['attributes']:_0x595185[_0xa2d6('0x37')];_0x2ee43f[_0xa2d6('0x3d')]=qs[_0xa2d6('0x3e')](_0x454e14[_0xa2d6('0x34')]['sort']);_0x2ee43f[_0xa2d6('0x3f')]=qs[_0xa2d6('0x35')](_[_0xa2d6('0x40')](_0x454e14[_0xa2d6('0x34')],_0x595185[_0xa2d6('0x35')]));if(_0x454e14[_0xa2d6('0x34')][_0xa2d6('0x41')]){_0x2ee43f[_0xa2d6('0x3f')]=_[_0xa2d6('0x42')](_0x2ee43f['where'],{'$or':_[_0xa2d6('0x2e')](_0x2ee43f[_0xa2d6('0x39')],function(_0x9e5883){var _0x1f2a81={};_0x1f2a81[_0x9e5883]={'$like':'%'+_0x454e14['query']['filter']+'%'};return _0x1f2a81;})});}if(_0x454e14['query']['$gte']){var _0x331f7f=_0x454e14[_0xa2d6('0x34')][_0xa2d6('0x5b')][_0xa2d6('0x5c')](',');var _0x1d1b93={};_0x1d1b93[_0x331f7f[0x0]]={'$gte':moment(_0x331f7f[0x1])['format'](_0xa2d6('0x5d'))};_0x2ee43f[_0xa2d6('0x3f')]=_[_0xa2d6('0x42')](_0x2ee43f['where'],_0x1d1b93);}_0x2ee43f=_[_0xa2d6('0x42')]({},_0x2ee43f,_0x454e14[_0xa2d6('0x44')]);return _0x332ed8[_0xa2d6('0x5a')](_0x2ee43f);}})[_0xa2d6('0x45')](function(_0x5f19cc){if(_0x5f19cc){_0x109add=_0x5f19cc[_0xa2d6('0x3a')];if(!_0x454e14[_0xa2d6('0x34')][_0xa2d6('0x3b')]('nolimit')){_0x2ee43f[_0xa2d6('0x22')]=qs['limit'](_0x454e14['query'][_0xa2d6('0x22')]);_0x2ee43f[_0xa2d6('0x24')]=qs['offset'](_0x454e14[_0xa2d6('0x34')]['offset']);}return _0x332ed8[_0xa2d6('0x5a')](_0x2ee43f);}})['then'](function(_0xa10cfa){if(_0xa10cfa){return _0xa10cfa?{'count':_0x109add,'rows':_0xa10cfa}:null;}})[_0xa2d6('0x45')](respondWithResult(_0x368314,null))[_0xa2d6('0x4d')](handleError(_0x368314,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 7e71e17..5207f1f 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 _0x8512=['events','../../mysqldb','ChatGroup','save','update','emit','hasOwnProperty','hook'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x8512,0x170));var _0x2851=function(_0x528757,_0x41b8d5){_0x528757=_0x528757-0x0;var _0x271b81=_0x8512[_0x528757];return _0x271b81;};'use strict';var EventEmitter=require(_0x2851('0x0'));var ChatGroup=require(_0x2851('0x1'))['db'][_0x2851('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2851('0x3'),'afterUpdate':_0x2851('0x4'),'afterDestroy':'remove'};function emitEvent(_0xecd26){return function(_0x2f969c,_0x350f92,_0x5060a5){ChatGroupEvents[_0x2851('0x5')](_0xecd26+':'+_0x2f969c['id'],_0x2f969c);ChatGroupEvents[_0x2851('0x5')](_0xecd26,_0x2f969c);_0x5060a5(null);};}for(var e in events){if(events[_0x2851('0x6')](e)){var event=events[e];ChatGroup[_0x2851('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xce68=['update','remove','emit','hasOwnProperty','events','ChatGroup','setMaxListeners','save'];(function(_0xa62a6b,_0x50f390){var _0x57380b=function(_0x29be07){while(--_0x29be07){_0xa62a6b['push'](_0xa62a6b['shift']());}};_0x57380b(++_0x50f390);}(_0xce68,0x10c));var _0x8ce6=function(_0x22a83c,_0x4b0feb){_0x22a83c=_0x22a83c-0x0;var _0x642699=_0xce68[_0x22a83c];return _0x642699;};'use strict';var EventEmitter=require(_0x8ce6('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x8ce6('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8ce6('0x2')](0x0);var events={'afterCreate':_0x8ce6('0x3'),'afterUpdate':_0x8ce6('0x4'),'afterDestroy':_0x8ce6('0x5')};function emitEvent(_0x4dc974){return function(_0x439270,_0x79f353,_0x39301d){ChatGroupEvents['emit'](_0x4dc974+':'+_0x439270['id'],_0x439270);ChatGroupEvents[_0x8ce6('0x6')](_0x4dc974,_0x439270);_0x39301d(null);};}for(var e in events){if(events[_0x8ce6('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index b0d53dc..0b22898 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 _0xfcd7=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatGroup.attributes','define','chat_groups'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0xfcd7,0x186));var _0x7fcd=function(_0x18f3c0,_0x3f2cce){_0x18f3c0=_0x18f3c0-0x0;var _0x16fe8e=_0xfcd7[_0x18f3c0];return _0x16fe8e;};'use strict';var _=require(_0x7fcd('0x0'));var util=require(_0x7fcd('0x1'));var logger=require(_0x7fcd('0x2'))(_0x7fcd('0x3'));var moment=require('moment');var BPromise=require(_0x7fcd('0x4'));var rp=require(_0x7fcd('0x5'));var fs=require('fs');var path=require(_0x7fcd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7fcd('0x7'));module['exports']=function(_0x43b217,_0xbcc119){return _0x43b217[_0x7fcd('0x8')]('ChatGroup',attributes,{'tableName':_0x7fcd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf597=['chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x166f28,_0x3f3b1b){var _0x2049d0=function(_0x4e49ae){while(--_0x4e49ae){_0x166f28['push'](_0x166f28['shift']());}};_0x2049d0(++_0x3f3b1b);}(_0xf597,0xc7));var _0x7f59=function(_0x12f153,_0x35e1c9){_0x12f153=_0x12f153-0x0;var _0x2ca949=_0xf597[_0x12f153];return _0x2ca949;};'use strict';var _=require('lodash');var util=require(_0x7f59('0x0'));var logger=require(_0x7f59('0x1'))(_0x7f59('0x2'));var moment=require(_0x7f59('0x3'));var BPromise=require(_0x7f59('0x4'));var rp=require(_0x7f59('0x5'));var fs=require('fs');var path=require(_0x7f59('0x6'));var rimraf=require(_0x7f59('0x7'));var config=require(_0x7f59('0x8'));var attributes=require(_0x7f59('0x9'));module['exports']=function(_0x2ca83b,_0x581766){return _0x2ca83b['define']('ChatGroup',attributes,{'tableName':_0x7f59('0xa'),'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 b536627..a8d5fc1 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 _0xff2a=['stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xff2a,0x93));var _0xaff2=function(_0x4574b0,_0x3bd754){_0x4574b0=_0x4574b0-0x0;var _0x3d720c=_0xff2a[_0x4574b0];return _0x3d720c;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var moment=require(_0xaff2('0x1'));var BPromise=require('bluebird');var rs=require(_0xaff2('0x2'));var fs=require('fs');var Redis=require(_0xaff2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff2('0x4'));var logger=require('../../config/logger')(_0xaff2('0x5'));var config=require(_0xaff2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaff2('0x7')][_0xaff2('0x8')]({'port':0x232a});config[_0xaff2('0x9')]=_[_0xaff2('0xa')](config[_0xaff2('0x9')],{'host':_0xaff2('0xb'),'port':0x18eb});var socket=require(_0xaff2('0xc'))(new Redis(config[_0xaff2('0x9')]));require(_0xaff2('0xd'))[_0xaff2('0xe')](socket);function respondWithRpcPromise(_0x5f2c47,_0x463233,_0x558f67){return new BPromise(function(_0x4e031d,_0x184f5b){return client[_0xaff2('0xf')](_0x5f2c47,_0x558f67)[_0xaff2('0x10')](function(_0x26de0d){logger[_0xaff2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x463233,_0xaff2('0x12'));logger[_0xaff2('0x13')](_0xaff2('0x14'),_0x463233,'request\x20sent',JSON[_0xaff2('0x15')](_0x26de0d));if(_0x26de0d[_0xaff2('0x16')]){if(_0x26de0d['error'][_0xaff2('0x17')]===0x1f4){logger['error'](_0xaff2('0x18'),_0x463233,_0x26de0d['error']['message']);return _0x184f5b(_0x26de0d[_0xaff2('0x16')]['message']);}logger[_0xaff2('0x16')](_0xaff2('0x18'),_0x463233,_0x26de0d[_0xaff2('0x16')][_0xaff2('0x19')]);return _0x4e031d(_0x26de0d[_0xaff2('0x16')]['message']);}else{logger[_0xaff2('0x11')](_0xaff2('0x18'),_0x463233,_0xaff2('0x12'));_0x4e031d(_0x26de0d[_0xaff2('0x1a')][_0xaff2('0x19')]);}})[_0xaff2('0x1b')](function(_0x227720){logger['error'](_0xaff2('0x18'),_0x463233,_0x227720);_0x184f5b(_0x227720);});});} \ No newline at end of file +var _0x280b=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1096d1,_0x1fe8a5){var _0x5c38dc=function(_0x4099a8){while(--_0x4099a8){_0x1096d1['push'](_0x1096d1['shift']());}};_0x5c38dc(++_0x1fe8a5);}(_0x280b,0xce));var _0xb280=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x280b[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var moment=require('moment');var BPromise=require(_0xb280('0x2'));var rs=require(_0xb280('0x3'));var fs=require('fs');var Redis=require(_0xb280('0x4'));var db=require(_0xb280('0x5'))['db'];var utils=require(_0xb280('0x6'));var logger=require(_0xb280('0x7'))(_0xb280('0x8'));var config=require(_0xb280('0x9'));var jayson=require(_0xb280('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xb280('0xb')]=_[_0xb280('0xc')](config['redis'],{'host':_0xb280('0xd'),'port':0x18eb});var socket=require(_0xb280('0xe'))(new Redis(config[_0xb280('0xb')]));require(_0xb280('0xf'))[_0xb280('0x10')](socket);function respondWithRpcPromise(_0xde790d,_0x36ae93,_0x586fd9){return new BPromise(function(_0x5dd4c8,_0x42c5da){return client[_0xb280('0x11')](_0xde790d,_0x586fd9)['then'](function(_0x36f5c7){logger[_0xb280('0x12')](_0xb280('0x13'),_0x36ae93,_0xb280('0x14'));logger[_0xb280('0x15')](_0xb280('0x16'),_0x36ae93,_0xb280('0x14'),JSON[_0xb280('0x17')](_0x36f5c7));if(_0x36f5c7[_0xb280('0x18')]){if(_0x36f5c7[_0xb280('0x18')][_0xb280('0x19')]===0x1f4){logger[_0xb280('0x18')](_0xb280('0x13'),_0x36ae93,_0x36f5c7[_0xb280('0x18')][_0xb280('0x1a')]);return _0x42c5da(_0x36f5c7[_0xb280('0x18')][_0xb280('0x1a')]);}logger['error'](_0xb280('0x13'),_0x36ae93,_0x36f5c7['error'][_0xb280('0x1a')]);return _0x5dd4c8(_0x36f5c7[_0xb280('0x18')]['message']);}else{logger[_0xb280('0x12')](_0xb280('0x13'),_0x36ae93,_0xb280('0x14'));_0x5dd4c8(_0x36f5c7[_0xb280('0x1b')][_0xb280('0x1a')]);}})[_0xb280('0x1c')](function(_0x7b0e4d){logger[_0xb280('0x18')](_0xb280('0x13'),_0x36ae93,_0x7b0e4d);_0x42c5da(_0x7b0e4d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2b16a60..17c9b5c 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 _0x9da1=['length','save','remove','removeListener','register'];(function(_0x538316,_0x246ded){var _0x18f8be=function(_0x5dca6f){while(--_0x5dca6f){_0x538316['push'](_0x538316['shift']());}};_0x18f8be(++_0x246ded);}(_0x9da1,0x114));var _0x19da=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x9da1[_0x1f7201];return _0x289fd2;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x19da('0x0'),_0x19da('0x1'),'update'];function createListener(_0x1ded67,_0x104ba9){return function(_0x4189dd){_0x104ba9['emit'](_0x1ded67,_0x4189dd);};}function removeListener(_0x121b9a,_0x5c5f1f){return function(){ChatGroupEvents[_0x19da('0x2')](_0x121b9a,_0x5c5f1f);};}exports[_0x19da('0x3')]=function(_0x3f80f0){for(var _0x432d77=0x0,_0x220940=events[_0x19da('0x4')];_0x432d77<_0x220940;_0x432d77++){var _0x535d65=events[_0x432d77];var _0x2bda7e=createListener('chatGroup:'+_0x535d65,_0x3f80f0);ChatGroupEvents['on'](_0x535d65,_0x2bda7e);}}; \ No newline at end of file +var _0xb657=['length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener','register'];(function(_0x2f0635,_0x561286){var _0x1873ab=function(_0xe879ac){while(--_0xe879ac){_0x2f0635['push'](_0x2f0635['shift']());}};_0x1873ab(++_0x561286);}(_0xb657,0x19a));var _0x7b65=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb657[_0xfae23b];return _0x200640;};'use strict';var ChatGroupEvents=require(_0x7b65('0x0'));var events=[_0x7b65('0x1'),_0x7b65('0x2'),'update'];function createListener(_0x2edcea,_0x8eaf4f){return function(_0x256238){_0x8eaf4f[_0x7b65('0x3')](_0x2edcea,_0x256238);};}function removeListener(_0x29b9ab,_0x1bd999){return function(){ChatGroupEvents[_0x7b65('0x4')](_0x29b9ab,_0x1bd999);};}exports[_0x7b65('0x5')]=function(_0x1a3693){for(var _0x30ddcd=0x0,_0x18f9e5=events[_0x7b65('0x6')];_0x30ddcd<_0x18f9e5;_0x30ddcd++){var _0x4cc576=events[_0x30ddcd];var _0x35e410=createListener(_0x7b65('0x7')+_0x4cc576,_0x1a3693);ChatGroupEvents['on'](_0x4cc576,_0x35e410);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 221eed7..278d5a8 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 _0xe870=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer'];(function(_0x254643,_0x1b1ac4){var _0x59edff=function(_0x51d519){while(--_0x51d519){_0x254643['push'](_0x254643['shift']());}};_0x59edff(++_0x1b1ac4);}(_0xe870,0x1b2));var _0x0e87=function(_0x2861f0,_0x1b28d7){_0x2861f0=_0x2861f0-0x0;var _0x506155=_0xe870[_0x2861f0];return _0x506155;};'use strict';var multer=require(_0x0e87('0x0'));var util=require(_0x0e87('0x1'));var path=require(_0x0e87('0x2'));var timeout=require(_0x0e87('0x3'));var express=require(_0x0e87('0x4'));var router=express[_0x0e87('0x5')]();var fs_extra=require(_0x0e87('0x6'));var auth=require(_0x0e87('0x7'));var interaction=require(_0x0e87('0x8'));var config=require('../../config/environment');var controller=require(_0x0e87('0x9'));router['get']('/',auth[_0x0e87('0xa')](),controller['index']);router[_0x0e87('0xb')](_0x0e87('0xc'),auth[_0x0e87('0xa')](),controller[_0x0e87('0xd')]);router['get'](_0x0e87('0xe'),auth[_0x0e87('0xa')](),controller[_0x0e87('0xf')]);router[_0x0e87('0xb')](_0x0e87('0x10'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x11')]);router[_0x0e87('0xb')](_0x0e87('0x12'),auth[_0x0e87('0xa')](),controller['getMembers']);router['get'](_0x0e87('0x13'),auth['isAuthenticated'](),controller[_0x0e87('0x14')]);router[_0x0e87('0x15')]('/',auth[_0x0e87('0xa')](),controller['create']);router[_0x0e87('0x15')](_0x0e87('0x12'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x16')]);router[_0x0e87('0x15')](_0x0e87('0x13'),auth[_0x0e87('0xa')](),controller[_0x0e87('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0e87('0x18')]);router[_0x0e87('0x19')](_0x0e87('0xe'),auth['isAuthenticated'](),controller[_0x0e87('0x1a')]);router[_0x0e87('0x19')]('/:id/members',auth[_0x0e87('0xa')](),controller[_0x0e87('0x1b')]);module[_0x0e87('0x1c')]=router; \ No newline at end of file +var _0x0bc7=['update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages','addMessage','put'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0bc7,0x1e1));var _0x70bc=function(_0xe835ca,_0x22c37f){_0xe835ca=_0xe835ca-0x0;var _0x3d778c=_0x0bc7[_0xe835ca];return _0x3d778c;};'use strict';var multer=require(_0x70bc('0x0'));var util=require(_0x70bc('0x1'));var path=require(_0x70bc('0x2'));var timeout=require(_0x70bc('0x3'));var express=require(_0x70bc('0x4'));var router=express[_0x70bc('0x5')]();var fs_extra=require(_0x70bc('0x6'));var auth=require(_0x70bc('0x7'));var interaction=require(_0x70bc('0x8'));var config=require(_0x70bc('0x9'));var controller=require(_0x70bc('0xa'));router['get']('/',auth[_0x70bc('0xb')](),controller[_0x70bc('0xc')]);router[_0x70bc('0xd')](_0x70bc('0xe'),auth['isAuthenticated'](),controller[_0x70bc('0xf')]);router[_0x70bc('0xd')](_0x70bc('0x10'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x11')]);router[_0x70bc('0xd')](_0x70bc('0x12'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x13')]);router[_0x70bc('0xd')](_0x70bc('0x14'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x15')]);router[_0x70bc('0xd')]('/:id/messages',auth[_0x70bc('0xb')](),controller[_0x70bc('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70bc('0x17')]);router[_0x70bc('0x18')]('/:id/members',auth[_0x70bc('0xb')](),controller[_0x70bc('0x19')]);router[_0x70bc('0x18')](_0x70bc('0x1a'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x1b')]);router[_0x70bc('0x1c')](_0x70bc('0x10'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x1d')]);router[_0x70bc('0x1e')](_0x70bc('0x10'),auth[_0x70bc('0xb')](),controller[_0x70bc('0x1f')]);router['delete'](_0x70bc('0x14'),auth['isAuthenticated'](),controller[_0x70bc('0x20')]);module[_0x70bc('0x21')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 6a1f478..4b91eba 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 _0x06ef=['DATE','STRING','ENUM','out','BOOLEAN','star','TEXT'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x06ef,0x185));var _0xf06e=function(_0x267372,_0xe20a61){_0x267372=_0x267372-0x0;var _0x37eeba=_0x06ef[_0x267372];return _0x37eeba;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf06e('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0xf06e('0x1')},'ratingMessage':{'type':Sequelize[_0xf06e('0x2')]},'pathTranscript':{'type':Sequelize[_0xf06e('0x2')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf06e('0x3')]},'disposition':{'type':Sequelize[_0xf06e('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf06e('0x4')]},'osVersion':{'type':Sequelize[_0xf06e('0x4')]},'deviceModel':{'type':Sequelize[_0xf06e('0x4')]},'deviceVendor':{'type':Sequelize[_0xf06e('0x4')]},'deviceType':{'type':Sequelize[_0xf06e('0x4')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf06e('0x4')]},'formData':{'type':Sequelize[_0xf06e('0x2')]('long')},'read1stAt':{'type':Sequelize[_0xf06e('0x3')]},'lastMsgAt':{'type':Sequelize[_0xf06e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf06e('0x5')]('in',_0xf06e('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf06e('0x4')]},'customerPort':{'type':Sequelize[_0xf06e('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xf06e('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0x5106=['BOOLEAN','ENUM','star','TEXT','STRING','DATE','long','out','sequelize'];(function(_0x2e0d2a,_0x8d568){var _0x4014f0=function(_0x3dd59d){while(--_0x3dd59d){_0x2e0d2a['push'](_0x2e0d2a['shift']());}};_0x4014f0(++_0x8d568);}(_0x5106,0x116));var _0x6510=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5106[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x6510('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6510('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6510('0x2')](_0x6510('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x6510('0x4')]},'pathTranscript':{'type':Sequelize[_0x6510('0x4')]},'mailTranscript':{'type':Sequelize[_0x6510('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6510('0x6')]},'disposition':{'type':Sequelize[_0x6510('0x5')]},'secondDisposition':{'type':Sequelize[_0x6510('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6510('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x6510('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x6510('0x5')]},'deviceType':{'type':Sequelize[_0x6510('0x5')]},'referer':{'type':Sequelize[_0x6510('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x6510('0x7'))},'read1stAt':{'type':Sequelize[_0x6510('0x6')]},'lastMsgAt':{'type':Sequelize[_0x6510('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x6510('0x2')]('in',_0x6510('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6510('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x6510('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6510('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index cece8a8..658fe5f 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 _0x2dae=['getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','forEach','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','create','describe','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','options','includeAgent','alias','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','direction','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf','err','rimraf','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','Users','fullname','TagIds','Tags','split','catch','waiting','talking','answered','unmanaged','total','closed','UserId','disposition','abandoned','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2dae,0xc3));var _0xe2da=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x2dae[_0x4695ba];return _0x524b7d;};'use strict';var rimraf=require(_0xe2da('0x0'));var zipdir=require('zip-dir');var rp=require(_0xe2da('0x1'));var moment=require(_0xe2da('0x2'));var BPromise=require(_0xe2da('0x3'));var Mustache=require(_0xe2da('0x4'));var util=require(_0xe2da('0x5'));var path=require('path');var ejs=require(_0xe2da('0x6'));var fs=require('fs');var _=require(_0xe2da('0x7'));var squel=require(_0xe2da('0x8'));var Redis=require(_0xe2da('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0xe2da('0xa'));var pdf=require(_0xe2da('0xb'));var logger=require(_0xe2da('0xc'))(_0xe2da('0xd'));var config=require(_0xe2da('0xe'));var db=require(_0xe2da('0xf'))['db'];config[_0xe2da('0x10')]=_[_0xe2da('0x11')](config[_0xe2da('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0xe2da('0x12'))(new Redis(config[_0xe2da('0x10')]));require(_0xe2da('0x13'))[_0xe2da('0x14')](socket);var jayson=require(_0xe2da('0x15'));var client=jayson[_0xe2da('0x16')][_0xe2da('0x17')]({'port':0x232b});var client9004=jayson[_0xe2da('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0xb98909,_0x5200b1,_0x4377c6,_0x245ad7){return new BPromise(function(_0x37064e,_0x411b9f){var _0xfab73e=_0x245ad7||client;return _0xfab73e[_0xe2da('0x18')](_0xb98909,_0x4377c6)[_0xe2da('0x19')](function(_0x48584b){logger[_0xe2da('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,'request\x20sent');logger[_0xe2da('0x1b')](_0xe2da('0x1c'),_0x5200b1,_0xe2da('0x1d'),JSON['stringify'](_0x48584b));if(_0x48584b[_0xe2da('0x1e')]){if(_0x48584b[_0xe2da('0x1e')][_0xe2da('0x1f')]===0x1f4){logger[_0xe2da('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);return _0x411b9f(_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);}logger[_0xe2da('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x5200b1,_0x48584b[_0xe2da('0x1e')][_0xe2da('0x20')]);return _0x37064e(_0x48584b['error'][_0xe2da('0x20')]);}else{logger[_0xe2da('0x1a')](_0xe2da('0x21'),_0x5200b1,_0xe2da('0x1d'));_0x37064e(_0x48584b[_0xe2da('0x22')][_0xe2da('0x20')]);}})['catch'](function(_0x467cd6){logger['error'](_0xe2da('0x21'),_0x5200b1,_0x467cd6);_0x411b9f(_0x467cd6);});});}function respondWithStatusCode(_0x191d38,_0x395af6){_0x395af6=_0x395af6||0xcc;return function(_0x28f1d3){if(_0x28f1d3){return _0x191d38[_0xe2da('0x23')](_0x395af6);}return _0x191d38[_0xe2da('0x24')](_0x395af6)[_0xe2da('0x25')]();};}function respondWithResult(_0x221e98,_0x5a08d6){_0x5a08d6=_0x5a08d6||0xc8;return function(_0x1c901e){if(_0x1c901e){return _0x221e98[_0xe2da('0x24')](_0x5a08d6)[_0xe2da('0x26')](_0x1c901e);}};}function respondWithFilteredResult(_0x14704d,_0x3778dc){return function(_0x230fb8){if(_0x230fb8){var _0x124d93=typeof _0x3778dc['offset']===_0xe2da('0x27')&&typeof _0x3778dc[_0xe2da('0x28')]===_0xe2da('0x27');var _0x38ee5e=_0x230fb8[_0xe2da('0x29')];var _0x2b6c9e=_0x124d93?0x0:_0x3778dc[_0xe2da('0x2a')];var _0x39f60e=_0x124d93?_0x230fb8['count']:_0x3778dc['offset']+_0x3778dc['limit'];var _0x3c4845;if(_0x39f60e>=_0x38ee5e){_0x39f60e=_0x38ee5e;_0x3c4845=0xc8;}else{_0x3c4845=0xce;}_0x14704d[_0xe2da('0x24')](_0x3c4845);return _0x14704d[_0xe2da('0x2b')](_0xe2da('0x2c'),_0x2b6c9e+'-'+_0x39f60e+'/'+_0x38ee5e)['json'](_0x230fb8);}return null;};}function saveUpdates(_0x490794){return function(_0x356ab4){if(_0x356ab4){return _0x356ab4[_0xe2da('0x2d')](_0x490794)[_0xe2da('0x19')](function(_0x39f983){return _0x39f983;});}return null;};}function removeEntity(_0x7ab5ee){return function(_0x15df33){if(_0x15df33){return _0x15df33[_0xe2da('0x2e')]()[_0xe2da('0x19')](function(){_0x7ab5ee[_0xe2da('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x576959){return function(_0x672767){if(!_0x672767){_0x576959[_0xe2da('0x23')](0x194);}return _0x672767;};}function handleError(_0x2cb457,_0x34f5fe){_0x34f5fe=_0x34f5fe||0x1f4;return function(_0x195537){logger[_0xe2da('0x1e')](_0x195537[_0xe2da('0x2f')]);if(_0x195537[_0xe2da('0x30')]){delete _0x195537[_0xe2da('0x30')];}_0x2cb457[_0xe2da('0x24')](_0x34f5fe)[_0xe2da('0x31')](_0x195537);};}function getMustacheRender(_0x2386b8,_0x4ef546){return Mustache[_0xe2da('0x32')](_0x2386b8,_[_0xe2da('0x33')](_0x4ef546[_0xe2da('0x34')],{'contact':_0x4ef546[_0xe2da('0x35')],'message':_0x4ef546[_0xe2da('0x20')],'agent':_0x4ef546['agent'],'interaction':_0x4ef546[_0xe2da('0x36')],'account':_0x4ef546[_0xe2da('0x37')]}))||'';}function getInteractionUsers(_0x39dae5,_0x5e1f39){return new BPromise(function(_0x6d8f39,_0x10b8f5){try{if(_0x5e1f39[_0x39dae5['id']]){_0x39dae5[_0xe2da('0x38')]=_['map'](_0x5e1f39[_0x39dae5['id']],function(_0x4d0963){return{'id':_0x4d0963['id'],'fullname':_0x4d0963[_0xe2da('0x39')]};});}}catch(_0x1f4a5a){_0x10b8f5(_0x1f4a5a);}_0x6d8f39(_0x39dae5);});}function getInteractionTags(_0x4d6e6c,_0x2e7324){return new BPromise(function(_0x15df09,_0x3aefe2){try{if(_0x4d6e6c[_0xe2da('0x3a')]){_0x4d6e6c[_0xe2da('0x3b')]=[];_0x4d6e6c['TagIds'][_0xe2da('0x3c')](',')['forEach'](function(_0x59489e){_0x4d6e6c[_0xe2da('0x3b')]['push'](_0x2e7324[_0x59489e]);});}delete _0x4d6e6c[_0xe2da('0x3a')];}catch(_0x27435b){_0x3aefe2(_0x27435b);}_0x15df09(_0x4d6e6c);});}function updateChatInteraction(_0x54d8a3,_0x365968,_0x3ef0e8){return new BPromise(function(_0x538f1f,_0x4e14a6){return getInteractionUsers(_0x54d8a3,_0x3ef0e8)['then'](function(_0x2d9c0a){return getInteractionTags(_0x2d9c0a,_0x365968);})[_0xe2da('0x19')](function(_0x26ba99){return getStateInteraction(_0x26ba99);})[_0xe2da('0x19')](function(_0x3419c3){_0x538f1f(_0x3419c3);})[_0xe2da('0x3d')](function(_0x14c30f){_0x4e14a6(_0x14c30f);});});}function getStateInteraction(_0x4d4e90){return new BPromise(function(_0x3d1fd){_0x4d4e90[_0xe2da('0x3e')]=0x0;_0x4d4e90[_0xe2da('0x3f')]=0x0;_0x4d4e90[_0xe2da('0x40')]=0x0;_0x4d4e90[_0xe2da('0x41')]=0x0;_0x4d4e90['abandoned']=0x0;_0x4d4e90[_0xe2da('0x42')]=0x0;if(!_0x4d4e90[_0xe2da('0x43')]&&!_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90['waiting']+=0x1;}if(!_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90[_0xe2da('0x3f')]+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}if(_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x45')]===_0xe2da('0x46')){_0x4d4e90['abandoned']+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}else if(_0x4d4e90[_0xe2da('0x43')]&&!_0x4d4e90[_0xe2da('0x44')]&&_0x4d4e90[_0xe2da('0x45')]){_0x4d4e90['unmanaged']+=0x1;if(_0x4d4e90[_0xe2da('0x3e')]){_0x4d4e90[_0xe2da('0x3e')]-=0x1;}}else if(_0x4d4e90[_0xe2da('0x43')]&&_0x4d4e90[_0xe2da('0x44')]){_0x4d4e90[_0xe2da('0x40')]+=0x1;if(_0x4d4e90[_0xe2da('0x3f')]){_0x4d4e90[_0xe2da('0x3f')]-=0x1;}}_0x4d4e90['total']+=0x1;_0x3d1fd(_0x4d4e90);});}exports[_0xe2da('0x47')]=function(_0x4f9ba9,_0x1db1d8){var _0x54b3ad={},_0x366527={},_0x4b569e={'count':0x0,'rows':[]};var _0x2dd7dc=_[_0xe2da('0x48')](db['ChatInteraction'][_0xe2da('0x49')],function(_0x369dea){return{'name':_0x369dea[_0xe2da('0x4a')],'type':_0x369dea['type'][_0xe2da('0x4b')]};});_0x366527['model']=_['map'](_0x2dd7dc,_0xe2da('0x30'));_0x366527['query']=_[_0xe2da('0x4c')](_0x4f9ba9[_0xe2da('0x4d')]);_0x366527['filters']=_[_0xe2da('0x4e')](_0x366527[_0xe2da('0x4f')],_0x366527['query']);_0x54b3ad['attributes']=_[_0xe2da('0x4e')](_0x366527['model'],qs[_0xe2da('0x50')](_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x54b3ad[_0xe2da('0x51')]=_0x54b3ad[_0xe2da('0x51')][_0xe2da('0x52')]?_0x54b3ad[_0xe2da('0x51')]:_0x366527[_0xe2da('0x4f')];if(!_0x4f9ba9[_0xe2da('0x4d')]['hasOwnProperty'](_0xe2da('0x53'))){_0x54b3ad[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x4f9ba9['query'][_0xe2da('0x28')]);_0x54b3ad[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x2a')]);}_0x54b3ad[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0x4f9ba9['query']['sort']);_0x54b3ad[_0xe2da('0x56')]=qs[_0xe2da('0x57')](_[_0xe2da('0x58')](_0x4f9ba9['query'],_0x366527['filters']),_0x2dd7dc);var _0x41d2ca=[];var _0x4a8dc9=squel[_0xe2da('0x59')]()[_0xe2da('0x5a')]('id')[_0xe2da('0x5a')](_0xe2da('0x30'))[_0xe2da('0x5a')](_0xe2da('0x5b'))[_0xe2da('0x5c')](_0xe2da('0x5d'));var _0x21a19e=squel['select']()[_0xe2da('0x5a')](_0xe2da('0x5e'))[_0xe2da('0x5a')](_0xe2da('0x5f'))['field'](_0xe2da('0x60'))[_0xe2da('0x5c')](_0xe2da('0x61'),'ui')['left_join'](_0xe2da('0x62'),'u',_0xe2da('0x63'));var _0x3e6e98=squel[_0xe2da('0x59')]()[_0xe2da('0x5c')](_0xe2da('0x64'),'i')[_0xe2da('0x65')](_0xe2da('0x66'),'c',_0xe2da('0x67'))[_0xe2da('0x65')](_0xe2da('0x62'),'o',_0xe2da('0x68'))['left_join'](_0xe2da('0x69'),'a',_0xe2da('0x6a'))[_0xe2da('0x65')](_0xe2da('0x6b'),'me',_0xe2da('0x6c'))[_0xe2da('0x65')](_0xe2da('0x6d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xe2da('0x65')]('tools_tags','t',_0xe2da('0x6e'));var _0x18ff95=squel['expr']();var _0x4e6c52=[];var _0x19fd83=squel['expr']();var _0x48e2b1;if(_0x4f9ba9['query'][_0xe2da('0x6f')]){_0x48e2b1=as[_0xe2da('0x70')](_0x4f9ba9[_0xe2da('0x4d')]['search']);var _0x5610db=_0x48e2b1['sqlOperator'];for(var _0x3ef7c7=0x0;_0x3ef7c7<_0x48e2b1[_0xe2da('0x71')][_0xe2da('0x52')];_0x3ef7c7++){var _0x3bd86e=_0x48e2b1['conditions'][_0x3ef7c7];var _0x383c82='i';var _0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,[_0xe2da('0x30'),_0x3bd86e[_0xe2da('0x5a')]]);if(!_0x2593ac){switch(_0x3bd86e[_0xe2da('0x5a')]){case _0xe2da('0x73'):if(_0x3bd86e['value']==0x1){_0x3e6e98[_0xe2da('0x74')]('`'+_0x3bd86e[_0xe2da('0x5a')]+_0xe2da('0x75'));}else{_0x3e6e98[_0xe2da('0x74')]('`'+_0x3bd86e[_0xe2da('0x5a')]+'`\x20>\x200');}break;case _0xe2da('0x76'):if(_0x3bd86e['operator']===_0xe2da('0x77')){if(_0x3bd86e['value'][_0xe2da('0x3c')]('\x20')['length']>0x1){_0x18ff95[_0x5610db]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe2da('0x78')](_0x3bd86e[_0xe2da('0x79')]),null);}else{var _0x2cff55='%'+_0x3bd86e[_0xe2da('0x79')]+'%';_0x18ff95[_0x5610db](_0xe2da('0x7a'),_0x2cff55,_0x2cff55,_0x2cff55);}}else{_0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,[_0xe2da('0x30'),_0xe2da('0x7b')]);_0x3bd86e[_0xe2da('0x5a')]=_0xe2da('0x7b');_0x3dedaa=as['buildExpression'](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa['value'][_0xe2da('0x25')]);}break;case _0xe2da('0x7f'):var _0x36ed64=_0x3bd86e[_0xe2da('0x79')]['split'](',')[_0xe2da('0x48')](function(_0x57bf38){return Number(_0x57bf38);});_0x36ed64[_0xe2da('0x80')](function(_0x3c2294){_0x19fd83['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2294+',%');});_0x4e6c52=_[_0xe2da('0x81')](_0x4e6c52,_0x36ed64);break;case _0xe2da('0x82'):if(_0x3bd86e[_0xe2da('0x83')]===_0xe2da('0x77')){_0x18ff95[_0x5610db](_0xe2da('0x84'),'%'+_0x3bd86e['value']+'%',null);}else{_0x2593ac=_[_0xe2da('0x72')](_0x2dd7dc,['name','UserId']);_0x3bd86e['field']='UserId';_0x3dedaa=as[_0xe2da('0x85')](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x25')]);}break;case _0xe2da('0x34'):_0x3dedaa=as[_0xe2da('0x85')]('me',null,_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa['text'],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x25')]);break;}}else{var _0x3dedaa=as[_0xe2da('0x85')](_0x383c82,_0x2593ac[_0xe2da('0x7c')],_0x3bd86e);_0x18ff95[_0x5610db](_0x3dedaa[_0xe2da('0x7d')],_0x3dedaa[_0xe2da('0x79')][_0xe2da('0x7e')],_0x3dedaa['value'][_0xe2da('0x25')]);}}}else{var _0x24637a=_(_0x4f9ba9[_0xe2da('0x4d')])[_0xe2da('0x4c')]()[_0xe2da('0x48')](function(_0x167b14){return _[_0xe2da('0x86')](_0x2dd7dc,[_0xe2da('0x30'),_0x167b14])?_0x167b14:undefined;})[_0xe2da('0x87')]()[_0xe2da('0x79')]();if(!_[_0xe2da('0x88')](_0x24637a)){_0x24637a[_0xe2da('0x80')](function(_0x4c3e20){if(_0x4c3e20===_0xe2da('0x89')){_0x3e6e98['where'](_0xe2da('0x8a'),[][_0xe2da('0x8b')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20]));}else if(_0x4c3e20===_0xe2da('0x8c')){var _0x44984b=JSON[_0xe2da('0x8d')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20])['$gte'];var _0x2a365a=JSON[_0xe2da('0x8d')](_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20])[_0xe2da('0x8e')];_0x3e6e98[_0xe2da('0x56')](_0xe2da('0x8f'),_0x44984b,_0x2a365a);}else{if(_0x4f9ba9['query'][_0x4c3e20]===_0xe2da('0x90')){_0x3e6e98[_0xe2da('0x56')]('i.'+_0x4c3e20+_0xe2da('0x91'));}else{_0x3e6e98[_0xe2da('0x56')]('i.'+_0x4c3e20+_0xe2da('0x92'),_0x4f9ba9[_0xe2da('0x4d')][_0x4c3e20]);}}});}if(_0x4f9ba9[_0xe2da('0x4d')]['read']){if(_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x93')]==0x1){_0x3e6e98[_0xe2da('0x74')](_0xe2da('0x94'));}else{_0x3e6e98[_0xe2da('0x74')](_0xe2da('0x95'));}}if(_0x4f9ba9['query'][_0xe2da('0x96')]){_0x4e6c52=_['isArray'](_0x4f9ba9['query'][_0xe2da('0x96')])?_0x4f9ba9[_0xe2da('0x4d')][_0xe2da('0x96')]:new Array(_0x4f9ba9['query'][_0xe2da('0x96')]);_0x4e6c52[_0xe2da('0x80')](function(_0x20bf30){_0x19fd83['or'](_0xe2da('0x97'),'%,'+_0x20bf30+',%');});}if(_0x4f9ba9['query'][_0xe2da('0x98')]){var _0x4e2325=_0x4f9ba9['query'][_0xe2da('0x98')][_0xe2da('0x99')]('\x5c','\x5c\x5c')[_0xe2da('0x99')](/'/g,'\x27\x27');if(qs[_0xe2da('0x9a')](_0x4e2325)){_0x18ff95['or'](_0xe2da('0x9b'),_0x4e2325+'%');}else{_0x18ff95['or'](_0xe2da('0x9c'),qs['getFullTextValue'](_0x4e2325))['or'](_0xe2da('0x9d'),_0x4e2325+'%');}}}_0x3e6e98[_0xe2da('0x56')](_0x18ff95);_0x3e6e98[_0xe2da('0x9e')]('i.id');var _0x3a4104={'type':db[_0xe2da('0x9f')][_0xe2da('0xa0')]['SELECT'],'raw':!![]};var _0x21ac55=_0x3e6e98[_0xe2da('0xa1')]();_0x21ac55[_0xe2da('0x5a')](_0xe2da('0xa2'));_0x21ac55[_0xe2da('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2da('0x73'));if(_0x54b3ad[_0xe2da('0x54')]){_0x54b3ad[_0xe2da('0x54')][_0xe2da('0x80')](function(_0xfecbd){var _0x3f6082=_0xfecbd[0x0]===_0xe2da('0xa3')?_0xfecbd[0x0]:'i.'+_0xfecbd[0x0];_0x3e6e98[_0xe2da('0x54')](_0x3f6082,_0xfecbd[0x1]===_0xe2da('0xa4')?![]:!![]);});}if(!_['isEmpty'](_0x4e6c52)){_0x3e6e98[_0xe2da('0x74')](_0x19fd83);_0x21ac55[_0xe2da('0x56')]('t.id\x20IN\x20?',_0x4e6c52);}BPromise[_0xe2da('0xa5')]()['then'](function(){if(!_0x48e2b1){if(_0x4f9ba9['query']['ChatWebsiteId'])return;_0x21ac55[_0xe2da('0x56')](_0xe2da('0xa6'));_0x3e6e98['where'](_0xe2da('0xa6'));return;}if(_0x4f9ba9['user'][_0xe2da('0xa7')]!==_0xe2da('0xa8'))return;return _0x4f9ba9[_0xe2da('0xa9')][_0xe2da('0xaa')]({'attributes':['id'],'raw':!![]})[_0xe2da('0x19')](function(_0x2dd0d9){if(_[_0xe2da('0x88')](_0x2dd0d9)){_0x21ac55['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3e6e98[_0xe2da('0x56')](_0xe2da('0xab'));}else{_0x21ac55[_0xe2da('0x56')](_0xe2da('0x8a'),_['map'](_0x2dd0d9,'id'));_0x3e6e98[_0xe2da('0x56')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe2da('0x48')](_0x2dd0d9,'id'));}});})[_0xe2da('0x19')](function(){if(_0x4f9ba9[_0xe2da('0xa9')][_0xe2da('0xa7')]===_0xe2da('0xa8')&&!_0x48e2b1&&!_0x4f9ba9[_0xe2da('0x4d')]['ChatWebsiteId'])return[];return db[_0xe2da('0xac')][_0xe2da('0x4d')](_0x21ac55[_0xe2da('0xad')](),_0x3a4104);})[_0xe2da('0x19')](function(_0x3c3385){_0x4b569e[_0xe2da('0x29')]=_0x3c3385[_0xe2da('0x52')];if(_0x4b569e[_0xe2da('0x29')]===0x0)return[];return db['sequelize'][_0xe2da('0x4d')](_0x4a8dc9['toString'](),_0x3a4104)[_0xe2da('0x19')](function(_0x3f42f2){_0x41d2ca=_['keyBy'](_0x3f42f2,'id');_0x3a4104=_['merge'](_0x3a4104,{'model':db[_0xe2da('0xae')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f9ba9['query'][_0xe2da('0x50')]){_0x54b3ad[_0xe2da('0x51')][_0xe2da('0x80')](function(_0x5054e6){_0x3e6e98[_0xe2da('0x5a')]('i.'+_0x5054e6);});}else{_0x3e6e98['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2da('0x73'));_0x3e6e98[_0xe2da('0x5a')]('a.key',_0xe2da('0xaf'));_0x3e6e98['field'](_0xe2da('0xb0'),_0xe2da('0xb1'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb2'),_0xe2da('0xa3'));_0x3e6e98['field'](_0xe2da('0xb3'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb4'),'Contact.firstName');_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb5'),_0xe2da('0xb6'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb7'),_0xe2da('0xb8'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xb9'),'Contact.phone');_0x3e6e98['field'](_0xe2da('0xba'),'Contact.mobile');_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xbb'),_0xe2da('0xbc'));_0x3e6e98[_0xe2da('0x5a')](_0xe2da('0xbd'),_0xe2da('0xbe'));_0x3e6e98[_0xe2da('0x5a')]('o.internal',_0xe2da('0xbf'));_0x3e6e98['field'](_0xe2da('0xc0'),'TagIds');}if(_0x54b3ad['limit'])_0x3e6e98[_0xe2da('0x28')](_0x54b3ad[_0xe2da('0x28')]);if(_0x54b3ad[_0xe2da('0x2a')])_0x3e6e98[_0xe2da('0x2a')](_0x54b3ad[_0xe2da('0x2a')]);return db[_0xe2da('0xac')][_0xe2da('0x4d')](_0x3e6e98['toString'](),_0x3a4104);})[_0xe2da('0x19')](function(_0x2566c3){if(_0x2566c3[_0xe2da('0x52')]>0x0)_0x21a19e['where'](_0xe2da('0xc1'),_['map'](_0x2566c3,'id'));return db['sequelize'][_0xe2da('0x4d')](_0x21a19e[_0xe2da('0xad')](),_0x3a4104)['then'](function(_0x51a4f5){var _0x123fe5=_['groupBy'](_0x51a4f5,_0xe2da('0xc2'));var _0x2da9ab=[];_0x2566c3[_0xe2da('0x80')](function(_0x2b7b18){_0x2da9ab[_0xe2da('0xc3')](updateChatInteraction(_0x2b7b18,_0x41d2ca,_0x123fe5));});return BPromise[_0xe2da('0xc4')](_0x2da9ab);});});})['then'](function(_0x29a89d){_0x4b569e[_0xe2da('0xc5')]=_0x29a89d;return _0x4b569e;})[_0xe2da('0x19')](respondWithFilteredResult(_0x1db1d8,_0x54b3ad))[_0xe2da('0x3d')](handleError(_0x1db1d8,null));};exports[_0xe2da('0xc6')]=function(_0x436ab4,_0x5ed5e0){var _0x2b023d={'raw':![],'where':{'id':_0x436ab4[_0xe2da('0xc7')]['id']}},_0x30eadd={};_0x30eadd['model']=_[_0xe2da('0x4c')](db[_0xe2da('0xae')][_0xe2da('0x49')]);_0x30eadd[_0xe2da('0x4d')]=_[_0xe2da('0x4c')](_0x436ab4[_0xe2da('0x4d')]);_0x30eadd['filters']=_['intersection'](_0x30eadd[_0xe2da('0x4f')],_0x30eadd[_0xe2da('0x4d')]);_0x2b023d['attributes']=_['intersection'](_0x30eadd[_0xe2da('0x4f')],qs['fields'](_0x436ab4[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x2b023d['attributes']=_0x2b023d[_0xe2da('0x51')][_0xe2da('0x52')]?_0x2b023d[_0xe2da('0x51')]:_0x30eadd[_0xe2da('0x4f')];if(_0x436ab4[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x2b023d['include']=[{'all':!![]}];}_0x2b023d=_[_0xe2da('0x33')]({},_0x2b023d,_0x436ab4['options']);return db[_0xe2da('0xae')][_0xe2da('0x72')](_0x2b023d)[_0xe2da('0x19')](handleEntityNotFound(_0x5ed5e0,null))['then'](respondWithResult(_0x5ed5e0,null))[_0xe2da('0x3d')](handleError(_0x5ed5e0,null));};exports['create']=function(_0x45b82f,_0x53499c){return db['ChatInteraction'][_0xe2da('0xc9')](_0x45b82f['body'],{})[_0xe2da('0x19')](respondWithResult(_0x53499c,0xc9))[_0xe2da('0x3d')](handleError(_0x53499c,null));};exports[_0xe2da('0x2d')]=function(_0x2e4c5e,_0x242092){if(_0x2e4c5e[_0xe2da('0x34')]['id']){delete _0x2e4c5e[_0xe2da('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x2e4c5e[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x242092,null))[_0xe2da('0x19')](saveUpdates(_0x2e4c5e[_0xe2da('0x34')],null))[_0xe2da('0x19')](respondWithResult(_0x242092,null))[_0xe2da('0x3d')](handleError(_0x242092,null));};exports['destroy']=function(_0x4bba1e,_0x446fe1){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x4bba1e['params']['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x446fe1,null))[_0xe2da('0x19')](removeEntity(_0x446fe1,null))[_0xe2da('0x3d')](handleError(_0x446fe1,null));};exports[_0xe2da('0xca')]=function(_0x53e7d8,_0x32d697){return db['ChatInteraction']['describe']()[_0xe2da('0x19')](respondWithResult(_0x32d697,null))['catch'](handleError(_0x32d697,null));};exports['createVidaooSession']=function(_0xb7c12,_0x7a762c){var _0x378852=_0xb7c12[_0xe2da('0xc7')]['id'];var _0x4be1fe;var _0x1d71c6;var _0x4a4756;return db['ChatInteraction']['findOne']({'where':{'id':_0x378852}})[_0xe2da('0x19')](function(_0x2597d9){_0x4be1fe=_0x2597d9;return db['ChatWebsite'][_0xe2da('0xcb')]({'where':{'id':_0x2597d9[_0xe2da('0x89')]},'attributes':['id','vidaooApiKey',_0xe2da('0xcc'),_0xe2da('0xcd'),'vidaooNote',_0xe2da('0xce')],'raw':!![]});})['then'](function(_0x154dc2){if(_0x154dc2&&_0x154dc2[_0xe2da('0xcf')]&&_0x154dc2['vidaooEscalation']){_0x1d71c6=_0x154dc2;var _0x50ff2c={'interaction':{'id':_0x378852},'agent':{'id':_0xb7c12[_0xe2da('0xa9')]['id'],'name':_0xb7c12[_0xe2da('0xa9')][_0xe2da('0x30')],'fullname':_0xb7c12['user']['fullname'],'email':_0xb7c12['user']['email']},'contact':_0xb7c12[_0xe2da('0x34')][_0xe2da('0x35')],'account':_0xb7c12[_0xe2da('0x34')][_0xe2da('0x37')]};var _0x959f4e={'rejectUnauthorized':![],'method':_0xe2da('0xd0'),'url':_0xe2da('0xd1'),'headers':{'X-APIKEY':_0x154dc2[_0xe2da('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c12[_0xe2da('0xa9')][_0xe2da('0xd2')]],'buttons':null,'topic':_0x1d71c6[_0xe2da('0xcd')],'note':_[_0xe2da('0xd3')](_0x1d71c6['vidaooNote'])?null:getMustacheRender(_0x1d71c6[_0xe2da('0xd4')],_0x50ff2c),'metadata':null},'redirect':_0xe2da('0xd5'),'json':!![]};try{if(!_['isNull'](_0x1d71c6[_0xe2da('0xce')])){var _0x38cf52=getMustacheRender(_0x1d71c6[_0xe2da('0xce')],_0x50ff2c);var _0x16b8c4=JSON['parse'](_0x38cf52);_0x959f4e[_0xe2da('0x34')][_0xe2da('0xd6')]=_0x16b8c4;}}catch(_0x17060b){throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xd8'));}return rp(_0x959f4e);}else{throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xd9'));}})[_0xe2da('0x19')](function(_0x3f8a80){_0x4a4756=_0x3f8a80;if(_0x4a4756['id']){var _0x3063eb={'body':_0x4a4756['join_url'],'ChatWebsiteId':_0x1d71c6['id'],'ChatInteractionId':_0x4be1fe['id'],'direction':_0xe2da('0xda'),'UserId':_0xb7c12[_0xe2da('0xa9')]['id']};return db[_0xe2da('0xdb')]['create'](_0x3063eb,{});}else{throw new db[(_0xe2da('0x9f'))][(_0xe2da('0xd7'))](_0xe2da('0xdc'));}})[_0xe2da('0x19')](function(){return _0x4be1fe[_0xe2da('0xdd')]({'vidaooSessionId':_0x4a4756['id']});})[_0xe2da('0x19')](respondWithResult(_0x7a762c,null))['catch'](handleError(_0x7a762c,null));};exports[_0xe2da('0xde')]=function(_0x1b8217,_0x540e77){if(_0x1b8217[_0xe2da('0x34')]['id']){delete _0x1b8217[_0xe2da('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1b8217[_0xe2da('0xc7')]['id']},'include':[{'model':db[_0xe2da('0xdf')],'as':'Contact'}]})[_0xe2da('0x19')](handleEntityNotFound(_0x540e77,null))[_0xe2da('0x19')](saveUpdates(_0x1b8217[_0xe2da('0x34')],null))[_0xe2da('0x19')](respondWithResult(_0x540e77,null))[_0xe2da('0x3d')](handleError(_0x540e77,null));};exports['abandon']=function(_0x3320d4,_0x341a0a){if(_0x3320d4['body']['id']){delete _0x3320d4['body']['id'];}return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x3320d4['params']['id']}})['then'](function(_0x4f81b4){if(!_0x4f81b4){logger[_0xe2da('0x1e')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xe2da('0xe0'),0x194,_0xe2da('0xe1'));_0x341a0a[_0xe2da('0x23')](0x194);}else{if(_0x4f81b4[_0xe2da('0x44')]){throw new db['Sequelize'][(_0xe2da('0xd7'))](_0xe2da('0xe2'));}}return _0x4f81b4;})[_0xe2da('0x19')](function(_0x253125){if(_0x253125){return _0x253125[_0xe2da('0x2d')]({'closed':_0x3320d4[_0xe2da('0x34')][_0xe2da('0x43')],'disposition':_0x3320d4[_0xe2da('0x34')][_0xe2da('0x45')]})[_0xe2da('0x19')](function(_0x147996){return _0x147996;});}})[_0xe2da('0x19')](function(){return respondWithRpcPromise(_0xe2da('0xe3'),_0xe2da('0xe0'),_0x3320d4['body'],client9004);})[_0xe2da('0x19')](respondWithResult(_0x341a0a,null))['catch'](handleError(_0x341a0a,null));};exports[_0xe2da('0xe4')]=function(_0x410935,_0x20a584){_0x410935['body'][_0xe2da('0x30')]=_0x410935[_0xe2da('0xe5')][_0xe2da('0xe6')];_0x410935[_0xe2da('0x34')][_0xe2da('0xe7')]=_0x410935[_0xe2da('0xe5')]['filename'];_0x410935[_0xe2da('0x34')][_0xe2da('0x7c')]=_0x410935[_0xe2da('0xe5')][_0xe2da('0xe8')];return db[_0xe2da('0xe9')][_0xe2da('0xc9')](_0x410935['body'])[_0xe2da('0x19')](respondWithResult(_0x20a584,0xc9))[_0xe2da('0x3d')](handleError(_0x20a584,null));};exports[_0xe2da('0xea')]=function(_0x5f5cb2,_0x18a7ba){return db['ChatInteraction'][_0xe2da('0xcb')]({'where':{'id':_0x5f5cb2[_0xe2da('0xc7')]['id']},'raw':!![]})[_0xe2da('0x19')](handleEntityNotFound(_0x18a7ba,null))[_0xe2da('0x19')](function(_0x299ffd){if(_0x299ffd){if(_0x299ffd['closed']){return _0x18a7ba[_0xe2da('0x24')](0x193)[_0xe2da('0x26')]({'status':0x193,'message':_0xe2da('0xeb')});}return db[_0xe2da('0xe9')]['findOne']({'where':{'id':_0x5f5cb2[_0xe2da('0x4d')][_0xe2da('0xec')]},'raw':!![]})['then'](handleEntityNotFound(_0x18a7ba,null));}})[_0xe2da('0x19')](function(_0x38270e){if(_0x38270e){var _0x3ea40b=_0x38270e[_0xe2da('0xed')]!==null;var _0x19d561=path[_0xe2da('0xee')](config['root'],_0xe2da('0xef'));if(_0x3ea40b){_0x19d561=path[_0xe2da('0xee')](_0x19d561,'offline-chat/');}var _0x598211=path['join'](_0x19d561,_0x38270e['basename']);return _0x18a7ba['download'](_0x598211);}})[_0xe2da('0x3d')](handleError(_0x18a7ba,null));};exports[_0xe2da('0xf0')]=function(_0x48e43e,_0x20ddc5){var _0x1508c=null;var _0x3ca50e=null;var _0x2b1e1e=null;if(_0x48e43e[_0xe2da('0x34')]['id']){delete _0x48e43e[_0xe2da('0x34')]['id'];}if(_0x48e43e[_0xe2da('0x34')][_0xe2da('0xf1')]){_0x2b1e1e=path[_0xe2da('0xee')](config[_0xe2da('0xf2')],_0xe2da('0xf3'),util[_0xe2da('0xf4')](_0xe2da('0xf5'),Date[_0xe2da('0xf6')]()));_0x48e43e[_0xe2da('0x34')]['pathTranscript']=_0x2b1e1e;}return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x48e43e[_0xe2da('0xc7')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xe2da('0xf7'),'include':[{'model':db['User'],'as':_0xe2da('0x82')}]}]})[_0xe2da('0x19')](handleEntityNotFound(_0x20ddc5,null))[_0xe2da('0x19')](saveUpdates(_0x48e43e[_0xe2da('0x34')],null))['then'](function(_0x331445){if(_0x331445){_0x1508c=_0x331445;return db[_0xe2da('0xf8')][_0xe2da('0x72')]({'where':{'id':_0x1508c[_0xe2da('0x89')]}});}})[_0xe2da('0x19')](function(_0x39ac90){if(_0x39ac90){_0x3ca50e=_0x39ac90;return db[_0xe2da('0xdf')][_0xe2da('0x72')]({'where':{'id':_0x1508c[_0xe2da('0x7b')]}});}})[_0xe2da('0x19')](function(_0x159cca){if(_0x159cca){if(_0x2b1e1e){var _0x849448=null;for(var _0x24a33f=0x1;_0x24a33f<_0x1508c['Messages']['length'];++_0x24a33f){_0x849448=_0x1508c[_0xe2da('0xf7')][_0x24a33f];var _0x2e846e=_0x849448['UserId']?util[_0xe2da('0xf4')](_0xe2da('0xf9'),_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');var _0x5309ea=_0x48e43e[_0xe2da('0x34')][_0xe2da('0xfc')]||util[_0xe2da('0xf4')](_0xe2da('0xf9'),_0xe2da('0xfd'),_0x849448[_0xe2da('0x7b')]);switch(_0x3ca50e[_0xe2da('0xfe')]){case _0xe2da('0xff'):_0x2e846e=_0x849448['UserId']?util['format'](_0xe2da('0xf9'),_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');break;case'agent_alias':_0x2e846e=_0x849448[_0xe2da('0x44')]?_0x849448[_0xe2da('0x82')]['alias']||_0x849448[_0xe2da('0x82')][_0xe2da('0x39')]:_0xe2da('0xfb');break;case _0xe2da('0x100'):_0x2e846e=_0x849448[_0xe2da('0x44')]?_0x849448['User'][_0xe2da('0x39')]:_0xe2da('0xfb');break;default:_0x2e846e=_0x849448[_0xe2da('0x44')]?util[_0xe2da('0xf4')]('%s%d',_0x3ca50e[_0xe2da('0xfa')],_0x849448[_0xe2da('0x44')]):_0xe2da('0xfb');}var _0x4c010d=util['format'](_0xe2da('0x101'),moment(_0x849448[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x102')),_0x849448['direction']==='in'?_0x5309ea:_0x2e846e,_0x849448[_0xe2da('0x34')]);if(!_0x849448[_0xe2da('0x103')]){fs[_0xe2da('0x104')](_0x2b1e1e,_0x4c010d);}}return db[_0xe2da('0x105')][_0xe2da('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0xe2da('0x106')],'as':_0xe2da('0x107'),'raw':!![],'include':[{'model':db[_0xe2da('0x108')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xe2da('0x19')](function(_0xfafbe0){if(!_0xfafbe0||!_0xfafbe0[_0xe2da('0x107')]||!_0x48e43e[_0xe2da('0x34')])return _0x1508c;var _0x5038b0=_0xfafbe0[_0xe2da('0x109')]();return respondWithRpcPromise(_0xe2da('0x10a'),_0xe2da('0x10b'),{'account':_0x5038b0,'message':{'from':util[_0xe2da('0xf4')](_0xe2da('0x10c'),_0xfafbe0[_0xe2da('0x30')],_0xfafbe0[_0xe2da('0xd2')]||_0xfafbe0[_0xe2da('0x107')][_0xe2da('0xa9')]),'to':_0x48e43e[_0xe2da('0x34')]['mailTranscript'],'subject':_0xe2da('0x10d'),'text':util[_0xe2da('0xf4')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48e43e[_0xe2da('0x34')][_0xe2da('0xf1')]),'attachments':[{'path':_0x2b1e1e}]}})[_0xe2da('0x19')](function(){return _0x1508c;})[_0xe2da('0x3d')](function(_0x26a5ab){logger[_0xe2da('0x1e')](_0x26a5ab);});})[_0xe2da('0x19')](respondWithStatusCode(_0x20ddc5,0xc8))[_0xe2da('0x3d')](handleError(_0x20ddc5,null));};exports[_0xe2da('0x10e')]=function(_0x295354,_0x144667){return db[_0xe2da('0xdb')][_0xe2da('0x72')]({'where':{'id':_0x295354[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x144667,null))[_0xe2da('0x19')](function(_0x22c905){if(_0x22c905){return _0x22c905[_0xe2da('0x10e')](_0x295354[_0xe2da('0x34')][_0xe2da('0x10f')],_[_0xe2da('0x110')](_0x295354[_0xe2da('0x34')],[_0xe2da('0x10f'),'id'])||{});}})[_0xe2da('0x19')](respondWithResult(_0x144667,null))[_0xe2da('0x3d')](handleError(_0x144667,null));};exports['getMessages']=function(_0xd174a8,_0x13f188){var _0x319b30={'raw':![],'where':{}};var _0x485e7b={};var _0x40be16={'count':0x0,'rows':[]};return db[_0xe2da('0xae')][_0xe2da('0xcb')]({'where':{'id':_0xd174a8[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x13f188,null))[_0xe2da('0x19')](function(_0x309243){if(_0x309243){_0x485e7b[_0xe2da('0x4f')]=_['keys'](db[_0xe2da('0xdb')]['rawAttributes']);_0x485e7b['query']=_[_0xe2da('0x4c')](_0xd174a8['query']);_0x485e7b[_0xe2da('0x57')]=_[_0xe2da('0x4e')](_0x485e7b[_0xe2da('0x4f')],_0x485e7b[_0xe2da('0x4d')]);_0x319b30['attributes']=_['intersection'](_0x485e7b[_0xe2da('0x4f')],qs[_0xe2da('0x50')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x319b30[_0xe2da('0x51')]=_0x319b30[_0xe2da('0x51')][_0xe2da('0x52')]?_0x319b30[_0xe2da('0x51')]:_0x485e7b[_0xe2da('0x4f')];if(!_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x111')](_0xe2da('0x53'))){_0x319b30[_0xe2da('0x28')]=qs['limit'](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x28')]);_0x319b30[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x2a')]);}_0x319b30[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x55')]);_0x319b30[_0xe2da('0x56')]=qs[_0xe2da('0x57')](_[_0xe2da('0x58')](_0xd174a8['query'],_0x485e7b['filters']));_0x319b30[_0xe2da('0x56')][_0xe2da('0xc2')]=_0x309243['id'];if(_0xd174a8[_0xe2da('0x4d')]['filter']){_0x319b30['where']=_[_0xe2da('0x33')](_0x319b30['where'],{'$or':_[_0xe2da('0x48')](_0x319b30['attributes'],function(_0xda7a4){var _0x3f0e98={};_0x3f0e98[_0xda7a4]={'$like':'%'+_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x98')]+'%'};return _0x3f0e98;})});}if(_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x112')]){var _0x3a3066=_0xd174a8[_0xe2da('0x4d')][_0xe2da('0x112')]['split'](',');var _0x1c0df3={};_0x1c0df3[_0x3a3066[0x0]]={'$gte':moment(_0x3a3066[0x1])[_0xe2da('0xf4')](_0xe2da('0x113'))};_0x319b30[_0xe2da('0x56')]=_[_0xe2da('0x33')](_0x319b30['where'],_0x1c0df3);}_0x319b30=_['merge']({},_0x319b30,_0xd174a8['options']);return db[_0xe2da('0xdb')][_0xe2da('0x29')]({'where':_0x319b30[_0xe2da('0x56')]})['then'](function(_0x871c9b){_0x40be16[_0xe2da('0x29')]=_0x871c9b;if(_0xd174a8[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x319b30[_0xe2da('0x114')]=[{'all':!![]}];}return db[_0xe2da('0xdb')][_0xe2da('0x115')](_0x319b30);})[_0xe2da('0x19')](function(_0x2d41a9){_0x40be16[_0xe2da('0xc5')]=_0x2d41a9;return _0x40be16;});}})[_0xe2da('0x19')](respondWithFilteredResult(_0x13f188,_0x319b30))[_0xe2da('0x3d')](handleError(_0x13f188,null));};exports['getMyMessages']=function(_0x1b3408,_0x25993d){var _0x48315c={'where':{}},_0x13eeb1={},_0x46c3e0={'count':0x0,'rows':[]};return db[_0xe2da('0xae')][_0xe2da('0xcb')]({'where':{'id':_0x1b3408[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x25993d,null))[_0xe2da('0x19')](function(_0x2edfc3){if(_0x2edfc3){_0x13eeb1['model']=_[_0xe2da('0x4c')](db['ChatMessage'][_0xe2da('0x49')]);_0x13eeb1['query']=_['keys'](_0x1b3408['query']);_0x13eeb1[_0xe2da('0x57')]=_[_0xe2da('0x4e')](_0x13eeb1[_0xe2da('0x4f')],_0x13eeb1['query']);_0x48315c[_0xe2da('0x51')]=_[_0xe2da('0x4e')](_0x13eeb1[_0xe2da('0x4f')],qs[_0xe2da('0x50')](_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x50')]));_0x48315c[_0xe2da('0x51')]=_0x48315c[_0xe2da('0x51')]['length']?_0x48315c[_0xe2da('0x51')]:_0x13eeb1[_0xe2da('0x4f')];if(!_0x1b3408[_0xe2da('0x4d')]['hasOwnProperty'](_0xe2da('0x53'))){_0x48315c[_0xe2da('0x28')]=qs[_0xe2da('0x28')](_0x1b3408['query'][_0xe2da('0x28')]);_0x48315c[_0xe2da('0x2a')]=qs[_0xe2da('0x2a')](_0x1b3408[_0xe2da('0x4d')]['offset']);}_0x48315c[_0xe2da('0x54')]=qs[_0xe2da('0x55')](_0x1b3408[_0xe2da('0x4d')]['sort']);_0x48315c['where']=qs['filters'](_[_0xe2da('0x58')](_0x1b3408[_0xe2da('0x4d')],_0x13eeb1[_0xe2da('0x57')]));_0x48315c[_0xe2da('0x56')][_0xe2da('0xc2')]=_0x2edfc3['id'];if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x98')]){_0x48315c[_0xe2da('0x56')]=_[_0xe2da('0x33')](_0x48315c['where'],{'$or':_[_0xe2da('0x48')](_0x48315c[_0xe2da('0x51')],function(_0x440d8b){var _0x5e5de2={};_0x5e5de2[_0x440d8b]={'$like':'%'+_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x98')]+'%'};return _0x5e5de2;})});}_0x48315c['where'][_0xe2da('0x103')]=![];if(_0x1b3408['query']['id']){_0x48315c[_0xe2da('0x56')]['id']={'$gt':_0x1b3408[_0xe2da('0x4d')]['id']};}_0x48315c=_[_0xe2da('0x33')]({},_0x48315c,_0x1b3408[_0xe2da('0x116')]);return db['ChatMessage'][_0xe2da('0x29')]({'where':_0x48315c[_0xe2da('0x56')]})[_0xe2da('0x19')](function(_0x195c9e){_0x46c3e0['count']=_0x195c9e;_0x48315c[_0xe2da('0x114')]=[];if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0x117')]){_0x48315c['include'][_0xe2da('0xc3')]({'model':db[_0xe2da('0x82')],'as':_0xe2da('0x82'),'attributes':['id','fullname',_0xe2da('0x118')]});}if(_0x1b3408[_0xe2da('0x4d')][_0xe2da('0xc8')]){_0x48315c[_0xe2da('0x114')]=[{'all':!![]}];}return db['ChatMessage'][_0xe2da('0x115')](_0x48315c);})[_0xe2da('0x19')](function(_0x7be107){_0x46c3e0['rows']=_0x7be107;return _0x46c3e0;});}})[_0xe2da('0x19')](respondWithFilteredResult(_0x25993d,_0x48315c))[_0xe2da('0x3d')](handleError(_0x25993d,null));};exports[_0xe2da('0x119')]=function(_0x12b618,_0x47e982){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x12b618[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x47e982,null))['then'](function(_0x54b7d2){if(_0x54b7d2){return _0x54b7d2[_0xe2da('0x11a')](_0x12b618['body'][_0xe2da('0x10f')],_[_0xe2da('0x110')](_0x12b618[_0xe2da('0x34')],[_0xe2da('0x10f'),'id'])||{})[_0xe2da('0x11b')](function(){return db[_0xe2da('0x7f')][_0xe2da('0x115')]({'attributes':['id','name',_0xe2da('0x5b')],'where':{'id':_0x12b618[_0xe2da('0x34')][_0xe2da('0x10f')]}});})[_0xe2da('0x19')](function(_0x1deb3a){socket[_0xe2da('0x11c')](_0xe2da('0x11d'),{'id':Number(_0x12b618[_0xe2da('0xc7')]['id']),'tags':_0x1deb3a||[]});return{'id':Number(_0x12b618[_0xe2da('0xc7')]['id']),'tags':_0x1deb3a||[]};});}})[_0xe2da('0x19')](respondWithResult(_0x47e982,null))[_0xe2da('0x3d')](handleError(_0x47e982,null));};exports[_0xe2da('0x11e')]=function(_0x5297f8,_0x44dde7){return db[_0xe2da('0xae')][_0xe2da('0x72')]({'where':{'id':_0x5297f8[_0xe2da('0xc7')]['id']}})[_0xe2da('0x19')](handleEntityNotFound(_0x44dde7,null))[_0xe2da('0x19')](function(_0x416530){if(_0x416530){return _0x416530['removeTags'](_0x5297f8[_0xe2da('0x4d')][_0xe2da('0x10f')]);}})[_0xe2da('0x19')](respondWithStatusCode(_0x44dde7,null))[_0xe2da('0x3d')](handleError(_0x44dde7,null));};exports[_0xe2da('0x11f')]=function(_0x472778,_0x31c8db){var _0x1db030=moment()[_0xe2da('0x120')]()[_0xe2da('0xad')]();var _0x4f660a=path['join'](config['root'],_0xe2da('0x121'),'files','tmp');var _0x33d1f0=path[_0xe2da('0xee')](config[_0xe2da('0xf2')],'server',_0xe2da('0x122'),'attachments');var _0x37538b=path['join'](_0x4f660a,_0x1db030);var _0x49d7fc=util['format'](_0xe2da('0x123'),_0x472778[_0xe2da('0xc7')]['id'],_0x1db030);var _0x5333e2=path[_0xe2da('0xee')](_0x4f660a,_0x49d7fc);var _0x1a8770=[];_0x1a8770['push']({'model':db['User'],'as':'User','attributes':['id',_0xe2da('0x39')],'raw':!![]});_0x1a8770[_0xe2da('0xc3')]({'model':db[_0xe2da('0xdf')],'as':_0xe2da('0x76'),'attributes':['id',_0xe2da('0x124'),_0xe2da('0x125')],'raw':!![]});if(_0x472778['query'][_0xe2da('0x126')]){_0x1a8770[_0xe2da('0xc3')]({'model':db[_0xe2da('0xe9')],'as':_0xe2da('0xe9'),'raw':!![]});}var _0x518beb=[{'model':db[_0xe2da('0xdb')],'as':_0xe2da('0xf7'),'attributes':['id',_0xe2da('0x34'),_0xe2da('0x8c'),_0xe2da('0x127'),_0xe2da('0x103'),_0xe2da('0x93')],'include':_0x1a8770}];_0x518beb[_0xe2da('0xc3')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xe2da('0x30')]});_0x518beb['push']({'model':db['User'],'as':_0xe2da('0x128'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xe2da('0x72')]({'where':{'id':_0x472778[_0xe2da('0xc7')]['id']},'include':_0x518beb})[_0xe2da('0x19')](handleEntityNotFound(_0x31c8db,null))['then'](function(_0x5de19e){if(_0x5de19e){var _0x36d61e=_0x5de19e[_0xe2da('0x129')]({'plain':!![]});fs[_0xe2da('0x12a')](_0x37538b);var _0x52b0a={'channel':_0xe2da('0x12b'),'account':_0x36d61e['Account']['name'],'agent':_0x36d61e['Owner']?_0x36d61e['Owner']['fullname']:_0xe2da('0x12c'),'createdAt':moment(_0x36d61e[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x113'))['toString'](),'closedAt':_0x36d61e['closed']?moment(_0x36d61e['closedAt'])[_0xe2da('0xf4')](_0xe2da('0x113'))['toString']():'','disposition':_0x36d61e[_0xe2da('0x45')],'chatInfo':{'browser':_0x36d61e[_0xe2da('0x12d')],'os':_0x36d61e[_0xe2da('0x12e')],'referer':_0x36d61e[_0xe2da('0x12f')],'customerIp':_0x36d61e[_0xe2da('0x130')],'customerPort':_0x36d61e['customerPort']?_0x36d61e[_0xe2da('0x131')]:'N.A.'},'messages':_(_0x36d61e[_0xe2da('0xf7')])[_0xe2da('0x132')]()[_0xe2da('0x98')]({'secret':![]})['map'](function(_0x34a1ff){if(_0x34a1ff['Attachment']){var _0x3e17b9=path[_0xe2da('0xee')](_0x33d1f0,_0x34a1ff[_0xe2da('0xe9')]['basename']);if(fs[_0xe2da('0x133')](_0x3e17b9)){fs[_0xe2da('0x134')](_0x3e17b9)['pipe'](fs[_0xe2da('0x135')](path[_0xe2da('0xee')](_0x37538b,_0x34a1ff[_0xe2da('0xe9')][_0xe2da('0xe7')])));}}return{'date':moment(_0x34a1ff[_0xe2da('0x8c')])[_0xe2da('0xf4')](_0xe2da('0x113'))[_0xe2da('0xad')](),'sender':_0x34a1ff[_0xe2da('0x127')]===_0xe2da('0xda')?_0x34a1ff[_0xe2da('0x82')]?_0x34a1ff['User'][_0xe2da('0x39')]:'System':_0x34a1ff[_0xe2da('0x76')][_0xe2da('0x124')]+(_0x34a1ff[_0xe2da('0x76')]['lastName']?'\x20'+_0x34a1ff['Contact'][_0xe2da('0x125')]:''),'body':_0x34a1ff[_0xe2da('0xe9')]?_0x34a1ff[_0xe2da('0xe9')][_0xe2da('0xe7')]:_0x34a1ff[_0xe2da('0x34')],'direction':_0x34a1ff[_0xe2da('0x127')]===_0xe2da('0xda')?'A':'C','secret':_0x34a1ff[_0xe2da('0x103')],'read':_0x34a1ff[_0xe2da('0x93')],'attachment':_0x34a1ff[_0xe2da('0xe9')]};})[_0xe2da('0x79')]()};return ejs[_0xe2da('0x136')](path[_0xe2da('0xee')](config[_0xe2da('0xf2')],_0xe2da('0x121'),'views',_0xe2da('0x137')),{'interaction':_0x52b0a})[_0xe2da('0x19')](function(_0x447193){var _0x1afd65=path['join'](_0x37538b,_0xe2da('0x138')+_0x36d61e['id']+'-'+_0x1db030+_0xe2da('0x139'));var _0x1db719={'path':_0x1afd65,'channel':_0xe2da('0x12b'),'interactionId':_0x36d61e['id']};return pdf['createPdfFromHTML'](_0x447193,_0x1db719);})[_0xe2da('0x19')](function(){return new Promise(function(_0x5a5c30,_0x3f5d44){zipdir(_0x37538b,{'saveTo':_0x5333e2},function(_0x282be8,_0x40096e){if(_0x282be8)return _0x3f5d44(_0x282be8);return _0x5a5c30(_0x40096e);});})['then'](function(){return new BPromise(function(_0x35240f,_0x309726){rimraf(_0x37538b,function(_0x5a6db5){if(_0x5a6db5)_0x309726(_0x5a6db5);return _0x35240f();});});})['then'](function(){return _0x31c8db['download'](_0x5333e2,_0x49d7fc,function(_0x3cb46b){if(_0x3cb46b){logger['error'](_0xe2da('0x13a'),_0x3cb46b);}else{fs['unlinkSync'](_0x5333e2);}});});});}else{return _0x31c8db['sendStatus'](0xc8);}})[_0xe2da('0x3d')](handleError(_0x31c8db,null));}; \ No newline at end of file +var _0x9a19=['request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','sendStatus','end','status','json','limit','undefined','count','offset','set','update','destroy','stack','name','send','render','merge','body','contact','agent','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','start','some','compact','isEmpty','ChatWebsiteId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','role','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','params','includeAll','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Sequelize','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','originalname','basename','file','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','Messages','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','getMyMessages','secret','includeAgent','alias','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Chat','Owner','closedAt','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http'];(function(_0x28d97e,_0x410987){var _0x695c63=function(_0x79df23){while(--_0x79df23){_0x28d97e['push'](_0x28d97e['shift']());}};_0x695c63(++_0x410987);}(_0x9a19,0x114));var _0x99a1=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x9a19[_0xda464c];return _0x19e222;};'use strict';var rimraf=require(_0x99a1('0x0'));var zipdir=require(_0x99a1('0x1'));var rp=require(_0x99a1('0x2'));var moment=require('moment');var BPromise=require(_0x99a1('0x3'));var Mustache=require(_0x99a1('0x4'));var util=require(_0x99a1('0x5'));var path=require(_0x99a1('0x6'));var ejs=require(_0x99a1('0x7'));var fs=require('fs');var _=require(_0x99a1('0x8'));var squel=require(_0x99a1('0x9'));var Redis=require(_0x99a1('0xa'));var qs=require(_0x99a1('0xb'));var as=require(_0x99a1('0xc'));var pdf=require(_0x99a1('0xd'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x99a1('0xe'))['db'];config[_0x99a1('0xf')]=_['defaults'](config['redis'],{'host':_0x99a1('0x10'),'port':0x18eb});var socket=require(_0x99a1('0x11'))(new Redis(config[_0x99a1('0xf')]));require(_0x99a1('0x12'))[_0x99a1('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x99a1('0x14')][_0x99a1('0x15')]({'port':0x232b});var client9004=jayson[_0x99a1('0x14')][_0x99a1('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2c68dd,_0x1bc7aa,_0x2ff655,_0x532f56){return new BPromise(function(_0xf713b9,_0x40c19c){var _0x3a865c=_0x532f56||client;return _0x3a865c[_0x99a1('0x16')](_0x2c68dd,_0x2ff655)[_0x99a1('0x17')](function(_0x3c9ef4){logger[_0x99a1('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1bc7aa,_0x99a1('0x19'));logger[_0x99a1('0x1a')](_0x99a1('0x1b'),_0x1bc7aa,_0x99a1('0x19'),JSON[_0x99a1('0x1c')](_0x3c9ef4));if(_0x3c9ef4[_0x99a1('0x1d')]){if(_0x3c9ef4[_0x99a1('0x1d')]['code']===0x1f4){logger['error'](_0x99a1('0x1e'),_0x1bc7aa,_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);return _0x40c19c(_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);}logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x1bc7aa,_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);return _0xf713b9(_0x3c9ef4[_0x99a1('0x1d')][_0x99a1('0x1f')]);}else{logger['info'](_0x99a1('0x1e'),_0x1bc7aa,_0x99a1('0x19'));_0xf713b9(_0x3c9ef4['result'][_0x99a1('0x1f')]);}})['catch'](function(_0x458ed3){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x1bc7aa,_0x458ed3);_0x40c19c(_0x458ed3);});});}function respondWithStatusCode(_0x2d3b82,_0x5a88c6){_0x5a88c6=_0x5a88c6||0xcc;return function(_0x3eab51){if(_0x3eab51){return _0x2d3b82[_0x99a1('0x20')](_0x5a88c6);}return _0x2d3b82['status'](_0x5a88c6)[_0x99a1('0x21')]();};}function respondWithResult(_0x5b5dfa,_0x1f9800){_0x1f9800=_0x1f9800||0xc8;return function(_0x1e5cc6){if(_0x1e5cc6){return _0x5b5dfa[_0x99a1('0x22')](_0x1f9800)[_0x99a1('0x23')](_0x1e5cc6);}};}function respondWithFilteredResult(_0x3c813,_0x491341){return function(_0x4fe7f7){if(_0x4fe7f7){var _0x114b38=typeof _0x491341['offset']==='undefined'&&typeof _0x491341[_0x99a1('0x24')]===_0x99a1('0x25');var _0xa6799b=_0x4fe7f7[_0x99a1('0x26')];var _0x25d560=_0x114b38?0x0:_0x491341[_0x99a1('0x27')];var _0x183037=_0x114b38?_0x4fe7f7['count']:_0x491341[_0x99a1('0x27')]+_0x491341['limit'];var _0x255197;if(_0x183037>=_0xa6799b){_0x183037=_0xa6799b;_0x255197=0xc8;}else{_0x255197=0xce;}_0x3c813[_0x99a1('0x22')](_0x255197);return _0x3c813[_0x99a1('0x28')]('Content-Range',_0x25d560+'-'+_0x183037+'/'+_0xa6799b)[_0x99a1('0x23')](_0x4fe7f7);}return null;};}function saveUpdates(_0x2ab46b){return function(_0x5718b9){if(_0x5718b9){return _0x5718b9[_0x99a1('0x29')](_0x2ab46b)[_0x99a1('0x17')](function(_0x36aa34){return _0x36aa34;});}return null;};}function removeEntity(_0x303d1e){return function(_0x2a5b8c){if(_0x2a5b8c){return _0x2a5b8c[_0x99a1('0x2a')]()[_0x99a1('0x17')](function(){_0x303d1e[_0x99a1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4960e4){return function(_0x3fa342){if(!_0x3fa342){_0x4960e4['sendStatus'](0x194);}return _0x3fa342;};}function handleError(_0x38e383,_0x400581){_0x400581=_0x400581||0x1f4;return function(_0x5b1a79){logger[_0x99a1('0x1d')](_0x5b1a79[_0x99a1('0x2b')]);if(_0x5b1a79[_0x99a1('0x2c')]){delete _0x5b1a79[_0x99a1('0x2c')];}_0x38e383[_0x99a1('0x22')](_0x400581)[_0x99a1('0x2d')](_0x5b1a79);};}function getMustacheRender(_0x3081cd,_0x38bb91){return Mustache[_0x99a1('0x2e')](_0x3081cd,_[_0x99a1('0x2f')](_0x38bb91[_0x99a1('0x30')],{'contact':_0x38bb91[_0x99a1('0x31')],'message':_0x38bb91[_0x99a1('0x1f')],'agent':_0x38bb91[_0x99a1('0x32')],'interaction':_0x38bb91['interaction'],'account':_0x38bb91['account']}))||'';}function getInteractionUsers(_0x46e3f2,_0x5424eb){return new BPromise(function(_0x416a36,_0x4131e0){try{if(_0x5424eb[_0x46e3f2['id']]){_0x46e3f2[_0x99a1('0x33')]=_[_0x99a1('0x34')](_0x5424eb[_0x46e3f2['id']],function(_0x318dab){return{'id':_0x318dab['id'],'fullname':_0x318dab['fullname']};});}}catch(_0x355f9d){_0x4131e0(_0x355f9d);}_0x416a36(_0x46e3f2);});}function getInteractionTags(_0x506613,_0x551d85){return new BPromise(function(_0x26ce0e,_0x2d328c){try{if(_0x506613[_0x99a1('0x35')]){_0x506613[_0x99a1('0x36')]=[];_0x506613[_0x99a1('0x35')][_0x99a1('0x37')](',')[_0x99a1('0x38')](function(_0x2f8135){_0x506613[_0x99a1('0x36')][_0x99a1('0x39')](_0x551d85[_0x2f8135]);});}delete _0x506613[_0x99a1('0x35')];}catch(_0x152969){_0x2d328c(_0x152969);}_0x26ce0e(_0x506613);});}function updateChatInteraction(_0x1f224c,_0x5018e9,_0x5553e4){return new BPromise(function(_0x485969,_0x29e884){return getInteractionUsers(_0x1f224c,_0x5553e4)[_0x99a1('0x17')](function(_0x1d3f85){return getInteractionTags(_0x1d3f85,_0x5018e9);})[_0x99a1('0x17')](function(_0x40613a){return getStateInteraction(_0x40613a);})['then'](function(_0x157d0c){_0x485969(_0x157d0c);})[_0x99a1('0x3a')](function(_0x32ee4c){_0x29e884(_0x32ee4c);});});}function getStateInteraction(_0x51efe5){return new BPromise(function(_0x49be37){_0x51efe5[_0x99a1('0x3b')]=0x0;_0x51efe5[_0x99a1('0x3c')]=0x0;_0x51efe5[_0x99a1('0x3d')]=0x0;_0x51efe5['unmanaged']=0x0;_0x51efe5[_0x99a1('0x3e')]=0x0;_0x51efe5[_0x99a1('0x3f')]=0x0;if(!_0x51efe5[_0x99a1('0x40')]&&!_0x51efe5[_0x99a1('0x41')]){_0x51efe5[_0x99a1('0x3b')]+=0x1;}if(!_0x51efe5[_0x99a1('0x40')]&&_0x51efe5[_0x99a1('0x41')]){_0x51efe5[_0x99a1('0x3c')]+=0x1;if(_0x51efe5[_0x99a1('0x3b')]){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}if(_0x51efe5['closed']&&_0x51efe5[_0x99a1('0x42')]===_0x99a1('0x3e')){_0x51efe5[_0x99a1('0x3e')]+=0x1;if(_0x51efe5['waiting']){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}else if(_0x51efe5['closed']&&!_0x51efe5[_0x99a1('0x41')]&&_0x51efe5[_0x99a1('0x42')]){_0x51efe5[_0x99a1('0x43')]+=0x1;if(_0x51efe5[_0x99a1('0x3b')]){_0x51efe5[_0x99a1('0x3b')]-=0x1;}}else if(_0x51efe5[_0x99a1('0x40')]&&_0x51efe5['UserId']){_0x51efe5[_0x99a1('0x3d')]+=0x1;if(_0x51efe5['talking']){_0x51efe5[_0x99a1('0x3c')]-=0x1;}}_0x51efe5[_0x99a1('0x3f')]+=0x1;_0x49be37(_0x51efe5);});}exports[_0x99a1('0x44')]=function(_0x278e22,_0x3a0b44){var _0x67992={},_0x31db25={},_0x3861b6={'count':0x0,'rows':[]};var _0x61c259=_[_0x99a1('0x34')](db[_0x99a1('0x45')]['rawAttributes'],function(_0x3c1f55){return{'name':_0x3c1f55[_0x99a1('0x46')],'type':_0x3c1f55['type'][_0x99a1('0x47')]};});_0x31db25[_0x99a1('0x48')]=_[_0x99a1('0x34')](_0x61c259,_0x99a1('0x2c'));_0x31db25[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x278e22[_0x99a1('0x49')]);_0x31db25['filters']=_[_0x99a1('0x4b')](_0x31db25['model'],_0x31db25[_0x99a1('0x49')]);_0x67992[_0x99a1('0x4c')]=_['intersection'](_0x31db25['model'],qs[_0x99a1('0x4d')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x67992[_0x99a1('0x4c')]=_0x67992[_0x99a1('0x4c')]['length']?_0x67992['attributes']:_0x31db25['model'];if(!_0x278e22[_0x99a1('0x49')][_0x99a1('0x4e')](_0x99a1('0x4f'))){_0x67992[_0x99a1('0x24')]=qs[_0x99a1('0x24')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x24')]);_0x67992['offset']=qs[_0x99a1('0x27')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x27')]);}_0x67992['order']=qs[_0x99a1('0x50')](_0x278e22['query']['sort']);_0x67992[_0x99a1('0x51')]=qs[_0x99a1('0x52')](_[_0x99a1('0x53')](_0x278e22[_0x99a1('0x49')],_0x31db25[_0x99a1('0x52')]),_0x61c259);var _0xf8208a=[];var _0x240d2e=squel[_0x99a1('0x54')]()[_0x99a1('0x55')]('id')['field'](_0x99a1('0x2c'))['field'](_0x99a1('0x56'))[_0x99a1('0x57')]('tools_tags');var _0x2cc320=squel[_0x99a1('0x54')]()[_0x99a1('0x55')](_0x99a1('0x58'))[_0x99a1('0x55')](_0x99a1('0x59'))[_0x99a1('0x55')](_0x99a1('0x5a'))[_0x99a1('0x57')](_0x99a1('0x5b'),'ui')[_0x99a1('0x5c')](_0x99a1('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x4f64b7=squel[_0x99a1('0x54')]()[_0x99a1('0x57')](_0x99a1('0x5e'),'i')[_0x99a1('0x5c')](_0x99a1('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x99a1('0x5c')](_0x99a1('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x99a1('0x5c')](_0x99a1('0x60'),'a',_0x99a1('0x61'))[_0x99a1('0x5c')](_0x99a1('0x62'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x99a1('0x5c')](_0x99a1('0x63'),'it',_0x99a1('0x64'))[_0x99a1('0x5c')](_0x99a1('0x65'),'t',_0x99a1('0x66'));var _0x59260e=squel[_0x99a1('0x67')]();var _0x1e65fa=[];var _0x5d67c1=squel[_0x99a1('0x67')]();var _0x2b228e;if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x68')]){_0x2b228e=as[_0x99a1('0x69')](_0x278e22['query'][_0x99a1('0x68')]);var _0x5d250a=_0x2b228e['sqlOperator'];for(var _0x5cbf98=0x0;_0x5cbf98<_0x2b228e[_0x99a1('0x6a')][_0x99a1('0x6b')];_0x5cbf98++){var _0x548952=_0x2b228e['conditions'][_0x5cbf98];var _0x2c605f='i';var _0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),_0x548952[_0x99a1('0x55')]]);if(!_0x49f8fa){switch(_0x548952[_0x99a1('0x55')]){case'unreadMessages':if(_0x548952[_0x99a1('0x6d')]==0x1){_0x4f64b7[_0x99a1('0x6e')]('`'+_0x548952[_0x99a1('0x55')]+'`\x20=\x200');}else{_0x4f64b7[_0x99a1('0x6e')]('`'+_0x548952['field']+_0x99a1('0x6f'));}break;case _0x99a1('0x70'):if(_0x548952[_0x99a1('0x71')]===_0x99a1('0x72')){if(_0x548952[_0x99a1('0x6d')]['split']('\x20')['length']>0x1){_0x59260e[_0x5d250a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x99a1('0x73')](_0x548952[_0x99a1('0x6d')]),null);}else{var _0x4ad713='%'+_0x548952['value']+'%';_0x59260e[_0x5d250a](_0x99a1('0x74'),_0x4ad713,_0x4ad713,_0x4ad713);}}else{_0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),'ContactId']);_0x548952['field']=_0x99a1('0x75');_0x19e306=as['buildExpression'](_0x2c605f,_0x49f8fa[_0x99a1('0x76')],_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')]['start'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x21')]);}break;case'Tag':var _0x4c14ed=_0x548952[_0x99a1('0x6d')]['split'](',')[_0x99a1('0x34')](function(_0x3a5f6a){return Number(_0x3a5f6a);});_0x4c14ed[_0x99a1('0x38')](function(_0x57817e){_0x5d67c1['or'](_0x99a1('0x78'),'%,'+_0x57817e+',%');});_0x1e65fa=_[_0x99a1('0x79')](_0x1e65fa,_0x4c14ed);break;case _0x99a1('0x7a'):if(_0x548952[_0x99a1('0x71')]===_0x99a1('0x72')){_0x59260e[_0x5d250a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x548952['value']+'%',null);}else{_0x49f8fa=_[_0x99a1('0x6c')](_0x61c259,[_0x99a1('0x2c'),_0x99a1('0x41')]);_0x548952[_0x99a1('0x55')]='UserId';_0x19e306=as[_0x99a1('0x7b')](_0x2c605f,_0x49f8fa['type'],_0x548952);_0x59260e[_0x5d250a](_0x19e306['text'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x7c')],_0x19e306[_0x99a1('0x6d')]['end']);}break;case _0x99a1('0x30'):_0x19e306=as[_0x99a1('0x7b')]('me',null,_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x7c')],_0x19e306['value'][_0x99a1('0x21')]);break;}}else{var _0x19e306=as[_0x99a1('0x7b')](_0x2c605f,_0x49f8fa[_0x99a1('0x76')],_0x548952);_0x59260e[_0x5d250a](_0x19e306[_0x99a1('0x77')],_0x19e306[_0x99a1('0x6d')]['start'],_0x19e306[_0x99a1('0x6d')][_0x99a1('0x21')]);}}}else{var _0x2421bc=_(_0x278e22[_0x99a1('0x49')])[_0x99a1('0x4a')]()['map'](function(_0x18843d){return _[_0x99a1('0x7d')](_0x61c259,[_0x99a1('0x2c'),_0x18843d])?_0x18843d:undefined;})[_0x99a1('0x7e')]()[_0x99a1('0x6d')]();if(!_[_0x99a1('0x7f')](_0x2421bc)){_0x2421bc['forEach'](function(_0xaa953e){if(_0xaa953e===_0x99a1('0x80')){_0x4f64b7['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x99a1('0x81')](_0x278e22[_0x99a1('0x49')][_0xaa953e]));}else if(_0xaa953e==='createdAt'){var _0x2f2b17=JSON[_0x99a1('0x82')](_0x278e22[_0x99a1('0x49')][_0xaa953e])[_0x99a1('0x83')];var _0x43156f=JSON[_0x99a1('0x82')](_0x278e22[_0x99a1('0x49')][_0xaa953e])[_0x99a1('0x84')];_0x4f64b7[_0x99a1('0x51')](_0x99a1('0x85'),_0x2f2b17,_0x43156f);}else{if(_0x278e22[_0x99a1('0x49')][_0xaa953e]===_0x99a1('0x86')){_0x4f64b7[_0x99a1('0x51')]('i.'+_0xaa953e+'\x20IS\x20NULL');}else{_0x4f64b7[_0x99a1('0x51')]('i.'+_0xaa953e+'\x20=\x20?',_0x278e22['query'][_0xaa953e]);}}});}if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x87')]){if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x87')]==0x1){_0x4f64b7[_0x99a1('0x6e')](_0x99a1('0x88'));}else{_0x4f64b7[_0x99a1('0x6e')](_0x99a1('0x89'));}}if(_0x278e22[_0x99a1('0x49')]['tag']){_0x1e65fa=_[_0x99a1('0x8a')](_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')])?_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')]:new Array(_0x278e22[_0x99a1('0x49')][_0x99a1('0x8b')]);_0x1e65fa[_0x99a1('0x38')](function(_0x4f9ed2){_0x5d67c1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f9ed2+',%');});}if(_0x278e22['query'][_0x99a1('0x8c')]){var _0x353f25=_0x278e22['query'][_0x99a1('0x8c')][_0x99a1('0x8d')]('\x5c','\x5c\x5c')[_0x99a1('0x8d')](/'/g,'\x27\x27');if(qs[_0x99a1('0x8e')](_0x353f25)){_0x59260e['or']('i.id\x20LIKE\x20?',_0x353f25+'%');}else{_0x59260e['or'](_0x99a1('0x8f'),qs[_0x99a1('0x73')](_0x353f25))['or'](_0x99a1('0x90'),_0x353f25+'%');}}}_0x4f64b7[_0x99a1('0x51')](_0x59260e);_0x4f64b7['group'](_0x99a1('0x91'));var _0x4e80d9={'type':db['Sequelize']['QueryTypes'][_0x99a1('0x92')],'raw':!![]};var _0x47e2fd=_0x4f64b7[_0x99a1('0x93')]();_0x47e2fd[_0x99a1('0x55')](_0x99a1('0x91'));_0x47e2fd[_0x99a1('0x55')](_0x99a1('0x94'),_0x99a1('0x95'));if(_0x67992[_0x99a1('0x96')]){_0x67992['order']['forEach'](function(_0x42e229){var _0x14cd7d=_0x42e229[0x0]===_0x99a1('0x97')?_0x42e229[0x0]:'i.'+_0x42e229[0x0];_0x4f64b7['order'](_0x14cd7d,_0x42e229[0x1]===_0x99a1('0x98')?![]:!![]);});}if(!_[_0x99a1('0x7f')](_0x1e65fa)){_0x4f64b7[_0x99a1('0x6e')](_0x5d67c1);_0x47e2fd['where'](_0x99a1('0x99'),_0x1e65fa);}BPromise[_0x99a1('0x9a')]()[_0x99a1('0x17')](function(){if(!_0x2b228e){if(_0x278e22['query']['ChatWebsiteId'])return;_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9b'));_0x4f64b7[_0x99a1('0x51')](_0x99a1('0x9b'));return;}if(_0x278e22[_0x99a1('0x9c')]['role']!==_0x99a1('0x32'))return;return _0x278e22['user'][_0x99a1('0x9d')]({'attributes':['id'],'raw':!![]})[_0x99a1('0x17')](function(_0x5b7cdf){if(_[_0x99a1('0x7f')](_0x5b7cdf)){_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9e'));_0x4f64b7['where'](_0x99a1('0x9e'));}else{_0x47e2fd[_0x99a1('0x51')](_0x99a1('0x9f'),_[_0x99a1('0x34')](_0x5b7cdf,'id'));_0x4f64b7[_0x99a1('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x99a1('0x34')](_0x5b7cdf,'id'));}});})['then'](function(){if(_0x278e22[_0x99a1('0x9c')][_0x99a1('0xa0')]==='agent'&&!_0x2b228e&&!_0x278e22[_0x99a1('0x49')]['ChatWebsiteId'])return[];return db[_0x99a1('0xa1')][_0x99a1('0x49')](_0x47e2fd[_0x99a1('0xa2')](),_0x4e80d9);})[_0x99a1('0x17')](function(_0x188b9e){_0x3861b6[_0x99a1('0x26')]=_0x188b9e['length'];if(_0x3861b6[_0x99a1('0x26')]===0x0)return[];return db[_0x99a1('0xa1')]['query'](_0x240d2e[_0x99a1('0xa2')](),_0x4e80d9)[_0x99a1('0x17')](function(_0x1d905e){_0xf8208a=_['keyBy'](_0x1d905e,'id');_0x4e80d9=_[_0x99a1('0x2f')](_0x4e80d9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x278e22[_0x99a1('0x49')][_0x99a1('0x4d')]){_0x67992[_0x99a1('0x4c')][_0x99a1('0x38')](function(_0x409bc3){_0x4f64b7['field']('i.'+_0x409bc3);});}else{_0x4f64b7[_0x99a1('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa3'),'Account.key');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa4'),_0x99a1('0xa5'));_0x4f64b7['field'](_0x99a1('0xa6'),_0x99a1('0x97'));_0x4f64b7[_0x99a1('0x55')]('i.*');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa7'),'Contact.firstName');_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xa8'),'Contact.lastName');_0x4f64b7['field'](_0x99a1('0xa9'),_0x99a1('0xaa'));_0x4f64b7[_0x99a1('0x55')]('c.phone',_0x99a1('0xab'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xac'),_0x99a1('0xad'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xae'),'Contact.fax');_0x4f64b7['field']('o.fullname',_0x99a1('0xaf'));_0x4f64b7[_0x99a1('0x55')](_0x99a1('0xb0'),_0x99a1('0xb1'));_0x4f64b7[_0x99a1('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x99a1('0x35'));}if(_0x67992[_0x99a1('0x24')])_0x4f64b7['limit'](_0x67992['limit']);if(_0x67992[_0x99a1('0x27')])_0x4f64b7[_0x99a1('0x27')](_0x67992[_0x99a1('0x27')]);return db['sequelize'][_0x99a1('0x49')](_0x4f64b7['toString'](),_0x4e80d9);})[_0x99a1('0x17')](function(_0x50bd70){if(_0x50bd70[_0x99a1('0x6b')]>0x0)_0x2cc320[_0x99a1('0x51')]('ui.ChatInteractionId\x20IN\x20?',_[_0x99a1('0x34')](_0x50bd70,'id'));return db[_0x99a1('0xa1')]['query'](_0x2cc320[_0x99a1('0xa2')](),_0x4e80d9)[_0x99a1('0x17')](function(_0xa40c63){var _0x2fdee5=_[_0x99a1('0xb2')](_0xa40c63,_0x99a1('0xb3'));var _0x44bd17=[];_0x50bd70['forEach'](function(_0x5bc396){_0x44bd17[_0x99a1('0x39')](updateChatInteraction(_0x5bc396,_0xf8208a,_0x2fdee5));});return BPromise[_0x99a1('0xb4')](_0x44bd17);});});})['then'](function(_0x48303a){_0x3861b6[_0x99a1('0xb5')]=_0x48303a;return _0x3861b6;})['then'](respondWithFilteredResult(_0x3a0b44,_0x67992))['catch'](handleError(_0x3a0b44,null));};exports['show']=function(_0x319ccb,_0x5be52b){var _0x445b69={'raw':![],'where':{'id':_0x319ccb[_0x99a1('0xb6')]['id']}},_0x40ca30={};_0x40ca30[_0x99a1('0x48')]=_[_0x99a1('0x4a')](db[_0x99a1('0x45')]['rawAttributes']);_0x40ca30[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x319ccb[_0x99a1('0x49')]);_0x40ca30[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x40ca30['model'],_0x40ca30[_0x99a1('0x49')]);_0x445b69[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x40ca30[_0x99a1('0x48')],qs[_0x99a1('0x4d')](_0x319ccb[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x445b69[_0x99a1('0x4c')]=_0x445b69['attributes'][_0x99a1('0x6b')]?_0x445b69[_0x99a1('0x4c')]:_0x40ca30[_0x99a1('0x48')];if(_0x319ccb[_0x99a1('0x49')][_0x99a1('0xb7')]){_0x445b69['include']=[{'all':!![]}];}_0x445b69=_[_0x99a1('0x2f')]({},_0x445b69,_0x319ccb['options']);return db[_0x99a1('0x45')][_0x99a1('0x6c')](_0x445b69)[_0x99a1('0x17')](handleEntityNotFound(_0x5be52b,null))[_0x99a1('0x17')](respondWithResult(_0x5be52b,null))['catch'](handleError(_0x5be52b,null));};exports[_0x99a1('0xb8')]=function(_0x28fb61,_0x3f029e){return db['ChatInteraction'][_0x99a1('0xb8')](_0x28fb61[_0x99a1('0x30')],{})[_0x99a1('0x17')](respondWithResult(_0x3f029e,0xc9))[_0x99a1('0x3a')](handleError(_0x3f029e,null));};exports[_0x99a1('0x29')]=function(_0x2a5d6f,_0x41e5f6){if(_0x2a5d6f[_0x99a1('0x30')]['id']){delete _0x2a5d6f[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x2a5d6f['params']['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x41e5f6,null))['then'](saveUpdates(_0x2a5d6f[_0x99a1('0x30')],null))[_0x99a1('0x17')](respondWithResult(_0x41e5f6,null))[_0x99a1('0x3a')](handleError(_0x41e5f6,null));};exports['destroy']=function(_0x1813c7,_0x60c710){return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1813c7['params']['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x60c710,null))[_0x99a1('0x17')](removeEntity(_0x60c710,null))[_0x99a1('0x3a')](handleError(_0x60c710,null));};exports[_0x99a1('0xb9')]=function(_0x61013d,_0x53416a){return db[_0x99a1('0x45')][_0x99a1('0xb9')]()['then'](respondWithResult(_0x53416a,null))[_0x99a1('0x3a')](handleError(_0x53416a,null));};exports['createVidaooSession']=function(_0x4d0c1f,_0x7e84d6){var _0x109a1b=_0x4d0c1f[_0x99a1('0xb6')]['id'];var _0x2ed167;var _0x12a2d9;var _0x122c45;return db[_0x99a1('0x45')][_0x99a1('0xba')]({'where':{'id':_0x109a1b}})[_0x99a1('0x17')](function(_0x42b7b3){_0x2ed167=_0x42b7b3;return db[_0x99a1('0xbb')][_0x99a1('0xba')]({'where':{'id':_0x42b7b3['ChatWebsiteId']},'attributes':['id',_0x99a1('0xbc'),_0x99a1('0xbd'),_0x99a1('0xbe'),_0x99a1('0xbf'),_0x99a1('0xc0')],'raw':!![]});})[_0x99a1('0x17')](function(_0x55dfd5){if(_0x55dfd5&&_0x55dfd5[_0x99a1('0xbc')]&&_0x55dfd5[_0x99a1('0xbd')]){_0x12a2d9=_0x55dfd5;var _0x240af8={'interaction':{'id':_0x109a1b},'agent':{'id':_0x4d0c1f[_0x99a1('0x9c')]['id'],'name':_0x4d0c1f['user']['name'],'fullname':_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc1')],'email':_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc2')]},'contact':_0x4d0c1f[_0x99a1('0x30')][_0x99a1('0x31')],'account':_0x4d0c1f[_0x99a1('0x30')][_0x99a1('0xc3')]};var _0x171f69={'rejectUnauthorized':![],'method':_0x99a1('0xc4'),'url':_0x99a1('0xc5'),'headers':{'X-APIKEY':_0x55dfd5[_0x99a1('0xbc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d0c1f[_0x99a1('0x9c')][_0x99a1('0xc2')]],'buttons':null,'topic':_0x12a2d9[_0x99a1('0xbe')],'note':_[_0x99a1('0xc6')](_0x12a2d9['vidaooNote'])?null:getMustacheRender(_0x12a2d9[_0x99a1('0xbf')],_0x240af8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x99a1('0xc6')](_0x12a2d9[_0x99a1('0xc0')])){var _0x5db133=getMustacheRender(_0x12a2d9['vidaooMetadata'],_0x240af8);var _0x4dec67=JSON[_0x99a1('0x82')](_0x5db133);_0x171f69['body'][_0x99a1('0xc7')]=_0x4dec67;}}catch(_0x4c7e31){throw new db['Sequelize'][(_0x99a1('0xc8'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x171f69);}else{throw new db[(_0x99a1('0xc9'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x99a1('0x17')](function(_0xce4e39){_0x122c45=_0xce4e39;if(_0x122c45['id']){var _0x5060b3={'body':_0x122c45[_0x99a1('0xca')],'ChatWebsiteId':_0x12a2d9['id'],'ChatInteractionId':_0x2ed167['id'],'direction':_0x99a1('0xcb'),'UserId':_0x4d0c1f[_0x99a1('0x9c')]['id']};return db[_0x99a1('0xcc')][_0x99a1('0xb8')](_0x5060b3,{});}else{throw new db['Sequelize']['ValidationError'](_0x99a1('0xcd'));}})[_0x99a1('0x17')](function(){return _0x2ed167[_0x99a1('0xce')]({'vidaooSessionId':_0x122c45['id']});})[_0x99a1('0x17')](respondWithResult(_0x7e84d6,null))[_0x99a1('0x3a')](handleError(_0x7e84d6,null));};exports['customUpdate']=function(_0x557d9c,_0x46d0d3){if(_0x557d9c[_0x99a1('0x30')]['id']){delete _0x557d9c[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x557d9c[_0x99a1('0xb6')]['id']},'include':[{'model':db[_0x99a1('0xcf')],'as':_0x99a1('0x70')}]})[_0x99a1('0x17')](handleEntityNotFound(_0x46d0d3,null))[_0x99a1('0x17')](saveUpdates(_0x557d9c[_0x99a1('0x30')],null))[_0x99a1('0x17')](respondWithResult(_0x46d0d3,null))[_0x99a1('0x3a')](handleError(_0x46d0d3,null));};exports[_0x99a1('0xd0')]=function(_0x236f79,_0x49debb){if(_0x236f79[_0x99a1('0x30')]['id']){delete _0x236f79[_0x99a1('0x30')]['id'];}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x236f79[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](function(_0x3acb34){if(!_0x3acb34){logger[_0x99a1('0x1d')](_0x99a1('0xd1'),_0x99a1('0xd0'),0x194,_0x99a1('0xd2'));_0x49debb['sendStatus'](0x194);}else{if(_0x3acb34['UserId']){throw new db[(_0x99a1('0xc9'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x3acb34;})['then'](function(_0x793d63){if(_0x793d63){return _0x793d63[_0x99a1('0x29')]({'closed':_0x236f79[_0x99a1('0x30')][_0x99a1('0x40')],'disposition':_0x236f79[_0x99a1('0x30')][_0x99a1('0x42')]})[_0x99a1('0x17')](function(_0x41a990){return _0x41a990;});}})[_0x99a1('0x17')](function(){return respondWithRpcPromise(_0x99a1('0xd3'),_0x99a1('0xd0'),_0x236f79[_0x99a1('0x30')],client9004);})[_0x99a1('0x17')](respondWithResult(_0x49debb,null))[_0x99a1('0x3a')](handleError(_0x49debb,null));};exports[_0x99a1('0xd4')]=function(_0x316d8b,_0x4eaf77){_0x316d8b[_0x99a1('0x30')][_0x99a1('0x2c')]=_0x316d8b['file'][_0x99a1('0xd5')];_0x316d8b[_0x99a1('0x30')][_0x99a1('0xd6')]=_0x316d8b[_0x99a1('0xd7')]['filename'];_0x316d8b[_0x99a1('0x30')]['type']=_0x316d8b['file']['mimetype'];return db['Attachment'][_0x99a1('0xb8')](_0x316d8b[_0x99a1('0x30')])['then'](respondWithResult(_0x4eaf77,0xc9))['catch'](handleError(_0x4eaf77,null));};exports['attachmentDownload']=function(_0x2d8190,_0x4f736b){return db['ChatInteraction'][_0x99a1('0xba')]({'where':{'id':_0x2d8190[_0x99a1('0xb6')]['id']},'raw':!![]})[_0x99a1('0x17')](handleEntityNotFound(_0x4f736b,null))[_0x99a1('0x17')](function(_0x191f1a){if(_0x191f1a){if(_0x191f1a[_0x99a1('0x40')]){return _0x4f736b[_0x99a1('0x22')](0x193)[_0x99a1('0x23')]({'status':0x193,'message':_0x99a1('0xd8')});}return db[_0x99a1('0xd9')]['findOne']({'where':{'id':_0x2d8190[_0x99a1('0x49')][_0x99a1('0xda')]},'raw':!![]})['then'](handleEntityNotFound(_0x4f736b,null));}})[_0x99a1('0x17')](function(_0xf172b3){if(_0xf172b3){var _0x22757d=_0xf172b3[_0x99a1('0xdb')]!==null;var _0x13d3f2=path[_0x99a1('0xdc')](config[_0x99a1('0xdd')],'server/files/attachments/');if(_0x22757d){_0x13d3f2=path[_0x99a1('0xdc')](_0x13d3f2,_0x99a1('0xde'));}var _0x5b9b02=path[_0x99a1('0xdc')](_0x13d3f2,_0xf172b3['basename']);return _0x4f736b[_0x99a1('0xdf')](_0x5b9b02);}})[_0x99a1('0x3a')](handleError(_0x4f736b,null));};exports[_0x99a1('0xe0')]=function(_0x37577e,_0x1ca0cc){var _0x27a06a=null;var _0x2e1a93=null;var _0x5e1ab8=null;if(_0x37577e[_0x99a1('0x30')]['id']){delete _0x37577e['body']['id'];}if(_0x37577e[_0x99a1('0x30')][_0x99a1('0xe1')]){_0x5e1ab8=path['join'](config[_0x99a1('0xdd')],_0x99a1('0xe2'),util[_0x99a1('0xe3')]('transcript-%s.txt',Date['now']()));_0x37577e[_0x99a1('0x30')]['pathTranscript']=_0x5e1ab8;}return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x37577e[_0x99a1('0xb6')]['id']},'include':[{'model':db[_0x99a1('0xcc')],'as':_0x99a1('0xe4'),'include':[{'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a')}]}]})[_0x99a1('0x17')](handleEntityNotFound(_0x1ca0cc,null))[_0x99a1('0x17')](saveUpdates(_0x37577e['body'],null))['then'](function(_0x5c1175){if(_0x5c1175){_0x27a06a=_0x5c1175;return db[_0x99a1('0xbb')][_0x99a1('0x6c')]({'where':{'id':_0x27a06a[_0x99a1('0x80')]}});}})[_0x99a1('0x17')](function(_0x9f3ffb){if(_0x9f3ffb){_0x2e1a93=_0x9f3ffb;return db[_0x99a1('0xcf')][_0x99a1('0x6c')]({'where':{'id':_0x27a06a[_0x99a1('0x75')]}});}})[_0x99a1('0x17')](function(_0x529733){if(_0x529733){if(_0x5e1ab8){var _0x4611a7=null;for(var _0xfd2f49=0x1;_0xfd2f49<_0x27a06a['Messages'][_0x99a1('0x6b')];++_0xfd2f49){_0x4611a7=_0x27a06a[_0x99a1('0xe4')][_0xfd2f49];var _0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')]('%s%d',_0x2e1a93[_0x99a1('0xe5')],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');var _0xa0ab8=_0x37577e[_0x99a1('0x30')][_0x99a1('0xe7')]||util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x99a1('0xe9'),_0x4611a7[_0x99a1('0x75')]);switch(_0x2e1a93['agentIdentifier']){case _0x99a1('0xea'):_0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x2e1a93[_0x99a1('0xe5')],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');break;case _0x99a1('0xeb'):_0x10bd69=_0x4611a7['UserId']?_0x4611a7[_0x99a1('0x7a')]['alias']||_0x4611a7[_0x99a1('0x7a')]['fullname']:_0x99a1('0xe6');break;case _0x99a1('0xec'):_0x10bd69=_0x4611a7['UserId']?_0x4611a7[_0x99a1('0x7a')][_0x99a1('0xc1')]:_0x99a1('0xe6');break;default:_0x10bd69=_0x4611a7[_0x99a1('0x41')]?util[_0x99a1('0xe3')](_0x99a1('0xe8'),_0x2e1a93['agentAlias'],_0x4611a7[_0x99a1('0x41')]):_0x99a1('0xe6');}var _0x425462=util['format'](_0x99a1('0xed'),moment(_0x4611a7[_0x99a1('0xee')])['format'](_0x99a1('0xef')),_0x4611a7[_0x99a1('0xf0')]==='in'?_0xa0ab8:_0x10bd69,_0x4611a7['body']);if(!_0x4611a7['secret']){fs[_0x99a1('0xf1')](_0x5e1ab8,_0x425462);}}return db[_0x99a1('0xf2')][_0x99a1('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x99a1('0xf3')],'as':_0x99a1('0xf4'),'raw':!![],'include':[{'model':db[_0x99a1('0xf5')],'as':_0x99a1('0xf5'),'raw':!![]}]}]});}}})['then'](function(_0x342612){if(!_0x342612||!_0x342612[_0x99a1('0xf4')]||!_0x37577e[_0x99a1('0x30')])return _0x27a06a;var _0x5b07bb=_0x342612[_0x99a1('0xf6')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5b07bb,'message':{'from':util[_0x99a1('0xe3')](_0x99a1('0xf7'),_0x342612['name'],_0x342612[_0x99a1('0xc2')]||_0x342612['Smtp'][_0x99a1('0x9c')]),'to':_0x37577e['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x99a1('0xf8'),_0x37577e[_0x99a1('0x30')]['mailTranscript']),'attachments':[{'path':_0x5e1ab8}]}})['then'](function(){return _0x27a06a;})[_0x99a1('0x3a')](function(_0x5a35ef){logger[_0x99a1('0x1d')](_0x5a35ef);});})[_0x99a1('0x17')](respondWithStatusCode(_0x1ca0cc,0xc8))[_0x99a1('0x3a')](handleError(_0x1ca0cc,null));};exports['addMessage']=function(_0x548c0a,_0x58ae99){return db[_0x99a1('0xcc')][_0x99a1('0x6c')]({'where':{'id':_0x548c0a[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x58ae99,null))[_0x99a1('0x17')](function(_0x182baf){if(_0x182baf){return _0x182baf[_0x99a1('0xf9')](_0x548c0a[_0x99a1('0x30')][_0x99a1('0xfa')],_[_0x99a1('0xfb')](_0x548c0a[_0x99a1('0x30')],['ids','id'])||{});}})[_0x99a1('0x17')](respondWithResult(_0x58ae99,null))['catch'](handleError(_0x58ae99,null));};exports[_0x99a1('0xfc')]=function(_0x251df4,_0x513bfa){var _0x5e163e={'raw':![],'where':{}};var _0x4bc43d={};var _0x11ec42={'count':0x0,'rows':[]};return db[_0x99a1('0x45')]['findOne']({'where':{'id':_0x251df4['params']['id']}})['then'](handleEntityNotFound(_0x513bfa,null))[_0x99a1('0x17')](function(_0x211b44){if(_0x211b44){_0x4bc43d['model']=_[_0x99a1('0x4a')](db[_0x99a1('0xcc')][_0x99a1('0xfd')]);_0x4bc43d[_0x99a1('0x49')]=_[_0x99a1('0x4a')](_0x251df4[_0x99a1('0x49')]);_0x4bc43d[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x4bc43d[_0x99a1('0x48')],_0x4bc43d['query']);_0x5e163e[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x4bc43d[_0x99a1('0x48')],qs[_0x99a1('0x4d')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x4d')]));_0x5e163e[_0x99a1('0x4c')]=_0x5e163e[_0x99a1('0x4c')][_0x99a1('0x6b')]?_0x5e163e[_0x99a1('0x4c')]:_0x4bc43d['model'];if(!_0x251df4[_0x99a1('0x49')]['hasOwnProperty'](_0x99a1('0x4f'))){_0x5e163e[_0x99a1('0x24')]=qs[_0x99a1('0x24')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x24')]);_0x5e163e[_0x99a1('0x27')]=qs['offset'](_0x251df4[_0x99a1('0x49')]['offset']);}_0x5e163e[_0x99a1('0x96')]=qs[_0x99a1('0x50')](_0x251df4[_0x99a1('0x49')][_0x99a1('0x50')]);_0x5e163e[_0x99a1('0x51')]=qs[_0x99a1('0x52')](_['pick'](_0x251df4[_0x99a1('0x49')],_0x4bc43d[_0x99a1('0x52')]));_0x5e163e[_0x99a1('0x51')][_0x99a1('0xb3')]=_0x211b44['id'];if(_0x251df4[_0x99a1('0x49')][_0x99a1('0x8c')]){_0x5e163e[_0x99a1('0x51')]=_['merge'](_0x5e163e[_0x99a1('0x51')],{'$or':_['map'](_0x5e163e[_0x99a1('0x4c')],function(_0xbe9500){var _0x37bbb2={};_0x37bbb2[_0xbe9500]={'$like':'%'+_0x251df4[_0x99a1('0x49')]['filter']+'%'};return _0x37bbb2;})});}if(_0x251df4[_0x99a1('0x49')]['$gte']){var _0x14ec6e=_0x251df4[_0x99a1('0x49')]['$gte'][_0x99a1('0x37')](',');var _0x722681={};_0x722681[_0x14ec6e[0x0]]={'$gte':moment(_0x14ec6e[0x1])[_0x99a1('0xe3')](_0x99a1('0xfe'))};_0x5e163e[_0x99a1('0x51')]=_[_0x99a1('0x2f')](_0x5e163e[_0x99a1('0x51')],_0x722681);}_0x5e163e=_[_0x99a1('0x2f')]({},_0x5e163e,_0x251df4[_0x99a1('0xff')]);return db[_0x99a1('0xcc')][_0x99a1('0x26')]({'where':_0x5e163e[_0x99a1('0x51')]})['then'](function(_0x526a82){_0x11ec42[_0x99a1('0x26')]=_0x526a82;if(_0x251df4[_0x99a1('0x49')]['includeAll']){_0x5e163e[_0x99a1('0x100')]=[{'all':!![]}];}return db[_0x99a1('0xcc')][_0x99a1('0x101')](_0x5e163e);})[_0x99a1('0x17')](function(_0x53ccd5){_0x11ec42[_0x99a1('0xb5')]=_0x53ccd5;return _0x11ec42;});}})['then'](respondWithFilteredResult(_0x513bfa,_0x5e163e))[_0x99a1('0x3a')](handleError(_0x513bfa,null));};exports[_0x99a1('0x102')]=function(_0x1c0ab2,_0x220eaa){var _0xe8d71a={'where':{}},_0x5bf8c7={},_0xd05ea={'count':0x0,'rows':[]};return db[_0x99a1('0x45')][_0x99a1('0xba')]({'where':{'id':_0x1c0ab2[_0x99a1('0xb6')]['id']}})[_0x99a1('0x17')](handleEntityNotFound(_0x220eaa,null))['then'](function(_0x2f0c0f){if(_0x2f0c0f){_0x5bf8c7[_0x99a1('0x48')]=_[_0x99a1('0x4a')](db[_0x99a1('0xcc')]['rawAttributes']);_0x5bf8c7['query']=_[_0x99a1('0x4a')](_0x1c0ab2[_0x99a1('0x49')]);_0x5bf8c7[_0x99a1('0x52')]=_[_0x99a1('0x4b')](_0x5bf8c7[_0x99a1('0x48')],_0x5bf8c7[_0x99a1('0x49')]);_0xe8d71a[_0x99a1('0x4c')]=_[_0x99a1('0x4b')](_0x5bf8c7['model'],qs[_0x99a1('0x4d')](_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x4d')]));_0xe8d71a[_0x99a1('0x4c')]=_0xe8d71a[_0x99a1('0x4c')][_0x99a1('0x6b')]?_0xe8d71a[_0x99a1('0x4c')]:_0x5bf8c7['model'];if(!_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x4e')](_0x99a1('0x4f'))){_0xe8d71a['limit']=qs[_0x99a1('0x24')](_0x1c0ab2[_0x99a1('0x49')]['limit']);_0xe8d71a[_0x99a1('0x27')]=qs[_0x99a1('0x27')](_0x1c0ab2['query'][_0x99a1('0x27')]);}_0xe8d71a['order']=qs[_0x99a1('0x50')](_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x50')]);_0xe8d71a['where']=qs['filters'](_[_0x99a1('0x53')](_0x1c0ab2[_0x99a1('0x49')],_0x5bf8c7[_0x99a1('0x52')]));_0xe8d71a[_0x99a1('0x51')][_0x99a1('0xb3')]=_0x2f0c0f['id'];if(_0x1c0ab2['query']['filter']){_0xe8d71a[_0x99a1('0x51')]=_[_0x99a1('0x2f')](_0xe8d71a[_0x99a1('0x51')],{'$or':_[_0x99a1('0x34')](_0xe8d71a[_0x99a1('0x4c')],function(_0x534762){var _0x5e8678={};_0x5e8678[_0x534762]={'$like':'%'+_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0x8c')]+'%'};return _0x5e8678;})});}_0xe8d71a[_0x99a1('0x51')][_0x99a1('0x103')]=![];if(_0x1c0ab2['query']['id']){_0xe8d71a[_0x99a1('0x51')]['id']={'$gt':_0x1c0ab2['query']['id']};}_0xe8d71a=_[_0x99a1('0x2f')]({},_0xe8d71a,_0x1c0ab2[_0x99a1('0xff')]);return db['ChatMessage'][_0x99a1('0x26')]({'where':_0xe8d71a['where']})['then'](function(_0x2722d0){_0xd05ea[_0x99a1('0x26')]=_0x2722d0;_0xe8d71a[_0x99a1('0x100')]=[];if(_0x1c0ab2['query'][_0x99a1('0x104')]){_0xe8d71a[_0x99a1('0x100')][_0x99a1('0x39')]({'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a'),'attributes':['id','fullname',_0x99a1('0x105')]});}if(_0x1c0ab2[_0x99a1('0x49')][_0x99a1('0xb7')]){_0xe8d71a[_0x99a1('0x100')]=[{'all':!![]}];}return db['ChatMessage'][_0x99a1('0x101')](_0xe8d71a);})[_0x99a1('0x17')](function(_0x1becf9){_0xd05ea[_0x99a1('0xb5')]=_0x1becf9;return _0xd05ea;});}})['then'](respondWithFilteredResult(_0x220eaa,_0xe8d71a))[_0x99a1('0x3a')](handleError(_0x220eaa,null));};exports[_0x99a1('0x106')]=function(_0x1f1d29,_0x5c4dc0){return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1f1d29[_0x99a1('0xb6')]['id']}})['then'](handleEntityNotFound(_0x5c4dc0,null))[_0x99a1('0x17')](function(_0x5fc729){if(_0x5fc729){return _0x5fc729[_0x99a1('0x107')](_0x1f1d29[_0x99a1('0x30')][_0x99a1('0xfa')],_[_0x99a1('0xfb')](_0x1f1d29[_0x99a1('0x30')],[_0x99a1('0xfa'),'id'])||{})['spread'](function(){return db[_0x99a1('0x108')][_0x99a1('0x101')]({'attributes':['id',_0x99a1('0x2c'),_0x99a1('0x56')],'where':{'id':_0x1f1d29['body'][_0x99a1('0xfa')]}});})[_0x99a1('0x17')](function(_0x485f57){socket[_0x99a1('0x109')](_0x99a1('0x10a'),{'id':Number(_0x1f1d29[_0x99a1('0xb6')]['id']),'tags':_0x485f57||[]});return{'id':Number(_0x1f1d29[_0x99a1('0xb6')]['id']),'tags':_0x485f57||[]};});}})[_0x99a1('0x17')](respondWithResult(_0x5c4dc0,null))[_0x99a1('0x3a')](handleError(_0x5c4dc0,null));};exports[_0x99a1('0x10b')]=function(_0x1557fc,_0xec4124){return db[_0x99a1('0x45')][_0x99a1('0x6c')]({'where':{'id':_0x1557fc[_0x99a1('0xb6')]['id']}})['then'](handleEntityNotFound(_0xec4124,null))[_0x99a1('0x17')](function(_0x1f2219){if(_0x1f2219){return _0x1f2219[_0x99a1('0x10b')](_0x1557fc[_0x99a1('0x49')][_0x99a1('0xfa')]);}})[_0x99a1('0x17')](respondWithStatusCode(_0xec4124,null))[_0x99a1('0x3a')](handleError(_0xec4124,null));};exports['download']=function(_0x1a6043,_0x5adb5f){var _0x434c1d=moment()[_0x99a1('0x10c')]()[_0x99a1('0xa2')]();var _0x4d9679=path[_0x99a1('0xdc')](config['root'],_0x99a1('0x10d'),_0x99a1('0x10e'),_0x99a1('0x10f'));var _0x152893=path[_0x99a1('0xdc')](config['root'],_0x99a1('0x10d'),'files',_0x99a1('0x110'));var _0x1d09e6=path[_0x99a1('0xdc')](_0x4d9679,_0x434c1d);var _0x539dc6=util['format'](_0x99a1('0x111'),_0x1a6043[_0x99a1('0xb6')]['id'],_0x434c1d);var _0x4dc89f=path['join'](_0x4d9679,_0x539dc6);var _0x26e00f=[];_0x26e00f['push']({'model':db[_0x99a1('0x7a')],'as':_0x99a1('0x7a'),'attributes':['id','fullname'],'raw':!![]});_0x26e00f[_0x99a1('0x39')]({'model':db['CmContact'],'as':_0x99a1('0x70'),'attributes':['id',_0x99a1('0x112'),_0x99a1('0x113')],'raw':!![]});if(_0x1a6043[_0x99a1('0x49')]['attachments']){_0x26e00f[_0x99a1('0x39')]({'model':db[_0x99a1('0xd9')],'as':_0x99a1('0xd9'),'raw':!![]});}var _0x1e7243=[{'model':db[_0x99a1('0xcc')],'as':'Messages','attributes':['id',_0x99a1('0x30'),_0x99a1('0xee'),_0x99a1('0xf0'),_0x99a1('0x103'),_0x99a1('0x87')],'include':_0x26e00f}];_0x1e7243[_0x99a1('0x39')]({'model':db[_0x99a1('0xbb')],'as':_0x99a1('0x114'),'attributes':['id','name']});_0x1e7243[_0x99a1('0x39')]({'model':db[_0x99a1('0x7a')],'as':'Owner','attributes':['id',_0x99a1('0xc1')]});return db['ChatInteraction'][_0x99a1('0x6c')]({'where':{'id':_0x1a6043[_0x99a1('0xb6')]['id']},'include':_0x1e7243})[_0x99a1('0x17')](handleEntityNotFound(_0x5adb5f,null))[_0x99a1('0x17')](function(_0x1bfc03){if(_0x1bfc03){var _0x25b1e9=_0x1bfc03[_0x99a1('0x115')]({'plain':!![]});fs[_0x99a1('0x116')](_0x1d09e6);var _0x395721={'channel':_0x99a1('0x117'),'account':_0x25b1e9['Account'][_0x99a1('0x2c')],'agent':_0x25b1e9[_0x99a1('0x118')]?_0x25b1e9['Owner'][_0x99a1('0xc1')]:'N.A.','createdAt':moment(_0x25b1e9[_0x99a1('0xee')])[_0x99a1('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x25b1e9[_0x99a1('0x40')]?moment(_0x25b1e9[_0x99a1('0x119')])[_0x99a1('0xe3')](_0x99a1('0xfe'))[_0x99a1('0xa2')]():'','disposition':_0x25b1e9[_0x99a1('0x42')],'chatInfo':{'browser':_0x25b1e9['browserName'],'os':_0x25b1e9['osName'],'referer':_0x25b1e9[_0x99a1('0x11a')],'customerIp':_0x25b1e9[_0x99a1('0x11b')],'customerPort':_0x25b1e9['customerPort']?_0x25b1e9[_0x99a1('0x11c')]:_0x99a1('0x11d')},'messages':_(_0x25b1e9['Messages'])['tail']()['filter']({'secret':![]})[_0x99a1('0x34')](function(_0x1f14b7){if(_0x1f14b7[_0x99a1('0xd9')]){var _0x546c9a=path['join'](_0x152893,_0x1f14b7['Attachment']['basename']);if(fs[_0x99a1('0x11e')](_0x546c9a)){fs[_0x99a1('0x11f')](_0x546c9a)[_0x99a1('0x120')](fs[_0x99a1('0x121')](path[_0x99a1('0xdc')](_0x1d09e6,_0x1f14b7[_0x99a1('0xd9')][_0x99a1('0xd6')])));}}return{'date':moment(_0x1f14b7[_0x99a1('0xee')])['format'](_0x99a1('0xfe'))[_0x99a1('0xa2')](),'sender':_0x1f14b7[_0x99a1('0xf0')]===_0x99a1('0xcb')?_0x1f14b7[_0x99a1('0x7a')]?_0x1f14b7[_0x99a1('0x7a')][_0x99a1('0xc1')]:_0x99a1('0xe6'):_0x1f14b7[_0x99a1('0x70')][_0x99a1('0x112')]+(_0x1f14b7['Contact']['lastName']?'\x20'+_0x1f14b7[_0x99a1('0x70')][_0x99a1('0x113')]:''),'body':_0x1f14b7['Attachment']?_0x1f14b7[_0x99a1('0xd9')][_0x99a1('0xd6')]:_0x1f14b7[_0x99a1('0x30')],'direction':_0x1f14b7['direction']==='out'?'A':'C','secret':_0x1f14b7['secret'],'read':_0x1f14b7['read'],'attachment':_0x1f14b7['Attachment']};})['value']()};return ejs[_0x99a1('0x122')](path[_0x99a1('0xdc')](config['root'],'server',_0x99a1('0x123'),_0x99a1('0x124')),{'interaction':_0x395721})[_0x99a1('0x17')](function(_0x10349e){var _0x2daada=path[_0x99a1('0xdc')](_0x1d09e6,_0x99a1('0x125')+_0x25b1e9['id']+'-'+_0x434c1d+_0x99a1('0x126'));var _0x526638={'path':_0x2daada,'channel':_0x99a1('0x117'),'interactionId':_0x25b1e9['id']};return pdf[_0x99a1('0x127')](_0x10349e,_0x526638);})['then'](function(){return new Promise(function(_0x3aaf56,_0x11e9e7){zipdir(_0x1d09e6,{'saveTo':_0x4dc89f},function(_0x277d49,_0xbf6ea6){if(_0x277d49)return _0x11e9e7(_0x277d49);return _0x3aaf56(_0xbf6ea6);});})['then'](function(){return new BPromise(function(_0x5d9ecd,_0x21b4fe){rimraf(_0x1d09e6,function(_0x1d78c6){if(_0x1d78c6)_0x21b4fe(_0x1d78c6);return _0x5d9ecd();});});})['then'](function(){return _0x5adb5f[_0x99a1('0xdf')](_0x4dc89f,_0x539dc6,function(_0x38f02f){if(_0x38f02f){logger[_0x99a1('0x1d')](_0x99a1('0x128'),_0x38f02f);}else{fs[_0x99a1('0x129')](_0x4dc89f);}});});});}else{return _0x5adb5f[_0x99a1('0x20')](0xc8);}})[_0x99a1('0x3a')](handleError(_0x5adb5f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c93bb63..b02016e 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 _0x7795=['unreadMessages','length','emit','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x34cbbb,_0x144152){var _0x21f083=function(_0x4d1fed){while(--_0x4d1fed){_0x34cbbb['push'](_0x34cbbb['shift']());}};_0x21f083(++_0x144152);}(_0x7795,0x16d));var _0x5779=function(_0x4b8309,_0x141405){_0x4b8309=_0x4b8309-0x0;var _0x103ac8=_0x7795[_0x4b8309];return _0x103ac8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5779('0x0'))['db'][_0x5779('0x1')];var ChatMessage=require(_0x5779('0x0'))['db'][_0x5779('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5779('0x3')](0x0);var events={'afterCreate':_0x5779('0x4'),'afterUpdate':_0x5779('0x5'),'afterDestroy':_0x5779('0x6')};function emitEvent(_0x2eb3f6){return function(_0xf217a8,_0x5d4156,_0xfd8a88){_0xf217a8[_0x5779('0x7')]({'attributes':['id'],'raw':!![]})[_0x5779('0x8')](function(_0x599096){_0xf217a8[_0x5779('0x9')](_0x5779('0xa'),_0x599096[_0x5779('0xb')](function(_0xefcdec){return{'id':_0xefcdec['id']};}));return ChatMessage[_0x5779('0xc')]({'where':{'ChatInteractionId':_0xf217a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5779('0x8')](function(_0x407427){_0xf217a8[_0x5779('0x9')](_0x5779('0xd'),_0x407427[_0x5779('0xe')]);ChatInteractionEvents[_0x5779('0xf')](_0x2eb3f6+':'+_0xf217a8['id'],_0xf217a8);ChatInteractionEvents['emit'](_0x2eb3f6,_0xf217a8);_0xfd8a88(null);})['catch'](_0xfd8a88(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5779('0x10')](e,emitEvent(event));}}module[_0x5779('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x6c27=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','setDataValue','Users','map','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c27,0x196));var _0x76c2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6c27[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x76c2('0x0'));var ChatInteraction=require(_0x76c2('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x76c2('0x1'))['db'][_0x76c2('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x76c2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x76c2('0x4')};function emitEvent(_0x5e9530){return function(_0x3f5f43,_0x54d87e,_0x5ee813){_0x3f5f43[_0x76c2('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x459f8c){_0x3f5f43[_0x76c2('0x6')](_0x76c2('0x7'),_0x459f8c[_0x76c2('0x8')](function(_0x61c086){return{'id':_0x61c086['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3f5f43['id'],'direction':'in','read':![]},'raw':!![]});})[_0x76c2('0x9')](function(_0x1b0f72){_0x3f5f43[_0x76c2('0x6')](_0x76c2('0xa'),_0x1b0f72[_0x76c2('0xb')]);ChatInteractionEvents[_0x76c2('0xc')](_0x5e9530+':'+_0x3f5f43['id'],_0x3f5f43);ChatInteractionEvents[_0x76c2('0xc')](_0x5e9530,_0x3f5f43);_0x5ee813(null);})[_0x76c2('0xd')](_0x5ee813(null));};}for(var e in events){if(events[_0x76c2('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x76c2('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 130bb94..b4c62b3 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 _0x524a=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util'];(function(_0x300448,_0x4d2e9a){var _0x1036de=function(_0x149910){while(--_0x149910){_0x300448['push'](_0x300448['shift']());}};_0x1036de(++_0x4d2e9a);}(_0x524a,0xb2));var _0xa524=function(_0x140c90,_0x3a368e){_0x140c90=_0x140c90-0x0;var _0x5c4794=_0x524a[_0x140c90];return _0x5c4794;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require(_0xa524('0x4'));var BPromise=require('bluebird');var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require(_0xa524('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xa524('0x8')]=function(_0xd5b41a,_0x43bf44){return _0xd5b41a[_0xa524('0x9')](_0xa524('0xa'),attributes,{'tableName':_0xa524('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a6fbb,_0x3d0d17,_0x1306a2){if(_0x4a6fbb[_0xa524('0xc')](_0xa524('0xd'))){_0x4a6fbb[_0xa524('0xe')]=moment()[_0xa524('0xf')](_0xa524('0x10'));}_0x1306a2(null,_0x4a6fbb);}},'charset':_0xa524('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6daf=['../../config/logger','api','moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0xcbc60d,_0x2e604a){var _0x102149=function(_0x3c0991){while(--_0x3c0991){_0xcbc60d['push'](_0xcbc60d['shift']());}};_0x102149(++_0x2e604a);}(_0x6daf,0x153));var _0xf6da=function(_0x326721,_0x27e2e4){_0x326721=_0x326721-0x0;var _0x29ebbb=_0x6daf[_0x326721];return _0x29ebbb;};'use strict';var _=require('lodash');var util=require(_0xf6da('0x0'));var logger=require(_0xf6da('0x1'))(_0xf6da('0x2'));var moment=require(_0xf6da('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6da('0x4'));var fs=require('fs');var path=require(_0xf6da('0x5'));var rimraf=require(_0xf6da('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6da('0x7'));module[_0xf6da('0x8')]=function(_0x232945,_0x5a7cb5){return _0x232945[_0xf6da('0x9')](_0xf6da('0xa'),attributes,{'tableName':_0xf6da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb7d9,_0x478d0f,_0x137952){if(_0x3bb7d9[_0xf6da('0xc')](_0xf6da('0xd'))){_0x3bb7d9['closedAt']=moment()[_0xf6da('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x137952(null,_0x3bb7d9);}},'charset':_0xf6da('0xf'),'collate':_0xf6da('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 62f3f17..9ee1f1f 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 _0x14cb=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatInteraction','update','options','raw','where','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x174480,_0x508a33){var _0x685484=function(_0x16bada){while(--_0x16bada){_0x174480['push'](_0x174480['shift']());}};_0x685484(++_0x508a33);}(_0x14cb,0x140));var _0xb14c=function(_0x404d7e,_0x1583e4){_0x404d7e=_0x404d7e-0x0;var _0x3c1421=_0x14cb[_0x404d7e];return _0x3c1421;};'use strict';var _=require('lodash');var util=require(_0xb14c('0x0'));var moment=require(_0xb14c('0x1'));var BPromise=require(_0xb14c('0x2'));var rs=require(_0xb14c('0x3'));var fs=require('fs');var Redis=require(_0xb14c('0x4'));var db=require(_0xb14c('0x5'))['db'];var utils=require(_0xb14c('0x6'));var logger=require(_0xb14c('0x7'))('rpc');var config=require(_0xb14c('0x8'));var jayson=require(_0xb14c('0x9'));var client=jayson[_0xb14c('0xa')][_0xb14c('0xb')]({'port':0x232a});config['redis']=_[_0xb14c('0xc')](config['redis'],{'host':_0xb14c('0xd'),'port':0x18eb});var socket=require(_0xb14c('0xe'))(new Redis(config[_0xb14c('0xf')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x30cfe5,_0x5deed6,_0x173c0e){return new BPromise(function(_0x418310,_0x55a79e){return client[_0xb14c('0x10')](_0x30cfe5,_0x173c0e)[_0xb14c('0x11')](function(_0x4739e9){logger[_0xb14c('0x12')](_0xb14c('0x13'),_0x5deed6,_0xb14c('0x14'));logger[_0xb14c('0x15')](_0xb14c('0x16'),_0x5deed6,'request\x20sent',JSON['stringify'](_0x4739e9));if(_0x4739e9[_0xb14c('0x17')]){if(_0x4739e9[_0xb14c('0x17')]['code']===0x1f4){logger['error'](_0xb14c('0x13'),_0x5deed6,_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);return _0x55a79e(_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);}logger['error'](_0xb14c('0x13'),_0x5deed6,_0x4739e9['error'][_0xb14c('0x18')]);return _0x418310(_0x4739e9[_0xb14c('0x17')][_0xb14c('0x18')]);}else{logger[_0xb14c('0x12')](_0xb14c('0x13'),_0x5deed6,_0xb14c('0x14'));_0x418310(_0x4739e9[_0xb14c('0x19')][_0xb14c('0x18')]);}})[_0xb14c('0x1a')](function(_0x19ca29){logger[_0xb14c('0x17')](_0xb14c('0x13'),_0x5deed6,_0x19ca29);_0x55a79e(_0x19ca29);});});}exports['UpdateChatInteraction']=function(_0x817cd3){var _0x5ad3dd=this;return new Promise(function(_0x34b671,_0xe3b4cf){return db[_0xb14c('0x1b')][_0xb14c('0x1c')](_0x817cd3['body'],{'raw':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x1f')]||null:null,'attributes':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3[_0xb14c('0x1d')][_0xb14c('0x20')]||null:null,'limit':_0x817cd3[_0xb14c('0x1d')]?_0x817cd3['options']['limit']||null:null})[_0xb14c('0x11')](function(_0x331577){logger['info'](_0xb14c('0x21'),_0x817cd3);logger[_0xb14c('0x15')]('UpdateChatInteraction',_0x817cd3,JSON[_0xb14c('0x22')](_0x331577));_0x34b671(_0x331577);})[_0xb14c('0x1a')](function(_0x3da190){logger[_0xb14c('0x17')](_0xb14c('0x21'),_0x3da190['message'],_0x817cd3);_0xe3b4cf(_0x5ad3dd[_0xb14c('0x17')](0x1f4,_0x3da190[_0xb14c('0x18')]));});});};exports[_0xb14c('0x23')]=function(_0x2e96da){return new Promise(function(_0x3ad41d,_0x534223){return db[_0xb14c('0x1b')][_0xb14c('0x24')]({'where':_0x2e96da[_0xb14c('0x1d')]?_0x2e96da[_0xb14c('0x1d')][_0xb14c('0x1f')]||null:null})[_0xb14c('0x11')](function(_0x5d06f2){if(_0x5d06f2){return _0x5d06f2['addTags'](_0x2e96da[_0xb14c('0x25')][_0xb14c('0x26')],_[_0xb14c('0x27')](_0x2e96da['body'],[_0xb14c('0x26'),'id'])||{});}})[_0xb14c('0x28')](function(_0x868c5f){logger['info']('AddTags',_0x2e96da);logger[_0xb14c('0x15')](_0xb14c('0x29'),_0x2e96da,JSON[_0xb14c('0x22')](_0x868c5f));_0x3ad41d(_0x868c5f);})['catch'](function(_0x5244b0){logger[_0xb14c('0x17')]('AddTags',_0x5244b0[_0xb14c('0x18')],_0x2e96da);_0x534223(_this[_0xb14c('0x17')](0x1f4,_0x5244b0[_0xb14c('0x18')]));});});}; \ No newline at end of file +var _0xe4e0=['update','body','options','raw','where','then','debug','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction'];(function(_0x4d4252,_0x55bb9d){var _0x4ca3b3=function(_0x42dd27){while(--_0x42dd27){_0x4d4252['push'](_0x4d4252['shift']());}};_0x4ca3b3(++_0x55bb9d);}(_0xe4e0,0x1a7));var _0x0e4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe4e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0e4e('0x0'));var util=require(_0x0e4e('0x1'));var moment=require(_0x0e4e('0x2'));var BPromise=require(_0x0e4e('0x3'));var rs=require(_0x0e4e('0x4'));var fs=require('fs');var Redis=require(_0x0e4e('0x5'));var db=require(_0x0e4e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e4e('0x7'))(_0x0e4e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e4e('0x9')][_0x0e4e('0xa')]({'port':0x232a});config['redis']=_[_0x0e4e('0xb')](config[_0x0e4e('0xc')],{'host':_0x0e4e('0xd'),'port':0x18eb});var socket=require(_0x0e4e('0xe'))(new Redis(config[_0x0e4e('0xc')]));require(_0x0e4e('0xf'))[_0x0e4e('0x10')](socket);function respondWithRpcPromise(_0xd3c3c3,_0x52e9a1,_0x52894a){return new BPromise(function(_0x4c9b90,_0x2fe13a){return client['request'](_0xd3c3c3,_0x52894a)['then'](function(_0x963398){logger[_0x0e4e('0x11')](_0x0e4e('0x12'),_0x52e9a1,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x52e9a1,_0x0e4e('0x13'),JSON[_0x0e4e('0x14')](_0x963398));if(_0x963398['error']){if(_0x963398[_0x0e4e('0x15')][_0x0e4e('0x16')]===0x1f4){logger['error'](_0x0e4e('0x12'),_0x52e9a1,_0x963398[_0x0e4e('0x15')][_0x0e4e('0x17')]);return _0x2fe13a(_0x963398[_0x0e4e('0x15')][_0x0e4e('0x17')]);}logger[_0x0e4e('0x15')](_0x0e4e('0x12'),_0x52e9a1,_0x963398[_0x0e4e('0x15')][_0x0e4e('0x17')]);return _0x4c9b90(_0x963398[_0x0e4e('0x15')][_0x0e4e('0x17')]);}else{logger['info'](_0x0e4e('0x12'),_0x52e9a1,_0x0e4e('0x13'));_0x4c9b90(_0x963398[_0x0e4e('0x18')][_0x0e4e('0x17')]);}})[_0x0e4e('0x19')](function(_0xb56a89){logger[_0x0e4e('0x15')](_0x0e4e('0x12'),_0x52e9a1,_0xb56a89);_0x2fe13a(_0xb56a89);});});}exports[_0x0e4e('0x1a')]=function(_0xce820b){var _0x157af8=this;return new Promise(function(_0x25743e,_0x1ae51c){return db[_0x0e4e('0x1b')][_0x0e4e('0x1c')](_0xce820b[_0x0e4e('0x1d')],{'raw':_0xce820b[_0x0e4e('0x1e')]?_0xce820b[_0x0e4e('0x1e')][_0x0e4e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xce820b[_0x0e4e('0x1e')]?_0xce820b[_0x0e4e('0x1e')][_0x0e4e('0x20')]||null:null,'attributes':_0xce820b[_0x0e4e('0x1e')]?_0xce820b[_0x0e4e('0x1e')]['attributes']||null:null,'limit':_0xce820b[_0x0e4e('0x1e')]?_0xce820b['options']['limit']||null:null})[_0x0e4e('0x21')](function(_0x3c7987){logger[_0x0e4e('0x11')](_0x0e4e('0x1a'),_0xce820b);logger[_0x0e4e('0x22')](_0x0e4e('0x1a'),_0xce820b,JSON[_0x0e4e('0x14')](_0x3c7987));_0x25743e(_0x3c7987);})[_0x0e4e('0x19')](function(_0x392280){logger['error'](_0x0e4e('0x1a'),_0x392280[_0x0e4e('0x17')],_0xce820b);_0x1ae51c(_0x157af8[_0x0e4e('0x15')](0x1f4,_0x392280[_0x0e4e('0x17')]));});});};exports[_0x0e4e('0x23')]=function(_0x26cbe6){return new Promise(function(_0x363d94,_0x4275c0){return db[_0x0e4e('0x1b')][_0x0e4e('0x24')]({'where':_0x26cbe6[_0x0e4e('0x1e')]?_0x26cbe6[_0x0e4e('0x1e')][_0x0e4e('0x20')]||null:null})[_0x0e4e('0x21')](function(_0xe290c5){if(_0xe290c5){return _0xe290c5['addTags'](_0x26cbe6['body'][_0x0e4e('0x25')],_[_0x0e4e('0x26')](_0x26cbe6[_0x0e4e('0x1d')],[_0x0e4e('0x25'),'id'])||{});}})[_0x0e4e('0x27')](function(_0x1c139d){logger[_0x0e4e('0x11')](_0x0e4e('0x28'),_0x26cbe6);logger[_0x0e4e('0x22')](_0x0e4e('0x28'),_0x26cbe6,JSON[_0x0e4e('0x14')](_0x1c139d));_0x363d94(_0x1c139d);})['catch'](function(_0x21acae){logger[_0x0e4e('0x15')](_0x0e4e('0x28'),_0x21acae[_0x0e4e('0x17')],_0x26cbe6);_0x4275c0(_this[_0x0e4e('0x15')](0x1f4,_0x21acae['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 836ee1f..b3ce57c 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 _0xea19=['save','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x40540f,_0x4431e2){var _0xaea6e7=function(_0x2ae71f){while(--_0x2ae71f){_0x40540f['push'](_0x40540f['shift']());}};_0xaea6e7(++_0x4431e2);}(_0xea19,0x14f));var _0x9ea1=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xea19[_0x55821d];return _0x58ea8a;};'use strict';var ChatInteractionEvents=require(_0x9ea1('0x0'));var events=[_0x9ea1('0x1'),'remove',_0x9ea1('0x2')];function createListener(_0x2f2bd2,_0x5d8ead){return function(_0x42af8d){_0x5d8ead[_0x9ea1('0x3')](_0x2f2bd2,_0x42af8d);};}function removeListener(_0x47e034,_0x209f06){return function(){ChatInteractionEvents[_0x9ea1('0x4')](_0x47e034,_0x209f06);};}exports[_0x9ea1('0x5')]=function(_0x6ad0f3){for(var _0x106732=0x0,_0xa438dd=events[_0x9ea1('0x6')];_0x106732<_0xa438dd;_0x106732++){var _0x4b31ed=events[_0x106732];var _0x3a573d=createListener(_0x9ea1('0x7')+_0x4b31ed,_0x6ad0f3);ChatInteractionEvents['on'](_0x4b31ed,_0x3a573d);}}; \ No newline at end of file +var _0x525e=['./chatInteraction.events','save','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x525e,0x78));var _0xe525=function(_0x1e7bdc,_0x1ce361){_0x1e7bdc=_0x1e7bdc-0x0;var _0x19cac4=_0x525e[_0x1e7bdc];return _0x19cac4;};'use strict';var ChatInteractionEvents=require(_0xe525('0x0'));var events=[_0xe525('0x1'),_0xe525('0x2'),_0xe525('0x3')];function createListener(_0x274c30,_0x2f287f){return function(_0x4e21b4){_0x2f287f[_0xe525('0x4')](_0x274c30,_0x4e21b4);};}function removeListener(_0x4c697c,_0x3d7c66){return function(){ChatInteractionEvents[_0xe525('0x5')](_0x4c697c,_0x3d7c66);};}exports[_0xe525('0x6')]=function(_0x59a6b6){for(var _0x4c68a3=0x0,_0x2dced6=events['length'];_0x4c68a3<_0x2dced6;_0x4c68a3++){var _0x369b83=events[_0x4c68a3];var _0x268d63=createListener(_0xe525('0x7')+_0x369b83,_0x59a6b6);ChatInteractionEvents['on'](_0x369b83,_0x268d63);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4b5adcd..b71b78b 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 _0xa5b1=['create','createVidaooSession','join','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','/:id','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','isChatInteractionAuthorized','/:id/messages','getMessages','getMyMessages','download','post'];(function(_0x379893,_0x1c7161){var _0x39cd43=function(_0x48af76){while(--_0x48af76){_0x379893['push'](_0x379893['shift']());}};_0x39cd43(++_0x1c7161);}(_0xa5b1,0x176));var _0x1a5b=function(_0x3bf1e0,_0x1580be){_0x3bf1e0=_0x3bf1e0-0x0;var _0x5a9ded=_0xa5b1[_0x3bf1e0];return _0x5a9ded;};'use strict';var multer=require(_0x1a5b('0x0'));var util=require(_0x1a5b('0x1'));var path=require(_0x1a5b('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a5b('0x3'));var router=express[_0x1a5b('0x4')]();var fs_extra=require(_0x1a5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1a5b('0x6'));var config=require(_0x1a5b('0x7'));var controller=require(_0x1a5b('0x8'));router[_0x1a5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a5b('0x9')](_0x1a5b('0xa'),auth[_0x1a5b('0xb')](),controller['describe']);router[_0x1a5b('0x9')]('/:id',auth[_0x1a5b('0xc')](),controller['show']);router[_0x1a5b('0x9')]('/:id/attachment_download',auth[_0x1a5b('0xc')](),controller['attachmentDownload']);router[_0x1a5b('0x9')](_0x1a5b('0xd'),auth[_0x1a5b('0xb')](),controller[_0x1a5b('0xe')]);router[_0x1a5b('0x9')]('/:id/my_messages',auth[_0x1a5b('0xc')](),controller[_0x1a5b('0xf')]);router[_0x1a5b('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x1a5b('0x10')]);router[_0x1a5b('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a5b('0x12')]);router['post']('/:id/vidaoo',auth[_0x1a5b('0xb')](),controller[_0x1a5b('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x457e94,_0x242d66,_0x3a0db3){_0x3a0db3(null,path[_0x1a5b('0x14')](config['root'],_0x1a5b('0x15')));},'filename':function(_0xa33fb,_0x1a1473,_0x589edb){_0x589edb(null,util[_0x1a5b('0x16')](_0x1a5b('0x17'),Date[_0x1a5b('0x18')](),_0x1a1473[_0x1a5b('0x19')][_0x1a5b('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1a5b('0x11')]('/:id/attachment_upload',upload[_0x1a5b('0x1b')](_0x1a5b('0x1c')),controller[_0x1a5b('0x1d')]);router[_0x1a5b('0x11')](_0x1a5b('0xd'),auth[_0x1a5b('0xc')](),controller[_0x1a5b('0x1e')]);router[_0x1a5b('0x11')](_0x1a5b('0x1f'),auth[_0x1a5b('0xb')](),interaction['tracked']('chat',_0x1a5b('0x20')),controller[_0x1a5b('0x21')]);router['put'](_0x1a5b('0x22'),auth[_0x1a5b('0xb')](),interaction[_0x1a5b('0x23')]('chat',_0x1a5b('0x24')),controller[_0x1a5b('0x25')]);router[_0x1a5b('0x26')](_0x1a5b('0x27'),controller[_0x1a5b('0x28')]);router[_0x1a5b('0x26')](_0x1a5b('0x29'),auth[_0x1a5b('0xc')](),controller['abandon']);router['put'](_0x1a5b('0x2a'),controller[_0x1a5b('0x2b')]);router['delete'](_0x1a5b('0x22'),auth[_0x1a5b('0xb')](),interaction[_0x1a5b('0x23')](_0x1a5b('0x2c'),_0x1a5b('0x2d')),controller[_0x1a5b('0x2e')]);router['delete'](_0x1a5b('0x1f'),auth[_0x1a5b('0xb')](),controller[_0x1a5b('0x2f')]);module[_0x1a5b('0x30')]=router; \ No newline at end of file +var _0x0195=['getMessages','/:id/my_messages','download','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages'];(function(_0x427165,_0x3f27ee){var _0xaa4c24=function(_0x1de8f3){while(--_0x1de8f3){_0x427165['push'](_0x427165['shift']());}};_0xaa4c24(++_0x3f27ee);}(_0x0195,0x159));var _0x5019=function(_0x4e5bad,_0xfcc2c6){_0x4e5bad=_0x4e5bad-0x0;var _0x226737=_0x0195[_0x4e5bad];return _0x226737;};'use strict';var multer=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var path=require(_0x5019('0x2'));var timeout=require('connect-timeout');var express=require(_0x5019('0x3'));var router=express[_0x5019('0x4')]();var fs_extra=require(_0x5019('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5019('0x6'));var config=require(_0x5019('0x7'));var controller=require(_0x5019('0x8'));router[_0x5019('0x9')]('/',auth[_0x5019('0xa')](),controller['index']);router['get'](_0x5019('0xb'),auth['isAuthenticated'](),controller[_0x5019('0xc')]);router[_0x5019('0x9')](_0x5019('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5019('0xe')]);router['get'](_0x5019('0xf'),auth[_0x5019('0x10')](),controller[_0x5019('0x11')]);router[_0x5019('0x9')](_0x5019('0x12'),auth[_0x5019('0xa')](),controller[_0x5019('0x13')]);router[_0x5019('0x9')](_0x5019('0x14'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x5019('0xa')](),controller[_0x5019('0x15')]);router[_0x5019('0x16')]('/',auth[_0x5019('0xa')](),controller[_0x5019('0x17')]);router['post']('/:id/vidaoo',auth[_0x5019('0xa')](),controller[_0x5019('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x322ee1,_0x551126,_0x45cbf3){_0x45cbf3(null,path['join'](config[_0x5019('0x19')],_0x5019('0x1a')));},'filename':function(_0x80fab1,_0xc2a882,_0x191342){_0x191342(null,util[_0x5019('0x1b')](_0x5019('0x1c'),Date[_0x5019('0x1d')](),_0xc2a882[_0x5019('0x1e')][_0x5019('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5019('0x16')](_0x5019('0x20'),upload[_0x5019('0x21')](_0x5019('0x22')),controller[_0x5019('0x23')]);router[_0x5019('0x16')](_0x5019('0x12'),auth[_0x5019('0x10')](),controller[_0x5019('0x24')]);router[_0x5019('0x16')](_0x5019('0x25'),auth['isAuthenticated'](),interaction[_0x5019('0x26')](_0x5019('0x27'),_0x5019('0x28')),controller['addTags']);router[_0x5019('0x29')](_0x5019('0xd'),auth['isAuthenticated'](),interaction[_0x5019('0x26')](_0x5019('0x27'),_0x5019('0x2a')),controller['update']);router[_0x5019('0x29')](_0x5019('0x2b'),controller[_0x5019('0x2c')]);router[_0x5019('0x29')](_0x5019('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x5019('0x2e')]);router[_0x5019('0x29')](_0x5019('0x2f'),controller['close']);router[_0x5019('0x30')]('/:id',auth['isAuthenticated'](),interaction[_0x5019('0x26')]('chat',_0x5019('0x31')),controller['destroy']);router['delete'](_0x5019('0x25'),auth[_0x5019('0xa')](),controller[_0x5019('0x32')]);module[_0x5019('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7a3ff4e..406f3c7 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 _0x1553=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0x54537,_0x4d6705){var _0x27600f=function(_0x28cf0c){while(--_0x28cf0c){_0x54537['push'](_0x54537['shift']());}};_0x27600f(++_0x4d6705);}(_0x1553,0xa2));var _0x3155=function(_0x49cee9,_0x28e9de){_0x49cee9=_0x49cee9-0x0;var _0x5c896d=_0x1553[_0x49cee9];return _0x5c896d;};'use strict';var Sequelize=require(_0x3155('0x0'));module['exports']={'body':{'type':Sequelize[_0x3155('0x1')](_0x3155('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3155('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3155('0x4')]}}; \ No newline at end of file +var _0x67f7=['sequelize','exports','TEXT','INTEGER'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x67f7,0x178));var _0x767f=function(_0x1ee817,_0x3b10f0){_0x1ee817=_0x1ee817-0x0;var _0x3387ac=_0x67f7[_0x1ee817];return _0x3387ac;};'use strict';var Sequelize=require(_0x767f('0x0'));module[_0x767f('0x1')]={'body':{'type':Sequelize[_0x767f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x767f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 8c8b7c3..487b0a6 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 _0x0cb0=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','name','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','find','describe','get','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty','agent','push','messages','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv'];(function(_0x52d354,_0x101f54){var _0x20c877=function(_0x380116){while(--_0x380116){_0x52d354['push'](_0x52d354['shift']());}};_0x20c877(++_0x101f54);}(_0x0cb0,0x1a6));var _0x00cb=function(_0x22fdbb,_0x49e68d){_0x22fdbb=_0x22fdbb-0x0;var _0x3b8ce7=_0x0cb0[_0x22fdbb];return _0x3b8ce7;};'use strict';var emlformat=require(_0x00cb('0x0'));var rimraf=require(_0x00cb('0x1'));var zipdir=require(_0x00cb('0x2'));var jsonpatch=require(_0x00cb('0x3'));var rp=require(_0x00cb('0x4'));var moment=require(_0x00cb('0x5'));var BPromise=require(_0x00cb('0x6'));var Mustache=require('mustache');var util=require(_0x00cb('0x7'));var path=require(_0x00cb('0x8'));var sox=require('sox');var csv=require(_0x00cb('0x9'));var ejs=require(_0x00cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00cb('0xb'));var squel=require('squel');var crypto=require(_0x00cb('0xc'));var jsforce=require(_0x00cb('0xd'));var deskjs=require(_0x00cb('0xe'));var toCsv=require(_0x00cb('0x9'));var querystring=require(_0x00cb('0xf'));var Papa=require(_0x00cb('0x10'));var Redis=require(_0x00cb('0x11'));var authService=require(_0x00cb('0x12'));var qs=require(_0x00cb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00cb('0x14'));var logger=require(_0x00cb('0x15'))(_0x00cb('0x16'));var utils=require(_0x00cb('0x17'));var config=require(_0x00cb('0x18'));var licenseUtil=require(_0x00cb('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x00cb('0x1a')],{'host':_0x00cb('0x1b'),'port':0x18eb});var socket=require(_0x00cb('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x00cb('0x1d')](socket);function respondWithStatusCode(_0x5d6b1e,_0x48232b){_0x48232b=_0x48232b||0xcc;return function(_0x177f7a){if(_0x177f7a){return _0x5d6b1e[_0x00cb('0x1e')](_0x48232b);}return _0x5d6b1e[_0x00cb('0x1f')](_0x48232b)['end']();};}function respondWithResult(_0x129ada,_0xdba23e){_0xdba23e=_0xdba23e||0xc8;return function(_0x57cc80){if(_0x57cc80){return _0x129ada[_0x00cb('0x1f')](_0xdba23e)[_0x00cb('0x20')](_0x57cc80);}};}function respondWithFilteredResult(_0x36a849,_0x27ec4d){return function(_0x95fcaa){if(_0x95fcaa){var _0x5ba118=typeof _0x27ec4d['offset']===_0x00cb('0x21')&&typeof _0x27ec4d[_0x00cb('0x22')]===_0x00cb('0x21');var _0x14919a=_0x95fcaa[_0x00cb('0x23')];var _0x160655=_0x5ba118?0x0:_0x27ec4d[_0x00cb('0x24')];var _0x3dc68c=_0x5ba118?_0x95fcaa['count']:_0x27ec4d[_0x00cb('0x24')]+_0x27ec4d[_0x00cb('0x22')];var _0x5aa39c;if(_0x3dc68c>=_0x14919a){_0x3dc68c=_0x14919a;_0x5aa39c=0xc8;}else{_0x5aa39c=0xce;}_0x36a849[_0x00cb('0x1f')](_0x5aa39c);return _0x36a849['set'](_0x00cb('0x25'),_0x160655+'-'+_0x3dc68c+'/'+_0x14919a)[_0x00cb('0x20')](_0x95fcaa);}return null;};}function patchUpdates(_0x444914){return function(_0x11fb57){try{jsonpatch[_0x00cb('0x26')](_0x11fb57,_0x444914,!![]);}catch(_0x35c357){return BPromise[_0x00cb('0x27')](_0x35c357);}return _0x11fb57['save']();};}function saveUpdates(_0x2eaf80,_0x135572){return function(_0x27f75d){if(_0x27f75d){return _0x27f75d[_0x00cb('0x28')](_0x2eaf80)[_0x00cb('0x29')](function(_0x4adc41){return _0x4adc41;});}return null;};}function removeEntity(_0x405f73,_0xa6295a){return function(_0x433afb){if(_0x433afb){return _0x433afb[_0x00cb('0x2a')]()['then'](function(){_0x405f73[_0x00cb('0x1f')](0xcc)[_0x00cb('0x2b')]();});}};}function handleEntityNotFound(_0x2427b0,_0x58370d){return function(_0x383ef8){if(!_0x383ef8){_0x2427b0[_0x00cb('0x1e')](0x194);}return _0x383ef8;};}function handleError(_0x3e572d,_0x7f3f9b){_0x7f3f9b=_0x7f3f9b||0x1f4;return function(_0x3cd34e){logger['error'](_0x3cd34e['stack']);if(_0x3cd34e[_0x00cb('0x2c')]){delete _0x3cd34e['name'];}_0x3e572d['status'](_0x7f3f9b)['send'](_0x3cd34e);};}exports[_0x00cb('0x2d')]=function(_0x621048,_0x2dd2be){var _0x10ef45={},_0x4fffd2={},_0x266355={'count':0x0,'rows':[]};var _0x282daa=_[_0x00cb('0x2e')](db[_0x00cb('0x2f')][_0x00cb('0x30')],function(_0x4387bd){return{'name':_0x4387bd['fieldName'],'type':_0x4387bd[_0x00cb('0x31')][_0x00cb('0x32')]};});_0x4fffd2['model']=_[_0x00cb('0x2e')](_0x282daa,'name');_0x4fffd2[_0x00cb('0x33')]=_[_0x00cb('0x34')](_0x621048['query']);_0x4fffd2['filters']=_[_0x00cb('0x35')](_0x4fffd2[_0x00cb('0x36')],_0x4fffd2[_0x00cb('0x33')]);_0x10ef45['attributes']=_[_0x00cb('0x35')](_0x4fffd2[_0x00cb('0x36')],qs['fields'](_0x621048[_0x00cb('0x33')]['fields']));_0x10ef45[_0x00cb('0x37')]=_0x10ef45[_0x00cb('0x37')][_0x00cb('0x38')]?_0x10ef45[_0x00cb('0x37')]:_0x4fffd2[_0x00cb('0x36')];if(!_0x621048[_0x00cb('0x33')][_0x00cb('0x39')](_0x00cb('0x3a'))){_0x10ef45[_0x00cb('0x22')]=qs[_0x00cb('0x22')](_0x621048['query'][_0x00cb('0x22')]);_0x10ef45[_0x00cb('0x24')]=qs['offset'](_0x621048[_0x00cb('0x33')][_0x00cb('0x24')]);}_0x10ef45[_0x00cb('0x3b')]=qs['sort'](_0x621048[_0x00cb('0x33')][_0x00cb('0x3c')]);_0x10ef45[_0x00cb('0x3d')]=qs[_0x00cb('0x3e')](_['pick'](_0x621048[_0x00cb('0x33')],_0x4fffd2['filters']),_0x282daa);if(_0x621048[_0x00cb('0x33')][_0x00cb('0x3f')]){_0x10ef45[_0x00cb('0x3d')]=_[_0x00cb('0x40')](_0x10ef45[_0x00cb('0x3d')],{'$or':_[_0x00cb('0x2e')](_0x282daa,function(_0x23e5e7){if(_0x23e5e7[_0x00cb('0x31')]!=='VIRTUAL'){var _0x1381eb={};_0x1381eb[_0x23e5e7['name']]={'$like':'%'+_0x621048[_0x00cb('0x33')][_0x00cb('0x3f')]+'%'};return _0x1381eb;}})});}_0x10ef45=_[_0x00cb('0x40')]({},_0x10ef45,_0x621048[_0x00cb('0x41')]);var _0x3b600c={'where':_0x10ef45[_0x00cb('0x3d')]};return db[_0x00cb('0x2f')][_0x00cb('0x23')](_0x3b600c)['then'](function(_0x331859){_0x266355[_0x00cb('0x23')]=_0x331859;if(_0x621048[_0x00cb('0x33')][_0x00cb('0x42')]){_0x10ef45[_0x00cb('0x43')]=[{'all':!![]}];}return db[_0x00cb('0x2f')]['findAll'](_0x10ef45);})[_0x00cb('0x29')](function(_0x5eda34){_0x266355[_0x00cb('0x44')]=_0x5eda34;return _0x266355;})[_0x00cb('0x29')](respondWithFilteredResult(_0x2dd2be,_0x10ef45))[_0x00cb('0x45')](handleError(_0x2dd2be,null));};exports[_0x00cb('0x46')]=function(_0x4d6607,_0x1307cc){var _0xe44066={'raw':!![],'where':{'id':_0x4d6607[_0x00cb('0x47')]['id']}},_0x59b331={};_0x59b331['model']=_[_0x00cb('0x34')](db[_0x00cb('0x2f')]['rawAttributes']);_0x59b331[_0x00cb('0x33')]=_[_0x00cb('0x34')](_0x4d6607[_0x00cb('0x33')]);_0x59b331[_0x00cb('0x3e')]=_[_0x00cb('0x35')](_0x59b331[_0x00cb('0x36')],_0x59b331[_0x00cb('0x33')]);_0xe44066[_0x00cb('0x37')]=_[_0x00cb('0x35')](_0x59b331['model'],qs['fields'](_0x4d6607['query'][_0x00cb('0x48')]));_0xe44066[_0x00cb('0x37')]=_0xe44066[_0x00cb('0x37')][_0x00cb('0x38')]?_0xe44066[_0x00cb('0x37')]:_0x59b331[_0x00cb('0x36')];if(_0x4d6607['query'][_0x00cb('0x42')]){_0xe44066[_0x00cb('0x43')]=[{'all':!![]}];}_0xe44066=_[_0x00cb('0x40')]({},_0xe44066,_0x4d6607['options']);return db[_0x00cb('0x2f')]['find'](_0xe44066)[_0x00cb('0x29')](handleEntityNotFound(_0x1307cc,null))['then'](respondWithResult(_0x1307cc,null))['catch'](handleError(_0x1307cc,null));};exports['create']=function(_0x589859,_0x4c8052){return db[_0x00cb('0x2f')][_0x00cb('0x49')](_0x589859[_0x00cb('0x4a')],{})[_0x00cb('0x29')](respondWithResult(_0x4c8052,0xc9))[_0x00cb('0x45')](handleError(_0x4c8052,null));};exports[_0x00cb('0x28')]=function(_0x1c49b2,_0x2f84b5){if(_0x1c49b2['body']['id']){delete _0x1c49b2[_0x00cb('0x4a')]['id'];}return db['ChatInternalMessage'][_0x00cb('0x4b')]({'where':{'id':_0x1c49b2[_0x00cb('0x47')]['id']}})[_0x00cb('0x29')](handleEntityNotFound(_0x2f84b5,null))[_0x00cb('0x29')](saveUpdates(_0x1c49b2[_0x00cb('0x4a')],null))[_0x00cb('0x29')](respondWithResult(_0x2f84b5,null))['catch'](handleError(_0x2f84b5,null));};exports[_0x00cb('0x2a')]=function(_0xff4164,_0x1ce8bc){return db[_0x00cb('0x2f')][_0x00cb('0x4b')]({'where':{'id':_0xff4164['params']['id']}})['then'](handleEntityNotFound(_0x1ce8bc,null))[_0x00cb('0x29')](removeEntity(_0x1ce8bc,null))[_0x00cb('0x45')](handleError(_0x1ce8bc,null));};exports[_0x00cb('0x4c')]=function(_0x3a41d2,_0x270850){return db[_0x00cb('0x2f')]['describe']()['then'](respondWithResult(_0x270850,null))[_0x00cb('0x45')](handleError(_0x270850,null));};function wrapUser(_0xb7bbea){return function(_0x2d6bb8){var _0x35da45=_0xb7bbea[_0x00cb('0x4d')]({'plain':!![]});_0x35da45['messages']=[];if(_0x2d6bb8){_0x35da45[_0x00cb('0x4e')]=_0x2d6bb8['createdAt'];_0x35da45[_0x00cb('0x4f')]=_0x2d6bb8;}else{_0x35da45[_0x00cb('0x4e')]=moment(0x0)['format'](_0x00cb('0x50'));_0x35da45[_0x00cb('0x4f')]={};}return _0x35da45;};}exports[_0x00cb('0x51')]=function(_0x15b193,_0x422a0d,_0x173bed){var _0x3a6539=[];return db[_0x00cb('0x52')][_0x00cb('0x53')]({'where':{'role':['agent',_0x00cb('0x54'),'user']},'attributes':['id',_0x00cb('0x55'),_0x00cb('0x2c'),_0x00cb('0x56'),_0x00cb('0x57'),_0x00cb('0x58'),'online',_0x00cb('0x59'),_0x00cb('0x5a'),_0x00cb('0x5b')],'order':qs['sort'](_0x00cb('0x5c')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x00cb('0x2c'),_0x00cb('0x31')],'through':{'attributes':[]}}]})[_0x00cb('0x29')](function(_0x15efdf){if(_0x15efdf){var _0x1d464a=_0x15b193[_0x00cb('0x5d')]['get']({'plain':!![]});if(!_0x1d464a)throw new Error(_0x00cb('0x5e'));if(_0x1d464a[_0x00cb('0x56')]===_0x00cb('0x5d')){return db[_0x00cb('0x5f')][_0x00cb('0x4b')]({'where':{'name':'Agents','userProfileId':_0x1d464a[_0x00cb('0x60')]},'raw':!![]})[_0x00cb('0x29')](function(_0x54e3f9){if(_0x54e3f9){if(_0x54e3f9['autoAssociation']===0x0){return db[_0x00cb('0x61')]['findAll']({'where':{'sectionId':_0x54e3f9['id']},'raw':!![]})[_0x00cb('0x29')](function(_0x37be40){var _0x41efdb=[];if(_[_0x00cb('0x62')](_0x37be40)){_0x41efdb=_['filter'](_0x15efdf,function(_0x4e2463){if(_0x4e2463[_0x00cb('0x56')]!==_0x00cb('0x63')){return _0x4e2463;}});return _0x41efdb;}else{for(var _0x1c5887=0x0;_0x1c5887<_0x15efdf[_0x00cb('0x38')];_0x1c5887++){var _0x30fd7e=_0x15efdf[_0x1c5887];if(_0x30fd7e[_0x00cb('0x56')]===_0x00cb('0x63')){var _0x27bceb=_[_0x00cb('0x4b')](_0x37be40,function(_0x3e917e){return _0x3e917e['resourceId']===_0x30fd7e['id'];});if(_0x27bceb)_0x41efdb[_0x00cb('0x64')](_0x30fd7e);}else{_0x41efdb[_0x00cb('0x64')](_0x30fd7e);}}return _0x41efdb;}});}else{return _0x15efdf;}}else{var _0x9082bd=_[_0x00cb('0x3f')](_0x15efdf,function(_0x5f53ad){if(_0x5f53ad[_0x00cb('0x56')]!==_0x00cb('0x63')){return _0x5f53ad;}});return _0x9082bd;}});}else{return _0x15efdf;}}})[_0x00cb('0x29')](function(_0x34d8ad){var _0x2735bf=[];if(_0x34d8ad){_0x3a6539=_0x34d8ad;for(var _0xea1538=0x0;_0xea1538<_0x34d8ad['length'];_0xea1538+=0x1){_0x3a6539[_0xea1538][_0x00cb('0x65')]=[];_0x2735bf[_0x00cb('0x64')](db[_0x00cb('0x2f')]['find']({'where':{'FromId':[_0x15b193[_0x00cb('0x5d')]['id'],_0x34d8ad[_0xea1538]['id']],'ToId':[_0x15b193[_0x00cb('0x5d')]['id'],_0x34d8ad[_0xea1538]['id']],'ChatGroupId':null},'attributes':['id',_0x00cb('0x66'),_0x00cb('0x67'),_0x00cb('0x68'),_0x00cb('0x69'),_0x00cb('0x4a')],'order':qs[_0x00cb('0x3c')](_0x00cb('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x00cb('0x29')](wrapUser(_0x34d8ad[_0xea1538])));}return BPromise[_0x00cb('0x6b')](_0x2735bf);}return[];})['then'](function(_0x1dc48d){return{'rows':_0x1dc48d,'count':_0x1dc48d['length']};})[_0x00cb('0x29')](respondWithResult(_0x422a0d,null))[_0x00cb('0x45')](handleError(_0x422a0d,null));}; \ No newline at end of file +var _0x74cb=['fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','keys','options','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir'];(function(_0x34babe,_0x1e1ae2){var _0x863b0d=function(_0x589e78){while(--_0x589e78){_0x34babe['push'](_0x34babe['shift']());}};_0x863b0d(++_0x1e1ae2);}(_0x74cb,0x1cd));var _0xb74c=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x74cb[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xb74c('0x0'));var rimraf=require(_0xb74c('0x1'));var zipdir=require(_0xb74c('0x2'));var jsonpatch=require(_0xb74c('0x3'));var rp=require('request-promise');var moment=require(_0xb74c('0x4'));var BPromise=require(_0xb74c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb74c('0x6'));var sox=require(_0xb74c('0x7'));var csv=require(_0xb74c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb74c('0x9'));var _=require(_0xb74c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb74c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb74c('0x8'));var querystring=require(_0xb74c('0xc'));var Papa=require(_0xb74c('0xd'));var Redis=require(_0xb74c('0xe'));var authService=require(_0xb74c('0xf'));var qs=require(_0xb74c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb74c('0x11'));var logger=require(_0xb74c('0x12'))('api');var utils=require(_0xb74c('0x13'));var config=require(_0xb74c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb74c('0x15'))['db'];config[_0xb74c('0x16')]=_[_0xb74c('0x17')](config['redis'],{'host':_0xb74c('0x18'),'port':0x18eb});var socket=require(_0xb74c('0x19'))(new Redis(config[_0xb74c('0x16')]));require(_0xb74c('0x1a'))[_0xb74c('0x1b')](socket);function respondWithStatusCode(_0x442faf,_0x3fad75){_0x3fad75=_0x3fad75||0xcc;return function(_0x2fb817){if(_0x2fb817){return _0x442faf[_0xb74c('0x1c')](_0x3fad75);}return _0x442faf['status'](_0x3fad75)['end']();};}function respondWithResult(_0x170567,_0x2064bb){_0x2064bb=_0x2064bb||0xc8;return function(_0x4cf8a4){if(_0x4cf8a4){return _0x170567[_0xb74c('0x1d')](_0x2064bb)[_0xb74c('0x1e')](_0x4cf8a4);}};}function respondWithFilteredResult(_0x2bd970,_0x4504e2){return function(_0x1c2481){if(_0x1c2481){var _0x3da110=typeof _0x4504e2['offset']===_0xb74c('0x1f')&&typeof _0x4504e2['limit']===_0xb74c('0x1f');var _0x236716=_0x1c2481[_0xb74c('0x20')];var _0x53f94a=_0x3da110?0x0:_0x4504e2[_0xb74c('0x21')];var _0x38314c=_0x3da110?_0x1c2481[_0xb74c('0x20')]:_0x4504e2['offset']+_0x4504e2['limit'];var _0x274f0e;if(_0x38314c>=_0x236716){_0x38314c=_0x236716;_0x274f0e=0xc8;}else{_0x274f0e=0xce;}_0x2bd970[_0xb74c('0x1d')](_0x274f0e);return _0x2bd970[_0xb74c('0x22')](_0xb74c('0x23'),_0x53f94a+'-'+_0x38314c+'/'+_0x236716)[_0xb74c('0x1e')](_0x1c2481);}return null;};}function patchUpdates(_0x33811d){return function(_0x31ff45){try{jsonpatch[_0xb74c('0x24')](_0x31ff45,_0x33811d,!![]);}catch(_0x180f2a){return BPromise[_0xb74c('0x25')](_0x180f2a);}return _0x31ff45[_0xb74c('0x26')]();};}function saveUpdates(_0x34797e,_0x59c8fa){return function(_0x511f6d){if(_0x511f6d){return _0x511f6d[_0xb74c('0x27')](_0x34797e)[_0xb74c('0x28')](function(_0x4c594c){return _0x4c594c;});}return null;};}function removeEntity(_0x486e9a,_0x58bd70){return function(_0x4eb969){if(_0x4eb969){return _0x4eb969[_0xb74c('0x29')]()[_0xb74c('0x28')](function(){_0x486e9a[_0xb74c('0x1d')](0xcc)[_0xb74c('0x2a')]();});}};}function handleEntityNotFound(_0xb96883,_0x4d813d){return function(_0x58c74c){if(!_0x58c74c){_0xb96883['sendStatus'](0x194);}return _0x58c74c;};}function handleError(_0x5bb40c,_0x6f4d6){_0x6f4d6=_0x6f4d6||0x1f4;return function(_0x5e139f){logger[_0xb74c('0x2b')](_0x5e139f[_0xb74c('0x2c')]);if(_0x5e139f[_0xb74c('0x2d')]){delete _0x5e139f[_0xb74c('0x2d')];}_0x5bb40c[_0xb74c('0x1d')](_0x6f4d6)[_0xb74c('0x2e')](_0x5e139f);};}exports[_0xb74c('0x2f')]=function(_0x16317d,_0x5d3d50){var _0x18814a={},_0x5335d9={},_0x563284={'count':0x0,'rows':[]};var _0x6fe84c=_[_0xb74c('0x30')](db[_0xb74c('0x31')][_0xb74c('0x32')],function(_0x6b93e7){return{'name':_0x6b93e7[_0xb74c('0x33')],'type':_0x6b93e7[_0xb74c('0x34')]['key']};});_0x5335d9[_0xb74c('0x35')]=_[_0xb74c('0x30')](_0x6fe84c,'name');_0x5335d9['query']=_['keys'](_0x16317d[_0xb74c('0x36')]);_0x5335d9['filters']=_[_0xb74c('0x37')](_0x5335d9[_0xb74c('0x35')],_0x5335d9[_0xb74c('0x36')]);_0x18814a[_0xb74c('0x38')]=_['intersection'](_0x5335d9[_0xb74c('0x35')],qs[_0xb74c('0x39')](_0x16317d['query'][_0xb74c('0x39')]));_0x18814a[_0xb74c('0x38')]=_0x18814a['attributes'][_0xb74c('0x3a')]?_0x18814a[_0xb74c('0x38')]:_0x5335d9['model'];if(!_0x16317d[_0xb74c('0x36')][_0xb74c('0x3b')](_0xb74c('0x3c'))){_0x18814a['limit']=qs[_0xb74c('0x3d')](_0x16317d[_0xb74c('0x36')][_0xb74c('0x3d')]);_0x18814a[_0xb74c('0x21')]=qs[_0xb74c('0x21')](_0x16317d[_0xb74c('0x36')][_0xb74c('0x21')]);}_0x18814a[_0xb74c('0x3e')]=qs[_0xb74c('0x3f')](_0x16317d[_0xb74c('0x36')]['sort']);_0x18814a[_0xb74c('0x40')]=qs[_0xb74c('0x41')](_[_0xb74c('0x42')](_0x16317d[_0xb74c('0x36')],_0x5335d9['filters']),_0x6fe84c);if(_0x16317d[_0xb74c('0x36')][_0xb74c('0x43')]){_0x18814a[_0xb74c('0x40')]=_[_0xb74c('0x44')](_0x18814a[_0xb74c('0x40')],{'$or':_[_0xb74c('0x30')](_0x6fe84c,function(_0x3f25b9){if(_0x3f25b9['type']!==_0xb74c('0x45')){var _0x11a579={};_0x11a579[_0x3f25b9['name']]={'$like':'%'+_0x16317d['query'][_0xb74c('0x43')]+'%'};return _0x11a579;}})});}_0x18814a=_[_0xb74c('0x44')]({},_0x18814a,_0x16317d['options']);var _0x6d7551={'where':_0x18814a[_0xb74c('0x40')]};return db['ChatInternalMessage'][_0xb74c('0x20')](_0x6d7551)[_0xb74c('0x28')](function(_0x19f960){_0x563284[_0xb74c('0x20')]=_0x19f960;if(_0x16317d['query']['includeAll']){_0x18814a[_0xb74c('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xb74c('0x47')](_0x18814a);})[_0xb74c('0x28')](function(_0x1846e3){_0x563284['rows']=_0x1846e3;return _0x563284;})['then'](respondWithFilteredResult(_0x5d3d50,_0x18814a))[_0xb74c('0x48')](handleError(_0x5d3d50,null));};exports[_0xb74c('0x49')]=function(_0x4b35f4,_0x4f13c2){var _0x37ce26={'raw':!![],'where':{'id':_0x4b35f4[_0xb74c('0x4a')]['id']}},_0x4e6a82={};_0x4e6a82[_0xb74c('0x35')]=_[_0xb74c('0x4b')](db[_0xb74c('0x31')]['rawAttributes']);_0x4e6a82['query']=_[_0xb74c('0x4b')](_0x4b35f4[_0xb74c('0x36')]);_0x4e6a82['filters']=_[_0xb74c('0x37')](_0x4e6a82[_0xb74c('0x35')],_0x4e6a82[_0xb74c('0x36')]);_0x37ce26['attributes']=_[_0xb74c('0x37')](_0x4e6a82[_0xb74c('0x35')],qs[_0xb74c('0x39')](_0x4b35f4[_0xb74c('0x36')][_0xb74c('0x39')]));_0x37ce26['attributes']=_0x37ce26[_0xb74c('0x38')][_0xb74c('0x3a')]?_0x37ce26[_0xb74c('0x38')]:_0x4e6a82['model'];if(_0x4b35f4[_0xb74c('0x36')]['includeAll']){_0x37ce26[_0xb74c('0x46')]=[{'all':!![]}];}_0x37ce26=_['merge']({},_0x37ce26,_0x4b35f4[_0xb74c('0x4c')]);return db[_0xb74c('0x31')][_0xb74c('0x4d')](_0x37ce26)['then'](handleEntityNotFound(_0x4f13c2,null))['then'](respondWithResult(_0x4f13c2,null))[_0xb74c('0x48')](handleError(_0x4f13c2,null));};exports[_0xb74c('0x4e')]=function(_0x2d9189,_0xf8e0b7){return db[_0xb74c('0x31')][_0xb74c('0x4e')](_0x2d9189['body'],{})[_0xb74c('0x28')](respondWithResult(_0xf8e0b7,0xc9))[_0xb74c('0x48')](handleError(_0xf8e0b7,null));};exports[_0xb74c('0x27')]=function(_0x2e0564,_0x51b3e6){if(_0x2e0564[_0xb74c('0x4f')]['id']){delete _0x2e0564[_0xb74c('0x4f')]['id'];}return db[_0xb74c('0x31')][_0xb74c('0x4d')]({'where':{'id':_0x2e0564['params']['id']}})[_0xb74c('0x28')](handleEntityNotFound(_0x51b3e6,null))['then'](saveUpdates(_0x2e0564[_0xb74c('0x4f')],null))[_0xb74c('0x28')](respondWithResult(_0x51b3e6,null))[_0xb74c('0x48')](handleError(_0x51b3e6,null));};exports[_0xb74c('0x29')]=function(_0x3eb6c0,_0x2215ee){return db[_0xb74c('0x31')]['find']({'where':{'id':_0x3eb6c0[_0xb74c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2215ee,null))['then'](removeEntity(_0x2215ee,null))[_0xb74c('0x48')](handleError(_0x2215ee,null));};exports[_0xb74c('0x50')]=function(_0x525f5f,_0x5b2d10){return db[_0xb74c('0x31')][_0xb74c('0x50')]()[_0xb74c('0x28')](respondWithResult(_0x5b2d10,null))['catch'](handleError(_0x5b2d10,null));};function wrapUser(_0x37209e){return function(_0x20771d){var _0x28fc3b=_0x37209e[_0xb74c('0x51')]({'plain':!![]});_0x28fc3b[_0xb74c('0x52')]=[];if(_0x20771d){_0x28fc3b[_0xb74c('0x53')]=_0x20771d['createdAt'];_0x28fc3b[_0xb74c('0x54')]=_0x20771d;}else{_0x28fc3b[_0xb74c('0x53')]=moment(0x0)[_0xb74c('0x55')](_0xb74c('0x56'));_0x28fc3b['lastMessage']={};}return _0x28fc3b;};}exports[_0xb74c('0x57')]=function(_0x1c537d,_0x41672f,_0x341e49){var _0x4fb9e0=[];return db[_0xb74c('0x58')][_0xb74c('0x47')]({'where':{'role':[_0xb74c('0x59'),_0xb74c('0x5a'),'user']},'attributes':['id',_0xb74c('0x5b'),_0xb74c('0x2d'),_0xb74c('0x5c'),_0xb74c('0x5d'),_0xb74c('0x5e'),_0xb74c('0x5f'),_0xb74c('0x60'),_0xb74c('0x61'),_0xb74c('0x62')],'order':qs[_0xb74c('0x3f')](_0xb74c('0x63')),'include':[{'model':db[_0xb74c('0x64')],'as':_0xb74c('0x65'),'attributes':['id','name',_0xb74c('0x34')],'through':{'attributes':[]}}]})[_0xb74c('0x28')](function(_0x83f88d){if(_0x83f88d){var _0x23c998=_0x1c537d[_0xb74c('0x66')]['get']({'plain':!![]});if(!_0x23c998)throw new Error(_0xb74c('0x67'));if(_0x23c998[_0xb74c('0x5c')]==='user'){return db[_0xb74c('0x68')][_0xb74c('0x4d')]({'where':{'name':_0xb74c('0x69'),'userProfileId':_0x23c998[_0xb74c('0x6a')]},'raw':!![]})[_0xb74c('0x28')](function(_0x44dec2){if(_0x44dec2){if(_0x44dec2[_0xb74c('0x6b')]===0x0){return db[_0xb74c('0x6c')]['findAll']({'where':{'sectionId':_0x44dec2['id']},'raw':!![]})[_0xb74c('0x28')](function(_0x2e7a19){var _0x4e52d1=[];if(_['isEmpty'](_0x2e7a19)){_0x4e52d1=_[_0xb74c('0x43')](_0x83f88d,function(_0x2698a1){if(_0x2698a1[_0xb74c('0x5c')]!==_0xb74c('0x59')){return _0x2698a1;}});return _0x4e52d1;}else{for(var _0x22bb21=0x0;_0x22bb21<_0x83f88d[_0xb74c('0x3a')];_0x22bb21++){var _0x2f8e8a=_0x83f88d[_0x22bb21];if(_0x2f8e8a['role']==='agent'){var _0x1e30dc=_['find'](_0x2e7a19,function(_0x403427){return _0x403427[_0xb74c('0x6d')]===_0x2f8e8a['id'];});if(_0x1e30dc)_0x4e52d1['push'](_0x2f8e8a);}else{_0x4e52d1[_0xb74c('0x6e')](_0x2f8e8a);}}return _0x4e52d1;}});}else{return _0x83f88d;}}else{var _0x336feb=_[_0xb74c('0x43')](_0x83f88d,function(_0x3e65fd){if(_0x3e65fd[_0xb74c('0x5c')]!==_0xb74c('0x59')){return _0x3e65fd;}});return _0x336feb;}});}else{return _0x83f88d;}}})[_0xb74c('0x28')](function(_0x470d62){var _0x109d55=[];if(_0x470d62){_0x4fb9e0=_0x470d62;for(var _0x41c109=0x0;_0x41c109<_0x470d62['length'];_0x41c109+=0x1){_0x4fb9e0[_0x41c109][_0xb74c('0x52')]=[];_0x109d55[_0xb74c('0x6e')](db[_0xb74c('0x31')]['find']({'where':{'FromId':[_0x1c537d['user']['id'],_0x470d62[_0x41c109]['id']],'ToId':[_0x1c537d[_0xb74c('0x66')]['id'],_0x470d62[_0x41c109]['id']],'ChatGroupId':null},'attributes':['id',_0xb74c('0x6f'),_0xb74c('0x70'),_0xb74c('0x71'),_0xb74c('0x72'),'body'],'order':qs[_0xb74c('0x3f')](_0xb74c('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb74c('0x28')](wrapUser(_0x470d62[_0x41c109])));}return BPromise['all'](_0x109d55);}return[];})[_0xb74c('0x28')](function(_0xdefac2){return{'rows':_0xdefac2,'count':_0xdefac2[_0xb74c('0x3a')]};})[_0xb74c('0x28')](respondWithResult(_0x41672f,null))['catch'](handleError(_0x41672f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 0252461..63ae191 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 _0x2eeb=['emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x54b406,_0x53fd7c){var _0x4f851a=function(_0x29bb56){while(--_0x29bb56){_0x54b406['push'](_0x54b406['shift']());}};_0x4f851a(++_0x53fd7c);}(_0x2eeb,0x80));var _0xb2ee=function(_0x2ad508,_0x42888b){_0x2ad508=_0x2ad508-0x0;var _0xb4307c=_0x2eeb[_0x2ad508];return _0xb4307c;};'use strict';var EventEmitter=require(_0xb2ee('0x0'));var ChatInternalMessage=require(_0xb2ee('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb2ee('0x2')](0x0);var events={'afterCreate':_0xb2ee('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x290fb0){return function(_0x102d46,_0x301517,_0x2c095a){ChatInternalMessageEvents[_0xb2ee('0x4')](_0x290fb0+':'+_0x102d46['id'],_0x102d46);ChatInternalMessageEvents[_0xb2ee('0x4')](_0x290fb0,_0x102d46);_0x2c095a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb2ee('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbc1c=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','hasOwnProperty','hook','exports'];(function(_0x4046c3,_0x23ec82){var _0x5a4e0b=function(_0x440742){while(--_0x440742){_0x4046c3['push'](_0x4046c3['shift']());}};_0x5a4e0b(++_0x23ec82);}(_0xbc1c,0x98));var _0xcbc1=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xbc1c[_0x2aea9e];return _0x430b92;};'use strict';var EventEmitter=require(_0xcbc1('0x0'));var ChatInternalMessage=require(_0xcbc1('0x1'))['db'][_0xcbc1('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcbc1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbc1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10aa62){return function(_0x4d6543,_0x56f8e0,_0x36038c){ChatInternalMessageEvents['emit'](_0x10aa62+':'+_0x4d6543['id'],_0x4d6543);ChatInternalMessageEvents['emit'](_0x10aa62,_0x4d6543);_0x36038c(null);};}for(var e in events){if(events[_0xcbc1('0x5')](e)){var event=events[e];ChatInternalMessage[_0xcbc1('0x6')](e,emitEvent(event));}}module[_0xcbc1('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b1a35d6..7c20eb6 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 _0x42fd=['exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x49cb7c,_0x45f0f5){var _0x539621=function(_0x16d2ab){while(--_0x16d2ab){_0x49cb7c['push'](_0x49cb7c['shift']());}};_0x539621(++_0x45f0f5);}(_0x42fd,0x1cc));var _0xd42f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x42fd[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0xd42f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd42f('0x1'));var BPromise=require(_0xd42f('0x2'));var rp=require(_0xd42f('0x3'));var fs=require('fs');var path=require(_0xd42f('0x4'));var rimraf=require(_0xd42f('0x5'));var config=require(_0xd42f('0x6'));var attributes=require(_0xd42f('0x7'));module[_0xd42f('0x8')]=function(_0x6811ff,_0xb900b9){return _0x6811ff[_0xd42f('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd42f('0xa'),'collate':_0xd42f('0xb')});}; \ No newline at end of file +var _0x7f8f=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7f8f,0xb7));var _0xf7f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f8f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf7f8('0x0'));var util=require('util');var logger=require(_0xf7f8('0x1'))(_0xf7f8('0x2'));var moment=require(_0xf7f8('0x3'));var BPromise=require(_0xf7f8('0x4'));var rp=require(_0xf7f8('0x5'));var fs=require('fs');var path=require(_0xf7f8('0x6'));var rimraf=require(_0xf7f8('0x7'));var config=require(_0xf7f8('0x8'));var attributes=require(_0xf7f8('0x9'));module['exports']=function(_0x5c5785,_0x15efff){return _0x5c5785[_0xf7f8('0xa')](_0xf7f8('0xb'),attributes,{'tableName':_0xf7f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7f8('0xd'),'collate':_0xf7f8('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 043ec24..2a302a3 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 _0xd89f=['code','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','register','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xd89f,0x13e));var _0xfd89=function(_0x3c6cb5,_0x4858d1){_0x3c6cb5=_0x3c6cb5-0x0;var _0x5e95a1=_0xd89f[_0x3c6cb5];return _0x5e95a1;};'use strict';var _=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var moment=require('moment');var BPromise=require(_0xfd89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd89('0x3'));var logger=require(_0xfd89('0x4'))(_0xfd89('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd89('0x6')][_0xfd89('0x7')]({'port':0x232a});config[_0xfd89('0x8')]=_[_0xfd89('0x9')](config[_0xfd89('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd89('0xa'))(new Redis(config[_0xfd89('0x8')]));require('./chatInternalMessage.socket')[_0xfd89('0xb')](socket);function respondWithRpcPromise(_0x5dd24e,_0x595fab,_0x1e87cd){return new BPromise(function(_0x50c139,_0x302a91){return client['request'](_0x5dd24e,_0x1e87cd)[_0xfd89('0xc')](function(_0x58078b){logger[_0xfd89('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x595fab,'request\x20sent');logger[_0xfd89('0xe')](_0xfd89('0xf'),_0x595fab,'request\x20sent',JSON[_0xfd89('0x10')](_0x58078b));if(_0x58078b[_0xfd89('0x11')]){if(_0x58078b[_0xfd89('0x11')][_0xfd89('0x12')]===0x1f4){logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x58078b['error'][_0xfd89('0x14')]);return _0x302a91(_0x58078b['error'][_0xfd89('0x14')]);}logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x58078b[_0xfd89('0x11')][_0xfd89('0x14')]);return _0x50c139(_0x58078b[_0xfd89('0x11')]['message']);}else{logger[_0xfd89('0xd')](_0xfd89('0x13'),_0x595fab,_0xfd89('0x15'));_0x50c139(_0x58078b[_0xfd89('0x16')][_0xfd89('0x14')]);}})[_0xfd89('0x17')](function(_0x110325){logger[_0xfd89('0x11')](_0xfd89('0x13'),_0x595fab,_0x110325);_0x302a91(_0x110325);});});} \ No newline at end of file +var _0xc180=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc180,0x185));var _0x0c18=function(_0x13bf5f,_0x23a83f){_0x13bf5f=_0x13bf5f-0x0;var _0x4406c0=_0xc180[_0x13bf5f];return _0x4406c0;};'use strict';var _=require(_0x0c18('0x0'));var util=require(_0x0c18('0x1'));var moment=require(_0x0c18('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c18('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c18('0x4'));var logger=require(_0x0c18('0x5'))(_0x0c18('0x6'));var config=require(_0x0c18('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c18('0x8')][_0x0c18('0x9')]({'port':0x232a});config[_0x0c18('0xa')]=_[_0x0c18('0xb')](config[_0x0c18('0xa')],{'host':_0x0c18('0xc'),'port':0x18eb});var socket=require(_0x0c18('0xd'))(new Redis(config[_0x0c18('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x41d481,_0x23601f,_0x2c3952){return new BPromise(function(_0x5a25d7,_0x33b863){return client[_0x0c18('0xe')](_0x41d481,_0x2c3952)[_0x0c18('0xf')](function(_0x44bd26){logger[_0x0c18('0x10')](_0x0c18('0x11'),_0x23601f,_0x0c18('0x12'));logger[_0x0c18('0x13')](_0x0c18('0x14'),_0x23601f,_0x0c18('0x12'),JSON['stringify'](_0x44bd26));if(_0x44bd26['error']){if(_0x44bd26[_0x0c18('0x15')][_0x0c18('0x16')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x23601f,_0x44bd26[_0x0c18('0x15')][_0x0c18('0x17')]);return _0x33b863(_0x44bd26[_0x0c18('0x15')][_0x0c18('0x17')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x23601f,_0x44bd26[_0x0c18('0x15')][_0x0c18('0x17')]);return _0x5a25d7(_0x44bd26[_0x0c18('0x15')][_0x0c18('0x17')]);}else{logger['info'](_0x0c18('0x11'),_0x23601f,_0x0c18('0x12'));_0x5a25d7(_0x44bd26[_0x0c18('0x18')][_0x0c18('0x17')]);}})[_0x0c18('0x19')](function(_0xb05b50){logger['error'](_0x0c18('0x11'),_0x23601f,_0xb05b50);_0x33b863(_0xb05b50);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7f1483c..fa94e48 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 _0xe790=['save','remove','update','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x282334,_0x13eecb){var _0x576027=function(_0x200cc0){while(--_0x200cc0){_0x282334['push'](_0x282334['shift']());}};_0x576027(++_0x13eecb);}(_0xe790,0x1bf));var _0x0e79=function(_0x3a8f8e,_0x17bda5){_0x3a8f8e=_0x3a8f8e-0x0;var _0x4ad19d=_0xe790[_0x3a8f8e];return _0x4ad19d;};'use strict';var ChatInternalMessageEvents=require(_0x0e79('0x0'));var events=[_0x0e79('0x1'),_0x0e79('0x2'),_0x0e79('0x3')];function createListener(_0x4c3b71,_0xc4b4b3){return function(_0x156e03){_0xc4b4b3[_0x0e79('0x4')](_0x4c3b71,_0x156e03);};}function removeListener(_0x4d533e,_0x29b7a0){return function(){ChatInternalMessageEvents[_0x0e79('0x5')](_0x4d533e,_0x29b7a0);};}exports['register']=function(_0x40a2a5){for(var _0x36a59c=0x0,_0x2cb621=events[_0x0e79('0x6')];_0x36a59c<_0x2cb621;_0x36a59c++){var _0x3cc74a=events[_0x36a59c];var _0x5c1894=createListener('chatInternalMessage:'+_0x3cc74a,_0x40a2a5);ChatInternalMessageEvents['on'](_0x3cc74a,_0x5c1894);}}; \ No newline at end of file +var _0x8f07=['save','emit','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x28b6fe,_0x5b79f2){var _0x43381f=function(_0x5debaa){while(--_0x5debaa){_0x28b6fe['push'](_0x28b6fe['shift']());}};_0x43381f(++_0x5b79f2);}(_0x8f07,0x153));var _0x78f0=function(_0x19a22a,_0x5d4907){_0x19a22a=_0x19a22a-0x0;var _0x490a6c=_0x8f07[_0x19a22a];return _0x490a6c;};'use strict';var ChatInternalMessageEvents=require(_0x78f0('0x0'));var events=[_0x78f0('0x1'),'remove','update'];function createListener(_0x36e16a,_0x3ad596){return function(_0x24a6b7){_0x3ad596[_0x78f0('0x2')](_0x36e16a,_0x24a6b7);};}function removeListener(_0x5864cd,_0xc90105){return function(){ChatInternalMessageEvents['removeListener'](_0x5864cd,_0xc90105);};}exports['register']=function(_0x35199c){for(var _0x358853=0x0,_0x5cf4af=events[_0x78f0('0x3')];_0x358853<_0x5cf4af;_0x358853++){var _0x1b748a=events[_0x358853];var _0x555532=createListener(_0x78f0('0x4')+_0x1b748a,_0x35199c);ChatInternalMessageEvents['on'](_0x1b748a,_0x555532);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4d6ee7b..ecc5ef5 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 _0x7257=['show','post','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','get','/users','getUsers','/:id'];(function(_0x1e2939,_0x1f1ddc){var _0x1a1028=function(_0x28220a){while(--_0x28220a){_0x1e2939['push'](_0x1e2939['shift']());}};_0x1a1028(++_0x1f1ddc);}(_0x7257,0xb8));var _0x7725=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x7257[_0x59e821];return _0x5333f6;};'use strict';var multer=require(_0x7725('0x0'));var util=require(_0x7725('0x1'));var path=require(_0x7725('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7725('0x3')]();var fs_extra=require(_0x7725('0x4'));var auth=require(_0x7725('0x5'));var interaction=require(_0x7725('0x6'));var config=require(_0x7725('0x7'));var controller=require(_0x7725('0x8'));router['get']('/',auth[_0x7725('0x9')](),controller[_0x7725('0xa')]);router['get']('/describe',auth[_0x7725('0x9')](),controller[_0x7725('0xb')]);router[_0x7725('0xc')](_0x7725('0xd'),auth[_0x7725('0x9')](),controller[_0x7725('0xe')]);router[_0x7725('0xc')](_0x7725('0xf'),auth['isAuthenticated'](),controller[_0x7725('0x10')]);router[_0x7725('0x11')]('/',auth[_0x7725('0x9')](),controller['create']);router['put'](_0x7725('0xf'),controller[_0x7725('0x12')]);router['delete'](_0x7725('0xf'),auth[_0x7725('0x9')](),controller['destroy']);module[_0x7725('0x13')]=router; \ No newline at end of file +var _0x4e1c=['get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x4e1c,0x160));var _0xc4e1=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x4e1c[_0x3b9149];return _0x2067f4;};'use strict';var multer=require('multer');var util=require(_0xc4e1('0x0'));var path=require('path');var timeout=require(_0xc4e1('0x1'));var express=require(_0xc4e1('0x2'));var router=express[_0xc4e1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4e1('0x4'));var interaction=require(_0xc4e1('0x5'));var config=require(_0xc4e1('0x6'));var controller=require(_0xc4e1('0x7'));router[_0xc4e1('0x8')]('/',auth[_0xc4e1('0x9')](),controller['index']);router['get'](_0xc4e1('0xa'),auth[_0xc4e1('0x9')](),controller[_0xc4e1('0xb')]);router[_0xc4e1('0x8')](_0xc4e1('0xc'),auth[_0xc4e1('0x9')](),controller[_0xc4e1('0xd')]);router[_0xc4e1('0x8')](_0xc4e1('0xe'),auth[_0xc4e1('0x9')](),controller[_0xc4e1('0xf')]);router[_0xc4e1('0x10')]('/',auth[_0xc4e1('0x9')](),controller['create']);router[_0xc4e1('0x11')](_0xc4e1('0xe'),controller['update']);router[_0xc4e1('0x12')]('/:id',auth[_0xc4e1('0x9')](),controller[_0xc4e1('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 21d4710..a51a14d 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 _0xfa28=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0xfa28[_0x47b15f];return _0x55bf25;};'use strict';var Sequelize=require(_0x8fa2('0x0'));module[_0x8fa2('0x1')]={'body':{'type':Sequelize[_0x8fa2('0x2')](_0x8fa2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8fa2('0x5')]('in',_0x8fa2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8fa2('0x7')]},'providerName':{'type':Sequelize[_0x8fa2('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2c6717,_0x240ba5){var _0x5395f6=function(_0x4184c5){while(--_0x4184c5){_0x2c6717['push'](_0x2c6717['shift']());}};_0x5395f6(++_0x240ba5);}(_0x0447,0x8b));var _0x7044=function(_0x437425,_0x5d0439){_0x437425=_0x437425-0x0;var _0x340245=_0x0447[_0x437425];return _0x340245;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6d7ce8d..84cf623 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 _0x8b38=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','rawAttributes','keys','include','find','create','body','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','User','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','stack','name','send','map','ChatMessage','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0x8b38,0xca));var _0x88b3=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0x8b38[_0x214d54];return _0x44ca46;};'use strict';var emlformat=require(_0x88b3('0x0'));var rimraf=require(_0x88b3('0x1'));var zipdir=require(_0x88b3('0x2'));var jsonpatch=require(_0x88b3('0x3'));var rp=require(_0x88b3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x88b3('0x5'));var util=require(_0x88b3('0x6'));var path=require(_0x88b3('0x7'));var sox=require(_0x88b3('0x8'));var csv=require(_0x88b3('0x9'));var ejs=require(_0x88b3('0xa'));var fs=require('fs');var fs_extra=require(_0x88b3('0xb'));var _=require('lodash');var squel=require(_0x88b3('0xc'));var crypto=require(_0x88b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x88b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x88b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x88b3('0x10'));var authService=require(_0x88b3('0x11'));var qs=require(_0x88b3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88b3('0x13'));var logger=require(_0x88b3('0x14'))(_0x88b3('0x15'));var utils=require(_0x88b3('0x16'));var config=require(_0x88b3('0x17'));var licenseUtil=require(_0x88b3('0x18'));var db=require(_0x88b3('0x19'))['db'];config['redis']=_['defaults'](config[_0x88b3('0x1a')],{'host':_0x88b3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88b3('0x1a')]));require(_0x88b3('0x1c'))['register'](socket);var jayson=require(_0x88b3('0x1d'));var client=jayson[_0x88b3('0x1e')][_0x88b3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x88b3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xce5ce7,_0x2685ae,_0x34bef9,_0x498cfe){return new BPromise(function(_0x417576,_0x4d02a3){var _0x4cd92c=_0x498cfe||client;return _0x4cd92c[_0x88b3('0x20')](_0xce5ce7,_0x34bef9)[_0x88b3('0x21')](function(_0xda6d82){logger['info'](_0x88b3('0x22'),_0x2685ae,_0x88b3('0x23'));logger[_0x88b3('0x24')](_0x88b3('0x25'),_0x2685ae,_0x88b3('0x23'),JSON[_0x88b3('0x26')](_0xda6d82));if(_0xda6d82[_0x88b3('0x27')]){if(_0xda6d82[_0x88b3('0x27')][_0x88b3('0x28')]===0x1f4){logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0xda6d82['error'][_0x88b3('0x29')]);return _0x4d02a3(_0xda6d82['error'][_0x88b3('0x29')]);}logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0xda6d82[_0x88b3('0x27')][_0x88b3('0x29')]);return _0x417576(_0xda6d82[_0x88b3('0x27')][_0x88b3('0x29')]);}else{logger[_0x88b3('0x2a')](_0x88b3('0x22'),_0x2685ae,_0x88b3('0x23'));_0x417576(_0xda6d82[_0x88b3('0x2b')]['message']);}})[_0x88b3('0x2c')](function(_0x5cd07d){logger[_0x88b3('0x27')](_0x88b3('0x22'),_0x2685ae,_0x5cd07d);_0x4d02a3(_0x5cd07d);});});}function respondWithStatusCode(_0xdefa14,_0x57e96){_0x57e96=_0x57e96||0xcc;return function(_0x396a23){if(_0x396a23){return _0xdefa14[_0x88b3('0x2d')](_0x57e96);}return _0xdefa14[_0x88b3('0x2e')](_0x57e96)[_0x88b3('0x2f')]();};}function respondWithResult(_0x30f1e5,_0x59ecb2){_0x59ecb2=_0x59ecb2||0xc8;return function(_0x2624d9){if(_0x2624d9){return _0x30f1e5[_0x88b3('0x2e')](_0x59ecb2)[_0x88b3('0x30')](_0x2624d9);}};}function respondWithFilteredResult(_0x5647c7,_0x556a01){return function(_0x2af0ae){if(_0x2af0ae){var _0x1cfec6=typeof _0x556a01[_0x88b3('0x31')]===_0x88b3('0x32')&&typeof _0x556a01['limit']===_0x88b3('0x32');var _0x133799=_0x2af0ae['count'];var _0x1fc173=_0x1cfec6?0x0:_0x556a01[_0x88b3('0x31')];var _0xd62528=_0x1cfec6?_0x2af0ae['count']:_0x556a01[_0x88b3('0x31')]+_0x556a01[_0x88b3('0x33')];var _0x556dd0;if(_0xd62528>=_0x133799){_0xd62528=_0x133799;_0x556dd0=0xc8;}else{_0x556dd0=0xce;}_0x5647c7['status'](_0x556dd0);return _0x5647c7[_0x88b3('0x34')](_0x88b3('0x35'),_0x1fc173+'-'+_0xd62528+'/'+_0x133799)[_0x88b3('0x30')](_0x2af0ae);}return null;};}function patchUpdates(_0x192fef){return function(_0x4f38d8){try{jsonpatch['apply'](_0x4f38d8,_0x192fef,!![]);}catch(_0x1a1a7e){return BPromise[_0x88b3('0x36')](_0x1a1a7e);}return _0x4f38d8['save']();};}function saveUpdates(_0x29ab4a,_0x56633b){return function(_0x48eaf1){if(_0x48eaf1){return _0x48eaf1[_0x88b3('0x37')](_0x29ab4a)['then'](function(_0xa7cb4){return _0xa7cb4;});}return null;};}function removeEntity(_0x9c5ae6,_0x4919fb){return function(_0xc64e25){if(_0xc64e25){return _0xc64e25['destroy']()['then'](function(){_0x9c5ae6[_0x88b3('0x2e')](0xcc)[_0x88b3('0x2f')]();});}};}function handleEntityNotFound(_0x2a1436,_0x3cd072){return function(_0x595626){if(!_0x595626){_0x2a1436[_0x88b3('0x2d')](0x194);}return _0x595626;};}function handleError(_0x3fa3db,_0x57980c){_0x57980c=_0x57980c||0x1f4;return function(_0x4d1c79){logger[_0x88b3('0x27')](_0x4d1c79[_0x88b3('0x38')]);if(_0x4d1c79[_0x88b3('0x39')]){delete _0x4d1c79[_0x88b3('0x39')];}_0x3fa3db['status'](_0x57980c)[_0x88b3('0x3a')](_0x4d1c79);};}exports['index']=function(_0x94576c,_0x2056e4){var _0x46057e={},_0x5f9a03={},_0xf9afab={'count':0x0,'rows':[]};var _0x497110=_[_0x88b3('0x3b')](db[_0x88b3('0x3c')]['rawAttributes'],function(_0x249641){return{'name':_0x249641[_0x88b3('0x3d')],'type':_0x249641[_0x88b3('0x3e')]['key']};});_0x5f9a03[_0x88b3('0x3f')]=_['map'](_0x497110,_0x88b3('0x39'));_0x5f9a03[_0x88b3('0x40')]=_['keys'](_0x94576c[_0x88b3('0x40')]);_0x5f9a03[_0x88b3('0x41')]=_[_0x88b3('0x42')](_0x5f9a03['model'],_0x5f9a03[_0x88b3('0x40')]);_0x46057e[_0x88b3('0x43')]=_[_0x88b3('0x42')](_0x5f9a03['model'],qs[_0x88b3('0x44')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x44')]));_0x46057e[_0x88b3('0x43')]=_0x46057e[_0x88b3('0x43')][_0x88b3('0x45')]?_0x46057e[_0x88b3('0x43')]:_0x5f9a03[_0x88b3('0x3f')];if(!_0x94576c['query'][_0x88b3('0x46')](_0x88b3('0x47'))){_0x46057e[_0x88b3('0x33')]=qs[_0x88b3('0x33')](_0x94576c[_0x88b3('0x40')]['limit']);_0x46057e[_0x88b3('0x31')]=qs[_0x88b3('0x31')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x31')]);}_0x46057e[_0x88b3('0x48')]=qs[_0x88b3('0x49')](_0x94576c[_0x88b3('0x40')][_0x88b3('0x49')]);_0x46057e[_0x88b3('0x4a')]=qs[_0x88b3('0x41')](_[_0x88b3('0x4b')](_0x94576c[_0x88b3('0x40')],_0x5f9a03[_0x88b3('0x41')]),_0x497110);if(_0x94576c[_0x88b3('0x40')][_0x88b3('0x4c')]){_0x46057e[_0x88b3('0x4a')]=_[_0x88b3('0x4d')](_0x46057e[_0x88b3('0x4a')],{'$or':_[_0x88b3('0x3b')](_0x497110,function(_0x3c1b8f){if(_0x3c1b8f['type']!==_0x88b3('0x4e')){var _0x2b87e9={};_0x2b87e9[_0x3c1b8f[_0x88b3('0x39')]]={'$like':'%'+_0x94576c[_0x88b3('0x40')][_0x88b3('0x4c')]+'%'};return _0x2b87e9;}})});}_0x46057e=_[_0x88b3('0x4d')]({},_0x46057e,_0x94576c[_0x88b3('0x4f')]);var _0x19b5bd={'where':_0x46057e['where']};return db[_0x88b3('0x3c')][_0x88b3('0x50')](_0x19b5bd)[_0x88b3('0x21')](function(_0x53f5df){_0xf9afab['count']=_0x53f5df;if(_0x94576c[_0x88b3('0x40')][_0x88b3('0x51')]){_0x46057e['include']=[{'all':!![]}];}return db[_0x88b3('0x3c')][_0x88b3('0x52')](_0x46057e);})['then'](function(_0x238890){_0xf9afab[_0x88b3('0x53')]=_0x238890;return _0xf9afab;})['then'](respondWithFilteredResult(_0x2056e4,_0x46057e))['catch'](handleError(_0x2056e4,null));};exports[_0x88b3('0x54')]=function(_0x3cebff,_0x1824db){var _0x24a510={'raw':!![],'where':{'id':_0x3cebff[_0x88b3('0x55')]['id']}},_0x25b0ee={};_0x25b0ee['model']=_['keys'](db[_0x88b3('0x3c')][_0x88b3('0x56')]);_0x25b0ee[_0x88b3('0x40')]=_[_0x88b3('0x57')](_0x3cebff[_0x88b3('0x40')]);_0x25b0ee[_0x88b3('0x41')]=_[_0x88b3('0x42')](_0x25b0ee[_0x88b3('0x3f')],_0x25b0ee[_0x88b3('0x40')]);_0x24a510[_0x88b3('0x43')]=_[_0x88b3('0x42')](_0x25b0ee[_0x88b3('0x3f')],qs[_0x88b3('0x44')](_0x3cebff[_0x88b3('0x40')][_0x88b3('0x44')]));_0x24a510[_0x88b3('0x43')]=_0x24a510[_0x88b3('0x43')][_0x88b3('0x45')]?_0x24a510[_0x88b3('0x43')]:_0x25b0ee[_0x88b3('0x3f')];if(_0x3cebff[_0x88b3('0x40')][_0x88b3('0x51')]){_0x24a510[_0x88b3('0x58')]=[{'all':!![]}];}_0x24a510=_[_0x88b3('0x4d')]({},_0x24a510,_0x3cebff[_0x88b3('0x4f')]);return db[_0x88b3('0x3c')][_0x88b3('0x59')](_0x24a510)['then'](handleEntityNotFound(_0x1824db,null))[_0x88b3('0x21')](respondWithResult(_0x1824db,null))['catch'](handleError(_0x1824db,null));};exports['create']=function(_0x43430f,_0x5cb715){return db[_0x88b3('0x3c')][_0x88b3('0x5a')](_0x43430f[_0x88b3('0x5b')],{})[_0x88b3('0x21')](respondWithResult(_0x5cb715,0xc9))[_0x88b3('0x2c')](handleError(_0x5cb715,null));};exports[_0x88b3('0x37')]=function(_0x39c8f9,_0x20d511){if(_0x39c8f9[_0x88b3('0x5b')]['id']){delete _0x39c8f9[_0x88b3('0x5b')]['id'];}return db[_0x88b3('0x3c')]['find']({'where':{'id':_0x39c8f9['params']['id']}})[_0x88b3('0x21')](handleEntityNotFound(_0x20d511,null))[_0x88b3('0x21')](saveUpdates(_0x39c8f9['body'],null))[_0x88b3('0x21')](respondWithResult(_0x20d511,null))['catch'](handleError(_0x20d511,null));};exports[_0x88b3('0x5c')]=function(_0xc48612,_0x5148fa){return db[_0x88b3('0x3c')][_0x88b3('0x59')]({'where':{'id':_0xc48612[_0x88b3('0x55')]['id']}})[_0x88b3('0x21')](handleEntityNotFound(_0x5148fa,null))[_0x88b3('0x21')](removeEntity(_0x5148fa,null))['catch'](handleError(_0x5148fa,null));};exports[_0x88b3('0x5d')]=function(_0x43ac0a,_0xf22058){return db[_0x88b3('0x3c')][_0x88b3('0x5d')]()['then'](respondWithResult(_0xf22058,null))[_0x88b3('0x2c')](handleError(_0xf22058,null));};var interaction_log=require(_0x88b3('0x14'))(_0x88b3('0x5e'));exports['accept']=function(_0x33c431,_0x6a5695,_0x1dda35){var _0x4742f9={'agent':{},'channel':_0x88b3('0x5f')};if(_0x33c431['body']['id']){delete _0x33c431['body']['id'];}_0x33c431[_0x88b3('0x5b')][_0x88b3('0x60')]=!![];_0x33c431[_0x88b3('0x5b')][_0x88b3('0x61')]=moment()[_0x88b3('0x62')](_0x88b3('0x63'));_0x33c431['body']['UserId']=_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')]||_0x33c431[_0x88b3('0x65')]['id'];_0x4742f9['agent']['id']=_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')];return db[_0x88b3('0x3c')][_0x88b3('0x59')]({'where':{'id':_0x33c431['params']['id'],'UserId':null}})[_0x88b3('0x21')](handleEntityNotFound(_0x6a5695,null))[_0x88b3('0x21')](saveUpdates(_0x33c431[_0x88b3('0x5b')],null))[_0x88b3('0x21')](function(_0x2df276){if(_0x2df276){_0x4742f9[_0x88b3('0x29')]=_0x2df276[_0x88b3('0x66')]({'plain':!![]});return db[_0x88b3('0x67')][_0x88b3('0x59')]({'where':{'id':_0x2df276[_0x88b3('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x6a5695,null))[_0x88b3('0x21')](function(_0x19a4d8){if(_0x19a4d8){return _0x19a4d8[_0x88b3('0x37')]({'UserId':_0x33c431[_0x88b3('0x5b')][_0x88b3('0x64')],'read1stAt':_[_0x88b3('0x69')](_0x19a4d8[_0x88b3('0x6a')])?moment()['format'](_0x88b3('0x63')):undefined});}return null;})[_0x88b3('0x21')](function(_0x242e8c){if(_0x242e8c){_0x4742f9['interaction']=_0x242e8c[_0x88b3('0x66')]({'plain':!![]});interaction_log[_0x88b3('0x2a')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33c431[_0x88b3('0x65')]['id'],_0x33c431[_0x88b3('0x65')]['name'],_0x33c431[_0x88b3('0x65')]['role'],_0x4742f9[_0x88b3('0x6b')]['id'],_0x33c431[_0x88b3('0x5b')]?JSON[_0x88b3('0x26')](_0x33c431['body']):_0x88b3('0x6c'));return respondWithRpcPromise(_0x88b3('0x6d'),_0x88b3('0x6e'),_0x4742f9);}return null;})[_0x88b3('0x21')](function(_0x1f6cea){var _0x6ca5e4=_0x88b3('0x6f')+_0x1f6cea[_0x88b3('0x29')][_0x88b3('0x70')];return db[_0x88b3('0x71')][_0x88b3('0x40')](_0x6ca5e4,{'type':db[_0x88b3('0x72')][_0x88b3('0x73')][_0x88b3('0x74')],'raw':!![]})[_0x88b3('0x21')](function(_0x3b46ed){return _0x3b46ed;});})[_0x88b3('0x21')](function(_0x251223){if(_0x251223){_0x4742f9[_0x88b3('0x29')]['contact']=_0x251223[0x0];if(!_0x33c431[_0x88b3('0x5b')]['UserId'])return;return db['User'][_0x88b3('0x59')]({'where':{'id':_0x33c431[_0x88b3('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x88b3('0x39'),_0x88b3('0x75'),_0x88b3('0x76'),_0x88b3('0x77')],'raw':!![]});}return null;})[_0x88b3('0x21')](function(_0x154014){if(!_0x154014)return null;_0x4742f9[_0x88b3('0x29')][_0x88b3('0x78')]=_0x154014;return _0x4742f9;})[_0x88b3('0x21')](function(_0xd55b11){if(_0xd55b11){if(_0x33c431[_0x88b3('0x5b')][_0x88b3('0x79')]){_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7a')]=util[_0x88b3('0x62')](_0x88b3('0x7b'),_0x33c431[_0x88b3('0x65')]['name']);_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7c')]=_0x4742f9[_0x88b3('0x7c')];_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7d')]=_0x4742f9[_0x88b3('0x7c')];_0x4742f9[_0x88b3('0x29')][_0x88b3('0x7e')]=_0x88b3('0x7f');return respondWithRpcPromise(_0x88b3('0x80'),'EventManager',{'event':_0x88b3('0x81'),'message':_[_0x88b3('0x4d')](_0x4742f9[_0x88b3('0x29')],JSON['parse'](_0x4742f9[_0x88b3('0x6b')][_0x88b3('0x82')]))},client9002)[_0x88b3('0x21')](function(){return _0x4742f9;});}return _0x4742f9;}return null;})[_0x88b3('0x21')](respondWithResult(_0x6a5695,null))[_0x88b3('0x2c')](handleError(_0x6a5695,null));};var interaction_log=require(_0x88b3('0x14'))(_0x88b3('0x5e'));exports['reject']=function(_0x39a9cd,_0x28400d,_0x5efbfe){var _0x1651e8={'agent':{},'channel':'chat'};if(_0x39a9cd['body']['id']){delete _0x39a9cd[_0x88b3('0x5b')]['id'];}_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')]=_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')]||_0x39a9cd[_0x88b3('0x65')]['id'];_0x1651e8[_0x88b3('0x78')]['id']=_0x39a9cd['body']['UserId'];return db[_0x88b3('0x3c')]['find']({'where':{'id':_0x39a9cd['params']['id'],'UserId':null}})[_0x88b3('0x21')](handleEntityNotFound(_0x28400d,null))[_0x88b3('0x21')](function(_0x510b2f){if(_0x510b2f){_0x1651e8[_0x88b3('0x29')]=_0x510b2f[_0x88b3('0x66')]({'plain':!![]});return db[_0x88b3('0x67')][_0x88b3('0x59')]({'where':{'id':_0x510b2f[_0x88b3('0x68')]}});}return null;})[_0x88b3('0x21')](handleEntityNotFound(_0x28400d,null))['then'](function(_0x20db2c){if(_0x20db2c){_0x1651e8[_0x88b3('0x6b')]=_0x20db2c[_0x88b3('0x66')]({'plain':!![]});interaction_log['info'](_0x88b3('0x83'),_0x39a9cd[_0x88b3('0x65')]['id'],_0x39a9cd[_0x88b3('0x65')][_0x88b3('0x39')],_0x39a9cd['user']['role'],_0x1651e8['interaction']['id'],_0x39a9cd[_0x88b3('0x5b')]?JSON['stringify'](_0x39a9cd[_0x88b3('0x5b')]):'null');return respondWithRpcPromise(_0x88b3('0x84'),'rejectMessage',_0x1651e8);}return null;})['then'](function(_0x398dee){var _0x527f7f=_0x88b3('0x6f')+_0x398dee[_0x88b3('0x29')][_0x88b3('0x70')];return db[_0x88b3('0x71')][_0x88b3('0x40')](_0x527f7f,{'type':db[_0x88b3('0x72')][_0x88b3('0x73')]['SELECT'],'raw':!![]})[_0x88b3('0x21')](function(_0x34e406){return _0x34e406;});})[_0x88b3('0x21')](function(_0x470972){if(_0x470972){_0x1651e8[_0x88b3('0x29')][_0x88b3('0x85')]=_0x470972[0x0];if(!_0x39a9cd[_0x88b3('0x5b')][_0x88b3('0x64')])return;return db[_0x88b3('0x86')]['find']({'where':{'id':_0x39a9cd[_0x88b3('0x5b')]['UserId'],'role':_0x88b3('0x78')},'attributes':['id',_0x88b3('0x39'),_0x88b3('0x75'),_0x88b3('0x76'),_0x88b3('0x77')],'raw':!![]});}return null;})['then'](function(_0x24eb07){if(!_0x24eb07)return null;_0x1651e8[_0x88b3('0x29')][_0x88b3('0x78')]=_0x24eb07;return _0x1651e8;})[_0x88b3('0x21')](function(_0x1de9d5){if(_0x1de9d5){_0x1de9d5[_0x88b3('0x29')][_0x88b3('0x7a')]=util[_0x88b3('0x62')](_0x88b3('0x7b'),_0x39a9cd['user'][_0x88b3('0x39')]);_0x1de9d5['message'][_0x88b3('0x7c')]=_0x1651e8[_0x88b3('0x7c')];_0x1de9d5['message']['motionChannel']=_0x1651e8[_0x88b3('0x7c')];_0x1de9d5[_0x88b3('0x29')][_0x88b3('0x7e')]=_0x88b3('0x36');respondWithRpcPromise('EventManager',_0x88b3('0x80'),{'event':'rejectmessage','message':_[_0x88b3('0x4d')](_0x1651e8['message'],JSON[_0x88b3('0x87')](_0x1651e8[_0x88b3('0x6b')]['formData']))},client9002);return _0x1651e8;}return null;})[_0x88b3('0x21')](respondWithResult(_0x28400d,null))[_0x88b3('0x2c')](handleError(_0x28400d,null));}; \ No newline at end of file +var _0xb67c=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','http','client','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','stack','name','send','index','map','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','include','catch','show','params','includeAll','find','create','update','body','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','parse','formData','chat-interactions','chat','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','SIP/%s','event','rejectmessage','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x48188b,_0x1adcc5){var _0x24357c=function(_0x196dbf){while(--_0x196dbf){_0x48188b['push'](_0x48188b['shift']());}};_0x24357c(++_0x1adcc5);}(_0xb67c,0x7a));var _0xcb67=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0xb67c[_0x2c2a8e];return _0x3b9e38;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcb67('0x0'));var jsonpatch=require(_0xcb67('0x1'));var rp=require(_0xcb67('0x2'));var moment=require(_0xcb67('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcb67('0x4'));var path=require(_0xcb67('0x5'));var sox=require('sox');var csv=require(_0xcb67('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb67('0x7'));var _=require(_0xcb67('0x8'));var squel=require(_0xcb67('0x9'));var crypto=require(_0xcb67('0xa'));var jsforce=require(_0xcb67('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcb67('0xc'));var authService=require(_0xcb67('0xd'));var qs=require(_0xcb67('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb67('0xf'));var logger=require(_0xcb67('0x10'))(_0xcb67('0x11'));var utils=require(_0xcb67('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb67('0x13'))['db'];config[_0xcb67('0x14')]=_[_0xcb67('0x15')](config[_0xcb67('0x14')],{'host':_0xcb67('0x16'),'port':0x18eb});var socket=require(_0xcb67('0x17'))(new Redis(config[_0xcb67('0x14')]));require(_0xcb67('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcb67('0x19')]({'port':0x232c});var client9002=jayson[_0xcb67('0x1a')][_0xcb67('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1d99d8,_0x3e9a2f,_0x54a73a,_0x8f1346){return new BPromise(function(_0x2469a5,_0x13ca6c){var _0x2ff51b=_0x8f1346||client;return _0x2ff51b[_0xcb67('0x1b')](_0x1d99d8,_0x54a73a)[_0xcb67('0x1c')](function(_0x5e5737){logger['info']('ChatMessage,\x20%s,\x20%s',_0x3e9a2f,_0xcb67('0x1d'));logger[_0xcb67('0x1e')](_0xcb67('0x1f'),_0x3e9a2f,_0xcb67('0x1d'),JSON[_0xcb67('0x20')](_0x5e5737));if(_0x5e5737['error']){if(_0x5e5737[_0xcb67('0x21')][_0xcb67('0x22')]===0x1f4){logger[_0xcb67('0x21')](_0xcb67('0x23'),_0x3e9a2f,_0x5e5737[_0xcb67('0x21')][_0xcb67('0x24')]);return _0x13ca6c(_0x5e5737[_0xcb67('0x21')]['message']);}logger[_0xcb67('0x21')](_0xcb67('0x23'),_0x3e9a2f,_0x5e5737['error']['message']);return _0x2469a5(_0x5e5737['error']['message']);}else{logger[_0xcb67('0x25')]('ChatMessage,\x20%s,\x20%s',_0x3e9a2f,'request\x20sent');_0x2469a5(_0x5e5737[_0xcb67('0x26')][_0xcb67('0x24')]);}})['catch'](function(_0x4806f5){logger[_0xcb67('0x21')](_0xcb67('0x23'),_0x3e9a2f,_0x4806f5);_0x13ca6c(_0x4806f5);});});}function respondWithStatusCode(_0x400e3e,_0x3f7d81){_0x3f7d81=_0x3f7d81||0xcc;return function(_0x4f3dbd){if(_0x4f3dbd){return _0x400e3e[_0xcb67('0x27')](_0x3f7d81);}return _0x400e3e[_0xcb67('0x28')](_0x3f7d81)[_0xcb67('0x29')]();};}function respondWithResult(_0x21b995,_0x1dc425){_0x1dc425=_0x1dc425||0xc8;return function(_0xe5e3fc){if(_0xe5e3fc){return _0x21b995[_0xcb67('0x28')](_0x1dc425)['json'](_0xe5e3fc);}};}function respondWithFilteredResult(_0x4c7ad4,_0xcaba23){return function(_0x5a1071){if(_0x5a1071){var _0x194b09=typeof _0xcaba23[_0xcb67('0x2a')]===_0xcb67('0x2b')&&typeof _0xcaba23[_0xcb67('0x2c')]==='undefined';var _0xfb4ded=_0x5a1071[_0xcb67('0x2d')];var _0x4a9a6f=_0x194b09?0x0:_0xcaba23[_0xcb67('0x2a')];var _0x4f8c46=_0x194b09?_0x5a1071[_0xcb67('0x2d')]:_0xcaba23[_0xcb67('0x2a')]+_0xcaba23[_0xcb67('0x2c')];var _0x413c1a;if(_0x4f8c46>=_0xfb4ded){_0x4f8c46=_0xfb4ded;_0x413c1a=0xc8;}else{_0x413c1a=0xce;}_0x4c7ad4[_0xcb67('0x28')](_0x413c1a);return _0x4c7ad4[_0xcb67('0x2e')]('Content-Range',_0x4a9a6f+'-'+_0x4f8c46+'/'+_0xfb4ded)[_0xcb67('0x2f')](_0x5a1071);}return null;};}function patchUpdates(_0x45467d){return function(_0x1ca916){try{jsonpatch[_0xcb67('0x30')](_0x1ca916,_0x45467d,!![]);}catch(_0xaaa1b1){return BPromise[_0xcb67('0x31')](_0xaaa1b1);}return _0x1ca916[_0xcb67('0x32')]();};}function saveUpdates(_0x586198,_0x510deb){return function(_0x7a692c){if(_0x7a692c){return _0x7a692c['update'](_0x586198)[_0xcb67('0x1c')](function(_0x277c79){return _0x277c79;});}return null;};}function removeEntity(_0x541008,_0x32bac6){return function(_0x220955){if(_0x220955){return _0x220955['destroy']()[_0xcb67('0x1c')](function(){_0x541008[_0xcb67('0x28')](0xcc)[_0xcb67('0x29')]();});}};}function handleEntityNotFound(_0x513284,_0x563f80){return function(_0x1244de){if(!_0x1244de){_0x513284[_0xcb67('0x27')](0x194);}return _0x1244de;};}function handleError(_0x5a0d4c,_0x551f38){_0x551f38=_0x551f38||0x1f4;return function(_0x2cd253){logger[_0xcb67('0x21')](_0x2cd253[_0xcb67('0x33')]);if(_0x2cd253[_0xcb67('0x34')]){delete _0x2cd253['name'];}_0x5a0d4c[_0xcb67('0x28')](_0x551f38)[_0xcb67('0x35')](_0x2cd253);};}exports[_0xcb67('0x36')]=function(_0x5d9772,_0x2e4c11){var _0x597b23={},_0x57555c={},_0x3fcf45={'count':0x0,'rows':[]};var _0x226a40=_[_0xcb67('0x37')](db[_0xcb67('0x38')][_0xcb67('0x39')],function(_0x1c562d){return{'name':_0x1c562d['fieldName'],'type':_0x1c562d['type']['key']};});_0x57555c[_0xcb67('0x3a')]=_[_0xcb67('0x37')](_0x226a40,_0xcb67('0x34'));_0x57555c[_0xcb67('0x3b')]=_[_0xcb67('0x3c')](_0x5d9772[_0xcb67('0x3b')]);_0x57555c[_0xcb67('0x3d')]=_[_0xcb67('0x3e')](_0x57555c[_0xcb67('0x3a')],_0x57555c[_0xcb67('0x3b')]);_0x597b23[_0xcb67('0x3f')]=_[_0xcb67('0x3e')](_0x57555c[_0xcb67('0x3a')],qs[_0xcb67('0x40')](_0x5d9772['query'][_0xcb67('0x40')]));_0x597b23['attributes']=_0x597b23['attributes'][_0xcb67('0x41')]?_0x597b23['attributes']:_0x57555c[_0xcb67('0x3a')];if(!_0x5d9772[_0xcb67('0x3b')]['hasOwnProperty'](_0xcb67('0x42'))){_0x597b23[_0xcb67('0x2c')]=qs['limit'](_0x5d9772[_0xcb67('0x3b')][_0xcb67('0x2c')]);_0x597b23['offset']=qs[_0xcb67('0x2a')](_0x5d9772[_0xcb67('0x3b')][_0xcb67('0x2a')]);}_0x597b23[_0xcb67('0x43')]=qs[_0xcb67('0x44')](_0x5d9772['query'][_0xcb67('0x44')]);_0x597b23[_0xcb67('0x45')]=qs[_0xcb67('0x3d')](_[_0xcb67('0x46')](_0x5d9772['query'],_0x57555c['filters']),_0x226a40);if(_0x5d9772[_0xcb67('0x3b')][_0xcb67('0x47')]){_0x597b23['where']=_[_0xcb67('0x48')](_0x597b23[_0xcb67('0x45')],{'$or':_[_0xcb67('0x37')](_0x226a40,function(_0x294104){if(_0x294104[_0xcb67('0x49')]!=='VIRTUAL'){var _0x5b4ddb={};_0x5b4ddb[_0x294104[_0xcb67('0x34')]]={'$like':'%'+_0x5d9772[_0xcb67('0x3b')][_0xcb67('0x47')]+'%'};return _0x5b4ddb;}})});}_0x597b23=_['merge']({},_0x597b23,_0x5d9772['options']);var _0x2e2a57={'where':_0x597b23[_0xcb67('0x45')]};return db[_0xcb67('0x38')][_0xcb67('0x2d')](_0x2e2a57)[_0xcb67('0x1c')](function(_0x5cf3cd){_0x3fcf45[_0xcb67('0x2d')]=_0x5cf3cd;if(_0x5d9772['query']['includeAll']){_0x597b23[_0xcb67('0x4a')]=[{'all':!![]}];}return db[_0xcb67('0x38')]['findAll'](_0x597b23);})[_0xcb67('0x1c')](function(_0x5e974f){_0x3fcf45['rows']=_0x5e974f;return _0x3fcf45;})[_0xcb67('0x1c')](respondWithFilteredResult(_0x2e4c11,_0x597b23))[_0xcb67('0x4b')](handleError(_0x2e4c11,null));};exports[_0xcb67('0x4c')]=function(_0x5d6c25,_0x3fb805){var _0x46b19d={'raw':!![],'where':{'id':_0x5d6c25[_0xcb67('0x4d')]['id']}},_0x388ef9={};_0x388ef9[_0xcb67('0x3a')]=_['keys'](db['ChatMessage'][_0xcb67('0x39')]);_0x388ef9[_0xcb67('0x3b')]=_['keys'](_0x5d6c25[_0xcb67('0x3b')]);_0x388ef9[_0xcb67('0x3d')]=_['intersection'](_0x388ef9[_0xcb67('0x3a')],_0x388ef9[_0xcb67('0x3b')]);_0x46b19d[_0xcb67('0x3f')]=_['intersection'](_0x388ef9[_0xcb67('0x3a')],qs[_0xcb67('0x40')](_0x5d6c25[_0xcb67('0x3b')][_0xcb67('0x40')]));_0x46b19d['attributes']=_0x46b19d[_0xcb67('0x3f')][_0xcb67('0x41')]?_0x46b19d[_0xcb67('0x3f')]:_0x388ef9[_0xcb67('0x3a')];if(_0x5d6c25['query'][_0xcb67('0x4e')]){_0x46b19d[_0xcb67('0x4a')]=[{'all':!![]}];}_0x46b19d=_[_0xcb67('0x48')]({},_0x46b19d,_0x5d6c25['options']);return db[_0xcb67('0x38')][_0xcb67('0x4f')](_0x46b19d)[_0xcb67('0x1c')](handleEntityNotFound(_0x3fb805,null))[_0xcb67('0x1c')](respondWithResult(_0x3fb805,null))[_0xcb67('0x4b')](handleError(_0x3fb805,null));};exports[_0xcb67('0x50')]=function(_0x3fcfab,_0x31bc77){return db[_0xcb67('0x38')][_0xcb67('0x50')](_0x3fcfab['body'],{})[_0xcb67('0x1c')](respondWithResult(_0x31bc77,0xc9))[_0xcb67('0x4b')](handleError(_0x31bc77,null));};exports[_0xcb67('0x51')]=function(_0x112d83,_0x42a91b){if(_0x112d83['body']['id']){delete _0x112d83['body']['id'];}return db['ChatMessage'][_0xcb67('0x4f')]({'where':{'id':_0x112d83[_0xcb67('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42a91b,null))[_0xcb67('0x1c')](saveUpdates(_0x112d83[_0xcb67('0x52')],null))[_0xcb67('0x1c')](respondWithResult(_0x42a91b,null))[_0xcb67('0x4b')](handleError(_0x42a91b,null));};exports[_0xcb67('0x53')]=function(_0x2d0e55,_0x128b8e){return db[_0xcb67('0x38')][_0xcb67('0x4f')]({'where':{'id':_0x2d0e55[_0xcb67('0x4d')]['id']}})[_0xcb67('0x1c')](handleEntityNotFound(_0x128b8e,null))[_0xcb67('0x1c')](removeEntity(_0x128b8e,null))[_0xcb67('0x4b')](handleError(_0x128b8e,null));};exports['describe']=function(_0x25772e,_0x2aff86){return db['ChatMessage'][_0xcb67('0x54')]()[_0xcb67('0x1c')](respondWithResult(_0x2aff86,null))['catch'](handleError(_0x2aff86,null));};var interaction_log=require(_0xcb67('0x10'))('chat-interactions');exports[_0xcb67('0x55')]=function(_0x6eae3e,_0x12802b,_0x550ea3){var _0x3e3263={'agent':{},'channel':'chat'};if(_0x6eae3e[_0xcb67('0x52')]['id']){delete _0x6eae3e[_0xcb67('0x52')]['id'];}_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x56')]=!![];_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x57')]=moment()[_0xcb67('0x58')](_0xcb67('0x59'));_0x6eae3e[_0xcb67('0x52')]['UserId']=_0x6eae3e['body'][_0xcb67('0x5a')]||_0x6eae3e[_0xcb67('0x5b')]['id'];_0x3e3263[_0xcb67('0x5c')]['id']=_0x6eae3e['body'][_0xcb67('0x5a')];return db['ChatMessage'][_0xcb67('0x4f')]({'where':{'id':_0x6eae3e[_0xcb67('0x4d')]['id'],'UserId':null}})[_0xcb67('0x1c')](handleEntityNotFound(_0x12802b,null))[_0xcb67('0x1c')](saveUpdates(_0x6eae3e[_0xcb67('0x52')],null))[_0xcb67('0x1c')](function(_0x4d633d){if(_0x4d633d){_0x3e3263[_0xcb67('0x24')]=_0x4d633d[_0xcb67('0x5d')]({'plain':!![]});return db[_0xcb67('0x5e')][_0xcb67('0x4f')]({'where':{'id':_0x4d633d[_0xcb67('0x5f')]}});}return null;})[_0xcb67('0x1c')](handleEntityNotFound(_0x12802b,null))['then'](function(_0x540236){if(_0x540236){return _0x540236[_0xcb67('0x51')]({'UserId':_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x5a')],'read1stAt':_[_0xcb67('0x60')](_0x540236[_0xcb67('0x61')])?moment()['format'](_0xcb67('0x59')):undefined});}return null;})[_0xcb67('0x1c')](function(_0x30f093){if(_0x30f093){_0x3e3263[_0xcb67('0x62')]=_0x30f093[_0xcb67('0x5d')]({'plain':!![]});interaction_log[_0xcb67('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6eae3e['user']['id'],_0x6eae3e[_0xcb67('0x5b')][_0xcb67('0x34')],_0x6eae3e[_0xcb67('0x5b')][_0xcb67('0x63')],_0x3e3263[_0xcb67('0x62')]['id'],_0x6eae3e[_0xcb67('0x52')]?JSON[_0xcb67('0x20')](_0x6eae3e[_0xcb67('0x52')]):_0xcb67('0x64'));return respondWithRpcPromise(_0xcb67('0x65'),_0xcb67('0x66'),_0x3e3263);}return null;})[_0xcb67('0x1c')](function(_0x56e6fa){var _0x35bf19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x56e6fa[_0xcb67('0x24')][_0xcb67('0x67')];return db[_0xcb67('0x68')]['query'](_0x35bf19,{'type':db['Sequelize'][_0xcb67('0x69')][_0xcb67('0x6a')],'raw':!![]})[_0xcb67('0x1c')](function(_0x282b9e){return _0x282b9e;});})[_0xcb67('0x1c')](function(_0xfaad41){if(_0xfaad41){_0x3e3263[_0xcb67('0x24')][_0xcb67('0x6b')]=_0xfaad41[0x0];if(!_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x5a')])return;return db['User'][_0xcb67('0x4f')]({'where':{'id':_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x5a')],'role':_0xcb67('0x5c')},'attributes':['id',_0xcb67('0x34'),_0xcb67('0x6c'),_0xcb67('0x6d'),_0xcb67('0x6e')],'raw':!![]});}return null;})[_0xcb67('0x1c')](function(_0x203091){if(!_0x203091)return null;_0x3e3263[_0xcb67('0x24')][_0xcb67('0x5c')]=_0x203091;return _0x3e3263;})[_0xcb67('0x1c')](function(_0x561e13){if(_0x561e13){if(_0x6eae3e[_0xcb67('0x52')][_0xcb67('0x6f')]){_0x3e3263[_0xcb67('0x24')][_0xcb67('0x70')]=util[_0xcb67('0x58')]('SIP/%s',_0x6eae3e[_0xcb67('0x5b')]['name']);_0x3e3263['message'][_0xcb67('0x71')]=_0x3e3263['channel'];_0x3e3263[_0xcb67('0x24')][_0xcb67('0x72')]=_0x3e3263[_0xcb67('0x71')];_0x3e3263[_0xcb67('0x24')]['event']=_0xcb67('0x55');return respondWithRpcPromise(_0xcb67('0x73'),_0xcb67('0x73'),{'event':'acceptmessage','message':_[_0xcb67('0x48')](_0x3e3263[_0xcb67('0x24')],JSON[_0xcb67('0x74')](_0x3e3263[_0xcb67('0x62')][_0xcb67('0x75')]))},client9002)['then'](function(){return _0x3e3263;});}return _0x3e3263;}return null;})[_0xcb67('0x1c')](respondWithResult(_0x12802b,null))[_0xcb67('0x4b')](handleError(_0x12802b,null));};var interaction_log=require('../../config/logger')(_0xcb67('0x76'));exports[_0xcb67('0x31')]=function(_0x41cbca,_0x4ab040,_0x23e200){var _0x2f8b8d={'agent':{},'channel':_0xcb67('0x77')};if(_0x41cbca[_0xcb67('0x52')]['id']){delete _0x41cbca[_0xcb67('0x52')]['id'];}_0x41cbca[_0xcb67('0x52')]['UserId']=_0x41cbca[_0xcb67('0x52')][_0xcb67('0x5a')]||_0x41cbca[_0xcb67('0x5b')]['id'];_0x2f8b8d[_0xcb67('0x5c')]['id']=_0x41cbca[_0xcb67('0x52')][_0xcb67('0x5a')];return db[_0xcb67('0x38')][_0xcb67('0x4f')]({'where':{'id':_0x41cbca['params']['id'],'UserId':null}})[_0xcb67('0x1c')](handleEntityNotFound(_0x4ab040,null))['then'](function(_0x3a8531){if(_0x3a8531){_0x2f8b8d[_0xcb67('0x24')]=_0x3a8531[_0xcb67('0x5d')]({'plain':!![]});return db[_0xcb67('0x5e')][_0xcb67('0x4f')]({'where':{'id':_0x3a8531['ChatInteractionId']}});}return null;})[_0xcb67('0x1c')](handleEntityNotFound(_0x4ab040,null))[_0xcb67('0x1c')](function(_0x2aaf4e){if(_0x2aaf4e){_0x2f8b8d[_0xcb67('0x62')]=_0x2aaf4e[_0xcb67('0x5d')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41cbca['user']['id'],_0x41cbca[_0xcb67('0x5b')][_0xcb67('0x34')],_0x41cbca[_0xcb67('0x5b')][_0xcb67('0x63')],_0x2f8b8d[_0xcb67('0x62')]['id'],_0x41cbca[_0xcb67('0x52')]?JSON[_0xcb67('0x20')](_0x41cbca[_0xcb67('0x52')]):_0xcb67('0x64'));return respondWithRpcPromise(_0xcb67('0x78'),'rejectMessage',_0x2f8b8d);}return null;})[_0xcb67('0x1c')](function(_0x139c4c){var _0x52f6a2=_0xcb67('0x79')+_0x139c4c[_0xcb67('0x24')]['ContactId'];return db['sequelize'][_0xcb67('0x3b')](_0x52f6a2,{'type':db['Sequelize'][_0xcb67('0x69')]['SELECT'],'raw':!![]})['then'](function(_0x27fcbe){return _0x27fcbe;});})[_0xcb67('0x1c')](function(_0x20ad79){if(_0x20ad79){_0x2f8b8d[_0xcb67('0x24')]['contact']=_0x20ad79[0x0];if(!_0x41cbca[_0xcb67('0x52')]['UserId'])return;return db[_0xcb67('0x7a')][_0xcb67('0x4f')]({'where':{'id':_0x41cbca[_0xcb67('0x52')]['UserId'],'role':_0xcb67('0x5c')},'attributes':['id',_0xcb67('0x34'),_0xcb67('0x6c'),_0xcb67('0x6d'),_0xcb67('0x6e')],'raw':!![]});}return null;})['then'](function(_0x1cf8b7){if(!_0x1cf8b7)return null;_0x2f8b8d[_0xcb67('0x24')][_0xcb67('0x5c')]=_0x1cf8b7;return _0x2f8b8d;})['then'](function(_0x13763b){if(_0x13763b){_0x13763b[_0xcb67('0x24')][_0xcb67('0x70')]=util['format'](_0xcb67('0x7b'),_0x41cbca[_0xcb67('0x5b')]['name']);_0x13763b[_0xcb67('0x24')]['channel']=_0x2f8b8d[_0xcb67('0x71')];_0x13763b['message'][_0xcb67('0x72')]=_0x2f8b8d[_0xcb67('0x71')];_0x13763b[_0xcb67('0x24')][_0xcb67('0x7c')]=_0xcb67('0x31');respondWithRpcPromise(_0xcb67('0x73'),_0xcb67('0x73'),{'event':_0xcb67('0x7d'),'message':_[_0xcb67('0x48')](_0x2f8b8d[_0xcb67('0x24')],JSON[_0xcb67('0x74')](_0x2f8b8d['interaction'][_0xcb67('0x75')]))},client9002);return _0x2f8b8d;}return null;})[_0xcb67('0x1c')](respondWithResult(_0x4ab040,null))['catch'](handleError(_0x4ab040,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a0b7396..16f420d 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 _0xe771=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1a64f5,_0x3fcdf5){var _0x2519b5=function(_0x4f113a){while(--_0x4f113a){_0x1a64f5['push'](_0x1a64f5['shift']());}};_0x2519b5(++_0x3fcdf5);}(_0xe771,0x18f));var _0x1e77=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe771[_0x39096d];return _0x13da4f;};'use strict';var EventEmitter=require(_0x1e77('0x0'));var ChatMessage=require(_0x1e77('0x1'))['db'][_0x1e77('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e77('0x3')](0x0);var events={'afterCreate':_0x1e77('0x4'),'afterUpdate':_0x1e77('0x5'),'afterDestroy':_0x1e77('0x6')};function emitEvent(_0x18dc94){return function(_0x44487c,_0x3afc60,_0x1f6b2b){ChatMessageEvents[_0x1e77('0x7')](_0x18dc94+':'+_0x44487c['id'],_0x44487c);ChatMessageEvents[_0x1e77('0x7')](_0x18dc94,_0x44487c);_0x1f6b2b(null);};}for(var e in events){if(events[_0x1e77('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1e77('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xa325=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xd28666,_0x4827a0){var _0x22694e=function(_0x9e8e51){while(--_0x9e8e51){_0xd28666['push'](_0xd28666['shift']());}};_0x22694e(++_0x4827a0);}(_0xa325,0x69));var _0x5a32=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa325[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0x5a32('0x0'));var ChatMessage=require(_0x5a32('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5a32('0x2')](0x0);var events={'afterCreate':_0x5a32('0x3'),'afterUpdate':_0x5a32('0x4'),'afterDestroy':_0x5a32('0x5')};function emitEvent(_0x566696){return function(_0x360421,_0x32c283,_0x16f3a5){ChatMessageEvents[_0x5a32('0x6')](_0x566696+':'+_0x360421['id'],_0x360421);ChatMessageEvents[_0x5a32('0x6')](_0x566696,_0x360421);_0x16f3a5(null);};}for(var e in events){if(events[_0x5a32('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 475ede7..84afa03 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 _0x75a4=['exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','rimraf','./chatMessage.attributes'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x75a4,0x180));var _0x475a=function(_0x31d20e,_0x42105f){_0x31d20e=_0x31d20e-0x0;var _0x5927b1=_0x75a4[_0x31d20e];return _0x5927b1;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var logger=require(_0x475a('0x2'))('api');var moment=require(_0x475a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x475a('0x4'));var config=require('../../config/environment');var attributes=require(_0x475a('0x5'));module[_0x475a('0x6')]=function(_0x3bb4e9,_0x202d52){return _0x3bb4e9[_0x475a('0x7')](_0x475a('0x8'),attributes,{'tableName':_0x475a('0x9'),'paranoid':![],'indexes':[{'name':_0x475a('0xa'),'fields':[_0x475a('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4dd621,_0xecea11,_0x119dea){var _0x27d12d=_0x3bb4e9[_0x475a('0xc')];var _0x25451f=_0x4dd621[_0x475a('0xd')]({'plain':!![]});if(_0x25451f[_0x475a('0xe')][_0x475a('0xf')]()==='in'||_0x25451f['direction'][_0x475a('0xf')]()===_0x475a('0x10')&&!_0x25451f[_0x475a('0x11')]&&!_[_0x475a('0x12')](_0x25451f[_0x475a('0x13')])){_0x27d12d[_0x475a('0x14')][_0x475a('0x15')]({'where':{'id':_0x25451f[_0x475a('0x16')]}})[_0x475a('0x17')](function(_0x5490c6){if(_0x5490c6){_0x5490c6[_0x475a('0x18')]({'lastMsgAt':_0x25451f[_0x475a('0x19')],'lastMsgDirection':_0x25451f[_0x475a('0xe')][_0x475a('0xf')]()});}})[_0x475a('0x1a')](function(_0x38d7d6){console[_0x475a('0x1b')](_0x38d7d6);});}_0x119dea();}},'charset':_0x475a('0x1c'),'collate':_0x475a('0x1d')});}; \ No newline at end of file +var _0x2c37=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x12c54b,_0x97dbad){var _0x439530=function(_0x421573){while(--_0x421573){_0x12c54b['push'](_0x12c54b['shift']());}};_0x439530(++_0x97dbad);}(_0x2c37,0x175));var _0x72c3=function(_0x2d1e0a,_0x4be683){_0x2d1e0a=_0x2d1e0a-0x0;var _0x2c508b=_0x2c37[_0x2d1e0a];return _0x2c508b;};'use strict';var _=require('lodash');var util=require(_0x72c3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x72c3('0x1'));var BPromise=require('bluebird');var rp=require(_0x72c3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72c3('0x3'));var config=require(_0x72c3('0x4'));var attributes=require(_0x72c3('0x5'));module[_0x72c3('0x6')]=function(_0x560d55,_0x508afa){return _0x560d55[_0x72c3('0x7')](_0x72c3('0x8'),attributes,{'tableName':_0x72c3('0x9'),'paranoid':![],'indexes':[{'name':_0x72c3('0xa'),'fields':[_0x72c3('0xb')],'type':_0x72c3('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43fe24,_0x404365,_0x38b84f){var _0x5225d3=_0x560d55[_0x72c3('0xd')];var _0x1852ad=_0x43fe24[_0x72c3('0xe')]({'plain':!![]});if(_0x1852ad['direction']['toLowerCase']()==='in'||_0x1852ad[_0x72c3('0xf')][_0x72c3('0x10')]()==='out'&&!_0x1852ad[_0x72c3('0x11')]&&!_[_0x72c3('0x12')](_0x1852ad[_0x72c3('0x13')])){_0x5225d3[_0x72c3('0x14')][_0x72c3('0x15')]({'where':{'id':_0x1852ad[_0x72c3('0x16')]}})[_0x72c3('0x17')](function(_0x7188e){if(_0x7188e){_0x7188e[_0x72c3('0x18')]({'lastMsgAt':_0x1852ad[_0x72c3('0x19')],'lastMsgDirection':_0x1852ad[_0x72c3('0xf')][_0x72c3('0x10')]()});}})[_0x72c3('0x1a')](function(_0x3c34cd){console[_0x72c3('0x1b')](_0x3c34cd);});}_0x38b84f();}},'charset':_0x72c3('0x1c'),'collate':_0x72c3('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index dbaacab..7262497 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 _0x238f=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatMessage','body','options','raw','CreateChatMessage','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x238f,0xad));var _0xf238=function(_0x405b82,_0x340642){_0x405b82=_0x405b82-0x0;var _0x5a8c8f=_0x238f[_0x405b82];return _0x5a8c8f;};'use strict';var _=require('lodash');var util=require(_0xf238('0x0'));var moment=require(_0xf238('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf238('0x2'));var db=require(_0xf238('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf238('0x4'))(_0xf238('0x5'));var config=require(_0xf238('0x6'));var jayson=require(_0xf238('0x7'));var client=jayson[_0xf238('0x8')][_0xf238('0x9')]({'port':0x232a});config[_0xf238('0xa')]=_[_0xf238('0xb')](config[_0xf238('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf238('0xc'))(new Redis(config[_0xf238('0xa')]));require('./chatMessage.socket')[_0xf238('0xd')](socket);function respondWithRpcPromise(_0x57b078,_0x1ff7c8,_0x1db8a9){return new BPromise(function(_0x33a1b6,_0x4e1c21){return client[_0xf238('0xe')](_0x57b078,_0x1db8a9)[_0xf238('0xf')](function(_0x21092d){logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,'request\x20sent');logger[_0xf238('0x12')](_0xf238('0x13'),_0x1ff7c8,'request\x20sent',JSON[_0xf238('0x14')](_0x21092d));if(_0x21092d[_0xf238('0x15')]){if(_0x21092d[_0xf238('0x15')][_0xf238('0x16')]===0x1f4){logger['error'](_0xf238('0x11'),_0x1ff7c8,_0x21092d[_0xf238('0x15')]['message']);return _0x4e1c21(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1ff7c8,_0x21092d['error'][_0xf238('0x17')]);return _0x33a1b6(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}else{logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,_0xf238('0x18'));_0x33a1b6(_0x21092d[_0xf238('0x19')][_0xf238('0x17')]);}})[_0xf238('0x1a')](function(_0x5413ed){logger[_0xf238('0x15')](_0xf238('0x11'),_0x1ff7c8,_0x5413ed);_0x4e1c21(_0x5413ed);});});}exports['CreateChatMessage']=function(_0x1020e8){var _0x52a48b=this;return new Promise(function(_0x27a7c9,_0x224992){return db[_0xf238('0x1b')]['create'](_0x1020e8[_0xf238('0x1c')],{'raw':_0x1020e8[_0xf238('0x1d')]?_0x1020e8[_0xf238('0x1d')][_0xf238('0x1e')]===undefined?!![]:![]:!![]})[_0xf238('0xf')](function(_0x64476e){logger[_0xf238('0x10')](_0xf238('0x1f'),_0x1020e8);logger[_0xf238('0x12')](_0xf238('0x1f'),_0x1020e8,JSON[_0xf238('0x14')](_0x64476e));_0x27a7c9(_0x64476e);})[_0xf238('0x1a')](function(_0x68a9bf){logger[_0xf238('0x15')](_0xf238('0x1f'),_0x68a9bf[_0xf238('0x17')],_0x1020e8);_0x224992(_0x52a48b[_0xf238('0x15')](0x1f4,_0x68a9bf[_0xf238('0x17')]));});});}; \ No newline at end of file +var _0xcd3b=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0xcd3b,0x145));var _0xbcd3=function(_0x2c6952,_0x26875f){_0x2c6952=_0x2c6952-0x0;var _0x1d4b70=_0xcd3b[_0x2c6952];return _0x1d4b70;};'use strict';var _=require(_0xbcd3('0x0'));var util=require(_0xbcd3('0x1'));var moment=require(_0xbcd3('0x2'));var BPromise=require(_0xbcd3('0x3'));var rs=require(_0xbcd3('0x4'));var fs=require('fs');var Redis=require(_0xbcd3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbcd3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcd3('0x7'));var client=jayson[_0xbcd3('0x8')][_0xbcd3('0x9')]({'port':0x232a});config[_0xbcd3('0xa')]=_[_0xbcd3('0xb')](config[_0xbcd3('0xa')],{'host':_0xbcd3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcd3('0xa')]));require(_0xbcd3('0xd'))[_0xbcd3('0xe')](socket);function respondWithRpcPromise(_0x332481,_0x3ff1c2,_0x4e1558){return new BPromise(function(_0x163c4e,_0x475ad9){return client[_0xbcd3('0xf')](_0x332481,_0x4e1558)[_0xbcd3('0x10')](function(_0xdd3ca0){logger[_0xbcd3('0x11')](_0xbcd3('0x12'),_0x3ff1c2,_0xbcd3('0x13'));logger[_0xbcd3('0x14')](_0xbcd3('0x15'),_0x3ff1c2,_0xbcd3('0x13'),JSON[_0xbcd3('0x16')](_0xdd3ca0));if(_0xdd3ca0[_0xbcd3('0x17')]){if(_0xdd3ca0[_0xbcd3('0x17')][_0xbcd3('0x18')]===0x1f4){logger['error'](_0xbcd3('0x12'),_0x3ff1c2,_0xdd3ca0['error'][_0xbcd3('0x19')]);return _0x475ad9(_0xdd3ca0[_0xbcd3('0x17')][_0xbcd3('0x19')]);}logger['error'](_0xbcd3('0x12'),_0x3ff1c2,_0xdd3ca0[_0xbcd3('0x17')][_0xbcd3('0x19')]);return _0x163c4e(_0xdd3ca0[_0xbcd3('0x17')][_0xbcd3('0x19')]);}else{logger[_0xbcd3('0x11')](_0xbcd3('0x12'),_0x3ff1c2,_0xbcd3('0x13'));_0x163c4e(_0xdd3ca0[_0xbcd3('0x1a')][_0xbcd3('0x19')]);}})[_0xbcd3('0x1b')](function(_0x6c690){logger[_0xbcd3('0x17')](_0xbcd3('0x12'),_0x3ff1c2,_0x6c690);_0x475ad9(_0x6c690);});});}exports['CreateChatMessage']=function(_0x5223f5){var _0x2de398=this;return new Promise(function(_0x165f2a,_0x2592fb){return db['ChatMessage'][_0xbcd3('0x1c')](_0x5223f5[_0xbcd3('0x1d')],{'raw':_0x5223f5['options']?_0x5223f5['options']['raw']===undefined?!![]:![]:!![]})[_0xbcd3('0x10')](function(_0x2b1865){logger[_0xbcd3('0x11')](_0xbcd3('0x1e'),_0x5223f5);logger[_0xbcd3('0x14')](_0xbcd3('0x1e'),_0x5223f5,JSON[_0xbcd3('0x16')](_0x2b1865));_0x165f2a(_0x2b1865);})['catch'](function(_0x50e2fd){logger[_0xbcd3('0x17')](_0xbcd3('0x1e'),_0x50e2fd[_0xbcd3('0x19')],_0x5223f5);_0x2592fb(_0x2de398[_0xbcd3('0x17')](0x1f4,_0x50e2fd[_0xbcd3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 01d0edd..2265b31 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 _0x10af=['./chatMessage.events','remove','update','emit','register','length','chatMessage:'];(function(_0x39ded7,_0x42cb9d){var _0x529869=function(_0x1f03f6){while(--_0x1f03f6){_0x39ded7['push'](_0x39ded7['shift']());}};_0x529869(++_0x42cb9d);}(_0x10af,0xfc));var _0xf10a=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x10af[_0x243b59];return _0x3e1676;};'use strict';var ChatMessageEvents=require(_0xf10a('0x0'));var events=['save',_0xf10a('0x1'),_0xf10a('0x2')];function createListener(_0x1e42f5,_0x211890){return function(_0x453e1a){_0x211890[_0xf10a('0x3')](_0x1e42f5,_0x453e1a);};}function removeListener(_0xbffc71,_0x13b338){return function(){ChatMessageEvents['removeListener'](_0xbffc71,_0x13b338);};}exports[_0xf10a('0x4')]=function(_0xf86ea1){for(var _0x5c9a4c=0x0,_0x4cd7e4=events[_0xf10a('0x5')];_0x5c9a4c<_0x4cd7e4;_0x5c9a4c++){var _0x1563fb=events[_0x5c9a4c];var _0x2ade36=createListener(_0xf10a('0x6')+_0x1563fb,_0xf86ea1);ChatMessageEvents['on'](_0x1563fb,_0x2ade36);}}; \ No newline at end of file +var _0xc474=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','emit'];(function(_0x345beb,_0x49113f){var _0x16c041=function(_0x36f154){while(--_0x36f154){_0x345beb['push'](_0x345beb['shift']());}};_0x16c041(++_0x49113f);}(_0xc474,0xfc));var _0x4c47=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc474[_0x413feb];return _0x40ee88;};'use strict';var ChatMessageEvents=require(_0x4c47('0x0'));var events=[_0x4c47('0x1'),_0x4c47('0x2'),'update'];function createListener(_0x29e5bf,_0x15bc09){return function(_0x1703cd){_0x15bc09[_0x4c47('0x3')](_0x29e5bf,_0x1703cd);};}function removeListener(_0x2b2443,_0x40b979){return function(){ChatMessageEvents[_0x4c47('0x4')](_0x2b2443,_0x40b979);};}exports[_0x4c47('0x5')]=function(_0x58db78){for(var _0x5aaf0e=0x0,_0x6aeef8=events[_0x4c47('0x6')];_0x5aaf0e<_0x6aeef8;_0x5aaf0e++){var _0x275a64=events[_0x5aaf0e];var _0x35a093=createListener(_0x4c47('0x7')+_0x275a64,_0x58db78);ChatMessageEvents['on'](_0x275a64,_0x35a093);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a14ef20..3baf51e 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 _0xe934=['put','accept','/:id/reject','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chatmessage:create','create'];(function(_0x55d8e9,_0x5eec54){var _0x287545=function(_0x56eab4){while(--_0x56eab4){_0x55d8e9['push'](_0x55d8e9['shift']());}};_0x287545(++_0x5eec54);}(_0xe934,0x1bc));var _0x4e93=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0xe934[_0x568ec8];return _0x52b2be;};'use strict';var multer=require('multer');var util=require(_0x4e93('0x0'));var path=require(_0x4e93('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e93('0x2'));var router=express[_0x4e93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e93('0x4'));var interaction=require(_0x4e93('0x5'));var config=require(_0x4e93('0x6'));var controller=require(_0x4e93('0x7'));router[_0x4e93('0x8')]('/',auth[_0x4e93('0x9')](),controller[_0x4e93('0xa')]);router[_0x4e93('0x8')](_0x4e93('0xb'),auth[_0x4e93('0x9')](),controller[_0x4e93('0xc')]);router[_0x4e93('0x8')](_0x4e93('0xd'),auth[_0x4e93('0x9')](),controller[_0x4e93('0xe')]);router['post']('/',auth[_0x4e93('0x9')](),interaction[_0x4e93('0xf')]('chat',_0x4e93('0x10')),controller[_0x4e93('0x11')]);router[_0x4e93('0x12')]('/:id',controller['update']);router[_0x4e93('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x4e93('0x13')]);router['put'](_0x4e93('0x14'),auth[_0x4e93('0x9')](),controller['reject']);router['delete'](_0x4e93('0xd'),auth[_0x4e93('0x9')](),controller[_0x4e93('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8070=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','/:id','update','accept','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3807dc,_0x3e855f){var _0x40ba4c=function(_0x58b4da){while(--_0x58b4da){_0x3807dc['push'](_0x3807dc['shift']());}};_0x40ba4c(++_0x3e855f);}(_0x8070,0x106));var _0x0807=function(_0x40521a,_0x12613d){_0x40521a=_0x40521a-0x0;var _0x285277=_0x8070[_0x40521a];return _0x285277;};'use strict';var multer=require(_0x0807('0x0'));var util=require(_0x0807('0x1'));var path=require(_0x0807('0x2'));var timeout=require(_0x0807('0x3'));var express=require(_0x0807('0x4'));var router=express['Router']();var fs_extra=require(_0x0807('0x5'));var auth=require(_0x0807('0x6'));var interaction=require(_0x0807('0x7'));var config=require(_0x0807('0x8'));var controller=require('./chatMessage.controller');router[_0x0807('0x9')]('/',auth[_0x0807('0xa')](),controller[_0x0807('0xb')]);router[_0x0807('0x9')](_0x0807('0xc'),auth['isAuthenticated'](),controller[_0x0807('0xd')]);router['get']('/:id',auth[_0x0807('0xa')](),controller[_0x0807('0xe')]);router[_0x0807('0xf')]('/',auth[_0x0807('0xa')](),interaction[_0x0807('0x10')](_0x0807('0x11'),_0x0807('0x12')),controller[_0x0807('0x13')]);router[_0x0807('0x14')](_0x0807('0x15'),controller[_0x0807('0x16')]);router[_0x0807('0x14')]('/:id/accept',auth[_0x0807('0xa')](),controller[_0x0807('0x17')]);router[_0x0807('0x14')]('/:id/reject',auth[_0x0807('0xa')](),controller[_0x0807('0x18')]);router[_0x0807('0x19')](_0x0807('0x15'),auth[_0x0807('0xa')](),controller[_0x0807('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 0e195db..9bd215b 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(_0x4a0ef2,_0x19d6c6){var _0x1e9023=function(_0x2de05d){while(--_0x2de05d){_0x4a0ef2['push'](_0x4a0ef2['shift']());}};_0x1e9023(++_0x19d6c6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c6527,_0x34c61e){_0x5c6527=_0x5c6527-0x0;var _0x2c7d4e=_0x5f2f[_0x5c6527];return _0x2c7d4e;};'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(_0x52e91c,_0x2c0f4a){var _0x2e227d=function(_0xf6c0){while(--_0xf6c0){_0x52e91c['push'](_0x52e91c['shift']());}};_0x2e227d(++_0x2c0f4a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c3467,_0xb806da){_0x1c3467=_0x1c3467-0x0;var _0x4cae17=_0x5f2f[_0x1c3467];return _0x4cae17;};'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 981da3a..4715428 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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x18afda,_0x294660){_0x18afda=_0x18afda-0x0;var _0x48a103=_0x7a54[_0x18afda];return _0x48a103;};'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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x1657b1,_0x3c93e2){_0x1657b1=_0x1657b1-0x0;var _0x1c575b=_0x7a54[_0x1657b1];return _0x1c575b;};'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 5314c3f..db93a1b 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 _0x4684=['exports','events','../../mysqldb','save','update','emit','hasOwnProperty','hook'];(function(_0x55380a,_0x536668){var _0x333037=function(_0x1ab290){while(--_0x1ab290){_0x55380a['push'](_0x55380a['shift']());}};_0x333037(++_0x536668);}(_0x4684,0xb9));var _0x4468=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0x4684[_0x431ae1];return _0x27fcbd;};'use strict';var EventEmitter=require(_0x4468('0x0'));var ChatOfflineMessage=require(_0x4468('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4468('0x2'),'afterUpdate':_0x4468('0x3'),'afterDestroy':'remove'};function emitEvent(_0x578d72){return function(_0x44d366,_0x2cb512,_0x8aec49){ChatOfflineMessageEvents[_0x4468('0x4')](_0x578d72+':'+_0x44d366['id'],_0x44d366);ChatOfflineMessageEvents[_0x4468('0x4')](_0x578d72,_0x44d366);_0x8aec49(null);};}for(var e in events){if(events[_0x4468('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x4468('0x6')](e,emitEvent(event));}}module[_0x4468('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x29b1=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x29b1,0x13b));var _0x129b=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x29b1[_0xe66cf2];return _0x2d84e7;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x129b('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x129b('0x1')](0x0);var events={'afterCreate':_0x129b('0x2'),'afterUpdate':_0x129b('0x3'),'afterDestroy':_0x129b('0x4')};function emitEvent(_0x2a052a){return function(_0x404e5a,_0xde8313,_0x34c50b){ChatOfflineMessageEvents[_0x129b('0x5')](_0x2a052a+':'+_0x404e5a['id'],_0x404e5a);ChatOfflineMessageEvents[_0x129b('0x5')](_0x2a052a,_0x404e5a);_0x34c50b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x129b('0x6')](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 6873257..3610444 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 _0x0a0c=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0a0c,0x16c));var _0xc0a0=function(_0x58c860,_0xf53229){_0x58c860=_0x58c860-0x0;var _0x1f5e64=_0x0a0c[_0x58c860];return _0x1f5e64;};'use strict';var attributes=require(_0xc0a0('0x0'));module[_0xc0a0('0x1')]=function(_0x1a0597){return _0x1a0597[_0xc0a0('0x2')](_0xc0a0('0x3'),attributes,{'tableName':_0xc0a0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfa37=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x53a879,_0x5d1d7c){var _0x3f1644=function(_0x6ffbd0){while(--_0x6ffbd0){_0x53a879['push'](_0x53a879['shift']());}};_0x3f1644(++_0x5d1d7c);}(_0xfa37,0x6d));var _0x7fa3=function(_0x24ae66,_0x27c8a3){_0x24ae66=_0x24ae66-0x0;var _0x2f346c=_0xfa37[_0x24ae66];return _0x2f346c;};'use strict';var attributes=require(_0x7fa3('0x0'));module[_0x7fa3('0x1')]=function(_0x3c606a){return _0x3c606a[_0x7fa3('0x2')](_0x7fa3('0x3'),attributes,{'tableName':_0x7fa3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7fa3('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ef708b9..1bf202e 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 _0xe68b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x131488,_0x5b106e){var _0x519196=function(_0x4c9d22){while(--_0x4c9d22){_0x131488['push'](_0x131488['shift']());}};_0x519196(++_0x5b106e);}(_0xe68b,0x6d));var _0xbe68=function(_0x2e0efe,_0xde101b){_0x2e0efe=_0x2e0efe-0x0;var _0x119d9a=_0xe68b[_0x2e0efe];return _0x119d9a;};'use strict';var _=require(_0xbe68('0x0'));var util=require(_0xbe68('0x1'));var moment=require(_0xbe68('0x2'));var BPromise=require(_0xbe68('0x3'));var rs=require(_0xbe68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe68('0x6'))(_0xbe68('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe68('0x8'));var client=jayson[_0xbe68('0x9')][_0xbe68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x486b73,_0x40860b,_0x242c8f){return new BPromise(function(_0x4a6a09,_0x2c8100){return client[_0xbe68('0xb')](_0x486b73,_0x242c8f)[_0xbe68('0xc')](function(_0x4e903f){logger[_0xbe68('0xd')](_0xbe68('0xe'),_0x40860b,'request\x20sent');logger[_0xbe68('0xf')](_0xbe68('0x10'),_0x40860b,'request\x20sent',JSON['stringify'](_0x4e903f));if(_0x4e903f[_0xbe68('0x11')]){if(_0x4e903f[_0xbe68('0x11')][_0xbe68('0x12')]===0x1f4){logger[_0xbe68('0x11')](_0xbe68('0xe'),_0x40860b,_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);return _0x2c8100(_0x4e903f[_0xbe68('0x11')]['message']);}logger[_0xbe68('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x40860b,_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);return _0x4a6a09(_0x4e903f[_0xbe68('0x11')][_0xbe68('0x13')]);}else{logger[_0xbe68('0xd')](_0xbe68('0xe'),_0x40860b,'request\x20sent');_0x4a6a09(_0x4e903f[_0xbe68('0x14')]['message']);}})[_0xbe68('0x15')](function(_0x2792e1){logger[_0xbe68('0x11')](_0xbe68('0xe'),_0x40860b,_0x2792e1);_0x2c8100(_0x2792e1);});});} \ No newline at end of file +var _0xef40=['rpc','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3720cd,_0x1e8ed9){var _0x146daa=function(_0x120295){while(--_0x120295){_0x3720cd['push'](_0x3720cd['shift']());}};_0x146daa(++_0x1e8ed9);}(_0xef40,0x18f));var _0x0ef4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xef40[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x0ef4('0x0'));var util=require(_0x0ef4('0x1'));var moment=require(_0x0ef4('0x2'));var BPromise=require(_0x0ef4('0x3'));var rs=require(_0x0ef4('0x4'));var fs=require('fs');var Redis=require(_0x0ef4('0x5'));var db=require(_0x0ef4('0x6'))['db'];var utils=require(_0x0ef4('0x7'));var logger=require(_0x0ef4('0x8'))(_0x0ef4('0x9'));var config=require('../../config/environment');var jayson=require(_0x0ef4('0xa'));var client=jayson[_0x0ef4('0xb')][_0x0ef4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb36e30,_0x4591c9,_0x3b254f){return new BPromise(function(_0x5296a1,_0x26dc22){return client['request'](_0xb36e30,_0x3b254f)[_0x0ef4('0xd')](function(_0x53bd07){logger[_0x0ef4('0xe')](_0x0ef4('0xf'),_0x4591c9,_0x0ef4('0x10'));logger[_0x0ef4('0x11')](_0x0ef4('0x12'),_0x4591c9,'request\x20sent',JSON[_0x0ef4('0x13')](_0x53bd07));if(_0x53bd07[_0x0ef4('0x14')]){if(_0x53bd07['error'][_0x0ef4('0x15')]===0x1f4){logger['error'](_0x0ef4('0xf'),_0x4591c9,_0x53bd07[_0x0ef4('0x14')][_0x0ef4('0x16')]);return _0x26dc22(_0x53bd07[_0x0ef4('0x14')][_0x0ef4('0x16')]);}logger[_0x0ef4('0x14')](_0x0ef4('0xf'),_0x4591c9,_0x53bd07[_0x0ef4('0x14')][_0x0ef4('0x16')]);return _0x5296a1(_0x53bd07[_0x0ef4('0x14')][_0x0ef4('0x16')]);}else{logger[_0x0ef4('0xe')](_0x0ef4('0xf'),_0x4591c9,_0x0ef4('0x10'));_0x5296a1(_0x53bd07[_0x0ef4('0x17')][_0x0ef4('0x16')]);}})['catch'](function(_0x1605f0){logger[_0x0ef4('0x14')](_0x0ef4('0xf'),_0x4591c9,_0x1605f0);_0x26dc22(_0x1605f0);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1469e37..ab0774b 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 _0x3934=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id','isAuthenticated','post','create','update','delete','exports','multer'];(function(_0x5d3217,_0x137c0c){var _0x5ee3f8=function(_0x13a553){while(--_0x13a553){_0x5d3217['push'](_0x5d3217['shift']());}};_0x5ee3f8(++_0x137c0c);}(_0x3934,0x1af));var _0x4393=function(_0x263169,_0x5382fe){_0x263169=_0x263169-0x0;var _0x477ebe=_0x3934[_0x263169];return _0x477ebe;};'use strict';var multer=require(_0x4393('0x0'));var util=require(_0x4393('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4393('0x2'));var router=express[_0x4393('0x3')]();var fs_extra=require(_0x4393('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4393('0x5'));var config=require(_0x4393('0x6'));var controller=require(_0x4393('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4393('0x8')](_0x4393('0x9'),auth['isAuthenticated'](),controller[_0x4393('0xa')]);router[_0x4393('0x8')](_0x4393('0xb'),auth[_0x4393('0xc')](),controller['show']);router[_0x4393('0xd')]('/',auth[_0x4393('0xc')](),controller[_0x4393('0xe')]);router['put'](_0x4393('0xb'),auth[_0x4393('0xc')](),controller[_0x4393('0xf')]);router[_0x4393('0x10')]('/:id',auth[_0x4393('0xc')](),controller['destroy']);module[_0x4393('0x11')]=router; \ No newline at end of file +var _0xede0=['delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','describe','/:id','post','create','put','update'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xede0,0xe6));var _0x0ede=function(_0x561934,_0xbae1ef){_0x561934=_0x561934-0x0;var _0x534140=_0xede0[_0x561934];return _0x534140;};'use strict';var multer=require(_0x0ede('0x0'));var util=require(_0x0ede('0x1'));var path=require('path');var timeout=require(_0x0ede('0x2'));var express=require(_0x0ede('0x3'));var router=express['Router']();var fs_extra=require(_0x0ede('0x4'));var auth=require(_0x0ede('0x5'));var interaction=require(_0x0ede('0x6'));var config=require(_0x0ede('0x7'));var controller=require(_0x0ede('0x8'));router['get']('/',auth[_0x0ede('0x9')](),controller['index']);router[_0x0ede('0xa')]('/describe',auth[_0x0ede('0x9')](),controller[_0x0ede('0xb')]);router[_0x0ede('0xa')](_0x0ede('0xc'),auth[_0x0ede('0x9')](),controller['show']);router[_0x0ede('0xd')]('/',auth[_0x0ede('0x9')](),controller[_0x0ede('0xe')]);router[_0x0ede('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0ede('0x10')]);router[_0x0ede('0x11')](_0x0ede('0xc'),auth[_0x0ede('0x9')](),controller[_0x0ede('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c8336e5..80ca1c5 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 _0x2375=['timeout','INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x2375,0xc2));var _0x5237=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x2375[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x5237('0x0'));module['exports']={'name':{'type':Sequelize[_0x5237('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5237('0x2')](_0x5237('0x3'),_0x5237('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5237('0x1')]},'timeout':{'type':Sequelize[_0x5237('0x5')]}}; \ No newline at end of file +var _0x90d5=['sequelize','STRING','mouseOver','INTEGER'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x90d5,0x198));var _0x590d=function(_0xa9d781,_0x17403c){_0xa9d781=_0xa9d781-0x0;var _0x1ccdaf=_0x90d5[_0xa9d781];return _0x1ccdaf;};'use strict';var Sequelize=require(_0x590d('0x0'));module['exports']={'name':{'type':Sequelize[_0x590d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x590d('0x2'),'timeout'),'defaultValue':_0x590d('0x2')},'selector':{'type':Sequelize[_0x590d('0x1')]},'timeout':{'type':Sequelize[_0x590d('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 39e7b4d..2589e1d 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 _0x0d64=['options','ChatProactiveAction','catch','create','body','update','find','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','error','stack','send','show','keys','query','intersection','model','attributes','fields','length','merge'];(function(_0x5126a7,_0x29026a){var _0x5bce5a=function(_0x41892c){while(--_0x41892c){_0x5126a7['push'](_0x5126a7['shift']());}};_0x5bce5a(++_0x29026a);}(_0x0d64,0x77));var _0x40d6=function(_0x2a9c27,_0x43433e){_0x2a9c27=_0x2a9c27-0x0;var _0x3f6be1=_0x0d64[_0x2a9c27];return _0x3f6be1;};'use strict';var emlformat=require(_0x40d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40d6('0x1'));var jsonpatch=require(_0x40d6('0x2'));var rp=require('request-promise');var moment=require(_0x40d6('0x3'));var BPromise=require(_0x40d6('0x4'));var Mustache=require('mustache');var util=require(_0x40d6('0x5'));var path=require(_0x40d6('0x6'));var sox=require(_0x40d6('0x7'));var csv=require(_0x40d6('0x8'));var ejs=require(_0x40d6('0x9'));var fs=require('fs');var fs_extra=require(_0x40d6('0xa'));var _=require(_0x40d6('0xb'));var squel=require(_0x40d6('0xc'));var crypto=require(_0x40d6('0xd'));var jsforce=require(_0x40d6('0xe'));var deskjs=require(_0x40d6('0xf'));var toCsv=require(_0x40d6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x40d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40d6('0x11'));var as=require(_0x40d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d6('0x13'))('api');var utils=require(_0x40d6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4067,_0x233ab5){_0x233ab5=_0x233ab5||0xcc;return function(_0x3dd4af){if(_0x3dd4af){return _0x1a4067[_0x40d6('0x15')](_0x233ab5);}return _0x1a4067['status'](_0x233ab5)[_0x40d6('0x16')]();};}function respondWithResult(_0x42537a,_0x44ae12){_0x44ae12=_0x44ae12||0xc8;return function(_0x18ccf7){if(_0x18ccf7){return _0x42537a['status'](_0x44ae12)[_0x40d6('0x17')](_0x18ccf7);}};}function respondWithFilteredResult(_0x29392b,_0x3eeab2){return function(_0x3db4c3){if(_0x3db4c3){var _0x300a26=typeof _0x3eeab2[_0x40d6('0x18')]===_0x40d6('0x19')&&typeof _0x3eeab2[_0x40d6('0x1a')]===_0x40d6('0x19');var _0x5866e9=_0x3db4c3[_0x40d6('0x1b')];var _0xbe088d=_0x300a26?0x0:_0x3eeab2['offset'];var _0x1118ee=_0x300a26?_0x3db4c3[_0x40d6('0x1b')]:_0x3eeab2[_0x40d6('0x18')]+_0x3eeab2[_0x40d6('0x1a')];var _0x41a0f3;if(_0x1118ee>=_0x5866e9){_0x1118ee=_0x5866e9;_0x41a0f3=0xc8;}else{_0x41a0f3=0xce;}_0x29392b[_0x40d6('0x1c')](_0x41a0f3);return _0x29392b['set'](_0x40d6('0x1d'),_0xbe088d+'-'+_0x1118ee+'/'+_0x5866e9)['json'](_0x3db4c3);}return null;};}function patchUpdates(_0x38ae04){return function(_0x39e53d){try{jsonpatch[_0x40d6('0x1e')](_0x39e53d,_0x38ae04,!![]);}catch(_0x2f8d02){return BPromise[_0x40d6('0x1f')](_0x2f8d02);}return _0x39e53d[_0x40d6('0x20')]();};}function saveUpdates(_0x48312b,_0x1f29b8){return function(_0x3dfbab){if(_0x3dfbab){return _0x3dfbab['update'](_0x48312b)['then'](function(_0x4fa4f2){return _0x4fa4f2;});}return null;};}function removeEntity(_0x45125d,_0x302def){return function(_0x3357ba){if(_0x3357ba){return _0x3357ba['destroy']()[_0x40d6('0x21')](function(){_0x45125d[_0x40d6('0x1c')](0xcc)[_0x40d6('0x16')]();});}};}function handleEntityNotFound(_0x2b7da1,_0x408265){return function(_0x5020eb){if(!_0x5020eb){_0x2b7da1[_0x40d6('0x15')](0x194);}return _0x5020eb;};}function handleError(_0x2ddc43,_0x298abd){_0x298abd=_0x298abd||0x1f4;return function(_0x127d40){logger[_0x40d6('0x22')](_0x127d40[_0x40d6('0x23')]);if(_0x127d40['name']){delete _0x127d40['name'];}_0x2ddc43[_0x40d6('0x1c')](_0x298abd)[_0x40d6('0x24')](_0x127d40);};}exports[_0x40d6('0x25')]=function(_0x33fcdd,_0x21fec7){var _0x8ff273={'raw':!![],'where':{'id':_0x33fcdd['params']['id']}},_0x11566a={};_0x11566a['model']=_[_0x40d6('0x26')](db['ChatProactiveAction']['rawAttributes']);_0x11566a[_0x40d6('0x27')]=_[_0x40d6('0x26')](_0x33fcdd['query']);_0x11566a['filters']=_[_0x40d6('0x28')](_0x11566a[_0x40d6('0x29')],_0x11566a[_0x40d6('0x27')]);_0x8ff273[_0x40d6('0x2a')]=_['intersection'](_0x11566a[_0x40d6('0x29')],qs[_0x40d6('0x2b')](_0x33fcdd[_0x40d6('0x27')][_0x40d6('0x2b')]));_0x8ff273['attributes']=_0x8ff273[_0x40d6('0x2a')][_0x40d6('0x2c')]?_0x8ff273[_0x40d6('0x2a')]:_0x11566a[_0x40d6('0x29')];if(_0x33fcdd[_0x40d6('0x27')]['includeAll']){_0x8ff273['include']=[{'all':!![]}];}_0x8ff273=_[_0x40d6('0x2d')]({},_0x8ff273,_0x33fcdd[_0x40d6('0x2e')]);return db[_0x40d6('0x2f')]['find'](_0x8ff273)[_0x40d6('0x21')](handleEntityNotFound(_0x21fec7,null))[_0x40d6('0x21')](respondWithResult(_0x21fec7,null))[_0x40d6('0x30')](handleError(_0x21fec7,null));};exports[_0x40d6('0x31')]=function(_0x433e70,_0x3966de){return db['ChatProactiveAction'][_0x40d6('0x31')](_0x433e70[_0x40d6('0x32')],{})[_0x40d6('0x21')](respondWithResult(_0x3966de,0xc9))[_0x40d6('0x30')](handleError(_0x3966de,null));};exports[_0x40d6('0x33')]=function(_0x16d0db,_0x534494){if(_0x16d0db[_0x40d6('0x32')]['id']){delete _0x16d0db[_0x40d6('0x32')]['id'];}return db[_0x40d6('0x2f')][_0x40d6('0x34')]({'where':{'id':_0x16d0db[_0x40d6('0x35')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x534494,null))[_0x40d6('0x21')](saveUpdates(_0x16d0db[_0x40d6('0x32')],null))[_0x40d6('0x21')](respondWithResult(_0x534494,null))[_0x40d6('0x30')](handleError(_0x534494,null));};exports[_0x40d6('0x36')]=function(_0x3afa26,_0x20a578){return db[_0x40d6('0x2f')]['find']({'where':{'id':_0x3afa26['params']['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x20a578,null))[_0x40d6('0x21')](removeEntity(_0x20a578,null))['catch'](handleError(_0x20a578,null));}; \ No newline at end of file +var _0x48e3=['bluebird','mustache','util','path','to-csv','lodash','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','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','save','then','destroy','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','update','body','params','eml-format','rimraf','fast-json-patch'];(function(_0x4ea822,_0x406816){var _0x951843=function(_0x231207){while(--_0x231207){_0x4ea822['push'](_0x4ea822['shift']());}};_0x951843(++_0x406816);}(_0x48e3,0xe9));var _0x348e=function(_0x9d8112,_0x4ae0c5){_0x9d8112=_0x9d8112-0x0;var _0x19269c=_0x48e3[_0x9d8112];return _0x19269c;};'use strict';var emlformat=require(_0x348e('0x0'));var rimraf=require(_0x348e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x348e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x348e('0x3'));var Mustache=require(_0x348e('0x4'));var util=require(_0x348e('0x5'));var path=require(_0x348e('0x6'));var sox=require('sox');var csv=require(_0x348e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x348e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x348e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x348e('0x7'));var querystring=require(_0x348e('0xa'));var Papa=require(_0x348e('0xb'));var Redis=require(_0x348e('0xc'));var authService=require(_0x348e('0xd'));var qs=require(_0x348e('0xe'));var as=require(_0x348e('0xf'));var hardwareService=require(_0x348e('0x10'));var logger=require(_0x348e('0x11'))(_0x348e('0x12'));var utils=require(_0x348e('0x13'));var config=require(_0x348e('0x14'));var licenseUtil=require(_0x348e('0x15'));var db=require(_0x348e('0x16'))['db'];function respondWithStatusCode(_0x57c341,_0x2ba049){_0x2ba049=_0x2ba049||0xcc;return function(_0x271fe7){if(_0x271fe7){return _0x57c341[_0x348e('0x17')](_0x2ba049);}return _0x57c341['status'](_0x2ba049)[_0x348e('0x18')]();};}function respondWithResult(_0x3031ee,_0x23865f){_0x23865f=_0x23865f||0xc8;return function(_0x246a85){if(_0x246a85){return _0x3031ee[_0x348e('0x19')](_0x23865f)['json'](_0x246a85);}};}function respondWithFilteredResult(_0x5169aa,_0x718b84){return function(_0x9cf0b8){if(_0x9cf0b8){var _0x1f9e74=typeof _0x718b84[_0x348e('0x1a')]==='undefined'&&typeof _0x718b84[_0x348e('0x1b')]==='undefined';var _0x217857=_0x9cf0b8[_0x348e('0x1c')];var _0x409ea8=_0x1f9e74?0x0:_0x718b84['offset'];var _0x2326bc=_0x1f9e74?_0x9cf0b8['count']:_0x718b84['offset']+_0x718b84['limit'];var _0x5eca68;if(_0x2326bc>=_0x217857){_0x2326bc=_0x217857;_0x5eca68=0xc8;}else{_0x5eca68=0xce;}_0x5169aa[_0x348e('0x19')](_0x5eca68);return _0x5169aa[_0x348e('0x1d')](_0x348e('0x1e'),_0x409ea8+'-'+_0x2326bc+'/'+_0x217857)[_0x348e('0x1f')](_0x9cf0b8);}return null;};}function patchUpdates(_0x3a5907){return function(_0x3d1ae3){try{jsonpatch[_0x348e('0x20')](_0x3d1ae3,_0x3a5907,!![]);}catch(_0x5c631d){return BPromise['reject'](_0x5c631d);}return _0x3d1ae3[_0x348e('0x21')]();};}function saveUpdates(_0x33600d,_0x2225d0){return function(_0xa0917f){if(_0xa0917f){return _0xa0917f['update'](_0x33600d)[_0x348e('0x22')](function(_0x45c4a9){return _0x45c4a9;});}return null;};}function removeEntity(_0x1c0caa,_0x4a5a84){return function(_0x116583){if(_0x116583){return _0x116583[_0x348e('0x23')]()[_0x348e('0x22')](function(){_0x1c0caa['status'](0xcc)[_0x348e('0x18')]();});}};}function handleEntityNotFound(_0x845e7f,_0x2519f3){return function(_0x49ba87){if(!_0x49ba87){_0x845e7f[_0x348e('0x17')](0x194);}return _0x49ba87;};}function handleError(_0x6f72c4,_0x1a987a){_0x1a987a=_0x1a987a||0x1f4;return function(_0x23bed7){logger['error'](_0x23bed7[_0x348e('0x24')]);if(_0x23bed7[_0x348e('0x25')]){delete _0x23bed7[_0x348e('0x25')];}_0x6f72c4[_0x348e('0x19')](_0x1a987a)[_0x348e('0x26')](_0x23bed7);};}exports[_0x348e('0x27')]=function(_0xcf5f40,_0x487784){var _0x37d892={'raw':!![],'where':{'id':_0xcf5f40['params']['id']}},_0xcf7f99={};_0xcf7f99[_0x348e('0x28')]=_[_0x348e('0x29')](db['ChatProactiveAction'][_0x348e('0x2a')]);_0xcf7f99[_0x348e('0x2b')]=_['keys'](_0xcf5f40[_0x348e('0x2b')]);_0xcf7f99[_0x348e('0x2c')]=_[_0x348e('0x2d')](_0xcf7f99[_0x348e('0x28')],_0xcf7f99[_0x348e('0x2b')]);_0x37d892[_0x348e('0x2e')]=_[_0x348e('0x2d')](_0xcf7f99['model'],qs['fields'](_0xcf5f40['query'][_0x348e('0x2f')]));_0x37d892[_0x348e('0x2e')]=_0x37d892[_0x348e('0x2e')]['length']?_0x37d892[_0x348e('0x2e')]:_0xcf7f99['model'];if(_0xcf5f40['query'][_0x348e('0x30')]){_0x37d892[_0x348e('0x31')]=[{'all':!![]}];}_0x37d892=_[_0x348e('0x32')]({},_0x37d892,_0xcf5f40[_0x348e('0x33')]);return db['ChatProactiveAction'][_0x348e('0x34')](_0x37d892)[_0x348e('0x22')](handleEntityNotFound(_0x487784,null))[_0x348e('0x22')](respondWithResult(_0x487784,null))[_0x348e('0x35')](handleError(_0x487784,null));};exports[_0x348e('0x36')]=function(_0x3a3b2c,_0x3e769c){return db[_0x348e('0x37')]['create'](_0x3a3b2c['body'],{})[_0x348e('0x22')](respondWithResult(_0x3e769c,0xc9))[_0x348e('0x35')](handleError(_0x3e769c,null));};exports[_0x348e('0x38')]=function(_0x900473,_0x405e6e){if(_0x900473[_0x348e('0x39')]['id']){delete _0x900473['body']['id'];}return db[_0x348e('0x37')][_0x348e('0x34')]({'where':{'id':_0x900473[_0x348e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x405e6e,null))[_0x348e('0x22')](saveUpdates(_0x900473[_0x348e('0x39')],null))[_0x348e('0x22')](respondWithResult(_0x405e6e,null))[_0x348e('0x35')](handleError(_0x405e6e,null));};exports[_0x348e('0x23')]=function(_0x326b50,_0x40d487){return db['ChatProactiveAction'][_0x348e('0x34')]({'where':{'id':_0x326b50[_0x348e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x40d487,null))[_0x348e('0x22')](removeEntity(_0x40d487,null))[_0x348e('0x35')](handleError(_0x40d487,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 961c001..fc76251 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 _0x5eb9=['path','rimraf','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5eb9,0x1d9));var _0x95eb=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x5eb9[_0x32a884];return _0x242f9b;};'use strict';var _=require(_0x95eb('0x0'));var util=require(_0x95eb('0x1'));var logger=require(_0x95eb('0x2'))(_0x95eb('0x3'));var moment=require(_0x95eb('0x4'));var BPromise=require(_0x95eb('0x5'));var rp=require(_0x95eb('0x6'));var fs=require('fs');var path=require(_0x95eb('0x7'));var rimraf=require(_0x95eb('0x8'));var config=require('../../config/environment');var attributes=require(_0x95eb('0x9'));module['exports']=function(_0xe94d0e,_0x35f9fd){return _0xe94d0e['define'](_0x95eb('0xa'),attributes,{'tableName':_0x95eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fd5=['bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','api'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8fd5,0x19c));var _0x58fd=function(_0x1ca18a,_0x3235bc){_0x1ca18a=_0x1ca18a-0x0;var _0x8b22c6=_0x8fd5[_0x1ca18a];return _0x8b22c6;};'use strict';var _=require(_0x58fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x58fd('0x1'));var moment=require('moment');var BPromise=require(_0x58fd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58fd('0x3'));var rimraf=require(_0x58fd('0x4'));var config=require(_0x58fd('0x5'));var attributes=require(_0x58fd('0x6'));module['exports']=function(_0x1752eb,_0x199543){return _0x1752eb['define'](_0x58fd('0x7'),attributes,{'tableName':_0x58fd('0x8'),'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 a7d8959..9642fe9 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 _0x10a9=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','lodash','util','moment','bluebird','randomstring'];(function(_0xff4297,_0x24cd88){var _0x19b089=function(_0x16a080){while(--_0x16a080){_0xff4297['push'](_0xff4297['shift']());}};_0x19b089(++_0x24cd88);}(_0x10a9,0x18a));var _0x910a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x10a9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var moment=require(_0x910a('0x2'));var BPromise=require(_0x910a('0x3'));var rs=require(_0x910a('0x4'));var fs=require('fs');var Redis=require(_0x910a('0x5'));var db=require(_0x910a('0x6'))['db'];var utils=require(_0x910a('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x910a('0x8'));var client=jayson[_0x910a('0x9')][_0x910a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48af21,_0x4f35d7,_0x3297c9){return new BPromise(function(_0x26885d,_0x4fdd33){return client[_0x910a('0xb')](_0x48af21,_0x3297c9)[_0x910a('0xc')](function(_0x4d4f05){logger['info'](_0x910a('0xd'),_0x4f35d7,'request\x20sent');logger['debug'](_0x910a('0xe'),_0x4f35d7,'request\x20sent',JSON[_0x910a('0xf')](_0x4d4f05));if(_0x4d4f05[_0x910a('0x10')]){if(_0x4d4f05[_0x910a('0x10')][_0x910a('0x11')]===0x1f4){logger[_0x910a('0x10')](_0x910a('0xd'),_0x4f35d7,_0x4d4f05[_0x910a('0x10')]['message']);return _0x4fdd33(_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);}logger['error'](_0x910a('0xd'),_0x4f35d7,_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);return _0x26885d(_0x4d4f05[_0x910a('0x10')][_0x910a('0x12')]);}else{logger[_0x910a('0x13')](_0x910a('0xd'),_0x4f35d7,_0x910a('0x14'));_0x26885d(_0x4d4f05['result'][_0x910a('0x12')]);}})['catch'](function(_0x28e136){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f35d7,_0x28e136);_0x4fdd33(_0x28e136);});});} \ No newline at end of file +var _0xb8f9=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch'];(function(_0x49c957,_0x3509d8){var _0x5b1d38=function(_0x219976){while(--_0x219976){_0x49c957['push'](_0x49c957['shift']());}};_0x5b1d38(++_0x3509d8);}(_0xb8f9,0xd8));var _0x9b8f=function(_0x420282,_0x1f941f){_0x420282=_0x420282-0x0;var _0x535480=_0xb8f9[_0x420282];return _0x535480;};'use strict';var _=require(_0x9b8f('0x0'));var util=require('util');var moment=require(_0x9b8f('0x1'));var BPromise=require(_0x9b8f('0x2'));var rs=require(_0x9b8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b8f('0x4'))['db'];var utils=require(_0x9b8f('0x5'));var logger=require(_0x9b8f('0x6'))(_0x9b8f('0x7'));var config=require(_0x9b8f('0x8'));var jayson=require(_0x9b8f('0x9'));var client=jayson[_0x9b8f('0xa')][_0x9b8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x519a87,_0x57dd62,_0x603573){return new BPromise(function(_0x1a6510,_0x9a2f61){return client[_0x9b8f('0xc')](_0x519a87,_0x603573)[_0x9b8f('0xd')](function(_0xd0a36e){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x57dd62,'request\x20sent');logger[_0x9b8f('0xe')](_0x9b8f('0xf'),_0x57dd62,_0x9b8f('0x10'),JSON[_0x9b8f('0x11')](_0xd0a36e));if(_0xd0a36e[_0x9b8f('0x12')]){if(_0xd0a36e[_0x9b8f('0x12')][_0x9b8f('0x13')]===0x1f4){logger[_0x9b8f('0x12')](_0x9b8f('0x14'),_0x57dd62,_0xd0a36e['error']['message']);return _0x9a2f61(_0xd0a36e[_0x9b8f('0x12')][_0x9b8f('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x57dd62,_0xd0a36e['error']['message']);return _0x1a6510(_0xd0a36e[_0x9b8f('0x12')][_0x9b8f('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x57dd62,_0x9b8f('0x10'));_0x1a6510(_0xd0a36e[_0x9b8f('0x16')][_0x9b8f('0x15')]);}})[_0x9b8f('0x17')](function(_0x4f736b){logger[_0x9b8f('0x12')](_0x9b8f('0x14'),_0x57dd62,_0x4f736b);_0x9a2f61(_0x4f736b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f230426..a91d1c8 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 _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x64b57d,_0x2a79d8){var _0x2f55bd=function(_0x2923){while(--_0x2923){_0x64b57d['push'](_0x64b57d['shift']());}};_0x2f55bd(++_0x2a79d8);}(_0xae24,0x182));var _0x4ae2=function(_0x48d4b2,_0x4d7742){_0x48d4b2=_0x48d4b2-0x0;var _0x25c348=_0xae24[_0x48d4b2];return _0x25c348;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index e79b4aa..f26e2a4 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 _0x5fe6=['STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x6125d8,_0x2db9b4){var _0x1274a3=function(_0x48d1a1){while(--_0x48d1a1){_0x6125d8['push'](_0x6125d8['shift']());}};_0x1274a3(++_0x2db9b4);}(_0x5fe6,0xd7));var _0x65fe=function(_0x17ab75,_0x55bb93){_0x17ab75=_0x17ab75-0x0;var _0x366116=_0x5fe6[_0x17ab75];return _0x366116;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x65fe('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x65fe('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x65fe('0x1')](_0x65fe('0x2'),_0x65fe('0x3'),_0x65fe('0x4'))}}; \ No newline at end of file +var _0x8842=['INTEGER','ENUM','rrmemory','exports','STRING'];(function(_0x24ff6b,_0x2d35e4){var _0x1d6ed0=function(_0x4e4b09){while(--_0x4e4b09){_0x24ff6b['push'](_0x24ff6b['shift']());}};_0x1d6ed0(++_0x2d35e4);}(_0x8842,0x1ed));var _0x2884=function(_0xf79d24,_0x27efe3){_0xf79d24=_0xf79d24-0x0;var _0x162f5c=_0x8842[_0xf79d24];return _0x162f5c;};'use strict';var Sequelize=require('sequelize');module[_0x2884('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2884('0x1')]},'timeout':{'type':Sequelize[_0x2884('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2884('0x3')](_0x2884('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0e4548a..b222446 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 _0x8f43=['type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','destroy','get','ChatQueues','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName'];(function(_0x49a5e0,_0x5ec0d5){var _0x3f6f10=function(_0xa2112e){while(--_0xa2112e){_0x49a5e0['push'](_0x49a5e0['shift']());}};_0x3f6f10(++_0x5ec0d5);}(_0x8f43,0x18b));var _0x38f4=function(_0x5e971e,_0x162d2d){_0x5e971e=_0x5e971e-0x0;var _0x2bddbe=_0x8f43[_0x5e971e];return _0x2bddbe;};'use strict';var emlformat=require(_0x38f4('0x0'));var rimraf=require(_0x38f4('0x1'));var zipdir=require(_0x38f4('0x2'));var jsonpatch=require(_0x38f4('0x3'));var rp=require(_0x38f4('0x4'));var moment=require(_0x38f4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38f4('0x6'));var path=require(_0x38f4('0x7'));var sox=require(_0x38f4('0x8'));var csv=require(_0x38f4('0x9'));var ejs=require(_0x38f4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38f4('0xb'));var squel=require(_0x38f4('0xc'));var crypto=require('crypto');var jsforce=require(_0x38f4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x38f4('0x9'));var querystring=require(_0x38f4('0xe'));var Papa=require(_0x38f4('0xf'));var Redis=require(_0x38f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38f4('0x11'));var as=require(_0x38f4('0x12'));var hardwareService=require(_0x38f4('0x13'));var logger=require('../../config/logger')(_0x38f4('0x14'));var utils=require(_0x38f4('0x15'));var config=require(_0x38f4('0x16'));var licenseUtil=require(_0x38f4('0x17'));var db=require(_0x38f4('0x18'))['db'];config[_0x38f4('0x19')]=_[_0x38f4('0x1a')](config[_0x38f4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x38f4('0x1b'))(new Redis(config['redis']));require(_0x38f4('0x1c'))[_0x38f4('0x1d')](socket);var jayson=require(_0x38f4('0x1e'));var client=jayson[_0x38f4('0x1f')][_0x38f4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x117979,_0x23f5c1,_0x5d1d2e,_0x39544b){return new BPromise(function(_0x476ca8,_0x39a4b4){var _0x1bdfd8=_0x39544b||client;return _0x1bdfd8[_0x38f4('0x21')](_0x117979,_0x5d1d2e)[_0x38f4('0x22')](function(_0x1f495a){logger['info'](_0x38f4('0x23'),_0x23f5c1,_0x38f4('0x24'));logger[_0x38f4('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23f5c1,'request\x20sent',JSON[_0x38f4('0x26')](_0x1f495a));if(_0x1f495a[_0x38f4('0x27')]){if(_0x1f495a[_0x38f4('0x27')][_0x38f4('0x28')]===0x1f4){logger[_0x38f4('0x27')](_0x38f4('0x23'),_0x23f5c1,_0x1f495a[_0x38f4('0x27')][_0x38f4('0x29')]);return _0x39a4b4(_0x1f495a['error'][_0x38f4('0x29')]);}logger[_0x38f4('0x27')](_0x38f4('0x23'),_0x23f5c1,_0x1f495a['error'][_0x38f4('0x29')]);return _0x476ca8(_0x1f495a[_0x38f4('0x27')][_0x38f4('0x29')]);}else{logger[_0x38f4('0x2a')](_0x38f4('0x23'),_0x23f5c1,_0x38f4('0x24'));_0x476ca8(_0x1f495a[_0x38f4('0x2b')]['message']);}})['catch'](function(_0x376010){logger[_0x38f4('0x27')]('ChatQueue,\x20%s,\x20%s',_0x23f5c1,_0x376010);_0x39a4b4(_0x376010);});});}function respondWithStatusCode(_0x4853a9,_0x5572bd){_0x5572bd=_0x5572bd||0xcc;return function(_0xd3bc5f){if(_0xd3bc5f){return _0x4853a9['sendStatus'](_0x5572bd);}return _0x4853a9['status'](_0x5572bd)['end']();};}function respondWithResult(_0x1fb63f,_0x4a88e1){_0x4a88e1=_0x4a88e1||0xc8;return function(_0x6cd127){if(_0x6cd127){return _0x1fb63f['status'](_0x4a88e1)[_0x38f4('0x2c')](_0x6cd127);}};}function respondWithFilteredResult(_0x36bb84,_0x32c106){return function(_0x326b0a){if(_0x326b0a){var _0x1022f3=typeof _0x32c106[_0x38f4('0x2d')]===_0x38f4('0x2e')&&typeof _0x32c106[_0x38f4('0x2f')]==='undefined';var _0x504664=_0x326b0a['count'];var _0x10f957=_0x1022f3?0x0:_0x32c106['offset'];var _0x47df2b=_0x1022f3?_0x326b0a[_0x38f4('0x30')]:_0x32c106[_0x38f4('0x2d')]+_0x32c106['limit'];var _0x1adc17;if(_0x47df2b>=_0x504664){_0x47df2b=_0x504664;_0x1adc17=0xc8;}else{_0x1adc17=0xce;}_0x36bb84[_0x38f4('0x31')](_0x1adc17);return _0x36bb84[_0x38f4('0x32')](_0x38f4('0x33'),_0x10f957+'-'+_0x47df2b+'/'+_0x504664)[_0x38f4('0x2c')](_0x326b0a);}return null;};}function patchUpdates(_0x2130d5){return function(_0x161b52){try{jsonpatch[_0x38f4('0x34')](_0x161b52,_0x2130d5,!![]);}catch(_0x4edf3d){return BPromise['reject'](_0x4edf3d);}return _0x161b52[_0x38f4('0x35')]();};}function saveUpdates(_0x7e3987,_0x59312b){return function(_0x421aca){if(_0x421aca){return _0x421aca[_0x38f4('0x36')](_0x7e3987)[_0x38f4('0x22')](function(_0x350c31){return _0x350c31;});}return null;};}function removeEntity(_0x425ac5,_0x7fa244){return function(_0x2fcb86){if(_0x2fcb86){return _0x2fcb86[_0x38f4('0x37')]()[_0x38f4('0x22')](function(){var _0x301901=_0x2fcb86[_0x38f4('0x38')]({'plain':!![]});var _0x193c46=_0x38f4('0x39');return db['UserProfileResource'][_0x38f4('0x37')]({'where':{'type':_0x193c46,'resourceId':_0x301901['id']}})[_0x38f4('0x22')](function(){return _0x2fcb86;});})[_0x38f4('0x22')](function(){_0x425ac5['status'](0xcc)[_0x38f4('0x3a')]();});}};}function handleEntityNotFound(_0x1b161d,_0x65ea9a){return function(_0x10d3a4){if(!_0x10d3a4){_0x1b161d['sendStatus'](0x194);}return _0x10d3a4;};}function handleError(_0x25669a,_0xd60edf){_0xd60edf=_0xd60edf||0x1f4;return function(_0x16844d){logger[_0x38f4('0x27')](_0x16844d[_0x38f4('0x3b')]);if(_0x16844d[_0x38f4('0x3c')]){delete _0x16844d[_0x38f4('0x3c')];}_0x25669a[_0x38f4('0x31')](_0xd60edf)[_0x38f4('0x3d')](_0x16844d);};}exports[_0x38f4('0x3e')]=function(_0xb4c27a,_0x1d4af7){var _0x5383c8={},_0x2504f5={},_0x432073={'count':0x0,'rows':[]};var _0x54b709=_[_0x38f4('0x3f')](db[_0x38f4('0x40')][_0x38f4('0x41')],function(_0x3b28b6){return{'name':_0x3b28b6[_0x38f4('0x42')],'type':_0x3b28b6[_0x38f4('0x43')]['key']};});_0x2504f5['model']=_['map'](_0x54b709,'name');_0x2504f5[_0x38f4('0x44')]=_[_0x38f4('0x45')](_0xb4c27a[_0x38f4('0x44')]);_0x2504f5[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x2504f5[_0x38f4('0x48')],_0x2504f5[_0x38f4('0x44')]);_0x5383c8[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x2504f5[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x5383c8[_0x38f4('0x49')]=_0x5383c8[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x5383c8['attributes']:_0x2504f5[_0x38f4('0x48')];if(!_0xb4c27a['query'][_0x38f4('0x4c')]('nolimit')){_0x5383c8[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x5383c8[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x2d')]);}_0x5383c8['order']=qs[_0x38f4('0x4d')](_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x4d')]);_0x5383c8['where']=qs[_0x38f4('0x46')](_[_0x38f4('0x4e')](_0xb4c27a[_0x38f4('0x44')],_0x2504f5[_0x38f4('0x46')]),_0x54b709);if(_0xb4c27a[_0x38f4('0x44')]['filter']){_0x5383c8[_0x38f4('0x4f')]=_['merge'](_0x5383c8['where'],{'$or':_[_0x38f4('0x3f')](_0x54b709,function(_0x13541f){if(_0x13541f[_0x38f4('0x43')]!==_0x38f4('0x50')){var _0x53efd3={};_0x53efd3[_0x13541f['name']]={'$like':'%'+_0xb4c27a['query'][_0x38f4('0x51')]+'%'};return _0x53efd3;}})});}_0x5383c8=_[_0x38f4('0x52')]({},_0x5383c8,_0xb4c27a[_0x38f4('0x53')]);var _0x2342a9={'where':_0x5383c8[_0x38f4('0x4f')]};return db[_0x38f4('0x40')][_0x38f4('0x30')](_0x2342a9)[_0x38f4('0x22')](function(_0x3bfcad){_0x432073['count']=_0x3bfcad;if(_0xb4c27a[_0x38f4('0x44')][_0x38f4('0x54')]){_0x5383c8[_0x38f4('0x55')]=[{'all':!![]}];}return db[_0x38f4('0x40')][_0x38f4('0x56')](_0x5383c8);})[_0x38f4('0x22')](function(_0x1caaf3){_0x432073[_0x38f4('0x57')]=_0x1caaf3;return _0x432073;})[_0x38f4('0x22')](respondWithFilteredResult(_0x1d4af7,_0x5383c8))['catch'](handleError(_0x1d4af7,null));};exports['show']=function(_0x3d6630,_0x26661e){var _0x53fc22={'raw':!![],'where':{'id':_0x3d6630['params']['id']}},_0x3807bd={};_0x3807bd['model']=_[_0x38f4('0x45')](db[_0x38f4('0x40')][_0x38f4('0x41')]);_0x3807bd[_0x38f4('0x44')]=_['keys'](_0x3d6630[_0x38f4('0x44')]);_0x3807bd[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x3807bd[_0x38f4('0x48')],_0x3807bd[_0x38f4('0x44')]);_0x53fc22[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x3807bd[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x3d6630[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x53fc22['attributes']=_0x53fc22[_0x38f4('0x49')]['length']?_0x53fc22['attributes']:_0x3807bd['model'];if(_0x3d6630[_0x38f4('0x44')][_0x38f4('0x54')]){_0x53fc22['include']=[{'all':!![]}];}_0x53fc22=_[_0x38f4('0x52')]({},_0x53fc22,_0x3d6630['options']);return db[_0x38f4('0x40')]['find'](_0x53fc22)[_0x38f4('0x22')](handleEntityNotFound(_0x26661e,null))[_0x38f4('0x22')](respondWithResult(_0x26661e,null))[_0x38f4('0x58')](handleError(_0x26661e,null));};exports[_0x38f4('0x59')]=function(_0x15a7e8,_0x468bf2){return db[_0x38f4('0x40')][_0x38f4('0x59')](_0x15a7e8[_0x38f4('0x5a')],{})[_0x38f4('0x22')](function(_0x205719){var _0x5b8586=_0x15a7e8['user']['get']({'plain':!![]});if(!_0x5b8586)throw new Error(_0x38f4('0x5b'));if(_0x5b8586[_0x38f4('0x5c')]===_0x38f4('0x5d')){var _0x55459b=_0x205719[_0x38f4('0x38')]({'plain':!![]});var _0x7c8f1d=_0x38f4('0x39');return db[_0x38f4('0x5e')][_0x38f4('0x5f')]({'where':{'name':_0x7c8f1d,'userProfileId':_0x5b8586[_0x38f4('0x60')]},'raw':!![]})[_0x38f4('0x22')](function(_0x59935f){if(_0x59935f&&_0x59935f[_0x38f4('0x61')]===0x0){return db['UserProfileResource'][_0x38f4('0x59')]({'name':_0x55459b[_0x38f4('0x3c')],'resourceId':_0x55459b['id'],'type':_0x59935f[_0x38f4('0x3c')],'sectionId':_0x59935f['id']},{})['then'](function(){return _0x205719;});}else{return _0x205719;}})[_0x38f4('0x58')](function(_0x3c0d04){logger[_0x38f4('0x27')](_0x38f4('0x62'),_0x3c0d04);throw _0x3c0d04;});}return _0x205719;})[_0x38f4('0x22')](respondWithResult(_0x468bf2,0xc9))[_0x38f4('0x58')](handleError(_0x468bf2,null));};exports[_0x38f4('0x36')]=function(_0x570a0b,_0x808dff){if(_0x570a0b[_0x38f4('0x5a')]['id']){delete _0x570a0b[_0x38f4('0x5a')]['id'];}return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x570a0b['params']['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x808dff,null))[_0x38f4('0x22')](saveUpdates(_0x570a0b[_0x38f4('0x5a')],null))[_0x38f4('0x22')](respondWithResult(_0x808dff,null))[_0x38f4('0x58')](handleError(_0x808dff,null));};exports[_0x38f4('0x37')]=function(_0x199560,_0x28ffef){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x199560[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x28ffef,null))['then'](removeEntity(_0x28ffef,null))[_0x38f4('0x58')](handleError(_0x28ffef,null));};exports[_0x38f4('0x64')]=function(_0x5f20e0,_0x114b18){return db[_0x38f4('0x40')][_0x38f4('0x64')]()[_0x38f4('0x22')](respondWithResult(_0x114b18,null))[_0x38f4('0x58')](handleError(_0x114b18,null));};exports['getMembers']=function(_0x4cab40,_0x32fd42,_0x21dffc){var _0x536133={'raw':!![],'where':{}},_0x4fd3f3={},_0x273ccc;return db[_0x38f4('0x40')]['findOne']({'where':{'id':_0x4cab40[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x32fd42,null))[_0x38f4('0x22')](function(_0x1ac0b1){if(_0x1ac0b1){_0x273ccc=_0x1ac0b1[_0x38f4('0x38')]({'plain':!![]});_0x4fd3f3['model']=_['keys'](db[_0x38f4('0x65')][_0x38f4('0x41')]);_0x4fd3f3[_0x38f4('0x44')]=_['keys'](_0x4cab40[_0x38f4('0x44')]);_0x4fd3f3[_0x38f4('0x46')]=_[_0x38f4('0x47')](_0x4fd3f3[_0x38f4('0x48')],_0x4fd3f3[_0x38f4('0x44')]);_0x536133[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x4fd3f3[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x4cab40['query'][_0x38f4('0x4a')]));_0x536133[_0x38f4('0x49')]=_0x536133[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x536133[_0x38f4('0x49')]:_0x4fd3f3[_0x38f4('0x48')];if(!_0x4cab40['query'][_0x38f4('0x4c')]('nolimit')){_0x536133[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0x4cab40[_0x38f4('0x44')]['limit']);_0x536133['offset']=qs['offset'](_0x4cab40[_0x38f4('0x44')]['offset']);}_0x536133[_0x38f4('0x66')]=qs[_0x38f4('0x4d')](_0x4cab40[_0x38f4('0x44')][_0x38f4('0x4d')]);_0x536133['where']=qs[_0x38f4('0x46')](_[_0x38f4('0x4e')](_0x4cab40[_0x38f4('0x44')],_0x4fd3f3['filters']));_0x536133['where'][_0x38f4('0x67')]=_0x1ac0b1['id'];if(_0x4cab40[_0x38f4('0x44')][_0x38f4('0x51')]){_0x536133[_0x38f4('0x4f')]=_[_0x38f4('0x52')](_0x536133['where'],{'$or':_[_0x38f4('0x3f')](_0x536133['attributes'],function(_0x3b391a){var _0x4a5b9a={};_0x4a5b9a[_0x3b391a]={'$like':'%'+_0x4cab40[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x4a5b9a;})});}_0x536133=_[_0x38f4('0x52')]({},_0x536133,_0x4cab40['options']);return db['UserChatQueue'][_0x38f4('0x56')](_0x536133);}})[_0x38f4('0x22')](function(_0x11ec3b){if(_0x11ec3b){return db['User'][_0x38f4('0x68')]({'where':{'id':_[_0x38f4('0x3f')](_0x11ec3b,_0x38f4('0x69')),'role':_0x38f4('0x6a')},'attributes':['id',_0x38f4('0x3c'),'chatPause',_0x38f4('0x6b'),_0x38f4('0x6c')]});}})['then'](function(_0x489607){if(_0x489607){return{'count':_0x489607[_0x38f4('0x30')],'rows':_[_0x38f4('0x3f')](_0x489607[_0x38f4('0x57')],function(_0xbc6171){return{'membername':_0xbc6171[_0x38f4('0x3c')],'UserId':_0xbc6171['id'],'queue_name':_0x273ccc[_0x38f4('0x3c')],'ChatQueueId':_0x273ccc['id'],'interface':util['format']('%s/%s','SIP',_0xbc6171[_0x38f4('0x3c')]),'penalty':0x0,'paused':_0xbc6171['chatPause'],'createdAt':_0xbc6171[_0x38f4('0x6c')],'updatedAt':_0xbc6171[_0x38f4('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x38f4('0x22')](respondWithFilteredResult(_0x32fd42,_0x536133))[_0x38f4('0x58')](handleError(_0x32fd42,null));};exports[_0x38f4('0x6d')]=function(_0x4d7f13,_0x9dcee1,_0x36366a){var _0x3ce724={};var _0xb9a15c={};var _0xa732fd;var _0x3f4946;return db[_0x38f4('0x40')][_0x38f4('0x6e')]({'where':{'id':_0x4d7f13['params']['id']}})['then'](handleEntityNotFound(_0x9dcee1,null))[_0x38f4('0x22')](function(_0x307eff){if(_0x307eff){_0xa732fd=_0x307eff;_0xb9a15c[_0x38f4('0x48')]=_[_0x38f4('0x45')](db[_0x38f4('0x6f')][_0x38f4('0x41')]);_0xb9a15c[_0x38f4('0x44')]=_['keys'](_0x4d7f13[_0x38f4('0x44')]);_0xb9a15c['filters']=_['intersection'](_0xb9a15c['model'],_0xb9a15c[_0x38f4('0x44')]);_0x3ce724['attributes']=_['intersection'](_0xb9a15c[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x4d7f13[_0x38f4('0x44')]['fields']));_0x3ce724[_0x38f4('0x49')]=_0x3ce724[_0x38f4('0x49')][_0x38f4('0x4b')]?_0x3ce724[_0x38f4('0x49')]:_0xb9a15c[_0x38f4('0x48')];_0x3ce724[_0x38f4('0x66')]=qs[_0x38f4('0x4d')](_0x4d7f13[_0x38f4('0x44')]['sort']);_0x3ce724[_0x38f4('0x4f')]=qs['filters'](_[_0x38f4('0x4e')](_0x4d7f13[_0x38f4('0x44')],_0xb9a15c[_0x38f4('0x46')]));if(_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x51')]){_0x3ce724['where']=_[_0x38f4('0x52')](_0x3ce724[_0x38f4('0x4f')],{'$or':_['map'](_0x3ce724[_0x38f4('0x49')],function(_0x4fabe7){var _0x293a2e={};_0x293a2e[_0x4fabe7]={'$like':'%'+_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x293a2e;})});}_0x3ce724=_[_0x38f4('0x52')]({},_0x3ce724,_0x4d7f13[_0x38f4('0x53')]);return _0xa732fd[_0x38f4('0x6d')](_0x3ce724);}})['then'](function(_0x38b8e9){if(_0x38b8e9){_0x3f4946=_0x38b8e9['length'];if(!_0x4d7f13[_0x38f4('0x44')]['hasOwnProperty'](_0x38f4('0x70'))){_0x3ce724[_0x38f4('0x2f')]=qs[_0x38f4('0x2f')](_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x3ce724[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0x4d7f13[_0x38f4('0x44')][_0x38f4('0x2d')]);}return _0xa732fd[_0x38f4('0x6d')](_0x3ce724);}})[_0x38f4('0x22')](function(_0xc8e6c5){if(_0xc8e6c5){return _0xc8e6c5?{'count':_0x3f4946,'rows':_0xc8e6c5}:null;}})['then'](respondWithResult(_0x9dcee1,null))[_0x38f4('0x58')](handleError(_0x9dcee1,null));};exports[_0x38f4('0x71')]=function(_0x200ee9,_0x4cb8f6,_0x3bb656){var _0x31514c=_0x200ee9[_0x38f4('0x5a')][_0x38f4('0x72')];return db[_0x38f4('0x6f')][_0x38f4('0x56')]({'where':{'id':_0x31514c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x38f4('0x73'),'attributes':['id','name',_0x38f4('0x74'),_0x38f4('0x75'),_0x38f4('0x76')],'raw':!![]}]})[_0x38f4('0x22')](function(_0x3e7408){if(_0x3e7408){var _0x3aecb3=_[_0x38f4('0x77')](_0x3e7408,function(_0x31abf4){var _0x3eac7e=_0x31abf4[_0x38f4('0x38')]({'plain':!![]});return _0x3eac7e[_0x38f4('0x73')];});return db['ChatQueue'][_0x38f4('0x5f')]({'where':{'id':_0x200ee9['params']['id']}})[_0x38f4('0x22')](function(_0x52047b){return db[_0x38f4('0x78')]['transaction'](function(_0x1c333f){return _0x52047b[_0x38f4('0x71')](_0x31514c,{'transaction':_0x1c333f})[_0x38f4('0x22')](function(){return BPromise[_0x38f4('0x79')](_0x3aecb3,function(_0x42c604){return db[_0x38f4('0x65')][_0x38f4('0x7a')]({'where':{'UserId':_0x42c604['id'],'ChatQueueId':_0x200ee9[_0x38f4('0x63')]['id']},'transaction':_0x1c333f});});})['then'](function(){_0x3aecb3[_0x38f4('0x7b')](function(_0x59d35d){socket[_0x38f4('0x7c')](_0x38f4('0x7d'),{'UserId':_0x59d35d['id'],'ChatQueueId':_0x52047b['id']});});});});});}})[_0x38f4('0x22')](respondWithStatusCode(_0x4cb8f6,null))[_0x38f4('0x58')](handleError(_0x4cb8f6,null));};exports[_0x38f4('0x7e')]=function(_0x482cb4,_0x178188,_0x3f486b){return db[_0x38f4('0x6f')]['findAll']({'where':{'id':_0x482cb4[_0x38f4('0x44')][_0x38f4('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x38f4('0x73'),'attributes':['id'],'raw':!![]}]})[_0x38f4('0x22')](handleEntityNotFound(_0x178188,null))[_0x38f4('0x22')](function(_0x100c0a){var _0x10660e=_[_0x38f4('0x3f')](_0x100c0a,'id');var _0x5d87c6=[];var _0x459a33=[];var _0xe1bd5d=squel[_0x38f4('0x7f')]();_0xe1bd5d[_0x38f4('0x80')](_0x38f4('0x81'))[_0x38f4('0x82')](_0x38f4('0x83'),'tq')[_0x38f4('0x84')]('user_has_teams','ut',_0x38f4('0x85'))[_0x38f4('0x4f')](_0x38f4('0x86'),_0x482cb4[_0x38f4('0x63')]['id']);for(var _0x11eef5=0x0;_0x11eef5<_0x100c0a[_0x38f4('0x4b')];_0x11eef5+=0x1){let _0x5ce0a5=_0x100c0a[_0x11eef5];for(var _0x138b9c=0x0;_0x138b9c<_0x5ce0a5[_0x38f4('0x73')][_0x38f4('0x4b')];_0x138b9c+=0x1){let _0x3c98f4=_0x5ce0a5['Agents'][_0x138b9c];var _0x4cc9c4=_0xe1bd5d[_0x38f4('0x87')]();_0x4cc9c4[_0x38f4('0x4f')](_0x38f4('0x88'),_0x3c98f4['id']);_0x459a33[_0x38f4('0x89')](db[_0x38f4('0x78')][_0x38f4('0x44')](_0x4cc9c4[_0x38f4('0x8a')](),{'type':db['sequelize']['QueryTypes'][_0x38f4('0x8b')]})[_0x38f4('0x22')](function(_0xa41f77){if(_0xa41f77[_0x38f4('0x4b')]===0x1){return _0x3c98f4['id'];}else{var _0x34db12=_['every'](_[_0x38f4('0x3f')](_0xa41f77,_0x38f4('0x8c')),function(_0x5acc28){return _[_0x38f4('0x8d')](_0x10660e,_0x5acc28);});if(_0x34db12){return _0x3c98f4['id'];}}}));}}return BPromise[_0x38f4('0x8e')](_0x459a33)[_0x38f4('0x22')](function(_0x49f047){_0x5d87c6=_(_0x5d87c6)[_0x38f4('0x8f')](_0x49f047)[_0x38f4('0x90')]()[_0x38f4('0x91')]();return db['ChatQueue'][_0x38f4('0x5f')]({'where':{'id':_0x482cb4[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](function(_0x454c59){return db[_0x38f4('0x78')][_0x38f4('0x92')](function(_0x105aa2){return _0x454c59[_0x38f4('0x7e')](_0x482cb4['query'][_0x38f4('0x72')],{'transaction':_0x105aa2})['then'](function(){if(!_[_0x38f4('0x93')](_0x5d87c6)){return _0x454c59[_0x38f4('0x94')](_0x5d87c6,{'transaction':_0x105aa2});}})['then'](function(){_0x5d87c6[_0x38f4('0x7b')](function(_0x292632){socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':_0x292632,'ChatQueueId':_0x454c59['id']});});});});});});})['then'](respondWithStatusCode(_0x178188,null))[_0x38f4('0x58')](handleError(_0x178188,null));};exports[_0x38f4('0x96')]=function(_0x41483d,_0x184660,_0x388b2a){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x41483d[_0x38f4('0x63')]['id']}})['then'](handleEntityNotFound(_0x184660,null))[_0x38f4('0x22')](function(_0x4f3865){if(_0x4f3865){return _0x4f3865['addAgents'](_0x41483d[_0x38f4('0x5a')][_0x38f4('0x72')],_[_0x38f4('0x97')](_0x41483d['body'],['ids','id'])||{})[_0x38f4('0x98')](function(_0x12f544){for(var _0x2b558f=0x0;_0x2b558f<_0x41483d[_0x38f4('0x5a')][_0x38f4('0x72')][_0x38f4('0x4b')];_0x2b558f+=0x1){socket[_0x38f4('0x7c')]('userChatQueue:save',{'UserId':Number(_0x41483d['body'][_0x38f4('0x72')][_0x2b558f]),'ChatQueueId':Number(_0x41483d[_0x38f4('0x63')]['id'])});}return _0x12f544;});}})['then'](respondWithResult(_0x184660,null))['catch'](handleError(_0x184660,null));};exports[_0x38f4('0x94')]=function(_0x4a8e1b,_0x4ee757,_0x320b60){return db[_0x38f4('0x40')][_0x38f4('0x5f')]({'where':{'id':_0x4a8e1b[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x4ee757,null))[_0x38f4('0x22')](function(_0x10be31){if(_0x10be31){return _0x10be31[_0x38f4('0x94')](_0x4a8e1b['query']['ids'])[_0x38f4('0x22')](function(){if(_['isArray'](_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')])){for(var _0x503af4=0x0;_0x503af4<_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')][_0x38f4('0x4b')];_0x503af4+=0x1){socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':Number(_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')][_0x503af4]),'ChatQueueId':Number(_0x4a8e1b[_0x38f4('0x63')]['id'])});}}else{socket[_0x38f4('0x7c')](_0x38f4('0x95'),{'UserId':Number(_0x4a8e1b[_0x38f4('0x44')][_0x38f4('0x72')]),'ChatQueueId':Number(_0x4a8e1b[_0x38f4('0x63')]['id'])});}});}})[_0x38f4('0x22')](respondWithStatusCode(_0x4ee757,null))['catch'](handleError(_0x4ee757,null));};exports['getAgents']=function(_0x3c33da,_0x5cf66b,_0x1dbc53){var _0x546f5c={};var _0x3cc4da={};var _0x213bf5;var _0x31a525;return db['ChatQueue'][_0x38f4('0x6e')]({'where':{'id':_0x3c33da[_0x38f4('0x63')]['id']}})[_0x38f4('0x22')](handleEntityNotFound(_0x5cf66b,null))[_0x38f4('0x22')](function(_0x2e6a0a){if(_0x2e6a0a){_0x213bf5=_0x2e6a0a;_0x3cc4da['model']=_[_0x38f4('0x45')](db[_0x38f4('0x99')][_0x38f4('0x41')]);_0x3cc4da['query']=_[_0x38f4('0x45')](_0x3c33da[_0x38f4('0x44')]);_0x3cc4da[_0x38f4('0x46')]=_['intersection'](_0x3cc4da[_0x38f4('0x48')],_0x3cc4da[_0x38f4('0x44')]);_0x546f5c[_0x38f4('0x49')]=_[_0x38f4('0x47')](_0x3cc4da[_0x38f4('0x48')],qs[_0x38f4('0x4a')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x4a')]));_0x546f5c[_0x38f4('0x49')]=_0x546f5c['attributes']['length']?_0x546f5c[_0x38f4('0x49')]:_0x3cc4da[_0x38f4('0x48')];_0x546f5c['order']=qs[_0x38f4('0x4d')](_0x3c33da['query'][_0x38f4('0x4d')]);_0x546f5c['where']=qs['filters'](_[_0x38f4('0x4e')](_0x3c33da[_0x38f4('0x44')],_0x3cc4da[_0x38f4('0x46')]));if(_0x3c33da[_0x38f4('0x44')][_0x38f4('0x51')]){_0x546f5c['where']=_[_0x38f4('0x52')](_0x546f5c['where'],{'$or':_[_0x38f4('0x3f')](_0x546f5c['attributes'],function(_0x346bd4){var _0x485e99={};_0x485e99[_0x346bd4]={'$like':'%'+_0x3c33da[_0x38f4('0x44')][_0x38f4('0x51')]+'%'};return _0x485e99;})});}_0x546f5c=_['merge']({},_0x546f5c,_0x3c33da['options']);return _0x213bf5['getAgents'](_0x546f5c);}})['then'](function(_0x462986){if(_0x462986){_0x31a525=_0x462986['length'];if(!_0x3c33da[_0x38f4('0x44')]['hasOwnProperty'](_0x38f4('0x70'))){_0x546f5c['limit']=qs[_0x38f4('0x2f')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x2f')]);_0x546f5c[_0x38f4('0x2d')]=qs[_0x38f4('0x2d')](_0x3c33da[_0x38f4('0x44')][_0x38f4('0x2d')]);}return _0x213bf5['getAgents'](_0x546f5c);}})[_0x38f4('0x22')](function(_0x36d54a){if(_0x36d54a){return _0x36d54a?{'count':_0x31a525,'rows':_0x36d54a}:null;}})[_0x38f4('0x22')](respondWithResult(_0x5cf66b,null))[_0x38f4('0x58')](handleError(_0x5cf66b,null));}; \ No newline at end of file +var _0xbacb=['redis','defaults','./chatQueue.socket','client','http','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','index','map','ChatQueue','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','describe','getMembers','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userChatQueue:remove','addAgents','isArray','findOne','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x349c7f,_0x4fa394){var _0x32708d=function(_0x3f802c){while(--_0x3f802c){_0x349c7f['push'](_0x349c7f['shift']());}};_0x32708d(++_0x4fa394);}(_0xbacb,0x116));var _0xbbac=function(_0x2e10a7,_0x50b1b1){_0x2e10a7=_0x2e10a7-0x0;var _0x4af6e3=_0xbacb[_0x2e10a7];return _0x4af6e3;};'use strict';var emlformat=require(_0xbbac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbac('0x1'));var jsonpatch=require(_0xbbac('0x2'));var rp=require(_0xbbac('0x3'));var moment=require(_0xbbac('0x4'));var BPromise=require(_0xbbac('0x5'));var Mustache=require(_0xbbac('0x6'));var util=require('util');var path=require(_0xbbac('0x7'));var sox=require(_0xbbac('0x8'));var csv=require(_0xbbac('0x9'));var ejs=require(_0xbbac('0xa'));var fs=require('fs');var fs_extra=require(_0xbbac('0xb'));var _=require(_0xbbac('0xc'));var squel=require('squel');var crypto=require(_0xbbac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbac('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbbac('0xf'));var Redis=require(_0xbbac('0x10'));var authService=require(_0xbbac('0x11'));var qs=require(_0xbbac('0x12'));var as=require(_0xbbac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbbac('0x14'));var utils=require('../../config/utils');var config=require(_0xbbac('0x15'));var licenseUtil=require(_0xbbac('0x16'));var db=require(_0xbbac('0x17'))['db'];config[_0xbbac('0x18')]=_[_0xbbac('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbbac('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbbac('0x1b')][_0xbbac('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x235305,_0xa6cb94,_0x39ecae,_0x4feab1){return new BPromise(function(_0x435879,_0x30ccf9){var _0x273b9a=_0x4feab1||client;return _0x273b9a[_0xbbac('0x1d')](_0x235305,_0x39ecae)[_0xbbac('0x1e')](function(_0x564902){logger[_0xbbac('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xa6cb94,'request\x20sent');logger[_0xbbac('0x20')](_0xbbac('0x21'),_0xa6cb94,_0xbbac('0x22'),JSON['stringify'](_0x564902));if(_0x564902[_0xbbac('0x23')]){if(_0x564902['error'][_0xbbac('0x24')]===0x1f4){logger[_0xbbac('0x23')](_0xbbac('0x25'),_0xa6cb94,_0x564902[_0xbbac('0x23')][_0xbbac('0x26')]);return _0x30ccf9(_0x564902[_0xbbac('0x23')][_0xbbac('0x26')]);}logger[_0xbbac('0x23')](_0xbbac('0x25'),_0xa6cb94,_0x564902[_0xbbac('0x23')]['message']);return _0x435879(_0x564902[_0xbbac('0x23')][_0xbbac('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xa6cb94,'request\x20sent');_0x435879(_0x564902[_0xbbac('0x27')]['message']);}})[_0xbbac('0x28')](function(_0xdc4bf9){logger[_0xbbac('0x23')]('ChatQueue,\x20%s,\x20%s',_0xa6cb94,_0xdc4bf9);_0x30ccf9(_0xdc4bf9);});});}function respondWithStatusCode(_0x1c077c,_0xa1091a){_0xa1091a=_0xa1091a||0xcc;return function(_0x10415d){if(_0x10415d){return _0x1c077c[_0xbbac('0x29')](_0xa1091a);}return _0x1c077c[_0xbbac('0x2a')](_0xa1091a)['end']();};}function respondWithResult(_0x324cf2,_0x3fcb3a){_0x3fcb3a=_0x3fcb3a||0xc8;return function(_0x229bfd){if(_0x229bfd){return _0x324cf2[_0xbbac('0x2a')](_0x3fcb3a)['json'](_0x229bfd);}};}function respondWithFilteredResult(_0x1e947a,_0x202ed3){return function(_0x2406b9){if(_0x2406b9){var _0x3da46f=typeof _0x202ed3[_0xbbac('0x2b')]===_0xbbac('0x2c')&&typeof _0x202ed3[_0xbbac('0x2d')]===_0xbbac('0x2c');var _0x5bef71=_0x2406b9['count'];var _0x59596f=_0x3da46f?0x0:_0x202ed3[_0xbbac('0x2b')];var _0x5d84e0=_0x3da46f?_0x2406b9[_0xbbac('0x2e')]:_0x202ed3['offset']+_0x202ed3[_0xbbac('0x2d')];var _0x367e97;if(_0x5d84e0>=_0x5bef71){_0x5d84e0=_0x5bef71;_0x367e97=0xc8;}else{_0x367e97=0xce;}_0x1e947a[_0xbbac('0x2a')](_0x367e97);return _0x1e947a['set'](_0xbbac('0x2f'),_0x59596f+'-'+_0x5d84e0+'/'+_0x5bef71)[_0xbbac('0x30')](_0x2406b9);}return null;};}function patchUpdates(_0x389c6e){return function(_0xe6a46e){try{jsonpatch['apply'](_0xe6a46e,_0x389c6e,!![]);}catch(_0x3c4f80){return BPromise['reject'](_0x3c4f80);}return _0xe6a46e[_0xbbac('0x31')]();};}function saveUpdates(_0x37356b,_0x3043b3){return function(_0x3d9aa1){if(_0x3d9aa1){return _0x3d9aa1[_0xbbac('0x32')](_0x37356b)[_0xbbac('0x1e')](function(_0x46e3dd){return _0x46e3dd;});}return null;};}function removeEntity(_0x40c811,_0x394b16){return function(_0x3dc75b){if(_0x3dc75b){return _0x3dc75b[_0xbbac('0x33')]()['then'](function(){var _0xabc69a=_0x3dc75b[_0xbbac('0x34')]({'plain':!![]});var _0x2ea3f1=_0xbbac('0x35');return db[_0xbbac('0x36')]['destroy']({'where':{'type':_0x2ea3f1,'resourceId':_0xabc69a['id']}})[_0xbbac('0x1e')](function(){return _0x3dc75b;});})[_0xbbac('0x1e')](function(){_0x40c811[_0xbbac('0x2a')](0xcc)[_0xbbac('0x37')]();});}};}function handleEntityNotFound(_0x2b8434,_0x26c4be){return function(_0xdd3ac2){if(!_0xdd3ac2){_0x2b8434[_0xbbac('0x29')](0x194);}return _0xdd3ac2;};}function handleError(_0x544118,_0x1da7cf){_0x1da7cf=_0x1da7cf||0x1f4;return function(_0x23291a){logger[_0xbbac('0x23')](_0x23291a[_0xbbac('0x38')]);if(_0x23291a[_0xbbac('0x39')]){delete _0x23291a[_0xbbac('0x39')];}_0x544118[_0xbbac('0x2a')](_0x1da7cf)['send'](_0x23291a);};}exports[_0xbbac('0x3a')]=function(_0x1c08e3,_0xbbeaf7){var _0x392223={},_0x3c3dd4={},_0x372db5={'count':0x0,'rows':[]};var _0x77492f=_[_0xbbac('0x3b')](db[_0xbbac('0x3c')]['rawAttributes'],function(_0x163d4c){return{'name':_0x163d4c[_0xbbac('0x3d')],'type':_0x163d4c[_0xbbac('0x3e')][_0xbbac('0x3f')]};});_0x3c3dd4[_0xbbac('0x40')]=_[_0xbbac('0x3b')](_0x77492f,'name');_0x3c3dd4[_0xbbac('0x41')]=_['keys'](_0x1c08e3['query']);_0x3c3dd4[_0xbbac('0x42')]=_['intersection'](_0x3c3dd4[_0xbbac('0x40')],_0x3c3dd4['query']);_0x392223[_0xbbac('0x43')]=_[_0xbbac('0x44')](_0x3c3dd4[_0xbbac('0x40')],qs[_0xbbac('0x45')](_0x1c08e3[_0xbbac('0x41')][_0xbbac('0x45')]));_0x392223['attributes']=_0x392223[_0xbbac('0x43')][_0xbbac('0x46')]?_0x392223['attributes']:_0x3c3dd4[_0xbbac('0x40')];if(!_0x1c08e3[_0xbbac('0x41')][_0xbbac('0x47')](_0xbbac('0x48'))){_0x392223['limit']=qs[_0xbbac('0x2d')](_0x1c08e3[_0xbbac('0x41')]['limit']);_0x392223[_0xbbac('0x2b')]=qs[_0xbbac('0x2b')](_0x1c08e3['query'][_0xbbac('0x2b')]);}_0x392223[_0xbbac('0x49')]=qs[_0xbbac('0x4a')](_0x1c08e3[_0xbbac('0x41')][_0xbbac('0x4a')]);_0x392223[_0xbbac('0x4b')]=qs[_0xbbac('0x42')](_[_0xbbac('0x4c')](_0x1c08e3[_0xbbac('0x41')],_0x3c3dd4['filters']),_0x77492f);if(_0x1c08e3[_0xbbac('0x41')][_0xbbac('0x4d')]){_0x392223[_0xbbac('0x4b')]=_['merge'](_0x392223[_0xbbac('0x4b')],{'$or':_[_0xbbac('0x3b')](_0x77492f,function(_0x81f1d7){if(_0x81f1d7[_0xbbac('0x3e')]!=='VIRTUAL'){var _0x46e07e={};_0x46e07e[_0x81f1d7[_0xbbac('0x39')]]={'$like':'%'+_0x1c08e3['query'][_0xbbac('0x4d')]+'%'};return _0x46e07e;}})});}_0x392223=_[_0xbbac('0x4e')]({},_0x392223,_0x1c08e3[_0xbbac('0x4f')]);var _0x22d395={'where':_0x392223[_0xbbac('0x4b')]};return db['ChatQueue'][_0xbbac('0x2e')](_0x22d395)[_0xbbac('0x1e')](function(_0x16c50f){_0x372db5[_0xbbac('0x2e')]=_0x16c50f;if(_0x1c08e3[_0xbbac('0x41')][_0xbbac('0x50')]){_0x392223[_0xbbac('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0xbbac('0x52')](_0x392223);})['then'](function(_0x4f9615){_0x372db5[_0xbbac('0x53')]=_0x4f9615;return _0x372db5;})[_0xbbac('0x1e')](respondWithFilteredResult(_0xbbeaf7,_0x392223))[_0xbbac('0x28')](handleError(_0xbbeaf7,null));};exports[_0xbbac('0x54')]=function(_0x429167,_0x3313c2){var _0x215c1b={'raw':!![],'where':{'id':_0x429167[_0xbbac('0x55')]['id']}},_0x122b4b={};_0x122b4b['model']=_[_0xbbac('0x56')](db[_0xbbac('0x3c')][_0xbbac('0x57')]);_0x122b4b[_0xbbac('0x41')]=_[_0xbbac('0x56')](_0x429167[_0xbbac('0x41')]);_0x122b4b[_0xbbac('0x42')]=_[_0xbbac('0x44')](_0x122b4b[_0xbbac('0x40')],_0x122b4b[_0xbbac('0x41')]);_0x215c1b[_0xbbac('0x43')]=_[_0xbbac('0x44')](_0x122b4b[_0xbbac('0x40')],qs['fields'](_0x429167[_0xbbac('0x41')][_0xbbac('0x45')]));_0x215c1b[_0xbbac('0x43')]=_0x215c1b[_0xbbac('0x43')][_0xbbac('0x46')]?_0x215c1b[_0xbbac('0x43')]:_0x122b4b[_0xbbac('0x40')];if(_0x429167[_0xbbac('0x41')][_0xbbac('0x50')]){_0x215c1b['include']=[{'all':!![]}];}_0x215c1b=_[_0xbbac('0x4e')]({},_0x215c1b,_0x429167[_0xbbac('0x4f')]);return db[_0xbbac('0x3c')]['find'](_0x215c1b)[_0xbbac('0x1e')](handleEntityNotFound(_0x3313c2,null))['then'](respondWithResult(_0x3313c2,null))['catch'](handleError(_0x3313c2,null));};exports[_0xbbac('0x58')]=function(_0x2d266d,_0x1d787d){return db[_0xbbac('0x3c')][_0xbbac('0x58')](_0x2d266d[_0xbbac('0x59')],{})[_0xbbac('0x1e')](function(_0x5eed3b){var _0x1c31d0=_0x2d266d[_0xbbac('0x5a')][_0xbbac('0x34')]({'plain':!![]});if(!_0x1c31d0)throw new Error(_0xbbac('0x5b'));if(_0x1c31d0[_0xbbac('0x5c')]===_0xbbac('0x5a')){var _0x4d3c57=_0x5eed3b[_0xbbac('0x34')]({'plain':!![]});var _0x4cfa1d=_0xbbac('0x35');return db[_0xbbac('0x5d')][_0xbbac('0x5e')]({'where':{'name':_0x4cfa1d,'userProfileId':_0x1c31d0[_0xbbac('0x5f')]},'raw':!![]})['then'](function(_0x2a67da){if(_0x2a67da&&_0x2a67da['autoAssociation']===0x0){return db[_0xbbac('0x36')][_0xbbac('0x58')]({'name':_0x4d3c57[_0xbbac('0x39')],'resourceId':_0x4d3c57['id'],'type':_0x2a67da[_0xbbac('0x39')],'sectionId':_0x2a67da['id']},{})[_0xbbac('0x1e')](function(){return _0x5eed3b;});}else{return _0x5eed3b;}})['catch'](function(_0x1cbd0e){logger[_0xbbac('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cbd0e);throw _0x1cbd0e;});}return _0x5eed3b;})[_0xbbac('0x1e')](respondWithResult(_0x1d787d,0xc9))[_0xbbac('0x28')](handleError(_0x1d787d,null));};exports[_0xbbac('0x32')]=function(_0x377392,_0x4d1719){if(_0x377392['body']['id']){delete _0x377392[_0xbbac('0x59')]['id'];}return db[_0xbbac('0x3c')]['find']({'where':{'id':_0x377392['params']['id']}})[_0xbbac('0x1e')](handleEntityNotFound(_0x4d1719,null))['then'](saveUpdates(_0x377392[_0xbbac('0x59')],null))['then'](respondWithResult(_0x4d1719,null))[_0xbbac('0x28')](handleError(_0x4d1719,null));};exports[_0xbbac('0x33')]=function(_0x4fc4a0,_0xf0defd){return db[_0xbbac('0x3c')][_0xbbac('0x5e')]({'where':{'id':_0x4fc4a0[_0xbbac('0x55')]['id']}})['then'](handleEntityNotFound(_0xf0defd,null))[_0xbbac('0x1e')](removeEntity(_0xf0defd,null))['catch'](handleError(_0xf0defd,null));};exports[_0xbbac('0x60')]=function(_0x4be914,_0x225722){return db[_0xbbac('0x3c')][_0xbbac('0x60')]()['then'](respondWithResult(_0x225722,null))[_0xbbac('0x28')](handleError(_0x225722,null));};exports[_0xbbac('0x61')]=function(_0x4cee32,_0xab5ecd,_0x38dae6){var _0x5df4c4={'raw':!![],'where':{}},_0x4df7b6={},_0x46afcc;return db[_0xbbac('0x3c')]['findOne']({'where':{'id':_0x4cee32[_0xbbac('0x55')]['id']}})[_0xbbac('0x1e')](handleEntityNotFound(_0xab5ecd,null))['then'](function(_0x7fec02){if(_0x7fec02){_0x46afcc=_0x7fec02[_0xbbac('0x34')]({'plain':!![]});_0x4df7b6['model']=_[_0xbbac('0x56')](db[_0xbbac('0x62')][_0xbbac('0x57')]);_0x4df7b6[_0xbbac('0x41')]=_[_0xbbac('0x56')](_0x4cee32[_0xbbac('0x41')]);_0x4df7b6['filters']=_[_0xbbac('0x44')](_0x4df7b6[_0xbbac('0x40')],_0x4df7b6[_0xbbac('0x41')]);_0x5df4c4['attributes']=_[_0xbbac('0x44')](_0x4df7b6[_0xbbac('0x40')],qs[_0xbbac('0x45')](_0x4cee32[_0xbbac('0x41')][_0xbbac('0x45')]));_0x5df4c4[_0xbbac('0x43')]=_0x5df4c4[_0xbbac('0x43')][_0xbbac('0x46')]?_0x5df4c4[_0xbbac('0x43')]:_0x4df7b6['model'];if(!_0x4cee32[_0xbbac('0x41')][_0xbbac('0x47')](_0xbbac('0x48'))){_0x5df4c4[_0xbbac('0x2d')]=qs[_0xbbac('0x2d')](_0x4cee32[_0xbbac('0x41')]['limit']);_0x5df4c4[_0xbbac('0x2b')]=qs['offset'](_0x4cee32['query'][_0xbbac('0x2b')]);}_0x5df4c4[_0xbbac('0x49')]=qs[_0xbbac('0x4a')](_0x4cee32[_0xbbac('0x41')]['sort']);_0x5df4c4[_0xbbac('0x4b')]=qs[_0xbbac('0x42')](_['pick'](_0x4cee32[_0xbbac('0x41')],_0x4df7b6[_0xbbac('0x42')]));_0x5df4c4['where']['ChatQueueId']=_0x7fec02['id'];if(_0x4cee32[_0xbbac('0x41')][_0xbbac('0x4d')]){_0x5df4c4[_0xbbac('0x4b')]=_[_0xbbac('0x4e')](_0x5df4c4[_0xbbac('0x4b')],{'$or':_[_0xbbac('0x3b')](_0x5df4c4[_0xbbac('0x43')],function(_0x10a020){var _0x26ae79={};_0x26ae79[_0x10a020]={'$like':'%'+_0x4cee32[_0xbbac('0x41')]['filter']+'%'};return _0x26ae79;})});}_0x5df4c4=_[_0xbbac('0x4e')]({},_0x5df4c4,_0x4cee32[_0xbbac('0x4f')]);return db[_0xbbac('0x62')]['findAll'](_0x5df4c4);}})[_0xbbac('0x1e')](function(_0xce348b){if(_0xce348b){return db[_0xbbac('0x63')][_0xbbac('0x64')]({'where':{'id':_['map'](_0xce348b,_0xbbac('0x65')),'role':_0xbbac('0x66')},'attributes':['id',_0xbbac('0x39'),'chatPause',_0xbbac('0x67'),_0xbbac('0x68')]});}})[_0xbbac('0x1e')](function(_0x52337c){if(_0x52337c){return{'count':_0x52337c[_0xbbac('0x2e')],'rows':_[_0xbbac('0x3b')](_0x52337c[_0xbbac('0x53')],function(_0x3646e3){return{'membername':_0x3646e3['name'],'UserId':_0x3646e3['id'],'queue_name':_0x46afcc[_0xbbac('0x39')],'ChatQueueId':_0x46afcc['id'],'interface':util[_0xbbac('0x69')](_0xbbac('0x6a'),_0xbbac('0x6b'),_0x3646e3['name']),'penalty':0x0,'paused':_0x3646e3[_0xbbac('0x6c')],'createdAt':_0x3646e3['createdAt'],'updatedAt':_0x3646e3[_0xbbac('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xab5ecd,_0x5df4c4))[_0xbbac('0x28')](handleError(_0xab5ecd,null));};exports['getTeams']=function(_0x491f2e,_0x11ebb0,_0x53682a){var _0x5699cb={};var _0x4b633b={};var _0x2f0397;var _0x23e8bb;return db[_0xbbac('0x3c')]['findOne']({'where':{'id':_0x491f2e[_0xbbac('0x55')]['id']}})[_0xbbac('0x1e')](handleEntityNotFound(_0x11ebb0,null))[_0xbbac('0x1e')](function(_0x4e19a1){if(_0x4e19a1){_0x2f0397=_0x4e19a1;_0x4b633b[_0xbbac('0x40')]=_[_0xbbac('0x56')](db[_0xbbac('0x6d')][_0xbbac('0x57')]);_0x4b633b['query']=_[_0xbbac('0x56')](_0x491f2e[_0xbbac('0x41')]);_0x4b633b[_0xbbac('0x42')]=_[_0xbbac('0x44')](_0x4b633b[_0xbbac('0x40')],_0x4b633b[_0xbbac('0x41')]);_0x5699cb[_0xbbac('0x43')]=_[_0xbbac('0x44')](_0x4b633b[_0xbbac('0x40')],qs['fields'](_0x491f2e[_0xbbac('0x41')][_0xbbac('0x45')]));_0x5699cb[_0xbbac('0x43')]=_0x5699cb['attributes']['length']?_0x5699cb[_0xbbac('0x43')]:_0x4b633b['model'];_0x5699cb['order']=qs['sort'](_0x491f2e[_0xbbac('0x41')][_0xbbac('0x4a')]);_0x5699cb['where']=qs[_0xbbac('0x42')](_[_0xbbac('0x4c')](_0x491f2e[_0xbbac('0x41')],_0x4b633b[_0xbbac('0x42')]));if(_0x491f2e[_0xbbac('0x41')][_0xbbac('0x4d')]){_0x5699cb[_0xbbac('0x4b')]=_['merge'](_0x5699cb[_0xbbac('0x4b')],{'$or':_[_0xbbac('0x3b')](_0x5699cb[_0xbbac('0x43')],function(_0x3e4f83){var _0x44b785={};_0x44b785[_0x3e4f83]={'$like':'%'+_0x491f2e[_0xbbac('0x41')][_0xbbac('0x4d')]+'%'};return _0x44b785;})});}_0x5699cb=_[_0xbbac('0x4e')]({},_0x5699cb,_0x491f2e[_0xbbac('0x4f')]);return _0x2f0397[_0xbbac('0x6e')](_0x5699cb);}})[_0xbbac('0x1e')](function(_0x15bd37){if(_0x15bd37){_0x23e8bb=_0x15bd37[_0xbbac('0x46')];if(!_0x491f2e[_0xbbac('0x41')][_0xbbac('0x47')](_0xbbac('0x48'))){_0x5699cb[_0xbbac('0x2d')]=qs[_0xbbac('0x2d')](_0x491f2e[_0xbbac('0x41')][_0xbbac('0x2d')]);_0x5699cb[_0xbbac('0x2b')]=qs['offset'](_0x491f2e['query'][_0xbbac('0x2b')]);}return _0x2f0397[_0xbbac('0x6e')](_0x5699cb);}})['then'](function(_0x32a666){if(_0x32a666){return _0x32a666?{'count':_0x23e8bb,'rows':_0x32a666}:null;}})['then'](respondWithResult(_0x11ebb0,null))[_0xbbac('0x28')](handleError(_0x11ebb0,null));};exports[_0xbbac('0x6f')]=function(_0x711eb,_0x30ad02,_0x4da3cb){var _0x46af53=_0x711eb[_0xbbac('0x59')][_0xbbac('0x70')];return db[_0xbbac('0x6d')][_0xbbac('0x52')]({'where':{'id':_0x46af53},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbbac('0x71'),'attributes':['id','name',_0xbbac('0x72'),'voicePause',_0xbbac('0x73')],'raw':!![]}]})[_0xbbac('0x1e')](function(_0x2e0e63){if(_0x2e0e63){var _0x30b999=_[_0xbbac('0x74')](_0x2e0e63,function(_0x3578c7){var _0x457cf9=_0x3578c7[_0xbbac('0x34')]({'plain':!![]});return _0x457cf9['Agents'];});return db[_0xbbac('0x3c')][_0xbbac('0x5e')]({'where':{'id':_0x711eb[_0xbbac('0x55')]['id']}})[_0xbbac('0x1e')](function(_0x532803){return db['sequelize'][_0xbbac('0x75')](function(_0x57f8e4){return _0x532803[_0xbbac('0x6f')](_0x46af53,{'transaction':_0x57f8e4})[_0xbbac('0x1e')](function(){return BPromise[_0xbbac('0x76')](_0x30b999,function(_0x4ea655){return db[_0xbbac('0x62')][_0xbbac('0x77')]({'where':{'UserId':_0x4ea655['id'],'ChatQueueId':_0x711eb['params']['id']},'transaction':_0x57f8e4});});})[_0xbbac('0x1e')](function(){_0x30b999[_0xbbac('0x78')](function(_0x455be1){socket[_0xbbac('0x79')](_0xbbac('0x7a'),{'UserId':_0x455be1['id'],'ChatQueueId':_0x532803['id']});});});});});}})[_0xbbac('0x1e')](respondWithStatusCode(_0x30ad02,null))[_0xbbac('0x28')](handleError(_0x30ad02,null));};exports[_0xbbac('0x7b')]=function(_0x1809ca,_0x33ea64,_0x5a0d35){return db['Team'][_0xbbac('0x52')]({'where':{'id':_0x1809ca['query'][_0xbbac('0x70')]},'attributes':['id'],'include':[{'model':db[_0xbbac('0x63')],'as':_0xbbac('0x71'),'attributes':['id'],'raw':!![]}]})[_0xbbac('0x1e')](handleEntityNotFound(_0x33ea64,null))[_0xbbac('0x1e')](function(_0x52bd81){var _0x54847d=_[_0xbbac('0x3b')](_0x52bd81,'id');var _0x5ad92f=[];var _0x5bc631=[];var _0x15b943=squel[_0xbbac('0x7c')]();_0x15b943[_0xbbac('0x7d')](_0xbbac('0x7e'))[_0xbbac('0x7f')](_0xbbac('0x80'),'tq')[_0xbbac('0x81')](_0xbbac('0x82'),'ut',_0xbbac('0x83'))[_0xbbac('0x4b')](_0xbbac('0x84'),_0x1809ca[_0xbbac('0x55')]['id']);for(var _0x3f9d05=0x0;_0x3f9d05<_0x52bd81['length'];_0x3f9d05+=0x1){let _0x1e68b0=_0x52bd81[_0x3f9d05];for(var _0x345f60=0x0;_0x345f60<_0x1e68b0[_0xbbac('0x71')]['length'];_0x345f60+=0x1){let _0x20eff4=_0x1e68b0[_0xbbac('0x71')][_0x345f60];var _0x488528=_0x15b943[_0xbbac('0x85')]();_0x488528[_0xbbac('0x4b')]('ut.UserId\x20=\x20?',_0x20eff4['id']);_0x5bc631[_0xbbac('0x86')](db[_0xbbac('0x87')][_0xbbac('0x41')](_0x488528[_0xbbac('0x88')](),{'type':db['sequelize'][_0xbbac('0x89')][_0xbbac('0x8a')]})[_0xbbac('0x1e')](function(_0xc3ecc2){if(_0xc3ecc2[_0xbbac('0x46')]===0x1){return _0x20eff4['id'];}else{var _0xc03b0a=_[_0xbbac('0x8b')](_['map'](_0xc3ecc2,_0xbbac('0x8c')),function(_0x521f18){return _[_0xbbac('0x8d')](_0x54847d,_0x521f18);});if(_0xc03b0a){return _0x20eff4['id'];}}}));}}return BPromise[_0xbbac('0x8e')](_0x5bc631)[_0xbbac('0x1e')](function(_0x5d1311){_0x5ad92f=_(_0x5ad92f)['union'](_0x5d1311)[_0xbbac('0x8f')]()[_0xbbac('0x90')]();return db[_0xbbac('0x3c')][_0xbbac('0x5e')]({'where':{'id':_0x1809ca[_0xbbac('0x55')]['id']}})['then'](function(_0x243de3){return db[_0xbbac('0x87')]['transaction'](function(_0x27ce7c){return _0x243de3[_0xbbac('0x7b')](_0x1809ca[_0xbbac('0x41')]['ids'],{'transaction':_0x27ce7c})['then'](function(){if(!_['isEmpty'](_0x5ad92f)){return _0x243de3[_0xbbac('0x91')](_0x5ad92f,{'transaction':_0x27ce7c});}})['then'](function(){_0x5ad92f[_0xbbac('0x78')](function(_0x1dc78b){socket[_0xbbac('0x79')](_0xbbac('0x92'),{'UserId':_0x1dc78b,'ChatQueueId':_0x243de3['id']});});});});});});})[_0xbbac('0x1e')](respondWithStatusCode(_0x33ea64,null))[_0xbbac('0x28')](handleError(_0x33ea64,null));};exports['addAgents']=function(_0x636560,_0x50b814,_0xc62c9c){return db[_0xbbac('0x3c')]['find']({'where':{'id':_0x636560[_0xbbac('0x55')]['id']}})[_0xbbac('0x1e')](handleEntityNotFound(_0x50b814,null))[_0xbbac('0x1e')](function(_0x17502d){if(_0x17502d){return _0x17502d[_0xbbac('0x93')](_0x636560[_0xbbac('0x59')][_0xbbac('0x70')],_['omit'](_0x636560[_0xbbac('0x59')],[_0xbbac('0x70'),'id'])||{})['spread'](function(_0x2c5598){for(var _0x1f8f8f=0x0;_0x1f8f8f<_0x636560['body'][_0xbbac('0x70')][_0xbbac('0x46')];_0x1f8f8f+=0x1){socket[_0xbbac('0x79')](_0xbbac('0x7a'),{'UserId':Number(_0x636560['body'][_0xbbac('0x70')][_0x1f8f8f]),'ChatQueueId':Number(_0x636560['params']['id'])});}return _0x2c5598;});}})['then'](respondWithResult(_0x50b814,null))[_0xbbac('0x28')](handleError(_0x50b814,null));};exports['removeAgents']=function(_0x465c8c,_0x9d6d58,_0x476ee2){return db[_0xbbac('0x3c')][_0xbbac('0x5e')]({'where':{'id':_0x465c8c[_0xbbac('0x55')]['id']}})['then'](handleEntityNotFound(_0x9d6d58,null))[_0xbbac('0x1e')](function(_0x50e253){if(_0x50e253){return _0x50e253[_0xbbac('0x91')](_0x465c8c['query'][_0xbbac('0x70')])[_0xbbac('0x1e')](function(){if(_[_0xbbac('0x94')](_0x465c8c[_0xbbac('0x41')][_0xbbac('0x70')])){for(var _0x8b69df=0x0;_0x8b69df<_0x465c8c[_0xbbac('0x41')]['ids'][_0xbbac('0x46')];_0x8b69df+=0x1){socket[_0xbbac('0x79')](_0xbbac('0x92'),{'UserId':Number(_0x465c8c[_0xbbac('0x41')][_0xbbac('0x70')][_0x8b69df]),'ChatQueueId':Number(_0x465c8c[_0xbbac('0x55')]['id'])});}}else{socket['emit'](_0xbbac('0x92'),{'UserId':Number(_0x465c8c[_0xbbac('0x41')][_0xbbac('0x70')]),'ChatQueueId':Number(_0x465c8c[_0xbbac('0x55')]['id'])});}});}})[_0xbbac('0x1e')](respondWithStatusCode(_0x9d6d58,null))[_0xbbac('0x28')](handleError(_0x9d6d58,null));};exports['getAgents']=function(_0x50b0ab,_0x352ce0,_0xc1460c){var _0x543fbe={};var _0x129010={};var _0x3c6104;var _0x4f4704;return db[_0xbbac('0x3c')][_0xbbac('0x95')]({'where':{'id':_0x50b0ab['params']['id']}})[_0xbbac('0x1e')](handleEntityNotFound(_0x352ce0,null))[_0xbbac('0x1e')](function(_0x4b0877){if(_0x4b0877){_0x3c6104=_0x4b0877;_0x129010[_0xbbac('0x40')]=_[_0xbbac('0x56')](db[_0xbbac('0x63')][_0xbbac('0x57')]);_0x129010[_0xbbac('0x41')]=_[_0xbbac('0x56')](_0x50b0ab[_0xbbac('0x41')]);_0x129010[_0xbbac('0x42')]=_['intersection'](_0x129010[_0xbbac('0x40')],_0x129010['query']);_0x543fbe[_0xbbac('0x43')]=_[_0xbbac('0x44')](_0x129010[_0xbbac('0x40')],qs['fields'](_0x50b0ab[_0xbbac('0x41')][_0xbbac('0x45')]));_0x543fbe[_0xbbac('0x43')]=_0x543fbe[_0xbbac('0x43')][_0xbbac('0x46')]?_0x543fbe[_0xbbac('0x43')]:_0x129010[_0xbbac('0x40')];_0x543fbe['order']=qs[_0xbbac('0x4a')](_0x50b0ab[_0xbbac('0x41')][_0xbbac('0x4a')]);_0x543fbe['where']=qs[_0xbbac('0x42')](_[_0xbbac('0x4c')](_0x50b0ab['query'],_0x129010[_0xbbac('0x42')]));if(_0x50b0ab['query'][_0xbbac('0x4d')]){_0x543fbe[_0xbbac('0x4b')]=_['merge'](_0x543fbe['where'],{'$or':_[_0xbbac('0x3b')](_0x543fbe[_0xbbac('0x43')],function(_0x3930f8){var _0x30999a={};_0x30999a[_0x3930f8]={'$like':'%'+_0x50b0ab['query'][_0xbbac('0x4d')]+'%'};return _0x30999a;})});}_0x543fbe=_[_0xbbac('0x4e')]({},_0x543fbe,_0x50b0ab[_0xbbac('0x4f')]);return _0x3c6104['getAgents'](_0x543fbe);}})[_0xbbac('0x1e')](function(_0x44ea0c){if(_0x44ea0c){_0x4f4704=_0x44ea0c[_0xbbac('0x46')];if(!_0x50b0ab[_0xbbac('0x41')]['hasOwnProperty'](_0xbbac('0x48'))){_0x543fbe[_0xbbac('0x2d')]=qs[_0xbbac('0x2d')](_0x50b0ab[_0xbbac('0x41')]['limit']);_0x543fbe[_0xbbac('0x2b')]=qs['offset'](_0x50b0ab['query'][_0xbbac('0x2b')]);}return _0x3c6104[_0xbbac('0x96')](_0x543fbe);}})[_0xbbac('0x1e')](function(_0x298b40){if(_0x298b40){return _0x298b40?{'count':_0x4f4704,'rows':_0x298b40}:null;}})['then'](respondWithResult(_0x352ce0,null))[_0xbbac('0x28')](handleError(_0x352ce0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e83dc3d..49354d7 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 _0x831e=['exports','events','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x831e,0xb0));var _0xe831=function(_0x164867,_0x12c1ac){_0x164867=_0x164867-0x0;var _0x2ae0bf=_0x831e[_0x164867];return _0x2ae0bf;};'use strict';var EventEmitter=require(_0xe831('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe831('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe831('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe831('0x3'),'afterDestroy':_0xe831('0x4')};function emitEvent(_0x21a2b4){return function(_0x32c48f,_0x39fc48,_0x22a250){ChatQueueEvents[_0xe831('0x5')](_0x21a2b4+':'+_0x32c48f['id'],_0x32c48f);ChatQueueEvents[_0xe831('0x5')](_0x21a2b4,_0x32c48f);_0x22a250(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xe831('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xf2b0=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x1193ea,_0xc04ef0){var _0x5e4000=function(_0xe18bde){while(--_0xe18bde){_0x1193ea['push'](_0x1193ea['shift']());}};_0x5e4000(++_0xc04ef0);}(_0xf2b0,0x83));var _0x0f2b=function(_0x5197ec,_0x3b44fb){_0x5197ec=_0x5197ec-0x0;var _0x4bfbc5=_0xf2b0[_0x5197ec];return _0x4bfbc5;};'use strict';var EventEmitter=require(_0x0f2b('0x0'));var ChatQueue=require(_0x0f2b('0x1'))['db'][_0x0f2b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0f2b('0x3')](0x0);var events={'afterCreate':_0x0f2b('0x4'),'afterUpdate':'update','afterDestroy':_0x0f2b('0x5')};function emitEvent(_0x3e4270){return function(_0x29986b,_0x2c482d,_0x1d0cdf){ChatQueueEvents['emit'](_0x3e4270+':'+_0x29986b['id'],_0x29986b);ChatQueueEvents[_0x0f2b('0x6')](_0x3e4270,_0x29986b);_0x1d0cdf(null);};}for(var e in events){if(events[_0x0f2b('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x0f2b('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cb7597c..b18e7fc 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 _0x916e=['request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x485968,_0x1a878e){var _0x3f55a7=function(_0x576133){while(--_0x576133){_0x485968['push'](_0x485968['shift']());}};_0x3f55a7(++_0x1a878e);}(_0x916e,0xc7));var _0xe916=function(_0x1b7620,_0x843b31){_0x1b7620=_0x1b7620-0x0;var _0x35b000=_0x916e[_0x1b7620];return _0x35b000;};'use strict';var _=require(_0xe916('0x0'));var util=require(_0xe916('0x1'));var logger=require(_0xe916('0x2'))(_0xe916('0x3'));var moment=require('moment');var BPromise=require(_0xe916('0x4'));var rp=require(_0xe916('0x5'));var fs=require('fs');var path=require(_0xe916('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe916('0x7'));module[_0xe916('0x8')]=function(_0x1b9bc2,_0x596d23){return _0x1b9bc2[_0xe916('0x9')](_0xe916('0xa'),attributes,{'tableName':_0xe916('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x098e=['../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x462a5c,_0x2a9699){var _0x108474=function(_0x28b206){while(--_0x28b206){_0x462a5c['push'](_0x462a5c['shift']());}};_0x108474(++_0x2a9699);}(_0x098e,0x1b2));var _0xe098=function(_0x34b704,_0x4a58a6){_0x34b704=_0x34b704-0x0;var _0x1bb64a=_0x098e[_0x34b704];return _0x1bb64a;};'use strict';var _=require(_0xe098('0x0'));var util=require(_0xe098('0x1'));var logger=require(_0xe098('0x2'))(_0xe098('0x3'));var moment=require(_0xe098('0x4'));var BPromise=require(_0xe098('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe098('0x6'));var rimraf=require(_0xe098('0x7'));var config=require(_0xe098('0x8'));var attributes=require('./chatQueue.attributes');module[_0xe098('0x9')]=function(_0xebc4a0,_0x3582d9){return _0xebc4a0[_0xe098('0xa')](_0xe098('0xb'),attributes,{'tableName':_0xe098('0xc'),'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 56c31be..47ec1b7 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 _0xd1f1=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x184ff,_0x512f37){var _0x35b4d5=function(_0x53fea4){while(--_0x53fea4){_0x184ff['push'](_0x184ff['shift']());}};_0x35b4d5(++_0x512f37);}(_0xd1f1,0x84));var _0x1d1f=function(_0x667ff8,_0x59e7df){_0x667ff8=_0x667ff8-0x0;var _0x2ddfc7=_0xd1f1[_0x667ff8];return _0x2ddfc7;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require(_0x1d1f('0x2'));var BPromise=require(_0x1d1f('0x3'));var rs=require(_0x1d1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))('rpc');var config=require(_0x1d1f('0x8'));var jayson=require(_0x1d1f('0x9'));var client=jayson['client'][_0x1d1f('0xa')]({'port':0x232a});config['redis']=_[_0x1d1f('0xb')](config[_0x1d1f('0xc')],{'host':_0x1d1f('0xd'),'port':0x18eb});var socket=require(_0x1d1f('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x6de58c,_0x2bc44f,_0xff11b6){return new BPromise(function(_0x390baf,_0x5485c9){return client[_0x1d1f('0xf')](_0x6de58c,_0xff11b6)[_0x1d1f('0x10')](function(_0x17a312){logger[_0x1d1f('0x11')](_0x1d1f('0x12'),_0x2bc44f,_0x1d1f('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2bc44f,'request\x20sent',JSON[_0x1d1f('0x14')](_0x17a312));if(_0x17a312[_0x1d1f('0x15')]){if(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x16')]===0x1f4){logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);return _0x5485c9(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);}logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x17a312[_0x1d1f('0x15')]['message']);return _0x390baf(_0x17a312[_0x1d1f('0x15')][_0x1d1f('0x17')]);}else{logger[_0x1d1f('0x11')](_0x1d1f('0x12'),_0x2bc44f,_0x1d1f('0x13'));_0x390baf(_0x17a312[_0x1d1f('0x18')][_0x1d1f('0x17')]);}})[_0x1d1f('0x19')](function(_0x2ee2dc){logger[_0x1d1f('0x15')](_0x1d1f('0x12'),_0x2bc44f,_0x2ee2dc);_0x5485c9(_0x2ee2dc);});});}exports[_0x1d1f('0x1a')]=function(_0x1a0742){var _0x131bc4=this;return new Promise(function(_0x1c6db5,_0x413c87){return db[_0x1d1f('0x1b')][_0x1d1f('0x1c')]({'raw':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742['options'][_0x1d1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742['options'][_0x1d1f('0x1f')]||null:null,'attributes':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')][_0x1d1f('0x20')]||null:null,'limit':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')]['limit']||null:null,'include':_0x1a0742[_0x1d1f('0x1d')]?_0x1a0742[_0x1d1f('0x1d')][_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x1a0742[_0x1d1f('0x1d')]['include'],function(_0x43a03a){return{'model':db[_0x43a03a[_0x1d1f('0x23')]],'as':_0x43a03a['as'],'attributes':_0x43a03a['attributes'],'include':_0x43a03a['include']?_[_0x1d1f('0x22')](_0x43a03a[_0x1d1f('0x21')],function(_0x41bd80){return{'model':db[_0x41bd80[_0x1d1f('0x23')]],'as':_0x41bd80['as'],'attributes':_0x41bd80['attributes'],'include':_0x41bd80['include']?_[_0x1d1f('0x22')](_0x41bd80[_0x1d1f('0x21')],function(_0x2b99e3){return{'model':db[_0x2b99e3[_0x1d1f('0x23')]],'as':_0x2b99e3['as'],'attributes':_0x2b99e3[_0x1d1f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x10')](function(_0x5efc5c){logger['info']('GetChatQueue',_0x1a0742);logger[_0x1d1f('0x24')](_0x1d1f('0x1a'),_0x1a0742,JSON[_0x1d1f('0x14')](_0x5efc5c));_0x1c6db5(_0x5efc5c);})['catch'](function(_0x2e0192){logger[_0x1d1f('0x15')]('GetChatQueue',_0x2e0192[_0x1d1f('0x17')],_0x1a0742);_0x413c87(_0x131bc4[_0x1d1f('0x15')](0x1f4,_0x2e0192[_0x1d1f('0x17')]));});});};exports[_0x1d1f('0x25')]=function(_0x4503a3){var _0x44406f=this;return new Promise(function(_0x47178b,_0x456314){return db[_0x1d1f('0x1b')][_0x1d1f('0x26')]({'raw':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x1f')]||null:null,'attributes':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x20')]||null:null,'include':_0x4503a3[_0x1d1f('0x1d')]?_0x4503a3[_0x1d1f('0x1d')][_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x4503a3['options'][_0x1d1f('0x21')],function(_0x2211b9){return{'model':db[_0x2211b9[_0x1d1f('0x23')]],'as':_0x2211b9['as'],'attributes':_0x2211b9[_0x1d1f('0x20')],'include':_0x2211b9['include']?_['map'](_0x2211b9[_0x1d1f('0x21')],function(_0x35dcd7){return{'model':db[_0x35dcd7[_0x1d1f('0x23')]],'as':_0x35dcd7['as'],'attributes':_0x35dcd7[_0x1d1f('0x20')],'include':_0x35dcd7[_0x1d1f('0x21')]?_[_0x1d1f('0x22')](_0x35dcd7['include'],function(_0x1350cd){return{'model':db[_0x1350cd['model']],'as':_0x1350cd['as'],'attributes':_0x1350cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x10')](function(_0x1f4ffc){logger['info'](_0x1d1f('0x25'),_0x4503a3);logger[_0x1d1f('0x24')](_0x1d1f('0x25'),_0x4503a3,JSON['stringify'](_0x1f4ffc));_0x47178b(_0x1f4ffc);})[_0x1d1f('0x19')](function(_0x490c13){logger[_0x1d1f('0x15')]('ShowChatQueue',_0x490c13[_0x1d1f('0x17')],_0x4503a3);_0x456314(_0x44406f[_0x1d1f('0x15')](0x1f4,_0x490c13['message']));});});}; \ No newline at end of file +var _0x58c4=['message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0x58c4,0x135));var _0x458c=function(_0x26846f,_0x551a9f){_0x26846f=_0x26846f-0x0;var _0x5452af=_0x58c4[_0x26846f];return _0x5452af;};'use strict';var _=require(_0x458c('0x0'));var util=require('util');var moment=require(_0x458c('0x1'));var BPromise=require(_0x458c('0x2'));var rs=require(_0x458c('0x3'));var fs=require('fs');var Redis=require(_0x458c('0x4'));var db=require(_0x458c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x458c('0x6'));var config=require(_0x458c('0x7'));var jayson=require(_0x458c('0x8'));var client=jayson[_0x458c('0x9')][_0x458c('0xa')]({'port':0x232a});config[_0x458c('0xb')]=_[_0x458c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x458c('0xd'))(new Redis(config[_0x458c('0xb')]));require(_0x458c('0xe'))['register'](socket);function respondWithRpcPromise(_0x59e641,_0x18bf18,_0x5933f3){return new BPromise(function(_0x4e8fcc,_0x53d9b6){return client[_0x458c('0xf')](_0x59e641,_0x5933f3)[_0x458c('0x10')](function(_0x22b56d){logger[_0x458c('0x11')](_0x458c('0x12'),_0x18bf18,_0x458c('0x13'));logger[_0x458c('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x18bf18,_0x458c('0x13'),JSON[_0x458c('0x15')](_0x22b56d));if(_0x22b56d['error']){if(_0x22b56d[_0x458c('0x16')][_0x458c('0x17')]===0x1f4){logger['error'](_0x458c('0x12'),_0x18bf18,_0x22b56d[_0x458c('0x16')][_0x458c('0x18')]);return _0x53d9b6(_0x22b56d['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x18bf18,_0x22b56d['error']['message']);return _0x4e8fcc(_0x22b56d[_0x458c('0x16')]['message']);}else{logger[_0x458c('0x11')](_0x458c('0x12'),_0x18bf18,_0x458c('0x13'));_0x4e8fcc(_0x22b56d['result']['message']);}})[_0x458c('0x19')](function(_0x4347f4){logger[_0x458c('0x16')]('ChatQueue,\x20%s,\x20%s',_0x18bf18,_0x4347f4);_0x53d9b6(_0x4347f4);});});}exports[_0x458c('0x1a')]=function(_0x23c119){var _0x3ed372=this;return new Promise(function(_0x49b7aa,_0x7b4338){return db[_0x458c('0x1b')][_0x458c('0x1c')]({'raw':_0x23c119[_0x458c('0x1d')]?_0x23c119[_0x458c('0x1d')][_0x458c('0x1e')]===undefined?!![]:![]:!![],'where':_0x23c119[_0x458c('0x1d')]?_0x23c119['options'][_0x458c('0x1f')]||null:null,'attributes':_0x23c119['options']?_0x23c119[_0x458c('0x1d')][_0x458c('0x20')]||null:null,'limit':_0x23c119['options']?_0x23c119[_0x458c('0x1d')]['limit']||null:null,'include':_0x23c119[_0x458c('0x1d')]?_0x23c119[_0x458c('0x1d')][_0x458c('0x21')]?_[_0x458c('0x22')](_0x23c119[_0x458c('0x1d')]['include'],function(_0x478662){return{'model':db[_0x478662[_0x458c('0x23')]],'as':_0x478662['as'],'attributes':_0x478662[_0x458c('0x20')],'include':_0x478662[_0x458c('0x21')]?_[_0x458c('0x22')](_0x478662[_0x458c('0x21')],function(_0xb3135e){return{'model':db[_0xb3135e[_0x458c('0x23')]],'as':_0xb3135e['as'],'attributes':_0xb3135e[_0x458c('0x20')],'include':_0xb3135e[_0x458c('0x21')]?_['map'](_0xb3135e[_0x458c('0x21')],function(_0x25a965){return{'model':db[_0x25a965['model']],'as':_0x25a965['as'],'attributes':_0x25a965['attributes']};}):[]};}):[]};}):[]:[]})[_0x458c('0x10')](function(_0x3f6755){logger[_0x458c('0x11')](_0x458c('0x1a'),_0x23c119);logger[_0x458c('0x14')]('GetChatQueue',_0x23c119,JSON[_0x458c('0x15')](_0x3f6755));_0x49b7aa(_0x3f6755);})[_0x458c('0x19')](function(_0xf7a600){logger['error']('GetChatQueue',_0xf7a600['message'],_0x23c119);_0x7b4338(_0x3ed372['error'](0x1f4,_0xf7a600[_0x458c('0x18')]));});});};exports[_0x458c('0x24')]=function(_0x201825){var _0x59341b=this;return new Promise(function(_0x194b2e,_0x5944d7){return db[_0x458c('0x1b')]['find']({'raw':_0x201825[_0x458c('0x1d')]?_0x201825[_0x458c('0x1d')][_0x458c('0x1e')]===undefined?!![]:![]:!![],'where':_0x201825[_0x458c('0x1d')]?_0x201825[_0x458c('0x1d')][_0x458c('0x1f')]||null:null,'attributes':_0x201825[_0x458c('0x1d')]?_0x201825[_0x458c('0x1d')]['attributes']||null:null,'include':_0x201825['options']?_0x201825[_0x458c('0x1d')][_0x458c('0x21')]?_[_0x458c('0x22')](_0x201825['options'][_0x458c('0x21')],function(_0x47fb56){return{'model':db[_0x47fb56[_0x458c('0x23')]],'as':_0x47fb56['as'],'attributes':_0x47fb56[_0x458c('0x20')],'include':_0x47fb56['include']?_[_0x458c('0x22')](_0x47fb56['include'],function(_0x1be5a3){return{'model':db[_0x1be5a3[_0x458c('0x23')]],'as':_0x1be5a3['as'],'attributes':_0x1be5a3['attributes'],'include':_0x1be5a3[_0x458c('0x21')]?_[_0x458c('0x22')](_0x1be5a3['include'],function(_0x31d71d){return{'model':db[_0x31d71d['model']],'as':_0x31d71d['as'],'attributes':_0x31d71d['attributes']};}):[]};}):[]};}):[]:[]})[_0x458c('0x10')](function(_0x3eca4d){logger[_0x458c('0x11')](_0x458c('0x24'),_0x201825);logger[_0x458c('0x14')]('ShowChatQueue',_0x201825,JSON[_0x458c('0x15')](_0x3eca4d));_0x194b2e(_0x3eca4d);})[_0x458c('0x19')](function(_0x2c2726){logger[_0x458c('0x16')]('ShowChatQueue',_0x2c2726[_0x458c('0x18')],_0x201825);_0x5944d7(_0x59341b[_0x458c('0x16')](0x1f4,_0x2c2726[_0x458c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 2cf15d1..83fb368 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 _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x9bde,0xe1));var _0xe9bd=function(_0xca6dd1,_0x383973){_0xca6dd1=_0xca6dd1-0x0;var _0x30b7bc=_0x9bde[_0xca6dd1];return _0x30b7bc;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file +var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x4f6960,_0x2bea9e){var _0x46f0ad=function(_0x5e671d){while(--_0x5e671d){_0x4f6960['push'](_0x4f6960['shift']());}};_0x46f0ad(++_0x2bea9e);}(_0x032e,0x124));var _0xe032=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x032e[_0x110c3d];return _0x226d67;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 341290b..4fa649d 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4e0871,_0x48a07f){var _0x5a72b0=function(_0x4f54ae){while(--_0x4f54ae){_0x4e0871['push'](_0x4e0871['shift']());}};_0x5a72b0(++_0x48a07f);}(_0x814b,0x1a2));var _0xb814=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x814b[_0x502598];return _0xbdee21;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x36fa90,_0x2807ed){var _0xdd8d9a=function(_0x127a53){while(--_0x127a53){_0x36fa90['push'](_0x36fa90['shift']());}};_0xdd8d9a(++_0x2807ed);}(_0xe14b,0x93));var _0xbe14=function(_0x5d0c58,_0x565435){_0x5d0c58=_0x5d0c58-0x0;var _0x312855=_0xe14b[_0x5d0c58];return _0x312855;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5e369a4..a8300b5 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 _0x3a00=['sequelize','exports','STRING','DATE'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0x3a00,0xfc));var _0x03a0=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0x3a00[_0x1f1511];return _0x1d9ab8;};'use strict';var moment=require('moment');var Sequelize=require(_0x03a0('0x0'));module[_0x03a0('0x1')]={'uniqueid':{'type':Sequelize[_0x03a0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x03a0('0x3')]},'leaveAt':{'type':Sequelize[_0x03a0('0x3')]},'acceptAt':{'type':Sequelize[_0x03a0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x03a0('0x2')]}}; \ No newline at end of file +var _0x4070=['STRING','DATE','moment','sequelize','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4070,0x1d3));var _0x0407=function(_0x23ef3f,_0x2b6b94){_0x23ef3f=_0x23ef3f-0x0;var _0x183993=_0x4070[_0x23ef3f];return _0x183993;};'use strict';var moment=require(_0x0407('0x0'));var Sequelize=require(_0x0407('0x1'));module[_0x0407('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0407('0x3')]},'joinAt':{'type':Sequelize[_0x0407('0x4')]},'leaveAt':{'type':Sequelize[_0x0407('0x4')]},'acceptAt':{'type':Sequelize[_0x0407('0x4')]},'exitAt':{'type':Sequelize[_0x0407('0x4')]},'reason':{'type':Sequelize[_0x0407('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5907b0b..e8e541d 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 _0x8c46=['filter','VIRTUAL','merge','options','include','ChatQueueReport','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0x4be325,_0x13dd05){var _0x5cdfd0=function(_0x3feb99){while(--_0x3feb99){_0x4be325['push'](_0x4be325['shift']());}};_0x5cdfd0(++_0x13dd05);}(_0x8c46,0x171));var _0x68c4=function(_0x3b76ae,_0x1f110e){_0x3b76ae=_0x3b76ae-0x0;var _0x11ab0f=_0x8c46[_0x3b76ae];return _0x11ab0f;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['ChatQueueReport'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['ChatQueueReport']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));}; \ No newline at end of file +var _0xa280=['then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ChatQueueReport','include','findAll','catch','show','params','includeAll','merge','options','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','update'];(function(_0x214648,_0x16265d){var _0x520e6f=function(_0x3af627){while(--_0x3af627){_0x214648['push'](_0x214648['shift']());}};_0x520e6f(++_0x16265d);}(_0xa280,0xc4));var _0x0a28=function(_0x3943a4,_0x54df31){_0x3943a4=_0x3943a4-0x0;var _0x17d655=_0xa280[_0x3943a4];return _0x17d655;};'use strict';var emlformat=require(_0x0a28('0x0'));var rimraf=require(_0x0a28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a28('0x2'));var rp=require(_0x0a28('0x3'));var moment=require(_0x0a28('0x4'));var BPromise=require(_0x0a28('0x5'));var Mustache=require(_0x0a28('0x6'));var util=require(_0x0a28('0x7'));var path=require(_0x0a28('0x8'));var sox=require(_0x0a28('0x9'));var csv=require(_0x0a28('0xa'));var ejs=require(_0x0a28('0xb'));var fs=require('fs');var fs_extra=require(_0x0a28('0xc'));var _=require(_0x0a28('0xd'));var squel=require(_0x0a28('0xe'));var crypto=require(_0x0a28('0xf'));var jsforce=require(_0x0a28('0x10'));var deskjs=require(_0x0a28('0x11'));var toCsv=require(_0x0a28('0xa'));var querystring=require(_0x0a28('0x12'));var Papa=require('papaparse');var Redis=require(_0x0a28('0x13'));var authService=require(_0x0a28('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0a28('0x15'));var hardwareService=require(_0x0a28('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0a28('0x17'));var config=require(_0x0a28('0x18'));var licenseUtil=require(_0x0a28('0x19'));var db=require(_0x0a28('0x1a'))['db'];function respondWithStatusCode(_0x17942d,_0x185f0e){_0x185f0e=_0x185f0e||0xcc;return function(_0x42588b){if(_0x42588b){return _0x17942d['sendStatus'](_0x185f0e);}return _0x17942d[_0x0a28('0x1b')](_0x185f0e)[_0x0a28('0x1c')]();};}function respondWithResult(_0x5e94cf,_0x260f51){_0x260f51=_0x260f51||0xc8;return function(_0x10225c){if(_0x10225c){return _0x5e94cf[_0x0a28('0x1b')](_0x260f51)[_0x0a28('0x1d')](_0x10225c);}};}function respondWithFilteredResult(_0x50c0a7,_0x4dc424){return function(_0x2bb8ff){if(_0x2bb8ff){var _0xf28728=typeof _0x4dc424[_0x0a28('0x1e')]==='undefined'&&typeof _0x4dc424[_0x0a28('0x1f')]===_0x0a28('0x20');var _0x120b12=_0x2bb8ff[_0x0a28('0x21')];var _0x54fcbe=_0xf28728?0x0:_0x4dc424['offset'];var _0x984b5e=_0xf28728?_0x2bb8ff[_0x0a28('0x21')]:_0x4dc424[_0x0a28('0x1e')]+_0x4dc424['limit'];var _0x18ac23;if(_0x984b5e>=_0x120b12){_0x984b5e=_0x120b12;_0x18ac23=0xc8;}else{_0x18ac23=0xce;}_0x50c0a7[_0x0a28('0x1b')](_0x18ac23);return _0x50c0a7[_0x0a28('0x22')]('Content-Range',_0x54fcbe+'-'+_0x984b5e+'/'+_0x120b12)[_0x0a28('0x1d')](_0x2bb8ff);}return null;};}function patchUpdates(_0x709adc){return function(_0x277eb0){try{jsonpatch['apply'](_0x277eb0,_0x709adc,!![]);}catch(_0x137973){return BPromise[_0x0a28('0x23')](_0x137973);}return _0x277eb0[_0x0a28('0x24')]();};}function saveUpdates(_0x26c8ac,_0x2bc1e7){return function(_0x1d9f30){if(_0x1d9f30){return _0x1d9f30[_0x0a28('0x25')](_0x26c8ac)[_0x0a28('0x26')](function(_0x5bc174){return _0x5bc174;});}return null;};}function removeEntity(_0x6ea86d,_0x405cbb){return function(_0x5b4315){if(_0x5b4315){return _0x5b4315['destroy']()['then'](function(){_0x6ea86d[_0x0a28('0x1b')](0xcc)[_0x0a28('0x1c')]();});}};}function handleEntityNotFound(_0x1be0a8,_0x44be23){return function(_0x356864){if(!_0x356864){_0x1be0a8[_0x0a28('0x27')](0x194);}return _0x356864;};}function handleError(_0x5f138e,_0x5f0fe9){_0x5f0fe9=_0x5f0fe9||0x1f4;return function(_0x239556){logger['error'](_0x239556['stack']);if(_0x239556[_0x0a28('0x28')]){delete _0x239556[_0x0a28('0x28')];}_0x5f138e[_0x0a28('0x1b')](_0x5f0fe9)[_0x0a28('0x29')](_0x239556);};}exports[_0x0a28('0x2a')]=function(_0x3745b2,_0x431cad){var _0x5c5114={},_0x4edd29={},_0x14cd0d={'count':0x0,'rows':[]};var _0x4ce49=_[_0x0a28('0x2b')](db['ChatQueueReport'][_0x0a28('0x2c')],function(_0x5e884f){return{'name':_0x5e884f[_0x0a28('0x2d')],'type':_0x5e884f[_0x0a28('0x2e')][_0x0a28('0x2f')]};});_0x4edd29[_0x0a28('0x30')]=_['map'](_0x4ce49,_0x0a28('0x28'));_0x4edd29['query']=_[_0x0a28('0x31')](_0x3745b2['query']);_0x4edd29[_0x0a28('0x32')]=_[_0x0a28('0x33')](_0x4edd29['model'],_0x4edd29[_0x0a28('0x34')]);_0x5c5114[_0x0a28('0x35')]=_['intersection'](_0x4edd29[_0x0a28('0x30')],qs[_0x0a28('0x36')](_0x3745b2[_0x0a28('0x34')][_0x0a28('0x36')]));_0x5c5114['attributes']=_0x5c5114[_0x0a28('0x35')][_0x0a28('0x37')]?_0x5c5114[_0x0a28('0x35')]:_0x4edd29[_0x0a28('0x30')];if(!_0x3745b2[_0x0a28('0x34')][_0x0a28('0x38')](_0x0a28('0x39'))){_0x5c5114['limit']=qs[_0x0a28('0x1f')](_0x3745b2[_0x0a28('0x34')][_0x0a28('0x1f')]);_0x5c5114[_0x0a28('0x1e')]=qs[_0x0a28('0x1e')](_0x3745b2['query'][_0x0a28('0x1e')]);}_0x5c5114[_0x0a28('0x3a')]=qs[_0x0a28('0x3b')](_0x3745b2[_0x0a28('0x34')][_0x0a28('0x3b')]);_0x5c5114[_0x0a28('0x3c')]=qs[_0x0a28('0x32')](_[_0x0a28('0x3d')](_0x3745b2[_0x0a28('0x34')],_0x4edd29[_0x0a28('0x32')]),_0x4ce49);if(_0x3745b2[_0x0a28('0x34')][_0x0a28('0x3e')]){_0x5c5114['where']=_['merge'](_0x5c5114['where'],{'$or':_[_0x0a28('0x2b')](_0x4ce49,function(_0x45e878){if(_0x45e878[_0x0a28('0x2e')]!==_0x0a28('0x3f')){var _0x1689a9={};_0x1689a9[_0x45e878[_0x0a28('0x28')]]={'$like':'%'+_0x3745b2[_0x0a28('0x34')][_0x0a28('0x3e')]+'%'};return _0x1689a9;}})});}_0x5c5114=_['merge']({},_0x5c5114,_0x3745b2['options']);var _0x1823b9={'where':_0x5c5114[_0x0a28('0x3c')]};return db[_0x0a28('0x40')][_0x0a28('0x21')](_0x1823b9)[_0x0a28('0x26')](function(_0x1fd095){_0x14cd0d[_0x0a28('0x21')]=_0x1fd095;if(_0x3745b2[_0x0a28('0x34')]['includeAll']){_0x5c5114[_0x0a28('0x41')]=[{'all':!![]}];}return db[_0x0a28('0x40')][_0x0a28('0x42')](_0x5c5114);})['then'](function(_0x21df7d){_0x14cd0d['rows']=_0x21df7d;return _0x14cd0d;})['then'](respondWithFilteredResult(_0x431cad,_0x5c5114))[_0x0a28('0x43')](handleError(_0x431cad,null));};exports[_0x0a28('0x44')]=function(_0x49ede6,_0xeff5d9){var _0x2a0c44={'raw':!![],'where':{'id':_0x49ede6[_0x0a28('0x45')]['id']}},_0x330ebf={};_0x330ebf[_0x0a28('0x30')]=_[_0x0a28('0x31')](db[_0x0a28('0x40')]['rawAttributes']);_0x330ebf[_0x0a28('0x34')]=_[_0x0a28('0x31')](_0x49ede6[_0x0a28('0x34')]);_0x330ebf[_0x0a28('0x32')]=_[_0x0a28('0x33')](_0x330ebf[_0x0a28('0x30')],_0x330ebf['query']);_0x2a0c44['attributes']=_[_0x0a28('0x33')](_0x330ebf['model'],qs[_0x0a28('0x36')](_0x49ede6[_0x0a28('0x34')]['fields']));_0x2a0c44[_0x0a28('0x35')]=_0x2a0c44['attributes'][_0x0a28('0x37')]?_0x2a0c44[_0x0a28('0x35')]:_0x330ebf[_0x0a28('0x30')];if(_0x49ede6[_0x0a28('0x34')][_0x0a28('0x46')]){_0x2a0c44[_0x0a28('0x41')]=[{'all':!![]}];}_0x2a0c44=_[_0x0a28('0x47')]({},_0x2a0c44,_0x49ede6[_0x0a28('0x48')]);return db[_0x0a28('0x40')][_0x0a28('0x49')](_0x2a0c44)[_0x0a28('0x26')](handleEntityNotFound(_0xeff5d9,null))[_0x0a28('0x26')](respondWithResult(_0xeff5d9,null))['catch'](handleError(_0xeff5d9,null));};exports[_0x0a28('0x4a')]=function(_0x4da344,_0x43b1d9){return db[_0x0a28('0x40')][_0x0a28('0x4a')](_0x4da344[_0x0a28('0x4b')],{})[_0x0a28('0x26')](respondWithResult(_0x43b1d9,0xc9))['catch'](handleError(_0x43b1d9,null));};exports[_0x0a28('0x25')]=function(_0x501e43,_0x7445a1){if(_0x501e43[_0x0a28('0x4b')]['id']){delete _0x501e43[_0x0a28('0x4b')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x501e43[_0x0a28('0x45')]['id']}})[_0x0a28('0x26')](handleEntityNotFound(_0x7445a1,null))[_0x0a28('0x26')](saveUpdates(_0x501e43[_0x0a28('0x4b')],null))[_0x0a28('0x26')](respondWithResult(_0x7445a1,null))[_0x0a28('0x43')](handleError(_0x7445a1,null));};exports[_0x0a28('0x4c')]=function(_0x79ab4d,_0x5cbdae){return db[_0x0a28('0x40')][_0x0a28('0x49')]({'where':{'id':_0x79ab4d[_0x0a28('0x45')]['id']}})[_0x0a28('0x26')](handleEntityNotFound(_0x5cbdae,null))[_0x0a28('0x26')](removeEntity(_0x5cbdae,null))[_0x0a28('0x43')](handleError(_0x5cbdae,null));};exports[_0x0a28('0x4d')]=function(_0x2ff7d1,_0x14a3ba){return db[_0x0a28('0x40')][_0x0a28('0x4d')]()[_0x0a28('0x26')](respondWithResult(_0x14a3ba,null))[_0x0a28('0x43')](handleError(_0x14a3ba,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6ba259c..fb172a1 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c1ade,_0xaa1212){_0x5c1ade=_0x5c1ade-0x0;var _0x4980b4=_0xb10b[_0x5c1ade];return _0x4980b4;};'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 +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x528342,_0x17a981){var _0x27dd91=function(_0x20bed6){while(--_0x20bed6){_0x528342['push'](_0x528342['shift']());}};_0x27dd91(++_0x17a981);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a80f6,_0x3d43ad){_0x4a80f6=_0x4a80f6-0x0;var _0x5bc762=_0xb10b[_0x4a80f6];return _0x5bc762;};'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 758a926..8d49bdf 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 _0x026b=['body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x026b,0x17d));var _0xb026=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x026b[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0xb026('0x0'));var util=require(_0xb026('0x1'));var moment=require(_0xb026('0x2'));var BPromise=require(_0xb026('0x3'));var rs=require(_0xb026('0x4'));var fs=require('fs');var Redis=require(_0xb026('0x5'));var db=require(_0xb026('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb026('0x7'))(_0xb026('0x8'));var config=require(_0xb026('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb026('0xa')][_0xb026('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a3dd3,_0x51cc4d,_0x27e173){return new BPromise(function(_0xc37ac6,_0x358fd6){return client[_0xb026('0xc')](_0x4a3dd3,_0x27e173)[_0xb026('0xd')](function(_0x198cc3){logger[_0xb026('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'));logger[_0xb026('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'),JSON[_0xb026('0x11')](_0x198cc3));if(_0x198cc3[_0xb026('0x12')]){if(_0x198cc3['error'][_0xb026('0x13')]===0x1f4){logger[_0xb026('0x12')](_0xb026('0x14'),_0x51cc4d,_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);return _0x358fd6(_0x198cc3['error']['message']);}logger['error'](_0xb026('0x14'),_0x51cc4d,_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);return _0xc37ac6(_0x198cc3[_0xb026('0x12')][_0xb026('0x15')]);}else{logger[_0xb026('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x51cc4d,_0xb026('0xf'));_0xc37ac6(_0x198cc3[_0xb026('0x16')][_0xb026('0x15')]);}})[_0xb026('0x17')](function(_0x21a8ce){logger[_0xb026('0x12')](_0xb026('0x14'),_0x51cc4d,_0x21a8ce);_0x358fd6(_0x21a8ce);});});}exports[_0xb026('0x18')]=function(_0x1fdf31){var _0x293e80=this;return new Promise(function(_0x105a4d,_0x1016e5){return db[_0xb026('0x19')][_0xb026('0x1a')](_0x1fdf31[_0xb026('0x1b')],{'raw':_0x1fdf31['options']?_0x1fdf31[_0xb026('0x1c')][_0xb026('0x1d')]===undefined?!![]:![]:!![]})[_0xb026('0xd')](function(_0x29588d){logger[_0xb026('0xe')]('CreateChatQueueReport',_0x1fdf31);logger[_0xb026('0x10')]('CreateChatQueueReport',_0x1fdf31,JSON[_0xb026('0x11')](_0x29588d));_0x105a4d(_0x29588d);})[_0xb026('0x17')](function(_0x652518){logger[_0xb026('0x12')](_0xb026('0x18'),_0x652518[_0xb026('0x15')],_0x1fdf31);_0x1016e5(_0x293e80[_0xb026('0x12')](0x1f4,_0x652518['message']));});});};exports[_0xb026('0x1e')]=function(_0x194988){var _0x220622=this;return new Promise(function(_0x178d26,_0x2bff89){return db['ChatQueueReport'][_0xb026('0x1f')](_0x194988[_0xb026('0x1b')],{'raw':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x20')]||null:null,'attributes':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')]['attributes']||null:null,'limit':_0x194988[_0xb026('0x1c')]?_0x194988[_0xb026('0x1c')][_0xb026('0x21')]||null:null})[_0xb026('0xd')](function(_0x402e24){logger[_0xb026('0xe')](_0xb026('0x1e'),_0x194988);logger[_0xb026('0x10')](_0xb026('0x1e'),_0x194988,JSON[_0xb026('0x11')](_0x402e24));_0x178d26(_0x402e24);})[_0xb026('0x17')](function(_0x31a5f3){logger['error'](_0xb026('0x1e'),_0x31a5f3[_0xb026('0x15')],_0x194988);_0x2bff89(_0x220622['error'](0x1f4,_0x31a5f3[_0xb026('0x15')]));});});}; \ No newline at end of file +var _0x353f=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','stringify','catch','UpdateChatQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info'];(function(_0x1bec0d,_0x338db4){var _0x49e3e3=function(_0x372c7a){while(--_0x372c7a){_0x1bec0d['push'](_0x1bec0d['shift']());}};_0x49e3e3(++_0x338db4);}(_0x353f,0xd2));var _0xf353=function(_0x1c3377,_0x28631d){_0x1c3377=_0x1c3377-0x0;var _0x4532d0=_0x353f[_0x1c3377];return _0x4532d0;};'use strict';var _=require(_0xf353('0x0'));var util=require(_0xf353('0x1'));var moment=require(_0xf353('0x2'));var BPromise=require(_0xf353('0x3'));var rs=require(_0xf353('0x4'));var fs=require('fs');var Redis=require(_0xf353('0x5'));var db=require(_0xf353('0x6'))['db'];var utils=require(_0xf353('0x7'));var logger=require(_0xf353('0x8'))(_0xf353('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf353('0xa')][_0xf353('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xef566e,_0x37b562,_0x5044d9){return new BPromise(function(_0x3cea91,_0x36d563){return client[_0xf353('0xc')](_0xef566e,_0x5044d9)['then'](function(_0x53c77d){logger[_0xf353('0xd')](_0xf353('0xe'),_0x37b562,_0xf353('0xf'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x37b562,_0xf353('0xf'),JSON['stringify'](_0x53c77d));if(_0x53c77d[_0xf353('0x10')]){if(_0x53c77d['error']['code']===0x1f4){logger[_0xf353('0x10')](_0xf353('0xe'),_0x37b562,_0x53c77d['error']['message']);return _0x36d563(_0x53c77d[_0xf353('0x10')][_0xf353('0x11')]);}logger['error'](_0xf353('0xe'),_0x37b562,_0x53c77d['error'][_0xf353('0x11')]);return _0x3cea91(_0x53c77d[_0xf353('0x10')]['message']);}else{logger[_0xf353('0xd')](_0xf353('0xe'),_0x37b562,'request\x20sent');_0x3cea91(_0x53c77d[_0xf353('0x12')][_0xf353('0x11')]);}})['catch'](function(_0x498c8d){logger[_0xf353('0x10')](_0xf353('0xe'),_0x37b562,_0x498c8d);_0x36d563(_0x498c8d);});});}exports[_0xf353('0x13')]=function(_0x29b841){var _0x213e07=this;return new Promise(function(_0x556130,_0x179293){return db[_0xf353('0x14')][_0xf353('0x15')](_0x29b841[_0xf353('0x16')],{'raw':_0x29b841['options']?_0x29b841[_0xf353('0x17')][_0xf353('0x18')]===undefined?!![]:![]:!![]})[_0xf353('0x19')](function(_0x4ab6af){logger[_0xf353('0xd')](_0xf353('0x13'),_0x29b841);logger[_0xf353('0x1a')]('CreateChatQueueReport',_0x29b841,JSON[_0xf353('0x1b')](_0x4ab6af));_0x556130(_0x4ab6af);})[_0xf353('0x1c')](function(_0x43af1e){logger[_0xf353('0x10')](_0xf353('0x13'),_0x43af1e['message'],_0x29b841);_0x179293(_0x213e07[_0xf353('0x10')](0x1f4,_0x43af1e[_0xf353('0x11')]));});});};exports[_0xf353('0x1d')]=function(_0x296ff3){var _0x4b44bc=this;return new Promise(function(_0x57f3e1,_0xc5e770){return db[_0xf353('0x14')]['update'](_0x296ff3[_0xf353('0x16')],{'raw':_0x296ff3[_0xf353('0x17')]?_0x296ff3['options'][_0xf353('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x296ff3[_0xf353('0x17')]?_0x296ff3[_0xf353('0x17')][_0xf353('0x1e')]||null:null,'attributes':_0x296ff3[_0xf353('0x17')]?_0x296ff3['options']['attributes']||null:null,'limit':_0x296ff3[_0xf353('0x17')]?_0x296ff3['options'][_0xf353('0x1f')]||null:null})['then'](function(_0x5c931f){logger['info'](_0xf353('0x1d'),_0x296ff3);logger[_0xf353('0x1a')](_0xf353('0x1d'),_0x296ff3,JSON[_0xf353('0x1b')](_0x5c931f));_0x57f3e1(_0x5c931f);})[_0xf353('0x1c')](function(_0x125f14){logger[_0xf353('0x10')](_0xf353('0x1d'),_0x125f14['message'],_0x296ff3);_0xc5e770(_0x4b44bc[_0xf353('0x10')](0x1f4,_0x125f14[_0xf353('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 34dcadb..a380c9c 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 _0xb620=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x333df5,_0x3c8b60){var _0x4ec1e3=function(_0x10d9f6){while(--_0x10d9f6){_0x333df5['push'](_0x333df5['shift']());}};_0x4ec1e3(++_0x3c8b60);}(_0xb620,0x88));var _0x0b62=function(_0x1438a5,_0x12ce4c){_0x1438a5=_0x1438a5-0x0;var _0x23ca93=_0xb620[_0x1438a5];return _0x23ca93;};'use strict';var multer=require(_0x0b62('0x0'));var util=require(_0x0b62('0x1'));var path=require(_0x0b62('0x2'));var timeout=require(_0x0b62('0x3'));var express=require(_0x0b62('0x4'));var router=express['Router']();var fs_extra=require(_0x0b62('0x5'));var auth=require(_0x0b62('0x6'));var interaction=require(_0x0b62('0x7'));var config=require(_0x0b62('0x8'));var controller=require(_0x0b62('0x9'));router[_0x0b62('0xa')]('/',auth[_0x0b62('0xb')](),controller[_0x0b62('0xc')]);router[_0x0b62('0xa')](_0x0b62('0xd'),auth['isAuthenticated'](),controller[_0x0b62('0xe')]);router[_0x0b62('0xa')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller[_0x0b62('0x10')]);router['post']('/',auth[_0x0b62('0xb')](),controller['create']);router[_0x0b62('0x11')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller['update']);router[_0x0b62('0x12')](_0x0b62('0xf'),auth[_0x0b62('0xb')](),controller[_0x0b62('0x13')]);module['exports']=router; \ No newline at end of file +var _0x71b3=['index','describe','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x3a4138,_0x7c6bd5){var _0x44b24e=function(_0x5eca1d){while(--_0x5eca1d){_0x3a4138['push'](_0x3a4138['shift']());}};_0x44b24e(++_0x7c6bd5);}(_0x71b3,0x1ae));var _0x371b=function(_0x514093,_0x5edc2a){_0x514093=_0x514093-0x0;var _0x4f3659=_0x71b3[_0x514093];return _0x4f3659;};'use strict';var multer=require('multer');var util=require(_0x371b('0x0'));var path=require(_0x371b('0x1'));var timeout=require(_0x371b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x371b('0x3'));var auth=require(_0x371b('0x4'));var interaction=require(_0x371b('0x5'));var config=require(_0x371b('0x6'));var controller=require(_0x371b('0x7'));router[_0x371b('0x8')]('/',auth[_0x371b('0x9')](),controller[_0x371b('0xa')]);router['get']('/describe',auth[_0x371b('0x9')](),controller[_0x371b('0xb')]);router[_0x371b('0x8')]('/:id',auth[_0x371b('0x9')](),controller[_0x371b('0xc')]);router[_0x371b('0xd')]('/',auth[_0x371b('0x9')](),controller['create']);router[_0x371b('0xe')](_0x371b('0xf'),auth[_0x371b('0x9')](),controller[_0x371b('0x10')]);router[_0x371b('0x11')](_0x371b('0xf'),auth['isAuthenticated'](),controller[_0x371b('0x12')]);module[_0x371b('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f1e8cbc..ea1779e 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xcf2777,_0x10f996){var _0x374a2a=function(_0x3fd7e2){while(--_0x3fd7e2){_0xcf2777['push'](_0xcf2777['shift']());}};_0x374a2a(++_0x10f996);}(_0x70e0,0x17b));var _0x070e=function(_0x433129,_0x1d68f7){_0x433129=_0x433129-0x0;var _0x24f6b6=_0x70e0[_0x433129];return _0x24f6b6;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x57e06b,_0x19a209){var _0x43cce0=function(_0x8e74d1){while(--_0x8e74d1){_0x57e06b['push'](_0x57e06b['shift']());}};_0x43cce0(++_0x19a209);}(_0x70e0,0x17b));var _0x070e=function(_0x8c457c,_0x36c74c){_0x8c457c=_0x8c457c-0x0;var _0x508f24=_0x70e0[_0x8c457c];return _0x508f24;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 5d46cc3..a84d812 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 _0xfe23=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','ChatTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xfe23,0x19a));var _0x3fe2=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xfe23[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fe2('0x0'));var zipdir=require(_0x3fe2('0x1'));var jsonpatch=require(_0x3fe2('0x2'));var rp=require(_0x3fe2('0x3'));var moment=require(_0x3fe2('0x4'));var BPromise=require(_0x3fe2('0x5'));var Mustache=require(_0x3fe2('0x6'));var util=require(_0x3fe2('0x7'));var path=require(_0x3fe2('0x8'));var sox=require(_0x3fe2('0x9'));var csv=require('to-csv');var ejs=require(_0x3fe2('0xa'));var fs=require('fs');var fs_extra=require(_0x3fe2('0xb'));var _=require('lodash');var squel=require(_0x3fe2('0xc'));var crypto=require(_0x3fe2('0xd'));var jsforce=require(_0x3fe2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fe2('0xf'));var Redis=require(_0x3fe2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3fe2('0x11'));var as=require(_0x3fe2('0x12'));var hardwareService=require(_0x3fe2('0x13'));var logger=require(_0x3fe2('0x14'))(_0x3fe2('0x15'));var utils=require('../../config/utils');var config=require(_0x3fe2('0x16'));var licenseUtil=require(_0x3fe2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x748954,_0x58bcbb){_0x58bcbb=_0x58bcbb||0xcc;return function(_0x5cde5d){if(_0x5cde5d){return _0x748954['sendStatus'](_0x58bcbb);}return _0x748954['status'](_0x58bcbb)[_0x3fe2('0x18')]();};}function respondWithResult(_0x4e04da,_0x359ad9){_0x359ad9=_0x359ad9||0xc8;return function(_0x3c000a){if(_0x3c000a){return _0x4e04da[_0x3fe2('0x19')](_0x359ad9)[_0x3fe2('0x1a')](_0x3c000a);}};}function respondWithFilteredResult(_0x5705b4,_0x1b7078){return function(_0x3719af){if(_0x3719af){var _0x18c37a=typeof _0x1b7078[_0x3fe2('0x1b')]==='undefined'&&typeof _0x1b7078[_0x3fe2('0x1c')]===_0x3fe2('0x1d');var _0x5216a9=_0x3719af[_0x3fe2('0x1e')];var _0x49c64f=_0x18c37a?0x0:_0x1b7078[_0x3fe2('0x1b')];var _0x573acc=_0x18c37a?_0x3719af[_0x3fe2('0x1e')]:_0x1b7078['offset']+_0x1b7078['limit'];var _0x2a0f22;if(_0x573acc>=_0x5216a9){_0x573acc=_0x5216a9;_0x2a0f22=0xc8;}else{_0x2a0f22=0xce;}_0x5705b4[_0x3fe2('0x19')](_0x2a0f22);return _0x5705b4[_0x3fe2('0x1f')](_0x3fe2('0x20'),_0x49c64f+'-'+_0x573acc+'/'+_0x5216a9)['json'](_0x3719af);}return null;};}function patchUpdates(_0x1be4dc){return function(_0x2a7682){try{jsonpatch[_0x3fe2('0x21')](_0x2a7682,_0x1be4dc,!![]);}catch(_0x1bc7dc){return BPromise[_0x3fe2('0x22')](_0x1bc7dc);}return _0x2a7682[_0x3fe2('0x23')]();};}function saveUpdates(_0x27c8b6,_0x1351da){return function(_0x32b538){if(_0x32b538){return _0x32b538[_0x3fe2('0x24')](_0x27c8b6)[_0x3fe2('0x25')](function(_0x381949){return _0x381949;});}return null;};}function removeEntity(_0x430b80,_0x4449fc){return function(_0x34479c){if(_0x34479c){return _0x34479c[_0x3fe2('0x26')]()[_0x3fe2('0x25')](function(){_0x430b80['status'](0xcc)[_0x3fe2('0x18')]();});}};}function handleEntityNotFound(_0xf86eb4,_0x53408f){return function(_0x48f8d8){if(!_0x48f8d8){_0xf86eb4[_0x3fe2('0x27')](0x194);}return _0x48f8d8;};}function handleError(_0x23e147,_0x4f2f46){_0x4f2f46=_0x4f2f46||0x1f4;return function(_0x5503fa){logger[_0x3fe2('0x28')](_0x5503fa['stack']);if(_0x5503fa[_0x3fe2('0x29')]){delete _0x5503fa[_0x3fe2('0x29')];}_0x23e147[_0x3fe2('0x19')](_0x4f2f46)['send'](_0x5503fa);};}exports['index']=function(_0x58def4,_0x46c773){var _0x22ce4a={},_0x36553f={},_0x3acf20={'count':0x0,'rows':[]};var _0x5692dc=_['map'](db[_0x3fe2('0x2a')][_0x3fe2('0x2b')],function(_0x15eb3c){return{'name':_0x15eb3c['fieldName'],'type':_0x15eb3c[_0x3fe2('0x2c')]['key']};});_0x36553f[_0x3fe2('0x2d')]=_['map'](_0x5692dc,_0x3fe2('0x29'));_0x36553f[_0x3fe2('0x2e')]=_[_0x3fe2('0x2f')](_0x58def4[_0x3fe2('0x2e')]);_0x36553f['filters']=_[_0x3fe2('0x30')](_0x36553f[_0x3fe2('0x2d')],_0x36553f['query']);_0x22ce4a[_0x3fe2('0x31')]=_['intersection'](_0x36553f[_0x3fe2('0x2d')],qs[_0x3fe2('0x32')](_0x58def4[_0x3fe2('0x2e')]['fields']));_0x22ce4a[_0x3fe2('0x31')]=_0x22ce4a[_0x3fe2('0x31')][_0x3fe2('0x33')]?_0x22ce4a[_0x3fe2('0x31')]:_0x36553f['model'];if(!_0x58def4['query'][_0x3fe2('0x34')](_0x3fe2('0x35'))){_0x22ce4a[_0x3fe2('0x1c')]=qs[_0x3fe2('0x1c')](_0x58def4['query'][_0x3fe2('0x1c')]);_0x22ce4a[_0x3fe2('0x1b')]=qs[_0x3fe2('0x1b')](_0x58def4[_0x3fe2('0x2e')][_0x3fe2('0x1b')]);}_0x22ce4a[_0x3fe2('0x36')]=qs[_0x3fe2('0x37')](_0x58def4['query'][_0x3fe2('0x37')]);_0x22ce4a['where']=qs[_0x3fe2('0x38')](_[_0x3fe2('0x39')](_0x58def4[_0x3fe2('0x2e')],_0x36553f[_0x3fe2('0x38')]),_0x5692dc);if(_0x58def4[_0x3fe2('0x2e')][_0x3fe2('0x3a')]){_0x22ce4a[_0x3fe2('0x3b')]=_['merge'](_0x22ce4a[_0x3fe2('0x3b')],{'$or':_[_0x3fe2('0x3c')](_0x5692dc,function(_0x4ef281){if(_0x4ef281['type']!=='VIRTUAL'){var _0x772110={};_0x772110[_0x4ef281[_0x3fe2('0x29')]]={'$like':'%'+_0x58def4['query'][_0x3fe2('0x3a')]+'%'};return _0x772110;}})});}_0x22ce4a=_[_0x3fe2('0x3d')]({},_0x22ce4a,_0x58def4[_0x3fe2('0x3e')]);var _0x1dd4ab={'where':_0x22ce4a[_0x3fe2('0x3b')]};return db[_0x3fe2('0x2a')][_0x3fe2('0x1e')](_0x1dd4ab)['then'](function(_0x5d7568){_0x3acf20[_0x3fe2('0x1e')]=_0x5d7568;if(_0x58def4['query'][_0x3fe2('0x3f')]){_0x22ce4a[_0x3fe2('0x40')]=[{'all':!![]}];}return db[_0x3fe2('0x2a')]['findAll'](_0x22ce4a);})['then'](function(_0x123f23){_0x3acf20[_0x3fe2('0x41')]=_0x123f23;return _0x3acf20;})['then'](respondWithFilteredResult(_0x46c773,_0x22ce4a))[_0x3fe2('0x42')](handleError(_0x46c773,null));};exports[_0x3fe2('0x43')]=function(_0x11ba47,_0x140a17){var _0x549e86={'raw':!![],'where':{'id':_0x11ba47[_0x3fe2('0x44')]['id']}},_0x5713a9={};_0x5713a9[_0x3fe2('0x2d')]=_[_0x3fe2('0x2f')](db[_0x3fe2('0x2a')][_0x3fe2('0x2b')]);_0x5713a9[_0x3fe2('0x2e')]=_[_0x3fe2('0x2f')](_0x11ba47['query']);_0x5713a9['filters']=_[_0x3fe2('0x30')](_0x5713a9[_0x3fe2('0x2d')],_0x5713a9['query']);_0x549e86[_0x3fe2('0x31')]=_[_0x3fe2('0x30')](_0x5713a9[_0x3fe2('0x2d')],qs[_0x3fe2('0x32')](_0x11ba47[_0x3fe2('0x2e')][_0x3fe2('0x32')]));_0x549e86[_0x3fe2('0x31')]=_0x549e86['attributes'][_0x3fe2('0x33')]?_0x549e86[_0x3fe2('0x31')]:_0x5713a9[_0x3fe2('0x2d')];if(_0x11ba47[_0x3fe2('0x2e')][_0x3fe2('0x3f')]){_0x549e86[_0x3fe2('0x40')]=[{'all':!![]}];}_0x549e86=_[_0x3fe2('0x3d')]({},_0x549e86,_0x11ba47[_0x3fe2('0x3e')]);return db[_0x3fe2('0x2a')][_0x3fe2('0x45')](_0x549e86)[_0x3fe2('0x25')](handleEntityNotFound(_0x140a17,null))[_0x3fe2('0x25')](respondWithResult(_0x140a17,null))[_0x3fe2('0x42')](handleError(_0x140a17,null));};exports['create']=function(_0x174cb9,_0x4c7803){return db[_0x3fe2('0x2a')][_0x3fe2('0x46')](_0x174cb9[_0x3fe2('0x47')],{})[_0x3fe2('0x25')](respondWithResult(_0x4c7803,0xc9))[_0x3fe2('0x42')](handleError(_0x4c7803,null));};exports[_0x3fe2('0x24')]=function(_0x31d662,_0x3e4cce){if(_0x31d662[_0x3fe2('0x47')]['id']){delete _0x31d662[_0x3fe2('0x47')]['id'];}return db['ChatTransferReport'][_0x3fe2('0x45')]({'where':{'id':_0x31d662[_0x3fe2('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e4cce,null))[_0x3fe2('0x25')](saveUpdates(_0x31d662[_0x3fe2('0x47')],null))[_0x3fe2('0x25')](respondWithResult(_0x3e4cce,null))[_0x3fe2('0x42')](handleError(_0x3e4cce,null));};exports['destroy']=function(_0x129c07,_0x54d3ef){return db['ChatTransferReport']['find']({'where':{'id':_0x129c07[_0x3fe2('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3ef,null))[_0x3fe2('0x25')](removeEntity(_0x54d3ef,null))[_0x3fe2('0x42')](handleError(_0x54d3ef,null));};exports[_0x3fe2('0x48')]=function(_0x11321d,_0x396b26){return db[_0x3fe2('0x2a')]['describe']()[_0x3fe2('0x25')](respondWithResult(_0x396b26,null))[_0x3fe2('0x42')](handleError(_0x396b26,null));}; \ No newline at end of file +var _0xad9f=['fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','send','map','ChatTransferReport','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs'];(function(_0xe89925,_0x124a3f){var _0x13d746=function(_0x415e8e){while(--_0x415e8e){_0xe89925['push'](_0xe89925['shift']());}};_0x13d746(++_0x124a3f);}(_0xad9f,0x1be));var _0xfad9=function(_0x52f394,_0x301b10){_0x52f394=_0x52f394-0x0;var _0x224728=_0xad9f[_0x52f394];return _0x224728;};'use strict';var emlformat=require(_0xfad9('0x0'));var rimraf=require(_0xfad9('0x1'));var zipdir=require(_0xfad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfad9('0x3'));var moment=require(_0xfad9('0x4'));var BPromise=require(_0xfad9('0x5'));var Mustache=require(_0xfad9('0x6'));var util=require('util');var path=require(_0xfad9('0x7'));var sox=require('sox');var csv=require(_0xfad9('0x8'));var ejs=require(_0xfad9('0x9'));var fs=require('fs');var fs_extra=require(_0xfad9('0xa'));var _=require(_0xfad9('0xb'));var squel=require(_0xfad9('0xc'));var crypto=require(_0xfad9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfad9('0x8'));var querystring=require(_0xfad9('0xe'));var Papa=require(_0xfad9('0xf'));var Redis=require(_0xfad9('0x10'));var authService=require(_0xfad9('0x11'));var qs=require(_0xfad9('0x12'));var as=require(_0xfad9('0x13'));var hardwareService=require(_0xfad9('0x14'));var logger=require('../../config/logger')(_0xfad9('0x15'));var utils=require(_0xfad9('0x16'));var config=require(_0xfad9('0x17'));var licenseUtil=require(_0xfad9('0x18'));var db=require(_0xfad9('0x19'))['db'];function respondWithStatusCode(_0x317a56,_0x8b3516){_0x8b3516=_0x8b3516||0xcc;return function(_0x7b01e8){if(_0x7b01e8){return _0x317a56[_0xfad9('0x1a')](_0x8b3516);}return _0x317a56[_0xfad9('0x1b')](_0x8b3516)[_0xfad9('0x1c')]();};}function respondWithResult(_0x491724,_0x1190da){_0x1190da=_0x1190da||0xc8;return function(_0x43916a){if(_0x43916a){return _0x491724[_0xfad9('0x1b')](_0x1190da)[_0xfad9('0x1d')](_0x43916a);}};}function respondWithFilteredResult(_0x16c3e9,_0x2b260b){return function(_0x567e45){if(_0x567e45){var _0x1d4d3e=typeof _0x2b260b['offset']===_0xfad9('0x1e')&&typeof _0x2b260b[_0xfad9('0x1f')]==='undefined';var _0x596b47=_0x567e45[_0xfad9('0x20')];var _0x18e48a=_0x1d4d3e?0x0:_0x2b260b[_0xfad9('0x21')];var _0xe2ffc0=_0x1d4d3e?_0x567e45[_0xfad9('0x20')]:_0x2b260b[_0xfad9('0x21')]+_0x2b260b[_0xfad9('0x1f')];var _0x3d508f;if(_0xe2ffc0>=_0x596b47){_0xe2ffc0=_0x596b47;_0x3d508f=0xc8;}else{_0x3d508f=0xce;}_0x16c3e9[_0xfad9('0x1b')](_0x3d508f);return _0x16c3e9[_0xfad9('0x22')]('Content-Range',_0x18e48a+'-'+_0xe2ffc0+'/'+_0x596b47)['json'](_0x567e45);}return null;};}function patchUpdates(_0x5d6a8f){return function(_0x18deea){try{jsonpatch[_0xfad9('0x23')](_0x18deea,_0x5d6a8f,!![]);}catch(_0x377977){return BPromise[_0xfad9('0x24')](_0x377977);}return _0x18deea[_0xfad9('0x25')]();};}function saveUpdates(_0x25c53c,_0x5c157f){return function(_0x46e091){if(_0x46e091){return _0x46e091[_0xfad9('0x26')](_0x25c53c)[_0xfad9('0x27')](function(_0xa970d2){return _0xa970d2;});}return null;};}function removeEntity(_0x15fdaa,_0x1371dc){return function(_0x3ba7ac){if(_0x3ba7ac){return _0x3ba7ac[_0xfad9('0x28')]()[_0xfad9('0x27')](function(){_0x15fdaa['status'](0xcc)[_0xfad9('0x1c')]();});}};}function handleEntityNotFound(_0x4781c2,_0x1e7c44){return function(_0x174ec9){if(!_0x174ec9){_0x4781c2[_0xfad9('0x1a')](0x194);}return _0x174ec9;};}function handleError(_0x51ee01,_0x22d24b){_0x22d24b=_0x22d24b||0x1f4;return function(_0x4beffe){logger[_0xfad9('0x29')](_0x4beffe[_0xfad9('0x2a')]);if(_0x4beffe['name']){delete _0x4beffe['name'];}_0x51ee01[_0xfad9('0x1b')](_0x22d24b)[_0xfad9('0x2b')](_0x4beffe);};}exports['index']=function(_0x38c053,_0x5e61c9){var _0x22b595={},_0x5a3ecb={},_0x1d2995={'count':0x0,'rows':[]};var _0x4957eb=_[_0xfad9('0x2c')](db[_0xfad9('0x2d')]['rawAttributes'],function(_0x1c72cd){return{'name':_0x1c72cd[_0xfad9('0x2e')],'type':_0x1c72cd[_0xfad9('0x2f')]['key']};});_0x5a3ecb[_0xfad9('0x30')]=_[_0xfad9('0x2c')](_0x4957eb,_0xfad9('0x31'));_0x5a3ecb[_0xfad9('0x32')]=_[_0xfad9('0x33')](_0x38c053['query']);_0x5a3ecb[_0xfad9('0x34')]=_[_0xfad9('0x35')](_0x5a3ecb[_0xfad9('0x30')],_0x5a3ecb[_0xfad9('0x32')]);_0x22b595['attributes']=_['intersection'](_0x5a3ecb[_0xfad9('0x30')],qs['fields'](_0x38c053[_0xfad9('0x32')][_0xfad9('0x36')]));_0x22b595[_0xfad9('0x37')]=_0x22b595[_0xfad9('0x37')][_0xfad9('0x38')]?_0x22b595[_0xfad9('0x37')]:_0x5a3ecb[_0xfad9('0x30')];if(!_0x38c053[_0xfad9('0x32')]['hasOwnProperty'](_0xfad9('0x39'))){_0x22b595[_0xfad9('0x1f')]=qs[_0xfad9('0x1f')](_0x38c053[_0xfad9('0x32')]['limit']);_0x22b595[_0xfad9('0x21')]=qs[_0xfad9('0x21')](_0x38c053['query']['offset']);}_0x22b595[_0xfad9('0x3a')]=qs['sort'](_0x38c053[_0xfad9('0x32')][_0xfad9('0x3b')]);_0x22b595['where']=qs[_0xfad9('0x34')](_['pick'](_0x38c053['query'],_0x5a3ecb[_0xfad9('0x34')]),_0x4957eb);if(_0x38c053[_0xfad9('0x32')][_0xfad9('0x3c')]){_0x22b595[_0xfad9('0x3d')]=_[_0xfad9('0x3e')](_0x22b595[_0xfad9('0x3d')],{'$or':_[_0xfad9('0x2c')](_0x4957eb,function(_0x116d3b){if(_0x116d3b[_0xfad9('0x2f')]!=='VIRTUAL'){var _0x316466={};_0x316466[_0x116d3b[_0xfad9('0x31')]]={'$like':'%'+_0x38c053[_0xfad9('0x32')][_0xfad9('0x3c')]+'%'};return _0x316466;}})});}_0x22b595=_[_0xfad9('0x3e')]({},_0x22b595,_0x38c053[_0xfad9('0x3f')]);var _0x40c871={'where':_0x22b595['where']};return db['ChatTransferReport'][_0xfad9('0x20')](_0x40c871)[_0xfad9('0x27')](function(_0x3e09b3){_0x1d2995[_0xfad9('0x20')]=_0x3e09b3;if(_0x38c053['query'][_0xfad9('0x40')]){_0x22b595[_0xfad9('0x41')]=[{'all':!![]}];}return db[_0xfad9('0x2d')][_0xfad9('0x42')](_0x22b595);})[_0xfad9('0x27')](function(_0x3a89e8){_0x1d2995[_0xfad9('0x43')]=_0x3a89e8;return _0x1d2995;})['then'](respondWithFilteredResult(_0x5e61c9,_0x22b595))[_0xfad9('0x44')](handleError(_0x5e61c9,null));};exports[_0xfad9('0x45')]=function(_0x46f5e7,_0x443129){var _0x43856c={'raw':!![],'where':{'id':_0x46f5e7['params']['id']}},_0x1963b5={};_0x1963b5[_0xfad9('0x30')]=_[_0xfad9('0x33')](db['ChatTransferReport'][_0xfad9('0x46')]);_0x1963b5[_0xfad9('0x32')]=_['keys'](_0x46f5e7['query']);_0x1963b5['filters']=_[_0xfad9('0x35')](_0x1963b5['model'],_0x1963b5['query']);_0x43856c[_0xfad9('0x37')]=_[_0xfad9('0x35')](_0x1963b5[_0xfad9('0x30')],qs['fields'](_0x46f5e7[_0xfad9('0x32')][_0xfad9('0x36')]));_0x43856c[_0xfad9('0x37')]=_0x43856c[_0xfad9('0x37')][_0xfad9('0x38')]?_0x43856c[_0xfad9('0x37')]:_0x1963b5['model'];if(_0x46f5e7[_0xfad9('0x32')][_0xfad9('0x40')]){_0x43856c[_0xfad9('0x41')]=[{'all':!![]}];}_0x43856c=_[_0xfad9('0x3e')]({},_0x43856c,_0x46f5e7[_0xfad9('0x3f')]);return db['ChatTransferReport'][_0xfad9('0x47')](_0x43856c)['then'](handleEntityNotFound(_0x443129,null))['then'](respondWithResult(_0x443129,null))[_0xfad9('0x44')](handleError(_0x443129,null));};exports[_0xfad9('0x48')]=function(_0x3a0bf3,_0xac7915){return db['ChatTransferReport'][_0xfad9('0x48')](_0x3a0bf3[_0xfad9('0x49')],{})['then'](respondWithResult(_0xac7915,0xc9))[_0xfad9('0x44')](handleError(_0xac7915,null));};exports['update']=function(_0x3c70e0,_0x230192){if(_0x3c70e0['body']['id']){delete _0x3c70e0['body']['id'];}return db[_0xfad9('0x2d')]['find']({'where':{'id':_0x3c70e0[_0xfad9('0x4a')]['id']}})[_0xfad9('0x27')](handleEntityNotFound(_0x230192,null))['then'](saveUpdates(_0x3c70e0[_0xfad9('0x49')],null))['then'](respondWithResult(_0x230192,null))[_0xfad9('0x44')](handleError(_0x230192,null));};exports[_0xfad9('0x28')]=function(_0xfb3464,_0x4ba598){return db[_0xfad9('0x2d')][_0xfad9('0x47')]({'where':{'id':_0xfb3464[_0xfad9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ba598,null))[_0xfad9('0x27')](removeEntity(_0x4ba598,null))[_0xfad9('0x44')](handleError(_0x4ba598,null));};exports[_0xfad9('0x4b')]=function(_0x59a2cf,_0x3e9354){return db['ChatTransferReport'][_0xfad9('0x4b')]()['then'](respondWithResult(_0x3e9354,null))[_0xfad9('0x44')](handleError(_0x3e9354,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 585376f..9f764e8 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 _0x2c7a=['lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x238957,_0x4147ea){var _0x1e4042=function(_0x58358f){while(--_0x58358f){_0x238957['push'](_0x238957['shift']());}};_0x1e4042(++_0x4147ea);}(_0x2c7a,0x179));var _0xa2c7=function(_0x12ec80,_0xb69070){_0x12ec80=_0x12ec80-0x0;var _0x1cf529=_0x2c7a[_0x12ec80];return _0x1cf529;};'use strict';var _=require(_0xa2c7('0x0'));var util=require(_0xa2c7('0x1'));var logger=require('../../config/logger')(_0xa2c7('0x2'));var moment=require(_0xa2c7('0x3'));var BPromise=require('bluebird');var rp=require(_0xa2c7('0x4'));var fs=require('fs');var path=require(_0xa2c7('0x5'));var rimraf=require(_0xa2c7('0x6'));var config=require('../../config/environment');var attributes=require(_0xa2c7('0x7'));module[_0xa2c7('0x8')]=function(_0x2fe36e,_0x2e2878){return _0x2fe36e[_0xa2c7('0x9')](_0xa2c7('0xa'),attributes,{'tableName':_0xa2c7('0xb'),'paranoid':![],'indexes':[{'name':_0xa2c7('0xc'),'fields':[_0xa2c7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b20=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b20,0xc9));var _0x00b2=function(_0x5244ba,_0x3db562){_0x5244ba=_0x5244ba-0x0;var _0x59ca3c=_0x0b20[_0x5244ba];return _0x59ca3c;};'use strict';var _=require(_0x00b2('0x0'));var util=require(_0x00b2('0x1'));var logger=require(_0x00b2('0x2'))(_0x00b2('0x3'));var moment=require(_0x00b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x00b2('0x5'));var fs=require('fs');var path=require(_0x00b2('0x6'));var rimraf=require(_0x00b2('0x7'));var config=require(_0x00b2('0x8'));var attributes=require(_0x00b2('0x9'));module['exports']=function(_0x31929f,_0x29ce4c){return _0x31929f['define']('ChatTransferReport',attributes,{'tableName':_0x00b2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x00b2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8b09c0d..fa9aa16 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 _0x87ad=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87ad,0x157));var _0xd87a=function(_0x33524a,_0x1309ab){_0x33524a=_0x33524a-0x0;var _0x32573b=_0x87ad[_0x33524a];return _0x32573b;};'use strict';var _=require(_0xd87a('0x0'));var util=require(_0xd87a('0x1'));var moment=require(_0xd87a('0x2'));var BPromise=require(_0xd87a('0x3'));var rs=require(_0xd87a('0x4'));var fs=require('fs');var Redis=require(_0xd87a('0x5'));var db=require(_0xd87a('0x6'))['db'];var utils=require(_0xd87a('0x7'));var logger=require('../../config/logger')(_0xd87a('0x8'));var config=require(_0xd87a('0x9'));var jayson=require(_0xd87a('0xa'));var client=jayson[_0xd87a('0xb')][_0xd87a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x379445,_0x1243dc,_0x5444f2){return new BPromise(function(_0x5b0263,_0x152450){return client[_0xd87a('0xd')](_0x379445,_0x5444f2)['then'](function(_0x364022){logger[_0xd87a('0xe')](_0xd87a('0xf'),_0x1243dc,_0xd87a('0x10'));logger[_0xd87a('0x11')](_0xd87a('0x12'),_0x1243dc,_0xd87a('0x10'),JSON[_0xd87a('0x13')](_0x364022));if(_0x364022[_0xd87a('0x14')]){if(_0x364022[_0xd87a('0x14')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1243dc,_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);return _0x152450(_0x364022['error'][_0xd87a('0x15')]);}logger['error'](_0xd87a('0xf'),_0x1243dc,_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);return _0x5b0263(_0x364022[_0xd87a('0x14')][_0xd87a('0x15')]);}else{logger[_0xd87a('0xe')](_0xd87a('0xf'),_0x1243dc,_0xd87a('0x10'));_0x5b0263(_0x364022['result'][_0xd87a('0x15')]);}})[_0xd87a('0x16')](function(_0x5b298b){logger[_0xd87a('0x14')](_0xd87a('0xf'),_0x1243dc,_0x5b298b);_0x152450(_0x5b298b);});});} \ No newline at end of file +var _0x37e6=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xf7cc2a,_0x840cf8){var _0x4b4cca=function(_0x1df5ad){while(--_0x1df5ad){_0xf7cc2a['push'](_0xf7cc2a['shift']());}};_0x4b4cca(++_0x840cf8);}(_0x37e6,0x151));var _0x637e=function(_0x84a429,_0x27d51c){_0x84a429=_0x84a429-0x0;var _0x2147f2=_0x37e6[_0x84a429];return _0x2147f2;};'use strict';var _=require(_0x637e('0x0'));var util=require(_0x637e('0x1'));var moment=require(_0x637e('0x2'));var BPromise=require(_0x637e('0x3'));var rs=require(_0x637e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x637e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x637e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x637e('0x7'));var client=jayson[_0x637e('0x8')][_0x637e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5afe5d,_0x4499d1,_0x56be6c){return new BPromise(function(_0x4eb538,_0x3f5bfc){return client['request'](_0x5afe5d,_0x56be6c)[_0x637e('0xa')](function(_0x236e36){logger[_0x637e('0xb')](_0x637e('0xc'),_0x4499d1,_0x637e('0xd'));logger[_0x637e('0xe')](_0x637e('0xf'),_0x4499d1,_0x637e('0xd'),JSON[_0x637e('0x10')](_0x236e36));if(_0x236e36[_0x637e('0x11')]){if(_0x236e36[_0x637e('0x11')]['code']===0x1f4){logger[_0x637e('0x11')](_0x637e('0xc'),_0x4499d1,_0x236e36['error'][_0x637e('0x12')]);return _0x3f5bfc(_0x236e36[_0x637e('0x11')]['message']);}logger[_0x637e('0x11')](_0x637e('0xc'),_0x4499d1,_0x236e36['error']['message']);return _0x4eb538(_0x236e36[_0x637e('0x11')][_0x637e('0x12')]);}else{logger[_0x637e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x4499d1,_0x637e('0xd'));_0x4eb538(_0x236e36[_0x637e('0x13')][_0x637e('0x12')]);}})[_0x637e('0x14')](function(_0x10fe74){logger[_0x637e('0x11')](_0x637e('0xc'),_0x4499d1,_0x10fe74);_0x3f5bfc(_0x10fe74);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9c6aa1d..f189229 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 _0x2514=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x57160c,_0x5fb60f){var _0x5587a2=function(_0x42525f){while(--_0x42525f){_0x57160c['push'](_0x57160c['shift']());}};_0x5587a2(++_0x5fb60f);}(_0x2514,0xe4));var _0x4251=function(_0x28d56f,_0x111806){_0x28d56f=_0x28d56f-0x0;var _0x269a53=_0x2514[_0x28d56f];return _0x269a53;};'use strict';var multer=require(_0x4251('0x0'));var util=require(_0x4251('0x1'));var path=require(_0x4251('0x2'));var timeout=require(_0x4251('0x3'));var express=require(_0x4251('0x4'));var router=express['Router']();var fs_extra=require(_0x4251('0x5'));var auth=require(_0x4251('0x6'));var interaction=require(_0x4251('0x7'));var config=require('../../config/environment');var controller=require(_0x4251('0x8'));router[_0x4251('0x9')]('/',auth[_0x4251('0xa')](),controller[_0x4251('0xb')]);router['get'](_0x4251('0xc'),auth[_0x4251('0xa')](),controller[_0x4251('0xd')]);router[_0x4251('0x9')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0xf')]);router[_0x4251('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4251('0x11')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0x12')]);router[_0x4251('0x13')](_0x4251('0xe'),auth[_0x4251('0xa')](),controller[_0x4251('0x14')]);module[_0x4251('0x15')]=router; \ No newline at end of file +var _0x388c=['create','put','update','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x388c,0x17c));var _0xc388=function(_0x110b79,_0x38230c){_0x110b79=_0x110b79-0x0;var _0x4b7721=_0x388c[_0x110b79];return _0x4b7721;};'use strict';var multer=require(_0xc388('0x0'));var util=require('util');var path=require(_0xc388('0x1'));var timeout=require(_0xc388('0x2'));var express=require(_0xc388('0x3'));var router=express[_0xc388('0x4')]();var fs_extra=require(_0xc388('0x5'));var auth=require(_0xc388('0x6'));var interaction=require(_0xc388('0x7'));var config=require('../../config/environment');var controller=require(_0xc388('0x8'));router[_0xc388('0x9')]('/',auth[_0xc388('0xa')](),controller[_0xc388('0xb')]);router[_0xc388('0x9')](_0xc388('0xc'),auth['isAuthenticated'](),controller[_0xc388('0xd')]);router['get']('/:id',auth[_0xc388('0xa')](),controller[_0xc388('0xe')]);router[_0xc388('0xf')]('/',auth[_0xc388('0xa')](),controller[_0xc388('0x10')]);router[_0xc388('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc388('0x12')]);router['delete'](_0xc388('0x13'),auth['isAuthenticated'](),controller[_0xc388('0x14')]);module[_0xc388('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 b91b743..6e39995 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 _0x2d68=['Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','CHAT','alternate','#fafafa','System','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','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','onlineForm','parse','setDataValue','stringify','textarea','Comments','getDataValue','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x38511a,_0x226b17){var _0x165d9e=function(_0x142362){while(--_0x142362){_0x38511a['push'](_0x38511a['shift']());}};_0x165d9e(++_0x226b17);}(_0x2d68,0xdf));var _0x82d6=function(_0x2123aa,_0x2e8a74){_0x2123aa=_0x2123aa-0x0;var _0x413cde=_0x2d68[_0x2123aa];return _0x413cde;};'use strict';var Sequelize=require(_0x82d6('0x0'));var rs=require(_0x82d6('0x1'));module[_0x82d6('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x82d6('0x3')},'description':{'type':Sequelize[_0x82d6('0x4')]},'mapKey':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x5')},'mapKeyOffline':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x5')},'key':{'type':Sequelize[_0x82d6('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x6')},'customerAlias':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x82d6('0x4')]},'animation':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x82d6('0xb')](_0x82d6('0xc'),_0x82d6('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0xe')},'start_chat_button':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0xf')},'offline_chat_button':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'header_offline':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x11')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x82d6('0x13')]},'closingQuestion':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x14')},'noteTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x15')},'placeholderMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x16')},'closingMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x17')},'closingMessageButton':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'skipMessageButton':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x19')},'ratingType':{'type':Sequelize[_0x82d6('0xb')](_0x82d6('0x1a'),_0x82d6('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x82d6('0x1c'),'variable':null,'config':{'placeholder':_0x82d6('0x1d'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x82d6('0x1c'),'props':{'title':_0x82d6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x82d6('0x5'),'type':_0x82d6('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x82d6('0x1e'))?JSON[_0x82d6('0x1f')](this['getDataValue'](_0x82d6('0x1e'))):{};},'set':function(_0x1439c7){return this[_0x82d6('0x20')](_0x82d6('0x1e'),JSON['stringify'](_0x1439c7));}},'offlineForm':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return JSON[_0x82d6('0x21')]({'items':[{'type':_0x82d6('0x1c'),'props':{'title':_0x82d6('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x82d6('0x5'),'type':'email'},'variable':null},{'type':_0x82d6('0x22'),'config':{'placeholder':_0x82d6('0x23')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x82d6('0x24')](_0x82d6('0x25'))?JSON['parse'](this['getDataValue'](_0x82d6('0x25'))):{};},'set':function(_0x4d82d0){return this[_0x82d6('0x20')](_0x82d6('0x25'),JSON['stringify'](_0x4d82d0));}},'token':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':function(){return rs[_0x82d6('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x82d6('0x4')]},'forwardOffline':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x82d6('0x4')]},'waitingTitle':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x28')},'offlineMessageBody':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x82d6('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x18')},'sendUnmanaged':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x82d6('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x82d6('0x4')]},'notificationTemplate':{'type':Sequelize[_0x82d6('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x82d6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2c')},'messagesAlignment':{'type':Sequelize[_0x82d6('0x4')],'defaultValue':_0x82d6('0x2d')},'defaultTitle':{'type':Sequelize[_0x82d6('0x4')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x82d6('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82d6('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x82d6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x82d6('0x2f')},'systemAvatar':{'type':Sequelize[_0x82d6('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x82d6('0x9')],'comment':_0x82d6('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x82d6('0x31'),'set':function(_0x700457){if(!_0x700457)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x82d6('0x32'),_0x700457);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x82d6('0x4')]},'vidaooTopic':{'type':Sequelize[_0x82d6('0x4')],'allowNull':![],'defaultValue':_0x82d6('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x82d6('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x82d6('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x480d=['randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','name','text','input','getDataValue','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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}}','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x3be065,_0x459692){var _0x1472a7=function(_0xa9c98){while(--_0xa9c98){_0x3be065['push'](_0x3be065['shift']());}};_0x1472a7(++_0x459692);}(_0x480d,0x1af));var _0xd480=function(_0x192135,_0x2a141b){_0x192135=_0x192135-0x0;var _0x342c10=_0x480d[_0x192135];return _0x342c10;};'use strict';var Sequelize=require(_0xd480('0x0'));var rs=require(_0xd480('0x1'));module[_0xd480('0x2')]={'name':{'type':Sequelize[_0xd480('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd480('0x3')],'allowNull':![],'unique':_0xd480('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x5')},'key':{'type':Sequelize[_0xd480('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd480('0x3')],'allowNull':![],'defaultValue':_0xd480('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd480('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd480('0x3')],'allowNull':![],'defaultValue':_0xd480('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd480('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd480('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd480('0xa')](_0xd480('0xb'),_0xd480('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0xf')},'download_transcript':{'type':Sequelize[_0xd480('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd480('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0x13')},'noteTitle':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0x15')},'closingMessage':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x16')},'closingMessageButton':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x17')},'skipMessageButton':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x18')},'conditionAgreement':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x19')},'ratingType':{'type':Sequelize[_0xd480('0xa')](_0xd480('0x1a'),_0xd480('0x1b')),'defaultValue':_0xd480('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0xd480('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd480('0x1c'),'type':_0xd480('0x1d'),'required':!![]},'props':{'title':_0xd480('0x1c'),'helpText':''}},{'type':_0xd480('0x1e'),'props':{'title':_0xd480('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd480('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0xd480('0x1f')](_0xd480('0x20'))):{};},'set':function(_0xacf4f3){return this[_0xd480('0x21')](_0xd480('0x20'),JSON[_0xd480('0x22')](_0xacf4f3));}},'offlineForm':{'type':Sequelize[_0xd480('0x23')],'defaultValue':function(){return JSON[_0xd480('0x22')]({'items':[{'type':_0xd480('0x1e'),'props':{'title':_0xd480('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd480('0x5'),'type':_0xd480('0x5')},'variable':null},{'type':_0xd480('0x24'),'config':{'placeholder':_0xd480('0x25')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd480('0x26'))?JSON[_0xd480('0x27')](this[_0xd480('0x1f')](_0xd480('0x26'))):{};},'set':function(_0x15de72){return this['setDataValue'](_0xd480('0x26'),JSON[_0xd480('0x22')](_0x15de72));}},'token':{'type':Sequelize[_0xd480('0x3')],'defaultValue':function(){return rs[_0xd480('0x28')]();}},'autoclose':{'type':Sequelize[_0xd480('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd480('0x3')]},'forwardOffline':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd480('0x3')]},'waitingTitle':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x29')},'waitingMessage':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0xd480('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x2b')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd480('0x17')},'enableCustomerAttachment':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd480('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd480('0x23')],'defaultValue':function(){return _0xd480('0x2c');}},'notificationSound':{'type':Sequelize[_0xd480('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xd480('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x2d')},'messagesAlignment':{'type':Sequelize[_0xd480('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xd480('0x3')]},'customerAvatar':{'type':Sequelize[_0xd480('0x23')]},'showCustomerAvatar':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd480('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd480('0x3')],'allowNull':![],'defaultValue':_0xd480('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd480('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd480('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd480('0x3')],'defaultValue':_0xd480('0x2f')},'systemAvatar':{'type':Sequelize[_0xd480('0x23')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd480('0x8')],'comment':_0xd480('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![],'comment':_0xd480('0x31'),'set':function(_0x26024a){if(!_0x26024a)this[_0xd480('0x21')](_0xd480('0x32'),null);this[_0xd480('0x21')](_0xd480('0x33'),_0x26024a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd480('0x3')],'allowNull':![],'defaultValue':_0xd480('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xd480('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xd480('0x23')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd480('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd480('0x23')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c02df41..3f9bc6b 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 _0x0ba7=['SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','files','offline-chat','omit','getInteractions','Owner','fullname','Tag','Tags','tag','Command','getSnippet','timezone','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','json','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','Disposition','getDispositions','findOne','length','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','applications','list','orderBy','priority','asc','account','contact','customerIp','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','forcedOwnership','Start','startRouting','EventManager','notify','offline','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','openNewInteraction','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions'];(function(_0x1d7dd3,_0x490932){var _0x85d60=function(_0x1fd445){while(--_0x1fd445){_0x1d7dd3['push'](_0x1d7dd3['shift']());}};_0x85d60(++_0x490932);}(_0x0ba7,0x16d));var _0x70ba=function(_0x57dd6b,_0x21dd15){_0x57dd6b=_0x57dd6b-0x0;var _0x9e3256=_0x0ba7[_0x57dd6b];return _0x9e3256;};'use strict';var BPromise=require(_0x70ba('0x0'));var Mustache=require('mustache');var util=require(_0x70ba('0x1'));var path=require(_0x70ba('0x2'));var ejs=require(_0x70ba('0x3'));var fs=require('fs');var fs_extra=require(_0x70ba('0x4'));var _=require('lodash');var querystring=require(_0x70ba('0x5'));var Redis=require(_0x70ba('0x6'));var qs=require(_0x70ba('0x7'));var logger=require(_0x70ba('0x8'))(_0x70ba('0x9'));var config=require(_0x70ba('0xa'));var db=require(_0x70ba('0xb'))['db'];config[_0x70ba('0xc')]=_[_0x70ba('0xd')](config[_0x70ba('0xc')],{'host':_0x70ba('0xe'),'port':0x18eb});var socket=require(_0x70ba('0xf'))(new Redis(config[_0x70ba('0xc')]));require(_0x70ba('0x10'))[_0x70ba('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x70ba('0x12'));var client=jayson['client'][_0x70ba('0x13')]({'port':0x232c});var client9002=jayson[_0x70ba('0x14')][_0x70ba('0x13')]({'port':0x232a});var client9003=jayson[_0x70ba('0x14')]['http']({'port':0x232b});var client9001=jayson['client'][_0x70ba('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x4a2c2e,_0xd6580e,_0x5e94c7,_0x285dad){return new BPromise(function(_0x35cb3f,_0x4df1e3){var _0x1d674b=_0x285dad||client;return _0x1d674b['request'](_0x4a2c2e,_0x5e94c7)[_0x70ba('0x15')](function(_0x2728e1){logger[_0x70ba('0x16')](_0x70ba('0x17'),_0xd6580e,_0x70ba('0x18'));logger[_0x70ba('0x19')](_0x70ba('0x1a'),_0xd6580e,_0x70ba('0x18'),JSON[_0x70ba('0x1b')](_0x2728e1));if(_0x2728e1[_0x70ba('0x1c')]){if(_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1d')]===0x1f4){logger[_0x70ba('0x1c')](_0x70ba('0x17'),_0xd6580e,_0x2728e1['error']['message']);return _0x4df1e3(_0x2728e1['error'][_0x70ba('0x1e')]);}logger[_0x70ba('0x1c')](_0x70ba('0x17'),_0xd6580e,_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1e')]);return _0x35cb3f(_0x2728e1[_0x70ba('0x1c')][_0x70ba('0x1e')]);}else{logger[_0x70ba('0x16')](_0x70ba('0x17'),_0xd6580e,_0x70ba('0x18'));_0x35cb3f(_0x2728e1[_0x70ba('0x1f')][_0x70ba('0x1e')]);}})[_0x70ba('0x20')](function(_0x4570b0){logger[_0x70ba('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0xd6580e,_0x4570b0);_0x4df1e3(_0x4570b0);});});}function respondWithStatusCode(_0x3b31ef,_0x4203cc){_0x4203cc=_0x4203cc||0xcc;return function(_0x52accf){if(_0x52accf){return _0x3b31ef[_0x70ba('0x21')](_0x4203cc);}return _0x3b31ef['status'](_0x4203cc)['end']();};}function respondWithResult(_0x112aeb,_0x5152b2){_0x5152b2=_0x5152b2||0xc8;return function(_0x45bbf2){if(_0x45bbf2){return _0x112aeb[_0x70ba('0x22')](_0x5152b2)['json'](_0x45bbf2);}};}function respondWithFilteredResult(_0xf403fc,_0x4ef847){return function(_0x5ad828){if(_0x5ad828){var _0x39482c=typeof _0x4ef847['offset']===_0x70ba('0x23')&&typeof _0x4ef847[_0x70ba('0x24')]===_0x70ba('0x23');var _0x33e218=_0x5ad828[_0x70ba('0x25')];var _0x265423=_0x39482c?0x0:_0x4ef847['offset'];var _0x2d840e=_0x39482c?_0x5ad828[_0x70ba('0x25')]:_0x4ef847[_0x70ba('0x26')]+_0x4ef847['limit'];var _0x445fe5;if(_0x2d840e>=_0x33e218){_0x2d840e=_0x33e218;_0x445fe5=0xc8;}else{_0x445fe5=0xce;}_0xf403fc['status'](_0x445fe5);return _0xf403fc['set']('Content-Range',_0x265423+'-'+_0x2d840e+'/'+_0x33e218)[_0x70ba('0x27')](_0x5ad828);}return null;};}function saveUpdates(_0x345edd){return function(_0x5b6e6e){if(_0x5b6e6e){return _0x5b6e6e['update'](_0x345edd)[_0x70ba('0x15')](function(_0x4ff810){return _0x4ff810;});}return null;};}function removeEntity(_0x102661){return function(_0x45d972){if(_0x45d972){return _0x45d972[_0x70ba('0x28')]()[_0x70ba('0x15')](function(){var _0x1db0c4=_0x45d972[_0x70ba('0x29')]({'plain':!![]});var _0x1f86cf=_0x70ba('0x2a');return db[_0x70ba('0x2b')][_0x70ba('0x28')]({'where':{'type':_0x1f86cf,'resourceId':_0x1db0c4['id']}})[_0x70ba('0x15')](function(){return _0x45d972;});})['then'](function(){_0x102661['status'](0xcc)[_0x70ba('0x2c')]();});}};}function handleEntityNotFound(_0x39433a){return function(_0x943e49){if(!_0x943e49){_0x39433a['sendStatus'](0x194);}return _0x943e49;};}function handleError(_0x5a5249,_0x507f00){_0x507f00=_0x507f00||0x1f4;return function(_0x2ada50){logger[_0x70ba('0x1c')](_0x2ada50[_0x70ba('0x2d')]);if(_0x2ada50['name']){delete _0x2ada50[_0x70ba('0x2e')];}_0x5a5249['status'](_0x507f00)['send'](_0x2ada50);};}exports[_0x70ba('0x2f')]=function(_0x591596,_0x15774e){var _0x14c86d={'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]},_0x4f3d6f={},_0x68316e={'count':0x0,'rows':[]};var _0x48328e=_[_0x70ba('0x32')](db[_0x70ba('0x33')][_0x70ba('0x34')],function(_0x75fbbe){return{'name':_0x75fbbe['fieldName'],'type':_0x75fbbe[_0x70ba('0x35')]['key']};});_0x4f3d6f[_0x70ba('0x36')]=_[_0x70ba('0x32')](_0x48328e,_0x70ba('0x2e'));_0x4f3d6f[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x591596[_0x70ba('0x37')]);_0x4f3d6f[_0x70ba('0x39')]=_['intersection'](_0x4f3d6f[_0x70ba('0x36')],_0x4f3d6f[_0x70ba('0x37')]);_0x14c86d[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x4f3d6f[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x591596['query'][_0x70ba('0x3c')]));_0x14c86d[_0x70ba('0x3a')]=_0x14c86d[_0x70ba('0x3a')]['length']?_0x14c86d['attributes']:_0x4f3d6f['model'];if(!_0x591596[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x14c86d['limit']=qs[_0x70ba('0x24')](_0x591596[_0x70ba('0x37')][_0x70ba('0x24')]);_0x14c86d[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x591596['query']['offset']);}_0x14c86d[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x591596[_0x70ba('0x37')]['sort']);_0x14c86d['where']=qs[_0x70ba('0x39')](_['pick'](_0x591596[_0x70ba('0x37')],_0x4f3d6f[_0x70ba('0x39')]),_0x48328e);if(_0x591596[_0x70ba('0x37')][_0x70ba('0x41')]){_0x14c86d[_0x70ba('0x42')]=_['merge'](_0x14c86d[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x48328e,function(_0x20e0b9){if(_0x20e0b9[_0x70ba('0x35')]!==_0x70ba('0x43')){var _0x3fdefb={};_0x3fdefb[_0x20e0b9[_0x70ba('0x2e')]]={'$like':'%'+_0x591596[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x3fdefb;}})});}_0x14c86d=_[_0x70ba('0x44')]({},_0x14c86d,_0x591596[_0x70ba('0x45')]);var _0x349059={'where':_0x14c86d[_0x70ba('0x42')]};return db[_0x70ba('0x33')][_0x70ba('0x25')](_0x349059)['then'](function(_0xd7638f){_0x68316e[_0x70ba('0x25')]=_0xd7638f;if(_0x591596['query'][_0x70ba('0x46')]){_0x14c86d[_0x70ba('0x47')]=[{'all':!![]}];}return db[_0x70ba('0x33')][_0x70ba('0x48')](_0x14c86d);})[_0x70ba('0x15')](function(_0x224fce){_0x68316e[_0x70ba('0x49')]=_0x224fce;return _0x68316e;})['then'](respondWithFilteredResult(_0x15774e,_0x14c86d))[_0x70ba('0x20')](handleError(_0x15774e,null));};exports[_0x70ba('0x4a')]=function(_0x390cd0,_0x3d1f89){var _0x3d46db={'raw':![],'where':{'id':_0x390cd0[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]},_0x383d53={};_0x383d53[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x33')][_0x70ba('0x34')]);_0x383d53[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x390cd0[_0x70ba('0x37')]);_0x383d53[_0x70ba('0x39')]=_['intersection'](_0x383d53[_0x70ba('0x36')],_0x383d53[_0x70ba('0x37')]);_0x3d46db[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x383d53['model'],qs['fields'](_0x390cd0['query'][_0x70ba('0x3c')]));_0x3d46db[_0x70ba('0x3a')]=_0x3d46db['attributes']['length']?_0x3d46db[_0x70ba('0x3a')]:_0x383d53[_0x70ba('0x36')];if(_0x390cd0[_0x70ba('0x37')][_0x70ba('0x46')]){_0x3d46db[_0x70ba('0x47')]=[{'all':!![]}];}_0x3d46db=_[_0x70ba('0x44')]({},_0x3d46db,_0x390cd0[_0x70ba('0x45')]);return db['ChatWebsite']['find'](_0x3d46db)[_0x70ba('0x15')](handleEntityNotFound(_0x3d1f89,null))[_0x70ba('0x15')](respondWithResult(_0x3d1f89,null))[_0x70ba('0x20')](handleError(_0x3d1f89,null));};exports[_0x70ba('0x4c')]=function(_0x4d4a45,_0x42ca9e){return db[_0x70ba('0x33')]['create'](_0x4d4a45['body'],{})['then'](function(_0x4acb51){var _0x2195d9=_0x4d4a45[_0x70ba('0x4d')][_0x70ba('0x29')]({'plain':!![]});if(!_0x2195d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2195d9[_0x70ba('0x4e')]===_0x70ba('0x4d')){var _0x29bb0b=_0x4acb51['get']({'plain':!![]});var _0x1bdcd4=_0x70ba('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x1bdcd4,'userProfileId':_0x2195d9[_0x70ba('0x4f')]},'raw':!![]})[_0x70ba('0x15')](function(_0x212204){if(_0x212204&&_0x212204[_0x70ba('0x50')]===0x0){return db[_0x70ba('0x2b')][_0x70ba('0x4c')]({'name':_0x29bb0b[_0x70ba('0x2e')],'resourceId':_0x29bb0b['id'],'type':_0x212204['name'],'sectionId':_0x212204['id']},{})[_0x70ba('0x15')](function(){return _0x4acb51;});}else{return _0x4acb51;}})[_0x70ba('0x20')](function(_0x4de412){logger['error'](_0x70ba('0x51'),_0x4de412);throw _0x4de412;});}return _0x4acb51;})[_0x70ba('0x15')](respondWithResult(_0x42ca9e,0xc9))['catch'](handleError(_0x42ca9e,null));};exports['update']=function(_0x3279bf,_0x5ddf78){if(_0x3279bf['body']['id']){delete _0x3279bf[_0x70ba('0x52')]['id'];}return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x3279bf[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x30')],'as':_0x70ba('0x31')}]})[_0x70ba('0x15')](handleEntityNotFound(_0x5ddf78,null))['then'](saveUpdates(_0x3279bf[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x5ddf78,null))[_0x70ba('0x20')](handleError(_0x5ddf78,null));};exports[_0x70ba('0x28')]=function(_0x355df4,_0x1799a2){return db['ChatWebsite'][_0x70ba('0x53')]({'where':{'id':_0x355df4['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x1799a2,null))['then'](removeEntity(_0x1799a2,null))[_0x70ba('0x20')](handleError(_0x1799a2,null));};exports[_0x70ba('0x54')]=function(_0x750a06,_0x305df9){return db[_0x70ba('0x33')][_0x70ba('0x54')]()['then'](respondWithResult(_0x305df9,null))[_0x70ba('0x20')](handleError(_0x305df9,null));};exports['addDisposition']=function(_0x490948,_0x31bf24){if(_0x490948[_0x70ba('0x52')]['id']){delete _0x490948['body']['id'];}return db[_0x70ba('0x33')]['find']({'where':{'id':_0x490948[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x31bf24,null))[_0x70ba('0x15')](function(_0x59e5c1){if(_0x59e5c1){_0x490948[_0x70ba('0x52')]['ChatWebsiteId']=_0x59e5c1['id'];return db[_0x70ba('0x55')]['create'](_0x490948[_0x70ba('0x52')]);}})[_0x70ba('0x15')](respondWithResult(_0x31bf24,null))[_0x70ba('0x20')](handleError(_0x31bf24,null));};exports[_0x70ba('0x56')]=function(_0x4bd8f6,_0x2b9489){var _0x530324={'raw':![],'where':{}};var _0x2c95c8={};var _0x28e490={'count':0x0,'rows':[]};return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x4bd8f6['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2b9489,null))[_0x70ba('0x15')](function(_0x3a2132){if(_0x3a2132){_0x2c95c8[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x55')][_0x70ba('0x34')]);_0x2c95c8[_0x70ba('0x37')]=_['keys'](_0x4bd8f6[_0x70ba('0x37')]);_0x2c95c8[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x2c95c8[_0x70ba('0x36')],_0x2c95c8[_0x70ba('0x37')]);_0x530324[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x2c95c8['model'],qs[_0x70ba('0x3c')](_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x530324[_0x70ba('0x3a')]=_0x530324[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x530324[_0x70ba('0x3a')]:_0x2c95c8[_0x70ba('0x36')];if(!_0x4bd8f6['query']['hasOwnProperty'](_0x70ba('0x3e'))){_0x530324[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x4bd8f6['query'][_0x70ba('0x24')]);_0x530324[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x4bd8f6['query'][_0x70ba('0x26')]);}_0x530324[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x40')]);_0x530324[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_['pick'](_0x4bd8f6[_0x70ba('0x37')],_0x2c95c8['filters']));_0x530324['where'][_0x70ba('0x59')]=_0x3a2132['id'];if(_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x41')]){_0x530324[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x530324[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x530324[_0x70ba('0x3a')],function(_0x48a362){var _0x122ea1={};_0x122ea1[_0x48a362]={'$like':'%'+_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x122ea1;})});}_0x530324=_['merge']({},_0x530324,_0x4bd8f6['options']);return db['Disposition'][_0x70ba('0x25')]({'where':_0x530324['where']})['then'](function(_0x5659ed){_0x28e490[_0x70ba('0x25')]=_0x5659ed;if(_0x4bd8f6[_0x70ba('0x37')][_0x70ba('0x46')]){_0x530324[_0x70ba('0x47')]=[{'all':!![]}];}return db[_0x70ba('0x55')]['findAll'](_0x530324);})['then'](function(_0x10758e){_0x28e490[_0x70ba('0x49')]=_0x10758e;return _0x28e490;});}})['then'](respondWithFilteredResult(_0x2b9489,_0x530324))[_0x70ba('0x20')](handleError(_0x2b9489,null));};exports[_0x70ba('0x5a')]=function(_0x30a7e7,_0x498af4){return db[_0x70ba('0x33')]['find']({'where':{'id':_0x30a7e7[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x498af4,null))['then'](function(_0xf8e8){if(_0xf8e8){return _0xf8e8['removeDispositions'](_0x30a7e7[_0x70ba('0x37')][_0x70ba('0x5b')]);}})['then'](respondWithStatusCode(_0x498af4,null))[_0x70ba('0x20')](handleError(_0x498af4,null));};exports[_0x70ba('0x5c')]=function(_0x35ebc4,_0xb3c58c){if(_0x35ebc4[_0x70ba('0x52')]['id']){delete _0x35ebc4[_0x70ba('0x52')]['id'];}return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x35ebc4[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0xb3c58c,null))['then'](function(_0x16e2f3){if(_0x16e2f3){_0x35ebc4[_0x70ba('0x52')][_0x70ba('0x59')]=_0x16e2f3['id'];return db[_0x70ba('0x5d')]['create'](_0x35ebc4[_0x70ba('0x52')]);}})['then'](respondWithResult(_0xb3c58c,null))[_0x70ba('0x20')](handleError(_0xb3c58c,null));};exports['getAnswers']=function(_0x44b3ad,_0x18d129){var _0x56a430={'raw':![],'where':{}};var _0x15a587={};var _0x849a57={'count':0x0,'rows':[]};return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x44b3ad[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x18d129,null))[_0x70ba('0x15')](function(_0x5150c){if(_0x5150c){_0x15a587['model']=_[_0x70ba('0x38')](db[_0x70ba('0x5d')][_0x70ba('0x34')]);_0x15a587[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x44b3ad[_0x70ba('0x37')]);_0x15a587[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x15a587['model'],_0x15a587[_0x70ba('0x37')]);_0x56a430[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x15a587['model'],qs[_0x70ba('0x3c')](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x56a430['attributes']=_0x56a430['attributes'][_0x70ba('0x58')]?_0x56a430['attributes']:_0x15a587['model'];if(!_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x56a430[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x44b3ad[_0x70ba('0x37')]['limit']);_0x56a430['offset']=qs[_0x70ba('0x26')](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x56a430[_0x70ba('0x3f')]=qs['sort'](_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x40')]);_0x56a430[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x44b3ad[_0x70ba('0x37')],_0x15a587[_0x70ba('0x39')]));_0x56a430[_0x70ba('0x42')][_0x70ba('0x59')]=_0x5150c['id'];if(_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x41')]){_0x56a430[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x56a430[_0x70ba('0x42')],{'$or':_['map'](_0x56a430[_0x70ba('0x3a')],function(_0x24328e){var _0x407b29={};_0x407b29[_0x24328e]={'$like':'%'+_0x44b3ad['query']['filter']+'%'};return _0x407b29;})});}_0x56a430=_['merge']({},_0x56a430,_0x44b3ad[_0x70ba('0x45')]);return db[_0x70ba('0x5d')][_0x70ba('0x25')]({'where':_0x56a430[_0x70ba('0x42')]})['then'](function(_0x36c69b){_0x849a57[_0x70ba('0x25')]=_0x36c69b;if(_0x44b3ad[_0x70ba('0x37')][_0x70ba('0x46')]){_0x56a430['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x56a430);})[_0x70ba('0x15')](function(_0x5deba6){_0x849a57[_0x70ba('0x49')]=_0x5deba6;return _0x849a57;});}})['then'](respondWithFilteredResult(_0x18d129,_0x56a430))[_0x70ba('0x20')](handleError(_0x18d129,null));};exports[_0x70ba('0x5f')]=function(_0x4f9d65,_0x4808cb){return db[_0x70ba('0x33')]['find']({'where':{'id':_0x4f9d65['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x4808cb,null))[_0x70ba('0x15')](function(_0x2e5aa7){if(_0x2e5aa7){return _0x2e5aa7[_0x70ba('0x5f')](_0x4f9d65[_0x70ba('0x37')][_0x70ba('0x5b')]);}})[_0x70ba('0x15')](respondWithStatusCode(_0x4808cb,null))[_0x70ba('0x20')](handleError(_0x4808cb,null));};exports[_0x70ba('0x60')]=function(_0x26c4a7,_0x39df97){_0x26c4a7[_0x70ba('0x52')][_0x70ba('0x61')]=_0x26c4a7[_0x70ba('0x62')][_0x70ba('0x63')];return db['ChatWebsite'][_0x70ba('0x53')]({'where':{'id':_0x26c4a7[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x39df97,null))['then'](saveUpdates(_0x26c4a7[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x39df97,null))['catch'](handleError(_0x39df97,null));};exports[_0x70ba('0x64')]=function(_0x490b96,_0x4cf238){_0x490b96[_0x70ba('0x52')]['agentAvatar']=_0x490b96[_0x70ba('0x62')]['filename'];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x490b96[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x4cf238,null))[_0x70ba('0x15')](saveUpdates(_0x490b96[_0x70ba('0x52')],null))[_0x70ba('0x15')](respondWithResult(_0x4cf238,null))[_0x70ba('0x20')](handleError(_0x4cf238,null));};exports[_0x70ba('0x65')]=function(_0x541fb6,_0x300b4e){_0x541fb6['body'][_0x70ba('0x66')]=_0x541fb6[_0x70ba('0x62')][_0x70ba('0x63')];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x541fb6[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x300b4e,null))[_0x70ba('0x15')](saveUpdates(_0x541fb6[_0x70ba('0x52')],null))['then'](respondWithResult(_0x300b4e,null))['catch'](handleError(_0x300b4e,null));};exports['addSystemAvatar']=function(_0x6660df,_0x556c20){_0x6660df[_0x70ba('0x52')][_0x70ba('0x67')]=_0x6660df[_0x70ba('0x62')]['filename'];return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x6660df[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x556c20,null))[_0x70ba('0x15')](saveUpdates(_0x6660df[_0x70ba('0x52')],null))['then'](respondWithResult(_0x556c20,null))['catch'](handleError(_0x556c20,null));};exports[_0x70ba('0x68')]=function(_0x4302e6,_0x554b47){var _0x25691a=path['join'](config[_0x70ba('0x69')],_0x70ba('0x6a'));var _0x4b9213={'where':{'id':_0x4302e6[_0x70ba('0x4b')]['id']},'attributes':['id',_0x70ba('0x61')],'raw':!![]};var _0x814ec6=![];return require(_0x70ba('0x6b'))['getLicense']()[_0x70ba('0x15')](function(_0xc0a10){if(_0xc0a10){_0x814ec6=_0xc0a10[_0x70ba('0x6c')];}})[_0x70ba('0x15')](function(){return db['ChatWebsite'][_0x70ba('0x53')](_0x4b9213);})[_0x70ba('0x15')](handleEntityNotFound(_0x554b47,null))[_0x70ba('0x15')](function(_0x21f988){if(_0x21f988){if(!_['isNil'](_0x21f988['sitepic'])){if(fs[_0x70ba('0x6d')](path[_0x70ba('0x6e')](config['root'],_0x70ba('0x6f'),_0x21f988[_0x70ba('0x61')]))&&_0x814ec6){_0x25691a=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x6f'),_0x21f988[_0x70ba('0x61')]);}}return _0x554b47[_0x70ba('0x70')](_0x25691a);}})[_0x70ba('0x20')](handleError(_0x554b47,null));};exports[_0x70ba('0x71')]=function(_0x373eb1,_0x2740ac){var _0x2772f2=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x72'));var _0x203622={'where':{'id':_0x373eb1[_0x70ba('0x4b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x203622)[_0x70ba('0x15')](handleEntityNotFound(_0x2740ac,null))[_0x70ba('0x15')](function(_0x322af0){if(_0x322af0){if(!_[_0x70ba('0x73')](_0x322af0[_0x70ba('0x74')])){if(fs['existsSync'](path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x322af0[_0x70ba('0x74')]))){_0x2772f2=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x322af0[_0x70ba('0x74')]);}}return _0x2740ac[_0x70ba('0x70')](_0x2772f2);}})[_0x70ba('0x20')](handleError(_0x2740ac,null));};exports['getCustomerAvatar']=function(_0x386d6e,_0x1729da){var _0xb3cf6=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x76'));var _0x55214a={'where':{'id':_0x386d6e[_0x70ba('0x4b')]['id']},'attributes':['id',_0x70ba('0x66'),_0x70ba('0x77')],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x55214a)[_0x70ba('0x15')](handleEntityNotFound(_0x1729da,null))[_0x70ba('0x15')](function(_0x494430){if(_0x494430){if(!_['isNil'](_0x494430[_0x70ba('0x66')])){if(fs[_0x70ba('0x6d')](path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x494430[_0x70ba('0x66')]))&&_0x494430[_0x70ba('0x77')]){_0xb3cf6=path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x494430[_0x70ba('0x66')]);}}return _0x1729da[_0x70ba('0x70')](_0xb3cf6);}})[_0x70ba('0x20')](handleError(_0x1729da,null));};exports[_0x70ba('0x78')]=function(_0x57cd06,_0x408eef){var _0x237d3b=path[_0x70ba('0x6e')](config['root'],_0x70ba('0x79'));var _0x2f7d0b={'where':{'id':_0x57cd06['params']['id']},'attributes':['id',_0x70ba('0x67')],'raw':!![]};return db[_0x70ba('0x33')][_0x70ba('0x53')](_0x2f7d0b)[_0x70ba('0x15')](handleEntityNotFound(_0x408eef,null))[_0x70ba('0x15')](function(_0x3016dd){if(_0x3016dd){if(!_[_0x70ba('0x73')](_0x3016dd[_0x70ba('0x67')])){if(fs[_0x70ba('0x6d')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0x75'),_0x3016dd[_0x70ba('0x67')]))){_0x237d3b=path['join'](config[_0x70ba('0x69')],'server/files/images/avatars/',_0x3016dd[_0x70ba('0x67')]);}}return _0x408eef[_0x70ba('0x70')](_0x237d3b);}})['catch'](handleError(_0x408eef,null));};exports['notify']=function(_0x5e5e6b,_0x28e339){var _0x43aba3=require(_0x70ba('0x7a'));var _0x28dff2=new _0x43aba3();var _0x226f09=_0x28dff2['setUA'](_0x5e5e6b['headers'][_0x70ba('0x7b')])['getResult']();var _0xb1be95={'body':_0x5e5e6b[_0x70ba('0x52')],'channel':_0x70ba('0x7c')};var _0x95e0fc=[];var _0x1c8b80=[];var _0x6b82ab={};var _0xfc0de6=![];return db[_0x70ba('0x7d')][_0x70ba('0x54')]()[_0x70ba('0x15')](function(_0x33189d){if(!_0x33189d){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x80'));}_0x95e0fc=_[_0x70ba('0x81')](_[_0x70ba('0x38')](_0x33189d),['createdAt',_0x70ba('0x82')]);_0x1c8b80=_['difference'](_[_0x70ba('0x38')](_0x33189d),['createdAt',_0x70ba('0x82'),_0x70ba('0x83'),'ListId']);if(_0x5e5e6b[_0x70ba('0x52')]['id']){delete _0x5e5e6b[_0x70ba('0x52')]['id'];}if(_[_0x70ba('0x73')](_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x84')])){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x85'));}if(_[_0x70ba('0x73')](_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x52')])||_0x5e5e6b['body'][_0x70ba('0x52')]===''){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x70ba('0x73')](_0x5e5e6b['body'][_0x70ba('0x86')])){throw new db['Sequelize'][(_0x70ba('0x7f'))](_0x70ba('0x87')+_0x1c8b80);}if(!_[_0x70ba('0x88')](_0x1c8b80,_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')])){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x89')+_0x1c8b80);}_0x6b82ab[_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')]]=_0x5e5e6b['body']['from'];})['then'](function(){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x5e5e6b[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x8a')],'as':'List','include':[{'model':db[_0x70ba('0x7d')],'as':_0x70ba('0x8b'),'where':_0x6b82ab,'limit':0x1,'order':[[_0x70ba('0x82'),_0x70ba('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0x70ba('0x8d')}]});})[_0x70ba('0x15')](handleEntityNotFound(_0x28e339,null))['then'](function(_0x13ce5d){if(_0x13ce5d&&_0x13ce5d[_0x70ba('0x8e')]){_0xb1be95['account']=_0x13ce5d;_0xb1be95[_0x70ba('0x8f')]=_0x13ce5d['Applications'];_0xb1be95[_0x70ba('0x90')]=_0x13ce5d[_0x70ba('0x8e')];_0xb1be95[_0x70ba('0x8f')]=_[_0x70ba('0x91')](_0xb1be95['applications'],[_0x70ba('0x92')],[_0x70ba('0x93')]);if(_0xb1be95[_0x70ba('0x94')][_0x70ba('0x8d')]){delete _0xb1be95[_0x70ba('0x94')]['Applications'];}if(_0xb1be95[_0x70ba('0x94')][_0x70ba('0x8e')]&&_0xb1be95['account'][_0x70ba('0x8e')][_0x70ba('0x8b')][_0x70ba('0x58')]){return _0xb1be95[_0x70ba('0x94')][_0x70ba('0x8e')]['Contacts'][0x0];}var _0x17e3b4=_['defaults'](_0x5e5e6b['body'],{'firstName':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x84')],'ListId':_0x13ce5d['ListId']});_0x17e3b4[_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x86')]]=_0x5e5e6b['body']['from'];return db[_0x70ba('0x7d')]['create'](_0x17e3b4,{'fields':_0x95e0fc,'raw':!![]});}})[_0x70ba('0x15')](handleEntityNotFound(_0x28e339,null))[_0x70ba('0x15')](function(_0x1c6580){_0xb1be95[_0x70ba('0x95')]=_0x1c6580;var _0x54fa03=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x96')];if(_0x5e5e6b[_0x70ba('0x97')][_0x70ba('0x98')]){_0x54fa03=_0x5e5e6b[_0x70ba('0x97')]['cf-connecting-ip'];}else if(_0x5e5e6b[_0x70ba('0x97')]['x-forwarded-for']){_0x54fa03=_[_0x70ba('0x99')](_0x5e5e6b[_0x70ba('0x97')]['x-forwarded-for'][_0x70ba('0x9a')](','));}if(_0x1c6580){var _0x230785={'ContactId':_0x1c6580['id'],'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'from':(_0x1c6580[_0x70ba('0x9b')]||'')+'\x20'+(_0x1c6580[_0x70ba('0x9c')]||''),'customerIp':_0x54fa03,'customerPort':_0x5e5e6b['headers'][_0x70ba('0x9d')]?_0x5e5e6b['headers'][_0x70ba('0x9d')]:null,'referer':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0x9e')],'browserName':_0x226f09[_0x70ba('0x9f')][_0x70ba('0x2e')]&&_0x226f09[_0x70ba('0x9f')]['version']?util[_0x70ba('0xa0')](_0x70ba('0xa1'),_0x226f09[_0x70ba('0x9f')][_0x70ba('0x2e')],_0x226f09['browser'][_0x70ba('0xa2')]):_0x70ba('0xa3'),'browserVersion':_0x226f09[_0x70ba('0x9f')][_0x70ba('0xa2')]||_0x70ba('0xa3'),'osName':util['format'](_0x70ba('0xa1'),_0x226f09['os'][_0x70ba('0x2e')],_0x226f09['os'][_0x70ba('0xa2')]),'osVersion':_0x226f09['os'][_0x70ba('0xa2')],'deviceModel':_0x226f09[_0x70ba('0xa4')]['model']&&_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')]?util[_0x70ba('0xa0')](_0x70ba('0xa6'),_0x226f09['device']['model'],_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')],_0x226f09['device']['type']):null,'deviceVendor':_0x226f09[_0x70ba('0xa4')][_0x70ba('0xa5')],'deviceType':_0x226f09[_0x70ba('0xa4')]['type'],'formData':JSON[_0x70ba('0x1b')](_0x5e5e6b['body'])};var _0x3a2000={'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'closed':![]};if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]){_0x3a2000[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')]['threadId'];return db[_0x70ba('0xa8')]['find']({'where':_0x3a2000})[_0x70ba('0x15')](function(_0x1811cd){if(_0x1811cd){return[_0x1811cd,![]];}_0x230785[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')];_0x230785[_0x70ba('0xa9')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa9')];return db[_0x70ba('0xa8')][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0xa15fd){return[_0xa15fd,!![]];});});}_0x3a2000[_0x70ba('0xaa')]=_0x1c6580['id'];if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xab')]&&_0x5e5e6b['body']['interaction']['id']){_0x3a2000['id']=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xab')]['id'];return db[_0x70ba('0xa8')][_0x70ba('0x53')]({'where':_0x3a2000})[_0x70ba('0x15')](function(_0x415365){if(_0x415365){return[_0x415365,![]];}return db[_0x70ba('0xa8')][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0x11fb0a){return[_0x11fb0a,!![]];});});}return db['ChatInteraction'][_0x70ba('0x4c')](_0x230785)[_0x70ba('0x15')](function(_0x1bdae4){return[_0x1bdae4,!![]];});}})[_0x70ba('0xac')](function(_0x4521e4,_0x34f7ec){if(_0x4521e4){_0xfc0de6=_0x34f7ec;if(!_0x34f7ec){var _0x3c80ab={'from':(_0xb1be95[_0x70ba('0x95')][_0x70ba('0x9b')]||'')+'\x20'+(_0xb1be95[_0x70ba('0x95')][_0x70ba('0x9c')]||'')};if(_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]&&_0x5e5e6b[_0x70ba('0x52')]['messageId']&&_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xa7')]!=_0x5e5e6b[_0x70ba('0x52')]['messageId']){_0x3c80ab[_0x70ba('0xa7')]=_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xad')];}return _0x4521e4[_0x70ba('0xae')](_0x3c80ab);}else{return _0x4521e4;}}})[_0x70ba('0x15')](function(_0x5df64b){_0xb1be95['interaction']=_0x5df64b[_0x70ba('0x29')]({'plain':!![]});_0xb1be95[_0x70ba('0xab')]['created']=_0xfc0de6;if(_0xb1be95[_0x70ba('0xab')][_0x70ba('0xaf')]){if(_0xb1be95['account'][_0x70ba('0xb0')]){_0xb1be95[_0x70ba('0x8f')][_0x70ba('0xb1')]({'id':0x0,'priority':_0xb1be95['applications'][_0x70ba('0x58')]+0x1,'app':_0x70ba('0xb2'),'appdata':_0x70ba('0xb3'),'interval':_0x70ba('0xb4')});}}return db['ChatMessage'][_0x70ba('0x4c')]({'body':_0x5e5e6b['body']['body'],'ChatWebsiteId':_0x5e5e6b[_0x70ba('0x4b')]['id'],'ChatInteractionId':_0x5df64b['id'],'direction':'in','ContactId':_0xb1be95[_0x70ba('0x95')]['id'],'AttachmentId':_0x5e5e6b[_0x70ba('0x52')][_0x70ba('0xb5')]});})[_0x70ba('0x15')](function(_0x927046){_0xb1be95[_0x70ba('0x1e')]=_0x927046;if(_0xb1be95[_0x70ba('0xab')]['UserId']){return db[_0x70ba('0xb6')][_0x70ba('0x53')]({'attributes':['id',_0x70ba('0x2e')],'where':{'id':_0xb1be95[_0x70ba('0xab')]['UserId']}})[_0x70ba('0x15')](function(_0x5eec0f){if(_0x5eec0f){_0xb1be95['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5eec0f[_0x70ba('0x2e')]+','+(_0xb1be95[_0x70ba('0x94')]['waitForTheAssignedAgent']||0xa),'interval':_0x70ba('0xb4')});_0xb1be95[_0x70ba('0xb7')]=!![];}return respondWithRpcPromise(_0x70ba('0xb8'),_0x70ba('0xb9'),_0xb1be95);});}return respondWithRpcPromise(_0x70ba('0xb8'),_0x70ba('0xb9'),_0xb1be95);})['then'](function(_0x14f5b1){respondWithRpcPromise(_0x70ba('0xba'),_0x70ba('0xba'),{'event':_0x70ba('0xbb'),'message':_0x14f5b1},client9002);return _0x14f5b1;})['then'](respondWithResult(_0x28e339,null))['catch'](handleError(_0x28e339,null));};exports[_0x70ba('0xbc')]=function(_0xc6268e,_0xef2393){var _0x46f57d,_0x4aa467,_0x4f0cc2;var _0x5b4710=[];var _0x36703b={};var _0x5e04b6=_0xc6268e['files']||[];var _0xc40464=[];var _0x41918a;return db[_0x70ba('0x7d')]['describe']()['then'](function(_0x4f4934){if(!_0x4f4934){throw new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0x80'));}_0x5b4710=_[_0x70ba('0x81')](_['keys'](_0x4f4934),['createdAt','updatedAt',_0x70ba('0x83'),'ListId']);if(_0xc6268e['body']['id']){delete _0xc6268e[_0x70ba('0x52')]['id'];}if(_[_0x70ba('0x73')](_0xc6268e['body']['from'])){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))]['ValidationError'](_0x70ba('0x85')));}if(_[_0x70ba('0x73')](_0xc6268e['body']['body'])||_0xc6268e[_0x70ba('0x52')]['body']===''){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))]['ValidationError'](_0x70ba('0xbe')));}if(_[_0x70ba('0x73')](_0xc6268e[_0x70ba('0x52')][_0x70ba('0xbf')])){throw _0xef2393[_0x70ba('0x22')](0x1f4)[_0x70ba('0xbd')](new db[(_0x70ba('0x7e'))][(_0x70ba('0x7f'))](_0x70ba('0xc0')+_0x5b4710));}if(!_['includes'](_0x5b4710,_0xc6268e[_0x70ba('0x52')]['mapKeyOffline'])){throw _0xef2393[_0x70ba('0x22')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x70ba('0xc1')+_0x5b4710));}_0x36703b[_0xc6268e[_0x70ba('0x52')][_0x70ba('0xbf')]]=_0xc6268e[_0x70ba('0x52')][_0x70ba('0x84')];})[_0x70ba('0x15')](function(){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0xc6268e[_0x70ba('0x4b')]['id']},'include':[{'model':db[_0x70ba('0x8a')],'as':_0x70ba('0x8e')},{'model':db[_0x70ba('0xc2')],'as':'MailAccount'}]});})[_0x70ba('0x15')](handleEntityNotFound(_0xef2393,null))[_0x70ba('0x15')](function(_0x232e13){if(_0x232e13&&_0x232e13[_0x70ba('0x8e')]){_0x4aa467=_0x232e13;var _0x56100e=_[_0x70ba('0xd')](_0xc6268e[_0x70ba('0x52')],{'firstName':_0xc6268e[_0x70ba('0x52')]['from'],'phone':_0xc6268e[_0x70ba('0x52')][_0x70ba('0x84')],'ListId':_0x232e13[_0x70ba('0xc3')]});_0x56100e[_0xc6268e[_0x70ba('0x52')]['mapKeyOffline']]=_0xc6268e[_0x70ba('0x52')]['from'];return db[_0x70ba('0x7d')][_0x70ba('0xc4')]({'where':_0x36703b,'defaults':_0x56100e});}})[_0x70ba('0xac')](function(_0x1536cc){if(_0x1536cc){_0x4f0cc2=_0x1536cc;var _0x54df0d=fs[_0x70ba('0xc5')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0x70ba('0xc6'));var _0x2773df=ejs[_0x70ba('0xc7')](_0x54df0d,{'body':_[_0x70ba('0xc8')](_0xc6268e[_0x70ba('0x52')][_0x70ba('0x52')]),'bodyTitle':_0x4aa467[_0x70ba('0xc9')]});return db[_0x70ba('0xca')][_0x70ba('0x4c')]({'body':_0x2773df,'plainBody':htmlToText['fromString'](_0x2773df),'ContactId':_0x1536cc['id'],'ChatWebsiteId':_0x4aa467['id']});}})[_0x70ba('0x15')](function(_0x584939){_0x41918a=_0x584939;if(_0x5e04b6[_0x70ba('0x58')]){var _0x204372=_0x5e04b6[_0x70ba('0x32')](function(_0x790d7b){return{'name':_0x790d7b[_0x70ba('0xcb')],'basename':_0x790d7b[_0x70ba('0x63')],'type':_0x790d7b[_0x70ba('0xcc')],'ChatOfflineMessageId':_0x584939['id']};});_0xc40464=_0x204372['map'](_0x4bf752=>{var _0x70d514={'filename':_0x4bf752[_0x70ba('0x2e')],'path':path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0xcd'),'files',_0x70ba('0xce'),'offline-chat',_0x4bf752['basename'])};return _0x70d514;});if(!_0x4aa467[_0x70ba('0xcf')]){return db[_0x70ba('0xd0')]['transaction'](function(_0xff0716){return db['Attachment'][_0x70ba('0xd1')](_0x204372,{'transaction':_0xff0716});});}}})[_0x70ba('0x15')](function(){if(_0x41918a){_0x46f57d=_0x41918a;return db[_0x70ba('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x70ba('0xd2')],'as':_0x70ba('0xd3'),'raw':!![],'include':[{'model':db[_0x70ba('0xd4')],'as':_0x70ba('0xd4'),'raw':!![]}]}]});}})[_0x70ba('0x15')](function(_0x42bcea){if(_0x42bcea&&_0x42bcea['Smtp']&&_0x4aa467['forwardOffline']&&_0x4aa467[_0x70ba('0xd5')]){var _0x3d4881=_0x42bcea[_0x70ba('0xd6')]();return respondWithRpcPromise(_0x70ba('0xd7'),_0x70ba('0xd8'),{'account':_0x3d4881,'message':{'from':util[_0x70ba('0xa0')](_0x70ba('0xd9'),_0x42bcea[_0x70ba('0x2e')],_0x42bcea[_0x70ba('0xda')]||_0x42bcea['Smtp'][_0x70ba('0x4d')]),'to':_0x4aa467[_0x70ba('0xd5')],'subject':_0x4aa467[_0x70ba('0xdb')],'html':_0x46f57d[_0x70ba('0x52')],'attachments':_0xc40464}},client9003)[_0x70ba('0x15')](function(){return _0x46f57d;})[_0x70ba('0x20')](function(_0x1c0bfa){logger['error'](_0x1c0bfa);});}})[_0x70ba('0x15')](function(){if(_0x4aa467&&_0x4aa467[_0x70ba('0xcf')]&&_0x4aa467[_0x70ba('0xdc')]){var _0x393f9f=[];if(_0x5e04b6[_0x70ba('0x58')]){_0x393f9f=_0x5e04b6[_0x70ba('0x32')](function(_0x285242){return{'name':_0x285242[_0x70ba('0xcb')],'basename':_0x285242[_0x70ba('0x63')],'type':_0x285242[_0x70ba('0xcc')],'ChatOfflineMessageId':_0x41918a['id']};});}var _0x498eaa;if(!_['isNil'](_0x4aa467[_0x70ba('0xdd')])){var _0xe29063=_[_0x70ba('0x32')](_0xc6268e[_0x70ba('0x52')],function(_0x280ff1){return _0x280ff1;});var _0x2f1d41=_[_0x70ba('0xde')](_0xe29063)[0x0];var _0x541fd6=_[_0x70ba('0xdf')](_0x2f1d41,function(_0xf0f523){return _0xf0f523;});_0x498eaa=_0x541fd6[0x1][_0x4aa467[_0x70ba('0xdd')]];}var _0x36318c={'from':_0x4f0cc2[_0x70ba('0xda')],'firstName':_0x4f0cc2[_0x70ba('0x9b')],'lastName':_0x4f0cc2[_0x70ba('0x9c')],'mapKey':_0x70ba('0xda'),'message':{'from':_0x4f0cc2[_0x70ba('0xda')],'to':_0x4aa467[_0x70ba('0xc2')]['email'],'cc':'','subject':_['isNil'](_0x498eaa)?_0x4aa467[_0x70ba('0xdb')]:_0x498eaa,'messageId':'','sentAt':new Date(),'attach':_0x393f9f[_0x70ba('0x58')],'attachments':_0x393f9f,'originChannel':_0x70ba('0xe0'),'ChatWebsiteId':_0x4aa467['id'],'ChatOfflineMessageId':_0x46f57d['id'],'originTo':_0x4aa467[_0x70ba('0xc2')][_0x70ba('0xda')]},'body':_0x46f57d[_0x70ba('0x52')]};var _0xac585={'account':{'id':_0x4aa467[_0x70ba('0xdc')]},'body':_0x36318c,'log':_0x70ba('0xe1')};return respondWithRpcPromise(_0x70ba('0xe1'),'notifyMail',_0xac585,client9001)[_0x70ba('0x15')](function(){return _0x46f57d;})[_0x70ba('0x20')](function(_0x38e3a2){logger[_0x70ba('0x1c')](_0x38e3a2);});}return;})['then'](function(){if(_0x46f57d){return _0x46f57d;}})['then'](respondWithResult(_0xef2393,null))[_0x70ba('0x20')](function(_0x5b39c7){logger['error'](_0x70ba('0x20'),_0x5b39c7);for(var _0x1232b9 of _0x5e04b6){var _0x5898a7=path['join'](config[_0x70ba('0x69')],_0x70ba('0xcd'),_0x70ba('0xe2'),_0x70ba('0xce'),_0x70ba('0xe3'),_0x1232b9[_0x70ba('0x63')]);fs_extra['remove'](_0x5898a7)['catch'](function(_0x3659d0){logger[_0x70ba('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x5898a7,_0x3659d0);});}});};exports['addInteraction']=function(_0x12958b,_0x2c7d8d){return db['ChatInteraction']['find']({'where':{'id':_0x12958b[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2c7d8d,null))[_0x70ba('0x15')](function(_0x27df76){if(_0x27df76){return _0x27df76['addInteraction'](_0x12958b[_0x70ba('0x52')]['ids'],_[_0x70ba('0xe4')](_0x12958b['body'],[_0x70ba('0x5b'),'id'])||{});}})[_0x70ba('0x15')](respondWithResult(_0x2c7d8d,null))[_0x70ba('0x20')](handleError(_0x2c7d8d,null));};exports[_0x70ba('0xe5')]=function(_0x48ef56,_0x39cbff){var _0x48014f={'raw':![],'where':{}};var _0x455bfd={};var _0x27d93e={'count':0x0,'rows':[]};return db[_0x70ba('0x33')]['findOne']({'where':{'id':_0x48ef56['params']['id']}})['then'](handleEntityNotFound(_0x39cbff,null))[_0x70ba('0x15')](function(_0x48f634){if(_0x48f634){_0x455bfd[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0xa8')][_0x70ba('0x34')]);_0x455bfd[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x48ef56[_0x70ba('0x37')]);_0x455bfd[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x455bfd[_0x70ba('0x36')],_0x455bfd[_0x70ba('0x37')]);_0x48014f[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x455bfd[_0x70ba('0x36')],qs['fields'](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x48014f[_0x70ba('0x3a')]=_0x48014f[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x48014f[_0x70ba('0x3a')]:_0x455bfd['model'];if(!_0x48ef56[_0x70ba('0x37')][_0x70ba('0x3d')]('nolimit')){_0x48014f[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x24')]);_0x48014f[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x48014f[_0x70ba('0x3f')]=qs[_0x70ba('0x40')](_0x48ef56[_0x70ba('0x37')][_0x70ba('0x40')]);_0x48014f[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_['pick'](_0x48ef56[_0x70ba('0x37')],_0x455bfd['filters']));_0x48014f['where'][_0x70ba('0x59')]=_0x48f634['id'];if(_0x48ef56['query'][_0x70ba('0x41')]){_0x48014f[_0x70ba('0x42')]=_[_0x70ba('0x44')](_0x48014f[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x48014f[_0x70ba('0x3a')],function(_0xf3906e){var _0x105b68={};_0x105b68[_0xf3906e]={'$like':'%'+_0x48ef56[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x105b68;})});}_0x48014f=_[_0x70ba('0x44')]({},_0x48014f,_0x48ef56['options']);return db[_0x70ba('0xa8')][_0x70ba('0x25')]({'where':_0x48014f[_0x70ba('0x42')]})['then'](function(_0x204089){_0x27d93e['count']=_0x204089;if(_0x48ef56['query'][_0x70ba('0x46')]){_0x48014f[_0x70ba('0x47')]=[{'model':db[_0x70ba('0x7d')],'as':'Contact','required':![]},{'model':db[_0x70ba('0xb6')],'as':_0x70ba('0xe6'),'attributes':[_0x70ba('0x2e'),_0x70ba('0xe7'),'internal'],'required':![]},{'model':db[_0x70ba('0xe8')],'as':_0x70ba('0xe9'),'attributes':['id',_0x70ba('0x2e'),'color'],'where':_0x48ef56[_0x70ba('0x37')][_0x70ba('0xea')]?{'id':_0x48ef56['query'][_0x70ba('0xea')]}:undefined,'required':_0x48ef56['query']['tag']?!![]:![]}];}return db[_0x70ba('0xa8')]['findAll'](_0x48014f);})[_0x70ba('0x15')](function(_0x6d80e6){_0x27d93e[_0x70ba('0x49')]=_0x6d80e6;return _0x27d93e;});}})[_0x70ba('0x15')](respondWithFilteredResult(_0x39cbff,_0x48014f))[_0x70ba('0x20')](handleError(_0x39cbff,null));};function iftimePromise(_0x46fc83,_0x5ca299){return respondWithRpcPromise(_0x70ba('0xeb'),_0x70ba('0xec'),{'command':_0x5ca299[_0x70ba('0xed')]?util[_0x70ba('0xa0')]('iftime\x20%s,%s',_0x46fc83[_0x70ba('0xee')],_0x5ca299[_0x70ba('0xed')]):util['format']('iftime\x20%s',_0x46fc83[_0x70ba('0xee')])},client9002)[_0x70ba('0x15')](function(_0x344d78){var _0x4fe10b=_0x344d78&&_0x344d78[_0x70ba('0xef')]('true')>=0x0?!![]:![];logger[_0x70ba('0x16')](_0x70ba('0xf0'),_0x5ca299['id'],_0x46fc83['id'],_0x46fc83['interval'],_0x4fe10b?_0x70ba('0xf1'):_0x70ba('0xf2'),_0x5ca299['timezone']?_0x5ca299['timezone']:'No\x20timezone');return _0x4fe10b;})['catch'](function(_0xbbda92){logger[_0x70ba('0x1c')](_0x70ba('0xf0'),_0x5ca299['id'],_0x46fc83['id'],_0x46fc83['interval'],util[_0x70ba('0xf3')](_0xbbda92,{'showHidden':![],'depth':null}),_0x5ca299['timezone']?_0x5ca299[_0x70ba('0xed')]:_0x70ba('0xf4'));return![];});}exports[_0x70ba('0xec')]=function(_0x1427f8,_0x410088){var _0x4fd1a5=0x0;var _0x12e0e9=0x0;var _0x54668c=![];var _0x5567ce;var _0x5ad1d1;return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x1427f8[_0x70ba('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0x70ba('0xf5'),'include':[{'model':db[_0x70ba('0xf5')],'as':_0x70ba('0xf6'),'attributes':['id',_0x70ba('0xee')],'raw':!![]}]}]})[_0x70ba('0x15')](handleEntityNotFound(_0x410088,null))[_0x70ba('0x15')](function(_0x1f031d){if(_0x1f031d){_0x5567ce=_0x1f031d;return _0x1f031d[_0x70ba('0xf7')]({'raw':!![]});}})[_0x70ba('0x15')](function(_0x33ef13){if(_0x5567ce){if(_0x33ef13){_0x5ad1d1=_0x33ef13;}}return require(_0x70ba('0x6b'))[_0x70ba('0xf8')]();})[_0x70ba('0x15')](function(_0x10397e){if(_0x10397e){_0x12e0e9=_0x10397e[_0x70ba('0xf9')];_0x54668c=_0x10397e[_0x70ba('0x6c')];}})['then'](function(){return db[_0x70ba('0xa8')][_0x70ba('0x25')]({'where':{'closed':![]}});})[_0x70ba('0x15')](function(_0x58edf1){_0x4fd1a5=_0x58edf1;if(_0x12e0e9&&_0x58edf1>_0x12e0e9){return db[_0x70ba('0xfa')][_0x70ba('0x57')]({'where':{'id':0x1}})[_0x70ba('0x15')](function(_0x4141d5){if(_0x4141d5){_0x4141d5['increment'](_0x70ba('0xfb'));}});}})[_0x70ba('0x15')](function(){if(_0x5567ce[_0x70ba('0xf5')]&&_0x5567ce[_0x70ba('0xf5')][_0x70ba('0xf6')]){var _0x1c47c0=[];for(var _0x4c208e=0x0;_0x4c208e<_0x5567ce[_0x70ba('0xf5')][_0x70ba('0xf6')]['length'];_0x4c208e++){var _0x5f41f8=_0x5567ce['Interval'][_0x70ba('0xf6')][_0x4c208e]['get']({'plain':!![]});_0x1c47c0[_0x70ba('0xb1')](iftimePromise(_0x5f41f8,_0x5567ce));}return BPromise['all'](_0x1c47c0)['then'](function(_0x2e49be){return _[_0x70ba('0xfc')](_0x2e49be);});}else{return!![];}})[_0x70ba('0x15')](function(_0x1439d3){var _0x138af3=fs[_0x70ba('0xc5')](path[_0x70ba('0x6e')](config[_0x70ba('0x69')],_0x70ba('0xfd')),_0x70ba('0xc6'));var _0x125daf={'remote':_0x5567ce[_0x70ba('0xfe')],'query':querystring[_0x70ba('0x1b')](_[_0x70ba('0x44')](_0x5567ce[_0x70ba('0x29')]({'plain':!![]}),{'customerIp':_0x1427f8[_0x70ba('0x97')]['x-forwarded-for']||_0x1427f8['headers'][_0x70ba('0xff')]||_0x1427f8['connection'][_0x70ba('0x100')]||_0x1427f8['ip'],'referer':_0x1427f8[_0x70ba('0x97')]['referer'],'openedInteractions':_0x4fd1a5,'maxInteractions':_0x12e0e9,'virtual':_0x54668c[_0x70ba('0xf9')],'online':_0x1439d3,'custom':_0x54668c}))[_0x70ba('0x101')](/'/g,'\x5c\x27')};_0x410088[_0x70ba('0xbd')](ejs[_0x70ba('0xc7')](Mustache['render'](_0x138af3,_0x125daf),{'proactiveActions':_0x5ad1d1,'alignment':_0x5567ce[_0x70ba('0x102')],'verticalAlignment':_0x5567ce[_0x70ba('0x103')],'div_color':_0x5567ce[_0x70ba('0x104')],'labelText':_0x5567ce[_0x70ba('0x105')],'text_color':_0x5567ce['textColor'],'button_color':_0x5567ce[_0x70ba('0x106')],'background_color':_0x5567ce[_0x70ba('0x107')],'hideWhenOffline':_0x5567ce[_0x70ba('0x108')],'interval':_0x5567ce[_0x70ba('0x109')]}));})[_0x70ba('0x20')](handleError(_0x410088,null));};exports[_0x70ba('0x10a')]=function(_0x3637a7,_0x5ca739){var _0x365164=_0x3637a7['params']['id'];var _0x194e6b=_0x3637a7[_0x70ba('0x52')];var _0x162a5c=0xc8;var _0x41e6fd=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x70ba('0xd0')][_0x70ba('0x10b')][_0x70ba('0x10c')][_0x70ba('0x10d')]},function(_0x802a0){return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x365164},'transaction':_0x802a0})[_0x70ba('0x15')](function(_0x40ec93){if(_0x40ec93){return db[_0x70ba('0x10e')][_0x70ba('0x28')]({'where':{'ChatWebsiteId':_0x365164},'transaction':_0x802a0})['then'](function(){var _0x157781=_[_0x70ba('0x32')](_0x194e6b,function(_0x3ea5ec){_0x3ea5ec[_0x70ba('0x59')]=_0x365164;return _0x3ea5ec;});return db[_0x70ba('0x10e')][_0x70ba('0xd1')](_0x157781,{'transaction':_0x802a0});});}else{_0x162a5c=0x194;_0x41e6fd=[];}});})['then'](function(){if(_0x162a5c!==0x194){return db[_0x70ba('0x10e')][_0x70ba('0x10f')]({'where':{'ChatWebsiteId':_0x365164},'order':_0x70ba('0x92')})[_0x70ba('0x15')](function(_0x24beaa){_0x41e6fd=_0x24beaa;});}})[_0x70ba('0x20')](function(_0x276bf5){_0x162a5c=0x1f4;logger[_0x70ba('0x1c')](_0x276bf5[_0x70ba('0x2d')]);if(_0x276bf5[_0x70ba('0x2e')]){delete _0x276bf5[_0x70ba('0x2e')];}_0x41e6fd=_0x276bf5;})[_0x70ba('0x110')](function(){if(_0x41e6fd===null){_0x5ca739[_0x70ba('0x21')](_0x162a5c);}else{if(_0x162a5c===0x1f4){_0x5ca739[_0x70ba('0x22')](_0x162a5c)['send'](_0x41e6fd);}else{_0x5ca739[_0x70ba('0x22')](_0x162a5c)['json'](_0x41e6fd);}}});};exports[_0x70ba('0x111')]=function(_0x1c3dca,_0x4ea206){var _0x545325={};var _0x5a3c96={};var _0x3c627b;var _0x483333;return db[_0x70ba('0x33')][_0x70ba('0x57')]({'where':{'id':_0x1c3dca[_0x70ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea206,null))['then'](function(_0x37a4e6){if(_0x37a4e6){_0x3c627b=_0x37a4e6;_0x5a3c96[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x10e')][_0x70ba('0x34')]);_0x5a3c96[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x1c3dca[_0x70ba('0x37')]);_0x5a3c96[_0x70ba('0x39')]=_[_0x70ba('0x3b')](_0x5a3c96['model'],_0x5a3c96['query']);_0x545325[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x5a3c96[_0x70ba('0x36')],qs['fields'](_0x1c3dca[_0x70ba('0x37')]['fields']));_0x545325[_0x70ba('0x3a')]=_0x545325[_0x70ba('0x3a')]['length']?_0x545325[_0x70ba('0x3a')]:_0x5a3c96[_0x70ba('0x36')];_0x545325[_0x70ba('0x3f')]=qs['sort'](_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x40')]);_0x545325[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x1c3dca['query'],_0x5a3c96[_0x70ba('0x39')]));if(_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x41')]){_0x545325['where']=_[_0x70ba('0x44')](_0x545325[_0x70ba('0x42')],{'$or':_['map'](_0x545325['attributes'],function(_0x5b2da3){var _0x38efa7={};_0x38efa7[_0x5b2da3]={'$like':'%'+_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x38efa7;})});}_0x545325=_['merge']({},_0x545325,_0x1c3dca[_0x70ba('0x45')]);return _0x3c627b['getApplications'](_0x545325);}})[_0x70ba('0x15')](function(_0x427106){if(_0x427106){_0x483333=_0x427106[_0x70ba('0x58')];if(!_0x1c3dca[_0x70ba('0x37')]['hasOwnProperty']('nolimit')){_0x545325[_0x70ba('0x24')]=qs[_0x70ba('0x24')](_0x1c3dca[_0x70ba('0x37')]['limit']);_0x545325[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x1c3dca[_0x70ba('0x37')][_0x70ba('0x26')]);}return _0x3c627b['getApplications'](_0x545325);}})[_0x70ba('0x15')](function(_0x44d4e6){if(_0x44d4e6){return _0x44d4e6?{'count':_0x483333,'rows':_0x44d4e6}:null;}})[_0x70ba('0x15')](respondWithResult(_0x4ea206,null))[_0x70ba('0x20')](handleError(_0x4ea206,null));};exports[_0x70ba('0x112')]=function(_0x159c6f,_0x3903d6){return db[_0x70ba('0x113')][_0x70ba('0x53')]({'where':{'id':_0x159c6f['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x3903d6,null))[_0x70ba('0x15')](function(_0x27266b){if(_0x27266b){return _0x27266b[_0x70ba('0x112')](_0x159c6f[_0x70ba('0x52')][_0x70ba('0x5b')],_[_0x70ba('0xe4')](_0x159c6f['body'],[_0x70ba('0x5b'),'id'])||{});}})[_0x70ba('0x15')](respondWithResult(_0x3903d6,null))['catch'](handleError(_0x3903d6,null));};exports[_0x70ba('0xf7')]=function(_0x14f242,_0x64b525){var _0x127807={};var _0x3bd943={};var _0x5136b9;var _0x3d39a9;return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x14f242[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x64b525,null))[_0x70ba('0x15')](function(_0x1b6df6){if(_0x1b6df6){_0x5136b9=_0x1b6df6;_0x3bd943[_0x70ba('0x36')]=_[_0x70ba('0x38')](db[_0x70ba('0x114')][_0x70ba('0x34')]);_0x3bd943[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x14f242['query']);_0x3bd943['filters']=_[_0x70ba('0x3b')](_0x3bd943['model'],_0x3bd943[_0x70ba('0x37')]);_0x127807[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x3bd943[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x14f242['query']['fields']));_0x127807['attributes']=_0x127807[_0x70ba('0x3a')]['length']?_0x127807[_0x70ba('0x3a')]:_0x3bd943['model'];_0x127807['order']=qs[_0x70ba('0x40')](_0x14f242['query'][_0x70ba('0x40')]);_0x127807[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x14f242[_0x70ba('0x37')],_0x3bd943[_0x70ba('0x39')]));if(_0x14f242[_0x70ba('0x37')][_0x70ba('0x41')]){_0x127807[_0x70ba('0x42')]=_['merge'](_0x127807[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x127807['attributes'],function(_0x2dc128){var _0x5aa67f={};_0x5aa67f[_0x2dc128]={'$like':'%'+_0x14f242[_0x70ba('0x37')]['filter']+'%'};return _0x5aa67f;})});}_0x127807=_[_0x70ba('0x44')]({},_0x127807,_0x14f242['options']);return _0x5136b9['getProactiveActions'](_0x127807);}})['then'](function(_0x29ac90){if(_0x29ac90){_0x3d39a9=_0x29ac90['length'];if(!_0x14f242[_0x70ba('0x37')][_0x70ba('0x3d')](_0x70ba('0x3e'))){_0x127807[_0x70ba('0x24')]=qs['limit'](_0x14f242[_0x70ba('0x37')][_0x70ba('0x24')]);_0x127807['offset']=qs[_0x70ba('0x26')](_0x14f242['query'][_0x70ba('0x26')]);}return _0x5136b9[_0x70ba('0xf7')](_0x127807);}})[_0x70ba('0x15')](function(_0x3a7eb6){if(_0x3a7eb6){return _0x3a7eb6?{'count':_0x3d39a9,'rows':_0x3a7eb6}:null;}})[_0x70ba('0x15')](respondWithResult(_0x64b525,null))['catch'](handleError(_0x64b525,null));};exports['getFields']=function(_0x87c389,_0x414704){var _0x3fa3e5=_0x87c389['query']['online']==='false'?_0x70ba('0x115'):_0x70ba('0x116');return db[_0x70ba('0x33')]['find']({'attributes':['id',_0x3fa3e5],'where':{'id':_0x87c389['params']['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x414704,null))[_0x70ba('0x15')](function(_0xf966b8){if(_0xf966b8){var _0x444c5a=_0xf966b8[_0x3fa3e5];var _0x3aa637=_0x444c5a&&_0x444c5a[_0x70ba('0x117')]?_0x444c5a[_0x70ba('0x117')]:[];_0x414704[_0x70ba('0xbd')]({'fromKey':_[_0x70ba('0x73')](_0x444c5a['fromKey'])?undefined:_0x444c5a[_0x70ba('0x118')],'count':_0x3aa637[_0x70ba('0x58')],'rows':_0x3aa637});}})[_0x70ba('0x20')](handleError(_0x414704,null));};exports[_0x70ba('0x119')]=function(_0x54b253,_0x2d775a){var _0x23c420={'raw':![],'where':{}};var _0x4822d2={};var _0x148c21={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x54b253[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x2d775a,null))[_0x70ba('0x15')](function(_0x2a590a){if(_0x2a590a){_0x4822d2['model']=_[_0x70ba('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x4822d2[_0x70ba('0x37')]=_[_0x70ba('0x38')](_0x54b253[_0x70ba('0x37')]);_0x4822d2['filters']=_['intersection'](_0x4822d2[_0x70ba('0x36')],_0x4822d2['query']);_0x23c420[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x4822d2[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x54b253[_0x70ba('0x37')][_0x70ba('0x3c')]));_0x23c420['attributes']=_0x23c420[_0x70ba('0x3a')][_0x70ba('0x58')]?_0x23c420[_0x70ba('0x3a')]:_0x4822d2[_0x70ba('0x36')];if(!_0x54b253[_0x70ba('0x37')][_0x70ba('0x3d')]('nolimit')){_0x23c420['limit']=qs[_0x70ba('0x24')](_0x54b253['query'][_0x70ba('0x24')]);_0x23c420[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x54b253[_0x70ba('0x37')][_0x70ba('0x26')]);}_0x23c420['order']=qs['sort'](_0x54b253[_0x70ba('0x37')]['sort']);_0x23c420[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x54b253['query'],_0x4822d2[_0x70ba('0x39')]));_0x23c420[_0x70ba('0x42')][_0x70ba('0x59')]=_0x2a590a['id'];if(_0x54b253[_0x70ba('0x37')][_0x70ba('0x41')]){_0x23c420['where']=_[_0x70ba('0x44')](_0x23c420[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0x23c420['attributes'],function(_0x329644){var _0x55fb0a={};_0x55fb0a[_0x329644]={'$like':'%'+_0x54b253[_0x70ba('0x37')][_0x70ba('0x41')]+'%'};return _0x55fb0a;})});}_0x23c420=_[_0x70ba('0x44')]({},_0x23c420,_0x54b253['options']);return db[_0x70ba('0xca')][_0x70ba('0x25')]({'where':_0x23c420[_0x70ba('0x42')]})[_0x70ba('0x15')](function(_0x2323b3){_0x148c21[_0x70ba('0x25')]=_0x2323b3;if(_0x54b253[_0x70ba('0x37')]['includeAll']){_0x23c420[_0x70ba('0x47')]=[{'all':!![]}];}else{_0x23c420[_0x70ba('0x47')]=[{'model':db[_0x70ba('0x7d')],'as':_0x70ba('0x11a'),'required':![]},{'model':db['Attachment'],'as':_0x70ba('0x11b'),'required':![]}];}return db[_0x70ba('0xca')][_0x70ba('0x48')](_0x23c420);})[_0x70ba('0x15')](function(_0x36eafe){_0x148c21[_0x70ba('0x49')]=_0x36eafe;return _0x148c21;});}})['then'](respondWithFilteredResult(_0x2d775a,_0x23c420))['catch'](handleError(_0x2d775a,null));};exports[_0x70ba('0x11c')]=function(_0x4171a6,_0x2a1c36){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x4171a6[_0x70ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a1c36,null))[_0x70ba('0x15')](function(_0x2435aa){if(_0x2435aa){return _0x2435aa[_0x70ba('0x11c')](_0x4171a6['body'][_0x70ba('0x5b')],_[_0x70ba('0xe4')](_0x4171a6[_0x70ba('0x52')],[_0x70ba('0x5b'),'id'])||{})['spread'](function(_0x11e4d1){for(var _0x28b15e=0x0;_0x28b15e<_0x4171a6[_0x70ba('0x52')][_0x70ba('0x5b')][_0x70ba('0x58')];_0x28b15e+=0x1){socket[_0x70ba('0x11d')](_0x70ba('0x11e'),{'UserId':Number(_0x4171a6[_0x70ba('0x52')][_0x70ba('0x5b')][_0x28b15e]),'ChatWebsiteId':Number(_0x4171a6[_0x70ba('0x4b')]['id'])});}return _0x11e4d1;});}})[_0x70ba('0x15')](respondWithResult(_0x2a1c36,null))[_0x70ba('0x20')](handleError(_0x2a1c36,null));};exports[_0x70ba('0x11f')]=function(_0x5a4371,_0xcbc178){return db[_0x70ba('0x33')][_0x70ba('0x53')]({'where':{'id':_0x5a4371[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0xcbc178,null))['then'](function(_0x4128a2){if(_0x4128a2){return _0x4128a2[_0x70ba('0x11f')](_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')])[_0x70ba('0x15')](function(){if(_[_0x70ba('0x120')](_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')])){for(var _0xb85429=0x0;_0xb85429<_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')][_0x70ba('0x58')];_0xb85429+=0x1){socket[_0x70ba('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x5a4371['query'][_0x70ba('0x5b')][_0xb85429]),'ChatWebsiteId':Number(_0x5a4371[_0x70ba('0x4b')]['id'])});}}else{socket[_0x70ba('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x5a4371[_0x70ba('0x37')][_0x70ba('0x5b')]),'ChatWebsiteId':Number(_0x5a4371[_0x70ba('0x4b')]['id'])});}});}})[_0x70ba('0x15')](respondWithStatusCode(_0xcbc178,null))['catch'](handleError(_0xcbc178,null));};exports[_0x70ba('0x121')]=function(_0x14e603,_0x48dcce){var _0xf9acab={};var _0x3ad18e={};var _0x1c460f;var _0x52a29f;return db['ChatWebsite'][_0x70ba('0x57')]({'where':{'id':_0x14e603[_0x70ba('0x4b')]['id']}})[_0x70ba('0x15')](handleEntityNotFound(_0x48dcce,null))[_0x70ba('0x15')](function(_0x4c15ee){if(_0x4c15ee){_0x1c460f=_0x4c15ee;_0x3ad18e[_0x70ba('0x36')]=_['keys'](db[_0x70ba('0xb6')][_0x70ba('0x34')]);_0x3ad18e[_0x70ba('0x37')]=_['keys'](_0x14e603[_0x70ba('0x37')]);_0x3ad18e['filters']=_[_0x70ba('0x3b')](_0x3ad18e[_0x70ba('0x36')],_0x3ad18e[_0x70ba('0x37')]);_0xf9acab['attributes']=_[_0x70ba('0x3b')](_0x3ad18e[_0x70ba('0x36')],qs[_0x70ba('0x3c')](_0x14e603['query']['fields']));_0xf9acab[_0x70ba('0x3a')]=_0xf9acab[_0x70ba('0x3a')][_0x70ba('0x58')]?_0xf9acab['attributes']:_0x3ad18e[_0x70ba('0x36')];_0xf9acab[_0x70ba('0x3f')]=qs['sort'](_0x14e603[_0x70ba('0x37')][_0x70ba('0x40')]);_0xf9acab[_0x70ba('0x42')]=qs[_0x70ba('0x39')](_[_0x70ba('0x5e')](_0x14e603[_0x70ba('0x37')],_0x3ad18e[_0x70ba('0x39')]));if(_0x14e603[_0x70ba('0x37')][_0x70ba('0x41')]){_0xf9acab['where']=_[_0x70ba('0x44')](_0xf9acab[_0x70ba('0x42')],{'$or':_[_0x70ba('0x32')](_0xf9acab['attributes'],function(_0x25f0fc){var _0x2baf04={};_0x2baf04[_0x25f0fc]={'$like':'%'+_0x14e603[_0x70ba('0x37')]['filter']+'%'};return _0x2baf04;})});}_0xf9acab=_[_0x70ba('0x44')]({},_0xf9acab,_0x14e603['options']);return _0x1c460f['getAgents'](_0xf9acab);}})['then'](function(_0x4679c9){if(_0x4679c9){_0x52a29f=_0x4679c9[_0x70ba('0x58')];if(!_0x14e603['query'][_0x70ba('0x3d')]('nolimit')){_0xf9acab['limit']=qs[_0x70ba('0x24')](_0x14e603['query'][_0x70ba('0x24')]);_0xf9acab[_0x70ba('0x26')]=qs[_0x70ba('0x26')](_0x14e603[_0x70ba('0x37')]['offset']);}return _0x1c460f[_0x70ba('0x121')](_0xf9acab);}})[_0x70ba('0x15')](function(_0x247767){if(_0x247767){return _0x247767?{'count':_0x52a29f,'rows':_0x247767}:null;}})[_0x70ba('0x15')](respondWithResult(_0x48dcce,null))[_0x70ba('0x20')](handleError(_0x48dcce,null));}; \ No newline at end of file +var _0x9335=['systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','spread','firstName','interaction','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','mimetype','server','basename','openNewInteraction','sequelize','Attachment','bulkCreate','CloudProvider','Smtp','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','findAndCountAll','priority','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','status','json','offset','limit','undefined','count','set','destroy','get','ChatWebsites','end','sendStatus','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','mandatoryDispositionPause','include','options','create','role','autoAssociation','UserProfileResource','update','body','find','Pause','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','pick','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9335,0xab));var _0x5933=function(_0x1633c5,_0x58f710){_0x1633c5=_0x1633c5-0x0;var _0x54b0bd=_0x9335[_0x1633c5];return _0x54b0bd;};'use strict';var BPromise=require(_0x5933('0x0'));var Mustache=require(_0x5933('0x1'));var util=require('util');var path=require(_0x5933('0x2'));var ejs=require(_0x5933('0x3'));var fs=require('fs');var fs_extra=require(_0x5933('0x4'));var _=require(_0x5933('0x5'));var querystring=require(_0x5933('0x6'));var Redis=require(_0x5933('0x7'));var qs=require(_0x5933('0x8'));var logger=require('../../config/logger')(_0x5933('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5933('0xa')]=_[_0x5933('0xb')](config[_0x5933('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5933('0xc'))(new Redis(config[_0x5933('0xa')]));require(_0x5933('0xd'))[_0x5933('0xe')](socket);var htmlToText=require(_0x5933('0xf'));var jayson=require(_0x5933('0x10'));var client=jayson[_0x5933('0x11')][_0x5933('0x12')]({'port':0x232c});var client9002=jayson[_0x5933('0x11')][_0x5933('0x12')]({'port':0x232a});var client9003=jayson[_0x5933('0x11')][_0x5933('0x12')]({'port':0x232b});var client9001=jayson[_0x5933('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1e698e,_0x5af679,_0x8b6bad,_0x1b4428){return new BPromise(function(_0x12a173,_0x4e817c){var _0x104825=_0x1b4428||client;return _0x104825['request'](_0x1e698e,_0x8b6bad)[_0x5933('0x13')](function(_0x4fc51d){logger[_0x5933('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5af679,_0x5933('0x15'));logger['debug'](_0x5933('0x16'),_0x5af679,_0x5933('0x15'),JSON[_0x5933('0x17')](_0x4fc51d));if(_0x4fc51d['error']){if(_0x4fc51d['error'][_0x5933('0x18')]===0x1f4){logger[_0x5933('0x19')](_0x5933('0x1a'),_0x5af679,_0x4fc51d['error']['message']);return _0x4e817c(_0x4fc51d[_0x5933('0x19')]['message']);}logger[_0x5933('0x19')](_0x5933('0x1a'),_0x5af679,_0x4fc51d[_0x5933('0x19')]['message']);return _0x12a173(_0x4fc51d[_0x5933('0x19')][_0x5933('0x1b')]);}else{logger[_0x5933('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5af679,_0x5933('0x15'));_0x12a173(_0x4fc51d['result'][_0x5933('0x1b')]);}})['catch'](function(_0x1343b4){logger['error'](_0x5933('0x1a'),_0x5af679,_0x1343b4);_0x4e817c(_0x1343b4);});});}function respondWithStatusCode(_0x50026f,_0x54a25a){_0x54a25a=_0x54a25a||0xcc;return function(_0x4bb547){if(_0x4bb547){return _0x50026f['sendStatus'](_0x54a25a);}return _0x50026f[_0x5933('0x1c')](_0x54a25a)['end']();};}function respondWithResult(_0x1a2f5d,_0x544f23){_0x544f23=_0x544f23||0xc8;return function(_0x4f538a){if(_0x4f538a){return _0x1a2f5d[_0x5933('0x1c')](_0x544f23)[_0x5933('0x1d')](_0x4f538a);}};}function respondWithFilteredResult(_0x297b15,_0x56e8a9){return function(_0xd2320){if(_0xd2320){var _0x101a7b=typeof _0x56e8a9[_0x5933('0x1e')]==='undefined'&&typeof _0x56e8a9[_0x5933('0x1f')]===_0x5933('0x20');var _0x49c49c=_0xd2320[_0x5933('0x21')];var _0x148020=_0x101a7b?0x0:_0x56e8a9['offset'];var _0x253ff1=_0x101a7b?_0xd2320['count']:_0x56e8a9[_0x5933('0x1e')]+_0x56e8a9[_0x5933('0x1f')];var _0x1af598;if(_0x253ff1>=_0x49c49c){_0x253ff1=_0x49c49c;_0x1af598=0xc8;}else{_0x1af598=0xce;}_0x297b15['status'](_0x1af598);return _0x297b15[_0x5933('0x22')]('Content-Range',_0x148020+'-'+_0x253ff1+'/'+_0x49c49c)[_0x5933('0x1d')](_0xd2320);}return null;};}function saveUpdates(_0x2d15dd){return function(_0x5e7526){if(_0x5e7526){return _0x5e7526['update'](_0x2d15dd)['then'](function(_0x3eb646){return _0x3eb646;});}return null;};}function removeEntity(_0x1a5f25){return function(_0x4bcd5f){if(_0x4bcd5f){return _0x4bcd5f[_0x5933('0x23')]()[_0x5933('0x13')](function(){var _0x22ef10=_0x4bcd5f[_0x5933('0x24')]({'plain':!![]});var _0x56256e=_0x5933('0x25');return db['UserProfileResource'][_0x5933('0x23')]({'where':{'type':_0x56256e,'resourceId':_0x22ef10['id']}})['then'](function(){return _0x4bcd5f;});})[_0x5933('0x13')](function(){_0x1a5f25[_0x5933('0x1c')](0xcc)[_0x5933('0x26')]();});}};}function handleEntityNotFound(_0x3d8cf3){return function(_0x4e5dc2){if(!_0x4e5dc2){_0x3d8cf3[_0x5933('0x27')](0x194);}return _0x4e5dc2;};}function handleError(_0x13e18f,_0x5b0c9e){_0x5b0c9e=_0x5b0c9e||0x1f4;return function(_0x486edd){logger[_0x5933('0x19')](_0x486edd['stack']);if(_0x486edd['name']){delete _0x486edd[_0x5933('0x28')];}_0x13e18f[_0x5933('0x1c')](_0x5b0c9e)[_0x5933('0x29')](_0x486edd);};}exports[_0x5933('0x2a')]=function(_0x4f37b1,_0x5e3a34){var _0x4ca849={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5e8128={},_0x27ac93={'count':0x0,'rows':[]};var _0x5ae4b2=_[_0x5933('0x2b')](db[_0x5933('0x2c')][_0x5933('0x2d')],function(_0x37afcf){return{'name':_0x37afcf[_0x5933('0x2e')],'type':_0x37afcf[_0x5933('0x2f')][_0x5933('0x30')]};});_0x5e8128[_0x5933('0x31')]=_[_0x5933('0x2b')](_0x5ae4b2,_0x5933('0x28'));_0x5e8128['query']=_[_0x5933('0x32')](_0x4f37b1[_0x5933('0x33')]);_0x5e8128[_0x5933('0x34')]=_[_0x5933('0x35')](_0x5e8128[_0x5933('0x31')],_0x5e8128[_0x5933('0x33')]);_0x4ca849[_0x5933('0x36')]=_[_0x5933('0x35')](_0x5e8128[_0x5933('0x31')],qs[_0x5933('0x37')](_0x4f37b1['query']['fields']));_0x4ca849[_0x5933('0x36')]=_0x4ca849[_0x5933('0x36')][_0x5933('0x38')]?_0x4ca849['attributes']:_0x5e8128['model'];if(!_0x4f37b1[_0x5933('0x33')][_0x5933('0x39')]('nolimit')){_0x4ca849[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0x4f37b1[_0x5933('0x33')][_0x5933('0x1f')]);_0x4ca849[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x4f37b1['query']['offset']);}_0x4ca849[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x4f37b1[_0x5933('0x33')][_0x5933('0x3b')]);_0x4ca849[_0x5933('0x3c')]=qs[_0x5933('0x34')](_['pick'](_0x4f37b1[_0x5933('0x33')],_0x5e8128[_0x5933('0x34')]),_0x5ae4b2);if(_0x4f37b1[_0x5933('0x33')]['filter']){_0x4ca849[_0x5933('0x3c')]=_[_0x5933('0x3d')](_0x4ca849[_0x5933('0x3c')],{'$or':_[_0x5933('0x2b')](_0x5ae4b2,function(_0x11325f){if(_0x11325f[_0x5933('0x2f')]!==_0x5933('0x3e')){var _0x32e93c={};_0x32e93c[_0x11325f[_0x5933('0x28')]]={'$like':'%'+_0x4f37b1[_0x5933('0x33')]['filter']+'%'};return _0x32e93c;}})});}_0x4ca849=_[_0x5933('0x3d')]({},_0x4ca849,_0x4f37b1['options']);var _0x5e17f4={'where':_0x4ca849['where']};return db[_0x5933('0x2c')]['count'](_0x5e17f4)['then'](function(_0x2c49dc){_0x27ac93[_0x5933('0x21')]=_0x2c49dc;if(_0x4f37b1['query'][_0x5933('0x3f')]){_0x4ca849['include']=[{'all':!![]}];}return db[_0x5933('0x2c')][_0x5933('0x40')](_0x4ca849);})['then'](function(_0x4ab791){_0x27ac93[_0x5933('0x41')]=_0x4ab791;return _0x27ac93;})[_0x5933('0x13')](respondWithFilteredResult(_0x5e3a34,_0x4ca849))[_0x5933('0x42')](handleError(_0x5e3a34,null));};exports[_0x5933('0x43')]=function(_0x3b7089,_0x4da269){var _0x14f463={'raw':![],'where':{'id':_0x3b7089[_0x5933('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0x5933('0x45')}]},_0xa744b7={};_0xa744b7[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0x2c')]['rawAttributes']);_0xa744b7[_0x5933('0x33')]=_[_0x5933('0x32')](_0x3b7089[_0x5933('0x33')]);_0xa744b7[_0x5933('0x34')]=_['intersection'](_0xa744b7[_0x5933('0x31')],_0xa744b7[_0x5933('0x33')]);_0x14f463[_0x5933('0x36')]=_[_0x5933('0x35')](_0xa744b7[_0x5933('0x31')],qs[_0x5933('0x37')](_0x3b7089[_0x5933('0x33')][_0x5933('0x37')]));_0x14f463[_0x5933('0x36')]=_0x14f463[_0x5933('0x36')]['length']?_0x14f463[_0x5933('0x36')]:_0xa744b7['model'];if(_0x3b7089[_0x5933('0x33')]['includeAll']){_0x14f463[_0x5933('0x46')]=[{'all':!![]}];}_0x14f463=_['merge']({},_0x14f463,_0x3b7089[_0x5933('0x47')]);return db[_0x5933('0x2c')]['find'](_0x14f463)[_0x5933('0x13')](handleEntityNotFound(_0x4da269,null))['then'](respondWithResult(_0x4da269,null))[_0x5933('0x42')](handleError(_0x4da269,null));};exports[_0x5933('0x48')]=function(_0x2680be,_0x3b808c){return db[_0x5933('0x2c')][_0x5933('0x48')](_0x2680be['body'],{})[_0x5933('0x13')](function(_0x273718){var _0x4310a3=_0x2680be['user'][_0x5933('0x24')]({'plain':!![]});if(!_0x4310a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4310a3[_0x5933('0x49')]==='user'){var _0xa75fe=_0x273718[_0x5933('0x24')]({'plain':!![]});var _0x39136e=_0x5933('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x39136e,'userProfileId':_0x4310a3['userProfileId']},'raw':!![]})[_0x5933('0x13')](function(_0x2263e0){if(_0x2263e0&&_0x2263e0[_0x5933('0x4a')]===0x0){return db[_0x5933('0x4b')][_0x5933('0x48')]({'name':_0xa75fe[_0x5933('0x28')],'resourceId':_0xa75fe['id'],'type':_0x2263e0['name'],'sectionId':_0x2263e0['id']},{})['then'](function(){return _0x273718;});}else{return _0x273718;}})[_0x5933('0x42')](function(_0x11fc26){logger[_0x5933('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11fc26);throw _0x11fc26;});}return _0x273718;})[_0x5933('0x13')](respondWithResult(_0x3b808c,0xc9))[_0x5933('0x42')](handleError(_0x3b808c,null));};exports[_0x5933('0x4c')]=function(_0x476530,_0x71f426){if(_0x476530[_0x5933('0x4d')]['id']){delete _0x476530[_0x5933('0x4d')]['id'];}return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x476530[_0x5933('0x44')]['id']},'include':[{'model':db[_0x5933('0x4f')],'as':_0x5933('0x45')}]})[_0x5933('0x13')](handleEntityNotFound(_0x71f426,null))['then'](saveUpdates(_0x476530[_0x5933('0x4d')],null))[_0x5933('0x13')](respondWithResult(_0x71f426,null))[_0x5933('0x42')](handleError(_0x71f426,null));};exports[_0x5933('0x23')]=function(_0x43b046,_0x2d8cf5){return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x43b046[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x2d8cf5,null))[_0x5933('0x13')](removeEntity(_0x2d8cf5,null))[_0x5933('0x42')](handleError(_0x2d8cf5,null));};exports[_0x5933('0x50')]=function(_0x6cd137,_0x2a50d9){return db[_0x5933('0x2c')]['describe']()['then'](respondWithResult(_0x2a50d9,null))[_0x5933('0x42')](handleError(_0x2a50d9,null));};exports[_0x5933('0x51')]=function(_0x43998c,_0x1852df){if(_0x43998c[_0x5933('0x4d')]['id']){delete _0x43998c[_0x5933('0x4d')]['id'];}return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x43998c[_0x5933('0x44')]['id']}})['then'](handleEntityNotFound(_0x1852df,null))['then'](function(_0x1a7e76){if(_0x1a7e76){_0x43998c['body'][_0x5933('0x52')]=_0x1a7e76['id'];return db['Disposition']['create'](_0x43998c[_0x5933('0x4d')]);}})['then'](respondWithResult(_0x1852df,null))['catch'](handleError(_0x1852df,null));};exports[_0x5933('0x53')]=function(_0xac263,_0x10e6c5){var _0x305669={'raw':![],'where':{}};var _0x91587e={};var _0x47a026={'count':0x0,'rows':[]};return db[_0x5933('0x2c')]['findOne']({'where':{'id':_0xac263[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x10e6c5,null))[_0x5933('0x13')](function(_0x24698a){if(_0x24698a){_0x91587e[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0x54')][_0x5933('0x2d')]);_0x91587e[_0x5933('0x33')]=_[_0x5933('0x32')](_0xac263[_0x5933('0x33')]);_0x91587e[_0x5933('0x34')]=_['intersection'](_0x91587e[_0x5933('0x31')],_0x91587e[_0x5933('0x33')]);_0x305669[_0x5933('0x36')]=_['intersection'](_0x91587e['model'],qs[_0x5933('0x37')](_0xac263[_0x5933('0x33')][_0x5933('0x37')]));_0x305669[_0x5933('0x36')]=_0x305669[_0x5933('0x36')][_0x5933('0x38')]?_0x305669[_0x5933('0x36')]:_0x91587e['model'];if(!_0xac263[_0x5933('0x33')][_0x5933('0x39')]('nolimit')){_0x305669[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0xac263[_0x5933('0x33')][_0x5933('0x1f')]);_0x305669[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0xac263[_0x5933('0x33')][_0x5933('0x1e')]);}_0x305669[_0x5933('0x3a')]=qs['sort'](_0xac263['query']['sort']);_0x305669['where']=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0xac263['query'],_0x91587e['filters']));_0x305669[_0x5933('0x3c')]['ChatWebsiteId']=_0x24698a['id'];if(_0xac263[_0x5933('0x33')][_0x5933('0x56')]){_0x305669[_0x5933('0x3c')]=_['merge'](_0x305669[_0x5933('0x3c')],{'$or':_['map'](_0x305669[_0x5933('0x36')],function(_0xc52c42){var _0x577129={};_0x577129[_0xc52c42]={'$like':'%'+_0xac263[_0x5933('0x33')][_0x5933('0x56')]+'%'};return _0x577129;})});}_0x305669=_[_0x5933('0x3d')]({},_0x305669,_0xac263[_0x5933('0x47')]);return db['Disposition'][_0x5933('0x21')]({'where':_0x305669[_0x5933('0x3c')]})['then'](function(_0x2edb6e){_0x47a026[_0x5933('0x21')]=_0x2edb6e;if(_0xac263['query']['includeAll']){_0x305669['include']=[{'all':!![]}];}return db[_0x5933('0x54')]['findAll'](_0x305669);})[_0x5933('0x13')](function(_0x4a0f53){_0x47a026[_0x5933('0x41')]=_0x4a0f53;return _0x47a026;});}})[_0x5933('0x13')](respondWithFilteredResult(_0x10e6c5,_0x305669))[_0x5933('0x42')](handleError(_0x10e6c5,null));};exports[_0x5933('0x57')]=function(_0x4d7661,_0x3c443d){return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x4d7661[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x3c443d,null))[_0x5933('0x13')](function(_0x5dbad5){if(_0x5dbad5){return _0x5dbad5[_0x5933('0x57')](_0x4d7661['query'][_0x5933('0x58')]);}})[_0x5933('0x13')](respondWithStatusCode(_0x3c443d,null))[_0x5933('0x42')](handleError(_0x3c443d,null));};exports[_0x5933('0x59')]=function(_0x241160,_0x1caabb){if(_0x241160['body']['id']){delete _0x241160[_0x5933('0x4d')]['id'];}return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x241160[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x1caabb,null))[_0x5933('0x13')](function(_0x2b6321){if(_0x2b6321){_0x241160[_0x5933('0x4d')][_0x5933('0x52')]=_0x2b6321['id'];return db[_0x5933('0x5a')][_0x5933('0x48')](_0x241160[_0x5933('0x4d')]);}})[_0x5933('0x13')](respondWithResult(_0x1caabb,null))[_0x5933('0x42')](handleError(_0x1caabb,null));};exports[_0x5933('0x5b')]=function(_0x2419d7,_0x22d503){var _0x2b58ce={'raw':![],'where':{}};var _0x36862a={};var _0x51c28b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5933('0x5c')]({'where':{'id':_0x2419d7[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x22d503,null))[_0x5933('0x13')](function(_0xfb586d){if(_0xfb586d){_0x36862a[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0x5a')]['rawAttributes']);_0x36862a['query']=_['keys'](_0x2419d7['query']);_0x36862a[_0x5933('0x34')]=_[_0x5933('0x35')](_0x36862a[_0x5933('0x31')],_0x36862a[_0x5933('0x33')]);_0x2b58ce[_0x5933('0x36')]=_[_0x5933('0x35')](_0x36862a[_0x5933('0x31')],qs[_0x5933('0x37')](_0x2419d7[_0x5933('0x33')][_0x5933('0x37')]));_0x2b58ce[_0x5933('0x36')]=_0x2b58ce[_0x5933('0x36')]['length']?_0x2b58ce['attributes']:_0x36862a['model'];if(!_0x2419d7[_0x5933('0x33')][_0x5933('0x39')](_0x5933('0x5d'))){_0x2b58ce[_0x5933('0x1f')]=qs['limit'](_0x2419d7[_0x5933('0x33')][_0x5933('0x1f')]);_0x2b58ce[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x2419d7[_0x5933('0x33')][_0x5933('0x1e')]);}_0x2b58ce[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x2419d7[_0x5933('0x33')]['sort']);_0x2b58ce[_0x5933('0x3c')]=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0x2419d7[_0x5933('0x33')],_0x36862a[_0x5933('0x34')]));_0x2b58ce[_0x5933('0x3c')]['ChatWebsiteId']=_0xfb586d['id'];if(_0x2419d7[_0x5933('0x33')]['filter']){_0x2b58ce[_0x5933('0x3c')]=_[_0x5933('0x3d')](_0x2b58ce['where'],{'$or':_[_0x5933('0x2b')](_0x2b58ce[_0x5933('0x36')],function(_0x3e243d){var _0x4d8dd8={};_0x4d8dd8[_0x3e243d]={'$like':'%'+_0x2419d7['query'][_0x5933('0x56')]+'%'};return _0x4d8dd8;})});}_0x2b58ce=_[_0x5933('0x3d')]({},_0x2b58ce,_0x2419d7[_0x5933('0x47')]);return db['CannedAnswer'][_0x5933('0x21')]({'where':_0x2b58ce['where']})['then'](function(_0xc9594a){_0x51c28b[_0x5933('0x21')]=_0xc9594a;if(_0x2419d7[_0x5933('0x33')][_0x5933('0x3f')]){_0x2b58ce[_0x5933('0x46')]=[{'all':!![]}];}return db[_0x5933('0x5a')]['findAll'](_0x2b58ce);})[_0x5933('0x13')](function(_0x3f00cd){_0x51c28b[_0x5933('0x41')]=_0x3f00cd;return _0x51c28b;});}})[_0x5933('0x13')](respondWithFilteredResult(_0x22d503,_0x2b58ce))[_0x5933('0x42')](handleError(_0x22d503,null));};exports[_0x5933('0x5e')]=function(_0x44d995,_0x426193){return db['ChatWebsite'][_0x5933('0x4e')]({'where':{'id':_0x44d995['params']['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x426193,null))[_0x5933('0x13')](function(_0xdb7da){if(_0xdb7da){return _0xdb7da[_0x5933('0x5e')](_0x44d995[_0x5933('0x33')][_0x5933('0x58')]);}})['then'](respondWithStatusCode(_0x426193,null))[_0x5933('0x42')](handleError(_0x426193,null));};exports[_0x5933('0x5f')]=function(_0x506e2c,_0x25865a){_0x506e2c[_0x5933('0x4d')][_0x5933('0x60')]=_0x506e2c['file'][_0x5933('0x61')];return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x506e2c[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x25865a,null))[_0x5933('0x13')](saveUpdates(_0x506e2c['body'],null))['then'](respondWithResult(_0x25865a,null))[_0x5933('0x42')](handleError(_0x25865a,null));};exports[_0x5933('0x62')]=function(_0x5c8584,_0x51f649){_0x5c8584[_0x5933('0x4d')][_0x5933('0x63')]=_0x5c8584[_0x5933('0x64')][_0x5933('0x61')];return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x5c8584['params']['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x51f649,null))[_0x5933('0x13')](saveUpdates(_0x5c8584['body'],null))['then'](respondWithResult(_0x51f649,null))['catch'](handleError(_0x51f649,null));};exports[_0x5933('0x65')]=function(_0x99732c,_0x3a3feb){_0x99732c[_0x5933('0x4d')][_0x5933('0x66')]=_0x99732c[_0x5933('0x64')]['filename'];return db[_0x5933('0x2c')]['find']({'where':{'id':_0x99732c[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x3a3feb,null))[_0x5933('0x13')](saveUpdates(_0x99732c[_0x5933('0x4d')],null))[_0x5933('0x13')](respondWithResult(_0x3a3feb,null))[_0x5933('0x42')](handleError(_0x3a3feb,null));};exports[_0x5933('0x67')]=function(_0x2072e5,_0x58c946){_0x2072e5['body']['systemAvatar']=_0x2072e5[_0x5933('0x64')]['filename'];return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x2072e5[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x58c946,null))[_0x5933('0x13')](saveUpdates(_0x2072e5[_0x5933('0x4d')],null))[_0x5933('0x13')](respondWithResult(_0x58c946,null))[_0x5933('0x42')](handleError(_0x58c946,null));};exports[_0x5933('0x68')]=function(_0xe93693,_0x3ee9bc){var _0x4eb1a7=path[_0x5933('0x69')](config['root'],_0x5933('0x6a'));var _0x22687e={'where':{'id':_0xe93693['params']['id']},'attributes':['id',_0x5933('0x60')],'raw':!![]};var _0x594e2f=![];return require(_0x5933('0x6b'))[_0x5933('0x6c')]()[_0x5933('0x13')](function(_0x57f01c){if(_0x57f01c){_0x594e2f=_0x57f01c[_0x5933('0x6d')];}})[_0x5933('0x13')](function(){return db[_0x5933('0x2c')][_0x5933('0x4e')](_0x22687e);})['then'](handleEntityNotFound(_0x3ee9bc,null))['then'](function(_0x128252){if(_0x128252){if(!_[_0x5933('0x6e')](_0x128252[_0x5933('0x60')])){if(fs[_0x5933('0x6f')](path[_0x5933('0x69')](config[_0x5933('0x70')],'server/files/images/logos/',_0x128252[_0x5933('0x60')]))&&_0x594e2f){_0x4eb1a7=path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x71'),_0x128252[_0x5933('0x60')]);}}return _0x3ee9bc[_0x5933('0x72')](_0x4eb1a7);}})['catch'](handleError(_0x3ee9bc,null));};exports[_0x5933('0x73')]=function(_0x4c7f9e,_0x51be9e){var _0x299dee=path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x74'));var _0x22c8e1={'where':{'id':_0x4c7f9e[_0x5933('0x44')]['id']},'attributes':['id',_0x5933('0x63')],'raw':!![]};return db[_0x5933('0x2c')][_0x5933('0x4e')](_0x22c8e1)[_0x5933('0x13')](handleEntityNotFound(_0x51be9e,null))[_0x5933('0x13')](function(_0x424b27){if(_0x424b27){if(!_[_0x5933('0x6e')](_0x424b27[_0x5933('0x63')])){if(fs[_0x5933('0x6f')](path[_0x5933('0x69')](config['root'],_0x5933('0x75'),_0x424b27[_0x5933('0x63')]))){_0x299dee=path[_0x5933('0x69')](config['root'],'server/files/images/avatars/',_0x424b27['agentAvatar']);}}return _0x51be9e[_0x5933('0x72')](_0x299dee);}})[_0x5933('0x42')](handleError(_0x51be9e,null));};exports[_0x5933('0x76')]=function(_0x30b5c2,_0x6f7e3b){var _0x46944f=path[_0x5933('0x69')](config['root'],_0x5933('0x77'));var _0x3b1082={'where':{'id':_0x30b5c2['params']['id']},'attributes':['id',_0x5933('0x66'),_0x5933('0x78')],'raw':!![]};return db[_0x5933('0x2c')][_0x5933('0x4e')](_0x3b1082)['then'](handleEntityNotFound(_0x6f7e3b,null))[_0x5933('0x13')](function(_0x54f0cc){if(_0x54f0cc){if(!_[_0x5933('0x6e')](_0x54f0cc[_0x5933('0x66')])){if(fs[_0x5933('0x6f')](path[_0x5933('0x69')](config['root'],_0x5933('0x75'),_0x54f0cc[_0x5933('0x66')]))&&_0x54f0cc['showCustomerAvatar']){_0x46944f=path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x75'),_0x54f0cc['customerAvatar']);}}return _0x6f7e3b[_0x5933('0x72')](_0x46944f);}})[_0x5933('0x42')](handleError(_0x6f7e3b,null));};exports['getSystemAvatar']=function(_0x405b10,_0x1fd5bf){var _0x136ad9=path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x79'));var _0x4e4062={'where':{'id':_0x405b10[_0x5933('0x44')]['id']},'attributes':['id',_0x5933('0x7a')],'raw':!![]};return db[_0x5933('0x2c')][_0x5933('0x4e')](_0x4e4062)['then'](handleEntityNotFound(_0x1fd5bf,null))['then'](function(_0x5d7ae9){if(_0x5d7ae9){if(!_['isNil'](_0x5d7ae9[_0x5933('0x7a')])){if(fs['existsSync'](path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x75'),_0x5d7ae9[_0x5933('0x7a')]))){_0x136ad9=path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0x75'),_0x5d7ae9[_0x5933('0x7a')]);}}return _0x1fd5bf[_0x5933('0x72')](_0x136ad9);}})[_0x5933('0x42')](handleError(_0x1fd5bf,null));};exports[_0x5933('0x7b')]=function(_0x48db67,_0x5385e5){var _0x4fb2d1=require(_0x5933('0x7c'));var _0xc36c4b=new _0x4fb2d1();var _0x104ffc=_0xc36c4b[_0x5933('0x7d')](_0x48db67[_0x5933('0x7e')][_0x5933('0x7f')])['getResult']();var _0x26c7b6={'body':_0x48db67['body'],'channel':'chat'};var _0x4954d2=[];var _0xc82635=[];var _0x3f8de5={};var _0x31ada5=![];return db[_0x5933('0x80')][_0x5933('0x50')]()['then'](function(_0x4af4cf){if(!_0x4af4cf){throw new db['Sequelize'][(_0x5933('0x81'))](_0x5933('0x82'));}_0x4954d2=_[_0x5933('0x83')](_[_0x5933('0x32')](_0x4af4cf),[_0x5933('0x84'),_0x5933('0x85')]);_0xc82635=_[_0x5933('0x83')](_[_0x5933('0x32')](_0x4af4cf),[_0x5933('0x84'),'updatedAt',_0x5933('0x86'),_0x5933('0x87')]);if(_0x48db67['body']['id']){delete _0x48db67['body']['id'];}if(_[_0x5933('0x6e')](_0x48db67['body'][_0x5933('0x88')])){throw new db[(_0x5933('0x89'))][(_0x5933('0x81'))](_0x5933('0x8a'));}if(_[_0x5933('0x6e')](_0x48db67[_0x5933('0x4d')][_0x5933('0x4d')])||_0x48db67[_0x5933('0x4d')][_0x5933('0x4d')]===''){throw new db[(_0x5933('0x89'))][(_0x5933('0x81'))](_0x5933('0x8b'));}if(_['isNil'](_0x48db67['body']['mapKey'])){throw new db[(_0x5933('0x89'))][(_0x5933('0x81'))](_0x5933('0x8c')+_0xc82635);}if(!_['includes'](_0xc82635,_0x48db67[_0x5933('0x4d')][_0x5933('0x8d')])){throw new db[(_0x5933('0x89'))][(_0x5933('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xc82635);}_0x3f8de5[_0x48db67[_0x5933('0x4d')][_0x5933('0x8d')]]=_0x48db67['body'][_0x5933('0x88')];})[_0x5933('0x13')](function(){return db[_0x5933('0x2c')][_0x5933('0x4e')]({'where':{'id':_0x48db67[_0x5933('0x44')]['id']},'include':[{'model':db[_0x5933('0x8e')],'as':_0x5933('0x8f'),'include':[{'model':db[_0x5933('0x80')],'as':_0x5933('0x90'),'where':_0x3f8de5,'limit':0x1,'order':[[_0x5933('0x85'),_0x5933('0x91')]]}]},{'model':db[_0x5933('0x92')],'as':_0x5933('0x93')}]});})[_0x5933('0x13')](handleEntityNotFound(_0x5385e5,null))[_0x5933('0x13')](function(_0x3fc2fa){if(_0x3fc2fa&&_0x3fc2fa[_0x5933('0x8f')]){_0x26c7b6['account']=_0x3fc2fa;_0x26c7b6[_0x5933('0x94')]=_0x3fc2fa[_0x5933('0x93')];_0x26c7b6[_0x5933('0x95')]=_0x3fc2fa['List'];_0x26c7b6[_0x5933('0x94')]=_[_0x5933('0x96')](_0x26c7b6[_0x5933('0x94')],['priority'],[_0x5933('0x97')]);if(_0x26c7b6[_0x5933('0x98')]['Applications']){delete _0x26c7b6[_0x5933('0x98')][_0x5933('0x93')];}if(_0x26c7b6['account'][_0x5933('0x8f')]&&_0x26c7b6[_0x5933('0x98')][_0x5933('0x8f')][_0x5933('0x90')]['length']){return _0x26c7b6[_0x5933('0x98')][_0x5933('0x8f')][_0x5933('0x90')][0x0];}var _0x46d13b=_[_0x5933('0xb')](_0x48db67[_0x5933('0x4d')],{'firstName':_0x48db67[_0x5933('0x4d')][_0x5933('0x88')],'ListId':_0x3fc2fa[_0x5933('0x87')]});_0x46d13b[_0x48db67[_0x5933('0x4d')][_0x5933('0x8d')]]=_0x48db67[_0x5933('0x4d')][_0x5933('0x88')];return db[_0x5933('0x80')][_0x5933('0x48')](_0x46d13b,{'fields':_0x4954d2,'raw':!![]});}})[_0x5933('0x13')](handleEntityNotFound(_0x5385e5,null))[_0x5933('0x13')](function(_0x441933){_0x26c7b6[_0x5933('0x99')]=_0x441933;var _0xf93224=_0x48db67[_0x5933('0x4d')][_0x5933('0x9a')];if(_0x48db67['headers'][_0x5933('0x9b')]){_0xf93224=_0x48db67['headers'][_0x5933('0x9b')];}else if(_0x48db67[_0x5933('0x7e')][_0x5933('0x9c')]){_0xf93224=_[_0x5933('0x9d')](_0x48db67['headers'][_0x5933('0x9c')][_0x5933('0x9e')](','));}if(_0x441933){var _0x142ba6={'ContactId':_0x441933['id'],'ChatWebsiteId':_0x48db67[_0x5933('0x44')]['id'],'from':(_0x441933['firstName']||'')+'\x20'+(_0x441933[_0x5933('0x9f')]||''),'customerIp':_0xf93224,'customerPort':_0x48db67[_0x5933('0x7e')][_0x5933('0xa0')]?_0x48db67[_0x5933('0x7e')]['x-real-port']:null,'referer':_0x48db67[_0x5933('0x4d')][_0x5933('0xa1')],'browserName':_0x104ffc[_0x5933('0xa2')][_0x5933('0x28')]&&_0x104ffc['browser']['version']?util[_0x5933('0xa3')](_0x5933('0xa4'),_0x104ffc[_0x5933('0xa2')][_0x5933('0x28')],_0x104ffc[_0x5933('0xa2')][_0x5933('0xa5')]):'unknown','browserVersion':_0x104ffc[_0x5933('0xa2')]['version']||_0x5933('0xa6'),'osName':util['format']('%s\x20%s',_0x104ffc['os'][_0x5933('0x28')],_0x104ffc['os']['version']),'osVersion':_0x104ffc['os'][_0x5933('0xa5')],'deviceModel':_0x104ffc[_0x5933('0xa7')][_0x5933('0x31')]&&_0x104ffc[_0x5933('0xa7')]['vendor']?util[_0x5933('0xa3')](_0x5933('0xa8'),_0x104ffc['device'][_0x5933('0x31')],_0x104ffc[_0x5933('0xa7')][_0x5933('0xa9')],_0x104ffc['device']['type']):null,'deviceVendor':_0x104ffc[_0x5933('0xa7')][_0x5933('0xa9')],'deviceType':_0x104ffc[_0x5933('0xa7')][_0x5933('0x2f')],'formData':JSON[_0x5933('0x17')](_0x48db67[_0x5933('0x4d')])};var _0x796499={'ChatWebsiteId':_0x48db67[_0x5933('0x44')]['id'],'closed':![]};if(_0x48db67[_0x5933('0x4d')]['threadId']){_0x796499[_0x5933('0xaa')]=_0x48db67[_0x5933('0x4d')][_0x5933('0xaa')];return db['ChatInteraction']['find']({'where':_0x796499})[_0x5933('0x13')](function(_0x1f8859){if(_0x1f8859){return[_0x1f8859,![]];}_0x142ba6[_0x5933('0xaa')]=_0x48db67[_0x5933('0x4d')][_0x5933('0xaa')];_0x142ba6[_0x5933('0xab')]=_0x48db67['body'][_0x5933('0xab')];return db[_0x5933('0xac')][_0x5933('0x48')](_0x142ba6)['then'](function(_0x593e25){return[_0x593e25,!![]];});});}_0x796499[_0x5933('0xad')]=_0x441933['id'];if(_0x48db67[_0x5933('0x4d')]['interaction']&&_0x48db67[_0x5933('0x4d')]['interaction']['id']){_0x796499['id']=_0x48db67['body']['interaction']['id'];return db[_0x5933('0xac')][_0x5933('0x4e')]({'where':_0x796499})[_0x5933('0x13')](function(_0x3ba7d7){if(_0x3ba7d7){return[_0x3ba7d7,![]];}return db[_0x5933('0xac')][_0x5933('0x48')](_0x142ba6)[_0x5933('0x13')](function(_0x1e2c86){return[_0x1e2c86,!![]];});});}return db['ChatInteraction'][_0x5933('0x48')](_0x142ba6)[_0x5933('0x13')](function(_0x2b69eb){return[_0x2b69eb,!![]];});}})[_0x5933('0xae')](function(_0xb303ea,_0xeb82e3){if(_0xb303ea){_0x31ada5=_0xeb82e3;if(!_0xeb82e3){var _0x3bef2d={'from':(_0x26c7b6[_0x5933('0x99')][_0x5933('0xaf')]||'')+'\x20'+(_0x26c7b6['contact'][_0x5933('0x9f')]||'')};if(_0x48db67[_0x5933('0x4d')][_0x5933('0xaa')]&&_0x48db67[_0x5933('0x4d')]['messageId']&&_0x48db67[_0x5933('0x4d')][_0x5933('0xaa')]!=_0x48db67[_0x5933('0x4d')]['messageId']){_0x3bef2d[_0x5933('0xaa')]=_0x48db67[_0x5933('0x4d')]['messageId'];}return _0xb303ea[_0x5933('0x4c')](_0x3bef2d);}else{return _0xb303ea;}}})[_0x5933('0x13')](function(_0x386ad8){_0x26c7b6[_0x5933('0xb0')]=_0x386ad8['get']({'plain':!![]});_0x26c7b6[_0x5933('0xb0')][_0x5933('0xb1')]=_0x31ada5;if(_0x26c7b6[_0x5933('0xb0')]['created']){if(_0x26c7b6['account'][_0x5933('0xb2')]){_0x26c7b6[_0x5933('0x94')][_0x5933('0xb3')]({'id':0x0,'priority':_0x26c7b6[_0x5933('0x94')][_0x5933('0x38')]+0x1,'app':_0x5933('0xb4'),'appdata':_0x5933('0xb5'),'interval':'*,*,*,*'});}}return db[_0x5933('0xb6')][_0x5933('0x48')]({'body':_0x48db67[_0x5933('0x4d')][_0x5933('0x4d')],'ChatWebsiteId':_0x48db67['params']['id'],'ChatInteractionId':_0x386ad8['id'],'direction':'in','ContactId':_0x26c7b6[_0x5933('0x99')]['id'],'AttachmentId':_0x48db67[_0x5933('0x4d')][_0x5933('0xb7')]});})[_0x5933('0x13')](function(_0x13e361){_0x26c7b6['message']=_0x13e361;if(_0x26c7b6['interaction'][_0x5933('0xb8')]){return db[_0x5933('0xb9')][_0x5933('0x4e')]({'attributes':['id','name'],'where':{'id':_0x26c7b6['interaction'][_0x5933('0xb8')]}})['then'](function(_0x26104d){if(_0x26104d){_0x26c7b6[_0x5933('0x94')][_0x5933('0xba')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x26104d['name']+','+(_0x26c7b6[_0x5933('0x98')][_0x5933('0xbb')]||0xa),'interval':_0x5933('0xbc')});_0x26c7b6['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5933('0xbd'),_0x5933('0xbe'),_0x26c7b6);});}return respondWithRpcPromise(_0x5933('0xbd'),_0x5933('0xbe'),_0x26c7b6);})[_0x5933('0x13')](function(_0x3ac3d7){respondWithRpcPromise(_0x5933('0xbf'),'EventManager',{'event':_0x5933('0x7b'),'message':_0x3ac3d7},client9002);return _0x3ac3d7;})[_0x5933('0x13')](respondWithResult(_0x5385e5,null))[_0x5933('0x42')](handleError(_0x5385e5,null));};exports[_0x5933('0xc0')]=function(_0x5244d5,_0x309f9c){var _0x244842,_0x5f5922,_0x2f852f;var _0xd591ec=[];var _0x5c1952={};var _0x51b27c=_0x5244d5[_0x5933('0xc1')]||[];var _0x5727b=[];var _0x1e151d;return db['CmContact']['describe']()[_0x5933('0x13')](function(_0x40b924){if(!_0x40b924){throw new db['Sequelize'][(_0x5933('0x81'))](_0x5933('0x82'));}_0xd591ec=_[_0x5933('0x83')](_[_0x5933('0x32')](_0x40b924),[_0x5933('0x84'),_0x5933('0x85'),_0x5933('0x86'),_0x5933('0x87')]);if(_0x5244d5[_0x5933('0x4d')]['id']){delete _0x5244d5[_0x5933('0x4d')]['id'];}if(_['isNil'](_0x5244d5[_0x5933('0x4d')]['from'])){throw _0x309f9c['status'](0x1f4)[_0x5933('0x29')](new db[(_0x5933('0x89'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x5933('0x6e')](_0x5244d5[_0x5933('0x4d')]['body'])||_0x5244d5[_0x5933('0x4d')][_0x5933('0x4d')]===''){throw _0x309f9c[_0x5933('0x1c')](0x1f4)[_0x5933('0x29')](new db['Sequelize'][(_0x5933('0x81'))](_0x5933('0x8b')));}if(_[_0x5933('0x6e')](_0x5244d5[_0x5933('0x4d')]['mapKeyOffline'])){throw _0x309f9c[_0x5933('0x1c')](0x1f4)['send'](new db[(_0x5933('0x89'))][(_0x5933('0x81'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd591ec));}if(!_[_0x5933('0xc2')](_0xd591ec,_0x5244d5[_0x5933('0x4d')][_0x5933('0xc3')])){throw _0x309f9c[_0x5933('0x1c')](0x1f4)[_0x5933('0x29')](new db[(_0x5933('0x89'))][(_0x5933('0x81'))](_0x5933('0xc4')+_0xd591ec));}_0x5c1952[_0x5244d5[_0x5933('0x4d')][_0x5933('0xc3')]]=_0x5244d5[_0x5933('0x4d')][_0x5933('0x88')];})['then'](function(){return db['ChatWebsite'][_0x5933('0x4e')]({'where':{'id':_0x5244d5[_0x5933('0x44')]['id']},'include':[{'model':db[_0x5933('0x8e')],'as':_0x5933('0x8f')},{'model':db['MailAccount'],'as':_0x5933('0xc5')}]});})['then'](handleEntityNotFound(_0x309f9c,null))[_0x5933('0x13')](function(_0x27a158){if(_0x27a158&&_0x27a158[_0x5933('0x8f')]){_0x5f5922=_0x27a158;var _0x285831=_[_0x5933('0xb')](_0x5244d5[_0x5933('0x4d')],{'firstName':_0x5244d5[_0x5933('0x4d')][_0x5933('0x88')],'phone':_0x5244d5[_0x5933('0x4d')][_0x5933('0x88')],'ListId':_0x27a158[_0x5933('0x87')]});_0x285831[_0x5244d5['body']['mapKeyOffline']]=_0x5244d5[_0x5933('0x4d')]['from'];return db['CmContact'][_0x5933('0xc6')]({'where':_0x5c1952,'defaults':_0x285831});}})[_0x5933('0xae')](function(_0x31dd3e){if(_0x31dd3e){_0x2f852f=_0x31dd3e;var _0x1a3977=fs['readFileSync'](path['join'](config[_0x5933('0x70')],_0x5933('0xc7')),_0x5933('0xc8'));var _0x12e384=ejs[_0x5933('0xc9')](_0x1a3977,{'body':_[_0x5933('0xca')](_0x5244d5[_0x5933('0x4d')][_0x5933('0x4d')]),'bodyTitle':_0x5f5922['offlineMessageBody']});return db['ChatOfflineMessage'][_0x5933('0x48')]({'body':_0x12e384,'plainBody':htmlToText[_0x5933('0xcb')](_0x12e384),'ContactId':_0x31dd3e['id'],'ChatWebsiteId':_0x5f5922['id']});}})[_0x5933('0x13')](function(_0x20e2ef){_0x1e151d=_0x20e2ef;if(_0x51b27c[_0x5933('0x38')]){var _0x16d7f0=_0x51b27c[_0x5933('0x2b')](function(_0x153d89){return{'name':_0x153d89['originalname'],'basename':_0x153d89[_0x5933('0x61')],'type':_0x153d89[_0x5933('0xcc')],'ChatOfflineMessageId':_0x20e2ef['id']};});_0x5727b=_0x16d7f0[_0x5933('0x2b')](_0x43d1ae=>{var _0x41a4ea={'filename':_0x43d1ae[_0x5933('0x28')],'path':path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0xcd'),_0x5933('0xc1'),'attachments','offline-chat',_0x43d1ae[_0x5933('0xce')])};return _0x41a4ea;});if(!_0x5f5922[_0x5933('0xcf')]){return db[_0x5933('0xd0')]['transaction'](function(_0x35d9ab){return db[_0x5933('0xd1')][_0x5933('0xd2')](_0x16d7f0,{'transaction':_0x35d9ab});});}}})[_0x5933('0x13')](function(){if(_0x1e151d){_0x244842=_0x1e151d;return db[_0x5933('0xc5')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5933('0xd3'),'raw':!![]}]}]});}})[_0x5933('0x13')](function(_0xa0241a){if(_0xa0241a&&_0xa0241a[_0x5933('0xd4')]&&_0x5f5922['forwardOffline']&&_0x5f5922[_0x5933('0xd5')]){var _0x55bd7a=_0xa0241a[_0x5933('0xd6')]();return respondWithRpcPromise('SendMail',_0x5933('0xd7'),{'account':_0x55bd7a,'message':{'from':util[_0x5933('0xa3')](_0x5933('0xd8'),_0xa0241a[_0x5933('0x28')],_0xa0241a[_0x5933('0xd9')]||_0xa0241a[_0x5933('0xd4')][_0x5933('0xda')]),'to':_0x5f5922[_0x5933('0xd5')],'subject':_0x5f5922[_0x5933('0xdb')],'html':_0x244842[_0x5933('0x4d')],'attachments':_0x5727b}},client9003)['then'](function(){return _0x244842;})[_0x5933('0x42')](function(_0xfccea){logger['error'](_0xfccea);});}})[_0x5933('0x13')](function(){if(_0x5f5922&&_0x5f5922['openNewInteraction']&&_0x5f5922[_0x5933('0xdc')]){var _0x1108b0=[];if(_0x51b27c[_0x5933('0x38')]){_0x1108b0=_0x51b27c[_0x5933('0x2b')](function(_0x467410){return{'name':_0x467410['originalname'],'basename':_0x467410['filename'],'type':_0x467410[_0x5933('0xcc')],'ChatOfflineMessageId':_0x1e151d['id']};});}var _0x1ba171;if(!_[_0x5933('0x6e')](_0x5f5922['subjectOffline'])){var _0x2ccc82=_['map'](_0x5244d5[_0x5933('0x4d')],function(_0x3b0ac1){return _0x3b0ac1;});var _0x201c5f=_[_0x5933('0xdd')](_0x2ccc82)[0x0];var _0x223543=_[_0x5933('0xde')](_0x201c5f,function(_0x3fd69c){return _0x3fd69c;});_0x1ba171=_0x223543[0x1][_0x5f5922[_0x5933('0xdf')]];}var _0x2baad0={'from':_0x2f852f[_0x5933('0xd9')],'firstName':_0x2f852f[_0x5933('0xaf')],'lastName':_0x2f852f[_0x5933('0x9f')],'mapKey':_0x5933('0xd9'),'message':{'from':_0x2f852f['email'],'to':_0x5f5922['MailAccount'][_0x5933('0xd9')],'cc':'','subject':_[_0x5933('0x6e')](_0x1ba171)?_0x5f5922[_0x5933('0xdb')]:_0x1ba171,'messageId':'','sentAt':new Date(),'attach':_0x1108b0[_0x5933('0x38')],'attachments':_0x1108b0,'originChannel':_0x5933('0xe0'),'ChatWebsiteId':_0x5f5922['id'],'ChatOfflineMessageId':_0x244842['id'],'originTo':_0x5f5922['MailAccount'][_0x5933('0xd9')]},'body':_0x244842[_0x5933('0x4d')]};var _0x54815f={'account':{'id':_0x5f5922[_0x5933('0xdc')]},'body':_0x2baad0,'log':_0x5933('0xe1')};return respondWithRpcPromise('NotifyMailAccount',_0x5933('0xe2'),_0x54815f,client9001)[_0x5933('0x13')](function(){return _0x244842;})[_0x5933('0x42')](function(_0x2710b2){logger[_0x5933('0x19')](_0x2710b2);});}return;})[_0x5933('0x13')](function(){if(_0x244842){return _0x244842;}})[_0x5933('0x13')](respondWithResult(_0x309f9c,null))[_0x5933('0x42')](function(_0x22921c){logger[_0x5933('0x19')](_0x5933('0x42'),_0x22921c);for(var _0x2aef08 of _0x51b27c){var _0x295997=path['join'](config[_0x5933('0x70')],_0x5933('0xcd'),'files',_0x5933('0xe3'),'offline-chat',_0x2aef08[_0x5933('0x61')]);fs_extra['remove'](_0x295997)[_0x5933('0x42')](function(_0x4ac41a){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x295997,_0x4ac41a);});}});};exports[_0x5933('0xe4')]=function(_0x3ef4a8,_0x59e06e){return db[_0x5933('0xac')][_0x5933('0x4e')]({'where':{'id':_0x3ef4a8['params']['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x59e06e,null))['then'](function(_0x27e98b){if(_0x27e98b){return _0x27e98b['addInteraction'](_0x3ef4a8['body'][_0x5933('0x58')],_[_0x5933('0xe5')](_0x3ef4a8[_0x5933('0x4d')],[_0x5933('0x58'),'id'])||{});}})[_0x5933('0x13')](respondWithResult(_0x59e06e,null))[_0x5933('0x42')](handleError(_0x59e06e,null));};exports['getInteractions']=function(_0x3ad550,_0x2eace1){var _0x810d55={'raw':![],'where':{}};var _0x2e6a8b={};var _0x4e60c8={'count':0x0,'rows':[]};return db[_0x5933('0x2c')][_0x5933('0x5c')]({'where':{'id':_0x3ad550[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x2eace1,null))[_0x5933('0x13')](function(_0x35a42e){if(_0x35a42e){_0x2e6a8b[_0x5933('0x31')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x2e6a8b['query']=_[_0x5933('0x32')](_0x3ad550[_0x5933('0x33')]);_0x2e6a8b[_0x5933('0x34')]=_[_0x5933('0x35')](_0x2e6a8b[_0x5933('0x31')],_0x2e6a8b[_0x5933('0x33')]);_0x810d55['attributes']=_[_0x5933('0x35')](_0x2e6a8b[_0x5933('0x31')],qs[_0x5933('0x37')](_0x3ad550[_0x5933('0x33')][_0x5933('0x37')]));_0x810d55[_0x5933('0x36')]=_0x810d55['attributes'][_0x5933('0x38')]?_0x810d55[_0x5933('0x36')]:_0x2e6a8b['model'];if(!_0x3ad550[_0x5933('0x33')][_0x5933('0x39')](_0x5933('0x5d'))){_0x810d55[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0x3ad550[_0x5933('0x33')]['limit']);_0x810d55[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x3ad550[_0x5933('0x33')][_0x5933('0x1e')]);}_0x810d55[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x3ad550[_0x5933('0x33')][_0x5933('0x3b')]);_0x810d55[_0x5933('0x3c')]=qs[_0x5933('0x34')](_['pick'](_0x3ad550[_0x5933('0x33')],_0x2e6a8b[_0x5933('0x34')]));_0x810d55['where']['ChatWebsiteId']=_0x35a42e['id'];if(_0x3ad550[_0x5933('0x33')][_0x5933('0x56')]){_0x810d55[_0x5933('0x3c')]=_['merge'](_0x810d55['where'],{'$or':_[_0x5933('0x2b')](_0x810d55['attributes'],function(_0x318a1a){var _0x284688={};_0x284688[_0x318a1a]={'$like':'%'+_0x3ad550[_0x5933('0x33')][_0x5933('0x56')]+'%'};return _0x284688;})});}_0x810d55=_[_0x5933('0x3d')]({},_0x810d55,_0x3ad550['options']);return db[_0x5933('0xac')][_0x5933('0x21')]({'where':_0x810d55[_0x5933('0x3c')]})[_0x5933('0x13')](function(_0x34f733){_0x4e60c8['count']=_0x34f733;if(_0x3ad550[_0x5933('0x33')][_0x5933('0x3f')]){_0x810d55['include']=[{'model':db[_0x5933('0x80')],'as':_0x5933('0xe6'),'required':![]},{'model':db[_0x5933('0xb9')],'as':_0x5933('0xe7'),'attributes':['name',_0x5933('0xe8'),_0x5933('0xe9')],'required':![]},{'model':db[_0x5933('0xea')],'as':_0x5933('0xeb'),'attributes':['id',_0x5933('0x28'),_0x5933('0xec')],'where':_0x3ad550[_0x5933('0x33')][_0x5933('0xed')]?{'id':_0x3ad550[_0x5933('0x33')][_0x5933('0xed')]}:undefined,'required':_0x3ad550[_0x5933('0x33')]['tag']?!![]:![]}];}return db[_0x5933('0xac')]['findAll'](_0x810d55);})['then'](function(_0x2f6615){_0x4e60c8[_0x5933('0x41')]=_0x2f6615;return _0x4e60c8;});}})['then'](respondWithFilteredResult(_0x2eace1,_0x810d55))[_0x5933('0x42')](handleError(_0x2eace1,null));};function iftimePromise(_0x5aa579,_0x4a08c3){return respondWithRpcPromise(_0x5933('0xee'),_0x5933('0xef'),{'command':_0x4a08c3[_0x5933('0xf0')]?util[_0x5933('0xa3')]('iftime\x20%s,%s',_0x5aa579[_0x5933('0xf1')],_0x4a08c3[_0x5933('0xf0')]):util[_0x5933('0xa3')](_0x5933('0xf2'),_0x5aa579[_0x5933('0xf1')])},client9002)[_0x5933('0x13')](function(_0x55198e){var _0x5e59c0=_0x55198e&&_0x55198e[_0x5933('0xf3')](_0x5933('0xf4'))>=0x0?!![]:![];logger[_0x5933('0x14')](_0x5933('0xf5'),_0x4a08c3['id'],_0x5aa579['id'],_0x5aa579[_0x5933('0xf1')],_0x5e59c0?_0x5933('0xf6'):_0x5933('0xf7'),_0x4a08c3['timezone']?_0x4a08c3['timezone']:_0x5933('0xf8'));return _0x5e59c0;})[_0x5933('0x42')](function(_0x572c22){logger[_0x5933('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4a08c3['id'],_0x5aa579['id'],_0x5aa579[_0x5933('0xf1')],util[_0x5933('0xf9')](_0x572c22,{'showHidden':![],'depth':null}),_0x4a08c3[_0x5933('0xf0')]?_0x4a08c3[_0x5933('0xf0')]:_0x5933('0xf8'));return![];});}exports[_0x5933('0xef')]=function(_0xca00d2,_0x2052c3){var _0x2cc798=0x0;var _0x1ca077=0x0;var _0x172018=![];var _0x5a3f43;var _0x5429b4;return db['ChatWebsite'][_0x5933('0x4e')]({'where':{'id':_0xca00d2[_0x5933('0x44')]['id']},'include':[{'model':db[_0x5933('0xfa')],'as':_0x5933('0xfa'),'include':[{'model':db['Interval'],'as':_0x5933('0xfb'),'attributes':['id',_0x5933('0xf1')],'raw':!![]}]}]})[_0x5933('0x13')](handleEntityNotFound(_0x2052c3,null))[_0x5933('0x13')](function(_0x34bab1){if(_0x34bab1){_0x5a3f43=_0x34bab1;return _0x34bab1[_0x5933('0xfc')]({'raw':!![]});}})[_0x5933('0x13')](function(_0x123cf3){if(_0x5a3f43){if(_0x123cf3){_0x5429b4=_0x123cf3;}}return require(_0x5933('0x6b'))[_0x5933('0x6c')]();})['then'](function(_0x50f481){if(_0x50f481){_0x1ca077=_0x50f481['virtual'];_0x172018=_0x50f481['custom'];}})['then'](function(){return db[_0x5933('0xac')][_0x5933('0x21')]({'where':{'closed':![]}});})[_0x5933('0x13')](function(_0x34afc0){_0x2cc798=_0x34afc0;if(_0x1ca077&&_0x34afc0>_0x1ca077){return db['License'][_0x5933('0x5c')]({'where':{'id':0x1}})[_0x5933('0x13')](function(_0x549063){if(_0x549063){_0x549063[_0x5933('0xfd')]('chatLicenseExceeded');}});}})[_0x5933('0x13')](function(){if(_0x5a3f43[_0x5933('0xfa')]&&_0x5a3f43[_0x5933('0xfa')]['Intervals']){var _0x585d8f=[];for(var _0x7ebf0a=0x0;_0x7ebf0a<_0x5a3f43[_0x5933('0xfa')][_0x5933('0xfb')][_0x5933('0x38')];_0x7ebf0a++){var _0x4ab75b=_0x5a3f43[_0x5933('0xfa')][_0x5933('0xfb')][_0x7ebf0a][_0x5933('0x24')]({'plain':!![]});_0x585d8f[_0x5933('0xb3')](iftimePromise(_0x4ab75b,_0x5a3f43));}return BPromise['all'](_0x585d8f)[_0x5933('0x13')](function(_0x1276ba){return _[_0x5933('0xfe')](_0x1276ba);});}else{return!![];}})[_0x5933('0x13')](function(_0x5b9a7f){var _0x56079e=fs['readFileSync'](path[_0x5933('0x69')](config[_0x5933('0x70')],_0x5933('0xff')),_0x5933('0xc8'));var _0x19d7ab={'remote':_0x5a3f43[_0x5933('0x100')],'query':querystring[_0x5933('0x17')](_[_0x5933('0x3d')](_0x5a3f43[_0x5933('0x24')]({'plain':!![]}),{'customerIp':_0xca00d2[_0x5933('0x7e')][_0x5933('0x9c')]||_0xca00d2[_0x5933('0x7e')][_0x5933('0x101')]||_0xca00d2[_0x5933('0x102')][_0x5933('0x103')]||_0xca00d2['ip'],'referer':_0xca00d2[_0x5933('0x7e')][_0x5933('0xa1')],'openedInteractions':_0x2cc798,'maxInteractions':_0x1ca077,'virtual':_0x172018[_0x5933('0x104')],'online':_0x5b9a7f,'custom':_0x172018}))[_0x5933('0x105')](/'/g,'\x5c\x27')};_0x2052c3['send'](ejs[_0x5933('0xc9')](Mustache[_0x5933('0xc9')](_0x56079e,_0x19d7ab),{'proactiveActions':_0x5429b4,'alignment':_0x5a3f43[_0x5933('0x106')],'verticalAlignment':_0x5a3f43[_0x5933('0x107')],'div_color':_0x5a3f43[_0x5933('0xec')],'labelText':_0x5a3f43[_0x5933('0x108')],'text_color':_0x5a3f43[_0x5933('0x109')],'button_color':_0x5a3f43[_0x5933('0x10a')],'background_color':_0x5a3f43[_0x5933('0x10b')],'hideWhenOffline':_0x5a3f43[_0x5933('0x10c')],'interval':_0x5a3f43[_0x5933('0x10d')]}));})[_0x5933('0x42')](handleError(_0x2052c3,null));};exports[_0x5933('0x10e')]=function(_0x143de6,_0x2906f9){var _0x52f40d=_0x143de6[_0x5933('0x44')]['id'];var _0x37244c=_0x143de6[_0x5933('0x4d')];var _0xb60183=0xc8;var _0x206e02=null;return db[_0x5933('0xd0')][_0x5933('0x10f')]({'isolationLevel':db[_0x5933('0xd0')][_0x5933('0x110')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0xebf6e8){return db[_0x5933('0x2c')][_0x5933('0x5c')]({'where':{'id':_0x52f40d},'transaction':_0xebf6e8})['then'](function(_0x5f2dff){if(_0x5f2dff){return db[_0x5933('0x92')][_0x5933('0x23')]({'where':{'ChatWebsiteId':_0x52f40d},'transaction':_0xebf6e8})[_0x5933('0x13')](function(){var _0x592711=_[_0x5933('0x2b')](_0x37244c,function(_0x2560d2){_0x2560d2[_0x5933('0x52')]=_0x52f40d;return _0x2560d2;});return db['ChatApplication'][_0x5933('0xd2')](_0x592711,{'transaction':_0xebf6e8});});}else{_0xb60183=0x194;_0x206e02=[];}});})['then'](function(){if(_0xb60183!==0x194){return db[_0x5933('0x92')][_0x5933('0x111')]({'where':{'ChatWebsiteId':_0x52f40d},'order':_0x5933('0x112')})[_0x5933('0x13')](function(_0xd76d94){_0x206e02=_0xd76d94;});}})[_0x5933('0x42')](function(_0x484f46){_0xb60183=0x1f4;logger['error'](_0x484f46[_0x5933('0x113')]);if(_0x484f46['name']){delete _0x484f46['name'];}_0x206e02=_0x484f46;})[_0x5933('0x114')](function(){if(_0x206e02===null){_0x2906f9[_0x5933('0x27')](_0xb60183);}else{if(_0xb60183===0x1f4){_0x2906f9[_0x5933('0x1c')](_0xb60183)[_0x5933('0x29')](_0x206e02);}else{_0x2906f9[_0x5933('0x1c')](_0xb60183)[_0x5933('0x1d')](_0x206e02);}}});};exports[_0x5933('0x115')]=function(_0x585711,_0x36ca50){var _0x59640d={};var _0x26d464={};var _0x2ae0d0;var _0x1aecc3;return db[_0x5933('0x2c')]['findOne']({'where':{'id':_0x585711[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x36ca50,null))[_0x5933('0x13')](function(_0x180dfe){if(_0x180dfe){_0x2ae0d0=_0x180dfe;_0x26d464['model']=_[_0x5933('0x32')](db[_0x5933('0x92')][_0x5933('0x2d')]);_0x26d464[_0x5933('0x33')]=_[_0x5933('0x32')](_0x585711['query']);_0x26d464['filters']=_[_0x5933('0x35')](_0x26d464['model'],_0x26d464[_0x5933('0x33')]);_0x59640d[_0x5933('0x36')]=_[_0x5933('0x35')](_0x26d464['model'],qs[_0x5933('0x37')](_0x585711[_0x5933('0x33')][_0x5933('0x37')]));_0x59640d['attributes']=_0x59640d['attributes'][_0x5933('0x38')]?_0x59640d[_0x5933('0x36')]:_0x26d464[_0x5933('0x31')];_0x59640d['order']=qs[_0x5933('0x3b')](_0x585711['query'][_0x5933('0x3b')]);_0x59640d[_0x5933('0x3c')]=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0x585711['query'],_0x26d464[_0x5933('0x34')]));if(_0x585711[_0x5933('0x33')][_0x5933('0x56')]){_0x59640d[_0x5933('0x3c')]=_[_0x5933('0x3d')](_0x59640d[_0x5933('0x3c')],{'$or':_[_0x5933('0x2b')](_0x59640d[_0x5933('0x36')],function(_0x4b8b9c){var _0x5a095b={};_0x5a095b[_0x4b8b9c]={'$like':'%'+_0x585711[_0x5933('0x33')][_0x5933('0x56')]+'%'};return _0x5a095b;})});}_0x59640d=_[_0x5933('0x3d')]({},_0x59640d,_0x585711[_0x5933('0x47')]);return _0x2ae0d0['getApplications'](_0x59640d);}})[_0x5933('0x13')](function(_0x3c7d75){if(_0x3c7d75){_0x1aecc3=_0x3c7d75[_0x5933('0x38')];if(!_0x585711[_0x5933('0x33')][_0x5933('0x39')]('nolimit')){_0x59640d[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0x585711['query'][_0x5933('0x1f')]);_0x59640d[_0x5933('0x1e')]=qs['offset'](_0x585711[_0x5933('0x33')]['offset']);}return _0x2ae0d0[_0x5933('0x115')](_0x59640d);}})[_0x5933('0x13')](function(_0x3866c2){if(_0x3866c2){return _0x3866c2?{'count':_0x1aecc3,'rows':_0x3866c2}:null;}})[_0x5933('0x13')](respondWithResult(_0x36ca50,null))['catch'](handleError(_0x36ca50,null));};exports[_0x5933('0x116')]=function(_0x479f4f,_0x20b109){return db['chatProactiveAction'][_0x5933('0x4e')]({'where':{'id':_0x479f4f[_0x5933('0x44')]['id']}})['then'](handleEntityNotFound(_0x20b109,null))[_0x5933('0x13')](function(_0x510eee){if(_0x510eee){return _0x510eee[_0x5933('0x116')](_0x479f4f[_0x5933('0x4d')][_0x5933('0x58')],_[_0x5933('0xe5')](_0x479f4f[_0x5933('0x4d')],[_0x5933('0x58'),'id'])||{});}})[_0x5933('0x13')](respondWithResult(_0x20b109,null))['catch'](handleError(_0x20b109,null));};exports[_0x5933('0xfc')]=function(_0x4c9ee5,_0xfbf1c5){var _0x30bbde={};var _0x527411={};var _0x423d22;var _0x3ddcae;return db[_0x5933('0x2c')][_0x5933('0x5c')]({'where':{'id':_0x4c9ee5['params']['id']}})[_0x5933('0x13')](handleEntityNotFound(_0xfbf1c5,null))[_0x5933('0x13')](function(_0x3c33a6){if(_0x3c33a6){_0x423d22=_0x3c33a6;_0x527411[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0x117')][_0x5933('0x2d')]);_0x527411['query']=_[_0x5933('0x32')](_0x4c9ee5[_0x5933('0x33')]);_0x527411[_0x5933('0x34')]=_['intersection'](_0x527411[_0x5933('0x31')],_0x527411[_0x5933('0x33')]);_0x30bbde[_0x5933('0x36')]=_[_0x5933('0x35')](_0x527411[_0x5933('0x31')],qs['fields'](_0x4c9ee5[_0x5933('0x33')][_0x5933('0x37')]));_0x30bbde[_0x5933('0x36')]=_0x30bbde[_0x5933('0x36')][_0x5933('0x38')]?_0x30bbde[_0x5933('0x36')]:_0x527411[_0x5933('0x31')];_0x30bbde[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x4c9ee5[_0x5933('0x33')][_0x5933('0x3b')]);_0x30bbde[_0x5933('0x3c')]=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0x4c9ee5[_0x5933('0x33')],_0x527411[_0x5933('0x34')]));if(_0x4c9ee5['query'][_0x5933('0x56')]){_0x30bbde[_0x5933('0x3c')]=_[_0x5933('0x3d')](_0x30bbde[_0x5933('0x3c')],{'$or':_[_0x5933('0x2b')](_0x30bbde[_0x5933('0x36')],function(_0x563b2b){var _0x59c9eb={};_0x59c9eb[_0x563b2b]={'$like':'%'+_0x4c9ee5['query'][_0x5933('0x56')]+'%'};return _0x59c9eb;})});}_0x30bbde=_[_0x5933('0x3d')]({},_0x30bbde,_0x4c9ee5[_0x5933('0x47')]);return _0x423d22[_0x5933('0xfc')](_0x30bbde);}})[_0x5933('0x13')](function(_0x24e485){if(_0x24e485){_0x3ddcae=_0x24e485[_0x5933('0x38')];if(!_0x4c9ee5[_0x5933('0x33')][_0x5933('0x39')](_0x5933('0x5d'))){_0x30bbde[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0x4c9ee5['query'][_0x5933('0x1f')]);_0x30bbde[_0x5933('0x1e')]=qs[_0x5933('0x1e')](_0x4c9ee5['query']['offset']);}return _0x423d22[_0x5933('0xfc')](_0x30bbde);}})[_0x5933('0x13')](function(_0x4e2fc6){if(_0x4e2fc6){return _0x4e2fc6?{'count':_0x3ddcae,'rows':_0x4e2fc6}:null;}})[_0x5933('0x13')](respondWithResult(_0xfbf1c5,null))[_0x5933('0x42')](handleError(_0xfbf1c5,null));};exports[_0x5933('0x118')]=function(_0x4b8177,_0x22085f){var _0xd48c65=_0x4b8177['query']['online']==='false'?_0x5933('0x119'):'onlineForm';return db[_0x5933('0x2c')][_0x5933('0x4e')]({'attributes':['id',_0xd48c65],'where':{'id':_0x4b8177[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x22085f,null))[_0x5933('0x13')](function(_0x10e115){if(_0x10e115){var _0x1ec14=_0x10e115[_0xd48c65];var _0x1e09d3=_0x1ec14&&_0x1ec14[_0x5933('0x11a')]?_0x1ec14[_0x5933('0x11a')]:[];_0x22085f['send']({'fromKey':_[_0x5933('0x6e')](_0x1ec14[_0x5933('0x11b')])?undefined:_0x1ec14[_0x5933('0x11b')],'count':_0x1e09d3['length'],'rows':_0x1e09d3});}})[_0x5933('0x42')](handleError(_0x22085f,null));};exports[_0x5933('0x11c')]=function(_0x4eed1a,_0x182fd4){var _0xfd9954={'raw':![],'where':{}};var _0x528cbc={};var _0x25a633={'count':0x0,'rows':[]};return db[_0x5933('0x2c')][_0x5933('0x5c')]({'where':{'id':_0x4eed1a[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x182fd4,null))[_0x5933('0x13')](function(_0x56be45){if(_0x56be45){_0x528cbc[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0x11d')]['rawAttributes']);_0x528cbc['query']=_[_0x5933('0x32')](_0x4eed1a[_0x5933('0x33')]);_0x528cbc[_0x5933('0x34')]=_[_0x5933('0x35')](_0x528cbc[_0x5933('0x31')],_0x528cbc[_0x5933('0x33')]);_0xfd9954[_0x5933('0x36')]=_[_0x5933('0x35')](_0x528cbc[_0x5933('0x31')],qs[_0x5933('0x37')](_0x4eed1a['query'][_0x5933('0x37')]));_0xfd9954[_0x5933('0x36')]=_0xfd9954[_0x5933('0x36')]['length']?_0xfd9954[_0x5933('0x36')]:_0x528cbc[_0x5933('0x31')];if(!_0x4eed1a['query'][_0x5933('0x39')](_0x5933('0x5d'))){_0xfd9954[_0x5933('0x1f')]=qs[_0x5933('0x1f')](_0x4eed1a[_0x5933('0x33')]['limit']);_0xfd9954['offset']=qs['offset'](_0x4eed1a['query'][_0x5933('0x1e')]);}_0xfd9954[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x4eed1a[_0x5933('0x33')][_0x5933('0x3b')]);_0xfd9954['where']=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0x4eed1a[_0x5933('0x33')],_0x528cbc[_0x5933('0x34')]));_0xfd9954['where'][_0x5933('0x52')]=_0x56be45['id'];if(_0x4eed1a['query'][_0x5933('0x56')]){_0xfd9954[_0x5933('0x3c')]=_['merge'](_0xfd9954[_0x5933('0x3c')],{'$or':_[_0x5933('0x2b')](_0xfd9954['attributes'],function(_0x291d4f){var _0x517367={};_0x517367[_0x291d4f]={'$like':'%'+_0x4eed1a['query'][_0x5933('0x56')]+'%'};return _0x517367;})});}_0xfd9954=_['merge']({},_0xfd9954,_0x4eed1a['options']);return db[_0x5933('0x11d')][_0x5933('0x21')]({'where':_0xfd9954[_0x5933('0x3c')]})[_0x5933('0x13')](function(_0xf716ed){_0x25a633[_0x5933('0x21')]=_0xf716ed;if(_0x4eed1a['query'][_0x5933('0x3f')]){_0xfd9954['include']=[{'all':!![]}];}else{_0xfd9954['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x5933('0xd1')],'as':_0x5933('0x11e'),'required':![]}];}return db[_0x5933('0x11d')][_0x5933('0x40')](_0xfd9954);})['then'](function(_0x2ea0a1){_0x25a633[_0x5933('0x41')]=_0x2ea0a1;return _0x25a633;});}})[_0x5933('0x13')](respondWithFilteredResult(_0x182fd4,_0xfd9954))[_0x5933('0x42')](handleError(_0x182fd4,null));};exports['addAgents']=function(_0x31be57,_0x5bae25){return db[_0x5933('0x2c')]['find']({'where':{'id':_0x31be57['params']['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x5bae25,null))[_0x5933('0x13')](function(_0x59044f){if(_0x59044f){return _0x59044f[_0x5933('0x11f')](_0x31be57[_0x5933('0x4d')][_0x5933('0x58')],_['omit'](_0x31be57[_0x5933('0x4d')],['ids','id'])||{})[_0x5933('0xae')](function(_0x1de569){for(var _0x3f9f6a=0x0;_0x3f9f6a<_0x31be57['body'][_0x5933('0x58')][_0x5933('0x38')];_0x3f9f6a+=0x1){socket[_0x5933('0x120')]('userChatWebsite:save',{'UserId':Number(_0x31be57['body'][_0x5933('0x58')][_0x3f9f6a]),'ChatWebsiteId':Number(_0x31be57[_0x5933('0x44')]['id'])});}return _0x1de569;});}})[_0x5933('0x13')](respondWithResult(_0x5bae25,null))[_0x5933('0x42')](handleError(_0x5bae25,null));};exports[_0x5933('0x121')]=function(_0x1e9325,_0x1f903c){return db[_0x5933('0x2c')]['find']({'where':{'id':_0x1e9325[_0x5933('0x44')]['id']}})[_0x5933('0x13')](handleEntityNotFound(_0x1f903c,null))[_0x5933('0x13')](function(_0x3e0af2){if(_0x3e0af2){return _0x3e0af2[_0x5933('0x121')](_0x1e9325[_0x5933('0x33')][_0x5933('0x58')])[_0x5933('0x13')](function(){if(_[_0x5933('0x122')](_0x1e9325[_0x5933('0x33')]['ids'])){for(var _0x137898=0x0;_0x137898<_0x1e9325[_0x5933('0x33')][_0x5933('0x58')][_0x5933('0x38')];_0x137898+=0x1){socket[_0x5933('0x120')](_0x5933('0x123'),{'UserId':Number(_0x1e9325[_0x5933('0x33')]['ids'][_0x137898]),'ChatWebsiteId':Number(_0x1e9325[_0x5933('0x44')]['id'])});}}else{socket[_0x5933('0x120')](_0x5933('0x123'),{'UserId':Number(_0x1e9325[_0x5933('0x33')][_0x5933('0x58')]),'ChatWebsiteId':Number(_0x1e9325['params']['id'])});}});}})[_0x5933('0x13')](respondWithStatusCode(_0x1f903c,null))[_0x5933('0x42')](handleError(_0x1f903c,null));};exports[_0x5933('0x124')]=function(_0x4fd833,_0x3ff8d4){var _0x321c07={};var _0xddff9a={};var _0x559685;var _0x372085;return db[_0x5933('0x2c')]['findOne']({'where':{'id':_0x4fd833[_0x5933('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ff8d4,null))[_0x5933('0x13')](function(_0x55f6bb){if(_0x55f6bb){_0x559685=_0x55f6bb;_0xddff9a[_0x5933('0x31')]=_[_0x5933('0x32')](db[_0x5933('0xb9')]['rawAttributes']);_0xddff9a[_0x5933('0x33')]=_['keys'](_0x4fd833[_0x5933('0x33')]);_0xddff9a['filters']=_[_0x5933('0x35')](_0xddff9a[_0x5933('0x31')],_0xddff9a[_0x5933('0x33')]);_0x321c07[_0x5933('0x36')]=_['intersection'](_0xddff9a['model'],qs['fields'](_0x4fd833[_0x5933('0x33')]['fields']));_0x321c07[_0x5933('0x36')]=_0x321c07[_0x5933('0x36')][_0x5933('0x38')]?_0x321c07[_0x5933('0x36')]:_0xddff9a[_0x5933('0x31')];_0x321c07[_0x5933('0x3a')]=qs[_0x5933('0x3b')](_0x4fd833['query']['sort']);_0x321c07[_0x5933('0x3c')]=qs[_0x5933('0x34')](_[_0x5933('0x55')](_0x4fd833['query'],_0xddff9a['filters']));if(_0x4fd833[_0x5933('0x33')]['filter']){_0x321c07[_0x5933('0x3c')]=_[_0x5933('0x3d')](_0x321c07[_0x5933('0x3c')],{'$or':_[_0x5933('0x2b')](_0x321c07[_0x5933('0x36')],function(_0x361009){var _0x23ce46={};_0x23ce46[_0x361009]={'$like':'%'+_0x4fd833[_0x5933('0x33')]['filter']+'%'};return _0x23ce46;})});}_0x321c07=_[_0x5933('0x3d')]({},_0x321c07,_0x4fd833[_0x5933('0x47')]);return _0x559685['getAgents'](_0x321c07);}})['then'](function(_0xc15a9c){if(_0xc15a9c){_0x372085=_0xc15a9c[_0x5933('0x38')];if(!_0x4fd833['query'][_0x5933('0x39')](_0x5933('0x5d'))){_0x321c07[_0x5933('0x1f')]=qs['limit'](_0x4fd833['query'][_0x5933('0x1f')]);_0x321c07['offset']=qs[_0x5933('0x1e')](_0x4fd833['query'][_0x5933('0x1e')]);}return _0x559685[_0x5933('0x124')](_0x321c07);}})[_0x5933('0x13')](function(_0x5eb665){if(_0x5eb665){return _0x5eb665?{'count':_0x372085,'rows':_0x5eb665}:null;}})[_0x5933('0x13')](respondWithResult(_0x3ff8d4,null))[_0x5933('0x42')](handleError(_0x3ff8d4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3d7a001..2c30eae 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 _0x2263=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xf2f367,_0x188411){var _0x3e918a=function(_0x445c8b){while(--_0x445c8b){_0xf2f367['push'](_0xf2f367['shift']());}};_0x3e918a(++_0x188411);}(_0x2263,0x6e));var _0x3226=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2263[_0x40ac5e];return _0x2839d6;};'use strict';var EventEmitter=require(_0x3226('0x0'));var ChatWebsite=require(_0x3226('0x1'))['db'][_0x3226('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3226('0x3')](0x0);var events={'afterCreate':_0x3226('0x4'),'afterUpdate':_0x3226('0x5'),'afterDestroy':_0x3226('0x6')};function emitEvent(_0x1541e7){return function(_0x4acb00,_0x242bcf,_0x572291){ChatWebsiteEvents[_0x3226('0x7')](_0x1541e7+':'+_0x4acb00['id'],_0x4acb00);ChatWebsiteEvents[_0x3226('0x7')](_0x1541e7,_0x4acb00);_0x572291(null);};}for(var e in events){if(events[_0x3226('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3226('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa37e=['hook','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x61533b,_0x404df5){var _0x156b05=function(_0x2e1fe0){while(--_0x2e1fe0){_0x61533b['push'](_0x61533b['shift']());}};_0x156b05(++_0x404df5);}(_0xa37e,0x97));var _0xea37=function(_0x198154,_0x1fed94){_0x198154=_0x198154-0x0;var _0x22ff10=_0xa37e[_0x198154];return _0x22ff10;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xea37('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xea37('0x1')](0x0);var events={'afterCreate':_0xea37('0x2'),'afterUpdate':_0xea37('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cabb8){return function(_0x537c5a,_0x360ed5,_0x3eea71){ChatWebsiteEvents[_0xea37('0x4')](_0x3cabb8+':'+_0x537c5a['id'],_0x537c5a);ChatWebsiteEvents['emit'](_0x3cabb8,_0x537c5a);_0x3eea71(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xea37('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 68407b9..7d03123 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 _0xae94=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x39c9a5,_0xa9a25f){var _0x4ebfda=function(_0x5dd594){while(--_0x5dd594){_0x39c9a5['push'](_0x39c9a5['shift']());}};_0x4ebfda(++_0xa9a25f);}(_0xae94,0x1b4));var _0x4ae9=function(_0x561f49,_0x1ccfd8){_0x561f49=_0x561f49-0x0;var _0x1c8a47=_0xae94[_0x561f49];return _0x1c8a47;};'use strict';var _=require(_0x4ae9('0x0'));var util=require(_0x4ae9('0x1'));var logger=require(_0x4ae9('0x2'))(_0x4ae9('0x3'));var moment=require('moment');var BPromise=require(_0x4ae9('0x4'));var rp=require(_0x4ae9('0x5'));var fs=require('fs');var path=require(_0x4ae9('0x6'));var rimraf=require(_0x4ae9('0x7'));var config=require(_0x4ae9('0x8'));var attributes=require(_0x4ae9('0x9'));module[_0x4ae9('0xa')]=function(_0x5949b2,_0x34e76b){return _0x5949b2['define'](_0x4ae9('0xb'),attributes,{'tableName':_0x4ae9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a43=['path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','api','moment','bluebird'];(function(_0x1a0e6a,_0x1b43de){var _0x4b3934=function(_0x81dc97){while(--_0x81dc97){_0x1a0e6a['push'](_0x1a0e6a['shift']());}};_0x4b3934(++_0x1b43de);}(_0x1a43,0x18c));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x31a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x31a4('0x1'));var moment=require(_0x31a4('0x2'));var BPromise=require(_0x31a4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31a4('0x4'));var rimraf=require(_0x31a4('0x5'));var config=require(_0x31a4('0x6'));var attributes=require(_0x31a4('0x7'));module['exports']=function(_0x44c14b,_0xbdf4a){return _0x44c14b[_0x31a4('0x8')]('ChatWebsite',attributes,{'tableName':_0x31a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index a1e8451..4e355d6 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 _0xa9a4=['info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','./chatWebsite.socket','register'];(function(_0x5ed43b,_0x4e3b43){var _0x8007d8=function(_0x1f5160){while(--_0x1f5160){_0x5ed43b['push'](_0x5ed43b['shift']());}};_0x8007d8(++_0x4e3b43);}(_0xa9a4,0x145));var _0x4a9a=function(_0x8ede0d,_0xaa023d){_0x8ede0d=_0x8ede0d-0x0;var _0x31cbaa=_0xa9a4[_0x8ede0d];return _0x31cbaa;};'use strict';var _=require(_0x4a9a('0x0'));var util=require(_0x4a9a('0x1'));var moment=require(_0x4a9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a9a('0x3'));var logger=require(_0x4a9a('0x4'))('rpc');var config=require(_0x4a9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4a9a('0x6')]['http']({'port':0x232a});config[_0x4a9a('0x7')]=_['defaults'](config[_0x4a9a('0x7')],{'host':_0x4a9a('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a9a('0x7')]));require(_0x4a9a('0x9'))[_0x4a9a('0xa')](socket);function respondWithRpcPromise(_0x2c0e95,_0x367e19,_0x2d387e){return new BPromise(function(_0x27d8d3,_0x4e9220){return client['request'](_0x2c0e95,_0x2d387e)['then'](function(_0x410557){logger[_0x4a9a('0xb')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x4a9a('0xc'));logger[_0x4a9a('0xd')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x367e19,_0x4a9a('0xc'),JSON[_0x4a9a('0xe')](_0x410557));if(_0x410557['error']){if(_0x410557['error'][_0x4a9a('0xf')]===0x1f4){logger[_0x4a9a('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x410557[_0x4a9a('0x10')][_0x4a9a('0x11')]);return _0x4e9220(_0x410557[_0x4a9a('0x10')]['message']);}logger[_0x4a9a('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x367e19,_0x410557['error'][_0x4a9a('0x11')]);return _0x27d8d3(_0x410557['error'][_0x4a9a('0x11')]);}else{logger['info'](_0x4a9a('0x12'),_0x367e19,_0x4a9a('0xc'));_0x27d8d3(_0x410557[_0x4a9a('0x13')]['message']);}})[_0x4a9a('0x14')](function(_0x44a418){logger[_0x4a9a('0x10')](_0x4a9a('0x12'),_0x367e19,_0x44a418);_0x4e9220(_0x44a418);});});} \ No newline at end of file +var _0x6025=['defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x269a80,_0xac79c1){var _0x2e125e=function(_0x5b068e){while(--_0x5b068e){_0x269a80['push'](_0x269a80['shift']());}};_0x2e125e(++_0xac79c1);}(_0x6025,0x138));var _0x5602=function(_0x1d20b5,_0x19a3c6){_0x1d20b5=_0x1d20b5-0x0;var _0xdbbd2d=_0x6025[_0x1d20b5];return _0xdbbd2d;};'use strict';var _=require(_0x5602('0x0'));var util=require(_0x5602('0x1'));var moment=require('moment');var BPromise=require(_0x5602('0x2'));var rs=require(_0x5602('0x3'));var fs=require('fs');var Redis=require(_0x5602('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5602('0x5'))(_0x5602('0x6'));var config=require(_0x5602('0x7'));var jayson=require(_0x5602('0x8'));var client=jayson[_0x5602('0x9')][_0x5602('0xa')]({'port':0x232a});config[_0x5602('0xb')]=_[_0x5602('0xc')](config[_0x5602('0xb')],{'host':_0x5602('0xd'),'port':0x18eb});var socket=require(_0x5602('0xe'))(new Redis(config[_0x5602('0xb')]));require('./chatWebsite.socket')[_0x5602('0xf')](socket);function respondWithRpcPromise(_0x16bf97,_0x53a04b,_0x1d1d24){return new BPromise(function(_0x253d44,_0x111f07){return client[_0x5602('0x10')](_0x16bf97,_0x1d1d24)[_0x5602('0x11')](function(_0x9ae5c8){logger[_0x5602('0x12')](_0x5602('0x13'),_0x53a04b,_0x5602('0x14'));logger[_0x5602('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x53a04b,_0x5602('0x14'),JSON['stringify'](_0x9ae5c8));if(_0x9ae5c8[_0x5602('0x16')]){if(_0x9ae5c8['error'][_0x5602('0x17')]===0x1f4){logger[_0x5602('0x16')](_0x5602('0x13'),_0x53a04b,_0x9ae5c8[_0x5602('0x16')][_0x5602('0x18')]);return _0x111f07(_0x9ae5c8[_0x5602('0x16')][_0x5602('0x18')]);}logger[_0x5602('0x16')](_0x5602('0x13'),_0x53a04b,_0x9ae5c8[_0x5602('0x16')]['message']);return _0x253d44(_0x9ae5c8[_0x5602('0x16')][_0x5602('0x18')]);}else{logger['info'](_0x5602('0x13'),_0x53a04b,_0x5602('0x14'));_0x253d44(_0x9ae5c8[_0x5602('0x19')][_0x5602('0x18')]);}})[_0x5602('0x1a')](function(_0x13e455){logger['error'](_0x5602('0x13'),_0x53a04b,_0x13e455);_0x111f07(_0x13e455);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 23d8475..c6cea41 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 _0xe250=['remove','update','removeListener','chatWebsite:','./chatWebsite.events','save'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xe250,0x13c));var _0x0e25=function(_0x1e02da,_0x14633b){_0x1e02da=_0x1e02da-0x0;var _0x5d0d87=_0xe250[_0x1e02da];return _0x5d0d87;};'use strict';var ChatWebsiteEvents=require(_0x0e25('0x0'));var events=[_0x0e25('0x1'),_0x0e25('0x2'),_0x0e25('0x3')];function createListener(_0x5de450,_0x336aa7){return function(_0x195678){_0x336aa7['emit'](_0x5de450,_0x195678);};}function removeListener(_0x432e18,_0x5e3054){return function(){ChatWebsiteEvents[_0x0e25('0x4')](_0x432e18,_0x5e3054);};}exports['register']=function(_0x18c7f5){for(var _0x27d7d2=0x0,_0x2ca53d=events['length'];_0x27d7d2<_0x2ca53d;_0x27d7d2++){var _0x32d3b6=events[_0x27d7d2];var _0x5abfcb=createListener(_0x0e25('0x5')+_0x32d3b6,_0x18c7f5);ChatWebsiteEvents['on'](_0x32d3b6,_0x5abfcb);}}; \ No newline at end of file +var _0x7d13=['remove','update','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7d13,0x1cd));var _0x37d1=function(_0x3a4838,_0x5eb63c){_0x3a4838=_0x3a4838-0x0;var _0x10fc53=_0x7d13[_0x3a4838];return _0x10fc53;};'use strict';var ChatWebsiteEvents=require(_0x37d1('0x0'));var events=['save',_0x37d1('0x1'),_0x37d1('0x2')];function createListener(_0x25ec34,_0x3b82d9){return function(_0x3217e9){_0x3b82d9['emit'](_0x25ec34,_0x3217e9);};}function removeListener(_0x33bd4e,_0xd4bc8){return function(){ChatWebsiteEvents[_0x37d1('0x3')](_0x33bd4e,_0xd4bc8);};}exports[_0x37d1('0x4')]=function(_0x58ed25){for(var _0x577e13=0x0,_0x29406a=events[_0x37d1('0x5')];_0x577e13<_0x29406a;_0x577e13++){var _0x203863=events[_0x577e13];var _0xe7e7e4=createListener(_0x37d1('0x6')+_0x203863,_0x58ed25);ChatWebsiteEvents['on'](_0x203863,_0xe7e7e4);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ca70e5f..ca30c37 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 _0x5180=['addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addProactiveActions','/:id/users','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','post','addDisposition','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','format','now'];(function(_0x21dea4,_0x414d26){var _0x5e0e33=function(_0x530f8b){while(--_0x530f8b){_0x21dea4['push'](_0x21dea4['shift']());}};_0x5e0e33(++_0x414d26);}(_0x5180,0xe4));var _0x0518=function(_0x344d27,_0x562e14){_0x344d27=_0x344d27-0x0;var _0x53e3ee=_0x5180[_0x344d27];return _0x53e3ee;};'use strict';var multer=require('multer');var util=require(_0x0518('0x0'));var path=require(_0x0518('0x1'));var timeout=require(_0x0518('0x2'));var express=require(_0x0518('0x3'));var router=express[_0x0518('0x4')]();var fs_extra=require(_0x0518('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0518('0x6'));var config=require(_0x0518('0x7'));var controller=require(_0x0518('0x8'));router[_0x0518('0x9')]('/',auth['isAuthenticated'](),controller[_0x0518('0xa')]);router[_0x0518('0x9')](_0x0518('0xb'),auth[_0x0518('0xc')](),controller[_0x0518('0xd')]);router['get'](_0x0518('0xe'),auth[_0x0518('0xc')](),controller[_0x0518('0xf')]);router[_0x0518('0x9')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller['getDispositions']);router[_0x0518('0x9')](_0x0518('0x11'),auth['isAuthenticated'](),controller[_0x0518('0x12')]);router[_0x0518('0x9')](_0x0518('0x13'),controller[_0x0518('0x14')]);router[_0x0518('0x9')](_0x0518('0x15'),controller['getAvatar']);router[_0x0518('0x9')](_0x0518('0x16'),controller[_0x0518('0x17')]);router[_0x0518('0x9')](_0x0518('0x18'),controller[_0x0518('0x19')]);router[_0x0518('0x9')](_0x0518('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x0518('0x9')](_0x0518('0x1b'),controller[_0x0518('0x1c')]);router[_0x0518('0x9')](_0x0518('0x1d'),auth['isAuthenticated'](),controller['getApplications']);router[_0x0518('0x9')](_0x0518('0x1e'),auth[_0x0518('0xc')](),controller[_0x0518('0x1f')]);router[_0x0518('0x9')]('/:id/fields',controller['getFields']);router[_0x0518('0x9')](_0x0518('0x20'),auth['isAuthenticated'](),controller[_0x0518('0x21')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x0518('0x22')]('/',auth[_0x0518('0xc')](),controller['create']);router[_0x0518('0x22')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller[_0x0518('0x23')]);router[_0x0518('0x22')](_0x0518('0x11'),auth[_0x0518('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x5e0b20,_0x296fc5,_0x3124f9){_0x3124f9(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x27')));},'filename':function(_0x331521,_0x1d4114,_0x4a056a){_0x4a056a(null,util['format'](_0x0518('0x28'),Date['now'](),_0x1d4114[_0x0518('0x29')]));}})});router[_0x0518('0x22')]('/:id/logo',upload[_0x0518('0x2a')](_0x0518('0x2b')),controller[_0x0518('0x2c')]);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x8a99ce,_0x5d01a2,_0x24f495){_0x24f495(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x5ea80a,_0x5169a7,_0x4ea2b1){_0x4ea2b1(null,util[_0x0518('0x2e')]('%s-%s',Date[_0x0518('0x2f')](),_0x5169a7['originalname']));}})});router[_0x0518('0x22')]('/:id/avatar',upload['single'](_0x0518('0x2b')),controller[_0x0518('0x30')]);var upload=multer({'storage':multer[_0x0518('0x24')]({'destination':function(_0x23430b,_0x51b2ac,_0x125ea3){_0x125ea3(null,path[_0x0518('0x25')](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x5a5f40,_0x4579f4,_0x5d1439){_0x5d1439(null,util[_0x0518('0x2e')](_0x0518('0x28'),Date[_0x0518('0x2f')](),_0x4579f4[_0x0518('0x29')]));}})});router[_0x0518('0x22')](_0x0518('0x16'),upload[_0x0518('0x2a')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ecd64,_0x434837,_0x20d5d3){_0x20d5d3(null,path['join'](config[_0x0518('0x26')],_0x0518('0x2d')));},'filename':function(_0x207d83,_0x311b45,_0x5f043b){_0x5f043b(null,util[_0x0518('0x2e')](_0x0518('0x28'),Date[_0x0518('0x2f')](),_0x311b45[_0x0518('0x29')]));}})});router[_0x0518('0x22')](_0x0518('0x18'),upload[_0x0518('0x2a')]('file'),controller[_0x0518('0x31')]);router[_0x0518('0x22')](_0x0518('0x32'),controller[_0x0518('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2d5c15,_0x3c689f,_0x459fb7){const _0x4a91a3=path[_0x0518('0x25')](config['root'],_0x0518('0x34'),_0x0518('0x35'),_0x0518('0x36'));fs_extra[_0x0518('0x37')](_0x4a91a3,function(){_0x459fb7(null,_0x4a91a3);});},'filename':function(_0x14b971,_0x2759a9,_0x5cab19){const _0x20f541=_0x2759a9['originalname'][_0x0518('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3392a8=path['extname'](_0x20f541);const _0x57dcd0=Date[_0x0518('0x2f')]()+'-'+_0x20f541[_0x0518('0x38')](_0x3392a8,'')+_0x3392a8;_0x5cab19(null,_0x57dcd0);}})});router[_0x0518('0x22')](_0x0518('0x39'),offlineUploadMulter[_0x0518('0x3a')](),controller['offline']);router[_0x0518('0x22')](_0x0518('0x1a'),auth[_0x0518('0xc')](),controller[_0x0518('0x3b')]);router['post'](_0x0518('0x1d'),auth['isAuthenticated'](),controller['addApplications']);router[_0x0518('0x22')](_0x0518('0x1e'),auth[_0x0518('0xc')](),controller[_0x0518('0x3c')]);router['post'](_0x0518('0x3d'),auth[_0x0518('0xc')](),controller['addAgents']);router[_0x0518('0x3e')](_0x0518('0xe'),auth[_0x0518('0xc')](),controller['update']);router[_0x0518('0x3f')](_0x0518('0xe'),auth[_0x0518('0xc')](),controller[_0x0518('0x40')]);router[_0x0518('0x3f')](_0x0518('0x10'),auth[_0x0518('0xc')](),controller[_0x0518('0x41')]);router[_0x0518('0x3f')]('/:id/canned_answers',auth[_0x0518('0xc')](),controller[_0x0518('0x42')]);router['delete'](_0x0518('0x3d'),auth[_0x0518('0xc')](),controller[_0x0518('0x43')]);module[_0x0518('0x44')]=router; \ No newline at end of file +var _0x5da1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','join','root','format','%s-%s','now','originalname','file','diskStorage','server/files/images/avatars/','single','addAvatar','addCustomerAvatar','/:id/notify','notify','offline-chat','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','update','delete','destroy','removeDispositions','removeAnswers','exports','multer'];(function(_0x32181b,_0x532096){var _0x2e4571=function(_0x5b8217){while(--_0x5b8217){_0x32181b['push'](_0x32181b['shift']());}};_0x2e4571(++_0x532096);}(_0x5da1,0xd7));var _0x15da=function(_0x43f850,_0xdc4a7c){_0x43f850=_0x43f850-0x0;var _0x4eb906=_0x5da1[_0x43f850];return _0x4eb906;};'use strict';var multer=require(_0x15da('0x0'));var util=require(_0x15da('0x1'));var path=require(_0x15da('0x2'));var timeout=require(_0x15da('0x3'));var express=require(_0x15da('0x4'));var router=express[_0x15da('0x5')]();var fs_extra=require(_0x15da('0x6'));var auth=require(_0x15da('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x15da('0x8'));var controller=require(_0x15da('0x9'));router[_0x15da('0xa')]('/',auth[_0x15da('0xb')](),controller[_0x15da('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x15da('0xd')]);router[_0x15da('0xa')](_0x15da('0xe'),auth[_0x15da('0xb')](),controller[_0x15da('0xf')]);router['get'](_0x15da('0x10'),auth[_0x15da('0xb')](),controller[_0x15da('0x11')]);router[_0x15da('0xa')](_0x15da('0x12'),auth['isAuthenticated'](),controller[_0x15da('0x13')]);router['get'](_0x15da('0x14'),controller['getLogo']);router[_0x15da('0xa')](_0x15da('0x15'),controller[_0x15da('0x16')]);router['get'](_0x15da('0x17'),controller[_0x15da('0x18')]);router[_0x15da('0xa')](_0x15da('0x19'),controller['getSystemAvatar']);router[_0x15da('0xa')](_0x15da('0x1a'),auth['isAuthenticated'](),controller[_0x15da('0x1b')]);router[_0x15da('0xa')](_0x15da('0x1c'),controller[_0x15da('0x1d')]);router['get'](_0x15da('0x1e'),auth[_0x15da('0xb')](),controller[_0x15da('0x1f')]);router['get'](_0x15da('0x20'),auth[_0x15da('0xb')](),controller[_0x15da('0x21')]);router[_0x15da('0xa')]('/:id/fields',controller[_0x15da('0x22')]);router[_0x15da('0xa')](_0x15da('0x23'),auth[_0x15da('0xb')](),controller[_0x15da('0x24')]);router[_0x15da('0xa')](_0x15da('0x25'),auth['isAuthenticated'](),controller[_0x15da('0x26')]);router['post']('/',auth['isAuthenticated'](),controller[_0x15da('0x27')]);router['post']('/:id/dispositions',auth[_0x15da('0xb')](),controller[_0x15da('0x28')]);router[_0x15da('0x29')](_0x15da('0x12'),auth[_0x15da('0xb')](),controller[_0x15da('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16a633,_0x2aa506,_0x511b78){_0x511b78(null,path[_0x15da('0x2b')](config[_0x15da('0x2c')],'server/files/images/logos/'));},'filename':function(_0x17ebbc,_0x43c2f4,_0x43ab42){_0x43ab42(null,util[_0x15da('0x2d')](_0x15da('0x2e'),Date[_0x15da('0x2f')](),_0x43c2f4[_0x15da('0x30')]));}})});router['post'](_0x15da('0x14'),upload['single'](_0x15da('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0x15da('0x32')]({'destination':function(_0x4d18cd,_0x4244e3,_0x678a48){_0x678a48(null,path[_0x15da('0x2b')](config[_0x15da('0x2c')],_0x15da('0x33')));},'filename':function(_0x38a1c3,_0x46c087,_0x4ae2f1){_0x4ae2f1(null,util[_0x15da('0x2d')](_0x15da('0x2e'),Date[_0x15da('0x2f')](),_0x46c087[_0x15da('0x30')]));}})});router[_0x15da('0x29')](_0x15da('0x15'),upload[_0x15da('0x34')]('file'),controller[_0x15da('0x35')]);var upload=multer({'storage':multer[_0x15da('0x32')]({'destination':function(_0x110241,_0x204aeb,_0x3db74b){_0x3db74b(null,path['join'](config[_0x15da('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x221bb1,_0x4fad50,_0x31a701){_0x31a701(null,util['format'](_0x15da('0x2e'),Date[_0x15da('0x2f')](),_0x4fad50[_0x15da('0x30')]));}})});router[_0x15da('0x29')](_0x15da('0x17'),upload[_0x15da('0x34')](_0x15da('0x31')),controller[_0x15da('0x36')]);var upload=multer({'storage':multer[_0x15da('0x32')]({'destination':function(_0x32470b,_0x69f879,_0x5be636){_0x5be636(null,path[_0x15da('0x2b')](config[_0x15da('0x2c')],_0x15da('0x33')));},'filename':function(_0x52e308,_0x3c7d00,_0x3e72c5){_0x3e72c5(null,util[_0x15da('0x2d')](_0x15da('0x2e'),Date[_0x15da('0x2f')](),_0x3c7d00[_0x15da('0x30')]));}})});router[_0x15da('0x29')](_0x15da('0x19'),upload['single']('file'),controller['addSystemAvatar']);router['post'](_0x15da('0x37'),controller[_0x15da('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x15da('0x32')]({'destination':function(_0x23490d,_0x1d8823,_0x45945d){const _0x485872=path[_0x15da('0x2b')](config[_0x15da('0x2c')],'server/files','attachments',_0x15da('0x39'));fs_extra['ensureDir'](_0x485872,function(){_0x45945d(null,_0x485872);});},'filename':function(_0x541176,_0x48fbee,_0x2f8650){const _0x2fb8bc=_0x48fbee[_0x15da('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x72010a=path[_0x15da('0x3a')](_0x2fb8bc);const _0x3ae4a0=Date[_0x15da('0x2f')]()+'-'+_0x2fb8bc[_0x15da('0x3b')](_0x72010a,'')+_0x72010a;_0x2f8650(null,_0x3ae4a0);}})});router['post'](_0x15da('0x3c'),offlineUploadMulter[_0x15da('0x3d')](),controller[_0x15da('0x3e')]);router[_0x15da('0x29')](_0x15da('0x1a'),auth['isAuthenticated'](),controller[_0x15da('0x3f')]);router[_0x15da('0x29')](_0x15da('0x1e'),auth[_0x15da('0xb')](),controller[_0x15da('0x40')]);router['post'](_0x15da('0x20'),auth['isAuthenticated'](),controller[_0x15da('0x41')]);router[_0x15da('0x29')](_0x15da('0x25'),auth[_0x15da('0xb')](),controller['addAgents']);router['put'](_0x15da('0xe'),auth[_0x15da('0xb')](),controller[_0x15da('0x42')]);router[_0x15da('0x43')](_0x15da('0xe'),auth['isAuthenticated'](),controller[_0x15da('0x44')]);router[_0x15da('0x43')](_0x15da('0x10'),auth['isAuthenticated'](),controller[_0x15da('0x45')]);router[_0x15da('0x43')](_0x15da('0x12'),auth[_0x15da('0xb')](),controller[_0x15da('0x46')]);router[_0x15da('0x43')](_0x15da('0x25'),auth[_0x15da('0xb')](),controller['removeAgents']);module[_0x15da('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 6a303c0..dbc4c08 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 _0x67d2=['isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x80d5e8,_0x3be93c){var _0x3e8164=function(_0x138cf2){while(--_0x138cf2){_0x80d5e8['push'](_0x80d5e8['shift']());}};_0x3e8164(++_0x3be93c);}(_0x67d2,0xc2));var _0x267d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x67d2[_0x432682];return _0x463d05;};var beaverLogger=require('beaver-logger/server');var express=require(_0x267d('0x0'));var auth=require(_0x267d('0x1'));var config=require(_0x267d('0x2'));var router=express[_0x267d('0x3')]();var isProduction=config[_0x267d('0x4')]==='production'||![];function clientSideLogs(_0x252104,_0x3904f5,_0x48f201){var _0x34deca=_0x252104['app']['get'](_0x267d('0x5'));if(!_0x34deca){throw new Error(_0x267d('0x6'));}return beaverLogger[_0x267d('0x7')]({'uri':_0x267d('0x8'),'logger':_0x34deca,'enableCors':!isProduction})(_0x252104,_0x3904f5,_0x48f201);}router[_0x267d('0x9')](auth[_0x267d('0xa')](),clientSideLogs);module[_0x267d('0xb')]=router; \ No newline at end of file +var _0x2cfa=['isAuthenticated','exports','express','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x3ddf68,_0x143ed4){var _0x1cb8d6=function(_0x57b49e){while(--_0x57b49e){_0x3ddf68['push'](_0x3ddf68['shift']());}};_0x1cb8d6(++_0x143ed4);}(_0x2cfa,0x1af));var _0xa2cf=function(_0x2146dc,_0x5736a0){_0x2146dc=_0x2146dc-0x0;var _0x958647=_0x2cfa[_0x2146dc];return _0x958647;};var beaverLogger=require('beaver-logger/server');var express=require(_0xa2cf('0x0'));var auth=require('../components/auth/service');var config=require(_0xa2cf('0x1'));var router=express[_0xa2cf('0x2')]();var isProduction=config['env']===_0xa2cf('0x3')||![];function clientSideLogs(_0x2cbe8c,_0x234001,_0x3b4ca2){var _0x2f5f29=_0x2cbe8c[_0xa2cf('0x4')][_0xa2cf('0x5')](_0xa2cf('0x6'));if(!_0x2f5f29){throw new Error(_0xa2cf('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xa2cf('0x8'),'logger':_0x2f5f29,'enableCors':!isProduction})(_0x2cbe8c,_0x234001,_0x3b4ca2);}router['use'](auth[_0xa2cf('0x9')](),clientSideLogs);module[_0xa2cf('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 5d79c7d..9a38fe2 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 _0xa9c8=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x1cd746,_0x4be7ad){var _0x333b65=function(_0x232401){while(--_0x232401){_0x1cd746['push'](_0x1cd746['shift']());}};_0x333b65(++_0x4be7ad);}(_0xa9c8,0x108));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a9c('0x0'));module[_0x8a9c('0x1')]={'name':{'type':Sequelize[_0x8a9c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8a9c('0x3'),_0x8a9c('0x4'),_0x8a9c('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8a9c('0x6')](_0x8a9c('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x8a9c('0x2')],'comment':_0x8a9c('0x8')},'data2':{'type':Sequelize[_0x8a9c('0x2')],'comment':_0x8a9c('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x8a9c('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x8a9c('0xb')},'data5':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xd')},'data6':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xe')},'data7':{'type':Sequelize[_0x8a9c('0xc')],'comment':_0x8a9c('0xf')}}; \ No newline at end of file +var _0xc834=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x44a946,_0x36d928){var _0x4342f4=function(_0x2b6b04){while(--_0x2b6b04){_0x44a946['push'](_0x44a946['shift']());}};_0x4342f4(++_0x36d928);}(_0xc834,0x1d4));var _0x4c83=function(_0x48731c,_0x300332){_0x48731c=_0x48731c-0x0;var _0x246f0e=_0xc834[_0x48731c];return _0x246f0e;};'use strict';var Sequelize=require(_0x4c83('0x0'));module[_0x4c83('0x1')]={'name':{'type':Sequelize[_0x4c83('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4c83('0x3')](_0x4c83('0x4'),_0x4c83('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4c83('0x3')](_0x4c83('0x6'),_0x4c83('0x7'))},'data1':{'type':Sequelize[_0x4c83('0x2')],'comment':_0x4c83('0x8')},'data2':{'type':Sequelize[_0x4c83('0x2')],'comment':_0x4c83('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x4c83('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x4c83('0xb')},'data5':{'type':Sequelize[_0x4c83('0xc')],'comment':_0x4c83('0xd')},'data6':{'type':Sequelize[_0x4c83('0xc')],'comment':_0x4c83('0xe')},'data7':{'type':Sequelize[_0x4c83('0xc')],'comment':_0x4c83('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a13e092..80bec9f 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 _0xb258=['offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','send','slice','index','CloudProvider','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','service','decryptString','data3','catch','show','params','rawAttributes','include','create','body','Name\x20parameter\x20not\x20specified','join','MicrosoftAzure','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json'];(function(_0x561f16,_0x3b9227){var _0x887390=function(_0x3b14de){while(--_0x3b14de){_0x561f16['push'](_0x561f16['shift']());}};_0x887390(++_0x3b9227);}(_0xb258,0x176));var _0x8b25=function(_0x1d36cd,_0x20ea11){_0x1d36cd=_0x1d36cd-0x0;var _0x35c2e2=_0xb258[_0x1d36cd];return _0x35c2e2;};'use strict';var _=require(_0x8b25('0x0'));var Redis=require(_0x8b25('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x8b25('0x2'));var config=require('../../config/environment');var logger=require(_0x8b25('0x3'))(_0x8b25('0x4'));var db=require(_0x8b25('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8b25('0x6')]=_[_0x8b25('0x7')](config[_0x8b25('0x6')],{'host':_0x8b25('0x8'),'port':0x18eb});var socket=require(_0x8b25('0x9'))(new Redis(config[_0x8b25('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x136513,_0x3f7087){_0x3f7087=_0x3f7087||0xcc;return function(_0xada10b){if(_0xada10b){return _0x136513[_0x8b25('0xa')](_0x3f7087);}return _0x136513[_0x8b25('0xb')](_0x3f7087)[_0x8b25('0xc')]();};}function respondWithResult(_0x263912,_0x29ade1){_0x29ade1=_0x29ade1||0xc8;return function(_0x30706c){if(_0x30706c){return _0x263912[_0x8b25('0xb')](_0x29ade1)[_0x8b25('0xd')](_0x30706c);}};}function respondWithFilteredResult(_0x57a286,_0x100a5a){return function(_0x266902){if(_0x266902){var _0x108150=typeof _0x100a5a[_0x8b25('0xe')]===_0x8b25('0xf')&&typeof _0x100a5a['limit']===_0x8b25('0xf');var _0x37224c=_0x266902[_0x8b25('0x10')];var _0x1106b0=_0x108150?0x0:_0x100a5a[_0x8b25('0xe')];var _0x3c9fee=_0x108150?_0x266902[_0x8b25('0x10')]:_0x100a5a[_0x8b25('0xe')]+_0x100a5a[_0x8b25('0x11')];var _0x39ca7b;if(_0x3c9fee>=_0x37224c){_0x3c9fee=_0x37224c;_0x39ca7b=0xc8;}else{_0x39ca7b=0xce;}_0x57a286[_0x8b25('0xb')](_0x39ca7b);return _0x57a286[_0x8b25('0x12')](_0x8b25('0x13'),_0x1106b0+'-'+_0x3c9fee+'/'+_0x37224c)['json'](_0x266902);}return null;};}function saveUpdates(_0x28f7b3){return function(_0x55b3ed){if(_0x55b3ed){return _0x55b3ed[_0x8b25('0x14')](_0x28f7b3)[_0x8b25('0x15')](function(_0x1046f6){return _0x1046f6;});}return null;};}function removeEntity(_0x100d9c){return function(_0x3506f0){if(_0x3506f0){return _0x3506f0[_0x8b25('0x16')]()[_0x8b25('0x15')](function(){_0x100d9c[_0x8b25('0xb')](0xcc)[_0x8b25('0xc')]();});}};}function handleEntityNotFound(_0x228d97){return function(_0xa7812f){if(!_0xa7812f){_0x228d97['sendStatus'](0x194);}return _0xa7812f;};}function handleError(_0x336bc5,_0x405c56){_0x405c56=_0x405c56||0x1f4;return function(_0x272a35){logger[_0x8b25('0x17')](_0x272a35[_0x8b25('0x18')]);if(_0x272a35['name']){delete _0x272a35['name'];}_0x336bc5[_0x8b25('0xb')](_0x405c56)[_0x8b25('0x19')](_0x272a35);};}function maskClientSecret(_0x419679){return _['padEnd'](_0x419679[_0x8b25('0x1a')](0x0,0x3),0x14,'*');}exports[_0x8b25('0x1b')]=function(_0x54dafb,_0x13a0a5){var _0x467bab={},_0x5141db={},_0x14c28d={'count':0x0,'rows':[]};var _0x2abc7c=_['map'](db[_0x8b25('0x1c')]['rawAttributes'],function(_0x22193e){return{'name':_0x22193e[_0x8b25('0x1d')],'type':_0x22193e[_0x8b25('0x1e')][_0x8b25('0x1f')]};});_0x5141db[_0x8b25('0x20')]=_[_0x8b25('0x21')](_0x2abc7c,'name');_0x5141db[_0x8b25('0x22')]=_[_0x8b25('0x23')](_0x54dafb['query']);_0x5141db['filters']=_[_0x8b25('0x24')](_0x5141db['model'],_0x5141db[_0x8b25('0x22')]);_0x467bab[_0x8b25('0x25')]=_[_0x8b25('0x24')](_0x5141db[_0x8b25('0x20')],qs[_0x8b25('0x26')](_0x54dafb[_0x8b25('0x22')][_0x8b25('0x26')]));_0x467bab[_0x8b25('0x25')]=_0x467bab[_0x8b25('0x25')][_0x8b25('0x27')]?_0x467bab['attributes']:_0x5141db[_0x8b25('0x20')];if(!_0x54dafb['query'][_0x8b25('0x28')](_0x8b25('0x29'))){_0x467bab[_0x8b25('0x11')]=qs[_0x8b25('0x11')](_0x54dafb['query']['limit']);_0x467bab[_0x8b25('0xe')]=qs[_0x8b25('0xe')](_0x54dafb[_0x8b25('0x22')][_0x8b25('0xe')]);}_0x467bab['order']=qs['sort'](_0x54dafb[_0x8b25('0x22')]['sort']);_0x467bab[_0x8b25('0x2a')]=qs[_0x8b25('0x2b')](_[_0x8b25('0x2c')](_0x54dafb['query'],_0x5141db[_0x8b25('0x2b')]),_0x2abc7c);if(_0x54dafb['query'][_0x8b25('0x2d')]){_0x467bab[_0x8b25('0x2a')]=_[_0x8b25('0x2e')](_0x467bab['where'],{'$or':_[_0x8b25('0x21')](_0x2abc7c,function(_0x5a1fb1){if(_0x5a1fb1[_0x8b25('0x1e')]!==_0x8b25('0x2f')){var _0x2fde3e={};_0x2fde3e[_0x5a1fb1['name']]={'$like':'%'+_0x54dafb[_0x8b25('0x22')][_0x8b25('0x2d')]+'%'};return _0x2fde3e;}})});}_0x467bab=_['merge']({},_0x467bab,_0x54dafb[_0x8b25('0x30')]);var _0x4ea533={'where':_0x467bab[_0x8b25('0x2a')]};return db[_0x8b25('0x1c')][_0x8b25('0x10')](_0x4ea533)['then'](function(_0x20e62e){_0x14c28d[_0x8b25('0x10')]=_0x20e62e;if(_0x54dafb['query'][_0x8b25('0x31')]){_0x467bab['include']=[{'all':!![]}];}return db[_0x8b25('0x1c')][_0x8b25('0x32')](_0x467bab);})[_0x8b25('0x15')](function(_0x8b33f4){_0x14c28d[_0x8b25('0x33')]=_[_0x8b25('0x21')](_0x8b33f4,function(_0x4630aa){if(_0x4630aa[_0x8b25('0x34')]==='MicrosoftAzure'){var _0x213a88=encryptor[_0x8b25('0x35')](_0x4630aa['data3']);_0x4630aa[_0x8b25('0x36')]=maskClientSecret(_0x213a88);}return _0x4630aa;});return _0x14c28d;})['then'](respondWithFilteredResult(_0x13a0a5,_0x467bab))[_0x8b25('0x37')](handleError(_0x13a0a5,null));};exports[_0x8b25('0x38')]=function(_0x5e1e0e,_0x537729){var _0x1b564d={'raw':!![],'where':{'id':_0x5e1e0e[_0x8b25('0x39')]['id']}},_0x82978c={};_0x82978c[_0x8b25('0x20')]=_['keys'](db[_0x8b25('0x1c')][_0x8b25('0x3a')]);_0x82978c['query']=_['keys'](_0x5e1e0e['query']);_0x82978c[_0x8b25('0x2b')]=_[_0x8b25('0x24')](_0x82978c['model'],_0x82978c[_0x8b25('0x22')]);_0x1b564d[_0x8b25('0x25')]=_[_0x8b25('0x24')](_0x82978c[_0x8b25('0x20')],qs[_0x8b25('0x26')](_0x5e1e0e[_0x8b25('0x22')]['fields']));_0x1b564d[_0x8b25('0x25')]=_0x1b564d['attributes'][_0x8b25('0x27')]?_0x1b564d['attributes']:_0x82978c[_0x8b25('0x20')];if(_0x5e1e0e[_0x8b25('0x22')][_0x8b25('0x31')]){_0x1b564d[_0x8b25('0x3b')]=[{'all':!![]}];}_0x1b564d=_[_0x8b25('0x2e')]({},_0x1b564d,_0x5e1e0e['options']);return db['CloudProvider']['find'](_0x1b564d)['then'](handleEntityNotFound(_0x537729,null))[_0x8b25('0x15')](function(_0x4f160b){if(_0x4f160b[_0x8b25('0x34')]==='MicrosoftAzure'){var _0x6170dc=encryptor[_0x8b25('0x35')](_0x4f160b[_0x8b25('0x36')]);_0x4f160b[_0x8b25('0x36')]=maskClientSecret(_0x6170dc);}return _0x4f160b;})[_0x8b25('0x15')](respondWithResult(_0x537729,null))[_0x8b25('0x37')](handleError(_0x537729,null));};exports[_0x8b25('0x3c')]=function(_0x6e33da,_0x1c4043){if(!_0x6e33da[_0x8b25('0x3d')]['name'])throw new Error(_0x8b25('0x3e'));if(!_0x6e33da['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x6910fb=db['CloudProvider'][_0x8b25('0x3a')][_0x8b25('0x34')]['values'];if(!_0x6910fb['includes'](_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x6910fb[_0x8b25('0x3f')](',\x20'));if(_0x6e33da[_0x8b25('0x3d')]['service']===_0x8b25('0x40')&&_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]){_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]=encryptor[_0x8b25('0x41')](_0x6e33da[_0x8b25('0x3d')][_0x8b25('0x36')]);}return db[_0x8b25('0x1c')][_0x8b25('0x3c')](_0x6e33da[_0x8b25('0x3d')],{})[_0x8b25('0x15')](respondWithResult(_0x1c4043,0xc9))[_0x8b25('0x37')](handleError(_0x1c4043,null));};exports['update']=function(_0x57eb58,_0x281741){if(_0x57eb58[_0x8b25('0x3d')]['id']){delete _0x57eb58[_0x8b25('0x3d')]['id'];}return db['CloudProvider'][_0x8b25('0x42')]({'where':{'id':_0x57eb58['params']['id']}})['then'](handleEntityNotFound(_0x281741,null))[_0x8b25('0x15')](function(_0x3152bd){if(_0x3152bd[_0x8b25('0x34')]===_0x8b25('0x40')&&_0x57eb58[_0x8b25('0x3d')]['data3']){_0x57eb58[_0x8b25('0x3d')][_0x8b25('0x36')]=encryptor[_0x8b25('0x41')](_0x57eb58[_0x8b25('0x3d')][_0x8b25('0x36')]);}return _0x3152bd;})[_0x8b25('0x15')](saveUpdates(_0x57eb58[_0x8b25('0x3d')],null))['then'](respondWithResult(_0x281741,null))[_0x8b25('0x37')](handleError(_0x281741,null));};exports[_0x8b25('0x16')]=function(_0x3f9870,_0x4b9495){return db[_0x8b25('0x1c')][_0x8b25('0x42')]({'where':{'id':_0x3f9870[_0x8b25('0x39')]['id']}})[_0x8b25('0x15')](handleEntityNotFound(_0x4b9495,null))[_0x8b25('0x15')](removeEntity(_0x4b9495,null))[_0x8b25('0x37')](handleError(_0x4b9495,null));};exports[_0x8b25('0x43')]=function(_0x56768d,_0x3e1b89){return db[_0x8b25('0x1c')][_0x8b25('0x44')]({'where':{'id':_0x56768d[_0x8b25('0x39')]['id']},'raw':!![]})[_0x8b25('0x15')](function(_0x54b4dc){if(!_0x54b4dc)return _0x3e1b89['sendStatus'](0x194);return{'url':oauth[_0x8b25('0x45')](_0x54b4dc,_0x56768d[_0x8b25('0x46')]['id'])};})[_0x8b25('0x15')](respondWithResult(_0x3e1b89,null))['catch'](handleError(_0x3e1b89,null));};exports[_0x8b25('0x47')]=function(_0x5ee99b,_0x2b36ec){var _0xf39f9a=_0x5ee99b['body'];var _0x1a6dcb;var _0x1e6ae4;if(_0xf39f9a[_0x8b25('0x17')])throw _0xf39f9a;redis[_0x8b25('0x48')](_0xf39f9a[_0x8b25('0x49')])[_0x8b25('0x15')](function(_0x273ab3){if(!_0x273ab3)throw new Error(_0x8b25('0x4a'));_0x1a6dcb=JSON[_0x8b25('0x4b')](_0x273ab3);var _0x239962=Buffer[_0x8b25('0x4c')](_0xf39f9a[_0x8b25('0x49')],_0x8b25('0x4d'))[_0x8b25('0x4e')]('ascii');_0x1e6ae4=JSON[_0x8b25('0x4b')](_0x239962);if(!oauth[_0x8b25('0x4f')](_0xf39f9a[_0x8b25('0x50')],_0x1a6dcb[_0x8b25('0x51')]))throw new Error(_0x8b25('0x52'));redis[_0x8b25('0x53')](_0xf39f9a['state']);return oauth[_0x8b25('0x54')](_0xf39f9a[_0x8b25('0x55')],_0x1a6dcb);})[_0x8b25('0x15')](function(_0x55dc78){_0x1a6dcb[_0x8b25('0x56')]=_0x55dc78[_0x8b25('0x57')];_0x1a6dcb[_0x8b25('0x58')]=_0x55dc78[_0x8b25('0x59')];return db[_0x8b25('0x1c')][_0x8b25('0x14')]({'data5':_0x1a6dcb['data5'],'data6':_0x1a6dcb[_0x8b25('0x58')]},{'where':{'id':_0x1a6dcb['id']}});})[_0x8b25('0x15')](function(){oauth[_0x8b25('0x5a')](_0x1a6dcb);socket[_0x8b25('0x5b')](_0x8b25('0x5c'),{'id':_0x1e6ae4['id']});return;})['then'](respondWithStatusCode(_0x2b36ec,null))['catch'](function(_0xc118cc){if(_0x1e6ae4){socket[_0x8b25('0x5b')](_0x8b25('0x5d'),{'id':_0x1e6ae4['id']});}if(!_0x1a6dcb){logger['error'](_0x8b25('0x5e'),_0xc118cc);return _0x2b36ec['status'](0x1f4)[_0x8b25('0x19')](_0xc118cc['message']);}logger['error'](_0x8b25('0x5f'),_0x1a6dcb['id'],JSON[_0x8b25('0x60')](_0xc118cc));});}; \ No newline at end of file +var _0xcc88=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','CloudProvider','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','include','options','find','create','body','Name\x20parameter\x20not\x20specified','values','includes','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','startRefreshInterval','emit','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','status','stack','name','send','slice','index','map','rawAttributes','fieldName'];(function(_0xbd2f0,_0x4fa2cc){var _0xcc3290=function(_0x99719e){while(--_0x99719e){_0xbd2f0['push'](_0xbd2f0['shift']());}};_0xcc3290(++_0x4fa2cc);}(_0xcc88,0x1b6));var _0x8cc8=function(_0x14bf67,_0x1f326c){_0x14bf67=_0x14bf67-0x0;var _0x57e66a=_0xcc88[_0x14bf67];return _0x57e66a;};'use strict';var _=require(_0x8cc8('0x0'));var Redis=require(_0x8cc8('0x1'));var qs=require(_0x8cc8('0x2'));var encryptor=require(_0x8cc8('0x3'));var config=require(_0x8cc8('0x4'));var logger=require(_0x8cc8('0x5'))(_0x8cc8('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x8cc8('0x7'));config[_0x8cc8('0x8')]=_[_0x8cc8('0x9')](config[_0x8cc8('0x8')],{'host':_0x8cc8('0xa'),'port':0x18eb});var socket=require(_0x8cc8('0xb'))(new Redis(config[_0x8cc8('0x8')]));var redis=new Redis(config[_0x8cc8('0x8')]);function respondWithStatusCode(_0x13a0af,_0x1b0c6d){_0x1b0c6d=_0x1b0c6d||0xcc;return function(_0x5bf60c){if(_0x5bf60c){return _0x13a0af[_0x8cc8('0xc')](_0x1b0c6d);}return _0x13a0af['status'](_0x1b0c6d)[_0x8cc8('0xd')]();};}function respondWithResult(_0x928e3b,_0x166df4){_0x166df4=_0x166df4||0xc8;return function(_0x2a921d){if(_0x2a921d){return _0x928e3b['status'](_0x166df4)[_0x8cc8('0xe')](_0x2a921d);}};}function respondWithFilteredResult(_0x3330e6,_0x5bdc8b){return function(_0x59a754){if(_0x59a754){var _0x429f0d=typeof _0x5bdc8b[_0x8cc8('0xf')]===_0x8cc8('0x10')&&typeof _0x5bdc8b[_0x8cc8('0x11')]===_0x8cc8('0x10');var _0x3e75c1=_0x59a754[_0x8cc8('0x12')];var _0x433dca=_0x429f0d?0x0:_0x5bdc8b[_0x8cc8('0xf')];var _0x53d4f7=_0x429f0d?_0x59a754[_0x8cc8('0x12')]:_0x5bdc8b[_0x8cc8('0xf')]+_0x5bdc8b[_0x8cc8('0x11')];var _0x251ab1;if(_0x53d4f7>=_0x3e75c1){_0x53d4f7=_0x3e75c1;_0x251ab1=0xc8;}else{_0x251ab1=0xce;}_0x3330e6['status'](_0x251ab1);return _0x3330e6[_0x8cc8('0x13')](_0x8cc8('0x14'),_0x433dca+'-'+_0x53d4f7+'/'+_0x3e75c1)[_0x8cc8('0xe')](_0x59a754);}return null;};}function saveUpdates(_0x297d01){return function(_0x15dbdb){if(_0x15dbdb){return _0x15dbdb[_0x8cc8('0x15')](_0x297d01)['then'](function(_0x3041df){return _0x3041df;});}return null;};}function removeEntity(_0xbc27ee){return function(_0x5b8222){if(_0x5b8222){return _0x5b8222['destroy']()[_0x8cc8('0x16')](function(){_0xbc27ee[_0x8cc8('0x17')](0xcc)[_0x8cc8('0xd')]();});}};}function handleEntityNotFound(_0x60794a){return function(_0x439ae8){if(!_0x439ae8){_0x60794a['sendStatus'](0x194);}return _0x439ae8;};}function handleError(_0x35eeca,_0x55add1){_0x55add1=_0x55add1||0x1f4;return function(_0x5ef50d){logger['error'](_0x5ef50d[_0x8cc8('0x18')]);if(_0x5ef50d[_0x8cc8('0x19')]){delete _0x5ef50d[_0x8cc8('0x19')];}_0x35eeca[_0x8cc8('0x17')](_0x55add1)[_0x8cc8('0x1a')](_0x5ef50d);};}function maskClientSecret(_0x280bb3){return _['padEnd'](_0x280bb3[_0x8cc8('0x1b')](0x0,0x3),0x14,'*');}exports[_0x8cc8('0x1c')]=function(_0xcbf59,_0x3e109d){var _0x1d7ab4={},_0x3c8e13={},_0x2232bb={'count':0x0,'rows':[]};var _0x4765c3=_[_0x8cc8('0x1d')](db['CloudProvider'][_0x8cc8('0x1e')],function(_0x6cdc66){return{'name':_0x6cdc66[_0x8cc8('0x1f')],'type':_0x6cdc66['type'][_0x8cc8('0x20')]};});_0x3c8e13['model']=_['map'](_0x4765c3,_0x8cc8('0x19'));_0x3c8e13[_0x8cc8('0x21')]=_[_0x8cc8('0x22')](_0xcbf59['query']);_0x3c8e13[_0x8cc8('0x23')]=_[_0x8cc8('0x24')](_0x3c8e13[_0x8cc8('0x25')],_0x3c8e13[_0x8cc8('0x21')]);_0x1d7ab4[_0x8cc8('0x26')]=_[_0x8cc8('0x24')](_0x3c8e13[_0x8cc8('0x25')],qs[_0x8cc8('0x27')](_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x27')]));_0x1d7ab4[_0x8cc8('0x26')]=_0x1d7ab4[_0x8cc8('0x26')][_0x8cc8('0x28')]?_0x1d7ab4['attributes']:_0x3c8e13['model'];if(!_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x29')](_0x8cc8('0x2a'))){_0x1d7ab4[_0x8cc8('0x11')]=qs[_0x8cc8('0x11')](_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x11')]);_0x1d7ab4[_0x8cc8('0xf')]=qs[_0x8cc8('0xf')](_0xcbf59[_0x8cc8('0x21')]['offset']);}_0x1d7ab4['order']=qs[_0x8cc8('0x2b')](_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x2b')]);_0x1d7ab4['where']=qs['filters'](_[_0x8cc8('0x2c')](_0xcbf59[_0x8cc8('0x21')],_0x3c8e13[_0x8cc8('0x23')]),_0x4765c3);if(_0xcbf59[_0x8cc8('0x21')]['filter']){_0x1d7ab4[_0x8cc8('0x2d')]=_[_0x8cc8('0x2e')](_0x1d7ab4[_0x8cc8('0x2d')],{'$or':_[_0x8cc8('0x1d')](_0x4765c3,function(_0x35d02e){if(_0x35d02e['type']!==_0x8cc8('0x2f')){var _0x26841a={};_0x26841a[_0x35d02e['name']]={'$like':'%'+_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x30')]+'%'};return _0x26841a;}})});}_0x1d7ab4=_[_0x8cc8('0x2e')]({},_0x1d7ab4,_0xcbf59['options']);var _0x4d7b65={'where':_0x1d7ab4[_0x8cc8('0x2d')]};return db[_0x8cc8('0x31')][_0x8cc8('0x12')](_0x4d7b65)[_0x8cc8('0x16')](function(_0x2a2cde){_0x2232bb[_0x8cc8('0x12')]=_0x2a2cde;if(_0xcbf59[_0x8cc8('0x21')][_0x8cc8('0x32')]){_0x1d7ab4['include']=[{'all':!![]}];}return db[_0x8cc8('0x31')][_0x8cc8('0x33')](_0x1d7ab4);})[_0x8cc8('0x16')](function(_0x225955){_0x2232bb['rows']=_[_0x8cc8('0x1d')](_0x225955,function(_0x2c4400){if(_0x2c4400[_0x8cc8('0x34')]===_0x8cc8('0x35')){var _0x3e6556=encryptor[_0x8cc8('0x36')](_0x2c4400[_0x8cc8('0x37')]);_0x2c4400[_0x8cc8('0x37')]=maskClientSecret(_0x3e6556);}return _0x2c4400;});return _0x2232bb;})[_0x8cc8('0x16')](respondWithFilteredResult(_0x3e109d,_0x1d7ab4))[_0x8cc8('0x38')](handleError(_0x3e109d,null));};exports[_0x8cc8('0x39')]=function(_0x150113,_0xc8097e){var _0x4f6f78={'raw':!![],'where':{'id':_0x150113[_0x8cc8('0x3a')]['id']}},_0x16b5eb={};_0x16b5eb[_0x8cc8('0x25')]=_[_0x8cc8('0x22')](db['CloudProvider'][_0x8cc8('0x1e')]);_0x16b5eb['query']=_['keys'](_0x150113[_0x8cc8('0x21')]);_0x16b5eb[_0x8cc8('0x23')]=_[_0x8cc8('0x24')](_0x16b5eb[_0x8cc8('0x25')],_0x16b5eb[_0x8cc8('0x21')]);_0x4f6f78[_0x8cc8('0x26')]=_[_0x8cc8('0x24')](_0x16b5eb[_0x8cc8('0x25')],qs[_0x8cc8('0x27')](_0x150113[_0x8cc8('0x21')]['fields']));_0x4f6f78[_0x8cc8('0x26')]=_0x4f6f78[_0x8cc8('0x26')][_0x8cc8('0x28')]?_0x4f6f78[_0x8cc8('0x26')]:_0x16b5eb[_0x8cc8('0x25')];if(_0x150113['query'][_0x8cc8('0x32')]){_0x4f6f78[_0x8cc8('0x3b')]=[{'all':!![]}];}_0x4f6f78=_[_0x8cc8('0x2e')]({},_0x4f6f78,_0x150113[_0x8cc8('0x3c')]);return db[_0x8cc8('0x31')][_0x8cc8('0x3d')](_0x4f6f78)['then'](handleEntityNotFound(_0xc8097e,null))[_0x8cc8('0x16')](function(_0x52d08c){if(_0x52d08c[_0x8cc8('0x34')]===_0x8cc8('0x35')){var _0x1e6357=encryptor[_0x8cc8('0x36')](_0x52d08c[_0x8cc8('0x37')]);_0x52d08c[_0x8cc8('0x37')]=maskClientSecret(_0x1e6357);}return _0x52d08c;})[_0x8cc8('0x16')](respondWithResult(_0xc8097e,null))[_0x8cc8('0x38')](handleError(_0xc8097e,null));};exports[_0x8cc8('0x3e')]=function(_0x12be84,_0xbaa0f9){if(!_0x12be84[_0x8cc8('0x3f')][_0x8cc8('0x19')])throw new Error(_0x8cc8('0x40'));if(!_0x12be84[_0x8cc8('0x3f')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x43a733=db['CloudProvider']['rawAttributes'][_0x8cc8('0x34')][_0x8cc8('0x41')];if(!_0x43a733[_0x8cc8('0x42')](_0x12be84['body'][_0x8cc8('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x43a733['join'](',\x20'));if(_0x12be84[_0x8cc8('0x3f')][_0x8cc8('0x34')]===_0x8cc8('0x35')&&_0x12be84[_0x8cc8('0x3f')][_0x8cc8('0x37')]){_0x12be84[_0x8cc8('0x3f')][_0x8cc8('0x37')]=encryptor['encryptString'](_0x12be84[_0x8cc8('0x3f')][_0x8cc8('0x37')]);}return db[_0x8cc8('0x31')][_0x8cc8('0x3e')](_0x12be84[_0x8cc8('0x3f')],{})[_0x8cc8('0x16')](respondWithResult(_0xbaa0f9,0xc9))['catch'](handleError(_0xbaa0f9,null));};exports[_0x8cc8('0x15')]=function(_0x43888f,_0x56c5ce){if(_0x43888f['body']['id']){delete _0x43888f[_0x8cc8('0x3f')]['id'];}return db[_0x8cc8('0x31')]['find']({'where':{'id':_0x43888f[_0x8cc8('0x3a')]['id']}})[_0x8cc8('0x16')](handleEntityNotFound(_0x56c5ce,null))[_0x8cc8('0x16')](function(_0x1899b4){if(_0x1899b4[_0x8cc8('0x34')]===_0x8cc8('0x35')&&_0x43888f[_0x8cc8('0x3f')]['data3']){_0x43888f[_0x8cc8('0x3f')][_0x8cc8('0x37')]=encryptor[_0x8cc8('0x43')](_0x43888f['body'][_0x8cc8('0x37')]);}return _0x1899b4;})[_0x8cc8('0x16')](saveUpdates(_0x43888f[_0x8cc8('0x3f')],null))[_0x8cc8('0x16')](respondWithResult(_0x56c5ce,null))[_0x8cc8('0x38')](handleError(_0x56c5ce,null));};exports[_0x8cc8('0x44')]=function(_0x145b4a,_0x169d38){return db[_0x8cc8('0x31')][_0x8cc8('0x3d')]({'where':{'id':_0x145b4a[_0x8cc8('0x3a')]['id']}})['then'](handleEntityNotFound(_0x169d38,null))['then'](removeEntity(_0x169d38,null))[_0x8cc8('0x38')](handleError(_0x169d38,null));};exports[_0x8cc8('0x45')]=function(_0x23296d,_0x579696){return db[_0x8cc8('0x31')][_0x8cc8('0x46')]({'where':{'id':_0x23296d[_0x8cc8('0x3a')]['id']},'raw':!![]})[_0x8cc8('0x16')](function(_0x2fd4ef){if(!_0x2fd4ef)return _0x579696[_0x8cc8('0xc')](0x194);return{'url':oauth[_0x8cc8('0x47')](_0x2fd4ef,_0x23296d[_0x8cc8('0x48')]['id'])};})[_0x8cc8('0x16')](respondWithResult(_0x579696,null))[_0x8cc8('0x38')](handleError(_0x579696,null));};exports[_0x8cc8('0x49')]=function(_0x276cbe,_0x4fd3c3){var _0x4b42b8=_0x276cbe[_0x8cc8('0x3f')];var _0x383c96;var _0x2f6308;if(_0x4b42b8[_0x8cc8('0x4a')])throw _0x4b42b8;redis[_0x8cc8('0x4b')](_0x4b42b8['state'])[_0x8cc8('0x16')](function(_0x3bf81a){if(!_0x3bf81a)throw new Error(_0x8cc8('0x4c'));_0x383c96=JSON[_0x8cc8('0x4d')](_0x3bf81a);var _0x5c62d8=Buffer[_0x8cc8('0x4e')](_0x4b42b8['state'],_0x8cc8('0x4f'))[_0x8cc8('0x50')](_0x8cc8('0x51'));_0x2f6308=JSON[_0x8cc8('0x4d')](_0x5c62d8);if(!oauth[_0x8cc8('0x52')](_0x4b42b8[_0x8cc8('0x53')],_0x383c96[_0x8cc8('0x54')]))throw new Error(_0x8cc8('0x55'));redis[_0x8cc8('0x56')](_0x4b42b8['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x4b42b8[_0x8cc8('0x57')],_0x383c96);})[_0x8cc8('0x16')](function(_0x30cad6){_0x383c96[_0x8cc8('0x58')]=_0x30cad6[_0x8cc8('0x59')];_0x383c96[_0x8cc8('0x5a')]=_0x30cad6['refresh_token'];return db[_0x8cc8('0x31')][_0x8cc8('0x15')]({'data5':_0x383c96[_0x8cc8('0x58')],'data6':_0x383c96[_0x8cc8('0x5a')]},{'where':{'id':_0x383c96['id']}});})['then'](function(){oauth[_0x8cc8('0x5b')](_0x383c96);socket['emit']('microsoftAuthorization:success',{'id':_0x2f6308['id']});return;})['then'](respondWithStatusCode(_0x4fd3c3,null))['catch'](function(_0x1e8e75){if(_0x2f6308){socket[_0x8cc8('0x5c')]('microsoftAuthorization:error',{'id':_0x2f6308['id']});}if(!_0x383c96){logger[_0x8cc8('0x4a')]('Invalid\x20authentication\x20state\x20parameter',_0x1e8e75);return _0x4fd3c3[_0x8cc8('0x17')](0x1f4)['send'](_0x1e8e75['message']);}logger[_0x8cc8('0x4a')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x383c96['id'],JSON[_0x8cc8('0x5d')](_0x1e8e75));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index dc8eeb8..7d8cc00 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 _0xf90e=['CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5358f2,_0x49d10c){var _0x1c8340=function(_0x5a4a88){while(--_0x5a4a88){_0x5358f2['push'](_0x5358f2['shift']());}};_0x1c8340(++_0x49d10c);}(_0xf90e,0xfe));var _0xef90=function(_0x1732d3,_0x4bc1ab){_0x1732d3=_0x1732d3-0x0;var _0x5182a7=_0xf90e[_0x1732d3];return _0x5182a7;};'use strict';var _=require(_0xef90('0x0'));var util=require('util');var logger=require(_0xef90('0x1'))(_0xef90('0x2'));var moment=require('moment');var BPromise=require(_0xef90('0x3'));var rp=require(_0xef90('0x4'));var fs=require('fs');var path=require(_0xef90('0x5'));var rimraf=require(_0xef90('0x6'));var config=require(_0xef90('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xef90('0x8')]=function(_0x461f3a,_0x269cc6){return _0x461f3a[_0xef90('0x9')](_0xef90('0xa'),attributes,{'tableName':_0xef90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2fa=['moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0xd2fa,0xa2));var _0xad2f=function(_0x420bb7,_0x4e6b0a){_0x420bb7=_0x420bb7-0x0;var _0x487c52=_0xd2fa[_0x420bb7];return _0x487c52;};'use strict';var _=require(_0xad2f('0x0'));var util=require(_0xad2f('0x1'));var logger=require(_0xad2f('0x2'))('api');var moment=require(_0xad2f('0x3'));var BPromise=require(_0xad2f('0x4'));var rp=require(_0xad2f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad2f('0x6'));var config=require(_0xad2f('0x7'));var attributes=require(_0xad2f('0x8'));module['exports']=function(_0x2c0a1d,_0x1559f6){return _0x2c0a1d['define'](_0xad2f('0x9'),attributes,{'tableName':_0xad2f('0xa'),'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 202f14b..7ff71d6 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 _0xfc43=['isAfter','unix','exp','resolve','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','decode','payload','iss','issuer','aud'];(function(_0x52972d,_0x39df87){var _0x1c853c=function(_0x4c7e1b){while(--_0x4c7e1b){_0x52972d['push'](_0x52972d['shift']());}};_0x1c853c(++_0x39df87);}(_0xfc43,0xc1));var _0x3fc4=function(_0x440572,_0x27491b){_0x440572=_0x440572-0x0;var _0x1781c4=_0xfc43[_0x440572];return _0x1781c4;};'use strict';var _=require(_0x3fc4('0x0'));var crypto=require(_0x3fc4('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x3fc4('0x2'));var Redis=require(_0x3fc4('0x3'));var rp=require(_0x3fc4('0x4'));var util=require(_0x3fc4('0x5'));var encryptor=require(_0x3fc4('0x6'));var config=require(_0x3fc4('0x7'));var logger=require(_0x3fc4('0x8'))(_0x3fc4('0x9'));var schedule=require(_0x3fc4('0xa'));var db=require(_0x3fc4('0xb'))['db'];config[_0x3fc4('0xc')]=_['defaults'](config['redis'],{'host':_0x3fc4('0xd'),'port':0x18eb});var redis=new Redis(config[_0x3fc4('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3fc4('0xe'),_0x3fc4('0xf'),_0x3fc4('0x10'),_0x3fc4('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x3fc4('0x12')],'Dynamics365':['openid',_0x3fc4('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x3fc4('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x3fc4('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x229677){var _0x344521=_[_0x3fc4('0x15')](AZURE_AUTH_SCOPES[_0x229677[_0x3fc4('0x16')]]);if(_0x229677[_0x3fc4('0x16')]===_0x3fc4('0x17'))_0x344521[_0x3fc4('0x18')](_0x229677[_0x3fc4('0x19')]+'/.default');return _0x344521[_0x3fc4('0x1a')]('\x20');}function getAccessTokenScope(_0xe89d1b){if(_0xe89d1b[_0x3fc4('0x16')]===_0x3fc4('0x1b'))return _0x3fc4('0x1c');if(_0xe89d1b[_0x3fc4('0x16')]===_0x3fc4('0x17'))return _0xe89d1b[_0x3fc4('0x19')]+_0x3fc4('0x1d');}function generateMicrosoftAuthorizationUrl(_0x51519b,_0x1464e1){var _0xa78ebd=MICROSOFT_AUTH_URL[_0x3fc4('0x1e')]('{TENANT_ID}',_0x51519b[_0x3fc4('0x1f')]);var _0x853db4=[_0x3fc4('0x20'),_0x3fc4('0x21')];var _0x4dc58a=Buffer[_0x3fc4('0x22')](JSON[_0x3fc4('0x23')]({'id':_0x1464e1}))['toString'](_0x3fc4('0x24'));var _0xd3614=crypto[_0x3fc4('0x25')](0x10)[_0x3fc4('0x26')](_0x3fc4('0x27'));var _0x198175=getAuthorizationScopes(_0x51519b);var _0x3a9ed6=[{'key':_0x3fc4('0x28'),'value':_0x51519b[_0x3fc4('0x29')]},{'key':_0x3fc4('0x2a'),'value':encodeURIComponent(_0x853db4[_0x3fc4('0x1a')]('\x20'))},{'key':_0x3fc4('0x2b'),'value':_0x51519b[_0x3fc4('0x2c')]},{'key':_0x3fc4('0x2d'),'value':_0x3fc4('0x2e')},{'key':_0x3fc4('0x2f'),'value':encodeURIComponent(_0x198175)},{'key':_0x3fc4('0x30'),'value':_0x4dc58a},{'key':_0x3fc4('0x31'),'value':_0xd3614},{'key':_0x3fc4('0x32'),'value':'login'}];var _0x4e374d=_0xa78ebd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3fc4('0x15')](_0x3a9ed6,function(_0x1f9e2c){return _0x1f9e2c[_0x3fc4('0x33')]+'='+_0x1f9e2c[_0x3fc4('0x34')];})[_0x3fc4('0x1a')]('&');_0x51519b[_0x3fc4('0x35')]={'issuer':_0xa78ebd[_0x3fc4('0x1e')]('oauth2/',''),'audience':_0x51519b[_0x3fc4('0x29')],'state':_0x4dc58a,'nonce':_0xd3614};redis['set'](_0x4dc58a,JSON[_0x3fc4('0x23')](_0x51519b));return _0x4e374d;}function isValidIdToken(_0x5dd3e6,_0x5838df){try{var _0xf71a8=jwt[_0x3fc4('0x36')](_0x5dd3e6,{'complete':!![]});var _0x1fd6d5=_0xf71a8[_0x3fc4('0x37')];if(_0x1fd6d5[_0x3fc4('0x38')]!==_0x5838df[_0x3fc4('0x39')])return![];if(_0x1fd6d5[_0x3fc4('0x3a')]!==_0x5838df['audience'])return![];if(_0x1fd6d5[_0x3fc4('0x31')]!==_0x5838df['nonce'])return![];if(moment()[_0x3fc4('0x3b')](moment[_0x3fc4('0x3c')](_0x1fd6d5[_0x3fc4('0x3d')])))return![];return!![];}catch(_0x2b9665){throw _0x2b9665;}}function refreshOauth2MicrosoftAccessToken(_0x49b14f){return Promise[_0x3fc4('0x3e')]()['then'](function(){if(_0x49b14f[_0x3fc4('0x3f')])return _0x49b14f;return db[_0x3fc4('0x40')][_0x3fc4('0x41')]({'where':{'id':_0x49b14f['id']},'raw':!![]});})['then'](function(_0x5959d7){var _0x12eb0a={'grant_type':_0x3fc4('0x42'),'refresh_token':_0x5959d7[_0x3fc4('0x43')],'scope':getAccessTokenScope(_0x5959d7),'redirect_uri':_0x5959d7[_0x3fc4('0x2c')],'client_id':_0x5959d7['data1'],'client_secret':encryptor[_0x3fc4('0x44')](_0x5959d7['data3'])};var _0x2abd19={'method':_0x3fc4('0x45'),'uri':MICROSOFT_AUTH_URL[_0x3fc4('0x1e')](_0x3fc4('0x46'),_0x5959d7[_0x3fc4('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12eb0a,'json':!![]};return rp(_0x2abd19);})[_0x3fc4('0x47')](function(_0x50593d){_0x49b14f[_0x3fc4('0x48')]=_0x50593d[_0x3fc4('0x49')];_0x49b14f['data6']=_0x50593d['refresh_token'];return db[_0x3fc4('0x40')]['update']({'data5':_0x49b14f[_0x3fc4('0x48')],'data6':_0x49b14f[_0x3fc4('0x43')]},{'where':{'id':_0x49b14f['id']}});})[_0x3fc4('0x47')](function(){return _0x49b14f;})[_0x3fc4('0x4a')](function(_0x4f0452){logger[_0x3fc4('0x4b')](_0x3fc4('0x4c'),_0x49b14f['id'],_0x4f0452);});}function getOauth2MicrosoftAccessToken(_0x295a93,_0x38fb7a){var _0x12a686={'grant_type':_0x3fc4('0x4d'),'code':_0x295a93,'scope':getAccessTokenScope(_0x38fb7a),'redirect_uri':_0x38fb7a[_0x3fc4('0x2c')],'client_id':_0x38fb7a[_0x3fc4('0x29')],'client_secret':encryptor[_0x3fc4('0x44')](_0x38fb7a[_0x3fc4('0x3f')])};var _0x53b10f={'method':_0x3fc4('0x45'),'uri':MICROSOFT_AUTH_URL[_0x3fc4('0x1e')](_0x3fc4('0x46'),_0x38fb7a[_0x3fc4('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12a686,'json':!![]};return rp(_0x53b10f);}function startRefreshInterval(_0xaf047f){var _0x383b8b=schedule['intervals'];if(_0x383b8b[_0xaf047f['id']])clearInterval(_0x383b8b[_0xaf047f['id']]);_0x383b8b[_0xaf047f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3fc4('0x4e')](this,{'id':_0xaf047f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3fc4('0x4f')]=_0x383b8b;}function startAllRefreshIntervals(){return db[_0x3fc4('0x40')][_0x3fc4('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3fc4('0x47')](function(_0x4097df){var _0x1204cf=_0x4097df[_0x3fc4('0x15')](function(_0x4e5af1){return refreshOauth2MicrosoftAccessToken(_0x4e5af1)[_0x3fc4('0x47')](function(_0x25a12f){startRefreshInterval(_0x25a12f);});});return Promise[_0x3fc4('0x51')](_0x1204cf);})[_0x3fc4('0x4a')](function(_0x307c6b){var _0x315c90=_0x307c6b?util['inspect'](_0x307c6b,{'showHidden':![],'depth':null}):'';logger[_0x3fc4('0x4b')](_0x3fc4('0x52'),_0x315c90);});}module[_0x3fc4('0x53')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xd9d8=['https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','client_id','response_type','response_mode','form_post','nonce','prompt','login','map','key','oauth2Claims','data1','decode','iss','issuer','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data4','decryptString','data5','access_token','data6','update','catch','error','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xd9d8,0x119));var _0x8d9d=function(_0x2db5fb,_0x428716){_0x2db5fb=_0x2db5fb-0x0;var _0x506298=_0xd9d8[_0x2db5fb];return _0x506298;};'use strict';var _=require('lodash');var crypto=require(_0x8d9d('0x0'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x8d9d('0x1'));var rp=require(_0x8d9d('0x2'));var util=require(_0x8d9d('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x8d9d('0x4'));var logger=require(_0x8d9d('0x5'))(_0x8d9d('0x6'));var schedule=require(_0x8d9d('0x7'));var db=require(_0x8d9d('0x8'))['db'];config[_0x8d9d('0x9')]=_[_0x8d9d('0xa')](config[_0x8d9d('0x9')],{'host':_0x8d9d('0xb'),'port':0x18eb});var redis=new Redis(config[_0x8d9d('0x9')]);var MICROSOFT_AUTH_URL=_0x8d9d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8d9d('0xd'),'profile','email',_0x8d9d('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8d9d('0xf'),_0x8d9d('0x10')],'Dynamics365':[_0x8d9d('0xd'),_0x8d9d('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x8d9d('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x38a5aa){var _0x44e2d7=_['map'](AZURE_AUTH_SCOPES[_0x38a5aa[_0x8d9d('0x12')]]);if(_0x38a5aa[_0x8d9d('0x12')]===_0x8d9d('0x13'))_0x44e2d7[_0x8d9d('0x14')](_0x38a5aa[_0x8d9d('0x15')]+_0x8d9d('0x16'));return _0x44e2d7[_0x8d9d('0x17')]('\x20');}function getAccessTokenScope(_0x1e417c){if(_0x1e417c[_0x8d9d('0x12')]===_0x8d9d('0x18'))return _0x8d9d('0x19');if(_0x1e417c[_0x8d9d('0x12')]==='Dynamics365')return _0x1e417c[_0x8d9d('0x15')]+_0x8d9d('0x16');}function generateMicrosoftAuthorizationUrl(_0x48c922,_0x463663){var _0x383e5e=MICROSOFT_AUTH_URL[_0x8d9d('0x1a')](_0x8d9d('0x1b'),_0x48c922[_0x8d9d('0x1c')]);var _0x5e33c2=[_0x8d9d('0x1d'),_0x8d9d('0x1e')];var _0x32b9a7=Buffer[_0x8d9d('0x1f')](JSON[_0x8d9d('0x20')]({'id':_0x463663}))[_0x8d9d('0x21')](_0x8d9d('0x22'));var _0x532b8f=crypto['randomBytes'](0x10)['toString']('hex');var _0x286f4b=getAuthorizationScopes(_0x48c922);var _0x5542b2=[{'key':_0x8d9d('0x23'),'value':_0x48c922['data1']},{'key':_0x8d9d('0x24'),'value':encodeURIComponent(_0x5e33c2['join']('\x20'))},{'key':'redirect_uri','value':_0x48c922['data4']},{'key':_0x8d9d('0x25'),'value':_0x8d9d('0x26')},{'key':'scope','value':encodeURIComponent(_0x286f4b)},{'key':'state','value':_0x32b9a7},{'key':_0x8d9d('0x27'),'value':_0x532b8f},{'key':_0x8d9d('0x28'),'value':_0x8d9d('0x29')}];var _0x358ffb=_0x383e5e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8d9d('0x2a')](_0x5542b2,function(_0x126823){return _0x126823[_0x8d9d('0x2b')]+'='+_0x126823['value'];})[_0x8d9d('0x17')]('&');_0x48c922[_0x8d9d('0x2c')]={'issuer':_0x383e5e[_0x8d9d('0x1a')]('oauth2/',''),'audience':_0x48c922[_0x8d9d('0x2d')],'state':_0x32b9a7,'nonce':_0x532b8f};redis['set'](_0x32b9a7,JSON[_0x8d9d('0x20')](_0x48c922));return _0x358ffb;}function isValidIdToken(_0x51335c,_0x35e532){try{var _0x479257=jwt[_0x8d9d('0x2e')](_0x51335c,{'complete':!![]});var _0x22e68c=_0x479257['payload'];if(_0x22e68c[_0x8d9d('0x2f')]!==_0x35e532[_0x8d9d('0x30')])return![];if(_0x22e68c[_0x8d9d('0x31')]!==_0x35e532[_0x8d9d('0x32')])return![];if(_0x22e68c[_0x8d9d('0x27')]!==_0x35e532[_0x8d9d('0x27')])return![];if(moment()['isAfter'](moment[_0x8d9d('0x33')](_0x22e68c[_0x8d9d('0x34')])))return![];return!![];}catch(_0x1df280){throw _0x1df280;}}function refreshOauth2MicrosoftAccessToken(_0x37c5f5){return Promise[_0x8d9d('0x35')]()[_0x8d9d('0x36')](function(){if(_0x37c5f5[_0x8d9d('0x37')])return _0x37c5f5;return db[_0x8d9d('0x38')][_0x8d9d('0x39')]({'where':{'id':_0x37c5f5['id']},'raw':!![]});})[_0x8d9d('0x36')](function(_0x240400){var _0x3d3b39={'grant_type':_0x8d9d('0x3a'),'refresh_token':_0x240400['data6'],'scope':getAccessTokenScope(_0x240400),'redirect_uri':_0x240400[_0x8d9d('0x3b')],'client_id':_0x240400['data1'],'client_secret':encryptor[_0x8d9d('0x3c')](_0x240400['data3'])};var _0x3a50c4={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8d9d('0x1a')](_0x8d9d('0x1b'),_0x240400[_0x8d9d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3d3b39,'json':!![]};return rp(_0x3a50c4);})['then'](function(_0x49e827){_0x37c5f5[_0x8d9d('0x3d')]=_0x49e827[_0x8d9d('0x3e')];_0x37c5f5[_0x8d9d('0x3f')]=_0x49e827['refresh_token'];return db[_0x8d9d('0x38')][_0x8d9d('0x40')]({'data5':_0x37c5f5[_0x8d9d('0x3d')],'data6':_0x37c5f5['data6']},{'where':{'id':_0x37c5f5['id']}});})['then'](function(){return _0x37c5f5;})[_0x8d9d('0x41')](function(_0x51ab21){logger[_0x8d9d('0x42')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x37c5f5['id'],_0x51ab21);});}function getOauth2MicrosoftAccessToken(_0x1adcf4,_0x53addd){var _0x30c04d={'grant_type':_0x8d9d('0x43'),'code':_0x1adcf4,'scope':getAccessTokenScope(_0x53addd),'redirect_uri':_0x53addd[_0x8d9d('0x3b')],'client_id':_0x53addd['data1'],'client_secret':encryptor[_0x8d9d('0x3c')](_0x53addd[_0x8d9d('0x37')])};var _0x2baec8={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x8d9d('0x1b'),_0x53addd[_0x8d9d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x30c04d,'json':!![]};return rp(_0x2baec8);}function startRefreshInterval(_0x2fb511){var _0x4a3e77=schedule[_0x8d9d('0x44')];if(_0x4a3e77[_0x2fb511['id']])clearInterval(_0x4a3e77[_0x2fb511['id']]);_0x4a3e77[_0x2fb511['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8d9d('0x45')](this,{'id':_0x2fb511['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8d9d('0x44')]=_0x4a3e77;}function startAllRefreshIntervals(){return db[_0x8d9d('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8d9d('0x36')](function(_0x1d9bdf){var _0x790019=_0x1d9bdf[_0x8d9d('0x2a')](function(_0x38535f){return refreshOauth2MicrosoftAccessToken(_0x38535f)['then'](function(_0x15486c){startRefreshInterval(_0x15486c);});});return Promise[_0x8d9d('0x46')](_0x790019);})[_0x8d9d('0x41')](function(_0x459848){var _0x4fec36=_0x459848?util[_0x8d9d('0x47')](_0x459848,{'showHidden':![],'depth':null}):'';logger[_0x8d9d('0x42')](_0x8d9d('0x48'),_0x4fec36);});}module[_0x8d9d('0x49')]={'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 a059f55..e7d92c7 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 _0xf960=['CloudProvider,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c4ca7,_0x5abe87){var _0xc82d75=function(_0x27780f){while(--_0x27780f){_0x2c4ca7['push'](_0x2c4ca7['shift']());}};_0xc82d75(++_0x5abe87);}(_0xf960,0x193));var _0x0f96=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf960[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x0f96('0x0'));var util=require('util');var moment=require(_0x0f96('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f96('0x2'));var fs=require('fs');var Redis=require(_0x0f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f96('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0f96('0x5'));var jayson=require(_0x0f96('0x6'));var client=jayson[_0x0f96('0x7')][_0x0f96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x765dfe,_0x5c61f0,_0x48a12b){return new BPromise(function(_0x1c690a,_0x354642){return client[_0x0f96('0x9')](_0x765dfe,_0x48a12b)[_0x0f96('0xa')](function(_0x1eb762){logger[_0x0f96('0xb')]('CloudProvider,\x20%s,\x20%s',_0x5c61f0,_0x0f96('0xc'));logger['debug'](_0x0f96('0xd'),_0x5c61f0,'request\x20sent',JSON[_0x0f96('0xe')](_0x1eb762));if(_0x1eb762[_0x0f96('0xf')]){if(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x10')]===0x1f4){logger['error'](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x354642(_0x1eb762[_0x0f96('0xf')]['message']);}logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x1c690a(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);}else{logger['info'](_0x0f96('0x11'),_0x5c61f0,'request\x20sent');_0x1c690a(_0x1eb762['result'][_0x0f96('0x12')]);}})[_0x0f96('0x13')](function(_0x183d93){logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x183d93);_0x354642(_0x183d93);});});} \ No newline at end of file +var _0x215d=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x215d,0x187));var _0xd215=function(_0x2fd887,_0xbd24d7){_0x2fd887=_0x2fd887-0x0;var _0xc522cf=_0x215d[_0x2fd887];return _0xc522cf;};'use strict';var _=require(_0xd215('0x0'));var util=require('util');var moment=require(_0xd215('0x1'));var BPromise=require(_0xd215('0x2'));var rs=require(_0xd215('0x3'));var fs=require('fs');var Redis=require(_0xd215('0x4'));var db=require(_0xd215('0x5'))['db'];var utils=require(_0xd215('0x6'));var logger=require('../../config/logger')(_0xd215('0x7'));var config=require('../../config/environment');var jayson=require(_0xd215('0x8'));var client=jayson[_0xd215('0x9')][_0xd215('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a6d12,_0xc5d7fe,_0x4e2c85){return new BPromise(function(_0x1ab6c8,_0x28885f){return client[_0xd215('0xb')](_0x5a6d12,_0x4e2c85)['then'](function(_0x184b3f){logger[_0xd215('0xc')](_0xd215('0xd'),_0xc5d7fe,_0xd215('0xe'));logger[_0xd215('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xc5d7fe,_0xd215('0xe'),JSON[_0xd215('0x10')](_0x184b3f));if(_0x184b3f[_0xd215('0x11')]){if(_0x184b3f['error'][_0xd215('0x12')]===0x1f4){logger[_0xd215('0x11')](_0xd215('0xd'),_0xc5d7fe,_0x184b3f[_0xd215('0x11')][_0xd215('0x13')]);return _0x28885f(_0x184b3f['error'][_0xd215('0x13')]);}logger[_0xd215('0x11')](_0xd215('0xd'),_0xc5d7fe,_0x184b3f[_0xd215('0x11')][_0xd215('0x13')]);return _0x1ab6c8(_0x184b3f[_0xd215('0x11')][_0xd215('0x13')]);}else{logger[_0xd215('0xc')]('CloudProvider,\x20%s,\x20%s',_0xc5d7fe,_0xd215('0xe'));_0x1ab6c8(_0x184b3f[_0xd215('0x14')][_0xd215('0x13')]);}})[_0xd215('0x15')](function(_0x6587f1){logger[_0xd215('0x11')](_0xd215('0xd'),_0xc5d7fe,_0x6587f1);_0x28885f(_0x6587f1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 21694e8..f21db10 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x34ad56,_0x2c9ac4){var _0x2d4c7c=function(_0x5935c9){while(--_0x5935c9){_0x34ad56['push'](_0x34ad56['shift']());}};_0x2d4c7c(++_0x2c9ac4);}(_0xadb5,0xad));var _0x5adb=function(_0xa3d728,_0x465555){_0xa3d728=_0xa3d728-0x0;var _0xe3754c=_0xadb5[_0xa3d728];return _0xe3754c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x38884e,_0x2752b1){_0x38884e=_0x38884e-0x0;var _0x5f46ee=_0x7a54[_0x38884e];return _0x5f46ee;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index c004199..c79f3a8 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 _0x9772=['sequelize','STRING'];(function(_0x3f8f8c,_0x32716c){var _0x3cdf64=function(_0x16e3bb){while(--_0x16e3bb){_0x3f8f8c['push'](_0x3f8f8c['shift']());}};_0x3cdf64(++_0x32716c);}(_0x9772,0x74));var _0x2977=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9772[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x2977('0x0'));module['exports']={'name':{'type':Sequelize[_0x2977('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2977('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x2977('0x1')]},'fax':{'type':Sequelize[_0x2977('0x1')]},'type':{'type':Sequelize[_0x2977('0x1')]},'street':{'type':Sequelize[_0x2977('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2977('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2977('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2977('0x1')]},'sPostalCode':{'type':Sequelize[_0x2977('0x1')]},'sCity':{'type':Sequelize[_0x2977('0x1')]},'sCountry':{'type':Sequelize[_0x2977('0x1')]},'description':{'type':Sequelize[_0x2977('0x1')]}}; \ No newline at end of file +var _0x4c94=['exports','STRING'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x4c94,0x150));var _0x44c9=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x4c94[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require('sequelize');module[_0x44c9('0x0')]={'name':{'type':Sequelize[_0x44c9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x44c9('0x1')]},'companyId':{'type':Sequelize[_0x44c9('0x1')]},'website':{'type':Sequelize[_0x44c9('0x1')]},'phone':{'type':Sequelize[_0x44c9('0x1')]},'fax':{'type':Sequelize[_0x44c9('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x44c9('0x1')]},'postalCode':{'type':Sequelize[_0x44c9('0x1')]},'city':{'type':Sequelize[_0x44c9('0x1')]},'country':{'type':Sequelize[_0x44c9('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x44c9('0x1')]},'sStreet':{'type':Sequelize[_0x44c9('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x44c9('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44c9('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2de68e0..f4bb89e 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 _0x804f=['get','Companies','UserProfileResource','then','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','addContacts','ids','getContacts','findOne','CmContact','where','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy'];(function(_0xfca425,_0x2950d6){var _0x44ea89=function(_0x5c0db6){while(--_0x5c0db6){_0xfca425['push'](_0xfca425['shift']());}};_0x44ea89(++_0x2950d6);}(_0x804f,0xe5));var _0xf804=function(_0xef55d2,_0x3dde91){_0xef55d2=_0xef55d2-0x0;var _0x355272=_0x804f[_0xef55d2];return _0x355272;};'use strict';var emlformat=require(_0xf804('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf804('0x1'));var jsonpatch=require(_0xf804('0x2'));var rp=require('request-promise');var moment=require(_0xf804('0x3'));var BPromise=require(_0xf804('0x4'));var Mustache=require(_0xf804('0x5'));var util=require('util');var path=require(_0xf804('0x6'));var sox=require(_0xf804('0x7'));var csv=require(_0xf804('0x8'));var ejs=require(_0xf804('0x9'));var fs=require('fs');var fs_extra=require(_0xf804('0xa'));var _=require('lodash');var squel=require(_0xf804('0xb'));var crypto=require(_0xf804('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf804('0xd'));var toCsv=require(_0xf804('0x8'));var querystring=require('querystring');var Papa=require(_0xf804('0xe'));var Redis=require(_0xf804('0xf'));var authService=require(_0xf804('0x10'));var qs=require(_0xf804('0x11'));var as=require(_0xf804('0x12'));var hardwareService=require(_0xf804('0x13'));var logger=require('../../config/logger')(_0xf804('0x14'));var utils=require(_0xf804('0x15'));var config=require(_0xf804('0x16'));var licenseUtil=require(_0xf804('0x17'));var db=require(_0xf804('0x18'))['db'];function respondWithStatusCode(_0xd723f9,_0x20cbcb){_0x20cbcb=_0x20cbcb||0xcc;return function(_0x1aa93b){if(_0x1aa93b){return _0xd723f9['sendStatus'](_0x20cbcb);}return _0xd723f9[_0xf804('0x19')](_0x20cbcb)[_0xf804('0x1a')]();};}function respondWithResult(_0x3d4fba,_0x3060cf){_0x3060cf=_0x3060cf||0xc8;return function(_0x69a31e){if(_0x69a31e){return _0x3d4fba[_0xf804('0x19')](_0x3060cf)[_0xf804('0x1b')](_0x69a31e);}};}function respondWithFilteredResult(_0x1d7092,_0x58b9bb){return function(_0x178939){if(_0x178939){var _0x5b7bf6=typeof _0x58b9bb[_0xf804('0x1c')]===_0xf804('0x1d')&&typeof _0x58b9bb[_0xf804('0x1e')]==='undefined';var _0x219fc=_0x178939[_0xf804('0x1f')];var _0x5294e9=_0x5b7bf6?0x0:_0x58b9bb['offset'];var _0x230544=_0x5b7bf6?_0x178939[_0xf804('0x1f')]:_0x58b9bb[_0xf804('0x1c')]+_0x58b9bb['limit'];var _0x8dbbd8;if(_0x230544>=_0x219fc){_0x230544=_0x219fc;_0x8dbbd8=0xc8;}else{_0x8dbbd8=0xce;}_0x1d7092['status'](_0x8dbbd8);return _0x1d7092[_0xf804('0x20')](_0xf804('0x21'),_0x5294e9+'-'+_0x230544+'/'+_0x219fc)[_0xf804('0x1b')](_0x178939);}return null;};}function patchUpdates(_0x40f3e6){return function(_0x12e304){try{jsonpatch[_0xf804('0x22')](_0x12e304,_0x40f3e6,!![]);}catch(_0x318f76){return BPromise[_0xf804('0x23')](_0x318f76);}return _0x12e304['save']();};}function saveUpdates(_0x36828d,_0x4682b8){return function(_0x8da672){if(_0x8da672){return _0x8da672[_0xf804('0x24')](_0x36828d)['then'](function(_0x4e70ca){return _0x4e70ca;});}return null;};}function removeEntity(_0x507df5,_0xbf371f){return function(_0x2c9aeb){if(_0x2c9aeb){return _0x2c9aeb[_0xf804('0x25')]()['then'](function(){var _0x100575=_0x2c9aeb[_0xf804('0x26')]({'plain':!![]});var _0x3a06ad=_0xf804('0x27');return db[_0xf804('0x28')]['destroy']({'where':{'type':_0x3a06ad,'resourceId':_0x100575['id']}})['then'](function(){return _0x2c9aeb;});})[_0xf804('0x29')](function(){_0x507df5[_0xf804('0x19')](0xcc)[_0xf804('0x1a')]();});}};}function handleEntityNotFound(_0x599cd7,_0x5f2131){return function(_0x2d0c6f){if(!_0x2d0c6f){_0x599cd7[_0xf804('0x2a')](0x194);}return _0x2d0c6f;};}function handleError(_0x4be56a,_0x272843){_0x272843=_0x272843||0x1f4;return function(_0x48dfea){logger[_0xf804('0x2b')](_0x48dfea[_0xf804('0x2c')]);if(_0x48dfea[_0xf804('0x2d')]){delete _0x48dfea['name'];}_0x4be56a[_0xf804('0x19')](_0x272843)[_0xf804('0x2e')](_0x48dfea);};}exports[_0xf804('0x2f')]=function(_0x493ef0,_0x16226d){var _0x159785={},_0xfbbc={},_0x3ed71f={'count':0x0,'rows':[]};return db[_0xf804('0x30')][_0xf804('0x31')]()['then'](function(_0x11a8ed){_0xfbbc[_0xf804('0x32')]=_['keys'](_0x11a8ed);_0xfbbc[_0xf804('0x33')]=_[_0xf804('0x34')](_0x493ef0[_0xf804('0x33')]);_0xfbbc[_0xf804('0x35')]=_['intersection'](_0xfbbc[_0xf804('0x32')],_0xfbbc[_0xf804('0x33')]);_0x159785[_0xf804('0x36')]=_[_0xf804('0x37')](_0xfbbc[_0xf804('0x32')],qs[_0xf804('0x38')](_0x493ef0['query'][_0xf804('0x38')]));_0x159785['attributes']=_0x159785[_0xf804('0x36')][_0xf804('0x39')]?_0x159785['attributes']:_0xfbbc[_0xf804('0x32')];if(!_0x493ef0[_0xf804('0x33')]['hasOwnProperty'](_0xf804('0x3a'))){_0x159785[_0xf804('0x1e')]=qs[_0xf804('0x1e')](_0x493ef0[_0xf804('0x33')][_0xf804('0x1e')]);_0x159785[_0xf804('0x1c')]=qs[_0xf804('0x1c')](_0x493ef0[_0xf804('0x33')][_0xf804('0x1c')]);}_0x159785[_0xf804('0x3b')]=qs[_0xf804('0x3c')](_0x493ef0[_0xf804('0x33')][_0xf804('0x3c')]);_0x159785['where']=qs[_0xf804('0x35')](_[_0xf804('0x3d')](_0x493ef0[_0xf804('0x33')],_0xfbbc['filters']),_0x11a8ed);if(_0x493ef0[_0xf804('0x33')][_0xf804('0x3e')]){_0x159785['where']=_[_0xf804('0x3f')](_0x159785['where'],{'$or':_[_0xf804('0x40')](_0x159785['attributes'],function(_0x512445){var _0x2f003b={};_0x2f003b[_0x512445]={'$like':'%'+_0x493ef0[_0xf804('0x33')]['filter']+'%'};return _0x2f003b;})});}_0x159785=_['merge']({},_0x159785,_0x493ef0[_0xf804('0x41')]);var _0xbd9b8b={'where':_0x159785['where']};return db[_0xf804('0x30')][_0xf804('0x1f')](_0xbd9b8b)['then'](function(_0x1a89c1){_0x3ed71f['count']=_0x1a89c1;if(_0x493ef0[_0xf804('0x33')][_0xf804('0x42')]){_0x159785[_0xf804('0x43')]=[{'all':!![]}];}return db[_0xf804('0x30')][_0xf804('0x44')](_0x159785);})[_0xf804('0x29')](function(_0x3fb6f1){_0x3ed71f[_0xf804('0x45')]=_0x3fb6f1;return _0x3ed71f;})['then'](respondWithFilteredResult(_0x16226d,_0x159785))['catch'](handleError(_0x16226d,null));})[_0xf804('0x46')](handleError(_0x16226d,null));};exports[_0xf804('0x47')]=function(_0x164869,_0x4dde93){var _0x9750d={'raw':![],'where':{'id':_0x164869[_0xf804('0x48')]['id']}},_0x5c4972={};_0x5c4972['model']=_[_0xf804('0x34')](db[_0xf804('0x30')][_0xf804('0x49')]);_0x5c4972['query']=_[_0xf804('0x34')](_0x164869[_0xf804('0x33')]);_0x5c4972[_0xf804('0x35')]=_[_0xf804('0x37')](_0x5c4972[_0xf804('0x32')],_0x5c4972[_0xf804('0x33')]);_0x9750d['attributes']=_[_0xf804('0x37')](_0x5c4972[_0xf804('0x32')],qs[_0xf804('0x38')](_0x164869[_0xf804('0x33')]['fields']));_0x9750d[_0xf804('0x36')]=_0x9750d['attributes'][_0xf804('0x39')]?_0x9750d[_0xf804('0x36')]:_0x5c4972['model'];if(_0x164869[_0xf804('0x33')][_0xf804('0x42')]){_0x9750d['include']=[{'all':!![]}];}_0x9750d=_[_0xf804('0x3f')]({},_0x9750d,_0x164869['options']);return db[_0xf804('0x30')]['find'](_0x9750d)[_0xf804('0x29')](handleEntityNotFound(_0x4dde93,null))[_0xf804('0x29')](respondWithResult(_0x4dde93,null))[_0xf804('0x46')](handleError(_0x4dde93,null));};exports[_0xf804('0x4a')]=function(_0xb5b4e5,_0x521634){return db[_0xf804('0x30')][_0xf804('0x4a')](_0xb5b4e5[_0xf804('0x4b')],{})['then'](function(_0x47357d){var _0x2588de=_0xb5b4e5[_0xf804('0x4c')][_0xf804('0x26')]({'plain':!![]});if(!_0x2588de)throw new Error(_0xf804('0x4d'));if(_0x2588de[_0xf804('0x4e')]===_0xf804('0x4c')){var _0x2eaf3c=_0x47357d[_0xf804('0x26')]({'plain':!![]});var _0x13a84f=_0xf804('0x27');return db[_0xf804('0x4f')][_0xf804('0x50')]({'where':{'name':_0x13a84f,'userProfileId':_0x2588de['userProfileId']},'raw':!![]})[_0xf804('0x29')](function(_0x5ef6c8){if(_0x5ef6c8&&_0x5ef6c8[_0xf804('0x51')]===0x0){return db[_0xf804('0x28')][_0xf804('0x4a')]({'name':_0x2eaf3c['name'],'resourceId':_0x2eaf3c['id'],'type':_0x5ef6c8[_0xf804('0x2d')],'sectionId':_0x5ef6c8['id']},{})[_0xf804('0x29')](function(){return _0x47357d;});}else{return _0x47357d;}})[_0xf804('0x46')](function(_0x13ce8f){logger[_0xf804('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13ce8f);throw _0x13ce8f;});}return _0x47357d;})[_0xf804('0x29')](respondWithResult(_0x521634,0xc9))[_0xf804('0x46')](handleError(_0x521634,null));};exports[_0xf804('0x24')]=function(_0x2dfc6b,_0x5c35b5){if(_0x2dfc6b[_0xf804('0x4b')]['id']){delete _0x2dfc6b[_0xf804('0x4b')]['id'];}return db[_0xf804('0x30')][_0xf804('0x50')]({'where':{'id':_0x2dfc6b[_0xf804('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c35b5,null))['then'](saveUpdates(_0x2dfc6b[_0xf804('0x4b')],null))['then'](respondWithResult(_0x5c35b5,null))[_0xf804('0x46')](handleError(_0x5c35b5,null));};exports[_0xf804('0x25')]=function(_0x1470cd,_0x1ca086){return db[_0xf804('0x30')]['find']({'where':{'id':_0x1470cd[_0xf804('0x48')]['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x1ca086,null))['then'](removeEntity(_0x1ca086,null))[_0xf804('0x46')](handleError(_0x1ca086,null));};exports['describe']=function(_0x2a2596,_0x3826a5){return db[_0xf804('0x30')][_0xf804('0x31')]()[_0xf804('0x29')](respondWithResult(_0x3826a5,null))[_0xf804('0x46')](handleError(_0x3826a5,null));};exports[_0xf804('0x52')]=function(_0x4ea719,_0x39ccb3,_0x165d98){return db['CmContact'][_0xf804('0x50')]({'where':{'id':_0x4ea719['params']['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x39ccb3,null))[_0xf804('0x29')](function(_0x17f57c){if(_0x17f57c){return _0x17f57c['addContacts'](_0x4ea719[_0xf804('0x4b')][_0xf804('0x53')],_['omit'](_0x4ea719[_0xf804('0x4b')],[_0xf804('0x53'),'id'])||{});}})[_0xf804('0x29')](respondWithResult(_0x39ccb3,null))['catch'](handleError(_0x39ccb3,null));};exports[_0xf804('0x54')]=function(_0x1663b0,_0x7d9cae,_0x1f5db6){var _0x9921e2={};var _0x4c262b={};var _0x200df9;var _0x5ecdd3;return db[_0xf804('0x30')][_0xf804('0x55')]({'where':{'id':_0x1663b0[_0xf804('0x48')]['id']}})[_0xf804('0x29')](handleEntityNotFound(_0x7d9cae,null))[_0xf804('0x29')](function(_0x5bb704){if(_0x5bb704){_0x200df9=_0x5bb704;_0x4c262b[_0xf804('0x32')]=_[_0xf804('0x34')](db[_0xf804('0x56')][_0xf804('0x49')]);_0x4c262b[_0xf804('0x33')]=_[_0xf804('0x34')](_0x1663b0[_0xf804('0x33')]);_0x4c262b['filters']=_[_0xf804('0x37')](_0x4c262b['model'],_0x4c262b[_0xf804('0x33')]);_0x9921e2[_0xf804('0x36')]=_[_0xf804('0x37')](_0x4c262b[_0xf804('0x32')],qs[_0xf804('0x38')](_0x1663b0['query'][_0xf804('0x38')]));_0x9921e2[_0xf804('0x36')]=_0x9921e2[_0xf804('0x36')][_0xf804('0x39')]?_0x9921e2[_0xf804('0x36')]:_0x4c262b[_0xf804('0x32')];_0x9921e2[_0xf804('0x3b')]=qs[_0xf804('0x3c')](_0x1663b0[_0xf804('0x33')][_0xf804('0x3c')]);_0x9921e2[_0xf804('0x57')]=qs[_0xf804('0x35')](_[_0xf804('0x3d')](_0x1663b0[_0xf804('0x33')],_0x4c262b[_0xf804('0x35')]));if(_0x1663b0[_0xf804('0x33')]['filter']){_0x9921e2[_0xf804('0x57')]=_[_0xf804('0x3f')](_0x9921e2['where'],{'$or':_[_0xf804('0x40')](_0x9921e2['attributes'],function(_0x56d189){var _0x31c203={};_0x31c203[_0x56d189]={'$like':'%'+_0x1663b0[_0xf804('0x33')][_0xf804('0x3e')]+'%'};return _0x31c203;})});}_0x9921e2=_[_0xf804('0x3f')]({},_0x9921e2,_0x1663b0[_0xf804('0x41')]);return _0x200df9[_0xf804('0x54')](_0x9921e2);}})[_0xf804('0x29')](function(_0x5d5b68){if(_0x5d5b68){_0x5ecdd3=_0x5d5b68['length'];if(!_0x1663b0[_0xf804('0x33')][_0xf804('0x58')](_0xf804('0x3a'))){_0x9921e2[_0xf804('0x1e')]=qs[_0xf804('0x1e')](_0x1663b0[_0xf804('0x33')][_0xf804('0x1e')]);_0x9921e2['offset']=qs[_0xf804('0x1c')](_0x1663b0[_0xf804('0x33')]['offset']);}return _0x200df9['getContacts'](_0x9921e2);}})[_0xf804('0x29')](function(_0x34782e){if(_0x34782e){return _0x34782e?{'count':_0x5ecdd3,'rows':_0x34782e}:null;}})['then'](respondWithResult(_0x7d9cae,null))[_0xf804('0x46')](handleError(_0x7d9cae,null));}; \ No newline at end of file +var _0x979c=['send','index','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','options','CmCompany','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name'];(function(_0x245d02,_0x454cd7){var _0x3d7d1d=function(_0x2aa8ed){while(--_0x2aa8ed){_0x245d02['push'](_0x245d02['shift']());}};_0x3d7d1d(++_0x454cd7);}(_0x979c,0xe0));var _0xc979=function(_0x5a49f8,_0x5cf581){_0x5a49f8=_0x5a49f8-0x0;var _0x2e05d4=_0x979c[_0x5a49f8];return _0x2e05d4;};'use strict';var emlformat=require(_0xc979('0x0'));var rimraf=require(_0xc979('0x1'));var zipdir=require(_0xc979('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc979('0x3'));var moment=require(_0xc979('0x4'));var BPromise=require(_0xc979('0x5'));var Mustache=require(_0xc979('0x6'));var util=require(_0xc979('0x7'));var path=require(_0xc979('0x8'));var sox=require(_0xc979('0x9'));var csv=require(_0xc979('0xa'));var ejs=require(_0xc979('0xb'));var fs=require('fs');var fs_extra=require(_0xc979('0xc'));var _=require(_0xc979('0xd'));var squel=require(_0xc979('0xe'));var crypto=require(_0xc979('0xf'));var jsforce=require(_0xc979('0x10'));var deskjs=require(_0xc979('0x11'));var toCsv=require(_0xc979('0xa'));var querystring=require(_0xc979('0x12'));var Papa=require(_0xc979('0x13'));var Redis=require(_0xc979('0x14'));var authService=require(_0xc979('0x15'));var qs=require(_0xc979('0x16'));var as=require(_0xc979('0x17'));var hardwareService=require(_0xc979('0x18'));var logger=require(_0xc979('0x19'))(_0xc979('0x1a'));var utils=require(_0xc979('0x1b'));var config=require(_0xc979('0x1c'));var licenseUtil=require(_0xc979('0x1d'));var db=require(_0xc979('0x1e'))['db'];function respondWithStatusCode(_0x1302e7,_0x366450){_0x366450=_0x366450||0xcc;return function(_0x1a0dc4){if(_0x1a0dc4){return _0x1302e7[_0xc979('0x1f')](_0x366450);}return _0x1302e7['status'](_0x366450)['end']();};}function respondWithResult(_0x28028c,_0x3379cd){_0x3379cd=_0x3379cd||0xc8;return function(_0x39fee8){if(_0x39fee8){return _0x28028c['status'](_0x3379cd)['json'](_0x39fee8);}};}function respondWithFilteredResult(_0x49dac9,_0x1404ae){return function(_0x43c360){if(_0x43c360){var _0x2ad904=typeof _0x1404ae[_0xc979('0x20')]===_0xc979('0x21')&&typeof _0x1404ae[_0xc979('0x22')]===_0xc979('0x21');var _0xd297db=_0x43c360[_0xc979('0x23')];var _0x2849b1=_0x2ad904?0x0:_0x1404ae[_0xc979('0x20')];var _0x1b2555=_0x2ad904?_0x43c360[_0xc979('0x23')]:_0x1404ae[_0xc979('0x20')]+_0x1404ae[_0xc979('0x22')];var _0x505098;if(_0x1b2555>=_0xd297db){_0x1b2555=_0xd297db;_0x505098=0xc8;}else{_0x505098=0xce;}_0x49dac9[_0xc979('0x24')](_0x505098);return _0x49dac9['set'](_0xc979('0x25'),_0x2849b1+'-'+_0x1b2555+'/'+_0xd297db)['json'](_0x43c360);}return null;};}function patchUpdates(_0x410654){return function(_0xf8548b){try{jsonpatch[_0xc979('0x26')](_0xf8548b,_0x410654,!![]);}catch(_0x5e5a4d){return BPromise[_0xc979('0x27')](_0x5e5a4d);}return _0xf8548b[_0xc979('0x28')]();};}function saveUpdates(_0x53ce73,_0x28a0fb){return function(_0x37eb49){if(_0x37eb49){return _0x37eb49['update'](_0x53ce73)[_0xc979('0x29')](function(_0x24a89b){return _0x24a89b;});}return null;};}function removeEntity(_0x172644,_0x217091){return function(_0x29900d){if(_0x29900d){return _0x29900d[_0xc979('0x2a')]()['then'](function(){var _0x1d34a1=_0x29900d[_0xc979('0x2b')]({'plain':!![]});var _0x1ddcd5=_0xc979('0x2c');return db[_0xc979('0x2d')][_0xc979('0x2a')]({'where':{'type':_0x1ddcd5,'resourceId':_0x1d34a1['id']}})[_0xc979('0x29')](function(){return _0x29900d;});})['then'](function(){_0x172644[_0xc979('0x24')](0xcc)[_0xc979('0x2e')]();});}};}function handleEntityNotFound(_0x561c52,_0x45abcf){return function(_0x4d21c3){if(!_0x4d21c3){_0x561c52[_0xc979('0x1f')](0x194);}return _0x4d21c3;};}function handleError(_0x3b0091,_0x34f2ae){_0x34f2ae=_0x34f2ae||0x1f4;return function(_0x1565e3){logger['error'](_0x1565e3[_0xc979('0x2f')]);if(_0x1565e3['name']){delete _0x1565e3[_0xc979('0x30')];}_0x3b0091[_0xc979('0x24')](_0x34f2ae)[_0xc979('0x31')](_0x1565e3);};}exports[_0xc979('0x32')]=function(_0xbcb5e,_0x1ec9cd){var _0x3e93df={},_0x2ba9a5={},_0x13abe4={'count':0x0,'rows':[]};return db['CmCompany'][_0xc979('0x33')]()[_0xc979('0x29')](function(_0x55163e){_0x2ba9a5[_0xc979('0x34')]=_['keys'](_0x55163e);_0x2ba9a5[_0xc979('0x35')]=_[_0xc979('0x36')](_0xbcb5e[_0xc979('0x35')]);_0x2ba9a5[_0xc979('0x37')]=_[_0xc979('0x38')](_0x2ba9a5[_0xc979('0x34')],_0x2ba9a5[_0xc979('0x35')]);_0x3e93df[_0xc979('0x39')]=_[_0xc979('0x38')](_0x2ba9a5['model'],qs[_0xc979('0x3a')](_0xbcb5e['query']['fields']));_0x3e93df[_0xc979('0x39')]=_0x3e93df[_0xc979('0x39')][_0xc979('0x3b')]?_0x3e93df[_0xc979('0x39')]:_0x2ba9a5[_0xc979('0x34')];if(!_0xbcb5e[_0xc979('0x35')][_0xc979('0x3c')]('nolimit')){_0x3e93df[_0xc979('0x22')]=qs['limit'](_0xbcb5e['query'][_0xc979('0x22')]);_0x3e93df[_0xc979('0x20')]=qs[_0xc979('0x20')](_0xbcb5e[_0xc979('0x35')][_0xc979('0x20')]);}_0x3e93df[_0xc979('0x3d')]=qs[_0xc979('0x3e')](_0xbcb5e[_0xc979('0x35')][_0xc979('0x3e')]);_0x3e93df[_0xc979('0x3f')]=qs[_0xc979('0x37')](_['pick'](_0xbcb5e['query'],_0x2ba9a5[_0xc979('0x37')]),_0x55163e);if(_0xbcb5e[_0xc979('0x35')][_0xc979('0x40')]){_0x3e93df[_0xc979('0x3f')]=_[_0xc979('0x41')](_0x3e93df[_0xc979('0x3f')],{'$or':_[_0xc979('0x42')](_0x3e93df[_0xc979('0x39')],function(_0x4d3d55){var _0x4049b3={};_0x4049b3[_0x4d3d55]={'$like':'%'+_0xbcb5e['query'][_0xc979('0x40')]+'%'};return _0x4049b3;})});}_0x3e93df=_[_0xc979('0x41')]({},_0x3e93df,_0xbcb5e[_0xc979('0x43')]);var _0x1b0d29={'where':_0x3e93df[_0xc979('0x3f')]};return db[_0xc979('0x44')][_0xc979('0x23')](_0x1b0d29)[_0xc979('0x29')](function(_0x42735f){_0x13abe4[_0xc979('0x23')]=_0x42735f;if(_0xbcb5e[_0xc979('0x35')]['includeAll']){_0x3e93df[_0xc979('0x45')]=[{'all':!![]}];}return db[_0xc979('0x44')][_0xc979('0x46')](_0x3e93df);})[_0xc979('0x29')](function(_0x3b0d24){_0x13abe4[_0xc979('0x47')]=_0x3b0d24;return _0x13abe4;})[_0xc979('0x29')](respondWithFilteredResult(_0x1ec9cd,_0x3e93df))[_0xc979('0x48')](handleError(_0x1ec9cd,null));})[_0xc979('0x48')](handleError(_0x1ec9cd,null));};exports['show']=function(_0x1c80e8,_0x300310){var _0x595e97={'raw':![],'where':{'id':_0x1c80e8[_0xc979('0x49')]['id']}},_0x20d538={};_0x20d538[_0xc979('0x34')]=_[_0xc979('0x36')](db['CmCompany'][_0xc979('0x4a')]);_0x20d538[_0xc979('0x35')]=_[_0xc979('0x36')](_0x1c80e8[_0xc979('0x35')]);_0x20d538[_0xc979('0x37')]=_['intersection'](_0x20d538[_0xc979('0x34')],_0x20d538[_0xc979('0x35')]);_0x595e97[_0xc979('0x39')]=_[_0xc979('0x38')](_0x20d538[_0xc979('0x34')],qs[_0xc979('0x3a')](_0x1c80e8[_0xc979('0x35')][_0xc979('0x3a')]));_0x595e97['attributes']=_0x595e97[_0xc979('0x39')][_0xc979('0x3b')]?_0x595e97[_0xc979('0x39')]:_0x20d538[_0xc979('0x34')];if(_0x1c80e8[_0xc979('0x35')][_0xc979('0x4b')]){_0x595e97[_0xc979('0x45')]=[{'all':!![]}];}_0x595e97=_[_0xc979('0x41')]({},_0x595e97,_0x1c80e8[_0xc979('0x43')]);return db[_0xc979('0x44')][_0xc979('0x4c')](_0x595e97)[_0xc979('0x29')](handleEntityNotFound(_0x300310,null))[_0xc979('0x29')](respondWithResult(_0x300310,null))[_0xc979('0x48')](handleError(_0x300310,null));};exports['create']=function(_0x25c0e5,_0x178280){return db['CmCompany'][_0xc979('0x4d')](_0x25c0e5[_0xc979('0x4e')],{})[_0xc979('0x29')](function(_0x35f470){var _0x41eb0b=_0x25c0e5[_0xc979('0x4f')][_0xc979('0x2b')]({'plain':!![]});if(!_0x41eb0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41eb0b[_0xc979('0x50')]==='user'){var _0x3cd28f=_0x35f470[_0xc979('0x2b')]({'plain':!![]});var _0xcc48a5=_0xc979('0x2c');return db['UserProfileSection'][_0xc979('0x4c')]({'where':{'name':_0xcc48a5,'userProfileId':_0x41eb0b[_0xc979('0x51')]},'raw':!![]})['then'](function(_0x5c023b){if(_0x5c023b&&_0x5c023b['autoAssociation']===0x0){return db['UserProfileResource'][_0xc979('0x4d')]({'name':_0x3cd28f[_0xc979('0x30')],'resourceId':_0x3cd28f['id'],'type':_0x5c023b['name'],'sectionId':_0x5c023b['id']},{})[_0xc979('0x29')](function(){return _0x35f470;});}else{return _0x35f470;}})['catch'](function(_0x4c9fc0){logger[_0xc979('0x52')](_0xc979('0x53'),_0x4c9fc0);throw _0x4c9fc0;});}return _0x35f470;})[_0xc979('0x29')](respondWithResult(_0x178280,0xc9))['catch'](handleError(_0x178280,null));};exports[_0xc979('0x54')]=function(_0x32e8f1,_0x7f92ed){if(_0x32e8f1[_0xc979('0x4e')]['id']){delete _0x32e8f1[_0xc979('0x4e')]['id'];}return db[_0xc979('0x44')][_0xc979('0x4c')]({'where':{'id':_0x32e8f1[_0xc979('0x49')]['id']}})['then'](handleEntityNotFound(_0x7f92ed,null))[_0xc979('0x29')](saveUpdates(_0x32e8f1[_0xc979('0x4e')],null))[_0xc979('0x29')](respondWithResult(_0x7f92ed,null))['catch'](handleError(_0x7f92ed,null));};exports['destroy']=function(_0x3734a7,_0x33e523){return db[_0xc979('0x44')][_0xc979('0x4c')]({'where':{'id':_0x3734a7[_0xc979('0x49')]['id']}})[_0xc979('0x29')](handleEntityNotFound(_0x33e523,null))['then'](removeEntity(_0x33e523,null))[_0xc979('0x48')](handleError(_0x33e523,null));};exports[_0xc979('0x33')]=function(_0x13bcb1,_0x5da516){return db[_0xc979('0x44')]['describe']()[_0xc979('0x29')](respondWithResult(_0x5da516,null))[_0xc979('0x48')](handleError(_0x5da516,null));};exports[_0xc979('0x55')]=function(_0x174824,_0x4011c9,_0xae917d){return db[_0xc979('0x56')][_0xc979('0x4c')]({'where':{'id':_0x174824[_0xc979('0x49')]['id']}})[_0xc979('0x29')](handleEntityNotFound(_0x4011c9,null))[_0xc979('0x29')](function(_0x4896b8){if(_0x4896b8){return _0x4896b8['addContacts'](_0x174824['body'][_0xc979('0x57')],_[_0xc979('0x58')](_0x174824[_0xc979('0x4e')],[_0xc979('0x57'),'id'])||{});}})['then'](respondWithResult(_0x4011c9,null))[_0xc979('0x48')](handleError(_0x4011c9,null));};exports[_0xc979('0x59')]=function(_0x5a5cd6,_0x5c6705,_0xae8421){var _0x2e653a={};var _0x2df3f5={};var _0x149199;var _0x3e33fb;return db[_0xc979('0x44')]['findOne']({'where':{'id':_0x5a5cd6[_0xc979('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c6705,null))[_0xc979('0x29')](function(_0x536934){if(_0x536934){_0x149199=_0x536934;_0x2df3f5['model']=_['keys'](db['CmContact'][_0xc979('0x4a')]);_0x2df3f5[_0xc979('0x35')]=_['keys'](_0x5a5cd6['query']);_0x2df3f5['filters']=_[_0xc979('0x38')](_0x2df3f5['model'],_0x2df3f5['query']);_0x2e653a[_0xc979('0x39')]=_['intersection'](_0x2df3f5[_0xc979('0x34')],qs[_0xc979('0x3a')](_0x5a5cd6[_0xc979('0x35')][_0xc979('0x3a')]));_0x2e653a[_0xc979('0x39')]=_0x2e653a['attributes'][_0xc979('0x3b')]?_0x2e653a[_0xc979('0x39')]:_0x2df3f5[_0xc979('0x34')];_0x2e653a[_0xc979('0x3d')]=qs[_0xc979('0x3e')](_0x5a5cd6['query'][_0xc979('0x3e')]);_0x2e653a[_0xc979('0x3f')]=qs[_0xc979('0x37')](_[_0xc979('0x5a')](_0x5a5cd6[_0xc979('0x35')],_0x2df3f5[_0xc979('0x37')]));if(_0x5a5cd6['query'][_0xc979('0x40')]){_0x2e653a[_0xc979('0x3f')]=_[_0xc979('0x41')](_0x2e653a['where'],{'$or':_[_0xc979('0x42')](_0x2e653a[_0xc979('0x39')],function(_0x1ec934){var _0x10cd5={};_0x10cd5[_0x1ec934]={'$like':'%'+_0x5a5cd6['query'][_0xc979('0x40')]+'%'};return _0x10cd5;})});}_0x2e653a=_['merge']({},_0x2e653a,_0x5a5cd6[_0xc979('0x43')]);return _0x149199[_0xc979('0x59')](_0x2e653a);}})['then'](function(_0x463d1e){if(_0x463d1e){_0x3e33fb=_0x463d1e['length'];if(!_0x5a5cd6['query'][_0xc979('0x3c')]('nolimit')){_0x2e653a[_0xc979('0x22')]=qs[_0xc979('0x22')](_0x5a5cd6[_0xc979('0x35')][_0xc979('0x22')]);_0x2e653a[_0xc979('0x20')]=qs[_0xc979('0x20')](_0x5a5cd6[_0xc979('0x35')]['offset']);}return _0x149199[_0xc979('0x59')](_0x2e653a);}})[_0xc979('0x29')](function(_0x27951e){if(_0x27951e){return _0x27951e?{'count':_0x3e33fb,'rows':_0x27951e}:null;}})[_0xc979('0x29')](respondWithResult(_0x5c6705,null))[_0xc979('0x48')](handleError(_0x5c6705,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 75730be..fcf731b 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 _0x3691=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','moment','bluebird'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x3691,0x1d2));var _0x1369=function(_0x43da4a,_0x4d9ec1){_0x43da4a=_0x43da4a-0x0;var _0x12b578=_0x3691[_0x43da4a];return _0x12b578;};'use strict';var _=require(_0x1369('0x0'));var util=require(_0x1369('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1369('0x2'));var BPromise=require(_0x1369('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1369('0x4'));var rimraf=require(_0x1369('0x5'));var config=require('../../config/environment');var attributes=require(_0x1369('0x6'));module[_0x1369('0x7')]=function(_0x735f28,_0x14e25b){return _0x735f28[_0x1369('0x8')](_0x1369('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b17=['rimraf','../../config/environment','exports','define','CmCompany','cm_companies','util','api','moment','request-promise','path'];(function(_0x2d8280,_0x1deadf){var _0x1b11b9=function(_0x190bfe){while(--_0x190bfe){_0x2d8280['push'](_0x2d8280['shift']());}};_0x1b11b9(++_0x1deadf);}(_0x7b17,0x124));var _0x77b1=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x7b17[_0x4350c2];return _0x8b6406;};'use strict';var _=require('lodash');var util=require(_0x77b1('0x0'));var logger=require('../../config/logger')(_0x77b1('0x1'));var moment=require(_0x77b1('0x2'));var BPromise=require('bluebird');var rp=require(_0x77b1('0x3'));var fs=require('fs');var path=require(_0x77b1('0x4'));var rimraf=require(_0x77b1('0x5'));var config=require(_0x77b1('0x6'));var attributes=require('./cmCompany.attributes');module[_0x77b1('0x7')]=function(_0x1873dd,_0x36259e){return _0x1873dd[_0x77b1('0x8')](_0x77b1('0x9'),attributes,{'tableName':_0x77b1('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 6365b89..f5eb4fb 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 _0x1753=['info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2fcec4,_0x4f816b){var _0x23381c=function(_0x4ee0e9){while(--_0x4ee0e9){_0x2fcec4['push'](_0x2fcec4['shift']());}};_0x23381c(++_0x4f816b);}(_0x1753,0x71));var _0x3175=function(_0x1ca6f4,_0x498aad){_0x1ca6f4=_0x1ca6f4-0x0;var _0xeddabe=_0x1753[_0x1ca6f4];return _0xeddabe;};'use strict';var _=require(_0x3175('0x0'));var util=require(_0x3175('0x1'));var moment=require('moment');var BPromise=require(_0x3175('0x2'));var rs=require(_0x3175('0x3'));var fs=require('fs');var Redis=require(_0x3175('0x4'));var db=require(_0x3175('0x5'))['db'];var utils=require(_0x3175('0x6'));var logger=require(_0x3175('0x7'))(_0x3175('0x8'));var config=require('../../config/environment');var jayson=require(_0x3175('0x9'));var client=jayson[_0x3175('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571a10,_0x441555,_0xc01269){return new BPromise(function(_0x956d68,_0x5f4340){return client[_0x3175('0xb')](_0x571a10,_0xc01269)[_0x3175('0xc')](function(_0x30fa00){logger[_0x3175('0xd')](_0x3175('0xe'),_0x441555,'request\x20sent');logger[_0x3175('0xf')](_0x3175('0x10'),_0x441555,_0x3175('0x11'),JSON[_0x3175('0x12')](_0x30fa00));if(_0x30fa00[_0x3175('0x13')]){if(_0x30fa00[_0x3175('0x13')]['code']===0x1f4){logger[_0x3175('0x13')](_0x3175('0xe'),_0x441555,_0x30fa00[_0x3175('0x13')][_0x3175('0x14')]);return _0x5f4340(_0x30fa00[_0x3175('0x13')][_0x3175('0x14')]);}logger[_0x3175('0x13')](_0x3175('0xe'),_0x441555,_0x30fa00['error'][_0x3175('0x14')]);return _0x956d68(_0x30fa00['error'][_0x3175('0x14')]);}else{logger['info'](_0x3175('0xe'),_0x441555,_0x3175('0x11'));_0x956d68(_0x30fa00['result'][_0x3175('0x14')]);}})['catch'](function(_0x5c8a5a){logger['error'](_0x3175('0xe'),_0x441555,_0x5c8a5a);_0x5f4340(_0x5c8a5a);});});} \ No newline at end of file +var _0x40a2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird'];(function(_0x18dc83,_0x462295){var _0x8236a2=function(_0x448df4){while(--_0x448df4){_0x18dc83['push'](_0x18dc83['shift']());}};_0x8236a2(++_0x462295);}(_0x40a2,0x1e0));var _0x240a=function(_0x17e054,_0x545e13){_0x17e054=_0x17e054-0x0;var _0x4b783f=_0x40a2[_0x17e054];return _0x4b783f;};'use strict';var _=require('lodash');var util=require(_0x240a('0x0'));var moment=require(_0x240a('0x1'));var BPromise=require(_0x240a('0x2'));var rs=require(_0x240a('0x3'));var fs=require('fs');var Redis=require(_0x240a('0x4'));var db=require(_0x240a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x240a('0x6'))(_0x240a('0x7'));var config=require(_0x240a('0x8'));var jayson=require(_0x240a('0x9'));var client=jayson[_0x240a('0xa')][_0x240a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dd404,_0x3bc57a,_0x54c47b){return new BPromise(function(_0x476d70,_0x14450b){return client[_0x240a('0xc')](_0x4dd404,_0x54c47b)[_0x240a('0xd')](function(_0x3e4872){logger[_0x240a('0xe')](_0x240a('0xf'),_0x3bc57a,'request\x20sent');logger[_0x240a('0x10')](_0x240a('0x11'),_0x3bc57a,_0x240a('0x12'),JSON['stringify'](_0x3e4872));if(_0x3e4872[_0x240a('0x13')]){if(_0x3e4872['error']['code']===0x1f4){logger[_0x240a('0x13')](_0x240a('0xf'),_0x3bc57a,_0x3e4872['error'][_0x240a('0x14')]);return _0x14450b(_0x3e4872[_0x240a('0x13')][_0x240a('0x14')]);}logger['error'](_0x240a('0xf'),_0x3bc57a,_0x3e4872['error']['message']);return _0x476d70(_0x3e4872[_0x240a('0x13')][_0x240a('0x14')]);}else{logger[_0x240a('0xe')](_0x240a('0xf'),_0x3bc57a,'request\x20sent');_0x476d70(_0x3e4872[_0x240a('0x15')][_0x240a('0x14')]);}})[_0x240a('0x16')](function(_0x44219f){logger['error'](_0x240a('0xf'),_0x3bc57a,_0x44219f);_0x14450b(_0x44219f);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a7e3e98..d8ecf7f 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 _0xe7ba=['delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe7ba,0x1d1));var _0xae7b=function(_0xe1b111,_0x5661dc){_0xe1b111=_0xe1b111-0x0;var _0x339286=_0xe7ba[_0xe1b111];return _0x339286;};'use strict';var multer=require(_0xae7b('0x0'));var util=require(_0xae7b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xae7b('0x2'));var router=express['Router']();var fs_extra=require(_0xae7b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xae7b('0x4'));var config=require('../../config/environment');var controller=require(_0xae7b('0x5'));router[_0xae7b('0x6')]('/',auth[_0xae7b('0x7')](),controller[_0xae7b('0x8')]);router[_0xae7b('0x6')](_0xae7b('0x9'),auth['isAuthenticated'](),controller[_0xae7b('0xa')]);router[_0xae7b('0x6')](_0xae7b('0xb'),auth[_0xae7b('0x7')](),controller[_0xae7b('0xc')]);router['get']('/:id/contacts',auth[_0xae7b('0x7')](),controller[_0xae7b('0xd')]);router[_0xae7b('0xe')]('/',auth['isAuthenticated'](),controller[_0xae7b('0xf')]);router[_0xae7b('0xe')](_0xae7b('0x10'),auth[_0xae7b('0x7')](),controller[_0xae7b('0x11')]);router['put']('/:id',auth[_0xae7b('0x7')](),controller[_0xae7b('0x12')]);router[_0xae7b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xae7b('0x14')]);module[_0xae7b('0x15')]=router; \ No newline at end of file +var _0x07ac=['index','/describe','get','/:id','show','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x07ac,0x17d));var _0xc07a=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0x07ac[_0x53c4f8];return _0x416458;};'use strict';var multer=require(_0xc07a('0x0'));var util=require(_0xc07a('0x1'));var path=require(_0xc07a('0x2'));var timeout=require(_0xc07a('0x3'));var express=require('express');var router=express[_0xc07a('0x4')]();var fs_extra=require(_0xc07a('0x5'));var auth=require(_0xc07a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc07a('0x7'));var controller=require(_0xc07a('0x8'));router['get']('/',auth[_0xc07a('0x9')](),controller[_0xc07a('0xa')]);router['get'](_0xc07a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc07a('0xc')](_0xc07a('0xd'),auth['isAuthenticated'](),controller[_0xc07a('0xe')]);router[_0xc07a('0xc')]('/:id/contacts',auth[_0xc07a('0x9')](),controller[_0xc07a('0xf')]);router[_0xc07a('0x10')]('/',auth[_0xc07a('0x9')](),controller[_0xc07a('0x11')]);router[_0xc07a('0x10')]('/:id/contacts',auth[_0xc07a('0x9')](),controller[_0xc07a('0x12')]);router[_0xc07a('0x13')](_0xc07a('0xd'),auth[_0xc07a('0x9')](),controller[_0xc07a('0x14')]);router['delete'](_0xc07a('0xd'),auth[_0xc07a('0x9')](),controller[_0xc07a('0x15')]);module[_0xc07a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d9df0a0..cc3807c 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 _0xb7e7=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7b7e('0x0'));var Sequelize=require('sequelize');module[_0x7b7e('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b7e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7b7e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7b7e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7b7e('0x2')]},'description':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b7e('0x2')]},'email':{'type':Sequelize[_0x7b7e('0x2')]},'url':{'type':Sequelize[_0x7b7e('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7b7e('0x2')]},'twitter':{'type':Sequelize[_0x7b7e('0x2')]},'skype':{'type':Sequelize[_0x7b7e('0x2')]},'teams':{'type':Sequelize[_0x7b7e('0x2')]},'viber':{'type':Sequelize[_0x7b7e('0x2')]},'line':{'type':Sequelize[_0x7b7e('0x2')]},'wechat':{'type':Sequelize[_0x7b7e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7b7e('0x4')]},'priority':{'type':Sequelize[_0x7b7e('0x4')](0x2)[_0x7b7e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':Sequelize[_0x7b7e('0x7')]},'dialTimezone':{'type':Sequelize[_0x7b7e('0x2')]},'utcOffset':{'type':Sequelize[_0x7b7e('0x4')]}}; \ No newline at end of file +var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4e98ff,_0x425e3e){var _0x3c22f1=function(_0x967d2f){while(--_0x967d2f){_0x4e98ff['push'](_0x4e98ff['shift']());}};_0x3c22f1(++_0x425e3e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d883b7b..f18b9d9 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 _0x0737=['CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','forEach','Tags','rows','catch','params','tags','columnName','displayName','analytics','findAll','alias','custom','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','utcOffset','timezones','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','find','$and','omit','format','pickBy','cf_%d','setFields','toParam','values','phone','getTags','options','setTags','ids','getHoppers','CmHopper','rawAttributes','ContactId','includeAll','getHopperHistories','nolimit','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','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','fork','File\x20uploaded\x20correctly!','pid','file','parse','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','Account','closed','closedAt','disposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingValue','subject','threadId','Interaction','findAndCountAll','all','flatten','sortBy','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','status','end','sendStatus','error','stack','name','send','index','describe','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','select','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','datetime','text','filter','isNil','Contact','isEmpty','ListId','where','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','replace','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?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','DESC','having','t.id\x20IN\x20?','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge'];(function(_0x27e41b,_0x251679){var _0x422d67=function(_0x432fe7){while(--_0x432fe7){_0x27e41b['push'](_0x27e41b['shift']());}};_0x422d67(++_0x251679);}(_0x0737,0xa3));var _0x7073=function(_0x4461fc,_0x44b291){_0x4461fc=_0x4461fc-0x0;var _0x17de46=_0x0737[_0x4461fc];return _0x17de46;};'use strict';var moment=require(_0x7073('0x0'));var BPromise=require(_0x7073('0x1'));var util=require('util');var path=require(_0x7073('0x2'));var fs=require('fs');var _=require(_0x7073('0x3'));var squel=require('squel');var Papa=require(_0x7073('0x4'));var Redis=require(_0x7073('0x5'));var qs=require(_0x7073('0x6'));var as=require(_0x7073('0x7'));var logger=require(_0x7073('0x8'))(_0x7073('0x9'));var config=require('../../config/environment');var shared=require(_0x7073('0xa'));var db=require('../../mysqldb')['db'];config[_0x7073('0xb')]=_[_0x7073('0xc')](config['redis'],{'host':_0x7073('0xd'),'port':0x18eb});var socket=require(_0x7073('0xe'))(new Redis(config[_0x7073('0xb')]));require('./cmContact.socket')[_0x7073('0xf')](socket);function respondWithResult(_0xfd266,_0x3b14bb){_0x3b14bb=_0x3b14bb||0xc8;return function(_0x53032c){if(_0x53032c){return _0xfd266['status'](_0x3b14bb)[_0x7073('0x10')](_0x53032c);}};}function respondWithFilteredResult(_0x1854ba,_0x432a50){return function(_0x2ccc6c){if(_0x2ccc6c){var _0x309b84=typeof _0x432a50['offset']===_0x7073('0x11')&&typeof _0x432a50[_0x7073('0x12')]===_0x7073('0x11');var _0x35b2db=_0x2ccc6c[_0x7073('0x13')];var _0x4a609f=_0x309b84?0x0:_0x432a50[_0x7073('0x14')];var _0x2e5902=_0x309b84?_0x2ccc6c[_0x7073('0x13')]:_0x432a50['offset']+_0x432a50[_0x7073('0x12')];var _0x2b3780;if(_0x2e5902>=_0x35b2db){_0x2e5902=_0x35b2db;_0x2b3780=0xc8;}else{_0x2b3780=0xce;}_0x1854ba['status'](_0x2b3780);return _0x1854ba[_0x7073('0x15')](_0x7073('0x16'),_0x4a609f+'-'+_0x2e5902+'/'+_0x35b2db)[_0x7073('0x10')](_0x2ccc6c);}return null;};}function saveUpdates(_0x445f8e){return function(_0x143172){if(_0x143172){return _0x143172[_0x7073('0x17')](_0x445f8e)[_0x7073('0x18')](function(_0x11ec18){return _0x11ec18;});}return null;};}function removeEntity(_0x8194b2){return function(_0x440e67){if(_0x440e67){return _0x440e67[_0x7073('0x19')]()[_0x7073('0x18')](function(){_0x8194b2[_0x7073('0x1a')](0xcc)[_0x7073('0x1b')]();});}};}function handleEntityNotFound(_0x1b0514){return function(_0x3d2782){if(!_0x3d2782){_0x1b0514[_0x7073('0x1c')](0x194);}return _0x3d2782;};}function handleError(_0x1709ad,_0x515340){_0x515340=_0x515340||0x1f4;return function(_0x3e6f03){logger[_0x7073('0x1d')](_0x3e6f03[_0x7073('0x1e')]);if(_0x3e6f03['name']){delete _0x3e6f03[_0x7073('0x1f')];}_0x1709ad[_0x7073('0x1a')](_0x515340)[_0x7073('0x20')](_0x3e6f03);};}exports[_0x7073('0x21')]=function(_0x2da7ee,_0x1ece5d){var _0xa5d77f={},_0x16714e={},_0x23e74e={'count':0x0,'rows':[]};return db['CmContact'][_0x7073('0x22')]()[_0x7073('0x18')](function(_0x3f013b){var _0x59cd86=[];for(var _0x550aad=0x0;_0x550aad0x1){_0x3baa32['or'](_0x7073('0x5d'),qs[_0x7073('0x5e')](_0x3b1a4a),null);}else{if(qs[_0x7073('0x5f')](_0x3b1a4a)){_0x3baa32['or'](_0x7073('0x60'),_0x3b1a4a+'%');_0x3baa32['or'](_0x7073('0x61'),_0x3b1a4a+'%');_0x3baa32['or'](_0x7073('0x62'),_0x3b1a4a+'%');_0x3baa32['or']('c.fax\x20LIKE\x20?',_0x3b1a4a+'%');}else if(qs[_0x7073('0x63')](_0x3b1a4a)){_0x3baa32['or']('c.email\x20LIKE\x20?',_0x3b1a4a+'%');}else{_0x3baa32['or'](_0x7073('0x64'),'%'+_0x3b1a4a+'%');_0x3baa32['or']('c.lastName\x20LIKE\x20?','%'+_0x3b1a4a+'%');_0x3baa32['or'](_0x7073('0x65'),'%'+_0x3b1a4a+'%');}}}}_0x316284[_0x7073('0x57')](_0x3baa32);_0x316284[_0x7073('0x66')](_0x7073('0x67'));var _0x187e3e={'type':db[_0x7073('0x68')]['QueryTypes'][_0x7073('0x69')],'raw':!![]};var _0x510d1e=_0x316284['clone']()['field'](_0x7073('0x67'));if(_0xa5d77f[_0x7073('0x34')]){_0xa5d77f[_0x7073('0x34')]['forEach'](function(_0x59c2c1){_0x316284[_0x7073('0x34')]('c.'+_0x59c2c1[0x0],_0x59c2c1[0x1]===_0x7073('0x6a')?![]:!![]);});}if(!_[_0x7073('0x55')](_0x158fe4)){_0x316284[_0x7073('0x6b')](_0xacb283);_0x510d1e['where'](_0x7073('0x6c'),_0x158fe4);}BPromise['resolve']()[_0x7073('0x18')](function(){if(!_0xf771e5)return;if(_0x2da7ee[_0x7073('0x6d')]['role']!==_0x7073('0x6e'))return;if(!_[_0x7073('0x6f')](_0xf771e5[_0x7073('0x46')],[_0x7073('0x37'),'User'])){return _0x2da7ee[_0x7073('0x6d')][_0x7073('0x70')]({'attributes':['id'],'raw':!![]})[_0x7073('0x18')](function(_0x2e8008){if(_[_0x7073('0x55')](_0x2e8008)){_0x510d1e[_0x7073('0x57')](_0x7073('0x71'));_0x316284[_0x7073('0x57')]('c.ListId\x20IS\x20NULL');}else{_0x510d1e[_0x7073('0x57')](_0x7073('0x58'),_[_0x7073('0x49')](_0x2e8008,'id'));_0x316284[_0x7073('0x57')](_0x7073('0x58'),_['map'](_0x2e8008,'id'));}});}})[_0x7073('0x18')](function(){if(_0x2da7ee[_0x7073('0x6d')][_0x7073('0x72')]===_0x7073('0x6e')&&!_0xf771e5&&!_0x2da7ee[_0x7073('0x2d')][_0x7073('0x56')])return[];return db[_0x7073('0x73')][_0x7073('0x2d')](_0x510d1e[_0x7073('0x74')](),_0x187e3e);})[_0x7073('0x18')](function(_0x518052){_0x23e74e[_0x7073('0x13')]=_0x518052[_0x7073('0x32')];if(_0x23e74e[_0x7073('0x13')]===0x0)return[];return db['sequelize'][_0x7073('0x2d')](_0x583379[_0x7073('0x74')](),_0x187e3e)['then'](function(_0x51ef11){_0x374ef0=_[_0x7073('0x75')](_0x51ef11,'id');_0x187e3e=_[_0x7073('0x76')](_0x187e3e,{'model':db[_0x7073('0x77')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2da7ee[_0x7073('0x2d')][_0x7073('0x30')]){_0xa5d77f[_0x7073('0x31')]['forEach'](function(_0x22b159){_0x316284[_0x7073('0x37')]('c.'+_0x22b159);});}else{_0x316284[_0x7073('0x37')]('c.id');_0x316284['field'](_0x7073('0x78'));_0x316284['field'](_0x7073('0x79'));_0x316284[_0x7073('0x37')](_0x7073('0x7a'));_0x316284[_0x7073('0x37')](_0x7073('0x7b'));_0x316284[_0x7073('0x37')](_0x7073('0x7c'));_0x316284[_0x7073('0x37')](_0x7073('0x7d'));_0x316284[_0x7073('0x37')](_0x7073('0x7e'));_0x316284['field'](_0x7073('0x7f'));_0x316284['field']('c.deletedAt');_0x316284[_0x7073('0x37')](_0x7073('0x80'));_0x316284[_0x7073('0x37')](_0x7073('0x81'),_0x7073('0x82'));}if(_0xa5d77f[_0x7073('0x12')])_0x316284[_0x7073('0x12')](_0xa5d77f['limit']);if(_0xa5d77f['offset'])_0x316284['offset'](_0xa5d77f[_0x7073('0x14')]);return db[_0x7073('0x73')][_0x7073('0x2d')](_0x316284[_0x7073('0x74')](),_0x187e3e);});})[_0x7073('0x18')](function(_0x9a3dc0){_0x9a3dc0[_0x7073('0x83')](function(_0x3649df){if(_0x3649df['TagIds']){_0x3649df[_0x7073('0x84')]=[];_0x3649df[_0x7073('0x82')][_0x7073('0x48')](',')['forEach'](function(_0x382e9b){_0x3649df[_0x7073('0x84')]['push'](_0x374ef0[_0x382e9b]);});}delete _0x3649df[_0x7073('0x82')];});_0x23e74e[_0x7073('0x85')]=_0x9a3dc0;return _0x23e74e;})[_0x7073('0x18')](respondWithFilteredResult(_0x1ece5d,_0xa5d77f));})[_0x7073('0x86')](handleError(_0x1ece5d,null));};exports[_0x7073('0x19')]=function(_0x3592e8,_0x1d1291){return db['CmContact']['find']({'where':{'id':_0x3592e8[_0x7073('0x87')]['id']}})[_0x7073('0x18')](handleEntityNotFound(_0x1d1291,null))[_0x7073('0x18')](removeEntity(_0x1d1291,null))[_0x7073('0x86')](handleError(_0x1d1291,null));};exports[_0x7073('0x22')]=function(_0x1745a2,_0x3bab0c){return db[_0x7073('0x77')][_0x7073('0x22')]()[_0x7073('0x18')](function(_0x5594f5){delete _0x5594f5[_0x7073('0x88')];for(var _0x5200ee=0x0;_0x5200ee=_0x8aabd6){_0x513330=_0x8aabd6;_0x1fba1a=0xc8;}else{_0x1fba1a=0xce;}_0x5d0b6e['status'](_0x1fba1a);return _0x5d0b6e['set'](_0x2afc('0x13'),_0x25c628+'-'+_0x513330+'/'+_0x8aabd6)[_0x2afc('0xf')](_0x46abcd);}return null;};}function saveUpdates(_0x56a7b3){return function(_0xa3c99a){if(_0xa3c99a){return _0xa3c99a['update'](_0x56a7b3)['then'](function(_0x5938e7){return _0x5938e7;});}return null;};}function removeEntity(_0x2bb0cb){return function(_0x10157e){if(_0x10157e){return _0x10157e[_0x2afc('0x14')]()[_0x2afc('0x15')](function(){_0x2bb0cb[_0x2afc('0xe')](0xcc)[_0x2afc('0x16')]();});}};}function handleEntityNotFound(_0x138767){return function(_0x14915a){if(!_0x14915a){_0x138767[_0x2afc('0x17')](0x194);}return _0x14915a;};}function handleError(_0x376618,_0xee7f71){_0xee7f71=_0xee7f71||0x1f4;return function(_0x4dabbd){logger[_0x2afc('0x18')](_0x4dabbd[_0x2afc('0x19')]);if(_0x4dabbd['name']){delete _0x4dabbd[_0x2afc('0x1a')];}_0x376618['status'](_0xee7f71)['send'](_0x4dabbd);};}exports['index']=function(_0x15868d,_0x428344){var _0x119864={},_0x63a229={},_0x194521={'count':0x0,'rows':[]};return db[_0x2afc('0x1b')][_0x2afc('0x1c')]()[_0x2afc('0x15')](function(_0x2a1cde){var _0x300aba=[];for(var _0x1667fd=0x0;_0x1667fd0x1){_0x2761e2['or'](_0x2afc('0x5d'),qs[_0x2afc('0x5e')](_0x466aa7),null);}else{if(qs[_0x2afc('0x5f')](_0x466aa7)){_0x2761e2['or']('c.id\x20LIKE\x20?',_0x466aa7+'%');_0x2761e2['or'](_0x2afc('0x60'),_0x466aa7+'%');_0x2761e2['or'](_0x2afc('0x61'),_0x466aa7+'%');_0x2761e2['or']('c.fax\x20LIKE\x20?',_0x466aa7+'%');}else if(qs[_0x2afc('0x62')](_0x466aa7)){_0x2761e2['or'](_0x2afc('0x63'),_0x466aa7+'%');}else{_0x2761e2['or'](_0x2afc('0x64'),'%'+_0x466aa7+'%');_0x2761e2['or']('c.lastName\x20LIKE\x20?','%'+_0x466aa7+'%');_0x2761e2['or'](_0x2afc('0x63'),'%'+_0x466aa7+'%');}}}}_0x45879d[_0x2afc('0x30')](_0x2761e2);_0x45879d['group'](_0x2afc('0x65'));var _0x268880={'type':db[_0x2afc('0x66')]['QueryTypes'][_0x2afc('0x67')],'raw':!![]};var _0x2ed3d2=_0x45879d[_0x2afc('0x68')]()[_0x2afc('0x34')](_0x2afc('0x65'));if(_0x119864[_0x2afc('0x2e')]){_0x119864[_0x2afc('0x2e')][_0x2afc('0x46')](function(_0x1733d6){_0x45879d[_0x2afc('0x2e')]('c.'+_0x1733d6[0x0],_0x1733d6[0x1]===_0x2afc('0x69')?![]:!![]);});}if(!_[_0x2afc('0x6a')](_0x1eb404)){_0x45879d[_0x2afc('0x6b')](_0x349bbe);_0x2ed3d2[_0x2afc('0x30')](_0x2afc('0x6c'),_0x1eb404);}BPromise[_0x2afc('0x6d')]()[_0x2afc('0x15')](function(){if(!_0x2bc302)return;if(_0x15868d[_0x2afc('0x6e')][_0x2afc('0x6f')]!==_0x2afc('0x70'))return;if(!_['some'](_0x2bc302[_0x2afc('0x42')],[_0x2afc('0x34'),'User'])){return _0x15868d[_0x2afc('0x6e')][_0x2afc('0x71')]({'attributes':['id'],'raw':!![]})[_0x2afc('0x15')](function(_0x27f3f5){if(_['isEmpty'](_0x27f3f5)){_0x2ed3d2[_0x2afc('0x30')](_0x2afc('0x72'));_0x45879d[_0x2afc('0x30')](_0x2afc('0x72'));}else{_0x2ed3d2[_0x2afc('0x30')](_0x2afc('0x56'),_[_0x2afc('0x45')](_0x27f3f5,'id'));_0x45879d[_0x2afc('0x30')](_0x2afc('0x56'),_['map'](_0x27f3f5,'id'));}});}})[_0x2afc('0x15')](function(){if(_0x15868d['user']['role']==='agent'&&!_0x2bc302&&!_0x15868d['query']['ListId'])return[];return db['sequelize']['query'](_0x2ed3d2[_0x2afc('0x73')](),_0x268880);})['then'](function(_0x453878){_0x194521[_0x2afc('0x74')]=_0x453878[_0x2afc('0x1d')];if(_0x194521['count']===0x0)return[];return db[_0x2afc('0x75')][_0x2afc('0x27')](_0x1e0edb[_0x2afc('0x73')](),_0x268880)[_0x2afc('0x15')](function(_0x320ba7){_0x31abf1=_[_0x2afc('0x76')](_0x320ba7,'id');_0x268880=_[_0x2afc('0x77')](_0x268880,{'model':db[_0x2afc('0x1b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15868d['query']['fields']){_0x119864[_0x2afc('0x2b')][_0x2afc('0x46')](function(_0x174356){_0x45879d[_0x2afc('0x34')]('c.'+_0x174356);});}else{_0x45879d[_0x2afc('0x34')]('c.id');_0x45879d[_0x2afc('0x34')](_0x2afc('0x78'));_0x45879d['field'](_0x2afc('0x79'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x7a'));_0x45879d[_0x2afc('0x34')]('c.mobile');_0x45879d[_0x2afc('0x34')](_0x2afc('0x7b'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x7c'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x7d'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x7e'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x7f'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x80'));_0x45879d[_0x2afc('0x34')](_0x2afc('0x81'),'TagIds');}if(_0x119864[_0x2afc('0x12')])_0x45879d[_0x2afc('0x12')](_0x119864[_0x2afc('0x12')]);if(_0x119864[_0x2afc('0x10')])_0x45879d[_0x2afc('0x10')](_0x119864[_0x2afc('0x10')]);return db[_0x2afc('0x75')]['query'](_0x45879d[_0x2afc('0x73')](),_0x268880);});})[_0x2afc('0x15')](function(_0x615ce3){_0x615ce3['forEach'](function(_0x5f8099){if(_0x5f8099[_0x2afc('0x82')]){_0x5f8099[_0x2afc('0x83')]=[];_0x5f8099['TagIds'][_0x2afc('0x5c')](',')[_0x2afc('0x46')](function(_0x3fd0c4){_0x5f8099[_0x2afc('0x83')]['push'](_0x31abf1[_0x3fd0c4]);});}delete _0x5f8099['TagIds'];});_0x194521[_0x2afc('0x84')]=_0x615ce3;return _0x194521;})[_0x2afc('0x15')](respondWithFilteredResult(_0x428344,_0x119864));})[_0x2afc('0x85')](handleError(_0x428344,null));};exports['destroy']=function(_0x33ab9f,_0x4905cd){return db[_0x2afc('0x1b')][_0x2afc('0x43')]({'where':{'id':_0x33ab9f[_0x2afc('0x86')]['id']}})['then'](handleEntityNotFound(_0x4905cd,null))[_0x2afc('0x15')](removeEntity(_0x4905cd,null))['catch'](handleError(_0x4905cd,null));};exports[_0x2afc('0x1c')]=function(_0x32f4e3,_0x4f14b){return db[_0x2afc('0x1b')][_0x2afc('0x1c')]()[_0x2afc('0x15')](function(_0x3c5546){delete _0x3c5546['tags'];for(var _0x7e7ed9=0x0;_0x7e7ed9{}\s\\|]/g,'-');_0x92d21d(null,util[_0x65d7('0x26')]('%s-%s%s',path['basename'](_0x49bd5a['originalname'],path[_0x65d7('0x27')](_0x49bd5a['originalname'])),Date[_0x65d7('0x28')](),path[_0x65d7('0x27')](_0x49bd5a[_0x65d7('0x24')])));}})});router[_0x65d7('0x1b')](_0x65d7('0x29'),upload[_0x65d7('0x2a')]('file'),controller[_0x65d7('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e2e43,_0x336134,_0x3b163c){_0x3b163c(null,path[_0x65d7('0x22')](config[_0x65d7('0x23')],_0x65d7('0x2c')));},'filename':function(_0xc038fc,_0x1db31d,_0x5cb488){_0x1db31d[_0x65d7('0x24')]=_0x1db31d['originalname'][_0x65d7('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cb488(null,util[_0x65d7('0x26')](_0x65d7('0x2d'),path[_0x65d7('0x2e')](_0x1db31d[_0x65d7('0x24')],path['extname'](_0x1db31d[_0x65d7('0x24')])),Date[_0x65d7('0x28')](),path[_0x65d7('0x27')](_0x1db31d[_0x65d7('0x24')])));}})});router[_0x65d7('0x1b')](_0x65d7('0x2f'),upload[_0x65d7('0x2a')](_0x65d7('0x30')),controller[_0x65d7('0x31')]);router[_0x65d7('0x1b')](_0x65d7('0x32'),auth[_0x65d7('0xd')](),controller[_0x65d7('0x33')]);router[_0x65d7('0x34')](_0x65d7('0xf'),auth[_0x65d7('0xd')](),controller[_0x65d7('0x35')]);router[_0x65d7('0x36')](_0x65d7('0xf'),auth[_0x65d7('0xd')](),controller[_0x65d7('0x37')]);module[_0x65d7('0x38')]=router; \ No newline at end of file +var _0xf3aa=['delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','create','bulkCreate','setTags','join','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','diskStorage','root','upload','update'];(function(_0x14102c,_0x1cb214){var _0x13297b=function(_0x1f4372){while(--_0x1f4372){_0x14102c['push'](_0x14102c['shift']());}};_0x13297b(++_0x1cb214);}(_0xf3aa,0x1a8));var _0xaf3a=function(_0x4abf13,_0x28742a){_0x4abf13=_0x4abf13-0x0;var _0x27b0e5=_0xf3aa[_0x4abf13];return _0x27b0e5;};'use strict';var multer=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var path=require(_0xaf3a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf3a('0x3')]();var fs_extra=require(_0xaf3a('0x4'));var auth=require(_0xaf3a('0x5'));var interaction=require(_0xaf3a('0x6'));var config=require(_0xaf3a('0x7'));var controller=require('./cmContact.controller');router[_0xaf3a('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf3a('0x9')]);router['get'](_0xaf3a('0xa'),auth[_0xaf3a('0xb')](),controller[_0xaf3a('0xc')]);router[_0xaf3a('0x8')](_0xaf3a('0xd'),auth[_0xaf3a('0xb')](),controller['show']);router[_0xaf3a('0x8')](_0xaf3a('0xe'),auth['isAuthenticated'](),controller[_0xaf3a('0xf')]);router[_0xaf3a('0x8')](_0xaf3a('0x10'),auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x11')]);router[_0xaf3a('0x8')](_0xaf3a('0x12'),auth['isAuthenticated'](),controller[_0xaf3a('0x13')]);router[_0xaf3a('0x8')]('/:id/hopper_finals',auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x14')]);router[_0xaf3a('0x8')](_0xaf3a('0x15'),auth[_0xaf3a('0xb')](),controller['getJscriptySessions']);router[_0xaf3a('0x8')](_0xaf3a('0x16'),auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x17')]);router[_0xaf3a('0x18')](_0xaf3a('0x19'),auth[_0xaf3a('0xb')](),controller['merge']);router[_0xaf3a('0x18')]('/',auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x1a')]);router['post']('/create_many',auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x1b')]);router[_0xaf3a('0x18')](_0xaf3a('0xe'),auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9da606,_0x26fb46,_0x1c6356){_0x1c6356(null,path[_0xaf3a('0x1d')](config['root'],_0xaf3a('0x1e')));},'filename':function(_0x29e6d0,_0x554be8,_0x45b6be){_0x554be8['originalname']=_0x554be8[_0xaf3a('0x1f')][_0xaf3a('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45b6be(null,util[_0xaf3a('0x21')](_0xaf3a('0x22'),path[_0xaf3a('0x23')](_0x554be8[_0xaf3a('0x1f')],path[_0xaf3a('0x24')](_0x554be8[_0xaf3a('0x1f')])),Date[_0xaf3a('0x25')](),path[_0xaf3a('0x24')](_0x554be8[_0xaf3a('0x1f')])));}})});router[_0xaf3a('0x18')](_0xaf3a('0x26'),upload[_0xaf3a('0x27')](_0xaf3a('0x28')),controller[_0xaf3a('0x29')]);var upload=multer({'storage':multer[_0xaf3a('0x2a')]({'destination':function(_0x5137fd,_0x435cc7,_0x3316f6){_0x3316f6(null,path['join'](config[_0xaf3a('0x2b')],_0xaf3a('0x1e')));},'filename':function(_0x4e119d,_0xa28a5c,_0x3d5898){_0xa28a5c[_0xaf3a('0x1f')]=_0xa28a5c[_0xaf3a('0x1f')][_0xaf3a('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d5898(null,util['format'](_0xaf3a('0x22'),path['basename'](_0xa28a5c['originalname'],path[_0xaf3a('0x24')](_0xa28a5c[_0xaf3a('0x1f')])),Date[_0xaf3a('0x25')](),path[_0xaf3a('0x24')](_0xa28a5c[_0xaf3a('0x1f')])));}})});router[_0xaf3a('0x18')]('/upload',upload['single'](_0xaf3a('0x28')),controller[_0xaf3a('0x2c')]);router[_0xaf3a('0x18')]('/upload/:id',auth[_0xaf3a('0xb')](),controller['import']);router['put']('/:id',auth[_0xaf3a('0xb')](),controller[_0xaf3a('0x2d')]);router[_0xaf3a('0x2e')](_0xaf3a('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 77eefd1..1ada0a5 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 _0x0ac6=['sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice'];(function(_0x4560c7,_0x3d10f0){var _0x48bf7d=function(_0x486c50){while(--_0x486c50){_0x4560c7['push'](_0x4560c7['shift']());}};_0x48bf7d(++_0x3d10f0);}(_0x0ac6,0x17a));var _0x60ac=function(_0xd57a40,_0x501ead){_0xd57a40=_0xd57a40-0x0;var _0x1848ea=_0x0ac6[_0xd57a40];return _0x1848ea;};'use strict';var Sequelize=require(_0x60ac('0x0'));var _=require(_0x60ac('0x1'));module[_0x60ac('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f8d0b){return this[_0x60ac('0x3')](_0x60ac('0x4'));}},'alias':{'type':Sequelize[_0x60ac('0x5')],'allowNull':![],'set':function(_0x484e49){this[_0x60ac('0x6')](_0x60ac('0x4'),_0x484e49?_0x484e49:this[_0x60ac('0x3')]('name'));}},'type':{'type':Sequelize[_0x60ac('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x60ac('0x7')](_0x60ac('0x8')),'get':function(){if(this[_0x60ac('0x3')](_0x60ac('0x9'))===_0x60ac('0xa')){return JSON[_0x60ac('0xb')](this[_0x60ac('0x3')]('values'));}else{return this[_0x60ac('0x3')](_0x60ac('0xc'));}},'set':function(_0x444217){if(Array[_0x60ac('0xd')](_0x444217)){this[_0x60ac('0x6')]('values',JSON[_0x60ac('0xe')](_0x444217));}else{this[_0x60ac('0x6')](_0x60ac('0xc'),_0x444217);}}},'required':{'type':Sequelize[_0x60ac('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x60ac('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x60ac('0x10')](_0x60ac('0x11'))}}; \ No newline at end of file +var _0xeff2=['stringify','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias','name','STRING','TEXT','long','select','isArray'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xeff2,0x165));var _0x2eff=function(_0x3884d3,_0x598547){_0x3884d3=_0x3884d3-0x0;var _0x368b88=_0xeff2[_0x3884d3];return _0x368b88;};'use strict';var Sequelize=require(_0x2eff('0x0'));var _=require(_0x2eff('0x1'));module[_0x2eff('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xdda175){return this[_0x2eff('0x3')](_0x2eff('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3af351){this['setDataValue'](_0x2eff('0x4'),_0x3af351?_0x3af351:this['getDataValue'](_0x2eff('0x5')));}},'type':{'type':Sequelize[_0x2eff('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x2eff('0x7')](_0x2eff('0x8')),'get':function(){if(this[_0x2eff('0x3')]('type')===_0x2eff('0x9')){return JSON['parse'](this[_0x2eff('0x3')]('values'));}else{return this[_0x2eff('0x3')]('values');}},'set':function(_0x419416){if(Array[_0x2eff('0xa')](_0x419416)){this['setDataValue']('values',JSON[_0x2eff('0xb')](_0x419416));}else{this['setDataValue'](_0x2eff('0xc'),_0x419416);}}},'required':{'type':Sequelize[_0x2eff('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2eff('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2eff('0xe')](_0x2eff('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8f8c6f0..fcaa3c3 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 _0x2db3=['body','create','sequelize','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','fieldName','type','key','differenceBy','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','options','find'];(function(_0x1129fe,_0x173e56){var _0x208d09=function(_0x171aeb){while(--_0x171aeb){_0x1129fe['push'](_0x1129fe['shift']());}};_0x208d09(++_0x173e56);}(_0x2db3,0x116));var _0x32db=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x2db3[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32db('0x0'));var zipdir=require(_0x32db('0x1'));var jsonpatch=require(_0x32db('0x2'));var rp=require('request-promise');var moment=require(_0x32db('0x3'));var BPromise=require(_0x32db('0x4'));var Mustache=require('mustache');var util=require(_0x32db('0x5'));var path=require(_0x32db('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x32db('0x7'));var fs=require('fs');var fs_extra=require(_0x32db('0x8'));var _=require(_0x32db('0x9'));var squel=require(_0x32db('0xa'));var crypto=require(_0x32db('0xb'));var jsforce=require(_0x32db('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x32db('0xd'));var Papa=require(_0x32db('0xe'));var Redis=require(_0x32db('0xf'));var authService=require(_0x32db('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x32db('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32db('0x12'))(_0x32db('0x13'));var utils=require(_0x32db('0x14'));var config=require(_0x32db('0x15'));var licenseUtil=require(_0x32db('0x16'));var db=require(_0x32db('0x17'))['db'];function respondWithStatusCode(_0x36c3cf,_0x3fbe09){_0x3fbe09=_0x3fbe09||0xcc;return function(_0x1e8426){if(_0x1e8426){return _0x36c3cf[_0x32db('0x18')](_0x3fbe09);}return _0x36c3cf['status'](_0x3fbe09)[_0x32db('0x19')]();};}function respondWithResult(_0x3dd341,_0x9d04b3){_0x9d04b3=_0x9d04b3||0xc8;return function(_0x102f48){if(_0x102f48){return _0x3dd341[_0x32db('0x1a')](_0x9d04b3)[_0x32db('0x1b')](_0x102f48);}};}function respondWithFilteredResult(_0x159048,_0x510a2a){return function(_0x492437){if(_0x492437){var _0x3d9afd=typeof _0x510a2a['offset']==='undefined'&&typeof _0x510a2a[_0x32db('0x1c')]===_0x32db('0x1d');var _0x2f0f02=_0x492437[_0x32db('0x1e')];var _0x398d88=_0x3d9afd?0x0:_0x510a2a[_0x32db('0x1f')];var _0x51b751=_0x3d9afd?_0x492437['count']:_0x510a2a['offset']+_0x510a2a[_0x32db('0x1c')];var _0x5b30a4;if(_0x51b751>=_0x2f0f02){_0x51b751=_0x2f0f02;_0x5b30a4=0xc8;}else{_0x5b30a4=0xce;}_0x159048['status'](_0x5b30a4);return _0x159048['set'](_0x32db('0x20'),_0x398d88+'-'+_0x51b751+'/'+_0x2f0f02)['json'](_0x492437);}return null;};}function patchUpdates(_0x125005){return function(_0x5b9ecf){try{jsonpatch[_0x32db('0x21')](_0x5b9ecf,_0x125005,!![]);}catch(_0xdf1d36){return BPromise[_0x32db('0x22')](_0xdf1d36);}return _0x5b9ecf[_0x32db('0x23')]();};}function saveUpdates(_0x2076e6,_0x788611){return function(_0x3848d2){if(_0x3848d2){return _0x3848d2[_0x32db('0x24')](_0x2076e6)[_0x32db('0x25')](function(_0x4be360){return _0x4be360;});}return null;};}function removeEntity(_0x237b61,_0x1b3930){return function(_0x4c6a16){if(_0x4c6a16){return _0x4c6a16[_0x32db('0x26')]()[_0x32db('0x25')](function(){_0x237b61[_0x32db('0x1a')](0xcc)[_0x32db('0x19')]();});}};}function handleEntityNotFound(_0x54814d,_0x411045){return function(_0x20e35c){if(!_0x20e35c){_0x54814d[_0x32db('0x18')](0x194);}return _0x20e35c;};}function handleError(_0x491eab,_0x5d6833){_0x5d6833=_0x5d6833||0x1f4;return function(_0x3b225c){logger[_0x32db('0x27')](_0x3b225c[_0x32db('0x28')]);if(_0x3b225c[_0x32db('0x29')]){delete _0x3b225c[_0x32db('0x29')];}_0x491eab[_0x32db('0x1a')](_0x5d6833)['send'](_0x3b225c);};}exports[_0x32db('0x2a')]=function(_0x1b6af1,_0x5d2062){var _0xa75324={},_0x516855={},_0x216fd0={'count':0x0,'rows':[]};var _0x37ba2b=_[_0x32db('0x2b')](db[_0x32db('0x2c')]['rawAttributes'],function(_0x4cb52d){return{'name':_0x4cb52d[_0x32db('0x2d')],'type':_0x4cb52d[_0x32db('0x2e')][_0x32db('0x2f')]};});_0x516855['model']=_[_0x32db('0x30')](_['map'](_0x37ba2b,_0x32db('0x29')),[_0x32db('0x29')]);_0x516855[_0x32db('0x31')]=_['keys'](_0x1b6af1['query']);_0x516855[_0x32db('0x32')]=_['intersection'](_0x516855[_0x32db('0x33')],_0x516855[_0x32db('0x31')]);_0xa75324[_0x32db('0x34')]=_[_0x32db('0x35')](_0x516855[_0x32db('0x33')],qs[_0x32db('0x36')](_0x1b6af1[_0x32db('0x31')][_0x32db('0x36')]));_0xa75324[_0x32db('0x34')]=_0xa75324[_0x32db('0x34')]['length']?_0xa75324[_0x32db('0x34')]:_0x516855[_0x32db('0x33')];if(!_0x1b6af1[_0x32db('0x31')][_0x32db('0x37')]('nolimit')){_0xa75324[_0x32db('0x1c')]=qs[_0x32db('0x1c')](_0x1b6af1[_0x32db('0x31')]['limit']);_0xa75324['offset']=qs[_0x32db('0x1f')](_0x1b6af1[_0x32db('0x31')][_0x32db('0x1f')]);}_0xa75324[_0x32db('0x38')]=qs[_0x32db('0x39')](_0x1b6af1[_0x32db('0x31')][_0x32db('0x39')]);_0xa75324[_0x32db('0x3a')]=qs['filters'](_[_0x32db('0x3b')](_0x1b6af1[_0x32db('0x31')],_0x516855[_0x32db('0x32')]),_0x37ba2b);if(_0x1b6af1[_0x32db('0x31')][_0x32db('0x3c')]){_0xa75324['where']=_['merge'](_0xa75324[_0x32db('0x3a')],{'$or':_[_0x32db('0x2b')](_0x37ba2b,function(_0x1ad59c){if(_0x1ad59c[_0x32db('0x2e')]!==_0x32db('0x3d')){var _0x50773e={};_0x50773e[_0x1ad59c[_0x32db('0x29')]]={'$like':'%'+_0x1b6af1[_0x32db('0x31')]['filter']+'%'};return _0x50773e;}})});}_0xa75324=_[_0x32db('0x3e')]({},_0xa75324,_0x1b6af1['options']);var _0x1a0368={'where':_0xa75324[_0x32db('0x3a')]};return db['CmCustomField'][_0x32db('0x1e')](_0x1a0368)[_0x32db('0x25')](function(_0x127c97){_0x216fd0[_0x32db('0x1e')]=_0x127c97;if(_0x1b6af1[_0x32db('0x31')][_0x32db('0x3f')]){_0xa75324[_0x32db('0x40')]=[{'all':!![]}];}return db[_0x32db('0x2c')][_0x32db('0x41')](_0xa75324);})[_0x32db('0x25')](function(_0x4a7ea8){_0x216fd0['rows']=_0x4a7ea8;return _0x216fd0;})[_0x32db('0x25')](respondWithFilteredResult(_0x5d2062,_0xa75324))[_0x32db('0x42')](handleError(_0x5d2062,null));};exports[_0x32db('0x43')]=function(_0x557af3,_0x95d9b6){var _0x1d5fb4={'raw':!![],'where':{'id':_0x557af3[_0x32db('0x44')]['id']}},_0x2846eb={};_0x2846eb[_0x32db('0x33')]=_[_0x32db('0x45')](db[_0x32db('0x2c')][_0x32db('0x46')]);_0x2846eb[_0x32db('0x31')]=_[_0x32db('0x45')](_0x557af3[_0x32db('0x31')]);_0x2846eb[_0x32db('0x32')]=_[_0x32db('0x35')](_0x2846eb[_0x32db('0x33')],_0x2846eb[_0x32db('0x31')]);_0x1d5fb4[_0x32db('0x34')]=_[_0x32db('0x35')](_0x2846eb[_0x32db('0x33')],qs['fields'](_0x557af3[_0x32db('0x31')]['fields']));_0x1d5fb4['attributes']=_0x1d5fb4[_0x32db('0x34')][_0x32db('0x47')]?_0x1d5fb4[_0x32db('0x34')]:_0x2846eb[_0x32db('0x33')];if(_0x557af3['query'][_0x32db('0x3f')]){_0x1d5fb4[_0x32db('0x40')]=[{'all':!![]}];}_0x1d5fb4=_['merge']({},_0x1d5fb4,_0x557af3[_0x32db('0x48')]);return db[_0x32db('0x2c')][_0x32db('0x49')](_0x1d5fb4)[_0x32db('0x25')](handleEntityNotFound(_0x95d9b6,null))[_0x32db('0x25')](respondWithResult(_0x95d9b6,null))[_0x32db('0x42')](handleError(_0x95d9b6,null));};exports['update']=function(_0x3c7a7e,_0x4f7911){if(_0x3c7a7e[_0x32db('0x4a')]['id']){delete _0x3c7a7e['body']['id'];}return db[_0x32db('0x2c')][_0x32db('0x49')]({'where':{'id':_0x3c7a7e[_0x32db('0x44')]['id']}})[_0x32db('0x25')](handleEntityNotFound(_0x4f7911,null))[_0x32db('0x25')](saveUpdates(_0x3c7a7e['body'],null))['then'](respondWithResult(_0x4f7911,null))[_0x32db('0x42')](handleError(_0x4f7911,null));};exports['destroy']=function(_0x2fc230,_0xb09c91){return db[_0x32db('0x2c')][_0x32db('0x49')]({'where':{'id':_0x2fc230[_0x32db('0x44')]['id']}})[_0x32db('0x25')](handleEntityNotFound(_0xb09c91,null))[_0x32db('0x25')](removeEntity(_0xb09c91,null))['catch'](handleError(_0xb09c91,null));};exports[_0x32db('0x4b')]=function(_0x5246fb,_0x1e608e){var _0x205e7e;return db[_0x32db('0x4c')]['transaction'](function(_0x3f1d63){return db[_0x32db('0x2c')][_0x32db('0x4b')](_0x5246fb['body'],{'transaction':_0x3f1d63})[_0x32db('0x25')](function(_0x4cb3fa){_0x205e7e=_0x4cb3fa;var _0x178148={'type':db['Sequelize'][_0x32db('0x4d')],'transaction':_0x3f1d63};switch(_0x5246fb[_0x32db('0x4a')]['type']){case _0x32db('0x4e'):_0x178148[_0x32db('0x2e')]=db[_0x32db('0x4f')][_0x32db('0x4d')];break;case _0x32db('0x50'):_0x178148['type']=db[_0x32db('0x4f')][_0x32db('0x51')];break;case'switch':_0x178148[_0x32db('0x2e')]=db['Sequelize'][_0x32db('0x52')];_0x178148['defaultValue']=![];break;default:}return db[_0x32db('0x4c')][_0x32db('0x53')][_0x32db('0x54')](_0x32db('0x55'),util[_0x32db('0x56')](_0x32db('0x57'),_0x205e7e['id']),_0x178148);})[_0x32db('0x25')](function(){return _0x205e7e;});})['then'](respondWithResult(_0x1e608e,0xc9))['catch'](handleError(_0x1e608e,null));}; \ No newline at end of file +var _0x67fd=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','json','reject','save','update','destroy','then','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x67fd,0xa7));var _0xd67f=function(_0x219548,_0x56e060){_0x219548=_0x219548-0x0;var _0x5df8a0=_0x67fd[_0x219548];return _0x5df8a0;};'use strict';var emlformat=require(_0xd67f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd67f('0x1'));var jsonpatch=require(_0xd67f('0x2'));var rp=require('request-promise');var moment=require(_0xd67f('0x3'));var BPromise=require(_0xd67f('0x4'));var Mustache=require(_0xd67f('0x5'));var util=require(_0xd67f('0x6'));var path=require('path');var sox=require(_0xd67f('0x7'));var csv=require(_0xd67f('0x8'));var ejs=require(_0xd67f('0x9'));var fs=require('fs');var fs_extra=require(_0xd67f('0xa'));var _=require(_0xd67f('0xb'));var squel=require('squel');var crypto=require(_0xd67f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd67f('0xd'));var toCsv=require(_0xd67f('0x8'));var querystring=require(_0xd67f('0xe'));var Papa=require(_0xd67f('0xf'));var Redis=require('ioredis');var authService=require(_0xd67f('0x10'));var qs=require(_0xd67f('0x11'));var as=require(_0xd67f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd67f('0x13'))(_0xd67f('0x14'));var utils=require(_0xd67f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd67f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x524076,_0x579e72){_0x579e72=_0x579e72||0xcc;return function(_0x46fa37){if(_0x46fa37){return _0x524076[_0xd67f('0x17')](_0x579e72);}return _0x524076[_0xd67f('0x18')](_0x579e72)[_0xd67f('0x19')]();};}function respondWithResult(_0xd8eb60,_0x130f80){_0x130f80=_0x130f80||0xc8;return function(_0x4bc03b){if(_0x4bc03b){return _0xd8eb60[_0xd67f('0x18')](_0x130f80)['json'](_0x4bc03b);}};}function respondWithFilteredResult(_0x5cf4b0,_0x488bae){return function(_0x3bbdf4){if(_0x3bbdf4){var _0x32a4e6=typeof _0x488bae['offset']==='undefined'&&typeof _0x488bae['limit']===_0xd67f('0x1a');var _0x3da172=_0x3bbdf4[_0xd67f('0x1b')];var _0x435415=_0x32a4e6?0x0:_0x488bae[_0xd67f('0x1c')];var _0x4e0d53=_0x32a4e6?_0x3bbdf4['count']:_0x488bae['offset']+_0x488bae[_0xd67f('0x1d')];var _0x55f794;if(_0x4e0d53>=_0x3da172){_0x4e0d53=_0x3da172;_0x55f794=0xc8;}else{_0x55f794=0xce;}_0x5cf4b0['status'](_0x55f794);return _0x5cf4b0[_0xd67f('0x1e')]('Content-Range',_0x435415+'-'+_0x4e0d53+'/'+_0x3da172)[_0xd67f('0x1f')](_0x3bbdf4);}return null;};}function patchUpdates(_0x2c6ad3){return function(_0x43a1e3){try{jsonpatch['apply'](_0x43a1e3,_0x2c6ad3,!![]);}catch(_0x1f9491){return BPromise[_0xd67f('0x20')](_0x1f9491);}return _0x43a1e3[_0xd67f('0x21')]();};}function saveUpdates(_0x35c1a0,_0x59603a){return function(_0x306030){if(_0x306030){return _0x306030[_0xd67f('0x22')](_0x35c1a0)['then'](function(_0x5f2af6){return _0x5f2af6;});}return null;};}function removeEntity(_0x82778a,_0x40404f){return function(_0x22b460){if(_0x22b460){return _0x22b460[_0xd67f('0x23')]()[_0xd67f('0x24')](function(){_0x82778a['status'](0xcc)[_0xd67f('0x19')]();});}};}function handleEntityNotFound(_0x36e996,_0x1f2154){return function(_0x64ec2b){if(!_0x64ec2b){_0x36e996[_0xd67f('0x17')](0x194);}return _0x64ec2b;};}function handleError(_0x37d0fa,_0x6690e4){_0x6690e4=_0x6690e4||0x1f4;return function(_0x51eccb){logger[_0xd67f('0x25')](_0x51eccb['stack']);if(_0x51eccb[_0xd67f('0x26')]){delete _0x51eccb[_0xd67f('0x26')];}_0x37d0fa['status'](_0x6690e4)[_0xd67f('0x27')](_0x51eccb);};}exports[_0xd67f('0x28')]=function(_0x14e306,_0x43651c){var _0x182f2d={},_0x42b173={},_0x35a8e5={'count':0x0,'rows':[]};var _0x1862aa=_['map'](db[_0xd67f('0x29')][_0xd67f('0x2a')],function(_0x540549){return{'name':_0x540549[_0xd67f('0x2b')],'type':_0x540549[_0xd67f('0x2c')][_0xd67f('0x2d')]};});_0x42b173[_0xd67f('0x2e')]=_[_0xd67f('0x2f')](_[_0xd67f('0x30')](_0x1862aa,_0xd67f('0x26')),['name']);_0x42b173[_0xd67f('0x31')]=_['keys'](_0x14e306[_0xd67f('0x31')]);_0x42b173[_0xd67f('0x32')]=_[_0xd67f('0x33')](_0x42b173[_0xd67f('0x2e')],_0x42b173[_0xd67f('0x31')]);_0x182f2d[_0xd67f('0x34')]=_[_0xd67f('0x33')](_0x42b173[_0xd67f('0x2e')],qs[_0xd67f('0x35')](_0x14e306['query']['fields']));_0x182f2d[_0xd67f('0x34')]=_0x182f2d[_0xd67f('0x34')][_0xd67f('0x36')]?_0x182f2d[_0xd67f('0x34')]:_0x42b173['model'];if(!_0x14e306[_0xd67f('0x31')][_0xd67f('0x37')](_0xd67f('0x38'))){_0x182f2d[_0xd67f('0x1d')]=qs[_0xd67f('0x1d')](_0x14e306[_0xd67f('0x31')]['limit']);_0x182f2d[_0xd67f('0x1c')]=qs['offset'](_0x14e306['query']['offset']);}_0x182f2d[_0xd67f('0x39')]=qs[_0xd67f('0x3a')](_0x14e306['query']['sort']);_0x182f2d[_0xd67f('0x3b')]=qs['filters'](_[_0xd67f('0x3c')](_0x14e306['query'],_0x42b173['filters']),_0x1862aa);if(_0x14e306[_0xd67f('0x31')][_0xd67f('0x3d')]){_0x182f2d[_0xd67f('0x3b')]=_[_0xd67f('0x3e')](_0x182f2d[_0xd67f('0x3b')],{'$or':_[_0xd67f('0x30')](_0x1862aa,function(_0xdf2fc7){if(_0xdf2fc7[_0xd67f('0x2c')]!==_0xd67f('0x3f')){var _0x2b559c={};_0x2b559c[_0xdf2fc7[_0xd67f('0x26')]]={'$like':'%'+_0x14e306[_0xd67f('0x31')][_0xd67f('0x3d')]+'%'};return _0x2b559c;}})});}_0x182f2d=_['merge']({},_0x182f2d,_0x14e306[_0xd67f('0x40')]);var _0x2f3b7e={'where':_0x182f2d[_0xd67f('0x3b')]};return db[_0xd67f('0x29')][_0xd67f('0x1b')](_0x2f3b7e)[_0xd67f('0x24')](function(_0x14f573){_0x35a8e5[_0xd67f('0x1b')]=_0x14f573;if(_0x14e306[_0xd67f('0x31')][_0xd67f('0x41')]){_0x182f2d[_0xd67f('0x42')]=[{'all':!![]}];}return db[_0xd67f('0x29')][_0xd67f('0x43')](_0x182f2d);})[_0xd67f('0x24')](function(_0xad2a2){_0x35a8e5[_0xd67f('0x44')]=_0xad2a2;return _0x35a8e5;})[_0xd67f('0x24')](respondWithFilteredResult(_0x43651c,_0x182f2d))[_0xd67f('0x45')](handleError(_0x43651c,null));};exports[_0xd67f('0x46')]=function(_0x5e3b38,_0x23204a){var _0x5c413b={'raw':!![],'where':{'id':_0x5e3b38[_0xd67f('0x47')]['id']}},_0x289c3c={};_0x289c3c[_0xd67f('0x2e')]=_[_0xd67f('0x48')](db[_0xd67f('0x29')]['rawAttributes']);_0x289c3c['query']=_[_0xd67f('0x48')](_0x5e3b38['query']);_0x289c3c['filters']=_[_0xd67f('0x33')](_0x289c3c[_0xd67f('0x2e')],_0x289c3c[_0xd67f('0x31')]);_0x5c413b[_0xd67f('0x34')]=_['intersection'](_0x289c3c[_0xd67f('0x2e')],qs[_0xd67f('0x35')](_0x5e3b38['query'][_0xd67f('0x35')]));_0x5c413b[_0xd67f('0x34')]=_0x5c413b[_0xd67f('0x34')][_0xd67f('0x36')]?_0x5c413b[_0xd67f('0x34')]:_0x289c3c['model'];if(_0x5e3b38['query'][_0xd67f('0x41')]){_0x5c413b[_0xd67f('0x42')]=[{'all':!![]}];}_0x5c413b=_['merge']({},_0x5c413b,_0x5e3b38[_0xd67f('0x40')]);return db[_0xd67f('0x29')][_0xd67f('0x49')](_0x5c413b)[_0xd67f('0x24')](handleEntityNotFound(_0x23204a,null))[_0xd67f('0x24')](respondWithResult(_0x23204a,null))['catch'](handleError(_0x23204a,null));};exports[_0xd67f('0x22')]=function(_0x22e234,_0x4f6732){if(_0x22e234[_0xd67f('0x4a')]['id']){delete _0x22e234[_0xd67f('0x4a')]['id'];}return db[_0xd67f('0x29')][_0xd67f('0x49')]({'where':{'id':_0x22e234[_0xd67f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f6732,null))[_0xd67f('0x24')](saveUpdates(_0x22e234[_0xd67f('0x4a')],null))[_0xd67f('0x24')](respondWithResult(_0x4f6732,null))['catch'](handleError(_0x4f6732,null));};exports[_0xd67f('0x23')]=function(_0x392041,_0x484f40){return db[_0xd67f('0x29')]['find']({'where':{'id':_0x392041[_0xd67f('0x47')]['id']}})['then'](handleEntityNotFound(_0x484f40,null))[_0xd67f('0x24')](removeEntity(_0x484f40,null))[_0xd67f('0x45')](handleError(_0x484f40,null));};exports[_0xd67f('0x4b')]=function(_0x3d839a,_0x514fc6){var _0x512179;return db[_0xd67f('0x4c')]['transaction'](function(_0x58bcc3){return db[_0xd67f('0x29')]['create'](_0x3d839a[_0xd67f('0x4a')],{'transaction':_0x58bcc3})[_0xd67f('0x24')](function(_0x50a314){_0x512179=_0x50a314;var _0x311f13={'type':db[_0xd67f('0x4d')][_0xd67f('0x4e')],'transaction':_0x58bcc3};switch(_0x3d839a[_0xd67f('0x4a')]['type']){case'text':_0x311f13[_0xd67f('0x2c')]=db[_0xd67f('0x4d')][_0xd67f('0x4e')];break;case _0xd67f('0x4f'):_0x311f13[_0xd67f('0x2c')]=db[_0xd67f('0x4d')]['INTEGER'];break;case _0xd67f('0x50'):_0x311f13[_0xd67f('0x2c')]=db[_0xd67f('0x4d')][_0xd67f('0x51')];_0x311f13['defaultValue']=![];break;default:}return db[_0xd67f('0x4c')][_0xd67f('0x52')][_0xd67f('0x53')](_0xd67f('0x54'),util['format'](_0xd67f('0x55'),_0x512179['id']),_0x311f13);})['then'](function(){return _0x512179;});})[_0xd67f('0x24')](respondWithResult(_0x514fc6,0xc9))[_0xd67f('0x45')](handleError(_0x514fc6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 220cd7e..dbf2742 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 _0xd1a5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','CmCustomField','lodash'];(function(_0xb25e7a,_0x14db59){var _0x3e7253=function(_0x14b7c5){while(--_0x14b7c5){_0xb25e7a['push'](_0xb25e7a['shift']());}};_0x3e7253(++_0x14db59);}(_0xd1a5,0xbc));var _0x5d1a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd1a5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5d1a('0x0'));var util=require('util');var logger=require(_0x5d1a('0x1'))(_0x5d1a('0x2'));var moment=require(_0x5d1a('0x3'));var BPromise=require(_0x5d1a('0x4'));var rp=require(_0x5d1a('0x5'));var fs=require('fs');var path=require(_0x5d1a('0x6'));var rimraf=require(_0x5d1a('0x7'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x40fdea,_0x1416c6){return _0x40fdea['define'](_0x5d1a('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eb8=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x14d100,_0x461e55){var _0x43c18f=function(_0x23f5bd){while(--_0x23f5bd){_0x14d100['push'](_0x14d100['shift']());}};_0x43c18f(++_0x461e55);}(_0x8eb8,0x175));var _0x88eb=function(_0x1bf637,_0x31732c){_0x1bf637=_0x1bf637-0x0;var _0x5bdcfb=_0x8eb8[_0x1bf637];return _0x5bdcfb;};'use strict';var _=require(_0x88eb('0x0'));var util=require(_0x88eb('0x1'));var logger=require(_0x88eb('0x2'))(_0x88eb('0x3'));var moment=require(_0x88eb('0x4'));var BPromise=require(_0x88eb('0x5'));var rp=require(_0x88eb('0x6'));var fs=require('fs');var path=require(_0x88eb('0x7'));var rimraf=require(_0x88eb('0x8'));var config=require(_0x88eb('0x9'));var attributes=require('./cmCustomField.attributes');module[_0x88eb('0xa')]=function(_0x24b869,_0x3b47ea){return _0x24b869[_0x88eb('0xb')](_0x88eb('0xc'),attributes,{'tableName':_0x88eb('0xd'),'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 237dc22..42bad20 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 _0x930f=['request\x20sent','stringify','error','code','message','info','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x930f,0x1a8));var _0xf930=function(_0xdbf2c7,_0x1a16ec){_0xdbf2c7=_0xdbf2c7-0x0;var _0x3bb354=_0x930f[_0xdbf2c7];return _0x3bb354;};'use strict';var _=require(_0xf930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf930('0x1'));var rs=require(_0xf930('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf930('0x3'))(_0xf930('0x4'));var config=require(_0xf930('0x5'));var jayson=require(_0xf930('0x6'));var client=jayson[_0xf930('0x7')][_0xf930('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x285d22,_0x46211f,_0x334157){return new BPromise(function(_0x458540,_0x51f3d5){return client[_0xf930('0x9')](_0x285d22,_0x334157)['then'](function(_0x5bb2e8){logger['info'](_0xf930('0xa'),_0x46211f,'request\x20sent');logger[_0xf930('0xb')](_0xf930('0xc'),_0x46211f,_0xf930('0xd'),JSON[_0xf930('0xe')](_0x5bb2e8));if(_0x5bb2e8[_0xf930('0xf')]){if(_0x5bb2e8[_0xf930('0xf')][_0xf930('0x10')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x46211f,_0x5bb2e8[_0xf930('0xf')][_0xf930('0x11')]);return _0x51f3d5(_0x5bb2e8[_0xf930('0xf')][_0xf930('0x11')]);}logger[_0xf930('0xf')]('CmCustomField,\x20%s,\x20%s',_0x46211f,_0x5bb2e8[_0xf930('0xf')]['message']);return _0x458540(_0x5bb2e8[_0xf930('0xf')][_0xf930('0x11')]);}else{logger[_0xf930('0x12')](_0xf930('0xa'),_0x46211f,_0xf930('0xd'));_0x458540(_0x5bb2e8['result'][_0xf930('0x11')]);}})['catch'](function(_0x4ee2a7){logger[_0xf930('0xf')](_0xf930('0xa'),_0x46211f,_0x4ee2a7);_0x51f3d5(_0x4ee2a7);});});} \ No newline at end of file +var _0x5fcd=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fcd,0x6e));var _0xd5fc=function(_0x40ce9,_0x3fc18a){_0x40ce9=_0x40ce9-0x0;var _0x4c5b3d=_0x5fcd[_0x40ce9];return _0x4c5b3d;};'use strict';var _=require(_0xd5fc('0x0'));var util=require(_0xd5fc('0x1'));var moment=require(_0xd5fc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd5fc('0x4'))(_0xd5fc('0x5'));var config=require(_0xd5fc('0x6'));var jayson=require(_0xd5fc('0x7'));var client=jayson[_0xd5fc('0x8')][_0xd5fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x87ba76,_0x10eebe,_0x106483){return new BPromise(function(_0x28be98,_0x471533){return client[_0xd5fc('0xa')](_0x87ba76,_0x106483)[_0xd5fc('0xb')](function(_0x28a200){logger[_0xd5fc('0xc')](_0xd5fc('0xd'),_0x10eebe,_0xd5fc('0xe'));logger[_0xd5fc('0xf')](_0xd5fc('0x10'),_0x10eebe,_0xd5fc('0xe'),JSON[_0xd5fc('0x11')](_0x28a200));if(_0x28a200[_0xd5fc('0x12')]){if(_0x28a200['error'][_0xd5fc('0x13')]===0x1f4){logger[_0xd5fc('0x12')](_0xd5fc('0xd'),_0x10eebe,_0x28a200[_0xd5fc('0x12')][_0xd5fc('0x14')]);return _0x471533(_0x28a200['error'][_0xd5fc('0x14')]);}logger[_0xd5fc('0x12')](_0xd5fc('0xd'),_0x10eebe,_0x28a200[_0xd5fc('0x12')][_0xd5fc('0x14')]);return _0x28be98(_0x28a200[_0xd5fc('0x12')][_0xd5fc('0x14')]);}else{logger[_0xd5fc('0xc')]('CmCustomField,\x20%s,\x20%s',_0x10eebe,'request\x20sent');_0x28be98(_0x28a200[_0xd5fc('0x15')]['message']);}})[_0xd5fc('0x16')](function(_0x31a955){logger['error'](_0xd5fc('0xd'),_0x10eebe,_0x31a955);_0x471533(_0x31a955);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3eb8ad8..9ba118a 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 _0x7a3e=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x295dbf,_0x2a324e){var _0xcab490=function(_0x17e943){while(--_0x17e943){_0x295dbf['push'](_0x295dbf['shift']());}};_0xcab490(++_0x2a324e);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x41a89a,_0x476671){_0x41a89a=_0x41a89a-0x0;var _0x35ab71=_0x7a3e[_0x41a89a];return _0x35ab71;};'use strict';var multer=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var path=require(_0xe7a3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7a3('0x3'));var router=express[_0xe7a3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe7a3('0x5'));var config=require(_0xe7a3('0x6'));var controller=require(_0xe7a3('0x7'));router['get']('/',auth[_0xe7a3('0x8')](),controller[_0xe7a3('0x9')]);router[_0xe7a3('0xa')](_0xe7a3('0xb'),auth[_0xe7a3('0x8')](),controller['show']);router[_0xe7a3('0xc')]('/',auth[_0xe7a3('0x8')](),controller[_0xe7a3('0xd')]);router[_0xe7a3('0xe')]('/:id',auth[_0xe7a3('0x8')](),controller[_0xe7a3('0xf')]);router[_0xe7a3('0x10')](_0xe7a3('0xb'),auth[_0xe7a3('0x8')](),controller[_0xe7a3('0x11')]);module[_0xe7a3('0x12')]=router; \ No newline at end of file +var _0x35e2=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe708d6,_0x472d27){var _0x296a91=function(_0x18b41e){while(--_0x18b41e){_0xe708d6['push'](_0xe708d6['shift']());}};_0x296a91(++_0x472d27);}(_0x35e2,0x1ed));var _0x235e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x35e2[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0x235e('0x0'));var util=require('util');var path=require(_0x235e('0x1'));var timeout=require(_0x235e('0x2'));var express=require(_0x235e('0x3'));var router=express['Router']();var fs_extra=require(_0x235e('0x4'));var auth=require(_0x235e('0x5'));var interaction=require(_0x235e('0x6'));var config=require(_0x235e('0x7'));var controller=require(_0x235e('0x8'));router[_0x235e('0x9')]('/',auth[_0x235e('0xa')](),controller[_0x235e('0xb')]);router[_0x235e('0x9')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0xd')]);router[_0x235e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x235e('0xf')](_0x235e('0xc'),auth['isAuthenticated'](),controller[_0x235e('0x10')]);router[_0x235e('0x11')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0x12')]);module[_0x235e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index cb71aab..401065b 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 _0x7096=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','sequelize','STRING'];(function(_0x4e119c,_0x4fd4c0){var _0x224f8f=function(_0x3262ba){while(--_0x3262ba){_0x4e119c['push'](_0x4e119c['shift']());}};_0x224f8f(++_0x4fd4c0);}(_0x7096,0x10c));var _0x6709=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7096[_0x4baae2];return _0x1a2285;};'use strict';var moment=require('moment');var Sequelize=require(_0x6709('0x0'));module['exports']={'phone':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6709('0x2')],'defaultValue':moment()[_0x6709('0x3')](_0x6709('0x4'))},'countbusyretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6709('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6709('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6709('0x2')]},'priority':{'type':Sequelize[_0x6709('0x5')](0x2)[_0x6709('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6709('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6709('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6709('0x8')},'UserId':{'type':Sequelize[_0x6709('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x6709('0x5')],'unique':_0x6709('0x8')},'CampaignId':{'type':Sequelize[_0x6709('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6709('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6709('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6709('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x8f4c=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x44e20c,_0x9c0215){var _0x3c9736=function(_0x177e10){while(--_0x177e10){_0x44e20c['push'](_0x44e20c['shift']());}};_0x3c9736(++_0x9c0215);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5d2a5d,_0x55d114){_0x5d2a5d=_0x5d2a5d-0x0;var _0x66550d=_0x8f4c[_0x5d2a5d];return _0x66550d;};'use strict';var moment=require(_0xc8f4('0x0'));var Sequelize=require(_0xc8f4('0x1'));module[_0xc8f4('0x2')]={'phone':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc8f4('0x5')],'defaultValue':moment()['format'](_0xc8f4('0x6'))},'countbusyretry':{'type':Sequelize[_0xc8f4('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc8f4('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc8f4('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc8f4('0x7')],'unique':_0xc8f4('0x9')},'ListId':{'type':Sequelize[_0xc8f4('0x7')],'unique':_0xc8f4('0x9')},'UserId':{'type':Sequelize[_0xc8f4('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc8f4('0x9')},'CampaignId':{'type':Sequelize[_0xc8f4('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xc8f4('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc8f4('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc8f4('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc8f4('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xc8f4('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f12e42f..0e08c24 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 _0xbe45=['attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','options','then','includeAll','rows','show','params','include','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','state','statedesc','campaign','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','length','sequelize','transaction','dialPreviewAutoRecallMe','direction','hopperIds','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmList','List','Queue','dialActive','getPreviewRecall','hopperId','scheduledat','CmCompany','Company','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','getTimezone','eml-format','rimraf','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/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','sendStatus','error','stack','name','send','index','CmHopper','fieldName','key','query','keys','filters','intersection','model','concat','$and','$gte','$lt','$lte','$ne','$not','$notBetween','$notIn','$like','$notILike','$contains','$contained','$any','fields'];(function(_0x5ce131,_0x3813fc){var _0x2d4b31=function(_0x3df6ce){while(--_0x3df6ce){_0x5ce131['push'](_0x5ce131['shift']());}};_0x2d4b31(++_0x3813fc);}(_0xbe45,0xf0));var _0x5be4=function(_0x58825e,_0x460434){_0x58825e=_0x58825e-0x0;var _0x25fef4=_0xbe45[_0x58825e];return _0x25fef4;};'use strict';var emlformat=require(_0x5be4('0x0'));var rimraf=require(_0x5be4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be4('0x2'));var rp=require(_0x5be4('0x3'));var moment=require(_0x5be4('0x4'));var BPromise=require(_0x5be4('0x5'));var Mustache=require(_0x5be4('0x6'));var util=require(_0x5be4('0x7'));var path=require('path');var sox=require(_0x5be4('0x8'));var csv=require(_0x5be4('0x9'));var ejs=require(_0x5be4('0xa'));var fs=require('fs');var fs_extra=require(_0x5be4('0xb'));var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0x9'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var shared=require('../../config/environment');var licenseUtil=require(_0x5be4('0x18'));var db=require(_0x5be4('0x19'))['db'];function respondWithStatusCode(_0x1d7960,_0x5c6615){_0x5c6615=_0x5c6615||0xcc;return function(_0x349610){if(_0x349610){return _0x1d7960['sendStatus'](_0x5c6615);}return _0x1d7960[_0x5be4('0x1a')](_0x5c6615)[_0x5be4('0x1b')]();};}function respondWithResult(_0x2dd93e,_0x335842){_0x335842=_0x335842||0xc8;return function(_0x246499){if(_0x246499){return _0x2dd93e[_0x5be4('0x1a')](_0x335842)[_0x5be4('0x1c')](_0x246499);}};}function respondWithFilteredResult(_0x5ebe65,_0x3e830e){return function(_0x8466a7){if(_0x8466a7){var _0x1d7db7=typeof _0x3e830e[_0x5be4('0x1d')]===_0x5be4('0x1e')&&typeof _0x3e830e[_0x5be4('0x1f')]===_0x5be4('0x1e');var _0x2b704d=_0x8466a7['count'];var _0x175630=_0x1d7db7?0x0:_0x3e830e['offset'];var _0x5172d2=_0x1d7db7?_0x8466a7[_0x5be4('0x20')]:_0x3e830e[_0x5be4('0x1d')]+_0x3e830e['limit'];var _0x88e373;if(_0x5172d2>=_0x2b704d){_0x5172d2=_0x2b704d;_0x88e373=0xc8;}else{_0x88e373=0xce;}_0x5ebe65[_0x5be4('0x1a')](_0x88e373);return _0x5ebe65['set']('Content-Range',_0x175630+'-'+_0x5172d2+'/'+_0x2b704d)[_0x5be4('0x1c')](_0x8466a7);}return null;};}function patchUpdates(_0x207948){return function(_0x4b73f9){try{jsonpatch['apply'](_0x4b73f9,_0x207948,!![]);}catch(_0x9bdadd){return BPromise[_0x5be4('0x21')](_0x9bdadd);}return _0x4b73f9[_0x5be4('0x22')]();};}function saveUpdates(_0x3ccd67,_0xa20552){return function(_0x5c76af){if(_0x5c76af){return _0x5c76af[_0x5be4('0x23')](_0x3ccd67)['then'](function(_0x242005){return _0x242005;});}return null;};}function removeEntity(_0x12b9cd,_0x4d6eff){return function(_0xf74e0c){if(_0xf74e0c){return _0xf74e0c[_0x5be4('0x24')]()['then'](function(){_0x12b9cd[_0x5be4('0x1a')](0xcc)[_0x5be4('0x1b')]();});}};}function handleEntityNotFound(_0x353a65,_0x39cf54){return function(_0xa7a16){if(!_0xa7a16){_0x353a65[_0x5be4('0x25')](0x194);}return _0xa7a16;};}function handleError(_0x112728,_0x5b49ea){_0x5b49ea=_0x5b49ea||0x1f4;return function(_0x50e5be){logger[_0x5be4('0x26')](_0x50e5be[_0x5be4('0x27')]);if(_0x50e5be[_0x5be4('0x28')]){delete _0x50e5be['name'];}_0x112728[_0x5be4('0x1a')](_0x5b49ea)[_0x5be4('0x29')](_0x50e5be);};}exports[_0x5be4('0x2a')]=function(_0x412ef6,_0x16f3bf){var _0x1e0485={},_0x4b9029={},_0x1661c2={'count':0x0,'rows':[]};var _0x17a291=_['map'](db[_0x5be4('0x2b')]['rawAttributes'],function(_0x1539f9){return{'name':_0x1539f9[_0x5be4('0x2c')],'type':_0x1539f9['type'][_0x5be4('0x2d')]};});_0x4b9029['model']=_['map'](_0x17a291,_0x5be4('0x28'));_0x4b9029[_0x5be4('0x2e')]=_[_0x5be4('0x2f')](_0x412ef6[_0x5be4('0x2e')]);_0x4b9029[_0x5be4('0x30')]=_[_0x5be4('0x31')](_0x4b9029[_0x5be4('0x32')],_0x4b9029[_0x5be4('0x2e')]);_0x4b9029[_0x5be4('0x30')]=_[_0x5be4('0x33')](_0x4b9029[_0x5be4('0x30')],[_0x5be4('0x34'),'$or','$gt',_0x5be4('0x35'),_0x5be4('0x36'),_0x5be4('0x37'),_0x5be4('0x38'),'$eq',_0x5be4('0x39'),'$between',_0x5be4('0x3a'),'$in',_0x5be4('0x3b'),_0x5be4('0x3c'),'$notLike','$iLike',_0x5be4('0x3d'),'$like','$overlap',_0x5be4('0x3e'),_0x5be4('0x3f'),_0x5be4('0x40')]);_0x1e0485['attributes']=_[_0x5be4('0x31')](_0x4b9029[_0x5be4('0x32')],qs['fields'](_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x41')]));_0x1e0485[_0x5be4('0x42')]=_0x1e0485[_0x5be4('0x42')]['length']?_0x1e0485[_0x5be4('0x42')]:_0x4b9029[_0x5be4('0x32')];if(!_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x43')](_0x5be4('0x44'))){_0x1e0485[_0x5be4('0x1f')]=qs[_0x5be4('0x1f')](_0x412ef6[_0x5be4('0x2e')]['limit']);_0x1e0485[_0x5be4('0x1d')]=qs[_0x5be4('0x1d')](_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x1d')]);}_0x1e0485[_0x5be4('0x45')]=qs['sort'](_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x46')]);_0x1e0485['where']=qs[_0x5be4('0x30')](_[_0x5be4('0x47')](_0x412ef6['query'],_0x4b9029[_0x5be4('0x30')]),_0x17a291);if(_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x48')]){_0x1e0485[_0x5be4('0x49')]=_[_0x5be4('0x4a')](_0x1e0485[_0x5be4('0x49')],{'$or':_[_0x5be4('0x4b')](_0x17a291,function(_0x426c00){if(_0x426c00[_0x5be4('0x4c')]!=='VIRTUAL'){var _0x1add45={};_0x1add45[_0x426c00['name']]={'$like':'%'+_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x48')]+'%'};return _0x1add45;}})});}_0x1e0485=_['merge']({},_0x1e0485,_0x412ef6[_0x5be4('0x4d')]);var _0x48c1db={'where':_0x1e0485['where']};return db[_0x5be4('0x2b')][_0x5be4('0x20')](_0x48c1db)[_0x5be4('0x4e')](function(_0x2550a9){_0x1661c2[_0x5be4('0x20')]=_0x2550a9;if(_0x412ef6[_0x5be4('0x2e')][_0x5be4('0x4f')]){_0x1e0485['include']=[{'all':!![]}];}return db[_0x5be4('0x2b')]['findAll'](_0x1e0485);})[_0x5be4('0x4e')](function(_0x518ad5){_0x1661c2[_0x5be4('0x50')]=_0x518ad5;return _0x1661c2;})[_0x5be4('0x4e')](respondWithFilteredResult(_0x16f3bf,_0x1e0485))['catch'](handleError(_0x16f3bf,null));};exports[_0x5be4('0x51')]=function(_0x7432ab,_0x1b2171){var _0x4f548c={'raw':!![],'where':{'id':_0x7432ab[_0x5be4('0x52')]['id']}},_0x17fabd={};_0x17fabd['model']=_[_0x5be4('0x2f')](db['CmHopper']['rawAttributes']);_0x17fabd[_0x5be4('0x2e')]=_[_0x5be4('0x2f')](_0x7432ab['query']);_0x17fabd[_0x5be4('0x30')]=_['intersection'](_0x17fabd['model'],_0x17fabd[_0x5be4('0x2e')]);_0x4f548c[_0x5be4('0x42')]=_[_0x5be4('0x31')](_0x17fabd['model'],qs['fields'](_0x7432ab[_0x5be4('0x2e')][_0x5be4('0x41')]));_0x4f548c[_0x5be4('0x42')]=_0x4f548c[_0x5be4('0x42')]['length']?_0x4f548c[_0x5be4('0x42')]:_0x17fabd[_0x5be4('0x32')];if(_0x7432ab['query'][_0x5be4('0x4f')]){_0x4f548c[_0x5be4('0x53')]=[{'all':!![]}];}_0x4f548c=_[_0x5be4('0x4a')]({},_0x4f548c,_0x7432ab['options']);return db[_0x5be4('0x2b')][_0x5be4('0x54')](_0x4f548c)[_0x5be4('0x4e')](handleEntityNotFound(_0x1b2171,null))[_0x5be4('0x4e')](respondWithResult(_0x1b2171,null))[_0x5be4('0x55')](handleError(_0x1b2171,null));};exports[_0x5be4('0x56')]=function(_0x1396ce,_0x1e1565){return db[_0x5be4('0x2b')][_0x5be4('0x56')](_0x1396ce['body'],{})[_0x5be4('0x4e')](respondWithResult(_0x1e1565,0xc9))['catch'](handleError(_0x1e1565,null));};exports[_0x5be4('0x23')]=function(_0x1e50bb,_0xafdf6e){if(_0x1e50bb[_0x5be4('0x57')]['id']){delete _0x1e50bb[_0x5be4('0x57')]['id'];}return db[_0x5be4('0x2b')][_0x5be4('0x54')]({'where':{'id':_0x1e50bb[_0x5be4('0x52')]['id']}})[_0x5be4('0x4e')](handleEntityNotFound(_0xafdf6e,null))[_0x5be4('0x4e')](saveUpdates(_0x1e50bb[_0x5be4('0x57')],null))['then'](respondWithResult(_0xafdf6e,null))[_0x5be4('0x55')](handleError(_0xafdf6e,null));};exports[_0x5be4('0x58')]=function(_0x418f23,_0x210541){return db[_0x5be4('0x2b')]['describe']()[_0x5be4('0x4e')](respondWithResult(_0x210541,null))[_0x5be4('0x55')](handleError(_0x210541,null));};exports[_0x5be4('0x24')]=function(_0x446e59,_0x3a55cd){var _0x1c0ee;return db[_0x5be4('0x2b')]['find']({'where':{'id':_0x446e59[_0x5be4('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a55cd,null))[_0x5be4('0x4e')](function(_0x279e18){if(_0x279e18){return _0x279e18['destroy']()[_0x5be4('0x4e')](function(_0x35617e){return _0x35617e;});}})[_0x5be4('0x4e')](function(_0xb12df){_0x1c0ee=_0xb12df;if(_0xb12df){if(_0xb12df[_0x5be4('0x59')]||_0xb12df[_0x5be4('0x5a')]){return db[_0xb12df[_0x5be4('0x59')]?_0x5be4('0x5b'):'Campaign']['find']({'where':{'id':_0xb12df[_0x5be4('0x59')]?_0xb12df['VoiceQueueId']:_0xb12df[_0x5be4('0x5a')]},'attributes':['id','name'],'raw':!![]});}}})[_0x5be4('0x4e')](function(_0x2a5b4f){var _0x688cc2={};if(_0x2a5b4f){_[_0x5be4('0x4a')](_0x688cc2,_[_0x5be4('0x5c')](_0x1c0ee[_0x5be4('0x5d')],[_0x5be4('0x5e'),'updatedAt','id']));_0x688cc2[_0x5be4('0x5f')]=0x15;_0x688cc2[_0x5be4('0x60')]='deleted';_0x688cc2[_0x5be4('0x61')]=_0x2a5b4f[_0x5be4('0x28')];_0x688cc2[_0x5be4('0x62')]=_0x446e59[_0x5be4('0x63')][_0x5be4('0x28')];_0x688cc2['UserId']=_0x446e59[_0x5be4('0x63')]['id'];_0x688cc2[_0x5be4('0x64')]=!![];_0x688cc2[_0x5be4('0x65')]=moment()[_0x5be4('0x66')](_0x5be4('0x67'));_0x688cc2['calleridnum']=_0x1c0ee[_0x5be4('0x68')];_0x688cc2['campaigntype']=_0x1c0ee[_0x5be4('0x59')]?_0x5be4('0x69'):_0x5be4('0x6a');return db['CmContact'][_0x5be4('0x54')]({'where':{'id':_0x688cc2[_0x5be4('0x6b')]},'attributes':['firstName','lastName']})[_0x5be4('0x4e')](function(_0xbaf63b){if(!_['isNil'](_0x3a55cd)&&!_[_0x5be4('0x6c')](_0xbaf63b[_0x5be4('0x6d')])){_0x688cc2[_0x5be4('0x6e')]=_0xbaf63b[_0x5be4('0x6d')];if(!_[_0x5be4('0x6c')](_0xbaf63b[_0x5be4('0x6f')])){_0x688cc2[_0x5be4('0x6e')]+='\x20'+_0xbaf63b[_0x5be4('0x6f')];}}})[_0x5be4('0x70')](function(){return db[_0x5be4('0x71')][_0x5be4('0x56')](_0x688cc2);});}})[_0x5be4('0x4e')](function(){return _0x3a55cd[_0x5be4('0x1a')](0xcc)[_0x5be4('0x1b')]();})[_0x5be4('0x55')](handleError(_0x3a55cd,null));};exports[_0x5be4('0x72')]=function(_0x61e42d,_0x26d5d9,_0xf6bd82){var _0x2995e6=[];return db[_0x5be4('0x73')][_0x5be4('0x58')]()[_0x5be4('0x4e')](function(_0x3ee8d0){_0x2995e6=_['keys'](_0x3ee8d0);return _0x61e42d['user'][_0x5be4('0x74')]({'where':{'type':_0x5be4('0x75'),'dialActive':!![],'dialMethod':_0x5be4('0x76')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x5be4('0x4e')](function(_0x7728d){if(_0x7728d&&_0x7728d[_0x5be4('0x77')]){return db[_0x5be4('0x78')][_0x5be4('0x79')](function(_0x32dd0a){var _0x24f066={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5be4('0x67'))},'VoiceQueueId':{'$in':_[_0x5be4('0x4b')](_0x7728d,'id')},'$or':[{'UserId':null},{'UserId':_0x61e42d['user']['id']}]};var _0x3df075={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x7728d)['filter']([_0x5be4('0x7a'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x61e42d['user']['id']}]};var _0x2ba514={'$or':[_0x24f066,_0x3df075]};var _0x225c9b=[];if(_0x61e42d[_0x5be4('0x57')][_0x5be4('0x7b')]&&_0x61e42d['body']['direction']==='prev'){if(!_['isEmpty'](_0x61e42d['body'][_0x5be4('0x7c')])){_0x2ba514['id']={'$in':_0x61e42d[_0x5be4('0x57')]['hopperIds']};}_0x225c9b=[['priority',_0x5be4('0x7d')],[_0x5be4('0x7e'),_0x7728d[0x0][_0x5be4('0x7f')]===_0x5be4('0x7d')?_0x5be4('0x80'):_0x5be4('0x7d')],db[_0x5be4('0x78')][_0x5be4('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5be4('0x80')]];}else{if(!_[_0x5be4('0x82')](_0x61e42d['body']['hopperIds'])){_0x2ba514['id']={'$notIn':_0x61e42d[_0x5be4('0x57')][_0x5be4('0x7c')]};}_0x225c9b=[['priority',_0x5be4('0x80')],[_0x5be4('0x7e'),_0x7728d[0x0][_0x5be4('0x7f')]],db[_0x5be4('0x78')][_0x5be4('0x81')](_0x5be4('0x83')),['id',_0x5be4('0x7d')]];}return db[_0x5be4('0x2b')][_0x5be4('0x84')]({'attributes':['id','scheduledat',_0x5be4('0x85')],'where':_0x2ba514,'order':_0x225c9b,'transaction':_0x32dd0a,'lock':_0x32dd0a[_0x5be4('0x86')][_0x5be4('0x87')],'include':[{'model':db[_0x5be4('0x73')],'as':_0x5be4('0x88'),'attributes':_0x2995e6,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x5be4('0x28')]}]},{'model':db[_0x5be4('0x89')],'as':_0x5be4('0x8a'),'attributes':['id',_0x5be4('0x28')]},{'model':db[_0x5be4('0x5b')],'as':_0x5be4('0x8b'),'attributes':['id',_0x5be4('0x28'),_0x5be4('0x8c')]}]})['then'](function(_0x23cd8d){if(_0x23cd8d){return _0x23cd8d[_0x5be4('0x23')]({'UserId':_0x61e42d[_0x5be4('0x63')]['id']},{'transaction':_0x32dd0a});}});});}})[_0x5be4('0x4e')](handleEntityNotFound(_0x26d5d9,null))[_0x5be4('0x4e')](respondWithResult(_0x26d5d9,null))[_0x5be4('0x55')](handleError(_0x26d5d9,null));};exports[_0x5be4('0x8d')]=function(_0x4bd667,_0x4e72ab,_0x303b86){var _0x180a69=[];return db[_0x5be4('0x73')][_0x5be4('0x58')]()[_0x5be4('0x4e')](function(_0x416b22){_0x180a69=_[_0x5be4('0x2f')](_0x416b22);return _0x4bd667[_0x5be4('0x63')]['getVoiceQueues']({'where':{'type':_0x5be4('0x75'),'dialActive':!![],'dialMethod':_0x5be4('0x76')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x5be4('0x4e')](function(_0x5dfdd1){if(_0x5dfdd1&&_0x5dfdd1['length']){return db['sequelize'][_0x5be4('0x79')](function(_0x382edd){var _0x3ae29a={'active':![],'recallme':!![],'id':_0x4bd667[_0x5be4('0x57')][_0x5be4('0x8e')]};return db['CmHopper'][_0x5be4('0x84')]({'attributes':['id',_0x5be4('0x8f'),_0x5be4('0x85')],'where':_0x3ae29a,'transaction':_0x382edd,'lock':_0x382edd['LOCK'][_0x5be4('0x87')],'include':[{'model':db[_0x5be4('0x73')],'as':'Contact','attributes':_0x180a69,'include':[{'model':db[_0x5be4('0x90')],'as':_0x5be4('0x91'),'attributes':['id',_0x5be4('0x28')]}]},{'model':db[_0x5be4('0x89')],'as':_0x5be4('0x8a'),'attributes':['id',_0x5be4('0x28')]},{'model':db[_0x5be4('0x5b')],'as':_0x5be4('0x8b'),'attributes':['id',_0x5be4('0x28'),'dialActive']}]})[_0x5be4('0x4e')](function(_0x16f281){if(_0x16f281){return _0x16f281[_0x5be4('0x23')]({'UserId':_0x4bd667[_0x5be4('0x63')]['id']},{'transaction':_0x382edd});}});});}})[_0x5be4('0x4e')](handleEntityNotFound(_0x4e72ab,null))[_0x5be4('0x4e')](respondWithResult(_0x4e72ab,null))[_0x5be4('0x55')](handleError(_0x4e72ab,null));};exports[_0x5be4('0x92')]=function(_0xe3cf5d,_0x1f3183,_0x2fa25e){return _0xe3cf5d[_0x5be4('0x63')][_0x5be4('0x74')]({'where':{'type':_0x5be4('0x75'),'dialActive':!![],'dialMethod':_0x5be4('0x76')},'attributes':['id'],'raw':!![]})[_0x5be4('0x4e')](function(_0x526e03){if(_0x526e03&&_0x526e03['length']){return db[_0x5be4('0x2b')][_0x5be4('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5be4('0x66')](_0x5be4('0x67'))},'VoiceQueueId':{'$in':_[_0x5be4('0x4b')](_0x526e03,'id')},'$or':[{'UserId':null},{'UserId':_0xe3cf5d[_0x5be4('0x63')]['id']}]}});}return 0x0;})[_0x5be4('0x4e')](function(_0x230cfa){if(!_[_0x5be4('0x6c')](_0x230cfa)&&_[_0x5be4('0x93')](_0x230cfa)){return _0x1f3183[_0x5be4('0x1a')](0xc8)[_0x5be4('0x1c')]({'contacts':_0x230cfa});}else{logger[_0x5be4('0x26')](_0x5be4('0x94'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x1f3183[_0x5be4('0x25')](0x194);}})[_0x5be4('0x55')](handleError(_0x1f3183,null));};exports[_0x5be4('0x95')]=function(_0x4f82a3,_0x18b0ac,_0x2fb12c){var _0x4aac5a=shared[_0x5be4('0x96')];var _0x49d84a=[];_[_0x5be4('0x4b')](_0x4aac5a,function(_0x3f94ba){_0x49d84a[_0x5be4('0x97')]({'id':_0x3f94ba[_0x5be4('0x28')],'name':_0x3f94ba[_0x5be4('0x28')],'utcOffset':_0x3f94ba['utcOffset']});});return _0x18b0ac[_0x5be4('0x1a')](0xc8)[_0x5be4('0x1c')]({'tz':_0x49d84a});};exports[_0x5be4('0x98')]=function(_0x46d123,_0x1da051,_0x55c4c0){var _0x4f5f32=shared['timezones'];var _0x4a6370={};if(!_[_0x5be4('0x6c')](_0x4f5f32[_0x46d123[_0x5be4('0x57')]['id']]))_0x4a6370=_0x4f5f32[_0x46d123[_0x5be4('0x57')]['id']];return _0x1da051['status'](0xc8)['json'](_0x4a6370);}; \ No newline at end of file +var _0xc856=['type','map','keys','filters','intersection','model','concat','$and','$gt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','query','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','create','body','find','describe','VoiceQueueId','VoiceQueue','omit','dataValues','updatedAt','state','statedesc','campaign','membername','UserId','user','deleted','deletedat','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','hopperId','LOCK','UPDATE','Company','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopper','rawAttributes','fieldName'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc856,0x1a9));var _0x6c85=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc856[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0x6c85('0x0'));var rimraf=require(_0x6c85('0x1'));var zipdir=require(_0x6c85('0x2'));var jsonpatch=require(_0x6c85('0x3'));var rp=require(_0x6c85('0x4'));var moment=require(_0x6c85('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6c85('0x6'));var util=require(_0x6c85('0x7'));var path=require(_0x6c85('0x8'));var sox=require('sox');var csv=require(_0x6c85('0x9'));var ejs=require(_0x6c85('0xa'));var fs=require('fs');var fs_extra=require(_0x6c85('0xb'));var _=require(_0x6c85('0xc'));var squel=require(_0x6c85('0xd'));var crypto=require(_0x6c85('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c85('0x9'));var querystring=require(_0x6c85('0xf'));var Papa=require('papaparse');var Redis=require(_0x6c85('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6c85('0x11'));var hardwareService=require(_0x6c85('0x12'));var logger=require(_0x6c85('0x13'))(_0x6c85('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var shared=require('../../config/environment');var licenseUtil=require(_0x6c85('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb75c,_0x5541ab){_0x5541ab=_0x5541ab||0xcc;return function(_0x28947b){if(_0x28947b){return _0x1cb75c[_0x6c85('0x16')](_0x5541ab);}return _0x1cb75c['status'](_0x5541ab)[_0x6c85('0x17')]();};}function respondWithResult(_0x162d4a,_0x4efe95){_0x4efe95=_0x4efe95||0xc8;return function(_0x3adc05){if(_0x3adc05){return _0x162d4a['status'](_0x4efe95)[_0x6c85('0x18')](_0x3adc05);}};}function respondWithFilteredResult(_0x30c479,_0x10c31d){return function(_0x553344){if(_0x553344){var _0x50c182=typeof _0x10c31d[_0x6c85('0x19')]==='undefined'&&typeof _0x10c31d[_0x6c85('0x1a')]===_0x6c85('0x1b');var _0x244573=_0x553344[_0x6c85('0x1c')];var _0x5e2a10=_0x50c182?0x0:_0x10c31d[_0x6c85('0x19')];var _0x12d180=_0x50c182?_0x553344[_0x6c85('0x1c')]:_0x10c31d[_0x6c85('0x19')]+_0x10c31d['limit'];var _0x3429ef;if(_0x12d180>=_0x244573){_0x12d180=_0x244573;_0x3429ef=0xc8;}else{_0x3429ef=0xce;}_0x30c479[_0x6c85('0x1d')](_0x3429ef);return _0x30c479[_0x6c85('0x1e')](_0x6c85('0x1f'),_0x5e2a10+'-'+_0x12d180+'/'+_0x244573)['json'](_0x553344);}return null;};}function patchUpdates(_0x5d09a7){return function(_0x2dd764){try{jsonpatch[_0x6c85('0x20')](_0x2dd764,_0x5d09a7,!![]);}catch(_0x2ff684){return BPromise[_0x6c85('0x21')](_0x2ff684);}return _0x2dd764[_0x6c85('0x22')]();};}function saveUpdates(_0x41b826,_0x34ae04){return function(_0x5605d2){if(_0x5605d2){return _0x5605d2[_0x6c85('0x23')](_0x41b826)[_0x6c85('0x24')](function(_0x48c9f2){return _0x48c9f2;});}return null;};}function removeEntity(_0x2a6f52,_0x42f5c5){return function(_0x201b91){if(_0x201b91){return _0x201b91[_0x6c85('0x25')]()[_0x6c85('0x24')](function(){_0x2a6f52[_0x6c85('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8114,_0x53479e){return function(_0x410737){if(!_0x410737){_0x4e8114[_0x6c85('0x16')](0x194);}return _0x410737;};}function handleError(_0x5f3c7a,_0xc3b2fa){_0xc3b2fa=_0xc3b2fa||0x1f4;return function(_0x43c577){logger[_0x6c85('0x26')](_0x43c577[_0x6c85('0x27')]);if(_0x43c577['name']){delete _0x43c577[_0x6c85('0x28')];}_0x5f3c7a[_0x6c85('0x1d')](_0xc3b2fa)[_0x6c85('0x29')](_0x43c577);};}exports[_0x6c85('0x2a')]=function(_0x358ea9,_0x3248df){var _0x55286c={},_0x5d6b9c={},_0x3183b4={'count':0x0,'rows':[]};var _0x417fdc=_['map'](db[_0x6c85('0x2b')][_0x6c85('0x2c')],function(_0x3a05e2){return{'name':_0x3a05e2[_0x6c85('0x2d')],'type':_0x3a05e2[_0x6c85('0x2e')]['key']};});_0x5d6b9c['model']=_[_0x6c85('0x2f')](_0x417fdc,_0x6c85('0x28'));_0x5d6b9c['query']=_[_0x6c85('0x30')](_0x358ea9['query']);_0x5d6b9c[_0x6c85('0x31')]=_[_0x6c85('0x32')](_0x5d6b9c[_0x6c85('0x33')],_0x5d6b9c['query']);_0x5d6b9c[_0x6c85('0x31')]=_[_0x6c85('0x34')](_0x5d6b9c[_0x6c85('0x31')],[_0x6c85('0x35'),'$or',_0x6c85('0x36'),'$gte','$lt',_0x6c85('0x37'),_0x6c85('0x38'),_0x6c85('0x39'),_0x6c85('0x3a'),_0x6c85('0x3b'),_0x6c85('0x3c'),_0x6c85('0x3d'),_0x6c85('0x3e'),_0x6c85('0x3f'),_0x6c85('0x40'),_0x6c85('0x41'),'$notILike',_0x6c85('0x3f'),_0x6c85('0x42'),_0x6c85('0x43'),'$contained',_0x6c85('0x44')]);_0x55286c[_0x6c85('0x45')]=_[_0x6c85('0x32')](_0x5d6b9c[_0x6c85('0x33')],qs['fields'](_0x358ea9[_0x6c85('0x46')]['fields']));_0x55286c[_0x6c85('0x45')]=_0x55286c[_0x6c85('0x45')][_0x6c85('0x47')]?_0x55286c[_0x6c85('0x45')]:_0x5d6b9c['model'];if(!_0x358ea9[_0x6c85('0x46')][_0x6c85('0x48')]('nolimit')){_0x55286c[_0x6c85('0x1a')]=qs[_0x6c85('0x1a')](_0x358ea9[_0x6c85('0x46')][_0x6c85('0x1a')]);_0x55286c[_0x6c85('0x19')]=qs[_0x6c85('0x19')](_0x358ea9[_0x6c85('0x46')][_0x6c85('0x19')]);}_0x55286c['order']=qs['sort'](_0x358ea9[_0x6c85('0x46')][_0x6c85('0x49')]);_0x55286c['where']=qs[_0x6c85('0x31')](_[_0x6c85('0x4a')](_0x358ea9[_0x6c85('0x46')],_0x5d6b9c[_0x6c85('0x31')]),_0x417fdc);if(_0x358ea9[_0x6c85('0x46')][_0x6c85('0x4b')]){_0x55286c[_0x6c85('0x4c')]=_[_0x6c85('0x4d')](_0x55286c[_0x6c85('0x4c')],{'$or':_[_0x6c85('0x2f')](_0x417fdc,function(_0x10fd9e){if(_0x10fd9e[_0x6c85('0x2e')]!==_0x6c85('0x4e')){var _0xa708c4={};_0xa708c4[_0x10fd9e[_0x6c85('0x28')]]={'$like':'%'+_0x358ea9['query'][_0x6c85('0x4b')]+'%'};return _0xa708c4;}})});}_0x55286c=_['merge']({},_0x55286c,_0x358ea9['options']);var _0x666bf7={'where':_0x55286c[_0x6c85('0x4c')]};return db[_0x6c85('0x2b')]['count'](_0x666bf7)[_0x6c85('0x24')](function(_0xf56b57){_0x3183b4['count']=_0xf56b57;if(_0x358ea9[_0x6c85('0x46')][_0x6c85('0x4f')]){_0x55286c['include']=[{'all':!![]}];}return db['CmHopper'][_0x6c85('0x50')](_0x55286c);})[_0x6c85('0x24')](function(_0x58e768){_0x3183b4[_0x6c85('0x51')]=_0x58e768;return _0x3183b4;})[_0x6c85('0x24')](respondWithFilteredResult(_0x3248df,_0x55286c))[_0x6c85('0x52')](handleError(_0x3248df,null));};exports[_0x6c85('0x53')]=function(_0x267913,_0x2d632c){var _0x55158c={'raw':!![],'where':{'id':_0x267913[_0x6c85('0x54')]['id']}},_0x56718c={};_0x56718c[_0x6c85('0x33')]=_[_0x6c85('0x30')](db[_0x6c85('0x2b')][_0x6c85('0x2c')]);_0x56718c['query']=_[_0x6c85('0x30')](_0x267913[_0x6c85('0x46')]);_0x56718c[_0x6c85('0x31')]=_['intersection'](_0x56718c[_0x6c85('0x33')],_0x56718c[_0x6c85('0x46')]);_0x55158c[_0x6c85('0x45')]=_[_0x6c85('0x32')](_0x56718c['model'],qs[_0x6c85('0x55')](_0x267913[_0x6c85('0x46')][_0x6c85('0x55')]));_0x55158c[_0x6c85('0x45')]=_0x55158c[_0x6c85('0x45')]['length']?_0x55158c[_0x6c85('0x45')]:_0x56718c[_0x6c85('0x33')];if(_0x267913[_0x6c85('0x46')][_0x6c85('0x4f')]){_0x55158c[_0x6c85('0x56')]=[{'all':!![]}];}_0x55158c=_[_0x6c85('0x4d')]({},_0x55158c,_0x267913['options']);return db[_0x6c85('0x2b')]['find'](_0x55158c)[_0x6c85('0x24')](handleEntityNotFound(_0x2d632c,null))[_0x6c85('0x24')](respondWithResult(_0x2d632c,null))['catch'](handleError(_0x2d632c,null));};exports[_0x6c85('0x57')]=function(_0x7ef63b,_0x2f4d38){return db['CmHopper'][_0x6c85('0x57')](_0x7ef63b[_0x6c85('0x58')],{})[_0x6c85('0x24')](respondWithResult(_0x2f4d38,0xc9))['catch'](handleError(_0x2f4d38,null));};exports[_0x6c85('0x23')]=function(_0x3842ae,_0x27bc04){if(_0x3842ae['body']['id']){delete _0x3842ae[_0x6c85('0x58')]['id'];}return db['CmHopper'][_0x6c85('0x59')]({'where':{'id':_0x3842ae[_0x6c85('0x54')]['id']}})['then'](handleEntityNotFound(_0x27bc04,null))['then'](saveUpdates(_0x3842ae[_0x6c85('0x58')],null))['then'](respondWithResult(_0x27bc04,null))[_0x6c85('0x52')](handleError(_0x27bc04,null));};exports[_0x6c85('0x5a')]=function(_0x4e62f5,_0x5f4c16){return db[_0x6c85('0x2b')]['describe']()[_0x6c85('0x24')](respondWithResult(_0x5f4c16,null))[_0x6c85('0x52')](handleError(_0x5f4c16,null));};exports[_0x6c85('0x25')]=function(_0x2b3f0f,_0x2aab8b){var _0x180984;return db[_0x6c85('0x2b')][_0x6c85('0x59')]({'where':{'id':_0x2b3f0f['params']['id']}})['then'](handleEntityNotFound(_0x2aab8b,null))['then'](function(_0x17910f){if(_0x17910f){return _0x17910f[_0x6c85('0x25')]()['then'](function(_0x5bfc1d){return _0x5bfc1d;});}})['then'](function(_0xeba390){_0x180984=_0xeba390;if(_0xeba390){if(_0xeba390[_0x6c85('0x5b')]||_0xeba390['CampaignId']){return db[_0xeba390[_0x6c85('0x5b')]?_0x6c85('0x5c'):'Campaign'][_0x6c85('0x59')]({'where':{'id':_0xeba390['VoiceQueueId']?_0xeba390['VoiceQueueId']:_0xeba390['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x6c85('0x24')](function(_0xb1eb8d){var _0x613be6={};if(_0xb1eb8d){_[_0x6c85('0x4d')](_0x613be6,_[_0x6c85('0x5d')](_0x180984[_0x6c85('0x5e')],['createdAt',_0x6c85('0x5f'),'id']));_0x613be6[_0x6c85('0x60')]=0x15;_0x613be6[_0x6c85('0x61')]='deleted';_0x613be6[_0x6c85('0x62')]=_0xb1eb8d[_0x6c85('0x28')];_0x613be6[_0x6c85('0x63')]=_0x2b3f0f['user']['name'];_0x613be6[_0x6c85('0x64')]=_0x2b3f0f[_0x6c85('0x65')]['id'];_0x613be6[_0x6c85('0x66')]=!![];_0x613be6[_0x6c85('0x67')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x613be6[_0x6c85('0x68')]=_0x180984[_0x6c85('0x69')];_0x613be6[_0x6c85('0x6a')]=_0x180984[_0x6c85('0x5b')]?_0x6c85('0x6b'):_0x6c85('0x6c');return db['CmContact'][_0x6c85('0x59')]({'where':{'id':_0x613be6[_0x6c85('0x6d')]},'attributes':[_0x6c85('0x6e'),_0x6c85('0x6f')]})[_0x6c85('0x24')](function(_0x25af12){if(!_[_0x6c85('0x70')](_0x2aab8b)&&!_[_0x6c85('0x70')](_0x25af12[_0x6c85('0x6e')])){_0x613be6[_0x6c85('0x71')]=_0x25af12[_0x6c85('0x6e')];if(!_[_0x6c85('0x70')](_0x25af12['lastName'])){_0x613be6[_0x6c85('0x71')]+='\x20'+_0x25af12['lastName'];}}})['finally'](function(){return db['CmHopperFinal'][_0x6c85('0x57')](_0x613be6);});}})[_0x6c85('0x24')](function(){return _0x2aab8b[_0x6c85('0x1d')](0xcc)['end']();})[_0x6c85('0x52')](handleError(_0x2aab8b,null));};exports[_0x6c85('0x72')]=function(_0x5bd784,_0x7c5a5d,_0xdcf5fe){var _0x24e9d3=[];return db[_0x6c85('0x73')]['describe']()[_0x6c85('0x24')](function(_0x19f274){_0x24e9d3=_[_0x6c85('0x30')](_0x19f274);return _0x5bd784[_0x6c85('0x65')][_0x6c85('0x74')]({'where':{'type':_0x6c85('0x75'),'dialActive':!![],'dialMethod':_0x6c85('0x76')},'attributes':['id',_0x6c85('0x77'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x6c85('0x24')](function(_0x5e8355){if(_0x5e8355&&_0x5e8355[_0x6c85('0x47')]){return db[_0x6c85('0x78')][_0x6c85('0x79')](function(_0x181d74){var _0x4d0743={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6c85('0x7a')](_0x6c85('0x7b'))},'VoiceQueueId':{'$in':_[_0x6c85('0x2f')](_0x5e8355,'id')},'$or':[{'UserId':null},{'UserId':_0x5bd784['user']['id']}]};var _0x32ad15={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5e8355)[_0x6c85('0x4b')]([_0x6c85('0x7c'),0x0])[_0x6c85('0x2f')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x5bd784[_0x6c85('0x65')]['id']}]};var _0xa37e53={'$or':[_0x4d0743,_0x32ad15]};var _0xa8ee15=[];if(_0x5bd784[_0x6c85('0x58')][_0x6c85('0x7d')]&&_0x5bd784['body'][_0x6c85('0x7d')]===_0x6c85('0x7e')){if(!_[_0x6c85('0x7f')](_0x5bd784[_0x6c85('0x58')][_0x6c85('0x80')])){_0xa37e53['id']={'$in':_0x5bd784['body'][_0x6c85('0x80')]};}_0xa8ee15=[[_0x6c85('0x81'),_0x6c85('0x82')],[_0x6c85('0x83'),_0x5e8355[0x0][_0x6c85('0x77')]===_0x6c85('0x82')?_0x6c85('0x84'):_0x6c85('0x82')],db[_0x6c85('0x78')]['literal'](_0x6c85('0x85')),['id','DESC']];}else{if(!_[_0x6c85('0x7f')](_0x5bd784[_0x6c85('0x58')]['hopperIds'])){_0xa37e53['id']={'$notIn':_0x5bd784['body'][_0x6c85('0x80')]};}_0xa8ee15=[[_0x6c85('0x81'),'DESC'],[_0x6c85('0x83'),_0x5e8355[0x0][_0x6c85('0x77')]],db[_0x6c85('0x78')][_0x6c85('0x86')](_0x6c85('0x87')),['id',_0x6c85('0x82')]];}return db[_0x6c85('0x2b')]['findOne']({'attributes':['id',_0x6c85('0x88'),_0x6c85('0x89')],'where':_0xa37e53,'order':_0xa8ee15,'transaction':_0x181d74,'lock':_0x181d74['LOCK']['UPDATE'],'include':[{'model':db[_0x6c85('0x73')],'as':_0x6c85('0x8a'),'attributes':_0x24e9d3,'include':[{'model':db[_0x6c85('0x8b')],'as':'Company','attributes':['id',_0x6c85('0x28')]}]},{'model':db[_0x6c85('0x8c')],'as':_0x6c85('0x8d'),'attributes':['id',_0x6c85('0x28')]},{'model':db[_0x6c85('0x5c')],'as':_0x6c85('0x8e'),'attributes':['id','name',_0x6c85('0x8f')]}]})[_0x6c85('0x24')](function(_0x156be4){if(_0x156be4){return _0x156be4[_0x6c85('0x23')]({'UserId':_0x5bd784[_0x6c85('0x65')]['id']},{'transaction':_0x181d74});}});});}})[_0x6c85('0x24')](handleEntityNotFound(_0x7c5a5d,null))[_0x6c85('0x24')](respondWithResult(_0x7c5a5d,null))[_0x6c85('0x52')](handleError(_0x7c5a5d,null));};exports[_0x6c85('0x90')]=function(_0x4d7025,_0x152883,_0x4a4df){var _0x5d4cbc=[];return db[_0x6c85('0x73')][_0x6c85('0x5a')]()[_0x6c85('0x24')](function(_0x17ede4){_0x5d4cbc=_[_0x6c85('0x30')](_0x17ede4);return _0x4d7025[_0x6c85('0x65')]['getVoiceQueues']({'where':{'type':_0x6c85('0x75'),'dialActive':!![],'dialMethod':_0x6c85('0x76')},'attributes':['id',_0x6c85('0x77'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x6c85('0x24')](function(_0x270fae){if(_0x270fae&&_0x270fae['length']){return db[_0x6c85('0x78')][_0x6c85('0x79')](function(_0x4c696){var _0x57eced={'active':![],'recallme':!![],'id':_0x4d7025[_0x6c85('0x58')][_0x6c85('0x91')]};return db[_0x6c85('0x2b')]['findOne']({'attributes':['id',_0x6c85('0x88'),_0x6c85('0x89')],'where':_0x57eced,'transaction':_0x4c696,'lock':_0x4c696[_0x6c85('0x92')][_0x6c85('0x93')],'include':[{'model':db['CmContact'],'as':_0x6c85('0x8a'),'attributes':_0x5d4cbc,'include':[{'model':db['CmCompany'],'as':_0x6c85('0x94'),'attributes':['id','name']}]},{'model':db[_0x6c85('0x8c')],'as':_0x6c85('0x8d'),'attributes':['id','name']},{'model':db[_0x6c85('0x5c')],'as':'Queue','attributes':['id',_0x6c85('0x28'),_0x6c85('0x8f')]}]})[_0x6c85('0x24')](function(_0x1ab9e4){if(_0x1ab9e4){return _0x1ab9e4[_0x6c85('0x23')]({'UserId':_0x4d7025[_0x6c85('0x65')]['id']},{'transaction':_0x4c696});}});});}})[_0x6c85('0x24')](handleEntityNotFound(_0x152883,null))[_0x6c85('0x24')](respondWithResult(_0x152883,null))[_0x6c85('0x52')](handleError(_0x152883,null));};exports['getOpenContacts']=function(_0x257c4a,_0x3af94e,_0x3df011){return _0x257c4a[_0x6c85('0x65')][_0x6c85('0x74')]({'where':{'type':_0x6c85('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x6c85('0x24')](function(_0x49490e){if(_0x49490e&&_0x49490e[_0x6c85('0x47')]){return db[_0x6c85('0x2b')][_0x6c85('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6c85('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6c85('0x2f')](_0x49490e,'id')},'$or':[{'UserId':null},{'UserId':_0x257c4a['user']['id']}]}});}return 0x0;})[_0x6c85('0x24')](function(_0x42a5ce){if(!_[_0x6c85('0x70')](_0x42a5ce)&&_[_0x6c85('0x95')](_0x42a5ce)){return _0x3af94e['status'](0xc8)[_0x6c85('0x18')]({'contacts':_0x42a5ce});}else{logger[_0x6c85('0x26')](_0x6c85('0x96'),_0x6c85('0x97'),0x194,'entity\x20not\x20found');_0x3af94e[_0x6c85('0x16')](0x194);}})[_0x6c85('0x52')](handleError(_0x3af94e,null));};exports[_0x6c85('0x98')]=function(_0x5249ca,_0xd87846,_0x3264f4){var _0x28d6ab=shared[_0x6c85('0x99')];var _0x3f2184=[];_[_0x6c85('0x2f')](_0x28d6ab,function(_0x564f1c){_0x3f2184[_0x6c85('0x9a')]({'id':_0x564f1c['name'],'name':_0x564f1c['name'],'utcOffset':_0x564f1c[_0x6c85('0x9b')]});});return _0xd87846[_0x6c85('0x1d')](0xc8)[_0x6c85('0x18')]({'tz':_0x3f2184});};exports[_0x6c85('0x9c')]=function(_0x3bedc7,_0x5d14e8,_0x1d50c0){var _0x1f393a=shared[_0x6c85('0x99')];var _0x349acb={};if(!_['isNil'](_0x1f393a[_0x3bedc7[_0x6c85('0x58')]['id']]))_0x349acb=_0x1f393a[_0x3bedc7[_0x6c85('0x58')]['id']];return _0x5d14e8[_0x6c85('0x1d')](0xc8)['json'](_0x349acb);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index e1a4f2a..7cfd4e2 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x187d,0x93));var _0xd187=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x187d[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x58f7be,_0xebef22){var _0x5c57dc=function(_0x5a32c8){while(--_0x5a32c8){_0x58f7be['push'](_0x58f7be['shift']());}};_0x5c57dc(++_0xebef22);}(_0xeff8,0x186));var _0x8eff=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xeff8[_0x489b87];return _0x1823b6;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6af2ac0..9a8fccb 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 _0xe8fd=['destroy','GetContactDialer','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','CmList','List','\x20MINUTE','CmHopperHandlePreviewRecallNotifications','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','CmHopper,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetCmHopper','CmHopper','options','raw','attributes','limit','include','map','model','catch','ShowCmHopper','where','CreateCmHopper','body','UpdateCmHopper','update','active','DestroyCmHopper'];(function(_0x3abb2c,_0x4cc712){var _0x80932d=function(_0x727088){while(--_0x727088){_0x3abb2c['push'](_0x3abb2c['shift']());}};_0x80932d(++_0x4cc712);}(_0xe8fd,0x83));var _0xde8f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xe8fd[_0x500419];return _0x241c1a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde8f('0x0'));var fs=require('fs');var Redis=require(_0xde8f('0x1'));var db=require(_0xde8f('0x2'))['db'];var utils=require(_0xde8f('0x3'));var logger=require('../../config/logger')(_0xde8f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0xde8f('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21f22d,_0x32aef0,_0x3ded9c){return new BPromise(function(_0x34e8f9,_0x34d1ef){return client[_0xde8f('0x6')](_0x21f22d,_0x3ded9c)[_0xde8f('0x7')](function(_0x4ae906){logger[_0xde8f('0x8')](_0xde8f('0x9'),_0x32aef0,'request\x20sent');logger[_0xde8f('0xa')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x32aef0,_0xde8f('0xb'),JSON[_0xde8f('0xc')](_0x4ae906));if(_0x4ae906[_0xde8f('0xd')]){if(_0x4ae906[_0xde8f('0xd')][_0xde8f('0xe')]===0x1f4){logger[_0xde8f('0xd')](_0xde8f('0x9'),_0x32aef0,_0x4ae906['error'][_0xde8f('0xf')]);return _0x34d1ef(_0x4ae906[_0xde8f('0xd')][_0xde8f('0xf')]);}logger['error'](_0xde8f('0x9'),_0x32aef0,_0x4ae906[_0xde8f('0xd')][_0xde8f('0xf')]);return _0x34e8f9(_0x4ae906['error'][_0xde8f('0xf')]);}else{logger[_0xde8f('0x8')](_0xde8f('0x9'),_0x32aef0,'request\x20sent');_0x34e8f9(_0x4ae906[_0xde8f('0x10')]['message']);}})['catch'](function(_0x2a3337){logger[_0xde8f('0xd')](_0xde8f('0x9'),_0x32aef0,_0x2a3337);_0x34d1ef(_0x2a3337);});});}exports[_0xde8f('0x11')]=function(_0x4473ad){var _0x4bc7c3=this;return new Promise(function(_0x5c5fb2,_0xd99414){return db[_0xde8f('0x12')]['findAll']({'raw':_0x4473ad[_0xde8f('0x13')]?_0x4473ad[_0xde8f('0x13')][_0xde8f('0x14')]===undefined?!![]:![]:!![],'where':_0x4473ad['options']?_0x4473ad['options']['where']||null:null,'attributes':_0x4473ad[_0xde8f('0x13')]?_0x4473ad[_0xde8f('0x13')][_0xde8f('0x15')]||null:null,'limit':_0x4473ad[_0xde8f('0x13')]?_0x4473ad[_0xde8f('0x13')][_0xde8f('0x16')]||null:null,'include':_0x4473ad[_0xde8f('0x13')]?_0x4473ad[_0xde8f('0x13')][_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x4473ad[_0xde8f('0x13')][_0xde8f('0x17')],function(_0x45ea1c){return{'model':db[_0x45ea1c[_0xde8f('0x19')]],'as':_0x45ea1c['as'],'attributes':_0x45ea1c['attributes'],'include':_0x45ea1c['include']?_['map'](_0x45ea1c['include'],function(_0x3040b5){return{'model':db[_0x3040b5[_0xde8f('0x19')]],'as':_0x3040b5['as'],'attributes':_0x3040b5[_0xde8f('0x15')],'include':_0x3040b5[_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x3040b5[_0xde8f('0x17')],function(_0x4ce1ab){return{'model':db[_0x4ce1ab[_0xde8f('0x19')]],'as':_0x4ce1ab['as'],'attributes':_0x4ce1ab[_0xde8f('0x15')]};}):[]};}):[]};}):[]:[]})[_0xde8f('0x7')](function(_0x2545e9){logger[_0xde8f('0x8')](_0xde8f('0x11'),_0x4473ad);logger[_0xde8f('0xa')]('GetCmHopper',_0x4473ad,JSON[_0xde8f('0xc')](_0x2545e9));_0x5c5fb2(_0x2545e9);})[_0xde8f('0x1a')](function(_0x510a74){logger[_0xde8f('0xd')](_0xde8f('0x11'),_0x510a74['message'],_0x4473ad);_0xd99414(_0x4bc7c3[_0xde8f('0xd')](0x1f4,_0x510a74['message']));});});};exports[_0xde8f('0x1b')]=function(_0x2380aa){var _0x5cc768=this;return new Promise(function(_0x4e1ef8,_0x3b6658){return db[_0xde8f('0x12')]['find']({'raw':_0x2380aa[_0xde8f('0x13')]?_0x2380aa[_0xde8f('0x13')][_0xde8f('0x14')]===undefined?!![]:![]:!![],'where':_0x2380aa[_0xde8f('0x13')]?_0x2380aa['options'][_0xde8f('0x1c')]||null:null,'attributes':_0x2380aa[_0xde8f('0x13')]?_0x2380aa[_0xde8f('0x13')][_0xde8f('0x15')]||null:null,'include':_0x2380aa[_0xde8f('0x13')]?_0x2380aa[_0xde8f('0x13')][_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x2380aa['options'][_0xde8f('0x17')],function(_0x46c2bf){return{'model':db[_0x46c2bf[_0xde8f('0x19')]],'as':_0x46c2bf['as'],'attributes':_0x46c2bf[_0xde8f('0x15')],'include':_0x46c2bf[_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x46c2bf[_0xde8f('0x17')],function(_0x3d643d){return{'model':db[_0x3d643d[_0xde8f('0x19')]],'as':_0x3d643d['as'],'attributes':_0x3d643d[_0xde8f('0x15')],'include':_0x3d643d['include']?_['map'](_0x3d643d[_0xde8f('0x17')],function(_0x5897a0){return{'model':db[_0x5897a0[_0xde8f('0x19')]],'as':_0x5897a0['as'],'attributes':_0x5897a0[_0xde8f('0x15')]};}):[]};}):[]};}):[]:[]})[_0xde8f('0x7')](function(_0x3352e0){logger[_0xde8f('0x8')](_0xde8f('0x1b'),_0x2380aa);logger[_0xde8f('0xa')](_0xde8f('0x1b'),_0x2380aa,JSON[_0xde8f('0xc')](_0x3352e0));_0x4e1ef8(_0x3352e0);})[_0xde8f('0x1a')](function(_0x5b2c7e){logger[_0xde8f('0xd')](_0xde8f('0x1b'),_0x5b2c7e[_0xde8f('0xf')],_0x2380aa);_0x3b6658(_0x5cc768[_0xde8f('0xd')](0x1f4,_0x5b2c7e[_0xde8f('0xf')]));});});};exports[_0xde8f('0x1d')]=function(_0x190208){var _0x43a1f2=this;return new Promise(function(_0x4a1bbf,_0x277930){return db[_0xde8f('0x12')]['create'](_0x190208[_0xde8f('0x1e')],{'raw':_0x190208[_0xde8f('0x13')]?_0x190208[_0xde8f('0x13')][_0xde8f('0x14')]===undefined?!![]:![]:!![]})[_0xde8f('0x7')](function(_0x58128f){logger['info']('CreateCmHopper',_0x190208);logger[_0xde8f('0xa')](_0xde8f('0x1d'),_0x190208,JSON['stringify'](_0x58128f));_0x4a1bbf(_0x58128f);})[_0xde8f('0x1a')](function(_0x532b67){logger[_0xde8f('0xd')](_0xde8f('0x1d'),_0x532b67[_0xde8f('0xf')],_0x190208);_0x277930(_0x43a1f2['error'](0x1f4,_0x532b67[_0xde8f('0xf')]));});});};exports[_0xde8f('0x1f')]=function(_0xf4e923){var _0x38a564=this;return new Promise(function(_0x3c124c,_0x1176a3){return db[_0xde8f('0x12')][_0xde8f('0x20')](_0xf4e923['body'],{'raw':_0xf4e923['options']?_0xf4e923[_0xde8f('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf4e923[_0xde8f('0x13')]?_0xf4e923['options'][_0xde8f('0x1c')]||null:null,'attributes':_0xf4e923[_0xde8f('0x13')]?_0xf4e923['options'][_0xde8f('0x15')]||null:null,'limit':_0xf4e923[_0xde8f('0x13')]?_0xf4e923['options'][_0xde8f('0x16')]||null:null})[_0xde8f('0x7')](function(_0x3f175c){logger[_0xde8f('0x8')](_0xde8f('0x1f'),_0xf4e923);logger[_0xde8f('0x8')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xde8f('0xc')](_0xf4e923['options']['where']),_0xf4e923['body'][_0xde8f('0x21')]);logger[_0xde8f('0xa')](_0xde8f('0x1f'),_0xf4e923,JSON[_0xde8f('0xc')](_0x3f175c));_0x3c124c(_0x3f175c);})[_0xde8f('0x1a')](function(_0x200bf6){logger['error'](_0xde8f('0x1f'),_0x200bf6['message'],_0xf4e923);_0x1176a3(_0x38a564['error'](0x1f4,_0x200bf6[_0xde8f('0xf')]));});});};exports[_0xde8f('0x22')]=function(_0x325e6f){var _0xfb3027=this;return new Promise(function(_0x2a9dc9,_0x1ecec1){return db[_0xde8f('0x12')][_0xde8f('0x23')]({'where':_0x325e6f[_0xde8f('0x13')]?_0x325e6f[_0xde8f('0x13')][_0xde8f('0x1c')]||null:null})[_0xde8f('0x7')](function(_0x3608cb){logger[_0xde8f('0x8')](_0xde8f('0x22'),_0x325e6f);logger[_0xde8f('0xa')](_0xde8f('0x22'),_0x325e6f,JSON[_0xde8f('0xc')](_0x3608cb));_0x2a9dc9(_0x3608cb);})[_0xde8f('0x1a')](function(_0x5c5526){logger['error'](_0xde8f('0x22'),_0x5c5526[_0xde8f('0xf')],_0x325e6f);_0x1ecec1(_0xfb3027[_0xde8f('0xd')](0x1f4,_0x5c5526['message']));});});};exports[_0xde8f('0x24')]=function(_0x5bfa54){var _0x38f71b=this;return new Promise(function(_0x24384d,_0x4fa0c6){return db['CmContact'][_0xde8f('0x25')]()[_0xde8f('0x7')](function(_0x43b698){return db[_0xde8f('0x26')][_0xde8f('0x27')](function(_0x388ad0){return db[_0xde8f('0x12')][_0xde8f('0x28')]({'where':_0x5bfa54[_0xde8f('0x13')]?_0x5bfa54['options']['where']||null:null,'attributes':_0x5bfa54['options']?_0x5bfa54[_0xde8f('0x13')][_0xde8f('0x15')]||null:null,'limit':_0x5bfa54[_0xde8f('0x13')]?_0x5bfa54[_0xde8f('0x13')][_0xde8f('0x16')]||null:null,'order':_0x5bfa54[_0xde8f('0x13')]?_0x5bfa54[_0xde8f('0x13')][_0xde8f('0x29')]||null:null,'transaction':_0x388ad0,'lock':_0x388ad0[_0xde8f('0x2a')][_0xde8f('0x2b')],'include':[{'model':db[_0xde8f('0x2c')],'as':_0xde8f('0x2d'),'attributes':_[_0xde8f('0x2e')](_0x43b698)},{'model':db[_0xde8f('0x2f')],'as':_0xde8f('0x30'),'attributes':['id',_0xde8f('0x31'),_0xde8f('0x32')]}]})[_0xde8f('0x7')](function(_0x174bdc){var _0x308b7f=[];var _0x89661d=[];for(var _0x23c35c=0x0;_0x23c35c<_0x174bdc[_0xde8f('0x33')];_0x23c35c+=0x1){var _0x538cf2=_0x174bdc[_0x23c35c][_0xde8f('0x34')];if(_0x538cf2===null){_0x308b7f[_0xde8f('0x35')](_0x174bdc[_0x23c35c][_0xde8f('0x20')](_0x5bfa54[_0xde8f('0x1e')],{'transaction':_0x388ad0}));}else if(!_0x89661d[_0xde8f('0x36')](_0x538cf2)){_0x89661d[_0xde8f('0x35')](_0x538cf2);_0x308b7f[_0xde8f('0x35')](_0x174bdc[_0x23c35c]['update'](_0x5bfa54[_0xde8f('0x1e')],{'transaction':_0x388ad0}));}}return BPromise['all'](_0x308b7f);});})[_0xde8f('0x7')](function(_0x57d9b4){logger[_0xde8f('0x8')](_0xde8f('0x24'),_0x5bfa54);if(_0x57d9b4[_0xde8f('0x33')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x57d9b4[0x0][_0xde8f('0x37')]['id'],_0x57d9b4[0x0]['dataValues'][_0xde8f('0x38')],_0x57d9b4[0x0]['dataValues']['active']);}logger[_0xde8f('0xa')](_0xde8f('0x24'),_0x5bfa54,JSON[_0xde8f('0xc')](_0x57d9b4));_0x24384d(_0x57d9b4);})[_0xde8f('0x1a')](function(_0x47178e){logger[_0xde8f('0xd')](_0xde8f('0x24'),_0x47178e[_0xde8f('0xf')],_0x5bfa54);_0x4fa0c6(_0x38f71b[_0xde8f('0xd')](0x1f4,_0x47178e['message']));});});});};exports[_0xde8f('0x39')]=function(_0x396096){var _0x4d210c=this;return new Promise(function(_0x251dcf,_0x330c87){return db['sequelize'][_0xde8f('0x27')](function(_0x32cf23){return db[_0xde8f('0x3a')][_0xde8f('0x3b')](_0x396096['body'],{'raw':_0x396096[_0xde8f('0x13')]?_0x396096[_0xde8f('0x13')][_0xde8f('0x14')]===undefined?!![]:![]:!![],'transaction':_0x32cf23})[_0xde8f('0x7')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xde8f('0xc')](_0x396096[_0xde8f('0x13')][_0xde8f('0x1c')]),_0x396096[_0xde8f('0x13')][_0xde8f('0x1c')][_0xde8f('0x21')]);return db[_0xde8f('0x12')][_0xde8f('0x23')]({'where':_0x396096['options']?_0x396096[_0xde8f('0x13')][_0xde8f('0x1c')]||null:null,'transaction':_0x32cf23});});})['then'](function(_0x5ce168){logger[_0xde8f('0x8')](_0xde8f('0x39'),_0x396096);logger[_0xde8f('0xa')](_0xde8f('0x39'),_0x396096,JSON[_0xde8f('0xc')](_0x5ce168));_0x251dcf(_0x5ce168);})[_0xde8f('0x1a')](function(_0x6e9c37){logger['error']('MoveContactManagedDialer',_0x6e9c37[_0xde8f('0xf')],_0x396096);_0x330c87(_0x4d210c[_0xde8f('0xd')](0x1f4,_0x6e9c37[_0xde8f('0xf')]));});});};exports[_0xde8f('0x3c')]=function(_0x3d1e55){var _0x3484d6=this;return new Promise(function(_0x217b09,_0x3351){return db[_0xde8f('0x12')][_0xde8f('0x28')]({'raw':_0x3d1e55['options']?_0x3d1e55[_0xde8f('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3d1e55[_0xde8f('0x13')]?_0x3d1e55[_0xde8f('0x13')][_0xde8f('0x1c')]||null:null,'attributes':[[db[_0xde8f('0x26')]['fn'](_0xde8f('0x3d'),db['sequelize']['fn']('IF',db[_0xde8f('0x26')][_0xde8f('0x3e')](_0xde8f('0x3f')+util[_0xde8f('0x40')]('\x22%s\x22',moment()[_0xde8f('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xde8f('0x41')))),_0xde8f('0x42')]]})[_0xde8f('0x7')](function(_0x4ac326){logger[_0xde8f('0x8')](_0xde8f('0x3c'),_0x3d1e55);logger[_0xde8f('0xa')](_0xde8f('0x3c'),_0x3d1e55,JSON[_0xde8f('0xc')](_0x4ac326));_0x217b09(_0x4ac326);})[_0xde8f('0x1a')](function(_0x18f85b){logger[_0xde8f('0xd')](_0xde8f('0x3c'),_0x18f85b[_0xde8f('0xf')],_0x3d1e55);_0x3351(_0x3484d6[_0xde8f('0xd')](0x1f4,_0x18f85b[_0xde8f('0xf')]));});});};exports['GetContactRecallMe']=function(_0x51746d){var _0x39123a=this;return new Promise(function(_0x28c875,_0x4df3ac){return db[_0xde8f('0x2c')][_0xde8f('0x25')]()['then'](function(_0x44455e){return db[_0xde8f('0x26')][_0xde8f('0x27')](function(_0x4b88ef){return db[_0xde8f('0x12')]['findAll']({'where':_0x51746d[_0xde8f('0x13')]?_0x51746d[_0xde8f('0x13')][_0xde8f('0x1c')]||null:null,'attributes':_0x51746d['options']?_0x51746d['options'][_0xde8f('0x15')]||null:null,'limit':0x1,'order':_0x51746d[_0xde8f('0x13')]?_0x51746d[_0xde8f('0x13')][_0xde8f('0x29')]||null:null,'group':db[_0xde8f('0x12')][_0xde8f('0x34')],'transaction':_0x4b88ef,'lock':_0x4b88ef['LOCK'][_0xde8f('0x2b')],'include':_0x51746d[_0xde8f('0x13')]?_0x51746d[_0xde8f('0x13')][_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x51746d['options'][_0xde8f('0x17')],function(_0xe8d3a6){return{'model':db[_0xe8d3a6[_0xde8f('0x19')]],'as':_0xe8d3a6['as'],'attributes':_0xe8d3a6[_0xde8f('0x15')],'include':_0xe8d3a6['include']?_[_0xde8f('0x18')](_0xe8d3a6['include'],function(_0x5acda5){return{'model':db[_0x5acda5[_0xde8f('0x19')]],'as':_0x5acda5['as'],'attributes':_0x5acda5[_0xde8f('0x15')],'include':_0x5acda5[_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x5acda5[_0xde8f('0x17')],function(_0x5926f2){return{'model':db[_0x5926f2['model']],'as':_0x5926f2['as'],'attributes':_0x5926f2[_0xde8f('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x482ebd){var _0xfcd083=[];for(var _0x4447e3=0x0;_0x4447e3<_0x482ebd[_0xde8f('0x33')];_0x4447e3+=0x1){_0xfcd083[_0xde8f('0x35')](_0x482ebd[_0x4447e3][_0xde8f('0x20')](_0x51746d['body'],{'transaction':_0x4b88ef}));}return BPromise['all'](_0xfcd083);});})[_0xde8f('0x7')](function(_0x28e2c1){logger[_0xde8f('0x8')]('GetContactRecallMe',_0x51746d);logger[_0xde8f('0xa')](_0xde8f('0x43'),_0x51746d,JSON['stringify'](_0x28e2c1));_0x28c875(_0x28e2c1);})[_0xde8f('0x1a')](function(_0x573432){logger['error'](_0xde8f('0x43'),_0x573432[_0xde8f('0xf')],_0x51746d);_0x4df3ac(_0x39123a[_0xde8f('0xd')](0x1f4,_0x573432[_0xde8f('0xf')]));});});});};exports[_0xde8f('0x44')]=function(_0x40e6c1){var _0x5bfbd6=this;return new Promise(function(_0x1f2a45,_0x224442){db[_0xde8f('0x2c')]['describe']()[_0xde8f('0x7')](function(_0x1602b3){return db['CmHopper']['findAll']({'raw':_0x40e6c1[_0xde8f('0x13')]?_0x40e6c1[_0xde8f('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x40e6c1[_0xde8f('0x13')]?_0x40e6c1['options'][_0xde8f('0x1c')]||null:null,'attributes':_0x40e6c1['options']?_0x40e6c1['options'][_0xde8f('0x15')]||null:null,'limit':_0x40e6c1[_0xde8f('0x13')]?_0x40e6c1[_0xde8f('0x13')][_0xde8f('0x16')]||null:null,'include':_0x40e6c1['options']?_0x40e6c1[_0xde8f('0x13')][_0xde8f('0x17')]?_[_0xde8f('0x18')](_0x40e6c1[_0xde8f('0x13')][_0xde8f('0x17')],function(_0x1ec87d){return{'model':db[_0x1ec87d['model']],'as':_0x1ec87d['as'],'attributes':_0x1ec87d['as']===_0xde8f('0x2d')?_[_0xde8f('0x2e')](_0x1602b3):_0x1ec87d['attributes'],'include':_0x1ec87d[_0xde8f('0x17')]?_['map'](_0x1ec87d['include'],function(_0x3fd4ab){return{'model':db[_0x3fd4ab[_0xde8f('0x19')]],'as':_0x3fd4ab['as'],'attributes':_0x3fd4ab[_0xde8f('0x15')],'include':_0x3fd4ab[_0xde8f('0x17')]?_['map'](_0x3fd4ab['include'],function(_0x121f1e){return{'model':db[_0x121f1e['model']],'as':_0x121f1e['as'],'attributes':_0x121f1e[_0xde8f('0x15')]};}):[]};}):[]};}):[]:[]})[_0xde8f('0x7')](function(_0x3f3a28){logger[_0xde8f('0x8')](_0xde8f('0x11'),_0x40e6c1);logger[_0xde8f('0xa')](_0xde8f('0x11'),_0x40e6c1,JSON[_0xde8f('0xc')](_0x3f3a28));_0x1f2a45(_0x3f3a28);})[_0xde8f('0x1a')](function(_0x5f5550){logger[_0xde8f('0xd')]('GetCmHopper',_0x5f5550[_0xde8f('0xf')],_0x40e6c1);_0x224442(_0x5bfbd6['error'](0x1f4,_0x5f5550[_0xde8f('0xf')]));});});});};exports[_0xde8f('0x45')]=function(_0x4c2f01){var _0x4c5436=this;return new Promise(function(_0x502540,_0x3be69f){return db['CmContact'][_0xde8f('0x46')]({'raw':!![],'where':{'phone':_0x4c2f01['options'][_0xde8f('0x1c')][_0xde8f('0x47')]},'attributes':['id',_0xde8f('0x48')],'order':[['id',_0xde8f('0x49')]]})[_0xde8f('0x7')](function(_0x2d9668){logger[_0xde8f('0x8')]('getContactByPhone',_0x4c2f01);logger[_0xde8f('0xa')](_0xde8f('0x4a'),_0x4c2f01,JSON[_0xde8f('0xc')](_0x2d9668));_0x502540(_0x2d9668);})['catch'](function(_0x160dae){logger[_0xde8f('0xd')](_0xde8f('0x4a'),_0x160dae['message'],_0x4c2f01);_0x3be69f(_0x4c5436[_0xde8f('0xd')](0x1f4,_0x160dae['message']));});});};exports['ResetActiveCalls']=function(_0x321849){var _0x7b1b91=this;return new Promise(function(_0x4b76d3,_0x2b1a3f){return db[_0xde8f('0x26')][_0xde8f('0x27')](function(_0x27ad45){return db[_0xde8f('0x12')][_0xde8f('0x20')]({'active':![]},{'where':{},'transaction':_0x27ad45})['then'](function(_0x5a45cc){logger['info'](_0xde8f('0x4b'),_0x321849);logger[_0xde8f('0xa')](_0xde8f('0x4b'),_0x321849,JSON[_0xde8f('0xc')](_0x5a45cc));_0x4b76d3(_0x5a45cc);})[_0xde8f('0x1a')](function(_0x760b71){logger['error'](_0xde8f('0x4b'),_0x760b71[_0xde8f('0xf')],_0x321849);_0x2b1a3f(_0x7b1b91[_0xde8f('0xd')](0x1f4,_0x760b71[_0xde8f('0xf')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x210fa5){var _0x4c0385=this;var _0x4803d8=_0x210fa5['body'][_0xde8f('0x1c')][_0xde8f('0x4c')];var _0x20cbb0=_0x210fa5[_0xde8f('0x1e')][_0xde8f('0x1c')][_0xde8f('0x4d')];return new Promise(function(_0x4b1ef2,_0x207c67){return db[_0xde8f('0x12')][_0xde8f('0x28')]({'where':{'voiceQueueId':_0x4803d8,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0xde8f('0x3e')](_0xde8f('0x4e')+_0x20cbb0+'\x20MINUTE')}},'include':[{'model':db[_0xde8f('0x2c')],'as':_0xde8f('0x2d')},{'model':db[_0xde8f('0x2f')],'as':'Agent','attributes':['id','name',_0xde8f('0x32')]},{'model':db[_0xde8f('0x4f')],'as':_0xde8f('0x50')}]})[_0xde8f('0x7')](function(_0x29a84d){return db[_0xde8f('0x26')][_0xde8f('0x27')](function(_0x197dca){return db['CmHopper'][_0xde8f('0x20')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4803d8,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xde8f('0x26')]['literal'](_0xde8f('0x4e')+_0x20cbb0+_0xde8f('0x51'))}},'transaction':_0x197dca})['then'](function(_0x262074){_0x4b1ef2(_0x29a84d);})[_0xde8f('0x1a')](function(_0x4bfc8e){logger[_0xde8f('0xd')](_0xde8f('0x52'),_0x4bfc8e[_0xde8f('0xf')],_0x210fa5);_0x207c67(validateExpressRequest);});});})[_0xde8f('0x1a')](function(_0x3bf311){logger[_0xde8f('0xd')](_0xde8f('0x52'),_0x3bf311['message'],_0x210fa5);_0x207c67(_0x4c0385[_0xde8f('0xd')](0x1f4,_0x3bf311['message']));});});}; \ No newline at end of file +var _0xa5a2=['UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','CmContact','describe','transaction','order','Contact','keys','User','Agent','voicePause','length','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','sequelize','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','LOCK','UPDATE','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueId','\x20MINUTE','name','NOW()\x20+\x20INTERVAL\x20','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','model','map','ShowCmHopper','find','debug','CreateCmHopper','create','update','body'];(function(_0x50573a,_0x5c62a6){var _0x59c394=function(_0x1914ba){while(--_0x1914ba){_0x50573a['push'](_0x50573a['shift']());}};_0x59c394(++_0x5c62a6);}(_0xa5a2,0x8d));var _0x2a5a=function(_0x1f35b0,_0x184f54){_0x1f35b0=_0x1f35b0-0x0;var _0x1607b0=_0xa5a2[_0x1f35b0];return _0x1607b0;};'use strict';var _=require(_0x2a5a('0x0'));var util=require(_0x2a5a('0x1'));var moment=require(_0x2a5a('0x2'));var BPromise=require(_0x2a5a('0x3'));var rs=require(_0x2a5a('0x4'));var fs=require('fs');var Redis=require(_0x2a5a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a5a('0x6'));var logger=require(_0x2a5a('0x7'))('rpc');var config=require(_0x2a5a('0x8'));var jayson=require(_0x2a5a('0x9'));const {validateExpressRequest}=require(_0x2a5a('0xa'));var client=jayson[_0x2a5a('0xb')][_0x2a5a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x329884,_0x301482,_0x5f2fa4){return new BPromise(function(_0x717f6f,_0x5a477a){return client['request'](_0x329884,_0x5f2fa4)[_0x2a5a('0xd')](function(_0x2220a2){logger[_0x2a5a('0xe')](_0x2a5a('0xf'),_0x301482,_0x2a5a('0x10'));logger['debug'](_0x2a5a('0x11'),_0x301482,_0x2a5a('0x10'),JSON[_0x2a5a('0x12')](_0x2220a2));if(_0x2220a2[_0x2a5a('0x13')]){if(_0x2220a2['error'][_0x2a5a('0x14')]===0x1f4){logger['error'](_0x2a5a('0xf'),_0x301482,_0x2220a2[_0x2a5a('0x13')]['message']);return _0x5a477a(_0x2220a2[_0x2a5a('0x13')][_0x2a5a('0x15')]);}logger[_0x2a5a('0x13')](_0x2a5a('0xf'),_0x301482,_0x2220a2[_0x2a5a('0x13')][_0x2a5a('0x15')]);return _0x717f6f(_0x2220a2[_0x2a5a('0x13')][_0x2a5a('0x15')]);}else{logger[_0x2a5a('0xe')](_0x2a5a('0xf'),_0x301482,'request\x20sent');_0x717f6f(_0x2220a2['result'][_0x2a5a('0x15')]);}})[_0x2a5a('0x16')](function(_0x147653){logger[_0x2a5a('0x13')]('CmHopper,\x20%s,\x20%s',_0x301482,_0x147653);_0x5a477a(_0x147653);});});}exports[_0x2a5a('0x17')]=function(_0x47c9bd){var _0x376ca7=this;return new Promise(function(_0x2e1807,_0x898328){return db[_0x2a5a('0x18')][_0x2a5a('0x19')]({'raw':_0x47c9bd[_0x2a5a('0x1a')]?_0x47c9bd['options'][_0x2a5a('0x1b')]===undefined?!![]:![]:!![],'where':_0x47c9bd[_0x2a5a('0x1a')]?_0x47c9bd[_0x2a5a('0x1a')][_0x2a5a('0x1c')]||null:null,'attributes':_0x47c9bd[_0x2a5a('0x1a')]?_0x47c9bd['options'][_0x2a5a('0x1d')]||null:null,'limit':_0x47c9bd[_0x2a5a('0x1a')]?_0x47c9bd[_0x2a5a('0x1a')][_0x2a5a('0x1e')]||null:null,'include':_0x47c9bd[_0x2a5a('0x1a')]?_0x47c9bd[_0x2a5a('0x1a')][_0x2a5a('0x1f')]?_['map'](_0x47c9bd[_0x2a5a('0x1a')][_0x2a5a('0x1f')],function(_0x2aeefc){return{'model':db[_0x2aeefc[_0x2a5a('0x20')]],'as':_0x2aeefc['as'],'attributes':_0x2aeefc[_0x2a5a('0x1d')],'include':_0x2aeefc['include']?_[_0x2a5a('0x21')](_0x2aeefc[_0x2a5a('0x1f')],function(_0xe1563e){return{'model':db[_0xe1563e[_0x2a5a('0x20')]],'as':_0xe1563e['as'],'attributes':_0xe1563e[_0x2a5a('0x1d')],'include':_0xe1563e[_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0xe1563e['include'],function(_0x3f125e){return{'model':db[_0x3f125e[_0x2a5a('0x20')]],'as':_0x3f125e['as'],'attributes':_0x3f125e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a5a('0xd')](function(_0xcffc1c){logger[_0x2a5a('0xe')](_0x2a5a('0x17'),_0x47c9bd);logger['debug'](_0x2a5a('0x17'),_0x47c9bd,JSON['stringify'](_0xcffc1c));_0x2e1807(_0xcffc1c);})[_0x2a5a('0x16')](function(_0x60983){logger[_0x2a5a('0x13')](_0x2a5a('0x17'),_0x60983[_0x2a5a('0x15')],_0x47c9bd);_0x898328(_0x376ca7[_0x2a5a('0x13')](0x1f4,_0x60983[_0x2a5a('0x15')]));});});};exports[_0x2a5a('0x22')]=function(_0x1a16fe){var _0x28cd47=this;return new Promise(function(_0x3f7bc3,_0xf7d9b2){return db['CmHopper'][_0x2a5a('0x23')]({'raw':_0x1a16fe[_0x2a5a('0x1a')]?_0x1a16fe['options'][_0x2a5a('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a16fe[_0x2a5a('0x1a')]?_0x1a16fe['options'][_0x2a5a('0x1c')]||null:null,'attributes':_0x1a16fe[_0x2a5a('0x1a')]?_0x1a16fe[_0x2a5a('0x1a')]['attributes']||null:null,'include':_0x1a16fe[_0x2a5a('0x1a')]?_0x1a16fe[_0x2a5a('0x1a')][_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x1a16fe[_0x2a5a('0x1a')][_0x2a5a('0x1f')],function(_0x4e11c7){return{'model':db[_0x4e11c7[_0x2a5a('0x20')]],'as':_0x4e11c7['as'],'attributes':_0x4e11c7[_0x2a5a('0x1d')],'include':_0x4e11c7['include']?_[_0x2a5a('0x21')](_0x4e11c7[_0x2a5a('0x1f')],function(_0x372fa7){return{'model':db[_0x372fa7['model']],'as':_0x372fa7['as'],'attributes':_0x372fa7[_0x2a5a('0x1d')],'include':_0x372fa7[_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x372fa7[_0x2a5a('0x1f')],function(_0x5242df){return{'model':db[_0x5242df[_0x2a5a('0x20')]],'as':_0x5242df['as'],'attributes':_0x5242df[_0x2a5a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2a5a('0xd')](function(_0x2f62ba){logger[_0x2a5a('0xe')](_0x2a5a('0x22'),_0x1a16fe);logger[_0x2a5a('0x24')](_0x2a5a('0x22'),_0x1a16fe,JSON[_0x2a5a('0x12')](_0x2f62ba));_0x3f7bc3(_0x2f62ba);})[_0x2a5a('0x16')](function(_0xac88a3){logger[_0x2a5a('0x13')](_0x2a5a('0x22'),_0xac88a3[_0x2a5a('0x15')],_0x1a16fe);_0xf7d9b2(_0x28cd47[_0x2a5a('0x13')](0x1f4,_0xac88a3['message']));});});};exports[_0x2a5a('0x25')]=function(_0x275e35){var _0xbd9a5c=this;return new Promise(function(_0x2d1d16,_0x2e8093){return db[_0x2a5a('0x18')][_0x2a5a('0x26')](_0x275e35['body'],{'raw':_0x275e35['options']?_0x275e35[_0x2a5a('0x1a')][_0x2a5a('0x1b')]===undefined?!![]:![]:!![]})[_0x2a5a('0xd')](function(_0x5e28dc){logger[_0x2a5a('0xe')](_0x2a5a('0x25'),_0x275e35);logger['debug']('CreateCmHopper',_0x275e35,JSON[_0x2a5a('0x12')](_0x5e28dc));_0x2d1d16(_0x5e28dc);})['catch'](function(_0x1da112){logger['error'](_0x2a5a('0x25'),_0x1da112[_0x2a5a('0x15')],_0x275e35);_0x2e8093(_0xbd9a5c['error'](0x1f4,_0x1da112[_0x2a5a('0x15')]));});});};exports['UpdateCmHopper']=function(_0x3b1ff2){var _0x5cae52=this;return new Promise(function(_0x4f97ea,_0x45e96b){return db[_0x2a5a('0x18')][_0x2a5a('0x27')](_0x3b1ff2[_0x2a5a('0x28')],{'raw':_0x3b1ff2[_0x2a5a('0x1a')]?_0x3b1ff2['options'][_0x2a5a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b1ff2[_0x2a5a('0x1a')]?_0x3b1ff2[_0x2a5a('0x1a')][_0x2a5a('0x1c')]||null:null,'attributes':_0x3b1ff2[_0x2a5a('0x1a')]?_0x3b1ff2[_0x2a5a('0x1a')][_0x2a5a('0x1d')]||null:null,'limit':_0x3b1ff2[_0x2a5a('0x1a')]?_0x3b1ff2[_0x2a5a('0x1a')][_0x2a5a('0x1e')]||null:null})[_0x2a5a('0xd')](function(_0x272320){logger[_0x2a5a('0xe')](_0x2a5a('0x29'),_0x3b1ff2);logger[_0x2a5a('0xe')](_0x2a5a('0x2a'),JSON['stringify'](_0x3b1ff2[_0x2a5a('0x1a')][_0x2a5a('0x1c')]),_0x3b1ff2[_0x2a5a('0x28')][_0x2a5a('0x2b')]);logger[_0x2a5a('0x24')](_0x2a5a('0x29'),_0x3b1ff2,JSON['stringify'](_0x272320));_0x4f97ea(_0x272320);})[_0x2a5a('0x16')](function(_0x471e85){logger[_0x2a5a('0x13')]('UpdateCmHopper',_0x471e85['message'],_0x3b1ff2);_0x45e96b(_0x5cae52[_0x2a5a('0x13')](0x1f4,_0x471e85[_0x2a5a('0x15')]));});});};exports['DestroyCmHopper']=function(_0x49f295){var _0x5a60f2=this;return new Promise(function(_0x350e84,_0x4f752c){return db[_0x2a5a('0x18')]['destroy']({'where':_0x49f295['options']?_0x49f295[_0x2a5a('0x1a')]['where']||null:null})['then'](function(_0x24b3ce){logger['info'](_0x2a5a('0x2c'),_0x49f295);logger[_0x2a5a('0x24')]('DestroyCmHopper',_0x49f295,JSON['stringify'](_0x24b3ce));_0x350e84(_0x24b3ce);})[_0x2a5a('0x16')](function(_0x10d2e4){logger['error']('DestroyCmHopper',_0x10d2e4[_0x2a5a('0x15')],_0x49f295);_0x4f752c(_0x5a60f2[_0x2a5a('0x13')](0x1f4,_0x10d2e4[_0x2a5a('0x15')]));});});};exports['GetContactDialer']=function(_0x249e61){var _0x4ac98c=this;return new Promise(function(_0x55d028,_0x3169a5){return db[_0x2a5a('0x2d')][_0x2a5a('0x2e')]()[_0x2a5a('0xd')](function(_0x3db010){return db['sequelize'][_0x2a5a('0x2f')](function(_0x5a28b0){return db[_0x2a5a('0x18')]['findAll']({'where':_0x249e61['options']?_0x249e61['options'][_0x2a5a('0x1c')]||null:null,'attributes':_0x249e61[_0x2a5a('0x1a')]?_0x249e61[_0x2a5a('0x1a')][_0x2a5a('0x1d')]||null:null,'limit':_0x249e61[_0x2a5a('0x1a')]?_0x249e61[_0x2a5a('0x1a')][_0x2a5a('0x1e')]||null:null,'order':_0x249e61[_0x2a5a('0x1a')]?_0x249e61['options'][_0x2a5a('0x30')]||null:null,'transaction':_0x5a28b0,'lock':_0x5a28b0['LOCK']['UPDATE'],'include':[{'model':db[_0x2a5a('0x2d')],'as':_0x2a5a('0x31'),'attributes':_[_0x2a5a('0x32')](_0x3db010)},{'model':db[_0x2a5a('0x33')],'as':_0x2a5a('0x34'),'attributes':['id','name',_0x2a5a('0x35')]}]})[_0x2a5a('0xd')](function(_0x5f3a46){var _0x3992f4=[];var _0x1c7c61=[];for(var _0x299dd0=0x0;_0x299dd0<_0x5f3a46[_0x2a5a('0x36')];_0x299dd0+=0x1){var _0x54c3ca=_0x5f3a46[_0x299dd0]['UserId'];if(_0x54c3ca===null){_0x3992f4[_0x2a5a('0x37')](_0x5f3a46[_0x299dd0]['update'](_0x249e61['body'],{'transaction':_0x5a28b0}));}else if(!_0x1c7c61[_0x2a5a('0x38')](_0x54c3ca)){_0x1c7c61[_0x2a5a('0x37')](_0x54c3ca);_0x3992f4['push'](_0x5f3a46[_0x299dd0][_0x2a5a('0x27')](_0x249e61[_0x2a5a('0x28')],{'transaction':_0x5a28b0}));}}return BPromise[_0x2a5a('0x39')](_0x3992f4);});})[_0x2a5a('0xd')](function(_0x2dac43){logger[_0x2a5a('0xe')]('GetContactDialer',_0x249e61);if(_0x2dac43[_0x2a5a('0x36')]>0x0){logger[_0x2a5a('0xe')](_0x2a5a('0x3a'),_0x2dac43[0x0]['dataValues']['id'],_0x2dac43[0x0][_0x2a5a('0x3b')][_0x2a5a('0x3c')],_0x2dac43[0x0][_0x2a5a('0x3b')][_0x2a5a('0x2b')]);}logger[_0x2a5a('0x24')](_0x2a5a('0x3d'),_0x249e61,JSON[_0x2a5a('0x12')](_0x2dac43));_0x55d028(_0x2dac43);})['catch'](function(_0xdb07e3){logger[_0x2a5a('0x13')](_0x2a5a('0x3d'),_0xdb07e3['message'],_0x249e61);_0x3169a5(_0x4ac98c[_0x2a5a('0x13')](0x1f4,_0xdb07e3[_0x2a5a('0x15')]));});});});};exports[_0x2a5a('0x3e')]=function(_0xde5485){var _0x4e3ba2=this;return new Promise(function(_0x1fa651,_0x9fb1e7){return db['sequelize'][_0x2a5a('0x2f')](function(_0x37c5ae){return db[_0x2a5a('0x3f')][_0x2a5a('0x26')](_0xde5485[_0x2a5a('0x28')],{'raw':_0xde5485['options']?_0xde5485[_0x2a5a('0x1a')][_0x2a5a('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x37c5ae})[_0x2a5a('0xd')](function(){logger['info'](_0x2a5a('0x40'),JSON[_0x2a5a('0x12')](_0xde5485[_0x2a5a('0x1a')]['where']),_0xde5485[_0x2a5a('0x1a')][_0x2a5a('0x1c')]['active']);return db[_0x2a5a('0x18')][_0x2a5a('0x41')]({'where':_0xde5485['options']?_0xde5485[_0x2a5a('0x1a')][_0x2a5a('0x1c')]||null:null,'transaction':_0x37c5ae});});})[_0x2a5a('0xd')](function(_0x555338){logger[_0x2a5a('0xe')]('MoveContactManagedDialer',_0xde5485);logger[_0x2a5a('0x24')](_0x2a5a('0x3e'),_0xde5485,JSON[_0x2a5a('0x12')](_0x555338));_0x1fa651(_0x555338);})['catch'](function(_0x5a6e3b){logger['error'](_0x2a5a('0x3e'),_0x5a6e3b['message'],_0xde5485);_0x9fb1e7(_0x4e3ba2['error'](0x1f4,_0x5a6e3b[_0x2a5a('0x15')]));});});};exports['CountReScheduled']=function(_0x9f7d4){var _0x4bc5a6=this;return new Promise(function(_0x20ffc6,_0x4e1603){return db[_0x2a5a('0x18')][_0x2a5a('0x19')]({'raw':_0x9f7d4[_0x2a5a('0x1a')]?_0x9f7d4['options']['raw']===undefined?!![]:![]:!![],'where':_0x9f7d4[_0x2a5a('0x1a')]?_0x9f7d4['options'][_0x2a5a('0x1c')]||null:null,'attributes':[[db[_0x2a5a('0x42')]['fn'](_0x2a5a('0x43'),db[_0x2a5a('0x42')]['fn']('IF',db['sequelize'][_0x2a5a('0x44')](_0x2a5a('0x45')+util['format'](_0x2a5a('0x46'),moment()[_0x2a5a('0x47')](_0x2a5a('0x48')))+_0x2a5a('0x49')))),_0x2a5a('0x4a')]]})[_0x2a5a('0xd')](function(_0x2c8b12){logger[_0x2a5a('0xe')]('CountReScheduled',_0x9f7d4);logger[_0x2a5a('0x24')](_0x2a5a('0x4b'),_0x9f7d4,JSON[_0x2a5a('0x12')](_0x2c8b12));_0x20ffc6(_0x2c8b12);})[_0x2a5a('0x16')](function(_0x2221b1){logger['error'](_0x2a5a('0x4b'),_0x2221b1[_0x2a5a('0x15')],_0x9f7d4);_0x4e1603(_0x4bc5a6[_0x2a5a('0x13')](0x1f4,_0x2221b1[_0x2a5a('0x15')]));});});};exports[_0x2a5a('0x4c')]=function(_0x1a8cff){var _0x5d58da=this;return new Promise(function(_0x4f24b3,_0x391e39){return db[_0x2a5a('0x2d')]['describe']()[_0x2a5a('0xd')](function(_0x8f6bab){return db[_0x2a5a('0x42')][_0x2a5a('0x2f')](function(_0x40e20e){return db[_0x2a5a('0x18')][_0x2a5a('0x19')]({'where':_0x1a8cff[_0x2a5a('0x1a')]?_0x1a8cff['options'][_0x2a5a('0x1c')]||null:null,'attributes':_0x1a8cff[_0x2a5a('0x1a')]?_0x1a8cff['options'][_0x2a5a('0x1d')]||null:null,'limit':0x1,'order':_0x1a8cff[_0x2a5a('0x1a')]?_0x1a8cff[_0x2a5a('0x1a')]['order']||null:null,'group':db['CmHopper'][_0x2a5a('0x4d')],'transaction':_0x40e20e,'lock':_0x40e20e[_0x2a5a('0x4e')][_0x2a5a('0x4f')],'include':_0x1a8cff[_0x2a5a('0x1a')]?_0x1a8cff[_0x2a5a('0x1a')][_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x1a8cff[_0x2a5a('0x1a')][_0x2a5a('0x1f')],function(_0x166130){return{'model':db[_0x166130[_0x2a5a('0x20')]],'as':_0x166130['as'],'attributes':_0x166130[_0x2a5a('0x1d')],'include':_0x166130[_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x166130[_0x2a5a('0x1f')],function(_0x29f6f4){return{'model':db[_0x29f6f4[_0x2a5a('0x20')]],'as':_0x29f6f4['as'],'attributes':_0x29f6f4[_0x2a5a('0x1d')],'include':_0x29f6f4[_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x29f6f4[_0x2a5a('0x1f')],function(_0x5bffa0){return{'model':db[_0x5bffa0[_0x2a5a('0x20')]],'as':_0x5bffa0['as'],'attributes':_0x5bffa0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cbb6d){var _0x3c84df=[];for(var _0x14456b=0x0;_0x14456b<_0x2cbb6d['length'];_0x14456b+=0x1){_0x3c84df[_0x2a5a('0x37')](_0x2cbb6d[_0x14456b]['update'](_0x1a8cff[_0x2a5a('0x28')],{'transaction':_0x40e20e}));}return BPromise[_0x2a5a('0x39')](_0x3c84df);});})[_0x2a5a('0xd')](function(_0x55f2af){logger['info'](_0x2a5a('0x4c'),_0x1a8cff);logger[_0x2a5a('0x24')](_0x2a5a('0x4c'),_0x1a8cff,JSON[_0x2a5a('0x12')](_0x55f2af));_0x4f24b3(_0x55f2af);})[_0x2a5a('0x16')](function(_0x24d53b){logger[_0x2a5a('0x13')](_0x2a5a('0x4c'),_0x24d53b[_0x2a5a('0x15')],_0x1a8cff);_0x391e39(_0x5d58da[_0x2a5a('0x13')](0x1f4,_0x24d53b[_0x2a5a('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x442495){var _0x23864d=this;return new Promise(function(_0x226d56,_0x34493d){db[_0x2a5a('0x2d')][_0x2a5a('0x2e')]()['then'](function(_0x480d70){return db[_0x2a5a('0x18')][_0x2a5a('0x19')]({'raw':_0x442495[_0x2a5a('0x1a')]?_0x442495[_0x2a5a('0x1a')][_0x2a5a('0x1b')]===undefined?!![]:![]:!![],'where':_0x442495[_0x2a5a('0x1a')]?_0x442495[_0x2a5a('0x1a')]['where']||null:null,'attributes':_0x442495['options']?_0x442495[_0x2a5a('0x1a')][_0x2a5a('0x1d')]||null:null,'limit':_0x442495[_0x2a5a('0x1a')]?_0x442495[_0x2a5a('0x1a')][_0x2a5a('0x1e')]||null:null,'include':_0x442495[_0x2a5a('0x1a')]?_0x442495[_0x2a5a('0x1a')]['include']?_[_0x2a5a('0x21')](_0x442495[_0x2a5a('0x1a')][_0x2a5a('0x1f')],function(_0x29d51f){return{'model':db[_0x29d51f[_0x2a5a('0x20')]],'as':_0x29d51f['as'],'attributes':_0x29d51f['as']==='Contact'?_['keys'](_0x480d70):_0x29d51f['attributes'],'include':_0x29d51f['include']?_['map'](_0x29d51f[_0x2a5a('0x1f')],function(_0x5e5916){return{'model':db[_0x5e5916[_0x2a5a('0x20')]],'as':_0x5e5916['as'],'attributes':_0x5e5916['attributes'],'include':_0x5e5916[_0x2a5a('0x1f')]?_[_0x2a5a('0x21')](_0x5e5916[_0x2a5a('0x1f')],function(_0x1f9ce8){return{'model':db[_0x1f9ce8[_0x2a5a('0x20')]],'as':_0x1f9ce8['as'],'attributes':_0x1f9ce8[_0x2a5a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2a5a('0xd')](function(_0x5b1c39){logger['info'](_0x2a5a('0x17'),_0x442495);logger[_0x2a5a('0x24')](_0x2a5a('0x17'),_0x442495,JSON[_0x2a5a('0x12')](_0x5b1c39));_0x226d56(_0x5b1c39);})[_0x2a5a('0x16')](function(_0x481559){logger[_0x2a5a('0x13')](_0x2a5a('0x17'),_0x481559['message'],_0x442495);_0x34493d(_0x23864d[_0x2a5a('0x13')](0x1f4,_0x481559[_0x2a5a('0x15')]));});});});};exports[_0x2a5a('0x50')]=function(_0x5dbc99){var _0x2d8e2a=this;return new Promise(function(_0x2d4f36,_0x83aec4){return db[_0x2a5a('0x2d')][_0x2a5a('0x51')]({'raw':!![],'where':{'phone':_0x5dbc99[_0x2a5a('0x1a')][_0x2a5a('0x1c')][_0x2a5a('0x52')]},'attributes':['id',_0x2a5a('0x53')],'order':[['id','DESC']]})[_0x2a5a('0xd')](function(_0x18ad37){logger[_0x2a5a('0xe')](_0x2a5a('0x54'),_0x5dbc99);logger[_0x2a5a('0x24')](_0x2a5a('0x54'),_0x5dbc99,JSON['stringify'](_0x18ad37));_0x2d4f36(_0x18ad37);})[_0x2a5a('0x16')](function(_0x9ff8a4){logger['error'](_0x2a5a('0x54'),_0x9ff8a4['message'],_0x5dbc99);_0x83aec4(_0x2d8e2a['error'](0x1f4,_0x9ff8a4['message']));});});};exports['ResetActiveCalls']=function(_0x1e4aa0){var _0x4c2f54=this;return new Promise(function(_0x20d79f,_0x47eae2){return db['sequelize']['transaction'](function(_0x5cb353){return db['CmHopper'][_0x2a5a('0x27')]({'active':![]},{'where':{},'transaction':_0x5cb353})[_0x2a5a('0xd')](function(_0x36a2bd){logger[_0x2a5a('0xe')](_0x2a5a('0x55'),_0x1e4aa0);logger[_0x2a5a('0x24')](_0x2a5a('0x55'),_0x1e4aa0,JSON[_0x2a5a('0x12')](_0x36a2bd));_0x20d79f(_0x36a2bd);})[_0x2a5a('0x16')](function(_0xc1fb03){logger[_0x2a5a('0x13')](_0x2a5a('0x55'),_0xc1fb03[_0x2a5a('0x15')],_0x1e4aa0);_0x47eae2(_0x4c2f54[_0x2a5a('0x13')](0x1f4,_0xc1fb03[_0x2a5a('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2c50bb){var _0x34bb1b=this;var _0x36d0ae=_0x2c50bb[_0x2a5a('0x28')][_0x2a5a('0x1c')][_0x2a5a('0x56')];var _0x46e136=_0x2c50bb['body'][_0x2a5a('0x1c')]['interval'];return new Promise(function(_0x565ee8,_0xfab293){return db[_0x2a5a('0x18')][_0x2a5a('0x19')]({'where':{'voiceQueueId':_0x36d0ae,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x2a5a('0x42')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x46e136+_0x2a5a('0x57'))}},'include':[{'model':db[_0x2a5a('0x2d')],'as':_0x2a5a('0x31')},{'model':db[_0x2a5a('0x33')],'as':'Agent','attributes':['id',_0x2a5a('0x58'),'voicePause']},{'model':db['CmList'],'as':'List'}]})[_0x2a5a('0xd')](function(_0x40e7ca){return db[_0x2a5a('0x42')]['transaction'](function(_0xba16af){return db[_0x2a5a('0x18')][_0x2a5a('0x27')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x36d0ae,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x2a5a('0x42')][_0x2a5a('0x44')](_0x2a5a('0x59')+_0x46e136+'\x20MINUTE')}},'transaction':_0xba16af})['then'](function(_0x37db10){_0x565ee8(_0x40e7ca);})[_0x2a5a('0x16')](function(_0x989a42){logger['error'](_0x2a5a('0x5a'),_0x989a42[_0x2a5a('0x15')],_0x2c50bb);_0xfab293(validateExpressRequest);});});})[_0x2a5a('0x16')](function(_0x423ba1){logger[_0x2a5a('0x13')](_0x2a5a('0x5a'),_0x423ba1[_0x2a5a('0x15')],_0x2c50bb);_0xfab293(_0x34bb1b[_0x2a5a('0x13')](0x1f4,_0x423ba1[_0x2a5a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8b16914..7378418 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 _0x656f=['describe','/opencontacts','getOpenContacts','/timezones','/:id','show','create','post','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x4ce6c9,_0x12a437){var _0x92d7ab=function(_0x154025){while(--_0x154025){_0x4ce6c9['push'](_0x4ce6c9['shift']());}};_0x92d7ab(++_0x12a437);}(_0x656f,0xc4));var _0xf656=function(_0x589cb0,_0x3fc39b){_0x589cb0=_0x589cb0-0x0;var _0x5cfba7=_0x656f[_0x589cb0];return _0x5cfba7;};'use strict';var multer=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var path=require(_0xf656('0x2'));var timeout=require(_0xf656('0x3'));var express=require(_0xf656('0x4'));var router=express[_0xf656('0x5')]();var fs_extra=require(_0xf656('0x6'));var auth=require(_0xf656('0x7'));var interaction=require(_0xf656('0x8'));var config=require(_0xf656('0x9'));var controller=require(_0xf656('0xa'));router[_0xf656('0xb')]('/',auth[_0xf656('0xc')](),controller[_0xf656('0xd')]);router[_0xf656('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf656('0xe')]);router[_0xf656('0xb')](_0xf656('0xf'),auth[_0xf656('0xc')](),controller[_0xf656('0x10')]);router[_0xf656('0xb')](_0xf656('0x11'),auth['isAuthenticated'](),controller['getTimezones']);router['get'](_0xf656('0x12'),auth[_0xf656('0xc')](),controller[_0xf656('0x13')]);router['post']('/',auth[_0xf656('0xc')](),controller[_0xf656('0x14')]);router[_0xf656('0x15')](_0xf656('0x16'),auth[_0xf656('0xc')](),controller[_0xf656('0x17')]);router[_0xf656('0x15')](_0xf656('0x18'),auth[_0xf656('0xc')](),controller[_0xf656('0x19')]);router[_0xf656('0x15')]('/previewrecall',auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0xf656('0x1a')](_0xf656('0x12'),auth[_0xf656('0xc')](),controller['update']);router[_0xf656('0x1b')](_0xf656('0x12'),auth[_0xf656('0xc')](),controller[_0xf656('0x1c')]);module[_0xf656('0x1d')]=router; \ No newline at end of file +var _0x3c7e=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','create','post','/preview','getPreview','/previewrecall','getPreviewRecall','update'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x3c7e,0xdb));var _0xe3c7=function(_0x535780,_0x5d5d47){_0x535780=_0x535780-0x0;var _0x1a03fb=_0x3c7e[_0x535780];return _0x1a03fb;};'use strict';var multer=require('multer');var util=require(_0xe3c7('0x0'));var path=require('path');var timeout=require(_0xe3c7('0x1'));var express=require(_0xe3c7('0x2'));var router=express[_0xe3c7('0x3')]();var fs_extra=require(_0xe3c7('0x4'));var auth=require(_0xe3c7('0x5'));var interaction=require(_0xe3c7('0x6'));var config=require(_0xe3c7('0x7'));var controller=require(_0xe3c7('0x8'));router[_0xe3c7('0x9')]('/',auth[_0xe3c7('0xa')](),controller[_0xe3c7('0xb')]);router[_0xe3c7('0x9')](_0xe3c7('0xc'),auth[_0xe3c7('0xa')](),controller[_0xe3c7('0xd')]);router[_0xe3c7('0x9')](_0xe3c7('0xe'),auth[_0xe3c7('0xa')](),controller[_0xe3c7('0xf')]);router[_0xe3c7('0x9')]('/timezones',auth['isAuthenticated'](),controller['getTimezones']);router[_0xe3c7('0x9')](_0xe3c7('0x10'),auth[_0xe3c7('0xa')](),controller['show']);router['post']('/',auth[_0xe3c7('0xa')](),controller[_0xe3c7('0x11')]);router[_0xe3c7('0x12')](_0xe3c7('0x13'),auth[_0xe3c7('0xa')](),controller[_0xe3c7('0x14')]);router[_0xe3c7('0x12')]('/timezone',auth[_0xe3c7('0xa')](),controller['getTimezone']);router['post'](_0xe3c7('0x15'),auth[_0xe3c7('0xa')](),controller[_0xe3c7('0x16')]);router['put'](_0xe3c7('0x10'),auth['isAuthenticated'](),controller[_0xe3c7('0x17')]);router[_0xe3c7('0x18')](_0xe3c7('0x10'),auth[_0xe3c7('0xa')](),controller[_0xe3c7('0x19')]);module[_0xe3c7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c0f437e..0f5fd36 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 _0xdc03=['INTEGER','moment','exports','STRING','contactListQueue'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xdc03,0x65));var _0x3dc0=function(_0xf95cdc,_0x351737){_0xf95cdc=_0xf95cdc-0x0;var _0x4bb9fd=_0xdc03[_0xf95cdc];return _0x4bb9fd;};'use strict';var moment=require(_0x3dc0('0x0'));var Sequelize=require('sequelize');module[_0x3dc0('0x1')]={'phone':{'type':Sequelize[_0x3dc0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3dc0('0x3')},'ListId':{'type':Sequelize[_0x3dc0('0x4')],'unique':_0x3dc0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x3dc0('0x4')],'unique':_0x3dc0('0x3')}}; \ No newline at end of file +var _0xaa00=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xaa00,0x1f4));var _0x0aa0=function(_0x1bc1fc,_0x88b458){_0x1bc1fc=_0x1bc1fc-0x0;var _0x27a860=_0xaa00[_0x1bc1fc];return _0x27a860;};'use strict';var moment=require(_0x0aa0('0x0'));var Sequelize=require(_0x0aa0('0x1'));module[_0x0aa0('0x2')]={'phone':{'type':Sequelize[_0x0aa0('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0aa0('0x4')],'unique':_0x0aa0('0x5')},'ListId':{'type':Sequelize[_0x0aa0('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x0aa0('0x4')],'unique':_0x0aa0('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ef82615..d4e1cb1 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 _0x570a=['find','describe','eml-format','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','includeAll','rows','catch','show','params','rawAttributes','include','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x570a,0x11e));var _0xa570=function(_0x1e48a7,_0x3a83b9){_0x1e48a7=_0x1e48a7-0x0;var _0x7dd01f=_0x570a[_0x1e48a7];return _0x7dd01f;};'use strict';var emlformat=require(_0xa570('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa570('0x1'));var moment=require(_0xa570('0x2'));var BPromise=require(_0xa570('0x3'));var Mustache=require('mustache');var util=require(_0xa570('0x4'));var path=require('path');var sox=require(_0xa570('0x5'));var csv=require(_0xa570('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa570('0x7'));var _=require('lodash');var squel=require(_0xa570('0x8'));var crypto=require('crypto');var jsforce=require(_0xa570('0x9'));var deskjs=require(_0xa570('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa570('0xb'));var Papa=require(_0xa570('0xc'));var Redis=require('ioredis');var authService=require(_0xa570('0xd'));var qs=require(_0xa570('0xe'));var as=require(_0xa570('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa570('0x10'));var utils=require('../../config/utils');var config=require(_0xa570('0x11'));var licenseUtil=require(_0xa570('0x12'));var db=require(_0xa570('0x13'))['db'];function respondWithStatusCode(_0x45bc7d,_0x53137d){_0x53137d=_0x53137d||0xcc;return function(_0x3aa72b){if(_0x3aa72b){return _0x45bc7d['sendStatus'](_0x53137d);}return _0x45bc7d[_0xa570('0x14')](_0x53137d)[_0xa570('0x15')]();};}function respondWithResult(_0x1dad20,_0xaf3d01){_0xaf3d01=_0xaf3d01||0xc8;return function(_0x1219cd){if(_0x1219cd){return _0x1dad20['status'](_0xaf3d01)['json'](_0x1219cd);}};}function respondWithFilteredResult(_0x1aad69,_0x307089){return function(_0x429e21){if(_0x429e21){var _0x14eb43=typeof _0x307089[_0xa570('0x16')]===_0xa570('0x17')&&typeof _0x307089[_0xa570('0x18')]===_0xa570('0x17');var _0x3bc465=_0x429e21['count'];var _0x2a6f60=_0x14eb43?0x0:_0x307089[_0xa570('0x16')];var _0x275dd7=_0x14eb43?_0x429e21['count']:_0x307089[_0xa570('0x16')]+_0x307089[_0xa570('0x18')];var _0x31103d;if(_0x275dd7>=_0x3bc465){_0x275dd7=_0x3bc465;_0x31103d=0xc8;}else{_0x31103d=0xce;}_0x1aad69[_0xa570('0x14')](_0x31103d);return _0x1aad69[_0xa570('0x19')](_0xa570('0x1a'),_0x2a6f60+'-'+_0x275dd7+'/'+_0x3bc465)[_0xa570('0x1b')](_0x429e21);}return null;};}function patchUpdates(_0x18851c){return function(_0x1931db){try{jsonpatch[_0xa570('0x1c')](_0x1931db,_0x18851c,!![]);}catch(_0x5bf798){return BPromise[_0xa570('0x1d')](_0x5bf798);}return _0x1931db[_0xa570('0x1e')]();};}function saveUpdates(_0x12fd40,_0x19ce3a){return function(_0x1efe7c){if(_0x1efe7c){return _0x1efe7c[_0xa570('0x1f')](_0x12fd40)[_0xa570('0x20')](function(_0x172dcd){return _0x172dcd;});}return null;};}function removeEntity(_0x4c3474,_0x27a5ac){return function(_0x2c9e0f){if(_0x2c9e0f){return _0x2c9e0f[_0xa570('0x21')]()[_0xa570('0x20')](function(){_0x4c3474[_0xa570('0x14')](0xcc)[_0xa570('0x15')]();});}};}function handleEntityNotFound(_0x3a0048,_0x490a81){return function(_0x429274){if(!_0x429274){_0x3a0048['sendStatus'](0x194);}return _0x429274;};}function handleError(_0x4773ab,_0x45155f){_0x45155f=_0x45155f||0x1f4;return function(_0x3440d2){logger[_0xa570('0x22')](_0x3440d2[_0xa570('0x23')]);if(_0x3440d2[_0xa570('0x24')]){delete _0x3440d2[_0xa570('0x24')];}_0x4773ab['status'](_0x45155f)[_0xa570('0x25')](_0x3440d2);};}exports[_0xa570('0x26')]=function(_0x573fee,_0x319d8f){var _0x35372c={},_0xb81a29={},_0x36bc1d={'count':0x0,'rows':[]};var _0x274632=_[_0xa570('0x27')](db[_0xa570('0x28')]['rawAttributes'],function(_0x5bbaa4){return{'name':_0x5bbaa4[_0xa570('0x29')],'type':_0x5bbaa4[_0xa570('0x2a')][_0xa570('0x2b')]};});_0xb81a29[_0xa570('0x2c')]=_[_0xa570('0x27')](_0x274632,_0xa570('0x24'));_0xb81a29[_0xa570('0x2d')]=_[_0xa570('0x2e')](_0x573fee[_0xa570('0x2d')]);_0xb81a29['filters']=_[_0xa570('0x2f')](_0xb81a29[_0xa570('0x2c')],_0xb81a29['query']);_0x35372c[_0xa570('0x30')]=_[_0xa570('0x2f')](_0xb81a29[_0xa570('0x2c')],qs[_0xa570('0x31')](_0x573fee[_0xa570('0x2d')]['fields']));_0x35372c['attributes']=_0x35372c[_0xa570('0x30')][_0xa570('0x32')]?_0x35372c[_0xa570('0x30')]:_0xb81a29[_0xa570('0x2c')];if(!_0x573fee[_0xa570('0x2d')][_0xa570('0x33')](_0xa570('0x34'))){_0x35372c[_0xa570('0x18')]=qs['limit'](_0x573fee[_0xa570('0x2d')]['limit']);_0x35372c[_0xa570('0x16')]=qs[_0xa570('0x16')](_0x573fee[_0xa570('0x2d')]['offset']);}_0x35372c[_0xa570('0x35')]=qs[_0xa570('0x36')](_0x573fee[_0xa570('0x2d')]['sort']);_0x35372c[_0xa570('0x37')]=qs[_0xa570('0x38')](_['pick'](_0x573fee[_0xa570('0x2d')],_0xb81a29[_0xa570('0x38')]),_0x274632);if(_0x573fee[_0xa570('0x2d')][_0xa570('0x39')]){_0x35372c[_0xa570('0x37')]=_[_0xa570('0x3a')](_0x35372c[_0xa570('0x37')],{'$or':_[_0xa570('0x27')](_0x274632,function(_0x1e6b62){if(_0x1e6b62[_0xa570('0x2a')]!=='VIRTUAL'){var _0x355110={};_0x355110[_0x1e6b62[_0xa570('0x24')]]={'$like':'%'+_0x573fee[_0xa570('0x2d')]['filter']+'%'};return _0x355110;}})});}_0x35372c=_[_0xa570('0x3a')]({},_0x35372c,_0x573fee[_0xa570('0x3b')]);var _0xf7093e={'where':_0x35372c[_0xa570('0x37')]};return db[_0xa570('0x28')]['count'](_0xf7093e)['then'](function(_0x3e80e8){_0x36bc1d[_0xa570('0x3c')]=_0x3e80e8;if(_0x573fee[_0xa570('0x2d')][_0xa570('0x3d')]){_0x35372c['include']=[{'all':!![]}];}return db[_0xa570('0x28')]['findAll'](_0x35372c);})[_0xa570('0x20')](function(_0x9fded2){_0x36bc1d[_0xa570('0x3e')]=_0x9fded2;return _0x36bc1d;})[_0xa570('0x20')](respondWithFilteredResult(_0x319d8f,_0x35372c))[_0xa570('0x3f')](handleError(_0x319d8f,null));};exports[_0xa570('0x40')]=function(_0x1bfc50,_0x57daa4){var _0x5aaf24={'raw':!![],'where':{'id':_0x1bfc50[_0xa570('0x41')]['id']}},_0x1c035f={};_0x1c035f['model']=_[_0xa570('0x2e')](db['CmHopperBlack'][_0xa570('0x42')]);_0x1c035f[_0xa570('0x2d')]=_[_0xa570('0x2e')](_0x1bfc50[_0xa570('0x2d')]);_0x1c035f[_0xa570('0x38')]=_[_0xa570('0x2f')](_0x1c035f[_0xa570('0x2c')],_0x1c035f[_0xa570('0x2d')]);_0x5aaf24[_0xa570('0x30')]=_[_0xa570('0x2f')](_0x1c035f[_0xa570('0x2c')],qs['fields'](_0x1bfc50['query']['fields']));_0x5aaf24[_0xa570('0x30')]=_0x5aaf24['attributes'][_0xa570('0x32')]?_0x5aaf24[_0xa570('0x30')]:_0x1c035f[_0xa570('0x2c')];if(_0x1bfc50[_0xa570('0x2d')]['includeAll']){_0x5aaf24[_0xa570('0x43')]=[{'all':!![]}];}_0x5aaf24=_['merge']({},_0x5aaf24,_0x1bfc50['options']);return db[_0xa570('0x28')]['find'](_0x5aaf24)[_0xa570('0x20')](handleEntityNotFound(_0x57daa4,null))[_0xa570('0x20')](respondWithResult(_0x57daa4,null))[_0xa570('0x3f')](handleError(_0x57daa4,null));};exports[_0xa570('0x1f')]=function(_0x45ea68,_0x4d9e32){if(_0x45ea68[_0xa570('0x44')]['id']){delete _0x45ea68['body']['id'];}return db[_0xa570('0x28')][_0xa570('0x45')]({'where':{'id':_0x45ea68['params']['id']}})['then'](handleEntityNotFound(_0x4d9e32,null))[_0xa570('0x20')](saveUpdates(_0x45ea68[_0xa570('0x44')],null))['then'](respondWithResult(_0x4d9e32,null))[_0xa570('0x3f')](handleError(_0x4d9e32,null));};exports[_0xa570('0x21')]=function(_0x423e85,_0x547576){return db['CmHopperBlack']['find']({'where':{'id':_0x423e85[_0xa570('0x41')]['id']}})[_0xa570('0x20')](handleEntityNotFound(_0x547576,null))[_0xa570('0x20')](removeEntity(_0x547576,null))[_0xa570('0x3f')](handleError(_0x547576,null));};exports[_0xa570('0x46')]=function(_0x52101a,_0x5bf527){return db[_0xa570('0x28')]['describe']()['then'](respondWithResult(_0x5bf527,null))[_0xa570('0x3f')](handleError(_0x5bf527,null));}; \ No newline at end of file +var _0xef96=['send','index','map','CmHopperBlack','fieldName','model','name','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x1ed46f,_0x7691d7){var _0x43b931=function(_0x5f2454){while(--_0x5f2454){_0x1ed46f['push'](_0x1ed46f['shift']());}};_0x43b931(++_0x7691d7);}(_0xef96,0x150));var _0x6ef9=function(_0x26dfda,_0x18576e){_0x26dfda=_0x26dfda-0x0;var _0x3f8f70=_0xef96[_0x26dfda];return _0x3f8f70;};'use strict';var emlformat=require(_0x6ef9('0x0'));var rimraf=require(_0x6ef9('0x1'));var zipdir=require(_0x6ef9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ef9('0x3'));var moment=require(_0x6ef9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ef9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6ef9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ef9('0x7'));var squel=require(_0x6ef9('0x8'));var crypto=require(_0x6ef9('0x9'));var jsforce=require(_0x6ef9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6ef9('0x6'));var querystring=require(_0x6ef9('0xb'));var Papa=require(_0x6ef9('0xc'));var Redis=require('ioredis');var authService=require(_0x6ef9('0xd'));var qs=require(_0x6ef9('0xe'));var as=require(_0x6ef9('0xf'));var hardwareService=require(_0x6ef9('0x10'));var logger=require(_0x6ef9('0x11'))(_0x6ef9('0x12'));var utils=require(_0x6ef9('0x13'));var config=require(_0x6ef9('0x14'));var licenseUtil=require(_0x6ef9('0x15'));var db=require(_0x6ef9('0x16'))['db'];function respondWithStatusCode(_0x3086f8,_0x75c45b){_0x75c45b=_0x75c45b||0xcc;return function(_0x10720e){if(_0x10720e){return _0x3086f8[_0x6ef9('0x17')](_0x75c45b);}return _0x3086f8[_0x6ef9('0x18')](_0x75c45b)[_0x6ef9('0x19')]();};}function respondWithResult(_0x1acea7,_0x2c4d56){_0x2c4d56=_0x2c4d56||0xc8;return function(_0x397560){if(_0x397560){return _0x1acea7[_0x6ef9('0x18')](_0x2c4d56)[_0x6ef9('0x1a')](_0x397560);}};}function respondWithFilteredResult(_0x47c395,_0x15fd68){return function(_0x4ac9e2){if(_0x4ac9e2){var _0x40566e=typeof _0x15fd68['offset']===_0x6ef9('0x1b')&&typeof _0x15fd68[_0x6ef9('0x1c')]===_0x6ef9('0x1b');var _0x2c7b38=_0x4ac9e2[_0x6ef9('0x1d')];var _0x4fd949=_0x40566e?0x0:_0x15fd68['offset'];var _0x21c44=_0x40566e?_0x4ac9e2[_0x6ef9('0x1d')]:_0x15fd68[_0x6ef9('0x1e')]+_0x15fd68[_0x6ef9('0x1c')];var _0x413571;if(_0x21c44>=_0x2c7b38){_0x21c44=_0x2c7b38;_0x413571=0xc8;}else{_0x413571=0xce;}_0x47c395[_0x6ef9('0x18')](_0x413571);return _0x47c395[_0x6ef9('0x1f')](_0x6ef9('0x20'),_0x4fd949+'-'+_0x21c44+'/'+_0x2c7b38)[_0x6ef9('0x1a')](_0x4ac9e2);}return null;};}function patchUpdates(_0x1bc8e5){return function(_0x1a7c7b){try{jsonpatch['apply'](_0x1a7c7b,_0x1bc8e5,!![]);}catch(_0xb2457f){return BPromise[_0x6ef9('0x21')](_0xb2457f);}return _0x1a7c7b['save']();};}function saveUpdates(_0x8fb5b8,_0x4a7b1b){return function(_0xda982e){if(_0xda982e){return _0xda982e[_0x6ef9('0x22')](_0x8fb5b8)[_0x6ef9('0x23')](function(_0x50c540){return _0x50c540;});}return null;};}function removeEntity(_0x3711c9,_0x24f88f){return function(_0x4a8fd6){if(_0x4a8fd6){return _0x4a8fd6[_0x6ef9('0x24')]()[_0x6ef9('0x23')](function(){_0x3711c9[_0x6ef9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b01a,_0x90d1ca){return function(_0x10aebd){if(!_0x10aebd){_0x24b01a[_0x6ef9('0x17')](0x194);}return _0x10aebd;};}function handleError(_0x2c7b59,_0x4430de){_0x4430de=_0x4430de||0x1f4;return function(_0x4184e4){logger[_0x6ef9('0x25')](_0x4184e4[_0x6ef9('0x26')]);if(_0x4184e4['name']){delete _0x4184e4['name'];}_0x2c7b59[_0x6ef9('0x18')](_0x4430de)[_0x6ef9('0x27')](_0x4184e4);};}exports[_0x6ef9('0x28')]=function(_0x21bfdf,_0x434f50){var _0x3d29e7={},_0x120d73={},_0x720173={'count':0x0,'rows':[]};var _0xd03dfa=_[_0x6ef9('0x29')](db[_0x6ef9('0x2a')]['rawAttributes'],function(_0x1a5b36){return{'name':_0x1a5b36[_0x6ef9('0x2b')],'type':_0x1a5b36['type']['key']};});_0x120d73[_0x6ef9('0x2c')]=_[_0x6ef9('0x29')](_0xd03dfa,_0x6ef9('0x2d'));_0x120d73['query']=_[_0x6ef9('0x2e')](_0x21bfdf[_0x6ef9('0x2f')]);_0x120d73['filters']=_[_0x6ef9('0x30')](_0x120d73[_0x6ef9('0x2c')],_0x120d73[_0x6ef9('0x2f')]);_0x3d29e7['attributes']=_['intersection'](_0x120d73[_0x6ef9('0x2c')],qs['fields'](_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x31')]));_0x3d29e7[_0x6ef9('0x32')]=_0x3d29e7['attributes']['length']?_0x3d29e7['attributes']:_0x120d73[_0x6ef9('0x2c')];if(!_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x33')](_0x6ef9('0x34'))){_0x3d29e7[_0x6ef9('0x1c')]=qs[_0x6ef9('0x1c')](_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x1c')]);_0x3d29e7[_0x6ef9('0x1e')]=qs[_0x6ef9('0x1e')](_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x1e')]);}_0x3d29e7[_0x6ef9('0x35')]=qs[_0x6ef9('0x36')](_0x21bfdf['query'][_0x6ef9('0x36')]);_0x3d29e7[_0x6ef9('0x37')]=qs['filters'](_[_0x6ef9('0x38')](_0x21bfdf['query'],_0x120d73[_0x6ef9('0x39')]),_0xd03dfa);if(_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x3a')]){_0x3d29e7[_0x6ef9('0x37')]=_['merge'](_0x3d29e7['where'],{'$or':_[_0x6ef9('0x29')](_0xd03dfa,function(_0x4364e8){if(_0x4364e8[_0x6ef9('0x3b')]!==_0x6ef9('0x3c')){var _0x1bf02a={};_0x1bf02a[_0x4364e8['name']]={'$like':'%'+_0x21bfdf[_0x6ef9('0x2f')][_0x6ef9('0x3a')]+'%'};return _0x1bf02a;}})});}_0x3d29e7=_['merge']({},_0x3d29e7,_0x21bfdf[_0x6ef9('0x3d')]);var _0x51ff76={'where':_0x3d29e7['where']};return db[_0x6ef9('0x2a')][_0x6ef9('0x1d')](_0x51ff76)[_0x6ef9('0x23')](function(_0x57dce7){_0x720173[_0x6ef9('0x1d')]=_0x57dce7;if(_0x21bfdf['query'][_0x6ef9('0x3e')]){_0x3d29e7['include']=[{'all':!![]}];}return db[_0x6ef9('0x2a')][_0x6ef9('0x3f')](_0x3d29e7);})[_0x6ef9('0x23')](function(_0x1868df){_0x720173[_0x6ef9('0x40')]=_0x1868df;return _0x720173;})[_0x6ef9('0x23')](respondWithFilteredResult(_0x434f50,_0x3d29e7))[_0x6ef9('0x41')](handleError(_0x434f50,null));};exports[_0x6ef9('0x42')]=function(_0x1d9530,_0x238c67){var _0xdc6ba2={'raw':!![],'where':{'id':_0x1d9530[_0x6ef9('0x43')]['id']}},_0x21f350={};_0x21f350[_0x6ef9('0x2c')]=_[_0x6ef9('0x2e')](db['CmHopperBlack'][_0x6ef9('0x44')]);_0x21f350[_0x6ef9('0x2f')]=_[_0x6ef9('0x2e')](_0x1d9530['query']);_0x21f350[_0x6ef9('0x39')]=_[_0x6ef9('0x30')](_0x21f350[_0x6ef9('0x2c')],_0x21f350[_0x6ef9('0x2f')]);_0xdc6ba2[_0x6ef9('0x32')]=_[_0x6ef9('0x30')](_0x21f350[_0x6ef9('0x2c')],qs[_0x6ef9('0x31')](_0x1d9530[_0x6ef9('0x2f')][_0x6ef9('0x31')]));_0xdc6ba2[_0x6ef9('0x32')]=_0xdc6ba2[_0x6ef9('0x32')][_0x6ef9('0x45')]?_0xdc6ba2[_0x6ef9('0x32')]:_0x21f350[_0x6ef9('0x2c')];if(_0x1d9530[_0x6ef9('0x2f')]['includeAll']){_0xdc6ba2[_0x6ef9('0x46')]=[{'all':!![]}];}_0xdc6ba2=_[_0x6ef9('0x47')]({},_0xdc6ba2,_0x1d9530['options']);return db[_0x6ef9('0x2a')][_0x6ef9('0x48')](_0xdc6ba2)[_0x6ef9('0x23')](handleEntityNotFound(_0x238c67,null))['then'](respondWithResult(_0x238c67,null))[_0x6ef9('0x41')](handleError(_0x238c67,null));};exports[_0x6ef9('0x22')]=function(_0x2c584e,_0x3ada57){if(_0x2c584e[_0x6ef9('0x49')]['id']){delete _0x2c584e['body']['id'];}return db['CmHopperBlack'][_0x6ef9('0x48')]({'where':{'id':_0x2c584e[_0x6ef9('0x43')]['id']}})[_0x6ef9('0x23')](handleEntityNotFound(_0x3ada57,null))['then'](saveUpdates(_0x2c584e[_0x6ef9('0x49')],null))[_0x6ef9('0x23')](respondWithResult(_0x3ada57,null))[_0x6ef9('0x41')](handleError(_0x3ada57,null));};exports[_0x6ef9('0x24')]=function(_0x49b855,_0x3a62d3){return db['CmHopperBlack'][_0x6ef9('0x48')]({'where':{'id':_0x49b855[_0x6ef9('0x43')]['id']}})[_0x6ef9('0x23')](handleEntityNotFound(_0x3a62d3,null))[_0x6ef9('0x23')](removeEntity(_0x3a62d3,null))[_0x6ef9('0x41')](handleError(_0x3a62d3,null));};exports[_0x6ef9('0x4a')]=function(_0x1bffe0,_0x31cc96){return db[_0x6ef9('0x2a')]['describe']()[_0x6ef9('0x23')](respondWithResult(_0x31cc96,null))[_0x6ef9('0x41')](handleError(_0x31cc96,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c1d10ba..fc10e44 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 _0xf44c=['bluebird','request-promise','path','./cmHopperBlack.attributes','exports','cm_hopper_black','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf44c,0xe7));var _0xcf44=function(_0x31fab2,_0x1c7cd3){_0x31fab2=_0x31fab2-0x0;var _0x3dee62=_0xf44c[_0x31fab2];return _0x3dee62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf44('0x0'))(_0xcf44('0x1'));var moment=require(_0xcf44('0x2'));var BPromise=require(_0xcf44('0x3'));var rp=require(_0xcf44('0x4'));var fs=require('fs');var path=require(_0xcf44('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf44('0x6'));module[_0xcf44('0x7')]=function(_0x19278a,_0x4d5a2a){return _0x19278a['define']('CmHopperBlack',attributes,{'tableName':_0xcf44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb131=['cm_hopper_black','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x27a1b8,_0x4fb50e){var _0xd51fec=function(_0x127431){while(--_0x127431){_0x27a1b8['push'](_0x27a1b8['shift']());}};_0xd51fec(++_0x4fb50e);}(_0xb131,0x156));var _0x1b13=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xb131[_0x506172];return _0x2723c0;};'use strict';var _=require(_0x1b13('0x0'));var util=require(_0x1b13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1b13('0x2'));var BPromise=require(_0x1b13('0x3'));var rp=require(_0x1b13('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b13('0x5'));var config=require(_0x1b13('0x6'));var attributes=require(_0x1b13('0x7'));module[_0x1b13('0x8')]=function(_0x49473b,_0x48742b){return _0x49473b[_0x1b13('0x9')]('CmHopperBlack',attributes,{'tableName':_0x1b13('0xa'),'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 8ad665c..666376d 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 _0x3ae0=['destroy','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack'];(function(_0x873125,_0x1e3df1){var _0x1d9d0e=function(_0x2b41c0){while(--_0x2b41c0){_0x873125['push'](_0x873125['shift']());}};_0x1d9d0e(++_0x1e3df1);}(_0x3ae0,0x1d6));var _0x03ae=function(_0x22fe70,_0x6e1a47){_0x22fe70=_0x22fe70-0x0;var _0x93d0b4=_0x3ae0[_0x22fe70];return _0x93d0b4;};'use strict';var _=require('lodash');var util=require(_0x03ae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03ae('0x1'));var fs=require('fs');var Redis=require(_0x03ae('0x2'));var db=require(_0x03ae('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x03ae('0x4'))('rpc');var config=require(_0x03ae('0x5'));var jayson=require(_0x03ae('0x6'));var client=jayson[_0x03ae('0x7')][_0x03ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x219369,_0x323c1f,_0x3f033b){return new BPromise(function(_0x46a278,_0x4732dc){return client[_0x03ae('0x9')](_0x219369,_0x3f033b)[_0x03ae('0xa')](function(_0x5e9e86){logger[_0x03ae('0xb')](_0x03ae('0xc'),_0x323c1f,_0x03ae('0xd'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x323c1f,_0x03ae('0xd'),JSON['stringify'](_0x5e9e86));if(_0x5e9e86[_0x03ae('0xe')]){if(_0x5e9e86[_0x03ae('0xe')][_0x03ae('0xf')]===0x1f4){logger[_0x03ae('0xe')](_0x03ae('0xc'),_0x323c1f,_0x5e9e86[_0x03ae('0xe')][_0x03ae('0x10')]);return _0x4732dc(_0x5e9e86['error'][_0x03ae('0x10')]);}logger[_0x03ae('0xe')](_0x03ae('0xc'),_0x323c1f,_0x5e9e86[_0x03ae('0xe')][_0x03ae('0x10')]);return _0x46a278(_0x5e9e86['error'][_0x03ae('0x10')]);}else{logger[_0x03ae('0xb')](_0x03ae('0xc'),_0x323c1f,_0x03ae('0xd'));_0x46a278(_0x5e9e86[_0x03ae('0x11')]['message']);}})['catch'](function(_0xe45e4f){logger[_0x03ae('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x323c1f,_0xe45e4f);_0x4732dc(_0xe45e4f);});});}exports[_0x03ae('0x12')]=function(_0x4cbf2b){var _0x1d919a=this;return new Promise(function(_0x21eb8b,_0x5a0c27){return db['CmHopperBlack'][_0x03ae('0x13')]({'raw':_0x4cbf2b[_0x03ae('0x14')]?_0x4cbf2b[_0x03ae('0x14')][_0x03ae('0x15')]===undefined?!![]:![]:!![],'where':_0x4cbf2b[_0x03ae('0x14')]?_0x4cbf2b[_0x03ae('0x14')][_0x03ae('0x16')]||null:null,'attributes':_0x4cbf2b[_0x03ae('0x14')]?_0x4cbf2b[_0x03ae('0x14')][_0x03ae('0x17')]||null:null,'limit':_0x4cbf2b[_0x03ae('0x14')]?_0x4cbf2b[_0x03ae('0x14')][_0x03ae('0x18')]||null:null,'include':_0x4cbf2b[_0x03ae('0x14')]?_0x4cbf2b[_0x03ae('0x14')][_0x03ae('0x19')]?_[_0x03ae('0x1a')](_0x4cbf2b['options'][_0x03ae('0x19')],function(_0x1aa9e0){return{'model':db[_0x1aa9e0[_0x03ae('0x1b')]],'as':_0x1aa9e0['as'],'attributes':_0x1aa9e0['attributes'],'include':_0x1aa9e0['include']?_[_0x03ae('0x1a')](_0x1aa9e0['include'],function(_0x280eea){return{'model':db[_0x280eea[_0x03ae('0x1b')]],'as':_0x280eea['as'],'attributes':_0x280eea[_0x03ae('0x17')],'include':_0x280eea[_0x03ae('0x19')]?_['map'](_0x280eea['include'],function(_0x2a2e4e){return{'model':db[_0x2a2e4e[_0x03ae('0x1b')]],'as':_0x2a2e4e['as'],'attributes':_0x2a2e4e[_0x03ae('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c4da5){logger[_0x03ae('0xb')](_0x03ae('0x12'),_0x4cbf2b);logger[_0x03ae('0x1c')](_0x03ae('0x12'),_0x4cbf2b,JSON[_0x03ae('0x1d')](_0x5c4da5));_0x21eb8b(_0x5c4da5);})['catch'](function(_0x5ec980){logger[_0x03ae('0xe')](_0x03ae('0x12'),_0x5ec980[_0x03ae('0x10')],_0x4cbf2b);_0x5a0c27(_0x1d919a[_0x03ae('0xe')](0x1f4,_0x5ec980[_0x03ae('0x10')]));});});};exports[_0x03ae('0x1e')]=function(_0x17ad89){var _0x3d92e5=this;return new Promise(function(_0x511f76,_0x5d5e46){return db[_0x03ae('0x1f')]['update'](_0x17ad89[_0x03ae('0x20')],{'raw':_0x17ad89[_0x03ae('0x14')]?_0x17ad89[_0x03ae('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17ad89['options']?_0x17ad89[_0x03ae('0x14')][_0x03ae('0x16')]||null:null,'attributes':_0x17ad89[_0x03ae('0x14')]?_0x17ad89[_0x03ae('0x14')][_0x03ae('0x17')]||null:null,'limit':_0x17ad89['options']?_0x17ad89['options'][_0x03ae('0x18')]||null:null})[_0x03ae('0xa')](function(_0x40844f){logger[_0x03ae('0xb')](_0x03ae('0x1e'),_0x17ad89);logger['debug'](_0x03ae('0x1e'),_0x17ad89,JSON[_0x03ae('0x1d')](_0x40844f));_0x511f76(_0x40844f);})['catch'](function(_0x543fc7){logger[_0x03ae('0xe')](_0x03ae('0x1e'),_0x543fc7[_0x03ae('0x10')],_0x17ad89);_0x5d5e46(_0x3d92e5[_0x03ae('0xe')](0x1f4,_0x543fc7[_0x03ae('0x10')]));});});};exports[_0x03ae('0x21')]=function(_0x41dc02){var _0x2a4767=this;return new Promise(function(_0x31bec5,_0x3b568e){return db['CmHopperBlack'][_0x03ae('0x22')]({'where':_0x41dc02[_0x03ae('0x14')]?_0x41dc02[_0x03ae('0x14')][_0x03ae('0x16')]||null:null})['then'](function(_0x435bea){logger[_0x03ae('0xb')]('DestroyCmHopperBlack',_0x41dc02);logger[_0x03ae('0x1c')](_0x03ae('0x21'),_0x41dc02,JSON['stringify'](_0x435bea));_0x31bec5(_0x435bea);})[_0x03ae('0x23')](function(_0xd6e7a){logger[_0x03ae('0xe')](_0x03ae('0x21'),_0xd6e7a[_0x03ae('0x10')],_0x41dc02);_0x3b568e(_0x2a4767[_0x03ae('0xe')](0x1f4,_0xd6e7a[_0x03ae('0x10')]));});});}; \ No newline at end of file +var _0x7155=['code','message','result','catch','CmHopperBlack','options','raw','where','limit','include','map','model','attributes','then','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x47ec0d,_0xf09e8c){var _0xcae9b4=function(_0x59a04c){while(--_0x59a04c){_0x47ec0d['push'](_0x47ec0d['shift']());}};_0xcae9b4(++_0xf09e8c);}(_0x7155,0x82));var _0x5715=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7155[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5715('0x0'));var util=require('util');var moment=require(_0x5715('0x1'));var BPromise=require(_0x5715('0x2'));var rs=require(_0x5715('0x3'));var fs=require('fs');var Redis=require(_0x5715('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5715('0x5'))(_0x5715('0x6'));var config=require(_0x5715('0x7'));var jayson=require(_0x5715('0x8'));var client=jayson[_0x5715('0x9')][_0x5715('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c2d7d,_0x7b36fa,_0x5ae64a){return new BPromise(function(_0x589c1b,_0x1c72cc){return client['request'](_0x7c2d7d,_0x5ae64a)['then'](function(_0x2d405b){logger[_0x5715('0xb')](_0x5715('0xc'),_0x7b36fa,_0x5715('0xd'));logger[_0x5715('0xe')](_0x5715('0xf'),_0x7b36fa,'request\x20sent',JSON[_0x5715('0x10')](_0x2d405b));if(_0x2d405b[_0x5715('0x11')]){if(_0x2d405b[_0x5715('0x11')][_0x5715('0x12')]===0x1f4){logger[_0x5715('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x7b36fa,_0x2d405b[_0x5715('0x11')][_0x5715('0x13')]);return _0x1c72cc(_0x2d405b['error'][_0x5715('0x13')]);}logger[_0x5715('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x7b36fa,_0x2d405b[_0x5715('0x11')][_0x5715('0x13')]);return _0x589c1b(_0x2d405b['error'][_0x5715('0x13')]);}else{logger[_0x5715('0xb')](_0x5715('0xc'),_0x7b36fa,_0x5715('0xd'));_0x589c1b(_0x2d405b[_0x5715('0x14')][_0x5715('0x13')]);}})[_0x5715('0x15')](function(_0x198a31){logger[_0x5715('0x11')](_0x5715('0xc'),_0x7b36fa,_0x198a31);_0x1c72cc(_0x198a31);});});}exports['GetCmHopperBlack']=function(_0xd9e077){var _0x17033c=this;return new Promise(function(_0xa818d5,_0x2bb4c5){return db[_0x5715('0x16')]['findAll']({'raw':_0xd9e077[_0x5715('0x17')]?_0xd9e077[_0x5715('0x17')][_0x5715('0x18')]===undefined?!![]:![]:!![],'where':_0xd9e077[_0x5715('0x17')]?_0xd9e077['options'][_0x5715('0x19')]||null:null,'attributes':_0xd9e077['options']?_0xd9e077[_0x5715('0x17')]['attributes']||null:null,'limit':_0xd9e077[_0x5715('0x17')]?_0xd9e077['options'][_0x5715('0x1a')]||null:null,'include':_0xd9e077[_0x5715('0x17')]?_0xd9e077[_0x5715('0x17')][_0x5715('0x1b')]?_[_0x5715('0x1c')](_0xd9e077[_0x5715('0x17')][_0x5715('0x1b')],function(_0x25286e){return{'model':db[_0x25286e[_0x5715('0x1d')]],'as':_0x25286e['as'],'attributes':_0x25286e[_0x5715('0x1e')],'include':_0x25286e[_0x5715('0x1b')]?_[_0x5715('0x1c')](_0x25286e[_0x5715('0x1b')],function(_0x9de316){return{'model':db[_0x9de316['model']],'as':_0x9de316['as'],'attributes':_0x9de316[_0x5715('0x1e')],'include':_0x9de316[_0x5715('0x1b')]?_['map'](_0x9de316[_0x5715('0x1b')],function(_0x3ef362){return{'model':db[_0x3ef362['model']],'as':_0x3ef362['as'],'attributes':_0x3ef362[_0x5715('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5715('0x1f')](function(_0x54009e){logger['info']('GetCmHopperBlack',_0xd9e077);logger['debug']('GetCmHopperBlack',_0xd9e077,JSON[_0x5715('0x10')](_0x54009e));_0xa818d5(_0x54009e);})[_0x5715('0x15')](function(_0xb4bc49){logger[_0x5715('0x11')]('GetCmHopperBlack',_0xb4bc49[_0x5715('0x13')],_0xd9e077);_0x2bb4c5(_0x17033c[_0x5715('0x11')](0x1f4,_0xb4bc49[_0x5715('0x13')]));});});};exports[_0x5715('0x20')]=function(_0x126d2b){var _0x95394e=this;return new Promise(function(_0x415261,_0xd8209e){return db[_0x5715('0x16')][_0x5715('0x21')](_0x126d2b[_0x5715('0x22')],{'raw':_0x126d2b[_0x5715('0x17')]?_0x126d2b[_0x5715('0x17')][_0x5715('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x126d2b[_0x5715('0x17')]?_0x126d2b['options'][_0x5715('0x19')]||null:null,'attributes':_0x126d2b[_0x5715('0x17')]?_0x126d2b['options']['attributes']||null:null,'limit':_0x126d2b['options']?_0x126d2b[_0x5715('0x17')][_0x5715('0x1a')]||null:null})[_0x5715('0x1f')](function(_0x4c2849){logger['info']('UpdateCmHopperBlack',_0x126d2b);logger[_0x5715('0xe')](_0x5715('0x20'),_0x126d2b,JSON[_0x5715('0x10')](_0x4c2849));_0x415261(_0x4c2849);})['catch'](function(_0x15ce91){logger[_0x5715('0x11')](_0x5715('0x20'),_0x15ce91['message'],_0x126d2b);_0xd8209e(_0x95394e[_0x5715('0x11')](0x1f4,_0x15ce91[_0x5715('0x13')]));});});};exports[_0x5715('0x23')]=function(_0x3899c6){var _0x258a9a=this;return new Promise(function(_0x3cdccc,_0x50c230){return db[_0x5715('0x16')][_0x5715('0x24')]({'where':_0x3899c6[_0x5715('0x17')]?_0x3899c6['options'][_0x5715('0x19')]||null:null})[_0x5715('0x1f')](function(_0x3f829d){logger[_0x5715('0xb')](_0x5715('0x23'),_0x3899c6);logger[_0x5715('0xe')]('DestroyCmHopperBlack',_0x3899c6,JSON['stringify'](_0x3f829d));_0x3cdccc(_0x3f829d);})['catch'](function(_0x147513){logger['error']('DestroyCmHopperBlack',_0x147513[_0x5715('0x13')],_0x3899c6);_0x50c230(_0x258a9a[_0x5715('0x11')](0x1f4,_0x147513[_0x5715('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c9e9c1c..f318066 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 _0x81c6=['delete','util','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','/:id','update'];(function(_0x409b6f,_0x4f2ab9){var _0x5988c4=function(_0x375c0b){while(--_0x375c0b){_0x409b6f['push'](_0x409b6f['shift']());}};_0x5988c4(++_0x4f2ab9);}(_0x81c6,0x1d5));var _0x681c=function(_0x2c04d9,_0x59ec65){_0x2c04d9=_0x2c04d9-0x0;var _0x5ad09a=_0x81c6[_0x2c04d9];return _0x5ad09a;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var fs_extra=require(_0x681c('0x2'));var auth=require(_0x681c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x681c('0x4'));var controller=require(_0x681c('0x5'));router[_0x681c('0x6')]('/',auth[_0x681c('0x7')](),controller['index']);router[_0x681c('0x6')](_0x681c('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x681c('0x6')](_0x681c('0x9'),auth[_0x681c('0x7')](),controller['show']);router['put'](_0x681c('0x9'),auth['isAuthenticated'](),controller[_0x681c('0xa')]);router[_0x681c('0xb')](_0x681c('0x9'),auth[_0x681c('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1883=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e7d22,_0x5d693d){var _0x162560=function(_0x82f53a){while(--_0x82f53a){_0x5e7d22['push'](_0x5e7d22['shift']());}};_0x162560(++_0x5d693d);}(_0x1883,0xab));var _0x3188=function(_0x2d418e,_0xe31b0){_0x2d418e=_0x2d418e-0x0;var _0x3fa9e4=_0x1883[_0x2d418e];return _0x3fa9e4;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')]('/:id',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);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 82cd821..f87d4fa 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 _0xf5d3=['seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','followuptime','diff'];(function(_0x18301f,_0x116244){var _0x2666d9=function(_0xc5999a){while(--_0xc5999a){_0x18301f['push'](_0x18301f['shift']());}};_0x2666d9(++_0x116244);}(_0xf5d3,0x16c));var _0x3f5d=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xf5d3[_0x2b9b7f];return _0x4ed19a;};'use strict';var Sequelize=require(_0x3f5d('0x0'));var moment=require(_0x3f5d('0x1'));module[_0x3f5d('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3f5d('0x3')]},'scheduledat':{'type':Sequelize[_0x3f5d('0x4')]},'countbusyretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3f5d('0x3')]},'calleridnum':{'type':Sequelize[_0x3f5d('0x3')]},'calleridname':{'type':Sequelize[_0x3f5d('0x3')]},'starttime':{'type':Sequelize[_0x3f5d('0x4')]},'responsetime':{'type':Sequelize[_0x3f5d('0x4')]},'answertime':{'type':Sequelize[_0x3f5d('0x4')]},'droptime':{'type':Sequelize[_0x3f5d('0x4')]},'endtime':{'type':Sequelize[_0x3f5d('0x4')]},'ringtime':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3f5d('0x3')]},'campaigntype':{'type':Sequelize[_0x3f5d('0x3')]},'membername':{'type':Sequelize[_0x3f5d('0x3')]},'reason':{'type':Sequelize[_0x3f5d('0x3')]},'disposition':{'type':Sequelize[_0x3f5d('0x3')]},'secondDisposition':{'type':Sequelize[_0x3f5d('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f5d('0x3')]},'dispositionat':{'type':Sequelize[_0x3f5d('0x4')],'set':function(_0x85ea45){var _0x1a9b9c=this['getDataValue']('endtime');if(_0x1a9b9c&&_0x85ea45){this['setDataValue'](_0x3f5d('0x6'),moment(_0x85ea45)[_0x3f5d('0x7')](moment(_0x1a9b9c),_0x3f5d('0x8')));}return this[_0x3f5d('0x9')](_0x3f5d('0xa'),_0x85ea45);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x3f5d('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3f5d('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3f5d('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3f5d('0x4')]},'callback':{'type':Sequelize[_0x3f5d('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3f5d('0x4')]},'deleted':{'type':Sequelize[_0x3f5d('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3f5d('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3f5d('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3f5d('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x093c=['sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x093c,0x168));var _0xc093=function(_0x2168ee,_0x2b85c7){_0x2168ee=_0x2168ee-0x0;var _0x599a02=_0x093c[_0x2168ee];return _0x599a02;};'use strict';var Sequelize=require(_0xc093('0x0'));var moment=require(_0xc093('0x1'));module['exports']={'state':{'type':Sequelize[_0xc093('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc093('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc093('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc093('0x3')]},'originatecalleridname':{'type':Sequelize[_0xc093('0x3')]},'calleridnum':{'type':Sequelize[_0xc093('0x3')]},'calleridname':{'type':Sequelize[_0xc093('0x3')]},'starttime':{'type':Sequelize[_0xc093('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc093('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc093('0x4')]},'ringtime':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc093('0x3')]},'campaign':{'type':Sequelize[_0xc093('0x3')]},'campaigntype':{'type':Sequelize[_0xc093('0x3')]},'membername':{'type':Sequelize[_0xc093('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc093('0x3')]},'secondDisposition':{'type':Sequelize[_0xc093('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc093('0x3')]},'dispositionat':{'type':Sequelize[_0xc093('0x4')],'set':function(_0x514e24){var _0x1bc3e0=this[_0xc093('0x5')](_0xc093('0x6'));if(_0x1bc3e0&&_0x514e24){this[_0xc093('0x7')](_0xc093('0x8'),moment(_0x514e24)[_0xc093('0x9')](moment(_0x1bc3e0),'seconds'));}return this[_0xc093('0x7')](_0xc093('0xa'),_0x514e24);}},'amd':{'type':Sequelize[_0xc093('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc093('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc093('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc093('0x4')]},'callback':{'type':Sequelize[_0xc093('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc093('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc093('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 8480cc5..1e7905f 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 _0x6d38=['calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','describe','catch','body','uniqueid','find','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state'];(function(_0x6048e7,_0x485f4f){var _0x576f4c=function(_0x20893f){while(--_0x20893f){_0x6048e7['push'](_0x6048e7['shift']());}};_0x576f4c(++_0x485f4f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['CmHopperFinal'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':!![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')]()['then'](respondWithResult(_0xd20863,null))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x3226b5,_0x14fa58){if(_0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')]){delete _0x3226b5[_0x86d3('0x41')][_0x86d3('0x42')];}return db[_0x86d3('0x26')][_0x86d3('0x43')]({'where':{'uniqueid':_0x3226b5[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x14fa58,null))['then'](saveUpdates(_0x3226b5[_0x86d3('0x41')],null))[_0x86d3('0x20')](respondWithResult(_0x14fa58,null))['catch'](handleError(_0x14fa58,null));};exports[_0x86d3('0x45')]=function(_0x23a6ee,_0x197047,_0x2e9af5){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x23a6ee['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x48')))),_0x86d3('0x49')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x4b')))),_0x86d3('0x4c')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal'](_0x86d3('0x4d')))),'busyContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x86d3('0x4f')))),'dropContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x197047,null))[_0x86d3('0x20')](respondWithResult(_0x197047,null))['catch'](handleError(_0x197047,null));};exports[_0x86d3('0x53')]=function(_0x416428,_0x15cdd0,_0x29bdee){return db[_0x86d3('0x26')][_0x86d3('0x39')]({'raw':![],'where':{'CampaignId':_0x416428[_0x86d3('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86d3('0x49')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x4d')))),_0x86d3('0x54')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x55')))),_0x86d3('0x4e')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db[_0x86d3('0x46')]['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x86d3('0x56')],[db[_0x86d3('0x46')]['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x57')))),_0x86d3('0x58')],[db['sequelize']['fn'](_0x86d3('0x4a'),db['sequelize']['fn']('IF',db[_0x86d3('0x46')][_0x86d3('0x47')](_0x86d3('0x50')))),_0x86d3('0x51')],[db[_0x86d3('0x46')]['fn']('COUNT',db[_0x86d3('0x46')]['fn']('IF',db['sequelize'][_0x86d3('0x47')](_0x86d3('0x52')))),'answeringMachine']]})[_0x86d3('0x20')](handleEntityNotFound(_0x15cdd0,null))[_0x86d3('0x20')](respondWithResult(_0x15cdd0,null))[_0x86d3('0x40')](handleError(_0x15cdd0,null));};exports[_0x86d3('0x59')]=function(_0x308fed,_0x1c966a,_0x379799){return db['VoiceQueue'][_0x86d3('0x43')]({'where':{'id':_0x308fed[_0x86d3('0x44')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x1c966a,null))[_0x86d3('0x20')](function(_0x46e356){var _0x47f72e;if(_0x46e356){_0x47f72e=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')]('cm_hopper')[_0x86d3('0x5c')]([_0x86d3('0x5d'),_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x61'),_0x86d3('0x62'),_0x86d3('0x63')],squel[_0x86d3('0x64')]()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),'scheduledAt')[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))[_0x86d3('0x65')]('ANY_VALUE(ListId)',_0x86d3('0x60'))[_0x86d3('0x65')](_0x86d3('0x69'),_0x86d3('0x61'))['field']('NOW()',_0x86d3('0x62'))['field'](_0x86d3('0x67'),'updatedAt')['from'](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())['where'](_0x86d3('0x6d'),_0x308fed[_0x86d3('0x41')]['state'][_0x86d3('0x6c')]())[_0x86d3('0x32')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x86d3('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x86d3('0x64')]()['field']('phone')[_0x86d3('0x6e')]('cm_hopper')[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()[_0x86d3('0x65')]('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))[_0x86d3('0x32')](_0x86d3('0x6b'),_0x308fed[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')][_0x86d3('0x2b')](_0x47f72e);}return[];})['then'](respondWithResult(_0x1c966a,null))[_0x86d3('0x40')](handleError(_0x1c966a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xca2e0,_0x596b1d,_0x5a22ca){return db[_0x86d3('0x72')][_0x86d3('0x43')]({'where':{'id':_0xca2e0['params']['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x596b1d,null))[_0x86d3('0x20')](function(_0x879a8b){var _0x1c1384;if(_0x879a8b){_0x1c1384=squel[_0x86d3('0x5a')]()[_0x86d3('0x5b')](_0x86d3('0x73'))['fromQuery'](['phone',_0x86d3('0x5e'),_0x86d3('0x5f'),_0x86d3('0x60'),_0x86d3('0x74'),_0x86d3('0x62'),_0x86d3('0x63')],squel['select']()[_0x86d3('0x65')](_0x86d3('0x66'),_0x86d3('0x5d'))[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x5e'))[_0x86d3('0x65')](_0x86d3('0x68'),_0x86d3('0x5f'))['field'](_0x86d3('0x75'),_0x86d3('0x60'))['field']('ANY_VALUE(CampaignId)',_0x86d3('0x74'))[_0x86d3('0x65')](_0x86d3('0x67'),'createdAt')[_0x86d3('0x65')](_0x86d3('0x67'),_0x86d3('0x63'))[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id']['toString']())[_0x86d3('0x32')](_0x86d3('0x6d'),_0xca2e0[_0x86d3('0x41')][_0x86d3('0x77')]['toString']())[_0x86d3('0x32')](_0x86d3('0x78'))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field'](_0x86d3('0x5d'))[_0x86d3('0x6e')](_0x86d3('0x73'))[_0x86d3('0x32')](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]()))[_0x86d3('0x32')](_0x86d3('0x6f'),squel[_0x86d3('0x64')]()['field']('calleridnum')[_0x86d3('0x6e')](_0x86d3('0x6a'))['where'](_0x86d3('0x76'),_0xca2e0[_0x86d3('0x44')]['id'][_0x86d3('0x6c')]())[_0x86d3('0x32')](_0x86d3('0x70')))[_0x86d3('0x71')](_0x86d3('0x5f')))[_0x86d3('0x6c')]();return db[_0x86d3('0x46')]['query'](_0x1c1384);}return[];})['then'](respondWithResult(_0x596b1d,null))['catch'](handleError(_0x596b1d,null));};exports['checkContactHopper']=function(_0xad83bf,_0x2514c1,_0x28a509){return db[_0x86d3('0x79')][_0x86d3('0x7a')]({'where':{'VoiceQueueId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x61')],'CampaignId':_0xad83bf['body'][_0x86d3('0x74')],'ContactId':_0xad83bf[_0x86d3('0x41')][_0x86d3('0x5f')]}})[_0x86d3('0x20')](handleEntityNotFound(_0x2514c1,null))['then'](function(_0xe239b5){if(_0xe239b5){return _0xe239b5;}return null;})['then'](respondWithResult(_0x2514c1,null))[_0x86d3('0x40')](handleError(_0x2514c1,null));}; \ No newline at end of file +var _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xeda8,0x104));var _0x8eda=function(_0x440513,_0x5b37d1){_0x440513=_0x440513-0x0;var _0x482fbc=_0xeda8[_0x440513];return _0x482fbc;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 47b6169..95b1440 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 _0xa43f=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x56085e,_0x5c69e9){var _0x4de130=function(_0x120b34){while(--_0x120b34){_0x56085e['push'](_0x56085e['shift']());}};_0x4de130(++_0x5c69e9);}(_0xa43f,0xa3));var _0xfa43=function(_0x255d3e,_0x2568d9){_0x255d3e=_0x255d3e-0x0;var _0x5a501b=_0xa43f[_0x255d3e];return _0x5a501b;};'use strict';var _=require(_0xfa43('0x0'));var util=require(_0xfa43('0x1'));var logger=require(_0xfa43('0x2'))('api');var moment=require(_0xfa43('0x3'));var BPromise=require(_0xfa43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa43('0x5'));var rimraf=require(_0xfa43('0x6'));var config=require(_0xfa43('0x7'));var attributes=require(_0xfa43('0x8'));module[_0xfa43('0x9')]=function(_0x229714,_0x4a57df){return _0x229714['define'](_0xfa43('0xa'),attributes,{'tableName':_0xfa43('0xb'),'paranoid':![],'indexes':[{'name':_0xfa43('0xc'),'fields':[_0xfa43('0xc')]},{'name':_0xfa43('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbca7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger'];(function(_0x373715,_0x5e293d){var _0xc48f03=function(_0x2ec198){while(--_0x2ec198){_0x373715['push'](_0x373715['shift']());}};_0xc48f03(++_0x5e293d);}(_0xbca7,0xa3));var _0x7bca=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xbca7[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x7bca('0x0'));var util=require('util');var logger=require(_0x7bca('0x1'))(_0x7bca('0x2'));var moment=require(_0x7bca('0x3'));var BPromise=require(_0x7bca('0x4'));var rp=require(_0x7bca('0x5'));var fs=require('fs');var path=require(_0x7bca('0x6'));var rimraf=require(_0x7bca('0x7'));var config=require(_0x7bca('0x8'));var attributes=require(_0x7bca('0x9'));module[_0x7bca('0xa')]=function(_0x6c01fe,_0x5d1429){return _0x6c01fe[_0x7bca('0xb')]('CmHopperFinal',attributes,{'tableName':_0x7bca('0xc'),'paranoid':![],'indexes':[{'name':_0x7bca('0xd'),'fields':[_0x7bca('0xd')]},{'name':_0x7bca('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index dad114e..427faa0 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3efc22,_0x27b8c8){var _0x413389=function(_0x579963){while(--_0x579963){_0x3efc22['push'](_0x3efc22['shift']());}};_0x413389(++_0x27b8c8);}(_0xb10b,0x12a));var _0xbb10=function(_0x424c0f,_0x31a27d){_0x424c0f=_0x424c0f-0x0;var _0x265bf4=_0xb10b[_0x424c0f];return _0x265bf4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4b317f,_0x2e6034){var _0x44753c=function(_0x525789){while(--_0x525789){_0x4b317f['push'](_0x4b317f['shift']());}};_0x44753c(++_0x2e6034);}(_0x7a54,0x106));var _0x47a5=function(_0x13b1ce,_0x98cbb5){_0x13b1ce=_0x13b1ce-0x0;var _0x58ebdb=_0x7a54[_0x13b1ce];return _0x58ebdb;};'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 99d528f..42d4aad 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 _0xb714=['/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x49b401,_0x40fcd0){var _0x57dc27=function(_0x4358d4){while(--_0x4358d4){_0x49b401['push'](_0x49b401['shift']());}};_0x57dc27(++_0x40fcd0);}(_0xb714,0xa9));var _0x4b71=function(_0x3287c0,_0x24165a){_0x3287c0=_0x3287c0-0x0;var _0x5316e3=_0xb714[_0x3287c0];return _0x5316e3;};'use strict';var multer=require('multer');var util=require(_0x4b71('0x0'));var path=require(_0x4b71('0x1'));var timeout=require(_0x4b71('0x2'));var express=require(_0x4b71('0x3'));var router=express['Router']();var fs_extra=require(_0x4b71('0x4'));var auth=require(_0x4b71('0x5'));var interaction=require(_0x4b71('0x6'));var config=require(_0x4b71('0x7'));var controller=require(_0x4b71('0x8'));router[_0x4b71('0x9')]('/',auth[_0x4b71('0xa')](),controller[_0x4b71('0xb')]);router[_0x4b71('0x9')](_0x4b71('0xc'),auth[_0x4b71('0xa')](),controller['describe']);router[_0x4b71('0x9')](_0x4b71('0xd'),auth['isAuthenticated'](),controller[_0x4b71('0xe')]);router[_0x4b71('0x9')]('/voice/queue/countAttributes/:id',auth[_0x4b71('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x4b71('0xf'),auth[_0x4b71('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x4b71('0x10')](_0x4b71('0x11'),auth[_0x4b71('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x4b71('0x12'),auth[_0x4b71('0xa')](),controller[_0x4b71('0x13')]);router[_0x4b71('0x10')](_0x4b71('0x14'),auth[_0x4b71('0xa')](),controller[_0x4b71('0x15')]);router[_0x4b71('0x16')](_0x4b71('0xd'),auth[_0x4b71('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x6659=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','isAuthenticated','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','put','/:id','exports','util','connect-timeout','express'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x6659,0xbd));var _0x9665=function(_0x43d4a4,_0x4bb4ef){_0x43d4a4=_0x43d4a4-0x0;var _0x131ec8=_0x6659[_0x43d4a4];return _0x131ec8;};'use strict';var multer=require('multer');var util=require(_0x9665('0x0'));var path=require('path');var timeout=require(_0x9665('0x1'));var express=require(_0x9665('0x2'));var router=express[_0x9665('0x3')]();var fs_extra=require(_0x9665('0x4'));var auth=require(_0x9665('0x5'));var interaction=require(_0x9665('0x6'));var config=require(_0x9665('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9665('0x8')](_0x9665('0x9'),auth['isAuthenticated'](),controller[_0x9665('0xa')]);router[_0x9665('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x9665('0xb'),auth['isAuthenticated'](),controller[_0x9665('0xc')]);router[_0x9665('0x8')]('/campaign/countAttributes/:id',auth[_0x9665('0xd')](),controller[_0x9665('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x9665('0xf')]);router['post'](_0x9665('0x10'),auth[_0x9665('0xd')](),controller[_0x9665('0x11')]);router[_0x9665('0x12')](_0x9665('0x13'),auth['isAuthenticated'](),controller[_0x9665('0x14')]);router[_0x9665('0x15')](_0x9665('0x16'),auth[_0x9665('0xd')](),controller['update']);module[_0x9665('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b79ef5f..8fba28f 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 _0xe590=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x47a838,_0x2e0a6a){var _0x3ae5ae=function(_0x4c0925){while(--_0x4c0925){_0x47a838['push'](_0x47a838['shift']());}};_0x3ae5ae(++_0x2e0a6a);}(_0xe590,0x198));var _0x0e59=function(_0x4616a0,_0xae209c){_0x4616a0=_0x4616a0-0x0;var _0x57d938=_0xe590[_0x4616a0];return _0x57d938;};'use strict';var Sequelize=require(_0x0e59('0x0'));module[_0x0e59('0x1')]={'state':{'type':Sequelize[_0x0e59('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0e59('0x3')]},'scheduledat':{'type':Sequelize[_0x0e59('0x4')]},'countbusyretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0e59('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0e59('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0e59('0x3')]},'calleridnum':{'type':Sequelize[_0x0e59('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x0e59('0x4')]},'responsetime':{'type':Sequelize[_0x0e59('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x0e59('0x4')]},'endtime':{'type':Sequelize[_0x0e59('0x4')]},'ringtime':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0e59('0x3')]},'campaign':{'type':Sequelize[_0x0e59('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0e59('0x3')]},'reason':{'type':Sequelize[_0x0e59('0x3')]},'amd':{'type':Sequelize[_0x0e59('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0e59('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0e59('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0e59('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0e59('0x4')]},'recallme':{'type':Sequelize[_0x0e59('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0e59('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0e59('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf3d4=['INTEGER','STRING','BOOLEAN','sequelize','DATE'];(function(_0x5d3dae,_0x3a73b7){var _0x27dfc6=function(_0x40660f){while(--_0x40660f){_0x5d3dae['push'](_0x5d3dae['shift']());}};_0x27dfc6(++_0x3a73b7);}(_0xf3d4,0x71));var _0x4f3d=function(_0x56c745,_0x3fc5e0){_0x56c745=_0x56c745-0x0;var _0xa87ed8=_0xf3d4[_0x56c745];return _0xa87ed8;};'use strict';var Sequelize=require(_0x4f3d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4f3d('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4f3d('0x1')]},'droptime':{'type':Sequelize[_0x4f3d('0x1')]},'endtime':{'type':Sequelize[_0x4f3d('0x1')]},'ringtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4f3d('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4f3d('0x3')]},'membername':{'type':Sequelize[_0x4f3d('0x3')]},'reason':{'type':Sequelize[_0x4f3d('0x3')]},'amd':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4f3d('0x1')]},'recallme':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4f3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d7ba414..71090f4 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 _0xed35=['fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','find','create','describe','body','uniqueid','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','error','stack','name','send','index','CmHopperHistory','rawAttributes'];(function(_0x3f03dd,_0xc5f53b){var _0x1be078=function(_0x5e0c02){while(--_0x5e0c02){_0x3f03dd['push'](_0x3f03dd['shift']());}};_0x1be078(++_0xc5f53b);}(_0xed35,0xb1));var _0x5ed3=function(_0x15154a,_0x3a2a20){_0x15154a=_0x15154a-0x0;var _0x503958=_0xed35[_0x15154a];return _0x503958;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ed3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ed3('0x1'));var BPromise=require(_0x5ed3('0x2'));var Mustache=require(_0x5ed3('0x3'));var util=require(_0x5ed3('0x4'));var path=require('path');var sox=require(_0x5ed3('0x5'));var csv=require(_0x5ed3('0x6'));var ejs=require(_0x5ed3('0x7'));var fs=require('fs');var fs_extra=require(_0x5ed3('0x8'));var _=require(_0x5ed3('0x9'));var squel=require(_0x5ed3('0xa'));var crypto=require(_0x5ed3('0xb'));var jsforce=require(_0x5ed3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5ed3('0x6'));var querystring=require(_0x5ed3('0xd'));var Papa=require(_0x5ed3('0xe'));var Redis=require(_0x5ed3('0xf'));var authService=require(_0x5ed3('0x10'));var qs=require(_0x5ed3('0x11'));var as=require(_0x5ed3('0x12'));var hardwareService=require(_0x5ed3('0x13'));var logger=require('../../config/logger')(_0x5ed3('0x14'));var utils=require(_0x5ed3('0x15'));var config=require(_0x5ed3('0x16'));var licenseUtil=require(_0x5ed3('0x17'));var db=require(_0x5ed3('0x18'))['db'];function respondWithStatusCode(_0x1f6f2b,_0x2ce0f2){_0x2ce0f2=_0x2ce0f2||0xcc;return function(_0x1d86ea){if(_0x1d86ea){return _0x1f6f2b[_0x5ed3('0x19')](_0x2ce0f2);}return _0x1f6f2b[_0x5ed3('0x1a')](_0x2ce0f2)[_0x5ed3('0x1b')]();};}function respondWithResult(_0x1ebf3a,_0x440d15){_0x440d15=_0x440d15||0xc8;return function(_0x52bdf1){if(_0x52bdf1){return _0x1ebf3a['status'](_0x440d15)['json'](_0x52bdf1);}};}function respondWithFilteredResult(_0x4fc71c,_0x593863){return function(_0x28ba4d){if(_0x28ba4d){var _0x323da2=typeof _0x593863[_0x5ed3('0x1c')]===_0x5ed3('0x1d')&&typeof _0x593863[_0x5ed3('0x1e')]===_0x5ed3('0x1d');var _0x36c03c=_0x28ba4d['count'];var _0x243b80=_0x323da2?0x0:_0x593863[_0x5ed3('0x1c')];var _0x451c80=_0x323da2?_0x28ba4d[_0x5ed3('0x1f')]:_0x593863[_0x5ed3('0x1c')]+_0x593863['limit'];var _0x2adaf0;if(_0x451c80>=_0x36c03c){_0x451c80=_0x36c03c;_0x2adaf0=0xc8;}else{_0x2adaf0=0xce;}_0x4fc71c[_0x5ed3('0x1a')](_0x2adaf0);return _0x4fc71c[_0x5ed3('0x20')](_0x5ed3('0x21'),_0x243b80+'-'+_0x451c80+'/'+_0x36c03c)[_0x5ed3('0x22')](_0x28ba4d);}return null;};}function patchUpdates(_0x3de156){return function(_0x43ad17){try{jsonpatch['apply'](_0x43ad17,_0x3de156,!![]);}catch(_0x10d380){return BPromise['reject'](_0x10d380);}return _0x43ad17[_0x5ed3('0x23')]();};}function saveUpdates(_0x5de9a9,_0x40f754){return function(_0x131dcd){if(_0x131dcd){return _0x131dcd[_0x5ed3('0x24')](_0x5de9a9)[_0x5ed3('0x25')](function(_0x21550d){return _0x21550d;});}return null;};}function removeEntity(_0x69c6ca,_0x3eaf01){return function(_0x43c394){if(_0x43c394){return _0x43c394['destroy']()[_0x5ed3('0x25')](function(){_0x69c6ca[_0x5ed3('0x1a')](0xcc)[_0x5ed3('0x1b')]();});}};}function handleEntityNotFound(_0x2277bd,_0x109650){return function(_0x38f7d6){if(!_0x38f7d6){_0x2277bd[_0x5ed3('0x19')](0x194);}return _0x38f7d6;};}function handleError(_0x328bf0,_0x5a5d38){_0x5a5d38=_0x5a5d38||0x1f4;return function(_0x444007){logger[_0x5ed3('0x26')](_0x444007[_0x5ed3('0x27')]);if(_0x444007[_0x5ed3('0x28')]){delete _0x444007['name'];}_0x328bf0[_0x5ed3('0x1a')](_0x5a5d38)[_0x5ed3('0x29')](_0x444007);};}exports[_0x5ed3('0x2a')]=function(_0x59f5b6,_0x1c5d91){var _0x3dc66f={},_0x5eb033={},_0x39a517={'count':0x0,'rows':[]};var _0x2fcf31=_['map'](db[_0x5ed3('0x2b')][_0x5ed3('0x2c')],function(_0xddcff4){return{'name':_0xddcff4[_0x5ed3('0x2d')],'type':_0xddcff4[_0x5ed3('0x2e')][_0x5ed3('0x2f')]};});_0x5eb033['model']=_['map'](_0x2fcf31,_0x5ed3('0x28'));_0x5eb033['query']=_[_0x5ed3('0x30')](_0x59f5b6[_0x5ed3('0x31')]);_0x5eb033[_0x5ed3('0x32')]=_[_0x5ed3('0x33')](_0x5eb033[_0x5ed3('0x34')],_0x5eb033[_0x5ed3('0x31')]);_0x3dc66f['attributes']=_[_0x5ed3('0x33')](_0x5eb033['model'],qs['fields'](_0x59f5b6[_0x5ed3('0x31')][_0x5ed3('0x35')]));_0x3dc66f['attributes']=_0x3dc66f[_0x5ed3('0x36')][_0x5ed3('0x37')]?_0x3dc66f[_0x5ed3('0x36')]:_0x5eb033[_0x5ed3('0x34')];if(!_0x59f5b6['query'][_0x5ed3('0x38')](_0x5ed3('0x39'))){_0x3dc66f[_0x5ed3('0x1e')]=qs[_0x5ed3('0x1e')](_0x59f5b6[_0x5ed3('0x31')][_0x5ed3('0x1e')]);_0x3dc66f[_0x5ed3('0x1c')]=qs[_0x5ed3('0x1c')](_0x59f5b6['query'][_0x5ed3('0x1c')]);}_0x3dc66f['order']=qs[_0x5ed3('0x3a')](_0x59f5b6[_0x5ed3('0x31')][_0x5ed3('0x3a')]);_0x3dc66f['where']=qs[_0x5ed3('0x32')](_[_0x5ed3('0x3b')](_0x59f5b6[_0x5ed3('0x31')],_0x5eb033[_0x5ed3('0x32')]),_0x2fcf31);if(_0x59f5b6[_0x5ed3('0x31')]['filter']){_0x3dc66f[_0x5ed3('0x3c')]=_[_0x5ed3('0x3d')](_0x3dc66f[_0x5ed3('0x3c')],{'$or':_['map'](_0x2fcf31,function(_0x3adc0c){if(_0x3adc0c['type']!==_0x5ed3('0x3e')){var _0x5bfe85={};_0x5bfe85[_0x3adc0c[_0x5ed3('0x28')]]={'$like':'%'+_0x59f5b6[_0x5ed3('0x31')][_0x5ed3('0x3f')]+'%'};return _0x5bfe85;}})});}_0x3dc66f=_['merge']({},_0x3dc66f,_0x59f5b6['options']);var _0x5a0d17={'where':_0x3dc66f['where']};return db[_0x5ed3('0x2b')][_0x5ed3('0x1f')](_0x5a0d17)[_0x5ed3('0x25')](function(_0x4e9be6){_0x39a517[_0x5ed3('0x1f')]=_0x4e9be6;if(_0x59f5b6[_0x5ed3('0x31')][_0x5ed3('0x40')]){_0x3dc66f[_0x5ed3('0x41')]=[{'all':!![]}];}return db[_0x5ed3('0x2b')][_0x5ed3('0x42')](_0x3dc66f);})[_0x5ed3('0x25')](function(_0x52b831){_0x39a517['rows']=_0x52b831;return _0x39a517;})['then'](respondWithFilteredResult(_0x1c5d91,_0x3dc66f))[_0x5ed3('0x43')](handleError(_0x1c5d91,null));};exports[_0x5ed3('0x44')]=function(_0xd8f444,_0x4f322b){var _0x1c8b81={'raw':!![],'where':{'id':_0xd8f444['params']['id']}},_0x3f9bff={};_0x3f9bff[_0x5ed3('0x34')]=_[_0x5ed3('0x30')](db[_0x5ed3('0x2b')][_0x5ed3('0x2c')]);_0x3f9bff[_0x5ed3('0x31')]=_[_0x5ed3('0x30')](_0xd8f444[_0x5ed3('0x31')]);_0x3f9bff['filters']=_[_0x5ed3('0x33')](_0x3f9bff['model'],_0x3f9bff[_0x5ed3('0x31')]);_0x1c8b81[_0x5ed3('0x36')]=_[_0x5ed3('0x33')](_0x3f9bff[_0x5ed3('0x34')],qs['fields'](_0xd8f444['query']['fields']));_0x1c8b81[_0x5ed3('0x36')]=_0x1c8b81[_0x5ed3('0x36')][_0x5ed3('0x37')]?_0x1c8b81[_0x5ed3('0x36')]:_0x3f9bff[_0x5ed3('0x34')];if(_0xd8f444[_0x5ed3('0x31')][_0x5ed3('0x40')]){_0x1c8b81[_0x5ed3('0x41')]=[{'all':!![]}];}_0x1c8b81=_[_0x5ed3('0x3d')]({},_0x1c8b81,_0xd8f444['options']);return db[_0x5ed3('0x2b')][_0x5ed3('0x45')](_0x1c8b81)[_0x5ed3('0x25')](handleEntityNotFound(_0x4f322b,null))['then'](respondWithResult(_0x4f322b,null))[_0x5ed3('0x43')](handleError(_0x4f322b,null));};exports[_0x5ed3('0x46')]=function(_0x4d8182,_0x161553){return db[_0x5ed3('0x2b')]['create'](_0x4d8182['body'],{})['then'](respondWithResult(_0x161553,0xc9))['catch'](handleError(_0x161553,null));};exports[_0x5ed3('0x47')]=function(_0xde09a7,_0x10dd9f){return db['CmHopperHistory'][_0x5ed3('0x47')]()[_0x5ed3('0x25')](respondWithResult(_0x10dd9f,null))[_0x5ed3('0x43')](handleError(_0x10dd9f,null));};exports[_0x5ed3('0x24')]=function(_0xaa4af4,_0xa6317d){if(_0xaa4af4[_0x5ed3('0x48')][_0x5ed3('0x49')]){delete _0xaa4af4[_0x5ed3('0x48')][_0x5ed3('0x49')];}return db[_0x5ed3('0x2b')]['find']({'where':{'uniqueid':_0xaa4af4['params']['id']}})['then'](handleEntityNotFound(_0xa6317d,null))[_0x5ed3('0x25')](saveUpdates(_0xaa4af4[_0x5ed3('0x48')],null))[_0x5ed3('0x25')](respondWithResult(_0xa6317d,null))[_0x5ed3('0x43')](handleError(_0xa6317d,null));}; \ No newline at end of file +var _0x9083=['send','index','CmHopperHistory','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','describe','uniqueid','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name'];(function(_0x38e51f,_0x2d7948){var _0x70495c=function(_0x163619){while(--_0x163619){_0x38e51f['push'](_0x38e51f['shift']());}};_0x70495c(++_0x2d7948);}(_0x9083,0x10a));var _0x3908=function(_0x32966b,_0x2e8b06){_0x32966b=_0x32966b-0x0;var _0xa91d0d=_0x9083[_0x32966b];return _0xa91d0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3908('0x0'));var zipdir=require(_0x3908('0x1'));var jsonpatch=require(_0x3908('0x2'));var rp=require(_0x3908('0x3'));var moment=require(_0x3908('0x4'));var BPromise=require(_0x3908('0x5'));var Mustache=require('mustache');var util=require(_0x3908('0x6'));var path=require(_0x3908('0x7'));var sox=require(_0x3908('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3908('0x9'));var _=require(_0x3908('0xa'));var squel=require('squel');var crypto=require(_0x3908('0xb'));var jsforce=require(_0x3908('0xc'));var deskjs=require(_0x3908('0xd'));var toCsv=require(_0x3908('0xe'));var querystring=require(_0x3908('0xf'));var Papa=require(_0x3908('0x10'));var Redis=require(_0x3908('0x11'));var authService=require(_0x3908('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3908('0x13'));var hardwareService=require(_0x3908('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3908('0x15'));var db=require(_0x3908('0x16'))['db'];function respondWithStatusCode(_0x3da6f6,_0x3dd741){_0x3dd741=_0x3dd741||0xcc;return function(_0x1e706e){if(_0x1e706e){return _0x3da6f6['sendStatus'](_0x3dd741);}return _0x3da6f6['status'](_0x3dd741)['end']();};}function respondWithResult(_0x5d974a,_0xe802ed){_0xe802ed=_0xe802ed||0xc8;return function(_0x55f882){if(_0x55f882){return _0x5d974a[_0x3908('0x17')](_0xe802ed)[_0x3908('0x18')](_0x55f882);}};}function respondWithFilteredResult(_0x37a290,_0xe8777a){return function(_0x31f563){if(_0x31f563){var _0x27855e=typeof _0xe8777a[_0x3908('0x19')]===_0x3908('0x1a')&&typeof _0xe8777a[_0x3908('0x1b')]==='undefined';var _0x42188b=_0x31f563[_0x3908('0x1c')];var _0x2ecb41=_0x27855e?0x0:_0xe8777a['offset'];var _0x2fb8c7=_0x27855e?_0x31f563['count']:_0xe8777a['offset']+_0xe8777a[_0x3908('0x1b')];var _0x35a2a2;if(_0x2fb8c7>=_0x42188b){_0x2fb8c7=_0x42188b;_0x35a2a2=0xc8;}else{_0x35a2a2=0xce;}_0x37a290['status'](_0x35a2a2);return _0x37a290[_0x3908('0x1d')](_0x3908('0x1e'),_0x2ecb41+'-'+_0x2fb8c7+'/'+_0x42188b)[_0x3908('0x18')](_0x31f563);}return null;};}function patchUpdates(_0x50ee08){return function(_0x2c8318){try{jsonpatch[_0x3908('0x1f')](_0x2c8318,_0x50ee08,!![]);}catch(_0x26cb32){return BPromise['reject'](_0x26cb32);}return _0x2c8318['save']();};}function saveUpdates(_0x528b79,_0x3cfd6b){return function(_0x4f889f){if(_0x4f889f){return _0x4f889f[_0x3908('0x20')](_0x528b79)['then'](function(_0x1b5f38){return _0x1b5f38;});}return null;};}function removeEntity(_0x2f371c,_0x194ed5){return function(_0x281e33){if(_0x281e33){return _0x281e33[_0x3908('0x21')]()[_0x3908('0x22')](function(){_0x2f371c[_0x3908('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2cca,_0x59633e){return function(_0x241040){if(!_0x241040){_0x5b2cca['sendStatus'](0x194);}return _0x241040;};}function handleError(_0x319c91,_0x5a95aa){_0x5a95aa=_0x5a95aa||0x1f4;return function(_0x4ed824){logger[_0x3908('0x23')](_0x4ed824[_0x3908('0x24')]);if(_0x4ed824['name']){delete _0x4ed824[_0x3908('0x25')];}_0x319c91[_0x3908('0x17')](_0x5a95aa)[_0x3908('0x26')](_0x4ed824);};}exports[_0x3908('0x27')]=function(_0x4716d4,_0x2ff353){var _0x250ac0={},_0x5015cb={},_0x517b61={'count':0x0,'rows':[]};var _0x4ccf9c=_['map'](db[_0x3908('0x28')][_0x3908('0x29')],function(_0x22bf52){return{'name':_0x22bf52[_0x3908('0x2a')],'type':_0x22bf52['type'][_0x3908('0x2b')]};});_0x5015cb[_0x3908('0x2c')]=_[_0x3908('0x2d')](_0x4ccf9c,_0x3908('0x25'));_0x5015cb['query']=_[_0x3908('0x2e')](_0x4716d4['query']);_0x5015cb[_0x3908('0x2f')]=_[_0x3908('0x30')](_0x5015cb[_0x3908('0x2c')],_0x5015cb['query']);_0x250ac0[_0x3908('0x31')]=_['intersection'](_0x5015cb['model'],qs[_0x3908('0x32')](_0x4716d4[_0x3908('0x33')]['fields']));_0x250ac0[_0x3908('0x31')]=_0x250ac0[_0x3908('0x31')]['length']?_0x250ac0[_0x3908('0x31')]:_0x5015cb[_0x3908('0x2c')];if(!_0x4716d4[_0x3908('0x33')][_0x3908('0x34')](_0x3908('0x35'))){_0x250ac0[_0x3908('0x1b')]=qs[_0x3908('0x1b')](_0x4716d4[_0x3908('0x33')][_0x3908('0x1b')]);_0x250ac0[_0x3908('0x19')]=qs[_0x3908('0x19')](_0x4716d4[_0x3908('0x33')][_0x3908('0x19')]);}_0x250ac0[_0x3908('0x36')]=qs[_0x3908('0x37')](_0x4716d4[_0x3908('0x33')]['sort']);_0x250ac0[_0x3908('0x38')]=qs['filters'](_[_0x3908('0x39')](_0x4716d4[_0x3908('0x33')],_0x5015cb['filters']),_0x4ccf9c);if(_0x4716d4[_0x3908('0x33')][_0x3908('0x3a')]){_0x250ac0['where']=_[_0x3908('0x3b')](_0x250ac0['where'],{'$or':_[_0x3908('0x2d')](_0x4ccf9c,function(_0x8c7409){if(_0x8c7409[_0x3908('0x3c')]!==_0x3908('0x3d')){var _0x51ac0b={};_0x51ac0b[_0x8c7409[_0x3908('0x25')]]={'$like':'%'+_0x4716d4[_0x3908('0x33')][_0x3908('0x3a')]+'%'};return _0x51ac0b;}})});}_0x250ac0=_[_0x3908('0x3b')]({},_0x250ac0,_0x4716d4[_0x3908('0x3e')]);var _0x5585b6={'where':_0x250ac0['where']};return db[_0x3908('0x28')][_0x3908('0x1c')](_0x5585b6)[_0x3908('0x22')](function(_0x34e077){_0x517b61[_0x3908('0x1c')]=_0x34e077;if(_0x4716d4[_0x3908('0x33')][_0x3908('0x3f')]){_0x250ac0[_0x3908('0x40')]=[{'all':!![]}];}return db[_0x3908('0x28')][_0x3908('0x41')](_0x250ac0);})['then'](function(_0x212ed3){_0x517b61[_0x3908('0x42')]=_0x212ed3;return _0x517b61;})[_0x3908('0x22')](respondWithFilteredResult(_0x2ff353,_0x250ac0))[_0x3908('0x43')](handleError(_0x2ff353,null));};exports[_0x3908('0x44')]=function(_0x1a5533,_0x1dbb5a){var _0x4a8ad9={'raw':!![],'where':{'id':_0x1a5533[_0x3908('0x45')]['id']}},_0x519f69={};_0x519f69[_0x3908('0x2c')]=_[_0x3908('0x2e')](db[_0x3908('0x28')][_0x3908('0x29')]);_0x519f69[_0x3908('0x33')]=_[_0x3908('0x2e')](_0x1a5533[_0x3908('0x33')]);_0x519f69[_0x3908('0x2f')]=_['intersection'](_0x519f69[_0x3908('0x2c')],_0x519f69['query']);_0x4a8ad9[_0x3908('0x31')]=_[_0x3908('0x30')](_0x519f69[_0x3908('0x2c')],qs[_0x3908('0x32')](_0x1a5533[_0x3908('0x33')][_0x3908('0x32')]));_0x4a8ad9[_0x3908('0x31')]=_0x4a8ad9['attributes'][_0x3908('0x46')]?_0x4a8ad9[_0x3908('0x31')]:_0x519f69[_0x3908('0x2c')];if(_0x1a5533[_0x3908('0x33')][_0x3908('0x3f')]){_0x4a8ad9['include']=[{'all':!![]}];}_0x4a8ad9=_[_0x3908('0x3b')]({},_0x4a8ad9,_0x1a5533[_0x3908('0x3e')]);return db['CmHopperHistory']['find'](_0x4a8ad9)['then'](handleEntityNotFound(_0x1dbb5a,null))[_0x3908('0x22')](respondWithResult(_0x1dbb5a,null))[_0x3908('0x43')](handleError(_0x1dbb5a,null));};exports[_0x3908('0x47')]=function(_0x18975e,_0x165083){return db[_0x3908('0x28')]['create'](_0x18975e['body'],{})[_0x3908('0x22')](respondWithResult(_0x165083,0xc9))[_0x3908('0x43')](handleError(_0x165083,null));};exports['describe']=function(_0x232568,_0x277893){return db['CmHopperHistory'][_0x3908('0x48')]()[_0x3908('0x22')](respondWithResult(_0x277893,null))[_0x3908('0x43')](handleError(_0x277893,null));};exports[_0x3908('0x20')]=function(_0x295ac3,_0x28c502){if(_0x295ac3['body'][_0x3908('0x49')]){delete _0x295ac3[_0x3908('0x4a')][_0x3908('0x49')];}return db[_0x3908('0x28')][_0x3908('0x4b')]({'where':{'uniqueid':_0x295ac3[_0x3908('0x45')]['id']}})[_0x3908('0x22')](handleEntityNotFound(_0x28c502,null))[_0x3908('0x22')](saveUpdates(_0x295ac3['body'],null))['then'](respondWithResult(_0x28c502,null))['catch'](handleError(_0x28c502,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8196afb..44869b7 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 _0xf02c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1c38ee,_0x3fc5dc){var _0x1af302=function(_0x389561){while(--_0x389561){_0x1c38ee['push'](_0x1c38ee['shift']());}};_0x1af302(++_0x3fc5dc);}(_0xf02c,0x92));var _0xcf02=function(_0x19358a,_0x43c9d8){_0x19358a=_0x19358a-0x0;var _0x413a20=_0xf02c[_0x19358a];return _0x413a20;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var logger=require(_0xcf02('0x2'))(_0xcf02('0x3'));var moment=require(_0xcf02('0x4'));var BPromise=require(_0xcf02('0x5'));var rp=require(_0xcf02('0x6'));var fs=require('fs');var path=require(_0xcf02('0x7'));var rimraf=require(_0xcf02('0x8'));var config=require(_0xcf02('0x9'));var attributes=require(_0xcf02('0xa'));module[_0xcf02('0xb')]=function(_0x162df7,_0x2fe41e){return _0x162df7[_0xcf02('0xc')]('CmHopperHistory',attributes,{'tableName':_0xcf02('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':'uniqueid','fields':[_0xcf02('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0xabad,0x150));var _0xdaba=function(_0x3592ab,_0x4f669a){_0x3592ab=_0x3592ab-0x0;var _0x13298a=_0xabad[_0x3592ab];return _0x13298a;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xdaba('0xc')]},{'name':_0xdaba('0xd'),'fields':[_0xdaba('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b49b9f1..92189cd 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 _0x97f4=['outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x97f4,0x166));var _0x497f=function(_0x54f7bd,_0x3079e7){_0x54f7bd=_0x54f7bd-0x0;var _0x8121b2=_0x97f4[_0x54f7bd];return _0x8121b2;};'use strict';var _=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var moment=require(_0x497f('0x2'));var BPromise=require(_0x497f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x497f('0x4'));var db=require(_0x497f('0x5'))['db'];var utils=require(_0x497f('0x6'));var logger=require(_0x497f('0x7'))(_0x497f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x497f('0x9')][_0x497f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b15d,_0x3b23df,_0x134614){return new BPromise(function(_0x1b5224,_0x2e6ad0){return client['request'](_0x19b15d,_0x134614)[_0x497f('0xb')](function(_0x401948){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x3b23df,_0x497f('0xc'));logger[_0x497f('0xd')](_0x497f('0xe'),_0x3b23df,_0x497f('0xc'),JSON[_0x497f('0xf')](_0x401948));if(_0x401948[_0x497f('0x10')]){if(_0x401948[_0x497f('0x10')][_0x497f('0x11')]===0x1f4){logger[_0x497f('0x10')](_0x497f('0x12'),_0x3b23df,_0x401948[_0x497f('0x10')][_0x497f('0x13')]);return _0x2e6ad0(_0x401948['error'][_0x497f('0x13')]);}logger[_0x497f('0x10')](_0x497f('0x12'),_0x3b23df,_0x401948[_0x497f('0x10')]['message']);return _0x1b5224(_0x401948[_0x497f('0x10')][_0x497f('0x13')]);}else{logger[_0x497f('0x14')](_0x497f('0x12'),_0x3b23df,'request\x20sent');_0x1b5224(_0x401948[_0x497f('0x15')][_0x497f('0x13')]);}})[_0x497f('0x16')](function(_0x3b45c6){logger['error'](_0x497f('0x12'),_0x3b23df,_0x3b45c6);_0x2e6ad0(_0x3b45c6);});});}exports['CreateCmHopperHistory']=function(_0x59d7c3){var _0x5b0e9b=this;return new Promise(function(_0x2ef389,_0x28f84d){return db[_0x497f('0x17')]['create'](_0x59d7c3[_0x497f('0x18')],{'raw':_0x59d7c3[_0x497f('0x19')]?_0x59d7c3[_0x497f('0x19')][_0x497f('0x1a')]===undefined?!![]:![]:!![]})[_0x497f('0xb')](function(_0x3fd9a7){logger['info'](_0x497f('0x1b'),_0x59d7c3);logger['debug'](_0x497f('0x1b'),_0x59d7c3,JSON[_0x497f('0xf')](_0x3fd9a7));_0x2ef389(_0x3fd9a7);})['catch'](function(_0x1bb997){logger[_0x497f('0x10')](_0x497f('0x1b'),_0x1bb997[_0x497f('0x13')],_0x59d7c3);_0x28f84d(_0x5b0e9b['error'](0x1f4,_0x1bb997[_0x497f('0x13')]));});});};exports[_0x497f('0x1c')]=function(_0x47201b){var _0x14f81e=this;return new Promise(function(_0x27c2e1,_0x26dbf6){return db[_0x497f('0x17')]['findAll']({'raw':_0x47201b[_0x497f('0x19')]?_0x47201b[_0x497f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47201b['options']?_0x47201b[_0x497f('0x19')][_0x497f('0x1d')]||null:null,'attributes':[[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db['sequelize']['col']('id')),_0x497f('0x20')],[db['sequelize']['fn']('COUNT',db[_0x497f('0x1e')]['fn']('IF',db['sequelize'][_0x497f('0x21')](_0x497f('0x22')))),_0x497f('0x23')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db['sequelize'][_0x497f('0x21')](_0x497f('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db['sequelize']['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0x497f('0x25')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x26'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')](_0x497f('0x27')))),_0x497f('0x28')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x26'),db[_0x497f('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x497f('0x29')))),_0x497f('0x2a')]]})['then'](function(_0x5dd21e){logger[_0x497f('0x14')](_0x497f('0x1c'),_0x47201b);logger['debug']('AvgHandleTime',_0x47201b,JSON[_0x497f('0xf')](_0x5dd21e));_0x27c2e1(_0x5dd21e);})[_0x497f('0x16')](function(_0x1d86b7){logger[_0x497f('0x10')](_0x497f('0x1c'),_0x1d86b7[_0x497f('0x13')],_0x47201b);_0x26dbf6(_0x14f81e[_0x497f('0x10')](0x1f4,_0x1d86b7[_0x497f('0x13')]));});});};exports[_0x497f('0x2b')]=function(_0x445e8f){var _0x3b5dab=this;return new Promise(function(_0x126e02,_0x183d8b){return db[_0x497f('0x17')]['findAll']({'raw':_0x445e8f[_0x497f('0x19')]?_0x445e8f[_0x497f('0x19')][_0x497f('0x1a')]===undefined?!![]:![]:!![],'where':_0x445e8f['options']?_0x445e8f['options'][_0x497f('0x1d')]||null:null,'attributes':[['campaign',_0x497f('0x2c')],[db['sequelize']['fn'](_0x497f('0x1f'),db['sequelize']['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0x497f('0x2d')],[db['sequelize']['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x497f('0x2e')))),_0x497f('0x2f')],[db[_0x497f('0x1e')]['fn']('COUNT',db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x497f('0x30')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')]['literal'](_0x497f('0x31')))),_0x497f('0x32')],[db['sequelize']['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')](_0x497f('0x33')))),_0x497f('0x34')],[db['sequelize']['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')]['literal'](_0x497f('0x35')))),_0x497f('0x36')],[db[_0x497f('0x1e')]['fn']('COUNT',db[_0x497f('0x1e')]['fn']('IF',db['sequelize'][_0x497f('0x21')](_0x497f('0x37')))),_0x497f('0x38')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')](_0x497f('0x39')))),'outboundBlacklistCallsDay'],[db[_0x497f('0x1e')]['fn']('COUNT',db[_0x497f('0x1e')]['fn']('IF',db['sequelize'][_0x497f('0x21')](_0x497f('0x3a')))),_0x497f('0x3b')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0x497f('0x3c')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db['sequelize']['fn']('IF',db[_0x497f('0x1e')]['literal'](_0x497f('0x3d')))),_0x497f('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')](_0x497f('0x3f')))),_0x497f('0x3c')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db[_0x497f('0x1e')][_0x497f('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x497f('0x40')]],'group':[_0x497f('0x41')]})[_0x497f('0xb')](function(_0x40e656){logger['info'](_0x497f('0x2b'),_0x445e8f);logger['debug']('GetVoiceQueueHopperHistory',_0x445e8f,JSON[_0x497f('0xf')](_0x40e656));_0x126e02(_0x40e656);})[_0x497f('0x16')](function(_0x40b35c){logger['error']('GetVoiceQueueHopperHistory',_0x40b35c[_0x497f('0x13')],_0x445e8f);_0x183d8b(_0x3b5dab[_0x497f('0x10')](0x1f4,_0x40b35c['message']));});});};exports[_0x497f('0x42')]=function(_0x254ba0){var _0x75c480=this;return new Promise(function(_0xf5b1e6,_0x4fd837){return db[_0x497f('0x17')]['findAll']({'raw':_0x254ba0[_0x497f('0x19')]?_0x254ba0[_0x497f('0x19')][_0x497f('0x1a')]===undefined?!![]:![]:!![],'where':_0x254ba0[_0x497f('0x19')]?_0x254ba0[_0x497f('0x19')]['where']||null:null,'attributes':[['campaign',_0x497f('0x2c')],[db[_0x497f('0x1e')]['fn']('COUNT',db['sequelize'][_0x497f('0x43')]('id')),_0x497f('0x44')],[db[_0x497f('0x1e')]['fn'](_0x497f('0x1f'),db[_0x497f('0x1e')]['fn']('IF',db['sequelize'][_0x497f('0x21')](_0x497f('0x22')))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x3bcb41){logger['info'](_0x497f('0x42'),_0x254ba0);logger[_0x497f('0xd')](_0x497f('0x42'),_0x254ba0,JSON['stringify'](_0x3bcb41));_0xf5b1e6(_0x3bcb41);})[_0x497f('0x16')](function(_0x486f4f){logger[_0x497f('0x10')]('GetCampaignHopperHistory',_0x486f4f['message'],_0x254ba0);_0x4fd837(_0x75c480['error'](0x1f4,_0x486f4f[_0x497f('0x13')]));});});}; \ No newline at end of file +var _0xa74f=['GetVoiceQueueHopperHistory','findAll','raw','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','where','sequelize','col','predictiveIntervalTotalCalls','literal','COUNT','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime'];(function(_0x51b064,_0x3be4ff){var _0x1b726f=function(_0x2217b5){while(--_0x2217b5){_0x51b064['push'](_0x51b064['shift']());}};_0x1b726f(++_0x3be4ff);}(_0xa74f,0x9a));var _0xfa74=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xa74f[_0x1fa759];return _0x2da9f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateCmHopperHistory',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateCmHopperHistory',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});};exports['AvgHandleTime']=function(_0x529810){var _0x42c439=this;return new Promise(function(_0x286d6a,_0x42d9bf){return db['CmHopperHistory']['findAll']({'raw':_0x529810[_0xfa74('0x16')]?_0x529810[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x529810[_0xfa74('0x16')]?_0x529810['options'][_0xfa74('0x17')]||null:null,'attributes':[[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')][_0xfa74('0x19')]('id')),_0xfa74('0x1a')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xfa74('0x1b')]('`state`\x20=\x2010,\x201,\x20null'))),_0xfa74('0x1d')],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2011,\x201,\x20null'))),_0xfa74('0x1e')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1f'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x20')))),'predictiveIntervalAvgHoldtime'],[db[_0xfa74('0x18')]['fn']('AVG',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x21')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x390ed4){logger[_0xfa74('0x8')](_0xfa74('0x22'),_0x529810);logger[_0xfa74('0xa')]('AvgHandleTime',_0x529810,JSON[_0xfa74('0xc')](_0x390ed4));_0x286d6a(_0x390ed4);})[_0xfa74('0x12')](function(_0x501a70){logger['error']('AvgHandleTime',_0x501a70['message'],_0x529810);_0x42d9bf(_0x42c439['error'](0x1f4,_0x501a70[_0xfa74('0xf')]));});});};exports[_0xfa74('0x23')]=function(_0x3dcda3){var _0x235607=this;return new Promise(function(_0x2ab5a9,_0x304f6e){return db[_0xfa74('0x14')][_0xfa74('0x24')]({'raw':_0x3dcda3[_0xfa74('0x16')]?_0x3dcda3['options'][_0xfa74('0x25')]===undefined?!![]:![]:!![],'where':_0x3dcda3[_0xfa74('0x16')]?_0x3dcda3[_0xfa74('0x16')][_0xfa74('0x17')]||null:null,'attributes':[[_0xfa74('0x26'),_0xfa74('0x27')],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x200,\x201,\x20null'))),_0xfa74('0x28')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db['sequelize'][_0xfa74('0x1b')](_0xfa74('0x29')))),_0xfa74('0x2a')],[db['sequelize']['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2b')))),'outboundAnswerCallsDay'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xfa74('0x2c')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2d')))),'outboundCongestionCallsDay'],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xfa74('0x2e')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x2f')))),_0xfa74('0x30')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x31')))),_0xfa74('0x32')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')]('`state`\x20=\x2013,\x201,\x20null'))),_0xfa74('0x33')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x34')))),_0xfa74('0x35')],[db['sequelize']['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x36')))),_0xfa74('0x37')],[db[_0xfa74('0x18')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfa74('0x18')][_0xfa74('0x1b')](_0xfa74('0x38')))),_0xfa74('0x39')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')]['fn']('IF',db[_0xfa74('0x18')]['literal'](_0xfa74('0x3a')))),_0xfa74('0x37')],[db[_0xfa74('0x18')]['fn'](_0xfa74('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xfa74('0x1b')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xfa74('0x3b')]],'group':[_0xfa74('0x26')]})[_0xfa74('0x7')](function(_0x33e31e){logger[_0xfa74('0x8')](_0xfa74('0x23'),_0x3dcda3);logger[_0xfa74('0xa')]('GetVoiceQueueHopperHistory',_0x3dcda3,JSON[_0xfa74('0xc')](_0x33e31e));_0x2ab5a9(_0x33e31e);})['catch'](function(_0x21d7c5){logger['error']('GetVoiceQueueHopperHistory',_0x21d7c5[_0xfa74('0xf')],_0x3dcda3);_0x304f6e(_0x235607[_0xfa74('0xd')](0x1f4,_0x21d7c5['message']));});});};exports['GetCampaignHopperHistory']=function(_0x6e588d){var _0x1ab715=this;return new Promise(function(_0x8afe72,_0x234899){return db[_0xfa74('0x14')][_0xfa74('0x24')]({'raw':_0x6e588d[_0xfa74('0x16')]?_0x6e588d[_0xfa74('0x16')][_0xfa74('0x25')]===undefined?!![]:![]:!![],'where':_0x6e588d[_0xfa74('0x16')]?_0x6e588d['options'][_0xfa74('0x17')]||null:null,'attributes':[[_0xfa74('0x26'),'name'],[db['sequelize']['fn'](_0xfa74('0x1c'),db[_0xfa74('0x18')][_0xfa74('0x19')]('id')),_0xfa74('0x3c')],[db[_0xfa74('0x18')]['fn']('COUNT',db[_0xfa74('0x18')]['fn']('IF',db['sequelize'][_0xfa74('0x1b')](_0xfa74('0x2b')))),_0xfa74('0x3d')]],'group':['campaign']})['then'](function(_0x2d300a){logger[_0xfa74('0x8')](_0xfa74('0x3e'),_0x6e588d);logger[_0xfa74('0xa')]('GetCampaignHopperHistory',_0x6e588d,JSON[_0xfa74('0xc')](_0x2d300a));_0x8afe72(_0x2d300a);})[_0xfa74('0x12')](function(_0x5a2494){logger[_0xfa74('0xd')](_0xfa74('0x3e'),_0x5a2494[_0xfa74('0xf')],_0x6e588d);_0x234899(_0x1ab715[_0xfa74('0xd')](0x1f4,_0x5a2494['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d4f245c..dec4e42 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 _0x4be0=['post','create','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x590d0d,_0x551341){var _0x31ffeb=function(_0x17b816){while(--_0x17b816){_0x590d0d['push'](_0x590d0d['shift']());}};_0x31ffeb(++_0x551341);}(_0x4be0,0x1f2));var _0x04be=function(_0x4c4360,_0x9c4b9f){_0x4c4360=_0x4c4360-0x0;var _0x514a90=_0x4be0[_0x4c4360];return _0x514a90;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x04be('0x0'));var timeout=require(_0x04be('0x1'));var express=require(_0x04be('0x2'));var router=express[_0x04be('0x3')]();var fs_extra=require(_0x04be('0x4'));var auth=require(_0x04be('0x5'));var interaction=require(_0x04be('0x6'));var config=require(_0x04be('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x04be('0x8')]('/',auth[_0x04be('0x9')](),controller[_0x04be('0xa')]);router[_0x04be('0x8')]('/describe',auth[_0x04be('0x9')](),controller[_0x04be('0xb')]);router[_0x04be('0x8')](_0x04be('0xc'),auth[_0x04be('0x9')](),controller[_0x04be('0xd')]);router[_0x04be('0xe')]('/',auth['isAuthenticated'](),controller[_0x04be('0xf')]);router['put'](_0x04be('0xc'),auth[_0x04be('0x9')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x282b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','create','update'];(function(_0x22d153,_0xbf9e99){var _0x434e8a=function(_0x1523d5){while(--_0x1523d5){_0x22d153['push'](_0x22d153['shift']());}};_0x434e8a(++_0xbf9e99);}(_0x282b,0x130));var _0xb282=function(_0x56f865,_0xd399c5){_0x56f865=_0x56f865-0x0;var _0x700c63=_0x282b[_0x56f865];return _0x700c63;};'use strict';var multer=require('multer');var util=require(_0xb282('0x0'));var path=require(_0xb282('0x1'));var timeout=require(_0xb282('0x2'));var express=require(_0xb282('0x3'));var router=express[_0xb282('0x4')]();var fs_extra=require(_0xb282('0x5'));var auth=require(_0xb282('0x6'));var interaction=require(_0xb282('0x7'));var config=require(_0xb282('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb282('0x9')]);router[_0xb282('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb282('0xa')](_0xb282('0xb'),auth[_0xb282('0xc')](),controller[_0xb282('0xd')]);router['post']('/',auth[_0xb282('0xc')](),controller[_0xb282('0xe')]);router['put'](_0xb282('0xb'),auth[_0xb282('0xc')](),controller[_0xb282('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 80f3b0f..0a7dda1 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 _0xc99e=['STRING','name','sequelize','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc99e,0x6e));var _0xec99=function(_0x237357,_0x3e668a){_0x237357=_0x237357-0x0;var _0x4ff3d3=_0xc99e[_0x237357];return _0x4ff3d3;};'use strict';var Sequelize=require(_0xec99('0x0'));module[_0xec99('0x1')]={'name':{'type':Sequelize[_0xec99('0x2')],'unique':_0xec99('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xec99('0x2')]},'dialPrefix':{'type':Sequelize[_0xec99('0x2')]}}; \ No newline at end of file +var _0xadf0=['name','exports','STRING'];(function(_0x5c36ef,_0x5c79cc){var _0x12e114=function(_0x50902a){while(--_0x50902a){_0x5c36ef['push'](_0x5c36ef['shift']());}};_0x12e114(++_0x5c79cc);}(_0xadf0,0x12d));var _0x0adf=function(_0x3035be,_0x3c5435){_0x3035be=_0x3035be-0x0;var _0x13d7a5=_0xadf0[_0x3035be];return _0x13d7a5;};'use strict';var Sequelize=require('sequelize');module[_0x0adf('0x0')]={'name':{'type':Sequelize[_0x0adf('0x1')],'unique':_0x0adf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0adf('0x1')]},'dialPrefix':{'type':Sequelize[_0x0adf('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a7fea9a..a43e1e5 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 _0x7c8d=['CmList','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','hasOwnProperty','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','message','getContacts','CustomFields','concat','cf_%d','CmCustomField','raw','now','format','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','Lists','destroy','error','stack','name','index','map'];(function(_0x4cdb31,_0x37b8ec){var _0x368569=function(_0x5e3906){while(--_0x5e3906){_0x4cdb31['push'](_0x4cdb31['shift']());}};_0x368569(++_0x37b8ec);}(_0x7c8d,0x16f));var _0xd7c8=function(_0x59713e,_0x2ceee3){_0x59713e=_0x59713e-0x0;var _0x55c806=_0x7c8d[_0x59713e];return _0x55c806;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7c8('0x0'));var zipdir=require(_0xd7c8('0x1'));var jsonpatch=require(_0xd7c8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd7c8('0x3'));var Mustache=require(_0xd7c8('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd7c8('0x5'));var ejs=require(_0xd7c8('0x6'));var fs=require('fs');var fs_extra=require(_0xd7c8('0x7'));var _=require(_0xd7c8('0x8'));var squel=require('squel');var crypto=require(_0xd7c8('0x9'));var jsforce=require(_0xd7c8('0xa'));var deskjs=require(_0xd7c8('0xb'));var toCsv=require(_0xd7c8('0x5'));var querystring=require(_0xd7c8('0xc'));var Papa=require('papaparse');var Redis=require(_0xd7c8('0xd'));var authService=require(_0xd7c8('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7c8('0xf'));var logger=require('../../config/logger')(_0xd7c8('0x10'));var utils=require(_0xd7c8('0x11'));var config=require(_0xd7c8('0x12'));var licenseUtil=require(_0xd7c8('0x13'));var db=require(_0xd7c8('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd7c8('0x15'),'port':0x18eb});var socket=require(_0xd7c8('0x16'))(new Redis(config['redis']));require(_0xd7c8('0x17'))[_0xd7c8('0x18')](socket);function respondWithStatusCode(_0x1b4d5b,_0x1d34a9){_0x1d34a9=_0x1d34a9||0xcc;return function(_0xcd6274){if(_0xcd6274){return _0x1b4d5b[_0xd7c8('0x19')](_0x1d34a9);}return _0x1b4d5b['status'](_0x1d34a9)[_0xd7c8('0x1a')]();};}function respondWithResult(_0x11b52d,_0x514866){_0x514866=_0x514866||0xc8;return function(_0x383433){if(_0x383433){return _0x11b52d[_0xd7c8('0x1b')](_0x514866)[_0xd7c8('0x1c')](_0x383433);}};}function respondWithFilteredResult(_0x581d97,_0xd9688f){return function(_0x1d2c9c){if(_0x1d2c9c){var _0x37683c=typeof _0xd9688f['offset']===_0xd7c8('0x1d')&&typeof _0xd9688f[_0xd7c8('0x1e')]===_0xd7c8('0x1d');var _0xf18ace=_0x1d2c9c[_0xd7c8('0x1f')];var _0x3cc949=_0x37683c?0x0:_0xd9688f['offset'];var _0x25199b=_0x37683c?_0x1d2c9c[_0xd7c8('0x1f')]:_0xd9688f[_0xd7c8('0x20')]+_0xd9688f[_0xd7c8('0x1e')];var _0x4726d4;if(_0x25199b>=_0xf18ace){_0x25199b=_0xf18ace;_0x4726d4=0xc8;}else{_0x4726d4=0xce;}_0x581d97[_0xd7c8('0x1b')](_0x4726d4);return _0x581d97[_0xd7c8('0x21')]('Content-Range',_0x3cc949+'-'+_0x25199b+'/'+_0xf18ace)[_0xd7c8('0x1c')](_0x1d2c9c);}return null;};}function patchUpdates(_0x341d9e){return function(_0x13a443){try{jsonpatch[_0xd7c8('0x22')](_0x13a443,_0x341d9e,!![]);}catch(_0x210096){return BPromise[_0xd7c8('0x23')](_0x210096);}return _0x13a443[_0xd7c8('0x24')]();};}function saveUpdates(_0x2b0b3f,_0x34c301){return function(_0x1e211e){if(_0x1e211e){return _0x1e211e[_0xd7c8('0x25')](_0x2b0b3f)['then'](function(_0x3c6edf){return _0x3c6edf;});}return null;};}function removeEntity(_0xfad956,_0x2bd2da){return function(_0x10db5d){if(_0x10db5d){return _0x10db5d['destroy']()[_0xd7c8('0x26')](function(){var _0x5d936d=_0x10db5d[_0xd7c8('0x27')]({'plain':!![]});var _0x414d95=_0xd7c8('0x28');return db['UserProfileResource'][_0xd7c8('0x29')]({'where':{'type':_0x414d95,'resourceId':_0x5d936d['id']}})[_0xd7c8('0x26')](function(){return _0x10db5d;});})[_0xd7c8('0x26')](function(){_0xfad956['status'](0xcc)[_0xd7c8('0x1a')]();});}};}function handleEntityNotFound(_0x65c1bc,_0x87539a){return function(_0x14a8e4){if(!_0x14a8e4){_0x65c1bc[_0xd7c8('0x19')](0x194);}return _0x14a8e4;};}function handleError(_0x1b0436,_0x2d8e2e){_0x2d8e2e=_0x2d8e2e||0x1f4;return function(_0x2c6cd1){logger[_0xd7c8('0x2a')](_0x2c6cd1[_0xd7c8('0x2b')]);if(_0x2c6cd1[_0xd7c8('0x2c')]){delete _0x2c6cd1[_0xd7c8('0x2c')];}_0x1b0436[_0xd7c8('0x1b')](_0x2d8e2e)['send'](_0x2c6cd1);};}exports[_0xd7c8('0x2d')]=function(_0x227650,_0x5440e5){var _0x22cb4e={},_0x3290fa={},_0x2e74d8={'count':0x0,'rows':[]};var _0x45eb9d=_[_0xd7c8('0x2e')](db[_0xd7c8('0x2f')]['rawAttributes'],function(_0xc30667){return{'name':_0xc30667[_0xd7c8('0x30')],'type':_0xc30667[_0xd7c8('0x31')][_0xd7c8('0x32')]};});_0x3290fa[_0xd7c8('0x33')]=_[_0xd7c8('0x2e')](_0x45eb9d,_0xd7c8('0x2c'));_0x3290fa[_0xd7c8('0x34')]=_[_0xd7c8('0x35')](_0x227650['query']);_0x3290fa[_0xd7c8('0x36')]=_[_0xd7c8('0x37')](_0x3290fa[_0xd7c8('0x33')],_0x3290fa[_0xd7c8('0x34')]);_0x22cb4e[_0xd7c8('0x38')]=_[_0xd7c8('0x37')](_0x3290fa[_0xd7c8('0x33')],qs['fields'](_0x227650[_0xd7c8('0x34')][_0xd7c8('0x39')]));_0x22cb4e[_0xd7c8('0x38')]=_0x22cb4e[_0xd7c8('0x38')]['length']?_0x22cb4e[_0xd7c8('0x38')]:_0x3290fa[_0xd7c8('0x33')];if(!_0x227650[_0xd7c8('0x34')]['hasOwnProperty'](_0xd7c8('0x3a'))){_0x22cb4e[_0xd7c8('0x1e')]=qs[_0xd7c8('0x1e')](_0x227650['query'][_0xd7c8('0x1e')]);_0x22cb4e[_0xd7c8('0x20')]=qs[_0xd7c8('0x20')](_0x227650[_0xd7c8('0x34')][_0xd7c8('0x20')]);}_0x22cb4e[_0xd7c8('0x3b')]=qs[_0xd7c8('0x3c')](_0x227650[_0xd7c8('0x34')][_0xd7c8('0x3c')]);_0x22cb4e[_0xd7c8('0x3d')]=qs['filters'](_[_0xd7c8('0x3e')](_0x227650['query'],_0x3290fa[_0xd7c8('0x36')]),_0x45eb9d);if(_0x227650['query'][_0xd7c8('0x3f')]){_0x22cb4e[_0xd7c8('0x3d')]=_[_0xd7c8('0x40')](_0x22cb4e['where'],{'$or':_['map'](_0x45eb9d,function(_0x2dde4e){if(_0x2dde4e[_0xd7c8('0x31')]!=='VIRTUAL'){var _0x4f9e24={};_0x4f9e24[_0x2dde4e[_0xd7c8('0x2c')]]={'$like':'%'+_0x227650[_0xd7c8('0x34')][_0xd7c8('0x3f')]+'%'};return _0x4f9e24;}})});}_0x22cb4e=_[_0xd7c8('0x40')]({},_0x22cb4e,_0x227650[_0xd7c8('0x41')]);var _0x540201={'where':_0x22cb4e[_0xd7c8('0x3d')]};return db[_0xd7c8('0x2f')]['count'](_0x540201)[_0xd7c8('0x26')](function(_0x688e28){_0x2e74d8[_0xd7c8('0x1f')]=_0x688e28;if(_0x227650[_0xd7c8('0x34')][_0xd7c8('0x42')]){_0x22cb4e['include']=[{'all':!![]}];}return db['CmList'][_0xd7c8('0x43')](_0x22cb4e);})[_0xd7c8('0x26')](function(_0x4350ed){_0x2e74d8[_0xd7c8('0x44')]=_0x4350ed;return _0x2e74d8;})[_0xd7c8('0x26')](respondWithFilteredResult(_0x5440e5,_0x22cb4e))[_0xd7c8('0x45')](handleError(_0x5440e5,null));};exports[_0xd7c8('0x46')]=function(_0x14c048,_0x365e50){var _0x423392={'raw':![],'where':{'id':_0x14c048[_0xd7c8('0x47')]['id']}},_0x3f6c9d={};_0x3f6c9d['model']=_['keys'](db['CmList'][_0xd7c8('0x48')]);_0x3f6c9d[_0xd7c8('0x34')]=_[_0xd7c8('0x35')](_0x14c048[_0xd7c8('0x34')]);_0x3f6c9d['filters']=_[_0xd7c8('0x37')](_0x3f6c9d[_0xd7c8('0x33')],_0x3f6c9d[_0xd7c8('0x34')]);_0x423392[_0xd7c8('0x38')]=_[_0xd7c8('0x37')](_0x3f6c9d[_0xd7c8('0x33')],qs[_0xd7c8('0x39')](_0x14c048[_0xd7c8('0x34')]['fields']));_0x423392[_0xd7c8('0x38')]=_0x423392[_0xd7c8('0x38')]['length']?_0x423392[_0xd7c8('0x38')]:_0x3f6c9d[_0xd7c8('0x33')];if(_0x14c048[_0xd7c8('0x34')][_0xd7c8('0x42')]){_0x423392[_0xd7c8('0x49')]=[{'all':!![]}];}_0x423392=_[_0xd7c8('0x40')]({},_0x423392,_0x14c048['options']);return db['CmList'][_0xd7c8('0x4a')](_0x423392)[_0xd7c8('0x26')](handleEntityNotFound(_0x365e50,null))['then'](respondWithResult(_0x365e50,null))[_0xd7c8('0x45')](handleError(_0x365e50,null));};exports[_0xd7c8('0x4b')]=function(_0x35e005,_0x4b717f){return db[_0xd7c8('0x2f')][_0xd7c8('0x4b')](_0x35e005['body'],{})[_0xd7c8('0x26')](function(_0x28a429){var _0x586e88=_0x35e005[_0xd7c8('0x4c')][_0xd7c8('0x27')]({'plain':!![]});if(!_0x586e88)throw new Error(_0xd7c8('0x4d'));if(_0x586e88[_0xd7c8('0x4e')]===_0xd7c8('0x4c')){var _0xf4ec41=_0x28a429[_0xd7c8('0x27')]({'plain':!![]});var _0x42c94f=_0xd7c8('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x42c94f,'userProfileId':_0x586e88['userProfileId']},'raw':!![]})[_0xd7c8('0x26')](function(_0x5f48c6){if(_0x5f48c6&&_0x5f48c6[_0xd7c8('0x4f')]===0x0){return db['UserProfileResource'][_0xd7c8('0x4b')]({'name':_0xf4ec41['name'],'resourceId':_0xf4ec41['id'],'type':_0x5f48c6['name'],'sectionId':_0x5f48c6['id']},{})[_0xd7c8('0x26')](function(){return _0x28a429;});}else{return _0x28a429;}})['catch'](function(_0x3d31a1){logger['error'](_0xd7c8('0x50'),_0x3d31a1);throw _0x3d31a1;});}return _0x28a429;})[_0xd7c8('0x26')](respondWithResult(_0x4b717f,0xc9))[_0xd7c8('0x45')](handleError(_0x4b717f,null));};exports['update']=function(_0x29831d,_0x3b750d){if(_0x29831d[_0xd7c8('0x51')]['id']){delete _0x29831d['body']['id'];}return db['CmList']['find']({'where':{'id':_0x29831d['params']['id']}})['then'](handleEntityNotFound(_0x3b750d,null))[_0xd7c8('0x26')](saveUpdates(_0x29831d['body'],null))[_0xd7c8('0x26')](respondWithResult(_0x3b750d,null))[_0xd7c8('0x45')](handleError(_0x3b750d,null));};exports[_0xd7c8('0x29')]=function(_0x30b0c5,_0x5a8192){return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0x30b0c5[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x5a8192,null))[_0xd7c8('0x26')](removeEntity(_0x5a8192,null))[_0xd7c8('0x45')](handleError(_0x5a8192,null));};exports[_0xd7c8('0x52')]=function(_0x10ca36,_0x306435){return db[_0xd7c8('0x2f')][_0xd7c8('0x52')]()[_0xd7c8('0x26')](respondWithResult(_0x306435,null))[_0xd7c8('0x45')](handleError(_0x306435,null));};exports[_0xd7c8('0x53')]=function(_0x2f1521,_0x237c0b,_0x3d5995){if(_0x2f1521[_0xd7c8('0x51')]['id']){delete _0x2f1521[_0xd7c8('0x51')]['id'];}return db[_0xd7c8('0x2f')]['find']({'where':{'id':_0x2f1521['params']['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x237c0b,null))[_0xd7c8('0x26')](function(_0x537875){if(_0x537875){_0x2f1521[_0xd7c8('0x51')][_0xd7c8('0x54')]=_0x537875['id'];return db[_0xd7c8('0x55')][_0xd7c8('0x4b')](_0x2f1521[_0xd7c8('0x51')]);}})[_0xd7c8('0x26')](respondWithResult(_0x237c0b,null))[_0xd7c8('0x45')](handleError(_0x237c0b,null));};exports[_0xd7c8('0x56')]=function(_0x3f0549,_0x2dbf03,_0x3c22e4){var _0x4eb8ef={'raw':![],'where':{}};var _0x438391={};var _0x165251={'count':0x0,'rows':[]};return db[_0xd7c8('0x2f')][_0xd7c8('0x57')]({'where':{'id':_0x3f0549[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x2dbf03,null))[_0xd7c8('0x26')](function(_0x21a923){if(_0x21a923){_0x438391[_0xd7c8('0x33')]=_[_0xd7c8('0x35')](db[_0xd7c8('0x55')]['rawAttributes']);_0x438391['query']=_[_0xd7c8('0x35')](_0x3f0549[_0xd7c8('0x34')]);_0x438391[_0xd7c8('0x36')]=_['intersection'](_0x438391[_0xd7c8('0x33')],_0x438391[_0xd7c8('0x34')]);_0x4eb8ef[_0xd7c8('0x38')]=_[_0xd7c8('0x37')](_0x438391[_0xd7c8('0x33')],qs['fields'](_0x3f0549[_0xd7c8('0x34')]['fields']));_0x4eb8ef['attributes']=_0x4eb8ef[_0xd7c8('0x38')][_0xd7c8('0x58')]?_0x4eb8ef['attributes']:_0x438391[_0xd7c8('0x33')];if(!_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x59')](_0xd7c8('0x3a'))){_0x4eb8ef[_0xd7c8('0x1e')]=qs[_0xd7c8('0x1e')](_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x1e')]);_0x4eb8ef[_0xd7c8('0x20')]=qs[_0xd7c8('0x20')](_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x20')]);}_0x4eb8ef[_0xd7c8('0x3b')]=qs[_0xd7c8('0x3c')](_0x3f0549['query'][_0xd7c8('0x3c')]);_0x4eb8ef[_0xd7c8('0x3d')]=qs[_0xd7c8('0x36')](_[_0xd7c8('0x3e')](_0x3f0549[_0xd7c8('0x34')],_0x438391['filters']));_0x4eb8ef[_0xd7c8('0x3d')][_0xd7c8('0x54')]=_0x21a923['id'];if(_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x3f')]){_0x4eb8ef[_0xd7c8('0x3d')]=_[_0xd7c8('0x40')](_0x4eb8ef[_0xd7c8('0x3d')],{'$or':_[_0xd7c8('0x2e')](_0x4eb8ef[_0xd7c8('0x38')],function(_0x1c5367){var _0x5acda6={};_0x5acda6[_0x1c5367]={'$like':'%'+_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x3f')]+'%'};return _0x5acda6;})});}_0x4eb8ef=_[_0xd7c8('0x40')]({},_0x4eb8ef,_0x3f0549[_0xd7c8('0x41')]);return db['Disposition']['count']({'where':_0x4eb8ef[_0xd7c8('0x3d')]})[_0xd7c8('0x26')](function(_0x412be4){_0x165251[_0xd7c8('0x1f')]=_0x412be4;if(_0x3f0549[_0xd7c8('0x34')][_0xd7c8('0x42')]){_0x4eb8ef[_0xd7c8('0x49')]=[{'all':!![]}];}return db[_0xd7c8('0x55')][_0xd7c8('0x43')](_0x4eb8ef);})[_0xd7c8('0x26')](function(_0x28417f){_0x165251[_0xd7c8('0x44')]=_0x28417f;return _0x165251;});}})[_0xd7c8('0x26')](respondWithFilteredResult(_0x2dbf03,_0x4eb8ef))[_0xd7c8('0x45')](handleError(_0x2dbf03,null));};exports[_0xd7c8('0x5a')]=function(_0x2ffa00,_0x8667fe,_0x33f53d){return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0x2ffa00[_0xd7c8('0x47')]['id']}})['then'](handleEntityNotFound(_0x8667fe,null))['then'](function(_0x3925fb){if(_0x3925fb){return _0x3925fb[_0xd7c8('0x5a')](_0x2ffa00['query'][_0xd7c8('0x5b')]);}})['then'](respondWithStatusCode(_0x8667fe,null))[_0xd7c8('0x45')](handleError(_0x8667fe,null));};exports[_0xd7c8('0x5c')]=function(_0x3ffb3b,_0x1fe819,_0x58ecea){return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0x3ffb3b[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x1fe819,null))[_0xd7c8('0x26')](function(_0x282b7c){if(_0x282b7c){var _0x44d6f4=[];var _0x1150ed={'success':[],'errors':[]};return db[_0xd7c8('0x5d')][_0xd7c8('0x52')]()[_0xd7c8('0x26')](function(_0x427131){if(_0x3ffb3b[_0xd7c8('0x51')]['tags']&&_['isArray'](_0x3ffb3b['body'][_0xd7c8('0x5e')])){if(_0x3ffb3b[_0xd7c8('0x51')][_0xd7c8('0x5e')][_0xd7c8('0x58')]){_0x3ffb3b['body'][_0xd7c8('0x5e')]=_0x3ffb3b['body'][_0xd7c8('0x5e')][_0xd7c8('0x5f')](';')+';';}else{_0x3ffb3b[_0xd7c8('0x51')]['tags']=null;}}else{_0x3ffb3b[_0xd7c8('0x51')]['tags']=null;}if(_0x3ffb3b[_0xd7c8('0x51')]&&_[_0xd7c8('0x60')](_0x3ffb3b[_0xd7c8('0x51')])){for(var _0x5eba2b=0x0;_0x5eba2b<_0x3ffb3b[_0xd7c8('0x51')][_0xd7c8('0x58')];_0x5eba2b+=0x1){_0x3ffb3b[_0xd7c8('0x51')][_0x5eba2b]['ListId']=_0x3ffb3b[_0xd7c8('0x47')]['id'];_0x44d6f4[_0xd7c8('0x61')](_0x3ffb3b[_0xd7c8('0x51')][_0x5eba2b]);}return BPromise[_0xd7c8('0x62')](_0x44d6f4,function(_0x5bd102){return db['CmContact']['create'](_[_0xd7c8('0x63')](_0x5bd102,[_0xd7c8('0x5b'),'id'])||{},{'fields':_[_0xd7c8('0x35')](_0x427131),'raw':!![]})['then'](function(_0x4f0f30){_0x1150ed[_0xd7c8('0x64')][_0xd7c8('0x61')](_0x4f0f30[_0xd7c8('0x65')]);})[_0xd7c8('0x45')](function(_0x3cb13d){_0x1150ed[_0xd7c8('0x66')][_0xd7c8('0x61')]({'data':_0x5bd102,'error':_0x3cb13d[_0xd7c8('0x67')]});});})[_0xd7c8('0x26')](function(_0x4c62dd){return _0x1150ed;})[_0xd7c8('0x45')](function(_0xb044c3){return _0xb044c3;});}else{_0x1fe819[_0xd7c8('0x1b')](0x190)[_0xd7c8('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xd7c8('0x26')](respondWithResult(_0x1fe819,null))[_0xd7c8('0x45')](handleError(_0x1fe819,null));};exports[_0xd7c8('0x68')]=function(_0x3cfd29,_0x351f27,_0x321227){var _0x400546;return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0x3cfd29[_0xd7c8('0x47')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd7c8('0x69')}]})[_0xd7c8('0x26')](handleEntityNotFound(_0x351f27,null))[_0xd7c8('0x26')](function(_0x27f090){if(_0x27f090){_0x400546=_0x27f090;return db[_0xd7c8('0x5d')][_0xd7c8('0x48')];}})['then'](function(_0x4ba4f4){if(_0x4ba4f4){var _0x2784aa={};var _0x1ca596={};_0x1ca596['model']=_[_0xd7c8('0x6a')](_[_0xd7c8('0x35')](_0x4ba4f4),_[_0xd7c8('0x2e')](_0x400546[_0xd7c8('0x69')],function(_0x15cc96){return util['format'](_0xd7c8('0x6b'),_0x15cc96['id']);}));_0x1ca596['query']=_[_0xd7c8('0x35')](_0x3cfd29['query']);_0x1ca596['filters']=_[_0xd7c8('0x37')](_0x1ca596[_0xd7c8('0x33')],_0x1ca596[_0xd7c8('0x34')]);_0x2784aa[_0xd7c8('0x38')]=_[_0xd7c8('0x37')](_0x1ca596[_0xd7c8('0x33')],qs[_0xd7c8('0x39')](_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x39')]));_0x2784aa[_0xd7c8('0x38')]=_0x2784aa[_0xd7c8('0x38')][_0xd7c8('0x58')]?_0x2784aa['attributes']:_0x1ca596[_0xd7c8('0x33')];if(!_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x59')](_0xd7c8('0x3a'))){_0x2784aa[_0xd7c8('0x1e')]=qs[_0xd7c8('0x1e')](_0x3cfd29[_0xd7c8('0x34')]['limit']);_0x2784aa[_0xd7c8('0x20')]=qs[_0xd7c8('0x20')](_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x20')]);}_0x2784aa[_0xd7c8('0x3b')]=qs[_0xd7c8('0x3c')](_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x3c')]);_0x2784aa[_0xd7c8('0x3d')]=qs[_0xd7c8('0x36')](_[_0xd7c8('0x3e')](_0x3cfd29[_0xd7c8('0x34')],_0x1ca596[_0xd7c8('0x36')]));_0x2784aa['raw']=!![];if(_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x3f')]){_0x2784aa['where']=_[_0xd7c8('0x40')](_0x2784aa['where'],{'$or':_[_0xd7c8('0x2e')](_0x2784aa[_0xd7c8('0x38')],function(_0x3ae8dd){var _0x29a06c={};_0x29a06c[_0x3ae8dd]={'$like':'%'+_0x3cfd29[_0xd7c8('0x34')][_0xd7c8('0x3f')]+'%'};return _0x29a06c;})});}_0x2784aa=_[_0xd7c8('0x40')]({},_0x2784aa,_0x3cfd29[_0xd7c8('0x41')]);return _0x400546['getContacts'](_0x2784aa);}})[_0xd7c8('0x26')](respondWithResult(_0x351f27,null))[_0xd7c8('0x45')](handleError(_0x351f27,null));};exports['getContactsCsv']=function(_0xee298e,_0x42c0be,_0x45b7f3){var _0x533a7c;return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0xee298e[_0xd7c8('0x47')]['id']},'include':[{'model':db[_0xd7c8('0x6c')],'as':'CustomFields'}]})[_0xd7c8('0x26')](handleEntityNotFound(_0x42c0be,null))[_0xd7c8('0x26')](function(_0x2a481e){if(_0x2a481e){_0x533a7c=_0x2a481e;return db['CmContact']['rawAttributes'];}})[_0xd7c8('0x26')](function(_0x54bf50){if(_0x54bf50){var _0xf15d76={};var _0x2fbb53={};_0x2fbb53[_0xd7c8('0x33')]=_['concat'](_[_0xd7c8('0x35')](_0x54bf50),_[_0xd7c8('0x2e')](_0x533a7c[_0xd7c8('0x69')],function(_0x2ea8a2){return util['format']('cf_%d',_0x2ea8a2['id']);}));_0x2fbb53[_0xd7c8('0x34')]=_[_0xd7c8('0x35')](_0xee298e['query']);_0x2fbb53['filters']=_[_0xd7c8('0x37')](_0x2fbb53[_0xd7c8('0x33')],_0x2fbb53[_0xd7c8('0x34')]);_0xf15d76['attributes']=_['intersection'](_0x2fbb53[_0xd7c8('0x33')],qs['fields'](_0xee298e[_0xd7c8('0x34')][_0xd7c8('0x39')]));_0xf15d76[_0xd7c8('0x38')]=_0xf15d76[_0xd7c8('0x38')][_0xd7c8('0x58')]?_0xf15d76[_0xd7c8('0x38')]:_0x2fbb53['model'];if(!_0xee298e['query']['hasOwnProperty'](_0xd7c8('0x3a'))){_0xf15d76[_0xd7c8('0x1e')]=qs[_0xd7c8('0x1e')](_0xee298e[_0xd7c8('0x34')][_0xd7c8('0x1e')]);_0xf15d76[_0xd7c8('0x20')]=qs[_0xd7c8('0x20')](_0xee298e['query'][_0xd7c8('0x20')]);}_0xf15d76['order']=qs[_0xd7c8('0x3c')](_0xee298e[_0xd7c8('0x34')]['sort']);_0xf15d76[_0xd7c8('0x3d')]=qs['filters'](_['pick'](_0xee298e['query'],_0x2fbb53[_0xd7c8('0x36')]));_0xf15d76[_0xd7c8('0x6d')]=!![];if(_0xee298e[_0xd7c8('0x34')]['filter']){_0xf15d76[_0xd7c8('0x3d')]=_[_0xd7c8('0x40')](_0xf15d76[_0xd7c8('0x3d')],{'$or':_['map'](_0xf15d76[_0xd7c8('0x38')],function(_0x2b05a3){var _0x5da50b={};_0x5da50b[_0x2b05a3]={'$like':'%'+_0xee298e[_0xd7c8('0x34')]['filter']+'%'};return _0x5da50b;})});}_0xf15d76=_[_0xd7c8('0x40')]({},_0xf15d76,_0xee298e[_0xd7c8('0x41')]);return _0x533a7c[_0xd7c8('0x68')](_0xf15d76);}})[_0xd7c8('0x26')](function(_0x276255){if(!_['isEmpty'](_0x276255)){var _0x30c9c0=toCsv(_0x276255);var _0x589160=Date[_0xd7c8('0x6e')]();fs['writeFileSync'](util[_0xd7c8('0x6f')](_0xd7c8('0x70'),_0x533a7c['id'],_0x589160),_0x30c9c0);_0x42c0be['setHeader'](_0xd7c8('0x71'),_0xd7c8('0x72')+util[_0xd7c8('0x6f')](_0xd7c8('0x73'),_0x533a7c['id'],_0x589160));_0x42c0be['setHeader']('Content-type',_0xd7c8('0x74'));return _0x42c0be[_0xd7c8('0x75')](util[_0xd7c8('0x6f')](_0xd7c8('0x70'),_0x533a7c['id'],_0x589160));}else{return _0x42c0be['sendStatus'](0xcc);}})['catch'](handleError(_0x42c0be,null));};exports['addCustomField']=function(_0x4da777,_0x275ec9,_0x258095){var _0x5dad9c;delete _0x4da777[_0xd7c8('0x51')]['id'];return db['CmList'][_0xd7c8('0x57')]({'where':{'id':_0x4da777[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x275ec9,null))['then'](function(_0x3d99b2){if(_0x3d99b2){return db[_0xd7c8('0x76')][_0xd7c8('0x77')](function(_0x4e31ae){return db['CmCustomField'][_0xd7c8('0x4b')](_0x4da777[_0xd7c8('0x51')],{'transaction':_0x4e31ae})[_0xd7c8('0x26')](function(_0x27896c){_0x5dad9c=_0x27896c;return _0x3d99b2[_0xd7c8('0x78')](_0x27896c,{'transaction':_0x4e31ae});})[_0xd7c8('0x26')](function(){var _0x22e6bb={'type':db['Sequelize'][_0xd7c8('0x79')],'transaction':_0x4e31ae};switch(_0x4da777[_0xd7c8('0x51')]['type']){case _0xd7c8('0x7a'):_0x22e6bb[_0xd7c8('0x31')]=db[_0xd7c8('0x7b')][_0xd7c8('0x79')];break;case _0xd7c8('0x7c'):_0x22e6bb[_0xd7c8('0x31')]=db[_0xd7c8('0x7b')][_0xd7c8('0x7d')];break;case _0xd7c8('0x7e'):_0x22e6bb[_0xd7c8('0x31')]=db[_0xd7c8('0x7b')][_0xd7c8('0x7f')];_0x22e6bb[_0xd7c8('0x80')]=![];break;default:}return db[_0xd7c8('0x76')][_0xd7c8('0x81')]['addColumn']('cm_contacts',util[_0xd7c8('0x6f')](_0xd7c8('0x82'),_0x5dad9c['id']),_0x22e6bb);})[_0xd7c8('0x26')](function(){return _0x5dad9c;});});}})[_0xd7c8('0x26')](respondWithResult(_0x275ec9,null))[_0xd7c8('0x45')](handleError(_0x275ec9,null));};exports[_0xd7c8('0x83')]=function(_0xc6dd62,_0x1437b8,_0x1142e5){var _0xa3242e={};var _0x1a3232={};var _0x49716e;var _0x3d9fa0;return db['CmList']['findOne']({'where':{'id':_0xc6dd62[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x1437b8,null))['then'](function(_0x52a01a){if(_0x52a01a){_0x49716e=_0x52a01a;_0x1a3232['model']=_[_0xd7c8('0x35')](db[_0xd7c8('0x6c')][_0xd7c8('0x48')]);_0x1a3232[_0xd7c8('0x34')]=_['keys'](_0xc6dd62['query']);_0x1a3232['filters']=_[_0xd7c8('0x37')](_0x1a3232[_0xd7c8('0x33')],_0x1a3232[_0xd7c8('0x34')]);_0xa3242e[_0xd7c8('0x38')]=_['intersection'](_0x1a3232[_0xd7c8('0x33')],qs[_0xd7c8('0x39')](_0xc6dd62[_0xd7c8('0x34')][_0xd7c8('0x39')]));_0xa3242e[_0xd7c8('0x38')]=_0xa3242e[_0xd7c8('0x38')]['length']?_0xa3242e['attributes']:_0x1a3232[_0xd7c8('0x33')];_0xa3242e[_0xd7c8('0x3b')]=qs['sort'](_0xc6dd62[_0xd7c8('0x34')][_0xd7c8('0x3c')]);_0xa3242e[_0xd7c8('0x3d')]=qs['filters'](_[_0xd7c8('0x3e')](_0xc6dd62['query'],_0x1a3232[_0xd7c8('0x36')]));_0xa3242e[_0xd7c8('0x3d')]=_['merge'](_0xa3242e['where'],{'$or':[{'ListId':_0x52a01a['id']},{'ListId':null}]});if(_0xc6dd62['query'][_0xd7c8('0x3f')]){_0xa3242e[_0xd7c8('0x3d')]=_[_0xd7c8('0x40')](_0xa3242e[_0xd7c8('0x3d')],{'$or':_[_0xd7c8('0x2e')](_0xa3242e[_0xd7c8('0x38')],function(_0x520f20){var _0x46b6d6={};_0x46b6d6[_0x520f20]={'$like':'%'+_0xc6dd62[_0xd7c8('0x34')][_0xd7c8('0x3f')]+'%'};return _0x46b6d6;})});}_0xa3242e=_[_0xd7c8('0x40')]({},_0xa3242e,_0xc6dd62[_0xd7c8('0x41')]);return db['CmCustomField'][_0xd7c8('0x84')](_0xa3242e);}})['then'](respondWithResult(_0x1437b8,null))[_0xd7c8('0x45')](handleError(_0x1437b8,null));};exports[_0xd7c8('0x85')]=function(_0x5e5274,_0x4a533b,_0x2905c7){return db[_0xd7c8('0x2f')][_0xd7c8('0x4a')]({'where':{'id':_0x5e5274[_0xd7c8('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a533b,null))[_0xd7c8('0x26')](function(_0x2db4b8){if(_0x2db4b8){return _0x2db4b8[_0xd7c8('0x85')](_0x5e5274[_0xd7c8('0x51')][_0xd7c8('0x5b')],_[_0xd7c8('0x63')](_0x5e5274[_0xd7c8('0x51')],[_0xd7c8('0x5b'),'id'])||{})['spread'](function(_0x147101){for(var _0x5d53ff=0x0;_0x5d53ff<_0x5e5274['body'][_0xd7c8('0x5b')]['length'];_0x5d53ff+=0x1){socket[_0xd7c8('0x86')]('userCmList:save',{'UserId':Number(_0x5e5274[_0xd7c8('0x51')][_0xd7c8('0x5b')][_0x5d53ff]),'CmListId':Number(_0x5e5274[_0xd7c8('0x47')]['id'])});}return _0x147101;});}})[_0xd7c8('0x26')](respondWithResult(_0x4a533b,null))[_0xd7c8('0x45')](handleError(_0x4a533b,null));};exports[_0xd7c8('0x87')]=function(_0x4c591a,_0x513e33,_0x1da3ae){return db['CmList'][_0xd7c8('0x4a')]({'where':{'id':_0x4c591a[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x513e33,null))[_0xd7c8('0x26')](function(_0x597533){if(_0x597533){return _0x597533['removeAgents'](_0x4c591a[_0xd7c8('0x34')]['ids'])[_0xd7c8('0x26')](function(){if(_['isArray'](_0x4c591a[_0xd7c8('0x34')][_0xd7c8('0x5b')])){for(var _0x567139=0x0;_0x567139<_0x4c591a[_0xd7c8('0x34')][_0xd7c8('0x5b')][_0xd7c8('0x58')];_0x567139+=0x1){socket[_0xd7c8('0x86')](_0xd7c8('0x88'),{'UserId':Number(_0x4c591a[_0xd7c8('0x34')][_0xd7c8('0x5b')][_0x567139]),'CmListId':Number(_0x4c591a['params']['id'])});}}else{socket[_0xd7c8('0x86')](_0xd7c8('0x88'),{'UserId':Number(_0x4c591a[_0xd7c8('0x34')]['ids']),'CmListId':Number(_0x4c591a[_0xd7c8('0x47')]['id'])});}});}})[_0xd7c8('0x26')](respondWithStatusCode(_0x513e33,null))[_0xd7c8('0x45')](handleError(_0x513e33,null));};exports[_0xd7c8('0x89')]=function(_0x3a5b6f,_0x4c1f96,_0x336f00){var _0x540f93={};var _0xfef860={};var _0x37a1a5;var _0x1006a4;return db[_0xd7c8('0x2f')][_0xd7c8('0x57')]({'where':{'id':_0x3a5b6f[_0xd7c8('0x47')]['id']}})[_0xd7c8('0x26')](handleEntityNotFound(_0x4c1f96,null))[_0xd7c8('0x26')](function(_0x3070ce){if(_0x3070ce){_0x37a1a5=_0x3070ce;_0xfef860[_0xd7c8('0x33')]=_[_0xd7c8('0x35')](db['User'][_0xd7c8('0x48')]);_0xfef860[_0xd7c8('0x34')]=_[_0xd7c8('0x35')](_0x3a5b6f['query']);_0xfef860['filters']=_[_0xd7c8('0x37')](_0xfef860[_0xd7c8('0x33')],_0xfef860[_0xd7c8('0x34')]);_0x540f93['attributes']=_[_0xd7c8('0x37')](_0xfef860[_0xd7c8('0x33')],qs[_0xd7c8('0x39')](_0x3a5b6f[_0xd7c8('0x34')][_0xd7c8('0x39')]));_0x540f93[_0xd7c8('0x38')]=_0x540f93[_0xd7c8('0x38')][_0xd7c8('0x58')]?_0x540f93[_0xd7c8('0x38')]:_0xfef860[_0xd7c8('0x33')];_0x540f93[_0xd7c8('0x3b')]=qs[_0xd7c8('0x3c')](_0x3a5b6f[_0xd7c8('0x34')][_0xd7c8('0x3c')]);_0x540f93['where']=qs[_0xd7c8('0x36')](_[_0xd7c8('0x3e')](_0x3a5b6f[_0xd7c8('0x34')],_0xfef860[_0xd7c8('0x36')]));if(_0x3a5b6f['query'][_0xd7c8('0x3f')]){_0x540f93[_0xd7c8('0x3d')]=_[_0xd7c8('0x40')](_0x540f93[_0xd7c8('0x3d')],{'$or':_[_0xd7c8('0x2e')](_0x540f93['attributes'],function(_0x5b76f9){var _0x5b9744={};_0x5b9744[_0x5b76f9]={'$like':'%'+_0x3a5b6f['query'][_0xd7c8('0x3f')]+'%'};return _0x5b9744;})});}_0x540f93=_[_0xd7c8('0x40')]({},_0x540f93,_0x3a5b6f[_0xd7c8('0x41')]);return _0x37a1a5[_0xd7c8('0x89')](_0x540f93);}})[_0xd7c8('0x26')](function(_0x2c205){if(_0x2c205){_0x1006a4=_0x2c205[_0xd7c8('0x58')];if(!_0x3a5b6f[_0xd7c8('0x34')]['hasOwnProperty']('nolimit')){_0x540f93[_0xd7c8('0x1e')]=qs['limit'](_0x3a5b6f[_0xd7c8('0x34')][_0xd7c8('0x1e')]);_0x540f93[_0xd7c8('0x20')]=qs[_0xd7c8('0x20')](_0x3a5b6f['query'][_0xd7c8('0x20')]);}return _0x37a1a5['getAgents'](_0x540f93);}})[_0xd7c8('0x26')](function(_0x41bec2){if(_0x41bec2){return _0x41bec2?{'count':_0x1006a4,'rows':_0x41bec2}:null;}})[_0xd7c8('0x26')](respondWithResult(_0x4c1f96,null))['catch'](handleError(_0x4c1f96,null));}; \ No newline at end of file +var _0x6ca4=['sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','findAll','rows','catch','show','params','includeAll','include','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addContacts','tags','isArray','each','CmContact','omit','success','dataValues','errors','push','message','getContacts','CustomFields','concat','format','raw','getContactsCsv','CmCustomField','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path'];(function(_0x3146ca,_0x1b2d0b){var _0x2efb5d=function(_0x33b438){while(--_0x33b438){_0x3146ca['push'](_0x3146ca['shift']());}};_0x2efb5d(++_0x1b2d0b);}(_0x6ca4,0x86));var _0x46ca=function(_0x95ab77,_0x1b399f){_0x95ab77=_0x95ab77-0x0;var _0x405a8f=_0x6ca4[_0x95ab77];return _0x405a8f;};'use strict';var emlformat=require(_0x46ca('0x0'));var rimraf=require(_0x46ca('0x1'));var zipdir=require(_0x46ca('0x2'));var jsonpatch=require(_0x46ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x46ca('0x4'));var Mustache=require(_0x46ca('0x5'));var util=require('util');var path=require(_0x46ca('0x6'));var sox=require(_0x46ca('0x7'));var csv=require(_0x46ca('0x8'));var ejs=require(_0x46ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46ca('0xa'));var crypto=require(_0x46ca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x46ca('0xc'));var toCsv=require(_0x46ca('0x8'));var querystring=require(_0x46ca('0xd'));var Papa=require(_0x46ca('0xe'));var Redis=require('ioredis');var authService=require(_0x46ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x46ca('0x10'));var hardwareService=require(_0x46ca('0x11'));var logger=require(_0x46ca('0x12'))(_0x46ca('0x13'));var utils=require('../../config/utils');var config=require(_0x46ca('0x14'));var licenseUtil=require(_0x46ca('0x15'));var db=require(_0x46ca('0x16'))['db'];config[_0x46ca('0x17')]=_[_0x46ca('0x18')](config[_0x46ca('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x46ca('0x19'))(new Redis(config[_0x46ca('0x17')]));require(_0x46ca('0x1a'))[_0x46ca('0x1b')](socket);function respondWithStatusCode(_0x26f658,_0x583557){_0x583557=_0x583557||0xcc;return function(_0x4b95d3){if(_0x4b95d3){return _0x26f658[_0x46ca('0x1c')](_0x583557);}return _0x26f658[_0x46ca('0x1d')](_0x583557)[_0x46ca('0x1e')]();};}function respondWithResult(_0x2334b6,_0x5aa66d){_0x5aa66d=_0x5aa66d||0xc8;return function(_0x102b77){if(_0x102b77){return _0x2334b6[_0x46ca('0x1d')](_0x5aa66d)[_0x46ca('0x1f')](_0x102b77);}};}function respondWithFilteredResult(_0x326012,_0x293c0f){return function(_0x351f18){if(_0x351f18){var _0x292070=typeof _0x293c0f[_0x46ca('0x20')]===_0x46ca('0x21')&&typeof _0x293c0f['limit']===_0x46ca('0x21');var _0x54f4d3=_0x351f18['count'];var _0x47e155=_0x292070?0x0:_0x293c0f[_0x46ca('0x20')];var _0x12944a=_0x292070?_0x351f18[_0x46ca('0x22')]:_0x293c0f[_0x46ca('0x20')]+_0x293c0f[_0x46ca('0x23')];var _0x1e1e58;if(_0x12944a>=_0x54f4d3){_0x12944a=_0x54f4d3;_0x1e1e58=0xc8;}else{_0x1e1e58=0xce;}_0x326012[_0x46ca('0x1d')](_0x1e1e58);return _0x326012['set'](_0x46ca('0x24'),_0x47e155+'-'+_0x12944a+'/'+_0x54f4d3)['json'](_0x351f18);}return null;};}function patchUpdates(_0x47641e){return function(_0x283471){try{jsonpatch[_0x46ca('0x25')](_0x283471,_0x47641e,!![]);}catch(_0x2bc29c){return BPromise['reject'](_0x2bc29c);}return _0x283471[_0x46ca('0x26')]();};}function saveUpdates(_0x51ecb2,_0x151408){return function(_0x5b0021){if(_0x5b0021){return _0x5b0021[_0x46ca('0x27')](_0x51ecb2)['then'](function(_0x21f1b9){return _0x21f1b9;});}return null;};}function removeEntity(_0x570182,_0x341397){return function(_0x14fc12){if(_0x14fc12){return _0x14fc12[_0x46ca('0x28')]()[_0x46ca('0x29')](function(){var _0x200614=_0x14fc12[_0x46ca('0x2a')]({'plain':!![]});var _0x3b746a=_0x46ca('0x2b');return db[_0x46ca('0x2c')]['destroy']({'where':{'type':_0x3b746a,'resourceId':_0x200614['id']}})[_0x46ca('0x29')](function(){return _0x14fc12;});})['then'](function(){_0x570182['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c8d98,_0x493873){return function(_0x3b06a7){if(!_0x3b06a7){_0x4c8d98['sendStatus'](0x194);}return _0x3b06a7;};}function handleError(_0x489f1e,_0x39dab1){_0x39dab1=_0x39dab1||0x1f4;return function(_0x1d685d){logger[_0x46ca('0x2d')](_0x1d685d[_0x46ca('0x2e')]);if(_0x1d685d[_0x46ca('0x2f')]){delete _0x1d685d[_0x46ca('0x2f')];}_0x489f1e[_0x46ca('0x1d')](_0x39dab1)['send'](_0x1d685d);};}exports[_0x46ca('0x30')]=function(_0x231d3d,_0x13f0ef){var _0xe0fc4c={},_0x5f1859={},_0x2dae85={'count':0x0,'rows':[]};var _0x103c4e=_[_0x46ca('0x31')](db[_0x46ca('0x32')][_0x46ca('0x33')],function(_0x90bdf2){return{'name':_0x90bdf2[_0x46ca('0x34')],'type':_0x90bdf2[_0x46ca('0x35')][_0x46ca('0x36')]};});_0x5f1859[_0x46ca('0x37')]=_[_0x46ca('0x31')](_0x103c4e,_0x46ca('0x2f'));_0x5f1859[_0x46ca('0x38')]=_[_0x46ca('0x39')](_0x231d3d[_0x46ca('0x38')]);_0x5f1859['filters']=_[_0x46ca('0x3a')](_0x5f1859[_0x46ca('0x37')],_0x5f1859[_0x46ca('0x38')]);_0xe0fc4c[_0x46ca('0x3b')]=_['intersection'](_0x5f1859[_0x46ca('0x37')],qs[_0x46ca('0x3c')](_0x231d3d[_0x46ca('0x38')][_0x46ca('0x3c')]));_0xe0fc4c[_0x46ca('0x3b')]=_0xe0fc4c[_0x46ca('0x3b')][_0x46ca('0x3d')]?_0xe0fc4c['attributes']:_0x5f1859['model'];if(!_0x231d3d[_0x46ca('0x38')][_0x46ca('0x3e')](_0x46ca('0x3f'))){_0xe0fc4c['limit']=qs[_0x46ca('0x23')](_0x231d3d[_0x46ca('0x38')][_0x46ca('0x23')]);_0xe0fc4c[_0x46ca('0x20')]=qs[_0x46ca('0x20')](_0x231d3d['query'][_0x46ca('0x20')]);}_0xe0fc4c['order']=qs[_0x46ca('0x40')](_0x231d3d[_0x46ca('0x38')]['sort']);_0xe0fc4c[_0x46ca('0x41')]=qs[_0x46ca('0x42')](_[_0x46ca('0x43')](_0x231d3d[_0x46ca('0x38')],_0x5f1859[_0x46ca('0x42')]),_0x103c4e);if(_0x231d3d['query']['filter']){_0xe0fc4c['where']=_['merge'](_0xe0fc4c['where'],{'$or':_['map'](_0x103c4e,function(_0xefa94d){if(_0xefa94d[_0x46ca('0x35')]!==_0x46ca('0x44')){var _0x70beb9={};_0x70beb9[_0xefa94d[_0x46ca('0x2f')]]={'$like':'%'+_0x231d3d[_0x46ca('0x38')][_0x46ca('0x45')]+'%'};return _0x70beb9;}})});}_0xe0fc4c=_['merge']({},_0xe0fc4c,_0x231d3d['options']);var _0x204f77={'where':_0xe0fc4c[_0x46ca('0x41')]};return db['CmList'][_0x46ca('0x22')](_0x204f77)['then'](function(_0x5886b7){_0x2dae85[_0x46ca('0x22')]=_0x5886b7;if(_0x231d3d[_0x46ca('0x38')]['includeAll']){_0xe0fc4c['include']=[{'all':!![]}];}return db[_0x46ca('0x32')][_0x46ca('0x46')](_0xe0fc4c);})[_0x46ca('0x29')](function(_0x2460e9){_0x2dae85[_0x46ca('0x47')]=_0x2460e9;return _0x2dae85;})[_0x46ca('0x29')](respondWithFilteredResult(_0x13f0ef,_0xe0fc4c))[_0x46ca('0x48')](handleError(_0x13f0ef,null));};exports[_0x46ca('0x49')]=function(_0x2fe4c6,_0x28ae1a){var _0x43679a={'raw':![],'where':{'id':_0x2fe4c6[_0x46ca('0x4a')]['id']}},_0x4d0e3c={};_0x4d0e3c['model']=_[_0x46ca('0x39')](db[_0x46ca('0x32')][_0x46ca('0x33')]);_0x4d0e3c['query']=_[_0x46ca('0x39')](_0x2fe4c6[_0x46ca('0x38')]);_0x4d0e3c[_0x46ca('0x42')]=_['intersection'](_0x4d0e3c[_0x46ca('0x37')],_0x4d0e3c['query']);_0x43679a['attributes']=_['intersection'](_0x4d0e3c[_0x46ca('0x37')],qs[_0x46ca('0x3c')](_0x2fe4c6[_0x46ca('0x38')][_0x46ca('0x3c')]));_0x43679a[_0x46ca('0x3b')]=_0x43679a['attributes'][_0x46ca('0x3d')]?_0x43679a[_0x46ca('0x3b')]:_0x4d0e3c[_0x46ca('0x37')];if(_0x2fe4c6[_0x46ca('0x38')][_0x46ca('0x4b')]){_0x43679a[_0x46ca('0x4c')]=[{'all':!![]}];}_0x43679a=_[_0x46ca('0x4d')]({},_0x43679a,_0x2fe4c6[_0x46ca('0x4e')]);return db['CmList'][_0x46ca('0x4f')](_0x43679a)[_0x46ca('0x29')](handleEntityNotFound(_0x28ae1a,null))['then'](respondWithResult(_0x28ae1a,null))[_0x46ca('0x48')](handleError(_0x28ae1a,null));};exports[_0x46ca('0x50')]=function(_0x2cd554,_0x5acd00){return db['CmList'][_0x46ca('0x50')](_0x2cd554[_0x46ca('0x51')],{})[_0x46ca('0x29')](function(_0x2c368d){var _0x2d2a8d=_0x2cd554['user']['get']({'plain':!![]});if(!_0x2d2a8d)throw new Error(_0x46ca('0x52'));if(_0x2d2a8d['role']===_0x46ca('0x53')){var _0x46eb6f=_0x2c368d[_0x46ca('0x2a')]({'plain':!![]});var _0x1aa555=_0x46ca('0x2b');return db[_0x46ca('0x54')][_0x46ca('0x4f')]({'where':{'name':_0x1aa555,'userProfileId':_0x2d2a8d['userProfileId']},'raw':!![]})[_0x46ca('0x29')](function(_0x5d33ea){if(_0x5d33ea&&_0x5d33ea[_0x46ca('0x55')]===0x0){return db[_0x46ca('0x2c')][_0x46ca('0x50')]({'name':_0x46eb6f[_0x46ca('0x2f')],'resourceId':_0x46eb6f['id'],'type':_0x5d33ea['name'],'sectionId':_0x5d33ea['id']},{})[_0x46ca('0x29')](function(){return _0x2c368d;});}else{return _0x2c368d;}})[_0x46ca('0x48')](function(_0x506f0f){logger[_0x46ca('0x2d')](_0x46ca('0x56'),_0x506f0f);throw _0x506f0f;});}return _0x2c368d;})['then'](respondWithResult(_0x5acd00,0xc9))['catch'](handleError(_0x5acd00,null));};exports[_0x46ca('0x27')]=function(_0x210ba2,_0x25b378){if(_0x210ba2['body']['id']){delete _0x210ba2['body']['id'];}return db['CmList'][_0x46ca('0x4f')]({'where':{'id':_0x210ba2[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x25b378,null))['then'](saveUpdates(_0x210ba2[_0x46ca('0x51')],null))[_0x46ca('0x29')](respondWithResult(_0x25b378,null))['catch'](handleError(_0x25b378,null));};exports[_0x46ca('0x28')]=function(_0x3e088b,_0x4da7bf){return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x3e088b[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x4da7bf,null))[_0x46ca('0x29')](removeEntity(_0x4da7bf,null))[_0x46ca('0x48')](handleError(_0x4da7bf,null));};exports[_0x46ca('0x57')]=function(_0x5033a0,_0x1fd3d2){return db[_0x46ca('0x32')][_0x46ca('0x57')]()[_0x46ca('0x29')](respondWithResult(_0x1fd3d2,null))['catch'](handleError(_0x1fd3d2,null));};exports[_0x46ca('0x58')]=function(_0x2b03fe,_0xded7af,_0x63d16c){if(_0x2b03fe['body']['id']){delete _0x2b03fe[_0x46ca('0x51')]['id'];}return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x2b03fe[_0x46ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0xded7af,null))[_0x46ca('0x29')](function(_0xe6d14c){if(_0xe6d14c){_0x2b03fe['body'][_0x46ca('0x59')]=_0xe6d14c['id'];return db[_0x46ca('0x5a')][_0x46ca('0x50')](_0x2b03fe['body']);}})[_0x46ca('0x29')](respondWithResult(_0xded7af,null))[_0x46ca('0x48')](handleError(_0xded7af,null));};exports[_0x46ca('0x5b')]=function(_0x287267,_0x57c90a,_0x4b1d1b){var _0x34177b={'raw':![],'where':{}};var _0x65ca70={};var _0x392133={'count':0x0,'rows':[]};return db[_0x46ca('0x32')][_0x46ca('0x5c')]({'where':{'id':_0x287267[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x57c90a,null))[_0x46ca('0x29')](function(_0x380bcb){if(_0x380bcb){_0x65ca70[_0x46ca('0x37')]=_[_0x46ca('0x39')](db[_0x46ca('0x5a')][_0x46ca('0x33')]);_0x65ca70['query']=_['keys'](_0x287267[_0x46ca('0x38')]);_0x65ca70[_0x46ca('0x42')]=_['intersection'](_0x65ca70[_0x46ca('0x37')],_0x65ca70['query']);_0x34177b['attributes']=_[_0x46ca('0x3a')](_0x65ca70['model'],qs[_0x46ca('0x3c')](_0x287267[_0x46ca('0x38')][_0x46ca('0x3c')]));_0x34177b['attributes']=_0x34177b[_0x46ca('0x3b')][_0x46ca('0x3d')]?_0x34177b['attributes']:_0x65ca70['model'];if(!_0x287267[_0x46ca('0x38')]['hasOwnProperty'](_0x46ca('0x3f'))){_0x34177b['limit']=qs[_0x46ca('0x23')](_0x287267[_0x46ca('0x38')]['limit']);_0x34177b['offset']=qs[_0x46ca('0x20')](_0x287267[_0x46ca('0x38')][_0x46ca('0x20')]);}_0x34177b[_0x46ca('0x5d')]=qs[_0x46ca('0x40')](_0x287267[_0x46ca('0x38')][_0x46ca('0x40')]);_0x34177b[_0x46ca('0x41')]=qs['filters'](_[_0x46ca('0x43')](_0x287267['query'],_0x65ca70[_0x46ca('0x42')]));_0x34177b[_0x46ca('0x41')][_0x46ca('0x59')]=_0x380bcb['id'];if(_0x287267[_0x46ca('0x38')]['filter']){_0x34177b[_0x46ca('0x41')]=_[_0x46ca('0x4d')](_0x34177b['where'],{'$or':_['map'](_0x34177b['attributes'],function(_0x3b79f2){var _0x54b2f2={};_0x54b2f2[_0x3b79f2]={'$like':'%'+_0x287267[_0x46ca('0x38')][_0x46ca('0x45')]+'%'};return _0x54b2f2;})});}_0x34177b=_[_0x46ca('0x4d')]({},_0x34177b,_0x287267['options']);return db[_0x46ca('0x5a')]['count']({'where':_0x34177b[_0x46ca('0x41')]})[_0x46ca('0x29')](function(_0x5dfe93){_0x392133[_0x46ca('0x22')]=_0x5dfe93;if(_0x287267[_0x46ca('0x38')][_0x46ca('0x4b')]){_0x34177b[_0x46ca('0x4c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x34177b);})['then'](function(_0x450d85){_0x392133[_0x46ca('0x47')]=_0x450d85;return _0x392133;});}})[_0x46ca('0x29')](respondWithFilteredResult(_0x57c90a,_0x34177b))[_0x46ca('0x48')](handleError(_0x57c90a,null));};exports[_0x46ca('0x5e')]=function(_0x48ce39,_0x51679d,_0x1926d7){return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x48ce39['params']['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x51679d,null))['then'](function(_0xca15dd){if(_0xca15dd){return _0xca15dd[_0x46ca('0x5e')](_0x48ce39[_0x46ca('0x38')][_0x46ca('0x5f')]);}})[_0x46ca('0x29')](respondWithStatusCode(_0x51679d,null))[_0x46ca('0x48')](handleError(_0x51679d,null));};exports[_0x46ca('0x60')]=function(_0x519310,_0x1176ce,_0xe4d604){return db[_0x46ca('0x32')]['find']({'where':{'id':_0x519310['params']['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x1176ce,null))[_0x46ca('0x29')](function(_0xe6833){if(_0xe6833){var _0x32b300=[];var _0x2dbcb8={'success':[],'errors':[]};return db['CmContact'][_0x46ca('0x57')]()[_0x46ca('0x29')](function(_0x5ce773){if(_0x519310[_0x46ca('0x51')][_0x46ca('0x61')]&&_['isArray'](_0x519310['body'][_0x46ca('0x61')])){if(_0x519310[_0x46ca('0x51')][_0x46ca('0x61')][_0x46ca('0x3d')]){_0x519310[_0x46ca('0x51')][_0x46ca('0x61')]=_0x519310['body']['tags']['join'](';')+';';}else{_0x519310[_0x46ca('0x51')][_0x46ca('0x61')]=null;}}else{_0x519310['body']['tags']=null;}if(_0x519310[_0x46ca('0x51')]&&_[_0x46ca('0x62')](_0x519310[_0x46ca('0x51')])){for(var _0x9657d3=0x0;_0x9657d3<_0x519310[_0x46ca('0x51')]['length'];_0x9657d3+=0x1){_0x519310[_0x46ca('0x51')][_0x9657d3]['ListId']=_0x519310[_0x46ca('0x4a')]['id'];_0x32b300['push'](_0x519310[_0x46ca('0x51')][_0x9657d3]);}return BPromise[_0x46ca('0x63')](_0x32b300,function(_0x2fc0ff){return db[_0x46ca('0x64')]['create'](_[_0x46ca('0x65')](_0x2fc0ff,[_0x46ca('0x5f'),'id'])||{},{'fields':_['keys'](_0x5ce773),'raw':!![]})[_0x46ca('0x29')](function(_0x320f56){_0x2dbcb8[_0x46ca('0x66')]['push'](_0x320f56[_0x46ca('0x67')]);})['catch'](function(_0x2a40fb){_0x2dbcb8[_0x46ca('0x68')][_0x46ca('0x69')]({'data':_0x2fc0ff,'error':_0x2a40fb[_0x46ca('0x6a')]});});})[_0x46ca('0x29')](function(_0x444556){return _0x2dbcb8;})['catch'](function(_0x20ef02){return _0x20ef02;});}else{_0x1176ce['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x46ca('0x29')](respondWithResult(_0x1176ce,null))['catch'](handleError(_0x1176ce,null));};exports[_0x46ca('0x6b')]=function(_0x48cf92,_0x3ffa65,_0x4892a6){var _0x9cfb4b;return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x48cf92[_0x46ca('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x46ca('0x6c')}]})[_0x46ca('0x29')](handleEntityNotFound(_0x3ffa65,null))[_0x46ca('0x29')](function(_0x76db5b){if(_0x76db5b){_0x9cfb4b=_0x76db5b;return db['CmContact'][_0x46ca('0x33')];}})[_0x46ca('0x29')](function(_0x33d19c){if(_0x33d19c){var _0x31206b={};var _0x3c3000={};_0x3c3000['model']=_[_0x46ca('0x6d')](_[_0x46ca('0x39')](_0x33d19c),_[_0x46ca('0x31')](_0x9cfb4b[_0x46ca('0x6c')],function(_0x517fa0){return util[_0x46ca('0x6e')]('cf_%d',_0x517fa0['id']);}));_0x3c3000[_0x46ca('0x38')]=_['keys'](_0x48cf92[_0x46ca('0x38')]);_0x3c3000[_0x46ca('0x42')]=_['intersection'](_0x3c3000[_0x46ca('0x37')],_0x3c3000['query']);_0x31206b[_0x46ca('0x3b')]=_[_0x46ca('0x3a')](_0x3c3000[_0x46ca('0x37')],qs[_0x46ca('0x3c')](_0x48cf92['query']['fields']));_0x31206b[_0x46ca('0x3b')]=_0x31206b[_0x46ca('0x3b')]['length']?_0x31206b[_0x46ca('0x3b')]:_0x3c3000[_0x46ca('0x37')];if(!_0x48cf92['query']['hasOwnProperty']('nolimit')){_0x31206b[_0x46ca('0x23')]=qs[_0x46ca('0x23')](_0x48cf92[_0x46ca('0x38')][_0x46ca('0x23')]);_0x31206b['offset']=qs[_0x46ca('0x20')](_0x48cf92[_0x46ca('0x38')][_0x46ca('0x20')]);}_0x31206b[_0x46ca('0x5d')]=qs[_0x46ca('0x40')](_0x48cf92[_0x46ca('0x38')][_0x46ca('0x40')]);_0x31206b['where']=qs['filters'](_[_0x46ca('0x43')](_0x48cf92[_0x46ca('0x38')],_0x3c3000['filters']));_0x31206b[_0x46ca('0x6f')]=!![];if(_0x48cf92[_0x46ca('0x38')]['filter']){_0x31206b['where']=_[_0x46ca('0x4d')](_0x31206b[_0x46ca('0x41')],{'$or':_[_0x46ca('0x31')](_0x31206b[_0x46ca('0x3b')],function(_0x571af9){var _0x3c866a={};_0x3c866a[_0x571af9]={'$like':'%'+_0x48cf92[_0x46ca('0x38')][_0x46ca('0x45')]+'%'};return _0x3c866a;})});}_0x31206b=_[_0x46ca('0x4d')]({},_0x31206b,_0x48cf92['options']);return _0x9cfb4b[_0x46ca('0x6b')](_0x31206b);}})[_0x46ca('0x29')](respondWithResult(_0x3ffa65,null))[_0x46ca('0x48')](handleError(_0x3ffa65,null));};exports[_0x46ca('0x70')]=function(_0x49abe9,_0x503ae5,_0x3b0375){var _0x2db61d;return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x49abe9[_0x46ca('0x4a')]['id']},'include':[{'model':db[_0x46ca('0x71')],'as':_0x46ca('0x6c')}]})[_0x46ca('0x29')](handleEntityNotFound(_0x503ae5,null))[_0x46ca('0x29')](function(_0x4bf709){if(_0x4bf709){_0x2db61d=_0x4bf709;return db[_0x46ca('0x64')]['rawAttributes'];}})['then'](function(_0x5de58d){if(_0x5de58d){var _0xc4d4a={};var _0x5bf19f={};_0x5bf19f['model']=_[_0x46ca('0x6d')](_[_0x46ca('0x39')](_0x5de58d),_[_0x46ca('0x31')](_0x2db61d[_0x46ca('0x6c')],function(_0x4764f8){return util['format']('cf_%d',_0x4764f8['id']);}));_0x5bf19f[_0x46ca('0x38')]=_[_0x46ca('0x39')](_0x49abe9[_0x46ca('0x38')]);_0x5bf19f[_0x46ca('0x42')]=_[_0x46ca('0x3a')](_0x5bf19f[_0x46ca('0x37')],_0x5bf19f[_0x46ca('0x38')]);_0xc4d4a['attributes']=_['intersection'](_0x5bf19f[_0x46ca('0x37')],qs[_0x46ca('0x3c')](_0x49abe9[_0x46ca('0x38')][_0x46ca('0x3c')]));_0xc4d4a[_0x46ca('0x3b')]=_0xc4d4a['attributes']['length']?_0xc4d4a[_0x46ca('0x3b')]:_0x5bf19f[_0x46ca('0x37')];if(!_0x49abe9['query']['hasOwnProperty'](_0x46ca('0x3f'))){_0xc4d4a['limit']=qs[_0x46ca('0x23')](_0x49abe9[_0x46ca('0x38')][_0x46ca('0x23')]);_0xc4d4a[_0x46ca('0x20')]=qs[_0x46ca('0x20')](_0x49abe9[_0x46ca('0x38')][_0x46ca('0x20')]);}_0xc4d4a[_0x46ca('0x5d')]=qs[_0x46ca('0x40')](_0x49abe9[_0x46ca('0x38')][_0x46ca('0x40')]);_0xc4d4a[_0x46ca('0x41')]=qs[_0x46ca('0x42')](_[_0x46ca('0x43')](_0x49abe9['query'],_0x5bf19f[_0x46ca('0x42')]));_0xc4d4a['raw']=!![];if(_0x49abe9['query'][_0x46ca('0x45')]){_0xc4d4a[_0x46ca('0x41')]=_['merge'](_0xc4d4a[_0x46ca('0x41')],{'$or':_[_0x46ca('0x31')](_0xc4d4a[_0x46ca('0x3b')],function(_0x38a85d){var _0x5d7ac0={};_0x5d7ac0[_0x38a85d]={'$like':'%'+_0x49abe9[_0x46ca('0x38')][_0x46ca('0x45')]+'%'};return _0x5d7ac0;})});}_0xc4d4a=_[_0x46ca('0x4d')]({},_0xc4d4a,_0x49abe9[_0x46ca('0x4e')]);return _0x2db61d[_0x46ca('0x6b')](_0xc4d4a);}})['then'](function(_0x1f50bf){if(!_[_0x46ca('0x72')](_0x1f50bf)){var _0x15c4e9=toCsv(_0x1f50bf);var _0x3b08ab=Date[_0x46ca('0x73')]();fs[_0x46ca('0x74')](util[_0x46ca('0x6e')](_0x46ca('0x75'),_0x2db61d['id'],_0x3b08ab),_0x15c4e9);_0x503ae5[_0x46ca('0x76')]('Content-disposition','attachment;\x20filename='+util[_0x46ca('0x6e')]('list_%d_%s.csv',_0x2db61d['id'],_0x3b08ab));_0x503ae5[_0x46ca('0x76')](_0x46ca('0x77'),_0x46ca('0x78'));return _0x503ae5[_0x46ca('0x79')](util[_0x46ca('0x6e')]('/tmp/list_%d_%s.csv',_0x2db61d['id'],_0x3b08ab));}else{return _0x503ae5[_0x46ca('0x1c')](0xcc);}})[_0x46ca('0x48')](handleError(_0x503ae5,null));};exports[_0x46ca('0x7a')]=function(_0x49f064,_0x349154,_0x487f15){var _0xaf4655;delete _0x49f064[_0x46ca('0x51')]['id'];return db[_0x46ca('0x32')]['findOne']({'where':{'id':_0x49f064['params']['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x349154,null))[_0x46ca('0x29')](function(_0x104975){if(_0x104975){return db[_0x46ca('0x7b')]['transaction'](function(_0x118cb2){return db[_0x46ca('0x71')][_0x46ca('0x50')](_0x49f064[_0x46ca('0x51')],{'transaction':_0x118cb2})['then'](function(_0x3375de){_0xaf4655=_0x3375de;return _0x104975[_0x46ca('0x7c')](_0x3375de,{'transaction':_0x118cb2});})[_0x46ca('0x29')](function(){var _0xaac6b8={'type':db['Sequelize'][_0x46ca('0x7d')],'transaction':_0x118cb2};switch(_0x49f064[_0x46ca('0x51')][_0x46ca('0x35')]){case _0x46ca('0x7e'):_0xaac6b8[_0x46ca('0x35')]=db[_0x46ca('0x7f')]['TEXT'];break;case'number':_0xaac6b8[_0x46ca('0x35')]=db[_0x46ca('0x7f')][_0x46ca('0x80')];break;case _0x46ca('0x81'):_0xaac6b8[_0x46ca('0x35')]=db[_0x46ca('0x7f')][_0x46ca('0x82')];_0xaac6b8['defaultValue']=![];break;default:}return db[_0x46ca('0x7b')][_0x46ca('0x83')]['addColumn'](_0x46ca('0x84'),util[_0x46ca('0x6e')]('cf_%s',_0xaf4655['id']),_0xaac6b8);})[_0x46ca('0x29')](function(){return _0xaf4655;});});}})[_0x46ca('0x29')](respondWithResult(_0x349154,null))[_0x46ca('0x48')](handleError(_0x349154,null));};exports['getCustomFields']=function(_0x35e6f1,_0x538e37,_0x38a0f8){var _0x2c6da9={};var _0x7810da={};var _0x16128a;var _0x5b64f4;return db[_0x46ca('0x32')][_0x46ca('0x5c')]({'where':{'id':_0x35e6f1[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x538e37,null))[_0x46ca('0x29')](function(_0x14fb4d){if(_0x14fb4d){_0x16128a=_0x14fb4d;_0x7810da['model']=_['keys'](db['CmCustomField'][_0x46ca('0x33')]);_0x7810da[_0x46ca('0x38')]=_['keys'](_0x35e6f1['query']);_0x7810da['filters']=_[_0x46ca('0x3a')](_0x7810da[_0x46ca('0x37')],_0x7810da[_0x46ca('0x38')]);_0x2c6da9[_0x46ca('0x3b')]=_['intersection'](_0x7810da[_0x46ca('0x37')],qs['fields'](_0x35e6f1[_0x46ca('0x38')][_0x46ca('0x3c')]));_0x2c6da9[_0x46ca('0x3b')]=_0x2c6da9['attributes'][_0x46ca('0x3d')]?_0x2c6da9[_0x46ca('0x3b')]:_0x7810da[_0x46ca('0x37')];_0x2c6da9['order']=qs[_0x46ca('0x40')](_0x35e6f1['query'][_0x46ca('0x40')]);_0x2c6da9['where']=qs[_0x46ca('0x42')](_['pick'](_0x35e6f1[_0x46ca('0x38')],_0x7810da[_0x46ca('0x42')]));_0x2c6da9['where']=_[_0x46ca('0x4d')](_0x2c6da9[_0x46ca('0x41')],{'$or':[{'ListId':_0x14fb4d['id']},{'ListId':null}]});if(_0x35e6f1['query'][_0x46ca('0x45')]){_0x2c6da9['where']=_['merge'](_0x2c6da9[_0x46ca('0x41')],{'$or':_['map'](_0x2c6da9[_0x46ca('0x3b')],function(_0x352cec){var _0x2fb8f6={};_0x2fb8f6[_0x352cec]={'$like':'%'+_0x35e6f1['query'][_0x46ca('0x45')]+'%'};return _0x2fb8f6;})});}_0x2c6da9=_[_0x46ca('0x4d')]({},_0x2c6da9,_0x35e6f1[_0x46ca('0x4e')]);return db[_0x46ca('0x71')][_0x46ca('0x85')](_0x2c6da9);}})['then'](respondWithResult(_0x538e37,null))[_0x46ca('0x48')](handleError(_0x538e37,null));};exports[_0x46ca('0x86')]=function(_0x146774,_0x5496ac,_0xcf7d14){return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x146774[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x5496ac,null))['then'](function(_0x59e99c){if(_0x59e99c){return _0x59e99c[_0x46ca('0x86')](_0x146774[_0x46ca('0x51')][_0x46ca('0x5f')],_[_0x46ca('0x65')](_0x146774[_0x46ca('0x51')],[_0x46ca('0x5f'),'id'])||{})[_0x46ca('0x87')](function(_0x33b2b5){for(var _0x31d6a6=0x0;_0x31d6a6<_0x146774['body'][_0x46ca('0x5f')][_0x46ca('0x3d')];_0x31d6a6+=0x1){socket['emit'](_0x46ca('0x88'),{'UserId':Number(_0x146774[_0x46ca('0x51')]['ids'][_0x31d6a6]),'CmListId':Number(_0x146774[_0x46ca('0x4a')]['id'])});}return _0x33b2b5;});}})[_0x46ca('0x29')](respondWithResult(_0x5496ac,null))[_0x46ca('0x48')](handleError(_0x5496ac,null));};exports[_0x46ca('0x89')]=function(_0x55be3b,_0x71ae0c,_0x130113){return db[_0x46ca('0x32')][_0x46ca('0x4f')]({'where':{'id':_0x55be3b[_0x46ca('0x4a')]['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x71ae0c,null))[_0x46ca('0x29')](function(_0x1eac74){if(_0x1eac74){return _0x1eac74[_0x46ca('0x89')](_0x55be3b[_0x46ca('0x38')]['ids'])[_0x46ca('0x29')](function(){if(_['isArray'](_0x55be3b['query'][_0x46ca('0x5f')])){for(var _0x28625e=0x0;_0x28625e<_0x55be3b[_0x46ca('0x38')][_0x46ca('0x5f')][_0x46ca('0x3d')];_0x28625e+=0x1){socket[_0x46ca('0x8a')](_0x46ca('0x8b'),{'UserId':Number(_0x55be3b[_0x46ca('0x38')][_0x46ca('0x5f')][_0x28625e]),'CmListId':Number(_0x55be3b['params']['id'])});}}else{socket[_0x46ca('0x8a')](_0x46ca('0x8b'),{'UserId':Number(_0x55be3b['query'][_0x46ca('0x5f')]),'CmListId':Number(_0x55be3b[_0x46ca('0x4a')]['id'])});}});}})[_0x46ca('0x29')](respondWithStatusCode(_0x71ae0c,null))[_0x46ca('0x48')](handleError(_0x71ae0c,null));};exports[_0x46ca('0x8c')]=function(_0x449473,_0x4236d4,_0x520995){var _0x49c8fd={};var _0x3d630f={};var _0x4e0d1f;var _0x2b9417;return db[_0x46ca('0x32')]['findOne']({'where':{'id':_0x449473['params']['id']}})[_0x46ca('0x29')](handleEntityNotFound(_0x4236d4,null))[_0x46ca('0x29')](function(_0x31c15b){if(_0x31c15b){_0x4e0d1f=_0x31c15b;_0x3d630f['model']=_[_0x46ca('0x39')](db['User'][_0x46ca('0x33')]);_0x3d630f['query']=_[_0x46ca('0x39')](_0x449473[_0x46ca('0x38')]);_0x3d630f['filters']=_[_0x46ca('0x3a')](_0x3d630f[_0x46ca('0x37')],_0x3d630f[_0x46ca('0x38')]);_0x49c8fd[_0x46ca('0x3b')]=_[_0x46ca('0x3a')](_0x3d630f['model'],qs['fields'](_0x449473[_0x46ca('0x38')][_0x46ca('0x3c')]));_0x49c8fd['attributes']=_0x49c8fd[_0x46ca('0x3b')]['length']?_0x49c8fd[_0x46ca('0x3b')]:_0x3d630f[_0x46ca('0x37')];_0x49c8fd['order']=qs[_0x46ca('0x40')](_0x449473['query'][_0x46ca('0x40')]);_0x49c8fd['where']=qs[_0x46ca('0x42')](_[_0x46ca('0x43')](_0x449473[_0x46ca('0x38')],_0x3d630f['filters']));if(_0x449473['query'][_0x46ca('0x45')]){_0x49c8fd[_0x46ca('0x41')]=_[_0x46ca('0x4d')](_0x49c8fd[_0x46ca('0x41')],{'$or':_[_0x46ca('0x31')](_0x49c8fd[_0x46ca('0x3b')],function(_0x3f62dd){var _0x2c67b7={};_0x2c67b7[_0x3f62dd]={'$like':'%'+_0x449473[_0x46ca('0x38')][_0x46ca('0x45')]+'%'};return _0x2c67b7;})});}_0x49c8fd=_[_0x46ca('0x4d')]({},_0x49c8fd,_0x449473[_0x46ca('0x4e')]);return _0x4e0d1f['getAgents'](_0x49c8fd);}})[_0x46ca('0x29')](function(_0x4ce75f){if(_0x4ce75f){_0x2b9417=_0x4ce75f['length'];if(!_0x449473['query'][_0x46ca('0x3e')](_0x46ca('0x3f'))){_0x49c8fd[_0x46ca('0x23')]=qs[_0x46ca('0x23')](_0x449473[_0x46ca('0x38')][_0x46ca('0x23')]);_0x49c8fd['offset']=qs[_0x46ca('0x20')](_0x449473[_0x46ca('0x38')]['offset']);}return _0x4e0d1f['getAgents'](_0x49c8fd);}})[_0x46ca('0x29')](function(_0x41038e){if(_0x41038e){return _0x41038e?{'count':_0x2b9417,'rows':_0x41038e}:null;}})[_0x46ca('0x29')](respondWithResult(_0x4236d4,null))[_0x46ca('0x48')](handleError(_0x4236d4,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 877154c..c7d4908 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x27c677,_0x55ed4e){_0x27c677=_0x27c677-0x0;var _0x58d24b=_0x3e74[_0x27c677];return _0x58d24b;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x282958,_0x1a6895){_0x282958=_0x282958-0x0;var _0x5c15a1=_0x3e74[_0x282958];return _0x5c15a1;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index f9dbf3a..2a58873 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 _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x3e4aff,_0x35d750){var _0x19884e=function(_0x5be619){while(--_0x5be619){_0x3e4aff['push'](_0x3e4aff['shift']());}};_0x19884e(++_0x35d750);}(_0xbec5,0xe5));var _0x5bec=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xbec5[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x123887,_0x3e7ca0){var _0x418057=function(_0x502441){while(--_0x502441){_0x123887['push'](_0x123887['shift']());}};_0x418057(++_0x3e7ca0);}(_0x702d,0x147));var _0xd702=function(_0x5ad5c4,_0x1b91d2){_0x5ad5c4=_0x5ad5c4-0x0;var _0x90277=_0x702d[_0x5ad5c4];return _0x90277;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),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 5fc83a7..7fe0d01 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 _0x51fa=['error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5dca74,_0x26e147){var _0x3c389e=function(_0x80b84b){while(--_0x80b84b){_0x5dca74['push'](_0x5dca74['shift']());}};_0x3c389e(++_0x26e147);}(_0x51fa,0x17e));var _0xa51f=function(_0x33d9ea,_0x1e140d){_0x33d9ea=_0x33d9ea-0x0;var _0x4c07df=_0x51fa[_0x33d9ea];return _0x4c07df;};'use strict';var _=require(_0xa51f('0x0'));var util=require('util');var moment=require(_0xa51f('0x1'));var BPromise=require(_0xa51f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa51f('0x3'));var db=require(_0xa51f('0x4'))['db'];var utils=require(_0xa51f('0x5'));var logger=require(_0xa51f('0x6'))(_0xa51f('0x7'));var config=require(_0xa51f('0x8'));var jayson=require(_0xa51f('0x9'));var client=jayson['client'][_0xa51f('0xa')]({'port':0x232a});config['redis']=_[_0xa51f('0xb')](config[_0xa51f('0xc')],{'host':_0xa51f('0xd'),'port':0x18eb});var socket=require(_0xa51f('0xe'))(new Redis(config[_0xa51f('0xc')]));require('./cmList.socket')[_0xa51f('0xf')](socket);function respondWithRpcPromise(_0x20bd6a,_0x3a6e23,_0x15d08c){return new BPromise(function(_0x4090ef,_0x5a3954){return client[_0xa51f('0x10')](_0x20bd6a,_0x15d08c)[_0xa51f('0x11')](function(_0x2e366e){logger[_0xa51f('0x12')](_0xa51f('0x13'),_0x3a6e23,'request\x20sent');logger[_0xa51f('0x14')](_0xa51f('0x15'),_0x3a6e23,_0xa51f('0x16'),JSON['stringify'](_0x2e366e));if(_0x2e366e[_0xa51f('0x17')]){if(_0x2e366e[_0xa51f('0x17')][_0xa51f('0x18')]===0x1f4){logger['error'](_0xa51f('0x13'),_0x3a6e23,_0x2e366e['error'][_0xa51f('0x19')]);return _0x5a3954(_0x2e366e[_0xa51f('0x17')]['message']);}logger['error']('CmList,\x20%s,\x20%s',_0x3a6e23,_0x2e366e[_0xa51f('0x17')][_0xa51f('0x19')]);return _0x4090ef(_0x2e366e[_0xa51f('0x17')]['message']);}else{logger[_0xa51f('0x12')](_0xa51f('0x13'),_0x3a6e23,_0xa51f('0x16'));_0x4090ef(_0x2e366e[_0xa51f('0x1a')][_0xa51f('0x19')]);}})['catch'](function(_0xfc687c){logger['error'](_0xa51f('0x13'),_0x3a6e23,_0xfc687c);_0x5a3954(_0xfc687c);});});} \ No newline at end of file +var _0xaee4=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x39304b,_0x30a033){var _0x21160c=function(_0x3b51a9){while(--_0x3b51a9){_0x39304b['push'](_0x39304b['shift']());}};_0x21160c(++_0x30a033);}(_0xaee4,0x8e));var _0x4aee=function(_0x4b5a94,_0x3488a2){_0x4b5a94=_0x4b5a94-0x0;var _0x4002e1=_0xaee4[_0x4b5a94];return _0x4002e1;};'use strict';var _=require(_0x4aee('0x0'));var util=require(_0x4aee('0x1'));var moment=require(_0x4aee('0x2'));var BPromise=require(_0x4aee('0x3'));var rs=require(_0x4aee('0x4'));var fs=require('fs');var Redis=require(_0x4aee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aee('0x6'));var logger=require(_0x4aee('0x7'))('rpc');var config=require(_0x4aee('0x8'));var jayson=require(_0x4aee('0x9'));var client=jayson[_0x4aee('0xa')][_0x4aee('0xb')]({'port':0x232a});config[_0x4aee('0xc')]=_['defaults'](config['redis'],{'host':_0x4aee('0xd'),'port':0x18eb});var socket=require(_0x4aee('0xe'))(new Redis(config[_0x4aee('0xc')]));require('./cmList.socket')[_0x4aee('0xf')](socket);function respondWithRpcPromise(_0x4a994b,_0x6fe345,_0xdc5809){return new BPromise(function(_0x2cac3e,_0x717181){return client[_0x4aee('0x10')](_0x4a994b,_0xdc5809)[_0x4aee('0x11')](function(_0x2a5d4f){logger[_0x4aee('0x12')](_0x4aee('0x13'),_0x6fe345,_0x4aee('0x14'));logger[_0x4aee('0x15')](_0x4aee('0x16'),_0x6fe345,_0x4aee('0x14'),JSON[_0x4aee('0x17')](_0x2a5d4f));if(_0x2a5d4f['error']){if(_0x2a5d4f['error'][_0x4aee('0x18')]===0x1f4){logger[_0x4aee('0x19')](_0x4aee('0x13'),_0x6fe345,_0x2a5d4f[_0x4aee('0x19')][_0x4aee('0x1a')]);return _0x717181(_0x2a5d4f[_0x4aee('0x19')][_0x4aee('0x1a')]);}logger['error'](_0x4aee('0x13'),_0x6fe345,_0x2a5d4f[_0x4aee('0x19')]['message']);return _0x2cac3e(_0x2a5d4f[_0x4aee('0x19')][_0x4aee('0x1a')]);}else{logger[_0x4aee('0x12')]('CmList,\x20%s,\x20%s',_0x6fe345,_0x4aee('0x14'));_0x2cac3e(_0x2a5d4f['result'][_0x4aee('0x1a')]);}})[_0x4aee('0x1b')](function(_0x463e35){logger[_0x4aee('0x19')](_0x4aee('0x13'),_0x6fe345,_0x463e35);_0x717181(_0x463e35);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 87e437f..e768259 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 _0x573c=['update','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0x573c,0x1ed));var _0xc573=function(_0x8858f6,_0x3bcab3){_0x8858f6=_0x8858f6-0x0;var _0xb5fd77=_0x573c[_0x8858f6];return _0xb5fd77;};'use strict';var CmListEvents=require(_0xc573('0x0'));var events=[_0xc573('0x1'),_0xc573('0x2'),_0xc573('0x3')];function createListener(_0x17b070,_0x3e1b55){return function(_0x331993){_0x3e1b55['emit'](_0x17b070,_0x331993);};}function removeListener(_0x3a707f,_0x3fa472){return function(){CmListEvents[_0xc573('0x4')](_0x3a707f,_0x3fa472);};}exports[_0xc573('0x5')]=function(_0x8dc94d){for(var _0x9c0926=0x0,_0x2e918e=events[_0xc573('0x6')];_0x9c0926<_0x2e918e;_0x9c0926++){var _0x469896=events[_0x9c0926];var _0x51de6a=createListener(_0xc573('0x7')+_0x469896,_0x8dc94d);CmListEvents['on'](_0x469896,_0x51de6a);}}; \ No newline at end of file +var _0xda25=['emit','register','length','./cmList.events','remove','update'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xda25,0x183));var _0x5da2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xda25[_0x1b4b23];return _0x2a325b;};'use strict';var CmListEvents=require(_0x5da2('0x0'));var events=['save',_0x5da2('0x1'),_0x5da2('0x2')];function createListener(_0x365f9f,_0x574b3d){return function(_0x255889){_0x574b3d[_0x5da2('0x3')](_0x365f9f,_0x255889);};}function removeListener(_0x11528c,_0xe5d2b2){return function(){CmListEvents['removeListener'](_0x11528c,_0xe5d2b2);};}exports[_0x5da2('0x4')]=function(_0x14fa8d){for(var _0x48b3ad=0x0,_0x279232=events[_0x5da2('0x5')];_0x48b3ad<_0x279232;_0x48b3ad++){var _0x3edae1=events[_0x48b3ad];var _0x2c7d2a=createListener('cmList:'+_0x3edae1,_0x14fa8d);CmListEvents['on'](_0x3edae1,_0x2c7d2a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 43be37a..bdc3f87 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 _0xcc4c=['isAuthenticated','describe','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users','addAgents','update','delete','removeDispositions','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get'];(function(_0x377bc8,_0x5b0a39){var _0x547af6=function(_0x2e969b){while(--_0x2e969b){_0x377bc8['push'](_0x377bc8['shift']());}};_0x547af6(++_0x5b0a39);}(_0xcc4c,0x14c));var _0xccc4=function(_0x536577,_0x2512c2){_0x536577=_0x536577-0x0;var _0x11670b=_0xcc4c[_0x536577];return _0x11670b;};'use strict';var multer=require(_0xccc4('0x0'));var util=require('util');var path=require(_0xccc4('0x1'));var timeout=require(_0xccc4('0x2'));var express=require('express');var router=express[_0xccc4('0x3')]();var fs_extra=require(_0xccc4('0x4'));var auth=require(_0xccc4('0x5'));var interaction=require(_0xccc4('0x6'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xccc4('0x7')]);router[_0xccc4('0x8')]('/describe',auth[_0xccc4('0x9')](),controller[_0xccc4('0xa')]);router[_0xccc4('0x8')](_0xccc4('0xb'),auth[_0xccc4('0x9')](),controller[_0xccc4('0xc')]);router['get'](_0xccc4('0xd'),auth[_0xccc4('0x9')](),controller['getDispositions']);router[_0xccc4('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xccc4('0xe')]);router[_0xccc4('0x8')](_0xccc4('0xf'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xccc4('0x8')](_0xccc4('0x10'),auth['isAuthenticated'](),controller[_0xccc4('0x11')]);router[_0xccc4('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xccc4('0x12')]);router[_0xccc4('0x13')]('/',auth[_0xccc4('0x9')](),controller[_0xccc4('0x14')]);router['post'](_0xccc4('0xd'),auth[_0xccc4('0x9')](),controller[_0xccc4('0x15')]);router['post'](_0xccc4('0x16'),auth[_0xccc4('0x9')](),controller[_0xccc4('0x17')]);router['post']('/:id/fields',auth[_0xccc4('0x9')](),controller[_0xccc4('0x18')]);router[_0xccc4('0x13')](_0xccc4('0x19'),auth[_0xccc4('0x9')](),controller[_0xccc4('0x1a')]);router['put'](_0xccc4('0xb'),auth[_0xccc4('0x9')](),controller[_0xccc4('0x1b')]);router[_0xccc4('0x1c')]('/:id',auth[_0xccc4('0x9')](),controller['destroy']);router['delete'](_0xccc4('0xd'),auth[_0xccc4('0x9')](),controller[_0xccc4('0x1d')]);router[_0xccc4('0x1c')](_0xccc4('0x19'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xccc4('0x1e')]=router; \ No newline at end of file +var _0x0d3d=['path','connect-timeout','express','Router','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','post','/:id/dispositions','/:id/contacts','/:id/fields','addCustomField','addAgents','put','update','destroy','delete','exports','multer','util'];(function(_0x29bec5,_0x5491c5){var _0x257f68=function(_0x10995d){while(--_0x10995d){_0x29bec5['push'](_0x29bec5['shift']());}};_0x257f68(++_0x5491c5);}(_0x0d3d,0x115));var _0xd0d3=function(_0x3c7193,_0x2e16c2){_0x3c7193=_0x3c7193-0x0;var _0x46974e=_0x0d3d[_0x3c7193];return _0x46974e;};'use strict';var multer=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var path=require(_0xd0d3('0x2'));var timeout=require(_0xd0d3('0x3'));var express=require(_0xd0d3('0x4'));var router=express[_0xd0d3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0d3('0x6'));var config=require('../../config/environment');var controller=require(_0xd0d3('0x7'));router[_0xd0d3('0x8')]('/',auth[_0xd0d3('0x9')](),controller[_0xd0d3('0xa')]);router[_0xd0d3('0x8')](_0xd0d3('0xb'),auth[_0xd0d3('0x9')](),controller[_0xd0d3('0xc')]);router[_0xd0d3('0x8')](_0xd0d3('0xd'),auth[_0xd0d3('0x9')](),controller[_0xd0d3('0xe')]);router[_0xd0d3('0x8')]('/:id/dispositions',auth[_0xd0d3('0x9')](),controller[_0xd0d3('0xf')]);router[_0xd0d3('0x8')]('/:id/contacts',auth[_0xd0d3('0x9')](),controller[_0xd0d3('0x10')]);router[_0xd0d3('0x8')](_0xd0d3('0x11'),auth[_0xd0d3('0x9')](),controller[_0xd0d3('0x12')]);router[_0xd0d3('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd0d3('0x13')]);router[_0xd0d3('0x8')]('/:id/users',auth[_0xd0d3('0x9')](),controller['getAgents']);router[_0xd0d3('0x14')]('/',auth[_0xd0d3('0x9')](),controller['create']);router[_0xd0d3('0x14')](_0xd0d3('0x15'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xd0d3('0x16'),auth['isAuthenticated'](),controller['addContacts']);router[_0xd0d3('0x14')](_0xd0d3('0x17'),auth[_0xd0d3('0x9')](),controller[_0xd0d3('0x18')]);router[_0xd0d3('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xd0d3('0x19')]);router[_0xd0d3('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xd0d3('0x1b')]);router['delete'](_0xd0d3('0xd'),auth[_0xd0d3('0x9')](),controller[_0xd0d3('0x1c')]);router[_0xd0d3('0x1d')](_0xd0d3('0x15'),auth[_0xd0d3('0x9')](),controller['removeDispositions']);router[_0xd0d3('0x1d')]('/:id/users',auth[_0xd0d3('0x9')](),controller['removeAgents']);module[_0xd0d3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e709390..bd07524 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 _0x3583=['field','STRING','sequelize','getDataValue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3583,0x1ea));var _0x3358=function(_0x39d062,_0x2daed1){_0x39d062=_0x39d062-0x0;var _0x5bb5bc=_0x3583[_0x39d062];return _0x5bb5bc;};'use strict';var Sequelize=require(_0x3358('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1e8d83){return this[_0x3358('0x1')](_0x3358('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3358('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x55b7=['sequelize','exports','VIRTUAL','STRING'];(function(_0x5db0fc,_0x1702bf){var _0x1cdcf1=function(_0x57f69d){while(--_0x57f69d){_0x5db0fc['push'](_0x5db0fc['shift']());}};_0x1cdcf1(++_0x1702bf);}(_0x55b7,0xd8));var _0x755b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x55b7[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x755b('0x0'));module[_0x755b('0x1')]={'name':{'type':Sequelize[_0x755b('0x2')],'get':function(_0x5aca0b){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x755b('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 72641d9..3ecc081 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(_0x10fd6a,_0x5aed1c){var _0x694e0b=function(_0x536718){while(--_0x536718){_0x10fd6a['push'](_0x10fd6a['shift']());}};_0x694e0b(++_0x5aed1c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x46cbc1,_0x5def15){var _0xef95a5=function(_0x29e7be){while(--_0x29e7be){_0x46cbc1['push'](_0x46cbc1['shift']());}};_0xef95a5(++_0x5def15);}(_0x7a54,0x106));var _0x47a5=function(_0x394ed1,_0x17ed33){_0x394ed1=_0x394ed1-0x0;var _0x2d2413=_0x7a54[_0x394ed1];return _0x2d2413;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index dcaf064..57ea618 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 _0x7211=['rimraf','./condition.attributes','define','Condition','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x12127b,_0xbeb97a){var _0x3e8993=function(_0x420060){while(--_0x420060){_0x12127b['push'](_0x12127b['shift']());}};_0x3e8993(++_0xbeb97a);}(_0x7211,0x18a));var _0x1721=function(_0x152b03,_0x155ae3){_0x152b03=_0x152b03-0x0;var _0x87325c=_0x7211[_0x152b03];return _0x87325c;};'use strict';var _=require(_0x1721('0x0'));var util=require(_0x1721('0x1'));var logger=require(_0x1721('0x2'))(_0x1721('0x3'));var moment=require(_0x1721('0x4'));var BPromise=require('bluebird');var rp=require(_0x1721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1721('0x6'));var config=require('../../config/environment');var attributes=require(_0x1721('0x7'));module['exports']=function(_0x4e5a75,_0x3d63d0){return _0x4e5a75[_0x1721('0x8')](_0x1721('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc888=['./condition.attributes','define','Condition','tools_conditions','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x483031,_0x1da521){var _0x3a880a=function(_0x51de6c){while(--_0x51de6c){_0x483031['push'](_0x483031['shift']());}};_0x3a880a(++_0x1da521);}(_0xc888,0x72));var _0x8c88=function(_0x1f87a3,_0x3799c5){_0x1f87a3=_0x1f87a3-0x0;var _0x17ebae=_0xc888[_0x1f87a3];return _0x17ebae;};'use strict';var _=require(_0x8c88('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c88('0x1'));var moment=require(_0x8c88('0x2'));var BPromise=require(_0x8c88('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c88('0x4'));var rimraf=require(_0x8c88('0x5'));var config=require(_0x8c88('0x6'));var attributes=require(_0x8c88('0x7'));module['exports']=function(_0x104d3d,_0x4200a4){return _0x104d3d[_0x8c88('0x8')](_0x8c88('0x9'),attributes,{'tableName':_0x8c88('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 c315ffa..7ba5378 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 _0x9a44=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x34d37e,_0x18f3c1){var _0x27b91c=function(_0x521e11){while(--_0x521e11){_0x34d37e['push'](_0x34d37e['shift']());}};_0x27b91c(++_0x18f3c1);}(_0x9a44,0x11e));var _0x49a4=function(_0x24c13b,_0x426e5c){_0x24c13b=_0x24c13b-0x0;var _0x56258f=_0x9a44[_0x24c13b];return _0x56258f;};'use strict';var _=require('lodash');var util=require(_0x49a4('0x0'));var moment=require(_0x49a4('0x1'));var BPromise=require('bluebird');var rs=require(_0x49a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49a4('0x3'))['db'];var utils=require(_0x49a4('0x4'));var logger=require(_0x49a4('0x5'))(_0x49a4('0x6'));var config=require(_0x49a4('0x7'));var jayson=require(_0x49a4('0x8'));var client=jayson[_0x49a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x520b06,_0x1df86f,_0x159462){return new BPromise(function(_0x57ac4f,_0xee14a7){return client[_0x49a4('0xa')](_0x520b06,_0x159462)['then'](function(_0x502336){logger[_0x49a4('0xb')](_0x49a4('0xc'),_0x1df86f,_0x49a4('0xd'));logger[_0x49a4('0xe')](_0x49a4('0xf'),_0x1df86f,_0x49a4('0xd'),JSON[_0x49a4('0x10')](_0x502336));if(_0x502336[_0x49a4('0x11')]){if(_0x502336[_0x49a4('0x11')][_0x49a4('0x12')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x1df86f,_0x502336[_0x49a4('0x11')][_0x49a4('0x13')]);return _0xee14a7(_0x502336[_0x49a4('0x11')][_0x49a4('0x13')]);}logger[_0x49a4('0x11')](_0x49a4('0xc'),_0x1df86f,_0x502336[_0x49a4('0x11')][_0x49a4('0x13')]);return _0x57ac4f(_0x502336[_0x49a4('0x11')][_0x49a4('0x13')]);}else{logger[_0x49a4('0xb')]('Condition,\x20%s,\x20%s',_0x1df86f,_0x49a4('0xd'));_0x57ac4f(_0x502336[_0x49a4('0x14')][_0x49a4('0x13')]);}})[_0x49a4('0x15')](function(_0x3748d6){logger['error']('Condition,\x20%s,\x20%s',_0x1df86f,_0x3748d6);_0xee14a7(_0x3748d6);});});} \ No newline at end of file +var _0xd24d=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2c01a4,_0x4d613f){var _0x43f2ee=function(_0x2c93f4){while(--_0x2c93f4){_0x2c01a4['push'](_0x2c01a4['shift']());}};_0x43f2ee(++_0x4d613f);}(_0xd24d,0x1de));var _0xdd24=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd24d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdd24('0x0'));var util=require(_0xdd24('0x1'));var moment=require(_0xdd24('0x2'));var BPromise=require(_0xdd24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd24('0x4'));var db=require(_0xdd24('0x5'))['db'];var utils=require(_0xdd24('0x6'));var logger=require(_0xdd24('0x7'))(_0xdd24('0x8'));var config=require(_0xdd24('0x9'));var jayson=require(_0xdd24('0xa'));var client=jayson[_0xdd24('0xb')][_0xdd24('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x463645,_0x3f2787,_0x284487){return new BPromise(function(_0x3fa1d2,_0x25cd6e){return client[_0xdd24('0xd')](_0x463645,_0x284487)[_0xdd24('0xe')](function(_0x40b796){logger[_0xdd24('0xf')](_0xdd24('0x10'),_0x3f2787,_0xdd24('0x11'));logger[_0xdd24('0x12')]('Condition,\x20%s,\x20%s,\x20%s',_0x3f2787,_0xdd24('0x11'),JSON[_0xdd24('0x13')](_0x40b796));if(_0x40b796['error']){if(_0x40b796[_0xdd24('0x14')][_0xdd24('0x15')]===0x1f4){logger['error'](_0xdd24('0x10'),_0x3f2787,_0x40b796[_0xdd24('0x14')][_0xdd24('0x16')]);return _0x25cd6e(_0x40b796[_0xdd24('0x14')][_0xdd24('0x16')]);}logger[_0xdd24('0x14')](_0xdd24('0x10'),_0x3f2787,_0x40b796[_0xdd24('0x14')]['message']);return _0x3fa1d2(_0x40b796['error'][_0xdd24('0x16')]);}else{logger[_0xdd24('0xf')](_0xdd24('0x10'),_0x3f2787,_0xdd24('0x11'));_0x3fa1d2(_0x40b796[_0xdd24('0x17')]['message']);}})[_0xdd24('0x18')](function(_0x22dbcf){logger['error'](_0xdd24('0x10'),_0x3f2787,_0x22dbcf);_0x25cd6e(_0x22dbcf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ff3fd80..5ad3316 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 _0x652f=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x652f,0x1ba));var _0xf652=function(_0x380fb8,_0x4a28a2){_0x380fb8=_0x380fb8-0x0;var _0x1e204b=_0x652f[_0x380fb8];return _0x1e204b;};'use strict';var multer=require('multer');var util=require(_0xf652('0x0'));var path=require(_0xf652('0x1'));var timeout=require('connect-timeout');var express=require(_0xf652('0x2'));var router=express[_0xf652('0x3')]();var fs_extra=require(_0xf652('0x4'));var auth=require(_0xf652('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf652('0x6'));var controller=require(_0xf652('0x7'));router['put'](_0xf652('0x8'),auth[_0xf652('0x9')](),controller[_0xf652('0xa')]);router[_0xf652('0xb')](_0xf652('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xf652('0xc')]=router; \ No newline at end of file +var _0x13ca=['../../config/environment','put','/:id','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1da595,_0x113750){var _0x1dec14=function(_0x592932){while(--_0x592932){_0x1da595['push'](_0x1da595['shift']());}};_0x1dec14(++_0x113750);}(_0x13ca,0x9d));var _0xa13c=function(_0x781628,_0x163707){_0x781628=_0x781628-0x0;var _0x5014c7=_0x13ca[_0x781628];return _0x5014c7;};'use strict';var multer=require(_0xa13c('0x0'));var util=require(_0xa13c('0x1'));var path=require('path');var timeout=require(_0xa13c('0x2'));var express=require(_0xa13c('0x3'));var router=express[_0xa13c('0x4')]();var fs_extra=require(_0xa13c('0x5'));var auth=require(_0xa13c('0x6'));var interaction=require(_0xa13c('0x7'));var config=require(_0xa13c('0x8'));var controller=require('./condition.controller');router[_0xa13c('0x9')](_0xa13c('0xa'),auth[_0xa13c('0xb')](),controller[_0xa13c('0xc')]);router['delete']('/:id',auth[_0xa13c('0xb')](),controller[_0xa13c('0xd')]);module[_0xa13c('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 43c4522..6b7c152 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x4ea911,_0x1e3ba8){var _0x5db975=function(_0x4bf693){while(--_0x4bf693){_0x4ea911['push'](_0x4ea911['shift']());}};_0x5db975(++_0x1e3ba8);}(_0x757a,0xde));var _0xa757=function(_0x291ce2,_0x184240){_0x291ce2=_0x291ce2-0x0;var _0x541f36=_0x757a[_0x291ce2];return _0x541f36;};'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 _0x757a=['exports','STRING'];(function(_0x1fdff9,_0x4c4bf4){var _0x3d1b6e=function(_0x2fd0a8){while(--_0x2fd0a8){_0x1fdff9['push'](_0x1fdff9['shift']());}};_0x3d1b6e(++_0x4c4bf4);}(_0x757a,0xde));var _0xa757=function(_0x307792,_0x4d029a){_0x307792=_0x307792-0x0;var _0x2668b3=_0x757a[_0x307792];return _0x2668b3;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index be5fd0b..4df5411 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 _0xc0e4=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','Dashboard','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','findAll','catch','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','findOne','filter','map','rimraf'];(function(_0x3f7fbf,_0x2fea92){var _0x9a7775=function(_0x22ef6e){while(--_0x22ef6e){_0x3f7fbf['push'](_0x3f7fbf['shift']());}};_0x9a7775(++_0x2fea92);}(_0xc0e4,0x17f));var _0x4c0e=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xc0e4[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4c0e('0x1'));var moment=require(_0x4c0e('0x2'));var BPromise=require(_0x4c0e('0x3'));var Mustache=require(_0x4c0e('0x4'));var util=require(_0x4c0e('0x5'));var path=require(_0x4c0e('0x6'));var sox=require(_0x4c0e('0x7'));var csv=require(_0x4c0e('0x8'));var ejs=require(_0x4c0e('0x9'));var fs=require('fs');var fs_extra=require(_0x4c0e('0xa'));var _=require(_0x4c0e('0xb'));var squel=require(_0x4c0e('0xc'));var crypto=require(_0x4c0e('0xd'));var jsforce=require(_0x4c0e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c0e('0xf'));var authService=require(_0x4c0e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4c0e('0x11'));var hardwareService=require(_0x4c0e('0x12'));var logger=require(_0x4c0e('0x13'))(_0x4c0e('0x14'));var utils=require(_0x4c0e('0x15'));var config=require(_0x4c0e('0x16'));var licenseUtil=require(_0x4c0e('0x17'));var db=require('../../mysqldb')['db'];config[_0x4c0e('0x18')]=_['defaults'](config[_0x4c0e('0x18')],{'host':_0x4c0e('0x19'),'port':0x18eb});var socket=require(_0x4c0e('0x1a'))(new Redis(config[_0x4c0e('0x18')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x398adf,_0x315cb7){_0x315cb7=_0x315cb7||0xcc;return function(_0x15df57){if(_0x15df57){return _0x398adf['sendStatus'](_0x315cb7);}return _0x398adf[_0x4c0e('0x1b')](_0x315cb7)[_0x4c0e('0x1c')]();};}function respondWithResult(_0x587045,_0x3e876f){_0x3e876f=_0x3e876f||0xc8;return function(_0xea84ad){if(_0xea84ad){return _0x587045[_0x4c0e('0x1b')](_0x3e876f)[_0x4c0e('0x1d')](_0xea84ad);}};}function respondWithFilteredResult(_0x291e03,_0xaef3d6){return function(_0x534bba){if(_0x534bba){var _0x1e196a=typeof _0xaef3d6['offset']===_0x4c0e('0x1e')&&typeof _0xaef3d6['limit']===_0x4c0e('0x1e');var _0xf3a32=_0x534bba[_0x4c0e('0x1f')];var _0x178160=_0x1e196a?0x0:_0xaef3d6[_0x4c0e('0x20')];var _0x4f9278=_0x1e196a?_0x534bba[_0x4c0e('0x1f')]:_0xaef3d6[_0x4c0e('0x20')]+_0xaef3d6[_0x4c0e('0x21')];var _0x475f8e;if(_0x4f9278>=_0xf3a32){_0x4f9278=_0xf3a32;_0x475f8e=0xc8;}else{_0x475f8e=0xce;}_0x291e03[_0x4c0e('0x1b')](_0x475f8e);return _0x291e03[_0x4c0e('0x22')](_0x4c0e('0x23'),_0x178160+'-'+_0x4f9278+'/'+_0xf3a32)[_0x4c0e('0x1d')](_0x534bba);}return null;};}function patchUpdates(_0x55766a){return function(_0x53b70b){try{jsonpatch[_0x4c0e('0x24')](_0x53b70b,_0x55766a,!![]);}catch(_0x390b77){return BPromise[_0x4c0e('0x25')](_0x390b77);}return _0x53b70b[_0x4c0e('0x26')]();};}function saveUpdates(_0xcb6512,_0x5e059c){return function(_0x442026){if(_0x442026){return _0x442026[_0x4c0e('0x27')](_0xcb6512)[_0x4c0e('0x28')](function(_0x55059d){return _0x55059d;});}return null;};}function removeEntity(_0x1a0dd9,_0x4a44e5){return function(_0x525960){if(_0x525960){return _0x525960[_0x4c0e('0x29')]()[_0x4c0e('0x28')](function(){var _0x2e755c=_0x525960[_0x4c0e('0x2a')]({'plain':!![]});var _0x370445='CustomDashboards';return db[_0x4c0e('0x2b')]['destroy']({'where':{'type':_0x370445,'resourceId':_0x2e755c['id']}})[_0x4c0e('0x28')](function(){return _0x525960;});})[_0x4c0e('0x28')](function(){_0x1a0dd9[_0x4c0e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5cf3,_0x42c8f0){return function(_0x4388de){if(!_0x4388de){_0x3b5cf3['sendStatus'](0x194);}return _0x4388de;};}function handleError(_0x165d51,_0x5a6f48){_0x5a6f48=_0x5a6f48||0x1f4;return function(_0x1ee4c0){logger[_0x4c0e('0x2c')](_0x1ee4c0[_0x4c0e('0x2d')]);if(_0x1ee4c0[_0x4c0e('0x2e')]){delete _0x1ee4c0[_0x4c0e('0x2e')];}_0x165d51[_0x4c0e('0x1b')](_0x5a6f48)['send'](_0x1ee4c0);};}exports[_0x4c0e('0x2f')]=function(_0x18c5d9,_0x5b1031){var _0x187a0a={},_0x58daf2={},_0x1e042d={'count':0x0,'rows':[]};var _0x1de4cc=_['map'](db[_0x4c0e('0x30')]['rawAttributes'],function(_0x5eea0e){return{'name':_0x5eea0e['fieldName'],'type':_0x5eea0e['type'][_0x4c0e('0x31')]};});_0x58daf2[_0x4c0e('0x32')]=_['map'](_0x1de4cc,_0x4c0e('0x2e'));_0x58daf2[_0x4c0e('0x33')]=_[_0x4c0e('0x34')](_0x18c5d9[_0x4c0e('0x33')]);_0x58daf2[_0x4c0e('0x35')]=_['intersection'](_0x58daf2[_0x4c0e('0x32')],_0x58daf2['query']);_0x187a0a[_0x4c0e('0x36')]=_[_0x4c0e('0x37')](_0x58daf2[_0x4c0e('0x32')],qs[_0x4c0e('0x38')](_0x18c5d9[_0x4c0e('0x33')]['fields']));_0x187a0a[_0x4c0e('0x36')]=_0x187a0a[_0x4c0e('0x36')][_0x4c0e('0x39')]?_0x187a0a[_0x4c0e('0x36')]:_0x58daf2[_0x4c0e('0x32')];if(!_0x18c5d9['query'][_0x4c0e('0x3a')](_0x4c0e('0x3b'))){_0x187a0a[_0x4c0e('0x21')]=qs[_0x4c0e('0x21')](_0x18c5d9[_0x4c0e('0x33')]['limit']);_0x187a0a['offset']=qs[_0x4c0e('0x20')](_0x18c5d9[_0x4c0e('0x33')][_0x4c0e('0x20')]);}_0x187a0a[_0x4c0e('0x3c')]=qs['sort'](_0x18c5d9[_0x4c0e('0x33')][_0x4c0e('0x3d')]);_0x187a0a[_0x4c0e('0x3e')]=qs[_0x4c0e('0x35')](_[_0x4c0e('0x3f')](_0x18c5d9[_0x4c0e('0x33')],_0x58daf2[_0x4c0e('0x35')]),_0x1de4cc);if(_0x18c5d9[_0x4c0e('0x33')]['filter']){_0x187a0a[_0x4c0e('0x3e')]=_[_0x4c0e('0x40')](_0x187a0a[_0x4c0e('0x3e')],{'$or':_['map'](_0x1de4cc,function(_0x531df3){if(_0x531df3[_0x4c0e('0x41')]!==_0x4c0e('0x42')){var _0x2452d9={};_0x2452d9[_0x531df3[_0x4c0e('0x2e')]]={'$like':'%'+_0x18c5d9[_0x4c0e('0x33')]['filter']+'%'};return _0x2452d9;}})});}_0x187a0a=_[_0x4c0e('0x40')]({},_0x187a0a,_0x18c5d9[_0x4c0e('0x43')]);var _0x41a989={'where':_0x187a0a[_0x4c0e('0x3e')]};return db[_0x4c0e('0x30')][_0x4c0e('0x1f')](_0x41a989)[_0x4c0e('0x28')](function(_0x460ebb){_0x1e042d[_0x4c0e('0x1f')]=_0x460ebb;if(_0x18c5d9[_0x4c0e('0x33')]['includeAll']){_0x187a0a['include']=[{'all':!![]}];}return db[_0x4c0e('0x30')][_0x4c0e('0x44')](_0x187a0a);})[_0x4c0e('0x28')](function(_0x1a9660){_0x1e042d['rows']=_0x1a9660;return _0x1e042d;})[_0x4c0e('0x28')](respondWithFilteredResult(_0x5b1031,_0x187a0a))[_0x4c0e('0x45')](handleError(_0x5b1031,null));};exports['show']=function(_0x360386,_0x4d6d8b){var _0x191e23={'raw':![],'where':{'id':_0x360386['params']['id']}},_0x5aa8d7={};_0x5aa8d7[_0x4c0e('0x32')]=_['keys'](db[_0x4c0e('0x30')][_0x4c0e('0x46')]);_0x5aa8d7[_0x4c0e('0x33')]=_[_0x4c0e('0x34')](_0x360386[_0x4c0e('0x33')]);_0x5aa8d7['filters']=_[_0x4c0e('0x37')](_0x5aa8d7['model'],_0x5aa8d7[_0x4c0e('0x33')]);_0x191e23['attributes']=_[_0x4c0e('0x37')](_0x5aa8d7[_0x4c0e('0x32')],qs[_0x4c0e('0x38')](_0x360386[_0x4c0e('0x33')][_0x4c0e('0x38')]));_0x191e23[_0x4c0e('0x36')]=_0x191e23[_0x4c0e('0x36')][_0x4c0e('0x39')]?_0x191e23[_0x4c0e('0x36')]:_0x5aa8d7[_0x4c0e('0x32')];if(_0x360386[_0x4c0e('0x33')][_0x4c0e('0x47')]){_0x191e23[_0x4c0e('0x48')]=[{'all':!![]}];}_0x191e23=_['merge']({},_0x191e23,_0x360386[_0x4c0e('0x43')]);return db[_0x4c0e('0x30')][_0x4c0e('0x49')](_0x191e23)[_0x4c0e('0x28')](handleEntityNotFound(_0x4d6d8b,null))[_0x4c0e('0x28')](respondWithResult(_0x4d6d8b,null))['catch'](handleError(_0x4d6d8b,null));};exports['create']=function(_0x124055,_0xdf95cb){return db[_0x4c0e('0x30')][_0x4c0e('0x4a')](_0x124055[_0x4c0e('0x4b')],{})[_0x4c0e('0x28')](function(_0x45fb2d){var _0x2d50e1=_0x124055[_0x4c0e('0x4c')]['get']({'plain':!![]});if(!_0x2d50e1)throw new Error(_0x4c0e('0x4d'));if(_0x2d50e1[_0x4c0e('0x4e')]===_0x4c0e('0x4c')){var _0x52c5cc=_0x45fb2d[_0x4c0e('0x2a')]({'plain':!![]});var _0x17a034=_0x4c0e('0x4f');return db[_0x4c0e('0x50')]['find']({'where':{'name':_0x17a034,'userProfileId':_0x2d50e1[_0x4c0e('0x51')]},'raw':!![]})[_0x4c0e('0x28')](function(_0x3e5616){if(_0x3e5616&&_0x3e5616[_0x4c0e('0x52')]===0x0){return db[_0x4c0e('0x2b')][_0x4c0e('0x4a')]({'name':_0x52c5cc[_0x4c0e('0x2e')],'resourceId':_0x52c5cc['id'],'type':_0x3e5616[_0x4c0e('0x2e')],'sectionId':_0x3e5616['id']},{})[_0x4c0e('0x28')](function(){return _0x45fb2d;});}else{return _0x45fb2d;}})['catch'](function(_0x53b5e7){logger[_0x4c0e('0x2c')](_0x4c0e('0x53'),_0x53b5e7);throw _0x53b5e7;});}return _0x45fb2d;})['then'](respondWithResult(_0xdf95cb,0xc9))[_0x4c0e('0x45')](handleError(_0xdf95cb,null));};exports[_0x4c0e('0x54')]=function(_0x1bfdd8,_0x41b536){var _0xfcaf3c={'where':{'id':_0x1bfdd8[_0x4c0e('0x55')]['id']}},_0x4d9f9d={};_0x4d9f9d[_0x4c0e('0x32')]=_[_0x4c0e('0x34')](db[_0x4c0e('0x30')][_0x4c0e('0x46')]);_0xfcaf3c['attributes']=_[_0x4c0e('0x37')](_0x4d9f9d[_0x4c0e('0x32')],qs[_0x4c0e('0x38')](_0x1bfdd8[_0x4c0e('0x33')][_0x4c0e('0x38')]));_0xfcaf3c[_0x4c0e('0x36')]=_0xfcaf3c[_0x4c0e('0x36')][_0x4c0e('0x39')]?_0xfcaf3c['attributes']:_0x4d9f9d[_0x4c0e('0x32')];if(_0x1bfdd8['query'][_0x4c0e('0x47')]){_0xfcaf3c[_0x4c0e('0x48')]=[{'all':!![]}];}_0xfcaf3c=_['merge']({},_0xfcaf3c,_0x1bfdd8[_0x4c0e('0x43')]);return db[_0x4c0e('0x30')][_0x4c0e('0x49')](_0xfcaf3c)[_0x4c0e('0x28')](handleEntityNotFound(_0x41b536,null))['then'](function(_0x4f80ea){if(_0x4f80ea){var _0x39e161=_0x4f80ea[_0x4c0e('0x2a')]({'plain':!![]});_0x39e161=qs[_0x4c0e('0x56')](_0x39e161,['id',_0x4c0e('0x57'),_0x4c0e('0x58')]);_0x1bfdd8[_0x4c0e('0x4b')]=_[_0x4c0e('0x56')](_0x1bfdd8[_0x4c0e('0x4b')],['id',_0x4c0e('0x57'),_0x4c0e('0x58')]);return db['Dashboard'][_0x4c0e('0x4a')](_[_0x4c0e('0x40')](_0x39e161,_0x1bfdd8[_0x4c0e('0x4b')]),{'include':_0x1bfdd8['query'][_0x4c0e('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x3b5b58){var _0x1165a3=_0x1bfdd8['user'][_0x4c0e('0x2a')]({'plain':!![]});if(!_0x1165a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1165a3[_0x4c0e('0x4e')]===_0x4c0e('0x4c')){var _0x9cadd5=_0x3b5b58['get']({'plain':!![]});var _0x38617e=_0x4c0e('0x4f');return db[_0x4c0e('0x50')]['find']({'where':{'name':_0x38617e,'userProfileId':_0x1165a3[_0x4c0e('0x51')]},'raw':!![]})['then'](function(_0x531227){if(_0x531227&&_0x531227[_0x4c0e('0x52')]===0x0){return db[_0x4c0e('0x2b')][_0x4c0e('0x4a')]({'name':_0x9cadd5[_0x4c0e('0x2e')],'resourceId':_0x9cadd5['id'],'type':_0x531227['name'],'sectionId':_0x531227['id']},{})[_0x4c0e('0x28')](function(){return _0x3b5b58;});}else{return _0x3b5b58;}})['catch'](function(_0x33a858){logger[_0x4c0e('0x2c')](_0x4c0e('0x53'),_0x33a858);throw _0x33a858;});}return _0x3b5b58;});}})[_0x4c0e('0x28')](respondWithResult(_0x41b536,0xc9))[_0x4c0e('0x45')](handleError(_0x41b536,null));};exports['update']=function(_0x574e15,_0x21beb5){if(_0x574e15['body']['id']){delete _0x574e15[_0x4c0e('0x4b')]['id'];}return db[_0x4c0e('0x30')][_0x4c0e('0x49')]({'where':{'id':_0x574e15[_0x4c0e('0x55')]['id']}})['then'](handleEntityNotFound(_0x21beb5,null))[_0x4c0e('0x28')](saveUpdates(_0x574e15[_0x4c0e('0x4b')],null))[_0x4c0e('0x28')](respondWithResult(_0x21beb5,null))[_0x4c0e('0x45')](handleError(_0x21beb5,null));};exports[_0x4c0e('0x29')]=function(_0x4700b9,_0x5e83ea){return db[_0x4c0e('0x30')][_0x4c0e('0x49')]({'where':{'id':_0x4700b9[_0x4c0e('0x55')]['id']}})[_0x4c0e('0x28')](handleEntityNotFound(_0x5e83ea,null))['then'](removeEntity(_0x5e83ea,null))[_0x4c0e('0x45')](handleError(_0x5e83ea,null));};function widgetAttributes(_0x2353d1){try{switch(_0x2353d1[_0x4c0e('0x41')]){case _0x4c0e('0x59'):return[{'name':_0x4c0e('0x5a'),'value':_0x2353d1[_0x4c0e('0x5a')]||(_0x2353d1['attrs']&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1[_0x4c0e('0x5b')][0x0][_0x4c0e('0x5c')]:undefined)||'https://'}];case _0x4c0e('0x5d'):return[{'name':_0x4c0e('0x5e'),'value':_0x2353d1[_0x4c0e('0x5e')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x0]?_0x2353d1[_0x4c0e('0x5b')][0x0][_0x4c0e('0x5c')]:undefined)||''}];case'clock':return[{'name':_0x4c0e('0x5f'),'value':_0x2353d1[_0x4c0e('0x5f')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1['attrs'][0x0][_0x4c0e('0x5c')]:undefined)||_0x4c0e('0x60')},{'name':'attrTimezone','value':_0x2353d1[_0x4c0e('0x61')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x1]?_0x2353d1[_0x4c0e('0x5b')][0x1][_0x4c0e('0x5c')]:undefined)||_0x4c0e('0x62')},{'name':_0x4c0e('0x63'),'value':_0x2353d1['attrFontSize']||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x2]?_0x2353d1['attrs'][0x2][_0x4c0e('0x5c')]:undefined)||0xc}];case _0x4c0e('0x64'):return[{'name':_0x4c0e('0x65'),'value':_0x2353d1[_0x4c0e('0x65')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1[_0x4c0e('0x5b')][0x0][_0x4c0e('0x5c')]:undefined)||_0x4c0e('0x66')},{'name':'attrVoiceQueues','value':_0x2353d1[_0x4c0e('0x67')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x1]?_0x2353d1[_0x4c0e('0x5b')][0x1][_0x4c0e('0x5c')]:undefined)||[]},{'name':_0x4c0e('0x63'),'value':_0x2353d1[_0x4c0e('0x63')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x2]?_0x2353d1[_0x4c0e('0x5b')][0x2]['value']:undefined)||0x14},{'name':_0x4c0e('0x68'),'value':_0x2353d1['attrChannel']||(_0x2353d1['attrs']&&_0x2353d1[_0x4c0e('0x5b')][0x3]?_0x2353d1[_0x4c0e('0x5b')][0x3]['value']:undefined)||_0x4c0e('0x69')},{'name':'attrEmailAccounts','value':_0x2353d1[_0x4c0e('0x6a')]||(_0x2353d1['attrs']&&_0x2353d1[_0x4c0e('0x5b')][0x4]?_0x2353d1[_0x4c0e('0x5b')][0x4][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6b'),'value':_0x2353d1[_0x4c0e('0x6b')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x5]?_0x2353d1['attrs'][0x5][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6c'),'value':_0x2353d1['attrSmsAccounts']||(_0x2353d1['attrs']&&_0x2353d1[_0x4c0e('0x5b')][0x6]?_0x2353d1[_0x4c0e('0x5b')][0x6][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6d'),'value':_0x2353d1[_0x4c0e('0x6d')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x7]?_0x2353d1[_0x4c0e('0x5b')][0x7][_0x4c0e('0x5c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2353d1[_0x4c0e('0x6e')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x8]?_0x2353d1[_0x4c0e('0x5b')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x2353d1[_0x4c0e('0x6f')]||(_0x2353d1['attrs']&&_0x2353d1[_0x4c0e('0x5b')][0x9]?_0x2353d1[_0x4c0e('0x5b')][0x9]['value']:undefined)||''}];case _0x4c0e('0x70'):case _0x4c0e('0x71'):return[{'name':'attrSerie1','value':_0x2353d1[_0x4c0e('0x72')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1['attrs'][0x0][_0x4c0e('0x5c')]:undefined)||_0x4c0e('0x66')},{'name':_0x4c0e('0x73'),'value':_0x2353d1[_0x4c0e('0x73')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x1]?_0x2353d1['attrs'][0x1][_0x4c0e('0x5c')]:undefined)||null},{'name':_0x4c0e('0x74'),'value':_0x2353d1[_0x4c0e('0x74')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x2]?_0x2353d1[_0x4c0e('0x5b')][0x2]['value']:undefined)||null},{'name':_0x4c0e('0x67'),'value':_0x2353d1[_0x4c0e('0x67')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x3]?_0x2353d1[_0x4c0e('0x5b')][0x3][_0x4c0e('0x5c')]:undefined)||[]},{'name':_0x4c0e('0x68'),'value':_0x2353d1[_0x4c0e('0x68')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x4]?_0x2353d1[_0x4c0e('0x5b')][0x4][_0x4c0e('0x5c')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2353d1[_0x4c0e('0x6a')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x5]?_0x2353d1[_0x4c0e('0x5b')][0x5][_0x4c0e('0x5c')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2353d1[_0x4c0e('0x6b')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x6]?_0x2353d1[_0x4c0e('0x5b')][0x6][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6c'),'value':_0x2353d1['attrSmsAccounts']||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x7]?_0x2353d1['attrs'][0x7][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6d'),'value':_0x2353d1[_0x4c0e('0x6d')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1['attrs'][0x8]?_0x2353d1[_0x4c0e('0x5b')][0x8][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6e'),'value':_0x2353d1[_0x4c0e('0x6e')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x9]?_0x2353d1[_0x4c0e('0x5b')][0x9][_0x4c0e('0x5c')]:undefined)||''},{'name':_0x4c0e('0x6f'),'value':_0x2353d1[_0x4c0e('0x6f')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0xa]?_0x2353d1[_0x4c0e('0x5b')][0xa][_0x4c0e('0x5c')]:undefined)||''}];case _0x4c0e('0x75'):return[{'name':_0x4c0e('0x76'),'type':_0x2353d1[_0x4c0e('0x77')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1['attrs'][0x0][_0x4c0e('0x41')]:undefined)||null,'value':_0x2353d1['attrReport']||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x0]?_0x2353d1[_0x4c0e('0x5b')][0x0][_0x4c0e('0x5c')]:undefined)||null},{'name':_0x4c0e('0x78'),'value':_0x2353d1[_0x4c0e('0x78')]||(_0x2353d1[_0x4c0e('0x5b')]&&_0x2353d1[_0x4c0e('0x5b')][0x1]?_0x2353d1['attrs'][0x1][_0x4c0e('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x5ba68e){logger[_0x4c0e('0x2c')](_0x4c0e('0x79'),JSON['stringify'](_0x5ba68e));return[];}}exports[_0x4c0e('0x7a')]=function(_0x118628,_0x3ed3cf,_0x8e60d){if(_0x118628[_0x4c0e('0x4b')]['id']){delete _0x118628[_0x4c0e('0x4b')]['id'];}return db[_0x4c0e('0x30')][_0x4c0e('0x49')]({'where':{'id':_0x118628[_0x4c0e('0x55')]['id']}})[_0x4c0e('0x28')](handleEntityNotFound(_0x3ed3cf,null))[_0x4c0e('0x28')](function(_0x51f201){if(_0x51f201){_0x118628[_0x4c0e('0x4b')]['DashboardId']=_0x51f201['id'];_0x118628['body']['attrs']=widgetAttributes(_0x118628['body']);return db[_0x4c0e('0x7b')][_0x4c0e('0x4a')](_0x118628[_0x4c0e('0x4b')]);}})['then'](respondWithResult(_0x3ed3cf,null))[_0x4c0e('0x45')](handleError(_0x3ed3cf,null));};exports[_0x4c0e('0x7c')]=function(_0x221a15,_0x3c30c8,_0x3bd652){var _0x290cde={};var _0x1ee484={};var _0x41c971;var _0x2c7630;return db[_0x4c0e('0x30')][_0x4c0e('0x7d')]({'where':{'id':_0x221a15[_0x4c0e('0x55')]['id']}})['then'](handleEntityNotFound(_0x3c30c8,null))['then'](function(_0x168ad3){if(_0x168ad3){_0x41c971=_0x168ad3;_0x1ee484[_0x4c0e('0x32')]=_[_0x4c0e('0x34')](db[_0x4c0e('0x7b')][_0x4c0e('0x46')]);_0x1ee484['query']=_[_0x4c0e('0x34')](_0x221a15[_0x4c0e('0x33')]);_0x1ee484[_0x4c0e('0x35')]=_[_0x4c0e('0x37')](_0x1ee484['model'],_0x1ee484[_0x4c0e('0x33')]);_0x290cde[_0x4c0e('0x36')]=_['intersection'](_0x1ee484[_0x4c0e('0x32')],qs[_0x4c0e('0x38')](_0x221a15[_0x4c0e('0x33')]['fields']));_0x290cde[_0x4c0e('0x36')]=_0x290cde[_0x4c0e('0x36')]['length']?_0x290cde['attributes']:_0x1ee484['model'];_0x290cde[_0x4c0e('0x3c')]=qs['sort'](_0x221a15[_0x4c0e('0x33')][_0x4c0e('0x3d')]);_0x290cde['where']=qs[_0x4c0e('0x35')](_['pick'](_0x221a15[_0x4c0e('0x33')],_0x1ee484[_0x4c0e('0x35')]));if(_0x221a15[_0x4c0e('0x33')][_0x4c0e('0x7e')]){_0x290cde[_0x4c0e('0x3e')]=_[_0x4c0e('0x40')](_0x290cde[_0x4c0e('0x3e')],{'$or':_[_0x4c0e('0x7f')](_0x290cde[_0x4c0e('0x36')],function(_0x4eabdd){var _0x5c60a2={};_0x5c60a2[_0x4eabdd]={'$like':'%'+_0x221a15[_0x4c0e('0x33')][_0x4c0e('0x7e')]+'%'};return _0x5c60a2;})});}_0x290cde=_[_0x4c0e('0x40')]({},_0x290cde,_0x221a15[_0x4c0e('0x43')]);return _0x41c971['getItems'](_0x290cde);}})[_0x4c0e('0x28')](function(_0x2845b6){if(_0x2845b6){_0x2c7630=_0x2845b6[_0x4c0e('0x39')];if(!_0x221a15[_0x4c0e('0x33')][_0x4c0e('0x3a')](_0x4c0e('0x3b'))){_0x290cde[_0x4c0e('0x21')]=qs[_0x4c0e('0x21')](_0x221a15[_0x4c0e('0x33')][_0x4c0e('0x21')]);_0x290cde[_0x4c0e('0x20')]=qs['offset'](_0x221a15[_0x4c0e('0x33')]['offset']);}return _0x41c971[_0x4c0e('0x7c')](_0x290cde);}})[_0x4c0e('0x28')](function(_0x1a4f4b){if(_0x1a4f4b){return _0x1a4f4b?{'count':_0x2c7630,'rows':_0x1a4f4b}:null;}})[_0x4c0e('0x28')](respondWithResult(_0x3c30c8,null))[_0x4c0e('0x45')](handleError(_0x3c30c8,null));}; \ No newline at end of file +var _0x2bee=['attrReport','attrRefresh','stringify','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','CustomDashboards','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report'];(function(_0x522e4c,_0x11ee75){var _0x58d6c1=function(_0x2b40c3){while(--_0x2b40c3){_0x522e4c['push'](_0x522e4c['shift']());}};_0x58d6c1(++_0x11ee75);}(_0x2bee,0x83));var _0xe2be=function(_0x4a7193,_0x556c6a){_0x4a7193=_0x4a7193-0x0;var _0xc33d94=_0x2bee[_0x4a7193];return _0xc33d94;};'use strict';var emlformat=require(_0xe2be('0x0'));var rimraf=require(_0xe2be('0x1'));var zipdir=require(_0xe2be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2be('0x3'));var Mustache=require(_0xe2be('0x4'));var util=require(_0xe2be('0x5'));var path=require(_0xe2be('0x6'));var sox=require(_0xe2be('0x7'));var csv=require(_0xe2be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2be('0x9'));var squel=require(_0xe2be('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2be('0xb'));var deskjs=require(_0xe2be('0xc'));var toCsv=require(_0xe2be('0x8'));var querystring=require('querystring');var Papa=require(_0xe2be('0xd'));var Redis=require(_0xe2be('0xe'));var authService=require(_0xe2be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe2be('0x10'));var hardwareService=require(_0xe2be('0x11'));var logger=require(_0xe2be('0x12'))(_0xe2be('0x13'));var utils=require(_0xe2be('0x14'));var config=require(_0xe2be('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2be('0x16'))['db'];config['redis']=_[_0xe2be('0x17')](config[_0xe2be('0x18')],{'host':_0xe2be('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2be('0x18')]));require('./dashboard.socket')[_0xe2be('0x1a')](socket);function respondWithStatusCode(_0x4bc6a3,_0xa2de83){_0xa2de83=_0xa2de83||0xcc;return function(_0x52a0e1){if(_0x52a0e1){return _0x4bc6a3[_0xe2be('0x1b')](_0xa2de83);}return _0x4bc6a3[_0xe2be('0x1c')](_0xa2de83)[_0xe2be('0x1d')]();};}function respondWithResult(_0x52440f,_0x4a7555){_0x4a7555=_0x4a7555||0xc8;return function(_0x51a466){if(_0x51a466){return _0x52440f[_0xe2be('0x1c')](_0x4a7555)[_0xe2be('0x1e')](_0x51a466);}};}function respondWithFilteredResult(_0x30924b,_0x1fd268){return function(_0x3aff11){if(_0x3aff11){var _0x1ab6e2=typeof _0x1fd268[_0xe2be('0x1f')]===_0xe2be('0x20')&&typeof _0x1fd268['limit']===_0xe2be('0x20');var _0x3f2f1f=_0x3aff11[_0xe2be('0x21')];var _0x468450=_0x1ab6e2?0x0:_0x1fd268[_0xe2be('0x1f')];var _0x4f4709=_0x1ab6e2?_0x3aff11[_0xe2be('0x21')]:_0x1fd268[_0xe2be('0x1f')]+_0x1fd268[_0xe2be('0x22')];var _0x375c29;if(_0x4f4709>=_0x3f2f1f){_0x4f4709=_0x3f2f1f;_0x375c29=0xc8;}else{_0x375c29=0xce;}_0x30924b[_0xe2be('0x1c')](_0x375c29);return _0x30924b[_0xe2be('0x23')](_0xe2be('0x24'),_0x468450+'-'+_0x4f4709+'/'+_0x3f2f1f)[_0xe2be('0x1e')](_0x3aff11);}return null;};}function patchUpdates(_0x46b061){return function(_0x362b41){try{jsonpatch[_0xe2be('0x25')](_0x362b41,_0x46b061,!![]);}catch(_0x2e84a3){return BPromise[_0xe2be('0x26')](_0x2e84a3);}return _0x362b41[_0xe2be('0x27')]();};}function saveUpdates(_0x151eab,_0x54d035){return function(_0x167a75){if(_0x167a75){return _0x167a75['update'](_0x151eab)[_0xe2be('0x28')](function(_0x3fef21){return _0x3fef21;});}return null;};}function removeEntity(_0x58f96d,_0x3cd266){return function(_0xffe89){if(_0xffe89){return _0xffe89[_0xe2be('0x29')]()[_0xe2be('0x28')](function(){var _0x20c644=_0xffe89[_0xe2be('0x2a')]({'plain':!![]});var _0x3069d0=_0xe2be('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3069d0,'resourceId':_0x20c644['id']}})[_0xe2be('0x28')](function(){return _0xffe89;});})[_0xe2be('0x28')](function(){_0x58f96d[_0xe2be('0x1c')](0xcc)[_0xe2be('0x1d')]();});}};}function handleEntityNotFound(_0x14bc38,_0x40a4d9){return function(_0x41e447){if(!_0x41e447){_0x14bc38[_0xe2be('0x1b')](0x194);}return _0x41e447;};}function handleError(_0x20d090,_0x1ec682){_0x1ec682=_0x1ec682||0x1f4;return function(_0x2fd891){logger[_0xe2be('0x2c')](_0x2fd891[_0xe2be('0x2d')]);if(_0x2fd891[_0xe2be('0x2e')]){delete _0x2fd891[_0xe2be('0x2e')];}_0x20d090[_0xe2be('0x1c')](_0x1ec682)['send'](_0x2fd891);};}exports[_0xe2be('0x2f')]=function(_0x14e2bd,_0x460f2f){var _0x1c2e48={},_0x4b7a5f={},_0x27c2b4={'count':0x0,'rows':[]};var _0x5b7937=_[_0xe2be('0x30')](db[_0xe2be('0x31')][_0xe2be('0x32')],function(_0x23aed7){return{'name':_0x23aed7[_0xe2be('0x33')],'type':_0x23aed7[_0xe2be('0x34')][_0xe2be('0x35')]};});_0x4b7a5f[_0xe2be('0x36')]=_[_0xe2be('0x30')](_0x5b7937,_0xe2be('0x2e'));_0x4b7a5f[_0xe2be('0x37')]=_[_0xe2be('0x38')](_0x14e2bd[_0xe2be('0x37')]);_0x4b7a5f[_0xe2be('0x39')]=_['intersection'](_0x4b7a5f[_0xe2be('0x36')],_0x4b7a5f['query']);_0x1c2e48[_0xe2be('0x3a')]=_[_0xe2be('0x3b')](_0x4b7a5f['model'],qs[_0xe2be('0x3c')](_0x14e2bd[_0xe2be('0x37')][_0xe2be('0x3c')]));_0x1c2e48[_0xe2be('0x3a')]=_0x1c2e48[_0xe2be('0x3a')][_0xe2be('0x3d')]?_0x1c2e48[_0xe2be('0x3a')]:_0x4b7a5f[_0xe2be('0x36')];if(!_0x14e2bd['query'][_0xe2be('0x3e')]('nolimit')){_0x1c2e48[_0xe2be('0x22')]=qs[_0xe2be('0x22')](_0x14e2bd['query'][_0xe2be('0x22')]);_0x1c2e48['offset']=qs['offset'](_0x14e2bd[_0xe2be('0x37')][_0xe2be('0x1f')]);}_0x1c2e48[_0xe2be('0x3f')]=qs[_0xe2be('0x40')](_0x14e2bd[_0xe2be('0x37')][_0xe2be('0x40')]);_0x1c2e48['where']=qs[_0xe2be('0x39')](_[_0xe2be('0x41')](_0x14e2bd[_0xe2be('0x37')],_0x4b7a5f['filters']),_0x5b7937);if(_0x14e2bd[_0xe2be('0x37')][_0xe2be('0x42')]){_0x1c2e48[_0xe2be('0x43')]=_[_0xe2be('0x44')](_0x1c2e48[_0xe2be('0x43')],{'$or':_[_0xe2be('0x30')](_0x5b7937,function(_0x434712){if(_0x434712[_0xe2be('0x34')]!==_0xe2be('0x45')){var _0x4f5335={};_0x4f5335[_0x434712[_0xe2be('0x2e')]]={'$like':'%'+_0x14e2bd['query'][_0xe2be('0x42')]+'%'};return _0x4f5335;}})});}_0x1c2e48=_[_0xe2be('0x44')]({},_0x1c2e48,_0x14e2bd[_0xe2be('0x46')]);var _0x26d0f7={'where':_0x1c2e48[_0xe2be('0x43')]};return db[_0xe2be('0x31')][_0xe2be('0x21')](_0x26d0f7)[_0xe2be('0x28')](function(_0x2f2406){_0x27c2b4[_0xe2be('0x21')]=_0x2f2406;if(_0x14e2bd['query']['includeAll']){_0x1c2e48[_0xe2be('0x47')]=[{'all':!![]}];}return db[_0xe2be('0x31')][_0xe2be('0x48')](_0x1c2e48);})[_0xe2be('0x28')](function(_0x449bf4){_0x27c2b4['rows']=_0x449bf4;return _0x27c2b4;})[_0xe2be('0x28')](respondWithFilteredResult(_0x460f2f,_0x1c2e48))[_0xe2be('0x49')](handleError(_0x460f2f,null));};exports[_0xe2be('0x4a')]=function(_0x155d83,_0x2a22b3){var _0x3a06f0={'raw':![],'where':{'id':_0x155d83[_0xe2be('0x4b')]['id']}},_0x5dc342={};_0x5dc342['model']=_[_0xe2be('0x38')](db[_0xe2be('0x31')][_0xe2be('0x32')]);_0x5dc342[_0xe2be('0x37')]=_[_0xe2be('0x38')](_0x155d83[_0xe2be('0x37')]);_0x5dc342[_0xe2be('0x39')]=_[_0xe2be('0x3b')](_0x5dc342[_0xe2be('0x36')],_0x5dc342[_0xe2be('0x37')]);_0x3a06f0['attributes']=_[_0xe2be('0x3b')](_0x5dc342[_0xe2be('0x36')],qs[_0xe2be('0x3c')](_0x155d83[_0xe2be('0x37')][_0xe2be('0x3c')]));_0x3a06f0['attributes']=_0x3a06f0[_0xe2be('0x3a')][_0xe2be('0x3d')]?_0x3a06f0[_0xe2be('0x3a')]:_0x5dc342[_0xe2be('0x36')];if(_0x155d83[_0xe2be('0x37')][_0xe2be('0x4c')]){_0x3a06f0[_0xe2be('0x47')]=[{'all':!![]}];}_0x3a06f0=_[_0xe2be('0x44')]({},_0x3a06f0,_0x155d83[_0xe2be('0x46')]);return db[_0xe2be('0x31')][_0xe2be('0x4d')](_0x3a06f0)[_0xe2be('0x28')](handleEntityNotFound(_0x2a22b3,null))['then'](respondWithResult(_0x2a22b3,null))['catch'](handleError(_0x2a22b3,null));};exports['create']=function(_0xb0132b,_0x2e2b2d){return db[_0xe2be('0x31')][_0xe2be('0x4e')](_0xb0132b[_0xe2be('0x4f')],{})[_0xe2be('0x28')](function(_0x2f6cc7){var _0x4d1211=_0xb0132b[_0xe2be('0x50')]['get']({'plain':!![]});if(!_0x4d1211)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d1211[_0xe2be('0x51')]===_0xe2be('0x50')){var _0x3ab884=_0x2f6cc7[_0xe2be('0x2a')]({'plain':!![]});var _0xc4fb1d=_0xe2be('0x2b');return db[_0xe2be('0x52')]['find']({'where':{'name':_0xc4fb1d,'userProfileId':_0x4d1211['userProfileId']},'raw':!![]})[_0xe2be('0x28')](function(_0x815879){if(_0x815879&&_0x815879[_0xe2be('0x53')]===0x0){return db[_0xe2be('0x54')][_0xe2be('0x4e')]({'name':_0x3ab884['name'],'resourceId':_0x3ab884['id'],'type':_0x815879[_0xe2be('0x2e')],'sectionId':_0x815879['id']},{})['then'](function(){return _0x2f6cc7;});}else{return _0x2f6cc7;}})['catch'](function(_0x226032){logger['error'](_0xe2be('0x55'),_0x226032);throw _0x226032;});}return _0x2f6cc7;})[_0xe2be('0x28')](respondWithResult(_0x2e2b2d,0xc9))[_0xe2be('0x49')](handleError(_0x2e2b2d,null));};exports[_0xe2be('0x56')]=function(_0x201c17,_0x3257df){var _0xbbb11d={'where':{'id':_0x201c17[_0xe2be('0x4b')]['id']}},_0x41e5cb={};_0x41e5cb[_0xe2be('0x36')]=_[_0xe2be('0x38')](db[_0xe2be('0x31')]['rawAttributes']);_0xbbb11d[_0xe2be('0x3a')]=_[_0xe2be('0x3b')](_0x41e5cb[_0xe2be('0x36')],qs[_0xe2be('0x3c')](_0x201c17[_0xe2be('0x37')]['fields']));_0xbbb11d['attributes']=_0xbbb11d[_0xe2be('0x3a')]['length']?_0xbbb11d['attributes']:_0x41e5cb['model'];if(_0x201c17[_0xe2be('0x37')]['includeAll']){_0xbbb11d[_0xe2be('0x47')]=[{'all':!![]}];}_0xbbb11d=_[_0xe2be('0x44')]({},_0xbbb11d,_0x201c17[_0xe2be('0x46')]);return db[_0xe2be('0x31')][_0xe2be('0x4d')](_0xbbb11d)[_0xe2be('0x28')](handleEntityNotFound(_0x3257df,null))[_0xe2be('0x28')](function(_0x17f9fc){if(_0x17f9fc){var _0x824dce=_0x17f9fc[_0xe2be('0x2a')]({'plain':!![]});_0x824dce=qs[_0xe2be('0x57')](_0x824dce,['id','createdAt','updatedAt']);_0x201c17[_0xe2be('0x4f')]=_['omit'](_0x201c17['body'],['id',_0xe2be('0x58'),'updatedAt']);return db[_0xe2be('0x31')]['create'](_['merge'](_0x824dce,_0x201c17[_0xe2be('0x4f')]),{'include':_0x201c17[_0xe2be('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0xe2be('0x28')](function(_0x1fe30c){var _0x9d7c55=_0x201c17[_0xe2be('0x50')][_0xe2be('0x2a')]({'plain':!![]});if(!_0x9d7c55)throw new Error(_0xe2be('0x59'));if(_0x9d7c55['role']==='user'){var _0xde235a=_0x1fe30c[_0xe2be('0x2a')]({'plain':!![]});var _0x5ae866=_0xe2be('0x2b');return db[_0xe2be('0x52')]['find']({'where':{'name':_0x5ae866,'userProfileId':_0x9d7c55['userProfileId']},'raw':!![]})['then'](function(_0x70d287){if(_0x70d287&&_0x70d287[_0xe2be('0x53')]===0x0){return db[_0xe2be('0x54')][_0xe2be('0x4e')]({'name':_0xde235a[_0xe2be('0x2e')],'resourceId':_0xde235a['id'],'type':_0x70d287[_0xe2be('0x2e')],'sectionId':_0x70d287['id']},{})['then'](function(){return _0x1fe30c;});}else{return _0x1fe30c;}})[_0xe2be('0x49')](function(_0x5a54bc){logger[_0xe2be('0x2c')](_0xe2be('0x55'),_0x5a54bc);throw _0x5a54bc;});}return _0x1fe30c;});}})['then'](respondWithResult(_0x3257df,0xc9))['catch'](handleError(_0x3257df,null));};exports[_0xe2be('0x5a')]=function(_0x1976df,_0x14868b){if(_0x1976df[_0xe2be('0x4f')]['id']){delete _0x1976df['body']['id'];}return db['Dashboard'][_0xe2be('0x4d')]({'where':{'id':_0x1976df[_0xe2be('0x4b')]['id']}})[_0xe2be('0x28')](handleEntityNotFound(_0x14868b,null))['then'](saveUpdates(_0x1976df['body'],null))[_0xe2be('0x28')](respondWithResult(_0x14868b,null))[_0xe2be('0x49')](handleError(_0x14868b,null));};exports[_0xe2be('0x29')]=function(_0x2397ec,_0x62ec7){return db[_0xe2be('0x31')][_0xe2be('0x4d')]({'where':{'id':_0x2397ec['params']['id']}})[_0xe2be('0x28')](handleEntityNotFound(_0x62ec7,null))[_0xe2be('0x28')](removeEntity(_0x62ec7,null))['catch'](handleError(_0x62ec7,null));};function widgetAttributes(_0x402251){try{switch(_0x402251[_0xe2be('0x34')]){case _0xe2be('0x5b'):return[{'name':_0xe2be('0x5c'),'value':_0x402251[_0xe2be('0x5c')]||(_0x402251['attrs']&&_0x402251['attrs'][0x0]?_0x402251[_0xe2be('0x5d')][0x0][_0xe2be('0x5e')]:undefined)||'https://'}];case _0xe2be('0x5f'):return[{'name':_0xe2be('0x60'),'value':_0x402251[_0xe2be('0x60')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x0]?_0x402251[_0xe2be('0x5d')][0x0][_0xe2be('0x5e')]:undefined)||''}];case _0xe2be('0x61'):return[{'name':_0xe2be('0x62'),'value':_0x402251[_0xe2be('0x62')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x0]?_0x402251[_0xe2be('0x5d')][0x0][_0xe2be('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0xe2be('0x63'),'value':_0x402251[_0xe2be('0x63')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x1]?_0x402251[_0xe2be('0x5d')][0x1]['value']:undefined)||_0xe2be('0x64')},{'name':_0xe2be('0x65'),'value':_0x402251['attrFontSize']||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x2]?_0x402251[_0xe2be('0x5d')][0x2][_0xe2be('0x5e')]:undefined)||0xc}];case _0xe2be('0x66'):return[{'name':_0xe2be('0x67'),'value':_0x402251['attrMetric']||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x0]?_0x402251['attrs'][0x0][_0xe2be('0x5e')]:undefined)||_0xe2be('0x68')},{'name':'attrVoiceQueues','value':_0x402251[_0xe2be('0x69')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x1]?_0x402251[_0xe2be('0x5d')][0x1][_0xe2be('0x5e')]:undefined)||[]},{'name':_0xe2be('0x65'),'value':_0x402251[_0xe2be('0x65')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x2]?_0x402251[_0xe2be('0x5d')][0x2][_0xe2be('0x5e')]:undefined)||0x14},{'name':_0xe2be('0x6a'),'value':_0x402251['attrChannel']||(_0x402251['attrs']&&_0x402251[_0xe2be('0x5d')][0x3]?_0x402251[_0xe2be('0x5d')][0x3][_0xe2be('0x5e')]:undefined)||_0xe2be('0x6b')},{'name':_0xe2be('0x6c'),'value':_0x402251[_0xe2be('0x6c')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x4]?_0x402251[_0xe2be('0x5d')][0x4][_0xe2be('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x402251[_0xe2be('0x6d')]||(_0x402251['attrs']&&_0x402251[_0xe2be('0x5d')][0x5]?_0x402251['attrs'][0x5][_0xe2be('0x5e')]:undefined)||''},{'name':_0xe2be('0x6e'),'value':_0x402251[_0xe2be('0x6e')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x6]?_0x402251[_0xe2be('0x5d')][0x6]['value']:undefined)||''},{'name':_0xe2be('0x6f'),'value':_0x402251[_0xe2be('0x6f')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x7]?_0x402251[_0xe2be('0x5d')][0x7][_0xe2be('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x402251[_0xe2be('0x70')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x8]?_0x402251['attrs'][0x8][_0xe2be('0x5e')]:undefined)||''},{'name':_0xe2be('0x71'),'value':_0x402251[_0xe2be('0x71')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x9]?_0x402251['attrs'][0x9][_0xe2be('0x5e')]:undefined)||''}];case _0xe2be('0x72'):case _0xe2be('0x73'):return[{'name':_0xe2be('0x74'),'value':_0x402251['attrSerie1']||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x0]?_0x402251[_0xe2be('0x5d')][0x0][_0xe2be('0x5e')]:undefined)||_0xe2be('0x68')},{'name':'attrSerie2','value':_0x402251['attrSerie2']||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x1]?_0x402251['attrs'][0x1][_0xe2be('0x5e')]:undefined)||null},{'name':_0xe2be('0x75'),'value':_0x402251[_0xe2be('0x75')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x2]?_0x402251['attrs'][0x2][_0xe2be('0x5e')]:undefined)||null},{'name':_0xe2be('0x69'),'value':_0x402251['attrVoiceQueues']||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x3]?_0x402251[_0xe2be('0x5d')][0x3]['value']:undefined)||[]},{'name':_0xe2be('0x6a'),'value':_0x402251[_0xe2be('0x6a')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x4]?_0x402251[_0xe2be('0x5d')][0x4][_0xe2be('0x5e')]:undefined)||_0xe2be('0x6b')},{'name':'attrEmailAccounts','value':_0x402251[_0xe2be('0x6c')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x5]?_0x402251['attrs'][0x5][_0xe2be('0x5e')]:undefined)||''},{'name':_0xe2be('0x6d'),'value':_0x402251['attrFaxAccounts']||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x6]?_0x402251[_0xe2be('0x5d')][0x6][_0xe2be('0x5e')]:undefined)||''},{'name':_0xe2be('0x6e'),'value':_0x402251[_0xe2be('0x6e')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x7]?_0x402251[_0xe2be('0x5d')][0x7]['value']:undefined)||''},{'name':_0xe2be('0x6f'),'value':_0x402251[_0xe2be('0x6f')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x8]?_0x402251['attrs'][0x8][_0xe2be('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x402251[_0xe2be('0x70')]||(_0x402251['attrs']&&_0x402251[_0xe2be('0x5d')][0x9]?_0x402251[_0xe2be('0x5d')][0x9][_0xe2be('0x5e')]:undefined)||''},{'name':_0xe2be('0x71'),'value':_0x402251[_0xe2be('0x71')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0xa]?_0x402251['attrs'][0xa][_0xe2be('0x5e')]:undefined)||''}];case _0xe2be('0x76'):return[{'name':_0xe2be('0x77'),'type':_0x402251['reportType']||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x0]?_0x402251['attrs'][0x0][_0xe2be('0x34')]:undefined)||null,'value':_0x402251[_0xe2be('0x77')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251['attrs'][0x0]?_0x402251[_0xe2be('0x5d')][0x0][_0xe2be('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x402251[_0xe2be('0x78')]||(_0x402251[_0xe2be('0x5d')]&&_0x402251[_0xe2be('0x5d')][0x1]?_0x402251['attrs'][0x1][_0xe2be('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x4a834a){logger[_0xe2be('0x2c')]('widgetAttributes:\x20%s',JSON[_0xe2be('0x79')](_0x4a834a));return[];}}exports['addItem']=function(_0xf6c8f0,_0x27cebc,_0x1d69e6){if(_0xf6c8f0[_0xe2be('0x4f')]['id']){delete _0xf6c8f0['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0xf6c8f0[_0xe2be('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27cebc,null))[_0xe2be('0x28')](function(_0x5f78ab){if(_0x5f78ab){_0xf6c8f0['body']['DashboardId']=_0x5f78ab['id'];_0xf6c8f0[_0xe2be('0x4f')][_0xe2be('0x5d')]=widgetAttributes(_0xf6c8f0[_0xe2be('0x4f')]);return db[_0xe2be('0x7a')][_0xe2be('0x4e')](_0xf6c8f0[_0xe2be('0x4f')]);}})[_0xe2be('0x28')](respondWithResult(_0x27cebc,null))[_0xe2be('0x49')](handleError(_0x27cebc,null));};exports[_0xe2be('0x7b')]=function(_0x56742f,_0x2d39d7,_0x1cadc3){var _0xc45b22={};var _0x3f973b={};var _0x505cf9;var _0x23c7ed;return db[_0xe2be('0x31')][_0xe2be('0x7c')]({'where':{'id':_0x56742f[_0xe2be('0x4b')]['id']}})[_0xe2be('0x28')](handleEntityNotFound(_0x2d39d7,null))[_0xe2be('0x28')](function(_0xdea86b){if(_0xdea86b){_0x505cf9=_0xdea86b;_0x3f973b[_0xe2be('0x36')]=_[_0xe2be('0x38')](db[_0xe2be('0x7a')][_0xe2be('0x32')]);_0x3f973b['query']=_[_0xe2be('0x38')](_0x56742f[_0xe2be('0x37')]);_0x3f973b[_0xe2be('0x39')]=_[_0xe2be('0x3b')](_0x3f973b[_0xe2be('0x36')],_0x3f973b[_0xe2be('0x37')]);_0xc45b22[_0xe2be('0x3a')]=_[_0xe2be('0x3b')](_0x3f973b[_0xe2be('0x36')],qs['fields'](_0x56742f[_0xe2be('0x37')]['fields']));_0xc45b22[_0xe2be('0x3a')]=_0xc45b22[_0xe2be('0x3a')]['length']?_0xc45b22[_0xe2be('0x3a')]:_0x3f973b['model'];_0xc45b22[_0xe2be('0x3f')]=qs['sort'](_0x56742f[_0xe2be('0x37')]['sort']);_0xc45b22[_0xe2be('0x43')]=qs[_0xe2be('0x39')](_[_0xe2be('0x41')](_0x56742f['query'],_0x3f973b['filters']));if(_0x56742f[_0xe2be('0x37')][_0xe2be('0x42')]){_0xc45b22[_0xe2be('0x43')]=_[_0xe2be('0x44')](_0xc45b22[_0xe2be('0x43')],{'$or':_[_0xe2be('0x30')](_0xc45b22[_0xe2be('0x3a')],function(_0x2e87b3){var _0x573c6a={};_0x573c6a[_0x2e87b3]={'$like':'%'+_0x56742f['query'][_0xe2be('0x42')]+'%'};return _0x573c6a;})});}_0xc45b22=_[_0xe2be('0x44')]({},_0xc45b22,_0x56742f[_0xe2be('0x46')]);return _0x505cf9[_0xe2be('0x7b')](_0xc45b22);}})[_0xe2be('0x28')](function(_0x9d8951){if(_0x9d8951){_0x23c7ed=_0x9d8951[_0xe2be('0x3d')];if(!_0x56742f[_0xe2be('0x37')][_0xe2be('0x3e')]('nolimit')){_0xc45b22[_0xe2be('0x22')]=qs[_0xe2be('0x22')](_0x56742f[_0xe2be('0x37')][_0xe2be('0x22')]);_0xc45b22[_0xe2be('0x1f')]=qs[_0xe2be('0x1f')](_0x56742f['query'][_0xe2be('0x1f')]);}return _0x505cf9['getItems'](_0xc45b22);}})[_0xe2be('0x28')](function(_0x2a49b3){if(_0x2a49b3){return _0x2a49b3?{'count':_0x23c7ed,'rows':_0x2a49b3}:null;}})['then'](respondWithResult(_0x2d39d7,null))['catch'](handleError(_0x2d39d7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 73947bc..528a730 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 _0xc558=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x11deab,_0x595015){var _0x2a9bcf=function(_0x52d1cc){while(--_0x52d1cc){_0x11deab['push'](_0x11deab['shift']());}};_0x2a9bcf(++_0x595015);}(_0xc558,0x140));var _0x8c55=function(_0x4008a0,_0x25673e){_0x4008a0=_0x4008a0-0x0;var _0x16e9f2=_0xc558[_0x4008a0];return _0x16e9f2;};'use strict';var EventEmitter=require(_0x8c55('0x0'));var Dashboard=require(_0x8c55('0x1'))['db'][_0x8c55('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8c55('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c55('0x4'),'afterDestroy':_0x8c55('0x5')};function emitEvent(_0x554af4){return function(_0x1c92c4,_0x465022,_0x3b47bd){DashboardEvents[_0x8c55('0x6')](_0x554af4+':'+_0x1c92c4['id'],_0x1c92c4);DashboardEvents[_0x8c55('0x6')](_0x554af4,_0x1c92c4);_0x3b47bd(null);};}for(var e in events){if(events[_0x8c55('0x7')](e)){var event=events[e];Dashboard[_0x8c55('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x3249=['Dashboard','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x14b170,_0x1339ad){var _0x1be761=function(_0x4026f3){while(--_0x4026f3){_0x14b170['push'](_0x14b170['shift']());}};_0x1be761(++_0x1339ad);}(_0x3249,0xdf));var _0x9324=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x3249[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0x9324('0x0'));var Dashboard=require(_0x9324('0x1'))['db'][_0x9324('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9324('0x3'),'afterUpdate':'update','afterDestroy':_0x9324('0x4')};function emitEvent(_0x50b33d){return function(_0x138496,_0x23641f,_0x5c3917){DashboardEvents[_0x9324('0x5')](_0x50b33d+':'+_0x138496['id'],_0x138496);DashboardEvents[_0x9324('0x5')](_0x50b33d,_0x138496);_0x5c3917(null);};}for(var e in events){if(events[_0x9324('0x6')](e)){var event=events[e];Dashboard[_0x9324('0x7')](e,emitEvent(event));}}module[_0x9324('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 62cf463..5de1af0 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 _0xc222=['util','moment','bluebird','rimraf','../../config/environment','exports','Dashboard','dashboards','lodash'];(function(_0x5bde6a,_0x1d0810){var _0x2ee1ae=function(_0x2291bc){while(--_0x2291bc){_0x5bde6a['push'](_0x5bde6a['shift']());}};_0x2ee1ae(++_0x1d0810);}(_0xc222,0x194));var _0x2c22=function(_0x522a7b,_0x46956a){_0x522a7b=_0x522a7b-0x0;var _0x39a61d=_0xc222[_0x522a7b];return _0x39a61d;};'use strict';var _=require(_0x2c22('0x0'));var util=require(_0x2c22('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2c22('0x2'));var BPromise=require(_0x2c22('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c22('0x4'));var config=require(_0x2c22('0x5'));var attributes=require('./dashboard.attributes');module[_0x2c22('0x6')]=function(_0x2f7b5c,_0xf3cee0){return _0x2f7b5c['define'](_0x2c22('0x7'),attributes,{'tableName':_0x2c22('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dd3=['rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','util','api','moment','path'];(function(_0x52e988,_0x885e2d){var _0x12ac77=function(_0x17fafe){while(--_0x17fafe){_0x52e988['push'](_0x52e988['shift']());}};_0x12ac77(++_0x885e2d);}(_0x1dd3,0x1f0));var _0x31dd=function(_0x2d16d8,_0x295ba2){_0x2d16d8=_0x2d16d8-0x0;var _0x40e2bf=_0x1dd3[_0x2d16d8];return _0x40e2bf;};'use strict';var _=require('lodash');var util=require(_0x31dd('0x0'));var logger=require('../../config/logger')(_0x31dd('0x1'));var moment=require(_0x31dd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x31dd('0x3'));var rimraf=require(_0x31dd('0x4'));var config=require('../../config/environment');var attributes=require(_0x31dd('0x5'));module[_0x31dd('0x6')]=function(_0x3f9f22,_0x38e7ab){return _0x3f9f22[_0x31dd('0x7')](_0x31dd('0x8'),attributes,{'tableName':_0x31dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 8f5ea9a..5d628e9 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 _0xad8d=['client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x285b54,_0x3850cf){var _0x5dd0de=function(_0x5f46d5){while(--_0x5f46d5){_0x285b54['push'](_0x285b54['shift']());}};_0x5dd0de(++_0x3850cf);}(_0xad8d,0x17d));var _0xdad8=function(_0x34dd23,_0x50ce42){_0x34dd23=_0x34dd23-0x0;var _0x18a648=_0xad8d[_0x34dd23];return _0x18a648;};'use strict';var _=require(_0xdad8('0x0'));var util=require(_0xdad8('0x1'));var moment=require('moment');var BPromise=require(_0xdad8('0x2'));var rs=require(_0xdad8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdad8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdad8('0x5'))(_0xdad8('0x6'));var config=require(_0xdad8('0x7'));var jayson=require(_0xdad8('0x8'));var client=jayson[_0xdad8('0x9')]['http']({'port':0x232a});config[_0xdad8('0xa')]=_['defaults'](config[_0xdad8('0xa')],{'host':_0xdad8('0xb'),'port':0x18eb});var socket=require(_0xdad8('0xc'))(new Redis(config['redis']));require(_0xdad8('0xd'))[_0xdad8('0xe')](socket);function respondWithRpcPromise(_0x200cae,_0x290021,_0x2e548f){return new BPromise(function(_0x404173,_0x4f3683){return client[_0xdad8('0xf')](_0x200cae,_0x2e548f)[_0xdad8('0x10')](function(_0x3a296d){logger[_0xdad8('0x11')]('Dashboard,\x20%s,\x20%s',_0x290021,'request\x20sent');logger['debug'](_0xdad8('0x12'),_0x290021,_0xdad8('0x13'),JSON[_0xdad8('0x14')](_0x3a296d));if(_0x3a296d[_0xdad8('0x15')]){if(_0x3a296d[_0xdad8('0x15')]['code']===0x1f4){logger[_0xdad8('0x15')](_0xdad8('0x16'),_0x290021,_0x3a296d[_0xdad8('0x15')][_0xdad8('0x17')]);return _0x4f3683(_0x3a296d[_0xdad8('0x15')]['message']);}logger[_0xdad8('0x15')]('Dashboard,\x20%s,\x20%s',_0x290021,_0x3a296d[_0xdad8('0x15')][_0xdad8('0x17')]);return _0x404173(_0x3a296d[_0xdad8('0x15')][_0xdad8('0x17')]);}else{logger[_0xdad8('0x11')](_0xdad8('0x16'),_0x290021,_0xdad8('0x13'));_0x404173(_0x3a296d[_0xdad8('0x18')][_0xdad8('0x17')]);}})[_0xdad8('0x19')](function(_0x995872){logger[_0xdad8('0x15')](_0xdad8('0x16'),_0x290021,_0x995872);_0x4f3683(_0x995872);});});} \ No newline at end of file +var _0x758c=['defaults','localhost','socket.io-emitter','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x758c,0x110));var _0xc758=function(_0x190cb9,_0x31c774){_0x190cb9=_0x190cb9-0x0;var _0x261ddb=_0x758c[_0x190cb9];return _0x261ddb;};'use strict';var _=require(_0xc758('0x0'));var util=require(_0xc758('0x1'));var moment=require(_0xc758('0x2'));var BPromise=require(_0xc758('0x3'));var rs=require(_0xc758('0x4'));var fs=require('fs');var Redis=require(_0xc758('0x5'));var db=require(_0xc758('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc758('0x7'))(_0xc758('0x8'));var config=require(_0xc758('0x9'));var jayson=require(_0xc758('0xa'));var client=jayson[_0xc758('0xb')][_0xc758('0xc')]({'port':0x232a});config[_0xc758('0xd')]=_[_0xc758('0xe')](config[_0xc758('0xd')],{'host':_0xc758('0xf'),'port':0x18eb});var socket=require(_0xc758('0x10'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x20e910,_0x883810,_0x26fe61){return new BPromise(function(_0x4e5a34,_0x47721a){return client['request'](_0x20e910,_0x26fe61)[_0xc758('0x11')](function(_0x47cb28){logger[_0xc758('0x12')](_0xc758('0x13'),_0x883810,_0xc758('0x14'));logger[_0xc758('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x883810,'request\x20sent',JSON['stringify'](_0x47cb28));if(_0x47cb28['error']){if(_0x47cb28[_0xc758('0x16')][_0xc758('0x17')]===0x1f4){logger[_0xc758('0x16')]('Dashboard,\x20%s,\x20%s',_0x883810,_0x47cb28[_0xc758('0x16')][_0xc758('0x18')]);return _0x47721a(_0x47cb28['error'][_0xc758('0x18')]);}logger[_0xc758('0x16')](_0xc758('0x13'),_0x883810,_0x47cb28[_0xc758('0x16')][_0xc758('0x18')]);return _0x4e5a34(_0x47cb28[_0xc758('0x16')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x883810,'request\x20sent');_0x4e5a34(_0x47cb28[_0xc758('0x19')][_0xc758('0x18')]);}})['catch'](function(_0x57451e){logger['error'](_0xc758('0x13'),_0x883810,_0x57451e);_0x47721a(_0x57451e);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 11acecd..09309f3 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 _0x3aff=['update','emit','length','./dashboard.events','save','remove'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x3aff,0x69));var _0xf3af=function(_0x45cfd9,_0x16cef6){_0x45cfd9=_0x45cfd9-0x0;var _0x25cd5a=_0x3aff[_0x45cfd9];return _0x25cd5a;};'use strict';var DashboardEvents=require(_0xf3af('0x0'));var events=[_0xf3af('0x1'),_0xf3af('0x2'),_0xf3af('0x3')];function createListener(_0x5e14b,_0x3204f0){return function(_0x191e84){_0x3204f0[_0xf3af('0x4')](_0x5e14b,_0x191e84);};}function removeListener(_0x330bd7,_0x38a850){return function(){DashboardEvents['removeListener'](_0x330bd7,_0x38a850);};}exports['register']=function(_0x593047){for(var _0x113b21=0x0,_0x36fbc3=events[_0xf3af('0x5')];_0x113b21<_0x36fbc3;_0x113b21++){var _0x553148=events[_0x113b21];var _0x3fcfeb=createListener('dashboard:'+_0x553148,_0x593047);DashboardEvents['on'](_0x553148,_0x3fcfeb);}}; \ No newline at end of file +var _0x69bd=['remove','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0xe7aad3,_0x215b45){var _0x305862=function(_0x4c92d9){while(--_0x4c92d9){_0xe7aad3['push'](_0xe7aad3['shift']());}};_0x305862(++_0x215b45);}(_0x69bd,0xc6));var _0xd69b=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x69bd[_0x4d613c];return _0x301fe3;};'use strict';var DashboardEvents=require(_0xd69b('0x0'));var events=[_0xd69b('0x1'),_0xd69b('0x2'),'update'];function createListener(_0x38c9bc,_0x26bd28){return function(_0x133f28){_0x26bd28[_0xd69b('0x3')](_0x38c9bc,_0x133f28);};}function removeListener(_0x5cd2a5,_0x1523a8){return function(){DashboardEvents[_0xd69b('0x4')](_0x5cd2a5,_0x1523a8);};}exports[_0xd69b('0x5')]=function(_0x111aeb){for(var _0x78f7ec=0x0,_0x48e368=events[_0xd69b('0x6')];_0x78f7ec<_0x48e368;_0x78f7ec++){var _0x143fe2=events[_0x78f7ec];var _0x160868=createListener(_0xd69b('0x7')+_0x143fe2,_0x111aeb);DashboardEvents['on'](_0x143fe2,_0x160868);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 7de9296..10f8d39 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 _0x9e30=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','clone','addItem','destroy','exports','path','connect-timeout','Router'];(function(_0x267c48,_0x142210){var _0x3003d7=function(_0x33d7c6){while(--_0x33d7c6){_0x267c48['push'](_0x267c48['shift']());}};_0x3003d7(++_0x142210);}(_0x9e30,0x1f1));var _0x09e3=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0x9e30[_0x3cd133];return _0x2512c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x09e3('0x0'));var timeout=require(_0x09e3('0x1'));var express=require('express');var router=express[_0x09e3('0x2')]();var fs_extra=require(_0x09e3('0x3'));var auth=require(_0x09e3('0x4'));var interaction=require(_0x09e3('0x5'));var config=require(_0x09e3('0x6'));var controller=require(_0x09e3('0x7'));router[_0x09e3('0x8')]('/',auth[_0x09e3('0x9')](),controller[_0x09e3('0xa')]);router[_0x09e3('0x8')](_0x09e3('0xb'),auth[_0x09e3('0x9')](),controller[_0x09e3('0xc')]);router[_0x09e3('0x8')](_0x09e3('0xd'),auth[_0x09e3('0x9')](),controller['getItems']);router[_0x09e3('0xe')]('/',auth['isAuthenticated'](),controller[_0x09e3('0xf')]);router[_0x09e3('0xe')]('/:id/clone',auth[_0x09e3('0x9')](),controller[_0x09e3('0x10')]);router[_0x09e3('0xe')]('/:id/items',auth['isAuthenticated'](),controller[_0x09e3('0x11')]);router['put'](_0x09e3('0xb'),auth[_0x09e3('0x9')](),controller['update']);router['delete'](_0x09e3('0xb'),auth['isAuthenticated'](),controller[_0x09e3('0x12')]);module[_0x09e3('0x13')]=router; \ No newline at end of file +var _0xd128=['/:id','show','get','post','/:id/items','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0xd128,0x1d4));var _0x8d12=function(_0x3095c7,_0x46cc67){_0x3095c7=_0x3095c7-0x0;var _0x2d0f0c=_0xd128[_0x3095c7];return _0x2d0f0c;};'use strict';var multer=require(_0x8d12('0x0'));var util=require('util');var path=require(_0x8d12('0x1'));var timeout=require(_0x8d12('0x2'));var express=require(_0x8d12('0x3'));var router=express[_0x8d12('0x4')]();var fs_extra=require(_0x8d12('0x5'));var auth=require(_0x8d12('0x6'));var interaction=require(_0x8d12('0x7'));var config=require(_0x8d12('0x8'));var controller=require(_0x8d12('0x9'));router['get']('/',auth[_0x8d12('0xa')](),controller[_0x8d12('0xb')]);router['get'](_0x8d12('0xc'),auth[_0x8d12('0xa')](),controller[_0x8d12('0xd')]);router[_0x8d12('0xe')]('/:id/items',auth[_0x8d12('0xa')](),controller['getItems']);router[_0x8d12('0xf')]('/',auth[_0x8d12('0xa')](),controller['create']);router[_0x8d12('0xf')]('/:id/clone',auth[_0x8d12('0xa')](),controller['clone']);router[_0x8d12('0xf')](_0x8d12('0x10'),auth[_0x8d12('0xa')](),controller['addItem']);router[_0x8d12('0x11')](_0x8d12('0xc'),auth[_0x8d12('0xa')](),controller[_0x8d12('0x12')]);router['delete'](_0x8d12('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8d12('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f19e580..d11a246 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 _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0xdd2e33,_0x50fa29){var _0x84c0fb=function(_0x4b1b5d){while(--_0x4b1b5d){_0xdd2e33['push'](_0xdd2e33['shift']());}};_0x84c0fb(++_0x50fa29);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5a6282,_0x2569d5){_0x5a6282=_0x5a6282-0x0;var _0x1dac51=_0xc6ac[_0x5a6282];return _0x1dac51;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x10bf29,_0x239c7e){_0x10bf29=_0x10bf29-0x0;var _0x38d093=_0x7a54[_0x10bf29];return _0x38d093;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 15f30d0..cf85794 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 _0x9b2c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','destroy','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3f4d53,_0x73c342){var _0x3361a4=function(_0x32c845){while(--_0x32c845){_0x3f4d53['push'](_0x3f4d53['shift']());}};_0x3361a4(++_0x73c342);}(_0x9b2c,0x189));var _0xc9b2=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0x9b2c[_0x381372];return _0x4e959a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];config[_0xc9b2('0x1a')]=_[_0xc9b2('0x1b')](config['redis'],{'host':_0xc9b2('0x1c'),'port':0x18eb});var socket=require(_0xc9b2('0x1d'))(new Redis(config[_0xc9b2('0x1a')]));require(_0xc9b2('0x1e'))['register'](socket);function respondWithStatusCode(_0x11b076,_0x3cd2a2){_0x3cd2a2=_0x3cd2a2||0xcc;return function(_0x4f2328){if(_0x4f2328){return _0x11b076[_0xc9b2('0x1f')](_0x3cd2a2);}return _0x11b076[_0xc9b2('0x20')](_0x3cd2a2)[_0xc9b2('0x21')]();};}function respondWithResult(_0x302c1a,_0x2167f5){_0x2167f5=_0x2167f5||0xc8;return function(_0x59fb0f){if(_0x59fb0f){return _0x302c1a[_0xc9b2('0x20')](_0x2167f5)[_0xc9b2('0x22')](_0x59fb0f);}};}function respondWithFilteredResult(_0xe224aa,_0x7ffe35){return function(_0x49d95a){if(_0x49d95a){var _0x10aca7=typeof _0x7ffe35[_0xc9b2('0x23')]===_0xc9b2('0x24')&&typeof _0x7ffe35[_0xc9b2('0x25')]===_0xc9b2('0x24');var _0x43fb7a=_0x49d95a[_0xc9b2('0x26')];var _0x50352c=_0x10aca7?0x0:_0x7ffe35[_0xc9b2('0x23')];var _0x58e1ba=_0x10aca7?_0x49d95a[_0xc9b2('0x26')]:_0x7ffe35[_0xc9b2('0x23')]+_0x7ffe35['limit'];var _0x18237a;if(_0x58e1ba>=_0x43fb7a){_0x58e1ba=_0x43fb7a;_0x18237a=0xc8;}else{_0x18237a=0xce;}_0xe224aa[_0xc9b2('0x20')](_0x18237a);return _0xe224aa['set'](_0xc9b2('0x27'),_0x50352c+'-'+_0x58e1ba+'/'+_0x43fb7a)['json'](_0x49d95a);}return null;};}function patchUpdates(_0x127fef){return function(_0x159f96){try{jsonpatch[_0xc9b2('0x28')](_0x159f96,_0x127fef,!![]);}catch(_0x13006d){return BPromise[_0xc9b2('0x29')](_0x13006d);}return _0x159f96[_0xc9b2('0x2a')]();};}function saveUpdates(_0x128ec5,_0x278542){return function(_0x29ecc8){if(_0x29ecc8){return _0x29ecc8[_0xc9b2('0x2b')](_0x128ec5)['then'](function(_0x15dc60){return _0x15dc60;});}return null;};}function removeEntity(_0xbb3bf9,_0x444181){return function(_0x8e5dfa){if(_0x8e5dfa){return _0x8e5dfa['destroy']()[_0xc9b2('0x2c')](function(){_0xbb3bf9['status'](0xcc)[_0xc9b2('0x21')]();});}};}function handleEntityNotFound(_0xa07875,_0x38b3ff){return function(_0x245385){if(!_0x245385){_0xa07875[_0xc9b2('0x1f')](0x194);}return _0x245385;};}function handleError(_0x3801e1,_0x35c7f5){_0x35c7f5=_0x35c7f5||0x1f4;return function(_0x3d735a){logger[_0xc9b2('0x2d')](_0x3d735a[_0xc9b2('0x2e')]);if(_0x3d735a[_0xc9b2('0x2f')]){delete _0x3d735a[_0xc9b2('0x2f')];}_0x3801e1[_0xc9b2('0x20')](_0x35c7f5)[_0xc9b2('0x30')](_0x3d735a);};}exports[_0xc9b2('0x31')]=function(_0x2eebd3,_0x5d7748){var _0x5c2277={'raw':![],'where':{'id':_0x2eebd3[_0xc9b2('0x32')]['id']}},_0x3df56f={};_0x3df56f[_0xc9b2('0x33')]=_['keys'](db[_0xc9b2('0x34')]['rawAttributes']);_0x3df56f[_0xc9b2('0x35')]=_[_0xc9b2('0x36')](_0x2eebd3[_0xc9b2('0x35')]);_0x3df56f[_0xc9b2('0x37')]=_[_0xc9b2('0x38')](_0x3df56f[_0xc9b2('0x33')],_0x3df56f[_0xc9b2('0x35')]);_0x5c2277[_0xc9b2('0x39')]=_['intersection'](_0x3df56f[_0xc9b2('0x33')],qs[_0xc9b2('0x3a')](_0x2eebd3[_0xc9b2('0x35')][_0xc9b2('0x3a')]));_0x5c2277['attributes']=_0x5c2277['attributes'][_0xc9b2('0x3b')]?_0x5c2277[_0xc9b2('0x39')]:_0x3df56f['model'];if(_0x2eebd3['query'][_0xc9b2('0x3c')]){_0x5c2277['include']=[{'all':!![]}];}_0x5c2277=_[_0xc9b2('0x3d')]({},_0x5c2277,_0x2eebd3[_0xc9b2('0x3e')]);return db['DashboardItem'][_0xc9b2('0x3f')](_0x5c2277)[_0xc9b2('0x2c')](handleEntityNotFound(_0x5d7748,null))[_0xc9b2('0x2c')](respondWithResult(_0x5d7748,null))['catch'](handleError(_0x5d7748,null));};exports[_0xc9b2('0x40')]=function(_0xd8ee42,_0x9d888){return db['DashboardItem']['find']({'where':{'id':_0xd8ee42[_0xc9b2('0x32')]['id']}})['then'](handleEntityNotFound(_0x9d888,null))[_0xc9b2('0x2c')](removeEntity(_0x9d888,null))[_0xc9b2('0x41')](handleError(_0x9d888,null));};function widgetAttributes(_0x5b08a5){try{switch(_0x5b08a5[_0xc9b2('0x42')]){case _0xc9b2('0x43'):return[{'name':_0xc9b2('0x44'),'value':_0x5b08a5['attrUrl']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0][_0xc9b2('0x46')]:undefined)||_0xc9b2('0x47')}];case'custom':return[{'name':_0xc9b2('0x48'),'value':_0x5b08a5[_0xc9b2('0x48')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0][_0xc9b2('0x46')]:undefined)||''}];case _0xc9b2('0x49'):return[{'name':_0xc9b2('0x4a'),'value':_0x5b08a5[_0xc9b2('0x4a')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0][_0xc9b2('0x46')]:undefined)||_0xc9b2('0x4b')},{'name':'attrTimezone','value':_0x5b08a5[_0xc9b2('0x4c')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x1]?_0x5b08a5[_0xc9b2('0x45')][0x1]['value']:undefined)||_0xc9b2('0x4d')},{'name':_0xc9b2('0x4e'),'value':_0x5b08a5['attrFontSize']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x2]?_0x5b08a5['attrs'][0x2][_0xc9b2('0x46')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5b08a5[_0xc9b2('0x4f')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0][_0xc9b2('0x46')]:undefined)||_0xc9b2('0x50')},{'name':_0xc9b2('0x51'),'value':_0x5b08a5[_0xc9b2('0x51')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x1]?_0x5b08a5[_0xc9b2('0x45')][0x1][_0xc9b2('0x46')]:undefined)||[]},{'name':_0xc9b2('0x4e'),'value':_0x5b08a5[_0xc9b2('0x4e')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x2]?_0x5b08a5[_0xc9b2('0x45')][0x2]['value']:undefined)||0x14},{'name':_0xc9b2('0x52'),'value':_0x5b08a5['attrChannel']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x3]?_0x5b08a5['attrs'][0x3][_0xc9b2('0x46')]:undefined)||'voice'},{'name':_0xc9b2('0x53'),'value':_0x5b08a5[_0xc9b2('0x53')]||(_0x5b08a5['attrs']&&_0x5b08a5[_0xc9b2('0x45')][0x4]?_0x5b08a5['attrs'][0x4][_0xc9b2('0x46')]:undefined)||''},{'name':_0xc9b2('0x54'),'value':_0x5b08a5['attrFaxAccounts']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x5]?_0x5b08a5[_0xc9b2('0x45')][0x5][_0xc9b2('0x46')]:undefined)||''},{'name':_0xc9b2('0x55'),'value':_0x5b08a5[_0xc9b2('0x55')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x6]?_0x5b08a5['attrs'][0x6][_0xc9b2('0x46')]:undefined)||''},{'name':_0xc9b2('0x56'),'value':_0x5b08a5['attrOpenchannelAccounts']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x7]?_0x5b08a5[_0xc9b2('0x45')][0x7][_0xc9b2('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5b08a5[_0xc9b2('0x57')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x8]?_0x5b08a5[_0xc9b2('0x45')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x5b08a5[_0xc9b2('0x58')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x9]?_0x5b08a5['attrs'][0x9][_0xc9b2('0x46')]:undefined)||''}];case _0xc9b2('0x59'):case _0xc9b2('0x5a'):return[{'name':_0xc9b2('0x5b'),'value':_0x5b08a5[_0xc9b2('0x5b')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0][_0xc9b2('0x46')]:undefined)||_0xc9b2('0x50')},{'name':_0xc9b2('0x5c'),'value':_0x5b08a5[_0xc9b2('0x5c')]||(_0x5b08a5['attrs']&&_0x5b08a5[_0xc9b2('0x45')][0x1]?_0x5b08a5[_0xc9b2('0x45')][0x1][_0xc9b2('0x46')]:undefined)||null},{'name':'attrSerie3','value':_0x5b08a5[_0xc9b2('0x5d')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x2]?_0x5b08a5[_0xc9b2('0x45')][0x2][_0xc9b2('0x46')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5b08a5[_0xc9b2('0x51')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x3]?_0x5b08a5['attrs'][0x3][_0xc9b2('0x46')]:undefined)||[]},{'name':_0xc9b2('0x52'),'value':_0x5b08a5[_0xc9b2('0x52')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x4]?_0x5b08a5['attrs'][0x4][_0xc9b2('0x46')]:undefined)||_0xc9b2('0x5e')},{'name':_0xc9b2('0x53'),'value':_0x5b08a5[_0xc9b2('0x53')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x5]?_0x5b08a5[_0xc9b2('0x45')][0x5]['value']:undefined)||''},{'name':_0xc9b2('0x54'),'value':_0x5b08a5[_0xc9b2('0x54')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x6]?_0x5b08a5[_0xc9b2('0x45')][0x6][_0xc9b2('0x46')]:undefined)||''},{'name':_0xc9b2('0x55'),'value':_0x5b08a5[_0xc9b2('0x55')]||(_0x5b08a5['attrs']&&_0x5b08a5[_0xc9b2('0x45')][0x7]?_0x5b08a5[_0xc9b2('0x45')][0x7][_0xc9b2('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5b08a5[_0xc9b2('0x56')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x8]?_0x5b08a5[_0xc9b2('0x45')][0x8][_0xc9b2('0x46')]:undefined)||''},{'name':_0xc9b2('0x57'),'value':_0x5b08a5['attrWhatsappAccounts']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x9]?_0x5b08a5[_0xc9b2('0x45')][0x9][_0xc9b2('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5b08a5[_0xc9b2('0x58')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0xa]?_0x5b08a5[_0xc9b2('0x45')][0xa][_0xc9b2('0x46')]:undefined)||''}];case _0xc9b2('0x5f'):return[{'name':_0xc9b2('0x60'),'type':_0x5b08a5[_0xc9b2('0x61')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x0]?_0x5b08a5['attrs'][0x0][_0xc9b2('0x42')]:undefined)||null,'value':_0x5b08a5['attrReport']||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5[_0xc9b2('0x45')][0x0]?_0x5b08a5[_0xc9b2('0x45')][0x0]['value']:undefined)||null},{'name':_0xc9b2('0x62'),'value':_0x5b08a5[_0xc9b2('0x62')]||(_0x5b08a5[_0xc9b2('0x45')]&&_0x5b08a5['attrs'][0x1]?_0x5b08a5['attrs'][0x1][_0xc9b2('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x4c234a){logger[_0xc9b2('0x2d')](_0xc9b2('0x63'),JSON[_0xc9b2('0x64')](_0x4c234a));return[];}}exports[_0xc9b2('0x65')]=function(_0x3b91e9,_0x4d1396){if(_0x3b91e9[_0xc9b2('0x66')]){_0x3b91e9[_0xc9b2('0x66')][_0xc9b2('0x45')]=widgetAttributes(_0x3b91e9['body']);}return db[_0xc9b2('0x34')][_0xc9b2('0x65')](_0x3b91e9['body'],{})[_0xc9b2('0x2c')](respondWithResult(_0x4d1396,0xc9))[_0xc9b2('0x41')](handleError(_0x4d1396,null));};exports['update']=function(_0x38ef12,_0x4c3c74){if(_0x38ef12['body']['id']){delete _0x38ef12[_0xc9b2('0x66')]['id'];}_0x38ef12[_0xc9b2('0x66')][_0xc9b2('0x45')]=widgetAttributes(_0x38ef12[_0xc9b2('0x66')]);return db[_0xc9b2('0x34')][_0xc9b2('0x3f')]({'where':{'id':_0x38ef12[_0xc9b2('0x32')]['id']}})[_0xc9b2('0x2c')](handleEntityNotFound(_0x4c3c74,null))[_0xc9b2('0x2c')](saveUpdates(_0x38ef12[_0xc9b2('0x66')],null))[_0xc9b2('0x2c')](respondWithResult(_0x4c3c74,null))['catch'](handleError(_0x4c3c74,null));}; \ No newline at end of file +var _0xbc48=['widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','includeAll','catch','params','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','type','attrReport','attrRefresh'];(function(_0x2ae15f,_0x3e1860){var _0x42a3d3=function(_0xcd0e60){while(--_0xcd0e60){_0x2ae15f['push'](_0x2ae15f['shift']());}};_0x42a3d3(++_0x3e1860);}(_0xbc48,0x111));var _0x8bc4=function(_0x1a0dcf,_0x35ffff){_0x1a0dcf=_0x1a0dcf-0x0;var _0x3ae17c=_0xbc48[_0x1a0dcf];return _0x3ae17c;};'use strict';var emlformat=require(_0x8bc4('0x0'));var rimraf=require(_0x8bc4('0x1'));var zipdir=require(_0x8bc4('0x2'));var jsonpatch=require(_0x8bc4('0x3'));var rp=require('request-promise');var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var Mustache=require(_0x8bc4('0x6'));var util=require(_0x8bc4('0x7'));var path=require('path');var sox=require(_0x8bc4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bc4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8bc4('0xb'));var querystring=require(_0x8bc4('0xc'));var Papa=require(_0x8bc4('0xd'));var Redis=require(_0x8bc4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bc4('0xf'));var as=require(_0x8bc4('0x10'));var hardwareService=require(_0x8bc4('0x11'));var logger=require(_0x8bc4('0x12'))(_0x8bc4('0x13'));var utils=require(_0x8bc4('0x14'));var config=require(_0x8bc4('0x15'));var licenseUtil=require(_0x8bc4('0x16'));var db=require(_0x8bc4('0x17'))['db'];config[_0x8bc4('0x18')]=_[_0x8bc4('0x19')](config[_0x8bc4('0x18')],{'host':_0x8bc4('0x1a'),'port':0x18eb});var socket=require(_0x8bc4('0x1b'))(new Redis(config[_0x8bc4('0x18')]));require('./dashboardItem.socket')[_0x8bc4('0x1c')](socket);function respondWithStatusCode(_0x198f18,_0x1bffd0){_0x1bffd0=_0x1bffd0||0xcc;return function(_0xca2e4b){if(_0xca2e4b){return _0x198f18[_0x8bc4('0x1d')](_0x1bffd0);}return _0x198f18[_0x8bc4('0x1e')](_0x1bffd0)['end']();};}function respondWithResult(_0x4d2530,_0x50e59b){_0x50e59b=_0x50e59b||0xc8;return function(_0x36714f){if(_0x36714f){return _0x4d2530['status'](_0x50e59b)[_0x8bc4('0x1f')](_0x36714f);}};}function respondWithFilteredResult(_0x45244b,_0xbd600f){return function(_0x5982e6){if(_0x5982e6){var _0x13348c=typeof _0xbd600f[_0x8bc4('0x20')]==='undefined'&&typeof _0xbd600f[_0x8bc4('0x21')]==='undefined';var _0x659ae3=_0x5982e6['count'];var _0x5c3835=_0x13348c?0x0:_0xbd600f[_0x8bc4('0x20')];var _0x2602c6=_0x13348c?_0x5982e6[_0x8bc4('0x22')]:_0xbd600f[_0x8bc4('0x20')]+_0xbd600f[_0x8bc4('0x21')];var _0xf0a578;if(_0x2602c6>=_0x659ae3){_0x2602c6=_0x659ae3;_0xf0a578=0xc8;}else{_0xf0a578=0xce;}_0x45244b[_0x8bc4('0x1e')](_0xf0a578);return _0x45244b[_0x8bc4('0x23')](_0x8bc4('0x24'),_0x5c3835+'-'+_0x2602c6+'/'+_0x659ae3)[_0x8bc4('0x1f')](_0x5982e6);}return null;};}function patchUpdates(_0x148fda){return function(_0x4fd827){try{jsonpatch[_0x8bc4('0x25')](_0x4fd827,_0x148fda,!![]);}catch(_0x33f5b1){return BPromise[_0x8bc4('0x26')](_0x33f5b1);}return _0x4fd827['save']();};}function saveUpdates(_0x327e90,_0x247eb8){return function(_0x53aa1b){if(_0x53aa1b){return _0x53aa1b[_0x8bc4('0x27')](_0x327e90)[_0x8bc4('0x28')](function(_0x45118c){return _0x45118c;});}return null;};}function removeEntity(_0x4cb042,_0x324e59){return function(_0x5e80f7){if(_0x5e80f7){return _0x5e80f7['destroy']()[_0x8bc4('0x28')](function(){_0x4cb042[_0x8bc4('0x1e')](0xcc)[_0x8bc4('0x29')]();});}};}function handleEntityNotFound(_0x33a829,_0x16c2a8){return function(_0x14c7ec){if(!_0x14c7ec){_0x33a829[_0x8bc4('0x1d')](0x194);}return _0x14c7ec;};}function handleError(_0x30f783,_0x4a32a7){_0x4a32a7=_0x4a32a7||0x1f4;return function(_0x56f462){logger[_0x8bc4('0x2a')](_0x56f462[_0x8bc4('0x2b')]);if(_0x56f462[_0x8bc4('0x2c')]){delete _0x56f462[_0x8bc4('0x2c')];}_0x30f783[_0x8bc4('0x1e')](_0x4a32a7)[_0x8bc4('0x2d')](_0x56f462);};}exports['show']=function(_0xf57c8a,_0x88f990){var _0xb006b8={'raw':![],'where':{'id':_0xf57c8a['params']['id']}},_0x26452e={};_0x26452e[_0x8bc4('0x2e')]=_[_0x8bc4('0x2f')](db[_0x8bc4('0x30')][_0x8bc4('0x31')]);_0x26452e[_0x8bc4('0x32')]=_['keys'](_0xf57c8a[_0x8bc4('0x32')]);_0x26452e['filters']=_[_0x8bc4('0x33')](_0x26452e[_0x8bc4('0x2e')],_0x26452e[_0x8bc4('0x32')]);_0xb006b8[_0x8bc4('0x34')]=_['intersection'](_0x26452e['model'],qs[_0x8bc4('0x35')](_0xf57c8a[_0x8bc4('0x32')][_0x8bc4('0x35')]));_0xb006b8[_0x8bc4('0x34')]=_0xb006b8['attributes']['length']?_0xb006b8['attributes']:_0x26452e[_0x8bc4('0x2e')];if(_0xf57c8a[_0x8bc4('0x32')][_0x8bc4('0x36')]){_0xb006b8['include']=[{'all':!![]}];}_0xb006b8=_['merge']({},_0xb006b8,_0xf57c8a['options']);return db['DashboardItem']['find'](_0xb006b8)[_0x8bc4('0x28')](handleEntityNotFound(_0x88f990,null))[_0x8bc4('0x28')](respondWithResult(_0x88f990,null))[_0x8bc4('0x37')](handleError(_0x88f990,null));};exports['destroy']=function(_0x37885c,_0x208835){return db[_0x8bc4('0x30')]['find']({'where':{'id':_0x37885c[_0x8bc4('0x38')]['id']}})[_0x8bc4('0x28')](handleEntityNotFound(_0x208835,null))[_0x8bc4('0x28')](removeEntity(_0x208835,null))[_0x8bc4('0x37')](handleError(_0x208835,null));};function widgetAttributes(_0x409989){try{switch(_0x409989['type']){case _0x8bc4('0x39'):return[{'name':_0x8bc4('0x3a'),'value':_0x409989[_0x8bc4('0x3a')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x3c')]:undefined)||_0x8bc4('0x3d')}];case _0x8bc4('0x3e'):return[{'name':_0x8bc4('0x3f'),'value':_0x409989[_0x8bc4('0x3f')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x3c')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x409989[_0x8bc4('0x40')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989['attrs'][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x3c')]:undefined)||_0x8bc4('0x41')},{'name':'attrTimezone','value':_0x409989['attrTimezone']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x1]?_0x409989[_0x8bc4('0x3b')][0x1][_0x8bc4('0x3c')]:undefined)||_0x8bc4('0x42')},{'name':_0x8bc4('0x43'),'value':_0x409989[_0x8bc4('0x43')]||(_0x409989['attrs']&&_0x409989['attrs'][0x2]?_0x409989[_0x8bc4('0x3b')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x8bc4('0x44'),'value':_0x409989[_0x8bc4('0x44')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x3c')]:undefined)||'total'},{'name':_0x8bc4('0x45'),'value':_0x409989[_0x8bc4('0x45')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x1]?_0x409989['attrs'][0x1][_0x8bc4('0x3c')]:undefined)||[]},{'name':'attrFontSize','value':_0x409989[_0x8bc4('0x43')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x2]?_0x409989['attrs'][0x2][_0x8bc4('0x3c')]:undefined)||0x14},{'name':_0x8bc4('0x46'),'value':_0x409989[_0x8bc4('0x46')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989['attrs'][0x3]?_0x409989['attrs'][0x3][_0x8bc4('0x3c')]:undefined)||_0x8bc4('0x47')},{'name':_0x8bc4('0x48'),'value':_0x409989['attrEmailAccounts']||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x4]?_0x409989['attrs'][0x4][_0x8bc4('0x3c')]:undefined)||''},{'name':_0x8bc4('0x49'),'value':_0x409989[_0x8bc4('0x49')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x5]?_0x409989[_0x8bc4('0x3b')][0x5][_0x8bc4('0x3c')]:undefined)||''},{'name':_0x8bc4('0x4a'),'value':_0x409989[_0x8bc4('0x4a')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x6]?_0x409989[_0x8bc4('0x3b')][0x6][_0x8bc4('0x3c')]:undefined)||''},{'name':_0x8bc4('0x4b'),'value':_0x409989[_0x8bc4('0x4b')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989['attrs'][0x7]?_0x409989[_0x8bc4('0x3b')][0x7][_0x8bc4('0x3c')]:undefined)||''},{'name':_0x8bc4('0x4c'),'value':_0x409989[_0x8bc4('0x4c')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x8]?_0x409989[_0x8bc4('0x3b')][0x8][_0x8bc4('0x3c')]:undefined)||''},{'name':'attrChatWebsites','value':_0x409989[_0x8bc4('0x4d')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x9]?_0x409989[_0x8bc4('0x3b')][0x9]['value']:undefined)||''}];case _0x8bc4('0x4e'):case'pie-chart':return[{'name':_0x8bc4('0x4f'),'value':_0x409989['attrSerie1']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x0]?_0x409989[_0x8bc4('0x3b')][0x0]['value']:undefined)||_0x8bc4('0x50')},{'name':_0x8bc4('0x51'),'value':_0x409989['attrSerie2']||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x1]?_0x409989['attrs'][0x1][_0x8bc4('0x3c')]:undefined)||null},{'name':_0x8bc4('0x52'),'value':_0x409989[_0x8bc4('0x52')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x2]?_0x409989['attrs'][0x2][_0x8bc4('0x3c')]:undefined)||null},{'name':_0x8bc4('0x45'),'value':_0x409989[_0x8bc4('0x45')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x3]?_0x409989[_0x8bc4('0x3b')][0x3]['value']:undefined)||[]},{'name':_0x8bc4('0x46'),'value':_0x409989['attrChannel']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x4]?_0x409989[_0x8bc4('0x3b')][0x4][_0x8bc4('0x3c')]:undefined)||_0x8bc4('0x47')},{'name':'attrEmailAccounts','value':_0x409989[_0x8bc4('0x48')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x5]?_0x409989['attrs'][0x5][_0x8bc4('0x3c')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x409989[_0x8bc4('0x49')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x6]?_0x409989['attrs'][0x6]['value']:undefined)||''},{'name':_0x8bc4('0x4a'),'value':_0x409989[_0x8bc4('0x4a')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x7]?_0x409989[_0x8bc4('0x3b')][0x7][_0x8bc4('0x3c')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x409989[_0x8bc4('0x4b')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x8]?_0x409989[_0x8bc4('0x3b')][0x8][_0x8bc4('0x3c')]:undefined)||''},{'name':_0x8bc4('0x4c'),'value':_0x409989[_0x8bc4('0x4c')]||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x9]?_0x409989[_0x8bc4('0x3b')][0x9]['value']:undefined)||''},{'name':_0x8bc4('0x4d'),'value':_0x409989['attrChatWebsites']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0xa]?_0x409989[_0x8bc4('0x3b')][0xa][_0x8bc4('0x3c')]:undefined)||''}];case _0x8bc4('0x53'):return[{'name':'attrReport','type':_0x409989['reportType']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989['attrs'][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x54')]:undefined)||null,'value':_0x409989[_0x8bc4('0x55')]||(_0x409989['attrs']&&_0x409989[_0x8bc4('0x3b')][0x0]?_0x409989[_0x8bc4('0x3b')][0x0][_0x8bc4('0x3c')]:undefined)||null},{'name':_0x8bc4('0x56'),'value':_0x409989['attrRefresh']||(_0x409989[_0x8bc4('0x3b')]&&_0x409989[_0x8bc4('0x3b')][0x1]?_0x409989['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x122cde){logger[_0x8bc4('0x2a')](_0x8bc4('0x57'),JSON['stringify'](_0x122cde));return[];}}exports[_0x8bc4('0x58')]=function(_0x51b583,_0x4c0d0a){if(_0x51b583[_0x8bc4('0x59')]){_0x51b583[_0x8bc4('0x59')][_0x8bc4('0x3b')]=widgetAttributes(_0x51b583[_0x8bc4('0x59')]);}return db['DashboardItem'][_0x8bc4('0x58')](_0x51b583['body'],{})[_0x8bc4('0x28')](respondWithResult(_0x4c0d0a,0xc9))[_0x8bc4('0x37')](handleError(_0x4c0d0a,null));};exports[_0x8bc4('0x27')]=function(_0x9d2a88,_0x2fa108){if(_0x9d2a88['body']['id']){delete _0x9d2a88[_0x8bc4('0x59')]['id'];}_0x9d2a88['body']['attrs']=widgetAttributes(_0x9d2a88[_0x8bc4('0x59')]);return db['DashboardItem']['find']({'where':{'id':_0x9d2a88[_0x8bc4('0x38')]['id']}})[_0x8bc4('0x28')](handleEntityNotFound(_0x2fa108,null))[_0x8bc4('0x28')](saveUpdates(_0x9d2a88[_0x8bc4('0x59')],null))[_0x8bc4('0x28')](respondWithResult(_0x2fa108,null))[_0x8bc4('0x37')](handleError(_0x2fa108,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7ad03f7..dc88849 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 _0x9e05=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3b7b8d,_0x33a4e6){var _0x232a6a=function(_0x28fde2){while(--_0x28fde2){_0x3b7b8d['push'](_0x3b7b8d['shift']());}};_0x232a6a(++_0x33a4e6);}(_0x9e05,0x123));var _0x59e0=function(_0x8d5fe5,_0x31e122){_0x8d5fe5=_0x8d5fe5-0x0;var _0x2d2549=_0x9e05[_0x8d5fe5];return _0x2d2549;};'use strict';var EventEmitter=require(_0x59e0('0x0'));var DashboardItem=require(_0x59e0('0x1'))['db'][_0x59e0('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x59e0('0x3')](0x0);var events={'afterCreate':_0x59e0('0x4'),'afterUpdate':_0x59e0('0x5'),'afterDestroy':_0x59e0('0x6')};function emitEvent(_0x3a29e5){return function(_0x110cc2,_0x2ed02d,_0x23a289){DashboardItemEvents[_0x59e0('0x7')](_0x3a29e5+':'+_0x110cc2['id'],_0x110cc2);DashboardItemEvents[_0x59e0('0x7')](_0x3a29e5,_0x110cc2);_0x23a289(null);};}for(var e in events){if(events[_0x59e0('0x8')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x59e0('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x4cb5=['../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x342ede,_0x1adff1){var _0x2d9b76=function(_0x3b8071){while(--_0x3b8071){_0x342ede['push'](_0x342ede['shift']());}};_0x2d9b76(++_0x1adff1);}(_0x4cb5,0x8f));var _0x54cb=function(_0x2591bc,_0x116bfe){_0x2591bc=_0x2591bc-0x0;var _0x163fc4=_0x4cb5[_0x2591bc];return _0x163fc4;};'use strict';var EventEmitter=require(_0x54cb('0x0'));var DashboardItem=require(_0x54cb('0x1'))['db'][_0x54cb('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x54cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54cb('0x4'),'afterDestroy':_0x54cb('0x5')};function emitEvent(_0x240a36){return function(_0xe3fc36,_0x297dd8,_0xf3461f){DashboardItemEvents[_0x54cb('0x6')](_0x240a36+':'+_0xe3fc36['id'],_0xe3fc36);DashboardItemEvents['emit'](_0x240a36,_0xe3fc36);_0xf3461f(null);};}for(var e in events){if(events[_0x54cb('0x7')](e)){var event=events[e];DashboardItem[_0x54cb('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index a9fb854..ee625f3 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 _0x76b9=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','util','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x76b9,0x12f));var _0x976b=function(_0x2e7548,_0x2c9ec9){_0x2e7548=_0x2e7548-0x0;var _0x17adad=_0x76b9[_0x2e7548];return _0x17adad;};'use strict';var _=require('lodash');var util=require(_0x976b('0x0'));var logger=require(_0x976b('0x1'))(_0x976b('0x2'));var moment=require(_0x976b('0x3'));var BPromise=require(_0x976b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x976b('0x5'));var rimraf=require(_0x976b('0x6'));var config=require(_0x976b('0x7'));var attributes=require(_0x976b('0x8'));module[_0x976b('0x9')]=function(_0x578501,_0x1ecf07){return _0x578501['define'](_0x976b('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb42c=['moment','bluebird','request-promise','rimraf','exports','define','dashboard_items','lodash','util','api'];(function(_0x7cf586,_0xd0ff06){var _0x3c38a4=function(_0x509822){while(--_0x509822){_0x7cf586['push'](_0x7cf586['shift']());}};_0x3c38a4(++_0xd0ff06);}(_0xb42c,0x165));var _0xcb42=function(_0x4116d6,_0x7e8946){_0x4116d6=_0x4116d6-0x0;var _0x25d90d=_0xb42c[_0x4116d6];return _0x25d90d;};'use strict';var _=require(_0xcb42('0x0'));var util=require(_0xcb42('0x1'));var logger=require('../../config/logger')(_0xcb42('0x2'));var moment=require(_0xcb42('0x3'));var BPromise=require(_0xcb42('0x4'));var rp=require(_0xcb42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb42('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xcb42('0x7')]=function(_0x4f20d7,_0x3ddd69){return _0x4f20d7[_0xcb42('0x8')]('DashboardItem',attributes,{'tableName':_0xcb42('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index d891d3a..783d64b 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 _0xb368=['defaults','redis','localhost','./dashboardItem.socket','register','request','info','request\x20sent','debug','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x30a335,_0x5d0d98){var _0x35e0c1=function(_0x31e041){while(--_0x31e041){_0x30a335['push'](_0x30a335['shift']());}};_0x35e0c1(++_0x5d0d98);}(_0xb368,0x77));var _0x8b36=function(_0x2aeb72,_0x4f43eb){_0x2aeb72=_0x2aeb72-0x0;var _0x5e09a8=_0xb368[_0x2aeb72];return _0x5e09a8;};'use strict';var _=require('lodash');var util=require(_0x8b36('0x0'));var moment=require('moment');var BPromise=require(_0x8b36('0x1'));var rs=require(_0x8b36('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b36('0x3'))['db'];var utils=require(_0x8b36('0x4'));var logger=require(_0x8b36('0x5'))(_0x8b36('0x6'));var config=require(_0x8b36('0x7'));var jayson=require(_0x8b36('0x8'));var client=jayson[_0x8b36('0x9')][_0x8b36('0xa')]({'port':0x232a});config['redis']=_[_0x8b36('0xb')](config[_0x8b36('0xc')],{'host':_0x8b36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8b36('0xe'))[_0x8b36('0xf')](socket);function respondWithRpcPromise(_0x579e8e,_0xbde86a,_0x1407eb){return new BPromise(function(_0xf21180,_0x4019fa){return client[_0x8b36('0x10')](_0x579e8e,_0x1407eb)['then'](function(_0x53b2d0){logger[_0x8b36('0x11')]('DashboardItem,\x20%s,\x20%s',_0xbde86a,_0x8b36('0x12'));logger[_0x8b36('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xbde86a,_0x8b36('0x12'),JSON[_0x8b36('0x14')](_0x53b2d0));if(_0x53b2d0[_0x8b36('0x15')]){if(_0x53b2d0[_0x8b36('0x15')]['code']===0x1f4){logger[_0x8b36('0x15')](_0x8b36('0x16'),_0xbde86a,_0x53b2d0[_0x8b36('0x15')][_0x8b36('0x17')]);return _0x4019fa(_0x53b2d0[_0x8b36('0x15')][_0x8b36('0x17')]);}logger[_0x8b36('0x15')](_0x8b36('0x16'),_0xbde86a,_0x53b2d0['error'][_0x8b36('0x17')]);return _0xf21180(_0x53b2d0[_0x8b36('0x15')][_0x8b36('0x17')]);}else{logger[_0x8b36('0x11')](_0x8b36('0x16'),_0xbde86a,_0x8b36('0x12'));_0xf21180(_0x53b2d0[_0x8b36('0x18')][_0x8b36('0x17')]);}})[_0x8b36('0x19')](function(_0xe055cc){logger[_0x8b36('0x15')](_0x8b36('0x16'),_0xbde86a,_0xe055cc);_0x4019fa(_0xe055cc);});});} \ No newline at end of file +var _0xa437=['DashboardItem,\x20%s,\x20%s','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','register','then','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x18ea99,_0x5d0dc6){var _0x4e1a63=function(_0x560366){while(--_0x560366){_0x18ea99['push'](_0x18ea99['shift']());}};_0x4e1a63(++_0x5d0dc6);}(_0xa437,0xfe));var _0x7a43=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa437[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require('lodash');var util=require(_0x7a43('0x0'));var moment=require(_0x7a43('0x1'));var BPromise=require(_0x7a43('0x2'));var rs=require(_0x7a43('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a43('0x4'))['db'];var utils=require(_0x7a43('0x5'));var logger=require(_0x7a43('0x6'))(_0x7a43('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7a43('0x8')]=_[_0x7a43('0x9')](config[_0x7a43('0x8')],{'host':_0x7a43('0xa'),'port':0x18eb});var socket=require(_0x7a43('0xb'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x7a43('0xc')](socket);function respondWithRpcPromise(_0x417ae4,_0x2dcbe6,_0x197878){return new BPromise(function(_0x479fc1,_0x3391ae){return client['request'](_0x417ae4,_0x197878)[_0x7a43('0xd')](function(_0x4364e7){logger[_0x7a43('0xe')]('DashboardItem,\x20%s,\x20%s',_0x2dcbe6,'request\x20sent');logger[_0x7a43('0xf')](_0x7a43('0x10'),_0x2dcbe6,'request\x20sent',JSON[_0x7a43('0x11')](_0x4364e7));if(_0x4364e7[_0x7a43('0x12')]){if(_0x4364e7[_0x7a43('0x12')]['code']===0x1f4){logger[_0x7a43('0x12')]('DashboardItem,\x20%s,\x20%s',_0x2dcbe6,_0x4364e7['error'][_0x7a43('0x13')]);return _0x3391ae(_0x4364e7[_0x7a43('0x12')][_0x7a43('0x13')]);}logger[_0x7a43('0x12')]('DashboardItem,\x20%s,\x20%s',_0x2dcbe6,_0x4364e7[_0x7a43('0x12')][_0x7a43('0x13')]);return _0x479fc1(_0x4364e7['error'][_0x7a43('0x13')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x2dcbe6,'request\x20sent');_0x479fc1(_0x4364e7[_0x7a43('0x14')][_0x7a43('0x13')]);}})[_0x7a43('0x15')](function(_0x35a9bf){logger[_0x7a43('0x12')](_0x7a43('0x16'),_0x2dcbe6,_0x35a9bf);_0x3391ae(_0x35a9bf);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 42f3d36..3c307c8 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 _0x2749=['dashboardItem:','./dashboardItem.events','save','remove','emit','register','length'];(function(_0x42dcf9,_0x47dcd2){var _0x30b2be=function(_0x478521){while(--_0x478521){_0x42dcf9['push'](_0x42dcf9['shift']());}};_0x30b2be(++_0x47dcd2);}(_0x2749,0xa2));var _0x9274=function(_0x379ee5,_0x336c42){_0x379ee5=_0x379ee5-0x0;var _0x114694=_0x2749[_0x379ee5];return _0x114694;};'use strict';var DashboardItemEvents=require(_0x9274('0x0'));var events=[_0x9274('0x1'),_0x9274('0x2'),'update'];function createListener(_0x3b4067,_0x81e357){return function(_0x59237b){_0x81e357[_0x9274('0x3')](_0x3b4067,_0x59237b);};}function removeListener(_0x115c1e,_0x575dd4){return function(){DashboardItemEvents['removeListener'](_0x115c1e,_0x575dd4);};}exports[_0x9274('0x4')]=function(_0x30681f){for(var _0x5dcdce=0x0,_0x5cc7b8=events[_0x9274('0x5')];_0x5dcdce<_0x5cc7b8;_0x5dcdce++){var _0x1efd6e=events[_0x5dcdce];var _0x57f6fe=createListener(_0x9274('0x6')+_0x1efd6e,_0x30681f);DashboardItemEvents['on'](_0x1efd6e,_0x57f6fe);}}; \ No newline at end of file +var _0xfbed=['remove','update','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x3de813,_0x303da6){var _0x5954b4=function(_0x1750dc){while(--_0x1750dc){_0x3de813['push'](_0x3de813['shift']());}};_0x5954b4(++_0x303da6);}(_0xfbed,0x12e));var _0xdfbe=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xfbed[_0x8c43de];return _0xa6591b;};'use strict';var DashboardItemEvents=require(_0xdfbe('0x0'));var events=[_0xdfbe('0x1'),_0xdfbe('0x2'),_0xdfbe('0x3')];function createListener(_0x52da33,_0x34662b){return function(_0x473fd1){_0x34662b['emit'](_0x52da33,_0x473fd1);};}function removeListener(_0x55fc93,_0x4744bf){return function(){DashboardItemEvents[_0xdfbe('0x4')](_0x55fc93,_0x4744bf);};}exports[_0xdfbe('0x5')]=function(_0x560cbd){for(var _0x1a340b=0x0,_0x5aea00=events[_0xdfbe('0x6')];_0x1a340b<_0x5aea00;_0x1a340b++){var _0x2a2c3b=events[_0x1a340b];var _0x370369=createListener(_0xdfbe('0x7')+_0x2a2c3b,_0x560cbd);DashboardItemEvents['on'](_0x2a2c3b,_0x370369);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 2d179df..9f65487 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 _0xffea=['show','post','create','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2531c5,_0x26a054){var _0x2ec786=function(_0x5a9231){while(--_0x5a9231){_0x2531c5['push'](_0x2531c5['shift']());}};_0x2ec786(++_0x26a054);}(_0xffea,0x1b0));var _0xaffe=function(_0x5c99b6,_0x52e9ff){_0x5c99b6=_0x5c99b6-0x0;var _0x4ad36c=_0xffea[_0x5c99b6];return _0x4ad36c;};'use strict';var multer=require('multer');var util=require(_0xaffe('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaffe('0x1'));var router=express[_0xaffe('0x2')]();var fs_extra=require(_0xaffe('0x3'));var auth=require(_0xaffe('0x4'));var interaction=require(_0xaffe('0x5'));var config=require(_0xaffe('0x6'));var controller=require('./dashboardItem.controller');router[_0xaffe('0x7')](_0xaffe('0x8'),auth[_0xaffe('0x9')](),controller[_0xaffe('0xa')]);router[_0xaffe('0xb')]('/',auth[_0xaffe('0x9')](),controller[_0xaffe('0xc')]);router[_0xaffe('0xd')]('/:id',auth[_0xaffe('0x9')](),controller[_0xaffe('0xe')]);router[_0xaffe('0xf')](_0xaffe('0x8'),auth[_0xaffe('0x9')](),controller[_0xaffe('0x10')]);module['exports']=router; \ No newline at end of file +var _0x64bb=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','create','put','update','destroy','util','path','connect-timeout'];(function(_0x516f79,_0xed4093){var _0x4a20b9=function(_0x5e93fc){while(--_0x5e93fc){_0x516f79['push'](_0x516f79['shift']());}};_0x4a20b9(++_0xed4093);}(_0x64bb,0x89));var _0xb64b=function(_0x52858e,_0x40c1a1){_0x52858e=_0x52858e-0x0;var _0x3a3977=_0x64bb[_0x52858e];return _0x3a3977;};'use strict';var multer=require('multer');var util=require(_0xb64b('0x0'));var path=require(_0xb64b('0x1'));var timeout=require(_0xb64b('0x2'));var express=require(_0xb64b('0x3'));var router=express[_0xb64b('0x4')]();var fs_extra=require(_0xb64b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb64b('0x6'));var config=require(_0xb64b('0x7'));var controller=require('./dashboardItem.controller');router['get'](_0xb64b('0x8'),auth[_0xb64b('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb64b('0xa')]);router[_0xb64b('0xb')](_0xb64b('0x8'),auth[_0xb64b('0x9')](),controller[_0xb64b('0xc')]);router['delete'](_0xb64b('0x8'),auth[_0xb64b('0x9')](),controller[_0xb64b('0xd')]);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 470a1b9..645486f 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 _0xae11=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xae11,0x6a));var _0x1ae1=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xae11[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0x1ae1('0x0'));module[_0x1ae1('0x1')]={'name':{'type':Sequelize[_0x1ae1('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1ae1('0x3')](_0x1ae1('0x4'),_0x1ae1('0x5'),_0x1ae1('0x6')),'allowNull':![],'defaultValue':_0x1ae1('0x4')},'description':{'type':Sequelize[_0x1ae1('0x2')]}}; \ No newline at end of file +var _0xedc6=['exports','STRING','first','second','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedc6,0x1da));var _0x6edc=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xedc6[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x6edc('0x0'));module[_0x6edc('0x1')]={'name':{'type':Sequelize[_0x6edc('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x6edc('0x3'),_0x6edc('0x4'),'third'),'allowNull':![],'defaultValue':_0x6edc('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 7067dba..1ebf7f5 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 _0x3714=['mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Dispositions','stack','name','send','index','Disposition','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','merge','type','filter','options','includeAll','include','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x1fe3dd,_0xd21a25){var _0x2bd780=function(_0x146002){while(--_0x146002){_0x1fe3dd['push'](_0x1fe3dd['shift']());}};_0x2bd780(++_0xd21a25);}(_0x3714,0x95));var _0x4371=function(_0x249d23,_0x159db5){_0x249d23=_0x249d23-0x0;var _0x2bef81=_0x3714[_0x249d23];return _0x2bef81;};'use strict';var emlformat=require(_0x4371('0x0'));var rimraf=require(_0x4371('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4371('0x2'));var rp=require(_0x4371('0x3'));var moment=require(_0x4371('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4371('0x5'));var util=require(_0x4371('0x6'));var path=require(_0x4371('0x7'));var sox=require('sox');var csv=require(_0x4371('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4371('0x9'));var _=require(_0x4371('0xa'));var squel=require('squel');var crypto=require(_0x4371('0xb'));var jsforce=require(_0x4371('0xc'));var deskjs=require(_0x4371('0xd'));var toCsv=require(_0x4371('0x8'));var querystring=require('querystring');var Papa=require(_0x4371('0xe'));var Redis=require('ioredis');var authService=require(_0x4371('0xf'));var qs=require(_0x4371('0x10'));var as=require(_0x4371('0x11'));var hardwareService=require(_0x4371('0x12'));var logger=require('../../config/logger')(_0x4371('0x13'));var utils=require(_0x4371('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4371('0x15'));var db=require(_0x4371('0x16'))['db'];function respondWithStatusCode(_0x1d5806,_0x293b9c){_0x293b9c=_0x293b9c||0xcc;return function(_0x55972){if(_0x55972){return _0x1d5806[_0x4371('0x17')](_0x293b9c);}return _0x1d5806[_0x4371('0x18')](_0x293b9c)[_0x4371('0x19')]();};}function respondWithResult(_0x3decc7,_0x1d19ea){_0x1d19ea=_0x1d19ea||0xc8;return function(_0xf2c4e0){if(_0xf2c4e0){return _0x3decc7['status'](_0x1d19ea)[_0x4371('0x1a')](_0xf2c4e0);}};}function respondWithFilteredResult(_0x112f26,_0x41447c){return function(_0x482082){if(_0x482082){var _0x1adca6=typeof _0x41447c[_0x4371('0x1b')]===_0x4371('0x1c')&&typeof _0x41447c[_0x4371('0x1d')]===_0x4371('0x1c');var _0x41a55f=_0x482082[_0x4371('0x1e')];var _0x12dc62=_0x1adca6?0x0:_0x41447c[_0x4371('0x1b')];var _0x278bb3=_0x1adca6?_0x482082[_0x4371('0x1e')]:_0x41447c[_0x4371('0x1b')]+_0x41447c[_0x4371('0x1d')];var _0x5c7c42;if(_0x278bb3>=_0x41a55f){_0x278bb3=_0x41a55f;_0x5c7c42=0xc8;}else{_0x5c7c42=0xce;}_0x112f26[_0x4371('0x18')](_0x5c7c42);return _0x112f26[_0x4371('0x1f')](_0x4371('0x20'),_0x12dc62+'-'+_0x278bb3+'/'+_0x41a55f)[_0x4371('0x1a')](_0x482082);}return null;};}function patchUpdates(_0x2ad3cf){return function(_0x4c40fe){try{jsonpatch['apply'](_0x4c40fe,_0x2ad3cf,!![]);}catch(_0x596eeb){return BPromise[_0x4371('0x21')](_0x596eeb);}return _0x4c40fe['save']();};}function saveUpdates(_0x9d8623,_0x17dde7){return function(_0x3b89a8){if(_0x3b89a8){return _0x3b89a8[_0x4371('0x22')](_0x9d8623)[_0x4371('0x23')](function(_0x344a3d){return _0x344a3d;});}return null;};}function removeEntity(_0x1b245d,_0x345d87){return function(_0x3eaddc){if(_0x3eaddc){return _0x3eaddc[_0x4371('0x24')]()[_0x4371('0x23')](function(){var _0x6478bf=_0x3eaddc[_0x4371('0x25')]({'plain':!![]});var _0x3819d0=_0x4371('0x26');return db['UserProfileResource'][_0x4371('0x24')]({'where':{'type':_0x3819d0,'resourceId':_0x6478bf['id']}})['then'](function(){return _0x3eaddc;});})[_0x4371('0x23')](function(){_0x1b245d[_0x4371('0x18')](0xcc)[_0x4371('0x19')]();});}};}function handleEntityNotFound(_0x179045,_0x303fb6){return function(_0x342133){if(!_0x342133){_0x179045['sendStatus'](0x194);}return _0x342133;};}function handleError(_0x54b4ec,_0x137d76){_0x137d76=_0x137d76||0x1f4;return function(_0x2414ba){logger['error'](_0x2414ba[_0x4371('0x27')]);if(_0x2414ba[_0x4371('0x28')]){delete _0x2414ba[_0x4371('0x28')];}_0x54b4ec[_0x4371('0x18')](_0x137d76)[_0x4371('0x29')](_0x2414ba);};}exports[_0x4371('0x2a')]=function(_0x3e3839,_0x3d6d59){var _0x33700b={},_0x1e2563={},_0x41d6b7={'count':0x0,'rows':[]};var _0x85e9c7=_['map'](db[_0x4371('0x2b')][_0x4371('0x2c')],function(_0x21d5cc){return{'name':_0x21d5cc['fieldName'],'type':_0x21d5cc['type'][_0x4371('0x2d')]};});_0x1e2563['model']=_[_0x4371('0x2e')](_0x85e9c7,_0x4371('0x28'));_0x1e2563[_0x4371('0x2f')]=_[_0x4371('0x30')](_0x3e3839[_0x4371('0x2f')]);_0x1e2563[_0x4371('0x31')]=_[_0x4371('0x32')](_0x1e2563[_0x4371('0x33')],_0x1e2563['query']);_0x33700b[_0x4371('0x34')]=_[_0x4371('0x32')](_0x1e2563[_0x4371('0x33')],qs[_0x4371('0x35')](_0x3e3839['query'][_0x4371('0x35')]));_0x33700b['attributes']=_0x33700b[_0x4371('0x34')][_0x4371('0x36')]?_0x33700b[_0x4371('0x34')]:_0x1e2563['model'];if(!_0x3e3839[_0x4371('0x2f')]['hasOwnProperty']('nolimit')){_0x33700b['limit']=qs[_0x4371('0x1d')](_0x3e3839[_0x4371('0x2f')]['limit']);_0x33700b[_0x4371('0x1b')]=qs[_0x4371('0x1b')](_0x3e3839['query'][_0x4371('0x1b')]);}_0x33700b['order']=qs[_0x4371('0x37')](_0x3e3839[_0x4371('0x2f')]['sort']);_0x33700b[_0x4371('0x38')]=qs[_0x4371('0x31')](_[_0x4371('0x39')](_0x3e3839[_0x4371('0x2f')],_0x1e2563[_0x4371('0x31')]),_0x85e9c7);if(_0x3e3839[_0x4371('0x2f')]['filter']){_0x33700b[_0x4371('0x38')]=_[_0x4371('0x3a')](_0x33700b[_0x4371('0x38')],{'$or':_[_0x4371('0x2e')](_0x85e9c7,function(_0x231b55){if(_0x231b55[_0x4371('0x3b')]!=='VIRTUAL'){var _0x4664e9={};_0x4664e9[_0x231b55[_0x4371('0x28')]]={'$like':'%'+_0x3e3839[_0x4371('0x2f')][_0x4371('0x3c')]+'%'};return _0x4664e9;}})});}_0x33700b=_[_0x4371('0x3a')]({},_0x33700b,_0x3e3839[_0x4371('0x3d')]);var _0x387117={'where':_0x33700b[_0x4371('0x38')]};return db[_0x4371('0x2b')][_0x4371('0x1e')](_0x387117)[_0x4371('0x23')](function(_0x33c64b){_0x41d6b7['count']=_0x33c64b;if(_0x3e3839[_0x4371('0x2f')][_0x4371('0x3e')]){_0x33700b[_0x4371('0x3f')]=[{'all':!![]}];}return db[_0x4371('0x2b')]['findAll'](_0x33700b);})[_0x4371('0x23')](function(_0x176daf){_0x41d6b7[_0x4371('0x40')]=_0x176daf;return _0x41d6b7;})[_0x4371('0x23')](respondWithFilteredResult(_0x3d6d59,_0x33700b))[_0x4371('0x41')](handleError(_0x3d6d59,null));};exports[_0x4371('0x42')]=function(_0x123908,_0x5e22f3){var _0x33c45d={'raw':!![],'where':{'id':_0x123908[_0x4371('0x43')]['id']}},_0xa0399e={};_0xa0399e[_0x4371('0x33')]=_[_0x4371('0x30')](db['Disposition'][_0x4371('0x2c')]);_0xa0399e[_0x4371('0x2f')]=_[_0x4371('0x30')](_0x123908[_0x4371('0x2f')]);_0xa0399e[_0x4371('0x31')]=_[_0x4371('0x32')](_0xa0399e['model'],_0xa0399e[_0x4371('0x2f')]);_0x33c45d[_0x4371('0x34')]=_['intersection'](_0xa0399e[_0x4371('0x33')],qs[_0x4371('0x35')](_0x123908[_0x4371('0x2f')][_0x4371('0x35')]));_0x33c45d[_0x4371('0x34')]=_0x33c45d['attributes'][_0x4371('0x36')]?_0x33c45d[_0x4371('0x34')]:_0xa0399e[_0x4371('0x33')];if(_0x123908[_0x4371('0x2f')][_0x4371('0x3e')]){_0x33c45d['include']=[{'all':!![]}];}_0x33c45d=_[_0x4371('0x3a')]({},_0x33c45d,_0x123908[_0x4371('0x3d')]);return db['Disposition'][_0x4371('0x44')](_0x33c45d)[_0x4371('0x23')](handleEntityNotFound(_0x5e22f3,null))['then'](respondWithResult(_0x5e22f3,null))[_0x4371('0x41')](handleError(_0x5e22f3,null));};exports[_0x4371('0x45')]=function(_0x4868e5,_0x10f8eb){return db[_0x4371('0x2b')][_0x4371('0x45')](_0x4868e5[_0x4371('0x46')],{})[_0x4371('0x23')](function(_0x49976a){var _0x13d8d9=_0x4868e5['user'][_0x4371('0x25')]({'plain':!![]});if(!_0x13d8d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d8d9[_0x4371('0x47')]===_0x4371('0x48')){var _0x5922dc=_0x49976a[_0x4371('0x25')]({'plain':!![]});var _0x3d9b7c=_0x4371('0x26');return db[_0x4371('0x49')][_0x4371('0x44')]({'where':{'name':_0x3d9b7c,'userProfileId':_0x13d8d9[_0x4371('0x4a')]},'raw':!![]})['then'](function(_0x220f77){if(_0x220f77&&_0x220f77['autoAssociation']===0x0){return db[_0x4371('0x4b')][_0x4371('0x45')]({'name':_0x5922dc[_0x4371('0x28')],'resourceId':_0x5922dc['id'],'type':_0x220f77['name'],'sectionId':_0x220f77['id']},{})['then'](function(){return _0x49976a;});}else{return _0x49976a;}})[_0x4371('0x41')](function(_0xa8f474){logger['error'](_0x4371('0x4c'),_0xa8f474);throw _0xa8f474;});}return _0x49976a;})[_0x4371('0x23')](respondWithResult(_0x10f8eb,0xc9))[_0x4371('0x41')](handleError(_0x10f8eb,null));};exports[_0x4371('0x22')]=function(_0x4ca579,_0x193409){if(_0x4ca579[_0x4371('0x46')]['id']){delete _0x4ca579[_0x4371('0x46')]['id'];}return db[_0x4371('0x2b')][_0x4371('0x44')]({'where':{'id':_0x4ca579[_0x4371('0x43')]['id']}})['then'](handleEntityNotFound(_0x193409,null))['then'](saveUpdates(_0x4ca579[_0x4371('0x46')],null))['then'](respondWithResult(_0x193409,null))['catch'](handleError(_0x193409,null));};exports[_0x4371('0x24')]=function(_0x417ae7,_0x454b17){return db['Disposition'][_0x4371('0x44')]({'where':{'id':_0x417ae7['params']['id']}})[_0x4371('0x23')](handleEntityNotFound(_0x454b17,null))[_0x4371('0x23')](removeEntity(_0x454b17,null))[_0x4371('0x41')](handleError(_0x454b17,null));}; \ No newline at end of file +var _0x5186=['destroy','get','end','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','filter','merge','options','findAll','rows','catch','show','params','keys','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','set','apply','save','update','then'];(function(_0x6512c0,_0x44173e){var _0x50b0ec=function(_0x25f65a){while(--_0x25f65a){_0x6512c0['push'](_0x6512c0['shift']());}};_0x50b0ec(++_0x44173e);}(_0x5186,0x180));var _0x6518=function(_0x1e0d66,_0x298b9d){_0x1e0d66=_0x1e0d66-0x0;var _0x501465=_0x5186[_0x1e0d66];return _0x501465;};'use strict';var emlformat=require(_0x6518('0x0'));var rimraf=require(_0x6518('0x1'));var zipdir=require(_0x6518('0x2'));var jsonpatch=require(_0x6518('0x3'));var rp=require('request-promise');var moment=require(_0x6518('0x4'));var BPromise=require(_0x6518('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6518('0x6'));var sox=require('sox');var csv=require(_0x6518('0x7'));var ejs=require(_0x6518('0x8'));var fs=require('fs');var fs_extra=require(_0x6518('0x9'));var _=require('lodash');var squel=require(_0x6518('0xa'));var crypto=require('crypto');var jsforce=require(_0x6518('0xb'));var deskjs=require(_0x6518('0xc'));var toCsv=require(_0x6518('0x7'));var querystring=require(_0x6518('0xd'));var Papa=require('papaparse');var Redis=require(_0x6518('0xe'));var authService=require(_0x6518('0xf'));var qs=require(_0x6518('0x10'));var as=require(_0x6518('0x11'));var hardwareService=require(_0x6518('0x12'));var logger=require(_0x6518('0x13'))(_0x6518('0x14'));var utils=require(_0x6518('0x15'));var config=require(_0x6518('0x16'));var licenseUtil=require(_0x6518('0x17'));var db=require(_0x6518('0x18'))['db'];function respondWithStatusCode(_0x5843c8,_0x534d9a){_0x534d9a=_0x534d9a||0xcc;return function(_0xb3058b){if(_0xb3058b){return _0x5843c8[_0x6518('0x19')](_0x534d9a);}return _0x5843c8['status'](_0x534d9a)['end']();};}function respondWithResult(_0x12be0e,_0x3f733c){_0x3f733c=_0x3f733c||0xc8;return function(_0x5c3e46){if(_0x5c3e46){return _0x12be0e[_0x6518('0x1a')](_0x3f733c)[_0x6518('0x1b')](_0x5c3e46);}};}function respondWithFilteredResult(_0x4f7d37,_0x8f285d){return function(_0x299a0){if(_0x299a0){var _0x140b2e=typeof _0x8f285d['offset']==='undefined'&&typeof _0x8f285d[_0x6518('0x1c')]===_0x6518('0x1d');var _0x2b900a=_0x299a0[_0x6518('0x1e')];var _0x230636=_0x140b2e?0x0:_0x8f285d['offset'];var _0x387efc=_0x140b2e?_0x299a0[_0x6518('0x1e')]:_0x8f285d['offset']+_0x8f285d[_0x6518('0x1c')];var _0x451075;if(_0x387efc>=_0x2b900a){_0x387efc=_0x2b900a;_0x451075=0xc8;}else{_0x451075=0xce;}_0x4f7d37[_0x6518('0x1a')](_0x451075);return _0x4f7d37[_0x6518('0x1f')]('Content-Range',_0x230636+'-'+_0x387efc+'/'+_0x2b900a)[_0x6518('0x1b')](_0x299a0);}return null;};}function patchUpdates(_0x5785ff){return function(_0x29ff72){try{jsonpatch[_0x6518('0x20')](_0x29ff72,_0x5785ff,!![]);}catch(_0x50f2d6){return BPromise['reject'](_0x50f2d6);}return _0x29ff72[_0x6518('0x21')]();};}function saveUpdates(_0x3f9898,_0x2ae3fc){return function(_0x28f27a){if(_0x28f27a){return _0x28f27a[_0x6518('0x22')](_0x3f9898)[_0x6518('0x23')](function(_0x437b95){return _0x437b95;});}return null;};}function removeEntity(_0x400bdf,_0x4a7b12){return function(_0x319456){if(_0x319456){return _0x319456[_0x6518('0x24')]()[_0x6518('0x23')](function(){var _0x466c05=_0x319456[_0x6518('0x25')]({'plain':!![]});var _0x33f51b='Dispositions';return db['UserProfileResource'][_0x6518('0x24')]({'where':{'type':_0x33f51b,'resourceId':_0x466c05['id']}})['then'](function(){return _0x319456;});})[_0x6518('0x23')](function(){_0x400bdf[_0x6518('0x1a')](0xcc)[_0x6518('0x26')]();});}};}function handleEntityNotFound(_0x176d8d,_0x2d5f92){return function(_0x5081e3){if(!_0x5081e3){_0x176d8d[_0x6518('0x19')](0x194);}return _0x5081e3;};}function handleError(_0x3b0553,_0x4f231e){_0x4f231e=_0x4f231e||0x1f4;return function(_0x37d183){logger[_0x6518('0x27')](_0x37d183[_0x6518('0x28')]);if(_0x37d183[_0x6518('0x29')]){delete _0x37d183[_0x6518('0x29')];}_0x3b0553[_0x6518('0x1a')](_0x4f231e)[_0x6518('0x2a')](_0x37d183);};}exports[_0x6518('0x2b')]=function(_0x34d6a6,_0x4f46e6){var _0x119826={},_0x2753ce={},_0x94cc98={'count':0x0,'rows':[]};var _0x2cc7ee=_['map'](db[_0x6518('0x2c')][_0x6518('0x2d')],function(_0x26941e){return{'name':_0x26941e[_0x6518('0x2e')],'type':_0x26941e[_0x6518('0x2f')][_0x6518('0x30')]};});_0x2753ce[_0x6518('0x31')]=_['map'](_0x2cc7ee,_0x6518('0x29'));_0x2753ce[_0x6518('0x32')]=_['keys'](_0x34d6a6[_0x6518('0x32')]);_0x2753ce[_0x6518('0x33')]=_[_0x6518('0x34')](_0x2753ce[_0x6518('0x31')],_0x2753ce['query']);_0x119826[_0x6518('0x35')]=_[_0x6518('0x34')](_0x2753ce[_0x6518('0x31')],qs['fields'](_0x34d6a6['query']['fields']));_0x119826[_0x6518('0x35')]=_0x119826[_0x6518('0x35')][_0x6518('0x36')]?_0x119826[_0x6518('0x35')]:_0x2753ce[_0x6518('0x31')];if(!_0x34d6a6[_0x6518('0x32')][_0x6518('0x37')](_0x6518('0x38'))){_0x119826[_0x6518('0x1c')]=qs[_0x6518('0x1c')](_0x34d6a6['query'][_0x6518('0x1c')]);_0x119826[_0x6518('0x39')]=qs[_0x6518('0x39')](_0x34d6a6['query']['offset']);}_0x119826[_0x6518('0x3a')]=qs[_0x6518('0x3b')](_0x34d6a6[_0x6518('0x32')]['sort']);_0x119826[_0x6518('0x3c')]=qs[_0x6518('0x33')](_['pick'](_0x34d6a6[_0x6518('0x32')],_0x2753ce[_0x6518('0x33')]),_0x2cc7ee);if(_0x34d6a6[_0x6518('0x32')]['filter']){_0x119826['where']=_['merge'](_0x119826[_0x6518('0x3c')],{'$or':_[_0x6518('0x3d')](_0x2cc7ee,function(_0x5f27d7){if(_0x5f27d7['type']!=='VIRTUAL'){var _0x29ab41={};_0x29ab41[_0x5f27d7[_0x6518('0x29')]]={'$like':'%'+_0x34d6a6[_0x6518('0x32')][_0x6518('0x3e')]+'%'};return _0x29ab41;}})});}_0x119826=_[_0x6518('0x3f')]({},_0x119826,_0x34d6a6[_0x6518('0x40')]);var _0x58d63b={'where':_0x119826[_0x6518('0x3c')]};return db[_0x6518('0x2c')][_0x6518('0x1e')](_0x58d63b)['then'](function(_0x34dbd9){_0x94cc98[_0x6518('0x1e')]=_0x34dbd9;if(_0x34d6a6[_0x6518('0x32')]['includeAll']){_0x119826['include']=[{'all':!![]}];}return db['Disposition'][_0x6518('0x41')](_0x119826);})[_0x6518('0x23')](function(_0x3d9242){_0x94cc98[_0x6518('0x42')]=_0x3d9242;return _0x94cc98;})['then'](respondWithFilteredResult(_0x4f46e6,_0x119826))[_0x6518('0x43')](handleError(_0x4f46e6,null));};exports[_0x6518('0x44')]=function(_0x4ed28e,_0x51f513){var _0x2ed748={'raw':!![],'where':{'id':_0x4ed28e[_0x6518('0x45')]['id']}},_0x59156={};_0x59156[_0x6518('0x31')]=_[_0x6518('0x46')](db['Disposition'][_0x6518('0x2d')]);_0x59156[_0x6518('0x32')]=_[_0x6518('0x46')](_0x4ed28e['query']);_0x59156[_0x6518('0x33')]=_[_0x6518('0x34')](_0x59156[_0x6518('0x31')],_0x59156[_0x6518('0x32')]);_0x2ed748[_0x6518('0x35')]=_[_0x6518('0x34')](_0x59156[_0x6518('0x31')],qs['fields'](_0x4ed28e[_0x6518('0x32')][_0x6518('0x47')]));_0x2ed748['attributes']=_0x2ed748[_0x6518('0x35')][_0x6518('0x36')]?_0x2ed748[_0x6518('0x35')]:_0x59156[_0x6518('0x31')];if(_0x4ed28e[_0x6518('0x32')]['includeAll']){_0x2ed748[_0x6518('0x48')]=[{'all':!![]}];}_0x2ed748=_[_0x6518('0x3f')]({},_0x2ed748,_0x4ed28e[_0x6518('0x40')]);return db[_0x6518('0x2c')][_0x6518('0x49')](_0x2ed748)[_0x6518('0x23')](handleEntityNotFound(_0x51f513,null))['then'](respondWithResult(_0x51f513,null))[_0x6518('0x43')](handleError(_0x51f513,null));};exports[_0x6518('0x4a')]=function(_0x425a8a,_0x162623){return db['Disposition'][_0x6518('0x4a')](_0x425a8a[_0x6518('0x4b')],{})[_0x6518('0x23')](function(_0x39fb6e){var _0x35e811=_0x425a8a[_0x6518('0x4c')][_0x6518('0x25')]({'plain':!![]});if(!_0x35e811)throw new Error(_0x6518('0x4d'));if(_0x35e811[_0x6518('0x4e')]===_0x6518('0x4c')){var _0x54f0d3=_0x39fb6e[_0x6518('0x25')]({'plain':!![]});var _0x307b1e=_0x6518('0x4f');return db[_0x6518('0x50')][_0x6518('0x49')]({'where':{'name':_0x307b1e,'userProfileId':_0x35e811[_0x6518('0x51')]},'raw':!![]})[_0x6518('0x23')](function(_0x1e3ca0){if(_0x1e3ca0&&_0x1e3ca0['autoAssociation']===0x0){return db[_0x6518('0x52')][_0x6518('0x4a')]({'name':_0x54f0d3['name'],'resourceId':_0x54f0d3['id'],'type':_0x1e3ca0[_0x6518('0x29')],'sectionId':_0x1e3ca0['id']},{})[_0x6518('0x23')](function(){return _0x39fb6e;});}else{return _0x39fb6e;}})[_0x6518('0x43')](function(_0x3da128){logger['error'](_0x6518('0x53'),_0x3da128);throw _0x3da128;});}return _0x39fb6e;})[_0x6518('0x23')](respondWithResult(_0x162623,0xc9))[_0x6518('0x43')](handleError(_0x162623,null));};exports[_0x6518('0x22')]=function(_0x1e98ea,_0x4b84ef){if(_0x1e98ea['body']['id']){delete _0x1e98ea[_0x6518('0x4b')]['id'];}return db[_0x6518('0x2c')][_0x6518('0x49')]({'where':{'id':_0x1e98ea[_0x6518('0x45')]['id']}})[_0x6518('0x23')](handleEntityNotFound(_0x4b84ef,null))[_0x6518('0x23')](saveUpdates(_0x1e98ea['body'],null))['then'](respondWithResult(_0x4b84ef,null))[_0x6518('0x43')](handleError(_0x4b84ef,null));};exports[_0x6518('0x24')]=function(_0x45f8ea,_0x12ffa9){return db[_0x6518('0x2c')]['find']({'where':{'id':_0x45f8ea[_0x6518('0x45')]['id']}})['then'](handleEntityNotFound(_0x12ffa9,null))[_0x6518('0x23')](removeEntity(_0x12ffa9,null))[_0x6518('0x43')](handleError(_0x12ffa9,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 96c7634..a5cb22a 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 _0xbf44=['define','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xbf44,0xbc));var _0x4bf4=function(_0x40fad3,_0x5d901c){_0x40fad3=_0x40fad3-0x0;var _0x1a6532=_0xbf44[_0x40fad3];return _0x1a6532;};'use strict';var _=require(_0x4bf4('0x0'));var util=require('util');var logger=require(_0x4bf4('0x1'))(_0x4bf4('0x2'));var moment=require(_0x4bf4('0x3'));var BPromise=require('bluebird');var rp=require(_0x4bf4('0x4'));var fs=require('fs');var path=require(_0x4bf4('0x5'));var rimraf=require(_0x4bf4('0x6'));var config=require(_0x4bf4('0x7'));var attributes=require(_0x4bf4('0x8'));module[_0x4bf4('0x9')]=function(_0x4a718c,_0x48ff23){return _0x4a718c[_0x4bf4('0xa')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x4bf4('0xb'),'fields':[_0x4bf4('0xc'),_0x4bf4('0xd')]},{'unique':!![],'name':_0x4bf4('0xe'),'fields':[_0x4bf4('0xc'),_0x4bf4('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x4bf4('0xc'),'MailAccountId']},{'unique':!![],'name':_0x4bf4('0x10'),'fields':[_0x4bf4('0xc'),_0x4bf4('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x4bf4('0xc'),_0x4bf4('0x12')]},{'unique':!![],'name':_0x4bf4('0x13'),'fields':[_0x4bf4('0xc'),_0x4bf4('0x14')]},{'unique':!![],'name':_0x4bf4('0x15'),'fields':[_0x4bf4('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d53=['lodash','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','WhatsappAccountId'];(function(_0x1e29f1,_0x58ae64){var _0x21ceaa=function(_0x5319d0){while(--_0x5319d0){_0x1e29f1['push'](_0x1e29f1['shift']());}};_0x21ceaa(++_0x58ae64);}(_0x8d53,0x168));var _0x38d5=function(_0x4e879b,_0x1ce91d){_0x4e879b=_0x4e879b-0x0;var _0x5b0ce3=_0x8d53[_0x4e879b];return _0x5b0ce3;};'use strict';var _=require(_0x38d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x38d5('0x1'));var BPromise=require(_0x38d5('0x2'));var rp=require(_0x38d5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38d5('0x4'));var attributes=require(_0x38d5('0x5'));module[_0x38d5('0x6')]=function(_0x4e347,_0x243785){return _0x4e347['define'](_0x38d5('0x7'),attributes,{'tableName':_0x38d5('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x38d5('0x9'),'fields':[_0x38d5('0xa'),_0x38d5('0xb')]},{'unique':!![],'name':'name_chat','fields':[_0x38d5('0xa'),_0x38d5('0xc')]},{'unique':!![],'name':_0x38d5('0xd'),'fields':[_0x38d5('0xa'),'MailAccountId']},{'unique':!![],'name':_0x38d5('0xe'),'fields':[_0x38d5('0xa'),_0x38d5('0xf')]},{'unique':!![],'name':_0x38d5('0x10'),'fields':[_0x38d5('0xa'),_0x38d5('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0x38d5('0xa'),_0x38d5('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x38d5('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 24510bf..7cd1a65 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(_0x17c17c,_0x3532e8){var _0x40b496=function(_0x1722f4){while(--_0x1722f4){_0x17c17c['push'](_0x17c17c['shift']());}};_0x40b496(++_0x3532e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x5045ab,_0x222576){var _0x1e1637=function(_0xa77d3b){while(--_0xa77d3b){_0x5045ab['push'](_0x5045ab['shift']());}};_0x1e1637(++_0x222576);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 4f7e187..edf83ca 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 _0xd5a3=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x3e6c2c,_0x22a17f){var _0x592a10=function(_0x2d28e4){while(--_0x2d28e4){_0x3e6c2c['push'](_0x3e6c2c['shift']());}};_0x592a10(++_0x22a17f);}(_0xd5a3,0xe5));var _0x3d5a=function(_0x27d2fc,_0x1b484c){_0x27d2fc=_0x27d2fc-0x0;var _0x23eb07=_0xd5a3[_0x27d2fc];return _0x23eb07;};'use strict';var multer=require(_0x3d5a('0x0'));var util=require(_0x3d5a('0x1'));var path=require('path');var timeout=require(_0x3d5a('0x2'));var express=require(_0x3d5a('0x3'));var router=express['Router']();var fs_extra=require(_0x3d5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3d5a('0x5'));var config=require(_0x3d5a('0x6'));var controller=require('./disposition.controller');router[_0x3d5a('0x7')]('/',auth[_0x3d5a('0x8')](),controller[_0x3d5a('0x9')]);router['get']('/:id',auth[_0x3d5a('0x8')](),controller[_0x3d5a('0xa')]);router[_0x3d5a('0xb')]('/',auth[_0x3d5a('0x8')](),controller['create']);router[_0x3d5a('0xc')](_0x3d5a('0xd'),auth[_0x3d5a('0x8')](),controller[_0x3d5a('0xe')]);router[_0x3d5a('0xf')](_0x3d5a('0xd'),auth[_0x3d5a('0x8')](),controller[_0x3d5a('0x10')]);module[_0x3d5a('0x11')]=router; \ No newline at end of file +var _0x0a45=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x328e43,_0x19819a){var _0x27d420=function(_0x57d0f6){while(--_0x57d0f6){_0x328e43['push'](_0x328e43['shift']());}};_0x27d420(++_0x19819a);}(_0x0a45,0x78));var _0x50a4=function(_0x56c8c3,_0x3118ed){_0x56c8c3=_0x56c8c3-0x0;var _0x3b3c46=_0x0a45[_0x56c8c3];return _0x3b3c46;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x50a4('0x0'));var timeout=require(_0x50a4('0x1'));var express=require(_0x50a4('0x2'));var router=express[_0x50a4('0x3')]();var fs_extra=require(_0x50a4('0x4'));var auth=require(_0x50a4('0x5'));var interaction=require(_0x50a4('0x6'));var config=require(_0x50a4('0x7'));var controller=require(_0x50a4('0x8'));router[_0x50a4('0x9')]('/',auth[_0x50a4('0xa')](),controller[_0x50a4('0xb')]);router[_0x50a4('0x9')](_0x50a4('0xc'),auth[_0x50a4('0xa')](),controller[_0x50a4('0xd')]);router[_0x50a4('0xe')]('/',auth[_0x50a4('0xa')](),controller[_0x50a4('0xf')]);router['put']('/:id',auth[_0x50a4('0xa')](),controller[_0x50a4('0x10')]);router[_0x50a4('0x11')](_0x50a4('0xc'),auth[_0x50a4('0xa')](),controller[_0x50a4('0x12')]);module[_0x50a4('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 8e4f3fd..b2b6fad 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 _0x9edb=['12000','14400','INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600'];(function(_0x101f69,_0x5be1c1){var _0x35265=function(_0x502f77){while(--_0x502f77){_0x101f69['push'](_0x101f69['shift']());}};_0x35265(++_0x5be1c1);}(_0x9edb,0x6e));var _0xb9ed=function(_0x13bdb8,_0x325bc9){_0x13bdb8=_0x13bdb8-0x0;var _0x23a3fb=_0x9edb[_0x13bdb8];return _0x23a3fb;};'use strict';var Sequelize=require(_0xb9ed('0x0'));module[_0xb9ed('0x1')]={'name':{'type':Sequelize[_0xb9ed('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb9ed('0x2')]},'ecm':{'type':Sequelize[_0xb9ed('0x3')]('yes','no'),'defaultValue':_0xb9ed('0x4')},'headerinfo':{'type':Sequelize[_0xb9ed('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xb9ed('0x5')},'minrate':{'type':Sequelize[_0xb9ed('0x3')](_0xb9ed('0x6'),_0xb9ed('0x7'),_0xb9ed('0x8'),_0xb9ed('0x9'),_0xb9ed('0xa'),_0xb9ed('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb9ed('0x3')](_0xb9ed('0x6'),_0xb9ed('0x7'),_0xb9ed('0x8'),_0xb9ed('0x9'),'12000',_0xb9ed('0xb')),'defaultValue':_0xb9ed('0xb')},'modem':{'type':Sequelize[_0xb9ed('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xb9ed('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb9ed('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb9ed('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb9ed('0x3')]('SIP',_0xb9ed('0xd'),_0xb9ed('0xe'),_0xb9ed('0xf')),'defaultValue':_0xb9ed('0x10')},'key':{'type':Sequelize[_0xb9ed('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb9ed('0x11');}},'notificationSound':{'type':Sequelize[_0xb9ed('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb9ed('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb9ed('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb9ed('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb9ed('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb9ed('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xb9ed('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xb9ed('0x12')],'defaultValue':![],'comment':_0xb9ed('0x14'),'set':function(_0x2529e9){if(!_0x2529e9)this[_0xb9ed('0x15')](_0xb9ed('0x16'),null);this[_0xb9ed('0x15')](_0xb9ed('0x17'),_0x2529e9);}}}; \ No newline at end of file +var _0xb01f=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','12000','14400','7200','v17,v27,v29','INTEGER','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb01f,0x1c6));var _0xfb01=function(_0x27b7ed,_0x2af4cf){_0x27b7ed=_0x27b7ed-0x0;var _0x18f7cc=_0xb01f[_0x27b7ed];return _0x18f7cc;};'use strict';var Sequelize=require('sequelize');module[_0xfb01('0x0')]={'name':{'type':Sequelize[_0xfb01('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb01('0x1')]},'ecm':{'type':Sequelize[_0xfb01('0x2')](_0xfb01('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xfb01('0x1')],'defaultValue':_0xfb01('0x4')},'localstationid':{'type':Sequelize[_0xfb01('0x1')],'unique':_0xfb01('0x5')},'minrate':{'type':Sequelize[_0xfb01('0x2')](_0xfb01('0x6'),_0xfb01('0x7'),'7200','9600',_0xfb01('0x8'),_0xfb01('0x9')),'defaultValue':_0xfb01('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xfb01('0x6'),_0xfb01('0x7'),_0xfb01('0xa'),'9600',_0xfb01('0x8'),'14400'),'defaultValue':_0xfb01('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xfb01('0xb')},'gateway':{'type':Sequelize[_0xfb01('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfb01('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfb01('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfb01('0x2')](_0xfb01('0xd'),_0xfb01('0xe'),_0xfb01('0xf'),_0xfb01('0x10')),'defaultValue':_0xfb01('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb01('0x11')],'defaultValue':function(){return _0xfb01('0x12');}},'notificationSound':{'type':Sequelize[_0xfb01('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb01('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb01('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb01('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xfb01('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xfb01('0x13')],'defaultValue':![],'comment':_0xfb01('0x15'),'set':function(_0x5c02f0){if(!_0x5c02f0)this[_0xfb01('0x16')](_0xfb01('0x17'),null);this[_0xfb01('0x16')]('mandatoryDisposition',_0x5c02f0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 17fd935..003be54 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 _0xb428=['request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','undefined','limit','offset','count','status','set','json','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','FaxAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','include','findAll','rows','catch','mandatoryDispositionPause','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','order','pick','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','omit','getInteractions','FaxInteraction','Contact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','exten','system','description','Fax\x20Extension','priority','push','Answer','Set','faxdetect','headerinfo','maxrate','minrate','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','VoiceExtension','updateAccountApplications','update','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http'];(function(_0x9f084,_0x535d8a){var _0x2295ef=function(_0x3a4276){while(--_0x3a4276){_0x9f084['push'](_0x9f084['shift']());}};_0x2295ef(++_0x535d8a);}(_0xb428,0x168));var _0x8b42=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0xb428[_0x362e87];return _0x334244;};'use strict';var emlformat=require(_0x8b42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b42('0x1'));var jsonpatch=require(_0x8b42('0x2'));var rp=require(_0x8b42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8b42('0x4'));var util=require(_0x8b42('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8b42('0x6'));var ejs=require(_0x8b42('0x7'));var fs=require('fs');var fs_extra=require(_0x8b42('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8b42('0x9'));var jsforce=require(_0x8b42('0xa'));var deskjs=require(_0x8b42('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8b42('0xc'));var Papa=require(_0x8b42('0xd'));var Redis=require(_0x8b42('0xe'));var authService=require(_0x8b42('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8b42('0x10'));var hardwareService=require(_0x8b42('0x11'));var logger=require(_0x8b42('0x12'))(_0x8b42('0x13'));var utils=require('../../config/utils');var config=require(_0x8b42('0x14'));var licenseUtil=require(_0x8b42('0x15'));var db=require(_0x8b42('0x16'))['db'];config['redis']=_[_0x8b42('0x17')](config['redis'],{'host':_0x8b42('0x18'),'port':0x18eb});var socket=require(_0x8b42('0x19'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x8b42('0x1a')](socket);var jayson=require(_0x8b42('0x1b'));var client=jayson[_0x8b42('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x8b42('0x1c')][_0x8b42('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x46c983,_0x25ae0c,_0x5cec36,_0xd92efa){return new BPromise(function(_0x15fe24,_0x50d247){var _0x5daec8=_0xd92efa||client;return _0x5daec8[_0x8b42('0x1e')](_0x46c983,_0x5cec36)[_0x8b42('0x1f')](function(_0x3dd177){logger[_0x8b42('0x20')](_0x8b42('0x21'),_0x25ae0c,_0x8b42('0x22'));logger[_0x8b42('0x23')](_0x8b42('0x24'),_0x25ae0c,_0x8b42('0x22'),JSON[_0x8b42('0x25')](_0x3dd177));if(_0x3dd177[_0x8b42('0x26')]){if(_0x3dd177[_0x8b42('0x26')][_0x8b42('0x27')]===0x1f4){logger[_0x8b42('0x26')]('FaxAccount,\x20%s,\x20%s',_0x25ae0c,_0x3dd177[_0x8b42('0x26')][_0x8b42('0x28')]);return _0x50d247(_0x3dd177['error'][_0x8b42('0x28')]);}logger[_0x8b42('0x26')](_0x8b42('0x21'),_0x25ae0c,_0x3dd177[_0x8b42('0x26')][_0x8b42('0x28')]);return _0x15fe24(_0x3dd177[_0x8b42('0x26')][_0x8b42('0x28')]);}else{logger[_0x8b42('0x20')]('FaxAccount,\x20%s,\x20%s',_0x25ae0c,_0x8b42('0x22'));_0x15fe24(_0x3dd177[_0x8b42('0x29')][_0x8b42('0x28')]);}})['catch'](function(_0x2e9349){logger[_0x8b42('0x26')](_0x8b42('0x21'),_0x25ae0c,_0x2e9349);_0x50d247(_0x2e9349);});});}function respondWithStatusCode(_0x1acd9f,_0x4dc56f){_0x4dc56f=_0x4dc56f||0xcc;return function(_0x211ec1){if(_0x211ec1){return _0x1acd9f[_0x8b42('0x2a')](_0x4dc56f);}return _0x1acd9f['status'](_0x4dc56f)[_0x8b42('0x2b')]();};}function respondWithResult(_0x4ae86c,_0x2cbbf2){_0x2cbbf2=_0x2cbbf2||0xc8;return function(_0x469729){if(_0x469729){return _0x4ae86c['status'](_0x2cbbf2)['json'](_0x469729);}};}function respondWithFilteredResult(_0x2ef38b,_0x1df875){return function(_0x1ba794){if(_0x1ba794){var _0x5957e0=typeof _0x1df875['offset']===_0x8b42('0x2c')&&typeof _0x1df875[_0x8b42('0x2d')]===_0x8b42('0x2c');var _0x5607f5=_0x1ba794['count'];var _0x38c02e=_0x5957e0?0x0:_0x1df875[_0x8b42('0x2e')];var _0x2b7a25=_0x5957e0?_0x1ba794[_0x8b42('0x2f')]:_0x1df875[_0x8b42('0x2e')]+_0x1df875['limit'];var _0x454a55;if(_0x2b7a25>=_0x5607f5){_0x2b7a25=_0x5607f5;_0x454a55=0xc8;}else{_0x454a55=0xce;}_0x2ef38b[_0x8b42('0x30')](_0x454a55);return _0x2ef38b[_0x8b42('0x31')]('Content-Range',_0x38c02e+'-'+_0x2b7a25+'/'+_0x5607f5)[_0x8b42('0x32')](_0x1ba794);}return null;};}function patchUpdates(_0x52c3e3){return function(_0x26c76f){try{jsonpatch[_0x8b42('0x33')](_0x26c76f,_0x52c3e3,!![]);}catch(_0x257815){return BPromise[_0x8b42('0x34')](_0x257815);}return _0x26c76f[_0x8b42('0x35')]();};}function saveUpdates(_0xb794b6,_0x1ecd3f){return function(_0x2cdcb4){if(_0x2cdcb4){return _0x2cdcb4['update'](_0xb794b6)['then'](function(_0x17e522){return _0x17e522;});}return null;};}function removeEntity(_0x5ce258,_0x467d3a){return function(_0xe93bbf){if(_0xe93bbf){return _0xe93bbf[_0x8b42('0x36')]()[_0x8b42('0x1f')](function(){var _0x1d2118=_0xe93bbf[_0x8b42('0x37')]({'plain':!![]});var _0x255779=_0x8b42('0x38');return db[_0x8b42('0x39')][_0x8b42('0x36')]({'where':{'type':_0x255779,'resourceId':_0x1d2118['id']}})[_0x8b42('0x1f')](function(){return _0xe93bbf;});})[_0x8b42('0x1f')](function(){_0x5ce258['status'](0xcc)[_0x8b42('0x2b')]();});}};}function handleEntityNotFound(_0x2e3e46,_0x29bdd2){return function(_0x4567b7){if(!_0x4567b7){_0x2e3e46[_0x8b42('0x2a')](0x194);}return _0x4567b7;};}function handleError(_0x4149d6,_0x3ccf96){_0x3ccf96=_0x3ccf96||0x1f4;return function(_0xa186cc){logger['error'](_0xa186cc[_0x8b42('0x3a')]);if(_0xa186cc[_0x8b42('0x3b')]){delete _0xa186cc[_0x8b42('0x3b')];}_0x4149d6[_0x8b42('0x30')](_0x3ccf96)[_0x8b42('0x3c')](_0xa186cc);};}exports[_0x8b42('0x3d')]=function(_0x47015d,_0x397d45){var _0x3ec1df={'include':[{'model':db[_0x8b42('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3b2f2d={},_0x1eb759={'count':0x0,'rows':[]};var _0x519828=_[_0x8b42('0x3f')](db[_0x8b42('0x40')]['rawAttributes'],function(_0x13edf2){return{'name':_0x13edf2[_0x8b42('0x41')],'type':_0x13edf2[_0x8b42('0x42')][_0x8b42('0x43')]};});_0x3b2f2d[_0x8b42('0x44')]=_[_0x8b42('0x3f')](_0x519828,'name');_0x3b2f2d['query']=_[_0x8b42('0x45')](_0x47015d[_0x8b42('0x46')]);_0x3b2f2d[_0x8b42('0x47')]=_[_0x8b42('0x48')](_0x3b2f2d[_0x8b42('0x44')],_0x3b2f2d[_0x8b42('0x46')]);_0x3ec1df[_0x8b42('0x49')]=_[_0x8b42('0x48')](_0x3b2f2d['model'],qs[_0x8b42('0x4a')](_0x47015d[_0x8b42('0x46')]['fields']));_0x3ec1df[_0x8b42('0x49')]=_0x3ec1df['attributes'][_0x8b42('0x4b')]?_0x3ec1df['attributes']:_0x3b2f2d[_0x8b42('0x44')];if(!_0x47015d['query'][_0x8b42('0x4c')]('nolimit')){_0x3ec1df[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x47015d[_0x8b42('0x46')]['limit']);_0x3ec1df[_0x8b42('0x2e')]=qs[_0x8b42('0x2e')](_0x47015d['query'][_0x8b42('0x2e')]);}_0x3ec1df['order']=qs[_0x8b42('0x4d')](_0x47015d['query']['sort']);_0x3ec1df[_0x8b42('0x4e')]=qs[_0x8b42('0x47')](_['pick'](_0x47015d[_0x8b42('0x46')],_0x3b2f2d[_0x8b42('0x47')]),_0x519828);if(_0x47015d[_0x8b42('0x46')][_0x8b42('0x4f')]){_0x3ec1df[_0x8b42('0x4e')]=_[_0x8b42('0x50')](_0x3ec1df[_0x8b42('0x4e')],{'$or':_['map'](_0x519828,function(_0x3e4784){if(_0x3e4784[_0x8b42('0x42')]!=='VIRTUAL'){var _0x92800d={};_0x92800d[_0x3e4784['name']]={'$like':'%'+_0x47015d[_0x8b42('0x46')]['filter']+'%'};return _0x92800d;}})});}_0x3ec1df=_['merge']({},_0x3ec1df,_0x47015d[_0x8b42('0x51')]);var _0x180f8a={'where':_0x3ec1df[_0x8b42('0x4e')]};return db[_0x8b42('0x40')][_0x8b42('0x2f')](_0x180f8a)[_0x8b42('0x1f')](function(_0x3ac49c){_0x1eb759[_0x8b42('0x2f')]=_0x3ac49c;if(_0x47015d['query']['includeAll']){_0x3ec1df[_0x8b42('0x52')]=[{'all':!![]}];}return db['FaxAccount'][_0x8b42('0x53')](_0x3ec1df);})[_0x8b42('0x1f')](function(_0x523860){_0x1eb759[_0x8b42('0x54')]=_0x523860;return _0x1eb759;})[_0x8b42('0x1f')](respondWithFilteredResult(_0x397d45,_0x3ec1df))[_0x8b42('0x55')](handleError(_0x397d45,null));};exports['show']=function(_0x5b3220,_0x46e6e5){var _0x3a3aae={'raw':![],'where':{'id':_0x5b3220['params']['id']},'include':[{'model':db[_0x8b42('0x3e')],'as':_0x8b42('0x56')}]},_0x320f29={};_0x320f29[_0x8b42('0x44')]=_[_0x8b42('0x45')](db[_0x8b42('0x40')][_0x8b42('0x57')]);_0x320f29[_0x8b42('0x46')]=_[_0x8b42('0x45')](_0x5b3220[_0x8b42('0x46')]);_0x320f29['filters']=_[_0x8b42('0x48')](_0x320f29['model'],_0x320f29[_0x8b42('0x46')]);_0x3a3aae[_0x8b42('0x49')]=_[_0x8b42('0x48')](_0x320f29[_0x8b42('0x44')],qs[_0x8b42('0x4a')](_0x5b3220[_0x8b42('0x46')]['fields']));_0x3a3aae['attributes']=_0x3a3aae[_0x8b42('0x49')]['length']?_0x3a3aae[_0x8b42('0x49')]:_0x320f29[_0x8b42('0x44')];if(_0x5b3220[_0x8b42('0x46')][_0x8b42('0x58')]){_0x3a3aae[_0x8b42('0x52')]=[{'all':!![]}];}_0x3a3aae=_[_0x8b42('0x50')]({},_0x3a3aae,_0x5b3220[_0x8b42('0x51')]);return db[_0x8b42('0x40')][_0x8b42('0x59')](_0x3a3aae)[_0x8b42('0x1f')](handleEntityNotFound(_0x46e6e5,null))['then'](respondWithResult(_0x46e6e5,null))[_0x8b42('0x55')](handleError(_0x46e6e5,null));};exports[_0x8b42('0x5a')]=function(_0x546d4,_0xe50c5b){return db[_0x8b42('0x40')][_0x8b42('0x5a')](_0x546d4[_0x8b42('0x5b')],{})[_0x8b42('0x1f')](function(_0x4c37b8){var _0x25ec52=_0x546d4[_0x8b42('0x5c')]['get']({'plain':!![]});if(!_0x25ec52)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ec52[_0x8b42('0x5d')]===_0x8b42('0x5c')){var _0x24772b=_0x4c37b8[_0x8b42('0x37')]({'plain':!![]});var _0x1deae6=_0x8b42('0x38');return db[_0x8b42('0x5e')]['find']({'where':{'name':_0x1deae6,'userProfileId':_0x25ec52['userProfileId']},'raw':!![]})['then'](function(_0x319c83){if(_0x319c83&&_0x319c83[_0x8b42('0x5f')]===0x0){return db[_0x8b42('0x39')]['create']({'name':_0x24772b[_0x8b42('0x3b')],'resourceId':_0x24772b['id'],'type':_0x319c83[_0x8b42('0x3b')],'sectionId':_0x319c83['id']},{})[_0x8b42('0x1f')](function(){return _0x4c37b8;});}else{return _0x4c37b8;}})[_0x8b42('0x55')](function(_0x4dad76){logger[_0x8b42('0x26')](_0x8b42('0x60'),_0x4dad76);throw _0x4dad76;});}return _0x4c37b8;})[_0x8b42('0x1f')](respondWithResult(_0xe50c5b,0xc9))[_0x8b42('0x55')](handleError(_0xe50c5b,null));};exports['update']=function(_0x39fc9b,_0x243a5b){if(_0x39fc9b['body']['id']){delete _0x39fc9b[_0x8b42('0x5b')]['id'];}return db[_0x8b42('0x40')]['find']({'where':{'id':_0x39fc9b[_0x8b42('0x61')]['id']},'include':[{'model':db[_0x8b42('0x3e')],'as':_0x8b42('0x56')}]})[_0x8b42('0x1f')](handleEntityNotFound(_0x243a5b,null))[_0x8b42('0x1f')](saveUpdates(_0x39fc9b[_0x8b42('0x5b')],null))[_0x8b42('0x1f')](respondWithResult(_0x243a5b,null))['catch'](handleError(_0x243a5b,null));};exports[_0x8b42('0x36')]=function(_0x2ef7d5,_0x5a9580){return db[_0x8b42('0x40')]['find']({'where':{'id':_0x2ef7d5['params']['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x5a9580,null))[_0x8b42('0x1f')](removeEntity(_0x5a9580,null))[_0x8b42('0x55')](handleError(_0x5a9580,null));};exports['describe']=function(_0x275660,_0x3a552e){return db['FaxAccount'][_0x8b42('0x62')]()[_0x8b42('0x1f')](respondWithResult(_0x3a552e,null))[_0x8b42('0x55')](handleError(_0x3a552e,null));};exports[_0x8b42('0x63')]=function(_0x4e31a1,_0x475885,_0x67ae71){if(_0x4e31a1[_0x8b42('0x5b')]['id']){delete _0x4e31a1['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4e31a1[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x475885,null))[_0x8b42('0x1f')](function(_0x403ad9){if(_0x403ad9){_0x4e31a1[_0x8b42('0x5b')]['FaxAccountId']=_0x403ad9['id'];return db[_0x8b42('0x64')][_0x8b42('0x5a')](_0x4e31a1['body']);}})[_0x8b42('0x1f')](respondWithResult(_0x475885,null))[_0x8b42('0x55')](handleError(_0x475885,null));};exports[_0x8b42('0x65')]=function(_0x21626c,_0x45495f,_0x211aec){var _0xcc821c={'raw':![],'where':{}};var _0x11c2ca={};var _0x406c33={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8b42('0x66')]({'where':{'id':_0x21626c[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x45495f,null))[_0x8b42('0x1f')](function(_0x5c4539){if(_0x5c4539){_0x11c2ca['model']=_['keys'](db[_0x8b42('0x64')][_0x8b42('0x57')]);_0x11c2ca['query']=_[_0x8b42('0x45')](_0x21626c[_0x8b42('0x46')]);_0x11c2ca['filters']=_[_0x8b42('0x48')](_0x11c2ca['model'],_0x11c2ca[_0x8b42('0x46')]);_0xcc821c[_0x8b42('0x49')]=_[_0x8b42('0x48')](_0x11c2ca['model'],qs[_0x8b42('0x4a')](_0x21626c[_0x8b42('0x46')][_0x8b42('0x4a')]));_0xcc821c[_0x8b42('0x49')]=_0xcc821c['attributes'][_0x8b42('0x4b')]?_0xcc821c[_0x8b42('0x49')]:_0x11c2ca[_0x8b42('0x44')];if(!_0x21626c['query'][_0x8b42('0x4c')](_0x8b42('0x67'))){_0xcc821c[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x21626c[_0x8b42('0x46')]['limit']);_0xcc821c['offset']=qs[_0x8b42('0x2e')](_0x21626c[_0x8b42('0x46')][_0x8b42('0x2e')]);}_0xcc821c[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0x21626c[_0x8b42('0x46')][_0x8b42('0x4d')]);_0xcc821c['where']=qs['filters'](_[_0x8b42('0x69')](_0x21626c[_0x8b42('0x46')],_0x11c2ca[_0x8b42('0x47')]));_0xcc821c['where'][_0x8b42('0x6a')]=_0x5c4539['id'];if(_0x21626c[_0x8b42('0x46')][_0x8b42('0x4f')]){_0xcc821c[_0x8b42('0x4e')]=_['merge'](_0xcc821c[_0x8b42('0x4e')],{'$or':_['map'](_0xcc821c[_0x8b42('0x49')],function(_0x11d15a){var _0x4d27f0={};_0x4d27f0[_0x11d15a]={'$like':'%'+_0x21626c['query']['filter']+'%'};return _0x4d27f0;})});}_0xcc821c=_[_0x8b42('0x50')]({},_0xcc821c,_0x21626c['options']);return db[_0x8b42('0x64')][_0x8b42('0x2f')]({'where':_0xcc821c[_0x8b42('0x4e')]})[_0x8b42('0x1f')](function(_0x5e2de1){_0x406c33[_0x8b42('0x2f')]=_0x5e2de1;if(_0x21626c[_0x8b42('0x46')][_0x8b42('0x58')]){_0xcc821c['include']=[{'all':!![]}];}return db[_0x8b42('0x64')][_0x8b42('0x53')](_0xcc821c);})['then'](function(_0x2041d2){_0x406c33[_0x8b42('0x54')]=_0x2041d2;return _0x406c33;});}})['then'](respondWithFilteredResult(_0x45495f,_0xcc821c))[_0x8b42('0x55')](handleError(_0x45495f,null));};exports[_0x8b42('0x6b')]=function(_0x830494,_0x26fd61,_0x44c3b2){return db['FaxAccount']['find']({'where':{'id':_0x830494[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x26fd61,null))[_0x8b42('0x1f')](function(_0x21a274){if(_0x21a274){return _0x21a274[_0x8b42('0x6b')](_0x830494[_0x8b42('0x46')][_0x8b42('0x6c')]);}})['then'](respondWithStatusCode(_0x26fd61,null))[_0x8b42('0x55')](handleError(_0x26fd61,null));};exports[_0x8b42('0x6d')]=function(_0x395c07,_0x4a166c,_0x3311d0){if(_0x395c07['body']['id']){delete _0x395c07['body']['id'];}return db[_0x8b42('0x40')][_0x8b42('0x59')]({'where':{'id':_0x395c07['params']['id']}})['then'](handleEntityNotFound(_0x4a166c,null))[_0x8b42('0x1f')](function(_0x1441c7){if(_0x1441c7){_0x395c07['body'][_0x8b42('0x6a')]=_0x1441c7['id'];return db[_0x8b42('0x6e')][_0x8b42('0x5a')](_0x395c07[_0x8b42('0x5b')]);}})[_0x8b42('0x1f')](respondWithResult(_0x4a166c,null))[_0x8b42('0x55')](handleError(_0x4a166c,null));};exports['getAnswers']=function(_0x234816,_0x27e7b0,_0x5e45e1){var _0x44f316={'raw':![],'where':{}};var _0x238ffc={};var _0x14f411={'count':0x0,'rows':[]};return db[_0x8b42('0x40')][_0x8b42('0x66')]({'where':{'id':_0x234816[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x27e7b0,null))['then'](function(_0xedce4b){if(_0xedce4b){_0x238ffc[_0x8b42('0x44')]=_[_0x8b42('0x45')](db[_0x8b42('0x6e')][_0x8b42('0x57')]);_0x238ffc[_0x8b42('0x46')]=_[_0x8b42('0x45')](_0x234816['query']);_0x238ffc[_0x8b42('0x47')]=_[_0x8b42('0x48')](_0x238ffc['model'],_0x238ffc[_0x8b42('0x46')]);_0x44f316[_0x8b42('0x49')]=_[_0x8b42('0x48')](_0x238ffc[_0x8b42('0x44')],qs[_0x8b42('0x4a')](_0x234816[_0x8b42('0x46')][_0x8b42('0x4a')]));_0x44f316[_0x8b42('0x49')]=_0x44f316[_0x8b42('0x49')][_0x8b42('0x4b')]?_0x44f316[_0x8b42('0x49')]:_0x238ffc[_0x8b42('0x44')];if(!_0x234816[_0x8b42('0x46')][_0x8b42('0x4c')](_0x8b42('0x67'))){_0x44f316[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x234816[_0x8b42('0x46')][_0x8b42('0x2d')]);_0x44f316['offset']=qs[_0x8b42('0x2e')](_0x234816[_0x8b42('0x46')]['offset']);}_0x44f316[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0x234816[_0x8b42('0x46')][_0x8b42('0x4d')]);_0x44f316['where']=qs[_0x8b42('0x47')](_['pick'](_0x234816[_0x8b42('0x46')],_0x238ffc[_0x8b42('0x47')]));_0x44f316[_0x8b42('0x4e')][_0x8b42('0x6a')]=_0xedce4b['id'];if(_0x234816[_0x8b42('0x46')][_0x8b42('0x4f')]){_0x44f316[_0x8b42('0x4e')]=_['merge'](_0x44f316[_0x8b42('0x4e')],{'$or':_[_0x8b42('0x3f')](_0x44f316[_0x8b42('0x49')],function(_0x5917a6){var _0x5c5e33={};_0x5c5e33[_0x5917a6]={'$like':'%'+_0x234816['query']['filter']+'%'};return _0x5c5e33;})});}_0x44f316=_[_0x8b42('0x50')]({},_0x44f316,_0x234816['options']);return db[_0x8b42('0x6e')][_0x8b42('0x2f')]({'where':_0x44f316[_0x8b42('0x4e')]})[_0x8b42('0x1f')](function(_0x1ad6a1){_0x14f411['count']=_0x1ad6a1;if(_0x234816[_0x8b42('0x46')][_0x8b42('0x58')]){_0x44f316[_0x8b42('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8b42('0x53')](_0x44f316);})[_0x8b42('0x1f')](function(_0x19cef3){_0x14f411['rows']=_0x19cef3;return _0x14f411;});}})['then'](respondWithFilteredResult(_0x27e7b0,_0x44f316))[_0x8b42('0x55')](handleError(_0x27e7b0,null));};exports[_0x8b42('0x6f')]=function(_0x4f9b2c,_0x16758a,_0x582789){return db[_0x8b42('0x40')][_0x8b42('0x59')]({'where':{'id':_0x4f9b2c[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x16758a,null))[_0x8b42('0x1f')](function(_0x25da4e){if(_0x25da4e){return _0x25da4e['removeAnswers'](_0x4f9b2c[_0x8b42('0x46')][_0x8b42('0x6c')]);}})[_0x8b42('0x1f')](respondWithStatusCode(_0x16758a,null))[_0x8b42('0x55')](handleError(_0x16758a,null));};exports['addInteraction']=function(_0x542f08,_0x49f701,_0xa49e2b){return db['FaxInteraction']['find']({'where':{'id':_0x542f08[_0x8b42('0x61')]['id']}})['then'](handleEntityNotFound(_0x49f701,null))[_0x8b42('0x1f')](function(_0x1373cf){if(_0x1373cf){return _0x1373cf['addInteraction'](_0x542f08[_0x8b42('0x5b')][_0x8b42('0x6c')],_[_0x8b42('0x70')](_0x542f08['body'],[_0x8b42('0x6c'),'id'])||{});}})[_0x8b42('0x1f')](respondWithResult(_0x49f701,null))[_0x8b42('0x55')](handleError(_0x49f701,null));};exports[_0x8b42('0x71')]=function(_0x421aa,_0x26d9a7,_0x46421a){var _0x35e90c={'raw':![],'where':{}};var _0x100b44={};var _0x7218b3={'count':0x0,'rows':[]};return db[_0x8b42('0x40')]['findOne']({'where':{'id':_0x421aa[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x26d9a7,null))[_0x8b42('0x1f')](function(_0x570a05){if(_0x570a05){_0x100b44['model']=_['keys'](db[_0x8b42('0x72')][_0x8b42('0x57')]);_0x100b44[_0x8b42('0x46')]=_[_0x8b42('0x45')](_0x421aa[_0x8b42('0x46')]);_0x100b44[_0x8b42('0x47')]=_[_0x8b42('0x48')](_0x100b44[_0x8b42('0x44')],_0x100b44[_0x8b42('0x46')]);_0x35e90c[_0x8b42('0x49')]=_['intersection'](_0x100b44[_0x8b42('0x44')],qs[_0x8b42('0x4a')](_0x421aa[_0x8b42('0x46')]['fields']));_0x35e90c[_0x8b42('0x49')]=_0x35e90c[_0x8b42('0x49')]['length']?_0x35e90c[_0x8b42('0x49')]:_0x100b44[_0x8b42('0x44')];if(!_0x421aa[_0x8b42('0x46')]['hasOwnProperty'](_0x8b42('0x67'))){_0x35e90c[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x421aa[_0x8b42('0x46')][_0x8b42('0x2d')]);_0x35e90c[_0x8b42('0x2e')]=qs[_0x8b42('0x2e')](_0x421aa[_0x8b42('0x46')]['offset']);}_0x35e90c[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0x421aa[_0x8b42('0x46')][_0x8b42('0x4d')]);_0x35e90c[_0x8b42('0x4e')]=qs[_0x8b42('0x47')](_[_0x8b42('0x69')](_0x421aa['query'],_0x100b44[_0x8b42('0x47')]));_0x35e90c[_0x8b42('0x4e')]['FaxAccountId']=_0x570a05['id'];if(_0x421aa[_0x8b42('0x46')]['filter']){_0x35e90c['where']=_[_0x8b42('0x50')](_0x35e90c['where'],{'$or':_[_0x8b42('0x3f')](_0x35e90c[_0x8b42('0x49')],function(_0x3957ad){var _0x378b95={};_0x378b95[_0x3957ad]={'$like':'%'+_0x421aa[_0x8b42('0x46')][_0x8b42('0x4f')]+'%'};return _0x378b95;})});}_0x35e90c=_[_0x8b42('0x50')]({},_0x35e90c,_0x421aa[_0x8b42('0x51')]);return db[_0x8b42('0x72')][_0x8b42('0x2f')]({'where':_0x35e90c[_0x8b42('0x4e')]})['then'](function(_0x2b05f3){_0x7218b3[_0x8b42('0x2f')]=_0x2b05f3;if(_0x421aa[_0x8b42('0x46')][_0x8b42('0x58')]){_0x35e90c['include']=[{'model':db['CmContact'],'as':_0x8b42('0x73'),'required':![]},{'model':db[_0x8b42('0x74')],'as':_0x8b42('0x75'),'attributes':[_0x8b42('0x3b'),_0x8b42('0x76'),_0x8b42('0x77')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x8b42('0x3b'),_0x8b42('0x78')],'where':_0x421aa[_0x8b42('0x46')][_0x8b42('0x79')]?{'id':_0x421aa[_0x8b42('0x46')][_0x8b42('0x79')]}:undefined,'required':_0x421aa[_0x8b42('0x46')][_0x8b42('0x79')]?!![]:![]}];}return db[_0x8b42('0x72')][_0x8b42('0x53')](_0x35e90c);})['then'](function(_0x35cacf){_0x7218b3[_0x8b42('0x54')]=_0x35cacf;return _0x7218b3;});}})[_0x8b42('0x1f')](respondWithFilteredResult(_0x26d9a7,_0x35e90c))[_0x8b42('0x55')](handleError(_0x26d9a7,null));};exports[_0x8b42('0x7a')]=function(_0xbced19,_0x560b96){var _0x36232c=_0xbced19[_0x8b42('0x61')]['id'];var _0x1c234b=_0xbced19[_0x8b42('0x5b')];var _0x50b41c=0xc8;var _0x53f886=null;return db[_0x8b42('0x7b')][_0x8b42('0x7c')]({'isolationLevel':db[_0x8b42('0x7b')][_0x8b42('0x7d')][_0x8b42('0x7e')][_0x8b42('0x7f')]},function(_0xb8fce8){return db[_0x8b42('0x40')][_0x8b42('0x66')]({'where':{'id':_0x36232c},'transaction':_0xb8fce8})[_0x8b42('0x1f')](function(_0x41953e){if(_0x41953e){return db[_0x8b42('0x80')]['destroy']({'where':{'FaxAccountId':_0x36232c},'transaction':_0xb8fce8})[_0x8b42('0x1f')](function(){var _0x5b12fa=_[_0x8b42('0x3f')](_0x1c234b,function(_0x542730){_0x542730[_0x8b42('0x6a')]=_0x36232c;return _0x542730;});return db[_0x8b42('0x80')][_0x8b42('0x81')](_0x5b12fa,{'transaction':_0xb8fce8});});}else{_0x50b41c=0x194;_0x53f886=[];}});})['then'](function(){if(_0x50b41c!==0x194){return db['FaxApplication'][_0x8b42('0x82')]({'where':{'FaxAccountId':_0x36232c},'order':'priority'})[_0x8b42('0x1f')](function(_0x2935fe){_0x53f886=_0x2935fe;});}})[_0x8b42('0x55')](function(_0x5c52fb){_0x50b41c=0x1f4;logger[_0x8b42('0x26')](_0x5c52fb[_0x8b42('0x3a')]);if(_0x5c52fb['name']){delete _0x5c52fb[_0x8b42('0x3b')];}_0x53f886=_0x5c52fb;})['finally'](function(){if(_0x53f886===null){_0x560b96['sendStatus'](_0x50b41c);}else{if(_0x50b41c===0x1f4){_0x560b96['status'](_0x50b41c)[_0x8b42('0x3c')](_0x53f886);}else{_0x560b96[_0x8b42('0x30')](_0x50b41c)[_0x8b42('0x32')](_0x53f886);}}});};exports[_0x8b42('0x83')]=function(_0xe0214d,_0x362fef,_0x698463){var _0x39fe01={};var _0x2de45c={};var _0x369899;var _0x25c0b3;return db[_0x8b42('0x40')][_0x8b42('0x66')]({'where':{'id':_0xe0214d[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x362fef,null))[_0x8b42('0x1f')](function(_0x27794b){if(_0x27794b){_0x369899=_0x27794b;_0x2de45c[_0x8b42('0x44')]=_['keys'](db[_0x8b42('0x80')][_0x8b42('0x57')]);_0x2de45c[_0x8b42('0x46')]=_[_0x8b42('0x45')](_0xe0214d['query']);_0x2de45c['filters']=_[_0x8b42('0x48')](_0x2de45c['model'],_0x2de45c['query']);_0x39fe01[_0x8b42('0x49')]=_['intersection'](_0x2de45c['model'],qs['fields'](_0xe0214d[_0x8b42('0x46')][_0x8b42('0x4a')]));_0x39fe01[_0x8b42('0x49')]=_0x39fe01['attributes'][_0x8b42('0x4b')]?_0x39fe01['attributes']:_0x2de45c[_0x8b42('0x44')];_0x39fe01[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0xe0214d['query'][_0x8b42('0x4d')]);_0x39fe01['where']=qs[_0x8b42('0x47')](_[_0x8b42('0x69')](_0xe0214d[_0x8b42('0x46')],_0x2de45c[_0x8b42('0x47')]));if(_0xe0214d[_0x8b42('0x46')][_0x8b42('0x4f')]){_0x39fe01[_0x8b42('0x4e')]=_['merge'](_0x39fe01['where'],{'$or':_[_0x8b42('0x3f')](_0x39fe01[_0x8b42('0x49')],function(_0x3c73f8){var _0x1e538b={};_0x1e538b[_0x3c73f8]={'$like':'%'+_0xe0214d[_0x8b42('0x46')][_0x8b42('0x4f')]+'%'};return _0x1e538b;})});}_0x39fe01=_[_0x8b42('0x50')]({},_0x39fe01,_0xe0214d['options']);return _0x369899[_0x8b42('0x83')](_0x39fe01);}})[_0x8b42('0x1f')](function(_0x3ae37b){if(_0x3ae37b){_0x25c0b3=_0x3ae37b[_0x8b42('0x4b')];if(!_0xe0214d['query'][_0x8b42('0x4c')](_0x8b42('0x67'))){_0x39fe01[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0xe0214d[_0x8b42('0x46')][_0x8b42('0x2d')]);_0x39fe01[_0x8b42('0x2e')]=qs[_0x8b42('0x2e')](_0xe0214d[_0x8b42('0x46')][_0x8b42('0x2e')]);}return _0x369899[_0x8b42('0x83')](_0x39fe01);}})[_0x8b42('0x1f')](function(_0x506f13){if(_0x506f13){return _0x506f13?{'count':_0x25c0b3,'rows':_0x506f13}:null;}})[_0x8b42('0x1f')](respondWithResult(_0x362fef,null))[_0x8b42('0x55')](handleError(_0x362fef,null));};function Extension(_0x2d9a5c,_0x485714,_0x4c39a5,_0x4ebc26){this[_0x8b42('0x84')]='from-voip-provider';this[_0x8b42('0x85')]=_0x2d9a5c['localstationid'];this['app']=_0x4ebc26;this['type']=_0x8b42('0x86');this[_0x8b42('0x87')]=_0x8b42('0x88');this['FaxAccountId']=_0x2d9a5c['id'];this[_0x8b42('0x89')]=_0x485714;this['appdata']=_0x4c39a5;}function createExtensionsReciveFax(_0x412ef7){var _0x457c6b=0x1;var _0x4f5201=[];_0x4f5201[_0x8b42('0x8a')](new Extension(_0x412ef7,_0x457c6b,'',_0x8b42('0x8b')));_0x457c6b+=0x1;_0x4f5201[_0x8b42('0x8a')](new Extension(_0x412ef7,_0x457c6b,'CDR(type)=inbound-fax',_0x8b42('0x8c')));_0x457c6b+=0x1;for(var _0x3a421e in _0x412ef7){if(_0x412ef7[_0x8b42('0x4c')](_0x3a421e)&&(_0x3a421e==='ecm'||_0x3a421e==='localstationid'||_0x3a421e==='gateway'||_0x3a421e===_0x8b42('0x8d')||_0x3a421e===_0x8b42('0x8e')||_0x3a421e===_0x8b42('0x8f')||_0x3a421e===_0x8b42('0x90')||_0x3a421e===_0x8b42('0x91')||_0x3a421e===_0x8b42('0x92'))){_0x4f5201['push'](new Extension(_0x412ef7,_0x457c6b,_0x8b42('0x93')+_0x3a421e+')='+_0x412ef7[_0x3a421e],'Set'));_0x457c6b+=0x1;}}_0x4f5201[_0x8b42('0x8a')](new Extension(_0x412ef7,_0x457c6b,'6',_0x8b42('0x94')));_0x457c6b+=0x1;_0x4f5201[_0x8b42('0x8a')](new Extension(_0x412ef7,_0x457c6b,_0x8b42('0x95'),'ReceiveFax'));_0x457c6b=0x0;return _0x4f5201;}exports['addAccountApplications']=function(_0x49911e,_0x19765b,_0x3d1369){var _0x4092eb;return db[_0x8b42('0x7b')][_0x8b42('0x7c')](function(_0x177927){return db[_0x8b42('0x40')][_0x8b42('0x5a')](_0x49911e['body'],{'transaction':_0x177927})['then'](function(_0x496a4e){_0x4092eb=_0x496a4e[_0x8b42('0x37')]({'plain':!![]});return db[_0x8b42('0x96')][_0x8b42('0x81')](createExtensionsReciveFax(_0x4092eb),{'transaction':_0x177927});});})['then'](function(){return _0x4092eb;})[_0x8b42('0x1f')](respondWithResult(_0x19765b,null))['catch'](handleError(_0x19765b,null));};exports[_0x8b42('0x97')]=function(_0x366a35,_0x2eb40b,_0x3cd04a){var _0x57b899;return db[_0x8b42('0x7b')][_0x8b42('0x7c')](function(_0x10e467){return db[_0x8b42('0x40')][_0x8b42('0x98')](_0x366a35['body'],{'where':{'id':_0x366a35[_0x8b42('0x5b')]['id']},'transaction':_0x10e467})['then'](function(_0x5e900c){return db[_0x8b42('0x96')][_0x8b42('0x36')]({'where':{'FaxAccountId':_0x366a35[_0x8b42('0x5b')]['id']},'transaction':_0x10e467})[_0x8b42('0x1f')](function(_0x13a653){return db[_0x8b42('0x96')][_0x8b42('0x81')](createExtensionsReciveFax(_['omit'](_0x366a35[_0x8b42('0x5b')],[_0x8b42('0x99'),_0x8b42('0x43'),_0x8b42('0x9a'),_0x8b42('0x9b'),_0x8b42('0x9c'),_0x8b42('0x9d')])),{'transaction':_0x10e467});});});})[_0x8b42('0x1f')](function(){return db['FaxAccount'][_0x8b42('0x9e')](_0x366a35['body']['id']);})[_0x8b42('0x1f')](respondWithResult(_0x2eb40b,null))[_0x8b42('0x55')](handleError(_0x2eb40b,null));};exports[_0x8b42('0x9f')]=function(_0x13ff7a,_0x1f11c5,_0x2f8e4b){var _0x56ad4b={'raw':!![],'where':{}};var _0x47fe66={};var _0x1525a6={'count':0x0,'rows':[]};return db[_0x8b42('0x40')][_0x8b42('0x66')]({'where':{'id':_0x13ff7a[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x1f11c5,null))[_0x8b42('0x1f')](function(_0x2cf130){if(_0x2cf130){_0x47fe66['model']=_[_0x8b42('0x45')](db[_0x8b42('0xa0')]['rawAttributes']);_0x47fe66['query']=_['keys'](_0x13ff7a[_0x8b42('0x46')]);_0x47fe66[_0x8b42('0x47')]=_['intersection'](_0x47fe66[_0x8b42('0x44')],_0x47fe66[_0x8b42('0x46')]);_0x56ad4b[_0x8b42('0x49')]=_[_0x8b42('0x48')](_0x47fe66[_0x8b42('0x44')],qs[_0x8b42('0x4a')](_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x4a')]));_0x56ad4b[_0x8b42('0x49')]=_0x56ad4b[_0x8b42('0x49')][_0x8b42('0x4b')]?_0x56ad4b[_0x8b42('0x49')]:_0x47fe66[_0x8b42('0x44')];if(!_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x4c')]('nolimit')){_0x56ad4b[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x2d')]);_0x56ad4b['offset']=qs['offset'](_0x13ff7a['query']['offset']);}_0x56ad4b[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x4d')]);_0x56ad4b[_0x8b42('0x4e')]=qs[_0x8b42('0x47')](_[_0x8b42('0x69')](_0x13ff7a[_0x8b42('0x46')],_0x47fe66[_0x8b42('0x47')]));_0x56ad4b[_0x8b42('0x4e')]['FaxAccountId']=_0x2cf130['id'];if(_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x4f')]){_0x56ad4b[_0x8b42('0x4e')]=_[_0x8b42('0x50')](_0x56ad4b[_0x8b42('0x4e')],{'$or':_[_0x8b42('0x3f')](_0x56ad4b[_0x8b42('0x49')],function(_0x1d35eb){var _0x43673b={};_0x43673b[_0x1d35eb]={'$like':'%'+_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x4f')]+'%'};return _0x43673b;})});}if(_0x13ff7a[_0x8b42('0x46')][_0x8b42('0xa1')]){var _0x541d4d=_0x13ff7a[_0x8b42('0x46')][_0x8b42('0xa1')][_0x8b42('0xa2')](',');var _0x578443={};_0x578443[_0x541d4d[0x0]]={'$gte':moment(_0x541d4d[0x1])[_0x8b42('0xa3')](_0x8b42('0xa4'))};_0x56ad4b[_0x8b42('0x4e')]=_[_0x8b42('0x50')](_0x56ad4b['where'],_0x578443);}_0x56ad4b=_[_0x8b42('0x50')]({},_0x56ad4b,_0x13ff7a[_0x8b42('0x51')]);return db[_0x8b42('0xa0')][_0x8b42('0x2f')]({'where':_0x56ad4b[_0x8b42('0x4e')]})[_0x8b42('0x1f')](function(_0x555941){_0x1525a6[_0x8b42('0x2f')]=_0x555941;if(_0x13ff7a[_0x8b42('0x46')][_0x8b42('0x58')]){_0x56ad4b[_0x8b42('0x52')]=[{'all':!![]}];}return db[_0x8b42('0xa0')][_0x8b42('0x53')](_0x56ad4b);})['then'](function(_0x308490){_0x1525a6[_0x8b42('0x54')]=_0x308490;return _0x1525a6;});}})[_0x8b42('0x1f')](respondWithFilteredResult(_0x1f11c5,_0x56ad4b))[_0x8b42('0x55')](handleError(_0x1f11c5,null));};exports[_0x8b42('0x3c')]=function(_0x7ae205,_0x4a5736,_0x24e1ac){var _0x4f4282,_0x6a7e5f={},_0x10166f;if(_0x7ae205[_0x8b42('0x5b')]['to']){_0x10166f=_0x7ae205[_0x8b42('0x5b')]['to'][0x0];}return db[_0x8b42('0x40')][_0x8b42('0x59')]({'where':{'id':_0x7ae205[_0x8b42('0x61')]['id']},'include':[{'model':db[_0x8b42('0xa5')],'as':_0x8b42('0xa6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x10166f},'limit':0x1,'order':[[_0x8b42('0x9b'),'DESC']]}]}]})[_0x8b42('0x1f')](handleEntityNotFound(_0x4a5736,null))[_0x8b42('0x1f')](function(_0x26d753){_0x4f4282=_0x26d753;if(_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')]&&_0x7ae205['body'][_0x8b42('0xa7')][_0x8b42('0x4b')]){for(var _0x1412c6=0x0;_0x1412c6<_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][_0x8b42('0x4b')];_0x1412c6+=0x1){_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][_0x1412c6]={'filename':_0x7ae205['body']['attachments'][_0x1412c6]['name'],'id':_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][_0x1412c6]['id'],'path':path[_0x8b42('0xa8')](config[_0x8b42('0xa9')],'server/files/attachments',_0x7ae205['body'][_0x8b42('0xa7')][_0x1412c6][_0x8b42('0xaa')])};}}return respondWithRpcPromise(_0x8b42('0xab'),_0x8b42('0xab'),{'FaxAccountId':_[_0x8b42('0xac')](_0x7ae205[_0x8b42('0x61')]['id'])?undefined:_0x7ae205[_0x8b42('0x61')]['id'],'path':_[_0x8b42('0xac')](_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0][_0x8b42('0xad')])?undefined:_0x7ae205[_0x8b42('0x5b')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x7ae205[_0x8b42('0x5b')]['to'][0x0])?undefined:_0x7ae205[_0x8b42('0x5b')]['to'][0x0]},client9002);})[_0x8b42('0x1f')](function(){if(_0x4f4282){if(_[_0x8b42('0xac')](_0x7ae205['body'][_0x8b42('0xae')])){_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xae')]=util[_0x8b42('0xa3')](_0x8b42('0xaf'),_0x4f4282['name'],_0x4f4282[_0x8b42('0xb0')]);}if(_0x4f4282['List']){if(_0x4f4282[_0x8b42('0xa6')][_0x8b42('0xb1')]['length']){return _0x4f4282[_0x8b42('0xa6')][_0x8b42('0xb1')][0x0];}else{return db['CmContact'][_0x8b42('0x5a')](_[_0x8b42('0x17')](_0x7ae205['body'],{'firstName':_0x7ae205[_0x8b42('0x5b')]['to'][0x0],'phone':_0x7ae205['body']['to'][0x0],'fax':_0x7ae205[_0x8b42('0x5b')]['to'][0x0],'ListId':_0x4f4282['ListId']}));}}else{throw new Error(_0x8b42('0xb2'));}}else{throw new Error(_0x8b42('0xb3'));}})[_0x8b42('0x1f')](function(_0x224e7c){if(_0x224e7c){return db[_0x8b42('0x72')]['find']({'where':{'ContactId':_0x224e7c['id'],'closed':![],'FaxAccountId':_0x4f4282['id']}})[_0x8b42('0x1f')](function(_0x5f9ee4){if(_0x5f9ee4){return[_0x5f9ee4,![]];}return db['FaxInteraction'][_0x8b42('0x5a')]({'UserId':_0x7ae205[_0x8b42('0x5c')]['id'],'ContactId':_0x224e7c['id'],'FaxAccountId':_0x4f4282['id'],'fax':_0x7ae205[_0x8b42('0x5b')]['to'][0x0],'firstMsgDirection':_0x8b42('0xb4'),'Messages':[_['merge'](_0x7ae205[_0x8b42('0x5b')],{'read':![],'body':_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0][_0x8b42('0xb5')],'FaxAccountId':_0x4f4282['id'],'UserId':_0x7ae205[_0x8b42('0x5c')]['id'],'ContactId':_0x224e7c['id'],'AttachmentId':_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x8b42('0xa0')],'as':_0x8b42('0xb6')}]})[_0x8b42('0x1f')](function(_0x25a033){return[_0x25a033,!![]];});});}else{throw new Error(_0x8b42('0xb7'));}})[_0x8b42('0xb8')](function(_0x337b9c,_0x5c7fe2){if(_0x5c7fe2){return _0x337b9c;}return db[_0x8b42('0xa0')][_0x8b42('0x5a')]({'direction':_0x8b42('0xb4'),'read':![],'body':_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0][_0x8b42('0xb5')],'FaxAccountId':_0x4f4282['id'],'FaxInteractionId':_0x337b9c['id'],'UserId':_0x7ae205[_0x8b42('0x5c')]['id'],'ContactId':_0x337b9c['ContactId'],'AttachmentId':_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0]['id']})[_0x8b42('0x1f')](function(_0x3b21ed){_0x337b9c[_0x8b42('0xb9')]['Messages']=[];_0x337b9c[_0x8b42('0xb9')][_0x8b42('0xb6')][_0x8b42('0x8a')](_0x3b21ed[_0x8b42('0xb9')]);return _0x337b9c;});})['then'](function(_0x2edc58){respondWithRpcPromise('SendFax',_0x8b42('0xba'),{'FaxAccountId':_[_0x8b42('0xac')](_0x7ae205['params']['id'])?undefined:_0x7ae205[_0x8b42('0x61')]['id'],'path':_[_0x8b42('0xac')](_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0]['path'])?undefined:_0x7ae205[_0x8b42('0x5b')][_0x8b42('0xa7')][0x0]['path'],'fax':_[_0x8b42('0xac')](_0x7ae205['body']['to'][0x0])?undefined:_0x7ae205['body']['to'][0x0],'AttachmentId':_0x7ae205[_0x8b42('0x5b')]['attachments'][0x0]['id']},client9002)[_0x8b42('0x1f')](function(_0x18851b){logger[_0x8b42('0x20')]('SendFaxRpc,\x20%s',_0x18851b);})[_0x8b42('0x55')](function(_0x56e402){logger[_0x8b42('0x20')](_0x8b42('0xbb'),_0x56e402);});return _0x2edc58;})[_0x8b42('0x1f')](respondWithResult(_0x4a5736,null))['catch'](handleError(_0x4a5736,null));};exports[_0x8b42('0xbc')]=function(_0x4e3801,_0x3e88ea,_0x386c25){return db[_0x8b42('0x40')][_0x8b42('0x59')]({'where':{'id':_0x4e3801[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x3e88ea,null))[_0x8b42('0x1f')](function(_0x38807a){if(_0x38807a){return _0x38807a[_0x8b42('0xbc')](_0x4e3801[_0x8b42('0x5b')][_0x8b42('0x6c')],_['omit'](_0x4e3801['body'],[_0x8b42('0x6c'),'id'])||{})[_0x8b42('0xb8')](function(_0x4558f6){for(var _0x341bad=0x0;_0x341bad<_0x4e3801['body'][_0x8b42('0x6c')][_0x8b42('0x4b')];_0x341bad+=0x1){socket[_0x8b42('0xbd')](_0x8b42('0xbe'),{'UserId':Number(_0x4e3801[_0x8b42('0x5b')][_0x8b42('0x6c')][_0x341bad]),'FaxAccountId':Number(_0x4e3801['params']['id'])});}return _0x4558f6;});}})['then'](respondWithResult(_0x3e88ea,null))['catch'](handleError(_0x3e88ea,null));};exports['removeAgents']=function(_0x47b98a,_0x55e808,_0x1ece8c){return db['FaxAccount'][_0x8b42('0x59')]({'where':{'id':_0x47b98a[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x55e808,null))[_0x8b42('0x1f')](function(_0x9bd15e){if(_0x9bd15e){return _0x9bd15e[_0x8b42('0xbf')](_0x47b98a[_0x8b42('0x46')]['ids'])[_0x8b42('0x1f')](function(){if(_[_0x8b42('0xc0')](_0x47b98a['query'][_0x8b42('0x6c')])){for(var _0x53fc1a=0x0;_0x53fc1a<_0x47b98a[_0x8b42('0x46')][_0x8b42('0x6c')]['length'];_0x53fc1a+=0x1){socket['emit'](_0x8b42('0xc1'),{'UserId':Number(_0x47b98a[_0x8b42('0x46')][_0x8b42('0x6c')][_0x53fc1a]),'FaxAccountId':Number(_0x47b98a['params']['id'])});}}else{socket['emit'](_0x8b42('0xc1'),{'UserId':Number(_0x47b98a[_0x8b42('0x46')]['ids']),'FaxAccountId':Number(_0x47b98a['params']['id'])});}});}})[_0x8b42('0x1f')](respondWithStatusCode(_0x55e808,null))[_0x8b42('0x55')](handleError(_0x55e808,null));};exports[_0x8b42('0xc2')]=function(_0x41e9c2,_0x19d15d,_0x3ac487){var _0x3fc147={};var _0x466c48={};var _0x5e8916;var _0x5a4f64;return db[_0x8b42('0x40')][_0x8b42('0x66')]({'where':{'id':_0x41e9c2[_0x8b42('0x61')]['id']}})[_0x8b42('0x1f')](handleEntityNotFound(_0x19d15d,null))[_0x8b42('0x1f')](function(_0x46da8d){if(_0x46da8d){_0x5e8916=_0x46da8d;_0x466c48[_0x8b42('0x44')]=_[_0x8b42('0x45')](db[_0x8b42('0x74')][_0x8b42('0x57')]);_0x466c48['query']=_[_0x8b42('0x45')](_0x41e9c2[_0x8b42('0x46')]);_0x466c48[_0x8b42('0x47')]=_[_0x8b42('0x48')](_0x466c48['model'],_0x466c48['query']);_0x3fc147[_0x8b42('0x49')]=_['intersection'](_0x466c48[_0x8b42('0x44')],qs['fields'](_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x4a')]));_0x3fc147[_0x8b42('0x49')]=_0x3fc147[_0x8b42('0x49')][_0x8b42('0x4b')]?_0x3fc147['attributes']:_0x466c48['model'];_0x3fc147[_0x8b42('0x68')]=qs[_0x8b42('0x4d')](_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x4d')]);_0x3fc147['where']=qs[_0x8b42('0x47')](_[_0x8b42('0x69')](_0x41e9c2[_0x8b42('0x46')],_0x466c48[_0x8b42('0x47')]));if(_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x4f')]){_0x3fc147[_0x8b42('0x4e')]=_[_0x8b42('0x50')](_0x3fc147[_0x8b42('0x4e')],{'$or':_[_0x8b42('0x3f')](_0x3fc147[_0x8b42('0x49')],function(_0x7cd2bf){var _0x206f25={};_0x206f25[_0x7cd2bf]={'$like':'%'+_0x41e9c2[_0x8b42('0x46')]['filter']+'%'};return _0x206f25;})});}_0x3fc147=_[_0x8b42('0x50')]({},_0x3fc147,_0x41e9c2[_0x8b42('0x51')]);return _0x5e8916[_0x8b42('0xc2')](_0x3fc147);}})[_0x8b42('0x1f')](function(_0x281692){if(_0x281692){_0x5a4f64=_0x281692[_0x8b42('0x4b')];if(!_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x4c')](_0x8b42('0x67'))){_0x3fc147[_0x8b42('0x2d')]=qs[_0x8b42('0x2d')](_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x2d')]);_0x3fc147[_0x8b42('0x2e')]=qs['offset'](_0x41e9c2[_0x8b42('0x46')][_0x8b42('0x2e')]);}return _0x5e8916[_0x8b42('0xc2')](_0x3fc147);}})[_0x8b42('0x1f')](function(_0x10c70f){if(_0x10c70f){return _0x10c70f?{'count':_0x5a4f64,'rows':_0x10c70f}:null;}})[_0x8b42('0x1f')](respondWithResult(_0x19d15d,null))[_0x8b42('0x55')](handleError(_0x19d15d,null));}; \ No newline at end of file +var _0x1d74=['send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','name','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','show','params','Pause','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','stack','finally','getApplications','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Set','/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','get','VoiceExtension','bulkCreate','updateAccountApplications','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmContact','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','ListId','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','end'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x1d74,0x153));var _0x41d7=function(_0x1f6be7,_0x36d37d){_0x1f6be7=_0x1f6be7-0x0;var _0x1edcde=_0x1d74[_0x1f6be7];return _0x1edcde;};'use strict';var emlformat=require(_0x41d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x41d7('0x1'));var rp=require(_0x41d7('0x2'));var moment=require(_0x41d7('0x3'));var BPromise=require(_0x41d7('0x4'));var Mustache=require(_0x41d7('0x5'));var util=require('util');var path=require(_0x41d7('0x6'));var sox=require(_0x41d7('0x7'));var csv=require(_0x41d7('0x8'));var ejs=require(_0x41d7('0x9'));var fs=require('fs');var fs_extra=require(_0x41d7('0xa'));var _=require(_0x41d7('0xb'));var squel=require(_0x41d7('0xc'));var crypto=require(_0x41d7('0xd'));var jsforce=require(_0x41d7('0xe'));var deskjs=require(_0x41d7('0xf'));var toCsv=require(_0x41d7('0x8'));var querystring=require('querystring');var Papa=require(_0x41d7('0x10'));var Redis=require(_0x41d7('0x11'));var authService=require(_0x41d7('0x12'));var qs=require(_0x41d7('0x13'));var as=require(_0x41d7('0x14'));var hardwareService=require(_0x41d7('0x15'));var logger=require(_0x41d7('0x16'))(_0x41d7('0x17'));var utils=require(_0x41d7('0x18'));var config=require(_0x41d7('0x19'));var licenseUtil=require(_0x41d7('0x1a'));var db=require(_0x41d7('0x1b'))['db'];config['redis']=_[_0x41d7('0x1c')](config[_0x41d7('0x1d')],{'host':_0x41d7('0x1e'),'port':0x18eb});var socket=require(_0x41d7('0x1f'))(new Redis(config[_0x41d7('0x1d')]));require(_0x41d7('0x20'))[_0x41d7('0x21')](socket);var jayson=require(_0x41d7('0x22'));var client=jayson[_0x41d7('0x23')][_0x41d7('0x24')]({'port':0x232c});var client9002=jayson[_0x41d7('0x23')][_0x41d7('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x2dedf6,_0x470737,_0x3d35fc,_0x462df8){return new BPromise(function(_0x327633,_0x3975f3){var _0x255213=_0x462df8||client;return _0x255213[_0x41d7('0x25')](_0x2dedf6,_0x3d35fc)[_0x41d7('0x26')](function(_0x4a2f1b){logger['info'](_0x41d7('0x27'),_0x470737,_0x41d7('0x28'));logger[_0x41d7('0x29')](_0x41d7('0x2a'),_0x470737,_0x41d7('0x28'),JSON[_0x41d7('0x2b')](_0x4a2f1b));if(_0x4a2f1b[_0x41d7('0x2c')]){if(_0x4a2f1b[_0x41d7('0x2c')]['code']===0x1f4){logger[_0x41d7('0x2c')](_0x41d7('0x27'),_0x470737,_0x4a2f1b[_0x41d7('0x2c')][_0x41d7('0x2d')]);return _0x3975f3(_0x4a2f1b['error'][_0x41d7('0x2d')]);}logger[_0x41d7('0x2c')](_0x41d7('0x27'),_0x470737,_0x4a2f1b[_0x41d7('0x2c')]['message']);return _0x327633(_0x4a2f1b[_0x41d7('0x2c')][_0x41d7('0x2d')]);}else{logger[_0x41d7('0x2e')](_0x41d7('0x27'),_0x470737,_0x41d7('0x28'));_0x327633(_0x4a2f1b[_0x41d7('0x2f')][_0x41d7('0x2d')]);}})[_0x41d7('0x30')](function(_0x117311){logger[_0x41d7('0x2c')](_0x41d7('0x27'),_0x470737,_0x117311);_0x3975f3(_0x117311);});});}function respondWithStatusCode(_0x662dd9,_0x5b2ef4){_0x5b2ef4=_0x5b2ef4||0xcc;return function(_0x5aa588){if(_0x5aa588){return _0x662dd9[_0x41d7('0x31')](_0x5b2ef4);}return _0x662dd9['status'](_0x5b2ef4)['end']();};}function respondWithResult(_0x37be2c,_0x352691){_0x352691=_0x352691||0xc8;return function(_0x494490){if(_0x494490){return _0x37be2c[_0x41d7('0x32')](_0x352691)[_0x41d7('0x33')](_0x494490);}};}function respondWithFilteredResult(_0x3bfa55,_0x2e9eb4){return function(_0x4e6bf4){if(_0x4e6bf4){var _0x91d0d0=typeof _0x2e9eb4['offset']===_0x41d7('0x34')&&typeof _0x2e9eb4['limit']===_0x41d7('0x34');var _0x3413c0=_0x4e6bf4['count'];var _0xf80561=_0x91d0d0?0x0:_0x2e9eb4[_0x41d7('0x35')];var _0x2db755=_0x91d0d0?_0x4e6bf4[_0x41d7('0x36')]:_0x2e9eb4[_0x41d7('0x35')]+_0x2e9eb4[_0x41d7('0x37')];var _0x23c3d6;if(_0x2db755>=_0x3413c0){_0x2db755=_0x3413c0;_0x23c3d6=0xc8;}else{_0x23c3d6=0xce;}_0x3bfa55[_0x41d7('0x32')](_0x23c3d6);return _0x3bfa55['set'](_0x41d7('0x38'),_0xf80561+'-'+_0x2db755+'/'+_0x3413c0)[_0x41d7('0x33')](_0x4e6bf4);}return null;};}function patchUpdates(_0x23f149){return function(_0x465302){try{jsonpatch[_0x41d7('0x39')](_0x465302,_0x23f149,!![]);}catch(_0x115ef5){return BPromise[_0x41d7('0x3a')](_0x115ef5);}return _0x465302[_0x41d7('0x3b')]();};}function saveUpdates(_0x2e3959,_0x1f1e4a){return function(_0x468cfd){if(_0x468cfd){return _0x468cfd[_0x41d7('0x3c')](_0x2e3959)[_0x41d7('0x26')](function(_0x2b7903){return _0x2b7903;});}return null;};}function removeEntity(_0xebf23,_0x2657bb){return function(_0x41f152){if(_0x41f152){return _0x41f152[_0x41d7('0x3d')]()['then'](function(){var _0x54111d=_0x41f152['get']({'plain':!![]});var _0x235f17=_0x41d7('0x3e');return db[_0x41d7('0x3f')][_0x41d7('0x3d')]({'where':{'type':_0x235f17,'resourceId':_0x54111d['id']}})[_0x41d7('0x26')](function(){return _0x41f152;});})[_0x41d7('0x26')](function(){_0xebf23[_0x41d7('0x32')](0xcc)[_0x41d7('0x40')]();});}};}function handleEntityNotFound(_0x1f000c,_0x5bddd5){return function(_0x454ad8){if(!_0x454ad8){_0x1f000c[_0x41d7('0x31')](0x194);}return _0x454ad8;};}function handleError(_0x178dae,_0x24466d){_0x24466d=_0x24466d||0x1f4;return function(_0x1491d0){logger[_0x41d7('0x2c')](_0x1491d0['stack']);if(_0x1491d0['name']){delete _0x1491d0['name'];}_0x178dae[_0x41d7('0x32')](_0x24466d)[_0x41d7('0x41')](_0x1491d0);};}exports[_0x41d7('0x42')]=function(_0x48747e,_0xf69ac7){var _0x30d865={'include':[{'model':db['Pause'],'as':_0x41d7('0x43')}]},_0x579f12={},_0x9547a6={'count':0x0,'rows':[]};var _0x50660e=_[_0x41d7('0x44')](db[_0x41d7('0x45')]['rawAttributes'],function(_0xf09a15){return{'name':_0xf09a15[_0x41d7('0x46')],'type':_0xf09a15[_0x41d7('0x47')][_0x41d7('0x48')]};});_0x579f12['model']=_[_0x41d7('0x44')](_0x50660e,_0x41d7('0x49'));_0x579f12['query']=_[_0x41d7('0x4a')](_0x48747e[_0x41d7('0x4b')]);_0x579f12['filters']=_['intersection'](_0x579f12[_0x41d7('0x4c')],_0x579f12[_0x41d7('0x4b')]);_0x30d865[_0x41d7('0x4d')]=_[_0x41d7('0x4e')](_0x579f12[_0x41d7('0x4c')],qs[_0x41d7('0x4f')](_0x48747e[_0x41d7('0x4b')][_0x41d7('0x4f')]));_0x30d865[_0x41d7('0x4d')]=_0x30d865[_0x41d7('0x4d')]['length']?_0x30d865['attributes']:_0x579f12['model'];if(!_0x48747e[_0x41d7('0x4b')][_0x41d7('0x50')](_0x41d7('0x51'))){_0x30d865[_0x41d7('0x37')]=qs[_0x41d7('0x37')](_0x48747e[_0x41d7('0x4b')][_0x41d7('0x37')]);_0x30d865[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x48747e[_0x41d7('0x4b')][_0x41d7('0x35')]);}_0x30d865[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x48747e[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x30d865['where']=qs['filters'](_['pick'](_0x48747e[_0x41d7('0x4b')],_0x579f12[_0x41d7('0x54')]),_0x50660e);if(_0x48747e[_0x41d7('0x4b')][_0x41d7('0x55')]){_0x30d865[_0x41d7('0x56')]=_[_0x41d7('0x57')](_0x30d865['where'],{'$or':_[_0x41d7('0x44')](_0x50660e,function(_0x36926e){if(_0x36926e['type']!==_0x41d7('0x58')){var _0x5f3d1b={};_0x5f3d1b[_0x36926e[_0x41d7('0x49')]]={'$like':'%'+_0x48747e[_0x41d7('0x4b')][_0x41d7('0x55')]+'%'};return _0x5f3d1b;}})});}_0x30d865=_[_0x41d7('0x57')]({},_0x30d865,_0x48747e[_0x41d7('0x59')]);var _0x381f7b={'where':_0x30d865['where']};return db[_0x41d7('0x45')][_0x41d7('0x36')](_0x381f7b)[_0x41d7('0x26')](function(_0x5c8383){_0x9547a6[_0x41d7('0x36')]=_0x5c8383;if(_0x48747e[_0x41d7('0x4b')]['includeAll']){_0x30d865[_0x41d7('0x5a')]=[{'all':!![]}];}return db[_0x41d7('0x45')][_0x41d7('0x5b')](_0x30d865);})['then'](function(_0x3a7a3a){_0x9547a6['rows']=_0x3a7a3a;return _0x9547a6;})[_0x41d7('0x26')](respondWithFilteredResult(_0xf69ac7,_0x30d865))[_0x41d7('0x30')](handleError(_0xf69ac7,null));};exports[_0x41d7('0x5c')]=function(_0x57a013,_0x3db878){var _0x24ddb4={'raw':![],'where':{'id':_0x57a013[_0x41d7('0x5d')]['id']},'include':[{'model':db[_0x41d7('0x5e')],'as':'mandatoryDispositionPause'}]},_0xbfdfae={};_0xbfdfae[_0x41d7('0x4c')]=_[_0x41d7('0x4a')](db[_0x41d7('0x45')]['rawAttributes']);_0xbfdfae[_0x41d7('0x4b')]=_['keys'](_0x57a013[_0x41d7('0x4b')]);_0xbfdfae[_0x41d7('0x54')]=_[_0x41d7('0x4e')](_0xbfdfae[_0x41d7('0x4c')],_0xbfdfae[_0x41d7('0x4b')]);_0x24ddb4[_0x41d7('0x4d')]=_[_0x41d7('0x4e')](_0xbfdfae[_0x41d7('0x4c')],qs[_0x41d7('0x4f')](_0x57a013[_0x41d7('0x4b')]['fields']));_0x24ddb4[_0x41d7('0x4d')]=_0x24ddb4[_0x41d7('0x4d')][_0x41d7('0x5f')]?_0x24ddb4['attributes']:_0xbfdfae['model'];if(_0x57a013[_0x41d7('0x4b')][_0x41d7('0x60')]){_0x24ddb4[_0x41d7('0x5a')]=[{'all':!![]}];}_0x24ddb4=_[_0x41d7('0x57')]({},_0x24ddb4,_0x57a013[_0x41d7('0x59')]);return db[_0x41d7('0x45')][_0x41d7('0x61')](_0x24ddb4)[_0x41d7('0x26')](handleEntityNotFound(_0x3db878,null))[_0x41d7('0x26')](respondWithResult(_0x3db878,null))[_0x41d7('0x30')](handleError(_0x3db878,null));};exports[_0x41d7('0x62')]=function(_0x46f734,_0x45175b){return db['FaxAccount'][_0x41d7('0x62')](_0x46f734[_0x41d7('0x63')],{})[_0x41d7('0x26')](function(_0x127a58){var _0xcae197=_0x46f734[_0x41d7('0x64')]['get']({'plain':!![]});if(!_0xcae197)throw new Error(_0x41d7('0x65'));if(_0xcae197[_0x41d7('0x66')]===_0x41d7('0x64')){var _0x8dbd4b=_0x127a58['get']({'plain':!![]});var _0xd8add8='FaxAccounts';return db[_0x41d7('0x67')]['find']({'where':{'name':_0xd8add8,'userProfileId':_0xcae197[_0x41d7('0x68')]},'raw':!![]})[_0x41d7('0x26')](function(_0x28476c){if(_0x28476c&&_0x28476c[_0x41d7('0x69')]===0x0){return db[_0x41d7('0x3f')][_0x41d7('0x62')]({'name':_0x8dbd4b[_0x41d7('0x49')],'resourceId':_0x8dbd4b['id'],'type':_0x28476c['name'],'sectionId':_0x28476c['id']},{})[_0x41d7('0x26')](function(){return _0x127a58;});}else{return _0x127a58;}})['catch'](function(_0x3a2b39){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a2b39);throw _0x3a2b39;});}return _0x127a58;})['then'](respondWithResult(_0x45175b,0xc9))[_0x41d7('0x30')](handleError(_0x45175b,null));};exports['update']=function(_0x4f5d7a,_0x106362){if(_0x4f5d7a[_0x41d7('0x63')]['id']){delete _0x4f5d7a[_0x41d7('0x63')]['id'];}return db[_0x41d7('0x45')]['find']({'where':{'id':_0x4f5d7a[_0x41d7('0x5d')]['id']},'include':[{'model':db[_0x41d7('0x5e')],'as':'mandatoryDispositionPause'}]})[_0x41d7('0x26')](handleEntityNotFound(_0x106362,null))[_0x41d7('0x26')](saveUpdates(_0x4f5d7a[_0x41d7('0x63')],null))[_0x41d7('0x26')](respondWithResult(_0x106362,null))['catch'](handleError(_0x106362,null));};exports['destroy']=function(_0x2985cb,_0x4c8a90){return db[_0x41d7('0x45')]['find']({'where':{'id':_0x2985cb[_0x41d7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4c8a90,null))['then'](removeEntity(_0x4c8a90,null))['catch'](handleError(_0x4c8a90,null));};exports[_0x41d7('0x6a')]=function(_0x46c7a2,_0x3e8975){return db['FaxAccount'][_0x41d7('0x6a')]()['then'](respondWithResult(_0x3e8975,null))[_0x41d7('0x30')](handleError(_0x3e8975,null));};exports['addDisposition']=function(_0x1f8034,_0x29eb8e,_0x20aaf6){if(_0x1f8034['body']['id']){delete _0x1f8034[_0x41d7('0x63')]['id'];}return db[_0x41d7('0x45')]['find']({'where':{'id':_0x1f8034['params']['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x29eb8e,null))[_0x41d7('0x26')](function(_0x20d91b){if(_0x20d91b){_0x1f8034['body'][_0x41d7('0x6b')]=_0x20d91b['id'];return db[_0x41d7('0x6c')][_0x41d7('0x62')](_0x1f8034[_0x41d7('0x63')]);}})['then'](respondWithResult(_0x29eb8e,null))[_0x41d7('0x30')](handleError(_0x29eb8e,null));};exports[_0x41d7('0x6d')]=function(_0x396a53,_0x11ae13,_0x1c126e){var _0x31485f={'raw':![],'where':{}};var _0x31889c={};var _0x8acbba={'count':0x0,'rows':[]};return db['FaxAccount'][_0x41d7('0x6e')]({'where':{'id':_0x396a53[_0x41d7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x11ae13,null))[_0x41d7('0x26')](function(_0x3f939e){if(_0x3f939e){_0x31889c['model']=_['keys'](db['Disposition'][_0x41d7('0x6f')]);_0x31889c[_0x41d7('0x4b')]=_[_0x41d7('0x4a')](_0x396a53[_0x41d7('0x4b')]);_0x31889c['filters']=_[_0x41d7('0x4e')](_0x31889c['model'],_0x31889c[_0x41d7('0x4b')]);_0x31485f[_0x41d7('0x4d')]=_[_0x41d7('0x4e')](_0x31889c['model'],qs[_0x41d7('0x4f')](_0x396a53[_0x41d7('0x4b')][_0x41d7('0x4f')]));_0x31485f[_0x41d7('0x4d')]=_0x31485f[_0x41d7('0x4d')][_0x41d7('0x5f')]?_0x31485f[_0x41d7('0x4d')]:_0x31889c[_0x41d7('0x4c')];if(!_0x396a53[_0x41d7('0x4b')][_0x41d7('0x50')](_0x41d7('0x51'))){_0x31485f['limit']=qs[_0x41d7('0x37')](_0x396a53[_0x41d7('0x4b')]['limit']);_0x31485f[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x396a53[_0x41d7('0x4b')]['offset']);}_0x31485f[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x396a53[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x31485f['where']=qs[_0x41d7('0x54')](_[_0x41d7('0x70')](_0x396a53[_0x41d7('0x4b')],_0x31889c['filters']));_0x31485f[_0x41d7('0x56')][_0x41d7('0x6b')]=_0x3f939e['id'];if(_0x396a53['query'][_0x41d7('0x55')]){_0x31485f[_0x41d7('0x56')]=_[_0x41d7('0x57')](_0x31485f[_0x41d7('0x56')],{'$or':_[_0x41d7('0x44')](_0x31485f[_0x41d7('0x4d')],function(_0x564c5f){var _0x5c1f02={};_0x5c1f02[_0x564c5f]={'$like':'%'+_0x396a53['query'][_0x41d7('0x55')]+'%'};return _0x5c1f02;})});}_0x31485f=_['merge']({},_0x31485f,_0x396a53['options']);return db[_0x41d7('0x6c')][_0x41d7('0x36')]({'where':_0x31485f[_0x41d7('0x56')]})[_0x41d7('0x26')](function(_0x4e8320){_0x8acbba[_0x41d7('0x36')]=_0x4e8320;if(_0x396a53[_0x41d7('0x4b')][_0x41d7('0x60')]){_0x31485f[_0x41d7('0x5a')]=[{'all':!![]}];}return db[_0x41d7('0x6c')][_0x41d7('0x5b')](_0x31485f);})[_0x41d7('0x26')](function(_0x216372){_0x8acbba['rows']=_0x216372;return _0x8acbba;});}})[_0x41d7('0x26')](respondWithFilteredResult(_0x11ae13,_0x31485f))[_0x41d7('0x30')](handleError(_0x11ae13,null));};exports[_0x41d7('0x71')]=function(_0x1a3539,_0x1f4638,_0x46f5ac){return db['FaxAccount']['find']({'where':{'id':_0x1a3539[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x1f4638,null))['then'](function(_0xd1005f){if(_0xd1005f){return _0xd1005f[_0x41d7('0x71')](_0x1a3539[_0x41d7('0x4b')][_0x41d7('0x72')]);}})[_0x41d7('0x26')](respondWithStatusCode(_0x1f4638,null))['catch'](handleError(_0x1f4638,null));};exports[_0x41d7('0x73')]=function(_0x594fa8,_0x2776ff,_0x2c8a9a){if(_0x594fa8[_0x41d7('0x63')]['id']){delete _0x594fa8[_0x41d7('0x63')]['id'];}return db[_0x41d7('0x45')][_0x41d7('0x61')]({'where':{'id':_0x594fa8[_0x41d7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2776ff,null))['then'](function(_0x26bf6a){if(_0x26bf6a){_0x594fa8[_0x41d7('0x63')][_0x41d7('0x6b')]=_0x26bf6a['id'];return db[_0x41d7('0x74')][_0x41d7('0x62')](_0x594fa8[_0x41d7('0x63')]);}})[_0x41d7('0x26')](respondWithResult(_0x2776ff,null))[_0x41d7('0x30')](handleError(_0x2776ff,null));};exports[_0x41d7('0x75')]=function(_0x1088c8,_0x55ba10,_0x561926){var _0x5298a6={'raw':![],'where':{}};var _0x98ffe4={};var _0x1c8592={'count':0x0,'rows':[]};return db[_0x41d7('0x45')][_0x41d7('0x6e')]({'where':{'id':_0x1088c8[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x55ba10,null))[_0x41d7('0x26')](function(_0xe4a507){if(_0xe4a507){_0x98ffe4['model']=_[_0x41d7('0x4a')](db['CannedAnswer']['rawAttributes']);_0x98ffe4[_0x41d7('0x4b')]=_[_0x41d7('0x4a')](_0x1088c8['query']);_0x98ffe4[_0x41d7('0x54')]=_[_0x41d7('0x4e')](_0x98ffe4[_0x41d7('0x4c')],_0x98ffe4[_0x41d7('0x4b')]);_0x5298a6['attributes']=_[_0x41d7('0x4e')](_0x98ffe4[_0x41d7('0x4c')],qs[_0x41d7('0x4f')](_0x1088c8['query']['fields']));_0x5298a6[_0x41d7('0x4d')]=_0x5298a6[_0x41d7('0x4d')][_0x41d7('0x5f')]?_0x5298a6[_0x41d7('0x4d')]:_0x98ffe4[_0x41d7('0x4c')];if(!_0x1088c8[_0x41d7('0x4b')][_0x41d7('0x50')](_0x41d7('0x51'))){_0x5298a6[_0x41d7('0x37')]=qs[_0x41d7('0x37')](_0x1088c8['query'][_0x41d7('0x37')]);_0x5298a6[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x1088c8['query']['offset']);}_0x5298a6['order']=qs['sort'](_0x1088c8[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x5298a6[_0x41d7('0x56')]=qs[_0x41d7('0x54')](_[_0x41d7('0x70')](_0x1088c8[_0x41d7('0x4b')],_0x98ffe4[_0x41d7('0x54')]));_0x5298a6[_0x41d7('0x56')][_0x41d7('0x6b')]=_0xe4a507['id'];if(_0x1088c8[_0x41d7('0x4b')][_0x41d7('0x55')]){_0x5298a6['where']=_[_0x41d7('0x57')](_0x5298a6[_0x41d7('0x56')],{'$or':_[_0x41d7('0x44')](_0x5298a6[_0x41d7('0x4d')],function(_0x39b76d){var _0x2c7c16={};_0x2c7c16[_0x39b76d]={'$like':'%'+_0x1088c8[_0x41d7('0x4b')][_0x41d7('0x55')]+'%'};return _0x2c7c16;})});}_0x5298a6=_[_0x41d7('0x57')]({},_0x5298a6,_0x1088c8[_0x41d7('0x59')]);return db[_0x41d7('0x74')]['count']({'where':_0x5298a6[_0x41d7('0x56')]})[_0x41d7('0x26')](function(_0x57d20c){_0x1c8592['count']=_0x57d20c;if(_0x1088c8[_0x41d7('0x4b')][_0x41d7('0x60')]){_0x5298a6[_0x41d7('0x5a')]=[{'all':!![]}];}return db[_0x41d7('0x74')][_0x41d7('0x5b')](_0x5298a6);})[_0x41d7('0x26')](function(_0x506e3d){_0x1c8592[_0x41d7('0x76')]=_0x506e3d;return _0x1c8592;});}})[_0x41d7('0x26')](respondWithFilteredResult(_0x55ba10,_0x5298a6))[_0x41d7('0x30')](handleError(_0x55ba10,null));};exports[_0x41d7('0x77')]=function(_0x1dfa38,_0x1d08c1,_0x30bec7){return db[_0x41d7('0x45')][_0x41d7('0x61')]({'where':{'id':_0x1dfa38[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x1d08c1,null))[_0x41d7('0x26')](function(_0x2f6c84){if(_0x2f6c84){return _0x2f6c84['removeAnswers'](_0x1dfa38['query']['ids']);}})[_0x41d7('0x26')](respondWithStatusCode(_0x1d08c1,null))[_0x41d7('0x30')](handleError(_0x1d08c1,null));};exports['addInteraction']=function(_0x2af888,_0x439b8a,_0x5d69b9){return db[_0x41d7('0x78')][_0x41d7('0x61')]({'where':{'id':_0x2af888[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x439b8a,null))['then'](function(_0x44991a){if(_0x44991a){return _0x44991a[_0x41d7('0x79')](_0x2af888[_0x41d7('0x63')][_0x41d7('0x72')],_[_0x41d7('0x7a')](_0x2af888['body'],[_0x41d7('0x72'),'id'])||{});}})[_0x41d7('0x26')](respondWithResult(_0x439b8a,null))[_0x41d7('0x30')](handleError(_0x439b8a,null));};exports[_0x41d7('0x7b')]=function(_0x1477a5,_0x435e40,_0x792955){var _0x5bc57d={'raw':![],'where':{}};var _0x264377={};var _0x1360d9={'count':0x0,'rows':[]};return db[_0x41d7('0x45')][_0x41d7('0x6e')]({'where':{'id':_0x1477a5['params']['id']}})['then'](handleEntityNotFound(_0x435e40,null))['then'](function(_0xe4188a){if(_0xe4188a){_0x264377['model']=_['keys'](db[_0x41d7('0x78')][_0x41d7('0x6f')]);_0x264377[_0x41d7('0x4b')]=_['keys'](_0x1477a5[_0x41d7('0x4b')]);_0x264377[_0x41d7('0x54')]=_[_0x41d7('0x4e')](_0x264377[_0x41d7('0x4c')],_0x264377[_0x41d7('0x4b')]);_0x5bc57d[_0x41d7('0x4d')]=_[_0x41d7('0x4e')](_0x264377[_0x41d7('0x4c')],qs['fields'](_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x4f')]));_0x5bc57d[_0x41d7('0x4d')]=_0x5bc57d['attributes'][_0x41d7('0x5f')]?_0x5bc57d[_0x41d7('0x4d')]:_0x264377[_0x41d7('0x4c')];if(!_0x1477a5['query']['hasOwnProperty'](_0x41d7('0x51'))){_0x5bc57d[_0x41d7('0x37')]=qs[_0x41d7('0x37')](_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x37')]);_0x5bc57d[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x1477a5[_0x41d7('0x4b')]['offset']);}_0x5bc57d[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x5bc57d[_0x41d7('0x56')]=qs['filters'](_['pick'](_0x1477a5[_0x41d7('0x4b')],_0x264377[_0x41d7('0x54')]));_0x5bc57d[_0x41d7('0x56')]['FaxAccountId']=_0xe4188a['id'];if(_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x55')]){_0x5bc57d[_0x41d7('0x56')]=_[_0x41d7('0x57')](_0x5bc57d[_0x41d7('0x56')],{'$or':_[_0x41d7('0x44')](_0x5bc57d['attributes'],function(_0x5a33a0){var _0x334c4b={};_0x334c4b[_0x5a33a0]={'$like':'%'+_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x55')]+'%'};return _0x334c4b;})});}_0x5bc57d=_['merge']({},_0x5bc57d,_0x1477a5[_0x41d7('0x59')]);return db['FaxInteraction'][_0x41d7('0x36')]({'where':_0x5bc57d['where']})[_0x41d7('0x26')](function(_0x208e98){_0x1360d9[_0x41d7('0x36')]=_0x208e98;if(_0x1477a5['query'][_0x41d7('0x60')]){_0x5bc57d[_0x41d7('0x5a')]=[{'model':db['CmContact'],'as':_0x41d7('0x7c'),'required':![]},{'model':db['User'],'as':_0x41d7('0x7d'),'attributes':[_0x41d7('0x49'),_0x41d7('0x7e'),_0x41d7('0x7f')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x1477a5[_0x41d7('0x4b')]['tag']?{'id':_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x80')]}:undefined,'required':_0x1477a5[_0x41d7('0x4b')][_0x41d7('0x80')]?!![]:![]}];}return db[_0x41d7('0x78')]['findAll'](_0x5bc57d);})[_0x41d7('0x26')](function(_0x459314){_0x1360d9[_0x41d7('0x76')]=_0x459314;return _0x1360d9;});}})['then'](respondWithFilteredResult(_0x435e40,_0x5bc57d))[_0x41d7('0x30')](handleError(_0x435e40,null));};exports[_0x41d7('0x81')]=function(_0x2e2a9c,_0x3df61d){var _0x107a67=_0x2e2a9c[_0x41d7('0x5d')]['id'];var _0x58dad3=_0x2e2a9c['body'];var _0x5efdf0=0xc8;var _0x3d78e0=null;return db[_0x41d7('0x82')][_0x41d7('0x83')]({'isolationLevel':db[_0x41d7('0x82')]['Transaction'][_0x41d7('0x84')][_0x41d7('0x85')]},function(_0x1bd2b8){return db['FaxAccount'][_0x41d7('0x6e')]({'where':{'id':_0x107a67},'transaction':_0x1bd2b8})[_0x41d7('0x26')](function(_0xc9b9fb){if(_0xc9b9fb){return db['FaxApplication'][_0x41d7('0x3d')]({'where':{'FaxAccountId':_0x107a67},'transaction':_0x1bd2b8})['then'](function(){var _0x4ab23e=_[_0x41d7('0x44')](_0x58dad3,function(_0xa3ff9){_0xa3ff9[_0x41d7('0x6b')]=_0x107a67;return _0xa3ff9;});return db[_0x41d7('0x86')]['bulkCreate'](_0x4ab23e,{'transaction':_0x1bd2b8});});}else{_0x5efdf0=0x194;_0x3d78e0=[];}});})['then'](function(){if(_0x5efdf0!==0x194){return db[_0x41d7('0x86')][_0x41d7('0x87')]({'where':{'FaxAccountId':_0x107a67},'order':_0x41d7('0x88')})['then'](function(_0x15d0d5){_0x3d78e0=_0x15d0d5;});}})['catch'](function(_0x3f8ee2){_0x5efdf0=0x1f4;logger[_0x41d7('0x2c')](_0x3f8ee2[_0x41d7('0x89')]);if(_0x3f8ee2[_0x41d7('0x49')]){delete _0x3f8ee2[_0x41d7('0x49')];}_0x3d78e0=_0x3f8ee2;})[_0x41d7('0x8a')](function(){if(_0x3d78e0===null){_0x3df61d[_0x41d7('0x31')](_0x5efdf0);}else{if(_0x5efdf0===0x1f4){_0x3df61d[_0x41d7('0x32')](_0x5efdf0)[_0x41d7('0x41')](_0x3d78e0);}else{_0x3df61d[_0x41d7('0x32')](_0x5efdf0)[_0x41d7('0x33')](_0x3d78e0);}}});};exports[_0x41d7('0x8b')]=function(_0x5a8f14,_0x2c2323,_0x247e15){var _0x15ac60={};var _0xc5ecc9={};var _0x130132;var _0x499474;return db[_0x41d7('0x45')][_0x41d7('0x6e')]({'where':{'id':_0x5a8f14[_0x41d7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2c2323,null))[_0x41d7('0x26')](function(_0x268e7d){if(_0x268e7d){_0x130132=_0x268e7d;_0xc5ecc9[_0x41d7('0x4c')]=_['keys'](db[_0x41d7('0x86')][_0x41d7('0x6f')]);_0xc5ecc9[_0x41d7('0x4b')]=_[_0x41d7('0x4a')](_0x5a8f14[_0x41d7('0x4b')]);_0xc5ecc9[_0x41d7('0x54')]=_[_0x41d7('0x4e')](_0xc5ecc9['model'],_0xc5ecc9[_0x41d7('0x4b')]);_0x15ac60[_0x41d7('0x4d')]=_['intersection'](_0xc5ecc9['model'],qs[_0x41d7('0x4f')](_0x5a8f14[_0x41d7('0x4b')]['fields']));_0x15ac60[_0x41d7('0x4d')]=_0x15ac60[_0x41d7('0x4d')][_0x41d7('0x5f')]?_0x15ac60[_0x41d7('0x4d')]:_0xc5ecc9[_0x41d7('0x4c')];_0x15ac60[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x5a8f14[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x15ac60['where']=qs['filters'](_[_0x41d7('0x70')](_0x5a8f14[_0x41d7('0x4b')],_0xc5ecc9[_0x41d7('0x54')]));if(_0x5a8f14[_0x41d7('0x4b')][_0x41d7('0x55')]){_0x15ac60['where']=_[_0x41d7('0x57')](_0x15ac60[_0x41d7('0x56')],{'$or':_[_0x41d7('0x44')](_0x15ac60[_0x41d7('0x4d')],function(_0x4fae23){var _0x571a47={};_0x571a47[_0x4fae23]={'$like':'%'+_0x5a8f14[_0x41d7('0x4b')]['filter']+'%'};return _0x571a47;})});}_0x15ac60=_['merge']({},_0x15ac60,_0x5a8f14[_0x41d7('0x59')]);return _0x130132['getApplications'](_0x15ac60);}})[_0x41d7('0x26')](function(_0x5e4711){if(_0x5e4711){_0x499474=_0x5e4711[_0x41d7('0x5f')];if(!_0x5a8f14[_0x41d7('0x4b')][_0x41d7('0x50')](_0x41d7('0x51'))){_0x15ac60[_0x41d7('0x37')]=qs[_0x41d7('0x37')](_0x5a8f14[_0x41d7('0x4b')][_0x41d7('0x37')]);_0x15ac60[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x5a8f14[_0x41d7('0x4b')][_0x41d7('0x35')]);}return _0x130132['getApplications'](_0x15ac60);}})[_0x41d7('0x26')](function(_0x3cefff){if(_0x3cefff){return _0x3cefff?{'count':_0x499474,'rows':_0x3cefff}:null;}})[_0x41d7('0x26')](respondWithResult(_0x2c2323,null))[_0x41d7('0x30')](handleError(_0x2c2323,null));};function Extension(_0x331998,_0x5172d3,_0x145f9c,_0x1bcf13){this['context']=_0x41d7('0x8c');this['exten']=_0x331998[_0x41d7('0x8d')];this[_0x41d7('0x8e')]=_0x1bcf13;this[_0x41d7('0x47')]=_0x41d7('0x8f');this[_0x41d7('0x90')]=_0x41d7('0x91');this['FaxAccountId']=_0x331998['id'];this[_0x41d7('0x88')]=_0x5172d3;this[_0x41d7('0x92')]=_0x145f9c;}function createExtensionsReciveFax(_0x54e477){var _0x214c8=0x1;var _0x582ac1=[];_0x582ac1[_0x41d7('0x93')](new Extension(_0x54e477,_0x214c8,'',_0x41d7('0x94')));_0x214c8+=0x1;_0x582ac1['push'](new Extension(_0x54e477,_0x214c8,_0x41d7('0x95'),'Set'));_0x214c8+=0x1;for(var _0x27ecaa in _0x54e477){if(_0x54e477[_0x41d7('0x50')](_0x27ecaa)&&(_0x27ecaa===_0x41d7('0x96')||_0x27ecaa==='localstationid'||_0x27ecaa===_0x41d7('0x97')||_0x27ecaa===_0x41d7('0x98')||_0x27ecaa===_0x41d7('0x99')||_0x27ecaa===_0x41d7('0x9a')||_0x27ecaa===_0x41d7('0x9b')||_0x27ecaa==='modem'||_0x27ecaa===_0x41d7('0x9c'))){_0x582ac1[_0x41d7('0x93')](new Extension(_0x54e477,_0x214c8,_0x41d7('0x9d')+_0x27ecaa+')='+_0x54e477[_0x27ecaa],_0x41d7('0x9e')));_0x214c8+=0x1;}}_0x582ac1[_0x41d7('0x93')](new Extension(_0x54e477,_0x214c8,'6','Wait'));_0x214c8+=0x1;_0x582ac1['push'](new Extension(_0x54e477,_0x214c8,_0x41d7('0x9f'),'ReceiveFax'));_0x214c8=0x0;return _0x582ac1;}exports[_0x41d7('0xa0')]=function(_0x496fb5,_0x3dd1b6,_0x2996b4){var _0x203afc;return db[_0x41d7('0x82')][_0x41d7('0x83')](function(_0x226e52){return db['FaxAccount'][_0x41d7('0x62')](_0x496fb5['body'],{'transaction':_0x226e52})[_0x41d7('0x26')](function(_0x2d0d6a){_0x203afc=_0x2d0d6a[_0x41d7('0xa1')]({'plain':!![]});return db[_0x41d7('0xa2')][_0x41d7('0xa3')](createExtensionsReciveFax(_0x203afc),{'transaction':_0x226e52});});})[_0x41d7('0x26')](function(){return _0x203afc;})['then'](respondWithResult(_0x3dd1b6,null))[_0x41d7('0x30')](handleError(_0x3dd1b6,null));};exports[_0x41d7('0xa4')]=function(_0x148f63,_0x21882a,_0xd3a95e){var _0xfb403a;return db[_0x41d7('0x82')][_0x41d7('0x83')](function(_0x226bbc){return db[_0x41d7('0x45')][_0x41d7('0x3c')](_0x148f63[_0x41d7('0x63')],{'where':{'id':_0x148f63[_0x41d7('0x63')]['id']},'transaction':_0x226bbc})[_0x41d7('0x26')](function(_0x2b97ba){return db[_0x41d7('0xa2')][_0x41d7('0x3d')]({'where':{'FaxAccountId':_0x148f63['body']['id']},'transaction':_0x226bbc})[_0x41d7('0x26')](function(_0x50177a){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x41d7('0x7a')](_0x148f63['body'],['tech',_0x41d7('0x48'),'createdAt',_0x41d7('0xa5'),_0x41d7('0xa6'),'ListId'])),{'transaction':_0x226bbc});});});})['then'](function(){return db['FaxAccount'][_0x41d7('0xa7')](_0x148f63[_0x41d7('0x63')]['id']);})[_0x41d7('0x26')](respondWithResult(_0x21882a,null))[_0x41d7('0x30')](handleError(_0x21882a,null));};exports[_0x41d7('0xa8')]=function(_0x2f87b5,_0x2a26ef,_0xa1a0c1){var _0x16221c={'raw':!![],'where':{}};var _0x45bd22={};var _0x558e9e={'count':0x0,'rows':[]};return db[_0x41d7('0x45')]['findOne']({'where':{'id':_0x2f87b5[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x2a26ef,null))[_0x41d7('0x26')](function(_0x4a447f){if(_0x4a447f){_0x45bd22[_0x41d7('0x4c')]=_[_0x41d7('0x4a')](db[_0x41d7('0xa9')][_0x41d7('0x6f')]);_0x45bd22['query']=_[_0x41d7('0x4a')](_0x2f87b5[_0x41d7('0x4b')]);_0x45bd22[_0x41d7('0x54')]=_['intersection'](_0x45bd22['model'],_0x45bd22[_0x41d7('0x4b')]);_0x16221c['attributes']=_[_0x41d7('0x4e')](_0x45bd22[_0x41d7('0x4c')],qs[_0x41d7('0x4f')](_0x2f87b5['query'][_0x41d7('0x4f')]));_0x16221c[_0x41d7('0x4d')]=_0x16221c['attributes'][_0x41d7('0x5f')]?_0x16221c['attributes']:_0x45bd22[_0x41d7('0x4c')];if(!_0x2f87b5['query'][_0x41d7('0x50')](_0x41d7('0x51'))){_0x16221c['limit']=qs[_0x41d7('0x37')](_0x2f87b5[_0x41d7('0x4b')]['limit']);_0x16221c[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x2f87b5[_0x41d7('0x4b')]['offset']);}_0x16221c[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x2f87b5[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x16221c[_0x41d7('0x56')]=qs['filters'](_[_0x41d7('0x70')](_0x2f87b5['query'],_0x45bd22['filters']));_0x16221c[_0x41d7('0x56')][_0x41d7('0x6b')]=_0x4a447f['id'];if(_0x2f87b5[_0x41d7('0x4b')]['filter']){_0x16221c[_0x41d7('0x56')]=_[_0x41d7('0x57')](_0x16221c['where'],{'$or':_[_0x41d7('0x44')](_0x16221c['attributes'],function(_0x3af516){var _0x343121={};_0x343121[_0x3af516]={'$like':'%'+_0x2f87b5['query'][_0x41d7('0x55')]+'%'};return _0x343121;})});}if(_0x2f87b5[_0x41d7('0x4b')][_0x41d7('0xaa')]){var _0x40d5d8=_0x2f87b5['query']['$gte'][_0x41d7('0xab')](',');var _0x1d8db0={};_0x1d8db0[_0x40d5d8[0x0]]={'$gte':moment(_0x40d5d8[0x1])[_0x41d7('0xac')](_0x41d7('0xad'))};_0x16221c[_0x41d7('0x56')]=_[_0x41d7('0x57')](_0x16221c[_0x41d7('0x56')],_0x1d8db0);}_0x16221c=_[_0x41d7('0x57')]({},_0x16221c,_0x2f87b5[_0x41d7('0x59')]);return db[_0x41d7('0xa9')][_0x41d7('0x36')]({'where':_0x16221c['where']})[_0x41d7('0x26')](function(_0x412a13){_0x558e9e[_0x41d7('0x36')]=_0x412a13;if(_0x2f87b5[_0x41d7('0x4b')][_0x41d7('0x60')]){_0x16221c[_0x41d7('0x5a')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x16221c);})[_0x41d7('0x26')](function(_0x35fe4b){_0x558e9e['rows']=_0x35fe4b;return _0x558e9e;});}})[_0x41d7('0x26')](respondWithFilteredResult(_0x2a26ef,_0x16221c))['catch'](handleError(_0x2a26ef,null));};exports[_0x41d7('0x41')]=function(_0x32e3be,_0x3f91e8,_0x4e51af){var _0x823243,_0x48ca46={},_0x593955;if(_0x32e3be['body']['to']){_0x593955=_0x32e3be[_0x41d7('0x63')]['to'][0x0];}return db[_0x41d7('0x45')][_0x41d7('0x61')]({'where':{'id':_0x32e3be['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x41d7('0xae')],'as':_0x41d7('0xaf'),'where':{'fax':_0x593955},'limit':0x1,'order':[[_0x41d7('0xa5'),_0x41d7('0xb0')]]}]}]})[_0x41d7('0x26')](handleEntityNotFound(_0x3f91e8,null))[_0x41d7('0x26')](function(_0x3109dd){_0x823243=_0x3109dd;if(_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')]&&_0x32e3be[_0x41d7('0x63')]['attachments']['length']){for(var _0x5775d2=0x0;_0x5775d2<_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][_0x41d7('0x5f')];_0x5775d2+=0x1){_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][_0x5775d2]={'filename':_0x32e3be[_0x41d7('0x63')]['attachments'][_0x5775d2][_0x41d7('0x49')],'id':_0x32e3be['body']['attachments'][_0x5775d2]['id'],'path':path['join'](config['root'],_0x41d7('0xb2'),_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][_0x5775d2][_0x41d7('0xb3')])};}}return respondWithRpcPromise(_0x41d7('0xb4'),_0x41d7('0xb4'),{'FaxAccountId':_[_0x41d7('0xb5')](_0x32e3be['params']['id'])?undefined:_0x32e3be[_0x41d7('0x5d')]['id'],'path':_[_0x41d7('0xb5')](_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][0x0][_0x41d7('0x6')])?undefined:_0x32e3be['body']['attachments'][0x0]['path'],'fax':_[_0x41d7('0xb5')](_0x32e3be[_0x41d7('0x63')]['to'][0x0])?undefined:_0x32e3be[_0x41d7('0x63')]['to'][0x0]},client9002);})['then'](function(){if(_0x823243){if(_[_0x41d7('0xb5')](_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb6')])){_0x32e3be['body']['from']=util['format']('\x22%s\x22\x20<%s>',_0x823243[_0x41d7('0x49')],_0x823243[_0x41d7('0xb7')]);}if(_0x823243[_0x41d7('0xb8')]){if(_0x823243[_0x41d7('0xb8')][_0x41d7('0xaf')][_0x41d7('0x5f')]){return _0x823243[_0x41d7('0xb8')]['Contacts'][0x0];}else{return db[_0x41d7('0xae')]['create'](_[_0x41d7('0x1c')](_0x32e3be['body'],{'firstName':_0x32e3be[_0x41d7('0x63')]['to'][0x0],'phone':_0x32e3be[_0x41d7('0x63')]['to'][0x0],'fax':_0x32e3be[_0x41d7('0x63')]['to'][0x0],'ListId':_0x823243[_0x41d7('0xb9')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x41d7('0xba'));}})[_0x41d7('0x26')](function(_0x507f5a){if(_0x507f5a){return db['FaxInteraction']['find']({'where':{'ContactId':_0x507f5a['id'],'closed':![],'FaxAccountId':_0x823243['id']}})['then'](function(_0x4387ad){if(_0x4387ad){return[_0x4387ad,![]];}return db[_0x41d7('0x78')]['create']({'UserId':_0x32e3be[_0x41d7('0x64')]['id'],'ContactId':_0x507f5a['id'],'FaxAccountId':_0x823243['id'],'fax':_0x32e3be['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x32e3be[_0x41d7('0x63')],{'read':![],'body':_0x32e3be['body']['attachments'][0x0][_0x41d7('0xbb')],'FaxAccountId':_0x823243['id'],'UserId':_0x32e3be[_0x41d7('0x64')]['id'],'ContactId':_0x507f5a['id'],'AttachmentId':_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][0x0]['id']})]},{'include':[{'model':db[_0x41d7('0xa9')],'as':_0x41d7('0xbc')}]})[_0x41d7('0x26')](function(_0x203efc){return[_0x203efc,!![]];});});}else{throw new Error(_0x41d7('0xbd'));}})[_0x41d7('0xbe')](function(_0x52f25,_0x449e57){if(_0x449e57){return _0x52f25;}return db[_0x41d7('0xa9')][_0x41d7('0x62')]({'direction':'out','read':![],'body':_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][0x0]['filename'],'FaxAccountId':_0x823243['id'],'FaxInteractionId':_0x52f25['id'],'UserId':_0x32e3be[_0x41d7('0x64')]['id'],'ContactId':_0x52f25[_0x41d7('0xbf')],'AttachmentId':_0x32e3be['body'][_0x41d7('0xb1')][0x0]['id']})[_0x41d7('0x26')](function(_0x1444f7){_0x52f25[_0x41d7('0xc0')][_0x41d7('0xbc')]=[];_0x52f25['dataValues'][_0x41d7('0xbc')][_0x41d7('0x93')](_0x1444f7[_0x41d7('0xc0')]);return _0x52f25;});})[_0x41d7('0x26')](function(_0x9aa9e){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x32e3be[_0x41d7('0x5d')]['id'])?undefined:_0x32e3be[_0x41d7('0x5d')]['id'],'path':_[_0x41d7('0xb5')](_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][0x0][_0x41d7('0x6')])?undefined:_0x32e3be[_0x41d7('0x63')]['attachments'][0x0][_0x41d7('0x6')],'fax':_[_0x41d7('0xb5')](_0x32e3be['body']['to'][0x0])?undefined:_0x32e3be['body']['to'][0x0],'AttachmentId':_0x32e3be[_0x41d7('0x63')][_0x41d7('0xb1')][0x0]['id']},client9002)[_0x41d7('0x26')](function(_0x512647){logger[_0x41d7('0x2e')](_0x41d7('0xc1'),_0x512647);})['catch'](function(_0x255cd2){logger['info'](_0x41d7('0xc1'),_0x255cd2);});return _0x9aa9e;})['then'](respondWithResult(_0x3f91e8,null))[_0x41d7('0x30')](handleError(_0x3f91e8,null));};exports[_0x41d7('0xc2')]=function(_0x317b07,_0x27a94a,_0x2c84e9){return db[_0x41d7('0x45')][_0x41d7('0x61')]({'where':{'id':_0x317b07[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x27a94a,null))[_0x41d7('0x26')](function(_0x51677b){if(_0x51677b){return _0x51677b[_0x41d7('0xc2')](_0x317b07['body'][_0x41d7('0x72')],_[_0x41d7('0x7a')](_0x317b07[_0x41d7('0x63')],[_0x41d7('0x72'),'id'])||{})[_0x41d7('0xbe')](function(_0x4786e0){for(var _0x481175=0x0;_0x481175<_0x317b07[_0x41d7('0x63')][_0x41d7('0x72')][_0x41d7('0x5f')];_0x481175+=0x1){socket[_0x41d7('0xc3')](_0x41d7('0xc4'),{'UserId':Number(_0x317b07[_0x41d7('0x63')][_0x41d7('0x72')][_0x481175]),'FaxAccountId':Number(_0x317b07[_0x41d7('0x5d')]['id'])});}return _0x4786e0;});}})[_0x41d7('0x26')](respondWithResult(_0x27a94a,null))['catch'](handleError(_0x27a94a,null));};exports[_0x41d7('0xc5')]=function(_0x5a7fb5,_0x5e7c21,_0x4045f3){return db[_0x41d7('0x45')][_0x41d7('0x61')]({'where':{'id':_0x5a7fb5[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x5e7c21,null))[_0x41d7('0x26')](function(_0x3cb4c1){if(_0x3cb4c1){return _0x3cb4c1[_0x41d7('0xc5')](_0x5a7fb5[_0x41d7('0x4b')]['ids'])[_0x41d7('0x26')](function(){if(_[_0x41d7('0xc6')](_0x5a7fb5['query'][_0x41d7('0x72')])){for(var _0xdfe738=0x0;_0xdfe738<_0x5a7fb5[_0x41d7('0x4b')][_0x41d7('0x72')][_0x41d7('0x5f')];_0xdfe738+=0x1){socket['emit'](_0x41d7('0xc7'),{'UserId':Number(_0x5a7fb5[_0x41d7('0x4b')]['ids'][_0xdfe738]),'FaxAccountId':Number(_0x5a7fb5[_0x41d7('0x5d')]['id'])});}}else{socket['emit'](_0x41d7('0xc7'),{'UserId':Number(_0x5a7fb5[_0x41d7('0x4b')]['ids']),'FaxAccountId':Number(_0x5a7fb5[_0x41d7('0x5d')]['id'])});}});}})[_0x41d7('0x26')](respondWithStatusCode(_0x5e7c21,null))[_0x41d7('0x30')](handleError(_0x5e7c21,null));};exports[_0x41d7('0xc8')]=function(_0x2b20f7,_0x5567a1,_0x18313b){var _0x1afe2b={};var _0x5e7f1c={};var _0x239f02;var _0x10b004;return db['FaxAccount']['findOne']({'where':{'id':_0x2b20f7[_0x41d7('0x5d')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x5567a1,null))[_0x41d7('0x26')](function(_0x47bf21){if(_0x47bf21){_0x239f02=_0x47bf21;_0x5e7f1c[_0x41d7('0x4c')]=_[_0x41d7('0x4a')](db[_0x41d7('0xc9')]['rawAttributes']);_0x5e7f1c['query']=_[_0x41d7('0x4a')](_0x2b20f7[_0x41d7('0x4b')]);_0x5e7f1c[_0x41d7('0x54')]=_[_0x41d7('0x4e')](_0x5e7f1c['model'],_0x5e7f1c[_0x41d7('0x4b')]);_0x1afe2b[_0x41d7('0x4d')]=_[_0x41d7('0x4e')](_0x5e7f1c['model'],qs[_0x41d7('0x4f')](_0x2b20f7['query']['fields']));_0x1afe2b[_0x41d7('0x4d')]=_0x1afe2b[_0x41d7('0x4d')][_0x41d7('0x5f')]?_0x1afe2b[_0x41d7('0x4d')]:_0x5e7f1c[_0x41d7('0x4c')];_0x1afe2b[_0x41d7('0x52')]=qs[_0x41d7('0x53')](_0x2b20f7[_0x41d7('0x4b')][_0x41d7('0x53')]);_0x1afe2b[_0x41d7('0x56')]=qs[_0x41d7('0x54')](_[_0x41d7('0x70')](_0x2b20f7[_0x41d7('0x4b')],_0x5e7f1c[_0x41d7('0x54')]));if(_0x2b20f7[_0x41d7('0x4b')][_0x41d7('0x55')]){_0x1afe2b['where']=_[_0x41d7('0x57')](_0x1afe2b[_0x41d7('0x56')],{'$or':_[_0x41d7('0x44')](_0x1afe2b['attributes'],function(_0x35be2e){var _0x3897f6={};_0x3897f6[_0x35be2e]={'$like':'%'+_0x2b20f7[_0x41d7('0x4b')]['filter']+'%'};return _0x3897f6;})});}_0x1afe2b=_[_0x41d7('0x57')]({},_0x1afe2b,_0x2b20f7[_0x41d7('0x59')]);return _0x239f02[_0x41d7('0xc8')](_0x1afe2b);}})[_0x41d7('0x26')](function(_0x2f5a76){if(_0x2f5a76){_0x10b004=_0x2f5a76['length'];if(!_0x2b20f7[_0x41d7('0x4b')][_0x41d7('0x50')](_0x41d7('0x51'))){_0x1afe2b['limit']=qs[_0x41d7('0x37')](_0x2b20f7['query'][_0x41d7('0x37')]);_0x1afe2b[_0x41d7('0x35')]=qs[_0x41d7('0x35')](_0x2b20f7[_0x41d7('0x4b')][_0x41d7('0x35')]);}return _0x239f02[_0x41d7('0xc8')](_0x1afe2b);}})['then'](function(_0x1a6d51){if(_0x1a6d51){return _0x1a6d51?{'count':_0x10b004,'rows':_0x1a6d51}:null;}})[_0x41d7('0x26')](respondWithResult(_0x5567a1,null))[_0x41d7('0x30')](handleError(_0x5567a1,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9dd7233..ae06922 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 _0x6e51=['FaxAccount','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xb6bb9b,_0x4a08e7){var _0x4d99ba=function(_0x51250){while(--_0x51250){_0xb6bb9b['push'](_0xb6bb9b['shift']());}};_0x4d99ba(++_0x4a08e7);}(_0x6e51,0x1b6));var _0x16e5=function(_0x34c2de,_0x1c533b){_0x34c2de=_0x34c2de-0x0;var _0x4e7c4f=_0x6e51[_0x34c2de];return _0x4e7c4f;};'use strict';var EventEmitter=require(_0x16e5('0x0'));var FaxAccount=require(_0x16e5('0x1'))['db'][_0x16e5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x16e5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x16e5('0x4')};function emitEvent(_0x3893a8){return function(_0x58bc40,_0x58be01,_0x37cd85){FaxAccountEvents[_0x16e5('0x5')](_0x3893a8+':'+_0x58bc40['id'],_0x58bc40);FaxAccountEvents[_0x16e5('0x5')](_0x3893a8,_0x58bc40);_0x37cd85(null);};}for(var e in events){if(events[_0x16e5('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x16e5('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x2f4e=['update','remove','emit','hook','../../mysqldb','FaxAccount','save'];(function(_0x38afe9,_0x55472e){var _0x1af524=function(_0x8d2c7e){while(--_0x8d2c7e){_0x38afe9['push'](_0x38afe9['shift']());}};_0x1af524(++_0x55472e);}(_0x2f4e,0x1ee));var _0xe2f4=function(_0x4368f6,_0x5e6679){_0x4368f6=_0x4368f6-0x0;var _0x1c02b1=_0x2f4e[_0x4368f6];return _0x1c02b1;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xe2f4('0x0'))['db'][_0xe2f4('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe2f4('0x2'),'afterUpdate':_0xe2f4('0x3'),'afterDestroy':_0xe2f4('0x4')};function emitEvent(_0x319904){return function(_0x5a7b28,_0x28f24a,_0x3b94cc){FaxAccountEvents[_0xe2f4('0x5')](_0x319904+':'+_0x5a7b28['id'],_0x5a7b28);FaxAccountEvents[_0xe2f4('0x5')](_0x319904,_0x5a7b28);_0x3b94cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe2f4('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2767791..c2d5bf2 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 _0xd15f=['fax_accounts','lodash','util','../../config/logger','api','moment','rimraf','./faxAccount.attributes','exports','define'];(function(_0x53b9fb,_0x296c3b){var _0x4ae714=function(_0x95f86f){while(--_0x95f86f){_0x53b9fb['push'](_0x53b9fb['shift']());}};_0x4ae714(++_0x296c3b);}(_0xd15f,0x105));var _0xfd15=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xd15f[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0xfd15('0x0'));var util=require(_0xfd15('0x1'));var logger=require(_0xfd15('0x2'))(_0xfd15('0x3'));var moment=require(_0xfd15('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfd15('0x5'));var config=require('../../config/environment');var attributes=require(_0xfd15('0x6'));module[_0xfd15('0x7')]=function(_0x4a1876,_0x52d01a){return _0x4a1876[_0xfd15('0x8')]('FaxAccount',attributes,{'tableName':_0xfd15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef6a=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xef6a,0x84));var _0xaef6=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xef6a[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xaef6('0x0'));var util=require(_0xaef6('0x1'));var logger=require(_0xaef6('0x2'))(_0xaef6('0x3'));var moment=require(_0xaef6('0x4'));var BPromise=require(_0xaef6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaef6('0x6'));var rimraf=require(_0xaef6('0x7'));var config=require(_0xaef6('0x8'));var attributes=require(_0xaef6('0x9'));module['exports']=function(_0x2023f4,_0x114cc8){return _0x2023f4[_0xaef6('0xa')](_0xaef6('0xb'),attributes,{'tableName':_0xaef6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 274c14f..470df87 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 _0xe040=['body','fax','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','CmList','List','CmContact','Contacts','Applications','account','applications','orderBy','priority','asc','create','FaxInteraction','Contact\x20not\x20found','get','autoclose','length','close','*,*,*,*','created','interaction','ContactId','UserId','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxAccount','findAll','options','attributes','include','map','model','then','catch','NotifyFaxAccount'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe040,0xd5));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e04('0x0'));var util=require('util');var moment=require(_0x0e04('0x1'));var BPromise=require(_0x0e04('0x2'));var rs=require(_0x0e04('0x3'));var fs=require('fs');var Redis=require(_0x0e04('0x4'));var db=require(_0x0e04('0x5'))['db'];var utils=require(_0x0e04('0x6'));var logger=require('../../config/logger')(_0x0e04('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e04('0x8'));var client=jayson[_0x0e04('0x9')][_0x0e04('0xa')]({'port':0x232c});config[_0x0e04('0xb')]=_[_0x0e04('0xc')](config[_0x0e04('0xb')],{'host':_0x0e04('0xd'),'port':0x18eb});var socket=require(_0x0e04('0xe'))(new Redis(config[_0x0e04('0xb')]));require(_0x0e04('0xf'))[_0x0e04('0x10')](socket);function respondWithRpcPromise(_0x59b5a8,_0x557c61,_0x5e372b){return new BPromise(function(_0x5f54d8,_0x310eef){return client[_0x0e04('0x11')](_0x59b5a8,_0x5e372b)['then'](function(_0x55cdaf){logger[_0x0e04('0x12')](_0x0e04('0x13'),_0x557c61,_0x0e04('0x14'));logger['debug'](_0x0e04('0x15'),_0x557c61,'request\x20sent',JSON[_0x0e04('0x16')](_0x55cdaf));if(_0x55cdaf['error']){if(_0x55cdaf[_0x0e04('0x17')]['code']===0x1f4){logger[_0x0e04('0x17')](_0x0e04('0x13'),_0x557c61,_0x55cdaf[_0x0e04('0x17')][_0x0e04('0x18')]);return _0x310eef(_0x55cdaf[_0x0e04('0x17')][_0x0e04('0x18')]);}logger['error'](_0x0e04('0x13'),_0x557c61,_0x55cdaf[_0x0e04('0x17')][_0x0e04('0x18')]);return _0x5f54d8(_0x55cdaf[_0x0e04('0x17')][_0x0e04('0x18')]);}else{logger['info'](_0x0e04('0x13'),_0x557c61,_0x0e04('0x14'));_0x5f54d8(_0x55cdaf[_0x0e04('0x19')][_0x0e04('0x18')]);}})['catch'](function(_0x341b3a){logger[_0x0e04('0x17')](_0x0e04('0x13'),_0x557c61,_0x341b3a);_0x310eef(_0x341b3a);});});}exports[_0x0e04('0x1a')]=function(_0x254ceb){var _0x2fd81d=this;return new Promise(function(_0x3d0377,_0x4792f8){return db['FaxAccount'][_0x0e04('0x1b')]({'raw':_0x254ceb[_0x0e04('0x1c')]?_0x254ceb[_0x0e04('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x254ceb[_0x0e04('0x1c')]?_0x254ceb[_0x0e04('0x1c')]['where']||null:null,'attributes':_0x254ceb[_0x0e04('0x1c')]?_0x254ceb['options'][_0x0e04('0x1d')]||null:null,'limit':_0x254ceb[_0x0e04('0x1c')]?_0x254ceb[_0x0e04('0x1c')]['limit']||null:null,'include':_0x254ceb[_0x0e04('0x1c')]?_0x254ceb['options'][_0x0e04('0x1e')]?_[_0x0e04('0x1f')](_0x254ceb[_0x0e04('0x1c')][_0x0e04('0x1e')],function(_0x5579d4){return{'model':db[_0x5579d4['model']],'as':_0x5579d4['as'],'attributes':_0x5579d4['attributes'],'include':_0x5579d4[_0x0e04('0x1e')]?_[_0x0e04('0x1f')](_0x5579d4[_0x0e04('0x1e')],function(_0x49767a){return{'model':db[_0x49767a[_0x0e04('0x20')]],'as':_0x49767a['as'],'attributes':_0x49767a[_0x0e04('0x1d')],'include':_0x49767a['include']?_[_0x0e04('0x1f')](_0x49767a['include'],function(_0x130b86){return{'model':db[_0x130b86['model']],'as':_0x130b86['as'],'attributes':_0x130b86['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e04('0x21')](function(_0x3cd9f1){logger[_0x0e04('0x12')](_0x0e04('0x1a'),_0x254ceb);logger['debug'](_0x0e04('0x1a'),_0x254ceb,JSON[_0x0e04('0x16')](_0x3cd9f1));_0x3d0377(_0x3cd9f1);})[_0x0e04('0x22')](function(_0x4d00d6){logger[_0x0e04('0x17')](_0x0e04('0x1a'),_0x4d00d6[_0x0e04('0x18')],_0x254ceb);_0x4792f8(_0x2fd81d['error'](0x1f4,_0x4d00d6['message']));});});};exports[_0x0e04('0x23')]=function(_0x2463fc,_0x1fc625,_0x2653fc){var _0xad59da=this;return new Promise(function(_0x19a0ea,_0x3fd335){var _0x20a894={'body':_0x2463fc[_0x0e04('0x24')],'channel':_0x0e04('0x25')};var _0x3fa851=[];var _0x1b0c7b=[];var _0x3f1d4b={};return db['CmContact']['describe']()['then'](function(_0x5a960e){if(!_0x5a960e){throw new db['Sequelize']['ValidationError'](_0x0e04('0x26'));}_0x3fa851=_[_0x0e04('0x27')](_[_0x0e04('0x28')](_0x5a960e),[_0x0e04('0x29'),'updatedAt']);_0x1b0c7b=_['difference'](_['keys'](_0x5a960e),[_0x0e04('0x29'),_0x0e04('0x2a'),_0x0e04('0x2b'),_0x0e04('0x2c')]);if(_0x2463fc[_0x0e04('0x24')]['id']){delete _0x2463fc['body']['id'];}if(_[_0x0e04('0x2d')](_0x2463fc[_0x0e04('0x24')][_0x0e04('0x2e')])){throw new db[(_0x0e04('0x2f'))][(_0x0e04('0x30'))](_0x0e04('0x31'));}if(_[_0x0e04('0x2d')](_0x2463fc['body'][_0x0e04('0x24')])||_0x2463fc[_0x0e04('0x24')][_0x0e04('0x24')]===''){throw new db['Sequelize'][(_0x0e04('0x30'))](_0x0e04('0x32'));}if(_[_0x0e04('0x2d')](_0x2463fc[_0x0e04('0x24')][_0x0e04('0x33')])){throw new db['Sequelize'][(_0x0e04('0x30'))](_0x0e04('0x34')+_0x1b0c7b);}if(!_['includes'](_0x1b0c7b,_0x2463fc[_0x0e04('0x24')][_0x0e04('0x33')])){throw new db['Sequelize'][(_0x0e04('0x30'))](_0x0e04('0x35')+_0x1b0c7b);}_0x3f1d4b[_0x2463fc[_0x0e04('0x24')][_0x0e04('0x33')]]=_0x2463fc[_0x0e04('0x24')][_0x0e04('0x2e')];})[_0x0e04('0x21')](function(){return db[_0x0e04('0x36')][_0x0e04('0x37')]({'where':{'id':_0x2463fc['account']['id']},'include':[{'model':db[_0x0e04('0x38')],'as':_0x0e04('0x39'),'include':[{'model':db[_0x0e04('0x3a')],'as':_0x0e04('0x3b'),'where':_0x3f1d4b,'limit':0x1,'order':[[_0x0e04('0x2a'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x0e04('0x3c')}]});})['then'](function(_0x553b8d){if(_0x553b8d&&_0x553b8d[_0x0e04('0x39')]){var _0x4827b6=_0x553b8d['get']({'plain':!![]});_0x20a894[_0x0e04('0x3d')]=_0x4827b6;_0x20a894['applications']=_0x4827b6[_0x0e04('0x3c')];_0x20a894['list']=_0x4827b6[_0x0e04('0x39')];_0x20a894[_0x0e04('0x3e')]=_[_0x0e04('0x3f')](_0x20a894[_0x0e04('0x3e')],[_0x0e04('0x40')],[_0x0e04('0x41')]);if(_0x20a894[_0x0e04('0x3d')][_0x0e04('0x3c')]){delete _0x20a894[_0x0e04('0x3d')]['Applications'];}if(_0x20a894['account'][_0x0e04('0x39')]&&_0x20a894[_0x0e04('0x3d')][_0x0e04('0x39')][_0x0e04('0x3b')]['length']){return _0x20a894[_0x0e04('0x3d')]['List'][_0x0e04('0x3b')][0x0];}var _0x3ef3a4=_[_0x0e04('0xc')](_0x2463fc['body'],{'firstName':_0x2463fc['body'][_0x0e04('0x2e')],'ListId':_0x4827b6[_0x0e04('0x2c')]});_0x3ef3a4[_0x2463fc[_0x0e04('0x24')][_0x0e04('0x33')]]=_0x2463fc[_0x0e04('0x24')][_0x0e04('0x2e')];return db[_0x0e04('0x3a')][_0x0e04('0x42')](_0x3ef3a4,{'fields':_0x3fa851,'raw':!![]});}})[_0x0e04('0x21')](function(_0x2c4262){_0x20a894['contact']=_0x2c4262;if(_0x2c4262){var _0x3db2a6={'ContactId':_0x2c4262['id'],'FaxAccountId':_0x2463fc[_0x0e04('0x3d')]['id'],'fax':_0x2c4262[_0x0e04('0x25')]};return db['FaxInteraction'][_0x0e04('0x37')]({'where':{'ContactId':_0x2c4262['id'],'closed':![],'FaxAccountId':_0x2463fc[_0x0e04('0x3d')]['id']}})[_0x0e04('0x21')](function(_0x1be442){if(_0x1be442){return[_0x1be442,![]];}return db[_0x0e04('0x43')][_0x0e04('0x42')](_0x3db2a6)[_0x0e04('0x21')](function(_0x38a7e7){return[_0x38a7e7,!![]];});});}else{throw new Error(_0x0e04('0x44'));}})['spread'](function(_0x567919,_0x54015c){var _0xbff9d2=_0x567919[_0x0e04('0x45')]({'plain':!![]});if(_0x54015c){if(_0x20a894[_0x0e04('0x3d')][_0x0e04('0x46')]){_0x20a894[_0x0e04('0x3e')]['push']({'id':0x0,'priority':_0x20a894['applications'][_0x0e04('0x47')]+0x1,'app':_0x0e04('0x48'),'appdata':'unmanaged','interval':_0x0e04('0x49')});}_0xbff9d2[_0x0e04('0x4a')]=!![];}else{_0xbff9d2[_0x0e04('0x4a')]=![];}_0x20a894[_0x0e04('0x4b')]=_0xbff9d2;return db['FaxMessage']['create']({'body':_0x2463fc['body'][_0x0e04('0x24')],'FaxAccountId':_0x2463fc[_0x0e04('0x3d')]['id'],'FaxInteractionId':_0x567919['id'],'direction':'in','ContactId':_0x567919[_0x0e04('0x4c')],'AttachmentId':_0x2463fc[_0x0e04('0x24')]['AttachmentId']});})[_0x0e04('0x21')](function(_0x4524a4){_0x20a894[_0x0e04('0x18')]=_0x4524a4;if(_0x20a894[_0x0e04('0x4b')][_0x0e04('0x4d')]){return db['User'][_0x0e04('0x37')]({'attributes':['id',_0x0e04('0x4e')],'where':{'id':_0x20a894[_0x0e04('0x4b')][_0x0e04('0x4d')]}})[_0x0e04('0x21')](function(_0x58bb22){if(_0x58bb22){_0x20a894[_0x0e04('0x3e')][_0x0e04('0x4f')]({'id':0x0,'priority':0x0,'app':_0x0e04('0x50'),'appdata':_0x58bb22['name']+','+(_0x20a894[_0x0e04('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0x0e04('0x49')});}return respondWithRpcPromise(_0x0e04('0x51'),_0x0e04('0x52'),_0x20a894);});}return respondWithRpcPromise(_0x0e04('0x51'),_0x0e04('0x52'),_0x20a894);})['then'](function(_0x2d44b1){_0x19a0ea(_0x2d44b1);})['catch'](function(_0x564c88){_0x3fd335(_0xad59da[_0x0e04('0x17')](0x1f4,_0x564c88[_0x0e04('0x18')]));});});}; \ No newline at end of file +var _0x5216=['keys','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','asc','length','defaults','create','contact','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','debug','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','map','include','model','attributes','NotifyFaxAccount','fax','CmContact','describe','Sequelize','difference'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5216,0x85));var _0x6521=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5216[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x6521('0x0'));var util=require(_0x6521('0x1'));var moment=require(_0x6521('0x2'));var BPromise=require(_0x6521('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6521('0x4'));var db=require(_0x6521('0x5'))['db'];var utils=require(_0x6521('0x6'));var logger=require(_0x6521('0x7'))(_0x6521('0x8'));var config=require(_0x6521('0x9'));var jayson=require(_0x6521('0xa'));var client=jayson[_0x6521('0xb')][_0x6521('0xc')]({'port':0x232c});config[_0x6521('0xd')]=_['defaults'](config[_0x6521('0xd')],{'host':_0x6521('0xe'),'port':0x18eb});var socket=require(_0x6521('0xf'))(new Redis(config['redis']));require(_0x6521('0x10'))[_0x6521('0x11')](socket);function respondWithRpcPromise(_0x3ddc58,_0x30b99e,_0x36048c){return new BPromise(function(_0x51a6b4,_0x31f421){return client['request'](_0x3ddc58,_0x36048c)[_0x6521('0x12')](function(_0x1c74eb){logger[_0x6521('0x13')]('FaxAccount,\x20%s,\x20%s',_0x30b99e,'request\x20sent');logger[_0x6521('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x30b99e,_0x6521('0x15'),JSON[_0x6521('0x16')](_0x1c74eb));if(_0x1c74eb[_0x6521('0x17')]){if(_0x1c74eb[_0x6521('0x17')]['code']===0x1f4){logger['error'](_0x6521('0x18'),_0x30b99e,_0x1c74eb[_0x6521('0x17')]['message']);return _0x31f421(_0x1c74eb[_0x6521('0x17')]['message']);}logger['error'](_0x6521('0x18'),_0x30b99e,_0x1c74eb['error'][_0x6521('0x19')]);return _0x51a6b4(_0x1c74eb['error'][_0x6521('0x19')]);}else{logger[_0x6521('0x13')](_0x6521('0x18'),_0x30b99e,_0x6521('0x15'));_0x51a6b4(_0x1c74eb['result'][_0x6521('0x19')]);}})[_0x6521('0x1a')](function(_0x254362){logger[_0x6521('0x17')](_0x6521('0x18'),_0x30b99e,_0x254362);_0x31f421(_0x254362);});});}exports[_0x6521('0x1b')]=function(_0x20b2ef){var _0x4c46bb=this;return new Promise(function(_0x30199e,_0x1da341){return db[_0x6521('0x1c')][_0x6521('0x1d')]({'raw':_0x20b2ef[_0x6521('0x1e')]?_0x20b2ef['options'][_0x6521('0x1f')]===undefined?!![]:![]:!![],'where':_0x20b2ef['options']?_0x20b2ef[_0x6521('0x1e')][_0x6521('0x20')]||null:null,'attributes':_0x20b2ef['options']?_0x20b2ef[_0x6521('0x1e')]['attributes']||null:null,'limit':_0x20b2ef[_0x6521('0x1e')]?_0x20b2ef[_0x6521('0x1e')]['limit']||null:null,'include':_0x20b2ef[_0x6521('0x1e')]?_0x20b2ef['options']['include']?_[_0x6521('0x21')](_0x20b2ef[_0x6521('0x1e')][_0x6521('0x22')],function(_0x31c54d){return{'model':db[_0x31c54d[_0x6521('0x23')]],'as':_0x31c54d['as'],'attributes':_0x31c54d[_0x6521('0x24')],'include':_0x31c54d[_0x6521('0x22')]?_[_0x6521('0x21')](_0x31c54d[_0x6521('0x22')],function(_0x223d85){return{'model':db[_0x223d85[_0x6521('0x23')]],'as':_0x223d85['as'],'attributes':_0x223d85[_0x6521('0x24')],'include':_0x223d85[_0x6521('0x22')]?_[_0x6521('0x21')](_0x223d85[_0x6521('0x22')],function(_0x196087){return{'model':db[_0x196087['model']],'as':_0x196087['as'],'attributes':_0x196087[_0x6521('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6521('0x12')](function(_0x53609d){logger[_0x6521('0x13')](_0x6521('0x1b'),_0x20b2ef);logger['debug']('GetFaxAccount',_0x20b2ef,JSON[_0x6521('0x16')](_0x53609d));_0x30199e(_0x53609d);})['catch'](function(_0x4efd00){logger[_0x6521('0x17')]('GetFaxAccount',_0x4efd00[_0x6521('0x19')],_0x20b2ef);_0x1da341(_0x4c46bb[_0x6521('0x17')](0x1f4,_0x4efd00[_0x6521('0x19')]));});});};exports[_0x6521('0x25')]=function(_0x3b1d01,_0x1bae02,_0xcf9873){var _0x45795b=this;return new Promise(function(_0x585cfe,_0x26c65e){var _0x3b8370={'body':_0x3b1d01['body'],'channel':_0x6521('0x26')};var _0x2db50c=[];var _0xdcdf5e=[];var _0x5484c8={};return db[_0x6521('0x27')][_0x6521('0x28')]()[_0x6521('0x12')](function(_0x3d6151){if(!_0x3d6151){throw new db[(_0x6521('0x29'))]['ValidationError']('no\x20available\x20attributes');}_0x2db50c=_[_0x6521('0x2a')](_[_0x6521('0x2b')](_0x3d6151),[_0x6521('0x2c'),_0x6521('0x2d')]);_0xdcdf5e=_[_0x6521('0x2a')](_['keys'](_0x3d6151),['createdAt',_0x6521('0x2d'),_0x6521('0x2e'),'ListId']);if(_0x3b1d01[_0x6521('0x2f')]['id']){delete _0x3b1d01['body']['id'];}if(_[_0x6521('0x30')](_0x3b1d01[_0x6521('0x2f')][_0x6521('0x31')])){throw new db['Sequelize']['ValidationError'](_0x6521('0x32'));}if(_[_0x6521('0x30')](_0x3b1d01['body']['body'])||_0x3b1d01[_0x6521('0x2f')][_0x6521('0x2f')]===''){throw new db[(_0x6521('0x29'))][(_0x6521('0x33'))](_0x6521('0x34'));}if(_['isNil'](_0x3b1d01[_0x6521('0x2f')][_0x6521('0x35')])){throw new db[(_0x6521('0x29'))]['ValidationError'](_0x6521('0x36')+_0xdcdf5e);}if(!_['includes'](_0xdcdf5e,_0x3b1d01[_0x6521('0x2f')]['mapKey'])){throw new db[(_0x6521('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xdcdf5e);}_0x5484c8[_0x3b1d01[_0x6521('0x2f')][_0x6521('0x35')]]=_0x3b1d01[_0x6521('0x2f')][_0x6521('0x31')];})[_0x6521('0x12')](function(){return db[_0x6521('0x1c')][_0x6521('0x37')]({'where':{'id':_0x3b1d01[_0x6521('0x38')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6521('0x27')],'as':_0x6521('0x39'),'where':_0x5484c8,'limit':0x1,'order':[[_0x6521('0x2d'),_0x6521('0x3a')]]}]},{'model':db[_0x6521('0x3b')],'as':_0x6521('0x3c')}]});})[_0x6521('0x12')](function(_0x362ee3){if(_0x362ee3&&_0x362ee3[_0x6521('0x3d')]){var _0x3f0353=_0x362ee3[_0x6521('0x3e')]({'plain':!![]});_0x3b8370[_0x6521('0x38')]=_0x3f0353;_0x3b8370[_0x6521('0x3f')]=_0x3f0353[_0x6521('0x3c')];_0x3b8370[_0x6521('0x40')]=_0x3f0353[_0x6521('0x3d')];_0x3b8370['applications']=_[_0x6521('0x41')](_0x3b8370[_0x6521('0x3f')],['priority'],[_0x6521('0x42')]);if(_0x3b8370['account'][_0x6521('0x3c')]){delete _0x3b8370['account'][_0x6521('0x3c')];}if(_0x3b8370[_0x6521('0x38')]['List']&&_0x3b8370[_0x6521('0x38')]['List'][_0x6521('0x39')][_0x6521('0x43')]){return _0x3b8370[_0x6521('0x38')]['List'][_0x6521('0x39')][0x0];}var _0x5bd2d1=_[_0x6521('0x44')](_0x3b1d01['body'],{'firstName':_0x3b1d01[_0x6521('0x2f')][_0x6521('0x31')],'ListId':_0x3f0353['ListId']});_0x5bd2d1[_0x3b1d01[_0x6521('0x2f')][_0x6521('0x35')]]=_0x3b1d01[_0x6521('0x2f')][_0x6521('0x31')];return db[_0x6521('0x27')][_0x6521('0x45')](_0x5bd2d1,{'fields':_0x2db50c,'raw':!![]});}})['then'](function(_0x30e14a){_0x3b8370[_0x6521('0x46')]=_0x30e14a;if(_0x30e14a){var _0x1b96c8={'ContactId':_0x30e14a['id'],'FaxAccountId':_0x3b1d01['account']['id'],'fax':_0x30e14a[_0x6521('0x26')]};return db['FaxInteraction'][_0x6521('0x37')]({'where':{'ContactId':_0x30e14a['id'],'closed':![],'FaxAccountId':_0x3b1d01['account']['id']}})[_0x6521('0x12')](function(_0x37f461){if(_0x37f461){return[_0x37f461,![]];}return db['FaxInteraction'][_0x6521('0x45')](_0x1b96c8)[_0x6521('0x12')](function(_0x596bc1){return[_0x596bc1,!![]];});});}else{throw new Error(_0x6521('0x47'));}})[_0x6521('0x48')](function(_0x3d07e7,_0xe4deb8){var _0xa37051=_0x3d07e7[_0x6521('0x3e')]({'plain':!![]});if(_0xe4deb8){if(_0x3b8370[_0x6521('0x38')]['autoclose']){_0x3b8370['applications'][_0x6521('0x49')]({'id':0x0,'priority':_0x3b8370[_0x6521('0x3f')][_0x6521('0x43')]+0x1,'app':_0x6521('0x4a'),'appdata':_0x6521('0x4b'),'interval':_0x6521('0x4c')});}_0xa37051[_0x6521('0x4d')]=!![];}else{_0xa37051[_0x6521('0x4d')]=![];}_0x3b8370['interaction']=_0xa37051;return db[_0x6521('0x4e')]['create']({'body':_0x3b1d01[_0x6521('0x2f')][_0x6521('0x2f')],'FaxAccountId':_0x3b1d01['account']['id'],'FaxInteractionId':_0x3d07e7['id'],'direction':'in','ContactId':_0x3d07e7[_0x6521('0x4f')],'AttachmentId':_0x3b1d01[_0x6521('0x2f')]['AttachmentId']});})[_0x6521('0x12')](function(_0x57d672){_0x3b8370[_0x6521('0x19')]=_0x57d672;if(_0x3b8370[_0x6521('0x50')][_0x6521('0x51')]){return db[_0x6521('0x52')][_0x6521('0x37')]({'attributes':['id',_0x6521('0x53')],'where':{'id':_0x3b8370['interaction'][_0x6521('0x51')]}})[_0x6521('0x12')](function(_0x4b8dda){if(_0x4b8dda){_0x3b8370['applications'][_0x6521('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b8dda[_0x6521('0x53')]+','+(_0x3b8370[_0x6521('0x38')][_0x6521('0x55')]||0xa),'interval':_0x6521('0x4c')});}return respondWithRpcPromise(_0x6521('0x56'),_0x6521('0x57'),_0x3b8370);});}return respondWithRpcPromise(_0x6521('0x56'),_0x6521('0x57'),_0x3b8370);})[_0x6521('0x12')](function(_0x1722ca){_0x585cfe(_0x1722ca);})[_0x6521('0x1a')](function(_0x19cc32){_0x26c65e(_0x45795b[_0x6521('0x17')](0x1f4,_0x19cc32[_0x6521('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 392bbd9..fba911f 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 _0xd6ad=['length','faxAccount:','remove','update','removeListener','register'];(function(_0x14d5fc,_0x43244d){var _0x4ced81=function(_0x77dba9){while(--_0x77dba9){_0x14d5fc['push'](_0x14d5fc['shift']());}};_0x4ced81(++_0x43244d);}(_0xd6ad,0x13a));var _0xdd6a=function(_0x1c413e,_0x51788b){_0x1c413e=_0x1c413e-0x0;var _0x1d8309=_0xd6ad[_0x1c413e];return _0x1d8309;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0xdd6a('0x0'),_0xdd6a('0x1')];function createListener(_0x113a77,_0x44fbf1){return function(_0x271572){_0x44fbf1['emit'](_0x113a77,_0x271572);};}function removeListener(_0x1fa640,_0x544a79){return function(){FaxAccountEvents[_0xdd6a('0x2')](_0x1fa640,_0x544a79);};}exports[_0xdd6a('0x3')]=function(_0x254960){for(var _0x59496e=0x0,_0xf3b03b=events[_0xdd6a('0x4')];_0x59496e<_0xf3b03b;_0x59496e++){var _0x48eee0=events[_0x59496e];var _0x540cd4=createListener(_0xdd6a('0x5')+_0x48eee0,_0x254960);FaxAccountEvents['on'](_0x48eee0,_0x540cd4);}}; \ No newline at end of file +var _0x56eb=['faxAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0x32b50d,_0x4e0723){var _0x1b4bfd=function(_0x21d1dc){while(--_0x21d1dc){_0x32b50d['push'](_0x32b50d['shift']());}};_0x1b4bfd(++_0x4e0723);}(_0x56eb,0x1c1));var _0xb56e=function(_0x508613,_0x57dd44){_0x508613=_0x508613-0x0;var _0x2e92c6=_0x56eb[_0x508613];return _0x2e92c6;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xb56e('0x0'),_0xb56e('0x1'),_0xb56e('0x2')];function createListener(_0x3d067b,_0x4f2bb8){return function(_0x57ea20){_0x4f2bb8[_0xb56e('0x3')](_0x3d067b,_0x57ea20);};}function removeListener(_0x5a821e,_0x1d3741){return function(){FaxAccountEvents[_0xb56e('0x4')](_0x5a821e,_0x1d3741);};}exports[_0xb56e('0x5')]=function(_0x38ed96){for(var _0x4854a8=0x0,_0x2e9547=events[_0xb56e('0x6')];_0x4854a8<_0x2e9547;_0x4854a8++){var _0x4ceaad=events[_0x4854a8];var _0x5c710c=createListener(_0xb56e('0x7')+_0x4ceaad,_0x38ed96);FaxAccountEvents['on'](_0x4ceaad,_0x5c710c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1901444..8b63539 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x33ae96,_0x4718e7){var _0x5df3ef=function(_0x4cc962){while(--_0x4cc962){_0x33ae96['push'](_0x33ae96['shift']());}};_0x5df3ef(++_0x4718e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x436017,_0x47c412){var _0x50ed01=function(_0x1dd020){while(--_0x1dd020){_0x436017['push'](_0x436017['shift']());}};_0x50ed01(++_0x47c412);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index e0689ef..be82318 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 _0x17e6=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x17e6,0x19c));var _0x617e=function(_0x292427,_0x5dc5d1){_0x292427=_0x292427-0x0;var _0x1e5629=_0x17e6[_0x292427];return _0x1e5629;};'use strict';var Sequelize=require(_0x617e('0x0'));module[_0x617e('0x1')]={'priority':{'type':Sequelize[_0x617e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x617e('0x3')],'allowNull':![],'defaultValue':_0x617e('0x4')},'appdata':{'type':Sequelize[_0x617e('0x5')]()},'description':{'type':Sequelize[_0x617e('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x617e('0x6')}}; \ No newline at end of file +var _0xe48c=['INTEGER','STRING','TEXT','sequelize'];(function(_0x4a5cb5,_0x45fde9){var _0x17a2db=function(_0x51d067){while(--_0x51d067){_0x4a5cb5['push'](_0x4a5cb5['shift']());}};_0x17a2db(++_0x45fde9);}(_0xe48c,0x107));var _0xce48=function(_0x5bd309,_0x1e82cd){_0x5bd309=_0x5bd309-0x0;var _0x3eec3a=_0xe48c[_0x5bd309];return _0x3eec3a;};'use strict';var Sequelize=require(_0xce48('0x0'));module['exports']={'priority':{'type':Sequelize[_0xce48('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xce48('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xce48('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xce48('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index db0096e..f71a8aa 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 _0x8512=['../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','update','destroy','then','error','name','send','index','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FaxApplication','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x458bda,_0x424a93){var _0x5d6550=function(_0x4614f8){while(--_0x4614f8){_0x458bda['push'](_0x458bda['shift']());}};_0x5d6550(++_0x424a93);}(_0x8512,0x7a));var _0x2851=function(_0x123a35,_0x15be76){_0x123a35=_0x123a35-0x0;var _0x31e8d6=_0x8512[_0x123a35];return _0x31e8d6;};'use strict';var emlformat=require(_0x2851('0x0'));var rimraf=require(_0x2851('0x1'));var zipdir=require(_0x2851('0x2'));var jsonpatch=require(_0x2851('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2851('0x4'));var Mustache=require(_0x2851('0x5'));var util=require(_0x2851('0x6'));var path=require(_0x2851('0x7'));var sox=require(_0x2851('0x8'));var csv=require(_0x2851('0x9'));var ejs=require(_0x2851('0xa'));var fs=require('fs');var fs_extra=require(_0x2851('0xb'));var _=require(_0x2851('0xc'));var squel=require(_0x2851('0xd'));var crypto=require(_0x2851('0xe'));var jsforce=require(_0x2851('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2851('0x9'));var querystring=require(_0x2851('0x10'));var Papa=require('papaparse');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(_0x2851('0x11'));var logger=require(_0x2851('0x12'))(_0x2851('0x13'));var utils=require(_0x2851('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2851('0x15'));var db=require(_0x2851('0x16'))['db'];function respondWithStatusCode(_0x13188f,_0x4bc90c){_0x4bc90c=_0x4bc90c||0xcc;return function(_0x39a73f){if(_0x39a73f){return _0x13188f[_0x2851('0x17')](_0x4bc90c);}return _0x13188f['status'](_0x4bc90c)[_0x2851('0x18')]();};}function respondWithResult(_0x2d4684,_0x281028){_0x281028=_0x281028||0xc8;return function(_0x1df543){if(_0x1df543){return _0x2d4684[_0x2851('0x19')](_0x281028)['json'](_0x1df543);}};}function respondWithFilteredResult(_0x32d563,_0x3bc311){return function(_0xe80df0){if(_0xe80df0){var _0xdc8aeb=typeof _0x3bc311[_0x2851('0x1a')]===_0x2851('0x1b')&&typeof _0x3bc311[_0x2851('0x1c')]===_0x2851('0x1b');var _0x4a3636=_0xe80df0['count'];var _0xfad72c=_0xdc8aeb?0x0:_0x3bc311[_0x2851('0x1a')];var _0x1f49bc=_0xdc8aeb?_0xe80df0[_0x2851('0x1d')]:_0x3bc311[_0x2851('0x1a')]+_0x3bc311[_0x2851('0x1c')];var _0x1d5853;if(_0x1f49bc>=_0x4a3636){_0x1f49bc=_0x4a3636;_0x1d5853=0xc8;}else{_0x1d5853=0xce;}_0x32d563[_0x2851('0x19')](_0x1d5853);return _0x32d563[_0x2851('0x1e')]('Content-Range',_0xfad72c+'-'+_0x1f49bc+'/'+_0x4a3636)[_0x2851('0x1f')](_0xe80df0);}return null;};}function patchUpdates(_0x48e1b7){return function(_0x55f37c){try{jsonpatch['apply'](_0x55f37c,_0x48e1b7,!![]);}catch(_0xea0be5){return BPromise[_0x2851('0x20')](_0xea0be5);}return _0x55f37c['save']();};}function saveUpdates(_0x2edb23,_0x8f13d6){return function(_0x587e2d){if(_0x587e2d){return _0x587e2d[_0x2851('0x21')](_0x2edb23)['then'](function(_0x4aa893){return _0x4aa893;});}return null;};}function removeEntity(_0x5e89b2,_0x132963){return function(_0x121c4f){if(_0x121c4f){return _0x121c4f[_0x2851('0x22')]()[_0x2851('0x23')](function(){_0x5e89b2['status'](0xcc)[_0x2851('0x18')]();});}};}function handleEntityNotFound(_0x4cbefc,_0x53e3ac){return function(_0x3dc5e8){if(!_0x3dc5e8){_0x4cbefc[_0x2851('0x17')](0x194);}return _0x3dc5e8;};}function handleError(_0x132723,_0x29eacb){_0x29eacb=_0x29eacb||0x1f4;return function(_0x560826){logger[_0x2851('0x24')](_0x560826['stack']);if(_0x560826[_0x2851('0x25')]){delete _0x560826[_0x2851('0x25')];}_0x132723[_0x2851('0x19')](_0x29eacb)[_0x2851('0x26')](_0x560826);};}exports[_0x2851('0x27')]=function(_0xa9a36f,_0x3e8de2){var _0x54fb8f={},_0x272003={},_0x4a115e={'count':0x0,'rows':[]};var _0x19c086=_[_0x2851('0x28')](db['FaxApplication']['rawAttributes'],function(_0x587fff){return{'name':_0x587fff[_0x2851('0x29')],'type':_0x587fff[_0x2851('0x2a')][_0x2851('0x2b')]};});_0x272003[_0x2851('0x2c')]=_[_0x2851('0x28')](_0x19c086,'name');_0x272003[_0x2851('0x2d')]=_['keys'](_0xa9a36f[_0x2851('0x2d')]);_0x272003[_0x2851('0x2e')]=_['intersection'](_0x272003[_0x2851('0x2c')],_0x272003[_0x2851('0x2d')]);_0x54fb8f[_0x2851('0x2f')]=_[_0x2851('0x30')](_0x272003['model'],qs['fields'](_0xa9a36f[_0x2851('0x2d')][_0x2851('0x31')]));_0x54fb8f[_0x2851('0x2f')]=_0x54fb8f[_0x2851('0x2f')][_0x2851('0x32')]?_0x54fb8f['attributes']:_0x272003[_0x2851('0x2c')];if(!_0xa9a36f[_0x2851('0x2d')][_0x2851('0x33')](_0x2851('0x34'))){_0x54fb8f[_0x2851('0x1c')]=qs[_0x2851('0x1c')](_0xa9a36f[_0x2851('0x2d')][_0x2851('0x1c')]);_0x54fb8f[_0x2851('0x1a')]=qs[_0x2851('0x1a')](_0xa9a36f[_0x2851('0x2d')][_0x2851('0x1a')]);}_0x54fb8f['order']=qs[_0x2851('0x35')](_0xa9a36f[_0x2851('0x2d')][_0x2851('0x35')]);_0x54fb8f[_0x2851('0x36')]=qs[_0x2851('0x2e')](_[_0x2851('0x37')](_0xa9a36f['query'],_0x272003[_0x2851('0x2e')]),_0x19c086);if(_0xa9a36f['query'][_0x2851('0x38')]){_0x54fb8f[_0x2851('0x36')]=_['merge'](_0x54fb8f[_0x2851('0x36')],{'$or':_[_0x2851('0x28')](_0x19c086,function(_0x5deea7){if(_0x5deea7[_0x2851('0x2a')]!==_0x2851('0x39')){var _0x51742d={};_0x51742d[_0x5deea7[_0x2851('0x25')]]={'$like':'%'+_0xa9a36f[_0x2851('0x2d')][_0x2851('0x38')]+'%'};return _0x51742d;}})});}_0x54fb8f=_[_0x2851('0x3a')]({},_0x54fb8f,_0xa9a36f[_0x2851('0x3b')]);var _0x216eed={'where':_0x54fb8f[_0x2851('0x36')]};return db[_0x2851('0x3c')][_0x2851('0x1d')](_0x216eed)[_0x2851('0x23')](function(_0x26f3c2){_0x4a115e['count']=_0x26f3c2;if(_0xa9a36f[_0x2851('0x2d')][_0x2851('0x3d')]){_0x54fb8f[_0x2851('0x3e')]=[{'all':!![]}];}return db[_0x2851('0x3c')][_0x2851('0x3f')](_0x54fb8f);})[_0x2851('0x23')](function(_0x3a7225){_0x4a115e[_0x2851('0x40')]=_0x3a7225;return _0x4a115e;})[_0x2851('0x23')](respondWithFilteredResult(_0x3e8de2,_0x54fb8f))[_0x2851('0x41')](handleError(_0x3e8de2,null));};exports['show']=function(_0x3eaf48,_0x33153c){var _0x1ad026={'raw':!![],'where':{'id':_0x3eaf48[_0x2851('0x42')]['id']}},_0x2c6c4f={};_0x2c6c4f[_0x2851('0x2c')]=_[_0x2851('0x43')](db[_0x2851('0x3c')][_0x2851('0x44')]);_0x2c6c4f[_0x2851('0x2d')]=_[_0x2851('0x43')](_0x3eaf48[_0x2851('0x2d')]);_0x2c6c4f[_0x2851('0x2e')]=_['intersection'](_0x2c6c4f['model'],_0x2c6c4f[_0x2851('0x2d')]);_0x1ad026[_0x2851('0x2f')]=_[_0x2851('0x30')](_0x2c6c4f[_0x2851('0x2c')],qs[_0x2851('0x31')](_0x3eaf48[_0x2851('0x2d')][_0x2851('0x31')]));_0x1ad026['attributes']=_0x1ad026['attributes'][_0x2851('0x32')]?_0x1ad026[_0x2851('0x2f')]:_0x2c6c4f[_0x2851('0x2c')];if(_0x3eaf48[_0x2851('0x2d')][_0x2851('0x3d')]){_0x1ad026[_0x2851('0x3e')]=[{'all':!![]}];}_0x1ad026=_['merge']({},_0x1ad026,_0x3eaf48[_0x2851('0x3b')]);return db[_0x2851('0x3c')][_0x2851('0x45')](_0x1ad026)['then'](handleEntityNotFound(_0x33153c,null))[_0x2851('0x23')](respondWithResult(_0x33153c,null))[_0x2851('0x41')](handleError(_0x33153c,null));};exports['create']=function(_0x179239,_0x1b6130){return db[_0x2851('0x3c')][_0x2851('0x46')](_0x179239[_0x2851('0x47')],{})['then'](respondWithResult(_0x1b6130,0xc9))[_0x2851('0x41')](handleError(_0x1b6130,null));};exports[_0x2851('0x21')]=function(_0x3fc4e6,_0x2c9c96){if(_0x3fc4e6['body']['id']){delete _0x3fc4e6['body']['id'];}return db[_0x2851('0x3c')]['find']({'where':{'id':_0x3fc4e6[_0x2851('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c9c96,null))[_0x2851('0x23')](saveUpdates(_0x3fc4e6['body'],null))[_0x2851('0x23')](respondWithResult(_0x2c9c96,null))[_0x2851('0x41')](handleError(_0x2c9c96,null));};exports[_0x2851('0x22')]=function(_0x1916d1,_0x4f06fd){return db[_0x2851('0x3c')]['find']({'where':{'id':_0x1916d1[_0x2851('0x42')]['id']}})[_0x2851('0x23')](handleEntityNotFound(_0x4f06fd,null))[_0x2851('0x23')](removeEntity(_0x4f06fd,null))[_0x2851('0x41')](handleError(_0x4f06fd,null));}; \ No newline at end of file +var _0x6bdf=['params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','map','FaxApplication','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show'];(function(_0x1f999c,_0x4aaa0d){var _0x330de7=function(_0x3ec1f3){while(--_0x3ec1f3){_0x1f999c['push'](_0x1f999c['shift']());}};_0x330de7(++_0x4aaa0d);}(_0x6bdf,0x9b));var _0xf6bd=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x6bdf[_0x16629d];return _0x56ccee;};'use strict';var emlformat=require(_0xf6bd('0x0'));var rimraf=require(_0xf6bd('0x1'));var zipdir=require(_0xf6bd('0x2'));var jsonpatch=require(_0xf6bd('0x3'));var rp=require(_0xf6bd('0x4'));var moment=require(_0xf6bd('0x5'));var BPromise=require(_0xf6bd('0x6'));var Mustache=require('mustache');var util=require(_0xf6bd('0x7'));var path=require(_0xf6bd('0x8'));var sox=require(_0xf6bd('0x9'));var csv=require(_0xf6bd('0xa'));var ejs=require(_0xf6bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf6bd('0xc'));var crypto=require(_0xf6bd('0xd'));var jsforce=require(_0xf6bd('0xe'));var deskjs=require(_0xf6bd('0xf'));var toCsv=require(_0xf6bd('0xa'));var querystring=require(_0xf6bd('0x10'));var Papa=require(_0xf6bd('0x11'));var Redis=require(_0xf6bd('0x12'));var authService=require(_0xf6bd('0x13'));var qs=require(_0xf6bd('0x14'));var as=require(_0xf6bd('0x15'));var hardwareService=require(_0xf6bd('0x16'));var logger=require(_0xf6bd('0x17'))(_0xf6bd('0x18'));var utils=require(_0xf6bd('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x518e86,_0x2ba5cb){_0x2ba5cb=_0x2ba5cb||0xcc;return function(_0x1301a0){if(_0x1301a0){return _0x518e86[_0xf6bd('0x1a')](_0x2ba5cb);}return _0x518e86[_0xf6bd('0x1b')](_0x2ba5cb)['end']();};}function respondWithResult(_0x56b504,_0x25d9b1){_0x25d9b1=_0x25d9b1||0xc8;return function(_0x2e6fb7){if(_0x2e6fb7){return _0x56b504[_0xf6bd('0x1b')](_0x25d9b1)[_0xf6bd('0x1c')](_0x2e6fb7);}};}function respondWithFilteredResult(_0x5365b0,_0x5074ea){return function(_0x4ae0d4){if(_0x4ae0d4){var _0x44cc8d=typeof _0x5074ea[_0xf6bd('0x1d')]===_0xf6bd('0x1e')&&typeof _0x5074ea[_0xf6bd('0x1f')]===_0xf6bd('0x1e');var _0x2672b9=_0x4ae0d4[_0xf6bd('0x20')];var _0x3acec8=_0x44cc8d?0x0:_0x5074ea['offset'];var _0xa78b11=_0x44cc8d?_0x4ae0d4[_0xf6bd('0x20')]:_0x5074ea[_0xf6bd('0x1d')]+_0x5074ea[_0xf6bd('0x1f')];var _0x1a5b29;if(_0xa78b11>=_0x2672b9){_0xa78b11=_0x2672b9;_0x1a5b29=0xc8;}else{_0x1a5b29=0xce;}_0x5365b0['status'](_0x1a5b29);return _0x5365b0[_0xf6bd('0x21')](_0xf6bd('0x22'),_0x3acec8+'-'+_0xa78b11+'/'+_0x2672b9)['json'](_0x4ae0d4);}return null;};}function patchUpdates(_0x2ef23c){return function(_0x20d5e7){try{jsonpatch['apply'](_0x20d5e7,_0x2ef23c,!![]);}catch(_0x295584){return BPromise[_0xf6bd('0x23')](_0x295584);}return _0x20d5e7[_0xf6bd('0x24')]();};}function saveUpdates(_0x5a198f,_0x4a1043){return function(_0x5895dc){if(_0x5895dc){return _0x5895dc[_0xf6bd('0x25')](_0x5a198f)[_0xf6bd('0x26')](function(_0x321389){return _0x321389;});}return null;};}function removeEntity(_0x1a4da7,_0x10c7bc){return function(_0x77f673){if(_0x77f673){return _0x77f673[_0xf6bd('0x27')]()[_0xf6bd('0x26')](function(){_0x1a4da7[_0xf6bd('0x1b')](0xcc)[_0xf6bd('0x28')]();});}};}function handleEntityNotFound(_0x71ff93,_0x590eb3){return function(_0x4cccd8){if(!_0x4cccd8){_0x71ff93[_0xf6bd('0x1a')](0x194);}return _0x4cccd8;};}function handleError(_0x3e55df,_0x1f07bc){_0x1f07bc=_0x1f07bc||0x1f4;return function(_0x2d110d){logger['error'](_0x2d110d[_0xf6bd('0x29')]);if(_0x2d110d[_0xf6bd('0x2a')]){delete _0x2d110d[_0xf6bd('0x2a')];}_0x3e55df[_0xf6bd('0x1b')](_0x1f07bc)[_0xf6bd('0x2b')](_0x2d110d);};}exports['index']=function(_0x2472fb,_0x23322b){var _0x46016a={},_0xcfc033={},_0x3d9611={'count':0x0,'rows':[]};var _0x24f25f=_[_0xf6bd('0x2c')](db[_0xf6bd('0x2d')][_0xf6bd('0x2e')],function(_0x2c238b){return{'name':_0x2c238b[_0xf6bd('0x2f')],'type':_0x2c238b['type']['key']};});_0xcfc033[_0xf6bd('0x30')]=_['map'](_0x24f25f,'name');_0xcfc033['query']=_[_0xf6bd('0x31')](_0x2472fb[_0xf6bd('0x32')]);_0xcfc033[_0xf6bd('0x33')]=_[_0xf6bd('0x34')](_0xcfc033[_0xf6bd('0x30')],_0xcfc033[_0xf6bd('0x32')]);_0x46016a[_0xf6bd('0x35')]=_[_0xf6bd('0x34')](_0xcfc033[_0xf6bd('0x30')],qs[_0xf6bd('0x36')](_0x2472fb[_0xf6bd('0x32')][_0xf6bd('0x36')]));_0x46016a[_0xf6bd('0x35')]=_0x46016a[_0xf6bd('0x35')]['length']?_0x46016a['attributes']:_0xcfc033['model'];if(!_0x2472fb['query'][_0xf6bd('0x37')](_0xf6bd('0x38'))){_0x46016a[_0xf6bd('0x1f')]=qs[_0xf6bd('0x1f')](_0x2472fb[_0xf6bd('0x32')]['limit']);_0x46016a[_0xf6bd('0x1d')]=qs[_0xf6bd('0x1d')](_0x2472fb[_0xf6bd('0x32')][_0xf6bd('0x1d')]);}_0x46016a['order']=qs[_0xf6bd('0x39')](_0x2472fb['query'][_0xf6bd('0x39')]);_0x46016a[_0xf6bd('0x3a')]=qs[_0xf6bd('0x33')](_[_0xf6bd('0x3b')](_0x2472fb[_0xf6bd('0x32')],_0xcfc033[_0xf6bd('0x33')]),_0x24f25f);if(_0x2472fb[_0xf6bd('0x32')][_0xf6bd('0x3c')]){_0x46016a['where']=_['merge'](_0x46016a[_0xf6bd('0x3a')],{'$or':_[_0xf6bd('0x2c')](_0x24f25f,function(_0x44b069){if(_0x44b069[_0xf6bd('0x3d')]!==_0xf6bd('0x3e')){var _0x46a2ec={};_0x46a2ec[_0x44b069[_0xf6bd('0x2a')]]={'$like':'%'+_0x2472fb['query'][_0xf6bd('0x3c')]+'%'};return _0x46a2ec;}})});}_0x46016a=_[_0xf6bd('0x3f')]({},_0x46016a,_0x2472fb[_0xf6bd('0x40')]);var _0x2fb7eb={'where':_0x46016a[_0xf6bd('0x3a')]};return db[_0xf6bd('0x2d')][_0xf6bd('0x20')](_0x2fb7eb)[_0xf6bd('0x26')](function(_0x463c38){_0x3d9611[_0xf6bd('0x20')]=_0x463c38;if(_0x2472fb[_0xf6bd('0x32')][_0xf6bd('0x41')]){_0x46016a[_0xf6bd('0x42')]=[{'all':!![]}];}return db[_0xf6bd('0x2d')][_0xf6bd('0x43')](_0x46016a);})[_0xf6bd('0x26')](function(_0x155fe5){_0x3d9611['rows']=_0x155fe5;return _0x3d9611;})[_0xf6bd('0x26')](respondWithFilteredResult(_0x23322b,_0x46016a))[_0xf6bd('0x44')](handleError(_0x23322b,null));};exports[_0xf6bd('0x45')]=function(_0x4e58e5,_0x2928ee){var _0x2cb9f0={'raw':!![],'where':{'id':_0x4e58e5[_0xf6bd('0x46')]['id']}},_0x14a285={};_0x14a285[_0xf6bd('0x30')]=_[_0xf6bd('0x31')](db[_0xf6bd('0x2d')]['rawAttributes']);_0x14a285[_0xf6bd('0x32')]=_[_0xf6bd('0x31')](_0x4e58e5[_0xf6bd('0x32')]);_0x14a285[_0xf6bd('0x33')]=_[_0xf6bd('0x34')](_0x14a285['model'],_0x14a285['query']);_0x2cb9f0[_0xf6bd('0x35')]=_[_0xf6bd('0x34')](_0x14a285[_0xf6bd('0x30')],qs[_0xf6bd('0x36')](_0x4e58e5[_0xf6bd('0x32')][_0xf6bd('0x36')]));_0x2cb9f0[_0xf6bd('0x35')]=_0x2cb9f0[_0xf6bd('0x35')][_0xf6bd('0x47')]?_0x2cb9f0[_0xf6bd('0x35')]:_0x14a285[_0xf6bd('0x30')];if(_0x4e58e5[_0xf6bd('0x32')][_0xf6bd('0x41')]){_0x2cb9f0[_0xf6bd('0x42')]=[{'all':!![]}];}_0x2cb9f0=_['merge']({},_0x2cb9f0,_0x4e58e5[_0xf6bd('0x40')]);return db[_0xf6bd('0x2d')][_0xf6bd('0x48')](_0x2cb9f0)['then'](handleEntityNotFound(_0x2928ee,null))[_0xf6bd('0x26')](respondWithResult(_0x2928ee,null))[_0xf6bd('0x44')](handleError(_0x2928ee,null));};exports[_0xf6bd('0x49')]=function(_0x1cb323,_0x44a2ac){return db[_0xf6bd('0x2d')][_0xf6bd('0x49')](_0x1cb323[_0xf6bd('0x4a')],{})[_0xf6bd('0x26')](respondWithResult(_0x44a2ac,0xc9))[_0xf6bd('0x44')](handleError(_0x44a2ac,null));};exports[_0xf6bd('0x25')]=function(_0x32a934,_0x59447c){if(_0x32a934['body']['id']){delete _0x32a934[_0xf6bd('0x4a')]['id'];}return db[_0xf6bd('0x2d')][_0xf6bd('0x48')]({'where':{'id':_0x32a934['params']['id']}})['then'](handleEntityNotFound(_0x59447c,null))[_0xf6bd('0x26')](saveUpdates(_0x32a934[_0xf6bd('0x4a')],null))[_0xf6bd('0x26')](respondWithResult(_0x59447c,null))[_0xf6bd('0x44')](handleError(_0x59447c,null));};exports['destroy']=function(_0x222b74,_0x2adf26){return db[_0xf6bd('0x2d')][_0xf6bd('0x48')]({'where':{'id':_0x222b74['params']['id']}})[_0xf6bd('0x26')](handleEntityNotFound(_0x2adf26,null))[_0xf6bd('0x26')](removeEntity(_0x2adf26,null))[_0xf6bd('0x44')](handleError(_0x2adf26,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f54ca66..3d2d32c 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 _0xaeef=['FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaeef,0xb9));var _0xfaee=function(_0x423635,_0x237ecd){_0x423635=_0x423635-0x0;var _0x2ac702=_0xaeef[_0x423635];return _0x2ac702;};'use strict';var _=require(_0xfaee('0x0'));var util=require('util');var logger=require(_0xfaee('0x1'))(_0xfaee('0x2'));var moment=require(_0xfaee('0x3'));var BPromise=require(_0xfaee('0x4'));var rp=require(_0xfaee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfaee('0x6'));var config=require(_0xfaee('0x7'));var attributes=require('./faxApplication.attributes');module[_0xfaee('0x8')]=function(_0x2471a1,_0x19d860){return _0x2471a1[_0xfaee('0x9')](_0xfaee('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfaee('0xb'),'collate':_0xfaee('0xc')});}; \ No newline at end of file +var _0x07da=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3585db,_0x51a23b){var _0xce1e90=function(_0x5a1769){while(--_0x5a1769){_0x3585db['push'](_0x3585db['shift']());}};_0xce1e90(++_0x51a23b);}(_0x07da,0x113));var _0xa07d=function(_0x4f5da4,_0x4b2c6f){_0x4f5da4=_0x4f5da4-0x0;var _0x4eddcb=_0x07da[_0x4f5da4];return _0x4eddcb;};'use strict';var _=require(_0xa07d('0x0'));var util=require('util');var logger=require(_0xa07d('0x1'))(_0xa07d('0x2'));var moment=require(_0xa07d('0x3'));var BPromise=require(_0xa07d('0x4'));var rp=require(_0xa07d('0x5'));var fs=require('fs');var path=require(_0xa07d('0x6'));var rimraf=require(_0xa07d('0x7'));var config=require(_0xa07d('0x8'));var attributes=require(_0xa07d('0x9'));module[_0xa07d('0xa')]=function(_0x1b0456,_0x300aa9){return _0x1b0456[_0xa07d('0xb')]('FaxApplication',attributes,{'tableName':_0xa07d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa07d('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 1813b0a..5d26a33 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 _0x9b5f=['UpdateFaxApplication','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','update','body','options','raw','where','attributes','limit'];(function(_0x2199f7,_0x4f6410){var _0x6efa6a=function(_0x1d2362){while(--_0x1d2362){_0x2199f7['push'](_0x2199f7['shift']());}};_0x6efa6a(++_0x4f6410);}(_0x9b5f,0x7a));var _0xf9b5=function(_0x11c7d3,_0x47fe03){_0x11c7d3=_0x11c7d3-0x0;var _0x351767=_0x9b5f[_0x11c7d3];return _0x351767;};'use strict';var _=require(_0xf9b5('0x0'));var util=require(_0xf9b5('0x1'));var moment=require(_0xf9b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9b5('0x3'));var db=require(_0xf9b5('0x4'))['db'];var utils=require(_0xf9b5('0x5'));var logger=require(_0xf9b5('0x6'))(_0xf9b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xf9b5('0x8'));var client=jayson[_0xf9b5('0x9')][_0xf9b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c373,_0x49d429,_0x4ae75b){return new BPromise(function(_0x43ebbb,_0x446482){return client[_0xf9b5('0xb')](_0x29c373,_0x4ae75b)[_0xf9b5('0xc')](function(_0x5aa4bf){logger['info'](_0xf9b5('0xd'),_0x49d429,'request\x20sent');logger['debug'](_0xf9b5('0xe'),_0x49d429,_0xf9b5('0xf'),JSON[_0xf9b5('0x10')](_0x5aa4bf));if(_0x5aa4bf[_0xf9b5('0x11')]){if(_0x5aa4bf[_0xf9b5('0x11')]['code']===0x1f4){logger[_0xf9b5('0x11')]('FaxApplication,\x20%s,\x20%s',_0x49d429,_0x5aa4bf[_0xf9b5('0x11')][_0xf9b5('0x12')]);return _0x446482(_0x5aa4bf[_0xf9b5('0x11')][_0xf9b5('0x12')]);}logger[_0xf9b5('0x11')](_0xf9b5('0xd'),_0x49d429,_0x5aa4bf[_0xf9b5('0x11')][_0xf9b5('0x12')]);return _0x43ebbb(_0x5aa4bf[_0xf9b5('0x11')][_0xf9b5('0x12')]);}else{logger[_0xf9b5('0x13')](_0xf9b5('0xd'),_0x49d429,_0xf9b5('0xf'));_0x43ebbb(_0x5aa4bf['result'][_0xf9b5('0x12')]);}})[_0xf9b5('0x14')](function(_0x4ca4db){logger[_0xf9b5('0x11')](_0xf9b5('0xd'),_0x49d429,_0x4ca4db);_0x446482(_0x4ca4db);});});}exports['UpdateFaxApplication']=function(_0x197778){var _0x82f38d=this;return new Promise(function(_0x1a35f2,_0x598c5b){return db['FaxApplication'][_0xf9b5('0x15')](_0x197778[_0xf9b5('0x16')],{'raw':_0x197778[_0xf9b5('0x17')]?_0x197778[_0xf9b5('0x17')][_0xf9b5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197778[_0xf9b5('0x17')]?_0x197778['options'][_0xf9b5('0x19')]||null:null,'attributes':_0x197778[_0xf9b5('0x17')]?_0x197778['options'][_0xf9b5('0x1a')]||null:null,'limit':_0x197778[_0xf9b5('0x17')]?_0x197778[_0xf9b5('0x17')][_0xf9b5('0x1b')]||null:null})[_0xf9b5('0xc')](function(_0x103e75){logger[_0xf9b5('0x13')](_0xf9b5('0x1c'),_0x197778);logger[_0xf9b5('0x1d')](_0xf9b5('0x1c'),_0x197778,JSON[_0xf9b5('0x10')](_0x103e75));_0x1a35f2(_0x103e75);})[_0xf9b5('0x14')](function(_0x753fdf){logger['error'](_0xf9b5('0x1c'),_0x753fdf[_0xf9b5('0x12')],_0x197778);_0x598c5b(_0x82f38d[_0xf9b5('0x11')](0x1f4,_0x753fdf[_0xf9b5('0x12')]));});});}; \ No newline at end of file +var _0x9ee5=['body','options','raw','where','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateFaxApplication'];(function(_0x227b4e,_0x9c4da9){var _0x2597e4=function(_0x2921f5){while(--_0x2921f5){_0x227b4e['push'](_0x227b4e['shift']());}};_0x2597e4(++_0x9c4da9);}(_0x9ee5,0x123));var _0x59ee=function(_0xafb17c,_0x4faa87){_0xafb17c=_0xafb17c-0x0;var _0x3febc9=_0x9ee5[_0xafb17c];return _0x3febc9;};'use strict';var _=require(_0x59ee('0x0'));var util=require(_0x59ee('0x1'));var moment=require(_0x59ee('0x2'));var BPromise=require(_0x59ee('0x3'));var rs=require(_0x59ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x59ee('0x5'))(_0x59ee('0x6'));var config=require(_0x59ee('0x7'));var jayson=require(_0x59ee('0x8'));var client=jayson[_0x59ee('0x9')][_0x59ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b30ee,_0x17189d,_0x50a6a4){return new BPromise(function(_0x583dc2,_0x2bedc2){return client['request'](_0x2b30ee,_0x50a6a4)[_0x59ee('0xb')](function(_0x19cd8c){logger[_0x59ee('0xc')](_0x59ee('0xd'),_0x17189d,_0x59ee('0xe'));logger[_0x59ee('0xf')](_0x59ee('0x10'),_0x17189d,_0x59ee('0xe'),JSON[_0x59ee('0x11')](_0x19cd8c));if(_0x19cd8c[_0x59ee('0x12')]){if(_0x19cd8c[_0x59ee('0x12')]['code']===0x1f4){logger[_0x59ee('0x12')](_0x59ee('0xd'),_0x17189d,_0x19cd8c[_0x59ee('0x12')]['message']);return _0x2bedc2(_0x19cd8c['error'][_0x59ee('0x13')]);}logger[_0x59ee('0x12')]('FaxApplication,\x20%s,\x20%s',_0x17189d,_0x19cd8c['error'][_0x59ee('0x13')]);return _0x583dc2(_0x19cd8c[_0x59ee('0x12')]['message']);}else{logger[_0x59ee('0xc')](_0x59ee('0xd'),_0x17189d,_0x59ee('0xe'));_0x583dc2(_0x19cd8c['result'][_0x59ee('0x13')]);}})['catch'](function(_0x1d45d7){logger['error']('FaxApplication,\x20%s,\x20%s',_0x17189d,_0x1d45d7);_0x2bedc2(_0x1d45d7);});});}exports[_0x59ee('0x14')]=function(_0x44e7a8){var _0x28e2f2=this;return new Promise(function(_0x37b484,_0x5a3c2a){return db['FaxApplication']['update'](_0x44e7a8[_0x59ee('0x15')],{'raw':_0x44e7a8[_0x59ee('0x16')]?_0x44e7a8[_0x59ee('0x16')][_0x59ee('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44e7a8[_0x59ee('0x16')]?_0x44e7a8[_0x59ee('0x16')][_0x59ee('0x18')]||null:null,'attributes':_0x44e7a8[_0x59ee('0x16')]?_0x44e7a8[_0x59ee('0x16')]['attributes']||null:null,'limit':_0x44e7a8[_0x59ee('0x16')]?_0x44e7a8[_0x59ee('0x16')]['limit']||null:null})['then'](function(_0x35f40){logger[_0x59ee('0xc')](_0x59ee('0x14'),_0x44e7a8);logger[_0x59ee('0xf')]('UpdateFaxApplication',_0x44e7a8,JSON['stringify'](_0x35f40));_0x37b484(_0x35f40);})[_0x59ee('0x19')](function(_0x58e599){logger[_0x59ee('0x12')](_0x59ee('0x14'),_0x58e599['message'],_0x44e7a8);_0x5a3c2a(_0x28e2f2[_0x59ee('0x12')](0x1f4,_0x58e599[_0x59ee('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ca8a4f6..fbb312c 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6324=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x1dac5f,_0x571d8d){var _0x4841e3=function(_0x37235a){while(--_0x37235a){_0x1dac5f['push'](_0x1dac5f['shift']());}};_0x4841e3(++_0x571d8d);}(_0x6324,0x142));var _0x4632=function(_0x3abe2f,_0x1bdf2b){_0x3abe2f=_0x3abe2f-0x0;var _0x3f81e6=_0x6324[_0x3abe2f];return _0x3f81e6;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxApplication.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0xb')]('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0xe')]);router[_0x4632('0xf')](_0x4632('0x10'),auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);module[_0x4632('0x12')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x367dd3,_0xd1d1bf){var _0x5b7728=function(_0x502955){while(--_0x502955){_0x367dd3['push'](_0x367dd3['shift']());}};_0x5b7728(++_0xd1d1bf);}(_0xda3f,0xec));var _0xfda3=function(_0x188910,_0x18affe){_0x188910=_0x188910-0x0;var _0x16faed=_0xda3f[_0x188910];return _0x16faed;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 04ea536..f82b062 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 _0x1923=['out','ENUM','exports','STRING','DATE'];(function(_0x1e9b0f,_0x97cc2d){var _0x29f993=function(_0x18ae90){while(--_0x18ae90){_0x1e9b0f['push'](_0x1e9b0f['shift']());}};_0x29f993(++_0x97cc2d);}(_0x1923,0x12e));var _0x3192=function(_0x330f8a,_0x7949c2){_0x330f8a=_0x330f8a-0x0;var _0xd4f7b5=_0x1923[_0x330f8a];return _0xd4f7b5;};'use strict';var Sequelize=require('sequelize');module[_0x3192('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3192('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3192('0x1')]},'read1stAt':{'type':Sequelize[_0x3192('0x2')]},'fax':{'type':Sequelize[_0x3192('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x3192('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3192('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xeec6=['out','sequelize','DATE','STRING'];(function(_0x3369e7,_0x4a097e){var _0x27cfb6=function(_0x1e456e){while(--_0x1e456e){_0x3369e7['push'](_0x3369e7['shift']());}};_0x27cfb6(++_0x4a097e);}(_0xeec6,0x125));var _0x6eec=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0xeec6[_0x46a3e8];return _0xf1442e;};'use strict';var Sequelize=require(_0x6eec('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6eec('0x1')]},'disposition':{'type':Sequelize[_0x6eec('0x2')]},'secondDisposition':{'type':Sequelize[_0x6eec('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6eec('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6eec('0x1')]},'fax':{'type':Sequelize[_0x6eec('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6eec('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6eec('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6eec('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index a24e671..a723fa8 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 _0x3bc8=['having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','show','includeAll','include','create','params','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','Users','map','TagIds','split','forEach','Tags','catch','waiting','talking','unmanaged','closed','UserId','answered','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','find','value'];(function(_0x319421,_0x3e22c1){var _0xd576ab=function(_0x364d1a){while(--_0x364d1a){_0x319421['push'](_0x319421['shift']());}};_0xd576ab(++_0x3e22c1);}(_0x3bc8,0x150));var _0x83bc=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0x3bc8[_0x5d225a];return _0x1e7761;};'use strict';var emlformat=require(_0x83bc('0x0'));var rimraf=require(_0x83bc('0x1'));var zipdir=require(_0x83bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83bc('0x3'));var moment=require('moment');var BPromise=require(_0x83bc('0x4'));var Mustache=require(_0x83bc('0x5'));var util=require(_0x83bc('0x6'));var path=require(_0x83bc('0x7'));var sox=require(_0x83bc('0x8'));var csv=require(_0x83bc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83bc('0xa'));var squel=require('squel');var crypto=require(_0x83bc('0xb'));var jsforce=require(_0x83bc('0xc'));var deskjs=require(_0x83bc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x83bc('0xe'));var Papa=require(_0x83bc('0xf'));var Redis=require(_0x83bc('0x10'));var authService=require(_0x83bc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x83bc('0x12'));var hardwareService=require(_0x83bc('0x13'));var logger=require(_0x83bc('0x14'))(_0x83bc('0x15'));var utils=require(_0x83bc('0x16'));var config=require(_0x83bc('0x17'));var licenseUtil=require(_0x83bc('0x18'));var db=require(_0x83bc('0x19'))['db'];config['redis']=_[_0x83bc('0x1a')](config['redis'],{'host':_0x83bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0x83bc('0x1c')](socket);function respondWithStatusCode(_0x4d2230,_0x116001){_0x116001=_0x116001||0xcc;return function(_0x5ed0ea){if(_0x5ed0ea){return _0x4d2230[_0x83bc('0x1d')](_0x116001);}return _0x4d2230[_0x83bc('0x1e')](_0x116001)['end']();};}function respondWithResult(_0xe98fae,_0x462f15){_0x462f15=_0x462f15||0xc8;return function(_0x490aa4){if(_0x490aa4){return _0xe98fae[_0x83bc('0x1e')](_0x462f15)[_0x83bc('0x1f')](_0x490aa4);}};}function respondWithFilteredResult(_0x4fa568,_0x5cf456){return function(_0x114e6a){if(_0x114e6a){var _0x5e31f0=typeof _0x5cf456[_0x83bc('0x20')]===_0x83bc('0x21')&&typeof _0x5cf456['limit']===_0x83bc('0x21');var _0x19a387=_0x114e6a[_0x83bc('0x22')];var _0x43eef0=_0x5e31f0?0x0:_0x5cf456[_0x83bc('0x20')];var _0x504fb4=_0x5e31f0?_0x114e6a['count']:_0x5cf456[_0x83bc('0x20')]+_0x5cf456[_0x83bc('0x23')];var _0x2566d8;if(_0x504fb4>=_0x19a387){_0x504fb4=_0x19a387;_0x2566d8=0xc8;}else{_0x2566d8=0xce;}_0x4fa568[_0x83bc('0x1e')](_0x2566d8);return _0x4fa568[_0x83bc('0x24')](_0x83bc('0x25'),_0x43eef0+'-'+_0x504fb4+'/'+_0x19a387)[_0x83bc('0x1f')](_0x114e6a);}return null;};}function patchUpdates(_0x6f289c){return function(_0x287acc){try{jsonpatch[_0x83bc('0x26')](_0x287acc,_0x6f289c,!![]);}catch(_0x48eca3){return BPromise[_0x83bc('0x27')](_0x48eca3);}return _0x287acc[_0x83bc('0x28')]();};}function saveUpdates(_0x1f34ba,_0x3dd2e9){return function(_0x3d1593){if(_0x3d1593){return _0x3d1593[_0x83bc('0x29')](_0x1f34ba)['then'](function(_0x1e3fce){return _0x1e3fce;});}return null;};}function removeEntity(_0x1f2e59,_0x3b611d){return function(_0x432e4e){if(_0x432e4e){return _0x432e4e[_0x83bc('0x2a')]()[_0x83bc('0x2b')](function(){_0x1f2e59['status'](0xcc)[_0x83bc('0x2c')]();});}};}function handleEntityNotFound(_0x48efc1,_0xb6da4f){return function(_0x48db4c){if(!_0x48db4c){_0x48efc1[_0x83bc('0x1d')](0x194);}return _0x48db4c;};}function handleError(_0x3701f2,_0x352558){_0x352558=_0x352558||0x1f4;return function(_0x4ac272){logger['error'](_0x4ac272[_0x83bc('0x2d')]);if(_0x4ac272[_0x83bc('0x2e')]){delete _0x4ac272[_0x83bc('0x2e')];}_0x3701f2['status'](_0x352558)[_0x83bc('0x2f')](_0x4ac272);};}function getInteractionUsers(_0x253e39,_0x40c469){return new BPromise(function(_0x905f38,_0x7895e3){try{if(_0x40c469[_0x253e39['id']]){_0x253e39[_0x83bc('0x30')]=_[_0x83bc('0x31')](_0x40c469[_0x253e39['id']],function(_0x14e2f5){return{'id':_0x14e2f5['id'],'fullname':_0x14e2f5['fullname']};});}}catch(_0xb518b0){_0x7895e3(_0xb518b0);}_0x905f38(_0x253e39);});}function getInteractionTags(_0x44093c,_0x2f0192){return new BPromise(function(_0x4aa1cd,_0xc77cb){try{if(_0x44093c[_0x83bc('0x32')]){_0x44093c['Tags']=[];_0x44093c[_0x83bc('0x32')][_0x83bc('0x33')](',')[_0x83bc('0x34')](function(_0x243ac7){_0x44093c[_0x83bc('0x35')]['push'](_0x2f0192[_0x243ac7]);});}delete _0x44093c['TagIds'];}catch(_0x23706c){_0xc77cb(_0x23706c);}_0x4aa1cd(_0x44093c);});}function updateFaxInteraction(_0x2383b6,_0x29a5f9,_0x417dbc){return new BPromise(function(_0x33f221,_0x4ba8cd){return getInteractionUsers(_0x2383b6,_0x417dbc)[_0x83bc('0x2b')](function(_0x32d8cb){return getInteractionTags(_0x32d8cb,_0x29a5f9);})[_0x83bc('0x2b')](function(_0x1070ff){return getStateInteraction(_0x1070ff);})[_0x83bc('0x2b')](function(_0x37d935){_0x33f221(_0x37d935);})[_0x83bc('0x36')](function(_0x58ba91){_0x4ba8cd(_0x58ba91);});});}function getStateInteraction(_0x3ff051){return new BPromise(function(_0x5a115a){_0x3ff051[_0x83bc('0x37')]=0x0;_0x3ff051[_0x83bc('0x38')]=0x0;_0x3ff051['answered']=0x0;_0x3ff051[_0x83bc('0x39')]=0x0;_0x3ff051['total']=0x0;if(!_0x3ff051[_0x83bc('0x3a')]&&!_0x3ff051[_0x83bc('0x3b')]){_0x3ff051[_0x83bc('0x37')]+=0x1;}if(!_0x3ff051[_0x83bc('0x3a')]&&_0x3ff051[_0x83bc('0x3b')]){_0x3ff051[_0x83bc('0x38')]+=0x1;if(_0x3ff051[_0x83bc('0x37')]){_0x3ff051[_0x83bc('0x37')]-=0x1;}}if(_0x3ff051[_0x83bc('0x3a')]&&_0x3ff051['UserId']){_0x3ff051[_0x83bc('0x3c')]+=0x1;if(_0x3ff051[_0x83bc('0x38')]){_0x3ff051['talking']-=0x1;}}if(_0x3ff051[_0x83bc('0x3a')]&&!_0x3ff051[_0x83bc('0x3b')]){_0x3ff051[_0x83bc('0x39')]+=0x1;if(_0x3ff051[_0x83bc('0x37')]){_0x3ff051['waiting']-=0x1;}}_0x3ff051['total']+=0x1;_0x5a115a(_0x3ff051);});}exports['index']=function(_0x2fd45f,_0x69dc39){var _0x1b08e6={},_0x195a8f={},_0x144132={'count':0x0,'rows':[]};var _0x3e5429=_[_0x83bc('0x31')](db[_0x83bc('0x3d')][_0x83bc('0x3e')],function(_0x389778){return{'name':_0x389778[_0x83bc('0x3f')],'type':_0x389778[_0x83bc('0x40')][_0x83bc('0x41')]};});_0x195a8f[_0x83bc('0x42')]=_[_0x83bc('0x31')](_0x3e5429,_0x83bc('0x2e'));_0x195a8f[_0x83bc('0x43')]=_[_0x83bc('0x44')](_0x2fd45f[_0x83bc('0x43')]);_0x195a8f[_0x83bc('0x45')]=_['intersection'](_0x195a8f['model'],_0x195a8f[_0x83bc('0x43')]);_0x1b08e6['attributes']=_[_0x83bc('0x46')](_0x195a8f[_0x83bc('0x42')],qs[_0x83bc('0x47')](_0x2fd45f['query'][_0x83bc('0x47')]));_0x1b08e6[_0x83bc('0x48')]=_0x1b08e6[_0x83bc('0x48')]['length']?_0x1b08e6[_0x83bc('0x48')]:_0x195a8f[_0x83bc('0x42')];if(!_0x2fd45f['query']['hasOwnProperty'](_0x83bc('0x49'))){_0x1b08e6[_0x83bc('0x23')]=qs[_0x83bc('0x23')](_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x23')]);_0x1b08e6[_0x83bc('0x20')]=qs[_0x83bc('0x20')](_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x20')]);}_0x1b08e6['order']=qs[_0x83bc('0x4a')](_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x4a')]);_0x1b08e6[_0x83bc('0x4b')]=qs[_0x83bc('0x45')](_[_0x83bc('0x4c')](_0x2fd45f[_0x83bc('0x43')],_0x195a8f['filters']),_0x3e5429);var _0x4b11d2=[];var _0x215283=squel[_0x83bc('0x4d')]()[_0x83bc('0x4e')]('id')[_0x83bc('0x4e')]('name')[_0x83bc('0x4e')](_0x83bc('0x4f'))[_0x83bc('0x50')](_0x83bc('0x51'));var _0x4a4c2a=squel['select']()[_0x83bc('0x4e')](_0x83bc('0x52'))[_0x83bc('0x4e')](_0x83bc('0x53'))[_0x83bc('0x4e')](_0x83bc('0x54'))[_0x83bc('0x50')](_0x83bc('0x55'),'ui')[_0x83bc('0x56')](_0x83bc('0x57'),'u',_0x83bc('0x58'));var _0x47fa45=squel[_0x83bc('0x4d')]()[_0x83bc('0x50')]('fax_interactions','i')[_0x83bc('0x56')](_0x83bc('0x59'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x83bc('0x56')](_0x83bc('0x57'),'o',_0x83bc('0x5a'))[_0x83bc('0x56')]('fax_accounts','a',_0x83bc('0x5b'))[_0x83bc('0x56')](_0x83bc('0x5c'),'me',_0x83bc('0x5d'))[_0x83bc('0x56')](_0x83bc('0x5e'),'it',_0x83bc('0x5f'))[_0x83bc('0x56')](_0x83bc('0x51'),'t','t.id\x20=\x20it.TagId');var _0x28830b=squel[_0x83bc('0x60')]();var _0x4ea0ec=[];var _0x163424=squel[_0x83bc('0x60')]();var _0xe1561e;if(_0x2fd45f['query'][_0x83bc('0x61')]){_0xe1561e=as[_0x83bc('0x62')](_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x61')]);var _0x4871a3=_0xe1561e[_0x83bc('0x63')];for(var _0x2c50df=0x0;_0x2c50df<_0xe1561e[_0x83bc('0x64')][_0x83bc('0x65')];_0x2c50df++){var _0xdc389f=_0xe1561e[_0x83bc('0x64')][_0x2c50df];var _0x3e8e58='i';var _0x27a25c=_[_0x83bc('0x66')](_0x3e5429,[_0x83bc('0x2e'),_0xdc389f[_0x83bc('0x4e')]]);if(!_0x27a25c){switch(_0xdc389f['field']){case'unreadMessages':if(_0xdc389f[_0x83bc('0x67')]==0x1){_0x47fa45['having']('`'+_0xdc389f[_0x83bc('0x4e')]+'`\x20=\x200');}else{_0x47fa45[_0x83bc('0x68')]('`'+_0xdc389f[_0x83bc('0x4e')]+_0x83bc('0x69'));}break;case _0x83bc('0x6a'):if(_0xdc389f[_0x83bc('0x6b')]===_0x83bc('0x6c')){if(_0xdc389f[_0x83bc('0x67')][_0x83bc('0x33')]('\x20')[_0x83bc('0x65')]>0x1){_0x28830b[_0x4871a3](_0x83bc('0x6d'),qs['getFullTextValue'](_0xdc389f[_0x83bc('0x67')]),null);}else{var _0x3bc99c='%'+_0xdc389f[_0x83bc('0x67')]+'%';_0x28830b[_0x4871a3](_0x83bc('0x6e'),_0x3bc99c,_0x3bc99c,_0x3bc99c);}}else{_0x27a25c=_[_0x83bc('0x66')](_0x3e5429,[_0x83bc('0x2e'),_0x83bc('0x6f')]);_0xdc389f[_0x83bc('0x4e')]='ContactId';_0x4a0ca3=as[_0x83bc('0x70')](_0x3e8e58,_0x27a25c[_0x83bc('0x40')],_0xdc389f);_0x28830b[_0x4871a3](_0x4a0ca3['text'],_0x4a0ca3['value'][_0x83bc('0x71')],_0x4a0ca3[_0x83bc('0x67')][_0x83bc('0x2c')]);}break;case _0x83bc('0x72'):var _0x50ca5b=_0xdc389f[_0x83bc('0x67')]['split'](',')[_0x83bc('0x31')](function(_0x1322d2){return Number(_0x1322d2);});_0x50ca5b[_0x83bc('0x34')](function(_0x402874){_0x163424['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x402874+',%');});_0x4ea0ec=_['union'](_0x4ea0ec,_0x50ca5b);break;case _0x83bc('0x73'):if(_0xdc389f[_0x83bc('0x6b')]===_0x83bc('0x6c')){_0x28830b[_0x4871a3](_0x83bc('0x74'),'%'+_0xdc389f[_0x83bc('0x67')]+'%',null);}else{_0x27a25c=_[_0x83bc('0x66')](_0x3e5429,[_0x83bc('0x2e'),'UserId']);_0xdc389f[_0x83bc('0x4e')]='UserId';_0x4a0ca3=as[_0x83bc('0x70')](_0x3e8e58,_0x27a25c[_0x83bc('0x40')],_0xdc389f);_0x28830b[_0x4871a3](_0x4a0ca3[_0x83bc('0x75')],_0x4a0ca3[_0x83bc('0x67')][_0x83bc('0x71')],_0x4a0ca3[_0x83bc('0x67')][_0x83bc('0x2c')]);}break;case _0x83bc('0x76'):_0x4a0ca3=as[_0x83bc('0x70')]('me',null,_0xdc389f);_0x28830b[_0x4871a3](_0x4a0ca3[_0x83bc('0x75')],_0x4a0ca3['value'][_0x83bc('0x71')],_0x4a0ca3[_0x83bc('0x67')][_0x83bc('0x2c')]);break;}}else{var _0x4a0ca3=as[_0x83bc('0x70')](_0x3e8e58,_0x27a25c[_0x83bc('0x40')],_0xdc389f);_0x28830b[_0x4871a3](_0x4a0ca3[_0x83bc('0x75')],_0x4a0ca3['value']['start'],_0x4a0ca3['value'][_0x83bc('0x2c')]);}}}else{var _0x30fb35=_(_0x2fd45f[_0x83bc('0x43')])[_0x83bc('0x44')]()[_0x83bc('0x31')](function(_0x2f08c5){return _[_0x83bc('0x77')](_0x3e5429,[_0x83bc('0x2e'),_0x2f08c5])?_0x2f08c5:undefined;})[_0x83bc('0x78')]()['value']();if(!_['isEmpty'](_0x30fb35)){_0x30fb35['forEach'](function(_0x5559a6){if(_0x5559a6===_0x83bc('0x79')){_0x47fa45[_0x83bc('0x4b')](_0x83bc('0x7a'),[][_0x83bc('0x7b')](_0x2fd45f[_0x83bc('0x43')][_0x5559a6]));}else if(_0x5559a6==='createdAt'){var _0x2d988c=JSON[_0x83bc('0x7c')](_0x2fd45f[_0x83bc('0x43')][_0x5559a6])['$gte'];var _0xacd86b=JSON['parse'](_0x2fd45f[_0x83bc('0x43')][_0x5559a6])[_0x83bc('0x7d')];_0x47fa45[_0x83bc('0x4b')](_0x83bc('0x7e'),_0x2d988c,_0xacd86b);}else{if(_0x2fd45f[_0x83bc('0x43')][_0x5559a6]===_0x83bc('0x7f')){_0x47fa45[_0x83bc('0x4b')]('i.'+_0x5559a6+_0x83bc('0x80'));}else{_0x47fa45[_0x83bc('0x4b')]('i.'+_0x5559a6+_0x83bc('0x81'),_0x2fd45f['query'][_0x5559a6]);}}});}if(_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x82')]){if(_0x2fd45f['query']['read']==0x1){_0x47fa45['having'](_0x83bc('0x83'));}else{_0x47fa45[_0x83bc('0x68')](_0x83bc('0x84'));}}if(_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x85')]){_0x4ea0ec=_['isArray'](_0x2fd45f['query'][_0x83bc('0x85')])?_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x85')]:new Array(_0x2fd45f['query']['tag']);_0x4ea0ec[_0x83bc('0x34')](function(_0x490673){_0x163424['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x490673+',%');});}if(_0x2fd45f[_0x83bc('0x43')]['filter']){var _0x908d74=_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x86')][_0x83bc('0x87')]('\x5c','\x5c\x5c')[_0x83bc('0x87')](/'/g,'\x27\x27');if(qs[_0x83bc('0x88')](_0x908d74)){_0x28830b['or']('i.id\x20LIKE\x20?',_0x908d74+'%')['or'](_0x83bc('0x89'),_0x908d74+'%');}_0x28830b['or'](_0x83bc('0x8a'),_0x908d74+'%');}}_0x47fa45['where'](_0x28830b);_0x47fa45[_0x83bc('0x8b')](_0x83bc('0x8c'));var _0x395c24={'type':db[_0x83bc('0x8d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4d49cb=_0x47fa45[_0x83bc('0x8e')]();_0x4d49cb[_0x83bc('0x4e')](_0x83bc('0x8c'));_0x4d49cb[_0x83bc('0x4e')](_0x83bc('0x8f'),_0x83bc('0x90'));if(_0x1b08e6['order']){_0x1b08e6[_0x83bc('0x91')]['forEach'](function(_0x355847){var _0x199d40=_0x355847[0x0]===_0x83bc('0x92')?_0x355847[0x0]:'i.'+_0x355847[0x0];_0x47fa45[_0x83bc('0x91')](_0x199d40,_0x355847[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x4ea0ec)){_0x47fa45[_0x83bc('0x68')](_0x163424);_0x4d49cb[_0x83bc('0x4b')](_0x83bc('0x93'),_0x4ea0ec);}BPromise[_0x83bc('0x94')]()[_0x83bc('0x2b')](function(){if(!_0xe1561e){if(_0x2fd45f[_0x83bc('0x43')][_0x83bc('0x79')])return;_0x4d49cb['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x47fa45['where'](_0x83bc('0x95'));return;}if(_0x2fd45f[_0x83bc('0x96')][_0x83bc('0x97')]!==_0x83bc('0x98'))return;return _0x2fd45f[_0x83bc('0x96')][_0x83bc('0x99')]({'attributes':['id'],'raw':!![]})[_0x83bc('0x2b')](function(_0x387246){if(_[_0x83bc('0x9a')](_0x387246)){_0x4d49cb[_0x83bc('0x4b')](_0x83bc('0x9b'));_0x47fa45[_0x83bc('0x4b')](_0x83bc('0x9b'));}else{_0x4d49cb[_0x83bc('0x4b')](_0x83bc('0x7a'),_[_0x83bc('0x31')](_0x387246,'id'));_0x47fa45[_0x83bc('0x4b')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x387246,'id'));}});})[_0x83bc('0x2b')](function(){if(_0x2fd45f[_0x83bc('0x96')][_0x83bc('0x97')]==='agent'&&!_0xe1561e&&!_0x2fd45f[_0x83bc('0x43')]['FaxAccountId'])return[];return db[_0x83bc('0x9c')][_0x83bc('0x43')](_0x4d49cb[_0x83bc('0x9d')](),_0x395c24);})[_0x83bc('0x2b')](function(_0x11cbf7){_0x144132[_0x83bc('0x22')]=_0x11cbf7['length'];if(_0x144132[_0x83bc('0x22')]===0x0)return[];return db[_0x83bc('0x9c')][_0x83bc('0x43')](_0x215283[_0x83bc('0x9d')](),_0x395c24)['then'](function(_0x17e56b){_0x4b11d2=_['keyBy'](_0x17e56b,'id');_0x395c24=_[_0x83bc('0x9e')](_0x395c24,{'model':db[_0x83bc('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fd45f['query']['fields']){_0x1b08e6[_0x83bc('0x48')][_0x83bc('0x34')](function(_0x1343ad){_0x47fa45[_0x83bc('0x4e')]('i.'+_0x1343ad);});}else{_0x47fa45[_0x83bc('0x4e')](_0x83bc('0x8f'),_0x83bc('0x90'));_0x47fa45[_0x83bc('0x4e')](_0x83bc('0x9f'),_0x83bc('0xa0'));_0x47fa45[_0x83bc('0x4e')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x47fa45[_0x83bc('0x4e')](_0x83bc('0xa1'),_0x83bc('0x92'));_0x47fa45[_0x83bc('0x4e')](_0x83bc('0xa2'));_0x47fa45['field'](_0x83bc('0xa3'),_0x83bc('0xa4'));_0x47fa45[_0x83bc('0x4e')]('c.lastName','Contact.lastName');_0x47fa45['field']('c.email','Contact.email');_0x47fa45[_0x83bc('0x4e')]('c.phone','Contact.phone');_0x47fa45[_0x83bc('0x4e')](_0x83bc('0xa5'),_0x83bc('0xa6'));_0x47fa45[_0x83bc('0x4e')]('c.fax',_0x83bc('0xa7'));_0x47fa45[_0x83bc('0x4e')](_0x83bc('0xa8'),_0x83bc('0xa9'));_0x47fa45[_0x83bc('0x4e')]('o.internal',_0x83bc('0xaa'));_0x47fa45[_0x83bc('0x4e')](_0x83bc('0xab'),'TagIds');}if(_0x1b08e6['limit'])_0x47fa45['limit'](_0x1b08e6[_0x83bc('0x23')]);if(_0x1b08e6[_0x83bc('0x20')])_0x47fa45[_0x83bc('0x20')](_0x1b08e6[_0x83bc('0x20')]);return db[_0x83bc('0x9c')][_0x83bc('0x43')](_0x47fa45[_0x83bc('0x9d')](),_0x395c24);})[_0x83bc('0x2b')](function(_0x3d9741){if(_0x3d9741['length']>0x0)_0x4a4c2a[_0x83bc('0x4b')](_0x83bc('0xac'),_['map'](_0x3d9741,'id'));return db[_0x83bc('0x9c')][_0x83bc('0x43')](_0x4a4c2a[_0x83bc('0x9d')](),_0x395c24)['then'](function(_0x31b471){var _0x1cb935=_[_0x83bc('0xad')](_0x31b471,_0x83bc('0xae'));var _0x558cc6=[];_0x3d9741['forEach'](function(_0x3de0f3){_0x558cc6[_0x83bc('0xaf')](updateFaxInteraction(_0x3de0f3,_0x4b11d2,_0x1cb935));});return BPromise[_0x83bc('0xb0')](_0x558cc6);});});})[_0x83bc('0x2b')](function(_0x360b8c){_0x144132[_0x83bc('0xb1')]=_0x360b8c;return _0x144132;})[_0x83bc('0x2b')](respondWithFilteredResult(_0x69dc39,_0x1b08e6))[_0x83bc('0x36')](handleError(_0x69dc39,null));};exports[_0x83bc('0xb2')]=function(_0x364d05,_0x184172){var _0x49c008={'raw':![],'where':{'id':_0x364d05['params']['id']}},_0x2f98ba={};_0x2f98ba[_0x83bc('0x42')]=_[_0x83bc('0x44')](db['FaxInteraction'][_0x83bc('0x3e')]);_0x2f98ba[_0x83bc('0x43')]=_['keys'](_0x364d05['query']);_0x2f98ba[_0x83bc('0x45')]=_[_0x83bc('0x46')](_0x2f98ba['model'],_0x2f98ba['query']);_0x49c008['attributes']=_[_0x83bc('0x46')](_0x2f98ba['model'],qs['fields'](_0x364d05['query'][_0x83bc('0x47')]));_0x49c008['attributes']=_0x49c008[_0x83bc('0x48')][_0x83bc('0x65')]?_0x49c008[_0x83bc('0x48')]:_0x2f98ba[_0x83bc('0x42')];if(_0x364d05[_0x83bc('0x43')][_0x83bc('0xb3')]){_0x49c008[_0x83bc('0xb4')]=[{'all':!![]}];}_0x49c008=_['merge']({},_0x49c008,_0x364d05['options']);return db[_0x83bc('0x3d')]['find'](_0x49c008)['then'](handleEntityNotFound(_0x184172,null))[_0x83bc('0x2b')](respondWithResult(_0x184172,null))['catch'](handleError(_0x184172,null));};exports[_0x83bc('0xb5')]=function(_0x2a3557,_0x483ef5){return db[_0x83bc('0x3d')]['create'](_0x2a3557[_0x83bc('0x76')],{})[_0x83bc('0x2b')](respondWithResult(_0x483ef5,0xc9))[_0x83bc('0x36')](handleError(_0x483ef5,null));};exports[_0x83bc('0x29')]=function(_0xed7f13,_0x1d1f27){if(_0xed7f13[_0x83bc('0x76')]['id']){delete _0xed7f13[_0x83bc('0x76')]['id'];}return db['FaxInteraction'][_0x83bc('0x66')]({'where':{'id':_0xed7f13[_0x83bc('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1d1f27,null))[_0x83bc('0x2b')](saveUpdates(_0xed7f13[_0x83bc('0x76')],null))[_0x83bc('0x2b')](respondWithResult(_0x1d1f27,null))[_0x83bc('0x36')](handleError(_0x1d1f27,null));};exports['destroy']=function(_0x1edea1,_0x3564bc){return db[_0x83bc('0x3d')][_0x83bc('0x66')]({'where':{'id':_0x1edea1['params']['id']}})[_0x83bc('0x2b')](handleEntityNotFound(_0x3564bc,null))[_0x83bc('0x2b')](removeEntity(_0x3564bc,null))[_0x83bc('0x36')](handleError(_0x3564bc,null));};exports[_0x83bc('0xb7')]=function(_0x1398f4,_0x487df5){return db[_0x83bc('0x3d')][_0x83bc('0xb7')]()[_0x83bc('0x2b')](respondWithResult(_0x487df5,null))[_0x83bc('0x36')](handleError(_0x487df5,null));};exports[_0x83bc('0xb8')]=function(_0x383d52,_0x24fbe9,_0xf3bdee){return db[_0x83bc('0xb9')][_0x83bc('0x66')]({'where':{'id':_0x383d52['params']['id']}})[_0x83bc('0x2b')](handleEntityNotFound(_0x24fbe9,null))[_0x83bc('0x2b')](function(_0x22486d){if(_0x22486d){return _0x22486d[_0x83bc('0xb8')](_0x383d52[_0x83bc('0x76')][_0x83bc('0xba')],_[_0x83bc('0xbb')](_0x383d52['body'],[_0x83bc('0xba'),'id'])||{});}})[_0x83bc('0x2b')](respondWithResult(_0x24fbe9,null))[_0x83bc('0x36')](handleError(_0x24fbe9,null));};exports['getMessages']=function(_0x5eaccc,_0x82da11,_0x173af9){var _0x3e770b={'raw':![],'where':{}};var _0x4d768f={};var _0x475662={'count':0x0,'rows':[]};return db[_0x83bc('0x3d')][_0x83bc('0xbc')]({'where':{'id':_0x5eaccc['params']['id']}})[_0x83bc('0x2b')](handleEntityNotFound(_0x82da11,null))[_0x83bc('0x2b')](function(_0x30a2fd){if(_0x30a2fd){_0x4d768f[_0x83bc('0x42')]=_[_0x83bc('0x44')](db[_0x83bc('0xb9')][_0x83bc('0x3e')]);_0x4d768f[_0x83bc('0x43')]=_[_0x83bc('0x44')](_0x5eaccc[_0x83bc('0x43')]);_0x4d768f[_0x83bc('0x45')]=_[_0x83bc('0x46')](_0x4d768f['model'],_0x4d768f[_0x83bc('0x43')]);_0x3e770b[_0x83bc('0x48')]=_['intersection'](_0x4d768f[_0x83bc('0x42')],qs[_0x83bc('0x47')](_0x5eaccc['query'][_0x83bc('0x47')]));_0x3e770b['attributes']=_0x3e770b[_0x83bc('0x48')][_0x83bc('0x65')]?_0x3e770b[_0x83bc('0x48')]:_0x4d768f['model'];if(!_0x5eaccc[_0x83bc('0x43')][_0x83bc('0xbd')](_0x83bc('0x49'))){_0x3e770b['limit']=qs[_0x83bc('0x23')](_0x5eaccc['query'][_0x83bc('0x23')]);_0x3e770b['offset']=qs['offset'](_0x5eaccc[_0x83bc('0x43')]['offset']);}_0x3e770b['order']=qs[_0x83bc('0x4a')](_0x5eaccc[_0x83bc('0x43')][_0x83bc('0x4a')]);_0x3e770b['where']=qs[_0x83bc('0x45')](_[_0x83bc('0x4c')](_0x5eaccc[_0x83bc('0x43')],_0x4d768f[_0x83bc('0x45')]));_0x3e770b[_0x83bc('0x4b')][_0x83bc('0xae')]=_0x30a2fd['id'];if(_0x5eaccc[_0x83bc('0x43')][_0x83bc('0x86')]){_0x3e770b[_0x83bc('0x4b')]=_[_0x83bc('0x9e')](_0x3e770b[_0x83bc('0x4b')],{'$or':_[_0x83bc('0x31')](_0x3e770b['attributes'],function(_0x795e67){var _0x5dcf6d={};_0x5dcf6d[_0x795e67]={'$like':'%'+_0x5eaccc[_0x83bc('0x43')][_0x83bc('0x86')]+'%'};return _0x5dcf6d;})});}if(_0x5eaccc['query'][_0x83bc('0xbe')]){var _0x31fb3f=_0x5eaccc[_0x83bc('0x43')][_0x83bc('0xbe')][_0x83bc('0x33')](',');var _0x3c1a5f={};_0x3c1a5f[_0x31fb3f[0x0]]={'$gte':moment(_0x31fb3f[0x1])[_0x83bc('0xbf')](_0x83bc('0xc0'))};_0x3e770b['where']=_[_0x83bc('0x9e')](_0x3e770b[_0x83bc('0x4b')],_0x3c1a5f);}_0x3e770b=_[_0x83bc('0x9e')]({},_0x3e770b,_0x5eaccc[_0x83bc('0xc1')]);return db[_0x83bc('0xb9')]['count']({'where':_0x3e770b[_0x83bc('0x4b')]})['then'](function(_0x54261d){_0x475662[_0x83bc('0x22')]=_0x54261d;if(_0x5eaccc['query']['includeAll']){_0x3e770b[_0x83bc('0xb4')]=[{'all':!![]}];}return db[_0x83bc('0xb9')][_0x83bc('0xc2')](_0x3e770b);})['then'](function(_0x39486f){_0x475662[_0x83bc('0xb1')]=_0x39486f;return _0x475662;});}})[_0x83bc('0x2b')](respondWithFilteredResult(_0x82da11,_0x3e770b))[_0x83bc('0x36')](handleError(_0x82da11,null));};exports['addTags']=function(_0x8fdf1b,_0x52381c,_0x5a2641){return db['FaxInteraction'][_0x83bc('0x66')]({'where':{'id':_0x8fdf1b[_0x83bc('0xb6')]['id']}})[_0x83bc('0x2b')](handleEntityNotFound(_0x52381c,null))[_0x83bc('0x2b')](function(_0x4d4d53){if(_0x4d4d53){return _0x4d4d53['setTags'](_0x8fdf1b[_0x83bc('0x76')]['ids'],_[_0x83bc('0xbb')](_0x8fdf1b['body'],[_0x83bc('0xba'),'id'])||{})[_0x83bc('0xc3')](function(){return db['Tag']['findAll']({'attributes':['id',_0x83bc('0x2e'),_0x83bc('0x4f')],'where':{'id':_0x8fdf1b['body']['ids']}});})[_0x83bc('0x2b')](function(_0x59f503){socket[_0x83bc('0xc4')](_0x83bc('0xc5'),{'id':Number(_0x8fdf1b[_0x83bc('0xb6')]['id']),'tags':_0x59f503||[]});return{'id':Number(_0x8fdf1b[_0x83bc('0xb6')]['id']),'tags':_0x59f503||[]};});}})[_0x83bc('0x2b')](respondWithResult(_0x52381c,null))[_0x83bc('0x36')](handleError(_0x52381c,null));};exports[_0x83bc('0xc6')]=function(_0xc444ad,_0x46aa2f,_0x5bbe1c){return db['FaxInteraction'][_0x83bc('0x66')]({'where':{'id':_0xc444ad[_0x83bc('0xb6')]['id']}})[_0x83bc('0x2b')](handleEntityNotFound(_0x46aa2f,null))[_0x83bc('0x2b')](function(_0x39f8c3){if(_0x39f8c3){return _0x39f8c3['removeTags'](_0xc444ad['query']['ids']);}})['then'](respondWithStatusCode(_0x46aa2f,null))[_0x83bc('0x36')](handleError(_0x46aa2f,null));};exports[_0x83bc('0xc7')]=function(_0x538753,_0x2f15df){var _0x13e55f=moment()['unix']()[_0x83bc('0x9d')]();var _0x56adfc=path[_0x83bc('0xc8')](config[_0x83bc('0xc9')],_0x83bc('0xca'),'files',_0x83bc('0xcb'));var _0x1dfc7b=path[_0x83bc('0xc8')](config[_0x83bc('0xc9')],_0x83bc('0xca'),_0x83bc('0xcc'),_0x83bc('0xcd'));var _0x5668c3=path['join'](_0x56adfc,_0x13e55f);var _0x1a22b6=util['format'](_0x83bc('0xce'),_0x538753['params']['id'],_0x13e55f);var _0x1d0f57=path[_0x83bc('0xc8')](_0x56adfc,_0x1a22b6);var _0x56c2a7=[];_0x56c2a7[_0x83bc('0xaf')]({'model':db[_0x83bc('0xcf')],'as':_0x83bc('0xcf'),'raw':!![]});var _0x7d5e19=[{'model':db[_0x83bc('0xb9')],'as':_0x83bc('0xd0'),'attributes':['id',_0x83bc('0x76'),_0x83bc('0xd1')],'include':_0x56c2a7}];return db['FaxInteraction'][_0x83bc('0x66')]({'where':{'id':_0x538753[_0x83bc('0xb6')]['id']},'include':_0x7d5e19})[_0x83bc('0x2b')](handleEntityNotFound(_0x2f15df,null))[_0x83bc('0x2b')](function(_0x33dc78){if(_0x33dc78&&_0x33dc78[_0x83bc('0xd0')]){var _0x1e89c2=_0x33dc78[_0x83bc('0xd2')]({'plain':!![]});fs[_0x83bc('0xd3')](_0x5668c3);for(var _0x1e0834=0x0;_0x1e0834<_0x1e89c2[_0x83bc('0xd0')][_0x83bc('0x65')];_0x1e0834++){var _0x5937f8=_0x1e89c2['Messages'][_0x1e0834][_0x83bc('0xcf')];if(_0x5937f8){var _0x575e47=path['join'](_0x1dfc7b,_0x5937f8[_0x83bc('0xd4')]);if(fs[_0x83bc('0xd5')](_0x575e47)){fs[_0x83bc('0xd6')](_0x575e47)[_0x83bc('0xd7')](fs[_0x83bc('0xd8')](path[_0x83bc('0xc8')](_0x5668c3,_0x5937f8[_0x83bc('0xd4')])));}}}return BPromise[_0x83bc('0x94')]()[_0x83bc('0x2b')](function(){return new BPromise(function(_0x25a434,_0x24f6a1){zipdir(_0x5668c3,{'saveTo':_0x1d0f57},function(_0x58249f,_0xd357d8){if(_0x58249f)return _0x24f6a1(_0x58249f);return _0x25a434(_0xd357d8);});})[_0x83bc('0x2b')](function(){return new BPromise(function(_0x557f1b,_0x558987){rimraf(_0x5668c3,function(_0x5997a0){if(_0x5997a0)_0x558987(_0x5997a0);return _0x557f1b();});});})['then'](function(){return _0x2f15df[_0x83bc('0xc7')](_0x1d0f57,_0x1a22b6,function(_0x200836){if(_0x200836){console[_0x83bc('0xd9')](_0x83bc('0xda'),_0x200836);}else{fs[_0x83bc('0xdb')](_0x1d0f57);}});});});}else{return _0x2f15df[_0x83bc('0x1d')](0xc8);}})[_0x83bc('0x36')](handleError(_0x2f15df,null));}; \ No newline at end of file +var _0x6a31=['c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','show','params','rawAttributes','includeAll','catch','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','FaxInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','setTags','spread','faxInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','resolve','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','error','name','send','Users','map','Tags','TagIds','split','forEach','push','then','waiting','talking','answered','total','UserId','closed','unmanaged','index','FaxInteraction','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','left_join','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','FaxAccountId','where','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','count','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6a31,0x116));var _0x16a3=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x6a31[_0x469a3c];return _0x968f4;};'use strict';var emlformat=require(_0x16a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16a3('0x1'));var jsonpatch=require(_0x16a3('0x2'));var rp=require(_0x16a3('0x3'));var moment=require(_0x16a3('0x4'));var BPromise=require(_0x16a3('0x5'));var Mustache=require('mustache');var util=require(_0x16a3('0x6'));var path=require(_0x16a3('0x7'));var sox=require(_0x16a3('0x8'));var csv=require(_0x16a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16a3('0xa'));var _=require(_0x16a3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x16a3('0xc'));var deskjs=require(_0x16a3('0xd'));var toCsv=require(_0x16a3('0x9'));var querystring=require(_0x16a3('0xe'));var Papa=require(_0x16a3('0xf'));var Redis=require(_0x16a3('0x10'));var authService=require(_0x16a3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x16a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16a3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x16a3('0x14'));var licenseUtil=require(_0x16a3('0x15'));var db=require(_0x16a3('0x16'))['db'];config[_0x16a3('0x17')]=_[_0x16a3('0x18')](config[_0x16a3('0x17')],{'host':_0x16a3('0x19'),'port':0x18eb});var socket=require(_0x16a3('0x1a'))(new Redis(config['redis']));require(_0x16a3('0x1b'))[_0x16a3('0x1c')](socket);function respondWithStatusCode(_0x373123,_0x132a86){_0x132a86=_0x132a86||0xcc;return function(_0x56fe91){if(_0x56fe91){return _0x373123[_0x16a3('0x1d')](_0x132a86);}return _0x373123[_0x16a3('0x1e')](_0x132a86)[_0x16a3('0x1f')]();};}function respondWithResult(_0x2cf172,_0x5b8c6f){_0x5b8c6f=_0x5b8c6f||0xc8;return function(_0x533a3a){if(_0x533a3a){return _0x2cf172[_0x16a3('0x1e')](_0x5b8c6f)['json'](_0x533a3a);}};}function respondWithFilteredResult(_0x71c34,_0x1870f9){return function(_0x263a6c){if(_0x263a6c){var _0x2e974d=typeof _0x1870f9[_0x16a3('0x20')]===_0x16a3('0x21')&&typeof _0x1870f9[_0x16a3('0x22')]===_0x16a3('0x21');var _0x265375=_0x263a6c['count'];var _0x3546d5=_0x2e974d?0x0:_0x1870f9[_0x16a3('0x20')];var _0x109be6=_0x2e974d?_0x263a6c['count']:_0x1870f9[_0x16a3('0x20')]+_0x1870f9[_0x16a3('0x22')];var _0x1d6dd9;if(_0x109be6>=_0x265375){_0x109be6=_0x265375;_0x1d6dd9=0xc8;}else{_0x1d6dd9=0xce;}_0x71c34[_0x16a3('0x1e')](_0x1d6dd9);return _0x71c34[_0x16a3('0x23')](_0x16a3('0x24'),_0x3546d5+'-'+_0x109be6+'/'+_0x265375)[_0x16a3('0x25')](_0x263a6c);}return null;};}function patchUpdates(_0x13e27b){return function(_0xbd4afe){try{jsonpatch[_0x16a3('0x26')](_0xbd4afe,_0x13e27b,!![]);}catch(_0x345254){return BPromise[_0x16a3('0x27')](_0x345254);}return _0xbd4afe[_0x16a3('0x28')]();};}function saveUpdates(_0xc9431f,_0x31879f){return function(_0x4044ae){if(_0x4044ae){return _0x4044ae['update'](_0xc9431f)['then'](function(_0x5f30f8){return _0x5f30f8;});}return null;};}function removeEntity(_0x31ed73,_0x56e990){return function(_0x31068a){if(_0x31068a){return _0x31068a[_0x16a3('0x29')]()['then'](function(){_0x31ed73[_0x16a3('0x1e')](0xcc)[_0x16a3('0x1f')]();});}};}function handleEntityNotFound(_0x37c09d,_0x29158a){return function(_0x46d383){if(!_0x46d383){_0x37c09d['sendStatus'](0x194);}return _0x46d383;};}function handleError(_0x52b975,_0x3b409d){_0x3b409d=_0x3b409d||0x1f4;return function(_0xf0d11d){logger[_0x16a3('0x2a')](_0xf0d11d['stack']);if(_0xf0d11d['name']){delete _0xf0d11d[_0x16a3('0x2b')];}_0x52b975[_0x16a3('0x1e')](_0x3b409d)[_0x16a3('0x2c')](_0xf0d11d);};}function getInteractionUsers(_0x221bfe,_0x5721f5){return new BPromise(function(_0x3e3174,_0x2e77d9){try{if(_0x5721f5[_0x221bfe['id']]){_0x221bfe[_0x16a3('0x2d')]=_[_0x16a3('0x2e')](_0x5721f5[_0x221bfe['id']],function(_0x5b735a){return{'id':_0x5b735a['id'],'fullname':_0x5b735a['fullname']};});}}catch(_0x2cf38f){_0x2e77d9(_0x2cf38f);}_0x3e3174(_0x221bfe);});}function getInteractionTags(_0x1333e9,_0x7a982f){return new BPromise(function(_0x3e6c2b,_0x5efe95){try{if(_0x1333e9['TagIds']){_0x1333e9[_0x16a3('0x2f')]=[];_0x1333e9[_0x16a3('0x30')][_0x16a3('0x31')](',')[_0x16a3('0x32')](function(_0x33fdf7){_0x1333e9[_0x16a3('0x2f')][_0x16a3('0x33')](_0x7a982f[_0x33fdf7]);});}delete _0x1333e9[_0x16a3('0x30')];}catch(_0x1fcecd){_0x5efe95(_0x1fcecd);}_0x3e6c2b(_0x1333e9);});}function updateFaxInteraction(_0x357de2,_0x47f6ed,_0x45d6fd){return new BPromise(function(_0x52bc0b,_0x33039e){return getInteractionUsers(_0x357de2,_0x45d6fd)[_0x16a3('0x34')](function(_0x549ff5){return getInteractionTags(_0x549ff5,_0x47f6ed);})[_0x16a3('0x34')](function(_0x26afcb){return getStateInteraction(_0x26afcb);})[_0x16a3('0x34')](function(_0x58455f){_0x52bc0b(_0x58455f);})['catch'](function(_0x44fd8a){_0x33039e(_0x44fd8a);});});}function getStateInteraction(_0x7a5d10){return new BPromise(function(_0x2cb411){_0x7a5d10[_0x16a3('0x35')]=0x0;_0x7a5d10[_0x16a3('0x36')]=0x0;_0x7a5d10[_0x16a3('0x37')]=0x0;_0x7a5d10['unmanaged']=0x0;_0x7a5d10[_0x16a3('0x38')]=0x0;if(!_0x7a5d10['closed']&&!_0x7a5d10[_0x16a3('0x39')]){_0x7a5d10[_0x16a3('0x35')]+=0x1;}if(!_0x7a5d10[_0x16a3('0x3a')]&&_0x7a5d10[_0x16a3('0x39')]){_0x7a5d10['talking']+=0x1;if(_0x7a5d10[_0x16a3('0x35')]){_0x7a5d10[_0x16a3('0x35')]-=0x1;}}if(_0x7a5d10[_0x16a3('0x3a')]&&_0x7a5d10[_0x16a3('0x39')]){_0x7a5d10['answered']+=0x1;if(_0x7a5d10[_0x16a3('0x36')]){_0x7a5d10[_0x16a3('0x36')]-=0x1;}}if(_0x7a5d10[_0x16a3('0x3a')]&&!_0x7a5d10[_0x16a3('0x39')]){_0x7a5d10[_0x16a3('0x3b')]+=0x1;if(_0x7a5d10['waiting']){_0x7a5d10[_0x16a3('0x35')]-=0x1;}}_0x7a5d10['total']+=0x1;_0x2cb411(_0x7a5d10);});}exports[_0x16a3('0x3c')]=function(_0x4170bc,_0x3e387a){var _0x569295={},_0x36746e={},_0xc2cd85={'count':0x0,'rows':[]};var _0x1e79f6=_['map'](db[_0x16a3('0x3d')]['rawAttributes'],function(_0x3ad64d){return{'name':_0x3ad64d[_0x16a3('0x3e')],'type':_0x3ad64d[_0x16a3('0x3f')][_0x16a3('0x40')]};});_0x36746e['model']=_[_0x16a3('0x2e')](_0x1e79f6,'name');_0x36746e[_0x16a3('0x41')]=_[_0x16a3('0x42')](_0x4170bc[_0x16a3('0x41')]);_0x36746e[_0x16a3('0x43')]=_[_0x16a3('0x44')](_0x36746e[_0x16a3('0x45')],_0x36746e[_0x16a3('0x41')]);_0x569295['attributes']=_[_0x16a3('0x44')](_0x36746e[_0x16a3('0x45')],qs[_0x16a3('0x46')](_0x4170bc[_0x16a3('0x41')][_0x16a3('0x46')]));_0x569295['attributes']=_0x569295[_0x16a3('0x47')][_0x16a3('0x48')]?_0x569295[_0x16a3('0x47')]:_0x36746e[_0x16a3('0x45')];if(!_0x4170bc[_0x16a3('0x41')][_0x16a3('0x49')](_0x16a3('0x4a'))){_0x569295[_0x16a3('0x22')]=qs[_0x16a3('0x22')](_0x4170bc[_0x16a3('0x41')][_0x16a3('0x22')]);_0x569295[_0x16a3('0x20')]=qs[_0x16a3('0x20')](_0x4170bc['query'][_0x16a3('0x20')]);}_0x569295[_0x16a3('0x4b')]=qs[_0x16a3('0x4c')](_0x4170bc[_0x16a3('0x41')]['sort']);_0x569295['where']=qs[_0x16a3('0x43')](_['pick'](_0x4170bc['query'],_0x36746e[_0x16a3('0x43')]),_0x1e79f6);var _0x18311d=[];var _0x263845=squel['select']()['field']('id')[_0x16a3('0x4d')](_0x16a3('0x2b'))[_0x16a3('0x4d')](_0x16a3('0x4e'))[_0x16a3('0x4f')](_0x16a3('0x50'));var _0x7b3a2d=squel['select']()[_0x16a3('0x4d')](_0x16a3('0x51'))['field'](_0x16a3('0x52'))[_0x16a3('0x4d')](_0x16a3('0x53'))['from'](_0x16a3('0x54'),'ui')['left_join']('users','u',_0x16a3('0x55'));var _0x494773=squel[_0x16a3('0x56')]()['from']('fax_interactions','i')['left_join']('cm_contacts','c',_0x16a3('0x57'))['left_join'](_0x16a3('0x58'),'o',_0x16a3('0x59'))['left_join']('fax_accounts','a',_0x16a3('0x5a'))['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x16a3('0x5b')]('fax_interaction_has_tags','it',_0x16a3('0x5c'))[_0x16a3('0x5b')](_0x16a3('0x50'),'t','t.id\x20=\x20it.TagId');var _0x4fe056=squel[_0x16a3('0x5d')]();var _0x3f9bda=[];var _0x16b3e0=squel[_0x16a3('0x5d')]();var _0x3ee333;if(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x5e')]){_0x3ee333=as[_0x16a3('0x5f')](_0x4170bc[_0x16a3('0x41')]['search']);var _0x38ad17=_0x3ee333[_0x16a3('0x60')];for(var _0x32682a=0x0;_0x32682a<_0x3ee333[_0x16a3('0x61')][_0x16a3('0x48')];_0x32682a++){var _0x2a174b=_0x3ee333[_0x16a3('0x61')][_0x32682a];var _0x3829fb='i';var _0x2afa68=_['find'](_0x1e79f6,['name',_0x2a174b[_0x16a3('0x4d')]]);if(!_0x2afa68){switch(_0x2a174b[_0x16a3('0x4d')]){case _0x16a3('0x62'):if(_0x2a174b[_0x16a3('0x63')]==0x1){_0x494773[_0x16a3('0x64')]('`'+_0x2a174b[_0x16a3('0x4d')]+'`\x20=\x200');}else{_0x494773[_0x16a3('0x64')]('`'+_0x2a174b[_0x16a3('0x4d')]+_0x16a3('0x65'));}break;case _0x16a3('0x66'):if(_0x2a174b[_0x16a3('0x67')]==='$substring'){if(_0x2a174b[_0x16a3('0x63')][_0x16a3('0x31')]('\x20')[_0x16a3('0x48')]>0x1){_0x4fe056[_0x38ad17](_0x16a3('0x68'),qs[_0x16a3('0x69')](_0x2a174b['value']),null);}else{var _0x1d90c4='%'+_0x2a174b[_0x16a3('0x63')]+'%';_0x4fe056[_0x38ad17](_0x16a3('0x6a'),_0x1d90c4,_0x1d90c4,_0x1d90c4);}}else{_0x2afa68=_[_0x16a3('0x6b')](_0x1e79f6,[_0x16a3('0x2b'),_0x16a3('0x6c')]);_0x2a174b['field']='ContactId';_0x3e7d54=as[_0x16a3('0x6d')](_0x3829fb,_0x2afa68['type'],_0x2a174b);_0x4fe056[_0x38ad17](_0x3e7d54['text'],_0x3e7d54['value'][_0x16a3('0x6e')],_0x3e7d54['value'][_0x16a3('0x1f')]);}break;case _0x16a3('0x6f'):var _0x4c5d1e=_0x2a174b[_0x16a3('0x63')]['split'](',')[_0x16a3('0x2e')](function(_0xb68714){return Number(_0xb68714);});_0x4c5d1e[_0x16a3('0x32')](function(_0x11fc39){_0x16b3e0['or'](_0x16a3('0x70'),'%,'+_0x11fc39+',%');});_0x3f9bda=_[_0x16a3('0x71')](_0x3f9bda,_0x4c5d1e);break;case _0x16a3('0x72'):if(_0x2a174b[_0x16a3('0x67')]===_0x16a3('0x73')){_0x4fe056[_0x38ad17](_0x16a3('0x74'),'%'+_0x2a174b['value']+'%',null);}else{_0x2afa68=_[_0x16a3('0x6b')](_0x1e79f6,[_0x16a3('0x2b'),'UserId']);_0x2a174b['field']=_0x16a3('0x39');_0x3e7d54=as[_0x16a3('0x6d')](_0x3829fb,_0x2afa68[_0x16a3('0x3f')],_0x2a174b);_0x4fe056[_0x38ad17](_0x3e7d54[_0x16a3('0x75')],_0x3e7d54[_0x16a3('0x63')]['start'],_0x3e7d54[_0x16a3('0x63')][_0x16a3('0x1f')]);}break;case _0x16a3('0x76'):_0x3e7d54=as[_0x16a3('0x6d')]('me',null,_0x2a174b);_0x4fe056[_0x38ad17](_0x3e7d54[_0x16a3('0x75')],_0x3e7d54[_0x16a3('0x63')][_0x16a3('0x6e')],_0x3e7d54[_0x16a3('0x63')][_0x16a3('0x1f')]);break;}}else{var _0x3e7d54=as[_0x16a3('0x6d')](_0x3829fb,_0x2afa68['type'],_0x2a174b);_0x4fe056[_0x38ad17](_0x3e7d54[_0x16a3('0x75')],_0x3e7d54['value'][_0x16a3('0x6e')],_0x3e7d54[_0x16a3('0x63')][_0x16a3('0x1f')]);}}}else{var _0x3296ef=_(_0x4170bc[_0x16a3('0x41')])[_0x16a3('0x42')]()[_0x16a3('0x2e')](function(_0x555684){return _[_0x16a3('0x77')](_0x1e79f6,['name',_0x555684])?_0x555684:undefined;})[_0x16a3('0x78')]()[_0x16a3('0x63')]();if(!_[_0x16a3('0x79')](_0x3296ef)){_0x3296ef[_0x16a3('0x32')](function(_0x180d3c){if(_0x180d3c===_0x16a3('0x7a')){_0x494773[_0x16a3('0x7b')]('i.FaxAccountId\x20IN\x20?',[][_0x16a3('0x7c')](_0x4170bc[_0x16a3('0x41')][_0x180d3c]));}else if(_0x180d3c===_0x16a3('0x7d')){var _0x38fbe8=JSON[_0x16a3('0x7e')](_0x4170bc[_0x16a3('0x41')][_0x180d3c])[_0x16a3('0x7f')];var _0x2d9c94=JSON[_0x16a3('0x7e')](_0x4170bc['query'][_0x180d3c])['$lte'];_0x494773[_0x16a3('0x7b')](_0x16a3('0x80'),_0x38fbe8,_0x2d9c94);}else{if(_0x4170bc[_0x16a3('0x41')][_0x180d3c]==='null'){_0x494773['where']('i.'+_0x180d3c+_0x16a3('0x81'));}else{_0x494773[_0x16a3('0x7b')]('i.'+_0x180d3c+_0x16a3('0x82'),_0x4170bc[_0x16a3('0x41')][_0x180d3c]);}}});}if(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x83')]){if(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x83')]==0x1){_0x494773[_0x16a3('0x64')](_0x16a3('0x84'));}else{_0x494773['having']('`unreadMessages`\x20>\x200');}}if(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x85')]){_0x3f9bda=_['isArray'](_0x4170bc[_0x16a3('0x41')][_0x16a3('0x85')])?_0x4170bc[_0x16a3('0x41')]['tag']:new Array(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x85')]);_0x3f9bda[_0x16a3('0x32')](function(_0x5ade54){_0x16b3e0['or'](_0x16a3('0x70'),'%,'+_0x5ade54+',%');});}if(_0x4170bc['query']['filter']){var _0x1e2407=_0x4170bc[_0x16a3('0x41')]['filter'][_0x16a3('0x86')]('\x5c','\x5c\x5c')[_0x16a3('0x86')](/'/g,'\x27\x27');if(qs[_0x16a3('0x87')](_0x1e2407)){_0x4fe056['or'](_0x16a3('0x88'),_0x1e2407+'%')['or'](_0x16a3('0x89'),_0x1e2407+'%');}_0x4fe056['or'](_0x16a3('0x8a'),_0x1e2407+'%');}}_0x494773[_0x16a3('0x7b')](_0x4fe056);_0x494773[_0x16a3('0x8b')]('i.id');var _0x55f8f7={'type':db[_0x16a3('0x8c')][_0x16a3('0x8d')][_0x16a3('0x8e')],'raw':!![]};var _0x128955=_0x494773[_0x16a3('0x8f')]();_0x128955['field'](_0x16a3('0x90'));_0x128955[_0x16a3('0x4d')](_0x16a3('0x91'),_0x16a3('0x62'));if(_0x569295['order']){_0x569295[_0x16a3('0x4b')][_0x16a3('0x32')](function(_0x205738){var _0x3238e8=_0x205738[0x0]===_0x16a3('0x92')?_0x205738[0x0]:'i.'+_0x205738[0x0];_0x494773['order'](_0x3238e8,_0x205738[0x1]===_0x16a3('0x93')?![]:!![]);});}if(!_[_0x16a3('0x79')](_0x3f9bda)){_0x494773[_0x16a3('0x64')](_0x16b3e0);_0x128955[_0x16a3('0x7b')](_0x16a3('0x94'),_0x3f9bda);}BPromise['resolve']()[_0x16a3('0x34')](function(){if(!_0x3ee333){if(_0x4170bc['query']['FaxAccountId'])return;_0x128955['where'](_0x16a3('0x95'));_0x494773['where'](_0x16a3('0x95'));return;}if(_0x4170bc[_0x16a3('0x96')]['role']!==_0x16a3('0x97'))return;return _0x4170bc[_0x16a3('0x96')][_0x16a3('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0xb3c90d){if(_[_0x16a3('0x79')](_0xb3c90d)){_0x128955['where'](_0x16a3('0x99'));_0x494773[_0x16a3('0x7b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x128955['where']('i.FaxAccountId\x20IN\x20?',_[_0x16a3('0x2e')](_0xb3c90d,'id'));_0x494773[_0x16a3('0x7b')](_0x16a3('0x9a'),_['map'](_0xb3c90d,'id'));}});})['then'](function(){if(_0x4170bc[_0x16a3('0x96')][_0x16a3('0x9b')]===_0x16a3('0x97')&&!_0x3ee333&&!_0x4170bc[_0x16a3('0x41')][_0x16a3('0x7a')])return[];return db[_0x16a3('0x9c')][_0x16a3('0x41')](_0x128955['toString'](),_0x55f8f7);})[_0x16a3('0x34')](function(_0x51a9f5){_0xc2cd85[_0x16a3('0x9d')]=_0x51a9f5[_0x16a3('0x48')];if(_0xc2cd85[_0x16a3('0x9d')]===0x0)return[];return db[_0x16a3('0x9c')]['query'](_0x263845[_0x16a3('0x9e')](),_0x55f8f7)[_0x16a3('0x34')](function(_0x4113bd){_0x18311d=_[_0x16a3('0x9f')](_0x4113bd,'id');_0x55f8f7=_[_0x16a3('0xa0')](_0x55f8f7,{'model':db[_0x16a3('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4170bc[_0x16a3('0x41')][_0x16a3('0x46')]){_0x569295['attributes'][_0x16a3('0x32')](function(_0x4ea8fc){_0x494773[_0x16a3('0x4d')]('i.'+_0x4ea8fc);});}else{_0x494773[_0x16a3('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x16a3('0x62'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xa1'),_0x16a3('0xa2'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xa3'),_0x16a3('0xa4'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xa5'),'contactName');_0x494773[_0x16a3('0x4d')](_0x16a3('0xa6'));_0x494773[_0x16a3('0x4d')]('c.firstName','Contact.firstName');_0x494773['field'](_0x16a3('0xa7'),'Contact.lastName');_0x494773['field'](_0x16a3('0xa8'),_0x16a3('0xa9'));_0x494773[_0x16a3('0x4d')]('c.phone',_0x16a3('0xaa'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xab'),_0x16a3('0xac'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xad'),_0x16a3('0xae'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xaf'),_0x16a3('0xb0'));_0x494773[_0x16a3('0x4d')]('o.internal',_0x16a3('0xb1'));_0x494773[_0x16a3('0x4d')](_0x16a3('0xb2'),_0x16a3('0x30'));}if(_0x569295[_0x16a3('0x22')])_0x494773[_0x16a3('0x22')](_0x569295[_0x16a3('0x22')]);if(_0x569295[_0x16a3('0x20')])_0x494773[_0x16a3('0x20')](_0x569295[_0x16a3('0x20')]);return db[_0x16a3('0x9c')][_0x16a3('0x41')](_0x494773[_0x16a3('0x9e')](),_0x55f8f7);})[_0x16a3('0x34')](function(_0x593e23){if(_0x593e23[_0x16a3('0x48')]>0x0)_0x7b3a2d[_0x16a3('0x7b')](_0x16a3('0xb3'),_[_0x16a3('0x2e')](_0x593e23,'id'));return db[_0x16a3('0x9c')][_0x16a3('0x41')](_0x7b3a2d[_0x16a3('0x9e')](),_0x55f8f7)[_0x16a3('0x34')](function(_0x3d2b73){var _0xf19820=_[_0x16a3('0xb4')](_0x3d2b73,'FaxInteractionId');var _0x173e0b=[];_0x593e23[_0x16a3('0x32')](function(_0x50dc0f){_0x173e0b[_0x16a3('0x33')](updateFaxInteraction(_0x50dc0f,_0x18311d,_0xf19820));});return BPromise['all'](_0x173e0b);});});})['then'](function(_0x2e5c2b){_0xc2cd85['rows']=_0x2e5c2b;return _0xc2cd85;})[_0x16a3('0x34')](respondWithFilteredResult(_0x3e387a,_0x569295))['catch'](handleError(_0x3e387a,null));};exports[_0x16a3('0xb5')]=function(_0x3de02a,_0x34df19){var _0x14e444={'raw':![],'where':{'id':_0x3de02a[_0x16a3('0xb6')]['id']}},_0x5e32bd={};_0x5e32bd[_0x16a3('0x45')]=_['keys'](db['FaxInteraction'][_0x16a3('0xb7')]);_0x5e32bd[_0x16a3('0x41')]=_[_0x16a3('0x42')](_0x3de02a[_0x16a3('0x41')]);_0x5e32bd[_0x16a3('0x43')]=_[_0x16a3('0x44')](_0x5e32bd[_0x16a3('0x45')],_0x5e32bd[_0x16a3('0x41')]);_0x14e444[_0x16a3('0x47')]=_['intersection'](_0x5e32bd[_0x16a3('0x45')],qs[_0x16a3('0x46')](_0x3de02a[_0x16a3('0x41')][_0x16a3('0x46')]));_0x14e444[_0x16a3('0x47')]=_0x14e444['attributes'][_0x16a3('0x48')]?_0x14e444[_0x16a3('0x47')]:_0x5e32bd[_0x16a3('0x45')];if(_0x3de02a[_0x16a3('0x41')][_0x16a3('0xb8')]){_0x14e444['include']=[{'all':!![]}];}_0x14e444=_['merge']({},_0x14e444,_0x3de02a['options']);return db[_0x16a3('0x3d')][_0x16a3('0x6b')](_0x14e444)[_0x16a3('0x34')](handleEntityNotFound(_0x34df19,null))[_0x16a3('0x34')](respondWithResult(_0x34df19,null))[_0x16a3('0xb9')](handleError(_0x34df19,null));};exports[_0x16a3('0xba')]=function(_0x4f2920,_0x4b3e5d){return db[_0x16a3('0x3d')]['create'](_0x4f2920[_0x16a3('0x76')],{})[_0x16a3('0x34')](respondWithResult(_0x4b3e5d,0xc9))['catch'](handleError(_0x4b3e5d,null));};exports[_0x16a3('0xbb')]=function(_0x4b1c8b,_0x85f397){if(_0x4b1c8b[_0x16a3('0x76')]['id']){delete _0x4b1c8b[_0x16a3('0x76')]['id'];}return db[_0x16a3('0x3d')][_0x16a3('0x6b')]({'where':{'id':_0x4b1c8b[_0x16a3('0xb6')]['id']}})[_0x16a3('0x34')](handleEntityNotFound(_0x85f397,null))['then'](saveUpdates(_0x4b1c8b['body'],null))[_0x16a3('0x34')](respondWithResult(_0x85f397,null))[_0x16a3('0xb9')](handleError(_0x85f397,null));};exports[_0x16a3('0x29')]=function(_0x5802be,_0x2d3d2d){return db[_0x16a3('0x3d')][_0x16a3('0x6b')]({'where':{'id':_0x5802be[_0x16a3('0xb6')]['id']}})['then'](handleEntityNotFound(_0x2d3d2d,null))[_0x16a3('0x34')](removeEntity(_0x2d3d2d,null))[_0x16a3('0xb9')](handleError(_0x2d3d2d,null));};exports['describe']=function(_0x5c5136,_0x30a6d5){return db[_0x16a3('0x3d')][_0x16a3('0xbc')]()[_0x16a3('0x34')](respondWithResult(_0x30a6d5,null))[_0x16a3('0xb9')](handleError(_0x30a6d5,null));};exports[_0x16a3('0xbd')]=function(_0x159e44,_0x313b8b,_0x245d16){return db[_0x16a3('0xbe')][_0x16a3('0x6b')]({'where':{'id':_0x159e44[_0x16a3('0xb6')]['id']}})[_0x16a3('0x34')](handleEntityNotFound(_0x313b8b,null))[_0x16a3('0x34')](function(_0x183017){if(_0x183017){return _0x183017[_0x16a3('0xbd')](_0x159e44[_0x16a3('0x76')][_0x16a3('0xbf')],_[_0x16a3('0xc0')](_0x159e44[_0x16a3('0x76')],['ids','id'])||{});}})[_0x16a3('0x34')](respondWithResult(_0x313b8b,null))[_0x16a3('0xb9')](handleError(_0x313b8b,null));};exports[_0x16a3('0xc1')]=function(_0x338079,_0x49b1a9,_0x3cc203){var _0x4f2ee3={'raw':![],'where':{}};var _0x1c163b={};var _0x23cf0c={'count':0x0,'rows':[]};return db[_0x16a3('0x3d')][_0x16a3('0xc2')]({'where':{'id':_0x338079[_0x16a3('0xb6')]['id']}})[_0x16a3('0x34')](handleEntityNotFound(_0x49b1a9,null))[_0x16a3('0x34')](function(_0x2a19b5){if(_0x2a19b5){_0x1c163b[_0x16a3('0x45')]=_[_0x16a3('0x42')](db[_0x16a3('0xbe')][_0x16a3('0xb7')]);_0x1c163b[_0x16a3('0x41')]=_[_0x16a3('0x42')](_0x338079['query']);_0x1c163b[_0x16a3('0x43')]=_[_0x16a3('0x44')](_0x1c163b['model'],_0x1c163b['query']);_0x4f2ee3[_0x16a3('0x47')]=_['intersection'](_0x1c163b[_0x16a3('0x45')],qs[_0x16a3('0x46')](_0x338079[_0x16a3('0x41')][_0x16a3('0x46')]));_0x4f2ee3['attributes']=_0x4f2ee3[_0x16a3('0x47')]['length']?_0x4f2ee3['attributes']:_0x1c163b[_0x16a3('0x45')];if(!_0x338079[_0x16a3('0x41')][_0x16a3('0x49')](_0x16a3('0x4a'))){_0x4f2ee3[_0x16a3('0x22')]=qs[_0x16a3('0x22')](_0x338079[_0x16a3('0x41')][_0x16a3('0x22')]);_0x4f2ee3['offset']=qs[_0x16a3('0x20')](_0x338079[_0x16a3('0x41')][_0x16a3('0x20')]);}_0x4f2ee3[_0x16a3('0x4b')]=qs[_0x16a3('0x4c')](_0x338079[_0x16a3('0x41')][_0x16a3('0x4c')]);_0x4f2ee3['where']=qs['filters'](_['pick'](_0x338079[_0x16a3('0x41')],_0x1c163b[_0x16a3('0x43')]));_0x4f2ee3[_0x16a3('0x7b')][_0x16a3('0xc3')]=_0x2a19b5['id'];if(_0x338079[_0x16a3('0x41')][_0x16a3('0xc4')]){_0x4f2ee3[_0x16a3('0x7b')]=_[_0x16a3('0xa0')](_0x4f2ee3[_0x16a3('0x7b')],{'$or':_['map'](_0x4f2ee3['attributes'],function(_0x42f67a){var _0x419f5d={};_0x419f5d[_0x42f67a]={'$like':'%'+_0x338079[_0x16a3('0x41')]['filter']+'%'};return _0x419f5d;})});}if(_0x338079[_0x16a3('0x41')][_0x16a3('0x7f')]){var _0x397927=_0x338079['query'][_0x16a3('0x7f')]['split'](',');var _0x183012={};_0x183012[_0x397927[0x0]]={'$gte':moment(_0x397927[0x1])[_0x16a3('0xc5')](_0x16a3('0xc6'))};_0x4f2ee3['where']=_[_0x16a3('0xa0')](_0x4f2ee3[_0x16a3('0x7b')],_0x183012);}_0x4f2ee3=_['merge']({},_0x4f2ee3,_0x338079[_0x16a3('0xc7')]);return db[_0x16a3('0xbe')]['count']({'where':_0x4f2ee3[_0x16a3('0x7b')]})['then'](function(_0x55f63f){_0x23cf0c[_0x16a3('0x9d')]=_0x55f63f;if(_0x338079['query'][_0x16a3('0xb8')]){_0x4f2ee3['include']=[{'all':!![]}];}return db[_0x16a3('0xbe')][_0x16a3('0xc8')](_0x4f2ee3);})[_0x16a3('0x34')](function(_0x43d2a2){_0x23cf0c[_0x16a3('0xc9')]=_0x43d2a2;return _0x23cf0c;});}})[_0x16a3('0x34')](respondWithFilteredResult(_0x49b1a9,_0x4f2ee3))[_0x16a3('0xb9')](handleError(_0x49b1a9,null));};exports['addTags']=function(_0x24b54f,_0x4fd510,_0x355db6){return db[_0x16a3('0x3d')][_0x16a3('0x6b')]({'where':{'id':_0x24b54f['params']['id']}})[_0x16a3('0x34')](handleEntityNotFound(_0x4fd510,null))[_0x16a3('0x34')](function(_0x43be12){if(_0x43be12){return _0x43be12[_0x16a3('0xca')](_0x24b54f['body'][_0x16a3('0xbf')],_['omit'](_0x24b54f[_0x16a3('0x76')],[_0x16a3('0xbf'),'id'])||{})[_0x16a3('0xcb')](function(){return db[_0x16a3('0x6f')][_0x16a3('0xc8')]({'attributes':['id',_0x16a3('0x2b'),'color'],'where':{'id':_0x24b54f[_0x16a3('0x76')]['ids']}});})[_0x16a3('0x34')](function(_0x9a8660){socket['emit'](_0x16a3('0xcc'),{'id':Number(_0x24b54f[_0x16a3('0xb6')]['id']),'tags':_0x9a8660||[]});return{'id':Number(_0x24b54f[_0x16a3('0xb6')]['id']),'tags':_0x9a8660||[]};});}})[_0x16a3('0x34')](respondWithResult(_0x4fd510,null))[_0x16a3('0xb9')](handleError(_0x4fd510,null));};exports['removeTags']=function(_0x307126,_0x4a8182,_0x5ba257){return db['FaxInteraction'][_0x16a3('0x6b')]({'where':{'id':_0x307126[_0x16a3('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4a8182,null))[_0x16a3('0x34')](function(_0x6c348){if(_0x6c348){return _0x6c348[_0x16a3('0xcd')](_0x307126[_0x16a3('0x41')]['ids']);}})[_0x16a3('0x34')](respondWithStatusCode(_0x4a8182,null))[_0x16a3('0xb9')](handleError(_0x4a8182,null));};exports[_0x16a3('0xce')]=function(_0x57f453,_0x1e64fc){var _0x39b19a=moment()[_0x16a3('0xcf')]()[_0x16a3('0x9e')]();var _0x5a18d5=path['join'](config[_0x16a3('0xd0')],_0x16a3('0xd1'),_0x16a3('0xd2'),'tmp');var _0x4fffd2=path[_0x16a3('0xd3')](config[_0x16a3('0xd0')],_0x16a3('0xd1'),_0x16a3('0xd2'),_0x16a3('0xd4'));var _0xf4c232=path[_0x16a3('0xd3')](_0x5a18d5,_0x39b19a);var _0x2109c2=util[_0x16a3('0xc5')](_0x16a3('0xd5'),_0x57f453[_0x16a3('0xb6')]['id'],_0x39b19a);var _0x491150=path[_0x16a3('0xd3')](_0x5a18d5,_0x2109c2);var _0x39a789=[];_0x39a789[_0x16a3('0x33')]({'model':db[_0x16a3('0xd6')],'as':_0x16a3('0xd6'),'raw':!![]});var _0x4d2297=[{'model':db[_0x16a3('0xbe')],'as':_0x16a3('0xd7'),'attributes':['id',_0x16a3('0x76'),_0x16a3('0x7d')],'include':_0x39a789}];return db[_0x16a3('0x3d')]['find']({'where':{'id':_0x57f453[_0x16a3('0xb6')]['id']},'include':_0x4d2297})[_0x16a3('0x34')](handleEntityNotFound(_0x1e64fc,null))['then'](function(_0x23bedf){if(_0x23bedf&&_0x23bedf[_0x16a3('0xd7')]){var _0x2d8c1d=_0x23bedf[_0x16a3('0xd8')]({'plain':!![]});fs[_0x16a3('0xd9')](_0xf4c232);for(var _0x34497e=0x0;_0x34497e<_0x2d8c1d[_0x16a3('0xd7')]['length'];_0x34497e++){var _0x244e8e=_0x2d8c1d['Messages'][_0x34497e]['Attachment'];if(_0x244e8e){var _0x4fb51e=path[_0x16a3('0xd3')](_0x4fffd2,_0x244e8e[_0x16a3('0xda')]);if(fs[_0x16a3('0xdb')](_0x4fb51e)){fs['createReadStream'](_0x4fb51e)[_0x16a3('0xdc')](fs[_0x16a3('0xdd')](path[_0x16a3('0xd3')](_0xf4c232,_0x244e8e['basename'])));}}}return BPromise[_0x16a3('0xde')]()[_0x16a3('0x34')](function(){return new BPromise(function(_0x2dfe47,_0x15d0bc){zipdir(_0xf4c232,{'saveTo':_0x491150},function(_0x5163d5,_0x37224e){if(_0x5163d5)return _0x15d0bc(_0x5163d5);return _0x2dfe47(_0x37224e);});})[_0x16a3('0x34')](function(){return new BPromise(function(_0x62f373,_0x4e91ad){rimraf(_0xf4c232,function(_0x196b5a){if(_0x196b5a)_0x4e91ad(_0x196b5a);return _0x62f373();});});})[_0x16a3('0x34')](function(){return _0x1e64fc[_0x16a3('0xce')](_0x491150,_0x2109c2,function(_0x544df2){if(_0x544df2){console['log']('err',_0x544df2);}else{fs['unlinkSync'](_0x491150);}});});});}else{return _0x1e64fc[_0x16a3('0x1d')](0xc8);}})[_0x16a3('0xb9')](handleError(_0x1e64fc,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a18b351..c4d77a0 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 _0x32fa=['events','../../mysqldb','FaxInteraction','FaxMessage','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x32fa,0x1a9));var _0xa32f=function(_0xcf61d2,_0x2b9569){_0xcf61d2=_0xcf61d2-0x0;var _0x35893d=_0x32fa[_0xcf61d2];return _0x35893d;};'use strict';var EventEmitter=require(_0xa32f('0x0'));var FaxInteraction=require(_0xa32f('0x1'))['db'][_0xa32f('0x2')];var FaxMessage=require(_0xa32f('0x1'))['db'][_0xa32f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa32f('0x4'),'afterUpdate':'update','afterDestroy':_0xa32f('0x5')};function emitEvent(_0x2e4d44){return function(_0x4e49ea,_0x39f442,_0x71373){_0x4e49ea[_0xa32f('0x6')]({'attributes':['id'],'raw':!![]})[_0xa32f('0x7')](function(_0x3c6470){_0x4e49ea[_0xa32f('0x8')]('Users',_0x3c6470[_0xa32f('0x9')](function(_0x30eb8c){return{'id':_0x30eb8c['id']};}));return FaxMessage[_0xa32f('0xa')]({'where':{'FaxInteractionId':_0x4e49ea['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa32f('0x7')](function(_0x5e564c){_0x4e49ea['setDataValue'](_0xa32f('0xb'),_0x5e564c['length']);FaxInteractionEvents['emit'](_0x2e4d44+':'+_0x4e49ea['id'],_0x4e49ea);FaxInteractionEvents[_0xa32f('0xc')](_0x2e4d44,_0x4e49ea);_0x71373(null);})[_0xa32f('0xd')](_0x71373(null));};}for(var e in events){if(events[_0xa32f('0xe')](e)){var event=events[e];FaxInteraction[_0xa32f('0xf')](e,emitEvent(event));}}module[_0xa32f('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x9ad6=['catch','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x443c76,_0x329000){var _0x2c89bb=function(_0x1f6e4d){while(--_0x1f6e4d){_0x443c76['push'](_0x443c76['shift']());}};_0x2c89bb(++_0x329000);}(_0x9ad6,0x1b1));var _0x69ad=function(_0x156ef2,_0x4337ae){_0x156ef2=_0x156ef2-0x0;var _0x2c9ec2=_0x9ad6[_0x156ef2];return _0x2c9ec2;};'use strict';var EventEmitter=require(_0x69ad('0x0'));var FaxInteraction=require(_0x69ad('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x69ad('0x1'))['db'][_0x69ad('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x69ad('0x3')](0x0);var events={'afterCreate':_0x69ad('0x4'),'afterUpdate':_0x69ad('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a82cc){return function(_0x32e9ca,_0x1a8603,_0x58f199){_0x32e9ca[_0x69ad('0x6')]({'attributes':['id'],'raw':!![]})[_0x69ad('0x7')](function(_0x2966dd){_0x32e9ca['setDataValue'](_0x69ad('0x8'),_0x2966dd[_0x69ad('0x9')](function(_0x21e0c7){return{'id':_0x21e0c7['id']};}));return FaxMessage[_0x69ad('0xa')]({'where':{'FaxInteractionId':_0x32e9ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x69ad('0x7')](function(_0x14f1f4){_0x32e9ca[_0x69ad('0xb')](_0x69ad('0xc'),_0x14f1f4[_0x69ad('0xd')]);FaxInteractionEvents[_0x69ad('0xe')](_0x4a82cc+':'+_0x32e9ca['id'],_0x32e9ca);FaxInteractionEvents[_0x69ad('0xe')](_0x4a82cc,_0x32e9ca);_0x58f199(null);})[_0x69ad('0xf')](_0x58f199(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0254bc1..b783bf3 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 _0x258c=['exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x4892ff,_0x149392){var _0x51913e=function(_0x5147ea){while(--_0x5147ea){_0x4892ff['push'](_0x4892ff['shift']());}};_0x51913e(++_0x149392);}(_0x258c,0x168));var _0xc258=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x258c[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xc258('0x0'));var logger=require('../../config/logger')(_0xc258('0x1'));var moment=require(_0xc258('0x2'));var BPromise=require(_0xc258('0x3'));var rp=require(_0xc258('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc258('0x5'));var config=require(_0xc258('0x6'));var attributes=require(_0xc258('0x7'));module[_0xc258('0x8')]=function(_0x508ca7,_0x438b10){return _0x508ca7[_0xc258('0x9')]('FaxInteraction',attributes,{'tableName':_0xc258('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x318c7a,_0x77f721,_0x1809a8){if(_0x318c7a[_0xc258('0xb')](_0xc258('0xc'))){_0x318c7a[_0xc258('0xd')]=moment()[_0xc258('0xe')](_0xc258('0xf'));}_0x1809a8(null,_0x318c7a);}}});}; \ No newline at end of file +var _0xd0ce=['path','rimraf','FaxInteraction','fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5dbae9,_0x166a1f){var _0x14fd10=function(_0x2d0bdf){while(--_0x2d0bdf){_0x5dbae9['push'](_0x5dbae9['shift']());}};_0x14fd10(++_0x166a1f);}(_0xd0ce,0x166));var _0xed0c=function(_0x552352,_0x51e3b0){_0x552352=_0x552352-0x0;var _0x1e0d71=_0xd0ce[_0x552352];return _0x1e0d71;};'use strict';var _=require('lodash');var util=require(_0xed0c('0x0'));var logger=require(_0xed0c('0x1'))(_0xed0c('0x2'));var moment=require(_0xed0c('0x3'));var BPromise=require(_0xed0c('0x4'));var rp=require(_0xed0c('0x5'));var fs=require('fs');var path=require(_0xed0c('0x6'));var rimraf=require(_0xed0c('0x7'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x38a201,_0x16bd91){return _0x38a201['define'](_0xed0c('0x8'),attributes,{'tableName':_0xed0c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22c40f,_0x116bd6,_0x3ca693){if(_0x22c40f['changed'](_0xed0c('0xa'))){_0x22c40f[_0xed0c('0xb')]=moment()['format'](_0xed0c('0xc'));}_0x3ca693(null,_0x22c40f);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 38cdff0..3f2c816 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 _0x827e=['result','catch','FaxInteraction','update','body','options','raw','where','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','debug','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message'];(function(_0x2e98bb,_0x72c01a){var _0x2bf44c=function(_0xe692f){while(--_0xe692f){_0x2e98bb['push'](_0x2e98bb['shift']());}};_0x2bf44c(++_0x72c01a);}(_0x827e,0x113));var _0xe827=function(_0x7d6b60,_0x5b0989){_0x7d6b60=_0x7d6b60-0x0;var _0x4b512a=_0x827e[_0x7d6b60];return _0x4b512a;};'use strict';var _=require(_0xe827('0x0'));var util=require(_0xe827('0x1'));var moment=require(_0xe827('0x2'));var BPromise=require(_0xe827('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe827('0x4'));var db=require(_0xe827('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe827('0x6'))(_0xe827('0x7'));var config=require(_0xe827('0x8'));var jayson=require(_0xe827('0x9'));var client=jayson[_0xe827('0xa')][_0xe827('0xb')]({'port':0x232a});config['redis']=_[_0xe827('0xc')](config['redis'],{'host':_0xe827('0xd'),'port':0x18eb});var socket=require(_0xe827('0xe'))(new Redis(config['redis']));require(_0xe827('0xf'))[_0xe827('0x10')](socket);function respondWithRpcPromise(_0x590ee0,_0x40bf1d,_0x5110cc){return new BPromise(function(_0x1e06be,_0x12eae9){return client[_0xe827('0x11')](_0x590ee0,_0x5110cc)[_0xe827('0x12')](function(_0x331362){logger[_0xe827('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x40bf1d,'request\x20sent');logger[_0xe827('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x40bf1d,_0xe827('0x15'),JSON['stringify'](_0x331362));if(_0x331362[_0xe827('0x16')]){if(_0x331362[_0xe827('0x16')][_0xe827('0x17')]===0x1f4){logger[_0xe827('0x16')](_0xe827('0x18'),_0x40bf1d,_0x331362['error'][_0xe827('0x19')]);return _0x12eae9(_0x331362['error'][_0xe827('0x19')]);}logger[_0xe827('0x16')](_0xe827('0x18'),_0x40bf1d,_0x331362['error'][_0xe827('0x19')]);return _0x1e06be(_0x331362[_0xe827('0x16')]['message']);}else{logger['info'](_0xe827('0x18'),_0x40bf1d,'request\x20sent');_0x1e06be(_0x331362[_0xe827('0x1a')]['message']);}})[_0xe827('0x1b')](function(_0xfe832f){logger[_0xe827('0x16')](_0xe827('0x18'),_0x40bf1d,_0xfe832f);_0x12eae9(_0xfe832f);});});}exports['UpdateFaxInteraction']=function(_0x47068f){var _0x5d3c24=this;return new Promise(function(_0x46d049,_0x2c0928){return db[_0xe827('0x1c')][_0xe827('0x1d')](_0x47068f[_0xe827('0x1e')],{'raw':_0x47068f['options']?_0x47068f[_0xe827('0x1f')][_0xe827('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47068f['options']?_0x47068f[_0xe827('0x1f')][_0xe827('0x21')]||null:null,'attributes':_0x47068f['options']?_0x47068f[_0xe827('0x1f')]['attributes']||null:null,'limit':_0x47068f[_0xe827('0x1f')]?_0x47068f[_0xe827('0x1f')][_0xe827('0x22')]||null:null})['then'](function(_0x44fb3d){logger[_0xe827('0x13')](_0xe827('0x23'),_0x47068f);logger[_0xe827('0x14')](_0xe827('0x23'),_0x47068f,JSON[_0xe827('0x24')](_0x44fb3d));_0x46d049(_0x44fb3d);})['catch'](function(_0x3d8a25){logger['error'](_0xe827('0x23'),_0x3d8a25['message'],_0x47068f);_0x2c0928(_0x5d3c24['error'](0x1f4,_0x3d8a25[_0xe827('0x19')]));});});};exports[_0xe827('0x25')]=function(_0x19dbfe){return new Promise(function(_0x35c422,_0x31264b){return db[_0xe827('0x1c')][_0xe827('0x26')]({'where':_0x19dbfe[_0xe827('0x1f')]?_0x19dbfe[_0xe827('0x1f')][_0xe827('0x21')]||null:null})[_0xe827('0x12')](function(_0x35e99d){if(_0x35e99d){return _0x35e99d[_0xe827('0x27')](_0x19dbfe[_0xe827('0x1e')][_0xe827('0x28')],_['omit'](_0x19dbfe[_0xe827('0x1e')],[_0xe827('0x28'),'id'])||{});}})[_0xe827('0x29')](function(_0x5357f5){logger[_0xe827('0x13')](_0xe827('0x2a'),_0x19dbfe);logger[_0xe827('0x14')](_0xe827('0x2a'),_0x19dbfe,JSON[_0xe827('0x24')](_0x5357f5));_0x35c422(_0x5357f5);})[_0xe827('0x1b')](function(_0xf62600){logger[_0xe827('0x16')](_0xe827('0x2a'),_0xf62600[_0xe827('0x19')],_0x19dbfe);_0x31264b(_this[_0xe827('0x16')](0x1f4,_0xf62600['message']));});});}; \ No newline at end of file +var _0x001c=['UpdateFaxInteraction','FaxInteraction','options','raw','attributes','limit','stringify','catch','find','where','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x156479,_0x20e97d){var _0x4a9513=function(_0x39fcb0){while(--_0x39fcb0){_0x156479['push'](_0x156479['shift']());}};_0x4a9513(++_0x20e97d);}(_0x001c,0xe7));var _0xc001=function(_0x3808e2,_0x5864a9){_0x3808e2=_0x3808e2-0x0;var _0x424eeb=_0x001c[_0x3808e2];return _0x424eeb;};'use strict';var _=require(_0xc001('0x0'));var util=require('util');var moment=require(_0xc001('0x1'));var BPromise=require(_0xc001('0x2'));var rs=require(_0xc001('0x3'));var fs=require('fs');var Redis=require(_0xc001('0x4'));var db=require(_0xc001('0x5'))['db'];var utils=require(_0xc001('0x6'));var logger=require(_0xc001('0x7'))(_0xc001('0x8'));var config=require(_0xc001('0x9'));var jayson=require(_0xc001('0xa'));var client=jayson['client'][_0xc001('0xb')]({'port':0x232a});config[_0xc001('0xc')]=_[_0xc001('0xd')](config['redis'],{'host':_0xc001('0xe'),'port':0x18eb});var socket=require(_0xc001('0xf'))(new Redis(config[_0xc001('0xc')]));require('./faxInteraction.socket')[_0xc001('0x10')](socket);function respondWithRpcPromise(_0x440b22,_0x5168b6,_0xb0cdcb){return new BPromise(function(_0x2c94a3,_0x24390a){return client[_0xc001('0x11')](_0x440b22,_0xb0cdcb)[_0xc001('0x12')](function(_0x7f8c34){logger[_0xc001('0x13')](_0xc001('0x14'),_0x5168b6,_0xc001('0x15'));logger[_0xc001('0x16')](_0xc001('0x17'),_0x5168b6,_0xc001('0x15'),JSON['stringify'](_0x7f8c34));if(_0x7f8c34[_0xc001('0x18')]){if(_0x7f8c34['error'][_0xc001('0x19')]===0x1f4){logger[_0xc001('0x18')](_0xc001('0x14'),_0x5168b6,_0x7f8c34[_0xc001('0x18')]['message']);return _0x24390a(_0x7f8c34[_0xc001('0x18')][_0xc001('0x1a')]);}logger['error'](_0xc001('0x14'),_0x5168b6,_0x7f8c34[_0xc001('0x18')][_0xc001('0x1a')]);return _0x2c94a3(_0x7f8c34['error']['message']);}else{logger[_0xc001('0x13')](_0xc001('0x14'),_0x5168b6,_0xc001('0x15'));_0x2c94a3(_0x7f8c34['result'][_0xc001('0x1a')]);}})['catch'](function(_0x115a5b){logger[_0xc001('0x18')](_0xc001('0x14'),_0x5168b6,_0x115a5b);_0x24390a(_0x115a5b);});});}exports[_0xc001('0x1b')]=function(_0x51deb2){var _0x112168=this;return new Promise(function(_0x188ea3,_0x505f3f){return db[_0xc001('0x1c')]['update'](_0x51deb2['body'],{'raw':_0x51deb2[_0xc001('0x1d')]?_0x51deb2['options'][_0xc001('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51deb2[_0xc001('0x1d')]?_0x51deb2[_0xc001('0x1d')]['where']||null:null,'attributes':_0x51deb2[_0xc001('0x1d')]?_0x51deb2[_0xc001('0x1d')][_0xc001('0x1f')]||null:null,'limit':_0x51deb2[_0xc001('0x1d')]?_0x51deb2[_0xc001('0x1d')][_0xc001('0x20')]||null:null})['then'](function(_0x5c37f4){logger[_0xc001('0x13')](_0xc001('0x1b'),_0x51deb2);logger['debug']('UpdateFaxInteraction',_0x51deb2,JSON[_0xc001('0x21')](_0x5c37f4));_0x188ea3(_0x5c37f4);})[_0xc001('0x22')](function(_0x40f1f3){logger['error'](_0xc001('0x1b'),_0x40f1f3[_0xc001('0x1a')],_0x51deb2);_0x505f3f(_0x112168[_0xc001('0x18')](0x1f4,_0x40f1f3[_0xc001('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x59481a){return new Promise(function(_0x587081,_0x4673f9){return db[_0xc001('0x1c')][_0xc001('0x23')]({'where':_0x59481a[_0xc001('0x1d')]?_0x59481a['options'][_0xc001('0x24')]||null:null})[_0xc001('0x12')](function(_0x3efc9f){if(_0x3efc9f){return _0x3efc9f[_0xc001('0x25')](_0x59481a[_0xc001('0x26')][_0xc001('0x27')],_[_0xc001('0x28')](_0x59481a[_0xc001('0x26')],[_0xc001('0x27'),'id'])||{});}})[_0xc001('0x29')](function(_0x160168){logger[_0xc001('0x13')](_0xc001('0x2a'),_0x59481a);logger[_0xc001('0x16')](_0xc001('0x2a'),_0x59481a,JSON[_0xc001('0x21')](_0x160168));_0x587081(_0x160168);})[_0xc001('0x22')](function(_0x142eb6){logger['error']('AddTags',_0x142eb6['message'],_0x59481a);_0x4673f9(_this[_0xc001('0x18')](0x1f4,_0x142eb6[_0xc001('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ee866f3..418a643 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 _0xf428=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xf428,0x8a));var _0x8f42=function(_0x4e1c8d,_0x19af89){_0x4e1c8d=_0x4e1c8d-0x0;var _0x680c92=_0xf428[_0x4e1c8d];return _0x680c92;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8f42('0x0'),_0x8f42('0x1'),_0x8f42('0x2')];function createListener(_0x38ef4e,_0x1d762c){return function(_0x351b12){_0x1d762c[_0x8f42('0x3')](_0x38ef4e,_0x351b12);};}function removeListener(_0x49ebe8,_0x161704){return function(){FaxInteractionEvents[_0x8f42('0x4')](_0x49ebe8,_0x161704);};}exports[_0x8f42('0x5')]=function(_0x58b96e){for(var _0x2b5b4a=0x0,_0x59ce3d=events[_0x8f42('0x6')];_0x2b5b4a<_0x59ce3d;_0x2b5b4a++){var _0x2ef9e9=events[_0x2b5b4a];var _0x1283bf=createListener(_0x8f42('0x7')+_0x2ef9e9,_0x58b96e);FaxInteractionEvents['on'](_0x2ef9e9,_0x1283bf);}}; \ No newline at end of file +var _0x95a5=['removeListener','register','length','remove','update','emit'];(function(_0x5bc6b5,_0x2a6abf){var _0x21626d=function(_0x41554c){while(--_0x41554c){_0x5bc6b5['push'](_0x5bc6b5['shift']());}};_0x21626d(++_0x2a6abf);}(_0x95a5,0xc3));var _0x595a=function(_0x182e86,_0x39fd27){_0x182e86=_0x182e86-0x0;var _0x37e43f=_0x95a5[_0x182e86];return _0x37e43f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x595a('0x0'),_0x595a('0x1')];function createListener(_0x3eaa47,_0xdfe3cc){return function(_0x3ac181){_0xdfe3cc[_0x595a('0x2')](_0x3eaa47,_0x3ac181);};}function removeListener(_0x287e98,_0x52743e){return function(){FaxInteractionEvents[_0x595a('0x3')](_0x287e98,_0x52743e);};}exports[_0x595a('0x4')]=function(_0x410ae6){for(var _0x185e0f=0x0,_0x817e93=events[_0x595a('0x5')];_0x185e0f<_0x817e93;_0x185e0f++){var _0xa3263d=events[_0x185e0f];var _0x225886=createListener('faxInteraction:'+_0xa3263d,_0x410ae6);FaxInteractionEvents['on'](_0xa3263d,_0x225886);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 52111e8..9d65562 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 _0x3ef6=['delete','faxinteraction:destroy','removeTags','exports','multer','path','express','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','get','/describe','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update'];(function(_0x1e76e8,_0x41ec55){var _0x2d7a1f=function(_0x15a0bd){while(--_0x15a0bd){_0x1e76e8['push'](_0x1e76e8['shift']());}};_0x2d7a1f(++_0x41ec55);}(_0x3ef6,0xd6));var _0x63ef=function(_0xd2df4,_0x5b0104){_0xd2df4=_0xd2df4-0x0;var _0x2a2fc8=_0x3ef6[_0xd2df4];return _0x2a2fc8;};'use strict';var multer=require(_0x63ef('0x0'));var util=require('util');var path=require(_0x63ef('0x1'));var timeout=require('connect-timeout');var express=require(_0x63ef('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x63ef('0x3'));var config=require(_0x63ef('0x4'));var controller=require(_0x63ef('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x63ef('0x6')]);router[_0x63ef('0x7')](_0x63ef('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x63ef('0x7')]('/:id',auth[_0x63ef('0x9')](),controller[_0x63ef('0xa')]);router['get'](_0x63ef('0xb'),auth[_0x63ef('0x9')](),controller['getMessages']);router[_0x63ef('0x7')](_0x63ef('0xc'),auth[_0x63ef('0x9')](),controller[_0x63ef('0xd')]);router[_0x63ef('0xe')]('/',auth[_0x63ef('0x9')](),controller[_0x63ef('0xf')]);router[_0x63ef('0xe')](_0x63ef('0xb'),auth[_0x63ef('0x9')](),controller[_0x63ef('0x10')]);router['post'](_0x63ef('0x11'),auth[_0x63ef('0x9')](),interaction[_0x63ef('0x12')](_0x63ef('0x13'),_0x63ef('0x14')),controller[_0x63ef('0x15')]);router[_0x63ef('0x16')](_0x63ef('0x17'),auth['isAuthenticated'](),interaction[_0x63ef('0x12')](_0x63ef('0x13'),_0x63ef('0x18')),controller[_0x63ef('0x19')]);router[_0x63ef('0x1a')]('/:id',auth[_0x63ef('0x9')](),interaction[_0x63ef('0x12')]('fax',_0x63ef('0x1b')),controller['destroy']);router['delete'](_0x63ef('0x11'),auth[_0x63ef('0x9')](),controller[_0x63ef('0x1c')]);module[_0x63ef('0x1d')]=router; \ No newline at end of file +var _0xe636=['/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x4975f8,_0x3a226c){var _0x86d59f=function(_0x17a8d4){while(--_0x17a8d4){_0x4975f8['push'](_0x4975f8['shift']());}};_0x86d59f(++_0x3a226c);}(_0xe636,0xd3));var _0x6e63=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xe636[_0xc87d08];return _0x30a714;};'use strict';var multer=require(_0x6e63('0x0'));var util=require('util');var path=require(_0x6e63('0x1'));var timeout=require(_0x6e63('0x2'));var express=require(_0x6e63('0x3'));var router=express[_0x6e63('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6e63('0x5'));var config=require(_0x6e63('0x6'));var controller=require('./faxInteraction.controller');router[_0x6e63('0x7')]('/',auth[_0x6e63('0x8')](),controller['index']);router[_0x6e63('0x7')]('/describe',auth[_0x6e63('0x8')](),controller['describe']);router[_0x6e63('0x7')](_0x6e63('0x9'),auth[_0x6e63('0x8')](),controller[_0x6e63('0xa')]);router[_0x6e63('0x7')](_0x6e63('0xb'),auth[_0x6e63('0x8')](),controller[_0x6e63('0xc')]);router[_0x6e63('0x7')](_0x6e63('0xd'),auth['isAuthenticated'](),controller[_0x6e63('0xe')]);router[_0x6e63('0xf')]('/',auth[_0x6e63('0x8')](),controller[_0x6e63('0x10')]);router[_0x6e63('0xf')]('/:id/messages',auth[_0x6e63('0x8')](),controller['addMessage']);router[_0x6e63('0xf')](_0x6e63('0x11'),auth[_0x6e63('0x8')](),interaction[_0x6e63('0x12')](_0x6e63('0x13'),_0x6e63('0x14')),controller[_0x6e63('0x15')]);router[_0x6e63('0x16')]('/:id',auth[_0x6e63('0x8')](),interaction[_0x6e63('0x12')]('fax',_0x6e63('0x17')),controller[_0x6e63('0x18')]);router[_0x6e63('0x19')](_0x6e63('0x9'),auth['isAuthenticated'](),interaction[_0x6e63('0x12')](_0x6e63('0x13'),_0x6e63('0x1a')),controller['destroy']);router[_0x6e63('0x19')](_0x6e63('0x11'),auth[_0x6e63('0x8')](),controller[_0x6e63('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index c98fd67..cf0da3a 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 _0x7f42=['ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x28ba56,_0x183c9a){var _0x39091a=function(_0x370173){while(--_0x370173){_0x28ba56['push'](_0x28ba56['shift']());}};_0x39091a(++_0x183c9a);}(_0x7f42,0x1dd));var _0x27f4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7f42[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'body':{'type':Sequelize[_0x27f4('0x1')](_0x27f4('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x27f4('0x3')]('in','out'),'defaultValue':_0x27f4('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x27f4('0x5')]}}; \ No newline at end of file +var _0xf9f7=['exports','TEXT','medium','BOOLEAN','ENUM','DATE','sequelize'];(function(_0x2cf230,_0x545f5d){var _0x5dee7a=function(_0x51916){while(--_0x51916){_0x2cf230['push'](_0x2cf230['shift']());}};_0x5dee7a(++_0x545f5d);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x339c23,_0x541ff6){_0x339c23=_0x339c23-0x0;var _0x5bf134=_0xf9f7[_0x339c23];return _0x5bf134;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'body':{'type':Sequelize[_0x7f9f('0x2')](_0x7f9f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7f9f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f9f('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x7f9f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7f9f('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9a583fe..de17ad0 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 _0xb4e0=['error','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','destroy','stack','name','send','index','map','rawAttributes','filters','intersection','model','query','attributes','length','hasOwnProperty','order','sort','where','pick','type','filter','merge','FaxMessage','include','findAll','show','keys','includeAll','options','body','find','params','describe','accept','fax','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','role','rejectMessage','SELECT','User','interface','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','server','attachments','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x332903,_0x2e1849){var _0x25cc0e=function(_0x5b491a){while(--_0x5b491a){_0x332903['push'](_0x332903['shift']());}};_0x25cc0e(++_0x2e1849);}(_0xb4e0,0xeb));var _0x0b4e=function(_0x54ebcb,_0x4ec17e){_0x54ebcb=_0x54ebcb-0x0;var _0x2c6d7e=_0xb4e0[_0x54ebcb];return _0x2c6d7e;};'use strict';var emlformat=require(_0x0b4e('0x0'));var rimraf=require(_0x0b4e('0x1'));var zipdir=require(_0x0b4e('0x2'));var jsonpatch=require(_0x0b4e('0x3'));var rp=require(_0x0b4e('0x4'));var moment=require(_0x0b4e('0x5'));var BPromise=require(_0x0b4e('0x6'));var Mustache=require(_0x0b4e('0x7'));var util=require(_0x0b4e('0x8'));var path=require(_0x0b4e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b4e('0xa'));var fs=require('fs');var fs_extra=require(_0x0b4e('0xb'));var _=require('lodash');var squel=require(_0x0b4e('0xc'));var crypto=require(_0x0b4e('0xd'));var jsforce=require(_0x0b4e('0xe'));var deskjs=require(_0x0b4e('0xf'));var toCsv=require(_0x0b4e('0x10'));var querystring=require(_0x0b4e('0x11'));var Papa=require(_0x0b4e('0x12'));var Redis=require(_0x0b4e('0x13'));var authService=require(_0x0b4e('0x14'));var qs=require(_0x0b4e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b4e('0x16'))(_0x0b4e('0x17'));var utils=require(_0x0b4e('0x18'));var config=require(_0x0b4e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b4e('0x1a'))['db'];config[_0x0b4e('0x1b')]=_[_0x0b4e('0x1c')](config['redis'],{'host':_0x0b4e('0x1d'),'port':0x18eb});var socket=require(_0x0b4e('0x1e'))(new Redis(config[_0x0b4e('0x1b')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x0b4e('0x1f'));var client=jayson[_0x0b4e('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x0b4e('0x20')][_0x0b4e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x55cdba,_0x1215b7,_0x4e7a1b,_0x165cf9){return new BPromise(function(_0x21e9d0,_0x22f95e){var _0x4428e5=_0x165cf9||client;return _0x4428e5[_0x0b4e('0x22')](_0x55cdba,_0x4e7a1b)[_0x0b4e('0x23')](function(_0x3c29af){logger[_0x0b4e('0x24')](_0x0b4e('0x25'),_0x1215b7,_0x0b4e('0x26'));logger[_0x0b4e('0x27')](_0x0b4e('0x28'),_0x1215b7,_0x0b4e('0x26'),JSON[_0x0b4e('0x29')](_0x3c29af));if(_0x3c29af['error']){if(_0x3c29af['error'][_0x0b4e('0x2a')]===0x1f4){logger[_0x0b4e('0x2b')](_0x0b4e('0x25'),_0x1215b7,_0x3c29af['error'][_0x0b4e('0x2c')]);return _0x22f95e(_0x3c29af[_0x0b4e('0x2b')][_0x0b4e('0x2c')]);}logger[_0x0b4e('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x1215b7,_0x3c29af[_0x0b4e('0x2b')][_0x0b4e('0x2c')]);return _0x21e9d0(_0x3c29af['error']['message']);}else{logger[_0x0b4e('0x24')]('FaxMessage,\x20%s,\x20%s',_0x1215b7,_0x0b4e('0x26'));_0x21e9d0(_0x3c29af[_0x0b4e('0x2d')][_0x0b4e('0x2c')]);}})[_0x0b4e('0x2e')](function(_0x709a10){logger[_0x0b4e('0x2b')](_0x0b4e('0x25'),_0x1215b7,_0x709a10);_0x22f95e(_0x709a10);});});}function respondWithStatusCode(_0x331ce3,_0x560183){_0x560183=_0x560183||0xcc;return function(_0x42050c){if(_0x42050c){return _0x331ce3[_0x0b4e('0x2f')](_0x560183);}return _0x331ce3[_0x0b4e('0x30')](_0x560183)[_0x0b4e('0x31')]();};}function respondWithResult(_0x53b9a6,_0x3fd4ba){_0x3fd4ba=_0x3fd4ba||0xc8;return function(_0x258d2c){if(_0x258d2c){return _0x53b9a6['status'](_0x3fd4ba)['json'](_0x258d2c);}};}function respondWithFilteredResult(_0x43e896,_0x48dd95){return function(_0x2398be){if(_0x2398be){var _0x5ef41d=typeof _0x48dd95['offset']===_0x0b4e('0x32')&&typeof _0x48dd95[_0x0b4e('0x33')]==='undefined';var _0x531ece=_0x2398be[_0x0b4e('0x34')];var _0x169bab=_0x5ef41d?0x0:_0x48dd95[_0x0b4e('0x35')];var _0x152a2b=_0x5ef41d?_0x2398be[_0x0b4e('0x34')]:_0x48dd95[_0x0b4e('0x35')]+_0x48dd95[_0x0b4e('0x33')];var _0x20c273;if(_0x152a2b>=_0x531ece){_0x152a2b=_0x531ece;_0x20c273=0xc8;}else{_0x20c273=0xce;}_0x43e896['status'](_0x20c273);return _0x43e896[_0x0b4e('0x36')](_0x0b4e('0x37'),_0x169bab+'-'+_0x152a2b+'/'+_0x531ece)[_0x0b4e('0x38')](_0x2398be);}return null;};}function patchUpdates(_0x57b612){return function(_0x16885d){try{jsonpatch['apply'](_0x16885d,_0x57b612,!![]);}catch(_0x558ea2){return BPromise[_0x0b4e('0x39')](_0x558ea2);}return _0x16885d['save']();};}function saveUpdates(_0xa5d0db,_0x43c6fa){return function(_0x13f9fe){if(_0x13f9fe){return _0x13f9fe[_0x0b4e('0x3a')](_0xa5d0db)['then'](function(_0x59b50b){return _0x59b50b;});}return null;};}function removeEntity(_0x500473,_0x5cf7ce){return function(_0x42d198){if(_0x42d198){return _0x42d198[_0x0b4e('0x3b')]()[_0x0b4e('0x23')](function(){_0x500473['status'](0xcc)[_0x0b4e('0x31')]();});}};}function handleEntityNotFound(_0x22e234,_0x5aba68){return function(_0x3daeeb){if(!_0x3daeeb){_0x22e234[_0x0b4e('0x2f')](0x194);}return _0x3daeeb;};}function handleError(_0x21a5cf,_0x42df34){_0x42df34=_0x42df34||0x1f4;return function(_0x780994){logger['error'](_0x780994[_0x0b4e('0x3c')]);if(_0x780994[_0x0b4e('0x3d')]){delete _0x780994[_0x0b4e('0x3d')];}_0x21a5cf[_0x0b4e('0x30')](_0x42df34)[_0x0b4e('0x3e')](_0x780994);};}exports[_0x0b4e('0x3f')]=function(_0xc14fb3,_0x8f9ef8){var _0x46378a={},_0x9d428d={},_0x36e834={'count':0x0,'rows':[]};var _0x1b93f5=_[_0x0b4e('0x40')](db['FaxMessage'][_0x0b4e('0x41')],function(_0x5ae586){return{'name':_0x5ae586['fieldName'],'type':_0x5ae586['type']['key']};});_0x9d428d['model']=_['map'](_0x1b93f5,_0x0b4e('0x3d'));_0x9d428d['query']=_['keys'](_0xc14fb3['query']);_0x9d428d[_0x0b4e('0x42')]=_[_0x0b4e('0x43')](_0x9d428d[_0x0b4e('0x44')],_0x9d428d['query']);_0x46378a['attributes']=_[_0x0b4e('0x43')](_0x9d428d['model'],qs['fields'](_0xc14fb3[_0x0b4e('0x45')]['fields']));_0x46378a[_0x0b4e('0x46')]=_0x46378a['attributes'][_0x0b4e('0x47')]?_0x46378a[_0x0b4e('0x46')]:_0x9d428d[_0x0b4e('0x44')];if(!_0xc14fb3[_0x0b4e('0x45')][_0x0b4e('0x48')]('nolimit')){_0x46378a[_0x0b4e('0x33')]=qs[_0x0b4e('0x33')](_0xc14fb3[_0x0b4e('0x45')][_0x0b4e('0x33')]);_0x46378a[_0x0b4e('0x35')]=qs[_0x0b4e('0x35')](_0xc14fb3[_0x0b4e('0x45')][_0x0b4e('0x35')]);}_0x46378a[_0x0b4e('0x49')]=qs[_0x0b4e('0x4a')](_0xc14fb3[_0x0b4e('0x45')]['sort']);_0x46378a[_0x0b4e('0x4b')]=qs[_0x0b4e('0x42')](_[_0x0b4e('0x4c')](_0xc14fb3[_0x0b4e('0x45')],_0x9d428d['filters']),_0x1b93f5);if(_0xc14fb3[_0x0b4e('0x45')]['filter']){_0x46378a['where']=_['merge'](_0x46378a[_0x0b4e('0x4b')],{'$or':_[_0x0b4e('0x40')](_0x1b93f5,function(_0x277905){if(_0x277905[_0x0b4e('0x4d')]!=='VIRTUAL'){var _0x56d566={};_0x56d566[_0x277905[_0x0b4e('0x3d')]]={'$like':'%'+_0xc14fb3[_0x0b4e('0x45')][_0x0b4e('0x4e')]+'%'};return _0x56d566;}})});}_0x46378a=_[_0x0b4e('0x4f')]({},_0x46378a,_0xc14fb3['options']);var _0x4b24c4={'where':_0x46378a[_0x0b4e('0x4b')]};return db[_0x0b4e('0x50')][_0x0b4e('0x34')](_0x4b24c4)[_0x0b4e('0x23')](function(_0x27a0fb){_0x36e834[_0x0b4e('0x34')]=_0x27a0fb;if(_0xc14fb3['query']['includeAll']){_0x46378a[_0x0b4e('0x51')]=[{'all':!![]}];}return db[_0x0b4e('0x50')][_0x0b4e('0x52')](_0x46378a);})[_0x0b4e('0x23')](function(_0x28d4bb){_0x36e834['rows']=_0x28d4bb;return _0x36e834;})[_0x0b4e('0x23')](respondWithFilteredResult(_0x8f9ef8,_0x46378a))[_0x0b4e('0x2e')](handleError(_0x8f9ef8,null));};exports[_0x0b4e('0x53')]=function(_0x125469,_0x28307b){var _0x5852b0={'raw':!![],'where':{'id':_0x125469['params']['id']}},_0x372edd={};_0x372edd['model']=_[_0x0b4e('0x54')](db[_0x0b4e('0x50')]['rawAttributes']);_0x372edd['query']=_['keys'](_0x125469[_0x0b4e('0x45')]);_0x372edd[_0x0b4e('0x42')]=_[_0x0b4e('0x43')](_0x372edd[_0x0b4e('0x44')],_0x372edd[_0x0b4e('0x45')]);_0x5852b0[_0x0b4e('0x46')]=_[_0x0b4e('0x43')](_0x372edd['model'],qs['fields'](_0x125469[_0x0b4e('0x45')]['fields']));_0x5852b0[_0x0b4e('0x46')]=_0x5852b0[_0x0b4e('0x46')][_0x0b4e('0x47')]?_0x5852b0[_0x0b4e('0x46')]:_0x372edd['model'];if(_0x125469[_0x0b4e('0x45')][_0x0b4e('0x55')]){_0x5852b0[_0x0b4e('0x51')]=[{'all':!![]}];}_0x5852b0=_['merge']({},_0x5852b0,_0x125469[_0x0b4e('0x56')]);return db[_0x0b4e('0x50')]['find'](_0x5852b0)[_0x0b4e('0x23')](handleEntityNotFound(_0x28307b,null))['then'](respondWithResult(_0x28307b,null))[_0x0b4e('0x2e')](handleError(_0x28307b,null));};exports[_0x0b4e('0x3a')]=function(_0x34e997,_0x4694bd){if(_0x34e997[_0x0b4e('0x57')]['id']){delete _0x34e997['body']['id'];}return db[_0x0b4e('0x50')][_0x0b4e('0x58')]({'where':{'id':_0x34e997[_0x0b4e('0x59')]['id']}})['then'](handleEntityNotFound(_0x4694bd,null))[_0x0b4e('0x23')](saveUpdates(_0x34e997[_0x0b4e('0x57')],null))[_0x0b4e('0x23')](respondWithResult(_0x4694bd,null))[_0x0b4e('0x2e')](handleError(_0x4694bd,null));};exports[_0x0b4e('0x3b')]=function(_0x283a47,_0x5785b5){return db[_0x0b4e('0x50')][_0x0b4e('0x58')]({'where':{'id':_0x283a47['params']['id']}})[_0x0b4e('0x23')](handleEntityNotFound(_0x5785b5,null))[_0x0b4e('0x23')](removeEntity(_0x5785b5,null))[_0x0b4e('0x2e')](handleError(_0x5785b5,null));};exports[_0x0b4e('0x5a')]=function(_0x1f283b,_0x291e07){return db[_0x0b4e('0x50')][_0x0b4e('0x5a')]()[_0x0b4e('0x23')](respondWithResult(_0x291e07,null))['catch'](handleError(_0x291e07,null));};var interaction_log=require(_0x0b4e('0x16'))('fax-interactions');exports[_0x0b4e('0x5b')]=function(_0x457e03,_0x12b6eb,_0x3c2f71){var _0x46cca6={'agent':{},'channel':_0x0b4e('0x5c')};if(_0x457e03[_0x0b4e('0x57')]['id']){delete _0x457e03[_0x0b4e('0x57')]['id'];}_0x457e03[_0x0b4e('0x57')]['read']=!![];_0x457e03[_0x0b4e('0x57')]['readAt']=moment()[_0x0b4e('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x457e03[_0x0b4e('0x57')][_0x0b4e('0x5e')]=_0x457e03['body'][_0x0b4e('0x5e')]||_0x457e03[_0x0b4e('0x5f')]['id'];_0x46cca6[_0x0b4e('0x60')]['id']=_0x457e03[_0x0b4e('0x57')][_0x0b4e('0x5e')];return db[_0x0b4e('0x50')][_0x0b4e('0x58')]({'where':{'id':_0x457e03[_0x0b4e('0x59')]['id'],'UserId':null}})[_0x0b4e('0x23')](handleEntityNotFound(_0x12b6eb,null))['then'](saveUpdates(_0x457e03[_0x0b4e('0x57')],null))['then'](function(_0x325a47){if(_0x325a47){_0x46cca6[_0x0b4e('0x2c')]=_0x325a47[_0x0b4e('0x61')]({'plain':!![]});return db[_0x0b4e('0x62')][_0x0b4e('0x58')]({'where':{'id':_0x325a47[_0x0b4e('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x12b6eb,null))['then'](function(_0x415200){if(_0x415200){return _0x415200['update']({'UserId':_0x457e03[_0x0b4e('0x57')][_0x0b4e('0x5e')],'read1stAt':_['isNil'](_0x415200['read1stAt'])?moment()[_0x0b4e('0x5d')](_0x0b4e('0x64')):undefined});}return null;})['then'](function(_0x123991){if(_0x123991){_0x46cca6[_0x0b4e('0x65')]=_0x123991[_0x0b4e('0x61')]({'plain':!![]});interaction_log['info'](_0x0b4e('0x66'),_0x457e03[_0x0b4e('0x5f')]['id'],_0x457e03[_0x0b4e('0x5f')][_0x0b4e('0x3d')],_0x457e03[_0x0b4e('0x5f')]['role'],_0x46cca6['interaction']['id'],_0x457e03[_0x0b4e('0x57')]?JSON[_0x0b4e('0x29')](_0x457e03[_0x0b4e('0x57')]):_0x0b4e('0x67'));return respondWithRpcPromise('AcceptMessage',_0x0b4e('0x68'),_0x46cca6);}return null;})[_0x0b4e('0x23')](function(_0x2403bb){var _0x571659=_0x0b4e('0x69')+_0x2403bb[_0x0b4e('0x2c')][_0x0b4e('0x6a')];return db['sequelize'][_0x0b4e('0x45')](_0x571659,{'type':db[_0x0b4e('0x6b')][_0x0b4e('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x34de8d){return _0x34de8d;});})[_0x0b4e('0x23')](function(_0x3d4d5e){if(_0x3d4d5e){_0x46cca6[_0x0b4e('0x2c')][_0x0b4e('0x6d')]=_0x3d4d5e[0x0];if(!_0x457e03[_0x0b4e('0x57')][_0x0b4e('0x5e')])return;return db['User'][_0x0b4e('0x58')]({'where':{'id':_0x457e03[_0x0b4e('0x57')][_0x0b4e('0x5e')],'role':_0x0b4e('0x60')},'attributes':['id',_0x0b4e('0x3d'),_0x0b4e('0x6e'),'email',_0x0b4e('0x6f')],'raw':!![]});}return null;})[_0x0b4e('0x23')](function(_0x16ae51){if(!_0x16ae51)return null;_0x46cca6[_0x0b4e('0x2c')]['agent']=_0x16ae51;return _0x46cca6;})['then'](function(_0x180d9a){if(_0x180d9a){if(_0x457e03['body'][_0x0b4e('0x70')]){_0x46cca6[_0x0b4e('0x2c')]['interface']=util[_0x0b4e('0x5d')](_0x0b4e('0x71'),_0x457e03[_0x0b4e('0x5f')][_0x0b4e('0x3d')]);_0x46cca6[_0x0b4e('0x2c')][_0x0b4e('0x72')]=_0x46cca6[_0x0b4e('0x72')];_0x46cca6[_0x0b4e('0x2c')][_0x0b4e('0x73')]=_0x46cca6[_0x0b4e('0x72')];_0x46cca6[_0x0b4e('0x2c')][_0x0b4e('0x74')]=_0x0b4e('0x5b');return respondWithRpcPromise(_0x0b4e('0x75'),'EventManager',{'event':_0x0b4e('0x76'),'message':_0x46cca6[_0x0b4e('0x2c')]},client9002)[_0x0b4e('0x23')](function(){return _0x46cca6;});}return _0x46cca6;}return null;})['then'](respondWithResult(_0x12b6eb,null))[_0x0b4e('0x2e')](handleError(_0x12b6eb,null));};var interaction_log=require(_0x0b4e('0x16'))(_0x0b4e('0x77'));exports[_0x0b4e('0x39')]=function(_0x53fc53,_0x28713d,_0x38f837){var _0x2c6a11={'agent':{},'channel':_0x0b4e('0x5c')};if(_0x53fc53[_0x0b4e('0x57')]['id']){delete _0x53fc53[_0x0b4e('0x57')]['id'];}_0x53fc53[_0x0b4e('0x57')][_0x0b4e('0x5e')]=_0x53fc53[_0x0b4e('0x57')][_0x0b4e('0x5e')]||_0x53fc53[_0x0b4e('0x5f')]['id'];_0x2c6a11[_0x0b4e('0x60')]['id']=_0x53fc53[_0x0b4e('0x57')][_0x0b4e('0x5e')];return db[_0x0b4e('0x50')][_0x0b4e('0x58')]({'where':{'id':_0x53fc53['params']['id'],'UserId':null}})[_0x0b4e('0x23')](handleEntityNotFound(_0x28713d,null))[_0x0b4e('0x23')](function(_0x430c86){if(_0x430c86){_0x2c6a11['message']=_0x430c86[_0x0b4e('0x61')]({'plain':!![]});return db[_0x0b4e('0x62')][_0x0b4e('0x58')]({'where':{'id':_0x430c86[_0x0b4e('0x63')]}});}return null;})[_0x0b4e('0x23')](handleEntityNotFound(_0x28713d,null))[_0x0b4e('0x23')](function(_0x1d1316){if(_0x1d1316){_0x2c6a11[_0x0b4e('0x65')]=_0x1d1316[_0x0b4e('0x61')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53fc53[_0x0b4e('0x5f')]['id'],_0x53fc53[_0x0b4e('0x5f')][_0x0b4e('0x3d')],_0x53fc53['user'][_0x0b4e('0x78')],_0x2c6a11[_0x0b4e('0x65')]['id'],_0x53fc53[_0x0b4e('0x57')]?JSON[_0x0b4e('0x29')](_0x53fc53[_0x0b4e('0x57')]):_0x0b4e('0x67'));return respondWithRpcPromise('RejectMessage',_0x0b4e('0x79'),_0x2c6a11);}return null;})[_0x0b4e('0x23')](function(_0x98befe){var _0x39c1f3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x98befe[_0x0b4e('0x2c')][_0x0b4e('0x6a')];return db['sequelize'][_0x0b4e('0x45')](_0x39c1f3,{'type':db[_0x0b4e('0x6b')][_0x0b4e('0x6c')][_0x0b4e('0x7a')],'raw':!![]})[_0x0b4e('0x23')](function(_0x318a10){return _0x318a10;});})[_0x0b4e('0x23')](function(_0x5eb12a){if(_0x5eb12a){_0x2c6a11[_0x0b4e('0x2c')][_0x0b4e('0x6d')]=_0x5eb12a[0x0];if(!_0x53fc53[_0x0b4e('0x57')][_0x0b4e('0x5e')])return;return db[_0x0b4e('0x7b')]['find']({'where':{'id':_0x53fc53[_0x0b4e('0x57')][_0x0b4e('0x5e')],'role':'agent'},'attributes':['id',_0x0b4e('0x3d'),'fullname','email',_0x0b4e('0x6f')],'raw':!![]});}return null;})[_0x0b4e('0x23')](function(_0x1120c3){if(!_0x1120c3)return null;_0x2c6a11[_0x0b4e('0x2c')][_0x0b4e('0x60')]=_0x1120c3;return _0x2c6a11;})[_0x0b4e('0x23')](function(_0x28adef){if(_0x28adef){_0x28adef[_0x0b4e('0x2c')][_0x0b4e('0x7c')]=util[_0x0b4e('0x5d')](_0x0b4e('0x71'),_0x53fc53[_0x0b4e('0x5f')][_0x0b4e('0x3d')]);_0x28adef[_0x0b4e('0x2c')][_0x0b4e('0x72')]=_0x2c6a11[_0x0b4e('0x72')];_0x28adef[_0x0b4e('0x2c')][_0x0b4e('0x73')]=_0x2c6a11[_0x0b4e('0x72')];_0x28adef[_0x0b4e('0x2c')][_0x0b4e('0x74')]=_0x0b4e('0x39');respondWithRpcPromise('EventManager','EventManager',{'event':_0x0b4e('0x7d'),'message':_0x28adef[_0x0b4e('0x2c')]},client9002);return _0x2c6a11;}return null;})[_0x0b4e('0x23')](respondWithResult(_0x28713d,null))[_0x0b4e('0x2e')](handleError(_0x28713d,null));};exports[_0x0b4e('0x7e')]=function(_0x5de411,_0x5e1e16){var _0x1b7d9e;return db[_0x0b4e('0x50')][_0x0b4e('0x7e')](_0x5de411['body'],{})[_0x0b4e('0x23')](function(_0x41ac01){_0x1b7d9e=_0x41ac01;return db[_0x0b4e('0x7f')][_0x0b4e('0x80')]({'where':{'id':_0x1b7d9e[_0x0b4e('0x6a')]}});})[_0x0b4e('0x23')](function(_0x4240ff){if(_[_0x0b4e('0x81')](_0x4240ff)){return;}else{_0x1b7d9e[_0x0b4e('0x5c')]=_0x4240ff[_0x0b4e('0x5c')];return db[_0x0b4e('0x82')][_0x0b4e('0x80')]({'where':{'id':_0x1b7d9e[_0x0b4e('0x83')]}});}})[_0x0b4e('0x23')](function(_0x4cd4f5){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x5de411['body'])?undefined:_0x5de411['body'][_0x0b4e('0x84')],'path':_['isNil'](_0x4cd4f5)?undefined:util[_0x0b4e('0x5d')](_0x0b4e('0x85'),_0x4cd4f5['basename']),'fax':_[_0x0b4e('0x81')](_0x1b7d9e[_0x0b4e('0x5c')])?undefined:_0x1b7d9e[_0x0b4e('0x5c')],'AttachmentId':_0x1b7d9e['AttachmentId']},client9002);})[_0x0b4e('0x23')](respondWithResult(_0x5e1e16,0xc9))[_0x0b4e('0x2e')](handleError(_0x5e1e16,null));};exports[_0x0b4e('0x86')]=function(_0x23b07b,_0x56f1a1){var _0x445bfc=path['join'](config[_0x0b4e('0x87')],_0x0b4e('0x88'),'files',_0x0b4e('0x89'));return db[_0x0b4e('0x50')][_0x0b4e('0x58')]({'where':{'id':_0x23b07b[_0x0b4e('0x59')]['id']},'include':[{'model':db['Attachment'],'as':_0x0b4e('0x82')}]})['then'](handleEntityNotFound(_0x56f1a1,null))[_0x0b4e('0x23')](function(_0x3edb28){if(_0x3edb28){return _0x56f1a1[_0x0b4e('0x86')](path[_0x0b4e('0x8a')](_0x445bfc,_0x3edb28[_0x0b4e('0x82')]['basename']));}})['catch'](handleError(_0x56f1a1,null));}; \ No newline at end of file +var _0x616b=['user','role','null','AcceptMessage','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','motionChannel','create','findOne','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','files','Attachment','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','FaxMessage','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','findAll','show','params','include','update','body','find','describe','../../config/logger','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x5f8bb4,_0x4b6a09){var _0x2a7d10=function(_0x500ec6){while(--_0x500ec6){_0x5f8bb4['push'](_0x5f8bb4['shift']());}};_0x2a7d10(++_0x4b6a09);}(_0x616b,0x1d7));var _0xb616=function(_0x33f1f1,_0x3f2a10){_0x33f1f1=_0x33f1f1-0x0;var _0x3052d4=_0x616b[_0x33f1f1];return _0x3052d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb616('0x0'));var zipdir=require(_0xb616('0x1'));var jsonpatch=require(_0xb616('0x2'));var rp=require(_0xb616('0x3'));var moment=require('moment');var BPromise=require(_0xb616('0x4'));var Mustache=require(_0xb616('0x5'));var util=require(_0xb616('0x6'));var path=require('path');var sox=require(_0xb616('0x7'));var csv=require(_0xb616('0x8'));var ejs=require(_0xb616('0x9'));var fs=require('fs');var fs_extra=require(_0xb616('0xa'));var _=require(_0xb616('0xb'));var squel=require(_0xb616('0xc'));var crypto=require(_0xb616('0xd'));var jsforce=require(_0xb616('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb616('0xf'));var Papa=require(_0xb616('0x10'));var Redis=require(_0xb616('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb616('0x12'));var as=require(_0xb616('0x13'));var hardwareService=require(_0xb616('0x14'));var logger=require('../../config/logger')(_0xb616('0x15'));var utils=require('../../config/utils');var config=require(_0xb616('0x16'));var licenseUtil=require(_0xb616('0x17'));var db=require(_0xb616('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb616('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xb616('0x1a')](socket);var jayson=require(_0xb616('0x1b'));var client=jayson[_0xb616('0x1c')][_0xb616('0x1d')]({'port':0x232c});var client9002=jayson[_0xb616('0x1c')][_0xb616('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4bc097,_0x27950e,_0x50649b,_0x3344f6){return new BPromise(function(_0x54cbd5,_0xcd3e54){var _0x38c858=_0x3344f6||client;return _0x38c858[_0xb616('0x1e')](_0x4bc097,_0x50649b)[_0xb616('0x1f')](function(_0x4e85a3){logger[_0xb616('0x20')](_0xb616('0x21'),_0x27950e,_0xb616('0x22'));logger[_0xb616('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x27950e,_0xb616('0x22'),JSON[_0xb616('0x24')](_0x4e85a3));if(_0x4e85a3[_0xb616('0x25')]){if(_0x4e85a3['error'][_0xb616('0x26')]===0x1f4){logger[_0xb616('0x25')]('FaxMessage,\x20%s,\x20%s',_0x27950e,_0x4e85a3[_0xb616('0x25')][_0xb616('0x27')]);return _0xcd3e54(_0x4e85a3['error'][_0xb616('0x27')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x27950e,_0x4e85a3[_0xb616('0x25')][_0xb616('0x27')]);return _0x54cbd5(_0x4e85a3[_0xb616('0x25')][_0xb616('0x27')]);}else{logger[_0xb616('0x20')](_0xb616('0x21'),_0x27950e,'request\x20sent');_0x54cbd5(_0x4e85a3['result'][_0xb616('0x27')]);}})[_0xb616('0x28')](function(_0x43e43f){logger[_0xb616('0x25')](_0xb616('0x21'),_0x27950e,_0x43e43f);_0xcd3e54(_0x43e43f);});});}function respondWithStatusCode(_0x1da10a,_0x1321f0){_0x1321f0=_0x1321f0||0xcc;return function(_0x1aec4c){if(_0x1aec4c){return _0x1da10a[_0xb616('0x29')](_0x1321f0);}return _0x1da10a[_0xb616('0x2a')](_0x1321f0)[_0xb616('0x2b')]();};}function respondWithResult(_0x22c549,_0x3a3a5e){_0x3a3a5e=_0x3a3a5e||0xc8;return function(_0x818a23){if(_0x818a23){return _0x22c549[_0xb616('0x2a')](_0x3a3a5e)[_0xb616('0x2c')](_0x818a23);}};}function respondWithFilteredResult(_0x539a60,_0x1c7f18){return function(_0x4de91c){if(_0x4de91c){var _0x24e793=typeof _0x1c7f18[_0xb616('0x2d')]===_0xb616('0x2e')&&typeof _0x1c7f18[_0xb616('0x2f')]===_0xb616('0x2e');var _0x51a51a=_0x4de91c[_0xb616('0x30')];var _0x267833=_0x24e793?0x0:_0x1c7f18['offset'];var _0x1aebc1=_0x24e793?_0x4de91c[_0xb616('0x30')]:_0x1c7f18[_0xb616('0x2d')]+_0x1c7f18[_0xb616('0x2f')];var _0x1a8714;if(_0x1aebc1>=_0x51a51a){_0x1aebc1=_0x51a51a;_0x1a8714=0xc8;}else{_0x1a8714=0xce;}_0x539a60[_0xb616('0x2a')](_0x1a8714);return _0x539a60[_0xb616('0x31')](_0xb616('0x32'),_0x267833+'-'+_0x1aebc1+'/'+_0x51a51a)[_0xb616('0x2c')](_0x4de91c);}return null;};}function patchUpdates(_0x58cded){return function(_0xc8ff5){try{jsonpatch[_0xb616('0x33')](_0xc8ff5,_0x58cded,!![]);}catch(_0x225940){return BPromise[_0xb616('0x34')](_0x225940);}return _0xc8ff5[_0xb616('0x35')]();};}function saveUpdates(_0x28321c,_0x1a2bff){return function(_0x39162f){if(_0x39162f){return _0x39162f['update'](_0x28321c)['then'](function(_0x43e040){return _0x43e040;});}return null;};}function removeEntity(_0x4fe8a5,_0x10bfda){return function(_0x1ce0ef){if(_0x1ce0ef){return _0x1ce0ef[_0xb616('0x36')]()['then'](function(){_0x4fe8a5[_0xb616('0x2a')](0xcc)[_0xb616('0x2b')]();});}};}function handleEntityNotFound(_0x11fca6,_0x155c33){return function(_0x3ec407){if(!_0x3ec407){_0x11fca6[_0xb616('0x29')](0x194);}return _0x3ec407;};}function handleError(_0x2841df,_0xb53082){_0xb53082=_0xb53082||0x1f4;return function(_0x42c96d){logger[_0xb616('0x25')](_0x42c96d[_0xb616('0x37')]);if(_0x42c96d[_0xb616('0x38')]){delete _0x42c96d[_0xb616('0x38')];}_0x2841df[_0xb616('0x2a')](_0xb53082)[_0xb616('0x39')](_0x42c96d);};}exports[_0xb616('0x3a')]=function(_0x1a3bbc,_0x522565){var _0x2a3a37={},_0x4eb1a7={},_0x4b789c={'count':0x0,'rows':[]};var _0x5c9b7d=_[_0xb616('0x3b')](db[_0xb616('0x3c')]['rawAttributes'],function(_0x47f8d7){return{'name':_0x47f8d7[_0xb616('0x3d')],'type':_0x47f8d7['type'][_0xb616('0x3e')]};});_0x4eb1a7[_0xb616('0x3f')]=_['map'](_0x5c9b7d,_0xb616('0x38'));_0x4eb1a7[_0xb616('0x40')]=_[_0xb616('0x41')](_0x1a3bbc[_0xb616('0x40')]);_0x4eb1a7[_0xb616('0x42')]=_[_0xb616('0x43')](_0x4eb1a7[_0xb616('0x3f')],_0x4eb1a7['query']);_0x2a3a37['attributes']=_[_0xb616('0x43')](_0x4eb1a7[_0xb616('0x3f')],qs['fields'](_0x1a3bbc['query'][_0xb616('0x44')]));_0x2a3a37[_0xb616('0x45')]=_0x2a3a37[_0xb616('0x45')][_0xb616('0x46')]?_0x2a3a37[_0xb616('0x45')]:_0x4eb1a7[_0xb616('0x3f')];if(!_0x1a3bbc[_0xb616('0x40')]['hasOwnProperty'](_0xb616('0x47'))){_0x2a3a37[_0xb616('0x2f')]=qs[_0xb616('0x2f')](_0x1a3bbc[_0xb616('0x40')]['limit']);_0x2a3a37[_0xb616('0x2d')]=qs[_0xb616('0x2d')](_0x1a3bbc[_0xb616('0x40')][_0xb616('0x2d')]);}_0x2a3a37[_0xb616('0x48')]=qs[_0xb616('0x49')](_0x1a3bbc[_0xb616('0x40')][_0xb616('0x49')]);_0x2a3a37['where']=qs[_0xb616('0x42')](_[_0xb616('0x4a')](_0x1a3bbc['query'],_0x4eb1a7[_0xb616('0x42')]),_0x5c9b7d);if(_0x1a3bbc['query']['filter']){_0x2a3a37['where']=_[_0xb616('0x4b')](_0x2a3a37[_0xb616('0x4c')],{'$or':_[_0xb616('0x3b')](_0x5c9b7d,function(_0x57bafa){if(_0x57bafa[_0xb616('0x4d')]!==_0xb616('0x4e')){var _0x29e1ef={};_0x29e1ef[_0x57bafa['name']]={'$like':'%'+_0x1a3bbc[_0xb616('0x40')][_0xb616('0x4f')]+'%'};return _0x29e1ef;}})});}_0x2a3a37=_['merge']({},_0x2a3a37,_0x1a3bbc[_0xb616('0x50')]);var _0x5d3b8d={'where':_0x2a3a37[_0xb616('0x4c')]};return db['FaxMessage']['count'](_0x5d3b8d)[_0xb616('0x1f')](function(_0x22b278){_0x4b789c[_0xb616('0x30')]=_0x22b278;if(_0x1a3bbc[_0xb616('0x40')][_0xb616('0x51')]){_0x2a3a37['include']=[{'all':!![]}];}return db[_0xb616('0x3c')][_0xb616('0x52')](_0x2a3a37);})[_0xb616('0x1f')](function(_0x4c2729){_0x4b789c['rows']=_0x4c2729;return _0x4b789c;})[_0xb616('0x1f')](respondWithFilteredResult(_0x522565,_0x2a3a37))[_0xb616('0x28')](handleError(_0x522565,null));};exports[_0xb616('0x53')]=function(_0x540887,_0x4d68ee){var _0x4566f3={'raw':!![],'where':{'id':_0x540887[_0xb616('0x54')]['id']}},_0x3ee08b={};_0x3ee08b[_0xb616('0x3f')]=_[_0xb616('0x41')](db['FaxMessage']['rawAttributes']);_0x3ee08b['query']=_['keys'](_0x540887[_0xb616('0x40')]);_0x3ee08b[_0xb616('0x42')]=_['intersection'](_0x3ee08b[_0xb616('0x3f')],_0x3ee08b['query']);_0x4566f3['attributes']=_[_0xb616('0x43')](_0x3ee08b[_0xb616('0x3f')],qs[_0xb616('0x44')](_0x540887[_0xb616('0x40')][_0xb616('0x44')]));_0x4566f3[_0xb616('0x45')]=_0x4566f3[_0xb616('0x45')][_0xb616('0x46')]?_0x4566f3['attributes']:_0x3ee08b[_0xb616('0x3f')];if(_0x540887[_0xb616('0x40')][_0xb616('0x51')]){_0x4566f3[_0xb616('0x55')]=[{'all':!![]}];}_0x4566f3=_[_0xb616('0x4b')]({},_0x4566f3,_0x540887[_0xb616('0x50')]);return db['FaxMessage']['find'](_0x4566f3)['then'](handleEntityNotFound(_0x4d68ee,null))['then'](respondWithResult(_0x4d68ee,null))[_0xb616('0x28')](handleError(_0x4d68ee,null));};exports[_0xb616('0x56')]=function(_0x1257ed,_0x617635){if(_0x1257ed[_0xb616('0x57')]['id']){delete _0x1257ed[_0xb616('0x57')]['id'];}return db['FaxMessage'][_0xb616('0x58')]({'where':{'id':_0x1257ed[_0xb616('0x54')]['id']}})['then'](handleEntityNotFound(_0x617635,null))['then'](saveUpdates(_0x1257ed[_0xb616('0x57')],null))[_0xb616('0x1f')](respondWithResult(_0x617635,null))['catch'](handleError(_0x617635,null));};exports['destroy']=function(_0x5e78a8,_0x3e2c65){return db['FaxMessage'][_0xb616('0x58')]({'where':{'id':_0x5e78a8[_0xb616('0x54')]['id']}})[_0xb616('0x1f')](handleEntityNotFound(_0x3e2c65,null))[_0xb616('0x1f')](removeEntity(_0x3e2c65,null))['catch'](handleError(_0x3e2c65,null));};exports[_0xb616('0x59')]=function(_0x220be1,_0x40f4e8){return db[_0xb616('0x3c')][_0xb616('0x59')]()[_0xb616('0x1f')](respondWithResult(_0x40f4e8,null))[_0xb616('0x28')](handleError(_0x40f4e8,null));};var interaction_log=require(_0xb616('0x5a'))(_0xb616('0x5b'));exports['accept']=function(_0x49c987,_0x3c3dd8,_0x378c6f){var _0x42439c={'agent':{},'channel':'fax'};if(_0x49c987['body']['id']){delete _0x49c987[_0xb616('0x57')]['id'];}_0x49c987[_0xb616('0x57')][_0xb616('0x5c')]=!![];_0x49c987['body'][_0xb616('0x5d')]=moment()[_0xb616('0x5e')](_0xb616('0x5f'));_0x49c987['body']['UserId']=_0x49c987[_0xb616('0x57')]['UserId']||_0x49c987['user']['id'];_0x42439c[_0xb616('0x60')]['id']=_0x49c987['body'][_0xb616('0x61')];return db[_0xb616('0x3c')][_0xb616('0x58')]({'where':{'id':_0x49c987[_0xb616('0x54')]['id'],'UserId':null}})[_0xb616('0x1f')](handleEntityNotFound(_0x3c3dd8,null))[_0xb616('0x1f')](saveUpdates(_0x49c987[_0xb616('0x57')],null))[_0xb616('0x1f')](function(_0x5ebfeb){if(_0x5ebfeb){_0x42439c[_0xb616('0x27')]=_0x5ebfeb[_0xb616('0x62')]({'plain':!![]});return db[_0xb616('0x63')]['find']({'where':{'id':_0x5ebfeb[_0xb616('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3c3dd8,null))[_0xb616('0x1f')](function(_0x474a63){if(_0x474a63){return _0x474a63['update']({'UserId':_0x49c987['body']['UserId'],'read1stAt':_[_0xb616('0x65')](_0x474a63[_0xb616('0x66')])?moment()[_0xb616('0x5e')](_0xb616('0x5f')):undefined});}return null;})['then'](function(_0xd1503c){if(_0xd1503c){_0x42439c[_0xb616('0x67')]=_0xd1503c['get']({'plain':!![]});interaction_log[_0xb616('0x20')](_0xb616('0x68'),_0x49c987[_0xb616('0x69')]['id'],_0x49c987[_0xb616('0x69')]['name'],_0x49c987[_0xb616('0x69')][_0xb616('0x6a')],_0x42439c[_0xb616('0x67')]['id'],_0x49c987[_0xb616('0x57')]?JSON[_0xb616('0x24')](_0x49c987[_0xb616('0x57')]):_0xb616('0x6b'));return respondWithRpcPromise(_0xb616('0x6c'),'acceptMessage',_0x42439c);}return null;})[_0xb616('0x1f')](function(_0x382e10){var _0x27f9d5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x382e10[_0xb616('0x27')]['ContactId'];return db[_0xb616('0x6d')][_0xb616('0x40')](_0x27f9d5,{'type':db['Sequelize'][_0xb616('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x1f8b51){return _0x1f8b51;});})[_0xb616('0x1f')](function(_0x16b322){if(_0x16b322){_0x42439c['message'][_0xb616('0x6f')]=_0x16b322[0x0];if(!_0x49c987[_0xb616('0x57')]['UserId'])return;return db[_0xb616('0x70')][_0xb616('0x58')]({'where':{'id':_0x49c987[_0xb616('0x57')][_0xb616('0x61')],'role':_0xb616('0x60')},'attributes':['id','name',_0xb616('0x71'),_0xb616('0x72'),_0xb616('0x73')],'raw':!![]});}return null;})[_0xb616('0x1f')](function(_0x510736){if(!_0x510736)return null;_0x42439c[_0xb616('0x27')][_0xb616('0x60')]=_0x510736;return _0x42439c;})['then'](function(_0x4427c2){if(_0x4427c2){if(_0x49c987[_0xb616('0x57')]['manual']){_0x42439c[_0xb616('0x27')][_0xb616('0x74')]=util[_0xb616('0x5e')](_0xb616('0x75'),_0x49c987[_0xb616('0x69')][_0xb616('0x38')]);_0x42439c[_0xb616('0x27')][_0xb616('0x76')]=_0x42439c[_0xb616('0x76')];_0x42439c[_0xb616('0x27')]['motionChannel']=_0x42439c[_0xb616('0x76')];_0x42439c['message'][_0xb616('0x77')]=_0xb616('0x78');return respondWithRpcPromise(_0xb616('0x79'),'EventManager',{'event':_0xb616('0x7a'),'message':_0x42439c['message']},client9002)['then'](function(){return _0x42439c;});}return _0x42439c;}return null;})['then'](respondWithResult(_0x3c3dd8,null))[_0xb616('0x28')](handleError(_0x3c3dd8,null));};var interaction_log=require('../../config/logger')(_0xb616('0x5b'));exports[_0xb616('0x34')]=function(_0x3d5092,_0x5581a2,_0x4c3a01){var _0x431b4c={'agent':{},'channel':_0xb616('0x7b')};if(_0x3d5092[_0xb616('0x57')]['id']){delete _0x3d5092['body']['id'];}_0x3d5092[_0xb616('0x57')][_0xb616('0x61')]=_0x3d5092[_0xb616('0x57')][_0xb616('0x61')]||_0x3d5092[_0xb616('0x69')]['id'];_0x431b4c[_0xb616('0x60')]['id']=_0x3d5092[_0xb616('0x57')][_0xb616('0x61')];return db[_0xb616('0x3c')][_0xb616('0x58')]({'where':{'id':_0x3d5092[_0xb616('0x54')]['id'],'UserId':null}})[_0xb616('0x1f')](handleEntityNotFound(_0x5581a2,null))['then'](function(_0x3794e0){if(_0x3794e0){_0x431b4c[_0xb616('0x27')]=_0x3794e0[_0xb616('0x62')]({'plain':!![]});return db[_0xb616('0x63')][_0xb616('0x58')]({'where':{'id':_0x3794e0[_0xb616('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x5581a2,null))[_0xb616('0x1f')](function(_0x4155ea){if(_0x4155ea){_0x431b4c[_0xb616('0x67')]=_0x4155ea['get']({'plain':!![]});interaction_log[_0xb616('0x20')](_0xb616('0x7c'),_0x3d5092['user']['id'],_0x3d5092['user'][_0xb616('0x38')],_0x3d5092['user']['role'],_0x431b4c[_0xb616('0x67')]['id'],_0x3d5092[_0xb616('0x57')]?JSON[_0xb616('0x24')](_0x3d5092[_0xb616('0x57')]):_0xb616('0x6b'));return respondWithRpcPromise(_0xb616('0x7d'),_0xb616('0x7e'),_0x431b4c);}return null;})[_0xb616('0x1f')](function(_0x11b5ff){var _0x5d47f5=_0xb616('0x7f')+_0x11b5ff[_0xb616('0x27')][_0xb616('0x80')];return db[_0xb616('0x6d')][_0xb616('0x40')](_0x5d47f5,{'type':db[_0xb616('0x81')][_0xb616('0x6e')][_0xb616('0x82')],'raw':!![]})[_0xb616('0x1f')](function(_0x433f56){return _0x433f56;});})[_0xb616('0x1f')](function(_0x1a3979){if(_0x1a3979){_0x431b4c[_0xb616('0x27')][_0xb616('0x6f')]=_0x1a3979[0x0];if(!_0x3d5092['body']['UserId'])return;return db[_0xb616('0x70')]['find']({'where':{'id':_0x3d5092[_0xb616('0x57')][_0xb616('0x61')],'role':'agent'},'attributes':['id',_0xb616('0x38'),_0xb616('0x71'),_0xb616('0x72'),_0xb616('0x73')],'raw':!![]});}return null;})[_0xb616('0x1f')](function(_0x12b8a9){if(!_0x12b8a9)return null;_0x431b4c['message'][_0xb616('0x60')]=_0x12b8a9;return _0x431b4c;})[_0xb616('0x1f')](function(_0x5cd255){if(_0x5cd255){_0x5cd255[_0xb616('0x27')][_0xb616('0x74')]=util[_0xb616('0x5e')](_0xb616('0x75'),_0x3d5092[_0xb616('0x69')][_0xb616('0x38')]);_0x5cd255[_0xb616('0x27')][_0xb616('0x76')]=_0x431b4c[_0xb616('0x76')];_0x5cd255['message'][_0xb616('0x83')]=_0x431b4c[_0xb616('0x76')];_0x5cd255[_0xb616('0x27')]['event']=_0xb616('0x34');respondWithRpcPromise(_0xb616('0x79'),_0xb616('0x79'),{'event':'rejectmessage','message':_0x5cd255[_0xb616('0x27')]},client9002);return _0x431b4c;}return null;})[_0xb616('0x1f')](respondWithResult(_0x5581a2,null))[_0xb616('0x28')](handleError(_0x5581a2,null));};exports[_0xb616('0x84')]=function(_0x1f0d50,_0x5a3039){var _0x3c6004;return db['FaxMessage'][_0xb616('0x84')](_0x1f0d50[_0xb616('0x57')],{})['then'](function(_0x2a69a7){_0x3c6004=_0x2a69a7;return db['CmContact'][_0xb616('0x85')]({'where':{'id':_0x3c6004[_0xb616('0x80')]}});})['then'](function(_0x8181d5){if(_['isNil'](_0x8181d5)){return;}else{_0x3c6004[_0xb616('0x7b')]=_0x8181d5[_0xb616('0x7b')];return db['Attachment']['findOne']({'where':{'id':_0x3c6004[_0xb616('0x86')]}});}})[_0xb616('0x1f')](function(_0x1942bd){return respondWithRpcPromise(_0xb616('0x87'),'SendFax',{'FaxAccountId':_[_0xb616('0x65')](_0x1f0d50[_0xb616('0x57')])?undefined:_0x1f0d50['body'][_0xb616('0x88')],'path':_['isNil'](_0x1942bd)?undefined:util[_0xb616('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x1942bd[_0xb616('0x89')]),'fax':_['isNil'](_0x3c6004[_0xb616('0x7b')])?undefined:_0x3c6004[_0xb616('0x7b')],'AttachmentId':_0x3c6004[_0xb616('0x86')]},client9002);})[_0xb616('0x1f')](respondWithResult(_0x5a3039,0xc9))[_0xb616('0x28')](handleError(_0x5a3039,null));};exports['download']=function(_0x3ef118,_0x192282){var _0x249da9=path[_0xb616('0x8a')](config[_0xb616('0x8b')],_0xb616('0x8c'),_0xb616('0x8d'),'attachments');return db[_0xb616('0x3c')]['find']({'where':{'id':_0x3ef118[_0xb616('0x54')]['id']},'include':[{'model':db[_0xb616('0x8e')],'as':_0xb616('0x8e')}]})[_0xb616('0x1f')](handleEntityNotFound(_0x192282,null))[_0xb616('0x1f')](function(_0x3a6ec8){if(_0x3a6ec8){return _0x192282[_0xb616('0x8f')](path[_0xb616('0x8a')](_0x249da9,_0x3a6ec8[_0xb616('0x8e')][_0xb616('0x89')]));}})[_0xb616('0x28')](handleError(_0x192282,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 87e9dc2..4c4aba7 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 _0x4744=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x2ffc7f,_0x21acfa){var _0xed6aa2=function(_0x227171){while(--_0x227171){_0x2ffc7f['push'](_0x2ffc7f['shift']());}};_0xed6aa2(++_0x21acfa);}(_0x4744,0x107));var _0x4474=function(_0x3359a1,_0x3c0c9d){_0x3359a1=_0x3359a1-0x0;var _0x47d235=_0x4744[_0x3359a1];return _0x47d235;};'use strict';var EventEmitter=require(_0x4474('0x0'));var FaxMessage=require(_0x4474('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4474('0x2')](0x0);var events={'afterCreate':_0x4474('0x3'),'afterUpdate':_0x4474('0x4'),'afterDestroy':_0x4474('0x5')};function emitEvent(_0xbb4a32){return function(_0x3337f4,_0x395f6d,_0x37c996){FaxMessageEvents['emit'](_0xbb4a32+':'+_0x3337f4['id'],_0x3337f4);FaxMessageEvents['emit'](_0xbb4a32,_0x3337f4);_0x37c996(null);};}for(var e in events){if(events[_0x4474('0x6')](e)){var event=events[e];FaxMessage[_0x4474('0x7')](e,emitEvent(event));}}module[_0x4474('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x8277=['update','emit','hook','exports','../../mysqldb','FaxMessage','save'];(function(_0x42de8e,_0x467364){var _0x131c1a=function(_0x28cb5a){while(--_0x28cb5a){_0x42de8e['push'](_0x42de8e['shift']());}};_0x131c1a(++_0x467364);}(_0x8277,0xcf));var _0x7827=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x8277[_0x810025];return _0x4dbc81;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7827('0x0'))['db'][_0x7827('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7827('0x2'),'afterUpdate':_0x7827('0x3'),'afterDestroy':'remove'};function emitEvent(_0x141f27){return function(_0x202d8c,_0x56f066,_0x248be2){FaxMessageEvents[_0x7827('0x4')](_0x141f27+':'+_0x202d8c['id'],_0x202d8c);FaxMessageEvents[_0x7827('0x4')](_0x141f27,_0x202d8c);_0x248be2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x7827('0x5')](e,emitEvent(event));}}module[_0x7827('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3ebfc5c..fe2f48f 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 _0x0c66=['../../config/logger','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','define','fti_fax_messages','FULLTEXT','get','toLowerCase','out','secret','isNil','findOne','FaxInteractionId','update','createdAt','catch','utf8mb4','util'];(function(_0x56fd43,_0x4adc65){var _0x259212=function(_0x2ccafa){while(--_0x2ccafa){_0x56fd43['push'](_0x56fd43['shift']());}};_0x259212(++_0x4adc65);}(_0x0c66,0x125));var _0x60c6=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0c66[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0x60c6('0x0'));var logger=require(_0x60c6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x60c6('0x2'));var rp=require(_0x60c6('0x3'));var fs=require('fs');var path=require(_0x60c6('0x4'));var rimraf=require('rimraf');var config=require(_0x60c6('0x5'));var attributes=require(_0x60c6('0x6'));module['exports']=function(_0x5252be,_0x3a25f0){return _0x5252be[_0x60c6('0x7')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x60c6('0x8'),'fields':['body'],'type':_0x60c6('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51363c,_0x202b99,_0x57dbbf){var _0x42eb64=_0x5252be['models'];var _0x36c669=_0x51363c[_0x60c6('0xa')]({'plain':!![]});if(_0x36c669['direction'][_0x60c6('0xb')]()==='in'||_0x36c669['direction']['toLowerCase']()===_0x60c6('0xc')&&!_0x36c669[_0x60c6('0xd')]&&!_[_0x60c6('0xe')](_0x36c669['UserId'])){_0x42eb64['FaxInteraction'][_0x60c6('0xf')]({'where':{'id':_0x36c669[_0x60c6('0x10')]}})['then'](function(_0x426bbe){if(_0x426bbe){_0x426bbe[_0x60c6('0x11')]({'lastMsgAt':_0x36c669[_0x60c6('0x12')],'lastMsgDirection':_0x36c669['direction']['toLowerCase']()});}})[_0x60c6('0x13')](function(_0x41ba18){console['error'](_0x41ba18);});}_0x57dbbf();}},'charset':_0x60c6('0x14'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x258f=['moment','path','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x5cdfa7,_0x2b862c){var _0x49b176=function(_0x306604){while(--_0x306604){_0x5cdfa7['push'](_0x5cdfa7['shift']());}};_0x49b176(++_0x2b862c);}(_0x258f,0x15c));var _0xf258=function(_0x403e89,_0x48a1dc){_0x403e89=_0x403e89-0x0;var _0xdcccb9=_0x258f[_0x403e89];return _0xdcccb9;};'use strict';var _=require(_0xf258('0x0'));var util=require(_0xf258('0x1'));var logger=require('../../config/logger')(_0xf258('0x2'));var moment=require(_0xf258('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf258('0x4'));var rimraf=require(_0xf258('0x5'));var config=require(_0xf258('0x6'));var attributes=require(_0xf258('0x7'));module['exports']=function(_0x414abd,_0x3351fa){return _0x414abd[_0xf258('0x8')]('FaxMessage',attributes,{'tableName':_0xf258('0x9'),'paranoid':![],'indexes':[{'name':_0xf258('0xa'),'fields':[_0xf258('0xb')],'type':_0xf258('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf900a2,_0x1c7e4d,_0x3108f9){var _0xaca87e=_0x414abd[_0xf258('0xd')];var _0x5c52c0=_0xf900a2[_0xf258('0xe')]({'plain':!![]});if(_0x5c52c0[_0xf258('0xf')][_0xf258('0x10')]()==='in'||_0x5c52c0[_0xf258('0xf')][_0xf258('0x10')]()===_0xf258('0x11')&&!_0x5c52c0[_0xf258('0x12')]&&!_[_0xf258('0x13')](_0x5c52c0['UserId'])){_0xaca87e[_0xf258('0x14')][_0xf258('0x15')]({'where':{'id':_0x5c52c0['FaxInteractionId']}})[_0xf258('0x16')](function(_0x43cbe0){if(_0x43cbe0){_0x43cbe0['update']({'lastMsgAt':_0x5c52c0[_0xf258('0x17')],'lastMsgDirection':_0x5c52c0[_0xf258('0xf')][_0xf258('0x10')]()});}})[_0xf258('0x18')](function(_0x184232){console[_0xf258('0x19')](_0x184232);});}_0x3108f9();}},'charset':'utf8mb4','collate':_0xf258('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 394eb1e..4282f65 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 _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x3b45d7,_0xbc2848){var _0x4690e8=function(_0x209c3b){while(--_0x209c3b){_0x3b45d7['push'](_0x3b45d7['shift']());}};_0x4690e8(++_0xbc2848);}(_0x70e0,0x17b));var _0x070e=function(_0x3a5949,_0x45f4c5){_0x3a5949=_0x3a5949-0x0;var _0x59c43d=_0x70e0[_0x3a5949];return _0x59c43d;};'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});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file +var _0x8d0e=['http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x54c625,_0x1ac2a4){var _0x489f6a=function(_0x4f233d){while(--_0x4f233d){_0x54c625['push'](_0x54c625['shift']());}};_0x489f6a(++_0x1ac2a4);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x59a1e1,_0x20b1bd){_0x59a1e1=_0x59a1e1-0x0;var _0x17e503=_0x8d0e[_0x59a1e1];return _0x17e503;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('FaxMessage,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});}exports[_0xe8d0('0x1a')]=function(_0x12ebf4){var _0x524b00=this;return new Promise(function(_0x5ce284,_0x554402){return db[_0xe8d0('0x1b')][_0xe8d0('0x1c')](_0x12ebf4[_0xe8d0('0x1d')],{'raw':_0x12ebf4[_0xe8d0('0x1e')]?_0x12ebf4[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![]})[_0xe8d0('0x11')](function(_0x28a6b5){logger[_0xe8d0('0x12')]('CreateFaxMessage',_0x12ebf4);logger[_0xe8d0('0x20')](_0xe8d0('0x1a'),_0x12ebf4,JSON['stringify'](_0x28a6b5));_0x5ce284(_0x28a6b5);})[_0xe8d0('0x19')](function(_0x2e69d1){logger[_0xe8d0('0x16')](_0xe8d0('0x1a'),_0x2e69d1[_0xe8d0('0x17')],_0x12ebf4);_0x554402(_0x524b00[_0xe8d0('0x16')](0x1f4,_0x2e69d1[_0xe8d0('0x17')]));});});};exports[_0xe8d0('0x21')]=function(_0xfa3527){var _0x2dee67=this;return new Promise(function(_0x264de4,_0x539548){return db[_0xe8d0('0x1b')][_0xe8d0('0x22')](_0xfa3527[_0xe8d0('0x1d')],{'raw':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x23')]||null:null,'attributes':_0xfa3527[_0xe8d0('0x1e')]?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x24')]||null:null,'limit':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')]['limit']||null:null})['then'](function(_0x50ad3c){logger[_0xe8d0('0x12')](_0xe8d0('0x21'),_0xfa3527);logger[_0xe8d0('0x20')]('UpdateFaxMessage',_0xfa3527,JSON['stringify'](_0x50ad3c));_0x264de4(_0x50ad3c);})[_0xe8d0('0x19')](function(_0x551999){logger[_0xe8d0('0x16')](_0xe8d0('0x21'),_0x551999[_0xe8d0('0x17')],_0xfa3527);_0x539548(_0x2dee67[_0xe8d0('0x16')](0x1f4,_0x551999[_0xe8d0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cab4fef..a8e56b5 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 _0x6b0c=['faxMessage:','save','update','emit','removeListener'];(function(_0x1f1e54,_0x4ee42d){var _0x432e67=function(_0x5e684b){while(--_0x5e684b){_0x1f1e54['push'](_0x1f1e54['shift']());}};_0x432e67(++_0x4ee42d);}(_0x6b0c,0x1aa));var _0xc6b0=function(_0x10d043,_0x596d4f){_0x10d043=_0x10d043-0x0;var _0x52302c=_0x6b0c[_0x10d043];return _0x52302c;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xc6b0('0x0'),'remove',_0xc6b0('0x1')];function createListener(_0xee7189,_0x55eae4){return function(_0x52ffc3){_0x55eae4[_0xc6b0('0x2')](_0xee7189,_0x52ffc3);};}function removeListener(_0x4d4120,_0x198bd6){return function(){FaxMessageEvents[_0xc6b0('0x3')](_0x4d4120,_0x198bd6);};}exports['register']=function(_0x4d239e){for(var _0x59664d=0x0,_0x5bce79=events['length'];_0x59664d<_0x5bce79;_0x59664d++){var _0x5a146e=events[_0x59664d];var _0x28b1c1=createListener(_0xc6b0('0x4')+_0x5a146e,_0x4d239e);FaxMessageEvents['on'](_0x5a146e,_0x28b1c1);}}; \ No newline at end of file +var _0xf5bb=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','update'];(function(_0x2885e8,_0x57120f){var _0x1f6fb2=function(_0x5e3afb){while(--_0x5e3afb){_0x2885e8['push'](_0x2885e8['shift']());}};_0x1f6fb2(++_0x57120f);}(_0xf5bb,0x1cd));var _0xbf5b=function(_0x4f9495,_0x54790e){_0x4f9495=_0x4f9495-0x0;var _0x3e9d85=_0xf5bb[_0x4f9495];return _0x3e9d85;};'use strict';var FaxMessageEvents=require(_0xbf5b('0x0'));var events=[_0xbf5b('0x1'),'remove',_0xbf5b('0x2')];function createListener(_0x513040,_0x3c5f55){return function(_0x364677){_0x3c5f55[_0xbf5b('0x3')](_0x513040,_0x364677);};}function removeListener(_0x2be23a,_0x1e0604){return function(){FaxMessageEvents[_0xbf5b('0x4')](_0x2be23a,_0x1e0604);};}exports[_0xbf5b('0x5')]=function(_0x332786){for(var _0x168d22=0x0,_0x462f1f=events[_0xbf5b('0x6')];_0x168d22<_0x462f1f;_0x168d22++){var _0xf11135=events[_0x168d22];var _0x167193=createListener(_0xbf5b('0x7')+_0xf11135,_0x332786);FaxMessageEvents['on'](_0xf11135,_0x167193);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e60674a..284a856 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 _0xc788=['describe','/:id','show','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc788,0xc4));var _0x8c78=function(_0x7b68cc,_0x3f522e){_0x7b68cc=_0x7b68cc-0x0;var _0x36470e=_0xc788[_0x7b68cc];return _0x36470e;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./faxMessage.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/download',auth[_0x8c78('0x9')](),controller['download']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),interaction['tracked'](_0x8c78('0x10'),_0x8c78('0x11')),controller['create']);router[_0x8c78('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8c78('0x13')]);router[_0x8c78('0x12')](_0x8c78('0x14'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x15')]);router[_0x8c78('0x12')](_0x8c78('0x16'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x17')]);router[_0x8c78('0x18')]('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','faxmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe706,0xa3));var _0x6e70=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0xe706[_0x49a1a0];return _0x518a4f;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('fax',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 185a84a..4ce63b6 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 _0xa23f=['INTEGER','sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4267a8,_0x12c65a){var _0x38fd43=function(_0x527ef8){while(--_0x527ef8){_0x4267a8['push'](_0x4267a8['shift']());}};_0x38fd43(++_0x12c65a);}(_0xa23f,0x18d));var _0xfa23=function(_0x51e1a6,_0x450114){_0x51e1a6=_0x51e1a6-0x0;var _0x279845=_0xa23f[_0x51e1a6];return _0x279845;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'name':{'type':Sequelize[_0xfa23('0x2')],'unique':_0xfa23('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa23('0x4')](_0xfa23('0x5'),_0xfa23('0x6'),_0xfa23('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfa23('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5b47=['sequelize','exports','rrmemory','beepall','roundrobin','INTEGER'];(function(_0xf71292,_0x5bddbe){var _0x23e193=function(_0x257990){while(--_0x257990){_0xf71292['push'](_0xf71292['shift']());}};_0x23e193(++_0x5bddbe);}(_0x5b47,0x120));var _0x75b4=function(_0x2c7dd6,_0x562fc7){_0x2c7dd6=_0x2c7dd6-0x0;var _0x3ee3f8=_0x5b47[_0x2c7dd6];return _0x3ee3f8;};'use strict';var Sequelize=require(_0x75b4('0x0'));module[_0x75b4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x75b4('0x2'),_0x75b4('0x3'),_0x75b4('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x75b4('0x5')],'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 7fdbe49..3cf9345 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 _0x507a=['format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','findAll','User','Agents','flatMap','transaction','each','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','sequelize','toString','SELECT','includes','all','union','compact','value','removeTeams','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','FaxQueue','rows','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','pick','FaxQueueId','findAndCountAll','UserId','agent','faxPause'];(function(_0x245c39,_0x223b55){var _0x92468a=function(_0x1fb7f5){while(--_0x1fb7f5){_0x245c39['push'](_0x245c39['shift']());}};_0x92468a(++_0x223b55);}(_0x507a,0x1ca));var _0xa507=function(_0x3f5b8e,_0x4f5819){_0x3f5b8e=_0x3f5b8e-0x0;var _0x5eae66=_0x507a[_0x3f5b8e];return _0x5eae66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa507('0x0'));var rp=require(_0xa507('0x1'));var moment=require('moment');var BPromise=require(_0xa507('0x2'));var Mustache=require(_0xa507('0x3'));var util=require(_0xa507('0x4'));var path=require(_0xa507('0x5'));var sox=require(_0xa507('0x6'));var csv=require(_0xa507('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa507('0x8'));var squel=require(_0xa507('0x9'));var crypto=require(_0xa507('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa507('0xb'));var toCsv=require(_0xa507('0x7'));var querystring=require(_0xa507('0xc'));var Papa=require(_0xa507('0xd'));var Redis=require(_0xa507('0xe'));var authService=require(_0xa507('0xf'));var qs=require(_0xa507('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa507('0x11'))(_0xa507('0x12'));var utils=require(_0xa507('0x13'));var config=require(_0xa507('0x14'));var licenseUtil=require(_0xa507('0x15'));var db=require(_0xa507('0x16'))['db'];config[_0xa507('0x17')]=_['defaults'](config[_0xa507('0x17')],{'host':_0xa507('0x18'),'port':0x18eb});var socket=require(_0xa507('0x19'))(new Redis(config[_0xa507('0x17')]));require('./faxQueue.socket')[_0xa507('0x1a')](socket);function respondWithStatusCode(_0x275d6a,_0x5d63a1){_0x5d63a1=_0x5d63a1||0xcc;return function(_0x56b723){if(_0x56b723){return _0x275d6a[_0xa507('0x1b')](_0x5d63a1);}return _0x275d6a[_0xa507('0x1c')](_0x5d63a1)[_0xa507('0x1d')]();};}function respondWithResult(_0x1f9982,_0x1e67b9){_0x1e67b9=_0x1e67b9||0xc8;return function(_0x1a7fb9){if(_0x1a7fb9){return _0x1f9982[_0xa507('0x1c')](_0x1e67b9)[_0xa507('0x1e')](_0x1a7fb9);}};}function respondWithFilteredResult(_0x437786,_0x5d12b2){return function(_0x589936){if(_0x589936){var _0x26fc1a=typeof _0x5d12b2['offset']===_0xa507('0x1f')&&typeof _0x5d12b2[_0xa507('0x20')]===_0xa507('0x1f');var _0x423d11=_0x589936['count'];var _0x34a909=_0x26fc1a?0x0:_0x5d12b2[_0xa507('0x21')];var _0x303de8=_0x26fc1a?_0x589936[_0xa507('0x22')]:_0x5d12b2[_0xa507('0x21')]+_0x5d12b2['limit'];var _0x4f88f6;if(_0x303de8>=_0x423d11){_0x303de8=_0x423d11;_0x4f88f6=0xc8;}else{_0x4f88f6=0xce;}_0x437786[_0xa507('0x1c')](_0x4f88f6);return _0x437786[_0xa507('0x23')]('Content-Range',_0x34a909+'-'+_0x303de8+'/'+_0x423d11)[_0xa507('0x1e')](_0x589936);}return null;};}function patchUpdates(_0x36c62d){return function(_0x4a258a){try{jsonpatch[_0xa507('0x24')](_0x4a258a,_0x36c62d,!![]);}catch(_0x417fe5){return BPromise[_0xa507('0x25')](_0x417fe5);}return _0x4a258a[_0xa507('0x26')]();};}function saveUpdates(_0x18cea5,_0xa674b3){return function(_0x3ea56a){if(_0x3ea56a){return _0x3ea56a[_0xa507('0x27')](_0x18cea5)[_0xa507('0x28')](function(_0x1cbb55){return _0x1cbb55;});}return null;};}function removeEntity(_0x90cffb,_0x1c9336){return function(_0x51cbe6){if(_0x51cbe6){return _0x51cbe6[_0xa507('0x29')]()[_0xa507('0x28')](function(){var _0x310c85=_0x51cbe6[_0xa507('0x2a')]({'plain':!![]});var _0x1a269a=_0xa507('0x2b');return db[_0xa507('0x2c')]['destroy']({'where':{'type':_0x1a269a,'resourceId':_0x310c85['id']}})['then'](function(){return _0x51cbe6;});})[_0xa507('0x28')](function(){_0x90cffb[_0xa507('0x1c')](0xcc)[_0xa507('0x1d')]();});}};}function handleEntityNotFound(_0xb4bdc6,_0x495034){return function(_0xf7c7c8){if(!_0xf7c7c8){_0xb4bdc6[_0xa507('0x1b')](0x194);}return _0xf7c7c8;};}function handleError(_0xe8dfef,_0xbe1f0a){_0xbe1f0a=_0xbe1f0a||0x1f4;return function(_0x5433a2){logger[_0xa507('0x2d')](_0x5433a2['stack']);if(_0x5433a2[_0xa507('0x2e')]){delete _0x5433a2['name'];}_0xe8dfef[_0xa507('0x1c')](_0xbe1f0a)[_0xa507('0x2f')](_0x5433a2);};}exports[_0xa507('0x30')]=function(_0x44fcd8,_0x5db510){var _0xee36c4={},_0x3ef9b0={},_0x4e6215={'count':0x0,'rows':[]};var _0x879742=_['map'](db['FaxQueue'][_0xa507('0x31')],function(_0xa2af2b){return{'name':_0xa2af2b[_0xa507('0x32')],'type':_0xa2af2b[_0xa507('0x33')][_0xa507('0x34')]};});_0x3ef9b0[_0xa507('0x35')]=_[_0xa507('0x36')](_0x879742,_0xa507('0x2e'));_0x3ef9b0[_0xa507('0x37')]=_['keys'](_0x44fcd8[_0xa507('0x37')]);_0x3ef9b0[_0xa507('0x38')]=_[_0xa507('0x39')](_0x3ef9b0[_0xa507('0x35')],_0x3ef9b0['query']);_0xee36c4[_0xa507('0x3a')]=_[_0xa507('0x39')](_0x3ef9b0['model'],qs[_0xa507('0x3b')](_0x44fcd8[_0xa507('0x37')][_0xa507('0x3b')]));_0xee36c4[_0xa507('0x3a')]=_0xee36c4[_0xa507('0x3a')][_0xa507('0x3c')]?_0xee36c4['attributes']:_0x3ef9b0[_0xa507('0x35')];if(!_0x44fcd8[_0xa507('0x37')][_0xa507('0x3d')](_0xa507('0x3e'))){_0xee36c4[_0xa507('0x20')]=qs[_0xa507('0x20')](_0x44fcd8[_0xa507('0x37')][_0xa507('0x20')]);_0xee36c4[_0xa507('0x21')]=qs['offset'](_0x44fcd8[_0xa507('0x37')]['offset']);}_0xee36c4[_0xa507('0x3f')]=qs[_0xa507('0x40')](_0x44fcd8['query']['sort']);_0xee36c4[_0xa507('0x41')]=qs[_0xa507('0x38')](_['pick'](_0x44fcd8['query'],_0x3ef9b0[_0xa507('0x38')]),_0x879742);if(_0x44fcd8[_0xa507('0x37')][_0xa507('0x42')]){_0xee36c4[_0xa507('0x41')]=_[_0xa507('0x43')](_0xee36c4['where'],{'$or':_['map'](_0x879742,function(_0x39024d){if(_0x39024d['type']!==_0xa507('0x44')){var _0x1a9bc1={};_0x1a9bc1[_0x39024d['name']]={'$like':'%'+_0x44fcd8[_0xa507('0x37')]['filter']+'%'};return _0x1a9bc1;}})});}_0xee36c4=_['merge']({},_0xee36c4,_0x44fcd8[_0xa507('0x45')]);var _0x1355cd={'where':_0xee36c4[_0xa507('0x41')]};return db['FaxQueue'][_0xa507('0x22')](_0x1355cd)['then'](function(_0xd41721){_0x4e6215[_0xa507('0x22')]=_0xd41721;if(_0x44fcd8[_0xa507('0x37')][_0xa507('0x46')]){_0xee36c4[_0xa507('0x47')]=[{'all':!![]}];}return db[_0xa507('0x48')]['findAll'](_0xee36c4);})[_0xa507('0x28')](function(_0x59f5f3){_0x4e6215[_0xa507('0x49')]=_0x59f5f3;return _0x4e6215;})['then'](respondWithFilteredResult(_0x5db510,_0xee36c4))[_0xa507('0x4a')](handleError(_0x5db510,null));};exports['show']=function(_0x20261e,_0x1d5bb5){var _0x386d84={'raw':!![],'where':{'id':_0x20261e[_0xa507('0x4b')]['id']}},_0x263dbc={};_0x263dbc[_0xa507('0x35')]=_[_0xa507('0x4c')](db[_0xa507('0x48')]['rawAttributes']);_0x263dbc[_0xa507('0x37')]=_[_0xa507('0x4c')](_0x20261e[_0xa507('0x37')]);_0x263dbc['filters']=_['intersection'](_0x263dbc['model'],_0x263dbc['query']);_0x386d84['attributes']=_['intersection'](_0x263dbc[_0xa507('0x35')],qs['fields'](_0x20261e[_0xa507('0x37')][_0xa507('0x3b')]));_0x386d84[_0xa507('0x3a')]=_0x386d84[_0xa507('0x3a')][_0xa507('0x3c')]?_0x386d84['attributes']:_0x263dbc[_0xa507('0x35')];if(_0x20261e[_0xa507('0x37')][_0xa507('0x46')]){_0x386d84[_0xa507('0x47')]=[{'all':!![]}];}_0x386d84=_[_0xa507('0x43')]({},_0x386d84,_0x20261e[_0xa507('0x45')]);return db['FaxQueue'][_0xa507('0x4d')](_0x386d84)[_0xa507('0x28')](handleEntityNotFound(_0x1d5bb5,null))['then'](respondWithResult(_0x1d5bb5,null))[_0xa507('0x4a')](handleError(_0x1d5bb5,null));};exports[_0xa507('0x4e')]=function(_0x3d02c0,_0x4fe073){return db[_0xa507('0x48')][_0xa507('0x4e')](_0x3d02c0['body'],{})[_0xa507('0x28')](function(_0x4d76e5){var _0x4ebea7=_0x3d02c0[_0xa507('0x4f')][_0xa507('0x2a')]({'plain':!![]});if(!_0x4ebea7)throw new Error(_0xa507('0x50'));if(_0x4ebea7[_0xa507('0x51')]===_0xa507('0x4f')){var _0x2f0d6f=_0x4d76e5[_0xa507('0x2a')]({'plain':!![]});var _0x406fa3=_0xa507('0x2b');return db[_0xa507('0x52')]['find']({'where':{'name':_0x406fa3,'userProfileId':_0x4ebea7['userProfileId']},'raw':!![]})[_0xa507('0x28')](function(_0x30e356){if(_0x30e356&&_0x30e356[_0xa507('0x53')]===0x0){return db[_0xa507('0x2c')][_0xa507('0x4e')]({'name':_0x2f0d6f['name'],'resourceId':_0x2f0d6f['id'],'type':_0x30e356['name'],'sectionId':_0x30e356['id']},{})[_0xa507('0x28')](function(){return _0x4d76e5;});}else{return _0x4d76e5;}})[_0xa507('0x4a')](function(_0x376165){logger[_0xa507('0x2d')](_0xa507('0x54'),_0x376165);throw _0x376165;});}return _0x4d76e5;})['then'](respondWithResult(_0x4fe073,0xc9))[_0xa507('0x4a')](handleError(_0x4fe073,null));};exports[_0xa507('0x27')]=function(_0x248f67,_0x32ea71){if(_0x248f67[_0xa507('0x55')]['id']){delete _0x248f67['body']['id'];}return db[_0xa507('0x48')]['find']({'where':{'id':_0x248f67[_0xa507('0x4b')]['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x32ea71,null))['then'](saveUpdates(_0x248f67[_0xa507('0x55')],null))[_0xa507('0x28')](respondWithResult(_0x32ea71,null))[_0xa507('0x4a')](handleError(_0x32ea71,null));};exports[_0xa507('0x29')]=function(_0x2378c6,_0x17e988){return db[_0xa507('0x48')][_0xa507('0x4d')]({'where':{'id':_0x2378c6['params']['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x17e988,null))[_0xa507('0x28')](removeEntity(_0x17e988,null))[_0xa507('0x4a')](handleError(_0x17e988,null));};exports[_0xa507('0x56')]=function(_0x2fa536,_0x5b882d){return db['FaxQueue'][_0xa507('0x56')]()[_0xa507('0x28')](respondWithResult(_0x5b882d,null))[_0xa507('0x4a')](handleError(_0x5b882d,null));};exports['getMembers']=function(_0x552867,_0x179773,_0xbd4b27){var _0x12a912={'raw':!![],'where':{}},_0x24a986={},_0x4c7a16;return db[_0xa507('0x48')][_0xa507('0x57')]({'where':{'id':_0x552867[_0xa507('0x4b')]['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x179773,null))[_0xa507('0x28')](function(_0x11fab8){if(_0x11fab8){_0x4c7a16=_0x11fab8['get']({'plain':!![]});_0x24a986[_0xa507('0x35')]=_[_0xa507('0x4c')](db['UserFaxQueue'][_0xa507('0x31')]);_0x24a986['query']=_[_0xa507('0x4c')](_0x552867[_0xa507('0x37')]);_0x24a986['filters']=_['intersection'](_0x24a986[_0xa507('0x35')],_0x24a986['query']);_0x12a912['attributes']=_['intersection'](_0x24a986[_0xa507('0x35')],qs[_0xa507('0x3b')](_0x552867[_0xa507('0x37')][_0xa507('0x3b')]));_0x12a912[_0xa507('0x3a')]=_0x12a912[_0xa507('0x3a')][_0xa507('0x3c')]?_0x12a912[_0xa507('0x3a')]:_0x24a986['model'];if(!_0x552867[_0xa507('0x37')][_0xa507('0x3d')](_0xa507('0x3e'))){_0x12a912[_0xa507('0x20')]=qs['limit'](_0x552867[_0xa507('0x37')][_0xa507('0x20')]);_0x12a912[_0xa507('0x21')]=qs[_0xa507('0x21')](_0x552867['query'][_0xa507('0x21')]);}_0x12a912[_0xa507('0x3f')]=qs[_0xa507('0x40')](_0x552867[_0xa507('0x37')][_0xa507('0x40')]);_0x12a912[_0xa507('0x41')]=qs[_0xa507('0x38')](_[_0xa507('0x58')](_0x552867[_0xa507('0x37')],_0x24a986[_0xa507('0x38')]));_0x12a912[_0xa507('0x41')][_0xa507('0x59')]=_0x11fab8['id'];if(_0x552867[_0xa507('0x37')][_0xa507('0x42')]){_0x12a912[_0xa507('0x41')]=_['merge'](_0x12a912[_0xa507('0x41')],{'$or':_[_0xa507('0x36')](_0x12a912[_0xa507('0x3a')],function(_0x2175b2){var _0x744ec6={};_0x744ec6[_0x2175b2]={'$like':'%'+_0x552867[_0xa507('0x37')][_0xa507('0x42')]+'%'};return _0x744ec6;})});}_0x12a912=_[_0xa507('0x43')]({},_0x12a912,_0x552867[_0xa507('0x45')]);return db['UserFaxQueue']['findAll'](_0x12a912);}})['then'](function(_0x872f6b){if(_0x872f6b){return db['User'][_0xa507('0x5a')]({'where':{'id':_[_0xa507('0x36')](_0x872f6b,_0xa507('0x5b')),'role':_0xa507('0x5c')},'attributes':['id',_0xa507('0x2e'),_0xa507('0x5d'),'updatedAt','createdAt']});}})[_0xa507('0x28')](function(_0x4fd7ad){if(_0x4fd7ad){return{'count':_0x4fd7ad['count'],'rows':_['map'](_0x4fd7ad[_0xa507('0x49')],function(_0x77bab6){return{'membername':_0x77bab6[_0xa507('0x2e')],'UserId':_0x77bab6['id'],'queue_name':_0x4c7a16[_0xa507('0x2e')],'FaxQueueId':_0x4c7a16['id'],'interface':util[_0xa507('0x5e')](_0xa507('0x5f'),_0xa507('0x60'),_0x77bab6[_0xa507('0x2e')]),'penalty':0x0,'paused':_0x77bab6[_0xa507('0x5d')],'createdAt':_0x77bab6[_0xa507('0x61')],'updatedAt':_0x77bab6[_0xa507('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa507('0x28')](respondWithFilteredResult(_0x179773,_0x12a912))['catch'](handleError(_0x179773,null));};exports[_0xa507('0x63')]=function(_0x2f762a,_0x53fd2d,_0x24c275){var _0x280e8d={};var _0x2f43b0={};var _0x1dfa03;var _0x482ac1;return db[_0xa507('0x48')][_0xa507('0x57')]({'where':{'id':_0x2f762a['params']['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x53fd2d,null))[_0xa507('0x28')](function(_0x2106de){if(_0x2106de){_0x1dfa03=_0x2106de;_0x2f43b0['model']=_[_0xa507('0x4c')](db[_0xa507('0x64')]['rawAttributes']);_0x2f43b0['query']=_[_0xa507('0x4c')](_0x2f762a[_0xa507('0x37')]);_0x2f43b0['filters']=_[_0xa507('0x39')](_0x2f43b0[_0xa507('0x35')],_0x2f43b0[_0xa507('0x37')]);_0x280e8d['attributes']=_['intersection'](_0x2f43b0[_0xa507('0x35')],qs[_0xa507('0x3b')](_0x2f762a[_0xa507('0x37')][_0xa507('0x3b')]));_0x280e8d['attributes']=_0x280e8d['attributes'][_0xa507('0x3c')]?_0x280e8d[_0xa507('0x3a')]:_0x2f43b0[_0xa507('0x35')];_0x280e8d['order']=qs[_0xa507('0x40')](_0x2f762a[_0xa507('0x37')][_0xa507('0x40')]);_0x280e8d['where']=qs[_0xa507('0x38')](_['pick'](_0x2f762a[_0xa507('0x37')],_0x2f43b0[_0xa507('0x38')]));if(_0x2f762a[_0xa507('0x37')][_0xa507('0x42')]){_0x280e8d[_0xa507('0x41')]=_[_0xa507('0x43')](_0x280e8d[_0xa507('0x41')],{'$or':_['map'](_0x280e8d[_0xa507('0x3a')],function(_0x1cc7c5){var _0xde23c7={};_0xde23c7[_0x1cc7c5]={'$like':'%'+_0x2f762a[_0xa507('0x37')][_0xa507('0x42')]+'%'};return _0xde23c7;})});}_0x280e8d=_[_0xa507('0x43')]({},_0x280e8d,_0x2f762a['options']);return _0x1dfa03[_0xa507('0x63')](_0x280e8d);}})['then'](function(_0x2696ba){if(_0x2696ba){_0x482ac1=_0x2696ba['length'];if(!_0x2f762a['query'][_0xa507('0x3d')](_0xa507('0x3e'))){_0x280e8d[_0xa507('0x20')]=qs[_0xa507('0x20')](_0x2f762a[_0xa507('0x37')][_0xa507('0x20')]);_0x280e8d[_0xa507('0x21')]=qs[_0xa507('0x21')](_0x2f762a[_0xa507('0x37')]['offset']);}return _0x1dfa03[_0xa507('0x63')](_0x280e8d);}})[_0xa507('0x28')](function(_0x2671bb){if(_0x2671bb){return _0x2671bb?{'count':_0x482ac1,'rows':_0x2671bb}:null;}})[_0xa507('0x28')](respondWithResult(_0x53fd2d,null))['catch'](handleError(_0x53fd2d,null));};exports[_0xa507('0x65')]=function(_0x8677be,_0x1f3a93,_0x34a40f){var _0x1e2e3f=_0x8677be[_0xa507('0x55')][_0xa507('0x66')];return db[_0xa507('0x64')][_0xa507('0x67')]({'where':{'id':_0x1e2e3f},'attributes':['id'],'include':[{'model':db[_0xa507('0x68')],'as':_0xa507('0x69'),'attributes':['id',_0xa507('0x2e'),'online','voicePause','interface'],'raw':!![]}]})[_0xa507('0x28')](function(_0x5cb430){if(_0x5cb430){var _0x107f38=_[_0xa507('0x6a')](_0x5cb430,function(_0x53d038){var _0x50bd4b=_0x53d038[_0xa507('0x2a')]({'plain':!![]});return _0x50bd4b[_0xa507('0x69')];});return db[_0xa507('0x48')][_0xa507('0x4d')]({'where':{'id':_0x8677be[_0xa507('0x4b')]['id']}})[_0xa507('0x28')](function(_0x1b6a6a){return db['sequelize'][_0xa507('0x6b')](function(_0x38116f){return _0x1b6a6a[_0xa507('0x65')](_0x1e2e3f,{'transaction':_0x38116f})[_0xa507('0x28')](function(){return BPromise[_0xa507('0x6c')](_0x107f38,function(_0x424350){return db['UserFaxQueue'][_0xa507('0x6d')]({'where':{'UserId':_0x424350['id'],'FaxQueueId':_0x8677be[_0xa507('0x4b')]['id']},'transaction':_0x38116f});});})[_0xa507('0x28')](function(){_0x107f38[_0xa507('0x6e')](function(_0x244a05){socket['emit'](_0xa507('0x6f'),{'UserId':_0x244a05['id'],'FaxQueueId':_0x1b6a6a['id']});});});});});}})[_0xa507('0x28')](respondWithStatusCode(_0x1f3a93,null))[_0xa507('0x4a')](handleError(_0x1f3a93,null));};exports['removeTeams']=function(_0xa6319,_0x111cad,_0xff0a03){return db[_0xa507('0x64')][_0xa507('0x67')]({'where':{'id':_0xa6319[_0xa507('0x37')][_0xa507('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa507('0x68')],'as':_0xa507('0x69'),'attributes':['id'],'raw':!![]}]})[_0xa507('0x28')](handleEntityNotFound(_0x111cad,null))[_0xa507('0x28')](function(_0x540ed2){var _0x39a343=_[_0xa507('0x36')](_0x540ed2,'id');var _0x5ef1ca=[];var _0x54ff06=[];var _0x58091b=squel[_0xa507('0x70')]();_0x58091b[_0xa507('0x71')](_0xa507('0x72'))[_0xa507('0x73')](_0xa507('0x74'),'tq')[_0xa507('0x75')](_0xa507('0x76'),'ut',_0xa507('0x77'))[_0xa507('0x41')](_0xa507('0x78'),_0xa6319['params']['id']);for(var _0x50bb93=0x0;_0x50bb93<_0x540ed2[_0xa507('0x3c')];_0x50bb93+=0x1){let _0x47f2e9=_0x540ed2[_0x50bb93];for(var _0x2a769f=0x0;_0x2a769f<_0x47f2e9[_0xa507('0x69')][_0xa507('0x3c')];_0x2a769f+=0x1){let _0x4e5afa=_0x47f2e9[_0xa507('0x69')][_0x2a769f];var _0x4804b5=_0x58091b['clone']();_0x4804b5[_0xa507('0x41')]('ut.UserId\x20=\x20?',_0x4e5afa['id']);_0x54ff06[_0xa507('0x79')](db[_0xa507('0x7a')][_0xa507('0x37')](_0x4804b5[_0xa507('0x7b')](),{'type':db[_0xa507('0x7a')]['QueryTypes'][_0xa507('0x7c')]})[_0xa507('0x28')](function(_0x20fad0){if(_0x20fad0[_0xa507('0x3c')]===0x1){return _0x4e5afa['id'];}else{var _0x4ccbdf=_['every'](_['map'](_0x20fad0,'TeamId'),function(_0xf6a4e7){return _[_0xa507('0x7d')](_0x39a343,_0xf6a4e7);});if(_0x4ccbdf){return _0x4e5afa['id'];}}}));}}return BPromise[_0xa507('0x7e')](_0x54ff06)['then'](function(_0x4ab3ae){_0x5ef1ca=_(_0x5ef1ca)[_0xa507('0x7f')](_0x4ab3ae)[_0xa507('0x80')]()[_0xa507('0x81')]();return db[_0xa507('0x48')][_0xa507('0x4d')]({'where':{'id':_0xa6319['params']['id']}})[_0xa507('0x28')](function(_0x33ce26){return db['sequelize'][_0xa507('0x6b')](function(_0xe1d8d8){return _0x33ce26[_0xa507('0x82')](_0xa6319['query']['ids'],{'transaction':_0xe1d8d8})['then'](function(){if(!_['isEmpty'](_0x5ef1ca)){return _0x33ce26[_0xa507('0x83')](_0x5ef1ca,{'transaction':_0xe1d8d8});}})[_0xa507('0x28')](function(){_0x5ef1ca[_0xa507('0x6e')](function(_0x4656bc){socket[_0xa507('0x84')](_0xa507('0x85'),{'UserId':_0x4656bc,'FaxQueueId':_0x33ce26['id']});});});});});});})[_0xa507('0x28')](respondWithStatusCode(_0x111cad,null))['catch'](handleError(_0x111cad,null));};exports[_0xa507('0x86')]=function(_0x275d9f,_0x9dc79c,_0x3804b7){return db[_0xa507('0x48')][_0xa507('0x4d')]({'where':{'id':_0x275d9f[_0xa507('0x4b')]['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x9dc79c,null))[_0xa507('0x28')](function(_0x10fb53){if(_0x10fb53){return _0x10fb53['addAgents'](_0x275d9f[_0xa507('0x55')][_0xa507('0x66')],_['omit'](_0x275d9f[_0xa507('0x55')],[_0xa507('0x66'),'id'])||{})[_0xa507('0x87')](function(_0x3503bc){for(var _0x20c4ea=0x0;_0x20c4ea<_0x275d9f['body'][_0xa507('0x66')]['length'];_0x20c4ea+=0x1){socket[_0xa507('0x84')](_0xa507('0x6f'),{'UserId':Number(_0x275d9f[_0xa507('0x55')]['ids'][_0x20c4ea]),'FaxQueueId':Number(_0x275d9f[_0xa507('0x4b')]['id'])});}return _0x3503bc;});}})[_0xa507('0x28')](respondWithResult(_0x9dc79c,null))[_0xa507('0x4a')](handleError(_0x9dc79c,null));};exports[_0xa507('0x83')]=function(_0x3cf759,_0x4bd11a,_0x1095a3){return db[_0xa507('0x48')][_0xa507('0x4d')]({'where':{'id':_0x3cf759[_0xa507('0x4b')]['id']}})[_0xa507('0x28')](handleEntityNotFound(_0x4bd11a,null))['then'](function(_0xfaef81){if(_0xfaef81){return _0xfaef81[_0xa507('0x83')](_0x3cf759[_0xa507('0x37')]['ids'])[_0xa507('0x28')](function(){if(_[_0xa507('0x88')](_0x3cf759[_0xa507('0x37')][_0xa507('0x66')])){for(var _0x10d14b=0x0;_0x10d14b<_0x3cf759[_0xa507('0x37')][_0xa507('0x66')][_0xa507('0x3c')];_0x10d14b+=0x1){socket['emit'](_0xa507('0x85'),{'UserId':Number(_0x3cf759[_0xa507('0x37')][_0xa507('0x66')][_0x10d14b]),'FaxQueueId':Number(_0x3cf759[_0xa507('0x4b')]['id'])});}}else{socket[_0xa507('0x84')]('userFaxQueue:remove',{'UserId':Number(_0x3cf759[_0xa507('0x37')][_0xa507('0x66')]),'FaxQueueId':Number(_0x3cf759[_0xa507('0x4b')]['id'])});}});}})[_0xa507('0x28')](respondWithStatusCode(_0x4bd11a,null))['catch'](handleError(_0x4bd11a,null));};exports[_0xa507('0x89')]=function(_0x23432f,_0x4c408d,_0x1d1350){var _0x4d5fac={};var _0x52bbe8={};var _0x4a6b0e;var _0x550e31;return db[_0xa507('0x48')][_0xa507('0x57')]({'where':{'id':_0x23432f['params']['id']}})['then'](handleEntityNotFound(_0x4c408d,null))['then'](function(_0x12751f){if(_0x12751f){_0x4a6b0e=_0x12751f;_0x52bbe8[_0xa507('0x35')]=_[_0xa507('0x4c')](db['User'][_0xa507('0x31')]);_0x52bbe8[_0xa507('0x37')]=_[_0xa507('0x4c')](_0x23432f['query']);_0x52bbe8[_0xa507('0x38')]=_[_0xa507('0x39')](_0x52bbe8[_0xa507('0x35')],_0x52bbe8[_0xa507('0x37')]);_0x4d5fac[_0xa507('0x3a')]=_[_0xa507('0x39')](_0x52bbe8[_0xa507('0x35')],qs[_0xa507('0x3b')](_0x23432f['query'][_0xa507('0x3b')]));_0x4d5fac['attributes']=_0x4d5fac[_0xa507('0x3a')][_0xa507('0x3c')]?_0x4d5fac[_0xa507('0x3a')]:_0x52bbe8[_0xa507('0x35')];_0x4d5fac[_0xa507('0x3f')]=qs[_0xa507('0x40')](_0x23432f[_0xa507('0x37')]['sort']);_0x4d5fac[_0xa507('0x41')]=qs[_0xa507('0x38')](_[_0xa507('0x58')](_0x23432f[_0xa507('0x37')],_0x52bbe8['filters']));if(_0x23432f[_0xa507('0x37')][_0xa507('0x42')]){_0x4d5fac[_0xa507('0x41')]=_[_0xa507('0x43')](_0x4d5fac[_0xa507('0x41')],{'$or':_[_0xa507('0x36')](_0x4d5fac[_0xa507('0x3a')],function(_0x151c42){var _0x575bfb={};_0x575bfb[_0x151c42]={'$like':'%'+_0x23432f[_0xa507('0x37')]['filter']+'%'};return _0x575bfb;})});}_0x4d5fac=_[_0xa507('0x43')]({},_0x4d5fac,_0x23432f[_0xa507('0x45')]);return _0x4a6b0e[_0xa507('0x89')](_0x4d5fac);}})[_0xa507('0x28')](function(_0x3796c9){if(_0x3796c9){_0x550e31=_0x3796c9['length'];if(!_0x23432f[_0xa507('0x37')][_0xa507('0x3d')]('nolimit')){_0x4d5fac[_0xa507('0x20')]=qs[_0xa507('0x20')](_0x23432f[_0xa507('0x37')][_0xa507('0x20')]);_0x4d5fac[_0xa507('0x21')]=qs[_0xa507('0x21')](_0x23432f[_0xa507('0x37')][_0xa507('0x21')]);}return _0x4a6b0e[_0xa507('0x89')](_0x4d5fac);}})[_0xa507('0x28')](function(_0x74ea87){if(_0x74ea87){return _0x74ea87?{'count':_0x550e31,'rows':_0x74ea87}:null;}})[_0xa507('0x28')](respondWithResult(_0x4c408d,null))[_0xa507('0x4a')](handleError(_0x4c408d,null));}; \ No newline at end of file +var _0x84aa=['findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','describe','findOne','UserFaxQueue','rawAttributes','hasOwnProperty','FaxQueueId','options','User','findAndCountAll','UserId','agent','faxPause','format','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','localhost','register','status','end','offset','undefined','limit','count','set','Content-Range','json','get','FaxQueues','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x4fa22b,_0x336d47){var _0x1165b9=function(_0x3944be){while(--_0x3944be){_0x4fa22b['push'](_0x4fa22b['shift']());}};_0x1165b9(++_0x336d47);}(_0x84aa,0x158));var _0xa84a=function(_0x573461,_0x281c50){_0x573461=_0x573461-0x0;var _0x43db19=_0x84aa[_0x573461];return _0x43db19;};'use strict';var emlformat=require(_0xa84a('0x0'));var rimraf=require(_0xa84a('0x1'));var zipdir=require(_0xa84a('0x2'));var jsonpatch=require(_0xa84a('0x3'));var rp=require(_0xa84a('0x4'));var moment=require('moment');var BPromise=require(_0xa84a('0x5'));var Mustache=require('mustache');var util=require(_0xa84a('0x6'));var path=require(_0xa84a('0x7'));var sox=require(_0xa84a('0x8'));var csv=require(_0xa84a('0x9'));var ejs=require(_0xa84a('0xa'));var fs=require('fs');var fs_extra=require(_0xa84a('0xb'));var _=require(_0xa84a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa84a('0xd'));var toCsv=require(_0xa84a('0x9'));var querystring=require(_0xa84a('0xe'));var Papa=require(_0xa84a('0xf'));var Redis=require(_0xa84a('0x10'));var authService=require(_0xa84a('0x11'));var qs=require(_0xa84a('0x12'));var as=require(_0xa84a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa84a('0x14'))('api');var utils=require(_0xa84a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa84a('0x16')],{'host':_0xa84a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa84a('0x16')]));require('./faxQueue.socket')[_0xa84a('0x18')](socket);function respondWithStatusCode(_0xd74580,_0x563e73){_0x563e73=_0x563e73||0xcc;return function(_0xdf545f){if(_0xdf545f){return _0xd74580['sendStatus'](_0x563e73);}return _0xd74580[_0xa84a('0x19')](_0x563e73)[_0xa84a('0x1a')]();};}function respondWithResult(_0x424fd9,_0x1298ab){_0x1298ab=_0x1298ab||0xc8;return function(_0x43d2b8){if(_0x43d2b8){return _0x424fd9[_0xa84a('0x19')](_0x1298ab)['json'](_0x43d2b8);}};}function respondWithFilteredResult(_0x3f9c8a,_0x9f28b6){return function(_0x3e48ce){if(_0x3e48ce){var _0xe74341=typeof _0x9f28b6[_0xa84a('0x1b')]===_0xa84a('0x1c')&&typeof _0x9f28b6[_0xa84a('0x1d')]==='undefined';var _0x1593ff=_0x3e48ce[_0xa84a('0x1e')];var _0x400c90=_0xe74341?0x0:_0x9f28b6[_0xa84a('0x1b')];var _0x213e46=_0xe74341?_0x3e48ce['count']:_0x9f28b6[_0xa84a('0x1b')]+_0x9f28b6[_0xa84a('0x1d')];var _0x1ab588;if(_0x213e46>=_0x1593ff){_0x213e46=_0x1593ff;_0x1ab588=0xc8;}else{_0x1ab588=0xce;}_0x3f9c8a[_0xa84a('0x19')](_0x1ab588);return _0x3f9c8a[_0xa84a('0x1f')](_0xa84a('0x20'),_0x400c90+'-'+_0x213e46+'/'+_0x1593ff)[_0xa84a('0x21')](_0x3e48ce);}return null;};}function patchUpdates(_0x1ebbbd){return function(_0xd42dd3){try{jsonpatch['apply'](_0xd42dd3,_0x1ebbbd,!![]);}catch(_0x2e1dad){return BPromise['reject'](_0x2e1dad);}return _0xd42dd3['save']();};}function saveUpdates(_0x2ff732,_0x272b9c){return function(_0x27cd41){if(_0x27cd41){return _0x27cd41['update'](_0x2ff732)['then'](function(_0x188f62){return _0x188f62;});}return null;};}function removeEntity(_0x57818e,_0x573ea2){return function(_0x40ac07){if(_0x40ac07){return _0x40ac07['destroy']()['then'](function(){var _0x1ae18f=_0x40ac07[_0xa84a('0x22')]({'plain':!![]});var _0x42333e=_0xa84a('0x23');return db[_0xa84a('0x24')]['destroy']({'where':{'type':_0x42333e,'resourceId':_0x1ae18f['id']}})[_0xa84a('0x25')](function(){return _0x40ac07;});})['then'](function(){_0x57818e[_0xa84a('0x19')](0xcc)[_0xa84a('0x1a')]();});}};}function handleEntityNotFound(_0x55bc90,_0x3d5a22){return function(_0x4260f5){if(!_0x4260f5){_0x55bc90[_0xa84a('0x26')](0x194);}return _0x4260f5;};}function handleError(_0x118227,_0xdef35d){_0xdef35d=_0xdef35d||0x1f4;return function(_0x59a3d6){logger[_0xa84a('0x27')](_0x59a3d6[_0xa84a('0x28')]);if(_0x59a3d6[_0xa84a('0x29')]){delete _0x59a3d6[_0xa84a('0x29')];}_0x118227['status'](_0xdef35d)[_0xa84a('0x2a')](_0x59a3d6);};}exports[_0xa84a('0x2b')]=function(_0x3625c8,_0x1f26be){var _0x84bb05={},_0x511986={},_0xd81c65={'count':0x0,'rows':[]};var _0x46e010=_[_0xa84a('0x2c')](db[_0xa84a('0x2d')]['rawAttributes'],function(_0x245ff4){return{'name':_0x245ff4[_0xa84a('0x2e')],'type':_0x245ff4[_0xa84a('0x2f')][_0xa84a('0x30')]};});_0x511986[_0xa84a('0x31')]=_['map'](_0x46e010,_0xa84a('0x29'));_0x511986[_0xa84a('0x32')]=_[_0xa84a('0x33')](_0x3625c8['query']);_0x511986[_0xa84a('0x34')]=_[_0xa84a('0x35')](_0x511986['model'],_0x511986[_0xa84a('0x32')]);_0x84bb05[_0xa84a('0x36')]=_['intersection'](_0x511986[_0xa84a('0x31')],qs[_0xa84a('0x37')](_0x3625c8[_0xa84a('0x32')]['fields']));_0x84bb05[_0xa84a('0x36')]=_0x84bb05[_0xa84a('0x36')][_0xa84a('0x38')]?_0x84bb05['attributes']:_0x511986[_0xa84a('0x31')];if(!_0x3625c8['query']['hasOwnProperty'](_0xa84a('0x39'))){_0x84bb05[_0xa84a('0x1d')]=qs[_0xa84a('0x1d')](_0x3625c8[_0xa84a('0x32')][_0xa84a('0x1d')]);_0x84bb05['offset']=qs[_0xa84a('0x1b')](_0x3625c8[_0xa84a('0x32')][_0xa84a('0x1b')]);}_0x84bb05[_0xa84a('0x3a')]=qs[_0xa84a('0x3b')](_0x3625c8[_0xa84a('0x32')]['sort']);_0x84bb05[_0xa84a('0x3c')]=qs['filters'](_[_0xa84a('0x3d')](_0x3625c8[_0xa84a('0x32')],_0x511986[_0xa84a('0x34')]),_0x46e010);if(_0x3625c8[_0xa84a('0x32')][_0xa84a('0x3e')]){_0x84bb05[_0xa84a('0x3c')]=_[_0xa84a('0x3f')](_0x84bb05[_0xa84a('0x3c')],{'$or':_[_0xa84a('0x2c')](_0x46e010,function(_0x33c341){if(_0x33c341[_0xa84a('0x2f')]!==_0xa84a('0x40')){var _0x223be4={};_0x223be4[_0x33c341[_0xa84a('0x29')]]={'$like':'%'+_0x3625c8[_0xa84a('0x32')][_0xa84a('0x3e')]+'%'};return _0x223be4;}})});}_0x84bb05=_[_0xa84a('0x3f')]({},_0x84bb05,_0x3625c8['options']);var _0xb89921={'where':_0x84bb05[_0xa84a('0x3c')]};return db[_0xa84a('0x2d')][_0xa84a('0x1e')](_0xb89921)['then'](function(_0x2dcbf5){_0xd81c65[_0xa84a('0x1e')]=_0x2dcbf5;if(_0x3625c8[_0xa84a('0x32')][_0xa84a('0x41')]){_0x84bb05[_0xa84a('0x42')]=[{'all':!![]}];}return db['FaxQueue'][_0xa84a('0x43')](_0x84bb05);})[_0xa84a('0x25')](function(_0x2027a3){_0xd81c65[_0xa84a('0x44')]=_0x2027a3;return _0xd81c65;})['then'](respondWithFilteredResult(_0x1f26be,_0x84bb05))[_0xa84a('0x45')](handleError(_0x1f26be,null));};exports[_0xa84a('0x46')]=function(_0x10ce19,_0x304b97){var _0x160fa6={'raw':!![],'where':{'id':_0x10ce19[_0xa84a('0x47')]['id']}},_0x50e3e7={};_0x50e3e7[_0xa84a('0x31')]=_['keys'](db[_0xa84a('0x2d')]['rawAttributes']);_0x50e3e7[_0xa84a('0x32')]=_[_0xa84a('0x33')](_0x10ce19[_0xa84a('0x32')]);_0x50e3e7['filters']=_[_0xa84a('0x35')](_0x50e3e7[_0xa84a('0x31')],_0x50e3e7[_0xa84a('0x32')]);_0x160fa6[_0xa84a('0x36')]=_[_0xa84a('0x35')](_0x50e3e7['model'],qs['fields'](_0x10ce19['query']['fields']));_0x160fa6['attributes']=_0x160fa6[_0xa84a('0x36')][_0xa84a('0x38')]?_0x160fa6[_0xa84a('0x36')]:_0x50e3e7[_0xa84a('0x31')];if(_0x10ce19[_0xa84a('0x32')][_0xa84a('0x41')]){_0x160fa6['include']=[{'all':!![]}];}_0x160fa6=_['merge']({},_0x160fa6,_0x10ce19['options']);return db['FaxQueue'][_0xa84a('0x48')](_0x160fa6)[_0xa84a('0x25')](handleEntityNotFound(_0x304b97,null))[_0xa84a('0x25')](respondWithResult(_0x304b97,null))[_0xa84a('0x45')](handleError(_0x304b97,null));};exports['create']=function(_0x2064a8,_0x165717){return db['FaxQueue'][_0xa84a('0x49')](_0x2064a8[_0xa84a('0x4a')],{})[_0xa84a('0x25')](function(_0x253407){var _0x55b18b=_0x2064a8[_0xa84a('0x4b')][_0xa84a('0x22')]({'plain':!![]});if(!_0x55b18b)throw new Error(_0xa84a('0x4c'));if(_0x55b18b['role']===_0xa84a('0x4b')){var _0xd49901=_0x253407[_0xa84a('0x22')]({'plain':!![]});var _0x570471=_0xa84a('0x23');return db[_0xa84a('0x4d')][_0xa84a('0x48')]({'where':{'name':_0x570471,'userProfileId':_0x55b18b['userProfileId']},'raw':!![]})[_0xa84a('0x25')](function(_0x1c911a){if(_0x1c911a&&_0x1c911a[_0xa84a('0x4e')]===0x0){return db[_0xa84a('0x24')]['create']({'name':_0xd49901[_0xa84a('0x29')],'resourceId':_0xd49901['id'],'type':_0x1c911a[_0xa84a('0x29')],'sectionId':_0x1c911a['id']},{})[_0xa84a('0x25')](function(){return _0x253407;});}else{return _0x253407;}})['catch'](function(_0x1223b4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1223b4);throw _0x1223b4;});}return _0x253407;})['then'](respondWithResult(_0x165717,0xc9))[_0xa84a('0x45')](handleError(_0x165717,null));};exports[_0xa84a('0x4f')]=function(_0x3c31a8,_0x55b0bd){if(_0x3c31a8[_0xa84a('0x4a')]['id']){delete _0x3c31a8[_0xa84a('0x4a')]['id'];}return db['FaxQueue'][_0xa84a('0x48')]({'where':{'id':_0x3c31a8['params']['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x55b0bd,null))[_0xa84a('0x25')](saveUpdates(_0x3c31a8[_0xa84a('0x4a')],null))['then'](respondWithResult(_0x55b0bd,null))[_0xa84a('0x45')](handleError(_0x55b0bd,null));};exports['destroy']=function(_0x2d77cd,_0x52ca4e){return db[_0xa84a('0x2d')][_0xa84a('0x48')]({'where':{'id':_0x2d77cd[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x52ca4e,null))[_0xa84a('0x25')](removeEntity(_0x52ca4e,null))['catch'](handleError(_0x52ca4e,null));};exports[_0xa84a('0x50')]=function(_0x535999,_0x51e160){return db[_0xa84a('0x2d')][_0xa84a('0x50')]()[_0xa84a('0x25')](respondWithResult(_0x51e160,null))[_0xa84a('0x45')](handleError(_0x51e160,null));};exports['getMembers']=function(_0x5de8f1,_0x4d1c4c,_0x30726f){var _0x51b365={'raw':!![],'where':{}},_0x2b8d60={},_0x179d2d;return db['FaxQueue'][_0xa84a('0x51')]({'where':{'id':_0x5de8f1[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x4d1c4c,null))[_0xa84a('0x25')](function(_0x59497b){if(_0x59497b){_0x179d2d=_0x59497b['get']({'plain':!![]});_0x2b8d60['model']=_['keys'](db[_0xa84a('0x52')][_0xa84a('0x53')]);_0x2b8d60[_0xa84a('0x32')]=_[_0xa84a('0x33')](_0x5de8f1[_0xa84a('0x32')]);_0x2b8d60['filters']=_['intersection'](_0x2b8d60['model'],_0x2b8d60[_0xa84a('0x32')]);_0x51b365[_0xa84a('0x36')]=_[_0xa84a('0x35')](_0x2b8d60[_0xa84a('0x31')],qs[_0xa84a('0x37')](_0x5de8f1[_0xa84a('0x32')]['fields']));_0x51b365[_0xa84a('0x36')]=_0x51b365[_0xa84a('0x36')][_0xa84a('0x38')]?_0x51b365[_0xa84a('0x36')]:_0x2b8d60[_0xa84a('0x31')];if(!_0x5de8f1[_0xa84a('0x32')][_0xa84a('0x54')](_0xa84a('0x39'))){_0x51b365[_0xa84a('0x1d')]=qs['limit'](_0x5de8f1[_0xa84a('0x32')][_0xa84a('0x1d')]);_0x51b365[_0xa84a('0x1b')]=qs[_0xa84a('0x1b')](_0x5de8f1[_0xa84a('0x32')][_0xa84a('0x1b')]);}_0x51b365[_0xa84a('0x3a')]=qs[_0xa84a('0x3b')](_0x5de8f1[_0xa84a('0x32')][_0xa84a('0x3b')]);_0x51b365[_0xa84a('0x3c')]=qs[_0xa84a('0x34')](_[_0xa84a('0x3d')](_0x5de8f1['query'],_0x2b8d60[_0xa84a('0x34')]));_0x51b365[_0xa84a('0x3c')][_0xa84a('0x55')]=_0x59497b['id'];if(_0x5de8f1['query'][_0xa84a('0x3e')]){_0x51b365[_0xa84a('0x3c')]=_[_0xa84a('0x3f')](_0x51b365[_0xa84a('0x3c')],{'$or':_[_0xa84a('0x2c')](_0x51b365[_0xa84a('0x36')],function(_0x4d3e0f){var _0x284a58={};_0x284a58[_0x4d3e0f]={'$like':'%'+_0x5de8f1['query'][_0xa84a('0x3e')]+'%'};return _0x284a58;})});}_0x51b365=_[_0xa84a('0x3f')]({},_0x51b365,_0x5de8f1[_0xa84a('0x56')]);return db[_0xa84a('0x52')][_0xa84a('0x43')](_0x51b365);}})[_0xa84a('0x25')](function(_0x15ee09){if(_0x15ee09){return db[_0xa84a('0x57')][_0xa84a('0x58')]({'where':{'id':_[_0xa84a('0x2c')](_0x15ee09,_0xa84a('0x59')),'role':_0xa84a('0x5a')},'attributes':['id',_0xa84a('0x29'),_0xa84a('0x5b'),'updatedAt','createdAt']});}})[_0xa84a('0x25')](function(_0x2c2670){if(_0x2c2670){return{'count':_0x2c2670[_0xa84a('0x1e')],'rows':_[_0xa84a('0x2c')](_0x2c2670[_0xa84a('0x44')],function(_0x2200e1){return{'membername':_0x2200e1[_0xa84a('0x29')],'UserId':_0x2200e1['id'],'queue_name':_0x179d2d['name'],'FaxQueueId':_0x179d2d['id'],'interface':util[_0xa84a('0x5c')]('%s/%s',_0xa84a('0x5d'),_0x2200e1[_0xa84a('0x29')]),'penalty':0x0,'paused':_0x2200e1['faxPause'],'createdAt':_0x2200e1[_0xa84a('0x5e')],'updatedAt':_0x2200e1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4d1c4c,_0x51b365))[_0xa84a('0x45')](handleError(_0x4d1c4c,null));};exports[_0xa84a('0x5f')]=function(_0x289bc6,_0x1a52ec,_0x278bac){var _0x21ba5a={};var _0x57ba01={};var _0x338d80;var _0x561ce4;return db['FaxQueue']['findOne']({'where':{'id':_0x289bc6[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x1a52ec,null))[_0xa84a('0x25')](function(_0x227940){if(_0x227940){_0x338d80=_0x227940;_0x57ba01['model']=_[_0xa84a('0x33')](db[_0xa84a('0x60')][_0xa84a('0x53')]);_0x57ba01['query']=_[_0xa84a('0x33')](_0x289bc6[_0xa84a('0x32')]);_0x57ba01[_0xa84a('0x34')]=_[_0xa84a('0x35')](_0x57ba01[_0xa84a('0x31')],_0x57ba01[_0xa84a('0x32')]);_0x21ba5a[_0xa84a('0x36')]=_['intersection'](_0x57ba01[_0xa84a('0x31')],qs['fields'](_0x289bc6[_0xa84a('0x32')][_0xa84a('0x37')]));_0x21ba5a[_0xa84a('0x36')]=_0x21ba5a[_0xa84a('0x36')]['length']?_0x21ba5a[_0xa84a('0x36')]:_0x57ba01[_0xa84a('0x31')];_0x21ba5a[_0xa84a('0x3a')]=qs['sort'](_0x289bc6[_0xa84a('0x32')][_0xa84a('0x3b')]);_0x21ba5a['where']=qs[_0xa84a('0x34')](_[_0xa84a('0x3d')](_0x289bc6[_0xa84a('0x32')],_0x57ba01[_0xa84a('0x34')]));if(_0x289bc6[_0xa84a('0x32')][_0xa84a('0x3e')]){_0x21ba5a['where']=_[_0xa84a('0x3f')](_0x21ba5a[_0xa84a('0x3c')],{'$or':_[_0xa84a('0x2c')](_0x21ba5a[_0xa84a('0x36')],function(_0x5261b7){var _0x16321a={};_0x16321a[_0x5261b7]={'$like':'%'+_0x289bc6[_0xa84a('0x32')][_0xa84a('0x3e')]+'%'};return _0x16321a;})});}_0x21ba5a=_[_0xa84a('0x3f')]({},_0x21ba5a,_0x289bc6[_0xa84a('0x56')]);return _0x338d80[_0xa84a('0x5f')](_0x21ba5a);}})['then'](function(_0x5a0809){if(_0x5a0809){_0x561ce4=_0x5a0809[_0xa84a('0x38')];if(!_0x289bc6[_0xa84a('0x32')]['hasOwnProperty'](_0xa84a('0x39'))){_0x21ba5a[_0xa84a('0x1d')]=qs[_0xa84a('0x1d')](_0x289bc6[_0xa84a('0x32')][_0xa84a('0x1d')]);_0x21ba5a[_0xa84a('0x1b')]=qs['offset'](_0x289bc6['query'][_0xa84a('0x1b')]);}return _0x338d80['getTeams'](_0x21ba5a);}})[_0xa84a('0x25')](function(_0x23d2c9){if(_0x23d2c9){return _0x23d2c9?{'count':_0x561ce4,'rows':_0x23d2c9}:null;}})[_0xa84a('0x25')](respondWithResult(_0x1a52ec,null))['catch'](handleError(_0x1a52ec,null));};exports[_0xa84a('0x61')]=function(_0x56f87f,_0x436e5a,_0xcd0e77){var _0x7a59e=_0x56f87f[_0xa84a('0x4a')][_0xa84a('0x62')];return db['Team'][_0xa84a('0x43')]({'where':{'id':_0x7a59e},'attributes':['id'],'include':[{'model':db[_0xa84a('0x57')],'as':_0xa84a('0x63'),'attributes':['id',_0xa84a('0x29'),_0xa84a('0x64'),_0xa84a('0x65'),_0xa84a('0x66')],'raw':!![]}]})[_0xa84a('0x25')](function(_0x5d0ac6){if(_0x5d0ac6){var _0x45951a=_[_0xa84a('0x67')](_0x5d0ac6,function(_0x657c8){var _0x1b2ee4=_0x657c8[_0xa84a('0x22')]({'plain':!![]});return _0x1b2ee4['Agents'];});return db['FaxQueue'][_0xa84a('0x48')]({'where':{'id':_0x56f87f[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](function(_0x47f184){return db['sequelize'][_0xa84a('0x68')](function(_0x5661cc){return _0x47f184[_0xa84a('0x61')](_0x7a59e,{'transaction':_0x5661cc})[_0xa84a('0x25')](function(){return BPromise[_0xa84a('0x69')](_0x45951a,function(_0x63277c){return db['UserFaxQueue'][_0xa84a('0x6a')]({'where':{'UserId':_0x63277c['id'],'FaxQueueId':_0x56f87f[_0xa84a('0x47')]['id']},'transaction':_0x5661cc});});})[_0xa84a('0x25')](function(){_0x45951a['forEach'](function(_0x4af153){socket[_0xa84a('0x6b')](_0xa84a('0x6c'),{'UserId':_0x4af153['id'],'FaxQueueId':_0x47f184['id']});});});});});}})['then'](respondWithStatusCode(_0x436e5a,null))[_0xa84a('0x45')](handleError(_0x436e5a,null));};exports[_0xa84a('0x6d')]=function(_0x1da070,_0x2ac330,_0x5d1e02){return db[_0xa84a('0x60')][_0xa84a('0x43')]({'where':{'id':_0x1da070[_0xa84a('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa84a('0x57')],'as':_0xa84a('0x63'),'attributes':['id'],'raw':!![]}]})[_0xa84a('0x25')](handleEntityNotFound(_0x2ac330,null))['then'](function(_0x33a409){var _0x501a94=_['map'](_0x33a409,'id');var _0xe79606=[];var _0x20391d=[];var _0x3f753f=squel[_0xa84a('0x6e')]();_0x3f753f[_0xa84a('0x6f')](_0xa84a('0x70'))[_0xa84a('0x71')](_0xa84a('0x72'),'tq')[_0xa84a('0x73')](_0xa84a('0x74'),'ut',_0xa84a('0x75'))[_0xa84a('0x3c')](_0xa84a('0x76'),_0x1da070[_0xa84a('0x47')]['id']);for(var _0x3e84d0=0x0;_0x3e84d0<_0x33a409[_0xa84a('0x38')];_0x3e84d0+=0x1){let _0x17372e=_0x33a409[_0x3e84d0];for(var _0x3a5c5a=0x0;_0x3a5c5a<_0x17372e[_0xa84a('0x63')][_0xa84a('0x38')];_0x3a5c5a+=0x1){let _0x3760a4=_0x17372e[_0xa84a('0x63')][_0x3a5c5a];var _0x5a6e63=_0x3f753f['clone']();_0x5a6e63[_0xa84a('0x3c')](_0xa84a('0x77'),_0x3760a4['id']);_0x20391d['push'](db[_0xa84a('0x78')][_0xa84a('0x32')](_0x5a6e63['toString'](),{'type':db[_0xa84a('0x78')][_0xa84a('0x79')]['SELECT']})['then'](function(_0x3d34b8){if(_0x3d34b8['length']===0x1){return _0x3760a4['id'];}else{var _0x2e0213=_[_0xa84a('0x7a')](_[_0xa84a('0x2c')](_0x3d34b8,_0xa84a('0x7b')),function(_0x3bef5f){return _[_0xa84a('0x7c')](_0x501a94,_0x3bef5f);});if(_0x2e0213){return _0x3760a4['id'];}}}));}}return BPromise[_0xa84a('0x7d')](_0x20391d)[_0xa84a('0x25')](function(_0xf138dc){_0xe79606=_(_0xe79606)[_0xa84a('0x7e')](_0xf138dc)[_0xa84a('0x7f')]()[_0xa84a('0x80')]();return db[_0xa84a('0x2d')][_0xa84a('0x48')]({'where':{'id':_0x1da070[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](function(_0x2b72b6){return db[_0xa84a('0x78')][_0xa84a('0x68')](function(_0x225089){return _0x2b72b6[_0xa84a('0x6d')](_0x1da070[_0xa84a('0x32')][_0xa84a('0x62')],{'transaction':_0x225089})[_0xa84a('0x25')](function(){if(!_[_0xa84a('0x81')](_0xe79606)){return _0x2b72b6[_0xa84a('0x82')](_0xe79606,{'transaction':_0x225089});}})['then'](function(){_0xe79606[_0xa84a('0x83')](function(_0x59820c){socket[_0xa84a('0x6b')]('userFaxQueue:remove',{'UserId':_0x59820c,'FaxQueueId':_0x2b72b6['id']});});});});});});})['then'](respondWithStatusCode(_0x2ac330,null))[_0xa84a('0x45')](handleError(_0x2ac330,null));};exports[_0xa84a('0x84')]=function(_0x47a2e5,_0x1c13d0,_0x519652){return db['FaxQueue'][_0xa84a('0x48')]({'where':{'id':_0x47a2e5[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x1c13d0,null))['then'](function(_0x20e3ea){if(_0x20e3ea){return _0x20e3ea[_0xa84a('0x84')](_0x47a2e5['body'][_0xa84a('0x62')],_['omit'](_0x47a2e5['body'],[_0xa84a('0x62'),'id'])||{})[_0xa84a('0x85')](function(_0x2bc6f1){for(var _0x17add8=0x0;_0x17add8<_0x47a2e5[_0xa84a('0x4a')][_0xa84a('0x62')][_0xa84a('0x38')];_0x17add8+=0x1){socket[_0xa84a('0x6b')](_0xa84a('0x6c'),{'UserId':Number(_0x47a2e5[_0xa84a('0x4a')][_0xa84a('0x62')][_0x17add8]),'FaxQueueId':Number(_0x47a2e5['params']['id'])});}return _0x2bc6f1;});}})[_0xa84a('0x25')](respondWithResult(_0x1c13d0,null))[_0xa84a('0x45')](handleError(_0x1c13d0,null));};exports['removeAgents']=function(_0x514e30,_0x3d618d,_0x36e38b){return db[_0xa84a('0x2d')]['find']({'where':{'id':_0x514e30[_0xa84a('0x47')]['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x3d618d,null))[_0xa84a('0x25')](function(_0x2f3031){if(_0x2f3031){return _0x2f3031[_0xa84a('0x82')](_0x514e30[_0xa84a('0x32')][_0xa84a('0x62')])['then'](function(){if(_[_0xa84a('0x86')](_0x514e30['query']['ids'])){for(var _0x38f068=0x0;_0x38f068<_0x514e30[_0xa84a('0x32')][_0xa84a('0x62')][_0xa84a('0x38')];_0x38f068+=0x1){socket[_0xa84a('0x6b')](_0xa84a('0x87'),{'UserId':Number(_0x514e30['query'][_0xa84a('0x62')][_0x38f068]),'FaxQueueId':Number(_0x514e30['params']['id'])});}}else{socket[_0xa84a('0x6b')](_0xa84a('0x87'),{'UserId':Number(_0x514e30[_0xa84a('0x32')][_0xa84a('0x62')]),'FaxQueueId':Number(_0x514e30['params']['id'])});}});}})[_0xa84a('0x25')](respondWithStatusCode(_0x3d618d,null))['catch'](handleError(_0x3d618d,null));};exports[_0xa84a('0x88')]=function(_0x5c1682,_0x7723f7,_0x16fe20){var _0x417385={};var _0x581c00={};var _0x126138;var _0x427a27;return db[_0xa84a('0x2d')][_0xa84a('0x51')]({'where':{'id':_0x5c1682['params']['id']}})[_0xa84a('0x25')](handleEntityNotFound(_0x7723f7,null))[_0xa84a('0x25')](function(_0x56f214){if(_0x56f214){_0x126138=_0x56f214;_0x581c00[_0xa84a('0x31')]=_[_0xa84a('0x33')](db['User'][_0xa84a('0x53')]);_0x581c00[_0xa84a('0x32')]=_['keys'](_0x5c1682[_0xa84a('0x32')]);_0x581c00[_0xa84a('0x34')]=_[_0xa84a('0x35')](_0x581c00[_0xa84a('0x31')],_0x581c00[_0xa84a('0x32')]);_0x417385['attributes']=_['intersection'](_0x581c00[_0xa84a('0x31')],qs['fields'](_0x5c1682[_0xa84a('0x32')][_0xa84a('0x37')]));_0x417385[_0xa84a('0x36')]=_0x417385[_0xa84a('0x36')]['length']?_0x417385['attributes']:_0x581c00[_0xa84a('0x31')];_0x417385[_0xa84a('0x3a')]=qs[_0xa84a('0x3b')](_0x5c1682['query'][_0xa84a('0x3b')]);_0x417385[_0xa84a('0x3c')]=qs[_0xa84a('0x34')](_[_0xa84a('0x3d')](_0x5c1682[_0xa84a('0x32')],_0x581c00[_0xa84a('0x34')]));if(_0x5c1682['query'][_0xa84a('0x3e')]){_0x417385[_0xa84a('0x3c')]=_['merge'](_0x417385[_0xa84a('0x3c')],{'$or':_['map'](_0x417385[_0xa84a('0x36')],function(_0x1e83c4){var _0x6f6a5d={};_0x6f6a5d[_0x1e83c4]={'$like':'%'+_0x5c1682[_0xa84a('0x32')]['filter']+'%'};return _0x6f6a5d;})});}_0x417385=_[_0xa84a('0x3f')]({},_0x417385,_0x5c1682[_0xa84a('0x56')]);return _0x126138['getAgents'](_0x417385);}})['then'](function(_0x47d558){if(_0x47d558){_0x427a27=_0x47d558[_0xa84a('0x38')];if(!_0x5c1682[_0xa84a('0x32')][_0xa84a('0x54')](_0xa84a('0x39'))){_0x417385[_0xa84a('0x1d')]=qs[_0xa84a('0x1d')](_0x5c1682[_0xa84a('0x32')]['limit']);_0x417385[_0xa84a('0x1b')]=qs[_0xa84a('0x1b')](_0x5c1682['query'][_0xa84a('0x1b')]);}return _0x126138[_0xa84a('0x88')](_0x417385);}})[_0xa84a('0x25')](function(_0x24d881){if(_0x24d881){return _0x24d881?{'count':_0x427a27,'rows':_0x24d881}:null;}})[_0xa84a('0x25')](respondWithResult(_0x7723f7,null))[_0xa84a('0x45')](handleError(_0x7723f7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 28aef55..866bcfc 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 _0xd943=['exports','../../mysqldb','FaxQueue','setMaxListeners','save','remove','emit','hook'];(function(_0x478604,_0x40fbc9){var _0x11627e=function(_0x28b940){while(--_0x28b940){_0x478604['push'](_0x478604['shift']());}};_0x11627e(++_0x40fbc9);}(_0xd943,0x71));var _0x3d94=function(_0x56069a,_0x2b4f5f){_0x56069a=_0x56069a-0x0;var _0x530c39=_0xd943[_0x56069a];return _0x530c39;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3d94('0x0'))['db'][_0x3d94('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3d94('0x2')](0x0);var events={'afterCreate':_0x3d94('0x3'),'afterUpdate':'update','afterDestroy':_0x3d94('0x4')};function emitEvent(_0x3695c8){return function(_0x475cea,_0x3ca862,_0x2b3287){FaxQueueEvents[_0x3d94('0x5')](_0x3695c8+':'+_0x475cea['id'],_0x475cea);FaxQueueEvents[_0x3d94('0x5')](_0x3695c8,_0x475cea);_0x2b3287(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x3d94('0x6')](e,emitEvent(event));}}module[_0x3d94('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x5b38=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x3ec31f,_0x35d8dc){var _0x3e5d42=function(_0x50a1a0){while(--_0x50a1a0){_0x3ec31f['push'](_0x3ec31f['shift']());}};_0x3e5d42(++_0x35d8dc);}(_0x5b38,0x16a));var _0x85b3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5b38[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x85b3('0x0'));var FaxQueue=require(_0x85b3('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x85b3('0x2'),'afterUpdate':_0x85b3('0x3'),'afterDestroy':_0x85b3('0x4')};function emitEvent(_0x4f8ffc){return function(_0x18c1ae,_0x20f196,_0x203523){FaxQueueEvents[_0x85b3('0x5')](_0x4f8ffc+':'+_0x18c1ae['id'],_0x18c1ae);FaxQueueEvents['emit'](_0x4f8ffc,_0x18c1ae);_0x203523(null);};}for(var e in events){if(events[_0x85b3('0x6')](e)){var event=events[e];FaxQueue[_0x85b3('0x7')](e,emitEvent(event));}}module[_0x85b3('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 581a67c..7ee7b97 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 _0xff0a=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues','util','../../config/logger','api','moment'];(function(_0x11fd35,_0x259295){var _0x3792de=function(_0x5c099c){while(--_0x5c099c){_0x11fd35['push'](_0x11fd35['shift']());}};_0x3792de(++_0x259295);}(_0xff0a,0x98));var _0xaff0=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xff0a[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0xaff0('0x0'));var logger=require(_0xaff0('0x1'))(_0xaff0('0x2'));var moment=require(_0xaff0('0x3'));var BPromise=require(_0xaff0('0x4'));var rp=require(_0xaff0('0x5'));var fs=require('fs');var path=require(_0xaff0('0x6'));var rimraf=require(_0xaff0('0x7'));var config=require(_0xaff0('0x8'));var attributes=require(_0xaff0('0x9'));module[_0xaff0('0xa')]=function(_0x3df813,_0x2e934d){return _0x3df813['define'](_0xaff0('0xb'),attributes,{'tableName':_0xaff0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a0a=['exports','define','FaxQueue','fax_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','./faxQueue.attributes'];(function(_0x7fc954,_0x1aa3fd){var _0x4a7e9c=function(_0x4d72ac){while(--_0x4d72ac){_0x7fc954['push'](_0x7fc954['shift']());}};_0x4a7e9c(++_0x1aa3fd);}(_0x8a0a,0x88));var _0xa8a0=function(_0x55f53a,_0x3cc0b2){_0x55f53a=_0x55f53a-0x0;var _0x2cd5db=_0x8a0a[_0x55f53a];return _0x2cd5db;};'use strict';var _=require(_0xa8a0('0x0'));var util=require('util');var logger=require(_0xa8a0('0x1'))('api');var moment=require(_0xa8a0('0x2'));var BPromise=require(_0xa8a0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8a0('0x4'));var rimraf=require(_0xa8a0('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8a0('0x6'));module[_0xa8a0('0x7')]=function(_0x356bb5,_0x43f7e1){return _0x356bb5[_0xa8a0('0x8')](_0xa8a0('0x9'),attributes,{'tableName':_0xa8a0('0xa'),'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 c7db15a..c085b0d 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 _0xb3e6=['options','attributes','limit','include','map','model','GetFaxQueue','stringify','ShowFaxQueue','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','FaxQueue','findAll'];(function(_0x27eb02,_0x2887ad){var _0x4a2a8d=function(_0x5731e3){while(--_0x5731e3){_0x27eb02['push'](_0x27eb02['shift']());}};_0x4a2a8d(++_0x2887ad);}(_0xb3e6,0x89));var _0x6b3e=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xb3e6[_0x2b0bc2];return _0x56e5b9;};'use strict';var _=require(_0x6b3e('0x0'));var util=require(_0x6b3e('0x1'));var moment=require(_0x6b3e('0x2'));var BPromise=require(_0x6b3e('0x3'));var rs=require(_0x6b3e('0x4'));var fs=require('fs');var Redis=require(_0x6b3e('0x5'));var db=require(_0x6b3e('0x6'))['db'];var utils=require(_0x6b3e('0x7'));var logger=require(_0x6b3e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b3e('0x9'));var client=jayson[_0x6b3e('0xa')][_0x6b3e('0xb')]({'port':0x232a});config[_0x6b3e('0xc')]=_[_0x6b3e('0xd')](config[_0x6b3e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b3e('0xe'))(new Redis(config['redis']));require(_0x6b3e('0xf'))[_0x6b3e('0x10')](socket);function respondWithRpcPromise(_0x3191a3,_0x3e5357,_0x4ccfb9){return new BPromise(function(_0x27b46e,_0x1dd9ae){return client[_0x6b3e('0x11')](_0x3191a3,_0x4ccfb9)[_0x6b3e('0x12')](function(_0x181a7b){logger['info'](_0x6b3e('0x13'),_0x3e5357,_0x6b3e('0x14'));logger[_0x6b3e('0x15')](_0x6b3e('0x16'),_0x3e5357,_0x6b3e('0x14'),JSON['stringify'](_0x181a7b));if(_0x181a7b[_0x6b3e('0x17')]){if(_0x181a7b[_0x6b3e('0x17')][_0x6b3e('0x18')]===0x1f4){logger[_0x6b3e('0x17')](_0x6b3e('0x13'),_0x3e5357,_0x181a7b[_0x6b3e('0x17')]['message']);return _0x1dd9ae(_0x181a7b[_0x6b3e('0x17')][_0x6b3e('0x19')]);}logger[_0x6b3e('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3e5357,_0x181a7b['error']['message']);return _0x27b46e(_0x181a7b[_0x6b3e('0x17')]['message']);}else{logger[_0x6b3e('0x1a')](_0x6b3e('0x13'),_0x3e5357,_0x6b3e('0x14'));_0x27b46e(_0x181a7b[_0x6b3e('0x1b')]['message']);}})[_0x6b3e('0x1c')](function(_0x26bf1a){logger[_0x6b3e('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3e5357,_0x26bf1a);_0x1dd9ae(_0x26bf1a);});});}exports['GetFaxQueue']=function(_0x3694f0){var _0x3da20a=this;return new Promise(function(_0x331791,_0x1a8ebc){return db[_0x6b3e('0x1d')][_0x6b3e('0x1e')]({'raw':_0x3694f0[_0x6b3e('0x1f')]?_0x3694f0[_0x6b3e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3694f0[_0x6b3e('0x1f')]?_0x3694f0[_0x6b3e('0x1f')]['where']||null:null,'attributes':_0x3694f0['options']?_0x3694f0[_0x6b3e('0x1f')][_0x6b3e('0x20')]||null:null,'limit':_0x3694f0['options']?_0x3694f0[_0x6b3e('0x1f')][_0x6b3e('0x21')]||null:null,'include':_0x3694f0['options']?_0x3694f0['options'][_0x6b3e('0x22')]?_[_0x6b3e('0x23')](_0x3694f0['options']['include'],function(_0x44a24d){return{'model':db[_0x44a24d[_0x6b3e('0x24')]],'as':_0x44a24d['as'],'attributes':_0x44a24d[_0x6b3e('0x20')],'include':_0x44a24d[_0x6b3e('0x22')]?_[_0x6b3e('0x23')](_0x44a24d[_0x6b3e('0x22')],function(_0x1f72a5){return{'model':db[_0x1f72a5[_0x6b3e('0x24')]],'as':_0x1f72a5['as'],'attributes':_0x1f72a5['attributes'],'include':_0x1f72a5[_0x6b3e('0x22')]?_[_0x6b3e('0x23')](_0x1f72a5[_0x6b3e('0x22')],function(_0x213e59){return{'model':db[_0x213e59['model']],'as':_0x213e59['as'],'attributes':_0x213e59[_0x6b3e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6b3e('0x12')](function(_0x41232c){logger[_0x6b3e('0x1a')]('GetFaxQueue',_0x3694f0);logger[_0x6b3e('0x15')](_0x6b3e('0x25'),_0x3694f0,JSON[_0x6b3e('0x26')](_0x41232c));_0x331791(_0x41232c);})[_0x6b3e('0x1c')](function(_0x529d6f){logger[_0x6b3e('0x17')]('GetFaxQueue',_0x529d6f[_0x6b3e('0x19')],_0x3694f0);_0x1a8ebc(_0x3da20a[_0x6b3e('0x17')](0x1f4,_0x529d6f[_0x6b3e('0x19')]));});});};exports[_0x6b3e('0x27')]=function(_0x31fd3f){var _0x530b7c=this;return new Promise(function(_0x3263ef,_0x4836c9){return db[_0x6b3e('0x1d')]['find']({'raw':_0x31fd3f[_0x6b3e('0x1f')]?_0x31fd3f['options'][_0x6b3e('0x28')]===undefined?!![]:![]:!![],'where':_0x31fd3f[_0x6b3e('0x1f')]?_0x31fd3f['options'][_0x6b3e('0x29')]||null:null,'attributes':_0x31fd3f[_0x6b3e('0x1f')]?_0x31fd3f[_0x6b3e('0x1f')][_0x6b3e('0x20')]||null:null,'include':_0x31fd3f['options']?_0x31fd3f['options'][_0x6b3e('0x22')]?_['map'](_0x31fd3f[_0x6b3e('0x1f')][_0x6b3e('0x22')],function(_0x29bd53){return{'model':db[_0x29bd53['model']],'as':_0x29bd53['as'],'attributes':_0x29bd53[_0x6b3e('0x20')],'include':_0x29bd53[_0x6b3e('0x22')]?_[_0x6b3e('0x23')](_0x29bd53[_0x6b3e('0x22')],function(_0x3c93e8){return{'model':db[_0x3c93e8[_0x6b3e('0x24')]],'as':_0x3c93e8['as'],'attributes':_0x3c93e8[_0x6b3e('0x20')],'include':_0x3c93e8[_0x6b3e('0x22')]?_['map'](_0x3c93e8[_0x6b3e('0x22')],function(_0x5ac7f1){return{'model':db[_0x5ac7f1['model']],'as':_0x5ac7f1['as'],'attributes':_0x5ac7f1[_0x6b3e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6b3e('0x12')](function(_0x24b60d){logger['info']('ShowFaxQueue',_0x31fd3f);logger[_0x6b3e('0x15')](_0x6b3e('0x27'),_0x31fd3f,JSON['stringify'](_0x24b60d));_0x3263ef(_0x24b60d);})[_0x6b3e('0x1c')](function(_0x378395){logger['error'](_0x6b3e('0x27'),_0x378395[_0x6b3e('0x19')],_0x31fd3f);_0x4836c9(_0x530b7c[_0x6b3e('0x17')](0x1f4,_0x378395[_0x6b3e('0x19')]));});});}; \ No newline at end of file +var _0x09d9=['result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','attributes','model','ShowFaxQueue','find','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message'];(function(_0xd5f801,_0x568626){var _0xedf82d=function(_0x166c4e){while(--_0x166c4e){_0xd5f801['push'](_0xd5f801['shift']());}};_0xedf82d(++_0x568626);}(_0x09d9,0xd7));var _0x909d=function(_0x36e334,_0x39bd51){_0x36e334=_0x36e334-0x0;var _0x5279d8=_0x09d9[_0x36e334];return _0x5279d8;};'use strict';var _=require(_0x909d('0x0'));var util=require('util');var moment=require(_0x909d('0x1'));var BPromise=require(_0x909d('0x2'));var rs=require(_0x909d('0x3'));var fs=require('fs');var Redis=require(_0x909d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x909d('0x5'));var logger=require(_0x909d('0x6'))(_0x909d('0x7'));var config=require(_0x909d('0x8'));var jayson=require(_0x909d('0x9'));var client=jayson[_0x909d('0xa')][_0x909d('0xb')]({'port':0x232a});config[_0x909d('0xc')]=_[_0x909d('0xd')](config['redis'],{'host':_0x909d('0xe'),'port':0x18eb});var socket=require(_0x909d('0xf'))(new Redis(config['redis']));require(_0x909d('0x10'))[_0x909d('0x11')](socket);function respondWithRpcPromise(_0x2cff4b,_0x718f2,_0x52ebbb){return new BPromise(function(_0x23bdd7,_0x29acb5){return client['request'](_0x2cff4b,_0x52ebbb)['then'](function(_0x1729dc){logger[_0x909d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x718f2,_0x909d('0x13'));logger[_0x909d('0x14')](_0x909d('0x15'),_0x718f2,_0x909d('0x13'),JSON['stringify'](_0x1729dc));if(_0x1729dc[_0x909d('0x16')]){if(_0x1729dc[_0x909d('0x16')]['code']===0x1f4){logger[_0x909d('0x16')](_0x909d('0x17'),_0x718f2,_0x1729dc['error']['message']);return _0x29acb5(_0x1729dc[_0x909d('0x16')][_0x909d('0x18')]);}logger[_0x909d('0x16')](_0x909d('0x17'),_0x718f2,_0x1729dc['error'][_0x909d('0x18')]);return _0x23bdd7(_0x1729dc[_0x909d('0x16')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x718f2,_0x909d('0x13'));_0x23bdd7(_0x1729dc[_0x909d('0x19')][_0x909d('0x18')]);}})[_0x909d('0x1a')](function(_0x12b71e){logger[_0x909d('0x16')](_0x909d('0x17'),_0x718f2,_0x12b71e);_0x29acb5(_0x12b71e);});});}exports[_0x909d('0x1b')]=function(_0x1540d3){var _0x4c2e6d=this;return new Promise(function(_0x51b6fc,_0x31a8a6){return db[_0x909d('0x1c')][_0x909d('0x1d')]({'raw':_0x1540d3[_0x909d('0x1e')]?_0x1540d3['options'][_0x909d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1540d3['options']?_0x1540d3['options'][_0x909d('0x20')]||null:null,'attributes':_0x1540d3['options']?_0x1540d3[_0x909d('0x1e')]['attributes']||null:null,'limit':_0x1540d3['options']?_0x1540d3[_0x909d('0x1e')]['limit']||null:null,'include':_0x1540d3[_0x909d('0x1e')]?_0x1540d3[_0x909d('0x1e')][_0x909d('0x21')]?_[_0x909d('0x22')](_0x1540d3[_0x909d('0x1e')][_0x909d('0x21')],function(_0x3d980b){return{'model':db[_0x3d980b['model']],'as':_0x3d980b['as'],'attributes':_0x3d980b[_0x909d('0x23')],'include':_0x3d980b[_0x909d('0x21')]?_[_0x909d('0x22')](_0x3d980b['include'],function(_0x71333b){return{'model':db[_0x71333b[_0x909d('0x24')]],'as':_0x71333b['as'],'attributes':_0x71333b['attributes'],'include':_0x71333b[_0x909d('0x21')]?_[_0x909d('0x22')](_0x71333b[_0x909d('0x21')],function(_0x579d1b){return{'model':db[_0x579d1b[_0x909d('0x24')]],'as':_0x579d1b['as'],'attributes':_0x579d1b[_0x909d('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f0c89){logger[_0x909d('0x12')](_0x909d('0x1b'),_0x1540d3);logger[_0x909d('0x14')](_0x909d('0x1b'),_0x1540d3,JSON['stringify'](_0x4f0c89));_0x51b6fc(_0x4f0c89);})[_0x909d('0x1a')](function(_0x48e797){logger[_0x909d('0x16')]('GetFaxQueue',_0x48e797[_0x909d('0x18')],_0x1540d3);_0x31a8a6(_0x4c2e6d[_0x909d('0x16')](0x1f4,_0x48e797['message']));});});};exports[_0x909d('0x25')]=function(_0x49ce82){var _0x5254c4=this;return new Promise(function(_0x1e7774,_0x388c25){return db[_0x909d('0x1c')][_0x909d('0x26')]({'raw':_0x49ce82[_0x909d('0x1e')]?_0x49ce82['options'][_0x909d('0x1f')]===undefined?!![]:![]:!![],'where':_0x49ce82[_0x909d('0x1e')]?_0x49ce82[_0x909d('0x1e')]['where']||null:null,'attributes':_0x49ce82[_0x909d('0x1e')]?_0x49ce82[_0x909d('0x1e')]['attributes']||null:null,'include':_0x49ce82['options']?_0x49ce82[_0x909d('0x1e')]['include']?_['map'](_0x49ce82[_0x909d('0x1e')][_0x909d('0x21')],function(_0x11a656){return{'model':db[_0x11a656[_0x909d('0x24')]],'as':_0x11a656['as'],'attributes':_0x11a656[_0x909d('0x23')],'include':_0x11a656[_0x909d('0x21')]?_['map'](_0x11a656['include'],function(_0x433e48){return{'model':db[_0x433e48['model']],'as':_0x433e48['as'],'attributes':_0x433e48['attributes'],'include':_0x433e48['include']?_[_0x909d('0x22')](_0x433e48[_0x909d('0x21')],function(_0x3f92c5){return{'model':db[_0x3f92c5['model']],'as':_0x3f92c5['as'],'attributes':_0x3f92c5[_0x909d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x909d('0x27')](function(_0x553dea){logger[_0x909d('0x12')](_0x909d('0x25'),_0x49ce82);logger['debug']('ShowFaxQueue',_0x49ce82,JSON['stringify'](_0x553dea));_0x1e7774(_0x553dea);})[_0x909d('0x1a')](function(_0x289692){logger[_0x909d('0x16')]('ShowFaxQueue',_0x289692['message'],_0x49ce82);_0x388c25(_0x5254c4[_0x909d('0x16')](0x1f4,_0x289692[_0x909d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 139e1d9..8fb3304 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 _0x11a6=['./faxQueue.events','update','emit','removeListener','length'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x11a6,0x1c7));var _0x611a=function(_0xacfde8,_0x145f25){_0xacfde8=_0xacfde8-0x0;var _0x260442=_0x11a6[_0xacfde8];return _0x260442;};'use strict';var FaxQueueEvents=require(_0x611a('0x0'));var events=['save','remove',_0x611a('0x1')];function createListener(_0x194367,_0x149296){return function(_0x7d92e1){_0x149296[_0x611a('0x2')](_0x194367,_0x7d92e1);};}function removeListener(_0x3bed23,_0x1a3701){return function(){FaxQueueEvents[_0x611a('0x3')](_0x3bed23,_0x1a3701);};}exports['register']=function(_0x2a0bfb){for(var _0x28f1fd=0x0,_0x84299a=events[_0x611a('0x4')];_0x28f1fd<_0x84299a;_0x28f1fd++){var _0x47d6da=events[_0x28f1fd];var _0x3e2e22=createListener('faxQueue:'+_0x47d6da,_0x2a0bfb);FaxQueueEvents['on'](_0x47d6da,_0x3e2e22);}}; \ No newline at end of file +var _0xdedd=['register','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x3e6318,_0x3cb7f9){var _0x1f29d9=function(_0x5a5154){while(--_0x5a5154){_0x3e6318['push'](_0x3e6318['shift']());}};_0x1f29d9(++_0x3cb7f9);}(_0xdedd,0x197));var _0xdded=function(_0x4b3397,_0x390a69){_0x4b3397=_0x4b3397-0x0;var _0x5d0506=_0xdedd[_0x4b3397];return _0x5d0506;};'use strict';var FaxQueueEvents=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(){FaxQueueEvents[_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('faxQueue:'+_0x558cff,_0x2e327c);FaxQueueEvents['on'](_0x558cff,_0x224a4d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7459388..8cf5ff2 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 _0x1a37=['/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x5b63c3,_0xb57ece){var _0x150025=function(_0x45f5ca){while(--_0x45f5ca){_0x5b63c3['push'](_0x5b63c3['shift']());}};_0x150025(++_0xb57ece);}(_0x1a37,0xb4));var _0x71a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1a37[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./faxQueue.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getTeams']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0x13')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x13')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x15')]);router[_0x71a3('0x13')](_0x71a3('0x16'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x71a3('0x19')]);router[_0x71a3('0x1a')](_0x71a3('0x1b'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1c')]);router[_0x71a3('0x1a')]('/:id/teams',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1d')]);router['delete']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);module[_0x71a3('0x1f')]=router; \ No newline at end of file +var _0xe785=['/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe785,0x128));var _0x5e78=function(_0x550d2f,_0x367bea){_0x550d2f=_0x550d2f-0x0;var _0x28e111=_0xe785[_0x550d2f];return _0x28e111;};'use strict';var multer=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var path=require('path');var timeout=require(_0x5e78('0x2'));var express=require(_0x5e78('0x3'));var router=express[_0x5e78('0x4')]();var fs_extra=require(_0x5e78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e78('0x6'));var controller=require(_0x5e78('0x7'));router[_0x5e78('0x8')]('/',auth[_0x5e78('0x9')](),controller['index']);router['get'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xb')]);router['get'](_0x5e78('0xc'),auth['isAuthenticated'](),controller[_0x5e78('0xd')]);router['get'](_0x5e78('0xe'),auth[_0x5e78('0x9')](),controller['getMembers']);router[_0x5e78('0x8')](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x10')]);router[_0x5e78('0x8')](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller['getAgents']);router[_0x5e78('0x12')]('/',auth[_0x5e78('0x9')](),controller[_0x5e78('0x13')]);router['post'](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x14')]);router[_0x5e78('0x12')]('/:id/users',auth[_0x5e78('0x9')](),controller[_0x5e78('0x15')]);router[_0x5e78('0x16')](_0x5e78('0xc'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x17')]);router['delete']('/:id',auth[_0x5e78('0x9')](),controller[_0x5e78('0x18')]);router[_0x5e78('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x1a')]);module[_0x5e78('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 15777a4..fd8cb33 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 _0xba12=['STRING','DATE','sequelize'];(function(_0xdd2348,_0x5d3232){var _0x2e0a02=function(_0x38e687){while(--_0x38e687){_0xdd2348['push'](_0xdd2348['shift']());}};_0x2e0a02(++_0x5d3232);}(_0xba12,0xa4));var _0x2ba1=function(_0x284cd1,_0x87b55b){_0x284cd1=_0x284cd1-0x0;var _0x4b6653=_0xba12[_0x284cd1];return _0x4b6653;};'use strict';var moment=require('moment');var Sequelize=require(_0x2ba1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2ba1('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2ba1('0x1')]},'joinAt':{'type':Sequelize[_0x2ba1('0x2')]},'leaveAt':{'type':Sequelize[_0x2ba1('0x2')]},'acceptAt':{'type':Sequelize[_0x2ba1('0x2')]},'exitAt':{'type':Sequelize[_0x2ba1('0x2')]},'reason':{'type':Sequelize[_0x2ba1('0x1')]}}; \ No newline at end of file +var _0x9e92=['moment','sequelize','exports','STRING','DATE'];(function(_0x43d03b,_0x4d4561){var _0x408833=function(_0x11df59){while(--_0x11df59){_0x43d03b['push'](_0x43d03b['shift']());}};_0x408833(++_0x4d4561);}(_0x9e92,0x104));var _0x29e9=function(_0x1918c4,_0x4a3ddd){_0x1918c4=_0x1918c4-0x0;var _0x3b8c24=_0x9e92[_0x1918c4];return _0x3b8c24;};'use strict';var moment=require(_0x29e9('0x0'));var Sequelize=require(_0x29e9('0x1'));module[_0x29e9('0x2')]={'uniqueid':{'type':Sequelize[_0x29e9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x29e9('0x3')]},'joinAt':{'type':Sequelize[_0x29e9('0x4')]},'leaveAt':{'type':Sequelize[_0x29e9('0x4')]},'acceptAt':{'type':Sequelize[_0x29e9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x29e9('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 86c6952..ac0275e 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 _0xa3b9=['reject','save','update','then','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply'];(function(_0xde5d25,_0xc72fb4){var _0x519985=function(_0x243e5d){while(--_0x243e5d){_0xde5d25['push'](_0xde5d25['shift']());}};_0x519985(++_0xc72fb4);}(_0xa3b9,0x112));var _0x9a3b=function(_0x22c817,_0x5ea944){_0x22c817=_0x22c817-0x0;var _0x4ef41e=_0xa3b9[_0x22c817];return _0x4ef41e;};'use strict';var emlformat=require(_0x9a3b('0x0'));var rimraf=require(_0x9a3b('0x1'));var zipdir=require(_0x9a3b('0x2'));var jsonpatch=require(_0x9a3b('0x3'));var rp=require(_0x9a3b('0x4'));var moment=require(_0x9a3b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a3b('0x6'));var util=require(_0x9a3b('0x7'));var path=require(_0x9a3b('0x8'));var sox=require(_0x9a3b('0x9'));var csv=require(_0x9a3b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a3b('0xb'));var squel=require(_0x9a3b('0xc'));var crypto=require(_0x9a3b('0xd'));var jsforce=require(_0x9a3b('0xe'));var deskjs=require(_0x9a3b('0xf'));var toCsv=require(_0x9a3b('0xa'));var querystring=require(_0x9a3b('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a3b('0x11'));var authService=require(_0x9a3b('0x12'));var qs=require(_0x9a3b('0x13'));var as=require(_0x9a3b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a3b('0x15'))(_0x9a3b('0x16'));var utils=require(_0x9a3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a3b('0x18'))['db'];function respondWithStatusCode(_0x4fa0f7,_0x57fd21){_0x57fd21=_0x57fd21||0xcc;return function(_0x86116e){if(_0x86116e){return _0x4fa0f7[_0x9a3b('0x19')](_0x57fd21);}return _0x4fa0f7['status'](_0x57fd21)[_0x9a3b('0x1a')]();};}function respondWithResult(_0x4ccc2b,_0x1d5aef){_0x1d5aef=_0x1d5aef||0xc8;return function(_0x16ff58){if(_0x16ff58){return _0x4ccc2b[_0x9a3b('0x1b')](_0x1d5aef)['json'](_0x16ff58);}};}function respondWithFilteredResult(_0x4803e5,_0x703e57){return function(_0x594395){if(_0x594395){var _0x2b6474=typeof _0x703e57[_0x9a3b('0x1c')]===_0x9a3b('0x1d')&&typeof _0x703e57[_0x9a3b('0x1e')]===_0x9a3b('0x1d');var _0x5b8f24=_0x594395['count'];var _0xa2975=_0x2b6474?0x0:_0x703e57[_0x9a3b('0x1c')];var _0x5c1af2=_0x2b6474?_0x594395[_0x9a3b('0x1f')]:_0x703e57[_0x9a3b('0x1c')]+_0x703e57[_0x9a3b('0x1e')];var _0x4bd9c6;if(_0x5c1af2>=_0x5b8f24){_0x5c1af2=_0x5b8f24;_0x4bd9c6=0xc8;}else{_0x4bd9c6=0xce;}_0x4803e5['status'](_0x4bd9c6);return _0x4803e5[_0x9a3b('0x20')]('Content-Range',_0xa2975+'-'+_0x5c1af2+'/'+_0x5b8f24)['json'](_0x594395);}return null;};}function patchUpdates(_0x34665e){return function(_0x6bd3af){try{jsonpatch[_0x9a3b('0x21')](_0x6bd3af,_0x34665e,!![]);}catch(_0x1c911e){return BPromise[_0x9a3b('0x22')](_0x1c911e);}return _0x6bd3af[_0x9a3b('0x23')]();};}function saveUpdates(_0x5da539,_0x448324){return function(_0x1cb2c0){if(_0x1cb2c0){return _0x1cb2c0[_0x9a3b('0x24')](_0x5da539)[_0x9a3b('0x25')](function(_0x420e5c){return _0x420e5c;});}return null;};}function removeEntity(_0x2d44b1,_0x3b32d8){return function(_0x375804){if(_0x375804){return _0x375804['destroy']()[_0x9a3b('0x25')](function(){_0x2d44b1[_0x9a3b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58648d,_0x28a01c){return function(_0x23f0e2){if(!_0x23f0e2){_0x58648d[_0x9a3b('0x19')](0x194);}return _0x23f0e2;};}function handleError(_0x17e3e1,_0x4a6876){_0x4a6876=_0x4a6876||0x1f4;return function(_0x895da0){logger[_0x9a3b('0x26')](_0x895da0[_0x9a3b('0x27')]);if(_0x895da0[_0x9a3b('0x28')]){delete _0x895da0[_0x9a3b('0x28')];}_0x17e3e1[_0x9a3b('0x1b')](_0x4a6876)['send'](_0x895da0);};}exports[_0x9a3b('0x29')]=function(_0x4eeb4b,_0x432f23){var _0xcc06f={},_0x31d542={},_0x504b44={'count':0x0,'rows':[]};var _0x1b70e8=_[_0x9a3b('0x2a')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')],function(_0x3093f1){return{'name':_0x3093f1[_0x9a3b('0x2d')],'type':_0x3093f1['type']['key']};});_0x31d542[_0x9a3b('0x2e')]=_[_0x9a3b('0x2a')](_0x1b70e8,_0x9a3b('0x28'));_0x31d542[_0x9a3b('0x2f')]=_[_0x9a3b('0x30')](_0x4eeb4b['query']);_0x31d542['filters']=_['intersection'](_0x31d542[_0x9a3b('0x2e')],_0x31d542[_0x9a3b('0x2f')]);_0xcc06f['attributes']=_[_0x9a3b('0x31')](_0x31d542[_0x9a3b('0x2e')],qs[_0x9a3b('0x32')](_0x4eeb4b['query']['fields']));_0xcc06f[_0x9a3b('0x33')]=_0xcc06f['attributes'][_0x9a3b('0x34')]?_0xcc06f['attributes']:_0x31d542[_0x9a3b('0x2e')];if(!_0x4eeb4b['query'][_0x9a3b('0x35')](_0x9a3b('0x36'))){_0xcc06f[_0x9a3b('0x1e')]=qs[_0x9a3b('0x1e')](_0x4eeb4b[_0x9a3b('0x2f')]['limit']);_0xcc06f[_0x9a3b('0x1c')]=qs['offset'](_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x1c')]);}_0xcc06f[_0x9a3b('0x37')]=qs[_0x9a3b('0x38')](_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x38')]);_0xcc06f['where']=qs['filters'](_[_0x9a3b('0x39')](_0x4eeb4b[_0x9a3b('0x2f')],_0x31d542[_0x9a3b('0x3a')]),_0x1b70e8);if(_0x4eeb4b['query'][_0x9a3b('0x3b')]){_0xcc06f['where']=_[_0x9a3b('0x3c')](_0xcc06f[_0x9a3b('0x3d')],{'$or':_[_0x9a3b('0x2a')](_0x1b70e8,function(_0x4cd476){if(_0x4cd476[_0x9a3b('0x3e')]!==_0x9a3b('0x3f')){var _0x336350={};_0x336350[_0x4cd476[_0x9a3b('0x28')]]={'$like':'%'+_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x3b')]+'%'};return _0x336350;}})});}_0xcc06f=_['merge']({},_0xcc06f,_0x4eeb4b[_0x9a3b('0x40')]);var _0x33f136={'where':_0xcc06f[_0x9a3b('0x3d')]};return db['FaxQueueReport'][_0x9a3b('0x1f')](_0x33f136)[_0x9a3b('0x25')](function(_0x1df2bf){_0x504b44[_0x9a3b('0x1f')]=_0x1df2bf;if(_0x4eeb4b[_0x9a3b('0x2f')][_0x9a3b('0x41')]){_0xcc06f[_0x9a3b('0x42')]=[{'all':!![]}];}return db[_0x9a3b('0x2b')][_0x9a3b('0x43')](_0xcc06f);})['then'](function(_0xa13292){_0x504b44[_0x9a3b('0x44')]=_0xa13292;return _0x504b44;})[_0x9a3b('0x25')](respondWithFilteredResult(_0x432f23,_0xcc06f))[_0x9a3b('0x45')](handleError(_0x432f23,null));};exports[_0x9a3b('0x46')]=function(_0x2ad2b7,_0x53ee3e){var _0x129bbb={'raw':!![],'where':{'id':_0x2ad2b7[_0x9a3b('0x47')]['id']}},_0x2872b1={};_0x2872b1[_0x9a3b('0x2e')]=_[_0x9a3b('0x30')](db[_0x9a3b('0x2b')][_0x9a3b('0x2c')]);_0x2872b1[_0x9a3b('0x2f')]=_[_0x9a3b('0x30')](_0x2ad2b7[_0x9a3b('0x2f')]);_0x2872b1[_0x9a3b('0x3a')]=_[_0x9a3b('0x31')](_0x2872b1[_0x9a3b('0x2e')],_0x2872b1['query']);_0x129bbb[_0x9a3b('0x33')]=_[_0x9a3b('0x31')](_0x2872b1[_0x9a3b('0x2e')],qs[_0x9a3b('0x32')](_0x2ad2b7[_0x9a3b('0x2f')][_0x9a3b('0x32')]));_0x129bbb[_0x9a3b('0x33')]=_0x129bbb[_0x9a3b('0x33')][_0x9a3b('0x34')]?_0x129bbb[_0x9a3b('0x33')]:_0x2872b1[_0x9a3b('0x2e')];if(_0x2ad2b7[_0x9a3b('0x2f')][_0x9a3b('0x41')]){_0x129bbb['include']=[{'all':!![]}];}_0x129bbb=_[_0x9a3b('0x3c')]({},_0x129bbb,_0x2ad2b7[_0x9a3b('0x40')]);return db[_0x9a3b('0x2b')][_0x9a3b('0x48')](_0x129bbb)[_0x9a3b('0x25')](handleEntityNotFound(_0x53ee3e,null))[_0x9a3b('0x25')](respondWithResult(_0x53ee3e,null))['catch'](handleError(_0x53ee3e,null));};exports['create']=function(_0x2a8233,_0x51a2c7){return db[_0x9a3b('0x2b')][_0x9a3b('0x49')](_0x2a8233[_0x9a3b('0x4a')],{})[_0x9a3b('0x25')](respondWithResult(_0x51a2c7,0xc9))[_0x9a3b('0x45')](handleError(_0x51a2c7,null));};exports[_0x9a3b('0x24')]=function(_0x115f6b,_0x41389e){if(_0x115f6b[_0x9a3b('0x4a')]['id']){delete _0x115f6b[_0x9a3b('0x4a')]['id'];}return db[_0x9a3b('0x2b')][_0x9a3b('0x48')]({'where':{'id':_0x115f6b[_0x9a3b('0x47')]['id']}})[_0x9a3b('0x25')](handleEntityNotFound(_0x41389e,null))[_0x9a3b('0x25')](saveUpdates(_0x115f6b['body'],null))[_0x9a3b('0x25')](respondWithResult(_0x41389e,null))[_0x9a3b('0x45')](handleError(_0x41389e,null));};exports[_0x9a3b('0x4b')]=function(_0x5df82d,_0x20c9f3){return db[_0x9a3b('0x2b')]['find']({'where':{'id':_0x5df82d[_0x9a3b('0x47')]['id']}})[_0x9a3b('0x25')](handleEntityNotFound(_0x20c9f3,null))[_0x9a3b('0x25')](removeEntity(_0x20c9f3,null))[_0x9a3b('0x45')](handleError(_0x20c9f3,null));};exports[_0x9a3b('0x4c')]=function(_0x2953e3,_0xfa2703){return db[_0x9a3b('0x2b')][_0x9a3b('0x4c')]()[_0x9a3b('0x25')](respondWithResult(_0xfa2703,null))[_0x9a3b('0x45')](handleError(_0xfa2703,null));}; \ No newline at end of file +var _0xe80c=['order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','show','params','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','count','limit','Content-Range','reject','save','then','destroy','status','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x5907d2,_0x319964){var _0x296b06=function(_0x32d546){while(--_0x32d546){_0x5907d2['push'](_0x5907d2['shift']());}};_0x296b06(++_0x319964);}(_0xe80c,0x1c2));var _0xce80=function(_0x5ef758,_0x273e17){_0x5ef758=_0x5ef758-0x0;var _0x4b4eaa=_0xe80c[_0x5ef758];return _0x4b4eaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce80('0x0'));var zipdir=require(_0xce80('0x1'));var jsonpatch=require(_0xce80('0x2'));var rp=require(_0xce80('0x3'));var moment=require(_0xce80('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce80('0x5'));var util=require(_0xce80('0x6'));var path=require(_0xce80('0x7'));var sox=require(_0xce80('0x8'));var csv=require('to-csv');var ejs=require(_0xce80('0x9'));var fs=require('fs');var fs_extra=require(_0xce80('0xa'));var _=require(_0xce80('0xb'));var squel=require('squel');var crypto=require(_0xce80('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce80('0xd'));var toCsv=require('to-csv');var querystring=require(_0xce80('0xe'));var Papa=require(_0xce80('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce80('0x10'));var as=require(_0xce80('0x11'));var hardwareService=require(_0xce80('0x12'));var logger=require(_0xce80('0x13'))(_0xce80('0x14'));var utils=require(_0xce80('0x15'));var config=require(_0xce80('0x16'));var licenseUtil=require(_0xce80('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45a9b7,_0x37561b){_0x37561b=_0x37561b||0xcc;return function(_0x12d8c7){if(_0x12d8c7){return _0x45a9b7['sendStatus'](_0x37561b);}return _0x45a9b7['status'](_0x37561b)[_0xce80('0x18')]();};}function respondWithResult(_0x1903ec,_0x15f870){_0x15f870=_0x15f870||0xc8;return function(_0x3cac82){if(_0x3cac82){return _0x1903ec['status'](_0x15f870)[_0xce80('0x19')](_0x3cac82);}};}function respondWithFilteredResult(_0x5d134e,_0x9402b9){return function(_0x48796f){if(_0x48796f){var _0x24efa3=typeof _0x9402b9[_0xce80('0x1a')]==='undefined'&&typeof _0x9402b9['limit']==='undefined';var _0x35b40d=_0x48796f[_0xce80('0x1b')];var _0x148d57=_0x24efa3?0x0:_0x9402b9[_0xce80('0x1a')];var _0x4375b7=_0x24efa3?_0x48796f['count']:_0x9402b9[_0xce80('0x1a')]+_0x9402b9[_0xce80('0x1c')];var _0x4d4345;if(_0x4375b7>=_0x35b40d){_0x4375b7=_0x35b40d;_0x4d4345=0xc8;}else{_0x4d4345=0xce;}_0x5d134e['status'](_0x4d4345);return _0x5d134e['set'](_0xce80('0x1d'),_0x148d57+'-'+_0x4375b7+'/'+_0x35b40d)[_0xce80('0x19')](_0x48796f);}return null;};}function patchUpdates(_0x468b61){return function(_0x44f399){try{jsonpatch['apply'](_0x44f399,_0x468b61,!![]);}catch(_0x259a0b){return BPromise[_0xce80('0x1e')](_0x259a0b);}return _0x44f399[_0xce80('0x1f')]();};}function saveUpdates(_0x5315eb,_0x4df9bb){return function(_0x116b5e){if(_0x116b5e){return _0x116b5e['update'](_0x5315eb)[_0xce80('0x20')](function(_0x348d2d){return _0x348d2d;});}return null;};}function removeEntity(_0x2c5d01,_0x34f511){return function(_0x4fc91c){if(_0x4fc91c){return _0x4fc91c[_0xce80('0x21')]()['then'](function(){_0x2c5d01[_0xce80('0x22')](0xcc)[_0xce80('0x18')]();});}};}function handleEntityNotFound(_0x4cd1f5,_0x48080b){return function(_0x2b2dc3){if(!_0x2b2dc3){_0x4cd1f5['sendStatus'](0x194);}return _0x2b2dc3;};}function handleError(_0x2b7a4a,_0x1017f1){_0x1017f1=_0x1017f1||0x1f4;return function(_0x2a935a){logger[_0xce80('0x23')](_0x2a935a['stack']);if(_0x2a935a[_0xce80('0x24')]){delete _0x2a935a[_0xce80('0x24')];}_0x2b7a4a[_0xce80('0x22')](_0x1017f1)[_0xce80('0x25')](_0x2a935a);};}exports[_0xce80('0x26')]=function(_0x4792fe,_0x4d8796){var _0x6d1190={},_0x51b5bf={},_0x40cd7e={'count':0x0,'rows':[]};var _0x43ffb6=_[_0xce80('0x27')](db[_0xce80('0x28')][_0xce80('0x29')],function(_0x2f445c){return{'name':_0x2f445c[_0xce80('0x2a')],'type':_0x2f445c['type'][_0xce80('0x2b')]};});_0x51b5bf['model']=_['map'](_0x43ffb6,_0xce80('0x24'));_0x51b5bf[_0xce80('0x2c')]=_[_0xce80('0x2d')](_0x4792fe[_0xce80('0x2c')]);_0x51b5bf[_0xce80('0x2e')]=_[_0xce80('0x2f')](_0x51b5bf[_0xce80('0x30')],_0x51b5bf[_0xce80('0x2c')]);_0x6d1190['attributes']=_[_0xce80('0x2f')](_0x51b5bf['model'],qs[_0xce80('0x31')](_0x4792fe[_0xce80('0x2c')][_0xce80('0x31')]));_0x6d1190[_0xce80('0x32')]=_0x6d1190[_0xce80('0x32')][_0xce80('0x33')]?_0x6d1190['attributes']:_0x51b5bf[_0xce80('0x30')];if(!_0x4792fe[_0xce80('0x2c')][_0xce80('0x34')](_0xce80('0x35'))){_0x6d1190[_0xce80('0x1c')]=qs[_0xce80('0x1c')](_0x4792fe['query']['limit']);_0x6d1190[_0xce80('0x1a')]=qs[_0xce80('0x1a')](_0x4792fe[_0xce80('0x2c')][_0xce80('0x1a')]);}_0x6d1190[_0xce80('0x36')]=qs['sort'](_0x4792fe[_0xce80('0x2c')][_0xce80('0x37')]);_0x6d1190[_0xce80('0x38')]=qs[_0xce80('0x2e')](_[_0xce80('0x39')](_0x4792fe[_0xce80('0x2c')],_0x51b5bf[_0xce80('0x2e')]),_0x43ffb6);if(_0x4792fe[_0xce80('0x2c')][_0xce80('0x3a')]){_0x6d1190[_0xce80('0x38')]=_['merge'](_0x6d1190[_0xce80('0x38')],{'$or':_['map'](_0x43ffb6,function(_0x79ad39){if(_0x79ad39[_0xce80('0x3b')]!==_0xce80('0x3c')){var _0x2c87ce={};_0x2c87ce[_0x79ad39[_0xce80('0x24')]]={'$like':'%'+_0x4792fe['query'][_0xce80('0x3a')]+'%'};return _0x2c87ce;}})});}_0x6d1190=_[_0xce80('0x3d')]({},_0x6d1190,_0x4792fe[_0xce80('0x3e')]);var _0x53715e={'where':_0x6d1190[_0xce80('0x38')]};return db['FaxQueueReport'][_0xce80('0x1b')](_0x53715e)[_0xce80('0x20')](function(_0x3a5b0e){_0x40cd7e[_0xce80('0x1b')]=_0x3a5b0e;if(_0x4792fe[_0xce80('0x2c')][_0xce80('0x3f')]){_0x6d1190['include']=[{'all':!![]}];}return db[_0xce80('0x28')][_0xce80('0x40')](_0x6d1190);})[_0xce80('0x20')](function(_0x12bb2c){_0x40cd7e['rows']=_0x12bb2c;return _0x40cd7e;})[_0xce80('0x20')](respondWithFilteredResult(_0x4d8796,_0x6d1190))['catch'](handleError(_0x4d8796,null));};exports[_0xce80('0x41')]=function(_0x30b72c,_0x3e2edd){var _0x4167b9={'raw':!![],'where':{'id':_0x30b72c[_0xce80('0x42')]['id']}},_0x338393={};_0x338393[_0xce80('0x30')]=_[_0xce80('0x2d')](db[_0xce80('0x28')]['rawAttributes']);_0x338393[_0xce80('0x2c')]=_[_0xce80('0x2d')](_0x30b72c[_0xce80('0x2c')]);_0x338393['filters']=_[_0xce80('0x2f')](_0x338393[_0xce80('0x30')],_0x338393[_0xce80('0x2c')]);_0x4167b9['attributes']=_[_0xce80('0x2f')](_0x338393['model'],qs[_0xce80('0x31')](_0x30b72c[_0xce80('0x2c')][_0xce80('0x31')]));_0x4167b9['attributes']=_0x4167b9[_0xce80('0x32')][_0xce80('0x33')]?_0x4167b9[_0xce80('0x32')]:_0x338393['model'];if(_0x30b72c[_0xce80('0x2c')]['includeAll']){_0x4167b9['include']=[{'all':!![]}];}_0x4167b9=_[_0xce80('0x3d')]({},_0x4167b9,_0x30b72c[_0xce80('0x3e')]);return db[_0xce80('0x28')][_0xce80('0x43')](_0x4167b9)[_0xce80('0x20')](handleEntityNotFound(_0x3e2edd,null))[_0xce80('0x20')](respondWithResult(_0x3e2edd,null))[_0xce80('0x44')](handleError(_0x3e2edd,null));};exports[_0xce80('0x45')]=function(_0x5f448e,_0x217fa4){return db['FaxQueueReport'][_0xce80('0x45')](_0x5f448e[_0xce80('0x46')],{})[_0xce80('0x20')](respondWithResult(_0x217fa4,0xc9))[_0xce80('0x44')](handleError(_0x217fa4,null));};exports[_0xce80('0x47')]=function(_0x118583,_0x595662){if(_0x118583[_0xce80('0x46')]['id']){delete _0x118583['body']['id'];}return db[_0xce80('0x28')]['find']({'where':{'id':_0x118583['params']['id']}})[_0xce80('0x20')](handleEntityNotFound(_0x595662,null))[_0xce80('0x20')](saveUpdates(_0x118583[_0xce80('0x46')],null))[_0xce80('0x20')](respondWithResult(_0x595662,null))['catch'](handleError(_0x595662,null));};exports[_0xce80('0x21')]=function(_0xc420ef,_0x56dc30){return db[_0xce80('0x28')][_0xce80('0x43')]({'where':{'id':_0xc420ef[_0xce80('0x42')]['id']}})[_0xce80('0x20')](handleEntityNotFound(_0x56dc30,null))['then'](removeEntity(_0x56dc30,null))['catch'](handleError(_0x56dc30,null));};exports['describe']=function(_0x4671d0,_0x2bd460){return db[_0xce80('0x28')]['describe']()['then'](respondWithResult(_0x2bd460,null))[_0xce80('0x44')](handleError(_0x2bd460,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 478959b..0fb9d99 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x559e04,_0x1adc8c){var _0x54cf91=function(_0x42b691){while(--_0x42b691){_0x559e04['push'](_0x559e04['shift']());}};_0x54cf91(++_0x1adc8c);}(_0x7a54,0x106));var _0x47a5=function(_0x333185,_0x546c97){_0x333185=_0x333185-0x0;var _0x156fc6=_0x7a54[_0x333185];return _0x156fc6;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55963b,_0x20ebe2){_0x55963b=_0x55963b-0x0;var _0x44ed6e=_0x1cb9[_0x55963b];return _0x44ed6e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'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 a840d25..2dda3fa 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 _0xf90c=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueueReport,\x20%s,\x20%s','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','attributes','lodash','util','moment','bluebird'];(function(_0x37593b,_0x43d66e){var _0x5b5a43=function(_0x4b30c4){while(--_0x4b30c4){_0x37593b['push'](_0x37593b['shift']());}};_0x5b5a43(++_0x43d66e);}(_0xf90c,0x128));var _0xcf90=function(_0x4bb348,_0x46c996){_0x4bb348=_0x4bb348-0x0;var _0x208d1e=_0xf90c[_0x4bb348];return _0x208d1e;};'use strict';var _=require(_0xcf90('0x0'));var util=require(_0xcf90('0x1'));var moment=require(_0xcf90('0x2'));var BPromise=require(_0xcf90('0x3'));var rs=require(_0xcf90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf90('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf90('0x6'))(_0xcf90('0x7'));var config=require(_0xcf90('0x8'));var jayson=require(_0xcf90('0x9'));var client=jayson[_0xcf90('0xa')][_0xcf90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x174f3f,_0x151c1e,_0x26bf05){return new BPromise(function(_0x25905d,_0x13711a){return client[_0xcf90('0xc')](_0x174f3f,_0x26bf05)['then'](function(_0x3add35){logger[_0xcf90('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x151c1e,_0xcf90('0xe'));logger[_0xcf90('0xf')](_0xcf90('0x10'),_0x151c1e,_0xcf90('0xe'),JSON[_0xcf90('0x11')](_0x3add35));if(_0x3add35[_0xcf90('0x12')]){if(_0x3add35[_0xcf90('0x12')]['code']===0x1f4){logger[_0xcf90('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x151c1e,_0x3add35[_0xcf90('0x12')][_0xcf90('0x13')]);return _0x13711a(_0x3add35[_0xcf90('0x12')][_0xcf90('0x13')]);}logger[_0xcf90('0x12')](_0xcf90('0x14'),_0x151c1e,_0x3add35['error'][_0xcf90('0x13')]);return _0x25905d(_0x3add35['error']['message']);}else{logger[_0xcf90('0xd')](_0xcf90('0x14'),_0x151c1e,_0xcf90('0xe'));_0x25905d(_0x3add35['result']['message']);}})[_0xcf90('0x15')](function(_0x3ed266){logger[_0xcf90('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x151c1e,_0x3ed266);_0x13711a(_0x3ed266);});});}exports['CreateFaxQueueReport']=function(_0x3e6ff3){var _0x3ab12d=this;return new Promise(function(_0x10fb01,_0x27d66e){return db[_0xcf90('0x16')][_0xcf90('0x17')](_0x3e6ff3[_0xcf90('0x18')],{'raw':_0x3e6ff3[_0xcf90('0x19')]?_0x3e6ff3[_0xcf90('0x19')][_0xcf90('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4c1d06){logger[_0xcf90('0xd')]('CreateFaxQueueReport',_0x3e6ff3);logger[_0xcf90('0xf')](_0xcf90('0x1b'),_0x3e6ff3,JSON['stringify'](_0x4c1d06));_0x10fb01(_0x4c1d06);})[_0xcf90('0x15')](function(_0x5458e6){logger[_0xcf90('0x12')](_0xcf90('0x1b'),_0x5458e6[_0xcf90('0x13')],_0x3e6ff3);_0x27d66e(_0x3ab12d[_0xcf90('0x12')](0x1f4,_0x5458e6[_0xcf90('0x13')]));});});};exports[_0xcf90('0x1c')]=function(_0x16eaf7){var _0x5119ac=this;return new Promise(function(_0x2e530d,_0x29dad6){return db[_0xcf90('0x16')]['update'](_0x16eaf7[_0xcf90('0x18')],{'raw':_0x16eaf7[_0xcf90('0x19')]?_0x16eaf7[_0xcf90('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16eaf7['options']?_0x16eaf7['options']['where']||null:null,'attributes':_0x16eaf7[_0xcf90('0x19')]?_0x16eaf7[_0xcf90('0x19')][_0xcf90('0x1d')]||null:null,'limit':_0x16eaf7['options']?_0x16eaf7[_0xcf90('0x19')]['limit']||null:null})['then'](function(_0x208b07){logger[_0xcf90('0xd')]('UpdateFaxQueueReport',_0x16eaf7);logger['debug'](_0xcf90('0x1c'),_0x16eaf7,JSON[_0xcf90('0x11')](_0x208b07));_0x2e530d(_0x208b07);})['catch'](function(_0x5ca7be){logger['error'](_0xcf90('0x1c'),_0x5ca7be['message'],_0x16eaf7);_0x29dad6(_0x5119ac[_0xcf90('0x12')](0x1f4,_0x5ca7be['message']));});});}; \ No newline at end of file +var _0x05ca=['stringify','error','code','message','catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5dcd7a,_0x2ed04c){var _0x41761a=function(_0x3c10fd){while(--_0x3c10fd){_0x5dcd7a['push'](_0x5dcd7a['shift']());}};_0x41761a(++_0x2ed04c);}(_0x05ca,0xef));var _0xa05c=function(_0xaa7af2,_0x289bf0){_0xaa7af2=_0xaa7af2-0x0;var _0xbf48e3=_0x05ca[_0xaa7af2];return _0xbf48e3;};'use strict';var _=require(_0xa05c('0x0'));var util=require(_0xa05c('0x1'));var moment=require(_0xa05c('0x2'));var BPromise=require(_0xa05c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa05c('0x4'));var logger=require('../../config/logger')(_0xa05c('0x5'));var config=require(_0xa05c('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x124283,_0x2b13bc,_0x1e1bd2){return new BPromise(function(_0xd298d5,_0x5971d9){return client['request'](_0x124283,_0x1e1bd2)[_0xa05c('0x7')](function(_0x295f30){logger[_0xa05c('0x8')](_0xa05c('0x9'),_0x2b13bc,_0xa05c('0xa'));logger[_0xa05c('0xb')](_0xa05c('0xc'),_0x2b13bc,_0xa05c('0xa'),JSON[_0xa05c('0xd')](_0x295f30));if(_0x295f30['error']){if(_0x295f30[_0xa05c('0xe')][_0xa05c('0xf')]===0x1f4){logger[_0xa05c('0xe')](_0xa05c('0x9'),_0x2b13bc,_0x295f30[_0xa05c('0xe')][_0xa05c('0x10')]);return _0x5971d9(_0x295f30[_0xa05c('0xe')]['message']);}logger['error'](_0xa05c('0x9'),_0x2b13bc,_0x295f30[_0xa05c('0xe')]['message']);return _0xd298d5(_0x295f30[_0xa05c('0xe')]['message']);}else{logger[_0xa05c('0x8')](_0xa05c('0x9'),_0x2b13bc,_0xa05c('0xa'));_0xd298d5(_0x295f30['result'][_0xa05c('0x10')]);}})[_0xa05c('0x11')](function(_0xa968d5){logger[_0xa05c('0xe')](_0xa05c('0x9'),_0x2b13bc,_0xa968d5);_0x5971d9(_0xa968d5);});});}exports[_0xa05c('0x12')]=function(_0x1dc8fd){var _0x131875=this;return new Promise(function(_0x4bf926,_0x1679bc){return db['FaxQueueReport'][_0xa05c('0x13')](_0x1dc8fd[_0xa05c('0x14')],{'raw':_0x1dc8fd[_0xa05c('0x15')]?_0x1dc8fd[_0xa05c('0x15')][_0xa05c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x522678){logger[_0xa05c('0x8')](_0xa05c('0x12'),_0x1dc8fd);logger[_0xa05c('0xb')](_0xa05c('0x12'),_0x1dc8fd,JSON['stringify'](_0x522678));_0x4bf926(_0x522678);})[_0xa05c('0x11')](function(_0xb8006d){logger[_0xa05c('0xe')]('CreateFaxQueueReport',_0xb8006d['message'],_0x1dc8fd);_0x1679bc(_0x131875[_0xa05c('0xe')](0x1f4,_0xb8006d[_0xa05c('0x10')]));});});};exports[_0xa05c('0x17')]=function(_0x184a21){var _0x581ca2=this;return new Promise(function(_0x1fae0c,_0x469127){return db[_0xa05c('0x18')][_0xa05c('0x19')](_0x184a21[_0xa05c('0x14')],{'raw':_0x184a21[_0xa05c('0x15')]?_0x184a21['options'][_0xa05c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184a21[_0xa05c('0x15')]?_0x184a21[_0xa05c('0x15')][_0xa05c('0x1a')]||null:null,'attributes':_0x184a21[_0xa05c('0x15')]?_0x184a21['options'][_0xa05c('0x1b')]||null:null,'limit':_0x184a21[_0xa05c('0x15')]?_0x184a21['options']['limit']||null:null})[_0xa05c('0x7')](function(_0x323aea){logger[_0xa05c('0x8')]('UpdateFaxQueueReport',_0x184a21);logger[_0xa05c('0xb')](_0xa05c('0x17'),_0x184a21,JSON['stringify'](_0x323aea));_0x1fae0c(_0x323aea);})[_0xa05c('0x11')](function(_0x2deecd){logger[_0xa05c('0xe')]('UpdateFaxQueueReport',_0x2deecd['message'],_0x184a21);_0x469127(_0x581ca2['error'](0x1f4,_0x2deecd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7b34d1f..d6e2331 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 _0xd748=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd748,0x1ba));var _0x8d74=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0xd748[_0x4fa489];return _0x41d2ce;};'use strict';var multer=require(_0x8d74('0x0'));var util=require(_0x8d74('0x1'));var path=require(_0x8d74('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d74('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8d74('0x4'));var interaction=require(_0x8d74('0x5'));var config=require(_0x8d74('0x6'));var controller=require('./faxQueueReport.controller');router[_0x8d74('0x7')]('/',auth[_0x8d74('0x8')](),controller[_0x8d74('0x9')]);router[_0x8d74('0x7')](_0x8d74('0xa'),auth[_0x8d74('0x8')](),controller['describe']);router['get'](_0x8d74('0xb'),auth['isAuthenticated'](),controller[_0x8d74('0xc')]);router[_0x8d74('0xd')]('/',auth[_0x8d74('0x8')](),controller['create']);router[_0x8d74('0xe')]('/:id',auth[_0x8d74('0x8')](),controller[_0x8d74('0xf')]);router[_0x8d74('0x10')](_0x8d74('0xb'),auth[_0x8d74('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0300=['delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update'];(function(_0x168a75,_0x3a1f1e){var _0x3fe4ad=function(_0x2e2708){while(--_0x2e2708){_0x168a75['push'](_0x168a75['shift']());}};_0x3fe4ad(++_0x3a1f1e);}(_0x0300,0x1a6));var _0x0030=function(_0x316ac6,_0x4bffe9){_0x316ac6=_0x316ac6-0x0;var _0x417c99=_0x0300[_0x316ac6];return _0x417c99;};'use strict';var multer=require(_0x0030('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0030('0x1'));var express=require(_0x0030('0x2'));var router=express[_0x0030('0x3')]();var fs_extra=require(_0x0030('0x4'));var auth=require(_0x0030('0x5'));var interaction=require(_0x0030('0x6'));var config=require(_0x0030('0x7'));var controller=require(_0x0030('0x8'));router[_0x0030('0x9')]('/',auth[_0x0030('0xa')](),controller[_0x0030('0xb')]);router[_0x0030('0x9')](_0x0030('0xc'),auth[_0x0030('0xa')](),controller[_0x0030('0xd')]);router[_0x0030('0x9')]('/:id',auth[_0x0030('0xa')](),controller[_0x0030('0xe')]);router[_0x0030('0xf')]('/',auth[_0x0030('0xa')](),controller['create']);router[_0x0030('0x10')](_0x0030('0x11'),auth['isAuthenticated'](),controller[_0x0030('0x12')]);router[_0x0030('0x13')]('/:id',auth[_0x0030('0xa')](),controller[_0x0030('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3f74695..f05064c 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x35e792,_0x4751ae){var _0x2be575=function(_0x1dfdc8){while(--_0x1dfdc8){_0x35e792['push'](_0x35e792['shift']());}};_0x2be575(++_0x4751ae);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x464c31,_0x1c09c7){var _0x31a3f7=function(_0xfdfe33){while(--_0xfdfe33){_0x464c31['push'](_0x464c31['shift']());}};_0x31a3f7(++_0x1c09c7);}(_0xaa88,0x137));var _0x8aa8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xaa88[_0x5d4607];return _0x5e4a86;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 87d738e..22fdfb4 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 _0x9414=['create','body','describe','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','order','sort','filters','pick','where','merge','VIRTUAL','filter','FaxTransferReport','includeAll','rows','catch','show','params','length','include','options','find'];(function(_0x21c918,_0x463815){var _0x4e0097=function(_0x136925){while(--_0x136925){_0x21c918['push'](_0x21c918['shift']());}};_0x4e0097(++_0x463815);}(_0x9414,0x175));var _0x4941=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x9414[_0x2797c6];return _0x54809f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4941('0x0'));var jsonpatch=require(_0x4941('0x1'));var rp=require(_0x4941('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4941('0x3'));var path=require(_0x4941('0x4'));var sox=require(_0x4941('0x5'));var csv=require('to-csv');var ejs=require(_0x4941('0x6'));var fs=require('fs');var fs_extra=require(_0x4941('0x7'));var _=require(_0x4941('0x8'));var squel=require(_0x4941('0x9'));var crypto=require(_0x4941('0xa'));var jsforce=require(_0x4941('0xb'));var deskjs=require(_0x4941('0xc'));var toCsv=require(_0x4941('0xd'));var querystring=require(_0x4941('0xe'));var Papa=require(_0x4941('0xf'));var Redis=require(_0x4941('0x10'));var authService=require(_0x4941('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4941('0x12'));var hardwareService=require(_0x4941('0x13'));var logger=require(_0x4941('0x14'))(_0x4941('0x15'));var utils=require(_0x4941('0x16'));var config=require(_0x4941('0x17'));var licenseUtil=require(_0x4941('0x18'));var db=require(_0x4941('0x19'))['db'];function respondWithStatusCode(_0x491db1,_0xeabfe2){_0xeabfe2=_0xeabfe2||0xcc;return function(_0x4c260f){if(_0x4c260f){return _0x491db1[_0x4941('0x1a')](_0xeabfe2);}return _0x491db1[_0x4941('0x1b')](_0xeabfe2)[_0x4941('0x1c')]();};}function respondWithResult(_0x2473e0,_0x85c0d4){_0x85c0d4=_0x85c0d4||0xc8;return function(_0x2d8222){if(_0x2d8222){return _0x2473e0[_0x4941('0x1b')](_0x85c0d4)['json'](_0x2d8222);}};}function respondWithFilteredResult(_0x5bd54f,_0x1f9730){return function(_0x1cb93e){if(_0x1cb93e){var _0x26a90a=typeof _0x1f9730[_0x4941('0x1d')]===_0x4941('0x1e')&&typeof _0x1f9730[_0x4941('0x1f')]===_0x4941('0x1e');var _0x6c806d=_0x1cb93e[_0x4941('0x20')];var _0x5ea2c9=_0x26a90a?0x0:_0x1f9730[_0x4941('0x1d')];var _0x1a441d=_0x26a90a?_0x1cb93e[_0x4941('0x20')]:_0x1f9730[_0x4941('0x1d')]+_0x1f9730[_0x4941('0x1f')];var _0x2227ae;if(_0x1a441d>=_0x6c806d){_0x1a441d=_0x6c806d;_0x2227ae=0xc8;}else{_0x2227ae=0xce;}_0x5bd54f[_0x4941('0x1b')](_0x2227ae);return _0x5bd54f['set'](_0x4941('0x21'),_0x5ea2c9+'-'+_0x1a441d+'/'+_0x6c806d)[_0x4941('0x22')](_0x1cb93e);}return null;};}function patchUpdates(_0x29f7d7){return function(_0x3ba8a9){try{jsonpatch['apply'](_0x3ba8a9,_0x29f7d7,!![]);}catch(_0x446058){return BPromise['reject'](_0x446058);}return _0x3ba8a9[_0x4941('0x23')]();};}function saveUpdates(_0x40bcef,_0x5e7d30){return function(_0x1da395){if(_0x1da395){return _0x1da395[_0x4941('0x24')](_0x40bcef)[_0x4941('0x25')](function(_0x2f95ef){return _0x2f95ef;});}return null;};}function removeEntity(_0x438cd6,_0x3edef9){return function(_0x1ef85b){if(_0x1ef85b){return _0x1ef85b[_0x4941('0x26')]()[_0x4941('0x25')](function(){_0x438cd6[_0x4941('0x1b')](0xcc)[_0x4941('0x1c')]();});}};}function handleEntityNotFound(_0x528603,_0x31169f){return function(_0x597509){if(!_0x597509){_0x528603[_0x4941('0x1a')](0x194);}return _0x597509;};}function handleError(_0x387b18,_0x2d55cc){_0x2d55cc=_0x2d55cc||0x1f4;return function(_0x3f6a8b){logger[_0x4941('0x27')](_0x3f6a8b[_0x4941('0x28')]);if(_0x3f6a8b[_0x4941('0x29')]){delete _0x3f6a8b['name'];}_0x387b18[_0x4941('0x1b')](_0x2d55cc)[_0x4941('0x2a')](_0x3f6a8b);};}exports[_0x4941('0x2b')]=function(_0x8d7bb,_0x19868d){var _0x424c12={},_0x15b6b1={},_0x12d658={'count':0x0,'rows':[]};var _0xd18369=_[_0x4941('0x2c')](db['FaxTransferReport']['rawAttributes'],function(_0x59c728){return{'name':_0x59c728[_0x4941('0x2d')],'type':_0x59c728[_0x4941('0x2e')][_0x4941('0x2f')]};});_0x15b6b1[_0x4941('0x30')]=_['map'](_0xd18369,'name');_0x15b6b1['query']=_['keys'](_0x8d7bb[_0x4941('0x31')]);_0x15b6b1['filters']=_[_0x4941('0x32')](_0x15b6b1[_0x4941('0x30')],_0x15b6b1[_0x4941('0x31')]);_0x424c12['attributes']=_[_0x4941('0x32')](_0x15b6b1[_0x4941('0x30')],qs[_0x4941('0x33')](_0x8d7bb[_0x4941('0x31')][_0x4941('0x33')]));_0x424c12['attributes']=_0x424c12['attributes']['length']?_0x424c12[_0x4941('0x34')]:_0x15b6b1['model'];if(!_0x8d7bb['query']['hasOwnProperty']('nolimit')){_0x424c12[_0x4941('0x1f')]=qs[_0x4941('0x1f')](_0x8d7bb[_0x4941('0x31')][_0x4941('0x1f')]);_0x424c12[_0x4941('0x1d')]=qs[_0x4941('0x1d')](_0x8d7bb[_0x4941('0x31')][_0x4941('0x1d')]);}_0x424c12[_0x4941('0x35')]=qs[_0x4941('0x36')](_0x8d7bb[_0x4941('0x31')][_0x4941('0x36')]);_0x424c12['where']=qs[_0x4941('0x37')](_[_0x4941('0x38')](_0x8d7bb[_0x4941('0x31')],_0x15b6b1[_0x4941('0x37')]),_0xd18369);if(_0x8d7bb[_0x4941('0x31')]['filter']){_0x424c12[_0x4941('0x39')]=_[_0x4941('0x3a')](_0x424c12['where'],{'$or':_['map'](_0xd18369,function(_0x437cb0){if(_0x437cb0[_0x4941('0x2e')]!==_0x4941('0x3b')){var _0x3ec67a={};_0x3ec67a[_0x437cb0['name']]={'$like':'%'+_0x8d7bb['query'][_0x4941('0x3c')]+'%'};return _0x3ec67a;}})});}_0x424c12=_[_0x4941('0x3a')]({},_0x424c12,_0x8d7bb['options']);var _0x32c182={'where':_0x424c12[_0x4941('0x39')]};return db[_0x4941('0x3d')][_0x4941('0x20')](_0x32c182)[_0x4941('0x25')](function(_0x3a72fe){_0x12d658[_0x4941('0x20')]=_0x3a72fe;if(_0x8d7bb['query'][_0x4941('0x3e')]){_0x424c12['include']=[{'all':!![]}];}return db[_0x4941('0x3d')]['findAll'](_0x424c12);})[_0x4941('0x25')](function(_0x13c56f){_0x12d658[_0x4941('0x3f')]=_0x13c56f;return _0x12d658;})['then'](respondWithFilteredResult(_0x19868d,_0x424c12))[_0x4941('0x40')](handleError(_0x19868d,null));};exports[_0x4941('0x41')]=function(_0x59a12d,_0x3062e9){var _0x288fe9={'raw':!![],'where':{'id':_0x59a12d[_0x4941('0x42')]['id']}},_0xca15b8={};_0xca15b8[_0x4941('0x30')]=_['keys'](db[_0x4941('0x3d')]['rawAttributes']);_0xca15b8['query']=_['keys'](_0x59a12d[_0x4941('0x31')]);_0xca15b8['filters']=_['intersection'](_0xca15b8['model'],_0xca15b8[_0x4941('0x31')]);_0x288fe9['attributes']=_[_0x4941('0x32')](_0xca15b8[_0x4941('0x30')],qs[_0x4941('0x33')](_0x59a12d[_0x4941('0x31')][_0x4941('0x33')]));_0x288fe9[_0x4941('0x34')]=_0x288fe9[_0x4941('0x34')][_0x4941('0x43')]?_0x288fe9[_0x4941('0x34')]:_0xca15b8['model'];if(_0x59a12d[_0x4941('0x31')][_0x4941('0x3e')]){_0x288fe9[_0x4941('0x44')]=[{'all':!![]}];}_0x288fe9=_['merge']({},_0x288fe9,_0x59a12d[_0x4941('0x45')]);return db[_0x4941('0x3d')][_0x4941('0x46')](_0x288fe9)[_0x4941('0x25')](handleEntityNotFound(_0x3062e9,null))['then'](respondWithResult(_0x3062e9,null))[_0x4941('0x40')](handleError(_0x3062e9,null));};exports[_0x4941('0x47')]=function(_0x36d373,_0x3d6c81){return db[_0x4941('0x3d')]['create'](_0x36d373[_0x4941('0x48')],{})[_0x4941('0x25')](respondWithResult(_0x3d6c81,0xc9))[_0x4941('0x40')](handleError(_0x3d6c81,null));};exports['update']=function(_0x4ddd00,_0x46e582){if(_0x4ddd00[_0x4941('0x48')]['id']){delete _0x4ddd00[_0x4941('0x48')]['id'];}return db['FaxTransferReport'][_0x4941('0x46')]({'where':{'id':_0x4ddd00['params']['id']}})[_0x4941('0x25')](handleEntityNotFound(_0x46e582,null))['then'](saveUpdates(_0x4ddd00['body'],null))[_0x4941('0x25')](respondWithResult(_0x46e582,null))[_0x4941('0x40')](handleError(_0x46e582,null));};exports[_0x4941('0x26')]=function(_0x842c96,_0x2ab4aa){return db[_0x4941('0x3d')]['find']({'where':{'id':_0x842c96[_0x4941('0x42')]['id']}})[_0x4941('0x25')](handleEntityNotFound(_0x2ab4aa,null))['then'](removeEntity(_0x2ab4aa,null))[_0x4941('0x40')](handleError(_0x2ab4aa,null));};exports[_0x4941('0x49')]=function(_0x196a9c,_0x55e0a3){return db[_0x4941('0x3d')]['describe']()[_0x4941('0x25')](respondWithResult(_0x55e0a3,null))[_0x4941('0x40')](handleError(_0x55e0a3,null));}; \ No newline at end of file +var _0x48f0=['count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x334790,_0x3f0238){var _0x435bd7=function(_0x4c65ea){while(--_0x4c65ea){_0x334790['push'](_0x334790['shift']());}};_0x435bd7(++_0x3f0238);}(_0x48f0,0x1ec));var _0x048f=function(_0x4d5ab0,_0x11a29b){_0x4d5ab0=_0x4d5ab0-0x0;var _0x4d56cd=_0x48f0[_0x4d5ab0];return _0x4d56cd;};'use strict';var emlformat=require(_0x048f('0x0'));var rimraf=require(_0x048f('0x1'));var zipdir=require(_0x048f('0x2'));var jsonpatch=require(_0x048f('0x3'));var rp=require('request-promise');var moment=require(_0x048f('0x4'));var BPromise=require(_0x048f('0x5'));var Mustache=require(_0x048f('0x6'));var util=require(_0x048f('0x7'));var path=require(_0x048f('0x8'));var sox=require(_0x048f('0x9'));var csv=require('to-csv');var ejs=require(_0x048f('0xa'));var fs=require('fs');var fs_extra=require(_0x048f('0xb'));var _=require(_0x048f('0xc'));var squel=require('squel');var crypto=require(_0x048f('0xd'));var jsforce=require(_0x048f('0xe'));var deskjs=require(_0x048f('0xf'));var toCsv=require(_0x048f('0x10'));var querystring=require(_0x048f('0x11'));var Papa=require('papaparse');var Redis=require(_0x048f('0x12'));var authService=require(_0x048f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x048f('0x14'));var hardwareService=require(_0x048f('0x15'));var logger=require(_0x048f('0x16'))(_0x048f('0x17'));var utils=require(_0x048f('0x18'));var config=require(_0x048f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eec61,_0x303f7d){_0x303f7d=_0x303f7d||0xcc;return function(_0x46c96a){if(_0x46c96a){return _0x1eec61[_0x048f('0x1a')](_0x303f7d);}return _0x1eec61[_0x048f('0x1b')](_0x303f7d)[_0x048f('0x1c')]();};}function respondWithResult(_0x5b9b5f,_0x43ea7a){_0x43ea7a=_0x43ea7a||0xc8;return function(_0xd41329){if(_0xd41329){return _0x5b9b5f['status'](_0x43ea7a)[_0x048f('0x1d')](_0xd41329);}};}function respondWithFilteredResult(_0x123c31,_0x2b23a2){return function(_0x3f39b8){if(_0x3f39b8){var _0x28d213=typeof _0x2b23a2[_0x048f('0x1e')]===_0x048f('0x1f')&&typeof _0x2b23a2[_0x048f('0x20')]==='undefined';var _0x3e4f61=_0x3f39b8['count'];var _0x16bc0c=_0x28d213?0x0:_0x2b23a2['offset'];var _0x454b5c=_0x28d213?_0x3f39b8[_0x048f('0x21')]:_0x2b23a2[_0x048f('0x1e')]+_0x2b23a2[_0x048f('0x20')];var _0x5a0c56;if(_0x454b5c>=_0x3e4f61){_0x454b5c=_0x3e4f61;_0x5a0c56=0xc8;}else{_0x5a0c56=0xce;}_0x123c31[_0x048f('0x1b')](_0x5a0c56);return _0x123c31['set'](_0x048f('0x22'),_0x16bc0c+'-'+_0x454b5c+'/'+_0x3e4f61)[_0x048f('0x1d')](_0x3f39b8);}return null;};}function patchUpdates(_0x296fe5){return function(_0x41c7ba){try{jsonpatch[_0x048f('0x23')](_0x41c7ba,_0x296fe5,!![]);}catch(_0x3a07a1){return BPromise[_0x048f('0x24')](_0x3a07a1);}return _0x41c7ba[_0x048f('0x25')]();};}function saveUpdates(_0x33dc70,_0x5758ef){return function(_0x2d4e18){if(_0x2d4e18){return _0x2d4e18[_0x048f('0x26')](_0x33dc70)[_0x048f('0x27')](function(_0x283336){return _0x283336;});}return null;};}function removeEntity(_0x2be8ed,_0x682017){return function(_0x3e6c2d){if(_0x3e6c2d){return _0x3e6c2d[_0x048f('0x28')]()['then'](function(){_0x2be8ed[_0x048f('0x1b')](0xcc)[_0x048f('0x1c')]();});}};}function handleEntityNotFound(_0x57cebc,_0x55a915){return function(_0x287c09){if(!_0x287c09){_0x57cebc[_0x048f('0x1a')](0x194);}return _0x287c09;};}function handleError(_0x4fa416,_0x17fe7c){_0x17fe7c=_0x17fe7c||0x1f4;return function(_0x189f8c){logger[_0x048f('0x29')](_0x189f8c[_0x048f('0x2a')]);if(_0x189f8c[_0x048f('0x2b')]){delete _0x189f8c[_0x048f('0x2b')];}_0x4fa416[_0x048f('0x1b')](_0x17fe7c)['send'](_0x189f8c);};}exports[_0x048f('0x2c')]=function(_0x5c9526,_0x5eb6fe){var _0x5df7fb={},_0x4d16f8={},_0xde7a21={'count':0x0,'rows':[]};var _0x490126=_[_0x048f('0x2d')](db[_0x048f('0x2e')][_0x048f('0x2f')],function(_0x4df964){return{'name':_0x4df964[_0x048f('0x30')],'type':_0x4df964[_0x048f('0x31')][_0x048f('0x32')]};});_0x4d16f8[_0x048f('0x33')]=_[_0x048f('0x2d')](_0x490126,_0x048f('0x2b'));_0x4d16f8['query']=_[_0x048f('0x34')](_0x5c9526[_0x048f('0x35')]);_0x4d16f8[_0x048f('0x36')]=_[_0x048f('0x37')](_0x4d16f8[_0x048f('0x33')],_0x4d16f8[_0x048f('0x35')]);_0x5df7fb[_0x048f('0x38')]=_['intersection'](_0x4d16f8[_0x048f('0x33')],qs[_0x048f('0x39')](_0x5c9526[_0x048f('0x35')]['fields']));_0x5df7fb[_0x048f('0x38')]=_0x5df7fb[_0x048f('0x38')]['length']?_0x5df7fb[_0x048f('0x38')]:_0x4d16f8[_0x048f('0x33')];if(!_0x5c9526['query'][_0x048f('0x3a')]('nolimit')){_0x5df7fb[_0x048f('0x20')]=qs['limit'](_0x5c9526[_0x048f('0x35')][_0x048f('0x20')]);_0x5df7fb[_0x048f('0x1e')]=qs[_0x048f('0x1e')](_0x5c9526[_0x048f('0x35')][_0x048f('0x1e')]);}_0x5df7fb['order']=qs[_0x048f('0x3b')](_0x5c9526[_0x048f('0x35')][_0x048f('0x3b')]);_0x5df7fb[_0x048f('0x3c')]=qs[_0x048f('0x36')](_['pick'](_0x5c9526[_0x048f('0x35')],_0x4d16f8[_0x048f('0x36')]),_0x490126);if(_0x5c9526[_0x048f('0x35')][_0x048f('0x3d')]){_0x5df7fb['where']=_[_0x048f('0x3e')](_0x5df7fb[_0x048f('0x3c')],{'$or':_[_0x048f('0x2d')](_0x490126,function(_0x22ecdb){if(_0x22ecdb[_0x048f('0x31')]!=='VIRTUAL'){var _0x391835={};_0x391835[_0x22ecdb['name']]={'$like':'%'+_0x5c9526['query']['filter']+'%'};return _0x391835;}})});}_0x5df7fb=_['merge']({},_0x5df7fb,_0x5c9526[_0x048f('0x3f')]);var _0x2b7746={'where':_0x5df7fb[_0x048f('0x3c')]};return db[_0x048f('0x2e')][_0x048f('0x21')](_0x2b7746)[_0x048f('0x27')](function(_0x548e60){_0xde7a21[_0x048f('0x21')]=_0x548e60;if(_0x5c9526[_0x048f('0x35')][_0x048f('0x40')]){_0x5df7fb['include']=[{'all':!![]}];}return db[_0x048f('0x2e')][_0x048f('0x41')](_0x5df7fb);})[_0x048f('0x27')](function(_0x53262c){_0xde7a21['rows']=_0x53262c;return _0xde7a21;})[_0x048f('0x27')](respondWithFilteredResult(_0x5eb6fe,_0x5df7fb))[_0x048f('0x42')](handleError(_0x5eb6fe,null));};exports[_0x048f('0x43')]=function(_0x20e97e,_0x362c31){var _0x2c3658={'raw':!![],'where':{'id':_0x20e97e[_0x048f('0x44')]['id']}},_0x196b88={};_0x196b88[_0x048f('0x33')]=_['keys'](db[_0x048f('0x2e')]['rawAttributes']);_0x196b88[_0x048f('0x35')]=_[_0x048f('0x34')](_0x20e97e[_0x048f('0x35')]);_0x196b88[_0x048f('0x36')]=_[_0x048f('0x37')](_0x196b88[_0x048f('0x33')],_0x196b88[_0x048f('0x35')]);_0x2c3658[_0x048f('0x38')]=_[_0x048f('0x37')](_0x196b88['model'],qs[_0x048f('0x39')](_0x20e97e['query'][_0x048f('0x39')]));_0x2c3658[_0x048f('0x38')]=_0x2c3658[_0x048f('0x38')][_0x048f('0x45')]?_0x2c3658['attributes']:_0x196b88[_0x048f('0x33')];if(_0x20e97e[_0x048f('0x35')][_0x048f('0x40')]){_0x2c3658[_0x048f('0x46')]=[{'all':!![]}];}_0x2c3658=_[_0x048f('0x3e')]({},_0x2c3658,_0x20e97e['options']);return db[_0x048f('0x2e')][_0x048f('0x47')](_0x2c3658)['then'](handleEntityNotFound(_0x362c31,null))['then'](respondWithResult(_0x362c31,null))['catch'](handleError(_0x362c31,null));};exports[_0x048f('0x48')]=function(_0x386b3a,_0x49637e){return db['FaxTransferReport'][_0x048f('0x48')](_0x386b3a[_0x048f('0x49')],{})['then'](respondWithResult(_0x49637e,0xc9))[_0x048f('0x42')](handleError(_0x49637e,null));};exports[_0x048f('0x26')]=function(_0x27f4a8,_0x1e8117){if(_0x27f4a8[_0x048f('0x49')]['id']){delete _0x27f4a8[_0x048f('0x49')]['id'];}return db[_0x048f('0x2e')][_0x048f('0x47')]({'where':{'id':_0x27f4a8['params']['id']}})['then'](handleEntityNotFound(_0x1e8117,null))['then'](saveUpdates(_0x27f4a8['body'],null))[_0x048f('0x27')](respondWithResult(_0x1e8117,null))[_0x048f('0x42')](handleError(_0x1e8117,null));};exports[_0x048f('0x28')]=function(_0x5056b9,_0x107de2){return db[_0x048f('0x2e')][_0x048f('0x47')]({'where':{'id':_0x5056b9['params']['id']}})[_0x048f('0x27')](handleEntityNotFound(_0x107de2,null))[_0x048f('0x27')](removeEntity(_0x107de2,null))['catch'](handleError(_0x107de2,null));};exports[_0x048f('0x4a')]=function(_0x48bd38,_0x55dff3){return db[_0x048f('0x2e')][_0x048f('0x4a')]()[_0x048f('0x27')](respondWithResult(_0x55dff3,null))[_0x048f('0x42')](handleError(_0x55dff3,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d5fe9d2..f7244aa 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 _0x988c=['lodash','moment','bluebird','request-promise','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid'];(function(_0x3e98ea,_0x35793a){var _0x47d6ef=function(_0x27ac6e){while(--_0x27ac6e){_0x3e98ea['push'](_0x3e98ea['shift']());}};_0x47d6ef(++_0x35793a);}(_0x988c,0x19e));var _0xc988=function(_0x52c5da,_0x2d1f3a){_0x52c5da=_0x52c5da-0x0;var _0x561652=_0x988c[_0x52c5da];return _0x561652;};'use strict';var _=require(_0xc988('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc988('0x1'));var BPromise=require(_0xc988('0x2'));var rp=require(_0xc988('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc988('0x4'));module[_0xc988('0x5')]=function(_0x17fa32,_0x56317c){return _0x17fa32[_0xc988('0x6')](_0xc988('0x7'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc988('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8137=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x3bde10,_0x370bae){var _0xd89c20=function(_0x1d3bad){while(--_0x1d3bad){_0x3bde10['push'](_0x3bde10['shift']());}};_0xd89c20(++_0x370bae);}(_0x8137,0x11d));var _0x7813=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x8137[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x7813('0x0'));var util=require(_0x7813('0x1'));var logger=require(_0x7813('0x2'))(_0x7813('0x3'));var moment=require(_0x7813('0x4'));var BPromise=require(_0x7813('0x5'));var rp=require(_0x7813('0x6'));var fs=require('fs');var path=require(_0x7813('0x7'));var rimraf=require(_0x7813('0x8'));var config=require(_0x7813('0x9'));var attributes=require(_0x7813('0xa'));module[_0x7813('0xb')]=function(_0xa6a513,_0x2a3ad0){return _0xa6a513[_0x7813('0xc')](_0x7813('0xd'),attributes,{'tableName':_0x7813('0xe'),'paranoid':![],'indexes':[{'name':_0x7813('0xf'),'fields':[_0x7813('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 92b16b5..599455c 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 _0xe351=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe351,0xf4));var _0x1e35=function(_0x4b4472,_0xb322f7){_0x4b4472=_0x4b4472-0x0;var _0x398e75=_0xe351[_0x4b4472];return _0x398e75;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e35('0x0'));var BPromise=require(_0x1e35('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e35('0x2'));var db=require(_0x1e35('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e35('0x4'))(_0x1e35('0x5'));var config=require(_0x1e35('0x6'));var jayson=require(_0x1e35('0x7'));var client=jayson[_0x1e35('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390d3a,_0x33edae,_0x4955fa){return new BPromise(function(_0x4c3e04,_0x2229bd){return client[_0x1e35('0x9')](_0x390d3a,_0x4955fa)[_0x1e35('0xa')](function(_0x2206ef){logger[_0x1e35('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x33edae,_0x1e35('0xc'));logger[_0x1e35('0xd')](_0x1e35('0xe'),_0x33edae,_0x1e35('0xc'),JSON[_0x1e35('0xf')](_0x2206ef));if(_0x2206ef[_0x1e35('0x10')]){if(_0x2206ef[_0x1e35('0x10')][_0x1e35('0x11')]===0x1f4){logger[_0x1e35('0x10')](_0x1e35('0x12'),_0x33edae,_0x2206ef[_0x1e35('0x10')][_0x1e35('0x13')]);return _0x2229bd(_0x2206ef['error']['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x33edae,_0x2206ef[_0x1e35('0x10')]['message']);return _0x4c3e04(_0x2206ef[_0x1e35('0x10')]['message']);}else{logger['info'](_0x1e35('0x12'),_0x33edae,_0x1e35('0xc'));_0x4c3e04(_0x2206ef[_0x1e35('0x14')][_0x1e35('0x13')]);}})[_0x1e35('0x15')](function(_0x2d4cc8){logger[_0x1e35('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x33edae,_0x2d4cc8);_0x2229bd(_0x2d4cc8);});});} \ No newline at end of file +var _0x5782=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','catch'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x5782,0x1ce));var _0x2578=function(_0x3c8499,_0x1e052e){_0x3c8499=_0x3c8499-0x0;var _0x51d346=_0x5782[_0x3c8499];return _0x51d346;};'use strict';var _=require(_0x2578('0x0'));var util=require('util');var moment=require(_0x2578('0x1'));var BPromise=require('bluebird');var rs=require(_0x2578('0x2'));var fs=require('fs');var Redis=require(_0x2578('0x3'));var db=require(_0x2578('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2578('0x5'))(_0x2578('0x6'));var config=require(_0x2578('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2578('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aa268,_0x1d7702,_0x1c98c3){return new BPromise(function(_0x4464d0,_0x149a94){return client[_0x2578('0x9')](_0x3aa268,_0x1c98c3)[_0x2578('0xa')](function(_0x171f2c){logger[_0x2578('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x1d7702,_0x2578('0xc'));logger[_0x2578('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1d7702,'request\x20sent',JSON[_0x2578('0xe')](_0x171f2c));if(_0x171f2c[_0x2578('0xf')]){if(_0x171f2c[_0x2578('0xf')][_0x2578('0x10')]===0x1f4){logger[_0x2578('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x1d7702,_0x171f2c['error'][_0x2578('0x11')]);return _0x149a94(_0x171f2c[_0x2578('0xf')][_0x2578('0x11')]);}logger['error'](_0x2578('0x12'),_0x1d7702,_0x171f2c[_0x2578('0xf')][_0x2578('0x11')]);return _0x4464d0(_0x171f2c['error'][_0x2578('0x11')]);}else{logger[_0x2578('0xb')](_0x2578('0x12'),_0x1d7702,'request\x20sent');_0x4464d0(_0x171f2c[_0x2578('0x13')][_0x2578('0x11')]);}})[_0x2578('0x14')](function(_0x5d5a16){logger[_0x2578('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x1d7702,_0x5d5a16);_0x149a94(_0x5d5a16);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8fc3e86..8324103 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 _0xec3b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xec3b,0x1e2));var _0xbec3=function(_0x4fad8a,_0x58b446){_0x4fad8a=_0x4fad8a-0x0;var _0x5763a6=_0xec3b[_0x4fad8a];return _0x5763a6;};'use strict';var multer=require(_0xbec3('0x0'));var util=require(_0xbec3('0x1'));var path=require('path');var timeout=require(_0xbec3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbec3('0x3'));var auth=require(_0xbec3('0x4'));var interaction=require(_0xbec3('0x5'));var config=require(_0xbec3('0x6'));var controller=require(_0xbec3('0x7'));router[_0xbec3('0x8')]('/',auth[_0xbec3('0x9')](),controller['index']);router[_0xbec3('0x8')](_0xbec3('0xa'),auth[_0xbec3('0x9')](),controller[_0xbec3('0xb')]);router['get'](_0xbec3('0xc'),auth[_0xbec3('0x9')](),controller[_0xbec3('0xd')]);router['post']('/',auth[_0xbec3('0x9')](),controller[_0xbec3('0xe')]);router[_0xbec3('0xf')]('/:id',auth[_0xbec3('0x9')](),controller[_0xbec3('0x10')]);router['delete']('/:id',auth[_0xbec3('0x9')](),controller[_0xbec3('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc872=['get','index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x3cbba7,_0x23b17c){var _0x512e9b=function(_0x112e89){while(--_0x112e89){_0x3cbba7['push'](_0x3cbba7['shift']());}};_0x512e9b(++_0x23b17c);}(_0xc872,0x161));var _0x2c87=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xc872[_0xe4d6c6];return _0x3a8935;};'use strict';var multer=require('multer');var util=require(_0x2c87('0x0'));var path=require(_0x2c87('0x1'));var timeout=require(_0x2c87('0x2'));var express=require(_0x2c87('0x3'));var router=express['Router']();var fs_extra=require(_0x2c87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2c87('0x5'));var config=require(_0x2c87('0x6'));var controller=require(_0x2c87('0x7'));router[_0x2c87('0x8')]('/',auth['isAuthenticated'](),controller[_0x2c87('0x9')]);router[_0x2c87('0x8')](_0x2c87('0xa'),auth[_0x2c87('0xb')](),controller[_0x2c87('0xc')]);router['get'](_0x2c87('0xd'),auth['isAuthenticated'](),controller[_0x2c87('0xe')]);router['post']('/',auth[_0x2c87('0xb')](),controller[_0x2c87('0xf')]);router['put'](_0x2c87('0xd'),auth['isAuthenticated'](),controller[_0x2c87('0x10')]);router[_0x2c87('0x11')]('/:id',auth[_0x2c87('0xb')](),controller[_0x2c87('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2d07bbe..606bbcb 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 _0xe8b4=['post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3537e1,_0xbc7714){var _0x164a50=function(_0x57c2d1){while(--_0x57c2d1){_0x3537e1['push'](_0x3537e1['shift']());}};_0x164a50(++_0xbc7714);}(_0xe8b4,0xaf));var _0x4e8b=function(_0x4afdd2,_0x53a7b5){_0x4afdd2=_0x4afdd2-0x0;var _0x1d6adb=_0xe8b4[_0x4afdd2];return _0x1d6adb;};'use strict';var multer=require(_0x4e8b('0x0'));var util=require(_0x4e8b('0x1'));var path=require(_0x4e8b('0x2'));var timeout=require(_0x4e8b('0x3'));var express=require(_0x4e8b('0x4'));var router=express[_0x4e8b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4e8b('0x6'));var config=require(_0x4e8b('0x7'));var controller=require(_0x4e8b('0x8'));router[_0x4e8b('0x9')]('/',auth[_0x4e8b('0xa')](),controller['index']);router[_0x4e8b('0x9')](_0x4e8b('0xb'),auth['isAuthenticated'](),controller[_0x4e8b('0xc')]);router[_0x4e8b('0x9')](_0x4e8b('0xd'),auth[_0x4e8b('0xa')](),controller[_0x4e8b('0xe')]);router[_0x4e8b('0x9')](_0x4e8b('0xf'),auth['isAuthenticated'](),controller[_0x4e8b('0x10')]);router[_0x4e8b('0x11')]('/',auth[_0x4e8b('0xa')](),controller[_0x4e8b('0x12')]);router['post'](_0x4e8b('0xd'),auth[_0x4e8b('0xa')](),controller[_0x4e8b('0x13')]);router[_0x4e8b('0x14')](_0x4e8b('0xb'),auth[_0x4e8b('0xa')](),controller['update']);router[_0x4e8b('0x15')](_0x4e8b('0xb'),auth['isAuthenticated'](),controller[_0x4e8b('0x16')]);module[_0x4e8b('0x17')]=router; \ No newline at end of file +var _0xd38b=['addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x532597,_0x3ac173){var _0x39e41a=function(_0x185887){while(--_0x185887){_0x532597['push'](_0x532597['shift']());}};_0x39e41a(++_0x3ac173);}(_0xd38b,0x17b));var _0xbd38=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0xd38b[_0x146a85];return _0x1b59bf;};'use strict';var multer=require(_0xbd38('0x0'));var util=require(_0xbd38('0x1'));var path=require(_0xbd38('0x2'));var timeout=require(_0xbd38('0x3'));var express=require('express');var router=express[_0xbd38('0x4')]();var fs_extra=require(_0xbd38('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbd38('0x6'));var controller=require(_0xbd38('0x7'));router[_0xbd38('0x8')]('/',auth[_0xbd38('0x9')](),controller[_0xbd38('0xa')]);router[_0xbd38('0x8')](_0xbd38('0xb'),auth[_0xbd38('0x9')](),controller['show']);router[_0xbd38('0x8')](_0xbd38('0xc'),auth[_0xbd38('0x9')](),controller['getConfigurations']);router['get'](_0xbd38('0xd'),auth[_0xbd38('0x9')](),controller[_0xbd38('0xe')]);router[_0xbd38('0xf')]('/',auth[_0xbd38('0x9')](),controller[_0xbd38('0x10')]);router[_0xbd38('0xf')](_0xbd38('0xc'),auth[_0xbd38('0x9')](),controller[_0xbd38('0x11')]);router[_0xbd38('0x12')]('/:id',auth[_0xbd38('0x9')](),controller[_0xbd38('0x13')]);router[_0xbd38('0x14')](_0xbd38('0xb'),auth[_0xbd38('0x9')](),controller['destroy']);module[_0xbd38('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 d9c7338..3c24914 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 _0x8fd7=['sequelize','exports','STRING','basic','ENUM','newTab','integrationTab'];(function(_0x38a590,_0x4be77f){var _0x4834d5=function(_0x44d89c){while(--_0x44d89c){_0x38a590['push'](_0x38a590['shift']());}};_0x4834d5(++_0x4be77f);}(_0x8fd7,0x1ce));var _0x78fd=function(_0x3d3c27,_0x2c6973){_0x3d3c27=_0x3d3c27-0x0;var _0x469578=_0x8fd7[_0x3d3c27];return _0x469578;};'use strict';var Sequelize=require(_0x78fd('0x0'));module[_0x78fd('0x1')]={'name':{'type':Sequelize[_0x78fd('0x2')]},'description':{'type':Sequelize[_0x78fd('0x2')]},'username':{'type':Sequelize[_0x78fd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x78fd('0x3')),'defaultValue':_0x78fd('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x78fd('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x78fd('0x4')]('integrationTab',_0x78fd('0x5')),'defaultValue':_0x78fd('0x6')}}; \ No newline at end of file +var _0x5722=['newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x507a97,_0x22337f){var _0x1eb332=function(_0x5bc941){while(--_0x5bc941){_0x507a97['push'](_0x507a97['shift']());}};_0x1eb332(++_0x22337f);}(_0x5722,0xc7));var _0x2572=function(_0x5b06df,_0xe68441){_0x5b06df=_0x5b06df-0x0;var _0x433824=_0x5722[_0x5b06df];return _0x433824;};'use strict';var Sequelize=require(_0x2572('0x0'));module[_0x2572('0x1')]={'name':{'type':Sequelize[_0x2572('0x2')]},'description':{'type':Sequelize[_0x2572('0x2')]},'username':{'type':Sequelize[_0x2572('0x2')]},'remoteUri':{'type':Sequelize[_0x2572('0x2')]},'authType':{'type':Sequelize[_0x2572('0x3')](_0x2572('0x4')),'defaultValue':_0x2572('0x4')},'password':{'type':Sequelize[_0x2572('0x2')]},'consumerKey':{'type':Sequelize[_0x2572('0x2')]},'consumerSecret':{'type':Sequelize[_0x2572('0x2')]},'token':{'type':Sequelize[_0x2572('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2572('0x3')]('integrationTab',_0x2572('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 394fd34..70cc91f 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 _0x05fc=['pick','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','body','getConfigurations','findOne','DeskConfiguration','sort','filter','map','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','order','where'];(function(_0x37e7bf,_0x905de7){var _0xc4ede8=function(_0x11baee){while(--_0x11baee){_0x37e7bf['push'](_0x37e7bf['shift']());}};_0xc4ede8(++_0x905de7);}(_0x05fc,0x117));var _0xc05f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x05fc[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xc05f('0x0'));var rimraf=require(_0xc05f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc05f('0x2'));var rp=require(_0xc05f('0x3'));var moment=require('moment');var BPromise=require(_0xc05f('0x4'));var Mustache=require(_0xc05f('0x5'));var util=require(_0xc05f('0x6'));var path=require('path');var sox=require(_0xc05f('0x7'));var csv=require(_0xc05f('0x8'));var ejs=require(_0xc05f('0x9'));var fs=require('fs');var fs_extra=require(_0xc05f('0xa'));var _=require('lodash');var squel=require(_0xc05f('0xb'));var crypto=require(_0xc05f('0xc'));var jsforce=require(_0xc05f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc05f('0x8'));var querystring=require('querystring');var Papa=require(_0xc05f('0xe'));var Redis=require(_0xc05f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc05f('0x10'));var as=require(_0xc05f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc05f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc05f('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x451050,_0xaf9957){_0xaf9957=_0xaf9957||0xcc;return function(_0x12a22b){if(_0x12a22b){return _0x451050['sendStatus'](_0xaf9957);}return _0x451050[_0xc05f('0x14')](_0xaf9957)[_0xc05f('0x15')]();};}function respondWithResult(_0x16a865,_0x56412b){_0x56412b=_0x56412b||0xc8;return function(_0x6be92){if(_0x6be92){return _0x16a865['status'](_0x56412b)[_0xc05f('0x16')](_0x6be92);}};}function respondWithFilteredResult(_0x4ce2ec,_0x19db67){return function(_0x5431ed){if(_0x5431ed){var _0x404391=typeof _0x19db67[_0xc05f('0x17')]==='undefined'&&typeof _0x19db67[_0xc05f('0x18')]===_0xc05f('0x19');var _0x1da238=_0x5431ed[_0xc05f('0x1a')];var _0x2fbc78=_0x404391?0x0:_0x19db67['offset'];var _0x3fb551=_0x404391?_0x5431ed['count']:_0x19db67[_0xc05f('0x17')]+_0x19db67['limit'];var _0x58a8d0;if(_0x3fb551>=_0x1da238){_0x3fb551=_0x1da238;_0x58a8d0=0xc8;}else{_0x58a8d0=0xce;}_0x4ce2ec[_0xc05f('0x14')](_0x58a8d0);return _0x4ce2ec['set'](_0xc05f('0x1b'),_0x2fbc78+'-'+_0x3fb551+'/'+_0x1da238)[_0xc05f('0x16')](_0x5431ed);}return null;};}function patchUpdates(_0x26256f){return function(_0x2f62b0){try{jsonpatch[_0xc05f('0x1c')](_0x2f62b0,_0x26256f,!![]);}catch(_0x413855){return BPromise[_0xc05f('0x1d')](_0x413855);}return _0x2f62b0[_0xc05f('0x1e')]();};}function saveUpdates(_0x117606,_0x3bddd5){return function(_0x5839c6){if(_0x5839c6){return _0x5839c6[_0xc05f('0x1f')](_0x117606)['then'](function(_0x2304e8){return _0x2304e8;});}return null;};}function removeEntity(_0x329ae7,_0x2d0002){return function(_0x1b0768){if(_0x1b0768){return _0x1b0768[_0xc05f('0x20')]()[_0xc05f('0x21')](function(){_0x329ae7[_0xc05f('0x14')](0xcc)[_0xc05f('0x15')]();});}};}function handleEntityNotFound(_0x3d6aa7,_0x365cee){return function(_0x5dbf2d){if(!_0x5dbf2d){_0x3d6aa7[_0xc05f('0x22')](0x194);}return _0x5dbf2d;};}function handleError(_0x4ee290,_0x11228c){_0x11228c=_0x11228c||0x1f4;return function(_0x168d27){logger[_0xc05f('0x23')](_0x168d27['stack']);if(_0x168d27['name']){delete _0x168d27[_0xc05f('0x24')];}_0x4ee290['status'](_0x11228c)[_0xc05f('0x25')](_0x168d27);};}exports[_0xc05f('0x26')]=function(_0x362a45,_0x92aef2){var _0x5523f5={},_0x304a1e={},_0x48a9cd={'count':0x0,'rows':[]};var _0x3fc441=_['map'](db[_0xc05f('0x27')][_0xc05f('0x28')],function(_0x459ad3){return{'name':_0x459ad3[_0xc05f('0x29')],'type':_0x459ad3[_0xc05f('0x2a')][_0xc05f('0x2b')]};});_0x304a1e['model']=_['map'](_0x3fc441,_0xc05f('0x24'));_0x304a1e[_0xc05f('0x2c')]=_[_0xc05f('0x2d')](_0x362a45[_0xc05f('0x2c')]);_0x304a1e[_0xc05f('0x2e')]=_['intersection'](_0x304a1e[_0xc05f('0x2f')],_0x304a1e[_0xc05f('0x2c')]);_0x5523f5[_0xc05f('0x30')]=_[_0xc05f('0x31')](_0x304a1e['model'],qs['fields'](_0x362a45[_0xc05f('0x2c')][_0xc05f('0x32')]));_0x5523f5['attributes']=_0x5523f5[_0xc05f('0x30')][_0xc05f('0x33')]?_0x5523f5[_0xc05f('0x30')]:_0x304a1e[_0xc05f('0x2f')];if(!_0x362a45[_0xc05f('0x2c')]['hasOwnProperty']('nolimit')){_0x5523f5[_0xc05f('0x18')]=qs[_0xc05f('0x18')](_0x362a45['query'][_0xc05f('0x18')]);_0x5523f5['offset']=qs['offset'](_0x362a45['query'][_0xc05f('0x17')]);}_0x5523f5[_0xc05f('0x34')]=qs['sort'](_0x362a45[_0xc05f('0x2c')]['sort']);_0x5523f5[_0xc05f('0x35')]=qs[_0xc05f('0x2e')](_[_0xc05f('0x36')](_0x362a45[_0xc05f('0x2c')],_0x304a1e[_0xc05f('0x2e')]),_0x3fc441);if(_0x362a45[_0xc05f('0x2c')]['filter']){_0x5523f5[_0xc05f('0x35')]=_[_0xc05f('0x37')](_0x5523f5['where'],{'$or':_['map'](_0x3fc441,function(_0x2a83de){if(_0x2a83de[_0xc05f('0x2a')]!==_0xc05f('0x38')){var _0x2d9478={};_0x2d9478[_0x2a83de[_0xc05f('0x24')]]={'$like':'%'+_0x362a45['query']['filter']+'%'};return _0x2d9478;}})});}_0x5523f5=_[_0xc05f('0x37')]({},_0x5523f5,_0x362a45['options']);var _0x40077f={'where':_0x5523f5['where']};return db[_0xc05f('0x27')][_0xc05f('0x1a')](_0x40077f)[_0xc05f('0x21')](function(_0x4ad80a){_0x48a9cd[_0xc05f('0x1a')]=_0x4ad80a;if(_0x362a45[_0xc05f('0x2c')]['includeAll']){_0x5523f5[_0xc05f('0x39')]=[{'all':!![]}];}return db['DeskAccount'][_0xc05f('0x3a')](_0x5523f5);})[_0xc05f('0x21')](function(_0x20a97f){_0x48a9cd[_0xc05f('0x3b')]=_0x20a97f;return _0x48a9cd;})[_0xc05f('0x21')](respondWithFilteredResult(_0x92aef2,_0x5523f5))[_0xc05f('0x3c')](handleError(_0x92aef2,null));};exports[_0xc05f('0x3d')]=function(_0x589852,_0x69105c){var _0x541e33={'raw':![],'where':{'id':_0x589852[_0xc05f('0x3e')]['id']}},_0x193da5={};_0x193da5[_0xc05f('0x2f')]=_[_0xc05f('0x2d')](db['DeskAccount']['rawAttributes']);_0x193da5[_0xc05f('0x2c')]=_[_0xc05f('0x2d')](_0x589852['query']);_0x193da5['filters']=_[_0xc05f('0x31')](_0x193da5[_0xc05f('0x2f')],_0x193da5['query']);_0x541e33[_0xc05f('0x30')]=_[_0xc05f('0x31')](_0x193da5[_0xc05f('0x2f')],qs[_0xc05f('0x32')](_0x589852[_0xc05f('0x2c')][_0xc05f('0x32')]));_0x541e33[_0xc05f('0x30')]=_0x541e33[_0xc05f('0x30')][_0xc05f('0x33')]?_0x541e33[_0xc05f('0x30')]:_0x193da5[_0xc05f('0x2f')];if(_0x589852[_0xc05f('0x2c')][_0xc05f('0x3f')]){_0x541e33['include']=[{'all':!![]}];}_0x541e33=_[_0xc05f('0x37')]({},_0x541e33,_0x589852[_0xc05f('0x40')]);return db['DeskAccount']['find'](_0x541e33)[_0xc05f('0x21')](handleEntityNotFound(_0x69105c,null))['then'](respondWithResult(_0x69105c,null))[_0xc05f('0x3c')](handleError(_0x69105c,null));};exports[_0xc05f('0x41')]=function(_0x47ea76,_0x4a19f2){return db[_0xc05f('0x27')][_0xc05f('0x41')](_0x47ea76[_0xc05f('0x42')],{})[_0xc05f('0x21')](respondWithResult(_0x4a19f2,0xc9))['catch'](handleError(_0x4a19f2,null));};exports[_0xc05f('0x1f')]=function(_0x3951ff,_0x259d96){if(_0x3951ff[_0xc05f('0x42')]['id']){delete _0x3951ff['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x3951ff[_0xc05f('0x3e')]['id']}})[_0xc05f('0x21')](handleEntityNotFound(_0x259d96,null))[_0xc05f('0x21')](saveUpdates(_0x3951ff[_0xc05f('0x42')],null))[_0xc05f('0x21')](respondWithResult(_0x259d96,null))[_0xc05f('0x3c')](handleError(_0x259d96,null));};exports[_0xc05f('0x20')]=function(_0x1432f9,_0x2df91f){return db[_0xc05f('0x27')]['find']({'where':{'id':_0x1432f9[_0xc05f('0x3e')]['id']}})[_0xc05f('0x21')](handleEntityNotFound(_0x2df91f,null))['then'](removeEntity(_0x2df91f,null))[_0xc05f('0x3c')](handleError(_0x2df91f,null));};exports[_0xc05f('0x43')]=function(_0x56e658,_0x21cc67,_0x17f068){var _0x4dd0a6={};var _0x142063={};var _0x13d730;var _0x58519e;return db[_0xc05f('0x27')][_0xc05f('0x44')]({'where':{'id':_0x56e658[_0xc05f('0x3e')]['id']}})[_0xc05f('0x21')](handleEntityNotFound(_0x21cc67,null))['then'](function(_0x32b780){if(_0x32b780){_0x13d730=_0x32b780;_0x142063[_0xc05f('0x2f')]=_['keys'](db[_0xc05f('0x45')][_0xc05f('0x28')]);_0x142063['query']=_[_0xc05f('0x2d')](_0x56e658[_0xc05f('0x2c')]);_0x142063[_0xc05f('0x2e')]=_[_0xc05f('0x31')](_0x142063[_0xc05f('0x2f')],_0x142063['query']);_0x4dd0a6[_0xc05f('0x30')]=_[_0xc05f('0x31')](_0x142063['model'],qs[_0xc05f('0x32')](_0x56e658[_0xc05f('0x2c')][_0xc05f('0x32')]));_0x4dd0a6[_0xc05f('0x30')]=_0x4dd0a6[_0xc05f('0x30')][_0xc05f('0x33')]?_0x4dd0a6[_0xc05f('0x30')]:_0x142063[_0xc05f('0x2f')];_0x4dd0a6[_0xc05f('0x34')]=qs[_0xc05f('0x46')](_0x56e658[_0xc05f('0x2c')][_0xc05f('0x46')]);_0x4dd0a6[_0xc05f('0x35')]=qs[_0xc05f('0x2e')](_[_0xc05f('0x36')](_0x56e658['query'],_0x142063['filters']));if(_0x56e658[_0xc05f('0x2c')][_0xc05f('0x47')]){_0x4dd0a6[_0xc05f('0x35')]=_[_0xc05f('0x37')](_0x4dd0a6[_0xc05f('0x35')],{'$or':_[_0xc05f('0x48')](_0x4dd0a6['attributes'],function(_0x539826){var _0x216699={};_0x216699[_0x539826]={'$like':'%'+_0x56e658['query']['filter']+'%'};return _0x216699;})});}_0x4dd0a6=_[_0xc05f('0x37')]({},_0x4dd0a6,_0x56e658['options']);return _0x13d730[_0xc05f('0x43')](_0x4dd0a6);}})['then'](function(_0x185d98){if(_0x185d98){_0x58519e=_0x185d98['length'];if(!_0x56e658['query']['hasOwnProperty'](_0xc05f('0x49'))){_0x4dd0a6[_0xc05f('0x18')]=qs['limit'](_0x56e658[_0xc05f('0x2c')][_0xc05f('0x18')]);_0x4dd0a6[_0xc05f('0x17')]=qs[_0xc05f('0x17')](_0x56e658[_0xc05f('0x2c')][_0xc05f('0x17')]);}return _0x13d730[_0xc05f('0x43')](_0x4dd0a6);}})['then'](function(_0x29ee81){if(_0x29ee81){return _0x29ee81?{'count':_0x58519e,'rows':_0x29ee81}:null;}})[_0xc05f('0x21')](respondWithResult(_0x21cc67,null))['catch'](handleError(_0x21cc67,null));};exports[_0xc05f('0x4a')]=function(_0x27251f,_0x256c30,_0x439050){if(_0x27251f[_0xc05f('0x42')]['id']){delete _0x27251f['body']['id'];}return db['DeskAccount'][_0xc05f('0x44')]({'where':{'id':_0x27251f[_0xc05f('0x3e')]['id']}})[_0xc05f('0x21')](handleEntityNotFound(_0x256c30,null))[_0xc05f('0x21')](function(_0x3da1f9){if(_0x3da1f9){_0x27251f[_0xc05f('0x42')][_0xc05f('0x4b')]=_0x3da1f9['id'];_0x27251f['body'][_0xc05f('0x4c')]=integrations[_0xc05f('0x4d')](_0x27251f[_0xc05f('0x42')][_0xc05f('0x4e')],_0x27251f[_0xc05f('0x42')][_0xc05f('0x2a')]);_0x27251f[_0xc05f('0x42')][_0xc05f('0x4f')]=integrations[_0xc05f('0x50')](_0x27251f[_0xc05f('0x42')]['channel'],_0x27251f[_0xc05f('0x42')][_0xc05f('0x2a')]);return db[_0xc05f('0x45')][_0xc05f('0x41')](_0x27251f[_0xc05f('0x42')],{'include':[{'model':db['DeskField'],'as':_0xc05f('0x4c')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xc05f('0x21')](respondWithResult(_0x256c30,null))[_0xc05f('0x3c')](handleError(_0x256c30,null));};exports[_0xc05f('0x51')]=function(_0x3c017e,_0x1b747c,_0x2d772){var _0x50b6a1=[{'name':_0xc05f('0x52'),'label':_0xc05f('0x52'),'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 _0x196a58='';return db['DeskAccount']['findOne']({'where':{'id':_0x3c017e['params']['id']},'attributes':['id',_0xc05f('0x53'),_0xc05f('0x54'),_0xc05f('0x55'),_0xc05f('0x56'),'consumerKey',_0xc05f('0x57'),_0xc05f('0x58'),_0xc05f('0x59')]})[_0xc05f('0x21')](handleEntityNotFound(_0x1b747c,null))[_0xc05f('0x21')](function(_0x158d0a){if(_0x158d0a){_0x196a58=_0x158d0a[_0xc05f('0x53')];var _0x490ddd=_0x196a58[_0xc05f('0x5a')](-0x1);if(_0x490ddd==='/'){_0x196a58=_0x196a58[_0xc05f('0x5b')](0x0,_0x196a58[_0xc05f('0x5c')](_0x490ddd));}var _0x48b8b8={'method':_0xc05f('0x5d'),'uri':util[_0xc05f('0x5e')]('%s/custom_fields',_0x196a58),'headers':{'Content-Type':_0xc05f('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x158d0a[_0xc05f('0x54')]==='basic'){_0x48b8b8[_0xc05f('0x60')][_0xc05f('0x61')]=util[_0xc05f('0x5e')](_0xc05f('0x62'),new Buffer(util['format']('%s:%s',_0x158d0a[_0xc05f('0x55')],_0x158d0a['password']))[_0xc05f('0x63')](_0xc05f('0x64')));}return rp(_0x48b8b8)['then'](function(_0x457fee){return _0x50b6a1[_0xc05f('0x65')](_[_0xc05f('0x48')](_0x457fee[_0xc05f('0x66')][_0xc05f('0x67')],function(_0x59d218){return{'id':_0x59d218['name'],'name':_0x59d218[_0xc05f('0x24')],'type':_0x59d218[_0xc05f('0x2a')],'active':_0x59d218[_0xc05f('0x68')],'label':_0x59d218[_0xc05f('0x69')],'custom':!![]};}));});}})['then'](function(_0x3e325f){return{'count':_0x3e325f['length'],'rows':_0x3e325f};})[_0xc05f('0x21')](respondWithResult(_0x1b747c,null))[_0xc05f('0x3c')](function(_0x463a39){var _0x2bb544=_0x3c017e[_0xc05f('0x2c')][_0xc05f('0x6a')]?0x1f4:_0x463a39[_0xc05f('0x6b')]||0x1f4;logger['error'](_0xc05f('0x6c'),_0xc05f('0x51'),_0x2bb544,JSON[_0xc05f('0x6d')](_0x463a39));delete _0x463a39[_0xc05f('0x24')];if(_0x2bb544===0x191){_0x2bb544=0x190;}_0x1b747c[_0xc05f('0x14')](_0x2bb544)[_0xc05f('0x25')](_0x3c017e[_0xc05f('0x2c')][_0xc05f('0x6a')]?{'message':_0xc05f('0x6e'),'statusCode':_0x463a39['statusCode']}:_0x463a39);});}; \ No newline at end of file +var _0x55a8=['find','create','body','catch','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','username','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','authType','basic','headers','Authorization','Basic\x20%s','password','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','path','sox','to-csv','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','DeskAccount','findAll','then','rows','show','params','include'];(function(_0x4888fe,_0x26aadb){var _0x35a58f=function(_0x4fda8d){while(--_0x4fda8d){_0x4888fe['push'](_0x4888fe['shift']());}};_0x35a58f(++_0x26aadb);}(_0x55a8,0x109));var _0x855a=function(_0xe7310,_0x259182){_0xe7310=_0xe7310-0x0;var _0x46a601=_0x55a8[_0xe7310];return _0x46a601;};'use strict';var emlformat=require(_0x855a('0x0'));var rimraf=require(_0x855a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x855a('0x2'));var BPromise=require(_0x855a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x855a('0x4'));var sox=require(_0x855a('0x5'));var csv=require(_0x855a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x855a('0x7'));var squel=require('squel');var crypto=require(_0x855a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x855a('0x9'));var toCsv=require(_0x855a('0x6'));var querystring=require('querystring');var Papa=require(_0x855a('0xa'));var Redis=require('ioredis');var authService=require(_0x855a('0xb'));var qs=require(_0x855a('0xc'));var as=require(_0x855a('0xd'));var hardwareService=require(_0x855a('0xe'));var logger=require('../../config/logger')(_0x855a('0xf'));var utils=require(_0x855a('0x10'));var config=require(_0x855a('0x11'));var licenseUtil=require(_0x855a('0x12'));var db=require(_0x855a('0x13'))['db'];var integrations=require(_0x855a('0x14'));function respondWithStatusCode(_0x354579,_0x38a0d8){_0x38a0d8=_0x38a0d8||0xcc;return function(_0x3d9094){if(_0x3d9094){return _0x354579['sendStatus'](_0x38a0d8);}return _0x354579[_0x855a('0x15')](_0x38a0d8)[_0x855a('0x16')]();};}function respondWithResult(_0xad1c0,_0x3fc2fb){_0x3fc2fb=_0x3fc2fb||0xc8;return function(_0x545a77){if(_0x545a77){return _0xad1c0[_0x855a('0x15')](_0x3fc2fb)[_0x855a('0x17')](_0x545a77);}};}function respondWithFilteredResult(_0x1a6463,_0x5112da){return function(_0x16d955){if(_0x16d955){var _0x14b8ed=typeof _0x5112da[_0x855a('0x18')]==='undefined'&&typeof _0x5112da[_0x855a('0x19')]==='undefined';var _0x4f821b=_0x16d955[_0x855a('0x1a')];var _0x3d2651=_0x14b8ed?0x0:_0x5112da[_0x855a('0x18')];var _0x13e142=_0x14b8ed?_0x16d955['count']:_0x5112da['offset']+_0x5112da[_0x855a('0x19')];var _0x2e0d7b;if(_0x13e142>=_0x4f821b){_0x13e142=_0x4f821b;_0x2e0d7b=0xc8;}else{_0x2e0d7b=0xce;}_0x1a6463[_0x855a('0x15')](_0x2e0d7b);return _0x1a6463[_0x855a('0x1b')]('Content-Range',_0x3d2651+'-'+_0x13e142+'/'+_0x4f821b)['json'](_0x16d955);}return null;};}function patchUpdates(_0x81e5f1){return function(_0x41621f){try{jsonpatch[_0x855a('0x1c')](_0x41621f,_0x81e5f1,!![]);}catch(_0x1a1cd7){return BPromise[_0x855a('0x1d')](_0x1a1cd7);}return _0x41621f[_0x855a('0x1e')]();};}function saveUpdates(_0x19a5ad,_0x3e6328){return function(_0x2c5c49){if(_0x2c5c49){return _0x2c5c49[_0x855a('0x1f')](_0x19a5ad)['then'](function(_0xc8768c){return _0xc8768c;});}return null;};}function removeEntity(_0x32f7e4,_0x3c5416){return function(_0x309e41){if(_0x309e41){return _0x309e41[_0x855a('0x20')]()['then'](function(){_0x32f7e4[_0x855a('0x15')](0xcc)[_0x855a('0x16')]();});}};}function handleEntityNotFound(_0x5de713,_0x40e595){return function(_0x4ea418){if(!_0x4ea418){_0x5de713['sendStatus'](0x194);}return _0x4ea418;};}function handleError(_0x3c7326,_0x1fcf64){_0x1fcf64=_0x1fcf64||0x1f4;return function(_0x47a560){logger[_0x855a('0x21')](_0x47a560[_0x855a('0x22')]);if(_0x47a560[_0x855a('0x23')]){delete _0x47a560[_0x855a('0x23')];}_0x3c7326[_0x855a('0x15')](_0x1fcf64)[_0x855a('0x24')](_0x47a560);};}exports[_0x855a('0x25')]=function(_0x5120b5,_0x137ff7){var _0x4ebb0a={},_0x12edc4={},_0x218eee={'count':0x0,'rows':[]};var _0x8c57a2=_[_0x855a('0x26')](db['DeskAccount'][_0x855a('0x27')],function(_0x3abae7){return{'name':_0x3abae7[_0x855a('0x28')],'type':_0x3abae7[_0x855a('0x29')][_0x855a('0x2a')]};});_0x12edc4[_0x855a('0x2b')]=_[_0x855a('0x26')](_0x8c57a2,_0x855a('0x23'));_0x12edc4['query']=_[_0x855a('0x2c')](_0x5120b5[_0x855a('0x2d')]);_0x12edc4[_0x855a('0x2e')]=_[_0x855a('0x2f')](_0x12edc4[_0x855a('0x2b')],_0x12edc4[_0x855a('0x2d')]);_0x4ebb0a['attributes']=_[_0x855a('0x2f')](_0x12edc4['model'],qs[_0x855a('0x30')](_0x5120b5[_0x855a('0x2d')][_0x855a('0x30')]));_0x4ebb0a['attributes']=_0x4ebb0a[_0x855a('0x31')][_0x855a('0x32')]?_0x4ebb0a[_0x855a('0x31')]:_0x12edc4[_0x855a('0x2b')];if(!_0x5120b5[_0x855a('0x2d')]['hasOwnProperty'](_0x855a('0x33'))){_0x4ebb0a[_0x855a('0x19')]=qs[_0x855a('0x19')](_0x5120b5[_0x855a('0x2d')]['limit']);_0x4ebb0a[_0x855a('0x18')]=qs[_0x855a('0x18')](_0x5120b5['query']['offset']);}_0x4ebb0a[_0x855a('0x34')]=qs['sort'](_0x5120b5[_0x855a('0x2d')][_0x855a('0x35')]);_0x4ebb0a[_0x855a('0x36')]=qs['filters'](_[_0x855a('0x37')](_0x5120b5[_0x855a('0x2d')],_0x12edc4['filters']),_0x8c57a2);if(_0x5120b5[_0x855a('0x2d')][_0x855a('0x38')]){_0x4ebb0a[_0x855a('0x36')]=_[_0x855a('0x39')](_0x4ebb0a[_0x855a('0x36')],{'$or':_[_0x855a('0x26')](_0x8c57a2,function(_0x234f6e){if(_0x234f6e['type']!==_0x855a('0x3a')){var _0x1c80f7={};_0x1c80f7[_0x234f6e[_0x855a('0x23')]]={'$like':'%'+_0x5120b5[_0x855a('0x2d')]['filter']+'%'};return _0x1c80f7;}})});}_0x4ebb0a=_[_0x855a('0x39')]({},_0x4ebb0a,_0x5120b5[_0x855a('0x3b')]);var _0x40fcf8={'where':_0x4ebb0a[_0x855a('0x36')]};return db['DeskAccount'][_0x855a('0x1a')](_0x40fcf8)['then'](function(_0x45fe57){_0x218eee[_0x855a('0x1a')]=_0x45fe57;if(_0x5120b5[_0x855a('0x2d')][_0x855a('0x3c')]){_0x4ebb0a['include']=[{'all':!![]}];}return db[_0x855a('0x3d')][_0x855a('0x3e')](_0x4ebb0a);})[_0x855a('0x3f')](function(_0x304c03){_0x218eee[_0x855a('0x40')]=_0x304c03;return _0x218eee;})[_0x855a('0x3f')](respondWithFilteredResult(_0x137ff7,_0x4ebb0a))['catch'](handleError(_0x137ff7,null));};exports[_0x855a('0x41')]=function(_0xc869e6,_0x12d02d){var _0xa852bd={'raw':![],'where':{'id':_0xc869e6[_0x855a('0x42')]['id']}},_0x252567={};_0x252567['model']=_['keys'](db[_0x855a('0x3d')][_0x855a('0x27')]);_0x252567[_0x855a('0x2d')]=_[_0x855a('0x2c')](_0xc869e6['query']);_0x252567['filters']=_[_0x855a('0x2f')](_0x252567['model'],_0x252567['query']);_0xa852bd['attributes']=_['intersection'](_0x252567['model'],qs['fields'](_0xc869e6[_0x855a('0x2d')][_0x855a('0x30')]));_0xa852bd[_0x855a('0x31')]=_0xa852bd[_0x855a('0x31')][_0x855a('0x32')]?_0xa852bd[_0x855a('0x31')]:_0x252567[_0x855a('0x2b')];if(_0xc869e6[_0x855a('0x2d')][_0x855a('0x3c')]){_0xa852bd[_0x855a('0x43')]=[{'all':!![]}];}_0xa852bd=_[_0x855a('0x39')]({},_0xa852bd,_0xc869e6['options']);return db[_0x855a('0x3d')][_0x855a('0x44')](_0xa852bd)['then'](handleEntityNotFound(_0x12d02d,null))[_0x855a('0x3f')](respondWithResult(_0x12d02d,null))['catch'](handleError(_0x12d02d,null));};exports[_0x855a('0x45')]=function(_0x1cb38f,_0x241b0c){return db['DeskAccount'][_0x855a('0x45')](_0x1cb38f[_0x855a('0x46')],{})['then'](respondWithResult(_0x241b0c,0xc9))[_0x855a('0x47')](handleError(_0x241b0c,null));};exports['update']=function(_0x390e2c,_0x19ae05){if(_0x390e2c[_0x855a('0x46')]['id']){delete _0x390e2c[_0x855a('0x46')]['id'];}return db[_0x855a('0x3d')][_0x855a('0x44')]({'where':{'id':_0x390e2c[_0x855a('0x42')]['id']}})[_0x855a('0x3f')](handleEntityNotFound(_0x19ae05,null))[_0x855a('0x3f')](saveUpdates(_0x390e2c[_0x855a('0x46')],null))['then'](respondWithResult(_0x19ae05,null))[_0x855a('0x47')](handleError(_0x19ae05,null));};exports[_0x855a('0x20')]=function(_0xb05b56,_0x9b8985){return db[_0x855a('0x3d')][_0x855a('0x44')]({'where':{'id':_0xb05b56[_0x855a('0x42')]['id']}})['then'](handleEntityNotFound(_0x9b8985,null))[_0x855a('0x3f')](removeEntity(_0x9b8985,null))[_0x855a('0x47')](handleError(_0x9b8985,null));};exports[_0x855a('0x48')]=function(_0x15fd8e,_0x2cbc2e,_0x2ae7c1){var _0xf67d31={};var _0xbebb76={};var _0xe1bb95;var _0x2d1c67;return db[_0x855a('0x3d')][_0x855a('0x49')]({'where':{'id':_0x15fd8e[_0x855a('0x42')]['id']}})[_0x855a('0x3f')](handleEntityNotFound(_0x2cbc2e,null))[_0x855a('0x3f')](function(_0x5aa98a){if(_0x5aa98a){_0xe1bb95=_0x5aa98a;_0xbebb76[_0x855a('0x2b')]=_[_0x855a('0x2c')](db['DeskConfiguration']['rawAttributes']);_0xbebb76[_0x855a('0x2d')]=_[_0x855a('0x2c')](_0x15fd8e[_0x855a('0x2d')]);_0xbebb76[_0x855a('0x2e')]=_[_0x855a('0x2f')](_0xbebb76[_0x855a('0x2b')],_0xbebb76[_0x855a('0x2d')]);_0xf67d31['attributes']=_[_0x855a('0x2f')](_0xbebb76[_0x855a('0x2b')],qs[_0x855a('0x30')](_0x15fd8e[_0x855a('0x2d')][_0x855a('0x30')]));_0xf67d31[_0x855a('0x31')]=_0xf67d31[_0x855a('0x31')][_0x855a('0x32')]?_0xf67d31[_0x855a('0x31')]:_0xbebb76[_0x855a('0x2b')];_0xf67d31['order']=qs[_0x855a('0x35')](_0x15fd8e[_0x855a('0x2d')]['sort']);_0xf67d31[_0x855a('0x36')]=qs['filters'](_['pick'](_0x15fd8e[_0x855a('0x2d')],_0xbebb76[_0x855a('0x2e')]));if(_0x15fd8e[_0x855a('0x2d')][_0x855a('0x38')]){_0xf67d31[_0x855a('0x36')]=_[_0x855a('0x39')](_0xf67d31[_0x855a('0x36')],{'$or':_[_0x855a('0x26')](_0xf67d31[_0x855a('0x31')],function(_0x8892b3){var _0x5d8ff0={};_0x5d8ff0[_0x8892b3]={'$like':'%'+_0x15fd8e[_0x855a('0x2d')][_0x855a('0x38')]+'%'};return _0x5d8ff0;})});}_0xf67d31=_[_0x855a('0x39')]({},_0xf67d31,_0x15fd8e[_0x855a('0x3b')]);return _0xe1bb95['getConfigurations'](_0xf67d31);}})[_0x855a('0x3f')](function(_0x458782){if(_0x458782){_0x2d1c67=_0x458782['length'];if(!_0x15fd8e[_0x855a('0x2d')]['hasOwnProperty'](_0x855a('0x33'))){_0xf67d31[_0x855a('0x19')]=qs[_0x855a('0x19')](_0x15fd8e[_0x855a('0x2d')][_0x855a('0x19')]);_0xf67d31[_0x855a('0x18')]=qs['offset'](_0x15fd8e[_0x855a('0x2d')][_0x855a('0x18')]);}return _0xe1bb95['getConfigurations'](_0xf67d31);}})[_0x855a('0x3f')](function(_0x13094b){if(_0x13094b){return _0x13094b?{'count':_0x2d1c67,'rows':_0x13094b}:null;}})[_0x855a('0x3f')](respondWithResult(_0x2cbc2e,null))[_0x855a('0x47')](handleError(_0x2cbc2e,null));};exports[_0x855a('0x4a')]=function(_0x14b27e,_0x551cab,_0x14ddd7){if(_0x14b27e[_0x855a('0x46')]['id']){delete _0x14b27e[_0x855a('0x46')]['id'];}return db[_0x855a('0x3d')][_0x855a('0x49')]({'where':{'id':_0x14b27e[_0x855a('0x42')]['id']}})[_0x855a('0x3f')](handleEntityNotFound(_0x551cab,null))[_0x855a('0x3f')](function(_0x1f0b2f){if(_0x1f0b2f){_0x14b27e[_0x855a('0x46')][_0x855a('0x4b')]=_0x1f0b2f['id'];_0x14b27e['body'][_0x855a('0x4c')]=integrations[_0x855a('0x4d')](_0x14b27e[_0x855a('0x46')][_0x855a('0x4e')],_0x14b27e[_0x855a('0x46')][_0x855a('0x29')]);_0x14b27e[_0x855a('0x46')][_0x855a('0x4f')]=integrations[_0x855a('0x50')](_0x14b27e['body'][_0x855a('0x4e')],_0x14b27e['body']['type']);return db[_0x855a('0x51')][_0x855a('0x45')](_0x14b27e[_0x855a('0x46')],{'include':[{'model':db[_0x855a('0x52')],'as':_0x855a('0x4c')},{'model':db['DeskField'],'as':_0x855a('0x4f')}]});}return null;})['then'](respondWithResult(_0x551cab,null))[_0x855a('0x47')](handleError(_0x551cab,null));};exports[_0x855a('0x53')]=function(_0x51ee64,_0x264d17,_0xa6fc82){var _0x408ac0=[{'name':_0x855a('0x54'),'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 _0x30bfb5='';return db['DeskAccount']['findOne']({'where':{'id':_0x51ee64['params']['id']},'attributes':['id','remoteUri','authType',_0x855a('0x55'),'password',_0x855a('0x56'),'consumerSecret',_0x855a('0x57'),_0x855a('0x58')]})[_0x855a('0x3f')](handleEntityNotFound(_0x264d17,null))[_0x855a('0x3f')](function(_0x5f18de){if(_0x5f18de){_0x30bfb5=_0x5f18de[_0x855a('0x59')];var _0x4b0f0b=_0x30bfb5[_0x855a('0x5a')](-0x1);if(_0x4b0f0b==='/'){_0x30bfb5=_0x30bfb5[_0x855a('0x5b')](0x0,_0x30bfb5[_0x855a('0x5c')](_0x4b0f0b));}var _0x2cde3e={'method':'GET','uri':util[_0x855a('0x5d')](_0x855a('0x5e'),_0x30bfb5),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x5f18de[_0x855a('0x5f')]===_0x855a('0x60')){_0x2cde3e[_0x855a('0x61')][_0x855a('0x62')]=util[_0x855a('0x5d')](_0x855a('0x63'),new Buffer(util[_0x855a('0x5d')]('%s:%s',_0x5f18de['username'],_0x5f18de[_0x855a('0x64')]))['toString'](_0x855a('0x65')));}return rp(_0x2cde3e)[_0x855a('0x3f')](function(_0xf9edb4){return _0x408ac0[_0x855a('0x66')](_[_0x855a('0x26')](_0xf9edb4[_0x855a('0x67')][_0x855a('0x68')],function(_0x3d7164){return{'id':_0x3d7164[_0x855a('0x23')],'name':_0x3d7164[_0x855a('0x23')],'type':_0x3d7164['type'],'active':_0x3d7164['active'],'label':_0x3d7164[_0x855a('0x69')],'custom':!![]};}));});}})[_0x855a('0x3f')](function(_0x33bfac){return{'count':_0x33bfac['length'],'rows':_0x33bfac};})[_0x855a('0x3f')](respondWithResult(_0x264d17,null))[_0x855a('0x47')](function(_0x434da0){var _0x4dbe3a=_0x51ee64[_0x855a('0x2d')][_0x855a('0x6a')]?0x1f4:_0x434da0[_0x855a('0x6b')]||0x1f4;logger[_0x855a('0x21')](_0x855a('0x6c'),_0x855a('0x53'),_0x4dbe3a,JSON[_0x855a('0x6d')](_0x434da0));delete _0x434da0[_0x855a('0x23')];if(_0x4dbe3a===0x191){_0x4dbe3a=0x190;}_0x264d17['status'](_0x4dbe3a)[_0x855a('0x24')](_0x51ee64['query']['test']?{'message':_0x855a('0x6e'),'statusCode':_0x434da0[_0x855a('0x6b')]}:_0x434da0);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 11302ab..1dddc62 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 _0x7b53=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x28268e,_0x4e55ba){var _0x52083e=function(_0x529a11){while(--_0x529a11){_0x28268e['push'](_0x28268e['shift']());}};_0x52083e(++_0x4e55ba);}(_0x7b53,0x1b8));var _0x37b5=function(_0x595467,_0x1bc9bc){_0x595467=_0x595467-0x0;var _0x2e7ffc=_0x7b53[_0x595467];return _0x2e7ffc;};'use strict';var _=require(_0x37b5('0x0'));var util=require(_0x37b5('0x1'));var logger=require(_0x37b5('0x2'))(_0x37b5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x37b5('0x4'));var fs=require('fs');var path=require(_0x37b5('0x5'));var rimraf=require(_0x37b5('0x6'));var config=require(_0x37b5('0x7'));var attributes=require(_0x37b5('0x8'));var integrations=require(_0x37b5('0x9'));module['exports']=function(_0x259956,_0x1434a1){return _0x259956[_0x37b5('0xa')](_0x37b5('0xb'),attributes,{'tableName':_0x37b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe93b=['../../config/environment','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f5303,_0x354414){var _0x84ef1a=function(_0x27e275){while(--_0x27e275){_0x1f5303['push'](_0x1f5303['shift']());}};_0x84ef1a(++_0x354414);}(_0xe93b,0x188));var _0xbe93=function(_0x4a87d3,_0x30fe31){_0x4a87d3=_0x4a87d3-0x0;var _0x1fe679=_0xe93b[_0x4a87d3];return _0x1fe679;};'use strict';var _=require(_0xbe93('0x0'));var util=require(_0xbe93('0x1'));var logger=require('../../config/logger')(_0xbe93('0x2'));var moment=require(_0xbe93('0x3'));var BPromise=require(_0xbe93('0x4'));var rp=require(_0xbe93('0x5'));var fs=require('fs');var path=require(_0xbe93('0x6'));var rimraf=require(_0xbe93('0x7'));var config=require(_0xbe93('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x50f631,_0x453e97){return _0x50f631[_0xbe93('0x9')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 3ba12fc..edee7ee 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 _0x59a5=['../../config/environment','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowDeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x59a5,0x1c0));var _0x559a=function(_0x157ac6,_0xaa846f){_0x157ac6=_0x157ac6-0x0;var _0x4d586a=_0x59a5[_0x157ac6];return _0x4d586a;};'use strict';var _=require(_0x559a('0x0'));var util=require(_0x559a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x559a('0x2'));var fs=require('fs');var Redis=require(_0x559a('0x3'));var db=require(_0x559a('0x4'))['db'];var utils=require(_0x559a('0x5'));var logger=require('../../config/logger')(_0x559a('0x6'));var config=require(_0x559a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x559a('0x8')][_0x559a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a330e,_0x536bde,_0x527086){return new BPromise(function(_0x494da2,_0x59574b){return client[_0x559a('0xa')](_0x1a330e,_0x527086)[_0x559a('0xb')](function(_0x3c3ba1){logger['info'](_0x559a('0xc'),_0x536bde,_0x559a('0xd'));logger[_0x559a('0xe')](_0x559a('0xf'),_0x536bde,_0x559a('0xd'),JSON[_0x559a('0x10')](_0x3c3ba1));if(_0x3c3ba1[_0x559a('0x11')]){if(_0x3c3ba1[_0x559a('0x11')]['code']===0x1f4){logger[_0x559a('0x11')]('DeskAccount,\x20%s,\x20%s',_0x536bde,_0x3c3ba1[_0x559a('0x11')][_0x559a('0x12')]);return _0x59574b(_0x3c3ba1[_0x559a('0x11')][_0x559a('0x12')]);}logger[_0x559a('0x11')](_0x559a('0xc'),_0x536bde,_0x3c3ba1[_0x559a('0x11')][_0x559a('0x12')]);return _0x494da2(_0x3c3ba1['error'][_0x559a('0x12')]);}else{logger[_0x559a('0x13')]('DeskAccount,\x20%s,\x20%s',_0x536bde,_0x559a('0xd'));_0x494da2(_0x3c3ba1[_0x559a('0x14')]['message']);}})['catch'](function(_0x5ecaa9){logger[_0x559a('0x11')]('DeskAccount,\x20%s,\x20%s',_0x536bde,_0x5ecaa9);_0x59574b(_0x5ecaa9);});});}exports[_0x559a('0x15')]=function(_0x59363a){var _0x5552be=this;return new Promise(function(_0x3f1a1e,_0x3b7b5e){return db[_0x559a('0x16')][_0x559a('0x17')]({'raw':_0x59363a[_0x559a('0x18')]?_0x59363a['options'][_0x559a('0x19')]===undefined?!![]:![]:!![],'where':_0x59363a[_0x559a('0x18')]?_0x59363a[_0x559a('0x18')]['where']||null:null,'attributes':_0x59363a[_0x559a('0x18')]?_0x59363a[_0x559a('0x18')][_0x559a('0x1a')]||null:null,'limit':_0x59363a[_0x559a('0x18')]?_0x59363a[_0x559a('0x18')][_0x559a('0x1b')]||null:null,'include':_0x59363a['options']?_0x59363a[_0x559a('0x18')][_0x559a('0x1c')]?_['map'](_0x59363a['options'][_0x559a('0x1c')],function(_0x47386e){return{'model':db[_0x47386e['model']],'as':_0x47386e['as'],'attributes':_0x47386e['attributes'],'include':_0x47386e['include']?_[_0x559a('0x1d')](_0x47386e['include'],function(_0x2aaf17){return{'model':db[_0x2aaf17[_0x559a('0x1e')]],'as':_0x2aaf17['as'],'attributes':_0x2aaf17[_0x559a('0x1a')],'include':_0x2aaf17[_0x559a('0x1c')]?_[_0x559a('0x1d')](_0x2aaf17[_0x559a('0x1c')],function(_0x280852){return{'model':db[_0x280852[_0x559a('0x1e')]],'as':_0x280852['as'],'attributes':_0x280852[_0x559a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x559a('0xb')](function(_0x2adb26){logger[_0x559a('0x13')](_0x559a('0x15'),_0x59363a);logger['debug'](_0x559a('0x15'),_0x59363a,JSON[_0x559a('0x10')](_0x2adb26));_0x3f1a1e(_0x2adb26);})[_0x559a('0x1f')](function(_0x24ecc9){logger['error'](_0x559a('0x15'),_0x24ecc9[_0x559a('0x12')],_0x59363a);_0x3b7b5e(_0x5552be['error'](0x1f4,_0x24ecc9['message']));});});};exports['ShowDeskAccount']=function(_0xbe76ee){var _0x54b392=this;return new Promise(function(_0xc77e95,_0x265008){return db['DeskAccount'][_0x559a('0x20')]({'raw':_0xbe76ee[_0x559a('0x18')]?_0xbe76ee['options']['raw']===undefined?!![]:![]:!![],'where':_0xbe76ee[_0x559a('0x18')]?_0xbe76ee[_0x559a('0x18')][_0x559a('0x21')]||null:null,'attributes':_0xbe76ee[_0x559a('0x18')]?_0xbe76ee[_0x559a('0x18')][_0x559a('0x1a')]||null:null,'include':_0xbe76ee[_0x559a('0x18')]?_0xbe76ee[_0x559a('0x18')][_0x559a('0x1c')]?_[_0x559a('0x1d')](_0xbe76ee[_0x559a('0x18')][_0x559a('0x1c')],function(_0x3cbd1d){return{'model':db[_0x3cbd1d[_0x559a('0x1e')]],'as':_0x3cbd1d['as'],'attributes':_0x3cbd1d[_0x559a('0x1a')],'include':_0x3cbd1d['include']?_[_0x559a('0x1d')](_0x3cbd1d[_0x559a('0x1c')],function(_0x37a308){return{'model':db[_0x37a308[_0x559a('0x1e')]],'as':_0x37a308['as'],'attributes':_0x37a308[_0x559a('0x1a')],'include':_0x37a308['include']?_['map'](_0x37a308['include'],function(_0x3013d9){return{'model':db[_0x3013d9[_0x559a('0x1e')]],'as':_0x3013d9['as'],'attributes':_0x3013d9['attributes']};}):[]};}):[]};}):[]:[]})[_0x559a('0xb')](function(_0x4410bb){logger[_0x559a('0x13')](_0x559a('0x22'),_0xbe76ee);logger[_0x559a('0xe')]('ShowDeskAccount',_0xbe76ee,JSON[_0x559a('0x10')](_0x4410bb));_0xc77e95(_0x4410bb);})[_0x559a('0x1f')](function(_0x1750f9){logger[_0x559a('0x11')](_0x559a('0x22'),_0x1750f9[_0x559a('0x12')],_0xbe76ee);_0x265008(_0x54b392['error'](0x1f4,_0x1750f9[_0x559a('0x12')]));});});}; \ No newline at end of file +var _0x439a=['limit','include','model','map','ShowDeskAccount','find','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x439a,0x164));var _0xa439=function(_0x485038,_0x3e26e8){_0x485038=_0x485038-0x0;var _0xa87ace=_0x439a[_0x485038];return _0xa87ace;};'use strict';var _=require(_0xa439('0x0'));var util=require('util');var moment=require(_0xa439('0x1'));var BPromise=require(_0xa439('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa439('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa439('0x4'));var logger=require('../../config/logger')(_0xa439('0x5'));var config=require(_0xa439('0x6'));var jayson=require(_0xa439('0x7'));var client=jayson[_0xa439('0x8')][_0xa439('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a595b,_0x107b26,_0x202ba8){return new BPromise(function(_0x182ac1,_0x5e7db6){return client[_0xa439('0xa')](_0x2a595b,_0x202ba8)[_0xa439('0xb')](function(_0x1394ef){logger[_0xa439('0xc')](_0xa439('0xd'),_0x107b26,_0xa439('0xe'));logger[_0xa439('0xf')](_0xa439('0x10'),_0x107b26,_0xa439('0xe'),JSON[_0xa439('0x11')](_0x1394ef));if(_0x1394ef['error']){if(_0x1394ef[_0xa439('0x12')][_0xa439('0x13')]===0x1f4){logger[_0xa439('0x12')](_0xa439('0xd'),_0x107b26,_0x1394ef[_0xa439('0x12')][_0xa439('0x14')]);return _0x5e7db6(_0x1394ef[_0xa439('0x12')][_0xa439('0x14')]);}logger[_0xa439('0x12')](_0xa439('0xd'),_0x107b26,_0x1394ef['error'][_0xa439('0x14')]);return _0x182ac1(_0x1394ef[_0xa439('0x12')][_0xa439('0x14')]);}else{logger[_0xa439('0xc')](_0xa439('0xd'),_0x107b26,_0xa439('0xe'));_0x182ac1(_0x1394ef[_0xa439('0x15')][_0xa439('0x14')]);}})[_0xa439('0x16')](function(_0x37a97b){logger[_0xa439('0x12')](_0xa439('0xd'),_0x107b26,_0x37a97b);_0x5e7db6(_0x37a97b);});});}exports[_0xa439('0x17')]=function(_0x24801b){var _0x1b9397=this;return new Promise(function(_0x152dd1,_0xb4f435){return db[_0xa439('0x18')]['findAll']({'raw':_0x24801b['options']?_0x24801b[_0xa439('0x19')][_0xa439('0x1a')]===undefined?!![]:![]:!![],'where':_0x24801b[_0xa439('0x19')]?_0x24801b[_0xa439('0x19')][_0xa439('0x1b')]||null:null,'attributes':_0x24801b[_0xa439('0x19')]?_0x24801b[_0xa439('0x19')][_0xa439('0x1c')]||null:null,'limit':_0x24801b[_0xa439('0x19')]?_0x24801b[_0xa439('0x19')][_0xa439('0x1d')]||null:null,'include':_0x24801b['options']?_0x24801b[_0xa439('0x19')]['include']?_['map'](_0x24801b['options'][_0xa439('0x1e')],function(_0x230c0c){return{'model':db[_0x230c0c[_0xa439('0x1f')]],'as':_0x230c0c['as'],'attributes':_0x230c0c[_0xa439('0x1c')],'include':_0x230c0c[_0xa439('0x1e')]?_[_0xa439('0x20')](_0x230c0c[_0xa439('0x1e')],function(_0x32ffb1){return{'model':db[_0x32ffb1[_0xa439('0x1f')]],'as':_0x32ffb1['as'],'attributes':_0x32ffb1[_0xa439('0x1c')],'include':_0x32ffb1[_0xa439('0x1e')]?_[_0xa439('0x20')](_0x32ffb1['include'],function(_0x3b5fcb){return{'model':db[_0x3b5fcb[_0xa439('0x1f')]],'as':_0x3b5fcb['as'],'attributes':_0x3b5fcb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa439('0xb')](function(_0xd91ec1){logger[_0xa439('0xc')](_0xa439('0x17'),_0x24801b);logger[_0xa439('0xf')](_0xa439('0x17'),_0x24801b,JSON['stringify'](_0xd91ec1));_0x152dd1(_0xd91ec1);})['catch'](function(_0x1078cb){logger[_0xa439('0x12')](_0xa439('0x17'),_0x1078cb['message'],_0x24801b);_0xb4f435(_0x1b9397[_0xa439('0x12')](0x1f4,_0x1078cb[_0xa439('0x14')]));});});};exports[_0xa439('0x21')]=function(_0x3afa8b){var _0x3268ac=this;return new Promise(function(_0x419406,_0x39cfd4){return db[_0xa439('0x18')][_0xa439('0x22')]({'raw':_0x3afa8b['options']?_0x3afa8b[_0xa439('0x19')][_0xa439('0x1a')]===undefined?!![]:![]:!![],'where':_0x3afa8b[_0xa439('0x19')]?_0x3afa8b[_0xa439('0x19')][_0xa439('0x1b')]||null:null,'attributes':_0x3afa8b[_0xa439('0x19')]?_0x3afa8b[_0xa439('0x19')][_0xa439('0x1c')]||null:null,'include':_0x3afa8b[_0xa439('0x19')]?_0x3afa8b[_0xa439('0x19')][_0xa439('0x1e')]?_[_0xa439('0x20')](_0x3afa8b[_0xa439('0x19')][_0xa439('0x1e')],function(_0x2f128c){return{'model':db[_0x2f128c[_0xa439('0x1f')]],'as':_0x2f128c['as'],'attributes':_0x2f128c[_0xa439('0x1c')],'include':_0x2f128c['include']?_['map'](_0x2f128c[_0xa439('0x1e')],function(_0x358a83){return{'model':db[_0x358a83[_0xa439('0x1f')]],'as':_0x358a83['as'],'attributes':_0x358a83[_0xa439('0x1c')],'include':_0x358a83[_0xa439('0x1e')]?_[_0xa439('0x20')](_0x358a83[_0xa439('0x1e')],function(_0x13eda4){return{'model':db[_0x13eda4[_0xa439('0x1f')]],'as':_0x13eda4['as'],'attributes':_0x13eda4['attributes']};}):[]};}):[]};}):[]:[]})[_0xa439('0xb')](function(_0x4e2f4b){logger[_0xa439('0xc')]('ShowDeskAccount',_0x3afa8b);logger[_0xa439('0xf')]('ShowDeskAccount',_0x3afa8b,JSON[_0xa439('0x11')](_0x4e2f4b));_0x419406(_0x4e2f4b);})[_0xa439('0x16')](function(_0x5d72c5){logger[_0xa439('0x12')](_0xa439('0x21'),_0x5d72c5[_0xa439('0x14')],_0x3afa8b);_0x39cfd4(_0x3268ac['error'](0x1f4,_0x5d72c5[_0xa439('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a63c447..57e39e7 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 _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(_0x2a3f62,_0x1e11ea){var _0x129b02=function(_0x568a81){while(--_0x568a81){_0x2a3f62['push'](_0x2a3f62['shift']());}};_0x129b02(++_0x1e11ea);}(_0x34e8,0x12c));var _0x834e=function(_0x302faf,_0x370cdc){_0x302faf=_0x302faf-0x0;var _0x59083d=_0x34e8[_0x302faf];return _0x59083d;};'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 +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(_0x8330e6,_0x975b7){var _0x511354=function(_0x55e7e4){while(--_0x55e7e4){_0x8330e6['push'](_0x8330e6['shift']());}};_0x511354(++_0x975b7);}(_0x34e8,0x12c));var _0x834e=function(_0x426de4,_0x144552){_0x426de4=_0x426de4-0x0;var _0x170b20=_0x34e8[_0x426de4];return _0x170b20;};'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 b785841..80fedca 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 _0xdf3e=['sequelize','STRING'];(function(_0x7f37da,_0x30a906){var _0x474378=function(_0x5f0b57){while(--_0x5f0b57){_0x7f37da['push'](_0x7f37da['shift']());}};_0x474378(++_0x30a906);}(_0xdf3e,0x152));var _0xedf3=function(_0x287665,_0x1881f2){_0x287665=_0x287665-0x0;var _0x27b844=_0xdf3e[_0x287665];return _0x27b844;};'use strict';var Sequelize=require(_0xedf3('0x0'));module['exports']={'name':{'type':Sequelize[_0xedf3('0x1')]},'description':{'type':Sequelize[_0xedf3('0x1')]}}; \ No newline at end of file +var _0x57df=['STRING','sequelize','exports'];(function(_0x4aac9c,_0x14b664){var _0x3f9523=function(_0x4488dc){while(--_0x4488dc){_0x4aac9c['push'](_0x4aac9c['shift']());}};_0x3f9523(++_0x14b664);}(_0x57df,0xa9));var _0xf57d=function(_0x490e34,_0x3fe685){_0x490e34=_0x490e34-0x0;var _0x54d30b=_0x57df[_0x490e34];return _0x54d30b;};'use strict';var Sequelize=require(_0xf57d('0x0'));module[_0xf57d('0x1')]={'name':{'type':Sequelize[_0xf57d('0x2')]},'description':{'type':Sequelize[_0xf57d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7329028..85d64ff 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 _0xa53f=['bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','name','send','map','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll','include','DeskConfiguration','rows','catch','show','params','options','find','create','body','update','getFields','DeskField','rawAttributes','filter','getSubjects','findOne','hasOwnProperty','getDescriptions','getTags','Tag','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x100899,_0x4f7a01){var _0xa8738d=function(_0xcdda3e){while(--_0xcdda3e){_0x100899['push'](_0x100899['shift']());}};_0xa8738d(++_0x4f7a01);}(_0xa53f,0xf1));var _0xfa53=function(_0x3db00e,_0x56fa45){_0x3db00e=_0x3db00e-0x0;var _0x2be910=_0xa53f[_0x3db00e];return _0x2be910;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa53('0x0'));var zipdir=require(_0xfa53('0x1'));var jsonpatch=require(_0xfa53('0x2'));var rp=require(_0xfa53('0x3'));var moment=require(_0xfa53('0x4'));var BPromise=require(_0xfa53('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa53('0x6'));var sox=require(_0xfa53('0x7'));var csv=require(_0xfa53('0x8'));var ejs=require(_0xfa53('0x9'));var fs=require('fs');var fs_extra=require(_0xfa53('0xa'));var _=require(_0xfa53('0xb'));var squel=require(_0xfa53('0xc'));var crypto=require(_0xfa53('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfa53('0xe'));var toCsv=require(_0xfa53('0x8'));var querystring=require(_0xfa53('0xf'));var Papa=require(_0xfa53('0x10'));var Redis=require('ioredis');var authService=require(_0xfa53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfa53('0x12'));var hardwareService=require(_0xfa53('0x13'));var logger=require(_0xfa53('0x14'))(_0xfa53('0x15'));var utils=require('../../config/utils');var config=require(_0xfa53('0x16'));var licenseUtil=require(_0xfa53('0x17'));var db=require(_0xfa53('0x18'))['db'];function respondWithStatusCode(_0x34391a,_0x219df1){_0x219df1=_0x219df1||0xcc;return function(_0x35b701){if(_0x35b701){return _0x34391a[_0xfa53('0x19')](_0x219df1);}return _0x34391a[_0xfa53('0x1a')](_0x219df1)[_0xfa53('0x1b')]();};}function respondWithResult(_0xa41e8c,_0x3c37e0){_0x3c37e0=_0x3c37e0||0xc8;return function(_0xd51eba){if(_0xd51eba){return _0xa41e8c[_0xfa53('0x1a')](_0x3c37e0)[_0xfa53('0x1c')](_0xd51eba);}};}function respondWithFilteredResult(_0x3d09e7,_0x340d39){return function(_0x260e4c){if(_0x260e4c){var _0x3a0882=typeof _0x340d39['offset']==='undefined'&&typeof _0x340d39[_0xfa53('0x1d')]===_0xfa53('0x1e');var _0x590c1c=_0x260e4c[_0xfa53('0x1f')];var _0x2ff129=_0x3a0882?0x0:_0x340d39[_0xfa53('0x20')];var _0x5f1aac=_0x3a0882?_0x260e4c[_0xfa53('0x1f')]:_0x340d39[_0xfa53('0x20')]+_0x340d39[_0xfa53('0x1d')];var _0x2f0f08;if(_0x5f1aac>=_0x590c1c){_0x5f1aac=_0x590c1c;_0x2f0f08=0xc8;}else{_0x2f0f08=0xce;}_0x3d09e7[_0xfa53('0x1a')](_0x2f0f08);return _0x3d09e7[_0xfa53('0x21')](_0xfa53('0x22'),_0x2ff129+'-'+_0x5f1aac+'/'+_0x590c1c)[_0xfa53('0x1c')](_0x260e4c);}return null;};}function patchUpdates(_0x5501ba){return function(_0x223f60){try{jsonpatch[_0xfa53('0x23')](_0x223f60,_0x5501ba,!![]);}catch(_0x57d3a8){return BPromise[_0xfa53('0x24')](_0x57d3a8);}return _0x223f60['save']();};}function saveUpdates(_0x3fb718,_0x1bee77){return function(_0x1010f8){if(_0x1010f8){return _0x1010f8['update'](_0x3fb718)[_0xfa53('0x25')](function(_0x5a468){return _0x5a468;});}return null;};}function removeEntity(_0x50f2e3,_0x3d1841){return function(_0x56d26f){if(_0x56d26f){return _0x56d26f[_0xfa53('0x26')]()['then'](function(){_0x50f2e3[_0xfa53('0x1a')](0xcc)[_0xfa53('0x1b')]();});}};}function handleEntityNotFound(_0x20310a,_0x1baec2){return function(_0x233b18){if(!_0x233b18){_0x20310a[_0xfa53('0x19')](0x194);}return _0x233b18;};}function handleError(_0x38f0b4,_0x554538){_0x554538=_0x554538||0x1f4;return function(_0x3ae5c2){logger[_0xfa53('0x27')](_0x3ae5c2['stack']);if(_0x3ae5c2[_0xfa53('0x28')]){delete _0x3ae5c2[_0xfa53('0x28')];}_0x38f0b4[_0xfa53('0x1a')](_0x554538)[_0xfa53('0x29')](_0x3ae5c2);};}exports['index']=function(_0x661ff1,_0x328532){var _0x171a93={},_0x5b5ed5={},_0x3fde01={'count':0x0,'rows':[]};var _0x1f90d8=_[_0xfa53('0x2a')](db['DeskConfiguration']['rawAttributes'],function(_0x4396d1){return{'name':_0x4396d1['fieldName'],'type':_0x4396d1['type'][_0xfa53('0x2b')]};});_0x5b5ed5[_0xfa53('0x2c')]=_['map'](_0x1f90d8,_0xfa53('0x28'));_0x5b5ed5[_0xfa53('0x2d')]=_[_0xfa53('0x2e')](_0x661ff1['query']);_0x5b5ed5[_0xfa53('0x2f')]=_[_0xfa53('0x30')](_0x5b5ed5['model'],_0x5b5ed5[_0xfa53('0x2d')]);_0x171a93[_0xfa53('0x31')]=_['intersection'](_0x5b5ed5[_0xfa53('0x2c')],qs[_0xfa53('0x32')](_0x661ff1['query'][_0xfa53('0x32')]));_0x171a93[_0xfa53('0x31')]=_0x171a93[_0xfa53('0x31')][_0xfa53('0x33')]?_0x171a93[_0xfa53('0x31')]:_0x5b5ed5[_0xfa53('0x2c')];if(!_0x661ff1[_0xfa53('0x2d')]['hasOwnProperty'](_0xfa53('0x34'))){_0x171a93[_0xfa53('0x1d')]=qs[_0xfa53('0x1d')](_0x661ff1['query'][_0xfa53('0x1d')]);_0x171a93[_0xfa53('0x20')]=qs[_0xfa53('0x20')](_0x661ff1[_0xfa53('0x2d')][_0xfa53('0x20')]);}_0x171a93[_0xfa53('0x35')]=qs[_0xfa53('0x36')](_0x661ff1[_0xfa53('0x2d')][_0xfa53('0x36')]);_0x171a93[_0xfa53('0x37')]=qs[_0xfa53('0x2f')](_[_0xfa53('0x38')](_0x661ff1[_0xfa53('0x2d')],_0x5b5ed5[_0xfa53('0x2f')]),_0x1f90d8);if(_0x661ff1[_0xfa53('0x2d')]['filter']){_0x171a93[_0xfa53('0x37')]=_['merge'](_0x171a93[_0xfa53('0x37')],{'$or':_[_0xfa53('0x2a')](_0x1f90d8,function(_0x9df47c){if(_0x9df47c[_0xfa53('0x39')]!==_0xfa53('0x3a')){var _0x47076d={};_0x47076d[_0x9df47c['name']]={'$like':'%'+_0x661ff1[_0xfa53('0x2d')]['filter']+'%'};return _0x47076d;}})});}_0x171a93=_[_0xfa53('0x3b')]({},_0x171a93,_0x661ff1['options']);var _0xfe4a89={'where':_0x171a93['where']};return db['DeskConfiguration'][_0xfa53('0x1f')](_0xfe4a89)['then'](function(_0x38d91d){_0x3fde01[_0xfa53('0x1f')]=_0x38d91d;if(_0x661ff1[_0xfa53('0x2d')][_0xfa53('0x3c')]){_0x171a93[_0xfa53('0x3d')]=[{'all':!![]}];}return db[_0xfa53('0x3e')]['findAll'](_0x171a93);})[_0xfa53('0x25')](function(_0x2f7d13){_0x3fde01[_0xfa53('0x3f')]=_0x2f7d13;return _0x3fde01;})['then'](respondWithFilteredResult(_0x328532,_0x171a93))[_0xfa53('0x40')](handleError(_0x328532,null));};exports[_0xfa53('0x41')]=function(_0x4c606e,_0x1f258f){var _0x59a7f3={'raw':![],'where':{'id':_0x4c606e[_0xfa53('0x42')]['id']}},_0x230f2f={};_0x230f2f[_0xfa53('0x2c')]=_[_0xfa53('0x2e')](db[_0xfa53('0x3e')]['rawAttributes']);_0x230f2f[_0xfa53('0x2d')]=_[_0xfa53('0x2e')](_0x4c606e[_0xfa53('0x2d')]);_0x230f2f['filters']=_[_0xfa53('0x30')](_0x230f2f[_0xfa53('0x2c')],_0x230f2f[_0xfa53('0x2d')]);_0x59a7f3[_0xfa53('0x31')]=_[_0xfa53('0x30')](_0x230f2f[_0xfa53('0x2c')],qs[_0xfa53('0x32')](_0x4c606e[_0xfa53('0x2d')][_0xfa53('0x32')]));_0x59a7f3[_0xfa53('0x31')]=_0x59a7f3['attributes'][_0xfa53('0x33')]?_0x59a7f3[_0xfa53('0x31')]:_0x230f2f[_0xfa53('0x2c')];if(_0x4c606e['query']['includeAll']){_0x59a7f3[_0xfa53('0x3d')]=[{'all':!![]}];}_0x59a7f3=_[_0xfa53('0x3b')]({},_0x59a7f3,_0x4c606e[_0xfa53('0x43')]);return db[_0xfa53('0x3e')][_0xfa53('0x44')](_0x59a7f3)[_0xfa53('0x25')](handleEntityNotFound(_0x1f258f,null))[_0xfa53('0x25')](respondWithResult(_0x1f258f,null))[_0xfa53('0x40')](handleError(_0x1f258f,null));};exports[_0xfa53('0x45')]=function(_0x3d1de8,_0x55d1f9){return db[_0xfa53('0x3e')]['create'](_0x3d1de8[_0xfa53('0x46')],{})[_0xfa53('0x25')](respondWithResult(_0x55d1f9,0xc9))['catch'](handleError(_0x55d1f9,null));};exports[_0xfa53('0x47')]=function(_0x32fcd2,_0x1d2cf2){if(_0x32fcd2[_0xfa53('0x46')]['id']){delete _0x32fcd2['body']['id'];}return db[_0xfa53('0x3e')][_0xfa53('0x44')]({'where':{'id':_0x32fcd2[_0xfa53('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d2cf2,null))[_0xfa53('0x25')](saveUpdates(_0x32fcd2['body'],null))['then'](respondWithResult(_0x1d2cf2,null))['catch'](handleError(_0x1d2cf2,null));};exports[_0xfa53('0x26')]=function(_0xfd9b89,_0x24ad71){return db[_0xfa53('0x3e')]['find']({'where':{'id':_0xfd9b89[_0xfa53('0x42')]['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x24ad71,null))[_0xfa53('0x25')](removeEntity(_0x24ad71,null))[_0xfa53('0x40')](handleError(_0x24ad71,null));};exports[_0xfa53('0x48')]=function(_0x131349,_0x3d8dc9,_0x59fbf1){var _0x4b39bb={};var _0x11ea26={};var _0x4f0155;var _0x10eead;return db[_0xfa53('0x3e')]['findOne']({'where':{'id':_0x131349['params']['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x3d8dc9,null))[_0xfa53('0x25')](function(_0x4a5164){if(_0x4a5164){_0x4f0155=_0x4a5164;_0x11ea26[_0xfa53('0x2c')]=_[_0xfa53('0x2e')](db[_0xfa53('0x49')][_0xfa53('0x4a')]);_0x11ea26[_0xfa53('0x2d')]=_[_0xfa53('0x2e')](_0x131349[_0xfa53('0x2d')]);_0x11ea26[_0xfa53('0x2f')]=_[_0xfa53('0x30')](_0x11ea26['model'],_0x11ea26[_0xfa53('0x2d')]);_0x4b39bb[_0xfa53('0x31')]=_[_0xfa53('0x30')](_0x11ea26[_0xfa53('0x2c')],qs[_0xfa53('0x32')](_0x131349[_0xfa53('0x2d')][_0xfa53('0x32')]));_0x4b39bb[_0xfa53('0x31')]=_0x4b39bb[_0xfa53('0x31')][_0xfa53('0x33')]?_0x4b39bb[_0xfa53('0x31')]:_0x11ea26[_0xfa53('0x2c')];_0x4b39bb[_0xfa53('0x35')]=qs[_0xfa53('0x36')](_0x131349[_0xfa53('0x2d')][_0xfa53('0x36')]);_0x4b39bb[_0xfa53('0x37')]=qs[_0xfa53('0x2f')](_['pick'](_0x131349[_0xfa53('0x2d')],_0x11ea26[_0xfa53('0x2f')]));if(_0x131349[_0xfa53('0x2d')][_0xfa53('0x4b')]){_0x4b39bb[_0xfa53('0x37')]=_[_0xfa53('0x3b')](_0x4b39bb[_0xfa53('0x37')],{'$or':_[_0xfa53('0x2a')](_0x4b39bb[_0xfa53('0x31')],function(_0x52a46a){var _0x57dc46={};_0x57dc46[_0x52a46a]={'$like':'%'+_0x131349[_0xfa53('0x2d')][_0xfa53('0x4b')]+'%'};return _0x57dc46;})});}_0x4b39bb=_[_0xfa53('0x3b')]({},_0x4b39bb,_0x131349['options']);return _0x4f0155[_0xfa53('0x48')](_0x4b39bb);}})[_0xfa53('0x25')](function(_0xa5df42){if(_0xa5df42){_0x10eead=_0xa5df42[_0xfa53('0x33')];if(!_0x131349[_0xfa53('0x2d')]['hasOwnProperty']('nolimit')){_0x4b39bb[_0xfa53('0x1d')]=qs[_0xfa53('0x1d')](_0x131349[_0xfa53('0x2d')]['limit']);_0x4b39bb[_0xfa53('0x20')]=qs[_0xfa53('0x20')](_0x131349[_0xfa53('0x2d')][_0xfa53('0x20')]);}return _0x4f0155[_0xfa53('0x48')](_0x4b39bb);}})[_0xfa53('0x25')](function(_0x2b1e76){if(_0x2b1e76){return _0x2b1e76?{'count':_0x10eead,'rows':_0x2b1e76}:null;}})[_0xfa53('0x25')](respondWithResult(_0x3d8dc9,null))['catch'](handleError(_0x3d8dc9,null));};exports[_0xfa53('0x4c')]=function(_0x6901eb,_0x51abe2,_0x271589){var _0x45568c={};var _0x5089ce={};var _0x5806e7;var _0x5006a8;return db[_0xfa53('0x3e')][_0xfa53('0x4d')]({'where':{'id':_0x6901eb[_0xfa53('0x42')]['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x51abe2,null))['then'](function(_0x18cca1){if(_0x18cca1){_0x5806e7=_0x18cca1;_0x5089ce['model']=_[_0xfa53('0x2e')](db[_0xfa53('0x49')][_0xfa53('0x4a')]);_0x5089ce[_0xfa53('0x2d')]=_[_0xfa53('0x2e')](_0x6901eb[_0xfa53('0x2d')]);_0x5089ce[_0xfa53('0x2f')]=_[_0xfa53('0x30')](_0x5089ce[_0xfa53('0x2c')],_0x5089ce[_0xfa53('0x2d')]);_0x45568c[_0xfa53('0x31')]=_[_0xfa53('0x30')](_0x5089ce[_0xfa53('0x2c')],qs[_0xfa53('0x32')](_0x6901eb[_0xfa53('0x2d')][_0xfa53('0x32')]));_0x45568c['attributes']=_0x45568c['attributes'][_0xfa53('0x33')]?_0x45568c['attributes']:_0x5089ce[_0xfa53('0x2c')];_0x45568c['order']=qs[_0xfa53('0x36')](_0x6901eb[_0xfa53('0x2d')][_0xfa53('0x36')]);_0x45568c['where']=qs[_0xfa53('0x2f')](_[_0xfa53('0x38')](_0x6901eb[_0xfa53('0x2d')],_0x5089ce['filters']));if(_0x6901eb[_0xfa53('0x2d')]['filter']){_0x45568c['where']=_[_0xfa53('0x3b')](_0x45568c[_0xfa53('0x37')],{'$or':_[_0xfa53('0x2a')](_0x45568c[_0xfa53('0x31')],function(_0xf5224){var _0x3d75b9={};_0x3d75b9[_0xf5224]={'$like':'%'+_0x6901eb[_0xfa53('0x2d')][_0xfa53('0x4b')]+'%'};return _0x3d75b9;})});}_0x45568c=_[_0xfa53('0x3b')]({},_0x45568c,_0x6901eb[_0xfa53('0x43')]);return _0x5806e7['getSubjects'](_0x45568c);}})[_0xfa53('0x25')](function(_0x50af11){if(_0x50af11){_0x5006a8=_0x50af11[_0xfa53('0x33')];if(!_0x6901eb['query'][_0xfa53('0x4e')](_0xfa53('0x34'))){_0x45568c[_0xfa53('0x1d')]=qs[_0xfa53('0x1d')](_0x6901eb[_0xfa53('0x2d')][_0xfa53('0x1d')]);_0x45568c[_0xfa53('0x20')]=qs[_0xfa53('0x20')](_0x6901eb[_0xfa53('0x2d')]['offset']);}return _0x5806e7[_0xfa53('0x4c')](_0x45568c);}})[_0xfa53('0x25')](function(_0x4737c1){if(_0x4737c1){return _0x4737c1?{'count':_0x5006a8,'rows':_0x4737c1}:null;}})['then'](respondWithResult(_0x51abe2,null))['catch'](handleError(_0x51abe2,null));};exports[_0xfa53('0x4f')]=function(_0x374821,_0x16f7b9,_0x4f4bf5){var _0x30ad20={};var _0x4226ad={};var _0x456dca;var _0x283780;return db[_0xfa53('0x3e')][_0xfa53('0x4d')]({'where':{'id':_0x374821[_0xfa53('0x42')]['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x16f7b9,null))[_0xfa53('0x25')](function(_0x1d9282){if(_0x1d9282){_0x456dca=_0x1d9282;_0x4226ad[_0xfa53('0x2c')]=_[_0xfa53('0x2e')](db[_0xfa53('0x49')][_0xfa53('0x4a')]);_0x4226ad['query']=_[_0xfa53('0x2e')](_0x374821['query']);_0x4226ad[_0xfa53('0x2f')]=_['intersection'](_0x4226ad[_0xfa53('0x2c')],_0x4226ad[_0xfa53('0x2d')]);_0x30ad20['attributes']=_[_0xfa53('0x30')](_0x4226ad['model'],qs[_0xfa53('0x32')](_0x374821[_0xfa53('0x2d')][_0xfa53('0x32')]));_0x30ad20['attributes']=_0x30ad20[_0xfa53('0x31')][_0xfa53('0x33')]?_0x30ad20[_0xfa53('0x31')]:_0x4226ad[_0xfa53('0x2c')];_0x30ad20[_0xfa53('0x35')]=qs[_0xfa53('0x36')](_0x374821[_0xfa53('0x2d')][_0xfa53('0x36')]);_0x30ad20[_0xfa53('0x37')]=qs[_0xfa53('0x2f')](_[_0xfa53('0x38')](_0x374821[_0xfa53('0x2d')],_0x4226ad['filters']));if(_0x374821[_0xfa53('0x2d')][_0xfa53('0x4b')]){_0x30ad20[_0xfa53('0x37')]=_[_0xfa53('0x3b')](_0x30ad20[_0xfa53('0x37')],{'$or':_[_0xfa53('0x2a')](_0x30ad20['attributes'],function(_0x5c09fc){var _0x3f7372={};_0x3f7372[_0x5c09fc]={'$like':'%'+_0x374821[_0xfa53('0x2d')][_0xfa53('0x4b')]+'%'};return _0x3f7372;})});}_0x30ad20=_[_0xfa53('0x3b')]({},_0x30ad20,_0x374821['options']);return _0x456dca[_0xfa53('0x4f')](_0x30ad20);}})[_0xfa53('0x25')](function(_0x164624){if(_0x164624){_0x283780=_0x164624['length'];if(!_0x374821['query'][_0xfa53('0x4e')](_0xfa53('0x34'))){_0x30ad20[_0xfa53('0x1d')]=qs[_0xfa53('0x1d')](_0x374821['query'][_0xfa53('0x1d')]);_0x30ad20[_0xfa53('0x20')]=qs[_0xfa53('0x20')](_0x374821[_0xfa53('0x2d')][_0xfa53('0x20')]);}return _0x456dca[_0xfa53('0x4f')](_0x30ad20);}})[_0xfa53('0x25')](function(_0x5df593){if(_0x5df593){return _0x5df593?{'count':_0x283780,'rows':_0x5df593}:null;}})[_0xfa53('0x25')](respondWithResult(_0x16f7b9,null))[_0xfa53('0x40')](handleError(_0x16f7b9,null));};exports[_0xfa53('0x50')]=function(_0x4dbc71,_0x3d3530,_0x3fdc69){var _0x103a45={};var _0xebf83d={};var _0x39d18e;var _0x3519c7;return db[_0xfa53('0x3e')][_0xfa53('0x4d')]({'where':{'id':_0x4dbc71[_0xfa53('0x42')]['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x3d3530,null))['then'](function(_0x2791cd){if(_0x2791cd){_0x39d18e=_0x2791cd;_0xebf83d[_0xfa53('0x2c')]=_[_0xfa53('0x2e')](db[_0xfa53('0x51')][_0xfa53('0x4a')]);_0xebf83d[_0xfa53('0x2d')]=_[_0xfa53('0x2e')](_0x4dbc71['query']);_0xebf83d[_0xfa53('0x2f')]=_[_0xfa53('0x30')](_0xebf83d[_0xfa53('0x2c')],_0xebf83d[_0xfa53('0x2d')]);_0x103a45[_0xfa53('0x31')]=_[_0xfa53('0x30')](_0xebf83d[_0xfa53('0x2c')],qs[_0xfa53('0x32')](_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x32')]));_0x103a45[_0xfa53('0x31')]=_0x103a45[_0xfa53('0x31')]['length']?_0x103a45[_0xfa53('0x31')]:_0xebf83d[_0xfa53('0x2c')];_0x103a45['order']=qs[_0xfa53('0x36')](_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x36')]);_0x103a45[_0xfa53('0x37')]=qs['filters'](_[_0xfa53('0x38')](_0x4dbc71['query'],_0xebf83d[_0xfa53('0x2f')]));if(_0x4dbc71[_0xfa53('0x2d')]['filter']){_0x103a45['where']=_['merge'](_0x103a45[_0xfa53('0x37')],{'$or':_[_0xfa53('0x2a')](_0x103a45[_0xfa53('0x31')],function(_0x15cde9){var _0x1fd2f4={};_0x1fd2f4[_0x15cde9]={'$like':'%'+_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x4b')]+'%'};return _0x1fd2f4;})});}_0x103a45=_['merge']({},_0x103a45,_0x4dbc71[_0xfa53('0x43')]);return _0x39d18e[_0xfa53('0x50')](_0x103a45);}})[_0xfa53('0x25')](function(_0x396780){if(_0x396780){_0x3519c7=_0x396780[_0xfa53('0x33')];if(!_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x4e')](_0xfa53('0x34'))){_0x103a45['limit']=qs['limit'](_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x1d')]);_0x103a45[_0xfa53('0x20')]=qs[_0xfa53('0x20')](_0x4dbc71[_0xfa53('0x2d')][_0xfa53('0x20')]);}return _0x39d18e[_0xfa53('0x50')](_0x103a45);}})['then'](function(_0x4f88d4){if(_0x4f88d4){return _0x4f88d4?{'count':_0x3519c7,'rows':_0x4f88d4}:null;}})[_0xfa53('0x25')](respondWithResult(_0x3d3530,null))[_0xfa53('0x40')](handleError(_0x3d3530,null));};exports['setTags']=function(_0x220253,_0x316e93,_0x597e7b){if(_0x220253[_0xfa53('0x46')]['id']){delete _0x220253['body']['id'];}return db['DeskConfiguration'][_0xfa53('0x4d')]({'where':{'id':_0x220253[_0xfa53('0x42')]['id']}})[_0xfa53('0x25')](handleEntityNotFound(_0x316e93,null))['then'](function(_0x3014cd){if(_0x3014cd){return _0x3014cd['setTags'](_0x220253[_0xfa53('0x46')]['ids']||[]);}return null;})['then'](respondWithResult(_0x316e93,null))[_0xfa53('0x40')](handleError(_0x316e93,null));}; \ No newline at end of file +var _0x3c76=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','params','find','catch','create','body','getFields','DeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c76,0x9a));var _0x63c7=function(_0xb904df,_0x140597){_0xb904df=_0xb904df-0x0;var _0x147b38=_0x3c76[_0xb904df];return _0x147b38;};'use strict';var emlformat=require(_0x63c7('0x0'));var rimraf=require(_0x63c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63c7('0x2'));var rp=require(_0x63c7('0x3'));var moment=require(_0x63c7('0x4'));var BPromise=require(_0x63c7('0x5'));var Mustache=require(_0x63c7('0x6'));var util=require(_0x63c7('0x7'));var path=require(_0x63c7('0x8'));var sox=require('sox');var csv=require(_0x63c7('0x9'));var ejs=require(_0x63c7('0xa'));var fs=require('fs');var fs_extra=require(_0x63c7('0xb'));var _=require(_0x63c7('0xc'));var squel=require(_0x63c7('0xd'));var crypto=require(_0x63c7('0xe'));var jsforce=require(_0x63c7('0xf'));var deskjs=require(_0x63c7('0x10'));var toCsv=require(_0x63c7('0x9'));var querystring=require(_0x63c7('0x11'));var Papa=require('papaparse');var Redis=require(_0x63c7('0x12'));var authService=require(_0x63c7('0x13'));var qs=require(_0x63c7('0x14'));var as=require(_0x63c7('0x15'));var hardwareService=require(_0x63c7('0x16'));var logger=require(_0x63c7('0x17'))('api');var utils=require(_0x63c7('0x18'));var config=require(_0x63c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x63c7('0x1a'))['db'];function respondWithStatusCode(_0x492646,_0x43a28){_0x43a28=_0x43a28||0xcc;return function(_0x5dce22){if(_0x5dce22){return _0x492646[_0x63c7('0x1b')](_0x43a28);}return _0x492646[_0x63c7('0x1c')](_0x43a28)[_0x63c7('0x1d')]();};}function respondWithResult(_0x25d67c,_0x5e8bba){_0x5e8bba=_0x5e8bba||0xc8;return function(_0x2d686a){if(_0x2d686a){return _0x25d67c[_0x63c7('0x1c')](_0x5e8bba)['json'](_0x2d686a);}};}function respondWithFilteredResult(_0x53cf2b,_0x4cdb41){return function(_0x5104e0){if(_0x5104e0){var _0x2c4622=typeof _0x4cdb41[_0x63c7('0x1e')]===_0x63c7('0x1f')&&typeof _0x4cdb41[_0x63c7('0x20')]===_0x63c7('0x1f');var _0x3670a1=_0x5104e0[_0x63c7('0x21')];var _0x58b033=_0x2c4622?0x0:_0x4cdb41['offset'];var _0x3c3171=_0x2c4622?_0x5104e0[_0x63c7('0x21')]:_0x4cdb41[_0x63c7('0x1e')]+_0x4cdb41[_0x63c7('0x20')];var _0x2c22a3;if(_0x3c3171>=_0x3670a1){_0x3c3171=_0x3670a1;_0x2c22a3=0xc8;}else{_0x2c22a3=0xce;}_0x53cf2b[_0x63c7('0x1c')](_0x2c22a3);return _0x53cf2b[_0x63c7('0x22')](_0x63c7('0x23'),_0x58b033+'-'+_0x3c3171+'/'+_0x3670a1)[_0x63c7('0x24')](_0x5104e0);}return null;};}function patchUpdates(_0x302ba6){return function(_0x48e3d1){try{jsonpatch[_0x63c7('0x25')](_0x48e3d1,_0x302ba6,!![]);}catch(_0x18cc1d){return BPromise[_0x63c7('0x26')](_0x18cc1d);}return _0x48e3d1[_0x63c7('0x27')]();};}function saveUpdates(_0x37144c,_0x164acb){return function(_0x204683){if(_0x204683){return _0x204683[_0x63c7('0x28')](_0x37144c)[_0x63c7('0x29')](function(_0x24bf72){return _0x24bf72;});}return null;};}function removeEntity(_0x1de9ee,_0x7c1528){return function(_0x47ac67){if(_0x47ac67){return _0x47ac67[_0x63c7('0x2a')]()[_0x63c7('0x29')](function(){_0x1de9ee[_0x63c7('0x1c')](0xcc)[_0x63c7('0x1d')]();});}};}function handleEntityNotFound(_0x58c021,_0x3d10c2){return function(_0x1714db){if(!_0x1714db){_0x58c021['sendStatus'](0x194);}return _0x1714db;};}function handleError(_0x6188f6,_0x559302){_0x559302=_0x559302||0x1f4;return function(_0x340a74){logger[_0x63c7('0x2b')](_0x340a74[_0x63c7('0x2c')]);if(_0x340a74[_0x63c7('0x2d')]){delete _0x340a74[_0x63c7('0x2d')];}_0x6188f6[_0x63c7('0x1c')](_0x559302)[_0x63c7('0x2e')](_0x340a74);};}exports['index']=function(_0x53b170,_0x524e89){var _0x46ed30={},_0x4b8a07={},_0x1b1056={'count':0x0,'rows':[]};var _0x32486e=_['map'](db[_0x63c7('0x2f')][_0x63c7('0x30')],function(_0x19d268){return{'name':_0x19d268[_0x63c7('0x31')],'type':_0x19d268['type'][_0x63c7('0x32')]};});_0x4b8a07[_0x63c7('0x33')]=_[_0x63c7('0x34')](_0x32486e,'name');_0x4b8a07[_0x63c7('0x35')]=_[_0x63c7('0x36')](_0x53b170[_0x63c7('0x35')]);_0x4b8a07[_0x63c7('0x37')]=_['intersection'](_0x4b8a07[_0x63c7('0x33')],_0x4b8a07[_0x63c7('0x35')]);_0x46ed30['attributes']=_[_0x63c7('0x38')](_0x4b8a07[_0x63c7('0x33')],qs['fields'](_0x53b170[_0x63c7('0x35')][_0x63c7('0x39')]));_0x46ed30[_0x63c7('0x3a')]=_0x46ed30[_0x63c7('0x3a')][_0x63c7('0x3b')]?_0x46ed30[_0x63c7('0x3a')]:_0x4b8a07[_0x63c7('0x33')];if(!_0x53b170['query']['hasOwnProperty']('nolimit')){_0x46ed30['limit']=qs[_0x63c7('0x20')](_0x53b170['query'][_0x63c7('0x20')]);_0x46ed30[_0x63c7('0x1e')]=qs[_0x63c7('0x1e')](_0x53b170[_0x63c7('0x35')][_0x63c7('0x1e')]);}_0x46ed30[_0x63c7('0x3c')]=qs[_0x63c7('0x3d')](_0x53b170[_0x63c7('0x35')][_0x63c7('0x3d')]);_0x46ed30[_0x63c7('0x3e')]=qs[_0x63c7('0x37')](_[_0x63c7('0x3f')](_0x53b170[_0x63c7('0x35')],_0x4b8a07[_0x63c7('0x37')]),_0x32486e);if(_0x53b170[_0x63c7('0x35')][_0x63c7('0x40')]){_0x46ed30[_0x63c7('0x3e')]=_[_0x63c7('0x41')](_0x46ed30[_0x63c7('0x3e')],{'$or':_['map'](_0x32486e,function(_0x52bf1e){if(_0x52bf1e[_0x63c7('0x42')]!=='VIRTUAL'){var _0x40bde9={};_0x40bde9[_0x52bf1e[_0x63c7('0x2d')]]={'$like':'%'+_0x53b170[_0x63c7('0x35')][_0x63c7('0x40')]+'%'};return _0x40bde9;}})});}_0x46ed30=_['merge']({},_0x46ed30,_0x53b170[_0x63c7('0x43')]);var _0x64361d={'where':_0x46ed30[_0x63c7('0x3e')]};return db[_0x63c7('0x2f')]['count'](_0x64361d)[_0x63c7('0x29')](function(_0x6039fa){_0x1b1056[_0x63c7('0x21')]=_0x6039fa;if(_0x53b170[_0x63c7('0x35')]['includeAll']){_0x46ed30[_0x63c7('0x44')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x63c7('0x45')](_0x46ed30);})[_0x63c7('0x29')](function(_0x4edd7e){_0x1b1056[_0x63c7('0x46')]=_0x4edd7e;return _0x1b1056;})[_0x63c7('0x29')](respondWithFilteredResult(_0x524e89,_0x46ed30))['catch'](handleError(_0x524e89,null));};exports[_0x63c7('0x47')]=function(_0x3326b9,_0x6403db){var _0x332829={'raw':![],'where':{'id':_0x3326b9[_0x63c7('0x48')]['id']}},_0x146f78={};_0x146f78[_0x63c7('0x33')]=_[_0x63c7('0x36')](db[_0x63c7('0x2f')][_0x63c7('0x30')]);_0x146f78[_0x63c7('0x35')]=_['keys'](_0x3326b9[_0x63c7('0x35')]);_0x146f78[_0x63c7('0x37')]=_[_0x63c7('0x38')](_0x146f78[_0x63c7('0x33')],_0x146f78[_0x63c7('0x35')]);_0x332829[_0x63c7('0x3a')]=_[_0x63c7('0x38')](_0x146f78[_0x63c7('0x33')],qs[_0x63c7('0x39')](_0x3326b9['query'][_0x63c7('0x39')]));_0x332829['attributes']=_0x332829[_0x63c7('0x3a')][_0x63c7('0x3b')]?_0x332829[_0x63c7('0x3a')]:_0x146f78[_0x63c7('0x33')];if(_0x3326b9[_0x63c7('0x35')]['includeAll']){_0x332829[_0x63c7('0x44')]=[{'all':!![]}];}_0x332829=_[_0x63c7('0x41')]({},_0x332829,_0x3326b9[_0x63c7('0x43')]);return db[_0x63c7('0x2f')][_0x63c7('0x49')](_0x332829)['then'](handleEntityNotFound(_0x6403db,null))[_0x63c7('0x29')](respondWithResult(_0x6403db,null))[_0x63c7('0x4a')](handleError(_0x6403db,null));};exports['create']=function(_0x255524,_0x4b5d92){return db[_0x63c7('0x2f')][_0x63c7('0x4b')](_0x255524[_0x63c7('0x4c')],{})[_0x63c7('0x29')](respondWithResult(_0x4b5d92,0xc9))[_0x63c7('0x4a')](handleError(_0x4b5d92,null));};exports[_0x63c7('0x28')]=function(_0x13cbcc,_0x8026){if(_0x13cbcc['body']['id']){delete _0x13cbcc['body']['id'];}return db['DeskConfiguration'][_0x63c7('0x49')]({'where':{'id':_0x13cbcc['params']['id']}})[_0x63c7('0x29')](handleEntityNotFound(_0x8026,null))[_0x63c7('0x29')](saveUpdates(_0x13cbcc['body'],null))[_0x63c7('0x29')](respondWithResult(_0x8026,null))['catch'](handleError(_0x8026,null));};exports[_0x63c7('0x2a')]=function(_0x5ee59e,_0x340b42){return db[_0x63c7('0x2f')][_0x63c7('0x49')]({'where':{'id':_0x5ee59e[_0x63c7('0x48')]['id']}})['then'](handleEntityNotFound(_0x340b42,null))[_0x63c7('0x29')](removeEntity(_0x340b42,null))[_0x63c7('0x4a')](handleError(_0x340b42,null));};exports[_0x63c7('0x4d')]=function(_0x22a1ac,_0x5420ac,_0x406ede){var _0x1ad3aa={};var _0x1cc0ba={};var _0x46be38;var _0xd4bc28;return db[_0x63c7('0x2f')]['findOne']({'where':{'id':_0x22a1ac[_0x63c7('0x48')]['id']}})[_0x63c7('0x29')](handleEntityNotFound(_0x5420ac,null))[_0x63c7('0x29')](function(_0xf07276){if(_0xf07276){_0x46be38=_0xf07276;_0x1cc0ba['model']=_[_0x63c7('0x36')](db[_0x63c7('0x4e')][_0x63c7('0x30')]);_0x1cc0ba['query']=_[_0x63c7('0x36')](_0x22a1ac[_0x63c7('0x35')]);_0x1cc0ba[_0x63c7('0x37')]=_[_0x63c7('0x38')](_0x1cc0ba[_0x63c7('0x33')],_0x1cc0ba['query']);_0x1ad3aa[_0x63c7('0x3a')]=_[_0x63c7('0x38')](_0x1cc0ba[_0x63c7('0x33')],qs[_0x63c7('0x39')](_0x22a1ac[_0x63c7('0x35')][_0x63c7('0x39')]));_0x1ad3aa[_0x63c7('0x3a')]=_0x1ad3aa[_0x63c7('0x3a')][_0x63c7('0x3b')]?_0x1ad3aa[_0x63c7('0x3a')]:_0x1cc0ba[_0x63c7('0x33')];_0x1ad3aa[_0x63c7('0x3c')]=qs[_0x63c7('0x3d')](_0x22a1ac['query'][_0x63c7('0x3d')]);_0x1ad3aa['where']=qs[_0x63c7('0x37')](_[_0x63c7('0x3f')](_0x22a1ac[_0x63c7('0x35')],_0x1cc0ba['filters']));if(_0x22a1ac['query'][_0x63c7('0x40')]){_0x1ad3aa[_0x63c7('0x3e')]=_['merge'](_0x1ad3aa[_0x63c7('0x3e')],{'$or':_[_0x63c7('0x34')](_0x1ad3aa['attributes'],function(_0x1b1013){var _0x10280d={};_0x10280d[_0x1b1013]={'$like':'%'+_0x22a1ac[_0x63c7('0x35')][_0x63c7('0x40')]+'%'};return _0x10280d;})});}_0x1ad3aa=_[_0x63c7('0x41')]({},_0x1ad3aa,_0x22a1ac[_0x63c7('0x43')]);return _0x46be38['getFields'](_0x1ad3aa);}})[_0x63c7('0x29')](function(_0x1cd9dc){if(_0x1cd9dc){_0xd4bc28=_0x1cd9dc['length'];if(!_0x22a1ac[_0x63c7('0x35')][_0x63c7('0x4f')](_0x63c7('0x50'))){_0x1ad3aa[_0x63c7('0x20')]=qs[_0x63c7('0x20')](_0x22a1ac[_0x63c7('0x35')]['limit']);_0x1ad3aa[_0x63c7('0x1e')]=qs['offset'](_0x22a1ac[_0x63c7('0x35')][_0x63c7('0x1e')]);}return _0x46be38[_0x63c7('0x4d')](_0x1ad3aa);}})[_0x63c7('0x29')](function(_0x255ba3){if(_0x255ba3){return _0x255ba3?{'count':_0xd4bc28,'rows':_0x255ba3}:null;}})[_0x63c7('0x29')](respondWithResult(_0x5420ac,null))['catch'](handleError(_0x5420ac,null));};exports[_0x63c7('0x51')]=function(_0x5200cc,_0xf5c5ca,_0x31b7bb){var _0x23d7b9={};var _0x2a96b4={};var _0x3fb272;var _0x12f5ad;return db[_0x63c7('0x2f')]['findOne']({'where':{'id':_0x5200cc['params']['id']}})['then'](handleEntityNotFound(_0xf5c5ca,null))[_0x63c7('0x29')](function(_0x3f22dd){if(_0x3f22dd){_0x3fb272=_0x3f22dd;_0x2a96b4[_0x63c7('0x33')]=_[_0x63c7('0x36')](db[_0x63c7('0x4e')][_0x63c7('0x30')]);_0x2a96b4['query']=_[_0x63c7('0x36')](_0x5200cc['query']);_0x2a96b4['filters']=_['intersection'](_0x2a96b4[_0x63c7('0x33')],_0x2a96b4[_0x63c7('0x35')]);_0x23d7b9[_0x63c7('0x3a')]=_[_0x63c7('0x38')](_0x2a96b4['model'],qs[_0x63c7('0x39')](_0x5200cc[_0x63c7('0x35')]['fields']));_0x23d7b9[_0x63c7('0x3a')]=_0x23d7b9[_0x63c7('0x3a')][_0x63c7('0x3b')]?_0x23d7b9[_0x63c7('0x3a')]:_0x2a96b4[_0x63c7('0x33')];_0x23d7b9[_0x63c7('0x3c')]=qs['sort'](_0x5200cc[_0x63c7('0x35')][_0x63c7('0x3d')]);_0x23d7b9[_0x63c7('0x3e')]=qs[_0x63c7('0x37')](_[_0x63c7('0x3f')](_0x5200cc['query'],_0x2a96b4[_0x63c7('0x37')]));if(_0x5200cc[_0x63c7('0x35')][_0x63c7('0x40')]){_0x23d7b9[_0x63c7('0x3e')]=_[_0x63c7('0x41')](_0x23d7b9[_0x63c7('0x3e')],{'$or':_[_0x63c7('0x34')](_0x23d7b9[_0x63c7('0x3a')],function(_0x271a54){var _0xa3b28c={};_0xa3b28c[_0x271a54]={'$like':'%'+_0x5200cc[_0x63c7('0x35')][_0x63c7('0x40')]+'%'};return _0xa3b28c;})});}_0x23d7b9=_[_0x63c7('0x41')]({},_0x23d7b9,_0x5200cc['options']);return _0x3fb272[_0x63c7('0x51')](_0x23d7b9);}})['then'](function(_0xa03b77){if(_0xa03b77){_0x12f5ad=_0xa03b77['length'];if(!_0x5200cc[_0x63c7('0x35')]['hasOwnProperty']('nolimit')){_0x23d7b9[_0x63c7('0x20')]=qs[_0x63c7('0x20')](_0x5200cc[_0x63c7('0x35')]['limit']);_0x23d7b9['offset']=qs['offset'](_0x5200cc[_0x63c7('0x35')][_0x63c7('0x1e')]);}return _0x3fb272[_0x63c7('0x51')](_0x23d7b9);}})[_0x63c7('0x29')](function(_0x451c9a){if(_0x451c9a){return _0x451c9a?{'count':_0x12f5ad,'rows':_0x451c9a}:null;}})[_0x63c7('0x29')](respondWithResult(_0xf5c5ca,null))[_0x63c7('0x4a')](handleError(_0xf5c5ca,null));};exports[_0x63c7('0x52')]=function(_0x4eff1c,_0x28edb5,_0x31014c){var _0x2be5ee={};var _0xdd8fd1={};var _0x1e02c4;var _0xc58b28;return db[_0x63c7('0x2f')][_0x63c7('0x53')]({'where':{'id':_0x4eff1c[_0x63c7('0x48')]['id']}})[_0x63c7('0x29')](handleEntityNotFound(_0x28edb5,null))[_0x63c7('0x29')](function(_0x3a5acb){if(_0x3a5acb){_0x1e02c4=_0x3a5acb;_0xdd8fd1['model']=_['keys'](db[_0x63c7('0x4e')][_0x63c7('0x30')]);_0xdd8fd1['query']=_[_0x63c7('0x36')](_0x4eff1c[_0x63c7('0x35')]);_0xdd8fd1['filters']=_[_0x63c7('0x38')](_0xdd8fd1[_0x63c7('0x33')],_0xdd8fd1[_0x63c7('0x35')]);_0x2be5ee[_0x63c7('0x3a')]=_['intersection'](_0xdd8fd1[_0x63c7('0x33')],qs[_0x63c7('0x39')](_0x4eff1c[_0x63c7('0x35')][_0x63c7('0x39')]));_0x2be5ee['attributes']=_0x2be5ee['attributes'][_0x63c7('0x3b')]?_0x2be5ee['attributes']:_0xdd8fd1[_0x63c7('0x33')];_0x2be5ee['order']=qs[_0x63c7('0x3d')](_0x4eff1c[_0x63c7('0x35')][_0x63c7('0x3d')]);_0x2be5ee[_0x63c7('0x3e')]=qs[_0x63c7('0x37')](_[_0x63c7('0x3f')](_0x4eff1c['query'],_0xdd8fd1['filters']));if(_0x4eff1c['query'][_0x63c7('0x40')]){_0x2be5ee[_0x63c7('0x3e')]=_[_0x63c7('0x41')](_0x2be5ee[_0x63c7('0x3e')],{'$or':_['map'](_0x2be5ee['attributes'],function(_0x3d5fef){var _0x44065c={};_0x44065c[_0x3d5fef]={'$like':'%'+_0x4eff1c['query'][_0x63c7('0x40')]+'%'};return _0x44065c;})});}_0x2be5ee=_[_0x63c7('0x41')]({},_0x2be5ee,_0x4eff1c[_0x63c7('0x43')]);return _0x1e02c4[_0x63c7('0x52')](_0x2be5ee);}})[_0x63c7('0x29')](function(_0x496404){if(_0x496404){_0xc58b28=_0x496404['length'];if(!_0x4eff1c[_0x63c7('0x35')][_0x63c7('0x4f')](_0x63c7('0x50'))){_0x2be5ee['limit']=qs[_0x63c7('0x20')](_0x4eff1c[_0x63c7('0x35')][_0x63c7('0x20')]);_0x2be5ee[_0x63c7('0x1e')]=qs[_0x63c7('0x1e')](_0x4eff1c[_0x63c7('0x35')][_0x63c7('0x1e')]);}return _0x1e02c4[_0x63c7('0x52')](_0x2be5ee);}})['then'](function(_0x3bc54f){if(_0x3bc54f){return _0x3bc54f?{'count':_0xc58b28,'rows':_0x3bc54f}:null;}})[_0x63c7('0x29')](respondWithResult(_0x28edb5,null))[_0x63c7('0x4a')](handleError(_0x28edb5,null));};exports[_0x63c7('0x54')]=function(_0x37c49d,_0x3d84d1,_0x452d82){var _0x21c9df={};var _0x2623af={};var _0x54bd4f;var _0x2bd5d1;return db[_0x63c7('0x2f')][_0x63c7('0x53')]({'where':{'id':_0x37c49d['params']['id']}})[_0x63c7('0x29')](handleEntityNotFound(_0x3d84d1,null))[_0x63c7('0x29')](function(_0x8e229){if(_0x8e229){_0x54bd4f=_0x8e229;_0x2623af['model']=_[_0x63c7('0x36')](db[_0x63c7('0x55')]['rawAttributes']);_0x2623af[_0x63c7('0x35')]=_[_0x63c7('0x36')](_0x37c49d[_0x63c7('0x35')]);_0x2623af['filters']=_[_0x63c7('0x38')](_0x2623af[_0x63c7('0x33')],_0x2623af[_0x63c7('0x35')]);_0x21c9df[_0x63c7('0x3a')]=_[_0x63c7('0x38')](_0x2623af[_0x63c7('0x33')],qs['fields'](_0x37c49d['query']['fields']));_0x21c9df[_0x63c7('0x3a')]=_0x21c9df[_0x63c7('0x3a')]['length']?_0x21c9df[_0x63c7('0x3a')]:_0x2623af[_0x63c7('0x33')];_0x21c9df['order']=qs[_0x63c7('0x3d')](_0x37c49d['query'][_0x63c7('0x3d')]);_0x21c9df[_0x63c7('0x3e')]=qs[_0x63c7('0x37')](_[_0x63c7('0x3f')](_0x37c49d['query'],_0x2623af[_0x63c7('0x37')]));if(_0x37c49d['query'][_0x63c7('0x40')]){_0x21c9df[_0x63c7('0x3e')]=_[_0x63c7('0x41')](_0x21c9df[_0x63c7('0x3e')],{'$or':_['map'](_0x21c9df[_0x63c7('0x3a')],function(_0x898df5){var _0x1780de={};_0x1780de[_0x898df5]={'$like':'%'+_0x37c49d[_0x63c7('0x35')][_0x63c7('0x40')]+'%'};return _0x1780de;})});}_0x21c9df=_['merge']({},_0x21c9df,_0x37c49d['options']);return _0x54bd4f[_0x63c7('0x54')](_0x21c9df);}})[_0x63c7('0x29')](function(_0x21150f){if(_0x21150f){_0x2bd5d1=_0x21150f['length'];if(!_0x37c49d['query'][_0x63c7('0x4f')](_0x63c7('0x50'))){_0x21c9df[_0x63c7('0x20')]=qs['limit'](_0x37c49d[_0x63c7('0x35')][_0x63c7('0x20')]);_0x21c9df['offset']=qs[_0x63c7('0x1e')](_0x37c49d['query'][_0x63c7('0x1e')]);}return _0x54bd4f[_0x63c7('0x54')](_0x21c9df);}})[_0x63c7('0x29')](function(_0x1c17e6){if(_0x1c17e6){return _0x1c17e6?{'count':_0x2bd5d1,'rows':_0x1c17e6}:null;}})[_0x63c7('0x29')](respondWithResult(_0x3d84d1,null))['catch'](handleError(_0x3d84d1,null));};exports[_0x63c7('0x56')]=function(_0x5e96b5,_0x291e58,_0x4c5aff){if(_0x5e96b5[_0x63c7('0x4c')]['id']){delete _0x5e96b5['body']['id'];}return db[_0x63c7('0x2f')][_0x63c7('0x53')]({'where':{'id':_0x5e96b5['params']['id']}})[_0x63c7('0x29')](handleEntityNotFound(_0x291e58,null))['then'](function(_0x3c0875){if(_0x3c0875){return _0x3c0875[_0x63c7('0x56')](_0x5e96b5[_0x63c7('0x4c')]['ids']||[]);}return null;})[_0x63c7('0x29')](respondWithResult(_0x291e58,null))[_0x63c7('0x4a')](handleError(_0x291e58,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index dfaf347..aadd875 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 _0xb24c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x31959a,_0x134b6b){var _0x3b0745=function(_0x2e1cb9){while(--_0x2e1cb9){_0x31959a['push'](_0x31959a['shift']());}};_0x3b0745(++_0x134b6b);}(_0xb24c,0xcf));var _0xcb24=function(_0x63919d,_0x5ebb89){_0x63919d=_0x63919d-0x0;var _0x2eda33=_0xb24c[_0x63919d];return _0x2eda33;};'use strict';var _=require(_0xcb24('0x0'));var util=require('util');var logger=require(_0xcb24('0x1'))(_0xcb24('0x2'));var moment=require(_0xcb24('0x3'));var BPromise=require(_0xcb24('0x4'));var rp=require(_0xcb24('0x5'));var fs=require('fs');var path=require(_0xcb24('0x6'));var rimraf=require(_0xcb24('0x7'));var config=require(_0xcb24('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0xcb24('0x9')]=function(_0x58ad01,_0x2b286c){return _0x58ad01[_0xcb24('0xa')](_0xcb24('0xb'),attributes,{'tableName':_0xcb24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d1=['../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x69d1,0x1b5));var _0x169d=function(_0x30505a,_0x4d35c0){_0x30505a=_0x30505a-0x0;var _0x1c664b=_0x69d1[_0x30505a];return _0x1c664b;};'use strict';var _=require(_0x169d('0x0'));var util=require('util');var logger=require(_0x169d('0x1'))('api');var moment=require(_0x169d('0x2'));var BPromise=require(_0x169d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x169d('0x4'));var attributes=require('./intDeskConfiguration.attributes');module[_0x169d('0x5')]=function(_0x3c8fe5,_0x3827a1){return _0x3c8fe5[_0x169d('0x6')](_0x169d('0x7'),attributes,{'tableName':_0x169d('0x8'),'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 916f40f..be886a6 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 _0x0699=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x49e6b4,_0x3b1797){var _0x53fdb3=function(_0x2de726){while(--_0x2de726){_0x49e6b4['push'](_0x49e6b4['shift']());}};_0x53fdb3(++_0x3b1797);}(_0x0699,0x1db));var _0x9069=function(_0x3de4bf,_0x5280c1){_0x3de4bf=_0x3de4bf-0x0;var _0x3243b4=_0x0699[_0x3de4bf];return _0x3243b4;};'use strict';var _=require(_0x9069('0x0'));var util=require('util');var moment=require(_0x9069('0x1'));var BPromise=require('bluebird');var rs=require(_0x9069('0x2'));var fs=require('fs');var Redis=require(_0x9069('0x3'));var db=require(_0x9069('0x4'))['db'];var utils=require(_0x9069('0x5'));var logger=require('../../config/logger')(_0x9069('0x6'));var config=require(_0x9069('0x7'));var jayson=require(_0x9069('0x8'));var client=jayson[_0x9069('0x9')][_0x9069('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe64c,_0x3aba3f,_0x377885){return new BPromise(function(_0x4c0e39,_0x517217){return client[_0x9069('0xb')](_0x2fe64c,_0x377885)[_0x9069('0xc')](function(_0x3a5e8f){logger[_0x9069('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3aba3f,_0x9069('0xe'));logger[_0x9069('0xf')](_0x9069('0x10'),_0x3aba3f,_0x9069('0xe'),JSON[_0x9069('0x11')](_0x3a5e8f));if(_0x3a5e8f[_0x9069('0x12')]){if(_0x3a5e8f[_0x9069('0x12')][_0x9069('0x13')]===0x1f4){logger[_0x9069('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3aba3f,_0x3a5e8f[_0x9069('0x12')][_0x9069('0x14')]);return _0x517217(_0x3a5e8f['error'][_0x9069('0x14')]);}logger[_0x9069('0x12')](_0x9069('0x15'),_0x3aba3f,_0x3a5e8f[_0x9069('0x12')]['message']);return _0x4c0e39(_0x3a5e8f['error'][_0x9069('0x14')]);}else{logger['info'](_0x9069('0x15'),_0x3aba3f,_0x9069('0xe'));_0x4c0e39(_0x3a5e8f[_0x9069('0x16')]['message']);}})[_0x9069('0x17')](function(_0x2ed5f4){logger[_0x9069('0x12')](_0x9069('0x15'),_0x3aba3f,_0x2ed5f4);_0x517217(_0x2ed5f4);});});} \ No newline at end of file +var _0xdc36=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird'];(function(_0x4e08e8,_0x130b6c){var _0xa81663=function(_0x41b7d7){while(--_0x41b7d7){_0x4e08e8['push'](_0x4e08e8['shift']());}};_0xa81663(++_0x130b6c);}(_0xdc36,0x18c));var _0x6dc3=function(_0x3abb36,_0x20012d){_0x3abb36=_0x3abb36-0x0;var _0x53be8b=_0xdc36[_0x3abb36];return _0x53be8b;};'use strict';var _=require(_0x6dc3('0x0'));var util=require('util');var moment=require(_0x6dc3('0x1'));var BPromise=require(_0x6dc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dc3('0x3'));var db=require(_0x6dc3('0x4'))['db'];var utils=require(_0x6dc3('0x5'));var logger=require('../../config/logger')(_0x6dc3('0x6'));var config=require(_0x6dc3('0x7'));var jayson=require(_0x6dc3('0x8'));var client=jayson['client'][_0x6dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x71dd7,_0x17cbce,_0x45ef76){return new BPromise(function(_0x589aa8,_0xda595d){return client[_0x6dc3('0xa')](_0x71dd7,_0x45ef76)['then'](function(_0x88957d){logger[_0x6dc3('0xb')](_0x6dc3('0xc'),_0x17cbce,_0x6dc3('0xd'));logger['debug'](_0x6dc3('0xe'),_0x17cbce,'request\x20sent',JSON[_0x6dc3('0xf')](_0x88957d));if(_0x88957d[_0x6dc3('0x10')]){if(_0x88957d[_0x6dc3('0x10')][_0x6dc3('0x11')]===0x1f4){logger[_0x6dc3('0x10')](_0x6dc3('0xc'),_0x17cbce,_0x88957d[_0x6dc3('0x10')][_0x6dc3('0x12')]);return _0xda595d(_0x88957d['error'][_0x6dc3('0x12')]);}logger[_0x6dc3('0x10')](_0x6dc3('0xc'),_0x17cbce,_0x88957d[_0x6dc3('0x10')]['message']);return _0x589aa8(_0x88957d[_0x6dc3('0x10')][_0x6dc3('0x12')]);}else{logger[_0x6dc3('0xb')](_0x6dc3('0xc'),_0x17cbce,_0x6dc3('0xd'));_0x589aa8(_0x88957d['result']['message']);}})['catch'](function(_0x1a674a){logger[_0x6dc3('0x10')](_0x6dc3('0xc'),_0x17cbce,_0x1a674a);_0xda595d(_0x1a674a);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 04bb5ca..2cd21b1 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 _0x96eb=['./intDeskField.controller','isAuthenticated','get','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96eb,0x1df));var _0xb96e=function(_0x941051,_0x205266){_0x941051=_0x941051-0x0;var _0x368166=_0x96eb[_0x941051];return _0x368166;};'use strict';var multer=require(_0xb96e('0x0'));var util=require('util');var path=require(_0xb96e('0x1'));var timeout=require(_0xb96e('0x2'));var express=require('express');var router=express[_0xb96e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb96e('0x4'));var interaction=require(_0xb96e('0x5'));var config=require(_0xb96e('0x6'));var controller=require(_0xb96e('0x7'));router['get']('/',auth[_0xb96e('0x8')](),controller['index']);router[_0xb96e('0x9')](_0xb96e('0xa'),auth[_0xb96e('0x8')](),controller[_0xb96e('0xb')]);router[_0xb96e('0xc')]('/',auth['isAuthenticated'](),controller[_0xb96e('0xd')]);router['put'](_0xb96e('0xa'),auth[_0xb96e('0x8')](),controller[_0xb96e('0xe')]);router[_0xb96e('0xf')]('/:id',auth[_0xb96e('0x8')](),controller[_0xb96e('0x10')]);module[_0xb96e('0x11')]=router; \ No newline at end of file +var _0xd0ce=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3faf76,_0x1a75ca){var _0x45cc55=function(_0x2d640d){while(--_0x2d640d){_0x3faf76['push'](_0x3faf76['shift']());}};_0x45cc55(++_0x1a75ca);}(_0xd0ce,0x105));var _0xed0c=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0xd0ce[_0x15ddc9];return _0x2fc9e8;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xc')]);router[_0xed0c('0xb')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0xf')]);router[_0xed0c('0x10')]('/',auth[_0xed0c('0xe')](),controller[_0xed0c('0x11')]);router[_0xed0c('0x12')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller['update']);router[_0xed0c('0x13')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x14')]);module[_0xed0c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2d2e454..956273f 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 _0x8ebe=['variable','keyValue','picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3d52e0,_0x24185d){var _0x125178=function(_0x576a87){while(--_0x576a87){_0x3d52e0['push'](_0x3d52e0['shift']());}};_0x125178(++_0x24185d);}(_0x8ebe,0xe4));var _0xe8eb=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x8ebe[_0x25cd2c];return _0x1e364c;};'use strict';var Sequelize=require(_0xe8eb('0x0'));module[_0xe8eb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xe8eb('0x2'),'customVariable',_0xe8eb('0x3'),_0xe8eb('0x4')),'defaultValue':_0xe8eb('0x5')},'content':{'type':Sequelize[_0xe8eb('0x6')]},'key':{'type':Sequelize[_0xe8eb('0x6')]},'keyType':{'type':Sequelize[_0xe8eb('0x7')]('string',_0xe8eb('0x2'),_0xe8eb('0x8'))},'keyContent':{'type':Sequelize[_0xe8eb('0x6')]},'idField':{'type':Sequelize[_0xe8eb('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe8eb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe8eb('0x6')]}}; \ No newline at end of file +var _0x3675=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x389ac9,_0x178312){var _0x923da2=function(_0x56f5b2){while(--_0x56f5b2){_0x389ac9['push'](_0x389ac9['shift']());}};_0x923da2(++_0x178312);}(_0x3675,0xa2));var _0x5367=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x3675[_0x5d72da];return _0x43ebe7;};'use strict';var Sequelize=require(_0x5367('0x0'));module[_0x5367('0x1')]={'type':{'type':Sequelize[_0x5367('0x2')]('string',_0x5367('0x3'),_0x5367('0x4'),_0x5367('0x5'),_0x5367('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5367('0x7')]},'key':{'type':Sequelize[_0x5367('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x5367('0x7')]},'idField':{'type':Sequelize[_0x5367('0x7')]},'nameField':{'type':Sequelize[_0x5367('0x7')]},'customField':{'type':Sequelize[_0x5367('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5367('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7d773bd..138481e 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 _0xf5cd=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0xac004e,_0x4783bd){var _0x329974=function(_0x474091){while(--_0x474091){_0xac004e['push'](_0xac004e['shift']());}};_0x329974(++_0x4783bd);}(_0xf5cd,0x1bf));var _0xdf5c=function(_0xc160fd,_0x542f14){_0xc160fd=_0xc160fd-0x0;var _0x1a4e73=_0xf5cd[_0xc160fd];return _0x1a4e73;};'use strict';var emlformat=require(_0xdf5c('0x0'));var rimraf=require(_0xdf5c('0x1'));var zipdir=require(_0xdf5c('0x2'));var jsonpatch=require(_0xdf5c('0x3'));var rp=require(_0xdf5c('0x4'));var moment=require(_0xdf5c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf5c('0x6'));var util=require(_0xdf5c('0x7'));var path=require(_0xdf5c('0x8'));var sox=require(_0xdf5c('0x9'));var csv=require(_0xdf5c('0xa'));var ejs=require(_0xdf5c('0xb'));var fs=require('fs');var fs_extra=require(_0xdf5c('0xc'));var _=require(_0xdf5c('0xd'));var squel=require(_0xdf5c('0xe'));var crypto=require(_0xdf5c('0xf'));var jsforce=require(_0xdf5c('0x10'));var deskjs=require(_0xdf5c('0x11'));var toCsv=require(_0xdf5c('0xa'));var querystring=require(_0xdf5c('0x12'));var Papa=require(_0xdf5c('0x13'));var Redis=require('ioredis');var authService=require(_0xdf5c('0x14'));var qs=require(_0xdf5c('0x15'));var as=require(_0xdf5c('0x16'));var hardwareService=require(_0xdf5c('0x17'));var logger=require(_0xdf5c('0x18'))(_0xdf5c('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdf5c('0x1a'));var db=require(_0xdf5c('0x1b'))['db'];function respondWithStatusCode(_0x5809a5,_0x285569){_0x285569=_0x285569||0xcc;return function(_0x3f3c5f){if(_0x3f3c5f){return _0x5809a5[_0xdf5c('0x1c')](_0x285569);}return _0x5809a5[_0xdf5c('0x1d')](_0x285569)[_0xdf5c('0x1e')]();};}function respondWithResult(_0x460647,_0x32e112){_0x32e112=_0x32e112||0xc8;return function(_0x3c9728){if(_0x3c9728){return _0x460647[_0xdf5c('0x1d')](_0x32e112)['json'](_0x3c9728);}};}function respondWithFilteredResult(_0x436b88,_0x12a546){return function(_0x3d6ebc){if(_0x3d6ebc){var _0xc0889f=typeof _0x12a546['offset']===_0xdf5c('0x1f')&&typeof _0x12a546[_0xdf5c('0x20')]===_0xdf5c('0x1f');var _0x392aea=_0x3d6ebc[_0xdf5c('0x21')];var _0x41b922=_0xc0889f?0x0:_0x12a546[_0xdf5c('0x22')];var _0x5b2981=_0xc0889f?_0x3d6ebc['count']:_0x12a546[_0xdf5c('0x22')]+_0x12a546[_0xdf5c('0x20')];var _0x32e211;if(_0x5b2981>=_0x392aea){_0x5b2981=_0x392aea;_0x32e211=0xc8;}else{_0x32e211=0xce;}_0x436b88[_0xdf5c('0x1d')](_0x32e211);return _0x436b88['set'](_0xdf5c('0x23'),_0x41b922+'-'+_0x5b2981+'/'+_0x392aea)[_0xdf5c('0x24')](_0x3d6ebc);}return null;};}function patchUpdates(_0x1bcbc9){return function(_0x88ae31){try{jsonpatch[_0xdf5c('0x25')](_0x88ae31,_0x1bcbc9,!![]);}catch(_0x4c7b94){return BPromise['reject'](_0x4c7b94);}return _0x88ae31[_0xdf5c('0x26')]();};}function saveUpdates(_0x547fae,_0x297cd2){return function(_0x18e8d9){if(_0x18e8d9){return _0x18e8d9[_0xdf5c('0x27')](_0x547fae)[_0xdf5c('0x28')](function(_0x1e8c1d){return _0x1e8c1d;});}return null;};}function removeEntity(_0x390a3c,_0x937403){return function(_0x2af965){if(_0x2af965){return _0x2af965['destroy']()[_0xdf5c('0x28')](function(){_0x390a3c[_0xdf5c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cc31,_0x32f8b3){return function(_0x52deb9){if(!_0x52deb9){_0x9cc31[_0xdf5c('0x1c')](0x194);}return _0x52deb9;};}function handleError(_0x1035ed,_0x18fe30){_0x18fe30=_0x18fe30||0x1f4;return function(_0x43e432){logger[_0xdf5c('0x29')](_0x43e432[_0xdf5c('0x2a')]);if(_0x43e432['name']){delete _0x43e432[_0xdf5c('0x2b')];}_0x1035ed['status'](_0x18fe30)[_0xdf5c('0x2c')](_0x43e432);};}exports['index']=function(_0x7ebb52,_0x18b627){var _0x48ec5d={},_0xf07b12={},_0x1c448d={'count':0x0,'rows':[]};var _0x28dd38=_[_0xdf5c('0x2d')](db[_0xdf5c('0x2e')][_0xdf5c('0x2f')],function(_0x23c64a){return{'name':_0x23c64a[_0xdf5c('0x30')],'type':_0x23c64a[_0xdf5c('0x31')][_0xdf5c('0x32')]};});_0xf07b12[_0xdf5c('0x33')]=_[_0xdf5c('0x2d')](_0x28dd38,'name');_0xf07b12[_0xdf5c('0x34')]=_[_0xdf5c('0x35')](_0x7ebb52[_0xdf5c('0x34')]);_0xf07b12[_0xdf5c('0x36')]=_[_0xdf5c('0x37')](_0xf07b12[_0xdf5c('0x33')],_0xf07b12[_0xdf5c('0x34')]);_0x48ec5d['attributes']=_[_0xdf5c('0x37')](_0xf07b12['model'],qs[_0xdf5c('0x38')](_0x7ebb52[_0xdf5c('0x34')][_0xdf5c('0x38')]));_0x48ec5d[_0xdf5c('0x39')]=_0x48ec5d[_0xdf5c('0x39')][_0xdf5c('0x3a')]?_0x48ec5d[_0xdf5c('0x39')]:_0xf07b12[_0xdf5c('0x33')];if(!_0x7ebb52[_0xdf5c('0x34')][_0xdf5c('0x3b')](_0xdf5c('0x3c'))){_0x48ec5d['limit']=qs[_0xdf5c('0x20')](_0x7ebb52[_0xdf5c('0x34')]['limit']);_0x48ec5d['offset']=qs[_0xdf5c('0x22')](_0x7ebb52['query'][_0xdf5c('0x22')]);}_0x48ec5d['order']=qs[_0xdf5c('0x3d')](_0x7ebb52[_0xdf5c('0x34')]['sort']);_0x48ec5d[_0xdf5c('0x3e')]=qs['filters'](_[_0xdf5c('0x3f')](_0x7ebb52[_0xdf5c('0x34')],_0xf07b12[_0xdf5c('0x36')]),_0x28dd38);if(_0x7ebb52[_0xdf5c('0x34')]['filter']){_0x48ec5d[_0xdf5c('0x3e')]=_[_0xdf5c('0x40')](_0x48ec5d[_0xdf5c('0x3e')],{'$or':_['map'](_0x28dd38,function(_0x4adcfc){if(_0x4adcfc[_0xdf5c('0x31')]!==_0xdf5c('0x41')){var _0x516d35={};_0x516d35[_0x4adcfc[_0xdf5c('0x2b')]]={'$like':'%'+_0x7ebb52[_0xdf5c('0x34')][_0xdf5c('0x42')]+'%'};return _0x516d35;}})});}_0x48ec5d=_[_0xdf5c('0x40')]({},_0x48ec5d,_0x7ebb52['options']);var _0x38cca9={'where':_0x48ec5d[_0xdf5c('0x3e')]};return db['DeskField'][_0xdf5c('0x21')](_0x38cca9)[_0xdf5c('0x28')](function(_0x524401){_0x1c448d['count']=_0x524401;if(_0x7ebb52[_0xdf5c('0x34')][_0xdf5c('0x43')]){_0x48ec5d[_0xdf5c('0x44')]=[{'all':!![]}];}return db['DeskField'][_0xdf5c('0x45')](_0x48ec5d);})[_0xdf5c('0x28')](function(_0x2db53f){_0x1c448d['rows']=_0x2db53f;return _0x1c448d;})['then'](respondWithFilteredResult(_0x18b627,_0x48ec5d))[_0xdf5c('0x46')](handleError(_0x18b627,null));};exports[_0xdf5c('0x47')]=function(_0x5a7aa3,_0x3c8696){var _0x5a7224={'raw':!![],'where':{'id':_0x5a7aa3[_0xdf5c('0x48')]['id']}},_0x25fbbd={};_0x25fbbd[_0xdf5c('0x33')]=_[_0xdf5c('0x35')](db[_0xdf5c('0x2e')][_0xdf5c('0x2f')]);_0x25fbbd['query']=_[_0xdf5c('0x35')](_0x5a7aa3['query']);_0x25fbbd[_0xdf5c('0x36')]=_[_0xdf5c('0x37')](_0x25fbbd[_0xdf5c('0x33')],_0x25fbbd[_0xdf5c('0x34')]);_0x5a7224[_0xdf5c('0x39')]=_[_0xdf5c('0x37')](_0x25fbbd[_0xdf5c('0x33')],qs[_0xdf5c('0x38')](_0x5a7aa3['query'][_0xdf5c('0x38')]));_0x5a7224[_0xdf5c('0x39')]=_0x5a7224['attributes'][_0xdf5c('0x3a')]?_0x5a7224[_0xdf5c('0x39')]:_0x25fbbd['model'];if(_0x5a7aa3[_0xdf5c('0x34')][_0xdf5c('0x43')]){_0x5a7224[_0xdf5c('0x44')]=[{'all':!![]}];}_0x5a7224=_['merge']({},_0x5a7224,_0x5a7aa3[_0xdf5c('0x49')]);return db[_0xdf5c('0x2e')][_0xdf5c('0x4a')](_0x5a7224)[_0xdf5c('0x28')](handleEntityNotFound(_0x3c8696,null))['then'](respondWithResult(_0x3c8696,null))[_0xdf5c('0x46')](handleError(_0x3c8696,null));};exports[_0xdf5c('0x4b')]=function(_0x1c6831,_0x15b02d){return db[_0xdf5c('0x2e')][_0xdf5c('0x4b')](_0x1c6831['body'],{})[_0xdf5c('0x28')](respondWithResult(_0x15b02d,0xc9))[_0xdf5c('0x46')](handleError(_0x15b02d,null));};exports[_0xdf5c('0x27')]=function(_0x574ae7,_0x6c50e7){if(_0x574ae7[_0xdf5c('0x4c')]['id']){delete _0x574ae7[_0xdf5c('0x4c')]['id'];}return db['DeskField'][_0xdf5c('0x4a')]({'where':{'id':_0x574ae7['params']['id']}})['then'](handleEntityNotFound(_0x6c50e7,null))[_0xdf5c('0x28')](saveUpdates(_0x574ae7[_0xdf5c('0x4c')],null))[_0xdf5c('0x28')](respondWithResult(_0x6c50e7,null))[_0xdf5c('0x46')](handleError(_0x6c50e7,null));};exports[_0xdf5c('0x4d')]=function(_0x5ced23,_0x2eda44){return db[_0xdf5c('0x2e')]['find']({'where':{'id':_0x5ced23[_0xdf5c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2eda44,null))[_0xdf5c('0x28')](removeEntity(_0x2eda44,null))['catch'](handleError(_0x2eda44,null));}; \ No newline at end of file +var _0x8ba0=['find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','DeskField','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options'];(function(_0x54f978,_0x3a6b7e){var _0x5d40b3=function(_0x44b545){while(--_0x44b545){_0x54f978['push'](_0x54f978['shift']());}};_0x5d40b3(++_0x3a6b7e);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x419997,_0x3e58ce){_0x419997=_0x419997-0x0;var _0x24e721=_0x8ba0[_0x419997];return _0x24e721;};'use strict';var emlformat=require(_0x08ba('0x0'));var rimraf=require(_0x08ba('0x1'));var zipdir=require(_0x08ba('0x2'));var jsonpatch=require(_0x08ba('0x3'));var rp=require(_0x08ba('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x08ba('0x5'));var util=require(_0x08ba('0x6'));var path=require(_0x08ba('0x7'));var sox=require(_0x08ba('0x8'));var csv=require(_0x08ba('0x9'));var ejs=require(_0x08ba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08ba('0xb'));var squel=require(_0x08ba('0xc'));var crypto=require(_0x08ba('0xd'));var jsforce=require(_0x08ba('0xe'));var deskjs=require(_0x08ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x08ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x08ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08ba('0x12'));var as=require(_0x08ba('0x13'));var hardwareService=require(_0x08ba('0x14'));var logger=require(_0x08ba('0x15'))(_0x08ba('0x16'));var utils=require(_0x08ba('0x17'));var config=require(_0x08ba('0x18'));var licenseUtil=require(_0x08ba('0x19'));var db=require(_0x08ba('0x1a'))['db'];function respondWithStatusCode(_0x33d2b6,_0x1b0f0a){_0x1b0f0a=_0x1b0f0a||0xcc;return function(_0x1f9f6e){if(_0x1f9f6e){return _0x33d2b6['sendStatus'](_0x1b0f0a);}return _0x33d2b6[_0x08ba('0x1b')](_0x1b0f0a)[_0x08ba('0x1c')]();};}function respondWithResult(_0x2a9b54,_0x210419){_0x210419=_0x210419||0xc8;return function(_0x2c047c){if(_0x2c047c){return _0x2a9b54[_0x08ba('0x1b')](_0x210419)['json'](_0x2c047c);}};}function respondWithFilteredResult(_0x325b2f,_0x2886a7){return function(_0x337fe9){if(_0x337fe9){var _0x2887c8=typeof _0x2886a7[_0x08ba('0x1d')]==='undefined'&&typeof _0x2886a7[_0x08ba('0x1e')]===_0x08ba('0x1f');var _0x507c5a=_0x337fe9[_0x08ba('0x20')];var _0x57e1d5=_0x2887c8?0x0:_0x2886a7['offset'];var _0x24623c=_0x2887c8?_0x337fe9[_0x08ba('0x20')]:_0x2886a7[_0x08ba('0x1d')]+_0x2886a7[_0x08ba('0x1e')];var _0x6a9cc6;if(_0x24623c>=_0x507c5a){_0x24623c=_0x507c5a;_0x6a9cc6=0xc8;}else{_0x6a9cc6=0xce;}_0x325b2f[_0x08ba('0x1b')](_0x6a9cc6);return _0x325b2f[_0x08ba('0x21')]('Content-Range',_0x57e1d5+'-'+_0x24623c+'/'+_0x507c5a)['json'](_0x337fe9);}return null;};}function patchUpdates(_0x4081c5){return function(_0x53cf3a){try{jsonpatch[_0x08ba('0x22')](_0x53cf3a,_0x4081c5,!![]);}catch(_0x39fb5e){return BPromise['reject'](_0x39fb5e);}return _0x53cf3a[_0x08ba('0x23')]();};}function saveUpdates(_0x108024,_0x303d3a){return function(_0x15700e){if(_0x15700e){return _0x15700e[_0x08ba('0x24')](_0x108024)[_0x08ba('0x25')](function(_0x5695c0){return _0x5695c0;});}return null;};}function removeEntity(_0x3e6160,_0x3741bf){return function(_0x951b35){if(_0x951b35){return _0x951b35[_0x08ba('0x26')]()[_0x08ba('0x25')](function(){_0x3e6160['status'](0xcc)[_0x08ba('0x1c')]();});}};}function handleEntityNotFound(_0x17c24c,_0x19c501){return function(_0x23225d){if(!_0x23225d){_0x17c24c[_0x08ba('0x27')](0x194);}return _0x23225d;};}function handleError(_0x33fba6,_0xb6b373){_0xb6b373=_0xb6b373||0x1f4;return function(_0x529c32){logger[_0x08ba('0x28')](_0x529c32[_0x08ba('0x29')]);if(_0x529c32[_0x08ba('0x2a')]){delete _0x529c32['name'];}_0x33fba6['status'](_0xb6b373)['send'](_0x529c32);};}exports[_0x08ba('0x2b')]=function(_0x1f8e64,_0xb67f0d){var _0x939b76={},_0x419ff7={},_0x56194a={'count':0x0,'rows':[]};var _0x3483fe=_['map'](db[_0x08ba('0x2c')][_0x08ba('0x2d')],function(_0x519f54){return{'name':_0x519f54['fieldName'],'type':_0x519f54['type'][_0x08ba('0x2e')]};});_0x419ff7[_0x08ba('0x2f')]=_[_0x08ba('0x30')](_0x3483fe,_0x08ba('0x2a'));_0x419ff7['query']=_[_0x08ba('0x31')](_0x1f8e64[_0x08ba('0x32')]);_0x419ff7[_0x08ba('0x33')]=_[_0x08ba('0x34')](_0x419ff7['model'],_0x419ff7[_0x08ba('0x32')]);_0x939b76[_0x08ba('0x35')]=_[_0x08ba('0x34')](_0x419ff7[_0x08ba('0x2f')],qs[_0x08ba('0x36')](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x36')]));_0x939b76[_0x08ba('0x35')]=_0x939b76['attributes'][_0x08ba('0x37')]?_0x939b76[_0x08ba('0x35')]:_0x419ff7[_0x08ba('0x2f')];if(!_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x38')]('nolimit')){_0x939b76[_0x08ba('0x1e')]=qs[_0x08ba('0x1e')](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x1e')]);_0x939b76[_0x08ba('0x1d')]=qs['offset'](_0x1f8e64[_0x08ba('0x32')]['offset']);}_0x939b76[_0x08ba('0x39')]=qs['sort'](_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3a')]);_0x939b76[_0x08ba('0x3b')]=qs[_0x08ba('0x33')](_[_0x08ba('0x3c')](_0x1f8e64[_0x08ba('0x32')],_0x419ff7[_0x08ba('0x33')]),_0x3483fe);if(_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3d')]){_0x939b76[_0x08ba('0x3b')]=_[_0x08ba('0x3e')](_0x939b76[_0x08ba('0x3b')],{'$or':_[_0x08ba('0x30')](_0x3483fe,function(_0x268d30){if(_0x268d30['type']!==_0x08ba('0x3f')){var _0x222690={};_0x222690[_0x268d30[_0x08ba('0x2a')]]={'$like':'%'+_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x3d')]+'%'};return _0x222690;}})});}_0x939b76=_[_0x08ba('0x3e')]({},_0x939b76,_0x1f8e64['options']);var _0x4de276={'where':_0x939b76[_0x08ba('0x3b')]};return db['DeskField'][_0x08ba('0x20')](_0x4de276)[_0x08ba('0x25')](function(_0x3b8a54){_0x56194a['count']=_0x3b8a54;if(_0x1f8e64[_0x08ba('0x32')][_0x08ba('0x40')]){_0x939b76['include']=[{'all':!![]}];}return db['DeskField'][_0x08ba('0x41')](_0x939b76);})[_0x08ba('0x25')](function(_0x546bfe){_0x56194a[_0x08ba('0x42')]=_0x546bfe;return _0x56194a;})[_0x08ba('0x25')](respondWithFilteredResult(_0xb67f0d,_0x939b76))['catch'](handleError(_0xb67f0d,null));};exports[_0x08ba('0x43')]=function(_0x280707,_0x403d74){var _0x474730={'raw':!![],'where':{'id':_0x280707['params']['id']}},_0x519375={};_0x519375[_0x08ba('0x2f')]=_['keys'](db[_0x08ba('0x2c')]['rawAttributes']);_0x519375['query']=_[_0x08ba('0x31')](_0x280707['query']);_0x519375[_0x08ba('0x33')]=_[_0x08ba('0x34')](_0x519375[_0x08ba('0x2f')],_0x519375[_0x08ba('0x32')]);_0x474730[_0x08ba('0x35')]=_['intersection'](_0x519375['model'],qs[_0x08ba('0x36')](_0x280707[_0x08ba('0x32')][_0x08ba('0x36')]));_0x474730['attributes']=_0x474730[_0x08ba('0x35')][_0x08ba('0x37')]?_0x474730['attributes']:_0x519375[_0x08ba('0x2f')];if(_0x280707[_0x08ba('0x32')][_0x08ba('0x40')]){_0x474730[_0x08ba('0x44')]=[{'all':!![]}];}_0x474730=_[_0x08ba('0x3e')]({},_0x474730,_0x280707[_0x08ba('0x45')]);return db['DeskField'][_0x08ba('0x46')](_0x474730)[_0x08ba('0x25')](handleEntityNotFound(_0x403d74,null))['then'](respondWithResult(_0x403d74,null))[_0x08ba('0x47')](handleError(_0x403d74,null));};exports[_0x08ba('0x48')]=function(_0x178271,_0x42e474){return db[_0x08ba('0x2c')]['create'](_0x178271[_0x08ba('0x49')],{})[_0x08ba('0x25')](respondWithResult(_0x42e474,0xc9))[_0x08ba('0x47')](handleError(_0x42e474,null));};exports[_0x08ba('0x24')]=function(_0x39f960,_0x1cb435){if(_0x39f960[_0x08ba('0x49')]['id']){delete _0x39f960['body']['id'];}return db[_0x08ba('0x2c')][_0x08ba('0x46')]({'where':{'id':_0x39f960[_0x08ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1cb435,null))[_0x08ba('0x25')](saveUpdates(_0x39f960[_0x08ba('0x49')],null))[_0x08ba('0x25')](respondWithResult(_0x1cb435,null))['catch'](handleError(_0x1cb435,null));};exports[_0x08ba('0x26')]=function(_0x20b1b0,_0x1679a1){return db[_0x08ba('0x2c')][_0x08ba('0x46')]({'where':{'id':_0x20b1b0[_0x08ba('0x4a')]['id']}})[_0x08ba('0x25')](handleEntityNotFound(_0x1679a1,null))[_0x08ba('0x25')](removeEntity(_0x1679a1,null))[_0x08ba('0x47')](handleError(_0x1679a1,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c044f46..6244fdf 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 _0xf4d9=['../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x2ffe8d,_0x8b883b){var _0x425b59=function(_0x418089){while(--_0x418089){_0x2ffe8d['push'](_0x2ffe8d['shift']());}};_0x425b59(++_0x8b883b);}(_0xf4d9,0xd9));var _0x9f4d=function(_0x1826ad,_0x2c23a3){_0x1826ad=_0x1826ad-0x0;var _0x593b66=_0xf4d9[_0x1826ad];return _0x593b66;};'use strict';var _=require(_0x9f4d('0x0'));var util=require(_0x9f4d('0x1'));var logger=require(_0x9f4d('0x2'))(_0x9f4d('0x3'));var moment=require(_0x9f4d('0x4'));var BPromise=require(_0x9f4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var attributes=require(_0x9f4d('0x8'));module[_0x9f4d('0x9')]=function(_0x97642e,_0x1b72e8){return _0x97642e[_0x9f4d('0xa')]('DeskField',attributes,{'tableName':_0x9f4d('0xb'),'paranoid':![],'indexes':[{'name':_0x9f4d('0xc'),'fields':[_0x9f4d('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a41=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x7a41,0x1ee));var _0x17a4=function(_0x1911eb,_0x32b62d){_0x1911eb=_0x1911eb-0x0;var _0x4c6608=_0x7a41[_0x1911eb];return _0x4c6608;};'use strict';var _=require(_0x17a4('0x0'));var util=require(_0x17a4('0x1'));var logger=require(_0x17a4('0x2'))(_0x17a4('0x3'));var moment=require(_0x17a4('0x4'));var BPromise=require(_0x17a4('0x5'));var rp=require(_0x17a4('0x6'));var fs=require('fs');var path=require(_0x17a4('0x7'));var rimraf=require(_0x17a4('0x8'));var config=require(_0x17a4('0x9'));var attributes=require(_0x17a4('0xa'));module['exports']=function(_0x46f021,_0x2a2b1e){return _0x46f021['define'](_0x17a4('0xb'),attributes,{'tableName':_0x17a4('0xc'),'paranoid':![],'indexes':[{'name':_0x17a4('0xd'),'fields':[_0x17a4('0xe'),_0x17a4('0xf')],'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 d54edcf..ae7ba53 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 _0xe6e7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util'];(function(_0x2b2535,_0x1145c){var _0x5677da=function(_0x528393){while(--_0x528393){_0x2b2535['push'](_0x2b2535['shift']());}};_0x5677da(++_0x1145c);}(_0xe6e7,0x117));var _0x7e6e=function(_0x5142c,_0xf563b4){_0x5142c=_0x5142c-0x0;var _0xcb3e23=_0xe6e7[_0x5142c];return _0xcb3e23;};'use strict';var _=require('lodash');var util=require(_0x7e6e('0x0'));var moment=require('moment');var BPromise=require(_0x7e6e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e6e('0x2'));var db=require(_0x7e6e('0x3'))['db'];var utils=require(_0x7e6e('0x4'));var logger=require(_0x7e6e('0x5'))(_0x7e6e('0x6'));var config=require(_0x7e6e('0x7'));var jayson=require(_0x7e6e('0x8'));var client=jayson['client'][_0x7e6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29dcc8,_0xb6fbdb,_0x573a8a){return new BPromise(function(_0x289b14,_0x1e7bd6){return client[_0x7e6e('0xa')](_0x29dcc8,_0x573a8a)[_0x7e6e('0xb')](function(_0xd12f32){logger[_0x7e6e('0xc')](_0x7e6e('0xd'),_0xb6fbdb,_0x7e6e('0xe'));logger['debug'](_0x7e6e('0xf'),_0xb6fbdb,'request\x20sent',JSON['stringify'](_0xd12f32));if(_0xd12f32[_0x7e6e('0x10')]){if(_0xd12f32[_0x7e6e('0x10')][_0x7e6e('0x11')]===0x1f4){logger[_0x7e6e('0x10')](_0x7e6e('0xd'),_0xb6fbdb,_0xd12f32[_0x7e6e('0x10')][_0x7e6e('0x12')]);return _0x1e7bd6(_0xd12f32[_0x7e6e('0x10')][_0x7e6e('0x12')]);}logger['error'](_0x7e6e('0xd'),_0xb6fbdb,_0xd12f32[_0x7e6e('0x10')][_0x7e6e('0x12')]);return _0x289b14(_0xd12f32[_0x7e6e('0x10')][_0x7e6e('0x12')]);}else{logger[_0x7e6e('0xc')](_0x7e6e('0xd'),_0xb6fbdb,_0x7e6e('0xe'));_0x289b14(_0xd12f32['result'][_0x7e6e('0x12')]);}})[_0x7e6e('0x13')](function(_0x5520a6){logger[_0x7e6e('0x10')](_0x7e6e('0xd'),_0xb6fbdb,_0x5520a6);_0x1e7bd6(_0x5520a6);});});} \ No newline at end of file +var _0xc871=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc871,0x19e));var _0x1c87=function(_0x50fc00,_0x2ac272){_0x50fc00=_0x50fc00-0x0;var _0x43a96f=_0xc871[_0x50fc00];return _0x43a96f;};'use strict';var _=require(_0x1c87('0x0'));var util=require(_0x1c87('0x1'));var moment=require('moment');var BPromise=require(_0x1c87('0x2'));var rs=require(_0x1c87('0x3'));var fs=require('fs');var Redis=require(_0x1c87('0x4'));var db=require(_0x1c87('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c87('0x6'))(_0x1c87('0x7'));var config=require(_0x1c87('0x8'));var jayson=require(_0x1c87('0x9'));var client=jayson[_0x1c87('0xa')][_0x1c87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x311a93,_0x12eb0a,_0x241199){return new BPromise(function(_0x35e764,_0x5997ee){return client[_0x1c87('0xc')](_0x311a93,_0x241199)[_0x1c87('0xd')](function(_0x34413b){logger['info'](_0x1c87('0xe'),_0x12eb0a,_0x1c87('0xf'));logger['debug'](_0x1c87('0x10'),_0x12eb0a,'request\x20sent',JSON[_0x1c87('0x11')](_0x34413b));if(_0x34413b[_0x1c87('0x12')]){if(_0x34413b['error']['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x12eb0a,_0x34413b[_0x1c87('0x12')][_0x1c87('0x13')]);return _0x5997ee(_0x34413b['error'][_0x1c87('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x12eb0a,_0x34413b[_0x1c87('0x12')][_0x1c87('0x13')]);return _0x35e764(_0x34413b[_0x1c87('0x12')]['message']);}else{logger[_0x1c87('0x14')](_0x1c87('0xe'),_0x12eb0a,_0x1c87('0xf'));_0x35e764(_0x34413b['result'][_0x1c87('0x13')]);}})[_0x1c87('0x15')](function(_0xf1b951){logger[_0x1c87('0x12')](_0x1c87('0xe'),_0x12eb0a,_0xf1b951);_0x5997ee(_0xf1b951);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a8d052c..c5affc4 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 _0xc5a4=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x564f43,_0x16ae42){var _0x30ac16=function(_0x30f48c){while(--_0x30f48c){_0x564f43['push'](_0x564f43['shift']());}};_0x30ac16(++_0x16ae42);}(_0xc5a4,0x80));var _0x4c5a=function(_0x28f386,_0x1a42c2){_0x28f386=_0x28f386-0x0;var _0x16d5b5=_0xc5a4[_0x28f386];return _0x16d5b5;};'use strict';var multer=require(_0x4c5a('0x0'));var util=require(_0x4c5a('0x1'));var path=require('path');var timeout=require(_0x4c5a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4c5a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4c5a('0x4'));var config=require(_0x4c5a('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x4c5a('0x6')]('/',auth[_0x4c5a('0x7')](),controller[_0x4c5a('0x8')]);router[_0x4c5a('0x6')](_0x4c5a('0x9'),auth[_0x4c5a('0x7')](),controller[_0x4c5a('0xa')]);router['get'](_0x4c5a('0xb'),auth['isAuthenticated'](),controller[_0x4c5a('0xc')]);router['get'](_0x4c5a('0xd'),auth[_0x4c5a('0x7')](),controller[_0x4c5a('0xe')]);router[_0x4c5a('0xf')]('/',auth[_0x4c5a('0x7')](),controller['create']);router[_0x4c5a('0xf')]('/:id/configurations',auth[_0x4c5a('0x7')](),controller[_0x4c5a('0x10')]);router[_0x4c5a('0x11')](_0x4c5a('0x9'),auth['isAuthenticated'](),controller[_0x4c5a('0x12')]);router[_0x4c5a('0x13')]('/:id',auth[_0x4c5a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x25e2=['show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id'];(function(_0x492e08,_0x2a23c2){var _0x5abbc4=function(_0xcf5611){while(--_0xcf5611){_0x492e08['push'](_0x492e08['shift']());}};_0x5abbc4(++_0x2a23c2);}(_0x25e2,0x1ae));var _0x225e=function(_0x491fbc,_0x1a708a){_0x491fbc=_0x491fbc-0x0;var _0x2559d7=_0x25e2[_0x491fbc];return _0x2559d7;};'use strict';var multer=require(_0x225e('0x0'));var util=require('util');var path=require(_0x225e('0x1'));var timeout=require(_0x225e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x225e('0x3'));var interaction=require(_0x225e('0x4'));var config=require(_0x225e('0x5'));var controller=require(_0x225e('0x6'));router[_0x225e('0x7')]('/',auth[_0x225e('0x8')](),controller[_0x225e('0x9')]);router[_0x225e('0x7')](_0x225e('0xa'),auth[_0x225e('0x8')](),controller[_0x225e('0xb')]);router[_0x225e('0x7')]('/:id/configurations',auth[_0x225e('0x8')](),controller['getConfigurations']);router[_0x225e('0x7')](_0x225e('0xc'),auth[_0x225e('0x8')](),controller[_0x225e('0xd')]);router[_0x225e('0xe')]('/',auth['isAuthenticated'](),controller[_0x225e('0xf')]);router[_0x225e('0xe')](_0x225e('0x10'),auth[_0x225e('0x8')](),controller[_0x225e('0x11')]);router['put']('/:id',auth[_0x225e('0x8')](),controller['update']);router[_0x225e('0x12')](_0x225e('0xa'),auth[_0x225e('0x8')](),controller[_0x225e('0x13')]);module[_0x225e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f34aefe..594aaef 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 _0x6657=['STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x6657[_0x1deee5];return _0x1d6c3a;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')]},'username':{'type':Sequelize[_0x7665('0x1')]},'password':{'type':Sequelize[_0x7665('0x1')]},'remoteUri':{'type':Sequelize[_0x7665('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x7665('0x1')]},'clientSecret':{'type':Sequelize[_0x7665('0x1')]},'serverUrl':{'type':Sequelize[_0x7665('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7665('0x1')]},'modernAuthentication':{'type':Sequelize[_0x7665('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc4aa=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4fcb07,_0x4a77a4){var _0xf2eeb=function(_0x279b1a){while(--_0x279b1a){_0x4fcb07['push'](_0x4fcb07['shift']());}};_0xf2eeb(++_0x4a77a4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')]},'username':{'type':Sequelize[_0xac4a('0x2')]},'password':{'type':Sequelize[_0xac4a('0x2')]},'remoteUri':{'type':Sequelize[_0xac4a('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'modernAuthentication':{'type':Sequelize[_0xac4a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 316c3d9..a35505d 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 _0x585b=['slainvokedidname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','modernAuthentication','CloudProvider','access_token','data5','data7','POST','/oauth2/token','clientId','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','forEach','@odata.type','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','statusCode','error','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','LogicalName','DisplayName','Label','EntityDefinitions(','TrueOption','true','FalseOption','false','request-promise','util','../../config/logger','../../mysqldb','status','json','undefined','limit','count','offset','set','update','then','end','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','Dynamics365Account','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','options','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x585b,0x1af));var _0xb585=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x585b[_0x27af45];return _0x18df21;};'use strict';var rp=require(_0xb585('0x0'));var util=require(_0xb585('0x1'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xb585('0x2'))('api');var db=require(_0xb585('0x3'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x4db6de,_0x5cc948){_0x5cc948=_0x5cc948||0xc8;return function(_0x18c863){if(_0x18c863){return _0x4db6de[_0xb585('0x4')](_0x5cc948)[_0xb585('0x5')](_0x18c863);}};}function respondWithFilteredResult(_0x474970,_0x378aff){return function(_0x4cb936){if(_0x4cb936){var _0x1488a5=typeof _0x378aff['offset']===_0xb585('0x6')&&typeof _0x378aff[_0xb585('0x7')]===_0xb585('0x6');var _0x104e16=_0x4cb936[_0xb585('0x8')];var _0x2ca0d8=_0x1488a5?0x0:_0x378aff['offset'];var _0x39bb98=_0x1488a5?_0x4cb936[_0xb585('0x8')]:_0x378aff[_0xb585('0x9')]+_0x378aff[_0xb585('0x7')];var _0x164cfc;if(_0x39bb98>=_0x104e16){_0x39bb98=_0x104e16;_0x164cfc=0xc8;}else{_0x164cfc=0xce;}_0x474970['status'](_0x164cfc);return _0x474970[_0xb585('0xa')]('Content-Range',_0x2ca0d8+'-'+_0x39bb98+'/'+_0x104e16)[_0xb585('0x5')](_0x4cb936);}return null;};}function saveUpdates(_0x5a3a13){return function(_0xf47426){if(_0xf47426){return _0xf47426[_0xb585('0xb')](_0x5a3a13)[_0xb585('0xc')](function(_0x1d9275){return _0x1d9275;});}return null;};}function removeEntity(_0x20a127){return function(_0x55a960){if(_0x55a960){return _0x55a960['destroy']()[_0xb585('0xc')](function(){_0x20a127[_0xb585('0x4')](0xcc)[_0xb585('0xd')]();});}};}function handleEntityNotFound(_0x3db57c){return function(_0x1550fc){if(!_0x1550fc){_0x3db57c[_0xb585('0xe')](0x194);}return _0x1550fc;};}function handleError(_0x5e1d1f,_0x54590d){_0x54590d=_0x54590d||0x1f4;return function(_0x2a57de){logger['error'](_0x2a57de[_0xb585('0xf')]);if(_0x2a57de[_0xb585('0x10')]){delete _0x2a57de[_0xb585('0x10')];}_0x5e1d1f[_0xb585('0x4')](_0x54590d)['send'](_0x2a57de);};}exports['index']=function(_0x49ca8a,_0x101828){var _0x1b4e9e={},_0x4149e8={},_0x4b7beb={'count':0x0,'rows':[]};var _0x5200f2=_[_0xb585('0x11')](db['Dynamics365Account'][_0xb585('0x12')],function(_0x482340){return{'name':_0x482340[_0xb585('0x13')],'type':_0x482340[_0xb585('0x14')][_0xb585('0x15')]};});_0x4149e8['model']=_['map'](_0x5200f2,_0xb585('0x10'));_0x4149e8['query']=_[_0xb585('0x16')](_0x49ca8a[_0xb585('0x17')]);_0x4149e8['filters']=_['intersection'](_0x4149e8['model'],_0x4149e8['query']);_0x1b4e9e[_0xb585('0x18')]=_[_0xb585('0x19')](_0x4149e8[_0xb585('0x1a')],qs[_0xb585('0x1b')](_0x49ca8a['query'][_0xb585('0x1b')]));_0x1b4e9e['attributes']=_0x1b4e9e['attributes'][_0xb585('0x1c')]?_0x1b4e9e[_0xb585('0x18')]:_0x4149e8[_0xb585('0x1a')];if(!_0x49ca8a[_0xb585('0x17')][_0xb585('0x1d')]('nolimit')){_0x1b4e9e[_0xb585('0x7')]=qs[_0xb585('0x7')](_0x49ca8a[_0xb585('0x17')][_0xb585('0x7')]);_0x1b4e9e['offset']=qs[_0xb585('0x9')](_0x49ca8a[_0xb585('0x17')][_0xb585('0x9')]);}_0x1b4e9e[_0xb585('0x1e')]=qs[_0xb585('0x1f')](_0x49ca8a['query'][_0xb585('0x1f')]);_0x1b4e9e[_0xb585('0x20')]=qs[_0xb585('0x21')](_[_0xb585('0x22')](_0x49ca8a[_0xb585('0x17')],_0x4149e8['filters']),_0x5200f2);if(_0x49ca8a['query'][_0xb585('0x23')]){_0x1b4e9e['where']=_[_0xb585('0x24')](_0x1b4e9e[_0xb585('0x20')],{'$or':_['map'](_0x5200f2,function(_0x5b9877){if(_0x5b9877[_0xb585('0x14')]!=='VIRTUAL'){var _0x44cffd={};_0x44cffd[_0x5b9877[_0xb585('0x10')]]={'$like':'%'+_0x49ca8a[_0xb585('0x17')]['filter']+'%'};return _0x44cffd;}})});}_0x1b4e9e=_['merge']({},_0x1b4e9e,_0x49ca8a['options']);var _0x513e10={'where':_0x1b4e9e[_0xb585('0x20')]};return db['Dynamics365Account'][_0xb585('0x8')](_0x513e10)['then'](function(_0x544ee7){_0x4b7beb['count']=_0x544ee7;if(_0x49ca8a[_0xb585('0x17')][_0xb585('0x25')]){_0x1b4e9e[_0xb585('0x26')]=[{'all':!![]}];}return db[_0xb585('0x27')][_0xb585('0x28')](_0x1b4e9e);})['then'](function(_0x35fecb){_0x4b7beb[_0xb585('0x29')]=_0x35fecb;return _0x4b7beb;})['then'](respondWithFilteredResult(_0x101828,_0x1b4e9e))[_0xb585('0x2a')](handleError(_0x101828,null));};exports[_0xb585('0x2b')]=function(_0x2e284b,_0x441a2c){var _0x5899c3={'raw':![],'where':{'id':_0x2e284b[_0xb585('0x2c')]['id']}},_0x17c7f8={};_0x17c7f8['model']=_['keys'](db[_0xb585('0x27')][_0xb585('0x12')]);_0x17c7f8[_0xb585('0x17')]=_[_0xb585('0x16')](_0x2e284b['query']);_0x17c7f8['filters']=_[_0xb585('0x19')](_0x17c7f8[_0xb585('0x1a')],_0x17c7f8[_0xb585('0x17')]);_0x5899c3[_0xb585('0x18')]=_['intersection'](_0x17c7f8[_0xb585('0x1a')],qs[_0xb585('0x1b')](_0x2e284b[_0xb585('0x17')][_0xb585('0x1b')]));_0x5899c3[_0xb585('0x18')]=_0x5899c3['attributes'][_0xb585('0x1c')]?_0x5899c3[_0xb585('0x18')]:_0x17c7f8[_0xb585('0x1a')];if(_0x2e284b[_0xb585('0x17')][_0xb585('0x25')]){_0x5899c3[_0xb585('0x26')]=[{'all':!![]}];}_0x5899c3=_[_0xb585('0x24')]({},_0x5899c3,_0x2e284b['options']);return db['Dynamics365Account'][_0xb585('0x2d')](_0x5899c3)['then'](handleEntityNotFound(_0x441a2c,null))['then'](respondWithResult(_0x441a2c,null))[_0xb585('0x2a')](handleError(_0x441a2c,null));};exports[_0xb585('0x2e')]=function(_0x35dfa1,_0x6e542){return db[_0xb585('0x27')][_0xb585('0x2e')](_0x35dfa1['body'],{})[_0xb585('0xc')](respondWithResult(_0x6e542,0xc9))[_0xb585('0x2a')](handleError(_0x6e542,null));};exports[_0xb585('0xb')]=function(_0x37f4d6,_0x9f5e34){if(_0x37f4d6['body']['id']){delete _0x37f4d6[_0xb585('0x2f')]['id'];}return db['Dynamics365Account'][_0xb585('0x2d')]({'where':{'id':_0x37f4d6[_0xb585('0x2c')]['id']}})['then'](handleEntityNotFound(_0x9f5e34,null))[_0xb585('0xc')](saveUpdates(_0x37f4d6[_0xb585('0x2f')],null))[_0xb585('0xc')](respondWithResult(_0x9f5e34,null))['catch'](handleError(_0x9f5e34,null));};exports[_0xb585('0x30')]=function(_0x59ab4d,_0x4e82c2){return db['Dynamics365Account'][_0xb585('0x2d')]({'where':{'id':_0x59ab4d[_0xb585('0x2c')]['id']}})[_0xb585('0xc')](handleEntityNotFound(_0x4e82c2,null))[_0xb585('0xc')](removeEntity(_0x4e82c2,null))['catch'](handleError(_0x4e82c2,null));};exports[_0xb585('0x31')]=function(_0x2389b4,_0x3baf04){var _0x517d60={};var _0x1fd1c7={};var _0x43e570;var _0x327b84;return db['Dynamics365Account'][_0xb585('0x32')]({'where':{'id':_0x2389b4[_0xb585('0x2c')]['id']}})[_0xb585('0xc')](handleEntityNotFound(_0x3baf04,null))['then'](function(_0x532d8c){if(_0x532d8c){_0x43e570=_0x532d8c;_0x1fd1c7[_0xb585('0x1a')]=_[_0xb585('0x16')](db[_0xb585('0x33')][_0xb585('0x12')]);_0x1fd1c7[_0xb585('0x17')]=_[_0xb585('0x16')](_0x2389b4['query']);_0x1fd1c7[_0xb585('0x21')]=_[_0xb585('0x19')](_0x1fd1c7[_0xb585('0x1a')],_0x1fd1c7[_0xb585('0x17')]);_0x517d60[_0xb585('0x18')]=_[_0xb585('0x19')](_0x1fd1c7[_0xb585('0x1a')],qs['fields'](_0x2389b4['query'][_0xb585('0x1b')]));_0x517d60[_0xb585('0x18')]=_0x517d60[_0xb585('0x18')][_0xb585('0x1c')]?_0x517d60[_0xb585('0x18')]:_0x1fd1c7[_0xb585('0x1a')];_0x517d60[_0xb585('0x1e')]=qs[_0xb585('0x1f')](_0x2389b4[_0xb585('0x17')][_0xb585('0x1f')]);_0x517d60[_0xb585('0x20')]=qs[_0xb585('0x21')](_[_0xb585('0x22')](_0x2389b4[_0xb585('0x17')],_0x1fd1c7[_0xb585('0x21')]));if(_0x2389b4[_0xb585('0x17')][_0xb585('0x23')]){_0x517d60[_0xb585('0x20')]=_[_0xb585('0x24')](_0x517d60[_0xb585('0x20')],{'$or':_[_0xb585('0x11')](_0x517d60[_0xb585('0x18')],function(_0x8bd147){var _0xf119ca={};_0xf119ca[_0x8bd147]={'$like':'%'+_0x2389b4[_0xb585('0x17')][_0xb585('0x23')]+'%'};return _0xf119ca;})});}_0x517d60=_[_0xb585('0x24')]({},_0x517d60,_0x2389b4[_0xb585('0x34')]);return _0x43e570['getConfigurations'](_0x517d60);}})['then'](function(_0x2bf828){if(_0x2bf828){_0x327b84=_0x2bf828['length'];if(!_0x2389b4[_0xb585('0x17')]['hasOwnProperty'](_0xb585('0x35'))){_0x517d60['limit']=qs[_0xb585('0x7')](_0x2389b4['query'][_0xb585('0x7')]);_0x517d60[_0xb585('0x9')]=qs[_0xb585('0x9')](_0x2389b4[_0xb585('0x17')][_0xb585('0x9')]);}return _0x43e570[_0xb585('0x31')](_0x517d60);}})[_0xb585('0xc')](function(_0x3a0283){if(_0x3a0283){return _0x3a0283?{'count':_0x327b84,'rows':_0x3a0283}:null;}})[_0xb585('0xc')](respondWithResult(_0x3baf04,null))[_0xb585('0x2a')](handleError(_0x3baf04,null));};exports[_0xb585('0x36')]=function(_0x1a7490,_0x438729){if(_0x1a7490[_0xb585('0x2f')]['id']){delete _0x1a7490[_0xb585('0x2f')]['id'];}return db[_0xb585('0x27')][_0xb585('0x32')]({'where':{'id':_0x1a7490['params']['id']}})[_0xb585('0xc')](handleEntityNotFound(_0x438729,null))[_0xb585('0xc')](function(_0x490baa){if(_0x490baa){_0x1a7490[_0xb585('0x2f')]['AccountId']=_0x490baa['id'];_0x1a7490[_0xb585('0x2f')][_0xb585('0x37')]=integrations[_0xb585('0x38')](_0x1a7490[_0xb585('0x2f')][_0xb585('0x39')],_0x1a7490['body'][_0xb585('0x14')]);_0x1a7490['body']['Descriptions']=integrations[_0xb585('0x3a')](_0x1a7490['body'][_0xb585('0x39')],_0x1a7490['body'][_0xb585('0x14')]);return db['Dynamics365Configuration'][_0xb585('0x2e')](_0x1a7490[_0xb585('0x2f')],{'include':[{'model':db[_0xb585('0x3b')],'as':_0xb585('0x37')},{'model':db[_0xb585('0x3b')],'as':_0xb585('0x3c')}]});}return null;})['then'](respondWithResult(_0x438729,null))[_0xb585('0x2a')](handleError(_0x438729,null));};function sanitizeRemoteUri(_0x68fcab){var _0x2ca5ee=_0x68fcab[_0xb585('0x3d')](-0x1);if(_0x2ca5ee==='/')return _0x68fcab[_0xb585('0x3e')](0x0,_0x68fcab[_0xb585('0x3f')](_0x2ca5ee));return _0x68fcab;}function getWebApiUrl(_0x5a8f4b){return util[_0xb585('0x40')](_0xb585('0x41'),_0x5a8f4b);}exports[_0xb585('0x42')]=function(_0x254190,_0x5eea3a){var _0x4efdf2=_0x254190[_0xb585('0x17')][_0xb585('0x43')];var _0x40f881=_0x4efdf2===_0xb585('0x44')?_0xb585('0x45'):_0xb585('0x46');var _0x1dbc68='';var _0x1919e2='';var _0x1b8221='';var _0x45c9fa='';var _0x3abc31='';var _0x266de7='';var _0x38bd2c='';var _0x4448a0='';var _0x263099=[_0xb585('0x47'),_0xb585('0x48'),_0xb585('0x49'),'ownerid',_0xb585('0x4a'),_0xb585('0x4b'),_0xb585('0x4c'),'regardingobjectid','directioncode',_0xb585('0x4d')];var _0x33725b=[_0xb585('0x4e'),'accountidyominame','actualserviceunits',_0xb585('0x4f'),_0xb585('0x50'),_0xb585('0x51'),_0xb585('0x52'),_0xb585('0x53'),'createdbyexternalpartyname',_0xb585('0x54'),_0xb585('0x55'),_0xb585('0x56'),'createdon',_0xb585('0x57'),_0xb585('0x58'),_0xb585('0x59'),_0xb585('0x5a'),_0xb585('0x5b'),'emailaddress','entitlementidname',_0xb585('0x5c'),'entityimage_url',_0xb585('0x5d'),_0xb585('0x5e'),_0xb585('0x5f'),_0xb585('0x60'),'importsequencenumber',_0xb585('0x61'),'kbarticleidname',_0xb585('0x62'),_0xb585('0x63'),'modifiedbyexternalpartyname',_0xb585('0x64'),_0xb585('0x65'),_0xb585('0x66'),_0xb585('0x67'),'modifiedonbehalfbyname',_0xb585('0x68'),_0xb585('0x69'),_0xb585('0x6a'),'numberofchildincidents',_0xb585('0x6b'),_0xb585('0x6c'),_0xb585('0x6d'),_0xb585('0x6e'),_0xb585('0x6f'),_0xb585('0x70'),_0xb585('0x71'),'primarycontactidyominame',_0xb585('0x72'),_0xb585('0x73'),_0xb585('0x74'),'resolveby',_0xb585('0x75'),_0xb585('0x76'),_0xb585('0x77'),_0xb585('0x78'),'sentimentvalue',_0xb585('0x79'),'slaname',_0xb585('0x7a'),_0xb585('0x7b'),'statuscode',_0xb585('0x7c'),_0xb585('0x7d'),'timezoneruleversionnumber',_0xb585('0x7e'),'traversedpath',_0xb585('0x7f'),_0xb585('0x80')];var _0x352d97=_0x263099['concat'](_0x33725b);return db[_0xb585('0x27')]['findOne']({'where':{'id':_0x254190[_0xb585('0x2c')]['id']},'attributes':['id',_0xb585('0x81'),'password',_0xb585('0x82'),_0xb585('0x83'),'clientId','clientSecret',_0xb585('0x84')],'include':[{'model':db[_0xb585('0x85')],'as':_0xb585('0x85'),'attributes':['id','data5','data7']}]})['then'](handleEntityNotFound(_0x5eea3a,null))['then'](function(_0x440629){if(_0x440629){if(_0x440629['modernAuthentication']){_0x440629[_0xb585('0x86')]=_0x440629[_0xb585('0x85')][_0xb585('0x87')];_0x4448a0=sanitizeRemoteUri(_0x440629[_0xb585('0x85')][_0xb585('0x88')]);_0x38bd2c=getWebApiUrl(_0x4448a0);return _0x440629;}_0x4448a0=sanitizeRemoteUri(_0x440629[_0xb585('0x82')]);_0x38bd2c=getWebApiUrl(_0x4448a0);var _0x136be0={'method':_0xb585('0x89'),'uri':'https://login.microsoftonline.com/'+_0x440629[_0xb585('0x83')]+_0xb585('0x8a'),'form':{'client_id':_0x440629[_0xb585('0x8b')],'resource':_0x4448a0,'username':_0x440629[_0xb585('0x81')],'password':_0x440629[_0xb585('0x8c')],'grant_type':_0xb585('0x8c'),'client_secret':_0x440629[_0xb585('0x8d')]},'json':!![]};return rp(_0x136be0);}})['then'](function(_0x5953b0){_0x266de7=_0x5953b0[_0xb585('0x86')];var _0x220941={'method':'GET','uri':encodeURI(_0x38bd2c+_0xb585('0x8e')+_0x40f881+'\x27'),'headers':{'Authorization':_0xb585('0x8f')+_0x266de7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x220941);})[_0xb585('0xc')](function(_0x3fe1a4){var _0x3d9fdc=_0x3fe1a4[_0xb585('0x90')][0x0];var _0x5ef7c5=_0x3d9fdc[_0xb585('0x91')];var _0x544d17={'method':_0xb585('0x92'),'uri':_0x38bd2c+'EntityDefinitions('+_0x5ef7c5+_0xb585('0x93'),'headers':{'Authorization':_0xb585('0x8f')+_0x266de7,'If-None-Match':null,'OData-Version':_0xb585('0x94')},'json':!![]};return rp(_0x544d17);})['then'](function(_0x15f6c0){_0x1dbc68=_0x15f6c0;_0x1919e2=_0x1dbc68[_0xb585('0x95')];_0x1919e2=_[_0xb585('0x96')](_0x1919e2,function(_0x506372){return!_0x352d97['includes'](_0x506372['LogicalName']);});var _0x1ddf68=[];var _0x1c019d=[];_0x1919e2[_0xb585('0x97')](function(_0xb509a1){if(_0xb509a1['@odata.type']){var _0x35c4b9=_0xb509a1[_0xb585('0x98')][_0xb585('0x3e')](_0xb509a1[_0xb585('0x98')]['lastIndexOf']('.')+0x1);if(_0x35c4b9==='PicklistAttributeMetadata'){_0x1ddf68[_0xb585('0x99')](getSelectList(_0x38bd2c,_0x4efdf2,_0x1c019d,_0x1dbc68['MetadataId'],_0xb509a1[_0xb585('0x91')],_0x266de7));}}});return Promise[_0xb585('0x9a')](_0x1ddf68);})[_0xb585('0xc')](function(_0x54ba9e){_0x1b8221=_0x54ba9e[0x0];var _0x1c0601=[];var _0x372c3e=[];_0x1919e2[_0xb585('0x97')](function(_0x4c57b8){if(!_[_0xb585('0x9b')](_0x4c57b8['@odata.type'])){var _0x70ae08=_0x4c57b8[_0xb585('0x98')]['substring'](_0x4c57b8[_0xb585('0x98')]['lastIndexOf']('.')+0x1);if(_0x70ae08==='BooleanAttributeMetadata'){_0x1c0601['push'](getBooleanList(_0x38bd2c,_0x4efdf2,_0x372c3e,_0x1dbc68[_0xb585('0x91')],_0x4c57b8[_0xb585('0x91')],_0x266de7));}}});return Promise[_0xb585('0x9a')](_0x1c0601);})['then'](function(_0x4263e3){_0x45c9fa=_0x4263e3[0x0];var _0x894a93=[];var _0x52233a=[];_0x1919e2['forEach'](function(_0x5a8d94){if(_0x5a8d94[_0xb585('0x98')]){var _0x25493c=_0x5a8d94['@odata.type']['substring'](_0x5a8d94[_0xb585('0x98')][_0xb585('0x3f')]('.')+0x1);if(_0x25493c===_0xb585('0x9c')||_0x25493c===_0xb585('0x9d')||_0x25493c===_0xb585('0x9e')||_0x25493c==='IntegerAttributeMetadata'||_0x25493c===_0xb585('0x9f')||_0x25493c===_0xb585('0xa0')||_0x25493c===_0xb585('0xa1')||_0x25493c===_0xb585('0xa2')||_0x25493c===_0xb585('0xa3')||_0x25493c==='DecimalAttributeMetadata'){_0x894a93[_0xb585('0x99')](getInputList(_0x38bd2c,_0x4efdf2,_0x25493c,_0x52233a,_0x1dbc68[_0xb585('0x91')],_0x5a8d94[_0xb585('0x91')],_0x266de7));}}});return Promise[_0xb585('0x9a')](_0x894a93);})[_0xb585('0xc')](function(_0x551f68){_0x3abc31=_0x551f68[0x0];var _0x42843a=_0x1b8221[_0xb585('0xa4')](_0x45c9fa)['concat'](_0x3abc31);var _0x13b6c5={'count':_0x42843a[_0xb585('0x1c')],'rows':_0x42843a};return _0x13b6c5;})[_0xb585('0xc')](respondWithResult(_0x5eea3a,null))[_0xb585('0x2a')](function(_0x1cb84b){var _0x4bb277=_0x254190[_0xb585('0x17')]['test']?0x1f4:_0x1cb84b[_0xb585('0xa5')]||0x1f4;logger[_0xb585('0xa6')](_0x1cb84b[_0xb585('0xf')]);delete _0x1cb84b[_0xb585('0x10')];if(_0x4bb277===0x191){_0x4bb277=0x190;}_0x5eea3a['status'](_0x4bb277)['send'](_0x254190['query'][_0xb585('0xa7')]?{'message':_0xb585('0xa8'),'statusCode':_0x1cb84b['statusCode']}:_0x1cb84b);});};function getSelectList(_0x102794,_0x1f38da,_0x5e1af9,_0x45e4d3,_0x563710,_0x35ea04){var _0x46f5c1={'method':_0xb585('0x92'),'uri':_0x102794+'EntityDefinitions('+_0x45e4d3+_0xb585('0xa9')+_0x563710+_0xb585('0xaa')+_0xb585('0xab'),'headers':{'Authorization':_0xb585('0x8f')+_0x35ea04,'If-None-Match':null,'OData-Version':_0xb585('0x94')},'json':!![]};return rp(_0x46f5c1)[_0xb585('0xc')](function(_0x3d10e1){var _0x55dbdf=[];var _0x2a7941=_0x3d10e1[_0xb585('0xac')][_0xb585('0xad')];_0x2a7941[_0xb585('0x97')](function(_0x9d1eef){_0x55dbdf['push']({'name':_0x9d1eef['Label'][_0xb585('0xae')]['Label'],'value':String(_0x9d1eef[_0xb585('0xaf')])});});var _0x5a6e9f={'id':_0x1f38da+'_'+_0x3d10e1[_0xb585('0xb0')],'name':_0x3d10e1[_0xb585('0xb1')]['UserLocalizedLabel'][_0xb585('0xb2')],'custom':![],'options':_0x55dbdf};_0x5e1af9[_0xb585('0x99')](_0x5a6e9f);return _0x5e1af9;});}function getBooleanList(_0x249834,_0x5c29a1,_0x72ecf7,_0x290c3,_0x18b6e7,_0xdb0acf){var _0x246a0b={'method':_0xb585('0x92'),'uri':_0x249834+_0xb585('0xb3')+_0x290c3+_0xb585('0xa9')+_0x18b6e7+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xb585('0x8f')+_0xdb0acf,'If-None-Match':null,'OData-Version':_0xb585('0x94')},'json':!![]};return rp(_0x246a0b)['then'](function(_0x455ceb){var _0xa83b81=[];_0xa83b81[_0xb585('0x99')]({'name':_0x455ceb['OptionSet'][_0xb585('0xb4')]['Label']['UserLocalizedLabel']['Label'],'value':_0xb585('0xb5')},{'name':_0x455ceb[_0xb585('0xac')][_0xb585('0xb6')]['Label'][_0xb585('0xae')][_0xb585('0xb2')],'value':_0xb585('0xb7')});var _0x4f39d5={'id':_0x5c29a1+'_'+_0x455ceb[_0xb585('0xb0')],'name':_0x455ceb[_0xb585('0xb1')][_0xb585('0xae')][_0xb585('0xb2')],'custom':![],'options':_0xa83b81};_0x72ecf7[_0xb585('0x99')](_0x4f39d5);return _0x72ecf7;});}function getInputList(_0x2292c0,_0x32d527,_0x570431,_0x56b025,_0x2e5915,_0x160460,_0x538755){var _0x2ef4ea={'method':_0xb585('0x92'),'uri':_0x2292c0+_0xb585('0xb3')+_0x2e5915+_0xb585('0xa9')+_0x160460+')/Microsoft.Dynamics.CRM.'+_0x570431+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xb585('0x8f')+_0x538755,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2ef4ea)[_0xb585('0xc')](function(_0x158b5f){var _0x23afb2={'id':_0x32d527+'_'+_0x158b5f[_0xb585('0xb0')],'name':_0x158b5f[_0xb585('0xb1')]['UserLocalizedLabel']?_0x158b5f[_0xb585('0xb1')]['UserLocalizedLabel']['Label']:_0x158b5f[_0xb585('0xb0')],'custom':![],'options':[]};_0x56b025['push'](_0x23afb2);return _0x56b025;});} \ No newline at end of file +var _0xbbd2=['subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','forEach','@odata.type','lastIndexOf','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','update','getConfigurations','order','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidname','actualserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xbbd2,0x100));var _0x2bbd=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xbbd2[_0x888385];return _0x22d5c2;};'use strict';var rp=require(_0x2bbd('0x0'));var util=require('util');var _=require(_0x2bbd('0x1'));var qs=require(_0x2bbd('0x2'));var logger=require(_0x2bbd('0x3'))(_0x2bbd('0x4'));var db=require(_0x2bbd('0x5'))['db'];var integrations=require(_0x2bbd('0x6'));function respondWithResult(_0x154ec8,_0x3565ca){_0x3565ca=_0x3565ca||0xc8;return function(_0x281058){if(_0x281058){return _0x154ec8[_0x2bbd('0x7')](_0x3565ca)[_0x2bbd('0x8')](_0x281058);}};}function respondWithFilteredResult(_0x23567a,_0xf43107){return function(_0x53fecf){if(_0x53fecf){var _0x2759df=typeof _0xf43107[_0x2bbd('0x9')]===_0x2bbd('0xa')&&typeof _0xf43107['limit']===_0x2bbd('0xa');var _0x3ce4e5=_0x53fecf[_0x2bbd('0xb')];var _0x3d582e=_0x2759df?0x0:_0xf43107[_0x2bbd('0x9')];var _0x1f1e00=_0x2759df?_0x53fecf[_0x2bbd('0xb')]:_0xf43107['offset']+_0xf43107[_0x2bbd('0xc')];var _0x3de9b0;if(_0x1f1e00>=_0x3ce4e5){_0x1f1e00=_0x3ce4e5;_0x3de9b0=0xc8;}else{_0x3de9b0=0xce;}_0x23567a[_0x2bbd('0x7')](_0x3de9b0);return _0x23567a[_0x2bbd('0xd')](_0x2bbd('0xe'),_0x3d582e+'-'+_0x1f1e00+'/'+_0x3ce4e5)[_0x2bbd('0x8')](_0x53fecf);}return null;};}function saveUpdates(_0x54e26f){return function(_0x3d8ff6){if(_0x3d8ff6){return _0x3d8ff6['update'](_0x54e26f)[_0x2bbd('0xf')](function(_0x1a30c5){return _0x1a30c5;});}return null;};}function removeEntity(_0x2248ac){return function(_0x4680b1){if(_0x4680b1){return _0x4680b1[_0x2bbd('0x10')]()[_0x2bbd('0xf')](function(){_0x2248ac[_0x2bbd('0x7')](0xcc)[_0x2bbd('0x11')]();});}};}function handleEntityNotFound(_0x3fa577){return function(_0x5b7ae6){if(!_0x5b7ae6){_0x3fa577[_0x2bbd('0x12')](0x194);}return _0x5b7ae6;};}function handleError(_0x404101,_0x232503){_0x232503=_0x232503||0x1f4;return function(_0x743220){logger[_0x2bbd('0x13')](_0x743220[_0x2bbd('0x14')]);if(_0x743220['name']){delete _0x743220[_0x2bbd('0x15')];}_0x404101[_0x2bbd('0x7')](_0x232503)[_0x2bbd('0x16')](_0x743220);};}exports[_0x2bbd('0x17')]=function(_0x2cd304,_0xfd799e){var _0x16174a={},_0x3e987f={},_0x2df9bf={'count':0x0,'rows':[]};var _0x498299=_[_0x2bbd('0x18')](db[_0x2bbd('0x19')][_0x2bbd('0x1a')],function(_0x990c02){return{'name':_0x990c02[_0x2bbd('0x1b')],'type':_0x990c02[_0x2bbd('0x1c')][_0x2bbd('0x1d')]};});_0x3e987f['model']=_[_0x2bbd('0x18')](_0x498299,_0x2bbd('0x15'));_0x3e987f[_0x2bbd('0x1e')]=_['keys'](_0x2cd304[_0x2bbd('0x1e')]);_0x3e987f[_0x2bbd('0x1f')]=_[_0x2bbd('0x20')](_0x3e987f['model'],_0x3e987f['query']);_0x16174a[_0x2bbd('0x21')]=_['intersection'](_0x3e987f['model'],qs[_0x2bbd('0x22')](_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0x22')]));_0x16174a[_0x2bbd('0x21')]=_0x16174a[_0x2bbd('0x21')][_0x2bbd('0x23')]?_0x16174a[_0x2bbd('0x21')]:_0x3e987f[_0x2bbd('0x24')];if(!_0x2cd304['query'][_0x2bbd('0x25')](_0x2bbd('0x26'))){_0x16174a[_0x2bbd('0xc')]=qs['limit'](_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0xc')]);_0x16174a[_0x2bbd('0x9')]=qs[_0x2bbd('0x9')](_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0x9')]);}_0x16174a['order']=qs[_0x2bbd('0x27')](_0x2cd304['query'][_0x2bbd('0x27')]);_0x16174a[_0x2bbd('0x28')]=qs[_0x2bbd('0x1f')](_[_0x2bbd('0x29')](_0x2cd304[_0x2bbd('0x1e')],_0x3e987f[_0x2bbd('0x1f')]),_0x498299);if(_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0x2a')]){_0x16174a[_0x2bbd('0x28')]=_[_0x2bbd('0x2b')](_0x16174a['where'],{'$or':_['map'](_0x498299,function(_0x5a5a77){if(_0x5a5a77[_0x2bbd('0x1c')]!==_0x2bbd('0x2c')){var _0x56e11b={};_0x56e11b[_0x5a5a77[_0x2bbd('0x15')]]={'$like':'%'+_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0x2a')]+'%'};return _0x56e11b;}})});}_0x16174a=_[_0x2bbd('0x2b')]({},_0x16174a,_0x2cd304[_0x2bbd('0x2d')]);var _0x27b2e3={'where':_0x16174a[_0x2bbd('0x28')]};return db[_0x2bbd('0x19')][_0x2bbd('0xb')](_0x27b2e3)[_0x2bbd('0xf')](function(_0x33c041){_0x2df9bf['count']=_0x33c041;if(_0x2cd304[_0x2bbd('0x1e')][_0x2bbd('0x2e')]){_0x16174a[_0x2bbd('0x2f')]=[{'all':!![]}];}return db[_0x2bbd('0x19')][_0x2bbd('0x30')](_0x16174a);})[_0x2bbd('0xf')](function(_0xe0a411){_0x2df9bf['rows']=_0xe0a411;return _0x2df9bf;})[_0x2bbd('0xf')](respondWithFilteredResult(_0xfd799e,_0x16174a))[_0x2bbd('0x31')](handleError(_0xfd799e,null));};exports['show']=function(_0x4e4c7d,_0x8d3f2){var _0x38e07d={'raw':![],'where':{'id':_0x4e4c7d[_0x2bbd('0x32')]['id']}},_0x215938={};_0x215938[_0x2bbd('0x24')]=_[_0x2bbd('0x33')](db[_0x2bbd('0x19')][_0x2bbd('0x1a')]);_0x215938[_0x2bbd('0x1e')]=_[_0x2bbd('0x33')](_0x4e4c7d['query']);_0x215938[_0x2bbd('0x1f')]=_[_0x2bbd('0x20')](_0x215938[_0x2bbd('0x24')],_0x215938[_0x2bbd('0x1e')]);_0x38e07d['attributes']=_[_0x2bbd('0x20')](_0x215938[_0x2bbd('0x24')],qs['fields'](_0x4e4c7d[_0x2bbd('0x1e')][_0x2bbd('0x22')]));_0x38e07d['attributes']=_0x38e07d[_0x2bbd('0x21')][_0x2bbd('0x23')]?_0x38e07d[_0x2bbd('0x21')]:_0x215938[_0x2bbd('0x24')];if(_0x4e4c7d['query']['includeAll']){_0x38e07d['include']=[{'all':!![]}];}_0x38e07d=_[_0x2bbd('0x2b')]({},_0x38e07d,_0x4e4c7d['options']);return db[_0x2bbd('0x19')][_0x2bbd('0x34')](_0x38e07d)['then'](handleEntityNotFound(_0x8d3f2,null))[_0x2bbd('0xf')](respondWithResult(_0x8d3f2,null))[_0x2bbd('0x31')](handleError(_0x8d3f2,null));};exports[_0x2bbd('0x35')]=function(_0x3dfbb5,_0x44aaf6){return db[_0x2bbd('0x19')]['create'](_0x3dfbb5[_0x2bbd('0x36')],{})[_0x2bbd('0xf')](respondWithResult(_0x44aaf6,0xc9))['catch'](handleError(_0x44aaf6,null));};exports[_0x2bbd('0x37')]=function(_0x40d0be,_0x44a0b0){if(_0x40d0be['body']['id']){delete _0x40d0be['body']['id'];}return db[_0x2bbd('0x19')][_0x2bbd('0x34')]({'where':{'id':_0x40d0be[_0x2bbd('0x32')]['id']}})[_0x2bbd('0xf')](handleEntityNotFound(_0x44a0b0,null))[_0x2bbd('0xf')](saveUpdates(_0x40d0be['body'],null))[_0x2bbd('0xf')](respondWithResult(_0x44a0b0,null))[_0x2bbd('0x31')](handleError(_0x44a0b0,null));};exports[_0x2bbd('0x10')]=function(_0x1116c4,_0x453ac0){return db[_0x2bbd('0x19')][_0x2bbd('0x34')]({'where':{'id':_0x1116c4['params']['id']}})[_0x2bbd('0xf')](handleEntityNotFound(_0x453ac0,null))[_0x2bbd('0xf')](removeEntity(_0x453ac0,null))['catch'](handleError(_0x453ac0,null));};exports[_0x2bbd('0x38')]=function(_0x4dc28b,_0x4035de){var _0x17f02a={};var _0x14e780={};var _0xeaca00;var _0x5afa6f;return db['Dynamics365Account']['findOne']({'where':{'id':_0x4dc28b[_0x2bbd('0x32')]['id']}})[_0x2bbd('0xf')](handleEntityNotFound(_0x4035de,null))['then'](function(_0xdc7237){if(_0xdc7237){_0xeaca00=_0xdc7237;_0x14e780[_0x2bbd('0x24')]=_[_0x2bbd('0x33')](db['Dynamics365Configuration']['rawAttributes']);_0x14e780[_0x2bbd('0x1e')]=_[_0x2bbd('0x33')](_0x4dc28b[_0x2bbd('0x1e')]);_0x14e780[_0x2bbd('0x1f')]=_[_0x2bbd('0x20')](_0x14e780[_0x2bbd('0x24')],_0x14e780[_0x2bbd('0x1e')]);_0x17f02a[_0x2bbd('0x21')]=_[_0x2bbd('0x20')](_0x14e780[_0x2bbd('0x24')],qs[_0x2bbd('0x22')](_0x4dc28b['query'][_0x2bbd('0x22')]));_0x17f02a[_0x2bbd('0x21')]=_0x17f02a['attributes']['length']?_0x17f02a[_0x2bbd('0x21')]:_0x14e780['model'];_0x17f02a[_0x2bbd('0x39')]=qs['sort'](_0x4dc28b[_0x2bbd('0x1e')][_0x2bbd('0x27')]);_0x17f02a[_0x2bbd('0x28')]=qs['filters'](_['pick'](_0x4dc28b[_0x2bbd('0x1e')],_0x14e780[_0x2bbd('0x1f')]));if(_0x4dc28b[_0x2bbd('0x1e')]['filter']){_0x17f02a[_0x2bbd('0x28')]=_['merge'](_0x17f02a[_0x2bbd('0x28')],{'$or':_[_0x2bbd('0x18')](_0x17f02a[_0x2bbd('0x21')],function(_0x3c85df){var _0x3e785e={};_0x3e785e[_0x3c85df]={'$like':'%'+_0x4dc28b['query'][_0x2bbd('0x2a')]+'%'};return _0x3e785e;})});}_0x17f02a=_['merge']({},_0x17f02a,_0x4dc28b[_0x2bbd('0x2d')]);return _0xeaca00[_0x2bbd('0x38')](_0x17f02a);}})[_0x2bbd('0xf')](function(_0x19aadf){if(_0x19aadf){_0x5afa6f=_0x19aadf['length'];if(!_0x4dc28b[_0x2bbd('0x1e')][_0x2bbd('0x25')](_0x2bbd('0x26'))){_0x17f02a[_0x2bbd('0xc')]=qs[_0x2bbd('0xc')](_0x4dc28b[_0x2bbd('0x1e')]['limit']);_0x17f02a[_0x2bbd('0x9')]=qs[_0x2bbd('0x9')](_0x4dc28b['query']['offset']);}return _0xeaca00[_0x2bbd('0x38')](_0x17f02a);}})[_0x2bbd('0xf')](function(_0x33fc27){if(_0x33fc27){return _0x33fc27?{'count':_0x5afa6f,'rows':_0x33fc27}:null;}})[_0x2bbd('0xf')](respondWithResult(_0x4035de,null))[_0x2bbd('0x31')](handleError(_0x4035de,null));};exports[_0x2bbd('0x3a')]=function(_0x548ed3,_0x2e3518){if(_0x548ed3[_0x2bbd('0x36')]['id']){delete _0x548ed3[_0x2bbd('0x36')]['id'];}return db[_0x2bbd('0x19')][_0x2bbd('0x3b')]({'where':{'id':_0x548ed3[_0x2bbd('0x32')]['id']}})[_0x2bbd('0xf')](handleEntityNotFound(_0x2e3518,null))[_0x2bbd('0xf')](function(_0x12ae7c){if(_0x12ae7c){_0x548ed3[_0x2bbd('0x36')][_0x2bbd('0x3c')]=_0x12ae7c['id'];_0x548ed3[_0x2bbd('0x36')]['Subjects']=integrations[_0x2bbd('0x3d')](_0x548ed3[_0x2bbd('0x36')][_0x2bbd('0x3e')],_0x548ed3[_0x2bbd('0x36')][_0x2bbd('0x1c')]);_0x548ed3['body'][_0x2bbd('0x3f')]=integrations[_0x2bbd('0x40')](_0x548ed3['body'][_0x2bbd('0x3e')],_0x548ed3[_0x2bbd('0x36')]['type']);return db[_0x2bbd('0x41')][_0x2bbd('0x35')](_0x548ed3[_0x2bbd('0x36')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x2bbd('0x42')],'as':_0x2bbd('0x3f')}]});}return null;})[_0x2bbd('0xf')](respondWithResult(_0x2e3518,null))[_0x2bbd('0x31')](handleError(_0x2e3518,null));};function sanitizeRemoteUri(_0x403244){var _0x36cde4=_0x403244[_0x2bbd('0x43')](-0x1);if(_0x36cde4==='/')return _0x403244[_0x2bbd('0x44')](0x0,_0x403244['lastIndexOf'](_0x36cde4));return _0x403244;}function getWebApiUrl(_0x3181a9){return util['format'](_0x2bbd('0x45'),_0x3181a9);}exports[_0x2bbd('0x46')]=function(_0x21b953,_0x22144b){var _0x4e4bc0=_0x21b953[_0x2bbd('0x1e')][_0x2bbd('0x47')];var _0x55f23a=_0x4e4bc0==='incident'?_0x2bbd('0x48'):_0x2bbd('0x49');var _0x39812d='';var _0x27062a='';var _0x5ade73='';var _0x4d42af='';var _0x223aec='';var _0x3a3776='';var _0x2dce39='';var _0x2dec46='';var _0x3e3658=[_0x2bbd('0x4a'),_0x2bbd('0x4b'),_0x2bbd('0x4c'),_0x2bbd('0x4d'),_0x2bbd('0x4e'),_0x2bbd('0x4f'),_0x2bbd('0x50'),'regardingobjectid',_0x2bbd('0x51'),'phonecall_activity_parties'];var _0x382dc6=[_0x2bbd('0x52'),'accountidyominame',_0x2bbd('0x53'),'billedserviceunits',_0x2bbd('0x54'),'contactidyominame',_0x2bbd('0x55'),'contractidname',_0x2bbd('0x56'),_0x2bbd('0x57'),_0x2bbd('0x58'),_0x2bbd('0x59'),_0x2bbd('0x5a'),_0x2bbd('0x5b'),'createdonbehalfbyyominame',_0x2bbd('0x5c'),'customeridtype',_0x2bbd('0x5d'),_0x2bbd('0x5e'),_0x2bbd('0x5f'),_0x2bbd('0x60'),_0x2bbd('0x61'),_0x2bbd('0x62'),_0x2bbd('0x63'),_0x2bbd('0x64'),_0x2bbd('0x65'),'importsequencenumber',_0x2bbd('0x66'),_0x2bbd('0x67'),'lastonholdtime','masteridname',_0x2bbd('0x68'),'modifiedbyexternalpartyyominame',_0x2bbd('0x69'),'modifiedbyyominame','modifiedon',_0x2bbd('0x6a'),_0x2bbd('0x6b'),'msdyn_incidenttypename',_0x2bbd('0x6c'),'numberofchildincidents','onholdtime',_0x2bbd('0x6d'),_0x2bbd('0x6e'),_0x2bbd('0x6f'),_0x2bbd('0x70'),_0x2bbd('0x71'),_0x2bbd('0x72'),_0x2bbd('0x73'),_0x2bbd('0x74'),_0x2bbd('0x75'),_0x2bbd('0x76'),'resolveby',_0x2bbd('0x77'),_0x2bbd('0x78'),_0x2bbd('0x79'),_0x2bbd('0x7a'),'sentimentvalue',_0x2bbd('0x7b'),_0x2bbd('0x7c'),_0x2bbd('0x7d'),_0x2bbd('0x7e'),_0x2bbd('0x7f'),_0x2bbd('0x80'),_0x2bbd('0x81'),_0x2bbd('0x82'),_0x2bbd('0x83'),_0x2bbd('0x84'),_0x2bbd('0x85'),_0x2bbd('0x86')];var _0x1653ce=_0x3e3658[_0x2bbd('0x87')](_0x382dc6);return db[_0x2bbd('0x19')][_0x2bbd('0x3b')]({'where':{'id':_0x21b953[_0x2bbd('0x32')]['id']},'attributes':['id','username','password',_0x2bbd('0x88'),_0x2bbd('0x89'),'clientId',_0x2bbd('0x8a'),'modernAuthentication'],'include':[{'model':db[_0x2bbd('0x8b')],'as':_0x2bbd('0x8b'),'attributes':['id',_0x2bbd('0x8c'),_0x2bbd('0x8d')]}]})[_0x2bbd('0xf')](handleEntityNotFound(_0x22144b,null))[_0x2bbd('0xf')](function(_0x392b55){if(_0x392b55){if(_0x392b55[_0x2bbd('0x8e')]){_0x392b55[_0x2bbd('0x8f')]=_0x392b55[_0x2bbd('0x8b')][_0x2bbd('0x8c')];_0x2dec46=sanitizeRemoteUri(_0x392b55[_0x2bbd('0x8b')][_0x2bbd('0x8d')]);_0x2dce39=getWebApiUrl(_0x2dec46);return _0x392b55;}_0x2dec46=sanitizeRemoteUri(_0x392b55[_0x2bbd('0x88')]);_0x2dce39=getWebApiUrl(_0x2dec46);var _0x457988={'method':_0x2bbd('0x90'),'uri':_0x2bbd('0x91')+_0x392b55[_0x2bbd('0x89')]+_0x2bbd('0x92'),'form':{'client_id':_0x392b55[_0x2bbd('0x93')],'resource':_0x2dec46,'username':_0x392b55['username'],'password':_0x392b55[_0x2bbd('0x94')],'grant_type':_0x2bbd('0x94'),'client_secret':_0x392b55[_0x2bbd('0x8a')]},'json':!![]};return rp(_0x457988);}})[_0x2bbd('0xf')](function(_0x55fca7){_0x3a3776=_0x55fca7[_0x2bbd('0x8f')];var _0x20e057={'method':_0x2bbd('0x95'),'uri':encodeURI(_0x2dce39+_0x2bbd('0x96')+_0x55f23a+'\x27'),'headers':{'Authorization':_0x2bbd('0x97')+_0x3a3776,'If-None-Match':null,'OData-Version':_0x2bbd('0x98')},'json':!![]};return rp(_0x20e057);})[_0x2bbd('0xf')](function(_0x25d49f){var _0x249cb6=_0x25d49f[_0x2bbd('0x99')][0x0];var _0x15e01a=_0x249cb6[_0x2bbd('0x9a')];var _0x466e03={'method':_0x2bbd('0x95'),'uri':_0x2dce39+_0x2bbd('0x9b')+_0x15e01a+_0x2bbd('0x9c'),'headers':{'Authorization':_0x2bbd('0x97')+_0x3a3776,'If-None-Match':null,'OData-Version':_0x2bbd('0x98')},'json':!![]};return rp(_0x466e03);})[_0x2bbd('0xf')](function(_0x474cba){_0x39812d=_0x474cba;_0x27062a=_0x39812d['Attributes'];_0x27062a=_['remove'](_0x27062a,function(_0x2fd0c9){return!_0x1653ce[_0x2bbd('0x9d')](_0x2fd0c9['LogicalName']);});var _0x1f21b3=[];var _0x57e2f1=[];_0x27062a[_0x2bbd('0x9e')](function(_0x5a8e68){if(_0x5a8e68[_0x2bbd('0x9f')]){var _0x458f80=_0x5a8e68[_0x2bbd('0x9f')][_0x2bbd('0x44')](_0x5a8e68[_0x2bbd('0x9f')][_0x2bbd('0xa0')]('.')+0x1);if(_0x458f80==='PicklistAttributeMetadata'){_0x1f21b3[_0x2bbd('0xa1')](getSelectList(_0x2dce39,_0x4e4bc0,_0x57e2f1,_0x39812d[_0x2bbd('0x9a')],_0x5a8e68['MetadataId'],_0x3a3776));}}});return Promise[_0x2bbd('0xa2')](_0x1f21b3);})['then'](function(_0x20bbf0){_0x5ade73=_0x20bbf0[0x0];var _0x3d7641=[];var _0xdfddc4=[];_0x27062a[_0x2bbd('0x9e')](function(_0x4f07ce){if(!_[_0x2bbd('0xa3')](_0x4f07ce[_0x2bbd('0x9f')])){var _0x5dfc0e=_0x4f07ce[_0x2bbd('0x9f')][_0x2bbd('0x44')](_0x4f07ce[_0x2bbd('0x9f')]['lastIndexOf']('.')+0x1);if(_0x5dfc0e===_0x2bbd('0xa4')){_0x3d7641[_0x2bbd('0xa1')](getBooleanList(_0x2dce39,_0x4e4bc0,_0xdfddc4,_0x39812d[_0x2bbd('0x9a')],_0x4f07ce[_0x2bbd('0x9a')],_0x3a3776));}}});return Promise[_0x2bbd('0xa2')](_0x3d7641);})[_0x2bbd('0xf')](function(_0x1d73d0){_0x4d42af=_0x1d73d0[0x0];var _0x5b128d=[];var _0x1106bf=[];_0x27062a[_0x2bbd('0x9e')](function(_0x49f1e2){if(_0x49f1e2[_0x2bbd('0x9f')]){var _0x2f3a73=_0x49f1e2['@odata.type'][_0x2bbd('0x44')](_0x49f1e2[_0x2bbd('0x9f')][_0x2bbd('0xa0')]('.')+0x1);if(_0x2f3a73===_0x2bbd('0xa5')||_0x2f3a73===_0x2bbd('0xa6')||_0x2f3a73==='BigIntAttributeMetadata'||_0x2f3a73===_0x2bbd('0xa7')||_0x2f3a73===_0x2bbd('0xa8')||_0x2f3a73===_0x2bbd('0xa9')||_0x2f3a73===_0x2bbd('0xaa')||_0x2f3a73===_0x2bbd('0xab')||_0x2f3a73===_0x2bbd('0xac')||_0x2f3a73===_0x2bbd('0xad')){_0x5b128d[_0x2bbd('0xa1')](getInputList(_0x2dce39,_0x4e4bc0,_0x2f3a73,_0x1106bf,_0x39812d[_0x2bbd('0x9a')],_0x49f1e2['MetadataId'],_0x3a3776));}}});return Promise[_0x2bbd('0xa2')](_0x5b128d);})[_0x2bbd('0xf')](function(_0x3910bb){_0x223aec=_0x3910bb[0x0];var _0x5cff44=_0x5ade73['concat'](_0x4d42af)[_0x2bbd('0x87')](_0x223aec);var _0x396f5f={'count':_0x5cff44['length'],'rows':_0x5cff44};return _0x396f5f;})[_0x2bbd('0xf')](respondWithResult(_0x22144b,null))[_0x2bbd('0x31')](function(_0x3f77a8){var _0x5e4c48=_0x21b953['query']['test']?0x1f4:_0x3f77a8['statusCode']||0x1f4;logger['error'](_0x3f77a8[_0x2bbd('0x14')]);delete _0x3f77a8[_0x2bbd('0x15')];if(_0x5e4c48===0x191){_0x5e4c48=0x190;}_0x22144b['status'](_0x5e4c48)[_0x2bbd('0x16')](_0x21b953[_0x2bbd('0x1e')][_0x2bbd('0xae')]?{'message':_0x2bbd('0xaf'),'statusCode':_0x3f77a8[_0x2bbd('0xb0')]}:_0x3f77a8);});};function getSelectList(_0x38c225,_0x42f343,_0x5d9ae4,_0x190d1a,_0x58e658,_0x3f0c29){var _0x5e7e15={'method':_0x2bbd('0x95'),'uri':_0x38c225+_0x2bbd('0x9b')+_0x190d1a+_0x2bbd('0xb1')+_0x58e658+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x2bbd('0xb2'),'headers':{'Authorization':_0x2bbd('0x97')+_0x3f0c29,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e7e15)[_0x2bbd('0xf')](function(_0x21e773){var _0x557fdb=[];var _0x4923ad=_0x21e773[_0x2bbd('0xb3')][_0x2bbd('0xb4')];_0x4923ad[_0x2bbd('0x9e')](function(_0x5d2862){_0x557fdb['push']({'name':_0x5d2862[_0x2bbd('0xb5')]['UserLocalizedLabel'][_0x2bbd('0xb5')],'value':String(_0x5d2862[_0x2bbd('0xb6')])});});var _0x59a53e={'id':_0x42f343+'_'+_0x21e773[_0x2bbd('0xb7')],'name':_0x21e773[_0x2bbd('0xb8')][_0x2bbd('0xb9')][_0x2bbd('0xb5')],'custom':![],'options':_0x557fdb};_0x5d9ae4[_0x2bbd('0xa1')](_0x59a53e);return _0x5d9ae4;});}function getBooleanList(_0x287726,_0x5c2a3a,_0x151b2b,_0x251f84,_0xfcc24,_0x3c738b){var _0x1bae72={'method':_0x2bbd('0x95'),'uri':_0x287726+_0x2bbd('0x9b')+_0x251f84+_0x2bbd('0xb1')+_0xfcc24+_0x2bbd('0xba'),'headers':{'Authorization':_0x2bbd('0x97')+_0x3c738b,'If-None-Match':null,'OData-Version':_0x2bbd('0x98')},'json':!![]};return rp(_0x1bae72)[_0x2bbd('0xf')](function(_0x15eda4){var _0x12e15a=[];_0x12e15a[_0x2bbd('0xa1')]({'name':_0x15eda4[_0x2bbd('0xb3')][_0x2bbd('0xbb')][_0x2bbd('0xb5')][_0x2bbd('0xb9')]['Label'],'value':_0x2bbd('0xbc')},{'name':_0x15eda4[_0x2bbd('0xb3')]['FalseOption']['Label'][_0x2bbd('0xb9')]['Label'],'value':_0x2bbd('0xbd')});var _0x5693e8={'id':_0x5c2a3a+'_'+_0x15eda4[_0x2bbd('0xb7')],'name':_0x15eda4['DisplayName'][_0x2bbd('0xb9')][_0x2bbd('0xb5')],'custom':![],'options':_0x12e15a};_0x151b2b[_0x2bbd('0xa1')](_0x5693e8);return _0x151b2b;});}function getInputList(_0x57f711,_0x3e00b3,_0x5669bf,_0x1f8bd7,_0x1caa5a,_0x55a6cc,_0x3bf5be){var _0x50bcfc={'method':_0x2bbd('0x95'),'uri':_0x57f711+'EntityDefinitions('+_0x1caa5a+_0x2bbd('0xb1')+_0x55a6cc+_0x2bbd('0xbe')+_0x5669bf+_0x2bbd('0xbf'),'headers':{'Authorization':_0x2bbd('0x97')+_0x3bf5be,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50bcfc)['then'](function(_0xea78e9){var _0x3a6b22={'id':_0x3e00b3+'_'+_0xea78e9[_0x2bbd('0xb7')],'name':_0xea78e9[_0x2bbd('0xb8')][_0x2bbd('0xb9')]?_0xea78e9['DisplayName']['UserLocalizedLabel']['Label']:_0xea78e9[_0x2bbd('0xb7')],'custom':![],'options':[]};_0x1f8bd7[_0x2bbd('0xa1')](_0x3a6b22);return _0x1f8bd7;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c903b05..e8375f4 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x73fc10,_0x25295d){var _0x3f392e=function(_0x54e640){while(--_0x54e640){_0x73fc10['push'](_0x73fc10['shift']());}};_0x3f392e(++_0x25295d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0xc10fb6,_0x3c5236){var _0x333c28=function(_0x126510){while(--_0x126510){_0xc10fb6['push'](_0xc10fb6['shift']());}};_0x333c28(++_0x3c5236);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb7e7[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index d41aeec..a49dd9a 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 _0x4658=['../../config/environment','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','map','include','model','debug','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4658,0xe7));var _0x8465=function(_0xd9884b,_0x32c492){_0xd9884b=_0xd9884b-0x0;var _0x1aaefa=_0x4658[_0xd9884b];return _0x1aaefa;};'use strict';var _=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var moment=require(_0x8465('0x2'));var BPromise=require(_0x8465('0x3'));var rs=require(_0x8465('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8465('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8465('0x6'))('rpc');var config=require(_0x8465('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8465('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x372748,_0x4cac16,_0x4dd64f){return new BPromise(function(_0x5a1d7c,_0x3b009d){return client[_0x8465('0x9')](_0x372748,_0x4dd64f)[_0x8465('0xa')](function(_0x24724d){logger[_0x8465('0xb')](_0x8465('0xc'),_0x4cac16,'request\x20sent');logger['debug'](_0x8465('0xd'),_0x4cac16,'request\x20sent',JSON[_0x8465('0xe')](_0x24724d));if(_0x24724d[_0x8465('0xf')]){if(_0x24724d[_0x8465('0xf')][_0x8465('0x10')]===0x1f4){logger[_0x8465('0xf')](_0x8465('0xc'),_0x4cac16,_0x24724d['error'][_0x8465('0x11')]);return _0x3b009d(_0x24724d[_0x8465('0xf')]['message']);}logger[_0x8465('0xf')](_0x8465('0xc'),_0x4cac16,_0x24724d[_0x8465('0xf')][_0x8465('0x11')]);return _0x5a1d7c(_0x24724d['error'][_0x8465('0x11')]);}else{logger[_0x8465('0xb')](_0x8465('0xc'),_0x4cac16,_0x8465('0x12'));_0x5a1d7c(_0x24724d[_0x8465('0x13')][_0x8465('0x11')]);}})[_0x8465('0x14')](function(_0x57f13e){logger[_0x8465('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x4cac16,_0x57f13e);_0x3b009d(_0x57f13e);});});}exports[_0x8465('0x15')]=function(_0x17f86b){var _0x55462e=this;return new Promise(function(_0xa95447,_0x38df6a){return db[_0x8465('0x16')][_0x8465('0x17')]({'raw':_0x17f86b[_0x8465('0x18')]?_0x17f86b[_0x8465('0x18')][_0x8465('0x19')]===undefined?!![]:![]:!![],'where':_0x17f86b[_0x8465('0x18')]?_0x17f86b[_0x8465('0x18')][_0x8465('0x1a')]||null:null,'attributes':_0x17f86b['options']?_0x17f86b[_0x8465('0x18')][_0x8465('0x1b')]||null:null,'limit':_0x17f86b['options']?_0x17f86b[_0x8465('0x18')]['limit']||null:null,'include':_0x17f86b[_0x8465('0x18')]?_0x17f86b[_0x8465('0x18')]['include']?_[_0x8465('0x1c')](_0x17f86b[_0x8465('0x18')][_0x8465('0x1d')],function(_0x2de7a5){return{'model':db[_0x2de7a5['model']],'as':_0x2de7a5['as'],'attributes':_0x2de7a5[_0x8465('0x1b')],'include':_0x2de7a5['include']?_[_0x8465('0x1c')](_0x2de7a5[_0x8465('0x1d')],function(_0x5094bf){return{'model':db[_0x5094bf[_0x8465('0x1e')]],'as':_0x5094bf['as'],'attributes':_0x5094bf['attributes'],'include':_0x5094bf[_0x8465('0x1d')]?_[_0x8465('0x1c')](_0x5094bf['include'],function(_0x1f74eb){return{'model':db[_0x1f74eb['model']],'as':_0x1f74eb['as'],'attributes':_0x1f74eb[_0x8465('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8465('0xa')](function(_0x4c5c8e){logger['info'](_0x8465('0x15'),_0x17f86b);logger[_0x8465('0x1f')](_0x8465('0x15'),_0x17f86b,JSON[_0x8465('0xe')](_0x4c5c8e));_0xa95447(_0x4c5c8e);})[_0x8465('0x14')](function(_0xc1f12f){logger['error']('GetDynamics365Account',_0xc1f12f[_0x8465('0x11')],_0x17f86b);_0x38df6a(_0x55462e[_0x8465('0xf')](0x1f4,_0xc1f12f[_0x8465('0x11')]));});});};exports[_0x8465('0x20')]=function(_0x3afe9a){var _0x3986c0=this;return new Promise(function(_0x638304,_0x2d78a2){return db[_0x8465('0x16')][_0x8465('0x21')]({'raw':_0x3afe9a[_0x8465('0x18')]?_0x3afe9a[_0x8465('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3afe9a[_0x8465('0x18')]?_0x3afe9a[_0x8465('0x18')]['where']||null:null,'attributes':_0x3afe9a[_0x8465('0x18')]?_0x3afe9a[_0x8465('0x18')][_0x8465('0x1b')]||null:null,'include':_0x3afe9a[_0x8465('0x18')]?_0x3afe9a['options'][_0x8465('0x1d')]?_['map'](_0x3afe9a['options']['include'],function(_0x444d35){return{'model':db[_0x444d35[_0x8465('0x1e')]],'as':_0x444d35['as'],'attributes':_0x444d35['attributes'],'include':_0x444d35[_0x8465('0x1d')]?_[_0x8465('0x1c')](_0x444d35[_0x8465('0x1d')],function(_0x3826db){return{'model':db[_0x3826db[_0x8465('0x1e')]],'as':_0x3826db['as'],'attributes':_0x3826db['attributes'],'include':_0x3826db['include']?_[_0x8465('0x1c')](_0x3826db[_0x8465('0x1d')],function(_0x5a6391){return{'model':db[_0x5a6391[_0x8465('0x1e')]],'as':_0x5a6391['as'],'attributes':_0x5a6391['attributes']};}):[]};}):[]};}):[]:[]})[_0x8465('0xa')](function(_0x4eff8c){logger[_0x8465('0xb')](_0x8465('0x20'),_0x3afe9a);logger[_0x8465('0x1f')]('ShowDynamics365Account',_0x3afe9a,JSON[_0x8465('0xe')](_0x4eff8c));_0x638304(_0x4eff8c);})[_0x8465('0x14')](function(_0x111e0c){logger[_0x8465('0xf')]('ShowDynamics365Account',_0x111e0c['message'],_0x3afe9a);_0x2d78a2(_0x3986c0[_0x8465('0xf')](0x1f4,_0x111e0c[_0x8465('0x11')]));});});}; \ No newline at end of file +var _0xbca6=['ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','GetDynamics365Account','message','find','where'];(function(_0x5cc36a,_0x1f03ee){var _0x487694=function(_0x6db708){while(--_0x6db708){_0x5cc36a['push'](_0x5cc36a['shift']());}};_0x487694(++_0x1f03ee);}(_0xbca6,0x139));var _0x6bca=function(_0x4731d3,_0x12aad9){_0x4731d3=_0x4731d3-0x0;var _0x461a63=_0xbca6[_0x4731d3];return _0x461a63;};'use strict';var _=require(_0x6bca('0x0'));var util=require(_0x6bca('0x1'));var moment=require(_0x6bca('0x2'));var BPromise=require(_0x6bca('0x3'));var rs=require(_0x6bca('0x4'));var fs=require('fs');var Redis=require(_0x6bca('0x5'));var db=require(_0x6bca('0x6'))['db'];var utils=require(_0x6bca('0x7'));var logger=require(_0x6bca('0x8'))(_0x6bca('0x9'));var config=require(_0x6bca('0xa'));var jayson=require(_0x6bca('0xb'));var client=jayson[_0x6bca('0xc')][_0x6bca('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38b550,_0x2f6905,_0x3ada26){return new BPromise(function(_0x4d0d57,_0x5ec9a5){return client['request'](_0x38b550,_0x3ada26)[_0x6bca('0xe')](function(_0xd78f87){logger[_0x6bca('0xf')](_0x6bca('0x10'),_0x2f6905,_0x6bca('0x11'));logger[_0x6bca('0x12')](_0x6bca('0x13'),_0x2f6905,_0x6bca('0x11'),JSON[_0x6bca('0x14')](_0xd78f87));if(_0xd78f87[_0x6bca('0x15')]){if(_0xd78f87[_0x6bca('0x15')][_0x6bca('0x16')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x2f6905,_0xd78f87[_0x6bca('0x15')]['message']);return _0x5ec9a5(_0xd78f87['error']['message']);}logger[_0x6bca('0x15')](_0x6bca('0x10'),_0x2f6905,_0xd78f87[_0x6bca('0x15')]['message']);return _0x4d0d57(_0xd78f87['error']['message']);}else{logger[_0x6bca('0xf')](_0x6bca('0x10'),_0x2f6905,_0x6bca('0x11'));_0x4d0d57(_0xd78f87[_0x6bca('0x17')]['message']);}})[_0x6bca('0x18')](function(_0x3426da){logger[_0x6bca('0x15')](_0x6bca('0x10'),_0x2f6905,_0x3426da);_0x5ec9a5(_0x3426da);});});}exports['GetDynamics365Account']=function(_0x2c78be){var _0x51e438=this;return new Promise(function(_0x36c6bf,_0x56f9a5){return db[_0x6bca('0x19')][_0x6bca('0x1a')]({'raw':_0x2c78be[_0x6bca('0x1b')]?_0x2c78be[_0x6bca('0x1b')][_0x6bca('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c78be['options']?_0x2c78be[_0x6bca('0x1b')]['where']||null:null,'attributes':_0x2c78be[_0x6bca('0x1b')]?_0x2c78be[_0x6bca('0x1b')][_0x6bca('0x1d')]||null:null,'limit':_0x2c78be[_0x6bca('0x1b')]?_0x2c78be[_0x6bca('0x1b')][_0x6bca('0x1e')]||null:null,'include':_0x2c78be[_0x6bca('0x1b')]?_0x2c78be[_0x6bca('0x1b')][_0x6bca('0x1f')]?_[_0x6bca('0x20')](_0x2c78be[_0x6bca('0x1b')][_0x6bca('0x1f')],function(_0x236a0e){return{'model':db[_0x236a0e[_0x6bca('0x21')]],'as':_0x236a0e['as'],'attributes':_0x236a0e[_0x6bca('0x1d')],'include':_0x236a0e[_0x6bca('0x1f')]?_['map'](_0x236a0e[_0x6bca('0x1f')],function(_0x2d3c13){return{'model':db[_0x2d3c13[_0x6bca('0x21')]],'as':_0x2d3c13['as'],'attributes':_0x2d3c13[_0x6bca('0x1d')],'include':_0x2d3c13[_0x6bca('0x1f')]?_[_0x6bca('0x20')](_0x2d3c13[_0x6bca('0x1f')],function(_0x54dd34){return{'model':db[_0x54dd34['model']],'as':_0x54dd34['as'],'attributes':_0x54dd34[_0x6bca('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6bca('0xe')](function(_0x35ee85){logger['info'](_0x6bca('0x22'),_0x2c78be);logger[_0x6bca('0x12')](_0x6bca('0x22'),_0x2c78be,JSON[_0x6bca('0x14')](_0x35ee85));_0x36c6bf(_0x35ee85);})[_0x6bca('0x18')](function(_0x502156){logger[_0x6bca('0x15')](_0x6bca('0x22'),_0x502156[_0x6bca('0x23')],_0x2c78be);_0x56f9a5(_0x51e438['error'](0x1f4,_0x502156[_0x6bca('0x23')]));});});};exports['ShowDynamics365Account']=function(_0x469010){var _0x2c21fc=this;return new Promise(function(_0x264ef9,_0x2c7056){return db['Dynamics365Account'][_0x6bca('0x24')]({'raw':_0x469010[_0x6bca('0x1b')]?_0x469010[_0x6bca('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x469010[_0x6bca('0x1b')]?_0x469010['options'][_0x6bca('0x25')]||null:null,'attributes':_0x469010['options']?_0x469010['options']['attributes']||null:null,'include':_0x469010[_0x6bca('0x1b')]?_0x469010[_0x6bca('0x1b')]['include']?_['map'](_0x469010['options'][_0x6bca('0x1f')],function(_0x151829){return{'model':db[_0x151829[_0x6bca('0x21')]],'as':_0x151829['as'],'attributes':_0x151829[_0x6bca('0x1d')],'include':_0x151829[_0x6bca('0x1f')]?_[_0x6bca('0x20')](_0x151829[_0x6bca('0x1f')],function(_0x24df76){return{'model':db[_0x24df76[_0x6bca('0x21')]],'as':_0x24df76['as'],'attributes':_0x24df76[_0x6bca('0x1d')],'include':_0x24df76[_0x6bca('0x1f')]?_[_0x6bca('0x20')](_0x24df76[_0x6bca('0x1f')],function(_0x740afb){return{'model':db[_0x740afb['model']],'as':_0x740afb['as'],'attributes':_0x740afb[_0x6bca('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6bca('0xe')](function(_0x15791d){logger['info'](_0x6bca('0x26'),_0x469010);logger[_0x6bca('0x12')]('ShowDynamics365Account',_0x469010,JSON['stringify'](_0x15791d));_0x264ef9(_0x15791d);})[_0x6bca('0x18')](function(_0x2a2947){logger['error'](_0x6bca('0x26'),_0x2a2947[_0x6bca('0x23')],_0x469010);_0x2c7056(_0x2c21fc['error'](0x1f4,_0x2a2947[_0x6bca('0x23')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 56dceb4..757d8e6 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 _0x4123=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','path'];(function(_0xc2aa3d,_0xe8ded6){var _0x41b0ae=function(_0x5a2f5d){while(--_0x5a2f5d){_0xc2aa3d['push'](_0xc2aa3d['shift']());}};_0x41b0ae(++_0xe8ded6);}(_0x4123,0x87));var _0x3412=function(_0x1cbf94,_0x583add){_0x1cbf94=_0x1cbf94-0x0;var _0x3ee429=_0x4123[_0x1cbf94];return _0x3ee429;};'use strict';var multer=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var path=require(_0x3412('0x2'));var timeout=require(_0x3412('0x3'));var express=require(_0x3412('0x4'));var router=express[_0x3412('0x5')]();var fs_extra=require(_0x3412('0x6'));var auth=require(_0x3412('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3412('0x8'));router[_0x3412('0x9')]('/',auth['isAuthenticated'](),controller[_0x3412('0xa')]);router[_0x3412('0x9')](_0x3412('0xb'),auth[_0x3412('0xc')](),controller[_0x3412('0xd')]);router[_0x3412('0x9')]('/:id/fields',auth[_0x3412('0xc')](),controller[_0x3412('0xe')]);router[_0x3412('0x9')](_0x3412('0xf'),auth[_0x3412('0xc')](),controller[_0x3412('0x10')]);router[_0x3412('0x9')](_0x3412('0x11'),auth[_0x3412('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0x3412('0xc')](),controller[_0x3412('0x12')]);router[_0x3412('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3412('0x14')](_0x3412('0xb'),auth[_0x3412('0xc')](),controller[_0x3412('0x15')]);module[_0x3412('0x16')]=router; \ No newline at end of file +var _0xa9fc=['isAuthenticated','show','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','/:id'];(function(_0x2ec54a,_0x848019){var _0x2f9825=function(_0x153e41){while(--_0x153e41){_0x2ec54a['push'](_0x2ec54a['shift']());}};_0x2f9825(++_0x848019);}(_0xa9fc,0x19f));var _0xca9f=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xa9fc[_0x2ac4af];return _0x3a36df;};'use strict';var multer=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var path=require(_0xca9f('0x2'));var timeout=require(_0xca9f('0x3'));var express=require(_0xca9f('0x4'));var router=express['Router']();var fs_extra=require(_0xca9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca9f('0x6'));var config=require(_0xca9f('0x7'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xca9f('0x8')]);router['get'](_0xca9f('0x9'),auth[_0xca9f('0xa')](),controller[_0xca9f('0xb')]);router[_0xca9f('0xc')](_0xca9f('0xd'),auth[_0xca9f('0xa')](),controller[_0xca9f('0xe')]);router[_0xca9f('0xc')]('/:id/subjects',auth[_0xca9f('0xa')](),controller[_0xca9f('0xf')]);router[_0xca9f('0xc')](_0xca9f('0x10'),auth['isAuthenticated'](),controller[_0xca9f('0x11')]);router[_0xca9f('0x12')]('/',auth['isAuthenticated'](),controller[_0xca9f('0x13')]);router[_0xca9f('0x14')](_0xca9f('0x9'),auth[_0xca9f('0xa')](),controller[_0xca9f('0x15')]);router[_0xca9f('0x16')](_0xca9f('0x9'),auth[_0xca9f('0xa')](),controller[_0xca9f('0x17')]);module[_0xca9f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 5d96510..3eb2ca0 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 _0x6c94=['STRING','ENUM','incident','contact','nothing','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6c94,0xd7));var _0x46c9=function(_0x25939c,_0x7984c4){_0x25939c=_0x25939c-0x0;var _0x7a194b=_0x6c94[_0x25939c];return _0x7a194b;};'use strict';var Sequelize=require(_0x46c9('0x0'));module[_0x46c9('0x1')]={'name':{'type':Sequelize[_0x46c9('0x2')]},'description':{'type':Sequelize[_0x46c9('0x2')]},'ticketType':{'type':Sequelize[_0x46c9('0x3')](_0x46c9('0x4'),'phonecall'),'defaultValue':_0x46c9('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x46c9('0x5'),_0x46c9('0x6')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0x4d08=['contact','exports','STRING','ENUM','incident','phonecall','nothing'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x4d08,0xa9));var _0x84d0=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4d08[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0x84d0('0x0')]={'name':{'type':Sequelize[_0x84d0('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x84d0('0x2')](_0x84d0('0x3'),_0x84d0('0x4')),'defaultValue':_0x84d0('0x3')},'moduleCreate':{'type':Sequelize[_0x84d0('0x2')]('contact',_0x84d0('0x5')),'defaultValue':_0x84d0('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8267a32..9065df4 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 _0xd8f8=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Dynamics365Configuration','include','findAll','rows','catch','show','params','find','create','body','update','findOne','getFields','getSubjects','getDescriptions','Dynamics365Field','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0x279b1a,_0x2bb6df){var _0x316364=function(_0x67247f){while(--_0x67247f){_0x279b1a['push'](_0x279b1a['shift']());}};_0x316364(++_0x2bb6df);}(_0xd8f8,0x1c9));var _0x8d8f=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xd8f8[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d8f('0x0'));var zipdir=require(_0x8d8f('0x1'));var jsonpatch=require(_0x8d8f('0x2'));var rp=require(_0x8d8f('0x3'));var moment=require(_0x8d8f('0x4'));var BPromise=require(_0x8d8f('0x5'));var Mustache=require(_0x8d8f('0x6'));var util=require(_0x8d8f('0x7'));var path=require(_0x8d8f('0x8'));var sox=require(_0x8d8f('0x9'));var csv=require(_0x8d8f('0xa'));var ejs=require(_0x8d8f('0xb'));var fs=require('fs');var fs_extra=require(_0x8d8f('0xc'));var _=require(_0x8d8f('0xd'));var squel=require(_0x8d8f('0xe'));var crypto=require(_0x8d8f('0xf'));var jsforce=require(_0x8d8f('0x10'));var deskjs=require(_0x8d8f('0x11'));var toCsv=require(_0x8d8f('0xa'));var querystring=require(_0x8d8f('0x12'));var Papa=require('papaparse');var Redis=require(_0x8d8f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8d8f('0x14'));var as=require(_0x8d8f('0x15'));var hardwareService=require(_0x8d8f('0x16'));var logger=require(_0x8d8f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x8d8f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d8f('0x19'))['db'];function respondWithStatusCode(_0x2be1,_0x47ead4){_0x47ead4=_0x47ead4||0xcc;return function(_0x12b255){if(_0x12b255){return _0x2be1[_0x8d8f('0x1a')](_0x47ead4);}return _0x2be1['status'](_0x47ead4)[_0x8d8f('0x1b')]();};}function respondWithResult(_0x24b5ca,_0x5f91a3){_0x5f91a3=_0x5f91a3||0xc8;return function(_0x2a55fc){if(_0x2a55fc){return _0x24b5ca[_0x8d8f('0x1c')](_0x5f91a3)['json'](_0x2a55fc);}};}function respondWithFilteredResult(_0x165087,_0x211b53){return function(_0xfc6006){if(_0xfc6006){var _0x55c452=typeof _0x211b53[_0x8d8f('0x1d')]===_0x8d8f('0x1e')&&typeof _0x211b53['limit']===_0x8d8f('0x1e');var _0x1f440e=_0xfc6006['count'];var _0x1c964f=_0x55c452?0x0:_0x211b53[_0x8d8f('0x1d')];var _0x4c7ad5=_0x55c452?_0xfc6006[_0x8d8f('0x1f')]:_0x211b53['offset']+_0x211b53[_0x8d8f('0x20')];var _0x41c0b5;if(_0x4c7ad5>=_0x1f440e){_0x4c7ad5=_0x1f440e;_0x41c0b5=0xc8;}else{_0x41c0b5=0xce;}_0x165087[_0x8d8f('0x1c')](_0x41c0b5);return _0x165087['set'](_0x8d8f('0x21'),_0x1c964f+'-'+_0x4c7ad5+'/'+_0x1f440e)['json'](_0xfc6006);}return null;};}function patchUpdates(_0x54e3be){return function(_0x4eb9f5){try{jsonpatch[_0x8d8f('0x22')](_0x4eb9f5,_0x54e3be,!![]);}catch(_0x3b7910){return BPromise[_0x8d8f('0x23')](_0x3b7910);}return _0x4eb9f5[_0x8d8f('0x24')]();};}function saveUpdates(_0x5eece5,_0x145b4f){return function(_0x5e88af){if(_0x5e88af){return _0x5e88af['update'](_0x5eece5)[_0x8d8f('0x25')](function(_0x1358a7){return _0x1358a7;});}return null;};}function removeEntity(_0x2536e1,_0x193dce){return function(_0x24aead){if(_0x24aead){return _0x24aead[_0x8d8f('0x26')]()[_0x8d8f('0x25')](function(){_0x2536e1[_0x8d8f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54232f,_0x26e9c8){return function(_0x36f410){if(!_0x36f410){_0x54232f[_0x8d8f('0x1a')](0x194);}return _0x36f410;};}function handleError(_0x4ce800,_0x4cb496){_0x4cb496=_0x4cb496||0x1f4;return function(_0x2adb53){logger[_0x8d8f('0x27')](_0x2adb53[_0x8d8f('0x28')]);if(_0x2adb53[_0x8d8f('0x29')]){delete _0x2adb53[_0x8d8f('0x29')];}_0x4ce800['status'](_0x4cb496)[_0x8d8f('0x2a')](_0x2adb53);};}exports[_0x8d8f('0x2b')]=function(_0x3d12b2,_0x3c4aa2){var _0x4d44ac={},_0x19d668={},_0x25b495={'count':0x0,'rows':[]};var _0x4c2d64=_[_0x8d8f('0x2c')](db['Dynamics365Configuration'][_0x8d8f('0x2d')],function(_0x37984a){return{'name':_0x37984a[_0x8d8f('0x2e')],'type':_0x37984a[_0x8d8f('0x2f')][_0x8d8f('0x30')]};});_0x19d668['model']=_[_0x8d8f('0x2c')](_0x4c2d64,_0x8d8f('0x29'));_0x19d668[_0x8d8f('0x31')]=_[_0x8d8f('0x32')](_0x3d12b2['query']);_0x19d668[_0x8d8f('0x33')]=_[_0x8d8f('0x34')](_0x19d668[_0x8d8f('0x35')],_0x19d668['query']);_0x4d44ac[_0x8d8f('0x36')]=_[_0x8d8f('0x34')](_0x19d668[_0x8d8f('0x35')],qs[_0x8d8f('0x37')](_0x3d12b2['query'][_0x8d8f('0x37')]));_0x4d44ac['attributes']=_0x4d44ac[_0x8d8f('0x36')][_0x8d8f('0x38')]?_0x4d44ac['attributes']:_0x19d668[_0x8d8f('0x35')];if(!_0x3d12b2['query'][_0x8d8f('0x39')](_0x8d8f('0x3a'))){_0x4d44ac[_0x8d8f('0x20')]=qs[_0x8d8f('0x20')](_0x3d12b2[_0x8d8f('0x31')][_0x8d8f('0x20')]);_0x4d44ac[_0x8d8f('0x1d')]=qs[_0x8d8f('0x1d')](_0x3d12b2[_0x8d8f('0x31')][_0x8d8f('0x1d')]);}_0x4d44ac[_0x8d8f('0x3b')]=qs[_0x8d8f('0x3c')](_0x3d12b2[_0x8d8f('0x31')][_0x8d8f('0x3c')]);_0x4d44ac['where']=qs[_0x8d8f('0x33')](_[_0x8d8f('0x3d')](_0x3d12b2[_0x8d8f('0x31')],_0x19d668['filters']),_0x4c2d64);if(_0x3d12b2[_0x8d8f('0x31')][_0x8d8f('0x3e')]){_0x4d44ac[_0x8d8f('0x3f')]=_['merge'](_0x4d44ac[_0x8d8f('0x3f')],{'$or':_['map'](_0x4c2d64,function(_0x1b3dec){if(_0x1b3dec['type']!==_0x8d8f('0x40')){var _0x554949={};_0x554949[_0x1b3dec[_0x8d8f('0x29')]]={'$like':'%'+_0x3d12b2['query'][_0x8d8f('0x3e')]+'%'};return _0x554949;}})});}_0x4d44ac=_[_0x8d8f('0x41')]({},_0x4d44ac,_0x3d12b2[_0x8d8f('0x42')]);var _0x362b65={'where':_0x4d44ac['where']};return db[_0x8d8f('0x43')][_0x8d8f('0x1f')](_0x362b65)['then'](function(_0x4eddf8){_0x25b495[_0x8d8f('0x1f')]=_0x4eddf8;if(_0x3d12b2[_0x8d8f('0x31')]['includeAll']){_0x4d44ac[_0x8d8f('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x8d8f('0x45')](_0x4d44ac);})['then'](function(_0x4aa4d2){_0x25b495[_0x8d8f('0x46')]=_0x4aa4d2;return _0x25b495;})[_0x8d8f('0x25')](respondWithFilteredResult(_0x3c4aa2,_0x4d44ac))[_0x8d8f('0x47')](handleError(_0x3c4aa2,null));};exports[_0x8d8f('0x48')]=function(_0x21ba24,_0x2cf2ef){var _0x2fedfb={'raw':![],'where':{'id':_0x21ba24[_0x8d8f('0x49')]['id']}},_0x243d9e={};_0x243d9e['model']=_[_0x8d8f('0x32')](db[_0x8d8f('0x43')]['rawAttributes']);_0x243d9e[_0x8d8f('0x31')]=_[_0x8d8f('0x32')](_0x21ba24['query']);_0x243d9e['filters']=_[_0x8d8f('0x34')](_0x243d9e['model'],_0x243d9e[_0x8d8f('0x31')]);_0x2fedfb[_0x8d8f('0x36')]=_[_0x8d8f('0x34')](_0x243d9e[_0x8d8f('0x35')],qs[_0x8d8f('0x37')](_0x21ba24[_0x8d8f('0x31')][_0x8d8f('0x37')]));_0x2fedfb[_0x8d8f('0x36')]=_0x2fedfb[_0x8d8f('0x36')][_0x8d8f('0x38')]?_0x2fedfb['attributes']:_0x243d9e[_0x8d8f('0x35')];if(_0x21ba24[_0x8d8f('0x31')]['includeAll']){_0x2fedfb[_0x8d8f('0x44')]=[{'all':!![]}];}_0x2fedfb=_['merge']({},_0x2fedfb,_0x21ba24[_0x8d8f('0x42')]);return db['Dynamics365Configuration'][_0x8d8f('0x4a')](_0x2fedfb)[_0x8d8f('0x25')](handleEntityNotFound(_0x2cf2ef,null))['then'](respondWithResult(_0x2cf2ef,null))[_0x8d8f('0x47')](handleError(_0x2cf2ef,null));};exports['create']=function(_0x406b73,_0x2ec3b1){return db[_0x8d8f('0x43')][_0x8d8f('0x4b')](_0x406b73[_0x8d8f('0x4c')],{})[_0x8d8f('0x25')](respondWithResult(_0x2ec3b1,0xc9))[_0x8d8f('0x47')](handleError(_0x2ec3b1,null));};exports[_0x8d8f('0x4d')]=function(_0x1ad5bc,_0x5820dd){if(_0x1ad5bc[_0x8d8f('0x4c')]['id']){delete _0x1ad5bc[_0x8d8f('0x4c')]['id'];}return db['Dynamics365Configuration'][_0x8d8f('0x4a')]({'where':{'id':_0x1ad5bc[_0x8d8f('0x49')]['id']}})[_0x8d8f('0x25')](handleEntityNotFound(_0x5820dd,null))[_0x8d8f('0x25')](saveUpdates(_0x1ad5bc[_0x8d8f('0x4c')],null))[_0x8d8f('0x25')](respondWithResult(_0x5820dd,null))[_0x8d8f('0x47')](handleError(_0x5820dd,null));};exports[_0x8d8f('0x26')]=function(_0x268a89,_0x4c0177){return db[_0x8d8f('0x43')][_0x8d8f('0x4a')]({'where':{'id':_0x268a89['params']['id']}})[_0x8d8f('0x25')](handleEntityNotFound(_0x4c0177,null))[_0x8d8f('0x25')](removeEntity(_0x4c0177,null))['catch'](handleError(_0x4c0177,null));};exports['getFields']=function(_0x3e0306,_0x6acc9f,_0x6a625a){var _0xceab7={};var _0x3a9399={};var _0x50d4d3;var _0x38abb6;return db['Dynamics365Configuration'][_0x8d8f('0x4e')]({'where':{'id':_0x3e0306[_0x8d8f('0x49')]['id']}})[_0x8d8f('0x25')](handleEntityNotFound(_0x6acc9f,null))['then'](function(_0x40116a){if(_0x40116a){_0x50d4d3=_0x40116a;_0x3a9399[_0x8d8f('0x35')]=_['keys'](db['Dynamics365Field'][_0x8d8f('0x2d')]);_0x3a9399['query']=_[_0x8d8f('0x32')](_0x3e0306[_0x8d8f('0x31')]);_0x3a9399[_0x8d8f('0x33')]=_[_0x8d8f('0x34')](_0x3a9399[_0x8d8f('0x35')],_0x3a9399[_0x8d8f('0x31')]);_0xceab7[_0x8d8f('0x36')]=_[_0x8d8f('0x34')](_0x3a9399[_0x8d8f('0x35')],qs['fields'](_0x3e0306['query'][_0x8d8f('0x37')]));_0xceab7[_0x8d8f('0x36')]=_0xceab7[_0x8d8f('0x36')][_0x8d8f('0x38')]?_0xceab7[_0x8d8f('0x36')]:_0x3a9399[_0x8d8f('0x35')];_0xceab7[_0x8d8f('0x3b')]=qs['sort'](_0x3e0306[_0x8d8f('0x31')][_0x8d8f('0x3c')]);_0xceab7['where']=qs[_0x8d8f('0x33')](_['pick'](_0x3e0306[_0x8d8f('0x31')],_0x3a9399[_0x8d8f('0x33')]));if(_0x3e0306[_0x8d8f('0x31')][_0x8d8f('0x3e')]){_0xceab7[_0x8d8f('0x3f')]=_[_0x8d8f('0x41')](_0xceab7[_0x8d8f('0x3f')],{'$or':_[_0x8d8f('0x2c')](_0xceab7['attributes'],function(_0x163535){var _0x1df951={};_0x1df951[_0x163535]={'$like':'%'+_0x3e0306['query'][_0x8d8f('0x3e')]+'%'};return _0x1df951;})});}_0xceab7=_[_0x8d8f('0x41')]({},_0xceab7,_0x3e0306[_0x8d8f('0x42')]);return _0x50d4d3[_0x8d8f('0x4f')](_0xceab7);}})[_0x8d8f('0x25')](function(_0x3469af){if(_0x3469af){_0x38abb6=_0x3469af[_0x8d8f('0x38')];if(!_0x3e0306['query']['hasOwnProperty']('nolimit')){_0xceab7[_0x8d8f('0x20')]=qs[_0x8d8f('0x20')](_0x3e0306[_0x8d8f('0x31')][_0x8d8f('0x20')]);_0xceab7[_0x8d8f('0x1d')]=qs[_0x8d8f('0x1d')](_0x3e0306[_0x8d8f('0x31')][_0x8d8f('0x1d')]);}return _0x50d4d3[_0x8d8f('0x4f')](_0xceab7);}})[_0x8d8f('0x25')](function(_0x2c78b4){if(_0x2c78b4){return _0x2c78b4?{'count':_0x38abb6,'rows':_0x2c78b4}:null;}})[_0x8d8f('0x25')](respondWithResult(_0x6acc9f,null))[_0x8d8f('0x47')](handleError(_0x6acc9f,null));};exports[_0x8d8f('0x50')]=function(_0x59a828,_0x588ab2,_0x325f2f){var _0x150678={};var _0x3e63bf={};var _0x3c7e87;var _0x16c1ac;return db[_0x8d8f('0x43')][_0x8d8f('0x4e')]({'where':{'id':_0x59a828[_0x8d8f('0x49')]['id']}})[_0x8d8f('0x25')](handleEntityNotFound(_0x588ab2,null))[_0x8d8f('0x25')](function(_0x222cae){if(_0x222cae){_0x3c7e87=_0x222cae;_0x3e63bf[_0x8d8f('0x35')]=_[_0x8d8f('0x32')](db['Dynamics365Field'][_0x8d8f('0x2d')]);_0x3e63bf[_0x8d8f('0x31')]=_[_0x8d8f('0x32')](_0x59a828[_0x8d8f('0x31')]);_0x3e63bf[_0x8d8f('0x33')]=_['intersection'](_0x3e63bf['model'],_0x3e63bf['query']);_0x150678[_0x8d8f('0x36')]=_[_0x8d8f('0x34')](_0x3e63bf[_0x8d8f('0x35')],qs[_0x8d8f('0x37')](_0x59a828['query'][_0x8d8f('0x37')]));_0x150678[_0x8d8f('0x36')]=_0x150678[_0x8d8f('0x36')][_0x8d8f('0x38')]?_0x150678[_0x8d8f('0x36')]:_0x3e63bf[_0x8d8f('0x35')];_0x150678[_0x8d8f('0x3b')]=qs[_0x8d8f('0x3c')](_0x59a828[_0x8d8f('0x31')]['sort']);_0x150678[_0x8d8f('0x3f')]=qs['filters'](_[_0x8d8f('0x3d')](_0x59a828[_0x8d8f('0x31')],_0x3e63bf[_0x8d8f('0x33')]));if(_0x59a828[_0x8d8f('0x31')]['filter']){_0x150678['where']=_['merge'](_0x150678[_0x8d8f('0x3f')],{'$or':_['map'](_0x150678[_0x8d8f('0x36')],function(_0x3cff66){var _0x35f8fc={};_0x35f8fc[_0x3cff66]={'$like':'%'+_0x59a828[_0x8d8f('0x31')][_0x8d8f('0x3e')]+'%'};return _0x35f8fc;})});}_0x150678=_['merge']({},_0x150678,_0x59a828['options']);return _0x3c7e87['getSubjects'](_0x150678);}})[_0x8d8f('0x25')](function(_0x4a6305){if(_0x4a6305){_0x16c1ac=_0x4a6305['length'];if(!_0x59a828[_0x8d8f('0x31')]['hasOwnProperty'](_0x8d8f('0x3a'))){_0x150678[_0x8d8f('0x20')]=qs[_0x8d8f('0x20')](_0x59a828[_0x8d8f('0x31')][_0x8d8f('0x20')]);_0x150678[_0x8d8f('0x1d')]=qs[_0x8d8f('0x1d')](_0x59a828[_0x8d8f('0x31')][_0x8d8f('0x1d')]);}return _0x3c7e87[_0x8d8f('0x50')](_0x150678);}})[_0x8d8f('0x25')](function(_0x538f35){if(_0x538f35){return _0x538f35?{'count':_0x16c1ac,'rows':_0x538f35}:null;}})[_0x8d8f('0x25')](respondWithResult(_0x588ab2,null))[_0x8d8f('0x47')](handleError(_0x588ab2,null));};exports[_0x8d8f('0x51')]=function(_0x3a09a8,_0x379744,_0x1c2bd6){var _0x3aac3b={};var _0x3067f7={};var _0x35ff8a;var _0x34418d;return db[_0x8d8f('0x43')]['findOne']({'where':{'id':_0x3a09a8[_0x8d8f('0x49')]['id']}})[_0x8d8f('0x25')](handleEntityNotFound(_0x379744,null))[_0x8d8f('0x25')](function(_0xe60cf7){if(_0xe60cf7){_0x35ff8a=_0xe60cf7;_0x3067f7[_0x8d8f('0x35')]=_[_0x8d8f('0x32')](db[_0x8d8f('0x52')][_0x8d8f('0x2d')]);_0x3067f7[_0x8d8f('0x31')]=_['keys'](_0x3a09a8[_0x8d8f('0x31')]);_0x3067f7[_0x8d8f('0x33')]=_['intersection'](_0x3067f7[_0x8d8f('0x35')],_0x3067f7[_0x8d8f('0x31')]);_0x3aac3b[_0x8d8f('0x36')]=_[_0x8d8f('0x34')](_0x3067f7[_0x8d8f('0x35')],qs[_0x8d8f('0x37')](_0x3a09a8['query']['fields']));_0x3aac3b[_0x8d8f('0x36')]=_0x3aac3b['attributes']['length']?_0x3aac3b[_0x8d8f('0x36')]:_0x3067f7['model'];_0x3aac3b[_0x8d8f('0x3b')]=qs['sort'](_0x3a09a8[_0x8d8f('0x31')][_0x8d8f('0x3c')]);_0x3aac3b[_0x8d8f('0x3f')]=qs[_0x8d8f('0x33')](_[_0x8d8f('0x3d')](_0x3a09a8[_0x8d8f('0x31')],_0x3067f7['filters']));if(_0x3a09a8['query'][_0x8d8f('0x3e')]){_0x3aac3b[_0x8d8f('0x3f')]=_['merge'](_0x3aac3b[_0x8d8f('0x3f')],{'$or':_[_0x8d8f('0x2c')](_0x3aac3b[_0x8d8f('0x36')],function(_0xc79451){var _0x1b02d9={};_0x1b02d9[_0xc79451]={'$like':'%'+_0x3a09a8['query']['filter']+'%'};return _0x1b02d9;})});}_0x3aac3b=_['merge']({},_0x3aac3b,_0x3a09a8['options']);return _0x35ff8a[_0x8d8f('0x51')](_0x3aac3b);}})['then'](function(_0x2d5025){if(_0x2d5025){_0x34418d=_0x2d5025[_0x8d8f('0x38')];if(!_0x3a09a8[_0x8d8f('0x31')][_0x8d8f('0x39')](_0x8d8f('0x3a'))){_0x3aac3b['limit']=qs[_0x8d8f('0x20')](_0x3a09a8['query'][_0x8d8f('0x20')]);_0x3aac3b['offset']=qs['offset'](_0x3a09a8['query'][_0x8d8f('0x1d')]);}return _0x35ff8a[_0x8d8f('0x51')](_0x3aac3b);}})[_0x8d8f('0x25')](function(_0x335bd1){if(_0x335bd1){return _0x335bd1?{'count':_0x34418d,'rows':_0x335bd1}:null;}})[_0x8d8f('0x25')](respondWithResult(_0x379744,null))[_0x8d8f('0x47')](handleError(_0x379744,null));}; \ No newline at end of file +var _0xfcb8=['update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','VIRTUAL','options','where','includeAll','findAll','catch','params','find','body','findOne','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x997222,_0x5c0bd8){var _0x4b8869=function(_0x378a38){while(--_0x378a38){_0x997222['push'](_0x997222['shift']());}};_0x4b8869(++_0x5c0bd8);}(_0xfcb8,0xc5));var _0x8fcb=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xfcb8[_0x271060];return _0x40540b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fcb('0x0'));var zipdir=require(_0x8fcb('0x1'));var jsonpatch=require(_0x8fcb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8fcb('0x3'));var Mustache=require(_0x8fcb('0x4'));var util=require(_0x8fcb('0x5'));var path=require(_0x8fcb('0x6'));var sox=require(_0x8fcb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fcb('0x8'));var _=require(_0x8fcb('0x9'));var squel=require(_0x8fcb('0xa'));var crypto=require(_0x8fcb('0xb'));var jsforce=require(_0x8fcb('0xc'));var deskjs=require(_0x8fcb('0xd'));var toCsv=require(_0x8fcb('0xe'));var querystring=require(_0x8fcb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8fcb('0x10'));var as=require(_0x8fcb('0x11'));var hardwareService=require(_0x8fcb('0x12'));var logger=require(_0x8fcb('0x13'))(_0x8fcb('0x14'));var utils=require(_0x8fcb('0x15'));var config=require(_0x8fcb('0x16'));var licenseUtil=require(_0x8fcb('0x17'));var db=require(_0x8fcb('0x18'))['db'];function respondWithStatusCode(_0x1f2741,_0x424acf){_0x424acf=_0x424acf||0xcc;return function(_0x30254a){if(_0x30254a){return _0x1f2741[_0x8fcb('0x19')](_0x424acf);}return _0x1f2741[_0x8fcb('0x1a')](_0x424acf)[_0x8fcb('0x1b')]();};}function respondWithResult(_0x16816a,_0x31fa5b){_0x31fa5b=_0x31fa5b||0xc8;return function(_0x21a407){if(_0x21a407){return _0x16816a[_0x8fcb('0x1a')](_0x31fa5b)['json'](_0x21a407);}};}function respondWithFilteredResult(_0x59fe4e,_0x70cc60){return function(_0x457761){if(_0x457761){var _0x27d2fd=typeof _0x70cc60[_0x8fcb('0x1c')]===_0x8fcb('0x1d')&&typeof _0x70cc60[_0x8fcb('0x1e')]===_0x8fcb('0x1d');var _0x2d61a6=_0x457761['count'];var _0x4ac3b6=_0x27d2fd?0x0:_0x70cc60[_0x8fcb('0x1c')];var _0x34cef6=_0x27d2fd?_0x457761[_0x8fcb('0x1f')]:_0x70cc60['offset']+_0x70cc60[_0x8fcb('0x1e')];var _0x1e0e45;if(_0x34cef6>=_0x2d61a6){_0x34cef6=_0x2d61a6;_0x1e0e45=0xc8;}else{_0x1e0e45=0xce;}_0x59fe4e[_0x8fcb('0x1a')](_0x1e0e45);return _0x59fe4e[_0x8fcb('0x20')](_0x8fcb('0x21'),_0x4ac3b6+'-'+_0x34cef6+'/'+_0x2d61a6)['json'](_0x457761);}return null;};}function patchUpdates(_0x184980){return function(_0x250859){try{jsonpatch[_0x8fcb('0x22')](_0x250859,_0x184980,!![]);}catch(_0x14f87f){return BPromise[_0x8fcb('0x23')](_0x14f87f);}return _0x250859[_0x8fcb('0x24')]();};}function saveUpdates(_0x24c7c0,_0x2b2c79){return function(_0x9709a0){if(_0x9709a0){return _0x9709a0[_0x8fcb('0x25')](_0x24c7c0)[_0x8fcb('0x26')](function(_0x411e64){return _0x411e64;});}return null;};}function removeEntity(_0x3f3273,_0x15d193){return function(_0xd020f8){if(_0xd020f8){return _0xd020f8[_0x8fcb('0x27')]()[_0x8fcb('0x26')](function(){_0x3f3273[_0x8fcb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x464bf3,_0x167b34){return function(_0x5a155d){if(!_0x5a155d){_0x464bf3['sendStatus'](0x194);}return _0x5a155d;};}function handleError(_0x1ea3ad,_0x16eec8){_0x16eec8=_0x16eec8||0x1f4;return function(_0x21055d){logger[_0x8fcb('0x28')](_0x21055d[_0x8fcb('0x29')]);if(_0x21055d[_0x8fcb('0x2a')]){delete _0x21055d[_0x8fcb('0x2a')];}_0x1ea3ad[_0x8fcb('0x1a')](_0x16eec8)[_0x8fcb('0x2b')](_0x21055d);};}exports[_0x8fcb('0x2c')]=function(_0x25feac,_0x5c8a6f){var _0x489686={},_0x55fb48={},_0x2a974e={'count':0x0,'rows':[]};var _0x573196=_[_0x8fcb('0x2d')](db[_0x8fcb('0x2e')][_0x8fcb('0x2f')],function(_0x350da6){return{'name':_0x350da6['fieldName'],'type':_0x350da6[_0x8fcb('0x30')][_0x8fcb('0x31')]};});_0x55fb48[_0x8fcb('0x32')]=_[_0x8fcb('0x2d')](_0x573196,_0x8fcb('0x2a'));_0x55fb48[_0x8fcb('0x33')]=_[_0x8fcb('0x34')](_0x25feac['query']);_0x55fb48['filters']=_[_0x8fcb('0x35')](_0x55fb48[_0x8fcb('0x32')],_0x55fb48[_0x8fcb('0x33')]);_0x489686[_0x8fcb('0x36')]=_[_0x8fcb('0x35')](_0x55fb48[_0x8fcb('0x32')],qs[_0x8fcb('0x37')](_0x25feac[_0x8fcb('0x33')]['fields']));_0x489686[_0x8fcb('0x36')]=_0x489686[_0x8fcb('0x36')][_0x8fcb('0x38')]?_0x489686[_0x8fcb('0x36')]:_0x55fb48['model'];if(!_0x25feac[_0x8fcb('0x33')]['hasOwnProperty'](_0x8fcb('0x39'))){_0x489686['limit']=qs[_0x8fcb('0x1e')](_0x25feac[_0x8fcb('0x33')][_0x8fcb('0x1e')]);_0x489686[_0x8fcb('0x1c')]=qs[_0x8fcb('0x1c')](_0x25feac['query'][_0x8fcb('0x1c')]);}_0x489686[_0x8fcb('0x3a')]=qs[_0x8fcb('0x3b')](_0x25feac[_0x8fcb('0x33')][_0x8fcb('0x3b')]);_0x489686['where']=qs['filters'](_[_0x8fcb('0x3c')](_0x25feac[_0x8fcb('0x33')],_0x55fb48[_0x8fcb('0x3d')]),_0x573196);if(_0x25feac[_0x8fcb('0x33')][_0x8fcb('0x3e')]){_0x489686['where']=_[_0x8fcb('0x3f')](_0x489686['where'],{'$or':_[_0x8fcb('0x2d')](_0x573196,function(_0x3d0910){if(_0x3d0910[_0x8fcb('0x30')]!==_0x8fcb('0x40')){var _0x1a40bf={};_0x1a40bf[_0x3d0910['name']]={'$like':'%'+_0x25feac[_0x8fcb('0x33')][_0x8fcb('0x3e')]+'%'};return _0x1a40bf;}})});}_0x489686=_['merge']({},_0x489686,_0x25feac[_0x8fcb('0x41')]);var _0x38a348={'where':_0x489686[_0x8fcb('0x42')]};return db['Dynamics365Configuration'][_0x8fcb('0x1f')](_0x38a348)[_0x8fcb('0x26')](function(_0x3d4ae3){_0x2a974e[_0x8fcb('0x1f')]=_0x3d4ae3;if(_0x25feac[_0x8fcb('0x33')][_0x8fcb('0x43')]){_0x489686['include']=[{'all':!![]}];}return db[_0x8fcb('0x2e')][_0x8fcb('0x44')](_0x489686);})['then'](function(_0x1ba5ab){_0x2a974e['rows']=_0x1ba5ab;return _0x2a974e;})['then'](respondWithFilteredResult(_0x5c8a6f,_0x489686))[_0x8fcb('0x45')](handleError(_0x5c8a6f,null));};exports['show']=function(_0x537570,_0x260f13){var _0x24d4a2={'raw':![],'where':{'id':_0x537570[_0x8fcb('0x46')]['id']}},_0x576c0f={};_0x576c0f['model']=_[_0x8fcb('0x34')](db[_0x8fcb('0x2e')][_0x8fcb('0x2f')]);_0x576c0f[_0x8fcb('0x33')]=_[_0x8fcb('0x34')](_0x537570[_0x8fcb('0x33')]);_0x576c0f[_0x8fcb('0x3d')]=_[_0x8fcb('0x35')](_0x576c0f[_0x8fcb('0x32')],_0x576c0f['query']);_0x24d4a2[_0x8fcb('0x36')]=_['intersection'](_0x576c0f['model'],qs['fields'](_0x537570[_0x8fcb('0x33')][_0x8fcb('0x37')]));_0x24d4a2['attributes']=_0x24d4a2[_0x8fcb('0x36')][_0x8fcb('0x38')]?_0x24d4a2[_0x8fcb('0x36')]:_0x576c0f[_0x8fcb('0x32')];if(_0x537570[_0x8fcb('0x33')][_0x8fcb('0x43')]){_0x24d4a2['include']=[{'all':!![]}];}_0x24d4a2=_[_0x8fcb('0x3f')]({},_0x24d4a2,_0x537570[_0x8fcb('0x41')]);return db[_0x8fcb('0x2e')][_0x8fcb('0x47')](_0x24d4a2)['then'](handleEntityNotFound(_0x260f13,null))[_0x8fcb('0x26')](respondWithResult(_0x260f13,null))[_0x8fcb('0x45')](handleError(_0x260f13,null));};exports['create']=function(_0x435a79,_0x5de747){return db['Dynamics365Configuration']['create'](_0x435a79[_0x8fcb('0x48')],{})[_0x8fcb('0x26')](respondWithResult(_0x5de747,0xc9))[_0x8fcb('0x45')](handleError(_0x5de747,null));};exports[_0x8fcb('0x25')]=function(_0x12a7e8,_0x4652bd){if(_0x12a7e8['body']['id']){delete _0x12a7e8['body']['id'];}return db[_0x8fcb('0x2e')][_0x8fcb('0x47')]({'where':{'id':_0x12a7e8[_0x8fcb('0x46')]['id']}})['then'](handleEntityNotFound(_0x4652bd,null))[_0x8fcb('0x26')](saveUpdates(_0x12a7e8[_0x8fcb('0x48')],null))['then'](respondWithResult(_0x4652bd,null))[_0x8fcb('0x45')](handleError(_0x4652bd,null));};exports[_0x8fcb('0x27')]=function(_0x317b98,_0x1aa718){return db[_0x8fcb('0x2e')][_0x8fcb('0x47')]({'where':{'id':_0x317b98[_0x8fcb('0x46')]['id']}})[_0x8fcb('0x26')](handleEntityNotFound(_0x1aa718,null))[_0x8fcb('0x26')](removeEntity(_0x1aa718,null))[_0x8fcb('0x45')](handleError(_0x1aa718,null));};exports['getFields']=function(_0x4b9d2f,_0x27adb6,_0x5e5cc1){var _0x1d8e3e={};var _0x5a7a95={};var _0x5eac5a;var _0x26968f;return db[_0x8fcb('0x2e')][_0x8fcb('0x49')]({'where':{'id':_0x4b9d2f[_0x8fcb('0x46')]['id']}})[_0x8fcb('0x26')](handleEntityNotFound(_0x27adb6,null))['then'](function(_0x56e205){if(_0x56e205){_0x5eac5a=_0x56e205;_0x5a7a95['model']=_['keys'](db['Dynamics365Field'][_0x8fcb('0x2f')]);_0x5a7a95[_0x8fcb('0x33')]=_[_0x8fcb('0x34')](_0x4b9d2f[_0x8fcb('0x33')]);_0x5a7a95['filters']=_[_0x8fcb('0x35')](_0x5a7a95[_0x8fcb('0x32')],_0x5a7a95[_0x8fcb('0x33')]);_0x1d8e3e[_0x8fcb('0x36')]=_[_0x8fcb('0x35')](_0x5a7a95[_0x8fcb('0x32')],qs[_0x8fcb('0x37')](_0x4b9d2f['query'][_0x8fcb('0x37')]));_0x1d8e3e[_0x8fcb('0x36')]=_0x1d8e3e[_0x8fcb('0x36')][_0x8fcb('0x38')]?_0x1d8e3e[_0x8fcb('0x36')]:_0x5a7a95[_0x8fcb('0x32')];_0x1d8e3e[_0x8fcb('0x3a')]=qs[_0x8fcb('0x3b')](_0x4b9d2f[_0x8fcb('0x33')]['sort']);_0x1d8e3e[_0x8fcb('0x42')]=qs['filters'](_[_0x8fcb('0x3c')](_0x4b9d2f['query'],_0x5a7a95[_0x8fcb('0x3d')]));if(_0x4b9d2f[_0x8fcb('0x33')]['filter']){_0x1d8e3e['where']=_[_0x8fcb('0x3f')](_0x1d8e3e[_0x8fcb('0x42')],{'$or':_[_0x8fcb('0x2d')](_0x1d8e3e[_0x8fcb('0x36')],function(_0x1c047e){var _0x47b62c={};_0x47b62c[_0x1c047e]={'$like':'%'+_0x4b9d2f[_0x8fcb('0x33')][_0x8fcb('0x3e')]+'%'};return _0x47b62c;})});}_0x1d8e3e=_['merge']({},_0x1d8e3e,_0x4b9d2f[_0x8fcb('0x41')]);return _0x5eac5a[_0x8fcb('0x4a')](_0x1d8e3e);}})[_0x8fcb('0x26')](function(_0x35ce24){if(_0x35ce24){_0x26968f=_0x35ce24[_0x8fcb('0x38')];if(!_0x4b9d2f[_0x8fcb('0x33')][_0x8fcb('0x4b')](_0x8fcb('0x39'))){_0x1d8e3e[_0x8fcb('0x1e')]=qs[_0x8fcb('0x1e')](_0x4b9d2f[_0x8fcb('0x33')][_0x8fcb('0x1e')]);_0x1d8e3e[_0x8fcb('0x1c')]=qs[_0x8fcb('0x1c')](_0x4b9d2f[_0x8fcb('0x33')][_0x8fcb('0x1c')]);}return _0x5eac5a[_0x8fcb('0x4a')](_0x1d8e3e);}})['then'](function(_0x4f5f62){if(_0x4f5f62){return _0x4f5f62?{'count':_0x26968f,'rows':_0x4f5f62}:null;}})['then'](respondWithResult(_0x27adb6,null))[_0x8fcb('0x45')](handleError(_0x27adb6,null));};exports[_0x8fcb('0x4c')]=function(_0xf2fd3d,_0x1bd85b,_0x6ca960){var _0x1405a4={};var _0x3ab2e1={};var _0x3761c5;var _0x41ef9c;return db[_0x8fcb('0x2e')][_0x8fcb('0x49')]({'where':{'id':_0xf2fd3d['params']['id']}})[_0x8fcb('0x26')](handleEntityNotFound(_0x1bd85b,null))[_0x8fcb('0x26')](function(_0x318439){if(_0x318439){_0x3761c5=_0x318439;_0x3ab2e1['model']=_[_0x8fcb('0x34')](db['Dynamics365Field'][_0x8fcb('0x2f')]);_0x3ab2e1[_0x8fcb('0x33')]=_[_0x8fcb('0x34')](_0xf2fd3d['query']);_0x3ab2e1[_0x8fcb('0x3d')]=_[_0x8fcb('0x35')](_0x3ab2e1[_0x8fcb('0x32')],_0x3ab2e1[_0x8fcb('0x33')]);_0x1405a4[_0x8fcb('0x36')]=_[_0x8fcb('0x35')](_0x3ab2e1[_0x8fcb('0x32')],qs[_0x8fcb('0x37')](_0xf2fd3d[_0x8fcb('0x33')][_0x8fcb('0x37')]));_0x1405a4['attributes']=_0x1405a4[_0x8fcb('0x36')][_0x8fcb('0x38')]?_0x1405a4['attributes']:_0x3ab2e1[_0x8fcb('0x32')];_0x1405a4[_0x8fcb('0x3a')]=qs[_0x8fcb('0x3b')](_0xf2fd3d['query'][_0x8fcb('0x3b')]);_0x1405a4[_0x8fcb('0x42')]=qs[_0x8fcb('0x3d')](_[_0x8fcb('0x3c')](_0xf2fd3d[_0x8fcb('0x33')],_0x3ab2e1[_0x8fcb('0x3d')]));if(_0xf2fd3d[_0x8fcb('0x33')]['filter']){_0x1405a4[_0x8fcb('0x42')]=_[_0x8fcb('0x3f')](_0x1405a4[_0x8fcb('0x42')],{'$or':_[_0x8fcb('0x2d')](_0x1405a4['attributes'],function(_0x83a73b){var _0x55533c={};_0x55533c[_0x83a73b]={'$like':'%'+_0xf2fd3d[_0x8fcb('0x33')][_0x8fcb('0x3e')]+'%'};return _0x55533c;})});}_0x1405a4=_[_0x8fcb('0x3f')]({},_0x1405a4,_0xf2fd3d['options']);return _0x3761c5[_0x8fcb('0x4c')](_0x1405a4);}})[_0x8fcb('0x26')](function(_0x3786ca){if(_0x3786ca){_0x41ef9c=_0x3786ca['length'];if(!_0xf2fd3d[_0x8fcb('0x33')][_0x8fcb('0x4b')](_0x8fcb('0x39'))){_0x1405a4['limit']=qs[_0x8fcb('0x1e')](_0xf2fd3d['query']['limit']);_0x1405a4[_0x8fcb('0x1c')]=qs[_0x8fcb('0x1c')](_0xf2fd3d[_0x8fcb('0x33')]['offset']);}return _0x3761c5['getSubjects'](_0x1405a4);}})[_0x8fcb('0x26')](function(_0x393f52){if(_0x393f52){return _0x393f52?{'count':_0x41ef9c,'rows':_0x393f52}:null;}})[_0x8fcb('0x26')](respondWithResult(_0x1bd85b,null))[_0x8fcb('0x45')](handleError(_0x1bd85b,null));};exports[_0x8fcb('0x4d')]=function(_0x443fc8,_0x2addcc,_0x6bb2ca){var _0x29c1cd={};var _0x103e78={};var _0x39d795;var _0x897f15;return db[_0x8fcb('0x2e')][_0x8fcb('0x49')]({'where':{'id':_0x443fc8[_0x8fcb('0x46')]['id']}})[_0x8fcb('0x26')](handleEntityNotFound(_0x2addcc,null))['then'](function(_0x5ab732){if(_0x5ab732){_0x39d795=_0x5ab732;_0x103e78[_0x8fcb('0x32')]=_['keys'](db['Dynamics365Field'][_0x8fcb('0x2f')]);_0x103e78['query']=_[_0x8fcb('0x34')](_0x443fc8['query']);_0x103e78[_0x8fcb('0x3d')]=_[_0x8fcb('0x35')](_0x103e78['model'],_0x103e78[_0x8fcb('0x33')]);_0x29c1cd[_0x8fcb('0x36')]=_[_0x8fcb('0x35')](_0x103e78['model'],qs[_0x8fcb('0x37')](_0x443fc8['query'][_0x8fcb('0x37')]));_0x29c1cd[_0x8fcb('0x36')]=_0x29c1cd[_0x8fcb('0x36')][_0x8fcb('0x38')]?_0x29c1cd[_0x8fcb('0x36')]:_0x103e78[_0x8fcb('0x32')];_0x29c1cd[_0x8fcb('0x3a')]=qs[_0x8fcb('0x3b')](_0x443fc8[_0x8fcb('0x33')][_0x8fcb('0x3b')]);_0x29c1cd[_0x8fcb('0x42')]=qs[_0x8fcb('0x3d')](_[_0x8fcb('0x3c')](_0x443fc8['query'],_0x103e78[_0x8fcb('0x3d')]));if(_0x443fc8[_0x8fcb('0x33')][_0x8fcb('0x3e')]){_0x29c1cd[_0x8fcb('0x42')]=_[_0x8fcb('0x3f')](_0x29c1cd[_0x8fcb('0x42')],{'$or':_[_0x8fcb('0x2d')](_0x29c1cd['attributes'],function(_0x1c6fb1){var _0x4e0448={};_0x4e0448[_0x1c6fb1]={'$like':'%'+_0x443fc8['query'][_0x8fcb('0x3e')]+'%'};return _0x4e0448;})});}_0x29c1cd=_[_0x8fcb('0x3f')]({},_0x29c1cd,_0x443fc8[_0x8fcb('0x41')]);return _0x39d795['getDescriptions'](_0x29c1cd);}})['then'](function(_0x2ed325){if(_0x2ed325){_0x897f15=_0x2ed325[_0x8fcb('0x38')];if(!_0x443fc8[_0x8fcb('0x33')]['hasOwnProperty'](_0x8fcb('0x39'))){_0x29c1cd[_0x8fcb('0x1e')]=qs[_0x8fcb('0x1e')](_0x443fc8[_0x8fcb('0x33')][_0x8fcb('0x1e')]);_0x29c1cd[_0x8fcb('0x1c')]=qs[_0x8fcb('0x1c')](_0x443fc8[_0x8fcb('0x33')][_0x8fcb('0x1c')]);}return _0x39d795['getDescriptions'](_0x29c1cd);}})['then'](function(_0x2bbf19){if(_0x2bbf19){return _0x2bbf19?{'count':_0x897f15,'rows':_0x2bbf19}:null;}})[_0x8fcb('0x26')](respondWithResult(_0x2addcc,null))[_0x8fcb('0x45')](handleError(_0x2addcc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 2e78d2b..6be672b 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 _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4f147d,_0x5457f3){var _0x3c6f44=function(_0x19b7bf){while(--_0x19b7bf){_0x4f147d['push'](_0x4f147d['shift']());}};_0x3c6f44(++_0x5457f3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x30b057,_0x1d1505){_0x30b057=_0x30b057-0x0;var _0x331671=_0xf3cd[_0x30b057];return _0x331671;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x3ac8fd,_0x2bc52c){var _0x3a88bb=function(_0x92b4de){while(--_0x92b4de){_0x3ac8fd['push'](_0x3ac8fd['shift']());}};_0x3a88bb(++_0x2bc52c);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index bb34d45..ef25a3e 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 _0xa4b3=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1d44be,_0x4e950b){var _0x437a2a=function(_0x14ad28){while(--_0x14ad28){_0x1d44be['push'](_0x1d44be['shift']());}};_0x437a2a(++_0x4e950b);}(_0xa4b3,0x115));var _0x3a4b=function(_0x5c16b8,_0x325817){_0x5c16b8=_0x5c16b8-0x0;var _0x45d5ed=_0xa4b3[_0x5c16b8];return _0x45d5ed;};'use strict';var _=require(_0x3a4b('0x0'));var util=require(_0x3a4b('0x1'));var moment=require('moment');var BPromise=require(_0x3a4b('0x2'));var rs=require(_0x3a4b('0x3'));var fs=require('fs');var Redis=require(_0x3a4b('0x4'));var db=require(_0x3a4b('0x5'))['db'];var utils=require(_0x3a4b('0x6'));var logger=require(_0x3a4b('0x7'))(_0x3a4b('0x8'));var config=require(_0x3a4b('0x9'));var jayson=require(_0x3a4b('0xa'));var client=jayson[_0x3a4b('0xb')][_0x3a4b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ab231,_0x5b731f,_0xe895e7){return new BPromise(function(_0x21b0cd,_0x252915){return client[_0x3a4b('0xd')](_0x4ab231,_0xe895e7)[_0x3a4b('0xe')](function(_0x4258ee){logger[_0x3a4b('0xf')](_0x3a4b('0x10'),_0x5b731f,_0x3a4b('0x11'));logger[_0x3a4b('0x12')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5b731f,_0x3a4b('0x11'),JSON[_0x3a4b('0x13')](_0x4258ee));if(_0x4258ee[_0x3a4b('0x14')]){if(_0x4258ee[_0x3a4b('0x14')][_0x3a4b('0x15')]===0x1f4){logger[_0x3a4b('0x14')](_0x3a4b('0x10'),_0x5b731f,_0x4258ee[_0x3a4b('0x14')][_0x3a4b('0x16')]);return _0x252915(_0x4258ee['error'][_0x3a4b('0x16')]);}logger[_0x3a4b('0x14')](_0x3a4b('0x10'),_0x5b731f,_0x4258ee[_0x3a4b('0x14')][_0x3a4b('0x16')]);return _0x21b0cd(_0x4258ee[_0x3a4b('0x14')][_0x3a4b('0x16')]);}else{logger[_0x3a4b('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b731f,_0x3a4b('0x11'));_0x21b0cd(_0x4258ee[_0x3a4b('0x17')]['message']);}})[_0x3a4b('0x18')](function(_0x3922e9){logger['error'](_0x3a4b('0x10'),_0x5b731f,_0x3922e9);_0x252915(_0x3922e9);});});} \ No newline at end of file +var _0x7a0e=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x50600f,_0x1a5b76){var _0x24cfe1=function(_0x38730c){while(--_0x38730c){_0x50600f['push'](_0x50600f['shift']());}};_0x24cfe1(++_0x1a5b76);}(_0x7a0e,0x1ee));var _0xe7a0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7a0e[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xe7a0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe7a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7a0('0x2'))['db'];var utils=require(_0xe7a0('0x3'));var logger=require(_0xe7a0('0x4'))('rpc');var config=require(_0xe7a0('0x5'));var jayson=require(_0xe7a0('0x6'));var client=jayson[_0xe7a0('0x7')][_0xe7a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41a49b,_0x290c8e,_0x42342f){return new BPromise(function(_0xf30d1,_0x228cf8){return client[_0xe7a0('0x9')](_0x41a49b,_0x42342f)[_0xe7a0('0xa')](function(_0x3f410c){logger['info'](_0xe7a0('0xb'),_0x290c8e,_0xe7a0('0xc'));logger[_0xe7a0('0xd')](_0xe7a0('0xe'),_0x290c8e,_0xe7a0('0xc'),JSON[_0xe7a0('0xf')](_0x3f410c));if(_0x3f410c[_0xe7a0('0x10')]){if(_0x3f410c['error'][_0xe7a0('0x11')]===0x1f4){logger['error'](_0xe7a0('0xb'),_0x290c8e,_0x3f410c[_0xe7a0('0x10')][_0xe7a0('0x12')]);return _0x228cf8(_0x3f410c[_0xe7a0('0x10')]['message']);}logger[_0xe7a0('0x10')](_0xe7a0('0xb'),_0x290c8e,_0x3f410c[_0xe7a0('0x10')][_0xe7a0('0x12')]);return _0xf30d1(_0x3f410c[_0xe7a0('0x10')][_0xe7a0('0x12')]);}else{logger[_0xe7a0('0x13')](_0xe7a0('0xb'),_0x290c8e,_0xe7a0('0xc'));_0xf30d1(_0x3f410c[_0xe7a0('0x14')]['message']);}})[_0xe7a0('0x15')](function(_0x2a47d4){logger['error'](_0xe7a0('0xb'),_0x290c8e,_0x2a47d4);_0x228cf8(_0x2a47d4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index fd0a4e3..7533990 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 _0xee58=['get','isAuthenticated','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xee58,0xb2));var _0x8ee5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xee58[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x8ee5('0x0'));var util=require(_0x8ee5('0x1'));var path=require(_0x8ee5('0x2'));var timeout=require(_0x8ee5('0x3'));var express=require('express');var router=express[_0x8ee5('0x4')]();var fs_extra=require(_0x8ee5('0x5'));var auth=require(_0x8ee5('0x6'));var interaction=require(_0x8ee5('0x7'));var config=require('../../config/environment');var controller=require(_0x8ee5('0x8'));router[_0x8ee5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8ee5('0x9')]('/:id',auth[_0x8ee5('0xa')](),controller['show']);router[_0x8ee5('0xb')]('/',auth[_0x8ee5('0xa')](),controller[_0x8ee5('0xc')]);router['put'](_0x8ee5('0xd'),auth[_0x8ee5('0xa')](),controller['update']);router[_0x8ee5('0xe')](_0x8ee5('0xd'),auth[_0x8ee5('0xa')](),controller[_0x8ee5('0xf')]);module[_0x8ee5('0x10')]=router; \ No newline at end of file +var _0xb7d2=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x437fc7,_0x4f7445){var _0x4cf319=function(_0x40a364){while(--_0x40a364){_0x437fc7['push'](_0x437fc7['shift']());}};_0x4cf319(++_0x4f7445);}(_0xb7d2,0x8e));var _0x2b7d=function(_0x363d7a,_0x2fe30e){_0x363d7a=_0x363d7a-0x0;var _0x22541d=_0xb7d2[_0x363d7a];return _0x22541d;};'use strict';var multer=require(_0x2b7d('0x0'));var util=require(_0x2b7d('0x1'));var path=require(_0x2b7d('0x2'));var timeout=require(_0x2b7d('0x3'));var express=require(_0x2b7d('0x4'));var router=express[_0x2b7d('0x5')]();var fs_extra=require(_0x2b7d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2b7d('0x7'));var config=require(_0x2b7d('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x2b7d('0x9')]('/',auth[_0x2b7d('0xa')](),controller[_0x2b7d('0xb')]);router[_0x2b7d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2b7d('0xc')]);router[_0x2b7d('0xd')]('/',auth[_0x2b7d('0xa')](),controller[_0x2b7d('0xe')]);router[_0x2b7d('0xf')](_0x2b7d('0x10'),auth['isAuthenticated'](),controller[_0x2b7d('0x11')]);router[_0x2b7d('0x12')](_0x2b7d('0x10'),auth[_0x2b7d('0xa')](),controller[_0x2b7d('0x13')]);module[_0x2b7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 81376ed..c426c55 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 _0x0d1e=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','string'];(function(_0xfdac2b,_0xd3fa96){var _0x4d3c33=function(_0xa4eb0f){while(--_0xa4eb0f){_0xfdac2b['push'](_0xfdac2b['shift']());}};_0x4d3c33(++_0xd3fa96);}(_0x0d1e,0xc5));var _0xe0d1=function(_0x14d54b,_0x1986ab){_0x14d54b=_0x14d54b-0x0;var _0x3e1f23=_0x0d1e[_0x14d54b];return _0x3e1f23;};'use strict';var Sequelize=require(_0xe0d1('0x0'));module[_0xe0d1('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe0d1('0x2'),_0xe0d1('0x3'),_0xe0d1('0x4'),'keyValue',_0xe0d1('0x5')),'defaultValue':_0xe0d1('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0d1('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe0d1('0x2'),_0xe0d1('0x3'),_0xe0d1('0x4'))},'keyContent':{'type':Sequelize[_0xe0d1('0x6')]},'idField':{'type':Sequelize[_0xe0d1('0x6')]},'nameField':{'type':Sequelize[_0xe0d1('0x6')]},'customField':{'type':Sequelize[_0xe0d1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0d1('0x6')]}}; \ No newline at end of file +var _0x22ce=['ENUM','BOOLEAN','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22ce,0x9a));var _0xe22c=function(_0xaf23cc,_0x18755c){_0xaf23cc=_0xaf23cc-0x0;var _0x1bc685=_0x22ce[_0xaf23cc];return _0x1bc685;};'use strict';var Sequelize=require('sequelize');module[_0xe22c('0x0')]={'type':{'type':Sequelize['ENUM'](_0xe22c('0x1'),_0xe22c('0x2'),_0xe22c('0x3'),_0xe22c('0x4'),'picklist'),'defaultValue':_0xe22c('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe22c('0x5')]},'keyType':{'type':Sequelize[_0xe22c('0x6')](_0xe22c('0x1'),_0xe22c('0x2'),_0xe22c('0x3'))},'keyContent':{'type':Sequelize[_0xe22c('0x5')]},'idField':{'type':Sequelize[_0xe22c('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe22c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe22c('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 4ce2b22..9b27a17 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 _0xd7e7=['pick','merge','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','end','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1dad70,_0x156649){var _0x14771d=function(_0x4186d5){while(--_0x4186d5){_0x1dad70['push'](_0x1dad70['shift']());}};_0x14771d(++_0x156649);}(_0xd7e7,0xed));var _0x7d7e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd7e7[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x7d7e('0x0'));var rimraf=require(_0x7d7e('0x1'));var zipdir=require(_0x7d7e('0x2'));var jsonpatch=require(_0x7d7e('0x3'));var rp=require(_0x7d7e('0x4'));var moment=require(_0x7d7e('0x5'));var BPromise=require(_0x7d7e('0x6'));var Mustache=require('mustache');var util=require(_0x7d7e('0x7'));var path=require('path');var sox=require(_0x7d7e('0x8'));var csv=require(_0x7d7e('0x9'));var ejs=require(_0x7d7e('0xa'));var fs=require('fs');var fs_extra=require(_0x7d7e('0xb'));var _=require('lodash');var squel=require(_0x7d7e('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d7e('0xd'));var deskjs=require(_0x7d7e('0xe'));var toCsv=require(_0x7d7e('0x9'));var querystring=require(_0x7d7e('0xf'));var Papa=require(_0x7d7e('0x10'));var Redis=require(_0x7d7e('0x11'));var authService=require(_0x7d7e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7d7e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d7e('0x14'))(_0x7d7e('0x15'));var utils=require(_0x7d7e('0x16'));var config=require(_0x7d7e('0x17'));var licenseUtil=require(_0x7d7e('0x18'));var db=require(_0x7d7e('0x19'))['db'];function respondWithStatusCode(_0x1f91eb,_0x27874b){_0x27874b=_0x27874b||0xcc;return function(_0x84d33d){if(_0x84d33d){return _0x1f91eb[_0x7d7e('0x1a')](_0x27874b);}return _0x1f91eb[_0x7d7e('0x1b')](_0x27874b)['end']();};}function respondWithResult(_0x338ced,_0x38ec44){_0x38ec44=_0x38ec44||0xc8;return function(_0x33d41d){if(_0x33d41d){return _0x338ced['status'](_0x38ec44)['json'](_0x33d41d);}};}function respondWithFilteredResult(_0xa01e66,_0x21d7d1){return function(_0x3f2b3a){if(_0x3f2b3a){var _0x1e47ac=typeof _0x21d7d1[_0x7d7e('0x1c')]===_0x7d7e('0x1d')&&typeof _0x21d7d1[_0x7d7e('0x1e')]===_0x7d7e('0x1d');var _0x142bb8=_0x3f2b3a[_0x7d7e('0x1f')];var _0x253a70=_0x1e47ac?0x0:_0x21d7d1['offset'];var _0x1baaa5=_0x1e47ac?_0x3f2b3a[_0x7d7e('0x1f')]:_0x21d7d1['offset']+_0x21d7d1[_0x7d7e('0x1e')];var _0x21e988;if(_0x1baaa5>=_0x142bb8){_0x1baaa5=_0x142bb8;_0x21e988=0xc8;}else{_0x21e988=0xce;}_0xa01e66[_0x7d7e('0x1b')](_0x21e988);return _0xa01e66[_0x7d7e('0x20')](_0x7d7e('0x21'),_0x253a70+'-'+_0x1baaa5+'/'+_0x142bb8)[_0x7d7e('0x22')](_0x3f2b3a);}return null;};}function patchUpdates(_0x34c57){return function(_0x43f13d){try{jsonpatch['apply'](_0x43f13d,_0x34c57,!![]);}catch(_0x1ef303){return BPromise[_0x7d7e('0x23')](_0x1ef303);}return _0x43f13d['save']();};}function saveUpdates(_0x217c80,_0x481a40){return function(_0x4d2749){if(_0x4d2749){return _0x4d2749[_0x7d7e('0x24')](_0x217c80)[_0x7d7e('0x25')](function(_0x16adaa){return _0x16adaa;});}return null;};}function removeEntity(_0x581630,_0x3cdc3e){return function(_0x3aa6db){if(_0x3aa6db){return _0x3aa6db[_0x7d7e('0x26')]()['then'](function(){_0x581630[_0x7d7e('0x1b')](0xcc)[_0x7d7e('0x27')]();});}};}function handleEntityNotFound(_0x669f8f,_0x22c9fa){return function(_0x5b83c7){if(!_0x5b83c7){_0x669f8f['sendStatus'](0x194);}return _0x5b83c7;};}function handleError(_0x4fef0f,_0xe58854){_0xe58854=_0xe58854||0x1f4;return function(_0x258798){logger[_0x7d7e('0x28')](_0x258798['stack']);if(_0x258798[_0x7d7e('0x29')]){delete _0x258798[_0x7d7e('0x29')];}_0x4fef0f['status'](_0xe58854)['send'](_0x258798);};}exports['index']=function(_0x43af22,_0x3c4e74){var _0x24c88d={},_0x581143={},_0x37e0a3={'count':0x0,'rows':[]};var _0x61dfc5=_[_0x7d7e('0x2a')](db['Dynamics365Field'][_0x7d7e('0x2b')],function(_0x202c14){return{'name':_0x202c14[_0x7d7e('0x2c')],'type':_0x202c14[_0x7d7e('0x2d')][_0x7d7e('0x2e')]};});_0x581143[_0x7d7e('0x2f')]=_[_0x7d7e('0x2a')](_0x61dfc5,_0x7d7e('0x29'));_0x581143[_0x7d7e('0x30')]=_[_0x7d7e('0x31')](_0x43af22['query']);_0x581143[_0x7d7e('0x32')]=_['intersection'](_0x581143[_0x7d7e('0x2f')],_0x581143[_0x7d7e('0x30')]);_0x24c88d[_0x7d7e('0x33')]=_['intersection'](_0x581143['model'],qs['fields'](_0x43af22[_0x7d7e('0x30')][_0x7d7e('0x34')]));_0x24c88d[_0x7d7e('0x33')]=_0x24c88d[_0x7d7e('0x33')][_0x7d7e('0x35')]?_0x24c88d[_0x7d7e('0x33')]:_0x581143[_0x7d7e('0x2f')];if(!_0x43af22[_0x7d7e('0x30')][_0x7d7e('0x36')](_0x7d7e('0x37'))){_0x24c88d['limit']=qs[_0x7d7e('0x1e')](_0x43af22[_0x7d7e('0x30')][_0x7d7e('0x1e')]);_0x24c88d[_0x7d7e('0x1c')]=qs['offset'](_0x43af22['query'][_0x7d7e('0x1c')]);}_0x24c88d[_0x7d7e('0x38')]=qs['sort'](_0x43af22['query'][_0x7d7e('0x39')]);_0x24c88d[_0x7d7e('0x3a')]=qs[_0x7d7e('0x32')](_[_0x7d7e('0x3b')](_0x43af22[_0x7d7e('0x30')],_0x581143[_0x7d7e('0x32')]),_0x61dfc5);if(_0x43af22[_0x7d7e('0x30')]['filter']){_0x24c88d['where']=_['merge'](_0x24c88d[_0x7d7e('0x3a')],{'$or':_[_0x7d7e('0x2a')](_0x61dfc5,function(_0x47a5f8){if(_0x47a5f8[_0x7d7e('0x2d')]!=='VIRTUAL'){var _0x2007b8={};_0x2007b8[_0x47a5f8[_0x7d7e('0x29')]]={'$like':'%'+_0x43af22['query']['filter']+'%'};return _0x2007b8;}})});}_0x24c88d=_[_0x7d7e('0x3c')]({},_0x24c88d,_0x43af22[_0x7d7e('0x3d')]);var _0x3d7b08={'where':_0x24c88d[_0x7d7e('0x3a')]};return db[_0x7d7e('0x3e')]['count'](_0x3d7b08)[_0x7d7e('0x25')](function(_0x1d54a9){_0x37e0a3[_0x7d7e('0x1f')]=_0x1d54a9;if(_0x43af22[_0x7d7e('0x30')][_0x7d7e('0x3f')]){_0x24c88d[_0x7d7e('0x40')]=[{'all':!![]}];}return db[_0x7d7e('0x3e')][_0x7d7e('0x41')](_0x24c88d);})[_0x7d7e('0x25')](function(_0x2f2161){_0x37e0a3[_0x7d7e('0x42')]=_0x2f2161;return _0x37e0a3;})[_0x7d7e('0x25')](respondWithFilteredResult(_0x3c4e74,_0x24c88d))[_0x7d7e('0x43')](handleError(_0x3c4e74,null));};exports[_0x7d7e('0x44')]=function(_0x48129b,_0x31df23){var _0x56b5e2={'raw':!![],'where':{'id':_0x48129b[_0x7d7e('0x45')]['id']}},_0x20735f={};_0x20735f[_0x7d7e('0x2f')]=_['keys'](db[_0x7d7e('0x3e')][_0x7d7e('0x2b')]);_0x20735f[_0x7d7e('0x30')]=_[_0x7d7e('0x31')](_0x48129b[_0x7d7e('0x30')]);_0x20735f[_0x7d7e('0x32')]=_[_0x7d7e('0x46')](_0x20735f[_0x7d7e('0x2f')],_0x20735f[_0x7d7e('0x30')]);_0x56b5e2[_0x7d7e('0x33')]=_['intersection'](_0x20735f[_0x7d7e('0x2f')],qs[_0x7d7e('0x34')](_0x48129b[_0x7d7e('0x30')][_0x7d7e('0x34')]));_0x56b5e2[_0x7d7e('0x33')]=_0x56b5e2[_0x7d7e('0x33')][_0x7d7e('0x35')]?_0x56b5e2[_0x7d7e('0x33')]:_0x20735f[_0x7d7e('0x2f')];if(_0x48129b[_0x7d7e('0x30')]['includeAll']){_0x56b5e2[_0x7d7e('0x40')]=[{'all':!![]}];}_0x56b5e2=_[_0x7d7e('0x3c')]({},_0x56b5e2,_0x48129b['options']);return db[_0x7d7e('0x3e')][_0x7d7e('0x47')](_0x56b5e2)[_0x7d7e('0x25')](handleEntityNotFound(_0x31df23,null))[_0x7d7e('0x25')](respondWithResult(_0x31df23,null))[_0x7d7e('0x43')](handleError(_0x31df23,null));};exports['create']=function(_0x3f4511,_0x44a720){return db['Dynamics365Field'][_0x7d7e('0x48')](_0x3f4511['body'],{})[_0x7d7e('0x25')](respondWithResult(_0x44a720,0xc9))[_0x7d7e('0x43')](handleError(_0x44a720,null));};exports[_0x7d7e('0x24')]=function(_0x49fff1,_0x20827a){if(_0x49fff1[_0x7d7e('0x49')]['id']){delete _0x49fff1[_0x7d7e('0x49')]['id'];}return db[_0x7d7e('0x3e')][_0x7d7e('0x47')]({'where':{'id':_0x49fff1[_0x7d7e('0x45')]['id']}})[_0x7d7e('0x25')](handleEntityNotFound(_0x20827a,null))['then'](saveUpdates(_0x49fff1['body'],null))[_0x7d7e('0x25')](respondWithResult(_0x20827a,null))[_0x7d7e('0x43')](handleError(_0x20827a,null));};exports[_0x7d7e('0x26')]=function(_0x127778,_0x1d80fb){return db['Dynamics365Field'][_0x7d7e('0x47')]({'where':{'id':_0x127778[_0x7d7e('0x45')]['id']}})[_0x7d7e('0x25')](handleEntityNotFound(_0x1d80fb,null))[_0x7d7e('0x25')](removeEntity(_0x1d80fb,null))['catch'](handleError(_0x1d80fb,null));}; \ No newline at end of file +var _0x1f69=['nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f69,0xa2));var _0x91f6=function(_0x301e8a,_0x765cfc){_0x301e8a=_0x301e8a-0x0;var _0x58d5a1=_0x1f69[_0x301e8a];return _0x58d5a1;};'use strict';var emlformat=require(_0x91f6('0x0'));var rimraf=require(_0x91f6('0x1'));var zipdir=require(_0x91f6('0x2'));var jsonpatch=require(_0x91f6('0x3'));var rp=require(_0x91f6('0x4'));var moment=require(_0x91f6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91f6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x91f6('0x7'));var csv=require(_0x91f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91f6('0x9'));var squel=require('squel');var crypto=require(_0x91f6('0xa'));var jsforce=require(_0x91f6('0xb'));var deskjs=require(_0x91f6('0xc'));var toCsv=require(_0x91f6('0x8'));var querystring=require(_0x91f6('0xd'));var Papa=require(_0x91f6('0xe'));var Redis=require(_0x91f6('0xf'));var authService=require(_0x91f6('0x10'));var qs=require(_0x91f6('0x11'));var as=require(_0x91f6('0x12'));var hardwareService=require(_0x91f6('0x13'));var logger=require(_0x91f6('0x14'))('api');var utils=require(_0x91f6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7217a9,_0x1547b6){_0x1547b6=_0x1547b6||0xcc;return function(_0x469fde){if(_0x469fde){return _0x7217a9[_0x91f6('0x16')](_0x1547b6);}return _0x7217a9['status'](_0x1547b6)['end']();};}function respondWithResult(_0x44eaa6,_0x2a113e){_0x2a113e=_0x2a113e||0xc8;return function(_0x287749){if(_0x287749){return _0x44eaa6[_0x91f6('0x17')](_0x2a113e)[_0x91f6('0x18')](_0x287749);}};}function respondWithFilteredResult(_0x4601b8,_0x27f085){return function(_0x2b02bb){if(_0x2b02bb){var _0x51f0fb=typeof _0x27f085['offset']===_0x91f6('0x19')&&typeof _0x27f085['limit']===_0x91f6('0x19');var _0x5ebcb1=_0x2b02bb[_0x91f6('0x1a')];var _0x54f0fa=_0x51f0fb?0x0:_0x27f085['offset'];var _0x4e7a39=_0x51f0fb?_0x2b02bb[_0x91f6('0x1a')]:_0x27f085[_0x91f6('0x1b')]+_0x27f085[_0x91f6('0x1c')];var _0x2860d7;if(_0x4e7a39>=_0x5ebcb1){_0x4e7a39=_0x5ebcb1;_0x2860d7=0xc8;}else{_0x2860d7=0xce;}_0x4601b8[_0x91f6('0x17')](_0x2860d7);return _0x4601b8['set'](_0x91f6('0x1d'),_0x54f0fa+'-'+_0x4e7a39+'/'+_0x5ebcb1)[_0x91f6('0x18')](_0x2b02bb);}return null;};}function patchUpdates(_0x4dbba8){return function(_0x3e9a5b){try{jsonpatch[_0x91f6('0x1e')](_0x3e9a5b,_0x4dbba8,!![]);}catch(_0x4283b1){return BPromise[_0x91f6('0x1f')](_0x4283b1);}return _0x3e9a5b[_0x91f6('0x20')]();};}function saveUpdates(_0x10d712,_0x1736f6){return function(_0x22931e){if(_0x22931e){return _0x22931e[_0x91f6('0x21')](_0x10d712)[_0x91f6('0x22')](function(_0x425cfc){return _0x425cfc;});}return null;};}function removeEntity(_0x2f7659,_0x49524f){return function(_0x2dcc0d){if(_0x2dcc0d){return _0x2dcc0d[_0x91f6('0x23')]()[_0x91f6('0x22')](function(){_0x2f7659[_0x91f6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d593,_0x24e217){return function(_0x341919){if(!_0x341919){_0x16d593[_0x91f6('0x16')](0x194);}return _0x341919;};}function handleError(_0x223024,_0x56d063){_0x56d063=_0x56d063||0x1f4;return function(_0x2873f5){logger[_0x91f6('0x24')](_0x2873f5[_0x91f6('0x25')]);if(_0x2873f5[_0x91f6('0x26')]){delete _0x2873f5[_0x91f6('0x26')];}_0x223024[_0x91f6('0x17')](_0x56d063)[_0x91f6('0x27')](_0x2873f5);};}exports['index']=function(_0x35a945,_0x5d5622){var _0x5495d8={},_0x5c6c6a={},_0x3e50de={'count':0x0,'rows':[]};var _0x3c1ab1=_[_0x91f6('0x28')](db[_0x91f6('0x29')][_0x91f6('0x2a')],function(_0x4fb76f){return{'name':_0x4fb76f[_0x91f6('0x2b')],'type':_0x4fb76f[_0x91f6('0x2c')][_0x91f6('0x2d')]};});_0x5c6c6a['model']=_[_0x91f6('0x28')](_0x3c1ab1,_0x91f6('0x26'));_0x5c6c6a[_0x91f6('0x2e')]=_[_0x91f6('0x2f')](_0x35a945[_0x91f6('0x2e')]);_0x5c6c6a[_0x91f6('0x30')]=_[_0x91f6('0x31')](_0x5c6c6a[_0x91f6('0x32')],_0x5c6c6a[_0x91f6('0x2e')]);_0x5495d8[_0x91f6('0x33')]=_[_0x91f6('0x31')](_0x5c6c6a[_0x91f6('0x32')],qs[_0x91f6('0x34')](_0x35a945['query'][_0x91f6('0x34')]));_0x5495d8[_0x91f6('0x33')]=_0x5495d8[_0x91f6('0x33')]['length']?_0x5495d8[_0x91f6('0x33')]:_0x5c6c6a[_0x91f6('0x32')];if(!_0x35a945[_0x91f6('0x2e')][_0x91f6('0x35')](_0x91f6('0x36'))){_0x5495d8[_0x91f6('0x1c')]=qs[_0x91f6('0x1c')](_0x35a945['query'][_0x91f6('0x1c')]);_0x5495d8[_0x91f6('0x1b')]=qs['offset'](_0x35a945['query'][_0x91f6('0x1b')]);}_0x5495d8[_0x91f6('0x37')]=qs[_0x91f6('0x38')](_0x35a945[_0x91f6('0x2e')][_0x91f6('0x38')]);_0x5495d8['where']=qs[_0x91f6('0x30')](_[_0x91f6('0x39')](_0x35a945[_0x91f6('0x2e')],_0x5c6c6a['filters']),_0x3c1ab1);if(_0x35a945[_0x91f6('0x2e')][_0x91f6('0x3a')]){_0x5495d8[_0x91f6('0x3b')]=_['merge'](_0x5495d8[_0x91f6('0x3b')],{'$or':_[_0x91f6('0x28')](_0x3c1ab1,function(_0x5b32f4){if(_0x5b32f4[_0x91f6('0x2c')]!=='VIRTUAL'){var _0x528445={};_0x528445[_0x5b32f4[_0x91f6('0x26')]]={'$like':'%'+_0x35a945[_0x91f6('0x2e')][_0x91f6('0x3a')]+'%'};return _0x528445;}})});}_0x5495d8=_[_0x91f6('0x3c')]({},_0x5495d8,_0x35a945['options']);var _0x4bf72f={'where':_0x5495d8[_0x91f6('0x3b')]};return db[_0x91f6('0x29')][_0x91f6('0x1a')](_0x4bf72f)[_0x91f6('0x22')](function(_0x4ae157){_0x3e50de[_0x91f6('0x1a')]=_0x4ae157;if(_0x35a945[_0x91f6('0x2e')][_0x91f6('0x3d')]){_0x5495d8[_0x91f6('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x5495d8);})['then'](function(_0xbb4651){_0x3e50de[_0x91f6('0x3f')]=_0xbb4651;return _0x3e50de;})[_0x91f6('0x22')](respondWithFilteredResult(_0x5d5622,_0x5495d8))[_0x91f6('0x40')](handleError(_0x5d5622,null));};exports[_0x91f6('0x41')]=function(_0x22f98a,_0x9041e6){var _0x28233a={'raw':!![],'where':{'id':_0x22f98a[_0x91f6('0x42')]['id']}},_0xd2842e={};_0xd2842e[_0x91f6('0x32')]=_[_0x91f6('0x2f')](db[_0x91f6('0x29')][_0x91f6('0x2a')]);_0xd2842e['query']=_[_0x91f6('0x2f')](_0x22f98a[_0x91f6('0x2e')]);_0xd2842e[_0x91f6('0x30')]=_['intersection'](_0xd2842e['model'],_0xd2842e['query']);_0x28233a[_0x91f6('0x33')]=_[_0x91f6('0x31')](_0xd2842e['model'],qs[_0x91f6('0x34')](_0x22f98a['query'][_0x91f6('0x34')]));_0x28233a[_0x91f6('0x33')]=_0x28233a[_0x91f6('0x33')][_0x91f6('0x43')]?_0x28233a['attributes']:_0xd2842e[_0x91f6('0x32')];if(_0x22f98a['query'][_0x91f6('0x3d')]){_0x28233a[_0x91f6('0x3e')]=[{'all':!![]}];}_0x28233a=_['merge']({},_0x28233a,_0x22f98a[_0x91f6('0x44')]);return db[_0x91f6('0x29')][_0x91f6('0x45')](_0x28233a)[_0x91f6('0x22')](handleEntityNotFound(_0x9041e6,null))[_0x91f6('0x22')](respondWithResult(_0x9041e6,null))[_0x91f6('0x40')](handleError(_0x9041e6,null));};exports[_0x91f6('0x46')]=function(_0x2aba98,_0x1586f8){return db['Dynamics365Field']['create'](_0x2aba98[_0x91f6('0x47')],{})['then'](respondWithResult(_0x1586f8,0xc9))[_0x91f6('0x40')](handleError(_0x1586f8,null));};exports['update']=function(_0x118a8b,_0x493c07){if(_0x118a8b['body']['id']){delete _0x118a8b[_0x91f6('0x47')]['id'];}return db[_0x91f6('0x29')][_0x91f6('0x45')]({'where':{'id':_0x118a8b[_0x91f6('0x42')]['id']}})[_0x91f6('0x22')](handleEntityNotFound(_0x493c07,null))[_0x91f6('0x22')](saveUpdates(_0x118a8b[_0x91f6('0x47')],null))[_0x91f6('0x22')](respondWithResult(_0x493c07,null))[_0x91f6('0x40')](handleError(_0x493c07,null));};exports[_0x91f6('0x23')]=function(_0xafeac2,_0x3767b1){return db[_0x91f6('0x29')][_0x91f6('0x45')]({'where':{'id':_0xafeac2[_0x91f6('0x42')]['id']}})[_0x91f6('0x22')](handleEntityNotFound(_0x3767b1,null))[_0x91f6('0x22')](removeEntity(_0x3767b1,null))[_0x91f6('0x40')](handleError(_0x3767b1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 40c1287..b60d3ac 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 _0x8a5d=['idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x157f26,_0x3e8476){var _0x5e5c84=function(_0x10770e){while(--_0x10770e){_0x157f26['push'](_0x157f26['shift']());}};_0x5e5c84(++_0x3e8476);}(_0x8a5d,0xe2));var _0xd8a5=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x8a5d[_0x29db36];return _0x234e87;};'use strict';var _=require(_0xd8a5('0x0'));var util=require('util');var logger=require(_0xd8a5('0x1'))(_0xd8a5('0x2'));var moment=require(_0xd8a5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd8a5('0x4'));var fs=require('fs');var path=require(_0xd8a5('0x5'));var rimraf=require(_0xd8a5('0x6'));var config=require(_0xd8a5('0x7'));var attributes=require(_0xd8a5('0x8'));module['exports']=function(_0x5c93fe,_0x3ce31c){return _0x5c93fe[_0xd8a5('0x9')]('Dynamics365Field',attributes,{'tableName':_0xd8a5('0xa'),'paranoid':![],'indexes':[{'name':_0xd8a5('0xb'),'fields':[_0xd8a5('0xc'),_0xd8a5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x966e=['bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','../../config/logger','moment'];(function(_0x4249a4,_0x1159df){var _0x119549=function(_0x32f5fc){while(--_0x32f5fc){_0x4249a4['push'](_0x4249a4['shift']());}};_0x119549(++_0x1159df);}(_0x966e,0x69));var _0xe966=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0x966e[_0x331298];return _0x3824bc;};'use strict';var _=require(_0xe966('0x0'));var util=require('util');var logger=require(_0xe966('0x1'))('api');var moment=require(_0xe966('0x2'));var BPromise=require(_0xe966('0x3'));var rp=require(_0xe966('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe966('0x5'));var config=require(_0xe966('0x6'));var attributes=require(_0xe966('0x7'));module['exports']=function(_0x534798,_0x1612a4){return _0x534798['define'](_0xe966('0x8'),attributes,{'tableName':_0xe966('0x9'),'paranoid':![],'indexes':[{'name':_0xe966('0xa'),'fields':[_0xe966('0xb'),'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 0486a54..cbb0072 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 _0x5c69=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0x5c69,0x126));var _0x95c6=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x5c69[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0x95c6('0x0'));var moment=require(_0x95c6('0x1'));var BPromise=require(_0x95c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95c6('0x3'))['db'];var utils=require(_0x95c6('0x4'));var logger=require('../../config/logger')(_0x95c6('0x5'));var config=require('../../config/environment');var jayson=require(_0x95c6('0x6'));var client=jayson[_0x95c6('0x7')][_0x95c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4223a4,_0x300cde,_0x5c65be){return new BPromise(function(_0x1a89ed,_0x51f8bb){return client[_0x95c6('0x9')](_0x4223a4,_0x5c65be)[_0x95c6('0xa')](function(_0x2c0c05){logger[_0x95c6('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x300cde,_0x95c6('0xc'));logger[_0x95c6('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x300cde,_0x95c6('0xc'),JSON[_0x95c6('0xe')](_0x2c0c05));if(_0x2c0c05[_0x95c6('0xf')]){if(_0x2c0c05[_0x95c6('0xf')][_0x95c6('0x10')]===0x1f4){logger[_0x95c6('0xf')](_0x95c6('0x11'),_0x300cde,_0x2c0c05['error'][_0x95c6('0x12')]);return _0x51f8bb(_0x2c0c05[_0x95c6('0xf')]['message']);}logger[_0x95c6('0xf')](_0x95c6('0x11'),_0x300cde,_0x2c0c05['error'][_0x95c6('0x12')]);return _0x1a89ed(_0x2c0c05[_0x95c6('0xf')][_0x95c6('0x12')]);}else{logger['info'](_0x95c6('0x11'),_0x300cde,_0x95c6('0xc'));_0x1a89ed(_0x2c0c05[_0x95c6('0x13')][_0x95c6('0x12')]);}})['catch'](function(_0x25b77b){logger[_0x95c6('0xf')](_0x95c6('0x11'),_0x300cde,_0x25b77b);_0x51f8bb(_0x25b77b);});});} \ No newline at end of file +var _0x5468=['info','request\x20sent','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message'];(function(_0x2bebb2,_0x321313){var _0x277503=function(_0x15c37e){while(--_0x15c37e){_0x2bebb2['push'](_0x2bebb2['shift']());}};_0x277503(++_0x321313);}(_0x5468,0x1a5));var _0x8546=function(_0x22e513,_0x1160ce){_0x22e513=_0x22e513-0x0;var _0x585e20=_0x5468[_0x22e513];return _0x585e20;};'use strict';var _=require(_0x8546('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8546('0x1'));var rs=require(_0x8546('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8546('0x3'))['db'];var utils=require(_0x8546('0x4'));var logger=require(_0x8546('0x5'))(_0x8546('0x6'));var config=require('../../config/environment');var jayson=require(_0x8546('0x7'));var client=jayson[_0x8546('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb2cf60,_0x148bbe,_0x3444f8){return new BPromise(function(_0x30543e,_0x33a6a2){return client[_0x8546('0x9')](_0xb2cf60,_0x3444f8)['then'](function(_0x5b653c){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x148bbe,'request\x20sent');logger[_0x8546('0xa')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x148bbe,'request\x20sent',JSON[_0x8546('0xb')](_0x5b653c));if(_0x5b653c[_0x8546('0xc')]){if(_0x5b653c[_0x8546('0xc')][_0x8546('0xd')]===0x1f4){logger['error'](_0x8546('0xe'),_0x148bbe,_0x5b653c[_0x8546('0xc')][_0x8546('0xf')]);return _0x33a6a2(_0x5b653c[_0x8546('0xc')][_0x8546('0xf')]);}logger[_0x8546('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x148bbe,_0x5b653c[_0x8546('0xc')][_0x8546('0xf')]);return _0x30543e(_0x5b653c[_0x8546('0xc')]['message']);}else{logger[_0x8546('0x10')](_0x8546('0xe'),_0x148bbe,_0x8546('0x11'));_0x30543e(_0x5b653c[_0x8546('0x12')][_0x8546('0xf')]);}})['catch'](function(_0x2a6638){logger[_0x8546('0xc')](_0x8546('0xe'),_0x148bbe,_0x2a6638);_0x33a6a2(_0x2a6638);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1c9f5be..4b07409 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 _0x3b9f=['multer','util','path','connect-timeout','fs-extra','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports'];(function(_0x3adf4e,_0x26d25f){var _0x4dc28b=function(_0x38d031){while(--_0x38d031){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x4dc28b(++_0x26d25f);}(_0x3b9f,0xfc));var _0xf3b9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3b9f[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xf3b9('0x0'));var util=require(_0xf3b9('0x1'));var path=require(_0xf3b9('0x2'));var timeout=require(_0xf3b9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf3b9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf3b9('0x5'));router[_0xf3b9('0x6')]('/',auth[_0xf3b9('0x7')](),controller[_0xf3b9('0x8')]);router[_0xf3b9('0x6')](_0xf3b9('0x9'),auth[_0xf3b9('0x7')](),controller[_0xf3b9('0xa')]);router[_0xf3b9('0x6')](_0xf3b9('0xb'),auth[_0xf3b9('0x7')](),controller['getConfigurations']);router[_0xf3b9('0x6')](_0xf3b9('0xc'),auth[_0xf3b9('0x7')](),controller[_0xf3b9('0xd')]);router[_0xf3b9('0xe')]('/',auth[_0xf3b9('0x7')](),controller[_0xf3b9('0xf')]);router[_0xf3b9('0xe')](_0xf3b9('0xb'),auth[_0xf3b9('0x7')](),controller[_0xf3b9('0x10')]);router['put'](_0xf3b9('0x9'),auth[_0xf3b9('0x7')](),controller[_0xf3b9('0x11')]);router[_0xf3b9('0x12')]('/:id',auth[_0xf3b9('0x7')](),controller[_0xf3b9('0x13')]);module[_0xf3b9('0x14')]=router; \ No newline at end of file +var _0x300f=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id'];(function(_0x321cde,_0xa7c16d){var _0x3d8137=function(_0x39cf11){while(--_0x39cf11){_0x321cde['push'](_0x321cde['shift']());}};_0x3d8137(++_0xa7c16d);}(_0x300f,0x8d));var _0xf300=function(_0x48a60f,_0x2bf525){_0x48a60f=_0x48a60f-0x0;var _0x2b0ced=_0x300f[_0x48a60f];return _0x2b0ced;};'use strict';var multer=require('multer');var util=require(_0xf300('0x0'));var path=require(_0xf300('0x1'));var timeout=require(_0xf300('0x2'));var express=require(_0xf300('0x3'));var router=express[_0xf300('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf300('0x5'));var interaction=require(_0xf300('0x6'));var config=require(_0xf300('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0xf300('0x8')]('/',auth['isAuthenticated'](),controller[_0xf300('0x9')]);router['get']('/:id',auth[_0xf300('0xa')](),controller[_0xf300('0xb')]);router['get'](_0xf300('0xc'),auth[_0xf300('0xa')](),controller[_0xf300('0xd')]);router[_0xf300('0x8')](_0xf300('0xe'),auth['isAuthenticated'](),controller[_0xf300('0xf')]);router[_0xf300('0x10')]('/',auth[_0xf300('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0xf300('0xa')](),controller[_0xf300('0x11')]);router[_0xf300('0x12')](_0xf300('0x13'),auth[_0xf300('0xa')](),controller[_0xf300('0x14')]);router[_0xf300('0x15')](_0xf300('0x13'),auth[_0xf300('0xa')](),controller['destroy']);module[_0xf300('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8e2f965..d88adf7 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 _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x578a80,_0x412698){var _0x4b4ba8=function(_0x4ff947){while(--_0x4ff947){_0x578a80['push'](_0x578a80['shift']());}};_0x4b4ba8(++_0x412698);}(_0x1a37,0xb4));var _0x71a3=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x1a37[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 39a193d..4d428f8 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 _0x8a1b=['ticket_type','company','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','params','rawAttributes','include','create','body','catch','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source'];(function(_0x33e142,_0x1a2281){var _0x59c9bd=function(_0x35e21b){while(--_0x35e21b){_0x33e142['push'](_0x33e142['shift']());}};_0x59c9bd(++_0x1a2281);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x64f01f,_0x836470){_0x64f01f=_0x64f01f-0x0;var _0x69c66a=_0x8a1b[_0x64f01f];return _0x69c66a;};'use strict';var emlformat=require(_0xb8a1('0x0'));var rimraf=require(_0xb8a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a1('0x2'));var rp=require(_0xb8a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8a1('0x4'));var util=require(_0xb8a1('0x5'));var path=require(_0xb8a1('0x6'));var sox=require(_0xb8a1('0x7'));var csv=require(_0xb8a1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8a1('0x9'));var _=require(_0xb8a1('0xa'));var squel=require(_0xb8a1('0xb'));var crypto=require(_0xb8a1('0xc'));var jsforce=require(_0xb8a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb8a1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb8a1('0xe'));var authService=require(_0xb8a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb8a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a1('0x11'))(_0xb8a1('0x12'));var utils=require(_0xb8a1('0x13'));var config=require(_0xb8a1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8a1('0x15'))['db'];var integrations=require(_0xb8a1('0x16'));function respondWithStatusCode(_0x34aa9a,_0x7420ea){_0x7420ea=_0x7420ea||0xcc;return function(_0x4e32a6){if(_0x4e32a6){return _0x34aa9a[_0xb8a1('0x17')](_0x7420ea);}return _0x34aa9a[_0xb8a1('0x18')](_0x7420ea)[_0xb8a1('0x19')]();};}function respondWithResult(_0x2feffe,_0xed7f42){_0xed7f42=_0xed7f42||0xc8;return function(_0x39dd1e){if(_0x39dd1e){return _0x2feffe[_0xb8a1('0x18')](_0xed7f42)[_0xb8a1('0x1a')](_0x39dd1e);}};}function respondWithFilteredResult(_0x4710be,_0x320151){return function(_0x367436){if(_0x367436){var _0x4ae501=typeof _0x320151[_0xb8a1('0x1b')]===_0xb8a1('0x1c')&&typeof _0x320151[_0xb8a1('0x1d')]===_0xb8a1('0x1c');var _0x367599=_0x367436[_0xb8a1('0x1e')];var _0x291ff3=_0x4ae501?0x0:_0x320151[_0xb8a1('0x1b')];var _0x1bc506=_0x4ae501?_0x367436[_0xb8a1('0x1e')]:_0x320151[_0xb8a1('0x1b')]+_0x320151[_0xb8a1('0x1d')];var _0x19a903;if(_0x1bc506>=_0x367599){_0x1bc506=_0x367599;_0x19a903=0xc8;}else{_0x19a903=0xce;}_0x4710be['status'](_0x19a903);return _0x4710be['set'](_0xb8a1('0x1f'),_0x291ff3+'-'+_0x1bc506+'/'+_0x367599)[_0xb8a1('0x1a')](_0x367436);}return null;};}function patchUpdates(_0x58bca0){return function(_0x3a339c){try{jsonpatch[_0xb8a1('0x20')](_0x3a339c,_0x58bca0,!![]);}catch(_0x451f76){return BPromise[_0xb8a1('0x21')](_0x451f76);}return _0x3a339c[_0xb8a1('0x22')]();};}function saveUpdates(_0x3f616f,_0x2618bd){return function(_0x3dd94e){if(_0x3dd94e){return _0x3dd94e[_0xb8a1('0x23')](_0x3f616f)[_0xb8a1('0x24')](function(_0x1a3e62){return _0x1a3e62;});}return null;};}function removeEntity(_0x1829b7,_0x2d9d56){return function(_0x54025f){if(_0x54025f){return _0x54025f[_0xb8a1('0x25')]()[_0xb8a1('0x24')](function(){_0x1829b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2b5b,_0x3e906f){return function(_0x3a6153){if(!_0x3a6153){_0x2b2b5b[_0xb8a1('0x17')](0x194);}return _0x3a6153;};}function handleError(_0x5e0241,_0x4bd5af){_0x4bd5af=_0x4bd5af||0x1f4;return function(_0x341f62){logger[_0xb8a1('0x26')](_0x341f62[_0xb8a1('0x27')]);if(_0x341f62['name']){delete _0x341f62[_0xb8a1('0x28')];}_0x5e0241['status'](_0x4bd5af)[_0xb8a1('0x29')](_0x341f62);};}exports[_0xb8a1('0x2a')]=function(_0x47cd2c,_0x2ed1ef){var _0x490260={},_0x105f9f={},_0x23b822={'count':0x0,'rows':[]};var _0x9c66bb=_[_0xb8a1('0x2b')](db[_0xb8a1('0x2c')]['rawAttributes'],function(_0x2ad164){return{'name':_0x2ad164[_0xb8a1('0x2d')],'type':_0x2ad164['type'][_0xb8a1('0x2e')]};});_0x105f9f['model']=_[_0xb8a1('0x2b')](_0x9c66bb,_0xb8a1('0x28'));_0x105f9f[_0xb8a1('0x2f')]=_[_0xb8a1('0x30')](_0x47cd2c[_0xb8a1('0x2f')]);_0x105f9f[_0xb8a1('0x31')]=_['intersection'](_0x105f9f[_0xb8a1('0x32')],_0x105f9f[_0xb8a1('0x2f')]);_0x490260[_0xb8a1('0x33')]=_[_0xb8a1('0x34')](_0x105f9f[_0xb8a1('0x32')],qs[_0xb8a1('0x35')](_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x35')]));_0x490260['attributes']=_0x490260['attributes'][_0xb8a1('0x36')]?_0x490260['attributes']:_0x105f9f[_0xb8a1('0x32')];if(!_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x37')](_0xb8a1('0x38'))){_0x490260[_0xb8a1('0x1d')]=qs[_0xb8a1('0x1d')](_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x1d')]);_0x490260[_0xb8a1('0x1b')]=qs[_0xb8a1('0x1b')](_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x1b')]);}_0x490260[_0xb8a1('0x39')]=qs[_0xb8a1('0x3a')](_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x3a')]);_0x490260[_0xb8a1('0x3b')]=qs['filters'](_[_0xb8a1('0x3c')](_0x47cd2c[_0xb8a1('0x2f')],_0x105f9f[_0xb8a1('0x31')]),_0x9c66bb);if(_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x3d')]){_0x490260[_0xb8a1('0x3b')]=_['merge'](_0x490260[_0xb8a1('0x3b')],{'$or':_[_0xb8a1('0x2b')](_0x9c66bb,function(_0xb8cf0b){if(_0xb8cf0b[_0xb8a1('0x3e')]!==_0xb8a1('0x3f')){var _0x40bb59={};_0x40bb59[_0xb8cf0b[_0xb8a1('0x28')]]={'$like':'%'+_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x3d')]+'%'};return _0x40bb59;}})});}_0x490260=_[_0xb8a1('0x40')]({},_0x490260,_0x47cd2c[_0xb8a1('0x41')]);var _0x46ba12={'where':_0x490260[_0xb8a1('0x3b')]};return db[_0xb8a1('0x2c')][_0xb8a1('0x1e')](_0x46ba12)['then'](function(_0x13f237){_0x23b822[_0xb8a1('0x1e')]=_0x13f237;if(_0x47cd2c[_0xb8a1('0x2f')][_0xb8a1('0x42')]){_0x490260['include']=[{'all':!![]}];}return db[_0xb8a1('0x2c')][_0xb8a1('0x43')](_0x490260);})[_0xb8a1('0x24')](function(_0xaf9ffc){_0x23b822[_0xb8a1('0x44')]=_0xaf9ffc;return _0x23b822;})['then'](respondWithFilteredResult(_0x2ed1ef,_0x490260))['catch'](handleError(_0x2ed1ef,null));};exports['show']=function(_0x1624be,_0xaa348b){var _0x26870b={'raw':![],'where':{'id':_0x1624be[_0xb8a1('0x45')]['id']}},_0x5c5465={};_0x5c5465[_0xb8a1('0x32')]=_[_0xb8a1('0x30')](db[_0xb8a1('0x2c')][_0xb8a1('0x46')]);_0x5c5465[_0xb8a1('0x2f')]=_[_0xb8a1('0x30')](_0x1624be[_0xb8a1('0x2f')]);_0x5c5465['filters']=_[_0xb8a1('0x34')](_0x5c5465['model'],_0x5c5465[_0xb8a1('0x2f')]);_0x26870b[_0xb8a1('0x33')]=_['intersection'](_0x5c5465[_0xb8a1('0x32')],qs[_0xb8a1('0x35')](_0x1624be[_0xb8a1('0x2f')][_0xb8a1('0x35')]));_0x26870b[_0xb8a1('0x33')]=_0x26870b[_0xb8a1('0x33')][_0xb8a1('0x36')]?_0x26870b[_0xb8a1('0x33')]:_0x5c5465[_0xb8a1('0x32')];if(_0x1624be[_0xb8a1('0x2f')][_0xb8a1('0x42')]){_0x26870b[_0xb8a1('0x47')]=[{'all':!![]}];}_0x26870b=_[_0xb8a1('0x40')]({},_0x26870b,_0x1624be[_0xb8a1('0x41')]);return db['FreshdeskAccount']['find'](_0x26870b)[_0xb8a1('0x24')](handleEntityNotFound(_0xaa348b,null))[_0xb8a1('0x24')](respondWithResult(_0xaa348b,null))['catch'](handleError(_0xaa348b,null));};exports[_0xb8a1('0x48')]=function(_0x730cbf,_0x435dc0){return db['FreshdeskAccount']['create'](_0x730cbf[_0xb8a1('0x49')],{})[_0xb8a1('0x24')](respondWithResult(_0x435dc0,0xc9))[_0xb8a1('0x4a')](handleError(_0x435dc0,null));};exports[_0xb8a1('0x23')]=function(_0xdcd04b,_0x4b286d){if(_0xdcd04b[_0xb8a1('0x49')]['id']){delete _0xdcd04b[_0xb8a1('0x49')]['id'];}return db[_0xb8a1('0x2c')][_0xb8a1('0x4b')]({'where':{'id':_0xdcd04b[_0xb8a1('0x45')]['id']}})[_0xb8a1('0x24')](handleEntityNotFound(_0x4b286d,null))['then'](saveUpdates(_0xdcd04b['body'],null))['then'](respondWithResult(_0x4b286d,null))['catch'](handleError(_0x4b286d,null));};exports[_0xb8a1('0x25')]=function(_0xc0fc7,_0x20fff9){return db[_0xb8a1('0x2c')][_0xb8a1('0x4b')]({'where':{'id':_0xc0fc7[_0xb8a1('0x45')]['id']}})[_0xb8a1('0x24')](handleEntityNotFound(_0x20fff9,null))[_0xb8a1('0x24')](removeEntity(_0x20fff9,null))[_0xb8a1('0x4a')](handleError(_0x20fff9,null));};exports[_0xb8a1('0x4c')]=function(_0x535523,_0x338caa,_0x403eb1){var _0x463acb={};var _0x107f54={};var _0x412d56;var _0x41dc40;return db[_0xb8a1('0x2c')][_0xb8a1('0x4d')]({'where':{'id':_0x535523['params']['id']}})['then'](handleEntityNotFound(_0x338caa,null))[_0xb8a1('0x24')](function(_0x42bc4f){if(_0x42bc4f){_0x412d56=_0x42bc4f;_0x107f54[_0xb8a1('0x32')]=_['keys'](db[_0xb8a1('0x4e')][_0xb8a1('0x46')]);_0x107f54[_0xb8a1('0x2f')]=_['keys'](_0x535523[_0xb8a1('0x2f')]);_0x107f54[_0xb8a1('0x31')]=_[_0xb8a1('0x34')](_0x107f54[_0xb8a1('0x32')],_0x107f54[_0xb8a1('0x2f')]);_0x463acb[_0xb8a1('0x33')]=_[_0xb8a1('0x34')](_0x107f54[_0xb8a1('0x32')],qs[_0xb8a1('0x35')](_0x535523[_0xb8a1('0x2f')]['fields']));_0x463acb[_0xb8a1('0x33')]=_0x463acb[_0xb8a1('0x33')]['length']?_0x463acb['attributes']:_0x107f54[_0xb8a1('0x32')];_0x463acb['order']=qs[_0xb8a1('0x3a')](_0x535523[_0xb8a1('0x2f')][_0xb8a1('0x3a')]);_0x463acb[_0xb8a1('0x3b')]=qs['filters'](_[_0xb8a1('0x3c')](_0x535523[_0xb8a1('0x2f')],_0x107f54['filters']));if(_0x535523[_0xb8a1('0x2f')][_0xb8a1('0x3d')]){_0x463acb[_0xb8a1('0x3b')]=_[_0xb8a1('0x40')](_0x463acb['where'],{'$or':_['map'](_0x463acb[_0xb8a1('0x33')],function(_0x4540df){var _0x20a12f={};_0x20a12f[_0x4540df]={'$like':'%'+_0x535523[_0xb8a1('0x2f')][_0xb8a1('0x3d')]+'%'};return _0x20a12f;})});}_0x463acb=_[_0xb8a1('0x40')]({},_0x463acb,_0x535523[_0xb8a1('0x41')]);return _0x412d56[_0xb8a1('0x4c')](_0x463acb);}})[_0xb8a1('0x24')](function(_0xbd8342){if(_0xbd8342){_0x41dc40=_0xbd8342[_0xb8a1('0x36')];if(!_0x535523[_0xb8a1('0x2f')]['hasOwnProperty']('nolimit')){_0x463acb[_0xb8a1('0x1d')]=qs[_0xb8a1('0x1d')](_0x535523[_0xb8a1('0x2f')][_0xb8a1('0x1d')]);_0x463acb[_0xb8a1('0x1b')]=qs['offset'](_0x535523[_0xb8a1('0x2f')]['offset']);}return _0x412d56[_0xb8a1('0x4c')](_0x463acb);}})[_0xb8a1('0x24')](function(_0x298747){if(_0x298747){return _0x298747?{'count':_0x41dc40,'rows':_0x298747}:null;}})[_0xb8a1('0x24')](respondWithResult(_0x338caa,null))[_0xb8a1('0x4a')](handleError(_0x338caa,null));};exports[_0xb8a1('0x4f')]=function(_0x5c9c9b,_0xb3453c,_0x27bdac){if(_0x5c9c9b[_0xb8a1('0x49')]['id']){delete _0x5c9c9b[_0xb8a1('0x49')]['id'];}return db[_0xb8a1('0x2c')][_0xb8a1('0x4d')]({'where':{'id':_0x5c9c9b[_0xb8a1('0x45')]['id']}})['then'](handleEntityNotFound(_0xb3453c,null))['then'](function(_0x5a97d0){if(_0x5a97d0){_0x5c9c9b[_0xb8a1('0x49')][_0xb8a1('0x50')]=_0x5a97d0['id'];_0x5c9c9b[_0xb8a1('0x49')][_0xb8a1('0x51')]=integrations['getSubjects'](_0x5c9c9b[_0xb8a1('0x49')]['channel'],_0x5c9c9b['body'][_0xb8a1('0x3e')]);_0x5c9c9b[_0xb8a1('0x49')]['Descriptions']=integrations['getDescriptions'](_0x5c9c9b[_0xb8a1('0x49')][_0xb8a1('0x52')],_0x5c9c9b['body'][_0xb8a1('0x3e')]);return db['FreshdeskConfiguration'][_0xb8a1('0x48')](_0x5c9c9b[_0xb8a1('0x49')],{'include':[{'model':db[_0xb8a1('0x53')],'as':_0xb8a1('0x51')},{'model':db[_0xb8a1('0x53')],'as':_0xb8a1('0x54')}]});}return null;})[_0xb8a1('0x24')](respondWithResult(_0xb3453c,null))[_0xb8a1('0x4a')](handleError(_0xb3453c,null));};exports[_0xb8a1('0x55')]=function(_0x3e8086,_0xa76191,_0x332dd8){var _0x5c3023='';return db[_0xb8a1('0x2c')]['findOne']({'where':{'id':_0x3e8086[_0xb8a1('0x45')]['id']},'attributes':['id',_0xb8a1('0x56'),_0xb8a1('0x57')]})[_0xb8a1('0x24')](handleEntityNotFound(_0xa76191,null))[_0xb8a1('0x24')](function(_0x4ae855){if(_0x4ae855){_0x5c3023=_0x4ae855['remoteUri'];var _0x14c1f7=_0x5c3023[_0xb8a1('0x58')](-0x1);if(_0x14c1f7==='/'){_0x5c3023=_0x5c3023['substring'](0x0,_0x5c3023['lastIndexOf'](_0x14c1f7));}return rp({'method':'GET','uri':util[_0xb8a1('0x59')](_0xb8a1('0x5a'),_0x5c3023,_0xb8a1('0x5b')),'headers':{'Authorization':util[_0xb8a1('0x59')](_0xb8a1('0x5c'),new Buffer(util[_0xb8a1('0x59')](_0xb8a1('0x5d'),_0x4ae855['apiKey']))[_0xb8a1('0x5e')](_0xb8a1('0x5f')))},'json':!![]});}})[_0xb8a1('0x24')](function(_0x1551fb){if(_0x1551fb){var _0x563e21=[_0xb8a1('0x60'),_0xb8a1('0x61'),_0xb8a1('0x62'),_0xb8a1('0x63'),_0xb8a1('0x18'),_0xb8a1('0x64'),_0xb8a1('0x65'),_0xb8a1('0x66'),_0xb8a1('0x67'),'group',_0xb8a1('0x68')];_[_0xb8a1('0x69')](_0x1551fb,function(_0x1bcade){return _0x563e21[_0xb8a1('0x6a')](_0x1bcade['name'])||!_0x1bcade['default']&&_0x1bcade[_0xb8a1('0x3e')]!==_0xb8a1('0x6b')&&_0x1bcade[_0xb8a1('0x3e')]!==_0xb8a1('0x6c');});return{'count':_0x1551fb[_0xb8a1('0x36')],'rows':_['map'](_0x1551fb,function(_0x39abbb){return{'id':_0x39abbb['name'],'name':_0x39abbb[_0xb8a1('0x6d')],'custom':!_0x39abbb[_0xb8a1('0x6e')],'options':_0x39abbb[_0xb8a1('0x6f')]?_[_0xb8a1('0x2b')](_0x39abbb['choices'],function(_0x3b86cb){return{'name':_[_0xb8a1('0x70')](_0x3b86cb),'value':_0x3b86cb};}):[]};})};}})[_0xb8a1('0x24')](respondWithResult(_0xa76191,null))[_0xb8a1('0x4a')](function(_0x1eb885){var _0x2189d4=_0x3e8086['query'][_0xb8a1('0x71')]?0x1f4:_0x1eb885[_0xb8a1('0x72')]||0x1f4;logger['error'](_0xb8a1('0x73'),_0xb8a1('0x55'),_0x2189d4,JSON['stringify'](_0x1eb885));delete _0x1eb885[_0xb8a1('0x28')];if(_0x2189d4===0x191){_0x2189d4=0x190;}_0xa76191[_0xb8a1('0x18')](_0x2189d4)['send'](_0x3e8086['query']['test']?{'message':_0xb8a1('0x74'),'statusCode':_0x1eb885[_0xb8a1('0x72')]}:_0x1eb885);});}; \ No newline at end of file +var _0x4ded=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','intersection','include','find','create','body','findOne','FreshdeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','remoteUri','apiKey','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','type','model','query','filters','fields','attributes','length'];(function(_0xa49f9f,_0x136ad8){var _0x3137dc=function(_0x42d310){while(--_0x42d310){_0xa49f9f['push'](_0xa49f9f['shift']());}};_0x3137dc(++_0x136ad8);}(_0x4ded,0x116));var _0xd4de=function(_0x4bd025,_0x217deb){_0x4bd025=_0x4bd025-0x0;var _0x5cf332=_0x4ded[_0x4bd025];return _0x5cf332;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];var integrations=require(_0xd4de('0x18'));function respondWithStatusCode(_0x2aa09d,_0x3ffc72){_0x3ffc72=_0x3ffc72||0xcc;return function(_0x3af6e0){if(_0x3af6e0){return _0x2aa09d[_0xd4de('0x19')](_0x3ffc72);}return _0x2aa09d[_0xd4de('0x1a')](_0x3ffc72)[_0xd4de('0x1b')]();};}function respondWithResult(_0x37cb9f,_0x691ba9){_0x691ba9=_0x691ba9||0xc8;return function(_0xd0d906){if(_0xd0d906){return _0x37cb9f[_0xd4de('0x1a')](_0x691ba9)[_0xd4de('0x1c')](_0xd0d906);}};}function respondWithFilteredResult(_0x102e5b,_0xa7c18b){return function(_0x325fba){if(_0x325fba){var _0x4b0a95=typeof _0xa7c18b['offset']===_0xd4de('0x1d')&&typeof _0xa7c18b[_0xd4de('0x1e')]===_0xd4de('0x1d');var _0x428aa2=_0x325fba['count'];var _0x4d0df6=_0x4b0a95?0x0:_0xa7c18b[_0xd4de('0x1f')];var _0x54b757=_0x4b0a95?_0x325fba[_0xd4de('0x20')]:_0xa7c18b[_0xd4de('0x1f')]+_0xa7c18b['limit'];var _0xc15081;if(_0x54b757>=_0x428aa2){_0x54b757=_0x428aa2;_0xc15081=0xc8;}else{_0xc15081=0xce;}_0x102e5b['status'](_0xc15081);return _0x102e5b[_0xd4de('0x21')](_0xd4de('0x22'),_0x4d0df6+'-'+_0x54b757+'/'+_0x428aa2)[_0xd4de('0x1c')](_0x325fba);}return null;};}function patchUpdates(_0x8e8712){return function(_0x5368f5){try{jsonpatch[_0xd4de('0x23')](_0x5368f5,_0x8e8712,!![]);}catch(_0x47311c){return BPromise[_0xd4de('0x24')](_0x47311c);}return _0x5368f5[_0xd4de('0x25')]();};}function saveUpdates(_0x1c631a,_0x2d092a){return function(_0x1561fd){if(_0x1561fd){return _0x1561fd[_0xd4de('0x26')](_0x1c631a)[_0xd4de('0x27')](function(_0x413f68){return _0x413f68;});}return null;};}function removeEntity(_0x534b37,_0xad333f){return function(_0x88a0b9){if(_0x88a0b9){return _0x88a0b9[_0xd4de('0x28')]()[_0xd4de('0x27')](function(){_0x534b37[_0xd4de('0x1a')](0xcc)[_0xd4de('0x1b')]();});}};}function handleEntityNotFound(_0xffe1cc,_0x36308c){return function(_0x2aa82a){if(!_0x2aa82a){_0xffe1cc[_0xd4de('0x19')](0x194);}return _0x2aa82a;};}function handleError(_0x2ea712,_0xb2d8a1){_0xb2d8a1=_0xb2d8a1||0x1f4;return function(_0x586126){logger[_0xd4de('0x29')](_0x586126[_0xd4de('0x2a')]);if(_0x586126['name']){delete _0x586126[_0xd4de('0x2b')];}_0x2ea712['status'](_0xb2d8a1)[_0xd4de('0x2c')](_0x586126);};}exports[_0xd4de('0x2d')]=function(_0x15d2b7,_0x4fa53a){var _0xd4de93={},_0x36f2f1={},_0x17f0a={'count':0x0,'rows':[]};var _0x50cb73=_[_0xd4de('0x2e')](db[_0xd4de('0x2f')]['rawAttributes'],function(_0x5103b5){return{'name':_0x5103b5['fieldName'],'type':_0x5103b5[_0xd4de('0x30')]['key']};});_0x36f2f1[_0xd4de('0x31')]=_[_0xd4de('0x2e')](_0x50cb73,_0xd4de('0x2b'));_0x36f2f1[_0xd4de('0x32')]=_['keys'](_0x15d2b7[_0xd4de('0x32')]);_0x36f2f1[_0xd4de('0x33')]=_['intersection'](_0x36f2f1[_0xd4de('0x31')],_0x36f2f1[_0xd4de('0x32')]);_0xd4de93['attributes']=_['intersection'](_0x36f2f1[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x34')]));_0xd4de93['attributes']=_0xd4de93[_0xd4de('0x35')][_0xd4de('0x36')]?_0xd4de93['attributes']:_0x36f2f1[_0xd4de('0x31')];if(!_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x37')](_0xd4de('0x38'))){_0xd4de93[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x15d2b7['query']['limit']);_0xd4de93[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x15d2b7[_0xd4de('0x32')]['offset']);}_0xd4de93[_0xd4de('0x39')]=qs[_0xd4de('0x3a')](_0x15d2b7['query'][_0xd4de('0x3a')]);_0xd4de93[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_[_0xd4de('0x3c')](_0x15d2b7['query'],_0x36f2f1['filters']),_0x50cb73);if(_0x15d2b7[_0xd4de('0x32')]['filter']){_0xd4de93[_0xd4de('0x3b')]=_['merge'](_0xd4de93[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x50cb73,function(_0x21cd77){if(_0x21cd77[_0xd4de('0x30')]!=='VIRTUAL'){var _0x21209d={};_0x21209d[_0x21cd77['name']]={'$like':'%'+_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x3d')]+'%'};return _0x21209d;}})});}_0xd4de93=_[_0xd4de('0x3e')]({},_0xd4de93,_0x15d2b7[_0xd4de('0x3f')]);var _0x349c5f={'where':_0xd4de93[_0xd4de('0x3b')]};return db[_0xd4de('0x2f')]['count'](_0x349c5f)[_0xd4de('0x27')](function(_0x1eb001){_0x17f0a[_0xd4de('0x20')]=_0x1eb001;if(_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x40')]){_0xd4de93['include']=[{'all':!![]}];}return db[_0xd4de('0x2f')][_0xd4de('0x41')](_0xd4de93);})[_0xd4de('0x27')](function(_0x593ee9){_0x17f0a[_0xd4de('0x42')]=_0x593ee9;return _0x17f0a;})[_0xd4de('0x27')](respondWithFilteredResult(_0x4fa53a,_0xd4de93))[_0xd4de('0x43')](handleError(_0x4fa53a,null));};exports['show']=function(_0x3b9026,_0x10a42c){var _0x419c49={'raw':![],'where':{'id':_0x3b9026[_0xd4de('0x44')]['id']}},_0x3f1e22={};_0x3f1e22[_0xd4de('0x31')]=_[_0xd4de('0x45')](db['FreshdeskAccount'][_0xd4de('0x46')]);_0x3f1e22[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x3b9026['query']);_0x3f1e22[_0xd4de('0x33')]=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],_0x3f1e22['query']);_0x419c49['attributes']=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],qs['fields'](_0x3b9026[_0xd4de('0x32')][_0xd4de('0x34')]));_0x419c49[_0xd4de('0x35')]=_0x419c49[_0xd4de('0x35')]['length']?_0x419c49[_0xd4de('0x35')]:_0x3f1e22[_0xd4de('0x31')];if(_0x3b9026[_0xd4de('0x32')][_0xd4de('0x40')]){_0x419c49[_0xd4de('0x48')]=[{'all':!![]}];}_0x419c49=_[_0xd4de('0x3e')]({},_0x419c49,_0x3b9026['options']);return db[_0xd4de('0x2f')][_0xd4de('0x49')](_0x419c49)[_0xd4de('0x27')](handleEntityNotFound(_0x10a42c,null))[_0xd4de('0x27')](respondWithResult(_0x10a42c,null))[_0xd4de('0x43')](handleError(_0x10a42c,null));};exports[_0xd4de('0x4a')]=function(_0x40bf55,_0x425a7e){return db[_0xd4de('0x2f')][_0xd4de('0x4a')](_0x40bf55['body'],{})[_0xd4de('0x27')](respondWithResult(_0x425a7e,0xc9))[_0xd4de('0x43')](handleError(_0x425a7e,null));};exports[_0xd4de('0x26')]=function(_0x518bfe,_0x13a900){if(_0x518bfe[_0xd4de('0x4b')]['id']){delete _0x518bfe[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x518bfe[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x13a900,null))[_0xd4de('0x27')](saveUpdates(_0x518bfe[_0xd4de('0x4b')],null))[_0xd4de('0x27')](respondWithResult(_0x13a900,null))['catch'](handleError(_0x13a900,null));};exports[_0xd4de('0x28')]=function(_0x26d032,_0x215f85){return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x26d032['params']['id']}})['then'](handleEntityNotFound(_0x215f85,null))[_0xd4de('0x27')](removeEntity(_0x215f85,null))[_0xd4de('0x43')](handleError(_0x215f85,null));};exports['getConfigurations']=function(_0x48cb7d,_0x2d8589,_0x368081){var _0x377376={};var _0x199440={};var _0x34d772;var _0x15c8cd;return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x48cb7d[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x2d8589,null))[_0xd4de('0x27')](function(_0x2e1780){if(_0x2e1780){_0x34d772=_0x2e1780;_0x199440['model']=_[_0xd4de('0x45')](db[_0xd4de('0x4d')][_0xd4de('0x46')]);_0x199440[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x48cb7d[_0xd4de('0x32')]);_0x199440['filters']=_[_0xd4de('0x47')](_0x199440['model'],_0x199440['query']);_0x377376[_0xd4de('0x35')]=_[_0xd4de('0x47')](_0x199440[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x48cb7d['query'][_0xd4de('0x34')]));_0x377376[_0xd4de('0x35')]=_0x377376[_0xd4de('0x35')][_0xd4de('0x36')]?_0x377376[_0xd4de('0x35')]:_0x199440['model'];_0x377376['order']=qs['sort'](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3a')]);_0x377376[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_['pick'](_0x48cb7d[_0xd4de('0x32')],_0x199440[_0xd4de('0x33')]));if(_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3d')]){_0x377376['where']=_[_0xd4de('0x3e')](_0x377376[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x377376[_0xd4de('0x35')],function(_0x598b60){var _0x4fd7c2={};_0x4fd7c2[_0x598b60]={'$like':'%'+_0x48cb7d['query'][_0xd4de('0x3d')]+'%'};return _0x4fd7c2;})});}_0x377376=_[_0xd4de('0x3e')]({},_0x377376,_0x48cb7d[_0xd4de('0x3f')]);return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x3005c2){if(_0x3005c2){_0x15c8cd=_0x3005c2[_0xd4de('0x36')];if(!_0x48cb7d['query'][_0xd4de('0x37')]('nolimit')){_0x377376[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1e')]);_0x377376[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1f')]);}return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x59f9d9){if(_0x59f9d9){return _0x59f9d9?{'count':_0x15c8cd,'rows':_0x59f9d9}:null;}})[_0xd4de('0x27')](respondWithResult(_0x2d8589,null))[_0xd4de('0x43')](handleError(_0x2d8589,null));};exports['addConfiguration']=function(_0x29c840,_0xb366b0,_0x21f7f7){if(_0x29c840[_0xd4de('0x4b')]['id']){delete _0x29c840[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x29c840[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0xb366b0,null))[_0xd4de('0x27')](function(_0x1e7e93){if(_0x1e7e93){_0x29c840[_0xd4de('0x4b')][_0xd4de('0x4e')]=_0x1e7e93['id'];_0x29c840['body'][_0xd4de('0x4f')]=integrations[_0xd4de('0x50')](_0x29c840[_0xd4de('0x4b')][_0xd4de('0x51')],_0x29c840[_0xd4de('0x4b')][_0xd4de('0x30')]);_0x29c840[_0xd4de('0x4b')][_0xd4de('0x52')]=integrations['getDescriptions'](_0x29c840[_0xd4de('0x4b')]['channel'],_0x29c840['body']['type']);return db[_0xd4de('0x4d')][_0xd4de('0x4a')](_0x29c840['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xd4de('0x52')}]});}return null;})['then'](respondWithResult(_0xb366b0,null))[_0xd4de('0x43')](handleError(_0xb366b0,null));};exports['getFields']=function(_0x1a0e6c,_0x223b1a,_0x4ee475){var _0x5df891='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1a0e6c[_0xd4de('0x44')]['id']},'attributes':['id',_0xd4de('0x53'),_0xd4de('0x54')]})[_0xd4de('0x27')](handleEntityNotFound(_0x223b1a,null))[_0xd4de('0x27')](function(_0x282d4f){if(_0x282d4f){_0x5df891=_0x282d4f['remoteUri'];var _0x5c651b=_0x5df891['slice'](-0x1);if(_0x5c651b==='/'){_0x5df891=_0x5df891[_0xd4de('0x55')](0x0,_0x5df891[_0xd4de('0x56')](_0x5c651b));}return rp({'method':'GET','uri':util[_0xd4de('0x57')]('%s/%s',_0x5df891,_0xd4de('0x58')),'headers':{'Authorization':util['format'](_0xd4de('0x59'),new Buffer(util[_0xd4de('0x57')]('%s:X',_0x282d4f[_0xd4de('0x54')]))['toString'](_0xd4de('0x5a')))},'json':!![]});}})[_0xd4de('0x27')](function(_0xc7ca29){if(_0xc7ca29){var _0xa94c28=['requester',_0xd4de('0x5b'),_0xd4de('0x5c'),_0xd4de('0x5d'),_0xd4de('0x1a'),_0xd4de('0x5e'),_0xd4de('0x5f'),_0xd4de('0x60'),_0xd4de('0x61'),_0xd4de('0x5f'),_0xd4de('0x62')];_[_0xd4de('0x63')](_0xc7ca29,function(_0x396f9f){return _0xa94c28[_0xd4de('0x64')](_0x396f9f['name'])||!_0x396f9f[_0xd4de('0x65')]&&_0x396f9f['type']!=='custom_text'&&_0x396f9f[_0xd4de('0x30')]!==_0xd4de('0x66');});return{'count':_0xc7ca29['length'],'rows':_[_0xd4de('0x2e')](_0xc7ca29,function(_0x249012){return{'id':_0x249012[_0xd4de('0x2b')],'name':_0x249012[_0xd4de('0x67')],'custom':!_0x249012['default'],'options':_0x249012[_0xd4de('0x68')]?_[_0xd4de('0x2e')](_0x249012[_0xd4de('0x68')],function(_0x2e81df){return{'name':_[_0xd4de('0x69')](_0x2e81df),'value':_0x2e81df};}):[]};})};}})['then'](respondWithResult(_0x223b1a,null))['catch'](function(_0x4cb7a5){var _0x4a2467=_0x1a0e6c[_0xd4de('0x32')]['test']?0x1f4:_0x4cb7a5[_0xd4de('0x6a')]||0x1f4;logger['error'](_0xd4de('0x6b'),_0xd4de('0x6c'),_0x4a2467,JSON[_0xd4de('0x6d')](_0x4cb7a5));delete _0x4cb7a5[_0xd4de('0x2b')];if(_0x4a2467===0x191){_0x4a2467=0x190;}_0x223b1a[_0xd4de('0x1a')](_0x4a2467)[_0xd4de('0x2c')](_0x1a0e6c[_0xd4de('0x32')][_0xd4de('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4cb7a5[_0xd4de('0x6a')]}:_0x4cb7a5);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7dcd559..454d4a7 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 _0x0928=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x44699f,_0x56196f){var _0x3250c3=function(_0x8deb9){while(--_0x8deb9){_0x44699f['push'](_0x44699f['shift']());}};_0x3250c3(++_0x56196f);}(_0x0928,0x6f));var _0x8092=function(_0x107d48,_0x369217){_0x107d48=_0x107d48-0x0;var _0x1c7227=_0x0928[_0x107d48];return _0x1c7227;};'use strict';var _=require(_0x8092('0x0'));var util=require(_0x8092('0x1'));var logger=require(_0x8092('0x2'))(_0x8092('0x3'));var moment=require(_0x8092('0x4'));var BPromise=require('bluebird');var rp=require(_0x8092('0x5'));var fs=require('fs');var path=require(_0x8092('0x6'));var rimraf=require(_0x8092('0x7'));var config=require(_0x8092('0x8'));var attributes=require(_0x8092('0x9'));var integrations=require(_0x8092('0xa'));module['exports']=function(_0x52f9f0,_0x5caf44){return _0x52f9f0[_0x8092('0xb')](_0x8092('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ac0=['../../config/environment','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x2ac0,0x14f));var _0x02ac=function(_0x437307,_0x583972){_0x437307=_0x437307-0x0;var _0x4be742=_0x2ac0[_0x437307];return _0x4be742;};'use strict';var _=require(_0x02ac('0x0'));var util=require('util');var logger=require(_0x02ac('0x1'))(_0x02ac('0x2'));var moment=require(_0x02ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x02ac('0x4'));var fs=require('fs');var path=require(_0x02ac('0x5'));var rimraf=require('rimraf');var config=require(_0x02ac('0x6'));var attributes=require(_0x02ac('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x18f949,_0x1697f2){return _0x18f949[_0x02ac('0x8')](_0x02ac('0x9'),attributes,{'tableName':_0x02ac('0xa'),'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 37f67e0..b78434b 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 _0xb0d9=['error','code','message','catch','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','GetFreshdeskAccount','debug','find','raw','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb0d9,0x78));var _0x9b0d=function(_0x4094db,_0x2891ab){_0x4094db=_0x4094db-0x0;var _0xfa62bd=_0xb0d9[_0x4094db];return _0xfa62bd;};'use strict';var _=require(_0x9b0d('0x0'));var util=require('util');var moment=require(_0x9b0d('0x1'));var BPromise=require(_0x9b0d('0x2'));var rs=require(_0x9b0d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b0d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b0d('0x5'))(_0x9b0d('0x6'));var config=require(_0x9b0d('0x7'));var jayson=require(_0x9b0d('0x8'));var client=jayson[_0x9b0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf398,_0xe52876,_0xb9a0db){return new BPromise(function(_0x3ddb52,_0x538048){return client[_0x9b0d('0xa')](_0x1cf398,_0xb9a0db)['then'](function(_0xc3bdff){logger[_0x9b0d('0xb')](_0x9b0d('0xc'),_0xe52876,'request\x20sent');logger['debug'](_0x9b0d('0xd'),_0xe52876,_0x9b0d('0xe'),JSON[_0x9b0d('0xf')](_0xc3bdff));if(_0xc3bdff[_0x9b0d('0x10')]){if(_0xc3bdff['error'][_0x9b0d('0x11')]===0x1f4){logger[_0x9b0d('0x10')](_0x9b0d('0xc'),_0xe52876,_0xc3bdff[_0x9b0d('0x10')]['message']);return _0x538048(_0xc3bdff[_0x9b0d('0x10')][_0x9b0d('0x12')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0xe52876,_0xc3bdff['error'][_0x9b0d('0x12')]);return _0x3ddb52(_0xc3bdff[_0x9b0d('0x10')]['message']);}else{logger['info'](_0x9b0d('0xc'),_0xe52876,'request\x20sent');_0x3ddb52(_0xc3bdff['result'][_0x9b0d('0x12')]);}})[_0x9b0d('0x13')](function(_0x4b5ee0){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0xe52876,_0x4b5ee0);_0x538048(_0x4b5ee0);});});}exports['GetFreshdeskAccount']=function(_0x573c8e){var _0x56101c=this;return new Promise(function(_0x4cf7d4,_0x1afdcb){return db[_0x9b0d('0x14')][_0x9b0d('0x15')]({'raw':_0x573c8e[_0x9b0d('0x16')]?_0x573c8e[_0x9b0d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x573c8e[_0x9b0d('0x16')]?_0x573c8e[_0x9b0d('0x16')][_0x9b0d('0x17')]||null:null,'attributes':_0x573c8e[_0x9b0d('0x16')]?_0x573c8e[_0x9b0d('0x16')][_0x9b0d('0x18')]||null:null,'limit':_0x573c8e[_0x9b0d('0x16')]?_0x573c8e['options'][_0x9b0d('0x19')]||null:null,'include':_0x573c8e['options']?_0x573c8e[_0x9b0d('0x16')][_0x9b0d('0x1a')]?_[_0x9b0d('0x1b')](_0x573c8e[_0x9b0d('0x16')]['include'],function(_0x4cc373){return{'model':db[_0x4cc373[_0x9b0d('0x1c')]],'as':_0x4cc373['as'],'attributes':_0x4cc373[_0x9b0d('0x18')],'include':_0x4cc373['include']?_[_0x9b0d('0x1b')](_0x4cc373['include'],function(_0x1713ff){return{'model':db[_0x1713ff[_0x9b0d('0x1c')]],'as':_0x1713ff['as'],'attributes':_0x1713ff['attributes'],'include':_0x1713ff[_0x9b0d('0x1a')]?_[_0x9b0d('0x1b')](_0x1713ff['include'],function(_0xa8b0a){return{'model':db[_0xa8b0a[_0x9b0d('0x1c')]],'as':_0xa8b0a['as'],'attributes':_0xa8b0a[_0x9b0d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcdd771){logger[_0x9b0d('0xb')](_0x9b0d('0x1d'),_0x573c8e);logger[_0x9b0d('0x1e')](_0x9b0d('0x1d'),_0x573c8e,JSON['stringify'](_0xcdd771));_0x4cf7d4(_0xcdd771);})[_0x9b0d('0x13')](function(_0x58f044){logger[_0x9b0d('0x10')](_0x9b0d('0x1d'),_0x58f044[_0x9b0d('0x12')],_0x573c8e);_0x1afdcb(_0x56101c[_0x9b0d('0x10')](0x1f4,_0x58f044[_0x9b0d('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x40e667){var _0x2a45ec=this;return new Promise(function(_0x47e25f,_0x331cd1){return db['FreshdeskAccount'][_0x9b0d('0x1f')]({'raw':_0x40e667[_0x9b0d('0x16')]?_0x40e667[_0x9b0d('0x16')][_0x9b0d('0x20')]===undefined?!![]:![]:!![],'where':_0x40e667[_0x9b0d('0x16')]?_0x40e667[_0x9b0d('0x16')][_0x9b0d('0x17')]||null:null,'attributes':_0x40e667['options']?_0x40e667['options'][_0x9b0d('0x18')]||null:null,'include':_0x40e667[_0x9b0d('0x16')]?_0x40e667[_0x9b0d('0x16')][_0x9b0d('0x1a')]?_[_0x9b0d('0x1b')](_0x40e667[_0x9b0d('0x16')][_0x9b0d('0x1a')],function(_0x11fc40){return{'model':db[_0x11fc40[_0x9b0d('0x1c')]],'as':_0x11fc40['as'],'attributes':_0x11fc40['attributes'],'include':_0x11fc40[_0x9b0d('0x1a')]?_[_0x9b0d('0x1b')](_0x11fc40[_0x9b0d('0x1a')],function(_0x55fea2){return{'model':db[_0x55fea2[_0x9b0d('0x1c')]],'as':_0x55fea2['as'],'attributes':_0x55fea2['attributes'],'include':_0x55fea2[_0x9b0d('0x1a')]?_[_0x9b0d('0x1b')](_0x55fea2[_0x9b0d('0x1a')],function(_0x319b90){return{'model':db[_0x319b90[_0x9b0d('0x1c')]],'as':_0x319b90['as'],'attributes':_0x319b90[_0x9b0d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24c639){logger[_0x9b0d('0xb')](_0x9b0d('0x21'),_0x40e667);logger[_0x9b0d('0x1e')](_0x9b0d('0x21'),_0x40e667,JSON[_0x9b0d('0xf')](_0x24c639));_0x47e25f(_0x24c639);})[_0x9b0d('0x13')](function(_0x14bf2c){logger[_0x9b0d('0x10')](_0x9b0d('0x21'),_0x14bf2c[_0x9b0d('0x12')],_0x40e667);_0x331cd1(_0x2a45ec[_0x9b0d('0x10')](0x1f4,_0x14bf2c[_0x9b0d('0x12')]));});});}; \ No newline at end of file +var _0x61c8=['catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','include','map','model','find','ShowFreshdeskAccount','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x592071,_0x5b9f75){var _0x363cf6=function(_0x312e86){while(--_0x312e86){_0x592071['push'](_0x592071['shift']());}};_0x363cf6(++_0x5b9f75);}(_0x61c8,0x199));var _0x861c=function(_0x4f485f,_0x1db0f7){_0x4f485f=_0x4f485f-0x0;var _0x1e998e=_0x61c8[_0x4f485f];return _0x1e998e;};'use strict';var _=require(_0x861c('0x0'));var util=require(_0x861c('0x1'));var moment=require(_0x861c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x861c('0x3'));var db=require(_0x861c('0x4'))['db'];var utils=require(_0x861c('0x5'));var logger=require(_0x861c('0x6'))(_0x861c('0x7'));var config=require('../../config/environment');var jayson=require(_0x861c('0x8'));var client=jayson[_0x861c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e9ffa,_0x3fca37,_0x536889){return new BPromise(function(_0x319bea,_0x5daa29){return client[_0x861c('0xa')](_0x3e9ffa,_0x536889)[_0x861c('0xb')](function(_0x590ae6){logger[_0x861c('0xc')](_0x861c('0xd'),_0x3fca37,_0x861c('0xe'));logger[_0x861c('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3fca37,'request\x20sent',JSON['stringify'](_0x590ae6));if(_0x590ae6['error']){if(_0x590ae6[_0x861c('0x10')][_0x861c('0x11')]===0x1f4){logger[_0x861c('0x10')](_0x861c('0xd'),_0x3fca37,_0x590ae6[_0x861c('0x10')]['message']);return _0x5daa29(_0x590ae6['error']['message']);}logger[_0x861c('0x10')](_0x861c('0xd'),_0x3fca37,_0x590ae6[_0x861c('0x10')][_0x861c('0x12')]);return _0x319bea(_0x590ae6['error'][_0x861c('0x12')]);}else{logger[_0x861c('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3fca37,'request\x20sent');_0x319bea(_0x590ae6[_0x861c('0x13')][_0x861c('0x12')]);}})[_0x861c('0x14')](function(_0x4fd26a){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3fca37,_0x4fd26a);_0x5daa29(_0x4fd26a);});});}exports[_0x861c('0x15')]=function(_0x19c6d2){var _0x43df7f=this;return new Promise(function(_0x1cd16f,_0x536ef8){return db[_0x861c('0x16')]['findAll']({'raw':_0x19c6d2[_0x861c('0x17')]?_0x19c6d2[_0x861c('0x17')][_0x861c('0x18')]===undefined?!![]:![]:!![],'where':_0x19c6d2[_0x861c('0x17')]?_0x19c6d2[_0x861c('0x17')][_0x861c('0x19')]||null:null,'attributes':_0x19c6d2[_0x861c('0x17')]?_0x19c6d2[_0x861c('0x17')][_0x861c('0x1a')]||null:null,'limit':_0x19c6d2[_0x861c('0x17')]?_0x19c6d2['options']['limit']||null:null,'include':_0x19c6d2['options']?_0x19c6d2[_0x861c('0x17')][_0x861c('0x1b')]?_[_0x861c('0x1c')](_0x19c6d2['options'][_0x861c('0x1b')],function(_0x2cd4d0){return{'model':db[_0x2cd4d0[_0x861c('0x1d')]],'as':_0x2cd4d0['as'],'attributes':_0x2cd4d0[_0x861c('0x1a')],'include':_0x2cd4d0[_0x861c('0x1b')]?_['map'](_0x2cd4d0['include'],function(_0x3e3a00){return{'model':db[_0x3e3a00[_0x861c('0x1d')]],'as':_0x3e3a00['as'],'attributes':_0x3e3a00[_0x861c('0x1a')],'include':_0x3e3a00['include']?_[_0x861c('0x1c')](_0x3e3a00[_0x861c('0x1b')],function(_0x383736){return{'model':db[_0x383736[_0x861c('0x1d')]],'as':_0x383736['as'],'attributes':_0x383736[_0x861c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x861c('0xb')](function(_0x2bdf5c){logger['info']('GetFreshdeskAccount',_0x19c6d2);logger[_0x861c('0xf')]('GetFreshdeskAccount',_0x19c6d2,JSON['stringify'](_0x2bdf5c));_0x1cd16f(_0x2bdf5c);})[_0x861c('0x14')](function(_0x4c9e3d){logger[_0x861c('0x10')](_0x861c('0x15'),_0x4c9e3d[_0x861c('0x12')],_0x19c6d2);_0x536ef8(_0x43df7f[_0x861c('0x10')](0x1f4,_0x4c9e3d[_0x861c('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x521c3a){var _0x121bc4=this;return new Promise(function(_0x156554,_0x740b32){return db[_0x861c('0x16')][_0x861c('0x1e')]({'raw':_0x521c3a[_0x861c('0x17')]?_0x521c3a[_0x861c('0x17')][_0x861c('0x18')]===undefined?!![]:![]:!![],'where':_0x521c3a[_0x861c('0x17')]?_0x521c3a[_0x861c('0x17')][_0x861c('0x19')]||null:null,'attributes':_0x521c3a[_0x861c('0x17')]?_0x521c3a[_0x861c('0x17')][_0x861c('0x1a')]||null:null,'include':_0x521c3a[_0x861c('0x17')]?_0x521c3a['options'][_0x861c('0x1b')]?_[_0x861c('0x1c')](_0x521c3a[_0x861c('0x17')][_0x861c('0x1b')],function(_0x46e0d1){return{'model':db[_0x46e0d1[_0x861c('0x1d')]],'as':_0x46e0d1['as'],'attributes':_0x46e0d1[_0x861c('0x1a')],'include':_0x46e0d1[_0x861c('0x1b')]?_[_0x861c('0x1c')](_0x46e0d1['include'],function(_0x12d98b){return{'model':db[_0x12d98b[_0x861c('0x1d')]],'as':_0x12d98b['as'],'attributes':_0x12d98b[_0x861c('0x1a')],'include':_0x12d98b['include']?_['map'](_0x12d98b[_0x861c('0x1b')],function(_0xe8def1){return{'model':db[_0xe8def1[_0x861c('0x1d')]],'as':_0xe8def1['as'],'attributes':_0xe8def1[_0x861c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x861c('0xb')](function(_0x28848d){logger[_0x861c('0xc')](_0x861c('0x1f'),_0x521c3a);logger[_0x861c('0xf')](_0x861c('0x1f'),_0x521c3a,JSON[_0x861c('0x20')](_0x28848d));_0x156554(_0x28848d);})[_0x861c('0x14')](function(_0x4b531e){logger[_0x861c('0x10')](_0x861c('0x1f'),_0x4b531e[_0x861c('0x12')],_0x521c3a);_0x740b32(_0x121bc4[_0x861c('0x10')](0x1f4,_0x4b531e['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 007647a..37f1db9 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 _0xa456=['/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','update','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x51898e,_0x2d3474){var _0x4fcd4a=function(_0x2e02b6){while(--_0x2e02b6){_0x51898e['push'](_0x51898e['shift']());}};_0x4fcd4a(++_0x2d3474);}(_0xa456,0x174));var _0x6a45=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xa456[_0x243b59];return _0x3e1676;};'use strict';var multer=require('multer');var util=require(_0x6a45('0x0'));var path=require(_0x6a45('0x1'));var timeout=require(_0x6a45('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a45('0x3'));var interaction=require(_0x6a45('0x4'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x6a45('0x5')]('/',auth[_0x6a45('0x6')](),controller[_0x6a45('0x7')]);router[_0x6a45('0x5')](_0x6a45('0x8'),auth[_0x6a45('0x6')](),controller[_0x6a45('0x9')]);router['get'](_0x6a45('0xa'),auth[_0x6a45('0x6')](),controller['getFields']);router[_0x6a45('0x5')]('/:id/subjects',auth[_0x6a45('0x6')](),controller[_0x6a45('0xb')]);router[_0x6a45('0x5')](_0x6a45('0xc'),auth[_0x6a45('0x6')](),controller[_0x6a45('0xd')]);router[_0x6a45('0x5')]('/:id/tags',auth[_0x6a45('0x6')](),controller[_0x6a45('0xe')]);router[_0x6a45('0xf')]('/',auth['isAuthenticated'](),controller[_0x6a45('0x10')]);router['post']('/:id/tags',auth['isAuthenticated'](),controller[_0x6a45('0x11')]);router['put']('/:id',auth[_0x6a45('0x6')](),controller[_0x6a45('0x12')]);router['delete'](_0x6a45('0x8'),auth[_0x6a45('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae1c=['get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xae1c,0x95));var _0xcae1=function(_0x233ac3,_0x5b049b){_0x233ac3=_0x233ac3-0x0;var _0x3d1f4d=_0xae1c[_0x233ac3];return _0x3d1f4d;};'use strict';var multer=require('multer');var util=require(_0xcae1('0x0'));var path=require('path');var timeout=require(_0xcae1('0x1'));var express=require('express');var router=express[_0xcae1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcae1('0x3'));var interaction=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var controller=require(_0xcae1('0x6'));router[_0xcae1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcae1('0x8'),auth[_0xcae1('0x9')](),controller[_0xcae1('0xa')]);router[_0xcae1('0x7')](_0xcae1('0xb'),auth[_0xcae1('0x9')](),controller[_0xcae1('0xc')]);router['get'](_0xcae1('0xd'),auth[_0xcae1('0x9')](),controller[_0xcae1('0xe')]);router[_0xcae1('0x7')](_0xcae1('0xf'),auth['isAuthenticated'](),controller[_0xcae1('0x10')]);router[_0xcae1('0x7')](_0xcae1('0x11'),auth[_0xcae1('0x9')](),controller[_0xcae1('0x12')]);router[_0xcae1('0x13')]('/',auth['isAuthenticated'](),controller[_0xcae1('0x14')]);router['post'](_0xcae1('0x11'),auth[_0xcae1('0x9')](),controller[_0xcae1('0x15')]);router[_0xcae1('0x16')](_0xcae1('0x8'),auth[_0xcae1('0x9')](),controller[_0xcae1('0x17')]);router[_0xcae1('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xcae1('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6175f55..d383021 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 _0x1a6f=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a6f,0xb6));var _0xf1a6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1a6f[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xf1a6('0x0'));module[_0xf1a6('0x1')]={'name':{'type':Sequelize[_0xf1a6('0x2')]},'description':{'type':Sequelize[_0xf1a6('0x2')]}}; \ No newline at end of file +var _0x3da6=['exports','STRING'];(function(_0x33279e,_0x115b84){var _0x2e92da=function(_0x3a73d7){while(--_0x3a73d7){_0x33279e['push'](_0x33279e['shift']());}};_0x2e92da(++_0x115b84);}(_0x3da6,0x1a2));var _0x63da=function(_0x4db5dc,_0x522901){_0x4db5dc=_0x4db5dc-0x0;var _0x62ee23=_0x3da6[_0x4db5dc];return _0x62ee23;};'use strict';var Sequelize=require('sequelize');module[_0x63da('0x0')]={'name':{'type':Sequelize[_0x63da('0x1')]},'description':{'type':Sequelize[_0x63da('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 87b39bb..1fbddff 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 _0x5699=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','undefined','limit','count','offset','status','set','json','apply','update','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','where','pick','merge','filter','options','include','rows','catch','show','params','intersection','includeAll','find','create','body','getFields','FreshdeskField','sort','hasOwnProperty','nolimit','findOne','getDescriptions','order','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5c1ae4,_0x41f508){var _0xa2aaef=function(_0x523a13){while(--_0x523a13){_0x5c1ae4['push'](_0x5c1ae4['shift']());}};_0xa2aaef(++_0x41f508);}(_0x5699,0x95));var _0x9569=function(_0x533a4a,_0xff9159){_0x533a4a=_0x533a4a-0x0;var _0x346a56=_0x5699[_0x533a4a];return _0x346a56;};'use strict';var emlformat=require(_0x9569('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9569('0x1'));var rp=require(_0x9569('0x2'));var moment=require('moment');var BPromise=require(_0x9569('0x3'));var Mustache=require(_0x9569('0x4'));var util=require(_0x9569('0x5'));var path=require(_0x9569('0x6'));var sox=require('sox');var csv=require(_0x9569('0x7'));var ejs=require(_0x9569('0x8'));var fs=require('fs');var fs_extra=require(_0x9569('0x9'));var _=require(_0x9569('0xa'));var squel=require(_0x9569('0xb'));var crypto=require(_0x9569('0xc'));var jsforce=require(_0x9569('0xd'));var deskjs=require(_0x9569('0xe'));var toCsv=require(_0x9569('0x7'));var querystring=require(_0x9569('0xf'));var Papa=require(_0x9569('0x10'));var Redis=require(_0x9569('0x11'));var authService=require(_0x9569('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9569('0x13'));var hardwareService=require(_0x9569('0x14'));var logger=require('../../config/logger')(_0x9569('0x15'));var utils=require(_0x9569('0x16'));var config=require(_0x9569('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9569('0x18'))['db'];function respondWithStatusCode(_0x149785,_0x4e6f27){_0x4e6f27=_0x4e6f27||0xcc;return function(_0x21e3f5){if(_0x21e3f5){return _0x149785['sendStatus'](_0x4e6f27);}return _0x149785['status'](_0x4e6f27)[_0x9569('0x19')]();};}function respondWithResult(_0x3ab2fb,_0x4a1935){_0x4a1935=_0x4a1935||0xc8;return function(_0x557c15){if(_0x557c15){return _0x3ab2fb['status'](_0x4a1935)['json'](_0x557c15);}};}function respondWithFilteredResult(_0x23bf1f,_0x434b79){return function(_0x50a142){if(_0x50a142){var _0x55cadf=typeof _0x434b79['offset']===_0x9569('0x1a')&&typeof _0x434b79[_0x9569('0x1b')]===_0x9569('0x1a');var _0x54745e=_0x50a142[_0x9569('0x1c')];var _0x1d60ce=_0x55cadf?0x0:_0x434b79['offset'];var _0x521d7c=_0x55cadf?_0x50a142['count']:_0x434b79[_0x9569('0x1d')]+_0x434b79[_0x9569('0x1b')];var _0x33e395;if(_0x521d7c>=_0x54745e){_0x521d7c=_0x54745e;_0x33e395=0xc8;}else{_0x33e395=0xce;}_0x23bf1f[_0x9569('0x1e')](_0x33e395);return _0x23bf1f[_0x9569('0x1f')]('Content-Range',_0x1d60ce+'-'+_0x521d7c+'/'+_0x54745e)[_0x9569('0x20')](_0x50a142);}return null;};}function patchUpdates(_0x128fca){return function(_0x5f0828){try{jsonpatch[_0x9569('0x21')](_0x5f0828,_0x128fca,!![]);}catch(_0x2290b7){return BPromise['reject'](_0x2290b7);}return _0x5f0828['save']();};}function saveUpdates(_0x166583,_0x17005c){return function(_0x54e80c){if(_0x54e80c){return _0x54e80c[_0x9569('0x22')](_0x166583)[_0x9569('0x23')](function(_0x19c9a9){return _0x19c9a9;});}return null;};}function removeEntity(_0x173590,_0x46397f){return function(_0x19d0e9){if(_0x19d0e9){return _0x19d0e9[_0x9569('0x24')]()[_0x9569('0x23')](function(){_0x173590[_0x9569('0x1e')](0xcc)[_0x9569('0x19')]();});}};}function handleEntityNotFound(_0x57b288,_0x112271){return function(_0x26cfb2){if(!_0x26cfb2){_0x57b288[_0x9569('0x25')](0x194);}return _0x26cfb2;};}function handleError(_0x50dc41,_0x4118e4){_0x4118e4=_0x4118e4||0x1f4;return function(_0x3492ae){logger[_0x9569('0x26')](_0x3492ae[_0x9569('0x27')]);if(_0x3492ae[_0x9569('0x28')]){delete _0x3492ae[_0x9569('0x28')];}_0x50dc41['status'](_0x4118e4)['send'](_0x3492ae);};}exports[_0x9569('0x29')]=function(_0x3fbbd7,_0x5f59d6){var _0x7bd50d={},_0x16c32c={},_0x343314={'count':0x0,'rows':[]};var _0x459e73=_[_0x9569('0x2a')](db[_0x9569('0x2b')][_0x9569('0x2c')],function(_0x39a359){return{'name':_0x39a359['fieldName'],'type':_0x39a359[_0x9569('0x2d')][_0x9569('0x2e')]};});_0x16c32c[_0x9569('0x2f')]=_[_0x9569('0x2a')](_0x459e73,_0x9569('0x28'));_0x16c32c['query']=_[_0x9569('0x30')](_0x3fbbd7[_0x9569('0x31')]);_0x16c32c[_0x9569('0x32')]=_['intersection'](_0x16c32c[_0x9569('0x2f')],_0x16c32c[_0x9569('0x31')]);_0x7bd50d[_0x9569('0x33')]=_['intersection'](_0x16c32c[_0x9569('0x2f')],qs['fields'](_0x3fbbd7[_0x9569('0x31')][_0x9569('0x34')]));_0x7bd50d[_0x9569('0x33')]=_0x7bd50d['attributes'][_0x9569('0x35')]?_0x7bd50d['attributes']:_0x16c32c['model'];if(!_0x3fbbd7['query']['hasOwnProperty']('nolimit')){_0x7bd50d[_0x9569('0x1b')]=qs[_0x9569('0x1b')](_0x3fbbd7[_0x9569('0x31')][_0x9569('0x1b')]);_0x7bd50d[_0x9569('0x1d')]=qs[_0x9569('0x1d')](_0x3fbbd7[_0x9569('0x31')]['offset']);}_0x7bd50d['order']=qs['sort'](_0x3fbbd7[_0x9569('0x31')]['sort']);_0x7bd50d[_0x9569('0x36')]=qs[_0x9569('0x32')](_[_0x9569('0x37')](_0x3fbbd7[_0x9569('0x31')],_0x16c32c[_0x9569('0x32')]),_0x459e73);if(_0x3fbbd7[_0x9569('0x31')]['filter']){_0x7bd50d[_0x9569('0x36')]=_[_0x9569('0x38')](_0x7bd50d[_0x9569('0x36')],{'$or':_['map'](_0x459e73,function(_0x213072){if(_0x213072[_0x9569('0x2d')]!=='VIRTUAL'){var _0x4b32f6={};_0x4b32f6[_0x213072[_0x9569('0x28')]]={'$like':'%'+_0x3fbbd7['query'][_0x9569('0x39')]+'%'};return _0x4b32f6;}})});}_0x7bd50d=_[_0x9569('0x38')]({},_0x7bd50d,_0x3fbbd7[_0x9569('0x3a')]);var _0x59c7d7={'where':_0x7bd50d['where']};return db[_0x9569('0x2b')]['count'](_0x59c7d7)[_0x9569('0x23')](function(_0x379e9b){_0x343314[_0x9569('0x1c')]=_0x379e9b;if(_0x3fbbd7[_0x9569('0x31')]['includeAll']){_0x7bd50d[_0x9569('0x3b')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x7bd50d);})['then'](function(_0x3c0d86){_0x343314[_0x9569('0x3c')]=_0x3c0d86;return _0x343314;})[_0x9569('0x23')](respondWithFilteredResult(_0x5f59d6,_0x7bd50d))[_0x9569('0x3d')](handleError(_0x5f59d6,null));};exports[_0x9569('0x3e')]=function(_0x656577,_0x4b4bbc){var _0x3dd9cc={'raw':![],'where':{'id':_0x656577[_0x9569('0x3f')]['id']}},_0x208361={};_0x208361[_0x9569('0x2f')]=_[_0x9569('0x30')](db['FreshdeskConfiguration'][_0x9569('0x2c')]);_0x208361['query']=_[_0x9569('0x30')](_0x656577[_0x9569('0x31')]);_0x208361[_0x9569('0x32')]=_[_0x9569('0x40')](_0x208361['model'],_0x208361[_0x9569('0x31')]);_0x3dd9cc[_0x9569('0x33')]=_['intersection'](_0x208361[_0x9569('0x2f')],qs[_0x9569('0x34')](_0x656577['query']['fields']));_0x3dd9cc[_0x9569('0x33')]=_0x3dd9cc['attributes'][_0x9569('0x35')]?_0x3dd9cc[_0x9569('0x33')]:_0x208361['model'];if(_0x656577[_0x9569('0x31')][_0x9569('0x41')]){_0x3dd9cc[_0x9569('0x3b')]=[{'all':!![]}];}_0x3dd9cc=_[_0x9569('0x38')]({},_0x3dd9cc,_0x656577[_0x9569('0x3a')]);return db[_0x9569('0x2b')][_0x9569('0x42')](_0x3dd9cc)['then'](handleEntityNotFound(_0x4b4bbc,null))[_0x9569('0x23')](respondWithResult(_0x4b4bbc,null))['catch'](handleError(_0x4b4bbc,null));};exports[_0x9569('0x43')]=function(_0x4a4c74,_0x1c3ad0){return db['FreshdeskConfiguration'][_0x9569('0x43')](_0x4a4c74[_0x9569('0x44')],{})[_0x9569('0x23')](respondWithResult(_0x1c3ad0,0xc9))[_0x9569('0x3d')](handleError(_0x1c3ad0,null));};exports['update']=function(_0x20fc33,_0x483683){if(_0x20fc33[_0x9569('0x44')]['id']){delete _0x20fc33[_0x9569('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x9569('0x42')]({'where':{'id':_0x20fc33[_0x9569('0x3f')]['id']}})['then'](handleEntityNotFound(_0x483683,null))['then'](saveUpdates(_0x20fc33[_0x9569('0x44')],null))[_0x9569('0x23')](respondWithResult(_0x483683,null))['catch'](handleError(_0x483683,null));};exports[_0x9569('0x24')]=function(_0xdc13ef,_0x855ef5){return db[_0x9569('0x2b')]['find']({'where':{'id':_0xdc13ef['params']['id']}})[_0x9569('0x23')](handleEntityNotFound(_0x855ef5,null))[_0x9569('0x23')](removeEntity(_0x855ef5,null))[_0x9569('0x3d')](handleError(_0x855ef5,null));};exports[_0x9569('0x45')]=function(_0x11976d,_0x4014a0,_0x456a43){var _0x97d0d1={};var _0x180994={};var _0x42dce6;var _0x4c41d1;return db[_0x9569('0x2b')]['findOne']({'where':{'id':_0x11976d[_0x9569('0x3f')]['id']}})[_0x9569('0x23')](handleEntityNotFound(_0x4014a0,null))['then'](function(_0x74cc78){if(_0x74cc78){_0x42dce6=_0x74cc78;_0x180994[_0x9569('0x2f')]=_[_0x9569('0x30')](db[_0x9569('0x46')]['rawAttributes']);_0x180994['query']=_[_0x9569('0x30')](_0x11976d['query']);_0x180994[_0x9569('0x32')]=_[_0x9569('0x40')](_0x180994[_0x9569('0x2f')],_0x180994[_0x9569('0x31')]);_0x97d0d1['attributes']=_[_0x9569('0x40')](_0x180994[_0x9569('0x2f')],qs[_0x9569('0x34')](_0x11976d['query'][_0x9569('0x34')]));_0x97d0d1[_0x9569('0x33')]=_0x97d0d1[_0x9569('0x33')][_0x9569('0x35')]?_0x97d0d1[_0x9569('0x33')]:_0x180994[_0x9569('0x2f')];_0x97d0d1['order']=qs[_0x9569('0x47')](_0x11976d[_0x9569('0x31')][_0x9569('0x47')]);_0x97d0d1[_0x9569('0x36')]=qs[_0x9569('0x32')](_['pick'](_0x11976d['query'],_0x180994[_0x9569('0x32')]));if(_0x11976d['query'][_0x9569('0x39')]){_0x97d0d1[_0x9569('0x36')]=_[_0x9569('0x38')](_0x97d0d1['where'],{'$or':_[_0x9569('0x2a')](_0x97d0d1[_0x9569('0x33')],function(_0x3d4da3){var _0x5bac84={};_0x5bac84[_0x3d4da3]={'$like':'%'+_0x11976d['query'][_0x9569('0x39')]+'%'};return _0x5bac84;})});}_0x97d0d1=_[_0x9569('0x38')]({},_0x97d0d1,_0x11976d[_0x9569('0x3a')]);return _0x42dce6[_0x9569('0x45')](_0x97d0d1);}})[_0x9569('0x23')](function(_0x30adc5){if(_0x30adc5){_0x4c41d1=_0x30adc5[_0x9569('0x35')];if(!_0x11976d[_0x9569('0x31')][_0x9569('0x48')](_0x9569('0x49'))){_0x97d0d1[_0x9569('0x1b')]=qs['limit'](_0x11976d[_0x9569('0x31')]['limit']);_0x97d0d1[_0x9569('0x1d')]=qs[_0x9569('0x1d')](_0x11976d[_0x9569('0x31')][_0x9569('0x1d')]);}return _0x42dce6[_0x9569('0x45')](_0x97d0d1);}})['then'](function(_0x254e40){if(_0x254e40){return _0x254e40?{'count':_0x4c41d1,'rows':_0x254e40}:null;}})[_0x9569('0x23')](respondWithResult(_0x4014a0,null))[_0x9569('0x3d')](handleError(_0x4014a0,null));};exports['getSubjects']=function(_0x102d18,_0x3fbd25,_0x47558d){var _0x41f46a={};var _0x39c2cb={};var _0x1d058b;var _0x5265ec;return db[_0x9569('0x2b')][_0x9569('0x4a')]({'where':{'id':_0x102d18['params']['id']}})['then'](handleEntityNotFound(_0x3fbd25,null))[_0x9569('0x23')](function(_0x249993){if(_0x249993){_0x1d058b=_0x249993;_0x39c2cb[_0x9569('0x2f')]=_[_0x9569('0x30')](db[_0x9569('0x46')][_0x9569('0x2c')]);_0x39c2cb[_0x9569('0x31')]=_[_0x9569('0x30')](_0x102d18[_0x9569('0x31')]);_0x39c2cb['filters']=_['intersection'](_0x39c2cb[_0x9569('0x2f')],_0x39c2cb['query']);_0x41f46a[_0x9569('0x33')]=_[_0x9569('0x40')](_0x39c2cb[_0x9569('0x2f')],qs['fields'](_0x102d18['query'][_0x9569('0x34')]));_0x41f46a[_0x9569('0x33')]=_0x41f46a[_0x9569('0x33')]['length']?_0x41f46a[_0x9569('0x33')]:_0x39c2cb[_0x9569('0x2f')];_0x41f46a['order']=qs[_0x9569('0x47')](_0x102d18[_0x9569('0x31')][_0x9569('0x47')]);_0x41f46a['where']=qs[_0x9569('0x32')](_[_0x9569('0x37')](_0x102d18[_0x9569('0x31')],_0x39c2cb[_0x9569('0x32')]));if(_0x102d18[_0x9569('0x31')][_0x9569('0x39')]){_0x41f46a[_0x9569('0x36')]=_[_0x9569('0x38')](_0x41f46a[_0x9569('0x36')],{'$or':_[_0x9569('0x2a')](_0x41f46a['attributes'],function(_0x44c33f){var _0x53053b={};_0x53053b[_0x44c33f]={'$like':'%'+_0x102d18[_0x9569('0x31')][_0x9569('0x39')]+'%'};return _0x53053b;})});}_0x41f46a=_[_0x9569('0x38')]({},_0x41f46a,_0x102d18[_0x9569('0x3a')]);return _0x1d058b['getSubjects'](_0x41f46a);}})[_0x9569('0x23')](function(_0x3bf4fd){if(_0x3bf4fd){_0x5265ec=_0x3bf4fd[_0x9569('0x35')];if(!_0x102d18[_0x9569('0x31')]['hasOwnProperty'](_0x9569('0x49'))){_0x41f46a[_0x9569('0x1b')]=qs[_0x9569('0x1b')](_0x102d18[_0x9569('0x31')][_0x9569('0x1b')]);_0x41f46a['offset']=qs[_0x9569('0x1d')](_0x102d18[_0x9569('0x31')][_0x9569('0x1d')]);}return _0x1d058b['getSubjects'](_0x41f46a);}})[_0x9569('0x23')](function(_0x5f2fd5){if(_0x5f2fd5){return _0x5f2fd5?{'count':_0x5265ec,'rows':_0x5f2fd5}:null;}})[_0x9569('0x23')](respondWithResult(_0x3fbd25,null))[_0x9569('0x3d')](handleError(_0x3fbd25,null));};exports[_0x9569('0x4b')]=function(_0x4878a7,_0x2b3761,_0x3f293b){var _0x4ec63c={};var _0x37a97e={};var _0x2fc51a;var _0x1d83b2;return db[_0x9569('0x2b')]['findOne']({'where':{'id':_0x4878a7[_0x9569('0x3f')]['id']}})[_0x9569('0x23')](handleEntityNotFound(_0x2b3761,null))[_0x9569('0x23')](function(_0x1ac1df){if(_0x1ac1df){_0x2fc51a=_0x1ac1df;_0x37a97e['model']=_[_0x9569('0x30')](db[_0x9569('0x46')][_0x9569('0x2c')]);_0x37a97e['query']=_[_0x9569('0x30')](_0x4878a7[_0x9569('0x31')]);_0x37a97e[_0x9569('0x32')]=_[_0x9569('0x40')](_0x37a97e[_0x9569('0x2f')],_0x37a97e[_0x9569('0x31')]);_0x4ec63c[_0x9569('0x33')]=_['intersection'](_0x37a97e[_0x9569('0x2f')],qs[_0x9569('0x34')](_0x4878a7[_0x9569('0x31')]['fields']));_0x4ec63c[_0x9569('0x33')]=_0x4ec63c[_0x9569('0x33')][_0x9569('0x35')]?_0x4ec63c[_0x9569('0x33')]:_0x37a97e[_0x9569('0x2f')];_0x4ec63c[_0x9569('0x4c')]=qs[_0x9569('0x47')](_0x4878a7['query'][_0x9569('0x47')]);_0x4ec63c['where']=qs[_0x9569('0x32')](_[_0x9569('0x37')](_0x4878a7[_0x9569('0x31')],_0x37a97e[_0x9569('0x32')]));if(_0x4878a7['query'][_0x9569('0x39')]){_0x4ec63c[_0x9569('0x36')]=_[_0x9569('0x38')](_0x4ec63c[_0x9569('0x36')],{'$or':_[_0x9569('0x2a')](_0x4ec63c[_0x9569('0x33')],function(_0x7d84ae){var _0xa93bb6={};_0xa93bb6[_0x7d84ae]={'$like':'%'+_0x4878a7[_0x9569('0x31')]['filter']+'%'};return _0xa93bb6;})});}_0x4ec63c=_['merge']({},_0x4ec63c,_0x4878a7[_0x9569('0x3a')]);return _0x2fc51a[_0x9569('0x4b')](_0x4ec63c);}})[_0x9569('0x23')](function(_0x57be35){if(_0x57be35){_0x1d83b2=_0x57be35[_0x9569('0x35')];if(!_0x4878a7['query'][_0x9569('0x48')]('nolimit')){_0x4ec63c[_0x9569('0x1b')]=qs[_0x9569('0x1b')](_0x4878a7['query']['limit']);_0x4ec63c[_0x9569('0x1d')]=qs['offset'](_0x4878a7['query'][_0x9569('0x1d')]);}return _0x2fc51a[_0x9569('0x4b')](_0x4ec63c);}})[_0x9569('0x23')](function(_0x4b7885){if(_0x4b7885){return _0x4b7885?{'count':_0x1d83b2,'rows':_0x4b7885}:null;}})[_0x9569('0x23')](respondWithResult(_0x2b3761,null))[_0x9569('0x3d')](handleError(_0x2b3761,null));};exports[_0x9569('0x4d')]=function(_0x186532,_0x560488,_0x11a926){var _0x427547={};var _0x2312f6={};var _0x3568b3;var _0x241061;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x186532[_0x9569('0x3f')]['id']}})['then'](handleEntityNotFound(_0x560488,null))['then'](function(_0x442c8c){if(_0x442c8c){_0x3568b3=_0x442c8c;_0x2312f6[_0x9569('0x2f')]=_[_0x9569('0x30')](db[_0x9569('0x4e')]['rawAttributes']);_0x2312f6['query']=_[_0x9569('0x30')](_0x186532['query']);_0x2312f6['filters']=_[_0x9569('0x40')](_0x2312f6[_0x9569('0x2f')],_0x2312f6['query']);_0x427547['attributes']=_[_0x9569('0x40')](_0x2312f6[_0x9569('0x2f')],qs[_0x9569('0x34')](_0x186532[_0x9569('0x31')][_0x9569('0x34')]));_0x427547['attributes']=_0x427547[_0x9569('0x33')]['length']?_0x427547['attributes']:_0x2312f6['model'];_0x427547['order']=qs[_0x9569('0x47')](_0x186532[_0x9569('0x31')][_0x9569('0x47')]);_0x427547[_0x9569('0x36')]=qs[_0x9569('0x32')](_[_0x9569('0x37')](_0x186532[_0x9569('0x31')],_0x2312f6[_0x9569('0x32')]));if(_0x186532['query'][_0x9569('0x39')]){_0x427547[_0x9569('0x36')]=_[_0x9569('0x38')](_0x427547['where'],{'$or':_['map'](_0x427547[_0x9569('0x33')],function(_0xa22c33){var _0x434adf={};_0x434adf[_0xa22c33]={'$like':'%'+_0x186532[_0x9569('0x31')][_0x9569('0x39')]+'%'};return _0x434adf;})});}_0x427547=_[_0x9569('0x38')]({},_0x427547,_0x186532['options']);return _0x3568b3[_0x9569('0x4d')](_0x427547);}})[_0x9569('0x23')](function(_0x202c15){if(_0x202c15){_0x241061=_0x202c15[_0x9569('0x35')];if(!_0x186532['query'][_0x9569('0x48')]('nolimit')){_0x427547[_0x9569('0x1b')]=qs['limit'](_0x186532[_0x9569('0x31')][_0x9569('0x1b')]);_0x427547[_0x9569('0x1d')]=qs[_0x9569('0x1d')](_0x186532[_0x9569('0x31')][_0x9569('0x1d')]);}return _0x3568b3[_0x9569('0x4d')](_0x427547);}})[_0x9569('0x23')](function(_0x35a50f){if(_0x35a50f){return _0x35a50f?{'count':_0x241061,'rows':_0x35a50f}:null;}})[_0x9569('0x23')](respondWithResult(_0x560488,null))[_0x9569('0x3d')](handleError(_0x560488,null));};exports['setTags']=function(_0x13a71c,_0x3a7d3d,_0x283da0){if(_0x13a71c[_0x9569('0x44')]['id']){delete _0x13a71c['body']['id'];}return db['FreshdeskConfiguration'][_0x9569('0x4a')]({'where':{'id':_0x13a71c['params']['id']}})[_0x9569('0x23')](handleEntityNotFound(_0x3a7d3d,null))[_0x9569('0x23')](function(_0xc4d663){if(_0xc4d663){return _0xc4d663[_0x9569('0x4f')](_0x13a71c[_0x9569('0x44')][_0x9569('0x50')]||[]);}return null;})[_0x9569('0x23')](respondWithResult(_0x3a7d3d,null))[_0x9569('0x3d')](handleError(_0x3a7d3d,null));}; \ No newline at end of file +var _0x01d1=['merge','VIRTUAL','options','includeAll','include','FreshdeskConfiguration','findAll','rows','catch','show','params','find','create','body','findOne','order','pick','getFields','getSubjects','FreshdeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter'];(function(_0x1a0c6a,_0x180781){var _0x3b5963=function(_0x2c2450){while(--_0x2c2450){_0x1a0c6a['push'](_0x1a0c6a['shift']());}};_0x3b5963(++_0x180781);}(_0x01d1,0x73));var _0x101d=function(_0x223cd5,_0x4ed40e){_0x223cd5=_0x223cd5-0x0;var _0x1ad430=_0x01d1[_0x223cd5];return _0x1ad430;};'use strict';var emlformat=require(_0x101d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x101d('0x1'));var jsonpatch=require(_0x101d('0x2'));var rp=require(_0x101d('0x3'));var moment=require(_0x101d('0x4'));var BPromise=require(_0x101d('0x5'));var Mustache=require(_0x101d('0x6'));var util=require(_0x101d('0x7'));var path=require('path');var sox=require(_0x101d('0x8'));var csv=require(_0x101d('0x9'));var ejs=require(_0x101d('0xa'));var fs=require('fs');var fs_extra=require(_0x101d('0xb'));var _=require('lodash');var squel=require(_0x101d('0xc'));var crypto=require(_0x101d('0xd'));var jsforce=require(_0x101d('0xe'));var deskjs=require(_0x101d('0xf'));var toCsv=require(_0x101d('0x9'));var querystring=require('querystring');var Papa=require(_0x101d('0x10'));var Redis=require('ioredis');var authService=require(_0x101d('0x11'));var qs=require(_0x101d('0x12'));var as=require(_0x101d('0x13'));var hardwareService=require(_0x101d('0x14'));var logger=require(_0x101d('0x15'))(_0x101d('0x16'));var utils=require('../../config/utils');var config=require(_0x101d('0x17'));var licenseUtil=require(_0x101d('0x18'));var db=require(_0x101d('0x19'))['db'];function respondWithStatusCode(_0x2305de,_0x49f4f3){_0x49f4f3=_0x49f4f3||0xcc;return function(_0x40c271){if(_0x40c271){return _0x2305de[_0x101d('0x1a')](_0x49f4f3);}return _0x2305de[_0x101d('0x1b')](_0x49f4f3)[_0x101d('0x1c')]();};}function respondWithResult(_0x21293e,_0x3e1a39){_0x3e1a39=_0x3e1a39||0xc8;return function(_0x374afc){if(_0x374afc){return _0x21293e[_0x101d('0x1b')](_0x3e1a39)[_0x101d('0x1d')](_0x374afc);}};}function respondWithFilteredResult(_0x599257,_0x5858e6){return function(_0xd33243){if(_0xd33243){var _0x5865e2=typeof _0x5858e6[_0x101d('0x1e')]===_0x101d('0x1f')&&typeof _0x5858e6['limit']==='undefined';var _0x376fe8=_0xd33243[_0x101d('0x20')];var _0x378e06=_0x5865e2?0x0:_0x5858e6[_0x101d('0x1e')];var _0x3abe8e=_0x5865e2?_0xd33243['count']:_0x5858e6['offset']+_0x5858e6['limit'];var _0x465c3c;if(_0x3abe8e>=_0x376fe8){_0x3abe8e=_0x376fe8;_0x465c3c=0xc8;}else{_0x465c3c=0xce;}_0x599257[_0x101d('0x1b')](_0x465c3c);return _0x599257[_0x101d('0x21')](_0x101d('0x22'),_0x378e06+'-'+_0x3abe8e+'/'+_0x376fe8)[_0x101d('0x1d')](_0xd33243);}return null;};}function patchUpdates(_0x54c5c2){return function(_0xc9d9e6){try{jsonpatch[_0x101d('0x23')](_0xc9d9e6,_0x54c5c2,!![]);}catch(_0x12e2d2){return BPromise[_0x101d('0x24')](_0x12e2d2);}return _0xc9d9e6[_0x101d('0x25')]();};}function saveUpdates(_0x30f69c,_0xaae1e2){return function(_0x16d1c2){if(_0x16d1c2){return _0x16d1c2[_0x101d('0x26')](_0x30f69c)[_0x101d('0x27')](function(_0x3fc419){return _0x3fc419;});}return null;};}function removeEntity(_0x12914b,_0x3e0f36){return function(_0x26c679){if(_0x26c679){return _0x26c679[_0x101d('0x28')]()[_0x101d('0x27')](function(){_0x12914b[_0x101d('0x1b')](0xcc)[_0x101d('0x1c')]();});}};}function handleEntityNotFound(_0x134672,_0x54d8a5){return function(_0x2d20f3){if(!_0x2d20f3){_0x134672['sendStatus'](0x194);}return _0x2d20f3;};}function handleError(_0x4325db,_0x2a813b){_0x2a813b=_0x2a813b||0x1f4;return function(_0x5c792c){logger[_0x101d('0x29')](_0x5c792c[_0x101d('0x2a')]);if(_0x5c792c[_0x101d('0x2b')]){delete _0x5c792c[_0x101d('0x2b')];}_0x4325db[_0x101d('0x1b')](_0x2a813b)[_0x101d('0x2c')](_0x5c792c);};}exports[_0x101d('0x2d')]=function(_0x35232d,_0x24a2fe){var _0x4e4e83={},_0x517bd4={},_0x2b35a2={'count':0x0,'rows':[]};var _0x13695c=_[_0x101d('0x2e')](db['FreshdeskConfiguration'][_0x101d('0x2f')],function(_0x5c7425){return{'name':_0x5c7425[_0x101d('0x30')],'type':_0x5c7425[_0x101d('0x31')][_0x101d('0x32')]};});_0x517bd4['model']=_[_0x101d('0x2e')](_0x13695c,_0x101d('0x2b'));_0x517bd4[_0x101d('0x33')]=_[_0x101d('0x34')](_0x35232d[_0x101d('0x33')]);_0x517bd4[_0x101d('0x35')]=_[_0x101d('0x36')](_0x517bd4['model'],_0x517bd4[_0x101d('0x33')]);_0x4e4e83[_0x101d('0x37')]=_['intersection'](_0x517bd4[_0x101d('0x38')],qs[_0x101d('0x39')](_0x35232d[_0x101d('0x33')]['fields']));_0x4e4e83[_0x101d('0x37')]=_0x4e4e83[_0x101d('0x37')][_0x101d('0x3a')]?_0x4e4e83[_0x101d('0x37')]:_0x517bd4['model'];if(!_0x35232d[_0x101d('0x33')][_0x101d('0x3b')](_0x101d('0x3c'))){_0x4e4e83['limit']=qs['limit'](_0x35232d[_0x101d('0x33')][_0x101d('0x3d')]);_0x4e4e83[_0x101d('0x1e')]=qs[_0x101d('0x1e')](_0x35232d['query'][_0x101d('0x1e')]);}_0x4e4e83['order']=qs[_0x101d('0x3e')](_0x35232d['query'][_0x101d('0x3e')]);_0x4e4e83[_0x101d('0x3f')]=qs[_0x101d('0x35')](_['pick'](_0x35232d['query'],_0x517bd4[_0x101d('0x35')]),_0x13695c);if(_0x35232d[_0x101d('0x33')][_0x101d('0x40')]){_0x4e4e83[_0x101d('0x3f')]=_[_0x101d('0x41')](_0x4e4e83[_0x101d('0x3f')],{'$or':_[_0x101d('0x2e')](_0x13695c,function(_0x2212b9){if(_0x2212b9[_0x101d('0x31')]!==_0x101d('0x42')){var _0x5ec9f5={};_0x5ec9f5[_0x2212b9[_0x101d('0x2b')]]={'$like':'%'+_0x35232d['query']['filter']+'%'};return _0x5ec9f5;}})});}_0x4e4e83=_[_0x101d('0x41')]({},_0x4e4e83,_0x35232d[_0x101d('0x43')]);var _0x5a4675={'where':_0x4e4e83[_0x101d('0x3f')]};return db['FreshdeskConfiguration'][_0x101d('0x20')](_0x5a4675)['then'](function(_0x559772){_0x2b35a2[_0x101d('0x20')]=_0x559772;if(_0x35232d[_0x101d('0x33')][_0x101d('0x44')]){_0x4e4e83[_0x101d('0x45')]=[{'all':!![]}];}return db[_0x101d('0x46')][_0x101d('0x47')](_0x4e4e83);})[_0x101d('0x27')](function(_0x550200){_0x2b35a2[_0x101d('0x48')]=_0x550200;return _0x2b35a2;})[_0x101d('0x27')](respondWithFilteredResult(_0x24a2fe,_0x4e4e83))[_0x101d('0x49')](handleError(_0x24a2fe,null));};exports[_0x101d('0x4a')]=function(_0xea8429,_0x1ed8ae){var _0x5014c3={'raw':![],'where':{'id':_0xea8429[_0x101d('0x4b')]['id']}},_0x465021={};_0x465021[_0x101d('0x38')]=_[_0x101d('0x34')](db[_0x101d('0x46')][_0x101d('0x2f')]);_0x465021['query']=_[_0x101d('0x34')](_0xea8429['query']);_0x465021[_0x101d('0x35')]=_['intersection'](_0x465021['model'],_0x465021[_0x101d('0x33')]);_0x5014c3['attributes']=_[_0x101d('0x36')](_0x465021['model'],qs[_0x101d('0x39')](_0xea8429[_0x101d('0x33')][_0x101d('0x39')]));_0x5014c3[_0x101d('0x37')]=_0x5014c3[_0x101d('0x37')]['length']?_0x5014c3[_0x101d('0x37')]:_0x465021['model'];if(_0xea8429[_0x101d('0x33')]['includeAll']){_0x5014c3['include']=[{'all':!![]}];}_0x5014c3=_[_0x101d('0x41')]({},_0x5014c3,_0xea8429[_0x101d('0x43')]);return db[_0x101d('0x46')][_0x101d('0x4c')](_0x5014c3)[_0x101d('0x27')](handleEntityNotFound(_0x1ed8ae,null))[_0x101d('0x27')](respondWithResult(_0x1ed8ae,null))['catch'](handleError(_0x1ed8ae,null));};exports[_0x101d('0x4d')]=function(_0x369420,_0x3f3125){return db[_0x101d('0x46')][_0x101d('0x4d')](_0x369420[_0x101d('0x4e')],{})[_0x101d('0x27')](respondWithResult(_0x3f3125,0xc9))[_0x101d('0x49')](handleError(_0x3f3125,null));};exports[_0x101d('0x26')]=function(_0x557932,_0x4b4275){if(_0x557932[_0x101d('0x4e')]['id']){delete _0x557932[_0x101d('0x4e')]['id'];}return db[_0x101d('0x46')][_0x101d('0x4c')]({'where':{'id':_0x557932[_0x101d('0x4b')]['id']}})[_0x101d('0x27')](handleEntityNotFound(_0x4b4275,null))[_0x101d('0x27')](saveUpdates(_0x557932[_0x101d('0x4e')],null))[_0x101d('0x27')](respondWithResult(_0x4b4275,null))[_0x101d('0x49')](handleError(_0x4b4275,null));};exports['destroy']=function(_0x7e2836,_0x320a0e){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x7e2836[_0x101d('0x4b')]['id']}})[_0x101d('0x27')](handleEntityNotFound(_0x320a0e,null))['then'](removeEntity(_0x320a0e,null))[_0x101d('0x49')](handleError(_0x320a0e,null));};exports['getFields']=function(_0x163ebf,_0xc7f2b8,_0x52e3ac){var _0x5ce050={};var _0xf44d73={};var _0x23f8e8;var _0x51fbc5;return db[_0x101d('0x46')][_0x101d('0x4f')]({'where':{'id':_0x163ebf['params']['id']}})[_0x101d('0x27')](handleEntityNotFound(_0xc7f2b8,null))[_0x101d('0x27')](function(_0x4b49b4){if(_0x4b49b4){_0x23f8e8=_0x4b49b4;_0xf44d73[_0x101d('0x38')]=_[_0x101d('0x34')](db['FreshdeskField']['rawAttributes']);_0xf44d73[_0x101d('0x33')]=_[_0x101d('0x34')](_0x163ebf[_0x101d('0x33')]);_0xf44d73[_0x101d('0x35')]=_['intersection'](_0xf44d73[_0x101d('0x38')],_0xf44d73[_0x101d('0x33')]);_0x5ce050[_0x101d('0x37')]=_[_0x101d('0x36')](_0xf44d73[_0x101d('0x38')],qs['fields'](_0x163ebf['query'][_0x101d('0x39')]));_0x5ce050[_0x101d('0x37')]=_0x5ce050[_0x101d('0x37')][_0x101d('0x3a')]?_0x5ce050[_0x101d('0x37')]:_0xf44d73['model'];_0x5ce050[_0x101d('0x50')]=qs['sort'](_0x163ebf['query'][_0x101d('0x3e')]);_0x5ce050[_0x101d('0x3f')]=qs['filters'](_[_0x101d('0x51')](_0x163ebf['query'],_0xf44d73[_0x101d('0x35')]));if(_0x163ebf['query'][_0x101d('0x40')]){_0x5ce050[_0x101d('0x3f')]=_['merge'](_0x5ce050[_0x101d('0x3f')],{'$or':_[_0x101d('0x2e')](_0x5ce050['attributes'],function(_0x4524e9){var _0x59b3d2={};_0x59b3d2[_0x4524e9]={'$like':'%'+_0x163ebf['query'][_0x101d('0x40')]+'%'};return _0x59b3d2;})});}_0x5ce050=_[_0x101d('0x41')]({},_0x5ce050,_0x163ebf[_0x101d('0x43')]);return _0x23f8e8[_0x101d('0x52')](_0x5ce050);}})[_0x101d('0x27')](function(_0x1aef43){if(_0x1aef43){_0x51fbc5=_0x1aef43[_0x101d('0x3a')];if(!_0x163ebf[_0x101d('0x33')][_0x101d('0x3b')](_0x101d('0x3c'))){_0x5ce050['limit']=qs[_0x101d('0x3d')](_0x163ebf[_0x101d('0x33')]['limit']);_0x5ce050[_0x101d('0x1e')]=qs['offset'](_0x163ebf['query'][_0x101d('0x1e')]);}return _0x23f8e8['getFields'](_0x5ce050);}})[_0x101d('0x27')](function(_0x276a9c){if(_0x276a9c){return _0x276a9c?{'count':_0x51fbc5,'rows':_0x276a9c}:null;}})[_0x101d('0x27')](respondWithResult(_0xc7f2b8,null))[_0x101d('0x49')](handleError(_0xc7f2b8,null));};exports[_0x101d('0x53')]=function(_0x457425,_0x3b8c94,_0x50fb8e){var _0x313a68={};var _0x597e95={};var _0x12a799;var _0x3eddb1;return db[_0x101d('0x46')][_0x101d('0x4f')]({'where':{'id':_0x457425[_0x101d('0x4b')]['id']}})[_0x101d('0x27')](handleEntityNotFound(_0x3b8c94,null))['then'](function(_0x3d95ec){if(_0x3d95ec){_0x12a799=_0x3d95ec;_0x597e95[_0x101d('0x38')]=_[_0x101d('0x34')](db['FreshdeskField'][_0x101d('0x2f')]);_0x597e95[_0x101d('0x33')]=_[_0x101d('0x34')](_0x457425[_0x101d('0x33')]);_0x597e95[_0x101d('0x35')]=_[_0x101d('0x36')](_0x597e95[_0x101d('0x38')],_0x597e95[_0x101d('0x33')]);_0x313a68['attributes']=_[_0x101d('0x36')](_0x597e95[_0x101d('0x38')],qs[_0x101d('0x39')](_0x457425[_0x101d('0x33')][_0x101d('0x39')]));_0x313a68[_0x101d('0x37')]=_0x313a68['attributes'][_0x101d('0x3a')]?_0x313a68[_0x101d('0x37')]:_0x597e95[_0x101d('0x38')];_0x313a68['order']=qs['sort'](_0x457425['query'][_0x101d('0x3e')]);_0x313a68[_0x101d('0x3f')]=qs[_0x101d('0x35')](_['pick'](_0x457425['query'],_0x597e95[_0x101d('0x35')]));if(_0x457425[_0x101d('0x33')]['filter']){_0x313a68[_0x101d('0x3f')]=_[_0x101d('0x41')](_0x313a68[_0x101d('0x3f')],{'$or':_[_0x101d('0x2e')](_0x313a68['attributes'],function(_0xe488f9){var _0x4a7085={};_0x4a7085[_0xe488f9]={'$like':'%'+_0x457425[_0x101d('0x33')][_0x101d('0x40')]+'%'};return _0x4a7085;})});}_0x313a68=_[_0x101d('0x41')]({},_0x313a68,_0x457425[_0x101d('0x43')]);return _0x12a799[_0x101d('0x53')](_0x313a68);}})[_0x101d('0x27')](function(_0x49ee5f){if(_0x49ee5f){_0x3eddb1=_0x49ee5f['length'];if(!_0x457425[_0x101d('0x33')][_0x101d('0x3b')](_0x101d('0x3c'))){_0x313a68[_0x101d('0x3d')]=qs[_0x101d('0x3d')](_0x457425[_0x101d('0x33')][_0x101d('0x3d')]);_0x313a68[_0x101d('0x1e')]=qs[_0x101d('0x1e')](_0x457425['query'][_0x101d('0x1e')]);}return _0x12a799[_0x101d('0x53')](_0x313a68);}})[_0x101d('0x27')](function(_0x1ddd49){if(_0x1ddd49){return _0x1ddd49?{'count':_0x3eddb1,'rows':_0x1ddd49}:null;}})['then'](respondWithResult(_0x3b8c94,null))[_0x101d('0x49')](handleError(_0x3b8c94,null));};exports['getDescriptions']=function(_0x2cbf97,_0x118949,_0x4b2047){var _0x3de6da={};var _0x52c21c={};var _0x20616b;var _0xa1c30f;return db[_0x101d('0x46')][_0x101d('0x4f')]({'where':{'id':_0x2cbf97[_0x101d('0x4b')]['id']}})[_0x101d('0x27')](handleEntityNotFound(_0x118949,null))[_0x101d('0x27')](function(_0x205104){if(_0x205104){_0x20616b=_0x205104;_0x52c21c[_0x101d('0x38')]=_[_0x101d('0x34')](db[_0x101d('0x54')][_0x101d('0x2f')]);_0x52c21c[_0x101d('0x33')]=_[_0x101d('0x34')](_0x2cbf97[_0x101d('0x33')]);_0x52c21c['filters']=_[_0x101d('0x36')](_0x52c21c[_0x101d('0x38')],_0x52c21c['query']);_0x3de6da[_0x101d('0x37')]=_[_0x101d('0x36')](_0x52c21c[_0x101d('0x38')],qs[_0x101d('0x39')](_0x2cbf97['query']['fields']));_0x3de6da['attributes']=_0x3de6da[_0x101d('0x37')][_0x101d('0x3a')]?_0x3de6da[_0x101d('0x37')]:_0x52c21c[_0x101d('0x38')];_0x3de6da[_0x101d('0x50')]=qs[_0x101d('0x3e')](_0x2cbf97[_0x101d('0x33')][_0x101d('0x3e')]);_0x3de6da['where']=qs[_0x101d('0x35')](_[_0x101d('0x51')](_0x2cbf97['query'],_0x52c21c[_0x101d('0x35')]));if(_0x2cbf97[_0x101d('0x33')][_0x101d('0x40')]){_0x3de6da[_0x101d('0x3f')]=_[_0x101d('0x41')](_0x3de6da[_0x101d('0x3f')],{'$or':_['map'](_0x3de6da[_0x101d('0x37')],function(_0x59e48a){var _0x2b2688={};_0x2b2688[_0x59e48a]={'$like':'%'+_0x2cbf97['query'][_0x101d('0x40')]+'%'};return _0x2b2688;})});}_0x3de6da=_[_0x101d('0x41')]({},_0x3de6da,_0x2cbf97[_0x101d('0x43')]);return _0x20616b[_0x101d('0x55')](_0x3de6da);}})['then'](function(_0x25e08b){if(_0x25e08b){_0xa1c30f=_0x25e08b['length'];if(!_0x2cbf97[_0x101d('0x33')][_0x101d('0x3b')](_0x101d('0x3c'))){_0x3de6da[_0x101d('0x3d')]=qs[_0x101d('0x3d')](_0x2cbf97[_0x101d('0x33')]['limit']);_0x3de6da[_0x101d('0x1e')]=qs[_0x101d('0x1e')](_0x2cbf97[_0x101d('0x33')]['offset']);}return _0x20616b[_0x101d('0x55')](_0x3de6da);}})[_0x101d('0x27')](function(_0xcfd609){if(_0xcfd609){return _0xcfd609?{'count':_0xa1c30f,'rows':_0xcfd609}:null;}})[_0x101d('0x27')](respondWithResult(_0x118949,null))[_0x101d('0x49')](handleError(_0x118949,null));};exports['getTags']=function(_0x78d9c4,_0x474f65,_0x15de1e){var _0x2a9789={};var _0x3802fd={};var _0x31fb01;var _0x49d635;return db[_0x101d('0x46')][_0x101d('0x4f')]({'where':{'id':_0x78d9c4[_0x101d('0x4b')]['id']}})[_0x101d('0x27')](handleEntityNotFound(_0x474f65,null))[_0x101d('0x27')](function(_0x3d5cd2){if(_0x3d5cd2){_0x31fb01=_0x3d5cd2;_0x3802fd[_0x101d('0x38')]=_[_0x101d('0x34')](db[_0x101d('0x56')][_0x101d('0x2f')]);_0x3802fd[_0x101d('0x33')]=_[_0x101d('0x34')](_0x78d9c4[_0x101d('0x33')]);_0x3802fd[_0x101d('0x35')]=_[_0x101d('0x36')](_0x3802fd[_0x101d('0x38')],_0x3802fd[_0x101d('0x33')]);_0x2a9789[_0x101d('0x37')]=_[_0x101d('0x36')](_0x3802fd[_0x101d('0x38')],qs[_0x101d('0x39')](_0x78d9c4[_0x101d('0x33')][_0x101d('0x39')]));_0x2a9789[_0x101d('0x37')]=_0x2a9789[_0x101d('0x37')][_0x101d('0x3a')]?_0x2a9789['attributes']:_0x3802fd['model'];_0x2a9789[_0x101d('0x50')]=qs[_0x101d('0x3e')](_0x78d9c4[_0x101d('0x33')]['sort']);_0x2a9789[_0x101d('0x3f')]=qs[_0x101d('0x35')](_[_0x101d('0x51')](_0x78d9c4['query'],_0x3802fd[_0x101d('0x35')]));if(_0x78d9c4[_0x101d('0x33')][_0x101d('0x40')]){_0x2a9789[_0x101d('0x3f')]=_[_0x101d('0x41')](_0x2a9789[_0x101d('0x3f')],{'$or':_['map'](_0x2a9789[_0x101d('0x37')],function(_0x5a6856){var _0xd2be3f={};_0xd2be3f[_0x5a6856]={'$like':'%'+_0x78d9c4[_0x101d('0x33')][_0x101d('0x40')]+'%'};return _0xd2be3f;})});}_0x2a9789=_[_0x101d('0x41')]({},_0x2a9789,_0x78d9c4['options']);return _0x31fb01[_0x101d('0x57')](_0x2a9789);}})[_0x101d('0x27')](function(_0x503d7e){if(_0x503d7e){_0x49d635=_0x503d7e[_0x101d('0x3a')];if(!_0x78d9c4[_0x101d('0x33')][_0x101d('0x3b')](_0x101d('0x3c'))){_0x2a9789['limit']=qs[_0x101d('0x3d')](_0x78d9c4[_0x101d('0x33')][_0x101d('0x3d')]);_0x2a9789[_0x101d('0x1e')]=qs[_0x101d('0x1e')](_0x78d9c4[_0x101d('0x33')][_0x101d('0x1e')]);}return _0x31fb01['getTags'](_0x2a9789);}})[_0x101d('0x27')](function(_0xa909ef){if(_0xa909ef){return _0xa909ef?{'count':_0x49d635,'rows':_0xa909ef}:null;}})[_0x101d('0x27')](respondWithResult(_0x474f65,null))['catch'](handleError(_0x474f65,null));};exports[_0x101d('0x58')]=function(_0x25804c,_0x50caf3,_0x468f51){if(_0x25804c[_0x101d('0x4e')]['id']){delete _0x25804c[_0x101d('0x4e')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x25804c[_0x101d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50caf3,null))[_0x101d('0x27')](function(_0x567e42){if(_0x567e42){return _0x567e42[_0x101d('0x58')](_0x25804c[_0x101d('0x4e')][_0x101d('0x59')]||[]);}return null;})[_0x101d('0x27')](respondWithResult(_0x50caf3,null))[_0x101d('0x49')](handleError(_0x50caf3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1d05f51..a33051e 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 _0x9712=['rimraf','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xacb13b,_0x5548b3){var _0x4f5b00=function(_0xad3ae6){while(--_0xad3ae6){_0xacb13b['push'](_0xacb13b['shift']());}};_0x4f5b00(++_0x5548b3);}(_0x9712,0xd1));var _0x2971=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x9712[_0x3f3a47];return _0x57a682;};'use strict';var _=require('lodash');var util=require(_0x2971('0x0'));var logger=require(_0x2971('0x1'))(_0x2971('0x2'));var moment=require(_0x2971('0x3'));var BPromise=require(_0x2971('0x4'));var rp=require(_0x2971('0x5'));var fs=require('fs');var path=require(_0x2971('0x6'));var rimraf=require(_0x2971('0x7'));var config=require('../../config/environment');var attributes=require(_0x2971('0x8'));module['exports']=function(_0x31e3c2,_0x2e83ba){return _0x31e3c2[_0x2971('0x9')](_0x2971('0xa'),attributes,{'tableName':_0x2971('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d63=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2575d8,_0x30d5ac){var _0x19e6c8=function(_0x260717){while(--_0x260717){_0x2575d8['push'](_0x2575d8['shift']());}};_0x19e6c8(++_0x30d5ac);}(_0x6d63,0x1ab));var _0x36d6=function(_0x2b339f,_0x5cca3b){_0x2b339f=_0x2b339f-0x0;var _0x38d409=_0x6d63[_0x2b339f];return _0x38d409;};'use strict';var _=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var logger=require(_0x36d6('0x2'))(_0x36d6('0x3'));var moment=require(_0x36d6('0x4'));var BPromise=require(_0x36d6('0x5'));var rp=require(_0x36d6('0x6'));var fs=require('fs');var path=require(_0x36d6('0x7'));var rimraf=require(_0x36d6('0x8'));var config=require(_0x36d6('0x9'));var attributes=require(_0x36d6('0xa'));module[_0x36d6('0xb')]=function(_0x4a63a9,_0x3a652e){return _0x4a63a9[_0x36d6('0xc')](_0x36d6('0xd'),attributes,{'tableName':_0x36d6('0xe'),'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 2edcf2b..106c880 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 _0x7d95=['http','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x19107b,_0x366bf6){var _0x3bd484=function(_0x100cb3){while(--_0x100cb3){_0x19107b['push'](_0x19107b['shift']());}};_0x3bd484(++_0x366bf6);}(_0x7d95,0xfc));var _0x57d9=function(_0x5ec09b,_0x12d654){_0x5ec09b=_0x5ec09b-0x0;var _0x5a8482=_0x7d95[_0x5ec09b];return _0x5a8482;};'use strict';var _=require('lodash');var util=require(_0x57d9('0x0'));var moment=require(_0x57d9('0x1'));var BPromise=require(_0x57d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x57d9('0x4'))(_0x57d9('0x5'));var config=require('../../config/environment');var jayson=require(_0x57d9('0x6'));var client=jayson[_0x57d9('0x7')][_0x57d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58c366,_0x63ad4c,_0x32b537){return new BPromise(function(_0xc038d4,_0x50a6cd){return client['request'](_0x58c366,_0x32b537)['then'](function(_0x1394fc){logger['info'](_0x57d9('0x9'),_0x63ad4c,_0x57d9('0xa'));logger[_0x57d9('0xb')](_0x57d9('0xc'),_0x63ad4c,_0x57d9('0xa'),JSON[_0x57d9('0xd')](_0x1394fc));if(_0x1394fc[_0x57d9('0xe')]){if(_0x1394fc[_0x57d9('0xe')][_0x57d9('0xf')]===0x1f4){logger[_0x57d9('0xe')](_0x57d9('0x9'),_0x63ad4c,_0x1394fc['error']['message']);return _0x50a6cd(_0x1394fc['error'][_0x57d9('0x10')]);}logger[_0x57d9('0xe')](_0x57d9('0x9'),_0x63ad4c,_0x1394fc['error'][_0x57d9('0x10')]);return _0xc038d4(_0x1394fc[_0x57d9('0xe')][_0x57d9('0x10')]);}else{logger[_0x57d9('0x11')](_0x57d9('0x9'),_0x63ad4c,_0x57d9('0xa'));_0xc038d4(_0x1394fc[_0x57d9('0x12')][_0x57d9('0x10')]);}})[_0x57d9('0x13')](function(_0x388a7c){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x63ad4c,_0x388a7c);_0x50a6cd(_0x388a7c);});});} \ No newline at end of file +var _0x0cb9=['FreshdeskConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2df74c,_0x42b9cb){var _0x219cc6=function(_0x1a2d86){while(--_0x1a2d86){_0x2df74c['push'](_0x2df74c['shift']());}};_0x219cc6(++_0x42b9cb);}(_0x0cb9,0x65));var _0x90cb=function(_0x5820ce,_0x5a1a1e){_0x5820ce=_0x5820ce-0x0;var _0x1adef1=_0x0cb9[_0x5820ce];return _0x1adef1;};'use strict';var _=require('lodash');var util=require(_0x90cb('0x0'));var moment=require(_0x90cb('0x1'));var BPromise=require(_0x90cb('0x2'));var rs=require(_0x90cb('0x3'));var fs=require('fs');var Redis=require(_0x90cb('0x4'));var db=require(_0x90cb('0x5'))['db'];var utils=require(_0x90cb('0x6'));var logger=require(_0x90cb('0x7'))(_0x90cb('0x8'));var config=require(_0x90cb('0x9'));var jayson=require(_0x90cb('0xa'));var client=jayson[_0x90cb('0xb')][_0x90cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b91e3,_0x2c038b,_0x14c72c){return new BPromise(function(_0x120092,_0x387b91){return client[_0x90cb('0xd')](_0x3b91e3,_0x14c72c)['then'](function(_0x57d338){logger['info'](_0x90cb('0xe'),_0x2c038b,'request\x20sent');logger[_0x90cb('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2c038b,'request\x20sent',JSON[_0x90cb('0x10')](_0x57d338));if(_0x57d338[_0x90cb('0x11')]){if(_0x57d338[_0x90cb('0x11')][_0x90cb('0x12')]===0x1f4){logger[_0x90cb('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c038b,_0x57d338[_0x90cb('0x11')]['message']);return _0x387b91(_0x57d338['error'][_0x90cb('0x13')]);}logger[_0x90cb('0x11')](_0x90cb('0xe'),_0x2c038b,_0x57d338[_0x90cb('0x11')][_0x90cb('0x13')]);return _0x120092(_0x57d338[_0x90cb('0x11')][_0x90cb('0x13')]);}else{logger['info'](_0x90cb('0xe'),_0x2c038b,_0x90cb('0x14'));_0x120092(_0x57d338[_0x90cb('0x15')][_0x90cb('0x13')]);}})[_0x90cb('0x16')](function(_0xd8452d){logger['error'](_0x90cb('0xe'),_0x2c038b,_0xd8452d);_0x387b91(_0xd8452d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d6f0569..1363516 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 _0xbf86=['isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller'];(function(_0x33baca,_0x1addef){var _0x34dfb8=function(_0x5a6aca){while(--_0x5a6aca){_0x33baca['push'](_0x33baca['shift']());}};_0x34dfb8(++_0x1addef);}(_0xbf86,0x106));var _0x6bf8=function(_0x90d794,_0xf3931b){_0x90d794=_0x90d794-0x0;var _0x1b05a5=_0xbf86[_0x90d794];return _0x1b05a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6bf8('0x0'));var timeout=require(_0x6bf8('0x1'));var express=require(_0x6bf8('0x2'));var router=express[_0x6bf8('0x3')]();var fs_extra=require(_0x6bf8('0x4'));var auth=require(_0x6bf8('0x5'));var interaction=require(_0x6bf8('0x6'));var config=require('../../config/environment');var controller=require(_0x6bf8('0x7'));router['get']('/',auth[_0x6bf8('0x8')](),controller[_0x6bf8('0x9')]);router[_0x6bf8('0xa')](_0x6bf8('0xb'),auth[_0x6bf8('0x8')](),controller[_0x6bf8('0xc')]);router['post']('/',auth[_0x6bf8('0x8')](),controller[_0x6bf8('0xd')]);router[_0x6bf8('0xe')](_0x6bf8('0xb'),auth[_0x6bf8('0x8')](),controller[_0x6bf8('0xf')]);router[_0x6bf8('0x10')]('/:id',auth[_0x6bf8('0x8')](),controller[_0x6bf8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x04a5=['express','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x27b699,_0x57c975){var _0x7d3530=function(_0x4f2bbb){while(--_0x4f2bbb){_0x27b699['push'](_0x27b699['shift']());}};_0x7d3530(++_0x57c975);}(_0x04a5,0xba));var _0x504a=function(_0x5b45da,_0x52bb87){_0x5b45da=_0x5b45da-0x0;var _0x2327f7=_0x04a5[_0x5b45da];return _0x2327f7;};'use strict';var multer=require(_0x504a('0x0'));var util=require(_0x504a('0x1'));var path=require(_0x504a('0x2'));var timeout=require(_0x504a('0x3'));var express=require(_0x504a('0x4'));var router=express[_0x504a('0x5')]();var fs_extra=require(_0x504a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x504a('0x7'));var config=require('../../config/environment');var controller=require(_0x504a('0x8'));router[_0x504a('0x9')]('/',auth['isAuthenticated'](),controller[_0x504a('0xa')]);router[_0x504a('0x9')](_0x504a('0xb'),auth[_0x504a('0xc')](),controller[_0x504a('0xd')]);router[_0x504a('0xe')]('/',auth[_0x504a('0xc')](),controller[_0x504a('0xf')]);router['put'](_0x504a('0xb'),auth[_0x504a('0xc')](),controller[_0x504a('0x10')]);router['delete'](_0x504a('0xb'),auth[_0x504a('0xc')](),controller[_0x504a('0x11')]);module[_0x504a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2d49401..0ca3746 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 _0xab35=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xab35,0x12a));var _0x5ab3=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xab35[_0x26fc81];return _0x9feece;};'use strict';var Sequelize=require(_0x5ab3('0x0'));module[_0x5ab3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ab3('0x2'),_0x5ab3('0x3'),_0x5ab3('0x4'),_0x5ab3('0x5'),_0x5ab3('0x6')),'defaultValue':_0x5ab3('0x2')},'content':{'type':Sequelize[_0x5ab3('0x7')]},'key':{'type':Sequelize[_0x5ab3('0x7')]},'keyType':{'type':Sequelize[_0x5ab3('0x8')](_0x5ab3('0x2'),_0x5ab3('0x3'),_0x5ab3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5ab3('0x7')]},'nameField':{'type':Sequelize[_0x5ab3('0x7')]},'customField':{'type':Sequelize[_0x5ab3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5ab3('0x7')]}}; \ No newline at end of file +var _0xe22e=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xe22e,0xd5));var _0xee22=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0xe22e[_0x4991d6];return _0x50faf7;};'use strict';var Sequelize=require(_0xee22('0x0'));module[_0xee22('0x1')]={'type':{'type':Sequelize[_0xee22('0x2')](_0xee22('0x3'),_0xee22('0x4'),_0xee22('0x5'),_0xee22('0x6'),_0xee22('0x7')),'defaultValue':_0xee22('0x3')},'content':{'type':Sequelize[_0xee22('0x8')]},'key':{'type':Sequelize[_0xee22('0x8')]},'keyType':{'type':Sequelize[_0xee22('0x2')](_0xee22('0x3'),_0xee22('0x4'),_0xee22('0x5'))},'keyContent':{'type':Sequelize[_0xee22('0x8')]},'idField':{'type':Sequelize[_0xee22('0x8')]},'nameField':{'type':Sequelize[_0xee22('0x8')]},'customField':{'type':Sequelize[_0xee22('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee22('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e30321c..afb360c 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 _0x7fce=['merge','VIRTUAL','includeAll','include','FreshdeskField','findAll','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter'];(function(_0x91f87d,_0x420208){var _0x57ae72=function(_0x38aae4){while(--_0x38aae4){_0x91f87d['push'](_0x91f87d['shift']());}};_0x57ae72(++_0x420208);}(_0x7fce,0xdc));var _0xe7fc=function(_0x2d916c,_0x5ca422){_0x2d916c=_0x2d916c-0x0;var _0x21d6cf=_0x7fce[_0x2d916c];return _0x21d6cf;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x12ebdd,_0x5255b7){return function(_0x2d9e77){if(!_0x2d9e77){_0x12ebdd[_0xe7fc('0x22')](0x194);}return _0x2d9e77;};}function handleError(_0x416464,_0x3be1fd){_0x3be1fd=_0x3be1fd||0x1f4;return function(_0x2249ed){logger[_0xe7fc('0x23')](_0x2249ed['stack']);if(_0x2249ed[_0xe7fc('0x24')]){delete _0x2249ed[_0xe7fc('0x24')];}_0x416464[_0xe7fc('0x16')](_0x3be1fd)[_0xe7fc('0x25')](_0x2249ed);};}exports[_0xe7fc('0x26')]=function(_0x4416b5,_0x383ca6){var _0x4da084={},_0x36a68b={},_0x2a08a4={'count':0x0,'rows':[]};var _0x512518=_[_0xe7fc('0x27')](db['FreshdeskField'][_0xe7fc('0x28')],function(_0x27255a){return{'name':_0x27255a['fieldName'],'type':_0x27255a[_0xe7fc('0x29')]['key']};});_0x36a68b[_0xe7fc('0x2a')]=_[_0xe7fc('0x27')](_0x512518,_0xe7fc('0x24'));_0x36a68b['query']=_[_0xe7fc('0x2b')](_0x4416b5['query']);_0x36a68b[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x36a68b['model'],_0x36a68b['query']);_0x4da084['attributes']=_['intersection'](_0x36a68b[_0xe7fc('0x2a')],qs[_0xe7fc('0x2e')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x4da084[_0xe7fc('0x30')]=_0x4da084[_0xe7fc('0x30')][_0xe7fc('0x31')]?_0x4da084[_0xe7fc('0x30')]:_0x36a68b[_0xe7fc('0x2a')];if(!_0x4416b5[_0xe7fc('0x2f')]['hasOwnProperty'](_0xe7fc('0x32'))){_0x4da084[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x19')]);_0x4da084['offset']=qs[_0xe7fc('0x17')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x17')]);}_0x4da084[_0xe7fc('0x33')]=qs[_0xe7fc('0x34')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x34')]);_0x4da084[_0xe7fc('0x35')]=qs[_0xe7fc('0x2c')](_[_0xe7fc('0x36')](_0x4416b5[_0xe7fc('0x2f')],_0x36a68b[_0xe7fc('0x2c')]),_0x512518);if(_0x4416b5['query'][_0xe7fc('0x37')]){_0x4da084[_0xe7fc('0x35')]=_[_0xe7fc('0x38')](_0x4da084[_0xe7fc('0x35')],{'$or':_[_0xe7fc('0x27')](_0x512518,function(_0x4ed2e4){if(_0x4ed2e4[_0xe7fc('0x29')]!==_0xe7fc('0x39')){var _0x112bb9={};_0x112bb9[_0x4ed2e4[_0xe7fc('0x24')]]={'$like':'%'+_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x37')]+'%'};return _0x112bb9;}})});}_0x4da084=_['merge']({},_0x4da084,_0x4416b5['options']);var _0x582053={'where':_0x4da084['where']};return db['FreshdeskField'][_0xe7fc('0x1a')](_0x582053)[_0xe7fc('0x20')](function(_0x4cc33f){_0x2a08a4[_0xe7fc('0x1a')]=_0x4cc33f;if(_0x4416b5['query'][_0xe7fc('0x3a')]){_0x4da084[_0xe7fc('0x3b')]=[{'all':!![]}];}return db[_0xe7fc('0x3c')][_0xe7fc('0x3d')](_0x4da084);})[_0xe7fc('0x20')](function(_0x3e35c7){_0x2a08a4['rows']=_0x3e35c7;return _0x2a08a4;})[_0xe7fc('0x20')](respondWithFilteredResult(_0x383ca6,_0x4da084))['catch'](handleError(_0x383ca6,null));};exports[_0xe7fc('0x3e')]=function(_0x381bb4,_0x533f26){var _0x636368={'raw':!![],'where':{'id':_0x381bb4[_0xe7fc('0x3f')]['id']}},_0x3ce7ad={};_0x3ce7ad[_0xe7fc('0x2a')]=_[_0xe7fc('0x2b')](db[_0xe7fc('0x3c')][_0xe7fc('0x28')]);_0x3ce7ad[_0xe7fc('0x2f')]=_[_0xe7fc('0x2b')](_0x381bb4[_0xe7fc('0x2f')]);_0x3ce7ad[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],_0x3ce7ad[_0xe7fc('0x2f')]);_0x636368[_0xe7fc('0x30')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],qs['fields'](_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x636368[_0xe7fc('0x30')]=_0x636368['attributes'][_0xe7fc('0x31')]?_0x636368[_0xe7fc('0x30')]:_0x3ce7ad[_0xe7fc('0x2a')];if(_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x3a')]){_0x636368['include']=[{'all':!![]}];}_0x636368=_['merge']({},_0x636368,_0x381bb4[_0xe7fc('0x40')]);return db[_0xe7fc('0x3c')][_0xe7fc('0x41')](_0x636368)[_0xe7fc('0x20')](handleEntityNotFound(_0x533f26,null))[_0xe7fc('0x20')](respondWithResult(_0x533f26,null))['catch'](handleError(_0x533f26,null));};exports[_0xe7fc('0x42')]=function(_0x2dd594,_0x2807ff){return db[_0xe7fc('0x3c')][_0xe7fc('0x42')](_0x2dd594[_0xe7fc('0x43')],{})[_0xe7fc('0x20')](respondWithResult(_0x2807ff,0xc9))[_0xe7fc('0x44')](handleError(_0x2807ff,null));};exports[_0xe7fc('0x1f')]=function(_0x45edbf,_0x533f31){if(_0x45edbf[_0xe7fc('0x43')]['id']){delete _0x45edbf['body']['id'];}return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x45edbf[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x533f31,null))[_0xe7fc('0x20')](saveUpdates(_0x45edbf[_0xe7fc('0x43')],null))[_0xe7fc('0x20')](respondWithResult(_0x533f31,null))[_0xe7fc('0x44')](handleError(_0x533f31,null));};exports[_0xe7fc('0x21')]=function(_0x535afb,_0x63a8bf){return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x535afb[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x63a8bf,null))[_0xe7fc('0x20')](removeEntity(_0x63a8bf,null))['catch'](handleError(_0x63a8bf,null));}; \ No newline at end of file +var _0x7d98=['pick','filter','merge','where','include','FreshdeskField','findAll','rows','show','rawAttributes','create','body','catch','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','name','send','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5da398,_0x13a526){var _0x4db43a=function(_0x377646){while(--_0x377646){_0x5da398['push'](_0x5da398['shift']());}};_0x4db43a(++_0x13a526);}(_0x7d98,0xe7));var _0x87d9=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x7d98[_0x2de0a7];return _0x429437;};'use strict';var emlformat=require(_0x87d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87d9('0x1'));var jsonpatch=require(_0x87d9('0x2'));var rp=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x87d9('0x5'));var util=require(_0x87d9('0x6'));var path=require('path');var sox=require(_0x87d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d9('0x8'));var squel=require(_0x87d9('0x9'));var crypto=require(_0x87d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x87d9('0xb'));var toCsv=require(_0x87d9('0xc'));var querystring=require(_0x87d9('0xd'));var Papa=require('papaparse');var Redis=require(_0x87d9('0xe'));var authService=require(_0x87d9('0xf'));var qs=require(_0x87d9('0x10'));var as=require(_0x87d9('0x11'));var hardwareService=require(_0x87d9('0x12'));var logger=require(_0x87d9('0x13'))(_0x87d9('0x14'));var utils=require(_0x87d9('0x15'));var config=require(_0x87d9('0x16'));var licenseUtil=require(_0x87d9('0x17'));var db=require(_0x87d9('0x18'))['db'];function respondWithStatusCode(_0x22f32d,_0x38f33e){_0x38f33e=_0x38f33e||0xcc;return function(_0x22758){if(_0x22758){return _0x22f32d[_0x87d9('0x19')](_0x38f33e);}return _0x22f32d[_0x87d9('0x1a')](_0x38f33e)[_0x87d9('0x1b')]();};}function respondWithResult(_0x185401,_0x380836){_0x380836=_0x380836||0xc8;return function(_0x27d61d){if(_0x27d61d){return _0x185401['status'](_0x380836)['json'](_0x27d61d);}};}function respondWithFilteredResult(_0x9e9e53,_0xaa910c){return function(_0x3231e7){if(_0x3231e7){var _0x501d32=typeof _0xaa910c['offset']===_0x87d9('0x1c')&&typeof _0xaa910c[_0x87d9('0x1d')]===_0x87d9('0x1c');var _0x23ae47=_0x3231e7[_0x87d9('0x1e')];var _0xebc1eb=_0x501d32?0x0:_0xaa910c[_0x87d9('0x1f')];var _0x1f33a3=_0x501d32?_0x3231e7[_0x87d9('0x1e')]:_0xaa910c[_0x87d9('0x1f')]+_0xaa910c[_0x87d9('0x1d')];var _0x5d6da1;if(_0x1f33a3>=_0x23ae47){_0x1f33a3=_0x23ae47;_0x5d6da1=0xc8;}else{_0x5d6da1=0xce;}_0x9e9e53[_0x87d9('0x1a')](_0x5d6da1);return _0x9e9e53['set'](_0x87d9('0x20'),_0xebc1eb+'-'+_0x1f33a3+'/'+_0x23ae47)[_0x87d9('0x21')](_0x3231e7);}return null;};}function patchUpdates(_0x334d31){return function(_0x57bef6){try{jsonpatch['apply'](_0x57bef6,_0x334d31,!![]);}catch(_0x545241){return BPromise[_0x87d9('0x22')](_0x545241);}return _0x57bef6[_0x87d9('0x23')]();};}function saveUpdates(_0x28aaaa,_0x6ab839){return function(_0xc82b02){if(_0xc82b02){return _0xc82b02[_0x87d9('0x24')](_0x28aaaa)[_0x87d9('0x25')](function(_0x3b24e7){return _0x3b24e7;});}return null;};}function removeEntity(_0x1c550c,_0x4c0f7a){return function(_0x31e1b2){if(_0x31e1b2){return _0x31e1b2[_0x87d9('0x26')]()[_0x87d9('0x25')](function(){_0x1c550c[_0x87d9('0x1a')](0xcc)[_0x87d9('0x1b')]();});}};}function handleEntityNotFound(_0x340462,_0x3641c8){return function(_0x32b83f){if(!_0x32b83f){_0x340462['sendStatus'](0x194);}return _0x32b83f;};}function handleError(_0x8b1ab7,_0x600404){_0x600404=_0x600404||0x1f4;return function(_0x2f63fa){logger[_0x87d9('0x27')](_0x2f63fa['stack']);if(_0x2f63fa[_0x87d9('0x28')]){delete _0x2f63fa[_0x87d9('0x28')];}_0x8b1ab7[_0x87d9('0x1a')](_0x600404)[_0x87d9('0x29')](_0x2f63fa);};}exports['index']=function(_0x21916a,_0x3c0283){var _0x501c5={},_0x5e1b55={},_0x1d04a9={'count':0x0,'rows':[]};var _0x22a401=_['map'](db['FreshdeskField']['rawAttributes'],function(_0x31122b){return{'name':_0x31122b[_0x87d9('0x2a')],'type':_0x31122b['type'][_0x87d9('0x2b')]};});_0x5e1b55['model']=_[_0x87d9('0x2c')](_0x22a401,'name');_0x5e1b55[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x21916a['query']);_0x5e1b55[_0x87d9('0x2f')]=_['intersection'](_0x5e1b55[_0x87d9('0x30')],_0x5e1b55[_0x87d9('0x2d')]);_0x501c5[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x5e1b55[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x21916a['query'][_0x87d9('0x33')]));_0x501c5[_0x87d9('0x31')]=_0x501c5[_0x87d9('0x31')][_0x87d9('0x34')]?_0x501c5[_0x87d9('0x31')]:_0x5e1b55[_0x87d9('0x30')];if(!_0x21916a[_0x87d9('0x2d')][_0x87d9('0x35')](_0x87d9('0x36'))){_0x501c5['limit']=qs[_0x87d9('0x1d')](_0x21916a[_0x87d9('0x2d')][_0x87d9('0x1d')]);_0x501c5[_0x87d9('0x1f')]=qs[_0x87d9('0x1f')](_0x21916a['query'][_0x87d9('0x1f')]);}_0x501c5[_0x87d9('0x37')]=qs[_0x87d9('0x38')](_0x21916a['query'][_0x87d9('0x38')]);_0x501c5['where']=qs[_0x87d9('0x2f')](_[_0x87d9('0x39')](_0x21916a[_0x87d9('0x2d')],_0x5e1b55[_0x87d9('0x2f')]),_0x22a401);if(_0x21916a['query'][_0x87d9('0x3a')]){_0x501c5['where']=_[_0x87d9('0x3b')](_0x501c5[_0x87d9('0x3c')],{'$or':_[_0x87d9('0x2c')](_0x22a401,function(_0x1af8eb){if(_0x1af8eb['type']!=='VIRTUAL'){var _0x2063de={};_0x2063de[_0x1af8eb['name']]={'$like':'%'+_0x21916a[_0x87d9('0x2d')]['filter']+'%'};return _0x2063de;}})});}_0x501c5=_[_0x87d9('0x3b')]({},_0x501c5,_0x21916a['options']);var _0xdf56e8={'where':_0x501c5[_0x87d9('0x3c')]};return db['FreshdeskField'][_0x87d9('0x1e')](_0xdf56e8)['then'](function(_0x4bc1ba){_0x1d04a9['count']=_0x4bc1ba;if(_0x21916a[_0x87d9('0x2d')]['includeAll']){_0x501c5[_0x87d9('0x3d')]=[{'all':!![]}];}return db[_0x87d9('0x3e')][_0x87d9('0x3f')](_0x501c5);})['then'](function(_0x915f05){_0x1d04a9[_0x87d9('0x40')]=_0x915f05;return _0x1d04a9;})[_0x87d9('0x25')](respondWithFilteredResult(_0x3c0283,_0x501c5))['catch'](handleError(_0x3c0283,null));};exports[_0x87d9('0x41')]=function(_0x58ec85,_0x5c2db5){var _0x59338e={'raw':!![],'where':{'id':_0x58ec85['params']['id']}},_0x39e807={};_0x39e807['model']=_[_0x87d9('0x2e')](db[_0x87d9('0x3e')][_0x87d9('0x42')]);_0x39e807[_0x87d9('0x2d')]=_[_0x87d9('0x2e')](_0x58ec85['query']);_0x39e807[_0x87d9('0x2f')]=_[_0x87d9('0x32')](_0x39e807['model'],_0x39e807['query']);_0x59338e[_0x87d9('0x31')]=_[_0x87d9('0x32')](_0x39e807[_0x87d9('0x30')],qs[_0x87d9('0x33')](_0x58ec85[_0x87d9('0x2d')][_0x87d9('0x33')]));_0x59338e[_0x87d9('0x31')]=_0x59338e[_0x87d9('0x31')]['length']?_0x59338e[_0x87d9('0x31')]:_0x39e807[_0x87d9('0x30')];if(_0x58ec85['query']['includeAll']){_0x59338e[_0x87d9('0x3d')]=[{'all':!![]}];}_0x59338e=_[_0x87d9('0x3b')]({},_0x59338e,_0x58ec85['options']);return db[_0x87d9('0x3e')]['find'](_0x59338e)['then'](handleEntityNotFound(_0x5c2db5,null))['then'](respondWithResult(_0x5c2db5,null))['catch'](handleError(_0x5c2db5,null));};exports[_0x87d9('0x43')]=function(_0x101446,_0x533a74){return db[_0x87d9('0x3e')][_0x87d9('0x43')](_0x101446[_0x87d9('0x44')],{})['then'](respondWithResult(_0x533a74,0xc9))[_0x87d9('0x45')](handleError(_0x533a74,null));};exports[_0x87d9('0x24')]=function(_0x2d4766,_0x384273){if(_0x2d4766[_0x87d9('0x44')]['id']){delete _0x2d4766[_0x87d9('0x44')]['id'];}return db['FreshdeskField'][_0x87d9('0x46')]({'where':{'id':_0x2d4766['params']['id']}})['then'](handleEntityNotFound(_0x384273,null))[_0x87d9('0x25')](saveUpdates(_0x2d4766[_0x87d9('0x44')],null))[_0x87d9('0x25')](respondWithResult(_0x384273,null))[_0x87d9('0x45')](handleError(_0x384273,null));};exports[_0x87d9('0x26')]=function(_0x4fdfa9,_0x4558f5){return db[_0x87d9('0x3e')][_0x87d9('0x46')]({'where':{'id':_0x4fdfa9[_0x87d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4558f5,null))[_0x87d9('0x25')](removeEntity(_0x4558f5,null))[_0x87d9('0x45')](handleError(_0x4558f5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 122204b..bf30c97 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 _0x5a7f=['path','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0xc7eddf,_0x474776){var _0x1d91a3=function(_0x375a5f){while(--_0x375a5f){_0xc7eddf['push'](_0xc7eddf['shift']());}};_0x1d91a3(++_0x474776);}(_0x5a7f,0xaf));var _0xf5a7=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5a7f[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xf5a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5a7('0x1'));var moment=require(_0xf5a7('0x2'));var BPromise=require(_0xf5a7('0x3'));var rp=require(_0xf5a7('0x4'));var fs=require('fs');var path=require(_0xf5a7('0x5'));var rimraf=require('rimraf');var config=require(_0xf5a7('0x6'));var attributes=require(_0xf5a7('0x7'));module[_0xf5a7('0x8')]=function(_0x54e2a1,_0x4fca30){return _0x54e2a1[_0xf5a7('0x9')](_0xf5a7('0xa'),attributes,{'tableName':_0xf5a7('0xb'),'paranoid':![],'indexes':[{'name':_0xf5a7('0xc'),'fields':[_0xf5a7('0xd'),_0xf5a7('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5541=['define','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x155d11,_0x4d3ab3){var _0x43d193=function(_0x53c4e5){while(--_0x53c4e5){_0x155d11['push'](_0x155d11['shift']());}};_0x43d193(++_0x4d3ab3);}(_0x5541,0x184));var _0x1554=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0x5541[_0x4370c7];return _0xce78a9;};'use strict';var _=require(_0x1554('0x0'));var util=require(_0x1554('0x1'));var logger=require(_0x1554('0x2'))(_0x1554('0x3'));var moment=require('moment');var BPromise=require(_0x1554('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1554('0x5'));var rimraf=require('rimraf');var config=require(_0x1554('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x1554('0x7')]=function(_0x32cdaa,_0x4c1cf7){return _0x32cdaa[_0x1554('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x1554('0x9'),_0x1554('0xa')],'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 434b43e..ce6954c 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 _0xc3f0=['info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x9e7ef5,_0x4f3a5f){var _0x3bc196=function(_0x40106c){while(--_0x40106c){_0x9e7ef5['push'](_0x9e7ef5['shift']());}};_0x3bc196(++_0x4f3a5f);}(_0xc3f0,0x1d7));var _0x0c3f=function(_0x45dfc5,_0x4f7557){_0x45dfc5=_0x45dfc5-0x0;var _0x3e3252=_0xc3f0[_0x45dfc5];return _0x3e3252;};'use strict';var _=require(_0x0c3f('0x0'));var util=require('util');var moment=require(_0x0c3f('0x1'));var BPromise=require(_0x0c3f('0x2'));var rs=require(_0x0c3f('0x3'));var fs=require('fs');var Redis=require(_0x0c3f('0x4'));var db=require(_0x0c3f('0x5'))['db'];var utils=require(_0x0c3f('0x6'));var logger=require(_0x0c3f('0x7'))('rpc');var config=require(_0x0c3f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0c3f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29f30b,_0x200382,_0x4f7470){return new BPromise(function(_0x15fabb,_0x55dd66){return client[_0x0c3f('0xa')](_0x29f30b,_0x4f7470)[_0x0c3f('0xb')](function(_0x7fdc08){logger[_0x0c3f('0xc')](_0x0c3f('0xd'),_0x200382,_0x0c3f('0xe'));logger[_0x0c3f('0xf')](_0x0c3f('0x10'),_0x200382,_0x0c3f('0xe'),JSON[_0x0c3f('0x11')](_0x7fdc08));if(_0x7fdc08[_0x0c3f('0x12')]){if(_0x7fdc08[_0x0c3f('0x12')][_0x0c3f('0x13')]===0x1f4){logger[_0x0c3f('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x200382,_0x7fdc08[_0x0c3f('0x12')][_0x0c3f('0x14')]);return _0x55dd66(_0x7fdc08[_0x0c3f('0x12')][_0x0c3f('0x14')]);}logger[_0x0c3f('0x12')](_0x0c3f('0xd'),_0x200382,_0x7fdc08[_0x0c3f('0x12')][_0x0c3f('0x14')]);return _0x15fabb(_0x7fdc08[_0x0c3f('0x12')][_0x0c3f('0x14')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x200382,_0x0c3f('0xe'));_0x15fabb(_0x7fdc08['result']['message']);}})['catch'](function(_0x2055ab){logger[_0x0c3f('0x12')](_0x0c3f('0xd'),_0x200382,_0x2055ab);_0x55dd66(_0x2055ab);});});} \ No newline at end of file +var _0x09de=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x24cee5,_0x4790b6){var _0x1ad152=function(_0x419fc3){while(--_0x419fc3){_0x24cee5['push'](_0x24cee5['shift']());}};_0x1ad152(++_0x4790b6);}(_0x09de,0xbc));var _0xe09d=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0x09de[_0x3f25b2];return _0xd8caeb;};'use strict';var _=require(_0xe09d('0x0'));var util=require(_0xe09d('0x1'));var moment=require('moment');var BPromise=require(_0xe09d('0x2'));var rs=require(_0xe09d('0x3'));var fs=require('fs');var Redis=require(_0xe09d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe09d('0x5'));var logger=require(_0xe09d('0x6'))(_0xe09d('0x7'));var config=require(_0xe09d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe09d('0x9')][_0xe09d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17da0b,_0x3041f6,_0x299880){return new BPromise(function(_0x50823c,_0x290793){return client[_0xe09d('0xb')](_0x17da0b,_0x299880)[_0xe09d('0xc')](function(_0x44c92e){logger['info'](_0xe09d('0xd'),_0x3041f6,_0xe09d('0xe'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3041f6,_0xe09d('0xe'),JSON[_0xe09d('0xf')](_0x44c92e));if(_0x44c92e[_0xe09d('0x10')]){if(_0x44c92e['error'][_0xe09d('0x11')]===0x1f4){logger[_0xe09d('0x10')](_0xe09d('0xd'),_0x3041f6,_0x44c92e[_0xe09d('0x10')]['message']);return _0x290793(_0x44c92e['error'][_0xe09d('0x12')]);}logger['error'](_0xe09d('0xd'),_0x3041f6,_0x44c92e[_0xe09d('0x10')]['message']);return _0x50823c(_0x44c92e['error'][_0xe09d('0x12')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x3041f6,_0xe09d('0xe'));_0x50823c(_0x44c92e[_0xe09d('0x13')]['message']);}})[_0xe09d('0x14')](function(_0x4c8fdf){logger[_0xe09d('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x3041f6,_0x4c8fdf);_0x290793(_0x4c8fdf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8531fc9..17a828e 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 _0x80ed=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','multer','path'];(function(_0x55a26f,_0x16f9bd){var _0x32590e=function(_0x52c912){while(--_0x52c912){_0x55a26f['push'](_0x55a26f['shift']());}};_0x32590e(++_0x16f9bd);}(_0x80ed,0x11c));var _0xd80e=function(_0x2f54ac,_0x460894){_0x2f54ac=_0x2f54ac-0x0;var _0xf5c1d9=_0x80ed[_0x2f54ac];return _0xf5c1d9;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getFields']);router[_0xd80e('0x10')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x10')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x12')]);router[_0xd80e('0x13')](_0xd80e('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd80e('0x9')](),controller[_0xd80e('0x14')]);module[_0xd80e('0x15')]=router; \ No newline at end of file +var _0x750a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','put','delete','destroy','exports'];(function(_0x314e16,_0x109b3b){var _0x2b76a5=function(_0x34eabe){while(--_0x34eabe){_0x314e16['push'](_0x314e16['shift']());}};_0x2b76a5(++_0x109b3b);}(_0x750a,0x140));var _0xa750=function(_0x2da711,_0x4ea6d5){_0x2da711=_0x2da711-0x0;var _0x4ca850=_0x750a[_0x2da711];return _0x4ca850;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/fields',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router['post'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['addConfiguration']);router[_0xa750('0x10')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['update']);router[_0xa750('0x11')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);module[_0xa750('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a42ecf6..6d69969 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 _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x4fcf57,_0x14d709){var _0x3b182d=function(_0x511540){while(--_0x511540){_0x4fcf57['push'](_0x4fcf57['shift']());}};_0x3b182d(++_0x14d709);}(_0x4991,0xf7));var _0x1499=function(_0x485635,_0x42a428){_0x485635=_0x485635-0x0;var _0x577a4f=_0x4991[_0x485635];return _0x577a4f;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xfff0=['username','exports','STRING'];(function(_0x5a03fa,_0xcf3275){var _0x29e6c2=function(_0x10638b){while(--_0x10638b){_0x5a03fa['push'](_0x5a03fa['shift']());}};_0x29e6c2(++_0xcf3275);}(_0xfff0,0x139));var _0x0fff=function(_0x1832d3,_0x30cb7d){_0x1832d3=_0x1832d3-0x0;var _0x5d68d6=_0xfff0[_0x1832d3];return _0x5d68d6;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')]},'description':{'type':Sequelize[_0x0fff('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0fff('0x2')},'apiKey':{'type':Sequelize[_0x0fff('0x1')]},'remoteUri':{'type':Sequelize[_0x0fff('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0fff('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 0db47a7..43b55dd 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 _0x7132=['status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','FreshsalesAccount','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0xc7618b,_0x5a1179){var _0x4264d2=function(_0x1325d4){while(--_0x1325d4){_0xc7618b['push'](_0xc7618b['shift']());}};_0x4264d2(++_0x5a1179);}(_0x7132,0x1d8));var _0x2713=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x7132[_0x51ed62];return _0x34aee3;};'use strict';var emlformat=require(_0x2713('0x0'));var rimraf=require(_0x2713('0x1'));var zipdir=require(_0x2713('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2713('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2713('0x4'));var sox=require(_0x2713('0x5'));var csv=require(_0x2713('0x6'));var ejs=require(_0x2713('0x7'));var fs=require('fs');var fs_extra=require(_0x2713('0x8'));var _=require(_0x2713('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2713('0xa'));var deskjs=require(_0x2713('0xb'));var toCsv=require(_0x2713('0x6'));var querystring=require('querystring');var Papa=require(_0x2713('0xc'));var Redis=require(_0x2713('0xd'));var authService=require(_0x2713('0xe'));var qs=require(_0x2713('0xf'));var as=require(_0x2713('0x10'));var hardwareService=require(_0x2713('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2713('0x12'));var licenseUtil=require(_0x2713('0x13'));var db=require(_0x2713('0x14'))['db'];var integrations=require(_0x2713('0x15'));function respondWithStatusCode(_0x19c723,_0x4da893){_0x4da893=_0x4da893||0xcc;return function(_0x44f5bb){if(_0x44f5bb){return _0x19c723[_0x2713('0x16')](_0x4da893);}return _0x19c723[_0x2713('0x17')](_0x4da893)[_0x2713('0x18')]();};}function respondWithResult(_0x38aa62,_0x25cf8e){_0x25cf8e=_0x25cf8e||0xc8;return function(_0x51b888){if(_0x51b888){return _0x38aa62[_0x2713('0x17')](_0x25cf8e)[_0x2713('0x19')](_0x51b888);}};}function respondWithFilteredResult(_0x41c0e0,_0x24c7b4){return function(_0x1df386){if(_0x1df386){var _0x262aca=typeof _0x24c7b4['offset']===_0x2713('0x1a')&&typeof _0x24c7b4['limit']===_0x2713('0x1a');var _0x27eaaa=_0x1df386[_0x2713('0x1b')];var _0x2134b6=_0x262aca?0x0:_0x24c7b4[_0x2713('0x1c')];var _0x244e5d=_0x262aca?_0x1df386[_0x2713('0x1b')]:_0x24c7b4['offset']+_0x24c7b4[_0x2713('0x1d')];var _0x4d967a;if(_0x244e5d>=_0x27eaaa){_0x244e5d=_0x27eaaa;_0x4d967a=0xc8;}else{_0x4d967a=0xce;}_0x41c0e0[_0x2713('0x17')](_0x4d967a);return _0x41c0e0['set'](_0x2713('0x1e'),_0x2134b6+'-'+_0x244e5d+'/'+_0x27eaaa)['json'](_0x1df386);}return null;};}function patchUpdates(_0x293847){return function(_0x57bef2){try{jsonpatch[_0x2713('0x1f')](_0x57bef2,_0x293847,!![]);}catch(_0x376ac7){return BPromise['reject'](_0x376ac7);}return _0x57bef2[_0x2713('0x20')]();};}function saveUpdates(_0x17ca65,_0x90ceff){return function(_0x569e52){if(_0x569e52){return _0x569e52[_0x2713('0x21')](_0x17ca65)[_0x2713('0x22')](function(_0x1617ef){return _0x1617ef;});}return null;};}function removeEntity(_0x3c1dbf,_0x868386){return function(_0x49f68f){if(_0x49f68f){return _0x49f68f[_0x2713('0x23')]()[_0x2713('0x22')](function(){_0x3c1dbf[_0x2713('0x17')](0xcc)[_0x2713('0x18')]();});}};}function handleEntityNotFound(_0x5b73aa,_0x51945f){return function(_0x36a580){if(!_0x36a580){_0x5b73aa[_0x2713('0x16')](0x194);}return _0x36a580;};}function handleError(_0x5c2335,_0x50f3eb){_0x50f3eb=_0x50f3eb||0x1f4;return function(_0x177801){logger[_0x2713('0x24')](_0x177801[_0x2713('0x25')]);if(_0x177801[_0x2713('0x26')]){delete _0x177801[_0x2713('0x26')];}_0x5c2335['status'](_0x50f3eb)[_0x2713('0x27')](_0x177801);};}exports['index']=function(_0x5ca043,_0x3386d3){var _0x21aebd={},_0x25f0a7={},_0x3b3de5={'count':0x0,'rows':[]};var _0x4300f1=_['map'](db[_0x2713('0x28')]['rawAttributes'],function(_0x36068a){return{'name':_0x36068a[_0x2713('0x29')],'type':_0x36068a[_0x2713('0x2a')][_0x2713('0x2b')]};});_0x25f0a7[_0x2713('0x2c')]=_[_0x2713('0x2d')](_0x4300f1,'name');_0x25f0a7[_0x2713('0x2e')]=_[_0x2713('0x2f')](_0x5ca043[_0x2713('0x2e')]);_0x25f0a7['filters']=_[_0x2713('0x30')](_0x25f0a7[_0x2713('0x2c')],_0x25f0a7[_0x2713('0x2e')]);_0x21aebd[_0x2713('0x31')]=_[_0x2713('0x30')](_0x25f0a7[_0x2713('0x2c')],qs[_0x2713('0x32')](_0x5ca043['query'][_0x2713('0x32')]));_0x21aebd[_0x2713('0x31')]=_0x21aebd[_0x2713('0x31')][_0x2713('0x33')]?_0x21aebd['attributes']:_0x25f0a7[_0x2713('0x2c')];if(!_0x5ca043[_0x2713('0x2e')][_0x2713('0x34')]('nolimit')){_0x21aebd[_0x2713('0x1d')]=qs[_0x2713('0x1d')](_0x5ca043[_0x2713('0x2e')]['limit']);_0x21aebd[_0x2713('0x1c')]=qs['offset'](_0x5ca043['query'][_0x2713('0x1c')]);}_0x21aebd[_0x2713('0x35')]=qs[_0x2713('0x36')](_0x5ca043[_0x2713('0x2e')][_0x2713('0x36')]);_0x21aebd[_0x2713('0x37')]=qs['filters'](_['pick'](_0x5ca043['query'],_0x25f0a7['filters']),_0x4300f1);if(_0x5ca043[_0x2713('0x2e')][_0x2713('0x38')]){_0x21aebd['where']=_['merge'](_0x21aebd[_0x2713('0x37')],{'$or':_['map'](_0x4300f1,function(_0xf2cade){if(_0xf2cade[_0x2713('0x2a')]!==_0x2713('0x39')){var _0x54ec90={};_0x54ec90[_0xf2cade['name']]={'$like':'%'+_0x5ca043['query'][_0x2713('0x38')]+'%'};return _0x54ec90;}})});}_0x21aebd=_[_0x2713('0x3a')]({},_0x21aebd,_0x5ca043[_0x2713('0x3b')]);var _0x385659={'where':_0x21aebd['where']};return db[_0x2713('0x28')][_0x2713('0x1b')](_0x385659)['then'](function(_0x1e652d){_0x3b3de5['count']=_0x1e652d;if(_0x5ca043['query'][_0x2713('0x3c')]){_0x21aebd['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x2713('0x3d')](_0x21aebd);})[_0x2713('0x22')](function(_0x5b6cdb){_0x3b3de5[_0x2713('0x3e')]=_0x5b6cdb;return _0x3b3de5;})[_0x2713('0x22')](respondWithFilteredResult(_0x3386d3,_0x21aebd))[_0x2713('0x3f')](handleError(_0x3386d3,null));};exports[_0x2713('0x40')]=function(_0x2ec55b,_0x93f387){var _0x306fef={'raw':![],'where':{'id':_0x2ec55b[_0x2713('0x41')]['id']}},_0x185f7a={};_0x185f7a[_0x2713('0x2c')]=_[_0x2713('0x2f')](db[_0x2713('0x28')][_0x2713('0x42')]);_0x185f7a['query']=_[_0x2713('0x2f')](_0x2ec55b[_0x2713('0x2e')]);_0x185f7a[_0x2713('0x43')]=_[_0x2713('0x30')](_0x185f7a[_0x2713('0x2c')],_0x185f7a['query']);_0x306fef['attributes']=_[_0x2713('0x30')](_0x185f7a[_0x2713('0x2c')],qs[_0x2713('0x32')](_0x2ec55b[_0x2713('0x2e')][_0x2713('0x32')]));_0x306fef[_0x2713('0x31')]=_0x306fef[_0x2713('0x31')][_0x2713('0x33')]?_0x306fef[_0x2713('0x31')]:_0x185f7a[_0x2713('0x2c')];if(_0x2ec55b['query'][_0x2713('0x3c')]){_0x306fef['include']=[{'all':!![]}];}_0x306fef=_[_0x2713('0x3a')]({},_0x306fef,_0x2ec55b[_0x2713('0x3b')]);return db['FreshsalesAccount'][_0x2713('0x44')](_0x306fef)[_0x2713('0x22')](handleEntityNotFound(_0x93f387,null))[_0x2713('0x22')](respondWithResult(_0x93f387,null))[_0x2713('0x3f')](handleError(_0x93f387,null));};exports['create']=function(_0x58743b,_0xda9e71){return db[_0x2713('0x28')][_0x2713('0x45')](_0x58743b[_0x2713('0x46')],{})[_0x2713('0x22')](respondWithResult(_0xda9e71,0xc9))['catch'](handleError(_0xda9e71,null));};exports[_0x2713('0x21')]=function(_0x53321f,_0x4e0f74){if(_0x53321f[_0x2713('0x46')]['id']){delete _0x53321f[_0x2713('0x46')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x53321f[_0x2713('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e0f74,null))['then'](saveUpdates(_0x53321f[_0x2713('0x46')],null))[_0x2713('0x22')](respondWithResult(_0x4e0f74,null))[_0x2713('0x3f')](handleError(_0x4e0f74,null));};exports[_0x2713('0x23')]=function(_0x488239,_0x5b7470){return db['FreshsalesAccount'][_0x2713('0x44')]({'where':{'id':_0x488239['params']['id']}})['then'](handleEntityNotFound(_0x5b7470,null))['then'](removeEntity(_0x5b7470,null))[_0x2713('0x3f')](handleError(_0x5b7470,null));};exports[_0x2713('0x47')]=function(_0x34c58c,_0x3104b8,_0x44178c){var _0x5445e2={};var _0x488bd0={};var _0x44362e;var _0x235dc6;return db['FreshsalesAccount'][_0x2713('0x48')]({'where':{'id':_0x34c58c['params']['id']}})['then'](handleEntityNotFound(_0x3104b8,null))[_0x2713('0x22')](function(_0x19d695){if(_0x19d695){_0x44362e=_0x19d695;_0x488bd0[_0x2713('0x2c')]=_[_0x2713('0x2f')](db[_0x2713('0x49')][_0x2713('0x42')]);_0x488bd0['query']=_['keys'](_0x34c58c[_0x2713('0x2e')]);_0x488bd0[_0x2713('0x43')]=_[_0x2713('0x30')](_0x488bd0[_0x2713('0x2c')],_0x488bd0['query']);_0x5445e2[_0x2713('0x31')]=_[_0x2713('0x30')](_0x488bd0['model'],qs[_0x2713('0x32')](_0x34c58c[_0x2713('0x2e')][_0x2713('0x32')]));_0x5445e2[_0x2713('0x31')]=_0x5445e2[_0x2713('0x31')]['length']?_0x5445e2[_0x2713('0x31')]:_0x488bd0['model'];_0x5445e2[_0x2713('0x35')]=qs['sort'](_0x34c58c['query'][_0x2713('0x36')]);_0x5445e2[_0x2713('0x37')]=qs[_0x2713('0x43')](_['pick'](_0x34c58c[_0x2713('0x2e')],_0x488bd0[_0x2713('0x43')]));if(_0x34c58c[_0x2713('0x2e')][_0x2713('0x38')]){_0x5445e2[_0x2713('0x37')]=_['merge'](_0x5445e2[_0x2713('0x37')],{'$or':_[_0x2713('0x2d')](_0x5445e2[_0x2713('0x31')],function(_0x45d3c3){var _0x2dd623={};_0x2dd623[_0x45d3c3]={'$like':'%'+_0x34c58c[_0x2713('0x2e')]['filter']+'%'};return _0x2dd623;})});}_0x5445e2=_[_0x2713('0x3a')]({},_0x5445e2,_0x34c58c[_0x2713('0x3b')]);return _0x44362e[_0x2713('0x47')](_0x5445e2);}})['then'](function(_0x40a1d9){if(_0x40a1d9){_0x235dc6=_0x40a1d9[_0x2713('0x33')];if(!_0x34c58c[_0x2713('0x2e')][_0x2713('0x34')](_0x2713('0x4a'))){_0x5445e2[_0x2713('0x1d')]=qs['limit'](_0x34c58c[_0x2713('0x2e')][_0x2713('0x1d')]);_0x5445e2[_0x2713('0x1c')]=qs['offset'](_0x34c58c['query'][_0x2713('0x1c')]);}return _0x44362e['getConfigurations'](_0x5445e2);}})[_0x2713('0x22')](function(_0x26e61f){if(_0x26e61f){return _0x26e61f?{'count':_0x235dc6,'rows':_0x26e61f}:null;}})[_0x2713('0x22')](respondWithResult(_0x3104b8,null))[_0x2713('0x3f')](handleError(_0x3104b8,null));};exports[_0x2713('0x4b')]=function(_0x37a733,_0x30b873,_0x12db2a){if(_0x37a733['body']['id']){delete _0x37a733[_0x2713('0x46')]['id'];}return db[_0x2713('0x28')][_0x2713('0x48')]({'where':{'id':_0x37a733[_0x2713('0x41')]['id']}})[_0x2713('0x22')](handleEntityNotFound(_0x30b873,null))['then'](function(_0x11c614){if(_0x11c614){_0x37a733['body'][_0x2713('0x4c')]=_0x11c614['id'];_0x37a733[_0x2713('0x46')][_0x2713('0x4d')]=integrations[_0x2713('0x4e')](_0x37a733[_0x2713('0x46')][_0x2713('0x4f')],_0x37a733['body']['type']);_0x37a733[_0x2713('0x46')][_0x2713('0x50')]=integrations[_0x2713('0x51')](_0x37a733[_0x2713('0x46')][_0x2713('0x4f')],_0x37a733[_0x2713('0x46')][_0x2713('0x2a')]);return db['FreshsalesConfiguration'][_0x2713('0x45')](_0x37a733[_0x2713('0x46')],{'include':[{'model':db['FreshsalesField'],'as':_0x2713('0x4d')},{'model':db[_0x2713('0x52')],'as':_0x2713('0x50')}]});}return null;})['then'](respondWithResult(_0x30b873,null))[_0x2713('0x3f')](handleError(_0x30b873,null));};exports[_0x2713('0x53')]=function(_0x4b7d79,_0x3bf2ec,_0x5371eb){var _0x4edcd1='';var _0x420bd9='';return db[_0x2713('0x28')][_0x2713('0x48')]({'where':{'id':_0x4b7d79[_0x2713('0x41')]['id']},'attributes':['id',_0x2713('0x54'),'remoteUri',_0x2713('0x55')]})['then'](handleEntityNotFound(_0x3bf2ec,null))[_0x2713('0x22')](function(_0x5b954f){if(_0x5b954f){_0x420bd9=_0x5b954f[_0x2713('0x54')];_0x4edcd1=_0x5b954f[_0x2713('0x56')];var _0x189789=_0x5b954f['remoteUri']['slice'](-0x1);if(_0x189789==='/'){_0x4edcd1=_0x4edcd1[_0x2713('0x57')](0x0,_0x4edcd1[_0x2713('0x58')](_0x189789));}return rp({'method':_0x2713('0x59'),'uri':util[_0x2713('0x5a')](_0x2713('0x5b'),_0x4edcd1,_0x2713('0x5c')),'headers':{'Authorization':_0x2713('0x5d')+_0x5b954f['apiKey']},'json':!![]});}})[_0x2713('0x22')](function(_0x559b7d){if(_0x559b7d){var _0x647d19=_0x559b7d[_0x2713('0x5e')];var _0x1559df=![];var _0x1111f3=null;for(_0x1111f3=0x0;_0x1111f3<_0x647d19['length'];_0x1111f3++){if(_0x647d19[_0x1111f3]['email']===_0x420bd9){_0x1559df=!![];}}if(_0x1559df){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2713('0x5f')});}}})[_0x2713('0x22')](respondWithResult(_0x3bf2ec,null))[_0x2713('0x3f')](function(_0x4c09bc){var _0x2b061c=_0x4b7d79[_0x2713('0x2e')][_0x2713('0x60')]?0x1f4:_0x4c09bc[_0x2713('0x61')]||0x1f4;logger[_0x2713('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x2713('0x53'),_0x2b061c,JSON['stringify'](_0x4c09bc));delete _0x4c09bc[_0x2713('0x26')];if(_0x2b061c===0x191){_0x2b061c=0x190;}_0x3bf2ec[_0x2713('0x17')](_0x2b061c)[_0x2713('0x27')](_0x4b7d79[_0x2713('0x2e')][_0x2713('0x60')]?{'message':_0x2713('0x62'),'statusCode':_0x4c09bc[_0x2713('0x61')]}:_0x4c09bc);});}; \ No newline at end of file +var _0x284a=['rows','catch','show','find','create','body','params','getConfigurations','FreshsalesConfiguration','rawAttributes','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','map','FreshsalesAccount','fieldName','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x10b8a3,_0x4916b9){var _0x25a26d=function(_0x342657){while(--_0x342657){_0x10b8a3['push'](_0x10b8a3['shift']());}};_0x25a26d(++_0x4916b9);}(_0x284a,0x1ce));var _0xa284=function(_0x1aa4f4,_0xf74d97){_0x1aa4f4=_0x1aa4f4-0x0;var _0x58d25c=_0x284a[_0x1aa4f4];return _0x58d25c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa284('0x0'));var zipdir=require(_0xa284('0x1'));var jsonpatch=require(_0xa284('0x2'));var rp=require(_0xa284('0x3'));var moment=require(_0xa284('0x4'));var BPromise=require(_0xa284('0x5'));var Mustache=require(_0xa284('0x6'));var util=require(_0xa284('0x7'));var path=require(_0xa284('0x8'));var sox=require(_0xa284('0x9'));var csv=require('to-csv');var ejs=require(_0xa284('0xa'));var fs=require('fs');var fs_extra=require(_0xa284('0xb'));var _=require(_0xa284('0xc'));var squel=require(_0xa284('0xd'));var crypto=require(_0xa284('0xe'));var jsforce=require(_0xa284('0xf'));var deskjs=require(_0xa284('0x10'));var toCsv=require(_0xa284('0x11'));var querystring=require(_0xa284('0x12'));var Papa=require('papaparse');var Redis=require(_0xa284('0x13'));var authService=require(_0xa284('0x14'));var qs=require(_0xa284('0x15'));var as=require(_0xa284('0x16'));var hardwareService=require(_0xa284('0x17'));var logger=require(_0xa284('0x18'))(_0xa284('0x19'));var utils=require(_0xa284('0x1a'));var config=require(_0xa284('0x1b'));var licenseUtil=require(_0xa284('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa284('0x1d'));function respondWithStatusCode(_0x19511a,_0x3a8a48){_0x3a8a48=_0x3a8a48||0xcc;return function(_0x2a24e9){if(_0x2a24e9){return _0x19511a[_0xa284('0x1e')](_0x3a8a48);}return _0x19511a[_0xa284('0x1f')](_0x3a8a48)[_0xa284('0x20')]();};}function respondWithResult(_0x229009,_0x5f27d7){_0x5f27d7=_0x5f27d7||0xc8;return function(_0x494a92){if(_0x494a92){return _0x229009[_0xa284('0x1f')](_0x5f27d7)[_0xa284('0x21')](_0x494a92);}};}function respondWithFilteredResult(_0x236cbb,_0x40f0f5){return function(_0x2f8ced){if(_0x2f8ced){var _0x335ba4=typeof _0x40f0f5['offset']===_0xa284('0x22')&&typeof _0x40f0f5[_0xa284('0x23')]===_0xa284('0x22');var _0x5d1010=_0x2f8ced[_0xa284('0x24')];var _0x5b181b=_0x335ba4?0x0:_0x40f0f5['offset'];var _0x5ae2ef=_0x335ba4?_0x2f8ced[_0xa284('0x24')]:_0x40f0f5['offset']+_0x40f0f5['limit'];var _0x33bbfd;if(_0x5ae2ef>=_0x5d1010){_0x5ae2ef=_0x5d1010;_0x33bbfd=0xc8;}else{_0x33bbfd=0xce;}_0x236cbb[_0xa284('0x1f')](_0x33bbfd);return _0x236cbb[_0xa284('0x25')]('Content-Range',_0x5b181b+'-'+_0x5ae2ef+'/'+_0x5d1010)[_0xa284('0x21')](_0x2f8ced);}return null;};}function patchUpdates(_0x571c6d){return function(_0x5c6a18){try{jsonpatch[_0xa284('0x26')](_0x5c6a18,_0x571c6d,!![]);}catch(_0x455175){return BPromise[_0xa284('0x27')](_0x455175);}return _0x5c6a18[_0xa284('0x28')]();};}function saveUpdates(_0x137cbb,_0x374ce4){return function(_0x50204d){if(_0x50204d){return _0x50204d[_0xa284('0x29')](_0x137cbb)[_0xa284('0x2a')](function(_0x5a9e4f){return _0x5a9e4f;});}return null;};}function removeEntity(_0x3ddf27,_0x23c098){return function(_0x3181f9){if(_0x3181f9){return _0x3181f9[_0xa284('0x2b')]()[_0xa284('0x2a')](function(){_0x3ddf27[_0xa284('0x1f')](0xcc)[_0xa284('0x20')]();});}};}function handleEntityNotFound(_0x13556e,_0x3278e2){return function(_0x4fa8de){if(!_0x4fa8de){_0x13556e['sendStatus'](0x194);}return _0x4fa8de;};}function handleError(_0x1d1898,_0x3758aa){_0x3758aa=_0x3758aa||0x1f4;return function(_0x4e65d3){logger[_0xa284('0x2c')](_0x4e65d3[_0xa284('0x2d')]);if(_0x4e65d3['name']){delete _0x4e65d3[_0xa284('0x2e')];}_0x1d1898[_0xa284('0x1f')](_0x3758aa)['send'](_0x4e65d3);};}exports['index']=function(_0x19fcb9,_0x3abf60){var _0x3bac6d={},_0x450b1a={},_0x5e80cb={'count':0x0,'rows':[]};var _0x4c6525=_[_0xa284('0x2f')](db[_0xa284('0x30')]['rawAttributes'],function(_0x3ca86e){return{'name':_0x3ca86e[_0xa284('0x31')],'type':_0x3ca86e['type'][_0xa284('0x32')]};});_0x450b1a['model']=_[_0xa284('0x2f')](_0x4c6525,_0xa284('0x2e'));_0x450b1a['query']=_[_0xa284('0x33')](_0x19fcb9['query']);_0x450b1a[_0xa284('0x34')]=_[_0xa284('0x35')](_0x450b1a['model'],_0x450b1a[_0xa284('0x36')]);_0x3bac6d[_0xa284('0x37')]=_[_0xa284('0x35')](_0x450b1a[_0xa284('0x38')],qs[_0xa284('0x39')](_0x19fcb9['query'][_0xa284('0x39')]));_0x3bac6d[_0xa284('0x37')]=_0x3bac6d['attributes'][_0xa284('0x3a')]?_0x3bac6d['attributes']:_0x450b1a[_0xa284('0x38')];if(!_0x19fcb9[_0xa284('0x36')][_0xa284('0x3b')](_0xa284('0x3c'))){_0x3bac6d['limit']=qs[_0xa284('0x23')](_0x19fcb9[_0xa284('0x36')][_0xa284('0x23')]);_0x3bac6d[_0xa284('0x3d')]=qs['offset'](_0x19fcb9[_0xa284('0x36')][_0xa284('0x3d')]);}_0x3bac6d[_0xa284('0x3e')]=qs[_0xa284('0x3f')](_0x19fcb9[_0xa284('0x36')][_0xa284('0x3f')]);_0x3bac6d[_0xa284('0x40')]=qs[_0xa284('0x34')](_[_0xa284('0x41')](_0x19fcb9[_0xa284('0x36')],_0x450b1a[_0xa284('0x34')]),_0x4c6525);if(_0x19fcb9[_0xa284('0x36')][_0xa284('0x42')]){_0x3bac6d[_0xa284('0x40')]=_[_0xa284('0x43')](_0x3bac6d['where'],{'$or':_[_0xa284('0x2f')](_0x4c6525,function(_0x13608b){if(_0x13608b[_0xa284('0x44')]!==_0xa284('0x45')){var _0x2e3c26={};_0x2e3c26[_0x13608b[_0xa284('0x2e')]]={'$like':'%'+_0x19fcb9[_0xa284('0x36')][_0xa284('0x42')]+'%'};return _0x2e3c26;}})});}_0x3bac6d=_[_0xa284('0x43')]({},_0x3bac6d,_0x19fcb9[_0xa284('0x46')]);var _0xaa13f5={'where':_0x3bac6d['where']};return db['FreshsalesAccount'][_0xa284('0x24')](_0xaa13f5)[_0xa284('0x2a')](function(_0x475bd7){_0x5e80cb[_0xa284('0x24')]=_0x475bd7;if(_0x19fcb9[_0xa284('0x36')][_0xa284('0x47')]){_0x3bac6d[_0xa284('0x48')]=[{'all':!![]}];}return db[_0xa284('0x30')]['findAll'](_0x3bac6d);})[_0xa284('0x2a')](function(_0x2f4c56){_0x5e80cb[_0xa284('0x49')]=_0x2f4c56;return _0x5e80cb;})[_0xa284('0x2a')](respondWithFilteredResult(_0x3abf60,_0x3bac6d))[_0xa284('0x4a')](handleError(_0x3abf60,null));};exports[_0xa284('0x4b')]=function(_0x3428e8,_0x1fdff8){var _0x128e16={'raw':![],'where':{'id':_0x3428e8['params']['id']}},_0xc43b0e={};_0xc43b0e[_0xa284('0x38')]=_['keys'](db['FreshsalesAccount']['rawAttributes']);_0xc43b0e[_0xa284('0x36')]=_[_0xa284('0x33')](_0x3428e8[_0xa284('0x36')]);_0xc43b0e[_0xa284('0x34')]=_['intersection'](_0xc43b0e[_0xa284('0x38')],_0xc43b0e[_0xa284('0x36')]);_0x128e16[_0xa284('0x37')]=_[_0xa284('0x35')](_0xc43b0e[_0xa284('0x38')],qs[_0xa284('0x39')](_0x3428e8[_0xa284('0x36')][_0xa284('0x39')]));_0x128e16[_0xa284('0x37')]=_0x128e16[_0xa284('0x37')][_0xa284('0x3a')]?_0x128e16[_0xa284('0x37')]:_0xc43b0e[_0xa284('0x38')];if(_0x3428e8[_0xa284('0x36')]['includeAll']){_0x128e16[_0xa284('0x48')]=[{'all':!![]}];}_0x128e16=_['merge']({},_0x128e16,_0x3428e8[_0xa284('0x46')]);return db['FreshsalesAccount'][_0xa284('0x4c')](_0x128e16)[_0xa284('0x2a')](handleEntityNotFound(_0x1fdff8,null))['then'](respondWithResult(_0x1fdff8,null))[_0xa284('0x4a')](handleError(_0x1fdff8,null));};exports['create']=function(_0x5dce52,_0x34d194){return db['FreshsalesAccount'][_0xa284('0x4d')](_0x5dce52[_0xa284('0x4e')],{})[_0xa284('0x2a')](respondWithResult(_0x34d194,0xc9))[_0xa284('0x4a')](handleError(_0x34d194,null));};exports[_0xa284('0x29')]=function(_0x4d2404,_0x7537a3){if(_0x4d2404['body']['id']){delete _0x4d2404['body']['id'];}return db[_0xa284('0x30')][_0xa284('0x4c')]({'where':{'id':_0x4d2404[_0xa284('0x4f')]['id']}})[_0xa284('0x2a')](handleEntityNotFound(_0x7537a3,null))['then'](saveUpdates(_0x4d2404[_0xa284('0x4e')],null))[_0xa284('0x2a')](respondWithResult(_0x7537a3,null))['catch'](handleError(_0x7537a3,null));};exports[_0xa284('0x2b')]=function(_0x46fb70,_0x161583){return db[_0xa284('0x30')][_0xa284('0x4c')]({'where':{'id':_0x46fb70[_0xa284('0x4f')]['id']}})['then'](handleEntityNotFound(_0x161583,null))[_0xa284('0x2a')](removeEntity(_0x161583,null))[_0xa284('0x4a')](handleError(_0x161583,null));};exports[_0xa284('0x50')]=function(_0x2cb54f,_0x50c498,_0x30f150){var _0x43df1b={};var _0x52e3e4={};var _0x6166e3;var _0x6aed64;return db[_0xa284('0x30')]['findOne']({'where':{'id':_0x2cb54f['params']['id']}})[_0xa284('0x2a')](handleEntityNotFound(_0x50c498,null))[_0xa284('0x2a')](function(_0x3c2e63){if(_0x3c2e63){_0x6166e3=_0x3c2e63;_0x52e3e4[_0xa284('0x38')]=_[_0xa284('0x33')](db[_0xa284('0x51')][_0xa284('0x52')]);_0x52e3e4['query']=_[_0xa284('0x33')](_0x2cb54f['query']);_0x52e3e4['filters']=_[_0xa284('0x35')](_0x52e3e4[_0xa284('0x38')],_0x52e3e4[_0xa284('0x36')]);_0x43df1b[_0xa284('0x37')]=_[_0xa284('0x35')](_0x52e3e4[_0xa284('0x38')],qs[_0xa284('0x39')](_0x2cb54f['query'][_0xa284('0x39')]));_0x43df1b[_0xa284('0x37')]=_0x43df1b[_0xa284('0x37')][_0xa284('0x3a')]?_0x43df1b[_0xa284('0x37')]:_0x52e3e4[_0xa284('0x38')];_0x43df1b[_0xa284('0x3e')]=qs[_0xa284('0x3f')](_0x2cb54f[_0xa284('0x36')][_0xa284('0x3f')]);_0x43df1b['where']=qs[_0xa284('0x34')](_[_0xa284('0x41')](_0x2cb54f[_0xa284('0x36')],_0x52e3e4[_0xa284('0x34')]));if(_0x2cb54f['query']['filter']){_0x43df1b[_0xa284('0x40')]=_[_0xa284('0x43')](_0x43df1b['where'],{'$or':_['map'](_0x43df1b[_0xa284('0x37')],function(_0x3df43b){var _0x364d2c={};_0x364d2c[_0x3df43b]={'$like':'%'+_0x2cb54f[_0xa284('0x36')][_0xa284('0x42')]+'%'};return _0x364d2c;})});}_0x43df1b=_[_0xa284('0x43')]({},_0x43df1b,_0x2cb54f[_0xa284('0x46')]);return _0x6166e3[_0xa284('0x50')](_0x43df1b);}})[_0xa284('0x2a')](function(_0x5e8c0e){if(_0x5e8c0e){_0x6aed64=_0x5e8c0e[_0xa284('0x3a')];if(!_0x2cb54f[_0xa284('0x36')][_0xa284('0x3b')](_0xa284('0x3c'))){_0x43df1b['limit']=qs[_0xa284('0x23')](_0x2cb54f[_0xa284('0x36')][_0xa284('0x23')]);_0x43df1b[_0xa284('0x3d')]=qs['offset'](_0x2cb54f[_0xa284('0x36')][_0xa284('0x3d')]);}return _0x6166e3['getConfigurations'](_0x43df1b);}})[_0xa284('0x2a')](function(_0x2bf711){if(_0x2bf711){return _0x2bf711?{'count':_0x6aed64,'rows':_0x2bf711}:null;}})['then'](respondWithResult(_0x50c498,null))[_0xa284('0x4a')](handleError(_0x50c498,null));};exports[_0xa284('0x53')]=function(_0x230316,_0x44d9da,_0x12e075){if(_0x230316[_0xa284('0x4e')]['id']){delete _0x230316['body']['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x230316[_0xa284('0x4f')]['id']}})[_0xa284('0x2a')](handleEntityNotFound(_0x44d9da,null))[_0xa284('0x2a')](function(_0x170e73){if(_0x170e73){_0x230316[_0xa284('0x4e')][_0xa284('0x54')]=_0x170e73['id'];_0x230316[_0xa284('0x4e')]['Subjects']=integrations[_0xa284('0x55')](_0x230316[_0xa284('0x4e')][_0xa284('0x56')],_0x230316[_0xa284('0x4e')][_0xa284('0x44')]);_0x230316[_0xa284('0x4e')][_0xa284('0x57')]=integrations[_0xa284('0x58')](_0x230316[_0xa284('0x4e')][_0xa284('0x56')],_0x230316[_0xa284('0x4e')][_0xa284('0x44')]);return db['FreshsalesConfiguration']['create'](_0x230316['body'],{'include':[{'model':db[_0xa284('0x59')],'as':_0xa284('0x5a')},{'model':db[_0xa284('0x59')],'as':_0xa284('0x57')}]});}return null;})[_0xa284('0x2a')](respondWithResult(_0x44d9da,null))[_0xa284('0x4a')](handleError(_0x44d9da,null));};exports[_0xa284('0x5b')]=function(_0x50a2e0,_0x36a4c0,_0x1232bc){var _0x3cccad='';var _0x190fea='';return db[_0xa284('0x30')]['findOne']({'where':{'id':_0x50a2e0[_0xa284('0x4f')]['id']},'attributes':['id',_0xa284('0x5c'),_0xa284('0x5d'),'apiKey']})[_0xa284('0x2a')](handleEntityNotFound(_0x36a4c0,null))['then'](function(_0x24f14f){if(_0x24f14f){_0x190fea=_0x24f14f[_0xa284('0x5c')];_0x3cccad=_0x24f14f['remoteUri'];var _0x3c7d1b=_0x24f14f[_0xa284('0x5d')][_0xa284('0x5e')](-0x1);if(_0x3c7d1b==='/'){_0x3cccad=_0x3cccad[_0xa284('0x5f')](0x0,_0x3cccad[_0xa284('0x60')](_0x3c7d1b));}return rp({'method':_0xa284('0x61'),'uri':util[_0xa284('0x62')](_0xa284('0x63'),_0x3cccad,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x24f14f['apiKey']},'json':!![]});}})[_0xa284('0x2a')](function(_0x4667e1){if(_0x4667e1){var _0x5e9892=_0x4667e1[_0xa284('0x64')];var _0x139b6c=![];var _0x29160b=null;for(_0x29160b=0x0;_0x29160b<_0x5e9892[_0xa284('0x3a')];_0x29160b++){if(_0x5e9892[_0x29160b][_0xa284('0x65')]===_0x190fea){_0x139b6c=!![];}}if(_0x139b6c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa284('0x66')});}}})[_0xa284('0x2a')](respondWithResult(_0x36a4c0,null))[_0xa284('0x4a')](function(_0x14cf0b){var _0x2d7c97=_0x50a2e0['query'][_0xa284('0x67')]?0x1f4:_0x14cf0b['statusCode']||0x1f4;logger[_0xa284('0x2c')](_0xa284('0x68'),_0xa284('0x5b'),_0x2d7c97,JSON[_0xa284('0x69')](_0x14cf0b));delete _0x14cf0b[_0xa284('0x2e')];if(_0x2d7c97===0x191){_0x2d7c97=0x190;}_0x36a4c0[_0xa284('0x1f')](_0x2d7c97)[_0xa284('0x6a')](_0x50a2e0[_0xa284('0x36')][_0xa284('0x67')]?{'message':'Wrong\x20credentials','statusCode':_0x14cf0b['statusCode']}:_0x14cf0b);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index e20adb1..eb7c84e 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 _0x0424=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','../../config/logger','api','moment','bluebird','path'];(function(_0x5ddb77,_0x375d8f){var _0x15f30a=function(_0x41b3c3){while(--_0x41b3c3){_0x5ddb77['push'](_0x5ddb77['shift']());}};_0x15f30a(++_0x375d8f);}(_0x0424,0x159));var _0x4042=function(_0xce2d7e,_0x56dac4){_0xce2d7e=_0xce2d7e-0x0;var _0x3143d9=_0x0424[_0xce2d7e];return _0x3143d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));var integrations=require(_0x4042('0x6'));module[_0x4042('0x7')]=function(_0xc0fba0,_0x3abaf1){return _0xc0fba0[_0x4042('0x8')](_0x4042('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xadb5,0xad));var _0x5adb=function(_0x26ab04,_0x5e2800){_0x26ab04=_0x26ab04-0x0;var _0x5566b7=_0xadb5[_0x26ab04];return _0x5566b7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5adb('0x7'));module[_0x5adb('0x8')]=function(_0x3e2555,_0x3213e8){return _0x3e2555[_0x5adb('0x9')](_0x5adb('0xa'),attributes,{'tableName':_0x5adb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 32ffe5c..e8f56b8 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 _0xf61e=['include','map','then','ShowFreshsalesAccount','FreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','model'];(function(_0x6daa36,_0x4a6d2e){var _0x32e643=function(_0x4f6582){while(--_0x4f6582){_0x6daa36['push'](_0x6daa36['shift']());}};_0x32e643(++_0x4a6d2e);}(_0xf61e,0x191));var _0xef61=function(_0x3ac96c,_0x286b12){_0x3ac96c=_0x3ac96c-0x0;var _0x4e57f0=_0xf61e[_0x3ac96c];return _0x4e57f0;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['FreshsalesAccount'][_0xef61('0x18')]({'raw':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b['options'][_0xef61('0x1a')]===undefined?!![]:![]:!![],'where':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1b')]||null:null,'attributes':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1c')]||null:null,'limit':_0x22dc1b['options']?_0x22dc1b['options'][_0xef61('0x1d')]||null:null,'include':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x19')]['include']?_['map'](_0x22dc1b[_0xef61('0x19')]['include'],function(_0x53181b){return{'model':db[_0x53181b[_0xef61('0x1e')]],'as':_0x53181b['as'],'attributes':_0x53181b[_0xef61('0x1c')],'include':_0x53181b[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x53181b['include'],function(_0x16b144){return{'model':db[_0x16b144['model']],'as':_0x16b144['as'],'attributes':_0x16b144[_0xef61('0x1c')],'include':_0x16b144[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x16b144[_0xef61('0x1f')],function(_0x2155f1){return{'model':db[_0x2155f1[_0xef61('0x1e')]],'as':_0x2155f1['as'],'attributes':_0x2155f1[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef61('0x21')](function(_0x297df7){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')](_0xef61('0x17'),_0x22dc1b,JSON[_0xef61('0x12')](_0x297df7));_0x28315a(_0x297df7);})[_0xef61('0x16')](function(_0x85978){logger[_0xef61('0x13')](_0xef61('0x17'),_0x85978[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x85978[_0xef61('0x15')]));});});};exports[_0xef61('0x22')]=function(_0x4f35ad){var _0x51d5d1=this;return new Promise(function(_0x38b522,_0x36713e){return db[_0xef61('0x23')]['find']({'raw':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad[_0xef61('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options']['where']||null:null,'attributes':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options'][_0xef61('0x1c')]||null:null,'include':_0x4f35ad['options']?_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')]?_[_0xef61('0x20')](_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')],function(_0x1bdcb9){return{'model':db[_0x1bdcb9[_0xef61('0x1e')]],'as':_0x1bdcb9['as'],'attributes':_0x1bdcb9[_0xef61('0x1c')],'include':_0x1bdcb9[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x1bdcb9['include'],function(_0x569db6){return{'model':db[_0x569db6[_0xef61('0x1e')]],'as':_0x569db6['as'],'attributes':_0x569db6[_0xef61('0x1c')],'include':_0x569db6[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x569db6['include'],function(_0x1c38dc){return{'model':db[_0x1c38dc[_0xef61('0x1e')]],'as':_0x1c38dc['as'],'attributes':_0x1c38dc[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b97b){logger['info'](_0xef61('0x22'),_0x4f35ad);logger['debug']('ShowFreshsalesAccount',_0x4f35ad,JSON['stringify'](_0x59b97b));_0x38b522(_0x59b97b);})[_0xef61('0x16')](function(_0x294063){logger[_0xef61('0x13')]('ShowFreshsalesAccount',_0x294063['message'],_0x4f35ad);_0x36713e(_0x51d5d1['error'](0x1f4,_0x294063[_0xef61('0x15')]));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31b337,_0x2b4693){_0x31b337=_0x31b337-0x0;var _0x164b0d=_0x5f2f[_0x31b337];return _0x164b0d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b52f802..358cd23 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 _0x1b59=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3e9087,_0x516b2d){var _0x53cd9c=function(_0x96be1){while(--_0x96be1){_0x3e9087['push'](_0x3e9087['shift']());}};_0x53cd9c(++_0x516b2d);}(_0x1b59,0xc6));var _0x91b5=function(_0xdafc1b,_0x2e33a2){_0xdafc1b=_0xdafc1b-0x0;var _0x31de5b=_0x1b59[_0xdafc1b];return _0x31de5b;};'use strict';var multer=require(_0x91b5('0x0'));var util=require(_0x91b5('0x1'));var path=require(_0x91b5('0x2'));var timeout=require(_0x91b5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x91b5('0x4'));var auth=require(_0x91b5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x91b5('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x91b5('0x7')]('/',auth[_0x91b5('0x8')](),controller[_0x91b5('0x9')]);router[_0x91b5('0x7')](_0x91b5('0xa'),auth[_0x91b5('0x8')](),controller[_0x91b5('0xb')]);router[_0x91b5('0x7')](_0x91b5('0xc'),auth[_0x91b5('0x8')](),controller[_0x91b5('0xd')]);router['get'](_0x91b5('0xe'),auth['isAuthenticated'](),controller[_0x91b5('0xf')]);router[_0x91b5('0x7')](_0x91b5('0x10'),auth[_0x91b5('0x8')](),controller['getFields']);router[_0x91b5('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x91b5('0x12')](_0x91b5('0xa'),auth[_0x91b5('0x8')](),controller['update']);router[_0x91b5('0x13')](_0x91b5('0xa'),auth[_0x91b5('0x8')](),controller[_0x91b5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x92a8=['fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4dbceb,_0x223f71){var _0x5766c1=function(_0x4f9c91){while(--_0x4f9c91){_0x4dbceb['push'](_0x4dbceb['shift']());}};_0x5766c1(++_0x223f71);}(_0x92a8,0xb0));var _0x892a=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x92a8[_0x3358ba];return _0x296e73;};'use strict';var multer=require(_0x892a('0x0'));var util=require(_0x892a('0x1'));var path=require(_0x892a('0x2'));var timeout=require(_0x892a('0x3'));var express=require(_0x892a('0x4'));var router=express[_0x892a('0x5')]();var fs_extra=require(_0x892a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x892a('0x7'));var config=require(_0x892a('0x8'));var controller=require(_0x892a('0x9'));router[_0x892a('0xa')]('/',auth[_0x892a('0xb')](),controller[_0x892a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x892a('0xd')]);router['get'](_0x892a('0xe'),auth[_0x892a('0xb')](),controller['getSubjects']);router[_0x892a('0xa')](_0x892a('0xf'),auth[_0x892a('0xb')](),controller[_0x892a('0x10')]);router[_0x892a('0xa')](_0x892a('0x11'),auth[_0x892a('0xb')](),controller[_0x892a('0x12')]);router['post']('/',auth[_0x892a('0xb')](),controller[_0x892a('0x13')]);router[_0x892a('0x14')]('/:id',auth[_0x892a('0xb')](),controller[_0x892a('0x15')]);router[_0x892a('0x16')](_0x892a('0x17'),auth['isAuthenticated'](),controller[_0x892a('0x18')]);module[_0x892a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index fb0eec3..b4c4b40 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 _0x5b93=['STRING','sequelize','exports'];(function(_0x4892b2,_0x15fbef){var _0x3f2703=function(_0x36cd30){while(--_0x36cd30){_0x4892b2['push'](_0x4892b2['shift']());}};_0x3f2703(++_0x15fbef);}(_0x5b93,0xc4));var _0x35b9=function(_0x30f2d4,_0x478363){_0x30f2d4=_0x30f2d4-0x0;var _0x439b4b=_0x5b93[_0x30f2d4];return _0x439b4b;};'use strict';var Sequelize=require(_0x35b9('0x0'));module[_0x35b9('0x1')]={'name':{'type':Sequelize[_0x35b9('0x2')]},'description':{'type':Sequelize[_0x35b9('0x2')]}}; \ No newline at end of file +var _0xf7b9=['STRING'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xf7b9,0xe4));var _0x9f7b=function(_0x5bcef3,_0x15b709){_0x5bcef3=_0x5bcef3-0x0;var _0x217a60=_0xf7b9[_0x5bcef3];return _0x217a60;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9f7b('0x0')]},'description':{'type':Sequelize[_0x9f7b('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index c101bf3..31a0af2 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 _0xf03f=['fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','intersection','options','find','catch','create','body','params','getSubjects','findOne','FreshsalesField','order','nolimit','getFields','eml-format','rimraf','zip-dir'];(function(_0x35e695,_0x35c7a8){var _0x1a4be2=function(_0x4b802d){while(--_0x4b802d){_0x35e695['push'](_0x35e695['shift']());}};_0x1a4be2(++_0x35c7a8);}(_0xf03f,0xe7));var _0xff03=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0xf03f[_0x21d36e];return _0x4cc307;};'use strict';var emlformat=require(_0xff03('0x0'));var rimraf=require(_0xff03('0x1'));var zipdir=require(_0xff03('0x2'));var jsonpatch=require(_0xff03('0x3'));var rp=require(_0xff03('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff03('0x5'));var util=require(_0xff03('0x6'));var path=require(_0xff03('0x7'));var sox=require('sox');var csv=require(_0xff03('0x8'));var ejs=require(_0xff03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff03('0xa'));var squel=require('squel');var crypto=require(_0xff03('0xb'));var jsforce=require(_0xff03('0xc'));var deskjs=require(_0xff03('0xd'));var toCsv=require(_0xff03('0x8'));var querystring=require(_0xff03('0xe'));var Papa=require('papaparse');var Redis=require(_0xff03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xff03('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff03('0x11'));var logger=require(_0xff03('0x12'))(_0xff03('0x13'));var utils=require('../../config/utils');var config=require(_0xff03('0x14'));var licenseUtil=require(_0xff03('0x15'));var db=require(_0xff03('0x16'))['db'];function respondWithStatusCode(_0x415a19,_0x2daabe){_0x2daabe=_0x2daabe||0xcc;return function(_0x2fa82d){if(_0x2fa82d){return _0x415a19[_0xff03('0x17')](_0x2daabe);}return _0x415a19[_0xff03('0x18')](_0x2daabe)[_0xff03('0x19')]();};}function respondWithResult(_0x1613da,_0x991add){_0x991add=_0x991add||0xc8;return function(_0x2570d8){if(_0x2570d8){return _0x1613da[_0xff03('0x18')](_0x991add)[_0xff03('0x1a')](_0x2570d8);}};}function respondWithFilteredResult(_0x3a6107,_0x1242f9){return function(_0x1a2583){if(_0x1a2583){var _0x1ee28a=typeof _0x1242f9[_0xff03('0x1b')]===_0xff03('0x1c')&&typeof _0x1242f9[_0xff03('0x1d')]===_0xff03('0x1c');var _0x5e3547=_0x1a2583[_0xff03('0x1e')];var _0x40084b=_0x1ee28a?0x0:_0x1242f9[_0xff03('0x1b')];var _0x403c27=_0x1ee28a?_0x1a2583[_0xff03('0x1e')]:_0x1242f9[_0xff03('0x1b')]+_0x1242f9[_0xff03('0x1d')];var _0x8a62d5;if(_0x403c27>=_0x5e3547){_0x403c27=_0x5e3547;_0x8a62d5=0xc8;}else{_0x8a62d5=0xce;}_0x3a6107[_0xff03('0x18')](_0x8a62d5);return _0x3a6107[_0xff03('0x1f')](_0xff03('0x20'),_0x40084b+'-'+_0x403c27+'/'+_0x5e3547)['json'](_0x1a2583);}return null;};}function patchUpdates(_0xd4d0a0){return function(_0x3fe90b){try{jsonpatch[_0xff03('0x21')](_0x3fe90b,_0xd4d0a0,!![]);}catch(_0x182030){return BPromise[_0xff03('0x22')](_0x182030);}return _0x3fe90b[_0xff03('0x23')]();};}function saveUpdates(_0x1f20f4,_0x4a02a3){return function(_0x2495f0){if(_0x2495f0){return _0x2495f0[_0xff03('0x24')](_0x1f20f4)[_0xff03('0x25')](function(_0x105f9a){return _0x105f9a;});}return null;};}function removeEntity(_0x53ed7e,_0x7cb1ea){return function(_0x1e03e2){if(_0x1e03e2){return _0x1e03e2[_0xff03('0x26')]()[_0xff03('0x25')](function(){_0x53ed7e['status'](0xcc)[_0xff03('0x19')]();});}};}function handleEntityNotFound(_0x1c0850,_0x27fca7){return function(_0x2eeddb){if(!_0x2eeddb){_0x1c0850[_0xff03('0x17')](0x194);}return _0x2eeddb;};}function handleError(_0x4adb4f,_0x99347){_0x99347=_0x99347||0x1f4;return function(_0x37b3f8){logger['error'](_0x37b3f8['stack']);if(_0x37b3f8[_0xff03('0x27')]){delete _0x37b3f8['name'];}_0x4adb4f[_0xff03('0x18')](_0x99347)[_0xff03('0x28')](_0x37b3f8);};}exports[_0xff03('0x29')]=function(_0x266899,_0x2274a5){var _0x4c8dd6={},_0x1b7e6a={},_0x2f0c98={'count':0x0,'rows':[]};var _0x4fdebc=_[_0xff03('0x2a')](db[_0xff03('0x2b')][_0xff03('0x2c')],function(_0x21c391){return{'name':_0x21c391[_0xff03('0x2d')],'type':_0x21c391[_0xff03('0x2e')][_0xff03('0x2f')]};});_0x1b7e6a[_0xff03('0x30')]=_['map'](_0x4fdebc,_0xff03('0x27'));_0x1b7e6a[_0xff03('0x31')]=_[_0xff03('0x32')](_0x266899[_0xff03('0x31')]);_0x1b7e6a[_0xff03('0x33')]=_['intersection'](_0x1b7e6a[_0xff03('0x30')],_0x1b7e6a[_0xff03('0x31')]);_0x4c8dd6[_0xff03('0x34')]=_['intersection'](_0x1b7e6a['model'],qs[_0xff03('0x35')](_0x266899[_0xff03('0x31')][_0xff03('0x35')]));_0x4c8dd6[_0xff03('0x34')]=_0x4c8dd6[_0xff03('0x34')][_0xff03('0x36')]?_0x4c8dd6[_0xff03('0x34')]:_0x1b7e6a[_0xff03('0x30')];if(!_0x266899[_0xff03('0x31')][_0xff03('0x37')]('nolimit')){_0x4c8dd6[_0xff03('0x1d')]=qs['limit'](_0x266899[_0xff03('0x31')]['limit']);_0x4c8dd6['offset']=qs[_0xff03('0x1b')](_0x266899[_0xff03('0x31')][_0xff03('0x1b')]);}_0x4c8dd6['order']=qs[_0xff03('0x38')](_0x266899[_0xff03('0x31')][_0xff03('0x38')]);_0x4c8dd6['where']=qs[_0xff03('0x33')](_[_0xff03('0x39')](_0x266899[_0xff03('0x31')],_0x1b7e6a[_0xff03('0x33')]),_0x4fdebc);if(_0x266899[_0xff03('0x31')]['filter']){_0x4c8dd6[_0xff03('0x3a')]=_[_0xff03('0x3b')](_0x4c8dd6[_0xff03('0x3a')],{'$or':_[_0xff03('0x2a')](_0x4fdebc,function(_0x2c6521){if(_0x2c6521[_0xff03('0x2e')]!==_0xff03('0x3c')){var _0x1d635c={};_0x1d635c[_0x2c6521[_0xff03('0x27')]]={'$like':'%'+_0x266899[_0xff03('0x31')][_0xff03('0x3d')]+'%'};return _0x1d635c;}})});}_0x4c8dd6=_['merge']({},_0x4c8dd6,_0x266899['options']);var _0x16912e={'where':_0x4c8dd6[_0xff03('0x3a')]};return db[_0xff03('0x2b')][_0xff03('0x1e')](_0x16912e)[_0xff03('0x25')](function(_0x5f39bf){_0x2f0c98[_0xff03('0x1e')]=_0x5f39bf;if(_0x266899[_0xff03('0x31')]['includeAll']){_0x4c8dd6[_0xff03('0x3e')]=[{'all':!![]}];}return db[_0xff03('0x2b')][_0xff03('0x3f')](_0x4c8dd6);})[_0xff03('0x25')](function(_0x3fe3ad){_0x2f0c98[_0xff03('0x40')]=_0x3fe3ad;return _0x2f0c98;})[_0xff03('0x25')](respondWithFilteredResult(_0x2274a5,_0x4c8dd6))['catch'](handleError(_0x2274a5,null));};exports['show']=function(_0x42e8f6,_0x197eb7){var _0x3c7b27={'raw':![],'where':{'id':_0x42e8f6['params']['id']}},_0x46f835={};_0x46f835[_0xff03('0x30')]=_[_0xff03('0x32')](db[_0xff03('0x2b')]['rawAttributes']);_0x46f835[_0xff03('0x31')]=_[_0xff03('0x32')](_0x42e8f6['query']);_0x46f835[_0xff03('0x33')]=_[_0xff03('0x41')](_0x46f835['model'],_0x46f835[_0xff03('0x31')]);_0x3c7b27[_0xff03('0x34')]=_[_0xff03('0x41')](_0x46f835['model'],qs['fields'](_0x42e8f6[_0xff03('0x31')][_0xff03('0x35')]));_0x3c7b27[_0xff03('0x34')]=_0x3c7b27[_0xff03('0x34')][_0xff03('0x36')]?_0x3c7b27['attributes']:_0x46f835[_0xff03('0x30')];if(_0x42e8f6[_0xff03('0x31')]['includeAll']){_0x3c7b27[_0xff03('0x3e')]=[{'all':!![]}];}_0x3c7b27=_[_0xff03('0x3b')]({},_0x3c7b27,_0x42e8f6[_0xff03('0x42')]);return db['FreshsalesConfiguration'][_0xff03('0x43')](_0x3c7b27)[_0xff03('0x25')](handleEntityNotFound(_0x197eb7,null))['then'](respondWithResult(_0x197eb7,null))[_0xff03('0x44')](handleError(_0x197eb7,null));};exports[_0xff03('0x45')]=function(_0x14091d,_0x180512){return db[_0xff03('0x2b')][_0xff03('0x45')](_0x14091d[_0xff03('0x46')],{})['then'](respondWithResult(_0x180512,0xc9))[_0xff03('0x44')](handleError(_0x180512,null));};exports['update']=function(_0x3c5b3a,_0x4d6a46){if(_0x3c5b3a['body']['id']){delete _0x3c5b3a[_0xff03('0x46')]['id'];}return db[_0xff03('0x2b')][_0xff03('0x43')]({'where':{'id':_0x3c5b3a['params']['id']}})['then'](handleEntityNotFound(_0x4d6a46,null))['then'](saveUpdates(_0x3c5b3a[_0xff03('0x46')],null))[_0xff03('0x25')](respondWithResult(_0x4d6a46,null))[_0xff03('0x44')](handleError(_0x4d6a46,null));};exports['destroy']=function(_0x5b915d,_0x26346c){return db[_0xff03('0x2b')][_0xff03('0x43')]({'where':{'id':_0x5b915d[_0xff03('0x47')]['id']}})[_0xff03('0x25')](handleEntityNotFound(_0x26346c,null))[_0xff03('0x25')](removeEntity(_0x26346c,null))['catch'](handleError(_0x26346c,null));};exports[_0xff03('0x48')]=function(_0x5d2e24,_0x4a2fe0,_0x45c603){var _0x702d73={};var _0x245462={};var _0x175228;var _0x49feda;return db[_0xff03('0x2b')][_0xff03('0x49')]({'where':{'id':_0x5d2e24['params']['id']}})[_0xff03('0x25')](handleEntityNotFound(_0x4a2fe0,null))[_0xff03('0x25')](function(_0x5ecfbf){if(_0x5ecfbf){_0x175228=_0x5ecfbf;_0x245462[_0xff03('0x30')]=_['keys'](db[_0xff03('0x4a')][_0xff03('0x2c')]);_0x245462[_0xff03('0x31')]=_['keys'](_0x5d2e24[_0xff03('0x31')]);_0x245462[_0xff03('0x33')]=_[_0xff03('0x41')](_0x245462['model'],_0x245462[_0xff03('0x31')]);_0x702d73['attributes']=_[_0xff03('0x41')](_0x245462[_0xff03('0x30')],qs['fields'](_0x5d2e24[_0xff03('0x31')]['fields']));_0x702d73['attributes']=_0x702d73['attributes']['length']?_0x702d73[_0xff03('0x34')]:_0x245462[_0xff03('0x30')];_0x702d73[_0xff03('0x4b')]=qs[_0xff03('0x38')](_0x5d2e24[_0xff03('0x31')][_0xff03('0x38')]);_0x702d73[_0xff03('0x3a')]=qs['filters'](_['pick'](_0x5d2e24[_0xff03('0x31')],_0x245462[_0xff03('0x33')]));if(_0x5d2e24[_0xff03('0x31')][_0xff03('0x3d')]){_0x702d73[_0xff03('0x3a')]=_[_0xff03('0x3b')](_0x702d73['where'],{'$or':_[_0xff03('0x2a')](_0x702d73[_0xff03('0x34')],function(_0x17a2c9){var _0x316baf={};_0x316baf[_0x17a2c9]={'$like':'%'+_0x5d2e24[_0xff03('0x31')][_0xff03('0x3d')]+'%'};return _0x316baf;})});}_0x702d73=_[_0xff03('0x3b')]({},_0x702d73,_0x5d2e24[_0xff03('0x42')]);return _0x175228['getSubjects'](_0x702d73);}})['then'](function(_0xeebe54){if(_0xeebe54){_0x49feda=_0xeebe54[_0xff03('0x36')];if(!_0x5d2e24['query']['hasOwnProperty'](_0xff03('0x4c'))){_0x702d73[_0xff03('0x1d')]=qs[_0xff03('0x1d')](_0x5d2e24[_0xff03('0x31')][_0xff03('0x1d')]);_0x702d73[_0xff03('0x1b')]=qs[_0xff03('0x1b')](_0x5d2e24[_0xff03('0x31')][_0xff03('0x1b')]);}return _0x175228[_0xff03('0x48')](_0x702d73);}})['then'](function(_0xcca9b8){if(_0xcca9b8){return _0xcca9b8?{'count':_0x49feda,'rows':_0xcca9b8}:null;}})[_0xff03('0x25')](respondWithResult(_0x4a2fe0,null))[_0xff03('0x44')](handleError(_0x4a2fe0,null));};exports['getDescriptions']=function(_0x5c2739,_0x2e1b15,_0x1715d9){var _0x288095={};var _0x2cb49a={};var _0x5376a7;var _0x464bb7;return db[_0xff03('0x2b')]['findOne']({'where':{'id':_0x5c2739[_0xff03('0x47')]['id']}})[_0xff03('0x25')](handleEntityNotFound(_0x2e1b15,null))[_0xff03('0x25')](function(_0x43021e){if(_0x43021e){_0x5376a7=_0x43021e;_0x2cb49a[_0xff03('0x30')]=_[_0xff03('0x32')](db[_0xff03('0x4a')][_0xff03('0x2c')]);_0x2cb49a[_0xff03('0x31')]=_[_0xff03('0x32')](_0x5c2739[_0xff03('0x31')]);_0x2cb49a['filters']=_[_0xff03('0x41')](_0x2cb49a[_0xff03('0x30')],_0x2cb49a[_0xff03('0x31')]);_0x288095[_0xff03('0x34')]=_['intersection'](_0x2cb49a[_0xff03('0x30')],qs[_0xff03('0x35')](_0x5c2739[_0xff03('0x31')]['fields']));_0x288095[_0xff03('0x34')]=_0x288095[_0xff03('0x34')]['length']?_0x288095[_0xff03('0x34')]:_0x2cb49a['model'];_0x288095[_0xff03('0x4b')]=qs['sort'](_0x5c2739['query'][_0xff03('0x38')]);_0x288095[_0xff03('0x3a')]=qs[_0xff03('0x33')](_['pick'](_0x5c2739[_0xff03('0x31')],_0x2cb49a[_0xff03('0x33')]));if(_0x5c2739[_0xff03('0x31')][_0xff03('0x3d')]){_0x288095[_0xff03('0x3a')]=_[_0xff03('0x3b')](_0x288095[_0xff03('0x3a')],{'$or':_[_0xff03('0x2a')](_0x288095['attributes'],function(_0x5a4317){var _0x46fd97={};_0x46fd97[_0x5a4317]={'$like':'%'+_0x5c2739[_0xff03('0x31')][_0xff03('0x3d')]+'%'};return _0x46fd97;})});}_0x288095=_[_0xff03('0x3b')]({},_0x288095,_0x5c2739[_0xff03('0x42')]);return _0x5376a7['getDescriptions'](_0x288095);}})[_0xff03('0x25')](function(_0x5c2018){if(_0x5c2018){_0x464bb7=_0x5c2018['length'];if(!_0x5c2739[_0xff03('0x31')]['hasOwnProperty']('nolimit')){_0x288095[_0xff03('0x1d')]=qs[_0xff03('0x1d')](_0x5c2739[_0xff03('0x31')][_0xff03('0x1d')]);_0x288095[_0xff03('0x1b')]=qs[_0xff03('0x1b')](_0x5c2739[_0xff03('0x31')][_0xff03('0x1b')]);}return _0x5376a7['getDescriptions'](_0x288095);}})[_0xff03('0x25')](function(_0x4c90db){if(_0x4c90db){return _0x4c90db?{'count':_0x464bb7,'rows':_0x4c90db}:null;}})[_0xff03('0x25')](respondWithResult(_0x2e1b15,null))[_0xff03('0x44')](handleError(_0x2e1b15,null));};exports[_0xff03('0x4d')]=function(_0x152d28,_0x132c60,_0x312983){var _0x18164b={};var _0x214e5c={};var _0x1363de;var _0x119f26;return db[_0xff03('0x2b')][_0xff03('0x49')]({'where':{'id':_0x152d28[_0xff03('0x47')]['id']}})['then'](handleEntityNotFound(_0x132c60,null))[_0xff03('0x25')](function(_0x1a234b){if(_0x1a234b){_0x1363de=_0x1a234b;_0x214e5c[_0xff03('0x30')]=_[_0xff03('0x32')](db['FreshsalesField'][_0xff03('0x2c')]);_0x214e5c['query']=_[_0xff03('0x32')](_0x152d28[_0xff03('0x31')]);_0x214e5c[_0xff03('0x33')]=_['intersection'](_0x214e5c[_0xff03('0x30')],_0x214e5c[_0xff03('0x31')]);_0x18164b[_0xff03('0x34')]=_[_0xff03('0x41')](_0x214e5c[_0xff03('0x30')],qs[_0xff03('0x35')](_0x152d28[_0xff03('0x31')]['fields']));_0x18164b[_0xff03('0x34')]=_0x18164b['attributes'][_0xff03('0x36')]?_0x18164b[_0xff03('0x34')]:_0x214e5c[_0xff03('0x30')];_0x18164b[_0xff03('0x4b')]=qs[_0xff03('0x38')](_0x152d28['query'][_0xff03('0x38')]);_0x18164b['where']=qs['filters'](_[_0xff03('0x39')](_0x152d28['query'],_0x214e5c[_0xff03('0x33')]));if(_0x152d28[_0xff03('0x31')][_0xff03('0x3d')]){_0x18164b[_0xff03('0x3a')]=_[_0xff03('0x3b')](_0x18164b[_0xff03('0x3a')],{'$or':_[_0xff03('0x2a')](_0x18164b[_0xff03('0x34')],function(_0x554d42){var _0x328f01={};_0x328f01[_0x554d42]={'$like':'%'+_0x152d28[_0xff03('0x31')][_0xff03('0x3d')]+'%'};return _0x328f01;})});}_0x18164b=_['merge']({},_0x18164b,_0x152d28[_0xff03('0x42')]);return _0x1363de[_0xff03('0x4d')](_0x18164b);}})[_0xff03('0x25')](function(_0x45f474){if(_0x45f474){_0x119f26=_0x45f474[_0xff03('0x36')];if(!_0x152d28[_0xff03('0x31')]['hasOwnProperty'](_0xff03('0x4c'))){_0x18164b[_0xff03('0x1d')]=qs[_0xff03('0x1d')](_0x152d28['query']['limit']);_0x18164b[_0xff03('0x1b')]=qs[_0xff03('0x1b')](_0x152d28[_0xff03('0x31')][_0xff03('0x1b')]);}return _0x1363de['getFields'](_0x18164b);}})[_0xff03('0x25')](function(_0xf3fb18){if(_0xf3fb18){return _0xf3fb18?{'count':_0x119f26,'rows':_0xf3fb18}:null;}})[_0xff03('0x25')](respondWithResult(_0x132c60,null))[_0xff03('0x44')](handleError(_0x132c60,null));}; \ No newline at end of file +var _0x652f=['FreshsalesConfiguration','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map'];(function(_0x2399b1,_0x4daff9){var _0x5f1404=function(_0x54f088){while(--_0x54f088){_0x2399b1['push'](_0x2399b1['shift']());}};_0x5f1404(++_0x4daff9);}(_0x652f,0x1ba));var _0xf652=function(_0x4286c0,_0x376c4e){_0x4286c0=_0x4286c0-0x0;var _0xae9449=_0x652f[_0x4286c0];return _0xae9449;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf652('0x0'));var zipdir=require(_0xf652('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf652('0x2'));var moment=require(_0xf652('0x3'));var BPromise=require(_0xf652('0x4'));var Mustache=require(_0xf652('0x5'));var util=require('util');var path=require(_0xf652('0x6'));var sox=require(_0xf652('0x7'));var csv=require('to-csv');var ejs=require(_0xf652('0x8'));var fs=require('fs');var fs_extra=require(_0xf652('0x9'));var _=require(_0xf652('0xa'));var squel=require(_0xf652('0xb'));var crypto=require(_0xf652('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf652('0xd'));var querystring=require(_0xf652('0xe'));var Papa=require(_0xf652('0xf'));var Redis=require(_0xf652('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf652('0x11'));var as=require(_0xf652('0x12'));var hardwareService=require(_0xf652('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf652('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf652('0x15'));var db=require(_0xf652('0x16'))['db'];function respondWithStatusCode(_0x5001d2,_0x11345c){_0x11345c=_0x11345c||0xcc;return function(_0x2e7193){if(_0x2e7193){return _0x5001d2['sendStatus'](_0x11345c);}return _0x5001d2[_0xf652('0x17')](_0x11345c)[_0xf652('0x18')]();};}function respondWithResult(_0x4a80cc,_0x557c9e){_0x557c9e=_0x557c9e||0xc8;return function(_0x580fab){if(_0x580fab){return _0x4a80cc[_0xf652('0x17')](_0x557c9e)[_0xf652('0x19')](_0x580fab);}};}function respondWithFilteredResult(_0x5c0bdc,_0x24aa4e){return function(_0x3494e0){if(_0x3494e0){var _0x2693c0=typeof _0x24aa4e['offset']==='undefined'&&typeof _0x24aa4e[_0xf652('0x1a')]===_0xf652('0x1b');var _0x43276e=_0x3494e0[_0xf652('0x1c')];var _0x4337f4=_0x2693c0?0x0:_0x24aa4e[_0xf652('0x1d')];var _0x1dabcb=_0x2693c0?_0x3494e0[_0xf652('0x1c')]:_0x24aa4e[_0xf652('0x1d')]+_0x24aa4e[_0xf652('0x1a')];var _0x5eca2d;if(_0x1dabcb>=_0x43276e){_0x1dabcb=_0x43276e;_0x5eca2d=0xc8;}else{_0x5eca2d=0xce;}_0x5c0bdc[_0xf652('0x17')](_0x5eca2d);return _0x5c0bdc[_0xf652('0x1e')](_0xf652('0x1f'),_0x4337f4+'-'+_0x1dabcb+'/'+_0x43276e)[_0xf652('0x19')](_0x3494e0);}return null;};}function patchUpdates(_0x4bc41e){return function(_0x4e8744){try{jsonpatch[_0xf652('0x20')](_0x4e8744,_0x4bc41e,!![]);}catch(_0x5edb72){return BPromise[_0xf652('0x21')](_0x5edb72);}return _0x4e8744[_0xf652('0x22')]();};}function saveUpdates(_0x156f7b,_0x2b5b90){return function(_0x40d597){if(_0x40d597){return _0x40d597[_0xf652('0x23')](_0x156f7b)[_0xf652('0x24')](function(_0x2b1fdf){return _0x2b1fdf;});}return null;};}function removeEntity(_0x4da314,_0x2a1434){return function(_0x56a38c){if(_0x56a38c){return _0x56a38c[_0xf652('0x25')]()[_0xf652('0x24')](function(){_0x4da314[_0xf652('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57213c,_0x460c1d){return function(_0x4e91eb){if(!_0x4e91eb){_0x57213c[_0xf652('0x26')](0x194);}return _0x4e91eb;};}function handleError(_0x1b159c,_0x328a3e){_0x328a3e=_0x328a3e||0x1f4;return function(_0x287149){logger[_0xf652('0x27')](_0x287149[_0xf652('0x28')]);if(_0x287149[_0xf652('0x29')]){delete _0x287149[_0xf652('0x29')];}_0x1b159c[_0xf652('0x17')](_0x328a3e)[_0xf652('0x2a')](_0x287149);};}exports['index']=function(_0x212cab,_0x553acb){var _0x20e416={},_0xf90e5c={},_0x4fa104={'count':0x0,'rows':[]};var _0x5b1ee4=_[_0xf652('0x2b')](db[_0xf652('0x2c')][_0xf652('0x2d')],function(_0x2a10e2){return{'name':_0x2a10e2['fieldName'],'type':_0x2a10e2[_0xf652('0x2e')][_0xf652('0x2f')]};});_0xf90e5c[_0xf652('0x30')]=_[_0xf652('0x2b')](_0x5b1ee4,_0xf652('0x29'));_0xf90e5c['query']=_[_0xf652('0x31')](_0x212cab['query']);_0xf90e5c[_0xf652('0x32')]=_[_0xf652('0x33')](_0xf90e5c[_0xf652('0x30')],_0xf90e5c[_0xf652('0x34')]);_0x20e416[_0xf652('0x35')]=_[_0xf652('0x33')](_0xf90e5c[_0xf652('0x30')],qs[_0xf652('0x36')](_0x212cab[_0xf652('0x34')]['fields']));_0x20e416[_0xf652('0x35')]=_0x20e416[_0xf652('0x35')][_0xf652('0x37')]?_0x20e416[_0xf652('0x35')]:_0xf90e5c[_0xf652('0x30')];if(!_0x212cab[_0xf652('0x34')][_0xf652('0x38')](_0xf652('0x39'))){_0x20e416['limit']=qs[_0xf652('0x1a')](_0x212cab['query'][_0xf652('0x1a')]);_0x20e416[_0xf652('0x1d')]=qs['offset'](_0x212cab['query'][_0xf652('0x1d')]);}_0x20e416[_0xf652('0x3a')]=qs['sort'](_0x212cab[_0xf652('0x34')][_0xf652('0x3b')]);_0x20e416[_0xf652('0x3c')]=qs['filters'](_[_0xf652('0x3d')](_0x212cab[_0xf652('0x34')],_0xf90e5c['filters']),_0x5b1ee4);if(_0x212cab[_0xf652('0x34')]['filter']){_0x20e416['where']=_['merge'](_0x20e416[_0xf652('0x3c')],{'$or':_[_0xf652('0x2b')](_0x5b1ee4,function(_0x41c63e){if(_0x41c63e[_0xf652('0x2e')]!==_0xf652('0x3e')){var _0x299167={};_0x299167[_0x41c63e['name']]={'$like':'%'+_0x212cab[_0xf652('0x34')][_0xf652('0x3f')]+'%'};return _0x299167;}})});}_0x20e416=_[_0xf652('0x40')]({},_0x20e416,_0x212cab[_0xf652('0x41')]);var _0x2d6a6f={'where':_0x20e416['where']};return db[_0xf652('0x2c')]['count'](_0x2d6a6f)[_0xf652('0x24')](function(_0x2eeb6d){_0x4fa104[_0xf652('0x1c')]=_0x2eeb6d;if(_0x212cab[_0xf652('0x34')][_0xf652('0x42')]){_0x20e416[_0xf652('0x43')]=[{'all':!![]}];}return db[_0xf652('0x2c')][_0xf652('0x44')](_0x20e416);})[_0xf652('0x24')](function(_0x555e3f){_0x4fa104[_0xf652('0x45')]=_0x555e3f;return _0x4fa104;})[_0xf652('0x24')](respondWithFilteredResult(_0x553acb,_0x20e416))[_0xf652('0x46')](handleError(_0x553acb,null));};exports[_0xf652('0x47')]=function(_0x1d9467,_0x52fc96){var _0x1af9c5={'raw':![],'where':{'id':_0x1d9467[_0xf652('0x48')]['id']}},_0x1871f0={};_0x1871f0['model']=_[_0xf652('0x31')](db[_0xf652('0x2c')]['rawAttributes']);_0x1871f0[_0xf652('0x34')]=_['keys'](_0x1d9467[_0xf652('0x34')]);_0x1871f0[_0xf652('0x32')]=_['intersection'](_0x1871f0[_0xf652('0x30')],_0x1871f0[_0xf652('0x34')]);_0x1af9c5['attributes']=_[_0xf652('0x33')](_0x1871f0[_0xf652('0x30')],qs[_0xf652('0x36')](_0x1d9467[_0xf652('0x34')][_0xf652('0x36')]));_0x1af9c5[_0xf652('0x35')]=_0x1af9c5[_0xf652('0x35')][_0xf652('0x37')]?_0x1af9c5['attributes']:_0x1871f0[_0xf652('0x30')];if(_0x1d9467[_0xf652('0x34')][_0xf652('0x42')]){_0x1af9c5[_0xf652('0x43')]=[{'all':!![]}];}_0x1af9c5=_[_0xf652('0x40')]({},_0x1af9c5,_0x1d9467[_0xf652('0x41')]);return db[_0xf652('0x2c')][_0xf652('0x49')](_0x1af9c5)[_0xf652('0x24')](handleEntityNotFound(_0x52fc96,null))[_0xf652('0x24')](respondWithResult(_0x52fc96,null))[_0xf652('0x46')](handleError(_0x52fc96,null));};exports[_0xf652('0x4a')]=function(_0x1c91f1,_0x3d0123){return db[_0xf652('0x2c')][_0xf652('0x4a')](_0x1c91f1['body'],{})[_0xf652('0x24')](respondWithResult(_0x3d0123,0xc9))[_0xf652('0x46')](handleError(_0x3d0123,null));};exports['update']=function(_0x17e16e,_0x468319){if(_0x17e16e[_0xf652('0x4b')]['id']){delete _0x17e16e[_0xf652('0x4b')]['id'];}return db[_0xf652('0x2c')][_0xf652('0x49')]({'where':{'id':_0x17e16e[_0xf652('0x48')]['id']}})[_0xf652('0x24')](handleEntityNotFound(_0x468319,null))['then'](saveUpdates(_0x17e16e['body'],null))[_0xf652('0x24')](respondWithResult(_0x468319,null))[_0xf652('0x46')](handleError(_0x468319,null));};exports['destroy']=function(_0x4bcd47,_0x56e4ad){return db[_0xf652('0x2c')][_0xf652('0x49')]({'where':{'id':_0x4bcd47['params']['id']}})['then'](handleEntityNotFound(_0x56e4ad,null))[_0xf652('0x24')](removeEntity(_0x56e4ad,null))['catch'](handleError(_0x56e4ad,null));};exports['getSubjects']=function(_0x45b3ea,_0x3fdc1f,_0x4c9e8e){var _0x4ab05e={};var _0x184c02={};var _0x2c05f1;var _0xa7bf68;return db[_0xf652('0x2c')][_0xf652('0x4c')]({'where':{'id':_0x45b3ea[_0xf652('0x48')]['id']}})[_0xf652('0x24')](handleEntityNotFound(_0x3fdc1f,null))[_0xf652('0x24')](function(_0x5c21b2){if(_0x5c21b2){_0x2c05f1=_0x5c21b2;_0x184c02['model']=_[_0xf652('0x31')](db[_0xf652('0x4d')][_0xf652('0x2d')]);_0x184c02['query']=_['keys'](_0x45b3ea[_0xf652('0x34')]);_0x184c02[_0xf652('0x32')]=_[_0xf652('0x33')](_0x184c02[_0xf652('0x30')],_0x184c02[_0xf652('0x34')]);_0x4ab05e['attributes']=_[_0xf652('0x33')](_0x184c02[_0xf652('0x30')],qs[_0xf652('0x36')](_0x45b3ea[_0xf652('0x34')][_0xf652('0x36')]));_0x4ab05e['attributes']=_0x4ab05e[_0xf652('0x35')][_0xf652('0x37')]?_0x4ab05e['attributes']:_0x184c02['model'];_0x4ab05e['order']=qs[_0xf652('0x3b')](_0x45b3ea[_0xf652('0x34')][_0xf652('0x3b')]);_0x4ab05e[_0xf652('0x3c')]=qs[_0xf652('0x32')](_[_0xf652('0x3d')](_0x45b3ea[_0xf652('0x34')],_0x184c02[_0xf652('0x32')]));if(_0x45b3ea[_0xf652('0x34')][_0xf652('0x3f')]){_0x4ab05e[_0xf652('0x3c')]=_[_0xf652('0x40')](_0x4ab05e[_0xf652('0x3c')],{'$or':_[_0xf652('0x2b')](_0x4ab05e[_0xf652('0x35')],function(_0x3af9d8){var _0x498d9e={};_0x498d9e[_0x3af9d8]={'$like':'%'+_0x45b3ea['query'][_0xf652('0x3f')]+'%'};return _0x498d9e;})});}_0x4ab05e=_[_0xf652('0x40')]({},_0x4ab05e,_0x45b3ea[_0xf652('0x41')]);return _0x2c05f1['getSubjects'](_0x4ab05e);}})[_0xf652('0x24')](function(_0x5697c0){if(_0x5697c0){_0xa7bf68=_0x5697c0[_0xf652('0x37')];if(!_0x45b3ea['query'][_0xf652('0x38')](_0xf652('0x39'))){_0x4ab05e['limit']=qs[_0xf652('0x1a')](_0x45b3ea[_0xf652('0x34')][_0xf652('0x1a')]);_0x4ab05e['offset']=qs[_0xf652('0x1d')](_0x45b3ea[_0xf652('0x34')][_0xf652('0x1d')]);}return _0x2c05f1[_0xf652('0x4e')](_0x4ab05e);}})[_0xf652('0x24')](function(_0x180feb){if(_0x180feb){return _0x180feb?{'count':_0xa7bf68,'rows':_0x180feb}:null;}})[_0xf652('0x24')](respondWithResult(_0x3fdc1f,null))[_0xf652('0x46')](handleError(_0x3fdc1f,null));};exports[_0xf652('0x4f')]=function(_0x27d18f,_0x3d9417,_0x366f2d){var _0x40bb82={};var _0x323655={};var _0x3d37e7;var _0x4a3df6;return db[_0xf652('0x2c')]['findOne']({'where':{'id':_0x27d18f[_0xf652('0x48')]['id']}})[_0xf652('0x24')](handleEntityNotFound(_0x3d9417,null))[_0xf652('0x24')](function(_0x222c37){if(_0x222c37){_0x3d37e7=_0x222c37;_0x323655[_0xf652('0x30')]=_['keys'](db[_0xf652('0x4d')][_0xf652('0x2d')]);_0x323655[_0xf652('0x34')]=_[_0xf652('0x31')](_0x27d18f['query']);_0x323655[_0xf652('0x32')]=_[_0xf652('0x33')](_0x323655[_0xf652('0x30')],_0x323655[_0xf652('0x34')]);_0x40bb82[_0xf652('0x35')]=_[_0xf652('0x33')](_0x323655[_0xf652('0x30')],qs[_0xf652('0x36')](_0x27d18f[_0xf652('0x34')][_0xf652('0x36')]));_0x40bb82[_0xf652('0x35')]=_0x40bb82[_0xf652('0x35')][_0xf652('0x37')]?_0x40bb82[_0xf652('0x35')]:_0x323655[_0xf652('0x30')];_0x40bb82[_0xf652('0x3a')]=qs['sort'](_0x27d18f[_0xf652('0x34')][_0xf652('0x3b')]);_0x40bb82[_0xf652('0x3c')]=qs['filters'](_[_0xf652('0x3d')](_0x27d18f['query'],_0x323655[_0xf652('0x32')]));if(_0x27d18f['query']['filter']){_0x40bb82[_0xf652('0x3c')]=_[_0xf652('0x40')](_0x40bb82['where'],{'$or':_[_0xf652('0x2b')](_0x40bb82[_0xf652('0x35')],function(_0x20ee83){var _0x20291e={};_0x20291e[_0x20ee83]={'$like':'%'+_0x27d18f[_0xf652('0x34')][_0xf652('0x3f')]+'%'};return _0x20291e;})});}_0x40bb82=_[_0xf652('0x40')]({},_0x40bb82,_0x27d18f['options']);return _0x3d37e7[_0xf652('0x4f')](_0x40bb82);}})[_0xf652('0x24')](function(_0x2af037){if(_0x2af037){_0x4a3df6=_0x2af037['length'];if(!_0x27d18f[_0xf652('0x34')]['hasOwnProperty']('nolimit')){_0x40bb82[_0xf652('0x1a')]=qs[_0xf652('0x1a')](_0x27d18f['query'][_0xf652('0x1a')]);_0x40bb82[_0xf652('0x1d')]=qs['offset'](_0x27d18f['query'][_0xf652('0x1d')]);}return _0x3d37e7['getDescriptions'](_0x40bb82);}})[_0xf652('0x24')](function(_0x441427){if(_0x441427){return _0x441427?{'count':_0x4a3df6,'rows':_0x441427}:null;}})[_0xf652('0x24')](respondWithResult(_0x3d9417,null))[_0xf652('0x46')](handleError(_0x3d9417,null));};exports[_0xf652('0x50')]=function(_0x5b0bd1,_0xd75267,_0x33e35b){var _0x4a591e={};var _0x4fb2b4={};var _0x1b0848;var _0x26bf62;return db['FreshsalesConfiguration'][_0xf652('0x4c')]({'where':{'id':_0x5b0bd1[_0xf652('0x48')]['id']}})[_0xf652('0x24')](handleEntityNotFound(_0xd75267,null))[_0xf652('0x24')](function(_0x31d2bc){if(_0x31d2bc){_0x1b0848=_0x31d2bc;_0x4fb2b4[_0xf652('0x30')]=_[_0xf652('0x31')](db[_0xf652('0x4d')]['rawAttributes']);_0x4fb2b4[_0xf652('0x34')]=_[_0xf652('0x31')](_0x5b0bd1[_0xf652('0x34')]);_0x4fb2b4[_0xf652('0x32')]=_[_0xf652('0x33')](_0x4fb2b4[_0xf652('0x30')],_0x4fb2b4['query']);_0x4a591e[_0xf652('0x35')]=_[_0xf652('0x33')](_0x4fb2b4['model'],qs[_0xf652('0x36')](_0x5b0bd1[_0xf652('0x34')][_0xf652('0x36')]));_0x4a591e['attributes']=_0x4a591e[_0xf652('0x35')][_0xf652('0x37')]?_0x4a591e['attributes']:_0x4fb2b4['model'];_0x4a591e[_0xf652('0x3a')]=qs[_0xf652('0x3b')](_0x5b0bd1['query'][_0xf652('0x3b')]);_0x4a591e[_0xf652('0x3c')]=qs[_0xf652('0x32')](_[_0xf652('0x3d')](_0x5b0bd1[_0xf652('0x34')],_0x4fb2b4[_0xf652('0x32')]));if(_0x5b0bd1[_0xf652('0x34')][_0xf652('0x3f')]){_0x4a591e[_0xf652('0x3c')]=_[_0xf652('0x40')](_0x4a591e[_0xf652('0x3c')],{'$or':_[_0xf652('0x2b')](_0x4a591e[_0xf652('0x35')],function(_0x23937f){var _0x5d4b8f={};_0x5d4b8f[_0x23937f]={'$like':'%'+_0x5b0bd1['query'][_0xf652('0x3f')]+'%'};return _0x5d4b8f;})});}_0x4a591e=_[_0xf652('0x40')]({},_0x4a591e,_0x5b0bd1[_0xf652('0x41')]);return _0x1b0848['getFields'](_0x4a591e);}})[_0xf652('0x24')](function(_0x2c3655){if(_0x2c3655){_0x26bf62=_0x2c3655[_0xf652('0x37')];if(!_0x5b0bd1['query'][_0xf652('0x38')]('nolimit')){_0x4a591e['limit']=qs[_0xf652('0x1a')](_0x5b0bd1[_0xf652('0x34')][_0xf652('0x1a')]);_0x4a591e[_0xf652('0x1d')]=qs[_0xf652('0x1d')](_0x5b0bd1[_0xf652('0x34')][_0xf652('0x1d')]);}return _0x1b0848[_0xf652('0x50')](_0x4a591e);}})[_0xf652('0x24')](function(_0x5936ab){if(_0x5936ab){return _0x5936ab?{'count':_0x26bf62,'rows':_0x5936ab}:null;}})[_0xf652('0x24')](respondWithResult(_0xd75267,null))[_0xf652('0x46')](handleError(_0xd75267,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 0f5e00f..cc86055 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 _0x2a95=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','util','bluebird'];(function(_0x4d6467,_0x401636){var _0x310498=function(_0x36f2f9){while(--_0x36f2f9){_0x4d6467['push'](_0x4d6467['shift']());}};_0x310498(++_0x401636);}(_0x2a95,0x139));var _0x52a9=function(_0x1e6f59,_0x16128c){_0x1e6f59=_0x1e6f59-0x0;var _0x2be16b=_0x2a95[_0x1e6f59];return _0x2be16b;};'use strict';var _=require('lodash');var util=require(_0x52a9('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x52a9('0x1'));var rp=require(_0x52a9('0x2'));var fs=require('fs');var path=require(_0x52a9('0x3'));var rimraf=require(_0x52a9('0x4'));var config=require(_0x52a9('0x5'));var attributes=require(_0x52a9('0x6'));module['exports']=function(_0x220aef,_0x158dd8){return _0x220aef['define'](_0x52a9('0x7'),attributes,{'tableName':_0x52a9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdca9=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','moment','bluebird','request-promise'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xdca9,0x1b5));var _0x9dca=function(_0x2fc25a,_0x5ce8e0){_0x2fc25a=_0x2fc25a-0x0;var _0x530c02=_0xdca9[_0x2fc25a];return _0x530c02;};'use strict';var _=require('lodash');var util=require(_0x9dca('0x0'));var logger=require('../../config/logger')(_0x9dca('0x1'));var moment=require(_0x9dca('0x2'));var BPromise=require(_0x9dca('0x3'));var rp=require(_0x9dca('0x4'));var fs=require('fs');var path=require(_0x9dca('0x5'));var rimraf=require(_0x9dca('0x6'));var config=require(_0x9dca('0x7'));var attributes=require(_0x9dca('0x8'));module[_0x9dca('0x9')]=function(_0x2446f4,_0x2c8155){return _0x2446f4[_0x9dca('0xa')](_0x9dca('0xb'),attributes,{'tableName':_0x9dca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 7f8cb0f..6b47c41 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 _0x72cf=['../../config/environment','jayson/promise','client','http','info','request\x20sent','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1bdb82,_0x50e7a5){var _0x11a52b=function(_0x5f2d02){while(--_0x5f2d02){_0x1bdb82['push'](_0x1bdb82['shift']());}};_0x11a52b(++_0x50e7a5);}(_0x72cf,0x92));var _0xf72c=function(_0xdc4d41,_0x20823f){_0xdc4d41=_0xdc4d41-0x0;var _0x54bced=_0x72cf[_0xdc4d41];return _0x54bced;};'use strict';var _=require(_0xf72c('0x0'));var util=require(_0xf72c('0x1'));var moment=require('moment');var BPromise=require(_0xf72c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf72c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf72c('0x4'));var logger=require(_0xf72c('0x5'))(_0xf72c('0x6'));var config=require(_0xf72c('0x7'));var jayson=require(_0xf72c('0x8'));var client=jayson[_0xf72c('0x9')][_0xf72c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26564a,_0x54cf35,_0x32618f){return new BPromise(function(_0x10269f,_0x28cfb4){return client['request'](_0x26564a,_0x32618f)['then'](function(_0x481512){logger[_0xf72c('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54cf35,_0xf72c('0xc'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x54cf35,_0xf72c('0xc'),JSON['stringify'](_0x481512));if(_0x481512['error']){if(_0x481512[_0xf72c('0xd')]['code']===0x1f4){logger[_0xf72c('0xd')](_0xf72c('0xe'),_0x54cf35,_0x481512[_0xf72c('0xd')][_0xf72c('0xf')]);return _0x28cfb4(_0x481512['error']['message']);}logger[_0xf72c('0xd')](_0xf72c('0xe'),_0x54cf35,_0x481512[_0xf72c('0xd')][_0xf72c('0xf')]);return _0x10269f(_0x481512['error'][_0xf72c('0xf')]);}else{logger[_0xf72c('0xb')](_0xf72c('0xe'),_0x54cf35,'request\x20sent');_0x10269f(_0x481512[_0xf72c('0x10')][_0xf72c('0xf')]);}})['catch'](function(_0x546111){logger[_0xf72c('0xd')](_0xf72c('0xe'),_0x54cf35,_0x546111);_0x28cfb4(_0x546111);});});} \ No newline at end of file +var _0xfb98=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x368d08,_0xc6a51d){var _0x218f12=function(_0x14d7f8){while(--_0x14d7f8){_0x368d08['push'](_0x368d08['shift']());}};_0x218f12(++_0xc6a51d);}(_0xfb98,0x1ad));var _0x8fb9=function(_0xff2152,_0x4b66c9){_0xff2152=_0xff2152-0x0;var _0x442d2a=_0xfb98[_0xff2152];return _0x442d2a;};'use strict';var _=require('lodash');var util=require(_0x8fb9('0x0'));var moment=require('moment');var BPromise=require(_0x8fb9('0x1'));var rs=require(_0x8fb9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fb9('0x3'))['db'];var utils=require(_0x8fb9('0x4'));var logger=require(_0x8fb9('0x5'))(_0x8fb9('0x6'));var config=require(_0x8fb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8fb9('0x8')][_0x8fb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d7739,_0x49a4ed,_0x3cfaa0){return new BPromise(function(_0x17ed98,_0x37542b){return client['request'](_0x1d7739,_0x3cfaa0)['then'](function(_0x587da6){logger[_0x8fb9('0xa')](_0x8fb9('0xb'),_0x49a4ed,_0x8fb9('0xc'));logger[_0x8fb9('0xd')](_0x8fb9('0xe'),_0x49a4ed,_0x8fb9('0xc'),JSON[_0x8fb9('0xf')](_0x587da6));if(_0x587da6[_0x8fb9('0x10')]){if(_0x587da6[_0x8fb9('0x10')][_0x8fb9('0x11')]===0x1f4){logger[_0x8fb9('0x10')](_0x8fb9('0xb'),_0x49a4ed,_0x587da6['error']['message']);return _0x37542b(_0x587da6[_0x8fb9('0x10')][_0x8fb9('0x12')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x49a4ed,_0x587da6[_0x8fb9('0x10')]['message']);return _0x17ed98(_0x587da6[_0x8fb9('0x10')][_0x8fb9('0x12')]);}else{logger[_0x8fb9('0xa')](_0x8fb9('0xb'),_0x49a4ed,_0x8fb9('0xc'));_0x17ed98(_0x587da6[_0x8fb9('0x13')][_0x8fb9('0x12')]);}})[_0x8fb9('0x14')](function(_0x138809){logger['error'](_0x8fb9('0xb'),_0x49a4ed,_0x138809);_0x37542b(_0x138809);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index b260648..5f9466a 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 _0x777f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer'];(function(_0x3a2797,_0x1f905c){var _0x5c2d96=function(_0x3c7bd7){while(--_0x3c7bd7){_0x3a2797['push'](_0x3a2797['shift']());}};_0x5c2d96(++_0x1f905c);}(_0x777f,0x9f));var _0xf777=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x777f[_0x25efdf];return _0x22c495;};'use strict';var multer=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var path=require(_0xf777('0x2'));var timeout=require(_0xf777('0x3'));var express=require(_0xf777('0x4'));var router=express[_0xf777('0x5')]();var fs_extra=require(_0xf777('0x6'));var auth=require(_0xf777('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf777('0x8'));var controller=require(_0xf777('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf777('0xa')](_0xf777('0xb'),auth[_0xf777('0xc')](),controller[_0xf777('0xd')]);router[_0xf777('0xe')]('/',auth[_0xf777('0xc')](),controller[_0xf777('0xf')]);router[_0xf777('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf777('0x11')](_0xf777('0xb'),auth['isAuthenticated'](),controller[_0xf777('0x12')]);module[_0xf777('0x13')]=router; \ No newline at end of file +var _0x136c=['show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated'];(function(_0x5ced49,_0x3a23c1){var _0x40bfe2=function(_0x181642){while(--_0x181642){_0x5ced49['push'](_0x5ced49['shift']());}};_0x40bfe2(++_0x3a23c1);}(_0x136c,0x1d2));var _0xc136=function(_0xa2c37d,_0x644ba2){_0xa2c37d=_0xa2c37d-0x0;var _0x469aca=_0x136c[_0xa2c37d];return _0x469aca;};'use strict';var multer=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var path=require('path');var timeout=require(_0xc136('0x2'));var express=require(_0xc136('0x3'));var router=express[_0xc136('0x4')]();var fs_extra=require(_0xc136('0x5'));var auth=require(_0xc136('0x6'));var interaction=require(_0xc136('0x7'));var config=require(_0xc136('0x8'));var controller=require(_0xc136('0x9'));router[_0xc136('0xa')]('/',auth['isAuthenticated'](),controller[_0xc136('0xb')]);router['get'](_0xc136('0xc'),auth[_0xc136('0xd')](),controller[_0xc136('0xe')]);router['post']('/',auth[_0xc136('0xd')](),controller['create']);router[_0xc136('0xf')](_0xc136('0xc'),auth[_0xc136('0xd')](),controller[_0xc136('0x10')]);router[_0xc136('0x11')](_0xc136('0xc'),auth[_0xc136('0xd')](),controller[_0xc136('0x12')]);module[_0xc136('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 85f6136..8dd533a 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 _0x1f40=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x31d4a7,_0x135a21){var _0x12b3c6=function(_0x110b8d){while(--_0x110b8d){_0x31d4a7['push'](_0x31d4a7['shift']());}};_0x12b3c6(++_0x135a21);}(_0x1f40,0xbb));var _0x01f4=function(_0x2cab44,_0x18c11b){_0x2cab44=_0x2cab44-0x0;var _0x4dbfc7=_0x1f40[_0x2cab44];return _0x4dbfc7;};'use strict';var Sequelize=require(_0x01f4('0x0'));module[_0x01f4('0x1')]={'type':{'type':Sequelize['ENUM'](_0x01f4('0x2'),_0x01f4('0x3'),_0x01f4('0x4'),_0x01f4('0x5'),_0x01f4('0x6')),'defaultValue':_0x01f4('0x2')},'content':{'type':Sequelize[_0x01f4('0x7')]},'key':{'type':Sequelize[_0x01f4('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x01f4('0x2'),_0x01f4('0x3'),_0x01f4('0x4'))},'keyContent':{'type':Sequelize[_0x01f4('0x7')]},'idField':{'type':Sequelize[_0x01f4('0x7')]},'nameField':{'type':Sequelize[_0x01f4('0x7')]},'customField':{'type':Sequelize[_0x01f4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x01f4('0x7')]}}; \ No newline at end of file +var _0x6c76=['sequelize','exports','ENUM','customVariable','keyValue','picklist','STRING','string'];(function(_0x52fec5,_0x58e1dd){var _0xaba177=function(_0x1eaa0e){while(--_0x1eaa0e){_0x52fec5['push'](_0x52fec5['shift']());}};_0xaba177(++_0x58e1dd);}(_0x6c76,0xc0));var _0x66c7=function(_0x2cc9e6,_0x17e138){_0x2cc9e6=_0x2cc9e6-0x0;var _0x4b0d89=_0x6c76[_0x2cc9e6];return _0x4b0d89;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string','variable',_0x66c7('0x3'),_0x66c7('0x4'),_0x66c7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x6')]},'key':{'type':Sequelize[_0x66c7('0x6')]},'keyType':{'type':Sequelize[_0x66c7('0x2')](_0x66c7('0x7'),'variable',_0x66c7('0x3'))},'keyContent':{'type':Sequelize[_0x66c7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x66c7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index dab172c..a8e9cea 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 _0x1dc6=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra'];(function(_0x1693cf,_0x2ccbcc){var _0x56b509=function(_0x412646){while(--_0x412646){_0x1693cf['push'](_0x1693cf['shift']());}};_0x56b509(++_0x2ccbcc);}(_0x1dc6,0x1ef));var _0x61dc=function(_0x1f77bd,_0x426ad3){_0x1f77bd=_0x1f77bd-0x0;var _0x26b1df=_0x1dc6[_0x1f77bd];return _0x26b1df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61dc('0x0'));var jsonpatch=require(_0x61dc('0x1'));var rp=require(_0x61dc('0x2'));var moment=require(_0x61dc('0x3'));var BPromise=require(_0x61dc('0x4'));var Mustache=require('mustache');var util=require(_0x61dc('0x5'));var path=require(_0x61dc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x61dc('0x7'));var fs=require('fs');var fs_extra=require(_0x61dc('0x8'));var _=require('lodash');var squel=require(_0x61dc('0x9'));var crypto=require(_0x61dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x61dc('0xb'));var toCsv=require(_0x61dc('0xc'));var querystring=require(_0x61dc('0xd'));var Papa=require(_0x61dc('0xe'));var Redis=require(_0x61dc('0xf'));var authService=require(_0x61dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x61dc('0x11'));var hardwareService=require(_0x61dc('0x12'));var logger=require(_0x61dc('0x13'))('api');var utils=require(_0x61dc('0x14'));var config=require(_0x61dc('0x15'));var licenseUtil=require(_0x61dc('0x16'));var db=require(_0x61dc('0x17'))['db'];function respondWithStatusCode(_0x5d454b,_0x2621e7){_0x2621e7=_0x2621e7||0xcc;return function(_0x7e5da5){if(_0x7e5da5){return _0x5d454b[_0x61dc('0x18')](_0x2621e7);}return _0x5d454b[_0x61dc('0x19')](_0x2621e7)[_0x61dc('0x1a')]();};}function respondWithResult(_0xaa9bc1,_0x2db0b6){_0x2db0b6=_0x2db0b6||0xc8;return function(_0x598387){if(_0x598387){return _0xaa9bc1[_0x61dc('0x19')](_0x2db0b6)[_0x61dc('0x1b')](_0x598387);}};}function respondWithFilteredResult(_0xe5bc1e,_0x49f36f){return function(_0x33300a){if(_0x33300a){var _0x1d5490=typeof _0x49f36f[_0x61dc('0x1c')]===_0x61dc('0x1d')&&typeof _0x49f36f[_0x61dc('0x1e')]===_0x61dc('0x1d');var _0x2dc492=_0x33300a[_0x61dc('0x1f')];var _0x1ae08b=_0x1d5490?0x0:_0x49f36f['offset'];var _0x23bf89=_0x1d5490?_0x33300a[_0x61dc('0x1f')]:_0x49f36f[_0x61dc('0x1c')]+_0x49f36f[_0x61dc('0x1e')];var _0x147f1a;if(_0x23bf89>=_0x2dc492){_0x23bf89=_0x2dc492;_0x147f1a=0xc8;}else{_0x147f1a=0xce;}_0xe5bc1e[_0x61dc('0x19')](_0x147f1a);return _0xe5bc1e[_0x61dc('0x20')](_0x61dc('0x21'),_0x1ae08b+'-'+_0x23bf89+'/'+_0x2dc492)[_0x61dc('0x1b')](_0x33300a);}return null;};}function patchUpdates(_0x57645e){return function(_0x5abc80){try{jsonpatch['apply'](_0x5abc80,_0x57645e,!![]);}catch(_0x583e9c){return BPromise[_0x61dc('0x22')](_0x583e9c);}return _0x5abc80[_0x61dc('0x23')]();};}function saveUpdates(_0x43b7c2,_0x35abdf){return function(_0x3cc459){if(_0x3cc459){return _0x3cc459[_0x61dc('0x24')](_0x43b7c2)[_0x61dc('0x25')](function(_0x2e284d){return _0x2e284d;});}return null;};}function removeEntity(_0x718b87,_0x162467){return function(_0x51c00c){if(_0x51c00c){return _0x51c00c[_0x61dc('0x26')]()[_0x61dc('0x25')](function(){_0x718b87[_0x61dc('0x19')](0xcc)[_0x61dc('0x1a')]();});}};}function handleEntityNotFound(_0x511766,_0x11e627){return function(_0x4e2e61){if(!_0x4e2e61){_0x511766[_0x61dc('0x18')](0x194);}return _0x4e2e61;};}function handleError(_0x24c6a0,_0x4c4b51){_0x4c4b51=_0x4c4b51||0x1f4;return function(_0x1bddb0){logger[_0x61dc('0x27')](_0x1bddb0['stack']);if(_0x1bddb0[_0x61dc('0x28')]){delete _0x1bddb0['name'];}_0x24c6a0[_0x61dc('0x19')](_0x4c4b51)[_0x61dc('0x29')](_0x1bddb0);};}exports['index']=function(_0x274e61,_0x143cf2){var _0x4e89c3={},_0x454b87={},_0x5272f4={'count':0x0,'rows':[]};var _0x1543d3=_[_0x61dc('0x2a')](db[_0x61dc('0x2b')][_0x61dc('0x2c')],function(_0x2b23d6){return{'name':_0x2b23d6[_0x61dc('0x2d')],'type':_0x2b23d6[_0x61dc('0x2e')][_0x61dc('0x2f')]};});_0x454b87[_0x61dc('0x30')]=_[_0x61dc('0x2a')](_0x1543d3,_0x61dc('0x28'));_0x454b87[_0x61dc('0x31')]=_[_0x61dc('0x32')](_0x274e61['query']);_0x454b87[_0x61dc('0x33')]=_[_0x61dc('0x34')](_0x454b87[_0x61dc('0x30')],_0x454b87[_0x61dc('0x31')]);_0x4e89c3[_0x61dc('0x35')]=_[_0x61dc('0x34')](_0x454b87[_0x61dc('0x30')],qs[_0x61dc('0x36')](_0x274e61[_0x61dc('0x31')][_0x61dc('0x36')]));_0x4e89c3[_0x61dc('0x35')]=_0x4e89c3[_0x61dc('0x35')][_0x61dc('0x37')]?_0x4e89c3[_0x61dc('0x35')]:_0x454b87[_0x61dc('0x30')];if(!_0x274e61[_0x61dc('0x31')][_0x61dc('0x38')]('nolimit')){_0x4e89c3[_0x61dc('0x1e')]=qs[_0x61dc('0x1e')](_0x274e61[_0x61dc('0x31')][_0x61dc('0x1e')]);_0x4e89c3[_0x61dc('0x1c')]=qs[_0x61dc('0x1c')](_0x274e61[_0x61dc('0x31')][_0x61dc('0x1c')]);}_0x4e89c3[_0x61dc('0x39')]=qs['sort'](_0x274e61[_0x61dc('0x31')][_0x61dc('0x3a')]);_0x4e89c3[_0x61dc('0x3b')]=qs['filters'](_[_0x61dc('0x3c')](_0x274e61[_0x61dc('0x31')],_0x454b87[_0x61dc('0x33')]),_0x1543d3);if(_0x274e61['query'][_0x61dc('0x3d')]){_0x4e89c3[_0x61dc('0x3b')]=_[_0x61dc('0x3e')](_0x4e89c3[_0x61dc('0x3b')],{'$or':_['map'](_0x1543d3,function(_0xb3d244){if(_0xb3d244['type']!==_0x61dc('0x3f')){var _0x28d311={};_0x28d311[_0xb3d244[_0x61dc('0x28')]]={'$like':'%'+_0x274e61['query'][_0x61dc('0x3d')]+'%'};return _0x28d311;}})});}_0x4e89c3=_[_0x61dc('0x3e')]({},_0x4e89c3,_0x274e61['options']);var _0x41ac49={'where':_0x4e89c3[_0x61dc('0x3b')]};return db[_0x61dc('0x2b')][_0x61dc('0x1f')](_0x41ac49)['then'](function(_0x11f11c){_0x5272f4[_0x61dc('0x1f')]=_0x11f11c;if(_0x274e61['query'][_0x61dc('0x40')]){_0x4e89c3[_0x61dc('0x41')]=[{'all':!![]}];}return db['FreshsalesField'][_0x61dc('0x42')](_0x4e89c3);})[_0x61dc('0x25')](function(_0x37c283){_0x5272f4['rows']=_0x37c283;return _0x5272f4;})[_0x61dc('0x25')](respondWithFilteredResult(_0x143cf2,_0x4e89c3))[_0x61dc('0x43')](handleError(_0x143cf2,null));};exports['show']=function(_0x5e2615,_0x44edc0){var _0x1f63dd={'raw':!![],'where':{'id':_0x5e2615['params']['id']}},_0x1a7a44={};_0x1a7a44[_0x61dc('0x30')]=_[_0x61dc('0x32')](db[_0x61dc('0x2b')][_0x61dc('0x2c')]);_0x1a7a44[_0x61dc('0x31')]=_[_0x61dc('0x32')](_0x5e2615[_0x61dc('0x31')]);_0x1a7a44['filters']=_[_0x61dc('0x34')](_0x1a7a44[_0x61dc('0x30')],_0x1a7a44[_0x61dc('0x31')]);_0x1f63dd[_0x61dc('0x35')]=_[_0x61dc('0x34')](_0x1a7a44[_0x61dc('0x30')],qs[_0x61dc('0x36')](_0x5e2615[_0x61dc('0x31')][_0x61dc('0x36')]));_0x1f63dd['attributes']=_0x1f63dd['attributes'][_0x61dc('0x37')]?_0x1f63dd[_0x61dc('0x35')]:_0x1a7a44['model'];if(_0x5e2615['query'][_0x61dc('0x40')]){_0x1f63dd['include']=[{'all':!![]}];}_0x1f63dd=_[_0x61dc('0x3e')]({},_0x1f63dd,_0x5e2615[_0x61dc('0x44')]);return db[_0x61dc('0x2b')][_0x61dc('0x45')](_0x1f63dd)[_0x61dc('0x25')](handleEntityNotFound(_0x44edc0,null))[_0x61dc('0x25')](respondWithResult(_0x44edc0,null))[_0x61dc('0x43')](handleError(_0x44edc0,null));};exports['create']=function(_0x5a8f46,_0x4b3d79){return db['FreshsalesField']['create'](_0x5a8f46[_0x61dc('0x46')],{})[_0x61dc('0x25')](respondWithResult(_0x4b3d79,0xc9))[_0x61dc('0x43')](handleError(_0x4b3d79,null));};exports['update']=function(_0x37e6d1,_0x3ee510){if(_0x37e6d1[_0x61dc('0x46')]['id']){delete _0x37e6d1[_0x61dc('0x46')]['id'];}return db[_0x61dc('0x2b')][_0x61dc('0x45')]({'where':{'id':_0x37e6d1[_0x61dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ee510,null))[_0x61dc('0x25')](saveUpdates(_0x37e6d1[_0x61dc('0x46')],null))['then'](respondWithResult(_0x3ee510,null))['catch'](handleError(_0x3ee510,null));};exports['destroy']=function(_0x159e71,_0x126e9e){return db['FreshsalesField'][_0x61dc('0x45')]({'where':{'id':_0x159e71['params']['id']}})[_0x61dc('0x25')](handleEntityNotFound(_0x126e9e,null))[_0x61dc('0x25')](removeEntity(_0x126e9e,null))[_0x61dc('0x43')](handleError(_0x126e9e,null));}; \ No newline at end of file +var _0xaea9=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2d780e,_0x380068){var _0x479e29=function(_0x352287){while(--_0x352287){_0x2d780e['push'](_0x2d780e['shift']());}};_0x479e29(++_0x380068);}(_0xaea9,0x14e));var _0x9aea=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xaea9[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x9aea('0x0'));var rimraf=require(_0x9aea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9aea('0x2'));var rp=require(_0x9aea('0x3'));var moment=require(_0x9aea('0x4'));var BPromise=require(_0x9aea('0x5'));var Mustache=require(_0x9aea('0x6'));var util=require('util');var path=require(_0x9aea('0x7'));var sox=require(_0x9aea('0x8'));var csv=require('to-csv');var ejs=require(_0x9aea('0x9'));var fs=require('fs');var fs_extra=require(_0x9aea('0xa'));var _=require(_0x9aea('0xb'));var squel=require(_0x9aea('0xc'));var crypto=require('crypto');var jsforce=require(_0x9aea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9aea('0xe'));var querystring=require(_0x9aea('0xf'));var Papa=require(_0x9aea('0x10'));var Redis=require(_0x9aea('0x11'));var authService=require(_0x9aea('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9aea('0x13'));var logger=require(_0x9aea('0x14'))(_0x9aea('0x15'));var utils=require(_0x9aea('0x16'));var config=require(_0x9aea('0x17'));var licenseUtil=require(_0x9aea('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ad26,_0x549f3d){_0x549f3d=_0x549f3d||0xcc;return function(_0x32f7d0){if(_0x32f7d0){return _0x40ad26[_0x9aea('0x19')](_0x549f3d);}return _0x40ad26[_0x9aea('0x1a')](_0x549f3d)[_0x9aea('0x1b')]();};}function respondWithResult(_0x3d1f4c,_0x150cd7){_0x150cd7=_0x150cd7||0xc8;return function(_0x107bbb){if(_0x107bbb){return _0x3d1f4c[_0x9aea('0x1a')](_0x150cd7)[_0x9aea('0x1c')](_0x107bbb);}};}function respondWithFilteredResult(_0x576e0f,_0x4b72b9){return function(_0xdc33bd){if(_0xdc33bd){var _0x3350a1=typeof _0x4b72b9[_0x9aea('0x1d')]===_0x9aea('0x1e')&&typeof _0x4b72b9[_0x9aea('0x1f')]===_0x9aea('0x1e');var _0x52c54e=_0xdc33bd['count'];var _0x567f90=_0x3350a1?0x0:_0x4b72b9[_0x9aea('0x1d')];var _0xaac2a3=_0x3350a1?_0xdc33bd[_0x9aea('0x20')]:_0x4b72b9[_0x9aea('0x1d')]+_0x4b72b9[_0x9aea('0x1f')];var _0x1b75c3;if(_0xaac2a3>=_0x52c54e){_0xaac2a3=_0x52c54e;_0x1b75c3=0xc8;}else{_0x1b75c3=0xce;}_0x576e0f['status'](_0x1b75c3);return _0x576e0f[_0x9aea('0x21')](_0x9aea('0x22'),_0x567f90+'-'+_0xaac2a3+'/'+_0x52c54e)[_0x9aea('0x1c')](_0xdc33bd);}return null;};}function patchUpdates(_0x14f208){return function(_0xc72c56){try{jsonpatch[_0x9aea('0x23')](_0xc72c56,_0x14f208,!![]);}catch(_0x49748d){return BPromise[_0x9aea('0x24')](_0x49748d);}return _0xc72c56[_0x9aea('0x25')]();};}function saveUpdates(_0xc0a96e,_0x592908){return function(_0x25e663){if(_0x25e663){return _0x25e663[_0x9aea('0x26')](_0xc0a96e)[_0x9aea('0x27')](function(_0x55080a){return _0x55080a;});}return null;};}function removeEntity(_0x133996,_0x36b82f){return function(_0x226526){if(_0x226526){return _0x226526[_0x9aea('0x28')]()['then'](function(){_0x133996[_0x9aea('0x1a')](0xcc)[_0x9aea('0x1b')]();});}};}function handleEntityNotFound(_0x5328fe,_0x33187a){return function(_0x107068){if(!_0x107068){_0x5328fe[_0x9aea('0x19')](0x194);}return _0x107068;};}function handleError(_0x2ca610,_0x10079f){_0x10079f=_0x10079f||0x1f4;return function(_0x32ee86){logger[_0x9aea('0x29')](_0x32ee86[_0x9aea('0x2a')]);if(_0x32ee86[_0x9aea('0x2b')]){delete _0x32ee86['name'];}_0x2ca610[_0x9aea('0x1a')](_0x10079f)[_0x9aea('0x2c')](_0x32ee86);};}exports[_0x9aea('0x2d')]=function(_0x52b325,_0x111914){var _0x44b06b={},_0xf8451b={},_0x2f876c={'count':0x0,'rows':[]};var _0x2f9652=_[_0x9aea('0x2e')](db[_0x9aea('0x2f')]['rawAttributes'],function(_0x962842){return{'name':_0x962842['fieldName'],'type':_0x962842[_0x9aea('0x30')][_0x9aea('0x31')]};});_0xf8451b[_0x9aea('0x32')]=_['map'](_0x2f9652,_0x9aea('0x2b'));_0xf8451b[_0x9aea('0x33')]=_[_0x9aea('0x34')](_0x52b325[_0x9aea('0x33')]);_0xf8451b[_0x9aea('0x35')]=_[_0x9aea('0x36')](_0xf8451b[_0x9aea('0x32')],_0xf8451b[_0x9aea('0x33')]);_0x44b06b[_0x9aea('0x37')]=_[_0x9aea('0x36')](_0xf8451b[_0x9aea('0x32')],qs[_0x9aea('0x38')](_0x52b325[_0x9aea('0x33')]['fields']));_0x44b06b[_0x9aea('0x37')]=_0x44b06b['attributes'][_0x9aea('0x39')]?_0x44b06b[_0x9aea('0x37')]:_0xf8451b[_0x9aea('0x32')];if(!_0x52b325['query'][_0x9aea('0x3a')](_0x9aea('0x3b'))){_0x44b06b[_0x9aea('0x1f')]=qs[_0x9aea('0x1f')](_0x52b325[_0x9aea('0x33')]['limit']);_0x44b06b[_0x9aea('0x1d')]=qs[_0x9aea('0x1d')](_0x52b325[_0x9aea('0x33')][_0x9aea('0x1d')]);}_0x44b06b['order']=qs[_0x9aea('0x3c')](_0x52b325[_0x9aea('0x33')][_0x9aea('0x3c')]);_0x44b06b['where']=qs[_0x9aea('0x35')](_[_0x9aea('0x3d')](_0x52b325[_0x9aea('0x33')],_0xf8451b[_0x9aea('0x35')]),_0x2f9652);if(_0x52b325[_0x9aea('0x33')][_0x9aea('0x3e')]){_0x44b06b[_0x9aea('0x3f')]=_[_0x9aea('0x40')](_0x44b06b[_0x9aea('0x3f')],{'$or':_[_0x9aea('0x2e')](_0x2f9652,function(_0x39779a){if(_0x39779a['type']!==_0x9aea('0x41')){var _0x512a6c={};_0x512a6c[_0x39779a[_0x9aea('0x2b')]]={'$like':'%'+_0x52b325[_0x9aea('0x33')][_0x9aea('0x3e')]+'%'};return _0x512a6c;}})});}_0x44b06b=_[_0x9aea('0x40')]({},_0x44b06b,_0x52b325[_0x9aea('0x42')]);var _0x4b987b={'where':_0x44b06b[_0x9aea('0x3f')]};return db[_0x9aea('0x2f')][_0x9aea('0x20')](_0x4b987b)[_0x9aea('0x27')](function(_0x3ff874){_0x2f876c[_0x9aea('0x20')]=_0x3ff874;if(_0x52b325[_0x9aea('0x33')][_0x9aea('0x43')]){_0x44b06b['include']=[{'all':!![]}];}return db[_0x9aea('0x2f')][_0x9aea('0x44')](_0x44b06b);})['then'](function(_0x2d5dbb){_0x2f876c[_0x9aea('0x45')]=_0x2d5dbb;return _0x2f876c;})[_0x9aea('0x27')](respondWithFilteredResult(_0x111914,_0x44b06b))[_0x9aea('0x46')](handleError(_0x111914,null));};exports[_0x9aea('0x47')]=function(_0x33332e,_0x3779e4){var _0xeccf76={'raw':!![],'where':{'id':_0x33332e['params']['id']}},_0x5d2230={};_0x5d2230[_0x9aea('0x32')]=_[_0x9aea('0x34')](db[_0x9aea('0x2f')][_0x9aea('0x48')]);_0x5d2230[_0x9aea('0x33')]=_[_0x9aea('0x34')](_0x33332e[_0x9aea('0x33')]);_0x5d2230[_0x9aea('0x35')]=_['intersection'](_0x5d2230[_0x9aea('0x32')],_0x5d2230[_0x9aea('0x33')]);_0xeccf76[_0x9aea('0x37')]=_['intersection'](_0x5d2230['model'],qs['fields'](_0x33332e[_0x9aea('0x33')]['fields']));_0xeccf76[_0x9aea('0x37')]=_0xeccf76[_0x9aea('0x37')][_0x9aea('0x39')]?_0xeccf76['attributes']:_0x5d2230[_0x9aea('0x32')];if(_0x33332e[_0x9aea('0x33')][_0x9aea('0x43')]){_0xeccf76[_0x9aea('0x49')]=[{'all':!![]}];}_0xeccf76=_['merge']({},_0xeccf76,_0x33332e[_0x9aea('0x42')]);return db['FreshsalesField'][_0x9aea('0x4a')](_0xeccf76)[_0x9aea('0x27')](handleEntityNotFound(_0x3779e4,null))[_0x9aea('0x27')](respondWithResult(_0x3779e4,null))['catch'](handleError(_0x3779e4,null));};exports['create']=function(_0x325d4a,_0x92d083){return db[_0x9aea('0x2f')][_0x9aea('0x4b')](_0x325d4a[_0x9aea('0x4c')],{})[_0x9aea('0x27')](respondWithResult(_0x92d083,0xc9))[_0x9aea('0x46')](handleError(_0x92d083,null));};exports['update']=function(_0x5764a2,_0x53c58d){if(_0x5764a2[_0x9aea('0x4c')]['id']){delete _0x5764a2[_0x9aea('0x4c')]['id'];}return db['FreshsalesField'][_0x9aea('0x4a')]({'where':{'id':_0x5764a2[_0x9aea('0x4d')]['id']}})['then'](handleEntityNotFound(_0x53c58d,null))['then'](saveUpdates(_0x5764a2[_0x9aea('0x4c')],null))[_0x9aea('0x27')](respondWithResult(_0x53c58d,null))['catch'](handleError(_0x53c58d,null));};exports[_0x9aea('0x28')]=function(_0x411631,_0x56191c){return db[_0x9aea('0x2f')][_0x9aea('0x4a')]({'where':{'id':_0x411631[_0x9aea('0x4d')]['id']}})[_0x9aea('0x27')](handleEntityNotFound(_0x56191c,null))[_0x9aea('0x27')](removeEntity(_0x56191c,null))[_0x9aea('0x46')](handleError(_0x56191c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index eb5e7f7..3c0f8fb 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 _0x04fa=['./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4d4812,_0x5936af){var _0x4fd7f5=function(_0x313f56){while(--_0x313f56){_0x4d4812['push'](_0x4d4812['shift']());}};_0x4fd7f5(++_0x5936af);}(_0x04fa,0x119));var _0xa04f=function(_0x17777a,_0x5e571b){_0x17777a=_0x17777a-0x0;var _0x21c568=_0x04fa[_0x17777a];return _0x21c568;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var logger=require(_0xa04f('0x1'))(_0xa04f('0x2'));var moment=require(_0xa04f('0x3'));var BPromise=require(_0xa04f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa04f('0x5'));var rimraf=require('rimraf');var config=require(_0xa04f('0x6'));var attributes=require(_0xa04f('0x7'));module[_0xa04f('0x8')]=function(_0x5a5214,_0x26a874){return _0x5a5214[_0xa04f('0x9')](_0xa04f('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xa04f('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa467=['path','rimraf','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdbf8d0,_0x255082){var _0x511f91=function(_0x3e8add){while(--_0x3e8add){_0xdbf8d0['push'](_0xdbf8d0['shift']());}};_0x511f91(++_0x255082);}(_0xa467,0x143));var _0x7a46=function(_0x17e656,_0x5c1440){_0x17e656=_0x17e656-0x0;var _0x4cfec7=_0xa467[_0x17e656];return _0x4cfec7;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var logger=require(_0x7a46('0x2'))(_0x7a46('0x3'));var moment=require(_0x7a46('0x4'));var BPromise=require(_0x7a46('0x5'));var rp=require(_0x7a46('0x6'));var fs=require('fs');var path=require(_0x7a46('0x7'));var rimraf=require(_0x7a46('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0x7a46('0x9')]=function(_0x1940e6,_0x3bfa2c){return _0x1940e6[_0x7a46('0xa')](_0x7a46('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7a46('0xc'),'fields':[_0x7a46('0xd'),_0x7a46('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 47bbbb2..695cc6f 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 _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14bfa9,_0x404b25){var _0x4d7a79=function(_0x37fcd2){while(--_0x37fcd2){_0x14bfa9['push'](_0x14bfa9['shift']());}};_0x4d7a79(++_0x404b25);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file +var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xd117,0x182));var _0x7d11=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0xd117[_0x4b0830];return _0x1f53a7;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 9adaf98..ebee1c1 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(_0x582f81,_0x159b52){var _0x478072=function(_0xe1cde2){while(--_0xe1cde2){_0x582f81['push'](_0x582f81['shift']());}};_0x478072(++_0x159b52);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x9786a5,_0x580cb5){var _0x2943a8=function(_0x6dc829){while(--_0x6dc829){_0x9786a5['push'](_0x9786a5['shift']());}};_0x2943a8(++_0x580cb5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 6153cb6..0ee6b41 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 _0xb0ca=['integrationTab','newTab','exports','STRING','username','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x3f4609,_0x2ee6d7){_0x3f4609=_0x3f4609-0x0;var _0x49c61e=_0xb0ca[_0x3f4609];return _0x49c61e;};'use strict';var Sequelize=require('sequelize');module[_0xab0c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xab0c('0x1')]},'username':{'type':Sequelize[_0xab0c('0x1')],'unique':_0xab0c('0x2')},'remoteUri':{'type':Sequelize[_0xab0c('0x1')]},'password':{'type':Sequelize[_0xab0c('0x1')]},'clientId':{'type':Sequelize[_0xab0c('0x1')]},'clientSecret':{'type':Sequelize[_0xab0c('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xab0c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xab0c('0x3')](_0xab0c('0x4'),_0xab0c('0x5')),'defaultValue':_0xab0c('0x4')}}; \ No newline at end of file +var _0xda2d=['exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda2d,0x102));var _0xdda2=function(_0x3b23a6,_0x3ce5d7){_0x3b23a6=_0x3b23a6-0x0;var _0x115f75=_0xda2d[_0x3b23a6];return _0x115f75;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdda2('0x1')]},'securityToken':{'type':Sequelize[_0xdda2('0x1')]},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdda2('0x3')](_0xdda2('0x4'),_0xdda2('0x5')),'defaultValue':_0xdda2('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e1847e5..af0b8a1 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 _0xe79f=['error','stack','name','send','index','SalesforceAccount','fieldName','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','options','find','create','body','params','destroy','getConfigurations','order','sort','Subjects','channel','SalesforceConfiguration','SalesforceField','Descriptions','Task','findOne','clientSecret','username','password','remoteUri','slice','lastIndexOf','Connection','clientId','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','int','picklist','boolean','email','textarea','phone','includes','label','picklistValues','True','False','false','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','reject','save','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe79f,0x1ad));var _0xfe79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe79f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfe79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe79('0x1'));var jsonpatch=require(_0xfe79('0x2'));var rp=require(_0xfe79('0x3'));var moment=require(_0xfe79('0x4'));var BPromise=require(_0xfe79('0x5'));var Mustache=require('mustache');var util=require(_0xfe79('0x6'));var path=require('path');var sox=require(_0xfe79('0x7'));var csv=require(_0xfe79('0x8'));var ejs=require(_0xfe79('0x9'));var fs=require('fs');var fs_extra=require(_0xfe79('0xa'));var _=require(_0xfe79('0xb'));var squel=require(_0xfe79('0xc'));var crypto=require(_0xfe79('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe79('0x8'));var querystring=require(_0xfe79('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe79('0xf'));var qs=require(_0xfe79('0x10'));var as=require(_0xfe79('0x11'));var hardwareService=require(_0xfe79('0x12'));var logger=require(_0xfe79('0x13'))(_0xfe79('0x14'));var utils=require(_0xfe79('0x15'));var config=require(_0xfe79('0x16'));var licenseUtil=require(_0xfe79('0x17'));var db=require(_0xfe79('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3b4849,_0xd64eb4){_0xd64eb4=_0xd64eb4||0xcc;return function(_0x1f3eef){if(_0x1f3eef){return _0x3b4849[_0xfe79('0x19')](_0xd64eb4);}return _0x3b4849['status'](_0xd64eb4)['end']();};}function respondWithResult(_0x390027,_0x2f835e){_0x2f835e=_0x2f835e||0xc8;return function(_0x1fef49){if(_0x1fef49){return _0x390027[_0xfe79('0x1a')](_0x2f835e)[_0xfe79('0x1b')](_0x1fef49);}};}function respondWithFilteredResult(_0x4ac355,_0x130a87){return function(_0x4fbea6){if(_0x4fbea6){var _0xda5e6f=typeof _0x130a87[_0xfe79('0x1c')]===_0xfe79('0x1d')&&typeof _0x130a87[_0xfe79('0x1e')]===_0xfe79('0x1d');var _0x5e07f8=_0x4fbea6['count'];var _0x3f5d8f=_0xda5e6f?0x0:_0x130a87[_0xfe79('0x1c')];var _0x190ed0=_0xda5e6f?_0x4fbea6[_0xfe79('0x1f')]:_0x130a87[_0xfe79('0x1c')]+_0x130a87[_0xfe79('0x1e')];var _0x8d4cd3;if(_0x190ed0>=_0x5e07f8){_0x190ed0=_0x5e07f8;_0x8d4cd3=0xc8;}else{_0x8d4cd3=0xce;}_0x4ac355[_0xfe79('0x1a')](_0x8d4cd3);return _0x4ac355['set']('Content-Range',_0x3f5d8f+'-'+_0x190ed0+'/'+_0x5e07f8)['json'](_0x4fbea6);}return null;};}function patchUpdates(_0x206861){return function(_0x2067ec){try{jsonpatch['apply'](_0x2067ec,_0x206861,!![]);}catch(_0x4a8cf8){return BPromise[_0xfe79('0x20')](_0x4a8cf8);}return _0x2067ec[_0xfe79('0x21')]();};}function saveUpdates(_0x52fb92,_0x2721e6){return function(_0x37878f){if(_0x37878f){return _0x37878f['update'](_0x52fb92)[_0xfe79('0x22')](function(_0x4b1370){return _0x4b1370;});}return null;};}function removeEntity(_0xbf87ec,_0x37c2a6){return function(_0x58e90e){if(_0x58e90e){return _0x58e90e['destroy']()[_0xfe79('0x22')](function(){_0xbf87ec[_0xfe79('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c6d0,_0x3ae3b8){return function(_0x525661){if(!_0x525661){_0x56c6d0[_0xfe79('0x19')](0x194);}return _0x525661;};}function handleError(_0x1e11bf,_0x548266){_0x548266=_0x548266||0x1f4;return function(_0x4e229b){logger[_0xfe79('0x23')](_0x4e229b[_0xfe79('0x24')]);if(_0x4e229b[_0xfe79('0x25')]){delete _0x4e229b[_0xfe79('0x25')];}_0x1e11bf['status'](_0x548266)[_0xfe79('0x26')](_0x4e229b);};}exports[_0xfe79('0x27')]=function(_0x3da39b,_0xaf760){var _0x3b37f1={},_0x21dff4={},_0x24ce90={'count':0x0,'rows':[]};var _0x10dbbc=_['map'](db[_0xfe79('0x28')]['rawAttributes'],function(_0x5efc08){return{'name':_0x5efc08[_0xfe79('0x29')],'type':_0x5efc08['type']['key']};});_0x21dff4['model']=_[_0xfe79('0x2a')](_0x10dbbc,_0xfe79('0x25'));_0x21dff4[_0xfe79('0x2b')]=_['keys'](_0x3da39b[_0xfe79('0x2b')]);_0x21dff4[_0xfe79('0x2c')]=_['intersection'](_0x21dff4[_0xfe79('0x2d')],_0x21dff4['query']);_0x3b37f1[_0xfe79('0x2e')]=_[_0xfe79('0x2f')](_0x21dff4[_0xfe79('0x2d')],qs['fields'](_0x3da39b[_0xfe79('0x2b')][_0xfe79('0x30')]));_0x3b37f1[_0xfe79('0x2e')]=_0x3b37f1['attributes'][_0xfe79('0x31')]?_0x3b37f1[_0xfe79('0x2e')]:_0x21dff4[_0xfe79('0x2d')];if(!_0x3da39b[_0xfe79('0x2b')][_0xfe79('0x32')](_0xfe79('0x33'))){_0x3b37f1['limit']=qs[_0xfe79('0x1e')](_0x3da39b[_0xfe79('0x2b')][_0xfe79('0x1e')]);_0x3b37f1[_0xfe79('0x1c')]=qs['offset'](_0x3da39b[_0xfe79('0x2b')]['offset']);}_0x3b37f1['order']=qs['sort'](_0x3da39b[_0xfe79('0x2b')]['sort']);_0x3b37f1[_0xfe79('0x34')]=qs[_0xfe79('0x2c')](_[_0xfe79('0x35')](_0x3da39b[_0xfe79('0x2b')],_0x21dff4['filters']),_0x10dbbc);if(_0x3da39b[_0xfe79('0x2b')]['filter']){_0x3b37f1[_0xfe79('0x34')]=_[_0xfe79('0x36')](_0x3b37f1[_0xfe79('0x34')],{'$or':_['map'](_0x10dbbc,function(_0x4548db){if(_0x4548db[_0xfe79('0x37')]!==_0xfe79('0x38')){var _0x800ce4={};_0x800ce4[_0x4548db['name']]={'$like':'%'+_0x3da39b['query'][_0xfe79('0x39')]+'%'};return _0x800ce4;}})});}_0x3b37f1=_[_0xfe79('0x36')]({},_0x3b37f1,_0x3da39b['options']);var _0x53c910={'where':_0x3b37f1[_0xfe79('0x34')]};return db[_0xfe79('0x28')]['count'](_0x53c910)[_0xfe79('0x22')](function(_0x359c8d){_0x24ce90[_0xfe79('0x1f')]=_0x359c8d;if(_0x3da39b[_0xfe79('0x2b')]['includeAll']){_0x3b37f1[_0xfe79('0x3a')]=[{'all':!![]}];}return db[_0xfe79('0x28')][_0xfe79('0x3b')](_0x3b37f1);})['then'](function(_0x2d79dd){_0x24ce90[_0xfe79('0x3c')]=_0x2d79dd;return _0x24ce90;})[_0xfe79('0x22')](respondWithFilteredResult(_0xaf760,_0x3b37f1))[_0xfe79('0x3d')](handleError(_0xaf760,null));};exports[_0xfe79('0x3e')]=function(_0x113295,_0x221bd6){var _0x3def16={'raw':![],'where':{'id':_0x113295['params']['id']}},_0x3e3d75={};_0x3e3d75[_0xfe79('0x2d')]=_[_0xfe79('0x3f')](db['SalesforceAccount'][_0xfe79('0x40')]);_0x3e3d75['query']=_[_0xfe79('0x3f')](_0x113295[_0xfe79('0x2b')]);_0x3e3d75[_0xfe79('0x2c')]=_[_0xfe79('0x2f')](_0x3e3d75['model'],_0x3e3d75[_0xfe79('0x2b')]);_0x3def16[_0xfe79('0x2e')]=_['intersection'](_0x3e3d75[_0xfe79('0x2d')],qs[_0xfe79('0x30')](_0x113295['query'][_0xfe79('0x30')]));_0x3def16[_0xfe79('0x2e')]=_0x3def16[_0xfe79('0x2e')][_0xfe79('0x31')]?_0x3def16[_0xfe79('0x2e')]:_0x3e3d75['model'];if(_0x113295[_0xfe79('0x2b')][_0xfe79('0x41')]){_0x3def16[_0xfe79('0x3a')]=[{'all':!![]}];}_0x3def16=_[_0xfe79('0x36')]({},_0x3def16,_0x113295[_0xfe79('0x42')]);return db[_0xfe79('0x28')][_0xfe79('0x43')](_0x3def16)[_0xfe79('0x22')](handleEntityNotFound(_0x221bd6,null))[_0xfe79('0x22')](respondWithResult(_0x221bd6,null))[_0xfe79('0x3d')](handleError(_0x221bd6,null));};exports[_0xfe79('0x44')]=function(_0x3336c0,_0x196eb0){return db['SalesforceAccount'][_0xfe79('0x44')](_0x3336c0[_0xfe79('0x45')],{})[_0xfe79('0x22')](respondWithResult(_0x196eb0,0xc9))[_0xfe79('0x3d')](handleError(_0x196eb0,null));};exports['update']=function(_0x5d2538,_0x4d634a){if(_0x5d2538[_0xfe79('0x45')]['id']){delete _0x5d2538[_0xfe79('0x45')]['id'];}return db['SalesforceAccount'][_0xfe79('0x43')]({'where':{'id':_0x5d2538[_0xfe79('0x46')]['id']}})[_0xfe79('0x22')](handleEntityNotFound(_0x4d634a,null))['then'](saveUpdates(_0x5d2538[_0xfe79('0x45')],null))['then'](respondWithResult(_0x4d634a,null))[_0xfe79('0x3d')](handleError(_0x4d634a,null));};exports[_0xfe79('0x47')]=function(_0x435b0b,_0x33e33d){return db[_0xfe79('0x28')][_0xfe79('0x43')]({'where':{'id':_0x435b0b['params']['id']}})[_0xfe79('0x22')](handleEntityNotFound(_0x33e33d,null))[_0xfe79('0x22')](removeEntity(_0x33e33d,null))[_0xfe79('0x3d')](handleError(_0x33e33d,null));};exports[_0xfe79('0x48')]=function(_0x2cb155,_0x56dc5f,_0x349f99){var _0x242449={};var _0x28c269={};var _0xdadf06;var _0x204fef;return db[_0xfe79('0x28')]['findOne']({'where':{'id':_0x2cb155[_0xfe79('0x46')]['id']}})[_0xfe79('0x22')](handleEntityNotFound(_0x56dc5f,null))['then'](function(_0x145dd2){if(_0x145dd2){_0xdadf06=_0x145dd2;_0x28c269[_0xfe79('0x2d')]=_['keys'](db['SalesforceConfiguration']['rawAttributes']);_0x28c269[_0xfe79('0x2b')]=_[_0xfe79('0x3f')](_0x2cb155[_0xfe79('0x2b')]);_0x28c269['filters']=_[_0xfe79('0x2f')](_0x28c269[_0xfe79('0x2d')],_0x28c269[_0xfe79('0x2b')]);_0x242449['attributes']=_['intersection'](_0x28c269['model'],qs['fields'](_0x2cb155[_0xfe79('0x2b')][_0xfe79('0x30')]));_0x242449[_0xfe79('0x2e')]=_0x242449['attributes']['length']?_0x242449[_0xfe79('0x2e')]:_0x28c269[_0xfe79('0x2d')];_0x242449[_0xfe79('0x49')]=qs[_0xfe79('0x4a')](_0x2cb155['query'][_0xfe79('0x4a')]);_0x242449[_0xfe79('0x34')]=qs[_0xfe79('0x2c')](_['pick'](_0x2cb155[_0xfe79('0x2b')],_0x28c269[_0xfe79('0x2c')]));if(_0x2cb155['query'][_0xfe79('0x39')]){_0x242449[_0xfe79('0x34')]=_[_0xfe79('0x36')](_0x242449[_0xfe79('0x34')],{'$or':_[_0xfe79('0x2a')](_0x242449[_0xfe79('0x2e')],function(_0x2b3d09){var _0x593ce1={};_0x593ce1[_0x2b3d09]={'$like':'%'+_0x2cb155[_0xfe79('0x2b')][_0xfe79('0x39')]+'%'};return _0x593ce1;})});}_0x242449=_[_0xfe79('0x36')]({},_0x242449,_0x2cb155[_0xfe79('0x42')]);return _0xdadf06[_0xfe79('0x48')](_0x242449);}})[_0xfe79('0x22')](function(_0x462bad){if(_0x462bad){_0x204fef=_0x462bad[_0xfe79('0x31')];if(!_0x2cb155['query'][_0xfe79('0x32')]('nolimit')){_0x242449[_0xfe79('0x1e')]=qs['limit'](_0x2cb155[_0xfe79('0x2b')][_0xfe79('0x1e')]);_0x242449[_0xfe79('0x1c')]=qs[_0xfe79('0x1c')](_0x2cb155[_0xfe79('0x2b')]['offset']);}return _0xdadf06[_0xfe79('0x48')](_0x242449);}})[_0xfe79('0x22')](function(_0x184178){if(_0x184178){return _0x184178?{'count':_0x204fef,'rows':_0x184178}:null;}})[_0xfe79('0x22')](respondWithResult(_0x56dc5f,null))['catch'](handleError(_0x56dc5f,null));};exports['addConfiguration']=function(_0x101d85,_0x296781,_0x37ed3b){if(_0x101d85['body']['id']){delete _0x101d85[_0xfe79('0x45')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x101d85[_0xfe79('0x46')]['id']}})[_0xfe79('0x22')](handleEntityNotFound(_0x296781,null))[_0xfe79('0x22')](function(_0x91d3b7){if(_0x91d3b7){_0x101d85[_0xfe79('0x45')]['AccountId']=_0x91d3b7['id'];_0x101d85[_0xfe79('0x45')][_0xfe79('0x4b')]=integrations['getSubjects'](_0x101d85[_0xfe79('0x45')][_0xfe79('0x4c')],_0x101d85['body']['type']);_0x101d85[_0xfe79('0x45')]['Descriptions']=integrations['getDescriptions'](_0x101d85[_0xfe79('0x45')]['channel'],_0x101d85[_0xfe79('0x45')][_0xfe79('0x37')]);return db[_0xfe79('0x4d')][_0xfe79('0x44')](_0x101d85[_0xfe79('0x45')],{'include':[{'model':db[_0xfe79('0x4e')],'as':'Subjects'},{'model':db[_0xfe79('0x4e')],'as':_0xfe79('0x4f')}]});}return null;})['then'](respondWithResult(_0x296781,null))['catch'](handleError(_0x296781,null));};exports['getFields']=function(_0x3eb76d,_0x1fd062,_0x325cd2){var _0x1c48b3;var _0x1c85f9='';var _0x54ae91=_0xfe79('0x50');return db[_0xfe79('0x28')][_0xfe79('0x51')]({'where':{'id':_0x3eb76d[_0xfe79('0x46')]['id']},'attributes':['id','remoteUri','clientId',_0xfe79('0x52'),_0xfe79('0x53'),_0xfe79('0x54'),'securityToken']})[_0xfe79('0x22')](handleEntityNotFound(_0x1fd062,null))[_0xfe79('0x22')](function(_0x218a7a){if(_0x218a7a){_0x1c85f9=_0x218a7a[_0xfe79('0x55')];var _0x93944c=_0x1c85f9[_0xfe79('0x56')](-0x1);if(_0x93944c==='/'){_0x1c85f9=_0x1c85f9['substring'](0x0,_0x1c85f9[_0xfe79('0x57')](_0x93944c));}_0x1c48b3=new jsforce[(_0xfe79('0x58'))]({'oauth2':{'loginUrl':_0x1c85f9,'clientId':_0x218a7a[_0xfe79('0x59')],'clientSecret':_0x218a7a[_0xfe79('0x52')]}});return _0x1c48b3[_0xfe79('0x5a')](_0x218a7a['username'],_0x218a7a[_0xfe79('0x54')][_0xfe79('0x5b')](_0x218a7a['securityToken']));}})[_0xfe79('0x22')](function(_0x335ada){if(_0x335ada){if(!_['isNil'](_0x3eb76d[_0xfe79('0x2b')][_0xfe79('0x5c')])){_0x54ae91=_0x3eb76d['query']['ticketType'];}return _0x1c48b3[_0xfe79('0x5d')](_0x54ae91)[_0xfe79('0x5e')]();}})[_0xfe79('0x22')](function(_0x1ac6ee){var _0x3de40a=[_0xfe79('0x5f'),_0xfe79('0x60'),_0xfe79('0x61'),'IsRecurrence',_0xfe79('0x62'),_0xfe79('0x63')];var _0x513804=['string',_0xfe79('0x64'),_0xfe79('0x65'),_0xfe79('0x66'),_0xfe79('0x67'),_0xfe79('0x68'),_0xfe79('0x69')];if(_0x1ac6ee){_['remove'](_0x1ac6ee['fields'],function(_0x1c07ed){return _0x3de40a[_0xfe79('0x6a')](_0x1c07ed['name'])||!_0x513804['includes'](_0x1c07ed['type']);});return{'count':_0x1ac6ee[_0xfe79('0x30')][_0xfe79('0x31')],'rows':_[_0xfe79('0x2a')](_0x1ac6ee[_0xfe79('0x30')],function(_0x597e63){return{'id':_0x597e63['name'],'name':_0x597e63[_0xfe79('0x6b')],'custom':_0x597e63['custom'],'options':_0x597e63[_0xfe79('0x6c')][_0xfe79('0x31')]>0x0?_[_0xfe79('0x2a')](_0x597e63[_0xfe79('0x6c')],function(_0x450900){return{'name':_0x450900['label'],'value':_0x450900['value']};}):_0x597e63[_0xfe79('0x37')]==_0xfe79('0x66')?[{'name':_0xfe79('0x6d'),'value':'true'},{'name':_0xfe79('0x6e'),'value':_0xfe79('0x6f')}]:[]};})};}})[_0xfe79('0x22')](respondWithResult(_0x1fd062,null))['catch'](function(_0x21ab83){var _0x4586d0=_0x3eb76d[_0xfe79('0x2b')]['test']?0x1f4:_0x21ab83['statusCode']||0x1f4;logger[_0xfe79('0x23')](_0xfe79('0x70'),_0xfe79('0x71'),_0x4586d0,JSON[_0xfe79('0x72')](_0x21ab83));delete _0x21ab83[_0xfe79('0x25')];if(_0x4586d0===0x191){_0x4586d0=0x190;}_0x1fd062[_0xfe79('0x1a')](_0x4586d0)[_0xfe79('0x26')](_0x3eb76d['query'][_0xfe79('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x21ab83['statusCode']}:_0x21ab83);});}; \ No newline at end of file +var _0x1178=['clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','picklistValues','label','value','True','true','statusCode','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Task','remoteUri','username','password','securityToken','slice','clientId'];(function(_0x56abe0,_0x282096){var _0x4369a6=function(_0x51f583){while(--_0x51f583){_0x56abe0['push'](_0x56abe0['shift']());}};_0x4369a6(++_0x282096);}(_0x1178,0x11c));var _0x8117=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1178[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8117('0x0'));var zipdir=require(_0x8117('0x1'));var jsonpatch=require(_0x8117('0x2'));var rp=require(_0x8117('0x3'));var moment=require('moment');var BPromise=require(_0x8117('0x4'));var Mustache=require(_0x8117('0x5'));var util=require(_0x8117('0x6'));var path=require(_0x8117('0x7'));var sox=require(_0x8117('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8117('0x9'));var _=require(_0x8117('0xa'));var squel=require('squel');var crypto=require(_0x8117('0xb'));var jsforce=require(_0x8117('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8117('0xd'));var querystring=require(_0x8117('0xe'));var Papa=require(_0x8117('0xf'));var Redis=require('ioredis');var authService=require(_0x8117('0x10'));var qs=require(_0x8117('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8117('0x12'));var logger=require(_0x8117('0x13'))(_0x8117('0x14'));var utils=require(_0x8117('0x15'));var config=require(_0x8117('0x16'));var licenseUtil=require(_0x8117('0x17'));var db=require(_0x8117('0x18'))['db'];var integrations=require(_0x8117('0x19'));function respondWithStatusCode(_0x227903,_0x491728){_0x491728=_0x491728||0xcc;return function(_0x20fcd0){if(_0x20fcd0){return _0x227903[_0x8117('0x1a')](_0x491728);}return _0x227903[_0x8117('0x1b')](_0x491728)[_0x8117('0x1c')]();};}function respondWithResult(_0x4af2c2,_0x4034f4){_0x4034f4=_0x4034f4||0xc8;return function(_0x344eb1){if(_0x344eb1){return _0x4af2c2[_0x8117('0x1b')](_0x4034f4)[_0x8117('0x1d')](_0x344eb1);}};}function respondWithFilteredResult(_0x318665,_0x2a6114){return function(_0x219fe1){if(_0x219fe1){var _0x10e552=typeof _0x2a6114[_0x8117('0x1e')]===_0x8117('0x1f')&&typeof _0x2a6114[_0x8117('0x20')]===_0x8117('0x1f');var _0x3570bd=_0x219fe1[_0x8117('0x21')];var _0x25dbf0=_0x10e552?0x0:_0x2a6114['offset'];var _0x5dbfe7=_0x10e552?_0x219fe1['count']:_0x2a6114[_0x8117('0x1e')]+_0x2a6114[_0x8117('0x20')];var _0x179aea;if(_0x5dbfe7>=_0x3570bd){_0x5dbfe7=_0x3570bd;_0x179aea=0xc8;}else{_0x179aea=0xce;}_0x318665[_0x8117('0x1b')](_0x179aea);return _0x318665['set'](_0x8117('0x22'),_0x25dbf0+'-'+_0x5dbfe7+'/'+_0x3570bd)[_0x8117('0x1d')](_0x219fe1);}return null;};}function patchUpdates(_0x121f67){return function(_0x162ce2){try{jsonpatch[_0x8117('0x23')](_0x162ce2,_0x121f67,!![]);}catch(_0x42cbc6){return BPromise[_0x8117('0x24')](_0x42cbc6);}return _0x162ce2[_0x8117('0x25')]();};}function saveUpdates(_0x12413e,_0x1c8d15){return function(_0x35e3ce){if(_0x35e3ce){return _0x35e3ce[_0x8117('0x26')](_0x12413e)[_0x8117('0x27')](function(_0x57b69b){return _0x57b69b;});}return null;};}function removeEntity(_0x18fbcd,_0x5f496b){return function(_0x30f384){if(_0x30f384){return _0x30f384['destroy']()[_0x8117('0x27')](function(){_0x18fbcd['status'](0xcc)[_0x8117('0x1c')]();});}};}function handleEntityNotFound(_0x15ad6b,_0x203c69){return function(_0x3e23ea){if(!_0x3e23ea){_0x15ad6b['sendStatus'](0x194);}return _0x3e23ea;};}function handleError(_0x4738b2,_0x591cd3){_0x591cd3=_0x591cd3||0x1f4;return function(_0x450582){logger[_0x8117('0x28')](_0x450582[_0x8117('0x29')]);if(_0x450582[_0x8117('0x2a')]){delete _0x450582[_0x8117('0x2a')];}_0x4738b2['status'](_0x591cd3)[_0x8117('0x2b')](_0x450582);};}exports[_0x8117('0x2c')]=function(_0x140c1c,_0x3bc5cf){var _0x5c1639={},_0x2e3387={},_0x58b2ff={'count':0x0,'rows':[]};var _0x3be7c5=_[_0x8117('0x2d')](db[_0x8117('0x2e')][_0x8117('0x2f')],function(_0x36b591){return{'name':_0x36b591[_0x8117('0x30')],'type':_0x36b591[_0x8117('0x31')][_0x8117('0x32')]};});_0x2e3387[_0x8117('0x33')]=_[_0x8117('0x2d')](_0x3be7c5,_0x8117('0x2a'));_0x2e3387[_0x8117('0x34')]=_[_0x8117('0x35')](_0x140c1c[_0x8117('0x34')]);_0x2e3387[_0x8117('0x36')]=_['intersection'](_0x2e3387[_0x8117('0x33')],_0x2e3387[_0x8117('0x34')]);_0x5c1639[_0x8117('0x37')]=_[_0x8117('0x38')](_0x2e3387[_0x8117('0x33')],qs[_0x8117('0x39')](_0x140c1c['query']['fields']));_0x5c1639[_0x8117('0x37')]=_0x5c1639[_0x8117('0x37')][_0x8117('0x3a')]?_0x5c1639[_0x8117('0x37')]:_0x2e3387['model'];if(!_0x140c1c[_0x8117('0x34')][_0x8117('0x3b')](_0x8117('0x3c'))){_0x5c1639[_0x8117('0x20')]=qs[_0x8117('0x20')](_0x140c1c[_0x8117('0x34')][_0x8117('0x20')]);_0x5c1639[_0x8117('0x1e')]=qs[_0x8117('0x1e')](_0x140c1c['query'][_0x8117('0x1e')]);}_0x5c1639[_0x8117('0x3d')]=qs[_0x8117('0x3e')](_0x140c1c['query'][_0x8117('0x3e')]);_0x5c1639[_0x8117('0x3f')]=qs['filters'](_[_0x8117('0x40')](_0x140c1c[_0x8117('0x34')],_0x2e3387[_0x8117('0x36')]),_0x3be7c5);if(_0x140c1c[_0x8117('0x34')]['filter']){_0x5c1639[_0x8117('0x3f')]=_[_0x8117('0x41')](_0x5c1639[_0x8117('0x3f')],{'$or':_[_0x8117('0x2d')](_0x3be7c5,function(_0x481c7d){if(_0x481c7d[_0x8117('0x31')]!==_0x8117('0x42')){var _0x848917={};_0x848917[_0x481c7d[_0x8117('0x2a')]]={'$like':'%'+_0x140c1c[_0x8117('0x34')][_0x8117('0x43')]+'%'};return _0x848917;}})});}_0x5c1639=_[_0x8117('0x41')]({},_0x5c1639,_0x140c1c[_0x8117('0x44')]);var _0x467e05={'where':_0x5c1639[_0x8117('0x3f')]};return db[_0x8117('0x2e')]['count'](_0x467e05)[_0x8117('0x27')](function(_0x22413e){_0x58b2ff[_0x8117('0x21')]=_0x22413e;if(_0x140c1c[_0x8117('0x34')][_0x8117('0x45')]){_0x5c1639[_0x8117('0x46')]=[{'all':!![]}];}return db[_0x8117('0x2e')]['findAll'](_0x5c1639);})[_0x8117('0x27')](function(_0x3fed26){_0x58b2ff[_0x8117('0x47')]=_0x3fed26;return _0x58b2ff;})[_0x8117('0x27')](respondWithFilteredResult(_0x3bc5cf,_0x5c1639))[_0x8117('0x48')](handleError(_0x3bc5cf,null));};exports[_0x8117('0x49')]=function(_0x5450ac,_0x22aa71){var _0x1d1a1e={'raw':![],'where':{'id':_0x5450ac['params']['id']}},_0x2f7f08={};_0x2f7f08[_0x8117('0x33')]=_['keys'](db[_0x8117('0x2e')]['rawAttributes']);_0x2f7f08[_0x8117('0x34')]=_[_0x8117('0x35')](_0x5450ac[_0x8117('0x34')]);_0x2f7f08[_0x8117('0x36')]=_[_0x8117('0x38')](_0x2f7f08[_0x8117('0x33')],_0x2f7f08[_0x8117('0x34')]);_0x1d1a1e[_0x8117('0x37')]=_['intersection'](_0x2f7f08[_0x8117('0x33')],qs[_0x8117('0x39')](_0x5450ac[_0x8117('0x34')]['fields']));_0x1d1a1e['attributes']=_0x1d1a1e[_0x8117('0x37')][_0x8117('0x3a')]?_0x1d1a1e[_0x8117('0x37')]:_0x2f7f08['model'];if(_0x5450ac[_0x8117('0x34')]['includeAll']){_0x1d1a1e[_0x8117('0x46')]=[{'all':!![]}];}_0x1d1a1e=_[_0x8117('0x41')]({},_0x1d1a1e,_0x5450ac[_0x8117('0x44')]);return db[_0x8117('0x2e')][_0x8117('0x4a')](_0x1d1a1e)[_0x8117('0x27')](handleEntityNotFound(_0x22aa71,null))['then'](respondWithResult(_0x22aa71,null))[_0x8117('0x48')](handleError(_0x22aa71,null));};exports[_0x8117('0x4b')]=function(_0x227bd7,_0x28fd92){return db[_0x8117('0x2e')]['create'](_0x227bd7[_0x8117('0x4c')],{})[_0x8117('0x27')](respondWithResult(_0x28fd92,0xc9))[_0x8117('0x48')](handleError(_0x28fd92,null));};exports[_0x8117('0x26')]=function(_0x2744af,_0x624bc5){if(_0x2744af[_0x8117('0x4c')]['id']){delete _0x2744af['body']['id'];}return db[_0x8117('0x2e')][_0x8117('0x4a')]({'where':{'id':_0x2744af[_0x8117('0x4d')]['id']}})[_0x8117('0x27')](handleEntityNotFound(_0x624bc5,null))[_0x8117('0x27')](saveUpdates(_0x2744af[_0x8117('0x4c')],null))[_0x8117('0x27')](respondWithResult(_0x624bc5,null))['catch'](handleError(_0x624bc5,null));};exports['destroy']=function(_0x45dbd7,_0x1b9cc6){return db['SalesforceAccount']['find']({'where':{'id':_0x45dbd7[_0x8117('0x4d')]['id']}})[_0x8117('0x27')](handleEntityNotFound(_0x1b9cc6,null))[_0x8117('0x27')](removeEntity(_0x1b9cc6,null))[_0x8117('0x48')](handleError(_0x1b9cc6,null));};exports[_0x8117('0x4e')]=function(_0x3e633e,_0x53c0ad,_0x2ac125){var _0x5ac93b={};var _0x39894a={};var _0x3ffb72;var _0x5a0fae;return db['SalesforceAccount'][_0x8117('0x4f')]({'where':{'id':_0x3e633e['params']['id']}})['then'](handleEntityNotFound(_0x53c0ad,null))[_0x8117('0x27')](function(_0x4cecd0){if(_0x4cecd0){_0x3ffb72=_0x4cecd0;_0x39894a[_0x8117('0x33')]=_[_0x8117('0x35')](db['SalesforceConfiguration'][_0x8117('0x2f')]);_0x39894a[_0x8117('0x34')]=_['keys'](_0x3e633e[_0x8117('0x34')]);_0x39894a[_0x8117('0x36')]=_[_0x8117('0x38')](_0x39894a[_0x8117('0x33')],_0x39894a[_0x8117('0x34')]);_0x5ac93b[_0x8117('0x37')]=_['intersection'](_0x39894a[_0x8117('0x33')],qs['fields'](_0x3e633e[_0x8117('0x34')][_0x8117('0x39')]));_0x5ac93b[_0x8117('0x37')]=_0x5ac93b[_0x8117('0x37')][_0x8117('0x3a')]?_0x5ac93b[_0x8117('0x37')]:_0x39894a[_0x8117('0x33')];_0x5ac93b[_0x8117('0x3d')]=qs[_0x8117('0x3e')](_0x3e633e['query'][_0x8117('0x3e')]);_0x5ac93b[_0x8117('0x3f')]=qs['filters'](_[_0x8117('0x40')](_0x3e633e['query'],_0x39894a[_0x8117('0x36')]));if(_0x3e633e[_0x8117('0x34')][_0x8117('0x43')]){_0x5ac93b['where']=_['merge'](_0x5ac93b[_0x8117('0x3f')],{'$or':_[_0x8117('0x2d')](_0x5ac93b['attributes'],function(_0x3bcfae){var _0x32b45c={};_0x32b45c[_0x3bcfae]={'$like':'%'+_0x3e633e[_0x8117('0x34')][_0x8117('0x43')]+'%'};return _0x32b45c;})});}_0x5ac93b=_['merge']({},_0x5ac93b,_0x3e633e[_0x8117('0x44')]);return _0x3ffb72[_0x8117('0x4e')](_0x5ac93b);}})[_0x8117('0x27')](function(_0x10c2b1){if(_0x10c2b1){_0x5a0fae=_0x10c2b1['length'];if(!_0x3e633e[_0x8117('0x34')][_0x8117('0x3b')]('nolimit')){_0x5ac93b[_0x8117('0x20')]=qs[_0x8117('0x20')](_0x3e633e[_0x8117('0x34')][_0x8117('0x20')]);_0x5ac93b[_0x8117('0x1e')]=qs['offset'](_0x3e633e[_0x8117('0x34')][_0x8117('0x1e')]);}return _0x3ffb72[_0x8117('0x4e')](_0x5ac93b);}})[_0x8117('0x27')](function(_0x1eb451){if(_0x1eb451){return _0x1eb451?{'count':_0x5a0fae,'rows':_0x1eb451}:null;}})[_0x8117('0x27')](respondWithResult(_0x53c0ad,null))['catch'](handleError(_0x53c0ad,null));};exports['addConfiguration']=function(_0x45abf0,_0x2fb027,_0xc0202e){if(_0x45abf0['body']['id']){delete _0x45abf0[_0x8117('0x4c')]['id'];}return db[_0x8117('0x2e')][_0x8117('0x4f')]({'where':{'id':_0x45abf0['params']['id']}})[_0x8117('0x27')](handleEntityNotFound(_0x2fb027,null))['then'](function(_0x19eecc){if(_0x19eecc){_0x45abf0[_0x8117('0x4c')][_0x8117('0x50')]=_0x19eecc['id'];_0x45abf0[_0x8117('0x4c')][_0x8117('0x51')]=integrations[_0x8117('0x52')](_0x45abf0[_0x8117('0x4c')][_0x8117('0x53')],_0x45abf0[_0x8117('0x4c')][_0x8117('0x31')]);_0x45abf0['body']['Descriptions']=integrations[_0x8117('0x54')](_0x45abf0['body'][_0x8117('0x53')],_0x45abf0[_0x8117('0x4c')][_0x8117('0x31')]);return db[_0x8117('0x55')][_0x8117('0x4b')](_0x45abf0['body'],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x8117('0x56')],'as':'Descriptions'}]});}return null;})[_0x8117('0x27')](respondWithResult(_0x2fb027,null))['catch'](handleError(_0x2fb027,null));};exports['getFields']=function(_0x13fa2c,_0x4e3952,_0x51ce57){var _0x59b87d;var _0x163b09='';var _0x1535da=_0x8117('0x57');return db['SalesforceAccount'][_0x8117('0x4f')]({'where':{'id':_0x13fa2c['params']['id']},'attributes':['id',_0x8117('0x58'),'clientId','clientSecret',_0x8117('0x59'),_0x8117('0x5a'),_0x8117('0x5b')]})['then'](handleEntityNotFound(_0x4e3952,null))['then'](function(_0x197272){if(_0x197272){_0x163b09=_0x197272[_0x8117('0x58')];var _0x11fe97=_0x163b09[_0x8117('0x5c')](-0x1);if(_0x11fe97==='/'){_0x163b09=_0x163b09['substring'](0x0,_0x163b09['lastIndexOf'](_0x11fe97));}_0x59b87d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x163b09,'clientId':_0x197272[_0x8117('0x5d')],'clientSecret':_0x197272[_0x8117('0x5e')]}});return _0x59b87d[_0x8117('0x5f')](_0x197272[_0x8117('0x59')],_0x197272['password'][_0x8117('0x60')](_0x197272[_0x8117('0x5b')]));}})[_0x8117('0x27')](function(_0x34df6c){if(_0x34df6c){if(!_[_0x8117('0x61')](_0x13fa2c['query']['ticketType'])){_0x1535da=_0x13fa2c[_0x8117('0x34')][_0x8117('0x62')];}return _0x59b87d[_0x8117('0x63')](_0x1535da)[_0x8117('0x64')]();}})[_0x8117('0x27')](function(_0x277517){var _0x37108d=[_0x8117('0x65'),_0x8117('0x66'),_0x8117('0x67'),_0x8117('0x68'),_0x8117('0x69'),_0x8117('0x6a')];var _0x3aecaf=[_0x8117('0x6b'),_0x8117('0x6c'),_0x8117('0x6d'),_0x8117('0x6e'),_0x8117('0x6f'),_0x8117('0x70'),_0x8117('0x71')];if(_0x277517){_[_0x8117('0x72')](_0x277517['fields'],function(_0x306f90){return _0x37108d['includes'](_0x306f90[_0x8117('0x2a')])||!_0x3aecaf[_0x8117('0x73')](_0x306f90[_0x8117('0x31')]);});return{'count':_0x277517[_0x8117('0x39')][_0x8117('0x3a')],'rows':_[_0x8117('0x2d')](_0x277517[_0x8117('0x39')],function(_0x4f1d6b){return{'id':_0x4f1d6b['name'],'name':_0x4f1d6b['label'],'custom':_0x4f1d6b['custom'],'options':_0x4f1d6b[_0x8117('0x74')]['length']>0x0?_['map'](_0x4f1d6b[_0x8117('0x74')],function(_0x841811){return{'name':_0x841811[_0x8117('0x75')],'value':_0x841811[_0x8117('0x76')]};}):_0x4f1d6b[_0x8117('0x31')]==_0x8117('0x6e')?[{'name':_0x8117('0x77'),'value':_0x8117('0x78')},{'name':'False','value':'false'}]:[]};})};}})['then'](respondWithResult(_0x4e3952,null))['catch'](function(_0x46a59f){var _0x2ce83e=_0x13fa2c['query']['test']?0x1f4:_0x46a59f[_0x8117('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8117('0x7a'),_0x2ce83e,JSON[_0x8117('0x7b')](_0x46a59f));delete _0x46a59f['name'];if(_0x2ce83e===0x191){_0x2ce83e=0x190;}_0x4e3952[_0x8117('0x1b')](_0x2ce83e)[_0x8117('0x2b')](_0x13fa2c[_0x8117('0x34')][_0x8117('0x7c')]?{'message':_0x8117('0x7d'),'statusCode':_0x46a59f[_0x8117('0x79')]}:_0x46a59f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 986d877..fbe8963 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 _0xfeff=['util','../../config/logger','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xfeff,0xe5));var _0xffef=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xfeff[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var logger=require(_0xffef('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xffef('0x3'));var rimraf=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var attributes=require(_0xffef('0x6'));var integrations=require(_0xffef('0x7'));module[_0xffef('0x8')]=function(_0x2b43ee,_0x549d62){return _0x2b43ee[_0xffef('0x9')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b44=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3758fb,_0x11db3b){var _0x569da=function(_0x2bbd49){while(--_0x2bbd49){_0x3758fb['push'](_0x3758fb['shift']());}};_0x569da(++_0x11db3b);}(_0x2b44,0x1d7));var _0x42b4=function(_0x32364b,_0x3f4f0c){_0x32364b=_0x32364b-0x0;var _0x341391=_0x2b44[_0x32364b];return _0x341391;};'use strict';var _=require(_0x42b4('0x0'));var util=require('util');var logger=require(_0x42b4('0x1'))(_0x42b4('0x2'));var moment=require(_0x42b4('0x3'));var BPromise=require(_0x42b4('0x4'));var rp=require(_0x42b4('0x5'));var fs=require('fs');var path=require(_0x42b4('0x6'));var rimraf=require(_0x42b4('0x7'));var config=require(_0x42b4('0x8'));var attributes=require(_0x42b4('0x9'));var integrations=require(_0x42b4('0xa'));module['exports']=function(_0x28a60a,_0x1276e2){return _0x28a60a[_0x42b4('0xb')](_0x42b4('0xc'),attributes,{'tableName':_0x42b4('0xd'),'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 d99e3b1..37646a8 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 _0xeb18=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','attributes','model','ShowSalesforceAccount','find','raw'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xeb18,0xd8));var _0x8eb1=function(_0x19ee96,_0x48b7d5){_0x19ee96=_0x19ee96-0x0;var _0x57aaf0=_0xeb18[_0x19ee96];return _0x57aaf0;};'use strict';var _=require(_0x8eb1('0x0'));var util=require('util');var moment=require(_0x8eb1('0x1'));var BPromise=require(_0x8eb1('0x2'));var rs=require(_0x8eb1('0x3'));var fs=require('fs');var Redis=require(_0x8eb1('0x4'));var db=require(_0x8eb1('0x5'))['db'];var utils=require(_0x8eb1('0x6'));var logger=require(_0x8eb1('0x7'))(_0x8eb1('0x8'));var config=require(_0x8eb1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8eb1('0xa')][_0x8eb1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272a1d,_0x3a0cbd,_0x148bef){return new BPromise(function(_0x505168,_0x57fe11){return client['request'](_0x272a1d,_0x148bef)[_0x8eb1('0xc')](function(_0x5074c8){logger['info'](_0x8eb1('0xd'),_0x3a0cbd,_0x8eb1('0xe'));logger[_0x8eb1('0xf')](_0x8eb1('0x10'),_0x3a0cbd,'request\x20sent',JSON[_0x8eb1('0x11')](_0x5074c8));if(_0x5074c8[_0x8eb1('0x12')]){if(_0x5074c8[_0x8eb1('0x12')][_0x8eb1('0x13')]===0x1f4){logger['error'](_0x8eb1('0xd'),_0x3a0cbd,_0x5074c8[_0x8eb1('0x12')][_0x8eb1('0x14')]);return _0x57fe11(_0x5074c8[_0x8eb1('0x12')]['message']);}logger['error'](_0x8eb1('0xd'),_0x3a0cbd,_0x5074c8[_0x8eb1('0x12')][_0x8eb1('0x14')]);return _0x505168(_0x5074c8[_0x8eb1('0x12')][_0x8eb1('0x14')]);}else{logger[_0x8eb1('0x15')](_0x8eb1('0xd'),_0x3a0cbd,_0x8eb1('0xe'));_0x505168(_0x5074c8['result'][_0x8eb1('0x14')]);}})[_0x8eb1('0x16')](function(_0x49888d){logger[_0x8eb1('0x12')](_0x8eb1('0xd'),_0x3a0cbd,_0x49888d);_0x57fe11(_0x49888d);});});}exports[_0x8eb1('0x17')]=function(_0x40e1f0){var _0x7ed8a6=this;return new Promise(function(_0x3915dd,_0x46543d){return db[_0x8eb1('0x18')][_0x8eb1('0x19')]({'raw':_0x40e1f0[_0x8eb1('0x1a')]?_0x40e1f0[_0x8eb1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40e1f0[_0x8eb1('0x1a')]?_0x40e1f0['options'][_0x8eb1('0x1b')]||null:null,'attributes':_0x40e1f0[_0x8eb1('0x1a')]?_0x40e1f0[_0x8eb1('0x1a')]['attributes']||null:null,'limit':_0x40e1f0[_0x8eb1('0x1a')]?_0x40e1f0[_0x8eb1('0x1a')][_0x8eb1('0x1c')]||null:null,'include':_0x40e1f0[_0x8eb1('0x1a')]?_0x40e1f0['options'][_0x8eb1('0x1d')]?_[_0x8eb1('0x1e')](_0x40e1f0['options'][_0x8eb1('0x1d')],function(_0x282243){return{'model':db[_0x282243['model']],'as':_0x282243['as'],'attributes':_0x282243[_0x8eb1('0x1f')],'include':_0x282243[_0x8eb1('0x1d')]?_['map'](_0x282243[_0x8eb1('0x1d')],function(_0x525d43){return{'model':db[_0x525d43[_0x8eb1('0x20')]],'as':_0x525d43['as'],'attributes':_0x525d43[_0x8eb1('0x1f')],'include':_0x525d43['include']?_['map'](_0x525d43[_0x8eb1('0x1d')],function(_0x20d093){return{'model':db[_0x20d093[_0x8eb1('0x20')]],'as':_0x20d093['as'],'attributes':_0x20d093[_0x8eb1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8eb1('0xc')](function(_0x3bfd12){logger[_0x8eb1('0x15')]('GetSalesforceAccount',_0x40e1f0);logger['debug'](_0x8eb1('0x17'),_0x40e1f0,JSON[_0x8eb1('0x11')](_0x3bfd12));_0x3915dd(_0x3bfd12);})[_0x8eb1('0x16')](function(_0x2bf3e3){logger[_0x8eb1('0x12')](_0x8eb1('0x17'),_0x2bf3e3[_0x8eb1('0x14')],_0x40e1f0);_0x46543d(_0x7ed8a6['error'](0x1f4,_0x2bf3e3[_0x8eb1('0x14')]));});});};exports[_0x8eb1('0x21')]=function(_0x32327f){var _0x299984=this;return new Promise(function(_0x3d30e2,_0xdb711d){return db['SalesforceAccount'][_0x8eb1('0x22')]({'raw':_0x32327f[_0x8eb1('0x1a')]?_0x32327f['options'][_0x8eb1('0x23')]===undefined?!![]:![]:!![],'where':_0x32327f['options']?_0x32327f['options'][_0x8eb1('0x1b')]||null:null,'attributes':_0x32327f[_0x8eb1('0x1a')]?_0x32327f[_0x8eb1('0x1a')][_0x8eb1('0x1f')]||null:null,'include':_0x32327f['options']?_0x32327f[_0x8eb1('0x1a')][_0x8eb1('0x1d')]?_[_0x8eb1('0x1e')](_0x32327f[_0x8eb1('0x1a')]['include'],function(_0x1dde35){return{'model':db[_0x1dde35[_0x8eb1('0x20')]],'as':_0x1dde35['as'],'attributes':_0x1dde35['attributes'],'include':_0x1dde35[_0x8eb1('0x1d')]?_['map'](_0x1dde35[_0x8eb1('0x1d')],function(_0x53cbc7){return{'model':db[_0x53cbc7[_0x8eb1('0x20')]],'as':_0x53cbc7['as'],'attributes':_0x53cbc7[_0x8eb1('0x1f')],'include':_0x53cbc7[_0x8eb1('0x1d')]?_['map'](_0x53cbc7[_0x8eb1('0x1d')],function(_0x1e865d){return{'model':db[_0x1e865d[_0x8eb1('0x20')]],'as':_0x1e865d['as'],'attributes':_0x1e865d[_0x8eb1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8eb1('0xc')](function(_0x1d3b2e){logger[_0x8eb1('0x15')](_0x8eb1('0x21'),_0x32327f);logger[_0x8eb1('0xf')](_0x8eb1('0x21'),_0x32327f,JSON[_0x8eb1('0x11')](_0x1d3b2e));_0x3d30e2(_0x1d3b2e);})[_0x8eb1('0x16')](function(_0x1e2e12){logger[_0x8eb1('0x12')](_0x8eb1('0x21'),_0x1e2e12[_0x8eb1('0x14')],_0x32327f);_0xdb711d(_0x299984['error'](0x1f4,_0x1e2e12[_0x8eb1('0x14')]));});});}; \ No newline at end of file +var _0x9297=['attributes','limit','map','include','model','GetSalesforceAccount','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','SalesforceAccount','findAll','options','raw','where'];(function(_0x421e73,_0x5a2031){var _0x4d7143=function(_0x128e4d){while(--_0x128e4d){_0x421e73['push'](_0x421e73['shift']());}};_0x4d7143(++_0x5a2031);}(_0x9297,0x179));var _0x7929=function(_0xc1d84f,_0x54ec44){_0xc1d84f=_0xc1d84f-0x0;var _0xfcbc17=_0x9297[_0xc1d84f];return _0xfcbc17;};'use strict';var _=require(_0x7929('0x0'));var util=require(_0x7929('0x1'));var moment=require(_0x7929('0x2'));var BPromise=require(_0x7929('0x3'));var rs=require(_0x7929('0x4'));var fs=require('fs');var Redis=require(_0x7929('0x5'));var db=require(_0x7929('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7929('0x7'))('rpc');var config=require(_0x7929('0x8'));var jayson=require(_0x7929('0x9'));var client=jayson[_0x7929('0xa')][_0x7929('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41afc1,_0xe1a55f,_0x2c1daf){return new BPromise(function(_0x56b5da,_0xec1c6){return client[_0x7929('0xc')](_0x41afc1,_0x2c1daf)[_0x7929('0xd')](function(_0xfcc313){logger['info'](_0x7929('0xe'),_0xe1a55f,'request\x20sent');logger[_0x7929('0xf')](_0x7929('0x10'),_0xe1a55f,'request\x20sent',JSON[_0x7929('0x11')](_0xfcc313));if(_0xfcc313[_0x7929('0x12')]){if(_0xfcc313['error'][_0x7929('0x13')]===0x1f4){logger['error'](_0x7929('0xe'),_0xe1a55f,_0xfcc313[_0x7929('0x12')][_0x7929('0x14')]);return _0xec1c6(_0xfcc313['error'][_0x7929('0x14')]);}logger[_0x7929('0x12')](_0x7929('0xe'),_0xe1a55f,_0xfcc313[_0x7929('0x12')][_0x7929('0x14')]);return _0x56b5da(_0xfcc313[_0x7929('0x12')][_0x7929('0x14')]);}else{logger[_0x7929('0x15')](_0x7929('0xe'),_0xe1a55f,_0x7929('0x16'));_0x56b5da(_0xfcc313[_0x7929('0x17')][_0x7929('0x14')]);}})[_0x7929('0x18')](function(_0x374cce){logger[_0x7929('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0xe1a55f,_0x374cce);_0xec1c6(_0x374cce);});});}exports['GetSalesforceAccount']=function(_0x1d2488){var _0x551933=this;return new Promise(function(_0x469ef8,_0x1ac3f7){return db[_0x7929('0x19')][_0x7929('0x1a')]({'raw':_0x1d2488['options']?_0x1d2488[_0x7929('0x1b')][_0x7929('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d2488[_0x7929('0x1b')]?_0x1d2488['options'][_0x7929('0x1d')]||null:null,'attributes':_0x1d2488['options']?_0x1d2488[_0x7929('0x1b')][_0x7929('0x1e')]||null:null,'limit':_0x1d2488[_0x7929('0x1b')]?_0x1d2488[_0x7929('0x1b')][_0x7929('0x1f')]||null:null,'include':_0x1d2488[_0x7929('0x1b')]?_0x1d2488[_0x7929('0x1b')]['include']?_[_0x7929('0x20')](_0x1d2488[_0x7929('0x1b')][_0x7929('0x21')],function(_0x3dedaf){return{'model':db[_0x3dedaf[_0x7929('0x22')]],'as':_0x3dedaf['as'],'attributes':_0x3dedaf[_0x7929('0x1e')],'include':_0x3dedaf[_0x7929('0x21')]?_['map'](_0x3dedaf['include'],function(_0x4ec97e){return{'model':db[_0x4ec97e['model']],'as':_0x4ec97e['as'],'attributes':_0x4ec97e[_0x7929('0x1e')],'include':_0x4ec97e['include']?_[_0x7929('0x20')](_0x4ec97e[_0x7929('0x21')],function(_0xa71c2a){return{'model':db[_0xa71c2a['model']],'as':_0xa71c2a['as'],'attributes':_0xa71c2a[_0x7929('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f0fe){logger[_0x7929('0x15')](_0x7929('0x23'),_0x1d2488);logger[_0x7929('0xf')](_0x7929('0x23'),_0x1d2488,JSON[_0x7929('0x11')](_0x45f0fe));_0x469ef8(_0x45f0fe);})['catch'](function(_0x32d79e){logger[_0x7929('0x12')](_0x7929('0x23'),_0x32d79e[_0x7929('0x14')],_0x1d2488);_0x1ac3f7(_0x551933['error'](0x1f4,_0x32d79e[_0x7929('0x14')]));});});};exports[_0x7929('0x24')]=function(_0x4c6e3f){var _0x587e88=this;return new Promise(function(_0x2a6ce0,_0x543aa4){return db[_0x7929('0x19')]['find']({'raw':_0x4c6e3f[_0x7929('0x1b')]?_0x4c6e3f[_0x7929('0x1b')][_0x7929('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c6e3f[_0x7929('0x1b')]?_0x4c6e3f[_0x7929('0x1b')][_0x7929('0x1d')]||null:null,'attributes':_0x4c6e3f[_0x7929('0x1b')]?_0x4c6e3f[_0x7929('0x1b')][_0x7929('0x1e')]||null:null,'include':_0x4c6e3f[_0x7929('0x1b')]?_0x4c6e3f[_0x7929('0x1b')][_0x7929('0x21')]?_[_0x7929('0x20')](_0x4c6e3f[_0x7929('0x1b')][_0x7929('0x21')],function(_0x582278){return{'model':db[_0x582278[_0x7929('0x22')]],'as':_0x582278['as'],'attributes':_0x582278[_0x7929('0x1e')],'include':_0x582278['include']?_[_0x7929('0x20')](_0x582278[_0x7929('0x21')],function(_0x20e809){return{'model':db[_0x20e809[_0x7929('0x22')]],'as':_0x20e809['as'],'attributes':_0x20e809[_0x7929('0x1e')],'include':_0x20e809[_0x7929('0x21')]?_[_0x7929('0x20')](_0x20e809[_0x7929('0x21')],function(_0xcc35ee){return{'model':db[_0xcc35ee[_0x7929('0x22')]],'as':_0xcc35ee['as'],'attributes':_0xcc35ee[_0x7929('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7929('0xd')](function(_0x2e5461){logger['info'](_0x7929('0x24'),_0x4c6e3f);logger[_0x7929('0xf')](_0x7929('0x24'),_0x4c6e3f,JSON[_0x7929('0x11')](_0x2e5461));_0x2a6ce0(_0x2e5461);})[_0x7929('0x18')](function(_0x2fb685){logger[_0x7929('0x12')](_0x7929('0x24'),_0x2fb685['message'],_0x4c6e3f);_0x543aa4(_0x587e88[_0x7929('0x12')](0x1f4,_0x2fb685['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d025a76..0434609 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xdb28,0x106));var _0x8db2=function(_0x1ff713,_0x453bd6){_0x1ff713=_0x1ff713-0x0;var _0x170018=_0xdb28[_0x1ff713];return _0x170018;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1fff4a,_0x5be09c){var _0x5a0a4a=function(_0x29af80){while(--_0x29af80){_0x1fff4a['push'](_0x1fff4a['shift']());}};_0x5a0a4a(++_0x5be09c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x214e5f,_0x3ee8e7){_0x214e5f=_0x214e5f-0x0;var _0x58674c=_0x5f2f[_0x214e5f];return _0x58674c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d7d754b..b4eb671 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 _0x0176=['account','nothing','sequelize','STRING','ENUM','Case','contact','lead','account_contact_lead'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0x0176,0x14f));var _0x6017=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0176[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6017('0x0'));module['exports']={'name':{'type':Sequelize[_0x6017('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6017('0x2')]('Task',_0x6017('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x6017('0x4'),_0x6017('0x5'),_0x6017('0x6'),_0x6017('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6017('0x2')](_0x6017('0x8'),'contact','lead','account'),'defaultValue':_0x6017('0x5')},'leadId':{'type':Sequelize[_0x6017('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6017('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x6017('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x6017('0x1')]}}; \ No newline at end of file +var _0x85cf=['Task','Case','lead','account_contact_lead','contact_lead','nothing','contact','account','exports','STRING','ENUM'];(function(_0x31443c,_0x4b7366){var _0x38a27f=function(_0xd4c705){while(--_0xd4c705){_0x31443c['push'](_0x31443c['shift']());}};_0x38a27f(++_0x4b7366);}(_0x85cf,0x76));var _0xf85c=function(_0x36ff77,_0x1bc3b2){_0x36ff77=_0x36ff77-0x0;var _0xfa7095=_0x85cf[_0x36ff77];return _0xfa7095;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'name':{'type':Sequelize[_0xf85c('0x1')]},'description':{'type':Sequelize[_0xf85c('0x1')]},'ticketType':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x3'),_0xf85c('0x4')),'defaultValue':_0xf85c('0x3')},'moduleSearch':{'type':Sequelize[_0xf85c('0x2')]('contact_lead','contact',_0xf85c('0x5'),_0xf85c('0x6'),'account'),'defaultValue':_0xf85c('0x7')},'moduleCreate':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x8'),_0xf85c('0x9'),_0xf85c('0x5'),_0xf85c('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xf85c('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xf85c('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index df897fd..e8383dd 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 _0xecd0=['params','rawAttributes','merge','find','create','body','getFields','SalesforceField','sort','findOne','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show'];(function(_0x4aab6c,_0x5193d9){var _0x4a4472=function(_0x4cef7a){while(--_0x4cef7a){_0x4aab6c['push'](_0x4aab6c['shift']());}};_0x4a4472(++_0x5193d9);}(_0xecd0,0x162));var _0x0ecd=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xecd0[_0x59b439];return _0x521ea3;};'use strict';var emlformat=require(_0x0ecd('0x0'));var rimraf=require(_0x0ecd('0x1'));var zipdir=require(_0x0ecd('0x2'));var jsonpatch=require(_0x0ecd('0x3'));var rp=require(_0x0ecd('0x4'));var moment=require('moment');var BPromise=require(_0x0ecd('0x5'));var Mustache=require(_0x0ecd('0x6'));var util=require(_0x0ecd('0x7'));var path=require(_0x0ecd('0x8'));var sox=require('sox');var csv=require(_0x0ecd('0x9'));var ejs=require(_0x0ecd('0xa'));var fs=require('fs');var fs_extra=require(_0x0ecd('0xb'));var _=require(_0x0ecd('0xc'));var squel=require(_0x0ecd('0xd'));var crypto=require(_0x0ecd('0xe'));var jsforce=require(_0x0ecd('0xf'));var deskjs=require(_0x0ecd('0x10'));var toCsv=require(_0x0ecd('0x9'));var querystring=require(_0x0ecd('0x11'));var Papa=require(_0x0ecd('0x12'));var Redis=require(_0x0ecd('0x13'));var authService=require(_0x0ecd('0x14'));var qs=require(_0x0ecd('0x15'));var as=require(_0x0ecd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ecd('0x17'))(_0x0ecd('0x18'));var utils=require(_0x0ecd('0x19'));var config=require(_0x0ecd('0x1a'));var licenseUtil=require(_0x0ecd('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124f76,_0x519253){_0x519253=_0x519253||0xcc;return function(_0x5009e1){if(_0x5009e1){return _0x124f76[_0x0ecd('0x1c')](_0x519253);}return _0x124f76[_0x0ecd('0x1d')](_0x519253)['end']();};}function respondWithResult(_0x4901b1,_0x1371d6){_0x1371d6=_0x1371d6||0xc8;return function(_0x342fc0){if(_0x342fc0){return _0x4901b1[_0x0ecd('0x1d')](_0x1371d6)[_0x0ecd('0x1e')](_0x342fc0);}};}function respondWithFilteredResult(_0x549ff0,_0x4d2ea3){return function(_0x27cbbc){if(_0x27cbbc){var _0x3b04db=typeof _0x4d2ea3['offset']==='undefined'&&typeof _0x4d2ea3[_0x0ecd('0x1f')]===_0x0ecd('0x20');var _0x13e519=_0x27cbbc['count'];var _0x43cdeb=_0x3b04db?0x0:_0x4d2ea3[_0x0ecd('0x21')];var _0x1ba463=_0x3b04db?_0x27cbbc['count']:_0x4d2ea3[_0x0ecd('0x21')]+_0x4d2ea3[_0x0ecd('0x1f')];var _0x1edd32;if(_0x1ba463>=_0x13e519){_0x1ba463=_0x13e519;_0x1edd32=0xc8;}else{_0x1edd32=0xce;}_0x549ff0[_0x0ecd('0x1d')](_0x1edd32);return _0x549ff0[_0x0ecd('0x22')](_0x0ecd('0x23'),_0x43cdeb+'-'+_0x1ba463+'/'+_0x13e519)['json'](_0x27cbbc);}return null;};}function patchUpdates(_0x3b9905){return function(_0x14b6ee){try{jsonpatch[_0x0ecd('0x24')](_0x14b6ee,_0x3b9905,!![]);}catch(_0x5d30cc){return BPromise['reject'](_0x5d30cc);}return _0x14b6ee[_0x0ecd('0x25')]();};}function saveUpdates(_0x22996c,_0x45379e){return function(_0x275a3b){if(_0x275a3b){return _0x275a3b[_0x0ecd('0x26')](_0x22996c)[_0x0ecd('0x27')](function(_0x3e3720){return _0x3e3720;});}return null;};}function removeEntity(_0x5a0ca7,_0x3b8ff8){return function(_0x47ed6a){if(_0x47ed6a){return _0x47ed6a[_0x0ecd('0x28')]()[_0x0ecd('0x27')](function(){_0x5a0ca7[_0x0ecd('0x1d')](0xcc)[_0x0ecd('0x29')]();});}};}function handleEntityNotFound(_0x34f1cd,_0x115a77){return function(_0x3b9d37){if(!_0x3b9d37){_0x34f1cd[_0x0ecd('0x1c')](0x194);}return _0x3b9d37;};}function handleError(_0x564157,_0x4430c0){_0x4430c0=_0x4430c0||0x1f4;return function(_0x421960){logger['error'](_0x421960[_0x0ecd('0x2a')]);if(_0x421960[_0x0ecd('0x2b')]){delete _0x421960[_0x0ecd('0x2b')];}_0x564157[_0x0ecd('0x1d')](_0x4430c0)[_0x0ecd('0x2c')](_0x421960);};}exports[_0x0ecd('0x2d')]=function(_0x5c5f38,_0x1c8304){var _0x55355b={},_0x5b595c={},_0x29d8be={'count':0x0,'rows':[]};var _0xfb167b=_[_0x0ecd('0x2e')](db[_0x0ecd('0x2f')]['rawAttributes'],function(_0x152785){return{'name':_0x152785['fieldName'],'type':_0x152785[_0x0ecd('0x30')][_0x0ecd('0x31')]};});_0x5b595c[_0x0ecd('0x32')]=_[_0x0ecd('0x2e')](_0xfb167b,_0x0ecd('0x2b'));_0x5b595c[_0x0ecd('0x33')]=_[_0x0ecd('0x34')](_0x5c5f38[_0x0ecd('0x33')]);_0x5b595c[_0x0ecd('0x35')]=_[_0x0ecd('0x36')](_0x5b595c[_0x0ecd('0x32')],_0x5b595c['query']);_0x55355b[_0x0ecd('0x37')]=_[_0x0ecd('0x36')](_0x5b595c[_0x0ecd('0x32')],qs['fields'](_0x5c5f38['query'][_0x0ecd('0x38')]));_0x55355b['attributes']=_0x55355b[_0x0ecd('0x37')][_0x0ecd('0x39')]?_0x55355b[_0x0ecd('0x37')]:_0x5b595c[_0x0ecd('0x32')];if(!_0x5c5f38[_0x0ecd('0x33')]['hasOwnProperty'](_0x0ecd('0x3a'))){_0x55355b['limit']=qs['limit'](_0x5c5f38['query'][_0x0ecd('0x1f')]);_0x55355b[_0x0ecd('0x21')]=qs['offset'](_0x5c5f38[_0x0ecd('0x33')][_0x0ecd('0x21')]);}_0x55355b['order']=qs['sort'](_0x5c5f38[_0x0ecd('0x33')]['sort']);_0x55355b[_0x0ecd('0x3b')]=qs[_0x0ecd('0x35')](_[_0x0ecd('0x3c')](_0x5c5f38[_0x0ecd('0x33')],_0x5b595c[_0x0ecd('0x35')]),_0xfb167b);if(_0x5c5f38[_0x0ecd('0x33')]['filter']){_0x55355b['where']=_['merge'](_0x55355b[_0x0ecd('0x3b')],{'$or':_[_0x0ecd('0x2e')](_0xfb167b,function(_0x15de6f){if(_0x15de6f[_0x0ecd('0x30')]!==_0x0ecd('0x3d')){var _0x3fbffb={};_0x3fbffb[_0x15de6f[_0x0ecd('0x2b')]]={'$like':'%'+_0x5c5f38[_0x0ecd('0x33')][_0x0ecd('0x3e')]+'%'};return _0x3fbffb;}})});}_0x55355b=_['merge']({},_0x55355b,_0x5c5f38[_0x0ecd('0x3f')]);var _0x50c3ea={'where':_0x55355b['where']};return db[_0x0ecd('0x2f')][_0x0ecd('0x40')](_0x50c3ea)[_0x0ecd('0x27')](function(_0xbda6b9){_0x29d8be[_0x0ecd('0x40')]=_0xbda6b9;if(_0x5c5f38['query'][_0x0ecd('0x41')]){_0x55355b[_0x0ecd('0x42')]=[{'all':!![]}];}return db[_0x0ecd('0x2f')][_0x0ecd('0x43')](_0x55355b);})[_0x0ecd('0x27')](function(_0x5104c8){_0x29d8be[_0x0ecd('0x44')]=_0x5104c8;return _0x29d8be;})[_0x0ecd('0x27')](respondWithFilteredResult(_0x1c8304,_0x55355b))[_0x0ecd('0x45')](handleError(_0x1c8304,null));};exports[_0x0ecd('0x46')]=function(_0x372d1a,_0x4b2d91){var _0x46387c={'raw':![],'where':{'id':_0x372d1a[_0x0ecd('0x47')]['id']}},_0x177488={};_0x177488[_0x0ecd('0x32')]=_['keys'](db[_0x0ecd('0x2f')][_0x0ecd('0x48')]);_0x177488[_0x0ecd('0x33')]=_[_0x0ecd('0x34')](_0x372d1a[_0x0ecd('0x33')]);_0x177488['filters']=_['intersection'](_0x177488['model'],_0x177488[_0x0ecd('0x33')]);_0x46387c[_0x0ecd('0x37')]=_[_0x0ecd('0x36')](_0x177488['model'],qs[_0x0ecd('0x38')](_0x372d1a[_0x0ecd('0x33')][_0x0ecd('0x38')]));_0x46387c[_0x0ecd('0x37')]=_0x46387c[_0x0ecd('0x37')][_0x0ecd('0x39')]?_0x46387c[_0x0ecd('0x37')]:_0x177488[_0x0ecd('0x32')];if(_0x372d1a[_0x0ecd('0x33')][_0x0ecd('0x41')]){_0x46387c[_0x0ecd('0x42')]=[{'all':!![]}];}_0x46387c=_[_0x0ecd('0x49')]({},_0x46387c,_0x372d1a[_0x0ecd('0x3f')]);return db['SalesforceConfiguration'][_0x0ecd('0x4a')](_0x46387c)[_0x0ecd('0x27')](handleEntityNotFound(_0x4b2d91,null))['then'](respondWithResult(_0x4b2d91,null))['catch'](handleError(_0x4b2d91,null));};exports[_0x0ecd('0x4b')]=function(_0x293fe7,_0x19a470){return db[_0x0ecd('0x2f')][_0x0ecd('0x4b')](_0x293fe7[_0x0ecd('0x4c')],{})[_0x0ecd('0x27')](respondWithResult(_0x19a470,0xc9))['catch'](handleError(_0x19a470,null));};exports[_0x0ecd('0x26')]=function(_0x112c0b,_0x4cb400){if(_0x112c0b[_0x0ecd('0x4c')]['id']){delete _0x112c0b[_0x0ecd('0x4c')]['id'];}return db['SalesforceConfiguration'][_0x0ecd('0x4a')]({'where':{'id':_0x112c0b[_0x0ecd('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cb400,null))['then'](saveUpdates(_0x112c0b[_0x0ecd('0x4c')],null))[_0x0ecd('0x27')](respondWithResult(_0x4cb400,null))[_0x0ecd('0x45')](handleError(_0x4cb400,null));};exports[_0x0ecd('0x28')]=function(_0x11407c,_0x19cff6){return db[_0x0ecd('0x2f')]['find']({'where':{'id':_0x11407c[_0x0ecd('0x47')]['id']}})[_0x0ecd('0x27')](handleEntityNotFound(_0x19cff6,null))[_0x0ecd('0x27')](removeEntity(_0x19cff6,null))[_0x0ecd('0x45')](handleError(_0x19cff6,null));};exports[_0x0ecd('0x4d')]=function(_0x2699e8,_0x268634,_0x3643f5){var _0x4e7e01={};var _0x64349e={};var _0x37b2b0;var _0x94a702;return db[_0x0ecd('0x2f')]['findOne']({'where':{'id':_0x2699e8['params']['id']}})[_0x0ecd('0x27')](handleEntityNotFound(_0x268634,null))[_0x0ecd('0x27')](function(_0x10d6f7){if(_0x10d6f7){_0x37b2b0=_0x10d6f7;_0x64349e['model']=_[_0x0ecd('0x34')](db[_0x0ecd('0x4e')]['rawAttributes']);_0x64349e['query']=_[_0x0ecd('0x34')](_0x2699e8['query']);_0x64349e['filters']=_[_0x0ecd('0x36')](_0x64349e[_0x0ecd('0x32')],_0x64349e[_0x0ecd('0x33')]);_0x4e7e01[_0x0ecd('0x37')]=_[_0x0ecd('0x36')](_0x64349e[_0x0ecd('0x32')],qs[_0x0ecd('0x38')](_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x38')]));_0x4e7e01['attributes']=_0x4e7e01[_0x0ecd('0x37')][_0x0ecd('0x39')]?_0x4e7e01[_0x0ecd('0x37')]:_0x64349e[_0x0ecd('0x32')];_0x4e7e01['order']=qs['sort'](_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x4f')]);_0x4e7e01[_0x0ecd('0x3b')]=qs[_0x0ecd('0x35')](_['pick'](_0x2699e8[_0x0ecd('0x33')],_0x64349e[_0x0ecd('0x35')]));if(_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x3e')]){_0x4e7e01[_0x0ecd('0x3b')]=_[_0x0ecd('0x49')](_0x4e7e01[_0x0ecd('0x3b')],{'$or':_['map'](_0x4e7e01[_0x0ecd('0x37')],function(_0x477d1b){var _0xc69938={};_0xc69938[_0x477d1b]={'$like':'%'+_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x3e')]+'%'};return _0xc69938;})});}_0x4e7e01=_['merge']({},_0x4e7e01,_0x2699e8[_0x0ecd('0x3f')]);return _0x37b2b0['getFields'](_0x4e7e01);}})['then'](function(_0x486e30){if(_0x486e30){_0x94a702=_0x486e30['length'];if(!_0x2699e8[_0x0ecd('0x33')]['hasOwnProperty'](_0x0ecd('0x3a'))){_0x4e7e01[_0x0ecd('0x1f')]=qs['limit'](_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x1f')]);_0x4e7e01[_0x0ecd('0x21')]=qs[_0x0ecd('0x21')](_0x2699e8[_0x0ecd('0x33')][_0x0ecd('0x21')]);}return _0x37b2b0[_0x0ecd('0x4d')](_0x4e7e01);}})[_0x0ecd('0x27')](function(_0x57baea){if(_0x57baea){return _0x57baea?{'count':_0x94a702,'rows':_0x57baea}:null;}})[_0x0ecd('0x27')](respondWithResult(_0x268634,null))[_0x0ecd('0x45')](handleError(_0x268634,null));};exports['getSubjects']=function(_0x2eaa07,_0x23afcc,_0x5460f5){var _0x31b9ab={};var _0x1ec324={};var _0x2f9622;var _0x2e9471;return db['SalesforceConfiguration'][_0x0ecd('0x50')]({'where':{'id':_0x2eaa07[_0x0ecd('0x47')]['id']}})[_0x0ecd('0x27')](handleEntityNotFound(_0x23afcc,null))[_0x0ecd('0x27')](function(_0x3573bc){if(_0x3573bc){_0x2f9622=_0x3573bc;_0x1ec324[_0x0ecd('0x32')]=_[_0x0ecd('0x34')](db['SalesforceField'][_0x0ecd('0x48')]);_0x1ec324[_0x0ecd('0x33')]=_[_0x0ecd('0x34')](_0x2eaa07[_0x0ecd('0x33')]);_0x1ec324[_0x0ecd('0x35')]=_[_0x0ecd('0x36')](_0x1ec324[_0x0ecd('0x32')],_0x1ec324[_0x0ecd('0x33')]);_0x31b9ab[_0x0ecd('0x37')]=_[_0x0ecd('0x36')](_0x1ec324['model'],qs[_0x0ecd('0x38')](_0x2eaa07[_0x0ecd('0x33')][_0x0ecd('0x38')]));_0x31b9ab['attributes']=_0x31b9ab[_0x0ecd('0x37')][_0x0ecd('0x39')]?_0x31b9ab[_0x0ecd('0x37')]:_0x1ec324[_0x0ecd('0x32')];_0x31b9ab[_0x0ecd('0x51')]=qs['sort'](_0x2eaa07[_0x0ecd('0x33')]['sort']);_0x31b9ab['where']=qs[_0x0ecd('0x35')](_[_0x0ecd('0x3c')](_0x2eaa07[_0x0ecd('0x33')],_0x1ec324[_0x0ecd('0x35')]));if(_0x2eaa07[_0x0ecd('0x33')][_0x0ecd('0x3e')]){_0x31b9ab[_0x0ecd('0x3b')]=_[_0x0ecd('0x49')](_0x31b9ab[_0x0ecd('0x3b')],{'$or':_[_0x0ecd('0x2e')](_0x31b9ab[_0x0ecd('0x37')],function(_0x44e38f){var _0x1e7687={};_0x1e7687[_0x44e38f]={'$like':'%'+_0x2eaa07['query'][_0x0ecd('0x3e')]+'%'};return _0x1e7687;})});}_0x31b9ab=_[_0x0ecd('0x49')]({},_0x31b9ab,_0x2eaa07[_0x0ecd('0x3f')]);return _0x2f9622['getSubjects'](_0x31b9ab);}})[_0x0ecd('0x27')](function(_0x55db99){if(_0x55db99){_0x2e9471=_0x55db99[_0x0ecd('0x39')];if(!_0x2eaa07[_0x0ecd('0x33')][_0x0ecd('0x52')](_0x0ecd('0x3a'))){_0x31b9ab[_0x0ecd('0x1f')]=qs['limit'](_0x2eaa07[_0x0ecd('0x33')]['limit']);_0x31b9ab[_0x0ecd('0x21')]=qs[_0x0ecd('0x21')](_0x2eaa07[_0x0ecd('0x33')][_0x0ecd('0x21')]);}return _0x2f9622[_0x0ecd('0x53')](_0x31b9ab);}})['then'](function(_0x307e6a){if(_0x307e6a){return _0x307e6a?{'count':_0x2e9471,'rows':_0x307e6a}:null;}})[_0x0ecd('0x27')](respondWithResult(_0x23afcc,null))[_0x0ecd('0x45')](handleError(_0x23afcc,null));};exports[_0x0ecd('0x54')]=function(_0x50717c,_0x5d8912,_0x2e507a){var _0x3808f5={};var _0x1db11e={};var _0x1f75f6;var _0x4d3389;return db[_0x0ecd('0x2f')][_0x0ecd('0x50')]({'where':{'id':_0x50717c[_0x0ecd('0x47')]['id']}})[_0x0ecd('0x27')](handleEntityNotFound(_0x5d8912,null))[_0x0ecd('0x27')](function(_0x41732f){if(_0x41732f){_0x1f75f6=_0x41732f;_0x1db11e['model']=_[_0x0ecd('0x34')](db[_0x0ecd('0x4e')][_0x0ecd('0x48')]);_0x1db11e[_0x0ecd('0x33')]=_['keys'](_0x50717c[_0x0ecd('0x33')]);_0x1db11e[_0x0ecd('0x35')]=_[_0x0ecd('0x36')](_0x1db11e[_0x0ecd('0x32')],_0x1db11e[_0x0ecd('0x33')]);_0x3808f5[_0x0ecd('0x37')]=_[_0x0ecd('0x36')](_0x1db11e['model'],qs[_0x0ecd('0x38')](_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x38')]));_0x3808f5['attributes']=_0x3808f5[_0x0ecd('0x37')][_0x0ecd('0x39')]?_0x3808f5[_0x0ecd('0x37')]:_0x1db11e[_0x0ecd('0x32')];_0x3808f5[_0x0ecd('0x51')]=qs['sort'](_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x4f')]);_0x3808f5['where']=qs[_0x0ecd('0x35')](_[_0x0ecd('0x3c')](_0x50717c[_0x0ecd('0x33')],_0x1db11e['filters']));if(_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x3e')]){_0x3808f5['where']=_['merge'](_0x3808f5[_0x0ecd('0x3b')],{'$or':_[_0x0ecd('0x2e')](_0x3808f5[_0x0ecd('0x37')],function(_0x366f75){var _0x49c94d={};_0x49c94d[_0x366f75]={'$like':'%'+_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x3e')]+'%'};return _0x49c94d;})});}_0x3808f5=_[_0x0ecd('0x49')]({},_0x3808f5,_0x50717c['options']);return _0x1f75f6[_0x0ecd('0x54')](_0x3808f5);}})['then'](function(_0x418709){if(_0x418709){_0x4d3389=_0x418709['length'];if(!_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x52')](_0x0ecd('0x3a'))){_0x3808f5[_0x0ecd('0x1f')]=qs[_0x0ecd('0x1f')](_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x1f')]);_0x3808f5[_0x0ecd('0x21')]=qs['offset'](_0x50717c[_0x0ecd('0x33')][_0x0ecd('0x21')]);}return _0x1f75f6[_0x0ecd('0x54')](_0x3808f5);}})[_0x0ecd('0x27')](function(_0x1882b2){if(_0x1882b2){return _0x1882b2?{'count':_0x4d3389,'rows':_0x1882b2}:null;}})[_0x0ecd('0x27')](respondWithResult(_0x5d8912,null))['catch'](handleError(_0x5d8912,null));}; \ No newline at end of file +var _0x1c9a=['hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','show','params','find','catch','create','update','body','destroy','getFields','findOne','SalesforceField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x76def9,_0x373afa){var _0x4251ba=function(_0xb79c40){while(--_0xb79c40){_0x76def9['push'](_0x76def9['shift']());}};_0x4251ba(++_0x373afa);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x5e9aeb,_0x557874){_0x5e9aeb=_0x5e9aeb-0x0;var _0x129407=_0x1c9a[_0x5e9aeb];return _0x129407;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require(_0xa1c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1c9('0x2'));var rp=require(_0xa1c9('0x3'));var moment=require(_0xa1c9('0x4'));var BPromise=require(_0xa1c9('0x5'));var Mustache=require(_0xa1c9('0x6'));var util=require('util');var path=require(_0xa1c9('0x7'));var sox=require('sox');var csv=require(_0xa1c9('0x8'));var ejs=require(_0xa1c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c9('0xa'));var _=require(_0xa1c9('0xb'));var squel=require(_0xa1c9('0xc'));var crypto=require(_0xa1c9('0xd'));var jsforce=require(_0xa1c9('0xe'));var deskjs=require(_0xa1c9('0xf'));var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0x10'));var Papa=require(_0xa1c9('0x11'));var Redis=require(_0xa1c9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c9('0x14'))(_0xa1c9('0x15'));var utils=require(_0xa1c9('0x16'));var config=require(_0xa1c9('0x17'));var licenseUtil=require(_0xa1c9('0x18'));var db=require(_0xa1c9('0x19'))['db'];function respondWithStatusCode(_0x390bd3,_0x1b0149){_0x1b0149=_0x1b0149||0xcc;return function(_0x33191d){if(_0x33191d){return _0x390bd3[_0xa1c9('0x1a')](_0x1b0149);}return _0x390bd3[_0xa1c9('0x1b')](_0x1b0149)[_0xa1c9('0x1c')]();};}function respondWithResult(_0x409dcc,_0x9df889){_0x9df889=_0x9df889||0xc8;return function(_0x33aaa8){if(_0x33aaa8){return _0x409dcc[_0xa1c9('0x1b')](_0x9df889)[_0xa1c9('0x1d')](_0x33aaa8);}};}function respondWithFilteredResult(_0x275059,_0x3f16d6){return function(_0x3f4131){if(_0x3f4131){var _0x59463b=typeof _0x3f16d6[_0xa1c9('0x1e')]==='undefined'&&typeof _0x3f16d6[_0xa1c9('0x1f')]===_0xa1c9('0x20');var _0x3f244b=_0x3f4131[_0xa1c9('0x21')];var _0x13086a=_0x59463b?0x0:_0x3f16d6[_0xa1c9('0x1e')];var _0x223932=_0x59463b?_0x3f4131[_0xa1c9('0x21')]:_0x3f16d6[_0xa1c9('0x1e')]+_0x3f16d6[_0xa1c9('0x1f')];var _0x278ba6;if(_0x223932>=_0x3f244b){_0x223932=_0x3f244b;_0x278ba6=0xc8;}else{_0x278ba6=0xce;}_0x275059[_0xa1c9('0x1b')](_0x278ba6);return _0x275059['set'](_0xa1c9('0x22'),_0x13086a+'-'+_0x223932+'/'+_0x3f244b)[_0xa1c9('0x1d')](_0x3f4131);}return null;};}function patchUpdates(_0x5d0599){return function(_0x1cc3c9){try{jsonpatch[_0xa1c9('0x23')](_0x1cc3c9,_0x5d0599,!![]);}catch(_0x22031f){return BPromise[_0xa1c9('0x24')](_0x22031f);}return _0x1cc3c9[_0xa1c9('0x25')]();};}function saveUpdates(_0x58ac15,_0x3c2b40){return function(_0x2acfb7){if(_0x2acfb7){return _0x2acfb7['update'](_0x58ac15)[_0xa1c9('0x26')](function(_0x23e18e){return _0x23e18e;});}return null;};}function removeEntity(_0x33b4ae,_0x25418a){return function(_0x168c19){if(_0x168c19){return _0x168c19['destroy']()[_0xa1c9('0x26')](function(){_0x33b4ae[_0xa1c9('0x1b')](0xcc)[_0xa1c9('0x1c')]();});}};}function handleEntityNotFound(_0x484a6b,_0x1fa411){return function(_0x37da08){if(!_0x37da08){_0x484a6b[_0xa1c9('0x1a')](0x194);}return _0x37da08;};}function handleError(_0x401380,_0x1575cc){_0x1575cc=_0x1575cc||0x1f4;return function(_0x339dee){logger[_0xa1c9('0x27')](_0x339dee[_0xa1c9('0x28')]);if(_0x339dee[_0xa1c9('0x29')]){delete _0x339dee[_0xa1c9('0x29')];}_0x401380[_0xa1c9('0x1b')](_0x1575cc)[_0xa1c9('0x2a')](_0x339dee);};}exports[_0xa1c9('0x2b')]=function(_0x3f43f1,_0x35cea){var _0xf584e2={},_0x568996={},_0x603beb={'count':0x0,'rows':[]};var _0x429f3d=_[_0xa1c9('0x2c')](db[_0xa1c9('0x2d')][_0xa1c9('0x2e')],function(_0x4c6dd4){return{'name':_0x4c6dd4[_0xa1c9('0x2f')],'type':_0x4c6dd4[_0xa1c9('0x30')]['key']};});_0x568996[_0xa1c9('0x31')]=_[_0xa1c9('0x2c')](_0x429f3d,_0xa1c9('0x29'));_0x568996[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x3f43f1[_0xa1c9('0x32')]);_0x568996[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0x568996[_0xa1c9('0x31')],_0x568996[_0xa1c9('0x32')]);_0xf584e2[_0xa1c9('0x36')]=_[_0xa1c9('0x35')](_0x568996[_0xa1c9('0x31')],qs[_0xa1c9('0x37')](_0x3f43f1[_0xa1c9('0x32')]['fields']));_0xf584e2[_0xa1c9('0x36')]=_0xf584e2[_0xa1c9('0x36')][_0xa1c9('0x38')]?_0xf584e2[_0xa1c9('0x36')]:_0x568996['model'];if(!_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x39')]('nolimit')){_0xf584e2['limit']=qs[_0xa1c9('0x1f')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0xf584e2[_0xa1c9('0x1e')]=qs[_0xa1c9('0x1e')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x1e')]);}_0xf584e2[_0xa1c9('0x3a')]=qs[_0xa1c9('0x3b')](_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3b')]);_0xf584e2['where']=qs[_0xa1c9('0x34')](_[_0xa1c9('0x3c')](_0x3f43f1[_0xa1c9('0x32')],_0x568996[_0xa1c9('0x34')]),_0x429f3d);if(_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3d')]){_0xf584e2[_0xa1c9('0x3e')]=_[_0xa1c9('0x3f')](_0xf584e2['where'],{'$or':_[_0xa1c9('0x2c')](_0x429f3d,function(_0x15d6b2){if(_0x15d6b2[_0xa1c9('0x30')]!=='VIRTUAL'){var _0x211853={};_0x211853[_0x15d6b2[_0xa1c9('0x29')]]={'$like':'%'+_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x3d')]+'%'};return _0x211853;}})});}_0xf584e2=_[_0xa1c9('0x3f')]({},_0xf584e2,_0x3f43f1[_0xa1c9('0x40')]);var _0x32502b={'where':_0xf584e2['where']};return db[_0xa1c9('0x2d')]['count'](_0x32502b)[_0xa1c9('0x26')](function(_0x4c1a9e){_0x603beb[_0xa1c9('0x21')]=_0x4c1a9e;if(_0x3f43f1[_0xa1c9('0x32')][_0xa1c9('0x41')]){_0xf584e2['include']=[{'all':!![]}];}return db[_0xa1c9('0x2d')]['findAll'](_0xf584e2);})[_0xa1c9('0x26')](function(_0x57ed69){_0x603beb['rows']=_0x57ed69;return _0x603beb;})[_0xa1c9('0x26')](respondWithFilteredResult(_0x35cea,_0xf584e2))['catch'](handleError(_0x35cea,null));};exports[_0xa1c9('0x42')]=function(_0x525833,_0x550872){var _0x45a528={'raw':![],'where':{'id':_0x525833[_0xa1c9('0x43')]['id']}},_0x418e95={};_0x418e95[_0xa1c9('0x31')]=_['keys'](db[_0xa1c9('0x2d')]['rawAttributes']);_0x418e95[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x525833[_0xa1c9('0x32')]);_0x418e95[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0x418e95[_0xa1c9('0x31')],_0x418e95[_0xa1c9('0x32')]);_0x45a528[_0xa1c9('0x36')]=_[_0xa1c9('0x35')](_0x418e95[_0xa1c9('0x31')],qs['fields'](_0x525833[_0xa1c9('0x32')][_0xa1c9('0x37')]));_0x45a528[_0xa1c9('0x36')]=_0x45a528[_0xa1c9('0x36')][_0xa1c9('0x38')]?_0x45a528[_0xa1c9('0x36')]:_0x418e95[_0xa1c9('0x31')];if(_0x525833[_0xa1c9('0x32')][_0xa1c9('0x41')]){_0x45a528['include']=[{'all':!![]}];}_0x45a528=_[_0xa1c9('0x3f')]({},_0x45a528,_0x525833[_0xa1c9('0x40')]);return db['SalesforceConfiguration'][_0xa1c9('0x44')](_0x45a528)[_0xa1c9('0x26')](handleEntityNotFound(_0x550872,null))['then'](respondWithResult(_0x550872,null))[_0xa1c9('0x45')](handleError(_0x550872,null));};exports[_0xa1c9('0x46')]=function(_0x468894,_0x222d0c){return db['SalesforceConfiguration'][_0xa1c9('0x46')](_0x468894['body'],{})[_0xa1c9('0x26')](respondWithResult(_0x222d0c,0xc9))['catch'](handleError(_0x222d0c,null));};exports[_0xa1c9('0x47')]=function(_0x1c5317,_0x6d28a1){if(_0x1c5317[_0xa1c9('0x48')]['id']){delete _0x1c5317[_0xa1c9('0x48')]['id'];}return db[_0xa1c9('0x2d')][_0xa1c9('0x44')]({'where':{'id':_0x1c5317[_0xa1c9('0x43')]['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0x6d28a1,null))[_0xa1c9('0x26')](saveUpdates(_0x1c5317[_0xa1c9('0x48')],null))[_0xa1c9('0x26')](respondWithResult(_0x6d28a1,null))[_0xa1c9('0x45')](handleError(_0x6d28a1,null));};exports[_0xa1c9('0x49')]=function(_0x2774d3,_0x4e8cd2){return db[_0xa1c9('0x2d')][_0xa1c9('0x44')]({'where':{'id':_0x2774d3[_0xa1c9('0x43')]['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0x4e8cd2,null))['then'](removeEntity(_0x4e8cd2,null))[_0xa1c9('0x45')](handleError(_0x4e8cd2,null));};exports[_0xa1c9('0x4a')]=function(_0x2cfba4,_0xef1290,_0x4c37dc){var _0x2aa6a1={};var _0x1aadc5={};var _0x143471;var _0xe6ce7c;return db[_0xa1c9('0x2d')][_0xa1c9('0x4b')]({'where':{'id':_0x2cfba4['params']['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0xef1290,null))[_0xa1c9('0x26')](function(_0x140345){if(_0x140345){_0x143471=_0x140345;_0x1aadc5[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x4c')]['rawAttributes']);_0x1aadc5['query']=_[_0xa1c9('0x33')](_0x2cfba4['query']);_0x1aadc5['filters']=_[_0xa1c9('0x35')](_0x1aadc5[_0xa1c9('0x31')],_0x1aadc5[_0xa1c9('0x32')]);_0x2aa6a1['attributes']=_['intersection'](_0x1aadc5[_0xa1c9('0x31')],qs['fields'](_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x37')]));_0x2aa6a1[_0xa1c9('0x36')]=_0x2aa6a1['attributes'][_0xa1c9('0x38')]?_0x2aa6a1[_0xa1c9('0x36')]:_0x1aadc5[_0xa1c9('0x31')];_0x2aa6a1[_0xa1c9('0x3a')]=qs[_0xa1c9('0x3b')](_0x2cfba4['query'][_0xa1c9('0x3b')]);_0x2aa6a1['where']=qs[_0xa1c9('0x34')](_['pick'](_0x2cfba4[_0xa1c9('0x32')],_0x1aadc5[_0xa1c9('0x34')]));if(_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x3d')]){_0x2aa6a1['where']=_[_0xa1c9('0x3f')](_0x2aa6a1['where'],{'$or':_[_0xa1c9('0x2c')](_0x2aa6a1[_0xa1c9('0x36')],function(_0x904c05){var _0x14ee8b={};_0x14ee8b[_0x904c05]={'$like':'%'+_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x3d')]+'%'};return _0x14ee8b;})});}_0x2aa6a1=_[_0xa1c9('0x3f')]({},_0x2aa6a1,_0x2cfba4[_0xa1c9('0x40')]);return _0x143471[_0xa1c9('0x4a')](_0x2aa6a1);}})[_0xa1c9('0x26')](function(_0x1dab1e){if(_0x1dab1e){_0xe6ce7c=_0x1dab1e[_0xa1c9('0x38')];if(!_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x39')]('nolimit')){_0x2aa6a1['limit']=qs[_0xa1c9('0x1f')](_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x2aa6a1[_0xa1c9('0x1e')]=qs[_0xa1c9('0x1e')](_0x2cfba4[_0xa1c9('0x32')][_0xa1c9('0x1e')]);}return _0x143471[_0xa1c9('0x4a')](_0x2aa6a1);}})['then'](function(_0x1288e5){if(_0x1288e5){return _0x1288e5?{'count':_0xe6ce7c,'rows':_0x1288e5}:null;}})[_0xa1c9('0x26')](respondWithResult(_0xef1290,null))[_0xa1c9('0x45')](handleError(_0xef1290,null));};exports[_0xa1c9('0x4d')]=function(_0x53e90b,_0x2afeef,_0x423a34){var _0x54f104={};var _0x179de9={};var _0x13f428;var _0x25bc30;return db['SalesforceConfiguration'][_0xa1c9('0x4b')]({'where':{'id':_0x53e90b['params']['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0x2afeef,null))[_0xa1c9('0x26')](function(_0x2f65c7){if(_0x2f65c7){_0x13f428=_0x2f65c7;_0x179de9[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x4c')]['rawAttributes']);_0x179de9[_0xa1c9('0x32')]=_['keys'](_0x53e90b[_0xa1c9('0x32')]);_0x179de9['filters']=_[_0xa1c9('0x35')](_0x179de9[_0xa1c9('0x31')],_0x179de9[_0xa1c9('0x32')]);_0x54f104[_0xa1c9('0x36')]=_[_0xa1c9('0x35')](_0x179de9[_0xa1c9('0x31')],qs[_0xa1c9('0x37')](_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x37')]));_0x54f104['attributes']=_0x54f104['attributes']['length']?_0x54f104[_0xa1c9('0x36')]:_0x179de9[_0xa1c9('0x31')];_0x54f104[_0xa1c9('0x3a')]=qs[_0xa1c9('0x3b')](_0x53e90b[_0xa1c9('0x32')]['sort']);_0x54f104['where']=qs[_0xa1c9('0x34')](_[_0xa1c9('0x3c')](_0x53e90b[_0xa1c9('0x32')],_0x179de9[_0xa1c9('0x34')]));if(_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x3d')]){_0x54f104[_0xa1c9('0x3e')]=_[_0xa1c9('0x3f')](_0x54f104['where'],{'$or':_['map'](_0x54f104['attributes'],function(_0x3b843e){var _0x27b5f6={};_0x27b5f6[_0x3b843e]={'$like':'%'+_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x3d')]+'%'};return _0x27b5f6;})});}_0x54f104=_[_0xa1c9('0x3f')]({},_0x54f104,_0x53e90b[_0xa1c9('0x40')]);return _0x13f428[_0xa1c9('0x4d')](_0x54f104);}})[_0xa1c9('0x26')](function(_0x2550bb){if(_0x2550bb){_0x25bc30=_0x2550bb[_0xa1c9('0x38')];if(!_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x39')](_0xa1c9('0x4e'))){_0x54f104[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x54f104[_0xa1c9('0x1e')]=qs['offset'](_0x53e90b[_0xa1c9('0x32')][_0xa1c9('0x1e')]);}return _0x13f428[_0xa1c9('0x4d')](_0x54f104);}})['then'](function(_0x4bfb9a){if(_0x4bfb9a){return _0x4bfb9a?{'count':_0x25bc30,'rows':_0x4bfb9a}:null;}})[_0xa1c9('0x26')](respondWithResult(_0x2afeef,null))[_0xa1c9('0x45')](handleError(_0x2afeef,null));};exports[_0xa1c9('0x4f')]=function(_0x470ecf,_0xbef82,_0x3d9ed4){var _0x21099a={};var _0x54dda1={};var _0x1b0473;var _0x16e745;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x470ecf[_0xa1c9('0x43')]['id']}})[_0xa1c9('0x26')](handleEntityNotFound(_0xbef82,null))[_0xa1c9('0x26')](function(_0x4a6322){if(_0x4a6322){_0x1b0473=_0x4a6322;_0x54dda1[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x4c')]['rawAttributes']);_0x54dda1['query']=_[_0xa1c9('0x33')](_0x470ecf[_0xa1c9('0x32')]);_0x54dda1['filters']=_['intersection'](_0x54dda1['model'],_0x54dda1[_0xa1c9('0x32')]);_0x21099a['attributes']=_[_0xa1c9('0x35')](_0x54dda1[_0xa1c9('0x31')],qs['fields'](_0x470ecf[_0xa1c9('0x32')][_0xa1c9('0x37')]));_0x21099a['attributes']=_0x21099a[_0xa1c9('0x36')][_0xa1c9('0x38')]?_0x21099a[_0xa1c9('0x36')]:_0x54dda1[_0xa1c9('0x31')];_0x21099a[_0xa1c9('0x3a')]=qs[_0xa1c9('0x3b')](_0x470ecf[_0xa1c9('0x32')][_0xa1c9('0x3b')]);_0x21099a['where']=qs['filters'](_[_0xa1c9('0x3c')](_0x470ecf['query'],_0x54dda1[_0xa1c9('0x34')]));if(_0x470ecf[_0xa1c9('0x32')][_0xa1c9('0x3d')]){_0x21099a[_0xa1c9('0x3e')]=_[_0xa1c9('0x3f')](_0x21099a['where'],{'$or':_['map'](_0x21099a[_0xa1c9('0x36')],function(_0x3bd0a6){var _0x505fd1={};_0x505fd1[_0x3bd0a6]={'$like':'%'+_0x470ecf[_0xa1c9('0x32')][_0xa1c9('0x3d')]+'%'};return _0x505fd1;})});}_0x21099a=_[_0xa1c9('0x3f')]({},_0x21099a,_0x470ecf[_0xa1c9('0x40')]);return _0x1b0473[_0xa1c9('0x4f')](_0x21099a);}})['then'](function(_0x4ce3f2){if(_0x4ce3f2){_0x16e745=_0x4ce3f2[_0xa1c9('0x38')];if(!_0x470ecf[_0xa1c9('0x32')][_0xa1c9('0x39')](_0xa1c9('0x4e'))){_0x21099a[_0xa1c9('0x1f')]=qs['limit'](_0x470ecf[_0xa1c9('0x32')]['limit']);_0x21099a[_0xa1c9('0x1e')]=qs[_0xa1c9('0x1e')](_0x470ecf['query']['offset']);}return _0x1b0473[_0xa1c9('0x4f')](_0x21099a);}})[_0xa1c9('0x26')](function(_0x330052){if(_0x330052){return _0x330052?{'count':_0x16e745,'rows':_0x330052}:null;}})[_0xa1c9('0x26')](respondWithResult(_0xbef82,null))[_0xa1c9('0x45')](handleError(_0xbef82,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 2654cbc..f64257a 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 _0x156b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x4648c6,_0x2e252b){var _0x3b88a7=function(_0x152716){while(--_0x152716){_0x4648c6['push'](_0x4648c6['shift']());}};_0x3b88a7(++_0x2e252b);}(_0x156b,0x143));var _0xb156=function(_0x455555,_0x2147fd){_0x455555=_0x455555-0x0;var _0x3cb183=_0x156b[_0x455555];return _0x3cb183;};'use strict';var _=require(_0xb156('0x0'));var util=require(_0xb156('0x1'));var logger=require('../../config/logger')(_0xb156('0x2'));var moment=require(_0xb156('0x3'));var BPromise=require(_0xb156('0x4'));var rp=require(_0xb156('0x5'));var fs=require('fs');var path=require(_0xb156('0x6'));var rimraf=require(_0xb156('0x7'));var config=require(_0xb156('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb156('0x9')]=function(_0xe4bd53,_0x522ec7){return _0xe4bd53[_0xb156('0xa')](_0xb156('0xb'),attributes,{'tableName':_0xb156('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf42e=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x9a663e,_0x224586){var _0x5a8817=function(_0x530d73){while(--_0x530d73){_0x9a663e['push'](_0x9a663e['shift']());}};_0x5a8817(++_0x224586);}(_0xf42e,0xe9));var _0xef42=function(_0x5848fe,_0x17f8b2){_0x5848fe=_0x5848fe-0x0;var _0x459c4a=_0xf42e[_0x5848fe];return _0x459c4a;};'use strict';var _=require(_0xef42('0x0'));var util=require(_0xef42('0x1'));var logger=require('../../config/logger')(_0xef42('0x2'));var moment=require(_0xef42('0x3'));var BPromise=require(_0xef42('0x4'));var rp=require(_0xef42('0x5'));var fs=require('fs');var path=require(_0xef42('0x6'));var rimraf=require(_0xef42('0x7'));var config=require(_0xef42('0x8'));var attributes=require(_0xef42('0x9'));module['exports']=function(_0x59101c,_0x45dae9){return _0x59101c[_0xef42('0xa')](_0xef42('0xb'),attributes,{'tableName':'int_salesforce_configurations','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 e8e6129..6a5ded3 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 _0x38b8=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x48d9c2,_0x476e02){var _0x415b9f=function(_0x41d962){while(--_0x41d962){_0x48d9c2['push'](_0x48d9c2['shift']());}};_0x415b9f(++_0x476e02);}(_0x38b8,0xe9));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require(_0x838b('0x1'));var moment=require(_0x838b('0x2'));var BPromise=require(_0x838b('0x3'));var rs=require(_0x838b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x838b('0x5'));var logger=require(_0x838b('0x6'))(_0x838b('0x7'));var config=require(_0x838b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x838b('0x9')][_0x838b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ea17e,_0xab3082,_0x534fbc){return new BPromise(function(_0xe209c3,_0x34df15){return client['request'](_0x1ea17e,_0x534fbc)['then'](function(_0x2e20d0){logger[_0x838b('0xb')](_0x838b('0xc'),_0xab3082,_0x838b('0xd'));logger[_0x838b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xab3082,_0x838b('0xd'),JSON[_0x838b('0xf')](_0x2e20d0));if(_0x2e20d0['error']){if(_0x2e20d0[_0x838b('0x10')][_0x838b('0x11')]===0x1f4){logger['error'](_0x838b('0xc'),_0xab3082,_0x2e20d0[_0x838b('0x10')][_0x838b('0x12')]);return _0x34df15(_0x2e20d0[_0x838b('0x10')]['message']);}logger[_0x838b('0x10')](_0x838b('0xc'),_0xab3082,_0x2e20d0[_0x838b('0x10')][_0x838b('0x12')]);return _0xe209c3(_0x2e20d0['error'][_0x838b('0x12')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0xab3082,_0x838b('0xd'));_0xe209c3(_0x2e20d0[_0x838b('0x13')][_0x838b('0x12')]);}})[_0x838b('0x14')](function(_0x34f979){logger[_0x838b('0x10')](_0x838b('0xc'),_0xab3082,_0x34f979);_0x34df15(_0x34f979);});});} \ No newline at end of file +var _0x58fb=['../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x462774,_0x4953d2){var _0x280503=function(_0x3fde13){while(--_0x3fde13){_0x462774['push'](_0x462774['shift']());}};_0x280503(++_0x4953d2);}(_0x58fb,0x17e));var _0xb58f=function(_0x1f0dde,_0x3956b0){_0x1f0dde=_0x1f0dde-0x0;var _0x42640c=_0x58fb[_0x1f0dde];return _0x42640c;};'use strict';var _=require(_0xb58f('0x0'));var util=require(_0xb58f('0x1'));var moment=require(_0xb58f('0x2'));var BPromise=require(_0xb58f('0x3'));var rs=require(_0xb58f('0x4'));var fs=require('fs');var Redis=require(_0xb58f('0x5'));var db=require(_0xb58f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb58f('0x7'))(_0xb58f('0x8'));var config=require(_0xb58f('0x9'));var jayson=require(_0xb58f('0xa'));var client=jayson['client'][_0xb58f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6e09,_0x3f843a,_0x58dfc2){return new BPromise(function(_0x1cb949,_0x49ddbb){return client[_0xb58f('0xc')](_0x5d6e09,_0x58dfc2)[_0xb58f('0xd')](function(_0x38bc6c){logger[_0xb58f('0xe')](_0xb58f('0xf'),_0x3f843a,_0xb58f('0x10'));logger[_0xb58f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3f843a,_0xb58f('0x10'),JSON[_0xb58f('0x12')](_0x38bc6c));if(_0x38bc6c[_0xb58f('0x13')]){if(_0x38bc6c[_0xb58f('0x13')][_0xb58f('0x14')]===0x1f4){logger['error'](_0xb58f('0xf'),_0x3f843a,_0x38bc6c[_0xb58f('0x13')][_0xb58f('0x15')]);return _0x49ddbb(_0x38bc6c['error'][_0xb58f('0x15')]);}logger[_0xb58f('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f843a,_0x38bc6c[_0xb58f('0x13')]['message']);return _0x1cb949(_0x38bc6c[_0xb58f('0x13')][_0xb58f('0x15')]);}else{logger[_0xb58f('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f843a,_0xb58f('0x10'));_0x1cb949(_0x38bc6c['result']['message']);}})[_0xb58f('0x16')](function(_0xe3d550){logger[_0xb58f('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f843a,_0xe3d550);_0x49ddbb(_0xe3d550);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 6cdd634..b32a4f4 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 _0x9b8c=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5160b6,_0x3083e0){var _0x170c39=function(_0x1dae6e){while(--_0x1dae6e){_0x5160b6['push'](_0x5160b6['shift']());}};_0x170c39(++_0x3083e0);}(_0x9b8c,0x12c));var _0xc9b8=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x9b8c[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require('multer');var util=require(_0xc9b8('0x0'));var path=require(_0xc9b8('0x1'));var timeout=require(_0xc9b8('0x2'));var express=require(_0xc9b8('0x3'));var router=express[_0xc9b8('0x4')]();var fs_extra=require(_0xc9b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc9b8('0x6'));var config=require('../../config/environment');var controller=require(_0xc9b8('0x7'));router[_0xc9b8('0x8')]('/',auth[_0xc9b8('0x9')](),controller[_0xc9b8('0xa')]);router[_0xc9b8('0x8')](_0xc9b8('0xb'),auth[_0xc9b8('0x9')](),controller[_0xc9b8('0xc')]);router[_0xc9b8('0xd')]('/',auth['isAuthenticated'](),controller[_0xc9b8('0xe')]);router[_0xc9b8('0xf')](_0xc9b8('0xb'),auth[_0xc9b8('0x9')](),controller[_0xc9b8('0x10')]);router[_0xc9b8('0x11')](_0xc9b8('0xb'),auth[_0xc9b8('0x9')](),controller[_0xc9b8('0x12')]);module[_0xc9b8('0x13')]=router; \ No newline at end of file +var _0x280d=['util','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','delete','destroy','multer'];(function(_0x57bf5a,_0x41979d){var _0x4ce761=function(_0x5994a4){while(--_0x5994a4){_0x57bf5a['push'](_0x57bf5a['shift']());}};_0x4ce761(++_0x41979d);}(_0x280d,0x11c));var _0xd280=function(_0x8be722,_0x33ad5c){_0x8be722=_0x8be722-0x0;var _0x28de61=_0x280d[_0x8be722];return _0x28de61;};'use strict';var multer=require(_0xd280('0x0'));var util=require(_0xd280('0x1'));var path=require('path');var timeout=require(_0xd280('0x2'));var express=require(_0xd280('0x3'));var router=express[_0xd280('0x4')]();var fs_extra=require(_0xd280('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd280('0x6'));var controller=require('./intSalesforceField.controller');router[_0xd280('0x7')]('/',auth['isAuthenticated'](),controller[_0xd280('0x8')]);router[_0xd280('0x7')](_0xd280('0x9'),auth[_0xd280('0xa')](),controller[_0xd280('0xb')]);router[_0xd280('0xc')]('/',auth[_0xd280('0xa')](),controller['create']);router['put'](_0xd280('0x9'),auth[_0xd280('0xa')](),controller['update']);router[_0xd280('0xd')](_0xd280('0x9'),auth['isAuthenticated'](),controller[_0xd280('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index bcef5a2..76af18e 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 _0x91f2=['STRING','customVariable','sequelize','exports','ENUM','variable','keyValue','picklist','string'];(function(_0x55306b,_0x39d4cf){var _0x4cb9c3=function(_0x245b17){while(--_0x245b17){_0x55306b['push'](_0x55306b['shift']());}};_0x4cb9c3(++_0x39d4cf);}(_0x91f2,0x185));var _0x291f=function(_0x35730e,_0x3922d1){_0x35730e=_0x35730e-0x0;var _0x379e0e=_0x91f2[_0x35730e];return _0x379e0e;};'use strict';var Sequelize=require(_0x291f('0x0'));module[_0x291f('0x1')]={'type':{'type':Sequelize[_0x291f('0x2')]('string',_0x291f('0x3'),'customVariable',_0x291f('0x4'),_0x291f('0x5')),'defaultValue':_0x291f('0x6')},'content':{'type':Sequelize[_0x291f('0x7')]},'key':{'type':Sequelize[_0x291f('0x7')]},'keyType':{'type':Sequelize[_0x291f('0x2')](_0x291f('0x6'),'variable',_0x291f('0x8'))},'keyContent':{'type':Sequelize[_0x291f('0x7')]},'idField':{'type':Sequelize[_0x291f('0x7')]},'variableName':{'type':Sequelize[_0x291f('0x7')]}}; \ No newline at end of file +var _0x708b=['string','variable','keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM'];(function(_0x592f11,_0x550cec){var _0x15ee32=function(_0x314726){while(--_0x314726){_0x592f11['push'](_0x592f11['shift']());}};_0x15ee32(++_0x550cec);}(_0x708b,0x189));var _0xb708=function(_0x12655e,_0x1e8c2d){_0x12655e=_0x12655e-0x0;var _0x3feb21=_0x708b[_0x12655e];return _0x3feb21;};'use strict';var Sequelize=require(_0xb708('0x0'));module[_0xb708('0x1')]={'type':{'type':Sequelize[_0xb708('0x2')](_0xb708('0x3'),_0xb708('0x4'),'customVariable',_0xb708('0x5'),_0xb708('0x6')),'defaultValue':_0xb708('0x3')},'content':{'type':Sequelize[_0xb708('0x7')]},'key':{'type':Sequelize[_0xb708('0x7')]},'keyType':{'type':Sequelize[_0xb708('0x2')](_0xb708('0x3'),_0xb708('0x4'),_0xb708('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xb708('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6477fcb..63d8654 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 _0x84ad=['destroy','name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','SalesforceField','findAll','catch','show','params','find','create','body','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','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then'];(function(_0x269d26,_0x9bc076){var _0x90ef36=function(_0x1ae6c0){while(--_0x1ae6c0){_0x269d26['push'](_0x269d26['shift']());}};_0x90ef36(++_0x9bc076);}(_0x84ad,0xb6));var _0xd84a=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0x84ad[_0x209bbf];return _0x592d4b;};'use strict';var emlformat=require(_0xd84a('0x0'));var rimraf=require(_0xd84a('0x1'));var zipdir=require(_0xd84a('0x2'));var jsonpatch=require(_0xd84a('0x3'));var rp=require('request-promise');var moment=require(_0xd84a('0x4'));var BPromise=require(_0xd84a('0x5'));var Mustache=require(_0xd84a('0x6'));var util=require(_0xd84a('0x7'));var path=require(_0xd84a('0x8'));var sox=require(_0xd84a('0x9'));var csv=require(_0xd84a('0xa'));var ejs=require(_0xd84a('0xb'));var fs=require('fs');var fs_extra=require(_0xd84a('0xc'));var _=require('lodash');var squel=require(_0xd84a('0xd'));var crypto=require(_0xd84a('0xe'));var jsforce=require(_0xd84a('0xf'));var deskjs=require(_0xd84a('0x10'));var toCsv=require(_0xd84a('0xa'));var querystring=require(_0xd84a('0x11'));var Papa=require(_0xd84a('0x12'));var Redis=require('ioredis');var authService=require(_0xd84a('0x13'));var qs=require(_0xd84a('0x14'));var as=require(_0xd84a('0x15'));var hardwareService=require(_0xd84a('0x16'));var logger=require(_0xd84a('0x17'))(_0xd84a('0x18'));var utils=require(_0xd84a('0x19'));var config=require(_0xd84a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1890b3,_0x57d64d){_0x57d64d=_0x57d64d||0xcc;return function(_0x3e2581){if(_0x3e2581){return _0x1890b3[_0xd84a('0x1b')](_0x57d64d);}return _0x1890b3[_0xd84a('0x1c')](_0x57d64d)[_0xd84a('0x1d')]();};}function respondWithResult(_0xc2b207,_0x359a26){_0x359a26=_0x359a26||0xc8;return function(_0x10c953){if(_0x10c953){return _0xc2b207[_0xd84a('0x1c')](_0x359a26)[_0xd84a('0x1e')](_0x10c953);}};}function respondWithFilteredResult(_0x532df9,_0x16fcdd){return function(_0x336c46){if(_0x336c46){var _0xb76a=typeof _0x16fcdd[_0xd84a('0x1f')]===_0xd84a('0x20')&&typeof _0x16fcdd['limit']==='undefined';var _0x4d4bac=_0x336c46[_0xd84a('0x21')];var _0x5da17d=_0xb76a?0x0:_0x16fcdd[_0xd84a('0x1f')];var _0x47f641=_0xb76a?_0x336c46[_0xd84a('0x21')]:_0x16fcdd[_0xd84a('0x1f')]+_0x16fcdd[_0xd84a('0x22')];var _0xb2c5ba;if(_0x47f641>=_0x4d4bac){_0x47f641=_0x4d4bac;_0xb2c5ba=0xc8;}else{_0xb2c5ba=0xce;}_0x532df9['status'](_0xb2c5ba);return _0x532df9['set'](_0xd84a('0x23'),_0x5da17d+'-'+_0x47f641+'/'+_0x4d4bac)['json'](_0x336c46);}return null;};}function patchUpdates(_0x1073e7){return function(_0x191748){try{jsonpatch[_0xd84a('0x24')](_0x191748,_0x1073e7,!![]);}catch(_0x485898){return BPromise['reject'](_0x485898);}return _0x191748[_0xd84a('0x25')]();};}function saveUpdates(_0x2adf04,_0x2448e7){return function(_0x39a47a){if(_0x39a47a){return _0x39a47a[_0xd84a('0x26')](_0x2adf04)[_0xd84a('0x27')](function(_0x10d7c2){return _0x10d7c2;});}return null;};}function removeEntity(_0x19b5a2,_0xe969b4){return function(_0x5d0222){if(_0x5d0222){return _0x5d0222[_0xd84a('0x28')]()[_0xd84a('0x27')](function(){_0x19b5a2[_0xd84a('0x1c')](0xcc)[_0xd84a('0x1d')]();});}};}function handleEntityNotFound(_0xf30328,_0x4ad0a5){return function(_0x5c2734){if(!_0x5c2734){_0xf30328['sendStatus'](0x194);}return _0x5c2734;};}function handleError(_0x318f41,_0x19a3ed){_0x19a3ed=_0x19a3ed||0x1f4;return function(_0x4d46b2){logger['error'](_0x4d46b2['stack']);if(_0x4d46b2['name']){delete _0x4d46b2[_0xd84a('0x29')];}_0x318f41[_0xd84a('0x1c')](_0x19a3ed)[_0xd84a('0x2a')](_0x4d46b2);};}exports[_0xd84a('0x2b')]=function(_0xd32229,_0x66aaef){var _0x423566={},_0x19a575={},_0x1cb4b3={'count':0x0,'rows':[]};var _0x4a3da6=_[_0xd84a('0x2c')](db['SalesforceField'][_0xd84a('0x2d')],function(_0x323b23){return{'name':_0x323b23['fieldName'],'type':_0x323b23['type'][_0xd84a('0x2e')]};});_0x19a575['model']=_[_0xd84a('0x2c')](_0x4a3da6,_0xd84a('0x29'));_0x19a575[_0xd84a('0x2f')]=_[_0xd84a('0x30')](_0xd32229[_0xd84a('0x2f')]);_0x19a575[_0xd84a('0x31')]=_['intersection'](_0x19a575[_0xd84a('0x32')],_0x19a575['query']);_0x423566[_0xd84a('0x33')]=_[_0xd84a('0x34')](_0x19a575[_0xd84a('0x32')],qs[_0xd84a('0x35')](_0xd32229[_0xd84a('0x2f')][_0xd84a('0x35')]));_0x423566[_0xd84a('0x33')]=_0x423566[_0xd84a('0x33')]['length']?_0x423566[_0xd84a('0x33')]:_0x19a575['model'];if(!_0xd32229['query'][_0xd84a('0x36')]('nolimit')){_0x423566[_0xd84a('0x22')]=qs['limit'](_0xd32229[_0xd84a('0x2f')][_0xd84a('0x22')]);_0x423566[_0xd84a('0x1f')]=qs[_0xd84a('0x1f')](_0xd32229['query'][_0xd84a('0x1f')]);}_0x423566[_0xd84a('0x37')]=qs[_0xd84a('0x38')](_0xd32229[_0xd84a('0x2f')][_0xd84a('0x38')]);_0x423566[_0xd84a('0x39')]=qs[_0xd84a('0x31')](_[_0xd84a('0x3a')](_0xd32229[_0xd84a('0x2f')],_0x19a575[_0xd84a('0x31')]),_0x4a3da6);if(_0xd32229['query'][_0xd84a('0x3b')]){_0x423566[_0xd84a('0x39')]=_[_0xd84a('0x3c')](_0x423566['where'],{'$or':_[_0xd84a('0x2c')](_0x4a3da6,function(_0x2e7821){if(_0x2e7821[_0xd84a('0x3d')]!==_0xd84a('0x3e')){var _0x21509a={};_0x21509a[_0x2e7821[_0xd84a('0x29')]]={'$like':'%'+_0xd32229[_0xd84a('0x2f')][_0xd84a('0x3b')]+'%'};return _0x21509a;}})});}_0x423566=_[_0xd84a('0x3c')]({},_0x423566,_0xd32229[_0xd84a('0x3f')]);var _0x3601d0={'where':_0x423566[_0xd84a('0x39')]};return db['SalesforceField'][_0xd84a('0x21')](_0x3601d0)['then'](function(_0x50b23f){_0x1cb4b3['count']=_0x50b23f;if(_0xd32229[_0xd84a('0x2f')][_0xd84a('0x40')]){_0x423566[_0xd84a('0x41')]=[{'all':!![]}];}return db[_0xd84a('0x42')][_0xd84a('0x43')](_0x423566);})[_0xd84a('0x27')](function(_0x29a70d){_0x1cb4b3['rows']=_0x29a70d;return _0x1cb4b3;})[_0xd84a('0x27')](respondWithFilteredResult(_0x66aaef,_0x423566))[_0xd84a('0x44')](handleError(_0x66aaef,null));};exports[_0xd84a('0x45')]=function(_0x24cd7e,_0x1306b1){var _0x160dda={'raw':!![],'where':{'id':_0x24cd7e[_0xd84a('0x46')]['id']}},_0x520f1f={};_0x520f1f['model']=_[_0xd84a('0x30')](db['SalesforceField']['rawAttributes']);_0x520f1f[_0xd84a('0x2f')]=_[_0xd84a('0x30')](_0x24cd7e[_0xd84a('0x2f')]);_0x520f1f[_0xd84a('0x31')]=_[_0xd84a('0x34')](_0x520f1f[_0xd84a('0x32')],_0x520f1f[_0xd84a('0x2f')]);_0x160dda[_0xd84a('0x33')]=_[_0xd84a('0x34')](_0x520f1f[_0xd84a('0x32')],qs[_0xd84a('0x35')](_0x24cd7e['query'][_0xd84a('0x35')]));_0x160dda[_0xd84a('0x33')]=_0x160dda['attributes']['length']?_0x160dda[_0xd84a('0x33')]:_0x520f1f['model'];if(_0x24cd7e['query'][_0xd84a('0x40')]){_0x160dda[_0xd84a('0x41')]=[{'all':!![]}];}_0x160dda=_[_0xd84a('0x3c')]({},_0x160dda,_0x24cd7e[_0xd84a('0x3f')]);return db[_0xd84a('0x42')][_0xd84a('0x47')](_0x160dda)[_0xd84a('0x27')](handleEntityNotFound(_0x1306b1,null))[_0xd84a('0x27')](respondWithResult(_0x1306b1,null))[_0xd84a('0x44')](handleError(_0x1306b1,null));};exports[_0xd84a('0x48')]=function(_0x2f93a9,_0x2e94a1){return db[_0xd84a('0x42')][_0xd84a('0x48')](_0x2f93a9[_0xd84a('0x49')],{})[_0xd84a('0x27')](respondWithResult(_0x2e94a1,0xc9))[_0xd84a('0x44')](handleError(_0x2e94a1,null));};exports[_0xd84a('0x26')]=function(_0xa75f37,_0x53e134){if(_0xa75f37[_0xd84a('0x49')]['id']){delete _0xa75f37[_0xd84a('0x49')]['id'];}return db[_0xd84a('0x42')][_0xd84a('0x47')]({'where':{'id':_0xa75f37['params']['id']}})['then'](handleEntityNotFound(_0x53e134,null))[_0xd84a('0x27')](saveUpdates(_0xa75f37[_0xd84a('0x49')],null))[_0xd84a('0x27')](respondWithResult(_0x53e134,null))[_0xd84a('0x44')](handleError(_0x53e134,null));};exports[_0xd84a('0x28')]=function(_0x1c7ccd,_0x4eccbc){return db['SalesforceField'][_0xd84a('0x47')]({'where':{'id':_0x1c7ccd[_0xd84a('0x46')]['id']}})[_0xd84a('0x27')](handleEntityNotFound(_0x4eccbc,null))[_0xd84a('0x27')](removeEntity(_0x4eccbc,null))[_0xd84a('0x44')](handleError(_0x4eccbc,null));}; \ No newline at end of file +var _0xf2e4=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','count','include','catch','show','params','includeAll','find','create','body','rimraf','fast-json-patch','request-promise','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/license/util','../../mysqldb','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SalesforceField','rawAttributes','fieldName','type','model','map'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xf2e4,0x140));var _0x4f2e=function(_0x13e111,_0x304aaa){_0x13e111=_0x13e111-0x0;var _0x602ee6=_0xf2e4[_0x13e111];return _0x602ee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f2e('0x1'));var rp=require(_0x4f2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f2e('0x3'));var util=require(_0x4f2e('0x4'));var path=require(_0x4f2e('0x5'));var sox=require(_0x4f2e('0x6'));var csv=require(_0x4f2e('0x7'));var ejs=require(_0x4f2e('0x8'));var fs=require('fs');var fs_extra=require(_0x4f2e('0x9'));var _=require(_0x4f2e('0xa'));var squel=require(_0x4f2e('0xb'));var crypto=require(_0x4f2e('0xc'));var jsforce=require(_0x4f2e('0xd'));var deskjs=require(_0x4f2e('0xe'));var toCsv=require(_0x4f2e('0x7'));var querystring=require('querystring');var Papa=require(_0x4f2e('0xf'));var Redis=require(_0x4f2e('0x10'));var authService=require(_0x4f2e('0x11'));var qs=require(_0x4f2e('0x12'));var as=require(_0x4f2e('0x13'));var hardwareService=require(_0x4f2e('0x14'));var logger=require(_0x4f2e('0x15'))(_0x4f2e('0x16'));var utils=require(_0x4f2e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4f2e('0x18'));var db=require(_0x4f2e('0x19'))['db'];function respondWithStatusCode(_0x150515,_0x3263d5){_0x3263d5=_0x3263d5||0xcc;return function(_0x359986){if(_0x359986){return _0x150515['sendStatus'](_0x3263d5);}return _0x150515['status'](_0x3263d5)[_0x4f2e('0x1a')]();};}function respondWithResult(_0x4c6a04,_0x370eb7){_0x370eb7=_0x370eb7||0xc8;return function(_0x8cd13a){if(_0x8cd13a){return _0x4c6a04[_0x4f2e('0x1b')](_0x370eb7)[_0x4f2e('0x1c')](_0x8cd13a);}};}function respondWithFilteredResult(_0x9d4aa4,_0x4d87f6){return function(_0x4385a4){if(_0x4385a4){var _0x58c0c1=typeof _0x4d87f6['offset']===_0x4f2e('0x1d')&&typeof _0x4d87f6[_0x4f2e('0x1e')]===_0x4f2e('0x1d');var _0x1765a6=_0x4385a4['count'];var _0x43b841=_0x58c0c1?0x0:_0x4d87f6[_0x4f2e('0x1f')];var _0x2afce4=_0x58c0c1?_0x4385a4['count']:_0x4d87f6['offset']+_0x4d87f6[_0x4f2e('0x1e')];var _0x31de20;if(_0x2afce4>=_0x1765a6){_0x2afce4=_0x1765a6;_0x31de20=0xc8;}else{_0x31de20=0xce;}_0x9d4aa4[_0x4f2e('0x1b')](_0x31de20);return _0x9d4aa4[_0x4f2e('0x20')](_0x4f2e('0x21'),_0x43b841+'-'+_0x2afce4+'/'+_0x1765a6)[_0x4f2e('0x1c')](_0x4385a4);}return null;};}function patchUpdates(_0x139fc7){return function(_0x44922a){try{jsonpatch[_0x4f2e('0x22')](_0x44922a,_0x139fc7,!![]);}catch(_0x23e567){return BPromise[_0x4f2e('0x23')](_0x23e567);}return _0x44922a[_0x4f2e('0x24')]();};}function saveUpdates(_0x346b8c,_0x24ed6c){return function(_0x7219d){if(_0x7219d){return _0x7219d[_0x4f2e('0x25')](_0x346b8c)[_0x4f2e('0x26')](function(_0x54ebe8){return _0x54ebe8;});}return null;};}function removeEntity(_0x2824c4,_0x2ed171){return function(_0x5a5480){if(_0x5a5480){return _0x5a5480[_0x4f2e('0x27')]()[_0x4f2e('0x26')](function(){_0x2824c4[_0x4f2e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2abd94,_0x3a45e3){return function(_0x3f8f21){if(!_0x3f8f21){_0x2abd94['sendStatus'](0x194);}return _0x3f8f21;};}function handleError(_0xece845,_0x116dcf){_0x116dcf=_0x116dcf||0x1f4;return function(_0x292152){logger[_0x4f2e('0x28')](_0x292152['stack']);if(_0x292152[_0x4f2e('0x29')]){delete _0x292152['name'];}_0xece845[_0x4f2e('0x1b')](_0x116dcf)[_0x4f2e('0x2a')](_0x292152);};}exports[_0x4f2e('0x2b')]=function(_0x4a9134,_0x9aacf4){var _0xb109cb={},_0x6e941b={},_0x5f4397={'count':0x0,'rows':[]};var _0x2124f3=_['map'](db[_0x4f2e('0x2c')][_0x4f2e('0x2d')],function(_0x363ec8){return{'name':_0x363ec8[_0x4f2e('0x2e')],'type':_0x363ec8[_0x4f2e('0x2f')]['key']};});_0x6e941b[_0x4f2e('0x30')]=_[_0x4f2e('0x31')](_0x2124f3,_0x4f2e('0x29'));_0x6e941b[_0x4f2e('0x32')]=_[_0x4f2e('0x33')](_0x4a9134[_0x4f2e('0x32')]);_0x6e941b[_0x4f2e('0x34')]=_[_0x4f2e('0x35')](_0x6e941b[_0x4f2e('0x30')],_0x6e941b[_0x4f2e('0x32')]);_0xb109cb[_0x4f2e('0x36')]=_[_0x4f2e('0x35')](_0x6e941b['model'],qs['fields'](_0x4a9134[_0x4f2e('0x32')][_0x4f2e('0x37')]));_0xb109cb['attributes']=_0xb109cb['attributes'][_0x4f2e('0x38')]?_0xb109cb['attributes']:_0x6e941b['model'];if(!_0x4a9134[_0x4f2e('0x32')][_0x4f2e('0x39')](_0x4f2e('0x3a'))){_0xb109cb['limit']=qs['limit'](_0x4a9134[_0x4f2e('0x32')][_0x4f2e('0x1e')]);_0xb109cb[_0x4f2e('0x1f')]=qs[_0x4f2e('0x1f')](_0x4a9134['query']['offset']);}_0xb109cb['order']=qs['sort'](_0x4a9134[_0x4f2e('0x32')][_0x4f2e('0x3b')]);_0xb109cb[_0x4f2e('0x3c')]=qs['filters'](_[_0x4f2e('0x3d')](_0x4a9134[_0x4f2e('0x32')],_0x6e941b['filters']),_0x2124f3);if(_0x4a9134[_0x4f2e('0x32')]['filter']){_0xb109cb[_0x4f2e('0x3c')]=_[_0x4f2e('0x3e')](_0xb109cb[_0x4f2e('0x3c')],{'$or':_[_0x4f2e('0x31')](_0x2124f3,function(_0x509a6f){if(_0x509a6f['type']!==_0x4f2e('0x3f')){var _0x253f46={};_0x253f46[_0x509a6f[_0x4f2e('0x29')]]={'$like':'%'+_0x4a9134[_0x4f2e('0x32')]['filter']+'%'};return _0x253f46;}})});}_0xb109cb=_['merge']({},_0xb109cb,_0x4a9134[_0x4f2e('0x40')]);var _0x15e929={'where':_0xb109cb[_0x4f2e('0x3c')]};return db[_0x4f2e('0x2c')][_0x4f2e('0x41')](_0x15e929)[_0x4f2e('0x26')](function(_0x2c0605){_0x5f4397[_0x4f2e('0x41')]=_0x2c0605;if(_0x4a9134['query']['includeAll']){_0xb109cb[_0x4f2e('0x42')]=[{'all':!![]}];}return db[_0x4f2e('0x2c')]['findAll'](_0xb109cb);})[_0x4f2e('0x26')](function(_0x1906c4){_0x5f4397['rows']=_0x1906c4;return _0x5f4397;})[_0x4f2e('0x26')](respondWithFilteredResult(_0x9aacf4,_0xb109cb))[_0x4f2e('0x43')](handleError(_0x9aacf4,null));};exports[_0x4f2e('0x44')]=function(_0x28f7a4,_0x5799e7){var _0xb97601={'raw':!![],'where':{'id':_0x28f7a4[_0x4f2e('0x45')]['id']}},_0x269f55={};_0x269f55[_0x4f2e('0x30')]=_[_0x4f2e('0x33')](db['SalesforceField'][_0x4f2e('0x2d')]);_0x269f55[_0x4f2e('0x32')]=_[_0x4f2e('0x33')](_0x28f7a4[_0x4f2e('0x32')]);_0x269f55[_0x4f2e('0x34')]=_[_0x4f2e('0x35')](_0x269f55[_0x4f2e('0x30')],_0x269f55[_0x4f2e('0x32')]);_0xb97601[_0x4f2e('0x36')]=_[_0x4f2e('0x35')](_0x269f55[_0x4f2e('0x30')],qs[_0x4f2e('0x37')](_0x28f7a4[_0x4f2e('0x32')]['fields']));_0xb97601[_0x4f2e('0x36')]=_0xb97601[_0x4f2e('0x36')][_0x4f2e('0x38')]?_0xb97601['attributes']:_0x269f55[_0x4f2e('0x30')];if(_0x28f7a4['query'][_0x4f2e('0x46')]){_0xb97601['include']=[{'all':!![]}];}_0xb97601=_[_0x4f2e('0x3e')]({},_0xb97601,_0x28f7a4[_0x4f2e('0x40')]);return db[_0x4f2e('0x2c')][_0x4f2e('0x47')](_0xb97601)[_0x4f2e('0x26')](handleEntityNotFound(_0x5799e7,null))[_0x4f2e('0x26')](respondWithResult(_0x5799e7,null))[_0x4f2e('0x43')](handleError(_0x5799e7,null));};exports[_0x4f2e('0x48')]=function(_0x4392b0,_0x3189a9){return db[_0x4f2e('0x2c')][_0x4f2e('0x48')](_0x4392b0[_0x4f2e('0x49')],{})['then'](respondWithResult(_0x3189a9,0xc9))[_0x4f2e('0x43')](handleError(_0x3189a9,null));};exports[_0x4f2e('0x25')]=function(_0x3b7d44,_0x29eaac){if(_0x3b7d44[_0x4f2e('0x49')]['id']){delete _0x3b7d44[_0x4f2e('0x49')]['id'];}return db['SalesforceField'][_0x4f2e('0x47')]({'where':{'id':_0x3b7d44[_0x4f2e('0x45')]['id']}})['then'](handleEntityNotFound(_0x29eaac,null))[_0x4f2e('0x26')](saveUpdates(_0x3b7d44[_0x4f2e('0x49')],null))[_0x4f2e('0x26')](respondWithResult(_0x29eaac,null))[_0x4f2e('0x43')](handleError(_0x29eaac,null));};exports[_0x4f2e('0x27')]=function(_0x3796d9,_0x1a62d1){return db[_0x4f2e('0x2c')]['find']({'where':{'id':_0x3796d9[_0x4f2e('0x45')]['id']}})[_0x4f2e('0x26')](handleEntityNotFound(_0x1a62d1,null))[_0x4f2e('0x26')](removeEntity(_0x1a62d1,null))['catch'](handleError(_0x1a62d1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 540f3b0..b92b0e3 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 _0x5ae8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util'];(function(_0x53be8d,_0x2cb53f){var _0x396d2c=function(_0x389878){while(--_0x389878){_0x53be8d['push'](_0x53be8d['shift']());}};_0x396d2c(++_0x2cb53f);}(_0x5ae8,0x19c));var _0x85ae=function(_0x5374a2,_0x4947d8){_0x5374a2=_0x5374a2-0x0;var _0x343822=_0x5ae8[_0x5374a2];return _0x343822;};'use strict';var _=require(_0x85ae('0x0'));var util=require(_0x85ae('0x1'));var logger=require(_0x85ae('0x2'))(_0x85ae('0x3'));var moment=require(_0x85ae('0x4'));var BPromise=require(_0x85ae('0x5'));var rp=require(_0x85ae('0x6'));var fs=require('fs');var path=require(_0x85ae('0x7'));var rimraf=require(_0x85ae('0x8'));var config=require(_0x85ae('0x9'));var attributes=require(_0x85ae('0xa'));module[_0x85ae('0xb')]=function(_0x3f943d,_0x426581){return _0x3f943d[_0x85ae('0xc')](_0x85ae('0xd'),attributes,{'tableName':_0x85ae('0xe'),'paranoid':![],'indexes':[{'name':_0x85ae('0xf'),'fields':[_0x85ae('0x10'),_0x85ae('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f0d=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x48051c,_0xf6eb60){var _0x20eb7d=function(_0x1acec1){while(--_0x1acec1){_0x48051c['push'](_0x48051c['shift']());}};_0x20eb7d(++_0xf6eb60);}(_0x8f0d,0x169));var _0xd8f0=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8f0d[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xd8f0('0x0'));var util=require(_0xd8f0('0x1'));var logger=require(_0xd8f0('0x2'))(_0xd8f0('0x3'));var moment=require(_0xd8f0('0x4'));var BPromise=require(_0xd8f0('0x5'));var rp=require(_0xd8f0('0x6'));var fs=require('fs');var path=require(_0xd8f0('0x7'));var rimraf=require(_0xd8f0('0x8'));var config=require(_0xd8f0('0x9'));var attributes=require(_0xd8f0('0xa'));module[_0xd8f0('0xb')]=function(_0x97d987,_0x250bd5){return _0x97d987['define'](_0xd8f0('0xc'),attributes,{'tableName':_0xd8f0('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xd8f0('0xe')],'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 913301f..b783236 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 _0x01b8=['client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x388ccc,_0x2a24fd){var _0x570c20=function(_0x1addd1){while(--_0x1addd1){_0x388ccc['push'](_0x388ccc['shift']());}};_0x570c20(++_0x2a24fd);}(_0x01b8,0x92));var _0x801b=function(_0x149de2,_0x5cbeec){_0x149de2=_0x149de2-0x0;var _0x59ffeb=_0x01b8[_0x149de2];return _0x59ffeb;};'use strict';var _=require(_0x801b('0x0'));var util=require(_0x801b('0x1'));var moment=require('moment');var BPromise=require(_0x801b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x801b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x801b('0x4'));var logger=require(_0x801b('0x5'))(_0x801b('0x6'));var config=require(_0x801b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x801b('0x8')][_0x801b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x125ce3,_0x508fff,_0x1abbfd){return new BPromise(function(_0x442f62,_0x2b4749){return client[_0x801b('0xa')](_0x125ce3,_0x1abbfd)[_0x801b('0xb')](function(_0x2626a3){logger[_0x801b('0xc')](_0x801b('0xd'),_0x508fff,_0x801b('0xe'));logger[_0x801b('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x508fff,_0x801b('0xe'),JSON[_0x801b('0x10')](_0x2626a3));if(_0x2626a3[_0x801b('0x11')]){if(_0x2626a3[_0x801b('0x11')][_0x801b('0x12')]===0x1f4){logger[_0x801b('0x11')](_0x801b('0xd'),_0x508fff,_0x2626a3[_0x801b('0x11')]['message']);return _0x2b4749(_0x2626a3['error'][_0x801b('0x13')]);}logger[_0x801b('0x11')]('SalesforceField,\x20%s,\x20%s',_0x508fff,_0x2626a3[_0x801b('0x11')]['message']);return _0x442f62(_0x2626a3[_0x801b('0x11')][_0x801b('0x13')]);}else{logger[_0x801b('0xc')](_0x801b('0xd'),_0x508fff,_0x801b('0xe'));_0x442f62(_0x2626a3[_0x801b('0x14')][_0x801b('0x13')]);}})[_0x801b('0x15')](function(_0x4faf52){logger['error'](_0x801b('0xd'),_0x508fff,_0x4faf52);_0x2b4749(_0x4faf52);});});} \ No newline at end of file +var _0xa908=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa908,0x1a1));var _0x8a90=function(_0x8e992d,_0x5dd91c){_0x8e992d=_0x8e992d-0x0;var _0x41dd7f=_0xa908[_0x8e992d];return _0x41dd7f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a90('0x0'));var BPromise=require(_0x8a90('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a90('0x2'));var db=require(_0x8a90('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a90('0x4'))('rpc');var config=require(_0x8a90('0x5'));var jayson=require(_0x8a90('0x6'));var client=jayson[_0x8a90('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f68db,_0x10bc00,_0x5f2191){return new BPromise(function(_0xd16b2,_0x2ca19e){return client[_0x8a90('0x8')](_0x2f68db,_0x5f2191)[_0x8a90('0x9')](function(_0x3abfad){logger[_0x8a90('0xa')](_0x8a90('0xb'),_0x10bc00,_0x8a90('0xc'));logger[_0x8a90('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x10bc00,_0x8a90('0xc'),JSON[_0x8a90('0xe')](_0x3abfad));if(_0x3abfad[_0x8a90('0xf')]){if(_0x3abfad['error'][_0x8a90('0x10')]===0x1f4){logger[_0x8a90('0xf')](_0x8a90('0xb'),_0x10bc00,_0x3abfad[_0x8a90('0xf')][_0x8a90('0x11')]);return _0x2ca19e(_0x3abfad[_0x8a90('0xf')][_0x8a90('0x11')]);}logger['error'](_0x8a90('0xb'),_0x10bc00,_0x3abfad[_0x8a90('0xf')][_0x8a90('0x11')]);return _0xd16b2(_0x3abfad['error']['message']);}else{logger[_0x8a90('0xa')](_0x8a90('0xb'),_0x10bc00,_0x8a90('0xc'));_0xd16b2(_0x3abfad[_0x8a90('0x12')][_0x8a90('0x11')]);}})[_0x8a90('0x13')](function(_0x305591){logger[_0x8a90('0xf')](_0x8a90('0xb'),_0x10bc00,_0x305591);_0x2ca19e(_0x305591);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1db86ab..e2156dc 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 _0x5145=['./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c0d30,_0x52e355){var _0x52230f=function(_0x5eb272){while(--_0x5eb272){_0x1c0d30['push'](_0x1c0d30['shift']());}};_0x52230f(++_0x52e355);}(_0x5145,0x1bf));var _0x5514=function(_0x9ee9df,_0x179c98){_0x9ee9df=_0x9ee9df-0x0;var _0x25cff1=_0x5145[_0x9ee9df];return _0x25cff1;};'use strict';var multer=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var path=require(_0x5514('0x2'));var timeout=require(_0x5514('0x3'));var express=require(_0x5514('0x4'));var router=express[_0x5514('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5514('0x6'));var interaction=require(_0x5514('0x7'));var config=require(_0x5514('0x8'));var controller=require(_0x5514('0x9'));router[_0x5514('0xa')]('/',auth[_0x5514('0xb')](),controller[_0x5514('0xc')]);router['get']('/:id',auth[_0x5514('0xb')](),controller[_0x5514('0xd')]);router[_0x5514('0xa')](_0x5514('0xe'),auth[_0x5514('0xb')](),controller[_0x5514('0xf')]);router[_0x5514('0xa')](_0x5514('0x10'),auth['isAuthenticated'](),controller[_0x5514('0x11')]);router[_0x5514('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5514('0xe'),auth['isAuthenticated'](),controller[_0x5514('0x13')]);router[_0x5514('0x14')]('/:id',auth[_0x5514('0xb')](),controller[_0x5514('0x15')]);router['delete'](_0x5514('0x16'),auth['isAuthenticated'](),controller[_0x5514('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0971=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x0971,0xc3));var _0x1097=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x0971[_0x350aeb];return _0x3c5273;};'use strict';var multer=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var path=require(_0x1097('0x2'));var timeout=require(_0x1097('0x3'));var express=require(_0x1097('0x4'));var router=express[_0x1097('0x5')]();var fs_extra=require(_0x1097('0x6'));var auth=require(_0x1097('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1097('0x8'));router[_0x1097('0x9')]('/',auth[_0x1097('0xa')](),controller[_0x1097('0xb')]);router[_0x1097('0x9')](_0x1097('0xc'),auth[_0x1097('0xa')](),controller['show']);router[_0x1097('0x9')](_0x1097('0xd'),auth['isAuthenticated'](),controller[_0x1097('0xe')]);router[_0x1097('0x9')](_0x1097('0xf'),auth['isAuthenticated'](),controller[_0x1097('0x10')]);router['post']('/',auth[_0x1097('0xa')](),controller[_0x1097('0x11')]);router[_0x1097('0x12')](_0x1097('0xd'),auth[_0x1097('0xa')](),controller[_0x1097('0x13')]);router[_0x1097('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1097('0x15')]('/:id',auth[_0x1097('0xa')](),controller[_0x1097('0x16')]);module[_0x1097('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0c1d771..e51368d 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 _0xe405=['exports','STRING','remoteUri','sequelize'];(function(_0x42e97d,_0x2bb770){var _0x1c7457=function(_0x3a7d22){while(--_0x3a7d22){_0x42e97d['push'](_0x42e97d['shift']());}};_0x1c7457(++_0x2bb770);}(_0xe405,0x143));var _0x5e40=function(_0x5c2f3b,_0x34f404){_0x5c2f3b=_0x5c2f3b-0x0;var _0x3d0cae=_0xe405[_0x5c2f3b];return _0x3d0cae;};'use strict';var Sequelize=require(_0x5e40('0x0'));module[_0x5e40('0x1')]={'name':{'type':Sequelize[_0x5e40('0x2')]},'description':{'type':Sequelize[_0x5e40('0x2')]},'username':{'type':Sequelize[_0x5e40('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5e40('0x2')]},'email':{'type':Sequelize[_0x5e40('0x2')]},'remoteUri':{'type':Sequelize[_0x5e40('0x2')],'unique':_0x5e40('0x3')},'serverUrl':{'type':Sequelize[_0x5e40('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0ee6=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1daef9,_0x1db541){var _0x3439e0=function(_0x4c1c8c){while(--_0x4c1c8c){_0x1daef9['push'](_0x1daef9['shift']());}};_0x3439e0(++_0x1db541);}(_0x0ee6,0x1be));var _0x60ee=function(_0xa17660,_0xcc4403){_0xa17660=_0xa17660-0x0;var _0x5dff03=_0x0ee6[_0xa17660];return _0x5dff03;};'use strict';var Sequelize=require(_0x60ee('0x0'));module[_0x60ee('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60ee('0x2')]},'username':{'type':Sequelize[_0x60ee('0x2')],'unique':_0x60ee('0x3')},'password':{'type':Sequelize[_0x60ee('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x60ee('0x2')],'unique':_0x60ee('0x4')},'serverUrl':{'type':Sequelize[_0x60ee('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ddc1d8a..734ddfc 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 _0x1302=['False','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','work_end','reopened_time','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','sys_class_name','close_notes','closed_by','parent_incident','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','includes','forEach','label','push','all','assign','remove','internalType','test','statusCode','stack','True','true'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1302,0xbf));var _0x2130=function(_0x2be0ca,_0x43e111){_0x2be0ca=_0x2be0ca-0x0;var _0x383d15=_0x1302[_0x2be0ca];return _0x383d15;};'use strict';var emlformat=require(_0x2130('0x0'));var rimraf=require(_0x2130('0x1'));var zipdir=require(_0x2130('0x2'));var jsonpatch=require(_0x2130('0x3'));var rp=require(_0x2130('0x4'));var moment=require(_0x2130('0x5'));var BPromise=require(_0x2130('0x6'));var Mustache=require(_0x2130('0x7'));var util=require(_0x2130('0x8'));var path=require(_0x2130('0x9'));var sox=require(_0x2130('0xa'));var csv=require('to-csv');var ejs=require(_0x2130('0xb'));var fs=require('fs');var fs_extra=require(_0x2130('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2130('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2130('0xe'));var toCsv=require(_0x2130('0xf'));var querystring=require(_0x2130('0x10'));var Papa=require('papaparse');var Redis=require(_0x2130('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2130('0x12'));var as=require(_0x2130('0x13'));var hardwareService=require(_0x2130('0x14'));var logger=require(_0x2130('0x15'))(_0x2130('0x16'));var utils=require(_0x2130('0x17'));var config=require(_0x2130('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2130('0x19'))['db'];var integrations=require(_0x2130('0x1a'));function respondWithStatusCode(_0x4b2246,_0x5873bb){_0x5873bb=_0x5873bb||0xcc;return function(_0x169914){if(_0x169914){return _0x4b2246[_0x2130('0x1b')](_0x5873bb);}return _0x4b2246[_0x2130('0x1c')](_0x5873bb)[_0x2130('0x1d')]();};}function respondWithResult(_0x5b3da8,_0xeaa34d){_0xeaa34d=_0xeaa34d||0xc8;return function(_0x2deb70){if(_0x2deb70){return _0x5b3da8[_0x2130('0x1c')](_0xeaa34d)[_0x2130('0x1e')](_0x2deb70);}};}function respondWithFilteredResult(_0x245cac,_0x52ee93){return function(_0x42aaf5){if(_0x42aaf5){var _0x5775da=typeof _0x52ee93['offset']===_0x2130('0x1f')&&typeof _0x52ee93[_0x2130('0x20')]===_0x2130('0x1f');var _0x477885=_0x42aaf5[_0x2130('0x21')];var _0xf02b97=_0x5775da?0x0:_0x52ee93[_0x2130('0x22')];var _0x38f671=_0x5775da?_0x42aaf5[_0x2130('0x21')]:_0x52ee93[_0x2130('0x22')]+_0x52ee93[_0x2130('0x20')];var _0x1d5f19;if(_0x38f671>=_0x477885){_0x38f671=_0x477885;_0x1d5f19=0xc8;}else{_0x1d5f19=0xce;}_0x245cac[_0x2130('0x1c')](_0x1d5f19);return _0x245cac[_0x2130('0x23')](_0x2130('0x24'),_0xf02b97+'-'+_0x38f671+'/'+_0x477885)['json'](_0x42aaf5);}return null;};}function patchUpdates(_0x5ed5d0){return function(_0xd61037){try{jsonpatch[_0x2130('0x25')](_0xd61037,_0x5ed5d0,!![]);}catch(_0x3abfe2){return BPromise[_0x2130('0x26')](_0x3abfe2);}return _0xd61037[_0x2130('0x27')]();};}function saveUpdates(_0x31d5af,_0x3fe5a0){return function(_0x54cee9){if(_0x54cee9){return _0x54cee9[_0x2130('0x28')](_0x31d5af)[_0x2130('0x29')](function(_0x4f2205){return _0x4f2205;});}return null;};}function removeEntity(_0x37dd07,_0x5e4b2e){return function(_0x46bd41){if(_0x46bd41){return _0x46bd41[_0x2130('0x2a')]()[_0x2130('0x29')](function(){_0x37dd07[_0x2130('0x1c')](0xcc)[_0x2130('0x1d')]();});}};}function handleEntityNotFound(_0x3467d6,_0x4873cf){return function(_0x5985ef){if(!_0x5985ef){_0x3467d6[_0x2130('0x1b')](0x194);}return _0x5985ef;};}function handleError(_0x4b4d68,_0x3194ee){_0x3194ee=_0x3194ee||0x1f4;return function(_0x716c63){logger[_0x2130('0x2b')](_0x716c63['stack']);if(_0x716c63[_0x2130('0x2c')]){delete _0x716c63[_0x2130('0x2c')];}_0x4b4d68['status'](_0x3194ee)[_0x2130('0x2d')](_0x716c63);};}exports[_0x2130('0x2e')]=function(_0x48831d,_0x2ced20){var _0x508498={},_0x57cbc4={},_0xf1994={'count':0x0,'rows':[]};var _0x4a7daf=_[_0x2130('0x2f')](db['ServicenowAccount']['rawAttributes'],function(_0x11c231){return{'name':_0x11c231[_0x2130('0x30')],'type':_0x11c231[_0x2130('0x31')][_0x2130('0x32')]};});_0x57cbc4[_0x2130('0x33')]=_[_0x2130('0x2f')](_0x4a7daf,_0x2130('0x2c'));_0x57cbc4[_0x2130('0x34')]=_[_0x2130('0x35')](_0x48831d['query']);_0x57cbc4[_0x2130('0x36')]=_[_0x2130('0x37')](_0x57cbc4['model'],_0x57cbc4[_0x2130('0x34')]);_0x508498[_0x2130('0x38')]=_[_0x2130('0x37')](_0x57cbc4[_0x2130('0x33')],qs[_0x2130('0x39')](_0x48831d[_0x2130('0x34')][_0x2130('0x39')]));_0x508498[_0x2130('0x38')]=_0x508498[_0x2130('0x38')]['length']?_0x508498[_0x2130('0x38')]:_0x57cbc4[_0x2130('0x33')];if(!_0x48831d[_0x2130('0x34')][_0x2130('0x3a')](_0x2130('0x3b'))){_0x508498[_0x2130('0x20')]=qs['limit'](_0x48831d[_0x2130('0x34')][_0x2130('0x20')]);_0x508498[_0x2130('0x22')]=qs['offset'](_0x48831d[_0x2130('0x34')][_0x2130('0x22')]);}_0x508498[_0x2130('0x3c')]=qs[_0x2130('0x3d')](_0x48831d[_0x2130('0x34')]['sort']);_0x508498[_0x2130('0x3e')]=qs[_0x2130('0x36')](_[_0x2130('0x3f')](_0x48831d['query'],_0x57cbc4[_0x2130('0x36')]),_0x4a7daf);if(_0x48831d[_0x2130('0x34')][_0x2130('0x40')]){_0x508498['where']=_[_0x2130('0x41')](_0x508498[_0x2130('0x3e')],{'$or':_[_0x2130('0x2f')](_0x4a7daf,function(_0x3652e1){if(_0x3652e1[_0x2130('0x31')]!==_0x2130('0x42')){var _0x50462c={};_0x50462c[_0x3652e1['name']]={'$like':'%'+_0x48831d['query']['filter']+'%'};return _0x50462c;}})});}_0x508498=_[_0x2130('0x41')]({},_0x508498,_0x48831d[_0x2130('0x43')]);var _0x3dd60a={'where':_0x508498[_0x2130('0x3e')]};return db[_0x2130('0x44')]['count'](_0x3dd60a)[_0x2130('0x29')](function(_0x452463){_0xf1994['count']=_0x452463;if(_0x48831d[_0x2130('0x34')][_0x2130('0x45')]){_0x508498[_0x2130('0x46')]=[{'all':!![]}];}return db[_0x2130('0x44')][_0x2130('0x47')](_0x508498);})['then'](function(_0x324151){_0xf1994[_0x2130('0x48')]=_0x324151;return _0xf1994;})[_0x2130('0x29')](respondWithFilteredResult(_0x2ced20,_0x508498))[_0x2130('0x49')](handleError(_0x2ced20,null));};exports[_0x2130('0x4a')]=function(_0x1c9f8e,_0x53a26a){var _0x5e6b75={'raw':![],'where':{'id':_0x1c9f8e[_0x2130('0x4b')]['id']}},_0x4149b1={};_0x4149b1['model']=_[_0x2130('0x35')](db['ServicenowAccount'][_0x2130('0x4c')]);_0x4149b1['query']=_['keys'](_0x1c9f8e[_0x2130('0x34')]);_0x4149b1[_0x2130('0x36')]=_[_0x2130('0x37')](_0x4149b1[_0x2130('0x33')],_0x4149b1[_0x2130('0x34')]);_0x5e6b75[_0x2130('0x38')]=_[_0x2130('0x37')](_0x4149b1[_0x2130('0x33')],qs[_0x2130('0x39')](_0x1c9f8e[_0x2130('0x34')]['fields']));_0x5e6b75[_0x2130('0x38')]=_0x5e6b75[_0x2130('0x38')][_0x2130('0x4d')]?_0x5e6b75[_0x2130('0x38')]:_0x4149b1[_0x2130('0x33')];if(_0x1c9f8e['query'][_0x2130('0x45')]){_0x5e6b75['include']=[{'all':!![]}];}_0x5e6b75=_[_0x2130('0x41')]({},_0x5e6b75,_0x1c9f8e['options']);return db[_0x2130('0x44')]['find'](_0x5e6b75)[_0x2130('0x29')](handleEntityNotFound(_0x53a26a,null))[_0x2130('0x29')](respondWithResult(_0x53a26a,null))[_0x2130('0x49')](handleError(_0x53a26a,null));};exports[_0x2130('0x4e')]=function(_0x8c1a96,_0x2b8e3c){return db[_0x2130('0x44')][_0x2130('0x4e')](_0x8c1a96[_0x2130('0x4f')],{})[_0x2130('0x29')](respondWithResult(_0x2b8e3c,0xc9))[_0x2130('0x49')](handleError(_0x2b8e3c,null));};exports[_0x2130('0x28')]=function(_0x49cc62,_0x191f1a){if(_0x49cc62[_0x2130('0x4f')]['id']){delete _0x49cc62['body']['id'];}return db[_0x2130('0x44')]['find']({'where':{'id':_0x49cc62[_0x2130('0x4b')]['id']}})['then'](handleEntityNotFound(_0x191f1a,null))['then'](saveUpdates(_0x49cc62[_0x2130('0x4f')],null))[_0x2130('0x29')](respondWithResult(_0x191f1a,null))[_0x2130('0x49')](handleError(_0x191f1a,null));};exports[_0x2130('0x2a')]=function(_0x2fb763,_0x45309d){return db['ServicenowAccount'][_0x2130('0x50')]({'where':{'id':_0x2fb763['params']['id']}})[_0x2130('0x29')](handleEntityNotFound(_0x45309d,null))[_0x2130('0x29')](removeEntity(_0x45309d,null))['catch'](handleError(_0x45309d,null));};exports['getConfigurations']=function(_0x1652c1,_0x23a2e1,_0x752571){var _0x510444={};var _0x5dbdd2={};var _0x3d8e5f;var _0x49651d;return db[_0x2130('0x44')][_0x2130('0x51')]({'where':{'id':_0x1652c1[_0x2130('0x4b')]['id']}})[_0x2130('0x29')](handleEntityNotFound(_0x23a2e1,null))[_0x2130('0x29')](function(_0x5c7332){if(_0x5c7332){_0x3d8e5f=_0x5c7332;_0x5dbdd2[_0x2130('0x33')]=_['keys'](db[_0x2130('0x52')]['rawAttributes']);_0x5dbdd2[_0x2130('0x34')]=_[_0x2130('0x35')](_0x1652c1[_0x2130('0x34')]);_0x5dbdd2[_0x2130('0x36')]=_[_0x2130('0x37')](_0x5dbdd2[_0x2130('0x33')],_0x5dbdd2[_0x2130('0x34')]);_0x510444['attributes']=_[_0x2130('0x37')](_0x5dbdd2[_0x2130('0x33')],qs['fields'](_0x1652c1[_0x2130('0x34')][_0x2130('0x39')]));_0x510444[_0x2130('0x38')]=_0x510444[_0x2130('0x38')][_0x2130('0x4d')]?_0x510444[_0x2130('0x38')]:_0x5dbdd2['model'];_0x510444[_0x2130('0x3c')]=qs['sort'](_0x1652c1[_0x2130('0x34')][_0x2130('0x3d')]);_0x510444[_0x2130('0x3e')]=qs['filters'](_[_0x2130('0x3f')](_0x1652c1[_0x2130('0x34')],_0x5dbdd2['filters']));if(_0x1652c1['query'][_0x2130('0x40')]){_0x510444['where']=_[_0x2130('0x41')](_0x510444['where'],{'$or':_[_0x2130('0x2f')](_0x510444[_0x2130('0x38')],function(_0x42ac7a){var _0x425f08={};_0x425f08[_0x42ac7a]={'$like':'%'+_0x1652c1['query'][_0x2130('0x40')]+'%'};return _0x425f08;})});}_0x510444=_['merge']({},_0x510444,_0x1652c1[_0x2130('0x43')]);return _0x3d8e5f['getConfigurations'](_0x510444);}})[_0x2130('0x29')](function(_0x4bf153){if(_0x4bf153){_0x49651d=_0x4bf153[_0x2130('0x4d')];if(!_0x1652c1[_0x2130('0x34')][_0x2130('0x3a')](_0x2130('0x3b'))){_0x510444[_0x2130('0x20')]=qs[_0x2130('0x20')](_0x1652c1[_0x2130('0x34')]['limit']);_0x510444[_0x2130('0x22')]=qs['offset'](_0x1652c1['query'][_0x2130('0x22')]);}return _0x3d8e5f[_0x2130('0x53')](_0x510444);}})['then'](function(_0x52e8d6){if(_0x52e8d6){return _0x52e8d6?{'count':_0x49651d,'rows':_0x52e8d6}:null;}})[_0x2130('0x29')](respondWithResult(_0x23a2e1,null))[_0x2130('0x49')](handleError(_0x23a2e1,null));};exports[_0x2130('0x54')]=function(_0x1d6e2e,_0x531b15,_0x235e95){if(_0x1d6e2e[_0x2130('0x4f')]['id']){delete _0x1d6e2e[_0x2130('0x4f')]['id'];}return db[_0x2130('0x44')][_0x2130('0x51')]({'where':{'id':_0x1d6e2e[_0x2130('0x4b')]['id']}})['then'](handleEntityNotFound(_0x531b15,null))[_0x2130('0x29')](function(_0x1c2d45){if(_0x1c2d45){_0x1d6e2e[_0x2130('0x4f')]['AccountId']=_0x1c2d45['id'];_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x55')]=integrations[_0x2130('0x56')](_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x57')],_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x31')]);_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x58')]=integrations[_0x2130('0x59')](_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x57')],_0x1d6e2e[_0x2130('0x4f')][_0x2130('0x31')]);return db[_0x2130('0x52')][_0x2130('0x4e')](_0x1d6e2e[_0x2130('0x4f')],{'include':[{'model':db['ServicenowField'],'as':_0x2130('0x55')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x2130('0x29')](respondWithResult(_0x531b15,null))[_0x2130('0x49')](handleError(_0x531b15,null));};exports[_0x2130('0x5a')]=function(_0x1c601b,_0x4c04aa,_0x32156d){var _0x580c48=[_0x2130('0x5b'),_0x2130('0x5c'),'knowledge',_0x2130('0x5d'),_0x2130('0x5e'),_0x2130('0x5f'),_0x2130('0x60'),'severity',_0x2130('0x61')];var _0x47bdbb=[_0x2130('0x62'),_0x2130('0x5b'),'caused_by',_0x2130('0x63'),_0x2130('0x64'),_0x2130('0x65'),'child_incidents',_0x2130('0x5c'),_0x2130('0x66'),_0x2130('0x67'),_0x2130('0x68'),_0x2130('0x69'),'opened_by','user_input',_0x2130('0x6a'),_0x2130('0x6b'),_0x2130('0x6c'),_0x2130('0x6d'),_0x2130('0x6e'),'order',_0x2130('0x6f'),_0x2130('0x70'),_0x2130('0x71'),_0x2130('0x72'),_0x2130('0x73'),_0x2130('0x74'),_0x2130('0x75'),_0x2130('0x76'),_0x2130('0x77'),_0x2130('0x78'),_0x2130('0x79'),_0x2130('0x7a'),_0x2130('0x7b'),'opened_at','business_duration','group_list',_0x2130('0x7c'),_0x2130('0x7d'),'resolved_at',_0x2130('0x7e'),_0x2130('0x7f'),_0x2130('0x5d'),_0x2130('0x80'),'short_description',_0x2130('0x5e'),_0x2130('0x81'),_0x2130('0x82'),_0x2130('0x83'),_0x2130('0x84'),'business_stc',_0x2130('0x85'),'description','calendar_duration',_0x2130('0x5f'),_0x2130('0x86'),_0x2130('0x87'),_0x2130('0x88'),'follow_up',_0x2130('0x89'),'sys_id',_0x2130('0x8a'),_0x2130('0x8b'),_0x2130('0x60'),'urgency',_0x2130('0x8c'),_0x2130('0x8d'),_0x2130('0x8e'),_0x2130('0x8f'),'assigned_to',_0x2130('0x90'),_0x2130('0x91'),_0x2130('0x92'),_0x2130('0x93'),'comments_and_work_notes',_0x2130('0x94'),_0x2130('0x95'),_0x2130('0x96'),_0x2130('0x97'),_0x2130('0x98'),_0x2130('0x99'),_0x2130('0x9a'),'location',_0x2130('0x61')];var _0x349996='';var _0x322c6f='';var _0x46d9b6=[];var _0x1c7e16='';var _0x151129='';var _0x118f33=[];var _0x3c3c9d='';var _0x4c2ddd='';var _0x34fb1f={};var _0x3b31bc='';return db[_0x2130('0x44')][_0x2130('0x51')]({'where':{'id':_0x1c601b[_0x2130('0x4b')]['id']},'attributes':['id',_0x2130('0x9b'),_0x2130('0x9c'),_0x2130('0x9d'),_0x2130('0x9e'),_0x2130('0x9f')]})[_0x2130('0x29')](handleEntityNotFound(_0x4c04aa,null))[_0x2130('0x29')](function(_0x419759){if(_0x419759){_0x3b31bc=_0x419759[_0x2130('0x9e')];var _0x6c0f89=_0x3b31bc[_0x2130('0xa0')](-0x1);if(_0x6c0f89==='/'){_0x3b31bc=_0x3b31bc[_0x2130('0xa1')](0x0,_0x3b31bc[_0x2130('0xa2')](_0x6c0f89));}_0x4c2ddd=util['format']('%s/api/now/doc/table/schema/',_0x3b31bc);_0x3c3c9d=util[_0x2130('0xa3')](_0x2130('0xa4'),_0x3b31bc);_0x34fb1f={'user':_0x419759['username'],'pass':_0x419759[_0x2130('0x9c')]};var _0x351f41={'method':_0x2130('0xa5'),'uri':_0x4c2ddd+_0x2130('0xa6'),'auth':_0x34fb1f,'json':!![]};return rp(_0x351f41);}})['then'](function(_0x53f1e5){if(_0x53f1e5[_0x2130('0xa7')]['length']>0x0){_0x349996=_0x53f1e5[_0x2130('0xa7')];}console[_0x2130('0xa8')](_0x2130('0xa9'),_0x349996);_0x118f33=[];_0x322c6f=Object['assign']([],_0x349996);_['remove'](_0x322c6f,function(_0x4a873b){return!_0x580c48[_0x2130('0xaa')](_0x4a873b[_0x2130('0x2c')]);});_0x322c6f[_0x2130('0xab')](function(_0x243a57){var _0x4b1575=createFieldObject(_0x3c3c9d,_0x34fb1f,_0x243a57['internalType'],_0x243a57['name'],_0x243a57[_0x2130('0xac')],![]);_0x118f33[_0x2130('0xad')](_0x4b1575);});return Promise[_0x2130('0xae')](_0x118f33);})[_0x2130('0x29')](function(_0x12a862){_0x46d9b6=_0x12a862;_0x1c7e16=Object[_0x2130('0xaf')]([],_0x349996);console[_0x2130('0xa8')]('TCL:\x20_object',_0x349996);_[_0x2130('0xb0')](_0x1c7e16,function(_0x29a79c){return _0x47bdbb[_0x2130('0xaa')](_0x29a79c[_0x2130('0x2c')]);});console[_0x2130('0xa8')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1c7e16);_0x118f33=[];_0x1c7e16[_0x2130('0xab')](function(_0x1339c0){var _0x174723=createFieldObject(_0x3c3c9d,_0x34fb1f,_0x1339c0[_0x2130('0xb1')],_0x1339c0[_0x2130('0x2c')],_0x1339c0['label'],!![]);_0x118f33[_0x2130('0xad')](_0x174723);});return Promise[_0x2130('0xae')](_0x118f33);})[_0x2130('0x29')](function(_0x58b783){_0x151129=_0x58b783;var _0x53607b=_0x46d9b6['concat'](_0x151129);return{'count':_0x53607b[_0x2130('0x4d')],'rows':_0x53607b};})['then'](respondWithResult(_0x4c04aa,null))[_0x2130('0x49')](function(_0xa8829d){console[_0x2130('0xa8')]('ServiceNow\x20error:\x20'+_0xa8829d);var _0x58e16c=_0x1c601b[_0x2130('0x34')][_0x2130('0xb2')]?0x1f4:_0xa8829d[_0x2130('0xb3')]||0x1f4;logger['error'](_0xa8829d[_0x2130('0xb4')]);delete _0xa8829d[_0x2130('0x2c')];if(_0x58e16c===0x191){_0x58e16c=0x190;}_0x4c04aa[_0x2130('0x1c')](_0x58e16c)[_0x2130('0x2d')](_0x1c601b[_0x2130('0x34')][_0x2130('0xb2')]?{'message':'Wrong\x20credentials','statusCode':_0xa8829d[_0x2130('0xb3')]}:_0xa8829d);});};function createFieldObject(_0x523062,_0x39e842,_0x21c6a3,_0xaa0a24,_0x4979ce,_0x53b158){return new Promise(function(_0x3faa09,_0x30ea61){var _0x3d45cd={'id':_0xaa0a24,'name':_0x4979ce,'custom':_0x53b158};if(_0x21c6a3==='boolean'){_0x3d45cd[_0x2130('0x43')]=[{'name':_0x2130('0xb5'),'value':_0x2130('0xb6')},{'name':_0x2130('0xb7'),'value':'false'}];_0x3faa09(_0x3d45cd);}else{var _0x34b2ed={'method':_0x2130('0xa5'),'uri':_0x523062+_0x2130('0xb8')+_0xaa0a24,'auth':_0x39e842,'json':!![]};return rp(_0x34b2ed)[_0x2130('0x29')](function(_0x2653da){var _0x5e51e3=[];if(_0x2653da[_0x2130('0xa7')][_0x2130('0x4d')]>0x0){_0x2653da[_0x2130('0xa7')][_0x2130('0xab')](function(_0x191f6a){if(_0x191f6a[_0x2130('0xb9')]===_0x2130('0xba')){var _0x47923e={'name':_0x191f6a['label'],'value':_0x191f6a['value']};_0x5e51e3[_0x2130('0xad')](_0x47923e);}});}_0x3d45cd['options']=_0x5e51e3;if(_0x3d45cd[_0x2130('0x43')][_0x2130('0x4d')]>0x0){_0x3faa09(_0x3d45cd);}else{if(_0x53b158==![]){_0x3faa09();}else{_0x3faa09(_0x3d45cd);}}});}});} \ No newline at end of file +var _0xcbf5=['correlation_id','location','password','email','remoteUri','serverUrl','slice','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','internalType','label','push','all','TCL:\x20_object','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','ServicenowAccount','includeAll','findAll','params','keys','include','find','catch','create','body','ServicenowConfiguration','pick','getConfigurations','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcbf5,0xe0));var _0x5cbf=function(_0xe3512c,_0x4d8e1b){_0xe3512c=_0xe3512c-0x0;var _0x1d82d9=_0xcbf5[_0xe3512c];return _0x1d82d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5cbf('0x0'));var jsonpatch=require(_0x5cbf('0x1'));var rp=require(_0x5cbf('0x2'));var moment=require(_0x5cbf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5cbf('0x4'));var path=require(_0x5cbf('0x5'));var sox=require(_0x5cbf('0x6'));var csv=require(_0x5cbf('0x7'));var ejs=require(_0x5cbf('0x8'));var fs=require('fs');var fs_extra=require(_0x5cbf('0x9'));var _=require(_0x5cbf('0xa'));var squel=require(_0x5cbf('0xb'));var crypto=require(_0x5cbf('0xc'));var jsforce=require(_0x5cbf('0xd'));var deskjs=require(_0x5cbf('0xe'));var toCsv=require(_0x5cbf('0x7'));var querystring=require('querystring');var Papa=require(_0x5cbf('0xf'));var Redis=require('ioredis');var authService=require(_0x5cbf('0x10'));var qs=require(_0x5cbf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cbf('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5cbf('0x13'));var licenseUtil=require(_0x5cbf('0x14'));var db=require(_0x5cbf('0x15'))['db'];var integrations=require(_0x5cbf('0x16'));function respondWithStatusCode(_0x6298ed,_0x5a7e0c){_0x5a7e0c=_0x5a7e0c||0xcc;return function(_0x175314){if(_0x175314){return _0x6298ed['sendStatus'](_0x5a7e0c);}return _0x6298ed[_0x5cbf('0x17')](_0x5a7e0c)[_0x5cbf('0x18')]();};}function respondWithResult(_0x28ad5d,_0xae82d7){_0xae82d7=_0xae82d7||0xc8;return function(_0x56bf63){if(_0x56bf63){return _0x28ad5d[_0x5cbf('0x17')](_0xae82d7)['json'](_0x56bf63);}};}function respondWithFilteredResult(_0x27ae6f,_0x32e1d0){return function(_0x440c0d){if(_0x440c0d){var _0x8d2497=typeof _0x32e1d0[_0x5cbf('0x19')]===_0x5cbf('0x1a')&&typeof _0x32e1d0[_0x5cbf('0x1b')]===_0x5cbf('0x1a');var _0x186efb=_0x440c0d[_0x5cbf('0x1c')];var _0x2a2b0e=_0x8d2497?0x0:_0x32e1d0[_0x5cbf('0x19')];var _0x23514f=_0x8d2497?_0x440c0d['count']:_0x32e1d0['offset']+_0x32e1d0['limit'];var _0x54421d;if(_0x23514f>=_0x186efb){_0x23514f=_0x186efb;_0x54421d=0xc8;}else{_0x54421d=0xce;}_0x27ae6f[_0x5cbf('0x17')](_0x54421d);return _0x27ae6f['set'](_0x5cbf('0x1d'),_0x2a2b0e+'-'+_0x23514f+'/'+_0x186efb)['json'](_0x440c0d);}return null;};}function patchUpdates(_0xfb94a7){return function(_0x8aff31){try{jsonpatch['apply'](_0x8aff31,_0xfb94a7,!![]);}catch(_0x186dc4){return BPromise[_0x5cbf('0x1e')](_0x186dc4);}return _0x8aff31['save']();};}function saveUpdates(_0x38abf6,_0x283310){return function(_0x4cf30c){if(_0x4cf30c){return _0x4cf30c[_0x5cbf('0x1f')](_0x38abf6)[_0x5cbf('0x20')](function(_0x132336){return _0x132336;});}return null;};}function removeEntity(_0x386699,_0x121e3b){return function(_0x5dfc66){if(_0x5dfc66){return _0x5dfc66[_0x5cbf('0x21')]()[_0x5cbf('0x20')](function(){_0x386699[_0x5cbf('0x17')](0xcc)[_0x5cbf('0x18')]();});}};}function handleEntityNotFound(_0x29585c,_0x2f93f5){return function(_0x3b18ea){if(!_0x3b18ea){_0x29585c[_0x5cbf('0x22')](0x194);}return _0x3b18ea;};}function handleError(_0xa8eb2,_0x581a9b){_0x581a9b=_0x581a9b||0x1f4;return function(_0x253894){logger[_0x5cbf('0x23')](_0x253894['stack']);if(_0x253894[_0x5cbf('0x24')]){delete _0x253894[_0x5cbf('0x24')];}_0xa8eb2[_0x5cbf('0x17')](_0x581a9b)[_0x5cbf('0x25')](_0x253894);};}exports[_0x5cbf('0x26')]=function(_0x26fe3b,_0x346bc6){var _0x450390={},_0x2192d9={},_0x482c46={'count':0x0,'rows':[]};var _0x56d156=_['map'](db['ServicenowAccount'][_0x5cbf('0x27')],function(_0x6801e6){return{'name':_0x6801e6[_0x5cbf('0x28')],'type':_0x6801e6[_0x5cbf('0x29')][_0x5cbf('0x2a')]};});_0x2192d9[_0x5cbf('0x2b')]=_['map'](_0x56d156,'name');_0x2192d9[_0x5cbf('0x2c')]=_['keys'](_0x26fe3b[_0x5cbf('0x2c')]);_0x2192d9[_0x5cbf('0x2d')]=_[_0x5cbf('0x2e')](_0x2192d9[_0x5cbf('0x2b')],_0x2192d9[_0x5cbf('0x2c')]);_0x450390[_0x5cbf('0x2f')]=_[_0x5cbf('0x2e')](_0x2192d9[_0x5cbf('0x2b')],qs['fields'](_0x26fe3b['query'][_0x5cbf('0x30')]));_0x450390[_0x5cbf('0x2f')]=_0x450390[_0x5cbf('0x2f')][_0x5cbf('0x31')]?_0x450390[_0x5cbf('0x2f')]:_0x2192d9['model'];if(!_0x26fe3b[_0x5cbf('0x2c')][_0x5cbf('0x32')](_0x5cbf('0x33'))){_0x450390['limit']=qs[_0x5cbf('0x1b')](_0x26fe3b['query'][_0x5cbf('0x1b')]);_0x450390[_0x5cbf('0x19')]=qs[_0x5cbf('0x19')](_0x26fe3b[_0x5cbf('0x2c')][_0x5cbf('0x19')]);}_0x450390[_0x5cbf('0x34')]=qs['sort'](_0x26fe3b[_0x5cbf('0x2c')][_0x5cbf('0x35')]);_0x450390[_0x5cbf('0x36')]=qs[_0x5cbf('0x2d')](_['pick'](_0x26fe3b[_0x5cbf('0x2c')],_0x2192d9[_0x5cbf('0x2d')]),_0x56d156);if(_0x26fe3b[_0x5cbf('0x2c')]['filter']){_0x450390[_0x5cbf('0x36')]=_[_0x5cbf('0x37')](_0x450390[_0x5cbf('0x36')],{'$or':_[_0x5cbf('0x38')](_0x56d156,function(_0xbaaecd){if(_0xbaaecd[_0x5cbf('0x29')]!=='VIRTUAL'){var _0x16b615={};_0x16b615[_0xbaaecd['name']]={'$like':'%'+_0x26fe3b['query'][_0x5cbf('0x39')]+'%'};return _0x16b615;}})});}_0x450390=_['merge']({},_0x450390,_0x26fe3b[_0x5cbf('0x3a')]);var _0x30d6d5={'where':_0x450390[_0x5cbf('0x36')]};return db[_0x5cbf('0x3b')][_0x5cbf('0x1c')](_0x30d6d5)[_0x5cbf('0x20')](function(_0x56a2a3){_0x482c46['count']=_0x56a2a3;if(_0x26fe3b[_0x5cbf('0x2c')][_0x5cbf('0x3c')]){_0x450390['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x5cbf('0x3d')](_0x450390);})[_0x5cbf('0x20')](function(_0x1adfb0){_0x482c46['rows']=_0x1adfb0;return _0x482c46;})[_0x5cbf('0x20')](respondWithFilteredResult(_0x346bc6,_0x450390))['catch'](handleError(_0x346bc6,null));};exports['show']=function(_0x3c8cdf,_0x4f9bfb){var _0x39dd8f={'raw':![],'where':{'id':_0x3c8cdf[_0x5cbf('0x3e')]['id']}},_0x50c2e5={};_0x50c2e5['model']=_[_0x5cbf('0x3f')](db[_0x5cbf('0x3b')][_0x5cbf('0x27')]);_0x50c2e5[_0x5cbf('0x2c')]=_['keys'](_0x3c8cdf['query']);_0x50c2e5[_0x5cbf('0x2d')]=_[_0x5cbf('0x2e')](_0x50c2e5['model'],_0x50c2e5[_0x5cbf('0x2c')]);_0x39dd8f[_0x5cbf('0x2f')]=_[_0x5cbf('0x2e')](_0x50c2e5[_0x5cbf('0x2b')],qs['fields'](_0x3c8cdf['query'][_0x5cbf('0x30')]));_0x39dd8f[_0x5cbf('0x2f')]=_0x39dd8f[_0x5cbf('0x2f')][_0x5cbf('0x31')]?_0x39dd8f['attributes']:_0x50c2e5['model'];if(_0x3c8cdf[_0x5cbf('0x2c')]['includeAll']){_0x39dd8f[_0x5cbf('0x40')]=[{'all':!![]}];}_0x39dd8f=_[_0x5cbf('0x37')]({},_0x39dd8f,_0x3c8cdf['options']);return db['ServicenowAccount'][_0x5cbf('0x41')](_0x39dd8f)['then'](handleEntityNotFound(_0x4f9bfb,null))[_0x5cbf('0x20')](respondWithResult(_0x4f9bfb,null))[_0x5cbf('0x42')](handleError(_0x4f9bfb,null));};exports[_0x5cbf('0x43')]=function(_0x391948,_0x43d628){return db[_0x5cbf('0x3b')][_0x5cbf('0x43')](_0x391948[_0x5cbf('0x44')],{})['then'](respondWithResult(_0x43d628,0xc9))['catch'](handleError(_0x43d628,null));};exports['update']=function(_0x2e845d,_0x82b49){if(_0x2e845d[_0x5cbf('0x44')]['id']){delete _0x2e845d['body']['id'];}return db[_0x5cbf('0x3b')]['find']({'where':{'id':_0x2e845d['params']['id']}})[_0x5cbf('0x20')](handleEntityNotFound(_0x82b49,null))[_0x5cbf('0x20')](saveUpdates(_0x2e845d[_0x5cbf('0x44')],null))[_0x5cbf('0x20')](respondWithResult(_0x82b49,null))['catch'](handleError(_0x82b49,null));};exports[_0x5cbf('0x21')]=function(_0x53a0c2,_0x3321d1){return db[_0x5cbf('0x3b')][_0x5cbf('0x41')]({'where':{'id':_0x53a0c2[_0x5cbf('0x3e')]['id']}})[_0x5cbf('0x20')](handleEntityNotFound(_0x3321d1,null))[_0x5cbf('0x20')](removeEntity(_0x3321d1,null))[_0x5cbf('0x42')](handleError(_0x3321d1,null));};exports['getConfigurations']=function(_0x442d7b,_0x486a84,_0x423d1e){var _0x4234c6={};var _0x4538f1={};var _0x2fe549;var _0x41d76c;return db['ServicenowAccount']['findOne']({'where':{'id':_0x442d7b[_0x5cbf('0x3e')]['id']}})[_0x5cbf('0x20')](handleEntityNotFound(_0x486a84,null))[_0x5cbf('0x20')](function(_0x199ebd){if(_0x199ebd){_0x2fe549=_0x199ebd;_0x4538f1[_0x5cbf('0x2b')]=_[_0x5cbf('0x3f')](db[_0x5cbf('0x45')][_0x5cbf('0x27')]);_0x4538f1[_0x5cbf('0x2c')]=_[_0x5cbf('0x3f')](_0x442d7b['query']);_0x4538f1[_0x5cbf('0x2d')]=_[_0x5cbf('0x2e')](_0x4538f1[_0x5cbf('0x2b')],_0x4538f1[_0x5cbf('0x2c')]);_0x4234c6['attributes']=_[_0x5cbf('0x2e')](_0x4538f1[_0x5cbf('0x2b')],qs[_0x5cbf('0x30')](_0x442d7b[_0x5cbf('0x2c')][_0x5cbf('0x30')]));_0x4234c6[_0x5cbf('0x2f')]=_0x4234c6[_0x5cbf('0x2f')]['length']?_0x4234c6[_0x5cbf('0x2f')]:_0x4538f1[_0x5cbf('0x2b')];_0x4234c6[_0x5cbf('0x34')]=qs[_0x5cbf('0x35')](_0x442d7b[_0x5cbf('0x2c')][_0x5cbf('0x35')]);_0x4234c6['where']=qs['filters'](_[_0x5cbf('0x46')](_0x442d7b[_0x5cbf('0x2c')],_0x4538f1[_0x5cbf('0x2d')]));if(_0x442d7b['query']['filter']){_0x4234c6[_0x5cbf('0x36')]=_[_0x5cbf('0x37')](_0x4234c6[_0x5cbf('0x36')],{'$or':_['map'](_0x4234c6[_0x5cbf('0x2f')],function(_0x5d6937){var _0x333324={};_0x333324[_0x5d6937]={'$like':'%'+_0x442d7b[_0x5cbf('0x2c')][_0x5cbf('0x39')]+'%'};return _0x333324;})});}_0x4234c6=_[_0x5cbf('0x37')]({},_0x4234c6,_0x442d7b['options']);return _0x2fe549[_0x5cbf('0x47')](_0x4234c6);}})[_0x5cbf('0x20')](function(_0x281445){if(_0x281445){_0x41d76c=_0x281445[_0x5cbf('0x31')];if(!_0x442d7b[_0x5cbf('0x2c')]['hasOwnProperty']('nolimit')){_0x4234c6[_0x5cbf('0x1b')]=qs['limit'](_0x442d7b[_0x5cbf('0x2c')][_0x5cbf('0x1b')]);_0x4234c6[_0x5cbf('0x19')]=qs[_0x5cbf('0x19')](_0x442d7b[_0x5cbf('0x2c')][_0x5cbf('0x19')]);}return _0x2fe549[_0x5cbf('0x47')](_0x4234c6);}})[_0x5cbf('0x20')](function(_0x56a93e){if(_0x56a93e){return _0x56a93e?{'count':_0x41d76c,'rows':_0x56a93e}:null;}})[_0x5cbf('0x20')](respondWithResult(_0x486a84,null))[_0x5cbf('0x42')](handleError(_0x486a84,null));};exports['addConfiguration']=function(_0x196129,_0x3c7493,_0x5f37be){if(_0x196129[_0x5cbf('0x44')]['id']){delete _0x196129[_0x5cbf('0x44')]['id'];}return db[_0x5cbf('0x3b')][_0x5cbf('0x48')]({'where':{'id':_0x196129[_0x5cbf('0x3e')]['id']}})[_0x5cbf('0x20')](handleEntityNotFound(_0x3c7493,null))[_0x5cbf('0x20')](function(_0x2f89bf){if(_0x2f89bf){_0x196129[_0x5cbf('0x44')]['AccountId']=_0x2f89bf['id'];_0x196129[_0x5cbf('0x44')][_0x5cbf('0x49')]=integrations[_0x5cbf('0x4a')](_0x196129['body'][_0x5cbf('0x4b')],_0x196129[_0x5cbf('0x44')][_0x5cbf('0x29')]);_0x196129['body']['Descriptions']=integrations[_0x5cbf('0x4c')](_0x196129[_0x5cbf('0x44')]['channel'],_0x196129[_0x5cbf('0x44')][_0x5cbf('0x29')]);return db['ServicenowConfiguration']['create'](_0x196129['body'],{'include':[{'model':db['ServicenowField'],'as':_0x5cbf('0x49')},{'model':db[_0x5cbf('0x4d')],'as':_0x5cbf('0x4e')}]});}return null;})[_0x5cbf('0x20')](respondWithResult(_0x3c7493,null))['catch'](handleError(_0x3c7493,null));};exports[_0x5cbf('0x4f')]=function(_0x1e2a09,_0x4282d9,_0x24dd34){var _0x4cfa0e=[_0x5cbf('0x50'),_0x5cbf('0x51'),_0x5cbf('0x52'),'subcategory',_0x5cbf('0x53'),_0x5cbf('0x54'),_0x5cbf('0x55'),_0x5cbf('0x56'),_0x5cbf('0x57')];var _0x28198f=[_0x5cbf('0x58'),'made_sla',_0x5cbf('0x59'),_0x5cbf('0x5a'),_0x5cbf('0x5b'),_0x5cbf('0x5c'),_0x5cbf('0x5d'),_0x5cbf('0x51'),_0x5cbf('0x5e'),'number',_0x5cbf('0x5f'),_0x5cbf('0x60'),_0x5cbf('0x61'),_0x5cbf('0x62'),'sys_created_on',_0x5cbf('0x63'),_0x5cbf('0x64'),_0x5cbf('0x65'),_0x5cbf('0x52'),_0x5cbf('0x34'),_0x5cbf('0x66'),_0x5cbf('0x67'),_0x5cbf('0x68'),'delivery_plan',_0x5cbf('0x69'),_0x5cbf('0x6a'),_0x5cbf('0x6b'),_0x5cbf('0x6c'),_0x5cbf('0x6d'),_0x5cbf('0x6e'),_0x5cbf('0x6f'),_0x5cbf('0x70'),_0x5cbf('0x71'),_0x5cbf('0x72'),_0x5cbf('0x73'),'group_list','work_end',_0x5cbf('0x74'),_0x5cbf('0x75'),_0x5cbf('0x76'),_0x5cbf('0x77'),'subcategory','work_notes',_0x5cbf('0x78'),_0x5cbf('0x53'),_0x5cbf('0x79'),_0x5cbf('0x7a'),_0x5cbf('0x7b'),_0x5cbf('0x7c'),_0x5cbf('0x7d'),'additional_assignee_list','description',_0x5cbf('0x7e'),_0x5cbf('0x54'),_0x5cbf('0x7f'),_0x5cbf('0x80'),_0x5cbf('0x81'),_0x5cbf('0x82'),'parent_incident',_0x5cbf('0x83'),_0x5cbf('0x84'),_0x5cbf('0x85'),_0x5cbf('0x55'),'urgency','problem_id',_0x5cbf('0x86'),_0x5cbf('0x87'),_0x5cbf('0x88'),_0x5cbf('0x89'),_0x5cbf('0x56'),_0x5cbf('0x8a'),_0x5cbf('0x8b'),'approval',_0x5cbf('0x8c'),_0x5cbf('0x8d'),_0x5cbf('0x8e'),_0x5cbf('0x8f'),_0x5cbf('0x90'),'escalation',_0x5cbf('0x91'),_0x5cbf('0x92'),_0x5cbf('0x93'),_0x5cbf('0x57')];var _0x2e0cfb='';var _0x55dc31='';var _0x4bdd7a=[];var _0x2641bc='';var _0x3ff906='';var _0x1cc26c=[];var _0x2db71d='';var _0x369db9='';var _0x3b6fd7={};var _0x59cdcb='';return db[_0x5cbf('0x3b')]['findOne']({'where':{'id':_0x1e2a09['params']['id']},'attributes':['id','username',_0x5cbf('0x94'),_0x5cbf('0x95'),_0x5cbf('0x96'),_0x5cbf('0x97')]})[_0x5cbf('0x20')](handleEntityNotFound(_0x4282d9,null))['then'](function(_0x1cef57){if(_0x1cef57){_0x59cdcb=_0x1cef57[_0x5cbf('0x96')];var _0x2b978e=_0x59cdcb[_0x5cbf('0x98')](-0x1);if(_0x2b978e==='/'){_0x59cdcb=_0x59cdcb[_0x5cbf('0x99')](0x0,_0x59cdcb[_0x5cbf('0x9a')](_0x2b978e));}_0x369db9=util[_0x5cbf('0x9b')](_0x5cbf('0x9c'),_0x59cdcb);_0x2db71d=util['format'](_0x5cbf('0x9d'),_0x59cdcb);_0x3b6fd7={'user':_0x1cef57[_0x5cbf('0x9e')],'pass':_0x1cef57['password']};var _0x55aafe={'method':_0x5cbf('0x9f'),'uri':_0x369db9+_0x5cbf('0xa0'),'auth':_0x3b6fd7,'json':!![]};return rp(_0x55aafe);}})[_0x5cbf('0x20')](function(_0x6a4322){if(_0x6a4322[_0x5cbf('0xa1')][_0x5cbf('0x31')]>0x0){_0x2e0cfb=_0x6a4322[_0x5cbf('0xa1')];}console[_0x5cbf('0xa2')]('incident\x20table\x20objects',_0x2e0cfb);_0x1cc26c=[];_0x55dc31=Object[_0x5cbf('0xa3')]([],_0x2e0cfb);_[_0x5cbf('0xa4')](_0x55dc31,function(_0x6e5b07){return!_0x4cfa0e[_0x5cbf('0xa5')](_0x6e5b07['name']);});_0x55dc31['forEach'](function(_0x3d9cd8){var _0x4043bb=createFieldObject(_0x2db71d,_0x3b6fd7,_0x3d9cd8[_0x5cbf('0xa6')],_0x3d9cd8[_0x5cbf('0x24')],_0x3d9cd8[_0x5cbf('0xa7')],![]);_0x1cc26c[_0x5cbf('0xa8')](_0x4043bb);});return Promise[_0x5cbf('0xa9')](_0x1cc26c);})[_0x5cbf('0x20')](function(_0x14c090){_0x4bdd7a=_0x14c090;_0x2641bc=Object[_0x5cbf('0xa3')]([],_0x2e0cfb);console['log'](_0x5cbf('0xaa'),_0x2e0cfb);_[_0x5cbf('0xa4')](_0x2641bc,function(_0x1f104e){return _0x28198f['includes'](_0x1f104e[_0x5cbf('0x24')]);});console[_0x5cbf('0xa2')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2641bc);_0x1cc26c=[];_0x2641bc[_0x5cbf('0xab')](function(_0x5ca21b){var _0x314ed2=createFieldObject(_0x2db71d,_0x3b6fd7,_0x5ca21b[_0x5cbf('0xa6')],_0x5ca21b['name'],_0x5ca21b[_0x5cbf('0xa7')],!![]);_0x1cc26c[_0x5cbf('0xa8')](_0x314ed2);});return Promise[_0x5cbf('0xa9')](_0x1cc26c);})[_0x5cbf('0x20')](function(_0x47ac74){_0x3ff906=_0x47ac74;var _0x2d4536=_0x4bdd7a[_0x5cbf('0xac')](_0x3ff906);return{'count':_0x2d4536[_0x5cbf('0x31')],'rows':_0x2d4536};})['then'](respondWithResult(_0x4282d9,null))[_0x5cbf('0x42')](function(_0x916040){console[_0x5cbf('0xa2')](_0x5cbf('0xad')+_0x916040);var _0x3243ea=_0x1e2a09[_0x5cbf('0x2c')][_0x5cbf('0xae')]?0x1f4:_0x916040[_0x5cbf('0xaf')]||0x1f4;logger[_0x5cbf('0x23')](_0x916040[_0x5cbf('0xb0')]);delete _0x916040[_0x5cbf('0x24')];if(_0x3243ea===0x191){_0x3243ea=0x190;}_0x4282d9['status'](_0x3243ea)[_0x5cbf('0x25')](_0x1e2a09['query'][_0x5cbf('0xae')]?{'message':_0x5cbf('0xb1'),'statusCode':_0x916040[_0x5cbf('0xaf')]}:_0x916040);});};function createFieldObject(_0x55b331,_0x5f1b64,_0x10b492,_0x51b820,_0x312731,_0x22cdf4){return new Promise(function(_0x261bb2,_0x2179a2){var _0x3f2b23={'id':_0x51b820,'name':_0x312731,'custom':_0x22cdf4};if(_0x10b492===_0x5cbf('0xb2')){_0x3f2b23[_0x5cbf('0x3a')]=[{'name':_0x5cbf('0xb3'),'value':'true'},{'name':_0x5cbf('0xb4'),'value':'false'}];_0x261bb2(_0x3f2b23);}else{var _0x100c30={'method':'GET','uri':_0x55b331+_0x5cbf('0xb5')+_0x51b820,'auth':_0x5f1b64,'json':!![]};return rp(_0x100c30)[_0x5cbf('0x20')](function(_0x51801e){var _0x5cfa09=[];if(_0x51801e[_0x5cbf('0xa1')]['length']>0x0){_0x51801e[_0x5cbf('0xa1')]['forEach'](function(_0x5c3e8d){if(_0x5c3e8d[_0x5cbf('0xb6')]===_0x5cbf('0xb7')){var _0x3ed8d7={'name':_0x5c3e8d[_0x5cbf('0xa7')],'value':_0x5c3e8d[_0x5cbf('0xb8')]};_0x5cfa09[_0x5cbf('0xa8')](_0x3ed8d7);}});}_0x3f2b23[_0x5cbf('0x3a')]=_0x5cfa09;if(_0x3f2b23['options']['length']>0x0){_0x261bb2(_0x3f2b23);}else{if(_0x22cdf4==![]){_0x261bb2();}else{_0x261bb2(_0x3f2b23);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7861e06..39cb1f5 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0x12417a,_0xaf8dc){var _0x4955f6=function(_0x29ff78){while(--_0x29ff78){_0x12417a['push'](_0x12417a['shift']());}};_0x4955f6(++_0xaf8dc);}(_0x1261,0x144));var _0x1126=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0x1261[_0x323430];return _0x9eecd1;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x1883,0xab));var _0x3188=function(_0x3b1798,_0x53f3c8){_0x3b1798=_0x3b1798-0x0;var _0x4b876d=_0x1883[_0x3b1798];return _0x4b876d;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));var integrations=require(_0x3188('0xb'));module[_0x3188('0xc')]=function(_0x33b62d,_0x24f2f1){return _0x33b62d[_0x3188('0xd')](_0x3188('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index da5c735..bed92df 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 _0x3bd0=['http','then','ServicenowAccount,\x20%s,\x20%s','debug','code','message','error','info','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','stringify','raw','ShowServicenowAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','client'];(function(_0x5ddda9,_0x43e558){var _0x53a004=function(_0x2794a1){while(--_0x2794a1){_0x5ddda9['push'](_0x5ddda9['shift']());}};_0x53a004(++_0x43e558);}(_0x3bd0,0x18c));var _0x03bd=function(_0x29e7fa,_0x231b9c){_0x29e7fa=_0x29e7fa-0x0;var _0x93b500=_0x3bd0[_0x29e7fa];return _0x93b500;};'use strict';var _=require(_0x03bd('0x0'));var util=require(_0x03bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03bd('0x2'));var fs=require('fs');var Redis=require(_0x03bd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03bd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x03bd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x03bd('0x6')][_0x03bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8f50ca,_0x2c88fc,_0x4d5e09){return new BPromise(function(_0x1389d8,_0x53aaf4){return client['request'](_0x8f50ca,_0x4d5e09)[_0x03bd('0x8')](function(_0x5d6d7c){logger['info'](_0x03bd('0x9'),_0x2c88fc,'request\x20sent');logger[_0x03bd('0xa')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2c88fc,'request\x20sent',JSON['stringify'](_0x5d6d7c));if(_0x5d6d7c['error']){if(_0x5d6d7c['error'][_0x03bd('0xb')]===0x1f4){logger['error'](_0x03bd('0x9'),_0x2c88fc,_0x5d6d7c['error'][_0x03bd('0xc')]);return _0x53aaf4(_0x5d6d7c[_0x03bd('0xd')]['message']);}logger[_0x03bd('0xd')](_0x03bd('0x9'),_0x2c88fc,_0x5d6d7c[_0x03bd('0xd')][_0x03bd('0xc')]);return _0x1389d8(_0x5d6d7c[_0x03bd('0xd')][_0x03bd('0xc')]);}else{logger[_0x03bd('0xe')](_0x03bd('0x9'),_0x2c88fc,_0x03bd('0xf'));_0x1389d8(_0x5d6d7c[_0x03bd('0x10')][_0x03bd('0xc')]);}})[_0x03bd('0x11')](function(_0x2e7b06){logger['error'](_0x03bd('0x9'),_0x2c88fc,_0x2e7b06);_0x53aaf4(_0x2e7b06);});});}exports[_0x03bd('0x12')]=function(_0x5646f4){var _0x4d5f05=this;return new Promise(function(_0x168e4f,_0x302d42){return db[_0x03bd('0x13')][_0x03bd('0x14')]({'raw':_0x5646f4[_0x03bd('0x15')]?_0x5646f4['options']['raw']===undefined?!![]:![]:!![],'where':_0x5646f4[_0x03bd('0x15')]?_0x5646f4[_0x03bd('0x15')][_0x03bd('0x16')]||null:null,'attributes':_0x5646f4['options']?_0x5646f4[_0x03bd('0x15')][_0x03bd('0x17')]||null:null,'limit':_0x5646f4[_0x03bd('0x15')]?_0x5646f4[_0x03bd('0x15')][_0x03bd('0x18')]||null:null,'include':_0x5646f4['options']?_0x5646f4[_0x03bd('0x15')][_0x03bd('0x19')]?_[_0x03bd('0x1a')](_0x5646f4[_0x03bd('0x15')]['include'],function(_0x4beda1){return{'model':db[_0x4beda1[_0x03bd('0x1b')]],'as':_0x4beda1['as'],'attributes':_0x4beda1[_0x03bd('0x17')],'include':_0x4beda1[_0x03bd('0x19')]?_[_0x03bd('0x1a')](_0x4beda1['include'],function(_0x14ab34){return{'model':db[_0x14ab34[_0x03bd('0x1b')]],'as':_0x14ab34['as'],'attributes':_0x14ab34[_0x03bd('0x17')],'include':_0x14ab34[_0x03bd('0x19')]?_[_0x03bd('0x1a')](_0x14ab34['include'],function(_0x58ccdb){return{'model':db[_0x58ccdb[_0x03bd('0x1b')]],'as':_0x58ccdb['as'],'attributes':_0x58ccdb[_0x03bd('0x17')]};}):[]};}):[]};}):[]:[]})[_0x03bd('0x8')](function(_0x45f239){logger[_0x03bd('0xe')](_0x03bd('0x12'),_0x5646f4);logger[_0x03bd('0xa')]('GetServicenowAccount',_0x5646f4,JSON[_0x03bd('0x1c')](_0x45f239));_0x168e4f(_0x45f239);})[_0x03bd('0x11')](function(_0x576ebd){logger['error']('GetServicenowAccount',_0x576ebd[_0x03bd('0xc')],_0x5646f4);_0x302d42(_0x4d5f05[_0x03bd('0xd')](0x1f4,_0x576ebd[_0x03bd('0xc')]));});});};exports['ShowServicenowAccount']=function(_0x17946f){var _0x148d06=this;return new Promise(function(_0x4bebc9,_0x4b3023){return db[_0x03bd('0x13')]['find']({'raw':_0x17946f['options']?_0x17946f['options'][_0x03bd('0x1d')]===undefined?!![]:![]:!![],'where':_0x17946f['options']?_0x17946f[_0x03bd('0x15')][_0x03bd('0x16')]||null:null,'attributes':_0x17946f[_0x03bd('0x15')]?_0x17946f[_0x03bd('0x15')]['attributes']||null:null,'include':_0x17946f[_0x03bd('0x15')]?_0x17946f[_0x03bd('0x15')][_0x03bd('0x19')]?_['map'](_0x17946f[_0x03bd('0x15')][_0x03bd('0x19')],function(_0x2351a0){return{'model':db[_0x2351a0[_0x03bd('0x1b')]],'as':_0x2351a0['as'],'attributes':_0x2351a0[_0x03bd('0x17')],'include':_0x2351a0['include']?_['map'](_0x2351a0[_0x03bd('0x19')],function(_0x4bee5e){return{'model':db[_0x4bee5e[_0x03bd('0x1b')]],'as':_0x4bee5e['as'],'attributes':_0x4bee5e['attributes'],'include':_0x4bee5e['include']?_[_0x03bd('0x1a')](_0x4bee5e['include'],function(_0x2f2104){return{'model':db[_0x2f2104[_0x03bd('0x1b')]],'as':_0x2f2104['as'],'attributes':_0x2f2104[_0x03bd('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d305e){logger[_0x03bd('0xe')](_0x03bd('0x1e'),_0x17946f);logger[_0x03bd('0xa')](_0x03bd('0x1e'),_0x17946f,JSON['stringify'](_0x1d305e));_0x4bebc9(_0x1d305e);})['catch'](function(_0x5baeb8){logger[_0x03bd('0xd')](_0x03bd('0x1e'),_0x5baeb8[_0x03bd('0xc')],_0x17946f);_0x4b3023(_0x148d06['error'](0x1f4,_0x5baeb8[_0x03bd('0xc')]));});});}; \ No newline at end of file +var _0x8aa2=['request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','ServicenowAccount','findAll','raw','options','where','attributes','limit','include','map','model','find','then','debug','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','info'];(function(_0x26b9f8,_0x45c3c0){var _0x2a3f8b=function(_0x2e3a2e){while(--_0x2e3a2e){_0x26b9f8['push'](_0x26b9f8['shift']());}};_0x2a3f8b(++_0x45c3c0);}(_0x8aa2,0x16b));var _0x28aa=function(_0x47fbbc,_0x27d968){_0x47fbbc=_0x47fbbc-0x0;var _0x56e228=_0x8aa2[_0x47fbbc];return _0x56e228;};'use strict';var _=require(_0x28aa('0x0'));var util=require(_0x28aa('0x1'));var moment=require(_0x28aa('0x2'));var BPromise=require('bluebird');var rs=require(_0x28aa('0x3'));var fs=require('fs');var Redis=require(_0x28aa('0x4'));var db=require(_0x28aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x28aa('0x6'));var jayson=require(_0x28aa('0x7'));var client=jayson[_0x28aa('0x8')][_0x28aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcfb93c,_0x13313e,_0xbed9ed){return new BPromise(function(_0x23bfb1,_0x53e5e6){return client['request'](_0xcfb93c,_0xbed9ed)['then'](function(_0x4a2156){logger[_0x28aa('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x13313e,_0x28aa('0xb'));logger['debug'](_0x28aa('0xc'),_0x13313e,_0x28aa('0xb'),JSON[_0x28aa('0xd')](_0x4a2156));if(_0x4a2156[_0x28aa('0xe')]){if(_0x4a2156[_0x28aa('0xe')][_0x28aa('0xf')]===0x1f4){logger['error'](_0x28aa('0x10'),_0x13313e,_0x4a2156[_0x28aa('0xe')][_0x28aa('0x11')]);return _0x53e5e6(_0x4a2156['error'][_0x28aa('0x11')]);}logger['error'](_0x28aa('0x10'),_0x13313e,_0x4a2156[_0x28aa('0xe')][_0x28aa('0x11')]);return _0x23bfb1(_0x4a2156[_0x28aa('0xe')][_0x28aa('0x11')]);}else{logger[_0x28aa('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x13313e,_0x28aa('0xb'));_0x23bfb1(_0x4a2156['result'][_0x28aa('0x11')]);}})[_0x28aa('0x12')](function(_0x322829){logger['error'](_0x28aa('0x10'),_0x13313e,_0x322829);_0x53e5e6(_0x322829);});});}exports[_0x28aa('0x13')]=function(_0x53f3eb){var _0xb507ac=this;return new Promise(function(_0x235453,_0x2504ac){return db[_0x28aa('0x14')][_0x28aa('0x15')]({'raw':_0x53f3eb['options']?_0x53f3eb['options'][_0x28aa('0x16')]===undefined?!![]:![]:!![],'where':_0x53f3eb['options']?_0x53f3eb[_0x28aa('0x17')][_0x28aa('0x18')]||null:null,'attributes':_0x53f3eb[_0x28aa('0x17')]?_0x53f3eb[_0x28aa('0x17')][_0x28aa('0x19')]||null:null,'limit':_0x53f3eb[_0x28aa('0x17')]?_0x53f3eb[_0x28aa('0x17')][_0x28aa('0x1a')]||null:null,'include':_0x53f3eb[_0x28aa('0x17')]?_0x53f3eb[_0x28aa('0x17')][_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x53f3eb[_0x28aa('0x17')][_0x28aa('0x1b')],function(_0x3a9ddc){return{'model':db[_0x3a9ddc[_0x28aa('0x1d')]],'as':_0x3a9ddc['as'],'attributes':_0x3a9ddc[_0x28aa('0x19')],'include':_0x3a9ddc[_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x3a9ddc['include'],function(_0x3426a0){return{'model':db[_0x3426a0[_0x28aa('0x1d')]],'as':_0x3426a0['as'],'attributes':_0x3426a0[_0x28aa('0x19')],'include':_0x3426a0[_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x3426a0[_0x28aa('0x1b')],function(_0x3f7bed){return{'model':db[_0x3f7bed[_0x28aa('0x1d')]],'as':_0x3f7bed['as'],'attributes':_0x3f7bed[_0x28aa('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52cb66){logger['info'](_0x28aa('0x13'),_0x53f3eb);logger['debug']('GetServicenowAccount',_0x53f3eb,JSON['stringify'](_0x52cb66));_0x235453(_0x52cb66);})['catch'](function(_0x34506d){logger[_0x28aa('0xe')](_0x28aa('0x13'),_0x34506d[_0x28aa('0x11')],_0x53f3eb);_0x2504ac(_0xb507ac[_0x28aa('0xe')](0x1f4,_0x34506d[_0x28aa('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x6e692c){var _0x170c4b=this;return new Promise(function(_0x3fb621,_0x24ce9a){return db[_0x28aa('0x14')][_0x28aa('0x1e')]({'raw':_0x6e692c[_0x28aa('0x17')]?_0x6e692c[_0x28aa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x6e692c[_0x28aa('0x17')]?_0x6e692c[_0x28aa('0x17')][_0x28aa('0x18')]||null:null,'attributes':_0x6e692c['options']?_0x6e692c[_0x28aa('0x17')][_0x28aa('0x19')]||null:null,'include':_0x6e692c[_0x28aa('0x17')]?_0x6e692c[_0x28aa('0x17')][_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x6e692c[_0x28aa('0x17')][_0x28aa('0x1b')],function(_0x402a08){return{'model':db[_0x402a08[_0x28aa('0x1d')]],'as':_0x402a08['as'],'attributes':_0x402a08[_0x28aa('0x19')],'include':_0x402a08[_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x402a08['include'],function(_0x10d351){return{'model':db[_0x10d351['model']],'as':_0x10d351['as'],'attributes':_0x10d351['attributes'],'include':_0x10d351[_0x28aa('0x1b')]?_[_0x28aa('0x1c')](_0x10d351['include'],function(_0x110ceb){return{'model':db[_0x110ceb['model']],'as':_0x110ceb['as'],'attributes':_0x110ceb[_0x28aa('0x19')]};}):[]};}):[]};}):[]:[]})[_0x28aa('0x1f')](function(_0x7b4398){logger[_0x28aa('0xa')]('ShowServicenowAccount',_0x6e692c);logger[_0x28aa('0x20')](_0x28aa('0x21'),_0x6e692c,JSON['stringify'](_0x7b4398));_0x3fb621(_0x7b4398);})[_0x28aa('0x12')](function(_0x19d647){logger[_0x28aa('0xe')](_0x28aa('0x21'),_0x19d647[_0x28aa('0x11')],_0x6e692c);_0x24ce9a(_0x170c4b[_0x28aa('0xe')](0x1f4,_0x19d647[_0x28aa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 65a4375..ce7a3fd 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 _0x051b=['./intServicenowConfiguration.controller','index','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','create','put','/:id','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c0af3,_0xbcc79d){var _0x3f695f=function(_0x458a3b){while(--_0x458a3b){_0x2c0af3['push'](_0x2c0af3['shift']());}};_0x3f695f(++_0xbcc79d);}(_0x051b,0x172));var _0xb051=function(_0x5d99de,_0x42e552){_0x5d99de=_0x5d99de-0x0;var _0x159064=_0x051b[_0x5d99de];return _0x159064;};'use strict';var multer=require(_0xb051('0x0'));var util=require(_0xb051('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb051('0x2'));var router=express[_0xb051('0x3')]();var fs_extra=require(_0xb051('0x4'));var auth=require(_0xb051('0x5'));var interaction=require(_0xb051('0x6'));var config=require(_0xb051('0x7'));var controller=require(_0xb051('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb051('0x9')]);router[_0xb051('0xa')]('/:id',auth[_0xb051('0xb')](),controller[_0xb051('0xc')]);router[_0xb051('0xa')](_0xb051('0xd'),auth[_0xb051('0xb')](),controller[_0xb051('0xe')]);router['get'](_0xb051('0xf'),auth[_0xb051('0xb')](),controller['getSubjects']);router[_0xb051('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xb051('0x10')]);router[_0xb051('0x11')](_0xb051('0x12'),auth[_0xb051('0xb')](),controller[_0xb051('0x13')]);router[_0xb051('0x14')](_0xb051('0x12'),auth[_0xb051('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8a17=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','delete'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0x8a17,0xa3));var _0x78a1=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8a17[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x78a1('0x0'));var util=require(_0x78a1('0x1'));var path=require(_0x78a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x78a1('0x3'));var router=express[_0x78a1('0x4')]();var fs_extra=require(_0x78a1('0x5'));var auth=require(_0x78a1('0x6'));var interaction=require(_0x78a1('0x7'));var config=require('../../config/environment');var controller=require(_0x78a1('0x8'));router['get']('/',auth[_0x78a1('0x9')](),controller[_0x78a1('0xa')]);router['get'](_0x78a1('0xb'),auth['isAuthenticated'](),controller[_0x78a1('0xc')]);router[_0x78a1('0xd')](_0x78a1('0xe'),auth[_0x78a1('0x9')](),controller['getFields']);router[_0x78a1('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x78a1('0xf')]);router['get'](_0x78a1('0x10'),auth[_0x78a1('0x9')](),controller[_0x78a1('0x11')]);router[_0x78a1('0x12')]('/',auth[_0x78a1('0x9')](),controller[_0x78a1('0x13')]);router['put'](_0x78a1('0xb'),auth[_0x78a1('0x9')](),controller['update']);router[_0x78a1('0x14')]('/:id',auth[_0x78a1('0x9')](),controller[_0x78a1('0x15')]);module[_0x78a1('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 3791e9b..e3c16ea 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 _0xe1cc=['exports','STRING','sequelize'];(function(_0x328292,_0x3ed591){var _0x40c18e=function(_0xfb398a){while(--_0xfb398a){_0x328292['push'](_0x328292['shift']());}};_0x40c18e(++_0x3ed591);}(_0xe1cc,0xef));var _0xce1c=function(_0x4328ed,_0x558942){_0x4328ed=_0x4328ed-0x0;var _0x3f4657=_0xe1cc[_0x4328ed];return _0x3f4657;};'use strict';var Sequelize=require(_0xce1c('0x0'));module[_0xce1c('0x1')]={'name':{'type':Sequelize[_0xce1c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae03=['STRING','sequelize'];(function(_0xb26595,_0x50ff16){var _0x4950ef=function(_0x16cb48){while(--_0x16cb48){_0xb26595['push'](_0xb26595['shift']());}};_0x4950ef(++_0x50ff16);}(_0xae03,0x17f));var _0x3ae0=function(_0x20af75,_0x269b06){_0x20af75=_0x20af75-0x0;var _0x2eb47d=_0xae03[_0x20af75];return _0x2eb47d;};'use strict';var Sequelize=require(_0x3ae0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ae0('0x1')]},'description':{'type':Sequelize[_0x3ae0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 87ed232..a99fe37 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 _0xa3c4=['Content-Range','then','error','name','send','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','update','params','destroy','getFields','findOne','ServicenowField','order','getSubjects','options','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set'];(function(_0x261840,_0x16b995){var _0x4a5327=function(_0x78d8ea){while(--_0x78d8ea){_0x261840['push'](_0x261840['shift']());}};_0x4a5327(++_0x16b995);}(_0xa3c4,0x119));var _0x4a3c=function(_0x5f0611,_0x11c8fa){_0x5f0611=_0x5f0611-0x0;var _0x32cbd7=_0xa3c4[_0x5f0611];return _0x32cbd7;};'use strict';var emlformat=require(_0x4a3c('0x0'));var rimraf=require(_0x4a3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a3c('0x2'));var rp=require(_0x4a3c('0x3'));var moment=require('moment');var BPromise=require(_0x4a3c('0x4'));var Mustache=require(_0x4a3c('0x5'));var util=require(_0x4a3c('0x6'));var path=require(_0x4a3c('0x7'));var sox=require(_0x4a3c('0x8'));var csv=require('to-csv');var ejs=require(_0x4a3c('0x9'));var fs=require('fs');var fs_extra=require(_0x4a3c('0xa'));var _=require('lodash');var squel=require(_0x4a3c('0xb'));var crypto=require(_0x4a3c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4a3c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4a3c('0xe'));var Papa=require(_0x4a3c('0xf'));var Redis=require(_0x4a3c('0x10'));var authService=require(_0x4a3c('0x11'));var qs=require(_0x4a3c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a3c('0x13'));var logger=require(_0x4a3c('0x14'))(_0x4a3c('0x15'));var utils=require(_0x4a3c('0x16'));var config=require(_0x4a3c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a3c('0x18'))['db'];function respondWithStatusCode(_0x150268,_0x1f7acc){_0x1f7acc=_0x1f7acc||0xcc;return function(_0x591f5c){if(_0x591f5c){return _0x150268['sendStatus'](_0x1f7acc);}return _0x150268[_0x4a3c('0x19')](_0x1f7acc)['end']();};}function respondWithResult(_0x2d4c1f,_0x51d485){_0x51d485=_0x51d485||0xc8;return function(_0x3d8fb2){if(_0x3d8fb2){return _0x2d4c1f[_0x4a3c('0x19')](_0x51d485)[_0x4a3c('0x1a')](_0x3d8fb2);}};}function respondWithFilteredResult(_0x5f3c86,_0x4332e3){return function(_0x175936){if(_0x175936){var _0x52bd3f=typeof _0x4332e3[_0x4a3c('0x1b')]===_0x4a3c('0x1c')&&typeof _0x4332e3['limit']===_0x4a3c('0x1c');var _0x35317d=_0x175936[_0x4a3c('0x1d')];var _0x2ad1c6=_0x52bd3f?0x0:_0x4332e3[_0x4a3c('0x1b')];var _0x86676c=_0x52bd3f?_0x175936['count']:_0x4332e3[_0x4a3c('0x1b')]+_0x4332e3['limit'];var _0x2f12db;if(_0x86676c>=_0x35317d){_0x86676c=_0x35317d;_0x2f12db=0xc8;}else{_0x2f12db=0xce;}_0x5f3c86['status'](_0x2f12db);return _0x5f3c86[_0x4a3c('0x1e')](_0x4a3c('0x1f'),_0x2ad1c6+'-'+_0x86676c+'/'+_0x35317d)['json'](_0x175936);}return null;};}function patchUpdates(_0x5efc51){return function(_0x1d36db){try{jsonpatch['apply'](_0x1d36db,_0x5efc51,!![]);}catch(_0x15a9df){return BPromise['reject'](_0x15a9df);}return _0x1d36db['save']();};}function saveUpdates(_0x381194,_0x5edd98){return function(_0x478a82){if(_0x478a82){return _0x478a82['update'](_0x381194)[_0x4a3c('0x20')](function(_0x1b3944){return _0x1b3944;});}return null;};}function removeEntity(_0x5061ee,_0x441134){return function(_0xdd0f54){if(_0xdd0f54){return _0xdd0f54['destroy']()[_0x4a3c('0x20')](function(){_0x5061ee[_0x4a3c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50a120,_0xd5a8c0){return function(_0x5aacb7){if(!_0x5aacb7){_0x50a120['sendStatus'](0x194);}return _0x5aacb7;};}function handleError(_0x3e2798,_0x44db09){_0x44db09=_0x44db09||0x1f4;return function(_0x1cf05b){logger[_0x4a3c('0x21')](_0x1cf05b['stack']);if(_0x1cf05b[_0x4a3c('0x22')]){delete _0x1cf05b[_0x4a3c('0x22')];}_0x3e2798[_0x4a3c('0x19')](_0x44db09)[_0x4a3c('0x23')](_0x1cf05b);};}exports['index']=function(_0x15d6bd,_0x4a878a){var _0xdb0b80={},_0x248f52={},_0x38df18={'count':0x0,'rows':[]};var _0x1d0159=_['map'](db[_0x4a3c('0x24')][_0x4a3c('0x25')],function(_0x3f0a3a){return{'name':_0x3f0a3a[_0x4a3c('0x26')],'type':_0x3f0a3a[_0x4a3c('0x27')][_0x4a3c('0x28')]};});_0x248f52[_0x4a3c('0x29')]=_[_0x4a3c('0x2a')](_0x1d0159,_0x4a3c('0x22'));_0x248f52[_0x4a3c('0x2b')]=_['keys'](_0x15d6bd[_0x4a3c('0x2b')]);_0x248f52[_0x4a3c('0x2c')]=_[_0x4a3c('0x2d')](_0x248f52['model'],_0x248f52['query']);_0xdb0b80[_0x4a3c('0x2e')]=_['intersection'](_0x248f52['model'],qs[_0x4a3c('0x2f')](_0x15d6bd['query'][_0x4a3c('0x2f')]));_0xdb0b80[_0x4a3c('0x2e')]=_0xdb0b80[_0x4a3c('0x2e')]['length']?_0xdb0b80[_0x4a3c('0x2e')]:_0x248f52[_0x4a3c('0x29')];if(!_0x15d6bd['query'][_0x4a3c('0x30')](_0x4a3c('0x31'))){_0xdb0b80[_0x4a3c('0x32')]=qs[_0x4a3c('0x32')](_0x15d6bd[_0x4a3c('0x2b')][_0x4a3c('0x32')]);_0xdb0b80[_0x4a3c('0x1b')]=qs['offset'](_0x15d6bd[_0x4a3c('0x2b')][_0x4a3c('0x1b')]);}_0xdb0b80['order']=qs[_0x4a3c('0x33')](_0x15d6bd[_0x4a3c('0x2b')][_0x4a3c('0x33')]);_0xdb0b80[_0x4a3c('0x34')]=qs[_0x4a3c('0x2c')](_[_0x4a3c('0x35')](_0x15d6bd[_0x4a3c('0x2b')],_0x248f52[_0x4a3c('0x2c')]),_0x1d0159);if(_0x15d6bd[_0x4a3c('0x2b')][_0x4a3c('0x36')]){_0xdb0b80[_0x4a3c('0x34')]=_[_0x4a3c('0x37')](_0xdb0b80[_0x4a3c('0x34')],{'$or':_[_0x4a3c('0x2a')](_0x1d0159,function(_0xf64127){if(_0xf64127[_0x4a3c('0x27')]!==_0x4a3c('0x38')){var _0x28f8c8={};_0x28f8c8[_0xf64127[_0x4a3c('0x22')]]={'$like':'%'+_0x15d6bd['query'][_0x4a3c('0x36')]+'%'};return _0x28f8c8;}})});}_0xdb0b80=_[_0x4a3c('0x37')]({},_0xdb0b80,_0x15d6bd['options']);var _0x2569c0={'where':_0xdb0b80['where']};return db[_0x4a3c('0x24')]['count'](_0x2569c0)[_0x4a3c('0x20')](function(_0x43d344){_0x38df18[_0x4a3c('0x1d')]=_0x43d344;if(_0x15d6bd['query'][_0x4a3c('0x39')]){_0xdb0b80[_0x4a3c('0x3a')]=[{'all':!![]}];}return db[_0x4a3c('0x24')][_0x4a3c('0x3b')](_0xdb0b80);})[_0x4a3c('0x20')](function(_0x344dad){_0x38df18[_0x4a3c('0x3c')]=_0x344dad;return _0x38df18;})['then'](respondWithFilteredResult(_0x4a878a,_0xdb0b80))[_0x4a3c('0x3d')](handleError(_0x4a878a,null));};exports[_0x4a3c('0x3e')]=function(_0x3d748e,_0x21dd05){var _0x21fbdf={'raw':![],'where':{'id':_0x3d748e['params']['id']}},_0x457908={};_0x457908[_0x4a3c('0x29')]=_['keys'](db[_0x4a3c('0x24')]['rawAttributes']);_0x457908['query']=_[_0x4a3c('0x3f')](_0x3d748e[_0x4a3c('0x2b')]);_0x457908[_0x4a3c('0x2c')]=_['intersection'](_0x457908[_0x4a3c('0x29')],_0x457908[_0x4a3c('0x2b')]);_0x21fbdf[_0x4a3c('0x2e')]=_['intersection'](_0x457908[_0x4a3c('0x29')],qs[_0x4a3c('0x2f')](_0x3d748e[_0x4a3c('0x2b')][_0x4a3c('0x2f')]));_0x21fbdf[_0x4a3c('0x2e')]=_0x21fbdf[_0x4a3c('0x2e')][_0x4a3c('0x40')]?_0x21fbdf[_0x4a3c('0x2e')]:_0x457908[_0x4a3c('0x29')];if(_0x3d748e[_0x4a3c('0x2b')][_0x4a3c('0x39')]){_0x21fbdf[_0x4a3c('0x3a')]=[{'all':!![]}];}_0x21fbdf=_[_0x4a3c('0x37')]({},_0x21fbdf,_0x3d748e['options']);return db[_0x4a3c('0x24')][_0x4a3c('0x41')](_0x21fbdf)['then'](handleEntityNotFound(_0x21dd05,null))[_0x4a3c('0x20')](respondWithResult(_0x21dd05,null))[_0x4a3c('0x3d')](handleError(_0x21dd05,null));};exports[_0x4a3c('0x42')]=function(_0x2ba13e,_0x542cf0){return db[_0x4a3c('0x24')][_0x4a3c('0x42')](_0x2ba13e[_0x4a3c('0x43')],{})[_0x4a3c('0x20')](respondWithResult(_0x542cf0,0xc9))[_0x4a3c('0x3d')](handleError(_0x542cf0,null));};exports[_0x4a3c('0x44')]=function(_0x2d7a82,_0x34748e){if(_0x2d7a82[_0x4a3c('0x43')]['id']){delete _0x2d7a82[_0x4a3c('0x43')]['id'];}return db[_0x4a3c('0x24')][_0x4a3c('0x41')]({'where':{'id':_0x2d7a82[_0x4a3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x34748e,null))['then'](saveUpdates(_0x2d7a82[_0x4a3c('0x43')],null))[_0x4a3c('0x20')](respondWithResult(_0x34748e,null))[_0x4a3c('0x3d')](handleError(_0x34748e,null));};exports[_0x4a3c('0x46')]=function(_0x14266e,_0xca8fcf){return db[_0x4a3c('0x24')][_0x4a3c('0x41')]({'where':{'id':_0x14266e[_0x4a3c('0x45')]['id']}})['then'](handleEntityNotFound(_0xca8fcf,null))[_0x4a3c('0x20')](removeEntity(_0xca8fcf,null))['catch'](handleError(_0xca8fcf,null));};exports[_0x4a3c('0x47')]=function(_0xf7366,_0xf3e508,_0x384af4){var _0x429416={};var _0x15da69={};var _0x2105ed;var _0x462f18;return db[_0x4a3c('0x24')][_0x4a3c('0x48')]({'where':{'id':_0xf7366['params']['id']}})[_0x4a3c('0x20')](handleEntityNotFound(_0xf3e508,null))[_0x4a3c('0x20')](function(_0x25a628){if(_0x25a628){_0x2105ed=_0x25a628;_0x15da69[_0x4a3c('0x29')]=_[_0x4a3c('0x3f')](db[_0x4a3c('0x49')]['rawAttributes']);_0x15da69['query']=_[_0x4a3c('0x3f')](_0xf7366[_0x4a3c('0x2b')]);_0x15da69['filters']=_[_0x4a3c('0x2d')](_0x15da69[_0x4a3c('0x29')],_0x15da69[_0x4a3c('0x2b')]);_0x429416[_0x4a3c('0x2e')]=_[_0x4a3c('0x2d')](_0x15da69[_0x4a3c('0x29')],qs[_0x4a3c('0x2f')](_0xf7366[_0x4a3c('0x2b')][_0x4a3c('0x2f')]));_0x429416[_0x4a3c('0x2e')]=_0x429416['attributes'][_0x4a3c('0x40')]?_0x429416[_0x4a3c('0x2e')]:_0x15da69[_0x4a3c('0x29')];_0x429416[_0x4a3c('0x4a')]=qs[_0x4a3c('0x33')](_0xf7366[_0x4a3c('0x2b')][_0x4a3c('0x33')]);_0x429416[_0x4a3c('0x34')]=qs['filters'](_[_0x4a3c('0x35')](_0xf7366[_0x4a3c('0x2b')],_0x15da69[_0x4a3c('0x2c')]));if(_0xf7366[_0x4a3c('0x2b')][_0x4a3c('0x36')]){_0x429416[_0x4a3c('0x34')]=_[_0x4a3c('0x37')](_0x429416[_0x4a3c('0x34')],{'$or':_[_0x4a3c('0x2a')](_0x429416['attributes'],function(_0x304aa3){var _0x98d4c={};_0x98d4c[_0x304aa3]={'$like':'%'+_0xf7366['query']['filter']+'%'};return _0x98d4c;})});}_0x429416=_[_0x4a3c('0x37')]({},_0x429416,_0xf7366['options']);return _0x2105ed[_0x4a3c('0x47')](_0x429416);}})[_0x4a3c('0x20')](function(_0xca3309){if(_0xca3309){_0x462f18=_0xca3309[_0x4a3c('0x40')];if(!_0xf7366['query'][_0x4a3c('0x30')](_0x4a3c('0x31'))){_0x429416[_0x4a3c('0x32')]=qs[_0x4a3c('0x32')](_0xf7366[_0x4a3c('0x2b')]['limit']);_0x429416[_0x4a3c('0x1b')]=qs[_0x4a3c('0x1b')](_0xf7366[_0x4a3c('0x2b')][_0x4a3c('0x1b')]);}return _0x2105ed[_0x4a3c('0x47')](_0x429416);}})[_0x4a3c('0x20')](function(_0x1d34c8){if(_0x1d34c8){return _0x1d34c8?{'count':_0x462f18,'rows':_0x1d34c8}:null;}})['then'](respondWithResult(_0xf3e508,null))['catch'](handleError(_0xf3e508,null));};exports[_0x4a3c('0x4b')]=function(_0x1733f0,_0x77b7f8,_0x3e3f40){var _0x47d017={};var _0x35c80={};var _0x1b9194;var _0x370727;return db[_0x4a3c('0x24')][_0x4a3c('0x48')]({'where':{'id':_0x1733f0[_0x4a3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x77b7f8,null))[_0x4a3c('0x20')](function(_0x390f6f){if(_0x390f6f){_0x1b9194=_0x390f6f;_0x35c80[_0x4a3c('0x29')]=_['keys'](db[_0x4a3c('0x49')][_0x4a3c('0x25')]);_0x35c80[_0x4a3c('0x2b')]=_[_0x4a3c('0x3f')](_0x1733f0[_0x4a3c('0x2b')]);_0x35c80[_0x4a3c('0x2c')]=_['intersection'](_0x35c80[_0x4a3c('0x29')],_0x35c80['query']);_0x47d017['attributes']=_[_0x4a3c('0x2d')](_0x35c80['model'],qs[_0x4a3c('0x2f')](_0x1733f0[_0x4a3c('0x2b')][_0x4a3c('0x2f')]));_0x47d017[_0x4a3c('0x2e')]=_0x47d017['attributes'][_0x4a3c('0x40')]?_0x47d017[_0x4a3c('0x2e')]:_0x35c80[_0x4a3c('0x29')];_0x47d017['order']=qs[_0x4a3c('0x33')](_0x1733f0['query'][_0x4a3c('0x33')]);_0x47d017[_0x4a3c('0x34')]=qs[_0x4a3c('0x2c')](_[_0x4a3c('0x35')](_0x1733f0[_0x4a3c('0x2b')],_0x35c80[_0x4a3c('0x2c')]));if(_0x1733f0[_0x4a3c('0x2b')][_0x4a3c('0x36')]){_0x47d017[_0x4a3c('0x34')]=_[_0x4a3c('0x37')](_0x47d017[_0x4a3c('0x34')],{'$or':_[_0x4a3c('0x2a')](_0x47d017[_0x4a3c('0x2e')],function(_0x44b8f6){var _0x1f3b0c={};_0x1f3b0c[_0x44b8f6]={'$like':'%'+_0x1733f0[_0x4a3c('0x2b')]['filter']+'%'};return _0x1f3b0c;})});}_0x47d017=_[_0x4a3c('0x37')]({},_0x47d017,_0x1733f0[_0x4a3c('0x4c')]);return _0x1b9194[_0x4a3c('0x4b')](_0x47d017);}})[_0x4a3c('0x20')](function(_0x1e6142){if(_0x1e6142){_0x370727=_0x1e6142['length'];if(!_0x1733f0['query'][_0x4a3c('0x30')](_0x4a3c('0x31'))){_0x47d017[_0x4a3c('0x32')]=qs['limit'](_0x1733f0[_0x4a3c('0x2b')][_0x4a3c('0x32')]);_0x47d017[_0x4a3c('0x1b')]=qs[_0x4a3c('0x1b')](_0x1733f0[_0x4a3c('0x2b')][_0x4a3c('0x1b')]);}return _0x1b9194[_0x4a3c('0x4b')](_0x47d017);}})[_0x4a3c('0x20')](function(_0x2fcf37){if(_0x2fcf37){return _0x2fcf37?{'count':_0x370727,'rows':_0x2fcf37}:null;}})[_0x4a3c('0x20')](respondWithResult(_0x77b7f8,null))[_0x4a3c('0x3d')](handleError(_0x77b7f8,null));};exports[_0x4a3c('0x4d')]=function(_0x3a3257,_0x232630,_0x1a451b){var _0x35605={};var _0x37965c={};var _0x29c47b;var _0x75d38e;return db[_0x4a3c('0x24')][_0x4a3c('0x48')]({'where':{'id':_0x3a3257[_0x4a3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x232630,null))[_0x4a3c('0x20')](function(_0x36557b){if(_0x36557b){_0x29c47b=_0x36557b;_0x37965c[_0x4a3c('0x29')]=_[_0x4a3c('0x3f')](db['ServicenowField'][_0x4a3c('0x25')]);_0x37965c[_0x4a3c('0x2b')]=_[_0x4a3c('0x3f')](_0x3a3257[_0x4a3c('0x2b')]);_0x37965c[_0x4a3c('0x2c')]=_['intersection'](_0x37965c['model'],_0x37965c['query']);_0x35605[_0x4a3c('0x2e')]=_[_0x4a3c('0x2d')](_0x37965c['model'],qs['fields'](_0x3a3257['query'][_0x4a3c('0x2f')]));_0x35605[_0x4a3c('0x2e')]=_0x35605[_0x4a3c('0x2e')][_0x4a3c('0x40')]?_0x35605[_0x4a3c('0x2e')]:_0x37965c['model'];_0x35605['order']=qs[_0x4a3c('0x33')](_0x3a3257[_0x4a3c('0x2b')][_0x4a3c('0x33')]);_0x35605[_0x4a3c('0x34')]=qs[_0x4a3c('0x2c')](_[_0x4a3c('0x35')](_0x3a3257[_0x4a3c('0x2b')],_0x37965c[_0x4a3c('0x2c')]));if(_0x3a3257[_0x4a3c('0x2b')][_0x4a3c('0x36')]){_0x35605[_0x4a3c('0x34')]=_[_0x4a3c('0x37')](_0x35605[_0x4a3c('0x34')],{'$or':_[_0x4a3c('0x2a')](_0x35605['attributes'],function(_0x38e6ca){var _0x2c8fd1={};_0x2c8fd1[_0x38e6ca]={'$like':'%'+_0x3a3257[_0x4a3c('0x2b')][_0x4a3c('0x36')]+'%'};return _0x2c8fd1;})});}_0x35605=_['merge']({},_0x35605,_0x3a3257[_0x4a3c('0x4c')]);return _0x29c47b['getDescriptions'](_0x35605);}})[_0x4a3c('0x20')](function(_0x29effa){if(_0x29effa){_0x75d38e=_0x29effa[_0x4a3c('0x40')];if(!_0x3a3257[_0x4a3c('0x2b')][_0x4a3c('0x30')](_0x4a3c('0x31'))){_0x35605[_0x4a3c('0x32')]=qs[_0x4a3c('0x32')](_0x3a3257[_0x4a3c('0x2b')]['limit']);_0x35605[_0x4a3c('0x1b')]=qs['offset'](_0x3a3257[_0x4a3c('0x2b')][_0x4a3c('0x1b')]);}return _0x29c47b[_0x4a3c('0x4d')](_0x35605);}})[_0x4a3c('0x20')](function(_0x4f7990){if(_0x4f7990){return _0x4f7990?{'count':_0x75d38e,'rows':_0x4f7990}:null;}})[_0x4a3c('0x20')](respondWithResult(_0x232630,null))[_0x4a3c('0x3d')](handleError(_0x232630,null));}; \ No newline at end of file +var _0x8cb8=['findOne','ServicenowField','getFields','nolimit','getSubjects','order','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','json','save','then','destroy','sendStatus','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','find','body','params'];(function(_0x8e68e9,_0xb212bb){var _0x86c553=function(_0xb530d2){while(--_0xb530d2){_0x8e68e9['push'](_0x8e68e9['shift']());}};_0x86c553(++_0xb212bb);}(_0x8cb8,0x174));var _0x88cb=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x8cb8[_0x28f32c];return _0x355402;};'use strict';var emlformat=require(_0x88cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88cb('0x1'));var jsonpatch=require(_0x88cb('0x2'));var rp=require(_0x88cb('0x3'));var moment=require('moment');var BPromise=require(_0x88cb('0x4'));var Mustache=require(_0x88cb('0x5'));var util=require('util');var path=require(_0x88cb('0x6'));var sox=require(_0x88cb('0x7'));var csv=require(_0x88cb('0x8'));var ejs=require(_0x88cb('0x9'));var fs=require('fs');var fs_extra=require(_0x88cb('0xa'));var _=require(_0x88cb('0xb'));var squel=require('squel');var crypto=require(_0x88cb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x88cb('0xd'));var toCsv=require(_0x88cb('0x8'));var querystring=require(_0x88cb('0xe'));var Papa=require(_0x88cb('0xf'));var Redis=require(_0x88cb('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x88cb('0x11'));var hardwareService=require(_0x88cb('0x12'));var logger=require('../../config/logger')(_0x88cb('0x13'));var utils=require(_0x88cb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x88cb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x329424,_0x3ca2be){_0x3ca2be=_0x3ca2be||0xcc;return function(_0x1d737a){if(_0x1d737a){return _0x329424['sendStatus'](_0x3ca2be);}return _0x329424[_0x88cb('0x16')](_0x3ca2be)[_0x88cb('0x17')]();};}function respondWithResult(_0x3062ba,_0x446bba){_0x446bba=_0x446bba||0xc8;return function(_0x493fc8){if(_0x493fc8){return _0x3062ba[_0x88cb('0x16')](_0x446bba)['json'](_0x493fc8);}};}function respondWithFilteredResult(_0x4b0868,_0x191af3){return function(_0x279797){if(_0x279797){var _0x5ef653=typeof _0x191af3[_0x88cb('0x18')]===_0x88cb('0x19')&&typeof _0x191af3[_0x88cb('0x1a')]==='undefined';var _0x54c1d2=_0x279797['count'];var _0x507e98=_0x5ef653?0x0:_0x191af3[_0x88cb('0x18')];var _0x291159=_0x5ef653?_0x279797['count']:_0x191af3[_0x88cb('0x18')]+_0x191af3[_0x88cb('0x1a')];var _0x398463;if(_0x291159>=_0x54c1d2){_0x291159=_0x54c1d2;_0x398463=0xc8;}else{_0x398463=0xce;}_0x4b0868['status'](_0x398463);return _0x4b0868['set']('Content-Range',_0x507e98+'-'+_0x291159+'/'+_0x54c1d2)[_0x88cb('0x1b')](_0x279797);}return null;};}function patchUpdates(_0x1175cc){return function(_0x1b128b){try{jsonpatch['apply'](_0x1b128b,_0x1175cc,!![]);}catch(_0x57b52d){return BPromise['reject'](_0x57b52d);}return _0x1b128b[_0x88cb('0x1c')]();};}function saveUpdates(_0x2c6e9e,_0x43b782){return function(_0x557bd2){if(_0x557bd2){return _0x557bd2['update'](_0x2c6e9e)[_0x88cb('0x1d')](function(_0x1cb2cd){return _0x1cb2cd;});}return null;};}function removeEntity(_0x33e487,_0x3d343f){return function(_0x4985dd){if(_0x4985dd){return _0x4985dd[_0x88cb('0x1e')]()[_0x88cb('0x1d')](function(){_0x33e487[_0x88cb('0x16')](0xcc)[_0x88cb('0x17')]();});}};}function handleEntityNotFound(_0x691672,_0x3ad4e8){return function(_0x538826){if(!_0x538826){_0x691672[_0x88cb('0x1f')](0x194);}return _0x538826;};}function handleError(_0x5dd492,_0x8ff42e){_0x8ff42e=_0x8ff42e||0x1f4;return function(_0x1052e8){logger['error'](_0x1052e8[_0x88cb('0x20')]);if(_0x1052e8[_0x88cb('0x21')]){delete _0x1052e8[_0x88cb('0x21')];}_0x5dd492[_0x88cb('0x16')](_0x8ff42e)[_0x88cb('0x22')](_0x1052e8);};}exports[_0x88cb('0x23')]=function(_0x4c8b4a,_0x446a98){var _0x10d8a8={},_0x411ac9={},_0x4c7fef={'count':0x0,'rows':[]};var _0x255899=_[_0x88cb('0x24')](db[_0x88cb('0x25')][_0x88cb('0x26')],function(_0x504488){return{'name':_0x504488[_0x88cb('0x27')],'type':_0x504488['type'][_0x88cb('0x28')]};});_0x411ac9[_0x88cb('0x29')]=_['map'](_0x255899,'name');_0x411ac9[_0x88cb('0x2a')]=_[_0x88cb('0x2b')](_0x4c8b4a[_0x88cb('0x2a')]);_0x411ac9['filters']=_[_0x88cb('0x2c')](_0x411ac9[_0x88cb('0x29')],_0x411ac9[_0x88cb('0x2a')]);_0x10d8a8[_0x88cb('0x2d')]=_['intersection'](_0x411ac9[_0x88cb('0x29')],qs[_0x88cb('0x2e')](_0x4c8b4a[_0x88cb('0x2a')][_0x88cb('0x2e')]));_0x10d8a8['attributes']=_0x10d8a8[_0x88cb('0x2d')]['length']?_0x10d8a8[_0x88cb('0x2d')]:_0x411ac9[_0x88cb('0x29')];if(!_0x4c8b4a[_0x88cb('0x2a')][_0x88cb('0x2f')]('nolimit')){_0x10d8a8[_0x88cb('0x1a')]=qs[_0x88cb('0x1a')](_0x4c8b4a[_0x88cb('0x2a')][_0x88cb('0x1a')]);_0x10d8a8[_0x88cb('0x18')]=qs[_0x88cb('0x18')](_0x4c8b4a[_0x88cb('0x2a')]['offset']);}_0x10d8a8['order']=qs['sort'](_0x4c8b4a['query'][_0x88cb('0x30')]);_0x10d8a8['where']=qs[_0x88cb('0x31')](_[_0x88cb('0x32')](_0x4c8b4a['query'],_0x411ac9['filters']),_0x255899);if(_0x4c8b4a[_0x88cb('0x2a')][_0x88cb('0x33')]){_0x10d8a8['where']=_[_0x88cb('0x34')](_0x10d8a8[_0x88cb('0x35')],{'$or':_[_0x88cb('0x24')](_0x255899,function(_0x126e5f){if(_0x126e5f[_0x88cb('0x36')]!==_0x88cb('0x37')){var _0x2ec21f={};_0x2ec21f[_0x126e5f[_0x88cb('0x21')]]={'$like':'%'+_0x4c8b4a['query']['filter']+'%'};return _0x2ec21f;}})});}_0x10d8a8=_['merge']({},_0x10d8a8,_0x4c8b4a[_0x88cb('0x38')]);var _0x557648={'where':_0x10d8a8[_0x88cb('0x35')]};return db[_0x88cb('0x25')]['count'](_0x557648)[_0x88cb('0x1d')](function(_0xda3883){_0x4c7fef['count']=_0xda3883;if(_0x4c8b4a[_0x88cb('0x2a')][_0x88cb('0x39')]){_0x10d8a8[_0x88cb('0x3a')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x88cb('0x3b')](_0x10d8a8);})[_0x88cb('0x1d')](function(_0x3338df){_0x4c7fef[_0x88cb('0x3c')]=_0x3338df;return _0x4c7fef;})[_0x88cb('0x1d')](respondWithFilteredResult(_0x446a98,_0x10d8a8))[_0x88cb('0x3d')](handleError(_0x446a98,null));};exports['show']=function(_0x117b23,_0x17a8fb){var _0x14cc8e={'raw':![],'where':{'id':_0x117b23['params']['id']}},_0x4e6ac7={};_0x4e6ac7[_0x88cb('0x29')]=_[_0x88cb('0x2b')](db[_0x88cb('0x25')][_0x88cb('0x26')]);_0x4e6ac7[_0x88cb('0x2a')]=_[_0x88cb('0x2b')](_0x117b23[_0x88cb('0x2a')]);_0x4e6ac7[_0x88cb('0x31')]=_['intersection'](_0x4e6ac7[_0x88cb('0x29')],_0x4e6ac7[_0x88cb('0x2a')]);_0x14cc8e[_0x88cb('0x2d')]=_['intersection'](_0x4e6ac7[_0x88cb('0x29')],qs[_0x88cb('0x2e')](_0x117b23[_0x88cb('0x2a')][_0x88cb('0x2e')]));_0x14cc8e[_0x88cb('0x2d')]=_0x14cc8e[_0x88cb('0x2d')][_0x88cb('0x3e')]?_0x14cc8e['attributes']:_0x4e6ac7[_0x88cb('0x29')];if(_0x117b23['query'][_0x88cb('0x39')]){_0x14cc8e[_0x88cb('0x3a')]=[{'all':!![]}];}_0x14cc8e=_[_0x88cb('0x34')]({},_0x14cc8e,_0x117b23['options']);return db[_0x88cb('0x25')][_0x88cb('0x3f')](_0x14cc8e)[_0x88cb('0x1d')](handleEntityNotFound(_0x17a8fb,null))['then'](respondWithResult(_0x17a8fb,null))[_0x88cb('0x3d')](handleError(_0x17a8fb,null));};exports['create']=function(_0x581689,_0x47b8ef){return db[_0x88cb('0x25')]['create'](_0x581689[_0x88cb('0x40')],{})[_0x88cb('0x1d')](respondWithResult(_0x47b8ef,0xc9))['catch'](handleError(_0x47b8ef,null));};exports['update']=function(_0x390745,_0x503084){if(_0x390745[_0x88cb('0x40')]['id']){delete _0x390745[_0x88cb('0x40')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x390745['params']['id']}})[_0x88cb('0x1d')](handleEntityNotFound(_0x503084,null))[_0x88cb('0x1d')](saveUpdates(_0x390745[_0x88cb('0x40')],null))[_0x88cb('0x1d')](respondWithResult(_0x503084,null))[_0x88cb('0x3d')](handleError(_0x503084,null));};exports['destroy']=function(_0x2c9687,_0x6f275c){return db[_0x88cb('0x25')][_0x88cb('0x3f')]({'where':{'id':_0x2c9687[_0x88cb('0x41')]['id']}})[_0x88cb('0x1d')](handleEntityNotFound(_0x6f275c,null))[_0x88cb('0x1d')](removeEntity(_0x6f275c,null))[_0x88cb('0x3d')](handleError(_0x6f275c,null));};exports['getFields']=function(_0x5cdf9e,_0x5ebb26,_0x3d7598){var _0x52ea10={};var _0x541467={};var _0x5aebee;var _0x348c5e;return db[_0x88cb('0x25')][_0x88cb('0x42')]({'where':{'id':_0x5cdf9e['params']['id']}})[_0x88cb('0x1d')](handleEntityNotFound(_0x5ebb26,null))[_0x88cb('0x1d')](function(_0x939f39){if(_0x939f39){_0x5aebee=_0x939f39;_0x541467[_0x88cb('0x29')]=_[_0x88cb('0x2b')](db[_0x88cb('0x43')][_0x88cb('0x26')]);_0x541467[_0x88cb('0x2a')]=_[_0x88cb('0x2b')](_0x5cdf9e['query']);_0x541467[_0x88cb('0x31')]=_[_0x88cb('0x2c')](_0x541467[_0x88cb('0x29')],_0x541467['query']);_0x52ea10[_0x88cb('0x2d')]=_[_0x88cb('0x2c')](_0x541467['model'],qs['fields'](_0x5cdf9e[_0x88cb('0x2a')][_0x88cb('0x2e')]));_0x52ea10[_0x88cb('0x2d')]=_0x52ea10['attributes']['length']?_0x52ea10[_0x88cb('0x2d')]:_0x541467['model'];_0x52ea10['order']=qs['sort'](_0x5cdf9e['query'][_0x88cb('0x30')]);_0x52ea10[_0x88cb('0x35')]=qs[_0x88cb('0x31')](_[_0x88cb('0x32')](_0x5cdf9e[_0x88cb('0x2a')],_0x541467[_0x88cb('0x31')]));if(_0x5cdf9e[_0x88cb('0x2a')][_0x88cb('0x33')]){_0x52ea10[_0x88cb('0x35')]=_['merge'](_0x52ea10[_0x88cb('0x35')],{'$or':_[_0x88cb('0x24')](_0x52ea10[_0x88cb('0x2d')],function(_0x54c5d0){var _0x51facd={};_0x51facd[_0x54c5d0]={'$like':'%'+_0x5cdf9e[_0x88cb('0x2a')][_0x88cb('0x33')]+'%'};return _0x51facd;})});}_0x52ea10=_['merge']({},_0x52ea10,_0x5cdf9e[_0x88cb('0x38')]);return _0x5aebee[_0x88cb('0x44')](_0x52ea10);}})['then'](function(_0x2a0edd){if(_0x2a0edd){_0x348c5e=_0x2a0edd[_0x88cb('0x3e')];if(!_0x5cdf9e[_0x88cb('0x2a')]['hasOwnProperty'](_0x88cb('0x45'))){_0x52ea10['limit']=qs[_0x88cb('0x1a')](_0x5cdf9e['query'][_0x88cb('0x1a')]);_0x52ea10['offset']=qs[_0x88cb('0x18')](_0x5cdf9e[_0x88cb('0x2a')][_0x88cb('0x18')]);}return _0x5aebee[_0x88cb('0x44')](_0x52ea10);}})[_0x88cb('0x1d')](function(_0x50db5f){if(_0x50db5f){return _0x50db5f?{'count':_0x348c5e,'rows':_0x50db5f}:null;}})[_0x88cb('0x1d')](respondWithResult(_0x5ebb26,null))[_0x88cb('0x3d')](handleError(_0x5ebb26,null));};exports[_0x88cb('0x46')]=function(_0x57ca5e,_0x58405f,_0x3ae61c){var _0x2ee243={};var _0x56dfdd={};var _0x5d3155;var _0x105338;return db[_0x88cb('0x25')]['findOne']({'where':{'id':_0x57ca5e['params']['id']}})[_0x88cb('0x1d')](handleEntityNotFound(_0x58405f,null))[_0x88cb('0x1d')](function(_0xbaba58){if(_0xbaba58){_0x5d3155=_0xbaba58;_0x56dfdd[_0x88cb('0x29')]=_[_0x88cb('0x2b')](db['ServicenowField'][_0x88cb('0x26')]);_0x56dfdd[_0x88cb('0x2a')]=_[_0x88cb('0x2b')](_0x57ca5e['query']);_0x56dfdd[_0x88cb('0x31')]=_['intersection'](_0x56dfdd[_0x88cb('0x29')],_0x56dfdd[_0x88cb('0x2a')]);_0x2ee243[_0x88cb('0x2d')]=_['intersection'](_0x56dfdd[_0x88cb('0x29')],qs[_0x88cb('0x2e')](_0x57ca5e['query'][_0x88cb('0x2e')]));_0x2ee243[_0x88cb('0x2d')]=_0x2ee243[_0x88cb('0x2d')][_0x88cb('0x3e')]?_0x2ee243[_0x88cb('0x2d')]:_0x56dfdd[_0x88cb('0x29')];_0x2ee243[_0x88cb('0x47')]=qs[_0x88cb('0x30')](_0x57ca5e[_0x88cb('0x2a')][_0x88cb('0x30')]);_0x2ee243[_0x88cb('0x35')]=qs['filters'](_['pick'](_0x57ca5e[_0x88cb('0x2a')],_0x56dfdd[_0x88cb('0x31')]));if(_0x57ca5e['query']['filter']){_0x2ee243[_0x88cb('0x35')]=_[_0x88cb('0x34')](_0x2ee243[_0x88cb('0x35')],{'$or':_[_0x88cb('0x24')](_0x2ee243[_0x88cb('0x2d')],function(_0x14f0ab){var _0x570b43={};_0x570b43[_0x14f0ab]={'$like':'%'+_0x57ca5e[_0x88cb('0x2a')]['filter']+'%'};return _0x570b43;})});}_0x2ee243=_[_0x88cb('0x34')]({},_0x2ee243,_0x57ca5e[_0x88cb('0x38')]);return _0x5d3155[_0x88cb('0x46')](_0x2ee243);}})['then'](function(_0x4db4fd){if(_0x4db4fd){_0x105338=_0x4db4fd[_0x88cb('0x3e')];if(!_0x57ca5e['query']['hasOwnProperty']('nolimit')){_0x2ee243['limit']=qs[_0x88cb('0x1a')](_0x57ca5e[_0x88cb('0x2a')]['limit']);_0x2ee243[_0x88cb('0x18')]=qs[_0x88cb('0x18')](_0x57ca5e['query'][_0x88cb('0x18')]);}return _0x5d3155['getSubjects'](_0x2ee243);}})[_0x88cb('0x1d')](function(_0x16b204){if(_0x16b204){return _0x16b204?{'count':_0x105338,'rows':_0x16b204}:null;}})[_0x88cb('0x1d')](respondWithResult(_0x58405f,null))[_0x88cb('0x3d')](handleError(_0x58405f,null));};exports[_0x88cb('0x48')]=function(_0xe79226,_0xf6a043,_0x2b49de){var _0x9fd08e={};var _0x4e300d={};var _0x531e2c;var _0x576567;return db[_0x88cb('0x25')][_0x88cb('0x42')]({'where':{'id':_0xe79226[_0x88cb('0x41')]['id']}})[_0x88cb('0x1d')](handleEntityNotFound(_0xf6a043,null))[_0x88cb('0x1d')](function(_0x1216c7){if(_0x1216c7){_0x531e2c=_0x1216c7;_0x4e300d['model']=_[_0x88cb('0x2b')](db['ServicenowField'][_0x88cb('0x26')]);_0x4e300d[_0x88cb('0x2a')]=_[_0x88cb('0x2b')](_0xe79226['query']);_0x4e300d[_0x88cb('0x31')]=_[_0x88cb('0x2c')](_0x4e300d[_0x88cb('0x29')],_0x4e300d[_0x88cb('0x2a')]);_0x9fd08e[_0x88cb('0x2d')]=_[_0x88cb('0x2c')](_0x4e300d['model'],qs['fields'](_0xe79226[_0x88cb('0x2a')][_0x88cb('0x2e')]));_0x9fd08e[_0x88cb('0x2d')]=_0x9fd08e[_0x88cb('0x2d')][_0x88cb('0x3e')]?_0x9fd08e[_0x88cb('0x2d')]:_0x4e300d[_0x88cb('0x29')];_0x9fd08e['order']=qs[_0x88cb('0x30')](_0xe79226[_0x88cb('0x2a')]['sort']);_0x9fd08e[_0x88cb('0x35')]=qs[_0x88cb('0x31')](_[_0x88cb('0x32')](_0xe79226[_0x88cb('0x2a')],_0x4e300d[_0x88cb('0x31')]));if(_0xe79226[_0x88cb('0x2a')]['filter']){_0x9fd08e[_0x88cb('0x35')]=_['merge'](_0x9fd08e[_0x88cb('0x35')],{'$or':_[_0x88cb('0x24')](_0x9fd08e[_0x88cb('0x2d')],function(_0x1b94e1){var _0x29bd03={};_0x29bd03[_0x1b94e1]={'$like':'%'+_0xe79226['query']['filter']+'%'};return _0x29bd03;})});}_0x9fd08e=_[_0x88cb('0x34')]({},_0x9fd08e,_0xe79226['options']);return _0x531e2c[_0x88cb('0x48')](_0x9fd08e);}})['then'](function(_0x1afeae){if(_0x1afeae){_0x576567=_0x1afeae[_0x88cb('0x3e')];if(!_0xe79226['query'][_0x88cb('0x2f')]('nolimit')){_0x9fd08e[_0x88cb('0x1a')]=qs[_0x88cb('0x1a')](_0xe79226['query'][_0x88cb('0x1a')]);_0x9fd08e[_0x88cb('0x18')]=qs[_0x88cb('0x18')](_0xe79226[_0x88cb('0x2a')]['offset']);}return _0x531e2c[_0x88cb('0x48')](_0x9fd08e);}})[_0x88cb('0x1d')](function(_0x5e73f6){if(_0x5e73f6){return _0x5e73f6?{'count':_0x576567,'rows':_0x5e73f6}:null;}})['then'](respondWithResult(_0xf6a043,null))['catch'](handleError(_0xf6a043,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index c4a6ed9..8f34dc3 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 _0xc343=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xc343,0x173));var _0x3c34=function(_0x5ad490,_0x4275bb){_0x5ad490=_0x5ad490-0x0;var _0x2cd3a6=_0xc343[_0x5ad490];return _0x2cd3a6;};'use strict';var _=require(_0x3c34('0x0'));var util=require('util');var logger=require(_0x3c34('0x1'))(_0x3c34('0x2'));var moment=require(_0x3c34('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c34('0x4'));var rimraf=require(_0x3c34('0x5'));var config=require(_0x3c34('0x6'));var attributes=require(_0x3c34('0x7'));module[_0x3c34('0x8')]=function(_0x37ddf8,_0x401457){return _0x37ddf8[_0x3c34('0x9')](_0x3c34('0xa'),attributes,{'tableName':_0x3c34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7948=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x5c9397,_0xe6bc88){var _0x194baf=function(_0x50d093){while(--_0x50d093){_0x5c9397['push'](_0x5c9397['shift']());}};_0x194baf(++_0xe6bc88);}(_0x7948,0x185));var _0x8794=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x7948[_0x11a220];return _0x20d8fe;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var logger=require(_0x8794('0x2'))(_0x8794('0x3'));var moment=require(_0x8794('0x4'));var BPromise=require(_0x8794('0x5'));var rp=require(_0x8794('0x6'));var fs=require('fs');var path=require(_0x8794('0x7'));var rimraf=require(_0x8794('0x8'));var config=require(_0x8794('0x9'));var attributes=require(_0x8794('0xa'));module[_0x8794('0xb')]=function(_0x322841,_0x1540b9){return _0x322841[_0x8794('0xc')](_0x8794('0xd'),attributes,{'tableName':_0x8794('0xe'),'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 c22d9b6..380645f 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 _0x9206=['randomstring','ioredis','../../config/logger','rpc','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9206,0x176));var _0x6920=function(_0x1e2465,_0xe8764a){_0x1e2465=_0x1e2465-0x0;var _0x48794b=_0x9206[_0x1e2465];return _0x48794b;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var moment=require(_0x6920('0x2'));var BPromise=require(_0x6920('0x3'));var rs=require(_0x6920('0x4'));var fs=require('fs');var Redis=require(_0x6920('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6920('0x6'))(_0x6920('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6920('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21fb21,_0x31966d,_0x2aad51){return new BPromise(function(_0xef5d38,_0x56bb75){return client['request'](_0x21fb21,_0x2aad51)[_0x6920('0x9')](function(_0xc578c6){logger[_0x6920('0xa')](_0x6920('0xb'),_0x31966d,_0x6920('0xc'));logger[_0x6920('0xd')](_0x6920('0xe'),_0x31966d,_0x6920('0xc'),JSON[_0x6920('0xf')](_0xc578c6));if(_0xc578c6[_0x6920('0x10')]){if(_0xc578c6[_0x6920('0x10')][_0x6920('0x11')]===0x1f4){logger[_0x6920('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x31966d,_0xc578c6['error'][_0x6920('0x12')]);return _0x56bb75(_0xc578c6[_0x6920('0x10')]['message']);}logger[_0x6920('0x10')](_0x6920('0xb'),_0x31966d,_0xc578c6[_0x6920('0x10')][_0x6920('0x12')]);return _0xef5d38(_0xc578c6[_0x6920('0x10')]['message']);}else{logger[_0x6920('0xa')](_0x6920('0xb'),_0x31966d,_0x6920('0xc'));_0xef5d38(_0xc578c6[_0x6920('0x13')][_0x6920('0x12')]);}})[_0x6920('0x14')](function(_0x3452a4){logger[_0x6920('0x10')](_0x6920('0xb'),_0x31966d,_0x3452a4);_0x56bb75(_0x3452a4);});});} \ No newline at end of file +var _0x2090=['jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2090,0x195));var _0x0209=function(_0x2674dc,_0xa7914b){_0x2674dc=_0x2674dc-0x0;var _0x2bd417=_0x2090[_0x2674dc];return _0x2bd417;};'use strict';var _=require(_0x0209('0x0'));var util=require(_0x0209('0x1'));var moment=require(_0x0209('0x2'));var BPromise=require(_0x0209('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0209('0x4'));var db=require(_0x0209('0x5'))['db'];var utils=require(_0x0209('0x6'));var logger=require(_0x0209('0x7'))('rpc');var config=require(_0x0209('0x8'));var jayson=require(_0x0209('0x9'));var client=jayson['client'][_0x0209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb4168a,_0x2a0688,_0x26b8bb){return new BPromise(function(_0x1e39d5,_0x3b0e01){return client[_0x0209('0xb')](_0xb4168a,_0x26b8bb)[_0x0209('0xc')](function(_0x3b8c4b){logger[_0x0209('0xd')](_0x0209('0xe'),_0x2a0688,_0x0209('0xf'));logger[_0x0209('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2a0688,'request\x20sent',JSON[_0x0209('0x11')](_0x3b8c4b));if(_0x3b8c4b['error']){if(_0x3b8c4b['error'][_0x0209('0x12')]===0x1f4){logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x3b8c4b[_0x0209('0x13')]['message']);return _0x3b0e01(_0x3b8c4b[_0x0209('0x13')][_0x0209('0x14')]);}logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x3b8c4b[_0x0209('0x13')]['message']);return _0x1e39d5(_0x3b8c4b[_0x0209('0x13')][_0x0209('0x14')]);}else{logger['info'](_0x0209('0xe'),_0x2a0688,_0x0209('0xf'));_0x1e39d5(_0x3b8c4b[_0x0209('0x15')][_0x0209('0x14')]);}})[_0x0209('0x16')](function(_0x4dbf17){logger[_0x0209('0x13')](_0x0209('0xe'),_0x2a0688,_0x4dbf17);_0x3b0e01(_0x4dbf17);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9102265..54b6fc0 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 _0x0e7d=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x106657,_0xe81f18){var _0x2caec9=function(_0x10552c){while(--_0x10552c){_0x106657['push'](_0x106657['shift']());}};_0x2caec9(++_0xe81f18);}(_0x0e7d,0x136));var _0xd0e7=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x0e7d[_0x163040];return _0x364667;};'use strict';var multer=require(_0xd0e7('0x0'));var util=require(_0xd0e7('0x1'));var path=require(_0xd0e7('0x2'));var timeout=require(_0xd0e7('0x3'));var express=require(_0xd0e7('0x4'));var router=express['Router']();var fs_extra=require(_0xd0e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0e7('0x6'));var config=require('../../config/environment');var controller=require(_0xd0e7('0x7'));router[_0xd0e7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd0e7('0x8')](_0xd0e7('0x9'),auth[_0xd0e7('0xa')](),controller[_0xd0e7('0xb')]);router[_0xd0e7('0xc')]('/',auth[_0xd0e7('0xa')](),controller[_0xd0e7('0xd')]);router[_0xd0e7('0xe')](_0xd0e7('0x9'),auth[_0xd0e7('0xa')](),controller[_0xd0e7('0xf')]);router[_0xd0e7('0x10')](_0xd0e7('0x9'),auth[_0xd0e7('0xa')](),controller[_0xd0e7('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc842=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x19ab52,_0x801f2){var _0x327ee6=function(_0x41c3c2){while(--_0x41c3c2){_0x19ab52['push'](_0x19ab52['shift']());}};_0x327ee6(++_0x801f2);}(_0xc842,0x1d1));var _0x2c84=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xc842[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x2c84('0x0'));var util=require(_0x2c84('0x1'));var path=require(_0x2c84('0x2'));var timeout=require(_0x2c84('0x3'));var express=require('express');var router=express[_0x2c84('0x4')]();var fs_extra=require(_0x2c84('0x5'));var auth=require(_0x2c84('0x6'));var interaction=require(_0x2c84('0x7'));var config=require(_0x2c84('0x8'));var controller=require(_0x2c84('0x9'));router[_0x2c84('0xa')]('/',auth[_0x2c84('0xb')](),controller[_0x2c84('0xc')]);router['get'](_0x2c84('0xd'),auth['isAuthenticated'](),controller[_0x2c84('0xe')]);router[_0x2c84('0xf')]('/',auth[_0x2c84('0xb')](),controller[_0x2c84('0x10')]);router[_0x2c84('0x11')]('/:id',auth[_0x2c84('0xb')](),controller[_0x2c84('0x12')]);router[_0x2c84('0x13')]('/:id',auth[_0x2c84('0xb')](),controller[_0x2c84('0x14')]);module[_0x2c84('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 16ea58a..0cfa891 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 _0x283c=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x202377,_0x37bb1a){var _0x47cebf=function(_0x28e952){while(--_0x28e952){_0x202377['push'](_0x202377['shift']());}};_0x47cebf(++_0x37bb1a);}(_0x283c,0x1c6));var _0xc283=function(_0x26af78,_0x2b72ff){_0x26af78=_0x26af78-0x0;var _0x1482ad=_0x283c[_0x26af78];return _0x1482ad;};'use strict';var Sequelize=require('sequelize');module[_0xc283('0x0')]={'type':{'type':Sequelize[_0xc283('0x1')](_0xc283('0x2'),_0xc283('0x3'),_0xc283('0x4'),_0xc283('0x5'),_0xc283('0x6')),'defaultValue':_0xc283('0x2')},'content':{'type':Sequelize[_0xc283('0x7')]},'key':{'type':Sequelize[_0xc283('0x7')]},'keyType':{'type':Sequelize[_0xc283('0x1')](_0xc283('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xc283('0x7')]},'idField':{'type':Sequelize[_0xc283('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc283('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc283('0x7')]}}; \ No newline at end of file +var _0xc4c4=['keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x5e09ed,_0x3a2790){var _0x553ad6=function(_0x20aa57){while(--_0x20aa57){_0x5e09ed['push'](_0x5e09ed['shift']());}};_0x553ad6(++_0x3a2790);}(_0xc4c4,0x104));var _0x4c4c=function(_0x157624,_0x3ee799){_0x157624=_0x157624-0x0;var _0x517e0c=_0xc4c4[_0x157624];return _0x517e0c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4c4c('0x0')](_0x4c4c('0x1'),_0x4c4c('0x2'),_0x4c4c('0x3'),_0x4c4c('0x4'),_0x4c4c('0x5')),'defaultValue':_0x4c4c('0x1')},'content':{'type':Sequelize[_0x4c4c('0x6')]},'key':{'type':Sequelize[_0x4c4c('0x6')]},'keyType':{'type':Sequelize[_0x4c4c('0x0')](_0x4c4c('0x1'),_0x4c4c('0x2'),_0x4c4c('0x3'))},'keyContent':{'type':Sequelize[_0x4c4c('0x6')]},'idField':{'type':Sequelize[_0x4c4c('0x6')]},'nameField':{'type':Sequelize[_0x4c4c('0x6')]},'customField':{'type':Sequelize[_0x4c4c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c4c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 94cb3c0..2cb687a 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 _0x64f6=['status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','params','includeAll','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x1d595f,_0x3ad16c){var _0x4ad132=function(_0x956b34){while(--_0x956b34){_0x1d595f['push'](_0x1d595f['shift']());}};_0x4ad132(++_0x3ad16c);}(_0x64f6,0x1a7));var _0x664f=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x64f6[_0x2a0824];return _0x1a78f7;};'use strict';var emlformat=require(_0x664f('0x0'));var rimraf=require(_0x664f('0x1'));var zipdir=require(_0x664f('0x2'));var jsonpatch=require(_0x664f('0x3'));var rp=require(_0x664f('0x4'));var moment=require(_0x664f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x664f('0x6'));var util=require(_0x664f('0x7'));var path=require(_0x664f('0x8'));var sox=require('sox');var csv=require(_0x664f('0x9'));var ejs=require(_0x664f('0xa'));var fs=require('fs');var fs_extra=require(_0x664f('0xb'));var _=require(_0x664f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x664f('0xd'));var deskjs=require(_0x664f('0xe'));var toCsv=require(_0x664f('0x9'));var querystring=require(_0x664f('0xf'));var Papa=require(_0x664f('0x10'));var Redis=require(_0x664f('0x11'));var authService=require(_0x664f('0x12'));var qs=require(_0x664f('0x13'));var as=require(_0x664f('0x14'));var hardwareService=require(_0x664f('0x15'));var logger=require(_0x664f('0x16'))(_0x664f('0x17'));var utils=require(_0x664f('0x18'));var config=require(_0x664f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46b0f4,_0x4c2f43){_0x4c2f43=_0x4c2f43||0xcc;return function(_0x459293){if(_0x459293){return _0x46b0f4[_0x664f('0x1a')](_0x4c2f43);}return _0x46b0f4[_0x664f('0x1b')](_0x4c2f43)[_0x664f('0x1c')]();};}function respondWithResult(_0x248f08,_0x3df256){_0x3df256=_0x3df256||0xc8;return function(_0x2ab952){if(_0x2ab952){return _0x248f08[_0x664f('0x1b')](_0x3df256)['json'](_0x2ab952);}};}function respondWithFilteredResult(_0x488923,_0x50d311){return function(_0x31dcda){if(_0x31dcda){var _0x503c1d=typeof _0x50d311['offset']==='undefined'&&typeof _0x50d311[_0x664f('0x1d')]===_0x664f('0x1e');var _0x2303cf=_0x31dcda[_0x664f('0x1f')];var _0x47df83=_0x503c1d?0x0:_0x50d311['offset'];var _0x5f02a9=_0x503c1d?_0x31dcda['count']:_0x50d311[_0x664f('0x20')]+_0x50d311[_0x664f('0x1d')];var _0x35a6cc;if(_0x5f02a9>=_0x2303cf){_0x5f02a9=_0x2303cf;_0x35a6cc=0xc8;}else{_0x35a6cc=0xce;}_0x488923[_0x664f('0x1b')](_0x35a6cc);return _0x488923[_0x664f('0x21')](_0x664f('0x22'),_0x47df83+'-'+_0x5f02a9+'/'+_0x2303cf)[_0x664f('0x23')](_0x31dcda);}return null;};}function patchUpdates(_0x8ccf67){return function(_0xa7282){try{jsonpatch[_0x664f('0x24')](_0xa7282,_0x8ccf67,!![]);}catch(_0x528579){return BPromise[_0x664f('0x25')](_0x528579);}return _0xa7282[_0x664f('0x26')]();};}function saveUpdates(_0x719919,_0x77f4c9){return function(_0x207620){if(_0x207620){return _0x207620[_0x664f('0x27')](_0x719919)[_0x664f('0x28')](function(_0x28c4fe){return _0x28c4fe;});}return null;};}function removeEntity(_0x264837,_0x47e8d3){return function(_0x2eec80){if(_0x2eec80){return _0x2eec80[_0x664f('0x29')]()['then'](function(){_0x264837[_0x664f('0x1b')](0xcc)[_0x664f('0x1c')]();});}};}function handleEntityNotFound(_0x45f342,_0x4f1c12){return function(_0x1469e6){if(!_0x1469e6){_0x45f342[_0x664f('0x1a')](0x194);}return _0x1469e6;};}function handleError(_0x1418fb,_0x44c642){_0x44c642=_0x44c642||0x1f4;return function(_0x554e7e){logger[_0x664f('0x2a')](_0x554e7e[_0x664f('0x2b')]);if(_0x554e7e[_0x664f('0x2c')]){delete _0x554e7e[_0x664f('0x2c')];}_0x1418fb[_0x664f('0x1b')](_0x44c642)[_0x664f('0x2d')](_0x554e7e);};}exports['index']=function(_0xa62b91,_0x34f956){var _0x5eefbb={},_0x4d78fc={},_0x15f06d={'count':0x0,'rows':[]};var _0x2b6a54=_[_0x664f('0x2e')](db[_0x664f('0x2f')][_0x664f('0x30')],function(_0x32147e){return{'name':_0x32147e[_0x664f('0x31')],'type':_0x32147e[_0x664f('0x32')][_0x664f('0x33')]};});_0x4d78fc['model']=_[_0x664f('0x2e')](_0x2b6a54,_0x664f('0x2c'));_0x4d78fc['query']=_['keys'](_0xa62b91[_0x664f('0x34')]);_0x4d78fc['filters']=_[_0x664f('0x35')](_0x4d78fc[_0x664f('0x36')],_0x4d78fc['query']);_0x5eefbb['attributes']=_['intersection'](_0x4d78fc['model'],qs[_0x664f('0x37')](_0xa62b91[_0x664f('0x34')]['fields']));_0x5eefbb[_0x664f('0x38')]=_0x5eefbb['attributes'][_0x664f('0x39')]?_0x5eefbb['attributes']:_0x4d78fc[_0x664f('0x36')];if(!_0xa62b91['query']['hasOwnProperty']('nolimit')){_0x5eefbb[_0x664f('0x1d')]=qs[_0x664f('0x1d')](_0xa62b91[_0x664f('0x34')]['limit']);_0x5eefbb[_0x664f('0x20')]=qs['offset'](_0xa62b91[_0x664f('0x34')][_0x664f('0x20')]);}_0x5eefbb[_0x664f('0x3a')]=qs[_0x664f('0x3b')](_0xa62b91[_0x664f('0x34')][_0x664f('0x3b')]);_0x5eefbb[_0x664f('0x3c')]=qs[_0x664f('0x3d')](_[_0x664f('0x3e')](_0xa62b91[_0x664f('0x34')],_0x4d78fc['filters']),_0x2b6a54);if(_0xa62b91[_0x664f('0x34')][_0x664f('0x3f')]){_0x5eefbb[_0x664f('0x3c')]=_[_0x664f('0x40')](_0x5eefbb[_0x664f('0x3c')],{'$or':_['map'](_0x2b6a54,function(_0x103a8c){if(_0x103a8c[_0x664f('0x32')]!==_0x664f('0x41')){var _0x3b7fc5={};_0x3b7fc5[_0x103a8c['name']]={'$like':'%'+_0xa62b91[_0x664f('0x34')][_0x664f('0x3f')]+'%'};return _0x3b7fc5;}})});}_0x5eefbb=_[_0x664f('0x40')]({},_0x5eefbb,_0xa62b91[_0x664f('0x42')]);var _0x54c3d5={'where':_0x5eefbb['where']};return db['ServicenowField'][_0x664f('0x1f')](_0x54c3d5)[_0x664f('0x28')](function(_0x32af9a){_0x15f06d[_0x664f('0x1f')]=_0x32af9a;if(_0xa62b91['query']['includeAll']){_0x5eefbb['include']=[{'all':!![]}];}return db[_0x664f('0x2f')][_0x664f('0x43')](_0x5eefbb);})[_0x664f('0x28')](function(_0xc4b7c7){_0x15f06d['rows']=_0xc4b7c7;return _0x15f06d;})['then'](respondWithFilteredResult(_0x34f956,_0x5eefbb))[_0x664f('0x44')](handleError(_0x34f956,null));};exports['show']=function(_0x30311e,_0x353ebf){var _0x1c3bbf={'raw':!![],'where':{'id':_0x30311e[_0x664f('0x45')]['id']}},_0x373c10={};_0x373c10['model']=_['keys'](db[_0x664f('0x2f')][_0x664f('0x30')]);_0x373c10['query']=_['keys'](_0x30311e['query']);_0x373c10[_0x664f('0x3d')]=_[_0x664f('0x35')](_0x373c10[_0x664f('0x36')],_0x373c10['query']);_0x1c3bbf['attributes']=_[_0x664f('0x35')](_0x373c10[_0x664f('0x36')],qs[_0x664f('0x37')](_0x30311e['query'][_0x664f('0x37')]));_0x1c3bbf[_0x664f('0x38')]=_0x1c3bbf[_0x664f('0x38')][_0x664f('0x39')]?_0x1c3bbf['attributes']:_0x373c10[_0x664f('0x36')];if(_0x30311e[_0x664f('0x34')][_0x664f('0x46')]){_0x1c3bbf[_0x664f('0x47')]=[{'all':!![]}];}_0x1c3bbf=_[_0x664f('0x40')]({},_0x1c3bbf,_0x30311e['options']);return db['ServicenowField']['find'](_0x1c3bbf)[_0x664f('0x28')](handleEntityNotFound(_0x353ebf,null))['then'](respondWithResult(_0x353ebf,null))[_0x664f('0x44')](handleError(_0x353ebf,null));};exports[_0x664f('0x48')]=function(_0x205ac1,_0x5eabae){return db['ServicenowField'][_0x664f('0x48')](_0x205ac1[_0x664f('0x49')],{})[_0x664f('0x28')](respondWithResult(_0x5eabae,0xc9))[_0x664f('0x44')](handleError(_0x5eabae,null));};exports[_0x664f('0x27')]=function(_0x487f80,_0x16d9fa){if(_0x487f80[_0x664f('0x49')]['id']){delete _0x487f80[_0x664f('0x49')]['id'];}return db[_0x664f('0x2f')][_0x664f('0x4a')]({'where':{'id':_0x487f80[_0x664f('0x45')]['id']}})['then'](handleEntityNotFound(_0x16d9fa,null))[_0x664f('0x28')](saveUpdates(_0x487f80[_0x664f('0x49')],null))[_0x664f('0x28')](respondWithResult(_0x16d9fa,null))['catch'](handleError(_0x16d9fa,null));};exports['destroy']=function(_0x4e4aa7,_0x1c2aee){return db['ServicenowField']['find']({'where':{'id':_0x4e4aa7[_0x664f('0x45')]['id']}})[_0x664f('0x28')](handleEntityNotFound(_0x1c2aee,null))['then'](removeEntity(_0x1c2aee,null))['catch'](handleError(_0x1c2aee,null));}; \ No newline at end of file +var _0x0259=['params','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','ServicenowField','includeAll','include','findAll','rows','show'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x0259,0x1ce));var _0x9025=function(_0x5f5b91,_0x4e4bb3){_0x5f5b91=_0x5f5b91-0x0;var _0x1036cb=_0x0259[_0x5f5b91];return _0x1036cb;};'use strict';var emlformat=require(_0x9025('0x0'));var rimraf=require(_0x9025('0x1'));var zipdir=require(_0x9025('0x2'));var jsonpatch=require(_0x9025('0x3'));var rp=require(_0x9025('0x4'));var moment=require(_0x9025('0x5'));var BPromise=require(_0x9025('0x6'));var Mustache=require(_0x9025('0x7'));var util=require(_0x9025('0x8'));var path=require(_0x9025('0x9'));var sox=require(_0x9025('0xa'));var csv=require(_0x9025('0xb'));var ejs=require(_0x9025('0xc'));var fs=require('fs');var fs_extra=require(_0x9025('0xd'));var _=require('lodash');var squel=require(_0x9025('0xe'));var crypto=require(_0x9025('0xf'));var jsforce=require(_0x9025('0x10'));var deskjs=require(_0x9025('0x11'));var toCsv=require(_0x9025('0xb'));var querystring=require(_0x9025('0x12'));var Papa=require(_0x9025('0x13'));var Redis=require(_0x9025('0x14'));var authService=require(_0x9025('0x15'));var qs=require(_0x9025('0x16'));var as=require(_0x9025('0x17'));var hardwareService=require(_0x9025('0x18'));var logger=require('../../config/logger')(_0x9025('0x19'));var utils=require(_0x9025('0x1a'));var config=require(_0x9025('0x1b'));var licenseUtil=require(_0x9025('0x1c'));var db=require(_0x9025('0x1d'))['db'];function respondWithStatusCode(_0x4e7313,_0x90d98){_0x90d98=_0x90d98||0xcc;return function(_0xfc46c1){if(_0xfc46c1){return _0x4e7313[_0x9025('0x1e')](_0x90d98);}return _0x4e7313[_0x9025('0x1f')](_0x90d98)[_0x9025('0x20')]();};}function respondWithResult(_0x54b682,_0x4e252c){_0x4e252c=_0x4e252c||0xc8;return function(_0x37eb7e){if(_0x37eb7e){return _0x54b682[_0x9025('0x1f')](_0x4e252c)['json'](_0x37eb7e);}};}function respondWithFilteredResult(_0x31040f,_0x53ddde){return function(_0x158dc9){if(_0x158dc9){var _0x2d3e2b=typeof _0x53ddde['offset']==='undefined'&&typeof _0x53ddde['limit']==='undefined';var _0x45834e=_0x158dc9['count'];var _0x307113=_0x2d3e2b?0x0:_0x53ddde[_0x9025('0x21')];var _0x571dce=_0x2d3e2b?_0x158dc9[_0x9025('0x22')]:_0x53ddde[_0x9025('0x21')]+_0x53ddde[_0x9025('0x23')];var _0x5f2746;if(_0x571dce>=_0x45834e){_0x571dce=_0x45834e;_0x5f2746=0xc8;}else{_0x5f2746=0xce;}_0x31040f[_0x9025('0x1f')](_0x5f2746);return _0x31040f[_0x9025('0x24')](_0x9025('0x25'),_0x307113+'-'+_0x571dce+'/'+_0x45834e)['json'](_0x158dc9);}return null;};}function patchUpdates(_0xa8169c){return function(_0x456be4){try{jsonpatch['apply'](_0x456be4,_0xa8169c,!![]);}catch(_0x379f8f){return BPromise['reject'](_0x379f8f);}return _0x456be4[_0x9025('0x26')]();};}function saveUpdates(_0x5e0c25,_0x2b7900){return function(_0x21b206){if(_0x21b206){return _0x21b206[_0x9025('0x27')](_0x5e0c25)[_0x9025('0x28')](function(_0xc3240e){return _0xc3240e;});}return null;};}function removeEntity(_0x226907,_0x5ec30d){return function(_0x556bdd){if(_0x556bdd){return _0x556bdd[_0x9025('0x29')]()['then'](function(){_0x226907['status'](0xcc)[_0x9025('0x20')]();});}};}function handleEntityNotFound(_0x47745a,_0x2c18b5){return function(_0x55750){if(!_0x55750){_0x47745a[_0x9025('0x1e')](0x194);}return _0x55750;};}function handleError(_0x2fa335,_0x394aef){_0x394aef=_0x394aef||0x1f4;return function(_0x25a839){logger[_0x9025('0x2a')](_0x25a839[_0x9025('0x2b')]);if(_0x25a839[_0x9025('0x2c')]){delete _0x25a839[_0x9025('0x2c')];}_0x2fa335[_0x9025('0x1f')](_0x394aef)[_0x9025('0x2d')](_0x25a839);};}exports['index']=function(_0x5c46f0,_0x551224){var _0x506edf={},_0x4565f4={},_0x506068={'count':0x0,'rows':[]};var _0x4c1173=_[_0x9025('0x2e')](db['ServicenowField']['rawAttributes'],function(_0x7d3754){return{'name':_0x7d3754[_0x9025('0x2f')],'type':_0x7d3754[_0x9025('0x30')]['key']};});_0x4565f4[_0x9025('0x31')]=_[_0x9025('0x2e')](_0x4c1173,_0x9025('0x2c'));_0x4565f4[_0x9025('0x32')]=_[_0x9025('0x33')](_0x5c46f0['query']);_0x4565f4[_0x9025('0x34')]=_[_0x9025('0x35')](_0x4565f4[_0x9025('0x31')],_0x4565f4['query']);_0x506edf['attributes']=_[_0x9025('0x35')](_0x4565f4[_0x9025('0x31')],qs[_0x9025('0x36')](_0x5c46f0[_0x9025('0x32')][_0x9025('0x36')]));_0x506edf['attributes']=_0x506edf[_0x9025('0x37')]['length']?_0x506edf['attributes']:_0x4565f4[_0x9025('0x31')];if(!_0x5c46f0[_0x9025('0x32')][_0x9025('0x38')](_0x9025('0x39'))){_0x506edf['limit']=qs['limit'](_0x5c46f0[_0x9025('0x32')]['limit']);_0x506edf['offset']=qs[_0x9025('0x21')](_0x5c46f0['query'][_0x9025('0x21')]);}_0x506edf[_0x9025('0x3a')]=qs[_0x9025('0x3b')](_0x5c46f0[_0x9025('0x32')][_0x9025('0x3b')]);_0x506edf[_0x9025('0x3c')]=qs[_0x9025('0x34')](_[_0x9025('0x3d')](_0x5c46f0[_0x9025('0x32')],_0x4565f4[_0x9025('0x34')]),_0x4c1173);if(_0x5c46f0[_0x9025('0x32')]['filter']){_0x506edf[_0x9025('0x3c')]=_[_0x9025('0x3e')](_0x506edf['where'],{'$or':_['map'](_0x4c1173,function(_0x24c9a8){if(_0x24c9a8[_0x9025('0x30')]!=='VIRTUAL'){var _0x2eeaef={};_0x2eeaef[_0x24c9a8[_0x9025('0x2c')]]={'$like':'%'+_0x5c46f0[_0x9025('0x32')]['filter']+'%'};return _0x2eeaef;}})});}_0x506edf=_['merge']({},_0x506edf,_0x5c46f0[_0x9025('0x3f')]);var _0x14d7e9={'where':_0x506edf[_0x9025('0x3c')]};return db[_0x9025('0x40')][_0x9025('0x22')](_0x14d7e9)[_0x9025('0x28')](function(_0x23af6f){_0x506068[_0x9025('0x22')]=_0x23af6f;if(_0x5c46f0[_0x9025('0x32')][_0x9025('0x41')]){_0x506edf[_0x9025('0x42')]=[{'all':!![]}];}return db[_0x9025('0x40')][_0x9025('0x43')](_0x506edf);})[_0x9025('0x28')](function(_0x1c25cf){_0x506068[_0x9025('0x44')]=_0x1c25cf;return _0x506068;})[_0x9025('0x28')](respondWithFilteredResult(_0x551224,_0x506edf))['catch'](handleError(_0x551224,null));};exports[_0x9025('0x45')]=function(_0x925029,_0x118c31){var _0x454d6b={'raw':!![],'where':{'id':_0x925029[_0x9025('0x46')]['id']}},_0x143172={};_0x143172[_0x9025('0x31')]=_[_0x9025('0x33')](db[_0x9025('0x40')][_0x9025('0x47')]);_0x143172[_0x9025('0x32')]=_[_0x9025('0x33')](_0x925029[_0x9025('0x32')]);_0x143172['filters']=_[_0x9025('0x35')](_0x143172['model'],_0x143172[_0x9025('0x32')]);_0x454d6b[_0x9025('0x37')]=_[_0x9025('0x35')](_0x143172['model'],qs['fields'](_0x925029[_0x9025('0x32')]['fields']));_0x454d6b['attributes']=_0x454d6b[_0x9025('0x37')]['length']?_0x454d6b['attributes']:_0x143172[_0x9025('0x31')];if(_0x925029[_0x9025('0x32')][_0x9025('0x41')]){_0x454d6b[_0x9025('0x42')]=[{'all':!![]}];}_0x454d6b=_[_0x9025('0x3e')]({},_0x454d6b,_0x925029[_0x9025('0x3f')]);return db['ServicenowField']['find'](_0x454d6b)[_0x9025('0x28')](handleEntityNotFound(_0x118c31,null))[_0x9025('0x28')](respondWithResult(_0x118c31,null))[_0x9025('0x48')](handleError(_0x118c31,null));};exports['create']=function(_0x584e9e,_0x31a0ec){return db[_0x9025('0x40')][_0x9025('0x49')](_0x584e9e[_0x9025('0x4a')],{})[_0x9025('0x28')](respondWithResult(_0x31a0ec,0xc9))[_0x9025('0x48')](handleError(_0x31a0ec,null));};exports[_0x9025('0x27')]=function(_0x5b46aa,_0x36158f){if(_0x5b46aa[_0x9025('0x4a')]['id']){delete _0x5b46aa[_0x9025('0x4a')]['id'];}return db['ServicenowField'][_0x9025('0x4b')]({'where':{'id':_0x5b46aa[_0x9025('0x46')]['id']}})[_0x9025('0x28')](handleEntityNotFound(_0x36158f,null))[_0x9025('0x28')](saveUpdates(_0x5b46aa[_0x9025('0x4a')],null))[_0x9025('0x28')](respondWithResult(_0x36158f,null))[_0x9025('0x48')](handleError(_0x36158f,null));};exports['destroy']=function(_0x208496,_0x52bbe2){return db['ServicenowField'][_0x9025('0x4b')]({'where':{'id':_0x208496['params']['id']}})[_0x9025('0x28')](handleEntityNotFound(_0x52bbe2,null))[_0x9025('0x28')](removeEntity(_0x52bbe2,null))[_0x9025('0x48')](handleError(_0x52bbe2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3e3bd96..e9e0ee1 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 _0xcd98=['moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x8ec7cf,_0x4a7431){var _0x2eed63=function(_0x5de6ce){while(--_0x5de6ce){_0x8ec7cf['push'](_0x8ec7cf['shift']());}};_0x2eed63(++_0x4a7431);}(_0xcd98,0x1cc));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8cd9('0x0'));var util=require(_0x8cd9('0x1'));var logger=require(_0x8cd9('0x2'))(_0x8cd9('0x3'));var moment=require(_0x8cd9('0x4'));var BPromise=require(_0x8cd9('0x5'));var rp=require(_0x8cd9('0x6'));var fs=require('fs');var path=require(_0x8cd9('0x7'));var rimraf=require(_0x8cd9('0x8'));var config=require('../../config/environment');var attributes=require(_0x8cd9('0x9'));module[_0x8cd9('0xa')]=function(_0x15033d,_0x2c7f2e){return _0x15033d[_0x8cd9('0xb')](_0x8cd9('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x8cd9('0xd'),'fields':[_0x8cd9('0xe'),_0x8cd9('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d0f=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','int_servicenow_fields','idField'];(function(_0x3d4976,_0x447adb){var _0x13195a=function(_0x4be116){while(--_0x4be116){_0x3d4976['push'](_0x3d4976['shift']());}};_0x13195a(++_0x447adb);}(_0x9d0f,0x9b));var _0xf9d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9d0f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf9d0('0x0'));var util=require(_0xf9d0('0x1'));var logger=require(_0xf9d0('0x2'))(_0xf9d0('0x3'));var moment=require(_0xf9d0('0x4'));var BPromise=require(_0xf9d0('0x5'));var rp=require(_0xf9d0('0x6'));var fs=require('fs');var path=require(_0xf9d0('0x7'));var rimraf=require(_0xf9d0('0x8'));var config=require(_0xf9d0('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xf9d0('0xa')]=function(_0x350b1d,_0x3d221d){return _0x350b1d['define']('ServicenowField',attributes,{'tableName':_0xf9d0('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf9d0('0xc'),_0xf9d0('0xd')],'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 3ca4cd8..e58768b 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x100c7f,_0x17a338){var _0x1e552a=function(_0x33b0da){while(--_0x33b0da){_0x100c7f['push'](_0x100c7f['shift']());}};_0x1e552a(++_0x17a338);}(_0xaa88,0x137));var _0x8aa8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xaa88[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x47c34c,_0x62e2ae){var _0x45f2f4=function(_0x219ce1){while(--_0x219ce1){_0x47c34c['push'](_0x47c34c['shift']());}};_0x45f2f4(++_0x62e2ae);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x370547,_0x127731){_0x370547=_0x370547-0x0;var _0x39ad58=_0x9ffd[_0x370547];return _0x39ad58;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 84f05b9..8f00db7 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(_0x23c2ad,_0xe4032c){var _0x5b8d36=function(_0xced2d){while(--_0xced2d){_0x23c2ad['push'](_0x23c2ad['shift']());}};_0x5b8d36(++_0xe4032c);}(_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','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x86a886,_0x5984b1){var _0x13c001=function(_0x196647){while(--_0x196647){_0x86a886['push'](_0x86a886['shift']());}};_0x13c001(++_0x5984b1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 2f0d28d..8e248d0 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(_0x3275ee,_0xf455b2){var _0x6abb74=function(_0x16bcf8){while(--_0x16bcf8){_0x3275ee['push'](_0x3275ee['shift']());}};_0x6abb74(++_0xf455b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x133642,_0x4f9f62){var _0x43880d=function(_0x140bac){while(--_0x140bac){_0x133642['push'](_0x133642['shift']());}};_0x43880d(++_0x4f9f62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 201bda1..9971d12 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 _0xdefc=['filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','fields','options','catch','create','body','find','getConfigurations','pick','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','login','JSON','PLAIN','Password\x20Expired','format','%s%s','/service/v4_1/rest.php','get_module_fields','values','remove','endsWith','map','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','reject','update','then','name','send','index','SugarcrmAccount','rawAttributes','type','key','model','keys','query'];(function(_0xf14466,_0x437e82){var _0x4b18b4=function(_0x560d3e){while(--_0x560d3e){_0xf14466['push'](_0xf14466['shift']());}};_0x4b18b4(++_0x437e82);}(_0xdefc,0x197));var _0xcdef=function(_0x4c4664,_0x506a85){_0x4c4664=_0x4c4664-0x0;var _0x2920cf=_0xdefc[_0x4c4664];return _0x2920cf;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdef('0x2'));var moment=require('moment');var BPromise=require(_0xcdef('0x3'));var Mustache=require(_0xcdef('0x4'));var util=require(_0xcdef('0x5'));var path=require(_0xcdef('0x6'));var sox=require(_0xcdef('0x7'));var csv=require(_0xcdef('0x8'));var ejs=require(_0xcdef('0x9'));var fs=require('fs');var fs_extra=require(_0xcdef('0xa'));var _=require(_0xcdef('0xb'));var squel=require(_0xcdef('0xc'));var crypto=require(_0xcdef('0xd'));var jsforce=require(_0xcdef('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcdef('0xf'));var Papa=require(_0xcdef('0x10'));var Redis=require(_0xcdef('0x11'));var authService=require(_0xcdef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdef('0x13'));var logger=require(_0xcdef('0x14'))('api');var utils=require(_0xcdef('0x15'));var config=require(_0xcdef('0x16'));var licenseUtil=require(_0xcdef('0x17'));var db=require(_0xcdef('0x18'))['db'];var integrations=require(_0xcdef('0x19'));function respondWithStatusCode(_0x132b04,_0x216de1){_0x216de1=_0x216de1||0xcc;return function(_0xfe395e){if(_0xfe395e){return _0x132b04[_0xcdef('0x1a')](_0x216de1);}return _0x132b04[_0xcdef('0x1b')](_0x216de1)[_0xcdef('0x1c')]();};}function respondWithResult(_0x595915,_0xb646c1){_0xb646c1=_0xb646c1||0xc8;return function(_0x198400){if(_0x198400){return _0x595915[_0xcdef('0x1b')](_0xb646c1)['json'](_0x198400);}};}function respondWithFilteredResult(_0x2aff86,_0x4363aa){return function(_0x22cc63){if(_0x22cc63){var _0x180b94=typeof _0x4363aa[_0xcdef('0x1d')]===_0xcdef('0x1e')&&typeof _0x4363aa['limit']==='undefined';var _0x1610e0=_0x22cc63['count'];var _0x24e47b=_0x180b94?0x0:_0x4363aa[_0xcdef('0x1d')];var _0x3a0387=_0x180b94?_0x22cc63[_0xcdef('0x1f')]:_0x4363aa[_0xcdef('0x1d')]+_0x4363aa['limit'];var _0x148d53;if(_0x3a0387>=_0x1610e0){_0x3a0387=_0x1610e0;_0x148d53=0xc8;}else{_0x148d53=0xce;}_0x2aff86[_0xcdef('0x1b')](_0x148d53);return _0x2aff86['set']('Content-Range',_0x24e47b+'-'+_0x3a0387+'/'+_0x1610e0)['json'](_0x22cc63);}return null;};}function patchUpdates(_0x147fdf){return function(_0x4646db){try{jsonpatch['apply'](_0x4646db,_0x147fdf,!![]);}catch(_0x51f09a){return BPromise[_0xcdef('0x20')](_0x51f09a);}return _0x4646db['save']();};}function saveUpdates(_0x502b40,_0x1743e5){return function(_0x24c866){if(_0x24c866){return _0x24c866[_0xcdef('0x21')](_0x502b40)['then'](function(_0x1b087a){return _0x1b087a;});}return null;};}function removeEntity(_0x4457ab,_0xe5e947){return function(_0x1799da){if(_0x1799da){return _0x1799da['destroy']()[_0xcdef('0x22')](function(){_0x4457ab[_0xcdef('0x1b')](0xcc)[_0xcdef('0x1c')]();});}};}function handleEntityNotFound(_0x4c7920,_0x37908b){return function(_0xdb1a3c){if(!_0xdb1a3c){_0x4c7920[_0xcdef('0x1a')](0x194);}return _0xdb1a3c;};}function handleError(_0x58cea2,_0xd1b0af){_0xd1b0af=_0xd1b0af||0x1f4;return function(_0x468968){logger['error'](_0x468968['stack']);if(_0x468968[_0xcdef('0x23')]){delete _0x468968[_0xcdef('0x23')];}_0x58cea2[_0xcdef('0x1b')](_0xd1b0af)[_0xcdef('0x24')](_0x468968);};}exports[_0xcdef('0x25')]=function(_0x15a679,_0x599433){var _0x3cb2ee={},_0x4e80f9={},_0x48f54c={'count':0x0,'rows':[]};var _0x4975f8=_['map'](db[_0xcdef('0x26')][_0xcdef('0x27')],function(_0x45ff92){return{'name':_0x45ff92['fieldName'],'type':_0x45ff92[_0xcdef('0x28')][_0xcdef('0x29')]};});_0x4e80f9[_0xcdef('0x2a')]=_['map'](_0x4975f8,_0xcdef('0x23'));_0x4e80f9['query']=_[_0xcdef('0x2b')](_0x15a679[_0xcdef('0x2c')]);_0x4e80f9[_0xcdef('0x2d')]=_['intersection'](_0x4e80f9[_0xcdef('0x2a')],_0x4e80f9[_0xcdef('0x2c')]);_0x3cb2ee[_0xcdef('0x2e')]=_[_0xcdef('0x2f')](_0x4e80f9[_0xcdef('0x2a')],qs['fields'](_0x15a679[_0xcdef('0x2c')]['fields']));_0x3cb2ee['attributes']=_0x3cb2ee['attributes'][_0xcdef('0x30')]?_0x3cb2ee[_0xcdef('0x2e')]:_0x4e80f9[_0xcdef('0x2a')];if(!_0x15a679[_0xcdef('0x2c')][_0xcdef('0x31')](_0xcdef('0x32'))){_0x3cb2ee[_0xcdef('0x33')]=qs[_0xcdef('0x33')](_0x15a679['query'][_0xcdef('0x33')]);_0x3cb2ee[_0xcdef('0x1d')]=qs[_0xcdef('0x1d')](_0x15a679['query'][_0xcdef('0x1d')]);}_0x3cb2ee[_0xcdef('0x34')]=qs['sort'](_0x15a679[_0xcdef('0x2c')][_0xcdef('0x35')]);_0x3cb2ee[_0xcdef('0x36')]=qs[_0xcdef('0x2d')](_['pick'](_0x15a679[_0xcdef('0x2c')],_0x4e80f9[_0xcdef('0x2d')]),_0x4975f8);if(_0x15a679['query'][_0xcdef('0x37')]){_0x3cb2ee['where']=_[_0xcdef('0x38')](_0x3cb2ee[_0xcdef('0x36')],{'$or':_['map'](_0x4975f8,function(_0x159bc3){if(_0x159bc3[_0xcdef('0x28')]!==_0xcdef('0x39')){var _0x412314={};_0x412314[_0x159bc3[_0xcdef('0x23')]]={'$like':'%'+_0x15a679[_0xcdef('0x2c')][_0xcdef('0x37')]+'%'};return _0x412314;}})});}_0x3cb2ee=_[_0xcdef('0x38')]({},_0x3cb2ee,_0x15a679['options']);var _0x1a18bf={'where':_0x3cb2ee['where']};return db['SugarcrmAccount'][_0xcdef('0x1f')](_0x1a18bf)['then'](function(_0x11ad38){_0x48f54c['count']=_0x11ad38;if(_0x15a679['query']['includeAll']){_0x3cb2ee[_0xcdef('0x3a')]=[{'all':!![]}];}return db[_0xcdef('0x26')][_0xcdef('0x3b')](_0x3cb2ee);})[_0xcdef('0x22')](function(_0x3be99c){_0x48f54c[_0xcdef('0x3c')]=_0x3be99c;return _0x48f54c;})[_0xcdef('0x22')](respondWithFilteredResult(_0x599433,_0x3cb2ee))['catch'](handleError(_0x599433,null));};exports[_0xcdef('0x3d')]=function(_0x5bdcc9,_0x19aaa5){var _0x1c1eb={'raw':![],'where':{'id':_0x5bdcc9[_0xcdef('0x3e')]['id']}},_0xed18c9={};_0xed18c9['model']=_[_0xcdef('0x2b')](db[_0xcdef('0x26')][_0xcdef('0x27')]);_0xed18c9['query']=_[_0xcdef('0x2b')](_0x5bdcc9[_0xcdef('0x2c')]);_0xed18c9['filters']=_[_0xcdef('0x2f')](_0xed18c9[_0xcdef('0x2a')],_0xed18c9[_0xcdef('0x2c')]);_0x1c1eb[_0xcdef('0x2e')]=_['intersection'](_0xed18c9[_0xcdef('0x2a')],qs['fields'](_0x5bdcc9[_0xcdef('0x2c')][_0xcdef('0x3f')]));_0x1c1eb[_0xcdef('0x2e')]=_0x1c1eb[_0xcdef('0x2e')][_0xcdef('0x30')]?_0x1c1eb[_0xcdef('0x2e')]:_0xed18c9[_0xcdef('0x2a')];if(_0x5bdcc9[_0xcdef('0x2c')]['includeAll']){_0x1c1eb[_0xcdef('0x3a')]=[{'all':!![]}];}_0x1c1eb=_['merge']({},_0x1c1eb,_0x5bdcc9[_0xcdef('0x40')]);return db[_0xcdef('0x26')]['find'](_0x1c1eb)[_0xcdef('0x22')](handleEntityNotFound(_0x19aaa5,null))[_0xcdef('0x22')](respondWithResult(_0x19aaa5,null))[_0xcdef('0x41')](handleError(_0x19aaa5,null));};exports[_0xcdef('0x42')]=function(_0x3b951c,_0x4d9626){return db[_0xcdef('0x26')][_0xcdef('0x42')](_0x3b951c['body'],{})[_0xcdef('0x22')](respondWithResult(_0x4d9626,0xc9))['catch'](handleError(_0x4d9626,null));};exports[_0xcdef('0x21')]=function(_0x4761fe,_0x23f923){if(_0x4761fe[_0xcdef('0x43')]['id']){delete _0x4761fe[_0xcdef('0x43')]['id'];}return db['SugarcrmAccount'][_0xcdef('0x44')]({'where':{'id':_0x4761fe['params']['id']}})[_0xcdef('0x22')](handleEntityNotFound(_0x23f923,null))[_0xcdef('0x22')](saveUpdates(_0x4761fe[_0xcdef('0x43')],null))['then'](respondWithResult(_0x23f923,null))[_0xcdef('0x41')](handleError(_0x23f923,null));};exports['destroy']=function(_0x2369db,_0x1756a1){return db['SugarcrmAccount']['find']({'where':{'id':_0x2369db[_0xcdef('0x3e')]['id']}})[_0xcdef('0x22')](handleEntityNotFound(_0x1756a1,null))[_0xcdef('0x22')](removeEntity(_0x1756a1,null))[_0xcdef('0x41')](handleError(_0x1756a1,null));};exports[_0xcdef('0x45')]=function(_0x348330,_0x2eb67e,_0xbd82f6){var _0x237eb7={};var _0xbdb3da={};var _0x12fd5a;var _0x9a440f;return db[_0xcdef('0x26')]['findOne']({'where':{'id':_0x348330[_0xcdef('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2eb67e,null))[_0xcdef('0x22')](function(_0x23520c){if(_0x23520c){_0x12fd5a=_0x23520c;_0xbdb3da[_0xcdef('0x2a')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0xbdb3da['query']=_[_0xcdef('0x2b')](_0x348330['query']);_0xbdb3da[_0xcdef('0x2d')]=_[_0xcdef('0x2f')](_0xbdb3da[_0xcdef('0x2a')],_0xbdb3da['query']);_0x237eb7[_0xcdef('0x2e')]=_[_0xcdef('0x2f')](_0xbdb3da['model'],qs[_0xcdef('0x3f')](_0x348330[_0xcdef('0x2c')]['fields']));_0x237eb7['attributes']=_0x237eb7[_0xcdef('0x2e')][_0xcdef('0x30')]?_0x237eb7[_0xcdef('0x2e')]:_0xbdb3da[_0xcdef('0x2a')];_0x237eb7[_0xcdef('0x34')]=qs['sort'](_0x348330[_0xcdef('0x2c')][_0xcdef('0x35')]);_0x237eb7[_0xcdef('0x36')]=qs[_0xcdef('0x2d')](_[_0xcdef('0x46')](_0x348330[_0xcdef('0x2c')],_0xbdb3da[_0xcdef('0x2d')]));if(_0x348330[_0xcdef('0x2c')]['filter']){_0x237eb7[_0xcdef('0x36')]=_[_0xcdef('0x38')](_0x237eb7['where'],{'$or':_['map'](_0x237eb7[_0xcdef('0x2e')],function(_0x4966e4){var _0xf8984f={};_0xf8984f[_0x4966e4]={'$like':'%'+_0x348330['query'][_0xcdef('0x37')]+'%'};return _0xf8984f;})});}_0x237eb7=_[_0xcdef('0x38')]({},_0x237eb7,_0x348330[_0xcdef('0x40')]);return _0x12fd5a[_0xcdef('0x45')](_0x237eb7);}})['then'](function(_0x56753d){if(_0x56753d){_0x9a440f=_0x56753d[_0xcdef('0x30')];if(!_0x348330['query'][_0xcdef('0x31')](_0xcdef('0x32'))){_0x237eb7['limit']=qs[_0xcdef('0x33')](_0x348330['query'][_0xcdef('0x33')]);_0x237eb7[_0xcdef('0x1d')]=qs[_0xcdef('0x1d')](_0x348330[_0xcdef('0x2c')][_0xcdef('0x1d')]);}return _0x12fd5a[_0xcdef('0x45')](_0x237eb7);}})[_0xcdef('0x22')](function(_0x65b192){if(_0x65b192){return _0x65b192?{'count':_0x9a440f,'rows':_0x65b192}:null;}})['then'](respondWithResult(_0x2eb67e,null))[_0xcdef('0x41')](handleError(_0x2eb67e,null));};exports[_0xcdef('0x47')]=function(_0x27b323,_0x430dbf,_0x29a368){if(_0x27b323[_0xcdef('0x43')]['id']){delete _0x27b323[_0xcdef('0x43')]['id'];}return db[_0xcdef('0x26')][_0xcdef('0x48')]({'where':{'id':_0x27b323['params']['id']}})['then'](handleEntityNotFound(_0x430dbf,null))['then'](function(_0x24c533){if(_0x24c533){_0x27b323[_0xcdef('0x43')][_0xcdef('0x49')]=_0x24c533['id'];_0x27b323['body'][_0xcdef('0x4a')]=integrations['getSubjects'](_0x27b323[_0xcdef('0x43')][_0xcdef('0x4b')],_0x27b323[_0xcdef('0x43')]['type']);_0x27b323['body'][_0xcdef('0x4c')]=integrations[_0xcdef('0x4d')](_0x27b323[_0xcdef('0x43')][_0xcdef('0x4b')],_0x27b323[_0xcdef('0x43')][_0xcdef('0x28')]);return db['SugarcrmConfiguration'][_0xcdef('0x42')](_0x27b323[_0xcdef('0x43')],{'include':[{'model':db[_0xcdef('0x4e')],'as':'Subjects'},{'model':db[_0xcdef('0x4e')],'as':'Descriptions'}]});}return null;})[_0xcdef('0x22')](respondWithResult(_0x430dbf,null))[_0xcdef('0x41')](handleError(_0x430dbf,null));};exports[_0xcdef('0x4f')]=function(_0x1283af,_0x22311e,_0x241fcd){var _0x33807e='';var _0x504627=['id',_0xcdef('0x23'),_0xcdef('0x50'),'created_by',_0xcdef('0x51'),'date_start',_0xcdef('0x52'),_0xcdef('0x53'),_0xcdef('0x54'),_0xcdef('0x55'),_0xcdef('0x56'),_0xcdef('0x57')];return db[_0xcdef('0x26')][_0xcdef('0x48')]({'where':{'id':_0x1283af[_0xcdef('0x3e')]['id']},'attributes':['id',_0xcdef('0x58'),_0xcdef('0x59'),_0xcdef('0x5a')]})[_0xcdef('0x22')](handleEntityNotFound(_0x22311e,null))[_0xcdef('0x22')](function(_0x35676b){if(_0x35676b){_0x33807e=_0x35676b[_0xcdef('0x5a')];var _0x1e3147=_0x33807e[_0xcdef('0x5b')](-0x1);if(_0x1e3147==='/'){_0x33807e=_0x33807e[_0xcdef('0x5c')](0x0,_0x33807e[_0xcdef('0x5d')](_0x1e3147));}return rp({'method':_0xcdef('0x5e'),'uri':util['format']('%s%s',_0x33807e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xcdef('0x5f'),'input_type':_0xcdef('0x60'),'response_type':_0xcdef('0x60'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x35676b[_0xcdef('0x58')],'password':_0x35676b[_0xcdef('0x59')],'encryption':_0xcdef('0x61')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xcdef('0x22')](function(_0xfb4840){if(_0xfb4840&&_0xfb4840[_0xcdef('0x23')]!=='Invalid\x20Login'&&_0xfb4840[_0xcdef('0x23')]!==_0xcdef('0x62')){return rp({'method':'POST','uri':util[_0xcdef('0x63')](_0xcdef('0x64'),_0x33807e,_0xcdef('0x65')),'json':!![],'form':{'method':_0xcdef('0x66'),'input_type':_0xcdef('0x60'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xfb4840['id'],'module_name':'Calls'})}})[_0xcdef('0x22')](function(_0xf3d728){if(_0xf3d728){var _0x1750ae=_[_0xcdef('0x67')](_0xf3d728['module_fields']);_[_0xcdef('0x68')](_0x1750ae,function(_0x3343c1){return _0x504627['includes'](_0x3343c1['name']);});return{'count':_0x1750ae['length'],'rows':_['map'](_0x1750ae,function(_0x174973){return{'id':_0x174973[_0xcdef('0x23')],'name':_0x174973['label'],'custom':_[_0xcdef('0x69')](_0x174973[_0xcdef('0x23')],'_c')?!![]:![],'options':_0x174973['options']?_[_0xcdef('0x6a')](_['values'](_0x174973[_0xcdef('0x40')]),function(_0x21e633){return{'name':_0x21e633['value'],'value':_0x21e633[_0xcdef('0x23')]};}):[]};})};}})[_0xcdef('0x22')](respondWithResult(_0x22311e,null))[_0xcdef('0x41')](function(_0x2a142d){var _0x5db47a=_0x1283af[_0xcdef('0x2c')][_0xcdef('0x6b')]?0x1f4:_0x2a142d[_0xcdef('0x6c')]||0x1f4;logger[_0xcdef('0x6d')](_0xcdef('0x6e'),_0xcdef('0x4f'),_0x5db47a,JSON[_0xcdef('0x6f')](_0x2a142d));delete _0x2a142d[_0xcdef('0x23')];if(_0x5db47a===0x191){_0x5db47a=0x190;}_0x22311e[_0xcdef('0x1b')](_0x5db47a)[_0xcdef('0x24')](_0x1283af[_0xcdef('0x2c')][_0xcdef('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x2a142d['statusCode']}:_0x2a142d);});}else{var _0x81a887=0x1f4;_0x22311e[_0xcdef('0x1b')](_0x81a887)[_0xcdef('0x24')]({'message':_0xcdef('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xbeba=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','length','find','create','body','update','params','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2d920f,_0x3283fc){var _0x3494ff=function(_0x11bef6){while(--_0x11bef6){_0x2d920f['push'](_0x2d920f['shift']());}};_0x3494ff(++_0x3283fc);}(_0xbeba,0x1ca));var _0xabeb=function(_0x605af2,_0x2c8e6e){_0x605af2=_0x605af2-0x0;var _0x5b0fc3=_0xbeba[_0x605af2];return _0x5b0fc3;};'use strict';var emlformat=require(_0xabeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabeb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xabeb('0x2'));var BPromise=require(_0xabeb('0x3'));var Mustache=require(_0xabeb('0x4'));var util=require(_0xabeb('0x5'));var path=require(_0xabeb('0x6'));var sox=require(_0xabeb('0x7'));var csv=require(_0xabeb('0x8'));var ejs=require(_0xabeb('0x9'));var fs=require('fs');var fs_extra=require(_0xabeb('0xa'));var _=require(_0xabeb('0xb'));var squel=require(_0xabeb('0xc'));var crypto=require(_0xabeb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabeb('0xe'));var toCsv=require(_0xabeb('0x8'));var querystring=require(_0xabeb('0xf'));var Papa=require(_0xabeb('0x10'));var Redis=require(_0xabeb('0x11'));var authService=require(_0xabeb('0x12'));var qs=require(_0xabeb('0x13'));var as=require(_0xabeb('0x14'));var hardwareService=require(_0xabeb('0x15'));var logger=require('../../config/logger')(_0xabeb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x12eabd,_0x124133){_0x124133=_0x124133||0xcc;return function(_0x498244){if(_0x498244){return _0x12eabd['sendStatus'](_0x124133);}return _0x12eabd[_0xabeb('0x17')](_0x124133)[_0xabeb('0x18')]();};}function respondWithResult(_0x388bda,_0x44d8ae){_0x44d8ae=_0x44d8ae||0xc8;return function(_0x468f02){if(_0x468f02){return _0x388bda['status'](_0x44d8ae)['json'](_0x468f02);}};}function respondWithFilteredResult(_0x28cbaa,_0x13a986){return function(_0xadc708){if(_0xadc708){var _0x3ac395=typeof _0x13a986['offset']===_0xabeb('0x19')&&typeof _0x13a986['limit']==='undefined';var _0x3670fe=_0xadc708[_0xabeb('0x1a')];var _0x70d7b0=_0x3ac395?0x0:_0x13a986[_0xabeb('0x1b')];var _0x54733d=_0x3ac395?_0xadc708['count']:_0x13a986[_0xabeb('0x1b')]+_0x13a986[_0xabeb('0x1c')];var _0x3a0f49;if(_0x54733d>=_0x3670fe){_0x54733d=_0x3670fe;_0x3a0f49=0xc8;}else{_0x3a0f49=0xce;}_0x28cbaa[_0xabeb('0x17')](_0x3a0f49);return _0x28cbaa[_0xabeb('0x1d')](_0xabeb('0x1e'),_0x70d7b0+'-'+_0x54733d+'/'+_0x3670fe)['json'](_0xadc708);}return null;};}function patchUpdates(_0x496329){return function(_0x25f2d5){try{jsonpatch[_0xabeb('0x1f')](_0x25f2d5,_0x496329,!![]);}catch(_0x34781f){return BPromise[_0xabeb('0x20')](_0x34781f);}return _0x25f2d5[_0xabeb('0x21')]();};}function saveUpdates(_0xa402c9,_0x3cfc66){return function(_0x4bd5b4){if(_0x4bd5b4){return _0x4bd5b4['update'](_0xa402c9)[_0xabeb('0x22')](function(_0x5c6e11){return _0x5c6e11;});}return null;};}function removeEntity(_0x1695b6,_0x24651e){return function(_0x344349){if(_0x344349){return _0x344349[_0xabeb('0x23')]()['then'](function(){_0x1695b6[_0xabeb('0x17')](0xcc)[_0xabeb('0x18')]();});}};}function handleEntityNotFound(_0x4b7603,_0x416645){return function(_0x1d6e45){if(!_0x1d6e45){_0x4b7603[_0xabeb('0x24')](0x194);}return _0x1d6e45;};}function handleError(_0x5090f3,_0x2d7f10){_0x2d7f10=_0x2d7f10||0x1f4;return function(_0x2ab397){logger[_0xabeb('0x25')](_0x2ab397[_0xabeb('0x26')]);if(_0x2ab397[_0xabeb('0x27')]){delete _0x2ab397['name'];}_0x5090f3[_0xabeb('0x17')](_0x2d7f10)[_0xabeb('0x28')](_0x2ab397);};}exports[_0xabeb('0x29')]=function(_0x1061ec,_0x291335){var _0x503dfc={},_0x53ce23={},_0x4e051e={'count':0x0,'rows':[]};var _0xcdd56=_[_0xabeb('0x2a')](db[_0xabeb('0x2b')][_0xabeb('0x2c')],function(_0x4e6758){return{'name':_0x4e6758['fieldName'],'type':_0x4e6758['type'][_0xabeb('0x2d')]};});_0x53ce23[_0xabeb('0x2e')]=_['map'](_0xcdd56,_0xabeb('0x27'));_0x53ce23[_0xabeb('0x2f')]=_[_0xabeb('0x30')](_0x1061ec['query']);_0x53ce23[_0xabeb('0x31')]=_[_0xabeb('0x32')](_0x53ce23[_0xabeb('0x2e')],_0x53ce23[_0xabeb('0x2f')]);_0x503dfc[_0xabeb('0x33')]=_[_0xabeb('0x32')](_0x53ce23[_0xabeb('0x2e')],qs[_0xabeb('0x34')](_0x1061ec[_0xabeb('0x2f')]['fields']));_0x503dfc[_0xabeb('0x33')]=_0x503dfc[_0xabeb('0x33')]['length']?_0x503dfc[_0xabeb('0x33')]:_0x53ce23['model'];if(!_0x1061ec['query'][_0xabeb('0x35')](_0xabeb('0x36'))){_0x503dfc[_0xabeb('0x1c')]=qs[_0xabeb('0x1c')](_0x1061ec[_0xabeb('0x2f')][_0xabeb('0x1c')]);_0x503dfc['offset']=qs[_0xabeb('0x1b')](_0x1061ec[_0xabeb('0x2f')][_0xabeb('0x1b')]);}_0x503dfc[_0xabeb('0x37')]=qs[_0xabeb('0x38')](_0x1061ec[_0xabeb('0x2f')]['sort']);_0x503dfc[_0xabeb('0x39')]=qs[_0xabeb('0x31')](_['pick'](_0x1061ec[_0xabeb('0x2f')],_0x53ce23['filters']),_0xcdd56);if(_0x1061ec[_0xabeb('0x2f')][_0xabeb('0x3a')]){_0x503dfc['where']=_[_0xabeb('0x3b')](_0x503dfc[_0xabeb('0x39')],{'$or':_[_0xabeb('0x2a')](_0xcdd56,function(_0x52699b){if(_0x52699b[_0xabeb('0x3c')]!=='VIRTUAL'){var _0x4d5f8a={};_0x4d5f8a[_0x52699b[_0xabeb('0x27')]]={'$like':'%'+_0x1061ec[_0xabeb('0x2f')][_0xabeb('0x3a')]+'%'};return _0x4d5f8a;}})});}_0x503dfc=_[_0xabeb('0x3b')]({},_0x503dfc,_0x1061ec[_0xabeb('0x3d')]);var _0x399f10={'where':_0x503dfc[_0xabeb('0x39')]};return db['SugarcrmAccount'][_0xabeb('0x1a')](_0x399f10)['then'](function(_0x2e50c7){_0x4e051e['count']=_0x2e50c7;if(_0x1061ec[_0xabeb('0x2f')][_0xabeb('0x3e')]){_0x503dfc[_0xabeb('0x3f')]=[{'all':!![]}];}return db[_0xabeb('0x2b')]['findAll'](_0x503dfc);})[_0xabeb('0x22')](function(_0x515b19){_0x4e051e[_0xabeb('0x40')]=_0x515b19;return _0x4e051e;})[_0xabeb('0x22')](respondWithFilteredResult(_0x291335,_0x503dfc))[_0xabeb('0x41')](handleError(_0x291335,null));};exports[_0xabeb('0x42')]=function(_0x1ba037,_0x5ddffd){var _0x3bed29={'raw':![],'where':{'id':_0x1ba037['params']['id']}},_0x56c912={};_0x56c912[_0xabeb('0x2e')]=_[_0xabeb('0x30')](db['SugarcrmAccount'][_0xabeb('0x2c')]);_0x56c912['query']=_[_0xabeb('0x30')](_0x1ba037[_0xabeb('0x2f')]);_0x56c912[_0xabeb('0x31')]=_[_0xabeb('0x32')](_0x56c912[_0xabeb('0x2e')],_0x56c912[_0xabeb('0x2f')]);_0x3bed29[_0xabeb('0x33')]=_[_0xabeb('0x32')](_0x56c912[_0xabeb('0x2e')],qs[_0xabeb('0x34')](_0x1ba037['query']['fields']));_0x3bed29['attributes']=_0x3bed29['attributes'][_0xabeb('0x43')]?_0x3bed29['attributes']:_0x56c912[_0xabeb('0x2e')];if(_0x1ba037['query'][_0xabeb('0x3e')]){_0x3bed29['include']=[{'all':!![]}];}_0x3bed29=_['merge']({},_0x3bed29,_0x1ba037[_0xabeb('0x3d')]);return db[_0xabeb('0x2b')][_0xabeb('0x44')](_0x3bed29)[_0xabeb('0x22')](handleEntityNotFound(_0x5ddffd,null))['then'](respondWithResult(_0x5ddffd,null))['catch'](handleError(_0x5ddffd,null));};exports[_0xabeb('0x45')]=function(_0x2a932e,_0x3ee21c){return db[_0xabeb('0x2b')]['create'](_0x2a932e[_0xabeb('0x46')],{})[_0xabeb('0x22')](respondWithResult(_0x3ee21c,0xc9))['catch'](handleError(_0x3ee21c,null));};exports[_0xabeb('0x47')]=function(_0x1b1bcb,_0x3b9aa5){if(_0x1b1bcb['body']['id']){delete _0x1b1bcb[_0xabeb('0x46')]['id'];}return db['SugarcrmAccount'][_0xabeb('0x44')]({'where':{'id':_0x1b1bcb[_0xabeb('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b9aa5,null))[_0xabeb('0x22')](saveUpdates(_0x1b1bcb[_0xabeb('0x46')],null))[_0xabeb('0x22')](respondWithResult(_0x3b9aa5,null))[_0xabeb('0x41')](handleError(_0x3b9aa5,null));};exports['destroy']=function(_0x787e0d,_0x4ece71){return db['SugarcrmAccount'][_0xabeb('0x44')]({'where':{'id':_0x787e0d[_0xabeb('0x48')]['id']}})[_0xabeb('0x22')](handleEntityNotFound(_0x4ece71,null))[_0xabeb('0x22')](removeEntity(_0x4ece71,null))[_0xabeb('0x41')](handleError(_0x4ece71,null));};exports['getConfigurations']=function(_0x395a57,_0x4a69da,_0x38c972){var _0x2eca76={};var _0x21b4aa={};var _0x296111;var _0x4b03ae;return db[_0xabeb('0x2b')][_0xabeb('0x49')]({'where':{'id':_0x395a57[_0xabeb('0x48')]['id']}})[_0xabeb('0x22')](handleEntityNotFound(_0x4a69da,null))['then'](function(_0x202fe6){if(_0x202fe6){_0x296111=_0x202fe6;_0x21b4aa[_0xabeb('0x2e')]=_[_0xabeb('0x30')](db[_0xabeb('0x4a')][_0xabeb('0x2c')]);_0x21b4aa[_0xabeb('0x2f')]=_[_0xabeb('0x30')](_0x395a57[_0xabeb('0x2f')]);_0x21b4aa[_0xabeb('0x31')]=_[_0xabeb('0x32')](_0x21b4aa[_0xabeb('0x2e')],_0x21b4aa[_0xabeb('0x2f')]);_0x2eca76[_0xabeb('0x33')]=_['intersection'](_0x21b4aa[_0xabeb('0x2e')],qs[_0xabeb('0x34')](_0x395a57[_0xabeb('0x2f')][_0xabeb('0x34')]));_0x2eca76[_0xabeb('0x33')]=_0x2eca76['attributes'][_0xabeb('0x43')]?_0x2eca76[_0xabeb('0x33')]:_0x21b4aa[_0xabeb('0x2e')];_0x2eca76[_0xabeb('0x37')]=qs['sort'](_0x395a57[_0xabeb('0x2f')][_0xabeb('0x38')]);_0x2eca76[_0xabeb('0x39')]=qs[_0xabeb('0x31')](_['pick'](_0x395a57[_0xabeb('0x2f')],_0x21b4aa[_0xabeb('0x31')]));if(_0x395a57[_0xabeb('0x2f')][_0xabeb('0x3a')]){_0x2eca76[_0xabeb('0x39')]=_['merge'](_0x2eca76['where'],{'$or':_[_0xabeb('0x2a')](_0x2eca76[_0xabeb('0x33')],function(_0x19dca2){var _0x45bfc6={};_0x45bfc6[_0x19dca2]={'$like':'%'+_0x395a57[_0xabeb('0x2f')][_0xabeb('0x3a')]+'%'};return _0x45bfc6;})});}_0x2eca76=_[_0xabeb('0x3b')]({},_0x2eca76,_0x395a57[_0xabeb('0x3d')]);return _0x296111[_0xabeb('0x4b')](_0x2eca76);}})[_0xabeb('0x22')](function(_0x17c87a){if(_0x17c87a){_0x4b03ae=_0x17c87a[_0xabeb('0x43')];if(!_0x395a57['query'][_0xabeb('0x35')](_0xabeb('0x36'))){_0x2eca76[_0xabeb('0x1c')]=qs['limit'](_0x395a57[_0xabeb('0x2f')][_0xabeb('0x1c')]);_0x2eca76[_0xabeb('0x1b')]=qs[_0xabeb('0x1b')](_0x395a57['query'][_0xabeb('0x1b')]);}return _0x296111[_0xabeb('0x4b')](_0x2eca76);}})['then'](function(_0x4ad7a5){if(_0x4ad7a5){return _0x4ad7a5?{'count':_0x4b03ae,'rows':_0x4ad7a5}:null;}})[_0xabeb('0x22')](respondWithResult(_0x4a69da,null))[_0xabeb('0x41')](handleError(_0x4a69da,null));};exports[_0xabeb('0x4c')]=function(_0x14dff3,_0x43256e,_0x165cc0){if(_0x14dff3[_0xabeb('0x46')]['id']){delete _0x14dff3[_0xabeb('0x46')]['id'];}return db[_0xabeb('0x2b')][_0xabeb('0x49')]({'where':{'id':_0x14dff3['params']['id']}})[_0xabeb('0x22')](handleEntityNotFound(_0x43256e,null))[_0xabeb('0x22')](function(_0xd4059){if(_0xd4059){_0x14dff3['body'][_0xabeb('0x4d')]=_0xd4059['id'];_0x14dff3[_0xabeb('0x46')][_0xabeb('0x4e')]=integrations[_0xabeb('0x4f')](_0x14dff3['body'][_0xabeb('0x50')],_0x14dff3[_0xabeb('0x46')][_0xabeb('0x3c')]);_0x14dff3[_0xabeb('0x46')][_0xabeb('0x51')]=integrations[_0xabeb('0x52')](_0x14dff3[_0xabeb('0x46')][_0xabeb('0x50')],_0x14dff3[_0xabeb('0x46')][_0xabeb('0x3c')]);return db['SugarcrmConfiguration'][_0xabeb('0x45')](_0x14dff3[_0xabeb('0x46')],{'include':[{'model':db[_0xabeb('0x53')],'as':_0xabeb('0x4e')},{'model':db['SugarcrmField'],'as':_0xabeb('0x51')}]});}return null;})['then'](respondWithResult(_0x43256e,null))[_0xabeb('0x41')](handleError(_0x43256e,null));};exports['getFields']=function(_0x4d6bd1,_0xe57583,_0x2a5562){var _0x234c80='';var _0x40eeba=['id',_0xabeb('0x27'),_0xabeb('0x54'),_0xabeb('0x55'),_0xabeb('0x56'),_0xabeb('0x57'),'duration_hours',_0xabeb('0x58'),_0xabeb('0x59'),'parent_type',_0xabeb('0x5a'),'direction'];return db[_0xabeb('0x2b')][_0xabeb('0x49')]({'where':{'id':_0x4d6bd1[_0xabeb('0x48')]['id']},'attributes':['id','username',_0xabeb('0x5b'),_0xabeb('0x5c')]})['then'](handleEntityNotFound(_0xe57583,null))[_0xabeb('0x22')](function(_0x25e3d7){if(_0x25e3d7){_0x234c80=_0x25e3d7[_0xabeb('0x5c')];var _0x2f5a64=_0x234c80[_0xabeb('0x5d')](-0x1);if(_0x2f5a64==='/'){_0x234c80=_0x234c80['substring'](0x0,_0x234c80[_0xabeb('0x5e')](_0x2f5a64));}return rp({'method':_0xabeb('0x5f'),'uri':util[_0xabeb('0x60')](_0xabeb('0x61'),_0x234c80,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xabeb('0x62'),'input_type':_0xabeb('0x63'),'response_type':'JSON','rest_data':JSON[_0xabeb('0x64')]({'user_auth':{'user_name':_0x25e3d7[_0xabeb('0x65')],'password':_0x25e3d7['password'],'encryption':_0xabeb('0x66')},'application':_0xabeb('0x67')})}});}})['then'](function(_0x38f480){if(_0x38f480&&_0x38f480[_0xabeb('0x27')]!=='Invalid\x20Login'&&_0x38f480['name']!==_0xabeb('0x68')){return rp({'method':_0xabeb('0x5f'),'uri':util['format'](_0xabeb('0x61'),_0x234c80,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xabeb('0x69'),'input_type':_0xabeb('0x63'),'response_type':_0xabeb('0x63'),'rest_data':JSON[_0xabeb('0x64')]({'session':_0x38f480['id'],'module_name':_0xabeb('0x6a')})}})[_0xabeb('0x22')](function(_0x348638){if(_0x348638){var _0x51cf9b=_[_0xabeb('0x6b')](_0x348638[_0xabeb('0x6c')]);_[_0xabeb('0x6d')](_0x51cf9b,function(_0x1e425e){return _0x40eeba[_0xabeb('0x6e')](_0x1e425e[_0xabeb('0x27')]);});return{'count':_0x51cf9b[_0xabeb('0x43')],'rows':_[_0xabeb('0x2a')](_0x51cf9b,function(_0x1ea213){return{'id':_0x1ea213[_0xabeb('0x27')],'name':_0x1ea213[_0xabeb('0x6f')],'custom':_[_0xabeb('0x70')](_0x1ea213[_0xabeb('0x27')],'_c')?!![]:![],'options':_0x1ea213[_0xabeb('0x3d')]?_['map'](_['values'](_0x1ea213[_0xabeb('0x3d')]),function(_0x32a0d1){return{'name':_0x32a0d1[_0xabeb('0x71')],'value':_0x32a0d1['name']};}):[]};})};}})[_0xabeb('0x22')](respondWithResult(_0xe57583,null))['catch'](function(_0x339511){var _0x3c40e3=_0x4d6bd1[_0xabeb('0x2f')][_0xabeb('0x72')]?0x1f4:_0x339511[_0xabeb('0x73')]||0x1f4;logger[_0xabeb('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xabeb('0x74'),_0x3c40e3,JSON[_0xabeb('0x64')](_0x339511));delete _0x339511[_0xabeb('0x27')];if(_0x3c40e3===0x191){_0x3c40e3=0x190;}_0xe57583['status'](_0x3c40e3)[_0xabeb('0x28')](_0x4d6bd1[_0xabeb('0x2f')][_0xabeb('0x72')]?{'message':_0xabeb('0x75'),'statusCode':_0x339511[_0xabeb('0x73')]}:_0x339511);});}else{var _0x27e5a2=0x1f4;_0xe57583[_0xabeb('0x17')](_0x27e5a2)[_0xabeb('0x28')]({'message':_0xabeb('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 3490077..7cb0d79 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 _0x7dd1=['int_sugarcrm_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','SugarcrmAccount'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7dd1,0x169));var _0x17dd=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7dd1[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x17dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x17dd('0x1'));var moment=require(_0x17dd('0x2'));var BPromise=require(_0x17dd('0x3'));var rp=require(_0x17dd('0x4'));var fs=require('fs');var path=require(_0x17dd('0x5'));var rimraf=require(_0x17dd('0x6'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x17dd('0x7'));module['exports']=function(_0x215ec8,_0x1b9038){return _0x215ec8['define'](_0x17dd('0x8'),attributes,{'tableName':_0x17dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd592=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x184150,_0xbf93a7){var _0x25c714=function(_0x4ad062){while(--_0x4ad062){_0x184150['push'](_0x184150['shift']());}};_0x25c714(++_0xbf93a7);}(_0xd592,0x1ec));var _0x2d59=function(_0x27fd19,_0x551f02){_0x27fd19=_0x27fd19-0x0;var _0x4e8bec=_0xd592[_0x27fd19];return _0x4e8bec;};'use strict';var _=require(_0x2d59('0x0'));var util=require(_0x2d59('0x1'));var logger=require(_0x2d59('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2d59('0x3'));var rp=require(_0x2d59('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d59('0x5'));var config=require(_0x2d59('0x6'));var attributes=require(_0x2d59('0x7'));var integrations=require(_0x2d59('0x8'));module[_0x2d59('0x9')]=function(_0x209f0c,_0x38d58e){return _0x209f0c[_0x2d59('0xa')](_0x2d59('0xb'),attributes,{'tableName':_0x2d59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 3a66f5c..d0558a0 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 _0xf8ec=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','model','include','map','stringify','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf8ec,0x103));var _0xcf8e=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xf8ec[_0x257642];return _0x3d813b;};'use strict';var _=require(_0xcf8e('0x0'));var util=require(_0xcf8e('0x1'));var moment=require(_0xcf8e('0x2'));var BPromise=require(_0xcf8e('0x3'));var rs=require(_0xcf8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf8e('0x5'))['db'];var utils=require(_0xcf8e('0x6'));var logger=require(_0xcf8e('0x7'))(_0xcf8e('0x8'));var config=require(_0xcf8e('0x9'));var jayson=require(_0xcf8e('0xa'));var client=jayson[_0xcf8e('0xb')][_0xcf8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50ee15,_0x4117be,_0x5ef746){return new BPromise(function(_0x4e9bb8,_0x518de7){return client[_0xcf8e('0xd')](_0x50ee15,_0x5ef746)[_0xcf8e('0xe')](function(_0x59145e){logger[_0xcf8e('0xf')](_0xcf8e('0x10'),_0x4117be,_0xcf8e('0x11'));logger[_0xcf8e('0x12')](_0xcf8e('0x13'),_0x4117be,_0xcf8e('0x11'),JSON['stringify'](_0x59145e));if(_0x59145e[_0xcf8e('0x14')]){if(_0x59145e[_0xcf8e('0x14')][_0xcf8e('0x15')]===0x1f4){logger[_0xcf8e('0x14')](_0xcf8e('0x10'),_0x4117be,_0x59145e[_0xcf8e('0x14')][_0xcf8e('0x16')]);return _0x518de7(_0x59145e[_0xcf8e('0x14')]['message']);}logger[_0xcf8e('0x14')](_0xcf8e('0x10'),_0x4117be,_0x59145e[_0xcf8e('0x14')][_0xcf8e('0x16')]);return _0x4e9bb8(_0x59145e['error'][_0xcf8e('0x16')]);}else{logger[_0xcf8e('0xf')](_0xcf8e('0x10'),_0x4117be,_0xcf8e('0x11'));_0x4e9bb8(_0x59145e[_0xcf8e('0x17')]['message']);}})[_0xcf8e('0x18')](function(_0x1721e0){logger[_0xcf8e('0x14')](_0xcf8e('0x10'),_0x4117be,_0x1721e0);_0x518de7(_0x1721e0);});});}exports[_0xcf8e('0x19')]=function(_0x4a22b3){var _0x37f2c4=this;return new Promise(function(_0x18bf4d,_0x27b3bf){return db[_0xcf8e('0x1a')][_0xcf8e('0x1b')]({'raw':_0x4a22b3[_0xcf8e('0x1c')]?_0x4a22b3['options'][_0xcf8e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a22b3['options']?_0x4a22b3[_0xcf8e('0x1c')][_0xcf8e('0x1e')]||null:null,'attributes':_0x4a22b3[_0xcf8e('0x1c')]?_0x4a22b3[_0xcf8e('0x1c')][_0xcf8e('0x1f')]||null:null,'limit':_0x4a22b3[_0xcf8e('0x1c')]?_0x4a22b3[_0xcf8e('0x1c')]['limit']||null:null,'include':_0x4a22b3[_0xcf8e('0x1c')]?_0x4a22b3[_0xcf8e('0x1c')]['include']?_['map'](_0x4a22b3[_0xcf8e('0x1c')]['include'],function(_0x2c0d99){return{'model':db[_0x2c0d99[_0xcf8e('0x20')]],'as':_0x2c0d99['as'],'attributes':_0x2c0d99[_0xcf8e('0x1f')],'include':_0x2c0d99[_0xcf8e('0x21')]?_[_0xcf8e('0x22')](_0x2c0d99[_0xcf8e('0x21')],function(_0x5070fe){return{'model':db[_0x5070fe['model']],'as':_0x5070fe['as'],'attributes':_0x5070fe['attributes'],'include':_0x5070fe[_0xcf8e('0x21')]?_[_0xcf8e('0x22')](_0x5070fe['include'],function(_0x772662){return{'model':db[_0x772662[_0xcf8e('0x20')]],'as':_0x772662['as'],'attributes':_0x772662[_0xcf8e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf8e('0xe')](function(_0x79664){logger[_0xcf8e('0xf')](_0xcf8e('0x19'),_0x4a22b3);logger[_0xcf8e('0x12')](_0xcf8e('0x19'),_0x4a22b3,JSON[_0xcf8e('0x23')](_0x79664));_0x18bf4d(_0x79664);})[_0xcf8e('0x18')](function(_0x3db793){logger['error'](_0xcf8e('0x19'),_0x3db793[_0xcf8e('0x16')],_0x4a22b3);_0x27b3bf(_0x37f2c4[_0xcf8e('0x14')](0x1f4,_0x3db793['message']));});});};exports[_0xcf8e('0x24')]=function(_0x56cd55){var _0x597300=this;return new Promise(function(_0x5c62dd,_0x1da66c){return db[_0xcf8e('0x1a')][_0xcf8e('0x25')]({'raw':_0x56cd55[_0xcf8e('0x1c')]?_0x56cd55[_0xcf8e('0x1c')][_0xcf8e('0x1d')]===undefined?!![]:![]:!![],'where':_0x56cd55[_0xcf8e('0x1c')]?_0x56cd55[_0xcf8e('0x1c')]['where']||null:null,'attributes':_0x56cd55[_0xcf8e('0x1c')]?_0x56cd55[_0xcf8e('0x1c')]['attributes']||null:null,'include':_0x56cd55[_0xcf8e('0x1c')]?_0x56cd55[_0xcf8e('0x1c')][_0xcf8e('0x21')]?_['map'](_0x56cd55['options']['include'],function(_0x5aad23){return{'model':db[_0x5aad23[_0xcf8e('0x20')]],'as':_0x5aad23['as'],'attributes':_0x5aad23[_0xcf8e('0x1f')],'include':_0x5aad23['include']?_[_0xcf8e('0x22')](_0x5aad23[_0xcf8e('0x21')],function(_0x3387e5){return{'model':db[_0x3387e5['model']],'as':_0x3387e5['as'],'attributes':_0x3387e5[_0xcf8e('0x1f')],'include':_0x3387e5['include']?_[_0xcf8e('0x22')](_0x3387e5[_0xcf8e('0x21')],function(_0xcf2b85){return{'model':db[_0xcf2b85[_0xcf8e('0x20')]],'as':_0xcf2b85['as'],'attributes':_0xcf2b85[_0xcf8e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf8e('0xe')](function(_0x11c2a4){logger['info'](_0xcf8e('0x24'),_0x56cd55);logger[_0xcf8e('0x12')](_0xcf8e('0x24'),_0x56cd55,JSON['stringify'](_0x11c2a4));_0x5c62dd(_0x11c2a4);})[_0xcf8e('0x18')](function(_0x43170a){logger[_0xcf8e('0x14')](_0xcf8e('0x24'),_0x43170a[_0xcf8e('0x16')],_0x56cd55);_0x1da66c(_0x597300['error'](0x1f4,_0x43170a['message']));});});}; \ No newline at end of file +var _0x894e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','options','raw','where','attributes','include','map','model','then','ShowSugarcrmAccount','find'];(function(_0x544190,_0x17e4e7){var _0x4b5176=function(_0x1b68d4){while(--_0x1b68d4){_0x544190['push'](_0x544190['shift']());}};_0x4b5176(++_0x17e4e7);}(_0x894e,0x1ba));var _0xe894=function(_0x20b8d,_0x471e78){_0x20b8d=_0x20b8d-0x0;var _0x44b833=_0x894e[_0x20b8d];return _0x44b833;};'use strict';var _=require(_0xe894('0x0'));var util=require(_0xe894('0x1'));var moment=require('moment');var BPromise=require(_0xe894('0x2'));var rs=require(_0xe894('0x3'));var fs=require('fs');var Redis=require(_0xe894('0x4'));var db=require(_0xe894('0x5'))['db'];var utils=require(_0xe894('0x6'));var logger=require(_0xe894('0x7'))(_0xe894('0x8'));var config=require(_0xe894('0x9'));var jayson=require(_0xe894('0xa'));var client=jayson['client'][_0xe894('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b3a65,_0x3e1410,_0x3c7303){return new BPromise(function(_0x5e16db,_0x22b4e3){return client[_0xe894('0xc')](_0x5b3a65,_0x3c7303)['then'](function(_0x338dd5){logger[_0xe894('0xd')](_0xe894('0xe'),_0x3e1410,_0xe894('0xf'));logger[_0xe894('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3e1410,_0xe894('0xf'),JSON[_0xe894('0x11')](_0x338dd5));if(_0x338dd5[_0xe894('0x12')]){if(_0x338dd5[_0xe894('0x12')][_0xe894('0x13')]===0x1f4){logger[_0xe894('0x12')](_0xe894('0xe'),_0x3e1410,_0x338dd5[_0xe894('0x12')][_0xe894('0x14')]);return _0x22b4e3(_0x338dd5[_0xe894('0x12')][_0xe894('0x14')]);}logger[_0xe894('0x12')](_0xe894('0xe'),_0x3e1410,_0x338dd5[_0xe894('0x12')]['message']);return _0x5e16db(_0x338dd5['error']['message']);}else{logger[_0xe894('0xd')](_0xe894('0xe'),_0x3e1410,_0xe894('0xf'));_0x5e16db(_0x338dd5[_0xe894('0x15')][_0xe894('0x14')]);}})[_0xe894('0x16')](function(_0x91698a){logger[_0xe894('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3e1410,_0x91698a);_0x22b4e3(_0x91698a);});});}exports[_0xe894('0x17')]=function(_0x1ed369){var _0x4683af=this;return new Promise(function(_0x4cc5a5,_0x2c7b61){return db['SugarcrmAccount']['findAll']({'raw':_0x1ed369[_0xe894('0x18')]?_0x1ed369['options'][_0xe894('0x19')]===undefined?!![]:![]:!![],'where':_0x1ed369['options']?_0x1ed369['options'][_0xe894('0x1a')]||null:null,'attributes':_0x1ed369[_0xe894('0x18')]?_0x1ed369[_0xe894('0x18')][_0xe894('0x1b')]||null:null,'limit':_0x1ed369[_0xe894('0x18')]?_0x1ed369[_0xe894('0x18')]['limit']||null:null,'include':_0x1ed369[_0xe894('0x18')]?_0x1ed369[_0xe894('0x18')][_0xe894('0x1c')]?_[_0xe894('0x1d')](_0x1ed369[_0xe894('0x18')]['include'],function(_0x2aa3d4){return{'model':db[_0x2aa3d4['model']],'as':_0x2aa3d4['as'],'attributes':_0x2aa3d4['attributes'],'include':_0x2aa3d4['include']?_[_0xe894('0x1d')](_0x2aa3d4[_0xe894('0x1c')],function(_0x22fa39){return{'model':db[_0x22fa39['model']],'as':_0x22fa39['as'],'attributes':_0x22fa39['attributes'],'include':_0x22fa39['include']?_[_0xe894('0x1d')](_0x22fa39[_0xe894('0x1c')],function(_0x49d513){return{'model':db[_0x49d513[_0xe894('0x1e')]],'as':_0x49d513['as'],'attributes':_0x49d513['attributes']};}):[]};}):[]};}):[]:[]})[_0xe894('0x1f')](function(_0x273e63){logger[_0xe894('0xd')](_0xe894('0x17'),_0x1ed369);logger[_0xe894('0x10')](_0xe894('0x17'),_0x1ed369,JSON[_0xe894('0x11')](_0x273e63));_0x4cc5a5(_0x273e63);})[_0xe894('0x16')](function(_0x2bbd9e){logger['error'](_0xe894('0x17'),_0x2bbd9e[_0xe894('0x14')],_0x1ed369);_0x2c7b61(_0x4683af[_0xe894('0x12')](0x1f4,_0x2bbd9e[_0xe894('0x14')]));});});};exports[_0xe894('0x20')]=function(_0x280d76){var _0x3d658=this;return new Promise(function(_0x558280,_0x380470){return db['SugarcrmAccount'][_0xe894('0x21')]({'raw':_0x280d76['options']?_0x280d76[_0xe894('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x280d76[_0xe894('0x18')]?_0x280d76[_0xe894('0x18')][_0xe894('0x1a')]||null:null,'attributes':_0x280d76[_0xe894('0x18')]?_0x280d76[_0xe894('0x18')][_0xe894('0x1b')]||null:null,'include':_0x280d76[_0xe894('0x18')]?_0x280d76[_0xe894('0x18')][_0xe894('0x1c')]?_[_0xe894('0x1d')](_0x280d76[_0xe894('0x18')][_0xe894('0x1c')],function(_0x23eab5){return{'model':db[_0x23eab5[_0xe894('0x1e')]],'as':_0x23eab5['as'],'attributes':_0x23eab5[_0xe894('0x1b')],'include':_0x23eab5[_0xe894('0x1c')]?_[_0xe894('0x1d')](_0x23eab5['include'],function(_0x3d9043){return{'model':db[_0x3d9043[_0xe894('0x1e')]],'as':_0x3d9043['as'],'attributes':_0x3d9043[_0xe894('0x1b')],'include':_0x3d9043[_0xe894('0x1c')]?_[_0xe894('0x1d')](_0x3d9043[_0xe894('0x1c')],function(_0x1fcdb6){return{'model':db[_0x1fcdb6[_0xe894('0x1e')]],'as':_0x1fcdb6['as'],'attributes':_0x1fcdb6[_0xe894('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cdc38){logger[_0xe894('0xd')]('ShowSugarcrmAccount',_0x280d76);logger[_0xe894('0x10')](_0xe894('0x20'),_0x280d76,JSON[_0xe894('0x11')](_0x2cdc38));_0x558280(_0x2cdc38);})[_0xe894('0x16')](function(_0x51da6d){logger[_0xe894('0x12')]('ShowSugarcrmAccount',_0x51da6d[_0xe894('0x14')],_0x280d76);_0x380470(_0x3d658[_0xe894('0x12')](0x1f4,_0x51da6d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index dc61cd3..5449d40 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 _0x60cb=['getSubjects','/:id/descriptions','getDescriptions','post','create','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects'];(function(_0x5a3c66,_0x45bd34){var _0x152866=function(_0x43f3a3){while(--_0x43f3a3){_0x5a3c66['push'](_0x5a3c66['shift']());}};_0x152866(++_0x45bd34);}(_0x60cb,0x9a));var _0xb60c=function(_0x5cc5dc,_0x5e4bf2){_0x5cc5dc=_0x5cc5dc-0x0;var _0x36c5fe=_0x60cb[_0x5cc5dc];return _0x36c5fe;};'use strict';var multer=require(_0xb60c('0x0'));var util=require(_0xb60c('0x1'));var path=require(_0xb60c('0x2'));var timeout=require(_0xb60c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb60c('0x4'));var interaction=require(_0xb60c('0x5'));var config=require(_0xb60c('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0xb60c('0x7')](),controller[_0xb60c('0x8')]);router[_0xb60c('0x9')](_0xb60c('0xa'),auth[_0xb60c('0x7')](),controller[_0xb60c('0xb')]);router[_0xb60c('0x9')](_0xb60c('0xc'),auth[_0xb60c('0x7')](),controller['getFields']);router[_0xb60c('0x9')](_0xb60c('0xd'),auth[_0xb60c('0x7')](),controller[_0xb60c('0xe')]);router['get'](_0xb60c('0xf'),auth['isAuthenticated'](),controller[_0xb60c('0x10')]);router[_0xb60c('0x11')]('/',auth[_0xb60c('0x7')](),controller[_0xb60c('0x12')]);router['put']('/:id',auth[_0xb60c('0x7')](),controller['update']);router[_0xb60c('0x13')](_0xb60c('0xa'),auth[_0xb60c('0x7')](),controller['destroy']);module[_0xb60c('0x14')]=router; \ No newline at end of file +var _0xacc5=['delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0xac18e5,_0x206f79){var _0x4eda4b=function(_0xe0415a){while(--_0xe0415a){_0xac18e5['push'](_0xac18e5['shift']());}};_0x4eda4b(++_0x206f79);}(_0xacc5,0xe4));var _0x5acc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xacc5[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5acc('0x0'));var router=express[_0x5acc('0x1')]();var fs_extra=require(_0x5acc('0x2'));var auth=require(_0x5acc('0x3'));var interaction=require(_0x5acc('0x4'));var config=require(_0x5acc('0x5'));var controller=require(_0x5acc('0x6'));router[_0x5acc('0x7')]('/',auth[_0x5acc('0x8')](),controller[_0x5acc('0x9')]);router[_0x5acc('0x7')](_0x5acc('0xa'),auth[_0x5acc('0x8')](),controller[_0x5acc('0xb')]);router[_0x5acc('0x7')](_0x5acc('0xc'),auth[_0x5acc('0x8')](),controller[_0x5acc('0xd')]);router['get'](_0x5acc('0xe'),auth[_0x5acc('0x8')](),controller[_0x5acc('0xf')]);router[_0x5acc('0x7')](_0x5acc('0x10'),auth[_0x5acc('0x8')](),controller[_0x5acc('0x11')]);router[_0x5acc('0x12')]('/',auth[_0x5acc('0x8')](),controller[_0x5acc('0x13')]);router[_0x5acc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5acc('0x15')]);router[_0x5acc('0x16')](_0x5acc('0xa'),auth['isAuthenticated'](),controller[_0x5acc('0x17')]);module[_0x5acc('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 7440c1d..eb2fa00 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 _0xa570=['sequelize','STRING'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0xa570,0x80));var _0x0a57=function(_0x53d845,_0x15f08f){_0x53d845=_0x53d845-0x0;var _0x2532c1=_0xa570[_0x53d845];return _0x2532c1;};'use strict';var Sequelize=require(_0x0a57('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a57('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x47af=['sequelize','exports','STRING'];(function(_0x2dee81,_0x58c3df){var _0xa3a214=function(_0x459326){while(--_0x459326){_0x2dee81['push'](_0x2dee81['shift']());}};_0xa3a214(++_0x58c3df);}(_0x47af,0x16e));var _0xf47a=function(_0xd2e41f,_0x8d91be){_0xd2e41f=_0xd2e41f-0x0;var _0x32e3fe=_0x47af[_0xd2e41f];return _0x32e3fe;};'use strict';var Sequelize=require(_0xf47a('0x0'));module[_0xf47a('0x1')]={'name':{'type':Sequelize[_0xf47a('0x2')]},'description':{'type':Sequelize[_0xf47a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5c9b4a0..820571f 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 _0xe91c=['fields','model','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SugarcrmConfiguration','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','getFields','findOne','SugarcrmField','pick','map','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','type','key','keys','query','filters','intersection','attributes'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xe91c,0x108));var _0xce91=function(_0x2c2d82,_0x2ddbb5){_0x2c2d82=_0x2c2d82-0x0;var _0x1c4ff4=_0xe91c[_0x2c2d82];return _0x1c4ff4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce91('0x0'));var zipdir=require(_0xce91('0x1'));var jsonpatch=require(_0xce91('0x2'));var rp=require(_0xce91('0x3'));var moment=require('moment');var BPromise=require(_0xce91('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xce91('0x5'));var sox=require(_0xce91('0x6'));var csv=require(_0xce91('0x7'));var ejs=require(_0xce91('0x8'));var fs=require('fs');var fs_extra=require(_0xce91('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce91('0xa'));var jsforce=require(_0xce91('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xce91('0x7'));var querystring=require(_0xce91('0xc'));var Papa=require(_0xce91('0xd'));var Redis=require('ioredis');var authService=require(_0xce91('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xce91('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce91('0x10'))(_0xce91('0x11'));var utils=require(_0xce91('0x12'));var config=require(_0xce91('0x13'));var licenseUtil=require(_0xce91('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda1d94,_0x54d357){_0x54d357=_0x54d357||0xcc;return function(_0x231e90){if(_0x231e90){return _0xda1d94['sendStatus'](_0x54d357);}return _0xda1d94['status'](_0x54d357)[_0xce91('0x15')]();};}function respondWithResult(_0x42a26a,_0x1ddfb3){_0x1ddfb3=_0x1ddfb3||0xc8;return function(_0x17dba4){if(_0x17dba4){return _0x42a26a[_0xce91('0x16')](_0x1ddfb3)[_0xce91('0x17')](_0x17dba4);}};}function respondWithFilteredResult(_0xa1d537,_0x25b97b){return function(_0x58ab94){if(_0x58ab94){var _0x5746f3=typeof _0x25b97b[_0xce91('0x18')]==='undefined'&&typeof _0x25b97b[_0xce91('0x19')]===_0xce91('0x1a');var _0x1bce09=_0x58ab94[_0xce91('0x1b')];var _0x137fdb=_0x5746f3?0x0:_0x25b97b['offset'];var _0x1d8ddd=_0x5746f3?_0x58ab94[_0xce91('0x1b')]:_0x25b97b[_0xce91('0x18')]+_0x25b97b[_0xce91('0x19')];var _0x1fac89;if(_0x1d8ddd>=_0x1bce09){_0x1d8ddd=_0x1bce09;_0x1fac89=0xc8;}else{_0x1fac89=0xce;}_0xa1d537[_0xce91('0x16')](_0x1fac89);return _0xa1d537[_0xce91('0x1c')](_0xce91('0x1d'),_0x137fdb+'-'+_0x1d8ddd+'/'+_0x1bce09)['json'](_0x58ab94);}return null;};}function patchUpdates(_0xfdd337){return function(_0x312338){try{jsonpatch[_0xce91('0x1e')](_0x312338,_0xfdd337,!![]);}catch(_0x28bde0){return BPromise[_0xce91('0x1f')](_0x28bde0);}return _0x312338[_0xce91('0x20')]();};}function saveUpdates(_0xc7a72f,_0x510c0b){return function(_0x3eb054){if(_0x3eb054){return _0x3eb054[_0xce91('0x21')](_0xc7a72f)[_0xce91('0x22')](function(_0x40cc47){return _0x40cc47;});}return null;};}function removeEntity(_0x13d45c,_0x537cf3){return function(_0x780dd5){if(_0x780dd5){return _0x780dd5['destroy']()[_0xce91('0x22')](function(){_0x13d45c[_0xce91('0x16')](0xcc)[_0xce91('0x15')]();});}};}function handleEntityNotFound(_0x34a443,_0x1e5f3c){return function(_0x1d6b10){if(!_0x1d6b10){_0x34a443['sendStatus'](0x194);}return _0x1d6b10;};}function handleError(_0x23a510,_0x391d1f){_0x391d1f=_0x391d1f||0x1f4;return function(_0x12d97e){logger[_0xce91('0x23')](_0x12d97e[_0xce91('0x24')]);if(_0x12d97e[_0xce91('0x25')]){delete _0x12d97e[_0xce91('0x25')];}_0x23a510[_0xce91('0x16')](_0x391d1f)[_0xce91('0x26')](_0x12d97e);};}exports[_0xce91('0x27')]=function(_0x1e9212,_0x26e95c){var _0x46c12c={},_0x13b5b7={},_0x28e264={'count':0x0,'rows':[]};var _0xe63730=_['map'](db['SugarcrmConfiguration'][_0xce91('0x28')],function(_0x4d1aaf){return{'name':_0x4d1aaf['fieldName'],'type':_0x4d1aaf[_0xce91('0x29')][_0xce91('0x2a')]};});_0x13b5b7['model']=_['map'](_0xe63730,'name');_0x13b5b7['query']=_[_0xce91('0x2b')](_0x1e9212[_0xce91('0x2c')]);_0x13b5b7[_0xce91('0x2d')]=_[_0xce91('0x2e')](_0x13b5b7['model'],_0x13b5b7['query']);_0x46c12c[_0xce91('0x2f')]=_[_0xce91('0x2e')](_0x13b5b7['model'],qs[_0xce91('0x30')](_0x1e9212[_0xce91('0x2c')][_0xce91('0x30')]));_0x46c12c[_0xce91('0x2f')]=_0x46c12c[_0xce91('0x2f')]['length']?_0x46c12c['attributes']:_0x13b5b7[_0xce91('0x31')];if(!_0x1e9212[_0xce91('0x2c')]['hasOwnProperty'](_0xce91('0x32'))){_0x46c12c[_0xce91('0x19')]=qs[_0xce91('0x19')](_0x1e9212[_0xce91('0x2c')][_0xce91('0x19')]);_0x46c12c[_0xce91('0x18')]=qs[_0xce91('0x18')](_0x1e9212[_0xce91('0x2c')][_0xce91('0x18')]);}_0x46c12c[_0xce91('0x33')]=qs[_0xce91('0x34')](_0x1e9212[_0xce91('0x2c')]['sort']);_0x46c12c[_0xce91('0x35')]=qs[_0xce91('0x2d')](_['pick'](_0x1e9212[_0xce91('0x2c')],_0x13b5b7[_0xce91('0x2d')]),_0xe63730);if(_0x1e9212[_0xce91('0x2c')]['filter']){_0x46c12c[_0xce91('0x35')]=_[_0xce91('0x36')](_0x46c12c[_0xce91('0x35')],{'$or':_['map'](_0xe63730,function(_0x1d1415){if(_0x1d1415[_0xce91('0x29')]!==_0xce91('0x37')){var _0x231e53={};_0x231e53[_0x1d1415[_0xce91('0x25')]]={'$like':'%'+_0x1e9212['query'][_0xce91('0x38')]+'%'};return _0x231e53;}})});}_0x46c12c=_[_0xce91('0x36')]({},_0x46c12c,_0x1e9212[_0xce91('0x39')]);var _0x5ed3bd={'where':_0x46c12c[_0xce91('0x35')]};return db[_0xce91('0x3a')][_0xce91('0x1b')](_0x5ed3bd)[_0xce91('0x22')](function(_0x238e8c){_0x28e264[_0xce91('0x1b')]=_0x238e8c;if(_0x1e9212[_0xce91('0x2c')][_0xce91('0x3b')]){_0x46c12c[_0xce91('0x3c')]=[{'all':!![]}];}return db[_0xce91('0x3a')]['findAll'](_0x46c12c);})['then'](function(_0x55b20f){_0x28e264[_0xce91('0x3d')]=_0x55b20f;return _0x28e264;})[_0xce91('0x22')](respondWithFilteredResult(_0x26e95c,_0x46c12c))[_0xce91('0x3e')](handleError(_0x26e95c,null));};exports[_0xce91('0x3f')]=function(_0x151ed4,_0x37beb9){var _0x59c0cb={'raw':![],'where':{'id':_0x151ed4[_0xce91('0x40')]['id']}},_0x32b8a9={};_0x32b8a9[_0xce91('0x31')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x32b8a9[_0xce91('0x2c')]=_['keys'](_0x151ed4['query']);_0x32b8a9[_0xce91('0x2d')]=_[_0xce91('0x2e')](_0x32b8a9[_0xce91('0x31')],_0x32b8a9[_0xce91('0x2c')]);_0x59c0cb[_0xce91('0x2f')]=_['intersection'](_0x32b8a9[_0xce91('0x31')],qs[_0xce91('0x30')](_0x151ed4['query'][_0xce91('0x30')]));_0x59c0cb[_0xce91('0x2f')]=_0x59c0cb[_0xce91('0x2f')][_0xce91('0x41')]?_0x59c0cb['attributes']:_0x32b8a9['model'];if(_0x151ed4['query'][_0xce91('0x3b')]){_0x59c0cb['include']=[{'all':!![]}];}_0x59c0cb=_['merge']({},_0x59c0cb,_0x151ed4[_0xce91('0x39')]);return db[_0xce91('0x3a')][_0xce91('0x42')](_0x59c0cb)[_0xce91('0x22')](handleEntityNotFound(_0x37beb9,null))[_0xce91('0x22')](respondWithResult(_0x37beb9,null))[_0xce91('0x3e')](handleError(_0x37beb9,null));};exports[_0xce91('0x43')]=function(_0x305478,_0x2cebe5){return db['SugarcrmConfiguration'][_0xce91('0x43')](_0x305478[_0xce91('0x44')],{})[_0xce91('0x22')](respondWithResult(_0x2cebe5,0xc9))['catch'](handleError(_0x2cebe5,null));};exports['update']=function(_0x408ae3,_0x154b7b){if(_0x408ae3[_0xce91('0x44')]['id']){delete _0x408ae3[_0xce91('0x44')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x408ae3[_0xce91('0x40')]['id']}})[_0xce91('0x22')](handleEntityNotFound(_0x154b7b,null))[_0xce91('0x22')](saveUpdates(_0x408ae3['body'],null))[_0xce91('0x22')](respondWithResult(_0x154b7b,null))[_0xce91('0x3e')](handleError(_0x154b7b,null));};exports[_0xce91('0x45')]=function(_0x50570e,_0xeae27d){return db['SugarcrmConfiguration'][_0xce91('0x42')]({'where':{'id':_0x50570e[_0xce91('0x40')]['id']}})[_0xce91('0x22')](handleEntityNotFound(_0xeae27d,null))['then'](removeEntity(_0xeae27d,null))[_0xce91('0x3e')](handleError(_0xeae27d,null));};exports[_0xce91('0x46')]=function(_0x3c72a3,_0x266fd4,_0x4679b3){var _0x933c97={};var _0x415b15={};var _0x2efe07;var _0x12114f;return db[_0xce91('0x3a')][_0xce91('0x47')]({'where':{'id':_0x3c72a3['params']['id']}})[_0xce91('0x22')](handleEntityNotFound(_0x266fd4,null))[_0xce91('0x22')](function(_0x137cd3){if(_0x137cd3){_0x2efe07=_0x137cd3;_0x415b15[_0xce91('0x31')]=_['keys'](db[_0xce91('0x48')][_0xce91('0x28')]);_0x415b15['query']=_[_0xce91('0x2b')](_0x3c72a3[_0xce91('0x2c')]);_0x415b15['filters']=_['intersection'](_0x415b15[_0xce91('0x31')],_0x415b15[_0xce91('0x2c')]);_0x933c97['attributes']=_['intersection'](_0x415b15[_0xce91('0x31')],qs[_0xce91('0x30')](_0x3c72a3[_0xce91('0x2c')][_0xce91('0x30')]));_0x933c97[_0xce91('0x2f')]=_0x933c97['attributes']['length']?_0x933c97[_0xce91('0x2f')]:_0x415b15['model'];_0x933c97[_0xce91('0x33')]=qs[_0xce91('0x34')](_0x3c72a3[_0xce91('0x2c')][_0xce91('0x34')]);_0x933c97[_0xce91('0x35')]=qs[_0xce91('0x2d')](_[_0xce91('0x49')](_0x3c72a3[_0xce91('0x2c')],_0x415b15[_0xce91('0x2d')]));if(_0x3c72a3[_0xce91('0x2c')][_0xce91('0x38')]){_0x933c97[_0xce91('0x35')]=_['merge'](_0x933c97[_0xce91('0x35')],{'$or':_[_0xce91('0x4a')](_0x933c97[_0xce91('0x2f')],function(_0x4cbf68){var _0x22ec77={};_0x22ec77[_0x4cbf68]={'$like':'%'+_0x3c72a3[_0xce91('0x2c')]['filter']+'%'};return _0x22ec77;})});}_0x933c97=_[_0xce91('0x36')]({},_0x933c97,_0x3c72a3[_0xce91('0x39')]);return _0x2efe07['getFields'](_0x933c97);}})[_0xce91('0x22')](function(_0x188f0a){if(_0x188f0a){_0x12114f=_0x188f0a[_0xce91('0x41')];if(!_0x3c72a3['query'][_0xce91('0x4b')](_0xce91('0x32'))){_0x933c97[_0xce91('0x19')]=qs[_0xce91('0x19')](_0x3c72a3[_0xce91('0x2c')][_0xce91('0x19')]);_0x933c97[_0xce91('0x18')]=qs[_0xce91('0x18')](_0x3c72a3['query'][_0xce91('0x18')]);}return _0x2efe07[_0xce91('0x46')](_0x933c97);}})[_0xce91('0x22')](function(_0x767f65){if(_0x767f65){return _0x767f65?{'count':_0x12114f,'rows':_0x767f65}:null;}})[_0xce91('0x22')](respondWithResult(_0x266fd4,null))['catch'](handleError(_0x266fd4,null));};exports[_0xce91('0x4c')]=function(_0x36c8b8,_0x31c23e,_0x117541){var _0x5ec8c6={};var _0x2551c0={};var _0x7bec58;var _0x27126c;return db['SugarcrmConfiguration'][_0xce91('0x47')]({'where':{'id':_0x36c8b8[_0xce91('0x40')]['id']}})[_0xce91('0x22')](handleEntityNotFound(_0x31c23e,null))[_0xce91('0x22')](function(_0x27c0ba){if(_0x27c0ba){_0x7bec58=_0x27c0ba;_0x2551c0['model']=_[_0xce91('0x2b')](db[_0xce91('0x48')][_0xce91('0x28')]);_0x2551c0[_0xce91('0x2c')]=_[_0xce91('0x2b')](_0x36c8b8[_0xce91('0x2c')]);_0x2551c0[_0xce91('0x2d')]=_[_0xce91('0x2e')](_0x2551c0[_0xce91('0x31')],_0x2551c0[_0xce91('0x2c')]);_0x5ec8c6['attributes']=_[_0xce91('0x2e')](_0x2551c0[_0xce91('0x31')],qs[_0xce91('0x30')](_0x36c8b8[_0xce91('0x2c')][_0xce91('0x30')]));_0x5ec8c6[_0xce91('0x2f')]=_0x5ec8c6['attributes'][_0xce91('0x41')]?_0x5ec8c6[_0xce91('0x2f')]:_0x2551c0[_0xce91('0x31')];_0x5ec8c6[_0xce91('0x33')]=qs[_0xce91('0x34')](_0x36c8b8[_0xce91('0x2c')][_0xce91('0x34')]);_0x5ec8c6[_0xce91('0x35')]=qs[_0xce91('0x2d')](_[_0xce91('0x49')](_0x36c8b8['query'],_0x2551c0[_0xce91('0x2d')]));if(_0x36c8b8[_0xce91('0x2c')][_0xce91('0x38')]){_0x5ec8c6[_0xce91('0x35')]=_[_0xce91('0x36')](_0x5ec8c6[_0xce91('0x35')],{'$or':_[_0xce91('0x4a')](_0x5ec8c6[_0xce91('0x2f')],function(_0x1cd09d){var _0x35506c={};_0x35506c[_0x1cd09d]={'$like':'%'+_0x36c8b8[_0xce91('0x2c')][_0xce91('0x38')]+'%'};return _0x35506c;})});}_0x5ec8c6=_[_0xce91('0x36')]({},_0x5ec8c6,_0x36c8b8['options']);return _0x7bec58[_0xce91('0x4c')](_0x5ec8c6);}})[_0xce91('0x22')](function(_0x492ef0){if(_0x492ef0){_0x27126c=_0x492ef0[_0xce91('0x41')];if(!_0x36c8b8[_0xce91('0x2c')][_0xce91('0x4b')](_0xce91('0x32'))){_0x5ec8c6['limit']=qs[_0xce91('0x19')](_0x36c8b8[_0xce91('0x2c')]['limit']);_0x5ec8c6[_0xce91('0x18')]=qs['offset'](_0x36c8b8['query'][_0xce91('0x18')]);}return _0x7bec58[_0xce91('0x4c')](_0x5ec8c6);}})[_0xce91('0x22')](function(_0x4dfe77){if(_0x4dfe77){return _0x4dfe77?{'count':_0x27126c,'rows':_0x4dfe77}:null;}})[_0xce91('0x22')](respondWithResult(_0x31c23e,null))[_0xce91('0x3e')](handleError(_0x31c23e,null));};exports['getDescriptions']=function(_0xa9910d,_0x4086f9,_0x2c70c9){var _0x35a800={};var _0x41c628={};var _0x229fa7;var _0x3c4d97;return db[_0xce91('0x3a')][_0xce91('0x47')]({'where':{'id':_0xa9910d['params']['id']}})[_0xce91('0x22')](handleEntityNotFound(_0x4086f9,null))[_0xce91('0x22')](function(_0xb1d6ed){if(_0xb1d6ed){_0x229fa7=_0xb1d6ed;_0x41c628[_0xce91('0x31')]=_[_0xce91('0x2b')](db[_0xce91('0x48')][_0xce91('0x28')]);_0x41c628[_0xce91('0x2c')]=_['keys'](_0xa9910d[_0xce91('0x2c')]);_0x41c628[_0xce91('0x2d')]=_[_0xce91('0x2e')](_0x41c628[_0xce91('0x31')],_0x41c628['query']);_0x35a800['attributes']=_['intersection'](_0x41c628[_0xce91('0x31')],qs[_0xce91('0x30')](_0xa9910d[_0xce91('0x2c')]['fields']));_0x35a800[_0xce91('0x2f')]=_0x35a800['attributes'][_0xce91('0x41')]?_0x35a800[_0xce91('0x2f')]:_0x41c628[_0xce91('0x31')];_0x35a800['order']=qs[_0xce91('0x34')](_0xa9910d[_0xce91('0x2c')][_0xce91('0x34')]);_0x35a800[_0xce91('0x35')]=qs[_0xce91('0x2d')](_['pick'](_0xa9910d[_0xce91('0x2c')],_0x41c628[_0xce91('0x2d')]));if(_0xa9910d['query'][_0xce91('0x38')]){_0x35a800['where']=_[_0xce91('0x36')](_0x35a800['where'],{'$or':_['map'](_0x35a800[_0xce91('0x2f')],function(_0x523308){var _0x3610cb={};_0x3610cb[_0x523308]={'$like':'%'+_0xa9910d[_0xce91('0x2c')][_0xce91('0x38')]+'%'};return _0x3610cb;})});}_0x35a800=_[_0xce91('0x36')]({},_0x35a800,_0xa9910d[_0xce91('0x39')]);return _0x229fa7[_0xce91('0x4d')](_0x35a800);}})[_0xce91('0x22')](function(_0x4a46d9){if(_0x4a46d9){_0x3c4d97=_0x4a46d9[_0xce91('0x41')];if(!_0xa9910d[_0xce91('0x2c')][_0xce91('0x4b')](_0xce91('0x32'))){_0x35a800['limit']=qs['limit'](_0xa9910d[_0xce91('0x2c')][_0xce91('0x19')]);_0x35a800[_0xce91('0x18')]=qs['offset'](_0xa9910d[_0xce91('0x2c')]['offset']);}return _0x229fa7[_0xce91('0x4d')](_0x35a800);}})[_0xce91('0x22')](function(_0x19b039){if(_0x19b039){return _0x19b039?{'count':_0x3c4d97,'rows':_0x19b039}:null;}})['then'](respondWithResult(_0x4086f9,null))[_0xce91('0x3e')](handleError(_0x4086f9,null));}; \ No newline at end of file +var _0x7470=['fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','SugarcrmField','pick','getFields','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0x7470,0x6f));var _0x0747=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7470[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x0747('0x0'));var rimraf=require(_0x0747('0x1'));var zipdir=require(_0x0747('0x2'));var jsonpatch=require(_0x0747('0x3'));var rp=require(_0x0747('0x4'));var moment=require('moment');var BPromise=require(_0x0747('0x5'));var Mustache=require('mustache');var util=require(_0x0747('0x6'));var path=require(_0x0747('0x7'));var sox=require(_0x0747('0x8'));var csv=require(_0x0747('0x9'));var ejs=require(_0x0747('0xa'));var fs=require('fs');var fs_extra=require(_0x0747('0xb'));var _=require(_0x0747('0xc'));var squel=require(_0x0747('0xd'));var crypto=require(_0x0747('0xe'));var jsforce=require(_0x0747('0xf'));var deskjs=require(_0x0747('0x10'));var toCsv=require(_0x0747('0x9'));var querystring=require(_0x0747('0x11'));var Papa=require(_0x0747('0x12'));var Redis=require(_0x0747('0x13'));var authService=require(_0x0747('0x14'));var qs=require(_0x0747('0x15'));var as=require(_0x0747('0x16'));var hardwareService=require(_0x0747('0x17'));var logger=require(_0x0747('0x18'))('api');var utils=require(_0x0747('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0747('0x1a'));var db=require(_0x0747('0x1b'))['db'];function respondWithStatusCode(_0x27a86f,_0x429468){_0x429468=_0x429468||0xcc;return function(_0x21c25b){if(_0x21c25b){return _0x27a86f['sendStatus'](_0x429468);}return _0x27a86f[_0x0747('0x1c')](_0x429468)['end']();};}function respondWithResult(_0x3336a1,_0x1b152d){_0x1b152d=_0x1b152d||0xc8;return function(_0x54cc11){if(_0x54cc11){return _0x3336a1[_0x0747('0x1c')](_0x1b152d)[_0x0747('0x1d')](_0x54cc11);}};}function respondWithFilteredResult(_0x5c0cc0,_0x4c6570){return function(_0x467137){if(_0x467137){var _0x108a13=typeof _0x4c6570['offset']==='undefined'&&typeof _0x4c6570[_0x0747('0x1e')]===_0x0747('0x1f');var _0x2db0e3=_0x467137['count'];var _0x49573b=_0x108a13?0x0:_0x4c6570[_0x0747('0x20')];var _0x1dbf3f=_0x108a13?_0x467137[_0x0747('0x21')]:_0x4c6570[_0x0747('0x20')]+_0x4c6570[_0x0747('0x1e')];var _0x299d73;if(_0x1dbf3f>=_0x2db0e3){_0x1dbf3f=_0x2db0e3;_0x299d73=0xc8;}else{_0x299d73=0xce;}_0x5c0cc0[_0x0747('0x1c')](_0x299d73);return _0x5c0cc0[_0x0747('0x22')](_0x0747('0x23'),_0x49573b+'-'+_0x1dbf3f+'/'+_0x2db0e3)[_0x0747('0x1d')](_0x467137);}return null;};}function patchUpdates(_0x56a34d){return function(_0x5d5ca2){try{jsonpatch['apply'](_0x5d5ca2,_0x56a34d,!![]);}catch(_0x58045c){return BPromise['reject'](_0x58045c);}return _0x5d5ca2[_0x0747('0x24')]();};}function saveUpdates(_0x21438e,_0x2206cc){return function(_0x39bc43){if(_0x39bc43){return _0x39bc43[_0x0747('0x25')](_0x21438e)[_0x0747('0x26')](function(_0x3356f6){return _0x3356f6;});}return null;};}function removeEntity(_0x13ab18,_0x439c12){return function(_0x5a713f){if(_0x5a713f){return _0x5a713f[_0x0747('0x27')]()['then'](function(){_0x13ab18['status'](0xcc)[_0x0747('0x28')]();});}};}function handleEntityNotFound(_0x175238,_0x449b6f){return function(_0x2af97e){if(!_0x2af97e){_0x175238['sendStatus'](0x194);}return _0x2af97e;};}function handleError(_0x2aee37,_0x2111ca){_0x2111ca=_0x2111ca||0x1f4;return function(_0x30edda){logger[_0x0747('0x29')](_0x30edda[_0x0747('0x2a')]);if(_0x30edda['name']){delete _0x30edda[_0x0747('0x2b')];}_0x2aee37[_0x0747('0x1c')](_0x2111ca)[_0x0747('0x2c')](_0x30edda);};}exports[_0x0747('0x2d')]=function(_0x5038b8,_0x94a87f){var _0x5d75c2={},_0x56556d={},_0x4c531d={'count':0x0,'rows':[]};var _0x34f76f=_[_0x0747('0x2e')](db[_0x0747('0x2f')][_0x0747('0x30')],function(_0x558847){return{'name':_0x558847[_0x0747('0x31')],'type':_0x558847[_0x0747('0x32')]['key']};});_0x56556d['model']=_['map'](_0x34f76f,_0x0747('0x2b'));_0x56556d[_0x0747('0x33')]=_[_0x0747('0x34')](_0x5038b8[_0x0747('0x33')]);_0x56556d[_0x0747('0x35')]=_[_0x0747('0x36')](_0x56556d[_0x0747('0x37')],_0x56556d[_0x0747('0x33')]);_0x5d75c2[_0x0747('0x38')]=_[_0x0747('0x36')](_0x56556d[_0x0747('0x37')],qs[_0x0747('0x39')](_0x5038b8[_0x0747('0x33')]['fields']));_0x5d75c2['attributes']=_0x5d75c2[_0x0747('0x38')][_0x0747('0x3a')]?_0x5d75c2[_0x0747('0x38')]:_0x56556d[_0x0747('0x37')];if(!_0x5038b8['query'][_0x0747('0x3b')]('nolimit')){_0x5d75c2[_0x0747('0x1e')]=qs[_0x0747('0x1e')](_0x5038b8[_0x0747('0x33')]['limit']);_0x5d75c2['offset']=qs[_0x0747('0x20')](_0x5038b8[_0x0747('0x33')][_0x0747('0x20')]);}_0x5d75c2[_0x0747('0x3c')]=qs[_0x0747('0x3d')](_0x5038b8['query']['sort']);_0x5d75c2[_0x0747('0x3e')]=qs[_0x0747('0x35')](_['pick'](_0x5038b8['query'],_0x56556d[_0x0747('0x35')]),_0x34f76f);if(_0x5038b8[_0x0747('0x33')][_0x0747('0x3f')]){_0x5d75c2['where']=_[_0x0747('0x40')](_0x5d75c2[_0x0747('0x3e')],{'$or':_['map'](_0x34f76f,function(_0x4d303a){if(_0x4d303a[_0x0747('0x32')]!==_0x0747('0x41')){var _0x2e4f92={};_0x2e4f92[_0x4d303a['name']]={'$like':'%'+_0x5038b8[_0x0747('0x33')][_0x0747('0x3f')]+'%'};return _0x2e4f92;}})});}_0x5d75c2=_[_0x0747('0x40')]({},_0x5d75c2,_0x5038b8[_0x0747('0x42')]);var _0x209106={'where':_0x5d75c2['where']};return db[_0x0747('0x2f')][_0x0747('0x21')](_0x209106)[_0x0747('0x26')](function(_0x3b4368){_0x4c531d['count']=_0x3b4368;if(_0x5038b8['query'][_0x0747('0x43')]){_0x5d75c2[_0x0747('0x44')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x0747('0x45')](_0x5d75c2);})[_0x0747('0x26')](function(_0x13dd10){_0x4c531d[_0x0747('0x46')]=_0x13dd10;return _0x4c531d;})[_0x0747('0x26')](respondWithFilteredResult(_0x94a87f,_0x5d75c2))[_0x0747('0x47')](handleError(_0x94a87f,null));};exports[_0x0747('0x48')]=function(_0x3f9331,_0x4b19f0){var _0x3a2f06={'raw':![],'where':{'id':_0x3f9331[_0x0747('0x49')]['id']}},_0x306301={};_0x306301['model']=_['keys'](db[_0x0747('0x2f')][_0x0747('0x30')]);_0x306301[_0x0747('0x33')]=_['keys'](_0x3f9331[_0x0747('0x33')]);_0x306301[_0x0747('0x35')]=_['intersection'](_0x306301[_0x0747('0x37')],_0x306301[_0x0747('0x33')]);_0x3a2f06[_0x0747('0x38')]=_[_0x0747('0x36')](_0x306301[_0x0747('0x37')],qs[_0x0747('0x39')](_0x3f9331[_0x0747('0x33')][_0x0747('0x39')]));_0x3a2f06[_0x0747('0x38')]=_0x3a2f06['attributes']['length']?_0x3a2f06[_0x0747('0x38')]:_0x306301['model'];if(_0x3f9331['query']['includeAll']){_0x3a2f06[_0x0747('0x44')]=[{'all':!![]}];}_0x3a2f06=_[_0x0747('0x40')]({},_0x3a2f06,_0x3f9331['options']);return db[_0x0747('0x2f')]['find'](_0x3a2f06)[_0x0747('0x26')](handleEntityNotFound(_0x4b19f0,null))[_0x0747('0x26')](respondWithResult(_0x4b19f0,null))[_0x0747('0x47')](handleError(_0x4b19f0,null));};exports['create']=function(_0x24f728,_0x4f8bc3){return db[_0x0747('0x2f')][_0x0747('0x4a')](_0x24f728[_0x0747('0x4b')],{})[_0x0747('0x26')](respondWithResult(_0x4f8bc3,0xc9))[_0x0747('0x47')](handleError(_0x4f8bc3,null));};exports[_0x0747('0x25')]=function(_0x31ad84,_0x1db284){if(_0x31ad84[_0x0747('0x4b')]['id']){delete _0x31ad84[_0x0747('0x4b')]['id'];}return db[_0x0747('0x2f')]['find']({'where':{'id':_0x31ad84[_0x0747('0x49')]['id']}})['then'](handleEntityNotFound(_0x1db284,null))[_0x0747('0x26')](saveUpdates(_0x31ad84['body'],null))[_0x0747('0x26')](respondWithResult(_0x1db284,null))[_0x0747('0x47')](handleError(_0x1db284,null));};exports['destroy']=function(_0x5b21dc,_0x568c72){return db[_0x0747('0x2f')][_0x0747('0x4c')]({'where':{'id':_0x5b21dc[_0x0747('0x49')]['id']}})['then'](handleEntityNotFound(_0x568c72,null))['then'](removeEntity(_0x568c72,null))['catch'](handleError(_0x568c72,null));};exports['getFields']=function(_0x2ff26b,_0x2f7043,_0x1fd638){var _0x39312c={};var _0x4c49dc={};var _0x4aba40;var _0x560d18;return db[_0x0747('0x2f')]['findOne']({'where':{'id':_0x2ff26b[_0x0747('0x49')]['id']}})[_0x0747('0x26')](handleEntityNotFound(_0x2f7043,null))[_0x0747('0x26')](function(_0x16249d){if(_0x16249d){_0x4aba40=_0x16249d;_0x4c49dc[_0x0747('0x37')]=_[_0x0747('0x34')](db[_0x0747('0x4d')][_0x0747('0x30')]);_0x4c49dc[_0x0747('0x33')]=_[_0x0747('0x34')](_0x2ff26b['query']);_0x4c49dc[_0x0747('0x35')]=_[_0x0747('0x36')](_0x4c49dc[_0x0747('0x37')],_0x4c49dc[_0x0747('0x33')]);_0x39312c[_0x0747('0x38')]=_[_0x0747('0x36')](_0x4c49dc[_0x0747('0x37')],qs[_0x0747('0x39')](_0x2ff26b[_0x0747('0x33')][_0x0747('0x39')]));_0x39312c[_0x0747('0x38')]=_0x39312c[_0x0747('0x38')][_0x0747('0x3a')]?_0x39312c[_0x0747('0x38')]:_0x4c49dc[_0x0747('0x37')];_0x39312c[_0x0747('0x3c')]=qs['sort'](_0x2ff26b[_0x0747('0x33')][_0x0747('0x3d')]);_0x39312c[_0x0747('0x3e')]=qs[_0x0747('0x35')](_[_0x0747('0x4e')](_0x2ff26b[_0x0747('0x33')],_0x4c49dc['filters']));if(_0x2ff26b[_0x0747('0x33')]['filter']){_0x39312c['where']=_[_0x0747('0x40')](_0x39312c[_0x0747('0x3e')],{'$or':_[_0x0747('0x2e')](_0x39312c[_0x0747('0x38')],function(_0x1127e2){var _0x2e2ddf={};_0x2e2ddf[_0x1127e2]={'$like':'%'+_0x2ff26b[_0x0747('0x33')][_0x0747('0x3f')]+'%'};return _0x2e2ddf;})});}_0x39312c=_[_0x0747('0x40')]({},_0x39312c,_0x2ff26b[_0x0747('0x42')]);return _0x4aba40[_0x0747('0x4f')](_0x39312c);}})['then'](function(_0x4c7db7){if(_0x4c7db7){_0x560d18=_0x4c7db7[_0x0747('0x3a')];if(!_0x2ff26b['query'][_0x0747('0x3b')](_0x0747('0x50'))){_0x39312c[_0x0747('0x1e')]=qs['limit'](_0x2ff26b['query'][_0x0747('0x1e')]);_0x39312c['offset']=qs[_0x0747('0x20')](_0x2ff26b['query'][_0x0747('0x20')]);}return _0x4aba40[_0x0747('0x4f')](_0x39312c);}})[_0x0747('0x26')](function(_0x5545c7){if(_0x5545c7){return _0x5545c7?{'count':_0x560d18,'rows':_0x5545c7}:null;}})[_0x0747('0x26')](respondWithResult(_0x2f7043,null))[_0x0747('0x47')](handleError(_0x2f7043,null));};exports[_0x0747('0x51')]=function(_0x53f806,_0x547b26,_0x41ebde){var _0x1d3264={};var _0x391032={};var _0x31ecde;var _0x19da9b;return db[_0x0747('0x2f')][_0x0747('0x52')]({'where':{'id':_0x53f806[_0x0747('0x49')]['id']}})[_0x0747('0x26')](handleEntityNotFound(_0x547b26,null))['then'](function(_0x2b0919){if(_0x2b0919){_0x31ecde=_0x2b0919;_0x391032['model']=_[_0x0747('0x34')](db[_0x0747('0x4d')][_0x0747('0x30')]);_0x391032[_0x0747('0x33')]=_['keys'](_0x53f806[_0x0747('0x33')]);_0x391032['filters']=_[_0x0747('0x36')](_0x391032[_0x0747('0x37')],_0x391032['query']);_0x1d3264['attributes']=_[_0x0747('0x36')](_0x391032['model'],qs[_0x0747('0x39')](_0x53f806[_0x0747('0x33')][_0x0747('0x39')]));_0x1d3264[_0x0747('0x38')]=_0x1d3264[_0x0747('0x38')][_0x0747('0x3a')]?_0x1d3264['attributes']:_0x391032[_0x0747('0x37')];_0x1d3264[_0x0747('0x3c')]=qs[_0x0747('0x3d')](_0x53f806[_0x0747('0x33')][_0x0747('0x3d')]);_0x1d3264['where']=qs[_0x0747('0x35')](_[_0x0747('0x4e')](_0x53f806['query'],_0x391032[_0x0747('0x35')]));if(_0x53f806[_0x0747('0x33')]['filter']){_0x1d3264['where']=_[_0x0747('0x40')](_0x1d3264[_0x0747('0x3e')],{'$or':_[_0x0747('0x2e')](_0x1d3264[_0x0747('0x38')],function(_0x4c2043){var _0x5c91e5={};_0x5c91e5[_0x4c2043]={'$like':'%'+_0x53f806[_0x0747('0x33')][_0x0747('0x3f')]+'%'};return _0x5c91e5;})});}_0x1d3264=_[_0x0747('0x40')]({},_0x1d3264,_0x53f806['options']);return _0x31ecde[_0x0747('0x51')](_0x1d3264);}})[_0x0747('0x26')](function(_0x432c69){if(_0x432c69){_0x19da9b=_0x432c69[_0x0747('0x3a')];if(!_0x53f806[_0x0747('0x33')][_0x0747('0x3b')](_0x0747('0x50'))){_0x1d3264[_0x0747('0x1e')]=qs['limit'](_0x53f806[_0x0747('0x33')][_0x0747('0x1e')]);_0x1d3264[_0x0747('0x20')]=qs['offset'](_0x53f806[_0x0747('0x33')][_0x0747('0x20')]);}return _0x31ecde[_0x0747('0x51')](_0x1d3264);}})[_0x0747('0x26')](function(_0x13db24){if(_0x13db24){return _0x13db24?{'count':_0x19da9b,'rows':_0x13db24}:null;}})[_0x0747('0x26')](respondWithResult(_0x547b26,null))['catch'](handleError(_0x547b26,null));};exports[_0x0747('0x53')]=function(_0x5dce67,_0x4c636f,_0x7eafeb){var _0x1a408a={};var _0x3b3d2e={};var _0x279dad;var _0x454e93;return db['SugarcrmConfiguration'][_0x0747('0x52')]({'where':{'id':_0x5dce67['params']['id']}})[_0x0747('0x26')](handleEntityNotFound(_0x4c636f,null))[_0x0747('0x26')](function(_0x25f7fc){if(_0x25f7fc){_0x279dad=_0x25f7fc;_0x3b3d2e[_0x0747('0x37')]=_['keys'](db['SugarcrmField'][_0x0747('0x30')]);_0x3b3d2e[_0x0747('0x33')]=_[_0x0747('0x34')](_0x5dce67['query']);_0x3b3d2e[_0x0747('0x35')]=_['intersection'](_0x3b3d2e[_0x0747('0x37')],_0x3b3d2e[_0x0747('0x33')]);_0x1a408a[_0x0747('0x38')]=_[_0x0747('0x36')](_0x3b3d2e[_0x0747('0x37')],qs['fields'](_0x5dce67[_0x0747('0x33')][_0x0747('0x39')]));_0x1a408a[_0x0747('0x38')]=_0x1a408a[_0x0747('0x38')][_0x0747('0x3a')]?_0x1a408a[_0x0747('0x38')]:_0x3b3d2e[_0x0747('0x37')];_0x1a408a[_0x0747('0x3c')]=qs[_0x0747('0x3d')](_0x5dce67[_0x0747('0x33')][_0x0747('0x3d')]);_0x1a408a[_0x0747('0x3e')]=qs['filters'](_['pick'](_0x5dce67['query'],_0x3b3d2e[_0x0747('0x35')]));if(_0x5dce67[_0x0747('0x33')][_0x0747('0x3f')]){_0x1a408a['where']=_[_0x0747('0x40')](_0x1a408a[_0x0747('0x3e')],{'$or':_[_0x0747('0x2e')](_0x1a408a[_0x0747('0x38')],function(_0x2f24d8){var _0xe37862={};_0xe37862[_0x2f24d8]={'$like':'%'+_0x5dce67[_0x0747('0x33')][_0x0747('0x3f')]+'%'};return _0xe37862;})});}_0x1a408a=_[_0x0747('0x40')]({},_0x1a408a,_0x5dce67[_0x0747('0x42')]);return _0x279dad[_0x0747('0x53')](_0x1a408a);}})[_0x0747('0x26')](function(_0x27a0d){if(_0x27a0d){_0x454e93=_0x27a0d[_0x0747('0x3a')];if(!_0x5dce67[_0x0747('0x33')][_0x0747('0x3b')](_0x0747('0x50'))){_0x1a408a['limit']=qs[_0x0747('0x1e')](_0x5dce67[_0x0747('0x33')][_0x0747('0x1e')]);_0x1a408a[_0x0747('0x20')]=qs[_0x0747('0x20')](_0x5dce67[_0x0747('0x33')][_0x0747('0x20')]);}return _0x279dad[_0x0747('0x53')](_0x1a408a);}})[_0x0747('0x26')](function(_0x8a24d){if(_0x8a24d){return _0x8a24d?{'count':_0x454e93,'rows':_0x8a24d}:null;}})['then'](respondWithResult(_0x4c636f,null))[_0x0747('0x47')](handleError(_0x4c636f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b949748..ba569e5 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 _0x7587=['bluebird','rimraf','../../config/environment','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment'];(function(_0xf41720,_0x354d47){var _0x426a40=function(_0x5edb70){while(--_0x5edb70){_0xf41720['push'](_0xf41720['shift']());}};_0x426a40(++_0x354d47);}(_0x7587,0x7a));var _0x7758=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7587[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0x7758('0x0'));var logger=require(_0x7758('0x1'))(_0x7758('0x2'));var moment=require(_0x7758('0x3'));var BPromise=require(_0x7758('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7758('0x5'));var config=require(_0x7758('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x2c3ff2,_0x25996b){return _0x2c3ff2['define'](_0x7758('0x7'),attributes,{'tableName':_0x7758('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e41=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','moment','bluebird'];(function(_0x235125,_0x586060){var _0x5e3ce4=function(_0xb9e7cc){while(--_0xb9e7cc){_0x235125['push'](_0x235125['shift']());}};_0x5e3ce4(++_0x586060);}(_0x2e41,0xa4));var _0x12e4=function(_0x4c11fb,_0x32dbc0){_0x4c11fb=_0x4c11fb-0x0;var _0x4caf73=_0x2e41[_0x4c11fb];return _0x4caf73;};'use strict';var _=require(_0x12e4('0x0'));var util=require(_0x12e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x12e4('0x2'));var BPromise=require(_0x12e4('0x3'));var rp=require(_0x12e4('0x4'));var fs=require('fs');var path=require(_0x12e4('0x5'));var rimraf=require(_0x12e4('0x6'));var config=require(_0x12e4('0x7'));var attributes=require(_0x12e4('0x8'));module[_0x12e4('0x9')]=function(_0x3f644f,_0x22923d){return _0x3f644f['define'](_0x12e4('0xa'),attributes,{'tableName':_0x12e4('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 3c88dee..78c2024 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 _0x0a74=['request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x0a74,0xbf));var _0x40a7=function(_0x1f5f0d,_0x1d5da6){_0x1f5f0d=_0x1f5f0d-0x0;var _0x407342=_0x0a74[_0x1f5f0d];return _0x407342;};'use strict';var _=require(_0x40a7('0x0'));var util=require('util');var moment=require(_0x40a7('0x1'));var BPromise=require(_0x40a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40a7('0x3'));var db=require(_0x40a7('0x4'))['db'];var utils=require(_0x40a7('0x5'));var logger=require(_0x40a7('0x6'))(_0x40a7('0x7'));var config=require(_0x40a7('0x8'));var jayson=require(_0x40a7('0x9'));var client=jayson[_0x40a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28dab7,_0x2d66dc,_0x2d667b){return new BPromise(function(_0x4f30cb,_0x1dde2e){return client[_0x40a7('0xb')](_0x28dab7,_0x2d667b)[_0x40a7('0xc')](function(_0x50b477){logger[_0x40a7('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2d66dc,'request\x20sent');logger[_0x40a7('0xe')](_0x40a7('0xf'),_0x2d66dc,_0x40a7('0x10'),JSON[_0x40a7('0x11')](_0x50b477));if(_0x50b477[_0x40a7('0x12')]){if(_0x50b477[_0x40a7('0x12')]['code']===0x1f4){logger[_0x40a7('0x12')](_0x40a7('0x13'),_0x2d66dc,_0x50b477['error'][_0x40a7('0x14')]);return _0x1dde2e(_0x50b477['error'][_0x40a7('0x14')]);}logger[_0x40a7('0x12')](_0x40a7('0x13'),_0x2d66dc,_0x50b477[_0x40a7('0x12')][_0x40a7('0x14')]);return _0x4f30cb(_0x50b477[_0x40a7('0x12')][_0x40a7('0x14')]);}else{logger[_0x40a7('0xd')](_0x40a7('0x13'),_0x2d66dc,_0x40a7('0x10'));_0x4f30cb(_0x50b477[_0x40a7('0x15')]['message']);}})[_0x40a7('0x16')](function(_0x3b9af3){logger['error'](_0x40a7('0x13'),_0x2d66dc,_0x3b9af3);_0x1dde2e(_0x3b9af3);});});} \ No newline at end of file +var _0x9e1a=['SugarcrmConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5a12fb,_0x45f0c0){var _0x315e57=function(_0x462b23){while(--_0x462b23){_0x5a12fb['push'](_0x5a12fb['shift']());}};_0x315e57(++_0x45f0c0);}(_0x9e1a,0x1c3));var _0xa9e1=function(_0x220a57,_0x84350d){_0x220a57=_0x220a57-0x0;var _0x462078=_0x9e1a[_0x220a57];return _0x462078;};'use strict';var _=require(_0xa9e1('0x0'));var util=require(_0xa9e1('0x1'));var moment=require(_0xa9e1('0x2'));var BPromise=require(_0xa9e1('0x3'));var rs=require(_0xa9e1('0x4'));var fs=require('fs');var Redis=require(_0xa9e1('0x5'));var db=require(_0xa9e1('0x6'))['db'];var utils=require(_0xa9e1('0x7'));var logger=require(_0xa9e1('0x8'))(_0xa9e1('0x9'));var config=require(_0xa9e1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa9e1('0xb')][_0xa9e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f9a,_0x2085ea,_0x3a3861){return new BPromise(function(_0xb2809b,_0x374f17){return client[_0xa9e1('0xd')](_0x5e7f9a,_0x3a3861)[_0xa9e1('0xe')](function(_0x290c4d){logger[_0xa9e1('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2085ea,_0xa9e1('0x10'));logger[_0xa9e1('0x11')](_0xa9e1('0x12'),_0x2085ea,'request\x20sent',JSON[_0xa9e1('0x13')](_0x290c4d));if(_0x290c4d[_0xa9e1('0x14')]){if(_0x290c4d[_0xa9e1('0x14')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2085ea,_0x290c4d[_0xa9e1('0x14')][_0xa9e1('0x15')]);return _0x374f17(_0x290c4d[_0xa9e1('0x14')][_0xa9e1('0x15')]);}logger[_0xa9e1('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2085ea,_0x290c4d[_0xa9e1('0x14')]['message']);return _0xb2809b(_0x290c4d[_0xa9e1('0x14')][_0xa9e1('0x15')]);}else{logger[_0xa9e1('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2085ea,_0xa9e1('0x10'));_0xb2809b(_0x290c4d[_0xa9e1('0x16')]['message']);}})[_0xa9e1('0x17')](function(_0x14cc60){logger[_0xa9e1('0x14')](_0xa9e1('0x18'),_0x2085ea,_0x14cc60);_0x374f17(_0x14cc60);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0d302e3..baf5376 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 _0x6cce=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cce,0x1e6));var _0xe6cc=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0x6cce[_0x17249c];return _0x324e7b;};'use strict';var multer=require('multer');var util=require(_0xe6cc('0x0'));var path=require('path');var timeout=require(_0xe6cc('0x1'));var express=require(_0xe6cc('0x2'));var router=express[_0xe6cc('0x3')]();var fs_extra=require(_0xe6cc('0x4'));var auth=require(_0xe6cc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6cc('0x6'));var controller=require(_0xe6cc('0x7'));router[_0xe6cc('0x8')]('/',auth[_0xe6cc('0x9')](),controller[_0xe6cc('0xa')]);router[_0xe6cc('0x8')](_0xe6cc('0xb'),auth['isAuthenticated'](),controller[_0xe6cc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe6cc('0xd')]);router[_0xe6cc('0xe')]('/:id',auth[_0xe6cc('0x9')](),controller[_0xe6cc('0xf')]);router[_0xe6cc('0x10')]('/:id',auth[_0xe6cc('0x9')](),controller['destroy']);module[_0xe6cc('0x11')]=router; \ No newline at end of file +var _0x908d=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer'];(function(_0x25e150,_0x411461){var _0x7c86c9=function(_0x9dc952){while(--_0x9dc952){_0x25e150['push'](_0x25e150['shift']());}};_0x7c86c9(++_0x411461);}(_0x908d,0x167));var _0xd908=function(_0x5b87cb,_0x171cd7){_0x5b87cb=_0x5b87cb-0x0;var _0x1ce308=_0x908d[_0x5b87cb];return _0x1ce308;};'use strict';var multer=require(_0xd908('0x0'));var util=require(_0xd908('0x1'));var path=require('path');var timeout=require(_0xd908('0x2'));var express=require('express');var router=express[_0xd908('0x3')]();var fs_extra=require(_0xd908('0x4'));var auth=require(_0xd908('0x5'));var interaction=require(_0xd908('0x6'));var config=require(_0xd908('0x7'));var controller=require(_0xd908('0x8'));router[_0xd908('0x9')]('/',auth[_0xd908('0xa')](),controller[_0xd908('0xb')]);router[_0xd908('0x9')](_0xd908('0xc'),auth[_0xd908('0xa')](),controller['show']);router[_0xd908('0xd')]('/',auth[_0xd908('0xa')](),controller[_0xd908('0xe')]);router[_0xd908('0xf')]('/:id',auth[_0xd908('0xa')](),controller['update']);router['delete'](_0xd908('0xc'),auth[_0xd908('0xa')](),controller[_0xd908('0x10')]);module[_0xd908('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index c4bb1f0..6a339ee 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 _0xe1a6=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1a6,0xbd));var _0x6e1a=function(_0x212160,_0x598284){_0x212160=_0x212160-0x0;var _0x31decd=_0xe1a6[_0x212160];return _0x31decd;};'use strict';var Sequelize=require(_0x6e1a('0x0'));module[_0x6e1a('0x1')]={'type':{'type':Sequelize[_0x6e1a('0x2')](_0x6e1a('0x3'),_0x6e1a('0x4'),'customVariable',_0x6e1a('0x5'),_0x6e1a('0x6')),'defaultValue':_0x6e1a('0x3')},'content':{'type':Sequelize[_0x6e1a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6e1a('0x2')]('string',_0x6e1a('0x4'),_0x6e1a('0x8'))},'keyContent':{'type':Sequelize[_0x6e1a('0x7')]},'idField':{'type':Sequelize[_0x6e1a('0x7')]},'nameField':{'type':Sequelize[_0x6e1a('0x7')]},'customField':{'type':Sequelize[_0x6e1a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e1a('0x7')]}}; \ No newline at end of file +var _0xdad0=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0xcfe12e,_0x126dda){var _0x2f25f7=function(_0x30fc7f){while(--_0x30fc7f){_0xcfe12e['push'](_0xcfe12e['shift']());}};_0x2f25f7(++_0x126dda);}(_0xdad0,0xb3));var _0x0dad=function(_0x4e9a01,_0x37c867){_0x4e9a01=_0x4e9a01-0x0;var _0x2d1ee5=_0xdad0[_0x4e9a01];return _0x2d1ee5;};'use strict';var Sequelize=require(_0x0dad('0x0'));module[_0x0dad('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0dad('0x2'),_0x0dad('0x3'),_0x0dad('0x4'),_0x0dad('0x5'),_0x0dad('0x6')),'defaultValue':_0x0dad('0x2')},'content':{'type':Sequelize[_0x0dad('0x7')]},'key':{'type':Sequelize[_0x0dad('0x7')]},'keyType':{'type':Sequelize[_0x0dad('0x8')](_0x0dad('0x2'),_0x0dad('0x3'),_0x0dad('0x4'))},'keyContent':{'type':Sequelize[_0x0dad('0x7')]},'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/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 88d00ad..bea43c4 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 _0x1a8c=['hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','end','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x187189,_0x229e81){var _0x148e6a=function(_0x35b8eb){while(--_0x35b8eb){_0x187189['push'](_0x187189['shift']());}};_0x148e6a(++_0x229e81);}(_0x1a8c,0xa9));var _0xc1a8=function(_0x6abb41,_0x34f919){_0x6abb41=_0x6abb41-0x0;var _0x32f4db=_0x1a8c[_0x6abb41];return _0x32f4db;};'use strict';var emlformat=require(_0xc1a8('0x0'));var rimraf=require(_0xc1a8('0x1'));var zipdir=require(_0xc1a8('0x2'));var jsonpatch=require(_0xc1a8('0x3'));var rp=require(_0xc1a8('0x4'));var moment=require(_0xc1a8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc1a8('0x6'));var util=require(_0xc1a8('0x7'));var path=require('path');var sox=require(_0xc1a8('0x8'));var csv=require(_0xc1a8('0x9'));var ejs=require(_0xc1a8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1a8('0xb'));var squel=require(_0xc1a8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1a8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc1a8('0xe'));var Papa=require(_0xc1a8('0xf'));var Redis=require(_0xc1a8('0x10'));var authService=require(_0xc1a8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc1a8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc1a8('0x13'));var utils=require(_0xc1a8('0x14'));var config=require(_0xc1a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ac24b,_0x1d33a5){_0x1d33a5=_0x1d33a5||0xcc;return function(_0x53d931){if(_0x53d931){return _0x2ac24b[_0xc1a8('0x16')](_0x1d33a5);}return _0x2ac24b['status'](_0x1d33a5)['end']();};}function respondWithResult(_0xe92d69,_0x111230){_0x111230=_0x111230||0xc8;return function(_0x5231df){if(_0x5231df){return _0xe92d69[_0xc1a8('0x17')](_0x111230)['json'](_0x5231df);}};}function respondWithFilteredResult(_0x12e19d,_0x2b676a){return function(_0x2a3931){if(_0x2a3931){var _0x4b61fd=typeof _0x2b676a[_0xc1a8('0x18')]===_0xc1a8('0x19')&&typeof _0x2b676a[_0xc1a8('0x1a')]===_0xc1a8('0x19');var _0x47a348=_0x2a3931[_0xc1a8('0x1b')];var _0x3ca905=_0x4b61fd?0x0:_0x2b676a[_0xc1a8('0x18')];var _0x3490b7=_0x4b61fd?_0x2a3931[_0xc1a8('0x1b')]:_0x2b676a['offset']+_0x2b676a[_0xc1a8('0x1a')];var _0x17b880;if(_0x3490b7>=_0x47a348){_0x3490b7=_0x47a348;_0x17b880=0xc8;}else{_0x17b880=0xce;}_0x12e19d['status'](_0x17b880);return _0x12e19d['set'](_0xc1a8('0x1c'),_0x3ca905+'-'+_0x3490b7+'/'+_0x47a348)[_0xc1a8('0x1d')](_0x2a3931);}return null;};}function patchUpdates(_0x3a7d2c){return function(_0x1dda08){try{jsonpatch[_0xc1a8('0x1e')](_0x1dda08,_0x3a7d2c,!![]);}catch(_0xb1d7b4){return BPromise['reject'](_0xb1d7b4);}return _0x1dda08[_0xc1a8('0x1f')]();};}function saveUpdates(_0xb2ca1e,_0x308b53){return function(_0xbe6988){if(_0xbe6988){return _0xbe6988[_0xc1a8('0x20')](_0xb2ca1e)[_0xc1a8('0x21')](function(_0x6b7380){return _0x6b7380;});}return null;};}function removeEntity(_0x12dae4,_0x563609){return function(_0x1e1c8b){if(_0x1e1c8b){return _0x1e1c8b['destroy']()[_0xc1a8('0x21')](function(){_0x12dae4[_0xc1a8('0x17')](0xcc)[_0xc1a8('0x22')]();});}};}function handleEntityNotFound(_0x20e6f2,_0x4e0dab){return function(_0x3dd532){if(!_0x3dd532){_0x20e6f2['sendStatus'](0x194);}return _0x3dd532;};}function handleError(_0xca198f,_0x306aaf){_0x306aaf=_0x306aaf||0x1f4;return function(_0x2993a4){logger[_0xc1a8('0x23')](_0x2993a4['stack']);if(_0x2993a4[_0xc1a8('0x24')]){delete _0x2993a4[_0xc1a8('0x24')];}_0xca198f[_0xc1a8('0x17')](_0x306aaf)[_0xc1a8('0x25')](_0x2993a4);};}exports[_0xc1a8('0x26')]=function(_0x5b11f2,_0x420924){var _0x515d75={},_0xac4a73={},_0x3134da={'count':0x0,'rows':[]};var _0x135f32=_[_0xc1a8('0x27')](db[_0xc1a8('0x28')][_0xc1a8('0x29')],function(_0x182bdc){return{'name':_0x182bdc[_0xc1a8('0x2a')],'type':_0x182bdc[_0xc1a8('0x2b')][_0xc1a8('0x2c')]};});_0xac4a73[_0xc1a8('0x2d')]=_[_0xc1a8('0x27')](_0x135f32,_0xc1a8('0x24'));_0xac4a73[_0xc1a8('0x2e')]=_[_0xc1a8('0x2f')](_0x5b11f2[_0xc1a8('0x2e')]);_0xac4a73[_0xc1a8('0x30')]=_['intersection'](_0xac4a73[_0xc1a8('0x2d')],_0xac4a73[_0xc1a8('0x2e')]);_0x515d75[_0xc1a8('0x31')]=_[_0xc1a8('0x32')](_0xac4a73['model'],qs[_0xc1a8('0x33')](_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x33')]));_0x515d75[_0xc1a8('0x31')]=_0x515d75['attributes'][_0xc1a8('0x34')]?_0x515d75[_0xc1a8('0x31')]:_0xac4a73['model'];if(!_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x35')](_0xc1a8('0x36'))){_0x515d75[_0xc1a8('0x1a')]=qs[_0xc1a8('0x1a')](_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x1a')]);_0x515d75['offset']=qs[_0xc1a8('0x18')](_0x5b11f2[_0xc1a8('0x2e')]['offset']);}_0x515d75[_0xc1a8('0x37')]=qs[_0xc1a8('0x38')](_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x38')]);_0x515d75['where']=qs[_0xc1a8('0x30')](_[_0xc1a8('0x39')](_0x5b11f2[_0xc1a8('0x2e')],_0xac4a73[_0xc1a8('0x30')]),_0x135f32);if(_0x5b11f2[_0xc1a8('0x2e')]['filter']){_0x515d75[_0xc1a8('0x3a')]=_[_0xc1a8('0x3b')](_0x515d75[_0xc1a8('0x3a')],{'$or':_[_0xc1a8('0x27')](_0x135f32,function(_0x1051ca){if(_0x1051ca[_0xc1a8('0x2b')]!==_0xc1a8('0x3c')){var _0x231f8d={};_0x231f8d[_0x1051ca[_0xc1a8('0x24')]]={'$like':'%'+_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x3d')]+'%'};return _0x231f8d;}})});}_0x515d75=_['merge']({},_0x515d75,_0x5b11f2['options']);var _0x5a2dd7={'where':_0x515d75[_0xc1a8('0x3a')]};return db[_0xc1a8('0x28')][_0xc1a8('0x1b')](_0x5a2dd7)[_0xc1a8('0x21')](function(_0x372fed){_0x3134da[_0xc1a8('0x1b')]=_0x372fed;if(_0x5b11f2[_0xc1a8('0x2e')][_0xc1a8('0x3e')]){_0x515d75[_0xc1a8('0x3f')]=[{'all':!![]}];}return db[_0xc1a8('0x28')][_0xc1a8('0x40')](_0x515d75);})['then'](function(_0x4a134c){_0x3134da[_0xc1a8('0x41')]=_0x4a134c;return _0x3134da;})['then'](respondWithFilteredResult(_0x420924,_0x515d75))['catch'](handleError(_0x420924,null));};exports[_0xc1a8('0x42')]=function(_0x2b8dad,_0x516c10){var _0x280af3={'raw':!![],'where':{'id':_0x2b8dad[_0xc1a8('0x43')]['id']}},_0x4e0b88={};_0x4e0b88[_0xc1a8('0x2d')]=_[_0xc1a8('0x2f')](db[_0xc1a8('0x28')][_0xc1a8('0x29')]);_0x4e0b88[_0xc1a8('0x2e')]=_[_0xc1a8('0x2f')](_0x2b8dad['query']);_0x4e0b88[_0xc1a8('0x30')]=_['intersection'](_0x4e0b88[_0xc1a8('0x2d')],_0x4e0b88[_0xc1a8('0x2e')]);_0x280af3['attributes']=_['intersection'](_0x4e0b88[_0xc1a8('0x2d')],qs[_0xc1a8('0x33')](_0x2b8dad[_0xc1a8('0x2e')][_0xc1a8('0x33')]));_0x280af3['attributes']=_0x280af3['attributes'][_0xc1a8('0x34')]?_0x280af3[_0xc1a8('0x31')]:_0x4e0b88[_0xc1a8('0x2d')];if(_0x2b8dad[_0xc1a8('0x2e')][_0xc1a8('0x3e')]){_0x280af3['include']=[{'all':!![]}];}_0x280af3=_[_0xc1a8('0x3b')]({},_0x280af3,_0x2b8dad[_0xc1a8('0x44')]);return db['SugarcrmField'][_0xc1a8('0x45')](_0x280af3)[_0xc1a8('0x21')](handleEntityNotFound(_0x516c10,null))[_0xc1a8('0x21')](respondWithResult(_0x516c10,null))[_0xc1a8('0x46')](handleError(_0x516c10,null));};exports[_0xc1a8('0x47')]=function(_0x219ffb,_0x52a8cb){return db[_0xc1a8('0x28')]['create'](_0x219ffb[_0xc1a8('0x48')],{})['then'](respondWithResult(_0x52a8cb,0xc9))['catch'](handleError(_0x52a8cb,null));};exports[_0xc1a8('0x20')]=function(_0x5deef9,_0x439faf){if(_0x5deef9[_0xc1a8('0x48')]['id']){delete _0x5deef9[_0xc1a8('0x48')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x5deef9['params']['id']}})[_0xc1a8('0x21')](handleEntityNotFound(_0x439faf,null))['then'](saveUpdates(_0x5deef9[_0xc1a8('0x48')],null))[_0xc1a8('0x21')](respondWithResult(_0x439faf,null))[_0xc1a8('0x46')](handleError(_0x439faf,null));};exports[_0xc1a8('0x49')]=function(_0x14ae89,_0x2364a1){return db[_0xc1a8('0x28')][_0xc1a8('0x45')]({'where':{'id':_0x14ae89['params']['id']}})[_0xc1a8('0x21')](handleEntityNotFound(_0x2364a1,null))['then'](removeEntity(_0x2364a1,null))[_0xc1a8('0x46')](handleError(_0x2364a1,null));}; \ No newline at end of file +var _0xe755=['filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','options','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','body','destroy','rimraf','zip-dir','mustache','util','path','sox','to-csv','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','SugarcrmField','fieldName','type','model','query','keys'];(function(_0xc2e320,_0xf97dd1){var _0x4a45d4=function(_0x2d4944){while(--_0x2d4944){_0xc2e320['push'](_0xc2e320['shift']());}};_0x4a45d4(++_0xf97dd1);}(_0xe755,0x9d));var _0x5e75=function(_0x18c76d,_0xb2f96){_0x18c76d=_0x18c76d-0x0;var _0x3c2cc3=_0xe755[_0x18c76d];return _0x3c2cc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e75('0x0'));var zipdir=require(_0x5e75('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5e75('0x2'));var util=require(_0x5e75('0x3'));var path=require(_0x5e75('0x4'));var sox=require(_0x5e75('0x5'));var csv=require(_0x5e75('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e75('0x7'));var squel=require(_0x5e75('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e75('0x9'));var Papa=require('papaparse');var Redis=require(_0x5e75('0xa'));var authService=require(_0x5e75('0xb'));var qs=require(_0x5e75('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e75('0xd'));var logger=require(_0x5e75('0xe'))('api');var utils=require(_0x5e75('0xf'));var config=require(_0x5e75('0x10'));var licenseUtil=require(_0x5e75('0x11'));var db=require(_0x5e75('0x12'))['db'];function respondWithStatusCode(_0x41a634,_0x4323a3){_0x4323a3=_0x4323a3||0xcc;return function(_0x3c615d){if(_0x3c615d){return _0x41a634[_0x5e75('0x13')](_0x4323a3);}return _0x41a634[_0x5e75('0x14')](_0x4323a3)[_0x5e75('0x15')]();};}function respondWithResult(_0x17cadc,_0x27e2a3){_0x27e2a3=_0x27e2a3||0xc8;return function(_0x3a7cca){if(_0x3a7cca){return _0x17cadc[_0x5e75('0x14')](_0x27e2a3)[_0x5e75('0x16')](_0x3a7cca);}};}function respondWithFilteredResult(_0xaaf4e8,_0x308560){return function(_0x1dc0d5){if(_0x1dc0d5){var _0x1d319d=typeof _0x308560[_0x5e75('0x17')]===_0x5e75('0x18')&&typeof _0x308560[_0x5e75('0x19')]===_0x5e75('0x18');var _0x4870bb=_0x1dc0d5[_0x5e75('0x1a')];var _0x2b0ded=_0x1d319d?0x0:_0x308560[_0x5e75('0x17')];var _0x1a0cf4=_0x1d319d?_0x1dc0d5[_0x5e75('0x1a')]:_0x308560[_0x5e75('0x17')]+_0x308560[_0x5e75('0x19')];var _0x15690c;if(_0x1a0cf4>=_0x4870bb){_0x1a0cf4=_0x4870bb;_0x15690c=0xc8;}else{_0x15690c=0xce;}_0xaaf4e8['status'](_0x15690c);return _0xaaf4e8[_0x5e75('0x1b')](_0x5e75('0x1c'),_0x2b0ded+'-'+_0x1a0cf4+'/'+_0x4870bb)[_0x5e75('0x16')](_0x1dc0d5);}return null;};}function patchUpdates(_0x3e6c70){return function(_0x2d62af){try{jsonpatch[_0x5e75('0x1d')](_0x2d62af,_0x3e6c70,!![]);}catch(_0x3f6aae){return BPromise['reject'](_0x3f6aae);}return _0x2d62af[_0x5e75('0x1e')]();};}function saveUpdates(_0x589095,_0x46d4f7){return function(_0x3fc6bb){if(_0x3fc6bb){return _0x3fc6bb[_0x5e75('0x1f')](_0x589095)['then'](function(_0x532f1d){return _0x532f1d;});}return null;};}function removeEntity(_0x1ee23e,_0x55bf8a){return function(_0xb73717){if(_0xb73717){return _0xb73717['destroy']()[_0x5e75('0x20')](function(){_0x1ee23e[_0x5e75('0x14')](0xcc)[_0x5e75('0x15')]();});}};}function handleEntityNotFound(_0x1eb8c4,_0xfddbf4){return function(_0x1c71e1){if(!_0x1c71e1){_0x1eb8c4[_0x5e75('0x13')](0x194);}return _0x1c71e1;};}function handleError(_0x32f1dc,_0x3fdebc){_0x3fdebc=_0x3fdebc||0x1f4;return function(_0x314ac8){logger[_0x5e75('0x21')](_0x314ac8['stack']);if(_0x314ac8['name']){delete _0x314ac8[_0x5e75('0x22')];}_0x32f1dc[_0x5e75('0x14')](_0x3fdebc)[_0x5e75('0x23')](_0x314ac8);};}exports[_0x5e75('0x24')]=function(_0x3712be,_0x372e13){var _0x5a1d84={},_0x258cd7={},_0x2db3ec={'count':0x0,'rows':[]};var _0x15baca=_[_0x5e75('0x25')](db[_0x5e75('0x26')]['rawAttributes'],function(_0x491ecc){return{'name':_0x491ecc[_0x5e75('0x27')],'type':_0x491ecc[_0x5e75('0x28')]['key']};});_0x258cd7[_0x5e75('0x29')]=_[_0x5e75('0x25')](_0x15baca,'name');_0x258cd7[_0x5e75('0x2a')]=_[_0x5e75('0x2b')](_0x3712be[_0x5e75('0x2a')]);_0x258cd7[_0x5e75('0x2c')]=_[_0x5e75('0x2d')](_0x258cd7[_0x5e75('0x29')],_0x258cd7['query']);_0x5a1d84[_0x5e75('0x2e')]=_['intersection'](_0x258cd7['model'],qs[_0x5e75('0x2f')](_0x3712be[_0x5e75('0x2a')]['fields']));_0x5a1d84[_0x5e75('0x2e')]=_0x5a1d84[_0x5e75('0x2e')][_0x5e75('0x30')]?_0x5a1d84[_0x5e75('0x2e')]:_0x258cd7[_0x5e75('0x29')];if(!_0x3712be[_0x5e75('0x2a')][_0x5e75('0x31')]('nolimit')){_0x5a1d84[_0x5e75('0x19')]=qs[_0x5e75('0x19')](_0x3712be['query'][_0x5e75('0x19')]);_0x5a1d84['offset']=qs[_0x5e75('0x17')](_0x3712be['query'][_0x5e75('0x17')]);}_0x5a1d84[_0x5e75('0x32')]=qs['sort'](_0x3712be[_0x5e75('0x2a')]['sort']);_0x5a1d84['where']=qs['filters'](_[_0x5e75('0x33')](_0x3712be[_0x5e75('0x2a')],_0x258cd7[_0x5e75('0x2c')]),_0x15baca);if(_0x3712be[_0x5e75('0x2a')][_0x5e75('0x34')]){_0x5a1d84[_0x5e75('0x35')]=_['merge'](_0x5a1d84[_0x5e75('0x35')],{'$or':_[_0x5e75('0x25')](_0x15baca,function(_0x258a41){if(_0x258a41['type']!=='VIRTUAL'){var _0x3bbe15={};_0x3bbe15[_0x258a41[_0x5e75('0x22')]]={'$like':'%'+_0x3712be[_0x5e75('0x2a')][_0x5e75('0x34')]+'%'};return _0x3bbe15;}})});}_0x5a1d84=_['merge']({},_0x5a1d84,_0x3712be[_0x5e75('0x36')]);var _0x27eb70={'where':_0x5a1d84[_0x5e75('0x35')]};return db[_0x5e75('0x26')][_0x5e75('0x1a')](_0x27eb70)['then'](function(_0x38ab9f){_0x2db3ec[_0x5e75('0x1a')]=_0x38ab9f;if(_0x3712be[_0x5e75('0x2a')][_0x5e75('0x37')]){_0x5a1d84[_0x5e75('0x38')]=[{'all':!![]}];}return db[_0x5e75('0x26')][_0x5e75('0x39')](_0x5a1d84);})['then'](function(_0x39ca53){_0x2db3ec[_0x5e75('0x3a')]=_0x39ca53;return _0x2db3ec;})[_0x5e75('0x20')](respondWithFilteredResult(_0x372e13,_0x5a1d84))[_0x5e75('0x3b')](handleError(_0x372e13,null));};exports['show']=function(_0x2c558d,_0x5a1edc){var _0x5ae1a2={'raw':!![],'where':{'id':_0x2c558d[_0x5e75('0x3c')]['id']}},_0x5b9186={};_0x5b9186[_0x5e75('0x29')]=_[_0x5e75('0x2b')](db['SugarcrmField'][_0x5e75('0x3d')]);_0x5b9186[_0x5e75('0x2a')]=_[_0x5e75('0x2b')](_0x2c558d['query']);_0x5b9186['filters']=_[_0x5e75('0x2d')](_0x5b9186['model'],_0x5b9186[_0x5e75('0x2a')]);_0x5ae1a2['attributes']=_[_0x5e75('0x2d')](_0x5b9186[_0x5e75('0x29')],qs[_0x5e75('0x2f')](_0x2c558d[_0x5e75('0x2a')][_0x5e75('0x2f')]));_0x5ae1a2[_0x5e75('0x2e')]=_0x5ae1a2[_0x5e75('0x2e')][_0x5e75('0x30')]?_0x5ae1a2['attributes']:_0x5b9186[_0x5e75('0x29')];if(_0x2c558d[_0x5e75('0x2a')][_0x5e75('0x37')]){_0x5ae1a2[_0x5e75('0x38')]=[{'all':!![]}];}_0x5ae1a2=_[_0x5e75('0x3e')]({},_0x5ae1a2,_0x2c558d[_0x5e75('0x36')]);return db[_0x5e75('0x26')][_0x5e75('0x3f')](_0x5ae1a2)[_0x5e75('0x20')](handleEntityNotFound(_0x5a1edc,null))[_0x5e75('0x20')](respondWithResult(_0x5a1edc,null))[_0x5e75('0x3b')](handleError(_0x5a1edc,null));};exports[_0x5e75('0x40')]=function(_0x2c602e,_0x1878d9){return db[_0x5e75('0x26')][_0x5e75('0x40')](_0x2c602e[_0x5e75('0x41')],{})[_0x5e75('0x20')](respondWithResult(_0x1878d9,0xc9))[_0x5e75('0x3b')](handleError(_0x1878d9,null));};exports[_0x5e75('0x1f')]=function(_0x19d7d4,_0xf037ee){if(_0x19d7d4[_0x5e75('0x41')]['id']){delete _0x19d7d4[_0x5e75('0x41')]['id'];}return db[_0x5e75('0x26')][_0x5e75('0x3f')]({'where':{'id':_0x19d7d4[_0x5e75('0x3c')]['id']}})[_0x5e75('0x20')](handleEntityNotFound(_0xf037ee,null))[_0x5e75('0x20')](saveUpdates(_0x19d7d4['body'],null))[_0x5e75('0x20')](respondWithResult(_0xf037ee,null))['catch'](handleError(_0xf037ee,null));};exports[_0x5e75('0x42')]=function(_0x176e3a,_0x3d0e94){return db[_0x5e75('0x26')][_0x5e75('0x3f')]({'where':{'id':_0x176e3a[_0x5e75('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3d0e94,null))['then'](removeEntity(_0x3d0e94,null))[_0x5e75('0x3b')](handleError(_0x3d0e94,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4ff5f2e..005c968 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 _0x3257=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x343ffc,_0x14401d){var _0x38602e=function(_0x2f83a9){while(--_0x2f83a9){_0x343ffc['push'](_0x343ffc['shift']());}};_0x38602e(++_0x14401d);}(_0x3257,0x6b));var _0x7325=function(_0xc8b58,_0x119e9c){_0xc8b58=_0xc8b58-0x0;var _0x233e48=_0x3257[_0xc8b58];return _0x233e48;};'use strict';var _=require(_0x7325('0x0'));var util=require(_0x7325('0x1'));var logger=require(_0x7325('0x2'))(_0x7325('0x3'));var moment=require('moment');var BPromise=require(_0x7325('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7325('0x5'));var rimraf=require(_0x7325('0x6'));var config=require(_0x7325('0x7'));var attributes=require(_0x7325('0x8'));module[_0x7325('0x9')]=function(_0x2b0996,_0x1a6fb8){return _0x2b0996[_0x7325('0xa')](_0x7325('0xb'),attributes,{'tableName':_0x7325('0xc'),'paranoid':![],'indexes':[{'name':_0x7325('0xd'),'fields':[_0x7325('0xe'),_0x7325('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16ef=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0xa64531,_0x48c65f){var _0x1b1f42=function(_0x78e575){while(--_0x78e575){_0xa64531['push'](_0xa64531['shift']());}};_0x1b1f42(++_0x48c65f);}(_0x16ef,0xef));var _0xf16e=function(_0x180278,_0x38ff90){_0x180278=_0x180278-0x0;var _0x5b366d=_0x16ef[_0x180278];return _0x5b366d;};'use strict';var _=require(_0xf16e('0x0'));var util=require(_0xf16e('0x1'));var logger=require(_0xf16e('0x2'))('api');var moment=require(_0xf16e('0x3'));var BPromise=require(_0xf16e('0x4'));var rp=require(_0xf16e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf16e('0x6'));var config=require(_0xf16e('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0xf16e('0x8')]=function(_0x5723d9,_0x3da697){return _0x5723d9[_0xf16e('0x9')](_0xf16e('0xa'),attributes,{'tableName':_0xf16e('0xb'),'paranoid':![],'indexes':[{'name':_0xf16e('0xc'),'fields':['idField',_0xf16e('0xd')],'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 7bfda43..14bb83c 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 _0x4043=['request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0xa548a4,_0x131063){var _0x364b1a=function(_0x53ac28){while(--_0x53ac28){_0xa548a4['push'](_0xa548a4['shift']());}};_0x364b1a(++_0x131063);}(_0x4043,0xf2));var _0x3404=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4043[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3404('0x0'));var util=require(_0x3404('0x1'));var moment=require('moment');var BPromise=require(_0x3404('0x2'));var rs=require(_0x3404('0x3'));var fs=require('fs');var Redis=require(_0x3404('0x4'));var db=require(_0x3404('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3404('0x6'));var config=require('../../config/environment');var jayson=require(_0x3404('0x7'));var client=jayson[_0x3404('0x8')][_0x3404('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37524f,_0x40f024,_0x32f8a3){return new BPromise(function(_0x4a4d5e,_0x3d31ac){return client[_0x3404('0xa')](_0x37524f,_0x32f8a3)['then'](function(_0x23dc6b){logger[_0x3404('0xb')](_0x3404('0xc'),_0x40f024,_0x3404('0xd'));logger['debug'](_0x3404('0xe'),_0x40f024,'request\x20sent',JSON[_0x3404('0xf')](_0x23dc6b));if(_0x23dc6b[_0x3404('0x10')]){if(_0x23dc6b[_0x3404('0x10')][_0x3404('0x11')]===0x1f4){logger[_0x3404('0x10')](_0x3404('0xc'),_0x40f024,_0x23dc6b['error']['message']);return _0x3d31ac(_0x23dc6b[_0x3404('0x10')][_0x3404('0x12')]);}logger[_0x3404('0x10')](_0x3404('0xc'),_0x40f024,_0x23dc6b[_0x3404('0x10')][_0x3404('0x12')]);return _0x4a4d5e(_0x23dc6b[_0x3404('0x10')][_0x3404('0x12')]);}else{logger[_0x3404('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x40f024,_0x3404('0xd'));_0x4a4d5e(_0x23dc6b[_0x3404('0x13')]['message']);}})[_0x3404('0x14')](function(_0x3d9c34){logger[_0x3404('0x10')](_0x3404('0xc'),_0x40f024,_0x3d9c34);_0x3d31ac(_0x3d9c34);});});} \ No newline at end of file +var _0x0e3f=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','../../mysqldb'];(function(_0x2c8da6,_0xcc6f91){var _0x879db4=function(_0x47d97c){while(--_0x47d97c){_0x2c8da6['push'](_0x2c8da6['shift']());}};_0x879db4(++_0xcc6f91);}(_0x0e3f,0x119));var _0xf0e3=function(_0x1d6e3e,_0x4e194c){_0x1d6e3e=_0x1d6e3e-0x0;var _0x222057=_0x0e3f[_0x1d6e3e];return _0x222057;};'use strict';var _=require('lodash');var util=require(_0xf0e3('0x0'));var moment=require(_0xf0e3('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0e3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0e3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0e3('0x4'))('rpc');var config=require(_0xf0e3('0x5'));var jayson=require(_0xf0e3('0x6'));var client=jayson['client'][_0xf0e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x297882,_0x5b2959,_0x539c0e){return new BPromise(function(_0x38dabe,_0x4f7b66){return client[_0xf0e3('0x8')](_0x297882,_0x539c0e)[_0xf0e3('0x9')](function(_0x2f60b1){logger[_0xf0e3('0xa')](_0xf0e3('0xb'),_0x5b2959,'request\x20sent');logger['debug'](_0xf0e3('0xc'),_0x5b2959,_0xf0e3('0xd'),JSON[_0xf0e3('0xe')](_0x2f60b1));if(_0x2f60b1[_0xf0e3('0xf')]){if(_0x2f60b1[_0xf0e3('0xf')][_0xf0e3('0x10')]===0x1f4){logger[_0xf0e3('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x5b2959,_0x2f60b1['error'][_0xf0e3('0x11')]);return _0x4f7b66(_0x2f60b1[_0xf0e3('0xf')][_0xf0e3('0x11')]);}logger[_0xf0e3('0xf')](_0xf0e3('0xb'),_0x5b2959,_0x2f60b1['error'][_0xf0e3('0x11')]);return _0x38dabe(_0x2f60b1[_0xf0e3('0xf')][_0xf0e3('0x11')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x5b2959,_0xf0e3('0xd'));_0x38dabe(_0x2f60b1['result']['message']);}})[_0xf0e3('0x12')](function(_0x37879d){logger[_0xf0e3('0xf')](_0xf0e3('0xb'),_0x5b2959,_0x37879d);_0x4f7b66(_0x37879d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ce30779..c1706d2 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 _0xdeb3=['addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x5f5466,_0x8d4193){var _0x37cbbf=function(_0x1a348f){while(--_0x1a348f){_0x5f5466['push'](_0x5f5466['shift']());}};_0x37cbbf(++_0x8d4193);}(_0xdeb3,0xeb));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var path=require(_0x3deb('0x2'));var timeout=require(_0x3deb('0x3'));var express=require(_0x3deb('0x4'));var router=express[_0x3deb('0x5')]();var fs_extra=require(_0x3deb('0x6'));var auth=require(_0x3deb('0x7'));var interaction=require(_0x3deb('0x8'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['show']);router['get'](_0x3deb('0xd'),auth[_0x3deb('0x9')](),controller[_0x3deb('0xe')]);router[_0x3deb('0xb')](_0x3deb('0xf'),auth[_0x3deb('0x9')](),controller[_0x3deb('0x10')]);router[_0x3deb('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3deb('0xd'),auth['isAuthenticated'](),controller[_0x3deb('0x12')]);router[_0x3deb('0x13')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['update']);router[_0x3deb('0x14')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0x15')]);module[_0x3deb('0x16')]=router; \ No newline at end of file +var _0xe18e=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0xe18e,0xe5));var _0xee18=function(_0x40168f,_0x5a2d1d){_0x40168f=_0x40168f-0x0;var _0x206d3b=_0xe18e[_0x40168f];return _0x206d3b;};'use strict';var multer=require(_0xee18('0x0'));var util=require(_0xee18('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee18('0x2'));var router=express[_0xee18('0x3')]();var fs_extra=require(_0xee18('0x4'));var auth=require(_0xee18('0x5'));var interaction=require(_0xee18('0x6'));var config=require('../../config/environment');var controller=require(_0xee18('0x7'));router[_0xee18('0x8')]('/',auth[_0xee18('0x9')](),controller[_0xee18('0xa')]);router[_0xee18('0x8')](_0xee18('0xb'),auth[_0xee18('0x9')](),controller[_0xee18('0xc')]);router[_0xee18('0x8')](_0xee18('0xd'),auth['isAuthenticated'](),controller[_0xee18('0xe')]);router['get']('/:id/fields',auth[_0xee18('0x9')](),controller[_0xee18('0xf')]);router[_0xee18('0x10')]('/',auth[_0xee18('0x9')](),controller[_0xee18('0x11')]);router[_0xee18('0x10')](_0xee18('0xd'),auth[_0xee18('0x9')](),controller[_0xee18('0x12')]);router[_0xee18('0x13')]('/:id',auth[_0xee18('0x9')](),controller[_0xee18('0x14')]);router[_0xee18('0x15')](_0xee18('0xb'),auth[_0xee18('0x9')](),controller[_0xee18('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 432dd6b..696afc4 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 _0x783a=['HelpDesk','sequelize','STRING'];(function(_0x2011cf,_0x2a1a5d){var _0x242337=function(_0x47cb85){while(--_0x47cb85){_0x2011cf['push'](_0x2011cf['shift']());}};_0x242337(++_0x2a1a5d);}(_0x783a,0x1cc));var _0xa783=function(_0x76425f,_0x1766b5){_0x76425f=_0x76425f-0x0;var _0x49e441=_0x783a[_0x76425f];return _0x49e441;};'use strict';var Sequelize=require(_0xa783('0x0'));module['exports']={'name':{'type':Sequelize[_0xa783('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa783('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa783('0x2')},'remoteUri':{'type':Sequelize[_0xa783('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa783('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa6c7=['exports','STRING','HelpDesk','sequelize'];(function(_0x4458c9,_0x34ff53){var _0x4ec436=function(_0x373534){while(--_0x373534){_0x4458c9['push'](_0x4458c9['shift']());}};_0x4ec436(++_0x34ff53);}(_0xa6c7,0xd7));var _0x7a6c=function(_0x58f1ef,_0x4cf4d5){_0x58f1ef=_0x58f1ef-0x0;var _0x2ef772=_0xa6c7[_0x58f1ef];return _0x2ef772;};'use strict';var Sequelize=require(_0x7a6c('0x0'));module[_0x7a6c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7a6c('0x2')]},'username':{'type':Sequelize[_0x7a6c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7a6c('0x3')},'remoteUri':{'type':Sequelize[_0x7a6c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7a6c('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7a6c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index de07b74..7c1856d 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 _0x684e=['filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','intersection','find','create','body','catch','params','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','username','description','moduleName','remoteUri','accessKey','slice','%s/webservice.php','GET','getchallenge','POST','login','result','token','describe','success','autogenerated','reference','owner','remove','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','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','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1e52bf,_0x4cfa32){var _0x2fdc63=function(_0x243d06){while(--_0x243d06){_0x1e52bf['push'](_0x1e52bf['shift']());}};_0x2fdc63(++_0x4cfa32);}(_0x684e,0x13e));var _0xe684=function(_0x1609b1,_0x1d2427){_0x1609b1=_0x1609b1-0x0;var _0x24cde9=_0x684e[_0x1609b1];return _0x24cde9;};'use strict';var emlformat=require(_0xe684('0x0'));var rimraf=require(_0xe684('0x1'));var zipdir=require(_0xe684('0x2'));var jsonpatch=require(_0xe684('0x3'));var rp=require(_0xe684('0x4'));var moment=require(_0xe684('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe684('0x6'));var path=require(_0xe684('0x7'));var sox=require(_0xe684('0x8'));var csv=require(_0xe684('0x9'));var ejs=require(_0xe684('0xa'));var fs=require('fs');var fs_extra=require(_0xe684('0xb'));var _=require(_0xe684('0xc'));var squel=require(_0xe684('0xd'));var crypto=require(_0xe684('0xe'));var jsforce=require(_0xe684('0xf'));var deskjs=require(_0xe684('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe684('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe684('0x12'));var qs=require(_0xe684('0x13'));var as=require(_0xe684('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe684('0x15'))(_0xe684('0x16'));var utils=require(_0xe684('0x17'));var config=require(_0xe684('0x18'));var licenseUtil=require(_0xe684('0x19'));var db=require(_0xe684('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x156299,_0x2ee8de){_0x2ee8de=_0x2ee8de||0xcc;return function(_0x4aa14c){if(_0x4aa14c){return _0x156299[_0xe684('0x1b')](_0x2ee8de);}return _0x156299[_0xe684('0x1c')](_0x2ee8de)[_0xe684('0x1d')]();};}function respondWithResult(_0x1febfa,_0x2fb0f1){_0x2fb0f1=_0x2fb0f1||0xc8;return function(_0x45ae1f){if(_0x45ae1f){return _0x1febfa[_0xe684('0x1c')](_0x2fb0f1)[_0xe684('0x1e')](_0x45ae1f);}};}function respondWithFilteredResult(_0x563cea,_0x134edd){return function(_0x371330){if(_0x371330){var _0x3badc6=typeof _0x134edd[_0xe684('0x1f')]===_0xe684('0x20')&&typeof _0x134edd[_0xe684('0x21')]===_0xe684('0x20');var _0x10a85c=_0x371330[_0xe684('0x22')];var _0x2abe2d=_0x3badc6?0x0:_0x134edd['offset'];var _0x587e11=_0x3badc6?_0x371330[_0xe684('0x22')]:_0x134edd[_0xe684('0x1f')]+_0x134edd[_0xe684('0x21')];var _0x556c43;if(_0x587e11>=_0x10a85c){_0x587e11=_0x10a85c;_0x556c43=0xc8;}else{_0x556c43=0xce;}_0x563cea[_0xe684('0x1c')](_0x556c43);return _0x563cea[_0xe684('0x23')](_0xe684('0x24'),_0x2abe2d+'-'+_0x587e11+'/'+_0x10a85c)['json'](_0x371330);}return null;};}function patchUpdates(_0x232059){return function(_0x3097c0){try{jsonpatch['apply'](_0x3097c0,_0x232059,!![]);}catch(_0x1ef795){return BPromise[_0xe684('0x25')](_0x1ef795);}return _0x3097c0['save']();};}function saveUpdates(_0x51dd63,_0x3a8347){return function(_0x350b3e){if(_0x350b3e){return _0x350b3e[_0xe684('0x26')](_0x51dd63)[_0xe684('0x27')](function(_0x3c9d2f){return _0x3c9d2f;});}return null;};}function removeEntity(_0x3350bc,_0x5256b1){return function(_0x370fcd){if(_0x370fcd){return _0x370fcd[_0xe684('0x28')]()['then'](function(){_0x3350bc[_0xe684('0x1c')](0xcc)[_0xe684('0x1d')]();});}};}function handleEntityNotFound(_0x1f1748,_0x249dd2){return function(_0x42896c){if(!_0x42896c){_0x1f1748[_0xe684('0x1b')](0x194);}return _0x42896c;};}function handleError(_0x5d4db8,_0x414ae5){_0x414ae5=_0x414ae5||0x1f4;return function(_0x198ed2){logger[_0xe684('0x29')](_0x198ed2[_0xe684('0x2a')]);if(_0x198ed2[_0xe684('0x2b')]){delete _0x198ed2['name'];}_0x5d4db8[_0xe684('0x1c')](_0x414ae5)['send'](_0x198ed2);};}exports[_0xe684('0x2c')]=function(_0x53ae0f,_0x6ac8ab){var _0x25efdd={},_0x9ce450={},_0x1615f9={'count':0x0,'rows':[]};var _0x4859c8=_[_0xe684('0x2d')](db[_0xe684('0x2e')][_0xe684('0x2f')],function(_0x23125b){return{'name':_0x23125b[_0xe684('0x30')],'type':_0x23125b[_0xe684('0x31')][_0xe684('0x32')]};});_0x9ce450[_0xe684('0x33')]=_[_0xe684('0x2d')](_0x4859c8,_0xe684('0x2b'));_0x9ce450[_0xe684('0x34')]=_[_0xe684('0x35')](_0x53ae0f[_0xe684('0x34')]);_0x9ce450[_0xe684('0x36')]=_['intersection'](_0x9ce450[_0xe684('0x33')],_0x9ce450[_0xe684('0x34')]);_0x25efdd[_0xe684('0x37')]=_['intersection'](_0x9ce450[_0xe684('0x33')],qs[_0xe684('0x38')](_0x53ae0f[_0xe684('0x34')][_0xe684('0x38')]));_0x25efdd[_0xe684('0x37')]=_0x25efdd[_0xe684('0x37')][_0xe684('0x39')]?_0x25efdd['attributes']:_0x9ce450['model'];if(!_0x53ae0f[_0xe684('0x34')][_0xe684('0x3a')](_0xe684('0x3b'))){_0x25efdd['limit']=qs['limit'](_0x53ae0f[_0xe684('0x34')]['limit']);_0x25efdd['offset']=qs[_0xe684('0x1f')](_0x53ae0f[_0xe684('0x34')][_0xe684('0x1f')]);}_0x25efdd['order']=qs[_0xe684('0x3c')](_0x53ae0f['query'][_0xe684('0x3c')]);_0x25efdd[_0xe684('0x3d')]=qs[_0xe684('0x36')](_[_0xe684('0x3e')](_0x53ae0f[_0xe684('0x34')],_0x9ce450['filters']),_0x4859c8);if(_0x53ae0f[_0xe684('0x34')]['filter']){_0x25efdd[_0xe684('0x3d')]=_[_0xe684('0x3f')](_0x25efdd[_0xe684('0x3d')],{'$or':_['map'](_0x4859c8,function(_0x32b1c1){if(_0x32b1c1[_0xe684('0x31')]!==_0xe684('0x40')){var _0x114ed1={};_0x114ed1[_0x32b1c1['name']]={'$like':'%'+_0x53ae0f[_0xe684('0x34')][_0xe684('0x41')]+'%'};return _0x114ed1;}})});}_0x25efdd=_[_0xe684('0x3f')]({},_0x25efdd,_0x53ae0f[_0xe684('0x42')]);var _0x38d220={'where':_0x25efdd[_0xe684('0x3d')]};return db[_0xe684('0x2e')]['count'](_0x38d220)['then'](function(_0x4177e4){_0x1615f9[_0xe684('0x22')]=_0x4177e4;if(_0x53ae0f[_0xe684('0x34')][_0xe684('0x43')]){_0x25efdd[_0xe684('0x44')]=[{'all':!![]}];}return db['VtigerAccount'][_0xe684('0x45')](_0x25efdd);})['then'](function(_0x10f830){_0x1615f9[_0xe684('0x46')]=_0x10f830;return _0x1615f9;})[_0xe684('0x27')](respondWithFilteredResult(_0x6ac8ab,_0x25efdd))['catch'](handleError(_0x6ac8ab,null));};exports[_0xe684('0x47')]=function(_0x1204c9,_0xab9080){var _0x32b4ff={'raw':![],'where':{'id':_0x1204c9['params']['id']}},_0x53a9a2={};_0x53a9a2[_0xe684('0x33')]=_[_0xe684('0x35')](db[_0xe684('0x2e')][_0xe684('0x2f')]);_0x53a9a2[_0xe684('0x34')]=_[_0xe684('0x35')](_0x1204c9[_0xe684('0x34')]);_0x53a9a2['filters']=_[_0xe684('0x48')](_0x53a9a2[_0xe684('0x33')],_0x53a9a2[_0xe684('0x34')]);_0x32b4ff[_0xe684('0x37')]=_[_0xe684('0x48')](_0x53a9a2[_0xe684('0x33')],qs['fields'](_0x1204c9[_0xe684('0x34')][_0xe684('0x38')]));_0x32b4ff[_0xe684('0x37')]=_0x32b4ff[_0xe684('0x37')]['length']?_0x32b4ff[_0xe684('0x37')]:_0x53a9a2[_0xe684('0x33')];if(_0x1204c9[_0xe684('0x34')][_0xe684('0x43')]){_0x32b4ff['include']=[{'all':!![]}];}_0x32b4ff=_[_0xe684('0x3f')]({},_0x32b4ff,_0x1204c9[_0xe684('0x42')]);return db[_0xe684('0x2e')][_0xe684('0x49')](_0x32b4ff)[_0xe684('0x27')](handleEntityNotFound(_0xab9080,null))[_0xe684('0x27')](respondWithResult(_0xab9080,null))['catch'](handleError(_0xab9080,null));};exports[_0xe684('0x4a')]=function(_0x396aed,_0x54e654){return db[_0xe684('0x2e')]['create'](_0x396aed[_0xe684('0x4b')],{})[_0xe684('0x27')](respondWithResult(_0x54e654,0xc9))[_0xe684('0x4c')](handleError(_0x54e654,null));};exports[_0xe684('0x26')]=function(_0xc08801,_0x3ecf8e){if(_0xc08801[_0xe684('0x4b')]['id']){delete _0xc08801[_0xe684('0x4b')]['id'];}return db[_0xe684('0x2e')][_0xe684('0x49')]({'where':{'id':_0xc08801['params']['id']}})[_0xe684('0x27')](handleEntityNotFound(_0x3ecf8e,null))[_0xe684('0x27')](saveUpdates(_0xc08801[_0xe684('0x4b')],null))[_0xe684('0x27')](respondWithResult(_0x3ecf8e,null))[_0xe684('0x4c')](handleError(_0x3ecf8e,null));};exports['destroy']=function(_0x427c45,_0x126a7d){return db[_0xe684('0x2e')][_0xe684('0x49')]({'where':{'id':_0x427c45[_0xe684('0x4d')]['id']}})['then'](handleEntityNotFound(_0x126a7d,null))[_0xe684('0x27')](removeEntity(_0x126a7d,null))[_0xe684('0x4c')](handleError(_0x126a7d,null));};exports[_0xe684('0x4e')]=function(_0x51d785,_0x256abd,_0x836b3d){var _0x399ed0={};var _0x5d226b={};var _0xfb18f8;var _0x16bc12;return db[_0xe684('0x2e')][_0xe684('0x4f')]({'where':{'id':_0x51d785[_0xe684('0x4d')]['id']}})['then'](handleEntityNotFound(_0x256abd,null))[_0xe684('0x27')](function(_0x260cce){if(_0x260cce){_0xfb18f8=_0x260cce;_0x5d226b[_0xe684('0x33')]=_[_0xe684('0x35')](db['VtigerConfiguration']['rawAttributes']);_0x5d226b['query']=_[_0xe684('0x35')](_0x51d785[_0xe684('0x34')]);_0x5d226b[_0xe684('0x36')]=_[_0xe684('0x48')](_0x5d226b[_0xe684('0x33')],_0x5d226b[_0xe684('0x34')]);_0x399ed0[_0xe684('0x37')]=_[_0xe684('0x48')](_0x5d226b[_0xe684('0x33')],qs[_0xe684('0x38')](_0x51d785[_0xe684('0x34')]['fields']));_0x399ed0[_0xe684('0x37')]=_0x399ed0[_0xe684('0x37')][_0xe684('0x39')]?_0x399ed0[_0xe684('0x37')]:_0x5d226b[_0xe684('0x33')];_0x399ed0[_0xe684('0x50')]=qs[_0xe684('0x3c')](_0x51d785[_0xe684('0x34')][_0xe684('0x3c')]);_0x399ed0[_0xe684('0x3d')]=qs[_0xe684('0x36')](_[_0xe684('0x3e')](_0x51d785[_0xe684('0x34')],_0x5d226b['filters']));if(_0x51d785[_0xe684('0x34')][_0xe684('0x41')]){_0x399ed0[_0xe684('0x3d')]=_[_0xe684('0x3f')](_0x399ed0[_0xe684('0x3d')],{'$or':_['map'](_0x399ed0[_0xe684('0x37')],function(_0x196cf9){var _0x24d950={};_0x24d950[_0x196cf9]={'$like':'%'+_0x51d785[_0xe684('0x34')][_0xe684('0x41')]+'%'};return _0x24d950;})});}_0x399ed0=_[_0xe684('0x3f')]({},_0x399ed0,_0x51d785[_0xe684('0x42')]);return _0xfb18f8[_0xe684('0x4e')](_0x399ed0);}})['then'](function(_0x5ec20b){if(_0x5ec20b){_0x16bc12=_0x5ec20b['length'];if(!_0x51d785[_0xe684('0x34')]['hasOwnProperty'](_0xe684('0x3b'))){_0x399ed0['limit']=qs[_0xe684('0x21')](_0x51d785['query']['limit']);_0x399ed0[_0xe684('0x1f')]=qs['offset'](_0x51d785[_0xe684('0x34')][_0xe684('0x1f')]);}return _0xfb18f8[_0xe684('0x4e')](_0x399ed0);}})[_0xe684('0x27')](function(_0x150fd9){if(_0x150fd9){return _0x150fd9?{'count':_0x16bc12,'rows':_0x150fd9}:null;}})[_0xe684('0x27')](respondWithResult(_0x256abd,null))[_0xe684('0x4c')](handleError(_0x256abd,null));};exports[_0xe684('0x51')]=function(_0x38f74d,_0x723931,_0x49652d){if(_0x38f74d['body']['id']){delete _0x38f74d[_0xe684('0x4b')]['id'];}return db[_0xe684('0x2e')][_0xe684('0x4f')]({'where':{'id':_0x38f74d[_0xe684('0x4d')]['id']}})[_0xe684('0x27')](handleEntityNotFound(_0x723931,null))[_0xe684('0x27')](function(_0x260d1a){if(_0x260d1a){_0x38f74d[_0xe684('0x4b')]['AccountId']=_0x260d1a['id'];_0x38f74d[_0xe684('0x4b')][_0xe684('0x52')]=integrations[_0xe684('0x53')](_0x38f74d['body'][_0xe684('0x54')],_0x38f74d[_0xe684('0x4b')][_0xe684('0x31')]);_0x38f74d[_0xe684('0x4b')][_0xe684('0x55')]=integrations[_0xe684('0x56')](_0x38f74d['body'][_0xe684('0x54')],_0x38f74d[_0xe684('0x4b')][_0xe684('0x31')]);return db[_0xe684('0x57')][_0xe684('0x4a')](_0x38f74d[_0xe684('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0xe684('0x52')},{'model':db[_0xe684('0x58')],'as':_0xe684('0x55')}]});}return null;})[_0xe684('0x27')](respondWithResult(_0x723931,null))[_0xe684('0x4c')](handleError(_0x723931,null));};var md5=require('md5');exports[_0xe684('0x59')]=function(_0x500b66,_0x6c4e25,_0x283a8a){var _0x51628e=null;var _0xb907e4=null;var _0x547f8c=null;var _0x56ae13=null;var _0x2cc62f='';return db[_0xe684('0x2e')]['findOne']({'where':{'id':_0x500b66[_0xe684('0x4d')]['id']},'attributes':['id',_0xe684('0x2b'),_0xe684('0x5a'),_0xe684('0x5b'),_0xe684('0x5c'),_0xe684('0x5d'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x6c4e25,null))[_0xe684('0x27')](function(_0x56b255){if(_0x56b255){_0x51628e=_0x56b255[_0xe684('0x5a')];_0xb907e4=_0x56b255[_0xe684('0x5e')];_0x547f8c=_0x56b255[_0xe684('0x5c')];_0x2cc62f=_0x56b255['remoteUri'];var _0x57af09=_0x2cc62f[_0xe684('0x5f')](-0x1);if(_0x57af09==='/'){_0x2cc62f=_0x2cc62f['substring'](0x0,_0x2cc62f['lastIndexOf'](_0x57af09));}_0x56ae13=util['format'](_0xe684('0x60'),_0x2cc62f);var _0x198504={'method':_0xe684('0x61'),'uri':_0x56ae13,'qs':{'operation':_0xe684('0x62'),'username':_0x56b255[_0xe684('0x5a')]},'json':!![]};return rp(_0x198504);}})[_0xe684('0x27')](function(_0x3c9eef){if(_0x3c9eef['success']){var _0x2a1677={'method':_0xe684('0x63'),'uri':_0x56ae13,'form':{'operation':_0xe684('0x64'),'username':_0x51628e,'accessKey':md5(_0x3c9eef[_0xe684('0x65')][_0xe684('0x66')]+_0xb907e4)},'json':!![]};return rp(_0x2a1677);}})['then'](function(_0x394880){if(_0x394880['success']){var _0x54f043={'method':_0xe684('0x61'),'uri':_0x56ae13,'qs':{'operation':_0xe684('0x67'),'username':_0x51628e,'sessionName':_0x394880[_0xe684('0x65')]['sessionName'],'elementType':_0x547f8c},'json':!![]};return rp(_0x54f043);}})['then'](function(_0x3b2bfd){if(_0x3b2bfd[_0xe684('0x68')]){var _0x1e208e=[_0xe684('0x69'),_0xe684('0x6a'),_0xe684('0x6b')];_[_0xe684('0x6c')](_0x3b2bfd[_0xe684('0x65')][_0xe684('0x38')],function(_0x4f3472){return _0x1e208e['includes'](_0x4f3472['type'][_0xe684('0x2b')]);});_[_0xe684('0x6c')](_0x3b2bfd[_0xe684('0x65')][_0xe684('0x38')],function(_0x2fcea1){return _0x2fcea1[_0xe684('0x6d')]===_0xe684('0x6e');});return{'count':_0x3b2bfd[_0xe684('0x65')][_0xe684('0x38')][_0xe684('0x39')],'rows':_[_0xe684('0x2d')](_0x3b2bfd[_0xe684('0x65')][_0xe684('0x38')],function(_0x27bfc7){return{'id':_0x27bfc7[_0xe684('0x2b')],'name':_0x27bfc7[_0xe684('0x6f')],'custom':_[_0xe684('0x70')](_0x27bfc7[_0xe684('0x2b')],'cf_')?!![]:![],'options':_0x27bfc7[_0xe684('0x31')][_0xe684('0x2b')]===_0xe684('0x71')&&_0x27bfc7[_0xe684('0x31')]['picklistValues'][_0xe684('0x39')]>0x0?_[_0xe684('0x2d')](_0x27bfc7[_0xe684('0x31')][_0xe684('0x72')],function(_0x5d9058){return{'name':_0x5d9058[_0xe684('0x6f')],'value':_0x5d9058[_0xe684('0x73')]};}):[]};})};}})[_0xe684('0x27')](respondWithResult(_0x6c4e25,null))[_0xe684('0x4c')](function(_0x4a9089){console[_0xe684('0x74')](_0xe684('0x75')+_0x4a9089);var _0x56912d=_0x500b66[_0xe684('0x34')][_0xe684('0x76')]?0x1f4:_0x4a9089[_0xe684('0x77')]||0x1f4;logger[_0xe684('0x29')](_0xe684('0x78'),_0xe684('0x59'),_0x56912d,JSON[_0xe684('0x79')](_0x4a9089));delete _0x4a9089['name'];if(_0x56912d===0x191){_0x56912d=0x190;}_0x6c4e25['status'](_0x56912d)[_0xe684('0x7a')](_0x500b66[_0xe684('0x34')][_0xe684('0x76')]?{'message':_0xe684('0x7b'),'statusCode':_0x4a9089[_0xe684('0x77')]}:_0x4a9089);});}; \ No newline at end of file +var _0x97ab=['remove','editable','false','label','cf_','picklist','picklistValues','value','log','statusCode','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','reject','save','destroy','error','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','then','includeAll','rows','catch','show','include','find','create','body','update','params','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner'];(function(_0x1851c1,_0x323085){var _0x1bc44d=function(_0x2967d1){while(--_0x2967d1){_0x1851c1['push'](_0x1851c1['shift']());}};_0x1bc44d(++_0x323085);}(_0x97ab,0x174));var _0xb97a=function(_0x552291,_0x2c0770){_0x552291=_0x552291-0x0;var _0x227cb8=_0x97ab[_0x552291];return _0x227cb8;};'use strict';var emlformat=require(_0xb97a('0x0'));var rimraf=require(_0xb97a('0x1'));var zipdir=require(_0xb97a('0x2'));var jsonpatch=require(_0xb97a('0x3'));var rp=require(_0xb97a('0x4'));var moment=require(_0xb97a('0x5'));var BPromise=require(_0xb97a('0x6'));var Mustache=require(_0xb97a('0x7'));var util=require(_0xb97a('0x8'));var path=require(_0xb97a('0x9'));var sox=require(_0xb97a('0xa'));var csv=require(_0xb97a('0xb'));var ejs=require(_0xb97a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb97a('0xd'));var squel=require(_0xb97a('0xe'));var crypto=require('crypto');var jsforce=require(_0xb97a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb97a('0x10'));var authService=require(_0xb97a('0x11'));var qs=require(_0xb97a('0x12'));var as=require(_0xb97a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb97a('0x14'));var utils=require(_0xb97a('0x15'));var config=require(_0xb97a('0x16'));var licenseUtil=require(_0xb97a('0x17'));var db=require(_0xb97a('0x18'))['db'];var integrations=require(_0xb97a('0x19'));function respondWithStatusCode(_0x391ec2,_0x4aeee3){_0x4aeee3=_0x4aeee3||0xcc;return function(_0x1bdfdc){if(_0x1bdfdc){return _0x391ec2[_0xb97a('0x1a')](_0x4aeee3);}return _0x391ec2['status'](_0x4aeee3)[_0xb97a('0x1b')]();};}function respondWithResult(_0x694cdb,_0xefbeae){_0xefbeae=_0xefbeae||0xc8;return function(_0x5d218e){if(_0x5d218e){return _0x694cdb[_0xb97a('0x1c')](_0xefbeae)[_0xb97a('0x1d')](_0x5d218e);}};}function respondWithFilteredResult(_0x43e6ab,_0x202e94){return function(_0x364f0e){if(_0x364f0e){var _0x594ed1=typeof _0x202e94['offset']===_0xb97a('0x1e')&&typeof _0x202e94[_0xb97a('0x1f')]===_0xb97a('0x1e');var _0x393bec=_0x364f0e[_0xb97a('0x20')];var _0x35cfa7=_0x594ed1?0x0:_0x202e94[_0xb97a('0x21')];var _0x1d5c88=_0x594ed1?_0x364f0e[_0xb97a('0x20')]:_0x202e94[_0xb97a('0x21')]+_0x202e94['limit'];var _0x48e609;if(_0x1d5c88>=_0x393bec){_0x1d5c88=_0x393bec;_0x48e609=0xc8;}else{_0x48e609=0xce;}_0x43e6ab['status'](_0x48e609);return _0x43e6ab['set']('Content-Range',_0x35cfa7+'-'+_0x1d5c88+'/'+_0x393bec)[_0xb97a('0x1d')](_0x364f0e);}return null;};}function patchUpdates(_0x124dee){return function(_0x4defda){try{jsonpatch['apply'](_0x4defda,_0x124dee,!![]);}catch(_0x375bfe){return BPromise[_0xb97a('0x22')](_0x375bfe);}return _0x4defda[_0xb97a('0x23')]();};}function saveUpdates(_0x5ec067,_0x2a2da1){return function(_0x95fdff){if(_0x95fdff){return _0x95fdff['update'](_0x5ec067)['then'](function(_0x17966b){return _0x17966b;});}return null;};}function removeEntity(_0x3959cd,_0x273f02){return function(_0x7270c7){if(_0x7270c7){return _0x7270c7[_0xb97a('0x24')]()['then'](function(){_0x3959cd[_0xb97a('0x1c')](0xcc)[_0xb97a('0x1b')]();});}};}function handleEntityNotFound(_0x29320d,_0x101f14){return function(_0x32230b){if(!_0x32230b){_0x29320d[_0xb97a('0x1a')](0x194);}return _0x32230b;};}function handleError(_0x1586d3,_0x374985){_0x374985=_0x374985||0x1f4;return function(_0xab7c20){logger[_0xb97a('0x25')](_0xab7c20[_0xb97a('0x26')]);if(_0xab7c20[_0xb97a('0x27')]){delete _0xab7c20[_0xb97a('0x27')];}_0x1586d3['status'](_0x374985)[_0xb97a('0x28')](_0xab7c20);};}exports['index']=function(_0x4aeba2,_0x18ce53){var _0xd3841={},_0x375058={},_0x13555f={'count':0x0,'rows':[]};var _0x30e072=_[_0xb97a('0x29')](db[_0xb97a('0x2a')][_0xb97a('0x2b')],function(_0x2b2492){return{'name':_0x2b2492[_0xb97a('0x2c')],'type':_0x2b2492['type'][_0xb97a('0x2d')]};});_0x375058[_0xb97a('0x2e')]=_[_0xb97a('0x29')](_0x30e072,_0xb97a('0x27'));_0x375058[_0xb97a('0x2f')]=_[_0xb97a('0x30')](_0x4aeba2[_0xb97a('0x2f')]);_0x375058[_0xb97a('0x31')]=_['intersection'](_0x375058[_0xb97a('0x2e')],_0x375058[_0xb97a('0x2f')]);_0xd3841[_0xb97a('0x32')]=_[_0xb97a('0x33')](_0x375058[_0xb97a('0x2e')],qs[_0xb97a('0x34')](_0x4aeba2['query'][_0xb97a('0x34')]));_0xd3841[_0xb97a('0x32')]=_0xd3841[_0xb97a('0x32')][_0xb97a('0x35')]?_0xd3841['attributes']:_0x375058['model'];if(!_0x4aeba2['query'][_0xb97a('0x36')]('nolimit')){_0xd3841[_0xb97a('0x1f')]=qs[_0xb97a('0x1f')](_0x4aeba2[_0xb97a('0x2f')][_0xb97a('0x1f')]);_0xd3841[_0xb97a('0x21')]=qs['offset'](_0x4aeba2[_0xb97a('0x2f')][_0xb97a('0x21')]);}_0xd3841[_0xb97a('0x37')]=qs[_0xb97a('0x38')](_0x4aeba2[_0xb97a('0x2f')]['sort']);_0xd3841[_0xb97a('0x39')]=qs[_0xb97a('0x31')](_['pick'](_0x4aeba2['query'],_0x375058[_0xb97a('0x31')]),_0x30e072);if(_0x4aeba2[_0xb97a('0x2f')]['filter']){_0xd3841[_0xb97a('0x39')]=_[_0xb97a('0x3a')](_0xd3841[_0xb97a('0x39')],{'$or':_['map'](_0x30e072,function(_0x5714af){if(_0x5714af[_0xb97a('0x3b')]!==_0xb97a('0x3c')){var _0x2b99bd={};_0x2b99bd[_0x5714af[_0xb97a('0x27')]]={'$like':'%'+_0x4aeba2[_0xb97a('0x2f')][_0xb97a('0x3d')]+'%'};return _0x2b99bd;}})});}_0xd3841=_[_0xb97a('0x3a')]({},_0xd3841,_0x4aeba2[_0xb97a('0x3e')]);var _0x2d2037={'where':_0xd3841[_0xb97a('0x39')]};return db[_0xb97a('0x2a')]['count'](_0x2d2037)[_0xb97a('0x3f')](function(_0x22528a){_0x13555f['count']=_0x22528a;if(_0x4aeba2[_0xb97a('0x2f')][_0xb97a('0x40')]){_0xd3841['include']=[{'all':!![]}];}return db[_0xb97a('0x2a')]['findAll'](_0xd3841);})[_0xb97a('0x3f')](function(_0x26b883){_0x13555f[_0xb97a('0x41')]=_0x26b883;return _0x13555f;})['then'](respondWithFilteredResult(_0x18ce53,_0xd3841))[_0xb97a('0x42')](handleError(_0x18ce53,null));};exports[_0xb97a('0x43')]=function(_0x42ee0a,_0x31688e){var _0xca867={'raw':![],'where':{'id':_0x42ee0a['params']['id']}},_0x40ea57={};_0x40ea57[_0xb97a('0x2e')]=_['keys'](db[_0xb97a('0x2a')][_0xb97a('0x2b')]);_0x40ea57[_0xb97a('0x2f')]=_['keys'](_0x42ee0a['query']);_0x40ea57[_0xb97a('0x31')]=_[_0xb97a('0x33')](_0x40ea57[_0xb97a('0x2e')],_0x40ea57['query']);_0xca867[_0xb97a('0x32')]=_[_0xb97a('0x33')](_0x40ea57[_0xb97a('0x2e')],qs['fields'](_0x42ee0a['query'][_0xb97a('0x34')]));_0xca867['attributes']=_0xca867[_0xb97a('0x32')][_0xb97a('0x35')]?_0xca867[_0xb97a('0x32')]:_0x40ea57[_0xb97a('0x2e')];if(_0x42ee0a[_0xb97a('0x2f')][_0xb97a('0x40')]){_0xca867[_0xb97a('0x44')]=[{'all':!![]}];}_0xca867=_['merge']({},_0xca867,_0x42ee0a['options']);return db[_0xb97a('0x2a')][_0xb97a('0x45')](_0xca867)[_0xb97a('0x3f')](handleEntityNotFound(_0x31688e,null))[_0xb97a('0x3f')](respondWithResult(_0x31688e,null))[_0xb97a('0x42')](handleError(_0x31688e,null));};exports['create']=function(_0x23206b,_0x2b8462){return db[_0xb97a('0x2a')][_0xb97a('0x46')](_0x23206b[_0xb97a('0x47')],{})[_0xb97a('0x3f')](respondWithResult(_0x2b8462,0xc9))['catch'](handleError(_0x2b8462,null));};exports[_0xb97a('0x48')]=function(_0x59cab5,_0x20b9d3){if(_0x59cab5['body']['id']){delete _0x59cab5[_0xb97a('0x47')]['id'];}return db['VtigerAccount'][_0xb97a('0x45')]({'where':{'id':_0x59cab5[_0xb97a('0x49')]['id']}})[_0xb97a('0x3f')](handleEntityNotFound(_0x20b9d3,null))[_0xb97a('0x3f')](saveUpdates(_0x59cab5[_0xb97a('0x47')],null))[_0xb97a('0x3f')](respondWithResult(_0x20b9d3,null))['catch'](handleError(_0x20b9d3,null));};exports[_0xb97a('0x24')]=function(_0x264fda,_0x552829){return db[_0xb97a('0x2a')][_0xb97a('0x45')]({'where':{'id':_0x264fda[_0xb97a('0x49')]['id']}})[_0xb97a('0x3f')](handleEntityNotFound(_0x552829,null))['then'](removeEntity(_0x552829,null))['catch'](handleError(_0x552829,null));};exports[_0xb97a('0x4a')]=function(_0x15c156,_0x9a7df9,_0xbeafe9){var _0x2b52f2={};var _0x3bb371={};var _0x4527ef;var _0x5b7739;return db[_0xb97a('0x2a')][_0xb97a('0x4b')]({'where':{'id':_0x15c156[_0xb97a('0x49')]['id']}})[_0xb97a('0x3f')](handleEntityNotFound(_0x9a7df9,null))[_0xb97a('0x3f')](function(_0x3d656a){if(_0x3d656a){_0x4527ef=_0x3d656a;_0x3bb371[_0xb97a('0x2e')]=_['keys'](db[_0xb97a('0x4c')]['rawAttributes']);_0x3bb371[_0xb97a('0x2f')]=_[_0xb97a('0x30')](_0x15c156['query']);_0x3bb371['filters']=_[_0xb97a('0x33')](_0x3bb371[_0xb97a('0x2e')],_0x3bb371[_0xb97a('0x2f')]);_0x2b52f2['attributes']=_[_0xb97a('0x33')](_0x3bb371['model'],qs[_0xb97a('0x34')](_0x15c156['query'][_0xb97a('0x34')]));_0x2b52f2[_0xb97a('0x32')]=_0x2b52f2[_0xb97a('0x32')]['length']?_0x2b52f2[_0xb97a('0x32')]:_0x3bb371[_0xb97a('0x2e')];_0x2b52f2[_0xb97a('0x37')]=qs[_0xb97a('0x38')](_0x15c156['query'][_0xb97a('0x38')]);_0x2b52f2['where']=qs[_0xb97a('0x31')](_['pick'](_0x15c156[_0xb97a('0x2f')],_0x3bb371['filters']));if(_0x15c156['query'][_0xb97a('0x3d')]){_0x2b52f2[_0xb97a('0x39')]=_[_0xb97a('0x3a')](_0x2b52f2[_0xb97a('0x39')],{'$or':_[_0xb97a('0x29')](_0x2b52f2['attributes'],function(_0x28f4d1){var _0x7167ad={};_0x7167ad[_0x28f4d1]={'$like':'%'+_0x15c156[_0xb97a('0x2f')][_0xb97a('0x3d')]+'%'};return _0x7167ad;})});}_0x2b52f2=_['merge']({},_0x2b52f2,_0x15c156[_0xb97a('0x3e')]);return _0x4527ef['getConfigurations'](_0x2b52f2);}})['then'](function(_0x332c76){if(_0x332c76){_0x5b7739=_0x332c76[_0xb97a('0x35')];if(!_0x15c156[_0xb97a('0x2f')][_0xb97a('0x36')]('nolimit')){_0x2b52f2['limit']=qs['limit'](_0x15c156[_0xb97a('0x2f')][_0xb97a('0x1f')]);_0x2b52f2[_0xb97a('0x21')]=qs['offset'](_0x15c156['query'][_0xb97a('0x21')]);}return _0x4527ef[_0xb97a('0x4a')](_0x2b52f2);}})[_0xb97a('0x3f')](function(_0x20096d){if(_0x20096d){return _0x20096d?{'count':_0x5b7739,'rows':_0x20096d}:null;}})[_0xb97a('0x3f')](respondWithResult(_0x9a7df9,null))[_0xb97a('0x42')](handleError(_0x9a7df9,null));};exports[_0xb97a('0x4d')]=function(_0x57bd07,_0x5d3013,_0x30964c){if(_0x57bd07['body']['id']){delete _0x57bd07[_0xb97a('0x47')]['id'];}return db[_0xb97a('0x2a')][_0xb97a('0x4b')]({'where':{'id':_0x57bd07[_0xb97a('0x49')]['id']}})[_0xb97a('0x3f')](handleEntityNotFound(_0x5d3013,null))['then'](function(_0x77c745){if(_0x77c745){_0x57bd07[_0xb97a('0x47')][_0xb97a('0x4e')]=_0x77c745['id'];_0x57bd07['body'][_0xb97a('0x4f')]=integrations[_0xb97a('0x50')](_0x57bd07['body'][_0xb97a('0x51')],_0x57bd07[_0xb97a('0x47')][_0xb97a('0x3b')]);_0x57bd07[_0xb97a('0x47')][_0xb97a('0x52')]=integrations[_0xb97a('0x53')](_0x57bd07['body'][_0xb97a('0x51')],_0x57bd07[_0xb97a('0x47')][_0xb97a('0x3b')]);return db[_0xb97a('0x4c')][_0xb97a('0x46')](_0x57bd07['body'],{'include':[{'model':db[_0xb97a('0x54')],'as':'Subjects'},{'model':db[_0xb97a('0x54')],'as':'Descriptions'}]});}return null;})[_0xb97a('0x3f')](respondWithResult(_0x5d3013,null))[_0xb97a('0x42')](handleError(_0x5d3013,null));};var md5=require(_0xb97a('0x55'));exports[_0xb97a('0x56')]=function(_0x545fb2,_0x13a1e2,_0x5b4413){var _0x367b22=null;var _0x29627d=null;var _0x22e60c=null;var _0x38591a=null;var _0x3e3222='';return db[_0xb97a('0x2a')]['findOne']({'where':{'id':_0x545fb2[_0xb97a('0x49')]['id']},'attributes':['id',_0xb97a('0x27'),_0xb97a('0x57'),_0xb97a('0x58'),_0xb97a('0x59'),_0xb97a('0x5a'),_0xb97a('0x5b'),_0xb97a('0x5c')]})[_0xb97a('0x3f')](handleEntityNotFound(_0x13a1e2,null))['then'](function(_0x4330b6){if(_0x4330b6){_0x367b22=_0x4330b6[_0xb97a('0x57')];_0x29627d=_0x4330b6[_0xb97a('0x5c')];_0x22e60c=_0x4330b6[_0xb97a('0x59')];_0x3e3222=_0x4330b6[_0xb97a('0x5a')];var _0x417a23=_0x3e3222['slice'](-0x1);if(_0x417a23==='/'){_0x3e3222=_0x3e3222[_0xb97a('0x5d')](0x0,_0x3e3222['lastIndexOf'](_0x417a23));}_0x38591a=util[_0xb97a('0x5e')](_0xb97a('0x5f'),_0x3e3222);var _0x4b67ef={'method':_0xb97a('0x60'),'uri':_0x38591a,'qs':{'operation':_0xb97a('0x61'),'username':_0x4330b6[_0xb97a('0x57')]},'json':!![]};return rp(_0x4b67ef);}})['then'](function(_0x47e232){if(_0x47e232[_0xb97a('0x62')]){var _0x59eb6e={'method':_0xb97a('0x63'),'uri':_0x38591a,'form':{'operation':_0xb97a('0x64'),'username':_0x367b22,'accessKey':md5(_0x47e232[_0xb97a('0x65')][_0xb97a('0x66')]+_0x29627d)},'json':!![]};return rp(_0x59eb6e);}})['then'](function(_0x257a36){if(_0x257a36['success']){var _0x1d6a83={'method':_0xb97a('0x60'),'uri':_0x38591a,'qs':{'operation':_0xb97a('0x67'),'username':_0x367b22,'sessionName':_0x257a36[_0xb97a('0x65')][_0xb97a('0x68')],'elementType':_0x22e60c},'json':!![]};return rp(_0x1d6a83);}})[_0xb97a('0x3f')](function(_0x484bab){if(_0x484bab['success']){var _0x3755a9=[_0xb97a('0x69'),_0xb97a('0x6a'),_0xb97a('0x6b')];_[_0xb97a('0x6c')](_0x484bab[_0xb97a('0x65')][_0xb97a('0x34')],function(_0x4aa12e){return _0x3755a9['includes'](_0x4aa12e[_0xb97a('0x3b')]['name']);});_[_0xb97a('0x6c')](_0x484bab[_0xb97a('0x65')][_0xb97a('0x34')],function(_0x551b60){return _0x551b60[_0xb97a('0x6d')]===_0xb97a('0x6e');});return{'count':_0x484bab['result']['fields'][_0xb97a('0x35')],'rows':_[_0xb97a('0x29')](_0x484bab[_0xb97a('0x65')]['fields'],function(_0x114308){return{'id':_0x114308[_0xb97a('0x27')],'name':_0x114308[_0xb97a('0x6f')],'custom':_['startsWith'](_0x114308[_0xb97a('0x27')],_0xb97a('0x70'))?!![]:![],'options':_0x114308['type']['name']===_0xb97a('0x71')&&_0x114308[_0xb97a('0x3b')][_0xb97a('0x72')]['length']>0x0?_['map'](_0x114308[_0xb97a('0x3b')][_0xb97a('0x72')],function(_0x21f695){return{'name':_0x21f695[_0xb97a('0x6f')],'value':_0x21f695[_0xb97a('0x73')]};}):[]};})};}})[_0xb97a('0x3f')](respondWithResult(_0x13a1e2,null))[_0xb97a('0x42')](function(_0xb3b841){console[_0xb97a('0x74')]('vTiger\x20error:\x20'+_0xb3b841);var _0x2b25dd=_0x545fb2[_0xb97a('0x2f')]['test']?0x1f4:_0xb3b841[_0xb97a('0x75')]||0x1f4;logger[_0xb97a('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2b25dd,JSON[_0xb97a('0x76')](_0xb3b841));delete _0xb3b841[_0xb97a('0x27')];if(_0x2b25dd===0x191){_0x2b25dd=0x190;}_0x13a1e2[_0xb97a('0x1c')](_0x2b25dd)[_0xb97a('0x28')](_0x545fb2[_0xb97a('0x2f')][_0xb97a('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0xb3b841[_0xb97a('0x75')]}:_0xb3b841);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 2035333..a3a0a20 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 _0x6396=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','lodash','util','moment'];(function(_0x286784,_0x2efc8a){var _0x259fb1=function(_0x34c83b){while(--_0x34c83b){_0x286784['push'](_0x286784['shift']());}};_0x259fb1(++_0x2efc8a);}(_0x6396,0x19f));var _0x6639=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x6396[_0x543242];return _0x4c99b6;};'use strict';var _=require(_0x6639('0x0'));var util=require(_0x6639('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6639('0x2'));var BPromise=require(_0x6639('0x3'));var rp=require(_0x6639('0x4'));var fs=require('fs');var path=require(_0x6639('0x5'));var rimraf=require(_0x6639('0x6'));var config=require(_0x6639('0x7'));var attributes=require(_0x6639('0x8'));var integrations=require(_0x6639('0x9'));module['exports']=function(_0x13ba21,_0x315d90){return _0x13ba21[_0x6639('0xa')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46d2=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x15f1f8,_0x15e5c8){var _0x53215d=function(_0x5bae68){while(--_0x5bae68){_0x15f1f8['push'](_0x15f1f8['shift']());}};_0x53215d(++_0x15e5c8);}(_0x46d2,0xbc));var _0x246d=function(_0x3b4886,_0x1fc2ce){_0x3b4886=_0x3b4886-0x0;var _0x3cc911=_0x46d2[_0x3b4886];return _0x3cc911;};'use strict';var _=require(_0x246d('0x0'));var util=require(_0x246d('0x1'));var logger=require(_0x246d('0x2'))(_0x246d('0x3'));var moment=require(_0x246d('0x4'));var BPromise=require('bluebird');var rp=require(_0x246d('0x5'));var fs=require('fs');var path=require(_0x246d('0x6'));var rimraf=require(_0x246d('0x7'));var config=require(_0x246d('0x8'));var attributes=require(_0x246d('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x246d('0xa')]=function(_0x5bac8b,_0x35f4d5){return _0x5bac8b['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 8cf431a..4e0aea4 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 _0x153f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x347b56,_0x35d65b){var _0x329340=function(_0x4e8fd1){while(--_0x4e8fd1){_0x347b56['push'](_0x347b56['shift']());}};_0x329340(++_0x35d65b);}(_0x153f,0x15b));var _0xf153=function(_0x3aed2a,_0x1d497c){_0x3aed2a=_0x3aed2a-0x0;var _0xa827b1=_0x153f[_0x3aed2a];return _0xa827b1;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')]({'raw':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1c')]||null:null,'attributes':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1d')]||null:null,'limit':_0x138dbe['options']?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1e')]||null:null,'include':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')]?_[_0xf153('0x20')](_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')],function(_0xf67cde){return{'model':db[_0xf67cde[_0xf153('0x21')]],'as':_0xf67cde['as'],'attributes':_0xf67cde[_0xf153('0x1d')],'include':_0xf67cde[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xf67cde[_0xf153('0x1f')],function(_0xe490f8){return{'model':db[_0xe490f8[_0xf153('0x21')]],'as':_0xe490f8['as'],'attributes':_0xe490f8[_0xf153('0x1d')],'include':_0xe490f8[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xe490f8[_0xf153('0x1f')],function(_0x48ebdc){return{'model':db[_0x48ebdc[_0xf153('0x21')]],'as':_0x48ebdc['as'],'attributes':_0x48ebdc[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cdcd){logger[_0xf153('0xe')]('GetVtigerAccount',_0x138dbe);logger[_0xf153('0x11')](_0xf153('0x17'),_0x138dbe,JSON[_0xf153('0x12')](_0x16cdcd));_0x4e790d(_0x16cdcd);})[_0xf153('0x22')](function(_0x339e96){logger[_0xf153('0x13')](_0xf153('0x17'),_0x339e96[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x339e96[_0xf153('0x15')]));});});};exports[_0xf153('0x23')]=function(_0x415a5f){var _0x5b5237=this;return new Promise(function(_0x258fb0,_0xbb3619){return db[_0xf153('0x18')][_0xf153('0x24')]({'raw':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1c')]||null:null,'attributes':_0x415a5f['options']?_0x415a5f[_0xf153('0x1a')]['attributes']||null:null,'include':_0x415a5f[_0xf153('0x1a')]?_0x415a5f[_0xf153('0x1a')]['include']?_[_0xf153('0x20')](_0x415a5f[_0xf153('0x1a')][_0xf153('0x1f')],function(_0x40be52){return{'model':db[_0x40be52[_0xf153('0x21')]],'as':_0x40be52['as'],'attributes':_0x40be52[_0xf153('0x1d')],'include':_0x40be52['include']?_[_0xf153('0x20')](_0x40be52['include'],function(_0x40834b){return{'model':db[_0x40834b[_0xf153('0x21')]],'as':_0x40834b['as'],'attributes':_0x40834b[_0xf153('0x1d')],'include':_0x40834b[_0xf153('0x1f')]?_[_0xf153('0x20')](_0x40834b[_0xf153('0x1f')],function(_0x4becf3){return{'model':db[_0x4becf3[_0xf153('0x21')]],'as':_0x4becf3['as'],'attributes':_0x4becf3[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf153('0xd')](function(_0x4e0634){logger[_0xf153('0xe')](_0xf153('0x23'),_0x415a5f);logger[_0xf153('0x11')](_0xf153('0x23'),_0x415a5f,JSON[_0xf153('0x12')](_0x4e0634));_0x258fb0(_0x4e0634);})[_0xf153('0x22')](function(_0x4cc481){logger[_0xf153('0x13')](_0xf153('0x23'),_0x4cc481['message'],_0x415a5f);_0xbb3619(_0x5b5237[_0xf153('0x13')](0x1f4,_0x4cc481[_0xf153('0x15')]));});});}; \ No newline at end of file +var _0x36ee=['message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowVtigerAccount','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x26804f,_0xa3ee2b){var _0x5cb1b4=function(_0x3df8cf){while(--_0x3df8cf){_0x26804f['push'](_0x26804f['shift']());}};_0x5cb1b4(++_0xa3ee2b);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')]({'raw':_0x2184ae['options']?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'limit':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')]['limit']||null:null,'include':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x2184ae[_0xe36e('0x1b')]['include'],function(_0x598a7a){return{'model':db[_0x598a7a[_0xe36e('0x21')]],'as':_0x598a7a['as'],'attributes':_0x598a7a[_0xe36e('0x1e')],'include':_0x598a7a[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x598a7a[_0xe36e('0x1f')],function(_0x1507f9){return{'model':db[_0x1507f9[_0xe36e('0x21')]],'as':_0x1507f9['as'],'attributes':_0x1507f9['attributes'],'include':_0x1507f9[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x1507f9[_0xe36e('0x1f')],function(_0x262caa){return{'model':db[_0x262caa['model']],'as':_0x262caa['as'],'attributes':_0x262caa[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7b02e){logger['info'](_0xe36e('0x18'),_0x2184ae);logger['debug'](_0xe36e('0x18'),_0x2184ae,JSON['stringify'](_0xf7b02e));_0x21d9a3(_0xf7b02e);})[_0xe36e('0x17')](function(_0x59548b){logger['error']('GetVtigerAccount',_0x59548b['message'],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0x59548b[_0xe36e('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4ac819){var _0x1fa1ec=this;return new Promise(function(_0xb8d44e,_0x259e19){return db[_0xe36e('0x19')][_0xe36e('0x22')]({'raw':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'include':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')],function(_0xf808f5){return{'model':db[_0xf808f5['model']],'as':_0xf808f5['as'],'attributes':_0xf808f5[_0xe36e('0x1e')],'include':_0xf808f5['include']?_['map'](_0xf808f5[_0xe36e('0x1f')],function(_0x4f620d){return{'model':db[_0x4f620d[_0xe36e('0x21')]],'as':_0x4f620d['as'],'attributes':_0x4f620d[_0xe36e('0x1e')],'include':_0x4f620d[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4f620d['include'],function(_0x56135c){return{'model':db[_0x56135c[_0xe36e('0x21')]],'as':_0x56135c['as'],'attributes':_0x56135c[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe36e('0xc')](function(_0x243338){logger['info'](_0xe36e('0x23'),_0x4ac819);logger[_0xe36e('0xe')](_0xe36e('0x23'),_0x4ac819,JSON['stringify'](_0x243338));_0xb8d44e(_0x243338);})[_0xe36e('0x17')](function(_0x2ff8f4){logger['error'](_0xe36e('0x23'),_0x2ff8f4[_0xe36e('0x14')],_0x4ac819);_0x259e19(_0x1fa1ec[_0xe36e('0x12')](0x1f4,_0x2ff8f4[_0xe36e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index b405ea3..fde85ea 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 _0xe018=['getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects'];(function(_0x27f4ea,_0x1a4b94){var _0x1800de=function(_0x1ab44d){while(--_0x1ab44d){_0x27f4ea['push'](_0x27f4ea['shift']());}};_0x1800de(++_0x1a4b94);}(_0xe018,0x68));var _0x8e01=function(_0x30d222,_0x5beb10){_0x30d222=_0x30d222-0x0;var _0x710cb5=_0xe018[_0x30d222];return _0x710cb5;};'use strict';var multer=require('multer');var util=require(_0x8e01('0x0'));var path=require(_0x8e01('0x1'));var timeout=require(_0x8e01('0x2'));var express=require(_0x8e01('0x3'));var router=express[_0x8e01('0x4')]();var fs_extra=require(_0x8e01('0x5'));var auth=require(_0x8e01('0x6'));var interaction=require(_0x8e01('0x7'));var config=require('../../config/environment');var controller=require(_0x8e01('0x8'));router[_0x8e01('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8e01('0xa'),auth[_0x8e01('0xb')](),controller[_0x8e01('0xc')]);router['get']('/:id/fields',auth[_0x8e01('0xb')](),controller[_0x8e01('0xd')]);router[_0x8e01('0x9')](_0x8e01('0xe'),auth[_0x8e01('0xb')](),controller[_0x8e01('0xf')]);router[_0x8e01('0x9')]('/:id/descriptions',auth[_0x8e01('0xb')](),controller[_0x8e01('0x10')]);router[_0x8e01('0x11')]('/',auth[_0x8e01('0xb')](),controller[_0x8e01('0x12')]);router[_0x8e01('0x13')](_0x8e01('0xa'),auth[_0x8e01('0xb')](),controller[_0x8e01('0x14')]);router[_0x8e01('0x15')](_0x8e01('0xa'),auth[_0x8e01('0xb')](),controller[_0x8e01('0x16')]);module[_0x8e01('0x17')]=router; \ No newline at end of file +var _0xb469=['put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xb469,0x102));var _0x9b46=function(_0x2a5649,_0x28c690){_0x2a5649=_0x2a5649-0x0;var _0x34d7ce=_0xb469[_0x2a5649];return _0x34d7ce;};'use strict';var multer=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require(_0x9b46('0x2'));var timeout=require(_0x9b46('0x3'));var express=require(_0x9b46('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9b46('0x5'));var interaction=require(_0x9b46('0x6'));var config=require(_0x9b46('0x7'));var controller=require(_0x9b46('0x8'));router['get']('/',auth[_0x9b46('0x9')](),controller[_0x9b46('0xa')]);router[_0x9b46('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x9b46('0xc'),auth[_0x9b46('0x9')](),controller['getFields']);router[_0x9b46('0xb')](_0x9b46('0xd'),auth[_0x9b46('0x9')](),controller[_0x9b46('0xe')]);router['get'](_0x9b46('0xf'),auth[_0x9b46('0x9')](),controller['getDescriptions']);router[_0x9b46('0x10')]('/',auth[_0x9b46('0x9')](),controller[_0x9b46('0x11')]);router[_0x9b46('0x12')]('/:id',auth[_0x9b46('0x9')](),controller[_0x9b46('0x13')]);router[_0x9b46('0x14')](_0x9b46('0x15'),auth[_0x9b46('0x9')](),controller['destroy']);module[_0x9b46('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a7295b3..eb7efa1 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 _0x0411=['STRING'];(function(_0x3b99e3,_0x54d531){var _0x403dda=function(_0x509efc){while(--_0x509efc){_0x3b99e3['push'](_0x3b99e3['shift']());}};_0x403dda(++_0x54d531);}(_0x0411,0x12d));var _0x1041=function(_0x319fc1,_0x29179b){_0x319fc1=_0x319fc1-0x0;var _0xb768af=_0x0411[_0x319fc1];return _0xb768af;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1041('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x94f4=['STRING','sequelize','exports'];(function(_0x9a0181,_0x3b2f42){var _0x1b52cb=function(_0x23a109){while(--_0x23a109){_0x9a0181['push'](_0x9a0181['shift']());}};_0x1b52cb(++_0x3b2f42);}(_0x94f4,0x17e));var _0x494f=function(_0x581ab8,_0x343064){_0x581ab8=_0x581ab8-0x0;var _0x39f0b5=_0x94f4[_0x581ab8];return _0x39f0b5;};'use strict';var Sequelize=require(_0x494f('0x0'));module[_0x494f('0x1')]={'name':{'type':Sequelize[_0x494f('0x2')]},'description':{'type':Sequelize[_0x494f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index aa0896a..77ae573 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 _0x480d=['sendStatus','status','offset','undefined','limit','count','json','save','update','then','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','VtigerField','length','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','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'];(function(_0x42fd61,_0x3cfd04){var _0x4f200a=function(_0x30b20b){while(--_0x30b20b){_0x42fd61['push'](_0x42fd61['shift']());}};_0x4f200a(++_0x3cfd04);}(_0x480d,0xd6));var _0xd480=function(_0x33b1f2,_0x4594dd){_0x33b1f2=_0x33b1f2-0x0;var _0x4577d2=_0x480d[_0x33b1f2];return _0x4577d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd480('0x0'));var zipdir=require(_0xd480('0x1'));var jsonpatch=require(_0xd480('0x2'));var rp=require(_0xd480('0x3'));var moment=require(_0xd480('0x4'));var BPromise=require(_0xd480('0x5'));var Mustache=require(_0xd480('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd480('0x7'));var csv=require('to-csv');var ejs=require(_0xd480('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd480('0x9'));var squel=require(_0xd480('0xa'));var crypto=require(_0xd480('0xb'));var jsforce=require(_0xd480('0xc'));var deskjs=require(_0xd480('0xd'));var toCsv=require(_0xd480('0xe'));var querystring=require(_0xd480('0xf'));var Papa=require(_0xd480('0x10'));var Redis=require(_0xd480('0x11'));var authService=require(_0xd480('0x12'));var qs=require(_0xd480('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd480('0x14'));var logger=require(_0xd480('0x15'))('api');var utils=require(_0xd480('0x16'));var config=require(_0xd480('0x17'));var licenseUtil=require(_0xd480('0x18'));var db=require(_0xd480('0x19'))['db'];function respondWithStatusCode(_0x1e8931,_0x3e0faa){_0x3e0faa=_0x3e0faa||0xcc;return function(_0x571d56){if(_0x571d56){return _0x1e8931[_0xd480('0x1a')](_0x3e0faa);}return _0x1e8931[_0xd480('0x1b')](_0x3e0faa)['end']();};}function respondWithResult(_0x23fa5a,_0x5712b6){_0x5712b6=_0x5712b6||0xc8;return function(_0x43831f){if(_0x43831f){return _0x23fa5a[_0xd480('0x1b')](_0x5712b6)['json'](_0x43831f);}};}function respondWithFilteredResult(_0x2969ae,_0x3d4623){return function(_0x4d326e){if(_0x4d326e){var _0x3afedc=typeof _0x3d4623[_0xd480('0x1c')]===_0xd480('0x1d')&&typeof _0x3d4623[_0xd480('0x1e')]===_0xd480('0x1d');var _0x2d7e20=_0x4d326e[_0xd480('0x1f')];var _0x54f057=_0x3afedc?0x0:_0x3d4623[_0xd480('0x1c')];var _0x1ba646=_0x3afedc?_0x4d326e[_0xd480('0x1f')]:_0x3d4623[_0xd480('0x1c')]+_0x3d4623['limit'];var _0xdb6ec2;if(_0x1ba646>=_0x2d7e20){_0x1ba646=_0x2d7e20;_0xdb6ec2=0xc8;}else{_0xdb6ec2=0xce;}_0x2969ae[_0xd480('0x1b')](_0xdb6ec2);return _0x2969ae['set']('Content-Range',_0x54f057+'-'+_0x1ba646+'/'+_0x2d7e20)[_0xd480('0x20')](_0x4d326e);}return null;};}function patchUpdates(_0x4ea7f7){return function(_0x5c6c18){try{jsonpatch['apply'](_0x5c6c18,_0x4ea7f7,!![]);}catch(_0x4d8b80){return BPromise['reject'](_0x4d8b80);}return _0x5c6c18[_0xd480('0x21')]();};}function saveUpdates(_0x4574d6,_0x2d57a1){return function(_0x3ff41a){if(_0x3ff41a){return _0x3ff41a[_0xd480('0x22')](_0x4574d6)[_0xd480('0x23')](function(_0x18ae37){return _0x18ae37;});}return null;};}function removeEntity(_0x113dfb,_0x2cfaa2){return function(_0x595dcf){if(_0x595dcf){return _0x595dcf['destroy']()[_0xd480('0x23')](function(){_0x113dfb[_0xd480('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a735d,_0x2a442a){return function(_0x2ede74){if(!_0x2ede74){_0x4a735d['sendStatus'](0x194);}return _0x2ede74;};}function handleError(_0x22d2b2,_0x2de5bf){_0x2de5bf=_0x2de5bf||0x1f4;return function(_0x2433b5){logger[_0xd480('0x24')](_0x2433b5[_0xd480('0x25')]);if(_0x2433b5[_0xd480('0x26')]){delete _0x2433b5['name'];}_0x22d2b2[_0xd480('0x1b')](_0x2de5bf)[_0xd480('0x27')](_0x2433b5);};}exports[_0xd480('0x28')]=function(_0x9eafe4,_0x3fca6c){var _0x5f11de={},_0x586b6c={},_0x554bbf={'count':0x0,'rows':[]};var _0x660017=_[_0xd480('0x29')](db[_0xd480('0x2a')]['rawAttributes'],function(_0x43c13f){return{'name':_0x43c13f[_0xd480('0x2b')],'type':_0x43c13f[_0xd480('0x2c')][_0xd480('0x2d')]};});_0x586b6c[_0xd480('0x2e')]=_['map'](_0x660017,_0xd480('0x26'));_0x586b6c[_0xd480('0x2f')]=_[_0xd480('0x30')](_0x9eafe4[_0xd480('0x2f')]);_0x586b6c['filters']=_['intersection'](_0x586b6c[_0xd480('0x2e')],_0x586b6c[_0xd480('0x2f')]);_0x5f11de[_0xd480('0x31')]=_[_0xd480('0x32')](_0x586b6c[_0xd480('0x2e')],qs[_0xd480('0x33')](_0x9eafe4['query'][_0xd480('0x33')]));_0x5f11de[_0xd480('0x31')]=_0x5f11de['attributes']['length']?_0x5f11de[_0xd480('0x31')]:_0x586b6c[_0xd480('0x2e')];if(!_0x9eafe4['query']['hasOwnProperty'](_0xd480('0x34'))){_0x5f11de[_0xd480('0x1e')]=qs[_0xd480('0x1e')](_0x9eafe4[_0xd480('0x2f')][_0xd480('0x1e')]);_0x5f11de[_0xd480('0x1c')]=qs[_0xd480('0x1c')](_0x9eafe4['query'][_0xd480('0x1c')]);}_0x5f11de[_0xd480('0x35')]=qs[_0xd480('0x36')](_0x9eafe4[_0xd480('0x2f')][_0xd480('0x36')]);_0x5f11de[_0xd480('0x37')]=qs[_0xd480('0x38')](_[_0xd480('0x39')](_0x9eafe4['query'],_0x586b6c[_0xd480('0x38')]),_0x660017);if(_0x9eafe4[_0xd480('0x2f')]['filter']){_0x5f11de[_0xd480('0x37')]=_[_0xd480('0x3a')](_0x5f11de[_0xd480('0x37')],{'$or':_[_0xd480('0x29')](_0x660017,function(_0x324f78){if(_0x324f78[_0xd480('0x2c')]!=='VIRTUAL'){var _0x17c878={};_0x17c878[_0x324f78[_0xd480('0x26')]]={'$like':'%'+_0x9eafe4[_0xd480('0x2f')][_0xd480('0x3b')]+'%'};return _0x17c878;}})});}_0x5f11de=_[_0xd480('0x3a')]({},_0x5f11de,_0x9eafe4[_0xd480('0x3c')]);var _0x2805a0={'where':_0x5f11de[_0xd480('0x37')]};return db[_0xd480('0x2a')]['count'](_0x2805a0)['then'](function(_0x50d81f){_0x554bbf[_0xd480('0x1f')]=_0x50d81f;if(_0x9eafe4['query'][_0xd480('0x3d')]){_0x5f11de[_0xd480('0x3e')]=[{'all':!![]}];}return db[_0xd480('0x2a')][_0xd480('0x3f')](_0x5f11de);})[_0xd480('0x23')](function(_0x2d3828){_0x554bbf[_0xd480('0x40')]=_0x2d3828;return _0x554bbf;})['then'](respondWithFilteredResult(_0x3fca6c,_0x5f11de))[_0xd480('0x41')](handleError(_0x3fca6c,null));};exports[_0xd480('0x42')]=function(_0x283a4a,_0x3a3e50){var _0x3879f4={'raw':![],'where':{'id':_0x283a4a[_0xd480('0x43')]['id']}},_0x1c8c25={};_0x1c8c25[_0xd480('0x2e')]=_[_0xd480('0x30')](db[_0xd480('0x2a')][_0xd480('0x44')]);_0x1c8c25['query']=_[_0xd480('0x30')](_0x283a4a[_0xd480('0x2f')]);_0x1c8c25[_0xd480('0x38')]=_['intersection'](_0x1c8c25['model'],_0x1c8c25[_0xd480('0x2f')]);_0x3879f4[_0xd480('0x31')]=_['intersection'](_0x1c8c25['model'],qs[_0xd480('0x33')](_0x283a4a[_0xd480('0x2f')][_0xd480('0x33')]));_0x3879f4['attributes']=_0x3879f4[_0xd480('0x31')]['length']?_0x3879f4[_0xd480('0x31')]:_0x1c8c25[_0xd480('0x2e')];if(_0x283a4a[_0xd480('0x2f')]['includeAll']){_0x3879f4[_0xd480('0x3e')]=[{'all':!![]}];}_0x3879f4=_[_0xd480('0x3a')]({},_0x3879f4,_0x283a4a[_0xd480('0x3c')]);return db['VtigerConfiguration'][_0xd480('0x45')](_0x3879f4)[_0xd480('0x23')](handleEntityNotFound(_0x3a3e50,null))[_0xd480('0x23')](respondWithResult(_0x3a3e50,null))[_0xd480('0x41')](handleError(_0x3a3e50,null));};exports[_0xd480('0x46')]=function(_0x2a5fd5,_0x551c39){return db[_0xd480('0x2a')]['create'](_0x2a5fd5[_0xd480('0x47')],{})[_0xd480('0x23')](respondWithResult(_0x551c39,0xc9))[_0xd480('0x41')](handleError(_0x551c39,null));};exports[_0xd480('0x22')]=function(_0x3034c0,_0x518385){if(_0x3034c0[_0xd480('0x47')]['id']){delete _0x3034c0[_0xd480('0x47')]['id'];}return db[_0xd480('0x2a')][_0xd480('0x45')]({'where':{'id':_0x3034c0['params']['id']}})['then'](handleEntityNotFound(_0x518385,null))['then'](saveUpdates(_0x3034c0['body'],null))[_0xd480('0x23')](respondWithResult(_0x518385,null))[_0xd480('0x41')](handleError(_0x518385,null));};exports[_0xd480('0x48')]=function(_0x493283,_0x5522a3){return db['VtigerConfiguration'][_0xd480('0x45')]({'where':{'id':_0x493283['params']['id']}})['then'](handleEntityNotFound(_0x5522a3,null))[_0xd480('0x23')](removeEntity(_0x5522a3,null))[_0xd480('0x41')](handleError(_0x5522a3,null));};exports[_0xd480('0x49')]=function(_0x211e18,_0x99c4f5,_0x8754d6){var _0x3a8818={};var _0x1d36b4={};var _0x4a2b85;var _0x2ed309;return db[_0xd480('0x2a')][_0xd480('0x4a')]({'where':{'id':_0x211e18[_0xd480('0x43')]['id']}})['then'](handleEntityNotFound(_0x99c4f5,null))[_0xd480('0x23')](function(_0xeea73c){if(_0xeea73c){_0x4a2b85=_0xeea73c;_0x1d36b4[_0xd480('0x2e')]=_[_0xd480('0x30')](db[_0xd480('0x4b')][_0xd480('0x44')]);_0x1d36b4[_0xd480('0x2f')]=_['keys'](_0x211e18['query']);_0x1d36b4[_0xd480('0x38')]=_[_0xd480('0x32')](_0x1d36b4[_0xd480('0x2e')],_0x1d36b4[_0xd480('0x2f')]);_0x3a8818[_0xd480('0x31')]=_[_0xd480('0x32')](_0x1d36b4[_0xd480('0x2e')],qs['fields'](_0x211e18[_0xd480('0x2f')][_0xd480('0x33')]));_0x3a8818[_0xd480('0x31')]=_0x3a8818[_0xd480('0x31')]['length']?_0x3a8818[_0xd480('0x31')]:_0x1d36b4[_0xd480('0x2e')];_0x3a8818[_0xd480('0x35')]=qs[_0xd480('0x36')](_0x211e18[_0xd480('0x2f')]['sort']);_0x3a8818['where']=qs[_0xd480('0x38')](_[_0xd480('0x39')](_0x211e18[_0xd480('0x2f')],_0x1d36b4[_0xd480('0x38')]));if(_0x211e18[_0xd480('0x2f')]['filter']){_0x3a8818[_0xd480('0x37')]=_[_0xd480('0x3a')](_0x3a8818[_0xd480('0x37')],{'$or':_['map'](_0x3a8818[_0xd480('0x31')],function(_0x5a191c){var _0x1c8cf2={};_0x1c8cf2[_0x5a191c]={'$like':'%'+_0x211e18[_0xd480('0x2f')][_0xd480('0x3b')]+'%'};return _0x1c8cf2;})});}_0x3a8818=_[_0xd480('0x3a')]({},_0x3a8818,_0x211e18['options']);return _0x4a2b85['getFields'](_0x3a8818);}})[_0xd480('0x23')](function(_0x1a4fb5){if(_0x1a4fb5){_0x2ed309=_0x1a4fb5[_0xd480('0x4c')];if(!_0x211e18['query'][_0xd480('0x4d')]('nolimit')){_0x3a8818['limit']=qs[_0xd480('0x1e')](_0x211e18[_0xd480('0x2f')][_0xd480('0x1e')]);_0x3a8818['offset']=qs[_0xd480('0x1c')](_0x211e18['query']['offset']);}return _0x4a2b85[_0xd480('0x49')](_0x3a8818);}})[_0xd480('0x23')](function(_0x3b4c95){if(_0x3b4c95){return _0x3b4c95?{'count':_0x2ed309,'rows':_0x3b4c95}:null;}})[_0xd480('0x23')](respondWithResult(_0x99c4f5,null))[_0xd480('0x41')](handleError(_0x99c4f5,null));};exports[_0xd480('0x4e')]=function(_0x1ddc80,_0x5aae83,_0x4f222a){var _0x6ee8cc={};var _0x4ddd5d={};var _0x3879df;var _0x208f86;return db[_0xd480('0x2a')]['findOne']({'where':{'id':_0x1ddc80[_0xd480('0x43')]['id']}})[_0xd480('0x23')](handleEntityNotFound(_0x5aae83,null))[_0xd480('0x23')](function(_0x5a4ec){if(_0x5a4ec){_0x3879df=_0x5a4ec;_0x4ddd5d[_0xd480('0x2e')]=_[_0xd480('0x30')](db['VtigerField'][_0xd480('0x44')]);_0x4ddd5d['query']=_[_0xd480('0x30')](_0x1ddc80[_0xd480('0x2f')]);_0x4ddd5d['filters']=_[_0xd480('0x32')](_0x4ddd5d[_0xd480('0x2e')],_0x4ddd5d[_0xd480('0x2f')]);_0x6ee8cc['attributes']=_[_0xd480('0x32')](_0x4ddd5d[_0xd480('0x2e')],qs[_0xd480('0x33')](_0x1ddc80[_0xd480('0x2f')][_0xd480('0x33')]));_0x6ee8cc['attributes']=_0x6ee8cc[_0xd480('0x31')][_0xd480('0x4c')]?_0x6ee8cc[_0xd480('0x31')]:_0x4ddd5d['model'];_0x6ee8cc[_0xd480('0x35')]=qs[_0xd480('0x36')](_0x1ddc80['query'][_0xd480('0x36')]);_0x6ee8cc[_0xd480('0x37')]=qs['filters'](_[_0xd480('0x39')](_0x1ddc80[_0xd480('0x2f')],_0x4ddd5d[_0xd480('0x38')]));if(_0x1ddc80[_0xd480('0x2f')][_0xd480('0x3b')]){_0x6ee8cc[_0xd480('0x37')]=_[_0xd480('0x3a')](_0x6ee8cc['where'],{'$or':_['map'](_0x6ee8cc['attributes'],function(_0x5758f2){var _0x42728c={};_0x42728c[_0x5758f2]={'$like':'%'+_0x1ddc80[_0xd480('0x2f')][_0xd480('0x3b')]+'%'};return _0x42728c;})});}_0x6ee8cc=_[_0xd480('0x3a')]({},_0x6ee8cc,_0x1ddc80[_0xd480('0x3c')]);return _0x3879df['getSubjects'](_0x6ee8cc);}})[_0xd480('0x23')](function(_0x20dc25){if(_0x20dc25){_0x208f86=_0x20dc25[_0xd480('0x4c')];if(!_0x1ddc80[_0xd480('0x2f')]['hasOwnProperty'](_0xd480('0x34'))){_0x6ee8cc['limit']=qs[_0xd480('0x1e')](_0x1ddc80[_0xd480('0x2f')][_0xd480('0x1e')]);_0x6ee8cc[_0xd480('0x1c')]=qs['offset'](_0x1ddc80['query']['offset']);}return _0x3879df[_0xd480('0x4e')](_0x6ee8cc);}})[_0xd480('0x23')](function(_0x55bbf9){if(_0x55bbf9){return _0x55bbf9?{'count':_0x208f86,'rows':_0x55bbf9}:null;}})['then'](respondWithResult(_0x5aae83,null))['catch'](handleError(_0x5aae83,null));};exports['getDescriptions']=function(_0x4ec9d9,_0x4ec0ff,_0x2d4677){var _0x5481a6={};var _0x50744e={};var _0xa206d7;var _0xabb325;return db[_0xd480('0x2a')][_0xd480('0x4a')]({'where':{'id':_0x4ec9d9['params']['id']}})['then'](handleEntityNotFound(_0x4ec0ff,null))[_0xd480('0x23')](function(_0x20d6d1){if(_0x20d6d1){_0xa206d7=_0x20d6d1;_0x50744e[_0xd480('0x2e')]=_['keys'](db[_0xd480('0x4b')]['rawAttributes']);_0x50744e[_0xd480('0x2f')]=_[_0xd480('0x30')](_0x4ec9d9['query']);_0x50744e['filters']=_[_0xd480('0x32')](_0x50744e['model'],_0x50744e['query']);_0x5481a6['attributes']=_['intersection'](_0x50744e[_0xd480('0x2e')],qs[_0xd480('0x33')](_0x4ec9d9[_0xd480('0x2f')]['fields']));_0x5481a6[_0xd480('0x31')]=_0x5481a6[_0xd480('0x31')][_0xd480('0x4c')]?_0x5481a6[_0xd480('0x31')]:_0x50744e[_0xd480('0x2e')];_0x5481a6['order']=qs['sort'](_0x4ec9d9[_0xd480('0x2f')][_0xd480('0x36')]);_0x5481a6[_0xd480('0x37')]=qs[_0xd480('0x38')](_[_0xd480('0x39')](_0x4ec9d9['query'],_0x50744e[_0xd480('0x38')]));if(_0x4ec9d9[_0xd480('0x2f')][_0xd480('0x3b')]){_0x5481a6[_0xd480('0x37')]=_[_0xd480('0x3a')](_0x5481a6[_0xd480('0x37')],{'$or':_[_0xd480('0x29')](_0x5481a6[_0xd480('0x31')],function(_0x3f6f12){var _0x189627={};_0x189627[_0x3f6f12]={'$like':'%'+_0x4ec9d9[_0xd480('0x2f')][_0xd480('0x3b')]+'%'};return _0x189627;})});}_0x5481a6=_['merge']({},_0x5481a6,_0x4ec9d9['options']);return _0xa206d7[_0xd480('0x4f')](_0x5481a6);}})[_0xd480('0x23')](function(_0x176f31){if(_0x176f31){_0xabb325=_0x176f31[_0xd480('0x4c')];if(!_0x4ec9d9[_0xd480('0x2f')][_0xd480('0x4d')]('nolimit')){_0x5481a6[_0xd480('0x1e')]=qs[_0xd480('0x1e')](_0x4ec9d9[_0xd480('0x2f')]['limit']);_0x5481a6[_0xd480('0x1c')]=qs[_0xd480('0x1c')](_0x4ec9d9[_0xd480('0x2f')][_0xd480('0x1c')]);}return _0xa206d7[_0xd480('0x4f')](_0x5481a6);}})['then'](function(_0x11ce7e){if(_0x11ce7e){return _0x11ce7e?{'count':_0xabb325,'rows':_0x11ce7e}:null;}})[_0xd480('0x23')](respondWithResult(_0x4ec0ff,null))[_0xd480('0x41')](handleError(_0x4ec0ff,null));}; \ No newline at end of file +var _0xece2=['count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','body','update','getFields','findOne','VtigerField','length','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xece2,0x1cd));var _0x2ece=function(_0x10f936,_0x229008){_0x10f936=_0x10f936-0x0;var _0x3f3d19=_0xece2[_0x10f936];return _0x3f3d19;};'use strict';var emlformat=require(_0x2ece('0x0'));var rimraf=require(_0x2ece('0x1'));var zipdir=require(_0x2ece('0x2'));var jsonpatch=require(_0x2ece('0x3'));var rp=require('request-promise');var moment=require(_0x2ece('0x4'));var BPromise=require(_0x2ece('0x5'));var Mustache=require(_0x2ece('0x6'));var util=require(_0x2ece('0x7'));var path=require(_0x2ece('0x8'));var sox=require(_0x2ece('0x9'));var csv=require('to-csv');var ejs=require(_0x2ece('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ece('0xb'));var squel=require(_0x2ece('0xc'));var crypto=require(_0x2ece('0xd'));var jsforce=require(_0x2ece('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2ece('0xf'));var querystring=require(_0x2ece('0x10'));var Papa=require(_0x2ece('0x11'));var Redis=require('ioredis');var authService=require(_0x2ece('0x12'));var qs=require(_0x2ece('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ece('0x14'));var logger=require(_0x2ece('0x15'))(_0x2ece('0x16'));var utils=require(_0x2ece('0x17'));var config=require(_0x2ece('0x18'));var licenseUtil=require(_0x2ece('0x19'));var db=require(_0x2ece('0x1a'))['db'];function respondWithStatusCode(_0x367209,_0x5add8f){_0x5add8f=_0x5add8f||0xcc;return function(_0xf0eefa){if(_0xf0eefa){return _0x367209[_0x2ece('0x1b')](_0x5add8f);}return _0x367209['status'](_0x5add8f)['end']();};}function respondWithResult(_0x30d37,_0x1933fa){_0x1933fa=_0x1933fa||0xc8;return function(_0x3e6503){if(_0x3e6503){return _0x30d37[_0x2ece('0x1c')](_0x1933fa)[_0x2ece('0x1d')](_0x3e6503);}};}function respondWithFilteredResult(_0x41a397,_0x216e85){return function(_0x18e2a3){if(_0x18e2a3){var _0x5d48e9=typeof _0x216e85['offset']===_0x2ece('0x1e')&&typeof _0x216e85['limit']==='undefined';var _0x251b87=_0x18e2a3[_0x2ece('0x1f')];var _0x4626c5=_0x5d48e9?0x0:_0x216e85['offset'];var _0x1aa82d=_0x5d48e9?_0x18e2a3[_0x2ece('0x1f')]:_0x216e85[_0x2ece('0x20')]+_0x216e85[_0x2ece('0x21')];var _0x3679e;if(_0x1aa82d>=_0x251b87){_0x1aa82d=_0x251b87;_0x3679e=0xc8;}else{_0x3679e=0xce;}_0x41a397[_0x2ece('0x1c')](_0x3679e);return _0x41a397[_0x2ece('0x22')](_0x2ece('0x23'),_0x4626c5+'-'+_0x1aa82d+'/'+_0x251b87)['json'](_0x18e2a3);}return null;};}function patchUpdates(_0x37b900){return function(_0x2ee8e5){try{jsonpatch[_0x2ece('0x24')](_0x2ee8e5,_0x37b900,!![]);}catch(_0x31b0dc){return BPromise[_0x2ece('0x25')](_0x31b0dc);}return _0x2ee8e5['save']();};}function saveUpdates(_0x373145,_0x2f6946){return function(_0x3e9825){if(_0x3e9825){return _0x3e9825['update'](_0x373145)[_0x2ece('0x26')](function(_0x415263){return _0x415263;});}return null;};}function removeEntity(_0x5b5934,_0x4b93cb){return function(_0x416cda){if(_0x416cda){return _0x416cda[_0x2ece('0x27')]()['then'](function(){_0x5b5934[_0x2ece('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590b3f,_0x651fa9){return function(_0x54573d){if(!_0x54573d){_0x590b3f['sendStatus'](0x194);}return _0x54573d;};}function handleError(_0x340e39,_0x4eb5cd){_0x4eb5cd=_0x4eb5cd||0x1f4;return function(_0x367c0e){logger[_0x2ece('0x28')](_0x367c0e['stack']);if(_0x367c0e[_0x2ece('0x29')]){delete _0x367c0e[_0x2ece('0x29')];}_0x340e39['status'](_0x4eb5cd)[_0x2ece('0x2a')](_0x367c0e);};}exports[_0x2ece('0x2b')]=function(_0xb8f737,_0x1085ce){var _0x243cb3={},_0x256bb3={},_0x48ee97={'count':0x0,'rows':[]};var _0x1e8a12=_[_0x2ece('0x2c')](db[_0x2ece('0x2d')][_0x2ece('0x2e')],function(_0x92d64b){return{'name':_0x92d64b[_0x2ece('0x2f')],'type':_0x92d64b[_0x2ece('0x30')]['key']};});_0x256bb3[_0x2ece('0x31')]=_[_0x2ece('0x2c')](_0x1e8a12,_0x2ece('0x29'));_0x256bb3[_0x2ece('0x32')]=_[_0x2ece('0x33')](_0xb8f737[_0x2ece('0x32')]);_0x256bb3[_0x2ece('0x34')]=_[_0x2ece('0x35')](_0x256bb3[_0x2ece('0x31')],_0x256bb3[_0x2ece('0x32')]);_0x243cb3['attributes']=_[_0x2ece('0x35')](_0x256bb3[_0x2ece('0x31')],qs[_0x2ece('0x36')](_0xb8f737[_0x2ece('0x32')][_0x2ece('0x36')]));_0x243cb3[_0x2ece('0x37')]=_0x243cb3[_0x2ece('0x37')]['length']?_0x243cb3[_0x2ece('0x37')]:_0x256bb3[_0x2ece('0x31')];if(!_0xb8f737[_0x2ece('0x32')][_0x2ece('0x38')](_0x2ece('0x39'))){_0x243cb3[_0x2ece('0x21')]=qs[_0x2ece('0x21')](_0xb8f737[_0x2ece('0x32')][_0x2ece('0x21')]);_0x243cb3['offset']=qs[_0x2ece('0x20')](_0xb8f737[_0x2ece('0x32')][_0x2ece('0x20')]);}_0x243cb3[_0x2ece('0x3a')]=qs[_0x2ece('0x3b')](_0xb8f737[_0x2ece('0x32')][_0x2ece('0x3b')]);_0x243cb3[_0x2ece('0x3c')]=qs[_0x2ece('0x34')](_[_0x2ece('0x3d')](_0xb8f737[_0x2ece('0x32')],_0x256bb3[_0x2ece('0x34')]),_0x1e8a12);if(_0xb8f737['query'][_0x2ece('0x3e')]){_0x243cb3[_0x2ece('0x3c')]=_['merge'](_0x243cb3[_0x2ece('0x3c')],{'$or':_[_0x2ece('0x2c')](_0x1e8a12,function(_0xff13e9){if(_0xff13e9['type']!==_0x2ece('0x3f')){var _0x1ff463={};_0x1ff463[_0xff13e9[_0x2ece('0x29')]]={'$like':'%'+_0xb8f737['query'][_0x2ece('0x3e')]+'%'};return _0x1ff463;}})});}_0x243cb3=_['merge']({},_0x243cb3,_0xb8f737[_0x2ece('0x40')]);var _0x148da5={'where':_0x243cb3[_0x2ece('0x3c')]};return db[_0x2ece('0x2d')][_0x2ece('0x1f')](_0x148da5)[_0x2ece('0x26')](function(_0x1f8957){_0x48ee97[_0x2ece('0x1f')]=_0x1f8957;if(_0xb8f737[_0x2ece('0x32')][_0x2ece('0x41')]){_0x243cb3['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x2ece('0x42')](_0x243cb3);})[_0x2ece('0x26')](function(_0x265218){_0x48ee97[_0x2ece('0x43')]=_0x265218;return _0x48ee97;})[_0x2ece('0x26')](respondWithFilteredResult(_0x1085ce,_0x243cb3))[_0x2ece('0x44')](handleError(_0x1085ce,null));};exports[_0x2ece('0x45')]=function(_0x2575e0,_0xb8047f){var _0x167ef5={'raw':![],'where':{'id':_0x2575e0[_0x2ece('0x46')]['id']}},_0x114ea2={};_0x114ea2[_0x2ece('0x31')]=_[_0x2ece('0x33')](db[_0x2ece('0x2d')][_0x2ece('0x2e')]);_0x114ea2[_0x2ece('0x32')]=_['keys'](_0x2575e0['query']);_0x114ea2[_0x2ece('0x34')]=_[_0x2ece('0x35')](_0x114ea2[_0x2ece('0x31')],_0x114ea2[_0x2ece('0x32')]);_0x167ef5[_0x2ece('0x37')]=_[_0x2ece('0x35')](_0x114ea2['model'],qs['fields'](_0x2575e0[_0x2ece('0x32')][_0x2ece('0x36')]));_0x167ef5[_0x2ece('0x37')]=_0x167ef5[_0x2ece('0x37')]['length']?_0x167ef5[_0x2ece('0x37')]:_0x114ea2[_0x2ece('0x31')];if(_0x2575e0[_0x2ece('0x32')]['includeAll']){_0x167ef5[_0x2ece('0x47')]=[{'all':!![]}];}_0x167ef5=_[_0x2ece('0x48')]({},_0x167ef5,_0x2575e0[_0x2ece('0x40')]);return db[_0x2ece('0x2d')][_0x2ece('0x49')](_0x167ef5)[_0x2ece('0x26')](handleEntityNotFound(_0xb8047f,null))[_0x2ece('0x26')](respondWithResult(_0xb8047f,null))['catch'](handleError(_0xb8047f,null));};exports['create']=function(_0x574ada,_0x588af5){return db['VtigerConfiguration']['create'](_0x574ada[_0x2ece('0x4a')],{})[_0x2ece('0x26')](respondWithResult(_0x588af5,0xc9))[_0x2ece('0x44')](handleError(_0x588af5,null));};exports[_0x2ece('0x4b')]=function(_0x2d3dd2,_0x4bad17){if(_0x2d3dd2[_0x2ece('0x4a')]['id']){delete _0x2d3dd2[_0x2ece('0x4a')]['id'];}return db['VtigerConfiguration'][_0x2ece('0x49')]({'where':{'id':_0x2d3dd2['params']['id']}})[_0x2ece('0x26')](handleEntityNotFound(_0x4bad17,null))[_0x2ece('0x26')](saveUpdates(_0x2d3dd2[_0x2ece('0x4a')],null))[_0x2ece('0x26')](respondWithResult(_0x4bad17,null))[_0x2ece('0x44')](handleError(_0x4bad17,null));};exports[_0x2ece('0x27')]=function(_0x313972,_0x24ecc0){return db[_0x2ece('0x2d')]['find']({'where':{'id':_0x313972['params']['id']}})[_0x2ece('0x26')](handleEntityNotFound(_0x24ecc0,null))[_0x2ece('0x26')](removeEntity(_0x24ecc0,null))['catch'](handleError(_0x24ecc0,null));};exports[_0x2ece('0x4c')]=function(_0x929cff,_0x333533,_0x42c229){var _0x796da7={};var _0x2ac85a={};var _0x3563ca;var _0x1dbf70;return db[_0x2ece('0x2d')][_0x2ece('0x4d')]({'where':{'id':_0x929cff['params']['id']}})[_0x2ece('0x26')](handleEntityNotFound(_0x333533,null))[_0x2ece('0x26')](function(_0x9fa1e1){if(_0x9fa1e1){_0x3563ca=_0x9fa1e1;_0x2ac85a['model']=_[_0x2ece('0x33')](db[_0x2ece('0x4e')]['rawAttributes']);_0x2ac85a[_0x2ece('0x32')]=_['keys'](_0x929cff['query']);_0x2ac85a[_0x2ece('0x34')]=_['intersection'](_0x2ac85a[_0x2ece('0x31')],_0x2ac85a['query']);_0x796da7['attributes']=_[_0x2ece('0x35')](_0x2ac85a['model'],qs[_0x2ece('0x36')](_0x929cff['query'][_0x2ece('0x36')]));_0x796da7[_0x2ece('0x37')]=_0x796da7['attributes'][_0x2ece('0x4f')]?_0x796da7[_0x2ece('0x37')]:_0x2ac85a[_0x2ece('0x31')];_0x796da7[_0x2ece('0x3a')]=qs[_0x2ece('0x3b')](_0x929cff[_0x2ece('0x32')][_0x2ece('0x3b')]);_0x796da7[_0x2ece('0x3c')]=qs[_0x2ece('0x34')](_[_0x2ece('0x3d')](_0x929cff[_0x2ece('0x32')],_0x2ac85a[_0x2ece('0x34')]));if(_0x929cff['query'][_0x2ece('0x3e')]){_0x796da7['where']=_[_0x2ece('0x48')](_0x796da7[_0x2ece('0x3c')],{'$or':_[_0x2ece('0x2c')](_0x796da7[_0x2ece('0x37')],function(_0x7b7eab){var _0xa3867={};_0xa3867[_0x7b7eab]={'$like':'%'+_0x929cff[_0x2ece('0x32')]['filter']+'%'};return _0xa3867;})});}_0x796da7=_[_0x2ece('0x48')]({},_0x796da7,_0x929cff[_0x2ece('0x40')]);return _0x3563ca[_0x2ece('0x4c')](_0x796da7);}})[_0x2ece('0x26')](function(_0x2ef27c){if(_0x2ef27c){_0x1dbf70=_0x2ef27c[_0x2ece('0x4f')];if(!_0x929cff[_0x2ece('0x32')][_0x2ece('0x38')](_0x2ece('0x39'))){_0x796da7[_0x2ece('0x21')]=qs[_0x2ece('0x21')](_0x929cff[_0x2ece('0x32')]['limit']);_0x796da7[_0x2ece('0x20')]=qs[_0x2ece('0x20')](_0x929cff[_0x2ece('0x32')][_0x2ece('0x20')]);}return _0x3563ca['getFields'](_0x796da7);}})[_0x2ece('0x26')](function(_0xf944d4){if(_0xf944d4){return _0xf944d4?{'count':_0x1dbf70,'rows':_0xf944d4}:null;}})['then'](respondWithResult(_0x333533,null))[_0x2ece('0x44')](handleError(_0x333533,null));};exports['getSubjects']=function(_0x2b5fae,_0x17a0e3,_0x1a8115){var _0x1dfc5b={};var _0x4bd298={};var _0x379118;var _0x5518bb;return db[_0x2ece('0x2d')][_0x2ece('0x4d')]({'where':{'id':_0x2b5fae['params']['id']}})[_0x2ece('0x26')](handleEntityNotFound(_0x17a0e3,null))['then'](function(_0x502e4b){if(_0x502e4b){_0x379118=_0x502e4b;_0x4bd298['model']=_[_0x2ece('0x33')](db[_0x2ece('0x4e')][_0x2ece('0x2e')]);_0x4bd298[_0x2ece('0x32')]=_[_0x2ece('0x33')](_0x2b5fae[_0x2ece('0x32')]);_0x4bd298[_0x2ece('0x34')]=_['intersection'](_0x4bd298['model'],_0x4bd298[_0x2ece('0x32')]);_0x1dfc5b[_0x2ece('0x37')]=_[_0x2ece('0x35')](_0x4bd298[_0x2ece('0x31')],qs[_0x2ece('0x36')](_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x36')]));_0x1dfc5b[_0x2ece('0x37')]=_0x1dfc5b[_0x2ece('0x37')]['length']?_0x1dfc5b[_0x2ece('0x37')]:_0x4bd298[_0x2ece('0x31')];_0x1dfc5b[_0x2ece('0x3a')]=qs[_0x2ece('0x3b')](_0x2b5fae[_0x2ece('0x32')]['sort']);_0x1dfc5b['where']=qs[_0x2ece('0x34')](_['pick'](_0x2b5fae[_0x2ece('0x32')],_0x4bd298['filters']));if(_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x3e')]){_0x1dfc5b['where']=_[_0x2ece('0x48')](_0x1dfc5b[_0x2ece('0x3c')],{'$or':_[_0x2ece('0x2c')](_0x1dfc5b[_0x2ece('0x37')],function(_0x3da85e){var _0x9aafe={};_0x9aafe[_0x3da85e]={'$like':'%'+_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x3e')]+'%'};return _0x9aafe;})});}_0x1dfc5b=_[_0x2ece('0x48')]({},_0x1dfc5b,_0x2b5fae[_0x2ece('0x40')]);return _0x379118['getSubjects'](_0x1dfc5b);}})[_0x2ece('0x26')](function(_0x18d8d4){if(_0x18d8d4){_0x5518bb=_0x18d8d4[_0x2ece('0x4f')];if(!_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x38')](_0x2ece('0x39'))){_0x1dfc5b['limit']=qs['limit'](_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x21')]);_0x1dfc5b[_0x2ece('0x20')]=qs[_0x2ece('0x20')](_0x2b5fae[_0x2ece('0x32')][_0x2ece('0x20')]);}return _0x379118[_0x2ece('0x50')](_0x1dfc5b);}})[_0x2ece('0x26')](function(_0x2255f4){if(_0x2255f4){return _0x2255f4?{'count':_0x5518bb,'rows':_0x2255f4}:null;}})[_0x2ece('0x26')](respondWithResult(_0x17a0e3,null))[_0x2ece('0x44')](handleError(_0x17a0e3,null));};exports[_0x2ece('0x51')]=function(_0x291f77,_0x310f67,_0x1e6397){var _0x1d1292={};var _0x28bb15={};var _0x1315f8;var _0x10b538;return db['VtigerConfiguration'][_0x2ece('0x4d')]({'where':{'id':_0x291f77[_0x2ece('0x46')]['id']}})['then'](handleEntityNotFound(_0x310f67,null))['then'](function(_0x409293){if(_0x409293){_0x1315f8=_0x409293;_0x28bb15['model']=_[_0x2ece('0x33')](db[_0x2ece('0x4e')][_0x2ece('0x2e')]);_0x28bb15[_0x2ece('0x32')]=_[_0x2ece('0x33')](_0x291f77[_0x2ece('0x32')]);_0x28bb15['filters']=_['intersection'](_0x28bb15[_0x2ece('0x31')],_0x28bb15[_0x2ece('0x32')]);_0x1d1292[_0x2ece('0x37')]=_[_0x2ece('0x35')](_0x28bb15['model'],qs['fields'](_0x291f77[_0x2ece('0x32')][_0x2ece('0x36')]));_0x1d1292['attributes']=_0x1d1292[_0x2ece('0x37')][_0x2ece('0x4f')]?_0x1d1292[_0x2ece('0x37')]:_0x28bb15[_0x2ece('0x31')];_0x1d1292[_0x2ece('0x3a')]=qs['sort'](_0x291f77[_0x2ece('0x32')]['sort']);_0x1d1292[_0x2ece('0x3c')]=qs[_0x2ece('0x34')](_[_0x2ece('0x3d')](_0x291f77['query'],_0x28bb15[_0x2ece('0x34')]));if(_0x291f77[_0x2ece('0x32')][_0x2ece('0x3e')]){_0x1d1292['where']=_['merge'](_0x1d1292[_0x2ece('0x3c')],{'$or':_['map'](_0x1d1292[_0x2ece('0x37')],function(_0x9d8c){var _0x4f66dd={};_0x4f66dd[_0x9d8c]={'$like':'%'+_0x291f77[_0x2ece('0x32')]['filter']+'%'};return _0x4f66dd;})});}_0x1d1292=_['merge']({},_0x1d1292,_0x291f77[_0x2ece('0x40')]);return _0x1315f8[_0x2ece('0x51')](_0x1d1292);}})[_0x2ece('0x26')](function(_0x4db924){if(_0x4db924){_0x10b538=_0x4db924['length'];if(!_0x291f77['query'][_0x2ece('0x38')](_0x2ece('0x39'))){_0x1d1292[_0x2ece('0x21')]=qs[_0x2ece('0x21')](_0x291f77[_0x2ece('0x32')][_0x2ece('0x21')]);_0x1d1292[_0x2ece('0x20')]=qs[_0x2ece('0x20')](_0x291f77[_0x2ece('0x32')][_0x2ece('0x20')]);}return _0x1315f8['getDescriptions'](_0x1d1292);}})[_0x2ece('0x26')](function(_0x4d31ea){if(_0x4d31ea){return _0x4d31ea?{'count':_0x10b538,'rows':_0x4d31ea}:null;}})[_0x2ece('0x26')](respondWithResult(_0x310f67,null))['catch'](handleError(_0x310f67,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index f473b6c..1981714 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 _0xb5b9=['../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1891df,_0x13f014){var _0x4547d6=function(_0x2b222e){while(--_0x2b222e){_0x1891df['push'](_0x1891df['shift']());}};_0x4547d6(++_0x13f014);}(_0xb5b9,0xfe));var _0x9b5b=function(_0x341f9f,_0x4366fb){_0x341f9f=_0x341f9f-0x0;var _0x5dc66e=_0xb5b9[_0x341f9f];return _0x5dc66e;};'use strict';var _=require(_0x9b5b('0x0'));var util=require(_0x9b5b('0x1'));var logger=require(_0x9b5b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b5b('0x3'));var rp=require(_0x9b5b('0x4'));var fs=require('fs');var path=require(_0x9b5b('0x5'));var rimraf=require('rimraf');var config=require(_0x9b5b('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x59f3f5,_0x6c706){return _0x59f3f5[_0x9b5b('0x7')](_0x9b5b('0x8'),attributes,{'tableName':_0x9b5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4384=['VtigerConfiguration','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3ceaea,_0x3f8b94){var _0x4b5315=function(_0x260a47){while(--_0x260a47){_0x3ceaea['push'](_0x3ceaea['shift']());}};_0x4b5315(++_0x3f8b94);}(_0x4384,0x106));var _0x4438=function(_0x6ee4ff,_0x4ff62e){_0x6ee4ff=_0x6ee4ff-0x0;var _0x1b187b=_0x4384[_0x6ee4ff];return _0x1b187b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4438('0x0'));var moment=require(_0x4438('0x1'));var BPromise=require(_0x4438('0x2'));var rp=require(_0x4438('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4438('0x4'));var config=require(_0x4438('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x4438('0x6')]=function(_0x96a234,_0x2822e5){return _0x96a234[_0x4438('0x7')](_0x4438('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 d60190f..2b45626 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 _0x563e=['result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x563e,0x128));var _0xe563=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x563e[_0x1ce236];return _0x241819;};'use strict';var _=require(_0xe563('0x0'));var util=require(_0xe563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe563('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe563('0x3'))['db'];var utils=require(_0xe563('0x4'));var logger=require(_0xe563('0x5'))('rpc');var config=require(_0xe563('0x6'));var jayson=require(_0xe563('0x7'));var client=jayson[_0xe563('0x8')][_0xe563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174c20,_0xeb16c0,_0x24ebb3){return new BPromise(function(_0xa9efb5,_0x133581){return client[_0xe563('0xa')](_0x174c20,_0x24ebb3)[_0xe563('0xb')](function(_0xc98953){logger[_0xe563('0xc')](_0xe563('0xd'),_0xeb16c0,_0xe563('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xeb16c0,_0xe563('0xe'),JSON[_0xe563('0xf')](_0xc98953));if(_0xc98953['error']){if(_0xc98953[_0xe563('0x10')][_0xe563('0x11')]===0x1f4){logger[_0xe563('0x10')](_0xe563('0xd'),_0xeb16c0,_0xc98953[_0xe563('0x10')][_0xe563('0x12')]);return _0x133581(_0xc98953[_0xe563('0x10')][_0xe563('0x12')]);}logger['error'](_0xe563('0xd'),_0xeb16c0,_0xc98953[_0xe563('0x10')][_0xe563('0x12')]);return _0xa9efb5(_0xc98953[_0xe563('0x10')][_0xe563('0x12')]);}else{logger[_0xe563('0xc')](_0xe563('0xd'),_0xeb16c0,_0xe563('0xe'));_0xa9efb5(_0xc98953[_0xe563('0x13')]['message']);}})[_0xe563('0x14')](function(_0x8cac90){logger[_0xe563('0x10')](_0xe563('0xd'),_0xeb16c0,_0x8cac90);_0x133581(_0x8cac90);});});} \ No newline at end of file +var _0x65cb=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x65cb,0x134));var _0xb65c=function(_0xa56044,_0x74ccb8){_0xa56044=_0xa56044-0x0;var _0x4ad79a=_0x65cb[_0xa56044];return _0x4ad79a;};'use strict';var _=require(_0xb65c('0x0'));var util=require(_0xb65c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb65c('0x2'));var fs=require('fs');var Redis=require(_0xb65c('0x3'));var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require(_0xb65c('0x9'));var client=jayson[_0xb65c('0xa')][_0xb65c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33a6d2,_0x3677d6,_0x508cd8){return new BPromise(function(_0x2d20b5,_0x1846b3){return client[_0xb65c('0xc')](_0x33a6d2,_0x508cd8)[_0xb65c('0xd')](function(_0x3b2915){logger[_0xb65c('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x3677d6,_0xb65c('0xf'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3677d6,_0xb65c('0xf'),JSON[_0xb65c('0x10')](_0x3b2915));if(_0x3b2915[_0xb65c('0x11')]){if(_0x3b2915[_0xb65c('0x11')][_0xb65c('0x12')]===0x1f4){logger[_0xb65c('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x3677d6,_0x3b2915[_0xb65c('0x11')]['message']);return _0x1846b3(_0x3b2915[_0xb65c('0x11')]['message']);}logger[_0xb65c('0x11')](_0xb65c('0x13'),_0x3677d6,_0x3b2915[_0xb65c('0x11')][_0xb65c('0x14')]);return _0x2d20b5(_0x3b2915[_0xb65c('0x11')]['message']);}else{logger[_0xb65c('0xe')](_0xb65c('0x13'),_0x3677d6,'request\x20sent');_0x2d20b5(_0x3b2915['result']['message']);}})[_0xb65c('0x15')](function(_0x463aca){logger[_0xb65c('0x11')](_0xb65c('0x13'),_0x3677d6,_0x463aca);_0x1846b3(_0x463aca);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 9b70060..2d332f9 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 _0xc374=['./intVtigerField.controller','index','get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2a2593,_0x27f202){var _0x50bfb7=function(_0x565088){while(--_0x565088){_0x2a2593['push'](_0x2a2593['shift']());}};_0x50bfb7(++_0x27f202);}(_0xc374,0x187));var _0x4c37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc374[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4c37('0x0'));var util=require(_0x4c37('0x1'));var path=require(_0x4c37('0x2'));var timeout=require(_0x4c37('0x3'));var express=require(_0x4c37('0x4'));var router=express[_0x4c37('0x5')]();var fs_extra=require(_0x4c37('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4c37('0x7'));var config=require(_0x4c37('0x8'));var controller=require(_0x4c37('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c37('0xa')]);router[_0x4c37('0xb')](_0x4c37('0xc'),auth[_0x4c37('0xd')](),controller['show']);router[_0x4c37('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c37('0xf')](_0x4c37('0xc'),auth[_0x4c37('0xd')](),controller[_0x4c37('0x10')]);router[_0x4c37('0x11')](_0x4c37('0xc'),auth[_0x4c37('0xd')](),controller[_0x4c37('0x12')]);module[_0x4c37('0x13')]=router; \ No newline at end of file +var _0x8737=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer','util'];(function(_0x12cd0e,_0x4a09bb){var _0x1898f8=function(_0x2578b4){while(--_0x2578b4){_0x12cd0e['push'](_0x12cd0e['shift']());}};_0x1898f8(++_0x4a09bb);}(_0x8737,0x1eb));var _0x7873=function(_0x6759cc,_0x2601b6){_0x6759cc=_0x6759cc-0x0;var _0x142e1=_0x8737[_0x6759cc];return _0x142e1;};'use strict';var multer=require(_0x7873('0x0'));var util=require(_0x7873('0x1'));var path=require(_0x7873('0x2'));var timeout=require(_0x7873('0x3'));var express=require('express');var router=express[_0x7873('0x4')]();var fs_extra=require(_0x7873('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7873('0x6'));var config=require(_0x7873('0x7'));var controller=require(_0x7873('0x8'));router[_0x7873('0x9')]('/',auth[_0x7873('0xa')](),controller['index']);router[_0x7873('0x9')](_0x7873('0xb'),auth['isAuthenticated'](),controller[_0x7873('0xc')]);router[_0x7873('0xd')]('/',auth[_0x7873('0xa')](),controller[_0x7873('0xe')]);router[_0x7873('0xf')](_0x7873('0xb'),auth[_0x7873('0xa')](),controller['update']);router[_0x7873('0x10')](_0x7873('0xb'),auth[_0x7873('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index de00762..e8f50c7 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 _0x9737=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','exports'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x9737,0x7f));var _0x7973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9737[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7973('0x0')]={'type':{'type':Sequelize[_0x7973('0x1')](_0x7973('0x2'),_0x7973('0x3'),_0x7973('0x4'),'keyValue',_0x7973('0x5')),'defaultValue':_0x7973('0x2')},'content':{'type':Sequelize[_0x7973('0x6')]},'key':{'type':Sequelize[_0x7973('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x7973('0x2'),'variable',_0x7973('0x4'))},'keyContent':{'type':Sequelize[_0x7973('0x6')]},'idField':{'type':Sequelize[_0x7973('0x6')]},'nameField':{'type':Sequelize[_0x7973('0x6')]},'customField':{'type':Sequelize[_0x7973('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7973('0x6')]}}; \ No newline at end of file +var _0x67d6=['exports','string','variable','picklist','STRING','ENUM','sequelize'];(function(_0x53fc45,_0x4cad40){var _0x4899ec=function(_0x26f843){while(--_0x26f843){_0x53fc45['push'](_0x53fc45['shift']());}};_0x4899ec(++_0x4cad40);}(_0x67d6,0x195));var _0x667d=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x67d6[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x667d('0x0'));module[_0x667d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x667d('0x2'),_0x667d('0x3'),'customVariable','keyValue',_0x667d('0x4')),'defaultValue':_0x667d('0x2')},'content':{'type':Sequelize[_0x667d('0x5')]},'key':{'type':Sequelize[_0x667d('0x5')]},'keyType':{'type':Sequelize[_0x667d('0x6')](_0x667d('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x667d('0x5')]},'idField':{'type':Sequelize[_0x667d('0x5')]},'nameField':{'type':Sequelize[_0x667d('0x5')]},'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 4889e78..5a290a9 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 _0xa003=['filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3f7e6b,_0x2009ca){var _0x5e406e=function(_0x37c227){while(--_0x37c227){_0x3f7e6b['push'](_0x3f7e6b['shift']());}};_0x5e406e(++_0x2009ca);}(_0xa003,0x13b));var _0x3a00=function(_0x43e407,_0x3aece6){_0x43e407=_0x43e407-0x0;var _0x2b0c92=_0xa003[_0x43e407];return _0x2b0c92;};'use strict';var emlformat=require(_0x3a00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a00('0x1'));var jsonpatch=require(_0x3a00('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a00('0x3'));var Mustache=require(_0x3a00('0x4'));var util=require(_0x3a00('0x5'));var path=require(_0x3a00('0x6'));var sox=require(_0x3a00('0x7'));var csv=require('to-csv');var ejs=require(_0x3a00('0x8'));var fs=require('fs');var fs_extra=require(_0x3a00('0x9'));var _=require(_0x3a00('0xa'));var squel=require(_0x3a00('0xb'));var crypto=require(_0x3a00('0xc'));var jsforce=require(_0x3a00('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a00('0xe'));var querystring=require(_0x3a00('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a00('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a00('0x11'));var hardwareService=require(_0x3a00('0x12'));var logger=require(_0x3a00('0x13'))(_0x3a00('0x14'));var utils=require('../../config/utils');var config=require(_0x3a00('0x15'));var licenseUtil=require(_0x3a00('0x16'));var db=require(_0x3a00('0x17'))['db'];function respondWithStatusCode(_0x551661,_0x4abb1b){_0x4abb1b=_0x4abb1b||0xcc;return function(_0x3da9ad){if(_0x3da9ad){return _0x551661[_0x3a00('0x18')](_0x4abb1b);}return _0x551661['status'](_0x4abb1b)[_0x3a00('0x19')]();};}function respondWithResult(_0x178290,_0x68b180){_0x68b180=_0x68b180||0xc8;return function(_0x2b610b){if(_0x2b610b){return _0x178290[_0x3a00('0x1a')](_0x68b180)[_0x3a00('0x1b')](_0x2b610b);}};}function respondWithFilteredResult(_0x32ab40,_0x42ddf3){return function(_0xbcac86){if(_0xbcac86){var _0x478854=typeof _0x42ddf3[_0x3a00('0x1c')]==='undefined'&&typeof _0x42ddf3[_0x3a00('0x1d')]==='undefined';var _0x29c854=_0xbcac86[_0x3a00('0x1e')];var _0x31d080=_0x478854?0x0:_0x42ddf3['offset'];var _0x41ef2e=_0x478854?_0xbcac86['count']:_0x42ddf3[_0x3a00('0x1c')]+_0x42ddf3[_0x3a00('0x1d')];var _0x3997af;if(_0x41ef2e>=_0x29c854){_0x41ef2e=_0x29c854;_0x3997af=0xc8;}else{_0x3997af=0xce;}_0x32ab40['status'](_0x3997af);return _0x32ab40['set'](_0x3a00('0x1f'),_0x31d080+'-'+_0x41ef2e+'/'+_0x29c854)[_0x3a00('0x1b')](_0xbcac86);}return null;};}function patchUpdates(_0x1ef57b){return function(_0x5e95bf){try{jsonpatch[_0x3a00('0x20')](_0x5e95bf,_0x1ef57b,!![]);}catch(_0x324d31){return BPromise['reject'](_0x324d31);}return _0x5e95bf[_0x3a00('0x21')]();};}function saveUpdates(_0x155686,_0x1296ed){return function(_0x11352f){if(_0x11352f){return _0x11352f[_0x3a00('0x22')](_0x155686)[_0x3a00('0x23')](function(_0x2cac92){return _0x2cac92;});}return null;};}function removeEntity(_0x55a1de,_0xbc6121){return function(_0x9dfdc2){if(_0x9dfdc2){return _0x9dfdc2[_0x3a00('0x24')]()[_0x3a00('0x23')](function(){_0x55a1de[_0x3a00('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162f22,_0x5d805c){return function(_0x30f158){if(!_0x30f158){_0x162f22[_0x3a00('0x18')](0x194);}return _0x30f158;};}function handleError(_0x25a350,_0x53be8d){_0x53be8d=_0x53be8d||0x1f4;return function(_0x1d33d4){logger[_0x3a00('0x25')](_0x1d33d4[_0x3a00('0x26')]);if(_0x1d33d4[_0x3a00('0x27')]){delete _0x1d33d4['name'];}_0x25a350[_0x3a00('0x1a')](_0x53be8d)[_0x3a00('0x28')](_0x1d33d4);};}exports[_0x3a00('0x29')]=function(_0x4cd1c7,_0x11b0db){var _0x5effe8={},_0x180015={},_0x2e8c7d={'count':0x0,'rows':[]};var _0x427618=_['map'](db[_0x3a00('0x2a')][_0x3a00('0x2b')],function(_0x19f033){return{'name':_0x19f033[_0x3a00('0x2c')],'type':_0x19f033['type'][_0x3a00('0x2d')]};});_0x180015[_0x3a00('0x2e')]=_[_0x3a00('0x2f')](_0x427618,_0x3a00('0x27'));_0x180015[_0x3a00('0x30')]=_[_0x3a00('0x31')](_0x4cd1c7[_0x3a00('0x30')]);_0x180015[_0x3a00('0x32')]=_[_0x3a00('0x33')](_0x180015[_0x3a00('0x2e')],_0x180015[_0x3a00('0x30')]);_0x5effe8['attributes']=_[_0x3a00('0x33')](_0x180015[_0x3a00('0x2e')],qs[_0x3a00('0x34')](_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x34')]));_0x5effe8['attributes']=_0x5effe8[_0x3a00('0x35')]['length']?_0x5effe8[_0x3a00('0x35')]:_0x180015['model'];if(!_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x36')](_0x3a00('0x37'))){_0x5effe8[_0x3a00('0x1d')]=qs[_0x3a00('0x1d')](_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x1d')]);_0x5effe8[_0x3a00('0x1c')]=qs[_0x3a00('0x1c')](_0x4cd1c7['query'][_0x3a00('0x1c')]);}_0x5effe8[_0x3a00('0x38')]=qs['sort'](_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x39')]);_0x5effe8[_0x3a00('0x3a')]=qs[_0x3a00('0x32')](_[_0x3a00('0x3b')](_0x4cd1c7[_0x3a00('0x30')],_0x180015[_0x3a00('0x32')]),_0x427618);if(_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x3c')]){_0x5effe8[_0x3a00('0x3a')]=_[_0x3a00('0x3d')](_0x5effe8[_0x3a00('0x3a')],{'$or':_[_0x3a00('0x2f')](_0x427618,function(_0x29b2ae){if(_0x29b2ae[_0x3a00('0x3e')]!==_0x3a00('0x3f')){var _0x11abf0={};_0x11abf0[_0x29b2ae['name']]={'$like':'%'+_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x3c')]+'%'};return _0x11abf0;}})});}_0x5effe8=_[_0x3a00('0x3d')]({},_0x5effe8,_0x4cd1c7['options']);var _0x9b0599={'where':_0x5effe8['where']};return db[_0x3a00('0x2a')][_0x3a00('0x1e')](_0x9b0599)[_0x3a00('0x23')](function(_0x28b6c9){_0x2e8c7d[_0x3a00('0x1e')]=_0x28b6c9;if(_0x4cd1c7[_0x3a00('0x30')][_0x3a00('0x40')]){_0x5effe8[_0x3a00('0x41')]=[{'all':!![]}];}return db[_0x3a00('0x2a')][_0x3a00('0x42')](_0x5effe8);})[_0x3a00('0x23')](function(_0x130029){_0x2e8c7d[_0x3a00('0x43')]=_0x130029;return _0x2e8c7d;})[_0x3a00('0x23')](respondWithFilteredResult(_0x11b0db,_0x5effe8))[_0x3a00('0x44')](handleError(_0x11b0db,null));};exports['show']=function(_0x1a8b31,_0x314c3c){var _0x4c16b9={'raw':!![],'where':{'id':_0x1a8b31['params']['id']}},_0x431f07={};_0x431f07[_0x3a00('0x2e')]=_[_0x3a00('0x31')](db[_0x3a00('0x2a')][_0x3a00('0x2b')]);_0x431f07[_0x3a00('0x30')]=_[_0x3a00('0x31')](_0x1a8b31['query']);_0x431f07['filters']=_[_0x3a00('0x33')](_0x431f07[_0x3a00('0x2e')],_0x431f07[_0x3a00('0x30')]);_0x4c16b9[_0x3a00('0x35')]=_[_0x3a00('0x33')](_0x431f07[_0x3a00('0x2e')],qs[_0x3a00('0x34')](_0x1a8b31[_0x3a00('0x30')]['fields']));_0x4c16b9[_0x3a00('0x35')]=_0x4c16b9[_0x3a00('0x35')][_0x3a00('0x45')]?_0x4c16b9[_0x3a00('0x35')]:_0x431f07['model'];if(_0x1a8b31[_0x3a00('0x30')][_0x3a00('0x40')]){_0x4c16b9[_0x3a00('0x41')]=[{'all':!![]}];}_0x4c16b9=_['merge']({},_0x4c16b9,_0x1a8b31[_0x3a00('0x46')]);return db[_0x3a00('0x2a')][_0x3a00('0x47')](_0x4c16b9)['then'](handleEntityNotFound(_0x314c3c,null))[_0x3a00('0x23')](respondWithResult(_0x314c3c,null))[_0x3a00('0x44')](handleError(_0x314c3c,null));};exports[_0x3a00('0x48')]=function(_0x6a75fe,_0x2d5a86){return db[_0x3a00('0x2a')][_0x3a00('0x48')](_0x6a75fe[_0x3a00('0x49')],{})['then'](respondWithResult(_0x2d5a86,0xc9))[_0x3a00('0x44')](handleError(_0x2d5a86,null));};exports['update']=function(_0x2a27fd,_0x1fc458){if(_0x2a27fd['body']['id']){delete _0x2a27fd[_0x3a00('0x49')]['id'];}return db[_0x3a00('0x2a')][_0x3a00('0x47')]({'where':{'id':_0x2a27fd[_0x3a00('0x4a')]['id']}})[_0x3a00('0x23')](handleEntityNotFound(_0x1fc458,null))[_0x3a00('0x23')](saveUpdates(_0x2a27fd['body'],null))[_0x3a00('0x23')](respondWithResult(_0x1fc458,null))['catch'](handleError(_0x1fc458,null));};exports['destroy']=function(_0x46e6e1,_0x5aa84c){return db[_0x3a00('0x2a')]['find']({'where':{'id':_0x46e6e1[_0x3a00('0x4a')]['id']}})[_0x3a00('0x23')](handleEntityNotFound(_0x5aa84c,null))[_0x3a00('0x23')](removeEntity(_0x5aa84c,null))[_0x3a00('0x44')](handleError(_0x5aa84c,null));}; \ No newline at end of file +var _0xe4b1=['path','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','eml-format','zip-dir','request-promise','mustache','util'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xe4b1,0xff));var _0x1e4b=function(_0xcf7d1e,_0x1b00ad){_0xcf7d1e=_0xcf7d1e-0x0;var _0x42b2cb=_0xe4b1[_0xcf7d1e];return _0x42b2cb;};'use strict';var emlformat=require(_0x1e4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e4b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e4b('0x3'));var util=require(_0x1e4b('0x4'));var path=require(_0x1e4b('0x5'));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(_0x1e4b('0x6'));var squel=require('squel');var crypto=require(_0x1e4b('0x7'));var jsforce=require(_0x1e4b('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x1e4b('0x9'));var querystring=require(_0x1e4b('0xa'));var Papa=require(_0x1e4b('0xb'));var Redis=require('ioredis');var authService=require(_0x1e4b('0xc'));var qs=require(_0x1e4b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e4b('0xe'));var logger=require('../../config/logger')(_0x1e4b('0xf'));var utils=require(_0x1e4b('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1e4b('0x11'))['db'];function respondWithStatusCode(_0x3b1ad4,_0x29ad6d){_0x29ad6d=_0x29ad6d||0xcc;return function(_0x5f0e5e){if(_0x5f0e5e){return _0x3b1ad4[_0x1e4b('0x12')](_0x29ad6d);}return _0x3b1ad4[_0x1e4b('0x13')](_0x29ad6d)[_0x1e4b('0x14')]();};}function respondWithResult(_0xc87be9,_0x3e4e47){_0x3e4e47=_0x3e4e47||0xc8;return function(_0x4bdc2b){if(_0x4bdc2b){return _0xc87be9[_0x1e4b('0x13')](_0x3e4e47)[_0x1e4b('0x15')](_0x4bdc2b);}};}function respondWithFilteredResult(_0x4f1d23,_0x3d0eb8){return function(_0xbb5ae8){if(_0xbb5ae8){var _0x4069ad=typeof _0x3d0eb8[_0x1e4b('0x16')]===_0x1e4b('0x17')&&typeof _0x3d0eb8[_0x1e4b('0x18')]===_0x1e4b('0x17');var _0x5ad8d1=_0xbb5ae8[_0x1e4b('0x19')];var _0x39d428=_0x4069ad?0x0:_0x3d0eb8[_0x1e4b('0x16')];var _0x160aae=_0x4069ad?_0xbb5ae8[_0x1e4b('0x19')]:_0x3d0eb8[_0x1e4b('0x16')]+_0x3d0eb8[_0x1e4b('0x18')];var _0x3b8f82;if(_0x160aae>=_0x5ad8d1){_0x160aae=_0x5ad8d1;_0x3b8f82=0xc8;}else{_0x3b8f82=0xce;}_0x4f1d23['status'](_0x3b8f82);return _0x4f1d23[_0x1e4b('0x1a')](_0x1e4b('0x1b'),_0x39d428+'-'+_0x160aae+'/'+_0x5ad8d1)[_0x1e4b('0x15')](_0xbb5ae8);}return null;};}function patchUpdates(_0x42fb33){return function(_0x11f281){try{jsonpatch[_0x1e4b('0x1c')](_0x11f281,_0x42fb33,!![]);}catch(_0x17154d){return BPromise['reject'](_0x17154d);}return _0x11f281['save']();};}function saveUpdates(_0x55d257,_0x3be131){return function(_0x532b3f){if(_0x532b3f){return _0x532b3f['update'](_0x55d257)[_0x1e4b('0x1d')](function(_0x10305a){return _0x10305a;});}return null;};}function removeEntity(_0x459b72,_0x1ea85a){return function(_0x3a65ae){if(_0x3a65ae){return _0x3a65ae[_0x1e4b('0x1e')]()[_0x1e4b('0x1d')](function(){_0x459b72[_0x1e4b('0x13')](0xcc)[_0x1e4b('0x14')]();});}};}function handleEntityNotFound(_0x3d3347,_0x2b1c75){return function(_0x4e5676){if(!_0x4e5676){_0x3d3347['sendStatus'](0x194);}return _0x4e5676;};}function handleError(_0x18828e,_0x3849e8){_0x3849e8=_0x3849e8||0x1f4;return function(_0x48dd69){logger['error'](_0x48dd69[_0x1e4b('0x1f')]);if(_0x48dd69[_0x1e4b('0x20')]){delete _0x48dd69[_0x1e4b('0x20')];}_0x18828e[_0x1e4b('0x13')](_0x3849e8)[_0x1e4b('0x21')](_0x48dd69);};}exports[_0x1e4b('0x22')]=function(_0x11e4bc,_0x357726){var _0x1a4d06={},_0x41e4d6={},_0x2a0749={'count':0x0,'rows':[]};var _0xc36fa4=_[_0x1e4b('0x23')](db[_0x1e4b('0x24')][_0x1e4b('0x25')],function(_0x1b6c90){return{'name':_0x1b6c90['fieldName'],'type':_0x1b6c90[_0x1e4b('0x26')]['key']};});_0x41e4d6[_0x1e4b('0x27')]=_[_0x1e4b('0x23')](_0xc36fa4,_0x1e4b('0x20'));_0x41e4d6[_0x1e4b('0x28')]=_[_0x1e4b('0x29')](_0x11e4bc[_0x1e4b('0x28')]);_0x41e4d6[_0x1e4b('0x2a')]=_[_0x1e4b('0x2b')](_0x41e4d6[_0x1e4b('0x27')],_0x41e4d6[_0x1e4b('0x28')]);_0x1a4d06[_0x1e4b('0x2c')]=_['intersection'](_0x41e4d6[_0x1e4b('0x27')],qs[_0x1e4b('0x2d')](_0x11e4bc[_0x1e4b('0x28')][_0x1e4b('0x2d')]));_0x1a4d06[_0x1e4b('0x2c')]=_0x1a4d06[_0x1e4b('0x2c')][_0x1e4b('0x2e')]?_0x1a4d06[_0x1e4b('0x2c')]:_0x41e4d6['model'];if(!_0x11e4bc[_0x1e4b('0x28')][_0x1e4b('0x2f')](_0x1e4b('0x30'))){_0x1a4d06[_0x1e4b('0x18')]=qs['limit'](_0x11e4bc[_0x1e4b('0x28')][_0x1e4b('0x18')]);_0x1a4d06[_0x1e4b('0x16')]=qs[_0x1e4b('0x16')](_0x11e4bc['query'][_0x1e4b('0x16')]);}_0x1a4d06[_0x1e4b('0x31')]=qs[_0x1e4b('0x32')](_0x11e4bc[_0x1e4b('0x28')]['sort']);_0x1a4d06['where']=qs[_0x1e4b('0x2a')](_[_0x1e4b('0x33')](_0x11e4bc[_0x1e4b('0x28')],_0x41e4d6[_0x1e4b('0x2a')]),_0xc36fa4);if(_0x11e4bc[_0x1e4b('0x28')][_0x1e4b('0x34')]){_0x1a4d06[_0x1e4b('0x35')]=_[_0x1e4b('0x36')](_0x1a4d06[_0x1e4b('0x35')],{'$or':_['map'](_0xc36fa4,function(_0x4e604b){if(_0x4e604b[_0x1e4b('0x26')]!==_0x1e4b('0x37')){var _0x40fcad={};_0x40fcad[_0x4e604b[_0x1e4b('0x20')]]={'$like':'%'+_0x11e4bc['query'][_0x1e4b('0x34')]+'%'};return _0x40fcad;}})});}_0x1a4d06=_[_0x1e4b('0x36')]({},_0x1a4d06,_0x11e4bc[_0x1e4b('0x38')]);var _0x51ef49={'where':_0x1a4d06[_0x1e4b('0x35')]};return db[_0x1e4b('0x24')][_0x1e4b('0x19')](_0x51ef49)[_0x1e4b('0x1d')](function(_0x4adc2f){_0x2a0749[_0x1e4b('0x19')]=_0x4adc2f;if(_0x11e4bc[_0x1e4b('0x28')][_0x1e4b('0x39')]){_0x1a4d06[_0x1e4b('0x3a')]=[{'all':!![]}];}return db[_0x1e4b('0x24')][_0x1e4b('0x3b')](_0x1a4d06);})[_0x1e4b('0x1d')](function(_0x333c53){_0x2a0749['rows']=_0x333c53;return _0x2a0749;})[_0x1e4b('0x1d')](respondWithFilteredResult(_0x357726,_0x1a4d06))[_0x1e4b('0x3c')](handleError(_0x357726,null));};exports[_0x1e4b('0x3d')]=function(_0x594663,_0x4d74ff){var _0x45da59={'raw':!![],'where':{'id':_0x594663[_0x1e4b('0x3e')]['id']}},_0x1df298={};_0x1df298[_0x1e4b('0x27')]=_['keys'](db[_0x1e4b('0x24')][_0x1e4b('0x25')]);_0x1df298[_0x1e4b('0x28')]=_[_0x1e4b('0x29')](_0x594663[_0x1e4b('0x28')]);_0x1df298[_0x1e4b('0x2a')]=_['intersection'](_0x1df298[_0x1e4b('0x27')],_0x1df298[_0x1e4b('0x28')]);_0x45da59['attributes']=_['intersection'](_0x1df298[_0x1e4b('0x27')],qs[_0x1e4b('0x2d')](_0x594663['query'][_0x1e4b('0x2d')]));_0x45da59[_0x1e4b('0x2c')]=_0x45da59[_0x1e4b('0x2c')][_0x1e4b('0x2e')]?_0x45da59[_0x1e4b('0x2c')]:_0x1df298[_0x1e4b('0x27')];if(_0x594663[_0x1e4b('0x28')][_0x1e4b('0x39')]){_0x45da59[_0x1e4b('0x3a')]=[{'all':!![]}];}_0x45da59=_[_0x1e4b('0x36')]({},_0x45da59,_0x594663[_0x1e4b('0x38')]);return db[_0x1e4b('0x24')][_0x1e4b('0x3f')](_0x45da59)[_0x1e4b('0x1d')](handleEntityNotFound(_0x4d74ff,null))['then'](respondWithResult(_0x4d74ff,null))[_0x1e4b('0x3c')](handleError(_0x4d74ff,null));};exports['create']=function(_0x2f70df,_0x7fecbe){return db[_0x1e4b('0x24')]['create'](_0x2f70df[_0x1e4b('0x40')],{})[_0x1e4b('0x1d')](respondWithResult(_0x7fecbe,0xc9))[_0x1e4b('0x3c')](handleError(_0x7fecbe,null));};exports['update']=function(_0x2a494d,_0x2f5814){if(_0x2a494d[_0x1e4b('0x40')]['id']){delete _0x2a494d[_0x1e4b('0x40')]['id'];}return db[_0x1e4b('0x24')]['find']({'where':{'id':_0x2a494d[_0x1e4b('0x3e')]['id']}})[_0x1e4b('0x1d')](handleEntityNotFound(_0x2f5814,null))[_0x1e4b('0x1d')](saveUpdates(_0x2a494d[_0x1e4b('0x40')],null))[_0x1e4b('0x1d')](respondWithResult(_0x2f5814,null))['catch'](handleError(_0x2f5814,null));};exports[_0x1e4b('0x1e')]=function(_0x1d184f,_0x15cf1b){return db[_0x1e4b('0x24')][_0x1e4b('0x3f')]({'where':{'id':_0x1d184f[_0x1e4b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x15cf1b,null))[_0x1e4b('0x1d')](removeEntity(_0x15cf1b,null))[_0x1e4b('0x3c')](handleError(_0x15cf1b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 43c89c9..c9bb940 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 _0x4675=['FieldId','lodash','../../config/logger','moment','path','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4675,0x1d5));var _0x5467=function(_0x135841,_0xf71043){_0x135841=_0x135841-0x0;var _0x805254=_0x4675[_0x135841];return _0x805254;};'use strict';var _=require(_0x5467('0x0'));var util=require('util');var logger=require(_0x5467('0x1'))('api');var moment=require(_0x5467('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5467('0x3'));var rimraf=require('rimraf');var config=require(_0x5467('0x4'));var attributes=require(_0x5467('0x5'));module['exports']=function(_0x8231fd,_0x42a1d4){return _0x8231fd[_0x5467('0x6')](_0x5467('0x7'),attributes,{'tableName':_0x5467('0x8'),'paranoid':![],'indexes':[{'name':_0x5467('0x9'),'fields':[_0x5467('0xa'),_0x5467('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4aa5=['FieldId','lodash','util','moment','bluebird','request-promise','path','./intVtigerField.attributes','exports','vtiger_unique_index','idField'];(function(_0x57163b,_0x41db5f){var _0x13c1ea=function(_0x8a7f7){while(--_0x8a7f7){_0x57163b['push'](_0x57163b['shift']());}};_0x13c1ea(++_0x41db5f);}(_0x4aa5,0x135));var _0x54aa=function(_0x46d45b,_0x166ff0){_0x46d45b=_0x46d45b-0x0;var _0x1e8ac3=_0x4aa5[_0x46d45b];return _0x1e8ac3;};'use strict';var _=require(_0x54aa('0x0'));var util=require(_0x54aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x54aa('0x2'));var BPromise=require(_0x54aa('0x3'));var rp=require(_0x54aa('0x4'));var fs=require('fs');var path=require(_0x54aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x54aa('0x6'));module[_0x54aa('0x7')]=function(_0x263885,_0x3e7b72){return _0x263885['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x54aa('0x8'),'fields':[_0x54aa('0x9'),_0x54aa('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index e237787..d88bab6 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 _0x056e=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c280f,_0x17a685){var _0x2f68e1=function(_0x186c04){while(--_0x186c04){_0x5c280f['push'](_0x5c280f['shift']());}};_0x2f68e1(++_0x17a685);}(_0x056e,0x94));var _0xe056=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x056e[_0x967959];return _0x5c4489;};'use strict';var _=require(_0xe056('0x0'));var util=require('util');var moment=require(_0xe056('0x1'));var BPromise=require(_0xe056('0x2'));var rs=require(_0xe056('0x3'));var fs=require('fs');var Redis=require(_0xe056('0x4'));var db=require(_0xe056('0x5'))['db'];var utils=require(_0xe056('0x6'));var logger=require('../../config/logger')(_0xe056('0x7'));var config=require(_0xe056('0x8'));var jayson=require(_0xe056('0x9'));var client=jayson['client'][_0xe056('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcddc0b,_0x384d65,_0x11d9c3){return new BPromise(function(_0x30dcd8,_0x4b4484){return client[_0xe056('0xb')](_0xcddc0b,_0x11d9c3)[_0xe056('0xc')](function(_0x2dcb01){logger[_0xe056('0xd')](_0xe056('0xe'),_0x384d65,_0xe056('0xf'));logger[_0xe056('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x384d65,_0xe056('0xf'),JSON[_0xe056('0x11')](_0x2dcb01));if(_0x2dcb01[_0xe056('0x12')]){if(_0x2dcb01[_0xe056('0x12')][_0xe056('0x13')]===0x1f4){logger[_0xe056('0x12')](_0xe056('0xe'),_0x384d65,_0x2dcb01[_0xe056('0x12')]['message']);return _0x4b4484(_0x2dcb01[_0xe056('0x12')][_0xe056('0x14')]);}logger[_0xe056('0x12')]('VtigerField,\x20%s,\x20%s',_0x384d65,_0x2dcb01['error'][_0xe056('0x14')]);return _0x30dcd8(_0x2dcb01[_0xe056('0x12')]['message']);}else{logger['info'](_0xe056('0xe'),_0x384d65,_0xe056('0xf'));_0x30dcd8(_0x2dcb01[_0xe056('0x15')][_0xe056('0x14')]);}})['catch'](function(_0x35eaaa){logger[_0xe056('0x12')](_0xe056('0xe'),_0x384d65,_0x35eaaa);_0x4b4484(_0x35eaaa);});});} \ No newline at end of file +var _0xb885=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info'];(function(_0x52f6bf,_0x56402f){var _0x53e96a=function(_0x9261e4){while(--_0x9261e4){_0x52f6bf['push'](_0x52f6bf['shift']());}};_0x53e96a(++_0x56402f);}(_0xb885,0x7a));var _0x5b88=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xb885[_0xf34109];return _0x570bfc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b88('0x0'));var BPromise=require(_0x5b88('0x1'));var rs=require(_0x5b88('0x2'));var fs=require('fs');var Redis=require(_0x5b88('0x3'));var db=require(_0x5b88('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5b88('0x5'));var config=require(_0x5b88('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5b88('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52b8bc,_0x243fb3,_0x53b56d){return new BPromise(function(_0x29eb7a,_0x18c3d4){return client[_0x5b88('0x8')](_0x52b8bc,_0x53b56d)[_0x5b88('0x9')](function(_0x4fe92b){logger[_0x5b88('0xa')](_0x5b88('0xb'),_0x243fb3,_0x5b88('0xc'));logger[_0x5b88('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x243fb3,_0x5b88('0xc'),JSON[_0x5b88('0xe')](_0x4fe92b));if(_0x4fe92b[_0x5b88('0xf')]){if(_0x4fe92b[_0x5b88('0xf')][_0x5b88('0x10')]===0x1f4){logger[_0x5b88('0xf')]('VtigerField,\x20%s,\x20%s',_0x243fb3,_0x4fe92b[_0x5b88('0xf')]['message']);return _0x18c3d4(_0x4fe92b['error'][_0x5b88('0x11')]);}logger[_0x5b88('0xf')]('VtigerField,\x20%s,\x20%s',_0x243fb3,_0x4fe92b[_0x5b88('0xf')][_0x5b88('0x11')]);return _0x29eb7a(_0x4fe92b[_0x5b88('0xf')]['message']);}else{logger['info'](_0x5b88('0xb'),_0x243fb3,_0x5b88('0xc'));_0x29eb7a(_0x4fe92b['result'][_0x5b88('0x11')]);}})[_0x5b88('0x12')](function(_0x548d24){logger['error'](_0x5b88('0xb'),_0x243fb3,_0x548d24);_0x18c3d4(_0x548d24);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c2645a0..c592571 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 _0x6829=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6829,0xf3));var _0x9682=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6829[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var path=require(_0x9682('0x2'));var timeout=require(_0x9682('0x3'));var express=require(_0x9682('0x4'));var router=express[_0x9682('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9682('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x9682('0x7')]('/',auth[_0x9682('0x8')](),controller['index']);router[_0x9682('0x7')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0x9')]);router[_0x9682('0x7')]('/:id/configurations',auth[_0x9682('0x8')](),controller[_0x9682('0xa')]);router[_0x9682('0x7')](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xc')]);router[_0x9682('0xd')]('/',auth[_0x9682('0x8')](),controller[_0x9682('0xe')]);router['post'](_0x9682('0xf'),auth[_0x9682('0x8')](),controller[_0x9682('0x10')]);router[_0x9682('0x11')](_0x9682('0x12'),auth[_0x9682('0x8')](),controller[_0x9682('0x13')]);router[_0x9682('0x14')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd856=['express','Router','fs-extra','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path'];(function(_0x642da6,_0x15b593){var _0x12dd73=function(_0x3e4d94){while(--_0x3e4d94){_0x642da6['push'](_0x642da6['shift']());}};_0x12dd73(++_0x15b593);}(_0xd856,0xb6));var _0x6d85=function(_0x20cf5f,_0x1eaf58){_0x20cf5f=_0x20cf5f-0x0;var _0x27f0fd=_0xd856[_0x20cf5f];return _0x27f0fd;};'use strict';var multer=require(_0x6d85('0x0'));var util=require('util');var path=require(_0x6d85('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d85('0x2'));var router=express[_0x6d85('0x3')]();var fs_extra=require(_0x6d85('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6d85('0x5'));var config=require('../../config/environment');var controller=require(_0x6d85('0x6'));router['get']('/',auth[_0x6d85('0x7')](),controller[_0x6d85('0x8')]);router[_0x6d85('0x9')](_0x6d85('0xa'),auth[_0x6d85('0x7')](),controller[_0x6d85('0xb')]);router['get'](_0x6d85('0xc'),auth[_0x6d85('0x7')](),controller[_0x6d85('0xd')]);router[_0x6d85('0x9')](_0x6d85('0xe'),auth[_0x6d85('0x7')](),controller[_0x6d85('0xf')]);router[_0x6d85('0x10')]('/',auth[_0x6d85('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0x6d85('0x7')](),controller[_0x6d85('0x11')]);router[_0x6d85('0x12')](_0x6d85('0xa'),auth[_0x6d85('0x7')](),controller[_0x6d85('0x13')]);router[_0x6d85('0x14')](_0x6d85('0xa'),auth[_0x6d85('0x7')](),controller[_0x6d85('0x15')]);module[_0x6d85('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 6c0d5aa..8b6c1c4 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 _0x38b2=['STRING','username','ENUM','password','token','integrationTab','sequelize','exports'];(function(_0x937506,_0x32072c){var _0x5d6d09=function(_0x2252d6){while(--_0x2252d6){_0x937506['push'](_0x937506['shift']());}};_0x5d6d09(++_0x32072c);}(_0x38b2,0xf6));var _0x238b=function(_0x282769,_0x33d24c){_0x282769=_0x282769-0x0;var _0x56d6d0=_0x38b2[_0x282769];return _0x56d6d0;};'use strict';var Sequelize=require(_0x238b('0x0'));module[_0x238b('0x1')]={'name':{'type':Sequelize[_0x238b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x238b('0x3')},'password':{'type':Sequelize[_0x238b('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x238b('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x238b('0x4')](_0x238b('0x5'),_0x238b('0x6')),'defaultValue':_0x238b('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x238b('0x4')](_0x238b('0x7'),'newTab'),'defaultValue':_0x238b('0x7')}}; \ No newline at end of file +var _0x0e4b=['ENUM','token','password','integrationTab','sequelize','exports','STRING','remoteUri'];(function(_0x972937,_0x277e0a){var _0x1d6b30=function(_0x35bd9d){while(--_0x35bd9d){_0x972937['push'](_0x972937['shift']());}};_0x1d6b30(++_0x277e0a);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x16ad32,_0x4cac16){_0x16ad32=_0x16ad32-0x0;var _0x35b3d5=_0x0e4b[_0x16ad32];return _0x35b3d5;};'use strict';var Sequelize=require(_0xb0e4('0x0'));module[_0xb0e4('0x1')]={'name':{'type':Sequelize[_0xb0e4('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb0e4('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb0e4('0x3')},'authType':{'type':Sequelize[_0xb0e4('0x4')]('password',_0xb0e4('0x5')),'defaultValue':_0xb0e4('0x6')},'serverUrl':{'type':Sequelize[_0xb0e4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb0e4('0x4')](_0xb0e4('0x7'),'newTab'),'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 44dd2e7..7c238be 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 _0x9c00=['options','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','findOne','filter'];(function(_0x776914,_0x1dde09){var _0x39a368=function(_0x254f26){while(--_0x254f26){_0x776914['push'](_0x776914['shift']());}};_0x39a368(++_0x1dde09);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2bb9b3,_0x1d2c25){_0x2bb9b3=_0x2bb9b3-0x0;var _0x601b6=_0x9c00[_0x2bb9b3];return _0x601b6;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];var integrations=require(_0x09c0('0x1b'));function respondWithStatusCode(_0x3b95cc,_0x331905){_0x331905=_0x331905||0xcc;return function(_0x6149a8){if(_0x6149a8){return _0x3b95cc[_0x09c0('0x1c')](_0x331905);}return _0x3b95cc[_0x09c0('0x1d')](_0x331905)[_0x09c0('0x1e')]();};}function respondWithResult(_0x16e490,_0x254598){_0x254598=_0x254598||0xc8;return function(_0x152140){if(_0x152140){return _0x16e490[_0x09c0('0x1d')](_0x254598)[_0x09c0('0x1f')](_0x152140);}};}function respondWithFilteredResult(_0x2fdf11,_0x4ff6b7){return function(_0x590129){if(_0x590129){var _0x558b4f=typeof _0x4ff6b7[_0x09c0('0x20')]===_0x09c0('0x21')&&typeof _0x4ff6b7[_0x09c0('0x22')]===_0x09c0('0x21');var _0x5dcab7=_0x590129[_0x09c0('0x23')];var _0x4aa8a5=_0x558b4f?0x0:_0x4ff6b7['offset'];var _0x2c12da=_0x558b4f?_0x590129['count']:_0x4ff6b7[_0x09c0('0x20')]+_0x4ff6b7[_0x09c0('0x22')];var _0x2da257;if(_0x2c12da>=_0x5dcab7){_0x2c12da=_0x5dcab7;_0x2da257=0xc8;}else{_0x2da257=0xce;}_0x2fdf11['status'](_0x2da257);return _0x2fdf11[_0x09c0('0x24')](_0x09c0('0x25'),_0x4aa8a5+'-'+_0x2c12da+'/'+_0x5dcab7)[_0x09c0('0x1f')](_0x590129);}return null;};}function patchUpdates(_0x3447c5){return function(_0x12bba7){try{jsonpatch[_0x09c0('0x26')](_0x12bba7,_0x3447c5,!![]);}catch(_0x8c6b9a){return BPromise['reject'](_0x8c6b9a);}return _0x12bba7[_0x09c0('0x27')]();};}function saveUpdates(_0x46f171,_0x473fbd){return function(_0x1d18e9){if(_0x1d18e9){return _0x1d18e9['update'](_0x46f171)['then'](function(_0x321bcc){return _0x321bcc;});}return null;};}function removeEntity(_0x25fdb5,_0x1e8a1c){return function(_0x3a5370){if(_0x3a5370){return _0x3a5370['destroy']()[_0x09c0('0x28')](function(){_0x25fdb5[_0x09c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(!_0x2e3d4d){_0x2c7202[_0x09c0('0x1c')](0x194);}return _0x2e3d4d;};}function handleError(_0x1f8131,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0x1f4;return function(_0x45cc64){logger[_0x09c0('0x29')](_0x45cc64[_0x09c0('0x2a')]);if(_0x45cc64[_0x09c0('0x2b')]){delete _0x45cc64[_0x09c0('0x2b')];}_0x1f8131['status'](_0x1d2d9d)[_0x09c0('0x2c')](_0x45cc64);};}exports[_0x09c0('0x2d')]=function(_0x53a7b8,_0x1d09e0){var _0x5aa0b9={},_0x3f5b10={},_0x4d6bdc={'count':0x0,'rows':[]};var _0x3ac8e4=_[_0x09c0('0x2e')](db[_0x09c0('0x2f')][_0x09c0('0x30')],function(_0x4e999a){return{'name':_0x4e999a['fieldName'],'type':_0x4e999a[_0x09c0('0x31')][_0x09c0('0x32')]};});_0x3f5b10[_0x09c0('0x33')]=_['map'](_0x3ac8e4,_0x09c0('0x2b'));_0x3f5b10['query']=_[_0x09c0('0x34')](_0x53a7b8[_0x09c0('0x35')]);_0x3f5b10[_0x09c0('0x36')]=_['intersection'](_0x3f5b10[_0x09c0('0x33')],_0x3f5b10[_0x09c0('0x35')]);_0x5aa0b9[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x3f5b10[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x53a7b8[_0x09c0('0x35')]['fields']));_0x5aa0b9[_0x09c0('0x37')]=_0x5aa0b9[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x5aa0b9[_0x09c0('0x37')]:_0x3f5b10[_0x09c0('0x33')];if(!_0x53a7b8['query'][_0x09c0('0x3b')](_0x09c0('0x3c'))){_0x5aa0b9[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0x53a7b8[_0x09c0('0x35')]['limit']);_0x5aa0b9[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x53a7b8[_0x09c0('0x35')][_0x09c0('0x20')]);}_0x5aa0b9[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0x53a7b8[_0x09c0('0x35')]['sort']);_0x5aa0b9[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0x53a7b8[_0x09c0('0x35')],_0x3f5b10[_0x09c0('0x36')]),_0x3ac8e4);if(_0x53a7b8['query']['filter']){_0x5aa0b9['where']=_['merge'](_0x5aa0b9[_0x09c0('0x3f')],{'$or':_[_0x09c0('0x2e')](_0x3ac8e4,function(_0xfd295b){if(_0xfd295b[_0x09c0('0x31')]!==_0x09c0('0x41')){var _0x4bd637={};_0x4bd637[_0xfd295b[_0x09c0('0x2b')]]={'$like':'%'+_0x53a7b8[_0x09c0('0x35')]['filter']+'%'};return _0x4bd637;}})});}_0x5aa0b9=_[_0x09c0('0x42')]({},_0x5aa0b9,_0x53a7b8['options']);var _0x3ee063={'where':_0x5aa0b9['where']};return db[_0x09c0('0x2f')][_0x09c0('0x23')](_0x3ee063)['then'](function(_0x26a21c){_0x4d6bdc[_0x09c0('0x23')]=_0x26a21c;if(_0x53a7b8['query'][_0x09c0('0x43')]){_0x5aa0b9[_0x09c0('0x44')]=[{'all':!![]}];}return db[_0x09c0('0x2f')][_0x09c0('0x45')](_0x5aa0b9);})[_0x09c0('0x28')](function(_0x34326c){_0x4d6bdc['rows']=_0x34326c;return _0x4d6bdc;})[_0x09c0('0x28')](respondWithFilteredResult(_0x1d09e0,_0x5aa0b9))[_0x09c0('0x46')](handleError(_0x1d09e0,null));};exports[_0x09c0('0x47')]=function(_0x57835c,_0x193ed2){var _0x30c0c5={'raw':![],'where':{'id':_0x57835c['params']['id']}},_0x447224={};_0x447224[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskAccount']['rawAttributes']);_0x447224[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0x57835c['query']);_0x447224[_0x09c0('0x36')]=_[_0x09c0('0x38')](_0x447224['model'],_0x447224[_0x09c0('0x35')]);_0x30c0c5[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x447224[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x57835c['query'][_0x09c0('0x39')]));_0x30c0c5['attributes']=_0x30c0c5['attributes'][_0x09c0('0x3a')]?_0x30c0c5[_0x09c0('0x37')]:_0x447224[_0x09c0('0x33')];if(_0x57835c[_0x09c0('0x35')][_0x09c0('0x43')]){_0x30c0c5[_0x09c0('0x44')]=[{'all':!![]}];}_0x30c0c5=_['merge']({},_0x30c0c5,_0x57835c['options']);return db['ZendeskAccount'][_0x09c0('0x48')](_0x30c0c5)[_0x09c0('0x28')](handleEntityNotFound(_0x193ed2,null))[_0x09c0('0x28')](respondWithResult(_0x193ed2,null))['catch'](handleError(_0x193ed2,null));};exports[_0x09c0('0x49')]=function(_0xff9650,_0x2016f1){return db[_0x09c0('0x2f')][_0x09c0('0x49')](_0xff9650[_0x09c0('0x4a')],{})[_0x09c0('0x28')](respondWithResult(_0x2016f1,0xc9))[_0x09c0('0x46')](handleError(_0x2016f1,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){if(_0x38085c[_0x09c0('0x4a')]['id']){delete _0x38085c[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x38085c[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x1b0198,null))[_0x09c0('0x28')](saveUpdates(_0x38085c[_0x09c0('0x4a')],null))[_0x09c0('0x28')](respondWithResult(_0x1b0198,null))['catch'](handleError(_0x1b0198,null));};exports[_0x09c0('0x4d')]=function(_0x44befb,_0x15b0a2){return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x44befb['params']['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x15b0a2,null))[_0x09c0('0x28')](removeEntity(_0x15b0a2,null))[_0x09c0('0x46')](handleError(_0x15b0a2,null));};exports['getConfigurations']=function(_0xe0b82a,_0x18c728,_0x14b701){var _0x25a36a={};var _0x55b0f0={};var _0xebfd6d;var _0x45ecd0;return db['ZendeskAccount'][_0x09c0('0x4e')]({'where':{'id':_0xe0b82a[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x18c728,null))[_0x09c0('0x28')](function(_0x21fe00){if(_0x21fe00){_0xebfd6d=_0x21fe00;_0x55b0f0[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskConfiguration']['rawAttributes']);_0x55b0f0[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0xe0b82a[_0x09c0('0x35')]);_0x55b0f0['filters']=_[_0x09c0('0x38')](_0x55b0f0['model'],_0x55b0f0[_0x09c0('0x35')]);_0x25a36a[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x55b0f0[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x39')]));_0x25a36a['attributes']=_0x25a36a[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x25a36a[_0x09c0('0x37')]:_0x55b0f0[_0x09c0('0x33')];_0x25a36a[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x3e')]);_0x25a36a[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0xe0b82a['query'],_0x55b0f0[_0x09c0('0x36')]));if(_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x4f')]){_0x25a36a[_0x09c0('0x3f')]=_['merge'](_0x25a36a[_0x09c0('0x3f')],{'$or':_['map'](_0x25a36a[_0x09c0('0x37')],function(_0x9a4f4){var _0x1cfdb3={};_0x1cfdb3[_0x9a4f4]={'$like':'%'+_0xe0b82a['query']['filter']+'%'};return _0x1cfdb3;})});}_0x25a36a=_[_0x09c0('0x42')]({},_0x25a36a,_0xe0b82a[_0x09c0('0x50')]);return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x4b65c7){if(_0x4b65c7){_0x45ecd0=_0x4b65c7[_0x09c0('0x3a')];if(!_0xe0b82a[_0x09c0('0x35')]['hasOwnProperty'](_0x09c0('0x3c'))){_0x25a36a[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0xe0b82a[_0x09c0('0x35')]['limit']);_0x25a36a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x20')]);}return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x30d976){if(_0x30d976){return _0x30d976?{'count':_0x45ecd0,'rows':_0x30d976}:null;}})[_0x09c0('0x28')](respondWithResult(_0x18c728,null))[_0x09c0('0x46')](handleError(_0x18c728,null));};exports[_0x09c0('0x52')]=function(_0x85adc7,_0x2906cb,_0x2d67e8){if(_0x85adc7['body']['id']){delete _0x85adc7[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x85adc7[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x2906cb,null))['then'](function(_0x1205da){if(_0x1205da){_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x53')]=_0x1205da['id'];_0x85adc7[_0x09c0('0x4a')]['Subjects']=integrations[_0x09c0('0x54')](_0x85adc7[_0x09c0('0x4a')]['channel'],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x55')]=integrations[_0x09c0('0x56')](_0x85adc7['body'][_0x09c0('0x57')],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);return db[_0x09c0('0x58')][_0x09c0('0x49')](_0x85adc7['body'],{'include':[{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x5a')},{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x55')}]});}return null;})[_0x09c0('0x28')](respondWithResult(_0x2906cb,null))[_0x09c0('0x46')](handleError(_0x2906cb,null));};exports['getFields']=function(_0x51fc84,_0x583c0d,_0x52fe65){var _0x7c1cb8='';return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x51fc84['params']['id']},'attributes':['id',_0x09c0('0x5b'),'password',_0x09c0('0x5c'),_0x09c0('0x5d'),'remoteUri']})[_0x09c0('0x28')](handleEntityNotFound(_0x583c0d,null))['then'](function(_0x4a42c4){if(_0x4a42c4){_0x7c1cb8=_0x4a42c4[_0x09c0('0x5e')];var _0x111647=_0x7c1cb8[_0x09c0('0x5f')](-0x1);if(_0x111647==='/'){_0x7c1cb8=_0x7c1cb8[_0x09c0('0x60')](0x0,_0x7c1cb8[_0x09c0('0x61')](_0x111647));}var _0x3ffd37={'method':_0x09c0('0x62'),'uri':util[_0x09c0('0x63')](_0x09c0('0x64'),_0x7c1cb8,_0x09c0('0x65')),'json':!![]};switch(_0x4a42c4['authType']){case _0x09c0('0x66'):_0x3ffd37[_0x09c0('0x67')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x68'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x66')]))[_0x09c0('0x69')](_0x09c0('0x6a')))};break;case _0x09c0('0x5c'):_0x3ffd37['headers']={'Authorization':util[_0x09c0('0x63')]('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x6b'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x5c')]))[_0x09c0('0x69')]('base64'))};break;default:throw new db[(_0x09c0('0x6c'))]['ValidationError'](_0x09c0('0x6d'));}return rp(_0x3ffd37);}})['then'](function(_0x35c446){if(_0x35c446){var _0x3e8b19=[_0x09c0('0x6e'),_0x09c0('0x6f'),_0x09c0('0x70'),_0x09c0('0x71')];_[_0x09c0('0x72')](_0x35c446['ticket_fields'],function(_0x4ab50d){return _0x3e8b19[_0x09c0('0x73')](_0x4ab50d[_0x09c0('0x31')]);});return{'count':_0x35c446[_0x09c0('0x65')][_0x09c0('0x3a')],'rows':_[_0x09c0('0x2e')](_0x35c446[_0x09c0('0x65')],function(_0x4060bb){return{'id':_0x4060bb['id'],'name':_0x4060bb[_0x09c0('0x74')]>0x7?_0x4060bb[_0x09c0('0x75')]:_0x4060bb[_0x09c0('0x31')],'custom':_0x4060bb['position']>0x7?!![]:![],'options':_0x4060bb['system_field_options']?_0x4060bb['system_field_options']:_0x4060bb[_0x09c0('0x76')]?_0x4060bb[_0x09c0('0x76')]:[]};})};}})[_0x09c0('0x28')](respondWithResult(_0x583c0d,null))['catch'](function(_0x5f1857){var _0x1618de=_0x51fc84['query'][_0x09c0('0x77')]?0x1f4:_0x5f1857[_0x09c0('0x78')]||0x1f4;logger['error'](_0x09c0('0x79'),'getFields',_0x1618de,JSON[_0x09c0('0x7a')](_0x5f1857));delete _0x5f1857[_0x09c0('0x2b')];if(_0x1618de===0x191){_0x1618de=0x190;}_0x583c0d[_0x09c0('0x1d')](_0x1618de)['send'](_0x51fc84[_0x09c0('0x35')][_0x09c0('0x77')]?{'message':_0x09c0('0x7b'),'statusCode':_0x5f1857[_0x09c0('0x78')]}:_0x5f1857);});}; \ No newline at end of file +var _0x6f7a=['name','send','index','map','ZendeskAccount','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','Subjects','getSubjects','channel','getDescriptions','ZendeskConfiguration','ZendeskField','Descriptions','getFields','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','username','password','toString','base64','token','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','description','group','includes','position','title','system_field_options','custom_field_options','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x4abe85,_0xa8b55f){_0x4abe85=_0x4abe85-0x0;var _0x2ce5e2=_0x6f7a[_0x4abe85];return _0x2ce5e2;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];var integrations=require(_0xa6f7('0x19'));function respondWithStatusCode(_0x5a3035,_0x3fc7f1){_0x3fc7f1=_0x3fc7f1||0xcc;return function(_0x532352){if(_0x532352){return _0x5a3035[_0xa6f7('0x1a')](_0x3fc7f1);}return _0x5a3035[_0xa6f7('0x1b')](_0x3fc7f1)[_0xa6f7('0x1c')]();};}function respondWithResult(_0x4d3d59,_0x34c02d){_0x34c02d=_0x34c02d||0xc8;return function(_0x491fae){if(_0x491fae){return _0x4d3d59[_0xa6f7('0x1b')](_0x34c02d)['json'](_0x491fae);}};}function respondWithFilteredResult(_0x17b814,_0x17f9c5){return function(_0x6efd38){if(_0x6efd38){var _0x47e664=typeof _0x17f9c5[_0xa6f7('0x1d')]===_0xa6f7('0x1e')&&typeof _0x17f9c5[_0xa6f7('0x1f')]===_0xa6f7('0x1e');var _0x5681d5=_0x6efd38['count'];var _0xba7755=_0x47e664?0x0:_0x17f9c5['offset'];var _0x378967=_0x47e664?_0x6efd38[_0xa6f7('0x20')]:_0x17f9c5['offset']+_0x17f9c5[_0xa6f7('0x1f')];var _0xb2cfaa;if(_0x378967>=_0x5681d5){_0x378967=_0x5681d5;_0xb2cfaa=0xc8;}else{_0xb2cfaa=0xce;}_0x17b814[_0xa6f7('0x1b')](_0xb2cfaa);return _0x17b814[_0xa6f7('0x21')](_0xa6f7('0x22'),_0xba7755+'-'+_0x378967+'/'+_0x5681d5)[_0xa6f7('0x23')](_0x6efd38);}return null;};}function patchUpdates(_0x4887ad){return function(_0x3c0c55){try{jsonpatch[_0xa6f7('0x24')](_0x3c0c55,_0x4887ad,!![]);}catch(_0x58b6a1){return BPromise['reject'](_0x58b6a1);}return _0x3c0c55['save']();};}function saveUpdates(_0x1de6c9,_0x119950){return function(_0x566b63){if(_0x566b63){return _0x566b63['update'](_0x1de6c9)['then'](function(_0x2b6a84){return _0x2b6a84;});}return null;};}function removeEntity(_0xc77e8e,_0x28263e){return function(_0x5baaa9){if(_0x5baaa9){return _0x5baaa9['destroy']()[_0xa6f7('0x25')](function(){_0xc77e8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x402d25,_0x5efdce){return function(_0x35847e){if(!_0x35847e){_0x402d25[_0xa6f7('0x1a')](0x194);}return _0x35847e;};}function handleError(_0x3c79ea,_0x2b4c6c){_0x2b4c6c=_0x2b4c6c||0x1f4;return function(_0x3a3508){logger['error'](_0x3a3508['stack']);if(_0x3a3508[_0xa6f7('0x26')]){delete _0x3a3508[_0xa6f7('0x26')];}_0x3c79ea['status'](_0x2b4c6c)[_0xa6f7('0x27')](_0x3a3508);};}exports[_0xa6f7('0x28')]=function(_0x87bccc,_0x3a7ff9){var _0x224f5a={},_0x10bf77={},_0x353de8={'count':0x0,'rows':[]};var _0x54f72c=_[_0xa6f7('0x29')](db[_0xa6f7('0x2a')][_0xa6f7('0x2b')],function(_0x278bad){return{'name':_0x278bad['fieldName'],'type':_0x278bad[_0xa6f7('0x2c')][_0xa6f7('0x2d')]};});_0x10bf77['model']=_[_0xa6f7('0x29')](_0x54f72c,_0xa6f7('0x26'));_0x10bf77['query']=_['keys'](_0x87bccc[_0xa6f7('0x2e')]);_0x10bf77[_0xa6f7('0x2f')]=_[_0xa6f7('0x30')](_0x10bf77[_0xa6f7('0x31')],_0x10bf77[_0xa6f7('0x2e')]);_0x224f5a['attributes']=_['intersection'](_0x10bf77[_0xa6f7('0x31')],qs['fields'](_0x87bccc[_0xa6f7('0x2e')][_0xa6f7('0x32')]));_0x224f5a[_0xa6f7('0x33')]=_0x224f5a[_0xa6f7('0x33')][_0xa6f7('0x34')]?_0x224f5a[_0xa6f7('0x33')]:_0x10bf77['model'];if(!_0x87bccc[_0xa6f7('0x2e')][_0xa6f7('0x35')](_0xa6f7('0x36'))){_0x224f5a['limit']=qs[_0xa6f7('0x1f')](_0x87bccc['query'][_0xa6f7('0x1f')]);_0x224f5a[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x87bccc['query'][_0xa6f7('0x1d')]);}_0x224f5a[_0xa6f7('0x37')]=qs[_0xa6f7('0x38')](_0x87bccc[_0xa6f7('0x2e')][_0xa6f7('0x38')]);_0x224f5a[_0xa6f7('0x39')]=qs['filters'](_[_0xa6f7('0x3a')](_0x87bccc[_0xa6f7('0x2e')],_0x10bf77[_0xa6f7('0x2f')]),_0x54f72c);if(_0x87bccc[_0xa6f7('0x2e')][_0xa6f7('0x3b')]){_0x224f5a[_0xa6f7('0x39')]=_[_0xa6f7('0x3c')](_0x224f5a[_0xa6f7('0x39')],{'$or':_['map'](_0x54f72c,function(_0x1b5213){if(_0x1b5213[_0xa6f7('0x2c')]!==_0xa6f7('0x3d')){var _0x518088={};_0x518088[_0x1b5213[_0xa6f7('0x26')]]={'$like':'%'+_0x87bccc[_0xa6f7('0x2e')]['filter']+'%'};return _0x518088;}})});}_0x224f5a=_[_0xa6f7('0x3c')]({},_0x224f5a,_0x87bccc[_0xa6f7('0x3e')]);var _0x3ecb88={'where':_0x224f5a[_0xa6f7('0x39')]};return db[_0xa6f7('0x2a')]['count'](_0x3ecb88)[_0xa6f7('0x25')](function(_0x1ce691){_0x353de8[_0xa6f7('0x20')]=_0x1ce691;if(_0x87bccc[_0xa6f7('0x2e')][_0xa6f7('0x3f')]){_0x224f5a[_0xa6f7('0x40')]=[{'all':!![]}];}return db[_0xa6f7('0x2a')][_0xa6f7('0x41')](_0x224f5a);})['then'](function(_0x5ac005){_0x353de8[_0xa6f7('0x42')]=_0x5ac005;return _0x353de8;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x3a7ff9,_0x224f5a))[_0xa6f7('0x43')](handleError(_0x3a7ff9,null));};exports[_0xa6f7('0x44')]=function(_0x2ac07f,_0x387714){var _0x21fdd7={'raw':![],'where':{'id':_0x2ac07f[_0xa6f7('0x45')]['id']}},_0x404552={};_0x404552[_0xa6f7('0x31')]=_['keys'](db[_0xa6f7('0x2a')][_0xa6f7('0x2b')]);_0x404552['query']=_[_0xa6f7('0x46')](_0x2ac07f[_0xa6f7('0x2e')]);_0x404552[_0xa6f7('0x2f')]=_[_0xa6f7('0x30')](_0x404552['model'],_0x404552[_0xa6f7('0x2e')]);_0x21fdd7['attributes']=_['intersection'](_0x404552[_0xa6f7('0x31')],qs[_0xa6f7('0x32')](_0x2ac07f[_0xa6f7('0x2e')][_0xa6f7('0x32')]));_0x21fdd7[_0xa6f7('0x33')]=_0x21fdd7[_0xa6f7('0x33')][_0xa6f7('0x34')]?_0x21fdd7['attributes']:_0x404552[_0xa6f7('0x31')];if(_0x2ac07f[_0xa6f7('0x2e')]['includeAll']){_0x21fdd7[_0xa6f7('0x40')]=[{'all':!![]}];}_0x21fdd7=_[_0xa6f7('0x3c')]({},_0x21fdd7,_0x2ac07f[_0xa6f7('0x3e')]);return db['ZendeskAccount'][_0xa6f7('0x47')](_0x21fdd7)['then'](handleEntityNotFound(_0x387714,null))[_0xa6f7('0x25')](respondWithResult(_0x387714,null))[_0xa6f7('0x43')](handleError(_0x387714,null));};exports[_0xa6f7('0x48')]=function(_0x5f3c84,_0x5df564){return db[_0xa6f7('0x2a')]['create'](_0x5f3c84[_0xa6f7('0x49')],{})['then'](respondWithResult(_0x5df564,0xc9))['catch'](handleError(_0x5df564,null));};exports[_0xa6f7('0x4a')]=function(_0x2e3a04,_0x350071){if(_0x2e3a04[_0xa6f7('0x49')]['id']){delete _0x2e3a04[_0xa6f7('0x49')]['id'];}return db[_0xa6f7('0x2a')]['find']({'where':{'id':_0x2e3a04[_0xa6f7('0x45')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x350071,null))['then'](saveUpdates(_0x2e3a04[_0xa6f7('0x49')],null))['then'](respondWithResult(_0x350071,null))[_0xa6f7('0x43')](handleError(_0x350071,null));};exports['destroy']=function(_0x488efc,_0x60eacc){return db[_0xa6f7('0x2a')][_0xa6f7('0x47')]({'where':{'id':_0x488efc[_0xa6f7('0x45')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x60eacc,null))['then'](removeEntity(_0x60eacc,null))[_0xa6f7('0x43')](handleError(_0x60eacc,null));};exports[_0xa6f7('0x4b')]=function(_0x5cddc9,_0x4b83f6,_0x5991f9){var _0x1d7bcd={};var _0x1c2099={};var _0x134dd7;var _0x55369a;return db[_0xa6f7('0x2a')]['findOne']({'where':{'id':_0x5cddc9[_0xa6f7('0x45')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x4b83f6,null))[_0xa6f7('0x25')](function(_0x1dcb45){if(_0x1dcb45){_0x134dd7=_0x1dcb45;_0x1c2099[_0xa6f7('0x31')]=_['keys'](db['ZendeskConfiguration'][_0xa6f7('0x2b')]);_0x1c2099[_0xa6f7('0x2e')]=_[_0xa6f7('0x46')](_0x5cddc9[_0xa6f7('0x2e')]);_0x1c2099['filters']=_[_0xa6f7('0x30')](_0x1c2099[_0xa6f7('0x31')],_0x1c2099[_0xa6f7('0x2e')]);_0x1d7bcd[_0xa6f7('0x33')]=_[_0xa6f7('0x30')](_0x1c2099[_0xa6f7('0x31')],qs['fields'](_0x5cddc9[_0xa6f7('0x2e')][_0xa6f7('0x32')]));_0x1d7bcd[_0xa6f7('0x33')]=_0x1d7bcd['attributes'][_0xa6f7('0x34')]?_0x1d7bcd[_0xa6f7('0x33')]:_0x1c2099[_0xa6f7('0x31')];_0x1d7bcd[_0xa6f7('0x37')]=qs['sort'](_0x5cddc9['query'][_0xa6f7('0x38')]);_0x1d7bcd[_0xa6f7('0x39')]=qs[_0xa6f7('0x2f')](_[_0xa6f7('0x3a')](_0x5cddc9[_0xa6f7('0x2e')],_0x1c2099[_0xa6f7('0x2f')]));if(_0x5cddc9[_0xa6f7('0x2e')]['filter']){_0x1d7bcd[_0xa6f7('0x39')]=_[_0xa6f7('0x3c')](_0x1d7bcd[_0xa6f7('0x39')],{'$or':_[_0xa6f7('0x29')](_0x1d7bcd[_0xa6f7('0x33')],function(_0x11fba9){var _0xa52de0={};_0xa52de0[_0x11fba9]={'$like':'%'+_0x5cddc9[_0xa6f7('0x2e')][_0xa6f7('0x3b')]+'%'};return _0xa52de0;})});}_0x1d7bcd=_[_0xa6f7('0x3c')]({},_0x1d7bcd,_0x5cddc9[_0xa6f7('0x3e')]);return _0x134dd7['getConfigurations'](_0x1d7bcd);}})[_0xa6f7('0x25')](function(_0x55c5ce){if(_0x55c5ce){_0x55369a=_0x55c5ce[_0xa6f7('0x34')];if(!_0x5cddc9['query'][_0xa6f7('0x35')](_0xa6f7('0x36'))){_0x1d7bcd['limit']=qs[_0xa6f7('0x1f')](_0x5cddc9[_0xa6f7('0x2e')][_0xa6f7('0x1f')]);_0x1d7bcd['offset']=qs[_0xa6f7('0x1d')](_0x5cddc9['query'][_0xa6f7('0x1d')]);}return _0x134dd7[_0xa6f7('0x4b')](_0x1d7bcd);}})['then'](function(_0xd8a485){if(_0xd8a485){return _0xd8a485?{'count':_0x55369a,'rows':_0xd8a485}:null;}})['then'](respondWithResult(_0x4b83f6,null))[_0xa6f7('0x43')](handleError(_0x4b83f6,null));};exports['addConfiguration']=function(_0x14f28e,_0x341dd6,_0x2bf525){if(_0x14f28e[_0xa6f7('0x49')]['id']){delete _0x14f28e[_0xa6f7('0x49')]['id'];}return db[_0xa6f7('0x2a')][_0xa6f7('0x4c')]({'where':{'id':_0x14f28e[_0xa6f7('0x45')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x341dd6,null))[_0xa6f7('0x25')](function(_0x110ea5){if(_0x110ea5){_0x14f28e[_0xa6f7('0x49')]['AccountId']=_0x110ea5['id'];_0x14f28e[_0xa6f7('0x49')][_0xa6f7('0x4d')]=integrations[_0xa6f7('0x4e')](_0x14f28e[_0xa6f7('0x49')][_0xa6f7('0x4f')],_0x14f28e[_0xa6f7('0x49')][_0xa6f7('0x2c')]);_0x14f28e[_0xa6f7('0x49')]['Descriptions']=integrations[_0xa6f7('0x50')](_0x14f28e[_0xa6f7('0x49')][_0xa6f7('0x4f')],_0x14f28e['body'][_0xa6f7('0x2c')]);return db[_0xa6f7('0x51')][_0xa6f7('0x48')](_0x14f28e[_0xa6f7('0x49')],{'include':[{'model':db[_0xa6f7('0x52')],'as':_0xa6f7('0x4d')},{'model':db[_0xa6f7('0x52')],'as':_0xa6f7('0x53')}]});}return null;})['then'](respondWithResult(_0x341dd6,null))['catch'](handleError(_0x341dd6,null));};exports[_0xa6f7('0x54')]=function(_0x326feb,_0x5e6d94,_0x3aa759){var _0x18ff29='';return db[_0xa6f7('0x2a')]['findOne']({'where':{'id':_0x326feb[_0xa6f7('0x45')]['id']},'attributes':['id','username','password','token','authType','remoteUri']})[_0xa6f7('0x25')](handleEntityNotFound(_0x5e6d94,null))[_0xa6f7('0x25')](function(_0x41dc51){if(_0x41dc51){_0x18ff29=_0x41dc51['remoteUri'];var _0x849412=_0x18ff29[_0xa6f7('0x55')](-0x1);if(_0x849412==='/'){_0x18ff29=_0x18ff29[_0xa6f7('0x56')](0x0,_0x18ff29[_0xa6f7('0x57')](_0x849412));}var _0x740cb5={'method':_0xa6f7('0x58'),'uri':util[_0xa6f7('0x59')](_0xa6f7('0x5a'),_0x18ff29,_0xa6f7('0x5b')),'json':!![]};switch(_0x41dc51[_0xa6f7('0x5c')]){case'password':_0x740cb5[_0xa6f7('0x5d')]={'Authorization':util[_0xa6f7('0x59')](_0xa6f7('0x5e'),new Buffer(util[_0xa6f7('0x59')](_0xa6f7('0x5f'),_0x41dc51[_0xa6f7('0x60')],_0x41dc51[_0xa6f7('0x61')]))[_0xa6f7('0x62')](_0xa6f7('0x63')))};break;case _0xa6f7('0x64'):_0x740cb5[_0xa6f7('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xa6f7('0x59')](_0xa6f7('0x65'),_0x41dc51[_0xa6f7('0x60')],_0x41dc51['token']))[_0xa6f7('0x62')](_0xa6f7('0x63')))};break;default:throw new db['Sequelize'][(_0xa6f7('0x66'))](_0xa6f7('0x67'));}return rp(_0x740cb5);}})['then'](function(_0x52dcd9){if(_0x52dcd9){var _0xadf749=['subject',_0xa6f7('0x68'),_0xa6f7('0x69'),'assignee'];_['remove'](_0x52dcd9[_0xa6f7('0x5b')],function(_0x1da89a){return _0xadf749[_0xa6f7('0x6a')](_0x1da89a['type']);});return{'count':_0x52dcd9[_0xa6f7('0x5b')][_0xa6f7('0x34')],'rows':_[_0xa6f7('0x29')](_0x52dcd9[_0xa6f7('0x5b')],function(_0x70d8c3){return{'id':_0x70d8c3['id'],'name':_0x70d8c3[_0xa6f7('0x6b')]>0x7?_0x70d8c3[_0xa6f7('0x6c')]:_0x70d8c3[_0xa6f7('0x2c')],'custom':_0x70d8c3[_0xa6f7('0x6b')]>0x7?!![]:![],'options':_0x70d8c3[_0xa6f7('0x6d')]?_0x70d8c3[_0xa6f7('0x6d')]:_0x70d8c3['custom_field_options']?_0x70d8c3[_0xa6f7('0x6e')]:[]};})};}})[_0xa6f7('0x25')](respondWithResult(_0x5e6d94,null))[_0xa6f7('0x43')](function(_0x1f3f99){var _0x46e6c4=_0x326feb[_0xa6f7('0x2e')]['test']?0x1f4:_0x1f3f99[_0xa6f7('0x6f')]||0x1f4;logger[_0xa6f7('0x70')](_0xa6f7('0x71'),_0xa6f7('0x54'),_0x46e6c4,JSON[_0xa6f7('0x72')](_0x1f3f99));delete _0x1f3f99[_0xa6f7('0x26')];if(_0x46e6c4===0x191){_0x46e6c4=0x190;}_0x5e6d94['status'](_0x46e6c4)['send'](_0x326feb[_0xa6f7('0x2e')][_0xa6f7('0x73')]?{'message':_0xa6f7('0x74'),'statusCode':_0x1f3f99[_0xa6f7('0x6f')]}:_0x1f3f99);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b14ba9c..97eb017 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 _0x14e1=['bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x4124a6,_0x22e4a6){var _0x5888d3=function(_0x5afe40){while(--_0x5afe40){_0x4124a6['push'](_0x4124a6['shift']());}};_0x5888d3(++_0x22e4a6);}(_0x14e1,0x18f));var _0x114e=function(_0x40a56b,_0xa7a5f0){_0x40a56b=_0x40a56b-0x0;var _0x3dcb23=_0x14e1[_0x40a56b];return _0x3dcb23;};'use strict';var _=require(_0x114e('0x0'));var util=require(_0x114e('0x1'));var logger=require(_0x114e('0x2'))(_0x114e('0x3'));var moment=require('moment');var BPromise=require(_0x114e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x114e('0x5'));var rimraf=require(_0x114e('0x6'));var config=require(_0x114e('0x7'));var attributes=require(_0x114e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x114e('0x9')]=function(_0x5ebb8c,_0x18e3f5){return _0x5ebb8c[_0x114e('0xa')](_0x114e('0xb'),attributes,{'tableName':_0x114e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ac=['../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x71ac,0x148));var _0xc71a=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x71ac[_0x496738];return _0xee1381;};'use strict';var _=require(_0xc71a('0x0'));var util=require(_0xc71a('0x1'));var logger=require('../../config/logger')(_0xc71a('0x2'));var moment=require(_0xc71a('0x3'));var BPromise=require(_0xc71a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc71a('0x5'));var rimraf=require(_0xc71a('0x6'));var config=require(_0xc71a('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc71a('0x8'));module[_0xc71a('0x9')]=function(_0x36fb33,_0x27d988){return _0x36fb33[_0xc71a('0xa')](_0xc71a('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 bdeaf21..88b97ca 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 _0x70e8=['message','ZendeskAccount,\x20%s,\x20%s','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','model','attributes','map','then','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5cddeb,_0xfb6615){var _0x53bbaf=function(_0x2c1bb4){while(--_0x2c1bb4){_0x5cddeb['push'](_0x5cddeb['shift']());}};_0x53bbaf(++_0xfb6615);}(_0x70e8,0x18d));var _0x870e=function(_0x1f46f1,_0x1e386e){_0x1f46f1=_0x1f46f1-0x0;var _0x6af55c=_0x70e8[_0x1f46f1];return _0x6af55c;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var moment=require(_0x870e('0x2'));var BPromise=require(_0x870e('0x3'));var rs=require(_0x870e('0x4'));var fs=require('fs');var Redis=require(_0x870e('0x5'));var db=require(_0x870e('0x6'))['db'];var utils=require(_0x870e('0x7'));var logger=require(_0x870e('0x8'))(_0x870e('0x9'));var config=require(_0x870e('0xa'));var jayson=require(_0x870e('0xb'));var client=jayson[_0x870e('0xc')][_0x870e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33cde0,_0x5ce9ae,_0x178544){return new BPromise(function(_0x257116,_0x1944c5){return client[_0x870e('0xe')](_0x33cde0,_0x178544)['then'](function(_0x50c422){logger[_0x870e('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x5ce9ae,_0x870e('0x10'));logger[_0x870e('0x11')](_0x870e('0x12'),_0x5ce9ae,_0x870e('0x10'),JSON[_0x870e('0x13')](_0x50c422));if(_0x50c422[_0x870e('0x14')]){if(_0x50c422[_0x870e('0x14')]['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x5ce9ae,_0x50c422[_0x870e('0x14')][_0x870e('0x15')]);return _0x1944c5(_0x50c422[_0x870e('0x14')]['message']);}logger[_0x870e('0x14')](_0x870e('0x16'),_0x5ce9ae,_0x50c422[_0x870e('0x14')]['message']);return _0x257116(_0x50c422[_0x870e('0x14')][_0x870e('0x15')]);}else{logger[_0x870e('0xf')](_0x870e('0x16'),_0x5ce9ae,_0x870e('0x10'));_0x257116(_0x50c422['result'][_0x870e('0x15')]);}})[_0x870e('0x17')](function(_0xe904e2){logger['error'](_0x870e('0x16'),_0x5ce9ae,_0xe904e2);_0x1944c5(_0xe904e2);});});}exports[_0x870e('0x18')]=function(_0x258ac7){var _0x4901f9=this;return new Promise(function(_0xa7d604,_0x18e106){return db[_0x870e('0x19')][_0x870e('0x1a')]({'raw':_0x258ac7[_0x870e('0x1b')]?_0x258ac7[_0x870e('0x1b')][_0x870e('0x1c')]===undefined?!![]:![]:!![],'where':_0x258ac7['options']?_0x258ac7[_0x870e('0x1b')][_0x870e('0x1d')]||null:null,'attributes':_0x258ac7[_0x870e('0x1b')]?_0x258ac7[_0x870e('0x1b')]['attributes']||null:null,'limit':_0x258ac7['options']?_0x258ac7[_0x870e('0x1b')][_0x870e('0x1e')]||null:null,'include':_0x258ac7[_0x870e('0x1b')]?_0x258ac7['options'][_0x870e('0x1f')]?_['map'](_0x258ac7[_0x870e('0x1b')][_0x870e('0x1f')],function(_0x4c4735){return{'model':db[_0x4c4735[_0x870e('0x20')]],'as':_0x4c4735['as'],'attributes':_0x4c4735[_0x870e('0x21')],'include':_0x4c4735['include']?_[_0x870e('0x22')](_0x4c4735[_0x870e('0x1f')],function(_0x20b264){return{'model':db[_0x20b264[_0x870e('0x20')]],'as':_0x20b264['as'],'attributes':_0x20b264[_0x870e('0x21')],'include':_0x20b264[_0x870e('0x1f')]?_[_0x870e('0x22')](_0x20b264[_0x870e('0x1f')],function(_0x37e775){return{'model':db[_0x37e775[_0x870e('0x20')]],'as':_0x37e775['as'],'attributes':_0x37e775[_0x870e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x870e('0x23')](function(_0x14e5b7){logger['info'](_0x870e('0x18'),_0x258ac7);logger[_0x870e('0x11')]('GetZendeskAccount',_0x258ac7,JSON[_0x870e('0x13')](_0x14e5b7));_0xa7d604(_0x14e5b7);})['catch'](function(_0x5592b8){logger[_0x870e('0x14')](_0x870e('0x18'),_0x5592b8['message'],_0x258ac7);_0x18e106(_0x4901f9[_0x870e('0x14')](0x1f4,_0x5592b8[_0x870e('0x15')]));});});};exports[_0x870e('0x24')]=function(_0x5ae141){var _0x5962d3=this;return new Promise(function(_0x4fe3db,_0x49df66){return db[_0x870e('0x19')][_0x870e('0x25')]({'raw':_0x5ae141[_0x870e('0x1b')]?_0x5ae141[_0x870e('0x1b')][_0x870e('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ae141[_0x870e('0x1b')]?_0x5ae141['options'][_0x870e('0x1d')]||null:null,'attributes':_0x5ae141[_0x870e('0x1b')]?_0x5ae141[_0x870e('0x1b')]['attributes']||null:null,'include':_0x5ae141[_0x870e('0x1b')]?_0x5ae141[_0x870e('0x1b')]['include']?_['map'](_0x5ae141[_0x870e('0x1b')][_0x870e('0x1f')],function(_0x2bc6c6){return{'model':db[_0x2bc6c6[_0x870e('0x20')]],'as':_0x2bc6c6['as'],'attributes':_0x2bc6c6[_0x870e('0x21')],'include':_0x2bc6c6['include']?_['map'](_0x2bc6c6[_0x870e('0x1f')],function(_0x278a28){return{'model':db[_0x278a28[_0x870e('0x20')]],'as':_0x278a28['as'],'attributes':_0x278a28[_0x870e('0x21')],'include':_0x278a28[_0x870e('0x1f')]?_[_0x870e('0x22')](_0x278a28[_0x870e('0x1f')],function(_0xe2a84){return{'model':db[_0xe2a84[_0x870e('0x20')]],'as':_0xe2a84['as'],'attributes':_0xe2a84[_0x870e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x870e('0x23')](function(_0x41da94){logger['info']('ShowZendeskAccount',_0x5ae141);logger[_0x870e('0x11')](_0x870e('0x24'),_0x5ae141,JSON[_0x870e('0x13')](_0x41da94));_0x4fe3db(_0x41da94);})[_0x870e('0x17')](function(_0x5ea2e7){logger[_0x870e('0x14')](_0x870e('0x24'),_0x5ea2e7[_0x870e('0x15')],_0x5ae141);_0x49df66(_0x5962d3[_0x870e('0x14')](0x1f4,_0x5ea2e7['message']));});});}; \ No newline at end of file +var _0xcd7b=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowZendeskAccount','lodash','util'];(function(_0x435cf5,_0x1ee6b9){var _0x196fab=function(_0x53dcff){while(--_0x53dcff){_0x435cf5['push'](_0x435cf5['shift']());}};_0x196fab(++_0x1ee6b9);}(_0xcd7b,0x8a));var _0xbcd7=function(_0x3a41e0,_0x3962fb){_0x3a41e0=_0x3a41e0-0x0;var _0x4bb66c=_0xcd7b[_0x3a41e0];return _0x4bb66c;};'use strict';var _=require(_0xbcd7('0x0'));var util=require(_0xbcd7('0x1'));var moment=require(_0xbcd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbcd7('0x3'));var fs=require('fs');var Redis=require(_0xbcd7('0x4'));var db=require(_0xbcd7('0x5'))['db'];var utils=require(_0xbcd7('0x6'));var logger=require(_0xbcd7('0x7'))(_0xbcd7('0x8'));var config=require(_0xbcd7('0x9'));var jayson=require(_0xbcd7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40d45b,_0x4151a0,_0x2f7c6d){return new BPromise(function(_0x135300,_0x7c14d5){return client['request'](_0x40d45b,_0x2f7c6d)['then'](function(_0x4711d4){logger[_0xbcd7('0xb')](_0xbcd7('0xc'),_0x4151a0,'request\x20sent');logger[_0xbcd7('0xd')](_0xbcd7('0xe'),_0x4151a0,'request\x20sent',JSON[_0xbcd7('0xf')](_0x4711d4));if(_0x4711d4[_0xbcd7('0x10')]){if(_0x4711d4[_0xbcd7('0x10')][_0xbcd7('0x11')]===0x1f4){logger[_0xbcd7('0x10')](_0xbcd7('0xc'),_0x4151a0,_0x4711d4[_0xbcd7('0x10')][_0xbcd7('0x12')]);return _0x7c14d5(_0x4711d4[_0xbcd7('0x10')][_0xbcd7('0x12')]);}logger['error'](_0xbcd7('0xc'),_0x4151a0,_0x4711d4[_0xbcd7('0x10')]['message']);return _0x135300(_0x4711d4[_0xbcd7('0x10')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x4151a0,_0xbcd7('0x13'));_0x135300(_0x4711d4[_0xbcd7('0x14')][_0xbcd7('0x12')]);}})[_0xbcd7('0x15')](function(_0x33895a){logger[_0xbcd7('0x10')](_0xbcd7('0xc'),_0x4151a0,_0x33895a);_0x7c14d5(_0x33895a);});});}exports[_0xbcd7('0x16')]=function(_0x519ff8){var _0x31d0f0=this;return new Promise(function(_0x57ba16,_0xfef594){return db[_0xbcd7('0x17')][_0xbcd7('0x18')]({'raw':_0x519ff8['options']?_0x519ff8[_0xbcd7('0x19')][_0xbcd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x519ff8[_0xbcd7('0x19')]?_0x519ff8[_0xbcd7('0x19')][_0xbcd7('0x1b')]||null:null,'attributes':_0x519ff8[_0xbcd7('0x19')]?_0x519ff8[_0xbcd7('0x19')][_0xbcd7('0x1c')]||null:null,'limit':_0x519ff8[_0xbcd7('0x19')]?_0x519ff8[_0xbcd7('0x19')][_0xbcd7('0x1d')]||null:null,'include':_0x519ff8[_0xbcd7('0x19')]?_0x519ff8[_0xbcd7('0x19')][_0xbcd7('0x1e')]?_[_0xbcd7('0x1f')](_0x519ff8['options']['include'],function(_0x2f6360){return{'model':db[_0x2f6360[_0xbcd7('0x20')]],'as':_0x2f6360['as'],'attributes':_0x2f6360[_0xbcd7('0x1c')],'include':_0x2f6360[_0xbcd7('0x1e')]?_[_0xbcd7('0x1f')](_0x2f6360[_0xbcd7('0x1e')],function(_0x1629e9){return{'model':db[_0x1629e9[_0xbcd7('0x20')]],'as':_0x1629e9['as'],'attributes':_0x1629e9[_0xbcd7('0x1c')],'include':_0x1629e9[_0xbcd7('0x1e')]?_[_0xbcd7('0x1f')](_0x1629e9[_0xbcd7('0x1e')],function(_0x3c7981){return{'model':db[_0x3c7981['model']],'as':_0x3c7981['as'],'attributes':_0x3c7981['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcd7('0x21')](function(_0x23f7ef){logger['info'](_0xbcd7('0x16'),_0x519ff8);logger['debug'](_0xbcd7('0x16'),_0x519ff8,JSON[_0xbcd7('0xf')](_0x23f7ef));_0x57ba16(_0x23f7ef);})[_0xbcd7('0x15')](function(_0x4e94d4){logger[_0xbcd7('0x10')](_0xbcd7('0x16'),_0x4e94d4['message'],_0x519ff8);_0xfef594(_0x31d0f0[_0xbcd7('0x10')](0x1f4,_0x4e94d4[_0xbcd7('0x12')]));});});};exports[_0xbcd7('0x22')]=function(_0x3c7a53){var _0xdaaa5b=this;return new Promise(function(_0x3a0f1f,_0x29a6eb){return db[_0xbcd7('0x17')]['find']({'raw':_0x3c7a53['options']?_0x3c7a53['options'][_0xbcd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c7a53[_0xbcd7('0x19')]?_0x3c7a53['options'][_0xbcd7('0x1b')]||null:null,'attributes':_0x3c7a53['options']?_0x3c7a53[_0xbcd7('0x19')]['attributes']||null:null,'include':_0x3c7a53['options']?_0x3c7a53[_0xbcd7('0x19')][_0xbcd7('0x1e')]?_[_0xbcd7('0x1f')](_0x3c7a53[_0xbcd7('0x19')][_0xbcd7('0x1e')],function(_0x1cdf5f){return{'model':db[_0x1cdf5f[_0xbcd7('0x20')]],'as':_0x1cdf5f['as'],'attributes':_0x1cdf5f[_0xbcd7('0x1c')],'include':_0x1cdf5f['include']?_[_0xbcd7('0x1f')](_0x1cdf5f['include'],function(_0x151218){return{'model':db[_0x151218['model']],'as':_0x151218['as'],'attributes':_0x151218['attributes'],'include':_0x151218['include']?_[_0xbcd7('0x1f')](_0x151218[_0xbcd7('0x1e')],function(_0xb5cda1){return{'model':db[_0xb5cda1[_0xbcd7('0x20')]],'as':_0xb5cda1['as'],'attributes':_0xb5cda1[_0xbcd7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fbce){logger[_0xbcd7('0xb')](_0xbcd7('0x22'),_0x3c7a53);logger[_0xbcd7('0xd')](_0xbcd7('0x22'),_0x3c7a53,JSON['stringify'](_0x41fbce));_0x3a0f1f(_0x41fbce);})[_0xbcd7('0x15')](function(_0x3b173a){logger[_0xbcd7('0x10')](_0xbcd7('0x22'),_0x3b173a['message'],_0x3c7a53);_0x29a6eb(_0xdaaa5b[_0xbcd7('0x10')](0x1f4,_0x3b173a[_0xbcd7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c66967d..407f36a 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x28c9ef,_0x3bac66){var _0x4a9d59=function(_0x5d0863){while(--_0x5d0863){_0x28c9ef['push'](_0x28c9ef['shift']());}};_0x4a9d59(++_0x3bac66);}(_0x750a,0x140));var _0xa750=function(_0x3c6e83,_0xba41f8){_0x3c6e83=_0x3c6e83-0x0;var _0x322588=_0x750a[_0x3c6e83];return _0x322588;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x203fcc,_0x30d96c){_0x203fcc=_0x203fcc-0x0;var _0x45dae5=_0x9ffd[_0x203fcc];return _0x45dae5;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 0fbc46a..7ddbfcd 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 _0xc9d9=['sequelize','STRING'];(function(_0x2d0c33,_0x2b22cf){var _0x50f706=function(_0x37b33a){while(--_0x37b33a){_0x2d0c33['push'](_0x2d0c33['shift']());}};_0x50f706(++_0x2b22cf);}(_0xc9d9,0x104));var _0x9c9d=function(_0x10cf21,_0x413ca2){_0x10cf21=_0x10cf21-0x0;var _0x28f12c=_0xc9d9[_0x10cf21];return _0x28f12c;};'use strict';var Sequelize=require(_0x9c9d('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c9d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xff92=['exports','sequelize'];(function(_0x3ab599,_0xc9afa7){var _0x53d176=function(_0x487f75){while(--_0x487f75){_0x3ab599['push'](_0x3ab599['shift']());}};_0x53d176(++_0xc9afa7);}(_0xff92,0x79));var _0x2ff9=function(_0x178382,_0x3168b2){_0x178382=_0x178382-0x0;var _0x5a7c0e=_0xff92[_0x178382];return _0x5a7c0e;};'use strict';var Sequelize=require(_0x2ff9('0x0'));module[_0x2ff9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index a31d576..ac76a95 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 _0x3ca1=['name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','update','then','destroy','end','error','stack'];(function(_0x15c93b,_0x52f50f){var _0x544bba=function(_0x40fcb7){while(--_0x40fcb7){_0x15c93b['push'](_0x15c93b['shift']());}};_0x544bba(++_0x52f50f);}(_0x3ca1,0x1d9));var _0x13ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x13ca('0x0'));var rimraf=require(_0x13ca('0x1'));var zipdir=require(_0x13ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13ca('0x3'));var moment=require(_0x13ca('0x4'));var BPromise=require(_0x13ca('0x5'));var Mustache=require(_0x13ca('0x6'));var util=require(_0x13ca('0x7'));var path=require('path');var sox=require(_0x13ca('0x8'));var csv=require(_0x13ca('0x9'));var ejs=require(_0x13ca('0xa'));var fs=require('fs');var fs_extra=require(_0x13ca('0xb'));var _=require(_0x13ca('0xc'));var squel=require(_0x13ca('0xd'));var crypto=require(_0x13ca('0xe'));var jsforce=require(_0x13ca('0xf'));var deskjs=require(_0x13ca('0x10'));var toCsv=require(_0x13ca('0x9'));var querystring=require(_0x13ca('0x11'));var Papa=require(_0x13ca('0x12'));var Redis=require(_0x13ca('0x13'));var authService=require(_0x13ca('0x14'));var qs=require(_0x13ca('0x15'));var as=require(_0x13ca('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x13ca('0x17'));var utils=require(_0x13ca('0x18'));var config=require(_0x13ca('0x19'));var licenseUtil=require(_0x13ca('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b1f4d,_0x2b38f3){_0x2b38f3=_0x2b38f3||0xcc;return function(_0x286fc3){if(_0x286fc3){return _0x3b1f4d[_0x13ca('0x1b')](_0x2b38f3);}return _0x3b1f4d[_0x13ca('0x1c')](_0x2b38f3)['end']();};}function respondWithResult(_0x791276,_0x44944b){_0x44944b=_0x44944b||0xc8;return function(_0x19199b){if(_0x19199b){return _0x791276[_0x13ca('0x1c')](_0x44944b)[_0x13ca('0x1d')](_0x19199b);}};}function respondWithFilteredResult(_0x179b9f,_0x2dea31){return function(_0xb41ba1){if(_0xb41ba1){var _0xed2c29=typeof _0x2dea31['offset']==='undefined'&&typeof _0x2dea31[_0x13ca('0x1e')]===_0x13ca('0x1f');var _0x58cb3b=_0xb41ba1[_0x13ca('0x20')];var _0x3d44fa=_0xed2c29?0x0:_0x2dea31['offset'];var _0x448a1f=_0xed2c29?_0xb41ba1[_0x13ca('0x20')]:_0x2dea31[_0x13ca('0x21')]+_0x2dea31['limit'];var _0x4b1b18;if(_0x448a1f>=_0x58cb3b){_0x448a1f=_0x58cb3b;_0x4b1b18=0xc8;}else{_0x4b1b18=0xce;}_0x179b9f[_0x13ca('0x1c')](_0x4b1b18);return _0x179b9f[_0x13ca('0x22')]('Content-Range',_0x3d44fa+'-'+_0x448a1f+'/'+_0x58cb3b)[_0x13ca('0x1d')](_0xb41ba1);}return null;};}function patchUpdates(_0x4cf3ff){return function(_0x58f420){try{jsonpatch['apply'](_0x58f420,_0x4cf3ff,!![]);}catch(_0x108b75){return BPromise[_0x13ca('0x23')](_0x108b75);}return _0x58f420[_0x13ca('0x24')]();};}function saveUpdates(_0x54ec28,_0x5541a0){return function(_0x156d18){if(_0x156d18){return _0x156d18[_0x13ca('0x25')](_0x54ec28)[_0x13ca('0x26')](function(_0x1e2d51){return _0x1e2d51;});}return null;};}function removeEntity(_0x270bc0,_0x2b4230){return function(_0xacc94c){if(_0xacc94c){return _0xacc94c[_0x13ca('0x27')]()[_0x13ca('0x26')](function(){_0x270bc0[_0x13ca('0x1c')](0xcc)[_0x13ca('0x28')]();});}};}function handleEntityNotFound(_0x22536d,_0x255d1a){return function(_0x5a03e4){if(!_0x5a03e4){_0x22536d[_0x13ca('0x1b')](0x194);}return _0x5a03e4;};}function handleError(_0x28dc88,_0x440f35){_0x440f35=_0x440f35||0x1f4;return function(_0x23e0eb){logger[_0x13ca('0x29')](_0x23e0eb[_0x13ca('0x2a')]);if(_0x23e0eb['name']){delete _0x23e0eb[_0x13ca('0x2b')];}_0x28dc88[_0x13ca('0x1c')](_0x440f35)[_0x13ca('0x2c')](_0x23e0eb);};}exports[_0x13ca('0x2d')]=function(_0x32c920,_0x1178f9){var _0x4a6b6f={},_0x42b351={},_0x36d74d={'count':0x0,'rows':[]};var _0x28619e=_[_0x13ca('0x2e')](db['ZendeskConfiguration']['rawAttributes'],function(_0x5211ab){return{'name':_0x5211ab[_0x13ca('0x2f')],'type':_0x5211ab[_0x13ca('0x30')][_0x13ca('0x31')]};});_0x42b351['model']=_[_0x13ca('0x2e')](_0x28619e,_0x13ca('0x2b'));_0x42b351['query']=_[_0x13ca('0x32')](_0x32c920[_0x13ca('0x33')]);_0x42b351[_0x13ca('0x34')]=_[_0x13ca('0x35')](_0x42b351[_0x13ca('0x36')],_0x42b351[_0x13ca('0x33')]);_0x4a6b6f['attributes']=_[_0x13ca('0x35')](_0x42b351['model'],qs[_0x13ca('0x37')](_0x32c920[_0x13ca('0x33')]['fields']));_0x4a6b6f[_0x13ca('0x38')]=_0x4a6b6f[_0x13ca('0x38')][_0x13ca('0x39')]?_0x4a6b6f['attributes']:_0x42b351[_0x13ca('0x36')];if(!_0x32c920[_0x13ca('0x33')][_0x13ca('0x3a')](_0x13ca('0x3b'))){_0x4a6b6f['limit']=qs['limit'](_0x32c920[_0x13ca('0x33')][_0x13ca('0x1e')]);_0x4a6b6f[_0x13ca('0x21')]=qs[_0x13ca('0x21')](_0x32c920[_0x13ca('0x33')]['offset']);}_0x4a6b6f[_0x13ca('0x3c')]=qs[_0x13ca('0x3d')](_0x32c920[_0x13ca('0x33')][_0x13ca('0x3d')]);_0x4a6b6f[_0x13ca('0x3e')]=qs['filters'](_[_0x13ca('0x3f')](_0x32c920[_0x13ca('0x33')],_0x42b351[_0x13ca('0x34')]),_0x28619e);if(_0x32c920[_0x13ca('0x33')][_0x13ca('0x40')]){_0x4a6b6f[_0x13ca('0x3e')]=_[_0x13ca('0x41')](_0x4a6b6f['where'],{'$or':_['map'](_0x28619e,function(_0x586921){if(_0x586921[_0x13ca('0x30')]!==_0x13ca('0x42')){var _0x32b0d7={};_0x32b0d7[_0x586921[_0x13ca('0x2b')]]={'$like':'%'+_0x32c920[_0x13ca('0x33')][_0x13ca('0x40')]+'%'};return _0x32b0d7;}})});}_0x4a6b6f=_[_0x13ca('0x41')]({},_0x4a6b6f,_0x32c920[_0x13ca('0x43')]);var _0x4228cb={'where':_0x4a6b6f[_0x13ca('0x3e')]};return db[_0x13ca('0x44')][_0x13ca('0x20')](_0x4228cb)[_0x13ca('0x26')](function(_0x4f7495){_0x36d74d[_0x13ca('0x20')]=_0x4f7495;if(_0x32c920[_0x13ca('0x33')][_0x13ca('0x45')]){_0x4a6b6f[_0x13ca('0x46')]=[{'all':!![]}];}return db[_0x13ca('0x44')][_0x13ca('0x47')](_0x4a6b6f);})[_0x13ca('0x26')](function(_0x29fbe4){_0x36d74d[_0x13ca('0x48')]=_0x29fbe4;return _0x36d74d;})[_0x13ca('0x26')](respondWithFilteredResult(_0x1178f9,_0x4a6b6f))[_0x13ca('0x49')](handleError(_0x1178f9,null));};exports['show']=function(_0x2d0c8d,_0x3d0a69){var _0xbb8cfd={'raw':![],'where':{'id':_0x2d0c8d[_0x13ca('0x4a')]['id']}},_0x487e07={};_0x487e07[_0x13ca('0x36')]=_[_0x13ca('0x32')](db[_0x13ca('0x44')][_0x13ca('0x4b')]);_0x487e07['query']=_[_0x13ca('0x32')](_0x2d0c8d[_0x13ca('0x33')]);_0x487e07[_0x13ca('0x34')]=_[_0x13ca('0x35')](_0x487e07['model'],_0x487e07[_0x13ca('0x33')]);_0xbb8cfd[_0x13ca('0x38')]=_[_0x13ca('0x35')](_0x487e07[_0x13ca('0x36')],qs[_0x13ca('0x37')](_0x2d0c8d['query'][_0x13ca('0x37')]));_0xbb8cfd[_0x13ca('0x38')]=_0xbb8cfd[_0x13ca('0x38')]['length']?_0xbb8cfd[_0x13ca('0x38')]:_0x487e07[_0x13ca('0x36')];if(_0x2d0c8d[_0x13ca('0x33')][_0x13ca('0x45')]){_0xbb8cfd[_0x13ca('0x46')]=[{'all':!![]}];}_0xbb8cfd=_[_0x13ca('0x41')]({},_0xbb8cfd,_0x2d0c8d[_0x13ca('0x43')]);return db['ZendeskConfiguration'][_0x13ca('0x4c')](_0xbb8cfd)[_0x13ca('0x26')](handleEntityNotFound(_0x3d0a69,null))[_0x13ca('0x26')](respondWithResult(_0x3d0a69,null))[_0x13ca('0x49')](handleError(_0x3d0a69,null));};exports[_0x13ca('0x4d')]=function(_0x53a9c3,_0x3f08fc){return db['ZendeskConfiguration'][_0x13ca('0x4d')](_0x53a9c3[_0x13ca('0x4e')],{})[_0x13ca('0x26')](respondWithResult(_0x3f08fc,0xc9))[_0x13ca('0x49')](handleError(_0x3f08fc,null));};exports[_0x13ca('0x25')]=function(_0x904a2c,_0xe4c2e9){if(_0x904a2c[_0x13ca('0x4e')]['id']){delete _0x904a2c[_0x13ca('0x4e')]['id'];}return db['ZendeskConfiguration'][_0x13ca('0x4c')]({'where':{'id':_0x904a2c['params']['id']}})['then'](handleEntityNotFound(_0xe4c2e9,null))[_0x13ca('0x26')](saveUpdates(_0x904a2c['body'],null))[_0x13ca('0x26')](respondWithResult(_0xe4c2e9,null))[_0x13ca('0x49')](handleError(_0xe4c2e9,null));};exports[_0x13ca('0x27')]=function(_0x43aaf5,_0xe189dc){return db[_0x13ca('0x44')][_0x13ca('0x4c')]({'where':{'id':_0x43aaf5[_0x13ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe189dc,null))[_0x13ca('0x26')](removeEntity(_0xe189dc,null))[_0x13ca('0x49')](handleError(_0xe189dc,null));};exports['getFields']=function(_0x4da333,_0x4d9bd1,_0x3050e2){var _0x5aad1b={};var _0x3a7497={};var _0x2124a7;var _0x2bf9a7;return db[_0x13ca('0x44')][_0x13ca('0x4f')]({'where':{'id':_0x4da333[_0x13ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d9bd1,null))[_0x13ca('0x26')](function(_0x1a3a73){if(_0x1a3a73){_0x2124a7=_0x1a3a73;_0x3a7497[_0x13ca('0x36')]=_[_0x13ca('0x32')](db[_0x13ca('0x50')][_0x13ca('0x4b')]);_0x3a7497[_0x13ca('0x33')]=_[_0x13ca('0x32')](_0x4da333[_0x13ca('0x33')]);_0x3a7497[_0x13ca('0x34')]=_['intersection'](_0x3a7497['model'],_0x3a7497[_0x13ca('0x33')]);_0x5aad1b[_0x13ca('0x38')]=_[_0x13ca('0x35')](_0x3a7497[_0x13ca('0x36')],qs[_0x13ca('0x37')](_0x4da333[_0x13ca('0x33')]['fields']));_0x5aad1b[_0x13ca('0x38')]=_0x5aad1b[_0x13ca('0x38')][_0x13ca('0x39')]?_0x5aad1b[_0x13ca('0x38')]:_0x3a7497['model'];_0x5aad1b[_0x13ca('0x3c')]=qs[_0x13ca('0x3d')](_0x4da333['query'][_0x13ca('0x3d')]);_0x5aad1b[_0x13ca('0x3e')]=qs['filters'](_['pick'](_0x4da333[_0x13ca('0x33')],_0x3a7497[_0x13ca('0x34')]));if(_0x4da333[_0x13ca('0x33')][_0x13ca('0x40')]){_0x5aad1b[_0x13ca('0x3e')]=_[_0x13ca('0x41')](_0x5aad1b[_0x13ca('0x3e')],{'$or':_[_0x13ca('0x2e')](_0x5aad1b[_0x13ca('0x38')],function(_0x2a45ac){var _0x1918aa={};_0x1918aa[_0x2a45ac]={'$like':'%'+_0x4da333['query'][_0x13ca('0x40')]+'%'};return _0x1918aa;})});}_0x5aad1b=_['merge']({},_0x5aad1b,_0x4da333[_0x13ca('0x43')]);return _0x2124a7[_0x13ca('0x51')](_0x5aad1b);}})[_0x13ca('0x26')](function(_0x44057a){if(_0x44057a){_0x2bf9a7=_0x44057a[_0x13ca('0x39')];if(!_0x4da333[_0x13ca('0x33')][_0x13ca('0x3a')](_0x13ca('0x3b'))){_0x5aad1b[_0x13ca('0x1e')]=qs['limit'](_0x4da333['query'][_0x13ca('0x1e')]);_0x5aad1b['offset']=qs['offset'](_0x4da333[_0x13ca('0x33')][_0x13ca('0x21')]);}return _0x2124a7[_0x13ca('0x51')](_0x5aad1b);}})[_0x13ca('0x26')](function(_0x179cc4){if(_0x179cc4){return _0x179cc4?{'count':_0x2bf9a7,'rows':_0x179cc4}:null;}})[_0x13ca('0x26')](respondWithResult(_0x4d9bd1,null))[_0x13ca('0x49')](handleError(_0x4d9bd1,null));};exports['getSubjects']=function(_0x4ae941,_0xb0da7d,_0x19ec00){var _0x444d95={};var _0x3effc5={};var _0x4ed5cb;var _0x28115f;return db[_0x13ca('0x44')]['findOne']({'where':{'id':_0x4ae941[_0x13ca('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb0da7d,null))[_0x13ca('0x26')](function(_0x1de1ed){if(_0x1de1ed){_0x4ed5cb=_0x1de1ed;_0x3effc5['model']=_[_0x13ca('0x32')](db['ZendeskField'][_0x13ca('0x4b')]);_0x3effc5[_0x13ca('0x33')]=_[_0x13ca('0x32')](_0x4ae941[_0x13ca('0x33')]);_0x3effc5[_0x13ca('0x34')]=_[_0x13ca('0x35')](_0x3effc5[_0x13ca('0x36')],_0x3effc5[_0x13ca('0x33')]);_0x444d95[_0x13ca('0x38')]=_['intersection'](_0x3effc5['model'],qs['fields'](_0x4ae941['query'][_0x13ca('0x37')]));_0x444d95[_0x13ca('0x38')]=_0x444d95[_0x13ca('0x38')]['length']?_0x444d95['attributes']:_0x3effc5['model'];_0x444d95[_0x13ca('0x3c')]=qs[_0x13ca('0x3d')](_0x4ae941[_0x13ca('0x33')][_0x13ca('0x3d')]);_0x444d95['where']=qs[_0x13ca('0x34')](_[_0x13ca('0x3f')](_0x4ae941[_0x13ca('0x33')],_0x3effc5[_0x13ca('0x34')]));if(_0x4ae941[_0x13ca('0x33')][_0x13ca('0x40')]){_0x444d95['where']=_[_0x13ca('0x41')](_0x444d95[_0x13ca('0x3e')],{'$or':_['map'](_0x444d95[_0x13ca('0x38')],function(_0x436f1f){var _0x10a943={};_0x10a943[_0x436f1f]={'$like':'%'+_0x4ae941[_0x13ca('0x33')][_0x13ca('0x40')]+'%'};return _0x10a943;})});}_0x444d95=_[_0x13ca('0x41')]({},_0x444d95,_0x4ae941[_0x13ca('0x43')]);return _0x4ed5cb['getSubjects'](_0x444d95);}})[_0x13ca('0x26')](function(_0x304311){if(_0x304311){_0x28115f=_0x304311['length'];if(!_0x4ae941[_0x13ca('0x33')][_0x13ca('0x3a')]('nolimit')){_0x444d95[_0x13ca('0x1e')]=qs['limit'](_0x4ae941[_0x13ca('0x33')]['limit']);_0x444d95[_0x13ca('0x21')]=qs[_0x13ca('0x21')](_0x4ae941['query'][_0x13ca('0x21')]);}return _0x4ed5cb[_0x13ca('0x52')](_0x444d95);}})[_0x13ca('0x26')](function(_0x2970f0){if(_0x2970f0){return _0x2970f0?{'count':_0x28115f,'rows':_0x2970f0}:null;}})[_0x13ca('0x26')](respondWithResult(_0xb0da7d,null))[_0x13ca('0x49')](handleError(_0xb0da7d,null));};exports[_0x13ca('0x53')]=function(_0x10c534,_0x91921d,_0x550bc8){var _0x574f3e={};var _0x1d8d39={};var _0x542b2c;var _0x4e7639;return db[_0x13ca('0x44')][_0x13ca('0x4f')]({'where':{'id':_0x10c534[_0x13ca('0x4a')]['id']}})[_0x13ca('0x26')](handleEntityNotFound(_0x91921d,null))[_0x13ca('0x26')](function(_0x107550){if(_0x107550){_0x542b2c=_0x107550;_0x1d8d39[_0x13ca('0x36')]=_[_0x13ca('0x32')](db[_0x13ca('0x50')][_0x13ca('0x4b')]);_0x1d8d39[_0x13ca('0x33')]=_[_0x13ca('0x32')](_0x10c534[_0x13ca('0x33')]);_0x1d8d39[_0x13ca('0x34')]=_['intersection'](_0x1d8d39[_0x13ca('0x36')],_0x1d8d39[_0x13ca('0x33')]);_0x574f3e[_0x13ca('0x38')]=_['intersection'](_0x1d8d39[_0x13ca('0x36')],qs['fields'](_0x10c534[_0x13ca('0x33')][_0x13ca('0x37')]));_0x574f3e[_0x13ca('0x38')]=_0x574f3e[_0x13ca('0x38')][_0x13ca('0x39')]?_0x574f3e[_0x13ca('0x38')]:_0x1d8d39[_0x13ca('0x36')];_0x574f3e[_0x13ca('0x3c')]=qs[_0x13ca('0x3d')](_0x10c534[_0x13ca('0x33')][_0x13ca('0x3d')]);_0x574f3e[_0x13ca('0x3e')]=qs[_0x13ca('0x34')](_[_0x13ca('0x3f')](_0x10c534['query'],_0x1d8d39[_0x13ca('0x34')]));if(_0x10c534[_0x13ca('0x33')]['filter']){_0x574f3e[_0x13ca('0x3e')]=_['merge'](_0x574f3e[_0x13ca('0x3e')],{'$or':_[_0x13ca('0x2e')](_0x574f3e[_0x13ca('0x38')],function(_0x5a6210){var _0x9cb4a7={};_0x9cb4a7[_0x5a6210]={'$like':'%'+_0x10c534[_0x13ca('0x33')]['filter']+'%'};return _0x9cb4a7;})});}_0x574f3e=_[_0x13ca('0x41')]({},_0x574f3e,_0x10c534[_0x13ca('0x43')]);return _0x542b2c[_0x13ca('0x53')](_0x574f3e);}})[_0x13ca('0x26')](function(_0x41475b){if(_0x41475b){_0x4e7639=_0x41475b['length'];if(!_0x10c534[_0x13ca('0x33')]['hasOwnProperty']('nolimit')){_0x574f3e[_0x13ca('0x1e')]=qs[_0x13ca('0x1e')](_0x10c534[_0x13ca('0x33')][_0x13ca('0x1e')]);_0x574f3e[_0x13ca('0x21')]=qs['offset'](_0x10c534[_0x13ca('0x33')][_0x13ca('0x21')]);}return _0x542b2c[_0x13ca('0x53')](_0x574f3e);}})[_0x13ca('0x26')](function(_0x299cd9){if(_0x299cd9){return _0x299cd9?{'count':_0x4e7639,'rows':_0x299cd9}:null;}})[_0x13ca('0x26')](respondWithResult(_0x91921d,null))[_0x13ca('0x49')](handleError(_0x91921d,null));};exports[_0x13ca('0x54')]=function(_0x9e5b8f,_0x21938c,_0x1b1dea){var _0x22cb84={};var _0x37f7e4={};var _0x4a7ff3;var _0x14532e;return db[_0x13ca('0x44')][_0x13ca('0x4f')]({'where':{'id':_0x9e5b8f['params']['id']}})[_0x13ca('0x26')](handleEntityNotFound(_0x21938c,null))[_0x13ca('0x26')](function(_0x1b095c){if(_0x1b095c){_0x4a7ff3=_0x1b095c;_0x37f7e4[_0x13ca('0x36')]=_[_0x13ca('0x32')](db['Tag'][_0x13ca('0x4b')]);_0x37f7e4['query']=_[_0x13ca('0x32')](_0x9e5b8f[_0x13ca('0x33')]);_0x37f7e4[_0x13ca('0x34')]=_['intersection'](_0x37f7e4[_0x13ca('0x36')],_0x37f7e4[_0x13ca('0x33')]);_0x22cb84[_0x13ca('0x38')]=_['intersection'](_0x37f7e4['model'],qs[_0x13ca('0x37')](_0x9e5b8f[_0x13ca('0x33')][_0x13ca('0x37')]));_0x22cb84[_0x13ca('0x38')]=_0x22cb84['attributes'][_0x13ca('0x39')]?_0x22cb84[_0x13ca('0x38')]:_0x37f7e4[_0x13ca('0x36')];_0x22cb84['order']=qs[_0x13ca('0x3d')](_0x9e5b8f[_0x13ca('0x33')]['sort']);_0x22cb84[_0x13ca('0x3e')]=qs[_0x13ca('0x34')](_[_0x13ca('0x3f')](_0x9e5b8f[_0x13ca('0x33')],_0x37f7e4['filters']));if(_0x9e5b8f[_0x13ca('0x33')][_0x13ca('0x40')]){_0x22cb84[_0x13ca('0x3e')]=_[_0x13ca('0x41')](_0x22cb84[_0x13ca('0x3e')],{'$or':_[_0x13ca('0x2e')](_0x22cb84['attributes'],function(_0x24db9a){var _0x538281={};_0x538281[_0x24db9a]={'$like':'%'+_0x9e5b8f[_0x13ca('0x33')][_0x13ca('0x40')]+'%'};return _0x538281;})});}_0x22cb84=_[_0x13ca('0x41')]({},_0x22cb84,_0x9e5b8f[_0x13ca('0x43')]);return _0x4a7ff3[_0x13ca('0x54')](_0x22cb84);}})[_0x13ca('0x26')](function(_0x1d0389){if(_0x1d0389){_0x14532e=_0x1d0389['length'];if(!_0x9e5b8f[_0x13ca('0x33')]['hasOwnProperty']('nolimit')){_0x22cb84['limit']=qs[_0x13ca('0x1e')](_0x9e5b8f[_0x13ca('0x33')][_0x13ca('0x1e')]);_0x22cb84[_0x13ca('0x21')]=qs[_0x13ca('0x21')](_0x9e5b8f['query']['offset']);}return _0x4a7ff3['getTags'](_0x22cb84);}})[_0x13ca('0x26')](function(_0x4378d3){if(_0x4378d3){return _0x4378d3?{'count':_0x14532e,'rows':_0x4378d3}:null;}})[_0x13ca('0x26')](respondWithResult(_0x21938c,null))[_0x13ca('0x49')](handleError(_0x21938c,null));};exports['setTags']=function(_0x3b499c,_0x49b283,_0x591245){if(_0x3b499c[_0x13ca('0x4e')]['id']){delete _0x3b499c['body']['id'];}return db[_0x13ca('0x44')]['findOne']({'where':{'id':_0x3b499c['params']['id']}})[_0x13ca('0x26')](handleEntityNotFound(_0x49b283,null))[_0x13ca('0x26')](function(_0x34d61e){if(_0x34d61e){return _0x34d61e[_0x13ca('0x55')](_0x3b499c[_0x13ca('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x49b283,null))[_0x13ca('0x49')](handleError(_0x49b283,null));}; \ No newline at end of file +var _0xd7a0=['lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','ZendeskConfiguration','includeAll','findAll','then','rows','catch','length','include','merge','options','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4b9bf9,_0x55ec68){var _0x99af3d=function(_0x288736){while(--_0x288736){_0x4b9bf9['push'](_0x4b9bf9['shift']());}};_0x99af3d(++_0x55ec68);}(_0xd7a0,0xef));var _0x0d7a=function(_0x3cbe2f,_0x3ce8fc){_0x3cbe2f=_0x3cbe2f-0x0;var _0x46b0ad=_0xd7a0[_0x3cbe2f];return _0x46b0ad;};'use strict';var emlformat=require(_0x0d7a('0x0'));var rimraf=require(_0x0d7a('0x1'));var zipdir=require(_0x0d7a('0x2'));var jsonpatch=require(_0x0d7a('0x3'));var rp=require(_0x0d7a('0x4'));var moment=require(_0x0d7a('0x5'));var BPromise=require(_0x0d7a('0x6'));var Mustache=require(_0x0d7a('0x7'));var util=require(_0x0d7a('0x8'));var path=require(_0x0d7a('0x9'));var sox=require(_0x0d7a('0xa'));var csv=require(_0x0d7a('0xb'));var ejs=require(_0x0d7a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d7a('0xd'));var squel=require('squel');var crypto=require(_0x0d7a('0xe'));var jsforce=require(_0x0d7a('0xf'));var deskjs=require(_0x0d7a('0x10'));var toCsv=require(_0x0d7a('0xb'));var querystring=require('querystring');var Papa=require(_0x0d7a('0x11'));var Redis=require('ioredis');var authService=require(_0x0d7a('0x12'));var qs=require(_0x0d7a('0x13'));var as=require(_0x0d7a('0x14'));var hardwareService=require(_0x0d7a('0x15'));var logger=require(_0x0d7a('0x16'))(_0x0d7a('0x17'));var utils=require(_0x0d7a('0x18'));var config=require(_0x0d7a('0x19'));var licenseUtil=require(_0x0d7a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465f6b,_0x2b7fb9){_0x2b7fb9=_0x2b7fb9||0xcc;return function(_0x40e4c8){if(_0x40e4c8){return _0x465f6b[_0x0d7a('0x1b')](_0x2b7fb9);}return _0x465f6b['status'](_0x2b7fb9)[_0x0d7a('0x1c')]();};}function respondWithResult(_0x108e6d,_0x4fff3f){_0x4fff3f=_0x4fff3f||0xc8;return function(_0x1257ad){if(_0x1257ad){return _0x108e6d[_0x0d7a('0x1d')](_0x4fff3f)['json'](_0x1257ad);}};}function respondWithFilteredResult(_0x380eab,_0x5ca5d7){return function(_0x3f017d){if(_0x3f017d){var _0x2e8bd8=typeof _0x5ca5d7['offset']===_0x0d7a('0x1e')&&typeof _0x5ca5d7['limit']===_0x0d7a('0x1e');var _0x545608=_0x3f017d[_0x0d7a('0x1f')];var _0x4a26ca=_0x2e8bd8?0x0:_0x5ca5d7[_0x0d7a('0x20')];var _0x4e6aad=_0x2e8bd8?_0x3f017d[_0x0d7a('0x1f')]:_0x5ca5d7['offset']+_0x5ca5d7[_0x0d7a('0x21')];var _0x4e1602;if(_0x4e6aad>=_0x545608){_0x4e6aad=_0x545608;_0x4e1602=0xc8;}else{_0x4e1602=0xce;}_0x380eab[_0x0d7a('0x1d')](_0x4e1602);return _0x380eab[_0x0d7a('0x22')](_0x0d7a('0x23'),_0x4a26ca+'-'+_0x4e6aad+'/'+_0x545608)['json'](_0x3f017d);}return null;};}function patchUpdates(_0x7d2810){return function(_0xb9e945){try{jsonpatch[_0x0d7a('0x24')](_0xb9e945,_0x7d2810,!![]);}catch(_0x4c42e4){return BPromise['reject'](_0x4c42e4);}return _0xb9e945['save']();};}function saveUpdates(_0x121b3d,_0x12000b){return function(_0x280907){if(_0x280907){return _0x280907[_0x0d7a('0x25')](_0x121b3d)['then'](function(_0x455318){return _0x455318;});}return null;};}function removeEntity(_0x30bda5,_0x20edbc){return function(_0x46eea5){if(_0x46eea5){return _0x46eea5[_0x0d7a('0x26')]()['then'](function(){_0x30bda5[_0x0d7a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59de5d,_0x1c56e7){return function(_0x5b6edf){if(!_0x5b6edf){_0x59de5d[_0x0d7a('0x1b')](0x194);}return _0x5b6edf;};}function handleError(_0x1c50c0,_0x17b007){_0x17b007=_0x17b007||0x1f4;return function(_0x3d3974){logger[_0x0d7a('0x27')](_0x3d3974[_0x0d7a('0x28')]);if(_0x3d3974['name']){delete _0x3d3974[_0x0d7a('0x29')];}_0x1c50c0[_0x0d7a('0x1d')](_0x17b007)[_0x0d7a('0x2a')](_0x3d3974);};}exports[_0x0d7a('0x2b')]=function(_0x5e3219,_0x52e0fd){var _0x2ffdd1={},_0x2ce916={},_0x288150={'count':0x0,'rows':[]};var _0x4b787d=_[_0x0d7a('0x2c')](db['ZendeskConfiguration'][_0x0d7a('0x2d')],function(_0x1704f7){return{'name':_0x1704f7[_0x0d7a('0x2e')],'type':_0x1704f7['type']['key']};});_0x2ce916[_0x0d7a('0x2f')]=_[_0x0d7a('0x2c')](_0x4b787d,_0x0d7a('0x29'));_0x2ce916[_0x0d7a('0x30')]=_[_0x0d7a('0x31')](_0x5e3219[_0x0d7a('0x30')]);_0x2ce916[_0x0d7a('0x32')]=_[_0x0d7a('0x33')](_0x2ce916[_0x0d7a('0x2f')],_0x2ce916[_0x0d7a('0x30')]);_0x2ffdd1[_0x0d7a('0x34')]=_['intersection'](_0x2ce916[_0x0d7a('0x2f')],qs[_0x0d7a('0x35')](_0x5e3219['query']['fields']));_0x2ffdd1[_0x0d7a('0x34')]=_0x2ffdd1[_0x0d7a('0x34')]['length']?_0x2ffdd1['attributes']:_0x2ce916['model'];if(!_0x5e3219['query'][_0x0d7a('0x36')](_0x0d7a('0x37'))){_0x2ffdd1[_0x0d7a('0x21')]=qs[_0x0d7a('0x21')](_0x5e3219[_0x0d7a('0x30')][_0x0d7a('0x21')]);_0x2ffdd1[_0x0d7a('0x20')]=qs[_0x0d7a('0x20')](_0x5e3219[_0x0d7a('0x30')][_0x0d7a('0x20')]);}_0x2ffdd1[_0x0d7a('0x38')]=qs[_0x0d7a('0x39')](_0x5e3219['query'][_0x0d7a('0x39')]);_0x2ffdd1[_0x0d7a('0x3a')]=qs[_0x0d7a('0x32')](_[_0x0d7a('0x3b')](_0x5e3219[_0x0d7a('0x30')],_0x2ce916['filters']),_0x4b787d);if(_0x5e3219[_0x0d7a('0x30')][_0x0d7a('0x3c')]){_0x2ffdd1[_0x0d7a('0x3a')]=_['merge'](_0x2ffdd1[_0x0d7a('0x3a')],{'$or':_['map'](_0x4b787d,function(_0x2f23bb){if(_0x2f23bb[_0x0d7a('0x3d')]!=='VIRTUAL'){var _0x16a7c6={};_0x16a7c6[_0x2f23bb[_0x0d7a('0x29')]]={'$like':'%'+_0x5e3219[_0x0d7a('0x30')]['filter']+'%'};return _0x16a7c6;}})});}_0x2ffdd1=_['merge']({},_0x2ffdd1,_0x5e3219['options']);var _0x580c05={'where':_0x2ffdd1[_0x0d7a('0x3a')]};return db[_0x0d7a('0x3e')][_0x0d7a('0x1f')](_0x580c05)['then'](function(_0x48926d){_0x288150[_0x0d7a('0x1f')]=_0x48926d;if(_0x5e3219[_0x0d7a('0x30')][_0x0d7a('0x3f')]){_0x2ffdd1['include']=[{'all':!![]}];}return db[_0x0d7a('0x3e')][_0x0d7a('0x40')](_0x2ffdd1);})[_0x0d7a('0x41')](function(_0x3b8c21){_0x288150[_0x0d7a('0x42')]=_0x3b8c21;return _0x288150;})[_0x0d7a('0x41')](respondWithFilteredResult(_0x52e0fd,_0x2ffdd1))[_0x0d7a('0x43')](handleError(_0x52e0fd,null));};exports['show']=function(_0x3771f8,_0x4a7211){var _0x52f2f3={'raw':![],'where':{'id':_0x3771f8['params']['id']}},_0x2544fa={};_0x2544fa[_0x0d7a('0x2f')]=_[_0x0d7a('0x31')](db[_0x0d7a('0x3e')]['rawAttributes']);_0x2544fa[_0x0d7a('0x30')]=_[_0x0d7a('0x31')](_0x3771f8['query']);_0x2544fa[_0x0d7a('0x32')]=_[_0x0d7a('0x33')](_0x2544fa[_0x0d7a('0x2f')],_0x2544fa['query']);_0x52f2f3['attributes']=_[_0x0d7a('0x33')](_0x2544fa[_0x0d7a('0x2f')],qs[_0x0d7a('0x35')](_0x3771f8[_0x0d7a('0x30')][_0x0d7a('0x35')]));_0x52f2f3[_0x0d7a('0x34')]=_0x52f2f3[_0x0d7a('0x34')][_0x0d7a('0x44')]?_0x52f2f3[_0x0d7a('0x34')]:_0x2544fa[_0x0d7a('0x2f')];if(_0x3771f8[_0x0d7a('0x30')][_0x0d7a('0x3f')]){_0x52f2f3[_0x0d7a('0x45')]=[{'all':!![]}];}_0x52f2f3=_[_0x0d7a('0x46')]({},_0x52f2f3,_0x3771f8[_0x0d7a('0x47')]);return db['ZendeskConfiguration'][_0x0d7a('0x48')](_0x52f2f3)[_0x0d7a('0x41')](handleEntityNotFound(_0x4a7211,null))[_0x0d7a('0x41')](respondWithResult(_0x4a7211,null))[_0x0d7a('0x43')](handleError(_0x4a7211,null));};exports[_0x0d7a('0x49')]=function(_0x1282a0,_0xe75f76){return db[_0x0d7a('0x3e')][_0x0d7a('0x49')](_0x1282a0[_0x0d7a('0x4a')],{})[_0x0d7a('0x41')](respondWithResult(_0xe75f76,0xc9))[_0x0d7a('0x43')](handleError(_0xe75f76,null));};exports[_0x0d7a('0x25')]=function(_0x3a3fbd,_0x2e0d95){if(_0x3a3fbd[_0x0d7a('0x4a')]['id']){delete _0x3a3fbd[_0x0d7a('0x4a')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x3a3fbd[_0x0d7a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e0d95,null))[_0x0d7a('0x41')](saveUpdates(_0x3a3fbd[_0x0d7a('0x4a')],null))['then'](respondWithResult(_0x2e0d95,null))[_0x0d7a('0x43')](handleError(_0x2e0d95,null));};exports[_0x0d7a('0x26')]=function(_0x42e0d7,_0x1103ac){return db['ZendeskConfiguration']['find']({'where':{'id':_0x42e0d7[_0x0d7a('0x4b')]['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0x1103ac,null))[_0x0d7a('0x41')](removeEntity(_0x1103ac,null))['catch'](handleError(_0x1103ac,null));};exports[_0x0d7a('0x4c')]=function(_0x371022,_0x55831b,_0x1aff4c){var _0x8ef288={};var _0x5f095f={};var _0x2753b0;var _0x4d41ac;return db[_0x0d7a('0x3e')][_0x0d7a('0x4d')]({'where':{'id':_0x371022[_0x0d7a('0x4b')]['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0x55831b,null))[_0x0d7a('0x41')](function(_0x1d26d2){if(_0x1d26d2){_0x2753b0=_0x1d26d2;_0x5f095f[_0x0d7a('0x2f')]=_[_0x0d7a('0x31')](db[_0x0d7a('0x4e')][_0x0d7a('0x2d')]);_0x5f095f[_0x0d7a('0x30')]=_['keys'](_0x371022[_0x0d7a('0x30')]);_0x5f095f['filters']=_[_0x0d7a('0x33')](_0x5f095f[_0x0d7a('0x2f')],_0x5f095f[_0x0d7a('0x30')]);_0x8ef288[_0x0d7a('0x34')]=_['intersection'](_0x5f095f[_0x0d7a('0x2f')],qs['fields'](_0x371022[_0x0d7a('0x30')][_0x0d7a('0x35')]));_0x8ef288['attributes']=_0x8ef288['attributes']['length']?_0x8ef288[_0x0d7a('0x34')]:_0x5f095f['model'];_0x8ef288[_0x0d7a('0x38')]=qs[_0x0d7a('0x39')](_0x371022[_0x0d7a('0x30')][_0x0d7a('0x39')]);_0x8ef288[_0x0d7a('0x3a')]=qs[_0x0d7a('0x32')](_[_0x0d7a('0x3b')](_0x371022[_0x0d7a('0x30')],_0x5f095f[_0x0d7a('0x32')]));if(_0x371022[_0x0d7a('0x30')][_0x0d7a('0x3c')]){_0x8ef288[_0x0d7a('0x3a')]=_[_0x0d7a('0x46')](_0x8ef288[_0x0d7a('0x3a')],{'$or':_[_0x0d7a('0x2c')](_0x8ef288['attributes'],function(_0x4ed204){var _0x1c500f={};_0x1c500f[_0x4ed204]={'$like':'%'+_0x371022[_0x0d7a('0x30')]['filter']+'%'};return _0x1c500f;})});}_0x8ef288=_[_0x0d7a('0x46')]({},_0x8ef288,_0x371022[_0x0d7a('0x47')]);return _0x2753b0[_0x0d7a('0x4c')](_0x8ef288);}})['then'](function(_0xbd6293){if(_0xbd6293){_0x4d41ac=_0xbd6293['length'];if(!_0x371022[_0x0d7a('0x30')]['hasOwnProperty'](_0x0d7a('0x37'))){_0x8ef288[_0x0d7a('0x21')]=qs[_0x0d7a('0x21')](_0x371022[_0x0d7a('0x30')][_0x0d7a('0x21')]);_0x8ef288['offset']=qs[_0x0d7a('0x20')](_0x371022[_0x0d7a('0x30')]['offset']);}return _0x2753b0['getFields'](_0x8ef288);}})['then'](function(_0x2c77ed){if(_0x2c77ed){return _0x2c77ed?{'count':_0x4d41ac,'rows':_0x2c77ed}:null;}})['then'](respondWithResult(_0x55831b,null))[_0x0d7a('0x43')](handleError(_0x55831b,null));};exports[_0x0d7a('0x4f')]=function(_0x2078fe,_0x14d27d,_0xf546b5){var _0x5c249c={};var _0xeed46c={};var _0x178460;var _0x51bbfd;return db[_0x0d7a('0x3e')][_0x0d7a('0x4d')]({'where':{'id':_0x2078fe[_0x0d7a('0x4b')]['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0x14d27d,null))['then'](function(_0x288c8f){if(_0x288c8f){_0x178460=_0x288c8f;_0xeed46c[_0x0d7a('0x2f')]=_[_0x0d7a('0x31')](db[_0x0d7a('0x4e')][_0x0d7a('0x2d')]);_0xeed46c['query']=_['keys'](_0x2078fe[_0x0d7a('0x30')]);_0xeed46c[_0x0d7a('0x32')]=_[_0x0d7a('0x33')](_0xeed46c[_0x0d7a('0x2f')],_0xeed46c[_0x0d7a('0x30')]);_0x5c249c['attributes']=_[_0x0d7a('0x33')](_0xeed46c[_0x0d7a('0x2f')],qs[_0x0d7a('0x35')](_0x2078fe[_0x0d7a('0x30')][_0x0d7a('0x35')]));_0x5c249c['attributes']=_0x5c249c[_0x0d7a('0x34')]['length']?_0x5c249c[_0x0d7a('0x34')]:_0xeed46c[_0x0d7a('0x2f')];_0x5c249c[_0x0d7a('0x38')]=qs[_0x0d7a('0x39')](_0x2078fe[_0x0d7a('0x30')][_0x0d7a('0x39')]);_0x5c249c[_0x0d7a('0x3a')]=qs['filters'](_[_0x0d7a('0x3b')](_0x2078fe[_0x0d7a('0x30')],_0xeed46c['filters']));if(_0x2078fe[_0x0d7a('0x30')]['filter']){_0x5c249c[_0x0d7a('0x3a')]=_[_0x0d7a('0x46')](_0x5c249c['where'],{'$or':_['map'](_0x5c249c[_0x0d7a('0x34')],function(_0x23ab4d){var _0x4bb735={};_0x4bb735[_0x23ab4d]={'$like':'%'+_0x2078fe[_0x0d7a('0x30')]['filter']+'%'};return _0x4bb735;})});}_0x5c249c=_[_0x0d7a('0x46')]({},_0x5c249c,_0x2078fe[_0x0d7a('0x47')]);return _0x178460[_0x0d7a('0x4f')](_0x5c249c);}})[_0x0d7a('0x41')](function(_0x2a14d3){if(_0x2a14d3){_0x51bbfd=_0x2a14d3[_0x0d7a('0x44')];if(!_0x2078fe[_0x0d7a('0x30')][_0x0d7a('0x36')](_0x0d7a('0x37'))){_0x5c249c[_0x0d7a('0x21')]=qs['limit'](_0x2078fe[_0x0d7a('0x30')][_0x0d7a('0x21')]);_0x5c249c[_0x0d7a('0x20')]=qs[_0x0d7a('0x20')](_0x2078fe['query'][_0x0d7a('0x20')]);}return _0x178460['getSubjects'](_0x5c249c);}})['then'](function(_0x822dbc){if(_0x822dbc){return _0x822dbc?{'count':_0x51bbfd,'rows':_0x822dbc}:null;}})[_0x0d7a('0x41')](respondWithResult(_0x14d27d,null))['catch'](handleError(_0x14d27d,null));};exports['getDescriptions']=function(_0x8eb684,_0x4ce9c3,_0x2a92db){var _0x2beccd={};var _0x56326c={};var _0x2ef265;var _0xe653af;return db[_0x0d7a('0x3e')]['findOne']({'where':{'id':_0x8eb684[_0x0d7a('0x4b')]['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0x4ce9c3,null))[_0x0d7a('0x41')](function(_0x1e85e5){if(_0x1e85e5){_0x2ef265=_0x1e85e5;_0x56326c[_0x0d7a('0x2f')]=_[_0x0d7a('0x31')](db['ZendeskField']['rawAttributes']);_0x56326c[_0x0d7a('0x30')]=_[_0x0d7a('0x31')](_0x8eb684[_0x0d7a('0x30')]);_0x56326c[_0x0d7a('0x32')]=_[_0x0d7a('0x33')](_0x56326c[_0x0d7a('0x2f')],_0x56326c[_0x0d7a('0x30')]);_0x2beccd[_0x0d7a('0x34')]=_[_0x0d7a('0x33')](_0x56326c['model'],qs[_0x0d7a('0x35')](_0x8eb684[_0x0d7a('0x30')][_0x0d7a('0x35')]));_0x2beccd[_0x0d7a('0x34')]=_0x2beccd[_0x0d7a('0x34')]['length']?_0x2beccd[_0x0d7a('0x34')]:_0x56326c[_0x0d7a('0x2f')];_0x2beccd[_0x0d7a('0x38')]=qs[_0x0d7a('0x39')](_0x8eb684[_0x0d7a('0x30')][_0x0d7a('0x39')]);_0x2beccd['where']=qs[_0x0d7a('0x32')](_[_0x0d7a('0x3b')](_0x8eb684[_0x0d7a('0x30')],_0x56326c[_0x0d7a('0x32')]));if(_0x8eb684['query']['filter']){_0x2beccd[_0x0d7a('0x3a')]=_[_0x0d7a('0x46')](_0x2beccd[_0x0d7a('0x3a')],{'$or':_[_0x0d7a('0x2c')](_0x2beccd[_0x0d7a('0x34')],function(_0x3342f2){var _0x12b5a8={};_0x12b5a8[_0x3342f2]={'$like':'%'+_0x8eb684[_0x0d7a('0x30')][_0x0d7a('0x3c')]+'%'};return _0x12b5a8;})});}_0x2beccd=_['merge']({},_0x2beccd,_0x8eb684[_0x0d7a('0x47')]);return _0x2ef265['getDescriptions'](_0x2beccd);}})[_0x0d7a('0x41')](function(_0x262452){if(_0x262452){_0xe653af=_0x262452[_0x0d7a('0x44')];if(!_0x8eb684[_0x0d7a('0x30')][_0x0d7a('0x36')](_0x0d7a('0x37'))){_0x2beccd[_0x0d7a('0x21')]=qs[_0x0d7a('0x21')](_0x8eb684['query']['limit']);_0x2beccd[_0x0d7a('0x20')]=qs[_0x0d7a('0x20')](_0x8eb684['query'][_0x0d7a('0x20')]);}return _0x2ef265[_0x0d7a('0x50')](_0x2beccd);}})[_0x0d7a('0x41')](function(_0x378dd9){if(_0x378dd9){return _0x378dd9?{'count':_0xe653af,'rows':_0x378dd9}:null;}})[_0x0d7a('0x41')](respondWithResult(_0x4ce9c3,null))[_0x0d7a('0x43')](handleError(_0x4ce9c3,null));};exports['getTags']=function(_0x10ce8a,_0xff9995,_0xde0c0c){var _0x157dba={};var _0x2e1390={};var _0x208b16;var _0xb9a17b;return db[_0x0d7a('0x3e')]['findOne']({'where':{'id':_0x10ce8a[_0x0d7a('0x4b')]['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0xff9995,null))['then'](function(_0x20730f){if(_0x20730f){_0x208b16=_0x20730f;_0x2e1390[_0x0d7a('0x2f')]=_[_0x0d7a('0x31')](db['Tag'][_0x0d7a('0x2d')]);_0x2e1390['query']=_[_0x0d7a('0x31')](_0x10ce8a[_0x0d7a('0x30')]);_0x2e1390[_0x0d7a('0x32')]=_['intersection'](_0x2e1390[_0x0d7a('0x2f')],_0x2e1390[_0x0d7a('0x30')]);_0x157dba['attributes']=_['intersection'](_0x2e1390['model'],qs[_0x0d7a('0x35')](_0x10ce8a[_0x0d7a('0x30')]['fields']));_0x157dba[_0x0d7a('0x34')]=_0x157dba[_0x0d7a('0x34')]['length']?_0x157dba['attributes']:_0x2e1390[_0x0d7a('0x2f')];_0x157dba[_0x0d7a('0x38')]=qs['sort'](_0x10ce8a[_0x0d7a('0x30')]['sort']);_0x157dba[_0x0d7a('0x3a')]=qs['filters'](_['pick'](_0x10ce8a[_0x0d7a('0x30')],_0x2e1390[_0x0d7a('0x32')]));if(_0x10ce8a[_0x0d7a('0x30')]['filter']){_0x157dba[_0x0d7a('0x3a')]=_[_0x0d7a('0x46')](_0x157dba[_0x0d7a('0x3a')],{'$or':_['map'](_0x157dba[_0x0d7a('0x34')],function(_0x934760){var _0xea5ffb={};_0xea5ffb[_0x934760]={'$like':'%'+_0x10ce8a[_0x0d7a('0x30')][_0x0d7a('0x3c')]+'%'};return _0xea5ffb;})});}_0x157dba=_[_0x0d7a('0x46')]({},_0x157dba,_0x10ce8a[_0x0d7a('0x47')]);return _0x208b16[_0x0d7a('0x51')](_0x157dba);}})[_0x0d7a('0x41')](function(_0x52afae){if(_0x52afae){_0xb9a17b=_0x52afae[_0x0d7a('0x44')];if(!_0x10ce8a[_0x0d7a('0x30')][_0x0d7a('0x36')](_0x0d7a('0x37'))){_0x157dba[_0x0d7a('0x21')]=qs[_0x0d7a('0x21')](_0x10ce8a[_0x0d7a('0x30')][_0x0d7a('0x21')]);_0x157dba[_0x0d7a('0x20')]=qs[_0x0d7a('0x20')](_0x10ce8a[_0x0d7a('0x30')][_0x0d7a('0x20')]);}return _0x208b16[_0x0d7a('0x51')](_0x157dba);}})[_0x0d7a('0x41')](function(_0x184746){if(_0x184746){return _0x184746?{'count':_0xb9a17b,'rows':_0x184746}:null;}})[_0x0d7a('0x41')](respondWithResult(_0xff9995,null))[_0x0d7a('0x43')](handleError(_0xff9995,null));};exports[_0x0d7a('0x52')]=function(_0x4385e2,_0x239bc0,_0x40afdb){if(_0x4385e2[_0x0d7a('0x4a')]['id']){delete _0x4385e2['body']['id'];}return db[_0x0d7a('0x3e')][_0x0d7a('0x4d')]({'where':{'id':_0x4385e2['params']['id']}})[_0x0d7a('0x41')](handleEntityNotFound(_0x239bc0,null))[_0x0d7a('0x41')](function(_0x22d0ce){if(_0x22d0ce){return _0x22d0ce[_0x0d7a('0x52')](_0x4385e2['body'][_0x0d7a('0x53')]||[]);}return null;})[_0x0d7a('0x41')](respondWithResult(_0x239bc0,null))[_0x0d7a('0x43')](handleError(_0x239bc0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6c645a5..19debf0 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 _0x63a5=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','ZendeskConfiguration','lodash','util'];(function(_0x256d97,_0x17b56d){var _0x487ee1=function(_0x4aa474){while(--_0x4aa474){_0x256d97['push'](_0x256d97['shift']());}};_0x487ee1(++_0x17b56d);}(_0x63a5,0x18e));var _0x563a=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x63a5[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var logger=require(_0x563a('0x2'))('api');var moment=require(_0x563a('0x3'));var BPromise=require('bluebird');var rp=require(_0x563a('0x4'));var fs=require('fs');var path=require(_0x563a('0x5'));var rimraf=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x1fdcb0,_0x5a6458){return _0x1fdcb0[_0x563a('0x8')](_0x563a('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0x7d25,0x8a));var _0x57d2=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x7d25[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 4ccccef..044d5b5 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 _0x803f=['request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x28540f,_0x2c3dae){var _0x2a1a2c=function(_0x52e742){while(--_0x52e742){_0x28540f['push'](_0x28540f['shift']());}};_0x2a1a2c(++_0x2c3dae);}(_0x803f,0x13c));var _0xf803=function(_0xf960fc,_0x5a91dc){_0xf960fc=_0xf960fc-0x0;var _0x27a0d3=_0x803f[_0xf960fc];return _0x27a0d3;};'use strict';var _=require('lodash');var util=require(_0xf803('0x0'));var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require(_0xf803('0x3'));var fs=require('fs');var Redis=require(_0xf803('0x4'));var db=require(_0xf803('0x5'))['db'];var utils=require(_0xf803('0x6'));var logger=require(_0xf803('0x7'))('rpc');var config=require(_0xf803('0x8'));var jayson=require(_0xf803('0x9'));var client=jayson[_0xf803('0xa')][_0xf803('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fb517,_0xe849b1,_0x2e2850){return new BPromise(function(_0x3b407e,_0x4cff45){return client[_0xf803('0xc')](_0x4fb517,_0x2e2850)['then'](function(_0x20dff5){logger['info'](_0xf803('0xd'),_0xe849b1,_0xf803('0xe'));logger['debug'](_0xf803('0xf'),_0xe849b1,_0xf803('0xe'),JSON[_0xf803('0x10')](_0x20dff5));if(_0x20dff5[_0xf803('0x11')]){if(_0x20dff5[_0xf803('0x11')][_0xf803('0x12')]===0x1f4){logger[_0xf803('0x11')](_0xf803('0xd'),_0xe849b1,_0x20dff5['error'][_0xf803('0x13')]);return _0x4cff45(_0x20dff5['error'][_0xf803('0x13')]);}logger[_0xf803('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe849b1,_0x20dff5[_0xf803('0x11')][_0xf803('0x13')]);return _0x3b407e(_0x20dff5[_0xf803('0x11')][_0xf803('0x13')]);}else{logger['info'](_0xf803('0xd'),_0xe849b1,_0xf803('0xe'));_0x3b407e(_0x20dff5[_0xf803('0x14')]['message']);}})[_0xf803('0x15')](function(_0x2bf2f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xe849b1,_0x2bf2f4);_0x4cff45(_0x2bf2f4);});});} \ No newline at end of file +var _0x29db=['request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x511129,_0x5c6ac0){var _0x58fcd9=function(_0x4d8c3b){while(--_0x4d8c3b){_0x511129['push'](_0x511129['shift']());}};_0x58fcd9(++_0x5c6ac0);}(_0x29db,0x6b));var _0xb29d=function(_0x28d169,_0x34d2da){_0x28d169=_0x28d169-0x0;var _0x4fd7c0=_0x29db[_0x28d169];return _0x4fd7c0;};'use strict';var _=require('lodash');var util=require(_0xb29d('0x0'));var moment=require(_0xb29d('0x1'));var BPromise=require(_0xb29d('0x2'));var rs=require(_0xb29d('0x3'));var fs=require('fs');var Redis=require(_0xb29d('0x4'));var db=require(_0xb29d('0x5'))['db'];var utils=require(_0xb29d('0x6'));var logger=require(_0xb29d('0x7'))(_0xb29d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb29d('0x9')][_0xb29d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x160459,_0x798e81,_0x2c7672){return new BPromise(function(_0x44e17b,_0x2fb28b){return client['request'](_0x160459,_0x2c7672)['then'](function(_0x2b0ec0){logger[_0xb29d('0xb')](_0xb29d('0xc'),_0x798e81,_0xb29d('0xd'));logger['debug'](_0xb29d('0xe'),_0x798e81,_0xb29d('0xd'),JSON[_0xb29d('0xf')](_0x2b0ec0));if(_0x2b0ec0['error']){if(_0x2b0ec0['error'][_0xb29d('0x10')]===0x1f4){logger[_0xb29d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x798e81,_0x2b0ec0[_0xb29d('0x11')][_0xb29d('0x12')]);return _0x2fb28b(_0x2b0ec0['error']['message']);}logger[_0xb29d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x798e81,_0x2b0ec0[_0xb29d('0x11')][_0xb29d('0x12')]);return _0x44e17b(_0x2b0ec0[_0xb29d('0x11')][_0xb29d('0x12')]);}else{logger['info'](_0xb29d('0xc'),_0x798e81,_0xb29d('0xd'));_0x44e17b(_0x2b0ec0['result']['message']);}})[_0xb29d('0x13')](function(_0x3f9a39){logger[_0xb29d('0x11')](_0xb29d('0xc'),_0x798e81,_0x3f9a39);_0x2fb28b(_0x3f9a39);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5cb9b43..079eaa4 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 _0xc565=['../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x51b659,_0x14192b){var _0x5401b8=function(_0x281bb4){while(--_0x281bb4){_0x51b659['push'](_0x51b659['shift']());}};_0x5401b8(++_0x14192b);}(_0xc565,0xd9));var _0x5c56=function(_0x2d2575,_0xa9e45){_0x2d2575=_0x2d2575-0x0;var _0x3489a1=_0xc565[_0x2d2575];return _0x3489a1;};'use strict';var multer=require(_0x5c56('0x0'));var util=require(_0x5c56('0x1'));var path=require('path');var timeout=require(_0x5c56('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5c56('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5c56('0x4'));var config=require('../../config/environment');var controller=require(_0x5c56('0x5'));router[_0x5c56('0x6')]('/',auth[_0x5c56('0x7')](),controller[_0x5c56('0x8')]);router[_0x5c56('0x6')]('/:id',auth[_0x5c56('0x7')](),controller[_0x5c56('0x9')]);router[_0x5c56('0xa')]('/',auth[_0x5c56('0x7')](),controller[_0x5c56('0xb')]);router[_0x5c56('0xc')](_0x5c56('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5c56('0xe')](_0x5c56('0xd'),auth[_0x5c56('0x7')](),controller[_0x5c56('0xf')]);module[_0x5c56('0x10')]=router; \ No newline at end of file +var _0xf625=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3d6e68,_0x455d10){var _0x51f6e4=function(_0x1d067c){while(--_0x1d067c){_0x3d6e68['push'](_0x3d6e68['shift']());}};_0x51f6e4(++_0x455d10);}(_0xf625,0x6c));var _0x5f62=function(_0x44db60,_0x4ec8ca){_0x44db60=_0x44db60-0x0;var _0x3fa929=_0xf625[_0x44db60];return _0x3fa929;};'use strict';var multer=require(_0x5f62('0x0'));var util=require(_0x5f62('0x1'));var path=require(_0x5f62('0x2'));var timeout=require(_0x5f62('0x3'));var express=require(_0x5f62('0x4'));var router=express[_0x5f62('0x5')]();var fs_extra=require(_0x5f62('0x6'));var auth=require(_0x5f62('0x7'));var interaction=require(_0x5f62('0x8'));var config=require(_0x5f62('0x9'));var controller=require(_0x5f62('0xa'));router[_0x5f62('0xb')]('/',auth['isAuthenticated'](),controller[_0x5f62('0xc')]);router['get'](_0x5f62('0xd'),auth['isAuthenticated'](),controller[_0x5f62('0xe')]);router[_0x5f62('0xf')]('/',auth[_0x5f62('0x10')](),controller[_0x5f62('0x11')]);router[_0x5f62('0x12')](_0x5f62('0xd'),auth['isAuthenticated'](),controller[_0x5f62('0x13')]);router[_0x5f62('0x14')](_0x5f62('0xd'),auth[_0x5f62('0x10')](),controller[_0x5f62('0x15')]);module[_0x5f62('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 19fd82a..d4f6b7e 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 _0xb084=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0xb084,0x195));var _0x4b08=function(_0x1638e6,_0x468be6){_0x1638e6=_0x1638e6-0x0;var _0x16913c=_0xb084[_0x1638e6];return _0x16913c;};'use strict';var Sequelize=require('sequelize');module[_0x4b08('0x0')]={'type':{'type':Sequelize[_0x4b08('0x1')](_0x4b08('0x2'),_0x4b08('0x3'),_0x4b08('0x4'),_0x4b08('0x5'),_0x4b08('0x6')),'defaultValue':_0x4b08('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4b08('0x7')]},'keyType':{'type':Sequelize[_0x4b08('0x1')](_0x4b08('0x2'),_0x4b08('0x3'),_0x4b08('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4b08('0x7')]},'nameField':{'type':Sequelize[_0x4b08('0x7')]},'customField':{'type':Sequelize[_0x4b08('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3003=['picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x413b63,_0x43a3c2){var _0x31da6e=function(_0x3b921e){while(--_0x3b921e){_0x413b63['push'](_0x413b63['shift']());}};_0x31da6e(++_0x43a3c2);}(_0x3003,0x11b));var _0x3300=function(_0x30e423,_0x407e47){_0x30e423=_0x30e423-0x0;var _0x4f9fef=_0x3003[_0x30e423];return _0x4f9fef;};'use strict';var Sequelize=require(_0x3300('0x0'));module[_0x3300('0x1')]={'type':{'type':Sequelize[_0x3300('0x2')](_0x3300('0x3'),_0x3300('0x4'),'customVariable','keyValue',_0x3300('0x5')),'defaultValue':_0x3300('0x3')},'content':{'type':Sequelize[_0x3300('0x6')]},'key':{'type':Sequelize[_0x3300('0x6')]},'keyType':{'type':Sequelize[_0x3300('0x2')](_0x3300('0x3'),_0x3300('0x4'),_0x3300('0x7'))},'keyContent':{'type':Sequelize[_0x3300('0x6')]},'idField':{'type':Sequelize[_0x3300('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3300('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 4cefc86..64c6cb5 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 _0x641a=['rows','catch','show','keys','intersection','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','nolimit','order','sort','where','merge','options','includeAll','include'];(function(_0x4b1ac1,_0x4ad3ef){var _0x4911b2=function(_0x212f93){while(--_0x212f93){_0x4b1ac1['push'](_0x4b1ac1['shift']());}};_0x4911b2(++_0x4ad3ef);}(_0x641a,0xde));var _0xa641=function(_0x25a52e,_0x260b10){_0x25a52e=_0x25a52e-0x0;var _0x2ea938=_0x641a[_0x25a52e];return _0x2ea938;};'use strict';var emlformat=require(_0xa641('0x0'));var rimraf=require(_0xa641('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa641('0x2'));var rp=require(_0xa641('0x3'));var moment=require(_0xa641('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa641('0x5'));var util=require(_0xa641('0x6'));var path=require('path');var sox=require(_0xa641('0x7'));var csv=require(_0xa641('0x8'));var ejs=require(_0xa641('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa641('0xa'));var squel=require('squel');var crypto=require(_0xa641('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa641('0xc'));var toCsv=require(_0xa641('0x8'));var querystring=require('querystring');var Papa=require(_0xa641('0xd'));var Redis=require('ioredis');var authService=require(_0xa641('0xe'));var qs=require(_0xa641('0xf'));var as=require(_0xa641('0x10'));var hardwareService=require(_0xa641('0x11'));var logger=require(_0xa641('0x12'))(_0xa641('0x13'));var utils=require(_0xa641('0x14'));var config=require(_0xa641('0x15'));var licenseUtil=require(_0xa641('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58692f,_0x2dbf79){_0x2dbf79=_0x2dbf79||0xcc;return function(_0x382e8b){if(_0x382e8b){return _0x58692f[_0xa641('0x17')](_0x2dbf79);}return _0x58692f[_0xa641('0x18')](_0x2dbf79)[_0xa641('0x19')]();};}function respondWithResult(_0x13f948,_0x29f55a){_0x29f55a=_0x29f55a||0xc8;return function(_0x2cd865){if(_0x2cd865){return _0x13f948['status'](_0x29f55a)['json'](_0x2cd865);}};}function respondWithFilteredResult(_0x86e15,_0x5b29d9){return function(_0x472ff5){if(_0x472ff5){var _0x40570b=typeof _0x5b29d9[_0xa641('0x1a')]==='undefined'&&typeof _0x5b29d9[_0xa641('0x1b')]===_0xa641('0x1c');var _0x5c533a=_0x472ff5[_0xa641('0x1d')];var _0x5b4140=_0x40570b?0x0:_0x5b29d9[_0xa641('0x1a')];var _0x2de1ba=_0x40570b?_0x472ff5[_0xa641('0x1d')]:_0x5b29d9[_0xa641('0x1a')]+_0x5b29d9[_0xa641('0x1b')];var _0x2d7172;if(_0x2de1ba>=_0x5c533a){_0x2de1ba=_0x5c533a;_0x2d7172=0xc8;}else{_0x2d7172=0xce;}_0x86e15[_0xa641('0x18')](_0x2d7172);return _0x86e15[_0xa641('0x1e')](_0xa641('0x1f'),_0x5b4140+'-'+_0x2de1ba+'/'+_0x5c533a)[_0xa641('0x20')](_0x472ff5);}return null;};}function patchUpdates(_0xdd6eb2){return function(_0x33a379){try{jsonpatch[_0xa641('0x21')](_0x33a379,_0xdd6eb2,!![]);}catch(_0x4e7c95){return BPromise['reject'](_0x4e7c95);}return _0x33a379[_0xa641('0x22')]();};}function saveUpdates(_0x32953e,_0x4a9962){return function(_0x5c6546){if(_0x5c6546){return _0x5c6546[_0xa641('0x23')](_0x32953e)['then'](function(_0x268a9d){return _0x268a9d;});}return null;};}function removeEntity(_0x3152b0,_0x30008e){return function(_0x377e7c){if(_0x377e7c){return _0x377e7c[_0xa641('0x24')]()[_0xa641('0x25')](function(){_0x3152b0[_0xa641('0x18')](0xcc)[_0xa641('0x19')]();});}};}function handleEntityNotFound(_0x2e4814,_0x4c5886){return function(_0x47e26e){if(!_0x47e26e){_0x2e4814[_0xa641('0x17')](0x194);}return _0x47e26e;};}function handleError(_0x121bb1,_0x1a0d8c){_0x1a0d8c=_0x1a0d8c||0x1f4;return function(_0x27b633){logger[_0xa641('0x26')](_0x27b633[_0xa641('0x27')]);if(_0x27b633[_0xa641('0x28')]){delete _0x27b633[_0xa641('0x28')];}_0x121bb1[_0xa641('0x18')](_0x1a0d8c)['send'](_0x27b633);};}exports[_0xa641('0x29')]=function(_0x21c29d,_0xaee5d2){var _0xd58812={},_0x2d917c={},_0x4a8004={'count':0x0,'rows':[]};var _0x124491=_[_0xa641('0x2a')](db[_0xa641('0x2b')][_0xa641('0x2c')],function(_0x2c9c54){return{'name':_0x2c9c54[_0xa641('0x2d')],'type':_0x2c9c54[_0xa641('0x2e')][_0xa641('0x2f')]};});_0x2d917c[_0xa641('0x30')]=_[_0xa641('0x2a')](_0x124491,'name');_0x2d917c['query']=_['keys'](_0x21c29d['query']);_0x2d917c[_0xa641('0x31')]=_['intersection'](_0x2d917c[_0xa641('0x30')],_0x2d917c[_0xa641('0x32')]);_0xd58812[_0xa641('0x33')]=_['intersection'](_0x2d917c['model'],qs['fields'](_0x21c29d['query'][_0xa641('0x34')]));_0xd58812['attributes']=_0xd58812[_0xa641('0x33')][_0xa641('0x35')]?_0xd58812[_0xa641('0x33')]:_0x2d917c[_0xa641('0x30')];if(!_0x21c29d[_0xa641('0x32')]['hasOwnProperty'](_0xa641('0x36'))){_0xd58812[_0xa641('0x1b')]=qs[_0xa641('0x1b')](_0x21c29d['query']['limit']);_0xd58812[_0xa641('0x1a')]=qs[_0xa641('0x1a')](_0x21c29d[_0xa641('0x32')]['offset']);}_0xd58812[_0xa641('0x37')]=qs['sort'](_0x21c29d[_0xa641('0x32')][_0xa641('0x38')]);_0xd58812[_0xa641('0x39')]=qs['filters'](_['pick'](_0x21c29d['query'],_0x2d917c['filters']),_0x124491);if(_0x21c29d[_0xa641('0x32')]['filter']){_0xd58812['where']=_['merge'](_0xd58812[_0xa641('0x39')],{'$or':_[_0xa641('0x2a')](_0x124491,function(_0x502fac){if(_0x502fac[_0xa641('0x2e')]!=='VIRTUAL'){var _0x4d1709={};_0x4d1709[_0x502fac[_0xa641('0x28')]]={'$like':'%'+_0x21c29d[_0xa641('0x32')]['filter']+'%'};return _0x4d1709;}})});}_0xd58812=_[_0xa641('0x3a')]({},_0xd58812,_0x21c29d[_0xa641('0x3b')]);var _0x597f43={'where':_0xd58812[_0xa641('0x39')]};return db[_0xa641('0x2b')][_0xa641('0x1d')](_0x597f43)['then'](function(_0xb535d1){_0x4a8004[_0xa641('0x1d')]=_0xb535d1;if(_0x21c29d['query'][_0xa641('0x3c')]){_0xd58812[_0xa641('0x3d')]=[{'all':!![]}];}return db[_0xa641('0x2b')]['findAll'](_0xd58812);})[_0xa641('0x25')](function(_0x521c9e){_0x4a8004[_0xa641('0x3e')]=_0x521c9e;return _0x4a8004;})['then'](respondWithFilteredResult(_0xaee5d2,_0xd58812))[_0xa641('0x3f')](handleError(_0xaee5d2,null));};exports[_0xa641('0x40')]=function(_0x5f1add,_0x51f2ae){var _0x327473={'raw':!![],'where':{'id':_0x5f1add['params']['id']}},_0x40773d={};_0x40773d[_0xa641('0x30')]=_[_0xa641('0x41')](db[_0xa641('0x2b')][_0xa641('0x2c')]);_0x40773d[_0xa641('0x32')]=_['keys'](_0x5f1add[_0xa641('0x32')]);_0x40773d[_0xa641('0x31')]=_[_0xa641('0x42')](_0x40773d[_0xa641('0x30')],_0x40773d['query']);_0x327473[_0xa641('0x33')]=_[_0xa641('0x42')](_0x40773d[_0xa641('0x30')],qs[_0xa641('0x34')](_0x5f1add[_0xa641('0x32')][_0xa641('0x34')]));_0x327473[_0xa641('0x33')]=_0x327473[_0xa641('0x33')][_0xa641('0x35')]?_0x327473['attributes']:_0x40773d['model'];if(_0x5f1add['query'][_0xa641('0x3c')]){_0x327473[_0xa641('0x3d')]=[{'all':!![]}];}_0x327473=_[_0xa641('0x3a')]({},_0x327473,_0x5f1add['options']);return db[_0xa641('0x2b')][_0xa641('0x43')](_0x327473)[_0xa641('0x25')](handleEntityNotFound(_0x51f2ae,null))[_0xa641('0x25')](respondWithResult(_0x51f2ae,null))[_0xa641('0x3f')](handleError(_0x51f2ae,null));};exports[_0xa641('0x44')]=function(_0x5ac094,_0x5c71ee){return db['ZendeskField'][_0xa641('0x44')](_0x5ac094['body'],{})[_0xa641('0x25')](respondWithResult(_0x5c71ee,0xc9))[_0xa641('0x3f')](handleError(_0x5c71ee,null));};exports[_0xa641('0x23')]=function(_0xb8735,_0x5a1c91){if(_0xb8735[_0xa641('0x45')]['id']){delete _0xb8735['body']['id'];}return db[_0xa641('0x2b')][_0xa641('0x43')]({'where':{'id':_0xb8735['params']['id']}})['then'](handleEntityNotFound(_0x5a1c91,null))[_0xa641('0x25')](saveUpdates(_0xb8735[_0xa641('0x45')],null))['then'](respondWithResult(_0x5a1c91,null))[_0xa641('0x3f')](handleError(_0x5a1c91,null));};exports[_0xa641('0x24')]=function(_0xe00407,_0x7bf0e9){return db[_0xa641('0x2b')]['find']({'where':{'id':_0xe00407[_0xa641('0x46')]['id']}})[_0xa641('0x25')](handleEntityNotFound(_0x7bf0e9,null))[_0xa641('0x25')](removeEntity(_0x7bf0e9,null))[_0xa641('0x3f')](handleError(_0x7bf0e9,null));}; \ No newline at end of file +var _0x6a55=['stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','includeAll','findAll','show','keys','include','merge','options','find','catch','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','reject','save','update','then','end','error'];(function(_0x459439,_0x114e12){var _0x4965e3=function(_0x56fd46){while(--_0x56fd46){_0x459439['push'](_0x459439['shift']());}};_0x4965e3(++_0x114e12);}(_0x6a55,0x154));var _0x56a5=function(_0x2cbec0,_0x262fef){_0x2cbec0=_0x2cbec0-0x0;var _0x3d4101=_0x6a55[_0x2cbec0];return _0x3d4101;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56a5('0x1'));var jsonpatch=require(_0x56a5('0x2'));var rp=require('request-promise');var moment=require(_0x56a5('0x3'));var BPromise=require(_0x56a5('0x4'));var Mustache=require(_0x56a5('0x5'));var util=require(_0x56a5('0x6'));var path=require(_0x56a5('0x7'));var sox=require(_0x56a5('0x8'));var csv=require(_0x56a5('0x9'));var ejs=require(_0x56a5('0xa'));var fs=require('fs');var fs_extra=require(_0x56a5('0xb'));var _=require(_0x56a5('0xc'));var squel=require(_0x56a5('0xd'));var crypto=require(_0x56a5('0xe'));var jsforce=require(_0x56a5('0xf'));var deskjs=require(_0x56a5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0x11'));var Papa=require(_0x56a5('0x12'));var Redis=require('ioredis');var authService=require(_0x56a5('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56a5('0x14'));var logger=require(_0x56a5('0x15'))(_0x56a5('0x16'));var utils=require(_0x56a5('0x17'));var config=require(_0x56a5('0x18'));var licenseUtil=require(_0x56a5('0x19'));var db=require(_0x56a5('0x1a'))['db'];function respondWithStatusCode(_0x4b4dc7,_0x42dced){_0x42dced=_0x42dced||0xcc;return function(_0x5a80ed){if(_0x5a80ed){return _0x4b4dc7[_0x56a5('0x1b')](_0x42dced);}return _0x4b4dc7[_0x56a5('0x1c')](_0x42dced)['end']();};}function respondWithResult(_0x281d8b,_0x145174){_0x145174=_0x145174||0xc8;return function(_0x11f64d){if(_0x11f64d){return _0x281d8b[_0x56a5('0x1c')](_0x145174)['json'](_0x11f64d);}};}function respondWithFilteredResult(_0x3ad9d9,_0xdfce42){return function(_0x24cb7b){if(_0x24cb7b){var _0x466f52=typeof _0xdfce42[_0x56a5('0x1d')]===_0x56a5('0x1e')&&typeof _0xdfce42[_0x56a5('0x1f')]===_0x56a5('0x1e');var _0x26debc=_0x24cb7b['count'];var _0x52758f=_0x466f52?0x0:_0xdfce42[_0x56a5('0x1d')];var _0x4ed8dc=_0x466f52?_0x24cb7b[_0x56a5('0x20')]:_0xdfce42[_0x56a5('0x1d')]+_0xdfce42[_0x56a5('0x1f')];var _0x365150;if(_0x4ed8dc>=_0x26debc){_0x4ed8dc=_0x26debc;_0x365150=0xc8;}else{_0x365150=0xce;}_0x3ad9d9[_0x56a5('0x1c')](_0x365150);return _0x3ad9d9['set']('Content-Range',_0x52758f+'-'+_0x4ed8dc+'/'+_0x26debc)[_0x56a5('0x21')](_0x24cb7b);}return null;};}function patchUpdates(_0x5882cd){return function(_0x32b71f){try{jsonpatch['apply'](_0x32b71f,_0x5882cd,!![]);}catch(_0x3a8046){return BPromise[_0x56a5('0x22')](_0x3a8046);}return _0x32b71f[_0x56a5('0x23')]();};}function saveUpdates(_0x4cc2e2,_0x25eeb2){return function(_0x5bdefb){if(_0x5bdefb){return _0x5bdefb[_0x56a5('0x24')](_0x4cc2e2)['then'](function(_0x5749ea){return _0x5749ea;});}return null;};}function removeEntity(_0x1228af,_0x488b2a){return function(_0x2cc3c0){if(_0x2cc3c0){return _0x2cc3c0['destroy']()[_0x56a5('0x25')](function(){_0x1228af[_0x56a5('0x1c')](0xcc)[_0x56a5('0x26')]();});}};}function handleEntityNotFound(_0x587d78,_0x38b5e0){return function(_0x2950f6){if(!_0x2950f6){_0x587d78['sendStatus'](0x194);}return _0x2950f6;};}function handleError(_0x1a0dec,_0x3cb7ae){_0x3cb7ae=_0x3cb7ae||0x1f4;return function(_0x3dfdaf){logger[_0x56a5('0x27')](_0x3dfdaf[_0x56a5('0x28')]);if(_0x3dfdaf[_0x56a5('0x29')]){delete _0x3dfdaf['name'];}_0x1a0dec[_0x56a5('0x1c')](_0x3cb7ae)['send'](_0x3dfdaf);};}exports[_0x56a5('0x2a')]=function(_0x42b87b,_0x1355d6){var _0xb1e9c5={},_0x263188={},_0x2de197={'count':0x0,'rows':[]};var _0x512a48=_[_0x56a5('0x2b')](db[_0x56a5('0x2c')][_0x56a5('0x2d')],function(_0x5036cc){return{'name':_0x5036cc[_0x56a5('0x2e')],'type':_0x5036cc[_0x56a5('0x2f')]['key']};});_0x263188['model']=_[_0x56a5('0x2b')](_0x512a48,_0x56a5('0x29'));_0x263188[_0x56a5('0x30')]=_['keys'](_0x42b87b[_0x56a5('0x30')]);_0x263188['filters']=_[_0x56a5('0x31')](_0x263188[_0x56a5('0x32')],_0x263188[_0x56a5('0x30')]);_0xb1e9c5[_0x56a5('0x33')]=_[_0x56a5('0x31')](_0x263188[_0x56a5('0x32')],qs['fields'](_0x42b87b['query'][_0x56a5('0x34')]));_0xb1e9c5[_0x56a5('0x33')]=_0xb1e9c5['attributes'][_0x56a5('0x35')]?_0xb1e9c5[_0x56a5('0x33')]:_0x263188[_0x56a5('0x32')];if(!_0x42b87b['query'][_0x56a5('0x36')](_0x56a5('0x37'))){_0xb1e9c5[_0x56a5('0x1f')]=qs[_0x56a5('0x1f')](_0x42b87b[_0x56a5('0x30')][_0x56a5('0x1f')]);_0xb1e9c5['offset']=qs[_0x56a5('0x1d')](_0x42b87b[_0x56a5('0x30')]['offset']);}_0xb1e9c5[_0x56a5('0x38')]=qs[_0x56a5('0x39')](_0x42b87b[_0x56a5('0x30')][_0x56a5('0x39')]);_0xb1e9c5['where']=qs[_0x56a5('0x3a')](_[_0x56a5('0x3b')](_0x42b87b[_0x56a5('0x30')],_0x263188[_0x56a5('0x3a')]),_0x512a48);if(_0x42b87b[_0x56a5('0x30')][_0x56a5('0x3c')]){_0xb1e9c5['where']=_['merge'](_0xb1e9c5[_0x56a5('0x3d')],{'$or':_[_0x56a5('0x2b')](_0x512a48,function(_0x268f9c){if(_0x268f9c[_0x56a5('0x2f')]!==_0x56a5('0x3e')){var _0x41bd0b={};_0x41bd0b[_0x268f9c['name']]={'$like':'%'+_0x42b87b[_0x56a5('0x30')][_0x56a5('0x3c')]+'%'};return _0x41bd0b;}})});}_0xb1e9c5=_['merge']({},_0xb1e9c5,_0x42b87b['options']);var _0xb44fb0={'where':_0xb1e9c5[_0x56a5('0x3d')]};return db['ZendeskField'][_0x56a5('0x20')](_0xb44fb0)[_0x56a5('0x25')](function(_0x47b3fa){_0x2de197[_0x56a5('0x20')]=_0x47b3fa;if(_0x42b87b[_0x56a5('0x30')][_0x56a5('0x3f')]){_0xb1e9c5['include']=[{'all':!![]}];}return db[_0x56a5('0x2c')][_0x56a5('0x40')](_0xb1e9c5);})['then'](function(_0x23bfa5){_0x2de197['rows']=_0x23bfa5;return _0x2de197;})[_0x56a5('0x25')](respondWithFilteredResult(_0x1355d6,_0xb1e9c5))['catch'](handleError(_0x1355d6,null));};exports[_0x56a5('0x41')]=function(_0x17fcee,_0x4431f7){var _0x5205b8={'raw':!![],'where':{'id':_0x17fcee['params']['id']}},_0x39ee9a={};_0x39ee9a[_0x56a5('0x32')]=_[_0x56a5('0x42')](db[_0x56a5('0x2c')][_0x56a5('0x2d')]);_0x39ee9a[_0x56a5('0x30')]=_[_0x56a5('0x42')](_0x17fcee[_0x56a5('0x30')]);_0x39ee9a[_0x56a5('0x3a')]=_['intersection'](_0x39ee9a[_0x56a5('0x32')],_0x39ee9a[_0x56a5('0x30')]);_0x5205b8['attributes']=_[_0x56a5('0x31')](_0x39ee9a[_0x56a5('0x32')],qs['fields'](_0x17fcee['query'][_0x56a5('0x34')]));_0x5205b8[_0x56a5('0x33')]=_0x5205b8[_0x56a5('0x33')][_0x56a5('0x35')]?_0x5205b8[_0x56a5('0x33')]:_0x39ee9a[_0x56a5('0x32')];if(_0x17fcee['query']['includeAll']){_0x5205b8[_0x56a5('0x43')]=[{'all':!![]}];}_0x5205b8=_[_0x56a5('0x44')]({},_0x5205b8,_0x17fcee[_0x56a5('0x45')]);return db['ZendeskField'][_0x56a5('0x46')](_0x5205b8)['then'](handleEntityNotFound(_0x4431f7,null))[_0x56a5('0x25')](respondWithResult(_0x4431f7,null))[_0x56a5('0x47')](handleError(_0x4431f7,null));};exports[_0x56a5('0x48')]=function(_0x2ecbaa,_0x37faf5){return db[_0x56a5('0x2c')][_0x56a5('0x48')](_0x2ecbaa[_0x56a5('0x49')],{})[_0x56a5('0x25')](respondWithResult(_0x37faf5,0xc9))['catch'](handleError(_0x37faf5,null));};exports[_0x56a5('0x24')]=function(_0xaaa40c,_0x5a8ba3){if(_0xaaa40c[_0x56a5('0x49')]['id']){delete _0xaaa40c[_0x56a5('0x49')]['id'];}return db[_0x56a5('0x2c')]['find']({'where':{'id':_0xaaa40c[_0x56a5('0x4a')]['id']}})[_0x56a5('0x25')](handleEntityNotFound(_0x5a8ba3,null))[_0x56a5('0x25')](saveUpdates(_0xaaa40c['body'],null))[_0x56a5('0x25')](respondWithResult(_0x5a8ba3,null))[_0x56a5('0x47')](handleError(_0x5a8ba3,null));};exports[_0x56a5('0x4b')]=function(_0x1b0c6f,_0x2b5f2a){return db[_0x56a5('0x2c')][_0x56a5('0x46')]({'where':{'id':_0x1b0c6f[_0x56a5('0x4a')]['id']}})[_0x56a5('0x25')](handleEntityNotFound(_0x2b5f2a,null))[_0x56a5('0x25')](removeEntity(_0x2b5f2a,null))[_0x56a5('0x47')](handleError(_0x2b5f2a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 120d4eb..78c7125 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 _0xcfed=['../../config/environment','./intZendeskField.attributes','exports','define','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x404175,_0x48519b){var _0xba0789=function(_0x4e8d21){while(--_0x4e8d21){_0x404175['push'](_0x404175['shift']());}};_0xba0789(++_0x48519b);}(_0xcfed,0x179));var _0xdcfe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xcfed[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xdcfe('0x0'));var util=require('util');var logger=require(_0xdcfe('0x1'))('api');var moment=require(_0xdcfe('0x2'));var BPromise=require(_0xdcfe('0x3'));var rp=require(_0xdcfe('0x4'));var fs=require('fs');var path=require(_0xdcfe('0x5'));var rimraf=require(_0xdcfe('0x6'));var config=require(_0xdcfe('0x7'));var attributes=require(_0xdcfe('0x8'));module[_0xdcfe('0x9')]=function(_0x28c075,_0x42837f){return _0x28c075[_0xdcfe('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xdcfe('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a2=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField'];(function(_0x1f4ad5,_0x51598b){var _0x17b098=function(_0x1b5bdc){while(--_0x1b5bdc){_0x1f4ad5['push'](_0x1f4ad5['shift']());}};_0x17b098(++_0x51598b);}(_0xf0a2,0x184));var _0x2f0a=function(_0x2a5cd7,_0x3c4fd7){_0x2a5cd7=_0x2a5cd7-0x0;var _0x39ceee=_0xf0a2[_0x2a5cd7];return _0x39ceee;};'use strict';var _=require(_0x2f0a('0x0'));var util=require(_0x2f0a('0x1'));var logger=require(_0x2f0a('0x2'))(_0x2f0a('0x3'));var moment=require(_0x2f0a('0x4'));var BPromise=require(_0x2f0a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f0a('0x6'));var rimraf=require(_0x2f0a('0x7'));var config=require(_0x2f0a('0x8'));var attributes=require(_0x2f0a('0x9'));module[_0x2f0a('0xa')]=function(_0x6f65,_0x1336c8){return _0x6f65['define'](_0x2f0a('0xb'),attributes,{'tableName':_0x2f0a('0xc'),'paranoid':![],'indexes':[{'name':_0x2f0a('0xd'),'fields':[_0x2f0a('0xe'),_0x2f0a('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 7e4988e..9d991de 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 _0x0479=['request\x20sent','debug','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s'];(function(_0x557df1,_0x4f2eda){var _0x17ded5=function(_0x5b9121){while(--_0x5b9121){_0x557df1['push'](_0x557df1['shift']());}};_0x17ded5(++_0x4f2eda);}(_0x0479,0x66));var _0x9047=function(_0x3333e5,_0x1e3a62){_0x3333e5=_0x3333e5-0x0;var _0x1091d2=_0x0479[_0x3333e5];return _0x1091d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9047('0x0'));var BPromise=require('bluebird');var rs=require(_0x9047('0x1'));var fs=require('fs');var Redis=require(_0x9047('0x2'));var db=require(_0x9047('0x3'))['db'];var utils=require(_0x9047('0x4'));var logger=require(_0x9047('0x5'))('rpc');var config=require(_0x9047('0x6'));var jayson=require(_0x9047('0x7'));var client=jayson['client'][_0x9047('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x105c3a,_0x8fcc3c,_0x385e19){return new BPromise(function(_0x108a97,_0x1ff4f7){return client[_0x9047('0x9')](_0x105c3a,_0x385e19)['then'](function(_0x3982e5){logger[_0x9047('0xa')](_0x9047('0xb'),_0x8fcc3c,_0x9047('0xc'));logger[_0x9047('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x8fcc3c,_0x9047('0xc'),JSON[_0x9047('0xe')](_0x3982e5));if(_0x3982e5[_0x9047('0xf')]){if(_0x3982e5[_0x9047('0xf')]['code']===0x1f4){logger[_0x9047('0xf')](_0x9047('0xb'),_0x8fcc3c,_0x3982e5['error'][_0x9047('0x10')]);return _0x1ff4f7(_0x3982e5[_0x9047('0xf')][_0x9047('0x10')]);}logger[_0x9047('0xf')](_0x9047('0xb'),_0x8fcc3c,_0x3982e5[_0x9047('0xf')][_0x9047('0x10')]);return _0x108a97(_0x3982e5[_0x9047('0xf')]['message']);}else{logger[_0x9047('0xa')](_0x9047('0xb'),_0x8fcc3c,'request\x20sent');_0x108a97(_0x3982e5[_0x9047('0x11')][_0x9047('0x10')]);}})[_0x9047('0x12')](function(_0x54d054){logger['error']('ZendeskField,\x20%s,\x20%s',_0x8fcc3c,_0x54d054);_0x1ff4f7(_0x54d054);});});} \ No newline at end of file +var _0x88a0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0x2e9c6d,_0xbecdb4){var _0x139a4f=function(_0x58566b){while(--_0x58566b){_0x2e9c6d['push'](_0x2e9c6d['shift']());}};_0x139a4f(++_0xbecdb4);}(_0x88a0,0x1e0));var _0x088a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x88a0[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x088a('0x0'));var util=require('util');var moment=require(_0x088a('0x1'));var BPromise=require(_0x088a('0x2'));var rs=require(_0x088a('0x3'));var fs=require('fs');var Redis=require(_0x088a('0x4'));var db=require(_0x088a('0x5'))['db'];var utils=require(_0x088a('0x6'));var logger=require(_0x088a('0x7'))(_0x088a('0x8'));var config=require(_0x088a('0x9'));var jayson=require(_0x088a('0xa'));var client=jayson[_0x088a('0xb')][_0x088a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd43cda,_0x1f22d3,_0x5627b0){return new BPromise(function(_0x18e641,_0x3700fe){return client[_0x088a('0xd')](_0xd43cda,_0x5627b0)['then'](function(_0x103761){logger[_0x088a('0xe')](_0x088a('0xf'),_0x1f22d3,_0x088a('0x10'));logger[_0x088a('0x11')](_0x088a('0x12'),_0x1f22d3,_0x088a('0x10'),JSON['stringify'](_0x103761));if(_0x103761[_0x088a('0x13')]){if(_0x103761[_0x088a('0x13')]['code']===0x1f4){logger[_0x088a('0x13')](_0x088a('0xf'),_0x1f22d3,_0x103761['error'][_0x088a('0x14')]);return _0x3700fe(_0x103761[_0x088a('0x13')][_0x088a('0x14')]);}logger[_0x088a('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1f22d3,_0x103761[_0x088a('0x13')][_0x088a('0x14')]);return _0x18e641(_0x103761[_0x088a('0x13')][_0x088a('0x14')]);}else{logger['info'](_0x088a('0xf'),_0x1f22d3,'request\x20sent');_0x18e641(_0x103761[_0x088a('0x15')][_0x088a('0x14')]);}})[_0x088a('0x16')](function(_0x254d35){logger[_0x088a('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1f22d3,_0x254d35);_0x3700fe(_0x254d35);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e619070..67968fd 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 _0x5397=['getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x19a5b4,_0x23e41f){var _0x18b706=function(_0x2fba65){while(--_0x2fba65){_0x19a5b4['push'](_0x19a5b4['shift']());}};_0x18b706(++_0x23e41f);}(_0x5397,0x14d));var _0x7539=function(_0x408357,_0x56042b){_0x408357=_0x408357-0x0;var _0x55812f=_0x5397[_0x408357];return _0x55812f;};'use strict';var multer=require(_0x7539('0x0'));var util=require(_0x7539('0x1'));var path=require(_0x7539('0x2'));var timeout=require(_0x7539('0x3'));var express=require(_0x7539('0x4'));var router=express[_0x7539('0x5')]();var fs_extra=require(_0x7539('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7539('0x7'));var config=require(_0x7539('0x8'));var controller=require(_0x7539('0x9'));router[_0x7539('0xa')]('/',auth[_0x7539('0xb')](),controller['index']);router['get'](_0x7539('0xc'),auth[_0x7539('0xb')](),controller[_0x7539('0xd')]);router[_0x7539('0xa')](_0x7539('0xe'),auth[_0x7539('0xb')](),controller[_0x7539('0xf')]);router['get'](_0x7539('0x10'),auth[_0x7539('0xb')](),controller[_0x7539('0x11')]);router[_0x7539('0x12')]('/',auth[_0x7539('0xb')](),controller[_0x7539('0x13')]);router[_0x7539('0x12')](_0x7539('0xe'),auth[_0x7539('0xb')](),controller[_0x7539('0x14')]);router[_0x7539('0x15')](_0x7539('0xc'),auth[_0x7539('0xb')](),controller[_0x7539('0x16')]);router[_0x7539('0x17')](_0x7539('0xc'),auth['isAuthenticated'](),controller[_0x7539('0x18')]);module['exports']=router; \ No newline at end of file +var _0xc3ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','multer','connect-timeout','express','Router'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xc3ef,0x122));var _0xfc3e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc3ef[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xfc3e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfc3e('0x1'));var express=require(_0xfc3e('0x2'));var router=express[_0xfc3e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc3e('0x4'));var interaction=require(_0xfc3e('0x5'));var config=require(_0xfc3e('0x6'));var controller=require('./intZohoAccount.controller');router[_0xfc3e('0x7')]('/',auth[_0xfc3e('0x8')](),controller[_0xfc3e('0x9')]);router['get'](_0xfc3e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xfc3e('0x7')](_0xfc3e('0xb'),auth[_0xfc3e('0x8')](),controller[_0xfc3e('0xc')]);router[_0xfc3e('0x7')](_0xfc3e('0xd'),auth[_0xfc3e('0x8')](),controller[_0xfc3e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfc3e('0xf')]);router[_0xfc3e('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfc3e('0x11')]);router[_0xfc3e('0x12')](_0xfc3e('0xa'),auth[_0xfc3e('0x8')](),controller[_0xfc3e('0x13')]);router['delete'](_0xfc3e('0xa'),auth[_0xfc3e('0x8')](),controller[_0xfc3e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e435a6a..0c317fa 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 _0xf109=['exports','STRING','sequelize'];(function(_0x5141a1,_0x548c6b){var _0x287fe0=function(_0x4d4912){while(--_0x4d4912){_0x5141a1['push'](_0x5141a1['shift']());}};_0x287fe0(++_0x548c6b);}(_0xf109,0xce));var _0x9f10=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xf109[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file +var _0xb903=['exports','STRING','sequelize'];(function(_0x2754c2,_0x10ceb4){var _0x4d5454=function(_0x4e90d2){while(--_0x4e90d2){_0x2754c2['push'](_0x2754c2['shift']());}};_0x4d5454(++_0x10ceb4);}(_0xb903,0x185));var _0x3b90=function(_0x43126c,_0x4ee5de){_0x43126c=_0x43126c-0x0;var _0x334a0f=_0xb903[_0x43126c];return _0x334a0f;};'use strict';var Sequelize=require(_0x3b90('0x0'));module[_0x3b90('0x1')]={'name':{'type':Sequelize[_0x3b90('0x2')]},'description':{'type':Sequelize[_0x3b90('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x3b90('0x2')]},'clientId':{'type':Sequelize[_0x3b90('0x2')]},'clientSecret':{'type':Sequelize[_0x3b90('0x2')]},'serverUrl':{'type':Sequelize[_0x3b90('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x3b90('0x2')]},'refreshToken':{'type':Sequelize[_0x3b90('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 38bb96e..037d644 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 _0xbe59=['getFields','clientId','code','host','zoho.eu','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','push','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','ZohoAccount','rawAttributes','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','ZohoConfiguration','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0xbe59,0x1ad));var _0x9be5=function(_0x5b180f,_0x30b9f0){_0x5b180f=_0x5b180f-0x0;var _0x1c5b79=_0xbe59[_0x5b180f];return _0x1c5b79;};'use strict';var emlformat=require(_0x9be5('0x0'));var rimraf=require(_0x9be5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9be5('0x2'));var rp=require(_0x9be5('0x3'));var moment=require(_0x9be5('0x4'));var BPromise=require(_0x9be5('0x5'));var Mustache=require(_0x9be5('0x6'));var util=require(_0x9be5('0x7'));var path=require(_0x9be5('0x8'));var sox=require('sox');var csv=require(_0x9be5('0x9'));var ejs=require(_0x9be5('0xa'));var fs=require('fs');var fs_extra=require(_0x9be5('0xb'));var _=require(_0x9be5('0xc'));var squel=require('squel');var crypto=require(_0x9be5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9be5('0x9'));var querystring=require(_0x9be5('0xe'));var Papa=require(_0x9be5('0xf'));var Redis=require(_0x9be5('0x10'));var authService=require(_0x9be5('0x11'));var qs=require(_0x9be5('0x12'));var as=require(_0x9be5('0x13'));var hardwareService=require(_0x9be5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9be5('0x15'));var config=require(_0x9be5('0x16'));var licenseUtil=require(_0x9be5('0x17'));var db=require(_0x9be5('0x18'))['db'];var integrations=require(_0x9be5('0x19'));function respondWithStatusCode(_0x10e092,_0xbc6937){_0xbc6937=_0xbc6937||0xcc;return function(_0x243f47){if(_0x243f47){return _0x10e092[_0x9be5('0x1a')](_0xbc6937);}return _0x10e092[_0x9be5('0x1b')](_0xbc6937)[_0x9be5('0x1c')]();};}function respondWithResult(_0xedcd45,_0x5b014b){_0x5b014b=_0x5b014b||0xc8;return function(_0x1c5b55){if(_0x1c5b55){return _0xedcd45[_0x9be5('0x1b')](_0x5b014b)['json'](_0x1c5b55);}};}function respondWithFilteredResult(_0x3c5746,_0x4bee98){return function(_0x4b3f0d){if(_0x4b3f0d){var _0x17ce4c=typeof _0x4bee98[_0x9be5('0x1d')]===_0x9be5('0x1e')&&typeof _0x4bee98[_0x9be5('0x1f')]===_0x9be5('0x1e');var _0x5b90ab=_0x4b3f0d['count'];var _0x1c94d7=_0x17ce4c?0x0:_0x4bee98[_0x9be5('0x1d')];var _0x2ae78a=_0x17ce4c?_0x4b3f0d[_0x9be5('0x20')]:_0x4bee98[_0x9be5('0x1d')]+_0x4bee98[_0x9be5('0x1f')];var _0xe23540;if(_0x2ae78a>=_0x5b90ab){_0x2ae78a=_0x5b90ab;_0xe23540=0xc8;}else{_0xe23540=0xce;}_0x3c5746[_0x9be5('0x1b')](_0xe23540);return _0x3c5746[_0x9be5('0x21')](_0x9be5('0x22'),_0x1c94d7+'-'+_0x2ae78a+'/'+_0x5b90ab)[_0x9be5('0x23')](_0x4b3f0d);}return null;};}function patchUpdates(_0x4b8c03){return function(_0x5ec542){try{jsonpatch['apply'](_0x5ec542,_0x4b8c03,!![]);}catch(_0x454161){return BPromise[_0x9be5('0x24')](_0x454161);}return _0x5ec542[_0x9be5('0x25')]();};}function saveUpdates(_0x12fbd3,_0x41b8f6){return function(_0x3fc19a){if(_0x3fc19a){return _0x3fc19a[_0x9be5('0x26')](_0x12fbd3)[_0x9be5('0x27')](function(_0xa4597b){return _0xa4597b;});}return null;};}function removeEntity(_0x4eeea8,_0x2dd869){return function(_0x38612b){if(_0x38612b){return _0x38612b[_0x9be5('0x28')]()['then'](function(){_0x4eeea8[_0x9be5('0x1b')](0xcc)[_0x9be5('0x1c')]();});}};}function handleEntityNotFound(_0x5f32c9,_0x22d337){return function(_0x2ea599){if(!_0x2ea599){_0x5f32c9['sendStatus'](0x194);}return _0x2ea599;};}function handleError(_0x24d2d5,_0x426b4a){_0x426b4a=_0x426b4a||0x1f4;return function(_0x18721e){logger[_0x9be5('0x29')](_0x18721e[_0x9be5('0x2a')]);if(_0x18721e[_0x9be5('0x2b')]){delete _0x18721e[_0x9be5('0x2b')];}_0x24d2d5['status'](_0x426b4a)['send'](_0x18721e);};}exports[_0x9be5('0x2c')]=function(_0x3c5d5b,_0x5adc29){var _0x30502f={},_0x2cc008={},_0x1d211f={'count':0x0,'rows':[]};var _0x5adb10=_[_0x9be5('0x2d')](db[_0x9be5('0x2e')][_0x9be5('0x2f')],function(_0x2d3eba){return{'name':_0x2d3eba['fieldName'],'type':_0x2d3eba['type'][_0x9be5('0x30')]};});_0x2cc008['model']=_['map'](_0x5adb10,_0x9be5('0x2b'));_0x2cc008[_0x9be5('0x31')]=_[_0x9be5('0x32')](_0x3c5d5b[_0x9be5('0x31')]);_0x2cc008[_0x9be5('0x33')]=_['intersection'](_0x2cc008[_0x9be5('0x34')],_0x2cc008[_0x9be5('0x31')]);_0x30502f['attributes']=_[_0x9be5('0x35')](_0x2cc008[_0x9be5('0x34')],qs[_0x9be5('0x36')](_0x3c5d5b[_0x9be5('0x31')][_0x9be5('0x36')]));_0x30502f['attributes']=_0x30502f['attributes']['length']?_0x30502f[_0x9be5('0x37')]:_0x2cc008[_0x9be5('0x34')];if(!_0x3c5d5b[_0x9be5('0x31')][_0x9be5('0x38')]('nolimit')){_0x30502f[_0x9be5('0x1f')]=qs[_0x9be5('0x1f')](_0x3c5d5b[_0x9be5('0x31')]['limit']);_0x30502f[_0x9be5('0x1d')]=qs[_0x9be5('0x1d')](_0x3c5d5b[_0x9be5('0x31')][_0x9be5('0x1d')]);}_0x30502f[_0x9be5('0x39')]=qs['sort'](_0x3c5d5b['query']['sort']);_0x30502f[_0x9be5('0x3a')]=qs[_0x9be5('0x33')](_[_0x9be5('0x3b')](_0x3c5d5b[_0x9be5('0x31')],_0x2cc008[_0x9be5('0x33')]),_0x5adb10);if(_0x3c5d5b[_0x9be5('0x31')][_0x9be5('0x3c')]){_0x30502f['where']=_['merge'](_0x30502f[_0x9be5('0x3a')],{'$or':_[_0x9be5('0x2d')](_0x5adb10,function(_0x458f1d){if(_0x458f1d[_0x9be5('0x3d')]!==_0x9be5('0x3e')){var _0x37c31d={};_0x37c31d[_0x458f1d[_0x9be5('0x2b')]]={'$like':'%'+_0x3c5d5b[_0x9be5('0x31')]['filter']+'%'};return _0x37c31d;}})});}_0x30502f=_[_0x9be5('0x3f')]({},_0x30502f,_0x3c5d5b[_0x9be5('0x40')]);var _0x5dde14={'where':_0x30502f[_0x9be5('0x3a')]};return db[_0x9be5('0x2e')][_0x9be5('0x20')](_0x5dde14)[_0x9be5('0x27')](function(_0x3a887c){_0x1d211f['count']=_0x3a887c;if(_0x3c5d5b[_0x9be5('0x31')][_0x9be5('0x41')]){_0x30502f[_0x9be5('0x42')]=[{'all':!![]}];}return db[_0x9be5('0x2e')][_0x9be5('0x43')](_0x30502f);})['then'](function(_0x5165a3){_0x1d211f[_0x9be5('0x44')]=_0x5165a3;return _0x1d211f;})['then'](respondWithFilteredResult(_0x5adc29,_0x30502f))[_0x9be5('0x45')](handleError(_0x5adc29,null));};exports[_0x9be5('0x46')]=function(_0x2cbc86,_0x47d7b1){var _0x1b5c43={'raw':![],'where':{'id':_0x2cbc86[_0x9be5('0x47')]['id']}},_0x38b17={};_0x38b17[_0x9be5('0x34')]=_[_0x9be5('0x32')](db['ZohoAccount']['rawAttributes']);_0x38b17[_0x9be5('0x31')]=_[_0x9be5('0x32')](_0x2cbc86[_0x9be5('0x31')]);_0x38b17['filters']=_['intersection'](_0x38b17[_0x9be5('0x34')],_0x38b17['query']);_0x1b5c43[_0x9be5('0x37')]=_['intersection'](_0x38b17[_0x9be5('0x34')],qs['fields'](_0x2cbc86[_0x9be5('0x31')][_0x9be5('0x36')]));_0x1b5c43[_0x9be5('0x37')]=_0x1b5c43[_0x9be5('0x37')][_0x9be5('0x48')]?_0x1b5c43[_0x9be5('0x37')]:_0x38b17[_0x9be5('0x34')];if(_0x2cbc86[_0x9be5('0x31')][_0x9be5('0x41')]){_0x1b5c43['include']=[{'all':!![]}];}_0x1b5c43=_[_0x9be5('0x3f')]({},_0x1b5c43,_0x2cbc86[_0x9be5('0x40')]);return db[_0x9be5('0x2e')][_0x9be5('0x49')](_0x1b5c43)['then'](handleEntityNotFound(_0x47d7b1,null))[_0x9be5('0x27')](respondWithResult(_0x47d7b1,null))[_0x9be5('0x45')](handleError(_0x47d7b1,null));};exports[_0x9be5('0x4a')]=function(_0x50d0b3,_0x232eb8){return db[_0x9be5('0x2e')][_0x9be5('0x4a')](_0x50d0b3['body'],{})[_0x9be5('0x27')](respondWithResult(_0x232eb8,0xc9))['catch'](handleError(_0x232eb8,null));};exports[_0x9be5('0x26')]=function(_0x324c4c,_0x168c3d){if(_0x324c4c[_0x9be5('0x4b')]['id']){delete _0x324c4c[_0x9be5('0x4b')]['id'];}return db[_0x9be5('0x2e')][_0x9be5('0x49')]({'where':{'id':_0x324c4c['params']['id']}})[_0x9be5('0x27')](handleEntityNotFound(_0x168c3d,null))[_0x9be5('0x27')](saveUpdates(_0x324c4c[_0x9be5('0x4b')],null))['then'](respondWithResult(_0x168c3d,null))[_0x9be5('0x45')](handleError(_0x168c3d,null));};exports[_0x9be5('0x28')]=function(_0x6d1faf,_0x665445){return db[_0x9be5('0x2e')]['find']({'where':{'id':_0x6d1faf[_0x9be5('0x47')]['id']}})[_0x9be5('0x27')](handleEntityNotFound(_0x665445,null))[_0x9be5('0x27')](removeEntity(_0x665445,null))[_0x9be5('0x45')](handleError(_0x665445,null));};exports['getConfigurations']=function(_0x36f34e,_0x59f553,_0x1d10a3){var _0x4657e0={};var _0x277e55={};var _0xf75a43;var _0x1f96de;return db[_0x9be5('0x2e')][_0x9be5('0x4c')]({'where':{'id':_0x36f34e[_0x9be5('0x47')]['id']}})[_0x9be5('0x27')](handleEntityNotFound(_0x59f553,null))['then'](function(_0x478c5b){if(_0x478c5b){_0xf75a43=_0x478c5b;_0x277e55[_0x9be5('0x34')]=_[_0x9be5('0x32')](db[_0x9be5('0x4d')][_0x9be5('0x2f')]);_0x277e55[_0x9be5('0x31')]=_['keys'](_0x36f34e[_0x9be5('0x31')]);_0x277e55[_0x9be5('0x33')]=_[_0x9be5('0x35')](_0x277e55[_0x9be5('0x34')],_0x277e55[_0x9be5('0x31')]);_0x4657e0['attributes']=_[_0x9be5('0x35')](_0x277e55[_0x9be5('0x34')],qs[_0x9be5('0x36')](_0x36f34e[_0x9be5('0x31')]['fields']));_0x4657e0[_0x9be5('0x37')]=_0x4657e0[_0x9be5('0x37')]['length']?_0x4657e0['attributes']:_0x277e55['model'];_0x4657e0[_0x9be5('0x39')]=qs[_0x9be5('0x4e')](_0x36f34e[_0x9be5('0x31')]['sort']);_0x4657e0['where']=qs[_0x9be5('0x33')](_[_0x9be5('0x3b')](_0x36f34e[_0x9be5('0x31')],_0x277e55[_0x9be5('0x33')]));if(_0x36f34e['query']['filter']){_0x4657e0[_0x9be5('0x3a')]=_[_0x9be5('0x3f')](_0x4657e0[_0x9be5('0x3a')],{'$or':_[_0x9be5('0x2d')](_0x4657e0[_0x9be5('0x37')],function(_0x443e8d){var _0xcb5dfd={};_0xcb5dfd[_0x443e8d]={'$like':'%'+_0x36f34e[_0x9be5('0x31')]['filter']+'%'};return _0xcb5dfd;})});}_0x4657e0=_[_0x9be5('0x3f')]({},_0x4657e0,_0x36f34e[_0x9be5('0x40')]);return _0xf75a43[_0x9be5('0x4f')](_0x4657e0);}})[_0x9be5('0x27')](function(_0x8f73ce){if(_0x8f73ce){_0x1f96de=_0x8f73ce[_0x9be5('0x48')];if(!_0x36f34e['query'][_0x9be5('0x38')]('nolimit')){_0x4657e0[_0x9be5('0x1f')]=qs[_0x9be5('0x1f')](_0x36f34e['query'][_0x9be5('0x1f')]);_0x4657e0['offset']=qs[_0x9be5('0x1d')](_0x36f34e['query'][_0x9be5('0x1d')]);}return _0xf75a43['getConfigurations'](_0x4657e0);}})['then'](function(_0x36ed04){if(_0x36ed04){return _0x36ed04?{'count':_0x1f96de,'rows':_0x36ed04}:null;}})[_0x9be5('0x27')](respondWithResult(_0x59f553,null))[_0x9be5('0x45')](handleError(_0x59f553,null));};exports[_0x9be5('0x50')]=function(_0x2187ab,_0x259857,_0x3a21f3){if(_0x2187ab[_0x9be5('0x4b')]['id']){delete _0x2187ab['body']['id'];}return db['ZohoAccount'][_0x9be5('0x4c')]({'where':{'id':_0x2187ab[_0x9be5('0x47')]['id']}})[_0x9be5('0x27')](handleEntityNotFound(_0x259857,null))[_0x9be5('0x27')](function(_0x2bafc8){if(_0x2bafc8){_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x51')]=_0x2bafc8['id'];_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x52')]=integrations[_0x9be5('0x53')](_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x54')],_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x3d')]);_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x55')]=integrations[_0x9be5('0x56')](_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x54')],_0x2187ab[_0x9be5('0x4b')][_0x9be5('0x3d')]);return db[_0x9be5('0x4d')][_0x9be5('0x4a')](_0x2187ab[_0x9be5('0x4b')],{'include':[{'model':db['ZohoField'],'as':_0x9be5('0x52')},{'model':db[_0x9be5('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x259857,null))[_0x9be5('0x45')](handleError(_0x259857,null));};function getAccessToken(_0x3b2269){return new Promise(function(_0x56814a,_0x375105){var _0x1458fe;switch(_0x3b2269['zone']){case'US':_0x1458fe='https://accounts.zoho.com';break;case'AU':_0x1458fe=_0x9be5('0x58');break;case'EU':_0x1458fe=_0x9be5('0x59');break;case'IN':_0x1458fe=_0x9be5('0x5a');break;case'CN':_0x1458fe=_0x9be5('0x5b');break;default:_0x1458fe=_0x9be5('0x59');break;}var _0x216ef0={'method':_0x9be5('0x5c'),'uri':_0x1458fe+_0x9be5('0x5d'),'qs':{'refresh_token':_0x3b2269[_0x9be5('0x5e')],'client_id':_0x3b2269['clientId'],'client_secret':_0x3b2269[_0x9be5('0x5f')],'grant_type':_0x9be5('0x60')},'json':!![]};return rp(_0x216ef0)[_0x9be5('0x27')](function(_0x1739a2){if(_0x1739a2[_0x9be5('0x61')]){_0x56814a(_0x1739a2[_0x9be5('0x61')]);}else{_0x375105(_0x9be5('0x62'));}})[_0x9be5('0x45')](function(_0x149a9d){_0x375105(_0x149a9d);});});}exports[_0x9be5('0x63')]=function(_0x6f46a1,_0x424ab0,_0xfaa3ad){var _0x392d61,_0xcc2b78,_0x3125d4,_0x51ba08,_0x1a7280;return db['ZohoAccount'][_0x9be5('0x4c')]({'where':{'id':_0x6f46a1[_0x9be5('0x47')]['id']},'attributes':['id','host','zone',_0x9be5('0x64'),_0x9be5('0x5f'),'serverUrl',_0x9be5('0x65'),_0x9be5('0x5e')]})[_0x9be5('0x27')](handleEntityNotFound(_0x424ab0,null))[_0x9be5('0x27')](function(_0x54e9d9){_0x1a7280=_0x54e9d9;_0x392d61=_0x1a7280[_0x9be5('0x66')];_0xcc2b78=_0x392d61===_0x9be5('0x67')?'eu':'com';_0x3125d4=_0x1a7280[_0x9be5('0x68')];var _0x326518=_0x3125d4[_0x9be5('0x69')](-0x1);if(_0x326518==='/'||_0x326518==='\x5c'||_0x326518===':'){_0x3125d4=_0x3125d4[_0x9be5('0x6a')](0x0,_0x3125d4[_0x9be5('0x6b')](_0x326518));}if(!_0x1a7280[_0x9be5('0x5e')]){throw new Error(_0x9be5('0x6c'));}return getAccessToken(_0x1a7280);})[_0x9be5('0x27')](function(_0x4c632f){if(_0x4c632f){return rp({'method':'GET','uri':util[_0x9be5('0x6d')](_0x9be5('0x6e'),_0xcc2b78),'qs':{'module':_0x9be5('0x6f')},'headers':{'Authorization':_0x9be5('0x70')+_0x4c632f},'json':!![]});}})[_0x9be5('0x27')](function(_0x343c06){if(_0x343c06){if(_0x343c06[_0x9be5('0x71')]&&_0x343c06[_0x9be5('0x71')][_0x9be5('0x29')]){throw new Error(_0x343c06[_0x9be5('0x71')]['error'][_0x9be5('0x72')]);}var _0x21ae6d=[];var _0x1e7838=[];var _0x18d53e=[_0x9be5('0x73'),'Subject',_0x9be5('0x74'),_0x9be5('0x75'),_0x9be5('0x76'),_0x9be5('0x77'),_0x9be5('0x78'),'Call_Type'];_0x1e7838=_[_0x9be5('0x79')](_0x343c06[_0x9be5('0x36')],function(_0x24d9a3){return _0x18d53e[_0x9be5('0x7a')](_0x24d9a3['api_name']);});for(var _0x7bf43d=0x0;_0x7bf43d<_0x1e7838[_0x9be5('0x48')];_0x7bf43d++){if(_0x1e7838[_0x7bf43d]['system_mandatory']===![]){_0x21ae6d[_0x9be5('0x7b')]({'id':_0x1e7838[_0x7bf43d]['id'],'name':_0x1e7838[_0x7bf43d]['display_label'],'custom':_0x1e7838[_0x7bf43d][_0x9be5('0x7c')],'options':_0x1e7838[_0x7bf43d][_0x9be5('0x7d')]==='picklist'&&_0x1e7838[_0x7bf43d][_0x9be5('0x7e')][_0x9be5('0x48')]>-0x1?_[_0x9be5('0x2d')](_0x1e7838[_0x7bf43d][_0x9be5('0x7e')],function(_0x1645e9){return{'name':_0x1645e9,'value':_0x1645e9};}):[]});}}return{'count':_0x21ae6d[_0x9be5('0x48')],'rows':_0x21ae6d};}else{return{'count':0x0,'rows':[]};}})[_0x9be5('0x27')](respondWithResult(_0x424ab0,null))[_0x9be5('0x45')](function(_0xf6196e){var _0x2c41ed=_0x6f46a1['query']['test']?0x1f4:_0xf6196e[_0x9be5('0x7f')]||0x1f4;logger[_0x9be5('0x29')](_0x9be5('0x80'),_0x9be5('0x63'),_0x2c41ed,JSON[_0x9be5('0x81')](_0xf6196e));delete _0xf6196e[_0x9be5('0x2b')];if(_0x2c41ed===0x191){_0x2c41ed=0x190;}_0x424ab0['status'](_0x2c41ed)['send'](_0x6f46a1[_0x9be5('0x31')][_0x9be5('0x82')]?{'message':_0x9be5('0x83'),'statusCode':_0xf6196e[_0x9be5('0x7f')]}:_0xf6196e);});}; \ No newline at end of file +var _0x7237=['fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','ZohoAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','getSubjects','channel','ZohoField','Subjects','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','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','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x239a98,_0x288178){var _0x16d789=function(_0xbdf050){while(--_0xbdf050){_0x239a98['push'](_0x239a98['shift']());}};_0x16d789(++_0x288178);}(_0x7237,0x101));var _0x7723=function(_0x73cc18,_0x404ae7){_0x73cc18=_0x73cc18-0x0;var _0x45cfec=_0x7237[_0x73cc18];return _0x45cfec;};'use strict';var emlformat=require(_0x7723('0x0'));var rimraf=require(_0x7723('0x1'));var zipdir=require(_0x7723('0x2'));var jsonpatch=require(_0x7723('0x3'));var rp=require(_0x7723('0x4'));var moment=require(_0x7723('0x5'));var BPromise=require(_0x7723('0x6'));var Mustache=require(_0x7723('0x7'));var util=require('util');var path=require(_0x7723('0x8'));var sox=require(_0x7723('0x9'));var csv=require('to-csv');var ejs=require(_0x7723('0xa'));var fs=require('fs');var fs_extra=require(_0x7723('0xb'));var _=require(_0x7723('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7723('0xd'));var deskjs=require(_0x7723('0xe'));var toCsv=require(_0x7723('0xf'));var querystring=require(_0x7723('0x10'));var Papa=require(_0x7723('0x11'));var Redis=require(_0x7723('0x12'));var authService=require(_0x7723('0x13'));var qs=require(_0x7723('0x14'));var as=require(_0x7723('0x15'));var hardwareService=require(_0x7723('0x16'));var logger=require(_0x7723('0x17'))(_0x7723('0x18'));var utils=require(_0x7723('0x19'));var config=require(_0x7723('0x1a'));var licenseUtil=require(_0x7723('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5199ae,_0x4abf61){_0x4abf61=_0x4abf61||0xcc;return function(_0x843e6d){if(_0x843e6d){return _0x5199ae[_0x7723('0x1c')](_0x4abf61);}return _0x5199ae[_0x7723('0x1d')](_0x4abf61)[_0x7723('0x1e')]();};}function respondWithResult(_0x294af9,_0xdd863a){_0xdd863a=_0xdd863a||0xc8;return function(_0x381a3c){if(_0x381a3c){return _0x294af9[_0x7723('0x1d')](_0xdd863a)[_0x7723('0x1f')](_0x381a3c);}};}function respondWithFilteredResult(_0x43ecf2,_0xad35b2){return function(_0x42c340){if(_0x42c340){var _0x46d6b0=typeof _0xad35b2[_0x7723('0x20')]===_0x7723('0x21')&&typeof _0xad35b2['limit']==='undefined';var _0x3726e2=_0x42c340[_0x7723('0x22')];var _0x1ce93c=_0x46d6b0?0x0:_0xad35b2['offset'];var _0x247e42=_0x46d6b0?_0x42c340[_0x7723('0x22')]:_0xad35b2['offset']+_0xad35b2[_0x7723('0x23')];var _0x535dc1;if(_0x247e42>=_0x3726e2){_0x247e42=_0x3726e2;_0x535dc1=0xc8;}else{_0x535dc1=0xce;}_0x43ecf2[_0x7723('0x1d')](_0x535dc1);return _0x43ecf2[_0x7723('0x24')](_0x7723('0x25'),_0x1ce93c+'-'+_0x247e42+'/'+_0x3726e2)[_0x7723('0x1f')](_0x42c340);}return null;};}function patchUpdates(_0x36f1be){return function(_0xa1264f){try{jsonpatch['apply'](_0xa1264f,_0x36f1be,!![]);}catch(_0x14fd70){return BPromise[_0x7723('0x26')](_0x14fd70);}return _0xa1264f[_0x7723('0x27')]();};}function saveUpdates(_0x27f4fd,_0x110c80){return function(_0x1aa6da){if(_0x1aa6da){return _0x1aa6da[_0x7723('0x28')](_0x27f4fd)[_0x7723('0x29')](function(_0x51c4af){return _0x51c4af;});}return null;};}function removeEntity(_0x421708,_0x5b825e){return function(_0x3dbba7){if(_0x3dbba7){return _0x3dbba7[_0x7723('0x2a')]()[_0x7723('0x29')](function(){_0x421708['status'](0xcc)[_0x7723('0x1e')]();});}};}function handleEntityNotFound(_0x4074c8,_0x4f8016){return function(_0xa7d8d9){if(!_0xa7d8d9){_0x4074c8[_0x7723('0x1c')](0x194);}return _0xa7d8d9;};}function handleError(_0x4bc2aa,_0x44ee2f){_0x44ee2f=_0x44ee2f||0x1f4;return function(_0x4b47a1){logger[_0x7723('0x2b')](_0x4b47a1[_0x7723('0x2c')]);if(_0x4b47a1[_0x7723('0x2d')]){delete _0x4b47a1[_0x7723('0x2d')];}_0x4bc2aa[_0x7723('0x1d')](_0x44ee2f)[_0x7723('0x2e')](_0x4b47a1);};}exports['index']=function(_0xbc0c33,_0x1b9d1c){var _0x329df5={},_0x2ee08c={},_0x7247f1={'count':0x0,'rows':[]};var _0x27bf3e=_[_0x7723('0x2f')](db[_0x7723('0x30')]['rawAttributes'],function(_0x3ae3b9){return{'name':_0x3ae3b9[_0x7723('0x31')],'type':_0x3ae3b9[_0x7723('0x32')][_0x7723('0x33')]};});_0x2ee08c[_0x7723('0x34')]=_[_0x7723('0x2f')](_0x27bf3e,_0x7723('0x2d'));_0x2ee08c['query']=_[_0x7723('0x35')](_0xbc0c33[_0x7723('0x36')]);_0x2ee08c[_0x7723('0x37')]=_[_0x7723('0x38')](_0x2ee08c[_0x7723('0x34')],_0x2ee08c[_0x7723('0x36')]);_0x329df5[_0x7723('0x39')]=_[_0x7723('0x38')](_0x2ee08c['model'],qs['fields'](_0xbc0c33[_0x7723('0x36')][_0x7723('0x3a')]));_0x329df5['attributes']=_0x329df5['attributes'][_0x7723('0x3b')]?_0x329df5[_0x7723('0x39')]:_0x2ee08c['model'];if(!_0xbc0c33['query'][_0x7723('0x3c')]('nolimit')){_0x329df5[_0x7723('0x23')]=qs['limit'](_0xbc0c33[_0x7723('0x36')]['limit']);_0x329df5[_0x7723('0x20')]=qs[_0x7723('0x20')](_0xbc0c33[_0x7723('0x36')][_0x7723('0x20')]);}_0x329df5[_0x7723('0x3d')]=qs['sort'](_0xbc0c33[_0x7723('0x36')][_0x7723('0x3e')]);_0x329df5[_0x7723('0x3f')]=qs[_0x7723('0x37')](_['pick'](_0xbc0c33[_0x7723('0x36')],_0x2ee08c[_0x7723('0x37')]),_0x27bf3e);if(_0xbc0c33['query'][_0x7723('0x40')]){_0x329df5['where']=_['merge'](_0x329df5[_0x7723('0x3f')],{'$or':_[_0x7723('0x2f')](_0x27bf3e,function(_0x1ed0f9){if(_0x1ed0f9[_0x7723('0x32')]!==_0x7723('0x41')){var _0x382427={};_0x382427[_0x1ed0f9[_0x7723('0x2d')]]={'$like':'%'+_0xbc0c33[_0x7723('0x36')]['filter']+'%'};return _0x382427;}})});}_0x329df5=_['merge']({},_0x329df5,_0xbc0c33['options']);var _0x109ff9={'where':_0x329df5[_0x7723('0x3f')]};return db[_0x7723('0x30')][_0x7723('0x22')](_0x109ff9)[_0x7723('0x29')](function(_0x56850d){_0x7247f1[_0x7723('0x22')]=_0x56850d;if(_0xbc0c33[_0x7723('0x36')]['includeAll']){_0x329df5['include']=[{'all':!![]}];}return db[_0x7723('0x30')][_0x7723('0x42')](_0x329df5);})[_0x7723('0x29')](function(_0xfcbb1){_0x7247f1[_0x7723('0x43')]=_0xfcbb1;return _0x7247f1;})[_0x7723('0x29')](respondWithFilteredResult(_0x1b9d1c,_0x329df5))[_0x7723('0x44')](handleError(_0x1b9d1c,null));};exports[_0x7723('0x45')]=function(_0x1d80cf,_0x533d95){var _0x340a1c={'raw':![],'where':{'id':_0x1d80cf[_0x7723('0x46')]['id']}},_0x1cd2f3={};_0x1cd2f3[_0x7723('0x34')]=_[_0x7723('0x35')](db[_0x7723('0x30')][_0x7723('0x47')]);_0x1cd2f3[_0x7723('0x36')]=_['keys'](_0x1d80cf[_0x7723('0x36')]);_0x1cd2f3['filters']=_[_0x7723('0x38')](_0x1cd2f3[_0x7723('0x34')],_0x1cd2f3[_0x7723('0x36')]);_0x340a1c['attributes']=_[_0x7723('0x38')](_0x1cd2f3[_0x7723('0x34')],qs['fields'](_0x1d80cf[_0x7723('0x36')][_0x7723('0x3a')]));_0x340a1c[_0x7723('0x39')]=_0x340a1c[_0x7723('0x39')]['length']?_0x340a1c[_0x7723('0x39')]:_0x1cd2f3['model'];if(_0x1d80cf[_0x7723('0x36')][_0x7723('0x48')]){_0x340a1c['include']=[{'all':!![]}];}_0x340a1c=_[_0x7723('0x49')]({},_0x340a1c,_0x1d80cf['options']);return db[_0x7723('0x30')][_0x7723('0x4a')](_0x340a1c)[_0x7723('0x29')](handleEntityNotFound(_0x533d95,null))[_0x7723('0x29')](respondWithResult(_0x533d95,null))[_0x7723('0x44')](handleError(_0x533d95,null));};exports[_0x7723('0x4b')]=function(_0x1cc028,_0x5e7dd5){return db[_0x7723('0x30')][_0x7723('0x4b')](_0x1cc028[_0x7723('0x4c')],{})[_0x7723('0x29')](respondWithResult(_0x5e7dd5,0xc9))[_0x7723('0x44')](handleError(_0x5e7dd5,null));};exports[_0x7723('0x28')]=function(_0x34ef53,_0x2af7e3){if(_0x34ef53[_0x7723('0x4c')]['id']){delete _0x34ef53[_0x7723('0x4c')]['id'];}return db[_0x7723('0x30')][_0x7723('0x4a')]({'where':{'id':_0x34ef53[_0x7723('0x46')]['id']}})[_0x7723('0x29')](handleEntityNotFound(_0x2af7e3,null))[_0x7723('0x29')](saveUpdates(_0x34ef53[_0x7723('0x4c')],null))['then'](respondWithResult(_0x2af7e3,null))['catch'](handleError(_0x2af7e3,null));};exports[_0x7723('0x2a')]=function(_0xca3cc1,_0x2da465){return db[_0x7723('0x30')]['find']({'where':{'id':_0xca3cc1[_0x7723('0x46')]['id']}})[_0x7723('0x29')](handleEntityNotFound(_0x2da465,null))[_0x7723('0x29')](removeEntity(_0x2da465,null))[_0x7723('0x44')](handleError(_0x2da465,null));};exports['getConfigurations']=function(_0x3d39c0,_0x57fce7,_0x188eef){var _0x42bb09={};var _0x2326b3={};var _0x327c49;var _0x3b3d62;return db[_0x7723('0x30')][_0x7723('0x4d')]({'where':{'id':_0x3d39c0['params']['id']}})[_0x7723('0x29')](handleEntityNotFound(_0x57fce7,null))[_0x7723('0x29')](function(_0x828d3b){if(_0x828d3b){_0x327c49=_0x828d3b;_0x2326b3[_0x7723('0x34')]=_['keys'](db[_0x7723('0x4e')][_0x7723('0x47')]);_0x2326b3[_0x7723('0x36')]=_['keys'](_0x3d39c0[_0x7723('0x36')]);_0x2326b3['filters']=_['intersection'](_0x2326b3[_0x7723('0x34')],_0x2326b3['query']);_0x42bb09[_0x7723('0x39')]=_[_0x7723('0x38')](_0x2326b3[_0x7723('0x34')],qs[_0x7723('0x3a')](_0x3d39c0[_0x7723('0x36')][_0x7723('0x3a')]));_0x42bb09['attributes']=_0x42bb09[_0x7723('0x39')][_0x7723('0x3b')]?_0x42bb09[_0x7723('0x39')]:_0x2326b3[_0x7723('0x34')];_0x42bb09['order']=qs[_0x7723('0x3e')](_0x3d39c0[_0x7723('0x36')][_0x7723('0x3e')]);_0x42bb09[_0x7723('0x3f')]=qs[_0x7723('0x37')](_['pick'](_0x3d39c0[_0x7723('0x36')],_0x2326b3[_0x7723('0x37')]));if(_0x3d39c0[_0x7723('0x36')][_0x7723('0x40')]){_0x42bb09[_0x7723('0x3f')]=_['merge'](_0x42bb09['where'],{'$or':_[_0x7723('0x2f')](_0x42bb09[_0x7723('0x39')],function(_0x65b7e5){var _0xd6879f={};_0xd6879f[_0x65b7e5]={'$like':'%'+_0x3d39c0[_0x7723('0x36')][_0x7723('0x40')]+'%'};return _0xd6879f;})});}_0x42bb09=_[_0x7723('0x49')]({},_0x42bb09,_0x3d39c0['options']);return _0x327c49[_0x7723('0x4f')](_0x42bb09);}})[_0x7723('0x29')](function(_0x1bddcf){if(_0x1bddcf){_0x3b3d62=_0x1bddcf[_0x7723('0x3b')];if(!_0x3d39c0[_0x7723('0x36')]['hasOwnProperty'](_0x7723('0x50'))){_0x42bb09[_0x7723('0x23')]=qs[_0x7723('0x23')](_0x3d39c0[_0x7723('0x36')][_0x7723('0x23')]);_0x42bb09[_0x7723('0x20')]=qs[_0x7723('0x20')](_0x3d39c0[_0x7723('0x36')][_0x7723('0x20')]);}return _0x327c49[_0x7723('0x4f')](_0x42bb09);}})[_0x7723('0x29')](function(_0x30c7c0){if(_0x30c7c0){return _0x30c7c0?{'count':_0x3b3d62,'rows':_0x30c7c0}:null;}})[_0x7723('0x29')](respondWithResult(_0x57fce7,null))[_0x7723('0x44')](handleError(_0x57fce7,null));};exports[_0x7723('0x51')]=function(_0x2684a0,_0x290012,_0x71c91c){if(_0x2684a0[_0x7723('0x4c')]['id']){delete _0x2684a0[_0x7723('0x4c')]['id'];}return db[_0x7723('0x30')]['findOne']({'where':{'id':_0x2684a0['params']['id']}})[_0x7723('0x29')](handleEntityNotFound(_0x290012,null))[_0x7723('0x29')](function(_0x332046){if(_0x332046){_0x2684a0['body']['AccountId']=_0x332046['id'];_0x2684a0[_0x7723('0x4c')]['Subjects']=integrations[_0x7723('0x52')](_0x2684a0[_0x7723('0x4c')][_0x7723('0x53')],_0x2684a0['body'][_0x7723('0x32')]);_0x2684a0[_0x7723('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x2684a0[_0x7723('0x4c')][_0x7723('0x53')],_0x2684a0[_0x7723('0x4c')][_0x7723('0x32')]);return db[_0x7723('0x4e')]['create'](_0x2684a0[_0x7723('0x4c')],{'include':[{'model':db[_0x7723('0x54')],'as':_0x7723('0x55')},{'model':db[_0x7723('0x54')],'as':_0x7723('0x56')}]});}return null;})[_0x7723('0x29')](respondWithResult(_0x290012,null))['catch'](handleError(_0x290012,null));};function getAccessToken(_0x26e24a){return new Promise(function(_0x3b7af4,_0x236378){var _0x13cc71;switch(_0x26e24a[_0x7723('0x57')]){case'US':_0x13cc71=_0x7723('0x58');break;case'AU':_0x13cc71='https://accounts.zoho.com.au';break;case'EU':_0x13cc71='https://accounts.zoho.eu';break;case'IN':_0x13cc71='https://accounts.zoho.in';break;case'CN':_0x13cc71=_0x7723('0x59');break;default:_0x13cc71=_0x7723('0x5a');break;}var _0x1e111d={'method':_0x7723('0x5b'),'uri':_0x13cc71+_0x7723('0x5c'),'qs':{'refresh_token':_0x26e24a[_0x7723('0x5d')],'client_id':_0x26e24a[_0x7723('0x5e')],'client_secret':_0x26e24a[_0x7723('0x5f')],'grant_type':_0x7723('0x60')},'json':!![]};return rp(_0x1e111d)[_0x7723('0x29')](function(_0x3f70cb){if(_0x3f70cb[_0x7723('0x61')]){_0x3b7af4(_0x3f70cb[_0x7723('0x61')]);}else{_0x236378('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x7723('0x44')](function(_0x3df7cc){_0x236378(_0x3df7cc);});});}exports[_0x7723('0x62')]=function(_0x51f539,_0x4679ed,_0x242add){var _0x1780fe,_0x27356c,_0x59ccf2,_0x1dd851,_0x299ccd;return db['ZohoAccount'][_0x7723('0x4d')]({'where':{'id':_0x51f539[_0x7723('0x46')]['id']},'attributes':['id',_0x7723('0x63'),_0x7723('0x57'),_0x7723('0x5e'),_0x7723('0x5f'),_0x7723('0x64'),'code',_0x7723('0x5d')]})['then'](handleEntityNotFound(_0x4679ed,null))['then'](function(_0x4063d7){_0x299ccd=_0x4063d7;_0x1780fe=_0x299ccd[_0x7723('0x63')];_0x27356c=_0x1780fe===_0x7723('0x65')?'eu':_0x7723('0x66');_0x59ccf2=_0x299ccd[_0x7723('0x64')];var _0x313b31=_0x59ccf2[_0x7723('0x67')](-0x1);if(_0x313b31==='/'||_0x313b31==='\x5c'||_0x313b31===':'){_0x59ccf2=_0x59ccf2[_0x7723('0x68')](0x0,_0x59ccf2[_0x7723('0x69')](_0x313b31));}if(!_0x299ccd[_0x7723('0x5d')]){throw new Error(_0x7723('0x6a'));}return getAccessToken(_0x299ccd);})['then'](function(_0x3f5490){if(_0x3f5490){return rp({'method':_0x7723('0x6b'),'uri':util['format'](_0x7723('0x6c'),_0x27356c),'qs':{'module':_0x7723('0x6d')},'headers':{'Authorization':_0x7723('0x6e')+_0x3f5490},'json':!![]});}})[_0x7723('0x29')](function(_0x4bb35c){if(_0x4bb35c){if(_0x4bb35c[_0x7723('0x6f')]&&_0x4bb35c[_0x7723('0x6f')][_0x7723('0x2b')]){throw new Error(_0x4bb35c[_0x7723('0x6f')][_0x7723('0x2b')][_0x7723('0x70')]);}var _0x527298=[];var _0x2e68b7=[];var _0x3fc5a1=[_0x7723('0x71'),_0x7723('0x72'),_0x7723('0x73'),_0x7723('0x74'),_0x7723('0x75'),_0x7723('0x76'),_0x7723('0x77'),_0x7723('0x78')];_0x2e68b7=_[_0x7723('0x79')](_0x4bb35c[_0x7723('0x3a')],function(_0x190aa5){return _0x3fc5a1[_0x7723('0x7a')](_0x190aa5[_0x7723('0x7b')]);});for(var _0x3435c6=0x0;_0x3435c6<_0x2e68b7['length'];_0x3435c6++){if(_0x2e68b7[_0x3435c6][_0x7723('0x7c')]===![]){_0x527298[_0x7723('0x7d')]({'id':_0x2e68b7[_0x3435c6]['id'],'name':_0x2e68b7[_0x3435c6][_0x7723('0x7e')],'custom':_0x2e68b7[_0x3435c6]['custom_field'],'options':_0x2e68b7[_0x3435c6][_0x7723('0x7f')]===_0x7723('0x80')&&_0x2e68b7[_0x3435c6][_0x7723('0x81')]['length']>-0x1?_[_0x7723('0x2f')](_0x2e68b7[_0x3435c6]['pick_list_values'],function(_0x4dc558){return{'name':_0x4dc558,'value':_0x4dc558};}):[]});}}return{'count':_0x527298[_0x7723('0x3b')],'rows':_0x527298};}else{return{'count':0x0,'rows':[]};}})[_0x7723('0x29')](respondWithResult(_0x4679ed,null))['catch'](function(_0x1a6e3f){var _0x279de9=_0x51f539[_0x7723('0x36')]['test']?0x1f4:_0x1a6e3f['statusCode']||0x1f4;logger[_0x7723('0x2b')](_0x7723('0x82'),'getFields',_0x279de9,JSON['stringify'](_0x1a6e3f));delete _0x1a6e3f['name'];if(_0x279de9===0x191){_0x279de9=0x190;}_0x4679ed[_0x7723('0x1d')](_0x279de9)[_0x7723('0x2e')](_0x51f539[_0x7723('0x36')][_0x7723('0x83')]?{'message':_0x7723('0x84'),'statusCode':_0x1a6e3f[_0x7723('0x85')]}:_0x1a6e3f);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index de35418..7ac266e 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 _0x58b3=['POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','name','https://accounts.zoho.com','https://accounts.zoho.eu','info','inspect','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','clientSecret','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x58b3,0xe5));var _0x358b=function(_0x4d31d0,_0x169964){_0x4d31d0=_0x4d31d0-0x0;var _0xa921a0=_0x58b3[_0x4d31d0];return _0xa921a0;};'use strict';var _=require('lodash');var util=require(_0x358b('0x0'));var logger=require(_0x358b('0x1'))(_0x358b('0x2'));var moment=require(_0x358b('0x3'));var BPromise=require(_0x358b('0x4'));var rp=require(_0x358b('0x5'));var fs=require('fs');var path=require(_0x358b('0x6'));var rimraf=require('rimraf');var config=require(_0x358b('0x7'));var attributes=require(_0x358b('0x8'));var integrations=require(_0x358b('0x9'));module[_0x358b('0xa')]=function(_0x3653e8,_0xd38b4){return _0x3653e8[_0x358b('0xb')]('ZohoAccount',attributes,{'tableName':_0x358b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d2dce,_0x46a2e,_0x588541){if(_0x4d2dce[_0x358b('0xd')](_0x358b('0xe'))||_0x4d2dce[_0x358b('0xd')]('serverUrl')||_0x4d2dce[_0x358b('0xd')]('clientId')||_0x4d2dce[_0x358b('0xd')](_0x358b('0xf'))||_0x4d2dce[_0x358b('0xd')]('code')||_0x4d2dce[_0x358b('0xd')](_0x358b('0x10'))){var _0x5ea174,_0x5ceca8;_0x5ea174=_0x4d2dce[_0x358b('0x11')];var _0xdc4b8c=_0x5ea174[_0x358b('0x12')](-0x1);if(_0xdc4b8c==='/'||_0xdc4b8c==='\x5c'||_0xdc4b8c===':'){_0x5ea174=_0x5ea174[_0x358b('0x13')](0x0,_0x5ea174[_0x358b('0x14')](_0xdc4b8c));}switch(_0x4d2dce['zone']){case'US':_0x5ceca8='https://accounts.zoho.com';break;case'AU':_0x5ceca8=_0x358b('0x15');break;case'IN':_0x5ceca8=_0x358b('0x16');break;case'CN':_0x5ceca8='https://accounts.zoho.com.cn';break;default:_0x5ceca8='https://accounts.zoho.eu';break;}var _0x215f8d={'method':_0x358b('0x17'),'uri':_0x5ceca8+_0x358b('0x18'),'form':{'grant_type':_0x358b('0x19'),'client_id':_0x4d2dce[_0x358b('0x1a')],'client_secret':_0x4d2dce[_0x358b('0xf')],'redirect_uri':_0x4d2dce[_0x358b('0x11')],'code':_0x4d2dce['code']},'headers':{'Content-Type':_0x358b('0x1b')}};return rp(_0x215f8d)[_0x358b('0x1c')](function(_0xd338a9){var _0x3854d4=JSON[_0x358b('0x1d')](_0xd338a9);if(_0x3854d4[_0x358b('0x1e')]){_0x4d2dce[_0x358b('0x1f')]=_0x3854d4['refresh_token'];logger['info'](util[_0x358b('0x20')](_0x358b('0x21'),_0x4d2dce['name'],_0x4d2dce['id']));}else{logger[_0x358b('0x22')](util[_0x358b('0x20')](_0x358b('0x23'),_0x4d2dce['name'],_0x4d2dce['id']),util['inspect'](_0x3854d4,{'showHidden':![],'depth':null}));}return _0x588541(null,_0x46a2e);})[_0x358b('0x24')](function(_0x43326d){logger[_0x358b('0x22')](util[_0x358b('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4d2dce[_0x358b('0x25')],_0x4d2dce['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x588541(_0x43326d);});}else{return _0x588541(null,_0x46a2e);}},'beforeUpdate':function(_0x1942b6,_0x58c1ef,_0x57d1ee){if(_0x1942b6[_0x358b('0xd')](_0x358b('0xe'))||_0x1942b6[_0x358b('0xd')](_0x358b('0x11'))||_0x1942b6[_0x358b('0xd')](_0x358b('0x1a'))||_0x1942b6['changed'](_0x358b('0xf'))||_0x1942b6[_0x358b('0xd')]('code')||_0x1942b6['changed']('host')){var _0xbc8502,_0x5e449a;_0xbc8502=_0x1942b6['serverUrl'];var _0x4c6202=_0xbc8502['slice'](-0x1);if(_0x4c6202==='/'||_0x4c6202==='\x5c'||_0x4c6202===':'){_0xbc8502=_0xbc8502[_0x358b('0x13')](0x0,_0xbc8502[_0x358b('0x14')](_0x4c6202));}switch(_0x1942b6[_0x358b('0xe')]){case'US':_0x5e449a=_0x358b('0x26');break;case'AU':_0x5e449a=_0x358b('0x15');break;case'IN':_0x5e449a=_0x358b('0x16');break;case'CN':_0x5e449a='https://accounts.zoho.com.cn';break;default:_0x5e449a=_0x358b('0x27');break;}var _0x38fd3b={'method':_0x358b('0x17'),'uri':_0x5e449a+_0x358b('0x18'),'form':{'grant_type':_0x358b('0x19'),'client_id':_0x1942b6[_0x358b('0x1a')],'client_secret':_0x1942b6['clientSecret'],'redirect_uri':_0x1942b6[_0x358b('0x11')],'code':_0x1942b6['code']},'headers':{'Content-Type':_0x358b('0x1b')}};return rp(_0x38fd3b)['then'](function(_0x4b526e){var _0x553dfb=JSON[_0x358b('0x1d')](_0x4b526e);if(_0x553dfb[_0x358b('0x1e')]){_0x1942b6['refreshToken']=_0x553dfb['refresh_token'];logger[_0x358b('0x28')](util[_0x358b('0x20')](_0x358b('0x21'),_0x1942b6[_0x358b('0x25')],_0x1942b6['id']));}else{logger[_0x358b('0x22')](util[_0x358b('0x20')](_0x358b('0x23'),_0x1942b6[_0x358b('0x25')],_0x1942b6['id']),util[_0x358b('0x29')](_0x553dfb,{'showHidden':![],'depth':null}));}return _0x57d1ee(null,_0x58c1ef);})[_0x358b('0x24')](function(_0x590f73){logger[_0x358b('0x22')](util[_0x358b('0x20')](_0x358b('0x23'),_0x1942b6[_0x358b('0x25')],_0x1942b6['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x57d1ee(_0x590f73);});}else{return _0x57d1ee(null,_0x58c1ef);}}}});}; \ No newline at end of file +var _0xc51d=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.eu','authorization_code','refreshToken','info','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','format'];(function(_0x378b89,_0x363201){var _0x166242=function(_0x55bcc6){while(--_0x55bcc6){_0x378b89['push'](_0x378b89['shift']());}};_0x166242(++_0x363201);}(_0xc51d,0x128));var _0xdc51=function(_0x37e06f,_0x5260ab){_0x37e06f=_0x37e06f-0x0;var _0x507f9c=_0xc51d[_0x37e06f];return _0x507f9c;};'use strict';var _=require(_0xdc51('0x0'));var util=require(_0xdc51('0x1'));var logger=require(_0xdc51('0x2'))(_0xdc51('0x3'));var moment=require(_0xdc51('0x4'));var BPromise=require(_0xdc51('0x5'));var rp=require(_0xdc51('0x6'));var fs=require('fs');var path=require(_0xdc51('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xdc51('0x8'));module[_0xdc51('0x9')]=function(_0x4f68e9,_0xe9ec1c){return _0x4f68e9[_0xdc51('0xa')](_0xdc51('0xb'),attributes,{'tableName':_0xdc51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe0f7d,_0x2fb155,_0x2b1853){if(_0xe0f7d[_0xdc51('0xd')](_0xdc51('0xe'))||_0xe0f7d[_0xdc51('0xd')](_0xdc51('0xf'))||_0xe0f7d['changed'](_0xdc51('0x10'))||_0xe0f7d[_0xdc51('0xd')](_0xdc51('0x11'))||_0xe0f7d[_0xdc51('0xd')](_0xdc51('0x12'))||_0xe0f7d['changed'](_0xdc51('0x13'))){var _0x32c08a,_0x2b4e1b;_0x32c08a=_0xe0f7d[_0xdc51('0xf')];var _0x4b9494=_0x32c08a[_0xdc51('0x14')](-0x1);if(_0x4b9494==='/'||_0x4b9494==='\x5c'||_0x4b9494===':'){_0x32c08a=_0x32c08a[_0xdc51('0x15')](0x0,_0x32c08a['lastIndexOf'](_0x4b9494));}switch(_0xe0f7d[_0xdc51('0xe')]){case'US':_0x2b4e1b=_0xdc51('0x16');break;case'AU':_0x2b4e1b=_0xdc51('0x17');break;case'IN':_0x2b4e1b=_0xdc51('0x18');break;case'CN':_0x2b4e1b='https://accounts.zoho.com.cn';break;default:_0x2b4e1b='https://accounts.zoho.eu';break;}var _0x40c2b8={'method':_0xdc51('0x19'),'uri':_0x2b4e1b+_0xdc51('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0xe0f7d[_0xdc51('0x10')],'client_secret':_0xe0f7d[_0xdc51('0x11')],'redirect_uri':_0xe0f7d[_0xdc51('0xf')],'code':_0xe0f7d[_0xdc51('0x12')]},'headers':{'Content-Type':_0xdc51('0x1b')}};return rp(_0x40c2b8)[_0xdc51('0x1c')](function(_0x58fda8){var _0x49f55a=JSON[_0xdc51('0x1d')](_0x58fda8);if(_0x49f55a[_0xdc51('0x1e')]){_0xe0f7d['refreshToken']=_0x49f55a[_0xdc51('0x1e')];logger['info'](util[_0xdc51('0x1f')](_0xdc51('0x20'),_0xe0f7d[_0xdc51('0x21')],_0xe0f7d['id']));}else{logger[_0xdc51('0x22')](util[_0xdc51('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe0f7d[_0xdc51('0x21')],_0xe0f7d['id']),util[_0xdc51('0x23')](_0x49f55a,{'showHidden':![],'depth':null}));}return _0x2b1853(null,_0x2fb155);})['catch'](function(_0x56bb3d){logger['error'](util[_0xdc51('0x1f')](_0xdc51('0x24'),_0xe0f7d['name'],_0xe0f7d['id']),util[_0xdc51('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x2b1853(_0x56bb3d);});}else{return _0x2b1853(null,_0x2fb155);}},'beforeUpdate':function(_0x4ff2fb,_0x26c668,_0x845505){if(_0x4ff2fb[_0xdc51('0xd')](_0xdc51('0xe'))||_0x4ff2fb[_0xdc51('0xd')](_0xdc51('0xf'))||_0x4ff2fb[_0xdc51('0xd')](_0xdc51('0x10'))||_0x4ff2fb['changed'](_0xdc51('0x11'))||_0x4ff2fb[_0xdc51('0xd')]('code')||_0x4ff2fb[_0xdc51('0xd')]('host')){var _0x53d44d,_0x11ecfc;_0x53d44d=_0x4ff2fb['serverUrl'];var _0x44c8bf=_0x53d44d['slice'](-0x1);if(_0x44c8bf==='/'||_0x44c8bf==='\x5c'||_0x44c8bf===':'){_0x53d44d=_0x53d44d[_0xdc51('0x15')](0x0,_0x53d44d['lastIndexOf'](_0x44c8bf));}switch(_0x4ff2fb[_0xdc51('0xe')]){case'US':_0x11ecfc=_0xdc51('0x16');break;case'AU':_0x11ecfc=_0xdc51('0x17');break;case'IN':_0x11ecfc=_0xdc51('0x18');break;case'CN':_0x11ecfc='https://accounts.zoho.com.cn';break;default:_0x11ecfc=_0xdc51('0x25');break;}var _0x257c5b={'method':_0xdc51('0x19'),'uri':_0x11ecfc+'/oauth/v2/token','form':{'grant_type':_0xdc51('0x26'),'client_id':_0x4ff2fb['clientId'],'client_secret':_0x4ff2fb['clientSecret'],'redirect_uri':_0x4ff2fb[_0xdc51('0xf')],'code':_0x4ff2fb['code']},'headers':{'Content-Type':_0xdc51('0x1b')}};return rp(_0x257c5b)[_0xdc51('0x1c')](function(_0x1b2b5a){var _0x1782f5=JSON[_0xdc51('0x1d')](_0x1b2b5a);if(_0x1782f5['refresh_token']){_0x4ff2fb[_0xdc51('0x27')]=_0x1782f5[_0xdc51('0x1e')];logger[_0xdc51('0x28')](util[_0xdc51('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4ff2fb[_0xdc51('0x21')],_0x4ff2fb['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4ff2fb[_0xdc51('0x21')],_0x4ff2fb['id']),util['inspect'](_0x1782f5,{'showHidden':![],'depth':null}));}return _0x845505(null,_0x26c668);})['catch'](function(_0xe39573){logger[_0xdc51('0x22')](util[_0xdc51('0x1f')](_0xdc51('0x24'),_0x4ff2fb[_0xdc51('0x21')],_0x4ff2fb['id']),util[_0xdc51('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x845505(_0xe39573);});}else{return _0x845505(null,_0x26c668);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index cdd1358..2e1e28f 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 _0xce62=['info','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowZohoAccount','find','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce62,0x83));var _0x2ce6=function(_0x5bff32,_0x4a5afd){_0x5bff32=_0x5bff32-0x0;var _0x5035ce=_0xce62[_0x5bff32];return _0x5035ce;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});}exports[_0x2ce6('0x15')]=function(_0x353894){var _0x37b5d1=this;return new Promise(function(_0x4f9ceb,_0xa00781){return db[_0x2ce6('0x16')][_0x2ce6('0x17')]({'raw':_0x353894['options']?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x353894[_0x2ce6('0x18')]?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1a')]||null:null,'attributes':_0x353894['options']?_0x353894[_0x2ce6('0x18')]['attributes']||null:null,'limit':_0x353894['options']?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1b')]||null:null,'include':_0x353894[_0x2ce6('0x18')]?_0x353894['options'][_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1c')],function(_0x5a4656){return{'model':db[_0x5a4656[_0x2ce6('0x1e')]],'as':_0x5a4656['as'],'attributes':_0x5a4656[_0x2ce6('0x1f')],'include':_0x5a4656[_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x5a4656[_0x2ce6('0x1c')],function(_0x366ada){return{'model':db[_0x366ada[_0x2ce6('0x1e')]],'as':_0x366ada['as'],'attributes':_0x366ada['attributes'],'include':_0x366ada['include']?_['map'](_0x366ada[_0x2ce6('0x1c')],function(_0x2df836){return{'model':db[_0x2df836['model']],'as':_0x2df836['as'],'attributes':_0x2df836['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ce6('0xc')](function(_0x126e43){logger[_0x2ce6('0xd')](_0x2ce6('0x15'),_0x353894);logger['debug']('GetZohoAccount',_0x353894,JSON[_0x2ce6('0x20')](_0x126e43));_0x4f9ceb(_0x126e43);})[_0x2ce6('0x14')](function(_0x2fd596){logger['error']('GetZohoAccount',_0x2fd596['message'],_0x353894);_0xa00781(_0x37b5d1[_0x2ce6('0xf')](0x1f4,_0x2fd596['message']));});});};exports[_0x2ce6('0x21')]=function(_0x287568){var _0x1669ae=this;return new Promise(function(_0x396092,_0x3c9bad){return db['ZohoAccount'][_0x2ce6('0x22')]({'raw':_0x287568[_0x2ce6('0x18')]?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x287568['options']?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x1a')]||null:null,'attributes':_0x287568[_0x2ce6('0x18')]?_0x287568['options'][_0x2ce6('0x1f')]||null:null,'include':_0x287568[_0x2ce6('0x18')]?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x287568[_0x2ce6('0x18')]['include'],function(_0x28734c){return{'model':db[_0x28734c['model']],'as':_0x28734c['as'],'attributes':_0x28734c['attributes'],'include':_0x28734c['include']?_[_0x2ce6('0x1d')](_0x28734c[_0x2ce6('0x1c')],function(_0xc50a7b){return{'model':db[_0xc50a7b[_0x2ce6('0x1e')]],'as':_0xc50a7b['as'],'attributes':_0xc50a7b[_0x2ce6('0x1f')],'include':_0xc50a7b[_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0xc50a7b[_0x2ce6('0x1c')],function(_0x3702b0){return{'model':db[_0x3702b0[_0x2ce6('0x1e')]],'as':_0x3702b0['as'],'attributes':_0x3702b0[_0x2ce6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2ce6('0xc')](function(_0x3553d2){logger[_0x2ce6('0xd')](_0x2ce6('0x21'),_0x287568);logger[_0x2ce6('0x23')]('ShowZohoAccount',_0x287568,JSON[_0x2ce6('0x20')](_0x3553d2));_0x396092(_0x3553d2);})[_0x2ce6('0x14')](function(_0x13346e){logger[_0x2ce6('0xf')]('ShowZohoAccount',_0x13346e[_0x2ce6('0x12')],_0x287568);_0x3c9bad(_0x1669ae['error'](0x1f4,_0x13346e[_0x2ce6('0x12')]));});});}; \ No newline at end of file +var _0x77e6=['result','catch','ZohoAccount','findAll','options','where','attributes','limit','include','model','map','GetZohoAccount','ShowZohoAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message'];(function(_0x1b691a,_0x3aea0d){var _0x5de158=function(_0x395b4a){while(--_0x395b4a){_0x1b691a['push'](_0x1b691a['shift']());}};_0x5de158(++_0x3aea0d);}(_0x77e6,0x1a6));var _0x677e=function(_0xfd8ce9,_0x2114bd){_0xfd8ce9=_0xfd8ce9-0x0;var _0x4a633e=_0x77e6[_0xfd8ce9];return _0x4a633e;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['GetZohoAccount']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')]({'raw':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1b')]||null:null,'attributes':_0x1c5124['options']?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null,'include':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['include']?_['map'](_0x1c5124['options'][_0x677e('0x1e')],function(_0x154fce){return{'model':db[_0x154fce[_0x677e('0x1f')]],'as':_0x154fce['as'],'attributes':_0x154fce[_0x677e('0x1c')],'include':_0x154fce[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x154fce[_0x677e('0x1e')],function(_0x42f2b8){return{'model':db[_0x42f2b8[_0x677e('0x1f')]],'as':_0x42f2b8['as'],'attributes':_0x42f2b8[_0x677e('0x1c')],'include':_0x42f2b8['include']?_['map'](_0x42f2b8[_0x677e('0x1e')],function(_0x184f68){return{'model':db[_0x184f68['model']],'as':_0x184f68['as'],'attributes':_0x184f68[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0xf6b3ad){logger[_0x677e('0xd')](_0x677e('0x21'),_0x1c5124);logger[_0x677e('0xf')]('GetZohoAccount',_0x1c5124,JSON[_0x677e('0x11')](_0xf6b3ad));_0x385b06(_0xf6b3ad);})[_0x677e('0x17')](function(_0xeca8e2){logger[_0x677e('0x12')](_0x677e('0x21'),_0xeca8e2[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0xeca8e2[_0x677e('0x15')]));});});};exports[_0x677e('0x22')]=function(_0x4c5113){var _0x22ccfb=this;return new Promise(function(_0x3cac19,_0x2fb815){return db[_0x677e('0x18')][_0x677e('0x23')]({'raw':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x24')]===undefined?!![]:![]:!![],'where':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')]['where']||null:null,'attributes':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'include':_0x4c5113[_0x677e('0x1a')]?_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')]?_['map'](_0x4c5113[_0x677e('0x1a')][_0x677e('0x1e')],function(_0x2d0bc0){return{'model':db[_0x2d0bc0['model']],'as':_0x2d0bc0['as'],'attributes':_0x2d0bc0[_0x677e('0x1c')],'include':_0x2d0bc0[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x2d0bc0[_0x677e('0x1e')],function(_0x35c945){return{'model':db[_0x35c945['model']],'as':_0x35c945['as'],'attributes':_0x35c945[_0x677e('0x1c')],'include':_0x35c945[_0x677e('0x1e')]?_[_0x677e('0x20')](_0x35c945[_0x677e('0x1e')],function(_0x548b22){return{'model':db[_0x548b22[_0x677e('0x1f')]],'as':_0x548b22['as'],'attributes':_0x548b22[_0x677e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x677e('0xc')](function(_0x576443){logger['info'](_0x677e('0x22'),_0x4c5113);logger[_0x677e('0xf')]('ShowZohoAccount',_0x4c5113,JSON[_0x677e('0x11')](_0x576443));_0x3cac19(_0x576443);})[_0x677e('0x17')](function(_0x497dca){logger['error'](_0x677e('0x22'),_0x497dca[_0x677e('0x15')],_0x4c5113);_0x2fb815(_0x22ccfb['error'](0x1f4,_0x497dca['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 4eccc32..5380f6b 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 _0x406b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','multer','connect-timeout','express','Router'];(function(_0x1ed46f,_0x7691d7){var _0x43b931=function(_0x5f2454){while(--_0x5f2454){_0x1ed46f['push'](_0x1ed46f['shift']());}};_0x43b931(++_0x7691d7);}(_0x406b,0x1e2));var _0xb406=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x406b[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xb406('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb406('0x1'));var express=require(_0xb406('0x2'));var router=express[_0xb406('0x3')]();var fs_extra=require(_0xb406('0x4'));var auth=require(_0xb406('0x5'));var interaction=require(_0xb406('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xb406('0x7')]('/',auth[_0xb406('0x8')](),controller[_0xb406('0x9')]);router[_0xb406('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb406('0x7')](_0xb406('0xa'),auth[_0xb406('0x8')](),controller['getFields']);router['get'](_0xb406('0xb'),auth[_0xb406('0x8')](),controller[_0xb406('0xc')]);router[_0xb406('0x7')](_0xb406('0xd'),auth[_0xb406('0x8')](),controller[_0xb406('0xe')]);router['post']('/',auth[_0xb406('0x8')](),controller['create']);router[_0xb406('0xf')]('/:id',auth[_0xb406('0x8')](),controller[_0xb406('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb406('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2ea3=['put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','post','create'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x2ea3,0x1d0));var _0x32ea=function(_0x3a5d3e,_0x487277){_0x3a5d3e=_0x3a5d3e-0x0;var _0x3f4d04=_0x2ea3[_0x3a5d3e];return _0x3f4d04;};'use strict';var multer=require(_0x32ea('0x0'));var util=require(_0x32ea('0x1'));var path=require(_0x32ea('0x2'));var timeout=require(_0x32ea('0x3'));var express=require(_0x32ea('0x4'));var router=express[_0x32ea('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x32ea('0x6'));var config=require(_0x32ea('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x32ea('0x8')]('/',auth[_0x32ea('0x9')](),controller['index']);router[_0x32ea('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x32ea('0xa')]);router['get'](_0x32ea('0xb'),auth[_0x32ea('0x9')](),controller['getFields']);router['get'](_0x32ea('0xc'),auth[_0x32ea('0x9')](),controller['getSubjects']);router[_0x32ea('0x8')](_0x32ea('0xd'),auth[_0x32ea('0x9')](),controller['getDescriptions']);router[_0x32ea('0xe')]('/',auth['isAuthenticated'](),controller[_0x32ea('0xf')]);router[_0x32ea('0x10')]('/:id',auth[_0x32ea('0x9')](),controller['update']);router['delete'](_0x32ea('0x11'),auth[_0x32ea('0x9')](),controller[_0x32ea('0x12')]);module[_0x32ea('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 875a074..497bed9 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 _0x7d22=['ENUM','sequelize','exports','STRING','lead','contact'];(function(_0x44e0e6,_0x531905){var _0x55a344=function(_0x498e80){while(--_0x498e80){_0x44e0e6['push'](_0x44e0e6['shift']());}};_0x55a344(++_0x531905);}(_0x7d22,0x1cf));var _0x27d2=function(_0x2d2524,_0x62aa66){_0x2d2524=_0x2d2524-0x0;var _0x112232=_0x7d22[_0x2d2524];return _0x112232;};'use strict';var Sequelize=require(_0x27d2('0x0'));module[_0x27d2('0x1')]={'name':{'type':Sequelize[_0x27d2('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x27d2('0x3'),_0x27d2('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x27d2('0x5')]('contact_lead',_0x27d2('0x4'),_0x27d2('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x27d2('0x2')]}}; \ No newline at end of file +var _0xcb4f=['exports','ENUM','lead','contact','nothing','contact_lead','STRING','sequelize'];(function(_0x14acd5,_0x361989){var _0x593ebd=function(_0x1f5f7f){while(--_0x1f5f7f){_0x14acd5['push'](_0x14acd5['shift']());}};_0x593ebd(++_0x361989);}(_0xcb4f,0x147));var _0xfcb4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xcb4f[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0xfcb4('0x0'));module[_0xfcb4('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xfcb4('0x2')](_0xfcb4('0x3'),_0xfcb4('0x4'),_0xfcb4('0x5')),'defaultValue':_0xfcb4('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xfcb4('0x6'),_0xfcb4('0x4'),_0xfcb4('0x3')),'defaultValue':_0xfcb4('0x6')},'description':{'type':Sequelize[_0xfcb4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 8c2e3e0..8a5a180 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 _0xfbc3=['stack','name','send','map','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','body','find','getFields','ZohoField','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy'];(function(_0x421262,_0x3db68c){var _0x3922e3=function(_0xc31b57){while(--_0xc31b57){_0x421262['push'](_0x421262['shift']());}};_0x3922e3(++_0x3db68c);}(_0xfbc3,0x1a3));var _0x3fbc=function(_0x55e412,_0x448751){_0x55e412=_0x55e412-0x0;var _0xe36e95=_0xfbc3[_0x55e412];return _0xe36e95;};'use strict';var emlformat=require(_0x3fbc('0x0'));var rimraf=require(_0x3fbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fbc('0x2'));var rp=require(_0x3fbc('0x3'));var moment=require(_0x3fbc('0x4'));var BPromise=require(_0x3fbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3fbc('0x6'));var sox=require(_0x3fbc('0x7'));var csv=require(_0x3fbc('0x8'));var ejs=require(_0x3fbc('0x9'));var fs=require('fs');var fs_extra=require(_0x3fbc('0xa'));var _=require(_0x3fbc('0xb'));var squel=require(_0x3fbc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3fbc('0xd'));var toCsv=require(_0x3fbc('0x8'));var querystring=require('querystring');var Papa=require(_0x3fbc('0xe'));var Redis=require(_0x3fbc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3fbc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fbc('0x11'));var logger=require(_0x3fbc('0x12'))(_0x3fbc('0x13'));var utils=require(_0x3fbc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3fbc('0x15'))['db'];function respondWithStatusCode(_0x497ce2,_0x55ace5){_0x55ace5=_0x55ace5||0xcc;return function(_0x307f93){if(_0x307f93){return _0x497ce2[_0x3fbc('0x16')](_0x55ace5);}return _0x497ce2[_0x3fbc('0x17')](_0x55ace5)[_0x3fbc('0x18')]();};}function respondWithResult(_0x3d2826,_0x188030){_0x188030=_0x188030||0xc8;return function(_0x3b28e0){if(_0x3b28e0){return _0x3d2826[_0x3fbc('0x17')](_0x188030)[_0x3fbc('0x19')](_0x3b28e0);}};}function respondWithFilteredResult(_0x4bf2bc,_0xc29d91){return function(_0x5012c3){if(_0x5012c3){var _0x1a8cb4=typeof _0xc29d91[_0x3fbc('0x1a')]==='undefined'&&typeof _0xc29d91[_0x3fbc('0x1b')]===_0x3fbc('0x1c');var _0x5a3ac6=_0x5012c3[_0x3fbc('0x1d')];var _0x5d719c=_0x1a8cb4?0x0:_0xc29d91[_0x3fbc('0x1a')];var _0x2643f8=_0x1a8cb4?_0x5012c3[_0x3fbc('0x1d')]:_0xc29d91[_0x3fbc('0x1a')]+_0xc29d91['limit'];var _0x52e8b0;if(_0x2643f8>=_0x5a3ac6){_0x2643f8=_0x5a3ac6;_0x52e8b0=0xc8;}else{_0x52e8b0=0xce;}_0x4bf2bc['status'](_0x52e8b0);return _0x4bf2bc[_0x3fbc('0x1e')]('Content-Range',_0x5d719c+'-'+_0x2643f8+'/'+_0x5a3ac6)[_0x3fbc('0x19')](_0x5012c3);}return null;};}function patchUpdates(_0x46348a){return function(_0x54afe9){try{jsonpatch[_0x3fbc('0x1f')](_0x54afe9,_0x46348a,!![]);}catch(_0x26f2d4){return BPromise[_0x3fbc('0x20')](_0x26f2d4);}return _0x54afe9[_0x3fbc('0x21')]();};}function saveUpdates(_0x5500ba,_0xe29ef6){return function(_0xbff50){if(_0xbff50){return _0xbff50[_0x3fbc('0x22')](_0x5500ba)[_0x3fbc('0x23')](function(_0x38fb86){return _0x38fb86;});}return null;};}function removeEntity(_0x57110b,_0xb04f04){return function(_0x35a046){if(_0x35a046){return _0x35a046[_0x3fbc('0x24')]()[_0x3fbc('0x23')](function(){_0x57110b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3a20,_0x178c5c){return function(_0x48f4f2){if(!_0x48f4f2){_0x2f3a20[_0x3fbc('0x16')](0x194);}return _0x48f4f2;};}function handleError(_0x169461,_0x525681){_0x525681=_0x525681||0x1f4;return function(_0x3e17f7){logger['error'](_0x3e17f7[_0x3fbc('0x25')]);if(_0x3e17f7[_0x3fbc('0x26')]){delete _0x3e17f7['name'];}_0x169461[_0x3fbc('0x17')](_0x525681)[_0x3fbc('0x27')](_0x3e17f7);};}exports['index']=function(_0x505f02,_0x382add){var _0x4e6752={},_0x315f76={},_0x587099={'count':0x0,'rows':[]};var _0x2ec801=_[_0x3fbc('0x28')](db['ZohoConfiguration']['rawAttributes'],function(_0x59f31f){return{'name':_0x59f31f[_0x3fbc('0x29')],'type':_0x59f31f['type']['key']};});_0x315f76['model']=_[_0x3fbc('0x28')](_0x2ec801,_0x3fbc('0x26'));_0x315f76[_0x3fbc('0x2a')]=_[_0x3fbc('0x2b')](_0x505f02[_0x3fbc('0x2a')]);_0x315f76[_0x3fbc('0x2c')]=_[_0x3fbc('0x2d')](_0x315f76[_0x3fbc('0x2e')],_0x315f76[_0x3fbc('0x2a')]);_0x4e6752[_0x3fbc('0x2f')]=_[_0x3fbc('0x2d')](_0x315f76[_0x3fbc('0x2e')],qs[_0x3fbc('0x30')](_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x30')]));_0x4e6752[_0x3fbc('0x2f')]=_0x4e6752[_0x3fbc('0x2f')]['length']?_0x4e6752[_0x3fbc('0x2f')]:_0x315f76[_0x3fbc('0x2e')];if(!_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x31')](_0x3fbc('0x32'))){_0x4e6752[_0x3fbc('0x1b')]=qs[_0x3fbc('0x1b')](_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x1b')]);_0x4e6752[_0x3fbc('0x1a')]=qs['offset'](_0x505f02[_0x3fbc('0x2a')]['offset']);}_0x4e6752['order']=qs[_0x3fbc('0x33')](_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x33')]);_0x4e6752[_0x3fbc('0x34')]=qs[_0x3fbc('0x2c')](_[_0x3fbc('0x35')](_0x505f02[_0x3fbc('0x2a')],_0x315f76[_0x3fbc('0x2c')]),_0x2ec801);if(_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x36')]){_0x4e6752[_0x3fbc('0x34')]=_[_0x3fbc('0x37')](_0x4e6752[_0x3fbc('0x34')],{'$or':_[_0x3fbc('0x28')](_0x2ec801,function(_0x308fd1){if(_0x308fd1[_0x3fbc('0x38')]!=='VIRTUAL'){var _0x25669f={};_0x25669f[_0x308fd1['name']]={'$like':'%'+_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x36')]+'%'};return _0x25669f;}})});}_0x4e6752=_[_0x3fbc('0x37')]({},_0x4e6752,_0x505f02[_0x3fbc('0x39')]);var _0x2a4e3c={'where':_0x4e6752[_0x3fbc('0x34')]};return db[_0x3fbc('0x3a')][_0x3fbc('0x1d')](_0x2a4e3c)[_0x3fbc('0x23')](function(_0x33123f){_0x587099['count']=_0x33123f;if(_0x505f02[_0x3fbc('0x2a')][_0x3fbc('0x3b')]){_0x4e6752[_0x3fbc('0x3c')]=[{'all':!![]}];}return db[_0x3fbc('0x3a')][_0x3fbc('0x3d')](_0x4e6752);})[_0x3fbc('0x23')](function(_0x33b887){_0x587099[_0x3fbc('0x3e')]=_0x33b887;return _0x587099;})['then'](respondWithFilteredResult(_0x382add,_0x4e6752))[_0x3fbc('0x3f')](handleError(_0x382add,null));};exports[_0x3fbc('0x40')]=function(_0x1f5b7b,_0x2724a3){var _0x501644={'raw':![],'where':{'id':_0x1f5b7b[_0x3fbc('0x41')]['id']}},_0x16c74e={};_0x16c74e['model']=_[_0x3fbc('0x2b')](db[_0x3fbc('0x3a')][_0x3fbc('0x42')]);_0x16c74e[_0x3fbc('0x2a')]=_[_0x3fbc('0x2b')](_0x1f5b7b[_0x3fbc('0x2a')]);_0x16c74e[_0x3fbc('0x2c')]=_[_0x3fbc('0x2d')](_0x16c74e[_0x3fbc('0x2e')],_0x16c74e[_0x3fbc('0x2a')]);_0x501644[_0x3fbc('0x2f')]=_['intersection'](_0x16c74e[_0x3fbc('0x2e')],qs[_0x3fbc('0x30')](_0x1f5b7b[_0x3fbc('0x2a')][_0x3fbc('0x30')]));_0x501644[_0x3fbc('0x2f')]=_0x501644[_0x3fbc('0x2f')][_0x3fbc('0x43')]?_0x501644[_0x3fbc('0x2f')]:_0x16c74e[_0x3fbc('0x2e')];if(_0x1f5b7b[_0x3fbc('0x2a')][_0x3fbc('0x3b')]){_0x501644[_0x3fbc('0x3c')]=[{'all':!![]}];}_0x501644=_[_0x3fbc('0x37')]({},_0x501644,_0x1f5b7b[_0x3fbc('0x39')]);return db[_0x3fbc('0x3a')]['find'](_0x501644)['then'](handleEntityNotFound(_0x2724a3,null))[_0x3fbc('0x23')](respondWithResult(_0x2724a3,null))['catch'](handleError(_0x2724a3,null));};exports['create']=function(_0x2ffc4e,_0x3e5a96){return db[_0x3fbc('0x3a')]['create'](_0x2ffc4e[_0x3fbc('0x44')],{})['then'](respondWithResult(_0x3e5a96,0xc9))[_0x3fbc('0x3f')](handleError(_0x3e5a96,null));};exports['update']=function(_0x5a5520,_0xd80f59){if(_0x5a5520[_0x3fbc('0x44')]['id']){delete _0x5a5520['body']['id'];}return db[_0x3fbc('0x3a')]['find']({'where':{'id':_0x5a5520['params']['id']}})['then'](handleEntityNotFound(_0xd80f59,null))[_0x3fbc('0x23')](saveUpdates(_0x5a5520[_0x3fbc('0x44')],null))['then'](respondWithResult(_0xd80f59,null))[_0x3fbc('0x3f')](handleError(_0xd80f59,null));};exports[_0x3fbc('0x24')]=function(_0x3b2882,_0x52d479){return db[_0x3fbc('0x3a')][_0x3fbc('0x45')]({'where':{'id':_0x3b2882[_0x3fbc('0x41')]['id']}})[_0x3fbc('0x23')](handleEntityNotFound(_0x52d479,null))[_0x3fbc('0x23')](removeEntity(_0x52d479,null))['catch'](handleError(_0x52d479,null));};exports[_0x3fbc('0x46')]=function(_0x354b30,_0x4892be,_0x57b0d1){var _0x15b480={};var _0xf99a03={};var _0x3fa319;var _0x4570ac;return db[_0x3fbc('0x3a')]['findOne']({'where':{'id':_0x354b30[_0x3fbc('0x41')]['id']}})['then'](handleEntityNotFound(_0x4892be,null))[_0x3fbc('0x23')](function(_0x37f253){if(_0x37f253){_0x3fa319=_0x37f253;_0xf99a03[_0x3fbc('0x2e')]=_[_0x3fbc('0x2b')](db[_0x3fbc('0x47')][_0x3fbc('0x42')]);_0xf99a03[_0x3fbc('0x2a')]=_[_0x3fbc('0x2b')](_0x354b30[_0x3fbc('0x2a')]);_0xf99a03[_0x3fbc('0x2c')]=_[_0x3fbc('0x2d')](_0xf99a03[_0x3fbc('0x2e')],_0xf99a03[_0x3fbc('0x2a')]);_0x15b480['attributes']=_[_0x3fbc('0x2d')](_0xf99a03[_0x3fbc('0x2e')],qs[_0x3fbc('0x30')](_0x354b30['query'][_0x3fbc('0x30')]));_0x15b480['attributes']=_0x15b480[_0x3fbc('0x2f')][_0x3fbc('0x43')]?_0x15b480[_0x3fbc('0x2f')]:_0xf99a03[_0x3fbc('0x2e')];_0x15b480['order']=qs[_0x3fbc('0x33')](_0x354b30[_0x3fbc('0x2a')][_0x3fbc('0x33')]);_0x15b480[_0x3fbc('0x34')]=qs[_0x3fbc('0x2c')](_[_0x3fbc('0x35')](_0x354b30[_0x3fbc('0x2a')],_0xf99a03[_0x3fbc('0x2c')]));if(_0x354b30['query'][_0x3fbc('0x36')]){_0x15b480[_0x3fbc('0x34')]=_[_0x3fbc('0x37')](_0x15b480['where'],{'$or':_['map'](_0x15b480['attributes'],function(_0x34f289){var _0x45dc78={};_0x45dc78[_0x34f289]={'$like':'%'+_0x354b30['query'][_0x3fbc('0x36')]+'%'};return _0x45dc78;})});}_0x15b480=_['merge']({},_0x15b480,_0x354b30[_0x3fbc('0x39')]);return _0x3fa319['getFields'](_0x15b480);}})[_0x3fbc('0x23')](function(_0x4f28ad){if(_0x4f28ad){_0x4570ac=_0x4f28ad['length'];if(!_0x354b30['query'][_0x3fbc('0x31')](_0x3fbc('0x32'))){_0x15b480[_0x3fbc('0x1b')]=qs[_0x3fbc('0x1b')](_0x354b30['query'][_0x3fbc('0x1b')]);_0x15b480[_0x3fbc('0x1a')]=qs[_0x3fbc('0x1a')](_0x354b30[_0x3fbc('0x2a')][_0x3fbc('0x1a')]);}return _0x3fa319[_0x3fbc('0x46')](_0x15b480);}})[_0x3fbc('0x23')](function(_0x367067){if(_0x367067){return _0x367067?{'count':_0x4570ac,'rows':_0x367067}:null;}})[_0x3fbc('0x23')](respondWithResult(_0x4892be,null))[_0x3fbc('0x3f')](handleError(_0x4892be,null));};exports[_0x3fbc('0x48')]=function(_0x30d305,_0x8ab01a,_0x504154){var _0x1f431f={};var _0x29b789={};var _0x3dfd08;var _0x53188b;return db[_0x3fbc('0x3a')][_0x3fbc('0x49')]({'where':{'id':_0x30d305[_0x3fbc('0x41')]['id']}})[_0x3fbc('0x23')](handleEntityNotFound(_0x8ab01a,null))[_0x3fbc('0x23')](function(_0x5741e7){if(_0x5741e7){_0x3dfd08=_0x5741e7;_0x29b789[_0x3fbc('0x2e')]=_[_0x3fbc('0x2b')](db[_0x3fbc('0x47')]['rawAttributes']);_0x29b789[_0x3fbc('0x2a')]=_[_0x3fbc('0x2b')](_0x30d305['query']);_0x29b789['filters']=_['intersection'](_0x29b789[_0x3fbc('0x2e')],_0x29b789[_0x3fbc('0x2a')]);_0x1f431f[_0x3fbc('0x2f')]=_[_0x3fbc('0x2d')](_0x29b789[_0x3fbc('0x2e')],qs[_0x3fbc('0x30')](_0x30d305[_0x3fbc('0x2a')][_0x3fbc('0x30')]));_0x1f431f['attributes']=_0x1f431f['attributes']['length']?_0x1f431f[_0x3fbc('0x2f')]:_0x29b789[_0x3fbc('0x2e')];_0x1f431f[_0x3fbc('0x4a')]=qs['sort'](_0x30d305[_0x3fbc('0x2a')]['sort']);_0x1f431f[_0x3fbc('0x34')]=qs[_0x3fbc('0x2c')](_['pick'](_0x30d305['query'],_0x29b789[_0x3fbc('0x2c')]));if(_0x30d305[_0x3fbc('0x2a')]['filter']){_0x1f431f['where']=_[_0x3fbc('0x37')](_0x1f431f['where'],{'$or':_[_0x3fbc('0x28')](_0x1f431f[_0x3fbc('0x2f')],function(_0x3bd816){var _0x2b11aa={};_0x2b11aa[_0x3bd816]={'$like':'%'+_0x30d305['query'][_0x3fbc('0x36')]+'%'};return _0x2b11aa;})});}_0x1f431f=_['merge']({},_0x1f431f,_0x30d305[_0x3fbc('0x39')]);return _0x3dfd08[_0x3fbc('0x48')](_0x1f431f);}})[_0x3fbc('0x23')](function(_0x493279){if(_0x493279){_0x53188b=_0x493279[_0x3fbc('0x43')];if(!_0x30d305[_0x3fbc('0x2a')][_0x3fbc('0x31')](_0x3fbc('0x32'))){_0x1f431f['limit']=qs[_0x3fbc('0x1b')](_0x30d305[_0x3fbc('0x2a')]['limit']);_0x1f431f[_0x3fbc('0x1a')]=qs[_0x3fbc('0x1a')](_0x30d305[_0x3fbc('0x2a')][_0x3fbc('0x1a')]);}return _0x3dfd08[_0x3fbc('0x48')](_0x1f431f);}})[_0x3fbc('0x23')](function(_0x2f921e){if(_0x2f921e){return _0x2f921e?{'count':_0x53188b,'rows':_0x2f921e}:null;}})[_0x3fbc('0x23')](respondWithResult(_0x8ab01a,null))[_0x3fbc('0x3f')](handleError(_0x8ab01a,null));};exports[_0x3fbc('0x4b')]=function(_0x2ca493,_0x3e568c,_0x2e56de){var _0x589525={};var _0x3fc63e={};var _0x5b0119;var _0x2ebf42;return db['ZohoConfiguration'][_0x3fbc('0x49')]({'where':{'id':_0x2ca493[_0x3fbc('0x41')]['id']}})[_0x3fbc('0x23')](handleEntityNotFound(_0x3e568c,null))[_0x3fbc('0x23')](function(_0x3b4695){if(_0x3b4695){_0x5b0119=_0x3b4695;_0x3fc63e[_0x3fbc('0x2e')]=_[_0x3fbc('0x2b')](db[_0x3fbc('0x47')][_0x3fbc('0x42')]);_0x3fc63e[_0x3fbc('0x2a')]=_[_0x3fbc('0x2b')](_0x2ca493[_0x3fbc('0x2a')]);_0x3fc63e[_0x3fbc('0x2c')]=_[_0x3fbc('0x2d')](_0x3fc63e[_0x3fbc('0x2e')],_0x3fc63e[_0x3fbc('0x2a')]);_0x589525[_0x3fbc('0x2f')]=_[_0x3fbc('0x2d')](_0x3fc63e[_0x3fbc('0x2e')],qs['fields'](_0x2ca493[_0x3fbc('0x2a')][_0x3fbc('0x30')]));_0x589525['attributes']=_0x589525[_0x3fbc('0x2f')][_0x3fbc('0x43')]?_0x589525[_0x3fbc('0x2f')]:_0x3fc63e[_0x3fbc('0x2e')];_0x589525[_0x3fbc('0x4a')]=qs[_0x3fbc('0x33')](_0x2ca493[_0x3fbc('0x2a')][_0x3fbc('0x33')]);_0x589525['where']=qs[_0x3fbc('0x2c')](_[_0x3fbc('0x35')](_0x2ca493[_0x3fbc('0x2a')],_0x3fc63e[_0x3fbc('0x2c')]));if(_0x2ca493[_0x3fbc('0x2a')][_0x3fbc('0x36')]){_0x589525[_0x3fbc('0x34')]=_[_0x3fbc('0x37')](_0x589525['where'],{'$or':_[_0x3fbc('0x28')](_0x589525[_0x3fbc('0x2f')],function(_0x3f23d5){var _0x36a9b5={};_0x36a9b5[_0x3f23d5]={'$like':'%'+_0x2ca493[_0x3fbc('0x2a')]['filter']+'%'};return _0x36a9b5;})});}_0x589525=_[_0x3fbc('0x37')]({},_0x589525,_0x2ca493[_0x3fbc('0x39')]);return _0x5b0119[_0x3fbc('0x4b')](_0x589525);}})[_0x3fbc('0x23')](function(_0x2931a1){if(_0x2931a1){_0x2ebf42=_0x2931a1['length'];if(!_0x2ca493['query'][_0x3fbc('0x31')]('nolimit')){_0x589525[_0x3fbc('0x1b')]=qs[_0x3fbc('0x1b')](_0x2ca493[_0x3fbc('0x2a')]['limit']);_0x589525['offset']=qs['offset'](_0x2ca493['query']['offset']);}return _0x5b0119[_0x3fbc('0x4b')](_0x589525);}})[_0x3fbc('0x23')](function(_0x7627cf){if(_0x7627cf){return _0x7627cf?{'count':_0x2ebf42,'rows':_0x7627cf}:null;}})[_0x3fbc('0x23')](respondWithResult(_0x3e568c,null))[_0x3fbc('0x3f')](handleError(_0x3e568c,null));}; \ No newline at end of file +var _0xba2f=['options','ZohoConfiguration','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','destroy','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','fieldName','key','map','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge'];(function(_0x34cdca,_0x4e13db){var _0x2fe9cf=function(_0x23c46f){while(--_0x23c46f){_0x34cdca['push'](_0x34cdca['shift']());}};_0x2fe9cf(++_0x4e13db);}(_0xba2f,0x147));var _0xfba2=function(_0x2d6d24,_0xaf0aec){_0x2d6d24=_0x2d6d24-0x0;var _0x37607e=_0xba2f[_0x2d6d24];return _0x37607e;};'use strict';var emlformat=require(_0xfba2('0x0'));var rimraf=require(_0xfba2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfba2('0x2'));var rp=require(_0xfba2('0x3'));var moment=require('moment');var BPromise=require(_0xfba2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfba2('0x5'));var csv=require(_0xfba2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfba2('0x7'));var crypto=require('crypto');var jsforce=require(_0xfba2('0x8'));var deskjs=require(_0xfba2('0x9'));var toCsv=require('to-csv');var querystring=require(_0xfba2('0xa'));var Papa=require(_0xfba2('0xb'));var Redis=require(_0xfba2('0xc'));var authService=require(_0xfba2('0xd'));var qs=require(_0xfba2('0xe'));var as=require(_0xfba2('0xf'));var hardwareService=require(_0xfba2('0x10'));var logger=require(_0xfba2('0x11'))(_0xfba2('0x12'));var utils=require(_0xfba2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfba2('0x14'));var db=require(_0xfba2('0x15'))['db'];function respondWithStatusCode(_0x3d13e4,_0x58a40f){_0x58a40f=_0x58a40f||0xcc;return function(_0x3a136e){if(_0x3a136e){return _0x3d13e4[_0xfba2('0x16')](_0x58a40f);}return _0x3d13e4[_0xfba2('0x17')](_0x58a40f)[_0xfba2('0x18')]();};}function respondWithResult(_0x1b0177,_0x5149bf){_0x5149bf=_0x5149bf||0xc8;return function(_0x437192){if(_0x437192){return _0x1b0177[_0xfba2('0x17')](_0x5149bf)[_0xfba2('0x19')](_0x437192);}};}function respondWithFilteredResult(_0x35aa6b,_0x5126d7){return function(_0x1ea2f2){if(_0x1ea2f2){var _0x448e57=typeof _0x5126d7[_0xfba2('0x1a')]===_0xfba2('0x1b')&&typeof _0x5126d7[_0xfba2('0x1c')]==='undefined';var _0x22cd2e=_0x1ea2f2[_0xfba2('0x1d')];var _0x1a33fb=_0x448e57?0x0:_0x5126d7[_0xfba2('0x1a')];var _0x4a3ade=_0x448e57?_0x1ea2f2[_0xfba2('0x1d')]:_0x5126d7['offset']+_0x5126d7[_0xfba2('0x1c')];var _0x4b42e5;if(_0x4a3ade>=_0x22cd2e){_0x4a3ade=_0x22cd2e;_0x4b42e5=0xc8;}else{_0x4b42e5=0xce;}_0x35aa6b[_0xfba2('0x17')](_0x4b42e5);return _0x35aa6b[_0xfba2('0x1e')](_0xfba2('0x1f'),_0x1a33fb+'-'+_0x4a3ade+'/'+_0x22cd2e)[_0xfba2('0x19')](_0x1ea2f2);}return null;};}function patchUpdates(_0x1ae4ac){return function(_0x42e8a5){try{jsonpatch['apply'](_0x42e8a5,_0x1ae4ac,!![]);}catch(_0x52cfed){return BPromise['reject'](_0x52cfed);}return _0x42e8a5[_0xfba2('0x20')]();};}function saveUpdates(_0x30920c,_0x3272ff){return function(_0x566208){if(_0x566208){return _0x566208[_0xfba2('0x21')](_0x30920c)[_0xfba2('0x22')](function(_0x5ac01c){return _0x5ac01c;});}return null;};}function removeEntity(_0xfddbda,_0x349e4e){return function(_0x182603){if(_0x182603){return _0x182603['destroy']()[_0xfba2('0x22')](function(){_0xfddbda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41d3bc,_0x3900c6){return function(_0x18c4e5){if(!_0x18c4e5){_0x41d3bc[_0xfba2('0x16')](0x194);}return _0x18c4e5;};}function handleError(_0x14a333,_0x608edb){_0x608edb=_0x608edb||0x1f4;return function(_0x2dcba8){logger[_0xfba2('0x23')](_0x2dcba8['stack']);if(_0x2dcba8[_0xfba2('0x24')]){delete _0x2dcba8['name'];}_0x14a333[_0xfba2('0x17')](_0x608edb)[_0xfba2('0x25')](_0x2dcba8);};}exports['index']=function(_0x2cce0f,_0x26c8fc){var _0x5e1cec={},_0x351628={},_0x3c3612={'count':0x0,'rows':[]};var _0x3329da=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x19d4d3){return{'name':_0x19d4d3[_0xfba2('0x26')],'type':_0x19d4d3['type'][_0xfba2('0x27')]};});_0x351628['model']=_[_0xfba2('0x28')](_0x3329da,_0xfba2('0x24'));_0x351628[_0xfba2('0x29')]=_[_0xfba2('0x2a')](_0x2cce0f['query']);_0x351628['filters']=_[_0xfba2('0x2b')](_0x351628['model'],_0x351628[_0xfba2('0x29')]);_0x5e1cec['attributes']=_[_0xfba2('0x2b')](_0x351628['model'],qs[_0xfba2('0x2c')](_0x2cce0f['query']['fields']));_0x5e1cec[_0xfba2('0x2d')]=_0x5e1cec[_0xfba2('0x2d')][_0xfba2('0x2e')]?_0x5e1cec['attributes']:_0x351628[_0xfba2('0x2f')];if(!_0x2cce0f[_0xfba2('0x29')][_0xfba2('0x30')](_0xfba2('0x31'))){_0x5e1cec[_0xfba2('0x1c')]=qs[_0xfba2('0x1c')](_0x2cce0f[_0xfba2('0x29')]['limit']);_0x5e1cec[_0xfba2('0x1a')]=qs['offset'](_0x2cce0f['query']['offset']);}_0x5e1cec[_0xfba2('0x32')]=qs[_0xfba2('0x33')](_0x2cce0f[_0xfba2('0x29')]['sort']);_0x5e1cec[_0xfba2('0x34')]=qs[_0xfba2('0x35')](_['pick'](_0x2cce0f['query'],_0x351628[_0xfba2('0x35')]),_0x3329da);if(_0x2cce0f['query'][_0xfba2('0x36')]){_0x5e1cec[_0xfba2('0x34')]=_['merge'](_0x5e1cec['where'],{'$or':_[_0xfba2('0x28')](_0x3329da,function(_0x26f37f){if(_0x26f37f[_0xfba2('0x37')]!==_0xfba2('0x38')){var _0xafdd01={};_0xafdd01[_0x26f37f[_0xfba2('0x24')]]={'$like':'%'+_0x2cce0f['query'][_0xfba2('0x36')]+'%'};return _0xafdd01;}})});}_0x5e1cec=_[_0xfba2('0x39')]({},_0x5e1cec,_0x2cce0f[_0xfba2('0x3a')]);var _0x4dcbe8={'where':_0x5e1cec[_0xfba2('0x34')]};return db[_0xfba2('0x3b')][_0xfba2('0x1d')](_0x4dcbe8)[_0xfba2('0x22')](function(_0x4d38cb){_0x3c3612[_0xfba2('0x1d')]=_0x4d38cb;if(_0x2cce0f['query'][_0xfba2('0x3c')]){_0x5e1cec['include']=[{'all':!![]}];}return db[_0xfba2('0x3b')][_0xfba2('0x3d')](_0x5e1cec);})[_0xfba2('0x22')](function(_0x9cff43){_0x3c3612['rows']=_0x9cff43;return _0x3c3612;})['then'](respondWithFilteredResult(_0x26c8fc,_0x5e1cec))[_0xfba2('0x3e')](handleError(_0x26c8fc,null));};exports[_0xfba2('0x3f')]=function(_0x60e3a4,_0x4f5803){var _0x1395c3={'raw':![],'where':{'id':_0x60e3a4[_0xfba2('0x40')]['id']}},_0x7a47b1={};_0x7a47b1[_0xfba2('0x2f')]=_[_0xfba2('0x2a')](db['ZohoConfiguration'][_0xfba2('0x41')]);_0x7a47b1[_0xfba2('0x29')]=_[_0xfba2('0x2a')](_0x60e3a4['query']);_0x7a47b1[_0xfba2('0x35')]=_[_0xfba2('0x2b')](_0x7a47b1[_0xfba2('0x2f')],_0x7a47b1['query']);_0x1395c3['attributes']=_[_0xfba2('0x2b')](_0x7a47b1['model'],qs[_0xfba2('0x2c')](_0x60e3a4[_0xfba2('0x29')][_0xfba2('0x2c')]));_0x1395c3[_0xfba2('0x2d')]=_0x1395c3[_0xfba2('0x2d')][_0xfba2('0x2e')]?_0x1395c3[_0xfba2('0x2d')]:_0x7a47b1[_0xfba2('0x2f')];if(_0x60e3a4[_0xfba2('0x29')][_0xfba2('0x3c')]){_0x1395c3[_0xfba2('0x42')]=[{'all':!![]}];}_0x1395c3=_[_0xfba2('0x39')]({},_0x1395c3,_0x60e3a4[_0xfba2('0x3a')]);return db[_0xfba2('0x3b')][_0xfba2('0x43')](_0x1395c3)['then'](handleEntityNotFound(_0x4f5803,null))['then'](respondWithResult(_0x4f5803,null))[_0xfba2('0x3e')](handleError(_0x4f5803,null));};exports['create']=function(_0x4c9045,_0x12773a){return db[_0xfba2('0x3b')][_0xfba2('0x44')](_0x4c9045[_0xfba2('0x45')],{})[_0xfba2('0x22')](respondWithResult(_0x12773a,0xc9))[_0xfba2('0x3e')](handleError(_0x12773a,null));};exports[_0xfba2('0x21')]=function(_0x1f66f9,_0x583cde){if(_0x1f66f9[_0xfba2('0x45')]['id']){delete _0x1f66f9[_0xfba2('0x45')]['id'];}return db[_0xfba2('0x3b')][_0xfba2('0x43')]({'where':{'id':_0x1f66f9[_0xfba2('0x40')]['id']}})[_0xfba2('0x22')](handleEntityNotFound(_0x583cde,null))[_0xfba2('0x22')](saveUpdates(_0x1f66f9[_0xfba2('0x45')],null))[_0xfba2('0x22')](respondWithResult(_0x583cde,null))[_0xfba2('0x3e')](handleError(_0x583cde,null));};exports[_0xfba2('0x46')]=function(_0x5710c8,_0x5bcf1c){return db[_0xfba2('0x3b')][_0xfba2('0x43')]({'where':{'id':_0x5710c8[_0xfba2('0x40')]['id']}})[_0xfba2('0x22')](handleEntityNotFound(_0x5bcf1c,null))[_0xfba2('0x22')](removeEntity(_0x5bcf1c,null))[_0xfba2('0x3e')](handleError(_0x5bcf1c,null));};exports[_0xfba2('0x47')]=function(_0x5c2772,_0xfd71ac,_0x5c1fb5){var _0x172e5a={};var _0x5bcfb9={};var _0x1030cf;var _0x360b8d;return db[_0xfba2('0x3b')][_0xfba2('0x48')]({'where':{'id':_0x5c2772[_0xfba2('0x40')]['id']}})[_0xfba2('0x22')](handleEntityNotFound(_0xfd71ac,null))['then'](function(_0x505c80){if(_0x505c80){_0x1030cf=_0x505c80;_0x5bcfb9[_0xfba2('0x2f')]=_[_0xfba2('0x2a')](db[_0xfba2('0x49')][_0xfba2('0x41')]);_0x5bcfb9['query']=_[_0xfba2('0x2a')](_0x5c2772[_0xfba2('0x29')]);_0x5bcfb9['filters']=_['intersection'](_0x5bcfb9[_0xfba2('0x2f')],_0x5bcfb9[_0xfba2('0x29')]);_0x172e5a[_0xfba2('0x2d')]=_[_0xfba2('0x2b')](_0x5bcfb9['model'],qs[_0xfba2('0x2c')](_0x5c2772[_0xfba2('0x29')][_0xfba2('0x2c')]));_0x172e5a[_0xfba2('0x2d')]=_0x172e5a[_0xfba2('0x2d')][_0xfba2('0x2e')]?_0x172e5a[_0xfba2('0x2d')]:_0x5bcfb9['model'];_0x172e5a[_0xfba2('0x32')]=qs[_0xfba2('0x33')](_0x5c2772[_0xfba2('0x29')][_0xfba2('0x33')]);_0x172e5a['where']=qs['filters'](_[_0xfba2('0x4a')](_0x5c2772[_0xfba2('0x29')],_0x5bcfb9[_0xfba2('0x35')]));if(_0x5c2772[_0xfba2('0x29')]['filter']){_0x172e5a[_0xfba2('0x34')]=_[_0xfba2('0x39')](_0x172e5a[_0xfba2('0x34')],{'$or':_[_0xfba2('0x28')](_0x172e5a['attributes'],function(_0x2fa8f1){var _0x1725a4={};_0x1725a4[_0x2fa8f1]={'$like':'%'+_0x5c2772[_0xfba2('0x29')][_0xfba2('0x36')]+'%'};return _0x1725a4;})});}_0x172e5a=_[_0xfba2('0x39')]({},_0x172e5a,_0x5c2772[_0xfba2('0x3a')]);return _0x1030cf['getFields'](_0x172e5a);}})['then'](function(_0x1b08bb){if(_0x1b08bb){_0x360b8d=_0x1b08bb['length'];if(!_0x5c2772['query'][_0xfba2('0x30')](_0xfba2('0x31'))){_0x172e5a[_0xfba2('0x1c')]=qs[_0xfba2('0x1c')](_0x5c2772[_0xfba2('0x29')]['limit']);_0x172e5a[_0xfba2('0x1a')]=qs[_0xfba2('0x1a')](_0x5c2772[_0xfba2('0x29')][_0xfba2('0x1a')]);}return _0x1030cf[_0xfba2('0x47')](_0x172e5a);}})[_0xfba2('0x22')](function(_0x5ca317){if(_0x5ca317){return _0x5ca317?{'count':_0x360b8d,'rows':_0x5ca317}:null;}})[_0xfba2('0x22')](respondWithResult(_0xfd71ac,null))[_0xfba2('0x3e')](handleError(_0xfd71ac,null));};exports[_0xfba2('0x4b')]=function(_0x2ea29e,_0x3bbab3,_0x8b4d3e){var _0x2ac8e8={};var _0x4e874c={};var _0x4132e1;var _0x3b2970;return db[_0xfba2('0x3b')][_0xfba2('0x48')]({'where':{'id':_0x2ea29e[_0xfba2('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bbab3,null))[_0xfba2('0x22')](function(_0x41efdb){if(_0x41efdb){_0x4132e1=_0x41efdb;_0x4e874c['model']=_[_0xfba2('0x2a')](db[_0xfba2('0x49')][_0xfba2('0x41')]);_0x4e874c[_0xfba2('0x29')]=_['keys'](_0x2ea29e[_0xfba2('0x29')]);_0x4e874c[_0xfba2('0x35')]=_['intersection'](_0x4e874c[_0xfba2('0x2f')],_0x4e874c['query']);_0x2ac8e8[_0xfba2('0x2d')]=_[_0xfba2('0x2b')](_0x4e874c['model'],qs[_0xfba2('0x2c')](_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x2c')]));_0x2ac8e8[_0xfba2('0x2d')]=_0x2ac8e8['attributes'][_0xfba2('0x2e')]?_0x2ac8e8[_0xfba2('0x2d')]:_0x4e874c['model'];_0x2ac8e8[_0xfba2('0x32')]=qs[_0xfba2('0x33')](_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x33')]);_0x2ac8e8[_0xfba2('0x34')]=qs['filters'](_['pick'](_0x2ea29e[_0xfba2('0x29')],_0x4e874c[_0xfba2('0x35')]));if(_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x36')]){_0x2ac8e8[_0xfba2('0x34')]=_[_0xfba2('0x39')](_0x2ac8e8[_0xfba2('0x34')],{'$or':_[_0xfba2('0x28')](_0x2ac8e8[_0xfba2('0x2d')],function(_0x4bad12){var _0xd04f0={};_0xd04f0[_0x4bad12]={'$like':'%'+_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x36')]+'%'};return _0xd04f0;})});}_0x2ac8e8=_[_0xfba2('0x39')]({},_0x2ac8e8,_0x2ea29e[_0xfba2('0x3a')]);return _0x4132e1['getSubjects'](_0x2ac8e8);}})[_0xfba2('0x22')](function(_0x2516bc){if(_0x2516bc){_0x3b2970=_0x2516bc[_0xfba2('0x2e')];if(!_0x2ea29e[_0xfba2('0x29')]['hasOwnProperty'](_0xfba2('0x31'))){_0x2ac8e8[_0xfba2('0x1c')]=qs['limit'](_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x1c')]);_0x2ac8e8[_0xfba2('0x1a')]=qs[_0xfba2('0x1a')](_0x2ea29e[_0xfba2('0x29')][_0xfba2('0x1a')]);}return _0x4132e1[_0xfba2('0x4b')](_0x2ac8e8);}})[_0xfba2('0x22')](function(_0x4d0a04){if(_0x4d0a04){return _0x4d0a04?{'count':_0x3b2970,'rows':_0x4d0a04}:null;}})[_0xfba2('0x22')](respondWithResult(_0x3bbab3,null))['catch'](handleError(_0x3bbab3,null));};exports['getDescriptions']=function(_0x18e0da,_0x4cc33e,_0x3e00a2){var _0x3605b5={};var _0x29fec3={};var _0x40b079;var _0x33d4ba;return db[_0xfba2('0x3b')]['findOne']({'where':{'id':_0x18e0da['params']['id']}})[_0xfba2('0x22')](handleEntityNotFound(_0x4cc33e,null))['then'](function(_0x4d26c7){if(_0x4d26c7){_0x40b079=_0x4d26c7;_0x29fec3['model']=_[_0xfba2('0x2a')](db['ZohoField'][_0xfba2('0x41')]);_0x29fec3[_0xfba2('0x29')]=_['keys'](_0x18e0da[_0xfba2('0x29')]);_0x29fec3['filters']=_[_0xfba2('0x2b')](_0x29fec3['model'],_0x29fec3[_0xfba2('0x29')]);_0x3605b5[_0xfba2('0x2d')]=_[_0xfba2('0x2b')](_0x29fec3['model'],qs[_0xfba2('0x2c')](_0x18e0da[_0xfba2('0x29')]['fields']));_0x3605b5[_0xfba2('0x2d')]=_0x3605b5['attributes'][_0xfba2('0x2e')]?_0x3605b5['attributes']:_0x29fec3[_0xfba2('0x2f')];_0x3605b5[_0xfba2('0x32')]=qs[_0xfba2('0x33')](_0x18e0da['query'][_0xfba2('0x33')]);_0x3605b5[_0xfba2('0x34')]=qs[_0xfba2('0x35')](_[_0xfba2('0x4a')](_0x18e0da[_0xfba2('0x29')],_0x29fec3[_0xfba2('0x35')]));if(_0x18e0da[_0xfba2('0x29')][_0xfba2('0x36')]){_0x3605b5['where']=_[_0xfba2('0x39')](_0x3605b5[_0xfba2('0x34')],{'$or':_[_0xfba2('0x28')](_0x3605b5['attributes'],function(_0x23c81a){var _0x4e2a98={};_0x4e2a98[_0x23c81a]={'$like':'%'+_0x18e0da[_0xfba2('0x29')][_0xfba2('0x36')]+'%'};return _0x4e2a98;})});}_0x3605b5=_[_0xfba2('0x39')]({},_0x3605b5,_0x18e0da[_0xfba2('0x3a')]);return _0x40b079[_0xfba2('0x4c')](_0x3605b5);}})[_0xfba2('0x22')](function(_0x42d4fc){if(_0x42d4fc){_0x33d4ba=_0x42d4fc[_0xfba2('0x2e')];if(!_0x18e0da[_0xfba2('0x29')][_0xfba2('0x30')](_0xfba2('0x31'))){_0x3605b5[_0xfba2('0x1c')]=qs[_0xfba2('0x1c')](_0x18e0da[_0xfba2('0x29')][_0xfba2('0x1c')]);_0x3605b5[_0xfba2('0x1a')]=qs[_0xfba2('0x1a')](_0x18e0da[_0xfba2('0x29')][_0xfba2('0x1a')]);}return _0x40b079[_0xfba2('0x4c')](_0x3605b5);}})[_0xfba2('0x22')](function(_0x2cee2c){if(_0x2cee2c){return _0x2cee2c?{'count':_0x33d4ba,'rows':_0x2cee2c}:null;}})[_0xfba2('0x22')](respondWithResult(_0x4cc33e,null))[_0xfba2('0x3e')](handleError(_0x4cc33e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 17ddde8..ab230b4 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 _0xdf7b=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment'];(function(_0x1cd1f5,_0x459609){var _0x393ebe=function(_0x463e54){while(--_0x463e54){_0x1cd1f5['push'](_0x1cd1f5['shift']());}};_0x393ebe(++_0x459609);}(_0xdf7b,0x8c));var _0xbdf7=function(_0x147c96,_0x309657){_0x147c96=_0x147c96-0x0;var _0x4ec711=_0xdf7b[_0x147c96];return _0x4ec711;};'use strict';var _=require(_0xbdf7('0x0'));var util=require(_0xbdf7('0x1'));var logger=require(_0xbdf7('0x2'))('api');var moment=require(_0xbdf7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdf7('0x4'));var rimraf=require(_0xbdf7('0x5'));var config=require(_0xbdf7('0x6'));var attributes=require(_0xbdf7('0x7'));module[_0xbdf7('0x8')]=function(_0x5eaa61,_0x4b5819){return _0x5eaa61[_0xbdf7('0x9')](_0xbdf7('0xa'),attributes,{'tableName':_0xbdf7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0b4=['request-promise','path','rimraf','../../config/environment','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','bluebird'];(function(_0x58896b,_0x47e042){var _0x1d89be=function(_0xf89b71){while(--_0xf89b71){_0x58896b['push'](_0x58896b['shift']());}};_0x1d89be(++_0x47e042);}(_0xf0b4,0xce));var _0x4f0b=function(_0x3b28b6,_0x14d1cb){_0x3b28b6=_0x3b28b6-0x0;var _0x4667ff=_0xf0b4[_0x3b28b6];return _0x4667ff;};'use strict';var _=require('lodash');var util=require(_0x4f0b('0x0'));var logger=require(_0x4f0b('0x1'))(_0x4f0b('0x2'));var moment=require('moment');var BPromise=require(_0x4f0b('0x3'));var rp=require(_0x4f0b('0x4'));var fs=require('fs');var path=require(_0x4f0b('0x5'));var rimraf=require(_0x4f0b('0x6'));var config=require(_0x4f0b('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x275d90,_0x221268){return _0x275d90['define'](_0x4f0b('0x8'),attributes,{'tableName':_0x4f0b('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 9c8afc6..1b9429c 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 _0xbae1=['result','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0xbae1,0x1b7));var _0x1bae=function(_0x1e003b,_0x3e4ded){_0x1e003b=_0x1e003b-0x0;var _0x268789=_0xbae1[_0x1e003b];return _0x268789;};'use strict';var _=require('lodash');var util=require(_0x1bae('0x0'));var moment=require(_0x1bae('0x1'));var BPromise=require('bluebird');var rs=require(_0x1bae('0x2'));var fs=require('fs');var Redis=require(_0x1bae('0x3'));var db=require(_0x1bae('0x4'))['db'];var utils=require(_0x1bae('0x5'));var logger=require(_0x1bae('0x6'))(_0x1bae('0x7'));var config=require(_0x1bae('0x8'));var jayson=require(_0x1bae('0x9'));var client=jayson[_0x1bae('0xa')][_0x1bae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cab53,_0x4c4e7f,_0x53887c){return new BPromise(function(_0x3939f8,_0x50d8c6){return client[_0x1bae('0xc')](_0x3cab53,_0x53887c)['then'](function(_0x599aaa){logger[_0x1bae('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c4e7f,'request\x20sent');logger[_0x1bae('0xe')](_0x1bae('0xf'),_0x4c4e7f,_0x1bae('0x10'),JSON[_0x1bae('0x11')](_0x599aaa));if(_0x599aaa[_0x1bae('0x12')]){if(_0x599aaa[_0x1bae('0x12')][_0x1bae('0x13')]===0x1f4){logger['error'](_0x1bae('0x14'),_0x4c4e7f,_0x599aaa['error']['message']);return _0x50d8c6(_0x599aaa[_0x1bae('0x12')]['message']);}logger[_0x1bae('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c4e7f,_0x599aaa[_0x1bae('0x12')]['message']);return _0x3939f8(_0x599aaa[_0x1bae('0x12')]['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4c4e7f,_0x1bae('0x10'));_0x3939f8(_0x599aaa[_0x1bae('0x15')][_0x1bae('0x16')]);}})['catch'](function(_0x38162b){logger[_0x1bae('0x12')](_0x1bae('0x14'),_0x4c4e7f,_0x38162b);_0x50d8c6(_0x38162b);});});} \ No newline at end of file +var _0x757c=['client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x36d28d,_0x5a9e25){var _0x361848=function(_0x569326){while(--_0x569326){_0x36d28d['push'](_0x36d28d['shift']());}};_0x361848(++_0x5a9e25);}(_0x757c,0x65));var _0xc757=function(_0xd3dfd8,_0x178bf3){_0xd3dfd8=_0xd3dfd8-0x0;var _0x2fffa1=_0x757c[_0xd3dfd8];return _0x2fffa1;};'use strict';var _=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var moment=require(_0xc757('0x2'));var BPromise=require(_0xc757('0x3'));var rs=require(_0xc757('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc757('0x5'))['db'];var utils=require(_0xc757('0x6'));var logger=require(_0xc757('0x7'))('rpc');var config=require(_0xc757('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc757('0x9')][_0xc757('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17631a,_0x2ca281,_0x283f5c){return new BPromise(function(_0x51abf2,_0x27ba59){return client[_0xc757('0xb')](_0x17631a,_0x283f5c)[_0xc757('0xc')](function(_0x488e6e){logger[_0xc757('0xd')](_0xc757('0xe'),_0x2ca281,_0xc757('0xf'));logger['debug'](_0xc757('0x10'),_0x2ca281,'request\x20sent',JSON[_0xc757('0x11')](_0x488e6e));if(_0x488e6e[_0xc757('0x12')]){if(_0x488e6e['error'][_0xc757('0x13')]===0x1f4){logger['error'](_0xc757('0xe'),_0x2ca281,_0x488e6e[_0xc757('0x12')][_0xc757('0x14')]);return _0x27ba59(_0x488e6e['error']['message']);}logger['error'](_0xc757('0xe'),_0x2ca281,_0x488e6e[_0xc757('0x12')]['message']);return _0x51abf2(_0x488e6e[_0xc757('0x12')][_0xc757('0x14')]);}else{logger[_0xc757('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ca281,_0xc757('0xf'));_0x51abf2(_0x488e6e['result']['message']);}})[_0xc757('0x15')](function(_0x3c6279){logger[_0xc757('0x12')](_0xc757('0xe'),_0x2ca281,_0x3c6279);_0x27ba59(_0x3c6279);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3fc40f7..4145963 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 _0x27ba=['create','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x54445b,_0xbcc01f){var _0x2a0714=function(_0x2b5d10){while(--_0x2b5d10){_0x54445b['push'](_0x54445b['shift']());}};_0x2a0714(++_0xbcc01f);}(_0x27ba,0xdc));var _0xa27b=function(_0x1c0ec7,_0x5c860e){_0x1c0ec7=_0x1c0ec7-0x0;var _0x13387d=_0x27ba[_0x1c0ec7];return _0x13387d;};'use strict';var multer=require('multer');var util=require(_0xa27b('0x0'));var path=require(_0xa27b('0x1'));var timeout=require(_0xa27b('0x2'));var express=require('express');var router=express[_0xa27b('0x3')]();var fs_extra=require(_0xa27b('0x4'));var auth=require(_0xa27b('0x5'));var interaction=require(_0xa27b('0x6'));var config=require('../../config/environment');var controller=require(_0xa27b('0x7'));router[_0xa27b('0x8')]('/',auth[_0xa27b('0x9')](),controller[_0xa27b('0xa')]);router[_0xa27b('0x8')](_0xa27b('0xb'),auth[_0xa27b('0x9')](),controller[_0xa27b('0xc')]);router[_0xa27b('0xd')]('/',auth['isAuthenticated'](),controller[_0xa27b('0xe')]);router[_0xa27b('0xf')](_0xa27b('0xb'),auth[_0xa27b('0x9')](),controller[_0xa27b('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa27b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5467=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x5467,0x1e0));var _0x7546=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5467[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7546('0x0'));var util=require(_0x7546('0x1'));var path=require(_0x7546('0x2'));var timeout=require(_0x7546('0x3'));var express=require(_0x7546('0x4'));var router=express[_0x7546('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7546('0x6'));var interaction=require(_0x7546('0x7'));var config=require(_0x7546('0x8'));var controller=require('./intZohoField.controller');router[_0x7546('0x9')]('/',auth[_0x7546('0xa')](),controller[_0x7546('0xb')]);router[_0x7546('0x9')](_0x7546('0xc'),auth['isAuthenticated'](),controller[_0x7546('0xd')]);router[_0x7546('0xe')]('/',auth[_0x7546('0xa')](),controller[_0x7546('0xf')]);router[_0x7546('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7546('0x11')]);router[_0x7546('0x12')](_0x7546('0xc'),auth[_0x7546('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 805f88c..26afdd6 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 _0x53d3=['string','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x29d61d,_0x43ae85){var _0x50d092=function(_0x2efd9e){while(--_0x2efd9e){_0x29d61d['push'](_0x29d61d['shift']());}};_0x50d092(++_0x43ae85);}(_0x53d3,0x17f));var _0x353d=function(_0x37cb14,_0xfd74ab){_0x37cb14=_0x37cb14-0x0;var _0x40cc36=_0x53d3[_0x37cb14];return _0x40cc36;};'use strict';var Sequelize=require(_0x353d('0x0'));module['exports']={'type':{'type':Sequelize[_0x353d('0x1')](_0x353d('0x2'),'variable',_0x353d('0x3'),_0x353d('0x4'),'picklist'),'defaultValue':_0x353d('0x2')},'content':{'type':Sequelize[_0x353d('0x5')]},'key':{'type':Sequelize[_0x353d('0x5')]},'keyType':{'type':Sequelize[_0x353d('0x1')]('string','variable',_0x353d('0x3'))},'keyContent':{'type':Sequelize[_0x353d('0x5')]},'idField':{'type':Sequelize[_0x353d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x353d('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x353d('0x5')]}}; \ No newline at end of file +var _0x822a=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x822a,0x11d));var _0xa822=function(_0x22382f,_0x5c2e54){_0x22382f=_0x22382f-0x0;var _0x35213b=_0x822a[_0x22382f];return _0x35213b;};'use strict';var Sequelize=require(_0xa822('0x0'));module[_0xa822('0x1')]={'type':{'type':Sequelize[_0xa822('0x2')](_0xa822('0x3'),_0xa822('0x4'),_0xa822('0x5'),_0xa822('0x6'),_0xa822('0x7')),'defaultValue':_0xa822('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa822('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xa822('0x3'),_0xa822('0x4'),_0xa822('0x5'))},'keyContent':{'type':Sequelize[_0xa822('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa822('0x8')]},'customField':{'type':Sequelize[_0xa822('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa822('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 158d166..ffbda29 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 _0x95e4=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoField','key','model'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x95e4,0xb1));var _0x495e=function(_0x593453,_0x25378e){_0x593453=_0x593453-0x0;var _0x4595cf=_0x95e4[_0x593453];return _0x4595cf;};'use strict';var emlformat=require(_0x495e('0x0'));var rimraf=require(_0x495e('0x1'));var zipdir=require(_0x495e('0x2'));var jsonpatch=require(_0x495e('0x3'));var rp=require(_0x495e('0x4'));var moment=require(_0x495e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x495e('0x6'));var util=require(_0x495e('0x7'));var path=require('path');var sox=require(_0x495e('0x8'));var csv=require(_0x495e('0x9'));var ejs=require(_0x495e('0xa'));var fs=require('fs');var fs_extra=require(_0x495e('0xb'));var _=require('lodash');var squel=require(_0x495e('0xc'));var crypto=require(_0x495e('0xd'));var jsforce=require(_0x495e('0xe'));var deskjs=require(_0x495e('0xf'));var toCsv=require(_0x495e('0x9'));var querystring=require(_0x495e('0x10'));var Papa=require(_0x495e('0x11'));var Redis=require(_0x495e('0x12'));var authService=require(_0x495e('0x13'));var qs=require(_0x495e('0x14'));var as=require(_0x495e('0x15'));var hardwareService=require(_0x495e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x495e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x495e('0x18'));var db=require(_0x495e('0x19'))['db'];function respondWithStatusCode(_0x482ec9,_0x2a5ea5){_0x2a5ea5=_0x2a5ea5||0xcc;return function(_0x21b0d3){if(_0x21b0d3){return _0x482ec9['sendStatus'](_0x2a5ea5);}return _0x482ec9[_0x495e('0x1a')](_0x2a5ea5)[_0x495e('0x1b')]();};}function respondWithResult(_0x42ddf8,_0x5b8cf7){_0x5b8cf7=_0x5b8cf7||0xc8;return function(_0x13a32e){if(_0x13a32e){return _0x42ddf8[_0x495e('0x1a')](_0x5b8cf7)[_0x495e('0x1c')](_0x13a32e);}};}function respondWithFilteredResult(_0x35ab8d,_0x5c6186){return function(_0x2aa33d){if(_0x2aa33d){var _0x52a280=typeof _0x5c6186[_0x495e('0x1d')]===_0x495e('0x1e')&&typeof _0x5c6186[_0x495e('0x1f')]===_0x495e('0x1e');var _0x53f174=_0x2aa33d['count'];var _0x5f1e0d=_0x52a280?0x0:_0x5c6186[_0x495e('0x1d')];var _0x34cada=_0x52a280?_0x2aa33d[_0x495e('0x20')]:_0x5c6186[_0x495e('0x1d')]+_0x5c6186[_0x495e('0x1f')];var _0x3b0ffa;if(_0x34cada>=_0x53f174){_0x34cada=_0x53f174;_0x3b0ffa=0xc8;}else{_0x3b0ffa=0xce;}_0x35ab8d[_0x495e('0x1a')](_0x3b0ffa);return _0x35ab8d['set'](_0x495e('0x21'),_0x5f1e0d+'-'+_0x34cada+'/'+_0x53f174)[_0x495e('0x1c')](_0x2aa33d);}return null;};}function patchUpdates(_0x430e33){return function(_0x4fcc5d){try{jsonpatch[_0x495e('0x22')](_0x4fcc5d,_0x430e33,!![]);}catch(_0x11a9cc){return BPromise[_0x495e('0x23')](_0x11a9cc);}return _0x4fcc5d[_0x495e('0x24')]();};}function saveUpdates(_0x4a2859,_0x1652c3){return function(_0x39c86a){if(_0x39c86a){return _0x39c86a['update'](_0x4a2859)[_0x495e('0x25')](function(_0x18088b){return _0x18088b;});}return null;};}function removeEntity(_0x53301d,_0xc4101c){return function(_0x15c17c){if(_0x15c17c){return _0x15c17c[_0x495e('0x26')]()[_0x495e('0x25')](function(){_0x53301d['status'](0xcc)[_0x495e('0x1b')]();});}};}function handleEntityNotFound(_0x2fb5d1,_0x5640d9){return function(_0x3701f5){if(!_0x3701f5){_0x2fb5d1['sendStatus'](0x194);}return _0x3701f5;};}function handleError(_0x52292e,_0x527c76){_0x527c76=_0x527c76||0x1f4;return function(_0xdc5ef8){logger[_0x495e('0x27')](_0xdc5ef8[_0x495e('0x28')]);if(_0xdc5ef8[_0x495e('0x29')]){delete _0xdc5ef8['name'];}_0x52292e[_0x495e('0x1a')](_0x527c76)[_0x495e('0x2a')](_0xdc5ef8);};}exports[_0x495e('0x2b')]=function(_0x39b20c,_0x200fa0){var _0x329733={},_0x17a32e={},_0x1c5071={'count':0x0,'rows':[]};var _0x40a335=_[_0x495e('0x2c')](db[_0x495e('0x2d')]['rawAttributes'],function(_0xc11a51){return{'name':_0xc11a51['fieldName'],'type':_0xc11a51['type'][_0x495e('0x2e')]};});_0x17a32e[_0x495e('0x2f')]=_['map'](_0x40a335,_0x495e('0x29'));_0x17a32e['query']=_[_0x495e('0x30')](_0x39b20c[_0x495e('0x31')]);_0x17a32e[_0x495e('0x32')]=_[_0x495e('0x33')](_0x17a32e['model'],_0x17a32e[_0x495e('0x31')]);_0x329733[_0x495e('0x34')]=_[_0x495e('0x33')](_0x17a32e[_0x495e('0x2f')],qs[_0x495e('0x35')](_0x39b20c[_0x495e('0x31')][_0x495e('0x35')]));_0x329733[_0x495e('0x34')]=_0x329733[_0x495e('0x34')][_0x495e('0x36')]?_0x329733[_0x495e('0x34')]:_0x17a32e[_0x495e('0x2f')];if(!_0x39b20c[_0x495e('0x31')][_0x495e('0x37')](_0x495e('0x38'))){_0x329733[_0x495e('0x1f')]=qs[_0x495e('0x1f')](_0x39b20c[_0x495e('0x31')][_0x495e('0x1f')]);_0x329733[_0x495e('0x1d')]=qs['offset'](_0x39b20c[_0x495e('0x31')][_0x495e('0x1d')]);}_0x329733['order']=qs[_0x495e('0x39')](_0x39b20c['query'][_0x495e('0x39')]);_0x329733[_0x495e('0x3a')]=qs[_0x495e('0x32')](_['pick'](_0x39b20c[_0x495e('0x31')],_0x17a32e[_0x495e('0x32')]),_0x40a335);if(_0x39b20c[_0x495e('0x31')][_0x495e('0x3b')]){_0x329733['where']=_[_0x495e('0x3c')](_0x329733['where'],{'$or':_[_0x495e('0x2c')](_0x40a335,function(_0x343c52){if(_0x343c52[_0x495e('0x3d')]!==_0x495e('0x3e')){var _0x3bff85={};_0x3bff85[_0x343c52[_0x495e('0x29')]]={'$like':'%'+_0x39b20c[_0x495e('0x31')]['filter']+'%'};return _0x3bff85;}})});}_0x329733=_[_0x495e('0x3c')]({},_0x329733,_0x39b20c[_0x495e('0x3f')]);var _0x3f9448={'where':_0x329733[_0x495e('0x3a')]};return db['ZohoField'][_0x495e('0x20')](_0x3f9448)[_0x495e('0x25')](function(_0x44ad45){_0x1c5071['count']=_0x44ad45;if(_0x39b20c[_0x495e('0x31')][_0x495e('0x40')]){_0x329733[_0x495e('0x41')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x329733);})['then'](function(_0x1e47d9){_0x1c5071[_0x495e('0x42')]=_0x1e47d9;return _0x1c5071;})['then'](respondWithFilteredResult(_0x200fa0,_0x329733))[_0x495e('0x43')](handleError(_0x200fa0,null));};exports[_0x495e('0x44')]=function(_0x13c41d,_0x2c8daa){var _0xd6cb6d={'raw':!![],'where':{'id':_0x13c41d[_0x495e('0x45')]['id']}},_0x2c29b1={};_0x2c29b1[_0x495e('0x2f')]=_[_0x495e('0x30')](db[_0x495e('0x2d')][_0x495e('0x46')]);_0x2c29b1[_0x495e('0x31')]=_[_0x495e('0x30')](_0x13c41d[_0x495e('0x31')]);_0x2c29b1[_0x495e('0x32')]=_[_0x495e('0x33')](_0x2c29b1[_0x495e('0x2f')],_0x2c29b1['query']);_0xd6cb6d[_0x495e('0x34')]=_[_0x495e('0x33')](_0x2c29b1[_0x495e('0x2f')],qs[_0x495e('0x35')](_0x13c41d[_0x495e('0x31')][_0x495e('0x35')]));_0xd6cb6d[_0x495e('0x34')]=_0xd6cb6d[_0x495e('0x34')][_0x495e('0x36')]?_0xd6cb6d[_0x495e('0x34')]:_0x2c29b1[_0x495e('0x2f')];if(_0x13c41d[_0x495e('0x31')][_0x495e('0x40')]){_0xd6cb6d[_0x495e('0x41')]=[{'all':!![]}];}_0xd6cb6d=_[_0x495e('0x3c')]({},_0xd6cb6d,_0x13c41d[_0x495e('0x3f')]);return db['ZohoField'][_0x495e('0x47')](_0xd6cb6d)['then'](handleEntityNotFound(_0x2c8daa,null))[_0x495e('0x25')](respondWithResult(_0x2c8daa,null))['catch'](handleError(_0x2c8daa,null));};exports[_0x495e('0x48')]=function(_0x1980aa,_0x5c9511){return db['ZohoField'][_0x495e('0x48')](_0x1980aa[_0x495e('0x49')],{})[_0x495e('0x25')](respondWithResult(_0x5c9511,0xc9))[_0x495e('0x43')](handleError(_0x5c9511,null));};exports[_0x495e('0x4a')]=function(_0x3eb7c4,_0x31ce2a){if(_0x3eb7c4[_0x495e('0x49')]['id']){delete _0x3eb7c4[_0x495e('0x49')]['id'];}return db[_0x495e('0x2d')][_0x495e('0x47')]({'where':{'id':_0x3eb7c4[_0x495e('0x45')]['id']}})[_0x495e('0x25')](handleEntityNotFound(_0x31ce2a,null))[_0x495e('0x25')](saveUpdates(_0x3eb7c4[_0x495e('0x49')],null))[_0x495e('0x25')](respondWithResult(_0x31ce2a,null))['catch'](handleError(_0x31ce2a,null));};exports[_0x495e('0x26')]=function(_0xb02125,_0x26aa37){return db[_0x495e('0x2d')][_0x495e('0x47')]({'where':{'id':_0xb02125[_0x495e('0x45')]['id']}})[_0x495e('0x25')](handleEntityNotFound(_0x26aa37,null))[_0x495e('0x25')](removeEntity(_0x26aa37,null))['catch'](handleError(_0x26aa37,null));}; \ No newline at end of file +var _0x839b=['fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x839b,0x1d5));var _0xb839=function(_0x117e16,_0x31fe86){_0x117e16=_0x117e16-0x0;var _0x2d2cb5=_0x839b[_0x117e16];return _0x2d2cb5;};'use strict';var emlformat=require(_0xb839('0x0'));var rimraf=require(_0xb839('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb839('0x2'));var rp=require(_0xb839('0x3'));var moment=require(_0xb839('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb839('0x5'));var util=require('util');var path=require(_0xb839('0x6'));var sox=require(_0xb839('0x7'));var csv=require(_0xb839('0x8'));var ejs=require(_0xb839('0x9'));var fs=require('fs');var fs_extra=require(_0xb839('0xa'));var _=require(_0xb839('0xb'));var squel=require(_0xb839('0xc'));var crypto=require(_0xb839('0xd'));var jsforce=require(_0xb839('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb839('0xf'));var Papa=require(_0xb839('0x10'));var Redis=require(_0xb839('0x11'));var authService=require(_0xb839('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb839('0x13'));var hardwareService=require(_0xb839('0x14'));var logger=require(_0xb839('0x15'))(_0xb839('0x16'));var utils=require(_0xb839('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb839('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a622,_0x561398){_0x561398=_0x561398||0xcc;return function(_0x1fc19a){if(_0x1fc19a){return _0x38a622[_0xb839('0x19')](_0x561398);}return _0x38a622[_0xb839('0x1a')](_0x561398)['end']();};}function respondWithResult(_0x1e83b8,_0x1c473c){_0x1c473c=_0x1c473c||0xc8;return function(_0x550d0b){if(_0x550d0b){return _0x1e83b8[_0xb839('0x1a')](_0x1c473c)[_0xb839('0x1b')](_0x550d0b);}};}function respondWithFilteredResult(_0xb55487,_0x481716){return function(_0x552e7e){if(_0x552e7e){var _0x147b5d=typeof _0x481716[_0xb839('0x1c')]===_0xb839('0x1d')&&typeof _0x481716['limit']===_0xb839('0x1d');var _0x55ed36=_0x552e7e['count'];var _0x83f8c1=_0x147b5d?0x0:_0x481716[_0xb839('0x1c')];var _0x399209=_0x147b5d?_0x552e7e[_0xb839('0x1e')]:_0x481716[_0xb839('0x1c')]+_0x481716[_0xb839('0x1f')];var _0x1b1031;if(_0x399209>=_0x55ed36){_0x399209=_0x55ed36;_0x1b1031=0xc8;}else{_0x1b1031=0xce;}_0xb55487[_0xb839('0x1a')](_0x1b1031);return _0xb55487[_0xb839('0x20')](_0xb839('0x21'),_0x83f8c1+'-'+_0x399209+'/'+_0x55ed36)[_0xb839('0x1b')](_0x552e7e);}return null;};}function patchUpdates(_0x34c9b7){return function(_0x1850c4){try{jsonpatch[_0xb839('0x22')](_0x1850c4,_0x34c9b7,!![]);}catch(_0x1a9dd9){return BPromise['reject'](_0x1a9dd9);}return _0x1850c4[_0xb839('0x23')]();};}function saveUpdates(_0x4fce1a,_0x30f0a1){return function(_0x30facb){if(_0x30facb){return _0x30facb[_0xb839('0x24')](_0x4fce1a)[_0xb839('0x25')](function(_0x1f7067){return _0x1f7067;});}return null;};}function removeEntity(_0x52257f,_0x24cb08){return function(_0x4197dd){if(_0x4197dd){return _0x4197dd[_0xb839('0x26')]()[_0xb839('0x25')](function(){_0x52257f[_0xb839('0x1a')](0xcc)[_0xb839('0x27')]();});}};}function handleEntityNotFound(_0x5f2919,_0x184b34){return function(_0x5e2ec3){if(!_0x5e2ec3){_0x5f2919[_0xb839('0x19')](0x194);}return _0x5e2ec3;};}function handleError(_0x11e07b,_0x2d76b2){_0x2d76b2=_0x2d76b2||0x1f4;return function(_0x173820){logger[_0xb839('0x28')](_0x173820[_0xb839('0x29')]);if(_0x173820[_0xb839('0x2a')]){delete _0x173820[_0xb839('0x2a')];}_0x11e07b[_0xb839('0x1a')](_0x2d76b2)[_0xb839('0x2b')](_0x173820);};}exports[_0xb839('0x2c')]=function(_0xf3ff8b,_0x544229){var _0x1cb100={},_0x52e28e={},_0x2aa315={'count':0x0,'rows':[]};var _0x616728=_[_0xb839('0x2d')](db[_0xb839('0x2e')][_0xb839('0x2f')],function(_0x14ef52){return{'name':_0x14ef52['fieldName'],'type':_0x14ef52[_0xb839('0x30')][_0xb839('0x31')]};});_0x52e28e[_0xb839('0x32')]=_['map'](_0x616728,_0xb839('0x2a'));_0x52e28e[_0xb839('0x33')]=_[_0xb839('0x34')](_0xf3ff8b[_0xb839('0x33')]);_0x52e28e[_0xb839('0x35')]=_[_0xb839('0x36')](_0x52e28e['model'],_0x52e28e[_0xb839('0x33')]);_0x1cb100[_0xb839('0x37')]=_[_0xb839('0x36')](_0x52e28e[_0xb839('0x32')],qs[_0xb839('0x38')](_0xf3ff8b[_0xb839('0x33')][_0xb839('0x38')]));_0x1cb100['attributes']=_0x1cb100[_0xb839('0x37')][_0xb839('0x39')]?_0x1cb100[_0xb839('0x37')]:_0x52e28e[_0xb839('0x32')];if(!_0xf3ff8b[_0xb839('0x33')]['hasOwnProperty'](_0xb839('0x3a'))){_0x1cb100[_0xb839('0x1f')]=qs[_0xb839('0x1f')](_0xf3ff8b[_0xb839('0x33')][_0xb839('0x1f')]);_0x1cb100['offset']=qs[_0xb839('0x1c')](_0xf3ff8b[_0xb839('0x33')]['offset']);}_0x1cb100[_0xb839('0x3b')]=qs['sort'](_0xf3ff8b[_0xb839('0x33')][_0xb839('0x3c')]);_0x1cb100[_0xb839('0x3d')]=qs[_0xb839('0x35')](_['pick'](_0xf3ff8b[_0xb839('0x33')],_0x52e28e['filters']),_0x616728);if(_0xf3ff8b[_0xb839('0x33')][_0xb839('0x3e')]){_0x1cb100[_0xb839('0x3d')]=_['merge'](_0x1cb100[_0xb839('0x3d')],{'$or':_['map'](_0x616728,function(_0x31617d){if(_0x31617d[_0xb839('0x30')]!==_0xb839('0x3f')){var _0x52452d={};_0x52452d[_0x31617d['name']]={'$like':'%'+_0xf3ff8b[_0xb839('0x33')][_0xb839('0x3e')]+'%'};return _0x52452d;}})});}_0x1cb100=_[_0xb839('0x40')]({},_0x1cb100,_0xf3ff8b['options']);var _0x1d236c={'where':_0x1cb100[_0xb839('0x3d')]};return db['ZohoField'][_0xb839('0x1e')](_0x1d236c)['then'](function(_0x5827ca){_0x2aa315[_0xb839('0x1e')]=_0x5827ca;if(_0xf3ff8b[_0xb839('0x33')][_0xb839('0x41')]){_0x1cb100[_0xb839('0x42')]=[{'all':!![]}];}return db[_0xb839('0x2e')][_0xb839('0x43')](_0x1cb100);})[_0xb839('0x25')](function(_0xf1b6a3){_0x2aa315[_0xb839('0x44')]=_0xf1b6a3;return _0x2aa315;})[_0xb839('0x25')](respondWithFilteredResult(_0x544229,_0x1cb100))['catch'](handleError(_0x544229,null));};exports[_0xb839('0x45')]=function(_0x29c8c4,_0x21e8c2){var _0x36bfef={'raw':!![],'where':{'id':_0x29c8c4['params']['id']}},_0x48921b={};_0x48921b[_0xb839('0x32')]=_[_0xb839('0x34')](db['ZohoField'][_0xb839('0x2f')]);_0x48921b[_0xb839('0x33')]=_[_0xb839('0x34')](_0x29c8c4[_0xb839('0x33')]);_0x48921b['filters']=_['intersection'](_0x48921b['model'],_0x48921b[_0xb839('0x33')]);_0x36bfef[_0xb839('0x37')]=_['intersection'](_0x48921b[_0xb839('0x32')],qs[_0xb839('0x38')](_0x29c8c4[_0xb839('0x33')][_0xb839('0x38')]));_0x36bfef['attributes']=_0x36bfef[_0xb839('0x37')][_0xb839('0x39')]?_0x36bfef[_0xb839('0x37')]:_0x48921b[_0xb839('0x32')];if(_0x29c8c4['query'][_0xb839('0x41')]){_0x36bfef['include']=[{'all':!![]}];}_0x36bfef=_['merge']({},_0x36bfef,_0x29c8c4[_0xb839('0x46')]);return db[_0xb839('0x2e')][_0xb839('0x47')](_0x36bfef)[_0xb839('0x25')](handleEntityNotFound(_0x21e8c2,null))[_0xb839('0x25')](respondWithResult(_0x21e8c2,null))['catch'](handleError(_0x21e8c2,null));};exports[_0xb839('0x48')]=function(_0x10d58a,_0x127e10){return db[_0xb839('0x2e')]['create'](_0x10d58a[_0xb839('0x49')],{})[_0xb839('0x25')](respondWithResult(_0x127e10,0xc9))['catch'](handleError(_0x127e10,null));};exports[_0xb839('0x24')]=function(_0x5de11e,_0x719e9e){if(_0x5de11e['body']['id']){delete _0x5de11e['body']['id'];}return db['ZohoField'][_0xb839('0x47')]({'where':{'id':_0x5de11e[_0xb839('0x4a')]['id']}})[_0xb839('0x25')](handleEntityNotFound(_0x719e9e,null))[_0xb839('0x25')](saveUpdates(_0x5de11e[_0xb839('0x49')],null))[_0xb839('0x25')](respondWithResult(_0x719e9e,null))['catch'](handleError(_0x719e9e,null));};exports['destroy']=function(_0x5d8800,_0x54b8c3){return db['ZohoField'][_0xb839('0x47')]({'where':{'id':_0x5d8800['params']['id']}})['then'](handleEntityNotFound(_0x54b8c3,null))['then'](removeEntity(_0x54b8c3,null))['catch'](handleError(_0x54b8c3,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 572c371..5c4921b 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 _0x5430=['bluebird','rimraf','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x24f85a,_0x26a3ec){var _0x350a55=function(_0xd5e1c2){while(--_0xd5e1c2){_0x24f85a['push'](_0x24f85a['shift']());}};_0x350a55(++_0x26a3ec);}(_0x5430,0x10c));var _0x0543=function(_0x1cdcb4,_0x4d1801){_0x1cdcb4=_0x1cdcb4-0x0;var _0x5a1011=_0x5430[_0x1cdcb4];return _0x5a1011;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x0543('0x7')]=function(_0x45b909,_0x9754ba){return _0x45b909[_0x0543('0x8')](_0x0543('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0543('0xa'),'fields':[_0x0543('0xb'),_0x0543('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a55=['moment','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash'];(function(_0x8322a1,_0x109024){var _0xe60840=function(_0x8625dd){while(--_0x8625dd){_0x8322a1['push'](_0x8322a1['shift']());}};_0xe60840(++_0x109024);}(_0x6a55,0xdb));var _0x56a5=function(_0x403db1,_0x59018e){_0x403db1=_0x403db1-0x0;var _0x47c48f=_0x6a55[_0x403db1];return _0x47c48f;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56a5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56a5('0x2'));var rimraf=require('rimraf');var config=require(_0x56a5('0x3'));var attributes=require('./intZohoField.attributes');module[_0x56a5('0x4')]=function(_0x380b1b,_0x42d164){return _0x380b1b[_0x56a5('0x5')](_0x56a5('0x6'),attributes,{'tableName':_0x56a5('0x7'),'paranoid':![],'indexes':[{'name':_0x56a5('0x8'),'fields':[_0x56a5('0x9'),'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 500113e..937da5a 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 _0x9b53=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x9b53,0x105));var _0x39b5=function(_0xdf1b8,_0x10bb9d){_0xdf1b8=_0xdf1b8-0x0;var _0x16a09d=_0x9b53[_0xdf1b8];return _0x16a09d;};'use strict';var _=require(_0x39b5('0x0'));var util=require(_0x39b5('0x1'));var moment=require(_0x39b5('0x2'));var BPromise=require(_0x39b5('0x3'));var rs=require(_0x39b5('0x4'));var fs=require('fs');var Redis=require(_0x39b5('0x5'));var db=require(_0x39b5('0x6'))['db'];var utils=require(_0x39b5('0x7'));var logger=require(_0x39b5('0x8'))(_0x39b5('0x9'));var config=require(_0x39b5('0xa'));var jayson=require(_0x39b5('0xb'));var client=jayson[_0x39b5('0xc')][_0x39b5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5597ff,_0xba5a98,_0x9aac37){return new BPromise(function(_0x5a46e0,_0x5e6ccb){return client[_0x39b5('0xe')](_0x5597ff,_0x9aac37)[_0x39b5('0xf')](function(_0xda93d9){logger['info'](_0x39b5('0x10'),_0xba5a98,_0x39b5('0x11'));logger[_0x39b5('0x12')](_0x39b5('0x13'),_0xba5a98,_0x39b5('0x11'),JSON[_0x39b5('0x14')](_0xda93d9));if(_0xda93d9[_0x39b5('0x15')]){if(_0xda93d9[_0x39b5('0x15')]['code']===0x1f4){logger['error'](_0x39b5('0x10'),_0xba5a98,_0xda93d9[_0x39b5('0x15')][_0x39b5('0x16')]);return _0x5e6ccb(_0xda93d9[_0x39b5('0x15')]['message']);}logger[_0x39b5('0x15')]('ZohoField,\x20%s,\x20%s',_0xba5a98,_0xda93d9[_0x39b5('0x15')][_0x39b5('0x16')]);return _0x5a46e0(_0xda93d9[_0x39b5('0x15')][_0x39b5('0x16')]);}else{logger[_0x39b5('0x17')](_0x39b5('0x10'),_0xba5a98,_0x39b5('0x11'));_0x5a46e0(_0xda93d9[_0x39b5('0x18')][_0x39b5('0x16')]);}})[_0x39b5('0x19')](function(_0x176762){logger[_0x39b5('0x15')](_0x39b5('0x10'),_0xba5a98,_0x176762);_0x5e6ccb(_0x176762);});});} \ No newline at end of file +var _0xbfa5=['client','http','request','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xbfa5,0x16c));var _0x5bfa=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xbfa5[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0x5bfa('0x0'));var moment=require('moment');var BPromise=require(_0x5bfa('0x1'));var rs=require(_0x5bfa('0x2'));var fs=require('fs');var Redis=require(_0x5bfa('0x3'));var db=require(_0x5bfa('0x4'))['db'];var utils=require(_0x5bfa('0x5'));var logger=require(_0x5bfa('0x6'))(_0x5bfa('0x7'));var config=require(_0x5bfa('0x8'));var jayson=require(_0x5bfa('0x9'));var client=jayson[_0x5bfa('0xa')][_0x5bfa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39c3a9,_0x45a5bd,_0x497581){return new BPromise(function(_0x3f0176,_0x44b093){return client[_0x5bfa('0xc')](_0x39c3a9,_0x497581)['then'](function(_0x4ad4e4){logger['info'](_0x5bfa('0xd'),_0x45a5bd,'request\x20sent');logger['debug'](_0x5bfa('0xe'),_0x45a5bd,_0x5bfa('0xf'),JSON[_0x5bfa('0x10')](_0x4ad4e4));if(_0x4ad4e4[_0x5bfa('0x11')]){if(_0x4ad4e4[_0x5bfa('0x11')][_0x5bfa('0x12')]===0x1f4){logger[_0x5bfa('0x11')](_0x5bfa('0xd'),_0x45a5bd,_0x4ad4e4['error'][_0x5bfa('0x13')]);return _0x44b093(_0x4ad4e4['error'][_0x5bfa('0x13')]);}logger[_0x5bfa('0x11')](_0x5bfa('0xd'),_0x45a5bd,_0x4ad4e4[_0x5bfa('0x11')][_0x5bfa('0x13')]);return _0x3f0176(_0x4ad4e4[_0x5bfa('0x11')][_0x5bfa('0x13')]);}else{logger['info'](_0x5bfa('0xd'),_0x45a5bd,_0x5bfa('0xf'));_0x3f0176(_0x4ad4e4[_0x5bfa('0x14')][_0x5bfa('0x13')]);}})[_0x5bfa('0x15')](function(_0x36686e){logger[_0x5bfa('0x11')](_0x5bfa('0xd'),_0x45a5bd,_0x36686e);_0x44b093(_0x36686e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9ff1be6..6ca80bc 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3e6675,_0x304711){var _0x51899b=function(_0x30f656){while(--_0x30f656){_0x3e6675['push'](_0x3e6675['shift']());}};_0x51899b(++_0x304711);}(_0x70e0,0x17b));var _0x070e=function(_0x4589d8,_0x35944a){_0x4589d8=_0x4589d8-0x0;var _0x34da28=_0x70e0[_0x4589d8];return _0x34da28;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x25b9a1,_0x3e141b){var _0x2dff67=function(_0x1d5279){while(--_0x1d5279){_0x25b9a1['push'](_0x25b9a1['shift']());}};_0x2dff67(++_0x3e141b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f8e7986..46f9b66 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 _0x175f=['BOOLEAN','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x635dac,_0x3b7bf7){var _0x577c4a=function(_0x3d6f41){while(--_0x3d6f41){_0x635dac['push'](_0x635dac['shift']());}};_0x577c4a(++_0x3b7bf7);}(_0x175f,0x1ab));var _0xf175=function(_0x483b05,_0x17293a){_0x483b05=_0x483b05-0x0;var _0x571b0e=_0x175f[_0x483b05];return _0x571b0e;};'use strict';var Sequelize=require('sequelize');module[_0xf175('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf175('0x1')},'version':{'type':Sequelize[_0xf175('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xf175('0x2')],'defaultValue':_0xf175('0x3')},'filename':{'type':Sequelize[_0xf175('0x2')]},'path':{'type':Sequelize[_0xf175('0x2')]},'type':{'type':Sequelize[_0xf175('0x2')]},'size':{'type':Sequelize[_0xf175('0x4')]},'active':{'type':Sequelize[_0xf175('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf175('0x2')]},'logo':{'type':Sequelize[_0xf175('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xf175('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf175('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x304a=['unique_name_and_version','app.js','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x2d4dc8,_0x591909){var _0x2ee36c=function(_0x573664){while(--_0x573664){_0x2d4dc8['push'](_0x2d4dc8['shift']());}};_0x2ee36c(++_0x591909);}(_0x304a,0x19a));var _0xa304=function(_0x1a1583,_0x238d20){_0x1a1583=_0x1a1583-0x0;var _0x37c622=_0x304a[_0x1a1583];return _0x37c622;};'use strict';var Sequelize=require(_0xa304('0x0'));module[_0xa304('0x1')]={'name':{'type':Sequelize[_0xa304('0x2')],'allowNull':![],'unique':_0xa304('0x3')},'version':{'type':Sequelize[_0xa304('0x2')],'allowNull':![],'unique':_0xa304('0x3')},'main':{'type':Sequelize[_0xa304('0x2')],'defaultValue':_0xa304('0x4')},'filename':{'type':Sequelize[_0xa304('0x2')]},'path':{'type':Sequelize[_0xa304('0x2')]},'type':{'type':Sequelize[_0xa304('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xa304('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xa304('0x2')]},'logo':{'type':Sequelize[_0xa304('0x2')]},'state':{'type':Sequelize[_0xa304('0x2')],'unique':_0xa304('0x6')},'description':{'type':Sequelize[_0xa304('0x2')]},'title':{'type':Sequelize[_0xa304('0x2')]},'remoteUri':{'type':Sequelize[_0xa304('0x2')]},'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 5521fa9..baf58b6 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 _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x525445,_0x4f8f42){var _0x48b600=function(_0x561bc1){while(--_0x561bc1){_0x525445['push'](_0x525445['shift']());}};_0x48b600(++_0x4f8f42);}(_0x4888,0x198));var _0x8488=function(_0x5ac7d7,_0x109040){_0x5ac7d7=_0x5ac7d7-0x0;var _0x23955f=_0x4888[_0x5ac7d7];return _0x23955f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0xf555d8,_0x370e95){var _0x29aa38=function(_0x425fbd){while(--_0x425fbd){_0xf555d8['push'](_0xf555d8['shift']());}};_0x29aa38(++_0x370e95);}(_0xfcf0,0x138));var _0x0fcf=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0xfcf0[_0x28c939];return _0x527fe9;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index f8f9f4e..b3cf0bf 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 _0x74dd=['path','../../config/environment','./integration.attributes','define','Integration','util','bluebird','request-promise'];(function(_0x25eea8,_0x1210f1){var _0x17190f=function(_0x53fed6){while(--_0x53fed6){_0x25eea8['push'](_0x25eea8['shift']());}};_0x17190f(++_0x1210f1);}(_0x74dd,0x1a5));var _0xd74d=function(_0x2beeb9,_0x415c85){_0x2beeb9=_0x2beeb9-0x0;var _0x3f7f25=_0x74dd[_0x2beeb9];return _0x3f7f25;};'use strict';var _=require('lodash');var util=require(_0xd74d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd74d('0x1'));var rp=require(_0xd74d('0x2'));var fs=require('fs');var path=require(_0xd74d('0x3'));var rimraf=require('rimraf');var config=require(_0xd74d('0x4'));var attributes=require(_0xd74d('0x5'));module['exports']=function(_0x355f06,_0x348027){return _0x355f06[_0xd74d('0x6')](_0xd74d('0x7'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2294=['util','../../config/logger','moment','request-promise','path','rimraf','./integration.attributes','exports','Integration','integrations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2294,0x1a1));var _0x4229=function(_0x5e065e,_0x2fabac){_0x5e065e=_0x5e065e-0x0;var _0x57eaa0=_0x2294[_0x5e065e];return _0x57eaa0;};'use strict';var _=require(_0x4229('0x0'));var util=require(_0x4229('0x1'));var logger=require(_0x4229('0x2'))('api');var moment=require(_0x4229('0x3'));var BPromise=require('bluebird');var rp=require(_0x4229('0x4'));var fs=require('fs');var path=require(_0x4229('0x5'));var rimraf=require(_0x4229('0x6'));var config=require('../../config/environment');var attributes=require(_0x4229('0x7'));module[_0x4229('0x8')]=function(_0x2e00d8,_0x14f433){return _0x2e00d8['define'](_0x4229('0x9'),attributes,{'tableName':_0x4229('0xa'),'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 6252dc9..db50c2d 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 _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x533a8f,_0x43ab77){var _0x3f62ca=function(_0x339b34){while(--_0x339b34){_0x533a8f['push'](_0x533a8f['shift']());}};_0x3f62ca(++_0x43ab77);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x444a11,_0x72fe6e){_0x444a11=_0x444a11-0x0;var _0x7396da=_0xc6ac[_0x444a11];return _0x7396da;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4f77e9,_0x55ce3e){var _0x3e5e6d=function(_0x33c527){while(--_0x33c527){_0x4f77e9['push'](_0x4f77e9['shift']());}};_0x3e5e6d(++_0x55ce3e);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xc782ee,_0x4a52dd){_0xc782ee=_0xc782ee-0x0;var _0x4de579=_0xc6ac[_0xc782ee];return _0x4de579;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2c533a4..3d698bf 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x45a632,_0x5d65e0){_0x45a632=_0x45a632-0x0;var _0x3ed012=_0x5f2f[_0x45a632];return _0x3ed012;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e1dabc9..c0b7104 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 _0xa2cb=['TEXT','SENT','RECEIVED','FAILED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa2cb,0x1f3));var _0xba2c=function(_0x1134c7,_0x30b7ba){_0x1134c7=_0x1134c7-0x0;var _0x5c30e5=_0xa2cb[_0x1134c7];return _0x5c30e5;};'use strict';var Sequelize=require('sequelize');module[_0xba2c('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xba2c('0x1')]},'exitStatus':{'type':Sequelize[_0xba2c('0x1')]},'ticketId':{'type':Sequelize[_0xba2c('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xba2c('0x1')]},'calleridnum':{'type':Sequelize[_0xba2c('0x1')]},'calleridname':{'type':Sequelize[_0xba2c('0x1')]},'queue':{'type':Sequelize[_0xba2c('0x1')]},'interface':{'type':Sequelize[_0xba2c('0x1')]},'membername':{'type':Sequelize[_0xba2c('0x1')]},'agentcalledAt':{'type':Sequelize[_0xba2c('0x2')]},'agentconnectAt':{'type':Sequelize[_0xba2c('0x2')]},'holdtime':{'type':Sequelize[_0xba2c('0x3')]},'agentcomplete':{'type':Sequelize[_0xba2c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xba2c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xba2c('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xba2c('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xba2c('0x2')]},'agentdump':{'type':Sequelize[_0xba2c('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xba2c('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xba2c('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xba2c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xba2c('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xba2c('0x1')]},'accountcode':{'type':Sequelize[_0xba2c('0x1')]},'context':{'type':Sequelize[_0xba2c('0x1')]},'exten':{'type':Sequelize[_0xba2c('0x1')]},'priority':{'type':Sequelize[_0xba2c('0x1')]},'destchannel':{'type':Sequelize[_0xba2c('0x1')]},'destchannelstate':{'type':Sequelize[_0xba2c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xba2c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xba2c('0x1')]},'destcalleridname':{'type':Sequelize[_0xba2c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xba2c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xba2c('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xba2c('0x1')]},'destcontext':{'type':Sequelize[_0xba2c('0x1')]},'destexten':{'type':Sequelize[_0xba2c('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xba2c('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xba2c('0x1')]},'subject':{'type':Sequelize[_0xba2c('0x1')]},'from':{'type':Sequelize[_0xba2c('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xba2c('0x1')]},'attachment':{'type':Sequelize[_0xba2c('0x5')]},'html':{'type':Sequelize[_0xba2c('0x5')]},'text':{'type':Sequelize[_0xba2c('0x5')]},'status':{'type':Sequelize['ENUM'](_0xba2c('0x6'),'SENDING',_0xba2c('0x7'),_0xba2c('0x8'))},'url':{'type':Sequelize[_0xba2c('0x1')]},'app':{'type':Sequelize[_0xba2c('0x1')]},'appdata':{'type':Sequelize[_0xba2c('0x1')]},'projectId':{'type':Sequelize[_0xba2c('0x3')]}}; \ No newline at end of file +var _0xc0ea=['BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x50296c,_0x385eec){var _0x4c71b8=function(_0x786a30){while(--_0x786a30){_0x50296c['push'](_0x50296c['shift']());}};_0x4c71b8(++_0x385eec);}(_0xc0ea,0x87));var _0xac0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0ea[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac0e('0x0'));module[_0xac0e('0x1')]={'integration':{'type':Sequelize[_0xac0e('0x2')]},'eventChannel':{'type':Sequelize[_0xac0e('0x2')]},'exitStatus':{'type':Sequelize[_0xac0e('0x2')]},'ticketId':{'type':Sequelize[_0xac0e('0x2')]},'integrationId':{'type':Sequelize[_0xac0e('0x3')]},'contacts':{'type':Sequelize[_0xac0e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xac0e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xac0e('0x2')]},'interface':{'type':Sequelize[_0xac0e('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xac0e('0x4')]},'holdtime':{'type':Sequelize[_0xac0e('0x3')]},'agentcomplete':{'type':Sequelize[_0xac0e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xac0e('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xac0e('0x3')]},'reason':{'type':Sequelize[_0xac0e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xac0e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xac0e('0x4')]},'agentdump':{'type':Sequelize[_0xac0e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xac0e('0x4')]},'lastevent':{'type':Sequelize[_0xac0e('0x2')]},'channel':{'type':Sequelize[_0xac0e('0x2')]},'channelstate':{'type':Sequelize[_0xac0e('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xac0e('0x2')]},'connectedlinename':{'type':Sequelize[_0xac0e('0x2')]},'language':{'type':Sequelize[_0xac0e('0x2')]},'accountcode':{'type':Sequelize[_0xac0e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xac0e('0x2')]},'priority':{'type':Sequelize[_0xac0e('0x2')]},'destchannel':{'type':Sequelize[_0xac0e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xac0e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xac0e('0x2')]},'destcalleridname':{'type':Sequelize[_0xac0e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xac0e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xac0e('0x2')]},'destlanguage':{'type':Sequelize[_0xac0e('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xac0e('0x2')]},'destexten':{'type':Sequelize[_0xac0e('0x2')]},'destpriority':{'type':Sequelize[_0xac0e('0x2')]},'destuniqueid':{'type':Sequelize[_0xac0e('0x2')]},'messageId':{'type':Sequelize[_0xac0e('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xac0e('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xac0e('0x2')]},'cc':{'type':Sequelize[_0xac0e('0x2')]},'attachment':{'type':Sequelize[_0xac0e('0x6')]},'html':{'type':Sequelize[_0xac0e('0x6')]},'text':{'type':Sequelize[_0xac0e('0x6')]},'status':{'type':Sequelize[_0xac0e('0x7')](_0xac0e('0x8'),'SENDING','RECEIVED',_0xac0e('0x9'))},'url':{'type':Sequelize[_0xac0e('0x2')]},'app':{'type':Sequelize[_0xac0e('0x2')]},'appdata':{'type':Sequelize[_0xac0e('0x2')]},'projectId':{'type':Sequelize[_0xac0e('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 18ae264..b8562e0 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 _0xd335=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length'];(function(_0x3eed0c,_0x2b24f1){var _0x44594f=function(_0x20598b){while(--_0x20598b){_0x3eed0c['push'](_0x3eed0c['shift']());}};_0x44594f(++_0x2b24f1);}(_0xd335,0x145));var _0x5d33=function(_0x3da7af,_0x31eeb3){_0x3da7af=_0x3da7af-0x0;var _0x5d8c3d=_0xd335[_0x3da7af];return _0x5d8c3d;};'use strict';var emlformat=require(_0x5d33('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d33('0x1'));var rp=require('request-promise');var moment=require(_0x5d33('0x2'));var BPromise=require(_0x5d33('0x3'));var Mustache=require('mustache');var util=require(_0x5d33('0x4'));var path=require('path');var sox=require(_0x5d33('0x5'));var csv=require(_0x5d33('0x6'));var ejs=require(_0x5d33('0x7'));var fs=require('fs');var fs_extra=require(_0x5d33('0x8'));var _=require(_0x5d33('0x9'));var squel=require(_0x5d33('0xa'));var crypto=require(_0x5d33('0xb'));var jsforce=require(_0x5d33('0xc'));var deskjs=require(_0x5d33('0xd'));var toCsv=require(_0x5d33('0x6'));var querystring=require(_0x5d33('0xe'));var Papa=require(_0x5d33('0xf'));var Redis=require(_0x5d33('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5d33('0x11'));var as=require(_0x5d33('0x12'));var hardwareService=require(_0x5d33('0x13'));var logger=require(_0x5d33('0x14'))(_0x5d33('0x15'));var utils=require(_0x5d33('0x16'));var config=require(_0x5d33('0x17'));var licenseUtil=require(_0x5d33('0x18'));var db=require(_0x5d33('0x19'))['db'];function respondWithStatusCode(_0x1a35be,_0x3bd439){_0x3bd439=_0x3bd439||0xcc;return function(_0xd8f2ab){if(_0xd8f2ab){return _0x1a35be[_0x5d33('0x1a')](_0x3bd439);}return _0x1a35be[_0x5d33('0x1b')](_0x3bd439)[_0x5d33('0x1c')]();};}function respondWithResult(_0x38862d,_0x4ffbc4){_0x4ffbc4=_0x4ffbc4||0xc8;return function(_0xdf003b){if(_0xdf003b){return _0x38862d[_0x5d33('0x1b')](_0x4ffbc4)['json'](_0xdf003b);}};}function respondWithFilteredResult(_0x4b8cab,_0x1e1469){return function(_0x2cadd5){if(_0x2cadd5){var _0x4d87e6=typeof _0x1e1469[_0x5d33('0x1d')]===_0x5d33('0x1e')&&typeof _0x1e1469['limit']===_0x5d33('0x1e');var _0x7f5990=_0x2cadd5[_0x5d33('0x1f')];var _0x4a999d=_0x4d87e6?0x0:_0x1e1469[_0x5d33('0x1d')];var _0x5dd937=_0x4d87e6?_0x2cadd5[_0x5d33('0x1f')]:_0x1e1469[_0x5d33('0x1d')]+_0x1e1469[_0x5d33('0x20')];var _0x546a3b;if(_0x5dd937>=_0x7f5990){_0x5dd937=_0x7f5990;_0x546a3b=0xc8;}else{_0x546a3b=0xce;}_0x4b8cab[_0x5d33('0x1b')](_0x546a3b);return _0x4b8cab['set'](_0x5d33('0x21'),_0x4a999d+'-'+_0x5dd937+'/'+_0x7f5990)['json'](_0x2cadd5);}return null;};}function patchUpdates(_0x52fa9a){return function(_0x3cefe9){try{jsonpatch['apply'](_0x3cefe9,_0x52fa9a,!![]);}catch(_0x1ac237){return BPromise['reject'](_0x1ac237);}return _0x3cefe9[_0x5d33('0x22')]();};}function saveUpdates(_0x430912,_0x129995){return function(_0x186737){if(_0x186737){return _0x186737[_0x5d33('0x23')](_0x430912)[_0x5d33('0x24')](function(_0x110f9d){return _0x110f9d;});}return null;};}function removeEntity(_0x5f3413,_0x506dba){return function(_0x18462a){if(_0x18462a){return _0x18462a[_0x5d33('0x25')]()[_0x5d33('0x24')](function(){_0x5f3413[_0x5d33('0x1b')](0xcc)[_0x5d33('0x1c')]();});}};}function handleEntityNotFound(_0x2437c1,_0x4182b7){return function(_0x220120){if(!_0x220120){_0x2437c1[_0x5d33('0x1a')](0x194);}return _0x220120;};}function handleError(_0x9b8c6e,_0x2cd6f0){_0x2cd6f0=_0x2cd6f0||0x1f4;return function(_0x270a24){logger[_0x5d33('0x26')](_0x270a24[_0x5d33('0x27')]);if(_0x270a24['name']){delete _0x270a24[_0x5d33('0x28')];}_0x9b8c6e[_0x5d33('0x1b')](_0x2cd6f0)[_0x5d33('0x29')](_0x270a24);};}exports[_0x5d33('0x2a')]=function(_0x1b3ec2,_0x1c8998){var _0xbc4bb0={},_0x5b149d={},_0x37eef4={'count':0x0,'rows':[]};var _0x2013a4=_[_0x5d33('0x2b')](db[_0x5d33('0x2c')][_0x5d33('0x2d')],function(_0x2dfc80){return{'name':_0x2dfc80['fieldName'],'type':_0x2dfc80[_0x5d33('0x2e')][_0x5d33('0x2f')]};});_0x5b149d[_0x5d33('0x30')]=_[_0x5d33('0x2b')](_0x2013a4,'name');_0x5b149d[_0x5d33('0x31')]=_[_0x5d33('0x32')](_0x1b3ec2['query']);_0x5b149d[_0x5d33('0x33')]=_['intersection'](_0x5b149d[_0x5d33('0x30')],_0x5b149d[_0x5d33('0x31')]);_0xbc4bb0['attributes']=_['intersection'](_0x5b149d[_0x5d33('0x30')],qs[_0x5d33('0x34')](_0x1b3ec2['query'][_0x5d33('0x34')]));_0xbc4bb0[_0x5d33('0x35')]=_0xbc4bb0[_0x5d33('0x35')][_0x5d33('0x36')]?_0xbc4bb0[_0x5d33('0x35')]:_0x5b149d[_0x5d33('0x30')];if(!_0x1b3ec2[_0x5d33('0x31')][_0x5d33('0x37')]('nolimit')){_0xbc4bb0['limit']=qs[_0x5d33('0x20')](_0x1b3ec2[_0x5d33('0x31')][_0x5d33('0x20')]);_0xbc4bb0[_0x5d33('0x1d')]=qs[_0x5d33('0x1d')](_0x1b3ec2[_0x5d33('0x31')]['offset']);}_0xbc4bb0[_0x5d33('0x38')]=qs[_0x5d33('0x39')](_0x1b3ec2['query'][_0x5d33('0x39')]);_0xbc4bb0[_0x5d33('0x3a')]=qs[_0x5d33('0x33')](_[_0x5d33('0x3b')](_0x1b3ec2['query'],_0x5b149d[_0x5d33('0x33')]),_0x2013a4);if(_0x1b3ec2['query'][_0x5d33('0x3c')]){_0xbc4bb0[_0x5d33('0x3a')]=_[_0x5d33('0x3d')](_0xbc4bb0[_0x5d33('0x3a')],{'$or':_[_0x5d33('0x2b')](_0x2013a4,function(_0x549183){if(_0x549183[_0x5d33('0x2e')]!==_0x5d33('0x3e')){var _0x28571a={};_0x28571a[_0x549183[_0x5d33('0x28')]]={'$like':'%'+_0x1b3ec2[_0x5d33('0x31')][_0x5d33('0x3c')]+'%'};return _0x28571a;}})});}_0xbc4bb0=_[_0x5d33('0x3d')]({},_0xbc4bb0,_0x1b3ec2[_0x5d33('0x3f')]);var _0x5284ff={'where':_0xbc4bb0[_0x5d33('0x3a')]};return db[_0x5d33('0x2c')]['count'](_0x5284ff)[_0x5d33('0x24')](function(_0x5c79a9){_0x37eef4[_0x5d33('0x1f')]=_0x5c79a9;if(_0x1b3ec2[_0x5d33('0x31')][_0x5d33('0x40')]){_0xbc4bb0[_0x5d33('0x41')]=[{'all':!![]}];}return db[_0x5d33('0x2c')][_0x5d33('0x42')](_0xbc4bb0);})[_0x5d33('0x24')](function(_0x24855e){_0x37eef4[_0x5d33('0x43')]=_0x24855e;return _0x37eef4;})['then'](respondWithFilteredResult(_0x1c8998,_0xbc4bb0))[_0x5d33('0x44')](handleError(_0x1c8998,null));};exports[_0x5d33('0x45')]=function(_0x23273d,_0x26453a){var _0x261727={'raw':![],'where':{'id':_0x23273d[_0x5d33('0x46')]['id']}},_0x58bcea={};_0x58bcea[_0x5d33('0x30')]=_[_0x5d33('0x32')](db[_0x5d33('0x2c')]['rawAttributes']);_0x58bcea['query']=_[_0x5d33('0x32')](_0x23273d[_0x5d33('0x31')]);_0x58bcea['filters']=_[_0x5d33('0x47')](_0x58bcea[_0x5d33('0x30')],_0x58bcea[_0x5d33('0x31')]);_0x261727[_0x5d33('0x35')]=_[_0x5d33('0x47')](_0x58bcea[_0x5d33('0x30')],qs['fields'](_0x23273d[_0x5d33('0x31')][_0x5d33('0x34')]));_0x261727[_0x5d33('0x35')]=_0x261727['attributes'][_0x5d33('0x36')]?_0x261727['attributes']:_0x58bcea[_0x5d33('0x30')];if(_0x23273d[_0x5d33('0x31')][_0x5d33('0x40')]){_0x261727['include']=[{'all':!![]}];}_0x261727=_[_0x5d33('0x3d')]({},_0x261727,_0x23273d[_0x5d33('0x3f')]);return db['IntegrationReport'][_0x5d33('0x48')](_0x261727)[_0x5d33('0x24')](handleEntityNotFound(_0x26453a,null))[_0x5d33('0x24')](respondWithResult(_0x26453a,null))[_0x5d33('0x44')](handleError(_0x26453a,null));};exports[_0x5d33('0x49')]=function(_0x277874,_0x9538d8){return db[_0x5d33('0x2c')][_0x5d33('0x49')](_0x277874[_0x5d33('0x4a')],{})[_0x5d33('0x24')](respondWithResult(_0x9538d8,0xc9))[_0x5d33('0x44')](handleError(_0x9538d8,null));};exports['update']=function(_0x462790,_0x33f09a){if(_0x462790[_0x5d33('0x4a')]['id']){delete _0x462790[_0x5d33('0x4a')]['id'];}return db['IntegrationReport'][_0x5d33('0x48')]({'where':{'id':_0x462790['params']['id']}})[_0x5d33('0x24')](handleEntityNotFound(_0x33f09a,null))[_0x5d33('0x24')](saveUpdates(_0x462790[_0x5d33('0x4a')],null))['then'](respondWithResult(_0x33f09a,null))['catch'](handleError(_0x33f09a,null));};exports[_0x5d33('0x25')]=function(_0xa52886,_0x223623){return db[_0x5d33('0x2c')][_0x5d33('0x48')]({'where':{'id':_0xa52886['params']['id']}})[_0x5d33('0x24')](handleEntityNotFound(_0x223623,null))[_0x5d33('0x24')](removeEntity(_0x223623,null))[_0x5d33('0x44')](handleError(_0x223623,null));};exports[_0x5d33('0x4b')]=function(_0x249547,_0x483752){return db['IntegrationReport'][_0x5d33('0x4b')]()['then'](respondWithResult(_0x483752,null))[_0x5d33('0x44')](handleError(_0x483752,null));}; \ No newline at end of file +var _0x6275=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','destroy','sendStatus','name','index','map','IntegrationReport','rawAttributes','type','model','query','intersection'];(function(_0x583bf0,_0x4b59aa){var _0x210ec6=function(_0x3a7abb){while(--_0x3a7abb){_0x583bf0['push'](_0x583bf0['shift']());}};_0x210ec6(++_0x4b59aa);}(_0x6275,0x13d));var _0x5627=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6275[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x5627('0x0'));var rimraf=require(_0x5627('0x1'));var zipdir=require(_0x5627('0x2'));var jsonpatch=require(_0x5627('0x3'));var rp=require('request-promise');var moment=require(_0x5627('0x4'));var BPromise=require(_0x5627('0x5'));var Mustache=require(_0x5627('0x6'));var util=require(_0x5627('0x7'));var path=require('path');var sox=require(_0x5627('0x8'));var csv=require(_0x5627('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5627('0xa'));var _=require('lodash');var squel=require(_0x5627('0xb'));var crypto=require(_0x5627('0xc'));var jsforce=require(_0x5627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5627('0x9'));var querystring=require('querystring');var Papa=require(_0x5627('0xe'));var Redis=require(_0x5627('0xf'));var authService=require(_0x5627('0x10'));var qs=require(_0x5627('0x11'));var as=require(_0x5627('0x12'));var hardwareService=require(_0x5627('0x13'));var logger=require(_0x5627('0x14'))(_0x5627('0x15'));var utils=require(_0x5627('0x16'));var config=require(_0x5627('0x17'));var licenseUtil=require(_0x5627('0x18'));var db=require(_0x5627('0x19'))['db'];function respondWithStatusCode(_0x26eac0,_0xcb5300){_0xcb5300=_0xcb5300||0xcc;return function(_0x6fff16){if(_0x6fff16){return _0x26eac0['sendStatus'](_0xcb5300);}return _0x26eac0['status'](_0xcb5300)[_0x5627('0x1a')]();};}function respondWithResult(_0x1b6962,_0x2fd6a5){_0x2fd6a5=_0x2fd6a5||0xc8;return function(_0x57177a){if(_0x57177a){return _0x1b6962['status'](_0x2fd6a5)[_0x5627('0x1b')](_0x57177a);}};}function respondWithFilteredResult(_0x366a8c,_0x5231be){return function(_0x45b837){if(_0x45b837){var _0x131a9b=typeof _0x5231be[_0x5627('0x1c')]==='undefined'&&typeof _0x5231be[_0x5627('0x1d')]===_0x5627('0x1e');var _0x41eb45=_0x45b837[_0x5627('0x1f')];var _0x25a844=_0x131a9b?0x0:_0x5231be['offset'];var _0x5836f7=_0x131a9b?_0x45b837['count']:_0x5231be[_0x5627('0x1c')]+_0x5231be[_0x5627('0x1d')];var _0x4ad0f9;if(_0x5836f7>=_0x41eb45){_0x5836f7=_0x41eb45;_0x4ad0f9=0xc8;}else{_0x4ad0f9=0xce;}_0x366a8c[_0x5627('0x20')](_0x4ad0f9);return _0x366a8c['set'](_0x5627('0x21'),_0x25a844+'-'+_0x5836f7+'/'+_0x41eb45)[_0x5627('0x1b')](_0x45b837);}return null;};}function patchUpdates(_0x1b0194){return function(_0x26211d){try{jsonpatch[_0x5627('0x22')](_0x26211d,_0x1b0194,!![]);}catch(_0x545341){return BPromise[_0x5627('0x23')](_0x545341);}return _0x26211d[_0x5627('0x24')]();};}function saveUpdates(_0x50a54a,_0x140ab1){return function(_0x423132){if(_0x423132){return _0x423132['update'](_0x50a54a)['then'](function(_0x1b90aa){return _0x1b90aa;});}return null;};}function removeEntity(_0x4dc268,_0x520b18){return function(_0x5686ac){if(_0x5686ac){return _0x5686ac[_0x5627('0x25')]()['then'](function(){_0x4dc268[_0x5627('0x20')](0xcc)[_0x5627('0x1a')]();});}};}function handleEntityNotFound(_0x2a9ce3,_0x38bf63){return function(_0x67f38f){if(!_0x67f38f){_0x2a9ce3[_0x5627('0x26')](0x194);}return _0x67f38f;};}function handleError(_0x2e282a,_0x327c6b){_0x327c6b=_0x327c6b||0x1f4;return function(_0x9435f7){logger['error'](_0x9435f7['stack']);if(_0x9435f7[_0x5627('0x27')]){delete _0x9435f7[_0x5627('0x27')];}_0x2e282a['status'](_0x327c6b)['send'](_0x9435f7);};}exports[_0x5627('0x28')]=function(_0x2856bd,_0x484120){var _0x665949={},_0x1e6328={},_0x2eef58={'count':0x0,'rows':[]};var _0x1954d5=_[_0x5627('0x29')](db[_0x5627('0x2a')][_0x5627('0x2b')],function(_0x1ce269){return{'name':_0x1ce269['fieldName'],'type':_0x1ce269[_0x5627('0x2c')]['key']};});_0x1e6328[_0x5627('0x2d')]=_[_0x5627('0x29')](_0x1954d5,_0x5627('0x27'));_0x1e6328[_0x5627('0x2e')]=_['keys'](_0x2856bd[_0x5627('0x2e')]);_0x1e6328['filters']=_[_0x5627('0x2f')](_0x1e6328['model'],_0x1e6328[_0x5627('0x2e')]);_0x665949[_0x5627('0x30')]=_['intersection'](_0x1e6328[_0x5627('0x2d')],qs['fields'](_0x2856bd[_0x5627('0x2e')][_0x5627('0x31')]));_0x665949[_0x5627('0x30')]=_0x665949['attributes'][_0x5627('0x32')]?_0x665949[_0x5627('0x30')]:_0x1e6328[_0x5627('0x2d')];if(!_0x2856bd[_0x5627('0x2e')][_0x5627('0x33')](_0x5627('0x34'))){_0x665949[_0x5627('0x1d')]=qs[_0x5627('0x1d')](_0x2856bd[_0x5627('0x2e')][_0x5627('0x1d')]);_0x665949['offset']=qs[_0x5627('0x1c')](_0x2856bd[_0x5627('0x2e')][_0x5627('0x1c')]);}_0x665949['order']=qs[_0x5627('0x35')](_0x2856bd[_0x5627('0x2e')][_0x5627('0x35')]);_0x665949[_0x5627('0x36')]=qs[_0x5627('0x37')](_[_0x5627('0x38')](_0x2856bd[_0x5627('0x2e')],_0x1e6328['filters']),_0x1954d5);if(_0x2856bd[_0x5627('0x2e')][_0x5627('0x39')]){_0x665949[_0x5627('0x36')]=_[_0x5627('0x3a')](_0x665949[_0x5627('0x36')],{'$or':_[_0x5627('0x29')](_0x1954d5,function(_0x268c63){if(_0x268c63[_0x5627('0x2c')]!==_0x5627('0x3b')){var _0x36f373={};_0x36f373[_0x268c63[_0x5627('0x27')]]={'$like':'%'+_0x2856bd[_0x5627('0x2e')][_0x5627('0x39')]+'%'};return _0x36f373;}})});}_0x665949=_[_0x5627('0x3a')]({},_0x665949,_0x2856bd[_0x5627('0x3c')]);var _0x60094e={'where':_0x665949[_0x5627('0x36')]};return db[_0x5627('0x2a')][_0x5627('0x1f')](_0x60094e)[_0x5627('0x3d')](function(_0x16a9c5){_0x2eef58['count']=_0x16a9c5;if(_0x2856bd[_0x5627('0x2e')][_0x5627('0x3e')]){_0x665949[_0x5627('0x3f')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x665949);})['then'](function(_0x5e04d8){_0x2eef58[_0x5627('0x40')]=_0x5e04d8;return _0x2eef58;})[_0x5627('0x3d')](respondWithFilteredResult(_0x484120,_0x665949))[_0x5627('0x41')](handleError(_0x484120,null));};exports[_0x5627('0x42')]=function(_0x34454f,_0x5a485b){var _0x169438={'raw':![],'where':{'id':_0x34454f['params']['id']}},_0x5c719b={};_0x5c719b[_0x5627('0x2d')]=_[_0x5627('0x43')](db['IntegrationReport'][_0x5627('0x2b')]);_0x5c719b[_0x5627('0x2e')]=_[_0x5627('0x43')](_0x34454f[_0x5627('0x2e')]);_0x5c719b['filters']=_[_0x5627('0x2f')](_0x5c719b[_0x5627('0x2d')],_0x5c719b['query']);_0x169438[_0x5627('0x30')]=_[_0x5627('0x2f')](_0x5c719b['model'],qs['fields'](_0x34454f[_0x5627('0x2e')][_0x5627('0x31')]));_0x169438[_0x5627('0x30')]=_0x169438[_0x5627('0x30')][_0x5627('0x32')]?_0x169438[_0x5627('0x30')]:_0x5c719b[_0x5627('0x2d')];if(_0x34454f[_0x5627('0x2e')][_0x5627('0x3e')]){_0x169438[_0x5627('0x3f')]=[{'all':!![]}];}_0x169438=_[_0x5627('0x3a')]({},_0x169438,_0x34454f[_0x5627('0x3c')]);return db['IntegrationReport'][_0x5627('0x44')](_0x169438)[_0x5627('0x3d')](handleEntityNotFound(_0x5a485b,null))[_0x5627('0x3d')](respondWithResult(_0x5a485b,null))['catch'](handleError(_0x5a485b,null));};exports[_0x5627('0x45')]=function(_0x57b26d,_0x29ccd9){return db[_0x5627('0x2a')][_0x5627('0x45')](_0x57b26d[_0x5627('0x46')],{})[_0x5627('0x3d')](respondWithResult(_0x29ccd9,0xc9))[_0x5627('0x41')](handleError(_0x29ccd9,null));};exports['update']=function(_0xa604f6,_0x5d30fb){if(_0xa604f6[_0x5627('0x46')]['id']){delete _0xa604f6[_0x5627('0x46')]['id'];}return db['IntegrationReport'][_0x5627('0x44')]({'where':{'id':_0xa604f6[_0x5627('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d30fb,null))['then'](saveUpdates(_0xa604f6[_0x5627('0x46')],null))[_0x5627('0x3d')](respondWithResult(_0x5d30fb,null))[_0x5627('0x41')](handleError(_0x5d30fb,null));};exports[_0x5627('0x25')]=function(_0x2c33fb,_0x401fcf){return db[_0x5627('0x2a')][_0x5627('0x44')]({'where':{'id':_0x2c33fb[_0x5627('0x47')]['id']}})[_0x5627('0x3d')](handleEntityNotFound(_0x401fcf,null))[_0x5627('0x3d')](removeEntity(_0x401fcf,null))['catch'](handleError(_0x401fcf,null));};exports['describe']=function(_0x125157,_0x4689d5){return db['IntegrationReport'][_0x5627('0x48')]()[_0x5627('0x3d')](respondWithResult(_0x4689d5,null))['catch'](handleError(_0x4689d5,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2a7b930..64e3201 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 _0xaff4=['lodash','util','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0xa8da7,_0x3e9aa3){var _0x4dc460=function(_0x263df7){while(--_0x263df7){_0xa8da7['push'](_0xa8da7['shift']());}};_0x4dc460(++_0x3e9aa3);}(_0xaff4,0x1a2));var _0x4aff=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xaff4[_0x368bba];return _0x409f8f;};'use strict';var _=require(_0x4aff('0x0'));var util=require(_0x4aff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4aff('0x2'));var fs=require('fs');var path=require(_0x4aff('0x3'));var rimraf=require(_0x4aff('0x4'));var config=require(_0x4aff('0x5'));var attributes=require(_0x4aff('0x6'));module[_0x4aff('0x7')]=function(_0x130ed6,_0x4c05b0){return _0x130ed6[_0x4aff('0x8')](_0x4aff('0x9'),attributes,{'tableName':_0x4aff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf166=['moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api'];(function(_0x135a40,_0x127033){var _0xb84bd8=function(_0x1bddc1){while(--_0x1bddc1){_0x135a40['push'](_0x135a40['shift']());}};_0xb84bd8(++_0x127033);}(_0xf166,0x183));var _0x6f16=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf166[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x6f16('0x0'));var util=require('util');var logger=require(_0x6f16('0x1'))(_0x6f16('0x2'));var moment=require(_0x6f16('0x3'));var BPromise=require(_0x6f16('0x4'));var rp=require(_0x6f16('0x5'));var fs=require('fs');var path=require(_0x6f16('0x6'));var rimraf=require('rimraf');var config=require(_0x6f16('0x7'));var attributes=require(_0x6f16('0x8'));module[_0x6f16('0x9')]=function(_0x46532e,_0x367c2e){return _0x46532e[_0x6f16('0xa')](_0x6f16('0xb'),attributes,{'tableName':_0x6f16('0xc'),'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 fec6f89..c38e234 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 _0x7a54=['info','IntegrationReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x393e3b,_0x5f0f56){_0x393e3b=_0x393e3b-0x0;var _0x2048fc=_0x7a54[_0x393e3b];return _0x2048fc;};'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')]('IntegrationReport,\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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x524e,0x15e));var _0xe524=function(_0x4f3feb,_0x1d1f17){_0x4f3feb=_0x4f3feb-0x0;var _0xf68dfd=_0x524e[_0x4f3feb];return _0xf68dfd;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index acbc18c..013d33e 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 _0x75a2=['get','/:id','isAuthenticated','show','getIntervals','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x6aa2e2,_0x5e21fc){var _0x3746fa=function(_0x1298c1){while(--_0x1298c1){_0x6aa2e2['push'](_0x6aa2e2['shift']());}};_0x3746fa(++_0x5e21fc);}(_0x75a2,0x187));var _0x275a=function(_0x493bd3,_0xe989d){_0x493bd3=_0x493bd3-0x0;var _0xe55fc6=_0x75a2[_0x493bd3];return _0xe55fc6;};'use strict';var multer=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var path=require(_0x275a('0x2'));var timeout=require('connect-timeout');var express=require(_0x275a('0x3'));var router=express[_0x275a('0x4')]();var fs_extra=require(_0x275a('0x5'));var auth=require(_0x275a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x275a('0x7'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x275a('0x8')](_0x275a('0x9'),auth[_0x275a('0xa')](),controller[_0x275a('0xb')]);router['get']('/:id/sub_intervals',auth[_0x275a('0xa')](),controller[_0x275a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x275a('0xd')](_0x275a('0xe'),auth[_0x275a('0xa')](),controller[_0x275a('0xf')]);router[_0x275a('0xd')](_0x275a('0x10'),auth[_0x275a('0xa')](),controller[_0x275a('0x11')]);router[_0x275a('0x12')](_0x275a('0x9'),auth[_0x275a('0xa')](),controller['update']);router[_0x275a('0x13')](_0x275a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x275a('0x14')]=router; \ No newline at end of file +var _0xf321=['../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/sub_intervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x825a2,_0x30a71a){var _0xa8ed8d=function(_0x37b312){while(--_0x37b312){_0x825a2['push'](_0x825a2['shift']());}};_0xa8ed8d(++_0x30a71a);}(_0xf321,0x1dd));var _0x1f32=function(_0x1fcefb,_0x5ae982){_0x1fcefb=_0x1fcefb-0x0;var _0x499a06=_0xf321[_0x1fcefb];return _0x499a06;};'use strict';var multer=require('multer');var util=require(_0x1f32('0x0'));var path=require(_0x1f32('0x1'));var timeout=require(_0x1f32('0x2'));var express=require(_0x1f32('0x3'));var router=express[_0x1f32('0x4')]();var fs_extra=require(_0x1f32('0x5'));var auth=require(_0x1f32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f32('0x7'));var controller=require('./interval.controller');router['get']('/',auth[_0x1f32('0x8')](),controller['index']);router[_0x1f32('0x9')](_0x1f32('0xa'),auth['isAuthenticated'](),controller[_0x1f32('0xb')]);router[_0x1f32('0x9')](_0x1f32('0xc'),auth[_0x1f32('0x8')](),controller['getIntervals']);router[_0x1f32('0xd')]('/',auth[_0x1f32('0x8')](),controller[_0x1f32('0xe')]);router[_0x1f32('0xd')](_0x1f32('0xc'),auth[_0x1f32('0x8')](),controller['addInterval']);router[_0x1f32('0xd')](_0x1f32('0xf'),auth[_0x1f32('0x8')](),controller[_0x1f32('0x10')]);router['put'](_0x1f32('0xa'),auth[_0x1f32('0x8')](),controller[_0x1f32('0x11')]);router[_0x1f32('0x12')](_0x1f32('0xa'),auth[_0x1f32('0x8')](),controller[_0x1f32('0x13')]);module[_0x1f32('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 6f0371a..427d0cb 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 _0x4439=['STRING','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4439,0x18a));var _0x9443=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0x4439[_0x3c414c];return _0x4f3062;};'use strict';var Sequelize=require(_0x9443('0x0'));module[_0x9443('0x1')]={'name':{'type':Sequelize[_0x9443('0x2')]},'description':{'type':Sequelize[_0x9443('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xf678=['STRING','sequelize','exports'];(function(_0x182a3e,_0x1f53c9){var _0x963691=function(_0x45d573){while(--_0x45d573){_0x182a3e['push'](_0x182a3e['shift']());}};_0x963691(++_0x1f53c9);}(_0xf678,0x1f3));var _0x8f67=function(_0x167b28,_0x2c7b95){_0x167b28=_0x167b28-0x0;var _0x38c900=_0xf678[_0x167b28];return _0x38c900;};'use strict';var Sequelize=require(_0x8f67('0x0'));module[_0x8f67('0x1')]={'name':{'type':Sequelize[_0x8f67('0x2')]},'description':{'type':Sequelize[_0x8f67('0x2')]},'interval':{'type':Sequelize[_0x8f67('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 a07fd63..5f079fe 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 _0x0050=['update','params','IntervalId','getIntervals','findOne','filter','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','Intervals','UserProfileResource','destroy','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','options','findAll','catch','show','keys','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x566d00,_0x5055f4){var _0x1bc530=function(_0x266547){while(--_0x266547){_0x566d00['push'](_0x566d00['shift']());}};_0x1bc530(++_0x5055f4);}(_0x0050,0x65));var _0x0005=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0050[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0005('0x0'));var rimraf=require(_0x0005('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0005('0x2'));var rp=require(_0x0005('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0005('0x4'));var util=require(_0x0005('0x5'));var path=require(_0x0005('0x6'));var sox=require(_0x0005('0x7'));var csv=require(_0x0005('0x8'));var ejs=require(_0x0005('0x9'));var fs=require('fs');var fs_extra=require(_0x0005('0xa'));var _=require(_0x0005('0xb'));var squel=require(_0x0005('0xc'));var crypto=require(_0x0005('0xd'));var jsforce=require(_0x0005('0xe'));var deskjs=require(_0x0005('0xf'));var toCsv=require(_0x0005('0x8'));var querystring=require('querystring');var Papa=require(_0x0005('0x10'));var Redis=require(_0x0005('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0005('0x12'));var as=require(_0x0005('0x13'));var hardwareService=require(_0x0005('0x14'));var logger=require('../../config/logger')(_0x0005('0x15'));var utils=require('../../config/utils');var config=require(_0x0005('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0005('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x191604,_0x4cc5fe){_0x4cc5fe=_0x4cc5fe||0xcc;return function(_0x444313){if(_0x444313){return _0x191604[_0x0005('0x18')](_0x4cc5fe);}return _0x191604[_0x0005('0x19')](_0x4cc5fe)['end']();};}function respondWithResult(_0x4e0d5e,_0x45f598){_0x45f598=_0x45f598||0xc8;return function(_0x1b0322){if(_0x1b0322){return _0x4e0d5e[_0x0005('0x19')](_0x45f598)[_0x0005('0x1a')](_0x1b0322);}};}function respondWithFilteredResult(_0x5deea2,_0x2d1821){return function(_0x5b411b){if(_0x5b411b){var _0x13a09b=typeof _0x2d1821[_0x0005('0x1b')]===_0x0005('0x1c')&&typeof _0x2d1821[_0x0005('0x1d')]===_0x0005('0x1c');var _0x430270=_0x5b411b['count'];var _0x44ad15=_0x13a09b?0x0:_0x2d1821[_0x0005('0x1b')];var _0x4fd829=_0x13a09b?_0x5b411b[_0x0005('0x1e')]:_0x2d1821[_0x0005('0x1b')]+_0x2d1821[_0x0005('0x1d')];var _0x2c0cb5;if(_0x4fd829>=_0x430270){_0x4fd829=_0x430270;_0x2c0cb5=0xc8;}else{_0x2c0cb5=0xce;}_0x5deea2[_0x0005('0x19')](_0x2c0cb5);return _0x5deea2[_0x0005('0x1f')](_0x0005('0x20'),_0x44ad15+'-'+_0x4fd829+'/'+_0x430270)[_0x0005('0x1a')](_0x5b411b);}return null;};}function patchUpdates(_0x24b133){return function(_0x444585){try{jsonpatch['apply'](_0x444585,_0x24b133,!![]);}catch(_0x2fe5f0){return BPromise[_0x0005('0x21')](_0x2fe5f0);}return _0x444585[_0x0005('0x22')]();};}function saveUpdates(_0x378f62,_0x534193){return function(_0x2428e8){if(_0x2428e8){return _0x2428e8['update'](_0x378f62)[_0x0005('0x23')](function(_0x57b461){return _0x57b461;});}return null;};}function removeEntity(_0x3efcb6,_0xbae902){return function(_0x497101){if(_0x497101){return _0x497101['destroy']()[_0x0005('0x23')](function(){var _0x3cbea3=_0x497101['get']({'plain':!![]});var _0x474e68=_0x0005('0x24');return db[_0x0005('0x25')][_0x0005('0x26')]({'where':{'type':_0x474e68,'resourceId':_0x3cbea3['id']}})['then'](function(){return _0x497101;});})[_0x0005('0x23')](function(){_0x3efcb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x396b90,_0x4fd56b){return function(_0x2d2a0e){if(!_0x2d2a0e){_0x396b90[_0x0005('0x18')](0x194);}return _0x2d2a0e;};}function handleError(_0x584bf3,_0x4544c2){_0x4544c2=_0x4544c2||0x1f4;return function(_0x40616b){logger[_0x0005('0x27')](_0x40616b[_0x0005('0x28')]);if(_0x40616b['name']){delete _0x40616b[_0x0005('0x29')];}_0x584bf3[_0x0005('0x19')](_0x4544c2)[_0x0005('0x2a')](_0x40616b);};}exports[_0x0005('0x2b')]=function(_0x2a134b,_0x24eec0){var _0x1bef81={},_0x21ee29={},_0x5aaf02={'count':0x0,'rows':[]};var _0x2695cd=_['map'](db[_0x0005('0x2c')][_0x0005('0x2d')],function(_0x1171d2){return{'name':_0x1171d2[_0x0005('0x2e')],'type':_0x1171d2[_0x0005('0x2f')][_0x0005('0x30')]};});_0x21ee29[_0x0005('0x31')]=_[_0x0005('0x32')](_0x2695cd,_0x0005('0x29'));_0x21ee29[_0x0005('0x33')]=_['keys'](_0x2a134b[_0x0005('0x33')]);_0x21ee29['filters']=_[_0x0005('0x34')](_0x21ee29[_0x0005('0x31')],_0x21ee29[_0x0005('0x33')]);_0x1bef81[_0x0005('0x35')]=_['intersection'](_0x21ee29['model'],qs[_0x0005('0x36')](_0x2a134b[_0x0005('0x33')][_0x0005('0x36')]));_0x1bef81['attributes']=_0x1bef81['attributes'][_0x0005('0x37')]?_0x1bef81[_0x0005('0x35')]:_0x21ee29['model'];if(!_0x2a134b['query'][_0x0005('0x38')]('nolimit')){_0x1bef81[_0x0005('0x1d')]=qs[_0x0005('0x1d')](_0x2a134b[_0x0005('0x33')][_0x0005('0x1d')]);_0x1bef81['offset']=qs[_0x0005('0x1b')](_0x2a134b[_0x0005('0x33')][_0x0005('0x1b')]);}_0x1bef81[_0x0005('0x39')]=qs[_0x0005('0x3a')](_0x2a134b[_0x0005('0x33')][_0x0005('0x3a')]);_0x1bef81['where']=qs[_0x0005('0x3b')](_[_0x0005('0x3c')](_0x2a134b[_0x0005('0x33')],_0x21ee29[_0x0005('0x3b')]),_0x2695cd);if(_0x2a134b[_0x0005('0x33')]['filter']){_0x1bef81[_0x0005('0x3d')]=_[_0x0005('0x3e')](_0x1bef81[_0x0005('0x3d')],{'$or':_[_0x0005('0x32')](_0x2695cd,function(_0x2ad745){if(_0x2ad745[_0x0005('0x2f')]!==_0x0005('0x3f')){var _0x5b3477={};_0x5b3477[_0x2ad745[_0x0005('0x29')]]={'$like':'%'+_0x2a134b['query']['filter']+'%'};return _0x5b3477;}})});}_0x1bef81=_[_0x0005('0x3e')]({},_0x1bef81,_0x2a134b[_0x0005('0x40')]);var _0x36983c={'where':_0x1bef81[_0x0005('0x3d')]};return db[_0x0005('0x2c')]['count'](_0x36983c)[_0x0005('0x23')](function(_0x4d4769){_0x5aaf02['count']=_0x4d4769;if(_0x2a134b[_0x0005('0x33')]['includeAll']){_0x1bef81['include']=[{'all':!![]}];}return db[_0x0005('0x2c')][_0x0005('0x41')](_0x1bef81);})[_0x0005('0x23')](function(_0x2178f6){_0x5aaf02['rows']=_0x2178f6;return _0x5aaf02;})[_0x0005('0x23')](respondWithFilteredResult(_0x24eec0,_0x1bef81))[_0x0005('0x42')](handleError(_0x24eec0,null));};exports[_0x0005('0x43')]=function(_0x206a50,_0x41de92){var _0x4a9d10={'raw':!![],'where':{'id':_0x206a50['params']['id']}},_0x5d25cf={};_0x5d25cf[_0x0005('0x31')]=_[_0x0005('0x44')](db[_0x0005('0x2c')][_0x0005('0x2d')]);_0x5d25cf['query']=_['keys'](_0x206a50[_0x0005('0x33')]);_0x5d25cf[_0x0005('0x3b')]=_[_0x0005('0x34')](_0x5d25cf[_0x0005('0x31')],_0x5d25cf['query']);_0x4a9d10[_0x0005('0x35')]=_[_0x0005('0x34')](_0x5d25cf[_0x0005('0x31')],qs[_0x0005('0x36')](_0x206a50[_0x0005('0x33')][_0x0005('0x36')]));_0x4a9d10[_0x0005('0x35')]=_0x4a9d10[_0x0005('0x35')]['length']?_0x4a9d10[_0x0005('0x35')]:_0x5d25cf['model'];if(_0x206a50[_0x0005('0x33')][_0x0005('0x45')]){_0x4a9d10[_0x0005('0x46')]=[{'all':!![]}];}_0x4a9d10=_[_0x0005('0x3e')]({},_0x4a9d10,_0x206a50[_0x0005('0x40')]);return db[_0x0005('0x2c')][_0x0005('0x47')](_0x4a9d10)[_0x0005('0x23')](handleEntityNotFound(_0x41de92,null))['then'](respondWithResult(_0x41de92,null))[_0x0005('0x42')](handleError(_0x41de92,null));};exports[_0x0005('0x48')]=function(_0x2c98b3,_0x2ef598){return db['Interval']['create'](_0x2c98b3[_0x0005('0x49')],{})[_0x0005('0x23')](function(_0x1fefa2){var _0x494c09=_0x2c98b3[_0x0005('0x4a')][_0x0005('0x4b')]({'plain':!![]});if(!_0x494c09)throw new Error(_0x0005('0x4c'));if(_0x494c09[_0x0005('0x4d')]===_0x0005('0x4a')){var _0x89be6d=_0x1fefa2['get']({'plain':!![]});var _0x2004de=_0x0005('0x24');return db['UserProfileSection'][_0x0005('0x47')]({'where':{'name':_0x2004de,'userProfileId':_0x494c09[_0x0005('0x4e')]},'raw':!![]})[_0x0005('0x23')](function(_0x153724){if(_0x153724&&_0x153724[_0x0005('0x4f')]===0x0){return db[_0x0005('0x25')][_0x0005('0x48')]({'name':_0x89be6d[_0x0005('0x29')],'resourceId':_0x89be6d['id'],'type':_0x153724[_0x0005('0x29')],'sectionId':_0x153724['id']},{})['then'](function(){return _0x1fefa2;});}else{return _0x1fefa2;}})['catch'](function(_0x4339f8){logger[_0x0005('0x27')](_0x0005('0x50'),_0x4339f8);throw _0x4339f8;});}return _0x1fefa2;})[_0x0005('0x23')](respondWithResult(_0x2ef598,0xc9))[_0x0005('0x42')](handleError(_0x2ef598,null));};exports[_0x0005('0x51')]=function(_0x2bc486,_0x2e4412){if(_0x2bc486[_0x0005('0x49')]['id']){delete _0x2bc486[_0x0005('0x49')]['id'];}return db['Interval']['find']({'where':{'id':_0x2bc486[_0x0005('0x52')]['id']}})[_0x0005('0x23')](handleEntityNotFound(_0x2e4412,null))['then'](saveUpdates(_0x2bc486[_0x0005('0x49')],null))[_0x0005('0x23')](respondWithResult(_0x2e4412,null))[_0x0005('0x42')](handleError(_0x2e4412,null));};exports[_0x0005('0x26')]=function(_0x1177ff,_0x143d88){return db['Interval'][_0x0005('0x47')]({'where':{'id':_0x1177ff[_0x0005('0x52')]['id']}})[_0x0005('0x23')](handleEntityNotFound(_0x143d88,null))['then'](removeEntity(_0x143d88,null))[_0x0005('0x42')](handleError(_0x143d88,null));};exports['addInterval']=function(_0x342120,_0x45152b,_0x5517b2){if(_0x342120[_0x0005('0x49')]['id']){delete _0x342120[_0x0005('0x49')]['id'];}return db[_0x0005('0x2c')]['find']({'where':{'id':_0x342120['params']['id']}})[_0x0005('0x23')](handleEntityNotFound(_0x45152b,null))['then'](function(_0x1a7e39){if(_0x1a7e39){_0x342120[_0x0005('0x49')][_0x0005('0x53')]=_0x1a7e39['id'];return db[_0x0005('0x2c')][_0x0005('0x48')](_0x342120[_0x0005('0x49')]);}})[_0x0005('0x23')](respondWithResult(_0x45152b,null))['catch'](handleError(_0x45152b,null));};exports[_0x0005('0x54')]=function(_0x53f310,_0x1025e7,_0x49cf72){var _0x18edb1={};var _0x12c48e={};var _0x4b3765;var _0x51c468;return db[_0x0005('0x2c')][_0x0005('0x55')]({'where':{'id':_0x53f310['params']['id']}})[_0x0005('0x23')](handleEntityNotFound(_0x1025e7,null))[_0x0005('0x23')](function(_0x3b2d1d){if(_0x3b2d1d){_0x4b3765=_0x3b2d1d;_0x12c48e[_0x0005('0x31')]=_[_0x0005('0x44')](db['Interval']['rawAttributes']);_0x12c48e[_0x0005('0x33')]=_[_0x0005('0x44')](_0x53f310[_0x0005('0x33')]);_0x12c48e[_0x0005('0x3b')]=_[_0x0005('0x34')](_0x12c48e[_0x0005('0x31')],_0x12c48e[_0x0005('0x33')]);_0x18edb1['attributes']=_[_0x0005('0x34')](_0x12c48e[_0x0005('0x31')],qs[_0x0005('0x36')](_0x53f310[_0x0005('0x33')]['fields']));_0x18edb1[_0x0005('0x35')]=_0x18edb1['attributes'][_0x0005('0x37')]?_0x18edb1[_0x0005('0x35')]:_0x12c48e[_0x0005('0x31')];_0x18edb1['order']=qs[_0x0005('0x3a')](_0x53f310[_0x0005('0x33')]['sort']);_0x18edb1[_0x0005('0x3d')]=qs['filters'](_['pick'](_0x53f310[_0x0005('0x33')],_0x12c48e[_0x0005('0x3b')]));if(_0x53f310[_0x0005('0x33')][_0x0005('0x56')]){_0x18edb1[_0x0005('0x3d')]=_[_0x0005('0x3e')](_0x18edb1['where'],{'$or':_['map'](_0x18edb1[_0x0005('0x35')],function(_0x4605b0){var _0x1b9580={};_0x1b9580[_0x4605b0]={'$like':'%'+_0x53f310[_0x0005('0x33')][_0x0005('0x56')]+'%'};return _0x1b9580;})});}_0x18edb1=_['merge']({},_0x18edb1,_0x53f310[_0x0005('0x40')]);return _0x4b3765[_0x0005('0x54')](_0x18edb1);}})[_0x0005('0x23')](function(_0x4a5d9b){if(_0x4a5d9b){_0x51c468=_0x4a5d9b[_0x0005('0x37')];if(!_0x53f310['query'][_0x0005('0x38')]('nolimit')){_0x18edb1[_0x0005('0x1d')]=qs[_0x0005('0x1d')](_0x53f310[_0x0005('0x33')][_0x0005('0x1d')]);_0x18edb1['offset']=qs[_0x0005('0x1b')](_0x53f310[_0x0005('0x33')][_0x0005('0x1b')]);}return _0x4b3765[_0x0005('0x54')](_0x18edb1);}})[_0x0005('0x23')](function(_0x1e1b88){if(_0x1e1b88){return _0x1e1b88?{'count':_0x51c468,'rows':_0x1e1b88}:null;}})[_0x0005('0x23')](respondWithResult(_0x1025e7,null))[_0x0005('0x42')](handleError(_0x1025e7,null));};exports[_0x0005('0x57')]=function(_0x193a89,_0x6c7240,_0x4fae27){return db[_0x0005('0x2c')][_0x0005('0x55')]({'where':{'id':_0x193a89[_0x0005('0x52')]['id']}})['then'](handleEntityNotFound(_0x6c7240,null))['then'](function(_0x4410f0){if(_0x4410f0){return db[_0x0005('0x58')][_0x0005('0x59')](function(_0x26cbff){return db[_0x0005('0x2c')][_0x0005('0x26')]({'where':{'IntervalId':_0x193a89[_0x0005('0x52')]['id']},'transaction':_0x26cbff})[_0x0005('0x23')](function(_0x127bef){var _0x3b1dbd=_[_0x0005('0x32')](_0x193a89['body'],function(_0x21dd50){delete _0x21dd50['id'];_0x21dd50[_0x0005('0x53')]=_0x193a89['params']['id'];return _0x21dd50;});return db[_0x0005('0x2c')][_0x0005('0x5a')](_0x3b1dbd,{'transaction':_0x26cbff});});})[_0x0005('0x23')](function(){return db['Interval'][_0x0005('0x41')]({'where':{'IntervalId':_0x193a89['params']['id']}});});}})[_0x0005('0x23')](respondWithResult(_0x6c7240,null))[_0x0005('0x42')](handleError(_0x6c7240,null));}; \ No newline at end of file +var _0xe226=['map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','length','pick','nolimit','addIntervals','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','error','stack','name','index'];(function(_0x43a4c6,_0x546a19){var _0x488916=function(_0x3ffaae){while(--_0x3ffaae){_0x43a4c6['push'](_0x43a4c6['shift']());}};_0x488916(++_0x546a19);}(_0xe226,0x1a3));var _0x6e22=function(_0x2a01e7,_0x4c0606){_0x2a01e7=_0x2a01e7-0x0;var _0x48a559=_0xe226[_0x2a01e7];return _0x48a559;};'use strict';var emlformat=require(_0x6e22('0x0'));var rimraf=require(_0x6e22('0x1'));var zipdir=require(_0x6e22('0x2'));var jsonpatch=require(_0x6e22('0x3'));var rp=require(_0x6e22('0x4'));var moment=require(_0x6e22('0x5'));var BPromise=require(_0x6e22('0x6'));var Mustache=require(_0x6e22('0x7'));var util=require(_0x6e22('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e22('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e22('0xa'));var crypto=require(_0x6e22('0xb'));var jsforce=require(_0x6e22('0xc'));var deskjs=require(_0x6e22('0xd'));var toCsv=require(_0x6e22('0xe'));var querystring=require(_0x6e22('0xf'));var Papa=require(_0x6e22('0x10'));var Redis=require(_0x6e22('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6e22('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e22('0x13'));var logger=require(_0x6e22('0x14'))('api');var utils=require(_0x6e22('0x15'));var config=require(_0x6e22('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e22('0x17'))['db'];var extensions=require(_0x6e22('0x18'));function respondWithStatusCode(_0x451c50,_0xf7926c){_0xf7926c=_0xf7926c||0xcc;return function(_0x595e52){if(_0x595e52){return _0x451c50[_0x6e22('0x19')](_0xf7926c);}return _0x451c50[_0x6e22('0x1a')](_0xf7926c)[_0x6e22('0x1b')]();};}function respondWithResult(_0x7a4239,_0x3966ee){_0x3966ee=_0x3966ee||0xc8;return function(_0x32019a){if(_0x32019a){return _0x7a4239[_0x6e22('0x1a')](_0x3966ee)[_0x6e22('0x1c')](_0x32019a);}};}function respondWithFilteredResult(_0x381001,_0x1129cc){return function(_0xd706e4){if(_0xd706e4){var _0x40aee5=typeof _0x1129cc[_0x6e22('0x1d')]===_0x6e22('0x1e')&&typeof _0x1129cc[_0x6e22('0x1f')]===_0x6e22('0x1e');var _0x1d6b01=_0xd706e4[_0x6e22('0x20')];var _0x515f29=_0x40aee5?0x0:_0x1129cc[_0x6e22('0x1d')];var _0x12bd9b=_0x40aee5?_0xd706e4[_0x6e22('0x20')]:_0x1129cc[_0x6e22('0x1d')]+_0x1129cc['limit'];var _0x3708bb;if(_0x12bd9b>=_0x1d6b01){_0x12bd9b=_0x1d6b01;_0x3708bb=0xc8;}else{_0x3708bb=0xce;}_0x381001['status'](_0x3708bb);return _0x381001[_0x6e22('0x21')](_0x6e22('0x22'),_0x515f29+'-'+_0x12bd9b+'/'+_0x1d6b01)['json'](_0xd706e4);}return null;};}function patchUpdates(_0x58cf2f){return function(_0x379753){try{jsonpatch[_0x6e22('0x23')](_0x379753,_0x58cf2f,!![]);}catch(_0x46f26f){return BPromise[_0x6e22('0x24')](_0x46f26f);}return _0x379753['save']();};}function saveUpdates(_0x50cd1f,_0x1979a3){return function(_0x29b0aa){if(_0x29b0aa){return _0x29b0aa[_0x6e22('0x25')](_0x50cd1f)[_0x6e22('0x26')](function(_0x677ed0){return _0x677ed0;});}return null;};}function removeEntity(_0x2508a9,_0x22e4af){return function(_0x2ac862){if(_0x2ac862){return _0x2ac862[_0x6e22('0x27')]()[_0x6e22('0x26')](function(){var _0x45a68a=_0x2ac862[_0x6e22('0x28')]({'plain':!![]});var _0x286ef9=_0x6e22('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x286ef9,'resourceId':_0x45a68a['id']}})[_0x6e22('0x26')](function(){return _0x2ac862;});})[_0x6e22('0x26')](function(){_0x2508a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6c6e7,_0xaf98cc){return function(_0x24cf2a){if(!_0x24cf2a){_0xd6c6e7[_0x6e22('0x19')](0x194);}return _0x24cf2a;};}function handleError(_0x5511ef,_0x9a7777){_0x9a7777=_0x9a7777||0x1f4;return function(_0x59abef){logger[_0x6e22('0x2a')](_0x59abef[_0x6e22('0x2b')]);if(_0x59abef[_0x6e22('0x2c')]){delete _0x59abef[_0x6e22('0x2c')];}_0x5511ef['status'](_0x9a7777)['send'](_0x59abef);};}exports[_0x6e22('0x2d')]=function(_0x4972c4,_0x18a806){var _0x400c9a={},_0x8d2f33={},_0x9d5649={'count':0x0,'rows':[]};var _0x44873f=_[_0x6e22('0x2e')](db[_0x6e22('0x2f')][_0x6e22('0x30')],function(_0x4d31f8){return{'name':_0x4d31f8[_0x6e22('0x31')],'type':_0x4d31f8[_0x6e22('0x32')][_0x6e22('0x33')]};});_0x8d2f33[_0x6e22('0x34')]=_['map'](_0x44873f,_0x6e22('0x2c'));_0x8d2f33['query']=_[_0x6e22('0x35')](_0x4972c4[_0x6e22('0x36')]);_0x8d2f33[_0x6e22('0x37')]=_[_0x6e22('0x38')](_0x8d2f33['model'],_0x8d2f33['query']);_0x400c9a['attributes']=_[_0x6e22('0x38')](_0x8d2f33[_0x6e22('0x34')],qs[_0x6e22('0x39')](_0x4972c4[_0x6e22('0x36')][_0x6e22('0x39')]));_0x400c9a[_0x6e22('0x3a')]=_0x400c9a[_0x6e22('0x3a')]['length']?_0x400c9a[_0x6e22('0x3a')]:_0x8d2f33[_0x6e22('0x34')];if(!_0x4972c4[_0x6e22('0x36')][_0x6e22('0x3b')]('nolimit')){_0x400c9a[_0x6e22('0x1f')]=qs[_0x6e22('0x1f')](_0x4972c4[_0x6e22('0x36')][_0x6e22('0x1f')]);_0x400c9a[_0x6e22('0x1d')]=qs[_0x6e22('0x1d')](_0x4972c4['query'][_0x6e22('0x1d')]);}_0x400c9a[_0x6e22('0x3c')]=qs['sort'](_0x4972c4[_0x6e22('0x36')][_0x6e22('0x3d')]);_0x400c9a[_0x6e22('0x3e')]=qs['filters'](_['pick'](_0x4972c4[_0x6e22('0x36')],_0x8d2f33[_0x6e22('0x37')]),_0x44873f);if(_0x4972c4[_0x6e22('0x36')][_0x6e22('0x3f')]){_0x400c9a[_0x6e22('0x3e')]=_[_0x6e22('0x40')](_0x400c9a[_0x6e22('0x3e')],{'$or':_[_0x6e22('0x2e')](_0x44873f,function(_0x2f58c7){if(_0x2f58c7[_0x6e22('0x32')]!==_0x6e22('0x41')){var _0x10d3a7={};_0x10d3a7[_0x2f58c7[_0x6e22('0x2c')]]={'$like':'%'+_0x4972c4[_0x6e22('0x36')]['filter']+'%'};return _0x10d3a7;}})});}_0x400c9a=_[_0x6e22('0x40')]({},_0x400c9a,_0x4972c4['options']);var _0x6f0d8a={'where':_0x400c9a[_0x6e22('0x3e')]};return db[_0x6e22('0x2f')]['count'](_0x6f0d8a)[_0x6e22('0x26')](function(_0x3d84ef){_0x9d5649[_0x6e22('0x20')]=_0x3d84ef;if(_0x4972c4[_0x6e22('0x36')][_0x6e22('0x42')]){_0x400c9a[_0x6e22('0x43')]=[{'all':!![]}];}return db['Interval'][_0x6e22('0x44')](_0x400c9a);})['then'](function(_0x34dd95){_0x9d5649[_0x6e22('0x45')]=_0x34dd95;return _0x9d5649;})[_0x6e22('0x26')](respondWithFilteredResult(_0x18a806,_0x400c9a))[_0x6e22('0x46')](handleError(_0x18a806,null));};exports[_0x6e22('0x47')]=function(_0x1aeb3c,_0xae4e1e){var _0x1b69ed={'raw':!![],'where':{'id':_0x1aeb3c[_0x6e22('0x48')]['id']}},_0x5cd5f5={};_0x5cd5f5[_0x6e22('0x34')]=_[_0x6e22('0x35')](db[_0x6e22('0x2f')][_0x6e22('0x30')]);_0x5cd5f5[_0x6e22('0x36')]=_[_0x6e22('0x35')](_0x1aeb3c[_0x6e22('0x36')]);_0x5cd5f5[_0x6e22('0x37')]=_['intersection'](_0x5cd5f5[_0x6e22('0x34')],_0x5cd5f5[_0x6e22('0x36')]);_0x1b69ed['attributes']=_['intersection'](_0x5cd5f5[_0x6e22('0x34')],qs[_0x6e22('0x39')](_0x1aeb3c[_0x6e22('0x36')][_0x6e22('0x39')]));_0x1b69ed[_0x6e22('0x3a')]=_0x1b69ed[_0x6e22('0x3a')]['length']?_0x1b69ed['attributes']:_0x5cd5f5[_0x6e22('0x34')];if(_0x1aeb3c[_0x6e22('0x36')][_0x6e22('0x42')]){_0x1b69ed[_0x6e22('0x43')]=[{'all':!![]}];}_0x1b69ed=_[_0x6e22('0x40')]({},_0x1b69ed,_0x1aeb3c['options']);return db[_0x6e22('0x2f')][_0x6e22('0x49')](_0x1b69ed)[_0x6e22('0x26')](handleEntityNotFound(_0xae4e1e,null))[_0x6e22('0x26')](respondWithResult(_0xae4e1e,null))['catch'](handleError(_0xae4e1e,null));};exports[_0x6e22('0x4a')]=function(_0x42a74d,_0x41c0d5){return db[_0x6e22('0x2f')][_0x6e22('0x4a')](_0x42a74d[_0x6e22('0x4b')],{})[_0x6e22('0x26')](function(_0x1c1b52){var _0x3a3b6a=_0x42a74d[_0x6e22('0x4c')][_0x6e22('0x28')]({'plain':!![]});if(!_0x3a3b6a)throw new Error(_0x6e22('0x4d'));if(_0x3a3b6a[_0x6e22('0x4e')]===_0x6e22('0x4c')){var _0x251ba6=_0x1c1b52[_0x6e22('0x28')]({'plain':!![]});var _0x35a720='Intervals';return db[_0x6e22('0x4f')][_0x6e22('0x49')]({'where':{'name':_0x35a720,'userProfileId':_0x3a3b6a[_0x6e22('0x50')]},'raw':!![]})['then'](function(_0x43a375){if(_0x43a375&&_0x43a375[_0x6e22('0x51')]===0x0){return db[_0x6e22('0x52')][_0x6e22('0x4a')]({'name':_0x251ba6[_0x6e22('0x2c')],'resourceId':_0x251ba6['id'],'type':_0x43a375[_0x6e22('0x2c')],'sectionId':_0x43a375['id']},{})[_0x6e22('0x26')](function(){return _0x1c1b52;});}else{return _0x1c1b52;}})[_0x6e22('0x46')](function(_0x4868e9){logger[_0x6e22('0x2a')](_0x6e22('0x53'),_0x4868e9);throw _0x4868e9;});}return _0x1c1b52;})[_0x6e22('0x26')](respondWithResult(_0x41c0d5,0xc9))['catch'](handleError(_0x41c0d5,null));};exports[_0x6e22('0x25')]=function(_0xcbbe50,_0x18b416){if(_0xcbbe50[_0x6e22('0x4b')]['id']){delete _0xcbbe50['body']['id'];}return db['Interval'][_0x6e22('0x49')]({'where':{'id':_0xcbbe50['params']['id']}})[_0x6e22('0x26')](handleEntityNotFound(_0x18b416,null))[_0x6e22('0x26')](saveUpdates(_0xcbbe50['body'],null))[_0x6e22('0x26')](respondWithResult(_0x18b416,null))[_0x6e22('0x46')](handleError(_0x18b416,null));};exports[_0x6e22('0x27')]=function(_0x3031f2,_0x54f9e8){return db[_0x6e22('0x2f')][_0x6e22('0x49')]({'where':{'id':_0x3031f2[_0x6e22('0x48')]['id']}})['then'](handleEntityNotFound(_0x54f9e8,null))[_0x6e22('0x26')](removeEntity(_0x54f9e8,null))[_0x6e22('0x46')](handleError(_0x54f9e8,null));};exports[_0x6e22('0x54')]=function(_0x1280d0,_0xd01775,_0x3735ae){if(_0x1280d0[_0x6e22('0x4b')]['id']){delete _0x1280d0[_0x6e22('0x4b')]['id'];}return db[_0x6e22('0x2f')][_0x6e22('0x49')]({'where':{'id':_0x1280d0[_0x6e22('0x48')]['id']}})[_0x6e22('0x26')](handleEntityNotFound(_0xd01775,null))[_0x6e22('0x26')](function(_0xb4ee83){if(_0xb4ee83){_0x1280d0['body'][_0x6e22('0x55')]=_0xb4ee83['id'];return db[_0x6e22('0x2f')]['create'](_0x1280d0[_0x6e22('0x4b')]);}})[_0x6e22('0x26')](respondWithResult(_0xd01775,null))['catch'](handleError(_0xd01775,null));};exports[_0x6e22('0x56')]=function(_0x4baf84,_0x432205,_0x41ed60){var _0x51f16b={};var _0x25e796={};var _0xc1e091;var _0x125b1f;return db[_0x6e22('0x2f')][_0x6e22('0x57')]({'where':{'id':_0x4baf84[_0x6e22('0x48')]['id']}})[_0x6e22('0x26')](handleEntityNotFound(_0x432205,null))[_0x6e22('0x26')](function(_0x164bbb){if(_0x164bbb){_0xc1e091=_0x164bbb;_0x25e796['model']=_[_0x6e22('0x35')](db[_0x6e22('0x2f')]['rawAttributes']);_0x25e796[_0x6e22('0x36')]=_[_0x6e22('0x35')](_0x4baf84[_0x6e22('0x36')]);_0x25e796[_0x6e22('0x37')]=_[_0x6e22('0x38')](_0x25e796['model'],_0x25e796[_0x6e22('0x36')]);_0x51f16b['attributes']=_['intersection'](_0x25e796[_0x6e22('0x34')],qs[_0x6e22('0x39')](_0x4baf84[_0x6e22('0x36')][_0x6e22('0x39')]));_0x51f16b[_0x6e22('0x3a')]=_0x51f16b['attributes'][_0x6e22('0x58')]?_0x51f16b[_0x6e22('0x3a')]:_0x25e796[_0x6e22('0x34')];_0x51f16b[_0x6e22('0x3c')]=qs[_0x6e22('0x3d')](_0x4baf84[_0x6e22('0x36')][_0x6e22('0x3d')]);_0x51f16b[_0x6e22('0x3e')]=qs[_0x6e22('0x37')](_[_0x6e22('0x59')](_0x4baf84[_0x6e22('0x36')],_0x25e796[_0x6e22('0x37')]));if(_0x4baf84[_0x6e22('0x36')]['filter']){_0x51f16b[_0x6e22('0x3e')]=_[_0x6e22('0x40')](_0x51f16b['where'],{'$or':_[_0x6e22('0x2e')](_0x51f16b[_0x6e22('0x3a')],function(_0x1ab84f){var _0x401a17={};_0x401a17[_0x1ab84f]={'$like':'%'+_0x4baf84[_0x6e22('0x36')][_0x6e22('0x3f')]+'%'};return _0x401a17;})});}_0x51f16b=_[_0x6e22('0x40')]({},_0x51f16b,_0x4baf84['options']);return _0xc1e091[_0x6e22('0x56')](_0x51f16b);}})[_0x6e22('0x26')](function(_0x282ec4){if(_0x282ec4){_0x125b1f=_0x282ec4[_0x6e22('0x58')];if(!_0x4baf84[_0x6e22('0x36')][_0x6e22('0x3b')](_0x6e22('0x5a'))){_0x51f16b[_0x6e22('0x1f')]=qs['limit'](_0x4baf84['query'][_0x6e22('0x1f')]);_0x51f16b['offset']=qs[_0x6e22('0x1d')](_0x4baf84['query']['offset']);}return _0xc1e091[_0x6e22('0x56')](_0x51f16b);}})[_0x6e22('0x26')](function(_0x1a44ae){if(_0x1a44ae){return _0x1a44ae?{'count':_0x125b1f,'rows':_0x1a44ae}:null;}})[_0x6e22('0x26')](respondWithResult(_0x432205,null))['catch'](handleError(_0x432205,null));};exports[_0x6e22('0x5b')]=function(_0x31a662,_0x5e5139,_0x27c0c4){return db[_0x6e22('0x2f')]['findOne']({'where':{'id':_0x31a662[_0x6e22('0x48')]['id']}})[_0x6e22('0x26')](handleEntityNotFound(_0x5e5139,null))[_0x6e22('0x26')](function(_0xcf596f){if(_0xcf596f){return db[_0x6e22('0x5c')]['transaction'](function(_0x4cbcf6){return db[_0x6e22('0x2f')][_0x6e22('0x27')]({'where':{'IntervalId':_0x31a662[_0x6e22('0x48')]['id']},'transaction':_0x4cbcf6})[_0x6e22('0x26')](function(_0x5b5362){var _0x6f4d8e=_[_0x6e22('0x2e')](_0x31a662['body'],function(_0x25ed31){delete _0x25ed31['id'];_0x25ed31['IntervalId']=_0x31a662[_0x6e22('0x48')]['id'];return _0x25ed31;});return db[_0x6e22('0x2f')]['bulkCreate'](_0x6f4d8e,{'transaction':_0x4cbcf6});});})[_0x6e22('0x26')](function(){return db[_0x6e22('0x2f')][_0x6e22('0x44')]({'where':{'IntervalId':_0x31a662[_0x6e22('0x48')]['id']}});});}})[_0x6e22('0x26')](respondWithResult(_0x5e5139,null))[_0x6e22('0x46')](handleError(_0x5e5139,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 95d040a..e90d441 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 _0x1b81=['../../config/environment','./interval.attributes','exports','Interval','rewrite','../../config/logger','request-promise','path'];(function(_0xe21d45,_0x6f5e38){var _0x322a32=function(_0x3b87c1){while(--_0x3b87c1){_0xe21d45['push'](_0xe21d45['shift']());}};_0x322a32(++_0x6f5e38);}(_0x1b81,0x7d));var _0x11b8=function(_0x15a168,_0xb39156){_0x15a168=_0x15a168-0x0;var _0x313e76=_0x1b81[_0x15a168];return _0x313e76;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11b8('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x11b8('0x1'));var fs=require('fs');var path=require(_0x11b8('0x2'));var rimraf=require('rimraf');var config=require(_0x11b8('0x3'));var attributes=require(_0x11b8('0x4'));var extensions=require('../../components/extensions/rewrite');module[_0x11b8('0x5')]=function(_0x4c579d,_0x46c2a4){return _0x4c579d['define'](_0x11b8('0x6'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x109cef,_0x2e1db2){extensions[_0x11b8('0x7')](_0x4c579d,_0x109cef);},'afterBulkCreate':function(_0x393718,_0x2c2a96,_0x586f15){_0x586f15();extensions[_0x11b8('0x7')](_0x4c579d,_0x393718[0x0]);},'afterUpdate':function(_0x5b1ae3,_0x2ec125){extensions[_0x11b8('0x7')](_0x4c579d,_0x5b1ae3);},'afterDestroy':function(_0x2b8826,_0x5ef4c5){extensions[_0x11b8('0x7')](_0x4c579d,_0x2b8826);}}});}; \ No newline at end of file +var _0xf6cf=['Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define'];(function(_0x89ac51,_0x5ecae1){var _0x166509=function(_0x11f862){while(--_0x11f862){_0x89ac51['push'](_0x89ac51['shift']());}};_0x166509(++_0x5ecae1);}(_0xf6cf,0x1b6));var _0xff6c=function(_0x428b23,_0x544aab){_0x428b23=_0x428b23-0x0;var _0x1f6673=_0xf6cf[_0x428b23];return _0x1f6673;};'use strict';var _=require('lodash');var util=require(_0xff6c('0x0'));var logger=require(_0xff6c('0x1'))(_0xff6c('0x2'));var moment=require(_0xff6c('0x3'));var BPromise=require(_0xff6c('0x4'));var rp=require(_0xff6c('0x5'));var fs=require('fs');var path=require(_0xff6c('0x6'));var rimraf=require(_0xff6c('0x7'));var config=require(_0xff6c('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0xff6c('0x9'));module[_0xff6c('0xa')]=function(_0x3b9c0a,_0x34c8a2){return _0x3b9c0a[_0xff6c('0xb')](_0xff6c('0xc'),attributes,{'tableName':_0xff6c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4261a0,_0x2779cb){extensions[_0xff6c('0xe')](_0x3b9c0a,_0x4261a0);},'afterBulkCreate':function(_0x3d9024,_0x29a5b1,_0x5cdc85){_0x5cdc85();extensions['rewrite'](_0x3b9c0a,_0x3d9024[0x0]);},'afterUpdate':function(_0x426768,_0xa7d9f9){extensions[_0xff6c('0xe')](_0x3b9c0a,_0x426768);},'afterDestroy':function(_0x6877a,_0x1e8722){extensions[_0xff6c('0xe')](_0x3b9c0a,_0x6877a);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index cebb709..31388ab 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 31e2318..c59f6fc 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x599049,_0x105e9b){var _0x5b3152=function(_0x45c1de){while(--_0x45c1de){_0x599049['push'](_0x599049['shift']());}};_0x5b3152(++_0x105e9b);}(_0xadb5,0xad));var _0x5adb=function(_0x229f4a,_0x1780f9){_0x229f4a=_0x229f4a-0x0;var _0x5dc80c=_0xadb5[_0x229f4a];return _0x5dc80c;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x0b0e,0x187));var _0xe0b0=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x0b0e[_0x48961c];return _0x1d895d;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('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 8f06f20..3732ad9 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 _0xc530=['email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','setEncoding','utf8','data','json','parse','error','status','api.jira','write','end','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','api','support','3eAmWpBVP0','key','MOTGUI','Report','description','stringify','issuetype','Bug','customfield_11500'];(function(_0x3a5d69,_0x1e2796){var _0x281f97=function(_0x2a2dd7){while(--_0x2a2dd7){_0x3a5d69['push'](_0x3a5d69['shift']());}};_0x281f97(++_0x1e2796);}(_0xc530,0xf7));var _0x0c53=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xc530[_0x30d87a];return _0x48f64b;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0x0c53('0x0'));var USERNAME=_0x0c53('0x1');var PASSWORD=_0x0c53('0x2');function openIssue(_0x1d6a1a,_0x53f218){var _0x4dd636={'fields':{'project':{'key':_0x1d6a1a[_0x0c53('0x3')]||_0x0c53('0x4')},'summary':(_0x1d6a1a['summary']||_0x0c53('0x5'))+'\x20from\x20'+_0x1d6a1a['ip'],'description':_0x1d6a1a[_0x0c53('0x6')]||JSON[_0x0c53('0x7')](_0x1d6a1a),'issuetype':{'name':_0x1d6a1a[_0x0c53('0x8')]||_0x0c53('0x9')}}};_0x4dd636['fields'][_0x0c53('0xa')]=_0x1d6a1a[_0x0c53('0xb')];_0x4dd636[_0x0c53('0xc')][_0x0c53('0xd')]=_0x1d6a1a[_0x0c53('0xe')];_0x4dd636[_0x0c53('0xc')][_0x0c53('0xf')]=_0x1d6a1a[_0x0c53('0x10')];_0x4dd636[_0x0c53('0xc')][_0x0c53('0x11')]=_0x1d6a1a[_0x0c53('0x12')];_0x4dd636[_0x0c53('0xc')][_0x0c53('0x13')]=_0x1d6a1a[_0x0c53('0x14')];_0x4dd636[_0x0c53('0xc')]['customfield_10102']=_0x1d6a1a['ip'];var _0x960f3c={'host':_0x0c53('0x15'),'port':0x1bb,'path':_0x0c53('0x16'),'method':_0x0c53('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0c53('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0c53('0x19')](_0x0c53('0x1a'))}};var _0x178229=JSON['stringify'](_0x4dd636);var _0xa0cf51=https['request'](_0x960f3c,function(_0x80f907){_0x80f907[_0x0c53('0x1b')](_0x0c53('0x1c'));var _0x52d55d='';_0x80f907['on'](_0x0c53('0x1d'),function(_0x1adf3e){_0x52d55d+=_0x1adf3e;});_0x80f907['on']('end',function(){if(_0x53f218){return _0x53f218['status'](_0x80f907['statusCode'])[_0x0c53('0x1e')](JSON[_0x0c53('0x1f')](_0x52d55d));}});});_0xa0cf51['on'](_0x0c53('0x20'),function(_0x2d2ea1){if(_0x53f218){return _0x53f218[_0x0c53('0x21')](0x1f4)[_0x0c53('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0c53('0x22')}]});}});_0xa0cf51[_0x0c53('0x23')](_0x178229);_0xa0cf51[_0x0c53('0x24')]();}exports[_0x0c53('0x25')]=openIssue;exports['send']=function(_0x717e35,_0x1d76da){_0x717e35[_0x0c53('0x26')]['ip']=_0x717e35[_0x0c53('0x27')][_0x0c53('0x28')]||_0x717e35[_0x0c53('0x29')][_0x0c53('0x2a')]||_0x717e35['socket'][_0x0c53('0x2a')]||_0x717e35[_0x0c53('0x29')]['socket'][_0x0c53('0x2a')];return openIssue(_0x717e35['body'],_0x1d76da);}; \ No newline at end of file +var _0x4341=['error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','toString','base64','stringify','request','setEncoding','data','end','statusCode'];(function(_0x37e342,_0x160c8f){var _0x1768f9=function(_0x413c98){while(--_0x413c98){_0x37e342['push'](_0x37e342['shift']());}};_0x1768f9(++_0x160c8f);}(_0x4341,0x103));var _0x1434=function(_0x3d823b,_0x245c0d){_0x3d823b=_0x3d823b-0x0;var _0x1c23cd=_0x4341[_0x3d823b];return _0x1c23cd;};'use strict';var BPromise=require(_0x1434('0x0'));var https=require(_0x1434('0x1'));var logger=require(_0x1434('0x2'))(_0x1434('0x3'));var USERNAME=_0x1434('0x4');var PASSWORD=_0x1434('0x5');function openIssue(_0x1f14a0,_0x583566){var _0x388c8a={'fields':{'project':{'key':_0x1f14a0[_0x1434('0x6')]||_0x1434('0x7')},'summary':(_0x1f14a0[_0x1434('0x8')]||_0x1434('0x9'))+_0x1434('0xa')+_0x1f14a0['ip'],'description':_0x1f14a0['description']||JSON['stringify'](_0x1f14a0),'issuetype':{'name':_0x1f14a0[_0x1434('0xb')]||_0x1434('0xc')}}};_0x388c8a[_0x1434('0xd')][_0x1434('0xe')]=_0x1f14a0[_0x1434('0xf')];_0x388c8a[_0x1434('0xd')][_0x1434('0x10')]=_0x1f14a0[_0x1434('0x11')];_0x388c8a[_0x1434('0xd')][_0x1434('0x12')]=_0x1f14a0[_0x1434('0x13')];_0x388c8a[_0x1434('0xd')][_0x1434('0x14')]=_0x1f14a0[_0x1434('0x15')];_0x388c8a[_0x1434('0xd')][_0x1434('0x16')]=_0x1f14a0['reason'];_0x388c8a[_0x1434('0xd')][_0x1434('0x17')]=_0x1f14a0['ip'];var _0x30b776={'host':_0x1434('0x18'),'port':0x1bb,'path':_0x1434('0x19'),'method':_0x1434('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1434('0x1b')](_0x1434('0x1c'))}};var _0x2b51a8=JSON[_0x1434('0x1d')](_0x388c8a);var _0x5f4bee=https[_0x1434('0x1e')](_0x30b776,function(_0x3f4ee0){_0x3f4ee0[_0x1434('0x1f')]('utf8');var _0x30db64='';_0x3f4ee0['on'](_0x1434('0x20'),function(_0x56791a){_0x30db64+=_0x56791a;});_0x3f4ee0['on'](_0x1434('0x21'),function(){if(_0x583566){return _0x583566['status'](_0x3f4ee0[_0x1434('0x22')])['json'](JSON['parse'](_0x30db64));}});});_0x5f4bee['on'](_0x1434('0x23'),function(_0x3e82cb){if(_0x583566){return _0x583566[_0x1434('0x24')](0x1f4)[_0x1434('0x25')]({'errors':[{'message':_0x1434('0x26'),'type':_0x1434('0x27')}]});}});_0x5f4bee[_0x1434('0x28')](_0x2b51a8);_0x5f4bee[_0x1434('0x21')]();}exports[_0x1434('0x29')]=openIssue;exports[_0x1434('0x2a')]=function(_0x5e4319,_0x523e75){_0x5e4319[_0x1434('0x2b')]['ip']=_0x5e4319[_0x1434('0x2c')][_0x1434('0x2d')]||_0x5e4319[_0x1434('0x2e')][_0x1434('0x2f')]||_0x5e4319[_0x1434('0x30')][_0x1434('0x2f')]||_0x5e4319[_0x1434('0x2e')]['socket'][_0x1434('0x2f')];return openIssue(_0x5e4319[_0x1434('0x2b')],_0x523e75);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index dc59350..e40c2f8 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','exports','multer','util'];(function(_0x4a0de0,_0x4a0be6){var _0x375e71=function(_0xc8993e){while(--_0xc8993e){_0x4a0de0['push'](_0x4a0de0['shift']());}};_0x375e71(++_0x4a0be6);}(_0x6324,0x142));var _0x4632=function(_0x3c99ef,_0x50b107){_0x3c99ef=_0x3c99ef-0x0;var _0x17550c=_0x6324[_0x3c99ef];return _0x17550c;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xe'),auth[_0x4632('0x8')](),controller['destroy']);module[_0x4632('0x11')]=router; \ No newline at end of file +var _0xd64b=['../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','post','create','update','delete','exports','multer','path','express','Router','fs-extra'];(function(_0x196977,_0x493310){var _0x2adc4f=function(_0x500a05){while(--_0x500a05){_0x196977['push'](_0x196977['shift']());}};_0x2adc4f(++_0x493310);}(_0xd64b,0xc1));var _0xbd64=function(_0x15ec35,_0x5b9972){_0x15ec35=_0x15ec35-0x0;var _0x937cce=_0xd64b[_0x15ec35];return _0x937cce;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0xd')]('/',auth[_0xbd64('0xa')](),controller[_0xbd64('0xe')]);router['put'](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xf')]);router[_0xbd64('0x10')]('/:id',auth[_0xbd64('0xa')](),controller['destroy']);module[_0xbd64('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 2ff3f57..b5fb20d 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x4ece37,_0x478187){_0x4ece37=_0x4ece37-0x0;var _0x2cd5e8=_0x7a54[_0x4ece37];return _0x2cd5e8;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x298d67,_0x599c48){_0x298d67=_0x298d67-0x0;var _0xa1599a=_0x7a54[_0x298d67];return _0xa1599a;};'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 6c9f1c5..4563f53 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 _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','JscriptyAnswerReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x6edc85,_0x2c7710){var _0x4631a9=function(_0x1988a9){while(--_0x1988a9){_0x6edc85['push'](_0x6edc85['shift']());}};_0x4631a9(++_0x2c7710);}(_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){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['JscriptyAnswerReport']['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['JscriptyAnswerReport'][_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['JscriptyAnswerReport'][_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','JscriptyAnswerReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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['JscriptyAnswerReport']['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['JscriptyAnswerReport'][_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['JscriptyAnswerReport'][_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/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c483f63..d456895 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 _0x1021=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','report_jscripty_answers'];(function(_0xf02982,_0x51cacc){var _0x30b0d7=function(_0x2e9b85){while(--_0x2e9b85){_0xf02982['push'](_0xf02982['shift']());}};_0x30b0d7(++_0x51cacc);}(_0x1021,0x78));var _0x1102=function(_0x2ba716,_0x4e486b){_0x2ba716=_0x2ba716-0x0;var _0x4b5fbf=_0x1021[_0x2ba716];return _0x4b5fbf;};'use strict';var _=require(_0x1102('0x0'));var util=require(_0x1102('0x1'));var logger=require('../../config/logger')(_0x1102('0x2'));var moment=require('moment');var BPromise=require(_0x1102('0x3'));var rp=require(_0x1102('0x4'));var fs=require('fs');var path=require(_0x1102('0x5'));var rimraf=require(_0x1102('0x6'));var config=require(_0x1102('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x3287b5,_0x4d619c){return _0x3287b5[_0x1102('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x1102('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3031=['api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x3031,0x1b8));var _0x1303=function(_0x3e9fb8,_0x4e8909){_0x3e9fb8=_0x3e9fb8-0x0;var _0x571b55=_0x3031[_0x3e9fb8];return _0x571b55;};'use strict';var _=require(_0x1303('0x0'));var util=require('util');var logger=require(_0x1303('0x1'))(_0x1303('0x2'));var moment=require(_0x1303('0x3'));var BPromise=require('bluebird');var rp=require(_0x1303('0x4'));var fs=require('fs');var path=require(_0x1303('0x5'));var rimraf=require(_0x1303('0x6'));var config=require(_0x1303('0x7'));var attributes=require(_0x1303('0x8'));module[_0x1303('0x9')]=function(_0x56b097,_0x5a8d23){return _0x56b097[_0x1303('0xa')](_0x1303('0xb'),attributes,{'tableName':_0x1303('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c4a9b9d..7bd2e94 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 _0xd4e9=['lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message'];(function(_0x4ec2ef,_0x252d7c){var _0x1bd414=function(_0x1302f5){while(--_0x1302f5){_0x4ec2ef['push'](_0x4ec2ef['shift']());}};_0x1bd414(++_0x252d7c);}(_0xd4e9,0x1cc));var _0x9d4e=function(_0x2f91d3,_0x4314c7){_0x2f91d3=_0x2f91d3-0x0;var _0x3adc77=_0xd4e9[_0x2f91d3];return _0x3adc77;};'use strict';var _=require(_0x9d4e('0x0'));var util=require(_0x9d4e('0x1'));var moment=require(_0x9d4e('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d4e('0x3'));var fs=require('fs');var Redis=require(_0x9d4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9d4e('0x5'));var config=require(_0x9d4e('0x6'));var jayson=require(_0x9d4e('0x7'));var client=jayson[_0x9d4e('0x8')][_0x9d4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x458843,_0x305e17,_0x10d6f5){return new BPromise(function(_0x1e7e09,_0x3c07df){return client[_0x9d4e('0xa')](_0x458843,_0x10d6f5)[_0x9d4e('0xb')](function(_0x371ef0){logger[_0x9d4e('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x305e17,_0x9d4e('0xd'));logger[_0x9d4e('0xe')](_0x9d4e('0xf'),_0x305e17,_0x9d4e('0xd'),JSON['stringify'](_0x371ef0));if(_0x371ef0[_0x9d4e('0x10')]){if(_0x371ef0[_0x9d4e('0x10')][_0x9d4e('0x11')]===0x1f4){logger[_0x9d4e('0x10')](_0x9d4e('0x12'),_0x305e17,_0x371ef0[_0x9d4e('0x10')][_0x9d4e('0x13')]);return _0x3c07df(_0x371ef0[_0x9d4e('0x10')][_0x9d4e('0x13')]);}logger['error'](_0x9d4e('0x12'),_0x305e17,_0x371ef0[_0x9d4e('0x10')][_0x9d4e('0x13')]);return _0x1e7e09(_0x371ef0[_0x9d4e('0x10')]['message']);}else{logger[_0x9d4e('0xc')](_0x9d4e('0x12'),_0x305e17,_0x9d4e('0xd'));_0x1e7e09(_0x371ef0['result'][_0x9d4e('0x13')]);}})['catch'](function(_0x3db5d1){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x305e17,_0x3db5d1);_0x3c07df(_0x3db5d1);});});} \ No newline at end of file +var _0x6fb9=['http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x24b05d,_0x317f78){var _0x3de229=function(_0x46e643){while(--_0x46e643){_0x24b05d['push'](_0x24b05d['shift']());}};_0x3de229(++_0x317f78);}(_0x6fb9,0x116));var _0x96fb=function(_0x11cbb5,_0x390441){_0x11cbb5=_0x11cbb5-0x0;var _0x54b8d3=_0x6fb9[_0x11cbb5];return _0x54b8d3;};'use strict';var _=require(_0x96fb('0x0'));var util=require(_0x96fb('0x1'));var moment=require(_0x96fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x96fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96fb('0x5'))(_0x96fb('0x6'));var config=require(_0x96fb('0x7'));var jayson=require(_0x96fb('0x8'));var client=jayson[_0x96fb('0x9')][_0x96fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21acc3,_0x4aa7b5,_0x2b8d3a){return new BPromise(function(_0x242ba5,_0x108f8d){return client[_0x96fb('0xb')](_0x21acc3,_0x2b8d3a)[_0x96fb('0xc')](function(_0xb6dfe6){logger[_0x96fb('0xd')](_0x96fb('0xe'),_0x4aa7b5,_0x96fb('0xf'));logger[_0x96fb('0x10')](_0x96fb('0x11'),_0x4aa7b5,_0x96fb('0xf'),JSON[_0x96fb('0x12')](_0xb6dfe6));if(_0xb6dfe6[_0x96fb('0x13')]){if(_0xb6dfe6[_0x96fb('0x13')][_0x96fb('0x14')]===0x1f4){logger[_0x96fb('0x13')](_0x96fb('0xe'),_0x4aa7b5,_0xb6dfe6['error'][_0x96fb('0x15')]);return _0x108f8d(_0xb6dfe6[_0x96fb('0x13')]['message']);}logger[_0x96fb('0x13')](_0x96fb('0xe'),_0x4aa7b5,_0xb6dfe6[_0x96fb('0x13')]['message']);return _0x242ba5(_0xb6dfe6[_0x96fb('0x13')][_0x96fb('0x15')]);}else{logger[_0x96fb('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4aa7b5,_0x96fb('0xf'));_0x242ba5(_0xb6dfe6[_0x96fb('0x16')]['message']);}})[_0x96fb('0x17')](function(_0x54aaee){logger[_0x96fb('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4aa7b5,_0x54aaee);_0x108f8d(_0x54aaee);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 610185f..7757de3 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 _0x0a78=['index','get','show','getSessions','getAnswers','/:id/summary','30s','create','post','/:id/clone','clone','put','/:id','update','delete','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5f1e89,_0x5e3aaa){var _0x14b415=function(_0x5c2e0){while(--_0x5c2e0){_0x5f1e89['push'](_0x5f1e89['shift']());}};_0x14b415(++_0x5e3aaa);}(_0x0a78,0x151));var _0x80a7=function(_0x57025c,_0x3b7d85){_0x57025c=_0x57025c-0x0;var _0x2c9145=_0x0a78[_0x57025c];return _0x2c9145;};'use strict';var multer=require(_0x80a7('0x0'));var util=require('util');var path=require(_0x80a7('0x1'));var timeout=require(_0x80a7('0x2'));var express=require(_0x80a7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x80a7('0x4'));var interaction=require(_0x80a7('0x5'));var config=require(_0x80a7('0x6'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x80a7('0x7')](),controller[_0x80a7('0x8')]);router[_0x80a7('0x9')]('/:id',auth[_0x80a7('0x7')](),controller[_0x80a7('0xa')]);router[_0x80a7('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x80a7('0xb')]);router[_0x80a7('0x9')]('/:id/answers',auth[_0x80a7('0x7')](),controller[_0x80a7('0xc')]);router[_0x80a7('0x9')](_0x80a7('0xd'),auth['isAuthenticated'](),timeout(_0x80a7('0xe')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller[_0x80a7('0xf')]);router[_0x80a7('0x10')](_0x80a7('0x11'),auth[_0x80a7('0x7')](),controller[_0x80a7('0x12')]);router[_0x80a7('0x13')](_0x80a7('0x14'),auth[_0x80a7('0x7')](),controller[_0x80a7('0x15')]);router[_0x80a7('0x16')](_0x80a7('0x14'),auth[_0x80a7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x407f=['exports','multer','util','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','put','/:id','update','delete'];(function(_0x4df317,_0xa7fc57){var _0x160910=function(_0x2c906d){while(--_0x2c906d){_0x4df317['push'](_0x4df317['shift']());}};_0x160910(++_0xa7fc57);}(_0x407f,0xd9));var _0xf407=function(_0x9dd7c4,_0x188c58){_0x9dd7c4=_0x9dd7c4-0x0;var _0x5cf9f8=_0x407f[_0x9dd7c4];return _0x5cf9f8;};'use strict';var multer=require(_0xf407('0x0'));var util=require(_0xf407('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf407('0x2')]();var fs_extra=require(_0xf407('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf407('0x4'));var controller=require(_0xf407('0x5'));router[_0xf407('0x6')]('/',auth[_0xf407('0x7')](),controller[_0xf407('0x8')]);router[_0xf407('0x6')]('/:id',auth[_0xf407('0x7')](),controller[_0xf407('0x9')]);router['get'](_0xf407('0xa'),auth[_0xf407('0x7')](),controller[_0xf407('0xb')]);router[_0xf407('0x6')](_0xf407('0xc'),auth[_0xf407('0x7')](),controller[_0xf407('0xd')]);router[_0xf407('0x6')](_0xf407('0xe'),auth[_0xf407('0x7')](),timeout(_0xf407('0xf')),controller[_0xf407('0x10')]);router[_0xf407('0x11')]('/',auth[_0xf407('0x7')](),controller[_0xf407('0x12')]);router['post']('/:id/clone',auth[_0xf407('0x7')](),controller['clone']);router[_0xf407('0x13')](_0xf407('0x14'),auth[_0xf407('0x7')](),controller[_0xf407('0x15')]);router[_0xf407('0x16')](_0xf407('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xf407('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b41182b..b16fb65 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 _0x6d3c=['TEXT','long','isObjectLike','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','STRING'];(function(_0x1d5446,_0x56d098){var _0x10e81d=function(_0x1c83b3){while(--_0x1c83b3){_0x1d5446['push'](_0x1d5446['shift']());}};_0x10e81d(++_0x56d098);}(_0x6d3c,0x190));var _0xc6d3=function(_0x5c3dc8,_0x3202a9){_0x5c3dc8=_0x5c3dc8-0x0;var _0x2dd20e=_0x6d3c[_0x5c3dc8];return _0x2dd20e;};'use strict';var Sequelize=require(_0xc6d3('0x0'));var _=require('lodash');var util=require(_0xc6d3('0x1'));module['exports']={'name':{'type':Sequelize[_0xc6d3('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xc6d3('0x2')]},'formData':{'type':Sequelize[_0xc6d3('0x3')](_0xc6d3('0x4')),'set':function(_0x15b01b){if(_[_0xc6d3('0x5')](_0x15b01b)){this['setDataValue'](_0xc6d3('0x6'),JSON['stringify'](_0x15b01b));}else if(_[_0xc6d3('0x7')](_0x15b01b)){this[_0xc6d3('0x8')](_0xc6d3('0x6'),_0x15b01b);}else{this['setDataValue']('formData',util[_0xc6d3('0x9')](_0xc6d3('0xa'),this['getDataValue']('name')||'',this[_0xc6d3('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc6d3('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc6d3('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xbdf3=['STRING','TEXT','long','setDataValue','formData','stringify','format','description','BOOLEAN','lodash','util','exports','name'];(function(_0x4a0f60,_0x298c30){var _0x59b579=function(_0x28e479){while(--_0x28e479){_0x4a0f60['push'](_0x4a0f60['shift']());}};_0x59b579(++_0x298c30);}(_0xbdf3,0xf3));var _0x3bdf=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xbdf3[_0x13ac10];return _0x28eda2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3bdf('0x0'));var util=require(_0x3bdf('0x1'));module[_0x3bdf('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3bdf('0x3')},'description':{'type':Sequelize[_0x3bdf('0x4')]},'formData':{'type':Sequelize[_0x3bdf('0x5')](_0x3bdf('0x6')),'set':function(_0x5f020d){if(_['isObjectLike'](_0x5f020d)){this[_0x3bdf('0x7')](_0x3bdf('0x8'),JSON[_0x3bdf('0x9')](_0x5f020d));}else if(_['isString'](_0x5f020d)){this['setDataValue'](_0x3bdf('0x8'),_0x5f020d);}else{this[_0x3bdf('0x7')](_0x3bdf('0x8'),util[_0x3bdf('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x3bdf('0x3'))||'',this['getDataValue'](_0x3bdf('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3bdf('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3bdf('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 5401d6e..4dcde7c 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 _0xc931=['rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getSessions','findOne','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','startTime','starttime','parse','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc931,0x19c));var _0x1c93=function(_0x44357a,_0x5732e7){_0x44357a=_0x44357a-0x0;var _0x2bd627=_0xc931[_0x44357a];return _0x2bd627;};'use strict';var emlformat=require(_0x1c93('0x0'));var rimraf=require(_0x1c93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c93('0x2'));var rp=require(_0x1c93('0x3'));var moment=require(_0x1c93('0x4'));var BPromise=require(_0x1c93('0x5'));var Mustache=require(_0x1c93('0x6'));var util=require(_0x1c93('0x7'));var path=require(_0x1c93('0x8'));var sox=require(_0x1c93('0x9'));var csv=require(_0x1c93('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c93('0xb'));var _=require(_0x1c93('0xc'));var squel=require(_0x1c93('0xd'));var crypto=require('crypto');var jsforce=require(_0x1c93('0xe'));var deskjs=require(_0x1c93('0xf'));var toCsv=require(_0x1c93('0xa'));var querystring=require(_0x1c93('0x10'));var Papa=require(_0x1c93('0x11'));var Redis=require(_0x1c93('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1c93('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1c93('0x14'));var config=require(_0x1c93('0x15'));var licenseUtil=require(_0x1c93('0x16'));var db=require(_0x1c93('0x17'))['db'];function respondWithStatusCode(_0x5e32f6,_0xf1627){_0xf1627=_0xf1627||0xcc;return function(_0x17c1e5){if(_0x17c1e5){return _0x5e32f6[_0x1c93('0x18')](_0xf1627);}return _0x5e32f6['status'](_0xf1627)[_0x1c93('0x19')]();};}function respondWithResult(_0x348304,_0x3e9baa){_0x3e9baa=_0x3e9baa||0xc8;return function(_0x3ed773){if(_0x3ed773){return _0x348304[_0x1c93('0x1a')](_0x3e9baa)[_0x1c93('0x1b')](_0x3ed773);}};}function respondWithFilteredResult(_0x16063d,_0x5be810){return function(_0x5b6da3){if(_0x5b6da3){var _0x2f6f2c=typeof _0x5be810[_0x1c93('0x1c')]===_0x1c93('0x1d')&&typeof _0x5be810[_0x1c93('0x1e')]==='undefined';var _0x47907c=_0x5b6da3[_0x1c93('0x1f')];var _0x185286=_0x2f6f2c?0x0:_0x5be810[_0x1c93('0x1c')];var _0x173af4=_0x2f6f2c?_0x5b6da3[_0x1c93('0x1f')]:_0x5be810[_0x1c93('0x1c')]+_0x5be810['limit'];var _0x5baf98;if(_0x173af4>=_0x47907c){_0x173af4=_0x47907c;_0x5baf98=0xc8;}else{_0x5baf98=0xce;}_0x16063d['status'](_0x5baf98);return _0x16063d['set'](_0x1c93('0x20'),_0x185286+'-'+_0x173af4+'/'+_0x47907c)[_0x1c93('0x1b')](_0x5b6da3);}return null;};}function patchUpdates(_0x1bddf9){return function(_0x43f789){try{jsonpatch[_0x1c93('0x21')](_0x43f789,_0x1bddf9,!![]);}catch(_0x2343c3){return BPromise[_0x1c93('0x22')](_0x2343c3);}return _0x43f789[_0x1c93('0x23')]();};}function saveUpdates(_0x14b99b,_0x26c4b2){return function(_0x41db55){if(_0x41db55){return _0x41db55[_0x1c93('0x24')](_0x14b99b)[_0x1c93('0x25')](function(_0x114a1f){return _0x114a1f;});}return null;};}function removeEntity(_0x3a4f57,_0x4bfa0b){return function(_0x41f807){if(_0x41f807){return _0x41f807[_0x1c93('0x26')]()['then'](function(){var _0x18f1ce=_0x41f807[_0x1c93('0x27')]({'plain':!![]});var _0x331885=_0x1c93('0x28');return db[_0x1c93('0x29')][_0x1c93('0x26')]({'where':{'type':_0x331885,'resourceId':_0x18f1ce['id']}})[_0x1c93('0x25')](function(){return _0x41f807;});})[_0x1c93('0x25')](function(){_0x3a4f57[_0x1c93('0x1a')](0xcc)[_0x1c93('0x19')]();});}};}function handleEntityNotFound(_0x58bf08,_0x252ac2){return function(_0x5ca28a){if(!_0x5ca28a){_0x58bf08[_0x1c93('0x18')](0x194);}return _0x5ca28a;};}function handleError(_0x125496,_0x2483f2){_0x2483f2=_0x2483f2||0x1f4;return function(_0x32e0b4){logger[_0x1c93('0x2a')](_0x32e0b4[_0x1c93('0x2b')]);if(_0x32e0b4[_0x1c93('0x2c')]){delete _0x32e0b4['name'];}_0x125496['status'](_0x2483f2)[_0x1c93('0x2d')](_0x32e0b4);};}exports[_0x1c93('0x2e')]=function(_0xb04747,_0x75c42d){var _0x14577e={},_0x400288={},_0x24f573={'count':0x0,'rows':[]};var _0x44f1ad=_['map'](db[_0x1c93('0x2f')][_0x1c93('0x30')],function(_0x49228e){return{'name':_0x49228e[_0x1c93('0x31')],'type':_0x49228e[_0x1c93('0x32')][_0x1c93('0x33')]};});_0x400288['model']=_[_0x1c93('0x34')](_0x44f1ad,_0x1c93('0x2c'));_0x400288[_0x1c93('0x35')]=_[_0x1c93('0x36')](_0xb04747[_0x1c93('0x35')]);_0x400288[_0x1c93('0x37')]=_[_0x1c93('0x38')](_0x400288[_0x1c93('0x39')],_0x400288[_0x1c93('0x35')]);_0x14577e['attributes']=_[_0x1c93('0x38')](_0x400288[_0x1c93('0x39')],qs[_0x1c93('0x3a')](_0xb04747[_0x1c93('0x35')][_0x1c93('0x3a')]));_0x14577e['attributes']=_0x14577e['attributes'][_0x1c93('0x3b')]?_0x14577e[_0x1c93('0x3c')]:_0x400288['model'];if(!_0xb04747[_0x1c93('0x35')][_0x1c93('0x3d')](_0x1c93('0x3e'))){_0x14577e[_0x1c93('0x1e')]=qs[_0x1c93('0x1e')](_0xb04747[_0x1c93('0x35')][_0x1c93('0x1e')]);_0x14577e[_0x1c93('0x1c')]=qs[_0x1c93('0x1c')](_0xb04747['query'][_0x1c93('0x1c')]);}_0x14577e['order']=qs[_0x1c93('0x3f')](_0xb04747[_0x1c93('0x35')]['sort']);_0x14577e[_0x1c93('0x40')]=qs[_0x1c93('0x37')](_[_0x1c93('0x41')](_0xb04747[_0x1c93('0x35')],_0x400288[_0x1c93('0x37')]),_0x44f1ad);if(_0xb04747[_0x1c93('0x35')][_0x1c93('0x42')]){_0x14577e[_0x1c93('0x40')]=_[_0x1c93('0x43')](_0x14577e[_0x1c93('0x40')],{'$or':_[_0x1c93('0x34')](_0x44f1ad,function(_0x3d80d9){if(_0x3d80d9[_0x1c93('0x32')]!=='VIRTUAL'){var _0x2bc381={};_0x2bc381[_0x3d80d9['name']]={'$like':'%'+_0xb04747[_0x1c93('0x35')][_0x1c93('0x42')]+'%'};return _0x2bc381;}})});}_0x14577e=_[_0x1c93('0x43')]({},_0x14577e,_0xb04747[_0x1c93('0x44')]);var _0x1c2f1e={'where':_0x14577e[_0x1c93('0x40')]};return db[_0x1c93('0x2f')][_0x1c93('0x1f')](_0x1c2f1e)[_0x1c93('0x25')](function(_0x1b3344){_0x24f573[_0x1c93('0x1f')]=_0x1b3344;if(_0xb04747[_0x1c93('0x35')][_0x1c93('0x45')]){_0x14577e[_0x1c93('0x46')]=[{'all':!![]}];}return db[_0x1c93('0x2f')][_0x1c93('0x47')](_0x14577e);})[_0x1c93('0x25')](function(_0x3ceb51){_0x24f573[_0x1c93('0x48')]=_0x3ceb51;return _0x24f573;})[_0x1c93('0x25')](respondWithFilteredResult(_0x75c42d,_0x14577e))[_0x1c93('0x49')](handleError(_0x75c42d,null));};exports[_0x1c93('0x4a')]=function(_0x50e242,_0x13ccd2){var _0x3e772c={'raw':![],'where':{'id':_0x50e242[_0x1c93('0x4b')]['id']}},_0x25fa62={};_0x25fa62[_0x1c93('0x39')]=_[_0x1c93('0x36')](db[_0x1c93('0x2f')][_0x1c93('0x30')]);_0x25fa62[_0x1c93('0x35')]=_[_0x1c93('0x36')](_0x50e242['query']);_0x25fa62[_0x1c93('0x37')]=_[_0x1c93('0x38')](_0x25fa62[_0x1c93('0x39')],_0x25fa62['query']);_0x3e772c[_0x1c93('0x3c')]=_[_0x1c93('0x38')](_0x25fa62[_0x1c93('0x39')],qs[_0x1c93('0x3a')](_0x50e242['query']['fields']));_0x3e772c[_0x1c93('0x3c')]=_0x3e772c[_0x1c93('0x3c')]['length']?_0x3e772c[_0x1c93('0x3c')]:_0x25fa62[_0x1c93('0x39')];if(_0x50e242[_0x1c93('0x35')][_0x1c93('0x45')]){_0x3e772c[_0x1c93('0x46')]=[{'all':!![]}];}_0x3e772c=_[_0x1c93('0x43')]({},_0x3e772c,_0x50e242[_0x1c93('0x44')]);return db[_0x1c93('0x2f')][_0x1c93('0x4c')](_0x3e772c)[_0x1c93('0x25')](handleEntityNotFound(_0x13ccd2,null))[_0x1c93('0x25')](respondWithResult(_0x13ccd2,null))['catch'](handleError(_0x13ccd2,null));};exports[_0x1c93('0x4d')]=function(_0x17a960,_0x3d30ec){return db[_0x1c93('0x2f')][_0x1c93('0x4d')](_0x17a960['body'],{})[_0x1c93('0x25')](function(_0x3bf257){var _0x1acc32=_0x17a960[_0x1c93('0x4e')]['get']({'plain':!![]});if(!_0x1acc32)throw new Error(_0x1c93('0x4f'));if(_0x1acc32[_0x1c93('0x50')]===_0x1c93('0x4e')){var _0x1588bf=_0x3bf257['get']({'plain':!![]});var _0x333a41=_0x1c93('0x28');return db[_0x1c93('0x51')][_0x1c93('0x4c')]({'where':{'name':_0x333a41,'userProfileId':_0x1acc32['userProfileId']},'raw':!![]})[_0x1c93('0x25')](function(_0x31a129){if(_0x31a129&&_0x31a129[_0x1c93('0x52')]===0x0){return db[_0x1c93('0x29')][_0x1c93('0x4d')]({'name':_0x1588bf[_0x1c93('0x2c')],'resourceId':_0x1588bf['id'],'type':_0x31a129[_0x1c93('0x2c')],'sectionId':_0x31a129['id']},{})[_0x1c93('0x25')](function(){return _0x3bf257;});}else{return _0x3bf257;}})[_0x1c93('0x49')](function(_0x476247){logger[_0x1c93('0x2a')](_0x1c93('0x53'),_0x476247);throw _0x476247;});}return _0x3bf257;})['then'](respondWithResult(_0x3d30ec,0xc9))['catch'](handleError(_0x3d30ec,null));};exports[_0x1c93('0x54')]=function(_0x36a138,_0x383e5a){var _0xb8fe10={'where':{'id':_0x36a138[_0x1c93('0x4b')]['id']}},_0x480b18={};_0x480b18['model']=_['keys'](db[_0x1c93('0x2f')][_0x1c93('0x30')]);_0xb8fe10[_0x1c93('0x3c')]=_[_0x1c93('0x38')](_0x480b18['model'],qs[_0x1c93('0x3a')](_0x36a138[_0x1c93('0x35')]['fields']));_0xb8fe10[_0x1c93('0x3c')]=_0xb8fe10['attributes'][_0x1c93('0x3b')]?_0xb8fe10['attributes']:_0x480b18[_0x1c93('0x39')];if(_0x36a138[_0x1c93('0x35')][_0x1c93('0x45')]){_0xb8fe10[_0x1c93('0x46')]=[{'all':!![]}];}_0xb8fe10=_[_0x1c93('0x43')]({},_0xb8fe10,_0x36a138[_0x1c93('0x44')]);return db[_0x1c93('0x2f')][_0x1c93('0x4c')](_0xb8fe10)[_0x1c93('0x25')](handleEntityNotFound(_0x383e5a,null))[_0x1c93('0x25')](function(_0x5e45cd){if(_0x5e45cd){var _0x343b75=_0x5e45cd[_0x1c93('0x27')]({'plain':!![]});_0x343b75=qs[_0x1c93('0x55')](_0x343b75,['id',_0x1c93('0x56'),_0x1c93('0x57')]);_0x36a138[_0x1c93('0x58')]=_[_0x1c93('0x55')](_0x36a138[_0x1c93('0x58')],['id',_0x1c93('0x56'),_0x1c93('0x57')]);return db[_0x1c93('0x2f')]['create'](_[_0x1c93('0x43')](_0x343b75,_0x36a138[_0x1c93('0x58')]),{'include':_0x36a138['query'][_0x1c93('0x45')]?[{'all':!![]}]:undefined})[_0x1c93('0x25')](function(_0x5b7d59){var _0x257cef=_0x36a138[_0x1c93('0x4e')][_0x1c93('0x27')]({'plain':!![]});if(!_0x257cef)throw new Error(_0x1c93('0x4f'));if(_0x257cef['role']===_0x1c93('0x4e')){var _0x4b8b8e=_0x5b7d59[_0x1c93('0x27')]({'plain':!![]});var _0x5d9b2e=_0x1c93('0x28');return db[_0x1c93('0x51')][_0x1c93('0x4c')]({'where':{'name':_0x5d9b2e,'userProfileId':_0x257cef['userProfileId']},'raw':!![]})[_0x1c93('0x25')](function(_0x3cdd49){if(_0x3cdd49&&_0x3cdd49[_0x1c93('0x52')]===0x0){return db[_0x1c93('0x29')][_0x1c93('0x4d')]({'name':_0x4b8b8e[_0x1c93('0x2c')],'resourceId':_0x4b8b8e['id'],'type':_0x3cdd49['name'],'sectionId':_0x3cdd49['id']},{})[_0x1c93('0x25')](function(){return _0x5b7d59;});}else{return _0x5b7d59;}})[_0x1c93('0x49')](function(_0x136eee){logger[_0x1c93('0x2a')](_0x1c93('0x53'),_0x136eee);throw _0x136eee;});}return _0x5b7d59;});}})[_0x1c93('0x25')](respondWithResult(_0x383e5a,0xc9))[_0x1c93('0x49')](handleError(_0x383e5a,null));};exports[_0x1c93('0x24')]=function(_0x553333,_0x36c393){if(_0x553333[_0x1c93('0x58')]['id']){delete _0x553333[_0x1c93('0x58')]['id'];}return db['JscriptyProject'][_0x1c93('0x4c')]({'where':{'id':_0x553333['params']['id']}})[_0x1c93('0x25')](handleEntityNotFound(_0x36c393,null))[_0x1c93('0x25')](saveUpdates(_0x553333[_0x1c93('0x58')],null))[_0x1c93('0x25')](respondWithResult(_0x36c393,null))[_0x1c93('0x49')](handleError(_0x36c393,null));};exports[_0x1c93('0x26')]=function(_0x72f8e5,_0x5375b1){return db[_0x1c93('0x2f')][_0x1c93('0x4c')]({'where':{'id':_0x72f8e5[_0x1c93('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5375b1,null))['then'](removeEntity(_0x5375b1,null))[_0x1c93('0x49')](handleError(_0x5375b1,null));};exports[_0x1c93('0x59')]=function(_0x10efe3,_0x2205ba,_0x4099f6){var _0x54f89a={'raw':!![],'where':{}};var _0x20707c={};var _0x39035d={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x1c93('0x5a')]({'where':{'id':_0x10efe3[_0x1c93('0x4b')]['id']}})[_0x1c93('0x25')](handleEntityNotFound(_0x2205ba,null))[_0x1c93('0x25')](function(_0x14e532){if(_0x14e532){_0x20707c[_0x1c93('0x39')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x20707c[_0x1c93('0x35')]=_[_0x1c93('0x36')](_0x10efe3[_0x1c93('0x35')]);_0x20707c['filters']=_[_0x1c93('0x38')](_0x20707c['model'],_0x20707c[_0x1c93('0x35')]);_0x54f89a[_0x1c93('0x3c')]=_[_0x1c93('0x38')](_0x20707c[_0x1c93('0x39')],qs[_0x1c93('0x3a')](_0x10efe3['query'][_0x1c93('0x3a')]));_0x54f89a[_0x1c93('0x3c')]=_0x54f89a[_0x1c93('0x3c')][_0x1c93('0x3b')]?_0x54f89a['attributes']:_0x20707c['model'];if(!_0x10efe3[_0x1c93('0x35')][_0x1c93('0x3d')](_0x1c93('0x3e'))){_0x54f89a['limit']=qs[_0x1c93('0x1e')](_0x10efe3[_0x1c93('0x35')][_0x1c93('0x1e')]);_0x54f89a['offset']=qs[_0x1c93('0x1c')](_0x10efe3[_0x1c93('0x35')][_0x1c93('0x1c')]);}_0x54f89a[_0x1c93('0x5b')]=qs[_0x1c93('0x3f')](_0x10efe3[_0x1c93('0x35')][_0x1c93('0x3f')]);_0x54f89a[_0x1c93('0x40')]=qs[_0x1c93('0x37')](_['pick'](_0x10efe3[_0x1c93('0x35')],_0x20707c[_0x1c93('0x37')]));_0x54f89a['where'][_0x1c93('0x5c')]=_0x14e532['id'];if(_0x10efe3['query'][_0x1c93('0x42')]){_0x54f89a[_0x1c93('0x40')]=_[_0x1c93('0x43')](_0x54f89a[_0x1c93('0x40')],{'$or':_[_0x1c93('0x34')](_0x54f89a[_0x1c93('0x3c')],function(_0x47c092){var _0x39800c={};_0x39800c[_0x47c092]={'$like':'%'+_0x10efe3[_0x1c93('0x35')]['filter']+'%'};return _0x39800c;})});}_0x54f89a=_[_0x1c93('0x43')]({},_0x54f89a,_0x10efe3[_0x1c93('0x44')]);return db[_0x1c93('0x5d')][_0x1c93('0x1f')]({'where':_0x54f89a['where']})[_0x1c93('0x25')](function(_0x3d92a7){_0x39035d[_0x1c93('0x1f')]=_0x3d92a7;if(_0x10efe3[_0x1c93('0x35')][_0x1c93('0x45')]){_0x54f89a[_0x1c93('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1c93('0x47')](_0x54f89a);})[_0x1c93('0x25')](function(_0x5f521e){_0x39035d[_0x1c93('0x48')]=_0x5f521e;return _0x39035d;});}})[_0x1c93('0x25')](respondWithFilteredResult(_0x2205ba,_0x54f89a))[_0x1c93('0x49')](handleError(_0x2205ba,null));};exports[_0x1c93('0x5e')]=function(_0x4a863e,_0x1092f6,_0x1e4516){var _0x1b3097={'raw':!![],'where':{}};var _0x36987b={};var _0x1557a0={'count':0x0,'rows':[]};return db[_0x1c93('0x2f')][_0x1c93('0x5a')]({'where':{'id':_0x4a863e[_0x1c93('0x4b')]['id']}})[_0x1c93('0x25')](handleEntityNotFound(_0x1092f6,null))[_0x1c93('0x25')](function(_0x468f69){if(_0x468f69){_0x36987b[_0x1c93('0x39')]=_[_0x1c93('0x36')](db[_0x1c93('0x5f')][_0x1c93('0x30')]);_0x36987b[_0x1c93('0x35')]=_[_0x1c93('0x36')](_0x4a863e['query']);_0x36987b[_0x1c93('0x37')]=_[_0x1c93('0x38')](_0x36987b['model'],_0x36987b[_0x1c93('0x35')]);_0x1b3097[_0x1c93('0x3c')]=_[_0x1c93('0x38')](_0x36987b[_0x1c93('0x39')],qs['fields'](_0x4a863e['query'][_0x1c93('0x3a')]));_0x1b3097['attributes']=_0x1b3097[_0x1c93('0x3c')]['length']?_0x1b3097['attributes']:_0x36987b['model'];if(!_0x4a863e['query'][_0x1c93('0x3d')](_0x1c93('0x3e'))){_0x1b3097[_0x1c93('0x1e')]=qs[_0x1c93('0x1e')](_0x4a863e['query'][_0x1c93('0x1e')]);_0x1b3097['offset']=qs[_0x1c93('0x1c')](_0x4a863e[_0x1c93('0x35')][_0x1c93('0x1c')]);}_0x1b3097[_0x1c93('0x5b')]=qs[_0x1c93('0x3f')](_0x4a863e['query'][_0x1c93('0x3f')]);_0x1b3097['where']=qs['filters'](_[_0x1c93('0x41')](_0x4a863e[_0x1c93('0x35')],_0x36987b[_0x1c93('0x37')]));_0x1b3097[_0x1c93('0x40')][_0x1c93('0x5c')]=_0x468f69['id'];if(_0x4a863e[_0x1c93('0x35')][_0x1c93('0x42')]){_0x1b3097['where']=_[_0x1c93('0x43')](_0x1b3097[_0x1c93('0x40')],{'$or':_[_0x1c93('0x34')](_0x1b3097[_0x1c93('0x3c')],function(_0x3d57f2){var _0x17ba08={};_0x17ba08[_0x3d57f2]={'$like':'%'+_0x4a863e[_0x1c93('0x35')][_0x1c93('0x42')]+'%'};return _0x17ba08;})});}_0x1b3097=_['merge']({},_0x1b3097,_0x4a863e[_0x1c93('0x44')]);return db[_0x1c93('0x5f')]['count']({'where':_0x1b3097[_0x1c93('0x40')]})['then'](function(_0x2e8c55){_0x1557a0[_0x1c93('0x1f')]=_0x2e8c55;if(_0x4a863e[_0x1c93('0x35')][_0x1c93('0x45')]){_0x1b3097[_0x1c93('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x1b3097);})[_0x1c93('0x25')](function(_0x4f2f8e){_0x1557a0[_0x1c93('0x48')]=_0x4f2f8e;return _0x1557a0;});}})[_0x1c93('0x25')](respondWithFilteredResult(_0x1092f6,_0x1b3097))[_0x1c93('0x49')](handleError(_0x1092f6,null));};function char(_0x4e85e0){return _0x1c93('0x60')===typeof _0x4e85e0?String['fromCharCode'][_0x1c93('0x21')](null,arguments):_0x4e85e0;}function needsEncapsulation(_0x6095b8){return!!_0x6095b8&&(_0x6095b8[_0x1c93('0x61')]()[_0x1c93('0x62')](char(0xd))>=0x0||_0x6095b8[_0x1c93('0x61')]()[_0x1c93('0x62')](char(0xa))>=0x0||_0x6095b8['toString']()['indexOf'](char(0x2c))>=0x0||_0x6095b8[_0x1c93('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xee1fe1){var _0x389010=char(0x22),_0x465827='\x5c'+char(0x22),_0x58db39=_0xee1fe1[_0x1c93('0x61')]()[_0x1c93('0x63')](new RegExp(_0x389010,'g'),_0x465827);return _0x389010+_0x58db39+_0x389010;}exports['getSummary']=function(_0x21e2ad,_0x41eddd,_0x3dbd55){var _0x563d1e,_0xe8c5d6;var _0x16af50={'where':{'ProjectId':_0x21e2ad[_0x1c93('0x4b')]['id']}};if(_0x21e2ad[_0x1c93('0x35')][_0x1c93('0x64')]){_0x16af50[_0x1c93('0x40')][_0x1c93('0x65')]=JSON[_0x1c93('0x66')](_0x21e2ad[_0x1c93('0x35')][_0x1c93('0x64')]);}return db[_0x1c93('0x5d')][_0x1c93('0x47')](_0x16af50)['then'](handleEntityNotFound(_0x41eddd,null))[_0x1c93('0x25')](function(_0x2584c9){if(_0x2584c9){_0x563d1e=_0x2584c9;return db['JscriptyQuestionReport'][_0x1c93('0x47')]({'where':{'SessionId':{'$in':_[_0x1c93('0x34')](_0x563d1e,'id')},'ProjectId':_0x21e2ad[_0x1c93('0x4b')]['id']},'order':'-createdAt'});}})[_0x1c93('0x25')](handleEntityNotFound(_0x41eddd,null))['then'](function(_0x18997b){if(_0x18997b){_0xe8c5d6=_0x18997b;var _0x33a719={};for(var _0x1d5e21=0x0,_0x2ba516=_0xe8c5d6[_0x1c93('0x3b')];_0x1d5e21<_0x2ba516;_0x1d5e21++){if(!_0x33a719[_0x1c93('0x3d')](_0xe8c5d6[_0x1d5e21]['questionId'])){_0x33a719[_0xe8c5d6[_0x1d5e21][_0x1c93('0x67')]]=needsEncapsulation(_0xe8c5d6[_0x1d5e21][_0x1c93('0x68')])?encapsulate(_0xe8c5d6[_0x1d5e21]['question']):_0xe8c5d6[_0x1d5e21][_0x1c93('0x68')];}}var _0x381f77=[],_0x369f1c={};for(var _0x319a59=0x0,_0x58442e=_0x563d1e[_0x1c93('0x3b')];_0x319a59<_0x58442e;_0x319a59++){_0x369f1c={'ProjectId':_0x21e2ad[_0x1c93('0x4b')]['id'],'SessionId':_0x563d1e[_0x319a59]['id'],'StartTime':moment(_0x563d1e[_0x319a59][_0x1c93('0x65')])[_0x1c93('0x69')](_0x1c93('0x6a'))};for(var _0x29a31d=0x0,_0x4d96af=_0xe8c5d6['length'];_0x29a31d<_0x4d96af;_0x29a31d++){if(_0xe8c5d6[_0x29a31d][_0x1c93('0x6b')]==_0x563d1e[_0x319a59]['id']&&_0x33a719[_0x1c93('0x3d')](_0xe8c5d6[_0x29a31d]['questionId'])){_0x369f1c[_0x33a719[_0xe8c5d6[_0x29a31d][_0x1c93('0x67')]]]=_0xe8c5d6[_0x29a31d][_0x1c93('0x6c')];}}for(var _0x1639ea in _0x33a719){if(!_0x369f1c['hasOwnProperty'](_0x33a719[_0x1639ea])){_0x369f1c[_0x33a719[_0x1639ea]]=null;}}_0x381f77[_0x1c93('0x6d')](_0x369f1c);}return _0x381f77;}})[_0x1c93('0x25')](function(_0xd61d67){if(!_[_0x1c93('0x6e')](_0xd61d67)){var _0x4eda0a=toCsv(_0xd61d67);var _0x1bb735=Date[_0x1c93('0x6f')]();fs[_0x1c93('0x70')](util[_0x1c93('0x69')](_0x1c93('0x71'),_0x21e2ad['params']['id'],_0x1bb735),_0x4eda0a);_0x41eddd[_0x1c93('0x72')](_0x1c93('0x73'),_0x1c93('0x74')+util[_0x1c93('0x69')](_0x1c93('0x75'),_0x21e2ad[_0x1c93('0x4b')]['id'],_0x1bb735));_0x41eddd[_0x1c93('0x72')](_0x1c93('0x76'),_0x1c93('0x77'));return _0x41eddd[_0x1c93('0x78')](util['format'](_0x1c93('0x71'),_0x21e2ad[_0x1c93('0x4b')]['id'],_0x1bb735));}else{return _0x41eddd[_0x1c93('0x18')](0xcc);}})[_0x1c93('0x49')](handleError(_0x41eddd,null));}; \ No newline at end of file +var _0xb846=['-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','UserProfileResource','error','name','send','index','JscriptyProject','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','clone','options','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getSessions','findOne','JscriptySessionReport','includeAll','getAnswers','hasOwnProperty','ProjectId','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport'];(function(_0x246926,_0x38e0b1){var _0x3e49aa=function(_0x3e60d5){while(--_0x3e60d5){_0x246926['push'](_0x246926['shift']());}};_0x3e49aa(++_0x38e0b1);}(_0xb846,0x1d0));var _0x6b84=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb846[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0x6b84('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6b84('0x1'));var rp=require(_0x6b84('0x2'));var moment=require(_0x6b84('0x3'));var BPromise=require(_0x6b84('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b84('0x5'));var sox=require(_0x6b84('0x6'));var csv=require(_0x6b84('0x7'));var ejs=require(_0x6b84('0x8'));var fs=require('fs');var fs_extra=require(_0x6b84('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b84('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6b84('0xb'));var toCsv=require(_0x6b84('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6b84('0xc'));var qs=require(_0x6b84('0xd'));var as=require(_0x6b84('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6b84('0xf'));var config=require(_0x6b84('0x10'));var licenseUtil=require(_0x6b84('0x11'));var db=require(_0x6b84('0x12'))['db'];function respondWithStatusCode(_0x306c51,_0x44543a){_0x44543a=_0x44543a||0xcc;return function(_0x196f75){if(_0x196f75){return _0x306c51[_0x6b84('0x13')](_0x44543a);}return _0x306c51[_0x6b84('0x14')](_0x44543a)[_0x6b84('0x15')]();};}function respondWithResult(_0x422cc8,_0xd737b2){_0xd737b2=_0xd737b2||0xc8;return function(_0x32d215){if(_0x32d215){return _0x422cc8['status'](_0xd737b2)[_0x6b84('0x16')](_0x32d215);}};}function respondWithFilteredResult(_0x5cd2ea,_0x2db9f7){return function(_0x2673ad){if(_0x2673ad){var _0x33b0ac=typeof _0x2db9f7[_0x6b84('0x17')]===_0x6b84('0x18')&&typeof _0x2db9f7[_0x6b84('0x19')]===_0x6b84('0x18');var _0x24a2ca=_0x2673ad[_0x6b84('0x1a')];var _0x42eb2f=_0x33b0ac?0x0:_0x2db9f7[_0x6b84('0x17')];var _0x35a88d=_0x33b0ac?_0x2673ad['count']:_0x2db9f7[_0x6b84('0x17')]+_0x2db9f7[_0x6b84('0x19')];var _0x273169;if(_0x35a88d>=_0x24a2ca){_0x35a88d=_0x24a2ca;_0x273169=0xc8;}else{_0x273169=0xce;}_0x5cd2ea[_0x6b84('0x14')](_0x273169);return _0x5cd2ea[_0x6b84('0x1b')](_0x6b84('0x1c'),_0x42eb2f+'-'+_0x35a88d+'/'+_0x24a2ca)['json'](_0x2673ad);}return null;};}function patchUpdates(_0x5c1499){return function(_0x2d1372){try{jsonpatch['apply'](_0x2d1372,_0x5c1499,!![]);}catch(_0x20717b){return BPromise[_0x6b84('0x1d')](_0x20717b);}return _0x2d1372[_0x6b84('0x1e')]();};}function saveUpdates(_0x4c682d,_0x4acacf){return function(_0x358f87){if(_0x358f87){return _0x358f87['update'](_0x4c682d)['then'](function(_0x20c1ec){return _0x20c1ec;});}return null;};}function removeEntity(_0x3c5765,_0x3cc917){return function(_0x1fa7a6){if(_0x1fa7a6){return _0x1fa7a6[_0x6b84('0x1f')]()[_0x6b84('0x20')](function(){var _0x297f4f=_0x1fa7a6['get']({'plain':!![]});var _0xb16a64='Projects';return db[_0x6b84('0x21')][_0x6b84('0x1f')]({'where':{'type':_0xb16a64,'resourceId':_0x297f4f['id']}})[_0x6b84('0x20')](function(){return _0x1fa7a6;});})[_0x6b84('0x20')](function(){_0x3c5765['status'](0xcc)[_0x6b84('0x15')]();});}};}function handleEntityNotFound(_0x1f209f,_0x3355f1){return function(_0x4d315a){if(!_0x4d315a){_0x1f209f[_0x6b84('0x13')](0x194);}return _0x4d315a;};}function handleError(_0x48b265,_0x21c4c5){_0x21c4c5=_0x21c4c5||0x1f4;return function(_0x3a9873){logger[_0x6b84('0x22')](_0x3a9873['stack']);if(_0x3a9873[_0x6b84('0x23')]){delete _0x3a9873[_0x6b84('0x23')];}_0x48b265[_0x6b84('0x14')](_0x21c4c5)[_0x6b84('0x24')](_0x3a9873);};}exports[_0x6b84('0x25')]=function(_0x110d68,_0x589e6e){var _0x4d88e1={},_0x1282fd={},_0x2cbf88={'count':0x0,'rows':[]};var _0x5a7355=_['map'](db[_0x6b84('0x26')]['rawAttributes'],function(_0x539f5b){return{'name':_0x539f5b[_0x6b84('0x27')],'type':_0x539f5b[_0x6b84('0x28')]['key']};});_0x1282fd[_0x6b84('0x29')]=_[_0x6b84('0x2a')](_0x5a7355,_0x6b84('0x23'));_0x1282fd['query']=_['keys'](_0x110d68[_0x6b84('0x2b')]);_0x1282fd['filters']=_[_0x6b84('0x2c')](_0x1282fd[_0x6b84('0x29')],_0x1282fd[_0x6b84('0x2b')]);_0x4d88e1[_0x6b84('0x2d')]=_[_0x6b84('0x2c')](_0x1282fd['model'],qs[_0x6b84('0x2e')](_0x110d68[_0x6b84('0x2b')]['fields']));_0x4d88e1[_0x6b84('0x2d')]=_0x4d88e1[_0x6b84('0x2d')][_0x6b84('0x2f')]?_0x4d88e1[_0x6b84('0x2d')]:_0x1282fd['model'];if(!_0x110d68[_0x6b84('0x2b')]['hasOwnProperty'](_0x6b84('0x30'))){_0x4d88e1[_0x6b84('0x19')]=qs[_0x6b84('0x19')](_0x110d68[_0x6b84('0x2b')][_0x6b84('0x19')]);_0x4d88e1[_0x6b84('0x17')]=qs[_0x6b84('0x17')](_0x110d68[_0x6b84('0x2b')][_0x6b84('0x17')]);}_0x4d88e1[_0x6b84('0x31')]=qs[_0x6b84('0x32')](_0x110d68['query'][_0x6b84('0x32')]);_0x4d88e1[_0x6b84('0x33')]=qs[_0x6b84('0x34')](_[_0x6b84('0x35')](_0x110d68['query'],_0x1282fd[_0x6b84('0x34')]),_0x5a7355);if(_0x110d68[_0x6b84('0x2b')][_0x6b84('0x36')]){_0x4d88e1[_0x6b84('0x33')]=_['merge'](_0x4d88e1[_0x6b84('0x33')],{'$or':_[_0x6b84('0x2a')](_0x5a7355,function(_0x4ff4c7){if(_0x4ff4c7[_0x6b84('0x28')]!==_0x6b84('0x37')){var _0x58964f={};_0x58964f[_0x4ff4c7[_0x6b84('0x23')]]={'$like':'%'+_0x110d68[_0x6b84('0x2b')][_0x6b84('0x36')]+'%'};return _0x58964f;}})});}_0x4d88e1=_[_0x6b84('0x38')]({},_0x4d88e1,_0x110d68['options']);var _0x5e1178={'where':_0x4d88e1[_0x6b84('0x33')]};return db[_0x6b84('0x26')][_0x6b84('0x1a')](_0x5e1178)[_0x6b84('0x20')](function(_0x3bb31f){_0x2cbf88['count']=_0x3bb31f;if(_0x110d68[_0x6b84('0x2b')]['includeAll']){_0x4d88e1[_0x6b84('0x39')]=[{'all':!![]}];}return db[_0x6b84('0x26')][_0x6b84('0x3a')](_0x4d88e1);})[_0x6b84('0x20')](function(_0x2de6fe){_0x2cbf88[_0x6b84('0x3b')]=_0x2de6fe;return _0x2cbf88;})[_0x6b84('0x20')](respondWithFilteredResult(_0x589e6e,_0x4d88e1))[_0x6b84('0x3c')](handleError(_0x589e6e,null));};exports[_0x6b84('0x3d')]=function(_0x20cd2b,_0x3cfa0f){var _0x362e33={'raw':![],'where':{'id':_0x20cd2b[_0x6b84('0x3e')]['id']}},_0x3622b7={};_0x3622b7['model']=_[_0x6b84('0x3f')](db['JscriptyProject'][_0x6b84('0x40')]);_0x3622b7[_0x6b84('0x2b')]=_[_0x6b84('0x3f')](_0x20cd2b[_0x6b84('0x2b')]);_0x3622b7['filters']=_['intersection'](_0x3622b7[_0x6b84('0x29')],_0x3622b7[_0x6b84('0x2b')]);_0x362e33[_0x6b84('0x2d')]=_[_0x6b84('0x2c')](_0x3622b7['model'],qs[_0x6b84('0x2e')](_0x20cd2b['query'][_0x6b84('0x2e')]));_0x362e33[_0x6b84('0x2d')]=_0x362e33[_0x6b84('0x2d')][_0x6b84('0x2f')]?_0x362e33['attributes']:_0x3622b7[_0x6b84('0x29')];if(_0x20cd2b[_0x6b84('0x2b')]['includeAll']){_0x362e33[_0x6b84('0x39')]=[{'all':!![]}];}_0x362e33=_[_0x6b84('0x38')]({},_0x362e33,_0x20cd2b['options']);return db[_0x6b84('0x26')]['find'](_0x362e33)[_0x6b84('0x20')](handleEntityNotFound(_0x3cfa0f,null))[_0x6b84('0x20')](respondWithResult(_0x3cfa0f,null))[_0x6b84('0x3c')](handleError(_0x3cfa0f,null));};exports['create']=function(_0x912758,_0x5c19e2){return db['JscriptyProject'][_0x6b84('0x41')](_0x912758[_0x6b84('0x42')],{})['then'](function(_0x115dd3){var _0x3fa0ef=_0x912758[_0x6b84('0x43')][_0x6b84('0x44')]({'plain':!![]});if(!_0x3fa0ef)throw new Error(_0x6b84('0x45'));if(_0x3fa0ef[_0x6b84('0x46')]==='user'){var _0x84ea38=_0x115dd3[_0x6b84('0x44')]({'plain':!![]});var _0x5c90fa='Projects';return db['UserProfileSection'][_0x6b84('0x47')]({'where':{'name':_0x5c90fa,'userProfileId':_0x3fa0ef[_0x6b84('0x48')]},'raw':!![]})[_0x6b84('0x20')](function(_0x3b4d38){if(_0x3b4d38&&_0x3b4d38[_0x6b84('0x49')]===0x0){return db[_0x6b84('0x21')][_0x6b84('0x41')]({'name':_0x84ea38[_0x6b84('0x23')],'resourceId':_0x84ea38['id'],'type':_0x3b4d38[_0x6b84('0x23')],'sectionId':_0x3b4d38['id']},{})[_0x6b84('0x20')](function(){return _0x115dd3;});}else{return _0x115dd3;}})['catch'](function(_0x2ab260){logger[_0x6b84('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ab260);throw _0x2ab260;});}return _0x115dd3;})['then'](respondWithResult(_0x5c19e2,0xc9))[_0x6b84('0x3c')](handleError(_0x5c19e2,null));};exports[_0x6b84('0x4a')]=function(_0xa09a29,_0x4f3635){var _0x22f240={'where':{'id':_0xa09a29[_0x6b84('0x3e')]['id']}},_0x42402e={};_0x42402e[_0x6b84('0x29')]=_[_0x6b84('0x3f')](db[_0x6b84('0x26')]['rawAttributes']);_0x22f240[_0x6b84('0x2d')]=_[_0x6b84('0x2c')](_0x42402e['model'],qs[_0x6b84('0x2e')](_0xa09a29[_0x6b84('0x2b')][_0x6b84('0x2e')]));_0x22f240[_0x6b84('0x2d')]=_0x22f240[_0x6b84('0x2d')]['length']?_0x22f240[_0x6b84('0x2d')]:_0x42402e[_0x6b84('0x29')];if(_0xa09a29[_0x6b84('0x2b')]['includeAll']){_0x22f240['include']=[{'all':!![]}];}_0x22f240=_['merge']({},_0x22f240,_0xa09a29[_0x6b84('0x4b')]);return db['JscriptyProject'][_0x6b84('0x47')](_0x22f240)[_0x6b84('0x20')](handleEntityNotFound(_0x4f3635,null))['then'](function(_0x2a79f9){if(_0x2a79f9){var _0x3af878=_0x2a79f9[_0x6b84('0x44')]({'plain':!![]});_0x3af878=qs[_0x6b84('0x4c')](_0x3af878,['id',_0x6b84('0x4d'),_0x6b84('0x4e')]);_0xa09a29[_0x6b84('0x42')]=_[_0x6b84('0x4c')](_0xa09a29[_0x6b84('0x42')],['id',_0x6b84('0x4d'),'updatedAt']);return db[_0x6b84('0x26')][_0x6b84('0x41')](_[_0x6b84('0x38')](_0x3af878,_0xa09a29[_0x6b84('0x42')]),{'include':_0xa09a29[_0x6b84('0x2b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x210fc0){var _0x5f3bb9=_0xa09a29['user']['get']({'plain':!![]});if(!_0x5f3bb9)throw new Error(_0x6b84('0x45'));if(_0x5f3bb9[_0x6b84('0x46')]==='user'){var _0x50a894=_0x210fc0['get']({'plain':!![]});var _0x4c46ff='Projects';return db[_0x6b84('0x4f')]['find']({'where':{'name':_0x4c46ff,'userProfileId':_0x5f3bb9[_0x6b84('0x48')]},'raw':!![]})['then'](function(_0x58b751){if(_0x58b751&&_0x58b751['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x50a894[_0x6b84('0x23')],'resourceId':_0x50a894['id'],'type':_0x58b751['name'],'sectionId':_0x58b751['id']},{})['then'](function(){return _0x210fc0;});}else{return _0x210fc0;}})[_0x6b84('0x3c')](function(_0x15456e){logger[_0x6b84('0x22')](_0x6b84('0x50'),_0x15456e);throw _0x15456e;});}return _0x210fc0;});}})[_0x6b84('0x20')](respondWithResult(_0x4f3635,0xc9))[_0x6b84('0x3c')](handleError(_0x4f3635,null));};exports[_0x6b84('0x51')]=function(_0x3b625c,_0x557032){if(_0x3b625c[_0x6b84('0x42')]['id']){delete _0x3b625c[_0x6b84('0x42')]['id'];}return db['JscriptyProject'][_0x6b84('0x47')]({'where':{'id':_0x3b625c[_0x6b84('0x3e')]['id']}})[_0x6b84('0x20')](handleEntityNotFound(_0x557032,null))[_0x6b84('0x20')](saveUpdates(_0x3b625c['body'],null))[_0x6b84('0x20')](respondWithResult(_0x557032,null))['catch'](handleError(_0x557032,null));};exports[_0x6b84('0x1f')]=function(_0x5ab980,_0x495a21){return db[_0x6b84('0x26')][_0x6b84('0x47')]({'where':{'id':_0x5ab980['params']['id']}})[_0x6b84('0x20')](handleEntityNotFound(_0x495a21,null))[_0x6b84('0x20')](removeEntity(_0x495a21,null))['catch'](handleError(_0x495a21,null));};exports[_0x6b84('0x52')]=function(_0x40c86a,_0x4224b3,_0x1a9ad9){var _0x33fb7a={'raw':!![],'where':{}};var _0x200dfd={};var _0x50f2c9={'count':0x0,'rows':[]};return db[_0x6b84('0x26')][_0x6b84('0x53')]({'where':{'id':_0x40c86a[_0x6b84('0x3e')]['id']}})[_0x6b84('0x20')](handleEntityNotFound(_0x4224b3,null))[_0x6b84('0x20')](function(_0x37009f){if(_0x37009f){_0x200dfd['model']=_[_0x6b84('0x3f')](db['JscriptySessionReport']['rawAttributes']);_0x200dfd[_0x6b84('0x2b')]=_[_0x6b84('0x3f')](_0x40c86a[_0x6b84('0x2b')]);_0x200dfd[_0x6b84('0x34')]=_[_0x6b84('0x2c')](_0x200dfd[_0x6b84('0x29')],_0x200dfd[_0x6b84('0x2b')]);_0x33fb7a[_0x6b84('0x2d')]=_[_0x6b84('0x2c')](_0x200dfd['model'],qs['fields'](_0x40c86a['query'][_0x6b84('0x2e')]));_0x33fb7a[_0x6b84('0x2d')]=_0x33fb7a[_0x6b84('0x2d')][_0x6b84('0x2f')]?_0x33fb7a[_0x6b84('0x2d')]:_0x200dfd[_0x6b84('0x29')];if(!_0x40c86a[_0x6b84('0x2b')]['hasOwnProperty'](_0x6b84('0x30'))){_0x33fb7a[_0x6b84('0x19')]=qs['limit'](_0x40c86a[_0x6b84('0x2b')][_0x6b84('0x19')]);_0x33fb7a[_0x6b84('0x17')]=qs[_0x6b84('0x17')](_0x40c86a[_0x6b84('0x2b')][_0x6b84('0x17')]);}_0x33fb7a[_0x6b84('0x31')]=qs[_0x6b84('0x32')](_0x40c86a['query']['sort']);_0x33fb7a[_0x6b84('0x33')]=qs[_0x6b84('0x34')](_[_0x6b84('0x35')](_0x40c86a[_0x6b84('0x2b')],_0x200dfd['filters']));_0x33fb7a[_0x6b84('0x33')]['ProjectId']=_0x37009f['id'];if(_0x40c86a[_0x6b84('0x2b')][_0x6b84('0x36')]){_0x33fb7a[_0x6b84('0x33')]=_[_0x6b84('0x38')](_0x33fb7a[_0x6b84('0x33')],{'$or':_[_0x6b84('0x2a')](_0x33fb7a[_0x6b84('0x2d')],function(_0x3be521){var _0x3ded09={};_0x3ded09[_0x3be521]={'$like':'%'+_0x40c86a[_0x6b84('0x2b')][_0x6b84('0x36')]+'%'};return _0x3ded09;})});}_0x33fb7a=_[_0x6b84('0x38')]({},_0x33fb7a,_0x40c86a[_0x6b84('0x4b')]);return db[_0x6b84('0x54')][_0x6b84('0x1a')]({'where':_0x33fb7a[_0x6b84('0x33')]})[_0x6b84('0x20')](function(_0x310259){_0x50f2c9['count']=_0x310259;if(_0x40c86a[_0x6b84('0x2b')][_0x6b84('0x55')]){_0x33fb7a[_0x6b84('0x39')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x6b84('0x3a')](_0x33fb7a);})[_0x6b84('0x20')](function(_0x1896f3){_0x50f2c9['rows']=_0x1896f3;return _0x50f2c9;});}})['then'](respondWithFilteredResult(_0x4224b3,_0x33fb7a))[_0x6b84('0x3c')](handleError(_0x4224b3,null));};exports[_0x6b84('0x56')]=function(_0x143c87,_0x1d0919,_0x509210){var _0x215a01={'raw':!![],'where':{}};var _0x393ffd={};var _0x1d301c={'count':0x0,'rows':[]};return db[_0x6b84('0x26')]['findOne']({'where':{'id':_0x143c87[_0x6b84('0x3e')]['id']}})[_0x6b84('0x20')](handleEntityNotFound(_0x1d0919,null))['then'](function(_0xb8e528){if(_0xb8e528){_0x393ffd[_0x6b84('0x29')]=_[_0x6b84('0x3f')](db['JscriptyAnswerReport'][_0x6b84('0x40')]);_0x393ffd['query']=_['keys'](_0x143c87[_0x6b84('0x2b')]);_0x393ffd[_0x6b84('0x34')]=_['intersection'](_0x393ffd[_0x6b84('0x29')],_0x393ffd[_0x6b84('0x2b')]);_0x215a01[_0x6b84('0x2d')]=_['intersection'](_0x393ffd[_0x6b84('0x29')],qs[_0x6b84('0x2e')](_0x143c87[_0x6b84('0x2b')][_0x6b84('0x2e')]));_0x215a01[_0x6b84('0x2d')]=_0x215a01[_0x6b84('0x2d')][_0x6b84('0x2f')]?_0x215a01[_0x6b84('0x2d')]:_0x393ffd[_0x6b84('0x29')];if(!_0x143c87[_0x6b84('0x2b')][_0x6b84('0x57')](_0x6b84('0x30'))){_0x215a01[_0x6b84('0x19')]=qs[_0x6b84('0x19')](_0x143c87[_0x6b84('0x2b')][_0x6b84('0x19')]);_0x215a01[_0x6b84('0x17')]=qs['offset'](_0x143c87[_0x6b84('0x2b')][_0x6b84('0x17')]);}_0x215a01[_0x6b84('0x31')]=qs[_0x6b84('0x32')](_0x143c87[_0x6b84('0x2b')][_0x6b84('0x32')]);_0x215a01[_0x6b84('0x33')]=qs[_0x6b84('0x34')](_[_0x6b84('0x35')](_0x143c87[_0x6b84('0x2b')],_0x393ffd[_0x6b84('0x34')]));_0x215a01[_0x6b84('0x33')][_0x6b84('0x58')]=_0xb8e528['id'];if(_0x143c87[_0x6b84('0x2b')][_0x6b84('0x36')]){_0x215a01[_0x6b84('0x33')]=_[_0x6b84('0x38')](_0x215a01[_0x6b84('0x33')],{'$or':_[_0x6b84('0x2a')](_0x215a01[_0x6b84('0x2d')],function(_0x4cadba){var _0x5325dc={};_0x5325dc[_0x4cadba]={'$like':'%'+_0x143c87[_0x6b84('0x2b')][_0x6b84('0x36')]+'%'};return _0x5325dc;})});}_0x215a01=_[_0x6b84('0x38')]({},_0x215a01,_0x143c87[_0x6b84('0x4b')]);return db[_0x6b84('0x59')]['count']({'where':_0x215a01[_0x6b84('0x33')]})[_0x6b84('0x20')](function(_0xe754e2){_0x1d301c[_0x6b84('0x1a')]=_0xe754e2;if(_0x143c87[_0x6b84('0x2b')][_0x6b84('0x55')]){_0x215a01[_0x6b84('0x39')]=[{'all':!![]}];}return db[_0x6b84('0x59')][_0x6b84('0x3a')](_0x215a01);})[_0x6b84('0x20')](function(_0x4f8490){_0x1d301c[_0x6b84('0x3b')]=_0x4f8490;return _0x1d301c;});}})[_0x6b84('0x20')](respondWithFilteredResult(_0x1d0919,_0x215a01))['catch'](handleError(_0x1d0919,null));};function char(_0x263d86){return _0x6b84('0x5a')===typeof _0x263d86?String[_0x6b84('0x5b')][_0x6b84('0x5c')](null,arguments):_0x263d86;}function needsEncapsulation(_0x216756){return!!_0x216756&&(_0x216756['toString']()[_0x6b84('0x5d')](char(0xd))>=0x0||_0x216756[_0x6b84('0x5e')]()[_0x6b84('0x5d')](char(0xa))>=0x0||_0x216756['toString']()[_0x6b84('0x5d')](char(0x2c))>=0x0||_0x216756[_0x6b84('0x5e')]()[_0x6b84('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4b9fbf){var _0x479297=char(0x22),_0x4f5e2f='\x5c'+char(0x22),_0x267587=_0x4b9fbf['toString']()[_0x6b84('0x5f')](new RegExp(_0x479297,'g'),_0x4f5e2f);return _0x479297+_0x267587+_0x479297;}exports[_0x6b84('0x60')]=function(_0x5aad28,_0xd6a9ca,_0x3cd09f){var _0x275142,_0x2fb9d3;var _0x2dcaef={'where':{'ProjectId':_0x5aad28[_0x6b84('0x3e')]['id']}};if(_0x5aad28[_0x6b84('0x2b')][_0x6b84('0x61')]){_0x2dcaef['where'][_0x6b84('0x62')]=JSON[_0x6b84('0x63')](_0x5aad28[_0x6b84('0x2b')][_0x6b84('0x61')]);}return db[_0x6b84('0x54')][_0x6b84('0x3a')](_0x2dcaef)[_0x6b84('0x20')](handleEntityNotFound(_0xd6a9ca,null))[_0x6b84('0x20')](function(_0x20fdbc){if(_0x20fdbc){_0x275142=_0x20fdbc;return db[_0x6b84('0x64')][_0x6b84('0x3a')]({'where':{'SessionId':{'$in':_[_0x6b84('0x2a')](_0x275142,'id')},'ProjectId':_0x5aad28['params']['id']},'order':_0x6b84('0x65')});}})[_0x6b84('0x20')](handleEntityNotFound(_0xd6a9ca,null))[_0x6b84('0x20')](function(_0x502823){if(_0x502823){_0x2fb9d3=_0x502823;var _0x390d72={};for(var _0x471025=0x0,_0x25b9b8=_0x2fb9d3[_0x6b84('0x2f')];_0x471025<_0x25b9b8;_0x471025++){if(!_0x390d72['hasOwnProperty'](_0x2fb9d3[_0x471025][_0x6b84('0x66')])){_0x390d72[_0x2fb9d3[_0x471025][_0x6b84('0x66')]]=needsEncapsulation(_0x2fb9d3[_0x471025][_0x6b84('0x67')])?encapsulate(_0x2fb9d3[_0x471025][_0x6b84('0x67')]):_0x2fb9d3[_0x471025][_0x6b84('0x67')];}}var _0x2653ab=[],_0x4b81f7={};for(var _0x98dca1=0x0,_0x1e2ba4=_0x275142[_0x6b84('0x2f')];_0x98dca1<_0x1e2ba4;_0x98dca1++){_0x4b81f7={'ProjectId':_0x5aad28[_0x6b84('0x3e')]['id'],'SessionId':_0x275142[_0x98dca1]['id'],'StartTime':moment(_0x275142[_0x98dca1][_0x6b84('0x62')])[_0x6b84('0x68')](_0x6b84('0x69'))};for(var _0xca9c19=0x0,_0x509bf9=_0x2fb9d3[_0x6b84('0x2f')];_0xca9c19<_0x509bf9;_0xca9c19++){if(_0x2fb9d3[_0xca9c19][_0x6b84('0x6a')]==_0x275142[_0x98dca1]['id']&&_0x390d72[_0x6b84('0x57')](_0x2fb9d3[_0xca9c19][_0x6b84('0x66')])){_0x4b81f7[_0x390d72[_0x2fb9d3[_0xca9c19][_0x6b84('0x66')]]]=_0x2fb9d3[_0xca9c19][_0x6b84('0x6b')];}}for(var _0x219264 in _0x390d72){if(!_0x4b81f7['hasOwnProperty'](_0x390d72[_0x219264])){_0x4b81f7[_0x390d72[_0x219264]]=null;}}_0x2653ab['push'](_0x4b81f7);}return _0x2653ab;}})[_0x6b84('0x20')](function(_0x341d24){if(!_[_0x6b84('0x6c')](_0x341d24)){var _0x3406ed=toCsv(_0x341d24);var _0x384599=Date['now']();fs[_0x6b84('0x6d')](util[_0x6b84('0x68')](_0x6b84('0x6e'),_0x5aad28[_0x6b84('0x3e')]['id'],_0x384599),_0x3406ed);_0xd6a9ca[_0x6b84('0x6f')](_0x6b84('0x70'),'attachment;\x20filename='+util[_0x6b84('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0x5aad28[_0x6b84('0x3e')]['id'],_0x384599));_0xd6a9ca['setHeader']('Content-type','text/csv');return _0xd6a9ca['download'](util['format'](_0x6b84('0x6e'),_0x5aad28[_0x6b84('0x3e')]['id'],_0x384599));}else{return _0xd6a9ca['sendStatus'](0xcc);}})['catch'](handleError(_0xd6a9ca,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 26b2362..a2f09c4 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 _0x0cfe=['define','JscriptyProject','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x4cf2c5,_0x150903){var _0x3e935b=function(_0x55162b){while(--_0x55162b){_0x4cf2c5['push'](_0x4cf2c5['shift']());}};_0x3e935b(++_0x150903);}(_0x0cfe,0x9c));var _0xe0cf=function(_0x56a800,_0x3c1115){_0x56a800=_0x56a800-0x0;var _0x39731c=_0x0cfe[_0x56a800];return _0x39731c;};'use strict';var _=require(_0xe0cf('0x0'));var util=require('util');var logger=require(_0xe0cf('0x1'))(_0xe0cf('0x2'));var moment=require(_0xe0cf('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0cf('0x5'));var config=require(_0xe0cf('0x6'));var attributes=require(_0xe0cf('0x7'));module[_0xe0cf('0x8')]=function(_0x58a4f7,_0x27c9ca){return _0x58a4f7[_0xe0cf('0x9')](_0xe0cf('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae24=['../../config/logger','moment','bluebird','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','lodash'];(function(_0x4e4072,_0xa52044){var _0x4e2536=function(_0x681390){while(--_0x681390){_0x4e4072['push'](_0x4e4072['shift']());}};_0x4e2536(++_0xa52044);}(_0xae24,0x182));var _0x4ae2=function(_0x468352,_0x5d6ea7){_0x468352=_0x468352-0x0;var _0xa91c44=_0xae24[_0x468352];return _0xa91c44;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));module[_0x4ae2('0x6')]=function(_0x20c85c,_0x3e6055){return _0x20c85c[_0x4ae2('0x7')](_0x4ae2('0x8'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index c355852..f432b77 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x29696a,_0x504c71){var _0x1cb7fd=function(_0x1d0f2c){while(--_0x1d0f2c){_0x29696a['push'](_0x29696a['shift']());}};_0x1cb7fd(++_0x504c71);}(_0xaa88,0x137));var _0x8aa8=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xaa88[_0x52e363];return _0x3fc2b5;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1c9c3f,_0x5eab64){var _0x5e9d62=function(_0x62777b){while(--_0x62777b){_0x1c9c3f['push'](_0x1c9c3f['shift']());}};_0x5e9d62(++_0x5eab64);}(_0xe706,0xa3));var _0x6e70=function(_0x108b66,_0x37db88){_0x108b66=_0x108b66-0x0;var _0x3ed76=_0xe706[_0x108b66];return _0x3ed76;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index a43d525..990fcf2 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 _0x79ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','post','create','/:id','update','exports','util'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x79ae,0x17b));var _0xe79a=function(_0xbfd538,_0x4d825c){_0xbfd538=_0xbfd538-0x0;var _0x2d9f73=_0x79ae[_0xbfd538];return _0x2d9f73;};'use strict';var multer=require('multer');var util=require(_0xe79a('0x0'));var path=require('path');var timeout=require(_0xe79a('0x1'));var express=require(_0xe79a('0x2'));var router=express[_0xe79a('0x3')]();var fs_extra=require(_0xe79a('0x4'));var auth=require(_0xe79a('0x5'));var interaction=require(_0xe79a('0x6'));var config=require(_0xe79a('0x7'));var controller=require(_0xe79a('0x8'));router['get']('/',auth[_0xe79a('0x9')](),controller[_0xe79a('0xa')]);router[_0xe79a('0xb')](_0xe79a('0xc'),auth[_0xe79a('0x9')](),controller[_0xe79a('0xd')]);router[_0xe79a('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe79a('0xe')]('/',auth[_0xe79a('0x9')](),controller[_0xe79a('0xf')]);router['put'](_0xe79a('0x10'),auth[_0xe79a('0x9')](),controller[_0xe79a('0x11')]);router['delete']('/:id',auth[_0xe79a('0x9')](),controller['destroy']);module[_0xe79a('0x12')]=router; \ No newline at end of file +var _0xd465=['isAuthenticated','index','/:id','show','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0xd465,0x18e));var _0x5d46=function(_0x27d04f,_0x1c4f9d){_0x27d04f=_0x27d04f-0x0;var _0x53d06a=_0xd465[_0x27d04f];return _0x53d06a;};'use strict';var multer=require(_0x5d46('0x0'));var util=require('util');var path=require(_0x5d46('0x1'));var timeout=require(_0x5d46('0x2'));var express=require(_0x5d46('0x3'));var router=express[_0x5d46('0x4')]();var fs_extra=require(_0x5d46('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d46('0x6'));var config=require(_0x5d46('0x7'));var controller=require(_0x5d46('0x8'));router[_0x5d46('0x9')]('/',auth[_0x5d46('0xa')](),controller[_0x5d46('0xb')]);router['get']('/describe',auth[_0x5d46('0xa')](),controller['describe']);router['get'](_0x5d46('0xc'),auth[_0x5d46('0xa')](),controller[_0x5d46('0xd')]);router['post']('/',auth[_0x5d46('0xa')](),controller['create']);router[_0x5d46('0xe')]('/:id',auth[_0x5d46('0xa')](),controller['update']);router['delete'](_0x5d46('0xc'),auth[_0x5d46('0xa')](),controller[_0x5d46('0xf')]);module[_0x5d46('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ce858eb..3d02a7b 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x20f311,_0x5e58bb){_0x20f311=_0x20f311-0x0;var _0x2e409e=_0x7a54[_0x20f311];return _0x2e409e;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x6aaae5,_0x407a2f){_0x6aaae5=_0x6aaae5-0x0;var _0x26abdf=_0x7a54[_0x6aaae5];return _0x26abdf;};'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 be042a9..b460e61 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 _0xc9b7=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xc9b7,0x1b4));var _0x7c9b=function(_0x596e98,_0xc326c9){_0x596e98=_0x596e98-0x0;var _0x1c09ac=_0xc9b7[_0x596e98];return _0x1c09ac;};'use strict';var emlformat=require(_0x7c9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c9b('0x1'));var jsonpatch=require(_0x7c9b('0x2'));var rp=require(_0x7c9b('0x3'));var moment=require(_0x7c9b('0x4'));var BPromise=require(_0x7c9b('0x5'));var Mustache=require(_0x7c9b('0x6'));var util=require(_0x7c9b('0x7'));var path=require(_0x7c9b('0x8'));var sox=require(_0x7c9b('0x9'));var csv=require(_0x7c9b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7c9b('0xb'));var crypto=require(_0x7c9b('0xc'));var jsforce=require(_0x7c9b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7c9b('0xa'));var querystring=require(_0x7c9b('0xe'));var Papa=require(_0x7c9b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7c9b('0x10'));var as=require(_0x7c9b('0x11'));var hardwareService=require(_0x7c9b('0x12'));var logger=require(_0x7c9b('0x13'))(_0x7c9b('0x14'));var utils=require(_0x7c9b('0x15'));var config=require(_0x7c9b('0x16'));var licenseUtil=require(_0x7c9b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6490,_0x23821f){_0x23821f=_0x23821f||0xcc;return function(_0x47f38b){if(_0x47f38b){return _0x1e6490[_0x7c9b('0x18')](_0x23821f);}return _0x1e6490[_0x7c9b('0x19')](_0x23821f)['end']();};}function respondWithResult(_0x4effd4,_0xd6706b){_0xd6706b=_0xd6706b||0xc8;return function(_0x56f97e){if(_0x56f97e){return _0x4effd4[_0x7c9b('0x19')](_0xd6706b)[_0x7c9b('0x1a')](_0x56f97e);}};}function respondWithFilteredResult(_0x749326,_0x512dc4){return function(_0x3484b4){if(_0x3484b4){var _0x93a4d9=typeof _0x512dc4['offset']===_0x7c9b('0x1b')&&typeof _0x512dc4[_0x7c9b('0x1c')]===_0x7c9b('0x1b');var _0x90a63d=_0x3484b4[_0x7c9b('0x1d')];var _0x47723b=_0x93a4d9?0x0:_0x512dc4[_0x7c9b('0x1e')];var _0x140d8a=_0x93a4d9?_0x3484b4['count']:_0x512dc4[_0x7c9b('0x1e')]+_0x512dc4['limit'];var _0x5d607c;if(_0x140d8a>=_0x90a63d){_0x140d8a=_0x90a63d;_0x5d607c=0xc8;}else{_0x5d607c=0xce;}_0x749326['status'](_0x5d607c);return _0x749326[_0x7c9b('0x1f')](_0x7c9b('0x20'),_0x47723b+'-'+_0x140d8a+'/'+_0x90a63d)[_0x7c9b('0x1a')](_0x3484b4);}return null;};}function patchUpdates(_0x28a067){return function(_0x49cf2e){try{jsonpatch[_0x7c9b('0x21')](_0x49cf2e,_0x28a067,!![]);}catch(_0x21b78b){return BPromise[_0x7c9b('0x22')](_0x21b78b);}return _0x49cf2e['save']();};}function saveUpdates(_0x605b0c,_0x47a4df){return function(_0x22fc60){if(_0x22fc60){return _0x22fc60['update'](_0x605b0c)['then'](function(_0x2afcad){return _0x2afcad;});}return null;};}function removeEntity(_0x235f5c,_0x197921){return function(_0x46e78f){if(_0x46e78f){return _0x46e78f[_0x7c9b('0x23')]()[_0x7c9b('0x24')](function(){_0x235f5c[_0x7c9b('0x19')](0xcc)[_0x7c9b('0x25')]();});}};}function handleEntityNotFound(_0x33551d,_0x162b5b){return function(_0x395d80){if(!_0x395d80){_0x33551d[_0x7c9b('0x18')](0x194);}return _0x395d80;};}function handleError(_0x417021,_0x20e412){_0x20e412=_0x20e412||0x1f4;return function(_0x3f53f0){logger[_0x7c9b('0x26')](_0x3f53f0[_0x7c9b('0x27')]);if(_0x3f53f0[_0x7c9b('0x28')]){delete _0x3f53f0['name'];}_0x417021['status'](_0x20e412)[_0x7c9b('0x29')](_0x3f53f0);};}exports[_0x7c9b('0x2a')]=function(_0x47b870,_0x25c1d3){var _0x526f54={},_0x358466={},_0x124f85={'count':0x0,'rows':[]};var _0x5d1323=_[_0x7c9b('0x2b')](db[_0x7c9b('0x2c')][_0x7c9b('0x2d')],function(_0x515a44){return{'name':_0x515a44[_0x7c9b('0x2e')],'type':_0x515a44[_0x7c9b('0x2f')]['key']};});_0x358466[_0x7c9b('0x30')]=_[_0x7c9b('0x2b')](_0x5d1323,_0x7c9b('0x28'));_0x358466['query']=_[_0x7c9b('0x31')](_0x47b870[_0x7c9b('0x32')]);_0x358466[_0x7c9b('0x33')]=_[_0x7c9b('0x34')](_0x358466[_0x7c9b('0x30')],_0x358466[_0x7c9b('0x32')]);_0x526f54['attributes']=_[_0x7c9b('0x34')](_0x358466[_0x7c9b('0x30')],qs[_0x7c9b('0x35')](_0x47b870[_0x7c9b('0x32')][_0x7c9b('0x35')]));_0x526f54[_0x7c9b('0x36')]=_0x526f54[_0x7c9b('0x36')]['length']?_0x526f54['attributes']:_0x358466['model'];if(!_0x47b870['query'][_0x7c9b('0x37')](_0x7c9b('0x38'))){_0x526f54[_0x7c9b('0x1c')]=qs[_0x7c9b('0x1c')](_0x47b870[_0x7c9b('0x32')][_0x7c9b('0x1c')]);_0x526f54[_0x7c9b('0x1e')]=qs['offset'](_0x47b870[_0x7c9b('0x32')][_0x7c9b('0x1e')]);}_0x526f54[_0x7c9b('0x39')]=qs[_0x7c9b('0x3a')](_0x47b870['query']['sort']);_0x526f54[_0x7c9b('0x3b')]=qs[_0x7c9b('0x33')](_[_0x7c9b('0x3c')](_0x47b870[_0x7c9b('0x32')],_0x358466[_0x7c9b('0x33')]),_0x5d1323);if(_0x47b870[_0x7c9b('0x32')][_0x7c9b('0x3d')]){_0x526f54[_0x7c9b('0x3b')]=_['merge'](_0x526f54[_0x7c9b('0x3b')],{'$or':_['map'](_0x5d1323,function(_0x1c1032){if(_0x1c1032['type']!==_0x7c9b('0x3e')){var _0x245e3b={};_0x245e3b[_0x1c1032[_0x7c9b('0x28')]]={'$like':'%'+_0x47b870['query'][_0x7c9b('0x3d')]+'%'};return _0x245e3b;}})});}_0x526f54=_[_0x7c9b('0x3f')]({},_0x526f54,_0x47b870[_0x7c9b('0x40')]);var _0x327c27={'where':_0x526f54[_0x7c9b('0x3b')]};return db['JscriptyQuestionReport'][_0x7c9b('0x1d')](_0x327c27)[_0x7c9b('0x24')](function(_0xa6cde1){_0x124f85[_0x7c9b('0x1d')]=_0xa6cde1;if(_0x47b870['query'][_0x7c9b('0x41')]){_0x526f54[_0x7c9b('0x42')]=[{'all':!![]}];}return db[_0x7c9b('0x2c')][_0x7c9b('0x43')](_0x526f54);})[_0x7c9b('0x24')](function(_0x3e270b){_0x124f85[_0x7c9b('0x44')]=_0x3e270b;return _0x124f85;})[_0x7c9b('0x24')](respondWithFilteredResult(_0x25c1d3,_0x526f54))[_0x7c9b('0x45')](handleError(_0x25c1d3,null));};exports[_0x7c9b('0x46')]=function(_0x1f4120,_0x5cd7ee){var _0x3383bf={'raw':!![],'where':{'id':_0x1f4120[_0x7c9b('0x47')]['id']}},_0x2853ad={};_0x2853ad[_0x7c9b('0x30')]=_[_0x7c9b('0x31')](db[_0x7c9b('0x2c')][_0x7c9b('0x2d')]);_0x2853ad[_0x7c9b('0x32')]=_[_0x7c9b('0x31')](_0x1f4120['query']);_0x2853ad[_0x7c9b('0x33')]=_[_0x7c9b('0x34')](_0x2853ad[_0x7c9b('0x30')],_0x2853ad[_0x7c9b('0x32')]);_0x3383bf[_0x7c9b('0x36')]=_['intersection'](_0x2853ad[_0x7c9b('0x30')],qs[_0x7c9b('0x35')](_0x1f4120['query'][_0x7c9b('0x35')]));_0x3383bf['attributes']=_0x3383bf['attributes'][_0x7c9b('0x48')]?_0x3383bf[_0x7c9b('0x36')]:_0x2853ad[_0x7c9b('0x30')];if(_0x1f4120[_0x7c9b('0x32')]['includeAll']){_0x3383bf['include']=[{'all':!![]}];}_0x3383bf=_[_0x7c9b('0x3f')]({},_0x3383bf,_0x1f4120[_0x7c9b('0x40')]);return db['JscriptyQuestionReport']['find'](_0x3383bf)[_0x7c9b('0x24')](handleEntityNotFound(_0x5cd7ee,null))['then'](respondWithResult(_0x5cd7ee,null))[_0x7c9b('0x45')](handleError(_0x5cd7ee,null));};exports[_0x7c9b('0x49')]=function(_0x4db1f2,_0x3e6d4c){return db[_0x7c9b('0x2c')][_0x7c9b('0x49')](_0x4db1f2[_0x7c9b('0x4a')],{})[_0x7c9b('0x24')](respondWithResult(_0x3e6d4c,0xc9))[_0x7c9b('0x45')](handleError(_0x3e6d4c,null));};exports[_0x7c9b('0x4b')]=function(_0x337172,_0x5a8226){if(_0x337172[_0x7c9b('0x4a')]['id']){delete _0x337172[_0x7c9b('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0x7c9b('0x4c')]({'where':{'id':_0x337172['params']['id']}})['then'](handleEntityNotFound(_0x5a8226,null))[_0x7c9b('0x24')](saveUpdates(_0x337172[_0x7c9b('0x4a')],null))[_0x7c9b('0x24')](respondWithResult(_0x5a8226,null))[_0x7c9b('0x45')](handleError(_0x5a8226,null));};exports[_0x7c9b('0x23')]=function(_0x52d63a,_0x2ae70f){return db[_0x7c9b('0x2c')][_0x7c9b('0x4c')]({'where':{'id':_0x52d63a[_0x7c9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ae70f,null))[_0x7c9b('0x24')](removeEntity(_0x2ae70f,null))[_0x7c9b('0x45')](handleError(_0x2ae70f,null));};exports['describe']=function(_0x48f56e,_0x577ec4){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x577ec4,null))[_0x7c9b('0x45')](handleError(_0x577ec4,null));}; \ No newline at end of file +var _0x1537=['stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','limit','undefined','offset','set','json','apply','reject','save','update','destroy','then','error'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x1537,0x147));var _0x7153=function(_0xaf2ec8,_0x470e3c){_0xaf2ec8=_0xaf2ec8-0x0;var _0x3e9430=_0x1537[_0xaf2ec8];return _0x3e9430;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7153('0x0'));var zipdir=require(_0x7153('0x1'));var jsonpatch=require(_0x7153('0x2'));var rp=require(_0x7153('0x3'));var moment=require(_0x7153('0x4'));var BPromise=require(_0x7153('0x5'));var Mustache=require(_0x7153('0x6'));var util=require('util');var path=require(_0x7153('0x7'));var sox=require('sox');var csv=require(_0x7153('0x8'));var ejs=require(_0x7153('0x9'));var fs=require('fs');var fs_extra=require(_0x7153('0xa'));var _=require('lodash');var squel=require(_0x7153('0xb'));var crypto=require(_0x7153('0xc'));var jsforce=require(_0x7153('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7153('0x8'));var querystring=require(_0x7153('0xe'));var Papa=require(_0x7153('0xf'));var Redis=require('ioredis');var authService=require(_0x7153('0x10'));var qs=require(_0x7153('0x11'));var as=require(_0x7153('0x12'));var hardwareService=require(_0x7153('0x13'));var logger=require(_0x7153('0x14'))(_0x7153('0x15'));var utils=require(_0x7153('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7153('0x17'))['db'];function respondWithStatusCode(_0x495888,_0x24d6ac){_0x24d6ac=_0x24d6ac||0xcc;return function(_0x540a2a){if(_0x540a2a){return _0x495888[_0x7153('0x18')](_0x24d6ac);}return _0x495888['status'](_0x24d6ac)['end']();};}function respondWithResult(_0x342eb0,_0x23c3ce){_0x23c3ce=_0x23c3ce||0xc8;return function(_0x2c4150){if(_0x2c4150){return _0x342eb0[_0x7153('0x19')](_0x23c3ce)['json'](_0x2c4150);}};}function respondWithFilteredResult(_0x5b1298,_0x3b3df4){return function(_0x5c7085){if(_0x5c7085){var _0x2a50d4=typeof _0x3b3df4['offset']==='undefined'&&typeof _0x3b3df4[_0x7153('0x1a')]===_0x7153('0x1b');var _0x1979a4=_0x5c7085['count'];var _0x3d6a50=_0x2a50d4?0x0:_0x3b3df4[_0x7153('0x1c')];var _0x37b4cd=_0x2a50d4?_0x5c7085['count']:_0x3b3df4['offset']+_0x3b3df4[_0x7153('0x1a')];var _0x585332;if(_0x37b4cd>=_0x1979a4){_0x37b4cd=_0x1979a4;_0x585332=0xc8;}else{_0x585332=0xce;}_0x5b1298[_0x7153('0x19')](_0x585332);return _0x5b1298[_0x7153('0x1d')]('Content-Range',_0x3d6a50+'-'+_0x37b4cd+'/'+_0x1979a4)[_0x7153('0x1e')](_0x5c7085);}return null;};}function patchUpdates(_0x293a1a){return function(_0x4c6fac){try{jsonpatch[_0x7153('0x1f')](_0x4c6fac,_0x293a1a,!![]);}catch(_0x18ce31){return BPromise[_0x7153('0x20')](_0x18ce31);}return _0x4c6fac[_0x7153('0x21')]();};}function saveUpdates(_0x4c9755,_0x2731fe){return function(_0x4bf113){if(_0x4bf113){return _0x4bf113[_0x7153('0x22')](_0x4c9755)['then'](function(_0x4218bf){return _0x4218bf;});}return null;};}function removeEntity(_0x5ef5a1,_0x1241e3){return function(_0x4eb6fd){if(_0x4eb6fd){return _0x4eb6fd[_0x7153('0x23')]()[_0x7153('0x24')](function(){_0x5ef5a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3525,_0x8b1883){return function(_0x4c51f6){if(!_0x4c51f6){_0x5a3525['sendStatus'](0x194);}return _0x4c51f6;};}function handleError(_0x478b76,_0x3fcdc8){_0x3fcdc8=_0x3fcdc8||0x1f4;return function(_0x10f271){logger[_0x7153('0x25')](_0x10f271[_0x7153('0x26')]);if(_0x10f271[_0x7153('0x27')]){delete _0x10f271[_0x7153('0x27')];}_0x478b76[_0x7153('0x19')](_0x3fcdc8)[_0x7153('0x28')](_0x10f271);};}exports[_0x7153('0x29')]=function(_0x363fda,_0x2610a8){var _0x2b6c0a={},_0x20bbfb={},_0x37ea6d={'count':0x0,'rows':[]};var _0x1fead9=_[_0x7153('0x2a')](db[_0x7153('0x2b')][_0x7153('0x2c')],function(_0x101fed){return{'name':_0x101fed[_0x7153('0x2d')],'type':_0x101fed[_0x7153('0x2e')][_0x7153('0x2f')]};});_0x20bbfb['model']=_['map'](_0x1fead9,_0x7153('0x27'));_0x20bbfb['query']=_[_0x7153('0x30')](_0x363fda[_0x7153('0x31')]);_0x20bbfb[_0x7153('0x32')]=_[_0x7153('0x33')](_0x20bbfb[_0x7153('0x34')],_0x20bbfb[_0x7153('0x31')]);_0x2b6c0a[_0x7153('0x35')]=_[_0x7153('0x33')](_0x20bbfb[_0x7153('0x34')],qs[_0x7153('0x36')](_0x363fda[_0x7153('0x31')][_0x7153('0x36')]));_0x2b6c0a[_0x7153('0x35')]=_0x2b6c0a[_0x7153('0x35')][_0x7153('0x37')]?_0x2b6c0a[_0x7153('0x35')]:_0x20bbfb[_0x7153('0x34')];if(!_0x363fda['query']['hasOwnProperty'](_0x7153('0x38'))){_0x2b6c0a[_0x7153('0x1a')]=qs[_0x7153('0x1a')](_0x363fda[_0x7153('0x31')]['limit']);_0x2b6c0a[_0x7153('0x1c')]=qs[_0x7153('0x1c')](_0x363fda['query'][_0x7153('0x1c')]);}_0x2b6c0a['order']=qs['sort'](_0x363fda[_0x7153('0x31')]['sort']);_0x2b6c0a['where']=qs[_0x7153('0x32')](_[_0x7153('0x39')](_0x363fda[_0x7153('0x31')],_0x20bbfb['filters']),_0x1fead9);if(_0x363fda[_0x7153('0x31')][_0x7153('0x3a')]){_0x2b6c0a[_0x7153('0x3b')]=_[_0x7153('0x3c')](_0x2b6c0a['where'],{'$or':_[_0x7153('0x2a')](_0x1fead9,function(_0x5e796c){if(_0x5e796c[_0x7153('0x2e')]!==_0x7153('0x3d')){var _0x399ada={};_0x399ada[_0x5e796c[_0x7153('0x27')]]={'$like':'%'+_0x363fda[_0x7153('0x31')][_0x7153('0x3a')]+'%'};return _0x399ada;}})});}_0x2b6c0a=_[_0x7153('0x3c')]({},_0x2b6c0a,_0x363fda[_0x7153('0x3e')]);var _0x217aef={'where':_0x2b6c0a[_0x7153('0x3b')]};return db[_0x7153('0x2b')]['count'](_0x217aef)['then'](function(_0x2bd80b){_0x37ea6d[_0x7153('0x3f')]=_0x2bd80b;if(_0x363fda[_0x7153('0x31')][_0x7153('0x40')]){_0x2b6c0a[_0x7153('0x41')]=[{'all':!![]}];}return db[_0x7153('0x2b')]['findAll'](_0x2b6c0a);})['then'](function(_0x103ee7){_0x37ea6d[_0x7153('0x42')]=_0x103ee7;return _0x37ea6d;})[_0x7153('0x24')](respondWithFilteredResult(_0x2610a8,_0x2b6c0a))['catch'](handleError(_0x2610a8,null));};exports['show']=function(_0x150853,_0x55ecdc){var _0x248a8f={'raw':!![],'where':{'id':_0x150853[_0x7153('0x43')]['id']}},_0x34d217={};_0x34d217[_0x7153('0x34')]=_[_0x7153('0x30')](db[_0x7153('0x2b')][_0x7153('0x2c')]);_0x34d217[_0x7153('0x31')]=_[_0x7153('0x30')](_0x150853[_0x7153('0x31')]);_0x34d217[_0x7153('0x32')]=_['intersection'](_0x34d217[_0x7153('0x34')],_0x34d217['query']);_0x248a8f['attributes']=_[_0x7153('0x33')](_0x34d217['model'],qs['fields'](_0x150853[_0x7153('0x31')][_0x7153('0x36')]));_0x248a8f[_0x7153('0x35')]=_0x248a8f['attributes'][_0x7153('0x37')]?_0x248a8f[_0x7153('0x35')]:_0x34d217['model'];if(_0x150853[_0x7153('0x31')][_0x7153('0x40')]){_0x248a8f['include']=[{'all':!![]}];}_0x248a8f=_[_0x7153('0x3c')]({},_0x248a8f,_0x150853['options']);return db[_0x7153('0x2b')][_0x7153('0x44')](_0x248a8f)[_0x7153('0x24')](handleEntityNotFound(_0x55ecdc,null))['then'](respondWithResult(_0x55ecdc,null))[_0x7153('0x45')](handleError(_0x55ecdc,null));};exports[_0x7153('0x46')]=function(_0x17190a,_0x1bd2c4){return db[_0x7153('0x2b')]['create'](_0x17190a['body'],{})[_0x7153('0x24')](respondWithResult(_0x1bd2c4,0xc9))[_0x7153('0x45')](handleError(_0x1bd2c4,null));};exports[_0x7153('0x22')]=function(_0x59ca5e,_0x18b118){if(_0x59ca5e[_0x7153('0x47')]['id']){delete _0x59ca5e[_0x7153('0x47')]['id'];}return db[_0x7153('0x2b')]['find']({'where':{'id':_0x59ca5e[_0x7153('0x43')]['id']}})[_0x7153('0x24')](handleEntityNotFound(_0x18b118,null))['then'](saveUpdates(_0x59ca5e[_0x7153('0x47')],null))[_0x7153('0x24')](respondWithResult(_0x18b118,null))[_0x7153('0x45')](handleError(_0x18b118,null));};exports[_0x7153('0x23')]=function(_0x20ff8f,_0x1b7516){return db[_0x7153('0x2b')]['find']({'where':{'id':_0x20ff8f[_0x7153('0x43')]['id']}})[_0x7153('0x24')](handleEntityNotFound(_0x1b7516,null))[_0x7153('0x24')](removeEntity(_0x1b7516,null))[_0x7153('0x45')](handleError(_0x1b7516,null));};exports[_0x7153('0x48')]=function(_0x5694c2,_0xeb0f3f){return db[_0x7153('0x2b')][_0x7153('0x48')]()[_0x7153('0x24')](respondWithResult(_0xeb0f3f,null))[_0x7153('0x45')](handleError(_0xeb0f3f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 911ba14..b6d7da4 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 _0xc491=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x24b135,_0x2aa165){var _0x56aafd=function(_0xdd7542){while(--_0xdd7542){_0x24b135['push'](_0x24b135['shift']());}};_0x56aafd(++_0x2aa165);}(_0xc491,0x17b));var _0x1c49=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xc491[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var logger=require(_0x1c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1c49('0x3'));var rp=require(_0x1c49('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c49('0x5'));var config=require(_0x1c49('0x6'));var attributes=require(_0x1c49('0x7'));module[_0x1c49('0x8')]=function(_0x1ad9eb,_0x2ecb1e){return _0x1ad9eb[_0x1c49('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x1c49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77cf=['path','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x505c98,_0x5b148b){var _0x5a7a52=function(_0x469384){while(--_0x469384){_0x505c98['push'](_0x505c98['shift']());}};_0x5a7a52(++_0x5b148b);}(_0x77cf,0x109));var _0xf77c=function(_0x5d18f4,_0x15e652){_0x5d18f4=_0x5d18f4-0x0;var _0x1aa8a0=_0x77cf[_0x5d18f4];return _0x1aa8a0;};'use strict';var _=require(_0xf77c('0x0'));var util=require('util');var logger=require(_0xf77c('0x1'))(_0xf77c('0x2'));var moment=require(_0xf77c('0x3'));var BPromise=require(_0xf77c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf77c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf77c('0x6'));module[_0xf77c('0x7')]=function(_0x137db9,_0xe6059){return _0x137db9[_0xf77c('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0xf77c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 27144cd..8b8d28f 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 _0xe23c=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35891,_0x13cbe2){var _0x44c31d=function(_0x1130cd){while(--_0x1130cd){_0x35891['push'](_0x35891['shift']());}};_0x44c31d(++_0x13cbe2);}(_0xe23c,0x160));var _0xce23=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0xe23c[_0x1fcaf1];return _0x55f464;};'use strict';var _=require(_0xce23('0x0'));var util=require('util');var moment=require(_0xce23('0x1'));var BPromise=require(_0xce23('0x2'));var rs=require(_0xce23('0x3'));var fs=require('fs');var Redis=require(_0xce23('0x4'));var db=require(_0xce23('0x5'))['db'];var utils=require(_0xce23('0x6'));var logger=require(_0xce23('0x7'))(_0xce23('0x8'));var config=require(_0xce23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xce23('0xa')][_0xce23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e96ca,_0xb73b6e,_0x5b9045){return new BPromise(function(_0x1dc288,_0x55f6ec){return client[_0xce23('0xc')](_0x3e96ca,_0x5b9045)[_0xce23('0xd')](function(_0x26d207){logger[_0xce23('0xe')](_0xce23('0xf'),_0xb73b6e,_0xce23('0x10'));logger[_0xce23('0x11')](_0xce23('0x12'),_0xb73b6e,'request\x20sent',JSON[_0xce23('0x13')](_0x26d207));if(_0x26d207[_0xce23('0x14')]){if(_0x26d207[_0xce23('0x14')][_0xce23('0x15')]===0x1f4){logger['error'](_0xce23('0xf'),_0xb73b6e,_0x26d207[_0xce23('0x14')][_0xce23('0x16')]);return _0x55f6ec(_0x26d207[_0xce23('0x14')][_0xce23('0x16')]);}logger[_0xce23('0x14')](_0xce23('0xf'),_0xb73b6e,_0x26d207[_0xce23('0x14')]['message']);return _0x1dc288(_0x26d207[_0xce23('0x14')][_0xce23('0x16')]);}else{logger[_0xce23('0xe')](_0xce23('0xf'),_0xb73b6e,'request\x20sent');_0x1dc288(_0x26d207[_0xce23('0x17')][_0xce23('0x16')]);}})[_0xce23('0x18')](function(_0x39b006){logger[_0xce23('0x14')](_0xce23('0xf'),_0xb73b6e,_0x39b006);_0x55f6ec(_0x39b006);});});} \ No newline at end of file +var _0x89d7=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x36fe0e,_0x635d7f){var _0x244f69=function(_0x279da5){while(--_0x279da5){_0x36fe0e['push'](_0x36fe0e['shift']());}};_0x244f69(++_0x635d7f);}(_0x89d7,0x64));var _0x789d=function(_0x18dedd,_0x4cb9e5){_0x18dedd=_0x18dedd-0x0;var _0x35b7e1=_0x89d7[_0x18dedd];return _0x35b7e1;};'use strict';var _=require('lodash');var util=require(_0x789d('0x0'));var moment=require(_0x789d('0x1'));var BPromise=require(_0x789d('0x2'));var rs=require(_0x789d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x789d('0x4'))['db'];var utils=require(_0x789d('0x5'));var logger=require(_0x789d('0x6'))(_0x789d('0x7'));var config=require(_0x789d('0x8'));var jayson=require(_0x789d('0x9'));var client=jayson[_0x789d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59dc96,_0x1c17b5,_0x20a34){return new BPromise(function(_0x2391a6,_0x4d3f78){return client[_0x789d('0xb')](_0x59dc96,_0x20a34)[_0x789d('0xc')](function(_0xd8f48){logger[_0x789d('0xd')](_0x789d('0xe'),_0x1c17b5,_0x789d('0xf'));logger[_0x789d('0x10')](_0x789d('0x11'),_0x1c17b5,'request\x20sent',JSON[_0x789d('0x12')](_0xd8f48));if(_0xd8f48['error']){if(_0xd8f48[_0x789d('0x13')]['code']===0x1f4){logger[_0x789d('0x13')](_0x789d('0xe'),_0x1c17b5,_0xd8f48[_0x789d('0x13')]['message']);return _0x4d3f78(_0xd8f48[_0x789d('0x13')][_0x789d('0x14')]);}logger['error'](_0x789d('0xe'),_0x1c17b5,_0xd8f48[_0x789d('0x13')][_0x789d('0x14')]);return _0x2391a6(_0xd8f48[_0x789d('0x13')][_0x789d('0x14')]);}else{logger[_0x789d('0xd')](_0x789d('0xe'),_0x1c17b5,_0x789d('0xf'));_0x2391a6(_0xd8f48[_0x789d('0x15')]['message']);}})[_0x789d('0x16')](function(_0x592eaa){logger[_0x789d('0x13')](_0x789d('0xe'),_0x1c17b5,_0x592eaa);_0x4d3f78(_0x592eaa);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 92bee1c..02b3d45 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 _0xfbb2=['get','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index'];(function(_0xa519c2,_0x5af9ad){var _0x4fff69=function(_0x4088ec){while(--_0x4088ec){_0xa519c2['push'](_0xa519c2['shift']());}};_0x4fff69(++_0x5af9ad);}(_0xfbb2,0x15d));var _0x2fbb=function(_0x2ddea4,_0x3b4d83){_0x2ddea4=_0x2ddea4-0x0;var _0xb3eb2=_0xfbb2[_0x2ddea4];return _0xb3eb2;};'use strict';var multer=require(_0x2fbb('0x0'));var util=require(_0x2fbb('0x1'));var path=require(_0x2fbb('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fbb('0x3'));var router=express[_0x2fbb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fbb('0x5'));var interaction=require(_0x2fbb('0x6'));var config=require(_0x2fbb('0x7'));var controller=require(_0x2fbb('0x8'));router['get']('/',auth[_0x2fbb('0x9')](),controller[_0x2fbb('0xa')]);router[_0x2fbb('0xb')](_0x2fbb('0xc'),auth[_0x2fbb('0x9')](),controller[_0x2fbb('0xd')]);router[_0x2fbb('0xb')](_0x2fbb('0xe'),auth[_0x2fbb('0x9')](),controller[_0x2fbb('0xf')]);router['get'](_0x2fbb('0x10'),auth[_0x2fbb('0x9')](),controller[_0x2fbb('0x11')]);router[_0x2fbb('0x12')]('/',auth[_0x2fbb('0x9')](),controller[_0x2fbb('0x13')]);router[_0x2fbb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2fbb('0x15')]);router[_0x2fbb('0x16')]('/:id',auth[_0x2fbb('0x9')](),controller['destroy']);module[_0x2fbb('0x17')]=router; \ No newline at end of file +var _0x4043=['../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','get','/:id','show','/:id/questions','post','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x4c473d,_0x142c2b){var _0xa69215=function(_0x540438){while(--_0x540438){_0x4c473d['push'](_0x4c473d['shift']());}};_0xa69215(++_0x142c2b);}(_0x4043,0xc0));var _0x3404=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4043[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x3404('0x0'));var util=require(_0x3404('0x1'));var path=require(_0x3404('0x2'));var timeout=require('connect-timeout');var express=require(_0x3404('0x3'));var router=express[_0x3404('0x4')]();var fs_extra=require(_0x3404('0x5'));var auth=require(_0x3404('0x6'));var interaction=require(_0x3404('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x3404('0x8')](),controller['index']);router['get'](_0x3404('0x9'),auth[_0x3404('0x8')](),controller['describe']);router[_0x3404('0xa')](_0x3404('0xb'),auth[_0x3404('0x8')](),controller[_0x3404('0xc')]);router['get'](_0x3404('0xd'),auth['isAuthenticated'](),controller['getQuestions']);router[_0x3404('0xe')]('/',auth[_0x3404('0x8')](),controller['create']);router['put'](_0x3404('0xb'),auth[_0x3404('0x8')](),controller[_0x3404('0xf')]);router[_0x3404('0x10')](_0x3404('0xb'),auth[_0x3404('0x8')](),controller[_0x3404('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a3640e8..4fa412b 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 _0x3e76=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','endtime'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0x3e76,0x1e9));var _0x63e7=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x3e76[_0x1b828b];return _0x98da1a;};'use strict';var moment=require(_0x63e7('0x0'));var Sequelize=require(_0x63e7('0x1'));module[_0x63e7('0x2')]={'starttime':{'type':Sequelize[_0x63e7('0x3')],'set':function(_0x394637){this[_0x63e7('0x4')]('starttime',_0x394637);this[_0x63e7('0x4')](_0x63e7('0x5'),moment()['format'](_0x63e7('0x6')));}},'endtime':{'type':Sequelize[_0x63e7('0x3')]},'membername':{'type':Sequelize[_0x63e7('0x7')]},'projectname':{'type':Sequelize[_0x63e7('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x63e7('0x7')]},'calleridnum':{'type':Sequelize[_0x63e7('0x7')]},'completed':{'type':Sequelize[_0x63e7('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x0278=['exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize'];(function(_0x54ca47,_0x2e0125){var _0x584e61=function(_0x2dd23a){while(--_0x2dd23a){_0x54ca47['push'](_0x54ca47['shift']());}};_0x584e61(++_0x2e0125);}(_0x0278,0x7d));var _0x8027=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x0278[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require('moment');var Sequelize=require(_0x8027('0x0'));module[_0x8027('0x1')]={'starttime':{'type':Sequelize[_0x8027('0x2')],'set':function(_0x1db1b9){this[_0x8027('0x3')]('starttime',_0x1db1b9);this[_0x8027('0x3')](_0x8027('0x4'),moment()[_0x8027('0x5')](_0x8027('0x6')));}},'endtime':{'type':Sequelize[_0x8027('0x2')]},'membername':{'type':Sequelize[_0x8027('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8027('0x7')]},'uniqueid':{'type':Sequelize[_0x8027('0x7')]},'calleridname':{'type':Sequelize[_0x8027('0x7')]},'calleridnum':{'type':Sequelize[_0x8027('0x7')]},'completed':{'type':Sequelize[_0x8027('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index bee74f1..5197e70 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 _0x289c=['SessionId','findAll','rows','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','JscriptySessionReport','count','includeAll','include','catch','show','params','merge','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport'];(function(_0x937aa9,_0x47613c){var _0x53a038=function(_0x45b3e1){while(--_0x45b3e1){_0x937aa9['push'](_0x937aa9['shift']());}};_0x53a038(++_0x47613c);}(_0x289c,0x137));var _0xc289=function(_0x1c03f9,_0x3a7b56){_0x1c03f9=_0x1c03f9-0x0;var _0x4f2135=_0x289c[_0x1c03f9];return _0x4f2135;};'use strict';var emlformat=require(_0xc289('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc289('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc289('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc289('0x3'));var util=require(_0xc289('0x4'));var path=require(_0xc289('0x5'));var sox=require(_0xc289('0x6'));var csv=require(_0xc289('0x7'));var ejs=require(_0xc289('0x8'));var fs=require('fs');var fs_extra=require(_0xc289('0x9'));var _=require(_0xc289('0xa'));var squel=require(_0xc289('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc289('0xc'));var toCsv=require(_0xc289('0x7'));var querystring=require('querystring');var Papa=require(_0xc289('0xd'));var Redis=require(_0xc289('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc289('0xf'));var as=require(_0xc289('0x10'));var hardwareService=require(_0xc289('0x11'));var logger=require(_0xc289('0x12'))(_0xc289('0x13'));var utils=require(_0xc289('0x14'));var config=require(_0xc289('0x15'));var licenseUtil=require(_0xc289('0x16'));var db=require(_0xc289('0x17'))['db'];function respondWithStatusCode(_0x33795d,_0x17b60c){_0x17b60c=_0x17b60c||0xcc;return function(_0x197d44){if(_0x197d44){return _0x33795d['sendStatus'](_0x17b60c);}return _0x33795d[_0xc289('0x18')](_0x17b60c)[_0xc289('0x19')]();};}function respondWithResult(_0xbe7850,_0xa5a88f){_0xa5a88f=_0xa5a88f||0xc8;return function(_0x148a0e){if(_0x148a0e){return _0xbe7850[_0xc289('0x18')](_0xa5a88f)['json'](_0x148a0e);}};}function respondWithFilteredResult(_0x4cd3bd,_0x354207){return function(_0x5bd2d3){if(_0x5bd2d3){var _0xc032c9=typeof _0x354207[_0xc289('0x1a')]===_0xc289('0x1b')&&typeof _0x354207[_0xc289('0x1c')]===_0xc289('0x1b');var _0x3cce81=_0x5bd2d3['count'];var _0x318507=_0xc032c9?0x0:_0x354207['offset'];var _0x2def28=_0xc032c9?_0x5bd2d3['count']:_0x354207[_0xc289('0x1a')]+_0x354207[_0xc289('0x1c')];var _0x3d40e4;if(_0x2def28>=_0x3cce81){_0x2def28=_0x3cce81;_0x3d40e4=0xc8;}else{_0x3d40e4=0xce;}_0x4cd3bd['status'](_0x3d40e4);return _0x4cd3bd[_0xc289('0x1d')](_0xc289('0x1e'),_0x318507+'-'+_0x2def28+'/'+_0x3cce81)[_0xc289('0x1f')](_0x5bd2d3);}return null;};}function patchUpdates(_0x103f0b){return function(_0x5bec3c){try{jsonpatch[_0xc289('0x20')](_0x5bec3c,_0x103f0b,!![]);}catch(_0x1dd3c1){return BPromise['reject'](_0x1dd3c1);}return _0x5bec3c[_0xc289('0x21')]();};}function saveUpdates(_0x403e25,_0x184fa8){return function(_0x28b5f7){if(_0x28b5f7){return _0x28b5f7[_0xc289('0x22')](_0x403e25)[_0xc289('0x23')](function(_0xbe37db){return _0xbe37db;});}return null;};}function removeEntity(_0x44af72,_0x4f6acd){return function(_0x4c6136){if(_0x4c6136){return _0x4c6136[_0xc289('0x24')]()[_0xc289('0x23')](function(){_0x44af72['status'](0xcc)[_0xc289('0x19')]();});}};}function handleEntityNotFound(_0x5a3b08,_0x315baf){return function(_0x1f23c2){if(!_0x1f23c2){_0x5a3b08['sendStatus'](0x194);}return _0x1f23c2;};}function handleError(_0x190c10,_0x3edac2){_0x3edac2=_0x3edac2||0x1f4;return function(_0x228796){logger['error'](_0x228796['stack']);if(_0x228796['name']){delete _0x228796[_0xc289('0x25')];}_0x190c10[_0xc289('0x18')](_0x3edac2)[_0xc289('0x26')](_0x228796);};}exports[_0xc289('0x27')]=function(_0x25fdbc,_0x14bfa9){var _0x50cf74={},_0x55cfff={},_0x58ae3b={'count':0x0,'rows':[]};var _0x3694dc=_[_0xc289('0x28')](db['JscriptySessionReport'][_0xc289('0x29')],function(_0x4b9fbd){return{'name':_0x4b9fbd['fieldName'],'type':_0x4b9fbd[_0xc289('0x2a')]['key']};});_0x55cfff[_0xc289('0x2b')]=_[_0xc289('0x28')](_0x3694dc,_0xc289('0x25'));_0x55cfff[_0xc289('0x2c')]=_[_0xc289('0x2d')](_0x25fdbc[_0xc289('0x2c')]);_0x55cfff[_0xc289('0x2e')]=_['intersection'](_0x55cfff[_0xc289('0x2b')],_0x55cfff[_0xc289('0x2c')]);_0x50cf74[_0xc289('0x2f')]=_[_0xc289('0x30')](_0x55cfff[_0xc289('0x2b')],qs['fields'](_0x25fdbc[_0xc289('0x2c')][_0xc289('0x31')]));_0x50cf74[_0xc289('0x2f')]=_0x50cf74[_0xc289('0x2f')][_0xc289('0x32')]?_0x50cf74['attributes']:_0x55cfff[_0xc289('0x2b')];if(!_0x25fdbc[_0xc289('0x2c')][_0xc289('0x33')](_0xc289('0x34'))){_0x50cf74[_0xc289('0x1c')]=qs['limit'](_0x25fdbc['query']['limit']);_0x50cf74[_0xc289('0x1a')]=qs[_0xc289('0x1a')](_0x25fdbc['query'][_0xc289('0x1a')]);}_0x50cf74[_0xc289('0x35')]=qs[_0xc289('0x36')](_0x25fdbc[_0xc289('0x2c')][_0xc289('0x36')]);_0x50cf74[_0xc289('0x37')]=qs[_0xc289('0x2e')](_[_0xc289('0x38')](_0x25fdbc[_0xc289('0x2c')],_0x55cfff[_0xc289('0x2e')]),_0x3694dc);if(_0x25fdbc[_0xc289('0x2c')]['filter']){_0x50cf74['where']=_['merge'](_0x50cf74[_0xc289('0x37')],{'$or':_[_0xc289('0x28')](_0x3694dc,function(_0x5a629c){if(_0x5a629c[_0xc289('0x2a')]!=='VIRTUAL'){var _0x14b1c4={};_0x14b1c4[_0x5a629c[_0xc289('0x25')]]={'$like':'%'+_0x25fdbc['query'][_0xc289('0x39')]+'%'};return _0x14b1c4;}})});}_0x50cf74=_['merge']({},_0x50cf74,_0x25fdbc[_0xc289('0x3a')]);var _0x134747={'where':_0x50cf74[_0xc289('0x37')]};return db[_0xc289('0x3b')][_0xc289('0x3c')](_0x134747)[_0xc289('0x23')](function(_0x38cd16){_0x58ae3b[_0xc289('0x3c')]=_0x38cd16;if(_0x25fdbc['query'][_0xc289('0x3d')]){_0x50cf74[_0xc289('0x3e')]=[{'all':!![]}];}return db[_0xc289('0x3b')]['findAll'](_0x50cf74);})[_0xc289('0x23')](function(_0x20eb01){_0x58ae3b['rows']=_0x20eb01;return _0x58ae3b;})['then'](respondWithFilteredResult(_0x14bfa9,_0x50cf74))[_0xc289('0x3f')](handleError(_0x14bfa9,null));};exports[_0xc289('0x40')]=function(_0x1b7699,_0x3445e0){var _0x41cc3d={'raw':!![],'where':{'id':_0x1b7699[_0xc289('0x41')]['id']}},_0xb95cf5={};_0xb95cf5[_0xc289('0x2b')]=_['keys'](db[_0xc289('0x3b')]['rawAttributes']);_0xb95cf5['query']=_[_0xc289('0x2d')](_0x1b7699[_0xc289('0x2c')]);_0xb95cf5[_0xc289('0x2e')]=_[_0xc289('0x30')](_0xb95cf5['model'],_0xb95cf5[_0xc289('0x2c')]);_0x41cc3d[_0xc289('0x2f')]=_[_0xc289('0x30')](_0xb95cf5['model'],qs[_0xc289('0x31')](_0x1b7699[_0xc289('0x2c')][_0xc289('0x31')]));_0x41cc3d[_0xc289('0x2f')]=_0x41cc3d['attributes'][_0xc289('0x32')]?_0x41cc3d[_0xc289('0x2f')]:_0xb95cf5[_0xc289('0x2b')];if(_0x1b7699[_0xc289('0x2c')][_0xc289('0x3d')]){_0x41cc3d[_0xc289('0x3e')]=[{'all':!![]}];}_0x41cc3d=_[_0xc289('0x42')]({},_0x41cc3d,_0x1b7699[_0xc289('0x3a')]);return db['JscriptySessionReport'][_0xc289('0x43')](_0x41cc3d)['then'](handleEntityNotFound(_0x3445e0,null))[_0xc289('0x23')](respondWithResult(_0x3445e0,null))[_0xc289('0x3f')](handleError(_0x3445e0,null));};exports[_0xc289('0x44')]=function(_0x44ce82,_0x270111){return db[_0xc289('0x3b')][_0xc289('0x44')](_0x44ce82[_0xc289('0x45')],{})[_0xc289('0x23')](respondWithResult(_0x270111,0xc9))[_0xc289('0x3f')](handleError(_0x270111,null));};exports[_0xc289('0x22')]=function(_0x41e2c8,_0x57efea){if(_0x41e2c8[_0xc289('0x45')]['id']){delete _0x41e2c8[_0xc289('0x45')]['id'];}return db[_0xc289('0x3b')][_0xc289('0x43')]({'where':{'id':_0x41e2c8[_0xc289('0x41')]['id']}})[_0xc289('0x23')](handleEntityNotFound(_0x57efea,null))[_0xc289('0x23')](saveUpdates(_0x41e2c8[_0xc289('0x45')],null))[_0xc289('0x23')](respondWithResult(_0x57efea,null))[_0xc289('0x3f')](handleError(_0x57efea,null));};exports[_0xc289('0x24')]=function(_0x1f7c29,_0x541a18){return db[_0xc289('0x3b')][_0xc289('0x43')]({'where':{'id':_0x1f7c29[_0xc289('0x41')]['id']}})[_0xc289('0x23')](handleEntityNotFound(_0x541a18,null))[_0xc289('0x23')](removeEntity(_0x541a18,null))[_0xc289('0x3f')](handleError(_0x541a18,null));};exports[_0xc289('0x46')]=function(_0x377278,_0x32fdb2){return db[_0xc289('0x3b')][_0xc289('0x46')]()[_0xc289('0x23')](respondWithResult(_0x32fdb2,null))[_0xc289('0x3f')](handleError(_0x32fdb2,null));};exports[_0xc289('0x47')]=function(_0x12daf6,_0xd9caad,_0x542923){var _0x391214={'raw':!![],'where':{}};var _0x523ea4={};var _0x36ccff={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xc289('0x48')]({'where':{'id':_0x12daf6[_0xc289('0x41')]['id']}})[_0xc289('0x23')](handleEntityNotFound(_0xd9caad,null))[_0xc289('0x23')](function(_0x350fa8){if(_0x350fa8){_0x523ea4[_0xc289('0x2b')]=_[_0xc289('0x2d')](db[_0xc289('0x49')][_0xc289('0x29')]);_0x523ea4[_0xc289('0x2c')]=_['keys'](_0x12daf6[_0xc289('0x2c')]);_0x523ea4[_0xc289('0x2e')]=_[_0xc289('0x30')](_0x523ea4['model'],_0x523ea4[_0xc289('0x2c')]);_0x391214[_0xc289('0x2f')]=_[_0xc289('0x30')](_0x523ea4['model'],qs[_0xc289('0x31')](_0x12daf6[_0xc289('0x2c')][_0xc289('0x31')]));_0x391214[_0xc289('0x2f')]=_0x391214[_0xc289('0x2f')][_0xc289('0x32')]?_0x391214['attributes']:_0x523ea4[_0xc289('0x2b')];if(!_0x12daf6['query'][_0xc289('0x33')]('nolimit')){_0x391214['limit']=qs[_0xc289('0x1c')](_0x12daf6[_0xc289('0x2c')][_0xc289('0x1c')]);_0x391214[_0xc289('0x1a')]=qs[_0xc289('0x1a')](_0x12daf6[_0xc289('0x2c')][_0xc289('0x1a')]);}_0x391214['order']=qs[_0xc289('0x36')](_0x12daf6[_0xc289('0x2c')][_0xc289('0x36')]);_0x391214[_0xc289('0x37')]=qs['filters'](_[_0xc289('0x38')](_0x12daf6[_0xc289('0x2c')],_0x523ea4[_0xc289('0x2e')]));_0x391214[_0xc289('0x37')][_0xc289('0x4a')]=_0x350fa8['id'];if(_0x12daf6['query'][_0xc289('0x39')]){_0x391214[_0xc289('0x37')]=_[_0xc289('0x42')](_0x391214[_0xc289('0x37')],{'$or':_['map'](_0x391214['attributes'],function(_0x499998){var _0x2ab4e4={};_0x2ab4e4[_0x499998]={'$like':'%'+_0x12daf6[_0xc289('0x2c')][_0xc289('0x39')]+'%'};return _0x2ab4e4;})});}_0x391214=_[_0xc289('0x42')]({},_0x391214,_0x12daf6[_0xc289('0x3a')]);return db['JscriptyQuestionReport'][_0xc289('0x3c')]({'where':_0x391214['where']})['then'](function(_0x27ec23){_0x36ccff[_0xc289('0x3c')]=_0x27ec23;if(_0x12daf6['query'][_0xc289('0x3d')]){_0x391214[_0xc289('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xc289('0x4b')](_0x391214);})[_0xc289('0x23')](function(_0x4ba004){_0x36ccff[_0xc289('0x4c')]=_0x4ba004;return _0x36ccff;});}})[_0xc289('0x23')](respondWithFilteredResult(_0xd9caad,_0x391214))['catch'](handleError(_0xd9caad,null));}; \ No newline at end of file +var _0x71f7=['querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','sendStatus','error','name','index','JscriptySessionReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','params','merge','find','catch','create','body','describe','getQuestions','findOne','pick','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0x71f7,0x15e));var _0x771f=function(_0x578401,_0x475b45){_0x578401=_0x578401-0x0;var _0x2fa622=_0x71f7[_0x578401];return _0x2fa622;};'use strict';var emlformat=require(_0x771f('0x0'));var rimraf=require(_0x771f('0x1'));var zipdir=require(_0x771f('0x2'));var jsonpatch=require(_0x771f('0x3'));var rp=require(_0x771f('0x4'));var moment=require(_0x771f('0x5'));var BPromise=require(_0x771f('0x6'));var Mustache=require(_0x771f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x771f('0x8'));var csv=require(_0x771f('0x9'));var ejs=require(_0x771f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x771f('0xb'));var squel=require(_0x771f('0xc'));var crypto=require(_0x771f('0xd'));var jsforce=require(_0x771f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x771f('0xf'));var Papa=require(_0x771f('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(_0x771f('0x11'))(_0x771f('0x12'));var utils=require(_0x771f('0x13'));var config=require(_0x771f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x771f('0x15'))['db'];function respondWithStatusCode(_0x217678,_0x287f77){_0x287f77=_0x287f77||0xcc;return function(_0x479d29){if(_0x479d29){return _0x217678['sendStatus'](_0x287f77);}return _0x217678[_0x771f('0x16')](_0x287f77)['end']();};}function respondWithResult(_0x3bbe6a,_0x40122f){_0x40122f=_0x40122f||0xc8;return function(_0x2826e2){if(_0x2826e2){return _0x3bbe6a[_0x771f('0x16')](_0x40122f)['json'](_0x2826e2);}};}function respondWithFilteredResult(_0x56af52,_0x530fb8){return function(_0x2101bf){if(_0x2101bf){var _0x59bb25=typeof _0x530fb8[_0x771f('0x17')]===_0x771f('0x18')&&typeof _0x530fb8[_0x771f('0x19')]==='undefined';var _0x233778=_0x2101bf['count'];var _0x137aec=_0x59bb25?0x0:_0x530fb8[_0x771f('0x17')];var _0x883bd4=_0x59bb25?_0x2101bf[_0x771f('0x1a')]:_0x530fb8['offset']+_0x530fb8[_0x771f('0x19')];var _0x38b588;if(_0x883bd4>=_0x233778){_0x883bd4=_0x233778;_0x38b588=0xc8;}else{_0x38b588=0xce;}_0x56af52[_0x771f('0x16')](_0x38b588);return _0x56af52[_0x771f('0x1b')]('Content-Range',_0x137aec+'-'+_0x883bd4+'/'+_0x233778)[_0x771f('0x1c')](_0x2101bf);}return null;};}function patchUpdates(_0x5b6f35){return function(_0x49c293){try{jsonpatch[_0x771f('0x1d')](_0x49c293,_0x5b6f35,!![]);}catch(_0x4c7fdc){return BPromise['reject'](_0x4c7fdc);}return _0x49c293[_0x771f('0x1e')]();};}function saveUpdates(_0x4af77c,_0x5003bc){return function(_0x34ca57){if(_0x34ca57){return _0x34ca57[_0x771f('0x1f')](_0x4af77c)[_0x771f('0x20')](function(_0xc8075c){return _0xc8075c;});}return null;};}function removeEntity(_0x5aafb4,_0x55617a){return function(_0xed103a){if(_0xed103a){return _0xed103a[_0x771f('0x21')]()[_0x771f('0x20')](function(){_0x5aafb4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfaea7,_0x505a53){return function(_0x4aeea2){if(!_0x4aeea2){_0xfaea7[_0x771f('0x22')](0x194);}return _0x4aeea2;};}function handleError(_0x17cf97,_0x3b5fd4){_0x3b5fd4=_0x3b5fd4||0x1f4;return function(_0x2a9392){logger[_0x771f('0x23')](_0x2a9392['stack']);if(_0x2a9392[_0x771f('0x24')]){delete _0x2a9392[_0x771f('0x24')];}_0x17cf97[_0x771f('0x16')](_0x3b5fd4)['send'](_0x2a9392);};}exports[_0x771f('0x25')]=function(_0x31b6f5,_0x28d014){var _0x134994={},_0x357629={},_0x2289d9={'count':0x0,'rows':[]};var _0x41387b=_['map'](db[_0x771f('0x26')][_0x771f('0x27')],function(_0x51a17f){return{'name':_0x51a17f['fieldName'],'type':_0x51a17f[_0x771f('0x28')][_0x771f('0x29')]};});_0x357629[_0x771f('0x2a')]=_[_0x771f('0x2b')](_0x41387b,_0x771f('0x24'));_0x357629[_0x771f('0x2c')]=_[_0x771f('0x2d')](_0x31b6f5['query']);_0x357629[_0x771f('0x2e')]=_[_0x771f('0x2f')](_0x357629['model'],_0x357629[_0x771f('0x2c')]);_0x134994[_0x771f('0x30')]=_[_0x771f('0x2f')](_0x357629[_0x771f('0x2a')],qs[_0x771f('0x31')](_0x31b6f5[_0x771f('0x2c')][_0x771f('0x31')]));_0x134994['attributes']=_0x134994[_0x771f('0x30')][_0x771f('0x32')]?_0x134994[_0x771f('0x30')]:_0x357629['model'];if(!_0x31b6f5[_0x771f('0x2c')][_0x771f('0x33')](_0x771f('0x34'))){_0x134994[_0x771f('0x19')]=qs['limit'](_0x31b6f5[_0x771f('0x2c')][_0x771f('0x19')]);_0x134994[_0x771f('0x17')]=qs['offset'](_0x31b6f5[_0x771f('0x2c')]['offset']);}_0x134994[_0x771f('0x35')]=qs[_0x771f('0x36')](_0x31b6f5[_0x771f('0x2c')][_0x771f('0x36')]);_0x134994[_0x771f('0x37')]=qs[_0x771f('0x2e')](_['pick'](_0x31b6f5[_0x771f('0x2c')],_0x357629[_0x771f('0x2e')]),_0x41387b);if(_0x31b6f5[_0x771f('0x2c')][_0x771f('0x38')]){_0x134994[_0x771f('0x37')]=_['merge'](_0x134994['where'],{'$or':_['map'](_0x41387b,function(_0x4c22d9){if(_0x4c22d9[_0x771f('0x28')]!==_0x771f('0x39')){var _0x1c2be9={};_0x1c2be9[_0x4c22d9[_0x771f('0x24')]]={'$like':'%'+_0x31b6f5[_0x771f('0x2c')][_0x771f('0x38')]+'%'};return _0x1c2be9;}})});}_0x134994=_['merge']({},_0x134994,_0x31b6f5[_0x771f('0x3a')]);var _0x1395a9={'where':_0x134994[_0x771f('0x37')]};return db['JscriptySessionReport'][_0x771f('0x1a')](_0x1395a9)[_0x771f('0x20')](function(_0x543cdd){_0x2289d9[_0x771f('0x1a')]=_0x543cdd;if(_0x31b6f5['query'][_0x771f('0x3b')]){_0x134994['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x771f('0x3c')](_0x134994);})[_0x771f('0x20')](function(_0x44a5f9){_0x2289d9[_0x771f('0x3d')]=_0x44a5f9;return _0x2289d9;})['then'](respondWithFilteredResult(_0x28d014,_0x134994))['catch'](handleError(_0x28d014,null));};exports['show']=function(_0x239923,_0x27b6cd){var _0x6829b3={'raw':!![],'where':{'id':_0x239923[_0x771f('0x3e')]['id']}},_0xb6021={};_0xb6021[_0x771f('0x2a')]=_[_0x771f('0x2d')](db[_0x771f('0x26')][_0x771f('0x27')]);_0xb6021[_0x771f('0x2c')]=_['keys'](_0x239923[_0x771f('0x2c')]);_0xb6021[_0x771f('0x2e')]=_['intersection'](_0xb6021[_0x771f('0x2a')],_0xb6021[_0x771f('0x2c')]);_0x6829b3['attributes']=_[_0x771f('0x2f')](_0xb6021[_0x771f('0x2a')],qs[_0x771f('0x31')](_0x239923[_0x771f('0x2c')][_0x771f('0x31')]));_0x6829b3[_0x771f('0x30')]=_0x6829b3[_0x771f('0x30')][_0x771f('0x32')]?_0x6829b3[_0x771f('0x30')]:_0xb6021[_0x771f('0x2a')];if(_0x239923[_0x771f('0x2c')][_0x771f('0x3b')]){_0x6829b3['include']=[{'all':!![]}];}_0x6829b3=_[_0x771f('0x3f')]({},_0x6829b3,_0x239923['options']);return db['JscriptySessionReport'][_0x771f('0x40')](_0x6829b3)['then'](handleEntityNotFound(_0x27b6cd,null))['then'](respondWithResult(_0x27b6cd,null))[_0x771f('0x41')](handleError(_0x27b6cd,null));};exports['create']=function(_0x9b4435,_0xfcead1){return db['JscriptySessionReport'][_0x771f('0x42')](_0x9b4435['body'],{})[_0x771f('0x20')](respondWithResult(_0xfcead1,0xc9))[_0x771f('0x41')](handleError(_0xfcead1,null));};exports['update']=function(_0x1c5afd,_0xc6c148){if(_0x1c5afd[_0x771f('0x43')]['id']){delete _0x1c5afd[_0x771f('0x43')]['id'];}return db['JscriptySessionReport'][_0x771f('0x40')]({'where':{'id':_0x1c5afd[_0x771f('0x3e')]['id']}})[_0x771f('0x20')](handleEntityNotFound(_0xc6c148,null))[_0x771f('0x20')](saveUpdates(_0x1c5afd[_0x771f('0x43')],null))[_0x771f('0x20')](respondWithResult(_0xc6c148,null))['catch'](handleError(_0xc6c148,null));};exports['destroy']=function(_0x29368f,_0x3f37d2){return db['JscriptySessionReport']['find']({'where':{'id':_0x29368f[_0x771f('0x3e')]['id']}})[_0x771f('0x20')](handleEntityNotFound(_0x3f37d2,null))[_0x771f('0x20')](removeEntity(_0x3f37d2,null))[_0x771f('0x41')](handleError(_0x3f37d2,null));};exports[_0x771f('0x44')]=function(_0x109432,_0x274e33){return db['JscriptySessionReport'][_0x771f('0x44')]()[_0x771f('0x20')](respondWithResult(_0x274e33,null))[_0x771f('0x41')](handleError(_0x274e33,null));};exports[_0x771f('0x45')]=function(_0x166bda,_0x51dc9b,_0x5415c8){var _0x4a6a35={'raw':!![],'where':{}};var _0x555830={};var _0xc7462={'count':0x0,'rows':[]};return db[_0x771f('0x26')][_0x771f('0x46')]({'where':{'id':_0x166bda[_0x771f('0x3e')]['id']}})[_0x771f('0x20')](handleEntityNotFound(_0x51dc9b,null))[_0x771f('0x20')](function(_0x286fbb){if(_0x286fbb){_0x555830['model']=_['keys'](db['JscriptyQuestionReport'][_0x771f('0x27')]);_0x555830['query']=_[_0x771f('0x2d')](_0x166bda[_0x771f('0x2c')]);_0x555830[_0x771f('0x2e')]=_[_0x771f('0x2f')](_0x555830[_0x771f('0x2a')],_0x555830[_0x771f('0x2c')]);_0x4a6a35[_0x771f('0x30')]=_['intersection'](_0x555830[_0x771f('0x2a')],qs[_0x771f('0x31')](_0x166bda[_0x771f('0x2c')][_0x771f('0x31')]));_0x4a6a35[_0x771f('0x30')]=_0x4a6a35['attributes'][_0x771f('0x32')]?_0x4a6a35['attributes']:_0x555830[_0x771f('0x2a')];if(!_0x166bda[_0x771f('0x2c')][_0x771f('0x33')](_0x771f('0x34'))){_0x4a6a35[_0x771f('0x19')]=qs[_0x771f('0x19')](_0x166bda['query']['limit']);_0x4a6a35[_0x771f('0x17')]=qs[_0x771f('0x17')](_0x166bda[_0x771f('0x2c')]['offset']);}_0x4a6a35[_0x771f('0x35')]=qs[_0x771f('0x36')](_0x166bda['query'][_0x771f('0x36')]);_0x4a6a35[_0x771f('0x37')]=qs[_0x771f('0x2e')](_[_0x771f('0x47')](_0x166bda['query'],_0x555830[_0x771f('0x2e')]));_0x4a6a35[_0x771f('0x37')]['SessionId']=_0x286fbb['id'];if(_0x166bda[_0x771f('0x2c')][_0x771f('0x38')]){_0x4a6a35[_0x771f('0x37')]=_[_0x771f('0x3f')](_0x4a6a35[_0x771f('0x37')],{'$or':_[_0x771f('0x2b')](_0x4a6a35['attributes'],function(_0x3717cd){var _0x7d5a41={};_0x7d5a41[_0x3717cd]={'$like':'%'+_0x166bda[_0x771f('0x2c')][_0x771f('0x38')]+'%'};return _0x7d5a41;})});}_0x4a6a35=_[_0x771f('0x3f')]({},_0x4a6a35,_0x166bda[_0x771f('0x3a')]);return db[_0x771f('0x48')][_0x771f('0x1a')]({'where':_0x4a6a35[_0x771f('0x37')]})['then'](function(_0x1546af){_0xc7462[_0x771f('0x1a')]=_0x1546af;if(_0x166bda[_0x771f('0x2c')][_0x771f('0x3b')]){_0x4a6a35['include']=[{'all':!![]}];}return db[_0x771f('0x48')]['findAll'](_0x4a6a35);})[_0x771f('0x20')](function(_0x55bf20){_0xc7462['rows']=_0x55bf20;return _0xc7462;});}})[_0x771f('0x20')](respondWithFilteredResult(_0x51dc9b,_0x4a6a35))[_0x771f('0x41')](handleError(_0x51dc9b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index dfc6a83..fc53ef1 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0xe5088b,_0x21f295){var _0x7ff7f5=function(_0x5de49b){while(--_0x5de49b){_0xe5088b['push'](_0xe5088b['shift']());}};_0x7ff7f5(++_0x21f295);}(_0x3831,0x14c));var _0x1383=function(_0x4814a7,_0x1a084d){_0x4814a7=_0x4814a7-0x0;var _0x406700=_0x3831[_0x4814a7];return _0x406700;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3baf=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3baf,0xf7));var _0xf3ba=function(_0x591e93,_0x2cdfb6){_0x591e93=_0x591e93-0x0;var _0x369ab0=_0x3baf[_0x591e93];return _0x369ab0;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var fs=require('fs');var path=require(_0xf3ba('0x7'));var rimraf=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var attributes=require(_0xf3ba('0xa'));module[_0xf3ba('0xb')]=function(_0x475268,_0x2e6df2){return _0x475268[_0xf3ba('0xc')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','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 639e539..c896245 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 _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xacf4,0xe7));var _0x4acf=function(_0x153da7,_0x419ee8){_0x153da7=_0x153da7-0x0;var _0x41e944=_0xacf4[_0x153da7];return _0x41e944;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x3f5257,_0x58379d){var _0x28cf08=function(_0x3af40a){while(--_0x3af40a){_0x3f5257['push'](_0x3f5257['shift']());}};_0x28cf08(++_0x58379d);}(_0xba34,0x119));var _0x4ba3=function(_0x15bc85,_0x45d61f){_0x15bc85=_0x15bc85-0x0;var _0x5b5f57=_0xba34[_0x15bc85];return _0x5b5f57;};'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 diff --git a/server/api/license/index.js b/server/api/license/index.js index cf9392f..e6ebc78 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 _0xdb7c=['/download_log_file','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update'];(function(_0x1df685,_0x128685){var _0x5740f3=function(_0x28f6d3){while(--_0x28f6d3){_0x1df685['push'](_0x1df685['shift']());}};_0x5740f3(++_0x128685);}(_0xdb7c,0xac));var _0xcdb7=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0xdb7c[_0x26cd05];return _0x3e13b9;};'use strict';var multer=require('multer');var util=require(_0xcdb7('0x0'));var path=require(_0xcdb7('0x1'));var timeout=require('connect-timeout');var express=require(_0xcdb7('0x2'));var router=express[_0xcdb7('0x3')]();var fs_extra=require(_0xcdb7('0x4'));var auth=require(_0xcdb7('0x5'));var interaction=require(_0xcdb7('0x6'));var config=require(_0xcdb7('0x7'));var controller=require(_0xcdb7('0x8'));router[_0xcdb7('0x9')]('/',controller[_0xcdb7('0xa')]);router[_0xcdb7('0xb')](_0xcdb7('0xc'),auth[_0xcdb7('0xd')](),controller[_0xcdb7('0xe')]);router[_0xcdb7('0x9')](_0xcdb7('0xf'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0xcdb7('0x10')]=router; \ No newline at end of file +var _0xefef=['downloadLogFile','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','/download_log_file'];(function(_0x32cfea,_0x5ae1bc){var _0x2e8137=function(_0x3a73a0){while(--_0x3a73a0){_0x32cfea['push'](_0x32cfea['shift']());}};_0x2e8137(++_0x5ae1bc);}(_0xefef,0xc5));var _0xfefe=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0xefef[_0x1034ca];return _0x1a023a;};'use strict';var multer=require(_0xfefe('0x0'));var util=require('util');var path=require(_0xfefe('0x1'));var timeout=require(_0xfefe('0x2'));var express=require(_0xfefe('0x3'));var router=express['Router']();var fs_extra=require(_0xfefe('0x4'));var auth=require(_0xfefe('0x5'));var interaction=require(_0xfefe('0x6'));var config=require(_0xfefe('0x7'));var controller=require(_0xfefe('0x8'));router[_0xfefe('0x9')]('/',controller['index']);router[_0xfefe('0xa')](_0xfefe('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfefe('0x9')](_0xfefe('0xc'),auth['isAuthenticated'](),controller[_0xfefe('0xd')]);module[_0xfefe('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ad94937..434772b 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 _0x7199=['TEXT','STRING','INTEGER','exports'];(function(_0x4f6ffd,_0x316dd8){var _0x34a32e=function(_0x386980){while(--_0x386980){_0x4f6ffd['push'](_0x4f6ffd['shift']());}};_0x34a32e(++_0x316dd8);}(_0x7199,0x1cf));var _0x9719=function(_0x409e33,_0x5eef26){_0x409e33=_0x409e33-0x0;var _0x1d77aa=_0x7199[_0x409e33];return _0x1d77aa;};'use strict';var Sequelize=require('sequelize');module[_0x9719('0x0')]={'license':{'type':Sequelize[_0x9719('0x1')]},'data1':{'type':Sequelize[_0x9719('0x2')]},'data2':{'type':Sequelize[_0x9719('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x9719('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b85=['TEXT','STRING','sequelize','exports'];(function(_0x4cb086,_0x4cc048){var _0x10d1af=function(_0x296e16){while(--_0x296e16){_0x4cb086['push'](_0x4cb086['shift']());}};_0x10d1af(++_0x4cc048);}(_0x0b85,0x86));var _0x50b8=function(_0x2b3496,_0x519e7e){_0x2b3496=_0x2b3496-0x0;var _0xeb8ebc=_0x0b85[_0x2b3496];return _0xeb8ebc;};'use strict';var Sequelize=require(_0x50b8('0x0'));module[_0x50b8('0x1')]={'license':{'type':Sequelize[_0x50b8('0x2')]},'data1':{'type':Sequelize[_0x50b8('0x3')]},'data2':{'type':Sequelize[_0x50b8('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index a0f93f2..3908a6c 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 _0x75b4=['attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','catch','body','find','params','get','checkLicense','key','demo','license-info.log','join','/var','log','xcally','setHeader','Content-disposition'];(function(_0x1f611e,_0xc001d2){var _0x52e5f5=function(_0x199680){while(--_0x199680){_0x1f611e['push'](_0x1f611e['shift']());}};_0x52e5f5(++_0xc001d2);}(_0x75b4,0x1c0));var _0x475b=function(_0x211166,_0x294949){_0x211166=_0x211166-0x0;var _0x1b081c=_0x75b4[_0x211166];return _0x1b081c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x475b('0x0'));var zipdir=require(_0x475b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x475b('0x2'));var moment=require(_0x475b('0x3'));var BPromise=require(_0x475b('0x4'));var Mustache=require(_0x475b('0x5'));var util=require(_0x475b('0x6'));var path=require(_0x475b('0x7'));var sox=require(_0x475b('0x8'));var csv=require(_0x475b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x475b('0xa'));var _=require(_0x475b('0xb'));var squel=require(_0x475b('0xc'));var crypto=require(_0x475b('0xd'));var jsforce=require(_0x475b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x475b('0x9'));var querystring=require('querystring');var Papa=require(_0x475b('0xf'));var Redis=require(_0x475b('0x10'));var authService=require(_0x475b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x475b('0x12'));var hardwareService=require(_0x475b('0x13'));var logger=require('../../config/logger')(_0x475b('0x14'));var utils=require(_0x475b('0x15'));var config=require(_0x475b('0x16'));var licenseUtil=require(_0x475b('0x17'));var db=require(_0x475b('0x18'))['db'];function respondWithStatusCode(_0x5a6852,_0xf967c6){_0xf967c6=_0xf967c6||0xcc;return function(_0x2da79a){if(_0x2da79a){return _0x5a6852[_0x475b('0x19')](_0xf967c6);}return _0x5a6852['status'](_0xf967c6)[_0x475b('0x1a')]();};}function respondWithResult(_0x21eec5,_0x235201){_0x235201=_0x235201||0xc8;return function(_0x45ad5e){if(_0x45ad5e){return _0x21eec5['status'](_0x235201)['json'](_0x45ad5e);}};}function respondWithFilteredResult(_0xce6057,_0x429b47){return function(_0x3546c1){if(_0x3546c1){var _0x439c13=typeof _0x429b47[_0x475b('0x1b')]===_0x475b('0x1c')&&typeof _0x429b47[_0x475b('0x1d')]===_0x475b('0x1c');var _0x2ed04b=_0x3546c1['count'];var _0x258b8b=_0x439c13?0x0:_0x429b47['offset'];var _0x89174e=_0x439c13?_0x3546c1[_0x475b('0x1e')]:_0x429b47[_0x475b('0x1b')]+_0x429b47['limit'];var _0x4da33f;if(_0x89174e>=_0x2ed04b){_0x89174e=_0x2ed04b;_0x4da33f=0xc8;}else{_0x4da33f=0xce;}_0xce6057[_0x475b('0x1f')](_0x4da33f);return _0xce6057[_0x475b('0x20')](_0x475b('0x21'),_0x258b8b+'-'+_0x89174e+'/'+_0x2ed04b)[_0x475b('0x22')](_0x3546c1);}return null;};}function patchUpdates(_0x332516){return function(_0x3b6f92){try{jsonpatch[_0x475b('0x23')](_0x3b6f92,_0x332516,!![]);}catch(_0x245aa4){return BPromise[_0x475b('0x24')](_0x245aa4);}return _0x3b6f92[_0x475b('0x25')]();};}function saveUpdates(_0x3a4277,_0xab895d){return function(_0xd26715){if(_0xd26715){return _0xd26715[_0x475b('0x26')](_0x3a4277)[_0x475b('0x27')](function(_0x4e897e){return _0x4e897e;});}return null;};}function removeEntity(_0x5a5a60,_0x184db7){return function(_0x1856b8){if(_0x1856b8){return _0x1856b8[_0x475b('0x28')]()[_0x475b('0x27')](function(){_0x5a5a60[_0x475b('0x1f')](0xcc)[_0x475b('0x1a')]();});}};}function handleEntityNotFound(_0x3915b7,_0x4af82a){return function(_0x19f5df){if(!_0x19f5df){_0x3915b7[_0x475b('0x19')](0x194);}return _0x19f5df;};}function handleError(_0x171d50,_0x11f9e9){_0x11f9e9=_0x11f9e9||0x1f4;return function(_0x5a7527){logger[_0x475b('0x29')](_0x5a7527[_0x475b('0x2a')]);if(_0x5a7527[_0x475b('0x2b')]){delete _0x5a7527[_0x475b('0x2b')];}_0x171d50['status'](_0x11f9e9)[_0x475b('0x2c')](_0x5a7527);};}var utilLicense=require(_0x475b('0x17'));exports[_0x475b('0x2d')]=function(_0x407bc1,_0x5e7710){var _0x2d2de8={'raw':!![],'where':{'id':0x1}},_0x140728={};_0x140728[_0x475b('0x2e')]=_[_0x475b('0x2f')](db['License'][_0x475b('0x30')]);_0x140728[_0x475b('0x31')]=_[_0x475b('0x2f')](_0x407bc1['query']);_0x140728[_0x475b('0x32')]=_[_0x475b('0x33')](_0x140728[_0x475b('0x2e')],_0x140728['query']);_0x2d2de8[_0x475b('0x34')]=_['intersection'](_0x140728['model'],qs[_0x475b('0x35')](_0x407bc1[_0x475b('0x31')][_0x475b('0x35')]));_0x2d2de8[_0x475b('0x34')]=_0x2d2de8[_0x475b('0x34')][_0x475b('0x36')]?_0x2d2de8[_0x475b('0x34')]:_0x140728[_0x475b('0x2e')];_0x2d2de8=_['merge']({},_0x2d2de8,_0x407bc1['options']);return utilLicense['getLicense'](_0x2d2de8)[_0x475b('0x27')](respondWithResult(_0x5e7710,null))[_0x475b('0x37')](handleError(_0x5e7710,null));};exports[_0x475b('0x26')]=function(_0x6aa868,_0x38c54d){if(_0x6aa868[_0x475b('0x38')]['id']){delete _0x6aa868['body']['id'];}return db['License'][_0x475b('0x39')]({'where':{'id':_0x6aa868[_0x475b('0x3a')]['id']}})[_0x475b('0x27')](handleEntityNotFound(_0x38c54d,null))[_0x475b('0x27')](function(_0x24ea75){var _0x3f2426=_0x24ea75[_0x475b('0x3b')]({'plain':!![]});return utilLicense[_0x475b('0x3c')](_0x3f2426,_0x6aa868['body'][_0x475b('0x3d')]);})['then'](function(_0x26a65b){if(!_0x26a65b[_0x475b('0x3e')]){return saveUpdates(_0x6aa868['body'],null);}return _0x26a65b;})[_0x475b('0x27')](respondWithResult(_0x38c54d,null))[_0x475b('0x37')](handleError(_0x38c54d,null));};exports['downloadLogFile']=function(_0x1f120f,_0x4fa515){var _0x20248f=_0x475b('0x3f');var _0x233e95=path[_0x475b('0x40')](_0x475b('0x41'),_0x475b('0x42'),_0x475b('0x43'),_0x20248f);_0x4fa515[_0x475b('0x44')](_0x475b('0x45'),_0x475b('0x46')+_0x20248f);_0x4fa515['set'](_0x475b('0x47'),_0x475b('0x48'));_0x4fa515[_0x475b('0x49')](_0x233e95);}; \ No newline at end of file +var _0xd1be=['end','json','offset','undefined','count','limit','set','Content-Range','apply','update','error','stack','name','index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','length','merge','options','then','catch','body','find','params','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','Content-Type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x277e71,_0x16a16f){var _0x5d2d6a=function(_0x356783){while(--_0x356783){_0x277e71['push'](_0x277e71['shift']());}};_0x5d2d6a(++_0x16a16f);}(_0xd1be,0x139));var _0xed1b=function(_0x239193,_0x1585ef){_0x239193=_0x239193-0x0;var _0x4f51c3=_0xd1be[_0x239193];return _0x4f51c3;};'use strict';var emlformat=require(_0xed1b('0x0'));var rimraf=require(_0xed1b('0x1'));var zipdir=require(_0xed1b('0x2'));var jsonpatch=require(_0xed1b('0x3'));var rp=require(_0xed1b('0x4'));var moment=require(_0xed1b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xed1b('0x6'));var util=require(_0xed1b('0x7'));var path=require(_0xed1b('0x8'));var sox=require(_0xed1b('0x9'));var csv=require(_0xed1b('0xa'));var ejs=require(_0xed1b('0xb'));var fs=require('fs');var fs_extra=require(_0xed1b('0xc'));var _=require('lodash');var squel=require(_0xed1b('0xd'));var crypto=require('crypto');var jsforce=require(_0xed1b('0xe'));var deskjs=require(_0xed1b('0xf'));var toCsv=require(_0xed1b('0xa'));var querystring=require('querystring');var Papa=require(_0xed1b('0x10'));var Redis=require(_0xed1b('0x11'));var authService=require(_0xed1b('0x12'));var qs=require(_0xed1b('0x13'));var as=require(_0xed1b('0x14'));var hardwareService=require(_0xed1b('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xed1b('0x16'));var config=require(_0xed1b('0x17'));var licenseUtil=require(_0xed1b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1531d4,_0x55775c){_0x55775c=_0x55775c||0xcc;return function(_0x1ac356){if(_0x1ac356){return _0x1531d4[_0xed1b('0x19')](_0x55775c);}return _0x1531d4[_0xed1b('0x1a')](_0x55775c)[_0xed1b('0x1b')]();};}function respondWithResult(_0x3dff01,_0x410db8){_0x410db8=_0x410db8||0xc8;return function(_0x4ccb1c){if(_0x4ccb1c){return _0x3dff01[_0xed1b('0x1a')](_0x410db8)[_0xed1b('0x1c')](_0x4ccb1c);}};}function respondWithFilteredResult(_0x2e0d08,_0x10e9a5){return function(_0x548e24){if(_0x548e24){var _0x430390=typeof _0x10e9a5[_0xed1b('0x1d')]===_0xed1b('0x1e')&&typeof _0x10e9a5['limit']===_0xed1b('0x1e');var _0x347879=_0x548e24[_0xed1b('0x1f')];var _0x314bc7=_0x430390?0x0:_0x10e9a5[_0xed1b('0x1d')];var _0x4742b4=_0x430390?_0x548e24[_0xed1b('0x1f')]:_0x10e9a5['offset']+_0x10e9a5[_0xed1b('0x20')];var _0x42141a;if(_0x4742b4>=_0x347879){_0x4742b4=_0x347879;_0x42141a=0xc8;}else{_0x42141a=0xce;}_0x2e0d08[_0xed1b('0x1a')](_0x42141a);return _0x2e0d08[_0xed1b('0x21')](_0xed1b('0x22'),_0x314bc7+'-'+_0x4742b4+'/'+_0x347879)['json'](_0x548e24);}return null;};}function patchUpdates(_0x3d1f83){return function(_0x3e241b){try{jsonpatch[_0xed1b('0x23')](_0x3e241b,_0x3d1f83,!![]);}catch(_0x2928e1){return BPromise['reject'](_0x2928e1);}return _0x3e241b['save']();};}function saveUpdates(_0x45857e,_0x55c3a8){return function(_0x4ca5c8){if(_0x4ca5c8){return _0x4ca5c8[_0xed1b('0x24')](_0x45857e)['then'](function(_0xf4b99){return _0xf4b99;});}return null;};}function removeEntity(_0x3bf37a,_0x47145c){return function(_0x5ac8f9){if(_0x5ac8f9){return _0x5ac8f9['destroy']()['then'](function(){_0x3bf37a[_0xed1b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e7c4,_0xce9dbd){return function(_0x2e820a){if(!_0x2e820a){_0x36e7c4[_0xed1b('0x19')](0x194);}return _0x2e820a;};}function handleError(_0x48a90a,_0x44558f){_0x44558f=_0x44558f||0x1f4;return function(_0x2eacd8){logger[_0xed1b('0x25')](_0x2eacd8[_0xed1b('0x26')]);if(_0x2eacd8['name']){delete _0x2eacd8[_0xed1b('0x27')];}_0x48a90a[_0xed1b('0x1a')](_0x44558f)['send'](_0x2eacd8);};}var utilLicense=require(_0xed1b('0x18'));exports[_0xed1b('0x28')]=function(_0x4d8536,_0x2b8142){var _0x43e03e={'raw':!![],'where':{'id':0x1}},_0x4248c5={};_0x4248c5['model']=_[_0xed1b('0x29')](db[_0xed1b('0x2a')][_0xed1b('0x2b')]);_0x4248c5[_0xed1b('0x2c')]=_[_0xed1b('0x29')](_0x4d8536[_0xed1b('0x2c')]);_0x4248c5[_0xed1b('0x2d')]=_[_0xed1b('0x2e')](_0x4248c5[_0xed1b('0x2f')],_0x4248c5[_0xed1b('0x2c')]);_0x43e03e[_0xed1b('0x30')]=_['intersection'](_0x4248c5[_0xed1b('0x2f')],qs['fields'](_0x4d8536[_0xed1b('0x2c')][_0xed1b('0x31')]));_0x43e03e['attributes']=_0x43e03e[_0xed1b('0x30')][_0xed1b('0x32')]?_0x43e03e['attributes']:_0x4248c5[_0xed1b('0x2f')];_0x43e03e=_[_0xed1b('0x33')]({},_0x43e03e,_0x4d8536[_0xed1b('0x34')]);return utilLicense['getLicense'](_0x43e03e)[_0xed1b('0x35')](respondWithResult(_0x2b8142,null))[_0xed1b('0x36')](handleError(_0x2b8142,null));};exports[_0xed1b('0x24')]=function(_0x45caa7,_0x2847fe){if(_0x45caa7[_0xed1b('0x37')]['id']){delete _0x45caa7[_0xed1b('0x37')]['id'];}return db['License'][_0xed1b('0x38')]({'where':{'id':_0x45caa7[_0xed1b('0x39')]['id']}})['then'](handleEntityNotFound(_0x2847fe,null))[_0xed1b('0x35')](function(_0x3f7cb0){var _0x34bb75=_0x3f7cb0['get']({'plain':!![]});return utilLicense['checkLicense'](_0x34bb75,_0x45caa7[_0xed1b('0x37')]['key']);})[_0xed1b('0x35')](function(_0x2e0ef1){if(!_0x2e0ef1[_0xed1b('0x3a')]){return saveUpdates(_0x45caa7[_0xed1b('0x37')],null);}return _0x2e0ef1;})[_0xed1b('0x35')](respondWithResult(_0x2847fe,null))[_0xed1b('0x36')](handleError(_0x2847fe,null));};exports[_0xed1b('0x3b')]=function(_0x1415ef,_0xfc80ca){var _0x5cb90e=_0xed1b('0x3c');var _0x21d59c=path[_0xed1b('0x3d')](_0xed1b('0x3e'),_0xed1b('0x3f'),_0xed1b('0x40'),_0x5cb90e);_0xfc80ca[_0xed1b('0x41')](_0xed1b('0x42'),'attachment;\x20filename='+_0x5cb90e);_0xfc80ca[_0xed1b('0x21')](_0xed1b('0x43'),'text/plain');_0xfc80ca['download'](_0x21d59c);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3d7c2de..789ecc9 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 _0xf525=['license','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define','License'];(function(_0x5a5570,_0x347886){var _0x142e1b=function(_0x4a26d4){while(--_0x4a26d4){_0x5a5570['push'](_0x5a5570['shift']());}};_0x142e1b(++_0x347886);}(_0xf525,0x145));var _0x5f52=function(_0x7acdfe,_0x2ff0fd){_0x7acdfe=_0x7acdfe-0x0;var _0x48ab39=_0xf525[_0x7acdfe];return _0x48ab39;};'use strict';var _=require(_0x5f52('0x0'));var util=require(_0x5f52('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5f52('0x2'));var BPromise=require(_0x5f52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f52('0x4'));var rimraf=require(_0x5f52('0x5'));var config=require(_0x5f52('0x6'));var attributes=require(_0x5f52('0x7'));module[_0x5f52('0x8')]=function(_0x31a825,_0x5a649f){return _0x31a825[_0x5f52('0x9')](_0x5f52('0xa'),attributes,{'tableName':_0x5f52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa203=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger'];(function(_0x46d846,_0x14b4e2){var _0x310597=function(_0x4ccbb2){while(--_0x4ccbb2){_0x46d846['push'](_0x46d846['shift']());}};_0x310597(++_0x14b4e2);}(_0xa203,0x178));var _0x3a20=function(_0x5b18d0,_0x1eb576){_0x5b18d0=_0x5b18d0-0x0;var _0xb39ba3=_0xa203[_0x5b18d0];return _0xb39ba3;};'use strict';var _=require(_0x3a20('0x0'));var util=require('util');var logger=require(_0x3a20('0x1'))(_0x3a20('0x2'));var moment=require(_0x3a20('0x3'));var BPromise=require(_0x3a20('0x4'));var rp=require(_0x3a20('0x5'));var fs=require('fs');var path=require(_0x3a20('0x6'));var rimraf=require(_0x3a20('0x7'));var config=require(_0x3a20('0x8'));var attributes=require(_0x3a20('0x9'));module[_0x3a20('0xa')]=function(_0x4f0979,_0x2738c1){return _0x4f0979[_0x3a20('0xb')](_0x3a20('0xc'),attributes,{'tableName':_0x3a20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 099eb67..ce0353f 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 _0x4d95=['License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0x4d95,0x81));var _0x54d9=function(_0x3f3514,_0x4dbfea){_0x3f3514=_0x3f3514-0x0;var _0x1203de=_0x4d95[_0x3f3514];return _0x1203de;};'use strict';var _=require(_0x54d9('0x0'));var util=require(_0x54d9('0x1'));var moment=require(_0x54d9('0x2'));var BPromise=require(_0x54d9('0x3'));var rs=require(_0x54d9('0x4'));var fs=require('fs');var Redis=require(_0x54d9('0x5'));var db=require(_0x54d9('0x6'))['db'];var utils=require(_0x54d9('0x7'));var logger=require(_0x54d9('0x8'))(_0x54d9('0x9'));var config=require(_0x54d9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x54d9('0xb')][_0x54d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c52d4,_0x412bdf,_0x285f3b){return new BPromise(function(_0x5d2f01,_0x48bf91){return client[_0x54d9('0xd')](_0x3c52d4,_0x285f3b)['then'](function(_0x79efc4){logger[_0x54d9('0xe')](_0x54d9('0xf'),_0x412bdf,'request\x20sent');logger[_0x54d9('0x10')](_0x54d9('0x11'),_0x412bdf,_0x54d9('0x12'),JSON[_0x54d9('0x13')](_0x79efc4));if(_0x79efc4[_0x54d9('0x14')]){if(_0x79efc4[_0x54d9('0x14')][_0x54d9('0x15')]===0x1f4){logger['error'](_0x54d9('0xf'),_0x412bdf,_0x79efc4[_0x54d9('0x14')][_0x54d9('0x16')]);return _0x48bf91(_0x79efc4[_0x54d9('0x14')][_0x54d9('0x16')]);}logger[_0x54d9('0x14')](_0x54d9('0xf'),_0x412bdf,_0x79efc4[_0x54d9('0x14')]['message']);return _0x5d2f01(_0x79efc4[_0x54d9('0x14')][_0x54d9('0x16')]);}else{logger[_0x54d9('0xe')](_0x54d9('0xf'),_0x412bdf,_0x54d9('0x12'));_0x5d2f01(_0x79efc4['result'][_0x54d9('0x16')]);}})[_0x54d9('0x17')](function(_0x30455e){logger['error']('License,\x20%s,\x20%s',_0x412bdf,_0x30455e);_0x48bf91(_0x30455e);});});} \ No newline at end of file +var _0x1bcf=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x5d214a,_0x350e18){var _0x2d1d18=function(_0x41156b){while(--_0x41156b){_0x5d214a['push'](_0x5d214a['shift']());}};_0x2d1d18(++_0x350e18);}(_0x1bcf,0x13e));var _0xf1bc=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x1bcf[_0x4fa438];return _0x4e3958;};'use strict';var _=require(_0xf1bc('0x0'));var util=require(_0xf1bc('0x1'));var moment=require(_0xf1bc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf1bc('0x3'));var fs=require('fs');var Redis=require(_0xf1bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1bc('0x5'));var logger=require(_0xf1bc('0x6'))(_0xf1bc('0x7'));var config=require(_0xf1bc('0x8'));var jayson=require(_0xf1bc('0x9'));var client=jayson['client'][_0xf1bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1689c2,_0x5cdf04,_0x7dbfe6){return new BPromise(function(_0xb253d6,_0x27692e){return client[_0xf1bc('0xb')](_0x1689c2,_0x7dbfe6)[_0xf1bc('0xc')](function(_0x20713d){logger[_0xf1bc('0xd')](_0xf1bc('0xe'),_0x5cdf04,_0xf1bc('0xf'));logger[_0xf1bc('0x10')](_0xf1bc('0x11'),_0x5cdf04,_0xf1bc('0xf'),JSON['stringify'](_0x20713d));if(_0x20713d[_0xf1bc('0x12')]){if(_0x20713d[_0xf1bc('0x12')][_0xf1bc('0x13')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x5cdf04,_0x20713d['error'][_0xf1bc('0x14')]);return _0x27692e(_0x20713d['error'][_0xf1bc('0x14')]);}logger[_0xf1bc('0x12')]('License,\x20%s,\x20%s',_0x5cdf04,_0x20713d['error'][_0xf1bc('0x14')]);return _0xb253d6(_0x20713d['error']['message']);}else{logger[_0xf1bc('0xd')](_0xf1bc('0xe'),_0x5cdf04,_0xf1bc('0xf'));_0xb253d6(_0x20713d[_0xf1bc('0x15')][_0xf1bc('0x14')]);}})[_0xf1bc('0x16')](function(_0x2b1489){logger[_0xf1bc('0x12')](_0xf1bc('0xe'),_0x5cdf04,_0x2b1489);_0x27692e(_0x2b1489);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 81e950d..283b61c 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 _0x2dc0=['/:id/interactions','addInteraction','send','put','/:id','delete','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addImap','addSmtp'];(function(_0x5a0406,_0x4c79a1){var _0x5100b9=function(_0x44f0d1){while(--_0x44f0d1){_0x5a0406['push'](_0x5a0406['shift']());}};_0x5100b9(++_0x4c79a1);}(_0x2dc0,0x1c1));var _0x02dc=function(_0x22a5ce,_0x1b5495){_0x22a5ce=_0x22a5ce-0x0;var _0x4a6f3a=_0x2dc0[_0x22a5ce];return _0x4a6f3a;};'use strict';var multer=require(_0x02dc('0x0'));var util=require(_0x02dc('0x1'));var path=require(_0x02dc('0x2'));var timeout=require(_0x02dc('0x3'));var express=require(_0x02dc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02dc('0x5'));var interaction=require(_0x02dc('0x6'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x02dc('0x7')]('/',auth[_0x02dc('0x8')](),controller[_0x02dc('0x9')]);router[_0x02dc('0x7')](_0x02dc('0xa'),auth[_0x02dc('0x8')](),controller[_0x02dc('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x02dc('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x02dc('0x7')](_0x02dc('0xd'),auth[_0x02dc('0x8')](),controller['getAnswers']);router[_0x02dc('0x7')](_0x02dc('0xe'),auth['isAuthenticated'](),controller[_0x02dc('0xf')]);router[_0x02dc('0x7')](_0x02dc('0x10'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x11')]);router[_0x02dc('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x02dc('0x7')](_0x02dc('0x12'),auth[_0x02dc('0x8')](),controller['getApplications']);router[_0x02dc('0x7')](_0x02dc('0x13'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x14')]);router[_0x02dc('0x7')](_0x02dc('0x15'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x16')]);router['get'](_0x02dc('0x17'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x18')]);router[_0x02dc('0x19')](_0x02dc('0x1a'),auth['isAuthenticated'](),controller[_0x02dc('0x1b')]);router['post'](_0x02dc('0xd'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x1c')]);router[_0x02dc('0x19')]('/',auth[_0x02dc('0x8')](),controller['create']);router['post'](_0x02dc('0xe'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x1d')]);router[_0x02dc('0x19')](_0x02dc('0x10'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x1e')]);router[_0x02dc('0x19')](_0x02dc('0x1f'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x20')]);router[_0x02dc('0x19')](_0x02dc('0x12'),auth[_0x02dc('0x8')](),controller['addApplications']);router[_0x02dc('0x19')]('/:id/send',auth[_0x02dc('0x8')](),controller[_0x02dc('0x21')]);router[_0x02dc('0x19')](_0x02dc('0x17'),auth[_0x02dc('0x8')](),controller['addAgents']);router[_0x02dc('0x22')](_0x02dc('0x23'),auth[_0x02dc('0x8')](),controller['update']);router[_0x02dc('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x02dc('0xd'),auth[_0x02dc('0x8')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0x02dc('0x8')](),controller['removeImap']);router[_0x02dc('0x24')](_0x02dc('0x10'),auth[_0x02dc('0x8')](),controller[_0x02dc('0x25')]);router[_0x02dc('0x24')](_0x02dc('0x23'),auth[_0x02dc('0x8')](),controller['destroy']);router[_0x02dc('0x24')]('/:id/users',auth[_0x02dc('0x8')](),controller[_0x02dc('0x26')]);module[_0x02dc('0x27')]=router; \ No newline at end of file +var _0x477b=['get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','/:id/users','addAgents','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4b22ea,_0x3ab7e6){var _0x1a4fa2=function(_0x41e2d8){while(--_0x41e2d8){_0x4b22ea['push'](_0x4b22ea['shift']());}};_0x1a4fa2(++_0x3ab7e6);}(_0x477b,0x101));var _0xb477=function(_0x578df2,_0x2aac5b){_0x578df2=_0x578df2-0x0;var _0x33229b=_0x477b[_0x578df2];return _0x33229b;};'use strict';var multer=require(_0xb477('0x0'));var util=require(_0xb477('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb477('0x2'));var router=express[_0xb477('0x3')]();var fs_extra=require(_0xb477('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb477('0x5'));var config=require(_0xb477('0x6'));var controller=require('./mailAccount.controller');router[_0xb477('0x7')]('/',auth[_0xb477('0x8')](),controller[_0xb477('0x9')]);router[_0xb477('0x7')](_0xb477('0xa'),auth[_0xb477('0x8')](),controller['describe']);router[_0xb477('0x7')](_0xb477('0xb'),auth[_0xb477('0x8')](),controller['show']);router[_0xb477('0x7')](_0xb477('0xc'),auth['isAuthenticated'](),controller[_0xb477('0xd')]);router['get'](_0xb477('0xe'),auth[_0xb477('0x8')](),controller[_0xb477('0xf')]);router[_0xb477('0x7')]('/:id/in_servers',auth[_0xb477('0x8')](),controller['getImap']);router[_0xb477('0x7')](_0xb477('0x10'),auth['isAuthenticated'](),controller[_0xb477('0x11')]);router[_0xb477('0x7')](_0xb477('0x12'),auth[_0xb477('0x8')](),controller[_0xb477('0x13')]);router[_0xb477('0x7')](_0xb477('0x14'),auth[_0xb477('0x8')](),controller[_0xb477('0x15')]);router[_0xb477('0x7')](_0xb477('0x16'),auth[_0xb477('0x8')](),controller[_0xb477('0x17')]);router[_0xb477('0x7')](_0xb477('0x18'),auth[_0xb477('0x8')](),controller[_0xb477('0x19')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xb477('0x1a')](_0xb477('0xc'),auth[_0xb477('0x8')](),controller[_0xb477('0x1b')]);router[_0xb477('0x1a')]('/:id/canned_answers',auth[_0xb477('0x8')](),controller[_0xb477('0x1c')]);router[_0xb477('0x1a')]('/',auth['isAuthenticated'](),controller[_0xb477('0x1d')]);router[_0xb477('0x1a')](_0xb477('0x1e'),auth['isAuthenticated'](),controller[_0xb477('0x1f')]);router[_0xb477('0x1a')](_0xb477('0x10'),auth[_0xb477('0x8')](),controller[_0xb477('0x20')]);router['post'](_0xb477('0x12'),auth[_0xb477('0x8')](),controller[_0xb477('0x21')]);router[_0xb477('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0xb477('0x22')]);router[_0xb477('0x1a')](_0xb477('0x23'),auth[_0xb477('0x8')](),controller['send']);router[_0xb477('0x1a')](_0xb477('0x24'),auth[_0xb477('0x8')](),controller[_0xb477('0x25')]);router['put'](_0xb477('0xb'),auth[_0xb477('0x8')](),controller['update']);router[_0xb477('0x26')](_0xb477('0xc'),auth[_0xb477('0x8')](),controller[_0xb477('0x27')]);router[_0xb477('0x26')](_0xb477('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xb477('0x26')](_0xb477('0x1e'),auth['isAuthenticated'](),controller[_0xb477('0x28')]);router[_0xb477('0x26')]('/:id/out_servers',auth[_0xb477('0x8')](),controller[_0xb477('0x29')]);router['delete']('/:id',auth[_0xb477('0x8')](),controller[_0xb477('0x2a')]);router[_0xb477('0x26')](_0xb477('0x24'),auth['isAuthenticated'](),controller[_0xb477('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 9bea5f1..b55417c 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 _0xf0d6=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','getDataValue','provider','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x1283d4,_0x36b6f1){var _0x433643=function(_0x4c9fbe){while(--_0x4c9fbe){_0x1283d4['push'](_0x1283d4['shift']());}};_0x433643(++_0x36b6f1);}(_0xf0d6,0x1e0));var _0x6f0d=function(_0x15b930,_0x568bca){_0x15b930=_0x15b930-0x0;var _0x16833b=_0xf0d6[_0x15b930];return _0x16833b;};'use strict';var Sequelize=require('sequelize');module[_0x6f0d('0x0')]={'description':{'type':Sequelize[_0x6f0d('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6f0d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6f0d('0x1')],'allowNull':![],'defaultValue':_0x6f0d('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6f0d('0x4')],'defaultValue':function(){return _0x6f0d('0x5');}},'notificationSound':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f0d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f0d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f0d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x6f0d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x6f0d('0x2')],'defaultValue':![],'comment':_0x6f0d('0x8'),'set':function(_0x3ca070){if(!_0x3ca070)this[_0x6f0d('0x9')](_0x6f0d('0xa'),null);this[_0x6f0d('0x9')](_0x6f0d('0xb'),_0x3ca070);}},'provider':{'type':Sequelize[_0x6f0d('0xc')](_0x6f0d('0xd'),'hotmail',_0x6f0d('0xe'),_0x6f0d('0xf')),'defaultValue':null,'get':function(){if(!this[_0x6f0d('0x10')]('provider'))return'custom';return this['getDataValue']('provider');},'set':function(_0x5e6e5a){if(_0x5e6e5a==='custom')_0x5e6e5a=null;return this[_0x6f0d('0x9')](_0x6f0d('0x11'),_0x5e6e5a);}}}; \ No newline at end of file +var _0x2586=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x3c334f,_0x358ac4){var _0x46a2e0=function(_0x33c789){while(--_0x33c789){_0x3c334f['push'](_0x3c334f['shift']());}};_0x46a2e0(++_0x358ac4);}(_0x2586,0xc0));var _0x6258=function(_0x3f931c,_0x1d993c){_0x3f931c=_0x3f931c-0x0;var _0x4d5a4d=_0x2586[_0x3f931c];return _0x4d5a4d;};'use strict';var Sequelize=require(_0x6258('0x0'));module['exports']={'description':{'type':Sequelize[_0x6258('0x1')]},'name':{'type':Sequelize[_0x6258('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x6258('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6258('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x6258('0x3')]},'markAsUnread':{'type':Sequelize[_0x6258('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6258('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x6258('0x4')](0x2)[_0x6258('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6258('0x3')],'defaultValue':function(){return _0x6258('0x6');}},'notificationSound':{'type':Sequelize[_0x6258('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6258('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6258('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6258('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6258('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x6258('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58c0c0){if(!_0x58c0c0)this[_0x6258('0x8')](_0x6258('0x9'),null);this[_0x6258('0x8')](_0x6258('0xa'),_0x58c0c0);}},'provider':{'type':Sequelize[_0x6258('0xb')](_0x6258('0xc'),_0x6258('0xd'),_0x6258('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x6258('0xf')](_0x6258('0x10')))return _0x6258('0x11');return this[_0x6258('0xf')](_0x6258('0x10'));},'set':function(_0x32184a){if(_0x32184a===_0x6258('0x11'))_0x32184a=null;return this[_0x6258('0x8')](_0x6258('0x10'),_0x32184a);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 79f53fe..8d90630 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 _0xb877=['lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','Pause','length','options','find','body','provider','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','key','custom','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','true','CmList','List','Contacts','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','server/files/attachments','getSmtpOptions','SendMail','sendMail','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb877,0x188));var _0x7b87=function(_0xbea163,_0xf6ec4d){_0xbea163=_0xbea163-0x0;var _0x52b10d=_0xb877[_0xbea163];return _0x52b10d;};'use strict';var moment=require(_0x7b87('0x0'));var BPromise=require(_0x7b87('0x1'));var util=require(_0x7b87('0x2'));var path=require(_0x7b87('0x3'));var _=require(_0x7b87('0x4'));var juice=require(_0x7b87('0x5'));var Redis=require(_0x7b87('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x7b87('0x7'))(_0x7b87('0x8'));var config=require(_0x7b87('0x9'));var db=require(_0x7b87('0xa'))['db'];config[_0x7b87('0xb')]=_[_0x7b87('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7b87('0xd'))(new Redis(config[_0x7b87('0xb')]));require('./mailAccount.socket')[_0x7b87('0xe')](socket);var jayson=require(_0x7b87('0xf'));var client=jayson[_0x7b87('0x10')][_0x7b87('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x20ff2c,_0x51efb6,_0x162bc2,_0x50cdfb){return new BPromise(function(_0xa8c4e,_0x16008d){var _0x2fafaf=_0x50cdfb||client;return _0x2fafaf[_0x7b87('0x12')](_0x20ff2c,_0x162bc2)[_0x7b87('0x13')](function(_0x4f84b1){logger[_0x7b87('0x14')](_0x7b87('0x15'),_0x51efb6,_0x7b87('0x16'));logger[_0x7b87('0x17')](_0x7b87('0x18'),_0x51efb6,'request\x20sent',JSON[_0x7b87('0x19')](_0x4f84b1));if(_0x4f84b1[_0x7b87('0x1a')]){if(_0x4f84b1['error']['code']===0x1f4){logger['error'](_0x7b87('0x15'),_0x51efb6,_0x4f84b1[_0x7b87('0x1a')][_0x7b87('0x1b')]);return _0x16008d(_0x4f84b1['error'][_0x7b87('0x1b')]);}logger[_0x7b87('0x1a')]('MailAccount,\x20%s,\x20%s',_0x51efb6,_0x4f84b1['error'][_0x7b87('0x1b')]);return _0xa8c4e(_0x4f84b1[_0x7b87('0x1a')][_0x7b87('0x1b')]);}else{logger[_0x7b87('0x14')]('MailAccount,\x20%s,\x20%s',_0x51efb6,_0x7b87('0x16'));_0xa8c4e(_0x4f84b1[_0x7b87('0x1c')][_0x7b87('0x1b')]);}})[_0x7b87('0x1d')](function(_0xbae02e){logger[_0x7b87('0x1a')]('MailAccount,\x20%s,\x20%s',_0x51efb6,_0xbae02e);_0x16008d(_0xbae02e);});});}function respondWithStatusCode(_0x45f650,_0x5bb745){_0x5bb745=_0x5bb745||0xcc;return function(_0x19783f){if(_0x19783f){return _0x45f650[_0x7b87('0x1e')](_0x5bb745);}return _0x45f650[_0x7b87('0x1f')](_0x5bb745)['end']();};}function respondWithResult(_0x4514b3,_0x1aae6a){_0x1aae6a=_0x1aae6a||0xc8;return function(_0x313ec0){if(_0x313ec0){return _0x4514b3[_0x7b87('0x1f')](_0x1aae6a)['json'](_0x313ec0);}};}function respondWithFilteredResult(_0x392814,_0x15a717){return function(_0x743096){if(_0x743096){var _0x14073f=typeof _0x15a717[_0x7b87('0x20')]===_0x7b87('0x21')&&typeof _0x15a717['limit']===_0x7b87('0x21');var _0x2efac1=_0x743096[_0x7b87('0x22')];var _0x115258=_0x14073f?0x0:_0x15a717[_0x7b87('0x20')];var _0x1a1d73=_0x14073f?_0x743096[_0x7b87('0x22')]:_0x15a717['offset']+_0x15a717[_0x7b87('0x23')];var _0x3979d7;if(_0x1a1d73>=_0x2efac1){_0x1a1d73=_0x2efac1;_0x3979d7=0xc8;}else{_0x3979d7=0xce;}_0x392814[_0x7b87('0x1f')](_0x3979d7);return _0x392814['set'](_0x7b87('0x24'),_0x115258+'-'+_0x1a1d73+'/'+_0x2efac1)[_0x7b87('0x25')](_0x743096);}return null;};}function saveUpdates(_0x270e8d){return function(_0x15ef5f){if(_0x15ef5f){return _0x15ef5f[_0x7b87('0x26')](_0x270e8d)[_0x7b87('0x13')](function(_0x28cbd2){return _0x28cbd2;});}return null;};}function removeEntity(_0x3630a1){return function(_0x5e4b24){if(_0x5e4b24){return _0x5e4b24[_0x7b87('0x27')]()[_0x7b87('0x13')](function(){var _0x4f1035=_0x5e4b24[_0x7b87('0x28')]({'plain':!![]});var _0x55fd3c=_0x7b87('0x29');return db[_0x7b87('0x2a')][_0x7b87('0x27')]({'where':{'type':_0x55fd3c,'resourceId':_0x4f1035['id']}})[_0x7b87('0x13')](function(){return _0x5e4b24;});})[_0x7b87('0x13')](function(){_0x3630a1[_0x7b87('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be313){return function(_0x18dbef){if(!_0x18dbef){_0x3be313[_0x7b87('0x1e')](0x194);}return _0x18dbef;};}function handleError(_0x120640,_0x443540){_0x443540=_0x443540||0x1f4;return function(_0x4bed84){logger[_0x7b87('0x1a')](_0x4bed84[_0x7b87('0x2b')]);if(_0x4bed84[_0x7b87('0x2c')]){delete _0x4bed84[_0x7b87('0x2c')];}_0x120640[_0x7b87('0x1f')](_0x443540)[_0x7b87('0x2d')](_0x4bed84);};}function getImapHost(_0x544852){switch(_0x544852){case'gmail':return _0x7b87('0x2e');case'yahoo':return _0x7b87('0x2f');case _0x7b87('0x30'):return _0x7b87('0x31');case _0x7b87('0x32'):return _0x7b87('0x33');}throw new Error(_0x7b87('0x34'),_0x544852);}function getSmtpHost(_0x2622af){switch(_0x2622af){case _0x7b87('0x35'):return _0x7b87('0x36');case _0x7b87('0x37'):return _0x7b87('0x38');case'hotmail':return _0x7b87('0x39');case _0x7b87('0x32'):return _0x7b87('0x3a');}throw new Error(_0x7b87('0x34'),_0x2622af);}function getAuthenticationOptions(_0x23bb5c,_0x44b653){var _0x472f15={};var _0xe155df={};if(_0x23bb5c){_0x472f15[_0x7b87('0x3b')]=_0xe155df[_0x7b87('0x3b')]=_0x44b653['username'];_0x472f15[_0x7b87('0x3c')]=_0xe155df[_0x7b87('0x3d')]=_0x44b653[_0x7b87('0x3c')];if(_0x44b653[_0x7b87('0x3e')]){_0x472f15[_0x7b87('0x3e')]=_0xe155df[_0x7b87('0x3e')]=!![];_0x472f15['CloudProviderId']=_0xe155df[_0x7b87('0x3f')]=_0x44b653[_0x7b87('0x3f')];_0x472f15['password']=_0xe155df[_0x7b87('0x3d')]=null;}else{_0x472f15[_0x7b87('0x3f')]=_0xe155df[_0x7b87('0x3f')]=null;}_0x472f15[_0x7b87('0x40')]=getImapHost(_0x23bb5c);_0x472f15[_0x7b87('0x41')]=0x3e1;_0xe155df[_0x7b87('0x40')]=getSmtpHost(_0x23bb5c);_0xe155df[_0x7b87('0x41')]=0x24b;_0xe155df[_0x7b87('0x42')]=![];_0x472f15[_0x7b87('0x43')]=_0xe155df['service']=null;}else{if(_0x44b653[_0x7b87('0x44')]){_0x472f15[_0x7b87('0x3b')]=_0xe155df[_0x7b87('0x3b')]=_0x44b653['username'];_0x472f15[_0x7b87('0x3c')]=_0xe155df[_0x7b87('0x3d')]=_0x44b653[_0x7b87('0x3c')];}else{_0x472f15[_0x7b87('0x44')]=_0xe155df[_0x7b87('0x44')]=![];_0x472f15[_0x7b87('0x3b')]=_0xe155df[_0x7b87('0x3b')]=null;_0x472f15['password']=_0xe155df['pass']=null;}_0x472f15['host']=_0x44b653[_0x7b87('0x45')][_0x7b87('0x40')];_0x472f15['port']=_0x44b653['Imap'][_0x7b87('0x41')];_0xe155df[_0x7b87('0x40')]=_0x44b653[_0x7b87('0x46')]['host'];_0xe155df[_0x7b87('0x41')]=_0x44b653[_0x7b87('0x46')]['port'];}return{'Imap':_0x472f15,'Smtp':_0xe155df};}exports['index']=function(_0x5d4bdb,_0x138935){var _0x461447={'include':[{'model':db[_0x7b87('0x47')],'as':_0x7b87('0x45')},{'model':db[_0x7b87('0x48')],'as':_0x7b87('0x46')},{'model':db['Pause'],'as':_0x7b87('0x49')}]},_0x25bc17={},_0x25eb68={'count':0x0,'rows':[]};var _0x3b4566=_[_0x7b87('0x4a')](db[_0x7b87('0x4b')][_0x7b87('0x4c')],function(_0x56686d){return{'name':_0x56686d[_0x7b87('0x4d')],'type':_0x56686d[_0x7b87('0x4e')]['key']};});_0x25bc17[_0x7b87('0x4f')]=_[_0x7b87('0x4a')](_0x3b4566,_0x7b87('0x2c'));_0x25bc17[_0x7b87('0x50')]=_[_0x7b87('0x51')](_0x5d4bdb[_0x7b87('0x50')]);_0x25bc17[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x25bc17[_0x7b87('0x4f')],_0x25bc17[_0x7b87('0x50')]);_0x461447[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0x25bc17[_0x7b87('0x4f')],qs[_0x7b87('0x55')](_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x55')]));_0x461447[_0x7b87('0x54')]=_0x461447[_0x7b87('0x54')]['length']?_0x461447[_0x7b87('0x54')]:_0x25bc17[_0x7b87('0x4f')];if(!_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x56')](_0x7b87('0x57'))){_0x461447[_0x7b87('0x23')]=qs['limit'](_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x23')]);_0x461447[_0x7b87('0x20')]=qs[_0x7b87('0x20')](_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x20')]);}_0x461447[_0x7b87('0x58')]=qs['sort'](_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x59')]);_0x461447['where']=qs['filters'](_[_0x7b87('0x5a')](_0x5d4bdb['query'],_0x25bc17[_0x7b87('0x52')]),_0x3b4566);if(_0x5d4bdb['query']['filter']){_0x461447[_0x7b87('0x5b')]=_[_0x7b87('0x5c')](_0x461447[_0x7b87('0x5b')],{'$or':_[_0x7b87('0x4a')](_0x3b4566,function(_0x3f5278){if(_0x3f5278[_0x7b87('0x4e')]!==_0x7b87('0x5d')){var _0x277ec5={};_0x277ec5[_0x3f5278[_0x7b87('0x2c')]]={'$like':'%'+_0x5d4bdb[_0x7b87('0x50')][_0x7b87('0x5e')]+'%'};return _0x277ec5;}})});}_0x461447=_[_0x7b87('0x5c')]({},_0x461447,_0x5d4bdb['options']);var _0x42d1de={'where':_0x461447[_0x7b87('0x5b')]};return db[_0x7b87('0x4b')]['count'](_0x42d1de)[_0x7b87('0x13')](function(_0x36fa07){_0x25eb68[_0x7b87('0x22')]=_0x36fa07;if(_0x5d4bdb['query'][_0x7b87('0x5f')]){_0x461447[_0x7b87('0x60')]=[{'all':!![]}];}return db[_0x7b87('0x4b')][_0x7b87('0x61')](_0x461447);})['then'](function(_0x453793){_0x25eb68[_0x7b87('0x62')]=_0x453793;return _0x25eb68;})[_0x7b87('0x13')](respondWithFilteredResult(_0x138935,_0x461447))[_0x7b87('0x1d')](handleError(_0x138935,null));};exports['show']=function(_0x2be9ac,_0x32ffc2){var _0x4bd32c={'raw':![],'where':{'id':_0x2be9ac[_0x7b87('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x7b87('0x48')],'as':_0x7b87('0x46')},{'model':db[_0x7b87('0x64')],'as':'mandatoryDispositionPause'}]},_0x41be2f={};_0x41be2f[_0x7b87('0x4f')]=_['keys'](db[_0x7b87('0x4b')][_0x7b87('0x4c')]);_0x41be2f['query']=_[_0x7b87('0x51')](_0x2be9ac[_0x7b87('0x50')]);_0x41be2f[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x41be2f[_0x7b87('0x4f')],_0x41be2f['query']);_0x4bd32c[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0x41be2f[_0x7b87('0x4f')],qs['fields'](_0x2be9ac['query'][_0x7b87('0x55')]));_0x4bd32c[_0x7b87('0x54')]=_0x4bd32c[_0x7b87('0x54')][_0x7b87('0x65')]?_0x4bd32c['attributes']:_0x41be2f[_0x7b87('0x4f')];if(_0x2be9ac[_0x7b87('0x50')][_0x7b87('0x5f')]){_0x4bd32c[_0x7b87('0x60')]=[{'all':!![]}];}_0x4bd32c=_[_0x7b87('0x5c')]({},_0x4bd32c,_0x2be9ac[_0x7b87('0x66')]);return db['MailAccount'][_0x7b87('0x67')](_0x4bd32c)[_0x7b87('0x13')](handleEntityNotFound(_0x32ffc2,null))[_0x7b87('0x13')](respondWithResult(_0x32ffc2,null))['catch'](handleError(_0x32ffc2,null));};exports[_0x7b87('0x26')]=function(_0x375f85,_0x5149bf){if(_0x375f85['body']['id']){delete _0x375f85[_0x7b87('0x68')]['id'];}var _0x3c7e94=_0x375f85[_0x7b87('0x68')]['provider']==='custom'?null:_0x375f85[_0x7b87('0x68')][_0x7b87('0x69')];var _0x3f6717=_0x375f85[_0x7b87('0x68')]['Imap']||{};var _0x507815=_0x375f85['body'][_0x7b87('0x46')]||{};if(_0x3c7e94){_0x3f6717[_0x7b87('0x40')]=getImapHost(_0x3c7e94);_0x3f6717[_0x7b87('0x41')]=0x3e1;_0x507815['host']=getSmtpHost(_0x3c7e94);_0x507815[_0x7b87('0x41')]=0x24b;_0x507815[_0x7b87('0x42')]=![];}if(_0x507815[_0x7b87('0x3e')]){_0x507815[_0x7b87('0x42')]=![];}else{_0x507815['CloudProviderId']=null;}if(!_0x3f6717['modernAuthentication'])_0x3f6717[_0x7b87('0x3f')]=null;_0x375f85['body'][_0x7b87('0x45')]=_0x3f6717;_0x375f85[_0x7b87('0x68')]['Smtp']=_0x507815;return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x375f85[_0x7b87('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x7b87('0x45')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x7b87('0x64')],'as':_0x7b87('0x49')}]})[_0x7b87('0x13')](handleEntityNotFound(_0x5149bf,null))[_0x7b87('0x13')](function(_0x57668f){if(!_0x57668f)throw new Error(_0x7b87('0x6a'));if(_0x57668f['service'])delete _0x375f85[_0x7b87('0x68')][_0x7b87('0x45')];return _0x57668f;})[_0x7b87('0x13')](saveUpdates(_0x375f85[_0x7b87('0x68')],null))['then'](function(_0x3c6c2b){if(!_0x375f85[_0x7b87('0x68')][_0x7b87('0x45')])return _0x3c6c2b;return db[_0x7b87('0x47')]['update'](_0x375f85['body']['Imap'],{'where':{'MailAccountId':_0x3c6c2b['id']}})[_0x7b87('0x13')](function(){return _0x3c6c2b;});})['then'](function(_0x9732da){if(!_0x375f85[_0x7b87('0x68')]['Smtp'])return _0x9732da;return db[_0x7b87('0x48')]['update'](_0x375f85[_0x7b87('0x68')][_0x7b87('0x46')],{'where':{'MailAccountId':_0x9732da['id']}})[_0x7b87('0x13')](function(){return _0x9732da;});})[_0x7b87('0x13')](respondWithResult(_0x5149bf,null))[_0x7b87('0x1d')](handleError(_0x5149bf,null));};exports[_0x7b87('0x6b')]=function(_0x295755,_0xcf0d72){return db[_0x7b87('0x4b')][_0x7b87('0x6b')]()[_0x7b87('0x13')](respondWithResult(_0xcf0d72,null))[_0x7b87('0x1d')](handleError(_0xcf0d72,null));};exports['addDisposition']=function(_0x18c3f3,_0x278c4d){if(_0x18c3f3[_0x7b87('0x68')]['id']){delete _0x18c3f3[_0x7b87('0x68')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x18c3f3[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x278c4d,null))['then'](function(_0x48bea7){if(_0x48bea7){_0x18c3f3[_0x7b87('0x68')][_0x7b87('0x6c')]=_0x48bea7['id'];return db['Disposition'][_0x7b87('0x6d')](_0x18c3f3['body']);}})[_0x7b87('0x13')](respondWithResult(_0x278c4d,null))[_0x7b87('0x1d')](handleError(_0x278c4d,null));};exports[_0x7b87('0x6e')]=function(_0x12d9f8,_0x2f5d90){var _0x34c43a={'raw':![],'where':{}};var _0x4e82f4={};var _0xec3ddd={'count':0x0,'rows':[]};return db[_0x7b87('0x4b')]['findOne']({'where':{'id':_0x12d9f8[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x2f5d90,null))[_0x7b87('0x13')](function(_0x2b8e93){if(_0x2b8e93){_0x4e82f4[_0x7b87('0x4f')]=_['keys'](db[_0x7b87('0x6f')][_0x7b87('0x4c')]);_0x4e82f4[_0x7b87('0x50')]=_[_0x7b87('0x51')](_0x12d9f8[_0x7b87('0x50')]);_0x4e82f4[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x4e82f4[_0x7b87('0x4f')],_0x4e82f4[_0x7b87('0x50')]);_0x34c43a[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0x4e82f4['model'],qs[_0x7b87('0x55')](_0x12d9f8[_0x7b87('0x50')][_0x7b87('0x55')]));_0x34c43a[_0x7b87('0x54')]=_0x34c43a['attributes']['length']?_0x34c43a[_0x7b87('0x54')]:_0x4e82f4[_0x7b87('0x4f')];if(!_0x12d9f8['query'][_0x7b87('0x56')](_0x7b87('0x57'))){_0x34c43a[_0x7b87('0x23')]=qs[_0x7b87('0x23')](_0x12d9f8['query']['limit']);_0x34c43a['offset']=qs[_0x7b87('0x20')](_0x12d9f8[_0x7b87('0x50')][_0x7b87('0x20')]);}_0x34c43a[_0x7b87('0x58')]=qs[_0x7b87('0x59')](_0x12d9f8['query'][_0x7b87('0x59')]);_0x34c43a[_0x7b87('0x5b')]=qs[_0x7b87('0x52')](_['pick'](_0x12d9f8[_0x7b87('0x50')],_0x4e82f4[_0x7b87('0x52')]));_0x34c43a[_0x7b87('0x5b')][_0x7b87('0x6c')]=_0x2b8e93['id'];if(_0x12d9f8[_0x7b87('0x50')][_0x7b87('0x5e')]){_0x34c43a['where']=_[_0x7b87('0x5c')](_0x34c43a[_0x7b87('0x5b')],{'$or':_[_0x7b87('0x4a')](_0x34c43a['attributes'],function(_0x5ddd4d){var _0x3dc869={};_0x3dc869[_0x5ddd4d]={'$like':'%'+_0x12d9f8['query']['filter']+'%'};return _0x3dc869;})});}_0x34c43a=_[_0x7b87('0x5c')]({},_0x34c43a,_0x12d9f8[_0x7b87('0x66')]);return db['Disposition'][_0x7b87('0x22')]({'where':_0x34c43a['where']})[_0x7b87('0x13')](function(_0x19bb64){_0xec3ddd[_0x7b87('0x22')]=_0x19bb64;if(_0x12d9f8[_0x7b87('0x50')][_0x7b87('0x5f')]){_0x34c43a['include']=[{'all':!![]}];}return db['Disposition'][_0x7b87('0x61')](_0x34c43a);})[_0x7b87('0x13')](function(_0x23768a){_0xec3ddd[_0x7b87('0x62')]=_0x23768a;return _0xec3ddd;});}})[_0x7b87('0x13')](respondWithFilteredResult(_0x2f5d90,_0x34c43a))['catch'](handleError(_0x2f5d90,null));};exports[_0x7b87('0x70')]=function(_0x19f656,_0x84c670){return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x19f656['params']['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x84c670,null))['then'](function(_0x5102c5){if(_0x5102c5){return _0x5102c5[_0x7b87('0x70')](_0x19f656[_0x7b87('0x50')][_0x7b87('0x71')]);}})['then'](respondWithStatusCode(_0x84c670,null))[_0x7b87('0x1d')](handleError(_0x84c670,null));};exports[_0x7b87('0x72')]=function(_0x7ab64c,_0x419a9e){if(_0x7ab64c[_0x7b87('0x68')]['id']){delete _0x7ab64c[_0x7b87('0x68')]['id'];}return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x7ab64c['params']['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x419a9e,null))[_0x7b87('0x13')](function(_0x293c1d){if(_0x293c1d){_0x7ab64c['body'][_0x7b87('0x6c')]=_0x293c1d['id'];return db[_0x7b87('0x73')][_0x7b87('0x6d')](_0x7ab64c[_0x7b87('0x68')]);}})[_0x7b87('0x13')](respondWithResult(_0x419a9e,null))[_0x7b87('0x1d')](handleError(_0x419a9e,null));};exports[_0x7b87('0x74')]=function(_0x2da4f9,_0x4d52c9){var _0x217b52={'raw':![],'where':{}};var _0xf11ede={};var _0x2ec4d1={'count':0x0,'rows':[]};return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x2da4f9['params']['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x4d52c9,null))['then'](function(_0x2685ed){if(_0x2685ed){_0xf11ede[_0x7b87('0x4f')]=_[_0x7b87('0x51')](db['CannedAnswer'][_0x7b87('0x4c')]);_0xf11ede[_0x7b87('0x50')]=_[_0x7b87('0x51')](_0x2da4f9[_0x7b87('0x50')]);_0xf11ede[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0xf11ede[_0x7b87('0x4f')],_0xf11ede[_0x7b87('0x50')]);_0x217b52[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0xf11ede[_0x7b87('0x4f')],qs['fields'](_0x2da4f9[_0x7b87('0x50')][_0x7b87('0x55')]));_0x217b52[_0x7b87('0x54')]=_0x217b52[_0x7b87('0x54')][_0x7b87('0x65')]?_0x217b52[_0x7b87('0x54')]:_0xf11ede['model'];if(!_0x2da4f9['query'][_0x7b87('0x56')](_0x7b87('0x57'))){_0x217b52[_0x7b87('0x23')]=qs['limit'](_0x2da4f9['query']['limit']);_0x217b52['offset']=qs[_0x7b87('0x20')](_0x2da4f9[_0x7b87('0x50')][_0x7b87('0x20')]);}_0x217b52['order']=qs['sort'](_0x2da4f9['query'][_0x7b87('0x59')]);_0x217b52[_0x7b87('0x5b')]=qs[_0x7b87('0x52')](_['pick'](_0x2da4f9[_0x7b87('0x50')],_0xf11ede[_0x7b87('0x52')]));_0x217b52['where']['MailAccountId']=_0x2685ed['id'];if(_0x2da4f9['query'][_0x7b87('0x5e')]){_0x217b52[_0x7b87('0x5b')]=_[_0x7b87('0x5c')](_0x217b52[_0x7b87('0x5b')],{'$or':_['map'](_0x217b52[_0x7b87('0x54')],function(_0x5bf2a9){var _0x4339ca={};_0x4339ca[_0x5bf2a9]={'$like':'%'+_0x2da4f9['query'][_0x7b87('0x5e')]+'%'};return _0x4339ca;})});}_0x217b52=_[_0x7b87('0x5c')]({},_0x217b52,_0x2da4f9[_0x7b87('0x66')]);return db['CannedAnswer'][_0x7b87('0x22')]({'where':_0x217b52['where']})[_0x7b87('0x13')](function(_0x53b235){_0x2ec4d1[_0x7b87('0x22')]=_0x53b235;if(_0x2da4f9['query'][_0x7b87('0x5f')]){_0x217b52[_0x7b87('0x60')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7b87('0x61')](_0x217b52);})[_0x7b87('0x13')](function(_0x3dc925){_0x2ec4d1[_0x7b87('0x62')]=_0x3dc925;return _0x2ec4d1;});}})[_0x7b87('0x13')](respondWithFilteredResult(_0x4d52c9,_0x217b52))[_0x7b87('0x1d')](handleError(_0x4d52c9,null));};exports[_0x7b87('0x76')]=function(_0x2a45d6,_0x11bd75){return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x2a45d6[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x11bd75,null))['then'](function(_0x1f372b){if(_0x1f372b){return _0x1f372b[_0x7b87('0x76')](_0x2a45d6[_0x7b87('0x50')][_0x7b87('0x71')]);}})[_0x7b87('0x13')](respondWithStatusCode(_0x11bd75,null))['catch'](handleError(_0x11bd75,null));};exports[_0x7b87('0x6d')]=function(_0xd91926,_0xd58c88){var _0x5adba2={'name':_0xd91926[_0x7b87('0x68')]['name'],'key':_0xd91926['body'][_0x7b87('0x77')],'provider':_0xd91926[_0x7b87('0x68')][_0x7b87('0x69')]===_0x7b87('0x78')?null:_0xd91926['body'][_0x7b87('0x69')],'email':_0xd91926['body'][_0x7b87('0x79')],'ListId':_0xd91926['body'][_0x7b87('0x7a')],'active':!_[_0x7b87('0x7b')](_0xd91926['body'][_0x7b87('0x7c')])?_0xd91926[_0x7b87('0x68')]['active']:!![],'description':_0xd91926[_0x7b87('0x68')][_0x7b87('0x7d')]||null};var _0x1732ce=getAuthenticationOptions(_0x5adba2[_0x7b87('0x69')],_0xd91926['body']);_0x5adba2['Imap']=_0x1732ce['Imap'];_0x5adba2[_0x7b87('0x46')]=_0x1732ce[_0x7b87('0x46')];return db[_0x7b87('0x4b')][_0x7b87('0x6d')](_0x5adba2,{'include':[{'model':db[_0x7b87('0x48')],'as':_0x7b87('0x46')},{'model':db[_0x7b87('0x47')],'as':_0x7b87('0x45')}]})[_0x7b87('0x13')](function(_0x35521f){var _0x14df87=_0xd91926['user'][_0x7b87('0x28')]({'plain':!![]});if(!_0x14df87)throw new Error(_0x7b87('0x7e'));if(_0x14df87[_0x7b87('0x7f')]===_0x7b87('0x3b')){var _0xe22b2b=_0x35521f['get']({'plain':!![]});return db[_0x7b87('0x80')]['find']({'where':{'name':_0x7b87('0x29'),'userProfileId':_0x14df87[_0x7b87('0x81')]},'raw':!![]})[_0x7b87('0x13')](function(_0x60a082){if(_0x60a082&&_0x60a082['autoAssociation']===0x0){return db[_0x7b87('0x2a')][_0x7b87('0x6d')]({'name':_0xe22b2b['name'],'resourceId':_0xe22b2b['id'],'type':_0x60a082['name'],'sectionId':_0x60a082['id']},{})[_0x7b87('0x13')](function(){return _0x35521f;});}else{return _0x35521f;}})[_0x7b87('0x1d')](function(_0x29e2f9){logger[_0x7b87('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e2f9);throw _0x29e2f9;});}return _0x35521f;})[_0x7b87('0x13')](respondWithResult(_0xd58c88,0xc9))[_0x7b87('0x1d')](handleError(_0xd58c88,null));};exports[_0x7b87('0x82')]=function(_0xcfca6e,_0x41921c){return db[_0x7b87('0x4b')]['findOne']({'where':{'id':_0xcfca6e[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x41921c,null))[_0x7b87('0x13')](function(_0x166f3f){if(_0x166f3f){return _0x166f3f[_0x7b87('0x82')]();}return null;})[_0x7b87('0x13')](respondWithResult(_0x41921c,null))[_0x7b87('0x1d')](handleError(_0x41921c,null));};exports['addImap']=function(_0x4e80fb,_0x25a0e3){if(_0x4e80fb['body']['id']){delete _0x4e80fb[_0x7b87('0x68')]['id'];}return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x4e80fb[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x25a0e3,null))['then'](function(_0x21c8a7){if(_0x21c8a7){_0x4e80fb[_0x7b87('0x68')]['MailAccountId']=_0x21c8a7['id'];return db[_0x7b87('0x47')][_0x7b87('0x6d')](_0x4e80fb['body']);}})[_0x7b87('0x13')](respondWithResult(_0x25a0e3,null))[_0x7b87('0x1d')](handleError(_0x25a0e3,null));};exports[_0x7b87('0x83')]=function(_0x3580c6,_0x266768){return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x3580c6[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x266768,null))[_0x7b87('0x13')](function(_0x5f17bd){if(_0x5f17bd){return _0x5f17bd[_0x7b87('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x266768,null))['catch'](handleError(_0x266768,null));};exports[_0x7b87('0x85')]=function(_0x1d5f51,_0x5f407f){return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x1d5f51[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x5f407f,null))[_0x7b87('0x13')](function(_0xbe914e){if(_0xbe914e){return _0xbe914e[_0x7b87('0x85')]();}return null;})['then'](respondWithResult(_0x5f407f,null))[_0x7b87('0x1d')](handleError(_0x5f407f,null));};exports[_0x7b87('0x86')]=function(_0x3686f8,_0x57e092){if(_0x3686f8[_0x7b87('0x68')]['id']){delete _0x3686f8[_0x7b87('0x68')]['id'];}return db[_0x7b87('0x4b')]['find']({'where':{'id':_0x3686f8['params']['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x57e092,null))[_0x7b87('0x13')](function(_0x19675a){if(_0x19675a){_0x3686f8['body'][_0x7b87('0x6c')]=_0x19675a['id'];return db['MailServerOut']['create'](_0x3686f8['body']);}})[_0x7b87('0x13')](respondWithResult(_0x57e092,null))[_0x7b87('0x1d')](handleError(_0x57e092,null));};exports[_0x7b87('0x87')]=function(_0x43936e,_0x1e7f0a){return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x43936e[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x1e7f0a,null))[_0x7b87('0x13')](function(_0x4ea058){if(_0x4ea058){return _0x4ea058[_0x7b87('0x88')](null);}return null;})[_0x7b87('0x13')](respondWithStatusCode(_0x1e7f0a,null))[_0x7b87('0x1d')](handleError(_0x1e7f0a,null));};exports[_0x7b87('0x89')]=function(_0x46eb00,_0x35bf6d){return db['MailInteraction'][_0x7b87('0x67')]({'where':{'id':_0x46eb00['params']['id']}})['then'](handleEntityNotFound(_0x35bf6d,null))[_0x7b87('0x13')](function(_0x217200){if(_0x217200){return _0x217200[_0x7b87('0x89')](_0x46eb00['body'][_0x7b87('0x71')],_[_0x7b87('0x8a')](_0x46eb00[_0x7b87('0x68')],[_0x7b87('0x71'),'id'])||{});}})[_0x7b87('0x13')](respondWithResult(_0x35bf6d,null))[_0x7b87('0x1d')](handleError(_0x35bf6d,null));};exports[_0x7b87('0x8b')]=function(_0x4eacc2,_0x43ac0c){var _0x578bcc={'raw':![],'where':{}};var _0x25cfab={};var _0x4edb10={'count':0x0,'rows':[]};return db[_0x7b87('0x4b')]['findOne']({'where':{'id':_0x4eacc2[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x43ac0c,null))['then'](function(_0x17efef){if(_0x17efef){_0x25cfab[_0x7b87('0x4f')]=_['keys'](db[_0x7b87('0x8c')][_0x7b87('0x4c')]);_0x25cfab['query']=_[_0x7b87('0x51')](_0x4eacc2[_0x7b87('0x50')]);_0x25cfab[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x25cfab[_0x7b87('0x4f')],_0x25cfab['query']);_0x578bcc[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0x25cfab['model'],qs[_0x7b87('0x55')](_0x4eacc2[_0x7b87('0x50')][_0x7b87('0x55')]));_0x578bcc[_0x7b87('0x54')]=_0x578bcc[_0x7b87('0x54')][_0x7b87('0x65')]?_0x578bcc['attributes']:_0x25cfab['model'];if(!_0x4eacc2['query']['hasOwnProperty'](_0x7b87('0x57'))){_0x578bcc[_0x7b87('0x23')]=qs[_0x7b87('0x23')](_0x4eacc2[_0x7b87('0x50')]['limit']);_0x578bcc[_0x7b87('0x20')]=qs[_0x7b87('0x20')](_0x4eacc2[_0x7b87('0x50')][_0x7b87('0x20')]);}_0x578bcc[_0x7b87('0x58')]=qs[_0x7b87('0x59')](_0x4eacc2[_0x7b87('0x50')][_0x7b87('0x59')]);_0x578bcc['where']=qs[_0x7b87('0x52')](_[_0x7b87('0x5a')](_0x4eacc2[_0x7b87('0x50')],_0x25cfab[_0x7b87('0x52')]));_0x578bcc[_0x7b87('0x5b')]['MailAccountId']=_0x17efef['id'];if(_0x4eacc2[_0x7b87('0x50')][_0x7b87('0x5e')]){_0x578bcc[_0x7b87('0x5b')]=_[_0x7b87('0x5c')](_0x578bcc[_0x7b87('0x5b')],{'$or':_['map'](_0x578bcc[_0x7b87('0x54')],function(_0x3c4a1c){var _0x5e098a={};_0x5e098a[_0x3c4a1c]={'$like':'%'+_0x4eacc2[_0x7b87('0x50')][_0x7b87('0x5e')]+'%'};return _0x5e098a;})});}_0x578bcc=_[_0x7b87('0x5c')]({},_0x578bcc,_0x4eacc2['options']);return db[_0x7b87('0x8c')]['count']({'where':_0x578bcc[_0x7b87('0x5b')]})['then'](function(_0x4c9beb){_0x4edb10['count']=_0x4c9beb;if(_0x4eacc2['query'][_0x7b87('0x5f')]){_0x578bcc[_0x7b87('0x60')]=[{'model':db[_0x7b87('0x8d')],'as':_0x7b87('0x8e'),'required':![]},{'model':db[_0x7b87('0x8f')],'as':_0x7b87('0x90'),'attributes':['name',_0x7b87('0x91'),_0x7b87('0x92')],'required':![]},{'model':db[_0x7b87('0x93')],'as':'Tags','attributes':['id','name','color'],'where':_0x4eacc2['query']['tag']?{'id':_0x4eacc2['query'][_0x7b87('0x94')]}:undefined,'required':_0x4eacc2[_0x7b87('0x50')]['tag']?!![]:![]}];}return db[_0x7b87('0x8c')][_0x7b87('0x61')](_0x578bcc);})[_0x7b87('0x13')](function(_0x3ce08f){_0x4edb10[_0x7b87('0x62')]=_0x3ce08f;return _0x4edb10;});}})[_0x7b87('0x13')](respondWithFilteredResult(_0x43ac0c,_0x578bcc))[_0x7b87('0x1d')](handleError(_0x43ac0c,null));};exports[_0x7b87('0x95')]=function addApplications(_0x5b3fac,_0x4b576c){var _0x34956a=_0x5b3fac[_0x7b87('0x63')]['id'];var _0x3e3094=_0x5b3fac[_0x7b87('0x68')];var _0x500ccd=0xc8;var _0x1ce20f=null;return db[_0x7b87('0x96')][_0x7b87('0x97')]({'isolationLevel':db[_0x7b87('0x96')][_0x7b87('0x98')][_0x7b87('0x99')][_0x7b87('0x9a')]},function(_0x25bfc1){return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x34956a},'transaction':_0x25bfc1})[_0x7b87('0x13')](function(_0x36510f){if(_0x36510f){return db[_0x7b87('0x9b')][_0x7b87('0x27')]({'where':{'MailAccountId':_0x34956a},'transaction':_0x25bfc1})['then'](function(){var _0x1dc62a=_[_0x7b87('0x4a')](_0x3e3094,function(_0x19b3ba){_0x19b3ba['MailAccountId']=_0x34956a;return _0x19b3ba;});return db[_0x7b87('0x9b')]['bulkCreate'](_0x1dc62a,{'transaction':_0x25bfc1});});}else{_0x500ccd=0x194;_0x1ce20f=[];}});})[_0x7b87('0x13')](function(){if(_0x500ccd!==0x194){return db['MailApplication'][_0x7b87('0x9c')]({'where':{'MailAccountId':_0x34956a},'order':_0x7b87('0x9d')})['then'](function(_0x200cfb){_0x1ce20f=_0x200cfb;});}})[_0x7b87('0x1d')](function(_0x160f19){_0x500ccd=0x1f4;logger[_0x7b87('0x1a')](_0x160f19['stack']);if(_0x160f19[_0x7b87('0x2c')]){delete _0x160f19[_0x7b87('0x2c')];}_0x1ce20f=_0x160f19;})[_0x7b87('0x9e')](function(){if(_0x1ce20f===null){_0x4b576c[_0x7b87('0x1e')](_0x500ccd);}else{if(_0x500ccd===0x1f4){_0x4b576c[_0x7b87('0x1f')](_0x500ccd)[_0x7b87('0x2d')](_0x1ce20f);}else{_0x4b576c[_0x7b87('0x1f')](_0x500ccd)[_0x7b87('0x25')](_0x1ce20f);}}});};exports[_0x7b87('0x9f')]=function(_0x412bd5,_0x5b2be0){var _0x17b65f={};var _0x160929={};var _0x3a7cc0;var _0xea83c5;return db[_0x7b87('0x4b')][_0x7b87('0x75')]({'where':{'id':_0x412bd5[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x5b2be0,null))['then'](function(_0x1064fb){if(_0x1064fb){_0x3a7cc0=_0x1064fb;_0x160929[_0x7b87('0x4f')]=_[_0x7b87('0x51')](db['MailApplication']['rawAttributes']);_0x160929[_0x7b87('0x50')]=_[_0x7b87('0x51')](_0x412bd5['query']);_0x160929[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x160929[_0x7b87('0x4f')],_0x160929[_0x7b87('0x50')]);_0x17b65f[_0x7b87('0x54')]=_['intersection'](_0x160929[_0x7b87('0x4f')],qs[_0x7b87('0x55')](_0x412bd5['query'][_0x7b87('0x55')]));_0x17b65f['attributes']=_0x17b65f[_0x7b87('0x54')][_0x7b87('0x65')]?_0x17b65f[_0x7b87('0x54')]:_0x160929[_0x7b87('0x4f')];_0x17b65f[_0x7b87('0x58')]=qs[_0x7b87('0x59')](_0x412bd5[_0x7b87('0x50')][_0x7b87('0x59')]);_0x17b65f[_0x7b87('0x5b')]=qs[_0x7b87('0x52')](_[_0x7b87('0x5a')](_0x412bd5[_0x7b87('0x50')],_0x160929[_0x7b87('0x52')]));if(_0x412bd5[_0x7b87('0x50')][_0x7b87('0x5e')]){_0x17b65f['where']=_[_0x7b87('0x5c')](_0x17b65f[_0x7b87('0x5b')],{'$or':_[_0x7b87('0x4a')](_0x17b65f[_0x7b87('0x54')],function(_0xa06d33){var _0xcc9de3={};_0xcc9de3[_0xa06d33]={'$like':'%'+_0x412bd5[_0x7b87('0x50')][_0x7b87('0x5e')]+'%'};return _0xcc9de3;})});}_0x17b65f=_[_0x7b87('0x5c')]({},_0x17b65f,_0x412bd5[_0x7b87('0x66')]);return _0x3a7cc0['getApplications'](_0x17b65f);}})[_0x7b87('0x13')](function(_0x5606e9){if(_0x5606e9){_0xea83c5=_0x5606e9[_0x7b87('0x65')];if(!_0x412bd5[_0x7b87('0x50')][_0x7b87('0x56')](_0x7b87('0x57'))){_0x17b65f[_0x7b87('0x23')]=qs['limit'](_0x412bd5[_0x7b87('0x50')]['limit']);_0x17b65f['offset']=qs[_0x7b87('0x20')](_0x412bd5[_0x7b87('0x50')][_0x7b87('0x20')]);}return _0x3a7cc0[_0x7b87('0x9f')](_0x17b65f);}})[_0x7b87('0x13')](function(_0x222d3a){if(_0x222d3a){return _0x222d3a?{'count':_0xea83c5,'rows':_0x222d3a}:null;}})[_0x7b87('0x13')](respondWithResult(_0x5b2be0,null))[_0x7b87('0x1d')](handleError(_0x5b2be0,null));};exports[_0x7b87('0xa0')]=function(_0x9a0e4c,_0x232959){var _0x3ee749={'raw':!![],'where':{}};var _0x4dc8a9={};var _0x4ba135={'count':0x0,'rows':[]};return db[_0x7b87('0x4b')]['findOne']({'where':{'id':_0x9a0e4c[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x232959,null))[_0x7b87('0x13')](function(_0x2cff78){if(_0x2cff78){_0x4dc8a9['model']=_[_0x7b87('0x51')](db['MailMessage'][_0x7b87('0x4c')]);_0x4dc8a9[_0x7b87('0x50')]=_['keys'](_0x9a0e4c[_0x7b87('0x50')]);_0x4dc8a9[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0x4dc8a9[_0x7b87('0x4f')],_0x4dc8a9[_0x7b87('0x50')]);_0x3ee749[_0x7b87('0x54')]=_['intersection'](_0x4dc8a9[_0x7b87('0x4f')],qs[_0x7b87('0x55')](_0x9a0e4c[_0x7b87('0x50')][_0x7b87('0x55')]));_0x3ee749[_0x7b87('0x54')]=_0x3ee749[_0x7b87('0x54')][_0x7b87('0x65')]?_0x3ee749[_0x7b87('0x54')]:_0x4dc8a9['model'];if(!_0x9a0e4c[_0x7b87('0x50')][_0x7b87('0x56')](_0x7b87('0x57'))){_0x3ee749[_0x7b87('0x23')]=qs['limit'](_0x9a0e4c[_0x7b87('0x50')][_0x7b87('0x23')]);_0x3ee749['offset']=qs[_0x7b87('0x20')](_0x9a0e4c['query'][_0x7b87('0x20')]);}_0x3ee749[_0x7b87('0x58')]=qs[_0x7b87('0x59')](_0x9a0e4c[_0x7b87('0x50')][_0x7b87('0x59')]);_0x3ee749[_0x7b87('0x5b')]=qs['filters'](_[_0x7b87('0x5a')](_0x9a0e4c['query'],_0x4dc8a9['filters']));_0x3ee749[_0x7b87('0x5b')][_0x7b87('0x6c')]=_0x2cff78['id'];if(_0x9a0e4c['query']['filter']){_0x3ee749['where']=_[_0x7b87('0x5c')](_0x3ee749[_0x7b87('0x5b')],{'$or':_[_0x7b87('0x4a')](_0x3ee749['attributes'],function(_0x54e69e){var _0x209b24={};_0x209b24[_0x54e69e]={'$like':'%'+_0x9a0e4c['query']['filter']+'%'};return _0x209b24;})});}if(_0x9a0e4c[_0x7b87('0x50')][_0x7b87('0xa1')]){var _0x5b050e=_0x9a0e4c[_0x7b87('0x50')]['$gte'][_0x7b87('0xa2')](',');var _0x18bb1c={};_0x18bb1c[_0x5b050e[0x0]]={'$gte':moment(_0x5b050e[0x1])[_0x7b87('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3ee749[_0x7b87('0x5b')]=_[_0x7b87('0x5c')](_0x3ee749[_0x7b87('0x5b')],_0x18bb1c);}_0x3ee749=_[_0x7b87('0x5c')]({},_0x3ee749,_0x9a0e4c['options']);return db[_0x7b87('0xa4')][_0x7b87('0x22')]({'where':_0x3ee749[_0x7b87('0x5b')]})['then'](function(_0xe85cf7){_0x4ba135[_0x7b87('0x22')]=_0xe85cf7;if(_0x9a0e4c[_0x7b87('0x50')]['includeAll']){_0x3ee749['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x3ee749);})[_0x7b87('0x13')](function(_0xa83507){if(_0x9a0e4c['query'][_0x7b87('0xa5')]===_0x7b87('0xa6')){for(var _0x36bfd9=0x0;_0x36bfd9<_0xa83507[_0x7b87('0x65')];_0x36bfd9++){_0xa83507[_0x36bfd9][_0x7b87('0x68')]=juice(_0xa83507[_0x36bfd9][_0x7b87('0x68')]);}}_0x4ba135['rows']=_0xa83507;return _0x4ba135;});}})['then'](respondWithFilteredResult(_0x232959,_0x3ee749))[_0x7b87('0x1d')](handleError(_0x232959,null));};exports[_0x7b87('0x2d')]=function(_0x27032f,_0x11d2cd){var _0x51fc9e,_0x1e718f={},_0x5c4ba8;if(_0x27032f[_0x7b87('0x68')]['to']){_0x5c4ba8=_0x27032f['body']['to'][_0x7b87('0xa2')](',')[0x0];}return db['MailAccount'][_0x7b87('0x67')]({'where':{'id':_0x27032f['params']['id']},'include':[{'model':db[_0x7b87('0xa7')],'as':_0x7b87('0xa8'),'include':[{'model':db[_0x7b87('0x8d')],'as':_0x7b87('0xa9'),'where':{'email':_0x5c4ba8},'limit':0x1,'order':[['updatedAt',_0x7b87('0xaa')]]}]},{'model':db[_0x7b87('0x48')],'as':_0x7b87('0x46'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x7b87('0xab'),'raw':!![]}]}]})[_0x7b87('0x13')](handleEntityNotFound(_0x11d2cd,null))[_0x7b87('0x13')](function(_0x58f926){if(!_0x58f926)return;_0x51fc9e=_0x58f926;if(!_0x58f926['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x7b87('0x7b')](_0x27032f['body']['from'])){_0x27032f[_0x7b87('0x68')][_0x7b87('0xac')]=util['format'](_0x7b87('0xad'),_0x58f926[_0x7b87('0x2c')],_0x58f926[_0x7b87('0x79')]||_0x58f926[_0x7b87('0x46')][_0x7b87('0x3b')]);}if(_0x27032f['body']['attachments']&&_0x27032f[_0x7b87('0x68')][_0x7b87('0xae')]['length']){for(var _0x2df74b=0x0;_0x2df74b<_0x27032f[_0x7b87('0x68')][_0x7b87('0xae')][_0x7b87('0x65')];_0x2df74b+=0x1){_0x27032f[_0x7b87('0x68')][_0x7b87('0xae')][_0x2df74b]={'filename':_0x27032f[_0x7b87('0x68')][_0x7b87('0xae')][_0x2df74b][_0x7b87('0x2c')],'path':path[_0x7b87('0xaf')](config['root'],_0x7b87('0xb0'),_0x27032f[_0x7b87('0x68')][_0x7b87('0xae')][_0x2df74b]['basename'])};}}var _0xd771d7=_0x58f926[_0x7b87('0xb1')]();return respondWithRpcPromise(_0x7b87('0xb2'),_0x7b87('0xb3'),{'account':_0xd771d7,'message':_0x27032f[_0x7b87('0x68')]});})[_0x7b87('0x13')](function(_0x5ee91e){if(!_0x5ee91e)return;_0x1e718f=_0x5ee91e;if(!_0x51fc9e['List'])throw new Error('List\x20not\x20found');if(_0x51fc9e[_0x7b87('0xa8')][_0x7b87('0xa9')][_0x7b87('0x65')])return _0x51fc9e['List']['Contacts'][0x0];return db[_0x7b87('0x8d')]['create'](_[_0x7b87('0xc')](_0x27032f[_0x7b87('0x68')],{'firstName':_0x27032f['body']['to'],'email':_0x27032f[_0x7b87('0x68')]['to'],'phone':_0x27032f[_0x7b87('0x68')]['to'],'ListId':_0x51fc9e[_0x7b87('0x7a')]}));})[_0x7b87('0x13')](function(_0x1c77d8){if(!_0x1c77d8)return;var _0x2a1b72={'UserId':_0x27032f[_0x7b87('0x3b')]['id'],'ContactId':_0x1c77d8['id'],'MailAccountId':_0x51fc9e['id'],'inReplyTo':_0x1e718f[_0x7b87('0xb4')],'to':_0x27032f[_0x7b87('0x68')]['from'],'cc':_0x27032f[_0x7b87('0x68')]['cc'],'subject':_0x27032f[_0x7b87('0x68')][_0x7b87('0xb5')],'attach':_0x27032f['body'][_0x7b87('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x7b87('0xa3')](_0x7b87('0xb7')),'lastMsgDirection':_0x7b87('0xb8'),'Messages':[_[_0x7b87('0x5c')](_0x27032f['body'],{'messageId':_0x1e718f[_0x7b87('0xb4')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x51fc9e['id'],'UserId':_0x27032f['user']['id'],'ContactId':_0x1c77d8['id']})]};if(_0x27032f['body'][_0x7b87('0xb9')]){_0x2a1b72=_[_0x7b87('0x5c')](_0x2a1b72,_0x27032f[_0x7b87('0x68')][_0x7b87('0xb9')]);}return db[_0x7b87('0x8c')][_0x7b87('0x6d')](_0x2a1b72,{'include':[{'model':db[_0x7b87('0xa4')],'as':_0x7b87('0xba')}]});})['then'](respondWithResult(_0x11d2cd,null))[_0x7b87('0x1d')](handleError(_0x11d2cd,null));};exports[_0x7b87('0xbb')]=function(_0x2481c7,_0x17da49){return db[_0x7b87('0x4b')]['find']({'where':{'id':_0x2481c7[_0x7b87('0x63')]['id']},'include':[{'model':db[_0x7b87('0x48')],'as':_0x7b87('0x46'),'raw':!![],'include':[{'model':db[_0x7b87('0xab')],'as':_0x7b87('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x17da49,null))[_0x7b87('0x13')](function(_0x59e2d0){if(!_0x59e2d0[_0x7b87('0x46')])return;var _0xf0163a=_0x59e2d0['getSmtpOptions']();return respondWithRpcPromise(_0x7b87('0xbc'),_0x7b87('0xbb'),{'account':_0xf0163a});})[_0x7b87('0x13')](respondWithResult(_0x17da49,null))[_0x7b87('0x1d')](handleError(_0x17da49,null));};exports[_0x7b87('0x27')]=function(_0x45a562,_0x57177e){return db['MailAccount']['find']({'where':{'id':_0x45a562[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x57177e,null))['then'](function(_0x530737){if(_0x530737&&_0x530737['service']){throw new db[(_0x7b87('0xbd'))]['ValidationError'](_0x7b87('0xbe'));}return _0x530737;})[_0x7b87('0x13')](removeEntity(_0x57177e,null))['catch'](handleError(_0x57177e,null));};exports[_0x7b87('0xbf')]=function(_0x43f102,_0xd69708){return db[_0x7b87('0x4b')]['find']({'where':{'id':_0x43f102['params']['id']}})['then'](handleEntityNotFound(_0xd69708,null))[_0x7b87('0x13')](function(_0x596018){if(_0x596018){return _0x596018[_0x7b87('0xbf')](_0x43f102[_0x7b87('0x68')][_0x7b87('0x71')],_[_0x7b87('0x8a')](_0x43f102[_0x7b87('0x68')],[_0x7b87('0x71'),'id'])||{})[_0x7b87('0xc0')](function(_0x4e3fc4){for(var _0x4348c9=0x0;_0x4348c9<_0x43f102[_0x7b87('0x68')][_0x7b87('0x71')][_0x7b87('0x65')];_0x4348c9+=0x1){socket[_0x7b87('0xc1')](_0x7b87('0xc2'),{'UserId':Number(_0x43f102['body']['ids'][_0x4348c9]),'MailAccountId':Number(_0x43f102[_0x7b87('0x63')]['id'])});}return _0x4e3fc4;});}})[_0x7b87('0x13')](respondWithResult(_0xd69708,null))[_0x7b87('0x1d')](handleError(_0xd69708,null));};exports[_0x7b87('0xc3')]=function(_0x109ba6,_0x63fe9d){return db[_0x7b87('0x4b')][_0x7b87('0x67')]({'where':{'id':_0x109ba6[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x63fe9d,null))[_0x7b87('0x13')](function(_0x97fc2f){if(_0x97fc2f){return _0x97fc2f[_0x7b87('0xc3')](_0x109ba6['query'][_0x7b87('0x71')])[_0x7b87('0x13')](function(){if(_['isArray'](_0x109ba6[_0x7b87('0x50')][_0x7b87('0x71')])){for(var _0x363404=0x0;_0x363404<_0x109ba6[_0x7b87('0x50')][_0x7b87('0x71')]['length'];_0x363404+=0x1){socket['emit'](_0x7b87('0xc4'),{'UserId':Number(_0x109ba6[_0x7b87('0x50')][_0x7b87('0x71')][_0x363404]),'MailAccountId':Number(_0x109ba6['params']['id'])});}}else{socket['emit'](_0x7b87('0xc4'),{'UserId':Number(_0x109ba6[_0x7b87('0x50')][_0x7b87('0x71')]),'MailAccountId':Number(_0x109ba6['params']['id'])});}});}})[_0x7b87('0x13')](respondWithStatusCode(_0x63fe9d,null))[_0x7b87('0x1d')](handleError(_0x63fe9d,null));};exports[_0x7b87('0xc5')]=function(_0x1d8538,_0x2264ce){var _0x11f832={};var _0xaf65b4={};var _0x5e3541;var _0x26b86f;return db[_0x7b87('0x4b')]['findOne']({'where':{'id':_0x1d8538[_0x7b87('0x63')]['id']}})[_0x7b87('0x13')](handleEntityNotFound(_0x2264ce,null))['then'](function(_0x2d45bf){if(_0x2d45bf){_0x5e3541=_0x2d45bf;_0xaf65b4[_0x7b87('0x4f')]=_[_0x7b87('0x51')](db['User'][_0x7b87('0x4c')]);_0xaf65b4[_0x7b87('0x50')]=_[_0x7b87('0x51')](_0x1d8538[_0x7b87('0x50')]);_0xaf65b4[_0x7b87('0x52')]=_[_0x7b87('0x53')](_0xaf65b4[_0x7b87('0x4f')],_0xaf65b4['query']);_0x11f832[_0x7b87('0x54')]=_[_0x7b87('0x53')](_0xaf65b4[_0x7b87('0x4f')],qs[_0x7b87('0x55')](_0x1d8538[_0x7b87('0x50')][_0x7b87('0x55')]));_0x11f832['attributes']=_0x11f832[_0x7b87('0x54')][_0x7b87('0x65')]?_0x11f832[_0x7b87('0x54')]:_0xaf65b4[_0x7b87('0x4f')];_0x11f832[_0x7b87('0x58')]=qs[_0x7b87('0x59')](_0x1d8538[_0x7b87('0x50')][_0x7b87('0x59')]);_0x11f832[_0x7b87('0x5b')]=qs[_0x7b87('0x52')](_[_0x7b87('0x5a')](_0x1d8538[_0x7b87('0x50')],_0xaf65b4[_0x7b87('0x52')]));if(_0x1d8538[_0x7b87('0x50')][_0x7b87('0x5e')]){_0x11f832[_0x7b87('0x5b')]=_[_0x7b87('0x5c')](_0x11f832[_0x7b87('0x5b')],{'$or':_[_0x7b87('0x4a')](_0x11f832[_0x7b87('0x54')],function(_0x4ab955){var _0x6c702={};_0x6c702[_0x4ab955]={'$like':'%'+_0x1d8538['query']['filter']+'%'};return _0x6c702;})});}_0x11f832=_[_0x7b87('0x5c')]({},_0x11f832,_0x1d8538['options']);return _0x5e3541['getAgents'](_0x11f832);}})['then'](function(_0x328824){if(_0x328824){_0x26b86f=_0x328824[_0x7b87('0x65')];if(!_0x1d8538[_0x7b87('0x50')][_0x7b87('0x56')](_0x7b87('0x57'))){_0x11f832['limit']=qs[_0x7b87('0x23')](_0x1d8538['query']['limit']);_0x11f832[_0x7b87('0x20')]=qs[_0x7b87('0x20')](_0x1d8538[_0x7b87('0x50')][_0x7b87('0x20')]);}return _0x5e3541['getAgents'](_0x11f832);}})['then'](function(_0x459b1e){if(_0x459b1e){return _0x459b1e?{'count':_0x26b86f,'rows':_0x459b1e}:null;}})[_0x7b87('0x13')](respondWithResult(_0x2264ce,null))['catch'](handleError(_0x2264ce,null));}; \ No newline at end of file +var _0x4dd1=['sort','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','MailServerIn','rawAttributes','merge','find','body','provider','custom','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','keys','where','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','isNil','active','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','User','Owner','fullname','Tag','Tags','color','tag','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','finally','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','defaults','ListId','messageId','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','MailAccounts','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','pass','password','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x338f3c,_0x416a1c){var _0x5ba6f6=function(_0x4b52de){while(--_0x4b52de){_0x338f3c['push'](_0x338f3c['shift']());}};_0x5ba6f6(++_0x416a1c);}(_0x4dd1,0x73));var _0x14dd=function(_0x1cd9a3,_0x316806){_0x1cd9a3=_0x1cd9a3-0x0;var _0x1e6039=_0x4dd1[_0x1cd9a3];return _0x1e6039;};'use strict';var moment=require(_0x14dd('0x0'));var BPromise=require(_0x14dd('0x1'));var util=require('util');var path=require('path');var _=require(_0x14dd('0x2'));var juice=require('juice');var Redis=require(_0x14dd('0x3'));var qs=require(_0x14dd('0x4'));var logger=require(_0x14dd('0x5'))(_0x14dd('0x6'));var config=require('../../config/environment');var db=require(_0x14dd('0x7'))['db'];config[_0x14dd('0x8')]=_['defaults'](config[_0x14dd('0x8')],{'host':_0x14dd('0x9'),'port':0x18eb});var socket=require(_0x14dd('0xa'))(new Redis(config[_0x14dd('0x8')]));require(_0x14dd('0xb'))['register'](socket);var jayson=require(_0x14dd('0xc'));var client=jayson[_0x14dd('0xd')][_0x14dd('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x10104d,_0x1438a1,_0x1692e1,_0x17a3e6){return new BPromise(function(_0x4b0437,_0x388c3e){var _0x293e45=_0x17a3e6||client;return _0x293e45['request'](_0x10104d,_0x1692e1)[_0x14dd('0xf')](function(_0xf223f1){logger[_0x14dd('0x10')](_0x14dd('0x11'),_0x1438a1,_0x14dd('0x12'));logger[_0x14dd('0x13')](_0x14dd('0x14'),_0x1438a1,'request\x20sent',JSON[_0x14dd('0x15')](_0xf223f1));if(_0xf223f1['error']){if(_0xf223f1[_0x14dd('0x16')][_0x14dd('0x17')]===0x1f4){logger[_0x14dd('0x16')](_0x14dd('0x11'),_0x1438a1,_0xf223f1[_0x14dd('0x16')]['message']);return _0x388c3e(_0xf223f1[_0x14dd('0x16')][_0x14dd('0x18')]);}logger[_0x14dd('0x16')](_0x14dd('0x11'),_0x1438a1,_0xf223f1['error'][_0x14dd('0x18')]);return _0x4b0437(_0xf223f1['error']['message']);}else{logger[_0x14dd('0x10')](_0x14dd('0x11'),_0x1438a1,_0x14dd('0x12'));_0x4b0437(_0xf223f1[_0x14dd('0x19')][_0x14dd('0x18')]);}})[_0x14dd('0x1a')](function(_0x3b46bd){logger[_0x14dd('0x16')]('MailAccount,\x20%s,\x20%s',_0x1438a1,_0x3b46bd);_0x388c3e(_0x3b46bd);});});}function respondWithStatusCode(_0x4548c4,_0x4e9034){_0x4e9034=_0x4e9034||0xcc;return function(_0x3957db){if(_0x3957db){return _0x4548c4[_0x14dd('0x1b')](_0x4e9034);}return _0x4548c4['status'](_0x4e9034)[_0x14dd('0x1c')]();};}function respondWithResult(_0x44c334,_0x6fc74c){_0x6fc74c=_0x6fc74c||0xc8;return function(_0x18c57c){if(_0x18c57c){return _0x44c334[_0x14dd('0x1d')](_0x6fc74c)[_0x14dd('0x1e')](_0x18c57c);}};}function respondWithFilteredResult(_0x531c7b,_0x4e36f7){return function(_0x1362b8){if(_0x1362b8){var _0x20fa48=typeof _0x4e36f7[_0x14dd('0x1f')]===_0x14dd('0x20')&&typeof _0x4e36f7[_0x14dd('0x21')]===_0x14dd('0x20');var _0x3e7374=_0x1362b8[_0x14dd('0x22')];var _0x15bd5e=_0x20fa48?0x0:_0x4e36f7[_0x14dd('0x1f')];var _0x332c19=_0x20fa48?_0x1362b8['count']:_0x4e36f7[_0x14dd('0x1f')]+_0x4e36f7[_0x14dd('0x21')];var _0x35e00a;if(_0x332c19>=_0x3e7374){_0x332c19=_0x3e7374;_0x35e00a=0xc8;}else{_0x35e00a=0xce;}_0x531c7b[_0x14dd('0x1d')](_0x35e00a);return _0x531c7b['set'](_0x14dd('0x23'),_0x15bd5e+'-'+_0x332c19+'/'+_0x3e7374)[_0x14dd('0x1e')](_0x1362b8);}return null;};}function saveUpdates(_0x48123e){return function(_0x422485){if(_0x422485){return _0x422485['update'](_0x48123e)[_0x14dd('0xf')](function(_0x1c00f2){return _0x1c00f2;});}return null;};}function removeEntity(_0x3a82b6){return function(_0x41fa22){if(_0x41fa22){return _0x41fa22[_0x14dd('0x24')]()['then'](function(){var _0x452791=_0x41fa22['get']({'plain':!![]});var _0x2a5c90=_0x14dd('0x25');return db['UserProfileResource'][_0x14dd('0x24')]({'where':{'type':_0x2a5c90,'resourceId':_0x452791['id']}})['then'](function(){return _0x41fa22;});})[_0x14dd('0xf')](function(){_0x3a82b6['status'](0xcc)[_0x14dd('0x1c')]();});}};}function handleEntityNotFound(_0x2380d4){return function(_0x3e6838){if(!_0x3e6838){_0x2380d4['sendStatus'](0x194);}return _0x3e6838;};}function handleError(_0x5722c6,_0x154549){_0x154549=_0x154549||0x1f4;return function(_0x6ec1b1){logger[_0x14dd('0x16')](_0x6ec1b1['stack']);if(_0x6ec1b1['name']){delete _0x6ec1b1['name'];}_0x5722c6[_0x14dd('0x1d')](_0x154549)[_0x14dd('0x26')](_0x6ec1b1);};}function getImapHost(_0x5ea48d){switch(_0x5ea48d){case _0x14dd('0x27'):return _0x14dd('0x28');case _0x14dd('0x29'):return'imap.mail.yahoo.com';case _0x14dd('0x2a'):return _0x14dd('0x2b');case _0x14dd('0x2c'):return _0x14dd('0x2d');}throw new Error('Unknown\x20email\x20service\x20provider',_0x5ea48d);}function getSmtpHost(_0x1775d2){switch(_0x1775d2){case _0x14dd('0x27'):return _0x14dd('0x2e');case'yahoo':return _0x14dd('0x2f');case'hotmail':return'smtp-mail.outlook.com';case'outlook365':return _0x14dd('0x30');}throw new Error(_0x14dd('0x31'),_0x1775d2);}function getAuthenticationOptions(_0x1f92d5,_0x21d148){var _0x266fe2={};var _0x4b18cb={};if(_0x1f92d5){_0x266fe2[_0x14dd('0x32')]=_0x4b18cb[_0x14dd('0x32')]=_0x21d148['username'];_0x266fe2['password']=_0x4b18cb[_0x14dd('0x33')]=_0x21d148[_0x14dd('0x34')];if(_0x21d148[_0x14dd('0x35')]){_0x266fe2['modernAuthentication']=_0x4b18cb[_0x14dd('0x35')]=!![];_0x266fe2[_0x14dd('0x36')]=_0x4b18cb[_0x14dd('0x36')]=_0x21d148['CloudProviderId'];_0x266fe2[_0x14dd('0x34')]=_0x4b18cb[_0x14dd('0x33')]=null;}else{_0x266fe2[_0x14dd('0x36')]=_0x4b18cb[_0x14dd('0x36')]=null;}_0x266fe2['host']=getImapHost(_0x1f92d5);_0x266fe2[_0x14dd('0x37')]=0x3e1;_0x4b18cb[_0x14dd('0x38')]=getSmtpHost(_0x1f92d5);_0x4b18cb[_0x14dd('0x37')]=0x24b;_0x4b18cb[_0x14dd('0x39')]=![];_0x266fe2[_0x14dd('0x3a')]=_0x4b18cb['service']=null;}else{if(_0x21d148[_0x14dd('0x3b')]){_0x266fe2[_0x14dd('0x32')]=_0x4b18cb[_0x14dd('0x32')]=_0x21d148['username'];_0x266fe2[_0x14dd('0x34')]=_0x4b18cb['pass']=_0x21d148['password'];}else{_0x266fe2[_0x14dd('0x3b')]=_0x4b18cb[_0x14dd('0x3b')]=![];_0x266fe2[_0x14dd('0x32')]=_0x4b18cb['user']=null;_0x266fe2[_0x14dd('0x34')]=_0x4b18cb[_0x14dd('0x33')]=null;}_0x266fe2[_0x14dd('0x38')]=_0x21d148[_0x14dd('0x3c')][_0x14dd('0x38')];_0x266fe2[_0x14dd('0x37')]=_0x21d148[_0x14dd('0x3c')][_0x14dd('0x37')];_0x4b18cb[_0x14dd('0x38')]=_0x21d148['Smtp'][_0x14dd('0x38')];_0x4b18cb['port']=_0x21d148[_0x14dd('0x3d')][_0x14dd('0x37')];}return{'Imap':_0x266fe2,'Smtp':_0x4b18cb};}exports[_0x14dd('0x3e')]=function(_0x13fa27,_0x93870c){var _0x53010c={'include':[{'model':db['MailServerIn'],'as':_0x14dd('0x3c')},{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d')},{'model':db[_0x14dd('0x40')],'as':_0x14dd('0x41')}]},_0x4c63fc={},_0x110956={'count':0x0,'rows':[]};var _0x1c314a=_[_0x14dd('0x42')](db[_0x14dd('0x43')]['rawAttributes'],function(_0x1c9092){return{'name':_0x1c9092['fieldName'],'type':_0x1c9092[_0x14dd('0x44')][_0x14dd('0x45')]};});_0x4c63fc[_0x14dd('0x46')]=_['map'](_0x1c314a,_0x14dd('0x47'));_0x4c63fc[_0x14dd('0x48')]=_['keys'](_0x13fa27[_0x14dd('0x48')]);_0x4c63fc['filters']=_[_0x14dd('0x49')](_0x4c63fc[_0x14dd('0x46')],_0x4c63fc['query']);_0x53010c[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x4c63fc[_0x14dd('0x46')],qs['fields'](_0x13fa27['query'][_0x14dd('0x4b')]));_0x53010c[_0x14dd('0x4a')]=_0x53010c[_0x14dd('0x4a')][_0x14dd('0x4c')]?_0x53010c[_0x14dd('0x4a')]:_0x4c63fc[_0x14dd('0x46')];if(!_0x13fa27[_0x14dd('0x48')][_0x14dd('0x4d')](_0x14dd('0x4e'))){_0x53010c[_0x14dd('0x21')]=qs['limit'](_0x13fa27['query']['limit']);_0x53010c['offset']=qs['offset'](_0x13fa27['query'][_0x14dd('0x1f')]);}_0x53010c[_0x14dd('0x4f')]=qs[_0x14dd('0x50')](_0x13fa27[_0x14dd('0x48')][_0x14dd('0x50')]);_0x53010c['where']=qs[_0x14dd('0x51')](_[_0x14dd('0x52')](_0x13fa27[_0x14dd('0x48')],_0x4c63fc[_0x14dd('0x51')]),_0x1c314a);if(_0x13fa27[_0x14dd('0x48')]['filter']){_0x53010c['where']=_['merge'](_0x53010c['where'],{'$or':_[_0x14dd('0x42')](_0x1c314a,function(_0x59d8c0){if(_0x59d8c0['type']!==_0x14dd('0x53')){var _0x13d5d5={};_0x13d5d5[_0x59d8c0['name']]={'$like':'%'+_0x13fa27[_0x14dd('0x48')][_0x14dd('0x54')]+'%'};return _0x13d5d5;}})});}_0x53010c=_['merge']({},_0x53010c,_0x13fa27[_0x14dd('0x55')]);var _0x141cf5={'where':_0x53010c['where']};return db['MailAccount'][_0x14dd('0x22')](_0x141cf5)['then'](function(_0x261a34){_0x110956[_0x14dd('0x22')]=_0x261a34;if(_0x13fa27[_0x14dd('0x48')][_0x14dd('0x56')]){_0x53010c[_0x14dd('0x57')]=[{'all':!![]}];}return db[_0x14dd('0x43')][_0x14dd('0x58')](_0x53010c);})[_0x14dd('0xf')](function(_0x20b8c7){_0x110956[_0x14dd('0x59')]=_0x20b8c7;return _0x110956;})[_0x14dd('0xf')](respondWithFilteredResult(_0x93870c,_0x53010c))['catch'](handleError(_0x93870c,null));};exports[_0x14dd('0x5a')]=function(_0x5adb6b,_0x30f872){var _0x13c5d0={'raw':![],'where':{'id':_0x5adb6b[_0x14dd('0x5b')]['id']},'include':[{'model':db[_0x14dd('0x5c')],'as':'Imap'},{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d')},{'model':db[_0x14dd('0x40')],'as':_0x14dd('0x41')}]},_0x3a1421={};_0x3a1421[_0x14dd('0x46')]=_['keys'](db['MailAccount'][_0x14dd('0x5d')]);_0x3a1421['query']=_['keys'](_0x5adb6b['query']);_0x3a1421[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0x3a1421[_0x14dd('0x46')],_0x3a1421[_0x14dd('0x48')]);_0x13c5d0['attributes']=_[_0x14dd('0x49')](_0x3a1421[_0x14dd('0x46')],qs[_0x14dd('0x4b')](_0x5adb6b['query'][_0x14dd('0x4b')]));_0x13c5d0[_0x14dd('0x4a')]=_0x13c5d0[_0x14dd('0x4a')]['length']?_0x13c5d0[_0x14dd('0x4a')]:_0x3a1421['model'];if(_0x5adb6b[_0x14dd('0x48')][_0x14dd('0x56')]){_0x13c5d0[_0x14dd('0x57')]=[{'all':!![]}];}_0x13c5d0=_[_0x14dd('0x5e')]({},_0x13c5d0,_0x5adb6b[_0x14dd('0x55')]);return db['MailAccount'][_0x14dd('0x5f')](_0x13c5d0)[_0x14dd('0xf')](handleEntityNotFound(_0x30f872,null))['then'](respondWithResult(_0x30f872,null))['catch'](handleError(_0x30f872,null));};exports['update']=function(_0x412313,_0x3be7f9){if(_0x412313[_0x14dd('0x60')]['id']){delete _0x412313['body']['id'];}var _0x1b39c0=_0x412313[_0x14dd('0x60')][_0x14dd('0x61')]===_0x14dd('0x62')?null:_0x412313[_0x14dd('0x60')][_0x14dd('0x61')];var _0x45bbca=_0x412313[_0x14dd('0x60')][_0x14dd('0x3c')]||{};var _0x594baa=_0x412313['body']['Smtp']||{};if(_0x1b39c0){_0x45bbca['host']=getImapHost(_0x1b39c0);_0x45bbca[_0x14dd('0x37')]=0x3e1;_0x594baa[_0x14dd('0x38')]=getSmtpHost(_0x1b39c0);_0x594baa['port']=0x24b;_0x594baa[_0x14dd('0x39')]=![];}if(_0x594baa[_0x14dd('0x35')]){_0x594baa[_0x14dd('0x39')]=![];}else{_0x594baa[_0x14dd('0x36')]=null;}if(!_0x45bbca[_0x14dd('0x35')])_0x45bbca['CloudProviderId']=null;_0x412313[_0x14dd('0x60')][_0x14dd('0x3c')]=_0x45bbca;_0x412313[_0x14dd('0x60')]['Smtp']=_0x594baa;return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0x412313['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x14dd('0x3c')},{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d')},{'model':db[_0x14dd('0x40')],'as':'mandatoryDispositionPause'}]})[_0x14dd('0xf')](handleEntityNotFound(_0x3be7f9,null))[_0x14dd('0xf')](function(_0x43a6cd){if(!_0x43a6cd)throw new Error(_0x14dd('0x63'));if(_0x43a6cd[_0x14dd('0x3a')])delete _0x412313[_0x14dd('0x60')][_0x14dd('0x3c')];return _0x43a6cd;})[_0x14dd('0xf')](saveUpdates(_0x412313[_0x14dd('0x60')],null))['then'](function(_0x1f9470){if(!_0x412313[_0x14dd('0x60')][_0x14dd('0x3c')])return _0x1f9470;return db[_0x14dd('0x5c')][_0x14dd('0x64')](_0x412313['body'][_0x14dd('0x3c')],{'where':{'MailAccountId':_0x1f9470['id']}})[_0x14dd('0xf')](function(){return _0x1f9470;});})[_0x14dd('0xf')](function(_0x22c90a){if(!_0x412313[_0x14dd('0x60')][_0x14dd('0x3d')])return _0x22c90a;return db[_0x14dd('0x3f')][_0x14dd('0x64')](_0x412313[_0x14dd('0x60')][_0x14dd('0x3d')],{'where':{'MailAccountId':_0x22c90a['id']}})[_0x14dd('0xf')](function(){return _0x22c90a;});})[_0x14dd('0xf')](respondWithResult(_0x3be7f9,null))[_0x14dd('0x1a')](handleError(_0x3be7f9,null));};exports[_0x14dd('0x65')]=function(_0x15acd2,_0x49c33d){return db[_0x14dd('0x43')][_0x14dd('0x65')]()['then'](respondWithResult(_0x49c33d,null))[_0x14dd('0x1a')](handleError(_0x49c33d,null));};exports[_0x14dd('0x66')]=function(_0xaffaef,_0x39939b){if(_0xaffaef[_0x14dd('0x60')]['id']){delete _0xaffaef[_0x14dd('0x60')]['id'];}return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0xaffaef[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x39939b,null))[_0x14dd('0xf')](function(_0x7125fd){if(_0x7125fd){_0xaffaef[_0x14dd('0x60')][_0x14dd('0x67')]=_0x7125fd['id'];return db[_0x14dd('0x68')][_0x14dd('0x69')](_0xaffaef[_0x14dd('0x60')]);}})['then'](respondWithResult(_0x39939b,null))['catch'](handleError(_0x39939b,null));};exports[_0x14dd('0x6a')]=function(_0x2ba859,_0x54467b){var _0x418b95={'raw':![],'where':{}};var _0xd6c564={};var _0xf29cc8={'count':0x0,'rows':[]};return db[_0x14dd('0x43')]['findOne']({'where':{'id':_0x2ba859[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x54467b,null))[_0x14dd('0xf')](function(_0x34d725){if(_0x34d725){_0xd6c564[_0x14dd('0x46')]=_[_0x14dd('0x6b')](db[_0x14dd('0x68')]['rawAttributes']);_0xd6c564['query']=_[_0x14dd('0x6b')](_0x2ba859[_0x14dd('0x48')]);_0xd6c564[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0xd6c564[_0x14dd('0x46')],_0xd6c564['query']);_0x418b95[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0xd6c564[_0x14dd('0x46')],qs[_0x14dd('0x4b')](_0x2ba859['query'][_0x14dd('0x4b')]));_0x418b95[_0x14dd('0x4a')]=_0x418b95[_0x14dd('0x4a')][_0x14dd('0x4c')]?_0x418b95[_0x14dd('0x4a')]:_0xd6c564[_0x14dd('0x46')];if(!_0x2ba859[_0x14dd('0x48')]['hasOwnProperty'](_0x14dd('0x4e'))){_0x418b95[_0x14dd('0x21')]=qs['limit'](_0x2ba859[_0x14dd('0x48')][_0x14dd('0x21')]);_0x418b95[_0x14dd('0x1f')]=qs['offset'](_0x2ba859[_0x14dd('0x48')][_0x14dd('0x1f')]);}_0x418b95[_0x14dd('0x4f')]=qs['sort'](_0x2ba859[_0x14dd('0x48')][_0x14dd('0x50')]);_0x418b95[_0x14dd('0x6c')]=qs[_0x14dd('0x51')](_[_0x14dd('0x52')](_0x2ba859[_0x14dd('0x48')],_0xd6c564[_0x14dd('0x51')]));_0x418b95['where'][_0x14dd('0x67')]=_0x34d725['id'];if(_0x2ba859['query'][_0x14dd('0x54')]){_0x418b95[_0x14dd('0x6c')]=_['merge'](_0x418b95[_0x14dd('0x6c')],{'$or':_[_0x14dd('0x42')](_0x418b95[_0x14dd('0x4a')],function(_0x3ec639){var _0x52a9b2={};_0x52a9b2[_0x3ec639]={'$like':'%'+_0x2ba859[_0x14dd('0x48')]['filter']+'%'};return _0x52a9b2;})});}_0x418b95=_[_0x14dd('0x5e')]({},_0x418b95,_0x2ba859[_0x14dd('0x55')]);return db['Disposition']['count']({'where':_0x418b95[_0x14dd('0x6c')]})[_0x14dd('0xf')](function(_0x354f30){_0xf29cc8[_0x14dd('0x22')]=_0x354f30;if(_0x2ba859[_0x14dd('0x48')][_0x14dd('0x56')]){_0x418b95['include']=[{'all':!![]}];}return db[_0x14dd('0x68')][_0x14dd('0x58')](_0x418b95);})[_0x14dd('0xf')](function(_0x42f594){_0xf29cc8[_0x14dd('0x59')]=_0x42f594;return _0xf29cc8;});}})[_0x14dd('0xf')](respondWithFilteredResult(_0x54467b,_0x418b95))[_0x14dd('0x1a')](handleError(_0x54467b,null));};exports[_0x14dd('0x6d')]=function(_0xc93889,_0x31a9d1){return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0xc93889[_0x14dd('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31a9d1,null))['then'](function(_0x5c1f9f){if(_0x5c1f9f){return _0x5c1f9f[_0x14dd('0x6d')](_0xc93889[_0x14dd('0x48')]['ids']);}})[_0x14dd('0xf')](respondWithStatusCode(_0x31a9d1,null))['catch'](handleError(_0x31a9d1,null));};exports['addAnswer']=function(_0x18ee3,_0x2737fa){if(_0x18ee3[_0x14dd('0x60')]['id']){delete _0x18ee3[_0x14dd('0x60')]['id'];}return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0x18ee3['params']['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x2737fa,null))[_0x14dd('0xf')](function(_0xf02996){if(_0xf02996){_0x18ee3['body']['MailAccountId']=_0xf02996['id'];return db['CannedAnswer'][_0x14dd('0x69')](_0x18ee3['body']);}})['then'](respondWithResult(_0x2737fa,null))['catch'](handleError(_0x2737fa,null));};exports[_0x14dd('0x6e')]=function(_0x282dde,_0x84e040){var _0x1d4e53={'raw':![],'where':{}};var _0x44efc3={};var _0x56d391={'count':0x0,'rows':[]};return db[_0x14dd('0x43')]['findOne']({'where':{'id':_0x282dde['params']['id']}})['then'](handleEntityNotFound(_0x84e040,null))['then'](function(_0x58be4c){if(_0x58be4c){_0x44efc3[_0x14dd('0x46')]=_['keys'](db[_0x14dd('0x6f')]['rawAttributes']);_0x44efc3[_0x14dd('0x48')]=_[_0x14dd('0x6b')](_0x282dde['query']);_0x44efc3[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0x44efc3[_0x14dd('0x46')],_0x44efc3[_0x14dd('0x48')]);_0x1d4e53[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x44efc3[_0x14dd('0x46')],qs[_0x14dd('0x4b')](_0x282dde[_0x14dd('0x48')]['fields']));_0x1d4e53['attributes']=_0x1d4e53[_0x14dd('0x4a')]['length']?_0x1d4e53['attributes']:_0x44efc3[_0x14dd('0x46')];if(!_0x282dde['query'][_0x14dd('0x4d')](_0x14dd('0x4e'))){_0x1d4e53[_0x14dd('0x21')]=qs[_0x14dd('0x21')](_0x282dde[_0x14dd('0x48')]['limit']);_0x1d4e53[_0x14dd('0x1f')]=qs[_0x14dd('0x1f')](_0x282dde[_0x14dd('0x48')][_0x14dd('0x1f')]);}_0x1d4e53['order']=qs[_0x14dd('0x50')](_0x282dde[_0x14dd('0x48')][_0x14dd('0x50')]);_0x1d4e53[_0x14dd('0x6c')]=qs[_0x14dd('0x51')](_[_0x14dd('0x52')](_0x282dde[_0x14dd('0x48')],_0x44efc3['filters']));_0x1d4e53['where'][_0x14dd('0x67')]=_0x58be4c['id'];if(_0x282dde['query']['filter']){_0x1d4e53['where']=_[_0x14dd('0x5e')](_0x1d4e53[_0x14dd('0x6c')],{'$or':_[_0x14dd('0x42')](_0x1d4e53[_0x14dd('0x4a')],function(_0x36f0e5){var _0x2870a7={};_0x2870a7[_0x36f0e5]={'$like':'%'+_0x282dde[_0x14dd('0x48')][_0x14dd('0x54')]+'%'};return _0x2870a7;})});}_0x1d4e53=_[_0x14dd('0x5e')]({},_0x1d4e53,_0x282dde['options']);return db[_0x14dd('0x6f')][_0x14dd('0x22')]({'where':_0x1d4e53[_0x14dd('0x6c')]})[_0x14dd('0xf')](function(_0x5034ca){_0x56d391['count']=_0x5034ca;if(_0x282dde['query'][_0x14dd('0x56')]){_0x1d4e53[_0x14dd('0x57')]=[{'all':!![]}];}return db[_0x14dd('0x6f')]['findAll'](_0x1d4e53);})[_0x14dd('0xf')](function(_0x5cc6c8){_0x56d391[_0x14dd('0x59')]=_0x5cc6c8;return _0x56d391;});}})['then'](respondWithFilteredResult(_0x84e040,_0x1d4e53))[_0x14dd('0x1a')](handleError(_0x84e040,null));};exports[_0x14dd('0x70')]=function(_0x45dccb,_0x42d5b4){return db['MailAccount'][_0x14dd('0x5f')]({'where':{'id':_0x45dccb[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x42d5b4,null))[_0x14dd('0xf')](function(_0x38e121){if(_0x38e121){return _0x38e121[_0x14dd('0x70')](_0x45dccb['query'][_0x14dd('0x71')]);}})[_0x14dd('0xf')](respondWithStatusCode(_0x42d5b4,null))[_0x14dd('0x1a')](handleError(_0x42d5b4,null));};exports[_0x14dd('0x69')]=function(_0x127cfd,_0x317385){var _0x12c709={'name':_0x127cfd[_0x14dd('0x60')]['name'],'key':_0x127cfd[_0x14dd('0x60')][_0x14dd('0x45')],'provider':_0x127cfd['body']['provider']==='custom'?null:_0x127cfd[_0x14dd('0x60')][_0x14dd('0x61')],'email':_0x127cfd[_0x14dd('0x60')]['email'],'ListId':_0x127cfd[_0x14dd('0x60')]['ListId'],'active':!_[_0x14dd('0x72')](_0x127cfd[_0x14dd('0x60')][_0x14dd('0x73')])?_0x127cfd[_0x14dd('0x60')][_0x14dd('0x73')]:!![],'description':_0x127cfd['body']['description']||null};var _0x3cac0a=getAuthenticationOptions(_0x12c709[_0x14dd('0x61')],_0x127cfd['body']);_0x12c709[_0x14dd('0x3c')]=_0x3cac0a[_0x14dd('0x3c')];_0x12c709['Smtp']=_0x3cac0a['Smtp'];return db['MailAccount'][_0x14dd('0x69')](_0x12c709,{'include':[{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d')},{'model':db[_0x14dd('0x5c')],'as':_0x14dd('0x3c')}]})[_0x14dd('0xf')](function(_0x2646b4){var _0x563434=_0x127cfd['user'][_0x14dd('0x74')]({'plain':!![]});if(!_0x563434)throw new Error(_0x14dd('0x75'));if(_0x563434[_0x14dd('0x76')]===_0x14dd('0x32')){var _0xa2d996=_0x2646b4[_0x14dd('0x74')]({'plain':!![]});return db[_0x14dd('0x77')][_0x14dd('0x5f')]({'where':{'name':_0x14dd('0x25'),'userProfileId':_0x563434[_0x14dd('0x78')]},'raw':!![]})[_0x14dd('0xf')](function(_0xbaac95){if(_0xbaac95&&_0xbaac95[_0x14dd('0x79')]===0x0){return db['UserProfileResource']['create']({'name':_0xa2d996[_0x14dd('0x47')],'resourceId':_0xa2d996['id'],'type':_0xbaac95['name'],'sectionId':_0xbaac95['id']},{})['then'](function(){return _0x2646b4;});}else{return _0x2646b4;}})['catch'](function(_0x50e93a){logger[_0x14dd('0x16')](_0x14dd('0x7a'),_0x50e93a);throw _0x50e93a;});}return _0x2646b4;})[_0x14dd('0xf')](respondWithResult(_0x317385,0xc9))[_0x14dd('0x1a')](handleError(_0x317385,null));};exports[_0x14dd('0x7b')]=function(_0x111dcd,_0xa9f488){return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x111dcd[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0xa9f488,null))[_0x14dd('0xf')](function(_0x45fb26){if(_0x45fb26){return _0x45fb26[_0x14dd('0x7b')]();}return null;})[_0x14dd('0xf')](respondWithResult(_0xa9f488,null))['catch'](handleError(_0xa9f488,null));};exports[_0x14dd('0x7d')]=function(_0xb28209,_0x783afd){if(_0xb28209[_0x14dd('0x60')]['id']){delete _0xb28209[_0x14dd('0x60')]['id'];}return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0xb28209[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x783afd,null))[_0x14dd('0xf')](function(_0x4d5d32){if(_0x4d5d32){_0xb28209['body']['MailAccountId']=_0x4d5d32['id'];return db[_0x14dd('0x5c')][_0x14dd('0x69')](_0xb28209[_0x14dd('0x60')]);}})[_0x14dd('0xf')](respondWithResult(_0x783afd,null))['catch'](handleError(_0x783afd,null));};exports[_0x14dd('0x7e')]=function(_0x428bc4,_0xae89b3){return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x428bc4[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0xae89b3,null))[_0x14dd('0xf')](function(_0x92998d){if(_0x92998d){return _0x92998d[_0x14dd('0x7f')](null);}return null;})[_0x14dd('0xf')](respondWithStatusCode(_0xae89b3,null))[_0x14dd('0x1a')](handleError(_0xae89b3,null));};exports['getSmtp']=function(_0x2365d1,_0x47400b){return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x2365d1[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x47400b,null))[_0x14dd('0xf')](function(_0x1041bd){if(_0x1041bd){return _0x1041bd[_0x14dd('0x80')]();}return null;})[_0x14dd('0xf')](respondWithResult(_0x47400b,null))[_0x14dd('0x1a')](handleError(_0x47400b,null));};exports['addSmtp']=function(_0x25a43d,_0x19111a){if(_0x25a43d[_0x14dd('0x60')]['id']){delete _0x25a43d['body']['id'];}return db['MailAccount'][_0x14dd('0x5f')]({'where':{'id':_0x25a43d[_0x14dd('0x5b')]['id']}})['then'](handleEntityNotFound(_0x19111a,null))['then'](function(_0x3cd0e6){if(_0x3cd0e6){_0x25a43d[_0x14dd('0x60')][_0x14dd('0x67')]=_0x3cd0e6['id'];return db[_0x14dd('0x3f')][_0x14dd('0x69')](_0x25a43d[_0x14dd('0x60')]);}})[_0x14dd('0xf')](respondWithResult(_0x19111a,null))[_0x14dd('0x1a')](handleError(_0x19111a,null));};exports[_0x14dd('0x81')]=function(_0x45a493,_0x3c0706){return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x45a493[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x3c0706,null))[_0x14dd('0xf')](function(_0x4c7d60){if(_0x4c7d60){return _0x4c7d60[_0x14dd('0x82')](null);}return null;})[_0x14dd('0xf')](respondWithStatusCode(_0x3c0706,null))[_0x14dd('0x1a')](handleError(_0x3c0706,null));};exports['addInteraction']=function(_0x4b05f5,_0x29e6f0){return db[_0x14dd('0x83')][_0x14dd('0x5f')]({'where':{'id':_0x4b05f5[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x29e6f0,null))[_0x14dd('0xf')](function(_0x47e69d){if(_0x47e69d){return _0x47e69d[_0x14dd('0x84')](_0x4b05f5['body'][_0x14dd('0x71')],_['omit'](_0x4b05f5[_0x14dd('0x60')],['ids','id'])||{});}})[_0x14dd('0xf')](respondWithResult(_0x29e6f0,null))[_0x14dd('0x1a')](handleError(_0x29e6f0,null));};exports[_0x14dd('0x85')]=function(_0x3fd308,_0x3418c5){var _0x143711={'raw':![],'where':{}};var _0x47ba8d={};var _0x1761a0={'count':0x0,'rows':[]};return db[_0x14dd('0x43')]['findOne']({'where':{'id':_0x3fd308[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x3418c5,null))[_0x14dd('0xf')](function(_0x1c9e85){if(_0x1c9e85){_0x47ba8d[_0x14dd('0x46')]=_[_0x14dd('0x6b')](db[_0x14dd('0x83')][_0x14dd('0x5d')]);_0x47ba8d[_0x14dd('0x48')]=_['keys'](_0x3fd308[_0x14dd('0x48')]);_0x47ba8d['filters']=_[_0x14dd('0x49')](_0x47ba8d[_0x14dd('0x46')],_0x47ba8d[_0x14dd('0x48')]);_0x143711[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x47ba8d[_0x14dd('0x46')],qs[_0x14dd('0x4b')](_0x3fd308[_0x14dd('0x48')][_0x14dd('0x4b')]));_0x143711[_0x14dd('0x4a')]=_0x143711[_0x14dd('0x4a')][_0x14dd('0x4c')]?_0x143711[_0x14dd('0x4a')]:_0x47ba8d['model'];if(!_0x3fd308['query'][_0x14dd('0x4d')](_0x14dd('0x4e'))){_0x143711[_0x14dd('0x21')]=qs[_0x14dd('0x21')](_0x3fd308[_0x14dd('0x48')][_0x14dd('0x21')]);_0x143711[_0x14dd('0x1f')]=qs[_0x14dd('0x1f')](_0x3fd308[_0x14dd('0x48')][_0x14dd('0x1f')]);}_0x143711[_0x14dd('0x4f')]=qs[_0x14dd('0x50')](_0x3fd308['query'][_0x14dd('0x50')]);_0x143711['where']=qs[_0x14dd('0x51')](_[_0x14dd('0x52')](_0x3fd308[_0x14dd('0x48')],_0x47ba8d[_0x14dd('0x51')]));_0x143711[_0x14dd('0x6c')][_0x14dd('0x67')]=_0x1c9e85['id'];if(_0x3fd308[_0x14dd('0x48')]['filter']){_0x143711[_0x14dd('0x6c')]=_[_0x14dd('0x5e')](_0x143711['where'],{'$or':_['map'](_0x143711[_0x14dd('0x4a')],function(_0x128c9c){var _0x1cbf70={};_0x1cbf70[_0x128c9c]={'$like':'%'+_0x3fd308[_0x14dd('0x48')][_0x14dd('0x54')]+'%'};return _0x1cbf70;})});}_0x143711=_[_0x14dd('0x5e')]({},_0x143711,_0x3fd308[_0x14dd('0x55')]);return db[_0x14dd('0x83')][_0x14dd('0x22')]({'where':_0x143711[_0x14dd('0x6c')]})[_0x14dd('0xf')](function(_0x44b632){_0x1761a0['count']=_0x44b632;if(_0x3fd308[_0x14dd('0x48')][_0x14dd('0x56')]){_0x143711[_0x14dd('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x14dd('0x86')],'as':_0x14dd('0x87'),'attributes':[_0x14dd('0x47'),_0x14dd('0x88'),'internal'],'required':![]},{'model':db[_0x14dd('0x89')],'as':_0x14dd('0x8a'),'attributes':['id','name',_0x14dd('0x8b')],'where':_0x3fd308[_0x14dd('0x48')][_0x14dd('0x8c')]?{'id':_0x3fd308[_0x14dd('0x48')][_0x14dd('0x8c')]}:undefined,'required':_0x3fd308[_0x14dd('0x48')][_0x14dd('0x8c')]?!![]:![]}];}return db['MailInteraction'][_0x14dd('0x58')](_0x143711);})['then'](function(_0x4244d6){_0x1761a0[_0x14dd('0x59')]=_0x4244d6;return _0x1761a0;});}})['then'](respondWithFilteredResult(_0x3418c5,_0x143711))[_0x14dd('0x1a')](handleError(_0x3418c5,null));};exports['addApplications']=function addApplications(_0x3008df,_0x5f0e10){var _0x27db52=_0x3008df[_0x14dd('0x5b')]['id'];var _0x4d356e=_0x3008df[_0x14dd('0x60')];var _0x47032f=0xc8;var _0x272f6d=null;return db['sequelize'][_0x14dd('0x8d')]({'isolationLevel':db[_0x14dd('0x8e')][_0x14dd('0x8f')]['ISOLATION_LEVELS'][_0x14dd('0x90')]},function(_0x479439){return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x27db52},'transaction':_0x479439})['then'](function(_0x140cd3){if(_0x140cd3){return db[_0x14dd('0x91')][_0x14dd('0x24')]({'where':{'MailAccountId':_0x27db52},'transaction':_0x479439})[_0x14dd('0xf')](function(){var _0x1bd58e=_[_0x14dd('0x42')](_0x4d356e,function(_0x5b57c5){_0x5b57c5['MailAccountId']=_0x27db52;return _0x5b57c5;});return db[_0x14dd('0x91')][_0x14dd('0x92')](_0x1bd58e,{'transaction':_0x479439});});}else{_0x47032f=0x194;_0x272f6d=[];}});})[_0x14dd('0xf')](function(){if(_0x47032f!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x27db52},'order':_0x14dd('0x93')})[_0x14dd('0xf')](function(_0x7b00ab){_0x272f6d=_0x7b00ab;});}})[_0x14dd('0x1a')](function(_0x5a7602){_0x47032f=0x1f4;logger['error'](_0x5a7602[_0x14dd('0x94')]);if(_0x5a7602[_0x14dd('0x47')]){delete _0x5a7602[_0x14dd('0x47')];}_0x272f6d=_0x5a7602;})[_0x14dd('0x95')](function(){if(_0x272f6d===null){_0x5f0e10[_0x14dd('0x1b')](_0x47032f);}else{if(_0x47032f===0x1f4){_0x5f0e10[_0x14dd('0x1d')](_0x47032f)[_0x14dd('0x26')](_0x272f6d);}else{_0x5f0e10['status'](_0x47032f)[_0x14dd('0x1e')](_0x272f6d);}}});};exports[_0x14dd('0x96')]=function(_0x2d0ee8,_0x1b3d7f){var _0x4ce456={};var _0x10ad1e={};var _0x38df97;var _0x29169d;return db['MailAccount'][_0x14dd('0x7c')]({'where':{'id':_0x2d0ee8[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x1b3d7f,null))[_0x14dd('0xf')](function(_0x5f5860){if(_0x5f5860){_0x38df97=_0x5f5860;_0x10ad1e[_0x14dd('0x46')]=_[_0x14dd('0x6b')](db[_0x14dd('0x91')]['rawAttributes']);_0x10ad1e[_0x14dd('0x48')]=_['keys'](_0x2d0ee8[_0x14dd('0x48')]);_0x10ad1e[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0x10ad1e['model'],_0x10ad1e[_0x14dd('0x48')]);_0x4ce456[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x10ad1e[_0x14dd('0x46')],qs['fields'](_0x2d0ee8[_0x14dd('0x48')][_0x14dd('0x4b')]));_0x4ce456['attributes']=_0x4ce456[_0x14dd('0x4a')][_0x14dd('0x4c')]?_0x4ce456[_0x14dd('0x4a')]:_0x10ad1e[_0x14dd('0x46')];_0x4ce456[_0x14dd('0x4f')]=qs[_0x14dd('0x50')](_0x2d0ee8[_0x14dd('0x48')][_0x14dd('0x50')]);_0x4ce456['where']=qs['filters'](_[_0x14dd('0x52')](_0x2d0ee8[_0x14dd('0x48')],_0x10ad1e[_0x14dd('0x51')]));if(_0x2d0ee8[_0x14dd('0x48')][_0x14dd('0x54')]){_0x4ce456[_0x14dd('0x6c')]=_[_0x14dd('0x5e')](_0x4ce456[_0x14dd('0x6c')],{'$or':_['map'](_0x4ce456[_0x14dd('0x4a')],function(_0x31c1fe){var _0x463d41={};_0x463d41[_0x31c1fe]={'$like':'%'+_0x2d0ee8['query'][_0x14dd('0x54')]+'%'};return _0x463d41;})});}_0x4ce456=_[_0x14dd('0x5e')]({},_0x4ce456,_0x2d0ee8['options']);return _0x38df97[_0x14dd('0x96')](_0x4ce456);}})[_0x14dd('0xf')](function(_0x3469e4){if(_0x3469e4){_0x29169d=_0x3469e4[_0x14dd('0x4c')];if(!_0x2d0ee8['query'][_0x14dd('0x4d')]('nolimit')){_0x4ce456['limit']=qs['limit'](_0x2d0ee8[_0x14dd('0x48')]['limit']);_0x4ce456[_0x14dd('0x1f')]=qs['offset'](_0x2d0ee8[_0x14dd('0x48')][_0x14dd('0x1f')]);}return _0x38df97['getApplications'](_0x4ce456);}})[_0x14dd('0xf')](function(_0x4e5f02){if(_0x4e5f02){return _0x4e5f02?{'count':_0x29169d,'rows':_0x4e5f02}:null;}})[_0x14dd('0xf')](respondWithResult(_0x1b3d7f,null))[_0x14dd('0x1a')](handleError(_0x1b3d7f,null));};exports['getMessages']=function(_0x1cb58f,_0x506d87){var _0x4319bb={'raw':!![],'where':{}};var _0x20ef94={};var _0x295f32={'count':0x0,'rows':[]};return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x1cb58f[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x506d87,null))['then'](function(_0x392f9c){if(_0x392f9c){_0x20ef94[_0x14dd('0x46')]=_[_0x14dd('0x6b')](db['MailMessage'][_0x14dd('0x5d')]);_0x20ef94[_0x14dd('0x48')]=_[_0x14dd('0x6b')](_0x1cb58f['query']);_0x20ef94[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0x20ef94[_0x14dd('0x46')],_0x20ef94['query']);_0x4319bb[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x20ef94[_0x14dd('0x46')],qs['fields'](_0x1cb58f[_0x14dd('0x48')]['fields']));_0x4319bb[_0x14dd('0x4a')]=_0x4319bb[_0x14dd('0x4a')]['length']?_0x4319bb[_0x14dd('0x4a')]:_0x20ef94[_0x14dd('0x46')];if(!_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x4d')](_0x14dd('0x4e'))){_0x4319bb['limit']=qs['limit'](_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x21')]);_0x4319bb[_0x14dd('0x1f')]=qs[_0x14dd('0x1f')](_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x1f')]);}_0x4319bb[_0x14dd('0x4f')]=qs[_0x14dd('0x50')](_0x1cb58f['query'][_0x14dd('0x50')]);_0x4319bb[_0x14dd('0x6c')]=qs[_0x14dd('0x51')](_['pick'](_0x1cb58f[_0x14dd('0x48')],_0x20ef94[_0x14dd('0x51')]));_0x4319bb[_0x14dd('0x6c')][_0x14dd('0x67')]=_0x392f9c['id'];if(_0x1cb58f['query'][_0x14dd('0x54')]){_0x4319bb['where']=_[_0x14dd('0x5e')](_0x4319bb[_0x14dd('0x6c')],{'$or':_[_0x14dd('0x42')](_0x4319bb[_0x14dd('0x4a')],function(_0x3fac3d){var _0x11896d={};_0x11896d[_0x3fac3d]={'$like':'%'+_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x54')]+'%'};return _0x11896d;})});}if(_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x97')]){var _0x1c2515=_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x97')][_0x14dd('0x98')](',');var _0x4ef09b={};_0x4ef09b[_0x1c2515[0x0]]={'$gte':moment(_0x1c2515[0x1])[_0x14dd('0x99')](_0x14dd('0x9a'))};_0x4319bb[_0x14dd('0x6c')]=_[_0x14dd('0x5e')](_0x4319bb['where'],_0x4ef09b);}_0x4319bb=_[_0x14dd('0x5e')]({},_0x4319bb,_0x1cb58f[_0x14dd('0x55')]);return db[_0x14dd('0x9b')][_0x14dd('0x22')]({'where':_0x4319bb[_0x14dd('0x6c')]})['then'](function(_0x538e63){_0x295f32[_0x14dd('0x22')]=_0x538e63;if(_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x56')]){_0x4319bb[_0x14dd('0x57')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4319bb);})[_0x14dd('0xf')](function(_0x29786f){if(_0x1cb58f[_0x14dd('0x48')][_0x14dd('0x9c')]===_0x14dd('0x9d')){for(var _0x18b66e=0x0;_0x18b66e<_0x29786f[_0x14dd('0x4c')];_0x18b66e++){_0x29786f[_0x18b66e]['body']=juice(_0x29786f[_0x18b66e][_0x14dd('0x60')]);}}_0x295f32['rows']=_0x29786f;return _0x295f32;});}})[_0x14dd('0xf')](respondWithFilteredResult(_0x506d87,_0x4319bb))[_0x14dd('0x1a')](handleError(_0x506d87,null));};exports[_0x14dd('0x26')]=function(_0x4e565f,_0x4bdfa2){var _0x3e214a,_0x541135={},_0x1a51c7;if(_0x4e565f[_0x14dd('0x60')]['to']){_0x1a51c7=_0x4e565f['body']['to'][_0x14dd('0x98')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x4e565f[_0x14dd('0x5b')]['id']},'include':[{'model':db[_0x14dd('0x9e')],'as':_0x14dd('0x9f'),'include':[{'model':db[_0x14dd('0xa0')],'as':_0x14dd('0xa1'),'where':{'email':_0x1a51c7},'limit':0x1,'order':[[_0x14dd('0xa2'),'DESC']]}]},{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d'),'raw':!![],'include':[{'model':db[_0x14dd('0xa3')],'as':_0x14dd('0xa3'),'raw':!![]}]}]})[_0x14dd('0xf')](handleEntityNotFound(_0x4bdfa2,null))[_0x14dd('0xf')](function(_0x428e2b){if(!_0x428e2b)return;_0x3e214a=_0x428e2b;if(!_0x428e2b[_0x14dd('0x3d')])throw new Error(_0x14dd('0xa4'));if(_[_0x14dd('0x72')](_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa5')])){_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa5')]=util['format'](_0x14dd('0xa6'),_0x428e2b[_0x14dd('0x47')],_0x428e2b[_0x14dd('0xa7')]||_0x428e2b[_0x14dd('0x3d')][_0x14dd('0x32')]);}if(_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa8')]&&_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa8')]['length']){for(var _0x41f746=0x0;_0x41f746<_0x4e565f['body'][_0x14dd('0xa8')][_0x14dd('0x4c')];_0x41f746+=0x1){_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa8')][_0x41f746]={'filename':_0x4e565f[_0x14dd('0x60')][_0x14dd('0xa8')][_0x41f746][_0x14dd('0x47')],'path':path[_0x14dd('0xa9')](config[_0x14dd('0xaa')],_0x14dd('0xab'),_0x4e565f['body']['attachments'][_0x41f746][_0x14dd('0xac')])};}}var _0x45f0ce=_0x428e2b['getSmtpOptions']();return respondWithRpcPromise(_0x14dd('0xad'),_0x14dd('0xae'),{'account':_0x45f0ce,'message':_0x4e565f[_0x14dd('0x60')]});})[_0x14dd('0xf')](function(_0x37933c){if(!_0x37933c)return;_0x541135=_0x37933c;if(!_0x3e214a['List'])throw new Error('List\x20not\x20found');if(_0x3e214a[_0x14dd('0x9f')]['Contacts'][_0x14dd('0x4c')])return _0x3e214a[_0x14dd('0x9f')][_0x14dd('0xa1')][0x0];return db['CmContact'][_0x14dd('0x69')](_[_0x14dd('0xaf')](_0x4e565f[_0x14dd('0x60')],{'firstName':_0x4e565f[_0x14dd('0x60')]['to'],'email':_0x4e565f[_0x14dd('0x60')]['to'],'phone':_0x4e565f[_0x14dd('0x60')]['to'],'ListId':_0x3e214a[_0x14dd('0xb0')]}));})[_0x14dd('0xf')](function(_0x54de23){if(!_0x54de23)return;var _0x36a13d={'UserId':_0x4e565f[_0x14dd('0x32')]['id'],'ContactId':_0x54de23['id'],'MailAccountId':_0x3e214a['id'],'inReplyTo':_0x541135[_0x14dd('0xb1')],'to':_0x4e565f[_0x14dd('0x60')]['from'],'cc':_0x4e565f[_0x14dd('0x60')]['cc'],'subject':_0x4e565f[_0x14dd('0x60')]['subject'],'attach':_0x4e565f[_0x14dd('0x60')][_0x14dd('0xb2')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x14dd('0x99')](_0x14dd('0x9a')),'lastMsgDirection':_0x14dd('0xb3'),'Messages':[_[_0x14dd('0x5e')](_0x4e565f[_0x14dd('0x60')],{'messageId':_0x541135[_0x14dd('0xb1')],'sentAt':moment()[_0x14dd('0x99')](_0x14dd('0x9a')),'read':!![],'MailAccountId':_0x3e214a['id'],'UserId':_0x4e565f[_0x14dd('0x32')]['id'],'ContactId':_0x54de23['id']})]};if(_0x4e565f[_0x14dd('0x60')][_0x14dd('0xb4')]){_0x36a13d=_[_0x14dd('0x5e')](_0x36a13d,_0x4e565f[_0x14dd('0x60')][_0x14dd('0xb4')]);}return db['MailInteraction']['create'](_0x36a13d,{'include':[{'model':db['MailMessage'],'as':_0x14dd('0xb5')}]});})[_0x14dd('0xf')](respondWithResult(_0x4bdfa2,null))[_0x14dd('0x1a')](handleError(_0x4bdfa2,null));};exports[_0x14dd('0xb6')]=function(_0x10c61b,_0x2ebf2b){return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0x10c61b['params']['id']},'include':[{'model':db[_0x14dd('0x3f')],'as':_0x14dd('0x3d'),'raw':!![],'include':[{'model':db[_0x14dd('0xa3')],'as':_0x14dd('0xa3'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2ebf2b,null))[_0x14dd('0xf')](function(_0x15771a){if(!_0x15771a[_0x14dd('0x3d')])return;var _0x597660=_0x15771a[_0x14dd('0xb7')]();return respondWithRpcPromise('VerifySmtp',_0x14dd('0xb6'),{'account':_0x597660});})['then'](respondWithResult(_0x2ebf2b,null))[_0x14dd('0x1a')](handleError(_0x2ebf2b,null));};exports[_0x14dd('0x24')]=function(_0x2ab490,_0x383db1){return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0x2ab490[_0x14dd('0x5b')]['id']}})['then'](handleEntityNotFound(_0x383db1,null))[_0x14dd('0xf')](function(_0x403638){if(_0x403638&&_0x403638['service']){throw new db[(_0x14dd('0xb8'))][(_0x14dd('0xb9'))](_0x14dd('0xba'));}return _0x403638;})['then'](removeEntity(_0x383db1,null))['catch'](handleError(_0x383db1,null));};exports[_0x14dd('0xbb')]=function(_0x9df56c,_0x48fa3b){return db['MailAccount'][_0x14dd('0x5f')]({'where':{'id':_0x9df56c[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x48fa3b,null))['then'](function(_0x1573d5){if(_0x1573d5){return _0x1573d5[_0x14dd('0xbb')](_0x9df56c[_0x14dd('0x60')][_0x14dd('0x71')],_[_0x14dd('0xbc')](_0x9df56c[_0x14dd('0x60')],[_0x14dd('0x71'),'id'])||{})['spread'](function(_0x2b4150){for(var _0x3bdf1d=0x0;_0x3bdf1d<_0x9df56c[_0x14dd('0x60')][_0x14dd('0x71')][_0x14dd('0x4c')];_0x3bdf1d+=0x1){socket[_0x14dd('0xbd')](_0x14dd('0xbe'),{'UserId':Number(_0x9df56c['body']['ids'][_0x3bdf1d]),'MailAccountId':Number(_0x9df56c[_0x14dd('0x5b')]['id'])});}return _0x2b4150;});}})[_0x14dd('0xf')](respondWithResult(_0x48fa3b,null))[_0x14dd('0x1a')](handleError(_0x48fa3b,null));};exports[_0x14dd('0xbf')]=function(_0x3f8ae5,_0x4f9072){return db[_0x14dd('0x43')][_0x14dd('0x5f')]({'where':{'id':_0x3f8ae5[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x4f9072,null))['then'](function(_0x56d5f6){if(_0x56d5f6){return _0x56d5f6[_0x14dd('0xbf')](_0x3f8ae5['query'][_0x14dd('0x71')])[_0x14dd('0xf')](function(){if(_[_0x14dd('0xc0')](_0x3f8ae5[_0x14dd('0x48')][_0x14dd('0x71')])){for(var _0x310fcf=0x0;_0x310fcf<_0x3f8ae5[_0x14dd('0x48')][_0x14dd('0x71')][_0x14dd('0x4c')];_0x310fcf+=0x1){socket[_0x14dd('0xbd')](_0x14dd('0xc1'),{'UserId':Number(_0x3f8ae5[_0x14dd('0x48')][_0x14dd('0x71')][_0x310fcf]),'MailAccountId':Number(_0x3f8ae5[_0x14dd('0x5b')]['id'])});}}else{socket[_0x14dd('0xbd')](_0x14dd('0xc1'),{'UserId':Number(_0x3f8ae5[_0x14dd('0x48')][_0x14dd('0x71')]),'MailAccountId':Number(_0x3f8ae5[_0x14dd('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f9072,null))[_0x14dd('0x1a')](handleError(_0x4f9072,null));};exports['getAgents']=function(_0x112cdf,_0x593d43){var _0x17ac7c={};var _0x314252={};var _0x1709fc;var _0x485155;return db[_0x14dd('0x43')][_0x14dd('0x7c')]({'where':{'id':_0x112cdf[_0x14dd('0x5b')]['id']}})[_0x14dd('0xf')](handleEntityNotFound(_0x593d43,null))[_0x14dd('0xf')](function(_0x451321){if(_0x451321){_0x1709fc=_0x451321;_0x314252['model']=_[_0x14dd('0x6b')](db[_0x14dd('0x86')][_0x14dd('0x5d')]);_0x314252[_0x14dd('0x48')]=_[_0x14dd('0x6b')](_0x112cdf[_0x14dd('0x48')]);_0x314252[_0x14dd('0x51')]=_[_0x14dd('0x49')](_0x314252[_0x14dd('0x46')],_0x314252['query']);_0x17ac7c[_0x14dd('0x4a')]=_[_0x14dd('0x49')](_0x314252['model'],qs['fields'](_0x112cdf[_0x14dd('0x48')][_0x14dd('0x4b')]));_0x17ac7c[_0x14dd('0x4a')]=_0x17ac7c[_0x14dd('0x4a')][_0x14dd('0x4c')]?_0x17ac7c['attributes']:_0x314252[_0x14dd('0x46')];_0x17ac7c[_0x14dd('0x4f')]=qs[_0x14dd('0x50')](_0x112cdf['query'][_0x14dd('0x50')]);_0x17ac7c[_0x14dd('0x6c')]=qs['filters'](_[_0x14dd('0x52')](_0x112cdf['query'],_0x314252[_0x14dd('0x51')]));if(_0x112cdf[_0x14dd('0x48')][_0x14dd('0x54')]){_0x17ac7c[_0x14dd('0x6c')]=_[_0x14dd('0x5e')](_0x17ac7c[_0x14dd('0x6c')],{'$or':_[_0x14dd('0x42')](_0x17ac7c['attributes'],function(_0x495803){var _0x5af74f={};_0x5af74f[_0x495803]={'$like':'%'+_0x112cdf['query'][_0x14dd('0x54')]+'%'};return _0x5af74f;})});}_0x17ac7c=_[_0x14dd('0x5e')]({},_0x17ac7c,_0x112cdf[_0x14dd('0x55')]);return _0x1709fc[_0x14dd('0xc2')](_0x17ac7c);}})['then'](function(_0x4c3a97){if(_0x4c3a97){_0x485155=_0x4c3a97['length'];if(!_0x112cdf[_0x14dd('0x48')][_0x14dd('0x4d')](_0x14dd('0x4e'))){_0x17ac7c[_0x14dd('0x21')]=qs[_0x14dd('0x21')](_0x112cdf['query'][_0x14dd('0x21')]);_0x17ac7c[_0x14dd('0x1f')]=qs[_0x14dd('0x1f')](_0x112cdf[_0x14dd('0x48')][_0x14dd('0x1f')]);}return _0x1709fc[_0x14dd('0xc2')](_0x17ac7c);}})[_0x14dd('0xf')](function(_0x46663b){if(_0x46663b){return _0x46663b?{'count':_0x485155,'rows':_0x46663b}:null;}})['then'](respondWithResult(_0x593d43,null))[_0x14dd('0x1a')](handleError(_0x593d43,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c752b2f..7fe3e81 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 _0xeb98=['hasOwnProperty','hook','../../mysqldb','MailAccount','setMaxListeners','emit'];(function(_0x1349ea,_0x112878){var _0x1d5790=function(_0x83d267){while(--_0x83d267){_0x1349ea['push'](_0x1349ea['shift']());}};_0x1d5790(++_0x112878);}(_0xeb98,0xe0));var _0x8eb9=function(_0x9066e7,_0x45f009){_0x9066e7=_0x9066e7-0x0;var _0x11413b=_0xeb98[_0x9066e7];return _0x11413b;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x8eb9('0x0'))['db'][_0x8eb9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8eb9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x241759){return function(_0x3769aa,_0x947fdd,_0x196257){MailAccountEvents['emit'](_0x241759+':'+_0x3769aa['id'],_0x3769aa);MailAccountEvents[_0x8eb9('0x3')](_0x241759,_0x3769aa);_0x196257(null);};}for(var e in events){if(events[_0x8eb9('0x4')](e)){var event=events[e];MailAccount[_0x8eb9('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x934f=['MailAccount','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x46cf0b,_0x4d1e62){var _0x4e84de=function(_0x19bd1f){while(--_0x19bd1f){_0x46cf0b['push'](_0x46cf0b['shift']());}};_0x4e84de(++_0x4d1e62);}(_0x934f,0x1d2));var _0xf934=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x934f[_0x21c09f];return _0x164d58;};'use strict';var EventEmitter=require(_0xf934('0x0'));var MailAccount=require(_0xf934('0x1'))['db'][_0xf934('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf934('0x3')](0x0);var events={'afterCreate':_0xf934('0x4'),'afterUpdate':_0xf934('0x5'),'afterDestroy':_0xf934('0x6')};function emitEvent(_0x1af97c){return function(_0x225f54,_0x508239,_0x2371d4){MailAccountEvents[_0xf934('0x7')](_0x1af97c+':'+_0x225f54['id'],_0x225f54);MailAccountEvents['emit'](_0x1af97c,_0x225f54);_0x2371d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xf934('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 1a16dc7..ad02f8c 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 _0x1c0f=['service','host','Smtp','port','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','mail_accounts','provider'];(function(_0x217195,_0x2b7eb6){var _0x1d0401=function(_0x4fc4e4){while(--_0x4fc4e4){_0x217195['push'](_0x217195['shift']());}};_0x1d0401(++_0x2b7eb6);}(_0x1c0f,0x6c));var _0xf1c0=function(_0x3bd7e2,_0x5cf7cb){_0x3bd7e2=_0x3bd7e2-0x0;var _0x35281c=_0x1c0f[_0x3bd7e2];return _0x35281c;};'use strict';var attributes=require(_0xf1c0('0x0'));module[_0xf1c0('0x1')]=function(_0x1b6c7b){return _0x1b6c7b['define']('MailAccount',attributes,{'tableName':_0xf1c0('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3ab9e0=this;var _0x2f688f={'id':_0x3ab9e0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3ab9e0[_0xf1c0('0x3')]!=='custom'){_0x2f688f[_0xf1c0('0x4')]=_0x3ab9e0[_0xf1c0('0x3')];}else{_0x2f688f[_0xf1c0('0x5')]=_0x3ab9e0[_0xf1c0('0x6')][_0xf1c0('0x5')];_0x2f688f[_0xf1c0('0x7')]=_0x3ab9e0[_0xf1c0('0x6')]['port'];_0x2f688f['secure']=_0x3ab9e0[_0xf1c0('0x6')]['secure'];}if(_0x3ab9e0['Smtp'][_0xf1c0('0x8')]){if(_0x3ab9e0[_0xf1c0('0x6')]['modernAuthentication']){if(!_0x3ab9e0[_0xf1c0('0x6')][_0xf1c0('0x9')])throw new Error(_0xf1c0('0xa'));_0x2f688f[_0xf1c0('0xb')]={'type':_0xf1c0('0xc'),'user':_0x3ab9e0[_0xf1c0('0x6')][_0xf1c0('0xd')],'accessToken':_0x3ab9e0[_0xf1c0('0x6')]['CloudProvider'][_0xf1c0('0xe')]};}else{_0x2f688f[_0xf1c0('0xb')]={'user':_0x3ab9e0[_0xf1c0('0x6')][_0xf1c0('0xd')],'pass':_0x3ab9e0[_0xf1c0('0x6')][_0xf1c0('0xf')]};}}return _0x2f688f;}}});}; \ No newline at end of file +var _0x2a87=['./mailAccount.attributes','exports','define','provider','service','host','Smtp','port','secure','authentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','CloudProvider','data5','pass'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a87,0x187));var _0x72a8=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x2a87[_0x5e28c2];return _0x1a8cc6;};'use strict';var attributes=require(_0x72a8('0x0'));module[_0x72a8('0x1')]=function(_0x5bdb03){return _0x5bdb03[_0x72a8('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x24b34c=this;var _0x22e400={'id':_0x24b34c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x24b34c[_0x72a8('0x3')]!=='custom'){_0x22e400[_0x72a8('0x4')]=_0x24b34c[_0x72a8('0x3')];}else{_0x22e400[_0x72a8('0x5')]=_0x24b34c[_0x72a8('0x6')][_0x72a8('0x5')];_0x22e400[_0x72a8('0x7')]=_0x24b34c[_0x72a8('0x6')][_0x72a8('0x7')];_0x22e400[_0x72a8('0x8')]=_0x24b34c[_0x72a8('0x6')][_0x72a8('0x8')];}if(_0x24b34c[_0x72a8('0x6')][_0x72a8('0x9')]){if(_0x24b34c['Smtp']['modernAuthentication']){if(!_0x24b34c[_0x72a8('0x6')]['CloudProvider'])throw new Error(_0x72a8('0xa'));_0x22e400[_0x72a8('0xb')]={'type':_0x72a8('0xc'),'user':_0x24b34c['Smtp'][_0x72a8('0xd')],'accessToken':_0x24b34c[_0x72a8('0x6')][_0x72a8('0xe')][_0x72a8('0xf')]};}else{_0x22e400[_0x72a8('0xb')]={'user':_0x24b34c[_0x72a8('0x6')][_0x72a8('0xd')],'pass':_0x24b34c[_0x72a8('0x6')][_0x72a8('0x10')]};}}return _0x22e400;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 41dece9..6aec60b 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 _0x6d38=['result','catch','findAll','options','raw','attributes','limit','map','include','model','then','GetMailAccount','debug','ShowMailAccount','find','smtp','setDataValue','smtpOptions','body','mail','difference','rawAttributes','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','get','account','omit','getSmtpOptions','list','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6d38[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var rs=require(_0x86d3('0x2'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x86d3('0x3'))('rpc');var config=require(_0x86d3('0x4'));var jayson=require(_0x86d3('0x5'));var client=jayson[_0x86d3('0x6')]['http']({'port':0x232c});config[_0x86d3('0x7')]=_[_0x86d3('0x8')](config[_0x86d3('0x7')],{'host':_0x86d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86d3('0xa'))[_0x86d3('0xb')](socket);function respondWithRpcPromise(_0xf273f5,_0x499640,_0x4a277e){return new BPromise(function(_0x3ed317,_0x555e6d){return client['request'](_0xf273f5,_0x4a277e)['then'](function(_0x4300e2){logger[_0x86d3('0xc')]('MailAccount,\x20%s,\x20%s',_0x499640,_0x86d3('0xd'));logger['debug'](_0x86d3('0xe'),_0x499640,_0x86d3('0xd'),JSON[_0x86d3('0xf')](_0x4300e2));if(_0x4300e2[_0x86d3('0x10')]){if(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')]===0x1f4){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2['error'][_0x86d3('0x13')]);return _0x555e6d(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);}logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);return _0x3ed317(_0x4300e2[_0x86d3('0x10')]['message']);}else{logger[_0x86d3('0xc')](_0x86d3('0x12'),_0x499640,_0x86d3('0xd'));_0x3ed317(_0x4300e2[_0x86d3('0x14')][_0x86d3('0x13')]);}})[_0x86d3('0x15')](function(_0x33e459){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x33e459);_0x555e6d(_0x33e459);});});}exports['GetMailAccount']=function(_0x191ba5){var _0x57c340=this;return new Promise(function(_0x6ced9e,_0x5c4d55){return db['MailAccount'][_0x86d3('0x16')]({'raw':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x18')]===undefined?!![]:![]:!![],'where':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')]['where']||null:null,'attributes':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'limit':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x1a')]||null:null,'include':_0x191ba5[_0x86d3('0x17')]?_0x191ba5['options']['include']?_[_0x86d3('0x1b')](_0x191ba5['options'][_0x86d3('0x1c')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x1d')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x19')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x1c')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x19')],'include':_0x611764['include']?_[_0x86d3('0x1b')](_0x611764[_0x86d3('0x1c')],function(_0x287b96){return{'model':db[_0x287b96[_0x86d3('0x1d')]],'as':_0x287b96['as'],'attributes':_0x287b96[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x1f203e){logger[_0x86d3('0xc')](_0x86d3('0x1f'),_0x191ba5);logger[_0x86d3('0x20')](_0x86d3('0x1f'),_0x191ba5,JSON[_0x86d3('0xf')](_0x1f203e));_0x6ced9e(_0x1f203e);})[_0x86d3('0x15')](function(_0x28c25e){logger['error'](_0x86d3('0x1f'),_0x28c25e[_0x86d3('0x13')],_0x191ba5);_0x5c4d55(_0x57c340[_0x86d3('0x10')](0x1f4,_0x28c25e[_0x86d3('0x13')]));});});};exports[_0x86d3('0x21')]=function(_0x245e39){var _0x4a5ff0=this;return new Promise(function(_0xba2f49,_0x5c71df){return db['MailAccount'][_0x86d3('0x22')]({'raw':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['where']||null:null,'attributes':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'include':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x245e39[_0x86d3('0x17')]['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x19')],'include':_0x4cdf45['include']?_[_0x86d3('0x1b')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x1d')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x19')],'include':_0x366943[_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x366943[_0x86d3('0x1c')],function(_0x2d15b9){return{'model':db[_0x2d15b9['model']],'as':_0x2d15b9['as'],'attributes':_0x2d15b9[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x5e2519){if(_0x245e39[_0x86d3('0x17')][_0x86d3('0x23')]===!![])_0x5e2519[_0x86d3('0x24')](_0x86d3('0x25'),_0x5e2519['getSmtpOptions']());logger[_0x86d3('0xc')](_0x86d3('0x21'),_0x245e39);logger[_0x86d3('0x20')]('ShowMailAccount',_0x245e39,JSON[_0x86d3('0xf')](_0x5e2519));_0xba2f49(_0x5e2519);})[_0x86d3('0x15')](function(_0x1a1c06){logger[_0x86d3('0x10')](_0x86d3('0x21'),_0x1a1c06[_0x86d3('0x13')],_0x245e39);_0x5c71df(_0x4a5ff0[_0x86d3('0x10')](0x1f4,_0x1a1c06[_0x86d3('0x13')]));});});};exports['NotifyMailAccount']=function(_0x22bc98){var _0x470978=this;return new Promise(function(_0x2bdc67,_0x461052){var _0x5ebb4d={'body':_0x22bc98[_0x86d3('0x26')],'channel':_0x86d3('0x27')};var _0x6f72be=_[_0x86d3('0x28')](_['keys'](db['CmContact'][_0x86d3('0x29')]),['createdAt','updatedAt',_0x86d3('0x2a'),_0x86d3('0x2b')]);var _0x43490a=![];if(_0x22bc98[_0x86d3('0x26')]['id']){delete _0x22bc98[_0x86d3('0x26')]['id'];}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x86d3('0x2d')](_0x22bc98[_0x86d3('0x26')]['body'])||_0x22bc98[_0x86d3('0x26')][_0x86d3('0x26')]===''){return _0x461052(_0x470978['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x2f')+_0x6f72be));}if(!_[_0x86d3('0x30')](_0x6f72be,_0x22bc98[_0x86d3('0x26')]['mapKey'])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x31')+_0x6f72be));}var _0x5d9dad={};_0x5d9dad[_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')]]=_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')];return db[_0x86d3('0x32')][_0x86d3('0x22')]({'where':{'id':_0x22bc98['account']['id']},'include':[{'model':db[_0x86d3('0x33')],'as':_0x86d3('0x34'),'include':[{'model':db['CmContact'],'as':_0x86d3('0x35'),'where':_0x5d9dad,'limit':0x1,'order':[[_0x86d3('0x36'),_0x86d3('0x37')]]}]},{'model':db[_0x86d3('0x38')],'as':_0x86d3('0x39')},{'model':db['MailServerOut'],'as':_0x86d3('0x3a'),'include':[{'model':db[_0x86d3('0x3b')],'as':_0x86d3('0x3b')}]}]})[_0x86d3('0x1e')](function(_0x369b75){if(_0x369b75&&_0x369b75[_0x86d3('0x34')]){var _0x1a4345=_0x369b75[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x1a4345,[_0x86d3('0x39'),_0x86d3('0x34')]);_0x5ebb4d['account'][_0x86d3('0x25')]=_0x369b75[_0x86d3('0x3f')]();_0x5ebb4d['applications']=_0x1a4345[_0x86d3('0x39')];_0x5ebb4d[_0x86d3('0x40')]=_0x1a4345[_0x86d3('0x34')];_0x5ebb4d[_0x86d3('0x41')]=_[_0x86d3('0x42')](_0x5ebb4d[_0x86d3('0x41')],['priority'],['asc']);if(_0x5ebb4d['account']&&_0x5ebb4d['account'][_0x86d3('0x43')]){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x44')]({'id':0x0,'priority':_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x45')]+0x1,'app':_0x86d3('0x46'),'appdata':_0x86d3('0x43'),'interval':'*,*,*,*'});}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')]){delete _0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')];}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x34')]){delete _0x5ebb4d[_0x86d3('0x3d')]['List'];}if(_0x1a4345[_0x86d3('0x34')]['Contacts'][_0x86d3('0x45')]){return _0x1a4345[_0x86d3('0x34')][_0x86d3('0x35')][0x0];}var _0x3ffd22=_[_0x86d3('0x8')](_0x22bc98['body'],{'firstName':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')],'ListId':_0x1a4345[_0x86d3('0x2b')]});_0x3ffd22[_0x22bc98['body']['mapKey']]=_0x22bc98['body'][_0x86d3('0x2c')];return db['CmContact'][_0x86d3('0x47')](_0x3ffd22);}else{throw new Error(_0x86d3('0x48'));}})[_0x86d3('0x1e')](function(_0x319ea0){_0x5ebb4d['contact']=_0x319ea0;if(_0x319ea0){if(!_0x22bc98['body']['message'][_0x86d3('0x49')]){_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')]=rs[_0x86d3('0x4a')]()+'\x20'+_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')];}var _0x5123fd={'ContactId':_0x319ea0['id'],'MailAccountId':_0x22bc98[_0x86d3('0x3d')]['id'],'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98['body'][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98['body'][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4c')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x86d3('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x22bc98['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x86d3('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x4f')]}}]})[_0x86d3('0x1e')](function(_0xa48003){if(_0xa48003){return[_0xa48003,![]];}return db['MailInteraction']['create'](_0x5123fd)[_0x86d3('0x1e')](function(_0xf2c179){return[_0xf2c179,!![]];});});}else{throw new Error(_0x86d3('0x50'));}})[_0x86d3('0x51')](function(_0x22d8eb,_0x1952af){if(_0x22d8eb){_0x43490a=_0x1952af;if(!_0x1952af){return _0x22d8eb[_0x86d3('0x52')]({'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22d8eb['attach']?_0x22d8eb[_0x86d3('0x4c')]:_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgDirection':'in'});}else{return _0x22d8eb;}}})['then'](function(_0x41d448){_0x5ebb4d['interaction']=_0x41d448[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x55')][_0x86d3('0x56')]=_0x43490a;return db[_0x86d3('0x57')][_0x86d3('0x47')]({'body':_0x22bc98['body'][_0x86d3('0x26')],'MailAccountId':_0x22bc98['account']['id'],'MailInteractionId':_0x41d448['id'],'direction':'in','ContactId':_0x5ebb4d[_0x86d3('0x58')]['id'],'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')],'from':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['to'],'cc':_0x22bc98[_0x86d3('0x26')]['message']['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'Attachments':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attachments'],'originTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x59')],'originCc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5a')],'bcc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5b')],'ChatWebsiteId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5c')]||null,'originChannel':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['originChannel']||_0x86d3('0x5d'),'ChatOfflineMessageId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x86d3('0x5f')}]});})[_0x86d3('0x1e')](function(_0x1a97f3){_0x5ebb4d[_0x86d3('0x13')]=_0x1a97f3;if(_0x5ebb4d['interaction']['UserId']){return db[_0x86d3('0x60')]['find']({'attributes':['id',_0x86d3('0x61')],'where':{'id':_0x5ebb4d['interaction']['UserId']}})[_0x86d3('0x1e')](function(_0x28bd40){if(_0x28bd40){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x62')]({'id':0x0,'priority':0x0,'app':_0x86d3('0x63'),'appdata':_0x28bd40['name']+','+(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x86d3('0x65'),_0x86d3('0x66'),_0x5ebb4d);});}return respondWithRpcPromise('Start',_0x86d3('0x66'),_0x5ebb4d);})['then'](function(_0x1867fc){_0x2bdc67(_0x1867fc);})['catch'](function(_0x5bb2e5){_0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x5bb2e5['message']));});});}; \ No newline at end of file +var _0x7a54=['CloudProvider','get','omit','Applications','smtpOptions','list','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','Contacts','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','MailInteraction','create','Contact\x20not\x20found','update','interaction','created','MailMessage','contact','subject','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','MailAccount','smtp','setDataValue','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','updatedAt','DESC','MailServerOut'];(function(_0x13d5bc,_0x3fce3c){var _0x4b8a40=function(_0xe3ef3a){while(--_0xe3ef3a){_0x13d5bc['push'](_0x13d5bc['shift']());}};_0x4b8a40(++_0x3fce3c);}(_0x7a54,0x106));var _0x47a5=function(_0x3789a3,_0x2eea73){_0x3789a3=_0x3789a3-0x0;var _0x1c0394=_0x7a54[_0x3789a3];return _0x1c0394;};'use strict';var _=require(_0x47a5('0x0'));var moment=require(_0x47a5('0x1'));var BPromise=require(_0x47a5('0x2'));var rs=require('randomstring');var Redis=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var client=jayson[_0x47a5('0x8')][_0x47a5('0x9')]({'port':0x232c});config['redis']=_[_0x47a5('0xa')](config['redis'],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require(_0x47a5('0xc'))(new Redis(config['redis']));require(_0x47a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d90b3,_0x582352,_0x2a0e98){return new BPromise(function(_0x2baee7,_0x5e31dd){return client[_0x47a5('0xe')](_0x5d90b3,_0x2a0e98)['then'](function(_0x5de6d7){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x582352,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x582352,_0x47a5('0x11'),JSON[_0x47a5('0x14')](_0x5de6d7));if(_0x5de6d7['error']){if(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x5e31dd(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}logger['error'](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2baee7(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x582352,_0x47a5('0x11'));_0x2baee7(_0x5de6d7['result']['message']);}})[_0x47a5('0x18')](function(_0xaf70a6){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0xaf70a6);_0x5e31dd(_0xaf70a6);});});}exports[_0x47a5('0x19')]=function(_0x12b98e){var _0x2763d6=this;return new Promise(function(_0xe3c618,_0x3aed38){return db['MailAccount'][_0x47a5('0x1a')]({'raw':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1d')]||null:null,'limit':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1e')]||null:null,'include':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1f')]?_['map'](_0x3abd6a[_0x47a5('0x1f')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x21')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1d')],'include':_0x5b6c4e[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x5b6c4e[_0x47a5('0x1f')],function(_0x3ba0b7){return{'model':db[_0x3ba0b7[_0x47a5('0x21')]],'as':_0x3ba0b7['as'],'attributes':_0x3ba0b7[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x361bfa){logger[_0x47a5('0xf')](_0x47a5('0x19'),_0x12b98e);logger[_0x47a5('0x12')]('GetMailAccount',_0x12b98e,JSON[_0x47a5('0x14')](_0x361bfa));_0xe3c618(_0x361bfa);})['catch'](function(_0x2ef875){logger[_0x47a5('0x15')](_0x47a5('0x19'),_0x2ef875['message'],_0x12b98e);_0x3aed38(_0x2763d6[_0x47a5('0x15')](0x1f4,_0x2ef875[_0x47a5('0x17')]));});});};exports[_0x47a5('0x23')]=function(_0x1f1c68){var _0x51cc81=this;return new Promise(function(_0x50d875,_0x6f9a12){return db[_0x47a5('0x24')]['find']({'raw':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x1f1c68[_0x47a5('0x1b')]?_0x1f1c68[_0x47a5('0x1b')]['attributes']||null:null,'include':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['include']?_[_0x47a5('0x20')](_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x21')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x20')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1d')],'include':_0x25cce0[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x25cce0[_0x47a5('0x1f')],function(_0x36add5){return{'model':db[_0x36add5[_0x47a5('0x21')]],'as':_0x36add5['as'],'attributes':_0x36add5[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x1a0d23){if(_0x1f1c68['options'][_0x47a5('0x25')]===!![])_0x1a0d23[_0x47a5('0x26')]('smtpOptions',_0x1a0d23[_0x47a5('0x27')]());logger[_0x47a5('0xf')](_0x47a5('0x23'),_0x1f1c68);logger['debug'](_0x47a5('0x23'),_0x1f1c68,JSON[_0x47a5('0x14')](_0x1a0d23));_0x50d875(_0x1a0d23);})['catch'](function(_0x2ebba0){logger[_0x47a5('0x15')]('ShowMailAccount',_0x2ebba0['message'],_0x1f1c68);_0x6f9a12(_0x51cc81['error'](0x1f4,_0x2ebba0[_0x47a5('0x17')]));});});};exports['NotifyMailAccount']=function(_0x9b5eaf){var _0x1f9631=this;return new Promise(function(_0x301a85,_0x111f0d){var _0x1b2c80={'body':_0x9b5eaf[_0x47a5('0x28')],'channel':_0x47a5('0x29')};var _0x1f3d01=_[_0x47a5('0x2a')](_[_0x47a5('0x2b')](db[_0x47a5('0x2c')][_0x47a5('0x2d')]),[_0x47a5('0x2e'),'updatedAt',_0x47a5('0x2f'),_0x47a5('0x30')]);var _0x331474=![];if(_0x9b5eaf[_0x47a5('0x28')]['id']){delete _0x9b5eaf['body']['id'];}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['from'])){return _0x111f0d(_0x1f9631['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x47a5('0x31')](_0x9b5eaf['body'][_0x47a5('0x28')])||_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')]===''){return _0x111f0d(_0x1f9631['error'](0x1f4,_0x47a5('0x32')));}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['mapKey'])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f3d01));}if(!_[_0x47a5('0x33')](_0x1f3d01,_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x47a5('0x35')+_0x1f3d01));}var _0xf0edbb={};_0xf0edbb[_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db[_0x47a5('0x24')][_0x47a5('0x37')]({'where':{'id':_0x9b5eaf[_0x47a5('0x38')]['id']},'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a'),'include':[{'model':db[_0x47a5('0x2c')],'as':'Contacts','where':_0xf0edbb,'limit':0x1,'order':[[_0x47a5('0x3b'),_0x47a5('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x47a5('0x3d')],'as':'Smtp','include':[{'model':db[_0x47a5('0x3e')],'as':_0x47a5('0x3e')}]}]})['then'](function(_0x4f62d3){if(_0x4f62d3&&_0x4f62d3[_0x47a5('0x3a')]){var _0x52d409=_0x4f62d3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x38')]=_[_0x47a5('0x40')](_0x52d409,[_0x47a5('0x41'),_0x47a5('0x3a')]);_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x42')]=_0x4f62d3['getSmtpOptions']();_0x1b2c80['applications']=_0x52d409[_0x47a5('0x41')];_0x1b2c80[_0x47a5('0x43')]=_0x52d409[_0x47a5('0x3a')];_0x1b2c80[_0x47a5('0x44')]=_[_0x47a5('0x45')](_0x1b2c80[_0x47a5('0x44')],[_0x47a5('0x46')],['asc']);if(_0x1b2c80[_0x47a5('0x38')]&&_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x47')]){_0x1b2c80['applications'][_0x47a5('0x48')]({'id':0x0,'priority':_0x1b2c80['applications'][_0x47a5('0x49')]+0x1,'app':_0x47a5('0x4a'),'appdata':_0x47a5('0x47'),'interval':_0x47a5('0x4b')});}if(_0x1b2c80['account'][_0x47a5('0x41')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x41')];}if(_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')];}if(_0x52d409['List'][_0x47a5('0x4c')][_0x47a5('0x49')]){return _0x52d409[_0x47a5('0x3a')][_0x47a5('0x4c')][0x0];}var _0x3329aa=_[_0x47a5('0xa')](_0x9b5eaf['body'],{'firstName':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')],'ListId':_0x52d409[_0x47a5('0x30')]});_0x3329aa[_0x9b5eaf['body'][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db['CmContact']['create'](_0x3329aa);}else{throw new Error(_0x47a5('0x4d'));}})[_0x47a5('0x22')](function(_0x4fa1da){_0x1b2c80['contact']=_0x4fa1da;if(_0x4fa1da){if(!_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')]){_0x9b5eaf['body']['message'][_0x47a5('0x4e')]=rs[_0x47a5('0x4f')]()+'\x20'+_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x36')];}var _0x4b706a={'ContactId':_0x4fa1da['id'],'MailAccountId':_0x9b5eaf['account']['id'],'inReplyTo':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf['body'][_0x47a5('0x17')]['subject'],'attach':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x47a5('0x37')]({'where':{'closed':![],'MailAccountId':_0x9b5eaf['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x53')]}}]})['then'](function(_0x4d3db1){if(_0x4d3db1){return[_0x4d3db1,![]];}return db[_0x47a5('0x54')][_0x47a5('0x55')](_0x4b706a)[_0x47a5('0x22')](function(_0x3c2b46){return[_0x3c2b46,!![]];});});}else{throw new Error(_0x47a5('0x56'));}})['spread'](function(_0x3474b7,_0x519e9e){if(_0x3474b7){_0x331474=_0x519e9e;if(!_0x519e9e){return _0x3474b7[_0x47a5('0x57')]({'inReplyTo':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['subject'],'attach':_0x3474b7[_0x47a5('0x50')]?_0x3474b7[_0x47a5('0x50')]:_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x47a5('0x52')),'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'});}else{return _0x3474b7;}}})[_0x47a5('0x22')](function(_0x4228a3){_0x1b2c80[_0x47a5('0x58')]=_0x4228a3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x59')]=_0x331474;return db[_0x47a5('0x5a')][_0x47a5('0x55')]({'body':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')],'MailAccountId':_0x9b5eaf[_0x47a5('0x38')]['id'],'MailInteractionId':_0x4228a3['id'],'direction':'in','ContactId':_0x1b2c80[_0x47a5('0x5b')]['id'],'messageId':_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x4e')],'from':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['to'],'cc':_0x9b5eaf[_0x47a5('0x28')]['message']['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5c')],'attach':_0x9b5eaf['body'][_0x47a5('0x17')]['attach'],'Attachments':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5d')],'originTo':_0x9b5eaf['body']['message']['originTo'],'originCc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5e')],'bcc':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5f')],'ChatWebsiteId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x60')]||null,'originChannel':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x61')]||_0x47a5('0x62'),'ChatOfflineMessageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x63')]||null},{'include':[{'model':db[_0x47a5('0x64')],'as':'Attachments'}]});})[_0x47a5('0x22')](function(_0x4833be){_0x1b2c80[_0x47a5('0x17')]=_0x4833be;if(_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]){return db[_0x47a5('0x66')][_0x47a5('0x37')]({'attributes':['id',_0x47a5('0x67')],'where':{'id':_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]}})[_0x47a5('0x22')](function(_0x254049){if(_0x254049){_0x1b2c80[_0x47a5('0x44')][_0x47a5('0x68')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x69'),'appdata':_0x254049[_0x47a5('0x67')]+','+(_0x1b2c80[_0x47a5('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x1b2c80);});}return respondWithRpcPromise(_0x47a5('0x6a'),_0x47a5('0x6b'),_0x1b2c80);})['then'](function(_0x732e00){_0x301a85(_0x732e00);})[_0x47a5('0x18')](function(_0x1baa5a){_0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x1baa5a[_0x47a5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4d47e9c..7631228 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 _0x832c=['register','length','mailAccount:','save','remove','update','emit','removeListener'];(function(_0x50c355,_0x126582){var _0x1b7e82=function(_0x100559){while(--_0x100559){_0x50c355['push'](_0x50c355['shift']());}};_0x1b7e82(++_0x126582);}(_0x832c,0x193));var _0xc832=function(_0x2e8341,_0x42df01){_0x2e8341=_0x2e8341-0x0;var _0x46e5cb=_0x832c[_0x2e8341];return _0x46e5cb;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xc832('0x0'),_0xc832('0x1'),_0xc832('0x2')];function createListener(_0x910488,_0x39cfec){return function(_0x303b8c){_0x39cfec[_0xc832('0x3')](_0x910488,_0x303b8c);};}function removeListener(_0x7c544d,_0x3799e6){return function(){MailAccountEvents[_0xc832('0x4')](_0x7c544d,_0x3799e6);};}exports[_0xc832('0x5')]=function(_0x584901){for(var _0x57253b=0x0,_0x4b7b6f=events[_0xc832('0x6')];_0x57253b<_0x4b7b6f;_0x57253b++){var _0x341f46=events[_0x57253b];var _0x227627=createListener(_0xc832('0x7')+_0x341f46,_0x584901);MailAccountEvents['on'](_0x341f46,_0x227627);}}; \ No newline at end of file +var _0x81b8=['./mailAccount.events','save','remove','update','register','length','mailAccount:'];(function(_0x1008d5,_0x5e4e5a){var _0x1d1746=function(_0x26f3c4){while(--_0x26f3c4){_0x1008d5['push'](_0x1008d5['shift']());}};_0x1d1746(++_0x5e4e5a);}(_0x81b8,0x1ce));var _0x881b=function(_0x309454,_0x119aff){_0x309454=_0x309454-0x0;var _0x369b89=_0x81b8[_0x309454];return _0x369b89;};'use strict';var MailAccountEvents=require(_0x881b('0x0'));var events=[_0x881b('0x1'),_0x881b('0x2'),_0x881b('0x3')];function createListener(_0x29e334,_0x2202b1){return function(_0x5c60db){_0x2202b1['emit'](_0x29e334,_0x5c60db);};}function removeListener(_0x5c5898,_0x253c95){return function(){MailAccountEvents['removeListener'](_0x5c5898,_0x253c95);};}exports[_0x881b('0x4')]=function(_0x203c33){for(var _0xfc215d=0x0,_0x30b534=events[_0x881b('0x5')];_0xfc215d<_0x30b534;_0xfc215d++){var _0x538cf9=events[_0xfc215d];var _0x3a12f8=createListener(_0x881b('0x6')+_0x538cf9,_0x203c33);MailAccountEvents['on'](_0x538cf9,_0x3a12f8);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 7a282fc..ca1a636 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 _0xc04b=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','delete','exports','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc04b,0x140));var _0xbc04=function(_0x32d63e,_0x3dc9db){_0x32d63e=_0x32d63e-0x0;var _0x14be18=_0xc04b[_0x32d63e];return _0x14be18;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc04('0x0'));var timeout=require(_0xbc04('0x1'));var express=require(_0xbc04('0x2'));var router=express[_0xbc04('0x3')]();var fs_extra=require(_0xbc04('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc04('0x5'));var config=require(_0xbc04('0x6'));var controller=require(_0xbc04('0x7'));router[_0xbc04('0x8')](_0xbc04('0x9'),auth[_0xbc04('0xa')](),controller[_0xbc04('0xb')]);router['put'](_0xbc04('0x9'),auth[_0xbc04('0xa')](),controller['update']);router[_0xbc04('0xc')](_0xbc04('0x9'),auth[_0xbc04('0xa')](),controller['destroy']);module[_0xbc04('0xd')]=router; \ No newline at end of file +var _0x2ac5=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','/:id','isAuthenticated','put','update','delete','exports'];(function(_0x50ed9a,_0x38bcbd){var _0x273f27=function(_0x1dfaf3){while(--_0x1dfaf3){_0x50ed9a['push'](_0x50ed9a['shift']());}};_0x273f27(++_0x38bcbd);}(_0x2ac5,0x1b3));var _0x52ac=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0x2ac5[_0x872f6f];return _0x59a5f4;};'use strict';var multer=require(_0x52ac('0x0'));var util=require(_0x52ac('0x1'));var path=require(_0x52ac('0x2'));var timeout=require(_0x52ac('0x3'));var express=require(_0x52ac('0x4'));var router=express[_0x52ac('0x5')]();var fs_extra=require(_0x52ac('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x52ac('0x7'));var controller=require('./mailApplication.controller');router[_0x52ac('0x8')](_0x52ac('0x9'),auth[_0x52ac('0xa')](),controller['show']);router[_0x52ac('0xb')](_0x52ac('0x9'),auth[_0x52ac('0xa')](),controller[_0x52ac('0xc')]);router[_0x52ac('0xd')](_0x52ac('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x52ac('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f8d3fc5..0136cb3 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 _0x55ef=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x55ef,0x98));var _0xf55e=function(_0xb6d0cc,_0xccc6a2){_0xb6d0cc=_0xb6d0cc-0x0;var _0x2b1766=_0x55ef[_0xb6d0cc];return _0x2b1766;};'use strict';var Sequelize=require('sequelize');module[_0xf55e('0x0')]={'priority':{'type':Sequelize[_0xf55e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf55e('0x2')],'allowNull':![],'defaultValue':_0xf55e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf55e('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf55e('0x4')}}; \ No newline at end of file +var _0x7ff5=['TEXT','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ff5,0xcd));var _0x57ff=function(_0x1a72f3,_0x3acf91){_0x1a72f3=_0x1a72f3-0x0;var _0x1bf9bf=_0x7ff5[_0x1a72f3];return _0x1bf9bf;};'use strict';var Sequelize=require('sequelize');module[_0x57ff('0x0')]={'priority':{'type':Sequelize[_0x57ff('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x57ff('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x57ff('0x3')]()},'description':{'type':Sequelize[_0x57ff('0x2')]},'interval':{'type':Sequelize[_0x57ff('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d120e51..85b8ae4 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x70e0,0x17b));var _0x070e=function(_0x174023,_0x97e6d6){_0x174023=_0x174023-0x0;var _0x706fa3=_0x70e0[_0x174023];return _0x706fa3;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x1e965f,_0x3a15cc){var _0x244e97=function(_0x2e8d78){while(--_0x2e8d78){_0x1e965f['push'](_0x1e965f['shift']());}};_0x244e97(++_0x3a15cc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 01650d9..50a4c24 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 _0x4daa=['api','request-promise','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x172d15,_0x3d1244){var _0x2f61de=function(_0x6653d6){while(--_0x6653d6){_0x172d15['push'](_0x172d15['shift']());}};_0x2f61de(++_0x3d1244);}(_0x4daa,0x102));var _0xa4da=function(_0x5f170f,_0x553d8e){_0x5f170f=_0x5f170f-0x0;var _0x2419de=_0x4daa[_0x5f170f];return _0x2419de;};'use strict';var _=require(_0xa4da('0x0'));var util=require('util');var logger=require(_0xa4da('0x1'))(_0xa4da('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa4da('0x3'));var fs=require('fs');var path=require(_0xa4da('0x4'));var rimraf=require(_0xa4da('0x5'));var config=require('../../config/environment');var attributes=require(_0xa4da('0x6'));module[_0xa4da('0x7')]=function(_0x3beeb2,_0xd1646a){return _0x3beeb2[_0xa4da('0x8')](_0xa4da('0x9'),attributes,{'tableName':_0xa4da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4da('0xb'),'collate':_0xa4da('0xc')});}; \ No newline at end of file +var _0x7b26=['path','rimraf','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise'];(function(_0x5b38e4,_0x1d9bee){var _0x3fcfcc=function(_0x3efaea){while(--_0x3efaea){_0x5b38e4['push'](_0x5b38e4['shift']());}};_0x3fcfcc(++_0x1d9bee);}(_0x7b26,0x1d0));var _0x67b2=function(_0x5afedb,_0x121641){_0x5afedb=_0x5afedb-0x0;var _0x39cdc6=_0x7b26[_0x5afedb];return _0x39cdc6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67b2('0x0'))(_0x67b2('0x1'));var moment=require('moment');var BPromise=require(_0x67b2('0x2'));var rp=require(_0x67b2('0x3'));var fs=require('fs');var path=require(_0x67b2('0x4'));var rimraf=require(_0x67b2('0x5'));var config=require('../../config/environment');var attributes=require(_0x67b2('0x6'));module[_0x67b2('0x7')]=function(_0x441b84,_0x5c88e9){return _0x441b84[_0x67b2('0x8')](_0x67b2('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67b2('0xa'),'collate':_0x67b2('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9afc9ea..b61bc72 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 _0xc1b3=['http','then','info','request\x20sent','stringify','error','code','message','MailApplication,\x20%s,\x20%s','catch','UpdateMailApplication','MailApplication','update','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x6eb18e,_0x43bfaf){var _0x311621=function(_0x42adab){while(--_0x42adab){_0x6eb18e['push'](_0x6eb18e['shift']());}};_0x311621(++_0x43bfaf);}(_0xc1b3,0x12d));var _0x3c1b=function(_0x2f29b2,_0x20ad9f){_0x2f29b2=_0x2f29b2-0x0;var _0x3d27de=_0xc1b3[_0x2f29b2];return _0x3d27de;};'use strict';var _=require(_0x3c1b('0x0'));var util=require(_0x3c1b('0x1'));var moment=require(_0x3c1b('0x2'));var BPromise=require(_0x3c1b('0x3'));var rs=require(_0x3c1b('0x4'));var fs=require('fs');var Redis=require(_0x3c1b('0x5'));var db=require(_0x3c1b('0x6'))['db'];var utils=require(_0x3c1b('0x7'));var logger=require(_0x3c1b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3c1b('0x9'));var client=jayson[_0x3c1b('0xa')][_0x3c1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c672d,_0x4d8359,_0x3cc80e){return new BPromise(function(_0x2bbdc0,_0x2f0fbe){return client['request'](_0x5c672d,_0x3cc80e)[_0x3c1b('0xc')](function(_0x425d82){logger[_0x3c1b('0xd')]('MailApplication,\x20%s,\x20%s',_0x4d8359,_0x3c1b('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x4d8359,'request\x20sent',JSON[_0x3c1b('0xf')](_0x425d82));if(_0x425d82[_0x3c1b('0x10')]){if(_0x425d82[_0x3c1b('0x10')][_0x3c1b('0x11')]===0x1f4){logger[_0x3c1b('0x10')]('MailApplication,\x20%s,\x20%s',_0x4d8359,_0x425d82['error']['message']);return _0x2f0fbe(_0x425d82[_0x3c1b('0x10')]['message']);}logger[_0x3c1b('0x10')]('MailApplication,\x20%s,\x20%s',_0x4d8359,_0x425d82[_0x3c1b('0x10')]['message']);return _0x2bbdc0(_0x425d82[_0x3c1b('0x10')][_0x3c1b('0x12')]);}else{logger['info'](_0x3c1b('0x13'),_0x4d8359,_0x3c1b('0xe'));_0x2bbdc0(_0x425d82['result'][_0x3c1b('0x12')]);}})[_0x3c1b('0x14')](function(_0x20d38f){logger[_0x3c1b('0x10')](_0x3c1b('0x13'),_0x4d8359,_0x20d38f);_0x2f0fbe(_0x20d38f);});});}exports[_0x3c1b('0x15')]=function(_0x27b1e9){var _0x49a029=this;return new Promise(function(_0x48a3a2,_0x1604a6){return db[_0x3c1b('0x16')][_0x3c1b('0x17')](_0x27b1e9['body'],{'raw':_0x27b1e9['options']?_0x27b1e9[_0x3c1b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27b1e9[_0x3c1b('0x18')]?_0x27b1e9[_0x3c1b('0x18')]['where']||null:null,'attributes':_0x27b1e9[_0x3c1b('0x18')]?_0x27b1e9[_0x3c1b('0x18')]['attributes']||null:null,'limit':_0x27b1e9[_0x3c1b('0x18')]?_0x27b1e9[_0x3c1b('0x18')]['limit']||null:null})['then'](function(_0x2e1c72){logger[_0x3c1b('0xd')](_0x3c1b('0x15'),_0x27b1e9);logger[_0x3c1b('0x19')](_0x3c1b('0x15'),_0x27b1e9,JSON['stringify'](_0x2e1c72));_0x48a3a2(_0x2e1c72);})[_0x3c1b('0x14')](function(_0x545cad){logger['error'](_0x3c1b('0x15'),_0x545cad['message'],_0x27b1e9);_0x1604a6(_0x49a029['error'](0x1f4,_0x545cad[_0x3c1b('0x12')]));});});}; \ No newline at end of file +var _0x15bf=['options','raw','where','attributes','limit','then','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','body'];(function(_0x2e067a,_0xab528c){var _0xc64976=function(_0x53a98e){while(--_0x53a98e){_0x2e067a['push'](_0x2e067a['shift']());}};_0xc64976(++_0xab528c);}(_0x15bf,0x18e));var _0xf15b=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x15bf[_0x35007a];return _0x574f68;};'use strict';var _=require(_0xf15b('0x0'));var util=require(_0xf15b('0x1'));var moment=require('moment');var BPromise=require(_0xf15b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf15b('0x3'))['db'];var utils=require(_0xf15b('0x4'));var logger=require(_0xf15b('0x5'))('rpc');var config=require(_0xf15b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf15b('0x7')][_0xf15b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ed90e,_0x5e8b8a,_0x26b19c){return new BPromise(function(_0x155bdc,_0xbbbbe8){return client['request'](_0x2ed90e,_0x26b19c)['then'](function(_0x4d242c){logger[_0xf15b('0x9')](_0xf15b('0xa'),_0x5e8b8a,_0xf15b('0xb'));logger['debug'](_0xf15b('0xc'),_0x5e8b8a,'request\x20sent',JSON[_0xf15b('0xd')](_0x4d242c));if(_0x4d242c[_0xf15b('0xe')]){if(_0x4d242c[_0xf15b('0xe')][_0xf15b('0xf')]===0x1f4){logger[_0xf15b('0xe')](_0xf15b('0xa'),_0x5e8b8a,_0x4d242c['error']['message']);return _0xbbbbe8(_0x4d242c[_0xf15b('0xe')][_0xf15b('0x10')]);}logger['error'](_0xf15b('0xa'),_0x5e8b8a,_0x4d242c[_0xf15b('0xe')][_0xf15b('0x10')]);return _0x155bdc(_0x4d242c[_0xf15b('0xe')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x5e8b8a,_0xf15b('0xb'));_0x155bdc(_0x4d242c[_0xf15b('0x11')][_0xf15b('0x10')]);}})['catch'](function(_0x7d3bb9){logger[_0xf15b('0xe')](_0xf15b('0xa'),_0x5e8b8a,_0x7d3bb9);_0xbbbbe8(_0x7d3bb9);});});}exports[_0xf15b('0x12')]=function(_0x5959d0){var _0x4f25a2=this;return new Promise(function(_0x3fdae6,_0x1fc85f){return db[_0xf15b('0x13')][_0xf15b('0x14')](_0x5959d0[_0xf15b('0x15')],{'raw':_0x5959d0[_0xf15b('0x16')]?_0x5959d0[_0xf15b('0x16')][_0xf15b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5959d0[_0xf15b('0x16')]?_0x5959d0[_0xf15b('0x16')][_0xf15b('0x18')]||null:null,'attributes':_0x5959d0[_0xf15b('0x16')]?_0x5959d0[_0xf15b('0x16')][_0xf15b('0x19')]||null:null,'limit':_0x5959d0[_0xf15b('0x16')]?_0x5959d0['options'][_0xf15b('0x1a')]||null:null})[_0xf15b('0x1b')](function(_0xa29991){logger[_0xf15b('0x9')](_0xf15b('0x12'),_0x5959d0);logger['debug'](_0xf15b('0x12'),_0x5959d0,JSON[_0xf15b('0xd')](_0xa29991));_0x3fdae6(_0xa29991);})['catch'](function(_0xcee959){logger['error'](_0xf15b('0x12'),_0xcee959[_0xf15b('0x10')],_0x5959d0);_0x1fc85f(_0x4f25a2[_0xf15b('0xe')](0x1f4,_0xcee959[_0xf15b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a74d306..faf85e3 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 _0x6194=['show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','mail','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','./mailInteraction.controller','get','/describe','describe','/:id','isAuthenticated'];(function(_0xc17d84,_0x46fd21){var _0x1f0a0a=function(_0x543720){while(--_0x543720){_0xc17d84['push'](_0xc17d84['shift']());}};_0x1f0a0a(++_0x46fd21);}(_0x6194,0x1df));var _0x4619=function(_0xc140f6,_0x34ae73){_0xc140f6=_0xc140f6-0x0;var _0x41cfc1=_0x6194[_0xc140f6];return _0x41cfc1;};'use strict';var express=require(_0x4619('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x4619('0x1'));router[_0x4619('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4619('0x2')](_0x4619('0x3'),auth['isAuthenticated'](),controller[_0x4619('0x4')]);router[_0x4619('0x2')](_0x4619('0x5'),auth[_0x4619('0x6')](),controller[_0x4619('0x7')]);router[_0x4619('0x2')](_0x4619('0x8'),auth[_0x4619('0x6')](),controller[_0x4619('0x9')]);router[_0x4619('0x2')](_0x4619('0xa'),auth['isAuthenticated'](),controller[_0x4619('0xb')]);router['post']('/',auth[_0x4619('0x6')](),controller[_0x4619('0xc')]);router[_0x4619('0xd')](_0x4619('0x8'),auth[_0x4619('0x6')](),controller[_0x4619('0xe')]);router[_0x4619('0xd')](_0x4619('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x4619('0x10'),'mailinteraction:addtags'),controller[_0x4619('0x11')]);router[_0x4619('0x12')](_0x4619('0x5'),auth[_0x4619('0x6')](),interaction[_0x4619('0x13')](_0x4619('0x10'),_0x4619('0x14')),controller[_0x4619('0x15')]);router[_0x4619('0x16')](_0x4619('0x5'),auth[_0x4619('0x6')](),interaction[_0x4619('0x13')]('mail',_0x4619('0x17')),controller[_0x4619('0x18')]);router[_0x4619('0x16')](_0x4619('0xf'),auth['isAuthenticated'](),controller[_0x4619('0x19')]);module[_0x4619('0x1a')]=router; \ No newline at end of file +var _0x7367=['/:id/download','download','post','addMessage','/:id/tags','mail','addTags','put','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x23ccd1,_0x28832d){var _0xd8f6ee=function(_0xfbd25a){while(--_0xfbd25a){_0x23ccd1['push'](_0x23ccd1['shift']());}};_0xd8f6ee(++_0x28832d);}(_0x7367,0xb7));var _0x7736=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7367[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x7736('0x0'));var router=express[_0x7736('0x1')]();var auth=require(_0x7736('0x2'));var interaction=require(_0x7736('0x3'));var controller=require(_0x7736('0x4'));router[_0x7736('0x5')]('/',auth[_0x7736('0x6')](),controller['index']);router[_0x7736('0x5')](_0x7736('0x7'),auth['isAuthenticated'](),controller[_0x7736('0x8')]);router[_0x7736('0x5')](_0x7736('0x9'),auth['isAuthenticated'](),controller[_0x7736('0xa')]);router[_0x7736('0x5')](_0x7736('0xb'),auth[_0x7736('0x6')](),controller[_0x7736('0xc')]);router[_0x7736('0x5')](_0x7736('0xd'),auth[_0x7736('0x6')](),controller[_0x7736('0xe')]);router[_0x7736('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth[_0x7736('0x6')](),controller[_0x7736('0x10')]);router['post'](_0x7736('0x11'),auth[_0x7736('0x6')](),interaction['tracked'](_0x7736('0x12'),'mailinteraction:addtags'),controller[_0x7736('0x13')]);router[_0x7736('0x14')](_0x7736('0x9'),auth[_0x7736('0x6')](),interaction[_0x7736('0x15')](_0x7736('0x12'),_0x7736('0x16')),controller[_0x7736('0x17')]);router[_0x7736('0x18')](_0x7736('0x9'),auth[_0x7736('0x6')](),interaction['tracked']('mail',_0x7736('0x19')),controller['destroy']);router[_0x7736('0x18')](_0x7736('0x11'),auth['isAuthenticated'](),controller[_0x7736('0x1a')]);module[_0x7736('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 99b6be4..b42eb78 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 _0x5b28=['BOOLEAN','sequelize','iconv','exports','STRING','TEXT','long','DATE','out'];(function(_0x390b1b,_0x825cf3){var _0x3d2c52=function(_0x18ef9c){while(--_0x18ef9c){_0x390b1b['push'](_0x390b1b['shift']());}};_0x3d2c52(++_0x825cf3);}(_0x5b28,0xac));var _0x85b2=function(_0x422980,_0xac68f9){_0x422980=_0x422980-0x0;var _0xc4288b=_0x5b28[_0x422980];return _0xc4288b;};'use strict';var Sequelize=require(_0x85b2('0x0'));var iconv=require(_0x85b2('0x1'));module[_0x85b2('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x85b2('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x85b2('0x3')](0x1fe)},'to':{'type':Sequelize[_0x85b2('0x3')]},'cc':{'type':Sequelize[_0x85b2('0x4')](_0x85b2('0x5'))},'subject':{'type':Sequelize[_0x85b2('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x85b2('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x85b2('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x85b2('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x85b2('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x85b2('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xa265=['DATE','STRING','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x5ee607,_0x5ef350){var _0x49a75a=function(_0x3fac2b){while(--_0x3fac2b){_0x5ee607['push'](_0x5ee607['shift']());}};_0x49a75a(++_0x5ef350);}(_0xa265,0xe6));var _0x5a26=function(_0x3baf4d,_0x2e2955){_0x3baf4d=_0x3baf4d-0x0;var _0x140515=_0xa265[_0x3baf4d];return _0x140515;};'use strict';var Sequelize=require(_0x5a26('0x0'));var iconv=require(_0x5a26('0x1'));module[_0x5a26('0x2')]={'closed':{'type':Sequelize[_0x5a26('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5a26('0x4')]},'disposition':{'type':Sequelize[_0x5a26('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5a26('0x5')]},'cc':{'type':Sequelize[_0x5a26('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5a26('0x4')]},'substatus':{'type':Sequelize[_0x5a26('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5a26('0x7')]('in',_0x5a26('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5a26('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5a26('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5a26('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index f04ebc8..2206ba2 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 _0xdc97=['Account.key','Account.mandatoryDisposition','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','findOne','enableEmailPreview','all','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','true','addTags','setTags','omit','spread','findAll','color','emit','mailInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','json','update','then','destroy','end','error','name','fullname','TagIds','Tags','split','forEach','push','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','total','UserId','closed','unmanaged','index','MailInteraction','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','select','field','from','tools_tags','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key'];(function(_0x44dee8,_0x3b349c){var _0x16c381=function(_0x3ec729){while(--_0x3ec729){_0x44dee8['push'](_0x44dee8['shift']());}};_0x16c381(++_0x3b349c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5ebcc9,_0xf12c97){_0x5ebcc9=_0x5ebcc9-0x0;var _0x1f99c7=_0xdc97[_0x5ebcc9];return _0x1f99c7;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var moment=require('moment');var BPromise=require(_0x7dc9('0x3'));var util=require('util');var path=require(_0x7dc9('0x4'));var fs=require('fs');var _=require(_0x7dc9('0x5'));var squel=require('squel');var juice=require(_0x7dc9('0x6'));var Redis=require(_0x7dc9('0x7'));var qs=require(_0x7dc9('0x8'));var as=require(_0x7dc9('0x9'));var logger=require('../../config/logger')(_0x7dc9('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x7dc9('0xb'));config[_0x7dc9('0xc')]=_[_0x7dc9('0xd')](config[_0x7dc9('0xc')],{'host':_0x7dc9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dc9('0xc')]));require(_0x7dc9('0xf'))[_0x7dc9('0x10')](socket);function respondWithStatusCode(_0x1dc3f7,_0x359c88){_0x359c88=_0x359c88||0xcc;return function(_0x3c2af5){if(_0x3c2af5){return _0x1dc3f7[_0x7dc9('0x11')](_0x359c88);}return _0x1dc3f7['status'](_0x359c88)['end']();};}function respondWithResult(_0x4be1c8,_0x599ef1){_0x599ef1=_0x599ef1||0xc8;return function(_0x94c75a){if(_0x94c75a){return _0x4be1c8[_0x7dc9('0x12')](_0x599ef1)['json'](_0x94c75a);}};}function respondWithFilteredResult(_0xbd06be,_0x2f3acd){return function(_0xaadf2){if(_0xaadf2){var _0xf37bc7=typeof _0x2f3acd[_0x7dc9('0x13')]===_0x7dc9('0x14')&&typeof _0x2f3acd['limit']===_0x7dc9('0x14');var _0x278191=_0xaadf2[_0x7dc9('0x15')];var _0x442819=_0xf37bc7?0x0:_0x2f3acd[_0x7dc9('0x13')];var _0xbe0437=_0xf37bc7?_0xaadf2[_0x7dc9('0x15')]:_0x2f3acd[_0x7dc9('0x13')]+_0x2f3acd[_0x7dc9('0x16')];var _0x5a6e04;if(_0xbe0437>=_0x278191){_0xbe0437=_0x278191;_0x5a6e04=0xc8;}else{_0x5a6e04=0xce;}_0xbd06be[_0x7dc9('0x12')](_0x5a6e04);return _0xbd06be['set'](_0x7dc9('0x17'),_0x442819+'-'+_0xbe0437+'/'+_0x278191)[_0x7dc9('0x18')](_0xaadf2);}return null;};}function saveUpdates(_0x5d61d7){return function(_0x41f66e){if(_0x41f66e){return _0x41f66e[_0x7dc9('0x19')](_0x5d61d7)[_0x7dc9('0x1a')](function(_0x4b2703){return _0x4b2703;});}return null;};}function removeEntity(_0x43ec33){return function(_0x184bfd){if(_0x184bfd){return _0x184bfd[_0x7dc9('0x1b')]()[_0x7dc9('0x1a')](function(){_0x43ec33[_0x7dc9('0x12')](0xcc)[_0x7dc9('0x1c')]();});}};}function handleEntityNotFound(_0x576681){return function(_0x593e60){if(!_0x593e60){_0x576681[_0x7dc9('0x11')](0x194);}return _0x593e60;};}function handleError(_0x5981e2,_0x596e0f){_0x596e0f=_0x596e0f||0x1f4;return function(_0x349001){logger[_0x7dc9('0x1d')](_0x349001['stack']);if(_0x349001[_0x7dc9('0x1e')]){delete _0x349001[_0x7dc9('0x1e')];}_0x5981e2[_0x7dc9('0x12')](_0x596e0f)['send'](_0x349001);};}function getInteractionUsers(_0x424763,_0x1e3a8d){return new BPromise(function(_0xf95336,_0x55a482){try{if(_0x1e3a8d[_0x424763['id']]){_0x424763['Users']=_['map'](_0x1e3a8d[_0x424763['id']],function(_0x25b383){return{'id':_0x25b383['id'],'fullname':_0x25b383[_0x7dc9('0x1f')]};});}}catch(_0x5843bf){_0x55a482(_0x5843bf);}_0xf95336(_0x424763);});}function getInteractionTags(_0x585eef,_0x47771b){return new BPromise(function(_0x5afb7d,_0x2d22eb){try{if(_0x585eef[_0x7dc9('0x20')]){_0x585eef[_0x7dc9('0x21')]=[];_0x585eef[_0x7dc9('0x20')][_0x7dc9('0x22')](',')[_0x7dc9('0x23')](function(_0x236d42){_0x585eef[_0x7dc9('0x21')][_0x7dc9('0x24')](_0x47771b[_0x236d42]);});}delete _0x585eef[_0x7dc9('0x20')];}catch(_0x14083d){_0x2d22eb(_0x14083d);}_0x5afb7d(_0x585eef);});}function getLastMessageText(_0x2a456c){return new BPromise(function(_0x4bb716,_0x4e929c){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x2a456c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})['then'](function(_0x4463dc){if(_0x4463dc&&_0x4463dc[_0x7dc9('0x25')]){_0x2a456c[_0x7dc9('0x26')]=_[_0x7dc9('0x27')](_0x4463dc[_0x7dc9('0x25')]);}_0x4bb716(_0x2a456c);})[_0x7dc9('0x28')](function(_0x5d2e7b){_0x4e929c(_0x5d2e7b);});});}function updateMailInteraction(_0x5ce3e1,_0x4d4e46,_0x477478,_0x49ed97){return new BPromise(function(_0x2b9ca0,_0x448e46){return getInteractionUsers(_0x5ce3e1,_0x477478)[_0x7dc9('0x1a')](function(_0x213066){return getInteractionTags(_0x213066,_0x4d4e46);})[_0x7dc9('0x1a')](function(_0x165882){return getStateInteraction(_0x165882);})[_0x7dc9('0x1a')](function(_0xf47bdc){if(_0x49ed97){_0x2b9ca0(getLastMessageText(_0xf47bdc));}else{_0x2b9ca0(_0xf47bdc);}})['catch'](function(_0x2b56d7){_0x448e46(_0x2b56d7);});});}function getStateInteraction(_0x4cdec4){return new BPromise(function(_0x421e1a){_0x4cdec4[_0x7dc9('0x29')]=0x0;_0x4cdec4[_0x7dc9('0x2a')]=0x0;_0x4cdec4[_0x7dc9('0x2b')]=0x0;_0x4cdec4['unmanaged']=0x0;_0x4cdec4[_0x7dc9('0x2c')]=0x0;if(!_0x4cdec4['closed']&&!_0x4cdec4[_0x7dc9('0x2d')]){_0x4cdec4['waiting']+=0x1;}if(!_0x4cdec4['closed']&&_0x4cdec4[_0x7dc9('0x2d')]){_0x4cdec4[_0x7dc9('0x2a')]+=0x1;if(_0x4cdec4[_0x7dc9('0x29')]){_0x4cdec4[_0x7dc9('0x29')]-=0x1;}}if(_0x4cdec4['closed']&&_0x4cdec4[_0x7dc9('0x2d')]){_0x4cdec4[_0x7dc9('0x2b')]+=0x1;if(_0x4cdec4[_0x7dc9('0x2a')]){_0x4cdec4[_0x7dc9('0x2a')]-=0x1;}}if(_0x4cdec4[_0x7dc9('0x2e')]&&!_0x4cdec4[_0x7dc9('0x2d')]){_0x4cdec4[_0x7dc9('0x2f')]+=0x1;if(_0x4cdec4[_0x7dc9('0x29')]){_0x4cdec4[_0x7dc9('0x29')]-=0x1;}}_0x4cdec4[_0x7dc9('0x2c')]+=0x1;_0x421e1a(_0x4cdec4);});}exports[_0x7dc9('0x30')]=function(_0x3a8d80,_0x5a94b5){var _0x34b5c9={},_0x7cdd8d={},_0x466b02={'count':0x0,'rows':[]};var _0xfd2612=_['map'](db[_0x7dc9('0x31')][_0x7dc9('0x32')],function(_0x255801){return{'name':_0x255801[_0x7dc9('0x33')],'type':_0x255801[_0x7dc9('0x34')][_0x7dc9('0x35')]};});_0x7cdd8d['model']=_['map'](_0xfd2612,_0x7dc9('0x1e'));_0x7cdd8d[_0x7dc9('0x36')]=_['keys'](_0x3a8d80[_0x7dc9('0x36')]);_0x7cdd8d['filters']=_[_0x7dc9('0x37')](_0x7cdd8d[_0x7dc9('0x38')],_0x7cdd8d[_0x7dc9('0x36')]);_0x34b5c9['attributes']=_[_0x7dc9('0x37')](_0x7cdd8d[_0x7dc9('0x38')],qs[_0x7dc9('0x39')](_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x39')]));_0x34b5c9[_0x7dc9('0x3a')]=_0x34b5c9[_0x7dc9('0x3a')]['length']?_0x34b5c9[_0x7dc9('0x3a')]:_0x7cdd8d['model'];if(!_0x3a8d80['query'][_0x7dc9('0x3b')](_0x7dc9('0x3c'))){_0x34b5c9[_0x7dc9('0x16')]=qs[_0x7dc9('0x16')](_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x16')]);_0x34b5c9[_0x7dc9('0x13')]=qs[_0x7dc9('0x13')](_0x3a8d80[_0x7dc9('0x36')]['offset']);}_0x34b5c9[_0x7dc9('0x3d')]=qs[_0x7dc9('0x3e')](_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x3e')]);_0x34b5c9[_0x7dc9('0x3f')]=qs[_0x7dc9('0x40')](_['pick'](_0x3a8d80[_0x7dc9('0x36')],_0x7cdd8d[_0x7dc9('0x40')]),_0xfd2612);var _0x49bffe=[];var _0x288c80=squel[_0x7dc9('0x41')]()[_0x7dc9('0x42')]('id')['field'](_0x7dc9('0x1e'))['field']('color')[_0x7dc9('0x43')](_0x7dc9('0x44'));var _0x36d591=squel['select']()['field'](_0x7dc9('0x45'))['field'](_0x7dc9('0x46'))[_0x7dc9('0x42')]('ui.MailInteractionId')[_0x7dc9('0x43')](_0x7dc9('0x47'),'ui')[_0x7dc9('0x48')](_0x7dc9('0x49'),'u',_0x7dc9('0x4a'));var _0x113087=squel[_0x7dc9('0x41')]()[_0x7dc9('0x43')](_0x7dc9('0x4b'),'i')[_0x7dc9('0x48')](_0x7dc9('0x4c'),'c',_0x7dc9('0x4d'))[_0x7dc9('0x48')]('users','o',_0x7dc9('0x4e'))['left_join']('mail_accounts','a',_0x7dc9('0x4f'))[_0x7dc9('0x48')](_0x7dc9('0x50'),'me',_0x7dc9('0x51'))[_0x7dc9('0x48')]('mail_interaction_has_tags','it',_0x7dc9('0x52'))[_0x7dc9('0x48')](_0x7dc9('0x44'),'t','t.id\x20=\x20it.TagId');var _0x341909=squel[_0x7dc9('0x53')]();var _0x2cf133=[];var _0x32bc31=squel[_0x7dc9('0x53')]();var _0x141c34;if(_0x3a8d80['query'][_0x7dc9('0x54')]){_0x141c34=as[_0x7dc9('0x55')](_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x54')]);var _0x877a67=_0x141c34[_0x7dc9('0x56')];for(var _0x31baf1=0x0;_0x31baf1<_0x141c34[_0x7dc9('0x57')][_0x7dc9('0x58')];_0x31baf1++){var _0x1de02f=_0x141c34[_0x7dc9('0x57')][_0x31baf1];var _0x3819e5='i';var _0x4fec6e=_[_0x7dc9('0x59')](_0xfd2612,[_0x7dc9('0x1e'),_0x1de02f[_0x7dc9('0x42')]]);if(!_0x4fec6e){switch(_0x1de02f[_0x7dc9('0x42')]){case _0x7dc9('0x5a'):if(_0x1de02f['value']==0x1){_0x113087[_0x7dc9('0x5b')]('`'+_0x1de02f[_0x7dc9('0x42')]+_0x7dc9('0x5c'));}else{_0x113087[_0x7dc9('0x5b')]('`'+_0x1de02f[_0x7dc9('0x42')]+_0x7dc9('0x5d'));}break;case'Contact':if(_0x1de02f['operator']==='$substring'){if(_0x1de02f[_0x7dc9('0x5e')][_0x7dc9('0x22')]('\x20')[_0x7dc9('0x58')]>0x1){_0x341909[_0x877a67](_0x7dc9('0x5f'),qs['getFullTextValue'](_0x1de02f['value']),null);}else{var _0x10649a='%'+_0x1de02f[_0x7dc9('0x5e')]+'%';_0x341909[_0x877a67](_0x7dc9('0x60'),_0x10649a,_0x10649a,_0x10649a);}}else{_0x4fec6e=_[_0x7dc9('0x59')](_0xfd2612,[_0x7dc9('0x1e'),_0x7dc9('0x61')]);_0x1de02f[_0x7dc9('0x42')]='ContactId';_0x45c774=as[_0x7dc9('0x62')](_0x3819e5,_0x4fec6e[_0x7dc9('0x34')],_0x1de02f);_0x341909[_0x877a67](_0x45c774[_0x7dc9('0x63')],_0x45c774[_0x7dc9('0x5e')][_0x7dc9('0x64')],_0x45c774['value'][_0x7dc9('0x1c')]);}break;case _0x7dc9('0x65'):var _0x3e49a8=_0x1de02f[_0x7dc9('0x5e')][_0x7dc9('0x22')](',')[_0x7dc9('0x66')](function(_0x286ac5){return Number(_0x286ac5);});_0x3e49a8[_0x7dc9('0x23')](function(_0x3463e4){_0x32bc31['or'](_0x7dc9('0x67'),'%,'+_0x3463e4+',%');});_0x2cf133=_[_0x7dc9('0x68')](_0x2cf133,_0x3e49a8);break;case _0x7dc9('0x69'):if(_0x1de02f[_0x7dc9('0x6a')]==='$substring'){_0x341909[_0x877a67](_0x7dc9('0x6b'),'%'+_0x1de02f['value']+'%',null);}else{_0x4fec6e=_[_0x7dc9('0x59')](_0xfd2612,[_0x7dc9('0x1e'),'UserId']);_0x1de02f[_0x7dc9('0x42')]=_0x7dc9('0x2d');_0x45c774=as['buildExpression'](_0x3819e5,_0x4fec6e[_0x7dc9('0x34')],_0x1de02f);_0x341909[_0x877a67](_0x45c774[_0x7dc9('0x63')],_0x45c774[_0x7dc9('0x5e')]['start'],_0x45c774['value'][_0x7dc9('0x1c')]);}break;case _0x7dc9('0x25'):_0x45c774=as[_0x7dc9('0x62')]('me',null,_0x1de02f);_0x341909[_0x877a67](_0x45c774[_0x7dc9('0x63')],_0x45c774[_0x7dc9('0x5e')][_0x7dc9('0x64')],_0x45c774[_0x7dc9('0x5e')][_0x7dc9('0x1c')]);break;}}else{var _0x45c774=as['buildExpression'](_0x3819e5,_0x4fec6e[_0x7dc9('0x34')],_0x1de02f);_0x341909[_0x877a67](_0x45c774[_0x7dc9('0x63')],_0x45c774[_0x7dc9('0x5e')]['start'],_0x45c774['value'][_0x7dc9('0x1c')]);}}}else{var _0x117444=_(_0x3a8d80[_0x7dc9('0x36')])[_0x7dc9('0x6c')]()['map'](function(_0x4c7c6b){return _[_0x7dc9('0x6d')](_0xfd2612,[_0x7dc9('0x1e'),_0x4c7c6b])?_0x4c7c6b:undefined;})[_0x7dc9('0x6e')]()[_0x7dc9('0x5e')]();if(!_['isEmpty'](_0x117444)){_0x117444[_0x7dc9('0x23')](function(_0x2db560){if(_0x2db560===_0x7dc9('0x6f')){_0x113087[_0x7dc9('0x3f')](_0x7dc9('0x70'),[][_0x7dc9('0x71')](_0x3a8d80[_0x7dc9('0x36')][_0x2db560]));}else if(_0x2db560==='createdAt'){var _0x2d7c33=JSON[_0x7dc9('0x72')](_0x3a8d80['query'][_0x2db560])['$gte'];var _0x1a0dad=JSON['parse'](_0x3a8d80[_0x7dc9('0x36')][_0x2db560])[_0x7dc9('0x73')];_0x113087[_0x7dc9('0x3f')](_0x7dc9('0x74'),_0x2d7c33,_0x1a0dad);}else{if(_0x3a8d80[_0x7dc9('0x36')][_0x2db560]===_0x7dc9('0x75')){_0x113087[_0x7dc9('0x3f')]('i.'+_0x2db560+_0x7dc9('0x76'));}else{_0x113087[_0x7dc9('0x3f')]('i.'+_0x2db560+_0x7dc9('0x77'),_0x3a8d80['query'][_0x2db560]);}}});}if(_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x78')]){if(_0x3a8d80[_0x7dc9('0x36')]['read']==0x1){_0x113087[_0x7dc9('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x113087['having'](_0x7dc9('0x79'));}}if(_0x3a8d80[_0x7dc9('0x36')]['tag']){_0x2cf133=_[_0x7dc9('0x7a')](_0x3a8d80['query']['tag'])?_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x7b')]:new Array(_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x7b')]);_0x2cf133['forEach'](function(_0xf9a553){_0x32bc31['or'](_0x7dc9('0x67'),'%,'+_0xf9a553+',%');});}if(_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x7c')]){var _0xe0071=_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x7c')][_0x7dc9('0x7d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xe0071)){_0x341909['or'](_0x7dc9('0x7e'),_0xe0071+'%');}else if(qs['isEmail'](_0xe0071)){_0x341909['or'](_0x7dc9('0x7f'),_0xe0071+'%');}else{_0x341909['or'](_0x7dc9('0x80'),qs[_0x7dc9('0x81')](_0xe0071))['or'](_0x7dc9('0x82'),qs['getFullTextValue'](_0xe0071));}}}_0x113087[_0x7dc9('0x3f')](_0x341909);_0x113087[_0x7dc9('0x83')]('i.id');var _0x1b811d={'type':db[_0x7dc9('0x84')][_0x7dc9('0x85')][_0x7dc9('0x86')],'raw':!![]};var _0x5bc1c3=_0x113087[_0x7dc9('0x87')]();_0x5bc1c3[_0x7dc9('0x42')]('i.id');_0x5bc1c3['field'](_0x7dc9('0x88'),_0x7dc9('0x5a'));if(_0x34b5c9['order']){_0x34b5c9[_0x7dc9('0x3d')]['forEach'](function(_0x2e7296){var _0x1d0722=_0x2e7296[0x0]===_0x7dc9('0x89')?_0x2e7296[0x0]:'i.'+_0x2e7296[0x0];_0x113087['order'](_0x1d0722,_0x2e7296[0x1]===_0x7dc9('0x8a')?![]:!![]);});}if(!_[_0x7dc9('0x8b')](_0x2cf133)){_0x113087[_0x7dc9('0x5b')](_0x32bc31);_0x5bc1c3['where'](_0x7dc9('0x8c'),_0x2cf133);}BPromise['resolve']()['then'](function(){if(!_0x141c34){if(_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x6f')])return;_0x5bc1c3[_0x7dc9('0x3f')](_0x7dc9('0x8d'));_0x113087[_0x7dc9('0x3f')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3a8d80[_0x7dc9('0x8e')][_0x7dc9('0x8f')]!==_0x7dc9('0x90'))return;return _0x3a8d80[_0x7dc9('0x8e')][_0x7dc9('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x40eb3a){if(_[_0x7dc9('0x8b')](_0x40eb3a)){_0x5bc1c3[_0x7dc9('0x3f')](_0x7dc9('0x92'));_0x113087['where'](_0x7dc9('0x92'));}else{_0x5bc1c3['where']('i.MailAccountId\x20IN\x20?',_[_0x7dc9('0x66')](_0x40eb3a,'id'));_0x113087['where'](_0x7dc9('0x70'),_[_0x7dc9('0x66')](_0x40eb3a,'id'));}});})[_0x7dc9('0x1a')](function(){if(_0x3a8d80[_0x7dc9('0x8e')][_0x7dc9('0x8f')]===_0x7dc9('0x90')&&!_0x141c34&&!_0x3a8d80['query'][_0x7dc9('0x6f')])return[];return db[_0x7dc9('0x93')][_0x7dc9('0x36')](_0x5bc1c3[_0x7dc9('0x94')](),_0x1b811d);})[_0x7dc9('0x1a')](function(_0x4c25fe){_0x466b02[_0x7dc9('0x15')]=_0x4c25fe['length'];if(_0x466b02[_0x7dc9('0x15')]===0x0)return[];return db[_0x7dc9('0x93')][_0x7dc9('0x36')](_0x288c80['toString'](),_0x1b811d)[_0x7dc9('0x1a')](function(_0x4441a6){_0x49bffe=_['keyBy'](_0x4441a6,'id');_0x1b811d=_[_0x7dc9('0x95')](_0x1b811d,{'model':db[_0x7dc9('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a8d80[_0x7dc9('0x36')][_0x7dc9('0x39')]){_0x34b5c9['attributes'][_0x7dc9('0x23')](function(_0x5cd971){_0x113087[_0x7dc9('0x42')]('i.'+_0x5cd971);});}else{_0x113087[_0x7dc9('0x42')](_0x7dc9('0x88'),'unreadMessages');_0x113087[_0x7dc9('0x42')](_0x7dc9('0x96'),_0x7dc9('0x97'));_0x113087['field']('a.mandatoryDisposition',_0x7dc9('0x98'));_0x113087[_0x7dc9('0x42')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x113087[_0x7dc9('0x42')](_0x7dc9('0x99'));_0x113087['field'](_0x7dc9('0x9a'));_0x113087['field'](_0x7dc9('0x9b'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0x9c'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0x9d'));_0x113087[_0x7dc9('0x42')]('i.attach');_0x113087[_0x7dc9('0x42')](_0x7dc9('0x9e'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0x9f'));_0x113087[_0x7dc9('0x42')]('i.subject');_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa0'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa1'));_0x113087['field'](_0x7dc9('0xa2'));_0x113087[_0x7dc9('0x42')]('i.substatus');_0x113087[_0x7dc9('0x42')]('i.to');_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa3'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa4'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa5'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa6'),'Contact.firstName');_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa7'),_0x7dc9('0xa8'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xa9'),'Contact.email');_0x113087[_0x7dc9('0x42')](_0x7dc9('0xaa'),_0x7dc9('0xab'));_0x113087[_0x7dc9('0x42')]('c.mobile',_0x7dc9('0xac'));_0x113087['field'](_0x7dc9('0xad'),'Contact.fax');_0x113087[_0x7dc9('0x42')](_0x7dc9('0xae'),_0x7dc9('0xaf'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xb0'),_0x7dc9('0xb1'));_0x113087[_0x7dc9('0x42')](_0x7dc9('0xb2'),_0x7dc9('0x20'));}if(_0x34b5c9[_0x7dc9('0x16')])_0x113087[_0x7dc9('0x16')](_0x34b5c9[_0x7dc9('0x16')]);if(_0x34b5c9['offset'])_0x113087[_0x7dc9('0x13')](_0x34b5c9[_0x7dc9('0x13')]);return db[_0x7dc9('0x93')][_0x7dc9('0x36')](_0x113087['toString'](),_0x1b811d);})[_0x7dc9('0x1a')](function(_0x35e061){if(_0x35e061[_0x7dc9('0x58')]>0x0)_0x36d591[_0x7dc9('0x3f')]('ui.MailInteractionId\x20IN\x20?',_[_0x7dc9('0x66')](_0x35e061,'id'));return db[_0x7dc9('0x93')][_0x7dc9('0x36')](_0x36d591['toString'](),_0x1b811d)['then'](function(_0x3cc550){var _0x1044f7=_[_0x7dc9('0xb3')](_0x3cc550,_0x7dc9('0xb4'));var _0x14aaed=[];return db['Setting'][_0x7dc9('0xb5')]({'attributes':[_0x7dc9('0xb6')],'raw':!![]})[_0x7dc9('0x1a')](function(_0x2064df){var _0x493612=_0x2064df[_0x7dc9('0xb6')];_0x35e061['forEach'](function(_0x30c38c){_0x14aaed['push'](updateMailInteraction(_0x30c38c,_0x49bffe,_0x1044f7,_0x493612));});return BPromise[_0x7dc9('0xb7')](_0x14aaed);});});});})[_0x7dc9('0x1a')](function(_0x382305){_0x466b02['rows']=_0x382305;return _0x466b02;})[_0x7dc9('0x1a')](respondWithFilteredResult(_0x5a94b5,_0x34b5c9))[_0x7dc9('0x28')](handleError(_0x5a94b5,null));};exports['show']=function(_0x4fd572,_0x11396a){var _0x5eaad9={'raw':![],'where':{'id':_0x4fd572[_0x7dc9('0xb8')]['id']}},_0x57e953={};_0x57e953[_0x7dc9('0x38')]=_[_0x7dc9('0x6c')](db['MailInteraction']['rawAttributes']);_0x57e953['query']=_[_0x7dc9('0x6c')](_0x4fd572[_0x7dc9('0x36')]);_0x57e953[_0x7dc9('0x40')]=_[_0x7dc9('0x37')](_0x57e953['model'],_0x57e953['query']);_0x5eaad9[_0x7dc9('0x3a')]=_[_0x7dc9('0x37')](_0x57e953[_0x7dc9('0x38')],qs['fields'](_0x4fd572['query'][_0x7dc9('0x39')]));_0x5eaad9['attributes']=_0x5eaad9[_0x7dc9('0x3a')][_0x7dc9('0x58')]?_0x5eaad9['attributes']:_0x57e953[_0x7dc9('0x38')];if(_0x4fd572[_0x7dc9('0x36')][_0x7dc9('0xb9')]){_0x5eaad9[_0x7dc9('0xba')]=[{'all':!![]}];}_0x5eaad9=_[_0x7dc9('0x95')]({},_0x5eaad9,_0x4fd572[_0x7dc9('0xbb')]);return db[_0x7dc9('0x31')][_0x7dc9('0x59')](_0x5eaad9)['then'](handleEntityNotFound(_0x11396a,null))[_0x7dc9('0x1a')](respondWithResult(_0x11396a,null))['catch'](handleError(_0x11396a,null));};exports[_0x7dc9('0xbc')]=function(_0x53e42d,_0x43a4b4){return db[_0x7dc9('0x31')]['create'](_0x53e42d[_0x7dc9('0xbd')],{})[_0x7dc9('0x1a')](respondWithResult(_0x43a4b4,0xc9))[_0x7dc9('0x28')](handleError(_0x43a4b4,null));};exports[_0x7dc9('0x19')]=function(_0x257c27,_0x4ba475){if(_0x257c27[_0x7dc9('0xbd')]['id']){delete _0x257c27['body']['id'];}return db[_0x7dc9('0x31')][_0x7dc9('0x59')]({'where':{'id':_0x257c27[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x4ba475,null))['then'](saveUpdates(_0x257c27[_0x7dc9('0xbd')],null))[_0x7dc9('0x1a')](respondWithResult(_0x4ba475,null))['catch'](handleError(_0x4ba475,null));};exports[_0x7dc9('0x1b')]=function(_0x1fbaea,_0x415093){return db[_0x7dc9('0x31')]['find']({'where':{'id':_0x1fbaea[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x415093,null))[_0x7dc9('0x1a')](removeEntity(_0x415093,null))[_0x7dc9('0x28')](handleError(_0x415093,null));};exports[_0x7dc9('0xbe')]=function(_0x485cc8,_0x6c7fdc){return db[_0x7dc9('0x31')][_0x7dc9('0xbe')]()[_0x7dc9('0x1a')](respondWithResult(_0x6c7fdc,null))['catch'](handleError(_0x6c7fdc,null));};exports[_0x7dc9('0xbf')]=function(_0x5c9d64,_0x59710c){return db['MailMessage'][_0x7dc9('0x59')]({'where':{'id':_0x5c9d64[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x59710c,null))[_0x7dc9('0x1a')](function(_0x24a1e2){if(_0x24a1e2){return _0x24a1e2[_0x7dc9('0xbf')](_0x5c9d64[_0x7dc9('0xbd')][_0x7dc9('0xc0')],_['omit'](_0x5c9d64[_0x7dc9('0xbd')],[_0x7dc9('0xc0'),'id'])||{});}})[_0x7dc9('0x1a')](respondWithResult(_0x59710c,null))['catch'](handleError(_0x59710c,null));};exports[_0x7dc9('0xc1')]=function(_0x462811,_0x4404d0){var _0x3a179a={'raw':![],'where':{}};var _0x33e3fa={};var _0x244ee5={'count':0x0,'rows':[]};return db[_0x7dc9('0x31')][_0x7dc9('0xb5')]({'where':{'id':_0x462811[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x4404d0,null))[_0x7dc9('0x1a')](function(_0x2abd10){if(_0x2abd10){_0x33e3fa[_0x7dc9('0x38')]=_[_0x7dc9('0x6c')](db[_0x7dc9('0xc2')][_0x7dc9('0x32')]);_0x33e3fa[_0x7dc9('0x36')]=_[_0x7dc9('0x6c')](_0x462811[_0x7dc9('0x36')]);_0x33e3fa[_0x7dc9('0x40')]=_['intersection'](_0x33e3fa[_0x7dc9('0x38')],_0x33e3fa['query']);_0x3a179a[_0x7dc9('0x3a')]=_['intersection'](_0x33e3fa['model'],qs[_0x7dc9('0x39')](_0x462811[_0x7dc9('0x36')]['fields']));_0x3a179a[_0x7dc9('0x3a')]=_0x3a179a['attributes'][_0x7dc9('0x58')]?_0x3a179a[_0x7dc9('0x3a')]:_0x33e3fa['model'];if(!_0x462811['query'][_0x7dc9('0x3b')](_0x7dc9('0x3c'))){_0x3a179a[_0x7dc9('0x16')]=qs[_0x7dc9('0x16')](_0x462811['query'][_0x7dc9('0x16')]);_0x3a179a[_0x7dc9('0x13')]=qs['offset'](_0x462811[_0x7dc9('0x36')][_0x7dc9('0x13')]);}_0x3a179a['order']=qs['sort'](_0x462811[_0x7dc9('0x36')][_0x7dc9('0x3e')]);_0x3a179a[_0x7dc9('0x3f')]=qs[_0x7dc9('0x40')](_['pick'](_0x462811[_0x7dc9('0x36')],_0x33e3fa['filters']));_0x3a179a['where'][_0x7dc9('0xb4')]=_0x2abd10['id'];if(_0x462811[_0x7dc9('0x36')][_0x7dc9('0x7c')]){_0x3a179a[_0x7dc9('0x3f')]=_[_0x7dc9('0x95')](_0x3a179a[_0x7dc9('0x3f')],{'$or':_[_0x7dc9('0x66')](_0x3a179a['attributes'],function(_0x331f2e){var _0x373a44={};_0x373a44[_0x331f2e]={'$like':'%'+_0x462811[_0x7dc9('0x36')][_0x7dc9('0x7c')]+'%'};return _0x373a44;})});}if(_0x462811[_0x7dc9('0x36')][_0x7dc9('0xc3')]){var _0x2c7113=_0x462811['query'][_0x7dc9('0xc3')][_0x7dc9('0x22')](',');var _0x18f1e6={};_0x18f1e6[_0x2c7113[0x0]]={'$gte':moment(_0x2c7113[0x1])[_0x7dc9('0xc4')](_0x7dc9('0xc5'))};_0x3a179a['where']=_[_0x7dc9('0x95')](_0x3a179a['where'],_0x18f1e6);}_0x3a179a=_[_0x7dc9('0x95')]({},_0x3a179a,_0x462811[_0x7dc9('0xbb')]);return db['MailMessage'][_0x7dc9('0x15')]({'where':_0x3a179a[_0x7dc9('0x3f')]})[_0x7dc9('0x1a')](function(_0x10f9cb){_0x244ee5[_0x7dc9('0x15')]=_0x10f9cb;if(_0x462811[_0x7dc9('0x36')]['includeAll']){_0x3a179a[_0x7dc9('0xba')]=[{'all':!![]}];}return db[_0x7dc9('0xc2')]['findAll'](_0x3a179a);})[_0x7dc9('0x1a')](function(_0x410cfe){if(_0x462811['query']['inlineCss']===_0x7dc9('0xc6')){for(var _0x2fd0ae=0x0;_0x2fd0ae<_0x410cfe[_0x7dc9('0x58')];_0x2fd0ae++){_0x410cfe[_0x2fd0ae]['body']=juice(_0x410cfe[_0x2fd0ae][_0x7dc9('0xbd')]);}}_0x244ee5['rows']=_0x410cfe;return _0x244ee5;});}})[_0x7dc9('0x1a')](respondWithFilteredResult(_0x4404d0,_0x3a179a))[_0x7dc9('0x28')](handleError(_0x4404d0,null));};exports[_0x7dc9('0xc7')]=function(_0x4cc15c,_0x8435b5){return db['MailInteraction']['find']({'where':{'id':_0x4cc15c[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x8435b5,null))[_0x7dc9('0x1a')](function(_0x3a3fbd){if(_0x3a3fbd){return _0x3a3fbd[_0x7dc9('0xc8')](_0x4cc15c['body']['ids'],_[_0x7dc9('0xc9')](_0x4cc15c[_0x7dc9('0xbd')],[_0x7dc9('0xc0'),'id'])||{})[_0x7dc9('0xca')](function(){return db['Tag'][_0x7dc9('0xcb')]({'attributes':['id','name',_0x7dc9('0xcc')],'where':{'id':_0x4cc15c['body'][_0x7dc9('0xc0')]}});})[_0x7dc9('0x1a')](function(_0x4b1632){socket[_0x7dc9('0xcd')](_0x7dc9('0xce'),{'id':Number(_0x4cc15c[_0x7dc9('0xb8')]['id']),'tags':_0x4b1632||[]});return{'id':Number(_0x4cc15c[_0x7dc9('0xb8')]['id']),'tags':_0x4b1632||[]};});}})[_0x7dc9('0x1a')](respondWithResult(_0x8435b5,null))['catch'](handleError(_0x8435b5,null));};exports[_0x7dc9('0xcf')]=function(_0x1ec900,_0x34f00c){return db[_0x7dc9('0x31')]['find']({'where':{'id':_0x1ec900[_0x7dc9('0xb8')]['id']}})[_0x7dc9('0x1a')](handleEntityNotFound(_0x34f00c,null))[_0x7dc9('0x1a')](function(_0x36421a){if(_0x36421a){return _0x36421a['removeTags'](_0x1ec900['query']['ids']);}})[_0x7dc9('0x1a')](respondWithStatusCode(_0x34f00c,null))[_0x7dc9('0x28')](handleError(_0x34f00c,null));};exports[_0x7dc9('0xd0')]=function(_0x319f93,_0x49623a){var _0xa20e0c=moment()['unix']()['toString']();var _0x5a30a9=path[_0x7dc9('0xd1')](config[_0x7dc9('0xd2')],_0x7dc9('0xd3'),_0x7dc9('0xd4'),'tmp');var _0x5025c2=path['join'](config[_0x7dc9('0xd2')],_0x7dc9('0xd3'),_0x7dc9('0xd4'),_0x7dc9('0xd5'));var _0x1f0722=path[_0x7dc9('0xd1')](_0x5a30a9,_0xa20e0c);var _0x4b707c=util[_0x7dc9('0xc4')](_0x7dc9('0xd6'),_0x319f93[_0x7dc9('0xb8')]['id'],_0xa20e0c);var _0x417e7e=path[_0x7dc9('0xd1')](_0x5a30a9,_0x4b707c);var _0x44a6d2=[];if(_0x319f93[_0x7dc9('0x36')]['attachments']){_0x44a6d2['push']({'model':db[_0x7dc9('0xd7')],'as':_0x7dc9('0xd8'),'raw':!![]});}var _0x261673=[{'model':db['MailMessage'],'as':_0x7dc9('0xd9'),'attributes':['id',_0x7dc9('0xbd'),_0x7dc9('0x43'),'to','cc',_0x7dc9('0xda'),_0x7dc9('0xdb'),_0x7dc9('0xdc')],'where':{'secret':![]},'order':qs[_0x7dc9('0x3e')]('id'),'include':_0x44a6d2}];return db[_0x7dc9('0x31')][_0x7dc9('0x59')]({'where':{'id':_0x319f93[_0x7dc9('0xb8')]['id']},'include':_0x261673})[_0x7dc9('0x1a')](handleEntityNotFound(_0x49623a,null))[_0x7dc9('0x1a')](function(_0x276d9f){if(_0x276d9f&&_0x276d9f[_0x7dc9('0xd9')]){var _0x5241dd=_0x276d9f[_0x7dc9('0xdd')]({'plain':!![]});fs[_0x7dc9('0xde')](_0x1f0722);return BPromise[_0x7dc9('0xdf')](_0x5241dd[_0x7dc9('0xd9')],function(_0x32a4bd,_0xe9e4a0){var _0x4a7491={'from':_0x32a4bd[_0x7dc9('0x43')],'to':_0x32a4bd['to'],'subject':_0x32a4bd[_0x7dc9('0xdb')],'html':htmlEntities[_0x7dc9('0xe0')](_0x32a4bd[_0x7dc9('0xbd')]),'headers':{'Date':moment(_0x32a4bd[_0x7dc9('0xdc')])['format'](_0x7dc9('0xe1'))},'attachments':[]};if(_0x32a4bd['cc']){_0x4a7491[_0x7dc9('0xe2')]['Cc']=_0x32a4bd['cc'];}if(_0x32a4bd['bcc']){_0x4a7491[_0x7dc9('0xe2')]['Bcc']=_0x32a4bd[_0x7dc9('0xda')];}return new BPromise(function(_0x2a8968,_0x32cae1){if(_0x32a4bd[_0x7dc9('0xd8')]){for(var _0x35ad90=0x0;_0x35ad90<_0x32a4bd[_0x7dc9('0xd8')]['length'];_0x35ad90++){var _0x5d6314=_0x32a4bd[_0x7dc9('0xd8')][_0x35ad90];var _0x163919=path['join'](_0x5025c2,_0x5d6314[_0x7dc9('0xe3')]);if(fs[_0x7dc9('0xe4')](_0x163919)){_0x4a7491[_0x7dc9('0xd5')][_0x7dc9('0x24')]({'name':_0x5d6314[_0x7dc9('0x1e')],'contentType':_0x5d6314[_0x7dc9('0x34')],'data':fs[_0x7dc9('0xe5')](_0x163919)});}}}emlformat[_0x7dc9('0xe6')](_0x4a7491,function(_0xc48e3,_0x18486e){if(_0xc48e3)return _0x32cae1(_0xc48e3);fs['writeFileSync'](path[_0x7dc9('0xd1')](_0x1f0722,util[_0x7dc9('0xc4')](_0x7dc9('0xe7'),_0xe9e4a0)),_0x18486e);return _0x2a8968(_0x18486e);});});})['then'](function(){return new BPromise(function(_0x41dacf,_0x2c86e6){zipdir(_0x1f0722,{'saveTo':_0x417e7e},function(_0x23d2c2,_0x54190b){if(_0x23d2c2)return _0x2c86e6(_0x23d2c2);return _0x41dacf(_0x54190b);});})[_0x7dc9('0x1a')](function(){return new BPromise(function(_0x382f01,_0x51abdd){rimraf(_0x1f0722,function(_0x7154d2){if(_0x7154d2)_0x51abdd(_0x7154d2);return _0x382f01();});});})[_0x7dc9('0x1a')](function(){return _0x49623a[_0x7dc9('0xd0')](_0x417e7e,_0x4b707c,function(_0x2646c9){if(!_0x2646c9)fs[_0x7dc9('0xe8')](_0x417e7e);});});});}else{return _0x49623a[_0x7dc9('0x11')](0xc8);}})[_0x7dc9('0x28')](handleError(_0x49623a,null));}; \ No newline at end of file +var _0x6eed=['emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','Attachment','Attachments','Messages','bcc','mkdirSync','subject','decode','createdAt','Bcc','existsSync','readFileSync','message%d.eml','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','html-entities','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','name','send','map','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','-id','lastMsgText','trimStart','plainBody','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','where','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.email','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','includeAll','include','options','create','body','params','destroy','describe','addMessage','omit','ids','getMessages','hasOwnProperty','merge','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags'];(function(_0x5e065e,_0x2fabac){var _0x57eaa0=function(_0x366727){while(--_0x366727){_0x5e065e['push'](_0x5e065e['shift']());}};_0x57eaa0(++_0x2fabac);}(_0x6eed,0xff));var _0xd6ee=function(_0x53ebae,_0xedf032){_0x53ebae=_0x53ebae-0x0;var _0x2ec42a=_0x6eed[_0x53ebae];return _0x2ec42a;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var moment=require(_0xd6ee('0x3'));var BPromise=require(_0xd6ee('0x4'));var util=require('util');var path=require(_0xd6ee('0x5'));var fs=require('fs');var _=require(_0xd6ee('0x6'));var squel=require('squel');var juice=require('juice');var Redis=require(_0xd6ee('0x7'));var qs=require(_0xd6ee('0x8'));var as=require(_0xd6ee('0x9'));var logger=require(_0xd6ee('0xa'))(_0xd6ee('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xd6ee('0xc'));config['redis']=_['defaults'](config['redis'],{'host':_0xd6ee('0xd'),'port':0x18eb});var socket=require(_0xd6ee('0xe'))(new Redis(config['redis']));require(_0xd6ee('0xf'))[_0xd6ee('0x10')](socket);function respondWithStatusCode(_0x2e55a2,_0x2f7ec1){_0x2f7ec1=_0x2f7ec1||0xcc;return function(_0x569fea){if(_0x569fea){return _0x2e55a2[_0xd6ee('0x11')](_0x2f7ec1);}return _0x2e55a2[_0xd6ee('0x12')](_0x2f7ec1)[_0xd6ee('0x13')]();};}function respondWithResult(_0x2f1030,_0x268dd1){_0x268dd1=_0x268dd1||0xc8;return function(_0x3fd1df){if(_0x3fd1df){return _0x2f1030['status'](_0x268dd1)[_0xd6ee('0x14')](_0x3fd1df);}};}function respondWithFilteredResult(_0xca0e8e,_0x54d3eb){return function(_0x369b4a){if(_0x369b4a){var _0x15918d=typeof _0x54d3eb[_0xd6ee('0x15')]===_0xd6ee('0x16')&&typeof _0x54d3eb[_0xd6ee('0x17')]===_0xd6ee('0x16');var _0x49bafc=_0x369b4a[_0xd6ee('0x18')];var _0xb99b70=_0x15918d?0x0:_0x54d3eb[_0xd6ee('0x15')];var _0x4dfab2=_0x15918d?_0x369b4a[_0xd6ee('0x18')]:_0x54d3eb['offset']+_0x54d3eb[_0xd6ee('0x17')];var _0x2b0495;if(_0x4dfab2>=_0x49bafc){_0x4dfab2=_0x49bafc;_0x2b0495=0xc8;}else{_0x2b0495=0xce;}_0xca0e8e[_0xd6ee('0x12')](_0x2b0495);return _0xca0e8e['set'](_0xd6ee('0x19'),_0xb99b70+'-'+_0x4dfab2+'/'+_0x49bafc)['json'](_0x369b4a);}return null;};}function saveUpdates(_0x391488){return function(_0x48a921){if(_0x48a921){return _0x48a921[_0xd6ee('0x1a')](_0x391488)[_0xd6ee('0x1b')](function(_0x23ff1f){return _0x23ff1f;});}return null;};}function removeEntity(_0x2888ef){return function(_0x134c65){if(_0x134c65){return _0x134c65['destroy']()[_0xd6ee('0x1b')](function(){_0x2888ef['status'](0xcc)[_0xd6ee('0x13')]();});}};}function handleEntityNotFound(_0x1af784){return function(_0x3631e6){if(!_0x3631e6){_0x1af784[_0xd6ee('0x11')](0x194);}return _0x3631e6;};}function handleError(_0xec9287,_0x48e6ad){_0x48e6ad=_0x48e6ad||0x1f4;return function(_0x4f5fc0){logger[_0xd6ee('0x1c')](_0x4f5fc0['stack']);if(_0x4f5fc0[_0xd6ee('0x1d')]){delete _0x4f5fc0['name'];}_0xec9287[_0xd6ee('0x12')](_0x48e6ad)[_0xd6ee('0x1e')](_0x4f5fc0);};}function getInteractionUsers(_0x152cd0,_0x352fc5){return new BPromise(function(_0xcd4596,_0x5476f2){try{if(_0x352fc5[_0x152cd0['id']]){_0x152cd0['Users']=_[_0xd6ee('0x1f')](_0x352fc5[_0x152cd0['id']],function(_0x18586f){return{'id':_0x18586f['id'],'fullname':_0x18586f['fullname']};});}}catch(_0x2c9b30){_0x5476f2(_0x2c9b30);}_0xcd4596(_0x152cd0);});}function getInteractionTags(_0xa1e700,_0x30a40a){return new BPromise(function(_0x373308,_0x3766df){try{if(_0xa1e700[_0xd6ee('0x20')]){_0xa1e700[_0xd6ee('0x21')]=[];_0xa1e700['TagIds'][_0xd6ee('0x22')](',')[_0xd6ee('0x23')](function(_0x50b786){_0xa1e700['Tags'][_0xd6ee('0x24')](_0x30a40a[_0x50b786]);});}delete _0xa1e700[_0xd6ee('0x20')];}catch(_0xddca){_0x3766df(_0xddca);}_0x373308(_0xa1e700);});}function getLastMessageText(_0x15a6fd){return new BPromise(function(_0x1f9f6d,_0x5e06c6){return db[_0xd6ee('0x25')][_0xd6ee('0x26')]({'where':{'$and':[{'MailInteractionId':_0x15a6fd['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd6ee('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xd6ee('0x28'),'raw':!![]})[_0xd6ee('0x1b')](function(_0x205042){if(_0x205042&&_0x205042['plainBody']){_0x15a6fd[_0xd6ee('0x29')]=_[_0xd6ee('0x2a')](_0x205042[_0xd6ee('0x2b')]);}_0x1f9f6d(_0x15a6fd);})[_0xd6ee('0x2c')](function(_0xbce8de){_0x5e06c6(_0xbce8de);});});}function updateMailInteraction(_0x946b9,_0x59ca1b,_0x8599de,_0x3c16eb){return new BPromise(function(_0x3375b2,_0x725ed2){return getInteractionUsers(_0x946b9,_0x8599de)['then'](function(_0x414e16){return getInteractionTags(_0x414e16,_0x59ca1b);})[_0xd6ee('0x1b')](function(_0x2916a3){return getStateInteraction(_0x2916a3);})['then'](function(_0x483dca){if(_0x3c16eb){_0x3375b2(getLastMessageText(_0x483dca));}else{_0x3375b2(_0x483dca);}})[_0xd6ee('0x2c')](function(_0x2ac9f2){_0x725ed2(_0x2ac9f2);});});}function getStateInteraction(_0x1479a4){return new BPromise(function(_0x139a15){_0x1479a4[_0xd6ee('0x2d')]=0x0;_0x1479a4[_0xd6ee('0x2e')]=0x0;_0x1479a4[_0xd6ee('0x2f')]=0x0;_0x1479a4[_0xd6ee('0x30')]=0x0;_0x1479a4[_0xd6ee('0x31')]=0x0;if(!_0x1479a4[_0xd6ee('0x32')]&&!_0x1479a4[_0xd6ee('0x33')]){_0x1479a4[_0xd6ee('0x2d')]+=0x1;}if(!_0x1479a4[_0xd6ee('0x32')]&&_0x1479a4[_0xd6ee('0x33')]){_0x1479a4[_0xd6ee('0x2e')]+=0x1;if(_0x1479a4['waiting']){_0x1479a4[_0xd6ee('0x2d')]-=0x1;}}if(_0x1479a4[_0xd6ee('0x32')]&&_0x1479a4[_0xd6ee('0x33')]){_0x1479a4['answered']+=0x1;if(_0x1479a4['talking']){_0x1479a4['talking']-=0x1;}}if(_0x1479a4['closed']&&!_0x1479a4[_0xd6ee('0x33')]){_0x1479a4[_0xd6ee('0x30')]+=0x1;if(_0x1479a4[_0xd6ee('0x2d')]){_0x1479a4[_0xd6ee('0x2d')]-=0x1;}}_0x1479a4[_0xd6ee('0x31')]+=0x1;_0x139a15(_0x1479a4);});}exports[_0xd6ee('0x34')]=function(_0x2c975a,_0x5a8305){var _0x158d31={},_0xb5558c={},_0x48fb7b={'count':0x0,'rows':[]};var _0x2dbb34=_[_0xd6ee('0x1f')](db[_0xd6ee('0x35')][_0xd6ee('0x36')],function(_0xdccf56){return{'name':_0xdccf56[_0xd6ee('0x37')],'type':_0xdccf56[_0xd6ee('0x38')]['key']};});_0xb5558c['model']=_['map'](_0x2dbb34,_0xd6ee('0x1d'));_0xb5558c['query']=_[_0xd6ee('0x39')](_0x2c975a[_0xd6ee('0x3a')]);_0xb5558c[_0xd6ee('0x3b')]=_[_0xd6ee('0x3c')](_0xb5558c[_0xd6ee('0x3d')],_0xb5558c['query']);_0x158d31['attributes']=_['intersection'](_0xb5558c['model'],qs[_0xd6ee('0x3e')](_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x3e')]));_0x158d31[_0xd6ee('0x3f')]=_0x158d31[_0xd6ee('0x3f')][_0xd6ee('0x40')]?_0x158d31[_0xd6ee('0x3f')]:_0xb5558c[_0xd6ee('0x3d')];if(!_0x2c975a[_0xd6ee('0x3a')]['hasOwnProperty'](_0xd6ee('0x41'))){_0x158d31[_0xd6ee('0x17')]=qs['limit'](_0x2c975a[_0xd6ee('0x3a')]['limit']);_0x158d31['offset']=qs[_0xd6ee('0x15')](_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x15')]);}_0x158d31[_0xd6ee('0x42')]=qs[_0xd6ee('0x43')](_0x2c975a[_0xd6ee('0x3a')]['sort']);_0x158d31['where']=qs[_0xd6ee('0x3b')](_[_0xd6ee('0x44')](_0x2c975a['query'],_0xb5558c[_0xd6ee('0x3b')]),_0x2dbb34);var _0x4c04c3=[];var _0x177b09=squel[_0xd6ee('0x45')]()[_0xd6ee('0x46')]('id')[_0xd6ee('0x46')](_0xd6ee('0x1d'))[_0xd6ee('0x46')](_0xd6ee('0x47'))[_0xd6ee('0x48')](_0xd6ee('0x49'));var _0x17a036=squel[_0xd6ee('0x45')]()['field'](_0xd6ee('0x4a'))[_0xd6ee('0x46')](_0xd6ee('0x4b'))[_0xd6ee('0x46')](_0xd6ee('0x4c'))[_0xd6ee('0x48')](_0xd6ee('0x4d'),'ui')[_0xd6ee('0x4e')](_0xd6ee('0x4f'),'u',_0xd6ee('0x50'));var _0x13806b=squel[_0xd6ee('0x45')]()['from'](_0xd6ee('0x51'),'i')[_0xd6ee('0x4e')](_0xd6ee('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd6ee('0x4e')]('users','o',_0xd6ee('0x53'))['left_join'](_0xd6ee('0x54'),'a',_0xd6ee('0x55'))['left_join'](_0xd6ee('0x56'),'me',_0xd6ee('0x57'))[_0xd6ee('0x4e')]('mail_interaction_has_tags','it',_0xd6ee('0x58'))[_0xd6ee('0x4e')]('tools_tags','t',_0xd6ee('0x59'));var _0x4f23e8=squel[_0xd6ee('0x5a')]();var _0x438d8c=[];var _0x9b7ad4=squel[_0xd6ee('0x5a')]();var _0x54f93d;if(_0x2c975a[_0xd6ee('0x3a')]['search']){_0x54f93d=as[_0xd6ee('0x5b')](_0x2c975a[_0xd6ee('0x3a')]['search']);var _0x1313fc=_0x54f93d[_0xd6ee('0x5c')];for(var _0x21eb2e=0x0;_0x21eb2e<_0x54f93d[_0xd6ee('0x5d')][_0xd6ee('0x40')];_0x21eb2e++){var _0x32829a=_0x54f93d[_0xd6ee('0x5d')][_0x21eb2e];var _0x22d5c0='i';var _0x5de1e4=_[_0xd6ee('0x5e')](_0x2dbb34,['name',_0x32829a[_0xd6ee('0x46')]]);if(!_0x5de1e4){switch(_0x32829a[_0xd6ee('0x46')]){case _0xd6ee('0x5f'):if(_0x32829a[_0xd6ee('0x60')]==0x1){_0x13806b['having']('`'+_0x32829a[_0xd6ee('0x46')]+'`\x20=\x200');}else{_0x13806b[_0xd6ee('0x61')]('`'+_0x32829a['field']+_0xd6ee('0x62'));}break;case'Contact':if(_0x32829a[_0xd6ee('0x63')]===_0xd6ee('0x64')){if(_0x32829a[_0xd6ee('0x60')][_0xd6ee('0x22')]('\x20')[_0xd6ee('0x40')]>0x1){_0x4f23e8[_0x1313fc](_0xd6ee('0x65'),qs[_0xd6ee('0x66')](_0x32829a[_0xd6ee('0x60')]),null);}else{var _0x1e0b07='%'+_0x32829a['value']+'%';_0x4f23e8[_0x1313fc](_0xd6ee('0x67'),_0x1e0b07,_0x1e0b07,_0x1e0b07);}}else{_0x5de1e4=_['find'](_0x2dbb34,[_0xd6ee('0x1d'),_0xd6ee('0x68')]);_0x32829a['field']='ContactId';_0x517424=as[_0xd6ee('0x69')](_0x22d5c0,_0x5de1e4[_0xd6ee('0x38')],_0x32829a);_0x4f23e8[_0x1313fc](_0x517424[_0xd6ee('0x6a')],_0x517424[_0xd6ee('0x60')][_0xd6ee('0x6b')],_0x517424[_0xd6ee('0x60')][_0xd6ee('0x13')]);}break;case _0xd6ee('0x6c'):var _0x56399d=_0x32829a[_0xd6ee('0x60')][_0xd6ee('0x22')](',')['map'](function(_0x219c11){return Number(_0x219c11);});_0x56399d[_0xd6ee('0x23')](function(_0x45f58f){_0x9b7ad4['or'](_0xd6ee('0x6d'),'%,'+_0x45f58f+',%');});_0x438d8c=_[_0xd6ee('0x6e')](_0x438d8c,_0x56399d);break;case _0xd6ee('0x6f'):if(_0x32829a[_0xd6ee('0x63')]===_0xd6ee('0x64')){_0x4f23e8[_0x1313fc](_0xd6ee('0x70'),'%'+_0x32829a[_0xd6ee('0x60')]+'%',null);}else{_0x5de1e4=_[_0xd6ee('0x5e')](_0x2dbb34,['name',_0xd6ee('0x33')]);_0x32829a[_0xd6ee('0x46')]='UserId';_0x517424=as[_0xd6ee('0x69')](_0x22d5c0,_0x5de1e4[_0xd6ee('0x38')],_0x32829a);_0x4f23e8[_0x1313fc](_0x517424['text'],_0x517424[_0xd6ee('0x60')][_0xd6ee('0x6b')],_0x517424['value'][_0xd6ee('0x13')]);}break;case _0xd6ee('0x2b'):_0x517424=as['buildExpression']('me',null,_0x32829a);_0x4f23e8[_0x1313fc](_0x517424[_0xd6ee('0x6a')],_0x517424[_0xd6ee('0x60')]['start'],_0x517424['value']['end']);break;}}else{var _0x517424=as[_0xd6ee('0x69')](_0x22d5c0,_0x5de1e4[_0xd6ee('0x38')],_0x32829a);_0x4f23e8[_0x1313fc](_0x517424[_0xd6ee('0x6a')],_0x517424[_0xd6ee('0x60')][_0xd6ee('0x6b')],_0x517424[_0xd6ee('0x60')][_0xd6ee('0x13')]);}}}else{var _0x402962=_(_0x2c975a[_0xd6ee('0x3a')])[_0xd6ee('0x39')]()[_0xd6ee('0x1f')](function(_0x8b9fe3){return _[_0xd6ee('0x71')](_0x2dbb34,['name',_0x8b9fe3])?_0x8b9fe3:undefined;})[_0xd6ee('0x72')]()[_0xd6ee('0x60')]();if(!_['isEmpty'](_0x402962)){_0x402962['forEach'](function(_0x1df2f0){if(_0x1df2f0==='MailAccountId'){_0x13806b[_0xd6ee('0x73')](_0xd6ee('0x74'),[][_0xd6ee('0x75')](_0x2c975a['query'][_0x1df2f0]));}else if(_0x1df2f0==='createdAt'){var _0x34463e=JSON[_0xd6ee('0x76')](_0x2c975a[_0xd6ee('0x3a')][_0x1df2f0])[_0xd6ee('0x77')];var _0x33de89=JSON[_0xd6ee('0x76')](_0x2c975a[_0xd6ee('0x3a')][_0x1df2f0])[_0xd6ee('0x78')];_0x13806b['where'](_0xd6ee('0x79'),_0x34463e,_0x33de89);}else{if(_0x2c975a[_0xd6ee('0x3a')][_0x1df2f0]==='null'){_0x13806b[_0xd6ee('0x73')]('i.'+_0x1df2f0+_0xd6ee('0x7a'));}else{_0x13806b[_0xd6ee('0x73')]('i.'+_0x1df2f0+_0xd6ee('0x7b'),_0x2c975a[_0xd6ee('0x3a')][_0x1df2f0]);}}});}if(_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x7c')]){if(_0x2c975a[_0xd6ee('0x3a')]['read']==0x1){_0x13806b[_0xd6ee('0x61')](_0xd6ee('0x7d'));}else{_0x13806b[_0xd6ee('0x61')](_0xd6ee('0x7e'));}}if(_0x2c975a['query']['tag']){_0x438d8c=_[_0xd6ee('0x7f')](_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x80')])?_0x2c975a[_0xd6ee('0x3a')]['tag']:new Array(_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x80')]);_0x438d8c[_0xd6ee('0x23')](function(_0xd5f026){_0x9b7ad4['or'](_0xd6ee('0x6d'),'%,'+_0xd5f026+',%');});}if(_0x2c975a['query'][_0xd6ee('0x81')]){var _0x3b9dd3=_0x2c975a[_0xd6ee('0x3a')][_0xd6ee('0x81')][_0xd6ee('0x82')]('\x5c','\x5c\x5c')[_0xd6ee('0x82')](/'/g,'\x27\x27');if(qs[_0xd6ee('0x83')](_0x3b9dd3)){_0x4f23e8['or'](_0xd6ee('0x84'),_0x3b9dd3+'%');}else if(qs[_0xd6ee('0x85')](_0x3b9dd3)){_0x4f23e8['or'](_0xd6ee('0x86'),_0x3b9dd3+'%');}else{_0x4f23e8['or'](_0xd6ee('0x87'),qs[_0xd6ee('0x66')](_0x3b9dd3))['or'](_0xd6ee('0x88'),qs[_0xd6ee('0x66')](_0x3b9dd3));}}}_0x13806b[_0xd6ee('0x73')](_0x4f23e8);_0x13806b['group']('i.id');var _0x55584c={'type':db[_0xd6ee('0x89')][_0xd6ee('0x8a')][_0xd6ee('0x8b')],'raw':!![]};var _0x1be904=_0x13806b[_0xd6ee('0x8c')]();_0x1be904[_0xd6ee('0x46')](_0xd6ee('0x8d'));_0x1be904['field'](_0xd6ee('0x8e'),_0xd6ee('0x5f'));if(_0x158d31[_0xd6ee('0x42')]){_0x158d31[_0xd6ee('0x42')][_0xd6ee('0x23')](function(_0x28c957){var _0x455234=_0x28c957[0x0]===_0xd6ee('0x8f')?_0x28c957[0x0]:'i.'+_0x28c957[0x0];_0x13806b[_0xd6ee('0x42')](_0x455234,_0x28c957[0x1]===_0xd6ee('0x90')?![]:!![]);});}if(!_[_0xd6ee('0x91')](_0x438d8c)){_0x13806b[_0xd6ee('0x61')](_0x9b7ad4);_0x1be904[_0xd6ee('0x73')]('t.id\x20IN\x20?',_0x438d8c);}BPromise[_0xd6ee('0x92')]()[_0xd6ee('0x1b')](function(){if(!_0x54f93d){if(_0x2c975a['query'][_0xd6ee('0x93')])return;_0x1be904[_0xd6ee('0x73')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x13806b[_0xd6ee('0x73')](_0xd6ee('0x94'));return;}if(_0x2c975a['user'][_0xd6ee('0x95')]!==_0xd6ee('0x96'))return;return _0x2c975a['user'][_0xd6ee('0x97')]({'attributes':['id'],'raw':!![]})[_0xd6ee('0x1b')](function(_0x4bb9bb){if(_[_0xd6ee('0x91')](_0x4bb9bb)){_0x1be904[_0xd6ee('0x73')](_0xd6ee('0x98'));_0x13806b['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x1be904['where'](_0xd6ee('0x74'),_[_0xd6ee('0x1f')](_0x4bb9bb,'id'));_0x13806b[_0xd6ee('0x73')]('i.MailAccountId\x20IN\x20?',_['map'](_0x4bb9bb,'id'));}});})[_0xd6ee('0x1b')](function(){if(_0x2c975a[_0xd6ee('0x99')][_0xd6ee('0x95')]===_0xd6ee('0x96')&&!_0x54f93d&&!_0x2c975a['query'][_0xd6ee('0x93')])return[];return db[_0xd6ee('0x9a')][_0xd6ee('0x3a')](_0x1be904[_0xd6ee('0x9b')](),_0x55584c);})[_0xd6ee('0x1b')](function(_0x3678df){_0x48fb7b[_0xd6ee('0x18')]=_0x3678df[_0xd6ee('0x40')];if(_0x48fb7b[_0xd6ee('0x18')]===0x0)return[];return db[_0xd6ee('0x9a')]['query'](_0x177b09[_0xd6ee('0x9b')](),_0x55584c)[_0xd6ee('0x1b')](function(_0x31b1d0){_0x4c04c3=_[_0xd6ee('0x9c')](_0x31b1d0,'id');_0x55584c=_['merge'](_0x55584c,{'model':db[_0xd6ee('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c975a[_0xd6ee('0x3a')]['fields']){_0x158d31[_0xd6ee('0x3f')][_0xd6ee('0x23')](function(_0x149f3a){_0x13806b['field']('i.'+_0x149f3a);});}else{_0x13806b[_0xd6ee('0x46')](_0xd6ee('0x8e'),'unreadMessages');_0x13806b['field']('a.key','Account.key');_0x13806b[_0xd6ee('0x46')](_0xd6ee('0x9d'),_0xd6ee('0x9e'));_0x13806b[_0xd6ee('0x46')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xd6ee('0x8f'));_0x13806b[_0xd6ee('0x46')]('i.id');_0x13806b['field'](_0xd6ee('0x9f'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa0'));_0x13806b[_0xd6ee('0x46')]('i.closed');_0x13806b['field'](_0xd6ee('0xa1'));_0x13806b['field'](_0xd6ee('0xa2'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa3'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa4'));_0x13806b['field'](_0xd6ee('0xa5'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa6'));_0x13806b['field'](_0xd6ee('0xa7'));_0x13806b['field']('i.thirdDisposition');_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa8'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xa9'));_0x13806b[_0xd6ee('0x46')]('i.ContactId');_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xaa'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xab'));_0x13806b[_0xd6ee('0x46')]('c.firstName',_0xd6ee('0xac'));_0x13806b['field'](_0xd6ee('0xad'),'Contact.lastName');_0x13806b[_0xd6ee('0x46')]('c.email',_0xd6ee('0xae'));_0x13806b[_0xd6ee('0x46')]('c.phone','Contact.phone');_0x13806b[_0xd6ee('0x46')]('c.mobile',_0xd6ee('0xaf'));_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xb0'),'Contact.fax');_0x13806b[_0xd6ee('0x46')](_0xd6ee('0xb1'),_0xd6ee('0xb2'));_0x13806b['field']('o.internal',_0xd6ee('0xb3'));_0x13806b['field'](_0xd6ee('0xb4'),_0xd6ee('0x20'));}if(_0x158d31[_0xd6ee('0x17')])_0x13806b[_0xd6ee('0x17')](_0x158d31[_0xd6ee('0x17')]);if(_0x158d31[_0xd6ee('0x15')])_0x13806b[_0xd6ee('0x15')](_0x158d31['offset']);return db[_0xd6ee('0x9a')][_0xd6ee('0x3a')](_0x13806b[_0xd6ee('0x9b')](),_0x55584c);})[_0xd6ee('0x1b')](function(_0x437917){if(_0x437917[_0xd6ee('0x40')]>0x0)_0x17a036[_0xd6ee('0x73')]('ui.MailInteractionId\x20IN\x20?',_[_0xd6ee('0x1f')](_0x437917,'id'));return db[_0xd6ee('0x9a')][_0xd6ee('0x3a')](_0x17a036['toString'](),_0x55584c)[_0xd6ee('0x1b')](function(_0x6132a4){var _0x51da21=_[_0xd6ee('0xb5')](_0x6132a4,_0xd6ee('0xb6'));var _0x4a6f8c=[];return db[_0xd6ee('0xb7')][_0xd6ee('0x26')]({'attributes':[_0xd6ee('0xb8')],'raw':!![]})['then'](function(_0x3ebc5a){var _0x1f67e6=_0x3ebc5a[_0xd6ee('0xb8')];_0x437917[_0xd6ee('0x23')](function(_0x46e274){_0x4a6f8c[_0xd6ee('0x24')](updateMailInteraction(_0x46e274,_0x4c04c3,_0x51da21,_0x1f67e6));});return BPromise[_0xd6ee('0xb9')](_0x4a6f8c);});});});})[_0xd6ee('0x1b')](function(_0x5c3af5){_0x48fb7b[_0xd6ee('0xba')]=_0x5c3af5;return _0x48fb7b;})[_0xd6ee('0x1b')](respondWithFilteredResult(_0x5a8305,_0x158d31))['catch'](handleError(_0x5a8305,null));};exports['show']=function(_0x3f02e0,_0x57230f){var _0x34abdd={'raw':![],'where':{'id':_0x3f02e0['params']['id']}},_0x5bb273={};_0x5bb273[_0xd6ee('0x3d')]=_[_0xd6ee('0x39')](db[_0xd6ee('0x35')][_0xd6ee('0x36')]);_0x5bb273[_0xd6ee('0x3a')]=_[_0xd6ee('0x39')](_0x3f02e0[_0xd6ee('0x3a')]);_0x5bb273[_0xd6ee('0x3b')]=_[_0xd6ee('0x3c')](_0x5bb273['model'],_0x5bb273[_0xd6ee('0x3a')]);_0x34abdd['attributes']=_['intersection'](_0x5bb273[_0xd6ee('0x3d')],qs[_0xd6ee('0x3e')](_0x3f02e0['query'][_0xd6ee('0x3e')]));_0x34abdd[_0xd6ee('0x3f')]=_0x34abdd[_0xd6ee('0x3f')]['length']?_0x34abdd[_0xd6ee('0x3f')]:_0x5bb273[_0xd6ee('0x3d')];if(_0x3f02e0['query'][_0xd6ee('0xbb')]){_0x34abdd[_0xd6ee('0xbc')]=[{'all':!![]}];}_0x34abdd=_['merge']({},_0x34abdd,_0x3f02e0[_0xd6ee('0xbd')]);return db['MailInteraction'][_0xd6ee('0x5e')](_0x34abdd)[_0xd6ee('0x1b')](handleEntityNotFound(_0x57230f,null))[_0xd6ee('0x1b')](respondWithResult(_0x57230f,null))[_0xd6ee('0x2c')](handleError(_0x57230f,null));};exports[_0xd6ee('0xbe')]=function(_0x273914,_0x1f5600){return db['MailInteraction'][_0xd6ee('0xbe')](_0x273914[_0xd6ee('0xbf')],{})[_0xd6ee('0x1b')](respondWithResult(_0x1f5600,0xc9))[_0xd6ee('0x2c')](handleError(_0x1f5600,null));};exports[_0xd6ee('0x1a')]=function(_0x4a332c,_0x1976ca){if(_0x4a332c[_0xd6ee('0xbf')]['id']){delete _0x4a332c[_0xd6ee('0xbf')]['id'];}return db[_0xd6ee('0x35')]['find']({'where':{'id':_0x4a332c[_0xd6ee('0xc0')]['id']}})['then'](handleEntityNotFound(_0x1976ca,null))[_0xd6ee('0x1b')](saveUpdates(_0x4a332c['body'],null))['then'](respondWithResult(_0x1976ca,null))[_0xd6ee('0x2c')](handleError(_0x1976ca,null));};exports[_0xd6ee('0xc1')]=function(_0x43e689,_0x273afa){return db['MailInteraction'][_0xd6ee('0x5e')]({'where':{'id':_0x43e689[_0xd6ee('0xc0')]['id']}})[_0xd6ee('0x1b')](handleEntityNotFound(_0x273afa,null))[_0xd6ee('0x1b')](removeEntity(_0x273afa,null))[_0xd6ee('0x2c')](handleError(_0x273afa,null));};exports['describe']=function(_0x373240,_0x2a7dda){return db[_0xd6ee('0x35')][_0xd6ee('0xc2')]()[_0xd6ee('0x1b')](respondWithResult(_0x2a7dda,null))[_0xd6ee('0x2c')](handleError(_0x2a7dda,null));};exports[_0xd6ee('0xc3')]=function(_0x49e41f,_0x3cb154){return db['MailMessage'][_0xd6ee('0x5e')]({'where':{'id':_0x49e41f[_0xd6ee('0xc0')]['id']}})[_0xd6ee('0x1b')](handleEntityNotFound(_0x3cb154,null))[_0xd6ee('0x1b')](function(_0x238967){if(_0x238967){return _0x238967['addMessage'](_0x49e41f[_0xd6ee('0xbf')]['ids'],_[_0xd6ee('0xc4')](_0x49e41f[_0xd6ee('0xbf')],[_0xd6ee('0xc5'),'id'])||{});}})[_0xd6ee('0x1b')](respondWithResult(_0x3cb154,null))['catch'](handleError(_0x3cb154,null));};exports[_0xd6ee('0xc6')]=function(_0x41d663,_0x19a5e0){var _0x3f1642={'raw':![],'where':{}};var _0x5a6dc0={};var _0x397657={'count':0x0,'rows':[]};return db[_0xd6ee('0x35')]['findOne']({'where':{'id':_0x41d663[_0xd6ee('0xc0')]['id']}})[_0xd6ee('0x1b')](handleEntityNotFound(_0x19a5e0,null))[_0xd6ee('0x1b')](function(_0x3f6d94){if(_0x3f6d94){_0x5a6dc0[_0xd6ee('0x3d')]=_[_0xd6ee('0x39')](db[_0xd6ee('0x25')]['rawAttributes']);_0x5a6dc0['query']=_[_0xd6ee('0x39')](_0x41d663[_0xd6ee('0x3a')]);_0x5a6dc0[_0xd6ee('0x3b')]=_[_0xd6ee('0x3c')](_0x5a6dc0[_0xd6ee('0x3d')],_0x5a6dc0[_0xd6ee('0x3a')]);_0x3f1642[_0xd6ee('0x3f')]=_[_0xd6ee('0x3c')](_0x5a6dc0['model'],qs[_0xd6ee('0x3e')](_0x41d663[_0xd6ee('0x3a')]['fields']));_0x3f1642['attributes']=_0x3f1642[_0xd6ee('0x3f')]['length']?_0x3f1642[_0xd6ee('0x3f')]:_0x5a6dc0['model'];if(!_0x41d663[_0xd6ee('0x3a')][_0xd6ee('0xc7')](_0xd6ee('0x41'))){_0x3f1642[_0xd6ee('0x17')]=qs['limit'](_0x41d663['query']['limit']);_0x3f1642['offset']=qs[_0xd6ee('0x15')](_0x41d663[_0xd6ee('0x3a')]['offset']);}_0x3f1642[_0xd6ee('0x42')]=qs[_0xd6ee('0x43')](_0x41d663['query'][_0xd6ee('0x43')]);_0x3f1642[_0xd6ee('0x73')]=qs[_0xd6ee('0x3b')](_[_0xd6ee('0x44')](_0x41d663[_0xd6ee('0x3a')],_0x5a6dc0[_0xd6ee('0x3b')]));_0x3f1642[_0xd6ee('0x73')]['MailInteractionId']=_0x3f6d94['id'];if(_0x41d663[_0xd6ee('0x3a')]['filter']){_0x3f1642[_0xd6ee('0x73')]=_[_0xd6ee('0xc8')](_0x3f1642['where'],{'$or':_[_0xd6ee('0x1f')](_0x3f1642[_0xd6ee('0x3f')],function(_0x4beec1){var _0xcb946={};_0xcb946[_0x4beec1]={'$like':'%'+_0x41d663['query'][_0xd6ee('0x81')]+'%'};return _0xcb946;})});}if(_0x41d663[_0xd6ee('0x3a')][_0xd6ee('0x77')]){var _0x359c00=_0x41d663[_0xd6ee('0x3a')][_0xd6ee('0x77')][_0xd6ee('0x22')](',');var _0x4d8659={};_0x4d8659[_0x359c00[0x0]]={'$gte':moment(_0x359c00[0x1])['format'](_0xd6ee('0xc9'))};_0x3f1642[_0xd6ee('0x73')]=_[_0xd6ee('0xc8')](_0x3f1642[_0xd6ee('0x73')],_0x4d8659);}_0x3f1642=_[_0xd6ee('0xc8')]({},_0x3f1642,_0x41d663[_0xd6ee('0xbd')]);return db[_0xd6ee('0x25')][_0xd6ee('0x18')]({'where':_0x3f1642[_0xd6ee('0x73')]})[_0xd6ee('0x1b')](function(_0x2a2f5e){_0x397657['count']=_0x2a2f5e;if(_0x41d663[_0xd6ee('0x3a')][_0xd6ee('0xbb')]){_0x3f1642[_0xd6ee('0xbc')]=[{'all':!![]}];}return db['MailMessage'][_0xd6ee('0xca')](_0x3f1642);})['then'](function(_0x5482a6){if(_0x41d663[_0xd6ee('0x3a')][_0xd6ee('0xcb')]===_0xd6ee('0xcc')){for(var _0x1f0483=0x0;_0x1f0483<_0x5482a6[_0xd6ee('0x40')];_0x1f0483++){_0x5482a6[_0x1f0483][_0xd6ee('0xbf')]=juice(_0x5482a6[_0x1f0483][_0xd6ee('0xbf')]);}}_0x397657[_0xd6ee('0xba')]=_0x5482a6;return _0x397657;});}})[_0xd6ee('0x1b')](respondWithFilteredResult(_0x19a5e0,_0x3f1642))['catch'](handleError(_0x19a5e0,null));};exports[_0xd6ee('0xcd')]=function(_0x7dc5a5,_0x276bb9){return db[_0xd6ee('0x35')][_0xd6ee('0x5e')]({'where':{'id':_0x7dc5a5['params']['id']}})['then'](handleEntityNotFound(_0x276bb9,null))[_0xd6ee('0x1b')](function(_0xfd00e8){if(_0xfd00e8){return _0xfd00e8[_0xd6ee('0xce')](_0x7dc5a5['body'][_0xd6ee('0xc5')],_[_0xd6ee('0xc4')](_0x7dc5a5['body'],[_0xd6ee('0xc5'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xd6ee('0x1d'),_0xd6ee('0x47')],'where':{'id':_0x7dc5a5[_0xd6ee('0xbf')][_0xd6ee('0xc5')]}});})[_0xd6ee('0x1b')](function(_0x500005){socket[_0xd6ee('0xcf')](_0xd6ee('0xd0'),{'id':Number(_0x7dc5a5[_0xd6ee('0xc0')]['id']),'tags':_0x500005||[]});return{'id':Number(_0x7dc5a5[_0xd6ee('0xc0')]['id']),'tags':_0x500005||[]};});}})['then'](respondWithResult(_0x276bb9,null))['catch'](handleError(_0x276bb9,null));};exports[_0xd6ee('0xd1')]=function(_0x121fc9,_0xc165f9){return db[_0xd6ee('0x35')][_0xd6ee('0x5e')]({'where':{'id':_0x121fc9[_0xd6ee('0xc0')]['id']}})[_0xd6ee('0x1b')](handleEntityNotFound(_0xc165f9,null))[_0xd6ee('0x1b')](function(_0x3c479c){if(_0x3c479c){return _0x3c479c['removeTags'](_0x121fc9[_0xd6ee('0x3a')][_0xd6ee('0xc5')]);}})[_0xd6ee('0x1b')](respondWithStatusCode(_0xc165f9,null))[_0xd6ee('0x2c')](handleError(_0xc165f9,null));};exports[_0xd6ee('0xd2')]=function(_0x2eaf42,_0x1de4fc){var _0x56fabd=moment()[_0xd6ee('0xd3')]()[_0xd6ee('0x9b')]();var _0x5c516f=path[_0xd6ee('0xd4')](config[_0xd6ee('0xd5')],_0xd6ee('0xd6'),_0xd6ee('0xd7'),_0xd6ee('0xd8'));var _0x5dcc55=path[_0xd6ee('0xd4')](config[_0xd6ee('0xd5')],_0xd6ee('0xd6'),_0xd6ee('0xd7'),_0xd6ee('0xd9'));var _0x1bea5c=path['join'](_0x5c516f,_0x56fabd);var _0x4cb0d1=util[_0xd6ee('0xda')]('transcript-%d-%s.zip',_0x2eaf42['params']['id'],_0x56fabd);var _0x4f1741=path['join'](_0x5c516f,_0x4cb0d1);var _0x40b161=[];if(_0x2eaf42['query'][_0xd6ee('0xd9')]){_0x40b161['push']({'model':db[_0xd6ee('0xdb')],'as':_0xd6ee('0xdc'),'raw':!![]});}var _0x3237e2=[{'model':db[_0xd6ee('0x25')],'as':_0xd6ee('0xdd'),'attributes':['id',_0xd6ee('0xbf'),_0xd6ee('0x48'),'to','cc',_0xd6ee('0xde'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0xd6ee('0x43')]('id'),'include':_0x40b161}];return db[_0xd6ee('0x35')]['find']({'where':{'id':_0x2eaf42[_0xd6ee('0xc0')]['id']},'include':_0x3237e2})[_0xd6ee('0x1b')](handleEntityNotFound(_0x1de4fc,null))['then'](function(_0x17f84d){if(_0x17f84d&&_0x17f84d['Messages']){var _0x2c152d=_0x17f84d['get']({'plain':!![]});fs[_0xd6ee('0xdf')](_0x1bea5c);return BPromise['each'](_0x2c152d[_0xd6ee('0xdd')],function(_0x539467,_0xc8e1e2){var _0x39db13={'from':_0x539467['from'],'to':_0x539467['to'],'subject':_0x539467[_0xd6ee('0xe0')],'html':htmlEntities[_0xd6ee('0xe1')](_0x539467[_0xd6ee('0xbf')]),'headers':{'Date':moment(_0x539467[_0xd6ee('0xe2')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x539467['cc']){_0x39db13['headers']['Cc']=_0x539467['cc'];}if(_0x539467['bcc']){_0x39db13['headers'][_0xd6ee('0xe3')]=_0x539467[_0xd6ee('0xde')];}return new BPromise(function(_0x485cd1,_0x2d923c){if(_0x539467[_0xd6ee('0xdc')]){for(var _0x3e1f50=0x0;_0x3e1f50<_0x539467['Attachments'][_0xd6ee('0x40')];_0x3e1f50++){var _0x387eab=_0x539467[_0xd6ee('0xdc')][_0x3e1f50];var _0x3fe185=path['join'](_0x5dcc55,_0x387eab['basename']);if(fs[_0xd6ee('0xe4')](_0x3fe185)){_0x39db13['attachments'][_0xd6ee('0x24')]({'name':_0x387eab[_0xd6ee('0x1d')],'contentType':_0x387eab[_0xd6ee('0x38')],'data':fs[_0xd6ee('0xe5')](_0x3fe185)});}}}emlformat['build'](_0x39db13,function(_0x458835,_0x259f84){if(_0x458835)return _0x2d923c(_0x458835);fs['writeFileSync'](path[_0xd6ee('0xd4')](_0x1bea5c,util[_0xd6ee('0xda')](_0xd6ee('0xe6'),_0xc8e1e2)),_0x259f84);return _0x485cd1(_0x259f84);});});})['then'](function(){return new BPromise(function(_0x272b87,_0x250438){zipdir(_0x1bea5c,{'saveTo':_0x4f1741},function(_0x51a522,_0x451efb){if(_0x51a522)return _0x250438(_0x51a522);return _0x272b87(_0x451efb);});})[_0xd6ee('0x1b')](function(){return new BPromise(function(_0x693e7d,_0x50ea61){rimraf(_0x1bea5c,function(_0x2d42b7){if(_0x2d42b7)_0x50ea61(_0x2d42b7);return _0x693e7d();});});})[_0xd6ee('0x1b')](function(){return _0x1de4fc['download'](_0x4f1741,_0x4cb0d1,function(_0x480943){if(!_0x480943)fs['unlinkSync'](_0x4f1741);});});});}else{return _0x1de4fc[_0xd6ee('0x11')](0xc8);}})[_0xd6ee('0x2c')](handleError(_0x1de4fc,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4c9c969..5b6e597 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 _0xf3c9=['map','findAll','setDataValue','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xf3c9,0xa1));var _0x9f3c=function(_0x39ba53,_0x46828f){_0x39ba53=_0x39ba53-0x0;var _0xc049b0=_0xf3c9[_0x39ba53];return _0xc049b0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x9f3c('0x0'))['db'][_0x9f3c('0x1')];var MailMessage=require(_0x9f3c('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9f3c('0x2')](0x0);var events={'afterCreate':_0x9f3c('0x3'),'afterUpdate':_0x9f3c('0x4'),'afterDestroy':_0x9f3c('0x5')};function emitEvent(_0x528060){return function(_0x33182f,_0x433b14,_0x55be79){_0x33182f[_0x9f3c('0x6')]({'attributes':['id'],'raw':!![]})[_0x9f3c('0x7')](function(_0x717658){_0x33182f['setDataValue'](_0x9f3c('0x8'),_0x717658[_0x9f3c('0x9')](function(_0x4963e2){return{'id':_0x4963e2['id']};}));return MailMessage[_0x9f3c('0xa')]({'where':{'MailInteractionId':_0x33182f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9f3c('0x7')](function(_0x52f60c){_0x33182f[_0x9f3c('0xb')]('unreadMessages',_0x52f60c[_0x9f3c('0xc')]);MailInteractionEvents[_0x9f3c('0xd')](_0x528060+':'+_0x33182f['id'],_0x33182f);MailInteractionEvents[_0x9f3c('0xd')](_0x528060,_0x33182f);_0x55be79(null);})[_0x9f3c('0xe')](_0x55be79(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x9f3c('0xf')](e,emitEvent(event));}}module[_0x9f3c('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xb0c3=['hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb0c3,0x12e));var _0x3b0c=function(_0x1dbb03,_0x5dddc1){_0x1dbb03=_0x1dbb03-0x0;var _0x593277=_0xb0c3[_0x1dbb03];return _0x593277;};'use strict';var EventEmitter=require(_0x3b0c('0x0'));var MailInteraction=require(_0x3b0c('0x1'))['db'][_0x3b0c('0x2')];var MailMessage=require(_0x3b0c('0x1'))['db'][_0x3b0c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3b0c('0x4')](0x0);var events={'afterCreate':_0x3b0c('0x5'),'afterUpdate':'update','afterDestroy':_0x3b0c('0x6')};function emitEvent(_0x4d1866){return function(_0x212503,_0x2046d5,_0x2eb1a7){_0x212503[_0x3b0c('0x7')]({'attributes':['id'],'raw':!![]})[_0x3b0c('0x8')](function(_0x1c6b54){_0x212503['setDataValue'](_0x3b0c('0x9'),_0x1c6b54[_0x3b0c('0xa')](function(_0x5ac118){return{'id':_0x5ac118['id']};}));return MailMessage[_0x3b0c('0xb')]({'where':{'MailInteractionId':_0x212503['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3b0c('0x8')](function(_0x1335a9){_0x212503[_0x3b0c('0xc')](_0x3b0c('0xd'),_0x1335a9[_0x3b0c('0xe')]);MailInteractionEvents[_0x3b0c('0xf')](_0x4d1866+':'+_0x212503['id'],_0x212503);MailInteractionEvents[_0x3b0c('0xf')](_0x4d1866,_0x212503);_0x2eb1a7(null);})[_0x3b0c('0x10')](_0x2eb1a7(null));};}for(var e in events){if(events[_0x3b0c('0x11')](e)){var event=events[e];MailInteraction[_0x3b0c('0x12')](e,emitEvent(event));}}module[_0x3b0c('0x13')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index a7cd538..b981d0f 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 _0x0391=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT'];(function(_0x238ced,_0x59871e){var _0x89e6e9=function(_0x4aeb07){while(--_0x4aeb07){_0x238ced['push'](_0x238ced['shift']());}};_0x89e6e9(++_0x59871e);}(_0x0391,0x1d8));var _0x1039=function(_0x28cdc0,_0x5c8e75){_0x28cdc0=_0x28cdc0-0x0;var _0x2feec1=_0x0391[_0x28cdc0];return _0x2feec1;};'use strict';var _=require(_0x1039('0x0'));var util=require('util');var logger=require(_0x1039('0x1'))('api');var moment=require(_0x1039('0x2'));var BPromise=require(_0x1039('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1039('0x4'));var rimraf=require(_0x1039('0x5'));var config=require(_0x1039('0x6'));var attributes=require(_0x1039('0x7'));module[_0x1039('0x8')]=function(_0x488a7b,_0x2e393a){return _0x488a7b[_0x1039('0x9')](_0x1039('0xa'),attributes,{'tableName':_0x1039('0xb'),'paranoid':![],'indexes':[{'name':_0x1039('0xc'),'fields':['subject','to'],'type':_0x1039('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xfb94aa,_0x311494,_0x46a563){if(_0xfb94aa['substatus']){_0xfb94aa[_0x1039('0xe')]=moment()[_0x1039('0xf')](_0x1039('0x10'));}if(_0xfb94aa[_0x1039('0x11')]){_0xfb94aa[_0x1039('0x12')]=moment()[_0x1039('0xf')](_0x1039('0x10'));}_0x46a563(null,_0x311494);},'beforeUpdate':function(_0x4308ec,_0x7f7b1,_0x56fdd5){if(_0x4308ec['changed'](_0x1039('0x13'))){_0x4308ec['substatusAt']=_0x4308ec['substatus']?moment()['format'](_0x1039('0x10')):null;}if(_0x4308ec['changed'](_0x1039('0x11'))){_0x4308ec[_0x1039('0x12')]=moment()['format'](_0x1039('0x10'));_0x4308ec[_0x1039('0x13')]=null;_0x4308ec[_0x1039('0xe')]=null;}_0x56fdd5(null,_0x4308ec);},'afterUpdate':function(_0x366cfe,_0x1dceff,_0x250226){var _0x17219c=_0x488a7b[_0x1039('0x14')];var _0x4188d9=_0x366cfe[_0x1039('0x15')]({'plain':!![]});if(_0x4188d9[_0x1039('0x11')]){return _0x17219c[_0x1039('0x16')][_0x1039('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4188d9['id']}})[_0x1039('0x18')](function(){_0x250226();})['catch'](function(_0xc6ca2b){_0x250226(_0xc6ca2b);});}else{_0x250226();}}},'charset':_0x1039('0x19'),'collate':_0x1039('0x1a')});}; \ No newline at end of file +var _0x4619=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','mail_interactions','fti_mail_interactions','substatusAt','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','get','update','then','catch'];(function(_0x3f3e97,_0x2a03bc){var _0xcbbec=function(_0x3291c9){while(--_0x3291c9){_0x3f3e97['push'](_0x3f3e97['shift']());}};_0xcbbec(++_0x2a03bc);}(_0x4619,0xc2));var _0x9461=function(_0x3b0428,_0x2c22bd){_0x3b0428=_0x3b0428-0x0;var _0x5a0f51=_0x4619[_0x3b0428];return _0x5a0f51;};'use strict';var _=require(_0x9461('0x0'));var util=require(_0x9461('0x1'));var logger=require(_0x9461('0x2'))(_0x9461('0x3'));var moment=require(_0x9461('0x4'));var BPromise=require(_0x9461('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9461('0x6'));var rimraf=require(_0x9461('0x7'));var config=require(_0x9461('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x4af874,_0x4fb932){return _0x4af874[_0x9461('0x9')]('MailInteraction',attributes,{'tableName':_0x9461('0xa'),'paranoid':![],'indexes':[{'name':_0x9461('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x316ce0,_0x5b9b58,_0x6434e1){if(_0x316ce0['substatus']){_0x316ce0[_0x9461('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x316ce0['closed']){_0x316ce0[_0x9461('0xd')]=moment()[_0x9461('0xe')](_0x9461('0xf'));}_0x6434e1(null,_0x5b9b58);},'beforeUpdate':function(_0x447324,_0x19ac7,_0x574b4b){if(_0x447324[_0x9461('0x10')](_0x9461('0x11'))){_0x447324['substatusAt']=_0x447324[_0x9461('0x11')]?moment()[_0x9461('0xe')](_0x9461('0xf')):null;}if(_0x447324[_0x9461('0x10')]('closed')){_0x447324[_0x9461('0xd')]=moment()[_0x9461('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x447324['substatus']=null;_0x447324[_0x9461('0xc')]=null;}_0x574b4b(null,_0x447324);},'afterUpdate':function(_0x38c574,_0x50903b,_0x3f3389){var _0xec43ac=_0x4af874['models'];var _0x2669a3=_0x38c574[_0x9461('0x12')]({'plain':!![]});if(_0x2669a3['closed']){return _0xec43ac['MailMessage'][_0x9461('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x2669a3['id']}})[_0x9461('0x14')](function(){_0x3f3389();})[_0x9461('0x15')](function(_0x2b6a50){_0x3f3389(_0x2b6a50);});}else{_0x3f3389();}}},'charset':_0x9461('0x16'),'collate':_0x9461('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b964225..78413b4 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 _0x069e=['body','ids','omit','spread','AddTags','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','catch','AddTagsToMailInteraction','find'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x069e,0x108));var _0xe069=function(_0x5d2699,_0xbb63f2){_0x5d2699=_0x5d2699-0x0;var _0x2a2ee6=_0x069e[_0x5d2699];return _0x2a2ee6;};'use strict';var _=require('lodash');var util=require(_0xe069('0x0'));var moment=require('moment');var BPromise=require(_0xe069('0x1'));var rs=require(_0xe069('0x2'));var fs=require('fs');var Redis=require(_0xe069('0x3'));var db=require(_0xe069('0x4'))['db'];var utils=require(_0xe069('0x5'));var logger=require(_0xe069('0x6'))(_0xe069('0x7'));var config=require(_0xe069('0x8'));var jayson=require(_0xe069('0x9'));var client=jayson[_0xe069('0xa')]['http']({'port':0x232a});config[_0xe069('0xb')]=_[_0xe069('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe069('0xd'))(new Redis(config['redis']));require(_0xe069('0xe'))[_0xe069('0xf')](socket);function respondWithRpcPromise(_0x1651e5,_0x229519,_0x20dcfc){return new BPromise(function(_0x20c3da,_0x3b2ccc){return client[_0xe069('0x10')](_0x1651e5,_0x20dcfc)[_0xe069('0x11')](function(_0x912865){logger[_0xe069('0x12')](_0xe069('0x13'),_0x229519,_0xe069('0x14'));logger['debug'](_0xe069('0x15'),_0x229519,_0xe069('0x14'),JSON[_0xe069('0x16')](_0x912865));if(_0x912865[_0xe069('0x17')]){if(_0x912865[_0xe069('0x17')][_0xe069('0x18')]===0x1f4){logger[_0xe069('0x17')](_0xe069('0x13'),_0x229519,_0x912865[_0xe069('0x17')][_0xe069('0x19')]);return _0x3b2ccc(_0x912865[_0xe069('0x17')]['message']);}logger[_0xe069('0x17')](_0xe069('0x13'),_0x229519,_0x912865['error']['message']);return _0x20c3da(_0x912865[_0xe069('0x17')][_0xe069('0x19')]);}else{logger[_0xe069('0x12')](_0xe069('0x13'),_0x229519,_0xe069('0x14'));_0x20c3da(_0x912865[_0xe069('0x1a')][_0xe069('0x19')]);}})['catch'](function(_0x47436e){logger[_0xe069('0x17')](_0xe069('0x13'),_0x229519,_0x47436e);_0x3b2ccc(_0x47436e);});});}exports[_0xe069('0x1b')]=function(_0xb564d){var _0x4c9256=this;return new Promise(function(_0x3af398,_0x346194){return db[_0xe069('0x1c')][_0xe069('0x1d')](_0xb564d['body'],{'raw':_0xb564d[_0xe069('0x1e')]?_0xb564d[_0xe069('0x1e')][_0xe069('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb564d[_0xe069('0x1e')]?_0xb564d[_0xe069('0x1e')][_0xe069('0x20')]||null:null,'attributes':_0xb564d[_0xe069('0x1e')]?_0xb564d[_0xe069('0x1e')]['attributes']||null:null,'limit':_0xb564d['options']?_0xb564d[_0xe069('0x1e')][_0xe069('0x21')]||null:null})['then'](function(_0x2f52cd){logger[_0xe069('0x12')](_0xe069('0x1b'),_0xb564d);logger['debug'](_0xe069('0x1b'),_0xb564d,JSON['stringify'](_0x2f52cd));_0x3af398(_0x2f52cd);})[_0xe069('0x22')](function(_0x332b2d){logger[_0xe069('0x17')]('UpdateMailInteraction',_0x332b2d[_0xe069('0x19')],_0xb564d);_0x346194(_0x4c9256[_0xe069('0x17')](0x1f4,_0x332b2d[_0xe069('0x19')]));});});};exports[_0xe069('0x23')]=function(_0xdac7de){return new Promise(function(_0x159746,_0x222e1a){return db[_0xe069('0x1c')][_0xe069('0x24')]({'where':_0xdac7de[_0xe069('0x1e')]?_0xdac7de[_0xe069('0x1e')]['where']||null:null})[_0xe069('0x11')](function(_0x2be2e2){if(_0x2be2e2){return _0x2be2e2['addTags'](_0xdac7de[_0xe069('0x25')][_0xe069('0x26')],_[_0xe069('0x27')](_0xdac7de[_0xe069('0x25')],[_0xe069('0x26'),'id'])||{});}})[_0xe069('0x28')](function(_0x16ae71){logger[_0xe069('0x12')](_0xe069('0x29'),_0xdac7de);logger[_0xe069('0x2a')](_0xe069('0x29'),_0xdac7de,JSON[_0xe069('0x16')](_0x16ae71));_0x159746(_0x16ae71);})['catch'](function(_0x300e18){logger[_0xe069('0x17')](_0xe069('0x29'),_0x300e18[_0xe069('0x19')],_0xdac7de);_0x222e1a(_this['error'](0x1f4,_0x300e18[_0xe069('0x19')]));});});}; \ No newline at end of file +var _0xbd5b=['attributes','limit','then','debug','stringify','catch','AddTagsToMailInteraction','find','body','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','UpdateMailInteraction','MailInteraction','update','options','where'];(function(_0xc8a598,_0x8ffd7c){var _0x2a6225=function(_0x5f2d46){while(--_0x5f2d46){_0xc8a598['push'](_0xc8a598['shift']());}};_0x2a6225(++_0x8ffd7c);}(_0xbd5b,0x1b8));var _0xbbd5=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xbd5b[_0x13e724];return _0x334a44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbbd5('0x0'));var BPromise=require(_0xbbd5('0x1'));var rs=require(_0xbbd5('0x2'));var fs=require('fs');var Redis=require(_0xbbd5('0x3'));var db=require(_0xbbd5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbd5('0x5'))(_0xbbd5('0x6'));var config=require(_0xbbd5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbbd5('0x8')][_0xbbd5('0x9')]({'port':0x232a});config[_0xbbd5('0xa')]=_[_0xbbd5('0xb')](config['redis'],{'host':_0xbbd5('0xc'),'port':0x18eb});var socket=require(_0xbbd5('0xd'))(new Redis(config[_0xbbd5('0xa')]));require(_0xbbd5('0xe'))['register'](socket);function respondWithRpcPromise(_0x556ca9,_0x4c0f6f,_0x431731){return new BPromise(function(_0x1c620a,_0x5a3ac8){return client[_0xbbd5('0xf')](_0x556ca9,_0x431731)['then'](function(_0x59d30d){logger['info'](_0xbbd5('0x10'),_0x4c0f6f,_0xbbd5('0x11'));logger['debug'](_0xbbd5('0x12'),_0x4c0f6f,'request\x20sent',JSON['stringify'](_0x59d30d));if(_0x59d30d['error']){if(_0x59d30d[_0xbbd5('0x13')]['code']===0x1f4){logger['error'](_0xbbd5('0x10'),_0x4c0f6f,_0x59d30d['error']['message']);return _0x5a3ac8(_0x59d30d[_0xbbd5('0x13')]['message']);}logger[_0xbbd5('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4c0f6f,_0x59d30d['error'][_0xbbd5('0x14')]);return _0x1c620a(_0x59d30d['error']['message']);}else{logger[_0xbbd5('0x15')]('MailInteraction,\x20%s,\x20%s',_0x4c0f6f,_0xbbd5('0x11'));_0x1c620a(_0x59d30d[_0xbbd5('0x16')][_0xbbd5('0x14')]);}})['catch'](function(_0x103829){logger[_0xbbd5('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4c0f6f,_0x103829);_0x5a3ac8(_0x103829);});});}exports[_0xbbd5('0x17')]=function(_0x1b1c3d){var _0x147e13=this;return new Promise(function(_0xf069a2,_0x4ee97c){return db[_0xbbd5('0x18')][_0xbbd5('0x19')](_0x1b1c3d['body'],{'raw':_0x1b1c3d[_0xbbd5('0x1a')]?_0x1b1c3d[_0xbbd5('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b1c3d['options']?_0x1b1c3d[_0xbbd5('0x1a')][_0xbbd5('0x1b')]||null:null,'attributes':_0x1b1c3d[_0xbbd5('0x1a')]?_0x1b1c3d[_0xbbd5('0x1a')][_0xbbd5('0x1c')]||null:null,'limit':_0x1b1c3d[_0xbbd5('0x1a')]?_0x1b1c3d[_0xbbd5('0x1a')][_0xbbd5('0x1d')]||null:null})[_0xbbd5('0x1e')](function(_0x299ed2){logger[_0xbbd5('0x15')](_0xbbd5('0x17'),_0x1b1c3d);logger[_0xbbd5('0x1f')](_0xbbd5('0x17'),_0x1b1c3d,JSON[_0xbbd5('0x20')](_0x299ed2));_0xf069a2(_0x299ed2);})[_0xbbd5('0x21')](function(_0x4ea429){logger[_0xbbd5('0x13')]('UpdateMailInteraction',_0x4ea429['message'],_0x1b1c3d);_0x4ee97c(_0x147e13[_0xbbd5('0x13')](0x1f4,_0x4ea429[_0xbbd5('0x14')]));});});};exports[_0xbbd5('0x22')]=function(_0x26ad9){return new Promise(function(_0x13cfe7,_0x554740){return db[_0xbbd5('0x18')][_0xbbd5('0x23')]({'where':_0x26ad9[_0xbbd5('0x1a')]?_0x26ad9[_0xbbd5('0x1a')][_0xbbd5('0x1b')]||null:null})[_0xbbd5('0x1e')](function(_0xca41d){if(_0xca41d){return _0xca41d['addTags'](_0x26ad9['body']['ids'],_['omit'](_0x26ad9[_0xbbd5('0x24')],['ids','id'])||{});}})[_0xbbd5('0x25')](function(_0x528da1){logger[_0xbbd5('0x15')](_0xbbd5('0x26'),_0x26ad9);logger[_0xbbd5('0x1f')](_0xbbd5('0x26'),_0x26ad9,JSON[_0xbbd5('0x20')](_0x528da1));_0x13cfe7(_0x528da1);})[_0xbbd5('0x21')](function(_0x2c67ca){logger[_0xbbd5('0x13')](_0xbbd5('0x26'),_0x2c67ca['message'],_0x26ad9);_0x554740(_this[_0xbbd5('0x13')](0x1f4,_0x2c67ca[_0xbbd5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 67e9bf9..09d08d6 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 _0x9594=['./mailInteraction.events','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x9594,0x110));var _0x4959=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x9594[_0xa1e3e3];return _0xc980e9;};'use strict';var MailInteractionEvents=require(_0x4959('0x0'));var events=['save',_0x4959('0x1'),_0x4959('0x2')];function createListener(_0x410176,_0x5a9174){return function(_0xbd5149){_0x5a9174[_0x4959('0x3')](_0x410176,_0xbd5149);};}function removeListener(_0x4f2e75,_0x244b8b){return function(){MailInteractionEvents[_0x4959('0x4')](_0x4f2e75,_0x244b8b);};}exports[_0x4959('0x5')]=function(_0x3512c0){for(var _0x55bab4=0x0,_0x416bd2=events[_0x4959('0x6')];_0x55bab4<_0x416bd2;_0x55bab4++){var _0x4e67c1=events[_0x55bab4];var _0x46971c=createListener(_0x4959('0x7')+_0x4e67c1,_0x3512c0);MailInteractionEvents['on'](_0x4e67c1,_0x46971c);}}; \ No newline at end of file +var _0xa238=['mailInteraction:','save','remove','update','removeListener','register','length'];(function(_0x12b93f,_0x599896){var _0x175640=function(_0x4aed5c){while(--_0x4aed5c){_0x12b93f['push'](_0x12b93f['shift']());}};_0x175640(++_0x599896);}(_0xa238,0x1dd));var _0x8a23=function(_0x21ecd5,_0x1e9045){_0x21ecd5=_0x21ecd5-0x0;var _0x2458ea=_0xa238[_0x21ecd5];return _0x2458ea;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x8a23('0x0'),_0x8a23('0x1'),_0x8a23('0x2')];function createListener(_0x106182,_0x5a9a86){return function(_0x458d9a){_0x5a9a86['emit'](_0x106182,_0x458d9a);};}function removeListener(_0x78a939,_0x413d76){return function(){MailInteractionEvents[_0x8a23('0x3')](_0x78a939,_0x413d76);};}exports[_0x8a23('0x4')]=function(_0x48cba2){for(var _0x44d6ac=0x0,_0xe3591=events[_0x8a23('0x5')];_0x44d6ac<_0xe3591;_0x44d6ac++){var _0x4aacff=events[_0x44d6ac];var _0x273cb6=createListener(_0x8a23('0x6')+_0x4aacff,_0x48cba2);MailInteractionEvents['on'](_0x4aacff,_0x273cb6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 42bdc64..d8e8f6f 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 _0xc40b=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','tracked','mail','mailmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f3a3a,_0x5ce2a1){var _0x3b4a60=function(_0x2bc5d4){while(--_0x2bc5d4){_0x4f3a3a['push'](_0x4f3a3a['shift']());}};_0x3b4a60(++_0x5ce2a1);}(_0xc40b,0x95));var _0xbc40=function(_0x27ca78,_0x3b5796){_0x27ca78=_0x27ca78-0x0;var _0x528091=_0xc40b[_0x27ca78];return _0x528091;};'use strict';var multer=require(_0xbc40('0x0'));var util=require('util');var path=require(_0xbc40('0x1'));var timeout=require(_0xbc40('0x2'));var express=require('express');var router=express[_0xbc40('0x3')]();var fs_extra=require(_0xbc40('0x4'));var auth=require(_0xbc40('0x5'));var interaction=require(_0xbc40('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbc40('0x7')]('/',auth[_0xbc40('0x8')](),controller[_0xbc40('0x9')]);router[_0xbc40('0x7')](_0xbc40('0xa'),auth['isAuthenticated'](),controller[_0xbc40('0xb')]);router[_0xbc40('0x7')](_0xbc40('0xc'),auth[_0xbc40('0x8')](),controller[_0xbc40('0xd')]);router[_0xbc40('0x7')](_0xbc40('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xbc40('0x8')](),interaction[_0xbc40('0xf')](_0xbc40('0x10'),_0xbc40('0x11')),controller['create']);router[_0xbc40('0x12')](_0xbc40('0xc'),auth[_0xbc40('0x8')](),controller['update']);router[_0xbc40('0x12')](_0xbc40('0x13'),auth[_0xbc40('0x8')](),controller[_0xbc40('0x14')]);router[_0xbc40('0x12')](_0xbc40('0x15'),auth[_0xbc40('0x8')](),controller[_0xbc40('0x16')]);router[_0xbc40('0x17')](_0xbc40('0xc'),auth[_0xbc40('0x8')](),controller[_0xbc40('0x18')]);module[_0xbc40('0x19')]=router; \ No newline at end of file +var _0x2bb0=['/describe','describe','/:id','show','/:id/download','post','tracked','mailmessage:create','put','/:id/accept','reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index'];(function(_0xea3649,_0x557e6a){var _0x5e7d67=function(_0x18e0fa){while(--_0x18e0fa){_0xea3649['push'](_0xea3649['shift']());}};_0x5e7d67(++_0x557e6a);}(_0x2bb0,0xf3));var _0x02bb=function(_0x258967,_0x50352c){_0x258967=_0x258967-0x0;var _0x599004=_0x2bb0[_0x258967];return _0x599004;};'use strict';var multer=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var path=require(_0x02bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x02bb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x02bb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x02bb('0x5'));var controller=require(_0x02bb('0x6'));router[_0x02bb('0x7')]('/',auth[_0x02bb('0x8')](),controller[_0x02bb('0x9')]);router[_0x02bb('0x7')](_0x02bb('0xa'),auth['isAuthenticated'](),controller[_0x02bb('0xb')]);router[_0x02bb('0x7')](_0x02bb('0xc'),auth['isAuthenticated'](),controller[_0x02bb('0xd')]);router['get'](_0x02bb('0xe'),auth[_0x02bb('0x8')](),controller['download']);router[_0x02bb('0xf')]('/',auth[_0x02bb('0x8')](),interaction[_0x02bb('0x10')]('mail',_0x02bb('0x11')),controller['create']);router[_0x02bb('0x12')](_0x02bb('0xc'),auth[_0x02bb('0x8')](),controller['update']);router[_0x02bb('0x12')](_0x02bb('0x13'),auth[_0x02bb('0x8')](),controller['accept']);router[_0x02bb('0x12')]('/:id/reject',auth[_0x02bb('0x8')](),controller[_0x02bb('0x14')]);router[_0x02bb('0x15')](_0x02bb('0xc'),auth[_0x02bb('0x8')](),controller[_0x02bb('0x16')]);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 f683184..1e6ae4a 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 _0xc99a=['lodash','exports','TEXT','medium','out','STRING','long','DATE','BOOLEAN','ENUM','Email','Chat'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0xc99a,0x1ec));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xac99('0x0'));module[_0xac99('0x1')]={'body':{'type':Sequelize[_0xac99('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xac99('0x2')](_0xac99('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xac99('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xac99('0x5')]},'to':{'type':Sequelize['TEXT'](_0xac99('0x6'))},'cc':{'type':Sequelize[_0xac99('0x2')](_0xac99('0x6'))},'bcc':{'type':Sequelize[_0xac99('0x2')](_0xac99('0x6'))},'subject':{'type':Sequelize[_0xac99('0x2')]},'sentAt':{'type':Sequelize[_0xac99('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xac99('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xac99('0x2')](_0xac99('0x6'))},'originCc':{'type':Sequelize[_0xac99('0x2')](_0xac99('0x6'))},'originChannel':{'type':Sequelize[_0xac99('0x9')](_0xac99('0xa'),_0xac99('0xb')),'defaultValue':_0xac99('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x8fd1=['ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Chat','Email','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fd1,0x182));var _0x18fd=function(_0x3d6db1,_0x4358f8){_0x3d6db1=_0x3d6db1-0x0;var _0x5e1cc3=_0x8fd1[_0x3d6db1];return _0x5e1cc3;};'use strict';var Sequelize=require(_0x18fd('0x0'));var _=require(_0x18fd('0x1'));module[_0x18fd('0x2')]={'body':{'type':Sequelize[_0x18fd('0x3')](_0x18fd('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x18fd('0x3')](_0x18fd('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x18fd('0x6')]('in',_0x18fd('0x7')),'defaultValue':_0x18fd('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x18fd('0x8')](0x1fe)},'from':{'type':Sequelize[_0x18fd('0x8')]},'to':{'type':Sequelize[_0x18fd('0x3')]('long')},'cc':{'type':Sequelize['TEXT'](_0x18fd('0x4'))},'bcc':{'type':Sequelize[_0x18fd('0x3')]('long')},'subject':{'type':Sequelize[_0x18fd('0x3')]},'sentAt':{'type':Sequelize[_0x18fd('0x9')]},'attach':{'type':Sequelize[_0x18fd('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x18fd('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x18fd('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x18fd('0x4'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x18fd('0x6')]('Email',_0x18fd('0xc')),'defaultValue':_0x18fd('0xd'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8dae4b8..eb6b18d 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 _0x08c0=['status','set','Content-Range','json','update','destroy','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','attributes','model','fields','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','length','find','body','describe','create','out','MailAccount','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','read','readAt','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','role','null','acceptMessage','ContactId','Sequelize','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','download','unix','toString','join','files','tmp','server','message-%s.eml','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','readFileSync','eml-format','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','offset','undefined','count'];(function(_0x1e7ce6,_0x33dce6){var _0x547650=function(_0xb52c09){while(--_0xb52c09){_0x1e7ce6['push'](_0x1e7ce6['shift']());}};_0x547650(++_0x33dce6);}(_0x08c0,0x19e));var _0x008c=function(_0x2dc81b,_0x2063ae){_0x2dc81b=_0x2dc81b-0x0;var _0x3a2946=_0x08c0[_0x2dc81b];return _0x3a2946;};'use strict';var emlformat=require(_0x008c('0x0'));var moment=require('moment');var BPromise=require(_0x008c('0x1'));var util=require(_0x008c('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x008c('0x3'));var Redis=require(_0x008c('0x4'));var htmlToText=require('html-to-text');var qs=require(_0x008c('0x5'));var logger=require(_0x008c('0x6'))('api');var interaction_log=require(_0x008c('0x6'))('mail-interactions');var config=require(_0x008c('0x7'));var db=require(_0x008c('0x8'))['db'];config['redis']=_[_0x008c('0x9')](config[_0x008c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x008c('0xb'))(new Redis(config[_0x008c('0xa')]));var htmlEntities=require(_0x008c('0xc'));require(_0x008c('0xd'))['register'](socket);var jayson=require(_0x008c('0xe'));var client=jayson[_0x008c('0xf')][_0x008c('0x10')]({'port':0x232c});var client9003=jayson[_0x008c('0xf')]['http']({'port':0x232b});var client9002=jayson[_0x008c('0xf')][_0x008c('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x10edfd,_0x978c51,_0x2e755a,_0x3d6f76){return new BPromise(function(_0x2e4370,_0x5a36a4){var _0x175379=_0x3d6f76||client;return _0x175379[_0x008c('0x11')](_0x10edfd,_0x2e755a)[_0x008c('0x12')](function(_0xebb049){logger[_0x008c('0x13')]('MailMessage,\x20%s,\x20%s',_0x978c51,_0x008c('0x14'));logger[_0x008c('0x15')](_0x008c('0x16'),_0x978c51,_0x008c('0x14'),JSON[_0x008c('0x17')](_0xebb049));if(_0xebb049[_0x008c('0x18')]){if(_0xebb049[_0x008c('0x18')][_0x008c('0x19')]===0x1f4){logger['error'](_0x008c('0x1a'),_0x978c51,_0xebb049[_0x008c('0x18')][_0x008c('0x1b')]);return _0x5a36a4(_0xebb049[_0x008c('0x18')][_0x008c('0x1b')]);}logger[_0x008c('0x18')](_0x008c('0x1a'),_0x978c51,_0xebb049[_0x008c('0x18')][_0x008c('0x1b')]);return _0x2e4370(_0xebb049['error'][_0x008c('0x1b')]);}else{logger['info'](_0x008c('0x1a'),_0x978c51,_0x008c('0x14'));_0x2e4370(_0xebb049[_0x008c('0x1c')][_0x008c('0x1b')]);}})[_0x008c('0x1d')](function(_0x2b58eb){logger[_0x008c('0x18')](_0x008c('0x1a'),_0x978c51,_0x2b58eb);_0x5a36a4(_0x2b58eb);});});}function respondWithResult(_0x292786,_0xf9d127){_0xf9d127=_0xf9d127||0xc8;return function(_0x293a40){if(_0x293a40){return _0x292786['status'](_0xf9d127)['json'](_0x293a40);}};}function respondWithFilteredResult(_0x4abc87,_0x413ab7){return function(_0xd4d8a5){if(_0xd4d8a5){var _0x27d5b7=typeof _0x413ab7[_0x008c('0x1e')]===_0x008c('0x1f')&&typeof _0x413ab7['limit']==='undefined';var _0x2ed8a2=_0xd4d8a5[_0x008c('0x20')];var _0x40842a=_0x27d5b7?0x0:_0x413ab7[_0x008c('0x1e')];var _0x106181=_0x27d5b7?_0xd4d8a5[_0x008c('0x20')]:_0x413ab7['offset']+_0x413ab7['limit'];var _0x3e7302;if(_0x106181>=_0x2ed8a2){_0x106181=_0x2ed8a2;_0x3e7302=0xc8;}else{_0x3e7302=0xce;}_0x4abc87[_0x008c('0x21')](_0x3e7302);return _0x4abc87[_0x008c('0x22')](_0x008c('0x23'),_0x40842a+'-'+_0x106181+'/'+_0x2ed8a2)[_0x008c('0x24')](_0xd4d8a5);}return null;};}function saveUpdates(_0x127ee4){return function(_0x4b62cc){if(_0x4b62cc){return _0x4b62cc[_0x008c('0x25')](_0x127ee4)[_0x008c('0x12')](function(_0xb6f60a){return _0xb6f60a;});}return null;};}function removeEntity(_0x54e181){return function(_0x5e67fa){if(_0x5e67fa){return _0x5e67fa[_0x008c('0x26')]()[_0x008c('0x12')](function(){_0x54e181['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x571a97){return function(_0x1e1ee8){if(!_0x1e1ee8){_0x571a97[_0x008c('0x27')](0x194);}return _0x1e1ee8;};}function handleError(_0x1ee660,_0x701c31){_0x701c31=_0x701c31||0x1f4;return function(_0x57183a){logger[_0x008c('0x18')](_0x57183a['stack']);if(_0x57183a[_0x008c('0x28')]){delete _0x57183a[_0x008c('0x28')];}_0x1ee660[_0x008c('0x21')](_0x701c31)[_0x008c('0x29')](_0x57183a);};}exports[_0x008c('0x2a')]=function(_0x1b36be,_0x3ccfa7){var _0x13cf9b={},_0x4035fb={},_0x18f36f={'count':0x0,'rows':[]};var _0x51b83a=_[_0x008c('0x2b')](db[_0x008c('0x2c')][_0x008c('0x2d')],function(_0x486512){return{'name':_0x486512[_0x008c('0x2e')],'type':_0x486512[_0x008c('0x2f')][_0x008c('0x30')]};});_0x4035fb['model']=_[_0x008c('0x2b')](_0x51b83a,_0x008c('0x28'));_0x4035fb[_0x008c('0x31')]=_[_0x008c('0x32')](_0x1b36be[_0x008c('0x31')]);_0x4035fb['filters']=_['intersection'](_0x4035fb['model'],_0x4035fb['query']);_0x13cf9b[_0x008c('0x33')]=_['intersection'](_0x4035fb[_0x008c('0x34')],qs['fields'](_0x1b36be[_0x008c('0x31')][_0x008c('0x35')]));_0x13cf9b[_0x008c('0x33')]=_0x13cf9b['attributes']['length']?_0x13cf9b[_0x008c('0x33')]:_0x4035fb[_0x008c('0x34')];if(!_0x1b36be[_0x008c('0x31')]['hasOwnProperty'](_0x008c('0x36'))){_0x13cf9b[_0x008c('0x37')]=qs[_0x008c('0x37')](_0x1b36be[_0x008c('0x31')][_0x008c('0x37')]);_0x13cf9b[_0x008c('0x1e')]=qs['offset'](_0x1b36be[_0x008c('0x31')][_0x008c('0x1e')]);}_0x13cf9b['order']=qs[_0x008c('0x38')](_0x1b36be[_0x008c('0x31')][_0x008c('0x38')]);_0x13cf9b[_0x008c('0x39')]=qs[_0x008c('0x3a')](_[_0x008c('0x3b')](_0x1b36be[_0x008c('0x31')],_0x4035fb[_0x008c('0x3a')]),_0x51b83a);if(_0x1b36be[_0x008c('0x31')][_0x008c('0x3c')]){_0x13cf9b[_0x008c('0x39')]=_[_0x008c('0x3d')](_0x13cf9b[_0x008c('0x39')],{'$or':_[_0x008c('0x2b')](_0x51b83a,function(_0x4a6c51){if(_0x4a6c51[_0x008c('0x2f')]!==_0x008c('0x3e')){var _0x4faf7c={};_0x4faf7c[_0x4a6c51['name']]={'$like':'%'+_0x1b36be[_0x008c('0x31')][_0x008c('0x3c')]+'%'};return _0x4faf7c;}})});}_0x13cf9b=_['merge']({},_0x13cf9b,_0x1b36be[_0x008c('0x3f')]);var _0xfd9457={'where':_0x13cf9b[_0x008c('0x39')]};return db[_0x008c('0x2c')][_0x008c('0x20')](_0xfd9457)['then'](function(_0x3a8986){_0x18f36f[_0x008c('0x20')]=_0x3a8986;if(_0x1b36be[_0x008c('0x31')][_0x008c('0x40')]){_0x13cf9b[_0x008c('0x41')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x13cf9b);})[_0x008c('0x12')](function(_0x2609f6){_0x18f36f[_0x008c('0x42')]=_0x2609f6;return _0x18f36f;})[_0x008c('0x12')](respondWithFilteredResult(_0x3ccfa7,_0x13cf9b))['catch'](handleError(_0x3ccfa7,null));};exports[_0x008c('0x43')]=function(_0x313bc9,_0x514ab4){var _0x3adf48={'raw':!![],'where':{'id':_0x313bc9[_0x008c('0x44')]['id']}},_0x16be14={};_0x16be14[_0x008c('0x34')]=_[_0x008c('0x32')](db[_0x008c('0x2c')]['rawAttributes']);_0x16be14['query']=_['keys'](_0x313bc9['query']);_0x16be14['filters']=_['intersection'](_0x16be14[_0x008c('0x34')],_0x16be14[_0x008c('0x31')]);_0x3adf48[_0x008c('0x33')]=_[_0x008c('0x45')](_0x16be14[_0x008c('0x34')],qs[_0x008c('0x35')](_0x313bc9[_0x008c('0x31')][_0x008c('0x35')]));_0x3adf48[_0x008c('0x33')]=_0x3adf48[_0x008c('0x33')][_0x008c('0x46')]?_0x3adf48['attributes']:_0x16be14[_0x008c('0x34')];if(_0x313bc9[_0x008c('0x31')][_0x008c('0x40')]){_0x3adf48[_0x008c('0x41')]=[{'all':!![]}];}_0x3adf48=_[_0x008c('0x3d')]({},_0x3adf48,_0x313bc9['options']);return db[_0x008c('0x2c')][_0x008c('0x47')](_0x3adf48)[_0x008c('0x12')](handleEntityNotFound(_0x514ab4,null))[_0x008c('0x12')](respondWithResult(_0x514ab4,null))[_0x008c('0x1d')](handleError(_0x514ab4,null));};exports[_0x008c('0x25')]=function(_0x326043,_0x58c637){if(_0x326043[_0x008c('0x48')]['id']){delete _0x326043[_0x008c('0x48')]['id'];}return db[_0x008c('0x2c')]['find']({'where':{'id':_0x326043['params']['id']}})[_0x008c('0x12')](handleEntityNotFound(_0x58c637,null))[_0x008c('0x12')](saveUpdates(_0x326043[_0x008c('0x48')],null))[_0x008c('0x12')](respondWithResult(_0x58c637,null))[_0x008c('0x1d')](handleError(_0x58c637,null));};exports[_0x008c('0x26')]=function(_0x89ea5c,_0x5b03e2){return db['MailMessage'][_0x008c('0x47')]({'where':{'id':_0x89ea5c['params']['id']}})[_0x008c('0x12')](handleEntityNotFound(_0x5b03e2,null))[_0x008c('0x12')](removeEntity(_0x5b03e2,null))['catch'](handleError(_0x5b03e2,null));};exports[_0x008c('0x49')]=function(_0x39530e,_0x1e1871){return db[_0x008c('0x2c')][_0x008c('0x49')]()[_0x008c('0x12')](respondWithResult(_0x1e1871,null))[_0x008c('0x1d')](handleError(_0x1e1871,null));};exports[_0x008c('0x4a')]=function(_0x74301b,_0x33113a){return db['MailMessage'][_0x008c('0x4a')](_0x74301b['body'])['then'](function(_0x105438){if(_0x105438){if(_0x105438['direction']===_0x008c('0x4b')&&!_0x105438['secret']){var _0x31fe72,_0x59602d,_0x4ce471;if(_0x74301b[_0x008c('0x48')]['to']){_0x59602d=_0x74301b[_0x008c('0x48')]['to']['split'](',')[0x0];}return db[_0x008c('0x4c')]['findOne']({'where':{'id':_0x105438[_0x008c('0x4d')]},'include':[{'model':db['CmList'],'as':_0x008c('0x4e'),'include':[{'model':db[_0x008c('0x4f')],'as':_0x008c('0x50'),'where':{'email':_0x59602d},'limit':0x1,'order':[[_0x008c('0x51'),_0x008c('0x52')]]}]},{'model':db['MailServerOut'],'as':_0x008c('0x53'),'raw':!![],'include':[{'model':db[_0x008c('0x54')],'as':_0x008c('0x54'),'raw':!![]}]}]})['then'](function(_0x121053){_0x31fe72=_0x121053;if(!_0x31fe72||!_0x31fe72[_0x008c('0x53')])return;var _0x23c8a1=_0x31fe72[_0x008c('0x55')]();if(_0x74301b['body'][_0x008c('0x56')]&&_0x74301b[_0x008c('0x48')]['attachments'][_0x008c('0x46')]){for(var _0x43de26=0x0;_0x43de26<_0x74301b[_0x008c('0x48')][_0x008c('0x56')][_0x008c('0x46')];_0x43de26+=0x1){_0x74301b[_0x008c('0x48')]['attachments'][_0x43de26]={'filename':_0x74301b[_0x008c('0x48')][_0x008c('0x56')][_0x43de26][_0x008c('0x28')],'path':path['join'](config[_0x008c('0x57')],_0x008c('0x58'),_0x74301b['body']['attachments'][_0x43de26][_0x008c('0x59')])};}}_0x4ce471={'account':_0x23c8a1,'message':_0x74301b[_0x008c('0x48')]};return;})[_0x008c('0x12')](function(){if(_0x31fe72['List']){if(_0x31fe72[_0x008c('0x4e')]['Contacts'][_0x008c('0x46')]){return _0x31fe72[_0x008c('0x4e')][_0x008c('0x50')][0x0];}else{return db[_0x008c('0x4f')][_0x008c('0x4a')](_['defaults'](_0x74301b[_0x008c('0x48')],{'firstName':_0x74301b[_0x008c('0x48')]['to'],'email':_0x74301b['body']['to'],'phone':_0x74301b[_0x008c('0x48')]['to'],'ListId':_0x31fe72[_0x008c('0x5a')]}));}}else{throw new Error(_0x008c('0x5b'));}})[_0x008c('0x12')](function(){if(_0x4ce471){return respondWithRpcPromise(_0x008c('0x5c'),_0x008c('0x5d'),_0x4ce471,client9003)[_0x008c('0x12')](function(_0x2b086d){return _0x105438[_0x008c('0x25')]({'read':!![],'messageId':_0x2b086d[_0x008c('0x5e')],'sentAt':moment()['format'](_0x008c('0x5f'))});})[_0x008c('0x1d')](function(_0x51afb1){logger['error']('%s',JSON[_0x008c('0x17')](_0x51afb1));return _0x105438;});}return _0x105438;});}return _0x105438;}})['then'](respondWithResult(_0x33113a,0xc9))['catch'](handleError(_0x33113a,null));};exports['accept']=function(_0x44744a,_0x1f844b){var _0x36bc76={'agent':{},'channel':'mail'};if(_0x44744a['body']['id']){delete _0x44744a['body']['id'];}_0x44744a[_0x008c('0x48')][_0x008c('0x60')]=!![];_0x44744a['body'][_0x008c('0x61')]=moment()[_0x008c('0x62')](_0x008c('0x5f'));_0x44744a['body'][_0x008c('0x63')]=_0x44744a[_0x008c('0x48')][_0x008c('0x63')]||_0x44744a[_0x008c('0x64')]['id'];_0x36bc76[_0x008c('0x65')]['id']=_0x44744a['body']['UserId'];return db['MailMessage'][_0x008c('0x47')]({'where':{'id':_0x44744a[_0x008c('0x44')]['id'],'UserId':null}})[_0x008c('0x12')](handleEntityNotFound(_0x1f844b,null))[_0x008c('0x12')](saveUpdates(_0x44744a[_0x008c('0x48')],null))[_0x008c('0x12')](function(_0x137ecc){if(_0x137ecc){_0x36bc76[_0x008c('0x1b')]=_0x137ecc[_0x008c('0x66')]({'plain':!![]});return db[_0x008c('0x67')][_0x008c('0x47')]({'where':{'id':_0x137ecc[_0x008c('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x1f844b,null))[_0x008c('0x12')](function(_0x15b7c8){if(_0x15b7c8){return _0x15b7c8[_0x008c('0x25')]({'UserId':_0x44744a['body'][_0x008c('0x63')],'read1stAt':_[_0x008c('0x69')](_0x15b7c8[_0x008c('0x6a')])?moment()[_0x008c('0x62')](_0x008c('0x5f')):undefined});}return null;})['then'](function(_0x76ba05){if(_0x76ba05){_0x36bc76['interaction']=_0x76ba05[_0x008c('0x66')]({'plain':!![]});interaction_log[_0x008c('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44744a['user']['id'],_0x44744a[_0x008c('0x64')]['name'],_0x44744a[_0x008c('0x64')][_0x008c('0x6b')],_0x36bc76['interaction']['id'],_0x44744a[_0x008c('0x48')]?JSON[_0x008c('0x17')](_0x44744a[_0x008c('0x48')]):_0x008c('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x008c('0x6d'),_0x36bc76);}return null;})['then'](function(_0x119652){var _0x473383='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x119652[_0x008c('0x1b')][_0x008c('0x6e')];return db['sequelize'][_0x008c('0x31')](_0x473383,{'type':db[_0x008c('0x6f')]['QueryTypes'][_0x008c('0x70')],'raw':!![]})['then'](function(_0x326051){return _0x326051;});})[_0x008c('0x12')](function(_0x5b08cb){if(_0x5b08cb){_0x36bc76['message']['contact']=_0x5b08cb[0x0];if(!_0x44744a[_0x008c('0x48')][_0x008c('0x63')])return;return db[_0x008c('0x71')]['find']({'where':{'id':_0x44744a[_0x008c('0x48')][_0x008c('0x63')],'role':_0x008c('0x65')},'attributes':['id',_0x008c('0x28'),_0x008c('0x72'),_0x008c('0x73'),_0x008c('0x74')],'raw':!![]});}return null;})[_0x008c('0x12')](function(_0x5a4941){if(!_0x5a4941)return null;_0x36bc76[_0x008c('0x1b')][_0x008c('0x65')]=_0x5a4941;return _0x36bc76;})[_0x008c('0x12')](function(_0x2c6d79){if(_0x2c6d79){if(_0x44744a[_0x008c('0x48')][_0x008c('0x75')]){_0x36bc76['message']['interface']=util[_0x008c('0x62')](_0x008c('0x76'),_0x44744a[_0x008c('0x64')][_0x008c('0x28')]);_0x36bc76[_0x008c('0x1b')]['channel']=_0x36bc76[_0x008c('0x77')];_0x36bc76[_0x008c('0x1b')][_0x008c('0x78')]=_0x36bc76[_0x008c('0x77')];_0x36bc76[_0x008c('0x1b')][_0x008c('0x79')]='accept';_0x36bc76[_0x008c('0x1b')]['body']=htmlToText[_0x008c('0x7a')](_0x36bc76[_0x008c('0x1b')][_0x008c('0x48')]);return respondWithRpcPromise(_0x008c('0x7b'),_0x008c('0x7b'),{'event':_0x008c('0x7c'),'message':_0x36bc76[_0x008c('0x1b')]},client9002)[_0x008c('0x12')](function(){return _0x36bc76;});}return _0x36bc76;}return null;})[_0x008c('0x12')](respondWithResult(_0x1f844b,null))[_0x008c('0x1d')](handleError(_0x1f844b,null));};exports[_0x008c('0x7d')]=function(_0x4bf295,_0x465adc){var _0x4f855e={'agent':{},'channel':_0x008c('0x7e')};if(_0x4bf295[_0x008c('0x48')]['id']){delete _0x4bf295['body']['id'];}_0x4bf295['body']['UserId']=_0x4bf295[_0x008c('0x48')][_0x008c('0x63')]||_0x4bf295[_0x008c('0x64')]['id'];_0x4f855e[_0x008c('0x65')]['id']=_0x4bf295[_0x008c('0x48')][_0x008c('0x63')];return db[_0x008c('0x2c')][_0x008c('0x47')]({'where':{'id':_0x4bf295[_0x008c('0x44')]['id'],'UserId':null}})[_0x008c('0x12')](handleEntityNotFound(_0x465adc,null))['then'](function(_0x1afa49){if(_0x1afa49){_0x4f855e[_0x008c('0x1b')]=_0x1afa49['get']({'plain':!![]});return db['MailInteraction'][_0x008c('0x47')]({'where':{'id':_0x1afa49[_0x008c('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x465adc,null))[_0x008c('0x12')](function(_0x159fef){if(_0x159fef){_0x4f855e['interaction']=_0x159fef[_0x008c('0x66')]({'plain':!![]});interaction_log[_0x008c('0x13')](_0x008c('0x7f'),_0x4bf295[_0x008c('0x64')]['id'],_0x4bf295[_0x008c('0x64')][_0x008c('0x28')],_0x4bf295['user'][_0x008c('0x6b')],_0x4f855e['interaction']['id'],_0x4bf295['body']?JSON['stringify'](_0x4bf295['body']):_0x008c('0x6c'));return respondWithRpcPromise(_0x008c('0x80'),'rejectMessage',_0x4f855e);}return null;})['then'](function(_0x579706){var _0x46c989=_0x008c('0x81')+_0x579706[_0x008c('0x1b')]['ContactId'];return db[_0x008c('0x82')][_0x008c('0x31')](_0x46c989,{'type':db[_0x008c('0x6f')][_0x008c('0x83')][_0x008c('0x70')],'raw':!![]})[_0x008c('0x12')](function(_0x18a121){return _0x18a121;});})[_0x008c('0x12')](function(_0x53c071){if(_0x53c071){_0x4f855e[_0x008c('0x1b')]['contact']=_0x53c071[0x0];if(!_0x4bf295[_0x008c('0x48')][_0x008c('0x63')])return;return db[_0x008c('0x71')]['find']({'where':{'id':_0x4bf295[_0x008c('0x48')][_0x008c('0x63')],'role':_0x008c('0x65')},'attributes':['id','name',_0x008c('0x72'),_0x008c('0x73'),_0x008c('0x74')],'raw':!![]});}return null;})['then'](function(_0x10d614){if(!_0x10d614)return null;_0x4f855e[_0x008c('0x1b')][_0x008c('0x65')]=_0x10d614;return _0x4f855e;})[_0x008c('0x12')](function(_0x58a8a9){if(_0x58a8a9){_0x58a8a9[_0x008c('0x1b')]['interface']=util[_0x008c('0x62')](_0x008c('0x76'),_0x4bf295['user'][_0x008c('0x28')]);_0x58a8a9[_0x008c('0x1b')]['channel']=_0x4f855e['channel'];_0x58a8a9[_0x008c('0x1b')][_0x008c('0x78')]=_0x4f855e['channel'];_0x58a8a9[_0x008c('0x1b')][_0x008c('0x79')]=_0x008c('0x7d');_0x58a8a9[_0x008c('0x1b')][_0x008c('0x48')]=htmlToText[_0x008c('0x7a')](_0x4f855e[_0x008c('0x1b')][_0x008c('0x48')]);respondWithRpcPromise('EventManager',_0x008c('0x7b'),{'event':'rejectmessage','message':_0x58a8a9[_0x008c('0x1b')]},client9002);return _0x4f855e;}return null;})['then'](respondWithResult(_0x465adc,null))['catch'](handleError(_0x465adc,null));};exports[_0x008c('0x84')]=function(_0x1fb65d,_0x308808){var _0x435f1f=moment()[_0x008c('0x85')]()[_0x008c('0x86')]();var _0x185f0c=path[_0x008c('0x87')](config[_0x008c('0x57')],'server',_0x008c('0x88'),_0x008c('0x89'));var _0x5d0af4=path[_0x008c('0x87')](config['root'],_0x008c('0x8a'),_0x008c('0x88'),_0x008c('0x56'));var _0x3191ff=util[_0x008c('0x62')](_0x008c('0x8b'),_0x435f1f);return db['MailMessage'][_0x008c('0x47')]({'where':{'id':_0x1fb65d['params']['id']},'attributes':['id',_0x008c('0x48'),'from','to','cc',_0x008c('0x8c'),_0x008c('0x8d'),_0x008c('0x8e')],'include':_0x1fb65d[_0x008c('0x31')][_0x008c('0x56')]?[{'model':db[_0x008c('0x8f')],'as':'Attachments'}]:undefined})[_0x008c('0x12')](handleEntityNotFound(_0x308808,null))[_0x008c('0x12')](function(_0x38ce30){if(_0x38ce30){var _0x170a9a=_0x38ce30;var _0x3e43b1={'from':_0x170a9a['from'],'to':_0x170a9a['to'],'subject':_0x170a9a[_0x008c('0x8d')],'html':htmlEntities['decode'](_0x170a9a[_0x008c('0x48')]),'headers':{'Date':moment(_0x170a9a[_0x008c('0x8e')])[_0x008c('0x62')](_0x008c('0x90'))},'attachments':[]};if(_0x38ce30['cc']){_0x3e43b1['headers']['Cc']=_0x38ce30['cc'];}if(_0x38ce30[_0x008c('0x8c')]){_0x3e43b1[_0x008c('0x91')][_0x008c('0x92')]=_0x38ce30['bcc'];}return new BPromise(function(_0x186ebb,_0x4b7269){if(_0x38ce30[_0x008c('0x93')]){for(var _0x1ff055=0x0;_0x1ff055<_0x38ce30['Attachments']['length'];_0x1ff055++){var _0x1cfc19=_0x38ce30[_0x008c('0x93')][_0x1ff055];var _0x36e42a=path[_0x008c('0x87')](_0x5d0af4,_0x1cfc19[_0x008c('0x59')]);if(fs['existsSync'](_0x36e42a)){_0x3e43b1[_0x008c('0x56')]['push']({'name':_0x1cfc19['name'],'contentType':_0x1cfc19[_0x008c('0x2f')],'data':fs[_0x008c('0x94')](_0x36e42a)});}}}emlformat['build'](_0x3e43b1,function(_0x4a2823,_0x3cdf12){if(_0x4a2823)return _0x4b7269(_0x4a2823);fs['writeFileSync'](path[_0x008c('0x87')](_0x185f0c,_0x3191ff),_0x3cdf12);return _0x186ebb(_0x3cdf12);});});}})[_0x008c('0x12')](function(_0x3b9100){if(_0x3b9100){return _0x308808[_0x008c('0x84')](path['join'](_0x185f0c,_0x3191ff),_0x3191ff,function(_0x59aeff){if(!_0x59aeff)fs['unlinkSync'](path[_0x008c('0x87')](_0x185f0c,_0x3191ff));});}})[_0x008c('0x1d')](handleError(_0x308808,null));}; \ No newline at end of file +var _0x5ba8=['MailMessage','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','rawAttributes','find','update','body','params','destroy','describe','create','out','secret','MailAccount','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','CmContact','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SELECT','motionChannel','rejectmessage','download','toString','server','files','tmp','createdAt','Attachment','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','html-entities','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','limit','undefined','set','Content-Range','sendStatus','stack','name','map'];(function(_0x6d5ec5,_0x207d88){var _0x4ca251=function(_0x53b051){while(--_0x53b051){_0x6d5ec5['push'](_0x6d5ec5['shift']());}};_0x4ca251(++_0x207d88);}(_0x5ba8,0x77));var _0x85ba=function(_0x37c416,_0x3248a0){_0x37c416=_0x37c416-0x0;var _0x2a7dcc=_0x5ba8[_0x37c416];return _0x2a7dcc;};'use strict';var emlformat=require(_0x85ba('0x0'));var moment=require(_0x85ba('0x1'));var BPromise=require(_0x85ba('0x2'));var util=require(_0x85ba('0x3'));var path=require(_0x85ba('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x85ba('0x5'));var htmlToText=require(_0x85ba('0x6'));var qs=require(_0x85ba('0x7'));var logger=require(_0x85ba('0x8'))(_0x85ba('0x9'));var interaction_log=require(_0x85ba('0x8'))(_0x85ba('0xa'));var config=require(_0x85ba('0xb'));var db=require('../../mysqldb')['db'];config[_0x85ba('0xc')]=_[_0x85ba('0xd')](config[_0x85ba('0xc')],{'host':_0x85ba('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85ba('0xc')]));var htmlEntities=require(_0x85ba('0xf'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x85ba('0x10'));var client=jayson[_0x85ba('0x11')][_0x85ba('0x12')]({'port':0x232c});var client9003=jayson[_0x85ba('0x11')][_0x85ba('0x12')]({'port':0x232b});var client9002=jayson[_0x85ba('0x11')][_0x85ba('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x18557e,_0x4f5532,_0x3cf172,_0x42b038){return new BPromise(function(_0x6049eb,_0xeeb58c){var _0x4cc414=_0x42b038||client;return _0x4cc414[_0x85ba('0x13')](_0x18557e,_0x3cf172)[_0x85ba('0x14')](function(_0x2b977c){logger[_0x85ba('0x15')](_0x85ba('0x16'),_0x4f5532,_0x85ba('0x17'));logger[_0x85ba('0x18')](_0x85ba('0x19'),_0x4f5532,_0x85ba('0x17'),JSON['stringify'](_0x2b977c));if(_0x2b977c[_0x85ba('0x1a')]){if(_0x2b977c[_0x85ba('0x1a')]['code']===0x1f4){logger['error'](_0x85ba('0x16'),_0x4f5532,_0x2b977c[_0x85ba('0x1a')][_0x85ba('0x1b')]);return _0xeeb58c(_0x2b977c[_0x85ba('0x1a')][_0x85ba('0x1b')]);}logger['error'](_0x85ba('0x16'),_0x4f5532,_0x2b977c[_0x85ba('0x1a')]['message']);return _0x6049eb(_0x2b977c[_0x85ba('0x1a')][_0x85ba('0x1b')]);}else{logger[_0x85ba('0x15')](_0x85ba('0x16'),_0x4f5532,_0x85ba('0x17'));_0x6049eb(_0x2b977c[_0x85ba('0x1c')][_0x85ba('0x1b')]);}})[_0x85ba('0x1d')](function(_0x1bbda7){logger[_0x85ba('0x1a')](_0x85ba('0x16'),_0x4f5532,_0x1bbda7);_0xeeb58c(_0x1bbda7);});});}function respondWithResult(_0x5f5770,_0x7cc8d7){_0x7cc8d7=_0x7cc8d7||0xc8;return function(_0x46be09){if(_0x46be09){return _0x5f5770[_0x85ba('0x1e')](_0x7cc8d7)[_0x85ba('0x1f')](_0x46be09);}};}function respondWithFilteredResult(_0x2d65d5,_0x16827c){return function(_0x145a97){if(_0x145a97){var _0x2471ad=typeof _0x16827c[_0x85ba('0x20')]==='undefined'&&typeof _0x16827c[_0x85ba('0x21')]===_0x85ba('0x22');var _0x7345f9=_0x145a97['count'];var _0x586489=_0x2471ad?0x0:_0x16827c[_0x85ba('0x20')];var _0x27a5bc=_0x2471ad?_0x145a97['count']:_0x16827c[_0x85ba('0x20')]+_0x16827c[_0x85ba('0x21')];var _0xc9176b;if(_0x27a5bc>=_0x7345f9){_0x27a5bc=_0x7345f9;_0xc9176b=0xc8;}else{_0xc9176b=0xce;}_0x2d65d5[_0x85ba('0x1e')](_0xc9176b);return _0x2d65d5[_0x85ba('0x23')](_0x85ba('0x24'),_0x586489+'-'+_0x27a5bc+'/'+_0x7345f9)[_0x85ba('0x1f')](_0x145a97);}return null;};}function saveUpdates(_0x56864d){return function(_0x4efa41){if(_0x4efa41){return _0x4efa41['update'](_0x56864d)[_0x85ba('0x14')](function(_0x3dab2d){return _0x3dab2d;});}return null;};}function removeEntity(_0x31bbc7){return function(_0x367542){if(_0x367542){return _0x367542['destroy']()['then'](function(){_0x31bbc7[_0x85ba('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d44cd){return function(_0x53fdd9){if(!_0x53fdd9){_0x1d44cd[_0x85ba('0x25')](0x194);}return _0x53fdd9;};}function handleError(_0x2c5c32,_0x34491e){_0x34491e=_0x34491e||0x1f4;return function(_0x334475){logger[_0x85ba('0x1a')](_0x334475[_0x85ba('0x26')]);if(_0x334475['name']){delete _0x334475[_0x85ba('0x27')];}_0x2c5c32[_0x85ba('0x1e')](_0x34491e)['send'](_0x334475);};}exports['index']=function(_0x5a00dd,_0x36b0ce){var _0x19678b={},_0x34308c={},_0xb73aeb={'count':0x0,'rows':[]};var _0x4ca626=_[_0x85ba('0x28')](db[_0x85ba('0x29')]['rawAttributes'],function(_0x155cbc){return{'name':_0x155cbc[_0x85ba('0x2a')],'type':_0x155cbc[_0x85ba('0x2b')]['key']};});_0x34308c[_0x85ba('0x2c')]=_[_0x85ba('0x28')](_0x4ca626,'name');_0x34308c['query']=_[_0x85ba('0x2d')](_0x5a00dd[_0x85ba('0x2e')]);_0x34308c[_0x85ba('0x2f')]=_[_0x85ba('0x30')](_0x34308c[_0x85ba('0x2c')],_0x34308c[_0x85ba('0x2e')]);_0x19678b[_0x85ba('0x31')]=_[_0x85ba('0x30')](_0x34308c[_0x85ba('0x2c')],qs[_0x85ba('0x32')](_0x5a00dd['query']['fields']));_0x19678b[_0x85ba('0x31')]=_0x19678b[_0x85ba('0x31')][_0x85ba('0x33')]?_0x19678b[_0x85ba('0x31')]:_0x34308c[_0x85ba('0x2c')];if(!_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x34')](_0x85ba('0x35'))){_0x19678b[_0x85ba('0x21')]=qs[_0x85ba('0x21')](_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x21')]);_0x19678b[_0x85ba('0x20')]=qs[_0x85ba('0x20')](_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x20')]);}_0x19678b[_0x85ba('0x36')]=qs['sort'](_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x37')]);_0x19678b[_0x85ba('0x38')]=qs[_0x85ba('0x2f')](_[_0x85ba('0x39')](_0x5a00dd['query'],_0x34308c['filters']),_0x4ca626);if(_0x5a00dd[_0x85ba('0x2e')]['filter']){_0x19678b[_0x85ba('0x38')]=_['merge'](_0x19678b[_0x85ba('0x38')],{'$or':_[_0x85ba('0x28')](_0x4ca626,function(_0x2d175c){if(_0x2d175c[_0x85ba('0x2b')]!==_0x85ba('0x3a')){var _0x29edf0={};_0x29edf0[_0x2d175c[_0x85ba('0x27')]]={'$like':'%'+_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x3b')]+'%'};return _0x29edf0;}})});}_0x19678b=_[_0x85ba('0x3c')]({},_0x19678b,_0x5a00dd[_0x85ba('0x3d')]);var _0x9bb6a5={'where':_0x19678b[_0x85ba('0x38')]};return db[_0x85ba('0x29')][_0x85ba('0x3e')](_0x9bb6a5)[_0x85ba('0x14')](function(_0x36daa8){_0xb73aeb[_0x85ba('0x3e')]=_0x36daa8;if(_0x5a00dd[_0x85ba('0x2e')][_0x85ba('0x3f')]){_0x19678b[_0x85ba('0x40')]=[{'all':!![]}];}return db[_0x85ba('0x29')][_0x85ba('0x41')](_0x19678b);})['then'](function(_0x13d790){_0xb73aeb[_0x85ba('0x42')]=_0x13d790;return _0xb73aeb;})[_0x85ba('0x14')](respondWithFilteredResult(_0x36b0ce,_0x19678b))['catch'](handleError(_0x36b0ce,null));};exports['show']=function(_0x58df52,_0x5a9c7c){var _0x1cdd2f={'raw':!![],'where':{'id':_0x58df52['params']['id']}},_0x192ff={};_0x192ff[_0x85ba('0x2c')]=_[_0x85ba('0x2d')](db[_0x85ba('0x29')][_0x85ba('0x43')]);_0x192ff[_0x85ba('0x2e')]=_['keys'](_0x58df52[_0x85ba('0x2e')]);_0x192ff[_0x85ba('0x2f')]=_[_0x85ba('0x30')](_0x192ff[_0x85ba('0x2c')],_0x192ff[_0x85ba('0x2e')]);_0x1cdd2f[_0x85ba('0x31')]=_['intersection'](_0x192ff[_0x85ba('0x2c')],qs[_0x85ba('0x32')](_0x58df52[_0x85ba('0x2e')][_0x85ba('0x32')]));_0x1cdd2f[_0x85ba('0x31')]=_0x1cdd2f[_0x85ba('0x31')][_0x85ba('0x33')]?_0x1cdd2f[_0x85ba('0x31')]:_0x192ff[_0x85ba('0x2c')];if(_0x58df52[_0x85ba('0x2e')]['includeAll']){_0x1cdd2f[_0x85ba('0x40')]=[{'all':!![]}];}_0x1cdd2f=_['merge']({},_0x1cdd2f,_0x58df52[_0x85ba('0x3d')]);return db['MailMessage'][_0x85ba('0x44')](_0x1cdd2f)[_0x85ba('0x14')](handleEntityNotFound(_0x5a9c7c,null))[_0x85ba('0x14')](respondWithResult(_0x5a9c7c,null))['catch'](handleError(_0x5a9c7c,null));};exports[_0x85ba('0x45')]=function(_0x3319c0,_0x5f240d){if(_0x3319c0[_0x85ba('0x46')]['id']){delete _0x3319c0[_0x85ba('0x46')]['id'];}return db['MailMessage'][_0x85ba('0x44')]({'where':{'id':_0x3319c0[_0x85ba('0x47')]['id']}})[_0x85ba('0x14')](handleEntityNotFound(_0x5f240d,null))[_0x85ba('0x14')](saveUpdates(_0x3319c0[_0x85ba('0x46')],null))[_0x85ba('0x14')](respondWithResult(_0x5f240d,null))[_0x85ba('0x1d')](handleError(_0x5f240d,null));};exports[_0x85ba('0x48')]=function(_0xe4644b,_0x2bb524){return db['MailMessage'][_0x85ba('0x44')]({'where':{'id':_0xe4644b[_0x85ba('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bb524,null))[_0x85ba('0x14')](removeEntity(_0x2bb524,null))[_0x85ba('0x1d')](handleError(_0x2bb524,null));};exports['describe']=function(_0x1d0545,_0x1e2839){return db[_0x85ba('0x29')][_0x85ba('0x49')]()[_0x85ba('0x14')](respondWithResult(_0x1e2839,null))[_0x85ba('0x1d')](handleError(_0x1e2839,null));};exports[_0x85ba('0x4a')]=function(_0x232269,_0x2c94af){return db['MailMessage'][_0x85ba('0x4a')](_0x232269[_0x85ba('0x46')])[_0x85ba('0x14')](function(_0xfe0c14){if(_0xfe0c14){if(_0xfe0c14['direction']===_0x85ba('0x4b')&&!_0xfe0c14[_0x85ba('0x4c')]){var _0x399d0b,_0x16c86a,_0x3b54fc;if(_0x232269[_0x85ba('0x46')]['to']){_0x16c86a=_0x232269['body']['to']['split'](',')[0x0];}return db[_0x85ba('0x4d')]['findOne']({'where':{'id':_0xfe0c14[_0x85ba('0x4e')]},'include':[{'model':db[_0x85ba('0x4f')],'as':_0x85ba('0x50'),'include':[{'model':db['CmContact'],'as':_0x85ba('0x51'),'where':{'email':_0x16c86a},'limit':0x1,'order':[['updatedAt',_0x85ba('0x52')]]}]},{'model':db[_0x85ba('0x53')],'as':_0x85ba('0x54'),'raw':!![],'include':[{'model':db[_0x85ba('0x55')],'as':_0x85ba('0x55'),'raw':!![]}]}]})[_0x85ba('0x14')](function(_0x310089){_0x399d0b=_0x310089;if(!_0x399d0b||!_0x399d0b[_0x85ba('0x54')])return;var _0x33c141=_0x399d0b[_0x85ba('0x56')]();if(_0x232269[_0x85ba('0x46')][_0x85ba('0x57')]&&_0x232269[_0x85ba('0x46')][_0x85ba('0x57')][_0x85ba('0x33')]){for(var _0xbe3585=0x0;_0xbe3585<_0x232269[_0x85ba('0x46')]['attachments'][_0x85ba('0x33')];_0xbe3585+=0x1){_0x232269[_0x85ba('0x46')][_0x85ba('0x57')][_0xbe3585]={'filename':_0x232269['body'][_0x85ba('0x57')][_0xbe3585][_0x85ba('0x27')],'path':path[_0x85ba('0x58')](config[_0x85ba('0x59')],'server/files/attachments',_0x232269[_0x85ba('0x46')]['attachments'][_0xbe3585][_0x85ba('0x5a')])};}}_0x3b54fc={'account':_0x33c141,'message':_0x232269['body']};return;})[_0x85ba('0x14')](function(){if(_0x399d0b[_0x85ba('0x50')]){if(_0x399d0b['List'][_0x85ba('0x51')][_0x85ba('0x33')]){return _0x399d0b['List'][_0x85ba('0x51')][0x0];}else{return db[_0x85ba('0x5b')][_0x85ba('0x4a')](_[_0x85ba('0xd')](_0x232269[_0x85ba('0x46')],{'firstName':_0x232269['body']['to'],'email':_0x232269[_0x85ba('0x46')]['to'],'phone':_0x232269[_0x85ba('0x46')]['to'],'ListId':_0x399d0b['ListId']}));}}else{throw new Error(_0x85ba('0x5c'));}})[_0x85ba('0x14')](function(){if(_0x3b54fc){return respondWithRpcPromise(_0x85ba('0x5d'),_0x85ba('0x5e'),_0x3b54fc,client9003)[_0x85ba('0x14')](function(_0x14bef0){return _0xfe0c14[_0x85ba('0x45')]({'read':!![],'messageId':_0x14bef0[_0x85ba('0x5f')],'sentAt':moment()[_0x85ba('0x60')](_0x85ba('0x61'))});})[_0x85ba('0x1d')](function(_0x41f195){logger[_0x85ba('0x1a')]('%s',JSON[_0x85ba('0x62')](_0x41f195));return _0xfe0c14;});}return _0xfe0c14;});}return _0xfe0c14;}})[_0x85ba('0x14')](respondWithResult(_0x2c94af,0xc9))[_0x85ba('0x1d')](handleError(_0x2c94af,null));};exports[_0x85ba('0x63')]=function(_0x279739,_0x1ce0d1){var _0x543354={'agent':{},'channel':'mail'};if(_0x279739[_0x85ba('0x46')]['id']){delete _0x279739[_0x85ba('0x46')]['id'];}_0x279739[_0x85ba('0x46')][_0x85ba('0x64')]=!![];_0x279739[_0x85ba('0x46')][_0x85ba('0x65')]=moment()[_0x85ba('0x60')](_0x85ba('0x61'));_0x279739[_0x85ba('0x46')]['UserId']=_0x279739[_0x85ba('0x46')][_0x85ba('0x66')]||_0x279739[_0x85ba('0x67')]['id'];_0x543354[_0x85ba('0x68')]['id']=_0x279739['body']['UserId'];return db[_0x85ba('0x29')][_0x85ba('0x44')]({'where':{'id':_0x279739[_0x85ba('0x47')]['id'],'UserId':null}})[_0x85ba('0x14')](handleEntityNotFound(_0x1ce0d1,null))['then'](saveUpdates(_0x279739['body'],null))['then'](function(_0x2b1aed){if(_0x2b1aed){_0x543354[_0x85ba('0x1b')]=_0x2b1aed[_0x85ba('0x69')]({'plain':!![]});return db[_0x85ba('0x6a')][_0x85ba('0x44')]({'where':{'id':_0x2b1aed[_0x85ba('0x6b')]}});}return null;})[_0x85ba('0x14')](handleEntityNotFound(_0x1ce0d1,null))[_0x85ba('0x14')](function(_0x55860f){if(_0x55860f){return _0x55860f[_0x85ba('0x45')]({'UserId':_0x279739[_0x85ba('0x46')][_0x85ba('0x66')],'read1stAt':_[_0x85ba('0x6c')](_0x55860f[_0x85ba('0x6d')])?moment()[_0x85ba('0x60')](_0x85ba('0x61')):undefined});}return null;})['then'](function(_0x2a47bc){if(_0x2a47bc){_0x543354['interaction']=_0x2a47bc['get']({'plain':!![]});interaction_log[_0x85ba('0x15')](_0x85ba('0x6e'),_0x279739[_0x85ba('0x67')]['id'],_0x279739[_0x85ba('0x67')]['name'],_0x279739[_0x85ba('0x67')][_0x85ba('0x6f')],_0x543354[_0x85ba('0x70')]['id'],_0x279739[_0x85ba('0x46')]?JSON[_0x85ba('0x62')](_0x279739[_0x85ba('0x46')]):_0x85ba('0x71'));return respondWithRpcPromise(_0x85ba('0x72'),_0x85ba('0x73'),_0x543354);}return null;})[_0x85ba('0x14')](function(_0x141fa4){var _0x3eaea9=_0x85ba('0x74')+_0x141fa4[_0x85ba('0x1b')][_0x85ba('0x75')];return db[_0x85ba('0x76')][_0x85ba('0x2e')](_0x3eaea9,{'type':db[_0x85ba('0x77')][_0x85ba('0x78')]['SELECT'],'raw':!![]})[_0x85ba('0x14')](function(_0x183ea2){return _0x183ea2;});})['then'](function(_0x19672c){if(_0x19672c){_0x543354[_0x85ba('0x1b')][_0x85ba('0x79')]=_0x19672c[0x0];if(!_0x279739[_0x85ba('0x46')][_0x85ba('0x66')])return;return db[_0x85ba('0x7a')][_0x85ba('0x44')]({'where':{'id':_0x279739[_0x85ba('0x46')][_0x85ba('0x66')],'role':'agent'},'attributes':['id',_0x85ba('0x27'),_0x85ba('0x7b'),_0x85ba('0x7c'),_0x85ba('0x7d')],'raw':!![]});}return null;})[_0x85ba('0x14')](function(_0x2a3235){if(!_0x2a3235)return null;_0x543354[_0x85ba('0x1b')][_0x85ba('0x68')]=_0x2a3235;return _0x543354;})[_0x85ba('0x14')](function(_0x34439d){if(_0x34439d){if(_0x279739[_0x85ba('0x46')][_0x85ba('0x7e')]){_0x543354[_0x85ba('0x1b')][_0x85ba('0x7f')]=util['format'](_0x85ba('0x80'),_0x279739[_0x85ba('0x67')][_0x85ba('0x27')]);_0x543354[_0x85ba('0x1b')][_0x85ba('0x81')]=_0x543354[_0x85ba('0x81')];_0x543354['message']['motionChannel']=_0x543354['channel'];_0x543354[_0x85ba('0x1b')][_0x85ba('0x82')]=_0x85ba('0x63');_0x543354['message']['body']=htmlToText[_0x85ba('0x83')](_0x543354['message'][_0x85ba('0x46')]);return respondWithRpcPromise(_0x85ba('0x84'),'EventManager',{'event':_0x85ba('0x85'),'message':_0x543354[_0x85ba('0x1b')]},client9002)['then'](function(){return _0x543354;});}return _0x543354;}return null;})[_0x85ba('0x14')](respondWithResult(_0x1ce0d1,null))['catch'](handleError(_0x1ce0d1,null));};exports[_0x85ba('0x86')]=function(_0x12afbe,_0x47ee89){var _0x559b6b={'agent':{},'channel':'mail'};if(_0x12afbe[_0x85ba('0x46')]['id']){delete _0x12afbe['body']['id'];}_0x12afbe['body'][_0x85ba('0x66')]=_0x12afbe['body'][_0x85ba('0x66')]||_0x12afbe[_0x85ba('0x67')]['id'];_0x559b6b[_0x85ba('0x68')]['id']=_0x12afbe[_0x85ba('0x46')][_0x85ba('0x66')];return db[_0x85ba('0x29')]['find']({'where':{'id':_0x12afbe[_0x85ba('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x47ee89,null))[_0x85ba('0x14')](function(_0x75ea80){if(_0x75ea80){_0x559b6b[_0x85ba('0x1b')]=_0x75ea80[_0x85ba('0x69')]({'plain':!![]});return db[_0x85ba('0x6a')][_0x85ba('0x44')]({'where':{'id':_0x75ea80[_0x85ba('0x6b')]}});}return null;})[_0x85ba('0x14')](handleEntityNotFound(_0x47ee89,null))[_0x85ba('0x14')](function(_0x5837da){if(_0x5837da){_0x559b6b['interaction']=_0x5837da['get']({'plain':!![]});interaction_log[_0x85ba('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12afbe['user']['id'],_0x12afbe[_0x85ba('0x67')][_0x85ba('0x27')],_0x12afbe[_0x85ba('0x67')]['role'],_0x559b6b['interaction']['id'],_0x12afbe[_0x85ba('0x46')]?JSON[_0x85ba('0x62')](_0x12afbe[_0x85ba('0x46')]):'null');return respondWithRpcPromise(_0x85ba('0x87'),_0x85ba('0x88'),_0x559b6b);}return null;})[_0x85ba('0x14')](function(_0x1f67ce){var _0x513bb1=_0x85ba('0x74')+_0x1f67ce[_0x85ba('0x1b')][_0x85ba('0x75')];return db['sequelize']['query'](_0x513bb1,{'type':db['Sequelize'][_0x85ba('0x78')][_0x85ba('0x89')],'raw':!![]})['then'](function(_0x189575){return _0x189575;});})[_0x85ba('0x14')](function(_0xd0a5ae){if(_0xd0a5ae){_0x559b6b[_0x85ba('0x1b')]['contact']=_0xd0a5ae[0x0];if(!_0x12afbe[_0x85ba('0x46')]['UserId'])return;return db[_0x85ba('0x7a')]['find']({'where':{'id':_0x12afbe[_0x85ba('0x46')][_0x85ba('0x66')],'role':_0x85ba('0x68')},'attributes':['id',_0x85ba('0x27'),_0x85ba('0x7b'),_0x85ba('0x7c'),_0x85ba('0x7d')],'raw':!![]});}return null;})[_0x85ba('0x14')](function(_0x2780c7){if(!_0x2780c7)return null;_0x559b6b[_0x85ba('0x1b')][_0x85ba('0x68')]=_0x2780c7;return _0x559b6b;})[_0x85ba('0x14')](function(_0x2cfeb0){if(_0x2cfeb0){_0x2cfeb0[_0x85ba('0x1b')][_0x85ba('0x7f')]=util['format']('SIP/%s',_0x12afbe[_0x85ba('0x67')][_0x85ba('0x27')]);_0x2cfeb0[_0x85ba('0x1b')][_0x85ba('0x81')]=_0x559b6b[_0x85ba('0x81')];_0x2cfeb0[_0x85ba('0x1b')][_0x85ba('0x8a')]=_0x559b6b[_0x85ba('0x81')];_0x2cfeb0['message']['event']='reject';_0x2cfeb0['message'][_0x85ba('0x46')]=htmlToText[_0x85ba('0x83')](_0x559b6b['message']['body']);respondWithRpcPromise('EventManager',_0x85ba('0x84'),{'event':_0x85ba('0x8b'),'message':_0x2cfeb0['message']},client9002);return _0x559b6b;}return null;})['then'](respondWithResult(_0x47ee89,null))['catch'](handleError(_0x47ee89,null));};exports[_0x85ba('0x8c')]=function(_0x36d3b8,_0x12313a){var _0x53e60a=moment()['unix']()[_0x85ba('0x8d')]();var _0x43f709=path['join'](config[_0x85ba('0x59')],_0x85ba('0x8e'),_0x85ba('0x8f'),_0x85ba('0x90'));var _0x5e2eeb=path[_0x85ba('0x58')](config[_0x85ba('0x59')],_0x85ba('0x8e'),_0x85ba('0x8f'),_0x85ba('0x57'));var _0x3dc334=util[_0x85ba('0x60')]('message-%s.eml',_0x53e60a);return db['MailMessage'][_0x85ba('0x44')]({'where':{'id':_0x36d3b8[_0x85ba('0x47')]['id']},'attributes':['id',_0x85ba('0x46'),'from','to','cc','bcc','subject',_0x85ba('0x91')],'include':_0x36d3b8[_0x85ba('0x2e')][_0x85ba('0x57')]?[{'model':db[_0x85ba('0x92')],'as':'Attachments'}]:undefined})[_0x85ba('0x14')](handleEntityNotFound(_0x12313a,null))[_0x85ba('0x14')](function(_0x140512){if(_0x140512){var _0x88d1f=_0x140512;var _0x11599d={'from':_0x88d1f[_0x85ba('0x93')],'to':_0x88d1f['to'],'subject':_0x88d1f[_0x85ba('0x94')],'html':htmlEntities[_0x85ba('0x95')](_0x88d1f[_0x85ba('0x46')]),'headers':{'Date':moment(_0x88d1f[_0x85ba('0x91')])[_0x85ba('0x60')](_0x85ba('0x96'))},'attachments':[]};if(_0x140512['cc']){_0x11599d['headers']['Cc']=_0x140512['cc'];}if(_0x140512[_0x85ba('0x97')]){_0x11599d[_0x85ba('0x98')][_0x85ba('0x99')]=_0x140512[_0x85ba('0x97')];}return new BPromise(function(_0x1b5d90,_0x5732c3){if(_0x140512[_0x85ba('0x9a')]){for(var _0x2cee52=0x0;_0x2cee52<_0x140512[_0x85ba('0x9a')][_0x85ba('0x33')];_0x2cee52++){var _0x36e38c=_0x140512[_0x85ba('0x9a')][_0x2cee52];var _0x32768a=path[_0x85ba('0x58')](_0x5e2eeb,_0x36e38c[_0x85ba('0x5a')]);if(fs[_0x85ba('0x9b')](_0x32768a)){_0x11599d[_0x85ba('0x57')]['push']({'name':_0x36e38c[_0x85ba('0x27')],'contentType':_0x36e38c[_0x85ba('0x2b')],'data':fs[_0x85ba('0x9c')](_0x32768a)});}}}emlformat[_0x85ba('0x9d')](_0x11599d,function(_0xb9d1dd,_0x474c90){if(_0xb9d1dd)return _0x5732c3(_0xb9d1dd);fs[_0x85ba('0x9e')](path[_0x85ba('0x58')](_0x43f709,_0x3dc334),_0x474c90);return _0x1b5d90(_0x474c90);});});}})[_0x85ba('0x14')](function(_0x3f5c73){if(_0x3f5c73){return _0x12313a['download'](path[_0x85ba('0x58')](_0x43f709,_0x3dc334),_0x3dc334,function(_0x4ce6f1){if(!_0x4ce6f1)fs[_0x85ba('0x9f')](path[_0x85ba('0x58')](_0x43f709,_0x3dc334));});}})[_0x85ba('0x1d')](handleError(_0x12313a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d50d1f0..26ac068 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 _0x5a76=['MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x334dd6,_0x33f834){var _0x562376=function(_0x37d1f8){while(--_0x37d1f8){_0x334dd6['push'](_0x334dd6['shift']());}};_0x562376(++_0x33f834);}(_0x5a76,0xf2));var _0x65a7=function(_0x4b48af,_0x4ad5b9){_0x4b48af=_0x4b48af-0x0;var _0x64ac44=_0x5a76[_0x4b48af];return _0x64ac44;};'use strict';var EventEmitter=require(_0x65a7('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x65a7('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x65a7('0x2')](0x0);var events={'afterCreate':_0x65a7('0x3'),'afterUpdate':'update','afterDestroy':_0x65a7('0x4')};function emitEvent(_0x30fff9){return function(_0x672f42,_0x23a69b,_0x2a11e8){MailMessageEvents[_0x65a7('0x5')](_0x30fff9+':'+_0x672f42['id'],_0x672f42);MailMessageEvents['emit'](_0x30fff9,_0x672f42);_0x2a11e8(null);};}for(var e in events){if(events[_0x65a7('0x6')](e)){var event=events[e];MailMessage[_0x65a7('0x7')](e,emitEvent(event));}}module[_0x65a7('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xe68c=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x42f270,_0x452dec){var _0x57bc5b=function(_0x258159){while(--_0x258159){_0x42f270['push'](_0x42f270['shift']());}};_0x57bc5b(++_0x452dec);}(_0xe68c,0x132));var _0xce68=function(_0x52eceb,_0x400bb4){_0x52eceb=_0x52eceb-0x0;var _0x415694=_0xe68c[_0x52eceb];return _0x415694;};'use strict';var EventEmitter=require(_0xce68('0x0'));var MailMessage=require(_0xce68('0x1'))['db'][_0xce68('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xce68('0x3')](0x0);var events={'afterCreate':_0xce68('0x4'),'afterUpdate':'update','afterDestroy':_0xce68('0x5')};function emitEvent(_0x24a1df){return function(_0x3bacd6,_0xcf836d,_0x5c9937){MailMessageEvents[_0xce68('0x6')](_0x24a1df+':'+_0x3bacd6['id'],_0x3bacd6);MailMessageEvents[_0xce68('0x6')](_0x24a1df,_0x3bacd6);_0x5c9937(null);};}for(var e in events){if(events[_0xce68('0x7')](e)){var event=events[e];MailMessage[_0xce68('0x8')](e,emitEvent(event));}}module[_0xce68('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 166dc3e..b0e19a2 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 _0x6d1b=['messageId','plainBody','subject','FULLTEXT','body','fromString','direction','toLowerCase','out','UserId','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','html-to-text','./mailMessage.attributes','exports','define','MailMessage','mail_messages'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x6d1b,0x13a));var _0xb6d1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6d1b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb6d1('0x0'));var util=require(_0xb6d1('0x1'));var logger=require('../../config/logger')(_0xb6d1('0x2'));var moment=require('moment');var BPromise=require(_0xb6d1('0x3'));var rp=require('request-promise');var htmlToText=require(_0xb6d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb6d1('0x5'));module[_0xb6d1('0x6')]=function(_0x2d8b7c,_0x4d7735){return _0x2d8b7c[_0xb6d1('0x7')](_0xb6d1('0x8'),attributes,{'tableName':_0xb6d1('0x9'),'paranoid':![],'indexes':[{'name':_0xb6d1('0xa'),'fields':[_0xb6d1('0xa')]},{'name':'fti_mail_messages','fields':[_0xb6d1('0xb'),_0xb6d1('0xc')],'type':_0xb6d1('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xff157,_0x504d78,_0x2bf38b){if(_0xff157[_0xb6d1('0xe')]){_0xff157[_0xb6d1('0xb')]=htmlToText[_0xb6d1('0xf')](_0xff157['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bf38b(null,_0x504d78);},'afterCreate':function(_0x2a44d2,_0x400822,_0x5242d7){var _0x22a9cd=_0x2d8b7c['models'];var _0x4f2b86=_0x2a44d2['get']({'plain':!![]});if(_0x4f2b86[_0xb6d1('0x10')][_0xb6d1('0x11')]()==='in'||_0x4f2b86['direction'][_0xb6d1('0x11')]()===_0xb6d1('0x12')&&!_0x4f2b86['secret']&&!_['isNil'](_0x4f2b86[_0xb6d1('0x13')])){_0x22a9cd['MailInteraction'][_0xb6d1('0x14')]({'where':{'id':_0x4f2b86['MailInteractionId']}})[_0xb6d1('0x15')](function(_0x1de8f6){if(_0x1de8f6){_0x1de8f6[_0xb6d1('0x16')]({'lastMsgAt':_0x4f2b86[_0xb6d1('0x17')],'lastMsgDirection':_0x4f2b86[_0xb6d1('0x10')][_0xb6d1('0x11')]()});}})[_0xb6d1('0x18')](function(_0x22f20c){console[_0xb6d1('0x19')](_0x22f20c);});}_0x5242d7();}},'charset':'utf8mb4','collate':_0xb6d1('0x1a')});}; \ No newline at end of file +var _0x834d=['request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0xd6f9ec,_0x5d6350){var _0x892fb8=function(_0x59d03d){while(--_0x59d03d){_0xd6f9ec['push'](_0xd6f9ec['shift']());}};_0x892fb8(++_0x5d6350);}(_0x834d,0xbc));var _0xd834=function(_0x125e86,_0x2b7b34){_0x125e86=_0x125e86-0x0;var _0x5e373e=_0x834d[_0x125e86];return _0x5e373e;};'use strict';var _=require('lodash');var util=require(_0xd834('0x0'));var logger=require('../../config/logger')(_0xd834('0x1'));var moment=require(_0xd834('0x2'));var BPromise=require(_0xd834('0x3'));var rp=require(_0xd834('0x4'));var htmlToText=require(_0xd834('0x5'));var fs=require('fs');var path=require(_0xd834('0x6'));var rimraf=require(_0xd834('0x7'));var config=require(_0xd834('0x8'));var attributes=require('./mailMessage.attributes');module[_0xd834('0x9')]=function(_0x1127a6,_0x5c47b0){return _0x1127a6['define'](_0xd834('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xd834('0xb'),'fields':[_0xd834('0xb')]},{'name':_0xd834('0xc'),'fields':[_0xd834('0xd'),'subject'],'type':_0xd834('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5adc16,_0x189443,_0x28ecfd){if(_0x5adc16[_0xd834('0xf')]){_0x5adc16[_0xd834('0xd')]=htmlToText[_0xd834('0x10')](_0x5adc16[_0xd834('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x28ecfd(null,_0x189443);},'afterCreate':function(_0x347ebd,_0x386554,_0x47a7bd){var _0x2a85ef=_0x1127a6[_0xd834('0x11')];var _0x859451=_0x347ebd[_0xd834('0x12')]({'plain':!![]});if(_0x859451[_0xd834('0x13')][_0xd834('0x14')]()==='in'||_0x859451[_0xd834('0x13')]['toLowerCase']()==='out'&&!_0x859451[_0xd834('0x15')]&&!_[_0xd834('0x16')](_0x859451[_0xd834('0x17')])){_0x2a85ef[_0xd834('0x18')][_0xd834('0x19')]({'where':{'id':_0x859451[_0xd834('0x1a')]}})['then'](function(_0x2d8b0b){if(_0x2d8b0b){_0x2d8b0b[_0xd834('0x1b')]({'lastMsgAt':_0x859451[_0xd834('0x1c')],'lastMsgDirection':_0x859451[_0xd834('0x13')][_0xd834('0x14')]()});}})[_0xd834('0x1d')](function(_0x4c05e2){console[_0xd834('0x1e')](_0x4c05e2);});}_0x47a7bd();}},'charset':'utf8mb4','collate':_0xd834('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a2c1677..f447dbf 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 _0xeb3b=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','body','options','then','CreateMailMessage','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x8b64d7,_0x47a58d){var _0x4179ed=function(_0x471f81){while(--_0x471f81){_0x8b64d7['push'](_0x8b64d7['shift']());}};_0x4179ed(++_0x47a58d);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1ceb7b,_0x894d3d){_0x1ceb7b=_0x1ceb7b-0x0;var _0x57c016=_0xeb3b[_0x1ceb7b];return _0x57c016;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});config[_0xbeb3('0xa')]=_[_0xbeb3('0xb')](config[_0xbeb3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbeb3('0xc'))(new Redis(config[_0xbeb3('0xa')]));require(_0xbeb3('0xd'))[_0xbeb3('0xe')](socket);function respondWithRpcPromise(_0x443396,_0x550805,_0x10161e){return new BPromise(function(_0x567333,_0x2d1e06){return client[_0xbeb3('0xf')](_0x443396,_0x10161e)['then'](function(_0x1dfff3){logger[_0xbeb3('0x10')](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));logger[_0xbeb3('0x13')](_0xbeb3('0x14'),_0x550805,'request\x20sent',JSON['stringify'](_0x1dfff3));if(_0x1dfff3[_0xbeb3('0x15')]){if(_0x1dfff3[_0xbeb3('0x15')]['code']===0x1f4){logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);return _0x2d1e06(_0x1dfff3[_0xbeb3('0x15')][_0xbeb3('0x16')]);}logger['error'](_0xbeb3('0x11'),_0x550805,_0x1dfff3['error'][_0xbeb3('0x16')]);return _0x567333(_0x1dfff3['error']['message']);}else{logger['info'](_0xbeb3('0x11'),_0x550805,_0xbeb3('0x12'));_0x567333(_0x1dfff3[_0xbeb3('0x17')][_0xbeb3('0x16')]);}})['catch'](function(_0x233a62){logger[_0xbeb3('0x15')](_0xbeb3('0x11'),_0x550805,_0x233a62);_0x2d1e06(_0x233a62);});});}exports['CreateMailMessage']=function(_0x4af96f){var _0x31c1bf=this;return new Promise(function(_0x57e8b6,_0x1d917b){return db['MailMessage']['create'](_0x4af96f[_0xbeb3('0x18')],{'raw':_0x4af96f[_0xbeb3('0x19')]?_0x4af96f[_0xbeb3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbeb3('0x1a')](function(_0x18ea0f){logger['info'](_0xbeb3('0x1b'),_0x4af96f);logger[_0xbeb3('0x13')]('CreateMailMessage',_0x4af96f,JSON[_0xbeb3('0x1c')](_0x18ea0f));_0x57e8b6(_0x18ea0f);})[_0xbeb3('0x1d')](function(_0x16b079){logger[_0xbeb3('0x15')](_0xbeb3('0x1b'),_0x16b079[_0xbeb3('0x16')],_0x4af96f);_0x1d917b(_0x31c1bf[_0xbeb3('0x15')](0x1f4,_0x16b079[_0xbeb3('0x16')]));});});}; \ No newline at end of file +var _0x6d11=['options','raw','CreateMailMessage','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage','create','body'];(function(_0x19614d,_0x1d6e0){var _0x4c5a3f=function(_0x3797aa){while(--_0x3797aa){_0x19614d['push'](_0x19614d['shift']());}};_0x4c5a3f(++_0x1d6e0);}(_0x6d11,0xbf));var _0x16d1=function(_0x157183,_0xcbf204){_0x157183=_0x157183-0x0;var _0x1ad730=_0x6d11[_0x157183];return _0x1ad730;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});}exports['CreateMailMessage']=function(_0x52a0f2){var _0x5b9599=this;return new Promise(function(_0x348425,_0x55a0e0){return db[_0x16d1('0x17')][_0x16d1('0x18')](_0x52a0f2[_0x16d1('0x19')],{'raw':_0x52a0f2[_0x16d1('0x1a')]?_0x52a0f2['options'][_0x16d1('0x1b')]===undefined?!![]:![]:!![]})[_0x16d1('0xf')](function(_0x2a897d){logger['info'](_0x16d1('0x1c'),_0x52a0f2);logger[_0x16d1('0x1d')](_0x16d1('0x1c'),_0x52a0f2,JSON[_0x16d1('0x14')](_0x2a897d));_0x348425(_0x2a897d);})[_0x16d1('0x1e')](function(_0x1448b7){logger[_0x16d1('0x15')](_0x16d1('0x1c'),_0x1448b7[_0x16d1('0x16')],_0x52a0f2);_0x55a0e0(_0x5b9599[_0x16d1('0x15')](0x1f4,_0x1448b7[_0x16d1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b248f47..0d8e3c3 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 _0x0e9f=['register','length','./mailMessage.events','save','emit','removeListener'];(function(_0x1522ca,_0x27cb15){var _0x1b420e=function(_0x2dbe88){while(--_0x2dbe88){_0x1522ca['push'](_0x1522ca['shift']());}};_0x1b420e(++_0x27cb15);}(_0x0e9f,0x116));var _0xf0e9=function(_0x1a30da,_0x361428){_0x1a30da=_0x1a30da-0x0;var _0x6740bb=_0x0e9f[_0x1a30da];return _0x6740bb;};'use strict';var MailMessageEvents=require(_0xf0e9('0x0'));var events=[_0xf0e9('0x1'),'remove','update'];function createListener(_0x15215f,_0x4c067c){return function(_0x4b7f25){_0x4c067c[_0xf0e9('0x2')](_0x15215f,_0x4b7f25);};}function removeListener(_0x559cad,_0x52a19d){return function(){MailMessageEvents[_0xf0e9('0x3')](_0x559cad,_0x52a19d);};}exports[_0xf0e9('0x4')]=function(_0x59ac7e){for(var _0x2322dc=0x0,_0x4a35a3=events[_0xf0e9('0x5')];_0x2322dc<_0x4a35a3;_0x2322dc++){var _0x2fa08f=events[_0x2322dc];var _0x106ba0=createListener('mailMessage:'+_0x2fa08f,_0x59ac7e);MailMessageEvents['on'](_0x2fa08f,_0x106ba0);}}; \ No newline at end of file +var _0x1c5b=['register','length','mailMessage:','remove','update','emit','removeListener'];(function(_0x374470,_0x317765){var _0x297979=function(_0x322dea){while(--_0x322dea){_0x374470['push'](_0x374470['shift']());}};_0x297979(++_0x317765);}(_0x1c5b,0x184));var _0xb1c5=function(_0x1c5ee0,_0x34bba3){_0x1c5ee0=_0x1c5ee0-0x0;var _0x21f8a9=_0x1c5b[_0x1c5ee0];return _0x21f8a9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xb1c5('0x0'),_0xb1c5('0x1')];function createListener(_0x12f471,_0x5ebdd2){return function(_0x57b8af){_0x5ebdd2[_0xb1c5('0x2')](_0x12f471,_0x57b8af);};}function removeListener(_0x50d135,_0x131a47){return function(){MailMessageEvents[_0xb1c5('0x3')](_0x50d135,_0x131a47);};}exports[_0xb1c5('0x4')]=function(_0x2f1a57){for(var _0x4a05e9=0x0,_0x30553a=events[_0xb1c5('0x5')];_0x4a05e9<_0x30553a;_0x4a05e9++){var _0xdacc9a=events[_0x4a05e9];var _0xbe3b85=createListener(_0xb1c5('0x6')+_0xdacc9a,_0x2f1a57);MailMessageEvents['on'](_0xdacc9a,_0xbe3b85);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a5d118b..4a8d5dd 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 _0x68a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x68a8,0x19e));var _0x868a=function(_0x3fdd03,_0x4d01ed){_0x3fdd03=_0x3fdd03-0x0;var _0x4b559f=_0x68a8[_0x3fdd03];return _0x4b559f;};'use strict';var multer=require(_0x868a('0x0'));var util=require(_0x868a('0x1'));var path=require('path');var timeout=require(_0x868a('0x2'));var express=require(_0x868a('0x3'));var router=express[_0x868a('0x4')]();var fs_extra=require(_0x868a('0x5'));var auth=require(_0x868a('0x6'));var interaction=require(_0x868a('0x7'));var config=require(_0x868a('0x8'));var controller=require('./mailQueue.controller');router[_0x868a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x868a('0x9')](_0x868a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x868a('0x9')](_0x868a('0xb'),auth[_0x868a('0xc')](),controller[_0x868a('0xd')]);router[_0x868a('0x9')](_0x868a('0xe'),auth['isAuthenticated'](),controller[_0x868a('0xf')]);router['get'](_0x868a('0x10'),auth[_0x868a('0xc')](),controller[_0x868a('0x11')]);router[_0x868a('0x9')](_0x868a('0x12'),auth[_0x868a('0xc')](),controller[_0x868a('0x13')]);router[_0x868a('0x14')]('/',auth[_0x868a('0xc')](),controller[_0x868a('0x15')]);router['post'](_0x868a('0x10'),auth[_0x868a('0xc')](),controller[_0x868a('0x16')]);router[_0x868a('0x14')](_0x868a('0x12'),auth[_0x868a('0xc')](),controller['addAgents']);router[_0x868a('0x17')](_0x868a('0xb'),auth['isAuthenticated'](),controller[_0x868a('0x18')]);router[_0x868a('0x19')](_0x868a('0xb'),auth[_0x868a('0xc')](),controller[_0x868a('0x1a')]);router[_0x868a('0x19')](_0x868a('0x10'),auth[_0x868a('0xc')](),controller[_0x868a('0x1b')]);router[_0x868a('0x19')](_0x868a('0x12'),auth['isAuthenticated'](),controller[_0x868a('0x1c')]);module[_0x868a('0x1d')]=router; \ No newline at end of file +var _0xa6ca=['../../config/environment','./mailQueue.controller','get','index','isAuthenticated','describe','/:id','show','getMembers','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xc3d9b3,_0x4119b6){var _0x932a04=function(_0x3b47fa){while(--_0x3b47fa){_0xc3d9b3['push'](_0xc3d9b3['shift']());}};_0x932a04(++_0x4119b6);}(_0xa6ca,0xbe));var _0xaa6c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa6ca[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xaa6c('0x0'));var path=require(_0xaa6c('0x1'));var timeout=require(_0xaa6c('0x2'));var express=require(_0xaa6c('0x3'));var router=express['Router']();var fs_extra=require(_0xaa6c('0x4'));var auth=require(_0xaa6c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa6c('0x6'));var controller=require(_0xaa6c('0x7'));router[_0xaa6c('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa6c('0x9')]);router[_0xaa6c('0x8')]('/describe',auth[_0xaa6c('0xa')](),controller[_0xaa6c('0xb')]);router[_0xaa6c('0x8')](_0xaa6c('0xc'),auth[_0xaa6c('0xa')](),controller[_0xaa6c('0xd')]);router[_0xaa6c('0x8')]('/:id/members',auth[_0xaa6c('0xa')](),controller[_0xaa6c('0xe')]);router['get']('/:id/teams',auth[_0xaa6c('0xa')](),controller['getTeams']);router[_0xaa6c('0x8')](_0xaa6c('0xf'),auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x10')]);router[_0xaa6c('0x11')]('/',auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x12')]);router[_0xaa6c('0x11')]('/:id/teams',auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x13')]);router['post']('/:id/users',auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x14')]);router[_0xaa6c('0x15')](_0xaa6c('0xc'),auth['isAuthenticated'](),controller[_0xaa6c('0x16')]);router[_0xaa6c('0x17')](_0xaa6c('0xc'),auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x18')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xaa6c('0x19')]);router[_0xaa6c('0x17')](_0xaa6c('0xf'),auth[_0xaa6c('0xa')](),controller[_0xaa6c('0x1a')]);module[_0xaa6c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4aa4ad9..3490f43 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 _0x88ca=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x383d1e,_0x2be586){var _0xd494b=function(_0x50d212){while(--_0x50d212){_0x383d1e['push'](_0x383d1e['shift']());}};_0xd494b(++_0x2be586);}(_0x88ca,0x14f));var _0xa88c=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x88ca[_0x3c0dcc];return _0x1a224c;};'use strict';var Sequelize=require(_0xa88c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa88c('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa88c('0x1')]},'timeout':{'type':Sequelize[_0xa88c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa88c('0x3')](_0xa88c('0x4'),'beepall',_0xa88c('0x5'))}}; \ No newline at end of file +var _0x95e4=['beepall','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x5ad94d,_0x10797a){var _0x56a639=function(_0x4fc1f1){while(--_0x4fc1f1){_0x5ad94d['push'](_0x5ad94d['shift']());}};_0x56a639(++_0x10797a);}(_0x95e4,0x140));var _0x495e=function(_0x4594fb,_0x337f2a){_0x4594fb=_0x4594fb-0x0;var _0x573a83=_0x95e4[_0x4594fb];return _0x573a83;};'use strict';var Sequelize=require('sequelize');module[_0x495e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x495e('0x1')]},'timeout':{'type':Sequelize[_0x495e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x495e('0x3')]('rrmemory',_0x495e('0x4'),_0x495e('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 5b875f6..56bec76 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 _0xda5d=['findAll','catch','params','MailQueue','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','findAndCountAll','UserId','agent','createdAt','rows','format','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','emit','userMailQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','then','destroy','get','MailQueues','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x1a9c77,_0x109183){var _0x4a7c8e=function(_0x2564c7){while(--_0x2564c7){_0x1a9c77['push'](_0x1a9c77['shift']());}};_0x4a7c8e(++_0x109183);}(_0xda5d,0xc8));var _0xdda5=function(_0x3487e2,_0x3242d8){_0x3487e2=_0x3487e2-0x0;var _0x29bfe0=_0xda5d[_0x3487e2];return _0x29bfe0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda5('0x0'));var zipdir=require(_0xdda5('0x1'));var jsonpatch=require(_0xdda5('0x2'));var rp=require(_0xdda5('0x3'));var moment=require('moment');var BPromise=require(_0xdda5('0x4'));var Mustache=require(_0xdda5('0x5'));var util=require(_0xdda5('0x6'));var path=require('path');var sox=require(_0xdda5('0x7'));var csv=require(_0xdda5('0x8'));var ejs=require(_0xdda5('0x9'));var fs=require('fs');var fs_extra=require(_0xdda5('0xa'));var _=require('lodash');var squel=require(_0xdda5('0xb'));var crypto=require(_0xdda5('0xc'));var jsforce=require(_0xdda5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdda5('0xe'));var Papa=require(_0xdda5('0xf'));var Redis=require('ioredis');var authService=require(_0xdda5('0x10'));var qs=require(_0xdda5('0x11'));var as=require(_0xdda5('0x12'));var hardwareService=require(_0xdda5('0x13'));var logger=require('../../config/logger')(_0xdda5('0x14'));var utils=require('../../config/utils');var config=require(_0xdda5('0x15'));var licenseUtil=require(_0xdda5('0x16'));var db=require(_0xdda5('0x17'))['db'];config[_0xdda5('0x18')]=_[_0xdda5('0x19')](config[_0xdda5('0x18')],{'host':_0xdda5('0x1a'),'port':0x18eb});var socket=require(_0xdda5('0x1b'))(new Redis(config[_0xdda5('0x18')]));require(_0xdda5('0x1c'))[_0xdda5('0x1d')](socket);function respondWithStatusCode(_0x9fade6,_0x35ac30){_0x35ac30=_0x35ac30||0xcc;return function(_0x4770e7){if(_0x4770e7){return _0x9fade6[_0xdda5('0x1e')](_0x35ac30);}return _0x9fade6['status'](_0x35ac30)[_0xdda5('0x1f')]();};}function respondWithResult(_0x535b0a,_0x5aab96){_0x5aab96=_0x5aab96||0xc8;return function(_0x2aa9d2){if(_0x2aa9d2){return _0x535b0a[_0xdda5('0x20')](_0x5aab96)['json'](_0x2aa9d2);}};}function respondWithFilteredResult(_0x200329,_0x58ca6f){return function(_0x9793da){if(_0x9793da){var _0x198acf=typeof _0x58ca6f[_0xdda5('0x21')]==='undefined'&&typeof _0x58ca6f[_0xdda5('0x22')]==='undefined';var _0xf211ec=_0x9793da[_0xdda5('0x23')];var _0x547ab7=_0x198acf?0x0:_0x58ca6f[_0xdda5('0x21')];var _0x3b332a=_0x198acf?_0x9793da['count']:_0x58ca6f['offset']+_0x58ca6f[_0xdda5('0x22')];var _0x546115;if(_0x3b332a>=_0xf211ec){_0x3b332a=_0xf211ec;_0x546115=0xc8;}else{_0x546115=0xce;}_0x200329['status'](_0x546115);return _0x200329['set'](_0xdda5('0x24'),_0x547ab7+'-'+_0x3b332a+'/'+_0xf211ec)[_0xdda5('0x25')](_0x9793da);}return null;};}function patchUpdates(_0x157e78){return function(_0x8fb615){try{jsonpatch[_0xdda5('0x26')](_0x8fb615,_0x157e78,!![]);}catch(_0x6d1849){return BPromise['reject'](_0x6d1849);}return _0x8fb615[_0xdda5('0x27')]();};}function saveUpdates(_0x5126ae,_0x3859c7){return function(_0x4c73cf){if(_0x4c73cf){return _0x4c73cf['update'](_0x5126ae)[_0xdda5('0x28')](function(_0x3e5471){return _0x3e5471;});}return null;};}function removeEntity(_0x1cff1f,_0x5dc4f3){return function(_0x33a608){if(_0x33a608){return _0x33a608[_0xdda5('0x29')]()[_0xdda5('0x28')](function(){var _0x596620=_0x33a608[_0xdda5('0x2a')]({'plain':!![]});var _0x1a3301=_0xdda5('0x2b');return db[_0xdda5('0x2c')]['destroy']({'where':{'type':_0x1a3301,'resourceId':_0x596620['id']}})[_0xdda5('0x28')](function(){return _0x33a608;});})[_0xdda5('0x28')](function(){_0x1cff1f[_0xdda5('0x20')](0xcc)[_0xdda5('0x1f')]();});}};}function handleEntityNotFound(_0x3af3f1,_0x5c01b1){return function(_0x4465e4){if(!_0x4465e4){_0x3af3f1['sendStatus'](0x194);}return _0x4465e4;};}function handleError(_0x11a101,_0x50752c){_0x50752c=_0x50752c||0x1f4;return function(_0x1f36f5){logger[_0xdda5('0x2d')](_0x1f36f5['stack']);if(_0x1f36f5[_0xdda5('0x2e')]){delete _0x1f36f5['name'];}_0x11a101[_0xdda5('0x20')](_0x50752c)[_0xdda5('0x2f')](_0x1f36f5);};}exports[_0xdda5('0x30')]=function(_0x22b9ac,_0x33507f){var _0x2171a8={},_0x1d0739={},_0x4dab7d={'count':0x0,'rows':[]};var _0x5b84c7=_[_0xdda5('0x31')](db['MailQueue'][_0xdda5('0x32')],function(_0x55949e){return{'name':_0x55949e['fieldName'],'type':_0x55949e[_0xdda5('0x33')][_0xdda5('0x34')]};});_0x1d0739['model']=_[_0xdda5('0x31')](_0x5b84c7,_0xdda5('0x2e'));_0x1d0739[_0xdda5('0x35')]=_[_0xdda5('0x36')](_0x22b9ac[_0xdda5('0x35')]);_0x1d0739['filters']=_[_0xdda5('0x37')](_0x1d0739[_0xdda5('0x38')],_0x1d0739['query']);_0x2171a8[_0xdda5('0x39')]=_['intersection'](_0x1d0739[_0xdda5('0x38')],qs[_0xdda5('0x3a')](_0x22b9ac['query'][_0xdda5('0x3a')]));_0x2171a8[_0xdda5('0x39')]=_0x2171a8[_0xdda5('0x39')][_0xdda5('0x3b')]?_0x2171a8[_0xdda5('0x39')]:_0x1d0739[_0xdda5('0x38')];if(!_0x22b9ac[_0xdda5('0x35')][_0xdda5('0x3c')]('nolimit')){_0x2171a8[_0xdda5('0x22')]=qs[_0xdda5('0x22')](_0x22b9ac[_0xdda5('0x35')][_0xdda5('0x22')]);_0x2171a8[_0xdda5('0x21')]=qs['offset'](_0x22b9ac[_0xdda5('0x35')][_0xdda5('0x21')]);}_0x2171a8[_0xdda5('0x3d')]=qs[_0xdda5('0x3e')](_0x22b9ac[_0xdda5('0x35')][_0xdda5('0x3e')]);_0x2171a8[_0xdda5('0x3f')]=qs[_0xdda5('0x40')](_[_0xdda5('0x41')](_0x22b9ac[_0xdda5('0x35')],_0x1d0739['filters']),_0x5b84c7);if(_0x22b9ac[_0xdda5('0x35')]['filter']){_0x2171a8[_0xdda5('0x3f')]=_[_0xdda5('0x42')](_0x2171a8['where'],{'$or':_['map'](_0x5b84c7,function(_0x40c51e){if(_0x40c51e['type']!==_0xdda5('0x43')){var _0x5f0519={};_0x5f0519[_0x40c51e[_0xdda5('0x2e')]]={'$like':'%'+_0x22b9ac['query'][_0xdda5('0x44')]+'%'};return _0x5f0519;}})});}_0x2171a8=_[_0xdda5('0x42')]({},_0x2171a8,_0x22b9ac[_0xdda5('0x45')]);var _0x293b78={'where':_0x2171a8[_0xdda5('0x3f')]};return db['MailQueue'][_0xdda5('0x23')](_0x293b78)[_0xdda5('0x28')](function(_0x3837fb){_0x4dab7d[_0xdda5('0x23')]=_0x3837fb;if(_0x22b9ac[_0xdda5('0x35')]['includeAll']){_0x2171a8['include']=[{'all':!![]}];}return db['MailQueue'][_0xdda5('0x46')](_0x2171a8);})[_0xdda5('0x28')](function(_0x541983){_0x4dab7d['rows']=_0x541983;return _0x4dab7d;})[_0xdda5('0x28')](respondWithFilteredResult(_0x33507f,_0x2171a8))[_0xdda5('0x47')](handleError(_0x33507f,null));};exports['show']=function(_0x28fbea,_0xf88d3f){var _0x55ebbb={'raw':!![],'where':{'id':_0x28fbea[_0xdda5('0x48')]['id']}},_0x11b6a3={};_0x11b6a3[_0xdda5('0x38')]=_['keys'](db[_0xdda5('0x49')]['rawAttributes']);_0x11b6a3['query']=_[_0xdda5('0x36')](_0x28fbea[_0xdda5('0x35')]);_0x11b6a3[_0xdda5('0x40')]=_[_0xdda5('0x37')](_0x11b6a3['model'],_0x11b6a3['query']);_0x55ebbb[_0xdda5('0x39')]=_[_0xdda5('0x37')](_0x11b6a3[_0xdda5('0x38')],qs[_0xdda5('0x3a')](_0x28fbea[_0xdda5('0x35')][_0xdda5('0x3a')]));_0x55ebbb[_0xdda5('0x39')]=_0x55ebbb['attributes'][_0xdda5('0x3b')]?_0x55ebbb[_0xdda5('0x39')]:_0x11b6a3['model'];if(_0x28fbea['query'][_0xdda5('0x4a')]){_0x55ebbb['include']=[{'all':!![]}];}_0x55ebbb=_['merge']({},_0x55ebbb,_0x28fbea[_0xdda5('0x45')]);return db['MailQueue'][_0xdda5('0x4b')](_0x55ebbb)[_0xdda5('0x28')](handleEntityNotFound(_0xf88d3f,null))[_0xdda5('0x28')](respondWithResult(_0xf88d3f,null))['catch'](handleError(_0xf88d3f,null));};exports[_0xdda5('0x4c')]=function(_0x7aacf9,_0x449eb1){return db['MailQueue']['create'](_0x7aacf9[_0xdda5('0x4d')],{})['then'](function(_0x4fc66e){var _0x5630ec=_0x7aacf9[_0xdda5('0x4e')][_0xdda5('0x2a')]({'plain':!![]});if(!_0x5630ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5630ec[_0xdda5('0x4f')]==='user'){var _0x4bd167=_0x4fc66e[_0xdda5('0x2a')]({'plain':!![]});var _0x1153aa=_0xdda5('0x2b');return db[_0xdda5('0x50')][_0xdda5('0x4b')]({'where':{'name':_0x1153aa,'userProfileId':_0x5630ec[_0xdda5('0x51')]},'raw':!![]})[_0xdda5('0x28')](function(_0x59fe4f){if(_0x59fe4f&&_0x59fe4f['autoAssociation']===0x0){return db[_0xdda5('0x2c')]['create']({'name':_0x4bd167['name'],'resourceId':_0x4bd167['id'],'type':_0x59fe4f[_0xdda5('0x2e')],'sectionId':_0x59fe4f['id']},{})[_0xdda5('0x28')](function(){return _0x4fc66e;});}else{return _0x4fc66e;}})[_0xdda5('0x47')](function(_0x48f7e8){logger[_0xdda5('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48f7e8);throw _0x48f7e8;});}return _0x4fc66e;})[_0xdda5('0x28')](respondWithResult(_0x449eb1,0xc9))[_0xdda5('0x47')](handleError(_0x449eb1,null));};exports['update']=function(_0x4dd434,_0x22e89b){if(_0x4dd434[_0xdda5('0x4d')]['id']){delete _0x4dd434[_0xdda5('0x4d')]['id'];}return db[_0xdda5('0x49')][_0xdda5('0x4b')]({'where':{'id':_0x4dd434['params']['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x22e89b,null))['then'](saveUpdates(_0x4dd434[_0xdda5('0x4d')],null))[_0xdda5('0x28')](respondWithResult(_0x22e89b,null))['catch'](handleError(_0x22e89b,null));};exports[_0xdda5('0x29')]=function(_0xb066ac,_0x1e792f){return db[_0xdda5('0x49')][_0xdda5('0x4b')]({'where':{'id':_0xb066ac[_0xdda5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e792f,null))[_0xdda5('0x28')](removeEntity(_0x1e792f,null))[_0xdda5('0x47')](handleError(_0x1e792f,null));};exports[_0xdda5('0x52')]=function(_0x529534,_0x37ba0c){return db[_0xdda5('0x49')][_0xdda5('0x52')]()['then'](respondWithResult(_0x37ba0c,null))[_0xdda5('0x47')](handleError(_0x37ba0c,null));};exports[_0xdda5('0x53')]=function(_0x48c6b6,_0x21f031,_0x5c876f){var _0x3baf66={'raw':!![],'where':{}},_0x22236f={},_0x1eb20b;return db['MailQueue'][_0xdda5('0x54')]({'where':{'id':_0x48c6b6[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x21f031,null))['then'](function(_0x2b4a46){if(_0x2b4a46){_0x1eb20b=_0x2b4a46['get']({'plain':!![]});_0x22236f[_0xdda5('0x38')]=_['keys'](db[_0xdda5('0x55')]['rawAttributes']);_0x22236f[_0xdda5('0x35')]=_['keys'](_0x48c6b6[_0xdda5('0x35')]);_0x22236f[_0xdda5('0x40')]=_[_0xdda5('0x37')](_0x22236f['model'],_0x22236f['query']);_0x3baf66[_0xdda5('0x39')]=_[_0xdda5('0x37')](_0x22236f[_0xdda5('0x38')],qs[_0xdda5('0x3a')](_0x48c6b6[_0xdda5('0x35')][_0xdda5('0x3a')]));_0x3baf66['attributes']=_0x3baf66[_0xdda5('0x39')][_0xdda5('0x3b')]?_0x3baf66[_0xdda5('0x39')]:_0x22236f[_0xdda5('0x38')];if(!_0x48c6b6[_0xdda5('0x35')][_0xdda5('0x3c')](_0xdda5('0x56'))){_0x3baf66['limit']=qs[_0xdda5('0x22')](_0x48c6b6[_0xdda5('0x35')]['limit']);_0x3baf66[_0xdda5('0x21')]=qs[_0xdda5('0x21')](_0x48c6b6[_0xdda5('0x35')]['offset']);}_0x3baf66['order']=qs['sort'](_0x48c6b6['query'][_0xdda5('0x3e')]);_0x3baf66['where']=qs[_0xdda5('0x40')](_['pick'](_0x48c6b6[_0xdda5('0x35')],_0x22236f[_0xdda5('0x40')]));_0x3baf66[_0xdda5('0x3f')][_0xdda5('0x57')]=_0x2b4a46['id'];if(_0x48c6b6[_0xdda5('0x35')][_0xdda5('0x44')]){_0x3baf66[_0xdda5('0x3f')]=_[_0xdda5('0x42')](_0x3baf66['where'],{'$or':_['map'](_0x3baf66['attributes'],function(_0x216a08){var _0x27ffd0={};_0x27ffd0[_0x216a08]={'$like':'%'+_0x48c6b6['query'][_0xdda5('0x44')]+'%'};return _0x27ffd0;})});}_0x3baf66=_['merge']({},_0x3baf66,_0x48c6b6[_0xdda5('0x45')]);return db[_0xdda5('0x55')][_0xdda5('0x46')](_0x3baf66);}})['then'](function(_0x4b06e3){if(_0x4b06e3){return db[_0xdda5('0x58')][_0xdda5('0x59')]({'where':{'id':_[_0xdda5('0x31')](_0x4b06e3,_0xdda5('0x5a')),'role':_0xdda5('0x5b')},'attributes':['id',_0xdda5('0x2e'),'mailPause','updatedAt',_0xdda5('0x5c')]});}})['then'](function(_0x331eec){if(_0x331eec){return{'count':_0x331eec[_0xdda5('0x23')],'rows':_[_0xdda5('0x31')](_0x331eec[_0xdda5('0x5d')],function(_0x3a3108){return{'membername':_0x3a3108[_0xdda5('0x2e')],'UserId':_0x3a3108['id'],'queue_name':_0x1eb20b[_0xdda5('0x2e')],'MailQueueId':_0x1eb20b['id'],'interface':util[_0xdda5('0x5e')](_0xdda5('0x5f'),_0xdda5('0x60'),_0x3a3108[_0xdda5('0x2e')]),'penalty':0x0,'paused':_0x3a3108[_0xdda5('0x61')],'createdAt':_0x3a3108['createdAt'],'updatedAt':_0x3a3108[_0xdda5('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdda5('0x28')](respondWithFilteredResult(_0x21f031,_0x3baf66))[_0xdda5('0x47')](handleError(_0x21f031,null));};exports[_0xdda5('0x63')]=function(_0x58aad2,_0x3aa873,_0x28f3f0){var _0xd7da3f={};var _0x51e010={};var _0x20436c;var _0x4cd896;return db['MailQueue'][_0xdda5('0x54')]({'where':{'id':_0x58aad2[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x3aa873,null))['then'](function(_0x2af109){if(_0x2af109){_0x20436c=_0x2af109;_0x51e010['model']=_[_0xdda5('0x36')](db[_0xdda5('0x64')][_0xdda5('0x32')]);_0x51e010['query']=_[_0xdda5('0x36')](_0x58aad2['query']);_0x51e010['filters']=_['intersection'](_0x51e010[_0xdda5('0x38')],_0x51e010['query']);_0xd7da3f[_0xdda5('0x39')]=_['intersection'](_0x51e010[_0xdda5('0x38')],qs['fields'](_0x58aad2[_0xdda5('0x35')]['fields']));_0xd7da3f['attributes']=_0xd7da3f[_0xdda5('0x39')][_0xdda5('0x3b')]?_0xd7da3f[_0xdda5('0x39')]:_0x51e010[_0xdda5('0x38')];_0xd7da3f[_0xdda5('0x3d')]=qs[_0xdda5('0x3e')](_0x58aad2[_0xdda5('0x35')][_0xdda5('0x3e')]);_0xd7da3f[_0xdda5('0x3f')]=qs[_0xdda5('0x40')](_['pick'](_0x58aad2[_0xdda5('0x35')],_0x51e010[_0xdda5('0x40')]));if(_0x58aad2[_0xdda5('0x35')][_0xdda5('0x44')]){_0xd7da3f['where']=_[_0xdda5('0x42')](_0xd7da3f['where'],{'$or':_['map'](_0xd7da3f[_0xdda5('0x39')],function(_0x3f2c1c){var _0x3b986b={};_0x3b986b[_0x3f2c1c]={'$like':'%'+_0x58aad2[_0xdda5('0x35')][_0xdda5('0x44')]+'%'};return _0x3b986b;})});}_0xd7da3f=_[_0xdda5('0x42')]({},_0xd7da3f,_0x58aad2[_0xdda5('0x45')]);return _0x20436c[_0xdda5('0x63')](_0xd7da3f);}})[_0xdda5('0x28')](function(_0xd18e8f){if(_0xd18e8f){_0x4cd896=_0xd18e8f[_0xdda5('0x3b')];if(!_0x58aad2[_0xdda5('0x35')]['hasOwnProperty'](_0xdda5('0x56'))){_0xd7da3f['limit']=qs[_0xdda5('0x22')](_0x58aad2[_0xdda5('0x35')][_0xdda5('0x22')]);_0xd7da3f['offset']=qs[_0xdda5('0x21')](_0x58aad2[_0xdda5('0x35')][_0xdda5('0x21')]);}return _0x20436c[_0xdda5('0x63')](_0xd7da3f);}})[_0xdda5('0x28')](function(_0x5dbee8){if(_0x5dbee8){return _0x5dbee8?{'count':_0x4cd896,'rows':_0x5dbee8}:null;}})[_0xdda5('0x28')](respondWithResult(_0x3aa873,null))['catch'](handleError(_0x3aa873,null));};exports[_0xdda5('0x65')]=function(_0x1e784e,_0x2eae12,_0x3fb6f1){var _0x4c2227=_0x1e784e[_0xdda5('0x4d')][_0xdda5('0x66')];return db[_0xdda5('0x64')]['findAll']({'where':{'id':_0x4c2227},'attributes':['id'],'include':[{'model':db[_0xdda5('0x58')],'as':_0xdda5('0x67'),'attributes':['id',_0xdda5('0x2e'),_0xdda5('0x68'),_0xdda5('0x69'),'interface'],'raw':!![]}]})[_0xdda5('0x28')](function(_0x39d68b){if(_0x39d68b){var _0xe5b4f7=_[_0xdda5('0x6a')](_0x39d68b,function(_0x4aa1dc){var _0x384040=_0x4aa1dc[_0xdda5('0x2a')]({'plain':!![]});return _0x384040[_0xdda5('0x67')];});return db['MailQueue']['find']({'where':{'id':_0x1e784e[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](function(_0x55325f){return db['sequelize']['transaction'](function(_0x1c1efc){return _0x55325f['addTeams'](_0x4c2227,{'transaction':_0x1c1efc})[_0xdda5('0x28')](function(){return BPromise[_0xdda5('0x6b')](_0xe5b4f7,function(_0x1a1019){return db['UserMailQueue'][_0xdda5('0x6c')]({'where':{'UserId':_0x1a1019['id'],'MailQueueId':_0x1e784e[_0xdda5('0x48')]['id']},'transaction':_0x1c1efc});});})[_0xdda5('0x28')](function(){_0xe5b4f7[_0xdda5('0x6d')](function(_0xece6b0){socket['emit']('userMailQueue:save',{'UserId':_0xece6b0['id'],'MailQueueId':_0x55325f['id']});});});});});}})[_0xdda5('0x28')](respondWithStatusCode(_0x2eae12,null))[_0xdda5('0x47')](handleError(_0x2eae12,null));};exports[_0xdda5('0x6e')]=function(_0x39dd36,_0x452577,_0x3bd1d4){return db[_0xdda5('0x64')][_0xdda5('0x46')]({'where':{'id':_0x39dd36['query'][_0xdda5('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdda5('0x28')](handleEntityNotFound(_0x452577,null))['then'](function(_0x47b1db){var _0x4f8861=_['map'](_0x47b1db,'id');var _0x55a013=[];var _0x447aad=[];var _0x5a873a=squel[_0xdda5('0x6f')]();_0x5a873a[_0xdda5('0x70')](_0xdda5('0x71'))['from'](_0xdda5('0x72'),'tq')[_0xdda5('0x73')]('user_has_teams','ut',_0xdda5('0x74'))[_0xdda5('0x3f')]('MailQueueId\x20=\x20?',_0x39dd36[_0xdda5('0x48')]['id']);for(var _0x1ca019=0x0;_0x1ca019<_0x47b1db[_0xdda5('0x3b')];_0x1ca019+=0x1){let _0x64d42a=_0x47b1db[_0x1ca019];for(var _0x360774=0x0;_0x360774<_0x64d42a[_0xdda5('0x67')]['length'];_0x360774+=0x1){let _0x1683e5=_0x64d42a[_0xdda5('0x67')][_0x360774];var _0x34f726=_0x5a873a[_0xdda5('0x75')]();_0x34f726[_0xdda5('0x3f')](_0xdda5('0x76'),_0x1683e5['id']);_0x447aad[_0xdda5('0x77')](db['sequelize']['query'](_0x34f726[_0xdda5('0x78')](),{'type':db[_0xdda5('0x79')][_0xdda5('0x7a')][_0xdda5('0x7b')]})['then'](function(_0x20a53e){if(_0x20a53e[_0xdda5('0x3b')]===0x1){return _0x1683e5['id'];}else{var _0x7168f1=_['every'](_['map'](_0x20a53e,'TeamId'),function(_0x429a1e){return _['includes'](_0x4f8861,_0x429a1e);});if(_0x7168f1){return _0x1683e5['id'];}}}));}}return BPromise[_0xdda5('0x7c')](_0x447aad)['then'](function(_0x40ea23){_0x55a013=_(_0x55a013)[_0xdda5('0x7d')](_0x40ea23)['compact']()[_0xdda5('0x7e')]();return db[_0xdda5('0x49')][_0xdda5('0x4b')]({'where':{'id':_0x39dd36[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](function(_0x46273f){return db[_0xdda5('0x79')]['transaction'](function(_0x23c3db){return _0x46273f[_0xdda5('0x6e')](_0x39dd36[_0xdda5('0x35')]['ids'],{'transaction':_0x23c3db})[_0xdda5('0x28')](function(){if(!_[_0xdda5('0x7f')](_0x55a013)){return _0x46273f[_0xdda5('0x80')](_0x55a013,{'transaction':_0x23c3db});}})[_0xdda5('0x28')](function(){_0x55a013[_0xdda5('0x6d')](function(_0x39f924){socket['emit']('userMailQueue:remove',{'UserId':_0x39f924,'MailQueueId':_0x46273f['id']});});});});});});})[_0xdda5('0x28')](respondWithStatusCode(_0x452577,null))['catch'](handleError(_0x452577,null));};exports[_0xdda5('0x81')]=function(_0x5577bd,_0x24e9a9,_0x5aaca2){return db['MailQueue'][_0xdda5('0x4b')]({'where':{'id':_0x5577bd[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x24e9a9,null))['then'](function(_0x41a291){if(_0x41a291){return _0x41a291[_0xdda5('0x81')](_0x5577bd[_0xdda5('0x4d')][_0xdda5('0x66')],_[_0xdda5('0x82')](_0x5577bd[_0xdda5('0x4d')],[_0xdda5('0x66'),'id'])||{})[_0xdda5('0x83')](function(_0x5b63f1){for(var _0x260ad6=0x0;_0x260ad6<_0x5577bd[_0xdda5('0x4d')][_0xdda5('0x66')][_0xdda5('0x3b')];_0x260ad6+=0x1){socket[_0xdda5('0x84')]('userMailQueue:save',{'UserId':Number(_0x5577bd[_0xdda5('0x4d')][_0xdda5('0x66')][_0x260ad6]),'MailQueueId':Number(_0x5577bd[_0xdda5('0x48')]['id'])});}return _0x5b63f1;});}})[_0xdda5('0x28')](respondWithResult(_0x24e9a9,null))[_0xdda5('0x47')](handleError(_0x24e9a9,null));};exports[_0xdda5('0x80')]=function(_0x23fe1d,_0x3017ef,_0x46d63c){return db[_0xdda5('0x49')][_0xdda5('0x4b')]({'where':{'id':_0x23fe1d[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x3017ef,null))[_0xdda5('0x28')](function(_0x5e324c){if(_0x5e324c){return _0x5e324c[_0xdda5('0x80')](_0x23fe1d['query'][_0xdda5('0x66')])[_0xdda5('0x28')](function(){if(_['isArray'](_0x23fe1d[_0xdda5('0x35')][_0xdda5('0x66')])){for(var _0x117d34=0x0;_0x117d34<_0x23fe1d[_0xdda5('0x35')][_0xdda5('0x66')][_0xdda5('0x3b')];_0x117d34+=0x1){socket[_0xdda5('0x84')](_0xdda5('0x85'),{'UserId':Number(_0x23fe1d['query'][_0xdda5('0x66')][_0x117d34]),'MailQueueId':Number(_0x23fe1d[_0xdda5('0x48')]['id'])});}}else{socket[_0xdda5('0x84')](_0xdda5('0x85'),{'UserId':Number(_0x23fe1d[_0xdda5('0x35')]['ids']),'MailQueueId':Number(_0x23fe1d[_0xdda5('0x48')]['id'])});}});}})[_0xdda5('0x28')](respondWithStatusCode(_0x3017ef,null))[_0xdda5('0x47')](handleError(_0x3017ef,null));};exports[_0xdda5('0x86')]=function(_0x2b762e,_0x2a6572,_0x4cc540){var _0x4e42b6={};var _0x2f1d29={};var _0x174d0d;var _0x8e14cd;return db['MailQueue'][_0xdda5('0x54')]({'where':{'id':_0x2b762e[_0xdda5('0x48')]['id']}})[_0xdda5('0x28')](handleEntityNotFound(_0x2a6572,null))['then'](function(_0x1d7c3a){if(_0x1d7c3a){_0x174d0d=_0x1d7c3a;_0x2f1d29[_0xdda5('0x38')]=_['keys'](db[_0xdda5('0x58')][_0xdda5('0x32')]);_0x2f1d29['query']=_[_0xdda5('0x36')](_0x2b762e[_0xdda5('0x35')]);_0x2f1d29['filters']=_['intersection'](_0x2f1d29[_0xdda5('0x38')],_0x2f1d29[_0xdda5('0x35')]);_0x4e42b6[_0xdda5('0x39')]=_[_0xdda5('0x37')](_0x2f1d29[_0xdda5('0x38')],qs[_0xdda5('0x3a')](_0x2b762e['query'][_0xdda5('0x3a')]));_0x4e42b6[_0xdda5('0x39')]=_0x4e42b6[_0xdda5('0x39')][_0xdda5('0x3b')]?_0x4e42b6[_0xdda5('0x39')]:_0x2f1d29['model'];_0x4e42b6['order']=qs[_0xdda5('0x3e')](_0x2b762e[_0xdda5('0x35')][_0xdda5('0x3e')]);_0x4e42b6[_0xdda5('0x3f')]=qs[_0xdda5('0x40')](_[_0xdda5('0x41')](_0x2b762e[_0xdda5('0x35')],_0x2f1d29[_0xdda5('0x40')]));if(_0x2b762e[_0xdda5('0x35')][_0xdda5('0x44')]){_0x4e42b6[_0xdda5('0x3f')]=_[_0xdda5('0x42')](_0x4e42b6[_0xdda5('0x3f')],{'$or':_['map'](_0x4e42b6['attributes'],function(_0x3f3a33){var _0x560212={};_0x560212[_0x3f3a33]={'$like':'%'+_0x2b762e[_0xdda5('0x35')][_0xdda5('0x44')]+'%'};return _0x560212;})});}_0x4e42b6=_[_0xdda5('0x42')]({},_0x4e42b6,_0x2b762e[_0xdda5('0x45')]);return _0x174d0d[_0xdda5('0x86')](_0x4e42b6);}})[_0xdda5('0x28')](function(_0x3e6a9b){if(_0x3e6a9b){_0x8e14cd=_0x3e6a9b[_0xdda5('0x3b')];if(!_0x2b762e[_0xdda5('0x35')][_0xdda5('0x3c')]('nolimit')){_0x4e42b6[_0xdda5('0x22')]=qs[_0xdda5('0x22')](_0x2b762e[_0xdda5('0x35')][_0xdda5('0x22')]);_0x4e42b6[_0xdda5('0x21')]=qs[_0xdda5('0x21')](_0x2b762e[_0xdda5('0x35')]['offset']);}return _0x174d0d[_0xdda5('0x86')](_0x4e42b6);}})[_0xdda5('0x28')](function(_0x3e5356){if(_0x3e5356){return _0x3e5356?{'count':_0x8e14cd,'rows':_0x3e5356}:null;}})[_0xdda5('0x28')](respondWithResult(_0x2a6572,null))[_0xdda5('0x47')](handleError(_0x2a6572,null));}; \ No newline at end of file +var _0xaac5=['removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','get','destroy','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','params','keys','find','catch','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','filter','User','findAndCountAll','mailPause','updatedAt','rows','%s/%s','createdAt','getTeams','Team','order','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty'];(function(_0xb0a6ac,_0x5682d2){var _0x317518=function(_0x178447){while(--_0x178447){_0xb0a6ac['push'](_0xb0a6ac['shift']());}};_0x317518(++_0x5682d2);}(_0xaac5,0x1b5));var _0x5aac=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xaac5[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aac('0x0'));var zipdir=require(_0x5aac('0x1'));var jsonpatch=require(_0x5aac('0x2'));var rp=require(_0x5aac('0x3'));var moment=require(_0x5aac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5aac('0x5'));var util=require(_0x5aac('0x6'));var path=require(_0x5aac('0x7'));var sox=require(_0x5aac('0x8'));var csv=require(_0x5aac('0x9'));var ejs=require(_0x5aac('0xa'));var fs=require('fs');var fs_extra=require(_0x5aac('0xb'));var _=require(_0x5aac('0xc'));var squel=require('squel');var crypto=require(_0x5aac('0xd'));var jsforce=require(_0x5aac('0xe'));var deskjs=require(_0x5aac('0xf'));var toCsv=require(_0x5aac('0x9'));var querystring=require(_0x5aac('0x10'));var Papa=require(_0x5aac('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5aac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5aac('0x13'));var logger=require(_0x5aac('0x14'))(_0x5aac('0x15'));var utils=require(_0x5aac('0x16'));var config=require(_0x5aac('0x17'));var licenseUtil=require(_0x5aac('0x18'));var db=require(_0x5aac('0x19'))['db'];config[_0x5aac('0x1a')]=_['defaults'](config[_0x5aac('0x1a')],{'host':_0x5aac('0x1b'),'port':0x18eb});var socket=require(_0x5aac('0x1c'))(new Redis(config[_0x5aac('0x1a')]));require(_0x5aac('0x1d'))[_0x5aac('0x1e')](socket);function respondWithStatusCode(_0x3dbb24,_0x5090ff){_0x5090ff=_0x5090ff||0xcc;return function(_0x331734){if(_0x331734){return _0x3dbb24[_0x5aac('0x1f')](_0x5090ff);}return _0x3dbb24[_0x5aac('0x20')](_0x5090ff)[_0x5aac('0x21')]();};}function respondWithResult(_0x28c5f6,_0x348c45){_0x348c45=_0x348c45||0xc8;return function(_0x1b991d){if(_0x1b991d){return _0x28c5f6['status'](_0x348c45)[_0x5aac('0x22')](_0x1b991d);}};}function respondWithFilteredResult(_0x22991c,_0xbcdbdf){return function(_0xef5217){if(_0xef5217){var _0x992b1a=typeof _0xbcdbdf['offset']===_0x5aac('0x23')&&typeof _0xbcdbdf[_0x5aac('0x24')]===_0x5aac('0x23');var _0x253e7c=_0xef5217[_0x5aac('0x25')];var _0x3e96dd=_0x992b1a?0x0:_0xbcdbdf[_0x5aac('0x26')];var _0x4f617a=_0x992b1a?_0xef5217[_0x5aac('0x25')]:_0xbcdbdf[_0x5aac('0x26')]+_0xbcdbdf['limit'];var _0x760c37;if(_0x4f617a>=_0x253e7c){_0x4f617a=_0x253e7c;_0x760c37=0xc8;}else{_0x760c37=0xce;}_0x22991c[_0x5aac('0x20')](_0x760c37);return _0x22991c[_0x5aac('0x27')](_0x5aac('0x28'),_0x3e96dd+'-'+_0x4f617a+'/'+_0x253e7c)[_0x5aac('0x22')](_0xef5217);}return null;};}function patchUpdates(_0x366387){return function(_0x1a5fbd){try{jsonpatch[_0x5aac('0x29')](_0x1a5fbd,_0x366387,!![]);}catch(_0x270b96){return BPromise['reject'](_0x270b96);}return _0x1a5fbd['save']();};}function saveUpdates(_0x171b82,_0x1510b3){return function(_0x2e4ed3){if(_0x2e4ed3){return _0x2e4ed3[_0x5aac('0x2a')](_0x171b82)['then'](function(_0x525a76){return _0x525a76;});}return null;};}function removeEntity(_0x24b8f1,_0x230bc3){return function(_0xe62ac1){if(_0xe62ac1){return _0xe62ac1['destroy']()[_0x5aac('0x2b')](function(){var _0x485612=_0xe62ac1[_0x5aac('0x2c')]({'plain':!![]});var _0x5f3915='MailQueues';return db['UserProfileResource'][_0x5aac('0x2d')]({'where':{'type':_0x5f3915,'resourceId':_0x485612['id']}})[_0x5aac('0x2b')](function(){return _0xe62ac1;});})[_0x5aac('0x2b')](function(){_0x24b8f1[_0x5aac('0x20')](0xcc)[_0x5aac('0x21')]();});}};}function handleEntityNotFound(_0x180fef,_0x9171cc){return function(_0x52432e){if(!_0x52432e){_0x180fef[_0x5aac('0x1f')](0x194);}return _0x52432e;};}function handleError(_0x5d0c0e,_0x43eb03){_0x43eb03=_0x43eb03||0x1f4;return function(_0x40b14c){logger['error'](_0x40b14c[_0x5aac('0x2e')]);if(_0x40b14c[_0x5aac('0x2f')]){delete _0x40b14c[_0x5aac('0x2f')];}_0x5d0c0e[_0x5aac('0x20')](_0x43eb03)[_0x5aac('0x30')](_0x40b14c);};}exports[_0x5aac('0x31')]=function(_0x201d68,_0x165ed8){var _0xd4d85c={},_0x391db0={},_0x3993ee={'count':0x0,'rows':[]};var _0x3051e1=_['map'](db[_0x5aac('0x32')][_0x5aac('0x33')],function(_0x1ac35e){return{'name':_0x1ac35e[_0x5aac('0x34')],'type':_0x1ac35e[_0x5aac('0x35')][_0x5aac('0x36')]};});_0x391db0[_0x5aac('0x37')]=_[_0x5aac('0x38')](_0x3051e1,_0x5aac('0x2f'));_0x391db0[_0x5aac('0x39')]=_['keys'](_0x201d68['query']);_0x391db0[_0x5aac('0x3a')]=_['intersection'](_0x391db0[_0x5aac('0x37')],_0x391db0[_0x5aac('0x39')]);_0xd4d85c[_0x5aac('0x3b')]=_[_0x5aac('0x3c')](_0x391db0['model'],qs[_0x5aac('0x3d')](_0x201d68['query'][_0x5aac('0x3d')]));_0xd4d85c['attributes']=_0xd4d85c['attributes'][_0x5aac('0x3e')]?_0xd4d85c[_0x5aac('0x3b')]:_0x391db0[_0x5aac('0x37')];if(!_0x201d68[_0x5aac('0x39')][_0x5aac('0x3f')](_0x5aac('0x40'))){_0xd4d85c[_0x5aac('0x24')]=qs[_0x5aac('0x24')](_0x201d68['query']['limit']);_0xd4d85c[_0x5aac('0x26')]=qs[_0x5aac('0x26')](_0x201d68[_0x5aac('0x39')][_0x5aac('0x26')]);}_0xd4d85c['order']=qs[_0x5aac('0x41')](_0x201d68[_0x5aac('0x39')]['sort']);_0xd4d85c[_0x5aac('0x42')]=qs[_0x5aac('0x3a')](_['pick'](_0x201d68['query'],_0x391db0[_0x5aac('0x3a')]),_0x3051e1);if(_0x201d68[_0x5aac('0x39')]['filter']){_0xd4d85c['where']=_[_0x5aac('0x43')](_0xd4d85c['where'],{'$or':_[_0x5aac('0x38')](_0x3051e1,function(_0x50d0de){if(_0x50d0de[_0x5aac('0x35')]!==_0x5aac('0x44')){var _0x34ef65={};_0x34ef65[_0x50d0de[_0x5aac('0x2f')]]={'$like':'%'+_0x201d68[_0x5aac('0x39')]['filter']+'%'};return _0x34ef65;}})});}_0xd4d85c=_['merge']({},_0xd4d85c,_0x201d68[_0x5aac('0x45')]);var _0x2a5fc7={'where':_0xd4d85c[_0x5aac('0x42')]};return db['MailQueue'][_0x5aac('0x25')](_0x2a5fc7)['then'](function(_0x55dea2){_0x3993ee[_0x5aac('0x25')]=_0x55dea2;if(_0x201d68[_0x5aac('0x39')]['includeAll']){_0xd4d85c[_0x5aac('0x46')]=[{'all':!![]}];}return db[_0x5aac('0x32')][_0x5aac('0x47')](_0xd4d85c);})[_0x5aac('0x2b')](function(_0x19ace6){_0x3993ee['rows']=_0x19ace6;return _0x3993ee;})[_0x5aac('0x2b')](respondWithFilteredResult(_0x165ed8,_0xd4d85c))['catch'](handleError(_0x165ed8,null));};exports['show']=function(_0x1bde32,_0x5419a5){var _0x479482={'raw':!![],'where':{'id':_0x1bde32[_0x5aac('0x48')]['id']}},_0x829f04={};_0x829f04[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x32')][_0x5aac('0x33')]);_0x829f04[_0x5aac('0x39')]=_[_0x5aac('0x49')](_0x1bde32[_0x5aac('0x39')]);_0x829f04[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x829f04[_0x5aac('0x37')],_0x829f04[_0x5aac('0x39')]);_0x479482['attributes']=_[_0x5aac('0x3c')](_0x829f04['model'],qs['fields'](_0x1bde32[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x479482[_0x5aac('0x3b')]=_0x479482['attributes'][_0x5aac('0x3e')]?_0x479482[_0x5aac('0x3b')]:_0x829f04[_0x5aac('0x37')];if(_0x1bde32[_0x5aac('0x39')]['includeAll']){_0x479482[_0x5aac('0x46')]=[{'all':!![]}];}_0x479482=_['merge']({},_0x479482,_0x1bde32[_0x5aac('0x45')]);return db[_0x5aac('0x32')][_0x5aac('0x4a')](_0x479482)['then'](handleEntityNotFound(_0x5419a5,null))[_0x5aac('0x2b')](respondWithResult(_0x5419a5,null))[_0x5aac('0x4b')](handleError(_0x5419a5,null));};exports[_0x5aac('0x4c')]=function(_0x3abfe0,_0x5699d0){return db['MailQueue'][_0x5aac('0x4c')](_0x3abfe0[_0x5aac('0x4d')],{})['then'](function(_0x2e1456){var _0x148391=_0x3abfe0[_0x5aac('0x4e')]['get']({'plain':!![]});if(!_0x148391)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x148391[_0x5aac('0x4f')]==='user'){var _0x2c16d3=_0x2e1456[_0x5aac('0x2c')]({'plain':!![]});var _0x5ad188='MailQueues';return db[_0x5aac('0x50')][_0x5aac('0x4a')]({'where':{'name':_0x5ad188,'userProfileId':_0x148391[_0x5aac('0x51')]},'raw':!![]})[_0x5aac('0x2b')](function(_0x359247){if(_0x359247&&_0x359247['autoAssociation']===0x0){return db[_0x5aac('0x52')][_0x5aac('0x4c')]({'name':_0x2c16d3['name'],'resourceId':_0x2c16d3['id'],'type':_0x359247['name'],'sectionId':_0x359247['id']},{})[_0x5aac('0x2b')](function(){return _0x2e1456;});}else{return _0x2e1456;}})['catch'](function(_0x340c2f){logger[_0x5aac('0x53')](_0x5aac('0x54'),_0x340c2f);throw _0x340c2f;});}return _0x2e1456;})[_0x5aac('0x2b')](respondWithResult(_0x5699d0,0xc9))[_0x5aac('0x4b')](handleError(_0x5699d0,null));};exports[_0x5aac('0x2a')]=function(_0x43f8e0,_0x2e5824){if(_0x43f8e0[_0x5aac('0x4d')]['id']){delete _0x43f8e0[_0x5aac('0x4d')]['id'];}return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x43f8e0[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x2e5824,null))[_0x5aac('0x2b')](saveUpdates(_0x43f8e0[_0x5aac('0x4d')],null))[_0x5aac('0x2b')](respondWithResult(_0x2e5824,null))['catch'](handleError(_0x2e5824,null));};exports['destroy']=function(_0x136408,_0x31c7f7){return db['MailQueue']['find']({'where':{'id':_0x136408[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x31c7f7,null))['then'](removeEntity(_0x31c7f7,null))[_0x5aac('0x4b')](handleError(_0x31c7f7,null));};exports['describe']=function(_0x381800,_0x2383fa){return db[_0x5aac('0x32')][_0x5aac('0x55')]()[_0x5aac('0x2b')](respondWithResult(_0x2383fa,null))[_0x5aac('0x4b')](handleError(_0x2383fa,null));};exports[_0x5aac('0x56')]=function(_0x4659d2,_0x1f7b86,_0x220b0b){var _0x310445={'raw':!![],'where':{}},_0x36a426={},_0xa1bde3;return db['MailQueue'][_0x5aac('0x57')]({'where':{'id':_0x4659d2[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x1f7b86,null))['then'](function(_0x5a0366){if(_0x5a0366){_0xa1bde3=_0x5a0366[_0x5aac('0x2c')]({'plain':!![]});_0x36a426[_0x5aac('0x37')]=_['keys'](db[_0x5aac('0x58')]['rawAttributes']);_0x36a426[_0x5aac('0x39')]=_['keys'](_0x4659d2[_0x5aac('0x39')]);_0x36a426[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x36a426[_0x5aac('0x37')],_0x36a426['query']);_0x310445[_0x5aac('0x3b')]=_[_0x5aac('0x3c')](_0x36a426[_0x5aac('0x37')],qs[_0x5aac('0x3d')](_0x4659d2['query'][_0x5aac('0x3d')]));_0x310445[_0x5aac('0x3b')]=_0x310445[_0x5aac('0x3b')][_0x5aac('0x3e')]?_0x310445[_0x5aac('0x3b')]:_0x36a426['model'];if(!_0x4659d2[_0x5aac('0x39')]['hasOwnProperty'](_0x5aac('0x40'))){_0x310445['limit']=qs['limit'](_0x4659d2[_0x5aac('0x39')][_0x5aac('0x24')]);_0x310445['offset']=qs['offset'](_0x4659d2[_0x5aac('0x39')][_0x5aac('0x26')]);}_0x310445['order']=qs['sort'](_0x4659d2['query'][_0x5aac('0x41')]);_0x310445['where']=qs['filters'](_[_0x5aac('0x59')](_0x4659d2[_0x5aac('0x39')],_0x36a426[_0x5aac('0x3a')]));_0x310445[_0x5aac('0x42')][_0x5aac('0x5a')]=_0x5a0366['id'];if(_0x4659d2[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x310445[_0x5aac('0x42')]=_[_0x5aac('0x43')](_0x310445['where'],{'$or':_['map'](_0x310445['attributes'],function(_0x42c18f){var _0x347eee={};_0x347eee[_0x42c18f]={'$like':'%'+_0x4659d2['query']['filter']+'%'};return _0x347eee;})});}_0x310445=_[_0x5aac('0x43')]({},_0x310445,_0x4659d2['options']);return db['UserMailQueue'][_0x5aac('0x47')](_0x310445);}})[_0x5aac('0x2b')](function(_0x991684){if(_0x991684){return db[_0x5aac('0x5c')][_0x5aac('0x5d')]({'where':{'id':_[_0x5aac('0x38')](_0x991684,'UserId'),'role':'agent'},'attributes':['id',_0x5aac('0x2f'),_0x5aac('0x5e'),_0x5aac('0x5f'),'createdAt']});}})[_0x5aac('0x2b')](function(_0x10ea25){if(_0x10ea25){return{'count':_0x10ea25[_0x5aac('0x25')],'rows':_['map'](_0x10ea25[_0x5aac('0x60')],function(_0x1e5cbb){return{'membername':_0x1e5cbb[_0x5aac('0x2f')],'UserId':_0x1e5cbb['id'],'queue_name':_0xa1bde3['name'],'MailQueueId':_0xa1bde3['id'],'interface':util['format'](_0x5aac('0x61'),'SIP',_0x1e5cbb[_0x5aac('0x2f')]),'penalty':0x0,'paused':_0x1e5cbb[_0x5aac('0x5e')],'createdAt':_0x1e5cbb[_0x5aac('0x62')],'updatedAt':_0x1e5cbb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5aac('0x2b')](respondWithFilteredResult(_0x1f7b86,_0x310445))[_0x5aac('0x4b')](handleError(_0x1f7b86,null));};exports[_0x5aac('0x63')]=function(_0x35db7f,_0xce6c04,_0x49a619){var _0x5d4662={};var _0x2d9ca1={};var _0x472aef;var _0x310c75;return db['MailQueue'][_0x5aac('0x57')]({'where':{'id':_0x35db7f[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0xce6c04,null))[_0x5aac('0x2b')](function(_0x1d9267){if(_0x1d9267){_0x472aef=_0x1d9267;_0x2d9ca1[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x64')][_0x5aac('0x33')]);_0x2d9ca1[_0x5aac('0x39')]=_[_0x5aac('0x49')](_0x35db7f['query']);_0x2d9ca1[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x2d9ca1['model'],_0x2d9ca1[_0x5aac('0x39')]);_0x5d4662[_0x5aac('0x3b')]=_['intersection'](_0x2d9ca1[_0x5aac('0x37')],qs[_0x5aac('0x3d')](_0x35db7f[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x5d4662[_0x5aac('0x3b')]=_0x5d4662['attributes'][_0x5aac('0x3e')]?_0x5d4662[_0x5aac('0x3b')]:_0x2d9ca1[_0x5aac('0x37')];_0x5d4662[_0x5aac('0x65')]=qs[_0x5aac('0x41')](_0x35db7f[_0x5aac('0x39')][_0x5aac('0x41')]);_0x5d4662[_0x5aac('0x42')]=qs['filters'](_['pick'](_0x35db7f[_0x5aac('0x39')],_0x2d9ca1[_0x5aac('0x3a')]));if(_0x35db7f[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x5d4662[_0x5aac('0x42')]=_['merge'](_0x5d4662['where'],{'$or':_[_0x5aac('0x38')](_0x5d4662[_0x5aac('0x3b')],function(_0x1cf04b){var _0x2d424f={};_0x2d424f[_0x1cf04b]={'$like':'%'+_0x35db7f[_0x5aac('0x39')][_0x5aac('0x5b')]+'%'};return _0x2d424f;})});}_0x5d4662=_[_0x5aac('0x43')]({},_0x5d4662,_0x35db7f[_0x5aac('0x45')]);return _0x472aef[_0x5aac('0x63')](_0x5d4662);}})[_0x5aac('0x2b')](function(_0x45a3fb){if(_0x45a3fb){_0x310c75=_0x45a3fb[_0x5aac('0x3e')];if(!_0x35db7f[_0x5aac('0x39')][_0x5aac('0x3f')](_0x5aac('0x40'))){_0x5d4662['limit']=qs[_0x5aac('0x24')](_0x35db7f['query'][_0x5aac('0x24')]);_0x5d4662['offset']=qs[_0x5aac('0x26')](_0x35db7f['query'][_0x5aac('0x26')]);}return _0x472aef[_0x5aac('0x63')](_0x5d4662);}})[_0x5aac('0x2b')](function(_0x7c58ec){if(_0x7c58ec){return _0x7c58ec?{'count':_0x310c75,'rows':_0x7c58ec}:null;}})[_0x5aac('0x2b')](respondWithResult(_0xce6c04,null))['catch'](handleError(_0xce6c04,null));};exports['addTeams']=function(_0x463c36,_0x22c61d,_0x343f02){var _0x269ae3=_0x463c36['body']['ids'];return db[_0x5aac('0x64')][_0x5aac('0x47')]({'where':{'id':_0x269ae3},'attributes':['id'],'include':[{'model':db[_0x5aac('0x5c')],'as':_0x5aac('0x66'),'attributes':['id',_0x5aac('0x2f'),_0x5aac('0x67'),_0x5aac('0x68'),_0x5aac('0x69')],'raw':!![]}]})[_0x5aac('0x2b')](function(_0x5cb1c0){if(_0x5cb1c0){var _0x435a2a=_[_0x5aac('0x6a')](_0x5cb1c0,function(_0x270b80){var _0x4989da=_0x270b80['get']({'plain':!![]});return _0x4989da[_0x5aac('0x66')];});return db['MailQueue']['find']({'where':{'id':_0x463c36[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](function(_0x5edd0d){return db[_0x5aac('0x6b')][_0x5aac('0x6c')](function(_0x5486f1){return _0x5edd0d[_0x5aac('0x6d')](_0x269ae3,{'transaction':_0x5486f1})[_0x5aac('0x2b')](function(){return BPromise['each'](_0x435a2a,function(_0xd9a3b2){return db[_0x5aac('0x58')]['findOrCreate']({'where':{'UserId':_0xd9a3b2['id'],'MailQueueId':_0x463c36[_0x5aac('0x48')]['id']},'transaction':_0x5486f1});});})[_0x5aac('0x2b')](function(){_0x435a2a['forEach'](function(_0x3e0491){socket[_0x5aac('0x6e')](_0x5aac('0x6f'),{'UserId':_0x3e0491['id'],'MailQueueId':_0x5edd0d['id']});});});});});}})[_0x5aac('0x2b')](respondWithStatusCode(_0x22c61d,null))['catch'](handleError(_0x22c61d,null));};exports[_0x5aac('0x70')]=function(_0x3460b5,_0xefb92a,_0x2bd302){return db[_0x5aac('0x64')][_0x5aac('0x47')]({'where':{'id':_0x3460b5[_0x5aac('0x39')][_0x5aac('0x71')]},'attributes':['id'],'include':[{'model':db[_0x5aac('0x5c')],'as':_0x5aac('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5aac('0x2b')](handleEntityNotFound(_0xefb92a,null))[_0x5aac('0x2b')](function(_0x47b8aa){var _0x321dda=_['map'](_0x47b8aa,'id');var _0x952088=[];var _0x3ed6d5=[];var _0x13114e=squel[_0x5aac('0x72')]();_0x13114e[_0x5aac('0x73')](_0x5aac('0x74'))[_0x5aac('0x75')](_0x5aac('0x76'),'tq')[_0x5aac('0x77')](_0x5aac('0x78'),'ut',_0x5aac('0x79'))[_0x5aac('0x42')](_0x5aac('0x7a'),_0x3460b5['params']['id']);for(var _0x460c35=0x0;_0x460c35<_0x47b8aa[_0x5aac('0x3e')];_0x460c35+=0x1){let _0x51c967=_0x47b8aa[_0x460c35];for(var _0x1d5b30=0x0;_0x1d5b30<_0x51c967[_0x5aac('0x66')][_0x5aac('0x3e')];_0x1d5b30+=0x1){let _0x1d12d2=_0x51c967[_0x5aac('0x66')][_0x1d5b30];var _0x9ebb9a=_0x13114e[_0x5aac('0x7b')]();_0x9ebb9a[_0x5aac('0x42')]('ut.UserId\x20=\x20?',_0x1d12d2['id']);_0x3ed6d5[_0x5aac('0x7c')](db[_0x5aac('0x6b')]['query'](_0x9ebb9a[_0x5aac('0x7d')](),{'type':db[_0x5aac('0x6b')][_0x5aac('0x7e')][_0x5aac('0x7f')]})[_0x5aac('0x2b')](function(_0x199ceb){if(_0x199ceb[_0x5aac('0x3e')]===0x1){return _0x1d12d2['id'];}else{var _0x3dbd42=_[_0x5aac('0x80')](_[_0x5aac('0x38')](_0x199ceb,'TeamId'),function(_0x7f9116){return _[_0x5aac('0x81')](_0x321dda,_0x7f9116);});if(_0x3dbd42){return _0x1d12d2['id'];}}}));}}return BPromise[_0x5aac('0x82')](_0x3ed6d5)[_0x5aac('0x2b')](function(_0x7c0f84){_0x952088=_(_0x952088)[_0x5aac('0x83')](_0x7c0f84)[_0x5aac('0x84')]()[_0x5aac('0x85')]();return db['MailQueue'][_0x5aac('0x4a')]({'where':{'id':_0x3460b5[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](function(_0x576d90){return db[_0x5aac('0x6b')][_0x5aac('0x6c')](function(_0x2371a1){return _0x576d90[_0x5aac('0x70')](_0x3460b5[_0x5aac('0x39')]['ids'],{'transaction':_0x2371a1})[_0x5aac('0x2b')](function(){if(!_[_0x5aac('0x86')](_0x952088)){return _0x576d90[_0x5aac('0x87')](_0x952088,{'transaction':_0x2371a1});}})[_0x5aac('0x2b')](function(){_0x952088[_0x5aac('0x88')](function(_0x4f6ac1){socket[_0x5aac('0x6e')](_0x5aac('0x89'),{'UserId':_0x4f6ac1,'MailQueueId':_0x576d90['id']});});});});});});})['then'](respondWithStatusCode(_0xefb92a,null))[_0x5aac('0x4b')](handleError(_0xefb92a,null));};exports[_0x5aac('0x8a')]=function(_0x57ec82,_0x3b38b7,_0x2da0aa){return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x57ec82[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b38b7,null))[_0x5aac('0x2b')](function(_0x43b68e){if(_0x43b68e){return _0x43b68e[_0x5aac('0x8a')](_0x57ec82[_0x5aac('0x4d')][_0x5aac('0x71')],_[_0x5aac('0x8b')](_0x57ec82[_0x5aac('0x4d')],[_0x5aac('0x71'),'id'])||{})[_0x5aac('0x8c')](function(_0x577323){for(var _0x42aeee=0x0;_0x42aeee<_0x57ec82[_0x5aac('0x4d')][_0x5aac('0x71')]['length'];_0x42aeee+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x57ec82['body'][_0x5aac('0x71')][_0x42aeee]),'MailQueueId':Number(_0x57ec82['params']['id'])});}return _0x577323;});}})[_0x5aac('0x2b')](respondWithResult(_0x3b38b7,null))[_0x5aac('0x4b')](handleError(_0x3b38b7,null));};exports['removeAgents']=function(_0x334f42,_0x509f60,_0x18bf64){return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x334f42[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x509f60,null))[_0x5aac('0x2b')](function(_0x34d917){if(_0x34d917){return _0x34d917['removeAgents'](_0x334f42[_0x5aac('0x39')]['ids'])[_0x5aac('0x2b')](function(){if(_[_0x5aac('0x8d')](_0x334f42[_0x5aac('0x39')][_0x5aac('0x71')])){for(var _0x4d9ba4=0x0;_0x4d9ba4<_0x334f42[_0x5aac('0x39')]['ids']['length'];_0x4d9ba4+=0x1){socket[_0x5aac('0x6e')](_0x5aac('0x89'),{'UserId':Number(_0x334f42[_0x5aac('0x39')][_0x5aac('0x71')][_0x4d9ba4]),'MailQueueId':Number(_0x334f42[_0x5aac('0x48')]['id'])});}}else{socket['emit'](_0x5aac('0x89'),{'UserId':Number(_0x334f42[_0x5aac('0x39')]['ids']),'MailQueueId':Number(_0x334f42[_0x5aac('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x509f60,null))['catch'](handleError(_0x509f60,null));};exports[_0x5aac('0x8e')]=function(_0xa1d670,_0x522efc,_0x53a611){var _0x31bee4={};var _0x2678df={};var _0x2cbd04;var _0x352ae5;return db[_0x5aac('0x32')][_0x5aac('0x57')]({'where':{'id':_0xa1d670[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x522efc,null))[_0x5aac('0x2b')](function(_0xbcdb85){if(_0xbcdb85){_0x2cbd04=_0xbcdb85;_0x2678df[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x5c')][_0x5aac('0x33')]);_0x2678df['query']=_[_0x5aac('0x49')](_0xa1d670[_0x5aac('0x39')]);_0x2678df[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x2678df[_0x5aac('0x37')],_0x2678df[_0x5aac('0x39')]);_0x31bee4[_0x5aac('0x3b')]=_['intersection'](_0x2678df[_0x5aac('0x37')],qs['fields'](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x31bee4[_0x5aac('0x3b')]=_0x31bee4[_0x5aac('0x3b')][_0x5aac('0x3e')]?_0x31bee4[_0x5aac('0x3b')]:_0x2678df[_0x5aac('0x37')];_0x31bee4[_0x5aac('0x65')]=qs[_0x5aac('0x41')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x41')]);_0x31bee4[_0x5aac('0x42')]=qs[_0x5aac('0x3a')](_[_0x5aac('0x59')](_0xa1d670[_0x5aac('0x39')],_0x2678df['filters']));if(_0xa1d670[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x31bee4[_0x5aac('0x42')]=_[_0x5aac('0x43')](_0x31bee4[_0x5aac('0x42')],{'$or':_['map'](_0x31bee4[_0x5aac('0x3b')],function(_0x4844ab){var _0x12aa7b={};_0x12aa7b[_0x4844ab]={'$like':'%'+_0xa1d670[_0x5aac('0x39')][_0x5aac('0x5b')]+'%'};return _0x12aa7b;})});}_0x31bee4=_['merge']({},_0x31bee4,_0xa1d670[_0x5aac('0x45')]);return _0x2cbd04['getAgents'](_0x31bee4);}})['then'](function(_0x232f3c){if(_0x232f3c){_0x352ae5=_0x232f3c['length'];if(!_0xa1d670[_0x5aac('0x39')]['hasOwnProperty'](_0x5aac('0x40'))){_0x31bee4['limit']=qs[_0x5aac('0x24')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x24')]);_0x31bee4[_0x5aac('0x26')]=qs[_0x5aac('0x26')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x26')]);}return _0x2cbd04[_0x5aac('0x8e')](_0x31bee4);}})[_0x5aac('0x2b')](function(_0x3064b0){if(_0x3064b0){return _0x3064b0?{'count':_0x352ae5,'rows':_0x3064b0}:null;}})[_0x5aac('0x2b')](respondWithResult(_0x522efc,null))[_0x5aac('0x4b')](handleError(_0x522efc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 273b101..c47ac22 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 _0xe1fc=['MailQueue','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3c03cf,_0x24b6e9){var _0xd9654c=function(_0x2b21a7){while(--_0x2b21a7){_0x3c03cf['push'](_0x3c03cf['shift']());}};_0xd9654c(++_0x24b6e9);}(_0xe1fc,0xf1));var _0xce1f=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xe1fc[_0x1655bb];return _0x5e2020;};'use strict';var EventEmitter=require(_0xce1f('0x0'));var MailQueue=require(_0xce1f('0x1'))['db'][_0xce1f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce1f('0x3'),'afterUpdate':'update','afterDestroy':_0xce1f('0x4')};function emitEvent(_0x1eb80){return function(_0x138a47,_0x18d873,_0x1a47cc){MailQueueEvents[_0xce1f('0x5')](_0x1eb80+':'+_0x138a47['id'],_0x138a47);MailQueueEvents[_0xce1f('0x5')](_0x1eb80,_0x138a47);_0x1a47cc(null);};}for(var e in events){if(events[_0xce1f('0x6')](e)){var event=events[e];MailQueue[_0xce1f('0x7')](e,emitEvent(event));}}module[_0xce1f('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xdfbf=['MailQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xc21b09,_0x5b4e19){var _0x34a385=function(_0x46efa5){while(--_0x46efa5){_0xc21b09['push'](_0xc21b09['shift']());}};_0x34a385(++_0x5b4e19);}(_0xdfbf,0x198));var _0xfdfb=function(_0x3e101f,_0x12e558){_0x3e101f=_0x3e101f-0x0;var _0x1c8109=_0xdfbf[_0x3e101f];return _0x1c8109;};'use strict';var EventEmitter=require(_0xfdfb('0x0'));var MailQueue=require(_0xfdfb('0x1'))['db'][_0xfdfb('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfdfb('0x3'),'afterUpdate':_0xfdfb('0x4'),'afterDestroy':_0xfdfb('0x5')};function emitEvent(_0x32bc84){return function(_0x31a082,_0x3d94a8,_0x4e10af){MailQueueEvents[_0xfdfb('0x6')](_0x32bc84+':'+_0x31a082['id'],_0x31a082);MailQueueEvents['emit'](_0x32bc84,_0x31a082);_0x4e10af(null);};}for(var e in events){if(events[_0xfdfb('0x7')](e)){var event=events[e];MailQueue[_0xfdfb('0x8')](e,emitEvent(event));}}module[_0xfdfb('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 eaa9ca1..6cf93d3 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 _0x9ec3=['bluebird','request-promise','path','../../config/environment','define','MailQueue','mail_queues','lodash','api','moment'];(function(_0x3995dd,_0x24f96f){var _0x410f8a=function(_0xe2c273){while(--_0xe2c273){_0x3995dd['push'](_0x3995dd['shift']());}};_0x410f8a(++_0x24f96f);}(_0x9ec3,0xcf));var _0x39ec=function(_0x1a64f3,_0x4b2b6b){_0x1a64f3=_0x1a64f3-0x0;var _0x37d68f=_0x9ec3[_0x1a64f3];return _0x37d68f;};'use strict';var _=require(_0x39ec('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x39ec('0x1'));var moment=require(_0x39ec('0x2'));var BPromise=require(_0x39ec('0x3'));var rp=require(_0x39ec('0x4'));var fs=require('fs');var path=require(_0x39ec('0x5'));var rimraf=require('rimraf');var config=require(_0x39ec('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x9e2bd2,_0x4c12da){return _0x9e2bd2[_0x39ec('0x7')](_0x39ec('0x8'),attributes,{'tableName':_0x39ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48ab=['path','../../config/environment','exports','define','MailQueue','lodash','request-promise'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x48ab,0x15c));var _0xb48a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x48ab[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xb48a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb48a('0x1'));var fs=require('fs');var path=require(_0xb48a('0x2'));var rimraf=require('rimraf');var config=require(_0xb48a('0x3'));var attributes=require('./mailQueue.attributes');module[_0xb48a('0x4')]=function(_0x179a72,_0x1851a6){return _0x179a72[_0xb48a('0x5')](_0xb48a('0x6'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index af52342..c177ed9 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 _0x544a=['../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailQueue','debug','find','ShowMailQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x472bfd,_0x48abd3){var _0xfeb8aa=function(_0xfd2bef){while(--_0xfd2bef){_0x472bfd['push'](_0x472bfd['shift']());}};_0xfeb8aa(++_0x48abd3);}(_0x544a,0xbd));var _0xa544=function(_0x4168e9,_0x137419){_0x4168e9=_0x4168e9-0x0;var _0x4fa5b8=_0x544a[_0x4168e9];return _0x4fa5b8;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var moment=require(_0xa544('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa544('0x4'));var logger=require(_0xa544('0x5'))('rpc');var config=require(_0xa544('0x6'));var jayson=require(_0xa544('0x7'));var client=jayson[_0xa544('0x8')][_0xa544('0x9')]({'port':0x232a});config[_0xa544('0xa')]=_['defaults'](config[_0xa544('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa544('0xb'))(new Redis(config[_0xa544('0xa')]));require('./mailQueue.socket')[_0xa544('0xc')](socket);function respondWithRpcPromise(_0x466616,_0x4766a8,_0x2d4a97){return new BPromise(function(_0x4ec7bd,_0x206759){return client[_0xa544('0xd')](_0x466616,_0x2d4a97)['then'](function(_0x22e855){logger['info'](_0xa544('0xe'),_0x4766a8,_0xa544('0xf'));logger['debug'](_0xa544('0x10'),_0x4766a8,_0xa544('0xf'),JSON[_0xa544('0x11')](_0x22e855));if(_0x22e855[_0xa544('0x12')]){if(_0x22e855[_0xa544('0x12')][_0xa544('0x13')]===0x1f4){logger[_0xa544('0x12')](_0xa544('0xe'),_0x4766a8,_0x22e855[_0xa544('0x12')][_0xa544('0x14')]);return _0x206759(_0x22e855[_0xa544('0x12')][_0xa544('0x14')]);}logger['error'](_0xa544('0xe'),_0x4766a8,_0x22e855[_0xa544('0x12')]['message']);return _0x4ec7bd(_0x22e855[_0xa544('0x12')][_0xa544('0x14')]);}else{logger[_0xa544('0x15')](_0xa544('0xe'),_0x4766a8,_0xa544('0xf'));_0x4ec7bd(_0x22e855[_0xa544('0x16')][_0xa544('0x14')]);}})[_0xa544('0x17')](function(_0x6e3ec3){logger[_0xa544('0x12')]('MailQueue,\x20%s,\x20%s',_0x4766a8,_0x6e3ec3);_0x206759(_0x6e3ec3);});});}exports['GetMailQueue']=function(_0x51c042){var _0x5a455a=this;return new Promise(function(_0x1b17be,_0x57a154){return db[_0xa544('0x18')][_0xa544('0x19')]({'raw':_0x51c042['options']?_0x51c042[_0xa544('0x1a')][_0xa544('0x1b')]===undefined?!![]:![]:!![],'where':_0x51c042[_0xa544('0x1a')]?_0x51c042[_0xa544('0x1a')][_0xa544('0x1c')]||null:null,'attributes':_0x51c042['options']?_0x51c042['options'][_0xa544('0x1d')]||null:null,'limit':_0x51c042['options']?_0x51c042[_0xa544('0x1a')][_0xa544('0x1e')]||null:null,'include':_0x51c042[_0xa544('0x1a')]?_0x51c042[_0xa544('0x1a')][_0xa544('0x1f')]?_[_0xa544('0x20')](_0x51c042[_0xa544('0x1a')][_0xa544('0x1f')],function(_0x3257e3){return{'model':db[_0x3257e3['model']],'as':_0x3257e3['as'],'attributes':_0x3257e3[_0xa544('0x1d')],'include':_0x3257e3[_0xa544('0x1f')]?_['map'](_0x3257e3[_0xa544('0x1f')],function(_0x116924){return{'model':db[_0x116924[_0xa544('0x21')]],'as':_0x116924['as'],'attributes':_0x116924['attributes'],'include':_0x116924[_0xa544('0x1f')]?_[_0xa544('0x20')](_0x116924[_0xa544('0x1f')],function(_0x46ad76){return{'model':db[_0x46ad76['model']],'as':_0x46ad76['as'],'attributes':_0x46ad76[_0xa544('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa544('0x22')](function(_0x153a15){logger['info'](_0xa544('0x23'),_0x51c042);logger[_0xa544('0x24')]('GetMailQueue',_0x51c042,JSON['stringify'](_0x153a15));_0x1b17be(_0x153a15);})[_0xa544('0x17')](function(_0x192786){logger[_0xa544('0x12')]('GetMailQueue',_0x192786[_0xa544('0x14')],_0x51c042);_0x57a154(_0x5a455a[_0xa544('0x12')](0x1f4,_0x192786[_0xa544('0x14')]));});});};exports['ShowMailQueue']=function(_0x10d552){var _0x21a5fe=this;return new Promise(function(_0x5da330,_0xdad0dc){return db['MailQueue'][_0xa544('0x25')]({'raw':_0x10d552[_0xa544('0x1a')]?_0x10d552[_0xa544('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x10d552['options']?_0x10d552[_0xa544('0x1a')][_0xa544('0x1c')]||null:null,'attributes':_0x10d552[_0xa544('0x1a')]?_0x10d552['options']['attributes']||null:null,'include':_0x10d552[_0xa544('0x1a')]?_0x10d552[_0xa544('0x1a')][_0xa544('0x1f')]?_['map'](_0x10d552['options'][_0xa544('0x1f')],function(_0x1abd39){return{'model':db[_0x1abd39[_0xa544('0x21')]],'as':_0x1abd39['as'],'attributes':_0x1abd39[_0xa544('0x1d')],'include':_0x1abd39[_0xa544('0x1f')]?_[_0xa544('0x20')](_0x1abd39[_0xa544('0x1f')],function(_0x555ff6){return{'model':db[_0x555ff6[_0xa544('0x21')]],'as':_0x555ff6['as'],'attributes':_0x555ff6[_0xa544('0x1d')],'include':_0x555ff6[_0xa544('0x1f')]?_[_0xa544('0x20')](_0x555ff6['include'],function(_0xd5e63f){return{'model':db[_0xd5e63f[_0xa544('0x21')]],'as':_0xd5e63f['as'],'attributes':_0xd5e63f[_0xa544('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa544('0x22')](function(_0x5f3ee1){logger[_0xa544('0x15')](_0xa544('0x26'),_0x10d552);logger[_0xa544('0x24')]('ShowMailQueue',_0x10d552,JSON[_0xa544('0x11')](_0x5f3ee1));_0x5da330(_0x5f3ee1);})[_0xa544('0x17')](function(_0x28942f){logger[_0xa544('0x12')]('ShowMailQueue',_0x28942f['message'],_0x10d552);_0xdad0dc(_0x21a5fe[_0xa544('0x12')](0x1f4,_0x28942f[_0xa544('0x14')]));});});}; \ No newline at end of file +var _0xb8b2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','http','redis','localhost','socket.io-emitter','./mailQueue.socket','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','find','ShowMailQueue','catch','lodash','util'];(function(_0x1706d6,_0x468cf1){var _0x1bef6a=function(_0x4ded1c){while(--_0x4ded1c){_0x1706d6['push'](_0x1706d6['shift']());}};_0x1bef6a(++_0x468cf1);}(_0xb8b2,0xb7));var _0x2b8b=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xb8b2[_0x25662e];return _0x59b7bc;};'use strict';var _=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var moment=require(_0x2b8b('0x2'));var BPromise=require(_0x2b8b('0x3'));var rs=require(_0x2b8b('0x4'));var fs=require('fs');var Redis=require(_0x2b8b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b8b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b8b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b8b('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2b8b('0x9')],{'host':_0x2b8b('0xa'),'port':0x18eb});var socket=require(_0x2b8b('0xb'))(new Redis(config['redis']));require(_0x2b8b('0xc'))['register'](socket);function respondWithRpcPromise(_0x606308,_0x13d3df,_0x1fe46d){return new BPromise(function(_0xde0de1,_0x55b027){return client['request'](_0x606308,_0x1fe46d)[_0x2b8b('0xd')](function(_0x6d33db){logger['info'](_0x2b8b('0xe'),_0x13d3df,'request\x20sent');logger[_0x2b8b('0xf')](_0x2b8b('0x10'),_0x13d3df,'request\x20sent',JSON[_0x2b8b('0x11')](_0x6d33db));if(_0x6d33db[_0x2b8b('0x12')]){if(_0x6d33db['error'][_0x2b8b('0x13')]===0x1f4){logger['error'](_0x2b8b('0xe'),_0x13d3df,_0x6d33db[_0x2b8b('0x12')][_0x2b8b('0x14')]);return _0x55b027(_0x6d33db[_0x2b8b('0x12')]['message']);}logger[_0x2b8b('0x12')]('MailQueue,\x20%s,\x20%s',_0x13d3df,_0x6d33db[_0x2b8b('0x12')]['message']);return _0xde0de1(_0x6d33db['error'][_0x2b8b('0x14')]);}else{logger[_0x2b8b('0x15')](_0x2b8b('0xe'),_0x13d3df,_0x2b8b('0x16'));_0xde0de1(_0x6d33db[_0x2b8b('0x17')][_0x2b8b('0x14')]);}})['catch'](function(_0x14a2bf){logger['error']('MailQueue,\x20%s,\x20%s',_0x13d3df,_0x14a2bf);_0x55b027(_0x14a2bf);});});}exports[_0x2b8b('0x18')]=function(_0x16e6fd){var _0x46bce0=this;return new Promise(function(_0x15264d,_0x1866fb){return db[_0x2b8b('0x19')][_0x2b8b('0x1a')]({'raw':_0x16e6fd[_0x2b8b('0x1b')]?_0x16e6fd[_0x2b8b('0x1b')][_0x2b8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x16e6fd[_0x2b8b('0x1b')]?_0x16e6fd[_0x2b8b('0x1b')][_0x2b8b('0x1d')]||null:null,'attributes':_0x16e6fd[_0x2b8b('0x1b')]?_0x16e6fd['options'][_0x2b8b('0x1e')]||null:null,'limit':_0x16e6fd[_0x2b8b('0x1b')]?_0x16e6fd['options']['limit']||null:null,'include':_0x16e6fd[_0x2b8b('0x1b')]?_0x16e6fd[_0x2b8b('0x1b')][_0x2b8b('0x1f')]?_[_0x2b8b('0x20')](_0x16e6fd[_0x2b8b('0x1b')][_0x2b8b('0x1f')],function(_0x36aaa0){return{'model':db[_0x36aaa0[_0x2b8b('0x21')]],'as':_0x36aaa0['as'],'attributes':_0x36aaa0['attributes'],'include':_0x36aaa0[_0x2b8b('0x1f')]?_[_0x2b8b('0x20')](_0x36aaa0[_0x2b8b('0x1f')],function(_0x386b09){return{'model':db[_0x386b09[_0x2b8b('0x21')]],'as':_0x386b09['as'],'attributes':_0x386b09[_0x2b8b('0x1e')],'include':_0x386b09[_0x2b8b('0x1f')]?_[_0x2b8b('0x20')](_0x386b09[_0x2b8b('0x1f')],function(_0x5830da){return{'model':db[_0x5830da[_0x2b8b('0x21')]],'as':_0x5830da['as'],'attributes':_0x5830da[_0x2b8b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dc452){logger['info'](_0x2b8b('0x18'),_0x16e6fd);logger[_0x2b8b('0xf')](_0x2b8b('0x18'),_0x16e6fd,JSON[_0x2b8b('0x11')](_0x2dc452));_0x15264d(_0x2dc452);})['catch'](function(_0x112d14){logger[_0x2b8b('0x12')](_0x2b8b('0x18'),_0x112d14[_0x2b8b('0x14')],_0x16e6fd);_0x1866fb(_0x46bce0['error'](0x1f4,_0x112d14[_0x2b8b('0x14')]));});});};exports['ShowMailQueue']=function(_0x470866){var _0x4f3419=this;return new Promise(function(_0x1ce5c5,_0x5eae34){return db[_0x2b8b('0x19')][_0x2b8b('0x22')]({'raw':_0x470866['options']?_0x470866['options'][_0x2b8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x470866[_0x2b8b('0x1b')]?_0x470866[_0x2b8b('0x1b')][_0x2b8b('0x1d')]||null:null,'attributes':_0x470866[_0x2b8b('0x1b')]?_0x470866[_0x2b8b('0x1b')][_0x2b8b('0x1e')]||null:null,'include':_0x470866[_0x2b8b('0x1b')]?_0x470866['options']['include']?_[_0x2b8b('0x20')](_0x470866[_0x2b8b('0x1b')][_0x2b8b('0x1f')],function(_0x231969){return{'model':db[_0x231969[_0x2b8b('0x21')]],'as':_0x231969['as'],'attributes':_0x231969[_0x2b8b('0x1e')],'include':_0x231969[_0x2b8b('0x1f')]?_[_0x2b8b('0x20')](_0x231969[_0x2b8b('0x1f')],function(_0x360512){return{'model':db[_0x360512[_0x2b8b('0x21')]],'as':_0x360512['as'],'attributes':_0x360512[_0x2b8b('0x1e')],'include':_0x360512[_0x2b8b('0x1f')]?_[_0x2b8b('0x20')](_0x360512[_0x2b8b('0x1f')],function(_0xff0aac){return{'model':db[_0xff0aac[_0x2b8b('0x21')]],'as':_0xff0aac['as'],'attributes':_0xff0aac[_0x2b8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2b8b('0xd')](function(_0x2f51af){logger[_0x2b8b('0x15')]('ShowMailQueue',_0x470866);logger[_0x2b8b('0xf')](_0x2b8b('0x23'),_0x470866,JSON[_0x2b8b('0x11')](_0x2f51af));_0x1ce5c5(_0x2f51af);})[_0x2b8b('0x24')](function(_0x586ff6){logger[_0x2b8b('0x12')]('ShowMailQueue',_0x586ff6[_0x2b8b('0x14')],_0x470866);_0x5eae34(_0x4f3419['error'](0x1f4,_0x586ff6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b1e0916..11710f5 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 _0xff83=['emit','mailQueue:','save','remove','update'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xff83,0x98));var _0x3ff8=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xff83[_0xf71120];return _0xbe2fd3;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x3ff8('0x0'),_0x3ff8('0x1'),_0x3ff8('0x2')];function createListener(_0x3280af,_0x4d8bb8){return function(_0x4db20d){_0x4d8bb8[_0x3ff8('0x3')](_0x3280af,_0x4db20d);};}function removeListener(_0x173f67,_0x3b185d){return function(){MailQueueEvents['removeListener'](_0x173f67,_0x3b185d);};}exports['register']=function(_0x163c8c){for(var _0x533bba=0x0,_0x49f70f=events['length'];_0x533bba<_0x49f70f;_0x533bba++){var _0x65158c=events[_0x533bba];var _0x184b3f=createListener(_0x3ff8('0x4')+_0x65158c,_0x163c8c);MailQueueEvents['on'](_0x65158c,_0x184b3f);}}; \ No newline at end of file +var _0xd2f0=['register','length','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x15c9f3,_0x8fae82){var _0x6470f5=function(_0x525ba5){while(--_0x525ba5){_0x15c9f3['push'](_0x15c9f3['shift']());}};_0x6470f5(++_0x8fae82);}(_0xd2f0,0x18b));var _0x0d2f=function(_0x65e91f,_0x1f265a){_0x65e91f=_0x65e91f-0x0;var _0x50e320=_0xd2f0[_0x65e91f];return _0x50e320;};'use strict';var MailQueueEvents=require(_0x0d2f('0x0'));var events=[_0x0d2f('0x1'),'remove',_0x0d2f('0x2')];function createListener(_0xcd550a,_0x5e0b7d){return function(_0x3a4207){_0x5e0b7d[_0x0d2f('0x3')](_0xcd550a,_0x3a4207);};}function removeListener(_0x485ec3,_0x5ab23f){return function(){MailQueueEvents[_0x0d2f('0x4')](_0x485ec3,_0x5ab23f);};}exports[_0x0d2f('0x5')]=function(_0x54dcd9){for(var _0x3a8973=0x0,_0x22f70a=events[_0x0d2f('0x6')];_0x3a8973<_0x22f70a;_0x3a8973++){var _0x66d8d=events[_0x3a8973];var _0x42f7b7=createListener(_0x0d2f('0x7')+_0x66d8d,_0x54dcd9);MailQueueEvents['on'](_0x66d8d,_0x42f7b7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0a149e4..4e6dbd3 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 _0x2f50=['delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','create','put'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2f50,0x145));var _0x02f5=function(_0x30d439,_0x146851){_0x30d439=_0x30d439-0x0;var _0x15016a=_0x2f50[_0x30d439];return _0x15016a;};'use strict';var multer=require(_0x02f5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x02f5('0x1'));var express=require(_0x02f5('0x2'));var router=express[_0x02f5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x02f5('0x4'));var interaction=require(_0x02f5('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x02f5('0x6')]('/',auth['isAuthenticated'](),controller[_0x02f5('0x7')]);router[_0x02f5('0x6')](_0x02f5('0x8'),auth[_0x02f5('0x9')](),controller[_0x02f5('0xa')]);router[_0x02f5('0x6')](_0x02f5('0xb'),auth[_0x02f5('0x9')](),controller['show']);router[_0x02f5('0xc')]('/',auth['isAuthenticated'](),controller[_0x02f5('0xd')]);router[_0x02f5('0xe')]('/:id',auth[_0x02f5('0x9')](),controller['update']);router[_0x02f5('0xf')]('/:id',auth[_0x02f5('0x9')](),controller['destroy']);module[_0x02f5('0x10')]=router; \ No newline at end of file +var _0x2fc8=['../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1ff8b0,_0x518e34){var _0x5ee11c=function(_0x10a36c){while(--_0x10a36c){_0x1ff8b0['push'](_0x1ff8b0['shift']());}};_0x5ee11c(++_0x518e34);}(_0x2fc8,0x118));var _0x82fc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2fc8[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x82fc('0x0'));var util=require(_0x82fc('0x1'));var path=require(_0x82fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x82fc('0x3'));var router=express[_0x82fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x82fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x82fc('0x6'));var controller=require(_0x82fc('0x7'));router[_0x82fc('0x8')]('/',auth[_0x82fc('0x9')](),controller['index']);router[_0x82fc('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x82fc('0xa')]);router[_0x82fc('0x8')]('/:id',auth[_0x82fc('0x9')](),controller[_0x82fc('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x82fc('0xc')]);router[_0x82fc('0xd')](_0x82fc('0xe'),auth['isAuthenticated'](),controller[_0x82fc('0xf')]);router[_0x82fc('0x10')](_0x82fc('0xe'),auth['isAuthenticated'](),controller[_0x82fc('0x11')]);module[_0x82fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index a5748ed..8c9c67b 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 _0x3d0d=['STRING','DATE','moment','sequelize','exports'];(function(_0x448f25,_0x260f14){var _0x2dd46b=function(_0x1955ae){while(--_0x1955ae){_0x448f25['push'](_0x448f25['shift']());}};_0x2dd46b(++_0x260f14);}(_0x3d0d,0xcf));var _0xd3d0=function(_0xcf5e1a,_0x2cbd7b){_0xcf5e1a=_0xcf5e1a-0x0;var _0xbd622c=_0x3d0d[_0xcf5e1a];return _0xbd622c;};'use strict';var moment=require(_0xd3d0('0x0'));var Sequelize=require(_0xd3d0('0x1'));module[_0xd3d0('0x2')]={'uniqueid':{'type':Sequelize[_0xd3d0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd3d0('0x3')]},'joinAt':{'type':Sequelize[_0xd3d0('0x4')]},'leaveAt':{'type':Sequelize[_0xd3d0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd3d0('0x3')]}}; \ No newline at end of file +var _0xe531=['moment','sequelize','exports','STRING','DATE'];(function(_0x3b0d68,_0x101de2){var _0x472625=function(_0x55cba1){while(--_0x55cba1){_0x3b0d68['push'](_0x3b0d68['shift']());}};_0x472625(++_0x101de2);}(_0xe531,0x64));var _0x1e53=function(_0x370c4a,_0x52c2b1){_0x370c4a=_0x370c4a-0x0;var _0xc2d3=_0xe531[_0x370c4a];return _0xc2d3;};'use strict';var moment=require(_0x1e53('0x0'));var Sequelize=require(_0x1e53('0x1'));module[_0x1e53('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1e53('0x3')]},'joinAt':{'type':Sequelize[_0x1e53('0x4')]},'leaveAt':{'type':Sequelize[_0x1e53('0x4')]},'acceptAt':{'type':Sequelize[_0x1e53('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 61dc5b4..34d8ff1 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 _0xd4a2=['describe','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','MailQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x2d09e2,_0x233ea0){var _0x41e74e=function(_0x12ebcd){while(--_0x12ebcd){_0x2d09e2['push'](_0x2d09e2['shift']());}};_0x41e74e(++_0x233ea0);}(_0xd4a2,0x173));var _0x2d4a=function(_0x9cff5a,_0x35e10f){_0x9cff5a=_0x9cff5a-0x0;var _0x4e6aa8=_0xd4a2[_0x9cff5a];return _0x4e6aa8;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];function respondWithStatusCode(_0x45b9fb,_0x5ac803){_0x5ac803=_0x5ac803||0xcc;return function(_0x2f785f){if(_0x2f785f){return _0x45b9fb[_0x2d4a('0x17')](_0x5ac803);}return _0x45b9fb[_0x2d4a('0x18')](_0x5ac803)[_0x2d4a('0x19')]();};}function respondWithResult(_0x544622,_0x4be8b4){_0x4be8b4=_0x4be8b4||0xc8;return function(_0x2a1d0f){if(_0x2a1d0f){return _0x544622['status'](_0x4be8b4)[_0x2d4a('0x1a')](_0x2a1d0f);}};}function respondWithFilteredResult(_0x175bda,_0x11896d){return function(_0x3a3156){if(_0x3a3156){var _0x4c5287=typeof _0x11896d[_0x2d4a('0x1b')]==='undefined'&&typeof _0x11896d[_0x2d4a('0x1c')]==='undefined';var _0x435687=_0x3a3156[_0x2d4a('0x1d')];var _0x2188b2=_0x4c5287?0x0:_0x11896d[_0x2d4a('0x1b')];var _0x498956=_0x4c5287?_0x3a3156['count']:_0x11896d['offset']+_0x11896d[_0x2d4a('0x1c')];var _0x1966d1;if(_0x498956>=_0x435687){_0x498956=_0x435687;_0x1966d1=0xc8;}else{_0x1966d1=0xce;}_0x175bda[_0x2d4a('0x18')](_0x1966d1);return _0x175bda[_0x2d4a('0x1e')](_0x2d4a('0x1f'),_0x2188b2+'-'+_0x498956+'/'+_0x435687)[_0x2d4a('0x1a')](_0x3a3156);}return null;};}function patchUpdates(_0x56445a){return function(_0x49f378){try{jsonpatch[_0x2d4a('0x20')](_0x49f378,_0x56445a,!![]);}catch(_0x1f3e17){return BPromise[_0x2d4a('0x21')](_0x1f3e17);}return _0x49f378[_0x2d4a('0x22')]();};}function saveUpdates(_0x1a2d20,_0x2e7736){return function(_0x22dd0b){if(_0x22dd0b){return _0x22dd0b[_0x2d4a('0x23')](_0x1a2d20)['then'](function(_0x26e7b8){return _0x26e7b8;});}return null;};}function removeEntity(_0x3240a2,_0x2c3799){return function(_0x42d813){if(_0x42d813){return _0x42d813[_0x2d4a('0x24')]()[_0x2d4a('0x25')](function(){_0x3240a2[_0x2d4a('0x18')](0xcc)[_0x2d4a('0x19')]();});}};}function handleEntityNotFound(_0x54c910,_0x544b9b){return function(_0x5cc7d8){if(!_0x5cc7d8){_0x54c910[_0x2d4a('0x17')](0x194);}return _0x5cc7d8;};}function handleError(_0x5029f3,_0x410f7d){_0x410f7d=_0x410f7d||0x1f4;return function(_0x3a2fd3){logger[_0x2d4a('0x26')](_0x3a2fd3[_0x2d4a('0x27')]);if(_0x3a2fd3[_0x2d4a('0x28')]){delete _0x3a2fd3[_0x2d4a('0x28')];}_0x5029f3[_0x2d4a('0x18')](_0x410f7d)[_0x2d4a('0x29')](_0x3a2fd3);};}exports['index']=function(_0x436f53,_0x5ce262){var _0x221602={},_0x9bac28={},_0xc497ce={'count':0x0,'rows':[]};var _0x20b87d=_[_0x2d4a('0x2a')](db[_0x2d4a('0x2b')][_0x2d4a('0x2c')],function(_0x2e8063){return{'name':_0x2e8063['fieldName'],'type':_0x2e8063[_0x2d4a('0x2d')][_0x2d4a('0x2e')]};});_0x9bac28[_0x2d4a('0x2f')]=_[_0x2d4a('0x2a')](_0x20b87d,_0x2d4a('0x28'));_0x9bac28['query']=_[_0x2d4a('0x30')](_0x436f53[_0x2d4a('0x31')]);_0x9bac28[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],_0x9bac28['query']);_0x221602[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x9bac28[_0x2d4a('0x2f')],qs[_0x2d4a('0x35')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x35')]));_0x221602['attributes']=_0x221602[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x221602[_0x2d4a('0x34')]:_0x9bac28[_0x2d4a('0x2f')];if(!_0x436f53[_0x2d4a('0x31')]['hasOwnProperty'](_0x2d4a('0x37'))){_0x221602[_0x2d4a('0x1c')]=qs['limit'](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1c')]);_0x221602[_0x2d4a('0x1b')]=qs[_0x2d4a('0x1b')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x1b')]);}_0x221602['order']=qs[_0x2d4a('0x38')](_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x38')]);_0x221602[_0x2d4a('0x39')]=qs[_0x2d4a('0x32')](_[_0x2d4a('0x3a')](_0x436f53['query'],_0x9bac28['filters']),_0x20b87d);if(_0x436f53[_0x2d4a('0x31')]['filter']){_0x221602[_0x2d4a('0x39')]=_[_0x2d4a('0x3b')](_0x221602['where'],{'$or':_[_0x2d4a('0x2a')](_0x20b87d,function(_0x275598){if(_0x275598[_0x2d4a('0x2d')]!==_0x2d4a('0x3c')){var _0x67bce3={};_0x67bce3[_0x275598[_0x2d4a('0x28')]]={'$like':'%'+_0x436f53[_0x2d4a('0x31')][_0x2d4a('0x3d')]+'%'};return _0x67bce3;}})});}_0x221602=_[_0x2d4a('0x3b')]({},_0x221602,_0x436f53[_0x2d4a('0x3e')]);var _0x3bb0cc={'where':_0x221602['where']};return db[_0x2d4a('0x2b')][_0x2d4a('0x1d')](_0x3bb0cc)[_0x2d4a('0x25')](function(_0x2f1635){_0xc497ce[_0x2d4a('0x1d')]=_0x2f1635;if(_0x436f53['query']['includeAll']){_0x221602['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x2d4a('0x3f')](_0x221602);})[_0x2d4a('0x25')](function(_0xf39020){_0xc497ce[_0x2d4a('0x40')]=_0xf39020;return _0xc497ce;})['then'](respondWithFilteredResult(_0x5ce262,_0x221602))[_0x2d4a('0x41')](handleError(_0x5ce262,null));};exports[_0x2d4a('0x42')]=function(_0x5e9704,_0x189d2a){var _0x13b0f0={'raw':!![],'where':{'id':_0x5e9704[_0x2d4a('0x43')]['id']}},_0x8a9375={};_0x8a9375[_0x2d4a('0x2f')]=_[_0x2d4a('0x30')](db['MailQueueReport'][_0x2d4a('0x2c')]);_0x8a9375[_0x2d4a('0x31')]=_[_0x2d4a('0x30')](_0x5e9704[_0x2d4a('0x31')]);_0x8a9375[_0x2d4a('0x32')]=_[_0x2d4a('0x33')](_0x8a9375['model'],_0x8a9375[_0x2d4a('0x31')]);_0x13b0f0[_0x2d4a('0x34')]=_[_0x2d4a('0x33')](_0x8a9375['model'],qs[_0x2d4a('0x35')](_0x5e9704['query'][_0x2d4a('0x35')]));_0x13b0f0[_0x2d4a('0x34')]=_0x13b0f0[_0x2d4a('0x34')][_0x2d4a('0x36')]?_0x13b0f0[_0x2d4a('0x34')]:_0x8a9375['model'];if(_0x5e9704['query'][_0x2d4a('0x44')]){_0x13b0f0[_0x2d4a('0x45')]=[{'all':!![]}];}_0x13b0f0=_['merge']({},_0x13b0f0,_0x5e9704[_0x2d4a('0x3e')]);return db['MailQueueReport'][_0x2d4a('0x46')](_0x13b0f0)[_0x2d4a('0x25')](handleEntityNotFound(_0x189d2a,null))[_0x2d4a('0x25')](respondWithResult(_0x189d2a,null))['catch'](handleError(_0x189d2a,null));};exports[_0x2d4a('0x47')]=function(_0x541b93,_0x3806b8){return db[_0x2d4a('0x2b')][_0x2d4a('0x47')](_0x541b93[_0x2d4a('0x48')],{})[_0x2d4a('0x25')](respondWithResult(_0x3806b8,0xc9))[_0x2d4a('0x41')](handleError(_0x3806b8,null));};exports[_0x2d4a('0x23')]=function(_0x2b2f4b,_0x1ffb96){if(_0x2b2f4b[_0x2d4a('0x48')]['id']){delete _0x2b2f4b[_0x2d4a('0x48')]['id'];}return db['MailQueueReport'][_0x2d4a('0x46')]({'where':{'id':_0x2b2f4b[_0x2d4a('0x43')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x1ffb96,null))[_0x2d4a('0x25')](saveUpdates(_0x2b2f4b[_0x2d4a('0x48')],null))['then'](respondWithResult(_0x1ffb96,null))[_0x2d4a('0x41')](handleError(_0x1ffb96,null));};exports[_0x2d4a('0x24')]=function(_0x2123e8,_0x440625){return db[_0x2d4a('0x2b')]['find']({'where':{'id':_0x2123e8['params']['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x440625,null))[_0x2d4a('0x25')](removeEntity(_0x440625,null))['catch'](handleError(_0x440625,null));};exports[_0x2d4a('0x49')]=function(_0x33f413,_0x7f0807){return db[_0x2d4a('0x2b')]['describe']()[_0x2d4a('0x25')](respondWithResult(_0x7f0807,null))['catch'](handleError(_0x7f0807,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x11dfeb,_0x46c3b4){var _0x3817af=function(_0x167e89){while(--_0x167e89){_0x11dfeb['push'](_0x11dfeb['shift']());}};_0x3817af(++_0x46c3b4);}(_0x0295,0x1f0));var _0x5029=function(_0xb5e222,_0x431ee4){_0xb5e222=_0xb5e222-0x0;var _0xb8501a=_0x0295[_0xb5e222];return _0xb8501a;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1b33025..4228343 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 _0xd8a3=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','uniqueid','lodash'];(function(_0x2a7a32,_0x43e193){var _0x5b17c2=function(_0x3276ff){while(--_0x3276ff){_0x2a7a32['push'](_0x2a7a32['shift']());}};_0x5b17c2(++_0x43e193);}(_0xd8a3,0xa4));var _0x3d8a=function(_0x2ce418,_0x27917f){_0x2ce418=_0x2ce418-0x0;var _0x3814e1=_0xd8a3[_0x2ce418];return _0x3814e1;};'use strict';var _=require(_0x3d8a('0x0'));var util=require(_0x3d8a('0x1'));var logger=require(_0x3d8a('0x2'))(_0x3d8a('0x3'));var moment=require('moment');var BPromise=require(_0x3d8a('0x4'));var rp=require(_0x3d8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d8a('0x6'));var config=require(_0x3d8a('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x3d8a('0x8')]=function(_0x58f896,_0x3831e6){return _0x58f896[_0x3d8a('0x9')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3d8a('0xa'),'fields':[_0x3d8a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46ae=['bluebird','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api'];(function(_0xcc7ddb,_0x29d685){var _0x51279c=function(_0x1a2666){while(--_0x1a2666){_0xcc7ddb['push'](_0xcc7ddb['shift']());}};_0x51279c(++_0x29d685);}(_0x46ae,0x6b));var _0xe46a=function(_0x3f5fc8,_0x4f4379){_0x3f5fc8=_0x3f5fc8-0x0;var _0x529645=_0x46ae[_0x3f5fc8];return _0x529645;};'use strict';var _=require('lodash');var util=require(_0xe46a('0x0'));var logger=require(_0xe46a('0x1'))(_0xe46a('0x2'));var moment=require('moment');var BPromise=require(_0xe46a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe46a('0x4'));var attributes=require(_0xe46a('0x5'));module[_0xe46a('0x6')]=function(_0x3c419c,_0x340e80){return _0x3c419c[_0xe46a('0x7')](_0xe46a('0x8'),attributes,{'tableName':_0xe46a('0x9'),'paranoid':![],'indexes':[{'name':_0xe46a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 31434b3..00721cf 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x341a12,_0x22e21a){var _0x1f2ab3=function(_0x2ca5f1){while(--_0x2ca5f1){_0x341a12['push'](_0x341a12['shift']());}};_0x1f2ab3(++_0x22e21a);}(_0xadb5,0xad));var _0x5adb=function(_0x45b5ed,_0x4a2bed){_0x45b5ed=_0x45b5ed-0x0;var _0x3773f2=_0xadb5[_0x45b5ed];return _0x3773f2;};'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']('MailQueueReport,\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);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +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(_0xf00315,_0x3ee7a4){var _0x1ab7c3=function(_0x301e65){while(--_0x301e65){_0xf00315['push'](_0xf00315['shift']());}};_0x1ab7c3(++_0x3ee7a4);}(_0x326f,0xd1));var _0xf326=function(_0x180cf5,_0x69c3f2){_0x180cf5=_0x180cf5-0x0;var _0x1d9167=_0x326f[_0x180cf5];return _0x1d9167;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b2651e3..24c4618 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b3880,_0x253317){var _0x3bb100=function(_0x17ae1a){while(--_0x17ae1a){_0x3b3880['push'](_0x3b3880['shift']());}};_0x3bb100(++_0x253317);}(_0x70e0,0x17b));var _0x070e=function(_0x38b090,_0x471976){_0x38b090=_0x38b090-0x0;var _0x1788ad=_0x70e0[_0x38b090];return _0x1788ad;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4b7f92,_0x5ac29c){var _0x58a57d=function(_0x2b6886){while(--_0x2b6886){_0x4b7f92['push'](_0x4b7f92['shift']());}};_0x58a57d(++_0x5ac29c);}(_0x70e0,0x17b));var _0x070e=function(_0x4054b3,_0x56b958){_0x4054b3=_0x4054b3-0x0;var _0x4fe335=_0x70e0[_0x4054b3];return _0x4fe335;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 235eadb..1f97706 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 _0x351f=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x265c54,_0x191f26){var _0x30dfb9=function(_0x53c035){while(--_0x53c035){_0x265c54['push'](_0x265c54['shift']());}};_0x30dfb9(++_0x191f26);}(_0x351f,0xd5));var _0xf351=function(_0x276041,_0x493e2d){_0x276041=_0x276041-0x0;var _0x836aab=_0x351f[_0x276041];return _0x836aab;};'use strict';var Sequelize=require(_0xf351('0x0'));module[_0xf351('0x1')]={'description':{'type':Sequelize[_0xf351('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf351('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf351('0x2')]},'port':{'type':Sequelize[_0xf351('0x4')]},'tls':{'type':Sequelize[_0xf351('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xf351('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf351('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf351('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf351('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x46a8=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x46a8,0x185));var _0x846a=function(_0x28a12a,_0x481fc4){_0x28a12a=_0x28a12a-0x0;var _0x326a73=_0x46a8[_0x28a12a];return _0x326a73;};'use strict';var Sequelize=require('sequelize');module[_0x846a('0x0')]={'description':{'type':Sequelize[_0x846a('0x1')]},'host':{'type':Sequelize[_0x846a('0x1')]},'authentication':{'type':Sequelize[_0x846a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x846a('0x3')]},'tls':{'type':Sequelize[_0x846a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x846a('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x846a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x846a('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x846a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x846a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7143dd9..27fbf18 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 _0xef59=['path','rimraf','../../config/environment','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird'];(function(_0x266c8a,_0x1007bf){var _0x3f9a29=function(_0x635d29){while(--_0x635d29){_0x266c8a['push'](_0x266c8a['shift']());}};_0x3f9a29(++_0x1007bf);}(_0xef59,0x10e));var _0x9ef5=function(_0x2a702f,_0x377aa7){_0x2a702f=_0x2a702f-0x0;var _0x52106f=_0xef59[_0x2a702f];return _0x52106f;};'use strict';var _=require(_0x9ef5('0x0'));var util=require(_0x9ef5('0x1'));var logger=require(_0x9ef5('0x2'))('api');var moment=require(_0x9ef5('0x3'));var BPromise=require(_0x9ef5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ef5('0x5'));var rimraf=require(_0x9ef5('0x6'));var config=require(_0x9ef5('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x4468ef,_0x2854aa){return _0x4468ef[_0x9ef5('0x8')](_0x9ef5('0x9'),attributes,{'tableName':_0x9ef5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c5d=['rimraf','../../config/environment','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x366913,_0x1eb63e){var _0x4d3ed5=function(_0x3b1dda){while(--_0x3b1dda){_0x366913['push'](_0x366913['shift']());}};_0x4d3ed5(++_0x1eb63e);}(_0x6c5d,0x165));var _0xd6c5=function(_0x19ff9c,_0x4f3863){_0x19ff9c=_0x19ff9c-0x0;var _0x271810=_0x6c5d[_0x19ff9c];return _0x271810;};'use strict';var _=require(_0xd6c5('0x0'));var util=require(_0xd6c5('0x1'));var logger=require(_0xd6c5('0x2'))(_0xd6c5('0x3'));var moment=require(_0xd6c5('0x4'));var BPromise=require(_0xd6c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6c5('0x6'));var config=require(_0xd6c5('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x125163,_0x527047){return _0x125163[_0xd6c5('0x8')](_0xd6c5('0x9'),attributes,{'tableName':_0xd6c5('0xa'),'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 8f2e8c9..dac217e 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 _0x4d4b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','stringify'];(function(_0x5e9396,_0x161fdd){var _0x4172e3=function(_0x4acd42){while(--_0x4acd42){_0x5e9396['push'](_0x5e9396['shift']());}};_0x4172e3(++_0x161fdd);}(_0x4d4b,0xf5));var _0xb4d4=function(_0x203a1c,_0x3b7f7e){_0x203a1c=_0x203a1c-0x0;var _0xd0bbc8=_0x4d4b[_0x203a1c];return _0xd0bbc8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb4d4('0x0'));var BPromise=require(_0xb4d4('0x1'));var rs=require(_0xb4d4('0x2'));var fs=require('fs');var Redis=require(_0xb4d4('0x3'));var db=require(_0xb4d4('0x4'))['db'];var utils=require(_0xb4d4('0x5'));var logger=require(_0xb4d4('0x6'))(_0xb4d4('0x7'));var config=require(_0xb4d4('0x8'));var jayson=require(_0xb4d4('0x9'));var client=jayson[_0xb4d4('0xa')][_0xb4d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18612d,_0x19ab48,_0x178707){return new BPromise(function(_0x1829f3,_0x595652){return client[_0xb4d4('0xc')](_0x18612d,_0x178707)[_0xb4d4('0xd')](function(_0x1c8c6b){logger['info']('MailServerIn,\x20%s,\x20%s',_0x19ab48,_0xb4d4('0xe'));logger[_0xb4d4('0xf')](_0xb4d4('0x10'),_0x19ab48,_0xb4d4('0xe'),JSON['stringify'](_0x1c8c6b));if(_0x1c8c6b[_0xb4d4('0x11')]){if(_0x1c8c6b[_0xb4d4('0x11')][_0xb4d4('0x12')]===0x1f4){logger['error'](_0xb4d4('0x13'),_0x19ab48,_0x1c8c6b[_0xb4d4('0x11')][_0xb4d4('0x14')]);return _0x595652(_0x1c8c6b['error']['message']);}logger[_0xb4d4('0x11')]('MailServerIn,\x20%s,\x20%s',_0x19ab48,_0x1c8c6b[_0xb4d4('0x11')][_0xb4d4('0x14')]);return _0x1829f3(_0x1c8c6b[_0xb4d4('0x11')][_0xb4d4('0x14')]);}else{logger[_0xb4d4('0x15')](_0xb4d4('0x13'),_0x19ab48,_0xb4d4('0xe'));_0x1829f3(_0x1c8c6b[_0xb4d4('0x16')]['message']);}})['catch'](function(_0x5235f3){logger['error'](_0xb4d4('0x13'),_0x19ab48,_0x5235f3);_0x595652(_0x5235f3);});});}exports[_0xb4d4('0x17')]=function(_0x48f292){var _0x1bf052=this;return new Promise(function(_0x2b4485,_0x3c690d){return db[_0xb4d4('0x18')][_0xb4d4('0x19')]({'raw':_0x48f292[_0xb4d4('0x1a')]?_0x48f292['options'][_0xb4d4('0x1b')]===undefined?!![]:![]:!![],'where':_0x48f292[_0xb4d4('0x1a')]?_0x48f292[_0xb4d4('0x1a')][_0xb4d4('0x1c')]||null:null,'attributes':_0x48f292['options']?_0x48f292[_0xb4d4('0x1a')]['attributes']||null:null,'limit':_0x48f292[_0xb4d4('0x1a')]?_0x48f292[_0xb4d4('0x1a')][_0xb4d4('0x1d')]||null:null,'include':_0x48f292[_0xb4d4('0x1a')]?_0x48f292[_0xb4d4('0x1a')][_0xb4d4('0x1e')]?_[_0xb4d4('0x1f')](_0x48f292[_0xb4d4('0x1a')][_0xb4d4('0x1e')],function(_0x216db6){return{'model':db[_0x216db6[_0xb4d4('0x20')]],'as':_0x216db6['as'],'attributes':_0x216db6['attributes'],'include':_0x216db6[_0xb4d4('0x1e')]?_[_0xb4d4('0x1f')](_0x216db6[_0xb4d4('0x1e')],function(_0x46363e){return{'model':db[_0x46363e[_0xb4d4('0x20')]],'as':_0x46363e['as'],'attributes':_0x46363e['attributes'],'include':_0x46363e[_0xb4d4('0x1e')]?_[_0xb4d4('0x1f')](_0x46363e[_0xb4d4('0x1e')],function(_0x612d74){return{'model':db[_0x612d74[_0xb4d4('0x20')]],'as':_0x612d74['as'],'attributes':_0x612d74[_0xb4d4('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb4d4('0xd')](function(_0x579a73){logger['info'](_0xb4d4('0x17'),_0x48f292);logger[_0xb4d4('0xf')](_0xb4d4('0x17'),_0x48f292,JSON[_0xb4d4('0x22')](_0x579a73));_0x2b4485(_0x579a73);})['catch'](function(_0x5a8a43){logger[_0xb4d4('0x11')](_0xb4d4('0x17'),_0x5a8a43['message'],_0x48f292);_0x3c690d(_0x1bf052['error'](0x1f4,_0x5a8a43[_0xb4d4('0x14')]));});});}; \ No newline at end of file +var _0x08ca=['findAll','options','raw','where','attributes','include','model','map','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetMailServerIn','MailServerIn'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x08ca,0xb2));var _0xa08c=function(_0x409157,_0x2b1fd2){_0x409157=_0x409157-0x0;var _0x39a804=_0x08ca[_0x409157];return _0x39a804;};'use strict';var _=require(_0xa08c('0x0'));var util=require('util');var moment=require(_0xa08c('0x1'));var BPromise=require(_0xa08c('0x2'));var rs=require(_0xa08c('0x3'));var fs=require('fs');var Redis=require(_0xa08c('0x4'));var db=require(_0xa08c('0x5'))['db'];var utils=require(_0xa08c('0x6'));var logger=require(_0xa08c('0x7'))(_0xa08c('0x8'));var config=require(_0xa08c('0x9'));var jayson=require(_0xa08c('0xa'));var client=jayson[_0xa08c('0xb')][_0xa08c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e0196,_0x2318a4,_0x1fc4b7){return new BPromise(function(_0x2ac084,_0x422ebd){return client['request'](_0x5e0196,_0x1fc4b7)[_0xa08c('0xd')](function(_0x55358d){logger[_0xa08c('0xe')](_0xa08c('0xf'),_0x2318a4,'request\x20sent');logger[_0xa08c('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2318a4,'request\x20sent',JSON[_0xa08c('0x11')](_0x55358d));if(_0x55358d[_0xa08c('0x12')]){if(_0x55358d['error'][_0xa08c('0x13')]===0x1f4){logger[_0xa08c('0x12')](_0xa08c('0xf'),_0x2318a4,_0x55358d[_0xa08c('0x12')][_0xa08c('0x14')]);return _0x422ebd(_0x55358d[_0xa08c('0x12')]['message']);}logger[_0xa08c('0x12')](_0xa08c('0xf'),_0x2318a4,_0x55358d[_0xa08c('0x12')][_0xa08c('0x14')]);return _0x2ac084(_0x55358d[_0xa08c('0x12')][_0xa08c('0x14')]);}else{logger[_0xa08c('0xe')](_0xa08c('0xf'),_0x2318a4,_0xa08c('0x15'));_0x2ac084(_0x55358d[_0xa08c('0x16')]['message']);}})[_0xa08c('0x17')](function(_0x34653a){logger[_0xa08c('0x12')](_0xa08c('0xf'),_0x2318a4,_0x34653a);_0x422ebd(_0x34653a);});});}exports[_0xa08c('0x18')]=function(_0x1b2097){var _0xf6f8d0=this;return new Promise(function(_0x3ea4f3,_0x16ebae){return db[_0xa08c('0x19')][_0xa08c('0x1a')]({'raw':_0x1b2097[_0xa08c('0x1b')]?_0x1b2097['options'][_0xa08c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b2097['options']?_0x1b2097[_0xa08c('0x1b')][_0xa08c('0x1d')]||null:null,'attributes':_0x1b2097[_0xa08c('0x1b')]?_0x1b2097[_0xa08c('0x1b')][_0xa08c('0x1e')]||null:null,'limit':_0x1b2097[_0xa08c('0x1b')]?_0x1b2097[_0xa08c('0x1b')]['limit']||null:null,'include':_0x1b2097[_0xa08c('0x1b')]?_0x1b2097[_0xa08c('0x1b')][_0xa08c('0x1f')]?_['map'](_0x1b2097[_0xa08c('0x1b')]['include'],function(_0x561b0c){return{'model':db[_0x561b0c[_0xa08c('0x20')]],'as':_0x561b0c['as'],'attributes':_0x561b0c[_0xa08c('0x1e')],'include':_0x561b0c['include']?_[_0xa08c('0x21')](_0x561b0c[_0xa08c('0x1f')],function(_0x491cb0){return{'model':db[_0x491cb0['model']],'as':_0x491cb0['as'],'attributes':_0x491cb0[_0xa08c('0x1e')],'include':_0x491cb0[_0xa08c('0x1f')]?_[_0xa08c('0x21')](_0x491cb0['include'],function(_0x424123){return{'model':db[_0x424123[_0xa08c('0x20')]],'as':_0x424123['as'],'attributes':_0x424123[_0xa08c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa08c('0xd')](function(_0x2dbd27){logger[_0xa08c('0xe')]('GetMailServerIn',_0x1b2097);logger['debug'](_0xa08c('0x18'),_0x1b2097,JSON['stringify'](_0x2dbd27));_0x3ea4f3(_0x2dbd27);})[_0xa08c('0x17')](function(_0xbac92a){logger[_0xa08c('0x12')](_0xa08c('0x18'),_0xbac92a[_0xa08c('0x14')],_0x1b2097);_0x16ebae(_0xf6f8d0[_0xa08c('0x12')](0x1f4,_0xbac92a[_0xa08c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 163f442..7c686d3 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(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7a54,0x106));var _0x47a5=function(_0x3a7a57,_0x3652e9){_0x3a7a57=_0x3a7a57-0x0;var _0x21f17b=_0x7a54[_0x3a7a57];return _0x21f17b;};'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(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0x1add5b,_0x579931){_0x1add5b=_0x1add5b-0x0;var _0xa15203=_0x7a54[_0x1add5b];return _0xa15203;};'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 aa03307..b3e4a8b 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x321985,_0x1dcc9b){var _0x3c9349=function(_0x3fa98f){while(--_0x3fa98f){_0x321985['push'](_0x321985['shift']());}};_0x3c9349(++_0x1dcc9b);}(_0xed3c,0x1a6));var _0xced3=function(_0x149a41,_0x3cbb44){_0x149a41=_0x149a41-0x0;var _0x10132c=_0xed3c[_0x149a41];return _0x10132c;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'description':{'type':Sequelize[_0xced3('0x2')]},'host':{'type':Sequelize[_0xced3('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xced3('0x2')]},'port':{'type':Sequelize[_0xced3('0x3')]},'secure':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5423=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3960bf,_0x5791cc){var _0x10ba8b=function(_0x552fdb){while(--_0x552fdb){_0x3960bf['push'](_0x3960bf['shift']());}};_0x10ba8b(++_0x5791cc);}(_0x5423,0xe3));var _0x3542=function(_0x3f4f17,_0x344491){_0x3f4f17=_0x3f4f17-0x0;var _0x5ac8af=_0x5423[_0x3f4f17];return _0x5ac8af;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3542('0x2')]},'user':{'type':Sequelize[_0x3542('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3542('0x3')]},'secure':{'type':Sequelize[_0x3542('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3542('0x2')]},'authentication':{'type':Sequelize[_0x3542('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d579549..58a0f5d 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 _0xa134=['fields','length','order','sort','where','pick','filters','merge','filter','includeAll','include','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','intersection','attributes'];(function(_0x470413,_0x3ad7c5){var _0x92b5e0=function(_0x171f36){while(--_0x171f36){_0x470413['push'](_0x470413['shift']());}};_0x92b5e0(++_0x3ad7c5);}(_0xa134,0x136));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4a13('0x0'));var rimraf=require(_0x4a13('0x1'));var zipdir=require(_0x4a13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a13('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a13('0x4'));var util=require(_0x4a13('0x5'));var path=require(_0x4a13('0x6'));var sox=require(_0x4a13('0x7'));var csv=require('to-csv');var ejs=require(_0x4a13('0x8'));var fs=require('fs');var fs_extra=require(_0x4a13('0x9'));var _=require('lodash');var squel=require(_0x4a13('0xa'));var crypto=require(_0x4a13('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4a13('0xc'));var toCsv=require(_0x4a13('0xd'));var querystring=require(_0x4a13('0xe'));var Papa=require(_0x4a13('0xf'));var Redis=require(_0x4a13('0x10'));var authService=require(_0x4a13('0x11'));var qs=require(_0x4a13('0x12'));var as=require(_0x4a13('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a13('0x14'))(_0x4a13('0x15'));var utils=require(_0x4a13('0x16'));var config=require(_0x4a13('0x17'));var licenseUtil=require(_0x4a13('0x18'));var db=require(_0x4a13('0x19'))['db'];function respondWithStatusCode(_0x5ae040,_0x24d7eb){_0x24d7eb=_0x24d7eb||0xcc;return function(_0xbcedc){if(_0xbcedc){return _0x5ae040[_0x4a13('0x1a')](_0x24d7eb);}return _0x5ae040[_0x4a13('0x1b')](_0x24d7eb)[_0x4a13('0x1c')]();};}function respondWithResult(_0x2df6c0,_0x1c6f1f){_0x1c6f1f=_0x1c6f1f||0xc8;return function(_0x11c1fc){if(_0x11c1fc){return _0x2df6c0[_0x4a13('0x1b')](_0x1c6f1f)[_0x4a13('0x1d')](_0x11c1fc);}};}function respondWithFilteredResult(_0x5b5861,_0x351ebb){return function(_0x29f324){if(_0x29f324){var _0xba5033=typeof _0x351ebb[_0x4a13('0x1e')]==='undefined'&&typeof _0x351ebb[_0x4a13('0x1f')]===_0x4a13('0x20');var _0xce3c27=_0x29f324[_0x4a13('0x21')];var _0xeb31d=_0xba5033?0x0:_0x351ebb[_0x4a13('0x1e')];var _0x537648=_0xba5033?_0x29f324[_0x4a13('0x21')]:_0x351ebb['offset']+_0x351ebb['limit'];var _0x443d96;if(_0x537648>=_0xce3c27){_0x537648=_0xce3c27;_0x443d96=0xc8;}else{_0x443d96=0xce;}_0x5b5861[_0x4a13('0x1b')](_0x443d96);return _0x5b5861[_0x4a13('0x22')](_0x4a13('0x23'),_0xeb31d+'-'+_0x537648+'/'+_0xce3c27)[_0x4a13('0x1d')](_0x29f324);}return null;};}function patchUpdates(_0x44d3ec){return function(_0x52040e){try{jsonpatch[_0x4a13('0x24')](_0x52040e,_0x44d3ec,!![]);}catch(_0x175a1d){return BPromise[_0x4a13('0x25')](_0x175a1d);}return _0x52040e[_0x4a13('0x26')]();};}function saveUpdates(_0x4d54f7,_0x1d9f54){return function(_0x423635){if(_0x423635){return _0x423635[_0x4a13('0x27')](_0x4d54f7)[_0x4a13('0x28')](function(_0x269dee){return _0x269dee;});}return null;};}function removeEntity(_0x226c9b,_0x16d2d8){return function(_0x189862){if(_0x189862){return _0x189862[_0x4a13('0x29')]()[_0x4a13('0x28')](function(){_0x226c9b[_0x4a13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a874a,_0x41ad15){return function(_0x34b63c){if(!_0x34b63c){_0x3a874a[_0x4a13('0x1a')](0x194);}return _0x34b63c;};}function handleError(_0x44479b,_0x3d98e9){_0x3d98e9=_0x3d98e9||0x1f4;return function(_0x516bfc){logger['error'](_0x516bfc['stack']);if(_0x516bfc[_0x4a13('0x2a')]){delete _0x516bfc[_0x4a13('0x2a')];}_0x44479b[_0x4a13('0x1b')](_0x3d98e9)[_0x4a13('0x2b')](_0x516bfc);};}exports[_0x4a13('0x2c')]=function(_0x4b4b68,_0x450219){var _0x31d0ed={},_0x20c301={},_0x4aadb3={'count':0x0,'rows':[]};var _0x8982c1=_[_0x4a13('0x2d')](db[_0x4a13('0x2e')][_0x4a13('0x2f')],function(_0x39647d){return{'name':_0x39647d['fieldName'],'type':_0x39647d[_0x4a13('0x30')][_0x4a13('0x31')]};});_0x20c301[_0x4a13('0x32')]=_['map'](_0x8982c1,_0x4a13('0x2a'));_0x20c301['query']=_[_0x4a13('0x33')](_0x4b4b68[_0x4a13('0x34')]);_0x20c301['filters']=_[_0x4a13('0x35')](_0x20c301['model'],_0x20c301[_0x4a13('0x34')]);_0x31d0ed[_0x4a13('0x36')]=_['intersection'](_0x20c301['model'],qs[_0x4a13('0x37')](_0x4b4b68[_0x4a13('0x34')][_0x4a13('0x37')]));_0x31d0ed['attributes']=_0x31d0ed['attributes'][_0x4a13('0x38')]?_0x31d0ed[_0x4a13('0x36')]:_0x20c301[_0x4a13('0x32')];if(!_0x4b4b68[_0x4a13('0x34')]['hasOwnProperty']('nolimit')){_0x31d0ed[_0x4a13('0x1f')]=qs[_0x4a13('0x1f')](_0x4b4b68[_0x4a13('0x34')][_0x4a13('0x1f')]);_0x31d0ed[_0x4a13('0x1e')]=qs[_0x4a13('0x1e')](_0x4b4b68[_0x4a13('0x34')]['offset']);}_0x31d0ed[_0x4a13('0x39')]=qs['sort'](_0x4b4b68[_0x4a13('0x34')][_0x4a13('0x3a')]);_0x31d0ed[_0x4a13('0x3b')]=qs['filters'](_[_0x4a13('0x3c')](_0x4b4b68['query'],_0x20c301[_0x4a13('0x3d')]),_0x8982c1);if(_0x4b4b68[_0x4a13('0x34')]['filter']){_0x31d0ed[_0x4a13('0x3b')]=_[_0x4a13('0x3e')](_0x31d0ed['where'],{'$or':_['map'](_0x8982c1,function(_0x12a9b6){if(_0x12a9b6[_0x4a13('0x30')]!=='VIRTUAL'){var _0x1cd7c6={};_0x1cd7c6[_0x12a9b6[_0x4a13('0x2a')]]={'$like':'%'+_0x4b4b68[_0x4a13('0x34')][_0x4a13('0x3f')]+'%'};return _0x1cd7c6;}})});}_0x31d0ed=_[_0x4a13('0x3e')]({},_0x31d0ed,_0x4b4b68['options']);var _0x5cf803={'where':_0x31d0ed[_0x4a13('0x3b')]};return db[_0x4a13('0x2e')][_0x4a13('0x21')](_0x5cf803)[_0x4a13('0x28')](function(_0x5187d8){_0x4aadb3[_0x4a13('0x21')]=_0x5187d8;if(_0x4b4b68[_0x4a13('0x34')][_0x4a13('0x40')]){_0x31d0ed[_0x4a13('0x41')]=[{'all':!![]}];}return db[_0x4a13('0x2e')]['findAll'](_0x31d0ed);})[_0x4a13('0x28')](function(_0x38b9f4){_0x4aadb3[_0x4a13('0x42')]=_0x38b9f4;return _0x4aadb3;})[_0x4a13('0x28')](respondWithFilteredResult(_0x450219,_0x31d0ed))['catch'](handleError(_0x450219,null));};exports[_0x4a13('0x43')]=function(_0x34df75,_0x1a1ac5){var _0x32812e={'raw':!![],'where':{'id':_0x34df75[_0x4a13('0x44')]['id']}},_0x2ce904={};_0x2ce904[_0x4a13('0x32')]=_[_0x4a13('0x33')](db[_0x4a13('0x2e')][_0x4a13('0x2f')]);_0x2ce904['query']=_['keys'](_0x34df75[_0x4a13('0x34')]);_0x2ce904['filters']=_[_0x4a13('0x35')](_0x2ce904[_0x4a13('0x32')],_0x2ce904[_0x4a13('0x34')]);_0x32812e[_0x4a13('0x36')]=_['intersection'](_0x2ce904['model'],qs[_0x4a13('0x37')](_0x34df75[_0x4a13('0x34')][_0x4a13('0x37')]));_0x32812e[_0x4a13('0x36')]=_0x32812e[_0x4a13('0x36')][_0x4a13('0x38')]?_0x32812e[_0x4a13('0x36')]:_0x2ce904[_0x4a13('0x32')];if(_0x34df75[_0x4a13('0x34')][_0x4a13('0x40')]){_0x32812e[_0x4a13('0x41')]=[{'all':!![]}];}_0x32812e=_['merge']({},_0x32812e,_0x34df75['options']);return db[_0x4a13('0x2e')][_0x4a13('0x45')](_0x32812e)[_0x4a13('0x28')](handleEntityNotFound(_0x1a1ac5,null))['then'](respondWithResult(_0x1a1ac5,null))[_0x4a13('0x46')](handleError(_0x1a1ac5,null));};exports[_0x4a13('0x47')]=function(_0x1e7b6f,_0x2f107a){return db[_0x4a13('0x2e')][_0x4a13('0x47')](_0x1e7b6f['body'],{})[_0x4a13('0x28')](respondWithResult(_0x2f107a,0xc9))[_0x4a13('0x46')](handleError(_0x2f107a,null));};exports['update']=function(_0x1f4cb7,_0x46e041){if(_0x1f4cb7[_0x4a13('0x48')]['id']){delete _0x1f4cb7[_0x4a13('0x48')]['id'];}return db[_0x4a13('0x2e')]['find']({'where':{'id':_0x1f4cb7[_0x4a13('0x44')]['id']}})[_0x4a13('0x28')](handleEntityNotFound(_0x46e041,null))[_0x4a13('0x28')](saveUpdates(_0x1f4cb7[_0x4a13('0x48')],null))[_0x4a13('0x28')](respondWithResult(_0x46e041,null))[_0x4a13('0x46')](handleError(_0x46e041,null));};exports['destroy']=function(_0x233f6c,_0x470cb8){return db['MailServerOut'][_0x4a13('0x45')]({'where':{'id':_0x233f6c[_0x4a13('0x44')]['id']}})[_0x4a13('0x28')](handleEntityNotFound(_0x470cb8,null))[_0x4a13('0x28')](removeEntity(_0x470cb8,null))[_0x4a13('0x46')](handleError(_0x470cb8,null));}; \ No newline at end of file +var _0x30d3=['mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','includeAll','findAll','catch','params','include','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x72040b,_0x470333){var _0x53ea9e=function(_0x3581e5){while(--_0x3581e5){_0x72040b['push'](_0x72040b['shift']());}};_0x53ea9e(++_0x470333);}(_0x30d3,0x14a));var _0x330d=function(_0x178135,_0x518b6a){_0x178135=_0x178135-0x0;var _0x4e09ac=_0x30d3[_0x178135];return _0x4e09ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x330d('0x0'));var zipdir=require(_0x330d('0x1'));var jsonpatch=require(_0x330d('0x2'));var rp=require(_0x330d('0x3'));var moment=require(_0x330d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x330d('0x5'));var util=require(_0x330d('0x6'));var path=require(_0x330d('0x7'));var sox=require(_0x330d('0x8'));var csv=require(_0x330d('0x9'));var ejs=require(_0x330d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x330d('0xb'));var crypto=require(_0x330d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x330d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x330d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x330d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x330d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x330d('0x11'));var utils=require(_0x330d('0x12'));var config=require(_0x330d('0x13'));var licenseUtil=require(_0x330d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27443e,_0x2ab5e4){_0x2ab5e4=_0x2ab5e4||0xcc;return function(_0x47aa28){if(_0x47aa28){return _0x27443e[_0x330d('0x15')](_0x2ab5e4);}return _0x27443e[_0x330d('0x16')](_0x2ab5e4)['end']();};}function respondWithResult(_0x2cd212,_0x599c35){_0x599c35=_0x599c35||0xc8;return function(_0x3c124a){if(_0x3c124a){return _0x2cd212[_0x330d('0x16')](_0x599c35)[_0x330d('0x17')](_0x3c124a);}};}function respondWithFilteredResult(_0x2b68d3,_0x2802bf){return function(_0x399d00){if(_0x399d00){var _0xce6f32=typeof _0x2802bf[_0x330d('0x18')]==='undefined'&&typeof _0x2802bf[_0x330d('0x19')]===_0x330d('0x1a');var _0x9a2999=_0x399d00[_0x330d('0x1b')];var _0x228d0f=_0xce6f32?0x0:_0x2802bf['offset'];var _0x10d96d=_0xce6f32?_0x399d00[_0x330d('0x1b')]:_0x2802bf[_0x330d('0x18')]+_0x2802bf[_0x330d('0x19')];var _0xa70ff8;if(_0x10d96d>=_0x9a2999){_0x10d96d=_0x9a2999;_0xa70ff8=0xc8;}else{_0xa70ff8=0xce;}_0x2b68d3[_0x330d('0x16')](_0xa70ff8);return _0x2b68d3['set'](_0x330d('0x1c'),_0x228d0f+'-'+_0x10d96d+'/'+_0x9a2999)[_0x330d('0x17')](_0x399d00);}return null;};}function patchUpdates(_0x3db31c){return function(_0x39bdcb){try{jsonpatch[_0x330d('0x1d')](_0x39bdcb,_0x3db31c,!![]);}catch(_0x2b436c){return BPromise[_0x330d('0x1e')](_0x2b436c);}return _0x39bdcb['save']();};}function saveUpdates(_0x5423ad,_0x49ff4f){return function(_0x264856){if(_0x264856){return _0x264856[_0x330d('0x1f')](_0x5423ad)[_0x330d('0x20')](function(_0xeb2f71){return _0xeb2f71;});}return null;};}function removeEntity(_0x50f4ac,_0x22757a){return function(_0x524974){if(_0x524974){return _0x524974['destroy']()['then'](function(){_0x50f4ac[_0x330d('0x16')](0xcc)[_0x330d('0x21')]();});}};}function handleEntityNotFound(_0x106b4c,_0x56e85f){return function(_0x128d22){if(!_0x128d22){_0x106b4c['sendStatus'](0x194);}return _0x128d22;};}function handleError(_0x508e2d,_0x247059){_0x247059=_0x247059||0x1f4;return function(_0x5cb83){logger['error'](_0x5cb83[_0x330d('0x22')]);if(_0x5cb83[_0x330d('0x23')]){delete _0x5cb83[_0x330d('0x23')];}_0x508e2d[_0x330d('0x16')](_0x247059)[_0x330d('0x24')](_0x5cb83);};}exports[_0x330d('0x25')]=function(_0x33746c,_0x22da75){var _0x1eb60a={},_0x4f6ddd={},_0x377f88={'count':0x0,'rows':[]};var _0x5ae9ab=_[_0x330d('0x26')](db['MailServerOut'][_0x330d('0x27')],function(_0x4c7a2c){return{'name':_0x4c7a2c[_0x330d('0x28')],'type':_0x4c7a2c[_0x330d('0x29')]['key']};});_0x4f6ddd[_0x330d('0x2a')]=_[_0x330d('0x26')](_0x5ae9ab,_0x330d('0x23'));_0x4f6ddd[_0x330d('0x2b')]=_[_0x330d('0x2c')](_0x33746c[_0x330d('0x2b')]);_0x4f6ddd[_0x330d('0x2d')]=_[_0x330d('0x2e')](_0x4f6ddd[_0x330d('0x2a')],_0x4f6ddd[_0x330d('0x2b')]);_0x1eb60a[_0x330d('0x2f')]=_[_0x330d('0x2e')](_0x4f6ddd['model'],qs[_0x330d('0x30')](_0x33746c[_0x330d('0x2b')][_0x330d('0x30')]));_0x1eb60a[_0x330d('0x2f')]=_0x1eb60a['attributes'][_0x330d('0x31')]?_0x1eb60a[_0x330d('0x2f')]:_0x4f6ddd[_0x330d('0x2a')];if(!_0x33746c['query'][_0x330d('0x32')](_0x330d('0x33'))){_0x1eb60a[_0x330d('0x19')]=qs[_0x330d('0x19')](_0x33746c[_0x330d('0x2b')][_0x330d('0x19')]);_0x1eb60a[_0x330d('0x18')]=qs[_0x330d('0x18')](_0x33746c[_0x330d('0x2b')][_0x330d('0x18')]);}_0x1eb60a['order']=qs[_0x330d('0x34')](_0x33746c[_0x330d('0x2b')][_0x330d('0x34')]);_0x1eb60a[_0x330d('0x35')]=qs[_0x330d('0x2d')](_[_0x330d('0x36')](_0x33746c[_0x330d('0x2b')],_0x4f6ddd[_0x330d('0x2d')]),_0x5ae9ab);if(_0x33746c[_0x330d('0x2b')][_0x330d('0x37')]){_0x1eb60a['where']=_[_0x330d('0x38')](_0x1eb60a[_0x330d('0x35')],{'$or':_[_0x330d('0x26')](_0x5ae9ab,function(_0x5e24ad){if(_0x5e24ad[_0x330d('0x29')]!==_0x330d('0x39')){var _0x3979ef={};_0x3979ef[_0x5e24ad['name']]={'$like':'%'+_0x33746c['query'][_0x330d('0x37')]+'%'};return _0x3979ef;}})});}_0x1eb60a=_['merge']({},_0x1eb60a,_0x33746c[_0x330d('0x3a')]);var _0x28dd0b={'where':_0x1eb60a[_0x330d('0x35')]};return db[_0x330d('0x3b')][_0x330d('0x1b')](_0x28dd0b)['then'](function(_0x441660){_0x377f88[_0x330d('0x1b')]=_0x441660;if(_0x33746c[_0x330d('0x2b')][_0x330d('0x3c')]){_0x1eb60a['include']=[{'all':!![]}];}return db[_0x330d('0x3b')][_0x330d('0x3d')](_0x1eb60a);})[_0x330d('0x20')](function(_0x3555cd){_0x377f88['rows']=_0x3555cd;return _0x377f88;})[_0x330d('0x20')](respondWithFilteredResult(_0x22da75,_0x1eb60a))[_0x330d('0x3e')](handleError(_0x22da75,null));};exports['show']=function(_0x3f3d16,_0x213e7f){var _0x1ef92f={'raw':!![],'where':{'id':_0x3f3d16[_0x330d('0x3f')]['id']}},_0x535e5a={};_0x535e5a[_0x330d('0x2a')]=_['keys'](db[_0x330d('0x3b')][_0x330d('0x27')]);_0x535e5a['query']=_[_0x330d('0x2c')](_0x3f3d16[_0x330d('0x2b')]);_0x535e5a[_0x330d('0x2d')]=_[_0x330d('0x2e')](_0x535e5a[_0x330d('0x2a')],_0x535e5a['query']);_0x1ef92f[_0x330d('0x2f')]=_[_0x330d('0x2e')](_0x535e5a[_0x330d('0x2a')],qs[_0x330d('0x30')](_0x3f3d16['query'][_0x330d('0x30')]));_0x1ef92f[_0x330d('0x2f')]=_0x1ef92f[_0x330d('0x2f')][_0x330d('0x31')]?_0x1ef92f[_0x330d('0x2f')]:_0x535e5a['model'];if(_0x3f3d16['query'][_0x330d('0x3c')]){_0x1ef92f[_0x330d('0x40')]=[{'all':!![]}];}_0x1ef92f=_['merge']({},_0x1ef92f,_0x3f3d16['options']);return db[_0x330d('0x3b')]['find'](_0x1ef92f)[_0x330d('0x20')](handleEntityNotFound(_0x213e7f,null))[_0x330d('0x20')](respondWithResult(_0x213e7f,null))[_0x330d('0x3e')](handleError(_0x213e7f,null));};exports['create']=function(_0xc55f59,_0x302af9){return db[_0x330d('0x3b')][_0x330d('0x41')](_0xc55f59['body'],{})['then'](respondWithResult(_0x302af9,0xc9))[_0x330d('0x3e')](handleError(_0x302af9,null));};exports[_0x330d('0x1f')]=function(_0x49525b,_0x374fb5){if(_0x49525b[_0x330d('0x42')]['id']){delete _0x49525b[_0x330d('0x42')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x49525b[_0x330d('0x3f')]['id']}})[_0x330d('0x20')](handleEntityNotFound(_0x374fb5,null))[_0x330d('0x20')](saveUpdates(_0x49525b[_0x330d('0x42')],null))[_0x330d('0x20')](respondWithResult(_0x374fb5,null))[_0x330d('0x3e')](handleError(_0x374fb5,null));};exports['destroy']=function(_0x7bf505,_0x204317){return db[_0x330d('0x3b')]['find']({'where':{'id':_0x7bf505['params']['id']}})[_0x330d('0x20')](handleEntityNotFound(_0x204317,null))[_0x330d('0x20')](removeEntity(_0x204317,null))[_0x330d('0x3e')](handleError(_0x204317,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index b20a1f8..b600ca0 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 _0x6211=['moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x2cddd0,_0x378435){var _0x4dc846=function(_0x92d944){while(--_0x92d944){_0x2cddd0['push'](_0x2cddd0['shift']());}};_0x4dc846(++_0x378435);}(_0x6211,0x1aa));var _0x1621=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6211[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x1621('0x0'));var util=require('util');var logger=require(_0x1621('0x1'))(_0x1621('0x2'));var moment=require(_0x1621('0x3'));var BPromise=require(_0x1621('0x4'));var rp=require(_0x1621('0x5'));var fs=require('fs');var path=require(_0x1621('0x6'));var rimraf=require(_0x1621('0x7'));var config=require('../../config/environment');var attributes=require(_0x1621('0x8'));module[_0x1621('0x9')]=function(_0x4a4688,_0x5df172){return _0x4a4688[_0x1621('0xa')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05c6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash'];(function(_0x52e95b,_0x330aa3){var _0x35be66=function(_0x48c177){while(--_0x48c177){_0x52e95b['push'](_0x52e95b['shift']());}};_0x35be66(++_0x330aa3);}(_0x05c6,0x109));var _0x605c=function(_0x24e64b,_0x622487){_0x24e64b=_0x24e64b-0x0;var _0x554a00=_0x05c6[_0x24e64b];return _0x554a00;};'use strict';var _=require(_0x605c('0x0'));var util=require(_0x605c('0x1'));var logger=require(_0x605c('0x2'))(_0x605c('0x3'));var moment=require(_0x605c('0x4'));var BPromise=require(_0x605c('0x5'));var rp=require(_0x605c('0x6'));var fs=require('fs');var path=require(_0x605c('0x7'));var rimraf=require(_0x605c('0x8'));var config=require('../../config/environment');var attributes=require(_0x605c('0x9'));module[_0x605c('0xa')]=function(_0x2bb831,_0x427d7f){return _0x2bb831[_0x605c('0xb')](_0x605c('0xc'),attributes,{'tableName':_0x605c('0xd'),'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 a237e72..6301398 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3afc37,_0x5bf2ce){var _0x2eedd0=function(_0x288ece){while(--_0x288ece){_0x3afc37['push'](_0x3afc37['shift']());}};_0x2eedd0(++_0x5bf2ce);}(_0x1261,0x144));var _0x1126=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x1261[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x52c641,_0x28221b){var _0x499b86=function(_0x46afa6){while(--_0x46afa6){_0x52c641['push'](_0x52c641['shift']());}};_0x499b86(++_0x28221b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x446d2e,_0x4bc597){_0x446d2e=_0x446d2e-0x0;var _0x1739de=_0x5f2f[_0x446d2e];return _0x1739de;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7f9a797..dfd7daf 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 _0xfea2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x1f75f6,_0x3654e1){var _0x5c06c1=function(_0x21b3ba){while(--_0x21b3ba){_0x1f75f6['push'](_0x1f75f6['shift']());}};_0x5c06c1(++_0x3654e1);}(_0xfea2,0xd9));var _0x2fea=function(_0x2a608d,_0x298459){_0x2a608d=_0x2a608d-0x0;var _0x1bee3e=_0xfea2[_0x2a608d];return _0x1bee3e;};'use strict';var multer=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var path=require(_0x2fea('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fea('0x3'));var router=express[_0x2fea('0x4')]();var fs_extra=require(_0x2fea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2fea('0x6'));var config=require(_0x2fea('0x7'));var controller=require(_0x2fea('0x8'));router[_0x2fea('0x9')]('/',auth[_0x2fea('0xa')](),controller[_0x2fea('0xb')]);router[_0x2fea('0x9')](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller[_0x2fea('0xd')]);router[_0x2fea('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2fea('0xe')]);router['post']('/',auth[_0x2fea('0xa')](),controller[_0x2fea('0xf')]);router[_0x2fea('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2fea('0x11')]);router[_0x2fea('0x12')](_0x2fea('0x13'),auth['isAuthenticated'](),controller[_0x2fea('0x14')]);module[_0x2fea('0x15')]=router; \ No newline at end of file +var _0x4a6c=['delete','exports','multer','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x162a48,_0x4b93c2){var _0x4f4721=function(_0x6261e4){while(--_0x6261e4){_0x162a48['push'](_0x162a48['shift']());}};_0x4f4721(++_0x4b93c2);}(_0x4a6c,0xac));var _0xc4a6=function(_0x443a24,_0x237fb3){_0x443a24=_0x443a24-0x0;var _0x15f79c=_0x4a6c[_0x443a24];return _0x15f79c;};'use strict';var multer=require(_0xc4a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc4a6('0x1')]();var fs_extra=require(_0xc4a6('0x2'));var auth=require(_0xc4a6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc4a6('0x4'));var controller=require(_0xc4a6('0x5'));router[_0xc4a6('0x6')]('/',auth[_0xc4a6('0x7')](),controller['index']);router['get'](_0xc4a6('0x8'),auth[_0xc4a6('0x7')](),controller[_0xc4a6('0x9')]);router[_0xc4a6('0x6')](_0xc4a6('0xa'),auth['isAuthenticated'](),controller[_0xc4a6('0xb')]);router['post']('/',auth[_0xc4a6('0x7')](),controller[_0xc4a6('0xc')]);router[_0xc4a6('0xd')](_0xc4a6('0xa'),auth[_0xc4a6('0x7')](),controller[_0xc4a6('0xe')]);router[_0xc4a6('0xf')](_0xc4a6('0xa'),auth[_0xc4a6('0x7')](),controller['destroy']);module[_0xc4a6('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 109f968..e124d00 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 _0x81c6=['exports'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x81c6,0x1d5));var _0x681c=function(_0x1c081d,_0x10b432){_0x1c081d=_0x1c081d-0x0;var _0x2deb0e=_0x81c6[_0x1c081d];return _0x2deb0e;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x31af=['sequelize','exports','STRING'];(function(_0x4808d3,_0x3353c6){var _0x3057fa=function(_0x535a58){while(--_0x535a58){_0x4808d3['push'](_0x4808d3['shift']());}};_0x3057fa(++_0x3353c6);}(_0x31af,0xde));var _0xf31a=function(_0x132da5,_0x5a1003){_0x132da5=_0x132da5-0x0;var _0x179f1b=_0x31af[_0x132da5];return _0x179f1b;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'unique':'name','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 4b6986c..fa84990 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 _0xd906=['filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','merge','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../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','send','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick'];(function(_0x3ae34a,_0x143082){var _0x4c9edc=function(_0x2796c8){while(--_0x2796c8){_0x3ae34a['push'](_0x3ae34a['shift']());}};_0x4c9edc(++_0x143082);}(_0xd906,0xf6));var _0x6d90=function(_0x2dea4c,_0x46b99a){_0x2dea4c=_0x2dea4c-0x0;var _0x563179=_0xd906[_0x2dea4c];return _0x563179;};'use strict';var emlformat=require(_0x6d90('0x0'));var rimraf=require(_0x6d90('0x1'));var zipdir=require(_0x6d90('0x2'));var jsonpatch=require(_0x6d90('0x3'));var rp=require(_0x6d90('0x4'));var moment=require(_0x6d90('0x5'));var BPromise=require(_0x6d90('0x6'));var Mustache=require(_0x6d90('0x7'));var util=require(_0x6d90('0x8'));var path=require(_0x6d90('0x9'));var sox=require(_0x6d90('0xa'));var csv=require(_0x6d90('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d90('0xc'));var _=require(_0x6d90('0xd'));var squel=require(_0x6d90('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d90('0xf'));var toCsv=require(_0x6d90('0xb'));var querystring=require(_0x6d90('0x10'));var Papa=require('papaparse');var Redis=require(_0x6d90('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6d90('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d90('0x13'))(_0x6d90('0x14'));var utils=require(_0x6d90('0x15'));var config=require(_0x6d90('0x16'));var licenseUtil=require(_0x6d90('0x17'));var db=require(_0x6d90('0x18'))['db'];function respondWithStatusCode(_0x38486b,_0x308c29){_0x308c29=_0x308c29||0xcc;return function(_0x3e6c23){if(_0x3e6c23){return _0x38486b[_0x6d90('0x19')](_0x308c29);}return _0x38486b['status'](_0x308c29)['end']();};}function respondWithResult(_0xc5025c,_0x209318){_0x209318=_0x209318||0xc8;return function(_0x38b7cf){if(_0x38b7cf){return _0xc5025c[_0x6d90('0x1a')](_0x209318)[_0x6d90('0x1b')](_0x38b7cf);}};}function respondWithFilteredResult(_0x47d8cb,_0x4e0cdc){return function(_0x1dd232){if(_0x1dd232){var _0x34f88c=typeof _0x4e0cdc[_0x6d90('0x1c')]===_0x6d90('0x1d')&&typeof _0x4e0cdc[_0x6d90('0x1e')]==='undefined';var _0x31a7b9=_0x1dd232[_0x6d90('0x1f')];var _0x2f8c67=_0x34f88c?0x0:_0x4e0cdc[_0x6d90('0x1c')];var _0x573674=_0x34f88c?_0x1dd232[_0x6d90('0x1f')]:_0x4e0cdc[_0x6d90('0x1c')]+_0x4e0cdc[_0x6d90('0x1e')];var _0xa754ab;if(_0x573674>=_0x31a7b9){_0x573674=_0x31a7b9;_0xa754ab=0xc8;}else{_0xa754ab=0xce;}_0x47d8cb[_0x6d90('0x1a')](_0xa754ab);return _0x47d8cb['set'](_0x6d90('0x20'),_0x2f8c67+'-'+_0x573674+'/'+_0x31a7b9)['json'](_0x1dd232);}return null;};}function patchUpdates(_0x3a50d0){return function(_0x3b4849){try{jsonpatch[_0x6d90('0x21')](_0x3b4849,_0x3a50d0,!![]);}catch(_0x1613c8){return BPromise[_0x6d90('0x22')](_0x1613c8);}return _0x3b4849[_0x6d90('0x23')]();};}function saveUpdates(_0x1bab95,_0x17afb7){return function(_0x414893){if(_0x414893){return _0x414893[_0x6d90('0x24')](_0x1bab95)[_0x6d90('0x25')](function(_0x274973){return _0x274973;});}return null;};}function removeEntity(_0x5c0599,_0xf0ff8a){return function(_0x10d79c){if(_0x10d79c){return _0x10d79c[_0x6d90('0x26')]()['then'](function(){_0x5c0599[_0x6d90('0x1a')](0xcc)[_0x6d90('0x27')]();});}};}function handleEntityNotFound(_0x4265de,_0x2817b1){return function(_0x4e29fe){if(!_0x4e29fe){_0x4265de[_0x6d90('0x19')](0x194);}return _0x4e29fe;};}function handleError(_0x26e410,_0x20d057){_0x20d057=_0x20d057||0x1f4;return function(_0x2fcdda){logger[_0x6d90('0x28')](_0x2fcdda[_0x6d90('0x29')]);if(_0x2fcdda[_0x6d90('0x2a')]){delete _0x2fcdda[_0x6d90('0x2a')];}_0x26e410['status'](_0x20d057)[_0x6d90('0x2b')](_0x2fcdda);};}exports['index']=function(_0x2312e2,_0x3c0c7f){var _0x3f4953={},_0x17f287={},_0x2b7b36={'count':0x0,'rows':[]};var _0x4d63d8=_[_0x6d90('0x2c')](db[_0x6d90('0x2d')][_0x6d90('0x2e')],function(_0x16593c){return{'name':_0x16593c['fieldName'],'type':_0x16593c[_0x6d90('0x2f')][_0x6d90('0x30')]};});_0x17f287[_0x6d90('0x31')]=_[_0x6d90('0x2c')](_0x4d63d8,_0x6d90('0x2a'));_0x17f287[_0x6d90('0x32')]=_[_0x6d90('0x33')](_0x2312e2[_0x6d90('0x32')]);_0x17f287[_0x6d90('0x34')]=_[_0x6d90('0x35')](_0x17f287[_0x6d90('0x31')],_0x17f287[_0x6d90('0x32')]);_0x3f4953['attributes']=_['intersection'](_0x17f287[_0x6d90('0x31')],qs[_0x6d90('0x36')](_0x2312e2[_0x6d90('0x32')][_0x6d90('0x36')]));_0x3f4953[_0x6d90('0x37')]=_0x3f4953[_0x6d90('0x37')][_0x6d90('0x38')]?_0x3f4953['attributes']:_0x17f287['model'];if(!_0x2312e2['query']['hasOwnProperty'](_0x6d90('0x39'))){_0x3f4953[_0x6d90('0x1e')]=qs[_0x6d90('0x1e')](_0x2312e2['query'][_0x6d90('0x1e')]);_0x3f4953[_0x6d90('0x1c')]=qs[_0x6d90('0x1c')](_0x2312e2[_0x6d90('0x32')][_0x6d90('0x1c')]);}_0x3f4953[_0x6d90('0x3a')]=qs[_0x6d90('0x3b')](_0x2312e2[_0x6d90('0x32')][_0x6d90('0x3b')]);_0x3f4953[_0x6d90('0x3c')]=qs['filters'](_[_0x6d90('0x3d')](_0x2312e2['query'],_0x17f287[_0x6d90('0x34')]),_0x4d63d8);if(_0x2312e2[_0x6d90('0x32')][_0x6d90('0x3e')]){_0x3f4953['where']=_['merge'](_0x3f4953[_0x6d90('0x3c')],{'$or':_[_0x6d90('0x2c')](_0x4d63d8,function(_0x2b7fec){if(_0x2b7fec['type']!==_0x6d90('0x3f')){var _0x193ec1={};_0x193ec1[_0x2b7fec[_0x6d90('0x2a')]]={'$like':'%'+_0x2312e2[_0x6d90('0x32')][_0x6d90('0x3e')]+'%'};return _0x193ec1;}})});}_0x3f4953=_['merge']({},_0x3f4953,_0x2312e2['options']);var _0x223f81={'where':_0x3f4953[_0x6d90('0x3c')]};return db['MailSubstatus'][_0x6d90('0x1f')](_0x223f81)[_0x6d90('0x25')](function(_0x50eadd){_0x2b7b36[_0x6d90('0x1f')]=_0x50eadd;if(_0x2312e2['query'][_0x6d90('0x40')]){_0x3f4953[_0x6d90('0x41')]=[{'all':!![]}];}return db[_0x6d90('0x2d')][_0x6d90('0x42')](_0x3f4953);})['then'](function(_0x817c6f){_0x2b7b36[_0x6d90('0x43')]=_0x817c6f;return _0x2b7b36;})[_0x6d90('0x25')](respondWithFilteredResult(_0x3c0c7f,_0x3f4953))[_0x6d90('0x44')](handleError(_0x3c0c7f,null));};exports[_0x6d90('0x45')]=function(_0x5af367,_0xc696a0){var _0x5c9d6f={'raw':!![],'where':{'id':_0x5af367['params']['id']}},_0x10900d={};_0x10900d['model']=_[_0x6d90('0x33')](db['MailSubstatus'][_0x6d90('0x2e')]);_0x10900d[_0x6d90('0x32')]=_['keys'](_0x5af367[_0x6d90('0x32')]);_0x10900d[_0x6d90('0x34')]=_[_0x6d90('0x35')](_0x10900d['model'],_0x10900d[_0x6d90('0x32')]);_0x5c9d6f[_0x6d90('0x37')]=_[_0x6d90('0x35')](_0x10900d['model'],qs[_0x6d90('0x36')](_0x5af367['query'][_0x6d90('0x36')]));_0x5c9d6f[_0x6d90('0x37')]=_0x5c9d6f['attributes'][_0x6d90('0x38')]?_0x5c9d6f[_0x6d90('0x37')]:_0x10900d[_0x6d90('0x31')];if(_0x5af367[_0x6d90('0x32')][_0x6d90('0x40')]){_0x5c9d6f[_0x6d90('0x41')]=[{'all':!![]}];}_0x5c9d6f=_[_0x6d90('0x46')]({},_0x5c9d6f,_0x5af367[_0x6d90('0x47')]);return db['MailSubstatus'][_0x6d90('0x48')](_0x5c9d6f)[_0x6d90('0x25')](handleEntityNotFound(_0xc696a0,null))[_0x6d90('0x25')](respondWithResult(_0xc696a0,null))[_0x6d90('0x44')](handleError(_0xc696a0,null));};exports[_0x6d90('0x49')]=function(_0x27ba7f,_0x4bd9c4){return db[_0x6d90('0x2d')][_0x6d90('0x49')](_0x27ba7f[_0x6d90('0x4a')],{})[_0x6d90('0x25')](respondWithResult(_0x4bd9c4,0xc9))[_0x6d90('0x44')](handleError(_0x4bd9c4,null));};exports[_0x6d90('0x24')]=function(_0x40407c,_0x5044b7){if(_0x40407c['body']['id']){delete _0x40407c[_0x6d90('0x4a')]['id'];}return db[_0x6d90('0x2d')]['find']({'where':{'id':_0x40407c[_0x6d90('0x4b')]['id']}})[_0x6d90('0x25')](handleEntityNotFound(_0x5044b7,null))['then'](saveUpdates(_0x40407c[_0x6d90('0x4a')],null))[_0x6d90('0x25')](respondWithResult(_0x5044b7,null))[_0x6d90('0x44')](handleError(_0x5044b7,null));};exports[_0x6d90('0x26')]=function(_0xa9e158,_0x3b7949){return db[_0x6d90('0x2d')][_0x6d90('0x48')]({'where':{'id':_0xa9e158[_0x6d90('0x4b')]['id']}})[_0x6d90('0x25')](handleEntityNotFound(_0x3b7949,null))[_0x6d90('0x25')](removeEntity(_0x3b7949,null))[_0x6d90('0x44')](handleError(_0x3b7949,null));};exports[_0x6d90('0x4c')]=function(_0x35c0f9,_0x599cf5){return db[_0x6d90('0x2d')][_0x6d90('0x4c')]()[_0x6d90('0x25')](respondWithResult(_0x599cf5,null))[_0x6d90('0x44')](handleError(_0x599cf5,null));}; \ No newline at end of file +var _0x878a=['send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x878a,0x1dc));var _0xa878=function(_0x317210,_0x3c8f2a){_0x317210=_0x317210-0x0;var _0xec4f60=_0x878a[_0x317210];return _0xec4f60;};'use strict';var emlformat=require(_0xa878('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa878('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa878('0x2'));var moment=require(_0xa878('0x3'));var BPromise=require(_0xa878('0x4'));var Mustache=require(_0xa878('0x5'));var util=require(_0xa878('0x6'));var path=require('path');var sox=require(_0xa878('0x7'));var csv=require(_0xa878('0x8'));var ejs=require(_0xa878('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa878('0xa'));var squel=require(_0xa878('0xb'));var crypto=require(_0xa878('0xc'));var jsforce=require(_0xa878('0xd'));var deskjs=require(_0xa878('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa878('0xf'));var Redis=require(_0xa878('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa878('0x11'));var as=require(_0xa878('0x12'));var hardwareService=require(_0xa878('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa878('0x14'));var config=require(_0xa878('0x15'));var licenseUtil=require(_0xa878('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f382,_0x5d9a27){_0x5d9a27=_0x5d9a27||0xcc;return function(_0x4f429b){if(_0x4f429b){return _0x14f382[_0xa878('0x17')](_0x5d9a27);}return _0x14f382[_0xa878('0x18')](_0x5d9a27)[_0xa878('0x19')]();};}function respondWithResult(_0x32e97e,_0x5e4c92){_0x5e4c92=_0x5e4c92||0xc8;return function(_0x1e690d){if(_0x1e690d){return _0x32e97e[_0xa878('0x18')](_0x5e4c92)[_0xa878('0x1a')](_0x1e690d);}};}function respondWithFilteredResult(_0x4b4237,_0x4c87c0){return function(_0x5ad158){if(_0x5ad158){var _0x7e67f9=typeof _0x4c87c0[_0xa878('0x1b')]==='undefined'&&typeof _0x4c87c0[_0xa878('0x1c')]===_0xa878('0x1d');var _0x5aa0e8=_0x5ad158[_0xa878('0x1e')];var _0x1adee1=_0x7e67f9?0x0:_0x4c87c0[_0xa878('0x1b')];var _0x3408be=_0x7e67f9?_0x5ad158[_0xa878('0x1e')]:_0x4c87c0[_0xa878('0x1b')]+_0x4c87c0[_0xa878('0x1c')];var _0x1a726c;if(_0x3408be>=_0x5aa0e8){_0x3408be=_0x5aa0e8;_0x1a726c=0xc8;}else{_0x1a726c=0xce;}_0x4b4237[_0xa878('0x18')](_0x1a726c);return _0x4b4237[_0xa878('0x1f')](_0xa878('0x20'),_0x1adee1+'-'+_0x3408be+'/'+_0x5aa0e8)['json'](_0x5ad158);}return null;};}function patchUpdates(_0x4c8c8c){return function(_0x2c8303){try{jsonpatch[_0xa878('0x21')](_0x2c8303,_0x4c8c8c,!![]);}catch(_0x464fd4){return BPromise[_0xa878('0x22')](_0x464fd4);}return _0x2c8303[_0xa878('0x23')]();};}function saveUpdates(_0x140150,_0x627aca){return function(_0x4462f6){if(_0x4462f6){return _0x4462f6[_0xa878('0x24')](_0x140150)['then'](function(_0x45d32e){return _0x45d32e;});}return null;};}function removeEntity(_0x5d0a96,_0x3aa76b){return function(_0x3bc797){if(_0x3bc797){return _0x3bc797[_0xa878('0x25')]()[_0xa878('0x26')](function(){_0x5d0a96['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55cf3b,_0x3ad51a){return function(_0x1396bf){if(!_0x1396bf){_0x55cf3b[_0xa878('0x17')](0x194);}return _0x1396bf;};}function handleError(_0x43747e,_0x2811dd){_0x2811dd=_0x2811dd||0x1f4;return function(_0x209406){logger[_0xa878('0x27')](_0x209406[_0xa878('0x28')]);if(_0x209406['name']){delete _0x209406[_0xa878('0x29')];}_0x43747e[_0xa878('0x18')](_0x2811dd)[_0xa878('0x2a')](_0x209406);};}exports['index']=function(_0x3a2e33,_0x116811){var _0x2b64b3={},_0x13b8f4={},_0x16c47f={'count':0x0,'rows':[]};var _0x160064=_[_0xa878('0x2b')](db[_0xa878('0x2c')][_0xa878('0x2d')],function(_0x4a9dda){return{'name':_0x4a9dda[_0xa878('0x2e')],'type':_0x4a9dda[_0xa878('0x2f')][_0xa878('0x30')]};});_0x13b8f4[_0xa878('0x31')]=_[_0xa878('0x2b')](_0x160064,_0xa878('0x29'));_0x13b8f4[_0xa878('0x32')]=_[_0xa878('0x33')](_0x3a2e33[_0xa878('0x32')]);_0x13b8f4['filters']=_[_0xa878('0x34')](_0x13b8f4[_0xa878('0x31')],_0x13b8f4['query']);_0x2b64b3[_0xa878('0x35')]=_['intersection'](_0x13b8f4[_0xa878('0x31')],qs[_0xa878('0x36')](_0x3a2e33['query'][_0xa878('0x36')]));_0x2b64b3[_0xa878('0x35')]=_0x2b64b3[_0xa878('0x35')][_0xa878('0x37')]?_0x2b64b3[_0xa878('0x35')]:_0x13b8f4[_0xa878('0x31')];if(!_0x3a2e33[_0xa878('0x32')]['hasOwnProperty']('nolimit')){_0x2b64b3[_0xa878('0x1c')]=qs[_0xa878('0x1c')](_0x3a2e33[_0xa878('0x32')][_0xa878('0x1c')]);_0x2b64b3['offset']=qs[_0xa878('0x1b')](_0x3a2e33[_0xa878('0x32')]['offset']);}_0x2b64b3['order']=qs[_0xa878('0x38')](_0x3a2e33[_0xa878('0x32')][_0xa878('0x38')]);_0x2b64b3[_0xa878('0x39')]=qs[_0xa878('0x3a')](_[_0xa878('0x3b')](_0x3a2e33['query'],_0x13b8f4[_0xa878('0x3a')]),_0x160064);if(_0x3a2e33['query'][_0xa878('0x3c')]){_0x2b64b3['where']=_[_0xa878('0x3d')](_0x2b64b3[_0xa878('0x39')],{'$or':_[_0xa878('0x2b')](_0x160064,function(_0x5032fb){if(_0x5032fb[_0xa878('0x2f')]!==_0xa878('0x3e')){var _0x49fd99={};_0x49fd99[_0x5032fb[_0xa878('0x29')]]={'$like':'%'+_0x3a2e33[_0xa878('0x32')][_0xa878('0x3c')]+'%'};return _0x49fd99;}})});}_0x2b64b3=_['merge']({},_0x2b64b3,_0x3a2e33[_0xa878('0x3f')]);var _0x14105f={'where':_0x2b64b3[_0xa878('0x39')]};return db[_0xa878('0x2c')][_0xa878('0x1e')](_0x14105f)[_0xa878('0x26')](function(_0x8b5de4){_0x16c47f[_0xa878('0x1e')]=_0x8b5de4;if(_0x3a2e33[_0xa878('0x32')][_0xa878('0x40')]){_0x2b64b3[_0xa878('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xa878('0x42')](_0x2b64b3);})[_0xa878('0x26')](function(_0x3e1755){_0x16c47f[_0xa878('0x43')]=_0x3e1755;return _0x16c47f;})[_0xa878('0x26')](respondWithFilteredResult(_0x116811,_0x2b64b3))[_0xa878('0x44')](handleError(_0x116811,null));};exports['show']=function(_0x498f66,_0x59bb26){var _0x15de47={'raw':!![],'where':{'id':_0x498f66[_0xa878('0x45')]['id']}},_0x3e0309={};_0x3e0309[_0xa878('0x31')]=_[_0xa878('0x33')](db['MailSubstatus'][_0xa878('0x2d')]);_0x3e0309[_0xa878('0x32')]=_[_0xa878('0x33')](_0x498f66[_0xa878('0x32')]);_0x3e0309[_0xa878('0x3a')]=_[_0xa878('0x34')](_0x3e0309[_0xa878('0x31')],_0x3e0309[_0xa878('0x32')]);_0x15de47[_0xa878('0x35')]=_[_0xa878('0x34')](_0x3e0309['model'],qs['fields'](_0x498f66['query']['fields']));_0x15de47[_0xa878('0x35')]=_0x15de47[_0xa878('0x35')][_0xa878('0x37')]?_0x15de47[_0xa878('0x35')]:_0x3e0309[_0xa878('0x31')];if(_0x498f66['query'][_0xa878('0x40')]){_0x15de47[_0xa878('0x41')]=[{'all':!![]}];}_0x15de47=_[_0xa878('0x3d')]({},_0x15de47,_0x498f66['options']);return db['MailSubstatus'][_0xa878('0x46')](_0x15de47)['then'](handleEntityNotFound(_0x59bb26,null))[_0xa878('0x26')](respondWithResult(_0x59bb26,null))[_0xa878('0x44')](handleError(_0x59bb26,null));};exports[_0xa878('0x47')]=function(_0x13031d,_0x2c6ad1){return db[_0xa878('0x2c')][_0xa878('0x47')](_0x13031d[_0xa878('0x48')],{})[_0xa878('0x26')](respondWithResult(_0x2c6ad1,0xc9))[_0xa878('0x44')](handleError(_0x2c6ad1,null));};exports[_0xa878('0x24')]=function(_0x155f01,_0x23e605){if(_0x155f01[_0xa878('0x48')]['id']){delete _0x155f01['body']['id'];}return db[_0xa878('0x2c')]['find']({'where':{'id':_0x155f01[_0xa878('0x45')]['id']}})[_0xa878('0x26')](handleEntityNotFound(_0x23e605,null))[_0xa878('0x26')](saveUpdates(_0x155f01['body'],null))[_0xa878('0x26')](respondWithResult(_0x23e605,null))['catch'](handleError(_0x23e605,null));};exports[_0xa878('0x25')]=function(_0x1c68ce,_0x39d8a9){return db[_0xa878('0x2c')][_0xa878('0x46')]({'where':{'id':_0x1c68ce[_0xa878('0x45')]['id']}})[_0xa878('0x26')](handleEntityNotFound(_0x39d8a9,null))[_0xa878('0x26')](removeEntity(_0x39d8a9,null))['catch'](handleError(_0x39d8a9,null));};exports['describe']=function(_0xbe7269,_0x3db84c){return db['MailSubstatus'][_0xa878('0x49')]()[_0xa878('0x26')](respondWithResult(_0x3db84c,null))[_0xa878('0x44')](handleError(_0x3db84c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 6c804c9..bade256 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 _0x62a1=['MailSubstatus','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x41f945,_0x3b2703){var _0x5761ce=function(_0x42b71e){while(--_0x42b71e){_0x41f945['push'](_0x41f945['shift']());}};_0x5761ce(++_0x3b2703);}(_0x62a1,0x1de));var _0x162a=function(_0x3fc00c,_0xe428bf){_0x3fc00c=_0x3fc00c-0x0;var _0x22d135=_0x62a1[_0x3fc00c];return _0x22d135;};'use strict';var EventEmitter=require(_0x162a('0x0'));var MailSubstatus=require(_0x162a('0x1'))['db'][_0x162a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x162a('0x3')](0x0);var events={'afterUpdate':_0x162a('0x4')};function emitEvent(_0x232c8c){return function(_0x598f84,_0x17a097,_0x4019b4){MailSubstatusEvents[_0x162a('0x5')](_0x232c8c+':'+_0x598f84['id'],_0x598f84);MailSubstatusEvents[_0x162a('0x5')](_0x232c8c,_0x598f84);_0x4019b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x162a('0x6')](e,emitEvent(event));}}module[_0x162a('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x40f5=['MailSubstatus','setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x5bc405,_0x2b89e1){var _0x57822b=function(_0x1ca900){while(--_0x1ca900){_0x5bc405['push'](_0x5bc405['shift']());}};_0x57822b(++_0x2b89e1);}(_0x40f5,0x1b0));var _0x540f=function(_0x4c4b3a,_0xdffe34){_0x4c4b3a=_0x4c4b3a-0x0;var _0x18bd63=_0x40f5[_0x4c4b3a];return _0x18bd63;};'use strict';var EventEmitter=require(_0x540f('0x0'));var MailSubstatus=require(_0x540f('0x1'))['db'][_0x540f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x540f('0x3')](0x0);var events={'afterUpdate':_0x540f('0x4')};function emitEvent(_0x41d2d1){return function(_0x53c390,_0x5e90ae,_0x59a38e){MailSubstatusEvents[_0x540f('0x5')](_0x41d2d1+':'+_0x53c390['id'],_0x53c390);MailSubstatusEvents[_0x540f('0x5')](_0x41d2d1,_0x53c390);_0x59a38e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x540f('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1b4f861..02d83eb 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 _0x545c=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','then'];(function(_0x329637,_0x51b33c){var _0x16d573=function(_0x33e044){while(--_0x33e044){_0x329637['push'](_0x329637['shift']());}};_0x16d573(++_0x51b33c);}(_0x545c,0x1a5));var _0xc545=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0x545c[_0x5c78d9];return _0x69ae1f;};'use strict';var attributes=require(_0xc545('0x0'));module[_0xc545('0x1')]=function(_0x3f5e23){var _0x5d503a=_0x3f5e23[_0xc545('0x2')];return _0x3f5e23[_0xc545('0x3')](_0xc545('0x4'),attributes,{'tableName':_0xc545('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x566a50,_0x58b029,_0x584b5e){return _0x5d503a[_0xc545('0x6')]['update']({'value':_0x566a50[_0xc545('0x7')]},{'where':{'field':_0xc545('0x8'),'value':_0x566a50[_0xc545('0x9')]['name']}})[_0xc545('0xa')](function(){_0x584b5e();})[_0xc545('0xb')](function(_0x3b17f9){_0x584b5e(_0x3b17f9);});}}});}; \ No newline at end of file +var _0x1066=['name','mailSubstatus','_previousDataValues','catch','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','update'];(function(_0x4fc2c3,_0xeb027f){var _0x1a2567=function(_0x4b8938){while(--_0x4b8938){_0x4fc2c3['push'](_0x4fc2c3['shift']());}};_0x1a2567(++_0xeb027f);}(_0x1066,0xd6));var _0x6106=function(_0x3280b0,_0x5a45c0){_0x3280b0=_0x3280b0-0x0;var _0x5b7a48=_0x1066[_0x3280b0];return _0x5b7a48;};'use strict';var attributes=require(_0x6106('0x0'));module[_0x6106('0x1')]=function(_0x2b7d37){var _0x5c0a4d=_0x2b7d37['models'];return _0x2b7d37[_0x6106('0x2')](_0x6106('0x3'),attributes,{'tableName':_0x6106('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3b1099,_0xce3a33,_0xeede0e){return _0x5c0a4d['Condition'][_0x6106('0x5')]({'value':_0x3b1099[_0x6106('0x6')]},{'where':{'field':_0x6106('0x7'),'value':_0x3b1099[_0x6106('0x8')][_0x6106('0x6')]}})['then'](function(){_0xeede0e();})[_0x6106('0x9')](function(_0xa2679e){_0xeede0e(_0xa2679e);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 02d3bf7..a81de57 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 _0xe66a=['jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x416202,_0x23d58d){var _0xf4a127=function(_0x4edb1f){while(--_0x4edb1f){_0x416202['push'](_0x416202['shift']());}};_0xf4a127(++_0x23d58d);}(_0xe66a,0x11e));var _0xae66=function(_0x1c28a1,_0x494081){_0x1c28a1=_0x1c28a1-0x0;var _0x604f4c=_0xe66a[_0x1c28a1];return _0x604f4c;};'use strict';var _=require('lodash');var util=require(_0xae66('0x0'));var moment=require(_0xae66('0x1'));var BPromise=require(_0xae66('0x2'));var rs=require(_0xae66('0x3'));var fs=require('fs');var Redis=require(_0xae66('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae66('0x5'))(_0xae66('0x6'));var config=require(_0xae66('0x7'));var jayson=require(_0xae66('0x8'));var client=jayson['client'][_0xae66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e3d60,_0x3538cd,_0x4f9a26){return new BPromise(function(_0x13f45e,_0xff8b84){return client[_0xae66('0xa')](_0x3e3d60,_0x4f9a26)['then'](function(_0x42e440){logger[_0xae66('0xb')](_0xae66('0xc'),_0x3538cd,_0xae66('0xd'));logger[_0xae66('0xe')](_0xae66('0xf'),_0x3538cd,'request\x20sent',JSON[_0xae66('0x10')](_0x42e440));if(_0x42e440[_0xae66('0x11')]){if(_0x42e440[_0xae66('0x11')][_0xae66('0x12')]===0x1f4){logger['error'](_0xae66('0xc'),_0x3538cd,_0x42e440['error'][_0xae66('0x13')]);return _0xff8b84(_0x42e440[_0xae66('0x11')][_0xae66('0x13')]);}logger[_0xae66('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x3538cd,_0x42e440[_0xae66('0x11')][_0xae66('0x13')]);return _0x13f45e(_0x42e440[_0xae66('0x11')][_0xae66('0x13')]);}else{logger[_0xae66('0xb')](_0xae66('0xc'),_0x3538cd,_0xae66('0xd'));_0x13f45e(_0x42e440['result'][_0xae66('0x13')]);}})[_0xae66('0x14')](function(_0x395e85){logger[_0xae66('0x11')](_0xae66('0xc'),_0x3538cd,_0x395e85);_0xff8b84(_0x395e85);});});} \ No newline at end of file +var _0x2dd3=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','MailSubstatus,\x20%s,\x20%s','message','result','catch'];(function(_0x71e503,_0x2bf4d8){var _0x29650f=function(_0x248e60){while(--_0x248e60){_0x71e503['push'](_0x71e503['shift']());}};_0x29650f(++_0x2bf4d8);}(_0x2dd3,0x6e));var _0x32dd=function(_0x41e182,_0x7ba76c){_0x41e182=_0x41e182-0x0;var _0x3c6252=_0x2dd3[_0x41e182];return _0x3c6252;};'use strict';var _=require('lodash');var util=require(_0x32dd('0x0'));var moment=require(_0x32dd('0x1'));var BPromise=require(_0x32dd('0x2'));var rs=require(_0x32dd('0x3'));var fs=require('fs');var Redis=require(_0x32dd('0x4'));var db=require(_0x32dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x32dd('0x6'))(_0x32dd('0x7'));var config=require(_0x32dd('0x8'));var jayson=require(_0x32dd('0x9'));var client=jayson[_0x32dd('0xa')][_0x32dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f65d9,_0x26f2df,_0xbee4fe){return new BPromise(function(_0x174720,_0x4b1801){return client[_0x32dd('0xc')](_0x3f65d9,_0xbee4fe)['then'](function(_0x37b4c1){logger[_0x32dd('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x26f2df,_0x32dd('0xe'));logger[_0x32dd('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x26f2df,_0x32dd('0xe'),JSON[_0x32dd('0x10')](_0x37b4c1));if(_0x37b4c1[_0x32dd('0x11')]){if(_0x37b4c1[_0x32dd('0x11')]['code']===0x1f4){logger[_0x32dd('0x11')](_0x32dd('0x12'),_0x26f2df,_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);return _0x4b1801(_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);}logger[_0x32dd('0x11')](_0x32dd('0x12'),_0x26f2df,_0x37b4c1['error'][_0x32dd('0x13')]);return _0x174720(_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);}else{logger[_0x32dd('0xd')](_0x32dd('0x12'),_0x26f2df,'request\x20sent');_0x174720(_0x37b4c1[_0x32dd('0x14')][_0x32dd('0x13')]);}})[_0x32dd('0x15')](function(_0x4edac4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x26f2df,_0x4edac4);_0x4b1801(_0x4edac4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 51dc05f..7de4eed 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 _0x2703=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x456ad4,_0x550f34){var _0x1b80eb=function(_0x9a40e7){while(--_0x9a40e7){_0x456ad4['push'](_0x456ad4['shift']());}};_0x1b80eb(++_0x550f34);}(_0x2703,0xf7));var _0x3270=function(_0x565da8,_0xbdf9b5){_0x565da8=_0x565da8-0x0;var _0x3361c7=_0x2703[_0x565da8];return _0x3361c7;};'use strict';var multer=require(_0x3270('0x0'));var util=require(_0x3270('0x1'));var path=require(_0x3270('0x2'));var timeout=require(_0x3270('0x3'));var express=require('express');var router=express[_0x3270('0x4')]();var fs_extra=require(_0x3270('0x5'));var auth=require(_0x3270('0x6'));var interaction=require(_0x3270('0x7'));var config=require(_0x3270('0x8'));var controller=require(_0x3270('0x9'));router[_0x3270('0xa')]('/',auth[_0x3270('0xb')](),controller[_0x3270('0xc')]);router[_0x3270('0xa')]('/describe',auth[_0x3270('0xb')](),controller[_0x3270('0xd')]);router[_0x3270('0xa')]('/:id',auth[_0x3270('0xb')](),controller[_0x3270('0xe')]);router[_0x3270('0xf')]('/',auth['isAuthenticated'](),controller[_0x3270('0x10')]);router[_0x3270('0x11')]('/:id',auth[_0x3270('0xb')](),controller[_0x3270('0x12')]);router[_0x3270('0x13')]('/:id',auth[_0x3270('0xb')](),controller[_0x3270('0x14')]);module['exports']=router; \ No newline at end of file +var _0xef4e=['describe','/:id','isAuthenticated','post','create','delete','destroy','multer','util','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','/describe'];(function(_0x350f37,_0x4c333c){var _0x1ff256=function(_0x580bb3){while(--_0x580bb3){_0x350f37['push'](_0x350f37['shift']());}};_0x1ff256(++_0x4c333c);}(_0xef4e,0x1d8));var _0xeef4=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0xef4e[_0x5a0d6c];return _0x1b9fc1;};'use strict';var multer=require(_0xeef4('0x0'));var util=require(_0xeef4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeef4('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeef4('0x3'));var config=require(_0xeef4('0x4'));var controller=require(_0xeef4('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xeef4('0x6')](_0xeef4('0x7'),auth['isAuthenticated'](),controller[_0xeef4('0x8')]);router['get'](_0xeef4('0x9'),auth[_0xeef4('0xa')](),controller['show']);router[_0xeef4('0xb')]('/',auth[_0xeef4('0xa')](),controller[_0xeef4('0xc')]);router['put'](_0xeef4('0x9'),auth[_0xeef4('0xa')](),controller['update']);router[_0xeef4('0xd')](_0xeef4('0x9'),auth[_0xeef4('0xa')](),controller[_0xeef4('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4f4a286..28e73fc 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0xa37ba7,_0x3b1cb7){var _0x3ac1c8=function(_0x4fd1d3){while(--_0x4fd1d3){_0xa37ba7['push'](_0xa37ba7['shift']());}};_0x3ac1c8(++_0x3b1cb7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x38c494,_0x167708){_0x38c494=_0x38c494-0x0;var _0xa37668=_0xf4eb[_0x38c494];return _0xa37668;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xae6db5,_0x5b81e9){var _0x526e3c=function(_0x477b79){while(--_0x477b79){_0xae6db5['push'](_0xae6db5['shift']());}};_0x526e3c(++_0x5b81e9);}(_0x008c,0x188));var _0xc008=function(_0x5e5658,_0x5ceb37){_0x5e5658=_0x5e5658-0x0;var _0x501ff8=_0x008c[_0x5e5658];return _0x501ff8;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 33c4c65..6e20695 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 _0xd82f=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection'];(function(_0xec34ea,_0x3cb9c9){var _0x10fc3a=function(_0x41a654){while(--_0x41a654){_0xec34ea['push'](_0xec34ea['shift']());}};_0x10fc3a(++_0x3cb9c9);}(_0xd82f,0xa8));var _0xfd82=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd82f[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xfd82('0x0'));var rimraf=require(_0xfd82('0x1'));var zipdir=require(_0xfd82('0x2'));var jsonpatch=require(_0xfd82('0x3'));var rp=require(_0xfd82('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfd82('0x5'));var util=require('util');var path=require(_0xfd82('0x6'));var sox=require(_0xfd82('0x7'));var csv=require('to-csv');var ejs=require(_0xfd82('0x8'));var fs=require('fs');var fs_extra=require(_0xfd82('0x9'));var _=require('lodash');var squel=require(_0xfd82('0xa'));var crypto=require(_0xfd82('0xb'));var jsforce=require(_0xfd82('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd82('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd82('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfd82('0xf'));var as=require(_0xfd82('0x10'));var hardwareService=require(_0xfd82('0x11'));var logger=require(_0xfd82('0x12'))(_0xfd82('0x13'));var utils=require(_0xfd82('0x14'));var config=require(_0xfd82('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd82('0x16'))['db'];function respondWithStatusCode(_0x25de39,_0x287b54){_0x287b54=_0x287b54||0xcc;return function(_0x617551){if(_0x617551){return _0x25de39['sendStatus'](_0x287b54);}return _0x25de39['status'](_0x287b54)[_0xfd82('0x17')]();};}function respondWithResult(_0x42dbb2,_0x5a2b78){_0x5a2b78=_0x5a2b78||0xc8;return function(_0xd4b6c8){if(_0xd4b6c8){return _0x42dbb2[_0xfd82('0x18')](_0x5a2b78)[_0xfd82('0x19')](_0xd4b6c8);}};}function respondWithFilteredResult(_0x58cffe,_0x394ab1){return function(_0x25d993){if(_0x25d993){var _0x4fc2f2=typeof _0x394ab1[_0xfd82('0x1a')]===_0xfd82('0x1b')&&typeof _0x394ab1[_0xfd82('0x1c')]===_0xfd82('0x1b');var _0x49e02b=_0x25d993[_0xfd82('0x1d')];var _0x566c47=_0x4fc2f2?0x0:_0x394ab1[_0xfd82('0x1a')];var _0x3131af=_0x4fc2f2?_0x25d993['count']:_0x394ab1[_0xfd82('0x1a')]+_0x394ab1['limit'];var _0x460d0f;if(_0x3131af>=_0x49e02b){_0x3131af=_0x49e02b;_0x460d0f=0xc8;}else{_0x460d0f=0xce;}_0x58cffe[_0xfd82('0x18')](_0x460d0f);return _0x58cffe[_0xfd82('0x1e')](_0xfd82('0x1f'),_0x566c47+'-'+_0x3131af+'/'+_0x49e02b)[_0xfd82('0x19')](_0x25d993);}return null;};}function patchUpdates(_0x58fcbf){return function(_0xc538a1){try{jsonpatch[_0xfd82('0x20')](_0xc538a1,_0x58fcbf,!![]);}catch(_0x2730fb){return BPromise[_0xfd82('0x21')](_0x2730fb);}return _0xc538a1['save']();};}function saveUpdates(_0x37585f,_0x2c9587){return function(_0x55b579){if(_0x55b579){return _0x55b579[_0xfd82('0x22')](_0x37585f)[_0xfd82('0x23')](function(_0x38daeb){return _0x38daeb;});}return null;};}function removeEntity(_0x4842c2,_0x124448){return function(_0x58ceb3){if(_0x58ceb3){return _0x58ceb3[_0xfd82('0x24')]()['then'](function(){_0x4842c2[_0xfd82('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ffa0c,_0x22733f){return function(_0x290295){if(!_0x290295){_0x3ffa0c[_0xfd82('0x25')](0x194);}return _0x290295;};}function handleError(_0x357e42,_0x536b58){_0x536b58=_0x536b58||0x1f4;return function(_0x4f6011){logger[_0xfd82('0x26')](_0x4f6011[_0xfd82('0x27')]);if(_0x4f6011[_0xfd82('0x28')]){delete _0x4f6011[_0xfd82('0x28')];}_0x357e42[_0xfd82('0x18')](_0x536b58)['send'](_0x4f6011);};}exports[_0xfd82('0x29')]=function(_0x2138d0,_0x528dfc){var _0xe5a43e={},_0x544b55={},_0x2e4fe0={'count':0x0,'rows':[]};var _0xf833a5=_[_0xfd82('0x2a')](db[_0xfd82('0x2b')][_0xfd82('0x2c')],function(_0x4623ae){return{'name':_0x4623ae[_0xfd82('0x2d')],'type':_0x4623ae['type']['key']};});_0x544b55[_0xfd82('0x2e')]=_[_0xfd82('0x2a')](_0xf833a5,_0xfd82('0x28'));_0x544b55[_0xfd82('0x2f')]=_[_0xfd82('0x30')](_0x2138d0[_0xfd82('0x2f')]);_0x544b55[_0xfd82('0x31')]=_[_0xfd82('0x32')](_0x544b55[_0xfd82('0x2e')],_0x544b55[_0xfd82('0x2f')]);_0xe5a43e[_0xfd82('0x33')]=_['intersection'](_0x544b55[_0xfd82('0x2e')],qs[_0xfd82('0x34')](_0x2138d0[_0xfd82('0x2f')][_0xfd82('0x34')]));_0xe5a43e[_0xfd82('0x33')]=_0xe5a43e[_0xfd82('0x33')]['length']?_0xe5a43e['attributes']:_0x544b55[_0xfd82('0x2e')];if(!_0x2138d0[_0xfd82('0x2f')][_0xfd82('0x35')](_0xfd82('0x36'))){_0xe5a43e[_0xfd82('0x1c')]=qs['limit'](_0x2138d0[_0xfd82('0x2f')][_0xfd82('0x1c')]);_0xe5a43e[_0xfd82('0x1a')]=qs[_0xfd82('0x1a')](_0x2138d0[_0xfd82('0x2f')]['offset']);}_0xe5a43e[_0xfd82('0x37')]=qs[_0xfd82('0x38')](_0x2138d0[_0xfd82('0x2f')][_0xfd82('0x38')]);_0xe5a43e[_0xfd82('0x39')]=qs[_0xfd82('0x31')](_[_0xfd82('0x3a')](_0x2138d0[_0xfd82('0x2f')],_0x544b55[_0xfd82('0x31')]),_0xf833a5);if(_0x2138d0[_0xfd82('0x2f')]['filter']){_0xe5a43e[_0xfd82('0x39')]=_[_0xfd82('0x3b')](_0xe5a43e['where'],{'$or':_[_0xfd82('0x2a')](_0xf833a5,function(_0x597455){if(_0x597455['type']!==_0xfd82('0x3c')){var _0x3abb9a={};_0x3abb9a[_0x597455[_0xfd82('0x28')]]={'$like':'%'+_0x2138d0[_0xfd82('0x2f')]['filter']+'%'};return _0x3abb9a;}})});}_0xe5a43e=_[_0xfd82('0x3b')]({},_0xe5a43e,_0x2138d0['options']);var _0x53064e={'where':_0xe5a43e[_0xfd82('0x39')]};return db[_0xfd82('0x2b')][_0xfd82('0x1d')](_0x53064e)['then'](function(_0x41f40b){_0x2e4fe0[_0xfd82('0x1d')]=_0x41f40b;if(_0x2138d0['query'][_0xfd82('0x3d')]){_0xe5a43e['include']=[{'all':!![]}];}return db[_0xfd82('0x2b')][_0xfd82('0x3e')](_0xe5a43e);})[_0xfd82('0x23')](function(_0x5cd59d){_0x2e4fe0[_0xfd82('0x3f')]=_0x5cd59d;return _0x2e4fe0;})[_0xfd82('0x23')](respondWithFilteredResult(_0x528dfc,_0xe5a43e))[_0xfd82('0x40')](handleError(_0x528dfc,null));};exports[_0xfd82('0x41')]=function(_0x1b0423,_0x57e0a1){var _0x48c38f={'raw':!![],'where':{'id':_0x1b0423[_0xfd82('0x42')]['id']}},_0x31e753={};_0x31e753['model']=_[_0xfd82('0x30')](db[_0xfd82('0x2b')]['rawAttributes']);_0x31e753[_0xfd82('0x2f')]=_[_0xfd82('0x30')](_0x1b0423[_0xfd82('0x2f')]);_0x31e753[_0xfd82('0x31')]=_['intersection'](_0x31e753[_0xfd82('0x2e')],_0x31e753['query']);_0x48c38f['attributes']=_[_0xfd82('0x32')](_0x31e753['model'],qs['fields'](_0x1b0423[_0xfd82('0x2f')][_0xfd82('0x34')]));_0x48c38f[_0xfd82('0x33')]=_0x48c38f[_0xfd82('0x33')][_0xfd82('0x43')]?_0x48c38f['attributes']:_0x31e753[_0xfd82('0x2e')];if(_0x1b0423[_0xfd82('0x2f')][_0xfd82('0x3d')]){_0x48c38f[_0xfd82('0x44')]=[{'all':!![]}];}_0x48c38f=_[_0xfd82('0x3b')]({},_0x48c38f,_0x1b0423[_0xfd82('0x45')]);return db['MailTransferReport'][_0xfd82('0x46')](_0x48c38f)[_0xfd82('0x23')](handleEntityNotFound(_0x57e0a1,null))[_0xfd82('0x23')](respondWithResult(_0x57e0a1,null))[_0xfd82('0x40')](handleError(_0x57e0a1,null));};exports['create']=function(_0x534773,_0x2fe85b){return db[_0xfd82('0x2b')][_0xfd82('0x47')](_0x534773[_0xfd82('0x48')],{})[_0xfd82('0x23')](respondWithResult(_0x2fe85b,0xc9))[_0xfd82('0x40')](handleError(_0x2fe85b,null));};exports[_0xfd82('0x22')]=function(_0x31c89a,_0x590c33){if(_0x31c89a[_0xfd82('0x48')]['id']){delete _0x31c89a[_0xfd82('0x48')]['id'];}return db[_0xfd82('0x2b')][_0xfd82('0x46')]({'where':{'id':_0x31c89a[_0xfd82('0x42')]['id']}})[_0xfd82('0x23')](handleEntityNotFound(_0x590c33,null))['then'](saveUpdates(_0x31c89a[_0xfd82('0x48')],null))[_0xfd82('0x23')](respondWithResult(_0x590c33,null))[_0xfd82('0x40')](handleError(_0x590c33,null));};exports['destroy']=function(_0x167bb0,_0x3b10fd){return db['MailTransferReport'][_0xfd82('0x46')]({'where':{'id':_0x167bb0[_0xfd82('0x42')]['id']}})[_0xfd82('0x23')](handleEntityNotFound(_0x3b10fd,null))[_0xfd82('0x23')](removeEntity(_0x3b10fd,null))[_0xfd82('0x40')](handleError(_0x3b10fd,null));};exports['describe']=function(_0x869638,_0x1a96d5){return db[_0xfd82('0x2b')]['describe']()['then'](respondWithResult(_0x1a96d5,null))[_0xfd82('0x40')](handleError(_0x1a96d5,null));}; \ No newline at end of file +var _0x96f6=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailTransferReport','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','then','end','stack','name','send','index','map','fieldName'];(function(_0x488dda,_0x24db1c){var _0x43cb7e=function(_0x53e8b0){while(--_0x53e8b0){_0x488dda['push'](_0x488dda['shift']());}};_0x43cb7e(++_0x24db1c);}(_0x96f6,0x19e));var _0x696f=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x96f6[_0x37b7b6];return _0x10c4c3;};'use strict';var emlformat=require(_0x696f('0x0'));var rimraf=require(_0x696f('0x1'));var zipdir=require(_0x696f('0x2'));var jsonpatch=require(_0x696f('0x3'));var rp=require(_0x696f('0x4'));var moment=require(_0x696f('0x5'));var BPromise=require(_0x696f('0x6'));var Mustache=require('mustache');var util=require(_0x696f('0x7'));var path=require(_0x696f('0x8'));var sox=require('sox');var csv=require(_0x696f('0x9'));var ejs=require(_0x696f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x696f('0xb'));var squel=require(_0x696f('0xc'));var crypto=require(_0x696f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x696f('0xe'));var toCsv=require(_0x696f('0x9'));var querystring=require('querystring');var Papa=require(_0x696f('0xf'));var Redis=require(_0x696f('0x10'));var authService=require(_0x696f('0x11'));var qs=require(_0x696f('0x12'));var as=require(_0x696f('0x13'));var hardwareService=require(_0x696f('0x14'));var logger=require(_0x696f('0x15'))('api');var utils=require(_0x696f('0x16'));var config=require(_0x696f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x696f('0x18'))['db'];function respondWithStatusCode(_0x446a58,_0x1d4685){_0x1d4685=_0x1d4685||0xcc;return function(_0x573efd){if(_0x573efd){return _0x446a58[_0x696f('0x19')](_0x1d4685);}return _0x446a58[_0x696f('0x1a')](_0x1d4685)['end']();};}function respondWithResult(_0x268752,_0x5c1f9b){_0x5c1f9b=_0x5c1f9b||0xc8;return function(_0xcbe00f){if(_0xcbe00f){return _0x268752[_0x696f('0x1a')](_0x5c1f9b)[_0x696f('0x1b')](_0xcbe00f);}};}function respondWithFilteredResult(_0x29efcf,_0x59cfae){return function(_0x98a30f){if(_0x98a30f){var _0x2d8d77=typeof _0x59cfae[_0x696f('0x1c')]===_0x696f('0x1d')&&typeof _0x59cfae[_0x696f('0x1e')]==='undefined';var _0x495f2c=_0x98a30f[_0x696f('0x1f')];var _0x3b3487=_0x2d8d77?0x0:_0x59cfae['offset'];var _0x106a20=_0x2d8d77?_0x98a30f[_0x696f('0x1f')]:_0x59cfae[_0x696f('0x1c')]+_0x59cfae[_0x696f('0x1e')];var _0x11fbc2;if(_0x106a20>=_0x495f2c){_0x106a20=_0x495f2c;_0x11fbc2=0xc8;}else{_0x11fbc2=0xce;}_0x29efcf['status'](_0x11fbc2);return _0x29efcf[_0x696f('0x20')]('Content-Range',_0x3b3487+'-'+_0x106a20+'/'+_0x495f2c)['json'](_0x98a30f);}return null;};}function patchUpdates(_0x393f9f){return function(_0x5c5f9d){try{jsonpatch['apply'](_0x5c5f9d,_0x393f9f,!![]);}catch(_0x1012ed){return BPromise['reject'](_0x1012ed);}return _0x5c5f9d[_0x696f('0x21')]();};}function saveUpdates(_0x416e12,_0x3c0d52){return function(_0x468feb){if(_0x468feb){return _0x468feb['update'](_0x416e12)[_0x696f('0x22')](function(_0x3d8c08){return _0x3d8c08;});}return null;};}function removeEntity(_0x22533b,_0x3289cc){return function(_0x297255){if(_0x297255){return _0x297255['destroy']()[_0x696f('0x22')](function(){_0x22533b['status'](0xcc)[_0x696f('0x23')]();});}};}function handleEntityNotFound(_0x5369e1,_0xd68004){return function(_0x5cb78c){if(!_0x5cb78c){_0x5369e1[_0x696f('0x19')](0x194);}return _0x5cb78c;};}function handleError(_0x436e4b,_0x246653){_0x246653=_0x246653||0x1f4;return function(_0x4c7bac){logger['error'](_0x4c7bac[_0x696f('0x24')]);if(_0x4c7bac[_0x696f('0x25')]){delete _0x4c7bac[_0x696f('0x25')];}_0x436e4b[_0x696f('0x1a')](_0x246653)[_0x696f('0x26')](_0x4c7bac);};}exports[_0x696f('0x27')]=function(_0x3468b5,_0x5f4438){var _0x49dd45={},_0x39c37d={},_0x43230e={'count':0x0,'rows':[]};var _0x540932=_[_0x696f('0x28')](db['MailTransferReport']['rawAttributes'],function(_0x57038e){return{'name':_0x57038e[_0x696f('0x29')],'type':_0x57038e[_0x696f('0x2a')][_0x696f('0x2b')]};});_0x39c37d[_0x696f('0x2c')]=_[_0x696f('0x28')](_0x540932,_0x696f('0x25'));_0x39c37d[_0x696f('0x2d')]=_[_0x696f('0x2e')](_0x3468b5[_0x696f('0x2d')]);_0x39c37d[_0x696f('0x2f')]=_[_0x696f('0x30')](_0x39c37d[_0x696f('0x2c')],_0x39c37d[_0x696f('0x2d')]);_0x49dd45[_0x696f('0x31')]=_[_0x696f('0x30')](_0x39c37d[_0x696f('0x2c')],qs[_0x696f('0x32')](_0x3468b5[_0x696f('0x2d')][_0x696f('0x32')]));_0x49dd45[_0x696f('0x31')]=_0x49dd45['attributes'][_0x696f('0x33')]?_0x49dd45['attributes']:_0x39c37d[_0x696f('0x2c')];if(!_0x3468b5[_0x696f('0x2d')][_0x696f('0x34')](_0x696f('0x35'))){_0x49dd45['limit']=qs[_0x696f('0x1e')](_0x3468b5[_0x696f('0x2d')][_0x696f('0x1e')]);_0x49dd45['offset']=qs[_0x696f('0x1c')](_0x3468b5[_0x696f('0x2d')][_0x696f('0x1c')]);}_0x49dd45[_0x696f('0x36')]=qs['sort'](_0x3468b5[_0x696f('0x2d')][_0x696f('0x37')]);_0x49dd45[_0x696f('0x38')]=qs[_0x696f('0x2f')](_[_0x696f('0x39')](_0x3468b5['query'],_0x39c37d[_0x696f('0x2f')]),_0x540932);if(_0x3468b5[_0x696f('0x2d')][_0x696f('0x3a')]){_0x49dd45[_0x696f('0x38')]=_[_0x696f('0x3b')](_0x49dd45['where'],{'$or':_[_0x696f('0x28')](_0x540932,function(_0x628dc9){if(_0x628dc9[_0x696f('0x2a')]!==_0x696f('0x3c')){var _0x27a57b={};_0x27a57b[_0x628dc9[_0x696f('0x25')]]={'$like':'%'+_0x3468b5[_0x696f('0x2d')][_0x696f('0x3a')]+'%'};return _0x27a57b;}})});}_0x49dd45=_[_0x696f('0x3b')]({},_0x49dd45,_0x3468b5[_0x696f('0x3d')]);var _0x5009ca={'where':_0x49dd45['where']};return db[_0x696f('0x3e')][_0x696f('0x1f')](_0x5009ca)[_0x696f('0x22')](function(_0x40955b){_0x43230e[_0x696f('0x1f')]=_0x40955b;if(_0x3468b5[_0x696f('0x2d')][_0x696f('0x3f')]){_0x49dd45['include']=[{'all':!![]}];}return db[_0x696f('0x3e')][_0x696f('0x40')](_0x49dd45);})[_0x696f('0x22')](function(_0x36fd97){_0x43230e['rows']=_0x36fd97;return _0x43230e;})[_0x696f('0x22')](respondWithFilteredResult(_0x5f4438,_0x49dd45))['catch'](handleError(_0x5f4438,null));};exports[_0x696f('0x41')]=function(_0x293192,_0x36be81){var _0xa4c016={'raw':!![],'where':{'id':_0x293192[_0x696f('0x42')]['id']}},_0x89f26d={};_0x89f26d[_0x696f('0x2c')]=_['keys'](db[_0x696f('0x3e')][_0x696f('0x43')]);_0x89f26d['query']=_['keys'](_0x293192[_0x696f('0x2d')]);_0x89f26d[_0x696f('0x2f')]=_[_0x696f('0x30')](_0x89f26d[_0x696f('0x2c')],_0x89f26d[_0x696f('0x2d')]);_0xa4c016[_0x696f('0x31')]=_[_0x696f('0x30')](_0x89f26d[_0x696f('0x2c')],qs['fields'](_0x293192['query'][_0x696f('0x32')]));_0xa4c016[_0x696f('0x31')]=_0xa4c016[_0x696f('0x31')][_0x696f('0x33')]?_0xa4c016['attributes']:_0x89f26d['model'];if(_0x293192[_0x696f('0x2d')][_0x696f('0x3f')]){_0xa4c016[_0x696f('0x44')]=[{'all':!![]}];}_0xa4c016=_[_0x696f('0x3b')]({},_0xa4c016,_0x293192[_0x696f('0x3d')]);return db[_0x696f('0x3e')][_0x696f('0x45')](_0xa4c016)[_0x696f('0x22')](handleEntityNotFound(_0x36be81,null))[_0x696f('0x22')](respondWithResult(_0x36be81,null))[_0x696f('0x46')](handleError(_0x36be81,null));};exports[_0x696f('0x47')]=function(_0x4a830c,_0x570d51){return db[_0x696f('0x3e')][_0x696f('0x47')](_0x4a830c[_0x696f('0x48')],{})[_0x696f('0x22')](respondWithResult(_0x570d51,0xc9))['catch'](handleError(_0x570d51,null));};exports[_0x696f('0x49')]=function(_0x242711,_0x35c365){if(_0x242711[_0x696f('0x48')]['id']){delete _0x242711[_0x696f('0x48')]['id'];}return db[_0x696f('0x3e')][_0x696f('0x45')]({'where':{'id':_0x242711['params']['id']}})[_0x696f('0x22')](handleEntityNotFound(_0x35c365,null))[_0x696f('0x22')](saveUpdates(_0x242711['body'],null))[_0x696f('0x22')](respondWithResult(_0x35c365,null))[_0x696f('0x46')](handleError(_0x35c365,null));};exports[_0x696f('0x4a')]=function(_0x58f48b,_0x27146e){return db[_0x696f('0x3e')][_0x696f('0x45')]({'where':{'id':_0x58f48b[_0x696f('0x42')]['id']}})['then'](handleEntityNotFound(_0x27146e,null))[_0x696f('0x22')](removeEntity(_0x27146e,null))[_0x696f('0x46')](handleError(_0x27146e,null));};exports[_0x696f('0x4b')]=function(_0x2ac7a8,_0x221591){return db[_0x696f('0x3e')]['describe']()[_0x696f('0x22')](respondWithResult(_0x221591,null))[_0x696f('0x46')](handleError(_0x221591,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 192f363..cf454e7 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 _0xd307=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd307,0x110));var _0x7d30=function(_0x40f8f5,_0x1280cd){_0x40f8f5=_0x40f8f5-0x0;var _0x2a734c=_0xd307[_0x40f8f5];return _0x2a734c;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var logger=require(_0x7d30('0x2'))(_0x7d30('0x3'));var moment=require(_0x7d30('0x4'));var BPromise=require(_0x7d30('0x5'));var rp=require(_0x7d30('0x6'));var fs=require('fs');var path=require(_0x7d30('0x7'));var rimraf=require('rimraf');var config=require(_0x7d30('0x8'));var attributes=require(_0x7d30('0x9'));module['exports']=function(_0x400916,_0x449938){return _0x400916[_0x7d30('0xa')](_0x7d30('0xb'),attributes,{'tableName':_0x7d30('0xc'),'paranoid':![],'indexes':[{'name':_0x7d30('0xd'),'fields':[_0x7d30('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe44=['report_mail_transfer','uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x56ae0c,_0x564e4a){var _0x3c2b55=function(_0x3ae6a2){while(--_0x3ae6a2){_0x56ae0c['push'](_0x56ae0c['shift']());}};_0x3c2b55(++_0x564e4a);}(_0xbe44,0x13a));var _0x4be4=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xbe44[_0x31a37b];return _0x49ae16;};'use strict';var _=require(_0x4be4('0x0'));var util=require('util');var logger=require(_0x4be4('0x1'))(_0x4be4('0x2'));var moment=require('moment');var BPromise=require(_0x4be4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4be4('0x4'));var rimraf=require(_0x4be4('0x5'));var config=require('../../config/environment');var attributes=require(_0x4be4('0x6'));module[_0x4be4('0x7')]=function(_0x8d6311,_0x1bd43e){return _0x8d6311[_0x4be4('0x8')](_0x4be4('0x9'),attributes,{'tableName':_0x4be4('0xa'),'paranoid':![],'indexes':[{'name':_0x4be4('0xb'),'fields':[_0x4be4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8132a35..d133bce 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 _0x40fc=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0x40fc,0x1c5));var _0xc40f=function(_0x2e14bf,_0x3af516){_0x2e14bf=_0x2e14bf-0x0;var _0x1f7d7b=_0x40fc[_0x2e14bf];return _0x1f7d7b;};'use strict';var _=require(_0xc40f('0x0'));var util=require(_0xc40f('0x1'));var moment=require(_0xc40f('0x2'));var BPromise=require(_0xc40f('0x3'));var rs=require(_0xc40f('0x4'));var fs=require('fs');var Redis=require(_0xc40f('0x5'));var db=require(_0xc40f('0x6'))['db'];var utils=require(_0xc40f('0x7'));var logger=require('../../config/logger')(_0xc40f('0x8'));var config=require(_0xc40f('0x9'));var jayson=require(_0xc40f('0xa'));var client=jayson[_0xc40f('0xb')][_0xc40f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1128e0,_0x4139a9,_0x1663e6){return new BPromise(function(_0x407003,_0x111053){return client[_0xc40f('0xd')](_0x1128e0,_0x1663e6)['then'](function(_0x65fd9e){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x4139a9,_0xc40f('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4139a9,_0xc40f('0xe'),JSON[_0xc40f('0xf')](_0x65fd9e));if(_0x65fd9e[_0xc40f('0x10')]){if(_0x65fd9e[_0xc40f('0x10')][_0xc40f('0x11')]===0x1f4){logger[_0xc40f('0x10')](_0xc40f('0x12'),_0x4139a9,_0x65fd9e[_0xc40f('0x10')]['message']);return _0x111053(_0x65fd9e[_0xc40f('0x10')][_0xc40f('0x13')]);}logger[_0xc40f('0x10')](_0xc40f('0x12'),_0x4139a9,_0x65fd9e[_0xc40f('0x10')][_0xc40f('0x13')]);return _0x407003(_0x65fd9e[_0xc40f('0x10')][_0xc40f('0x13')]);}else{logger[_0xc40f('0x14')](_0xc40f('0x12'),_0x4139a9,_0xc40f('0xe'));_0x407003(_0x65fd9e[_0xc40f('0x15')][_0xc40f('0x13')]);}})[_0xc40f('0x16')](function(_0x21d0bd){logger[_0xc40f('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x4139a9,_0x21d0bd);_0x111053(_0x21d0bd);});});} \ No newline at end of file +var _0x8ed1=['message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','stringify','error','code'];(function(_0x4fb6b6,_0x5eb1c7){var _0x3ea470=function(_0x26228c){while(--_0x26228c){_0x4fb6b6['push'](_0x4fb6b6['shift']());}};_0x3ea470(++_0x5eb1c7);}(_0x8ed1,0x17a));var _0x18ed=function(_0x11ba20,_0x3eaef2){_0x11ba20=_0x11ba20-0x0;var _0x23f263=_0x8ed1[_0x11ba20];return _0x23f263;};'use strict';var _=require(_0x18ed('0x0'));var util=require(_0x18ed('0x1'));var moment=require('moment');var BPromise=require(_0x18ed('0x2'));var rs=require(_0x18ed('0x3'));var fs=require('fs');var Redis=require(_0x18ed('0x4'));var db=require(_0x18ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x18ed('0x6'))(_0x18ed('0x7'));var config=require('../../config/environment');var jayson=require(_0x18ed('0x8'));var client=jayson[_0x18ed('0x9')][_0x18ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30290c,_0x428cf8,_0x1f64ba){return new BPromise(function(_0x59271e,_0x4c3293){return client[_0x18ed('0xb')](_0x30290c,_0x1f64ba)[_0x18ed('0xc')](function(_0x285638){logger[_0x18ed('0xd')](_0x18ed('0xe'),_0x428cf8,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x428cf8,'request\x20sent',JSON[_0x18ed('0xf')](_0x285638));if(_0x285638[_0x18ed('0x10')]){if(_0x285638[_0x18ed('0x10')][_0x18ed('0x11')]===0x1f4){logger[_0x18ed('0x10')](_0x18ed('0xe'),_0x428cf8,_0x285638[_0x18ed('0x10')][_0x18ed('0x12')]);return _0x4c3293(_0x285638[_0x18ed('0x10')][_0x18ed('0x12')]);}logger[_0x18ed('0x10')](_0x18ed('0xe'),_0x428cf8,_0x285638['error'][_0x18ed('0x12')]);return _0x59271e(_0x285638[_0x18ed('0x10')][_0x18ed('0x12')]);}else{logger[_0x18ed('0xd')](_0x18ed('0xe'),_0x428cf8,_0x18ed('0x13'));_0x59271e(_0x285638[_0x18ed('0x14')][_0x18ed('0x12')]);}})[_0x18ed('0x15')](function(_0x7262f4){logger[_0x18ed('0x10')](_0x18ed('0xe'),_0x428cf8,_0x7262f4);_0x4c3293(_0x7262f4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 74519a5..4f62fd6 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 _0x86a5=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','post','create','put','/:id','update','destroy'];(function(_0x4790f8,_0x51979c){var _0x402d07=function(_0x4d6419){while(--_0x4d6419){_0x4790f8['push'](_0x4790f8['shift']());}};_0x402d07(++_0x51979c);}(_0x86a5,0x166));var _0x586a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x86a5[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x586a('0x0'));var util=require(_0x586a('0x1'));var path=require(_0x586a('0x2'));var timeout=require(_0x586a('0x3'));var express=require(_0x586a('0x4'));var router=express[_0x586a('0x5')]();var fs_extra=require(_0x586a('0x6'));var auth=require(_0x586a('0x7'));var interaction=require(_0x586a('0x8'));var config=require(_0x586a('0x9'));var controller=require('./memberReport.controller');router[_0x586a('0xa')]('/',auth[_0x586a('0xb')](),controller[_0x586a('0xc')]);router[_0x586a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x586a('0xd')]);router['get']('/:id',auth[_0x586a('0xb')](),controller['show']);router[_0x586a('0xe')]('/',auth[_0x586a('0xb')](),controller[_0x586a('0xf')]);router[_0x586a('0x10')](_0x586a('0x11'),auth['isAuthenticated'](),controller[_0x586a('0x12')]);router['delete'](_0x586a('0x11'),auth[_0x586a('0xb')](),controller[_0x586a('0x13')]);module[_0x586a('0x14')]=router; \ No newline at end of file +var _0xbc41=['util','path','connect-timeout','Router','fs-extra','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x5cb9a6,_0x3fb781){var _0x2ce863=function(_0x63537d){while(--_0x63537d){_0x5cb9a6['push'](_0x5cb9a6['shift']());}};_0x2ce863(++_0x3fb781);}(_0xbc41,0x179));var _0x1bc4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbc41[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1bc4('0x0'));var util=require(_0x1bc4('0x1'));var path=require(_0x1bc4('0x2'));var timeout=require(_0x1bc4('0x3'));var express=require('express');var router=express[_0x1bc4('0x4')]();var fs_extra=require(_0x1bc4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x1bc4('0x6')]('/',auth[_0x1bc4('0x7')](),controller[_0x1bc4('0x8')]);router['get'](_0x1bc4('0x9'),auth[_0x1bc4('0x7')](),controller['describe']);router[_0x1bc4('0x6')](_0x1bc4('0xa'),auth[_0x1bc4('0x7')](),controller[_0x1bc4('0xb')]);router[_0x1bc4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1bc4('0xd')](_0x1bc4('0xa'),auth[_0x1bc4('0x7')](),controller[_0x1bc4('0xe')]);router[_0x1bc4('0xf')](_0x1bc4('0xa'),auth[_0x1bc4('0x7')](),controller[_0x1bc4('0x10')]);module[_0x1bc4('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 bbce44d..555ca17 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 _0x78b7=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING'];(function(_0x3ba63c,_0x37a91d){var _0x2fa08d=function(_0x653e2a){while(--_0x653e2a){_0x3ba63c['push'](_0x3ba63c['shift']());}};_0x2fa08d(++_0x37a91d);}(_0x78b7,0x6d));var _0x778b=function(_0x358ced,_0x108b26){_0x358ced=_0x358ced-0x0;var _0x167f51=_0x78b7[_0x358ced];return _0x167f51;};'use strict';var Sequelize=require(_0x778b('0x0'));var moment=require('moment');module[_0x778b('0x1')]={'channel':{'type':Sequelize[_0x778b('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x778b('0x2')]},'type':{'type':Sequelize[_0x778b('0x2')],'defaultValue':_0x778b('0x3'),'comment':_0x778b('0x4')},'duration':{'type':Sequelize[_0x778b('0x5')]},'enterAt':{'type':Sequelize[_0x778b('0x6')]},'exitAt':{'type':Sequelize[_0x778b('0x6')],'set':function(_0x3c38c5){var _0x395ba7=moment(_0x3c38c5);var _0x43750d=moment(this[_0x778b('0x7')](_0x778b('0x8')));var _0x1e6d5c=_0x395ba7['diff'](_0x43750d,_0x778b('0x9'));this[_0x778b('0xa')](_0x778b('0xb'),_0x3c38c5);this[_0x778b('0xa')](_0x778b('0xc'),_0x1e6d5c>=0x0?_0x1e6d5c:null);}},'data1':{'type':Sequelize[_0x778b('0x2')],'comment':_0x778b('0xd')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x778b('0x2')],'comment':_0x778b('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x778b('0xf')},'role':{'type':Sequelize[_0x778b('0x2')]},'internal':{'type':Sequelize[_0x778b('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9261=['INTEGER','DATE','getDataValue','diff','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9261,0xda));var _0x1926=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x9261[_0x5575cd];return _0x4979a0;};'use strict';var Sequelize=require(_0x1926('0x0'));var moment=require(_0x1926('0x1'));module[_0x1926('0x2')]={'channel':{'type':Sequelize[_0x1926('0x3')]},'membername':{'type':Sequelize[_0x1926('0x3')]},'interface':{'type':Sequelize[_0x1926('0x3')]},'type':{'type':Sequelize[_0x1926('0x3')],'defaultValue':_0x1926('0x4'),'comment':_0x1926('0x5')},'duration':{'type':Sequelize[_0x1926('0x6')]},'enterAt':{'type':Sequelize[_0x1926('0x7')]},'exitAt':{'type':Sequelize[_0x1926('0x7')],'set':function(_0xa72aae){var _0x11c006=moment(_0xa72aae);var _0x440ad5=moment(this[_0x1926('0x8')]('enterAt'));var _0x49e65f=_0x11c006[_0x1926('0x9')](_0x440ad5,'seconds');this['setDataValue'](_0x1926('0xa'),_0xa72aae);this[_0x1926('0xb')](_0x1926('0xc'),_0x49e65f>=0x0?_0x49e65f:null);}},'data1':{'type':Sequelize[_0x1926('0x3')],'comment':_0x1926('0xd')},'data2':{'type':Sequelize[_0x1926('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x1926('0xe')},'data4':{'type':Sequelize[_0x1926('0x3')],'comment':_0x1926('0xf')},'data5':{'type':Sequelize[_0x1926('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x1926('0x3')]},'internal':{'type':Sequelize[_0x1926('0x6')]},'uniqueid':{'type':Sequelize[_0x1926('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index dc26cff..8636bd5 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x277891,_0x5be99d){var _0x41702e=function(_0x651e32){while(--_0x651e32){_0x277891['push'](_0x277891['shift']());}};_0x41702e(++_0x5be99d);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +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(_0x5d4364,_0x4a6c71){var _0x460809=function(_0x420c17){while(--_0x420c17){_0x5d4364['push'](_0x5d4364['shift']());}};_0x460809(++_0x4a6c71);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c54940c..3d8ea94 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 _0xc7d3=['rimraf','../../config/environment','membername_interface','membername','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xc7d3,0x1f3));var _0x3c7d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc7d3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3c7d('0x0'));var util=require('util');var logger=require(_0x3c7d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3c7d('0x2'));var rp=require(_0x3c7d('0x3'));var fs=require('fs');var path=require(_0x3c7d('0x4'));var rimraf=require(_0x3c7d('0x5'));var config=require(_0x3c7d('0x6'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x137514,_0x108712){return _0x137514['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x3c7d('0x7'),'fields':[_0x3c7d('0x8'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb3e=['report_member','membername_interface','interface','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcb3e,0x17c));var _0xecb3=function(_0x432b47,_0x24d3b7){_0x432b47=_0x432b47-0x0;var _0xb74e85=_0xcb3e[_0x432b47];return _0xb74e85;};'use strict';var _=require(_0xecb3('0x0'));var util=require(_0xecb3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xecb3('0x2'));var BPromise=require(_0xecb3('0x3'));var rp=require(_0xecb3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecb3('0x5'));var config=require(_0xecb3('0x6'));var attributes=require(_0xecb3('0x7'));module[_0xecb3('0x8')]=function(_0xcda99c,_0x1d2ef7){return _0xcda99c[_0xecb3('0x9')]('MemberReport',attributes,{'tableName':_0xecb3('0xa'),'paranoid':![],'indexes':[{'name':_0xecb3('0xb'),'fields':['membername',_0xecb3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7f09b73..3499f54 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 _0x24ce=['MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','include','model','map','CreateMemberReport','create','body','UpdateMemberReport','limit','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13235b,_0x1fb41f){var _0x2b935f=function(_0x41d3d8){while(--_0x41d3d8){_0x13235b['push'](_0x13235b['shift']());}};_0x2b935f(++_0x1fb41f);}(_0x24ce,0x1de));var _0xe24c=function(_0x23accc,_0x5b3918){_0x23accc=_0x23accc-0x0;var _0x4e20b0=_0x24ce[_0x23accc];return _0x4e20b0;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var moment=require(_0xe24c('0x1'));var BPromise=require(_0xe24c('0x2'));var rs=require(_0xe24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe24c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe24c('0x5'));var jayson=require(_0xe24c('0x6'));var client=jayson[_0xe24c('0x7')][_0xe24c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1d970,_0x496abb,_0x6d00e){return new BPromise(function(_0x2d8dde,_0x1e02af){return client[_0xe24c('0x9')](_0xe1d970,_0x6d00e)[_0xe24c('0xa')](function(_0x33e9d3){logger[_0xe24c('0xb')](_0xe24c('0xc'),_0x496abb,_0xe24c('0xd'));logger[_0xe24c('0xe')](_0xe24c('0xf'),_0x496abb,_0xe24c('0xd'),JSON[_0xe24c('0x10')](_0x33e9d3));if(_0x33e9d3['error']){if(_0x33e9d3[_0xe24c('0x11')]['code']===0x1f4){logger[_0xe24c('0x11')]('MemberReport,\x20%s,\x20%s',_0x496abb,_0x33e9d3[_0xe24c('0x11')][_0xe24c('0x12')]);return _0x1e02af(_0x33e9d3['error']['message']);}logger['error'](_0xe24c('0xc'),_0x496abb,_0x33e9d3['error'][_0xe24c('0x12')]);return _0x2d8dde(_0x33e9d3[_0xe24c('0x11')][_0xe24c('0x12')]);}else{logger[_0xe24c('0xb')]('MemberReport,\x20%s,\x20%s',_0x496abb,_0xe24c('0xd'));_0x2d8dde(_0x33e9d3[_0xe24c('0x13')][_0xe24c('0x12')]);}})[_0xe24c('0x14')](function(_0x261609){logger[_0xe24c('0x11')](_0xe24c('0xc'),_0x496abb,_0x261609);_0x1e02af(_0x261609);});});}exports[_0xe24c('0x15')]=function(_0x384bd2){var _0x6c7fe2=this;return new Promise(function(_0xed9c0b,_0x1589cc){return db[_0xe24c('0x16')]['findAll']({'raw':_0x384bd2[_0xe24c('0x17')]?_0x384bd2[_0xe24c('0x17')][_0xe24c('0x18')]===undefined?!![]:![]:!![],'where':_0x384bd2['options']?_0x384bd2[_0xe24c('0x17')][_0xe24c('0x19')]||null:null,'attributes':_0x384bd2[_0xe24c('0x17')]?_0x384bd2[_0xe24c('0x17')][_0xe24c('0x1a')]||null:null,'limit':_0x384bd2[_0xe24c('0x17')]?_0x384bd2['options']['limit']||null:null,'include':_0x384bd2['options']?_0x384bd2[_0xe24c('0x17')]['include']?_['map'](_0x384bd2[_0xe24c('0x17')][_0xe24c('0x1b')],function(_0x267de3){return{'model':db[_0x267de3[_0xe24c('0x1c')]],'as':_0x267de3['as'],'attributes':_0x267de3[_0xe24c('0x1a')],'include':_0x267de3[_0xe24c('0x1b')]?_[_0xe24c('0x1d')](_0x267de3[_0xe24c('0x1b')],function(_0x2b6bcf){return{'model':db[_0x2b6bcf[_0xe24c('0x1c')]],'as':_0x2b6bcf['as'],'attributes':_0x2b6bcf[_0xe24c('0x1a')],'include':_0x2b6bcf['include']?_[_0xe24c('0x1d')](_0x2b6bcf[_0xe24c('0x1b')],function(_0x12b536){return{'model':db[_0x12b536[_0xe24c('0x1c')]],'as':_0x12b536['as'],'attributes':_0x12b536[_0xe24c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe24c('0xa')](function(_0x377dbd){logger[_0xe24c('0xb')](_0xe24c('0x15'),_0x384bd2);logger[_0xe24c('0xe')]('GetMemberReport',_0x384bd2,JSON[_0xe24c('0x10')](_0x377dbd));_0xed9c0b(_0x377dbd);})[_0xe24c('0x14')](function(_0x51d81e){logger[_0xe24c('0x11')](_0xe24c('0x15'),_0x51d81e['message'],_0x384bd2);_0x1589cc(_0x6c7fe2['error'](0x1f4,_0x51d81e[_0xe24c('0x12')]));});});};exports[_0xe24c('0x1e')]=function(_0x2eda7a){var _0x4d6e7d=this;return new Promise(function(_0x1e8d7e,_0x5430f9){return db['MemberReport'][_0xe24c('0x1f')](_0x2eda7a[_0xe24c('0x20')],{'raw':_0x2eda7a['options']?_0x2eda7a['options'][_0xe24c('0x18')]===undefined?!![]:![]:!![]})[_0xe24c('0xa')](function(_0x2c2b89){logger[_0xe24c('0xb')]('CreateMemberReport',_0x2eda7a);logger['debug']('CreateMemberReport',_0x2eda7a,JSON[_0xe24c('0x10')](_0x2c2b89));_0x1e8d7e(_0x2c2b89);})[_0xe24c('0x14')](function(_0x11ac90){logger['error'](_0xe24c('0x1e'),_0x11ac90[_0xe24c('0x12')],_0x2eda7a);_0x5430f9(_0x4d6e7d[_0xe24c('0x11')](0x1f4,_0x11ac90[_0xe24c('0x12')]));});});};exports[_0xe24c('0x21')]=function(_0x56ec9c){var _0x578103=this;return new Promise(function(_0x145c92,_0x77f337){return db['MemberReport']['update'](_0x56ec9c[_0xe24c('0x20')],{'raw':_0x56ec9c[_0xe24c('0x17')]?_0x56ec9c[_0xe24c('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ec9c[_0xe24c('0x17')]?_0x56ec9c[_0xe24c('0x17')][_0xe24c('0x19')]||null:null,'attributes':_0x56ec9c[_0xe24c('0x17')]?_0x56ec9c[_0xe24c('0x17')]['attributes']||null:null,'limit':_0x56ec9c[_0xe24c('0x17')]?_0x56ec9c[_0xe24c('0x17')][_0xe24c('0x22')]||null:null})['then'](function(_0x28abe4){logger[_0xe24c('0xb')]('UpdateMemberReport',_0x56ec9c);logger[_0xe24c('0xe')](_0xe24c('0x21'),_0x56ec9c,JSON[_0xe24c('0x10')](_0x28abe4));_0x145c92(_0x28abe4);})[_0xe24c('0x14')](function(_0x5dbd73){logger[_0xe24c('0x11')](_0xe24c('0x21'),_0x5dbd73[_0xe24c('0x12')],_0x56ec9c);_0x77f337(_0x578103[_0xe24c('0x11')](0x1f4,_0x5dbd73[_0xe24c('0x12')]));});});}; \ No newline at end of file +var _0x1c23=['body','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetMemberReport','findAll','options','raw','limit','include','map','model','attributes','CreateMemberReport','create','UpdateMemberReport','MemberReport','update'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1c23,0x1d5));var _0x31c2=function(_0xf92ed8,_0x3f4835){_0xf92ed8=_0xf92ed8-0x0;var _0x5dcd5e=_0x1c23[_0xf92ed8];return _0x5dcd5e;};'use strict';var _=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var moment=require(_0x31c2('0x2'));var BPromise=require(_0x31c2('0x3'));var rs=require(_0x31c2('0x4'));var fs=require('fs');var Redis=require(_0x31c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31c2('0x6'));var logger=require(_0x31c2('0x7'))('rpc');var config=require(_0x31c2('0x8'));var jayson=require(_0x31c2('0x9'));var client=jayson[_0x31c2('0xa')][_0x31c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ffcfb,_0x5c3007,_0x3b8308){return new BPromise(function(_0x2f98e5,_0x37d859){return client[_0x31c2('0xc')](_0x2ffcfb,_0x3b8308)[_0x31c2('0xd')](function(_0x55c11e){logger['info'](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));logger[_0x31c2('0x10')](_0x31c2('0x11'),_0x5c3007,_0x31c2('0xf'),JSON[_0x31c2('0x12')](_0x55c11e));if(_0x55c11e['error']){if(_0x55c11e[_0x31c2('0x13')]['code']===0x1f4){logger[_0x31c2('0x13')](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')]['message']);return _0x37d859(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}logger['error'](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);return _0x2f98e5(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}else{logger[_0x31c2('0x15')](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));_0x2f98e5(_0x55c11e[_0x31c2('0x16')][_0x31c2('0x14')]);}})[_0x31c2('0x17')](function(_0x5660fb){logger['error'](_0x31c2('0xe'),_0x5c3007,_0x5660fb);_0x37d859(_0x5660fb);});});}exports[_0x31c2('0x18')]=function(_0x1f7f83){var _0x589941=this;return new Promise(function(_0x5055e7,_0x437221){return db['MemberReport'][_0x31c2('0x19')]({'raw':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')]['where']||null:null,'attributes':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')]['attributes']||null:null,'limit':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1c')]||null:null,'include':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x1f7f83[_0x31c2('0x1a')]['include'],function(_0x25bdc2){return{'model':db[_0x25bdc2[_0x31c2('0x1f')]],'as':_0x25bdc2['as'],'attributes':_0x25bdc2['attributes'],'include':_0x25bdc2[_0x31c2('0x1d')]?_['map'](_0x25bdc2['include'],function(_0x3af6eb){return{'model':db[_0x3af6eb['model']],'as':_0x3af6eb['as'],'attributes':_0x3af6eb[_0x31c2('0x20')],'include':_0x3af6eb[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x3af6eb[_0x31c2('0x1d')],function(_0x3ad658){return{'model':db[_0x3ad658['model']],'as':_0x3ad658['as'],'attributes':_0x3ad658[_0x31c2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x31c2('0xd')](function(_0x3ae1b9){logger['info'](_0x31c2('0x18'),_0x1f7f83);logger[_0x31c2('0x10')](_0x31c2('0x18'),_0x1f7f83,JSON[_0x31c2('0x12')](_0x3ae1b9));_0x5055e7(_0x3ae1b9);})[_0x31c2('0x17')](function(_0x2164d8){logger[_0x31c2('0x13')]('GetMemberReport',_0x2164d8[_0x31c2('0x14')],_0x1f7f83);_0x437221(_0x589941[_0x31c2('0x13')](0x1f4,_0x2164d8[_0x31c2('0x14')]));});});};exports[_0x31c2('0x21')]=function(_0x276137){var _0x3e2eef=this;return new Promise(function(_0x4739c5,_0x4a4b43){return db['MemberReport'][_0x31c2('0x22')](_0x276137['body'],{'raw':_0x276137[_0x31c2('0x1a')]?_0x276137[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![]})[_0x31c2('0xd')](function(_0x569da8){logger[_0x31c2('0x15')]('CreateMemberReport',_0x276137);logger[_0x31c2('0x10')](_0x31c2('0x21'),_0x276137,JSON[_0x31c2('0x12')](_0x569da8));_0x4739c5(_0x569da8);})[_0x31c2('0x17')](function(_0x498042){logger['error']('CreateMemberReport',_0x498042[_0x31c2('0x14')],_0x276137);_0x4a4b43(_0x3e2eef[_0x31c2('0x13')](0x1f4,_0x498042[_0x31c2('0x14')]));});});};exports[_0x31c2('0x23')]=function(_0x1ce2ba){var _0x188f11=this;return new Promise(function(_0x173f1f,_0x305b9d){return db[_0x31c2('0x24')][_0x31c2('0x25')](_0x1ce2ba[_0x31c2('0x26')],{'raw':_0x1ce2ba[_0x31c2('0x1a')]?_0x1ce2ba[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce2ba[_0x31c2('0x1a')]?_0x1ce2ba['options']['where']||null:null,'attributes':_0x1ce2ba[_0x31c2('0x1a')]?_0x1ce2ba[_0x31c2('0x1a')][_0x31c2('0x20')]||null:null,'limit':_0x1ce2ba[_0x31c2('0x1a')]?_0x1ce2ba[_0x31c2('0x1a')]['limit']||null:null})['then'](function(_0x29d419){logger[_0x31c2('0x15')](_0x31c2('0x23'),_0x1ce2ba);logger[_0x31c2('0x10')](_0x31c2('0x23'),_0x1ce2ba,JSON['stringify'](_0x29d419));_0x173f1f(_0x29d419);})[_0x31c2('0x17')](function(_0x4026e9){logger['error'](_0x31c2('0x23'),_0x4026e9['message'],_0x1ce2ba);_0x305b9d(_0x188f11[_0x31c2('0x13')](0x1f4,_0x4026e9[_0x31c2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 081ed9e..8bb994f 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 _0x32b6=['../../components/interaction/service','./migration.controller','get','index','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x54301c,_0x5509b6){var _0x25cade=function(_0x289dd7){while(--_0x289dd7){_0x54301c['push'](_0x54301c['shift']());}};_0x25cade(++_0x5509b6);}(_0x32b6,0x18b));var _0x632b=function(_0x1e857b,_0x4971b5){_0x1e857b=_0x1e857b-0x0;var _0x36e165=_0x32b6[_0x1e857b];return _0x36e165;};'use strict';var multer=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var path=require(_0x632b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x632b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x632b('0x4'));var interaction=require(_0x632b('0x5'));var config=require('../../config/environment');var controller=require(_0x632b('0x6'));router[_0x632b('0x7')]('/',controller[_0x632b('0x8')]);module[_0x632b('0x9')]=router; \ No newline at end of file +var _0xe041=['../../config/environment','./migration.controller','get','index','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x28b05e,_0x5ed721){var _0x3ed7cb=function(_0x217f11){while(--_0x217f11){_0x28b05e['push'](_0x28b05e['shift']());}};_0x3ed7cb(++_0x5ed721);}(_0xe041,0x17b));var _0x1e04=function(_0x3e6e7e,_0x26cc84){_0x3e6e7e=_0x3e6e7e-0x0;var _0x268b60=_0xe041[_0x3e6e7e];return _0x268b60;};'use strict';var multer=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var path=require('path');var timeout=require(_0x1e04('0x2'));var express=require('express');var router=express[_0x1e04('0x3')]();var fs_extra=require(_0x1e04('0x4'));var auth=require(_0x1e04('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e04('0x6'));var controller=require(_0x1e04('0x7'));router[_0x1e04('0x8')]('/',controller[_0x1e04('0x9')]);module[_0x1e04('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 6ddf63a..d10225a 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 _0x239c=['STRING','version','exports'];(function(_0xa4fd3f,_0x5a8318){var _0x47752d=function(_0x2720c8){while(--_0x2720c8){_0xa4fd3f['push'](_0xa4fd3f['shift']());}};_0x47752d(++_0x5a8318);}(_0x239c,0xd1));var _0xc239=function(_0x197da6,_0x4b012d){_0x197da6=_0x197da6-0x0;var _0x2640ef=_0x239c[_0x197da6];return _0x2640ef;};'use strict';var Sequelize=require('sequelize');module[_0xc239('0x0')]={'version':{'type':Sequelize[_0xc239('0x1')],'unique':_0xc239('0x2')}}; \ No newline at end of file +var _0xb6be=['sequelize','version'];(function(_0x3b6523,_0xfb15f2){var _0x29dc68=function(_0x28878c){while(--_0x28878c){_0x3b6523['push'](_0x3b6523['shift']());}};_0x29dc68(++_0xfb15f2);}(_0xb6be,0xdc));var _0xeb6b=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xb6be[_0x404cde];return _0x139882;};'use strict';var Sequelize=require(_0xeb6b('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xeb6b('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ef65422..6269e57 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 _0x344b=['fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf'];(function(_0x1547c2,_0x3eb41c){var _0x69a274=function(_0x35fc74){while(--_0x35fc74){_0x1547c2['push'](_0x1547c2['shift']());}};_0x69a274(++_0x3eb41c);}(_0x344b,0x190));var _0xb344=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x344b[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0xb344('0x0'));var rimraf=require(_0xb344('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb344('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb344('0x3'));var util=require(_0xb344('0x4'));var path=require(_0xb344('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb344('0x6'));var fs=require('fs');var fs_extra=require(_0xb344('0x7'));var _=require(_0xb344('0x8'));var squel=require('squel');var crypto=require(_0xb344('0x9'));var jsforce=require(_0xb344('0xa'));var deskjs=require(_0xb344('0xb'));var toCsv=require(_0xb344('0xc'));var querystring=require(_0xb344('0xd'));var Papa=require(_0xb344('0xe'));var Redis=require(_0xb344('0xf'));var authService=require(_0xb344('0x10'));var qs=require(_0xb344('0x11'));var as=require(_0xb344('0x12'));var hardwareService=require(_0xb344('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb344('0x14'));var config=require(_0xb344('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb344('0x16'))['db'];function respondWithStatusCode(_0x5e8982,_0xc8750d){_0xc8750d=_0xc8750d||0xcc;return function(_0x22c337){if(_0x22c337){return _0x5e8982['sendStatus'](_0xc8750d);}return _0x5e8982[_0xb344('0x17')](_0xc8750d)[_0xb344('0x18')]();};}function respondWithResult(_0x32cb52,_0x4e9952){_0x4e9952=_0x4e9952||0xc8;return function(_0x394177){if(_0x394177){return _0x32cb52[_0xb344('0x17')](_0x4e9952)[_0xb344('0x19')](_0x394177);}};}function respondWithFilteredResult(_0x43b0e2,_0x237e0f){return function(_0x5c5b8b){if(_0x5c5b8b){var _0x30512a=typeof _0x237e0f[_0xb344('0x1a')]===_0xb344('0x1b')&&typeof _0x237e0f[_0xb344('0x1c')]==='undefined';var _0x45f8c0=_0x5c5b8b[_0xb344('0x1d')];var _0xcccd9a=_0x30512a?0x0:_0x237e0f[_0xb344('0x1a')];var _0x4d8e7f=_0x30512a?_0x5c5b8b[_0xb344('0x1d')]:_0x237e0f[_0xb344('0x1a')]+_0x237e0f[_0xb344('0x1c')];var _0x7c3f44;if(_0x4d8e7f>=_0x45f8c0){_0x4d8e7f=_0x45f8c0;_0x7c3f44=0xc8;}else{_0x7c3f44=0xce;}_0x43b0e2['status'](_0x7c3f44);return _0x43b0e2[_0xb344('0x1e')]('Content-Range',_0xcccd9a+'-'+_0x4d8e7f+'/'+_0x45f8c0)[_0xb344('0x19')](_0x5c5b8b);}return null;};}function patchUpdates(_0x4193cb){return function(_0x2059d9){try{jsonpatch['apply'](_0x2059d9,_0x4193cb,!![]);}catch(_0x1abe5c){return BPromise[_0xb344('0x1f')](_0x1abe5c);}return _0x2059d9[_0xb344('0x20')]();};}function saveUpdates(_0x5aed6f,_0x464736){return function(_0x1c2e2c){if(_0x1c2e2c){return _0x1c2e2c[_0xb344('0x21')](_0x5aed6f)[_0xb344('0x22')](function(_0x485927){return _0x485927;});}return null;};}function removeEntity(_0x498fd4,_0x7baee4){return function(_0xb4184b){if(_0xb4184b){return _0xb4184b[_0xb344('0x23')]()[_0xb344('0x22')](function(){_0x498fd4[_0xb344('0x17')](0xcc)[_0xb344('0x18')]();});}};}function handleEntityNotFound(_0x4a4cc4,_0x5543ec){return function(_0x27befb){if(!_0x27befb){_0x4a4cc4[_0xb344('0x24')](0x194);}return _0x27befb;};}function handleError(_0x29c7d3,_0xaaf326){_0xaaf326=_0xaaf326||0x1f4;return function(_0x3265f6){logger[_0xb344('0x25')](_0x3265f6[_0xb344('0x26')]);if(_0x3265f6[_0xb344('0x27')]){delete _0x3265f6[_0xb344('0x27')];}_0x29c7d3['status'](_0xaaf326)[_0xb344('0x28')](_0x3265f6);};}exports[_0xb344('0x29')]=function(_0x23a306,_0x3bdb1b){var _0x1cc199={},_0x595c57={},_0x6669b0={'count':0x0,'rows':[]};var _0x1576f1=_[_0xb344('0x2a')](db['Migration'][_0xb344('0x2b')],function(_0x5edb08){return{'name':_0x5edb08[_0xb344('0x2c')],'type':_0x5edb08[_0xb344('0x2d')]['key']};});_0x595c57['model']=_[_0xb344('0x2a')](_0x1576f1,_0xb344('0x27'));_0x595c57['query']=_[_0xb344('0x2e')](_0x23a306['query']);_0x595c57[_0xb344('0x2f')]=_[_0xb344('0x30')](_0x595c57[_0xb344('0x31')],_0x595c57[_0xb344('0x32')]);_0x1cc199[_0xb344('0x33')]=_['intersection'](_0x595c57[_0xb344('0x31')],qs[_0xb344('0x34')](_0x23a306[_0xb344('0x32')]['fields']));_0x1cc199['attributes']=_0x1cc199[_0xb344('0x33')][_0xb344('0x35')]?_0x1cc199[_0xb344('0x33')]:_0x595c57[_0xb344('0x31')];if(!_0x23a306[_0xb344('0x32')][_0xb344('0x36')]('nolimit')){_0x1cc199[_0xb344('0x1c')]=qs[_0xb344('0x1c')](_0x23a306[_0xb344('0x32')][_0xb344('0x1c')]);_0x1cc199['offset']=qs['offset'](_0x23a306[_0xb344('0x32')][_0xb344('0x1a')]);}_0x1cc199['order']=qs['sort'](_0x23a306[_0xb344('0x32')][_0xb344('0x37')]);_0x1cc199[_0xb344('0x38')]=qs[_0xb344('0x2f')](_[_0xb344('0x39')](_0x23a306[_0xb344('0x32')],_0x595c57['filters']),_0x1576f1);if(_0x23a306[_0xb344('0x32')]['filter']){_0x1cc199[_0xb344('0x38')]=_[_0xb344('0x3a')](_0x1cc199[_0xb344('0x38')],{'$or':_[_0xb344('0x2a')](_0x1576f1,function(_0x207545){if(_0x207545[_0xb344('0x2d')]!=='VIRTUAL'){var _0x568196={};_0x568196[_0x207545[_0xb344('0x27')]]={'$like':'%'+_0x23a306[_0xb344('0x32')][_0xb344('0x3b')]+'%'};return _0x568196;}})});}_0x1cc199=_[_0xb344('0x3a')]({},_0x1cc199,_0x23a306[_0xb344('0x3c')]);var _0x45099={'where':_0x1cc199[_0xb344('0x38')]};return db[_0xb344('0x3d')]['count'](_0x45099)[_0xb344('0x22')](function(_0xba9681){_0x6669b0[_0xb344('0x1d')]=_0xba9681;if(_0x23a306['query'][_0xb344('0x3e')]){_0x1cc199[_0xb344('0x3f')]=[{'all':!![]}];}return db[_0xb344('0x3d')][_0xb344('0x40')](_0x1cc199);})[_0xb344('0x22')](function(_0x419b52){_0x6669b0[_0xb344('0x41')]=_0x419b52;return _0x6669b0;})[_0xb344('0x22')](respondWithFilteredResult(_0x3bdb1b,_0x1cc199))[_0xb344('0x42')](handleError(_0x3bdb1b,null));}; \ No newline at end of file +var _0xc9df=['update','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','map','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','then','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save'];(function(_0x44464e,_0xe5b290){var _0x591011=function(_0x467ff8){while(--_0x467ff8){_0x44464e['push'](_0x44464e['shift']());}};_0x591011(++_0xe5b290);}(_0xc9df,0x1bf));var _0xfc9d=function(_0x3fd94a,_0x26202a){_0x3fd94a=_0x3fd94a-0x0;var _0xd3170d=_0xc9df[_0x3fd94a];return _0xd3170d;};'use strict';var emlformat=require(_0xfc9d('0x0'));var rimraf=require(_0xfc9d('0x1'));var zipdir=require(_0xfc9d('0x2'));var jsonpatch=require(_0xfc9d('0x3'));var rp=require(_0xfc9d('0x4'));var moment=require(_0xfc9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfc9d('0x6'));var util=require(_0xfc9d('0x7'));var path=require('path');var sox=require(_0xfc9d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc9d('0x9'));var _=require(_0xfc9d('0xa'));var squel=require(_0xfc9d('0xb'));var crypto=require(_0xfc9d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfc9d('0xd'));var toCsv=require(_0xfc9d('0xe'));var querystring=require('querystring');var Papa=require(_0xfc9d('0xf'));var Redis=require('ioredis');var authService=require(_0xfc9d('0x10'));var qs=require(_0xfc9d('0x11'));var as=require(_0xfc9d('0x12'));var hardwareService=require(_0xfc9d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfc9d('0x14'));var config=require(_0xfc9d('0x15'));var licenseUtil=require(_0xfc9d('0x16'));var db=require(_0xfc9d('0x17'))['db'];function respondWithStatusCode(_0x24e4b1,_0x14b5ce){_0x14b5ce=_0x14b5ce||0xcc;return function(_0x314007){if(_0x314007){return _0x24e4b1[_0xfc9d('0x18')](_0x14b5ce);}return _0x24e4b1[_0xfc9d('0x19')](_0x14b5ce)[_0xfc9d('0x1a')]();};}function respondWithResult(_0x246b5a,_0x5f08d6){_0x5f08d6=_0x5f08d6||0xc8;return function(_0x5f0c8a){if(_0x5f0c8a){return _0x246b5a['status'](_0x5f08d6)[_0xfc9d('0x1b')](_0x5f0c8a);}};}function respondWithFilteredResult(_0x41d817,_0xac0457){return function(_0x22c28d){if(_0x22c28d){var _0x292b91=typeof _0xac0457['offset']===_0xfc9d('0x1c')&&typeof _0xac0457['limit']==='undefined';var _0x5a3564=_0x22c28d['count'];var _0x134e21=_0x292b91?0x0:_0xac0457['offset'];var _0x1548e4=_0x292b91?_0x22c28d[_0xfc9d('0x1d')]:_0xac0457[_0xfc9d('0x1e')]+_0xac0457['limit'];var _0xeecfee;if(_0x1548e4>=_0x5a3564){_0x1548e4=_0x5a3564;_0xeecfee=0xc8;}else{_0xeecfee=0xce;}_0x41d817[_0xfc9d('0x19')](_0xeecfee);return _0x41d817[_0xfc9d('0x1f')](_0xfc9d('0x20'),_0x134e21+'-'+_0x1548e4+'/'+_0x5a3564)[_0xfc9d('0x1b')](_0x22c28d);}return null;};}function patchUpdates(_0x5cad71){return function(_0xe0fe7d){try{jsonpatch[_0xfc9d('0x21')](_0xe0fe7d,_0x5cad71,!![]);}catch(_0x308a86){return BPromise[_0xfc9d('0x22')](_0x308a86);}return _0xe0fe7d[_0xfc9d('0x23')]();};}function saveUpdates(_0x40ff61,_0x45c68a){return function(_0xa1c0bb){if(_0xa1c0bb){return _0xa1c0bb[_0xfc9d('0x24')](_0x40ff61)['then'](function(_0x2f1b7b){return _0x2f1b7b;});}return null;};}function removeEntity(_0x3d9890,_0x3a8fbb){return function(_0x43ea69){if(_0x43ea69){return _0x43ea69['destroy']()['then'](function(){_0x3d9890[_0xfc9d('0x19')](0xcc)[_0xfc9d('0x1a')]();});}};}function handleEntityNotFound(_0xc17cef,_0x5dcff7){return function(_0x39bbae){if(!_0x39bbae){_0xc17cef['sendStatus'](0x194);}return _0x39bbae;};}function handleError(_0x2caffe,_0xc6c023){_0xc6c023=_0xc6c023||0x1f4;return function(_0x49ce68){logger[_0xfc9d('0x25')](_0x49ce68[_0xfc9d('0x26')]);if(_0x49ce68[_0xfc9d('0x27')]){delete _0x49ce68[_0xfc9d('0x27')];}_0x2caffe['status'](_0xc6c023)[_0xfc9d('0x28')](_0x49ce68);};}exports[_0xfc9d('0x29')]=function(_0xc14389,_0x459eab){var _0x154ec8={},_0x5d28a3={},_0x3e405b={'count':0x0,'rows':[]};var _0x3a7102=_['map'](db[_0xfc9d('0x2a')][_0xfc9d('0x2b')],function(_0x53cbcd){return{'name':_0x53cbcd[_0xfc9d('0x2c')],'type':_0x53cbcd[_0xfc9d('0x2d')]['key']};});_0x5d28a3['model']=_[_0xfc9d('0x2e')](_0x3a7102,_0xfc9d('0x27'));_0x5d28a3['query']=_['keys'](_0xc14389[_0xfc9d('0x2f')]);_0x5d28a3['filters']=_['intersection'](_0x5d28a3[_0xfc9d('0x30')],_0x5d28a3[_0xfc9d('0x2f')]);_0x154ec8[_0xfc9d('0x31')]=_[_0xfc9d('0x32')](_0x5d28a3[_0xfc9d('0x30')],qs['fields'](_0xc14389[_0xfc9d('0x2f')][_0xfc9d('0x33')]));_0x154ec8[_0xfc9d('0x31')]=_0x154ec8[_0xfc9d('0x31')][_0xfc9d('0x34')]?_0x154ec8[_0xfc9d('0x31')]:_0x5d28a3[_0xfc9d('0x30')];if(!_0xc14389['query'][_0xfc9d('0x35')](_0xfc9d('0x36'))){_0x154ec8['limit']=qs['limit'](_0xc14389[_0xfc9d('0x2f')][_0xfc9d('0x37')]);_0x154ec8[_0xfc9d('0x1e')]=qs['offset'](_0xc14389[_0xfc9d('0x2f')][_0xfc9d('0x1e')]);}_0x154ec8[_0xfc9d('0x38')]=qs['sort'](_0xc14389['query'][_0xfc9d('0x39')]);_0x154ec8[_0xfc9d('0x3a')]=qs[_0xfc9d('0x3b')](_[_0xfc9d('0x3c')](_0xc14389[_0xfc9d('0x2f')],_0x5d28a3[_0xfc9d('0x3b')]),_0x3a7102);if(_0xc14389[_0xfc9d('0x2f')][_0xfc9d('0x3d')]){_0x154ec8[_0xfc9d('0x3a')]=_[_0xfc9d('0x3e')](_0x154ec8[_0xfc9d('0x3a')],{'$or':_['map'](_0x3a7102,function(_0x2b7295){if(_0x2b7295[_0xfc9d('0x2d')]!=='VIRTUAL'){var _0x5bb706={};_0x5bb706[_0x2b7295[_0xfc9d('0x27')]]={'$like':'%'+_0xc14389[_0xfc9d('0x2f')]['filter']+'%'};return _0x5bb706;}})});}_0x154ec8=_[_0xfc9d('0x3e')]({},_0x154ec8,_0xc14389['options']);var _0x527fb2={'where':_0x154ec8[_0xfc9d('0x3a')]};return db[_0xfc9d('0x2a')][_0xfc9d('0x1d')](_0x527fb2)['then'](function(_0x1ff163){_0x3e405b[_0xfc9d('0x1d')]=_0x1ff163;if(_0xc14389['query'][_0xfc9d('0x3f')]){_0x154ec8[_0xfc9d('0x40')]=[{'all':!![]}];}return db[_0xfc9d('0x2a')][_0xfc9d('0x41')](_0x154ec8);})[_0xfc9d('0x42')](function(_0x243173){_0x3e405b[_0xfc9d('0x43')]=_0x243173;return _0x3e405b;})[_0xfc9d('0x42')](respondWithFilteredResult(_0x459eab,_0x154ec8))[_0xfc9d('0x44')](handleError(_0x459eab,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8639090..b9df436 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 _0x837a=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x22bb0a,_0x30ffb8){var _0xda9e84=function(_0x470705){while(--_0x470705){_0x22bb0a['push'](_0x22bb0a['shift']());}};_0xda9e84(++_0x30ffb8);}(_0x837a,0x14a));var _0xa837=function(_0x17a063,_0x159823){_0x17a063=_0x17a063-0x0;var _0x13a882=_0x837a[_0x17a063];return _0x13a882;};'use strict';var _=require(_0xa837('0x0'));var util=require(_0xa837('0x1'));var logger=require(_0xa837('0x2'))(_0xa837('0x3'));var moment=require(_0xa837('0x4'));var BPromise=require(_0xa837('0x5'));var rp=require(_0xa837('0x6'));var fs=require('fs');var path=require(_0xa837('0x7'));var rimraf=require(_0xa837('0x8'));var config=require(_0xa837('0x9'));var attributes=require(_0xa837('0xa'));module[_0xa837('0xb')]=function(_0x43d7d5,_0x2ea2fc){return _0x43d7d5['define'](_0xa837('0xc'),attributes,{'tableName':_0xa837('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2a6=['Migration','migrations','lodash','util','../../config/logger','api','moment','request-promise','path','./migration.attributes','exports'];(function(_0xe1d0,_0x202630){var _0x2f3bb2=function(_0x19ccbd){while(--_0x19ccbd){_0xe1d0['push'](_0xe1d0['shift']());}};_0x2f3bb2(++_0x202630);}(_0xb2a6,0x136));var _0x6b2a=function(_0x237002,_0x1bc91c){_0x237002=_0x237002-0x0;var _0x36737d=_0xb2a6[_0x237002];return _0x36737d;};'use strict';var _=require(_0x6b2a('0x0'));var util=require(_0x6b2a('0x1'));var logger=require(_0x6b2a('0x2'))(_0x6b2a('0x3'));var moment=require(_0x6b2a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b2a('0x5'));var fs=require('fs');var path=require(_0x6b2a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6b2a('0x7'));module[_0x6b2a('0x8')]=function(_0x7df43b,_0x587f23){return _0x7df43b['define'](_0x6b2a('0x9'),attributes,{'tableName':_0x6b2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 32bf8be..0906c9b 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5ccfa9,_0x415e4d){var _0x228ced=function(_0x57750a){while(--_0x57750a){_0x5ccfa9['push'](_0x5ccfa9['shift']());}};_0x228ced(++_0x415e4d);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','Migration,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3a7722,_0x5d6f9f){_0x3a7722=_0x3a7722-0x0;var _0x2755aa=_0xbdb7[_0x3a7722];return _0x2755aa;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3603419..76f31ee 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 _0xa46e=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post','create','update','delete'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xa46e,0x8a));var _0xea46=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xa46e[_0x204ad4];return _0x50675f;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./network.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0xb')]('/',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xea46('0xd')]);router[_0xea46('0xe')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xf')]);module[_0xea46('0x10')]=router; \ No newline at end of file +var _0xb091=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./network.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x10d3c2,_0x1f5142){var _0x4208aa=function(_0x2e1ff9){while(--_0x2e1ff9){_0x10d3c2['push'](_0x10d3c2['shift']());}};_0x4208aa(++_0x1f5142);}(_0xb091,0x16e));var _0x1b09=function(_0x217894,_0x35aa63){_0x217894=_0x217894-0x0;var _0x43fb76=_0xb091[_0x217894];return _0x43fb76;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/:id',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0xb')]('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0xd')](_0x1b09('0xe'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xf')]);router[_0x1b09('0x10')](_0x1b09('0xe'),auth['isAuthenticated'](),controller[_0x1b09('0x11')]);module[_0x1b09('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 29aa5f2..ad79487 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 _0x8efd=['ENUM','turn','STRING','sequelize','exports'];(function(_0x9fdca,_0x364493){var _0x4037a3=function(_0x241c66){while(--_0x241c66){_0x9fdca['push'](_0x9fdca['shift']());}};_0x4037a3(++_0x364493);}(_0x8efd,0x8f));var _0xd8ef=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8efd[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xd8ef('0x0'));module[_0xd8ef('0x1')]={'type':{'type':Sequelize[_0xd8ef('0x2')]('localnet','externip','stun',_0xd8ef('0x3'))},'value':{'type':Sequelize[_0xd8ef('0x4')]},'username':{'type':Sequelize[_0xd8ef('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6751=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x6751,0x76));var _0x1675=function(_0x24e0c9,_0x284109){_0x24e0c9=_0x24e0c9-0x0;var _0x4448f0=_0x6751[_0x24e0c9];return _0x4448f0;};'use strict';var Sequelize=require(_0x1675('0x0'));module[_0x1675('0x1')]={'type':{'type':Sequelize[_0x1675('0x2')](_0x1675('0x3'),_0x1675('0x4'),_0x1675('0x5'),'turn')},'value':{'type':Sequelize[_0x1675('0x6')]},'username':{'type':Sequelize[_0x1675('0x6')]},'password':{'type':Sequelize[_0x1675('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e6174ea..62cbd57 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 _0x3893=['moment','bluebird','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','index','fieldName','key','map','name','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','type','VIRTUAL','filter','merge','includeAll','include','Network','findAll','show','params','keys','rawAttributes','length','find','sequelize','transaction','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','zip-dir','fast-json-patch','request-promise'];(function(_0x2907c9,_0x5d25bd){var _0x48fc5f=function(_0x225b67){while(--_0x225b67){_0x2907c9['push'](_0x2907c9['shift']());}};_0x48fc5f(++_0x5d25bd);}(_0x3893,0x1a1));var _0x3389=function(_0x484fae,_0x37c7ed){_0x484fae=_0x484fae-0x0;var _0x2df2a7=_0x3893[_0x484fae];return _0x2df2a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3389('0x0'));var jsonpatch=require(_0x3389('0x1'));var rp=require(_0x3389('0x2'));var moment=require(_0x3389('0x3'));var BPromise=require(_0x3389('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3389('0x5'));var sox=require(_0x3389('0x6'));var csv=require(_0x3389('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3389('0x8'));var squel=require(_0x3389('0x9'));var crypto=require(_0x3389('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3389('0xb'));var toCsv=require(_0x3389('0x7'));var querystring=require(_0x3389('0xc'));var Papa=require('papaparse');var Redis=require(_0x3389('0xd'));var authService=require(_0x3389('0xe'));var qs=require(_0x3389('0xf'));var as=require(_0x3389('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3389('0x11'))(_0x3389('0x12'));var utils=require(_0x3389('0x13'));var config=require(_0x3389('0x14'));var licenseUtil=require(_0x3389('0x15'));var db=require(_0x3389('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3389('0x17')][_0x3389('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xfca1b7,_0x3f66cd,_0x8d0049,_0x12f440){return new BPromise(function(_0x1a1acf,_0x2130ee){var _0x2c5a2e=_0x12f440||client;return _0x2c5a2e[_0x3389('0x19')](_0xfca1b7,_0x8d0049)['then'](function(_0xd4a8d8){logger['info'](_0x3389('0x1a'),_0x3f66cd,_0x3389('0x1b'));logger[_0x3389('0x1c')](_0x3389('0x1d'),_0x3f66cd,_0x3389('0x1b'),JSON[_0x3389('0x1e')](_0xd4a8d8));if(_0xd4a8d8[_0x3389('0x1f')]){if(_0xd4a8d8[_0x3389('0x1f')][_0x3389('0x20')]===0x1f4){logger[_0x3389('0x1f')](_0x3389('0x1a'),_0x3f66cd,_0xd4a8d8[_0x3389('0x1f')]['message']);return _0x2130ee(_0xd4a8d8[_0x3389('0x1f')][_0x3389('0x21')]);}logger[_0x3389('0x1f')](_0x3389('0x1a'),_0x3f66cd,_0xd4a8d8[_0x3389('0x1f')][_0x3389('0x21')]);return _0x1a1acf(_0xd4a8d8[_0x3389('0x1f')][_0x3389('0x21')]);}else{logger[_0x3389('0x22')](_0x3389('0x1a'),_0x3f66cd,_0x3389('0x1b'));_0x1a1acf(_0xd4a8d8['result']['message']);}})[_0x3389('0x23')](function(_0x499a70){logger['error'](_0x3389('0x1a'),_0x3f66cd,_0x499a70);_0x2130ee(_0x499a70);});});}function respondWithStatusCode(_0x9520cc,_0x3cc58d){_0x3cc58d=_0x3cc58d||0xcc;return function(_0x470b18){if(_0x470b18){return _0x9520cc[_0x3389('0x24')](_0x3cc58d);}return _0x9520cc[_0x3389('0x25')](_0x3cc58d)['end']();};}function respondWithResult(_0x38db4c,_0x37a672){_0x37a672=_0x37a672||0xc8;return function(_0x39092e){if(_0x39092e){return _0x38db4c[_0x3389('0x25')](_0x37a672)['json'](_0x39092e);}};}function respondWithFilteredResult(_0x20498f,_0x20460f){return function(_0xc995ad){if(_0xc995ad){var _0x2b0bec=typeof _0x20460f['offset']==='undefined'&&typeof _0x20460f[_0x3389('0x26')]===_0x3389('0x27');var _0x44c81a=_0xc995ad[_0x3389('0x28')];var _0x335c68=_0x2b0bec?0x0:_0x20460f[_0x3389('0x29')];var _0x4c7af4=_0x2b0bec?_0xc995ad[_0x3389('0x28')]:_0x20460f[_0x3389('0x29')]+_0x20460f[_0x3389('0x26')];var _0x45d2d4;if(_0x4c7af4>=_0x44c81a){_0x4c7af4=_0x44c81a;_0x45d2d4=0xc8;}else{_0x45d2d4=0xce;}_0x20498f['status'](_0x45d2d4);return _0x20498f[_0x3389('0x2a')](_0x3389('0x2b'),_0x335c68+'-'+_0x4c7af4+'/'+_0x44c81a)[_0x3389('0x2c')](_0xc995ad);}return null;};}function patchUpdates(_0x57a15a){return function(_0x3eeaf0){try{jsonpatch['apply'](_0x3eeaf0,_0x57a15a,!![]);}catch(_0x5aac71){return BPromise[_0x3389('0x2d')](_0x5aac71);}return _0x3eeaf0[_0x3389('0x2e')]();};}function saveUpdates(_0xc542ea,_0x2ce379){return function(_0x2316ac){if(_0x2316ac){return _0x2316ac[_0x3389('0x2f')](_0xc542ea)[_0x3389('0x30')](function(_0x3643a3){return _0x3643a3;});}return null;};}function removeEntity(_0x2a8772,_0x5ead30){return function(_0x36d4fd){if(_0x36d4fd){return _0x36d4fd[_0x3389('0x31')]()[_0x3389('0x30')](function(){_0x2a8772[_0x3389('0x25')](0xcc)[_0x3389('0x32')]();});}};}function handleEntityNotFound(_0x2df80a,_0xc3296f){return function(_0x6fb65f){if(!_0x6fb65f){_0x2df80a['sendStatus'](0x194);}return _0x6fb65f;};}function handleError(_0x41305a,_0x3b772e){_0x3b772e=_0x3b772e||0x1f4;return function(_0x5ad0b2){logger['error'](_0x5ad0b2['stack']);if(_0x5ad0b2['name']){delete _0x5ad0b2['name'];}_0x41305a[_0x3389('0x25')](_0x3b772e)['send'](_0x5ad0b2);};}exports[_0x3389('0x33')]=function(_0x570caf,_0x6985e1){var _0x269b8c={},_0x41e75e={},_0x2e5b79={'count':0x0,'rows':[]};var _0x400f65=_['map'](db['Network']['rawAttributes'],function(_0x11406a){return{'name':_0x11406a[_0x3389('0x34')],'type':_0x11406a['type'][_0x3389('0x35')]};});_0x41e75e['model']=_[_0x3389('0x36')](_0x400f65,_0x3389('0x37'));_0x41e75e['query']=_['keys'](_0x570caf[_0x3389('0x38')]);_0x41e75e['filters']=_[_0x3389('0x39')](_0x41e75e[_0x3389('0x3a')],_0x41e75e[_0x3389('0x38')]);_0x269b8c[_0x3389('0x3b')]=_[_0x3389('0x39')](_0x41e75e[_0x3389('0x3a')],qs[_0x3389('0x3c')](_0x570caf[_0x3389('0x38')][_0x3389('0x3c')]));_0x269b8c[_0x3389('0x3b')]=_0x269b8c[_0x3389('0x3b')]['length']?_0x269b8c['attributes']:_0x41e75e[_0x3389('0x3a')];if(!_0x570caf['query'][_0x3389('0x3d')](_0x3389('0x3e'))){_0x269b8c[_0x3389('0x26')]=qs[_0x3389('0x26')](_0x570caf['query']['limit']);_0x269b8c['offset']=qs[_0x3389('0x29')](_0x570caf['query'][_0x3389('0x29')]);}_0x269b8c[_0x3389('0x3f')]=qs[_0x3389('0x40')](_0x570caf[_0x3389('0x38')]['sort']);_0x269b8c['where']=qs[_0x3389('0x41')](_['pick'](_0x570caf[_0x3389('0x38')],_0x41e75e[_0x3389('0x41')]),_0x400f65);if(_0x570caf[_0x3389('0x38')]['filter']){_0x269b8c[_0x3389('0x42')]=_['merge'](_0x269b8c[_0x3389('0x42')],{'$or':_[_0x3389('0x36')](_0x400f65,function(_0x2918c8){if(_0x2918c8[_0x3389('0x43')]!==_0x3389('0x44')){var _0xb2e4f1={};_0xb2e4f1[_0x2918c8['name']]={'$like':'%'+_0x570caf[_0x3389('0x38')][_0x3389('0x45')]+'%'};return _0xb2e4f1;}})});}_0x269b8c=_[_0x3389('0x46')]({},_0x269b8c,_0x570caf['options']);var _0x1af07d={'where':_0x269b8c[_0x3389('0x42')]};return db['Network'][_0x3389('0x28')](_0x1af07d)[_0x3389('0x30')](function(_0xca138f){_0x2e5b79[_0x3389('0x28')]=_0xca138f;if(_0x570caf['query'][_0x3389('0x47')]){_0x269b8c[_0x3389('0x48')]=[{'all':!![]}];}return db[_0x3389('0x49')][_0x3389('0x4a')](_0x269b8c);})['then'](function(_0x21905a){_0x2e5b79['rows']=_0x21905a;return _0x2e5b79;})['then'](respondWithFilteredResult(_0x6985e1,_0x269b8c))[_0x3389('0x23')](handleError(_0x6985e1,null));};exports[_0x3389('0x4b')]=function(_0x48da1c,_0x2a076f){var _0x130d65={'raw':!![],'where':{'id':_0x48da1c[_0x3389('0x4c')]['id']}},_0xbeb37c={};_0xbeb37c[_0x3389('0x3a')]=_[_0x3389('0x4d')](db[_0x3389('0x49')][_0x3389('0x4e')]);_0xbeb37c[_0x3389('0x38')]=_[_0x3389('0x4d')](_0x48da1c[_0x3389('0x38')]);_0xbeb37c[_0x3389('0x41')]=_[_0x3389('0x39')](_0xbeb37c[_0x3389('0x3a')],_0xbeb37c['query']);_0x130d65[_0x3389('0x3b')]=_[_0x3389('0x39')](_0xbeb37c[_0x3389('0x3a')],qs[_0x3389('0x3c')](_0x48da1c['query'][_0x3389('0x3c')]));_0x130d65[_0x3389('0x3b')]=_0x130d65['attributes'][_0x3389('0x4f')]?_0x130d65[_0x3389('0x3b')]:_0xbeb37c[_0x3389('0x3a')];if(_0x48da1c[_0x3389('0x38')][_0x3389('0x47')]){_0x130d65[_0x3389('0x48')]=[{'all':!![]}];}_0x130d65=_[_0x3389('0x46')]({},_0x130d65,_0x48da1c['options']);return db['Network'][_0x3389('0x50')](_0x130d65)[_0x3389('0x30')](handleEntityNotFound(_0x2a076f,null))[_0x3389('0x30')](respondWithResult(_0x2a076f,null))[_0x3389('0x23')](handleError(_0x2a076f,null));};exports['create']=function(_0x141afe,_0x53f2c7,_0x2a016a){var _0x3a9b80;return db[_0x3389('0x51')][_0x3389('0x52')](function(_0x212a4d){return db[_0x3389('0x49')][_0x3389('0x53')](_0x141afe[_0x3389('0x54')],{'raw':!![]})[_0x3389('0x30')](function(_0x3378da){_0x3a9b80=_0x3378da;return db[_0x3389('0x49')][_0x3389('0x4a')]({'where':{'type':_0x141afe[_0x3389('0x54')]['type']},'raw':!![]});})[_0x3389('0x30')](function(_0x4f6518){if(_0x3a9b80[_0x3389('0x43')][_0x3389('0x55')]()==_0x3389('0x56')){var _0x2608a9=fs[_0x3389('0x57')](path[_0x3389('0x58')](config[_0x3389('0x59')],_0x3389('0x5a')),'utf8');var _0x51f25e=ejs[_0x3389('0x5b')](_0x2608a9,{'networks':_0x4f6518||[]});fs[_0x3389('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x51f25e);return respondWithRpcPromise('Reload','create',{'module':_0x3389('0x5d')});}else if(_0x3a9b80[_0x3389('0x43')]['toUpperCase']()==_0x3389('0x5e')){var _0x405ccc=fs[_0x3389('0x57')](path['join'](config['root'],_0x3389('0x5f')),_0x3389('0x60'));var _0x23b0eb=ejs[_0x3389('0x5b')](_0x405ccc,{'networks':_0x4f6518||[]});fs['writeFileSync'](_0x3389('0x61'),_0x23b0eb);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x6d79cf=fs[_0x3389('0x57')](path[_0x3389('0x58')](config[_0x3389('0x59')],_0x3389('0x63')),_0x3389('0x60'));var _0x445e68=ejs[_0x3389('0x5b')](_0x6d79cf,{'networks':_0x4f6518||[]});fs[_0x3389('0x5c')](util[_0x3389('0x64')](_0x3389('0x65'),_0x141afe[_0x3389('0x54')][_0x3389('0x43')][_0x3389('0x66')]()),_0x445e68);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x53'),{'module':_0x3389('0x67')});}return null;})[_0x3389('0x30')](function(){return _0x3a9b80;});})[_0x3389('0x30')](respondWithResult(_0x53f2c7,0xc9))[_0x3389('0x23')](handleError(_0x53f2c7,null));};exports[_0x3389('0x2f')]=function(_0x3ace76,_0x368408,_0x1ed4f1){var _0x572b08;return db['sequelize'][_0x3389('0x52')](function(_0x5de0ff){return db[_0x3389('0x49')][_0x3389('0x50')]({'where':{'id':_0x3ace76[_0x3389('0x4c')]['id']}})[_0x3389('0x30')](handleEntityNotFound(_0x368408,null))[_0x3389('0x30')](saveUpdates(_0x3ace76[_0x3389('0x54')],null))[_0x3389('0x30')](function(_0x499183){if(_0x499183){_0x572b08=_0x499183;return db[_0x3389('0x49')][_0x3389('0x4a')]({'where':{'type':_0x572b08[_0x3389('0x43')]},'raw':!![]});}return null;})['then'](function(_0x4ff7a1){if(_0x572b08[_0x3389('0x43')][_0x3389('0x55')]()==_0x3389('0x56')){var _0xb5df38=fs['readFileSync'](path['join'](config['root'],_0x3389('0x5a')),_0x3389('0x60'));var _0x234818=ejs[_0x3389('0x5b')](_0xb5df38,{'networks':_0x4ff7a1||[]});fs[_0x3389('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x234818);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x2f'),{'module':_0x3389('0x5d')});}else if(_0x572b08[_0x3389('0x43')]['toUpperCase']()==_0x3389('0x5e')){var _0x405a87=fs[_0x3389('0x57')](path['join'](config[_0x3389('0x59')],_0x3389('0x5f')),'utf8');var _0x130d35=ejs[_0x3389('0x5b')](_0x405a87,{'networks':_0x4ff7a1||[]});fs[_0x3389('0x5c')](_0x3389('0x61'),_0x130d35);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x2f'),{'module':_0x3389('0x5d')});}else{var _0x2e1077=fs[_0x3389('0x57')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x9ed516=ejs[_0x3389('0x5b')](_0x2e1077,{'networks':_0x4ff7a1||[]});fs[_0x3389('0x5c')](util[_0x3389('0x64')](_0x3389('0x65'),_0x3ace76['body'][_0x3389('0x43')][_0x3389('0x66')]()),_0x9ed516);return respondWithRpcPromise('Reload',_0x3389('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x3389('0x30')](function(_0x37c632){if(_0x37c632){return _0x572b08;}return null;});})[_0x3389('0x30')](respondWithResult(_0x368408,null))['catch'](handleError(_0x368408,null));};exports[_0x3389('0x31')]=function(_0x5cd672,_0x59cd75,_0x3d8d00){var _0x4aa89a;return db[_0x3389('0x49')][_0x3389('0x50')]({'where':{'id':_0x5cd672['params']['id']}})[_0x3389('0x30')](function(_0x1ab59c){_0x4aa89a=_0x1ab59c;return _0x1ab59c;})[_0x3389('0x30')](handleEntityNotFound(_0x59cd75,null))[_0x3389('0x30')](removeEntity(_0x59cd75,null))[_0x3389('0x30')](function(){if(_0x4aa89a){return db[_0x3389('0x49')]['findAll']({'where':{'type':_0x4aa89a[_0x3389('0x43')]},'raw':!![]});}})[_0x3389('0x30')](function(_0x29d648){if(_0x4aa89a['type'][_0x3389('0x55')]()==_0x3389('0x56')){var _0x3cd61e=fs[_0x3389('0x57')](path[_0x3389('0x58')](config[_0x3389('0x59')],_0x3389('0x5a')),_0x3389('0x60'));var _0x40c819=ejs[_0x3389('0x5b')](_0x3cd61e,{'networks':_0x29d648||[]});fs[_0x3389('0x5c')](_0x3389('0x68'),_0x40c819);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x31'),{'module':_0x3389('0x5d')});}else if(_0x4aa89a[_0x3389('0x43')]['toUpperCase']()==_0x3389('0x5e')){var _0xe5c08a=fs['readFileSync'](path[_0x3389('0x58')](config['root'],_0x3389('0x5f')),_0x3389('0x60'));var _0x30e899=ejs[_0x3389('0x5b')](_0xe5c08a,{'networks':_0x29d648||[]});fs[_0x3389('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x30e899);return respondWithRpcPromise(_0x3389('0x62'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x2395cb=fs['readFileSync'](path[_0x3389('0x58')](config[_0x3389('0x59')],_0x3389('0x63')),_0x3389('0x60'));var _0x2c7020=ejs[_0x3389('0x5b')](_0x2395cb,{'networks':_0x29d648||[]});fs[_0x3389('0x5c')](util[_0x3389('0x64')](_0x3389('0x65'),_0x5cd672[_0x3389('0x54')][_0x3389('0x43')][_0x3389('0x66')]()),_0x2c7020);return respondWithRpcPromise(_0x3389('0x62'),_0x3389('0x31'),{'module':_0x3389('0x67')});}return null;})[_0x3389('0x23')](handleError(_0x59cd75,null));}; \ No newline at end of file +var _0x23c0=['keys','find','transaction','body','findAll','toUpperCase','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','chan_sip.so','sequelize','STUN','server/files/templates/stun_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','Network','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params'];(function(_0x4080aa,_0x47e5ec){var _0x36bbeb=function(_0x402486){while(--_0x402486){_0x4080aa['push'](_0x4080aa['shift']());}};_0x36bbeb(++_0x47e5ec);}(_0x23c0,0x153));var _0x023c=function(_0x2a2cb3,_0x689eb9){_0x2a2cb3=_0x2a2cb3-0x0;var _0x35af21=_0x23c0[_0x2a2cb3];return _0x35af21;};'use strict';var emlformat=require(_0x023c('0x0'));var rimraf=require(_0x023c('0x1'));var zipdir=require(_0x023c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x023c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x023c('0x4'));var util=require(_0x023c('0x5'));var path=require('path');var sox=require(_0x023c('0x6'));var csv=require(_0x023c('0x7'));var ejs=require(_0x023c('0x8'));var fs=require('fs');var fs_extra=require(_0x023c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x023c('0xa'));var deskjs=require(_0x023c('0xb'));var toCsv=require(_0x023c('0x7'));var querystring=require('querystring');var Papa=require(_0x023c('0xc'));var Redis=require(_0x023c('0xd'));var authService=require(_0x023c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x023c('0xf'));var hardwareService=require(_0x023c('0x10'));var logger=require(_0x023c('0x11'))(_0x023c('0x12'));var utils=require(_0x023c('0x13'));var config=require(_0x023c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x023c('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x023c('0x16')][_0x023c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4383fe,_0x43fb29,_0x4c57de,_0x1e6e43){return new BPromise(function(_0x2c1b70,_0x2221e0){var _0x347b74=_0x1e6e43||client;return _0x347b74['request'](_0x4383fe,_0x4c57de)[_0x023c('0x18')](function(_0xa54321){logger[_0x023c('0x19')](_0x023c('0x1a'),_0x43fb29,'request\x20sent');logger[_0x023c('0x1b')](_0x023c('0x1c'),_0x43fb29,_0x023c('0x1d'),JSON[_0x023c('0x1e')](_0xa54321));if(_0xa54321['error']){if(_0xa54321[_0x023c('0x1f')][_0x023c('0x20')]===0x1f4){logger['error'](_0x023c('0x1a'),_0x43fb29,_0xa54321['error'][_0x023c('0x21')]);return _0x2221e0(_0xa54321[_0x023c('0x1f')][_0x023c('0x21')]);}logger['error'](_0x023c('0x1a'),_0x43fb29,_0xa54321[_0x023c('0x1f')][_0x023c('0x21')]);return _0x2c1b70(_0xa54321['error'][_0x023c('0x21')]);}else{logger[_0x023c('0x19')]('Network,\x20%s,\x20%s',_0x43fb29,_0x023c('0x1d'));_0x2c1b70(_0xa54321[_0x023c('0x22')][_0x023c('0x21')]);}})[_0x023c('0x23')](function(_0x18f9ec){logger[_0x023c('0x1f')](_0x023c('0x1a'),_0x43fb29,_0x18f9ec);_0x2221e0(_0x18f9ec);});});}function respondWithStatusCode(_0x36f86d,_0x27cc21){_0x27cc21=_0x27cc21||0xcc;return function(_0x2da00c){if(_0x2da00c){return _0x36f86d[_0x023c('0x24')](_0x27cc21);}return _0x36f86d[_0x023c('0x25')](_0x27cc21)[_0x023c('0x26')]();};}function respondWithResult(_0x499191,_0x4372b3){_0x4372b3=_0x4372b3||0xc8;return function(_0x3f27a4){if(_0x3f27a4){return _0x499191[_0x023c('0x25')](_0x4372b3)[_0x023c('0x27')](_0x3f27a4);}};}function respondWithFilteredResult(_0x2c0cf3,_0x5625a8){return function(_0x1ad7b8){if(_0x1ad7b8){var _0x2b7f71=typeof _0x5625a8['offset']===_0x023c('0x28')&&typeof _0x5625a8['limit']===_0x023c('0x28');var _0x175d28=_0x1ad7b8['count'];var _0x35fd42=_0x2b7f71?0x0:_0x5625a8[_0x023c('0x29')];var _0x236e52=_0x2b7f71?_0x1ad7b8[_0x023c('0x2a')]:_0x5625a8[_0x023c('0x29')]+_0x5625a8[_0x023c('0x2b')];var _0x357a62;if(_0x236e52>=_0x175d28){_0x236e52=_0x175d28;_0x357a62=0xc8;}else{_0x357a62=0xce;}_0x2c0cf3[_0x023c('0x25')](_0x357a62);return _0x2c0cf3['set'](_0x023c('0x2c'),_0x35fd42+'-'+_0x236e52+'/'+_0x175d28)['json'](_0x1ad7b8);}return null;};}function patchUpdates(_0x1763d){return function(_0xb74670){try{jsonpatch[_0x023c('0x2d')](_0xb74670,_0x1763d,!![]);}catch(_0x2e1f5a){return BPromise[_0x023c('0x2e')](_0x2e1f5a);}return _0xb74670[_0x023c('0x2f')]();};}function saveUpdates(_0x5479c4,_0x3292ce){return function(_0x30b3a4){if(_0x30b3a4){return _0x30b3a4[_0x023c('0x30')](_0x5479c4)[_0x023c('0x18')](function(_0x5456cd){return _0x5456cd;});}return null;};}function removeEntity(_0x12cc34,_0xd30128){return function(_0x16490c){if(_0x16490c){return _0x16490c[_0x023c('0x31')]()[_0x023c('0x18')](function(){_0x12cc34[_0x023c('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aebb1,_0x1c65bc){return function(_0x3f9ab2){if(!_0x3f9ab2){_0x2aebb1['sendStatus'](0x194);}return _0x3f9ab2;};}function handleError(_0x162741,_0x5f3309){_0x5f3309=_0x5f3309||0x1f4;return function(_0x103d3c){logger[_0x023c('0x1f')](_0x103d3c[_0x023c('0x32')]);if(_0x103d3c[_0x023c('0x33')]){delete _0x103d3c[_0x023c('0x33')];}_0x162741[_0x023c('0x25')](_0x5f3309)['send'](_0x103d3c);};}exports[_0x023c('0x34')]=function(_0x25b5ce,_0x1d55d1){var _0x444ec3={},_0x3c9461={},_0x2a7c8b={'count':0x0,'rows':[]};var _0x377cf0=_[_0x023c('0x35')](db[_0x023c('0x36')][_0x023c('0x37')],function(_0x343dff){return{'name':_0x343dff[_0x023c('0x38')],'type':_0x343dff[_0x023c('0x39')]['key']};});_0x3c9461[_0x023c('0x3a')]=_[_0x023c('0x35')](_0x377cf0,_0x023c('0x33'));_0x3c9461[_0x023c('0x3b')]=_['keys'](_0x25b5ce[_0x023c('0x3b')]);_0x3c9461[_0x023c('0x3c')]=_[_0x023c('0x3d')](_0x3c9461[_0x023c('0x3a')],_0x3c9461['query']);_0x444ec3[_0x023c('0x3e')]=_[_0x023c('0x3d')](_0x3c9461[_0x023c('0x3a')],qs['fields'](_0x25b5ce[_0x023c('0x3b')][_0x023c('0x3f')]));_0x444ec3[_0x023c('0x3e')]=_0x444ec3[_0x023c('0x3e')][_0x023c('0x40')]?_0x444ec3[_0x023c('0x3e')]:_0x3c9461[_0x023c('0x3a')];if(!_0x25b5ce[_0x023c('0x3b')]['hasOwnProperty'](_0x023c('0x41'))){_0x444ec3[_0x023c('0x2b')]=qs['limit'](_0x25b5ce[_0x023c('0x3b')][_0x023c('0x2b')]);_0x444ec3[_0x023c('0x29')]=qs[_0x023c('0x29')](_0x25b5ce[_0x023c('0x3b')][_0x023c('0x29')]);}_0x444ec3['order']=qs[_0x023c('0x42')](_0x25b5ce[_0x023c('0x3b')][_0x023c('0x42')]);_0x444ec3['where']=qs['filters'](_[_0x023c('0x43')](_0x25b5ce[_0x023c('0x3b')],_0x3c9461[_0x023c('0x3c')]),_0x377cf0);if(_0x25b5ce[_0x023c('0x3b')][_0x023c('0x44')]){_0x444ec3[_0x023c('0x45')]=_[_0x023c('0x46')](_0x444ec3[_0x023c('0x45')],{'$or':_[_0x023c('0x35')](_0x377cf0,function(_0x433f06){if(_0x433f06[_0x023c('0x39')]!=='VIRTUAL'){var _0x48bad5={};_0x48bad5[_0x433f06[_0x023c('0x33')]]={'$like':'%'+_0x25b5ce[_0x023c('0x3b')][_0x023c('0x44')]+'%'};return _0x48bad5;}})});}_0x444ec3=_[_0x023c('0x46')]({},_0x444ec3,_0x25b5ce[_0x023c('0x47')]);var _0x50f457={'where':_0x444ec3['where']};return db[_0x023c('0x36')][_0x023c('0x2a')](_0x50f457)[_0x023c('0x18')](function(_0x3afa98){_0x2a7c8b['count']=_0x3afa98;if(_0x25b5ce[_0x023c('0x3b')][_0x023c('0x48')]){_0x444ec3[_0x023c('0x49')]=[{'all':!![]}];}return db['Network']['findAll'](_0x444ec3);})[_0x023c('0x18')](function(_0x23acae){_0x2a7c8b[_0x023c('0x4a')]=_0x23acae;return _0x2a7c8b;})['then'](respondWithFilteredResult(_0x1d55d1,_0x444ec3))[_0x023c('0x23')](handleError(_0x1d55d1,null));};exports[_0x023c('0x4b')]=function(_0x2bf174,_0x5d9676){var _0x444f1a={'raw':!![],'where':{'id':_0x2bf174[_0x023c('0x4c')]['id']}},_0x2021f8={};_0x2021f8[_0x023c('0x3a')]=_[_0x023c('0x4d')](db['Network'][_0x023c('0x37')]);_0x2021f8[_0x023c('0x3b')]=_[_0x023c('0x4d')](_0x2bf174[_0x023c('0x3b')]);_0x2021f8[_0x023c('0x3c')]=_[_0x023c('0x3d')](_0x2021f8[_0x023c('0x3a')],_0x2021f8[_0x023c('0x3b')]);_0x444f1a[_0x023c('0x3e')]=_[_0x023c('0x3d')](_0x2021f8[_0x023c('0x3a')],qs[_0x023c('0x3f')](_0x2bf174[_0x023c('0x3b')][_0x023c('0x3f')]));_0x444f1a[_0x023c('0x3e')]=_0x444f1a[_0x023c('0x3e')][_0x023c('0x40')]?_0x444f1a[_0x023c('0x3e')]:_0x2021f8[_0x023c('0x3a')];if(_0x2bf174['query'][_0x023c('0x48')]){_0x444f1a[_0x023c('0x49')]=[{'all':!![]}];}_0x444f1a=_['merge']({},_0x444f1a,_0x2bf174[_0x023c('0x47')]);return db[_0x023c('0x36')][_0x023c('0x4e')](_0x444f1a)[_0x023c('0x18')](handleEntityNotFound(_0x5d9676,null))['then'](respondWithResult(_0x5d9676,null))['catch'](handleError(_0x5d9676,null));};exports['create']=function(_0xaefe20,_0x3d549f,_0x2597b5){var _0x45c128;return db['sequelize'][_0x023c('0x4f')](function(_0x1eb53f){return db['Network']['create'](_0xaefe20[_0x023c('0x50')],{'raw':!![]})[_0x023c('0x18')](function(_0x43d45c){_0x45c128=_0x43d45c;return db[_0x023c('0x36')][_0x023c('0x51')]({'where':{'type':_0xaefe20[_0x023c('0x50')][_0x023c('0x39')]},'raw':!![]});})[_0x023c('0x18')](function(_0x540c5b){if(_0x45c128[_0x023c('0x39')][_0x023c('0x52')]()=='STUN'){var _0x295c67=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],'server/files/templates/stun_multiple.ejs'),_0x023c('0x56'));var _0x5d32f8=ejs[_0x023c('0x57')](_0x295c67,{'networks':_0x540c5b||[]});fs[_0x023c('0x58')](_0x023c('0x59'),_0x5d32f8);return respondWithRpcPromise(_0x023c('0x5a'),_0x023c('0x5b'),{'module':'res_stun_monitor.so'});}else if(_0x45c128[_0x023c('0x39')][_0x023c('0x52')]()==_0x023c('0x5c')){var _0x3e5750=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],_0x023c('0x5d')),'utf8');var _0x32c37a=ejs[_0x023c('0x57')](_0x3e5750,{'networks':_0x540c5b||[]});fs['writeFileSync'](_0x023c('0x5e'),_0x32c37a);return respondWithRpcPromise(_0x023c('0x5a'),_0x023c('0x5b'),{'module':_0x023c('0x5f')});}else{var _0x59fbda=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],_0x023c('0x60')),_0x023c('0x56'));var _0x34fee2=ejs[_0x023c('0x57')](_0x59fbda,{'networks':_0x540c5b||[]});fs[_0x023c('0x58')](util[_0x023c('0x61')]('/etc/asterisk/sip_xcally_%s.conf',_0xaefe20[_0x023c('0x50')][_0x023c('0x39')]['toLowerCase']()),_0x34fee2);return respondWithRpcPromise(_0x023c('0x5a'),'create',{'module':_0x023c('0x62')});}return null;})[_0x023c('0x18')](function(){return _0x45c128;});})[_0x023c('0x18')](respondWithResult(_0x3d549f,0xc9))[_0x023c('0x23')](handleError(_0x3d549f,null));};exports['update']=function(_0x3aaa09,_0x51d187,_0x1e6356){var _0x3ccf54;return db[_0x023c('0x63')][_0x023c('0x4f')](function(_0x582d3a){return db[_0x023c('0x36')]['find']({'where':{'id':_0x3aaa09[_0x023c('0x4c')]['id']}})[_0x023c('0x18')](handleEntityNotFound(_0x51d187,null))[_0x023c('0x18')](saveUpdates(_0x3aaa09['body'],null))['then'](function(_0x2f279c){if(_0x2f279c){_0x3ccf54=_0x2f279c;return db[_0x023c('0x36')][_0x023c('0x51')]({'where':{'type':_0x3ccf54['type']},'raw':!![]});}return null;})['then'](function(_0x5b8845){if(_0x3ccf54[_0x023c('0x39')][_0x023c('0x52')]()==_0x023c('0x64')){var _0x62a6d8=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],_0x023c('0x65')),'utf8');var _0x1cf3fa=ejs['render'](_0x62a6d8,{'networks':_0x5b8845||[]});fs[_0x023c('0x58')]('/etc/asterisk/stun_xcally.conf',_0x1cf3fa);return respondWithRpcPromise(_0x023c('0x5a'),_0x023c('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x3ccf54[_0x023c('0x39')][_0x023c('0x52')]()==_0x023c('0x5c')){var _0x140a52=fs[_0x023c('0x53')](path['join'](config[_0x023c('0x55')],_0x023c('0x5d')),'utf8');var _0x1929bc=ejs[_0x023c('0x57')](_0x140a52,{'networks':_0x5b8845||[]});fs['writeFileSync'](_0x023c('0x5e'),_0x1929bc);return respondWithRpcPromise(_0x023c('0x5a'),'update',{'module':_0x023c('0x5f')});}else{var _0x1d84ff=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],'server/files/templates/network.ejs'),_0x023c('0x56'));var _0x15be9f=ejs[_0x023c('0x57')](_0x1d84ff,{'networks':_0x5b8845||[]});fs[_0x023c('0x58')](util['format'](_0x023c('0x66'),_0x3aaa09[_0x023c('0x50')][_0x023c('0x39')][_0x023c('0x67')]()),_0x15be9f);return respondWithRpcPromise(_0x023c('0x5a'),_0x023c('0x30'),{'module':_0x023c('0x62')});}return null;})[_0x023c('0x18')](function(_0x21ba2e){if(_0x21ba2e){return _0x3ccf54;}return null;});})[_0x023c('0x18')](respondWithResult(_0x51d187,null))[_0x023c('0x23')](handleError(_0x51d187,null));};exports[_0x023c('0x31')]=function(_0x1a9914,_0x223fa0,_0x5be440){var _0x334fc4;return db[_0x023c('0x36')][_0x023c('0x4e')]({'where':{'id':_0x1a9914[_0x023c('0x4c')]['id']}})[_0x023c('0x18')](function(_0x150c86){_0x334fc4=_0x150c86;return _0x150c86;})[_0x023c('0x18')](handleEntityNotFound(_0x223fa0,null))['then'](removeEntity(_0x223fa0,null))['then'](function(){if(_0x334fc4){return db[_0x023c('0x36')][_0x023c('0x51')]({'where':{'type':_0x334fc4[_0x023c('0x39')]},'raw':!![]});}})[_0x023c('0x18')](function(_0x3e0f89){if(_0x334fc4[_0x023c('0x39')]['toUpperCase']()==_0x023c('0x64')){var _0x26a70f=fs[_0x023c('0x53')](path[_0x023c('0x54')](config[_0x023c('0x55')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x22ba2f=ejs[_0x023c('0x57')](_0x26a70f,{'networks':_0x3e0f89||[]});fs[_0x023c('0x58')](_0x023c('0x59'),_0x22ba2f);return respondWithRpcPromise(_0x023c('0x5a'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x334fc4[_0x023c('0x39')][_0x023c('0x52')]()==_0x023c('0x5c')){var _0x498e59=fs[_0x023c('0x53')](path['join'](config['root'],_0x023c('0x5d')),_0x023c('0x56'));var _0x591eed=ejs[_0x023c('0x57')](_0x498e59,{'networks':_0x3e0f89||[]});fs[_0x023c('0x58')]('/etc/asterisk/turn_xcally.conf',_0x591eed);return respondWithRpcPromise(_0x023c('0x5a'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x1280e4=fs['readFileSync'](path[_0x023c('0x54')](config[_0x023c('0x55')],_0x023c('0x60')),_0x023c('0x56'));var _0x36ccd2=ejs[_0x023c('0x57')](_0x1280e4,{'networks':_0x3e0f89||[]});fs['writeFileSync'](util[_0x023c('0x61')](_0x023c('0x66'),_0x1a9914[_0x023c('0x50')]['type'][_0x023c('0x67')]()),_0x36ccd2);return respondWithRpcPromise('Reload',_0x023c('0x31'),{'module':_0x023c('0x62')});}return null;})['catch'](handleError(_0x223fa0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3c70bf7..7fd20f9 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash','api','moment','bluebird'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0xa75b,0x170));var _0xba75=function(_0x529171,_0x156c42){_0x529171=_0x529171-0x0;var _0x639544=_0xa75b[_0x529171];return _0x639544;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0xdbf14f,_0x4bfcc4){var _0x3e58a2=function(_0x389184){while(--_0x389184){_0xdbf14f['push'](_0xdbf14f['shift']());}};_0x3e58a2(++_0x4bfcc4);}(_0x96cc,0x16c));var _0xc96c=function(_0x2a2591,_0x958577){_0x2a2591=_0x2a2591-0x0;var _0x45bde5=_0x96cc[_0x2a2591];return _0x45bde5;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index d455645..e3b20ea 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4006be,_0x471947){var _0x3d65bd=function(_0xaa80a){while(--_0xaa80a){_0x4006be['push'](_0x4006be['shift']());}};_0x3d65bd(++_0x471947);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x17252e,_0x3e934a){_0x17252e=_0x17252e-0x0;var _0x3638d8=_0x7a54[_0x17252e];return _0x3638d8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 0e81fb0..dc0c626 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 _0x2732=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','post','/:id/dispositions','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','send','put','update','removeDispositions','delete','removeAnswers'];(function(_0x2725ee,_0x431533){var _0xe75458=function(_0x1f94ee){while(--_0x1f94ee){_0x2725ee['push'](_0x2725ee['shift']());}};_0xe75458(++_0x431533);}(_0x2732,0x182));var _0x2273=function(_0x16ab74,_0x52449c){_0x16ab74=_0x16ab74-0x0;var _0x487f4f=_0x2732[_0x16ab74];return _0x487f4f;};'use strict';var multer=require(_0x2273('0x0'));var util=require(_0x2273('0x1'));var path=require(_0x2273('0x2'));var timeout=require(_0x2273('0x3'));var express=require(_0x2273('0x4'));var router=express[_0x2273('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2273('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2273('0x7'));var controller=require('./openchannelAccount.controller');router[_0x2273('0x8')]('/',auth[_0x2273('0x9')](),controller['index']);router['get'](_0x2273('0xa'),auth[_0x2273('0x9')](),controller[_0x2273('0xb')]);router['get'](_0x2273('0xc'),auth[_0x2273('0x9')](),controller[_0x2273('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2273('0xe')]);router['get'](_0x2273('0xf'),auth[_0x2273('0x9')](),controller['getAnswers']);router[_0x2273('0x8')]('/:id/applications',auth[_0x2273('0x9')](),controller[_0x2273('0x10')]);router[_0x2273('0x8')](_0x2273('0x11'),auth[_0x2273('0x9')](),controller[_0x2273('0x12')]);router[_0x2273('0x8')](_0x2273('0x13'),auth[_0x2273('0x9')](),controller['getAgents']);router[_0x2273('0x14')]('/',auth[_0x2273('0x9')](),controller['create']);router[_0x2273('0x14')](_0x2273('0x15'),auth[_0x2273('0x9')](),controller[_0x2273('0x16')]);router[_0x2273('0x14')](_0x2273('0xf'),auth[_0x2273('0x9')](),controller['addAnswer']);router[_0x2273('0x14')](_0x2273('0x17'),controller[_0x2273('0x18')]);router[_0x2273('0x14')](_0x2273('0x19'),auth[_0x2273('0x9')](),controller[_0x2273('0x1a')]);router[_0x2273('0x14')](_0x2273('0x13'),auth[_0x2273('0x9')](),controller[_0x2273('0x1b')]);router[_0x2273('0x14')]('/:id/send',auth[_0x2273('0x9')](),controller[_0x2273('0x1c')]);router[_0x2273('0x1d')](_0x2273('0xc'),auth[_0x2273('0x9')](),controller[_0x2273('0x1e')]);router['delete']('/:id',auth[_0x2273('0x9')](),controller['destroy']);router['delete'](_0x2273('0x15'),auth[_0x2273('0x9')](),controller[_0x2273('0x1f')]);router[_0x2273('0x20')](_0x2273('0xf'),auth['isAuthenticated'](),controller[_0x2273('0x21')]);router['delete'](_0x2273('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2273('0x22')]=router; \ No newline at end of file +var _0x79a8=['addDisposition','addAnswer','/:id/notify','notify','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create'];(function(_0x4be64b,_0x40f436){var _0x31e508=function(_0x18b6d0){while(--_0x18b6d0){_0x4be64b['push'](_0x4be64b['shift']());}};_0x31e508(++_0x40f436);}(_0x79a8,0xe2));var _0x879a=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x79a8[_0x52980f];return _0x1f52a1;};'use strict';var multer=require(_0x879a('0x0'));var util=require(_0x879a('0x1'));var path=require('path');var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express[_0x879a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x879a('0x5'));var interaction=require(_0x879a('0x6'));var config=require(_0x879a('0x7'));var controller=require(_0x879a('0x8'));router[_0x879a('0x9')]('/',auth[_0x879a('0xa')](),controller[_0x879a('0xb')]);router[_0x879a('0x9')](_0x879a('0xc'),auth[_0x879a('0xa')](),controller[_0x879a('0xd')]);router[_0x879a('0x9')](_0x879a('0xe'),auth['isAuthenticated'](),controller[_0x879a('0xf')]);router[_0x879a('0x9')](_0x879a('0x10'),auth[_0x879a('0xa')](),controller[_0x879a('0x11')]);router[_0x879a('0x9')](_0x879a('0x12'),auth['isAuthenticated'](),controller[_0x879a('0x13')]);router[_0x879a('0x9')](_0x879a('0x14'),auth[_0x879a('0xa')](),controller[_0x879a('0x15')]);router[_0x879a('0x9')](_0x879a('0x16'),auth[_0x879a('0xa')](),controller[_0x879a('0x17')]);router['get']('/:id/users',auth[_0x879a('0xa')](),controller['getAgents']);router[_0x879a('0x18')]('/',auth[_0x879a('0xa')](),controller[_0x879a('0x19')]);router['post'](_0x879a('0x10'),auth[_0x879a('0xa')](),controller[_0x879a('0x1a')]);router['post']('/:id/canned_answers',auth[_0x879a('0xa')](),controller[_0x879a('0x1b')]);router['post'](_0x879a('0x1c'),controller[_0x879a('0x1d')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x879a('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x879a('0x1e')]);router[_0x879a('0x18')](_0x879a('0x1f'),auth[_0x879a('0xa')](),controller[_0x879a('0x20')]);router[_0x879a('0x21')](_0x879a('0xe'),auth['isAuthenticated'](),controller[_0x879a('0x22')]);router[_0x879a('0x23')](_0x879a('0xe'),auth[_0x879a('0xa')](),controller[_0x879a('0x24')]);router[_0x879a('0x23')](_0x879a('0x10'),auth[_0x879a('0xa')](),controller[_0x879a('0x25')]);router[_0x879a('0x23')](_0x879a('0x12'),auth[_0x879a('0xa')](),controller[_0x879a('0x26')]);router[_0x879a('0x23')](_0x879a('0x27'),auth[_0x879a('0xa')](),controller[_0x879a('0x28')]);module[_0x879a('0x29')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 82046ad..3b08602 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 _0xc79a=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc79a,0x106));var _0xac79=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0xc79a[_0xd67723];return _0x53b62b;};'use strict';var Sequelize=require(_0xac79('0x0'));var rs=require(_0xac79('0x1'));module['exports']={'name':{'type':Sequelize[_0xac79('0x2')],'unique':_0xac79('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xac79('0x2')],'defaultValue':function(){return rs[_0xac79('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xac79('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xac79('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac79('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xac79('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xac79('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xac79('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xac79('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac79('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xac79('0x5')],'defaultValue':![],'comment':_0xac79('0x7'),'set':function(_0x35fcb1){if(!_0x35fcb1)this[_0xac79('0x8')](_0xac79('0x9'),null);this[_0xac79('0x8')]('mandatoryDisposition',_0x35fcb1);}}}; \ No newline at end of file +var _0xf47a=['exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x48db3b,_0x28e67c){var _0x286503=function(_0x2bde78){while(--_0x2bde78){_0x48db3b['push'](_0x48db3b['shift']());}};_0x286503(++_0x28e67c);}(_0xf47a,0x8a));var _0xaf47=function(_0x521cdb,_0x59a7a0){_0x521cdb=_0x521cdb-0x0;var _0x475d97=_0xf47a[_0x521cdb];return _0x475d97;};'use strict';var Sequelize=require(_0xaf47('0x0'));var rs=require(_0xaf47('0x1'));module[_0xaf47('0x2')]={'name':{'type':Sequelize[_0xaf47('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xaf47('0x3')]},'token':{'type':Sequelize[_0xaf47('0x3')],'defaultValue':function(){return rs[_0xaf47('0x4')]();}},'replyUri':{'type':Sequelize[_0xaf47('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xaf47('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaf47('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaf47('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xaf47('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaf47('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf47('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xaf47('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x236fe1){if(!_0x236fe1)this[_0xaf47('0x8')]('mandatoryDispositionPauseId',null);this[_0xaf47('0x8')](_0xaf47('0x9'),_0x236fe1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0137a6c..7f00d53 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 _0x26b2=['set','Content-Range','json','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','body','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filter','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','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','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','priority','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','Owner','Tag','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','out','user','Messages','dataValues','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./openchannelAccount.socket','jayson/promise','http','then','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x36869f,_0x503eb5){var _0x40aa9c=function(_0x42c881){while(--_0x42c881){_0x36869f['push'](_0x36869f['shift']());}};_0x40aa9c(++_0x503eb5);}(_0x26b2,0x8e));var _0x226b=function(_0x126d54,_0x14bbe6){_0x126d54=_0x126d54-0x0;var _0x361e42=_0x26b2[_0x126d54];return _0x361e42;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x226b('0x0'));var jsonpatch=require(_0x226b('0x1'));var rp=require('request-promise');var moment=require(_0x226b('0x2'));var BPromise=require(_0x226b('0x3'));var Mustache=require(_0x226b('0x4'));var util=require('util');var path=require(_0x226b('0x5'));var sox=require('sox');var csv=require(_0x226b('0x6'));var ejs=require(_0x226b('0x7'));var fs=require('fs');var fs_extra=require(_0x226b('0x8'));var _=require(_0x226b('0x9'));var squel=require(_0x226b('0xa'));var crypto=require('crypto');var jsforce=require(_0x226b('0xb'));var deskjs=require(_0x226b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x226b('0xd'));var Papa=require('papaparse');var Redis=require(_0x226b('0xe'));var authService=require(_0x226b('0xf'));var qs=require(_0x226b('0x10'));var as=require(_0x226b('0x11'));var hardwareService=require(_0x226b('0x12'));var logger=require(_0x226b('0x13'))(_0x226b('0x14'));var utils=require(_0x226b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x226b('0x16'));var db=require(_0x226b('0x17'))['db'];config['redis']=_['defaults'](config[_0x226b('0x18')],{'host':_0x226b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x226b('0x18')]));require(_0x226b('0x1a'))['register'](socket);var jayson=require(_0x226b('0x1b'));var client=jayson['client'][_0x226b('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x226b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3c3a5f,_0x40c84d,_0x25049c,_0x5a898f){return new BPromise(function(_0x1b5ca8,_0x1810fa){var _0x5f11d4=_0x5a898f||client;return _0x5f11d4['request'](_0x3c3a5f,_0x25049c)[_0x226b('0x1d')](function(_0x53e189){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x40c84d,_0x226b('0x1e'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x40c84d,_0x226b('0x1e'),JSON[_0x226b('0x1f')](_0x53e189));if(_0x53e189[_0x226b('0x20')]){if(_0x53e189['error'][_0x226b('0x21')]===0x1f4){logger[_0x226b('0x20')](_0x226b('0x22'),_0x40c84d,_0x53e189[_0x226b('0x20')][_0x226b('0x23')]);return _0x1810fa(_0x53e189[_0x226b('0x20')][_0x226b('0x23')]);}logger[_0x226b('0x20')](_0x226b('0x22'),_0x40c84d,_0x53e189[_0x226b('0x20')][_0x226b('0x23')]);return _0x1b5ca8(_0x53e189['error'][_0x226b('0x23')]);}else{logger['info'](_0x226b('0x22'),_0x40c84d,'request\x20sent');_0x1b5ca8(_0x53e189[_0x226b('0x24')][_0x226b('0x23')]);}})[_0x226b('0x25')](function(_0x186bbb){logger[_0x226b('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x40c84d,_0x186bbb);_0x1810fa(_0x186bbb);});});}function respondWithStatusCode(_0x24a811,_0x85ace1){_0x85ace1=_0x85ace1||0xcc;return function(_0x190b24){if(_0x190b24){return _0x24a811[_0x226b('0x26')](_0x85ace1);}return _0x24a811['status'](_0x85ace1)[_0x226b('0x27')]();};}function respondWithResult(_0x2165d4,_0x4753d0){_0x4753d0=_0x4753d0||0xc8;return function(_0x2f0072){if(_0x2f0072){return _0x2165d4[_0x226b('0x28')](_0x4753d0)['json'](_0x2f0072);}};}function respondWithFilteredResult(_0x23a803,_0xad7511){return function(_0x41d896){if(_0x41d896){var _0x1d866c=typeof _0xad7511[_0x226b('0x29')]===_0x226b('0x2a')&&typeof _0xad7511[_0x226b('0x2b')]===_0x226b('0x2a');var _0x197810=_0x41d896[_0x226b('0x2c')];var _0x473a82=_0x1d866c?0x0:_0xad7511[_0x226b('0x29')];var _0x4ef2a0=_0x1d866c?_0x41d896[_0x226b('0x2c')]:_0xad7511[_0x226b('0x29')]+_0xad7511[_0x226b('0x2b')];var _0x9e388c;if(_0x4ef2a0>=_0x197810){_0x4ef2a0=_0x197810;_0x9e388c=0xc8;}else{_0x9e388c=0xce;}_0x23a803[_0x226b('0x28')](_0x9e388c);return _0x23a803[_0x226b('0x2d')](_0x226b('0x2e'),_0x473a82+'-'+_0x4ef2a0+'/'+_0x197810)[_0x226b('0x2f')](_0x41d896);}return null;};}function patchUpdates(_0x5f5cae){return function(_0xf2d9d7){try{jsonpatch[_0x226b('0x30')](_0xf2d9d7,_0x5f5cae,!![]);}catch(_0x3193fd){return BPromise[_0x226b('0x31')](_0x3193fd);}return _0xf2d9d7[_0x226b('0x32')]();};}function saveUpdates(_0x1d1c68,_0xc47533){return function(_0x33e68c){if(_0x33e68c){return _0x33e68c[_0x226b('0x33')](_0x1d1c68)[_0x226b('0x1d')](function(_0x1b6e9f){return _0x1b6e9f;});}return null;};}function removeEntity(_0x2fc96c,_0x380d62){return function(_0x480060){if(_0x480060){return _0x480060[_0x226b('0x34')]()[_0x226b('0x1d')](function(){var _0x176a14=_0x480060['get']({'plain':!![]});var _0xf49c1f=_0x226b('0x35');return db[_0x226b('0x36')][_0x226b('0x34')]({'where':{'type':_0xf49c1f,'resourceId':_0x176a14['id']}})[_0x226b('0x1d')](function(){return _0x480060;});})[_0x226b('0x1d')](function(){_0x2fc96c[_0x226b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4859af,_0xb3243a){return function(_0x14e997){if(!_0x14e997){_0x4859af['sendStatus'](0x194);}return _0x14e997;};}function handleError(_0x591d13,_0x448d09){_0x448d09=_0x448d09||0x1f4;return function(_0x5c91ec){logger['error'](_0x5c91ec[_0x226b('0x37')]);if(_0x5c91ec[_0x226b('0x38')]){delete _0x5c91ec[_0x226b('0x38')];}_0x591d13[_0x226b('0x28')](_0x448d09)[_0x226b('0x39')](_0x5c91ec);};}exports[_0x226b('0x3a')]=function(_0x332614,_0x1a92fb){var _0x146944={'include':[{'model':db[_0x226b('0x3b')],'as':_0x226b('0x3c')}]},_0x3132af={},_0x1de9d7={'count':0x0,'rows':[]};var _0x300d92=_[_0x226b('0x3d')](db[_0x226b('0x3e')]['rawAttributes'],function(_0x12ed97){return{'name':_0x12ed97[_0x226b('0x3f')],'type':_0x12ed97[_0x226b('0x40')][_0x226b('0x41')]};});_0x3132af[_0x226b('0x42')]=_[_0x226b('0x3d')](_0x300d92,_0x226b('0x38'));_0x3132af[_0x226b('0x43')]=_[_0x226b('0x44')](_0x332614[_0x226b('0x43')]);_0x3132af[_0x226b('0x45')]=_[_0x226b('0x46')](_0x3132af[_0x226b('0x42')],_0x3132af[_0x226b('0x43')]);_0x146944[_0x226b('0x47')]=_[_0x226b('0x46')](_0x3132af[_0x226b('0x42')],qs[_0x226b('0x48')](_0x332614[_0x226b('0x43')][_0x226b('0x48')]));_0x146944[_0x226b('0x47')]=_0x146944[_0x226b('0x47')][_0x226b('0x49')]?_0x146944[_0x226b('0x47')]:_0x3132af['model'];if(!_0x332614[_0x226b('0x43')][_0x226b('0x4a')](_0x226b('0x4b'))){_0x146944['limit']=qs['limit'](_0x332614[_0x226b('0x43')][_0x226b('0x2b')]);_0x146944[_0x226b('0x29')]=qs[_0x226b('0x29')](_0x332614[_0x226b('0x43')]['offset']);}_0x146944[_0x226b('0x4c')]=qs[_0x226b('0x4d')](_0x332614[_0x226b('0x43')][_0x226b('0x4d')]);_0x146944[_0x226b('0x4e')]=qs[_0x226b('0x45')](_[_0x226b('0x4f')](_0x332614[_0x226b('0x43')],_0x3132af[_0x226b('0x45')]),_0x300d92);if(_0x332614['query']['filter']){_0x146944[_0x226b('0x4e')]=_[_0x226b('0x50')](_0x146944['where'],{'$or':_[_0x226b('0x3d')](_0x300d92,function(_0x229cd8){if(_0x229cd8[_0x226b('0x40')]!==_0x226b('0x51')){var _0x210e32={};_0x210e32[_0x229cd8[_0x226b('0x38')]]={'$like':'%'+_0x332614['query']['filter']+'%'};return _0x210e32;}})});}_0x146944=_[_0x226b('0x50')]({},_0x146944,_0x332614[_0x226b('0x52')]);var _0x10d3db={'where':_0x146944[_0x226b('0x4e')]};return db[_0x226b('0x3e')]['count'](_0x10d3db)['then'](function(_0x5f431f){_0x1de9d7[_0x226b('0x2c')]=_0x5f431f;if(_0x332614[_0x226b('0x43')][_0x226b('0x53')]){_0x146944[_0x226b('0x54')]=[{'all':!![]}];}return db[_0x226b('0x3e')][_0x226b('0x55')](_0x146944);})['then'](function(_0x43458b){_0x1de9d7[_0x226b('0x56')]=_0x43458b;return _0x1de9d7;})[_0x226b('0x1d')](respondWithFilteredResult(_0x1a92fb,_0x146944))[_0x226b('0x25')](handleError(_0x1a92fb,null));};exports[_0x226b('0x57')]=function(_0x177367,_0x5e2b25){var _0x50e264={'raw':![],'where':{'id':_0x177367['params']['id']},'include':[{'model':db['Pause'],'as':_0x226b('0x3c')}]},_0x179101={};_0x179101[_0x226b('0x42')]=_['keys'](db[_0x226b('0x3e')][_0x226b('0x58')]);_0x179101[_0x226b('0x43')]=_[_0x226b('0x44')](_0x177367[_0x226b('0x43')]);_0x179101[_0x226b('0x45')]=_[_0x226b('0x46')](_0x179101['model'],_0x179101[_0x226b('0x43')]);_0x50e264['attributes']=_[_0x226b('0x46')](_0x179101[_0x226b('0x42')],qs[_0x226b('0x48')](_0x177367[_0x226b('0x43')]['fields']));_0x50e264[_0x226b('0x47')]=_0x50e264['attributes']['length']?_0x50e264[_0x226b('0x47')]:_0x179101[_0x226b('0x42')];if(_0x177367[_0x226b('0x43')][_0x226b('0x53')]){_0x50e264['include']=[{'all':!![]}];}_0x50e264=_[_0x226b('0x50')]({},_0x50e264,_0x177367[_0x226b('0x52')]);return db[_0x226b('0x3e')][_0x226b('0x59')](_0x50e264)[_0x226b('0x1d')](handleEntityNotFound(_0x5e2b25,null))['then'](respondWithResult(_0x5e2b25,null))[_0x226b('0x25')](handleError(_0x5e2b25,null));};exports['create']=function(_0x5a6300,_0x403862){return db[_0x226b('0x3e')]['create'](_0x5a6300['body'],{})[_0x226b('0x1d')](function(_0x40cee0){var _0xd49b26=_0x5a6300['user'][_0x226b('0x5a')]({'plain':!![]});if(!_0xd49b26)throw new Error(_0x226b('0x5b'));if(_0xd49b26[_0x226b('0x5c')]==='user'){var _0x18c4ea=_0x40cee0[_0x226b('0x5a')]({'plain':!![]});var _0x267f1d='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x267f1d,'userProfileId':_0xd49b26[_0x226b('0x5d')]},'raw':!![]})['then'](function(_0x15c3b9){if(_0x15c3b9&&_0x15c3b9[_0x226b('0x5e')]===0x0){return db[_0x226b('0x36')][_0x226b('0x5f')]({'name':_0x18c4ea[_0x226b('0x38')],'resourceId':_0x18c4ea['id'],'type':_0x15c3b9[_0x226b('0x38')],'sectionId':_0x15c3b9['id']},{})['then'](function(){return _0x40cee0;});}else{return _0x40cee0;}})[_0x226b('0x25')](function(_0x3d79cd){logger[_0x226b('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d79cd);throw _0x3d79cd;});}return _0x40cee0;})['then'](respondWithResult(_0x403862,0xc9))['catch'](handleError(_0x403862,null));};exports['update']=function(_0x29d8f9,_0x5e3299){if(_0x29d8f9['body']['id']){delete _0x29d8f9[_0x226b('0x60')]['id'];}return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x29d8f9[_0x226b('0x61')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x226b('0x1d')](handleEntityNotFound(_0x5e3299,null))[_0x226b('0x1d')](saveUpdates(_0x29d8f9[_0x226b('0x60')],null))['then'](respondWithResult(_0x5e3299,null))['catch'](handleError(_0x5e3299,null));};exports[_0x226b('0x34')]=function(_0x5ebe37,_0x10edb6){return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x5ebe37[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x10edb6,null))[_0x226b('0x1d')](removeEntity(_0x10edb6,null))[_0x226b('0x25')](handleError(_0x10edb6,null));};exports[_0x226b('0x62')]=function(_0x3acf1c,_0x2d0ef1){return db[_0x226b('0x3e')][_0x226b('0x62')]()[_0x226b('0x1d')](respondWithResult(_0x2d0ef1,null))[_0x226b('0x25')](handleError(_0x2d0ef1,null));};exports[_0x226b('0x63')]=function(_0x4f361f,_0x42967f,_0x5e13e9){if(_0x4f361f['body']['id']){delete _0x4f361f[_0x226b('0x60')]['id'];}return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x4f361f[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x42967f,null))[_0x226b('0x1d')](function(_0x24e1cb){if(_0x24e1cb){_0x4f361f[_0x226b('0x60')][_0x226b('0x64')]=_0x24e1cb['id'];return db[_0x226b('0x65')]['create'](_0x4f361f[_0x226b('0x60')]);}})[_0x226b('0x1d')](respondWithResult(_0x42967f,null))['catch'](handleError(_0x42967f,null));};exports[_0x226b('0x66')]=function(_0x159ef3,_0x2e5fdf,_0x337663){var _0x5da34d={'raw':![],'where':{}};var _0x396e1e={};var _0x4df97b={'count':0x0,'rows':[]};return db[_0x226b('0x3e')][_0x226b('0x67')]({'where':{'id':_0x159ef3[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x2e5fdf,null))[_0x226b('0x1d')](function(_0x336376){if(_0x336376){_0x396e1e[_0x226b('0x42')]=_[_0x226b('0x44')](db[_0x226b('0x65')][_0x226b('0x58')]);_0x396e1e[_0x226b('0x43')]=_['keys'](_0x159ef3['query']);_0x396e1e[_0x226b('0x45')]=_['intersection'](_0x396e1e[_0x226b('0x42')],_0x396e1e[_0x226b('0x43')]);_0x5da34d[_0x226b('0x47')]=_[_0x226b('0x46')](_0x396e1e[_0x226b('0x42')],qs['fields'](_0x159ef3[_0x226b('0x43')][_0x226b('0x48')]));_0x5da34d[_0x226b('0x47')]=_0x5da34d[_0x226b('0x47')][_0x226b('0x49')]?_0x5da34d['attributes']:_0x396e1e[_0x226b('0x42')];if(!_0x159ef3['query']['hasOwnProperty'](_0x226b('0x4b'))){_0x5da34d[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x159ef3[_0x226b('0x43')][_0x226b('0x2b')]);_0x5da34d[_0x226b('0x29')]=qs['offset'](_0x159ef3['query'][_0x226b('0x29')]);}_0x5da34d[_0x226b('0x4c')]=qs[_0x226b('0x4d')](_0x159ef3[_0x226b('0x43')][_0x226b('0x4d')]);_0x5da34d['where']=qs['filters'](_[_0x226b('0x4f')](_0x159ef3[_0x226b('0x43')],_0x396e1e['filters']));_0x5da34d[_0x226b('0x4e')]['OpenchannelAccountId']=_0x336376['id'];if(_0x159ef3[_0x226b('0x43')][_0x226b('0x68')]){_0x5da34d['where']=_[_0x226b('0x50')](_0x5da34d[_0x226b('0x4e')],{'$or':_[_0x226b('0x3d')](_0x5da34d[_0x226b('0x47')],function(_0x1c8098){var _0x587b6f={};_0x587b6f[_0x1c8098]={'$like':'%'+_0x159ef3[_0x226b('0x43')][_0x226b('0x68')]+'%'};return _0x587b6f;})});}_0x5da34d=_['merge']({},_0x5da34d,_0x159ef3['options']);return db[_0x226b('0x65')][_0x226b('0x2c')]({'where':_0x5da34d[_0x226b('0x4e')]})[_0x226b('0x1d')](function(_0x53d2ba){_0x4df97b[_0x226b('0x2c')]=_0x53d2ba;if(_0x159ef3[_0x226b('0x43')]['includeAll']){_0x5da34d['include']=[{'all':!![]}];}return db['Disposition'][_0x226b('0x55')](_0x5da34d);})[_0x226b('0x1d')](function(_0x2a71db){_0x4df97b[_0x226b('0x56')]=_0x2a71db;return _0x4df97b;});}})['then'](respondWithFilteredResult(_0x2e5fdf,_0x5da34d))[_0x226b('0x25')](handleError(_0x2e5fdf,null));};exports['removeDispositions']=function(_0x173162,_0x2eaed8,_0x31d5e8){return db[_0x226b('0x3e')]['find']({'where':{'id':_0x173162[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x2eaed8,null))[_0x226b('0x1d')](function(_0x3cf8eb){if(_0x3cf8eb){return _0x3cf8eb['removeDispositions'](_0x173162['query'][_0x226b('0x69')]);}})[_0x226b('0x1d')](respondWithStatusCode(_0x2eaed8,null))[_0x226b('0x25')](handleError(_0x2eaed8,null));};exports['addAnswer']=function(_0xd0a5cc,_0x4cc224,_0x3892e6){if(_0xd0a5cc[_0x226b('0x60')]['id']){delete _0xd0a5cc['body']['id'];}return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0xd0a5cc[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x4cc224,null))[_0x226b('0x1d')](function(_0x531905){if(_0x531905){_0xd0a5cc[_0x226b('0x60')][_0x226b('0x64')]=_0x531905['id'];return db[_0x226b('0x6a')][_0x226b('0x5f')](_0xd0a5cc[_0x226b('0x60')]);}})[_0x226b('0x1d')](respondWithResult(_0x4cc224,null))['catch'](handleError(_0x4cc224,null));};exports[_0x226b('0x6b')]=function(_0x4ce573,_0x2a8e16,_0x1ad7a4){var _0xa94d89={'raw':![],'where':{}};var _0x5cf25d={};var _0x3ca067={'count':0x0,'rows':[]};return db[_0x226b('0x3e')][_0x226b('0x67')]({'where':{'id':_0x4ce573['params']['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x2a8e16,null))['then'](function(_0x5d45a9){if(_0x5d45a9){_0x5cf25d[_0x226b('0x42')]=_[_0x226b('0x44')](db['CannedAnswer'][_0x226b('0x58')]);_0x5cf25d[_0x226b('0x43')]=_['keys'](_0x4ce573[_0x226b('0x43')]);_0x5cf25d[_0x226b('0x45')]=_['intersection'](_0x5cf25d[_0x226b('0x42')],_0x5cf25d[_0x226b('0x43')]);_0xa94d89['attributes']=_[_0x226b('0x46')](_0x5cf25d[_0x226b('0x42')],qs[_0x226b('0x48')](_0x4ce573['query'][_0x226b('0x48')]));_0xa94d89[_0x226b('0x47')]=_0xa94d89[_0x226b('0x47')][_0x226b('0x49')]?_0xa94d89[_0x226b('0x47')]:_0x5cf25d[_0x226b('0x42')];if(!_0x4ce573[_0x226b('0x43')][_0x226b('0x4a')]('nolimit')){_0xa94d89[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x4ce573['query'][_0x226b('0x2b')]);_0xa94d89[_0x226b('0x29')]=qs[_0x226b('0x29')](_0x4ce573[_0x226b('0x43')][_0x226b('0x29')]);}_0xa94d89[_0x226b('0x4c')]=qs[_0x226b('0x4d')](_0x4ce573[_0x226b('0x43')][_0x226b('0x4d')]);_0xa94d89[_0x226b('0x4e')]=qs[_0x226b('0x45')](_['pick'](_0x4ce573[_0x226b('0x43')],_0x5cf25d['filters']));_0xa94d89[_0x226b('0x4e')][_0x226b('0x64')]=_0x5d45a9['id'];if(_0x4ce573['query'][_0x226b('0x68')]){_0xa94d89[_0x226b('0x4e')]=_[_0x226b('0x50')](_0xa94d89['where'],{'$or':_[_0x226b('0x3d')](_0xa94d89[_0x226b('0x47')],function(_0x4d7191){var _0x430ad3={};_0x430ad3[_0x4d7191]={'$like':'%'+_0x4ce573[_0x226b('0x43')][_0x226b('0x68')]+'%'};return _0x430ad3;})});}_0xa94d89=_[_0x226b('0x50')]({},_0xa94d89,_0x4ce573[_0x226b('0x52')]);return db[_0x226b('0x6a')]['count']({'where':_0xa94d89[_0x226b('0x4e')]})[_0x226b('0x1d')](function(_0x527f0b){_0x3ca067[_0x226b('0x2c')]=_0x527f0b;if(_0x4ce573['query']['includeAll']){_0xa94d89[_0x226b('0x54')]=[{'all':!![]}];}return db[_0x226b('0x6a')][_0x226b('0x55')](_0xa94d89);})[_0x226b('0x1d')](function(_0x4010b8){_0x3ca067[_0x226b('0x56')]=_0x4010b8;return _0x3ca067;});}})[_0x226b('0x1d')](respondWithFilteredResult(_0x2a8e16,_0xa94d89))[_0x226b('0x25')](handleError(_0x2a8e16,null));};exports[_0x226b('0x6c')]=function(_0x318dff,_0x53f4be,_0x2206c4){return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x318dff[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x53f4be,null))[_0x226b('0x1d')](function(_0xa05ec0){if(_0xa05ec0){return _0xa05ec0['removeAnswers'](_0x318dff[_0x226b('0x43')]['ids']);}})[_0x226b('0x1d')](respondWithStatusCode(_0x53f4be,null))['catch'](handleError(_0x53f4be,null));};exports[_0x226b('0x6d')]=function(_0x3e3ca6,_0x6c2eb3,_0x429f05){var _0x485e56={'body':_0x3e3ca6[_0x226b('0x60')],'channel':_0x226b('0x6e')};var _0x30f33d=[];var _0xa4919=[];var _0x26dffb={};var _0x166d7c=![];return db['CmContact'][_0x226b('0x62')]()['then'](function(_0x894801){if(!_0x894801){throw new db['Sequelize'][(_0x226b('0x6f'))](_0x226b('0x70'));}_0x30f33d=_[_0x226b('0x71')](_[_0x226b('0x44')](_0x894801),[_0x226b('0x72'),'updatedAt']);_0xa4919=_[_0x226b('0x71')](_['keys'](_0x894801),[_0x226b('0x72'),_0x226b('0x73'),_0x226b('0x74'),_0x226b('0x75')]);if(_0x3e3ca6[_0x226b('0x60')]['id']){delete _0x3e3ca6[_0x226b('0x60')]['id'];}if(_[_0x226b('0x76')](_0x3e3ca6[_0x226b('0x60')][_0x226b('0x77')])){throw new db[(_0x226b('0x78'))][(_0x226b('0x6f'))](_0x226b('0x79'));}if(_[_0x226b('0x76')](_0x3e3ca6[_0x226b('0x60')][_0x226b('0x60')])||_0x3e3ca6[_0x226b('0x60')][_0x226b('0x60')]===''){throw new db[(_0x226b('0x78'))]['ValidationError'](_0x226b('0x7a'));}if(_[_0x226b('0x76')](_0x3e3ca6[_0x226b('0x60')][_0x226b('0x7b')])){throw new db[(_0x226b('0x78'))][(_0x226b('0x6f'))](_0x226b('0x7c')+_0xa4919);}if(!_['includes'](_0xa4919,_0x3e3ca6[_0x226b('0x60')][_0x226b('0x7b')])){throw new db[(_0x226b('0x78'))][(_0x226b('0x6f'))](_0x226b('0x7d')+_0xa4919);}_0x26dffb[_0x3e3ca6[_0x226b('0x60')][_0x226b('0x7b')]]=_0x3e3ca6[_0x226b('0x60')][_0x226b('0x77')];})['then'](function(){return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x3e3ca6['params']['id']},'include':[{'model':db[_0x226b('0x7e')],'as':_0x226b('0x7f'),'include':[{'model':db[_0x226b('0x80')],'as':_0x226b('0x81'),'where':_0x26dffb,'limit':0x1,'order':[[_0x226b('0x73'),_0x226b('0x82')]]}]},{'model':db[_0x226b('0x83')],'as':_0x226b('0x84')}]});})[_0x226b('0x1d')](handleEntityNotFound(_0x6c2eb3,null))['then'](function(_0x52739e){if(_0x52739e&&_0x52739e[_0x226b('0x7f')]){_0x485e56[_0x226b('0x85')]=_0x52739e;_0x485e56['applications']=_0x52739e['Applications'];_0x485e56[_0x226b('0x86')]=_0x52739e[_0x226b('0x7f')];_0x485e56[_0x226b('0x87')]=_['orderBy'](_0x485e56[_0x226b('0x87')],[_0x226b('0x88')],[_0x226b('0x89')]);if(_0x485e56[_0x226b('0x85')]['Applications']){delete _0x485e56[_0x226b('0x85')][_0x226b('0x84')];}if(_0x485e56[_0x226b('0x85')][_0x226b('0x7f')]&&_0x485e56[_0x226b('0x85')][_0x226b('0x7f')][_0x226b('0x81')][_0x226b('0x49')]){return _0x485e56[_0x226b('0x85')][_0x226b('0x7f')][_0x226b('0x81')][0x0];}var _0x2d3989=_[_0x226b('0x8a')](_0x3e3ca6['body'],{'firstName':_0x3e3ca6[_0x226b('0x60')][_0x226b('0x77')],'ListId':_0x52739e['ListId']});_0x2d3989[_0x3e3ca6[_0x226b('0x60')][_0x226b('0x7b')]]=_0x3e3ca6[_0x226b('0x60')][_0x226b('0x77')];return db[_0x226b('0x80')][_0x226b('0x5f')](_0x2d3989,{'fields':_0x30f33d,'raw':!![]});}})['then'](handleEntityNotFound(_0x6c2eb3,null))['then'](function(_0x3ad2ef){_0x485e56[_0x226b('0x8b')]=_0x3ad2ef;if(_0x3ad2ef){var _0x2cf9b9={'ContactId':_0x3ad2ef['id'],'OpenchannelAccountId':_0x3e3ca6[_0x226b('0x61')]['id'],'from':(_0x3ad2ef['firstName']||'')+'\x20'+(_0x3ad2ef[_0x226b('0x8c')]||'')};var _0x45457c={'OpenchannelAccountId':_0x3e3ca6['params']['id'],'closed':![]};if(_0x3e3ca6[_0x226b('0x60')][_0x226b('0x8d')]){_0x45457c[_0x226b('0x8d')]=_0x3e3ca6[_0x226b('0x60')][_0x226b('0x8d')];return db[_0x226b('0x8e')][_0x226b('0x59')]({'where':_0x45457c})[_0x226b('0x1d')](function(_0x467d3){if(_0x467d3){return[_0x467d3,![]];}_0x2cf9b9[_0x226b('0x8d')]=_0x3e3ca6[_0x226b('0x60')][_0x226b('0x8d')];_0x2cf9b9['externalUrl']=_0x3e3ca6[_0x226b('0x60')]['externalUrl'];return db['OpenchannelInteraction'][_0x226b('0x5f')](_0x2cf9b9)[_0x226b('0x1d')](function(_0x3ebc58){return[_0x3ebc58,!![]];});});}else{_0x45457c['threadId']=null;}_0x45457c[_0x226b('0x8f')]=_0x3ad2ef['id'];return db['OpenchannelInteraction']['find']({'where':_0x45457c})[_0x226b('0x1d')](function(_0x47e1d8){if(_0x47e1d8){return[_0x47e1d8,![]];}return db['OpenchannelInteraction'][_0x226b('0x5f')](_0x2cf9b9)[_0x226b('0x1d')](function(_0x5cfa69){return[_0x5cfa69,!![]];});});}})[_0x226b('0x90')](function(_0x3a54d1,_0x161b89){if(_0x3a54d1){_0x166d7c=_0x161b89;if(!_0x161b89){var _0x4160f2={'from':(_0x485e56[_0x226b('0x8b')][_0x226b('0x91')]||'')+'\x20'+(_0x485e56[_0x226b('0x8b')][_0x226b('0x8c')]||'')};if(_0x3e3ca6[_0x226b('0x60')][_0x226b('0x8d')]&&_0x3e3ca6[_0x226b('0x60')][_0x226b('0x92')]&&_0x3e3ca6[_0x226b('0x60')][_0x226b('0x8d')]!=_0x3e3ca6[_0x226b('0x60')]['messageId']){_0x4160f2[_0x226b('0x8d')]=_0x3e3ca6[_0x226b('0x60')][_0x226b('0x92')];}return _0x3a54d1['update'](_0x4160f2);}else{return _0x3a54d1;}}})[_0x226b('0x1d')](function(_0x385c21){_0x485e56[_0x226b('0x93')]=_0x385c21[_0x226b('0x5a')]({'plain':!![]});_0x485e56['interaction'][_0x226b('0x94')]=_0x166d7c;if(_0x485e56[_0x226b('0x93')][_0x226b('0x94')]){if(_0x485e56[_0x226b('0x85')][_0x226b('0x95')]){_0x485e56['applications'][_0x226b('0x96')]({'id':0x0,'priority':_0x485e56[_0x226b('0x87')]['length']+0x1,'app':_0x226b('0x97'),'appdata':_0x226b('0x98'),'interval':_0x226b('0x99')});}}return db[_0x226b('0x9a')][_0x226b('0x5f')]({'body':_0x3e3ca6[_0x226b('0x60')][_0x226b('0x60')],'OpenchannelAccountId':_0x3e3ca6[_0x226b('0x61')]['id'],'OpenchannelInteractionId':_0x385c21['id'],'direction':'in','ContactId':_0x485e56[_0x226b('0x8b')]['id'],'AttachmentId':_0x3e3ca6[_0x226b('0x60')][_0x226b('0x9b')]});})[_0x226b('0x1d')](function(_0x2267c9){_0x485e56[_0x226b('0x23')]=_0x2267c9;if(_0x485e56[_0x226b('0x93')][_0x226b('0x9c')]){return db[_0x226b('0x9d')][_0x226b('0x59')]({'attributes':['id',_0x226b('0x38')],'where':{'id':_0x485e56[_0x226b('0x93')][_0x226b('0x9c')]}})[_0x226b('0x1d')](function(_0xe2b550){if(_0xe2b550){_0x485e56[_0x226b('0x87')][_0x226b('0x9e')]({'id':0x0,'priority':0x0,'app':_0x226b('0x9f'),'appdata':_0xe2b550[_0x226b('0x38')]+','+(_0x485e56['account'][_0x226b('0xa0')]||0xa),'interval':_0x226b('0x99')});_0x485e56['forcedOwnership']=![];}return respondWithRpcPromise(_0x226b('0xa1'),_0x226b('0xa2'),_0x485e56);});}return respondWithRpcPromise(_0x226b('0xa1'),'startRouting',_0x485e56);})[_0x226b('0x1d')](function(_0x4bb435){respondWithRpcPromise('EventManager',_0x226b('0xa3'),{'event':'notify','message':_0x4bb435},client9002);return _0x4bb435;})[_0x226b('0x1d')](respondWithResult(_0x6c2eb3,null))[_0x226b('0x25')](handleError(_0x6c2eb3,null));};exports['addApplications']=function(_0x3541e6,_0x3882e7){var _0x5db31d=_0x3541e6[_0x226b('0x61')]['id'];var _0x332651=_0x3541e6[_0x226b('0x60')];var _0x32cde4=0xc8;var _0x5ac5e9=null;return db[_0x226b('0xa4')][_0x226b('0xa5')]({'isolationLevel':db[_0x226b('0xa4')][_0x226b('0xa6')][_0x226b('0xa7')]['READ_COMMITTED']},function(_0x29aae8){return db['OpenchannelAccount'][_0x226b('0x67')]({'where':{'id':_0x5db31d},'transaction':_0x29aae8})[_0x226b('0x1d')](function(_0x1ad22d){if(_0x1ad22d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x5db31d},'transaction':_0x29aae8})['then'](function(){var _0x3355cc=_[_0x226b('0x3d')](_0x332651,function(_0x47bcbd){_0x47bcbd[_0x226b('0x64')]=_0x5db31d;return _0x47bcbd;});return db[_0x226b('0x83')][_0x226b('0xa8')](_0x3355cc,{'transaction':_0x29aae8});});}else{_0x32cde4=0x194;_0x5ac5e9=[];}});})[_0x226b('0x1d')](function(){if(_0x32cde4!==0x194){return db[_0x226b('0x83')][_0x226b('0xa9')]({'where':{'OpenchannelAccountId':_0x5db31d},'order':'priority'})[_0x226b('0x1d')](function(_0x4448c0){_0x5ac5e9=_0x4448c0;});}})[_0x226b('0x25')](function(_0x414456){_0x32cde4=0x1f4;logger[_0x226b('0x20')](_0x414456[_0x226b('0x37')]);if(_0x414456[_0x226b('0x38')]){delete _0x414456[_0x226b('0x38')];}_0x5ac5e9=_0x414456;})[_0x226b('0xaa')](function(){if(_0x5ac5e9===null){_0x3882e7[_0x226b('0x26')](_0x32cde4);}else{if(_0x32cde4===0x1f4){_0x3882e7['status'](_0x32cde4)[_0x226b('0x39')](_0x5ac5e9);}else{_0x3882e7[_0x226b('0x28')](_0x32cde4)[_0x226b('0x2f')](_0x5ac5e9);}}});};exports[_0x226b('0xab')]=function(_0x2678d4,_0x4e7e1c,_0x16900b){var _0xc53704={};var _0x5e010d={};var _0x12a44c;var _0x5b7b2f;return db['OpenchannelAccount'][_0x226b('0x67')]({'where':{'id':_0x2678d4['params']['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x4e7e1c,null))[_0x226b('0x1d')](function(_0x270ab7){if(_0x270ab7){_0x12a44c=_0x270ab7;_0x5e010d['model']=_['keys'](db[_0x226b('0x83')]['rawAttributes']);_0x5e010d[_0x226b('0x43')]=_[_0x226b('0x44')](_0x2678d4[_0x226b('0x43')]);_0x5e010d[_0x226b('0x45')]=_[_0x226b('0x46')](_0x5e010d[_0x226b('0x42')],_0x5e010d[_0x226b('0x43')]);_0xc53704[_0x226b('0x47')]=_['intersection'](_0x5e010d['model'],qs[_0x226b('0x48')](_0x2678d4[_0x226b('0x43')][_0x226b('0x48')]));_0xc53704[_0x226b('0x47')]=_0xc53704[_0x226b('0x47')]['length']?_0xc53704[_0x226b('0x47')]:_0x5e010d[_0x226b('0x42')];_0xc53704[_0x226b('0x4c')]=qs[_0x226b('0x4d')](_0x2678d4[_0x226b('0x43')][_0x226b('0x4d')]);_0xc53704['where']=qs[_0x226b('0x45')](_['pick'](_0x2678d4[_0x226b('0x43')],_0x5e010d[_0x226b('0x45')]));if(_0x2678d4[_0x226b('0x43')]['filter']){_0xc53704[_0x226b('0x4e')]=_[_0x226b('0x50')](_0xc53704['where'],{'$or':_[_0x226b('0x3d')](_0xc53704[_0x226b('0x47')],function(_0x5cc42a){var _0x4570ca={};_0x4570ca[_0x5cc42a]={'$like':'%'+_0x2678d4[_0x226b('0x43')][_0x226b('0x68')]+'%'};return _0x4570ca;})});}_0xc53704=_[_0x226b('0x50')]({},_0xc53704,_0x2678d4[_0x226b('0x52')]);return _0x12a44c[_0x226b('0xab')](_0xc53704);}})[_0x226b('0x1d')](function(_0x4b9d43){if(_0x4b9d43){_0x5b7b2f=_0x4b9d43[_0x226b('0x49')];if(!_0x2678d4[_0x226b('0x43')][_0x226b('0x4a')]('nolimit')){_0xc53704['limit']=qs['limit'](_0x2678d4['query'][_0x226b('0x2b')]);_0xc53704[_0x226b('0x29')]=qs[_0x226b('0x29')](_0x2678d4[_0x226b('0x43')][_0x226b('0x29')]);}return _0x12a44c[_0x226b('0xab')](_0xc53704);}})[_0x226b('0x1d')](function(_0x15803b){if(_0x15803b){return _0x15803b?{'count':_0x5b7b2f,'rows':_0x15803b}:null;}})[_0x226b('0x1d')](respondWithResult(_0x4e7e1c,null))[_0x226b('0x25')](handleError(_0x4e7e1c,null));};exports['getInteractions']=function(_0x1cc3c6,_0x3fcdda,_0x14d4ba){var _0x353679={'raw':![],'where':{}};var _0x2c8bf4={};var _0x49cb0c={'count':0x0,'rows':[]};return db[_0x226b('0x3e')][_0x226b('0x67')]({'where':{'id':_0x1cc3c6[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x3fcdda,null))['then'](function(_0x5b0ae5){if(_0x5b0ae5){_0x2c8bf4[_0x226b('0x42')]=_[_0x226b('0x44')](db[_0x226b('0x8e')][_0x226b('0x58')]);_0x2c8bf4['query']=_[_0x226b('0x44')](_0x1cc3c6[_0x226b('0x43')]);_0x2c8bf4[_0x226b('0x45')]=_[_0x226b('0x46')](_0x2c8bf4['model'],_0x2c8bf4[_0x226b('0x43')]);_0x353679['attributes']=_[_0x226b('0x46')](_0x2c8bf4[_0x226b('0x42')],qs[_0x226b('0x48')](_0x1cc3c6[_0x226b('0x43')]['fields']));_0x353679[_0x226b('0x47')]=_0x353679[_0x226b('0x47')][_0x226b('0x49')]?_0x353679[_0x226b('0x47')]:_0x2c8bf4[_0x226b('0x42')];if(!_0x1cc3c6[_0x226b('0x43')][_0x226b('0x4a')](_0x226b('0x4b'))){_0x353679['limit']=qs[_0x226b('0x2b')](_0x1cc3c6[_0x226b('0x43')][_0x226b('0x2b')]);_0x353679['offset']=qs[_0x226b('0x29')](_0x1cc3c6['query']['offset']);}_0x353679['order']=qs[_0x226b('0x4d')](_0x1cc3c6[_0x226b('0x43')][_0x226b('0x4d')]);_0x353679[_0x226b('0x4e')]=qs[_0x226b('0x45')](_['pick'](_0x1cc3c6[_0x226b('0x43')],_0x2c8bf4[_0x226b('0x45')]));_0x353679[_0x226b('0x4e')]['OpenchannelAccountId']=_0x5b0ae5['id'];if(_0x1cc3c6[_0x226b('0x43')][_0x226b('0x68')]){_0x353679['where']=_[_0x226b('0x50')](_0x353679[_0x226b('0x4e')],{'$or':_['map'](_0x353679[_0x226b('0x47')],function(_0x3e23f1){var _0x53a9ef={};_0x53a9ef[_0x3e23f1]={'$like':'%'+_0x1cc3c6[_0x226b('0x43')]['filter']+'%'};return _0x53a9ef;})});}_0x353679=_[_0x226b('0x50')]({},_0x353679,_0x1cc3c6[_0x226b('0x52')]);return db[_0x226b('0x8e')]['count']({'where':_0x353679['where']})['then'](function(_0x5c8908){_0x49cb0c[_0x226b('0x2c')]=_0x5c8908;if(_0x1cc3c6[_0x226b('0x43')][_0x226b('0x53')]){_0x353679[_0x226b('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x226b('0xac'),'attributes':[_0x226b('0x38'),'fullname','internal'],'required':![]},{'model':db[_0x226b('0xad')],'as':'Tags','attributes':['id','name','color'],'where':_0x1cc3c6[_0x226b('0x43')]['tag']?{'id':_0x1cc3c6[_0x226b('0x43')]['tag']}:undefined,'required':_0x1cc3c6[_0x226b('0x43')][_0x226b('0xae')]?!![]:![]}];}return db[_0x226b('0x8e')][_0x226b('0x55')](_0x353679);})['then'](function(_0x869a4f){_0x49cb0c[_0x226b('0x56')]=_0x869a4f;return _0x49cb0c;});}})['then'](respondWithFilteredResult(_0x3fcdda,_0x353679))[_0x226b('0x25')](handleError(_0x3fcdda,null));};exports[_0x226b('0xaf')]=function(_0x470df9,_0x59a358,_0x58f242){return db['OpenchannelAccount'][_0x226b('0x59')]({'where':{'id':_0x470df9['params']['id']}})['then'](handleEntityNotFound(_0x59a358,null))[_0x226b('0x1d')](function(_0x31cdc7){if(_0x31cdc7){return _0x31cdc7['addAgents'](_0x470df9[_0x226b('0x60')]['ids'],_[_0x226b('0xb0')](_0x470df9[_0x226b('0x60')],[_0x226b('0x69'),'id'])||{})[_0x226b('0x90')](function(_0x194d15){for(var _0x30be58=0x0;_0x30be58<_0x470df9[_0x226b('0x60')][_0x226b('0x69')][_0x226b('0x49')];_0x30be58+=0x1){socket['emit'](_0x226b('0xb1'),{'UserId':Number(_0x470df9[_0x226b('0x60')][_0x226b('0x69')][_0x30be58]),'OpenchannelAccountId':Number(_0x470df9['params']['id'])});}return _0x194d15;});}})['then'](respondWithResult(_0x59a358,null))[_0x226b('0x25')](handleError(_0x59a358,null));};exports[_0x226b('0xb2')]=function(_0x592146,_0x4f09b7,_0x26572b){return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x592146['params']['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x4f09b7,null))[_0x226b('0x1d')](function(_0x487f75){if(_0x487f75){return _0x487f75[_0x226b('0xb2')](_0x592146['query'][_0x226b('0x69')])[_0x226b('0x1d')](function(){if(_[_0x226b('0xb3')](_0x592146[_0x226b('0x43')]['ids'])){for(var _0x495fb1=0x0;_0x495fb1<_0x592146['query'][_0x226b('0x69')][_0x226b('0x49')];_0x495fb1+=0x1){socket['emit'](_0x226b('0xb4'),{'UserId':Number(_0x592146[_0x226b('0x43')][_0x226b('0x69')][_0x495fb1]),'OpenchannelAccountId':Number(_0x592146[_0x226b('0x61')]['id'])});}}else{socket[_0x226b('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x592146[_0x226b('0x43')][_0x226b('0x69')]),'OpenchannelAccountId':Number(_0x592146[_0x226b('0x61')]['id'])});}});}})[_0x226b('0x1d')](respondWithStatusCode(_0x4f09b7,null))[_0x226b('0x25')](handleError(_0x4f09b7,null));};exports[_0x226b('0xb6')]=function(_0x171215,_0x5c3926,_0x146229){var _0x16bd44={};var _0x46cb87={};var _0x53d627;var _0x4f5fce;return db['OpenchannelAccount'][_0x226b('0x67')]({'where':{'id':_0x171215[_0x226b('0x61')]['id']}})['then'](handleEntityNotFound(_0x5c3926,null))[_0x226b('0x1d')](function(_0x39f659){if(_0x39f659){_0x53d627=_0x39f659;_0x46cb87[_0x226b('0x42')]=_['keys'](db[_0x226b('0x9d')]['rawAttributes']);_0x46cb87[_0x226b('0x43')]=_[_0x226b('0x44')](_0x171215[_0x226b('0x43')]);_0x46cb87['filters']=_[_0x226b('0x46')](_0x46cb87['model'],_0x46cb87[_0x226b('0x43')]);_0x16bd44['attributes']=_[_0x226b('0x46')](_0x46cb87[_0x226b('0x42')],qs[_0x226b('0x48')](_0x171215[_0x226b('0x43')]['fields']));_0x16bd44['attributes']=_0x16bd44['attributes'][_0x226b('0x49')]?_0x16bd44['attributes']:_0x46cb87[_0x226b('0x42')];_0x16bd44[_0x226b('0x4c')]=qs[_0x226b('0x4d')](_0x171215[_0x226b('0x43')][_0x226b('0x4d')]);_0x16bd44[_0x226b('0x4e')]=qs[_0x226b('0x45')](_[_0x226b('0x4f')](_0x171215[_0x226b('0x43')],_0x46cb87[_0x226b('0x45')]));if(_0x171215['query']['filter']){_0x16bd44['where']=_[_0x226b('0x50')](_0x16bd44[_0x226b('0x4e')],{'$or':_[_0x226b('0x3d')](_0x16bd44[_0x226b('0x47')],function(_0x4d3434){var _0x182c2d={};_0x182c2d[_0x4d3434]={'$like':'%'+_0x171215[_0x226b('0x43')]['filter']+'%'};return _0x182c2d;})});}_0x16bd44=_[_0x226b('0x50')]({},_0x16bd44,_0x171215[_0x226b('0x52')]);return _0x53d627[_0x226b('0xb6')](_0x16bd44);}})[_0x226b('0x1d')](function(_0xcae168){if(_0xcae168){_0x4f5fce=_0xcae168[_0x226b('0x49')];if(!_0x171215[_0x226b('0x43')][_0x226b('0x4a')](_0x226b('0x4b'))){_0x16bd44[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x171215['query'][_0x226b('0x2b')]);_0x16bd44[_0x226b('0x29')]=qs[_0x226b('0x29')](_0x171215['query'][_0x226b('0x29')]);}return _0x53d627[_0x226b('0xb6')](_0x16bd44);}})['then'](function(_0x3b3709){if(_0x3b3709){return _0x3b3709?{'count':_0x4f5fce,'rows':_0x3b3709}:null;}})[_0x226b('0x1d')](respondWithResult(_0x5c3926,null))[_0x226b('0x25')](handleError(_0x5c3926,null));};exports[_0x226b('0x39')]=function(_0xa1bc74,_0x465fc7,_0x82d9d6){var _0x2f962e,_0x58ed74,_0x10028e;if(_[_0x226b('0x76')](_0xa1bc74[_0x226b('0x60')]['body'])||_0xa1bc74['body'][_0x226b('0x60')]===''){throw new db[(_0x226b('0x78'))]['ValidationError'](_0x226b('0x7a'));}if(_[_0x226b('0x76')](_0xa1bc74[_0x226b('0x60')]['to'])){}_0x2f962e=_0xa1bc74['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0xa1bc74[_0x226b('0x61')]['id']}})[_0x226b('0x1d')](handleEntityNotFound(_0x465fc7,null))[_0x226b('0x1d')](function(_0x550dcb){if(_0x550dcb){return db[_0x226b('0x3e')][_0x226b('0x59')]({'where':{'id':_0x550dcb['id']},'include':[{'model':db[_0x226b('0x7e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x226b('0x81'),'where':{[_0x550dcb[_0x226b('0x7b')]]:_0x2f962e},'limit':0x1,'order':[[_0x226b('0x73'),_0x226b('0x82')]]}]}]})['then'](handleEntityNotFound(_0x465fc7,null))[_0x226b('0x1d')](function(_0x2bb03f){if(_0x2bb03f&&_0x2bb03f[_0x226b('0x7f')]){_0x58ed74=_0x2bb03f[_0x226b('0x5a')]({'plain':!![]});if(_0x58ed74[_0x226b('0x7f')]&&_0x58ed74[_0x226b('0x7f')][_0x226b('0x81')][_0x226b('0x49')]){return _0x58ed74['List']['Contacts'][0x0];}return db['CmContact'][_0x226b('0x5f')](_[_0x226b('0x8a')](_0xa1bc74[_0x226b('0x60')],{'firstName':_0x2f962e,[_0x2bb03f['mapKey']]:_0x2f962e,'phone':_0x2f962e,'ListId':_0x58ed74[_0x226b('0x75')]}));}})['then'](handleEntityNotFound(_0x465fc7,null))[_0x226b('0x1d')](function(_0x341d8d){if(_0x341d8d){_0x10028e=_0x341d8d;return db['OpenchannelInteraction'][_0x226b('0x59')]({'where':{'ContactId':_0x10028e['id'],'closed':![],'OpenchannelAccountId':_0x58ed74['id']}})[_0x226b('0x1d')](function(_0x1ce6d4){if(_0x1ce6d4){return[_0x1ce6d4,![]];}return db[_0x226b('0x8e')]['create']({'UserId':_0xa1bc74['user']['id'],'ContactId':_0x10028e['id'],'OpenchannelAccountId':_0x58ed74['id'],'lastMsgDirection':_0x226b('0xb7'),'Messages':[_[_0x226b('0x50')](_0xa1bc74[_0x226b('0x60')],{'read':![],'body':_0xa1bc74[_0x226b('0x60')][_0x226b('0x60')],'OpenchannelAccountId':_0x58ed74['id'],'UserId':_0xa1bc74[_0x226b('0xb8')]['id'],'ContactId':_0x10028e['id']})]},{'include':[{'model':db[_0x226b('0x9a')],'as':_0x226b('0xb9')}]})[_0x226b('0x1d')](function(_0x92129a){return[_0x92129a,!![]];});});}})[_0x226b('0x90')](function(_0x4422d3,_0x26a47d){if(_0x26a47d){return _0x4422d3;}return db[_0x226b('0x9a')][_0x226b('0x5f')](_[_0x226b('0x50')](_0xa1bc74[_0x226b('0x60')],{'read':![],'body':_0xa1bc74[_0x226b('0x60')][_0x226b('0x60')],'OpenchannelAccountId':_0x58ed74['id'],'OpenchannelInteractionId':_0x4422d3['id'],'UserId':_0xa1bc74[_0x226b('0xb8')]['id'],'ContactId':_0x10028e['id']}))[_0x226b('0x1d')](function(_0x450b5b){_0x4422d3[_0x226b('0xba')][_0x226b('0xb9')]=[];_0x4422d3[_0x226b('0xba')][_0x226b('0xb9')]['push'](_0x450b5b[_0x226b('0xba')]);return _0x4422d3;});});}})['then'](respondWithResult(_0x465fc7,null))['catch'](handleError(_0x465fc7,null));}; \ No newline at end of file +var _0xec64=['finally','sendStatus','json','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','ids','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','key','query','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','keys','rawAttributes','filters','intersection','create','body','user','role','UserProfileSection','autoAssociation','params','find','addDisposition','findOne','hasOwnProperty','order','pick','OpenchannelAccountId','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','include','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','Applications','list','orderBy','applications','priority','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xec64,0x19d));var _0x4ec6=function(_0x4d6ac0,_0x201628){_0x4d6ac0=_0x4d6ac0-0x0;var _0x5296c4=_0xec64[_0x4d6ac0];return _0x5296c4;};'use strict';var emlformat=require(_0x4ec6('0x0'));var rimraf=require(_0x4ec6('0x1'));var zipdir=require(_0x4ec6('0x2'));var jsonpatch=require(_0x4ec6('0x3'));var rp=require('request-promise');var moment=require(_0x4ec6('0x4'));var BPromise=require(_0x4ec6('0x5'));var Mustache=require(_0x4ec6('0x6'));var util=require('util');var path=require(_0x4ec6('0x7'));var sox=require(_0x4ec6('0x8'));var csv=require('to-csv');var ejs=require(_0x4ec6('0x9'));var fs=require('fs');var fs_extra=require(_0x4ec6('0xa'));var _=require(_0x4ec6('0xb'));var squel=require(_0x4ec6('0xc'));var crypto=require(_0x4ec6('0xd'));var jsforce=require(_0x4ec6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ec6('0xf'));var querystring=require(_0x4ec6('0x10'));var Papa=require(_0x4ec6('0x11'));var Redis=require(_0x4ec6('0x12'));var authService=require(_0x4ec6('0x13'));var qs=require(_0x4ec6('0x14'));var as=require(_0x4ec6('0x15'));var hardwareService=require(_0x4ec6('0x16'));var logger=require(_0x4ec6('0x17'))(_0x4ec6('0x18'));var utils=require(_0x4ec6('0x19'));var config=require(_0x4ec6('0x1a'));var licenseUtil=require(_0x4ec6('0x1b'));var db=require(_0x4ec6('0x1c'))['db'];config[_0x4ec6('0x1d')]=_[_0x4ec6('0x1e')](config['redis'],{'host':_0x4ec6('0x1f'),'port':0x18eb});var socket=require(_0x4ec6('0x20'))(new Redis(config[_0x4ec6('0x1d')]));require(_0x4ec6('0x21'))['register'](socket);var jayson=require(_0x4ec6('0x22'));var client=jayson['client'][_0x4ec6('0x23')]({'port':0x232c});var client9002=jayson[_0x4ec6('0x24')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31c908,_0x407105,_0x2a4468,_0x50215c){return new BPromise(function(_0x9cd8a,_0x539fcb){var _0x4165a5=_0x50215c||client;return _0x4165a5[_0x4ec6('0x25')](_0x31c908,_0x2a4468)[_0x4ec6('0x26')](function(_0x4d315a){logger[_0x4ec6('0x27')](_0x4ec6('0x28'),_0x407105,_0x4ec6('0x29'));logger[_0x4ec6('0x2a')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x407105,_0x4ec6('0x29'),JSON['stringify'](_0x4d315a));if(_0x4d315a[_0x4ec6('0x2b')]){if(_0x4d315a[_0x4ec6('0x2b')][_0x4ec6('0x2c')]===0x1f4){logger[_0x4ec6('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x407105,_0x4d315a['error'][_0x4ec6('0x2d')]);return _0x539fcb(_0x4d315a['error'][_0x4ec6('0x2d')]);}logger['error'](_0x4ec6('0x28'),_0x407105,_0x4d315a['error'][_0x4ec6('0x2d')]);return _0x9cd8a(_0x4d315a[_0x4ec6('0x2b')][_0x4ec6('0x2d')]);}else{logger[_0x4ec6('0x27')](_0x4ec6('0x28'),_0x407105,'request\x20sent');_0x9cd8a(_0x4d315a[_0x4ec6('0x2e')][_0x4ec6('0x2d')]);}})[_0x4ec6('0x2f')](function(_0x596795){logger['error'](_0x4ec6('0x28'),_0x407105,_0x596795);_0x539fcb(_0x596795);});});}function respondWithStatusCode(_0x26be16,_0x473f6a){_0x473f6a=_0x473f6a||0xcc;return function(_0x1db969){if(_0x1db969){return _0x26be16['sendStatus'](_0x473f6a);}return _0x26be16[_0x4ec6('0x30')](_0x473f6a)['end']();};}function respondWithResult(_0x156134,_0x3b7983){_0x3b7983=_0x3b7983||0xc8;return function(_0x227f97){if(_0x227f97){return _0x156134[_0x4ec6('0x30')](_0x3b7983)['json'](_0x227f97);}};}function respondWithFilteredResult(_0x3c8377,_0x5096c1){return function(_0x4fc68a){if(_0x4fc68a){var _0x4c19be=typeof _0x5096c1[_0x4ec6('0x31')]==='undefined'&&typeof _0x5096c1[_0x4ec6('0x32')]===_0x4ec6('0x33');var _0x13032d=_0x4fc68a[_0x4ec6('0x34')];var _0x2332b6=_0x4c19be?0x0:_0x5096c1[_0x4ec6('0x31')];var _0x2b6472=_0x4c19be?_0x4fc68a['count']:_0x5096c1[_0x4ec6('0x31')]+_0x5096c1[_0x4ec6('0x32')];var _0x1f7968;if(_0x2b6472>=_0x13032d){_0x2b6472=_0x13032d;_0x1f7968=0xc8;}else{_0x1f7968=0xce;}_0x3c8377[_0x4ec6('0x30')](_0x1f7968);return _0x3c8377[_0x4ec6('0x35')](_0x4ec6('0x36'),_0x2332b6+'-'+_0x2b6472+'/'+_0x13032d)['json'](_0x4fc68a);}return null;};}function patchUpdates(_0x17b6e2){return function(_0x47b3e7){try{jsonpatch[_0x4ec6('0x37')](_0x47b3e7,_0x17b6e2,!![]);}catch(_0x4aaaf0){return BPromise[_0x4ec6('0x38')](_0x4aaaf0);}return _0x47b3e7[_0x4ec6('0x39')]();};}function saveUpdates(_0x5d5f3c,_0x3b55d8){return function(_0x45ccac){if(_0x45ccac){return _0x45ccac[_0x4ec6('0x3a')](_0x5d5f3c)[_0x4ec6('0x26')](function(_0x2040a6){return _0x2040a6;});}return null;};}function removeEntity(_0xb98d20,_0x54ba55){return function(_0x15fc29){if(_0x15fc29){return _0x15fc29[_0x4ec6('0x3b')]()[_0x4ec6('0x26')](function(){var _0x456b99=_0x15fc29[_0x4ec6('0x3c')]({'plain':!![]});var _0x13079e=_0x4ec6('0x3d');return db[_0x4ec6('0x3e')][_0x4ec6('0x3b')]({'where':{'type':_0x13079e,'resourceId':_0x456b99['id']}})[_0x4ec6('0x26')](function(){return _0x15fc29;});})[_0x4ec6('0x26')](function(){_0xb98d20[_0x4ec6('0x30')](0xcc)[_0x4ec6('0x3f')]();});}};}function handleEntityNotFound(_0x2cf21b,_0x15721c){return function(_0x27b839){if(!_0x27b839){_0x2cf21b['sendStatus'](0x194);}return _0x27b839;};}function handleError(_0x38f53b,_0x1c0ab9){_0x1c0ab9=_0x1c0ab9||0x1f4;return function(_0x59ea4a){logger['error'](_0x59ea4a[_0x4ec6('0x40')]);if(_0x59ea4a[_0x4ec6('0x41')]){delete _0x59ea4a['name'];}_0x38f53b['status'](_0x1c0ab9)[_0x4ec6('0x42')](_0x59ea4a);};}exports[_0x4ec6('0x43')]=function(_0x5020cd,_0xf25c99){var _0x106302={'include':[{'model':db[_0x4ec6('0x44')],'as':_0x4ec6('0x45')}]},_0x3c9d89={},_0x20df0c={'count':0x0,'rows':[]};var _0xf2b2c5=_[_0x4ec6('0x46')](db[_0x4ec6('0x47')]['rawAttributes'],function(_0x4a7a6d){return{'name':_0x4a7a6d[_0x4ec6('0x48')],'type':_0x4a7a6d['type'][_0x4ec6('0x49')]};});_0x3c9d89['model']=_[_0x4ec6('0x46')](_0xf2b2c5,_0x4ec6('0x41'));_0x3c9d89[_0x4ec6('0x4a')]=_['keys'](_0x5020cd[_0x4ec6('0x4a')]);_0x3c9d89['filters']=_['intersection'](_0x3c9d89[_0x4ec6('0x4b')],_0x3c9d89[_0x4ec6('0x4a')]);_0x106302[_0x4ec6('0x4c')]=_['intersection'](_0x3c9d89[_0x4ec6('0x4b')],qs['fields'](_0x5020cd[_0x4ec6('0x4a')][_0x4ec6('0x4d')]));_0x106302[_0x4ec6('0x4c')]=_0x106302[_0x4ec6('0x4c')][_0x4ec6('0x4e')]?_0x106302[_0x4ec6('0x4c')]:_0x3c9d89[_0x4ec6('0x4b')];if(!_0x5020cd[_0x4ec6('0x4a')]['hasOwnProperty']('nolimit')){_0x106302[_0x4ec6('0x32')]=qs[_0x4ec6('0x32')](_0x5020cd[_0x4ec6('0x4a')][_0x4ec6('0x32')]);_0x106302['offset']=qs[_0x4ec6('0x31')](_0x5020cd[_0x4ec6('0x4a')][_0x4ec6('0x31')]);}_0x106302['order']=qs['sort'](_0x5020cd['query'][_0x4ec6('0x4f')]);_0x106302[_0x4ec6('0x50')]=qs['filters'](_['pick'](_0x5020cd[_0x4ec6('0x4a')],_0x3c9d89['filters']),_0xf2b2c5);if(_0x5020cd[_0x4ec6('0x4a')][_0x4ec6('0x51')]){_0x106302['where']=_[_0x4ec6('0x52')](_0x106302['where'],{'$or':_[_0x4ec6('0x46')](_0xf2b2c5,function(_0x58856e){if(_0x58856e[_0x4ec6('0x53')]!==_0x4ec6('0x54')){var _0x2c4cc6={};_0x2c4cc6[_0x58856e[_0x4ec6('0x41')]]={'$like':'%'+_0x5020cd['query']['filter']+'%'};return _0x2c4cc6;}})});}_0x106302=_[_0x4ec6('0x52')]({},_0x106302,_0x5020cd[_0x4ec6('0x55')]);var _0x50c4fc={'where':_0x106302[_0x4ec6('0x50')]};return db['OpenchannelAccount'][_0x4ec6('0x34')](_0x50c4fc)[_0x4ec6('0x26')](function(_0x138994){_0x20df0c['count']=_0x138994;if(_0x5020cd[_0x4ec6('0x4a')][_0x4ec6('0x56')]){_0x106302['include']=[{'all':!![]}];}return db[_0x4ec6('0x47')][_0x4ec6('0x57')](_0x106302);})[_0x4ec6('0x26')](function(_0x44d905){_0x20df0c[_0x4ec6('0x58')]=_0x44d905;return _0x20df0c;})[_0x4ec6('0x26')](respondWithFilteredResult(_0xf25c99,_0x106302))[_0x4ec6('0x2f')](handleError(_0xf25c99,null));};exports[_0x4ec6('0x59')]=function(_0x47b02b,_0x18e200){var _0x47ae1a={'raw':![],'where':{'id':_0x47b02b['params']['id']},'include':[{'model':db['Pause'],'as':_0x4ec6('0x45')}]},_0x2f70cb={};_0x2f70cb[_0x4ec6('0x4b')]=_[_0x4ec6('0x5a')](db[_0x4ec6('0x47')][_0x4ec6('0x5b')]);_0x2f70cb['query']=_['keys'](_0x47b02b['query']);_0x2f70cb[_0x4ec6('0x5c')]=_['intersection'](_0x2f70cb[_0x4ec6('0x4b')],_0x2f70cb[_0x4ec6('0x4a')]);_0x47ae1a[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x2f70cb[_0x4ec6('0x4b')],qs[_0x4ec6('0x4d')](_0x47b02b[_0x4ec6('0x4a')][_0x4ec6('0x4d')]));_0x47ae1a[_0x4ec6('0x4c')]=_0x47ae1a[_0x4ec6('0x4c')]['length']?_0x47ae1a[_0x4ec6('0x4c')]:_0x2f70cb[_0x4ec6('0x4b')];if(_0x47b02b[_0x4ec6('0x4a')][_0x4ec6('0x56')]){_0x47ae1a['include']=[{'all':!![]}];}_0x47ae1a=_[_0x4ec6('0x52')]({},_0x47ae1a,_0x47b02b[_0x4ec6('0x55')]);return db[_0x4ec6('0x47')]['find'](_0x47ae1a)['then'](handleEntityNotFound(_0x18e200,null))[_0x4ec6('0x26')](respondWithResult(_0x18e200,null))[_0x4ec6('0x2f')](handleError(_0x18e200,null));};exports[_0x4ec6('0x5e')]=function(_0x5c1960,_0x44f6ae){return db['OpenchannelAccount'][_0x4ec6('0x5e')](_0x5c1960[_0x4ec6('0x5f')],{})[_0x4ec6('0x26')](function(_0x12c47a){var _0x1e4c66=_0x5c1960[_0x4ec6('0x60')][_0x4ec6('0x3c')]({'plain':!![]});if(!_0x1e4c66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e4c66[_0x4ec6('0x61')]===_0x4ec6('0x60')){var _0x458154=_0x12c47a[_0x4ec6('0x3c')]({'plain':!![]});var _0x837a4e=_0x4ec6('0x3d');return db[_0x4ec6('0x62')]['find']({'where':{'name':_0x837a4e,'userProfileId':_0x1e4c66['userProfileId']},'raw':!![]})[_0x4ec6('0x26')](function(_0x44f148){if(_0x44f148&&_0x44f148[_0x4ec6('0x63')]===0x0){return db['UserProfileResource'][_0x4ec6('0x5e')]({'name':_0x458154[_0x4ec6('0x41')],'resourceId':_0x458154['id'],'type':_0x44f148['name'],'sectionId':_0x44f148['id']},{})[_0x4ec6('0x26')](function(){return _0x12c47a;});}else{return _0x12c47a;}})[_0x4ec6('0x2f')](function(_0x3d48b3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d48b3);throw _0x3d48b3;});}return _0x12c47a;})['then'](respondWithResult(_0x44f6ae,0xc9))[_0x4ec6('0x2f')](handleError(_0x44f6ae,null));};exports[_0x4ec6('0x3a')]=function(_0x492bb4,_0x338c0b){if(_0x492bb4[_0x4ec6('0x5f')]['id']){delete _0x492bb4[_0x4ec6('0x5f')]['id'];}return db[_0x4ec6('0x47')]['find']({'where':{'id':_0x492bb4[_0x4ec6('0x64')]['id']},'include':[{'model':db[_0x4ec6('0x44')],'as':_0x4ec6('0x45')}]})[_0x4ec6('0x26')](handleEntityNotFound(_0x338c0b,null))['then'](saveUpdates(_0x492bb4[_0x4ec6('0x5f')],null))[_0x4ec6('0x26')](respondWithResult(_0x338c0b,null))[_0x4ec6('0x2f')](handleError(_0x338c0b,null));};exports['destroy']=function(_0x33be40,_0x4ab907){return db['OpenchannelAccount'][_0x4ec6('0x65')]({'where':{'id':_0x33be40['params']['id']}})['then'](handleEntityNotFound(_0x4ab907,null))[_0x4ec6('0x26')](removeEntity(_0x4ab907,null))['catch'](handleError(_0x4ab907,null));};exports['describe']=function(_0x264d57,_0x249b16){return db[_0x4ec6('0x47')]['describe']()[_0x4ec6('0x26')](respondWithResult(_0x249b16,null))[_0x4ec6('0x2f')](handleError(_0x249b16,null));};exports[_0x4ec6('0x66')]=function(_0x57939c,_0x184497,_0x29cd22){if(_0x57939c[_0x4ec6('0x5f')]['id']){delete _0x57939c[_0x4ec6('0x5f')]['id'];}return db['OpenchannelAccount'][_0x4ec6('0x65')]({'where':{'id':_0x57939c[_0x4ec6('0x64')]['id']}})['then'](handleEntityNotFound(_0x184497,null))[_0x4ec6('0x26')](function(_0x4431b1){if(_0x4431b1){_0x57939c[_0x4ec6('0x5f')]['OpenchannelAccountId']=_0x4431b1['id'];return db['Disposition']['create'](_0x57939c[_0x4ec6('0x5f')]);}})[_0x4ec6('0x26')](respondWithResult(_0x184497,null))[_0x4ec6('0x2f')](handleError(_0x184497,null));};exports['getDispositions']=function(_0x4e02be,_0x56c24f,_0x3128e0){var _0x5387c3={'raw':![],'where':{}};var _0x1c235e={};var _0x3548fa={'count':0x0,'rows':[]};return db[_0x4ec6('0x47')][_0x4ec6('0x67')]({'where':{'id':_0x4e02be[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x56c24f,null))['then'](function(_0x1219fa){if(_0x1219fa){_0x1c235e['model']=_['keys'](db['Disposition'][_0x4ec6('0x5b')]);_0x1c235e[_0x4ec6('0x4a')]=_[_0x4ec6('0x5a')](_0x4e02be['query']);_0x1c235e[_0x4ec6('0x5c')]=_['intersection'](_0x1c235e[_0x4ec6('0x4b')],_0x1c235e[_0x4ec6('0x4a')]);_0x5387c3[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x1c235e[_0x4ec6('0x4b')],qs[_0x4ec6('0x4d')](_0x4e02be[_0x4ec6('0x4a')]['fields']));_0x5387c3['attributes']=_0x5387c3[_0x4ec6('0x4c')][_0x4ec6('0x4e')]?_0x5387c3['attributes']:_0x1c235e['model'];if(!_0x4e02be[_0x4ec6('0x4a')][_0x4ec6('0x68')]('nolimit')){_0x5387c3[_0x4ec6('0x32')]=qs[_0x4ec6('0x32')](_0x4e02be[_0x4ec6('0x4a')]['limit']);_0x5387c3[_0x4ec6('0x31')]=qs[_0x4ec6('0x31')](_0x4e02be[_0x4ec6('0x4a')]['offset']);}_0x5387c3[_0x4ec6('0x69')]=qs[_0x4ec6('0x4f')](_0x4e02be[_0x4ec6('0x4a')][_0x4ec6('0x4f')]);_0x5387c3[_0x4ec6('0x50')]=qs[_0x4ec6('0x5c')](_[_0x4ec6('0x6a')](_0x4e02be[_0x4ec6('0x4a')],_0x1c235e['filters']));_0x5387c3[_0x4ec6('0x50')][_0x4ec6('0x6b')]=_0x1219fa['id'];if(_0x4e02be['query'][_0x4ec6('0x51')]){_0x5387c3[_0x4ec6('0x50')]=_[_0x4ec6('0x52')](_0x5387c3[_0x4ec6('0x50')],{'$or':_['map'](_0x5387c3[_0x4ec6('0x4c')],function(_0x54b829){var _0x54ab86={};_0x54ab86[_0x54b829]={'$like':'%'+_0x4e02be[_0x4ec6('0x4a')][_0x4ec6('0x51')]+'%'};return _0x54ab86;})});}_0x5387c3=_[_0x4ec6('0x52')]({},_0x5387c3,_0x4e02be[_0x4ec6('0x55')]);return db[_0x4ec6('0x6c')][_0x4ec6('0x34')]({'where':_0x5387c3[_0x4ec6('0x50')]})[_0x4ec6('0x26')](function(_0x5df9c3){_0x3548fa[_0x4ec6('0x34')]=_0x5df9c3;if(_0x4e02be[_0x4ec6('0x4a')][_0x4ec6('0x56')]){_0x5387c3['include']=[{'all':!![]}];}return db[_0x4ec6('0x6c')][_0x4ec6('0x57')](_0x5387c3);})[_0x4ec6('0x26')](function(_0x569e64){_0x3548fa[_0x4ec6('0x58')]=_0x569e64;return _0x3548fa;});}})[_0x4ec6('0x26')](respondWithFilteredResult(_0x56c24f,_0x5387c3))[_0x4ec6('0x2f')](handleError(_0x56c24f,null));};exports[_0x4ec6('0x6d')]=function(_0x134b4d,_0x42b71f,_0x424e67){return db[_0x4ec6('0x47')][_0x4ec6('0x65')]({'where':{'id':_0x134b4d[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x42b71f,null))['then'](function(_0x3731a4){if(_0x3731a4){return _0x3731a4[_0x4ec6('0x6d')](_0x134b4d[_0x4ec6('0x4a')]['ids']);}})[_0x4ec6('0x26')](respondWithStatusCode(_0x42b71f,null))[_0x4ec6('0x2f')](handleError(_0x42b71f,null));};exports[_0x4ec6('0x6e')]=function(_0x808e07,_0x459a60,_0x3f8513){if(_0x808e07['body']['id']){delete _0x808e07[_0x4ec6('0x5f')]['id'];}return db[_0x4ec6('0x47')]['find']({'where':{'id':_0x808e07[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x459a60,null))[_0x4ec6('0x26')](function(_0x470bae){if(_0x470bae){_0x808e07[_0x4ec6('0x5f')][_0x4ec6('0x6b')]=_0x470bae['id'];return db[_0x4ec6('0x6f')][_0x4ec6('0x5e')](_0x808e07[_0x4ec6('0x5f')]);}})['then'](respondWithResult(_0x459a60,null))[_0x4ec6('0x2f')](handleError(_0x459a60,null));};exports[_0x4ec6('0x70')]=function(_0x2682e7,_0x2289e8,_0x5761c2){var _0x55a83c={'raw':![],'where':{}};var _0x4ac7f0={};var _0x16a58e={'count':0x0,'rows':[]};return db[_0x4ec6('0x47')][_0x4ec6('0x67')]({'where':{'id':_0x2682e7[_0x4ec6('0x64')]['id']}})['then'](handleEntityNotFound(_0x2289e8,null))[_0x4ec6('0x26')](function(_0x38714c){if(_0x38714c){_0x4ac7f0[_0x4ec6('0x4b')]=_[_0x4ec6('0x5a')](db[_0x4ec6('0x6f')]['rawAttributes']);_0x4ac7f0['query']=_[_0x4ec6('0x5a')](_0x2682e7[_0x4ec6('0x4a')]);_0x4ac7f0['filters']=_[_0x4ec6('0x5d')](_0x4ac7f0[_0x4ec6('0x4b')],_0x4ac7f0[_0x4ec6('0x4a')]);_0x55a83c[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x4ac7f0['model'],qs[_0x4ec6('0x4d')](_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x4d')]));_0x55a83c[_0x4ec6('0x4c')]=_0x55a83c['attributes'][_0x4ec6('0x4e')]?_0x55a83c[_0x4ec6('0x4c')]:_0x4ac7f0['model'];if(!_0x2682e7[_0x4ec6('0x4a')]['hasOwnProperty'](_0x4ec6('0x71'))){_0x55a83c[_0x4ec6('0x32')]=qs[_0x4ec6('0x32')](_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x32')]);_0x55a83c[_0x4ec6('0x31')]=qs[_0x4ec6('0x31')](_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x31')]);}_0x55a83c[_0x4ec6('0x69')]=qs['sort'](_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x4f')]);_0x55a83c[_0x4ec6('0x50')]=qs[_0x4ec6('0x5c')](_['pick'](_0x2682e7['query'],_0x4ac7f0[_0x4ec6('0x5c')]));_0x55a83c['where'][_0x4ec6('0x6b')]=_0x38714c['id'];if(_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x51')]){_0x55a83c[_0x4ec6('0x50')]=_[_0x4ec6('0x52')](_0x55a83c[_0x4ec6('0x50')],{'$or':_['map'](_0x55a83c['attributes'],function(_0x17b08d){var _0xab96fc={};_0xab96fc[_0x17b08d]={'$like':'%'+_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x51')]+'%'};return _0xab96fc;})});}_0x55a83c=_[_0x4ec6('0x52')]({},_0x55a83c,_0x2682e7[_0x4ec6('0x55')]);return db[_0x4ec6('0x6f')][_0x4ec6('0x34')]({'where':_0x55a83c[_0x4ec6('0x50')]})['then'](function(_0x155a18){_0x16a58e['count']=_0x155a18;if(_0x2682e7[_0x4ec6('0x4a')][_0x4ec6('0x56')]){_0x55a83c[_0x4ec6('0x72')]=[{'all':!![]}];}return db[_0x4ec6('0x6f')][_0x4ec6('0x57')](_0x55a83c);})[_0x4ec6('0x26')](function(_0x2b8874){_0x16a58e[_0x4ec6('0x58')]=_0x2b8874;return _0x16a58e;});}})['then'](respondWithFilteredResult(_0x2289e8,_0x55a83c))[_0x4ec6('0x2f')](handleError(_0x2289e8,null));};exports['removeAnswers']=function(_0x9874b,_0x2a034d,_0x221a43){return db[_0x4ec6('0x47')][_0x4ec6('0x65')]({'where':{'id':_0x9874b['params']['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x2a034d,null))[_0x4ec6('0x26')](function(_0x4bb64a){if(_0x4bb64a){return _0x4bb64a[_0x4ec6('0x73')](_0x9874b['query']['ids']);}})['then'](respondWithStatusCode(_0x2a034d,null))[_0x4ec6('0x2f')](handleError(_0x2a034d,null));};exports[_0x4ec6('0x74')]=function(_0x1ed077,_0xf0814,_0x4b43b0){var _0x236a4f={'body':_0x1ed077[_0x4ec6('0x5f')],'channel':_0x4ec6('0x75')};var _0x54c98f=[];var _0x1cff63=[];var _0x547b72={};var _0x505623=![];return db[_0x4ec6('0x76')]['describe']()[_0x4ec6('0x26')](function(_0x48a954){if(!_0x48a954){throw new db[(_0x4ec6('0x77'))][(_0x4ec6('0x78'))](_0x4ec6('0x79'));}_0x54c98f=_[_0x4ec6('0x7a')](_['keys'](_0x48a954),['createdAt',_0x4ec6('0x7b')]);_0x1cff63=_['difference'](_[_0x4ec6('0x5a')](_0x48a954),['createdAt',_0x4ec6('0x7b'),'CompanyId','ListId']);if(_0x1ed077[_0x4ec6('0x5f')]['id']){delete _0x1ed077[_0x4ec6('0x5f')]['id'];}if(_[_0x4ec6('0x7c')](_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7d')])){throw new db['Sequelize'][(_0x4ec6('0x78'))]('from\x20is\x20mandatory');}if(_[_0x4ec6('0x7c')](_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x5f')])||_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x5f')]===''){throw new db[(_0x4ec6('0x77'))][(_0x4ec6('0x78'))](_0x4ec6('0x7e'));}if(_['isNil'](_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7f')])){throw new db[(_0x4ec6('0x77'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1cff63);}if(!_[_0x4ec6('0x80')](_0x1cff63,_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7f')])){throw new db[(_0x4ec6('0x77'))][(_0x4ec6('0x78'))](_0x4ec6('0x81')+_0x1cff63);}_0x547b72[_0x1ed077[_0x4ec6('0x5f')]['mapKey']]=_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7d')];})[_0x4ec6('0x26')](function(){return db[_0x4ec6('0x47')][_0x4ec6('0x65')]({'where':{'id':_0x1ed077['params']['id']},'include':[{'model':db[_0x4ec6('0x82')],'as':_0x4ec6('0x83'),'include':[{'model':db[_0x4ec6('0x76')],'as':_0x4ec6('0x84'),'where':_0x547b72,'limit':0x1,'order':[[_0x4ec6('0x7b'),_0x4ec6('0x85')]]}]},{'model':db[_0x4ec6('0x86')],'as':'Applications'}]});})[_0x4ec6('0x26')](handleEntityNotFound(_0xf0814,null))['then'](function(_0x4549c4){if(_0x4549c4&&_0x4549c4['List']){_0x236a4f[_0x4ec6('0x87')]=_0x4549c4;_0x236a4f['applications']=_0x4549c4[_0x4ec6('0x88')];_0x236a4f[_0x4ec6('0x89')]=_0x4549c4[_0x4ec6('0x83')];_0x236a4f['applications']=_[_0x4ec6('0x8a')](_0x236a4f[_0x4ec6('0x8b')],[_0x4ec6('0x8c')],[_0x4ec6('0x8d')]);if(_0x236a4f[_0x4ec6('0x87')]['Applications']){delete _0x236a4f[_0x4ec6('0x87')][_0x4ec6('0x88')];}if(_0x236a4f[_0x4ec6('0x87')][_0x4ec6('0x83')]&&_0x236a4f[_0x4ec6('0x87')]['List'][_0x4ec6('0x84')][_0x4ec6('0x4e')]){return _0x236a4f[_0x4ec6('0x87')][_0x4ec6('0x83')][_0x4ec6('0x84')][0x0];}var _0x99bf1=_[_0x4ec6('0x1e')](_0x1ed077[_0x4ec6('0x5f')],{'firstName':_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7d')],'ListId':_0x4549c4[_0x4ec6('0x8e')]});_0x99bf1[_0x1ed077['body'][_0x4ec6('0x7f')]]=_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x7d')];return db[_0x4ec6('0x76')]['create'](_0x99bf1,{'fields':_0x54c98f,'raw':!![]});}})[_0x4ec6('0x26')](handleEntityNotFound(_0xf0814,null))[_0x4ec6('0x26')](function(_0x20ab67){_0x236a4f[_0x4ec6('0x8f')]=_0x20ab67;if(_0x20ab67){var _0x3d5e9e={'ContactId':_0x20ab67['id'],'OpenchannelAccountId':_0x1ed077['params']['id'],'from':(_0x20ab67[_0x4ec6('0x90')]||'')+'\x20'+(_0x20ab67[_0x4ec6('0x91')]||'')};var _0x28d217={'OpenchannelAccountId':_0x1ed077[_0x4ec6('0x64')]['id'],'closed':![]};if(_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x92')]){_0x28d217['threadId']=_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x92')];return db[_0x4ec6('0x93')][_0x4ec6('0x65')]({'where':_0x28d217})['then'](function(_0x398f1d){if(_0x398f1d){return[_0x398f1d,![]];}_0x3d5e9e[_0x4ec6('0x92')]=_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x92')];_0x3d5e9e[_0x4ec6('0x94')]=_0x1ed077['body']['externalUrl'];return db[_0x4ec6('0x93')]['create'](_0x3d5e9e)['then'](function(_0x286fa3){return[_0x286fa3,!![]];});});}else{_0x28d217[_0x4ec6('0x92')]=null;}_0x28d217['ContactId']=_0x20ab67['id'];return db[_0x4ec6('0x93')][_0x4ec6('0x65')]({'where':_0x28d217})[_0x4ec6('0x26')](function(_0x132236){if(_0x132236){return[_0x132236,![]];}return db[_0x4ec6('0x93')][_0x4ec6('0x5e')](_0x3d5e9e)[_0x4ec6('0x26')](function(_0x1ee66d){return[_0x1ee66d,!![]];});});}})['spread'](function(_0x23fde4,_0x4c3f90){if(_0x23fde4){_0x505623=_0x4c3f90;if(!_0x4c3f90){var _0x3f4090={'from':(_0x236a4f['contact'][_0x4ec6('0x90')]||'')+'\x20'+(_0x236a4f[_0x4ec6('0x8f')]['lastName']||'')};if(_0x1ed077[_0x4ec6('0x5f')]['threadId']&&_0x1ed077[_0x4ec6('0x5f')]['messageId']&&_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x92')]!=_0x1ed077['body'][_0x4ec6('0x95')]){_0x3f4090[_0x4ec6('0x92')]=_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x95')];}return _0x23fde4[_0x4ec6('0x3a')](_0x3f4090);}else{return _0x23fde4;}}})['then'](function(_0x59dfe9){_0x236a4f[_0x4ec6('0x96')]=_0x59dfe9['get']({'plain':!![]});_0x236a4f[_0x4ec6('0x96')][_0x4ec6('0x97')]=_0x505623;if(_0x236a4f['interaction']['created']){if(_0x236a4f[_0x4ec6('0x87')][_0x4ec6('0x98')]){_0x236a4f['applications']['push']({'id':0x0,'priority':_0x236a4f[_0x4ec6('0x8b')][_0x4ec6('0x4e')]+0x1,'app':_0x4ec6('0x99'),'appdata':_0x4ec6('0x9a'),'interval':_0x4ec6('0x9b')});}}return db[_0x4ec6('0x9c')][_0x4ec6('0x5e')]({'body':_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x5f')],'OpenchannelAccountId':_0x1ed077[_0x4ec6('0x64')]['id'],'OpenchannelInteractionId':_0x59dfe9['id'],'direction':'in','ContactId':_0x236a4f[_0x4ec6('0x8f')]['id'],'AttachmentId':_0x1ed077[_0x4ec6('0x5f')][_0x4ec6('0x9d')]});})[_0x4ec6('0x26')](function(_0xec0958){_0x236a4f[_0x4ec6('0x2d')]=_0xec0958;if(_0x236a4f[_0x4ec6('0x96')][_0x4ec6('0x9e')]){return db[_0x4ec6('0x9f')][_0x4ec6('0x65')]({'attributes':['id',_0x4ec6('0x41')],'where':{'id':_0x236a4f[_0x4ec6('0x96')][_0x4ec6('0x9e')]}})['then'](function(_0x419c10){if(_0x419c10){_0x236a4f[_0x4ec6('0x8b')][_0x4ec6('0xa0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x419c10[_0x4ec6('0x41')]+','+(_0x236a4f[_0x4ec6('0x87')][_0x4ec6('0xa1')]||0xa),'interval':_0x4ec6('0x9b')});_0x236a4f[_0x4ec6('0xa2')]=![];}return respondWithRpcPromise(_0x4ec6('0xa3'),_0x4ec6('0xa4'),_0x236a4f);});}return respondWithRpcPromise(_0x4ec6('0xa3'),_0x4ec6('0xa4'),_0x236a4f);})[_0x4ec6('0x26')](function(_0x1fedd4){respondWithRpcPromise(_0x4ec6('0xa5'),'EventManager',{'event':_0x4ec6('0x74'),'message':_0x1fedd4},client9002);return _0x1fedd4;})[_0x4ec6('0x26')](respondWithResult(_0xf0814,null))[_0x4ec6('0x2f')](handleError(_0xf0814,null));};exports[_0x4ec6('0xa6')]=function(_0x2fe07d,_0x384879){var _0x469b47=_0x2fe07d[_0x4ec6('0x64')]['id'];var _0x566c06=_0x2fe07d['body'];var _0x9359f9=0xc8;var _0x5d35bf=null;return db['sequelize'][_0x4ec6('0xa7')]({'isolationLevel':db[_0x4ec6('0xa8')]['Transaction'][_0x4ec6('0xa9')][_0x4ec6('0xaa')]},function(_0x8ae5f2){return db[_0x4ec6('0x47')][_0x4ec6('0x67')]({'where':{'id':_0x469b47},'transaction':_0x8ae5f2})['then'](function(_0x2e3025){if(_0x2e3025){return db[_0x4ec6('0x86')][_0x4ec6('0x3b')]({'where':{'OpenchannelAccountId':_0x469b47},'transaction':_0x8ae5f2})[_0x4ec6('0x26')](function(){var _0x31bf65=_[_0x4ec6('0x46')](_0x566c06,function(_0x780de9){_0x780de9[_0x4ec6('0x6b')]=_0x469b47;return _0x780de9;});return db[_0x4ec6('0x86')][_0x4ec6('0xab')](_0x31bf65,{'transaction':_0x8ae5f2});});}else{_0x9359f9=0x194;_0x5d35bf=[];}});})['then'](function(){if(_0x9359f9!==0x194){return db[_0x4ec6('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x469b47},'order':_0x4ec6('0x8c')})[_0x4ec6('0x26')](function(_0x3c5847){_0x5d35bf=_0x3c5847;});}})['catch'](function(_0x415c4f){_0x9359f9=0x1f4;logger['error'](_0x415c4f['stack']);if(_0x415c4f[_0x4ec6('0x41')]){delete _0x415c4f['name'];}_0x5d35bf=_0x415c4f;})[_0x4ec6('0xac')](function(){if(_0x5d35bf===null){_0x384879[_0x4ec6('0xad')](_0x9359f9);}else{if(_0x9359f9===0x1f4){_0x384879[_0x4ec6('0x30')](_0x9359f9)['send'](_0x5d35bf);}else{_0x384879[_0x4ec6('0x30')](_0x9359f9)[_0x4ec6('0xae')](_0x5d35bf);}}});};exports[_0x4ec6('0xaf')]=function(_0x58dc5d,_0x314c40,_0x228215){var _0x42a25d={};var _0x1451e9={};var _0x106985;var _0xbaba23;return db[_0x4ec6('0x47')]['findOne']({'where':{'id':_0x58dc5d[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x314c40,null))['then'](function(_0xdfa9c6){if(_0xdfa9c6){_0x106985=_0xdfa9c6;_0x1451e9[_0x4ec6('0x4b')]=_[_0x4ec6('0x5a')](db[_0x4ec6('0x86')][_0x4ec6('0x5b')]);_0x1451e9[_0x4ec6('0x4a')]=_[_0x4ec6('0x5a')](_0x58dc5d['query']);_0x1451e9[_0x4ec6('0x5c')]=_['intersection'](_0x1451e9['model'],_0x1451e9['query']);_0x42a25d[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x1451e9[_0x4ec6('0x4b')],qs[_0x4ec6('0x4d')](_0x58dc5d[_0x4ec6('0x4a')][_0x4ec6('0x4d')]));_0x42a25d[_0x4ec6('0x4c')]=_0x42a25d['attributes'][_0x4ec6('0x4e')]?_0x42a25d['attributes']:_0x1451e9[_0x4ec6('0x4b')];_0x42a25d[_0x4ec6('0x69')]=qs['sort'](_0x58dc5d['query'][_0x4ec6('0x4f')]);_0x42a25d[_0x4ec6('0x50')]=qs[_0x4ec6('0x5c')](_[_0x4ec6('0x6a')](_0x58dc5d['query'],_0x1451e9[_0x4ec6('0x5c')]));if(_0x58dc5d[_0x4ec6('0x4a')]['filter']){_0x42a25d[_0x4ec6('0x50')]=_['merge'](_0x42a25d[_0x4ec6('0x50')],{'$or':_[_0x4ec6('0x46')](_0x42a25d[_0x4ec6('0x4c')],function(_0x4fd7e1){var _0x2e9973={};_0x2e9973[_0x4fd7e1]={'$like':'%'+_0x58dc5d['query'][_0x4ec6('0x51')]+'%'};return _0x2e9973;})});}_0x42a25d=_[_0x4ec6('0x52')]({},_0x42a25d,_0x58dc5d[_0x4ec6('0x55')]);return _0x106985[_0x4ec6('0xaf')](_0x42a25d);}})[_0x4ec6('0x26')](function(_0x58d593){if(_0x58d593){_0xbaba23=_0x58d593['length'];if(!_0x58dc5d[_0x4ec6('0x4a')][_0x4ec6('0x68')](_0x4ec6('0x71'))){_0x42a25d[_0x4ec6('0x32')]=qs[_0x4ec6('0x32')](_0x58dc5d[_0x4ec6('0x4a')][_0x4ec6('0x32')]);_0x42a25d['offset']=qs[_0x4ec6('0x31')](_0x58dc5d['query'][_0x4ec6('0x31')]);}return _0x106985[_0x4ec6('0xaf')](_0x42a25d);}})[_0x4ec6('0x26')](function(_0x460f9e){if(_0x460f9e){return _0x460f9e?{'count':_0xbaba23,'rows':_0x460f9e}:null;}})['then'](respondWithResult(_0x314c40,null))['catch'](handleError(_0x314c40,null));};exports['getInteractions']=function(_0x56a414,_0x1d48d0,_0x2b5681){var _0x31bdfb={'raw':![],'where':{}};var _0x2bd0c3={};var _0x363fdd={'count':0x0,'rows':[]};return db[_0x4ec6('0x47')]['findOne']({'where':{'id':_0x56a414[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x1d48d0,null))[_0x4ec6('0x26')](function(_0x542f24){if(_0x542f24){_0x2bd0c3[_0x4ec6('0x4b')]=_[_0x4ec6('0x5a')](db[_0x4ec6('0x93')][_0x4ec6('0x5b')]);_0x2bd0c3[_0x4ec6('0x4a')]=_[_0x4ec6('0x5a')](_0x56a414[_0x4ec6('0x4a')]);_0x2bd0c3['filters']=_['intersection'](_0x2bd0c3[_0x4ec6('0x4b')],_0x2bd0c3[_0x4ec6('0x4a')]);_0x31bdfb[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x2bd0c3[_0x4ec6('0x4b')],qs[_0x4ec6('0x4d')](_0x56a414['query'][_0x4ec6('0x4d')]));_0x31bdfb[_0x4ec6('0x4c')]=_0x31bdfb[_0x4ec6('0x4c')][_0x4ec6('0x4e')]?_0x31bdfb[_0x4ec6('0x4c')]:_0x2bd0c3[_0x4ec6('0x4b')];if(!_0x56a414[_0x4ec6('0x4a')][_0x4ec6('0x68')](_0x4ec6('0x71'))){_0x31bdfb[_0x4ec6('0x32')]=qs['limit'](_0x56a414['query'][_0x4ec6('0x32')]);_0x31bdfb[_0x4ec6('0x31')]=qs[_0x4ec6('0x31')](_0x56a414[_0x4ec6('0x4a')][_0x4ec6('0x31')]);}_0x31bdfb[_0x4ec6('0x69')]=qs[_0x4ec6('0x4f')](_0x56a414['query'][_0x4ec6('0x4f')]);_0x31bdfb[_0x4ec6('0x50')]=qs['filters'](_[_0x4ec6('0x6a')](_0x56a414[_0x4ec6('0x4a')],_0x2bd0c3[_0x4ec6('0x5c')]));_0x31bdfb[_0x4ec6('0x50')][_0x4ec6('0x6b')]=_0x542f24['id'];if(_0x56a414[_0x4ec6('0x4a')][_0x4ec6('0x51')]){_0x31bdfb[_0x4ec6('0x50')]=_['merge'](_0x31bdfb[_0x4ec6('0x50')],{'$or':_[_0x4ec6('0x46')](_0x31bdfb['attributes'],function(_0x308391){var _0x809888={};_0x809888[_0x308391]={'$like':'%'+_0x56a414[_0x4ec6('0x4a')]['filter']+'%'};return _0x809888;})});}_0x31bdfb=_[_0x4ec6('0x52')]({},_0x31bdfb,_0x56a414[_0x4ec6('0x55')]);return db[_0x4ec6('0x93')][_0x4ec6('0x34')]({'where':_0x31bdfb[_0x4ec6('0x50')]})[_0x4ec6('0x26')](function(_0x105e98){_0x363fdd[_0x4ec6('0x34')]=_0x105e98;if(_0x56a414[_0x4ec6('0x4a')][_0x4ec6('0x56')]){_0x31bdfb[_0x4ec6('0x72')]=[{'model':db[_0x4ec6('0x76')],'as':_0x4ec6('0xb0'),'required':![]},{'model':db[_0x4ec6('0x9f')],'as':'Owner','attributes':[_0x4ec6('0x41'),_0x4ec6('0xb1'),_0x4ec6('0xb2')],'required':![]},{'model':db[_0x4ec6('0xb3')],'as':_0x4ec6('0xb4'),'attributes':['id',_0x4ec6('0x41'),_0x4ec6('0xb5')],'where':_0x56a414[_0x4ec6('0x4a')]['tag']?{'id':_0x56a414[_0x4ec6('0x4a')][_0x4ec6('0xb6')]}:undefined,'required':_0x56a414['query']['tag']?!![]:![]}];}return db[_0x4ec6('0x93')][_0x4ec6('0x57')](_0x31bdfb);})[_0x4ec6('0x26')](function(_0xebafe4){_0x363fdd['rows']=_0xebafe4;return _0x363fdd;});}})['then'](respondWithFilteredResult(_0x1d48d0,_0x31bdfb))[_0x4ec6('0x2f')](handleError(_0x1d48d0,null));};exports['addAgents']=function(_0x4e81cd,_0x1f47e8,_0x3fda72){return db[_0x4ec6('0x47')]['find']({'where':{'id':_0x4e81cd['params']['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x1f47e8,null))[_0x4ec6('0x26')](function(_0x569c48){if(_0x569c48){return _0x569c48[_0x4ec6('0xb7')](_0x4e81cd['body']['ids'],_[_0x4ec6('0xb8')](_0x4e81cd[_0x4ec6('0x5f')],[_0x4ec6('0xb9'),'id'])||{})['spread'](function(_0x2223ff){for(var _0x386b78=0x0;_0x386b78<_0x4e81cd[_0x4ec6('0x5f')]['ids'][_0x4ec6('0x4e')];_0x386b78+=0x1){socket[_0x4ec6('0xba')](_0x4ec6('0xbb'),{'UserId':Number(_0x4e81cd[_0x4ec6('0x5f')]['ids'][_0x386b78]),'OpenchannelAccountId':Number(_0x4e81cd['params']['id'])});}return _0x2223ff;});}})['then'](respondWithResult(_0x1f47e8,null))[_0x4ec6('0x2f')](handleError(_0x1f47e8,null));};exports['removeAgents']=function(_0x4f7ef1,_0x22fead,_0x132619){return db[_0x4ec6('0x47')][_0x4ec6('0x65')]({'where':{'id':_0x4f7ef1[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x22fead,null))[_0x4ec6('0x26')](function(_0xfab08e){if(_0xfab08e){return _0xfab08e[_0x4ec6('0xbc')](_0x4f7ef1['query'][_0x4ec6('0xb9')])['then'](function(){if(_['isArray'](_0x4f7ef1[_0x4ec6('0x4a')][_0x4ec6('0xb9')])){for(var _0x3fc3d1=0x0;_0x3fc3d1<_0x4f7ef1[_0x4ec6('0x4a')]['ids'][_0x4ec6('0x4e')];_0x3fc3d1+=0x1){socket[_0x4ec6('0xba')](_0x4ec6('0xbd'),{'UserId':Number(_0x4f7ef1[_0x4ec6('0x4a')][_0x4ec6('0xb9')][_0x3fc3d1]),'OpenchannelAccountId':Number(_0x4f7ef1['params']['id'])});}}else{socket[_0x4ec6('0xba')](_0x4ec6('0xbd'),{'UserId':Number(_0x4f7ef1['query'][_0x4ec6('0xb9')]),'OpenchannelAccountId':Number(_0x4f7ef1['params']['id'])});}});}})[_0x4ec6('0x26')](respondWithStatusCode(_0x22fead,null))[_0x4ec6('0x2f')](handleError(_0x22fead,null));};exports['getAgents']=function(_0x488b65,_0x518239,_0x364364){var _0x4d3376={};var _0x166f44={};var _0x1efb96;var _0x4a1e23;return db[_0x4ec6('0x47')][_0x4ec6('0x67')]({'where':{'id':_0x488b65[_0x4ec6('0x64')]['id']}})['then'](handleEntityNotFound(_0x518239,null))[_0x4ec6('0x26')](function(_0x5dcbae){if(_0x5dcbae){_0x1efb96=_0x5dcbae;_0x166f44[_0x4ec6('0x4b')]=_[_0x4ec6('0x5a')](db['User']['rawAttributes']);_0x166f44['query']=_[_0x4ec6('0x5a')](_0x488b65[_0x4ec6('0x4a')]);_0x166f44[_0x4ec6('0x5c')]=_['intersection'](_0x166f44['model'],_0x166f44[_0x4ec6('0x4a')]);_0x4d3376[_0x4ec6('0x4c')]=_[_0x4ec6('0x5d')](_0x166f44[_0x4ec6('0x4b')],qs[_0x4ec6('0x4d')](_0x488b65[_0x4ec6('0x4a')]['fields']));_0x4d3376[_0x4ec6('0x4c')]=_0x4d3376[_0x4ec6('0x4c')][_0x4ec6('0x4e')]?_0x4d3376[_0x4ec6('0x4c')]:_0x166f44[_0x4ec6('0x4b')];_0x4d3376['order']=qs[_0x4ec6('0x4f')](_0x488b65[_0x4ec6('0x4a')][_0x4ec6('0x4f')]);_0x4d3376[_0x4ec6('0x50')]=qs[_0x4ec6('0x5c')](_[_0x4ec6('0x6a')](_0x488b65[_0x4ec6('0x4a')],_0x166f44[_0x4ec6('0x5c')]));if(_0x488b65[_0x4ec6('0x4a')][_0x4ec6('0x51')]){_0x4d3376[_0x4ec6('0x50')]=_[_0x4ec6('0x52')](_0x4d3376['where'],{'$or':_[_0x4ec6('0x46')](_0x4d3376[_0x4ec6('0x4c')],function(_0x54236c){var _0xc2bc40={};_0xc2bc40[_0x54236c]={'$like':'%'+_0x488b65['query'][_0x4ec6('0x51')]+'%'};return _0xc2bc40;})});}_0x4d3376=_['merge']({},_0x4d3376,_0x488b65[_0x4ec6('0x55')]);return _0x1efb96[_0x4ec6('0xbe')](_0x4d3376);}})[_0x4ec6('0x26')](function(_0x4fcc04){if(_0x4fcc04){_0x4a1e23=_0x4fcc04['length'];if(!_0x488b65[_0x4ec6('0x4a')][_0x4ec6('0x68')]('nolimit')){_0x4d3376[_0x4ec6('0x32')]=qs[_0x4ec6('0x32')](_0x488b65[_0x4ec6('0x4a')][_0x4ec6('0x32')]);_0x4d3376['offset']=qs[_0x4ec6('0x31')](_0x488b65[_0x4ec6('0x4a')]['offset']);}return _0x1efb96[_0x4ec6('0xbe')](_0x4d3376);}})[_0x4ec6('0x26')](function(_0xe998e4){if(_0xe998e4){return _0xe998e4?{'count':_0x4a1e23,'rows':_0xe998e4}:null;}})[_0x4ec6('0x26')](respondWithResult(_0x518239,null))[_0x4ec6('0x2f')](handleError(_0x518239,null));};exports[_0x4ec6('0x42')]=function(_0x4aa4dc,_0x4389c8,_0x18814c){var _0x29d1ca,_0x2d0faa,_0x232b2c;if(_['isNil'](_0x4aa4dc['body'][_0x4ec6('0x5f')])||_0x4aa4dc[_0x4ec6('0x5f')]['body']===''){throw new db[(_0x4ec6('0x77'))][(_0x4ec6('0x78'))](_0x4ec6('0x7e'));}if(_['isNil'](_0x4aa4dc[_0x4ec6('0x5f')]['to'])){}_0x29d1ca=_0x4aa4dc['body']['to'];return db['OpenchannelAccount'][_0x4ec6('0x67')]({'where':{'id':_0x4aa4dc[_0x4ec6('0x64')]['id']}})[_0x4ec6('0x26')](handleEntityNotFound(_0x4389c8,null))['then'](function(_0x3be710){if(_0x3be710){return db[_0x4ec6('0x47')][_0x4ec6('0x65')]({'where':{'id':_0x3be710['id']},'include':[{'model':db[_0x4ec6('0x82')],'as':'List','include':[{'model':db[_0x4ec6('0x76')],'as':_0x4ec6('0x84'),'where':{[_0x3be710['mapKey']]:_0x29d1ca},'limit':0x1,'order':[[_0x4ec6('0x7b'),_0x4ec6('0x85')]]}]}]})['then'](handleEntityNotFound(_0x4389c8,null))[_0x4ec6('0x26')](function(_0xc6a40a){if(_0xc6a40a&&_0xc6a40a[_0x4ec6('0x83')]){_0x2d0faa=_0xc6a40a['get']({'plain':!![]});if(_0x2d0faa[_0x4ec6('0x83')]&&_0x2d0faa[_0x4ec6('0x83')]['Contacts'][_0x4ec6('0x4e')]){return _0x2d0faa[_0x4ec6('0x83')][_0x4ec6('0x84')][0x0];}return db[_0x4ec6('0x76')][_0x4ec6('0x5e')](_[_0x4ec6('0x1e')](_0x4aa4dc[_0x4ec6('0x5f')],{'firstName':_0x29d1ca,[_0xc6a40a[_0x4ec6('0x7f')]]:_0x29d1ca,'phone':_0x29d1ca,'ListId':_0x2d0faa[_0x4ec6('0x8e')]}));}})[_0x4ec6('0x26')](handleEntityNotFound(_0x4389c8,null))[_0x4ec6('0x26')](function(_0x94874d){if(_0x94874d){_0x232b2c=_0x94874d;return db[_0x4ec6('0x93')][_0x4ec6('0x65')]({'where':{'ContactId':_0x232b2c['id'],'closed':![],'OpenchannelAccountId':_0x2d0faa['id']}})['then'](function(_0x107bd8){if(_0x107bd8){return[_0x107bd8,![]];}return db['OpenchannelInteraction'][_0x4ec6('0x5e')]({'UserId':_0x4aa4dc[_0x4ec6('0x60')]['id'],'ContactId':_0x232b2c['id'],'OpenchannelAccountId':_0x2d0faa['id'],'lastMsgDirection':_0x4ec6('0xbf'),'Messages':[_[_0x4ec6('0x52')](_0x4aa4dc['body'],{'read':![],'body':_0x4aa4dc[_0x4ec6('0x5f')]['body'],'OpenchannelAccountId':_0x2d0faa['id'],'UserId':_0x4aa4dc[_0x4ec6('0x60')]['id'],'ContactId':_0x232b2c['id']})]},{'include':[{'model':db[_0x4ec6('0x9c')],'as':'Messages'}]})['then'](function(_0x58e1db){return[_0x58e1db,!![]];});});}})['spread'](function(_0x5ef651,_0x252568){if(_0x252568){return _0x5ef651;}return db[_0x4ec6('0x9c')][_0x4ec6('0x5e')](_[_0x4ec6('0x52')](_0x4aa4dc[_0x4ec6('0x5f')],{'read':![],'body':_0x4aa4dc[_0x4ec6('0x5f')][_0x4ec6('0x5f')],'OpenchannelAccountId':_0x2d0faa['id'],'OpenchannelInteractionId':_0x5ef651['id'],'UserId':_0x4aa4dc['user']['id'],'ContactId':_0x232b2c['id']}))[_0x4ec6('0x26')](function(_0x19f65b){_0x5ef651[_0x4ec6('0xc0')][_0x4ec6('0xc1')]=[];_0x5ef651[_0x4ec6('0xc0')][_0x4ec6('0xc1')][_0x4ec6('0xc2')](_0x19f65b['dataValues']);return _0x5ef651;});});}})[_0x4ec6('0x26')](respondWithResult(_0x4389c8,null))[_0x4ec6('0x2f')](handleError(_0x4389c8,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1605764..ec13f61 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e6c=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x47718f,_0x4aec14){var _0x39a2dd=function(_0x4ca365){while(--_0x4ca365){_0x47718f['push'](_0x47718f['shift']());}};_0x39a2dd(++_0x4aec14);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var OpenchannelAccount=require(_0xc6e6('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc6e6('0x2')](0x0);var events={'afterCreate':_0xc6e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e97f5){return function(_0x5a9e2b,_0x40b7e1,_0x4b13f0){OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5+':'+_0x5a9e2b['id'],_0x5a9e2b);OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5,_0x5a9e2b);_0x4b13f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc6e6('0x5')](e,emitEvent(event));}}module[_0xc6e6('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x106fa3,_0x5a4b6e){var _0x4a2a09=function(_0x5181ef){while(--_0x5181ef){_0x106fa3['push'](_0x106fa3['shift']());}};_0x4a2a09(++_0x5a4b6e);}(_0x9348,0x10d));var _0x8934=function(_0xa319c3,_0x347c0b){_0xa319c3=_0xa319c3-0x0;var _0x31af38=_0x9348[_0xa319c3];return _0x31af38;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index d7eec19..4c896a8 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(_0x380026,_0x5cae05){var _0x1afdca=function(_0x4e059f){while(--_0x4e059f){_0x380026['push'](_0x380026['shift']());}};_0x1afdca(++_0x5cae05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x256cd2,_0x4069b1){var _0xa4faca=function(_0x379825){while(--_0x379825){_0x256cd2['push'](_0x256cd2['shift']());}};_0xa4faca(++_0x4069b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index dfda7aa..2853794 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 _0xcecc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x205ef8,_0x21dd3a){var _0x6f359e=function(_0x1d8b73){while(--_0x1d8b73){_0x205ef8['push'](_0x205ef8['shift']());}};_0x6f359e(++_0x21dd3a);}(_0xcecc,0x186));var _0xccec=function(_0x29066a,_0x5600c0){_0x29066a=_0x29066a-0x0;var _0x3b98a0=_0xcecc[_0x29066a];return _0x3b98a0;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});config[_0xccec('0x8')]=_[_0xccec('0x9')](config['redis'],{'host':_0xccec('0xa'),'port':0x18eb});var socket=require(_0xccec('0xb'))(new Redis(config['redis']));require(_0xccec('0xc'))[_0xccec('0xd')](socket);function respondWithRpcPromise(_0x45ba32,_0x108788,_0x4a936c){return new BPromise(function(_0x49ad58,_0x5d94a5){return client[_0xccec('0xe')](_0x45ba32,_0x4a936c)[_0xccec('0xf')](function(_0x547e6e){logger[_0xccec('0x10')](_0xccec('0x11'),_0x108788,_0xccec('0x12'));logger['debug'](_0xccec('0x13'),_0x108788,_0xccec('0x12'),JSON[_0xccec('0x14')](_0x547e6e));if(_0x547e6e[_0xccec('0x15')]){if(_0x547e6e[_0xccec('0x15')]['code']===0x1f4){logger[_0xccec('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,_0x547e6e['error']['message']);return _0x5d94a5(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);return _0x49ad58(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}else{logger[_0xccec('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,'request\x20sent');_0x49ad58(_0x547e6e['result'][_0xccec('0x16')]);}})['catch'](function(_0x76b9fd){logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x76b9fd);_0x5d94a5(_0x76b9fd);});});} \ No newline at end of file +var _0x9ffd=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xb5db1a,_0x1affa6){_0xb5db1a=_0xb5db1a-0x0;var _0x212e4c=_0x9ffd[_0xb5db1a];return _0x212e4c;};'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});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 5b19505..9bc5e0c 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 _0x279d=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x112ad5,_0x139ae8){var _0x3d887f=function(_0x5b258f){while(--_0x5b258f){_0x112ad5['push'](_0x112ad5['shift']());}};_0x3d887f(++_0x139ae8);}(_0x279d,0x1d8));var _0xd279=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x279d[_0x1cc8fe];return _0x230054;};'use strict';var OpenchannelAccountEvents=require(_0xd279('0x0'));var events=[_0xd279('0x1'),_0xd279('0x2'),_0xd279('0x3')];function createListener(_0x59afe5,_0x4901ec){return function(_0x3e9699){_0x4901ec[_0xd279('0x4')](_0x59afe5,_0x3e9699);};}function removeListener(_0x47cfee,_0x15d034){return function(){OpenchannelAccountEvents[_0xd279('0x5')](_0x47cfee,_0x15d034);};}exports[_0xd279('0x6')]=function(_0x87b2a5){for(var _0x1d340c=0x0,_0x1faab4=events[_0xd279('0x7')];_0x1d340c<_0x1faab4;_0x1d340c++){var _0x5f164e=events[_0x1d340c];var _0x3cd28e=createListener(_0xd279('0x8')+_0x5f164e,_0x87b2a5);OpenchannelAccountEvents['on'](_0x5f164e,_0x3cd28e);}}; \ No newline at end of file +var _0x899a=['./openchannelAccount.events','save','update','emit','register','openchannelAccount:'];(function(_0x1c1566,_0x36b365){var _0x461fae=function(_0x1cc266){while(--_0x1cc266){_0x1c1566['push'](_0x1c1566['shift']());}};_0x461fae(++_0x36b365);}(_0x899a,0x1b6));var _0xa899=function(_0x756f4a,_0x5151e3){_0x756f4a=_0x756f4a-0x0;var _0x1fe0e3=_0x899a[_0x756f4a];return _0x1fe0e3;};'use strict';var OpenchannelAccountEvents=require(_0xa899('0x0'));var events=[_0xa899('0x1'),'remove',_0xa899('0x2')];function createListener(_0x3f08ab,_0x5d1c04){return function(_0x2742c1){_0x5d1c04[_0xa899('0x3')](_0x3f08ab,_0x2742c1);};}function removeListener(_0x1c5c93,_0x223383){return function(){OpenchannelAccountEvents['removeListener'](_0x1c5c93,_0x223383);};}exports[_0xa899('0x4')]=function(_0xb1bd49){for(var _0xad59d2=0x0,_0x2df63d=events['length'];_0xad59d2<_0x2df63d;_0xad59d2++){var _0x3d35fb=events[_0xad59d2];var _0xfc2b30=createListener(_0xa899('0x5')+_0x3d35fb,_0xb1bd49);OpenchannelAccountEvents['on'](_0x3d35fb,_0xfc2b30);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d7b34ff..b766870 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 _0xf494=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','get','isAuthenticated','post','create','put','/:id','update','exports','multer','util'];(function(_0x113939,_0x39e012){var _0x570e64=function(_0x117b68){while(--_0x117b68){_0x113939['push'](_0x113939['shift']());}};_0x570e64(++_0x39e012);}(_0xf494,0x166));var _0x4f49=function(_0x18b036,_0x1c45f1){_0x18b036=_0x18b036-0x0;var _0xacd469=_0xf494[_0x18b036];return _0xacd469;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require('path');var timeout=require(_0x4f49('0x2'));var express=require('express');var router=express[_0x4f49('0x3')]();var fs_extra=require(_0x4f49('0x4'));var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4f49('0x9')]);router[_0x4f49('0xa')]('/:id',auth[_0x4f49('0xb')](),controller['show']);router[_0x4f49('0xc')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xd')]);router[_0x4f49('0xe')](_0x4f49('0xf'),auth['isAuthenticated'](),controller[_0x4f49('0x10')]);router['delete']('/:id',auth[_0x4f49('0xb')](),controller['destroy']);module[_0x4f49('0x11')]=router; \ No newline at end of file +var _0x63af=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x60fad2,_0x3582e8){var _0x487a5b=function(_0x522cf8){while(--_0x522cf8){_0x60fad2['push'](_0x60fad2['shift']());}};_0x487a5b(++_0x3582e8);}(_0x63af,0x170));var _0xf63a=function(_0x54691e,_0x28b041){_0x54691e=_0x54691e-0x0;var _0x5520b2=_0x63af[_0x54691e];return _0x5520b2;};'use strict';var multer=require(_0xf63a('0x0'));var util=require(_0xf63a('0x1'));var path=require('path');var timeout=require(_0xf63a('0x2'));var express=require(_0xf63a('0x3'));var router=express[_0xf63a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf63a('0x5'));var interaction=require(_0xf63a('0x6'));var config=require(_0xf63a('0x7'));var controller=require('./openchannelApplication.controller');router[_0xf63a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf63a('0x9')]);router[_0xf63a('0x8')](_0xf63a('0xa'),auth[_0xf63a('0xb')](),controller[_0xf63a('0xc')]);router[_0xf63a('0xd')]('/',auth[_0xf63a('0xb')](),controller[_0xf63a('0xe')]);router[_0xf63a('0xf')](_0xf63a('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf63a('0xb')](),controller[_0xf63a('0x10')]);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 b4b5b42..5ef3245 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 _0xe2a7=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0xe2a7,0x122));var _0x7e2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2a7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7e2a('0x0')]={'priority':{'type':Sequelize[_0x7e2a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7e2a('0x2')],'allowNull':![],'defaultValue':_0x7e2a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7e2a('0x4')}}; \ No newline at end of file +var _0x8731=['exports','STRING','noop','sequelize'];(function(_0x91fd3a,_0x35ea08){var _0x2180e0=function(_0x5924fd){while(--_0x5924fd){_0x91fd3a['push'](_0x91fd3a['shift']());}};_0x2180e0(++_0x35ea08);}(_0x8731,0x193));var _0x1873=function(_0x1201ac,_0x2a4d38){_0x1201ac=_0x1201ac-0x0;var _0x15c735=_0x8731[_0x1201ac];return _0x15c735;};'use strict';var Sequelize=require(_0x1873('0x0'));module[_0x1873('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1873('0x2')],'allowNull':![],'defaultValue':_0x1873('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index d8714d2..8acddd0 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 _0xbe41=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x22e361,_0x2a2a96){var _0x417fce=function(_0x9ae933){while(--_0x9ae933){_0x22e361['push'](_0x22e361['shift']());}};_0x417fce(++_0x2a2a96);}(_0xbe41,0x158));var _0x1be4=function(_0x108b69,_0x209931){_0x108b69=_0x108b69-0x0;var _0x125f7b=_0xbe41[_0x108b69];return _0x125f7b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1be4('0x0'));var rp=require(_0x1be4('0x1'));var moment=require(_0x1be4('0x2'));var BPromise=require(_0x1be4('0x3'));var Mustache=require(_0x1be4('0x4'));var util=require(_0x1be4('0x5'));var path=require('path');var sox=require(_0x1be4('0x6'));var csv=require(_0x1be4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be4('0x8'));var _=require(_0x1be4('0x9'));var squel=require(_0x1be4('0xa'));var crypto=require(_0x1be4('0xb'));var jsforce=require(_0x1be4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1be4('0x7'));var querystring=require('querystring');var Papa=require(_0x1be4('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1be4('0xe'));var as=require(_0x1be4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1be4('0x10'))(_0x1be4('0x11'));var utils=require(_0x1be4('0x12'));var config=require(_0x1be4('0x13'));var licenseUtil=require(_0x1be4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b8083,_0x2608f9){_0x2608f9=_0x2608f9||0xcc;return function(_0x16c968){if(_0x16c968){return _0x5b8083['sendStatus'](_0x2608f9);}return _0x5b8083['status'](_0x2608f9)[_0x1be4('0x15')]();};}function respondWithResult(_0xd6a398,_0x4f6674){_0x4f6674=_0x4f6674||0xc8;return function(_0x53edef){if(_0x53edef){return _0xd6a398[_0x1be4('0x16')](_0x4f6674)[_0x1be4('0x17')](_0x53edef);}};}function respondWithFilteredResult(_0x437c76,_0xa4cdb9){return function(_0x5b09c2){if(_0x5b09c2){var _0x4e3f0e=typeof _0xa4cdb9[_0x1be4('0x18')]===_0x1be4('0x19')&&typeof _0xa4cdb9[_0x1be4('0x1a')]==='undefined';var _0x49f1e5=_0x5b09c2[_0x1be4('0x1b')];var _0x41151f=_0x4e3f0e?0x0:_0xa4cdb9[_0x1be4('0x18')];var _0x2f23a3=_0x4e3f0e?_0x5b09c2['count']:_0xa4cdb9[_0x1be4('0x18')]+_0xa4cdb9[_0x1be4('0x1a')];var _0x140b7c;if(_0x2f23a3>=_0x49f1e5){_0x2f23a3=_0x49f1e5;_0x140b7c=0xc8;}else{_0x140b7c=0xce;}_0x437c76[_0x1be4('0x16')](_0x140b7c);return _0x437c76['set'](_0x1be4('0x1c'),_0x41151f+'-'+_0x2f23a3+'/'+_0x49f1e5)[_0x1be4('0x17')](_0x5b09c2);}return null;};}function patchUpdates(_0x1f9bf5){return function(_0x1bd93f){try{jsonpatch['apply'](_0x1bd93f,_0x1f9bf5,!![]);}catch(_0x80223a){return BPromise[_0x1be4('0x1d')](_0x80223a);}return _0x1bd93f[_0x1be4('0x1e')]();};}function saveUpdates(_0x4abcf4,_0x53f366){return function(_0x3e6528){if(_0x3e6528){return _0x3e6528[_0x1be4('0x1f')](_0x4abcf4)[_0x1be4('0x20')](function(_0x5cd719){return _0x5cd719;});}return null;};}function removeEntity(_0x100289,_0x24a878){return function(_0x30fb2a){if(_0x30fb2a){return _0x30fb2a[_0x1be4('0x21')]()[_0x1be4('0x20')](function(){_0x100289[_0x1be4('0x16')](0xcc)[_0x1be4('0x15')]();});}};}function handleEntityNotFound(_0x42a1b1,_0x57d05f){return function(_0x34337b){if(!_0x34337b){_0x42a1b1['sendStatus'](0x194);}return _0x34337b;};}function handleError(_0x3b6295,_0x5ead8f){_0x5ead8f=_0x5ead8f||0x1f4;return function(_0x3e5f54){logger[_0x1be4('0x22')](_0x3e5f54[_0x1be4('0x23')]);if(_0x3e5f54['name']){delete _0x3e5f54[_0x1be4('0x24')];}_0x3b6295[_0x1be4('0x16')](_0x5ead8f)[_0x1be4('0x25')](_0x3e5f54);};}exports[_0x1be4('0x26')]=function(_0x8afe2f,_0xbd5e88){var _0x7c9696={},_0x4a04c7={},_0x4e6843={'count':0x0,'rows':[]};var _0x3e95a0=_[_0x1be4('0x27')](db[_0x1be4('0x28')][_0x1be4('0x29')],function(_0x8049b4){return{'name':_0x8049b4[_0x1be4('0x2a')],'type':_0x8049b4[_0x1be4('0x2b')][_0x1be4('0x2c')]};});_0x4a04c7[_0x1be4('0x2d')]=_[_0x1be4('0x27')](_0x3e95a0,'name');_0x4a04c7[_0x1be4('0x2e')]=_[_0x1be4('0x2f')](_0x8afe2f[_0x1be4('0x2e')]);_0x4a04c7[_0x1be4('0x30')]=_['intersection'](_0x4a04c7[_0x1be4('0x2d')],_0x4a04c7[_0x1be4('0x2e')]);_0x7c9696[_0x1be4('0x31')]=_[_0x1be4('0x32')](_0x4a04c7[_0x1be4('0x2d')],qs[_0x1be4('0x33')](_0x8afe2f['query'][_0x1be4('0x33')]));_0x7c9696[_0x1be4('0x31')]=_0x7c9696[_0x1be4('0x31')][_0x1be4('0x34')]?_0x7c9696[_0x1be4('0x31')]:_0x4a04c7['model'];if(!_0x8afe2f[_0x1be4('0x2e')][_0x1be4('0x35')](_0x1be4('0x36'))){_0x7c9696[_0x1be4('0x1a')]=qs['limit'](_0x8afe2f[_0x1be4('0x2e')][_0x1be4('0x1a')]);_0x7c9696['offset']=qs[_0x1be4('0x18')](_0x8afe2f['query'][_0x1be4('0x18')]);}_0x7c9696[_0x1be4('0x37')]=qs['sort'](_0x8afe2f[_0x1be4('0x2e')][_0x1be4('0x38')]);_0x7c9696[_0x1be4('0x39')]=qs[_0x1be4('0x30')](_['pick'](_0x8afe2f[_0x1be4('0x2e')],_0x4a04c7[_0x1be4('0x30')]),_0x3e95a0);if(_0x8afe2f[_0x1be4('0x2e')][_0x1be4('0x3a')]){_0x7c9696[_0x1be4('0x39')]=_[_0x1be4('0x3b')](_0x7c9696['where'],{'$or':_[_0x1be4('0x27')](_0x3e95a0,function(_0x5ef0af){if(_0x5ef0af[_0x1be4('0x2b')]!=='VIRTUAL'){var _0x53df7b={};_0x53df7b[_0x5ef0af[_0x1be4('0x24')]]={'$like':'%'+_0x8afe2f['query'][_0x1be4('0x3a')]+'%'};return _0x53df7b;}})});}_0x7c9696=_[_0x1be4('0x3b')]({},_0x7c9696,_0x8afe2f['options']);var _0x18fc72={'where':_0x7c9696[_0x1be4('0x39')]};return db[_0x1be4('0x28')][_0x1be4('0x1b')](_0x18fc72)['then'](function(_0x19ab7b){_0x4e6843['count']=_0x19ab7b;if(_0x8afe2f[_0x1be4('0x2e')][_0x1be4('0x3c')]){_0x7c9696[_0x1be4('0x3d')]=[{'all':!![]}];}return db[_0x1be4('0x28')][_0x1be4('0x3e')](_0x7c9696);})[_0x1be4('0x20')](function(_0x3a5347){_0x4e6843['rows']=_0x3a5347;return _0x4e6843;})['then'](respondWithFilteredResult(_0xbd5e88,_0x7c9696))[_0x1be4('0x3f')](handleError(_0xbd5e88,null));};exports[_0x1be4('0x40')]=function(_0x138922,_0x56eee1){var _0x26dfd5={'raw':!![],'where':{'id':_0x138922[_0x1be4('0x41')]['id']}},_0x23d3ca={};_0x23d3ca[_0x1be4('0x2d')]=_[_0x1be4('0x2f')](db[_0x1be4('0x28')][_0x1be4('0x29')]);_0x23d3ca['query']=_[_0x1be4('0x2f')](_0x138922[_0x1be4('0x2e')]);_0x23d3ca['filters']=_[_0x1be4('0x32')](_0x23d3ca[_0x1be4('0x2d')],_0x23d3ca['query']);_0x26dfd5[_0x1be4('0x31')]=_[_0x1be4('0x32')](_0x23d3ca[_0x1be4('0x2d')],qs['fields'](_0x138922['query']['fields']));_0x26dfd5[_0x1be4('0x31')]=_0x26dfd5['attributes'][_0x1be4('0x34')]?_0x26dfd5['attributes']:_0x23d3ca[_0x1be4('0x2d')];if(_0x138922['query']['includeAll']){_0x26dfd5[_0x1be4('0x3d')]=[{'all':!![]}];}_0x26dfd5=_['merge']({},_0x26dfd5,_0x138922[_0x1be4('0x42')]);return db[_0x1be4('0x28')][_0x1be4('0x43')](_0x26dfd5)[_0x1be4('0x20')](handleEntityNotFound(_0x56eee1,null))['then'](respondWithResult(_0x56eee1,null))[_0x1be4('0x3f')](handleError(_0x56eee1,null));};exports[_0x1be4('0x44')]=function(_0x551304,_0x46a8ab){return db[_0x1be4('0x28')][_0x1be4('0x44')](_0x551304[_0x1be4('0x45')],{})[_0x1be4('0x20')](respondWithResult(_0x46a8ab,0xc9))[_0x1be4('0x3f')](handleError(_0x46a8ab,null));};exports[_0x1be4('0x1f')]=function(_0xb5b959,_0x238540){if(_0xb5b959[_0x1be4('0x45')]['id']){delete _0xb5b959[_0x1be4('0x45')]['id'];}return db[_0x1be4('0x28')][_0x1be4('0x43')]({'where':{'id':_0xb5b959[_0x1be4('0x41')]['id']}})[_0x1be4('0x20')](handleEntityNotFound(_0x238540,null))[_0x1be4('0x20')](saveUpdates(_0xb5b959[_0x1be4('0x45')],null))[_0x1be4('0x20')](respondWithResult(_0x238540,null))['catch'](handleError(_0x238540,null));};exports['destroy']=function(_0x32a5a0,_0x62edf5){return db[_0x1be4('0x28')]['find']({'where':{'id':_0x32a5a0[_0x1be4('0x41')]['id']}})['then'](handleEntityNotFound(_0x62edf5,null))[_0x1be4('0x20')](removeEntity(_0x62edf5,null))['catch'](handleError(_0x62edf5,null));}; \ No newline at end of file +var _0xa021=['sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','show','keys','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x47649e,_0x2e4ddf){var _0xfc4d2d=function(_0x205e16){while(--_0x205e16){_0x47649e['push'](_0x47649e['shift']());}};_0xfc4d2d(++_0x2e4ddf);}(_0xa021,0x87));var _0x1a02=function(_0x5355b3,_0x2f1e18){_0x5355b3=_0x5355b3-0x0;var _0x1dbf46=_0xa021[_0x5355b3];return _0x1dbf46;};'use strict';var emlformat=require(_0x1a02('0x0'));var rimraf=require(_0x1a02('0x1'));var zipdir=require(_0x1a02('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a02('0x3'));var moment=require(_0x1a02('0x4'));var BPromise=require(_0x1a02('0x5'));var Mustache=require(_0x1a02('0x6'));var util=require(_0x1a02('0x7'));var path=require(_0x1a02('0x8'));var sox=require(_0x1a02('0x9'));var csv=require(_0x1a02('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a02('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a02('0xc'));var deskjs=require(_0x1a02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1a02('0xe'));var Papa=require(_0x1a02('0xf'));var Redis=require(_0x1a02('0x10'));var authService=require(_0x1a02('0x11'));var qs=require(_0x1a02('0x12'));var as=require(_0x1a02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a02('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1a02('0x15'));var licenseUtil=require(_0x1a02('0x16'));var db=require(_0x1a02('0x17'))['db'];function respondWithStatusCode(_0x585b71,_0x72d3d9){_0x72d3d9=_0x72d3d9||0xcc;return function(_0x3866b7){if(_0x3866b7){return _0x585b71[_0x1a02('0x18')](_0x72d3d9);}return _0x585b71[_0x1a02('0x19')](_0x72d3d9)['end']();};}function respondWithResult(_0x37caec,_0x5b3e18){_0x5b3e18=_0x5b3e18||0xc8;return function(_0x19c7e1){if(_0x19c7e1){return _0x37caec[_0x1a02('0x19')](_0x5b3e18)[_0x1a02('0x1a')](_0x19c7e1);}};}function respondWithFilteredResult(_0x58fb3c,_0x10d1ac){return function(_0xf4bb16){if(_0xf4bb16){var _0x5f1dfa=typeof _0x10d1ac['offset']===_0x1a02('0x1b')&&typeof _0x10d1ac['limit']===_0x1a02('0x1b');var _0x3a233d=_0xf4bb16[_0x1a02('0x1c')];var _0x58a22b=_0x5f1dfa?0x0:_0x10d1ac['offset'];var _0xe5306a=_0x5f1dfa?_0xf4bb16['count']:_0x10d1ac[_0x1a02('0x1d')]+_0x10d1ac['limit'];var _0x2f7f2e;if(_0xe5306a>=_0x3a233d){_0xe5306a=_0x3a233d;_0x2f7f2e=0xc8;}else{_0x2f7f2e=0xce;}_0x58fb3c[_0x1a02('0x19')](_0x2f7f2e);return _0x58fb3c[_0x1a02('0x1e')](_0x1a02('0x1f'),_0x58a22b+'-'+_0xe5306a+'/'+_0x3a233d)[_0x1a02('0x1a')](_0xf4bb16);}return null;};}function patchUpdates(_0x562ca9){return function(_0x38e202){try{jsonpatch[_0x1a02('0x20')](_0x38e202,_0x562ca9,!![]);}catch(_0x210bf9){return BPromise[_0x1a02('0x21')](_0x210bf9);}return _0x38e202[_0x1a02('0x22')]();};}function saveUpdates(_0x139495,_0x4a6579){return function(_0x1958d5){if(_0x1958d5){return _0x1958d5[_0x1a02('0x23')](_0x139495)[_0x1a02('0x24')](function(_0x423f42){return _0x423f42;});}return null;};}function removeEntity(_0x3f468e,_0xa9a468){return function(_0x50ce22){if(_0x50ce22){return _0x50ce22[_0x1a02('0x25')]()[_0x1a02('0x24')](function(){_0x3f468e[_0x1a02('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x239429,_0x500630){return function(_0x1a814b){if(!_0x1a814b){_0x239429['sendStatus'](0x194);}return _0x1a814b;};}function handleError(_0x263a05,_0x18d112){_0x18d112=_0x18d112||0x1f4;return function(_0x4d54b7){logger['error'](_0x4d54b7[_0x1a02('0x26')]);if(_0x4d54b7[_0x1a02('0x27')]){delete _0x4d54b7[_0x1a02('0x27')];}_0x263a05['status'](_0x18d112)[_0x1a02('0x28')](_0x4d54b7);};}exports[_0x1a02('0x29')]=function(_0x52fc94,_0x4740d3){var _0x1f682d={},_0x5d5355={},_0x40dc10={'count':0x0,'rows':[]};var _0x44b515=_[_0x1a02('0x2a')](db[_0x1a02('0x2b')][_0x1a02('0x2c')],function(_0x3a534b){return{'name':_0x3a534b[_0x1a02('0x2d')],'type':_0x3a534b[_0x1a02('0x2e')][_0x1a02('0x2f')]};});_0x5d5355[_0x1a02('0x30')]=_['map'](_0x44b515,'name');_0x5d5355['query']=_['keys'](_0x52fc94[_0x1a02('0x31')]);_0x5d5355['filters']=_['intersection'](_0x5d5355[_0x1a02('0x30')],_0x5d5355['query']);_0x1f682d[_0x1a02('0x32')]=_[_0x1a02('0x33')](_0x5d5355[_0x1a02('0x30')],qs[_0x1a02('0x34')](_0x52fc94[_0x1a02('0x31')][_0x1a02('0x34')]));_0x1f682d[_0x1a02('0x32')]=_0x1f682d[_0x1a02('0x32')][_0x1a02('0x35')]?_0x1f682d[_0x1a02('0x32')]:_0x5d5355[_0x1a02('0x30')];if(!_0x52fc94[_0x1a02('0x31')][_0x1a02('0x36')]('nolimit')){_0x1f682d[_0x1a02('0x37')]=qs[_0x1a02('0x37')](_0x52fc94[_0x1a02('0x31')][_0x1a02('0x37')]);_0x1f682d[_0x1a02('0x1d')]=qs[_0x1a02('0x1d')](_0x52fc94[_0x1a02('0x31')][_0x1a02('0x1d')]);}_0x1f682d['order']=qs['sort'](_0x52fc94[_0x1a02('0x31')][_0x1a02('0x38')]);_0x1f682d['where']=qs[_0x1a02('0x39')](_['pick'](_0x52fc94['query'],_0x5d5355[_0x1a02('0x39')]),_0x44b515);if(_0x52fc94['query'][_0x1a02('0x3a')]){_0x1f682d[_0x1a02('0x3b')]=_['merge'](_0x1f682d['where'],{'$or':_[_0x1a02('0x2a')](_0x44b515,function(_0x37a2b3){if(_0x37a2b3['type']!==_0x1a02('0x3c')){var _0x4a86e5={};_0x4a86e5[_0x37a2b3[_0x1a02('0x27')]]={'$like':'%'+_0x52fc94['query'][_0x1a02('0x3a')]+'%'};return _0x4a86e5;}})});}_0x1f682d=_[_0x1a02('0x3d')]({},_0x1f682d,_0x52fc94[_0x1a02('0x3e')]);var _0x3e96ba={'where':_0x1f682d[_0x1a02('0x3b')]};return db[_0x1a02('0x2b')][_0x1a02('0x1c')](_0x3e96ba)[_0x1a02('0x24')](function(_0x43941c){_0x40dc10[_0x1a02('0x1c')]=_0x43941c;if(_0x52fc94[_0x1a02('0x31')][_0x1a02('0x3f')]){_0x1f682d['include']=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x1f682d);})[_0x1a02('0x24')](function(_0x40d969){_0x40dc10['rows']=_0x40d969;return _0x40dc10;})[_0x1a02('0x24')](respondWithFilteredResult(_0x4740d3,_0x1f682d))['catch'](handleError(_0x4740d3,null));};exports[_0x1a02('0x40')]=function(_0xa33765,_0x1f184f){var _0x52a874={'raw':!![],'where':{'id':_0xa33765['params']['id']}},_0x319d17={};_0x319d17[_0x1a02('0x30')]=_[_0x1a02('0x41')](db[_0x1a02('0x2b')]['rawAttributes']);_0x319d17[_0x1a02('0x31')]=_['keys'](_0xa33765[_0x1a02('0x31')]);_0x319d17[_0x1a02('0x39')]=_[_0x1a02('0x33')](_0x319d17[_0x1a02('0x30')],_0x319d17[_0x1a02('0x31')]);_0x52a874['attributes']=_[_0x1a02('0x33')](_0x319d17[_0x1a02('0x30')],qs[_0x1a02('0x34')](_0xa33765[_0x1a02('0x31')][_0x1a02('0x34')]));_0x52a874[_0x1a02('0x32')]=_0x52a874[_0x1a02('0x32')][_0x1a02('0x35')]?_0x52a874['attributes']:_0x319d17[_0x1a02('0x30')];if(_0xa33765[_0x1a02('0x31')]['includeAll']){_0x52a874[_0x1a02('0x42')]=[{'all':!![]}];}_0x52a874=_[_0x1a02('0x3d')]({},_0x52a874,_0xa33765['options']);return db[_0x1a02('0x2b')][_0x1a02('0x43')](_0x52a874)['then'](handleEntityNotFound(_0x1f184f,null))[_0x1a02('0x24')](respondWithResult(_0x1f184f,null))[_0x1a02('0x44')](handleError(_0x1f184f,null));};exports[_0x1a02('0x45')]=function(_0x166504,_0xdaf2d4){return db[_0x1a02('0x2b')][_0x1a02('0x45')](_0x166504['body'],{})['then'](respondWithResult(_0xdaf2d4,0xc9))[_0x1a02('0x44')](handleError(_0xdaf2d4,null));};exports[_0x1a02('0x23')]=function(_0x1660e9,_0x4fbb77){if(_0x1660e9[_0x1a02('0x46')]['id']){delete _0x1660e9['body']['id'];}return db[_0x1a02('0x2b')][_0x1a02('0x43')]({'where':{'id':_0x1660e9['params']['id']}})[_0x1a02('0x24')](handleEntityNotFound(_0x4fbb77,null))[_0x1a02('0x24')](saveUpdates(_0x1660e9[_0x1a02('0x46')],null))['then'](respondWithResult(_0x4fbb77,null))[_0x1a02('0x44')](handleError(_0x4fbb77,null));};exports['destroy']=function(_0x29254c,_0x464da6){return db['OpenchannelApplication'][_0x1a02('0x43')]({'where':{'id':_0x29254c[_0x1a02('0x47')]['id']}})[_0x1a02('0x24')](handleEntityNotFound(_0x464da6,null))[_0x1a02('0x24')](removeEntity(_0x464da6,null))[_0x1a02('0x44')](handleError(_0x464da6,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 818669e..47e98ff 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 _0xde2a=['./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','util','../../config/logger','api','path'];(function(_0xa6ac0a,_0x5b5bb6){var _0x57a6ee=function(_0x3bb502){while(--_0x3bb502){_0xa6ac0a['push'](_0xa6ac0a['shift']());}};_0x57a6ee(++_0x5b5bb6);}(_0xde2a,0x152));var _0xade2=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xde2a[_0x3e2fcf];return _0x497db7;};'use strict';var _=require('lodash');var util=require(_0xade2('0x0'));var logger=require(_0xade2('0x1'))(_0xade2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xade2('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xade2('0x4'));module[_0xade2('0x5')]=function(_0x2cd62e,_0x1d4cae){return _0x2cd62e['define'](_0xade2('0x6'),attributes,{'tableName':_0xade2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xade2('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc956=['utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','openchannel_applications'];(function(_0x56d06e,_0x2a0abd){var _0x238419=function(_0x2ccb81){while(--_0x2ccb81){_0x56d06e['push'](_0x56d06e['shift']());}};_0x238419(++_0x2a0abd);}(_0xc956,0x116));var _0x6c95=function(_0x5b90d2,_0x50e447){_0x5b90d2=_0x5b90d2-0x0;var _0x2b3d92=_0xc956[_0x5b90d2];return _0x2b3d92;};'use strict';var _=require(_0x6c95('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c95('0x1'));var moment=require('moment');var BPromise=require(_0x6c95('0x2'));var rp=require(_0x6c95('0x3'));var fs=require('fs');var path=require(_0x6c95('0x4'));var rimraf=require(_0x6c95('0x5'));var config=require(_0x6c95('0x6'));var attributes=require(_0x6c95('0x7'));module[_0x6c95('0x8')]=function(_0x2cff66,_0x62bf9c){return _0x2cff66['define']('OpenchannelApplication',attributes,{'tableName':_0x6c95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c95('0xa'),'collate':_0x6c95('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b7da8ff..8f3da61 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 _0xed21=['catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x2ef367,_0x475f6d){var _0xb7eacc=function(_0x16d505){while(--_0x16d505){_0x2ef367['push'](_0x2ef367['shift']());}};_0xb7eacc(++_0x475f6d);}(_0xed21,0x166));var _0x1ed2=function(_0x1d22a3,_0x2fb15b){_0x1d22a3=_0x1d22a3-0x0;var _0x5e2a88=_0xed21[_0x1d22a3];return _0x5e2a88;};'use strict';var _=require('lodash');var util=require(_0x1ed2('0x0'));var moment=require(_0x1ed2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ed2('0x2'));var db=require(_0x1ed2('0x3'))['db'];var utils=require(_0x1ed2('0x4'));var logger=require(_0x1ed2('0x5'))('rpc');var config=require(_0x1ed2('0x6'));var jayson=require(_0x1ed2('0x7'));var client=jayson['client'][_0x1ed2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11c47e,_0x588edd,_0xb2ea6f){return new BPromise(function(_0x21a128,_0x10c0bf){return client['request'](_0x11c47e,_0xb2ea6f)[_0x1ed2('0x9')](function(_0x1a3105){logger[_0x1ed2('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x588edd,'request\x20sent');logger[_0x1ed2('0xb')](_0x1ed2('0xc'),_0x588edd,_0x1ed2('0xd'),JSON['stringify'](_0x1a3105));if(_0x1a3105[_0x1ed2('0xe')]){if(_0x1a3105[_0x1ed2('0xe')][_0x1ed2('0xf')]===0x1f4){logger[_0x1ed2('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x588edd,_0x1a3105[_0x1ed2('0xe')][_0x1ed2('0x10')]);return _0x10c0bf(_0x1a3105['error'][_0x1ed2('0x10')]);}logger[_0x1ed2('0xe')](_0x1ed2('0x11'),_0x588edd,_0x1a3105[_0x1ed2('0xe')]['message']);return _0x21a128(_0x1a3105[_0x1ed2('0xe')]['message']);}else{logger[_0x1ed2('0xa')](_0x1ed2('0x11'),_0x588edd,_0x1ed2('0xd'));_0x21a128(_0x1a3105[_0x1ed2('0x12')][_0x1ed2('0x10')]);}})[_0x1ed2('0x13')](function(_0x1d2575){logger[_0x1ed2('0xe')](_0x1ed2('0x11'),_0x588edd,_0x1d2575);_0x10c0bf(_0x1d2575);});});}exports[_0x1ed2('0x14')]=function(_0x12eed9){var _0x2eb443=this;return new Promise(function(_0x3f5574,_0x4eea2e){return db[_0x1ed2('0x15')][_0x1ed2('0x16')](_0x12eed9[_0x1ed2('0x17')],{'raw':_0x12eed9[_0x1ed2('0x18')]?_0x12eed9['options'][_0x1ed2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12eed9['options']?_0x12eed9['options'][_0x1ed2('0x1a')]||null:null,'attributes':_0x12eed9[_0x1ed2('0x18')]?_0x12eed9[_0x1ed2('0x18')]['attributes']||null:null,'limit':_0x12eed9[_0x1ed2('0x18')]?_0x12eed9[_0x1ed2('0x18')][_0x1ed2('0x1b')]||null:null})[_0x1ed2('0x9')](function(_0x21dfe0){logger['info'](_0x1ed2('0x14'),_0x12eed9);logger[_0x1ed2('0xb')](_0x1ed2('0x14'),_0x12eed9,JSON[_0x1ed2('0x1c')](_0x21dfe0));_0x3f5574(_0x21dfe0);})[_0x1ed2('0x13')](function(_0x39095b){logger[_0x1ed2('0xe')](_0x1ed2('0x14'),_0x39095b[_0x1ed2('0x10')],_0x12eed9);_0x4eea2e(_0x2eb443[_0x1ed2('0xe')](0x1f4,_0x39095b[_0x1ed2('0x10')]));});});}; \ No newline at end of file +var _0x192d=['body','options','raw','limit','UpdateOpenchannelApplication','debug','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','OpenchannelApplication'];(function(_0x31438d,_0x31c750){var _0xe845ac=function(_0x24003a){while(--_0x24003a){_0x31438d['push'](_0x31438d['shift']());}};_0xe845ac(++_0x31c750);}(_0x192d,0x1ab));var _0xd192=function(_0x6caf43,_0x334fbe){_0x6caf43=_0x6caf43-0x0;var _0x13454a=_0x192d[_0x6caf43];return _0x13454a;};'use strict';var _=require('lodash');var util=require(_0xd192('0x0'));var moment=require('moment');var BPromise=require(_0xd192('0x1'));var rs=require(_0xd192('0x2'));var fs=require('fs');var Redis=require(_0xd192('0x3'));var db=require(_0xd192('0x4'))['db'];var utils=require(_0xd192('0x5'));var logger=require('../../config/logger')(_0xd192('0x6'));var config=require(_0xd192('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd192('0x8')][_0xd192('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d234,_0x3338c0,_0x359ea2){return new BPromise(function(_0x5eb319,_0x3a32fb){return client[_0xd192('0xa')](_0x24d234,_0x359ea2)[_0xd192('0xb')](function(_0x419b3e){logger['info'](_0xd192('0xc'),_0x3338c0,_0xd192('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3338c0,_0xd192('0xd'),JSON[_0xd192('0xe')](_0x419b3e));if(_0x419b3e[_0xd192('0xf')]){if(_0x419b3e['error'][_0xd192('0x10')]===0x1f4){logger['error'](_0xd192('0xc'),_0x3338c0,_0x419b3e[_0xd192('0xf')]['message']);return _0x3a32fb(_0x419b3e[_0xd192('0xf')][_0xd192('0x11')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3338c0,_0x419b3e[_0xd192('0xf')][_0xd192('0x11')]);return _0x5eb319(_0x419b3e['error'][_0xd192('0x11')]);}else{logger[_0xd192('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x3338c0,_0xd192('0xd'));_0x5eb319(_0x419b3e[_0xd192('0x13')]['message']);}})['catch'](function(_0xd7af77){logger[_0xd192('0xf')](_0xd192('0xc'),_0x3338c0,_0xd7af77);_0x3a32fb(_0xd7af77);});});}exports['UpdateOpenchannelApplication']=function(_0xd15744){var _0x1e8a81=this;return new Promise(function(_0x9e99b4,_0x224e78){return db[_0xd192('0x14')]['update'](_0xd15744[_0xd192('0x15')],{'raw':_0xd15744[_0xd192('0x16')]?_0xd15744['options'][_0xd192('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd15744[_0xd192('0x16')]?_0xd15744[_0xd192('0x16')]['where']||null:null,'attributes':_0xd15744[_0xd192('0x16')]?_0xd15744[_0xd192('0x16')]['attributes']||null:null,'limit':_0xd15744[_0xd192('0x16')]?_0xd15744[_0xd192('0x16')][_0xd192('0x18')]||null:null})['then'](function(_0x1b2ea1){logger[_0xd192('0x12')](_0xd192('0x19'),_0xd15744);logger[_0xd192('0x1a')](_0xd192('0x19'),_0xd15744,JSON[_0xd192('0xe')](_0x1b2ea1));_0x9e99b4(_0x1b2ea1);})[_0xd192('0x1b')](function(_0x4ebbd2){logger[_0xd192('0xf')]('UpdateOpenchannelApplication',_0x4ebbd2['message'],_0xd15744);_0x224e78(_0x1e8a81['error'](0x1f4,_0x4ebbd2[_0xd192('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0f8041f..d2dd50e 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 _0xbd45=['connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path'];(function(_0x489727,_0x161e4f){var _0x1ccf21=function(_0x4b26e1){while(--_0x4b26e1){_0x489727['push'](_0x489727['shift']());}};_0x1ccf21(++_0x161e4f);}(_0xbd45,0x7a));var _0x5bd4=function(_0x38695b,_0x2fa3cb){_0x38695b=_0x38695b-0x0;var _0x5b36dd=_0xbd45[_0x38695b];return _0x5b36dd;};'use strict';var multer=require(_0x5bd4('0x0'));var util=require('util');var path=require(_0x5bd4('0x1'));var timeout=require(_0x5bd4('0x2'));var express=require(_0x5bd4('0x3'));var router=express[_0x5bd4('0x4')]();var fs_extra=require(_0x5bd4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bd4('0x6'));var controller=require(_0x5bd4('0x7'));router[_0x5bd4('0x8')]('/',auth[_0x5bd4('0x9')](),controller[_0x5bd4('0xa')]);router[_0x5bd4('0x8')](_0x5bd4('0xb'),auth[_0x5bd4('0x9')](),controller[_0x5bd4('0xc')]);router['get'](_0x5bd4('0xd'),auth[_0x5bd4('0x9')](),controller[_0x5bd4('0xe')]);router['get'](_0x5bd4('0xf'),auth[_0x5bd4('0x9')](),controller['getMessages']);router[_0x5bd4('0x8')](_0x5bd4('0x10'),auth['isAuthenticated'](),controller[_0x5bd4('0x11')]);router[_0x5bd4('0x12')]('/',auth['isAuthenticated'](),controller[_0x5bd4('0x13')]);router[_0x5bd4('0x12')]('/:id/messages',auth[_0x5bd4('0x9')](),controller[_0x5bd4('0x14')]);router['post']('/:id/tags',auth[_0x5bd4('0x9')](),interaction[_0x5bd4('0x15')](_0x5bd4('0x16'),_0x5bd4('0x17')),controller[_0x5bd4('0x18')]);router['put']('/:id',auth[_0x5bd4('0x9')](),interaction[_0x5bd4('0x15')](_0x5bd4('0x16'),'openchannelinteraction:update'),controller['update']);router['delete'](_0x5bd4('0xd'),auth[_0x5bd4('0x9')](),interaction[_0x5bd4('0x15')](_0x5bd4('0x16'),_0x5bd4('0x19')),controller[_0x5bd4('0x1a')]);router[_0x5bd4('0x1b')](_0x5bd4('0x1c'),auth[_0x5bd4('0x9')](),controller[_0x5bd4('0x1d')]);module[_0x5bd4('0x1e')]=router; \ No newline at end of file +var _0x4fca=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4fca,0x9e));var _0xa4fc=function(_0x1a7411,_0x2be9e5){_0x1a7411=_0x1a7411-0x0;var _0x201abb=_0x4fca[_0x1a7411];return _0x201abb;};'use strict';var multer=require(_0xa4fc('0x0'));var util=require(_0xa4fc('0x1'));var path=require('path');var timeout=require(_0xa4fc('0x2'));var express=require('express');var router=express[_0xa4fc('0x3')]();var fs_extra=require(_0xa4fc('0x4'));var auth=require(_0xa4fc('0x5'));var interaction=require(_0xa4fc('0x6'));var config=require(_0xa4fc('0x7'));var controller=require(_0xa4fc('0x8'));router[_0xa4fc('0x9')]('/',auth[_0xa4fc('0xa')](),controller[_0xa4fc('0xb')]);router[_0xa4fc('0x9')](_0xa4fc('0xc'),auth[_0xa4fc('0xa')](),controller['describe']);router[_0xa4fc('0x9')](_0xa4fc('0xd'),auth[_0xa4fc('0xa')](),controller[_0xa4fc('0xe')]);router[_0xa4fc('0x9')](_0xa4fc('0xf'),auth['isAuthenticated'](),controller[_0xa4fc('0x10')]);router[_0xa4fc('0x9')](_0xa4fc('0x11'),auth['isAuthenticated'](),controller[_0xa4fc('0x12')]);router[_0xa4fc('0x13')]('/',auth[_0xa4fc('0xa')](),controller[_0xa4fc('0x14')]);router['post'](_0xa4fc('0xf'),auth[_0xa4fc('0xa')](),controller['addMessage']);router['post'](_0xa4fc('0x15'),auth[_0xa4fc('0xa')](),interaction[_0xa4fc('0x16')](_0xa4fc('0x17'),_0xa4fc('0x18')),controller[_0xa4fc('0x19')]);router[_0xa4fc('0x1a')](_0xa4fc('0xd'),auth[_0xa4fc('0xa')](),interaction[_0xa4fc('0x16')](_0xa4fc('0x17'),'openchannelinteraction:update'),controller[_0xa4fc('0x1b')]);router[_0xa4fc('0x1c')]('/:id',auth[_0xa4fc('0xa')](),interaction[_0xa4fc('0x16')](_0xa4fc('0x17'),_0xa4fc('0x1d')),controller[_0xa4fc('0x1e')]);router[_0xa4fc('0x1c')](_0xa4fc('0x15'),auth[_0xa4fc('0xa')](),controller[_0xa4fc('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index ae7ddb1..7ccd19b 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 _0x8781=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x32ecf5,_0x345f85){var _0xb8b77b=function(_0x31d0da){while(--_0x31d0da){_0x32ecf5['push'](_0x32ecf5['shift']());}};_0xb8b77b(++_0x345f85);}(_0x8781,0x1c8));var _0x1878=function(_0x4c168c,_0x507e3b){_0x4c168c=_0x4c168c-0x0;var _0x362e67=_0x8781[_0x4c168c];return _0x362e67;};'use strict';var Sequelize=require(_0x1878('0x0'));module[_0x1878('0x1')]={'closed':{'type':Sequelize[_0x1878('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1878('0x3')]},'disposition':{'type':Sequelize[_0x1878('0x4')]},'secondDisposition':{'type':Sequelize[_0x1878('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1878('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1878('0x3')]},'threadId':{'type':Sequelize[_0x1878('0x4')]},'externalUrl':{'type':Sequelize[_0x1878('0x4')]},'lastMsgAt':{'type':Sequelize[_0x1878('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1878('0x5')]('in',_0x1878('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x1878('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c54=['exports','BOOLEAN','STRING','ENUM','out','sequelize'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x5c54,0x71));var _0x45c5=function(_0x2de399,_0x3c557d){_0x2de399=_0x2de399-0x0;var _0x50cba8=_0x5c54[_0x2de399];return _0x50cba8;};'use strict';var Sequelize=require(_0x45c5('0x0'));module[_0x45c5('0x1')]={'closed':{'type':Sequelize[_0x45c5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x45c5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x45c5('0x3')]},'note':{'type':Sequelize[_0x45c5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x45c5('0x3')]},'externalUrl':{'type':Sequelize[_0x45c5('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x45c5('0x4')]('in',_0x45c5('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x45c5('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 41dbb0d..4cc778f 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 _0x8a61=['total','UserId','closed','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','union','User','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','merge','OpenchannelInteraction','a.key','Account.key','Account.mandatoryDisposition','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','params','includeAll','include','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','format','addTags','setTags','spread','openchannelInteractionTags:save','download','unix','join','root','files','tmp','server','attachments','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','createdAt','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','forEach','Tags','push','catch','waiting','talking','answered'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0x8a61,0xb7));var _0x18a6=function(_0x2f61ba,_0x1187e6){_0x2f61ba=_0x2f61ba-0x0;var _0x54e4a4=_0x8a61[_0x2f61ba];return _0x54e4a4;};'use strict';var emlformat=require(_0x18a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x18a6('0x1'));var rp=require(_0x18a6('0x2'));var moment=require('moment');var BPromise=require(_0x18a6('0x3'));var Mustache=require(_0x18a6('0x4'));var util=require(_0x18a6('0x5'));var path=require('path');var sox=require(_0x18a6('0x6'));var csv=require(_0x18a6('0x7'));var ejs=require(_0x18a6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18a6('0x9'));var squel=require(_0x18a6('0xa'));var crypto=require(_0x18a6('0xb'));var jsforce=require(_0x18a6('0xc'));var deskjs=require(_0x18a6('0xd'));var toCsv=require(_0x18a6('0x7'));var querystring=require(_0x18a6('0xe'));var Papa=require(_0x18a6('0xf'));var Redis=require(_0x18a6('0x10'));var authService=require(_0x18a6('0x11'));var qs=require(_0x18a6('0x12'));var as=require(_0x18a6('0x13'));var pdf=require(_0x18a6('0x14'));var hardwareService=require(_0x18a6('0x15'));var logger=require(_0x18a6('0x16'))(_0x18a6('0x17'));var utils=require(_0x18a6('0x18'));var config=require(_0x18a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x18a6('0x1a'))['db'];config['redis']=_[_0x18a6('0x1b')](config[_0x18a6('0x1c')],{'host':_0x18a6('0x1d'),'port':0x18eb});var socket=require(_0x18a6('0x1e'))(new Redis(config[_0x18a6('0x1c')]));require(_0x18a6('0x1f'))[_0x18a6('0x20')](socket);function respondWithStatusCode(_0x3885fd,_0x2c4d46){_0x2c4d46=_0x2c4d46||0xcc;return function(_0x35ee48){if(_0x35ee48){return _0x3885fd[_0x18a6('0x21')](_0x2c4d46);}return _0x3885fd[_0x18a6('0x22')](_0x2c4d46)[_0x18a6('0x23')]();};}function respondWithResult(_0x3fe3bc,_0x350558){_0x350558=_0x350558||0xc8;return function(_0x3313e1){if(_0x3313e1){return _0x3fe3bc[_0x18a6('0x22')](_0x350558)[_0x18a6('0x24')](_0x3313e1);}};}function respondWithFilteredResult(_0x2c8372,_0x40e6a2){return function(_0x396d0a){if(_0x396d0a){var _0x5ddbeb=typeof _0x40e6a2[_0x18a6('0x25')]===_0x18a6('0x26')&&typeof _0x40e6a2[_0x18a6('0x27')]===_0x18a6('0x26');var _0x479619=_0x396d0a[_0x18a6('0x28')];var _0x50b2d6=_0x5ddbeb?0x0:_0x40e6a2[_0x18a6('0x25')];var _0x23b2bf=_0x5ddbeb?_0x396d0a[_0x18a6('0x28')]:_0x40e6a2[_0x18a6('0x25')]+_0x40e6a2[_0x18a6('0x27')];var _0x2d61f5;if(_0x23b2bf>=_0x479619){_0x23b2bf=_0x479619;_0x2d61f5=0xc8;}else{_0x2d61f5=0xce;}_0x2c8372[_0x18a6('0x22')](_0x2d61f5);return _0x2c8372[_0x18a6('0x29')](_0x18a6('0x2a'),_0x50b2d6+'-'+_0x23b2bf+'/'+_0x479619)[_0x18a6('0x24')](_0x396d0a);}return null;};}function patchUpdates(_0x1bf5d8){return function(_0x235578){try{jsonpatch[_0x18a6('0x2b')](_0x235578,_0x1bf5d8,!![]);}catch(_0x1c41df){return BPromise['reject'](_0x1c41df);}return _0x235578['save']();};}function saveUpdates(_0x30ab3f,_0x11e51d){return function(_0x5dbc25){if(_0x5dbc25){return _0x5dbc25[_0x18a6('0x2c')](_0x30ab3f)[_0x18a6('0x2d')](function(_0x23bc51){return _0x23bc51;});}return null;};}function removeEntity(_0x34654c,_0x456f92){return function(_0x17a721){if(_0x17a721){return _0x17a721[_0x18a6('0x2e')]()['then'](function(){_0x34654c[_0x18a6('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5fa4,_0x2c6f80){return function(_0x3d7774){if(!_0x3d7774){_0x3b5fa4['sendStatus'](0x194);}return _0x3d7774;};}function handleError(_0x296ef3,_0x52cd9a){_0x52cd9a=_0x52cd9a||0x1f4;return function(_0x2ab8db){logger[_0x18a6('0x2f')](_0x2ab8db[_0x18a6('0x30')]);if(_0x2ab8db[_0x18a6('0x31')]){delete _0x2ab8db['name'];}_0x296ef3['status'](_0x52cd9a)[_0x18a6('0x32')](_0x2ab8db);};}function getInteractionUsers(_0x42db30,_0xac15e7){return new BPromise(function(_0x340170,_0x2ada06){try{if(_0xac15e7[_0x42db30['id']]){_0x42db30[_0x18a6('0x33')]=_['map'](_0xac15e7[_0x42db30['id']],function(_0x269ef8){return{'id':_0x269ef8['id'],'fullname':_0x269ef8[_0x18a6('0x34')]};});}}catch(_0x5a43cd){_0x2ada06(_0x5a43cd);}_0x340170(_0x42db30);});}function getInteractionTags(_0x32be6e,_0x102887){return new BPromise(function(_0x337f5b,_0x5f1324){try{if(_0x32be6e['TagIds']){_0x32be6e['Tags']=[];_0x32be6e[_0x18a6('0x35')]['split'](',')[_0x18a6('0x36')](function(_0x179586){_0x32be6e[_0x18a6('0x37')][_0x18a6('0x38')](_0x102887[_0x179586]);});}delete _0x32be6e[_0x18a6('0x35')];}catch(_0x36476b){_0x5f1324(_0x36476b);}_0x337f5b(_0x32be6e);});}function updateOpenchannelInteraction(_0x509ff3,_0x31fdd0,_0x25f64c){return new BPromise(function(_0x176632,_0x35fc2a){return getInteractionUsers(_0x509ff3,_0x25f64c)[_0x18a6('0x2d')](function(_0x46fb2d){return getInteractionTags(_0x46fb2d,_0x31fdd0);})[_0x18a6('0x2d')](function(_0x4348f7){return getStateInteraction(_0x4348f7);})['then'](function(_0x5e22ba){_0x176632(_0x5e22ba);})[_0x18a6('0x39')](function(_0x2a7a52){_0x35fc2a(_0x2a7a52);});});}function getStateInteraction(_0x484c07){return new BPromise(function(_0x4be578){_0x484c07[_0x18a6('0x3a')]=0x0;_0x484c07[_0x18a6('0x3b')]=0x0;_0x484c07[_0x18a6('0x3c')]=0x0;_0x484c07['unmanaged']=0x0;_0x484c07[_0x18a6('0x3d')]=0x0;if(!_0x484c07['closed']&&!_0x484c07[_0x18a6('0x3e')]){_0x484c07[_0x18a6('0x3a')]+=0x1;}if(!_0x484c07[_0x18a6('0x3f')]&&_0x484c07[_0x18a6('0x3e')]){_0x484c07[_0x18a6('0x3b')]+=0x1;if(_0x484c07[_0x18a6('0x3a')]){_0x484c07[_0x18a6('0x3a')]-=0x1;}}if(_0x484c07['closed']&&_0x484c07[_0x18a6('0x3e')]){_0x484c07[_0x18a6('0x3c')]+=0x1;if(_0x484c07[_0x18a6('0x3b')]){_0x484c07[_0x18a6('0x3b')]-=0x1;}}if(_0x484c07[_0x18a6('0x3f')]&&!_0x484c07[_0x18a6('0x3e')]){_0x484c07['unmanaged']+=0x1;if(_0x484c07[_0x18a6('0x3a')]){_0x484c07['waiting']-=0x1;}}_0x484c07[_0x18a6('0x3d')]+=0x1;_0x4be578(_0x484c07);});}exports['index']=function(_0x541b60,_0x5471fc){var _0x5db713={},_0x29a066={},_0x26ff65={'count':0x0,'rows':[]};var _0x591d03=_[_0x18a6('0x40')](db['OpenchannelInteraction'][_0x18a6('0x41')],function(_0x184cbc){return{'name':_0x184cbc[_0x18a6('0x42')],'type':_0x184cbc[_0x18a6('0x43')][_0x18a6('0x44')]};});_0x29a066[_0x18a6('0x45')]=_[_0x18a6('0x40')](_0x591d03,_0x18a6('0x31'));_0x29a066[_0x18a6('0x46')]=_[_0x18a6('0x47')](_0x541b60[_0x18a6('0x46')]);_0x29a066[_0x18a6('0x48')]=_[_0x18a6('0x49')](_0x29a066[_0x18a6('0x45')],_0x29a066[_0x18a6('0x46')]);_0x5db713['attributes']=_[_0x18a6('0x49')](_0x29a066[_0x18a6('0x45')],qs[_0x18a6('0x4a')](_0x541b60[_0x18a6('0x46')][_0x18a6('0x4a')]));_0x5db713[_0x18a6('0x4b')]=_0x5db713[_0x18a6('0x4b')][_0x18a6('0x4c')]?_0x5db713[_0x18a6('0x4b')]:_0x29a066[_0x18a6('0x45')];if(!_0x541b60[_0x18a6('0x46')]['hasOwnProperty'](_0x18a6('0x4d'))){_0x5db713[_0x18a6('0x27')]=qs[_0x18a6('0x27')](_0x541b60[_0x18a6('0x46')][_0x18a6('0x27')]);_0x5db713['offset']=qs[_0x18a6('0x25')](_0x541b60[_0x18a6('0x46')][_0x18a6('0x25')]);}_0x5db713[_0x18a6('0x4e')]=qs['sort'](_0x541b60['query'][_0x18a6('0x4f')]);_0x5db713[_0x18a6('0x50')]=qs[_0x18a6('0x48')](_[_0x18a6('0x51')](_0x541b60[_0x18a6('0x46')],_0x29a066[_0x18a6('0x48')]),_0x591d03);var _0xdcfa9c=[];var _0x10f008=squel[_0x18a6('0x52')]()[_0x18a6('0x53')]('id')[_0x18a6('0x53')](_0x18a6('0x31'))[_0x18a6('0x53')](_0x18a6('0x54'))[_0x18a6('0x55')](_0x18a6('0x56'));var _0x875dbe=squel[_0x18a6('0x52')]()[_0x18a6('0x53')](_0x18a6('0x57'))['field'](_0x18a6('0x58'))[_0x18a6('0x53')](_0x18a6('0x59'))[_0x18a6('0x55')](_0x18a6('0x5a'),'ui')['left_join']('users','u',_0x18a6('0x5b'));var _0x35cb21=squel['select']()['from'](_0x18a6('0x5c'),'i')[_0x18a6('0x5d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x18a6('0x5d')](_0x18a6('0x5e'),'o',_0x18a6('0x5f'))[_0x18a6('0x5d')](_0x18a6('0x60'),'a',_0x18a6('0x61'))[_0x18a6('0x5d')](_0x18a6('0x62'),'me',_0x18a6('0x63'))[_0x18a6('0x5d')](_0x18a6('0x64'),'it',_0x18a6('0x65'))[_0x18a6('0x5d')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x6b0456=squel[_0x18a6('0x66')]();var _0x4d3a87=[];var _0x13ec07=squel[_0x18a6('0x66')]();var _0x55ba50;if(_0x541b60['query']['search']){_0x55ba50=as[_0x18a6('0x67')](_0x541b60[_0x18a6('0x46')]['search']);var _0x451ff9=_0x55ba50['sqlOperator'];for(var _0x51c211=0x0;_0x51c211<_0x55ba50[_0x18a6('0x68')][_0x18a6('0x4c')];_0x51c211++){var _0x41abd4=_0x55ba50['conditions'][_0x51c211];var _0x2fc3d8='i';var _0x243fec=_[_0x18a6('0x69')](_0x591d03,[_0x18a6('0x31'),_0x41abd4['field']]);if(!_0x243fec){switch(_0x41abd4[_0x18a6('0x53')]){case _0x18a6('0x6a'):if(_0x41abd4[_0x18a6('0x6b')]==0x1){_0x35cb21[_0x18a6('0x6c')]('`'+_0x41abd4[_0x18a6('0x53')]+'`\x20=\x200');}else{_0x35cb21[_0x18a6('0x6c')]('`'+_0x41abd4[_0x18a6('0x53')]+_0x18a6('0x6d'));}break;case _0x18a6('0x6e'):if(_0x41abd4[_0x18a6('0x6f')]===_0x18a6('0x70')){if(_0x41abd4['value'][_0x18a6('0x71')]('\x20')[_0x18a6('0x4c')]>0x1){_0x6b0456[_0x451ff9](_0x18a6('0x72'),qs[_0x18a6('0x73')](_0x41abd4[_0x18a6('0x6b')]),null);}else{var _0x23d797='%'+_0x41abd4[_0x18a6('0x6b')]+'%';_0x6b0456[_0x451ff9]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x23d797,_0x23d797,_0x23d797);}}else{_0x243fec=_[_0x18a6('0x69')](_0x591d03,[_0x18a6('0x31'),_0x18a6('0x74')]);_0x41abd4[_0x18a6('0x53')]=_0x18a6('0x74');_0x6ca1c6=as[_0x18a6('0x75')](_0x2fc3d8,_0x243fec[_0x18a6('0x43')],_0x41abd4);_0x6b0456[_0x451ff9](_0x6ca1c6[_0x18a6('0x76')],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x77')],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x23')]);}break;case _0x18a6('0x78'):var _0x6840fd=_0x41abd4[_0x18a6('0x6b')][_0x18a6('0x71')](',')[_0x18a6('0x40')](function(_0x277c53){return Number(_0x277c53);});_0x6840fd[_0x18a6('0x36')](function(_0x1bc57f){_0x13ec07['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bc57f+',%');});_0x4d3a87=_[_0x18a6('0x79')](_0x4d3a87,_0x6840fd);break;case _0x18a6('0x7a'):if(_0x41abd4[_0x18a6('0x6f')]==='$substring'){_0x6b0456[_0x451ff9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x41abd4['value']+'%',null);}else{_0x243fec=_[_0x18a6('0x69')](_0x591d03,['name',_0x18a6('0x3e')]);_0x41abd4['field']=_0x18a6('0x3e');_0x6ca1c6=as['buildExpression'](_0x2fc3d8,_0x243fec[_0x18a6('0x43')],_0x41abd4);_0x6b0456[_0x451ff9](_0x6ca1c6[_0x18a6('0x76')],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x77')],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x23')]);}break;case'body':_0x6ca1c6=as[_0x18a6('0x75')]('me',null,_0x41abd4);_0x6b0456[_0x451ff9](_0x6ca1c6[_0x18a6('0x76')],_0x6ca1c6[_0x18a6('0x6b')]['start'],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x23')]);break;}}else{var _0x6ca1c6=as[_0x18a6('0x75')](_0x2fc3d8,_0x243fec[_0x18a6('0x43')],_0x41abd4);_0x6b0456[_0x451ff9](_0x6ca1c6[_0x18a6('0x76')],_0x6ca1c6['value']['start'],_0x6ca1c6[_0x18a6('0x6b')][_0x18a6('0x23')]);}}}else{var _0x51c8e6=_(_0x541b60['query'])['keys']()[_0x18a6('0x40')](function(_0x3ac40a){return _['some'](_0x591d03,[_0x18a6('0x31'),_0x3ac40a])?_0x3ac40a:undefined;})[_0x18a6('0x7b')]()['value']();if(!_[_0x18a6('0x7c')](_0x51c8e6)){_0x51c8e6[_0x18a6('0x36')](function(_0xfa23cb){if(_0xfa23cb===_0x18a6('0x7d')){_0x35cb21[_0x18a6('0x50')](_0x18a6('0x7e'),[][_0x18a6('0x7f')](_0x541b60[_0x18a6('0x46')][_0xfa23cb]));}else if(_0xfa23cb==='createdAt'){var _0x33758c=JSON[_0x18a6('0x80')](_0x541b60['query'][_0xfa23cb])[_0x18a6('0x81')];var _0x3e64d6=JSON['parse'](_0x541b60[_0x18a6('0x46')][_0xfa23cb])[_0x18a6('0x82')];_0x35cb21[_0x18a6('0x50')](_0x18a6('0x83'),_0x33758c,_0x3e64d6);}else{if(_0x541b60[_0x18a6('0x46')][_0xfa23cb]===_0x18a6('0x84')){_0x35cb21['where']('i.'+_0xfa23cb+'\x20IS\x20NULL');}else{_0x35cb21[_0x18a6('0x50')]('i.'+_0xfa23cb+_0x18a6('0x85'),_0x541b60['query'][_0xfa23cb]);}}});}if(_0x541b60[_0x18a6('0x46')][_0x18a6('0x86')]){if(_0x541b60[_0x18a6('0x46')][_0x18a6('0x86')]==0x1){_0x35cb21['having'](_0x18a6('0x87'));}else{_0x35cb21[_0x18a6('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x541b60['query'][_0x18a6('0x88')]){_0x4d3a87=_[_0x18a6('0x89')](_0x541b60['query'][_0x18a6('0x88')])?_0x541b60[_0x18a6('0x46')]['tag']:new Array(_0x541b60[_0x18a6('0x46')][_0x18a6('0x88')]);_0x4d3a87[_0x18a6('0x36')](function(_0x47b6ef){_0x13ec07['or'](_0x18a6('0x8a'),'%,'+_0x47b6ef+',%');});}if(_0x541b60[_0x18a6('0x46')][_0x18a6('0x8b')]){var _0x5118ab=_0x541b60['query'][_0x18a6('0x8b')][_0x18a6('0x8c')]('\x5c','\x5c\x5c')[_0x18a6('0x8c')](/'/g,'\x27\x27');if(qs[_0x18a6('0x8d')](_0x5118ab)){_0x6b0456['or'](_0x18a6('0x8e'),_0x5118ab+'%');}else{_0x6b0456['or'](_0x18a6('0x8f'),qs[_0x18a6('0x73')](_0x5118ab))['or']('i.from\x20LIKE\x20?',_0x5118ab+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5118ab+'%');}}}_0x35cb21['where'](_0x6b0456);_0x35cb21[_0x18a6('0x90')](_0x18a6('0x91'));var _0x4aa980={'type':db[_0x18a6('0x92')][_0x18a6('0x93')][_0x18a6('0x94')],'raw':!![]};var _0x5efab4=_0x35cb21[_0x18a6('0x95')]();_0x5efab4[_0x18a6('0x53')](_0x18a6('0x91'));_0x5efab4[_0x18a6('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5db713['order']){_0x5db713['order'][_0x18a6('0x36')](function(_0x45dd66){var _0x2d1cdd=_0x45dd66[0x0]==='contactName'?_0x45dd66[0x0]:'i.'+_0x45dd66[0x0];_0x35cb21[_0x18a6('0x4e')](_0x2d1cdd,_0x45dd66[0x1]===_0x18a6('0x96')?![]:!![]);});}if(!_[_0x18a6('0x7c')](_0x4d3a87)){_0x35cb21['having'](_0x13ec07);_0x5efab4[_0x18a6('0x50')](_0x18a6('0x97'),_0x4d3a87);}BPromise['resolve']()['then'](function(){if(!_0x55ba50){if(_0x541b60[_0x18a6('0x46')]['OpenchannelAccountId'])return;_0x5efab4[_0x18a6('0x50')](_0x18a6('0x98'));_0x35cb21[_0x18a6('0x50')](_0x18a6('0x98'));return;}if(_0x541b60[_0x18a6('0x99')]['role']!==_0x18a6('0x9a'))return;return _0x541b60[_0x18a6('0x99')][_0x18a6('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b083b){if(_['isEmpty'](_0x1b083b)){_0x5efab4[_0x18a6('0x50')](_0x18a6('0x9c'));_0x35cb21[_0x18a6('0x50')](_0x18a6('0x9c'));}else{_0x5efab4[_0x18a6('0x50')](_0x18a6('0x7e'),_['map'](_0x1b083b,'id'));_0x35cb21[_0x18a6('0x50')](_0x18a6('0x7e'),_[_0x18a6('0x40')](_0x1b083b,'id'));}});})['then'](function(){if(_0x541b60['user'][_0x18a6('0x9d')]===_0x18a6('0x9a')&&!_0x55ba50&&!_0x541b60['query'][_0x18a6('0x7d')])return[];return db[_0x18a6('0x9e')]['query'](_0x5efab4[_0x18a6('0x9f')](),_0x4aa980);})['then'](function(_0x453b99){_0x26ff65[_0x18a6('0x28')]=_0x453b99[_0x18a6('0x4c')];if(_0x26ff65[_0x18a6('0x28')]===0x0)return[];return db[_0x18a6('0x9e')][_0x18a6('0x46')](_0x10f008[_0x18a6('0x9f')](),_0x4aa980)[_0x18a6('0x2d')](function(_0x581238){_0xdcfa9c=_['keyBy'](_0x581238,'id');_0x4aa980=_[_0x18a6('0xa0')](_0x4aa980,{'model':db[_0x18a6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x541b60[_0x18a6('0x46')][_0x18a6('0x4a')]){_0x5db713[_0x18a6('0x4b')][_0x18a6('0x36')](function(_0x129ef3){_0x35cb21[_0x18a6('0x53')]('i.'+_0x129ef3);});}else{_0x35cb21[_0x18a6('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x35cb21[_0x18a6('0x53')](_0x18a6('0xa2'),_0x18a6('0xa3'));_0x35cb21[_0x18a6('0x53')]('a.mandatoryDisposition',_0x18a6('0xa4'));_0x35cb21['field']('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',_0x18a6('0xa5'));_0x35cb21[_0x18a6('0x53')](_0x18a6('0xa6'));_0x35cb21[_0x18a6('0x53')]('c.firstName',_0x18a6('0xa7'));_0x35cb21[_0x18a6('0x53')](_0x18a6('0xa8'),_0x18a6('0xa9'));_0x35cb21[_0x18a6('0x53')](_0x18a6('0xaa'),_0x18a6('0xab'));_0x35cb21['field'](_0x18a6('0xac'),'Contact.phone');_0x35cb21[_0x18a6('0x53')](_0x18a6('0xad'),_0x18a6('0xae'));_0x35cb21['field']('c.fax',_0x18a6('0xaf'));_0x35cb21[_0x18a6('0x53')](_0x18a6('0xb0'),_0x18a6('0xb1'));_0x35cb21[_0x18a6('0x53')]('o.internal',_0x18a6('0xb2'));_0x35cb21[_0x18a6('0x53')](_0x18a6('0xb3'),'TagIds');}if(_0x5db713['limit'])_0x35cb21[_0x18a6('0x27')](_0x5db713[_0x18a6('0x27')]);if(_0x5db713[_0x18a6('0x25')])_0x35cb21[_0x18a6('0x25')](_0x5db713[_0x18a6('0x25')]);return db[_0x18a6('0x9e')][_0x18a6('0x46')](_0x35cb21[_0x18a6('0x9f')](),_0x4aa980);})[_0x18a6('0x2d')](function(_0x70d312){if(_0x70d312[_0x18a6('0x4c')]>0x0)_0x875dbe[_0x18a6('0x50')](_0x18a6('0xb4'),_[_0x18a6('0x40')](_0x70d312,'id'));return db[_0x18a6('0x9e')][_0x18a6('0x46')](_0x875dbe[_0x18a6('0x9f')](),_0x4aa980)[_0x18a6('0x2d')](function(_0x216c41){var _0x4dddb1=_['groupBy'](_0x216c41,_0x18a6('0xb5'));var _0x20240f=[];_0x70d312[_0x18a6('0x36')](function(_0x142f76){_0x20240f['push'](updateOpenchannelInteraction(_0x142f76,_0xdcfa9c,_0x4dddb1));});return BPromise[_0x18a6('0xb6')](_0x20240f);});});})[_0x18a6('0x2d')](function(_0x579dcd){_0x26ff65[_0x18a6('0xb7')]=_0x579dcd;return _0x26ff65;})[_0x18a6('0x2d')](respondWithFilteredResult(_0x5471fc,_0x5db713))[_0x18a6('0x39')](handleError(_0x5471fc,null));};exports['show']=function(_0x516623,_0x1cbf5e){var _0x4977f9={};if(_0x516623[_0x18a6('0x46')][_0x18a6('0x43')]&&_0x516623['query'][_0x18a6('0x43')]===_0x18a6('0x55')){_0x4977f9[_0x18a6('0x55')]=_0x516623[_0x18a6('0xb8')]['id'];}else{_0x4977f9['id']=_0x516623['params']['id'];}var _0x37c7c2={'raw':![],'where':_0x4977f9},_0x1a31ed={};_0x1a31ed['model']=_['keys'](db['OpenchannelInteraction'][_0x18a6('0x41')]);_0x1a31ed[_0x18a6('0x46')]=_['keys'](_0x516623['query']);_0x1a31ed['filters']=_['intersection'](_0x1a31ed[_0x18a6('0x45')],_0x1a31ed[_0x18a6('0x46')]);_0x37c7c2['attributes']=_['intersection'](_0x1a31ed[_0x18a6('0x45')],qs[_0x18a6('0x4a')](_0x516623[_0x18a6('0x46')][_0x18a6('0x4a')]));_0x37c7c2['attributes']=_0x37c7c2['attributes'][_0x18a6('0x4c')]?_0x37c7c2['attributes']:_0x1a31ed['model'];if(_0x516623[_0x18a6('0x46')][_0x18a6('0xb9')]){_0x37c7c2[_0x18a6('0xba')]=[{'all':!![]}];}_0x37c7c2=_['merge']({},_0x37c7c2,_0x516623['options']);return db[_0x18a6('0xa1')][_0x18a6('0x69')](_0x37c7c2)[_0x18a6('0x2d')](handleEntityNotFound(_0x1cbf5e,null))[_0x18a6('0x2d')](respondWithResult(_0x1cbf5e,null))[_0x18a6('0x39')](handleError(_0x1cbf5e,null));};exports[_0x18a6('0xbb')]=function(_0x260018,_0x33ea67){return db[_0x18a6('0xa1')][_0x18a6('0xbb')](_0x260018[_0x18a6('0xbc')],{})[_0x18a6('0x2d')](respondWithResult(_0x33ea67,0xc9))[_0x18a6('0x39')](handleError(_0x33ea67,null));};exports[_0x18a6('0x2c')]=function(_0x1ded8f,_0x5c7b5e){if(_0x1ded8f[_0x18a6('0xbc')]['id']){delete _0x1ded8f[_0x18a6('0xbc')]['id'];}return db[_0x18a6('0xa1')]['find']({'where':{'id':_0x1ded8f[_0x18a6('0xb8')]['id']}})[_0x18a6('0x2d')](handleEntityNotFound(_0x5c7b5e,null))[_0x18a6('0x2d')](saveUpdates(_0x1ded8f[_0x18a6('0xbc')],null))['then'](respondWithResult(_0x5c7b5e,null))['catch'](handleError(_0x5c7b5e,null));};exports[_0x18a6('0x2e')]=function(_0x30d90b,_0x167545){return db[_0x18a6('0xa1')]['find']({'where':{'id':_0x30d90b[_0x18a6('0xb8')]['id']}})['then'](handleEntityNotFound(_0x167545,null))[_0x18a6('0x2d')](removeEntity(_0x167545,null))[_0x18a6('0x39')](handleError(_0x167545,null));};exports[_0x18a6('0xbd')]=function(_0x3e9ed7,_0x47d7bb){return db[_0x18a6('0xa1')][_0x18a6('0xbd')]()[_0x18a6('0x2d')](respondWithResult(_0x47d7bb,null))[_0x18a6('0x39')](handleError(_0x47d7bb,null));};exports[_0x18a6('0xbe')]=function(_0x2bfae6,_0x350983,_0x15f285){return db[_0x18a6('0xbf')][_0x18a6('0x69')]({'where':{'id':_0x2bfae6[_0x18a6('0xb8')]['id']}})[_0x18a6('0x2d')](handleEntityNotFound(_0x350983,null))['then'](function(_0x143409){if(_0x143409){return _0x143409[_0x18a6('0xbe')](_0x2bfae6[_0x18a6('0xbc')]['ids'],_[_0x18a6('0xc0')](_0x2bfae6[_0x18a6('0xbc')],[_0x18a6('0xc1'),'id'])||{});}})[_0x18a6('0x2d')](respondWithResult(_0x350983,null))[_0x18a6('0x39')](handleError(_0x350983,null));};exports[_0x18a6('0xc2')]=function(_0x39e2f3,_0x42f95e,_0x4b447f){var _0x37c538={'raw':![],'where':{}};var _0xf1b736={};var _0x59cde7={'count':0x0,'rows':[]};return db[_0x18a6('0xa1')][_0x18a6('0xc3')]({'where':{'id':_0x39e2f3['params']['id']}})[_0x18a6('0x2d')](handleEntityNotFound(_0x42f95e,null))[_0x18a6('0x2d')](function(_0x18c8d3){if(_0x18c8d3){_0xf1b736[_0x18a6('0x45')]=_[_0x18a6('0x47')](db[_0x18a6('0xbf')][_0x18a6('0x41')]);_0xf1b736[_0x18a6('0x46')]=_[_0x18a6('0x47')](_0x39e2f3['query']);_0xf1b736[_0x18a6('0x48')]=_[_0x18a6('0x49')](_0xf1b736[_0x18a6('0x45')],_0xf1b736[_0x18a6('0x46')]);_0x37c538['attributes']=_['intersection'](_0xf1b736['model'],qs[_0x18a6('0x4a')](_0x39e2f3['query']['fields']));_0x37c538[_0x18a6('0x4b')]=_0x37c538[_0x18a6('0x4b')]['length']?_0x37c538[_0x18a6('0x4b')]:_0xf1b736[_0x18a6('0x45')];if(!_0x39e2f3[_0x18a6('0x46')][_0x18a6('0xc4')](_0x18a6('0x4d'))){_0x37c538[_0x18a6('0x27')]=qs['limit'](_0x39e2f3[_0x18a6('0x46')][_0x18a6('0x27')]);_0x37c538[_0x18a6('0x25')]=qs[_0x18a6('0x25')](_0x39e2f3['query'][_0x18a6('0x25')]);}_0x37c538[_0x18a6('0x4e')]=qs[_0x18a6('0x4f')](_0x39e2f3['query'][_0x18a6('0x4f')]);_0x37c538[_0x18a6('0x50')]=qs['filters'](_[_0x18a6('0x51')](_0x39e2f3[_0x18a6('0x46')],_0xf1b736['filters']));_0x37c538[_0x18a6('0x50')][_0x18a6('0xb5')]=_0x18c8d3['id'];if(_0x39e2f3[_0x18a6('0x46')][_0x18a6('0x8b')]){_0x37c538[_0x18a6('0x50')]=_[_0x18a6('0xa0')](_0x37c538[_0x18a6('0x50')],{'$or':_[_0x18a6('0x40')](_0x37c538[_0x18a6('0x4b')],function(_0x19cbf4){var _0x11dfc4={};_0x11dfc4[_0x19cbf4]={'$like':'%'+_0x39e2f3[_0x18a6('0x46')][_0x18a6('0x8b')]+'%'};return _0x11dfc4;})});}if(_0x39e2f3['query'][_0x18a6('0x81')]){var _0x1a5721=_0x39e2f3[_0x18a6('0x46')][_0x18a6('0x81')][_0x18a6('0x71')](',');var _0x5eb64a={};_0x5eb64a[_0x1a5721[0x0]]={'$gte':moment(_0x1a5721[0x1])[_0x18a6('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x37c538[_0x18a6('0x50')]=_[_0x18a6('0xa0')](_0x37c538[_0x18a6('0x50')],_0x5eb64a);}_0x37c538=_[_0x18a6('0xa0')]({},_0x37c538,_0x39e2f3['options']);return db['OpenchannelMessage'][_0x18a6('0x28')]({'where':_0x37c538['where']})[_0x18a6('0x2d')](function(_0x4ec55c){_0x59cde7['count']=_0x4ec55c;if(_0x39e2f3[_0x18a6('0x46')][_0x18a6('0xb9')]){_0x37c538[_0x18a6('0xba')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x37c538);})[_0x18a6('0x2d')](function(_0x1ce4b1){_0x59cde7['rows']=_0x1ce4b1;return _0x59cde7;});}})[_0x18a6('0x2d')](respondWithFilteredResult(_0x42f95e,_0x37c538))['catch'](handleError(_0x42f95e,null));};exports[_0x18a6('0xc6')]=function(_0x5f7633,_0x5a1204,_0x2185ad){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5f7633[_0x18a6('0xb8')]['id']}})[_0x18a6('0x2d')](handleEntityNotFound(_0x5a1204,null))['then'](function(_0x42f7c7){if(_0x42f7c7){return _0x42f7c7[_0x18a6('0xc7')](_0x5f7633[_0x18a6('0xbc')][_0x18a6('0xc1')],_[_0x18a6('0xc0')](_0x5f7633[_0x18a6('0xbc')],[_0x18a6('0xc1'),'id'])||{})[_0x18a6('0xc8')](function(){return db[_0x18a6('0x78')]['findAll']({'attributes':['id',_0x18a6('0x31'),'color'],'where':{'id':_0x5f7633[_0x18a6('0xbc')][_0x18a6('0xc1')]}});})[_0x18a6('0x2d')](function(_0x3545db){socket['emit'](_0x18a6('0xc9'),{'id':Number(_0x5f7633[_0x18a6('0xb8')]['id']),'tags':_0x3545db||[]});return{'id':Number(_0x5f7633[_0x18a6('0xb8')]['id']),'tags':_0x3545db||[]};});}})[_0x18a6('0x2d')](respondWithResult(_0x5a1204,null))[_0x18a6('0x39')](handleError(_0x5a1204,null));};exports['removeTags']=function(_0xddb743,_0x436c0f,_0x1ec6fc){return db[_0x18a6('0xa1')][_0x18a6('0x69')]({'where':{'id':_0xddb743[_0x18a6('0xb8')]['id']}})[_0x18a6('0x2d')](handleEntityNotFound(_0x436c0f,null))['then'](function(_0x173cdf){if(_0x173cdf){return _0x173cdf['removeTags'](_0xddb743[_0x18a6('0x46')][_0x18a6('0xc1')]);}})[_0x18a6('0x2d')](respondWithStatusCode(_0x436c0f,null))['catch'](handleError(_0x436c0f,null));};exports[_0x18a6('0xca')]=function(_0x44ba3b,_0x457815){var _0x5e6107=moment()[_0x18a6('0xcb')]()[_0x18a6('0x9f')]();var _0x473d55=path[_0x18a6('0xcc')](config[_0x18a6('0xcd')],'server',_0x18a6('0xce'),_0x18a6('0xcf'));var _0x56110d=path['join'](config[_0x18a6('0xcd')],_0x18a6('0xd0'),_0x18a6('0xce'),_0x18a6('0xd1'));var _0x19238c=path['join'](_0x473d55,_0x5e6107);var _0x3c67ef=util[_0x18a6('0xc5')]('transcript-%d-%s.zip',_0x44ba3b[_0x18a6('0xb8')]['id'],_0x5e6107);var _0x3e7531=path['join'](_0x473d55,_0x3c67ef);var _0x243398=[];_0x243398['push']({'model':db[_0x18a6('0x7a')],'as':'User','attributes':['id',_0x18a6('0x34')],'raw':!![]});_0x243398[_0x18a6('0x38')]({'model':db[_0x18a6('0xd2')],'as':_0x18a6('0x6e'),'attributes':['id',_0x18a6('0xd3'),_0x18a6('0xd4')],'raw':!![]});if(_0x44ba3b[_0x18a6('0x46')][_0x18a6('0xd1')]){_0x243398[_0x18a6('0x38')]({'model':db[_0x18a6('0xd5')],'as':_0x18a6('0xd5'),'raw':!![]});}var _0x42287c=[{'model':db[_0x18a6('0xbf')],'as':_0x18a6('0xd6'),'attributes':['id',_0x18a6('0xbc'),'createdAt',_0x18a6('0xd7'),_0x18a6('0xd8'),_0x18a6('0x86')],'include':_0x243398}];_0x42287c['push']({'model':db[_0x18a6('0xd9')],'as':_0x18a6('0xda'),'attributes':['id','name']});_0x42287c['push']({'model':db[_0x18a6('0x7a')],'as':_0x18a6('0xdb'),'attributes':['id',_0x18a6('0x34')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x44ba3b[_0x18a6('0xb8')]['id']},'include':_0x42287c})[_0x18a6('0x2d')](handleEntityNotFound(_0x457815,null))[_0x18a6('0x2d')](function(_0x4b7862){if(_0x4b7862){var _0x942bad=_0x4b7862[_0x18a6('0xdc')]({'plain':!![]});fs[_0x18a6('0xdd')](_0x19238c);var _0x38f005={'channel':_0x18a6('0xde'),'account':_0x942bad['Account'][_0x18a6('0x31')],'agent':_0x942bad[_0x18a6('0xdb')]?_0x942bad['Owner'][_0x18a6('0x34')]:_0x18a6('0xdf'),'createdAt':moment(_0x942bad['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x18a6('0x9f')](),'closedAt':_0x942bad[_0x18a6('0x3f')]?moment(_0x942bad[_0x18a6('0xe0')])[_0x18a6('0xc5')](_0x18a6('0xe1'))['toString']():'','disposition':_0x942bad['disposition'],'visibility':_0x942bad[_0x18a6('0xe2')]?_0x18a6('0xe3'):_0x18a6('0xe4'),'messages':_(_0x942bad[_0x18a6('0xd6')])[_0x18a6('0x8b')]({'secret':![]})[_0x18a6('0x40')](function(_0x31f304){if(_0x31f304[_0x18a6('0xd5')]){var _0x23e2df=path[_0x18a6('0xcc')](_0x56110d,_0x31f304[_0x18a6('0xd5')]['basename']);if(fs[_0x18a6('0xe5')](_0x23e2df)){fs[_0x18a6('0xe6')](_0x23e2df)[_0x18a6('0xe7')](fs[_0x18a6('0xe8')](path['join'](_0x19238c,_0x31f304[_0x18a6('0xd5')][_0x18a6('0xe9')])));}}return{'date':moment(_0x31f304[_0x18a6('0xea')])[_0x18a6('0xc5')](_0x18a6('0xe1'))[_0x18a6('0x9f')](),'sender':_0x31f304[_0x18a6('0xd7')]===_0x18a6('0xeb')?_0x31f304[_0x18a6('0x7a')]?_0x31f304['User'][_0x18a6('0x34')]:_0x18a6('0xec'):_0x31f304[_0x18a6('0x6e')][_0x18a6('0xd3')]+(_0x31f304[_0x18a6('0x6e')][_0x18a6('0xd4')]?'\x20'+_0x31f304[_0x18a6('0x6e')][_0x18a6('0xd4')]:''),'body':_0x31f304[_0x18a6('0xd5')]?_0x31f304[_0x18a6('0xd5')][_0x18a6('0xe9')]:_0x31f304['body'],'direction':_0x31f304[_0x18a6('0xd7')]===_0x18a6('0xeb')?'A':'C','secret':_0x31f304[_0x18a6('0xd8')],'read':_0x31f304[_0x18a6('0x86')],'attachment':_0x31f304['Attachment']};})[_0x18a6('0x6b')]()};return ejs[_0x18a6('0xed')](path[_0x18a6('0xcc')](config[_0x18a6('0xcd')],_0x18a6('0xd0'),_0x18a6('0xee'),_0x18a6('0xef')),{'interaction':_0x38f005})[_0x18a6('0x2d')](function(_0xa72b99){var _0x5dc6f1=path[_0x18a6('0xcc')](_0x19238c,_0x18a6('0xf0')+_0x942bad['id']+'-'+_0x5e6107+_0x18a6('0xf1'));var _0x10c243={'path':_0x5dc6f1,'channel':'Openchannel','interactionId':_0x942bad['id']};return pdf[_0x18a6('0xf2')](_0xa72b99,_0x10c243);})[_0x18a6('0x2d')](function(){return new BPromise(function(_0x2241c6,_0x2634d8){zipdir(_0x19238c,{'saveTo':_0x3e7531},function(_0x207519,_0x31d0ab){if(_0x207519)return _0x2634d8(_0x207519);return _0x2241c6(_0x31d0ab);});})[_0x18a6('0x2d')](function(){return new BPromise(function(_0x51cb57,_0x503de0){rimraf(_0x19238c,function(_0x121a5b){if(_0x121a5b)_0x503de0(_0x121a5b);return _0x51cb57();});});})[_0x18a6('0x2d')](function(){return _0x457815[_0x18a6('0xca')](_0x3e7531,_0x3c67ef,function(_0x38495f){if(_0x38495f){console['log']('err',_0x38495f);}else{fs[_0x18a6('0xf3')](_0x3e7531);}});});});}else{return _0x457815[_0x18a6('0x21')](0xc8);}})[_0x18a6('0x39')](handleError(_0x457815,null));}; \ No newline at end of file +var _0x5121=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','Tags','split','forEach','push','catch','talking','answered','total','closed','UserId','waiting','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','destroy','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','disposition','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x359b59,_0x38196e){var _0x378405=function(_0x7e3f4c){while(--_0x7e3f4c){_0x359b59['push'](_0x359b59['shift']());}};_0x378405(++_0x38196e);}(_0x5121,0x1dc));var _0x1512=function(_0x586c70,_0x4a8cb3){_0x586c70=_0x586c70-0x0;var _0x26db79=_0x5121[_0x586c70];return _0x26db79;};'use strict';var emlformat=require(_0x1512('0x0'));var rimraf=require(_0x1512('0x1'));var zipdir=require(_0x1512('0x2'));var jsonpatch=require(_0x1512('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1512('0x4'));var Mustache=require('mustache');var util=require(_0x1512('0x5'));var path=require(_0x1512('0x6'));var sox=require(_0x1512('0x7'));var csv=require(_0x1512('0x8'));var ejs=require(_0x1512('0x9'));var fs=require('fs');var fs_extra=require(_0x1512('0xa'));var _=require(_0x1512('0xb'));var squel=require(_0x1512('0xc'));var crypto=require('crypto');var jsforce=require(_0x1512('0xd'));var deskjs=require(_0x1512('0xe'));var toCsv=require(_0x1512('0x8'));var querystring=require('querystring');var Papa=require(_0x1512('0xf'));var Redis=require(_0x1512('0x10'));var authService=require(_0x1512('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1512('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1512('0x13'));var logger=require(_0x1512('0x14'))(_0x1512('0x15'));var utils=require(_0x1512('0x16'));var config=require(_0x1512('0x17'));var licenseUtil=require(_0x1512('0x18'));var db=require('../../mysqldb')['db'];config[_0x1512('0x19')]=_[_0x1512('0x1a')](config[_0x1512('0x19')],{'host':_0x1512('0x1b'),'port':0x18eb});var socket=require(_0x1512('0x1c'))(new Redis(config[_0x1512('0x19')]));require('./openchannelInteraction.socket')[_0x1512('0x1d')](socket);function respondWithStatusCode(_0x2e786d,_0xfdb1c7){_0xfdb1c7=_0xfdb1c7||0xcc;return function(_0x35ed9c){if(_0x35ed9c){return _0x2e786d[_0x1512('0x1e')](_0xfdb1c7);}return _0x2e786d['status'](_0xfdb1c7)[_0x1512('0x1f')]();};}function respondWithResult(_0x3eef33,_0x2e817d){_0x2e817d=_0x2e817d||0xc8;return function(_0x526aa0){if(_0x526aa0){return _0x3eef33[_0x1512('0x20')](_0x2e817d)['json'](_0x526aa0);}};}function respondWithFilteredResult(_0x59feba,_0x2472cf){return function(_0x550e80){if(_0x550e80){var _0x30bf96=typeof _0x2472cf[_0x1512('0x21')]===_0x1512('0x22')&&typeof _0x2472cf['limit']===_0x1512('0x22');var _0x806a6e=_0x550e80[_0x1512('0x23')];var _0x2bbf27=_0x30bf96?0x0:_0x2472cf['offset'];var _0x43138b=_0x30bf96?_0x550e80['count']:_0x2472cf[_0x1512('0x21')]+_0x2472cf[_0x1512('0x24')];var _0x436e1f;if(_0x43138b>=_0x806a6e){_0x43138b=_0x806a6e;_0x436e1f=0xc8;}else{_0x436e1f=0xce;}_0x59feba[_0x1512('0x20')](_0x436e1f);return _0x59feba[_0x1512('0x25')](_0x1512('0x26'),_0x2bbf27+'-'+_0x43138b+'/'+_0x806a6e)[_0x1512('0x27')](_0x550e80);}return null;};}function patchUpdates(_0x400a16){return function(_0x592561){try{jsonpatch[_0x1512('0x28')](_0x592561,_0x400a16,!![]);}catch(_0x49103e){return BPromise[_0x1512('0x29')](_0x49103e);}return _0x592561[_0x1512('0x2a')]();};}function saveUpdates(_0xcc9929,_0x2ee7f1){return function(_0x119166){if(_0x119166){return _0x119166[_0x1512('0x2b')](_0xcc9929)['then'](function(_0x5d55e7){return _0x5d55e7;});}return null;};}function removeEntity(_0x23d9bf,_0x444374){return function(_0x7062c1){if(_0x7062c1){return _0x7062c1['destroy']()[_0x1512('0x2c')](function(){_0x23d9bf[_0x1512('0x20')](0xcc)[_0x1512('0x1f')]();});}};}function handleEntityNotFound(_0x49c90d,_0x2c3323){return function(_0x5cd10b){if(!_0x5cd10b){_0x49c90d[_0x1512('0x1e')](0x194);}return _0x5cd10b;};}function handleError(_0x5fcb09,_0x538fd1){_0x538fd1=_0x538fd1||0x1f4;return function(_0xc42b38){logger[_0x1512('0x2d')](_0xc42b38[_0x1512('0x2e')]);if(_0xc42b38[_0x1512('0x2f')]){delete _0xc42b38[_0x1512('0x2f')];}_0x5fcb09[_0x1512('0x20')](_0x538fd1)[_0x1512('0x30')](_0xc42b38);};}function getInteractionUsers(_0x48d7b9,_0x1dcaad){return new BPromise(function(_0x257254,_0xfa9f56){try{if(_0x1dcaad[_0x48d7b9['id']]){_0x48d7b9[_0x1512('0x31')]=_[_0x1512('0x32')](_0x1dcaad[_0x48d7b9['id']],function(_0x413ffb){return{'id':_0x413ffb['id'],'fullname':_0x413ffb[_0x1512('0x33')]};});}}catch(_0x384638){_0xfa9f56(_0x384638);}_0x257254(_0x48d7b9);});}function getInteractionTags(_0x597484,_0x5e8692){return new BPromise(function(_0x37737b,_0x1254e1){try{if(_0x597484['TagIds']){_0x597484[_0x1512('0x34')]=[];_0x597484['TagIds'][_0x1512('0x35')](',')[_0x1512('0x36')](function(_0x114520){_0x597484['Tags'][_0x1512('0x37')](_0x5e8692[_0x114520]);});}delete _0x597484['TagIds'];}catch(_0x6f7f90){_0x1254e1(_0x6f7f90);}_0x37737b(_0x597484);});}function updateOpenchannelInteraction(_0xeff4a8,_0x45a99f,_0x4b5446){return new BPromise(function(_0x4dfd1b,_0x3def3e){return getInteractionUsers(_0xeff4a8,_0x4b5446)[_0x1512('0x2c')](function(_0x53a700){return getInteractionTags(_0x53a700,_0x45a99f);})['then'](function(_0x3a28e0){return getStateInteraction(_0x3a28e0);})['then'](function(_0x45fda1){_0x4dfd1b(_0x45fda1);})[_0x1512('0x38')](function(_0x11dbe1){_0x3def3e(_0x11dbe1);});});}function getStateInteraction(_0x52dba6){return new BPromise(function(_0x3a28c4){_0x52dba6['waiting']=0x0;_0x52dba6[_0x1512('0x39')]=0x0;_0x52dba6[_0x1512('0x3a')]=0x0;_0x52dba6['unmanaged']=0x0;_0x52dba6[_0x1512('0x3b')]=0x0;if(!_0x52dba6[_0x1512('0x3c')]&&!_0x52dba6[_0x1512('0x3d')]){_0x52dba6[_0x1512('0x3e')]+=0x1;}if(!_0x52dba6[_0x1512('0x3c')]&&_0x52dba6['UserId']){_0x52dba6['talking']+=0x1;if(_0x52dba6[_0x1512('0x3e')]){_0x52dba6[_0x1512('0x3e')]-=0x1;}}if(_0x52dba6[_0x1512('0x3c')]&&_0x52dba6[_0x1512('0x3d')]){_0x52dba6[_0x1512('0x3a')]+=0x1;if(_0x52dba6[_0x1512('0x39')]){_0x52dba6[_0x1512('0x39')]-=0x1;}}if(_0x52dba6[_0x1512('0x3c')]&&!_0x52dba6[_0x1512('0x3d')]){_0x52dba6['unmanaged']+=0x1;if(_0x52dba6[_0x1512('0x3e')]){_0x52dba6['waiting']-=0x1;}}_0x52dba6['total']+=0x1;_0x3a28c4(_0x52dba6);});}exports[_0x1512('0x3f')]=function(_0x193507,_0x198cad){var _0x339c71={},_0x4a5bc9={},_0x36479a={'count':0x0,'rows':[]};var _0x24a711=_[_0x1512('0x32')](db[_0x1512('0x40')][_0x1512('0x41')],function(_0x48d31e){return{'name':_0x48d31e[_0x1512('0x42')],'type':_0x48d31e[_0x1512('0x43')][_0x1512('0x44')]};});_0x4a5bc9[_0x1512('0x45')]=_[_0x1512('0x32')](_0x24a711,_0x1512('0x2f'));_0x4a5bc9['query']=_[_0x1512('0x46')](_0x193507[_0x1512('0x47')]);_0x4a5bc9[_0x1512('0x48')]=_[_0x1512('0x49')](_0x4a5bc9[_0x1512('0x45')],_0x4a5bc9[_0x1512('0x47')]);_0x339c71[_0x1512('0x4a')]=_[_0x1512('0x49')](_0x4a5bc9[_0x1512('0x45')],qs[_0x1512('0x4b')](_0x193507[_0x1512('0x47')][_0x1512('0x4b')]));_0x339c71['attributes']=_0x339c71['attributes'][_0x1512('0x4c')]?_0x339c71[_0x1512('0x4a')]:_0x4a5bc9[_0x1512('0x45')];if(!_0x193507[_0x1512('0x47')]['hasOwnProperty'](_0x1512('0x4d'))){_0x339c71[_0x1512('0x24')]=qs[_0x1512('0x24')](_0x193507[_0x1512('0x47')]['limit']);_0x339c71[_0x1512('0x21')]=qs[_0x1512('0x21')](_0x193507[_0x1512('0x47')][_0x1512('0x21')]);}_0x339c71['order']=qs[_0x1512('0x4e')](_0x193507[_0x1512('0x47')][_0x1512('0x4e')]);_0x339c71[_0x1512('0x4f')]=qs[_0x1512('0x48')](_[_0x1512('0x50')](_0x193507[_0x1512('0x47')],_0x4a5bc9['filters']),_0x24a711);var _0x1a30a8=[];var _0x57981d=squel[_0x1512('0x51')]()[_0x1512('0x52')]('id')[_0x1512('0x52')](_0x1512('0x2f'))[_0x1512('0x52')](_0x1512('0x53'))[_0x1512('0x54')](_0x1512('0x55'));var _0x114e4e=squel[_0x1512('0x51')]()[_0x1512('0x52')](_0x1512('0x56'))[_0x1512('0x52')](_0x1512('0x57'))[_0x1512('0x52')]('ui.OpenchannelInteractionId')['from'](_0x1512('0x58'),'ui')[_0x1512('0x59')]('users','u',_0x1512('0x5a'));var _0x312976=squel[_0x1512('0x51')]()[_0x1512('0x54')]('openchannel_interactions','i')['left_join'](_0x1512('0x5b'),'c',_0x1512('0x5c'))['left_join'](_0x1512('0x5d'),'o',_0x1512('0x5e'))[_0x1512('0x59')](_0x1512('0x5f'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x1512('0x59')](_0x1512('0x60'),'me',_0x1512('0x61'))[_0x1512('0x59')]('openchannel_interaction_has_tags','it',_0x1512('0x62'))['left_join'](_0x1512('0x55'),'t','t.id\x20=\x20it.TagId');var _0x3650ea=squel[_0x1512('0x63')]();var _0x43fc56=[];var _0x21598e=squel['expr']();var _0x28e01b;if(_0x193507[_0x1512('0x47')][_0x1512('0x64')]){_0x28e01b=as[_0x1512('0x65')](_0x193507[_0x1512('0x47')]['search']);var _0x15510c=_0x28e01b['sqlOperator'];for(var _0x67c073=0x0;_0x67c073<_0x28e01b[_0x1512('0x66')][_0x1512('0x4c')];_0x67c073++){var _0x5f154d=_0x28e01b[_0x1512('0x66')][_0x67c073];var _0x37f300='i';var _0x553c22=_[_0x1512('0x67')](_0x24a711,[_0x1512('0x2f'),_0x5f154d[_0x1512('0x52')]]);if(!_0x553c22){switch(_0x5f154d[_0x1512('0x52')]){case'unreadMessages':if(_0x5f154d[_0x1512('0x68')]==0x1){_0x312976['having']('`'+_0x5f154d[_0x1512('0x52')]+_0x1512('0x69'));}else{_0x312976[_0x1512('0x6a')]('`'+_0x5f154d[_0x1512('0x52')]+_0x1512('0x6b'));}break;case _0x1512('0x6c'):if(_0x5f154d[_0x1512('0x6d')]==='$substring'){if(_0x5f154d[_0x1512('0x68')]['split']('\x20')[_0x1512('0x4c')]>0x1){_0x3650ea[_0x15510c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1512('0x6e')](_0x5f154d[_0x1512('0x68')]),null);}else{var _0x460857='%'+_0x5f154d[_0x1512('0x68')]+'%';_0x3650ea[_0x15510c](_0x1512('0x6f'),_0x460857,_0x460857,_0x460857);}}else{_0x553c22=_[_0x1512('0x67')](_0x24a711,[_0x1512('0x2f'),_0x1512('0x70')]);_0x5f154d['field']=_0x1512('0x70');_0x53c240=as['buildExpression'](_0x37f300,_0x553c22['type'],_0x5f154d);_0x3650ea[_0x15510c](_0x53c240[_0x1512('0x71')],_0x53c240[_0x1512('0x68')][_0x1512('0x72')],_0x53c240['value'][_0x1512('0x1f')]);}break;case'Tag':var _0x1db57f=_0x5f154d[_0x1512('0x68')][_0x1512('0x35')](',')['map'](function(_0x31573d){return Number(_0x31573d);});_0x1db57f[_0x1512('0x36')](function(_0xec7ae2){_0x21598e['or'](_0x1512('0x73'),'%,'+_0xec7ae2+',%');});_0x43fc56=_['union'](_0x43fc56,_0x1db57f);break;case _0x1512('0x74'):if(_0x5f154d['operator']==='$substring'){_0x3650ea[_0x15510c](_0x1512('0x75'),'%'+_0x5f154d[_0x1512('0x68')]+'%',null);}else{_0x553c22=_[_0x1512('0x67')](_0x24a711,[_0x1512('0x2f'),_0x1512('0x3d')]);_0x5f154d[_0x1512('0x52')]=_0x1512('0x3d');_0x53c240=as[_0x1512('0x76')](_0x37f300,_0x553c22[_0x1512('0x43')],_0x5f154d);_0x3650ea[_0x15510c](_0x53c240[_0x1512('0x71')],_0x53c240[_0x1512('0x68')][_0x1512('0x72')],_0x53c240[_0x1512('0x68')]['end']);}break;case _0x1512('0x77'):_0x53c240=as[_0x1512('0x76')]('me',null,_0x5f154d);_0x3650ea[_0x15510c](_0x53c240[_0x1512('0x71')],_0x53c240[_0x1512('0x68')][_0x1512('0x72')],_0x53c240[_0x1512('0x68')][_0x1512('0x1f')]);break;}}else{var _0x53c240=as[_0x1512('0x76')](_0x37f300,_0x553c22[_0x1512('0x43')],_0x5f154d);_0x3650ea[_0x15510c](_0x53c240[_0x1512('0x71')],_0x53c240['value'][_0x1512('0x72')],_0x53c240[_0x1512('0x68')][_0x1512('0x1f')]);}}}else{var _0xa34039=_(_0x193507[_0x1512('0x47')])[_0x1512('0x46')]()[_0x1512('0x32')](function(_0xdbc2f){return _[_0x1512('0x78')](_0x24a711,[_0x1512('0x2f'),_0xdbc2f])?_0xdbc2f:undefined;})[_0x1512('0x79')]()[_0x1512('0x68')]();if(!_[_0x1512('0x7a')](_0xa34039)){_0xa34039[_0x1512('0x36')](function(_0x4922ff){if(_0x4922ff==='OpenchannelAccountId'){_0x312976[_0x1512('0x4f')](_0x1512('0x7b'),[][_0x1512('0x7c')](_0x193507['query'][_0x4922ff]));}else if(_0x4922ff===_0x1512('0x7d')){var _0x3ee5f1=JSON[_0x1512('0x7e')](_0x193507[_0x1512('0x47')][_0x4922ff])[_0x1512('0x7f')];var _0x1a420a=JSON[_0x1512('0x7e')](_0x193507[_0x1512('0x47')][_0x4922ff])[_0x1512('0x80')];_0x312976[_0x1512('0x4f')](_0x1512('0x81'),_0x3ee5f1,_0x1a420a);}else{if(_0x193507[_0x1512('0x47')][_0x4922ff]===_0x1512('0x82')){_0x312976['where']('i.'+_0x4922ff+_0x1512('0x83'));}else{_0x312976['where']('i.'+_0x4922ff+'\x20=\x20?',_0x193507[_0x1512('0x47')][_0x4922ff]);}}});}if(_0x193507[_0x1512('0x47')][_0x1512('0x84')]){if(_0x193507['query'][_0x1512('0x84')]==0x1){_0x312976[_0x1512('0x6a')](_0x1512('0x85'));}else{_0x312976['having'](_0x1512('0x86'));}}if(_0x193507[_0x1512('0x47')][_0x1512('0x87')]){_0x43fc56=_[_0x1512('0x88')](_0x193507[_0x1512('0x47')][_0x1512('0x87')])?_0x193507['query'][_0x1512('0x87')]:new Array(_0x193507[_0x1512('0x47')]['tag']);_0x43fc56[_0x1512('0x36')](function(_0x471c35){_0x21598e['or'](_0x1512('0x73'),'%,'+_0x471c35+',%');});}if(_0x193507[_0x1512('0x47')]['filter']){var _0x34f331=_0x193507['query'][_0x1512('0x89')][_0x1512('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1512('0x8b')](_0x34f331)){_0x3650ea['or'](_0x1512('0x8c'),_0x34f331+'%');}else{_0x3650ea['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x34f331))['or']('i.from\x20LIKE\x20?',_0x34f331+'%')['or'](_0x1512('0x8d'),_0x34f331+'%');}}}_0x312976[_0x1512('0x4f')](_0x3650ea);_0x312976[_0x1512('0x8e')](_0x1512('0x8f'));var _0x127800={'type':db['Sequelize'][_0x1512('0x90')][_0x1512('0x91')],'raw':!![]};var _0x57679b=_0x312976[_0x1512('0x92')]();_0x57679b[_0x1512('0x52')](_0x1512('0x8f'));_0x57679b['field'](_0x1512('0x93'),_0x1512('0x94'));if(_0x339c71[_0x1512('0x95')]){_0x339c71[_0x1512('0x95')][_0x1512('0x36')](function(_0x1e629d){var _0x4619ba=_0x1e629d[0x0]===_0x1512('0x96')?_0x1e629d[0x0]:'i.'+_0x1e629d[0x0];_0x312976[_0x1512('0x95')](_0x4619ba,_0x1e629d[0x1]===_0x1512('0x97')?![]:!![]);});}if(!_[_0x1512('0x7a')](_0x43fc56)){_0x312976[_0x1512('0x6a')](_0x21598e);_0x57679b['where'](_0x1512('0x98'),_0x43fc56);}BPromise['resolve']()[_0x1512('0x2c')](function(){if(!_0x28e01b){if(_0x193507[_0x1512('0x47')][_0x1512('0x99')])return;_0x57679b[_0x1512('0x4f')](_0x1512('0x9a'));_0x312976['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x193507[_0x1512('0x9b')][_0x1512('0x9c')]!==_0x1512('0x9d'))return;return _0x193507[_0x1512('0x9b')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x1512('0x2c')](function(_0x17fd74){if(_['isEmpty'](_0x17fd74)){_0x57679b[_0x1512('0x4f')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x312976[_0x1512('0x4f')](_0x1512('0x9e'));}else{_0x57679b['where'](_0x1512('0x7b'),_['map'](_0x17fd74,'id'));_0x312976[_0x1512('0x4f')](_0x1512('0x7b'),_[_0x1512('0x32')](_0x17fd74,'id'));}});})['then'](function(){if(_0x193507[_0x1512('0x9b')]['role']===_0x1512('0x9d')&&!_0x28e01b&&!_0x193507[_0x1512('0x47')][_0x1512('0x99')])return[];return db['sequelize'][_0x1512('0x47')](_0x57679b[_0x1512('0x9f')](),_0x127800);})[_0x1512('0x2c')](function(_0x531777){_0x36479a['count']=_0x531777[_0x1512('0x4c')];if(_0x36479a['count']===0x0)return[];return db[_0x1512('0xa0')][_0x1512('0x47')](_0x57981d['toString'](),_0x127800)['then'](function(_0x3d74b4){_0x1a30a8=_[_0x1512('0xa1')](_0x3d74b4,'id');_0x127800=_[_0x1512('0xa2')](_0x127800,{'model':db[_0x1512('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x193507[_0x1512('0x47')][_0x1512('0x4b')]){_0x339c71[_0x1512('0x4a')][_0x1512('0x36')](function(_0x117047){_0x312976[_0x1512('0x52')]('i.'+_0x117047);});}else{_0x312976[_0x1512('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1512('0x94'));_0x312976[_0x1512('0x52')](_0x1512('0xa3'),'Account.key');_0x312976['field'](_0x1512('0xa4'),_0x1512('0xa5'));_0x312976[_0x1512('0x52')]('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');_0x312976[_0x1512('0x52')](_0x1512('0xa6'));_0x312976['field'](_0x1512('0xa7'),_0x1512('0xa8'));_0x312976['field']('c.lastName',_0x1512('0xa9'));_0x312976[_0x1512('0x52')](_0x1512('0xaa'),_0x1512('0xab'));_0x312976[_0x1512('0x52')](_0x1512('0xac'),_0x1512('0xad'));_0x312976['field'](_0x1512('0xae'),_0x1512('0xaf'));_0x312976[_0x1512('0x52')](_0x1512('0xb0'),'Contact.fax');_0x312976[_0x1512('0x52')]('o.fullname',_0x1512('0xb1'));_0x312976[_0x1512('0x52')](_0x1512('0xb2'),_0x1512('0xb3'));_0x312976[_0x1512('0x52')](_0x1512('0xb4'),_0x1512('0xb5'));}if(_0x339c71[_0x1512('0x24')])_0x312976['limit'](_0x339c71[_0x1512('0x24')]);if(_0x339c71[_0x1512('0x21')])_0x312976[_0x1512('0x21')](_0x339c71[_0x1512('0x21')]);return db[_0x1512('0xa0')][_0x1512('0x47')](_0x312976[_0x1512('0x9f')](),_0x127800);})['then'](function(_0x1ed086){if(_0x1ed086[_0x1512('0x4c')]>0x0)_0x114e4e[_0x1512('0x4f')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x1512('0x32')](_0x1ed086,'id'));return db[_0x1512('0xa0')][_0x1512('0x47')](_0x114e4e[_0x1512('0x9f')](),_0x127800)[_0x1512('0x2c')](function(_0x2b20ca){var _0x3e40a5=_[_0x1512('0xb6')](_0x2b20ca,_0x1512('0xb7'));var _0x32a832=[];_0x1ed086['forEach'](function(_0x26e623){_0x32a832[_0x1512('0x37')](updateOpenchannelInteraction(_0x26e623,_0x1a30a8,_0x3e40a5));});return BPromise[_0x1512('0xb8')](_0x32a832);});});})[_0x1512('0x2c')](function(_0x5ad7f6){_0x36479a[_0x1512('0xb9')]=_0x5ad7f6;return _0x36479a;})[_0x1512('0x2c')](respondWithFilteredResult(_0x198cad,_0x339c71))[_0x1512('0x38')](handleError(_0x198cad,null));};exports[_0x1512('0xba')]=function(_0x52a2d5,_0x12f8c8){var _0xf9f3ac={};if(_0x52a2d5[_0x1512('0x47')][_0x1512('0x43')]&&_0x52a2d5[_0x1512('0x47')]['type']===_0x1512('0x54')){_0xf9f3ac['from']=_0x52a2d5[_0x1512('0xbb')]['id'];}else{_0xf9f3ac['id']=_0x52a2d5[_0x1512('0xbb')]['id'];}var _0x4eba0c={'raw':![],'where':_0xf9f3ac},_0x7250bb={};_0x7250bb[_0x1512('0x45')]=_[_0x1512('0x46')](db[_0x1512('0x40')][_0x1512('0x41')]);_0x7250bb[_0x1512('0x47')]=_[_0x1512('0x46')](_0x52a2d5['query']);_0x7250bb[_0x1512('0x48')]=_[_0x1512('0x49')](_0x7250bb['model'],_0x7250bb[_0x1512('0x47')]);_0x4eba0c[_0x1512('0x4a')]=_['intersection'](_0x7250bb[_0x1512('0x45')],qs[_0x1512('0x4b')](_0x52a2d5['query'][_0x1512('0x4b')]));_0x4eba0c['attributes']=_0x4eba0c[_0x1512('0x4a')][_0x1512('0x4c')]?_0x4eba0c[_0x1512('0x4a')]:_0x7250bb[_0x1512('0x45')];if(_0x52a2d5[_0x1512('0x47')][_0x1512('0xbc')]){_0x4eba0c[_0x1512('0xbd')]=[{'all':!![]}];}_0x4eba0c=_[_0x1512('0xa2')]({},_0x4eba0c,_0x52a2d5[_0x1512('0xbe')]);return db[_0x1512('0x40')]['find'](_0x4eba0c)[_0x1512('0x2c')](handleEntityNotFound(_0x12f8c8,null))[_0x1512('0x2c')](respondWithResult(_0x12f8c8,null))['catch'](handleError(_0x12f8c8,null));};exports[_0x1512('0xbf')]=function(_0x475223,_0x5b84e0){return db[_0x1512('0x40')][_0x1512('0xbf')](_0x475223[_0x1512('0x77')],{})[_0x1512('0x2c')](respondWithResult(_0x5b84e0,0xc9))[_0x1512('0x38')](handleError(_0x5b84e0,null));};exports[_0x1512('0x2b')]=function(_0x5dfbbf,_0x40f0a3){if(_0x5dfbbf['body']['id']){delete _0x5dfbbf[_0x1512('0x77')]['id'];}return db['OpenchannelInteraction'][_0x1512('0x67')]({'where':{'id':_0x5dfbbf[_0x1512('0xbb')]['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x40f0a3,null))[_0x1512('0x2c')](saveUpdates(_0x5dfbbf[_0x1512('0x77')],null))[_0x1512('0x2c')](respondWithResult(_0x40f0a3,null))[_0x1512('0x38')](handleError(_0x40f0a3,null));};exports[_0x1512('0xc0')]=function(_0x22fa41,_0x443fee){return db[_0x1512('0x40')][_0x1512('0x67')]({'where':{'id':_0x22fa41[_0x1512('0xbb')]['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x443fee,null))['then'](removeEntity(_0x443fee,null))[_0x1512('0x38')](handleError(_0x443fee,null));};exports['describe']=function(_0x5e18be,_0x3dbee3){return db[_0x1512('0x40')][_0x1512('0xc1')]()[_0x1512('0x2c')](respondWithResult(_0x3dbee3,null))[_0x1512('0x38')](handleError(_0x3dbee3,null));};exports[_0x1512('0xc2')]=function(_0x547c37,_0x514eab,_0x1cdc3a){return db['OpenchannelMessage'][_0x1512('0x67')]({'where':{'id':_0x547c37['params']['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x514eab,null))[_0x1512('0x2c')](function(_0x4d2a41){if(_0x4d2a41){return _0x4d2a41['addMessage'](_0x547c37[_0x1512('0x77')][_0x1512('0xc3')],_[_0x1512('0xc4')](_0x547c37['body'],[_0x1512('0xc3'),'id'])||{});}})[_0x1512('0x2c')](respondWithResult(_0x514eab,null))[_0x1512('0x38')](handleError(_0x514eab,null));};exports[_0x1512('0xc5')]=function(_0x30265b,_0x479182,_0x5f0991){var _0x541d69={'raw':![],'where':{}};var _0x467c01={};var _0x43c50d={'count':0x0,'rows':[]};return db[_0x1512('0x40')][_0x1512('0xc6')]({'where':{'id':_0x30265b[_0x1512('0xbb')]['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x479182,null))[_0x1512('0x2c')](function(_0x137d43){if(_0x137d43){_0x467c01[_0x1512('0x45')]=_[_0x1512('0x46')](db[_0x1512('0xc7')][_0x1512('0x41')]);_0x467c01[_0x1512('0x47')]=_[_0x1512('0x46')](_0x30265b['query']);_0x467c01[_0x1512('0x48')]=_[_0x1512('0x49')](_0x467c01[_0x1512('0x45')],_0x467c01[_0x1512('0x47')]);_0x541d69[_0x1512('0x4a')]=_['intersection'](_0x467c01[_0x1512('0x45')],qs[_0x1512('0x4b')](_0x30265b[_0x1512('0x47')][_0x1512('0x4b')]));_0x541d69[_0x1512('0x4a')]=_0x541d69[_0x1512('0x4a')][_0x1512('0x4c')]?_0x541d69[_0x1512('0x4a')]:_0x467c01['model'];if(!_0x30265b[_0x1512('0x47')]['hasOwnProperty'](_0x1512('0x4d'))){_0x541d69[_0x1512('0x24')]=qs[_0x1512('0x24')](_0x30265b[_0x1512('0x47')][_0x1512('0x24')]);_0x541d69[_0x1512('0x21')]=qs[_0x1512('0x21')](_0x30265b[_0x1512('0x47')][_0x1512('0x21')]);}_0x541d69[_0x1512('0x95')]=qs[_0x1512('0x4e')](_0x30265b[_0x1512('0x47')][_0x1512('0x4e')]);_0x541d69[_0x1512('0x4f')]=qs['filters'](_[_0x1512('0x50')](_0x30265b[_0x1512('0x47')],_0x467c01['filters']));_0x541d69[_0x1512('0x4f')][_0x1512('0xb7')]=_0x137d43['id'];if(_0x30265b[_0x1512('0x47')]['filter']){_0x541d69[_0x1512('0x4f')]=_[_0x1512('0xa2')](_0x541d69[_0x1512('0x4f')],{'$or':_[_0x1512('0x32')](_0x541d69[_0x1512('0x4a')],function(_0x3c4b24){var _0x1753af={};_0x1753af[_0x3c4b24]={'$like':'%'+_0x30265b[_0x1512('0x47')][_0x1512('0x89')]+'%'};return _0x1753af;})});}if(_0x30265b['query'][_0x1512('0x7f')]){var _0x16217e=_0x30265b['query'][_0x1512('0x7f')]['split'](',');var _0x2756a1={};_0x2756a1[_0x16217e[0x0]]={'$gte':moment(_0x16217e[0x1])[_0x1512('0xc8')](_0x1512('0xc9'))};_0x541d69[_0x1512('0x4f')]=_['merge'](_0x541d69[_0x1512('0x4f')],_0x2756a1);}_0x541d69=_['merge']({},_0x541d69,_0x30265b[_0x1512('0xbe')]);return db['OpenchannelMessage'][_0x1512('0x23')]({'where':_0x541d69[_0x1512('0x4f')]})['then'](function(_0x39e988){_0x43c50d['count']=_0x39e988;if(_0x30265b[_0x1512('0x47')][_0x1512('0xbc')]){_0x541d69[_0x1512('0xbd')]=[{'all':!![]}];}return db[_0x1512('0xc7')][_0x1512('0xca')](_0x541d69);})[_0x1512('0x2c')](function(_0x2a9a05){_0x43c50d['rows']=_0x2a9a05;return _0x43c50d;});}})['then'](respondWithFilteredResult(_0x479182,_0x541d69))[_0x1512('0x38')](handleError(_0x479182,null));};exports[_0x1512('0xcb')]=function(_0x3bd982,_0x4453ef,_0xf3c5d5){return db[_0x1512('0x40')]['find']({'where':{'id':_0x3bd982[_0x1512('0xbb')]['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x4453ef,null))[_0x1512('0x2c')](function(_0x4825b3){if(_0x4825b3){return _0x4825b3['setTags'](_0x3bd982[_0x1512('0x77')]['ids'],_[_0x1512('0xc4')](_0x3bd982[_0x1512('0x77')],[_0x1512('0xc3'),'id'])||{})['spread'](function(){return db[_0x1512('0xcc')][_0x1512('0xca')]({'attributes':['id',_0x1512('0x2f'),_0x1512('0x53')],'where':{'id':_0x3bd982[_0x1512('0x77')][_0x1512('0xc3')]}});})[_0x1512('0x2c')](function(_0x3a90eb){socket[_0x1512('0xcd')](_0x1512('0xce'),{'id':Number(_0x3bd982[_0x1512('0xbb')]['id']),'tags':_0x3a90eb||[]});return{'id':Number(_0x3bd982['params']['id']),'tags':_0x3a90eb||[]};});}})[_0x1512('0x2c')](respondWithResult(_0x4453ef,null))[_0x1512('0x38')](handleError(_0x4453ef,null));};exports[_0x1512('0xcf')]=function(_0x80e280,_0x481562,_0x288403){return db['OpenchannelInteraction'][_0x1512('0x67')]({'where':{'id':_0x80e280[_0x1512('0xbb')]['id']}})[_0x1512('0x2c')](handleEntityNotFound(_0x481562,null))['then'](function(_0x494d18){if(_0x494d18){return _0x494d18[_0x1512('0xcf')](_0x80e280[_0x1512('0x47')][_0x1512('0xc3')]);}})[_0x1512('0x2c')](respondWithStatusCode(_0x481562,null))[_0x1512('0x38')](handleError(_0x481562,null));};exports[_0x1512('0xd0')]=function(_0x1358ee,_0x2e5ba6){var _0x423203=moment()[_0x1512('0xd1')]()[_0x1512('0x9f')]();var _0x3ce729=path['join'](config[_0x1512('0xd2')],_0x1512('0xd3'),_0x1512('0xd4'),_0x1512('0xd5'));var _0x57a147=path[_0x1512('0xd6')](config[_0x1512('0xd2')],_0x1512('0xd3'),_0x1512('0xd4'),'attachments');var _0x298b21=path['join'](_0x3ce729,_0x423203);var _0x239da8=util[_0x1512('0xc8')](_0x1512('0xd7'),_0x1358ee[_0x1512('0xbb')]['id'],_0x423203);var _0x3e1726=path[_0x1512('0xd6')](_0x3ce729,_0x239da8);var _0x4b9af8=[];_0x4b9af8['push']({'model':db['User'],'as':_0x1512('0x74'),'attributes':['id','fullname'],'raw':!![]});_0x4b9af8[_0x1512('0x37')]({'model':db[_0x1512('0xd8')],'as':_0x1512('0x6c'),'attributes':['id',_0x1512('0xd9'),_0x1512('0xda')],'raw':!![]});if(_0x1358ee[_0x1512('0x47')]['attachments']){_0x4b9af8[_0x1512('0x37')]({'model':db[_0x1512('0xdb')],'as':'Attachment','raw':!![]});}var _0x21c45b=[{'model':db[_0x1512('0xc7')],'as':'Messages','attributes':['id','body',_0x1512('0x7d'),'direction',_0x1512('0xdc'),_0x1512('0x84')],'include':_0x4b9af8}];_0x21c45b['push']({'model':db[_0x1512('0xdd')],'as':_0x1512('0xde'),'attributes':['id','name']});_0x21c45b[_0x1512('0x37')]({'model':db[_0x1512('0x74')],'as':_0x1512('0xdf'),'attributes':['id',_0x1512('0x33')]});return db[_0x1512('0x40')]['find']({'where':{'id':_0x1358ee[_0x1512('0xbb')]['id']},'include':_0x21c45b})[_0x1512('0x2c')](handleEntityNotFound(_0x2e5ba6,null))[_0x1512('0x2c')](function(_0x273659){if(_0x273659){var _0x1d9bef=_0x273659['get']({'plain':!![]});fs[_0x1512('0xe0')](_0x298b21);var _0x1d463c={'channel':_0x1512('0xe1'),'account':_0x1d9bef[_0x1512('0xde')][_0x1512('0x2f')],'agent':_0x1d9bef[_0x1512('0xdf')]?_0x1d9bef[_0x1512('0xdf')][_0x1512('0x33')]:_0x1512('0xe2'),'createdAt':moment(_0x1d9bef['createdAt'])[_0x1512('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1d9bef[_0x1512('0x3c')]?moment(_0x1d9bef['closedAt'])[_0x1512('0xc8')](_0x1512('0xc9'))[_0x1512('0x9f')]():'','disposition':_0x1d9bef[_0x1512('0xe3')],'visibility':_0x1d9bef['threadId']?_0x1512('0xe4'):_0x1512('0xe5'),'messages':_(_0x1d9bef[_0x1512('0xe6')])[_0x1512('0x89')]({'secret':![]})[_0x1512('0x32')](function(_0x53c6b2){if(_0x53c6b2[_0x1512('0xdb')]){var _0x8036a8=path['join'](_0x57a147,_0x53c6b2[_0x1512('0xdb')][_0x1512('0xe7')]);if(fs['existsSync'](_0x8036a8)){fs[_0x1512('0xe8')](_0x8036a8)[_0x1512('0xe9')](fs[_0x1512('0xea')](path[_0x1512('0xd6')](_0x298b21,_0x53c6b2[_0x1512('0xdb')]['basename'])));}}return{'date':moment(_0x53c6b2['createdAt'])[_0x1512('0xc8')](_0x1512('0xc9'))['toString'](),'sender':_0x53c6b2[_0x1512('0xeb')]===_0x1512('0xec')?_0x53c6b2['User']?_0x53c6b2[_0x1512('0x74')]['fullname']:_0x1512('0xed'):_0x53c6b2[_0x1512('0x6c')][_0x1512('0xd9')]+(_0x53c6b2[_0x1512('0x6c')][_0x1512('0xda')]?'\x20'+_0x53c6b2['Contact']['lastName']:''),'body':_0x53c6b2[_0x1512('0xdb')]?_0x53c6b2[_0x1512('0xdb')][_0x1512('0xe7')]:_0x53c6b2[_0x1512('0x77')],'direction':_0x53c6b2[_0x1512('0xeb')]===_0x1512('0xec')?'A':'C','secret':_0x53c6b2[_0x1512('0xdc')],'read':_0x53c6b2[_0x1512('0x84')],'attachment':_0x53c6b2['Attachment']};})[_0x1512('0x68')]()};return ejs[_0x1512('0xee')](path['join'](config[_0x1512('0xd2')],'server',_0x1512('0xef'),_0x1512('0xf0')),{'interaction':_0x1d463c})['then'](function(_0x15fc83){var _0x568348=path[_0x1512('0xd6')](_0x298b21,_0x1512('0xf1')+_0x1d9bef['id']+'-'+_0x423203+_0x1512('0xf2'));var _0x7435ed={'path':_0x568348,'channel':_0x1512('0xe1'),'interactionId':_0x1d9bef['id']};return pdf[_0x1512('0xf3')](_0x15fc83,_0x7435ed);})[_0x1512('0x2c')](function(){return new BPromise(function(_0xa149dc,_0x56d062){zipdir(_0x298b21,{'saveTo':_0x3e1726},function(_0x1ff54c,_0x1f5709){if(_0x1ff54c)return _0x56d062(_0x1ff54c);return _0xa149dc(_0x1f5709);});})[_0x1512('0x2c')](function(){return new BPromise(function(_0x256322,_0x158842){rimraf(_0x298b21,function(_0x5a5a8f){if(_0x5a5a8f)_0x158842(_0x5a5a8f);return _0x256322();});});})[_0x1512('0x2c')](function(){return _0x2e5ba6[_0x1512('0xd0')](_0x3e1726,_0x239da8,function(_0xf94863){if(_0xf94863){console[_0x1512('0xf4')](_0x1512('0xf5'),_0xf94863);}else{fs[_0x1512('0xf6')](_0x3e1726);}});});});}else{return _0x2e5ba6['sendStatus'](0xc8);}})[_0x1512('0x38')](handleError(_0x2e5ba6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 941e6e7..1c49e0c 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 _0xe983=['events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','emit','catch','hasOwnProperty','exports'];(function(_0xdddbae,_0x50e704){var _0x58185a=function(_0x43f3bc){while(--_0x43f3bc){_0xdddbae['push'](_0xdddbae['shift']());}};_0x58185a(++_0x50e704);}(_0xe983,0x13b));var _0x3e98=function(_0x167a55,_0x131541){_0x167a55=_0x167a55-0x0;var _0x277be2=_0xe983[_0x167a55];return _0x277be2;};'use strict';var EventEmitter=require(_0x3e98('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3e98('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x3e98('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3e98('0x3')](0x0);var events={'afterCreate':_0x3e98('0x4'),'afterUpdate':_0x3e98('0x5'),'afterDestroy':_0x3e98('0x6')};function emitEvent(_0x4e696a){return function(_0x9337f2,_0x5870e2,_0x4daf1e){_0x9337f2['getUsers']({'attributes':['id'],'raw':!![]})[_0x3e98('0x7')](function(_0x5570a7){_0x9337f2[_0x3e98('0x8')]('Users',_0x5570a7[_0x3e98('0x9')](function(_0x5760ec){return{'id':_0x5760ec['id']};}));return OpenchannelMessage[_0x3e98('0xa')]({'where':{'OpenchannelInteractionId':_0x9337f2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3e98('0x7')](function(_0x5d1cba){_0x9337f2[_0x3e98('0x8')]('unreadMessages',_0x5d1cba['length']);OpenchannelInteractionEvents[_0x3e98('0xb')](_0x4e696a+':'+_0x9337f2['id'],_0x9337f2);OpenchannelInteractionEvents[_0x3e98('0xb')](_0x4e696a,_0x9337f2);_0x4daf1e(null);})[_0x3e98('0xc')](_0x4daf1e(null));};}for(var e in events){if(events[_0x3e98('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x3e98('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1345=['OpenchannelMessage','save','update','remove','getUsers','then','Users','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x51ab27,_0xfb56d4){var _0xcd1fda=function(_0x12d44a){while(--_0x12d44a){_0x51ab27['push'](_0x51ab27['shift']());}};_0xcd1fda(++_0xfb56d4);}(_0x1345,0x149));var _0x5134=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0x1345[_0x77d286];return _0x5446a5;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x5134('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x5134('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5134('0x2'),'afterUpdate':_0x5134('0x3'),'afterDestroy':_0x5134('0x4')};function emitEvent(_0x40d995){return function(_0x134541,_0x59f3a5,_0x528318){_0x134541[_0x5134('0x5')]({'attributes':['id'],'raw':!![]})[_0x5134('0x6')](function(_0xbb66b9){_0x134541['setDataValue'](_0x5134('0x7'),_0xbb66b9['map'](function(_0x461375){return{'id':_0x461375['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x134541['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5134('0x6')](function(_0x2cfe44){_0x134541[_0x5134('0x8')](_0x5134('0x9'),_0x2cfe44[_0x5134('0xa')]);OpenchannelInteractionEvents[_0x5134('0xb')](_0x40d995+':'+_0x134541['id'],_0x134541);OpenchannelInteractionEvents[_0x5134('0xb')](_0x40d995,_0x134541);_0x528318(null);})['catch'](_0x528318(null));};}for(var e in events){if(events[_0x5134('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x5134('0xd')](e,emitEvent(event));}}module[_0x5134('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 36f7746..acb8bf8 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 _0xb2e6=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4cbe98,_0x576f7b){var _0x49c755=function(_0x1e0487){while(--_0x1e0487){_0x4cbe98['push'](_0x4cbe98['shift']());}};_0x49c755(++_0x576f7b);}(_0xb2e6,0xc6));var _0x6b2e=function(_0x3f1ca4,_0x41f71f){_0x3f1ca4=_0x3f1ca4-0x0;var _0x36b193=_0xb2e6[_0x3f1ca4];return _0x36b193;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b2e('0x2'));var BPromise=require(_0x6b2e('0x3'));var rp=require(_0x6b2e('0x4'));var fs=require('fs');var path=require(_0x6b2e('0x5'));var rimraf=require('rimraf');var config=require(_0x6b2e('0x6'));var attributes=require(_0x6b2e('0x7'));module['exports']=function(_0x44b034,_0x10351a){return _0x44b034['define'](_0x6b2e('0x8'),attributes,{'tableName':_0x6b2e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b2e('0xa'),'collate':_0x6b2e('0xb'),'hooks':{'beforeUpdate':function(_0x35c79c,_0x48f743,_0x5aaa9a){if(_0x35c79c[_0x6b2e('0xc')]('closed')){_0x35c79c[_0x6b2e('0xd')]=moment()['format'](_0x6b2e('0xe'));}_0x5aaa9a(null,_0x35c79c);}}});}; \ No newline at end of file +var _0x3be6=['OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x53144f,_0x536f37){var _0x19b52b=function(_0x275c1c){while(--_0x275c1c){_0x53144f['push'](_0x53144f['shift']());}};_0x19b52b(++_0x536f37);}(_0x3be6,0x13a));var _0x63be=function(_0x217372,_0x1822ce){_0x217372=_0x217372-0x0;var _0x2715a1=_0x3be6[_0x217372];return _0x2715a1;};'use strict';var _=require(_0x63be('0x0'));var util=require(_0x63be('0x1'));var logger=require('../../config/logger')(_0x63be('0x2'));var moment=require(_0x63be('0x3'));var BPromise=require(_0x63be('0x4'));var rp=require(_0x63be('0x5'));var fs=require('fs');var path=require(_0x63be('0x6'));var rimraf=require(_0x63be('0x7'));var config=require(_0x63be('0x8'));var attributes=require(_0x63be('0x9'));module['exports']=function(_0x24901d,_0x30ca93){return _0x24901d['define'](_0x63be('0xa'),attributes,{'tableName':_0x63be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x63be('0xc'),'hooks':{'beforeUpdate':function(_0x3a257a,_0x458dd6,_0x22be86){if(_0x3a257a[_0x63be('0xd')](_0x63be('0xe'))){_0x3a257a[_0x63be('0xf')]=moment()[_0x63be('0x10')](_0x63be('0x11'));}_0x22be86(null,_0x3a257a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 9539e50..7c45a0b 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 _0xdf65=['then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','UpdateOpenchannelInteraction','update','body','options','raw','attributes','limit','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request'];(function(_0x1a01d1,_0x1b0c7a){var _0xb5eee9=function(_0x2c41de){while(--_0x2c41de){_0x1a01d1['push'](_0x1a01d1['shift']());}};_0xb5eee9(++_0x1b0c7a);}(_0xdf65,0x160));var _0x5df6=function(_0x573135,_0x4eca78){_0x573135=_0x573135-0x0;var _0x8355d2=_0xdf65[_0x573135];return _0x8355d2;};'use strict';var _=require(_0x5df6('0x0'));var util=require(_0x5df6('0x1'));var moment=require('moment');var BPromise=require(_0x5df6('0x2'));var rs=require(_0x5df6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df6('0x4'))['db'];var utils=require(_0x5df6('0x5'));var logger=require(_0x5df6('0x6'))(_0x5df6('0x7'));var config=require('../../config/environment');var jayson=require(_0x5df6('0x8'));var client=jayson[_0x5df6('0x9')][_0x5df6('0xa')]({'port':0x232a});config[_0x5df6('0xb')]=_['defaults'](config[_0x5df6('0xb')],{'host':_0x5df6('0xc'),'port':0x18eb});var socket=require(_0x5df6('0xd'))(new Redis(config[_0x5df6('0xb')]));require(_0x5df6('0xe'))[_0x5df6('0xf')](socket);function respondWithRpcPromise(_0x4843f4,_0x216dad,_0x5a550e){return new BPromise(function(_0x2d011b,_0x9f8ea7){return client[_0x5df6('0x10')](_0x4843f4,_0x5a550e)[_0x5df6('0x11')](function(_0x19088a){logger[_0x5df6('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x216dad,_0x5df6('0x13'));logger[_0x5df6('0x14')](_0x5df6('0x15'),_0x216dad,'request\x20sent',JSON[_0x5df6('0x16')](_0x19088a));if(_0x19088a[_0x5df6('0x17')]){if(_0x19088a[_0x5df6('0x17')][_0x5df6('0x18')]===0x1f4){logger[_0x5df6('0x17')](_0x5df6('0x19'),_0x216dad,_0x19088a[_0x5df6('0x17')][_0x5df6('0x1a')]);return _0x9f8ea7(_0x19088a['error'][_0x5df6('0x1a')]);}logger['error'](_0x5df6('0x19'),_0x216dad,_0x19088a[_0x5df6('0x17')][_0x5df6('0x1a')]);return _0x2d011b(_0x19088a[_0x5df6('0x17')][_0x5df6('0x1a')]);}else{logger['info'](_0x5df6('0x19'),_0x216dad,_0x5df6('0x13'));_0x2d011b(_0x19088a['result'][_0x5df6('0x1a')]);}})['catch'](function(_0x463e9a){logger[_0x5df6('0x17')](_0x5df6('0x19'),_0x216dad,_0x463e9a);_0x9f8ea7(_0x463e9a);});});}exports[_0x5df6('0x1b')]=function(_0x508417){var _0x52edd2=this;return new Promise(function(_0x277eb2,_0x3b872d){return db['OpenchannelInteraction'][_0x5df6('0x1c')](_0x508417[_0x5df6('0x1d')],{'raw':_0x508417['options']?_0x508417[_0x5df6('0x1e')][_0x5df6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x508417[_0x5df6('0x1e')]?_0x508417[_0x5df6('0x1e')]['where']||null:null,'attributes':_0x508417[_0x5df6('0x1e')]?_0x508417[_0x5df6('0x1e')][_0x5df6('0x20')]||null:null,'limit':_0x508417[_0x5df6('0x1e')]?_0x508417[_0x5df6('0x1e')][_0x5df6('0x21')]||null:null})[_0x5df6('0x11')](function(_0x5239ef){logger['info'](_0x5df6('0x1b'),_0x508417);logger[_0x5df6('0x14')](_0x5df6('0x1b'),_0x508417,JSON[_0x5df6('0x16')](_0x5239ef));_0x277eb2(_0x5239ef);})[_0x5df6('0x22')](function(_0x457fcf){logger[_0x5df6('0x17')](_0x5df6('0x1b'),_0x457fcf[_0x5df6('0x1a')],_0x508417);_0x3b872d(_0x52edd2[_0x5df6('0x17')](0x1f4,_0x457fcf[_0x5df6('0x1a')]));});});};exports[_0x5df6('0x23')]=function(_0x41589c){return new Promise(function(_0x3b279b,_0x2c3a4b){return db[_0x5df6('0x24')][_0x5df6('0x25')]({'where':_0x41589c['options']?_0x41589c['options']['where']||null:null})[_0x5df6('0x11')](function(_0x5da0fd){if(_0x5da0fd){return _0x5da0fd['addTags'](_0x41589c[_0x5df6('0x1d')]['ids'],_[_0x5df6('0x26')](_0x41589c[_0x5df6('0x1d')],['ids','id'])||{});}})[_0x5df6('0x27')](function(_0x1a7e61){logger[_0x5df6('0x12')](_0x5df6('0x28'),_0x41589c);logger[_0x5df6('0x14')](_0x5df6('0x28'),_0x41589c,JSON[_0x5df6('0x16')](_0x1a7e61));_0x3b279b(_0x1a7e61);})['catch'](function(_0x16f33e){logger[_0x5df6('0x17')]('AddTags',_0x16f33e[_0x5df6('0x1a')],_0x41589c);_0x2c3a4b(_this[_0x5df6('0x17')](0x1f4,_0x16f33e[_0x5df6('0x1a')]));});});}; \ No newline at end of file +var _0xdb1b=['socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb1b,0x1d4));var _0xbdb1=function(_0x729ca,_0x4031d7){_0x729ca=_0x729ca-0x0;var _0x396ac4=_0xdb1b[_0x729ca];return _0x396ac4;};'use strict';var _=require(_0xbdb1('0x0'));var util=require(_0xbdb1('0x1'));var moment=require('moment');var BPromise=require(_0xbdb1('0x2'));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(_0xbdb1('0x6'))('rpc');var config=require(_0xbdb1('0x7'));var jayson=require(_0xbdb1('0x8'));var client=jayson[_0xbdb1('0x9')][_0xbdb1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbdb1('0xb'),'port':0x18eb});var socket=require(_0xbdb1('0xc'))(new Redis(config['redis']));require(_0xbdb1('0xd'))['register'](socket);function respondWithRpcPromise(_0x20a47e,_0x3c11bc,_0x29d552){return new BPromise(function(_0x2b8bd6,_0x35f201){return client[_0xbdb1('0xe')](_0x20a47e,_0x29d552)[_0xbdb1('0xf')](function(_0x2fec7e){logger[_0xbdb1('0x10')](_0xbdb1('0x11'),_0x3c11bc,_0xbdb1('0x12'));logger[_0xbdb1('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3c11bc,_0xbdb1('0x12'),JSON[_0xbdb1('0x14')](_0x2fec7e));if(_0x2fec7e[_0xbdb1('0x15')]){if(_0x2fec7e[_0xbdb1('0x15')]['code']===0x1f4){logger[_0xbdb1('0x15')](_0xbdb1('0x11'),_0x3c11bc,_0x2fec7e[_0xbdb1('0x15')][_0xbdb1('0x16')]);return _0x35f201(_0x2fec7e[_0xbdb1('0x15')]['message']);}logger[_0xbdb1('0x15')](_0xbdb1('0x11'),_0x3c11bc,_0x2fec7e[_0xbdb1('0x15')][_0xbdb1('0x16')]);return _0x2b8bd6(_0x2fec7e[_0xbdb1('0x15')]['message']);}else{logger[_0xbdb1('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3c11bc,_0xbdb1('0x12'));_0x2b8bd6(_0x2fec7e[_0xbdb1('0x17')][_0xbdb1('0x16')]);}})[_0xbdb1('0x18')](function(_0x2e5484){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3c11bc,_0x2e5484);_0x35f201(_0x2e5484);});});}exports[_0xbdb1('0x19')]=function(_0x3cab16){var _0x37a53e=this;return new Promise(function(_0x6a94bd,_0x49f340){return db[_0xbdb1('0x1a')][_0xbdb1('0x1b')](_0x3cab16[_0xbdb1('0x1c')],{'raw':_0x3cab16[_0xbdb1('0x1d')]?_0x3cab16[_0xbdb1('0x1d')][_0xbdb1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cab16['options']?_0x3cab16[_0xbdb1('0x1d')][_0xbdb1('0x1f')]||null:null,'attributes':_0x3cab16[_0xbdb1('0x1d')]?_0x3cab16['options'][_0xbdb1('0x20')]||null:null,'limit':_0x3cab16[_0xbdb1('0x1d')]?_0x3cab16[_0xbdb1('0x1d')][_0xbdb1('0x21')]||null:null})[_0xbdb1('0xf')](function(_0x428f5b){logger['info'](_0xbdb1('0x19'),_0x3cab16);logger[_0xbdb1('0x13')]('UpdateOpenchannelInteraction',_0x3cab16,JSON[_0xbdb1('0x14')](_0x428f5b));_0x6a94bd(_0x428f5b);})[_0xbdb1('0x18')](function(_0x3b817b){logger['error']('UpdateOpenchannelInteraction',_0x3b817b['message'],_0x3cab16);_0x49f340(_0x37a53e['error'](0x1f4,_0x3b817b[_0xbdb1('0x16')]));});});};exports[_0xbdb1('0x22')]=function(_0x29f8bb){return new Promise(function(_0xf24524,_0x1daef9){return db[_0xbdb1('0x1a')][_0xbdb1('0x23')]({'where':_0x29f8bb[_0xbdb1('0x1d')]?_0x29f8bb[_0xbdb1('0x1d')][_0xbdb1('0x1f')]||null:null})[_0xbdb1('0xf')](function(_0x3f1e9d){if(_0x3f1e9d){return _0x3f1e9d['addTags'](_0x29f8bb[_0xbdb1('0x1c')]['ids'],_[_0xbdb1('0x24')](_0x29f8bb[_0xbdb1('0x1c')],[_0xbdb1('0x25'),'id'])||{});}})[_0xbdb1('0x26')](function(_0x4c7721){logger['info'](_0xbdb1('0x27'),_0x29f8bb);logger[_0xbdb1('0x13')](_0xbdb1('0x27'),_0x29f8bb,JSON[_0xbdb1('0x14')](_0x4c7721));_0xf24524(_0x4c7721);})[_0xbdb1('0x18')](function(_0x1591c7){logger[_0xbdb1('0x15')]('AddTags',_0x1591c7['message'],_0x29f8bb);_0x1daef9(_this[_0xbdb1('0x15')](0x1f4,_0x1591c7[_0xbdb1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5413a5f..3d87e05 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 _0x36ea=['emit','removeListener','register','openchannelInteraction:','save','remove'];(function(_0x16a7e2,_0x57a943){var _0x555622=function(_0x277d0a){while(--_0x277d0a){_0x16a7e2['push'](_0x16a7e2['shift']());}};_0x555622(++_0x57a943);}(_0x36ea,0x166));var _0xa36e=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x36ea[_0x1f9f5f];return _0x51d649;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xa36e('0x0'),_0xa36e('0x1'),'update'];function createListener(_0x38fa88,_0x4b7953){return function(_0x1cb290){_0x4b7953[_0xa36e('0x2')](_0x38fa88,_0x1cb290);};}function removeListener(_0x5b49a3,_0x457c38){return function(){OpenchannelInteractionEvents[_0xa36e('0x3')](_0x5b49a3,_0x457c38);};}exports[_0xa36e('0x4')]=function(_0x35e19d){for(var _0x5cf9d6=0x0,_0x24e687=events['length'];_0x5cf9d6<_0x24e687;_0x5cf9d6++){var _0x24d355=events[_0x5cf9d6];var _0x55895a=createListener(_0xa36e('0x5')+_0x24d355,_0x35e19d);OpenchannelInteractionEvents['on'](_0x24d355,_0x55895a);}}; \ No newline at end of file +var _0x2c91=['openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x314924,_0x34ce5e){var _0x1334bd=function(_0x502c53){while(--_0x502c53){_0x314924['push'](_0x314924['shift']());}};_0x1334bd(++_0x34ce5e);}(_0x2c91,0x151));var _0x12c9=function(_0x17b65b,_0x5f2f13){_0x17b65b=_0x17b65b-0x0;var _0x1cbbbc=_0x2c91[_0x17b65b];return _0x1cbbbc;};'use strict';var OpenchannelInteractionEvents=require(_0x12c9('0x0'));var events=[_0x12c9('0x1'),_0x12c9('0x2'),'update'];function createListener(_0x2a9754,_0x51f825){return function(_0x902881){_0x51f825[_0x12c9('0x3')](_0x2a9754,_0x902881);};}function removeListener(_0x1cacea,_0x49dbf8){return function(){OpenchannelInteractionEvents[_0x12c9('0x4')](_0x1cacea,_0x49dbf8);};}exports[_0x12c9('0x5')]=function(_0x359d60){for(var _0x220822=0x0,_0x1c9ff5=events[_0x12c9('0x6')];_0x220822<_0x1c9ff5;_0x220822++){var _0x15755b=events[_0x220822];var _0x48f1ce=createListener(_0x12c9('0x7')+_0x15755b,_0x359d60);OpenchannelInteractionEvents['on'](_0x15755b,_0x48f1ce);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index effe50a..fa92d02 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 6a83f35..ffb1097 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 _0xa478=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa478,0x136));var _0x8a47=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0xa478[_0x42ab91];return _0x259d35;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'body':{'type':Sequelize[_0x8a47('0x2')](_0x8a47('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8a47('0x5')]('in',_0x8a47('0x6')),'defaultValue':_0x8a47('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8a47('0x7')]},'providerName':{'type':Sequelize[_0x8a47('0x8')]},'providerResponse':{'type':Sequelize[_0x8a47('0x2')]}}; \ No newline at end of file +var _0xa5fa=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4d3681,_0x136f19){_0x4d3681=_0x4d3681-0x0;var _0x22c7ac=_0xa5fa[_0x4d3681];return _0x22c7ac;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'body':{'type':Sequelize[_0xaa5f('0x1')](_0xaa5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa5f('0x4')]('in',_0xaa5f('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xaa5f('0x6')]},'providerName':{'type':Sequelize[_0xaa5f('0x7')]},'providerResponse':{'type':Sequelize[_0xaa5f('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 09b7f08..ba63c24 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 _0xa661=['debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','contact','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa661,0xf2));var _0x1a66=function(_0x230df3,_0x2a972e){_0x230df3=_0x230df3-0x0;var _0x14c031=_0xa661[_0x230df3];return _0x14c031;};'use strict';var emlformat=require(_0x1a66('0x0'));var rimraf=require(_0x1a66('0x1'));var zipdir=require(_0x1a66('0x2'));var jsonpatch=require(_0x1a66('0x3'));var rp=require('request-promise');var moment=require(_0x1a66('0x4'));var BPromise=require(_0x1a66('0x5'));var Mustache=require(_0x1a66('0x6'));var util=require(_0x1a66('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a66('0x8'));var fs=require('fs');var fs_extra=require(_0x1a66('0x9'));var _=require(_0x1a66('0xa'));var squel=require(_0x1a66('0xb'));var crypto=require(_0x1a66('0xc'));var jsforce=require(_0x1a66('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a66('0xe'));var querystring=require(_0x1a66('0xf'));var Papa=require(_0x1a66('0x10'));var Redis=require('ioredis');var authService=require(_0x1a66('0x11'));var qs=require(_0x1a66('0x12'));var as=require(_0x1a66('0x13'));var hardwareService=require(_0x1a66('0x14'));var logger=require(_0x1a66('0x15'))(_0x1a66('0x16'));var utils=require('../../config/utils');var config=require(_0x1a66('0x17'));var licenseUtil=require(_0x1a66('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1a66('0x19')](config[_0x1a66('0x1a')],{'host':_0x1a66('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a66('0x1a')]));require('./openchannelMessage.socket')[_0x1a66('0x1c')](socket);var jayson=require(_0x1a66('0x1d'));var client=jayson[_0x1a66('0x1e')][_0x1a66('0x1f')]({'port':0x232c});var client9002=jayson[_0x1a66('0x1e')][_0x1a66('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x36e46d,_0x441dc0,_0x3d55a6,_0x871a84){return new BPromise(function(_0x17be94,_0x2029ea){var _0x7a884d=_0x871a84||client;return _0x7a884d[_0x1a66('0x20')](_0x36e46d,_0x3d55a6)['then'](function(_0x5ac2e4){logger[_0x1a66('0x21')](_0x1a66('0x22'),_0x441dc0,_0x1a66('0x23'));logger[_0x1a66('0x24')](_0x1a66('0x25'),_0x441dc0,_0x1a66('0x23'),JSON[_0x1a66('0x26')](_0x5ac2e4));if(_0x5ac2e4[_0x1a66('0x27')]){if(_0x5ac2e4['error'][_0x1a66('0x28')]===0x1f4){logger[_0x1a66('0x27')](_0x1a66('0x22'),_0x441dc0,_0x5ac2e4[_0x1a66('0x27')][_0x1a66('0x29')]);return _0x2029ea(_0x5ac2e4['error']['message']);}logger[_0x1a66('0x27')](_0x1a66('0x22'),_0x441dc0,_0x5ac2e4['error']['message']);return _0x17be94(_0x5ac2e4['error'][_0x1a66('0x29')]);}else{logger[_0x1a66('0x21')](_0x1a66('0x22'),_0x441dc0,'request\x20sent');_0x17be94(_0x5ac2e4[_0x1a66('0x2a')][_0x1a66('0x29')]);}})['catch'](function(_0x130a74){logger[_0x1a66('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x441dc0,_0x130a74);_0x2029ea(_0x130a74);});});}function respondWithStatusCode(_0x2badad,_0x5c5529){_0x5c5529=_0x5c5529||0xcc;return function(_0x4b6109){if(_0x4b6109){return _0x2badad[_0x1a66('0x2b')](_0x5c5529);}return _0x2badad[_0x1a66('0x2c')](_0x5c5529)['end']();};}function respondWithResult(_0x4dec85,_0x1a8bf4){_0x1a8bf4=_0x1a8bf4||0xc8;return function(_0x45f0e8){if(_0x45f0e8){return _0x4dec85['status'](_0x1a8bf4)[_0x1a66('0x2d')](_0x45f0e8);}};}function respondWithFilteredResult(_0x34f3e0,_0x189b0d){return function(_0x2012ec){if(_0x2012ec){var _0xd27353=typeof _0x189b0d[_0x1a66('0x2e')]===_0x1a66('0x2f')&&typeof _0x189b0d[_0x1a66('0x30')]===_0x1a66('0x2f');var _0x5e457f=_0x2012ec[_0x1a66('0x31')];var _0x4bc29e=_0xd27353?0x0:_0x189b0d[_0x1a66('0x2e')];var _0x46a379=_0xd27353?_0x2012ec[_0x1a66('0x31')]:_0x189b0d[_0x1a66('0x2e')]+_0x189b0d[_0x1a66('0x30')];var _0x55fbd7;if(_0x46a379>=_0x5e457f){_0x46a379=_0x5e457f;_0x55fbd7=0xc8;}else{_0x55fbd7=0xce;}_0x34f3e0[_0x1a66('0x2c')](_0x55fbd7);return _0x34f3e0[_0x1a66('0x32')]('Content-Range',_0x4bc29e+'-'+_0x46a379+'/'+_0x5e457f)[_0x1a66('0x2d')](_0x2012ec);}return null;};}function patchUpdates(_0xb38cf4){return function(_0x3f1efb){try{jsonpatch[_0x1a66('0x33')](_0x3f1efb,_0xb38cf4,!![]);}catch(_0x52ec49){return BPromise[_0x1a66('0x34')](_0x52ec49);}return _0x3f1efb[_0x1a66('0x35')]();};}function saveUpdates(_0x1b310d,_0x754ed1){return function(_0x493161){if(_0x493161){return _0x493161[_0x1a66('0x36')](_0x1b310d)[_0x1a66('0x37')](function(_0x28411d){return _0x28411d;});}return null;};}function removeEntity(_0x2b3fb7,_0x4684da){return function(_0x227336){if(_0x227336){return _0x227336[_0x1a66('0x38')]()[_0x1a66('0x37')](function(){_0x2b3fb7[_0x1a66('0x2c')](0xcc)[_0x1a66('0x39')]();});}};}function handleEntityNotFound(_0x4ef317,_0x19971a){return function(_0x214de4){if(!_0x214de4){_0x4ef317[_0x1a66('0x2b')](0x194);}return _0x214de4;};}function handleError(_0x13ac5f,_0x146d12){_0x146d12=_0x146d12||0x1f4;return function(_0x597251){logger['error'](_0x597251[_0x1a66('0x3a')]);if(_0x597251[_0x1a66('0x3b')]){delete _0x597251['name'];}_0x13ac5f[_0x1a66('0x2c')](_0x146d12)[_0x1a66('0x3c')](_0x597251);};}exports[_0x1a66('0x3d')]=function(_0x18fb6a,_0x3242c3){var _0x236682={},_0x1ed8a7={},_0x28e5e4={'count':0x0,'rows':[]};var _0x2b008e=_[_0x1a66('0x3e')](db[_0x1a66('0x3f')][_0x1a66('0x40')],function(_0x29b72f){return{'name':_0x29b72f[_0x1a66('0x41')],'type':_0x29b72f[_0x1a66('0x42')][_0x1a66('0x43')]};});_0x1ed8a7['model']=_[_0x1a66('0x3e')](_0x2b008e,_0x1a66('0x3b'));_0x1ed8a7[_0x1a66('0x44')]=_[_0x1a66('0x45')](_0x18fb6a[_0x1a66('0x44')]);_0x1ed8a7[_0x1a66('0x46')]=_['intersection'](_0x1ed8a7[_0x1a66('0x47')],_0x1ed8a7[_0x1a66('0x44')]);_0x236682[_0x1a66('0x48')]=_[_0x1a66('0x49')](_0x1ed8a7[_0x1a66('0x47')],qs[_0x1a66('0x4a')](_0x18fb6a[_0x1a66('0x44')][_0x1a66('0x4a')]));_0x236682[_0x1a66('0x48')]=_0x236682[_0x1a66('0x48')][_0x1a66('0x4b')]?_0x236682[_0x1a66('0x48')]:_0x1ed8a7[_0x1a66('0x47')];if(!_0x18fb6a[_0x1a66('0x44')][_0x1a66('0x4c')](_0x1a66('0x4d'))){_0x236682[_0x1a66('0x30')]=qs[_0x1a66('0x30')](_0x18fb6a['query'][_0x1a66('0x30')]);_0x236682[_0x1a66('0x2e')]=qs[_0x1a66('0x2e')](_0x18fb6a['query']['offset']);}_0x236682[_0x1a66('0x4e')]=qs[_0x1a66('0x4f')](_0x18fb6a[_0x1a66('0x44')][_0x1a66('0x4f')]);_0x236682['where']=qs[_0x1a66('0x46')](_[_0x1a66('0x50')](_0x18fb6a[_0x1a66('0x44')],_0x1ed8a7[_0x1a66('0x46')]),_0x2b008e);if(_0x18fb6a[_0x1a66('0x44')][_0x1a66('0x51')]){_0x236682[_0x1a66('0x52')]=_[_0x1a66('0x53')](_0x236682[_0x1a66('0x52')],{'$or':_[_0x1a66('0x3e')](_0x2b008e,function(_0x23a7ef){if(_0x23a7ef[_0x1a66('0x42')]!==_0x1a66('0x54')){var _0x4e060e={};_0x4e060e[_0x23a7ef['name']]={'$like':'%'+_0x18fb6a['query']['filter']+'%'};return _0x4e060e;}})});}_0x236682=_[_0x1a66('0x53')]({},_0x236682,_0x18fb6a[_0x1a66('0x55')]);var _0x22e6be={'where':_0x236682[_0x1a66('0x52')]};return db[_0x1a66('0x3f')][_0x1a66('0x31')](_0x22e6be)['then'](function(_0x492e07){_0x28e5e4[_0x1a66('0x31')]=_0x492e07;if(_0x18fb6a[_0x1a66('0x44')][_0x1a66('0x56')]){_0x236682[_0x1a66('0x57')]=[{'all':!![]}];}return db[_0x1a66('0x3f')][_0x1a66('0x58')](_0x236682);})[_0x1a66('0x37')](function(_0x2b73cf){_0x28e5e4[_0x1a66('0x59')]=_0x2b73cf;return _0x28e5e4;})[_0x1a66('0x37')](respondWithFilteredResult(_0x3242c3,_0x236682))[_0x1a66('0x5a')](handleError(_0x3242c3,null));};exports[_0x1a66('0x5b')]=function(_0x4e2593,_0x14b027){var _0x558a4d={'raw':!![],'where':{'id':_0x4e2593[_0x1a66('0x5c')]['id']}},_0xd31448={};_0xd31448['model']=_[_0x1a66('0x45')](db[_0x1a66('0x3f')][_0x1a66('0x40')]);_0xd31448[_0x1a66('0x44')]=_[_0x1a66('0x45')](_0x4e2593[_0x1a66('0x44')]);_0xd31448[_0x1a66('0x46')]=_['intersection'](_0xd31448[_0x1a66('0x47')],_0xd31448[_0x1a66('0x44')]);_0x558a4d[_0x1a66('0x48')]=_[_0x1a66('0x49')](_0xd31448[_0x1a66('0x47')],qs[_0x1a66('0x4a')](_0x4e2593[_0x1a66('0x44')][_0x1a66('0x4a')]));_0x558a4d['attributes']=_0x558a4d[_0x1a66('0x48')]['length']?_0x558a4d[_0x1a66('0x48')]:_0xd31448[_0x1a66('0x47')];if(_0x4e2593[_0x1a66('0x44')][_0x1a66('0x56')]){_0x558a4d[_0x1a66('0x57')]=[{'all':!![]}];}_0x558a4d=_['merge']({},_0x558a4d,_0x4e2593[_0x1a66('0x55')]);return db[_0x1a66('0x3f')][_0x1a66('0x5d')](_0x558a4d)[_0x1a66('0x37')](handleEntityNotFound(_0x14b027,null))['then'](respondWithResult(_0x14b027,null))[_0x1a66('0x5a')](handleError(_0x14b027,null));};exports[_0x1a66('0x5e')]=function(_0x51b33f,_0x1c0ee4){return db[_0x1a66('0x3f')][_0x1a66('0x5e')](_0x51b33f['body'],{})[_0x1a66('0x37')](respondWithResult(_0x1c0ee4,0xc9))['catch'](handleError(_0x1c0ee4,null));};exports['update']=function(_0x230835,_0x22246c){if(_0x230835[_0x1a66('0x5f')]['id']){delete _0x230835[_0x1a66('0x5f')]['id'];}return db[_0x1a66('0x3f')][_0x1a66('0x5d')]({'where':{'id':_0x230835[_0x1a66('0x5c')]['id']}})[_0x1a66('0x37')](handleEntityNotFound(_0x22246c,null))[_0x1a66('0x37')](saveUpdates(_0x230835[_0x1a66('0x5f')],null))[_0x1a66('0x37')](respondWithResult(_0x22246c,null))[_0x1a66('0x5a')](handleError(_0x22246c,null));};exports[_0x1a66('0x38')]=function(_0x5bf498,_0x317d40){return db['OpenchannelMessage'][_0x1a66('0x5d')]({'where':{'id':_0x5bf498[_0x1a66('0x5c')]['id']}})[_0x1a66('0x37')](handleEntityNotFound(_0x317d40,null))[_0x1a66('0x37')](removeEntity(_0x317d40,null))[_0x1a66('0x5a')](handleError(_0x317d40,null));};exports['describe']=function(_0x489009,_0x4b8b11){return db[_0x1a66('0x3f')][_0x1a66('0x60')]()[_0x1a66('0x37')](respondWithResult(_0x4b8b11,null))[_0x1a66('0x5a')](handleError(_0x4b8b11,null));};var interaction_log=require(_0x1a66('0x15'))(_0x1a66('0x61'));exports['accept']=function(_0x49dd9c,_0x5114b1,_0x2db981){var _0x31baad={'agent':{},'channel':_0x1a66('0x62')};if(_0x49dd9c[_0x1a66('0x5f')]['id']){delete _0x49dd9c[_0x1a66('0x5f')]['id'];}_0x49dd9c[_0x1a66('0x5f')][_0x1a66('0x63')]=!![];_0x49dd9c[_0x1a66('0x5f')][_0x1a66('0x64')]=moment()[_0x1a66('0x65')](_0x1a66('0x66'));_0x49dd9c['body'][_0x1a66('0x67')]=_0x49dd9c['body'][_0x1a66('0x67')]||_0x49dd9c['user']['id'];_0x31baad[_0x1a66('0x68')]['id']=_0x49dd9c['body'][_0x1a66('0x67')];return db[_0x1a66('0x3f')][_0x1a66('0x5d')]({'where':{'id':_0x49dd9c[_0x1a66('0x5c')]['id'],'UserId':null}})[_0x1a66('0x37')](handleEntityNotFound(_0x5114b1,null))[_0x1a66('0x37')](saveUpdates(_0x49dd9c[_0x1a66('0x5f')],null))[_0x1a66('0x37')](function(_0x404dd2){if(_0x404dd2){_0x31baad['message']=_0x404dd2[_0x1a66('0x69')]({'plain':!![]});return db[_0x1a66('0x6a')][_0x1a66('0x5d')]({'where':{'id':_0x404dd2[_0x1a66('0x6b')]}});}return null;})[_0x1a66('0x37')](handleEntityNotFound(_0x5114b1,null))[_0x1a66('0x37')](function(_0x419866){if(_0x419866){return _0x419866[_0x1a66('0x36')]({'UserId':_0x49dd9c[_0x1a66('0x5f')][_0x1a66('0x67')],'read1stAt':_[_0x1a66('0x6c')](_0x419866[_0x1a66('0x6d')])?moment()[_0x1a66('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5a168a){if(_0x5a168a){_0x31baad['interaction']=_0x5a168a['get']({'plain':!![]});interaction_log[_0x1a66('0x21')](_0x1a66('0x6e'),_0x49dd9c[_0x1a66('0x6f')]['id'],_0x49dd9c['user'][_0x1a66('0x3b')],_0x49dd9c[_0x1a66('0x6f')][_0x1a66('0x70')],_0x31baad['interaction']['id'],_0x49dd9c[_0x1a66('0x5f')]?JSON[_0x1a66('0x26')](_0x49dd9c[_0x1a66('0x5f')]):_0x1a66('0x71'));return respondWithRpcPromise(_0x1a66('0x72'),_0x1a66('0x73'),_0x31baad);}return null;})['then'](function(_0x8028a0){var _0x43467a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8028a0[_0x1a66('0x29')][_0x1a66('0x74')];return db[_0x1a66('0x75')][_0x1a66('0x44')](_0x43467a,{'type':db[_0x1a66('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1a66('0x37')](function(_0x246247){return _0x246247;});})[_0x1a66('0x37')](function(_0x125579){if(_0x125579){_0x31baad[_0x1a66('0x29')]['contact']=_0x125579[0x0];if(!_0x49dd9c['body'][_0x1a66('0x67')])return;return db[_0x1a66('0x77')]['find']({'where':{'id':_0x49dd9c[_0x1a66('0x5f')][_0x1a66('0x67')],'role':_0x1a66('0x68')},'attributes':['id',_0x1a66('0x3b'),_0x1a66('0x78'),_0x1a66('0x79'),_0x1a66('0x7a')],'raw':!![]});}return null;})[_0x1a66('0x37')](function(_0x2d7a7b){if(!_0x2d7a7b)return null;_0x31baad['message']['agent']=_0x2d7a7b;return _0x31baad;})[_0x1a66('0x37')](function(_0x4d3558){if(_0x4d3558){if(_0x49dd9c[_0x1a66('0x5f')][_0x1a66('0x7b')]){_0x31baad[_0x1a66('0x29')][_0x1a66('0x7c')]=util[_0x1a66('0x65')](_0x1a66('0x7d'),_0x49dd9c[_0x1a66('0x6f')][_0x1a66('0x3b')]);_0x31baad[_0x1a66('0x29')][_0x1a66('0x7e')]=_0x31baad[_0x1a66('0x7e')];_0x31baad[_0x1a66('0x29')]['motionChannel']=_0x31baad[_0x1a66('0x7e')];_0x31baad['message'][_0x1a66('0x7f')]=_0x1a66('0x80');return respondWithRpcPromise(_0x1a66('0x81'),_0x1a66('0x81'),{'event':'acceptmessage','message':_0x31baad['message']},client9002)[_0x1a66('0x37')](function(){return _0x31baad;});}return _0x31baad;}return null;})[_0x1a66('0x37')](respondWithResult(_0x5114b1,null))['catch'](handleError(_0x5114b1,null));};var interaction_log=require(_0x1a66('0x15'))(_0x1a66('0x61'));exports[_0x1a66('0x34')]=function(_0x22d5f5,_0xc1a4e3,_0xe7ed91){var _0x9293be={'agent':{},'channel':_0x1a66('0x62')};if(_0x22d5f5['body']['id']){delete _0x22d5f5['body']['id'];}_0x22d5f5[_0x1a66('0x5f')][_0x1a66('0x67')]=_0x22d5f5[_0x1a66('0x5f')][_0x1a66('0x67')]||_0x22d5f5[_0x1a66('0x6f')]['id'];_0x9293be[_0x1a66('0x68')]['id']=_0x22d5f5['body'][_0x1a66('0x67')];return db[_0x1a66('0x3f')][_0x1a66('0x5d')]({'where':{'id':_0x22d5f5[_0x1a66('0x5c')]['id'],'UserId':null}})[_0x1a66('0x37')](handleEntityNotFound(_0xc1a4e3,null))['then'](function(_0x41246a){if(_0x41246a){_0x9293be[_0x1a66('0x29')]=_0x41246a[_0x1a66('0x69')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1a66('0x5d')]({'where':{'id':_0x41246a[_0x1a66('0x6b')]}});}return null;})[_0x1a66('0x37')](handleEntityNotFound(_0xc1a4e3,null))[_0x1a66('0x37')](function(_0x2adb14){if(_0x2adb14){_0x9293be[_0x1a66('0x82')]=_0x2adb14[_0x1a66('0x69')]({'plain':!![]});interaction_log[_0x1a66('0x21')](_0x1a66('0x83'),_0x22d5f5[_0x1a66('0x6f')]['id'],_0x22d5f5[_0x1a66('0x6f')][_0x1a66('0x3b')],_0x22d5f5[_0x1a66('0x6f')][_0x1a66('0x70')],_0x9293be[_0x1a66('0x82')]['id'],_0x22d5f5[_0x1a66('0x5f')]?JSON[_0x1a66('0x26')](_0x22d5f5[_0x1a66('0x5f')]):_0x1a66('0x71'));return respondWithRpcPromise(_0x1a66('0x84'),_0x1a66('0x85'),_0x9293be);}return null;})[_0x1a66('0x37')](function(_0x54ef5b){var _0x4e4f82='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54ef5b[_0x1a66('0x29')][_0x1a66('0x74')];return db[_0x1a66('0x75')][_0x1a66('0x44')](_0x4e4f82,{'type':db['Sequelize'][_0x1a66('0x86')][_0x1a66('0x87')],'raw':!![]})[_0x1a66('0x37')](function(_0x391c94){return _0x391c94;});})[_0x1a66('0x37')](function(_0x5828d7){if(_0x5828d7){_0x9293be['message'][_0x1a66('0x88')]=_0x5828d7[0x0];if(!_0x22d5f5[_0x1a66('0x5f')][_0x1a66('0x67')])return;return db['User'][_0x1a66('0x5d')]({'where':{'id':_0x22d5f5[_0x1a66('0x5f')][_0x1a66('0x67')],'role':_0x1a66('0x68')},'attributes':['id',_0x1a66('0x3b'),'fullname','email',_0x1a66('0x7a')],'raw':!![]});}return null;})[_0x1a66('0x37')](function(_0x36c347){if(!_0x36c347)return null;_0x9293be[_0x1a66('0x29')]['agent']=_0x36c347;return _0x9293be;})[_0x1a66('0x37')](function(_0x2b3c35){if(_0x2b3c35){_0x2b3c35[_0x1a66('0x29')][_0x1a66('0x7c')]=util[_0x1a66('0x65')](_0x1a66('0x7d'),_0x22d5f5['user'][_0x1a66('0x3b')]);_0x2b3c35['message'][_0x1a66('0x7e')]=_0x9293be[_0x1a66('0x7e')];_0x2b3c35[_0x1a66('0x29')][_0x1a66('0x89')]=_0x9293be[_0x1a66('0x7e')];_0x2b3c35[_0x1a66('0x29')][_0x1a66('0x7f')]=_0x1a66('0x34');respondWithRpcPromise(_0x1a66('0x81'),_0x1a66('0x81'),{'event':_0x1a66('0x8a'),'message':_0x2b3c35['message']},client9002);return _0x9293be;}return null;})[_0x1a66('0x37')](respondWithResult(_0xc1a4e3,null))['catch'](handleError(_0xc1a4e3,null));}; \ No newline at end of file +var _0xac12=['mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelMessage.socket','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','rows','show','params','keys','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','RejectMessage','rejectMessage','sequelize','contact','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x514521,_0x39b240){var _0x10281f=function(_0x4509a7){while(--_0x4509a7){_0x514521['push'](_0x514521['shift']());}};_0x10281f(++_0x39b240);}(_0xac12,0x7c));var _0x2ac1=function(_0x2df642,_0x2a6a98){_0x2df642=_0x2df642-0x0;var _0x1bc481=_0xac12[_0x2df642];return _0x1bc481;};'use strict';var emlformat=require(_0x2ac1('0x0'));var rimraf=require(_0x2ac1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ac1('0x2'));var rp=require(_0x2ac1('0x3'));var moment=require('moment');var BPromise=require(_0x2ac1('0x4'));var Mustache=require(_0x2ac1('0x5'));var util=require('util');var path=require(_0x2ac1('0x6'));var sox=require(_0x2ac1('0x7'));var csv=require('to-csv');var ejs=require(_0x2ac1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ac1('0x9'));var squel=require(_0x2ac1('0xa'));var crypto=require(_0x2ac1('0xb'));var jsforce=require(_0x2ac1('0xc'));var deskjs=require(_0x2ac1('0xd'));var toCsv=require(_0x2ac1('0xe'));var querystring=require(_0x2ac1('0xf'));var Papa=require(_0x2ac1('0x10'));var Redis=require(_0x2ac1('0x11'));var authService=require(_0x2ac1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ac1('0x13'));var logger=require(_0x2ac1('0x14'))('api');var utils=require(_0x2ac1('0x15'));var config=require(_0x2ac1('0x16'));var licenseUtil=require(_0x2ac1('0x17'));var db=require('../../mysqldb')['db'];config[_0x2ac1('0x18')]=_[_0x2ac1('0x19')](config[_0x2ac1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ac1('0x1a'))(new Redis(config[_0x2ac1('0x18')]));require(_0x2ac1('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2ac1('0x1c')][_0x2ac1('0x1d')]({'port':0x232c});var client9002=jayson[_0x2ac1('0x1c')][_0x2ac1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5e40f0,_0x1382d5,_0x4ffaaa,_0x2041d8){return new BPromise(function(_0x21d179,_0x5a4303){var _0x10198f=_0x2041d8||client;return _0x10198f[_0x2ac1('0x1e')](_0x5e40f0,_0x4ffaaa)[_0x2ac1('0x1f')](function(_0x4febfe){logger[_0x2ac1('0x20')](_0x2ac1('0x21'),_0x1382d5,'request\x20sent');logger[_0x2ac1('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1382d5,'request\x20sent',JSON[_0x2ac1('0x23')](_0x4febfe));if(_0x4febfe['error']){if(_0x4febfe[_0x2ac1('0x24')]['code']===0x1f4){logger[_0x2ac1('0x24')](_0x2ac1('0x21'),_0x1382d5,_0x4febfe[_0x2ac1('0x24')][_0x2ac1('0x25')]);return _0x5a4303(_0x4febfe[_0x2ac1('0x24')][_0x2ac1('0x25')]);}logger['error'](_0x2ac1('0x21'),_0x1382d5,_0x4febfe[_0x2ac1('0x24')]['message']);return _0x21d179(_0x4febfe['error'][_0x2ac1('0x25')]);}else{logger[_0x2ac1('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1382d5,_0x2ac1('0x26'));_0x21d179(_0x4febfe[_0x2ac1('0x27')][_0x2ac1('0x25')]);}})[_0x2ac1('0x28')](function(_0x52ce02){logger[_0x2ac1('0x24')](_0x2ac1('0x21'),_0x1382d5,_0x52ce02);_0x5a4303(_0x52ce02);});});}function respondWithStatusCode(_0x307b67,_0x49c55b){_0x49c55b=_0x49c55b||0xcc;return function(_0x19cc3d){if(_0x19cc3d){return _0x307b67[_0x2ac1('0x29')](_0x49c55b);}return _0x307b67[_0x2ac1('0x2a')](_0x49c55b)[_0x2ac1('0x2b')]();};}function respondWithResult(_0x57d3d8,_0x92c081){_0x92c081=_0x92c081||0xc8;return function(_0x5d5c88){if(_0x5d5c88){return _0x57d3d8[_0x2ac1('0x2a')](_0x92c081)[_0x2ac1('0x2c')](_0x5d5c88);}};}function respondWithFilteredResult(_0x33e3a9,_0x54e817){return function(_0x52cad1){if(_0x52cad1){var _0x721091=typeof _0x54e817[_0x2ac1('0x2d')]==='undefined'&&typeof _0x54e817[_0x2ac1('0x2e')]==='undefined';var _0x3eeb08=_0x52cad1[_0x2ac1('0x2f')];var _0x22f202=_0x721091?0x0:_0x54e817[_0x2ac1('0x2d')];var _0x3963eb=_0x721091?_0x52cad1['count']:_0x54e817[_0x2ac1('0x2d')]+_0x54e817[_0x2ac1('0x2e')];var _0x340633;if(_0x3963eb>=_0x3eeb08){_0x3963eb=_0x3eeb08;_0x340633=0xc8;}else{_0x340633=0xce;}_0x33e3a9[_0x2ac1('0x2a')](_0x340633);return _0x33e3a9['set'](_0x2ac1('0x30'),_0x22f202+'-'+_0x3963eb+'/'+_0x3eeb08)[_0x2ac1('0x2c')](_0x52cad1);}return null;};}function patchUpdates(_0x42dc28){return function(_0x4def83){try{jsonpatch[_0x2ac1('0x31')](_0x4def83,_0x42dc28,!![]);}catch(_0x29fe20){return BPromise[_0x2ac1('0x32')](_0x29fe20);}return _0x4def83['save']();};}function saveUpdates(_0x191cb5,_0x4d9d97){return function(_0x5e1f16){if(_0x5e1f16){return _0x5e1f16[_0x2ac1('0x33')](_0x191cb5)[_0x2ac1('0x1f')](function(_0x2e63c1){return _0x2e63c1;});}return null;};}function removeEntity(_0x3b8931,_0x332b86){return function(_0x26c4a1){if(_0x26c4a1){return _0x26c4a1[_0x2ac1('0x34')]()[_0x2ac1('0x1f')](function(){_0x3b8931['status'](0xcc)[_0x2ac1('0x2b')]();});}};}function handleEntityNotFound(_0x1ffc7c,_0x1018ce){return function(_0x135315){if(!_0x135315){_0x1ffc7c[_0x2ac1('0x29')](0x194);}return _0x135315;};}function handleError(_0x3cb696,_0x19554b){_0x19554b=_0x19554b||0x1f4;return function(_0x2629e9){logger['error'](_0x2629e9[_0x2ac1('0x35')]);if(_0x2629e9['name']){delete _0x2629e9[_0x2ac1('0x36')];}_0x3cb696[_0x2ac1('0x2a')](_0x19554b)[_0x2ac1('0x37')](_0x2629e9);};}exports[_0x2ac1('0x38')]=function(_0x39cc5f,_0x5a4e0e){var _0x37ebef={},_0x1a526c={},_0x2b7092={'count':0x0,'rows':[]};var _0x250078=_[_0x2ac1('0x39')](db[_0x2ac1('0x3a')][_0x2ac1('0x3b')],function(_0x23b253){return{'name':_0x23b253[_0x2ac1('0x3c')],'type':_0x23b253['type'][_0x2ac1('0x3d')]};});_0x1a526c[_0x2ac1('0x3e')]=_[_0x2ac1('0x39')](_0x250078,_0x2ac1('0x36'));_0x1a526c[_0x2ac1('0x3f')]=_['keys'](_0x39cc5f[_0x2ac1('0x3f')]);_0x1a526c[_0x2ac1('0x40')]=_[_0x2ac1('0x41')](_0x1a526c[_0x2ac1('0x3e')],_0x1a526c[_0x2ac1('0x3f')]);_0x37ebef[_0x2ac1('0x42')]=_[_0x2ac1('0x41')](_0x1a526c[_0x2ac1('0x3e')],qs['fields'](_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x43')]));_0x37ebef[_0x2ac1('0x42')]=_0x37ebef[_0x2ac1('0x42')][_0x2ac1('0x44')]?_0x37ebef['attributes']:_0x1a526c[_0x2ac1('0x3e')];if(!_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x45')]('nolimit')){_0x37ebef[_0x2ac1('0x2e')]=qs[_0x2ac1('0x2e')](_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x2e')]);_0x37ebef['offset']=qs[_0x2ac1('0x2d')](_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x2d')]);}_0x37ebef[_0x2ac1('0x46')]=qs[_0x2ac1('0x47')](_0x39cc5f['query'][_0x2ac1('0x47')]);_0x37ebef[_0x2ac1('0x48')]=qs[_0x2ac1('0x40')](_[_0x2ac1('0x49')](_0x39cc5f[_0x2ac1('0x3f')],_0x1a526c['filters']),_0x250078);if(_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x4a')]){_0x37ebef['where']=_[_0x2ac1('0x4b')](_0x37ebef[_0x2ac1('0x48')],{'$or':_[_0x2ac1('0x39')](_0x250078,function(_0xec815d){if(_0xec815d[_0x2ac1('0x4c')]!=='VIRTUAL'){var _0x3a792c={};_0x3a792c[_0xec815d['name']]={'$like':'%'+_0x39cc5f[_0x2ac1('0x3f')][_0x2ac1('0x4a')]+'%'};return _0x3a792c;}})});}_0x37ebef=_[_0x2ac1('0x4b')]({},_0x37ebef,_0x39cc5f[_0x2ac1('0x4d')]);var _0x13738a={'where':_0x37ebef[_0x2ac1('0x48')]};return db[_0x2ac1('0x3a')][_0x2ac1('0x2f')](_0x13738a)[_0x2ac1('0x1f')](function(_0x514b78){_0x2b7092[_0x2ac1('0x2f')]=_0x514b78;if(_0x39cc5f['query']['includeAll']){_0x37ebef[_0x2ac1('0x4e')]=[{'all':!![]}];}return db[_0x2ac1('0x3a')]['findAll'](_0x37ebef);})['then'](function(_0x476c3b){_0x2b7092[_0x2ac1('0x4f')]=_0x476c3b;return _0x2b7092;})[_0x2ac1('0x1f')](respondWithFilteredResult(_0x5a4e0e,_0x37ebef))[_0x2ac1('0x28')](handleError(_0x5a4e0e,null));};exports[_0x2ac1('0x50')]=function(_0x2c8075,_0x252e5f){var _0x2ea63f={'raw':!![],'where':{'id':_0x2c8075[_0x2ac1('0x51')]['id']}},_0x41a3af={};_0x41a3af[_0x2ac1('0x3e')]=_[_0x2ac1('0x52')](db['OpenchannelMessage'][_0x2ac1('0x3b')]);_0x41a3af['query']=_['keys'](_0x2c8075[_0x2ac1('0x3f')]);_0x41a3af[_0x2ac1('0x40')]=_[_0x2ac1('0x41')](_0x41a3af[_0x2ac1('0x3e')],_0x41a3af[_0x2ac1('0x3f')]);_0x2ea63f[_0x2ac1('0x42')]=_[_0x2ac1('0x41')](_0x41a3af[_0x2ac1('0x3e')],qs[_0x2ac1('0x43')](_0x2c8075['query']['fields']));_0x2ea63f['attributes']=_0x2ea63f[_0x2ac1('0x42')][_0x2ac1('0x44')]?_0x2ea63f[_0x2ac1('0x42')]:_0x41a3af['model'];if(_0x2c8075['query'][_0x2ac1('0x53')]){_0x2ea63f['include']=[{'all':!![]}];}_0x2ea63f=_[_0x2ac1('0x4b')]({},_0x2ea63f,_0x2c8075['options']);return db['OpenchannelMessage'][_0x2ac1('0x54')](_0x2ea63f)[_0x2ac1('0x1f')](handleEntityNotFound(_0x252e5f,null))[_0x2ac1('0x1f')](respondWithResult(_0x252e5f,null))[_0x2ac1('0x28')](handleError(_0x252e5f,null));};exports[_0x2ac1('0x55')]=function(_0x2496e6,_0x3e42ff){return db[_0x2ac1('0x3a')][_0x2ac1('0x55')](_0x2496e6[_0x2ac1('0x56')],{})['then'](respondWithResult(_0x3e42ff,0xc9))['catch'](handleError(_0x3e42ff,null));};exports[_0x2ac1('0x33')]=function(_0x2cd8fc,_0x1509a3){if(_0x2cd8fc[_0x2ac1('0x56')]['id']){delete _0x2cd8fc[_0x2ac1('0x56')]['id'];}return db[_0x2ac1('0x3a')][_0x2ac1('0x54')]({'where':{'id':_0x2cd8fc[_0x2ac1('0x51')]['id']}})[_0x2ac1('0x1f')](handleEntityNotFound(_0x1509a3,null))['then'](saveUpdates(_0x2cd8fc[_0x2ac1('0x56')],null))[_0x2ac1('0x1f')](respondWithResult(_0x1509a3,null))[_0x2ac1('0x28')](handleError(_0x1509a3,null));};exports[_0x2ac1('0x34')]=function(_0x4a1a63,_0x3f3a5e){return db['OpenchannelMessage'][_0x2ac1('0x54')]({'where':{'id':_0x4a1a63[_0x2ac1('0x51')]['id']}})[_0x2ac1('0x1f')](handleEntityNotFound(_0x3f3a5e,null))['then'](removeEntity(_0x3f3a5e,null))[_0x2ac1('0x28')](handleError(_0x3f3a5e,null));};exports['describe']=function(_0x1f8f54,_0x231fb6){return db[_0x2ac1('0x3a')][_0x2ac1('0x57')]()[_0x2ac1('0x1f')](respondWithResult(_0x231fb6,null))[_0x2ac1('0x28')](handleError(_0x231fb6,null));};var interaction_log=require(_0x2ac1('0x14'))(_0x2ac1('0x58'));exports[_0x2ac1('0x59')]=function(_0x33fca4,_0x21b12b,_0x4dd357){var _0x592d68={'agent':{},'channel':_0x2ac1('0x5a')};if(_0x33fca4[_0x2ac1('0x56')]['id']){delete _0x33fca4[_0x2ac1('0x56')]['id'];}_0x33fca4[_0x2ac1('0x56')][_0x2ac1('0x5b')]=!![];_0x33fca4['body'][_0x2ac1('0x5c')]=moment()['format'](_0x2ac1('0x5d'));_0x33fca4[_0x2ac1('0x56')][_0x2ac1('0x5e')]=_0x33fca4['body']['UserId']||_0x33fca4[_0x2ac1('0x5f')]['id'];_0x592d68[_0x2ac1('0x60')]['id']=_0x33fca4[_0x2ac1('0x56')][_0x2ac1('0x5e')];return db['OpenchannelMessage']['find']({'where':{'id':_0x33fca4[_0x2ac1('0x51')]['id'],'UserId':null}})[_0x2ac1('0x1f')](handleEntityNotFound(_0x21b12b,null))[_0x2ac1('0x1f')](saveUpdates(_0x33fca4[_0x2ac1('0x56')],null))[_0x2ac1('0x1f')](function(_0x808c07){if(_0x808c07){_0x592d68[_0x2ac1('0x25')]=_0x808c07[_0x2ac1('0x61')]({'plain':!![]});return db[_0x2ac1('0x62')][_0x2ac1('0x54')]({'where':{'id':_0x808c07[_0x2ac1('0x63')]}});}return null;})[_0x2ac1('0x1f')](handleEntityNotFound(_0x21b12b,null))[_0x2ac1('0x1f')](function(_0x354503){if(_0x354503){return _0x354503[_0x2ac1('0x33')]({'UserId':_0x33fca4[_0x2ac1('0x56')][_0x2ac1('0x5e')],'read1stAt':_[_0x2ac1('0x64')](_0x354503[_0x2ac1('0x65')])?moment()[_0x2ac1('0x66')](_0x2ac1('0x5d')):undefined});}return null;})[_0x2ac1('0x1f')](function(_0x575033){if(_0x575033){_0x592d68[_0x2ac1('0x67')]=_0x575033[_0x2ac1('0x61')]({'plain':!![]});interaction_log[_0x2ac1('0x20')](_0x2ac1('0x68'),_0x33fca4[_0x2ac1('0x5f')]['id'],_0x33fca4[_0x2ac1('0x5f')][_0x2ac1('0x36')],_0x33fca4[_0x2ac1('0x5f')][_0x2ac1('0x69')],_0x592d68[_0x2ac1('0x67')]['id'],_0x33fca4[_0x2ac1('0x56')]?JSON[_0x2ac1('0x23')](_0x33fca4[_0x2ac1('0x56')]):'null');return respondWithRpcPromise(_0x2ac1('0x6a'),_0x2ac1('0x6b'),_0x592d68);}return null;})[_0x2ac1('0x1f')](function(_0x42d58d){var _0x4d596f=_0x2ac1('0x6c')+_0x42d58d[_0x2ac1('0x25')][_0x2ac1('0x6d')];return db['sequelize'][_0x2ac1('0x3f')](_0x4d596f,{'type':db[_0x2ac1('0x6e')][_0x2ac1('0x6f')][_0x2ac1('0x70')],'raw':!![]})[_0x2ac1('0x1f')](function(_0x1f5a57){return _0x1f5a57;});})[_0x2ac1('0x1f')](function(_0x25c244){if(_0x25c244){_0x592d68[_0x2ac1('0x25')]['contact']=_0x25c244[0x0];if(!_0x33fca4['body'][_0x2ac1('0x5e')])return;return db[_0x2ac1('0x71')]['find']({'where':{'id':_0x33fca4[_0x2ac1('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x2ac1('0x36'),_0x2ac1('0x72'),_0x2ac1('0x73'),_0x2ac1('0x74')],'raw':!![]});}return null;})[_0x2ac1('0x1f')](function(_0x4c1f97){if(!_0x4c1f97)return null;_0x592d68[_0x2ac1('0x25')][_0x2ac1('0x60')]=_0x4c1f97;return _0x592d68;})['then'](function(_0xd1e759){if(_0xd1e759){if(_0x33fca4[_0x2ac1('0x56')]['manual']){_0x592d68[_0x2ac1('0x25')][_0x2ac1('0x75')]=util[_0x2ac1('0x66')](_0x2ac1('0x76'),_0x33fca4['user'][_0x2ac1('0x36')]);_0x592d68[_0x2ac1('0x25')][_0x2ac1('0x77')]=_0x592d68[_0x2ac1('0x77')];_0x592d68[_0x2ac1('0x25')][_0x2ac1('0x78')]=_0x592d68[_0x2ac1('0x77')];_0x592d68['message'][_0x2ac1('0x79')]='accept';return respondWithRpcPromise(_0x2ac1('0x7a'),_0x2ac1('0x7a'),{'event':_0x2ac1('0x7b'),'message':_0x592d68['message']},client9002)[_0x2ac1('0x1f')](function(){return _0x592d68;});}return _0x592d68;}return null;})[_0x2ac1('0x1f')](respondWithResult(_0x21b12b,null))['catch'](handleError(_0x21b12b,null));};var interaction_log=require(_0x2ac1('0x14'))(_0x2ac1('0x58'));exports[_0x2ac1('0x32')]=function(_0x10607b,_0x500f1a,_0x52c36a){var _0x1c3654={'agent':{},'channel':_0x2ac1('0x5a')};if(_0x10607b[_0x2ac1('0x56')]['id']){delete _0x10607b[_0x2ac1('0x56')]['id'];}_0x10607b[_0x2ac1('0x56')][_0x2ac1('0x5e')]=_0x10607b[_0x2ac1('0x56')]['UserId']||_0x10607b[_0x2ac1('0x5f')]['id'];_0x1c3654[_0x2ac1('0x60')]['id']=_0x10607b['body']['UserId'];return db['OpenchannelMessage'][_0x2ac1('0x54')]({'where':{'id':_0x10607b['params']['id'],'UserId':null}})[_0x2ac1('0x1f')](handleEntityNotFound(_0x500f1a,null))[_0x2ac1('0x1f')](function(_0x15bf60){if(_0x15bf60){_0x1c3654[_0x2ac1('0x25')]=_0x15bf60[_0x2ac1('0x61')]({'plain':!![]});return db[_0x2ac1('0x62')]['find']({'where':{'id':_0x15bf60[_0x2ac1('0x63')]}});}return null;})[_0x2ac1('0x1f')](handleEntityNotFound(_0x500f1a,null))[_0x2ac1('0x1f')](function(_0x319c05){if(_0x319c05){_0x1c3654[_0x2ac1('0x67')]=_0x319c05[_0x2ac1('0x61')]({'plain':!![]});interaction_log[_0x2ac1('0x20')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10607b[_0x2ac1('0x5f')]['id'],_0x10607b[_0x2ac1('0x5f')]['name'],_0x10607b['user'][_0x2ac1('0x69')],_0x1c3654[_0x2ac1('0x67')]['id'],_0x10607b[_0x2ac1('0x56')]?JSON['stringify'](_0x10607b['body']):_0x2ac1('0x7c'));return respondWithRpcPromise(_0x2ac1('0x7d'),_0x2ac1('0x7e'),_0x1c3654);}return null;})[_0x2ac1('0x1f')](function(_0x520125){var _0x4696dc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x520125[_0x2ac1('0x25')][_0x2ac1('0x6d')];return db[_0x2ac1('0x7f')]['query'](_0x4696dc,{'type':db[_0x2ac1('0x6e')]['QueryTypes'][_0x2ac1('0x70')],'raw':!![]})[_0x2ac1('0x1f')](function(_0x5e2014){return _0x5e2014;});})[_0x2ac1('0x1f')](function(_0x4845a3){if(_0x4845a3){_0x1c3654[_0x2ac1('0x25')][_0x2ac1('0x80')]=_0x4845a3[0x0];if(!_0x10607b[_0x2ac1('0x56')][_0x2ac1('0x5e')])return;return db['User'][_0x2ac1('0x54')]({'where':{'id':_0x10607b[_0x2ac1('0x56')][_0x2ac1('0x5e')],'role':_0x2ac1('0x60')},'attributes':['id',_0x2ac1('0x36'),'fullname',_0x2ac1('0x73'),'internal'],'raw':!![]});}return null;})[_0x2ac1('0x1f')](function(_0x1454d0){if(!_0x1454d0)return null;_0x1c3654[_0x2ac1('0x25')][_0x2ac1('0x60')]=_0x1454d0;return _0x1c3654;})[_0x2ac1('0x1f')](function(_0x78f2fb){if(_0x78f2fb){_0x78f2fb['message'][_0x2ac1('0x75')]=util[_0x2ac1('0x66')]('SIP/%s',_0x10607b[_0x2ac1('0x5f')]['name']);_0x78f2fb[_0x2ac1('0x25')]['channel']=_0x1c3654['channel'];_0x78f2fb[_0x2ac1('0x25')]['motionChannel']=_0x1c3654[_0x2ac1('0x77')];_0x78f2fb[_0x2ac1('0x25')][_0x2ac1('0x79')]=_0x2ac1('0x32');respondWithRpcPromise(_0x2ac1('0x7a'),_0x2ac1('0x7a'),{'event':'rejectmessage','message':_0x78f2fb[_0x2ac1('0x25')]},client9002);return _0x1c3654;}return null;})[_0x2ac1('0x1f')](respondWithResult(_0x500f1a,null))[_0x2ac1('0x28')](handleError(_0x500f1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 5190f40..d3455c8 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 _0xe80b=['hook','events','../../mysqldb','save','update','remove','emit'];(function(_0x46e9dd,_0x1c3a1c){var _0xfe5a27=function(_0x419eaa){while(--_0x419eaa){_0x46e9dd['push'](_0x46e9dd['shift']());}};_0xfe5a27(++_0x1c3a1c);}(_0xe80b,0x120));var _0xbe80=function(_0x488c9f,_0x1679f8){_0x488c9f=_0x488c9f-0x0;var _0x493e0d=_0xe80b[_0x488c9f];return _0x493e0d;};'use strict';var EventEmitter=require(_0xbe80('0x0'));var OpenchannelMessage=require(_0xbe80('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe80('0x2'),'afterUpdate':_0xbe80('0x3'),'afterDestroy':_0xbe80('0x4')};function emitEvent(_0x34f1e1){return function(_0x8255fe,_0x741c75,_0x25c49b){OpenchannelMessageEvents[_0xbe80('0x5')](_0x34f1e1+':'+_0x8255fe['id'],_0x8255fe);OpenchannelMessageEvents[_0xbe80('0x5')](_0x34f1e1,_0x8255fe);_0x25c49b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xbe80('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xcd04=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x128be1,_0x392ae9){var _0x2b9957=function(_0x9e4281){while(--_0x9e4281){_0x128be1['push'](_0x128be1['shift']());}};_0x2b9957(++_0x392ae9);}(_0xcd04,0xcb));var _0x4cd0=function(_0x1093ec,_0x339daa){_0x1093ec=_0x1093ec-0x0;var _0x25eb52=_0xcd04[_0x1093ec];return _0x25eb52;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x4cd0('0x0'))['db'][_0x4cd0('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4cd0('0x2')](0x0);var events={'afterCreate':_0x4cd0('0x3'),'afterUpdate':_0x4cd0('0x4'),'afterDestroy':_0x4cd0('0x5')};function emitEvent(_0x2820a0){return function(_0xf134fc,_0xfac60,_0x433a92){OpenchannelMessageEvents['emit'](_0x2820a0+':'+_0xf134fc['id'],_0xf134fc);OpenchannelMessageEvents['emit'](_0x2820a0,_0xf134fc);_0x433a92(null);};}for(var e in events){if(events[_0x4cd0('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index d6d322f..858db80 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 _0xb688=['then','replyUri','info','format','length','Interaction','omit','Contact','POST','threadId','update','OpenchannelMessage,\x20%s,\x20%s','afterCreate','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb688,0xcf));var _0x8b68=function(_0x198145,_0x73d4ca){_0x198145=_0x198145-0x0;var _0x41b4a6=_0xb688[_0x198145];return _0x41b4a6;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[{'name':_0x8b68('0xc'),'fields':[_0x8b68('0xd')],'type':_0x8b68('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f9685,_0x261753,_0x21d944){var _0x24e0b0=_0x583d16[_0x8b68('0xf')];var _0x418775=_0x3f9685[_0x8b68('0x10')]({'plain':!![]});if(_0x418775[_0x8b68('0x11')]['toLowerCase']()==='in'||_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()===_0x8b68('0x13')&&!_0x418775[_0x8b68('0x14')]&&!_[_0x8b68('0x15')](_0x418775[_0x8b68('0x16')])){_0x24e0b0[_0x8b68('0x17')][_0x8b68('0x18')]({'where':{'id':_0x418775[_0x8b68('0x19')]}})['then'](function(_0xb2df35){if(_0xb2df35){_0xb2df35['update']({'lastMsgAt':_0x418775['createdAt'],'lastMsgDirection':_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()});}})[_0x8b68('0x1a')](function(_0x5d3468){console['error'](_0x5d3468);});}if(_0x418775[_0x8b68('0x11')]==='out'&&!_0x418775[_0x8b68('0x14')]){var _0xb44923;_0x24e0b0[_0x8b68('0x1b')][_0x8b68('0x1c')]()['then'](function(_0xd17693){return _0x24e0b0[_0x8b68('0x1d')]['find']({'where':{'id':_0x418775[_0x8b68('0x1e')]},'include':[{'model':_0x24e0b0[_0x8b68('0x17')],'as':_0x8b68('0x1f'),'where':{'id':_0x418775[_0x8b68('0x19')]},'limit':0x1,'include':[{'model':_0x24e0b0[_0x8b68('0x1b')],'as':'Contact','attributes':_[_0x8b68('0x20')](_0xd17693)}]}]});})[_0x8b68('0x21')](function(_0x59e9b1){_0xb44923=_0x59e9b1[_0x8b68('0x10')]({'plain':!![]});if(_0xb44923&&_0xb44923[_0x8b68('0x22')]){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0xb44923[_0x8b68('0x1f')]&&_0xb44923[_0x8b68('0x1f')][_0x8b68('0x25')]){_0x418775[_0x8b68('0x26')]=_[_0x8b68('0x27')](_0xb44923['Interactions'][0x0],_0x8b68('0x28'));_0x418775[_0x8b68('0x28')]=_0xb44923['Interactions'][0x0][_0x8b68('0x28')];}var _0x261753={'method':_0x8b68('0x29'),'uri':encodeURI(_0xb44923['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x261753['method']){case'GET':_0x261753['qs']=_0x418775;break;case _0x8b68('0x29'):_0x261753[_0x8b68('0xd')]=_0x418775;break;}return rp(_0x261753)[_0x8b68('0x21')](function(_0x583476){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0x583476[_0x8b68('0xd')]['threadId']&&_0x583476['body'][_0x8b68('0x2a')]!=_0x418775[_0x8b68('0x26')][_0x8b68('0x2a')]){return _0x24e0b0[_0x8b68('0x17')][_0x8b68('0x2b')]({'threadId':_0x583476[_0x8b68('0xd')][_0x8b68('0x2a')]},{'logging':!![],'where':{'id':_0x418775['Interaction']['id']}});}else{return;}})[_0x8b68('0x21')](function(){return _0x3f9685['update']({'read':!![]});})[_0x8b68('0x1a')](function(_0x133b75){logger['error'](_0x8b68('0x2c'),_0x8b68('0x2d'),util[_0x8b68('0x2e')](_0x133b75,{'showHidden':![],'depth':null}));_0x21d944();});}else{_0x21d944();}})['finally'](function(){_0x21d944();});}else{_0x21d944();}}},'charset':'utf8mb4','collate':_0x8b68('0x2f')});}; \ No newline at end of file +var _0x6cb4=['define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes'];(function(_0xc8aa5d,_0x122592){var _0x317fbd=function(_0x100493){while(--_0x100493){_0xc8aa5d['push'](_0xc8aa5d['shift']());}};_0x317fbd(++_0x122592);}(_0x6cb4,0xff));var _0x46cb=function(_0x49faed,_0x1d2f22){_0x49faed=_0x49faed-0x0;var _0x31f280=_0x6cb4[_0x49faed];return _0x31f280;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[{'name':_0x46cb('0xd'),'fields':[_0x46cb('0xe')],'type':_0x46cb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56258a,_0x3d7663,_0x34f9e9){var _0x48101c=_0x3d9d3c[_0x46cb('0x10')];var _0x106a87=_0x56258a['get']({'plain':!![]});if(_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()==='in'||_0x106a87['direction']['toLowerCase']()==='out'&&!_0x106a87[_0x46cb('0x13')]&&!_[_0x46cb('0x14')](_0x106a87[_0x46cb('0x15')])){_0x48101c[_0x46cb('0x16')]['findOne']({'where':{'id':_0x106a87[_0x46cb('0x17')]}})[_0x46cb('0x18')](function(_0x2a1f9d){if(_0x2a1f9d){_0x2a1f9d[_0x46cb('0x19')]({'lastMsgAt':_0x106a87[_0x46cb('0x1a')],'lastMsgDirection':_0x106a87[_0x46cb('0x11')][_0x46cb('0x12')]()});}})[_0x46cb('0x1b')](function(_0x37d368){console[_0x46cb('0x1c')](_0x37d368);});}if(_0x106a87[_0x46cb('0x11')]==='out'&&!_0x106a87[_0x46cb('0x13')]){var _0x5796d2;_0x48101c[_0x46cb('0x1d')]['describe']()['then'](function(_0x4e3454){return _0x48101c[_0x46cb('0x1e')][_0x46cb('0x1f')]({'where':{'id':_0x106a87[_0x46cb('0x20')]},'include':[{'model':_0x48101c[_0x46cb('0x16')],'as':_0x46cb('0x21'),'where':{'id':_0x106a87[_0x46cb('0x17')]},'limit':0x1,'include':[{'model':_0x48101c[_0x46cb('0x1d')],'as':_0x46cb('0x22'),'attributes':_[_0x46cb('0x23')](_0x4e3454)}]}]});})[_0x46cb('0x18')](function(_0x149483){_0x5796d2=_0x149483[_0x46cb('0x24')]({'plain':!![]});if(_0x5796d2&&_0x5796d2[_0x46cb('0x25')]){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x2a'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x5796d2[_0x46cb('0x21')]&&_0x5796d2[_0x46cb('0x21')][_0x46cb('0x2b')]){_0x106a87[_0x46cb('0x2c')]=_[_0x46cb('0x2d')](_0x5796d2[_0x46cb('0x21')][0x0],'Contact');_0x106a87['Contact']=_0x5796d2[_0x46cb('0x21')][0x0][_0x46cb('0x22')];}var _0x3d7663={'method':_0x46cb('0x2e'),'uri':encodeURI(_0x5796d2[_0x46cb('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3d7663['method']){case _0x46cb('0x2f'):_0x3d7663['qs']=_0x106a87;break;case'POST':_0x3d7663['body']=_0x106a87;break;}return rp(_0x3d7663)['then'](function(_0x180ce1){logger[_0x46cb('0x26')](_0x46cb('0x27'),_0x46cb('0x28'),util[_0x46cb('0x29')](_0x46cb('0x30'),_0x106a87['id'],_0x5796d2[_0x46cb('0x25')]));if(_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]&&_0x180ce1[_0x46cb('0xe')][_0x46cb('0x31')]!=_0x106a87['Interaction'][_0x46cb('0x31')]){return _0x48101c[_0x46cb('0x16')]['update']({'threadId':_0x180ce1['body'][_0x46cb('0x31')]},{'logging':!![],'where':{'id':_0x106a87['Interaction']['id']}});}else{return;}})[_0x46cb('0x18')](function(){return _0x56258a[_0x46cb('0x19')]({'read':!![]});})[_0x46cb('0x1b')](function(_0xd96713){logger[_0x46cb('0x1c')](_0x46cb('0x27'),'afterCreate',util[_0x46cb('0x32')](_0xd96713,{'showHidden':![],'depth':null}));_0x34f9e9();});}else{_0x34f9e9();}})['finally'](function(){_0x34f9e9();});}else{_0x34f9e9();}}},'charset':_0x46cb('0x33'),'collate':_0x46cb('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 155cd38..9dc254b 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x4c70af,_0x3573b8){var _0x4a4d4d=function(_0x55b185){while(--_0x55b185){_0x4c70af['push'](_0x4c70af['shift']());}};_0x4a4d4d(++_0x3573b8);}(_0xadb5,0xad));var _0x5adb=function(_0xc7cffc,_0x4e2404){_0xc7cffc=_0xc7cffc-0x0;var _0xcad377=_0xadb5[_0xc7cffc];return _0xcad377;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4ffcdf,_0x25a43e){var _0x1b103c=function(_0x252d13){while(--_0x252d13){_0x4ffcdf['push'](_0x4ffcdf['shift']());}};_0x1b103c(++_0x25a43e);}(_0x1261,0x144));var _0x1126=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0x1261[_0x260859];return _0x4b77f8;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index db4db7b..6fe7462 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 _0x6e6f=['emit','removeListener','length','openchannelMessage:','save','remove'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x6e6f,0x76));var _0xf6e6=function(_0x465147,_0x240ccd){_0x465147=_0x465147-0x0;var _0x5449b5=_0x6e6f[_0x465147];return _0x5449b5;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xf6e6('0x0'),_0xf6e6('0x1'),'update'];function createListener(_0x4497c3,_0x1f7b00){return function(_0x32f236){_0x1f7b00[_0xf6e6('0x2')](_0x4497c3,_0x32f236);};}function removeListener(_0x445201,_0x3deccf){return function(){OpenchannelMessageEvents[_0xf6e6('0x3')](_0x445201,_0x3deccf);};}exports['register']=function(_0x3c9820){for(var _0x3ca8a7=0x0,_0x3af742=events[_0xf6e6('0x4')];_0x3ca8a7<_0x3af742;_0x3ca8a7++){var _0x1a3561=events[_0x3ca8a7];var _0x172fd4=createListener(_0xf6e6('0x5')+_0x1a3561,_0x3c9820);OpenchannelMessageEvents['on'](_0x1a3561,_0x172fd4);}}; \ No newline at end of file +var _0x5594=['remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x5bc029,_0x98a63c){var _0xe8c401=function(_0x229bf5){while(--_0x229bf5){_0x5bc029['push'](_0x5bc029['shift']());}};_0xe8c401(++_0x98a63c);}(_0x5594,0x173));var _0x4559=function(_0x44990c,_0x18ffdc){_0x44990c=_0x44990c-0x0;var _0x1f407b=_0x5594[_0x44990c];return _0x1f407b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x4559('0x0'),_0x4559('0x1')];function createListener(_0x2414f4,_0x4fc84b){return function(_0x1732e1){_0x4fc84b[_0x4559('0x2')](_0x2414f4,_0x1732e1);};}function removeListener(_0x34b7f1,_0x3cbae4){return function(){OpenchannelMessageEvents[_0x4559('0x3')](_0x34b7f1,_0x3cbae4);};}exports[_0x4559('0x4')]=function(_0x42c0fe){for(var _0x197d95=0x0,_0x50e06e=events[_0x4559('0x5')];_0x197d95<_0x50e06e;_0x197d95++){var _0x1aaa44=events[_0x197d95];var _0x6ef555=createListener(_0x4559('0x6')+_0x1aaa44,_0x42c0fe);OpenchannelMessageEvents['on'](_0x1aaa44,_0x6ef555);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index c6d124d..4cc07a9 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 _0x25a1=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id'];(function(_0x1bb805,_0x27c596){var _0x243107=function(_0x5c396c){while(--_0x5c396c){_0x1bb805['push'](_0x1bb805['shift']());}};_0x243107(++_0x27c596);}(_0x25a1,0x17c));var _0x125a=function(_0x4a7d53,_0x326192){_0x4a7d53=_0x4a7d53-0x0;var _0x22ffad=_0x25a1[_0x4a7d53];return _0x22ffad;};'use strict';var multer=require(_0x125a('0x0'));var util=require(_0x125a('0x1'));var path=require(_0x125a('0x2'));var timeout=require(_0x125a('0x3'));var express=require(_0x125a('0x4'));var router=express[_0x125a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x125a('0x6'));var interaction=require(_0x125a('0x7'));var config=require(_0x125a('0x8'));var controller=require(_0x125a('0x9'));router[_0x125a('0xa')]('/',auth['isAuthenticated'](),controller[_0x125a('0xb')]);router[_0x125a('0xa')]('/describe',auth[_0x125a('0xc')](),controller[_0x125a('0xd')]);router[_0x125a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x125a('0xe')]);router[_0x125a('0xa')](_0x125a('0xf'),auth['isAuthenticated'](),controller[_0x125a('0x10')]);router[_0x125a('0xa')](_0x125a('0x11'),auth['isAuthenticated'](),controller[_0x125a('0x12')]);router[_0x125a('0xa')](_0x125a('0x13'),auth[_0x125a('0xc')](),controller['getAgents']);router[_0x125a('0x14')]('/',auth[_0x125a('0xc')](),controller[_0x125a('0x15')]);router[_0x125a('0x14')](_0x125a('0x11'),auth[_0x125a('0xc')](),controller[_0x125a('0x16')]);router[_0x125a('0x14')]('/:id/users',auth[_0x125a('0xc')](),controller[_0x125a('0x17')]);router[_0x125a('0x18')](_0x125a('0x19'),auth['isAuthenticated'](),controller['update']);router[_0x125a('0x1a')](_0x125a('0x19'),auth[_0x125a('0xc')](),controller[_0x125a('0x1b')]);router[_0x125a('0x1a')]('/:id/teams',auth[_0x125a('0xc')](),controller['removeTeams']);router[_0x125a('0x1a')]('/:id/users',auth[_0x125a('0xc')](),controller['removeAgents']);module[_0x125a('0x1c')]=router; \ No newline at end of file +var _0x6aa7=['removeTeams','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','/:id','update','delete','destroy'];(function(_0x4ff7d2,_0x25629b){var _0x6df362=function(_0x497b1b){while(--_0x497b1b){_0x4ff7d2['push'](_0x4ff7d2['shift']());}};_0x6df362(++_0x25629b);}(_0x6aa7,0x1a2));var _0x76aa=function(_0x11f580,_0x20fe03){_0x11f580=_0x11f580-0x0;var _0x10f3a8=_0x6aa7[_0x11f580];return _0x10f3a8;};'use strict';var multer=require('multer');var util=require(_0x76aa('0x0'));var path=require('path');var timeout=require(_0x76aa('0x1'));var express=require(_0x76aa('0x2'));var router=express['Router']();var fs_extra=require(_0x76aa('0x3'));var auth=require(_0x76aa('0x4'));var interaction=require(_0x76aa('0x5'));var config=require('../../config/environment');var controller=require(_0x76aa('0x6'));router[_0x76aa('0x7')]('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x7')](_0x76aa('0x9'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xa')]);router[_0x76aa('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x76aa('0xb')]);router[_0x76aa('0x7')]('/:id/members',auth[_0x76aa('0x8')](),controller[_0x76aa('0xc')]);router[_0x76aa('0x7')](_0x76aa('0xd'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xe')]);router[_0x76aa('0x7')](_0x76aa('0xf'),auth[_0x76aa('0x8')](),controller['getAgents']);router[_0x76aa('0x10')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0x11')]);router[_0x76aa('0x10')](_0x76aa('0xd'),auth[_0x76aa('0x8')](),controller['addTeams']);router['post'](_0x76aa('0xf'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x12')]);router[_0x76aa('0x13')](_0x76aa('0x14'),auth['isAuthenticated'](),controller[_0x76aa('0x15')]);router[_0x76aa('0x16')]('/:id',auth[_0x76aa('0x8')](),controller[_0x76aa('0x17')]);router['delete'](_0x76aa('0xd'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x18')]);router['delete'](_0x76aa('0xf'),auth[_0x76aa('0x8')](),controller['removeAgents']);module[_0x76aa('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 44b9031..6f11c4b 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 _0xc698=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc698,0x1bd));var _0x8c69=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc698[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require('sequelize');module[_0x8c69('0x0')]={'name':{'type':Sequelize[_0x8c69('0x1')],'unique':_0x8c69('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8c69('0x1')]},'timeout':{'type':Sequelize[_0x8c69('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8c69('0x4')](_0x8c69('0x5'),_0x8c69('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x0350=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0350,0x140));var _0x0035=function(_0x7e50bf,_0x439efb){_0x7e50bf=_0x7e50bf-0x0;var _0x1418c8=_0x0350[_0x7e50bf];return _0x1418c8;};'use strict';var Sequelize=require(_0x0035('0x0'));module[_0x0035('0x1')]={'name':{'type':Sequelize[_0x0035('0x2')],'unique':_0x0035('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0035('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0035('0x5')](_0x0035('0x6'),_0x0035('0x7'),_0x0035('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0c28535..bf4d106 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 _0x4352=['push','toString','QueryTypes','SELECT','includes','all','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','fast-json-patch','mustache','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','findOne','UserOpenchannelQueue','nolimit','pick','agent','openchannelPause','updatedAt','createdAt','format','SIP','Team','hasOwnProperty','getTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0x496b17,_0x37c78e){var _0x327e57=function(_0xb2900){while(--_0xb2900){_0x496b17['push'](_0x496b17['shift']());}};_0x327e57(++_0x37c78e);}(_0x4352,0x116));var _0x2435=function(_0x338aa2,_0x5e4858){_0x338aa2=_0x338aa2-0x0;var _0x1b5062=_0x4352[_0x338aa2];return _0x1b5062;};'use strict';var emlformat=require(_0x2435('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2435('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2435('0x2'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2435('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2435('0x4'));var _=require(_0x2435('0x5'));var squel=require('squel');var crypto=require(_0x2435('0x6'));var jsforce=require(_0x2435('0x7'));var deskjs=require(_0x2435('0x8'));var toCsv=require(_0x2435('0x3'));var querystring=require(_0x2435('0x9'));var Papa=require(_0x2435('0xa'));var Redis=require(_0x2435('0xb'));var authService=require(_0x2435('0xc'));var qs=require(_0x2435('0xd'));var as=require(_0x2435('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2435('0xf'))(_0x2435('0x10'));var utils=require(_0x2435('0x11'));var config=require(_0x2435('0x12'));var licenseUtil=require(_0x2435('0x13'));var db=require(_0x2435('0x14'))['db'];config[_0x2435('0x15')]=_['defaults'](config[_0x2435('0x15')],{'host':_0x2435('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2435('0x15')]));require('./openchannelQueue.socket')[_0x2435('0x17')](socket);function respondWithStatusCode(_0x50fe10,_0x421edd){_0x421edd=_0x421edd||0xcc;return function(_0x21b8ab){if(_0x21b8ab){return _0x50fe10[_0x2435('0x18')](_0x421edd);}return _0x50fe10[_0x2435('0x19')](_0x421edd)[_0x2435('0x1a')]();};}function respondWithResult(_0x216008,_0x246c45){_0x246c45=_0x246c45||0xc8;return function(_0x1f7c1c){if(_0x1f7c1c){return _0x216008[_0x2435('0x19')](_0x246c45)[_0x2435('0x1b')](_0x1f7c1c);}};}function respondWithFilteredResult(_0x270c83,_0x45acf2){return function(_0x496973){if(_0x496973){var _0x485246=typeof _0x45acf2[_0x2435('0x1c')]===_0x2435('0x1d')&&typeof _0x45acf2[_0x2435('0x1e')]===_0x2435('0x1d');var _0x4df9a8=_0x496973[_0x2435('0x1f')];var _0x465f0c=_0x485246?0x0:_0x45acf2[_0x2435('0x1c')];var _0x3b325a=_0x485246?_0x496973['count']:_0x45acf2[_0x2435('0x1c')]+_0x45acf2[_0x2435('0x1e')];var _0x4e93a6;if(_0x3b325a>=_0x4df9a8){_0x3b325a=_0x4df9a8;_0x4e93a6=0xc8;}else{_0x4e93a6=0xce;}_0x270c83[_0x2435('0x19')](_0x4e93a6);return _0x270c83[_0x2435('0x20')](_0x2435('0x21'),_0x465f0c+'-'+_0x3b325a+'/'+_0x4df9a8)[_0x2435('0x1b')](_0x496973);}return null;};}function patchUpdates(_0xb69937){return function(_0x1b0e97){try{jsonpatch[_0x2435('0x22')](_0x1b0e97,_0xb69937,!![]);}catch(_0x164054){return BPromise[_0x2435('0x23')](_0x164054);}return _0x1b0e97[_0x2435('0x24')]();};}function saveUpdates(_0x32de3f,_0x1e45c1){return function(_0x5ee15c){if(_0x5ee15c){return _0x5ee15c[_0x2435('0x25')](_0x32de3f)[_0x2435('0x26')](function(_0x590022){return _0x590022;});}return null;};}function removeEntity(_0x10a335,_0x4c1d93){return function(_0x27f279){if(_0x27f279){return _0x27f279[_0x2435('0x27')]()['then'](function(){var _0x22392=_0x27f279[_0x2435('0x28')]({'plain':!![]});var _0x3cd5e2=_0x2435('0x29');return db[_0x2435('0x2a')]['destroy']({'where':{'type':_0x3cd5e2,'resourceId':_0x22392['id']}})[_0x2435('0x26')](function(){return _0x27f279;});})[_0x2435('0x26')](function(){_0x10a335['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d85c,_0x44aaea){return function(_0x410234){if(!_0x410234){_0x45d85c[_0x2435('0x18')](0x194);}return _0x410234;};}function handleError(_0x541b45,_0x3a1b95){_0x3a1b95=_0x3a1b95||0x1f4;return function(_0x1b8923){logger[_0x2435('0x2b')](_0x1b8923[_0x2435('0x2c')]);if(_0x1b8923['name']){delete _0x1b8923[_0x2435('0x2d')];}_0x541b45[_0x2435('0x19')](_0x3a1b95)[_0x2435('0x2e')](_0x1b8923);};}exports[_0x2435('0x2f')]=function(_0x1b819d,_0x1d9df3){var _0x5687e5={},_0x5b08ea={},_0x3888ad={'count':0x0,'rows':[]};var _0x49f73d=_['map'](db[_0x2435('0x30')]['rawAttributes'],function(_0x2b9fba){return{'name':_0x2b9fba[_0x2435('0x31')],'type':_0x2b9fba[_0x2435('0x32')][_0x2435('0x33')]};});_0x5b08ea[_0x2435('0x34')]=_[_0x2435('0x35')](_0x49f73d,_0x2435('0x2d'));_0x5b08ea['query']=_[_0x2435('0x36')](_0x1b819d['query']);_0x5b08ea[_0x2435('0x37')]=_[_0x2435('0x38')](_0x5b08ea[_0x2435('0x34')],_0x5b08ea[_0x2435('0x39')]);_0x5687e5[_0x2435('0x3a')]=_[_0x2435('0x38')](_0x5b08ea[_0x2435('0x34')],qs[_0x2435('0x3b')](_0x1b819d['query'][_0x2435('0x3b')]));_0x5687e5[_0x2435('0x3a')]=_0x5687e5[_0x2435('0x3a')][_0x2435('0x3c')]?_0x5687e5[_0x2435('0x3a')]:_0x5b08ea['model'];if(!_0x1b819d[_0x2435('0x39')]['hasOwnProperty']('nolimit')){_0x5687e5[_0x2435('0x1e')]=qs[_0x2435('0x1e')](_0x1b819d['query']['limit']);_0x5687e5[_0x2435('0x1c')]=qs[_0x2435('0x1c')](_0x1b819d[_0x2435('0x39')][_0x2435('0x1c')]);}_0x5687e5[_0x2435('0x3d')]=qs[_0x2435('0x3e')](_0x1b819d[_0x2435('0x39')]['sort']);_0x5687e5[_0x2435('0x3f')]=qs[_0x2435('0x37')](_['pick'](_0x1b819d[_0x2435('0x39')],_0x5b08ea[_0x2435('0x37')]),_0x49f73d);if(_0x1b819d['query']['filter']){_0x5687e5[_0x2435('0x3f')]=_[_0x2435('0x40')](_0x5687e5['where'],{'$or':_[_0x2435('0x35')](_0x49f73d,function(_0x5bf830){if(_0x5bf830[_0x2435('0x32')]!==_0x2435('0x41')){var _0x31a422={};_0x31a422[_0x5bf830[_0x2435('0x2d')]]={'$like':'%'+_0x1b819d[_0x2435('0x39')][_0x2435('0x42')]+'%'};return _0x31a422;}})});}_0x5687e5=_['merge']({},_0x5687e5,_0x1b819d[_0x2435('0x43')]);var _0x6474b0={'where':_0x5687e5['where']};return db[_0x2435('0x30')][_0x2435('0x1f')](_0x6474b0)[_0x2435('0x26')](function(_0x166f1a){_0x3888ad[_0x2435('0x1f')]=_0x166f1a;if(_0x1b819d[_0x2435('0x39')][_0x2435('0x44')]){_0x5687e5[_0x2435('0x45')]=[{'all':!![]}];}return db[_0x2435('0x30')][_0x2435('0x46')](_0x5687e5);})[_0x2435('0x26')](function(_0x112918){_0x3888ad[_0x2435('0x47')]=_0x112918;return _0x3888ad;})[_0x2435('0x26')](respondWithFilteredResult(_0x1d9df3,_0x5687e5))[_0x2435('0x48')](handleError(_0x1d9df3,null));};exports['show']=function(_0x34d57b,_0x140237){var _0x42a0da={'raw':!![],'where':{'id':_0x34d57b[_0x2435('0x49')]['id']}},_0x5e52ff={};_0x5e52ff[_0x2435('0x34')]=_[_0x2435('0x36')](db[_0x2435('0x30')][_0x2435('0x4a')]);_0x5e52ff[_0x2435('0x39')]=_[_0x2435('0x36')](_0x34d57b['query']);_0x5e52ff[_0x2435('0x37')]=_['intersection'](_0x5e52ff['model'],_0x5e52ff[_0x2435('0x39')]);_0x42a0da[_0x2435('0x3a')]=_[_0x2435('0x38')](_0x5e52ff['model'],qs[_0x2435('0x3b')](_0x34d57b['query']['fields']));_0x42a0da['attributes']=_0x42a0da[_0x2435('0x3a')][_0x2435('0x3c')]?_0x42a0da[_0x2435('0x3a')]:_0x5e52ff['model'];if(_0x34d57b[_0x2435('0x39')][_0x2435('0x44')]){_0x42a0da[_0x2435('0x45')]=[{'all':!![]}];}_0x42a0da=_[_0x2435('0x40')]({},_0x42a0da,_0x34d57b[_0x2435('0x43')]);return db[_0x2435('0x30')][_0x2435('0x4b')](_0x42a0da)['then'](handleEntityNotFound(_0x140237,null))[_0x2435('0x26')](respondWithResult(_0x140237,null))[_0x2435('0x48')](handleError(_0x140237,null));};exports['create']=function(_0x56ed5a,_0x691a0d){return db[_0x2435('0x30')][_0x2435('0x4c')](_0x56ed5a[_0x2435('0x4d')],{})[_0x2435('0x26')](function(_0x1ad1c5){var _0x2e6e5a=_0x56ed5a[_0x2435('0x4e')]['get']({'plain':!![]});if(!_0x2e6e5a)throw new Error(_0x2435('0x4f'));if(_0x2e6e5a['role']===_0x2435('0x4e')){var _0x420c91=_0x1ad1c5[_0x2435('0x28')]({'plain':!![]});var _0x4a646b=_0x2435('0x29');return db[_0x2435('0x50')][_0x2435('0x4b')]({'where':{'name':_0x4a646b,'userProfileId':_0x2e6e5a[_0x2435('0x51')]},'raw':!![]})[_0x2435('0x26')](function(_0x437a9b){if(_0x437a9b&&_0x437a9b['autoAssociation']===0x0){return db[_0x2435('0x2a')][_0x2435('0x4c')]({'name':_0x420c91[_0x2435('0x2d')],'resourceId':_0x420c91['id'],'type':_0x437a9b[_0x2435('0x2d')],'sectionId':_0x437a9b['id']},{})['then'](function(){return _0x1ad1c5;});}else{return _0x1ad1c5;}})['catch'](function(_0x4f42c4){logger[_0x2435('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f42c4);throw _0x4f42c4;});}return _0x1ad1c5;})[_0x2435('0x26')](respondWithResult(_0x691a0d,0xc9))['catch'](handleError(_0x691a0d,null));};exports[_0x2435('0x25')]=function(_0x9a0d2f,_0x524b4b){if(_0x9a0d2f[_0x2435('0x4d')]['id']){delete _0x9a0d2f[_0x2435('0x4d')]['id'];}return db[_0x2435('0x30')][_0x2435('0x4b')]({'where':{'id':_0x9a0d2f[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x524b4b,null))['then'](saveUpdates(_0x9a0d2f['body'],null))[_0x2435('0x26')](respondWithResult(_0x524b4b,null))[_0x2435('0x48')](handleError(_0x524b4b,null));};exports[_0x2435('0x27')]=function(_0x5a9500,_0x12db9b){return db[_0x2435('0x30')][_0x2435('0x4b')]({'where':{'id':_0x5a9500[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x12db9b,null))['then'](removeEntity(_0x12db9b,null))[_0x2435('0x48')](handleError(_0x12db9b,null));};exports['describe']=function(_0x49a381,_0x58898e){return db[_0x2435('0x30')][_0x2435('0x52')]()[_0x2435('0x26')](respondWithResult(_0x58898e,null))[_0x2435('0x48')](handleError(_0x58898e,null));};exports['getMembers']=function(_0x20fe3a,_0x228afa,_0x130f3c){var _0x130a0d={'raw':!![],'where':{}},_0x274b80={},_0x5b71cb;return db['OpenchannelQueue'][_0x2435('0x53')]({'where':{'id':_0x20fe3a[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x228afa,null))[_0x2435('0x26')](function(_0x58951e){if(_0x58951e){_0x5b71cb=_0x58951e[_0x2435('0x28')]({'plain':!![]});_0x274b80[_0x2435('0x34')]=_['keys'](db[_0x2435('0x54')]['rawAttributes']);_0x274b80[_0x2435('0x39')]=_[_0x2435('0x36')](_0x20fe3a[_0x2435('0x39')]);_0x274b80['filters']=_['intersection'](_0x274b80[_0x2435('0x34')],_0x274b80[_0x2435('0x39')]);_0x130a0d[_0x2435('0x3a')]=_[_0x2435('0x38')](_0x274b80[_0x2435('0x34')],qs[_0x2435('0x3b')](_0x20fe3a[_0x2435('0x39')]['fields']));_0x130a0d[_0x2435('0x3a')]=_0x130a0d[_0x2435('0x3a')][_0x2435('0x3c')]?_0x130a0d[_0x2435('0x3a')]:_0x274b80['model'];if(!_0x20fe3a[_0x2435('0x39')]['hasOwnProperty'](_0x2435('0x55'))){_0x130a0d[_0x2435('0x1e')]=qs[_0x2435('0x1e')](_0x20fe3a[_0x2435('0x39')]['limit']);_0x130a0d[_0x2435('0x1c')]=qs['offset'](_0x20fe3a[_0x2435('0x39')][_0x2435('0x1c')]);}_0x130a0d[_0x2435('0x3d')]=qs[_0x2435('0x3e')](_0x20fe3a[_0x2435('0x39')][_0x2435('0x3e')]);_0x130a0d[_0x2435('0x3f')]=qs[_0x2435('0x37')](_[_0x2435('0x56')](_0x20fe3a[_0x2435('0x39')],_0x274b80[_0x2435('0x37')]));_0x130a0d[_0x2435('0x3f')]['OpenchannelQueueId']=_0x58951e['id'];if(_0x20fe3a['query'][_0x2435('0x42')]){_0x130a0d[_0x2435('0x3f')]=_[_0x2435('0x40')](_0x130a0d[_0x2435('0x3f')],{'$or':_[_0x2435('0x35')](_0x130a0d[_0x2435('0x3a')],function(_0x47e046){var _0x4847b0={};_0x4847b0[_0x47e046]={'$like':'%'+_0x20fe3a['query'][_0x2435('0x42')]+'%'};return _0x4847b0;})});}_0x130a0d=_[_0x2435('0x40')]({},_0x130a0d,_0x20fe3a['options']);return db[_0x2435('0x54')][_0x2435('0x46')](_0x130a0d);}})[_0x2435('0x26')](function(_0x104224){if(_0x104224){return db['User']['findAndCountAll']({'where':{'id':_[_0x2435('0x35')](_0x104224,'UserId'),'role':_0x2435('0x57')},'attributes':['id','name',_0x2435('0x58'),_0x2435('0x59'),_0x2435('0x5a')]});}})[_0x2435('0x26')](function(_0x4336ec){if(_0x4336ec){return{'count':_0x4336ec[_0x2435('0x1f')],'rows':_[_0x2435('0x35')](_0x4336ec[_0x2435('0x47')],function(_0x44793c){return{'membername':_0x44793c[_0x2435('0x2d')],'UserId':_0x44793c['id'],'queue_name':_0x5b71cb[_0x2435('0x2d')],'OpenchannelQueueId':_0x5b71cb['id'],'interface':util[_0x2435('0x5b')]('%s/%s',_0x2435('0x5c'),_0x44793c[_0x2435('0x2d')]),'penalty':0x0,'paused':_0x44793c[_0x2435('0x58')],'createdAt':_0x44793c[_0x2435('0x5a')],'updatedAt':_0x44793c[_0x2435('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2435('0x26')](respondWithFilteredResult(_0x228afa,_0x130a0d))['catch'](handleError(_0x228afa,null));};exports['getTeams']=function(_0x809c7f,_0x967bdd,_0x4d62b4){var _0x4d4735={};var _0x77b535={};var _0x53c5c7;var _0x570846;return db[_0x2435('0x30')]['findOne']({'where':{'id':_0x809c7f[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x967bdd,null))[_0x2435('0x26')](function(_0x3c662c){if(_0x3c662c){_0x53c5c7=_0x3c662c;_0x77b535['model']=_['keys'](db[_0x2435('0x5d')][_0x2435('0x4a')]);_0x77b535[_0x2435('0x39')]=_[_0x2435('0x36')](_0x809c7f[_0x2435('0x39')]);_0x77b535[_0x2435('0x37')]=_[_0x2435('0x38')](_0x77b535[_0x2435('0x34')],_0x77b535[_0x2435('0x39')]);_0x4d4735[_0x2435('0x3a')]=_[_0x2435('0x38')](_0x77b535['model'],qs[_0x2435('0x3b')](_0x809c7f['query'][_0x2435('0x3b')]));_0x4d4735[_0x2435('0x3a')]=_0x4d4735[_0x2435('0x3a')][_0x2435('0x3c')]?_0x4d4735[_0x2435('0x3a')]:_0x77b535['model'];_0x4d4735[_0x2435('0x3d')]=qs[_0x2435('0x3e')](_0x809c7f['query'][_0x2435('0x3e')]);_0x4d4735[_0x2435('0x3f')]=qs[_0x2435('0x37')](_[_0x2435('0x56')](_0x809c7f[_0x2435('0x39')],_0x77b535[_0x2435('0x37')]));if(_0x809c7f['query']['filter']){_0x4d4735[_0x2435('0x3f')]=_[_0x2435('0x40')](_0x4d4735[_0x2435('0x3f')],{'$or':_[_0x2435('0x35')](_0x4d4735['attributes'],function(_0x534989){var _0x3afb55={};_0x3afb55[_0x534989]={'$like':'%'+_0x809c7f[_0x2435('0x39')][_0x2435('0x42')]+'%'};return _0x3afb55;})});}_0x4d4735=_[_0x2435('0x40')]({},_0x4d4735,_0x809c7f['options']);return _0x53c5c7['getTeams'](_0x4d4735);}})[_0x2435('0x26')](function(_0xa740f2){if(_0xa740f2){_0x570846=_0xa740f2['length'];if(!_0x809c7f[_0x2435('0x39')][_0x2435('0x5e')]('nolimit')){_0x4d4735['limit']=qs[_0x2435('0x1e')](_0x809c7f[_0x2435('0x39')][_0x2435('0x1e')]);_0x4d4735[_0x2435('0x1c')]=qs[_0x2435('0x1c')](_0x809c7f[_0x2435('0x39')][_0x2435('0x1c')]);}return _0x53c5c7[_0x2435('0x5f')](_0x4d4735);}})[_0x2435('0x26')](function(_0xc38837){if(_0xc38837){return _0xc38837?{'count':_0x570846,'rows':_0xc38837}:null;}})['then'](respondWithResult(_0x967bdd,null))['catch'](handleError(_0x967bdd,null));};exports['addTeams']=function(_0x558683,_0x4702bb,_0x399f10){var _0x31baf4=_0x558683[_0x2435('0x4d')][_0x2435('0x60')];return db['Team']['findAll']({'where':{'id':_0x31baf4},'attributes':['id'],'include':[{'model':db[_0x2435('0x61')],'as':_0x2435('0x62'),'attributes':['id',_0x2435('0x2d'),_0x2435('0x63'),_0x2435('0x64'),_0x2435('0x65')],'raw':!![]}]})[_0x2435('0x26')](function(_0x5ccf46){if(_0x5ccf46){var _0x23497a=_[_0x2435('0x66')](_0x5ccf46,function(_0x1587d7){var _0x330940=_0x1587d7['get']({'plain':!![]});return _0x330940[_0x2435('0x62')];});return db[_0x2435('0x30')][_0x2435('0x4b')]({'where':{'id':_0x558683['params']['id']}})[_0x2435('0x26')](function(_0x1d953e){return db[_0x2435('0x67')][_0x2435('0x68')](function(_0x425d5c){return _0x1d953e[_0x2435('0x69')](_0x31baf4,{'transaction':_0x425d5c})[_0x2435('0x26')](function(){return BPromise['each'](_0x23497a,function(_0x31fe1b){return db['UserOpenchannelQueue'][_0x2435('0x6a')]({'where':{'UserId':_0x31fe1b['id'],'OpenchannelQueueId':_0x558683[_0x2435('0x49')]['id']},'transaction':_0x425d5c});});})[_0x2435('0x26')](function(){_0x23497a[_0x2435('0x6b')](function(_0x434c17){socket[_0x2435('0x6c')](_0x2435('0x6d'),{'UserId':_0x434c17['id'],'OpenchannelQueueId':_0x1d953e['id']});});});});});}})[_0x2435('0x26')](respondWithStatusCode(_0x4702bb,null))[_0x2435('0x48')](handleError(_0x4702bb,null));};exports[_0x2435('0x6e')]=function(_0x4989ba,_0x3fa745,_0x579384){return db[_0x2435('0x5d')][_0x2435('0x46')]({'where':{'id':_0x4989ba['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2435('0x61')],'as':_0x2435('0x62'),'attributes':['id'],'raw':!![]}]})[_0x2435('0x26')](handleEntityNotFound(_0x3fa745,null))[_0x2435('0x26')](function(_0x45aaf3){var _0x453584=_[_0x2435('0x35')](_0x45aaf3,'id');var _0x1bd31e=[];var _0x5e1645=[];var _0x291fbb=squel[_0x2435('0x6f')]();_0x291fbb[_0x2435('0x70')](_0x2435('0x71'))[_0x2435('0x72')]('team_has_openchannel_queues','tq')['join']('user_has_teams','ut',_0x2435('0x73'))[_0x2435('0x3f')](_0x2435('0x74'),_0x4989ba[_0x2435('0x49')]['id']);for(var _0x5aaf9a=0x0;_0x5aaf9a<_0x45aaf3[_0x2435('0x3c')];_0x5aaf9a+=0x1){let _0x5c46f9=_0x45aaf3[_0x5aaf9a];for(var _0x253558=0x0;_0x253558<_0x5c46f9[_0x2435('0x62')][_0x2435('0x3c')];_0x253558+=0x1){let _0x1f7ff5=_0x5c46f9[_0x2435('0x62')][_0x253558];var _0x1eedf3=_0x291fbb['clone']();_0x1eedf3[_0x2435('0x3f')](_0x2435('0x75'),_0x1f7ff5['id']);_0x5e1645[_0x2435('0x76')](db[_0x2435('0x67')][_0x2435('0x39')](_0x1eedf3[_0x2435('0x77')](),{'type':db[_0x2435('0x67')][_0x2435('0x78')][_0x2435('0x79')]})[_0x2435('0x26')](function(_0x1f639f){if(_0x1f639f[_0x2435('0x3c')]===0x1){return _0x1f7ff5['id'];}else{var _0x552fe2=_['every'](_[_0x2435('0x35')](_0x1f639f,'TeamId'),function(_0x52889b){return _[_0x2435('0x7a')](_0x453584,_0x52889b);});if(_0x552fe2){return _0x1f7ff5['id'];}}}));}}return BPromise[_0x2435('0x7b')](_0x5e1645)[_0x2435('0x26')](function(_0x3d500f){_0x1bd31e=_(_0x1bd31e)['union'](_0x3d500f)['compact']()[_0x2435('0x7c')]();return db[_0x2435('0x30')]['find']({'where':{'id':_0x4989ba[_0x2435('0x49')]['id']}})[_0x2435('0x26')](function(_0x3cbf21){return db[_0x2435('0x67')][_0x2435('0x68')](function(_0xeff766){return _0x3cbf21[_0x2435('0x6e')](_0x4989ba['query']['ids'],{'transaction':_0xeff766})['then'](function(){if(!_['isEmpty'](_0x1bd31e)){return _0x3cbf21[_0x2435('0x7d')](_0x1bd31e,{'transaction':_0xeff766});}})[_0x2435('0x26')](function(){_0x1bd31e[_0x2435('0x6b')](function(_0x115d59){socket['emit'](_0x2435('0x7e'),{'UserId':_0x115d59,'OpenchannelQueueId':_0x3cbf21['id']});});});});});});})['then'](respondWithStatusCode(_0x3fa745,null))[_0x2435('0x48')](handleError(_0x3fa745,null));};exports[_0x2435('0x7f')]=function(_0xd53ae7,_0x1d86ed,_0x5e4020){return db[_0x2435('0x30')][_0x2435('0x4b')]({'where':{'id':_0xd53ae7[_0x2435('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d86ed,null))[_0x2435('0x26')](function(_0x14eed3){if(_0x14eed3){return _0x14eed3[_0x2435('0x7f')](_0xd53ae7['body']['ids'],_[_0x2435('0x80')](_0xd53ae7[_0x2435('0x4d')],['ids','id'])||{})[_0x2435('0x81')](function(_0x2206b0){for(var _0x574e5c=0x0;_0x574e5c<_0xd53ae7[_0x2435('0x4d')]['ids'][_0x2435('0x3c')];_0x574e5c+=0x1){socket[_0x2435('0x6c')](_0x2435('0x6d'),{'UserId':Number(_0xd53ae7['body']['ids'][_0x574e5c]),'OpenchannelQueueId':Number(_0xd53ae7[_0x2435('0x49')]['id'])});}return _0x2206b0;});}})[_0x2435('0x26')](respondWithResult(_0x1d86ed,null))[_0x2435('0x48')](handleError(_0x1d86ed,null));};exports[_0x2435('0x7d')]=function(_0x38c1b9,_0x25230a,_0x2323c0){return db[_0x2435('0x30')][_0x2435('0x4b')]({'where':{'id':_0x38c1b9[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x25230a,null))[_0x2435('0x26')](function(_0x5219c3){if(_0x5219c3){return _0x5219c3[_0x2435('0x7d')](_0x38c1b9[_0x2435('0x39')][_0x2435('0x60')])[_0x2435('0x26')](function(){if(_[_0x2435('0x82')](_0x38c1b9[_0x2435('0x39')][_0x2435('0x60')])){for(var _0x1ccf05=0x0;_0x1ccf05<_0x38c1b9['query'][_0x2435('0x60')][_0x2435('0x3c')];_0x1ccf05+=0x1){socket['emit'](_0x2435('0x7e'),{'UserId':Number(_0x38c1b9[_0x2435('0x39')][_0x2435('0x60')][_0x1ccf05]),'OpenchannelQueueId':Number(_0x38c1b9['params']['id'])});}}else{socket[_0x2435('0x6c')](_0x2435('0x7e'),{'UserId':Number(_0x38c1b9[_0x2435('0x39')][_0x2435('0x60')]),'OpenchannelQueueId':Number(_0x38c1b9[_0x2435('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x25230a,null))['catch'](handleError(_0x25230a,null));};exports[_0x2435('0x83')]=function(_0x187e66,_0x244203,_0x3aaa5){var _0x24a0ac={};var _0x328656={};var _0x14152d;var _0x1c6272;return db[_0x2435('0x30')][_0x2435('0x53')]({'where':{'id':_0x187e66[_0x2435('0x49')]['id']}})[_0x2435('0x26')](handleEntityNotFound(_0x244203,null))[_0x2435('0x26')](function(_0x1175d2){if(_0x1175d2){_0x14152d=_0x1175d2;_0x328656[_0x2435('0x34')]=_[_0x2435('0x36')](db['User'][_0x2435('0x4a')]);_0x328656[_0x2435('0x39')]=_[_0x2435('0x36')](_0x187e66[_0x2435('0x39')]);_0x328656['filters']=_[_0x2435('0x38')](_0x328656[_0x2435('0x34')],_0x328656['query']);_0x24a0ac['attributes']=_[_0x2435('0x38')](_0x328656[_0x2435('0x34')],qs['fields'](_0x187e66[_0x2435('0x39')][_0x2435('0x3b')]));_0x24a0ac['attributes']=_0x24a0ac[_0x2435('0x3a')][_0x2435('0x3c')]?_0x24a0ac[_0x2435('0x3a')]:_0x328656[_0x2435('0x34')];_0x24a0ac['order']=qs[_0x2435('0x3e')](_0x187e66[_0x2435('0x39')][_0x2435('0x3e')]);_0x24a0ac[_0x2435('0x3f')]=qs['filters'](_[_0x2435('0x56')](_0x187e66[_0x2435('0x39')],_0x328656[_0x2435('0x37')]));if(_0x187e66[_0x2435('0x39')][_0x2435('0x42')]){_0x24a0ac['where']=_['merge'](_0x24a0ac[_0x2435('0x3f')],{'$or':_[_0x2435('0x35')](_0x24a0ac[_0x2435('0x3a')],function(_0x1b3981){var _0xffe1a0={};_0xffe1a0[_0x1b3981]={'$like':'%'+_0x187e66[_0x2435('0x39')]['filter']+'%'};return _0xffe1a0;})});}_0x24a0ac=_[_0x2435('0x40')]({},_0x24a0ac,_0x187e66[_0x2435('0x43')]);return _0x14152d[_0x2435('0x83')](_0x24a0ac);}})['then'](function(_0x5870b1){if(_0x5870b1){_0x1c6272=_0x5870b1[_0x2435('0x3c')];if(!_0x187e66[_0x2435('0x39')][_0x2435('0x5e')](_0x2435('0x55'))){_0x24a0ac['limit']=qs[_0x2435('0x1e')](_0x187e66['query']['limit']);_0x24a0ac[_0x2435('0x1c')]=qs['offset'](_0x187e66[_0x2435('0x39')][_0x2435('0x1c')]);}return _0x14152d[_0x2435('0x83')](_0x24a0ac);}})[_0x2435('0x26')](function(_0x49cda6){if(_0x49cda6){return _0x49cda6?{'count':_0x1c6272,'rows':_0x49cda6}:null;}})[_0x2435('0x26')](respondWithResult(_0x244203,null))[_0x2435('0x48')](handleError(_0x244203,null));}; \ No newline at end of file +var _0x72eb=['userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','userOpenchannelQueue:remove','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','OpenchannelQueueId','UserOpenchannelQueue','findAll','User','agent','format','%s/%s','SIP','createdAt','getTeams','findOne','pick','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','findOrCreate','forEach','emit'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x72eb,0x1b7));var _0xb72e=function(_0x145e61,_0x2c40d1){_0x145e61=_0x145e61-0x0;var _0x2a2f9b=_0x72eb[_0x145e61];return _0x2a2f9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb72e('0x0'));var zipdir=require(_0xb72e('0x1'));var jsonpatch=require(_0xb72e('0x2'));var rp=require(_0xb72e('0x3'));var moment=require(_0xb72e('0x4'));var BPromise=require(_0xb72e('0x5'));var Mustache=require('mustache');var util=require(_0xb72e('0x6'));var path=require(_0xb72e('0x7'));var sox=require(_0xb72e('0x8'));var csv=require(_0xb72e('0x9'));var ejs=require(_0xb72e('0xa'));var fs=require('fs');var fs_extra=require(_0xb72e('0xb'));var _=require(_0xb72e('0xc'));var squel=require(_0xb72e('0xd'));var crypto=require(_0xb72e('0xe'));var jsforce=require(_0xb72e('0xf'));var deskjs=require(_0xb72e('0x10'));var toCsv=require(_0xb72e('0x9'));var querystring=require(_0xb72e('0x11'));var Papa=require(_0xb72e('0x12'));var Redis=require(_0xb72e('0x13'));var authService=require(_0xb72e('0x14'));var qs=require(_0xb72e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb72e('0x16'));var logger=require(_0xb72e('0x17'))(_0xb72e('0x18'));var utils=require('../../config/utils');var config=require(_0xb72e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb72e('0x1a'))['db'];config['redis']=_[_0xb72e('0x1b')](config[_0xb72e('0x1c')],{'host':_0xb72e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb72e('0x1c')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x400c4c,_0x5ebf6e){_0x5ebf6e=_0x5ebf6e||0xcc;return function(_0x41bd64){if(_0x41bd64){return _0x400c4c[_0xb72e('0x1e')](_0x5ebf6e);}return _0x400c4c['status'](_0x5ebf6e)[_0xb72e('0x1f')]();};}function respondWithResult(_0x40f230,_0x401320){_0x401320=_0x401320||0xc8;return function(_0x5909e9){if(_0x5909e9){return _0x40f230[_0xb72e('0x20')](_0x401320)[_0xb72e('0x21')](_0x5909e9);}};}function respondWithFilteredResult(_0x29acda,_0x4377cc){return function(_0x3b03de){if(_0x3b03de){var _0x1dad65=typeof _0x4377cc['offset']==='undefined'&&typeof _0x4377cc[_0xb72e('0x22')]===_0xb72e('0x23');var _0x5311a7=_0x3b03de[_0xb72e('0x24')];var _0xb484b2=_0x1dad65?0x0:_0x4377cc[_0xb72e('0x25')];var _0xe86ff=_0x1dad65?_0x3b03de['count']:_0x4377cc['offset']+_0x4377cc[_0xb72e('0x22')];var _0x56f57a;if(_0xe86ff>=_0x5311a7){_0xe86ff=_0x5311a7;_0x56f57a=0xc8;}else{_0x56f57a=0xce;}_0x29acda[_0xb72e('0x20')](_0x56f57a);return _0x29acda[_0xb72e('0x26')](_0xb72e('0x27'),_0xb484b2+'-'+_0xe86ff+'/'+_0x5311a7)['json'](_0x3b03de);}return null;};}function patchUpdates(_0x58f74a){return function(_0x280c61){try{jsonpatch[_0xb72e('0x28')](_0x280c61,_0x58f74a,!![]);}catch(_0x5a0f97){return BPromise[_0xb72e('0x29')](_0x5a0f97);}return _0x280c61['save']();};}function saveUpdates(_0x5d4f19,_0x5b7417){return function(_0x2328d3){if(_0x2328d3){return _0x2328d3['update'](_0x5d4f19)[_0xb72e('0x2a')](function(_0x589422){return _0x589422;});}return null;};}function removeEntity(_0x2ac858,_0x2e2aea){return function(_0x3dbbe2){if(_0x3dbbe2){return _0x3dbbe2[_0xb72e('0x2b')]()[_0xb72e('0x2a')](function(){var _0xd4f087=_0x3dbbe2[_0xb72e('0x2c')]({'plain':!![]});var _0x309a70='OpenchannelQueues';return db[_0xb72e('0x2d')][_0xb72e('0x2b')]({'where':{'type':_0x309a70,'resourceId':_0xd4f087['id']}})['then'](function(){return _0x3dbbe2;});})['then'](function(){_0x2ac858[_0xb72e('0x20')](0xcc)[_0xb72e('0x1f')]();});}};}function handleEntityNotFound(_0x125caf,_0x397019){return function(_0x31467a){if(!_0x31467a){_0x125caf[_0xb72e('0x1e')](0x194);}return _0x31467a;};}function handleError(_0x5abf4a,_0xe03848){_0xe03848=_0xe03848||0x1f4;return function(_0x225ed5){logger[_0xb72e('0x2e')](_0x225ed5[_0xb72e('0x2f')]);if(_0x225ed5[_0xb72e('0x30')]){delete _0x225ed5[_0xb72e('0x30')];}_0x5abf4a[_0xb72e('0x20')](_0xe03848)[_0xb72e('0x31')](_0x225ed5);};}exports[_0xb72e('0x32')]=function(_0x2e1bdf,_0x430873){var _0x39a36e={},_0xf5ec0d={},_0x52b6a0={'count':0x0,'rows':[]};var _0x4d207e=_[_0xb72e('0x33')](db[_0xb72e('0x34')][_0xb72e('0x35')],function(_0x3e5f6d){return{'name':_0x3e5f6d[_0xb72e('0x36')],'type':_0x3e5f6d['type'][_0xb72e('0x37')]};});_0xf5ec0d[_0xb72e('0x38')]=_[_0xb72e('0x33')](_0x4d207e,_0xb72e('0x30'));_0xf5ec0d[_0xb72e('0x39')]=_[_0xb72e('0x3a')](_0x2e1bdf[_0xb72e('0x39')]);_0xf5ec0d['filters']=_[_0xb72e('0x3b')](_0xf5ec0d[_0xb72e('0x38')],_0xf5ec0d[_0xb72e('0x39')]);_0x39a36e[_0xb72e('0x3c')]=_[_0xb72e('0x3b')](_0xf5ec0d[_0xb72e('0x38')],qs[_0xb72e('0x3d')](_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x3d')]));_0x39a36e['attributes']=_0x39a36e['attributes'][_0xb72e('0x3e')]?_0x39a36e[_0xb72e('0x3c')]:_0xf5ec0d[_0xb72e('0x38')];if(!_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x3f')]('nolimit')){_0x39a36e[_0xb72e('0x22')]=qs[_0xb72e('0x22')](_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x22')]);_0x39a36e['offset']=qs[_0xb72e('0x25')](_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x25')]);}_0x39a36e[_0xb72e('0x40')]=qs[_0xb72e('0x41')](_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x41')]);_0x39a36e[_0xb72e('0x42')]=qs[_0xb72e('0x43')](_['pick'](_0x2e1bdf['query'],_0xf5ec0d[_0xb72e('0x43')]),_0x4d207e);if(_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x44')]){_0x39a36e['where']=_['merge'](_0x39a36e['where'],{'$or':_['map'](_0x4d207e,function(_0x3a0ae1){if(_0x3a0ae1[_0xb72e('0x45')]!==_0xb72e('0x46')){var _0x59d47f={};_0x59d47f[_0x3a0ae1[_0xb72e('0x30')]]={'$like':'%'+_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x44')]+'%'};return _0x59d47f;}})});}_0x39a36e=_[_0xb72e('0x47')]({},_0x39a36e,_0x2e1bdf[_0xb72e('0x48')]);var _0x585fd1={'where':_0x39a36e['where']};return db[_0xb72e('0x34')][_0xb72e('0x24')](_0x585fd1)['then'](function(_0x5279d1){_0x52b6a0[_0xb72e('0x24')]=_0x5279d1;if(_0x2e1bdf[_0xb72e('0x39')][_0xb72e('0x49')]){_0x39a36e[_0xb72e('0x4a')]=[{'all':!![]}];}return db[_0xb72e('0x34')]['findAll'](_0x39a36e);})[_0xb72e('0x2a')](function(_0x261618){_0x52b6a0[_0xb72e('0x4b')]=_0x261618;return _0x52b6a0;})[_0xb72e('0x2a')](respondWithFilteredResult(_0x430873,_0x39a36e))[_0xb72e('0x4c')](handleError(_0x430873,null));};exports[_0xb72e('0x4d')]=function(_0x21a76e,_0x28106a){var _0x29afdb={'raw':!![],'where':{'id':_0x21a76e[_0xb72e('0x4e')]['id']}},_0x14617e={};_0x14617e[_0xb72e('0x38')]=_[_0xb72e('0x3a')](db[_0xb72e('0x34')][_0xb72e('0x35')]);_0x14617e[_0xb72e('0x39')]=_[_0xb72e('0x3a')](_0x21a76e[_0xb72e('0x39')]);_0x14617e[_0xb72e('0x43')]=_['intersection'](_0x14617e['model'],_0x14617e[_0xb72e('0x39')]);_0x29afdb[_0xb72e('0x3c')]=_['intersection'](_0x14617e[_0xb72e('0x38')],qs['fields'](_0x21a76e[_0xb72e('0x39')][_0xb72e('0x3d')]));_0x29afdb[_0xb72e('0x3c')]=_0x29afdb[_0xb72e('0x3c')][_0xb72e('0x3e')]?_0x29afdb[_0xb72e('0x3c')]:_0x14617e[_0xb72e('0x38')];if(_0x21a76e[_0xb72e('0x39')][_0xb72e('0x49')]){_0x29afdb[_0xb72e('0x4a')]=[{'all':!![]}];}_0x29afdb=_[_0xb72e('0x47')]({},_0x29afdb,_0x21a76e[_0xb72e('0x48')]);return db[_0xb72e('0x34')][_0xb72e('0x4f')](_0x29afdb)['then'](handleEntityNotFound(_0x28106a,null))[_0xb72e('0x2a')](respondWithResult(_0x28106a,null))['catch'](handleError(_0x28106a,null));};exports[_0xb72e('0x50')]=function(_0xf23d57,_0x47e9cd){return db[_0xb72e('0x34')][_0xb72e('0x50')](_0xf23d57['body'],{})[_0xb72e('0x2a')](function(_0x262e01){var _0x30dc9b=_0xf23d57['user']['get']({'plain':!![]});if(!_0x30dc9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30dc9b[_0xb72e('0x51')]===_0xb72e('0x52')){var _0x2f1f46=_0x262e01['get']({'plain':!![]});var _0x47806e='OpenchannelQueues';return db[_0xb72e('0x53')][_0xb72e('0x4f')]({'where':{'name':_0x47806e,'userProfileId':_0x30dc9b[_0xb72e('0x54')]},'raw':!![]})['then'](function(_0x4b16ee){if(_0x4b16ee&&_0x4b16ee[_0xb72e('0x55')]===0x0){return db[_0xb72e('0x2d')][_0xb72e('0x50')]({'name':_0x2f1f46['name'],'resourceId':_0x2f1f46['id'],'type':_0x4b16ee[_0xb72e('0x30')],'sectionId':_0x4b16ee['id']},{})[_0xb72e('0x2a')](function(){return _0x262e01;});}else{return _0x262e01;}})[_0xb72e('0x4c')](function(_0x3a53d0){logger[_0xb72e('0x2e')](_0xb72e('0x56'),_0x3a53d0);throw _0x3a53d0;});}return _0x262e01;})[_0xb72e('0x2a')](respondWithResult(_0x47e9cd,0xc9))[_0xb72e('0x4c')](handleError(_0x47e9cd,null));};exports[_0xb72e('0x57')]=function(_0x18aeb9,_0x1034ea){if(_0x18aeb9[_0xb72e('0x58')]['id']){delete _0x18aeb9[_0xb72e('0x58')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x18aeb9[_0xb72e('0x4e')]['id']}})[_0xb72e('0x2a')](handleEntityNotFound(_0x1034ea,null))[_0xb72e('0x2a')](saveUpdates(_0x18aeb9['body'],null))[_0xb72e('0x2a')](respondWithResult(_0x1034ea,null))[_0xb72e('0x4c')](handleError(_0x1034ea,null));};exports[_0xb72e('0x2b')]=function(_0x5227dd,_0x1816fb){return db['OpenchannelQueue']['find']({'where':{'id':_0x5227dd['params']['id']}})['then'](handleEntityNotFound(_0x1816fb,null))['then'](removeEntity(_0x1816fb,null))[_0xb72e('0x4c')](handleError(_0x1816fb,null));};exports[_0xb72e('0x59')]=function(_0x6b22c3,_0x53d2ff){return db[_0xb72e('0x34')][_0xb72e('0x59')]()[_0xb72e('0x2a')](respondWithResult(_0x53d2ff,null))[_0xb72e('0x4c')](handleError(_0x53d2ff,null));};exports['getMembers']=function(_0x168a32,_0x266c66,_0x97e3d0){var _0x5b00e4={'raw':!![],'where':{}},_0x23eefe={},_0x2a3df5;return db[_0xb72e('0x34')]['findOne']({'where':{'id':_0x168a32[_0xb72e('0x4e')]['id']}})[_0xb72e('0x2a')](handleEntityNotFound(_0x266c66,null))['then'](function(_0x582b3b){if(_0x582b3b){_0x2a3df5=_0x582b3b[_0xb72e('0x2c')]({'plain':!![]});_0x23eefe[_0xb72e('0x38')]=_[_0xb72e('0x3a')](db['UserOpenchannelQueue'][_0xb72e('0x35')]);_0x23eefe[_0xb72e('0x39')]=_[_0xb72e('0x3a')](_0x168a32['query']);_0x23eefe['filters']=_['intersection'](_0x23eefe[_0xb72e('0x38')],_0x23eefe[_0xb72e('0x39')]);_0x5b00e4[_0xb72e('0x3c')]=_['intersection'](_0x23eefe[_0xb72e('0x38')],qs[_0xb72e('0x3d')](_0x168a32['query'][_0xb72e('0x3d')]));_0x5b00e4[_0xb72e('0x3c')]=_0x5b00e4[_0xb72e('0x3c')][_0xb72e('0x3e')]?_0x5b00e4[_0xb72e('0x3c')]:_0x23eefe[_0xb72e('0x38')];if(!_0x168a32['query'][_0xb72e('0x3f')]('nolimit')){_0x5b00e4['limit']=qs[_0xb72e('0x22')](_0x168a32[_0xb72e('0x39')][_0xb72e('0x22')]);_0x5b00e4['offset']=qs['offset'](_0x168a32[_0xb72e('0x39')]['offset']);}_0x5b00e4[_0xb72e('0x40')]=qs[_0xb72e('0x41')](_0x168a32[_0xb72e('0x39')][_0xb72e('0x41')]);_0x5b00e4['where']=qs[_0xb72e('0x43')](_['pick'](_0x168a32[_0xb72e('0x39')],_0x23eefe[_0xb72e('0x43')]));_0x5b00e4[_0xb72e('0x42')][_0xb72e('0x5a')]=_0x582b3b['id'];if(_0x168a32[_0xb72e('0x39')][_0xb72e('0x44')]){_0x5b00e4[_0xb72e('0x42')]=_['merge'](_0x5b00e4[_0xb72e('0x42')],{'$or':_[_0xb72e('0x33')](_0x5b00e4[_0xb72e('0x3c')],function(_0x3570f7){var _0x13947a={};_0x13947a[_0x3570f7]={'$like':'%'+_0x168a32[_0xb72e('0x39')][_0xb72e('0x44')]+'%'};return _0x13947a;})});}_0x5b00e4=_[_0xb72e('0x47')]({},_0x5b00e4,_0x168a32['options']);return db[_0xb72e('0x5b')][_0xb72e('0x5c')](_0x5b00e4);}})[_0xb72e('0x2a')](function(_0x18d7bc){if(_0x18d7bc){return db[_0xb72e('0x5d')]['findAndCountAll']({'where':{'id':_[_0xb72e('0x33')](_0x18d7bc,'UserId'),'role':_0xb72e('0x5e')},'attributes':['id','name','openchannelPause','updatedAt','createdAt']});}})[_0xb72e('0x2a')](function(_0x7f2ec9){if(_0x7f2ec9){return{'count':_0x7f2ec9[_0xb72e('0x24')],'rows':_[_0xb72e('0x33')](_0x7f2ec9[_0xb72e('0x4b')],function(_0x27d1ec){return{'membername':_0x27d1ec[_0xb72e('0x30')],'UserId':_0x27d1ec['id'],'queue_name':_0x2a3df5[_0xb72e('0x30')],'OpenchannelQueueId':_0x2a3df5['id'],'interface':util[_0xb72e('0x5f')](_0xb72e('0x60'),_0xb72e('0x61'),_0x27d1ec[_0xb72e('0x30')]),'penalty':0x0,'paused':_0x27d1ec['openchannelPause'],'createdAt':_0x27d1ec[_0xb72e('0x62')],'updatedAt':_0x27d1ec['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb72e('0x2a')](respondWithFilteredResult(_0x266c66,_0x5b00e4))['catch'](handleError(_0x266c66,null));};exports[_0xb72e('0x63')]=function(_0x1c29a6,_0x260822,_0x2664cd){var _0x5e40a6={};var _0x578bef={};var _0x6378fa;var _0x56c2e8;return db[_0xb72e('0x34')][_0xb72e('0x64')]({'where':{'id':_0x1c29a6[_0xb72e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x260822,null))['then'](function(_0x39bf78){if(_0x39bf78){_0x6378fa=_0x39bf78;_0x578bef[_0xb72e('0x38')]=_[_0xb72e('0x3a')](db['Team'][_0xb72e('0x35')]);_0x578bef['query']=_['keys'](_0x1c29a6[_0xb72e('0x39')]);_0x578bef[_0xb72e('0x43')]=_[_0xb72e('0x3b')](_0x578bef['model'],_0x578bef['query']);_0x5e40a6[_0xb72e('0x3c')]=_[_0xb72e('0x3b')](_0x578bef[_0xb72e('0x38')],qs[_0xb72e('0x3d')](_0x1c29a6['query'][_0xb72e('0x3d')]));_0x5e40a6[_0xb72e('0x3c')]=_0x5e40a6[_0xb72e('0x3c')][_0xb72e('0x3e')]?_0x5e40a6[_0xb72e('0x3c')]:_0x578bef['model'];_0x5e40a6['order']=qs[_0xb72e('0x41')](_0x1c29a6[_0xb72e('0x39')]['sort']);_0x5e40a6[_0xb72e('0x42')]=qs[_0xb72e('0x43')](_[_0xb72e('0x65')](_0x1c29a6[_0xb72e('0x39')],_0x578bef[_0xb72e('0x43')]));if(_0x1c29a6[_0xb72e('0x39')][_0xb72e('0x44')]){_0x5e40a6[_0xb72e('0x42')]=_[_0xb72e('0x47')](_0x5e40a6[_0xb72e('0x42')],{'$or':_[_0xb72e('0x33')](_0x5e40a6['attributes'],function(_0x1a6a2d){var _0x217f58={};_0x217f58[_0x1a6a2d]={'$like':'%'+_0x1c29a6[_0xb72e('0x39')][_0xb72e('0x44')]+'%'};return _0x217f58;})});}_0x5e40a6=_[_0xb72e('0x47')]({},_0x5e40a6,_0x1c29a6[_0xb72e('0x48')]);return _0x6378fa['getTeams'](_0x5e40a6);}})['then'](function(_0x147d71){if(_0x147d71){_0x56c2e8=_0x147d71[_0xb72e('0x3e')];if(!_0x1c29a6[_0xb72e('0x39')][_0xb72e('0x3f')]('nolimit')){_0x5e40a6[_0xb72e('0x22')]=qs[_0xb72e('0x22')](_0x1c29a6[_0xb72e('0x39')]['limit']);_0x5e40a6['offset']=qs[_0xb72e('0x25')](_0x1c29a6[_0xb72e('0x39')]['offset']);}return _0x6378fa[_0xb72e('0x63')](_0x5e40a6);}})[_0xb72e('0x2a')](function(_0x19e59b){if(_0x19e59b){return _0x19e59b?{'count':_0x56c2e8,'rows':_0x19e59b}:null;}})[_0xb72e('0x2a')](respondWithResult(_0x260822,null))[_0xb72e('0x4c')](handleError(_0x260822,null));};exports[_0xb72e('0x66')]=function(_0x1cc6bd,_0x3b9ec3,_0x28ab12){var _0x5d8739=_0x1cc6bd[_0xb72e('0x58')][_0xb72e('0x67')];return db[_0xb72e('0x68')][_0xb72e('0x5c')]({'where':{'id':_0x5d8739},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb72e('0x69'),'attributes':['id',_0xb72e('0x30'),_0xb72e('0x6a'),_0xb72e('0x6b'),'interface'],'raw':!![]}]})[_0xb72e('0x2a')](function(_0xd651e0){if(_0xd651e0){var _0x4117c6=_[_0xb72e('0x6c')](_0xd651e0,function(_0x583bcb){var _0x38d7f0=_0x583bcb[_0xb72e('0x2c')]({'plain':!![]});return _0x38d7f0['Agents'];});return db[_0xb72e('0x34')][_0xb72e('0x4f')]({'where':{'id':_0x1cc6bd['params']['id']}})[_0xb72e('0x2a')](function(_0x5f2f7f){return db[_0xb72e('0x6d')]['transaction'](function(_0x3cd008){return _0x5f2f7f[_0xb72e('0x66')](_0x5d8739,{'transaction':_0x3cd008})[_0xb72e('0x2a')](function(){return BPromise['each'](_0x4117c6,function(_0x13be0e){return db[_0xb72e('0x5b')][_0xb72e('0x6e')]({'where':{'UserId':_0x13be0e['id'],'OpenchannelQueueId':_0x1cc6bd[_0xb72e('0x4e')]['id']},'transaction':_0x3cd008});});})[_0xb72e('0x2a')](function(){_0x4117c6[_0xb72e('0x6f')](function(_0x185793){socket[_0xb72e('0x70')](_0xb72e('0x71'),{'UserId':_0x185793['id'],'OpenchannelQueueId':_0x5f2f7f['id']});});});});});}})[_0xb72e('0x2a')](respondWithStatusCode(_0x3b9ec3,null))[_0xb72e('0x4c')](handleError(_0x3b9ec3,null));};exports[_0xb72e('0x72')]=function(_0xcd1d24,_0x434a26,_0x396d57){return db[_0xb72e('0x68')][_0xb72e('0x5c')]({'where':{'id':_0xcd1d24[_0xb72e('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb72e('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb72e('0x2a')](handleEntityNotFound(_0x434a26,null))[_0xb72e('0x2a')](function(_0x149122){var _0x35fd56=_[_0xb72e('0x33')](_0x149122,'id');var _0x46ec57=[];var _0x2fc63d=[];var _0x25351f=squel[_0xb72e('0x73')]();_0x25351f[_0xb72e('0x74')]('tq.TeamId')[_0xb72e('0x75')](_0xb72e('0x76'),'tq')[_0xb72e('0x77')]('user_has_teams','ut',_0xb72e('0x78'))['where'](_0xb72e('0x79'),_0xcd1d24[_0xb72e('0x4e')]['id']);for(var _0x32e448=0x0;_0x32e448<_0x149122[_0xb72e('0x3e')];_0x32e448+=0x1){let _0x58c0c1=_0x149122[_0x32e448];for(var _0x3abee7=0x0;_0x3abee7<_0x58c0c1['Agents'][_0xb72e('0x3e')];_0x3abee7+=0x1){let _0x3903a9=_0x58c0c1[_0xb72e('0x69')][_0x3abee7];var _0x12b8a8=_0x25351f[_0xb72e('0x7a')]();_0x12b8a8['where'](_0xb72e('0x7b'),_0x3903a9['id']);_0x2fc63d[_0xb72e('0x7c')](db[_0xb72e('0x6d')][_0xb72e('0x39')](_0x12b8a8[_0xb72e('0x7d')](),{'type':db[_0xb72e('0x6d')]['QueryTypes']['SELECT']})[_0xb72e('0x2a')](function(_0x5c741e){if(_0x5c741e['length']===0x1){return _0x3903a9['id'];}else{var _0x52d8a7=_[_0xb72e('0x7e')](_['map'](_0x5c741e,'TeamId'),function(_0x30ec2e){return _['includes'](_0x35fd56,_0x30ec2e);});if(_0x52d8a7){return _0x3903a9['id'];}}}));}}return BPromise[_0xb72e('0x7f')](_0x2fc63d)['then'](function(_0x1b36ff){_0x46ec57=_(_0x46ec57)[_0xb72e('0x80')](_0x1b36ff)[_0xb72e('0x81')]()[_0xb72e('0x82')]();return db[_0xb72e('0x34')][_0xb72e('0x4f')]({'where':{'id':_0xcd1d24['params']['id']}})[_0xb72e('0x2a')](function(_0x3e0110){return db['sequelize']['transaction'](function(_0x400a19){return _0x3e0110[_0xb72e('0x72')](_0xcd1d24[_0xb72e('0x39')][_0xb72e('0x67')],{'transaction':_0x400a19})['then'](function(){if(!_[_0xb72e('0x83')](_0x46ec57)){return _0x3e0110[_0xb72e('0x84')](_0x46ec57,{'transaction':_0x400a19});}})[_0xb72e('0x2a')](function(){_0x46ec57[_0xb72e('0x6f')](function(_0x52c2b9){socket[_0xb72e('0x70')]('userOpenchannelQueue:remove',{'UserId':_0x52c2b9,'OpenchannelQueueId':_0x3e0110['id']});});});});});});})[_0xb72e('0x2a')](respondWithStatusCode(_0x434a26,null))['catch'](handleError(_0x434a26,null));};exports[_0xb72e('0x85')]=function(_0x187abd,_0x5361b4,_0x127f6c){return db['OpenchannelQueue']['find']({'where':{'id':_0x187abd[_0xb72e('0x4e')]['id']}})[_0xb72e('0x2a')](handleEntityNotFound(_0x5361b4,null))[_0xb72e('0x2a')](function(_0x133974){if(_0x133974){return _0x133974[_0xb72e('0x85')](_0x187abd['body'][_0xb72e('0x67')],_[_0xb72e('0x86')](_0x187abd[_0xb72e('0x58')],[_0xb72e('0x67'),'id'])||{})['spread'](function(_0x26a602){for(var _0x3bcbd8=0x0;_0x3bcbd8<_0x187abd[_0xb72e('0x58')][_0xb72e('0x67')][_0xb72e('0x3e')];_0x3bcbd8+=0x1){socket[_0xb72e('0x70')](_0xb72e('0x71'),{'UserId':Number(_0x187abd[_0xb72e('0x58')][_0xb72e('0x67')][_0x3bcbd8]),'OpenchannelQueueId':Number(_0x187abd[_0xb72e('0x4e')]['id'])});}return _0x26a602;});}})['then'](respondWithResult(_0x5361b4,null))[_0xb72e('0x4c')](handleError(_0x5361b4,null));};exports[_0xb72e('0x84')]=function(_0x22d141,_0x3e4e93,_0x202700){return db[_0xb72e('0x34')][_0xb72e('0x4f')]({'where':{'id':_0x22d141[_0xb72e('0x4e')]['id']}})[_0xb72e('0x2a')](handleEntityNotFound(_0x3e4e93,null))[_0xb72e('0x2a')](function(_0x57c11e){if(_0x57c11e){return _0x57c11e[_0xb72e('0x84')](_0x22d141['query'][_0xb72e('0x67')])['then'](function(){if(_['isArray'](_0x22d141[_0xb72e('0x39')][_0xb72e('0x67')])){for(var _0x53e7f1=0x0;_0x53e7f1<_0x22d141['query']['ids']['length'];_0x53e7f1+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x22d141[_0xb72e('0x39')][_0xb72e('0x67')][_0x53e7f1]),'OpenchannelQueueId':Number(_0x22d141[_0xb72e('0x4e')]['id'])});}}else{socket[_0xb72e('0x70')](_0xb72e('0x87'),{'UserId':Number(_0x22d141[_0xb72e('0x39')][_0xb72e('0x67')]),'OpenchannelQueueId':Number(_0x22d141[_0xb72e('0x4e')]['id'])});}});}})[_0xb72e('0x2a')](respondWithStatusCode(_0x3e4e93,null))[_0xb72e('0x4c')](handleError(_0x3e4e93,null));};exports['getAgents']=function(_0x31f0d2,_0x47a29e,_0x10afc4){var _0x414ac6={};var _0x4c7381={};var _0x544407;var _0x5eab0a;return db['OpenchannelQueue'][_0xb72e('0x64')]({'where':{'id':_0x31f0d2[_0xb72e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x47a29e,null))[_0xb72e('0x2a')](function(_0xb3fc39){if(_0xb3fc39){_0x544407=_0xb3fc39;_0x4c7381[_0xb72e('0x38')]=_[_0xb72e('0x3a')](db['User'][_0xb72e('0x35')]);_0x4c7381[_0xb72e('0x39')]=_['keys'](_0x31f0d2[_0xb72e('0x39')]);_0x4c7381[_0xb72e('0x43')]=_['intersection'](_0x4c7381[_0xb72e('0x38')],_0x4c7381[_0xb72e('0x39')]);_0x414ac6['attributes']=_[_0xb72e('0x3b')](_0x4c7381[_0xb72e('0x38')],qs[_0xb72e('0x3d')](_0x31f0d2[_0xb72e('0x39')][_0xb72e('0x3d')]));_0x414ac6['attributes']=_0x414ac6['attributes']['length']?_0x414ac6[_0xb72e('0x3c')]:_0x4c7381[_0xb72e('0x38')];_0x414ac6[_0xb72e('0x40')]=qs['sort'](_0x31f0d2[_0xb72e('0x39')][_0xb72e('0x41')]);_0x414ac6['where']=qs[_0xb72e('0x43')](_['pick'](_0x31f0d2[_0xb72e('0x39')],_0x4c7381[_0xb72e('0x43')]));if(_0x31f0d2['query'][_0xb72e('0x44')]){_0x414ac6['where']=_['merge'](_0x414ac6[_0xb72e('0x42')],{'$or':_[_0xb72e('0x33')](_0x414ac6['attributes'],function(_0x216bfd){var _0x5e11ae={};_0x5e11ae[_0x216bfd]={'$like':'%'+_0x31f0d2[_0xb72e('0x39')][_0xb72e('0x44')]+'%'};return _0x5e11ae;})});}_0x414ac6=_[_0xb72e('0x47')]({},_0x414ac6,_0x31f0d2[_0xb72e('0x48')]);return _0x544407[_0xb72e('0x88')](_0x414ac6);}})[_0xb72e('0x2a')](function(_0x4ea136){if(_0x4ea136){_0x5eab0a=_0x4ea136[_0xb72e('0x3e')];if(!_0x31f0d2[_0xb72e('0x39')][_0xb72e('0x3f')](_0xb72e('0x89'))){_0x414ac6[_0xb72e('0x22')]=qs[_0xb72e('0x22')](_0x31f0d2[_0xb72e('0x39')][_0xb72e('0x22')]);_0x414ac6[_0xb72e('0x25')]=qs[_0xb72e('0x25')](_0x31f0d2['query'][_0xb72e('0x25')]);}return _0x544407['getAgents'](_0x414ac6);}})[_0xb72e('0x2a')](function(_0x32737a){if(_0x32737a){return _0x32737a?{'count':_0x5eab0a,'rows':_0x32737a}:null;}})[_0xb72e('0x2a')](respondWithResult(_0x47a29e,null))[_0xb72e('0x4c')](handleError(_0x47a29e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 55d07a4..0b9e0fb 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 _0x0ca5=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca5,0x1dc));var _0x50ca=function(_0x405600,_0x19dd0c){_0x405600=_0x405600-0x0;var _0x168eb4=_0x0ca5[_0x405600];return _0x168eb4;};'use strict';var EventEmitter=require(_0x50ca('0x0'));var OpenchannelQueue=require(_0x50ca('0x1'))['db'][_0x50ca('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x50ca('0x3')](0x0);var events={'afterCreate':_0x50ca('0x4'),'afterUpdate':_0x50ca('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c704a){return function(_0x461404,_0x47ae92,_0x25ce35){OpenchannelQueueEvents[_0x50ca('0x6')](_0x1c704a+':'+_0x461404['id'],_0x461404);OpenchannelQueueEvents['emit'](_0x1c704a,_0x461404);_0x25ce35(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x50ca('0x7')](e,emitEvent(event));}}module[_0x50ca('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xead4=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x4a1455,_0x30c47e){var _0x3d6ae7=function(_0x2e0da4){while(--_0x2e0da4){_0x4a1455['push'](_0x4a1455['shift']());}};_0x3d6ae7(++_0x30c47e);}(_0xead4,0x1e2));var _0x4ead=function(_0x15e7be,_0x29206b){_0x15e7be=_0x15e7be-0x0;var _0x305089=_0xead4[_0x15e7be];return _0x305089;};'use strict';var EventEmitter=require(_0x4ead('0x0'));var OpenchannelQueue=require(_0x4ead('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4ead('0x2')](0x0);var events={'afterCreate':_0x4ead('0x3'),'afterUpdate':_0x4ead('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6b7eda){return function(_0xb7264a,_0x5e5c6d,_0x4ab15f){OpenchannelQueueEvents['emit'](_0x6b7eda+':'+_0xb7264a['id'],_0xb7264a);OpenchannelQueueEvents[_0x4ead('0x5')](_0x6b7eda,_0xb7264a);_0x4ab15f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x4ead('0x6')](e,emitEvent(event));}}module[_0x4ead('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index dc13597..fccb911 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 _0x223c=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','../../config/logger','api','moment'];(function(_0x37cbfd,_0x31a00c){var _0x48c86b=function(_0x299838){while(--_0x299838){_0x37cbfd['push'](_0x37cbfd['shift']());}};_0x48c86b(++_0x31a00c);}(_0x223c,0x194));var _0xc223=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x223c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc223('0x0'))(_0xc223('0x1'));var moment=require(_0xc223('0x2'));var BPromise=require(_0xc223('0x3'));var rp=require(_0xc223('0x4'));var fs=require('fs');var path=require(_0xc223('0x5'));var rimraf=require(_0xc223('0x6'));var config=require(_0xc223('0x7'));var attributes=require(_0xc223('0x8'));module['exports']=function(_0x446c36,_0x18da6d){return _0x446c36[_0xc223('0x9')]('OpenchannelQueue',attributes,{'tableName':_0xc223('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe20=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x32bcf2,_0x36d3c1){var _0x627630=function(_0xa68a71){while(--_0xa68a71){_0x32bcf2['push'](_0x32bcf2['shift']());}};_0x627630(++_0x36d3c1);}(_0xfe20,0x15e));var _0x0fe2=function(_0x18750d,_0x111d4f){_0x18750d=_0x18750d-0x0;var _0x369439=_0xfe20[_0x18750d];return _0x369439;};'use strict';var _=require(_0x0fe2('0x0'));var util=require(_0x0fe2('0x1'));var logger=require(_0x0fe2('0x2'))(_0x0fe2('0x3'));var moment=require(_0x0fe2('0x4'));var BPromise=require(_0x0fe2('0x5'));var rp=require(_0x0fe2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fe2('0x7'));var config=require(_0x0fe2('0x8'));var attributes=require(_0x0fe2('0x9'));module[_0x0fe2('0xa')]=function(_0x41fb80,_0x5b9133){return _0x41fb80[_0x0fe2('0xb')](_0x0fe2('0xc'),attributes,{'tableName':_0x0fe2('0xd'),'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 3f73e0a..b25c538 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 _0x6ca6=['client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','find','ShowOpenchannelQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x283aa7,_0x41bd24){var _0x4e6248=function(_0x59b66b){while(--_0x59b66b){_0x283aa7['push'](_0x283aa7['shift']());}};_0x4e6248(++_0x41bd24);}(_0x6ca6,0x8f));var _0x66ca=function(_0x7ef68b,_0x534aa7){_0x7ef68b=_0x7ef68b-0x0;var _0x74921f=_0x6ca6[_0x7ef68b];return _0x74921f;};'use strict';var _=require('lodash');var util=require(_0x66ca('0x0'));var moment=require(_0x66ca('0x1'));var BPromise=require(_0x66ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66ca('0x3'));var db=require(_0x66ca('0x4'))['db'];var utils=require(_0x66ca('0x5'));var logger=require('../../config/logger')(_0x66ca('0x6'));var config=require(_0x66ca('0x7'));var jayson=require(_0x66ca('0x8'));var client=jayson[_0x66ca('0x9')]['http']({'port':0x232a});config[_0x66ca('0xa')]=_[_0x66ca('0xb')](config[_0x66ca('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x66ca('0xc'))(new Redis(config[_0x66ca('0xa')]));require(_0x66ca('0xd'))[_0x66ca('0xe')](socket);function respondWithRpcPromise(_0x228ce2,_0x551efb,_0x71cf97){return new BPromise(function(_0x2bf9ab,_0x2c0131){return client[_0x66ca('0xf')](_0x228ce2,_0x71cf97)[_0x66ca('0x10')](function(_0xd9c5c5){logger[_0x66ca('0x11')](_0x66ca('0x12'),_0x551efb,_0x66ca('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x551efb,_0x66ca('0x13'),JSON[_0x66ca('0x14')](_0xd9c5c5));if(_0xd9c5c5[_0x66ca('0x15')]){if(_0xd9c5c5[_0x66ca('0x15')][_0x66ca('0x16')]===0x1f4){logger[_0x66ca('0x15')](_0x66ca('0x12'),_0x551efb,_0xd9c5c5[_0x66ca('0x15')][_0x66ca('0x17')]);return _0x2c0131(_0xd9c5c5[_0x66ca('0x15')]['message']);}logger[_0x66ca('0x15')](_0x66ca('0x12'),_0x551efb,_0xd9c5c5[_0x66ca('0x15')][_0x66ca('0x17')]);return _0x2bf9ab(_0xd9c5c5[_0x66ca('0x15')]['message']);}else{logger[_0x66ca('0x11')](_0x66ca('0x12'),_0x551efb,'request\x20sent');_0x2bf9ab(_0xd9c5c5['result'][_0x66ca('0x17')]);}})[_0x66ca('0x18')](function(_0x25b4b1){logger['error'](_0x66ca('0x12'),_0x551efb,_0x25b4b1);_0x2c0131(_0x25b4b1);});});}exports['GetOpenchannelQueue']=function(_0x33b8f0){var _0x3a45ba=this;return new Promise(function(_0xa9250d,_0x305eb4){return db[_0x66ca('0x19')]['findAll']({'raw':_0x33b8f0[_0x66ca('0x1a')]?_0x33b8f0[_0x66ca('0x1a')][_0x66ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x33b8f0[_0x66ca('0x1a')]?_0x33b8f0[_0x66ca('0x1a')][_0x66ca('0x1c')]||null:null,'attributes':_0x33b8f0[_0x66ca('0x1a')]?_0x33b8f0[_0x66ca('0x1a')][_0x66ca('0x1d')]||null:null,'limit':_0x33b8f0[_0x66ca('0x1a')]?_0x33b8f0['options'][_0x66ca('0x1e')]||null:null,'include':_0x33b8f0[_0x66ca('0x1a')]?_0x33b8f0[_0x66ca('0x1a')][_0x66ca('0x1f')]?_[_0x66ca('0x20')](_0x33b8f0[_0x66ca('0x1a')][_0x66ca('0x1f')],function(_0xb6969d){return{'model':db[_0xb6969d[_0x66ca('0x21')]],'as':_0xb6969d['as'],'attributes':_0xb6969d['attributes'],'include':_0xb6969d[_0x66ca('0x1f')]?_[_0x66ca('0x20')](_0xb6969d[_0x66ca('0x1f')],function(_0x49e99f){return{'model':db[_0x49e99f[_0x66ca('0x21')]],'as':_0x49e99f['as'],'attributes':_0x49e99f[_0x66ca('0x1d')],'include':_0x49e99f[_0x66ca('0x1f')]?_[_0x66ca('0x20')](_0x49e99f[_0x66ca('0x1f')],function(_0x4a9541){return{'model':db[_0x4a9541[_0x66ca('0x21')]],'as':_0x4a9541['as'],'attributes':_0x4a9541[_0x66ca('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43eb84){logger['info'](_0x66ca('0x22'),_0x33b8f0);logger[_0x66ca('0x23')](_0x66ca('0x22'),_0x33b8f0,JSON[_0x66ca('0x14')](_0x43eb84));_0xa9250d(_0x43eb84);})['catch'](function(_0x3d5f95){logger['error'](_0x66ca('0x22'),_0x3d5f95[_0x66ca('0x17')],_0x33b8f0);_0x305eb4(_0x3a45ba[_0x66ca('0x15')](0x1f4,_0x3d5f95[_0x66ca('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x3891db){var _0x4ff7f0=this;return new Promise(function(_0x52c007,_0x585999){return db[_0x66ca('0x19')][_0x66ca('0x24')]({'raw':_0x3891db[_0x66ca('0x1a')]?_0x3891db['options'][_0x66ca('0x1b')]===undefined?!![]:![]:!![],'where':_0x3891db[_0x66ca('0x1a')]?_0x3891db[_0x66ca('0x1a')]['where']||null:null,'attributes':_0x3891db[_0x66ca('0x1a')]?_0x3891db[_0x66ca('0x1a')][_0x66ca('0x1d')]||null:null,'include':_0x3891db['options']?_0x3891db[_0x66ca('0x1a')][_0x66ca('0x1f')]?_[_0x66ca('0x20')](_0x3891db[_0x66ca('0x1a')]['include'],function(_0x10811){return{'model':db[_0x10811[_0x66ca('0x21')]],'as':_0x10811['as'],'attributes':_0x10811['attributes'],'include':_0x10811[_0x66ca('0x1f')]?_['map'](_0x10811[_0x66ca('0x1f')],function(_0x275bca){return{'model':db[_0x275bca[_0x66ca('0x21')]],'as':_0x275bca['as'],'attributes':_0x275bca[_0x66ca('0x1d')],'include':_0x275bca[_0x66ca('0x1f')]?_[_0x66ca('0x20')](_0x275bca[_0x66ca('0x1f')],function(_0x58da07){return{'model':db[_0x58da07[_0x66ca('0x21')]],'as':_0x58da07['as'],'attributes':_0x58da07['attributes']};}):[]};}):[]};}):[]:[]})[_0x66ca('0x10')](function(_0xf3169){logger['info'](_0x66ca('0x25'),_0x3891db);logger['debug'](_0x66ca('0x25'),_0x3891db,JSON[_0x66ca('0x14')](_0xf3169));_0x52c007(_0xf3169);})[_0x66ca('0x18')](function(_0x94f7e9){logger[_0x66ca('0x15')](_0x66ca('0x25'),_0x94f7e9['message'],_0x3891db);_0x585999(_0x4ff7f0['error'](0x1f4,_0x94f7e9[_0x66ca('0x17')]));});});}; \ No newline at end of file +var _0x7729=['message','result','GetOpenchannelQueue','findAll','options','raw','where','attributes','map','model','include','then','debug','catch','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','register','request','info','request\x20sent','stringify','error','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7729,0x14c));var _0x9772=function(_0x5a28a8,_0x2ff358){_0x5a28a8=_0x5a28a8-0x0;var _0x5ab787=_0x7729[_0x5a28a8];return _0x5ab787;};'use strict';var _=require(_0x9772('0x0'));var util=require('util');var moment=require(_0x9772('0x1'));var BPromise=require(_0x9772('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9772('0x3'));var db=require(_0x9772('0x4'))['db'];var utils=require(_0x9772('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9772('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9772('0x7')][_0x9772('0x8')]({'port':0x232a});config[_0x9772('0x9')]=_['defaults'](config[_0x9772('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9772('0xa'))(new Redis(config[_0x9772('0x9')]));require('./openchannelQueue.socket')[_0x9772('0xb')](socket);function respondWithRpcPromise(_0x469100,_0x2b629a,_0x57c3a3){return new BPromise(function(_0x46414e,_0x42e5d5){return client[_0x9772('0xc')](_0x469100,_0x57c3a3)['then'](function(_0x5a8fc2){logger[_0x9772('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x2b629a,_0x9772('0xe'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2b629a,_0x9772('0xe'),JSON[_0x9772('0xf')](_0x5a8fc2));if(_0x5a8fc2[_0x9772('0x10')]){if(_0x5a8fc2[_0x9772('0x10')]['code']===0x1f4){logger[_0x9772('0x10')](_0x9772('0x11'),_0x2b629a,_0x5a8fc2[_0x9772('0x10')]['message']);return _0x42e5d5(_0x5a8fc2[_0x9772('0x10')]['message']);}logger[_0x9772('0x10')](_0x9772('0x11'),_0x2b629a,_0x5a8fc2[_0x9772('0x10')][_0x9772('0x12')]);return _0x46414e(_0x5a8fc2[_0x9772('0x10')]['message']);}else{logger[_0x9772('0xd')](_0x9772('0x11'),_0x2b629a,_0x9772('0xe'));_0x46414e(_0x5a8fc2[_0x9772('0x13')]['message']);}})['catch'](function(_0x3f0017){logger[_0x9772('0x10')](_0x9772('0x11'),_0x2b629a,_0x3f0017);_0x42e5d5(_0x3f0017);});});}exports[_0x9772('0x14')]=function(_0xa84f2c){var _0x2ac7ef=this;return new Promise(function(_0x460c57,_0xc2fa78){return db['OpenchannelQueue'][_0x9772('0x15')]({'raw':_0xa84f2c['options']?_0xa84f2c[_0x9772('0x16')][_0x9772('0x17')]===undefined?!![]:![]:!![],'where':_0xa84f2c[_0x9772('0x16')]?_0xa84f2c['options'][_0x9772('0x18')]||null:null,'attributes':_0xa84f2c[_0x9772('0x16')]?_0xa84f2c['options'][_0x9772('0x19')]||null:null,'limit':_0xa84f2c[_0x9772('0x16')]?_0xa84f2c[_0x9772('0x16')]['limit']||null:null,'include':_0xa84f2c['options']?_0xa84f2c[_0x9772('0x16')]['include']?_[_0x9772('0x1a')](_0xa84f2c[_0x9772('0x16')]['include'],function(_0x58a68d){return{'model':db[_0x58a68d[_0x9772('0x1b')]],'as':_0x58a68d['as'],'attributes':_0x58a68d[_0x9772('0x19')],'include':_0x58a68d[_0x9772('0x1c')]?_[_0x9772('0x1a')](_0x58a68d[_0x9772('0x1c')],function(_0x1c3865){return{'model':db[_0x1c3865[_0x9772('0x1b')]],'as':_0x1c3865['as'],'attributes':_0x1c3865[_0x9772('0x19')],'include':_0x1c3865[_0x9772('0x1c')]?_[_0x9772('0x1a')](_0x1c3865[_0x9772('0x1c')],function(_0x1d9ee5){return{'model':db[_0x1d9ee5[_0x9772('0x1b')]],'as':_0x1d9ee5['as'],'attributes':_0x1d9ee5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9772('0x1d')](function(_0x3b687b){logger['info'](_0x9772('0x14'),_0xa84f2c);logger[_0x9772('0x1e')](_0x9772('0x14'),_0xa84f2c,JSON[_0x9772('0xf')](_0x3b687b));_0x460c57(_0x3b687b);})[_0x9772('0x1f')](function(_0x7a3914){logger[_0x9772('0x10')](_0x9772('0x14'),_0x7a3914['message'],_0xa84f2c);_0xc2fa78(_0x2ac7ef['error'](0x1f4,_0x7a3914[_0x9772('0x12')]));});});};exports['ShowOpenchannelQueue']=function(_0x5913be){var _0x2d5bf4=this;return new Promise(function(_0x26525e,_0x387918){return db[_0x9772('0x20')][_0x9772('0x21')]({'raw':_0x5913be[_0x9772('0x16')]?_0x5913be[_0x9772('0x16')][_0x9772('0x17')]===undefined?!![]:![]:!![],'where':_0x5913be[_0x9772('0x16')]?_0x5913be[_0x9772('0x16')][_0x9772('0x18')]||null:null,'attributes':_0x5913be[_0x9772('0x16')]?_0x5913be[_0x9772('0x16')]['attributes']||null:null,'include':_0x5913be['options']?_0x5913be['options']['include']?_[_0x9772('0x1a')](_0x5913be[_0x9772('0x16')]['include'],function(_0x513bd5){return{'model':db[_0x513bd5[_0x9772('0x1b')]],'as':_0x513bd5['as'],'attributes':_0x513bd5[_0x9772('0x19')],'include':_0x513bd5['include']?_[_0x9772('0x1a')](_0x513bd5['include'],function(_0x16fc2e){return{'model':db[_0x16fc2e[_0x9772('0x1b')]],'as':_0x16fc2e['as'],'attributes':_0x16fc2e[_0x9772('0x19')],'include':_0x16fc2e['include']?_[_0x9772('0x1a')](_0x16fc2e[_0x9772('0x1c')],function(_0x1890ba){return{'model':db[_0x1890ba[_0x9772('0x1b')]],'as':_0x1890ba['as'],'attributes':_0x1890ba[_0x9772('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9772('0x1d')](function(_0x5a4201){logger[_0x9772('0xd')]('ShowOpenchannelQueue',_0x5913be);logger[_0x9772('0x1e')](_0x9772('0x22'),_0x5913be,JSON[_0x9772('0xf')](_0x5a4201));_0x26525e(_0x5a4201);})[_0x9772('0x1f')](function(_0x173759){logger[_0x9772('0x10')](_0x9772('0x22'),_0x173759[_0x9772('0x12')],_0x5913be);_0x387918(_0x2d5bf4[_0x9772('0x10')](0x1f4,_0x173759[_0x9772('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ac2b693..b457934 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 _0x9b2a=['./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0xa4f0c8,_0x452f30){var _0x286f16=function(_0x1111ad){while(--_0x1111ad){_0xa4f0c8['push'](_0xa4f0c8['shift']());}};_0x286f16(++_0x452f30);}(_0x9b2a,0x8a));var _0xa9b2=function(_0x309c96,_0x4fb139){_0x309c96=_0x309c96-0x0;var _0x375745=_0x9b2a[_0x309c96];return _0x375745;};'use strict';var OpenchannelQueueEvents=require(_0xa9b2('0x0'));var events=['save',_0xa9b2('0x1'),_0xa9b2('0x2')];function createListener(_0x4e9c83,_0x547244){return function(_0x10ae6f){_0x547244[_0xa9b2('0x3')](_0x4e9c83,_0x10ae6f);};}function removeListener(_0x541435,_0x565621){return function(){OpenchannelQueueEvents[_0xa9b2('0x4')](_0x541435,_0x565621);};}exports[_0xa9b2('0x5')]=function(_0x4539ae){for(var _0x56a3f7=0x0,_0x345cca=events['length'];_0x56a3f7<_0x345cca;_0x56a3f7++){var _0x7716a8=events[_0x56a3f7];var _0x5d83d2=createListener('openchannelQueue:'+_0x7716a8,_0x4539ae);OpenchannelQueueEvents['on'](_0x7716a8,_0x5d83d2);}}; \ No newline at end of file +var _0x6c40=['save','update','removeListener','register','length','./openchannelQueue.events'];(function(_0x295008,_0x5d9bff){var _0x4cdb9f=function(_0x4a4e68){while(--_0x4a4e68){_0x295008['push'](_0x295008['shift']());}};_0x4cdb9f(++_0x5d9bff);}(_0x6c40,0x1c7));var _0x06c4=function(_0x483609,_0x3a7fdf){_0x483609=_0x483609-0x0;var _0x451a59=_0x6c40[_0x483609];return _0x451a59;};'use strict';var OpenchannelQueueEvents=require(_0x06c4('0x0'));var events=[_0x06c4('0x1'),'remove',_0x06c4('0x2')];function createListener(_0x3133f9,_0x5593d7){return function(_0x103fa9){_0x5593d7['emit'](_0x3133f9,_0x103fa9);};}function removeListener(_0x4b517b,_0x2e8b8b){return function(){OpenchannelQueueEvents[_0x06c4('0x3')](_0x4b517b,_0x2e8b8b);};}exports[_0x06c4('0x4')]=function(_0x3822e4){for(var _0x4b3991=0x0,_0x11b1e8=events[_0x06c4('0x5')];_0x4b3991<_0x11b1e8;_0x4b3991++){var _0x4a07a7=events[_0x4b3991];var _0x5804ee=createListener('openchannelQueue:'+_0x4a07a7,_0x3822e4);OpenchannelQueueEvents['on'](_0x4a07a7,_0x5804ee);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 54b7fa9..d49ccd6 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 _0xef20=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xef20,0x1a4));var _0x0ef2=function(_0x22c7a7,_0x3f167f){_0x22c7a7=_0x22c7a7-0x0;var _0x5553aa=_0xef20[_0x22c7a7];return _0x5553aa;};'use strict';var multer=require(_0x0ef2('0x0'));var util=require(_0x0ef2('0x1'));var path=require(_0x0ef2('0x2'));var timeout=require(_0x0ef2('0x3'));var express=require('express');var router=express[_0x0ef2('0x4')]();var fs_extra=require(_0x0ef2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ef2('0x6'));var controller=require(_0x0ef2('0x7'));router['get']('/',auth[_0x0ef2('0x8')](),controller[_0x0ef2('0x9')]);router[_0x0ef2('0xa')](_0x0ef2('0xb'),auth[_0x0ef2('0x8')](),controller[_0x0ef2('0xc')]);router['get'](_0x0ef2('0xd'),auth[_0x0ef2('0x8')](),controller['show']);router[_0x0ef2('0xe')]('/',auth[_0x0ef2('0x8')](),controller[_0x0ef2('0xf')]);router[_0x0ef2('0x10')](_0x0ef2('0xd'),auth[_0x0ef2('0x8')](),controller[_0x0ef2('0x11')]);router[_0x0ef2('0x12')](_0x0ef2('0xd'),auth['isAuthenticated'](),controller[_0x0ef2('0x13')]);module[_0x0ef2('0x14')]=router; \ No newline at end of file +var _0x47a8=['../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x8393f8,_0x935cb2){var _0x39ac16=function(_0x1027df){while(--_0x1027df){_0x8393f8['push'](_0x8393f8['shift']());}};_0x39ac16(++_0x935cb2);}(_0x47a8,0x17b));var _0x847a=function(_0x2bb6fa,_0x4dc8d1){_0x2bb6fa=_0x2bb6fa-0x0;var _0x47563a=_0x47a8[_0x2bb6fa];return _0x47563a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x847a('0x0'));var timeout=require('connect-timeout');var express=require(_0x847a('0x1'));var router=express[_0x847a('0x2')]();var fs_extra=require(_0x847a('0x3'));var auth=require(_0x847a('0x4'));var interaction=require(_0x847a('0x5'));var config=require('../../config/environment');var controller=require(_0x847a('0x6'));router[_0x847a('0x7')]('/',auth[_0x847a('0x8')](),controller['index']);router[_0x847a('0x7')](_0x847a('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x847a('0x7')](_0x847a('0xa'),auth[_0x847a('0x8')](),controller[_0x847a('0xb')]);router[_0x847a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x847a('0xd')](_0x847a('0xa'),auth[_0x847a('0x8')](),controller[_0x847a('0xe')]);router['delete'](_0x847a('0xa'),auth[_0x847a('0x8')](),controller['destroy']);module[_0x847a('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 6ba9ee2..0a31d54 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 _0xd499=['exports','STRING','DATE','moment','sequelize'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0xd499,0x71));var _0x9d49=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xd499[_0x4c7935];return _0x30651d;};'use strict';var moment=require(_0x9d49('0x0'));var Sequelize=require(_0x9d49('0x1'));module[_0x9d49('0x2')]={'uniqueid':{'type':Sequelize[_0x9d49('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9d49('0x3')]},'joinAt':{'type':Sequelize[_0x9d49('0x4')]},'leaveAt':{'type':Sequelize[_0x9d49('0x4')]},'acceptAt':{'type':Sequelize[_0x9d49('0x4')]},'exitAt':{'type':Sequelize[_0x9d49('0x4')]},'reason':{'type':Sequelize[_0x9d49('0x3')]}}; \ No newline at end of file +var _0x2a8e=['DATE','moment','exports','STRING'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x2a8e,0x191));var _0xe2a8=function(_0xf18cdd,_0xfed9ab){_0xf18cdd=_0xf18cdd-0x0;var _0x5149f2=_0x2a8e[_0xf18cdd];return _0x5149f2;};'use strict';var moment=require(_0xe2a8('0x0'));var Sequelize=require('sequelize');module[_0xe2a8('0x1')]={'uniqueid':{'type':Sequelize[_0xe2a8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe2a8('0x2')]},'joinAt':{'type':Sequelize[_0xe2a8('0x3')]},'leaveAt':{'type':Sequelize[_0xe2a8('0x3')]},'acceptAt':{'type':Sequelize[_0xe2a8('0x3')]},'exitAt':{'type':Sequelize[_0xe2a8('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index ad0cdcf..f01b1ce 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 _0x6a0e=['OpenchannelQueueReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','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','undefined','count','offset','limit','set','apply','save','update','then','error','name','send','map'];(function(_0x11f4b5,_0x279f0d){var _0x59d5e0=function(_0x224edd){while(--_0x224edd){_0x11f4b5['push'](_0x11f4b5['shift']());}};_0x59d5e0(++_0x279f0d);}(_0x6a0e,0x1a3));var _0xe6a0=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x6a0e[_0x585d81];return _0x1aca0d;};'use strict';var emlformat=require(_0xe6a0('0x0'));var rimraf=require(_0xe6a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6a0('0x2'));var rp=require(_0xe6a0('0x3'));var moment=require(_0xe6a0('0x4'));var BPromise=require(_0xe6a0('0x5'));var Mustache=require(_0xe6a0('0x6'));var util=require(_0xe6a0('0x7'));var path=require(_0xe6a0('0x8'));var sox=require(_0xe6a0('0x9'));var csv=require(_0xe6a0('0xa'));var ejs=require(_0xe6a0('0xb'));var fs=require('fs');var fs_extra=require(_0xe6a0('0xc'));var _=require('lodash');var squel=require(_0xe6a0('0xd'));var crypto=require('crypto');var jsforce=require(_0xe6a0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6a0('0xa'));var querystring=require('querystring');var Papa=require(_0xe6a0('0xf'));var Redis=require(_0xe6a0('0x10'));var authService=require(_0xe6a0('0x11'));var qs=require(_0xe6a0('0x12'));var as=require(_0xe6a0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6a0('0x14'))(_0xe6a0('0x15'));var utils=require(_0xe6a0('0x16'));var config=require(_0xe6a0('0x17'));var licenseUtil=require(_0xe6a0('0x18'));var db=require(_0xe6a0('0x19'))['db'];function respondWithStatusCode(_0x3abe83,_0x36b408){_0x36b408=_0x36b408||0xcc;return function(_0x432313){if(_0x432313){return _0x3abe83[_0xe6a0('0x1a')](_0x36b408);}return _0x3abe83['status'](_0x36b408)[_0xe6a0('0x1b')]();};}function respondWithResult(_0x4ae0b4,_0x1309c0){_0x1309c0=_0x1309c0||0xc8;return function(_0x50870a){if(_0x50870a){return _0x4ae0b4[_0xe6a0('0x1c')](_0x1309c0)[_0xe6a0('0x1d')](_0x50870a);}};}function respondWithFilteredResult(_0x46953d,_0xdd22e9){return function(_0x328ffb){if(_0x328ffb){var _0x34f3ad=typeof _0xdd22e9['offset']===_0xe6a0('0x1e')&&typeof _0xdd22e9['limit']===_0xe6a0('0x1e');var _0x38a3a7=_0x328ffb[_0xe6a0('0x1f')];var _0x356f86=_0x34f3ad?0x0:_0xdd22e9[_0xe6a0('0x20')];var _0x3ce38b=_0x34f3ad?_0x328ffb[_0xe6a0('0x1f')]:_0xdd22e9['offset']+_0xdd22e9[_0xe6a0('0x21')];var _0x116681;if(_0x3ce38b>=_0x38a3a7){_0x3ce38b=_0x38a3a7;_0x116681=0xc8;}else{_0x116681=0xce;}_0x46953d[_0xe6a0('0x1c')](_0x116681);return _0x46953d[_0xe6a0('0x22')]('Content-Range',_0x356f86+'-'+_0x3ce38b+'/'+_0x38a3a7)[_0xe6a0('0x1d')](_0x328ffb);}return null;};}function patchUpdates(_0x47c899){return function(_0x263de8){try{jsonpatch[_0xe6a0('0x23')](_0x263de8,_0x47c899,!![]);}catch(_0x2ba956){return BPromise['reject'](_0x2ba956);}return _0x263de8[_0xe6a0('0x24')]();};}function saveUpdates(_0x50965a,_0x2fd1c0){return function(_0x4904cd){if(_0x4904cd){return _0x4904cd[_0xe6a0('0x25')](_0x50965a)['then'](function(_0x2b4d15){return _0x2b4d15;});}return null;};}function removeEntity(_0x55b0e0,_0x33486c){return function(_0x57af18){if(_0x57af18){return _0x57af18['destroy']()[_0xe6a0('0x26')](function(){_0x55b0e0[_0xe6a0('0x1c')](0xcc)[_0xe6a0('0x1b')]();});}};}function handleEntityNotFound(_0xfee7b3,_0x3ed4ca){return function(_0x10a6ec){if(!_0x10a6ec){_0xfee7b3[_0xe6a0('0x1a')](0x194);}return _0x10a6ec;};}function handleError(_0x432e02,_0x49b9eb){_0x49b9eb=_0x49b9eb||0x1f4;return function(_0x1d280e){logger[_0xe6a0('0x27')](_0x1d280e['stack']);if(_0x1d280e[_0xe6a0('0x28')]){delete _0x1d280e[_0xe6a0('0x28')];}_0x432e02[_0xe6a0('0x1c')](_0x49b9eb)[_0xe6a0('0x29')](_0x1d280e);};}exports['index']=function(_0x5341c5,_0x444621){var _0x325234={},_0x18fdb6={},_0x4b67a5={'count':0x0,'rows':[]};var _0x497985=_[_0xe6a0('0x2a')](db[_0xe6a0('0x2b')]['rawAttributes'],function(_0x10b0be){return{'name':_0x10b0be[_0xe6a0('0x2c')],'type':_0x10b0be['type'][_0xe6a0('0x2d')]};});_0x18fdb6[_0xe6a0('0x2e')]=_[_0xe6a0('0x2a')](_0x497985,_0xe6a0('0x28'));_0x18fdb6[_0xe6a0('0x2f')]=_[_0xe6a0('0x30')](_0x5341c5[_0xe6a0('0x2f')]);_0x18fdb6[_0xe6a0('0x31')]=_['intersection'](_0x18fdb6['model'],_0x18fdb6[_0xe6a0('0x2f')]);_0x325234[_0xe6a0('0x32')]=_[_0xe6a0('0x33')](_0x18fdb6['model'],qs[_0xe6a0('0x34')](_0x5341c5['query'][_0xe6a0('0x34')]));_0x325234[_0xe6a0('0x32')]=_0x325234[_0xe6a0('0x32')][_0xe6a0('0x35')]?_0x325234[_0xe6a0('0x32')]:_0x18fdb6['model'];if(!_0x5341c5[_0xe6a0('0x2f')]['hasOwnProperty'](_0xe6a0('0x36'))){_0x325234[_0xe6a0('0x21')]=qs[_0xe6a0('0x21')](_0x5341c5[_0xe6a0('0x2f')][_0xe6a0('0x21')]);_0x325234[_0xe6a0('0x20')]=qs['offset'](_0x5341c5[_0xe6a0('0x2f')][_0xe6a0('0x20')]);}_0x325234[_0xe6a0('0x37')]=qs[_0xe6a0('0x38')](_0x5341c5['query'][_0xe6a0('0x38')]);_0x325234[_0xe6a0('0x39')]=qs[_0xe6a0('0x31')](_[_0xe6a0('0x3a')](_0x5341c5[_0xe6a0('0x2f')],_0x18fdb6[_0xe6a0('0x31')]),_0x497985);if(_0x5341c5[_0xe6a0('0x2f')][_0xe6a0('0x3b')]){_0x325234[_0xe6a0('0x39')]=_[_0xe6a0('0x3c')](_0x325234[_0xe6a0('0x39')],{'$or':_['map'](_0x497985,function(_0x256d2d){if(_0x256d2d[_0xe6a0('0x3d')]!==_0xe6a0('0x3e')){var _0x426dd0={};_0x426dd0[_0x256d2d['name']]={'$like':'%'+_0x5341c5[_0xe6a0('0x2f')][_0xe6a0('0x3b')]+'%'};return _0x426dd0;}})});}_0x325234=_['merge']({},_0x325234,_0x5341c5[_0xe6a0('0x3f')]);var _0x14d574={'where':_0x325234[_0xe6a0('0x39')]};return db[_0xe6a0('0x2b')][_0xe6a0('0x1f')](_0x14d574)['then'](function(_0x4063e2){_0x4b67a5[_0xe6a0('0x1f')]=_0x4063e2;if(_0x5341c5[_0xe6a0('0x2f')]['includeAll']){_0x325234[_0xe6a0('0x40')]=[{'all':!![]}];}return db[_0xe6a0('0x2b')][_0xe6a0('0x41')](_0x325234);})['then'](function(_0x5120cc){_0x4b67a5[_0xe6a0('0x42')]=_0x5120cc;return _0x4b67a5;})['then'](respondWithFilteredResult(_0x444621,_0x325234))[_0xe6a0('0x43')](handleError(_0x444621,null));};exports[_0xe6a0('0x44')]=function(_0x42a0ec,_0x4b6162){var _0x1fc1a6={'raw':!![],'where':{'id':_0x42a0ec['params']['id']}},_0x537465={};_0x537465['model']=_['keys'](db['OpenchannelQueueReport'][_0xe6a0('0x45')]);_0x537465['query']=_[_0xe6a0('0x30')](_0x42a0ec['query']);_0x537465['filters']=_[_0xe6a0('0x33')](_0x537465['model'],_0x537465['query']);_0x1fc1a6[_0xe6a0('0x32')]=_[_0xe6a0('0x33')](_0x537465[_0xe6a0('0x2e')],qs[_0xe6a0('0x34')](_0x42a0ec[_0xe6a0('0x2f')][_0xe6a0('0x34')]));_0x1fc1a6[_0xe6a0('0x32')]=_0x1fc1a6[_0xe6a0('0x32')][_0xe6a0('0x35')]?_0x1fc1a6[_0xe6a0('0x32')]:_0x537465[_0xe6a0('0x2e')];if(_0x42a0ec[_0xe6a0('0x2f')][_0xe6a0('0x46')]){_0x1fc1a6[_0xe6a0('0x40')]=[{'all':!![]}];}_0x1fc1a6=_['merge']({},_0x1fc1a6,_0x42a0ec['options']);return db['OpenchannelQueueReport'][_0xe6a0('0x47')](_0x1fc1a6)['then'](handleEntityNotFound(_0x4b6162,null))[_0xe6a0('0x26')](respondWithResult(_0x4b6162,null))['catch'](handleError(_0x4b6162,null));};exports[_0xe6a0('0x48')]=function(_0x3b865e,_0x599617){return db[_0xe6a0('0x2b')]['create'](_0x3b865e[_0xe6a0('0x49')],{})['then'](respondWithResult(_0x599617,0xc9))[_0xe6a0('0x43')](handleError(_0x599617,null));};exports[_0xe6a0('0x25')]=function(_0x37ae37,_0x3fc329){if(_0x37ae37[_0xe6a0('0x49')]['id']){delete _0x37ae37[_0xe6a0('0x49')]['id'];}return db['OpenchannelQueueReport'][_0xe6a0('0x47')]({'where':{'id':_0x37ae37['params']['id']}})[_0xe6a0('0x26')](handleEntityNotFound(_0x3fc329,null))[_0xe6a0('0x26')](saveUpdates(_0x37ae37[_0xe6a0('0x49')],null))[_0xe6a0('0x26')](respondWithResult(_0x3fc329,null))[_0xe6a0('0x43')](handleError(_0x3fc329,null));};exports[_0xe6a0('0x4a')]=function(_0x33636b,_0x28adc5){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x33636b[_0xe6a0('0x4b')]['id']}})[_0xe6a0('0x26')](handleEntityNotFound(_0x28adc5,null))[_0xe6a0('0x26')](removeEntity(_0x28adc5,null))[_0xe6a0('0x43')](handleError(_0x28adc5,null));};exports[_0xe6a0('0x4c')]=function(_0x28be3,_0x9e193e){return db['OpenchannelQueueReport'][_0xe6a0('0x4c')]()['then'](respondWithResult(_0x9e193e,null))[_0xe6a0('0x43')](handleError(_0x9e193e,null));}; \ No newline at end of file +var _0x8d54=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','sendStatus','error','name','send','index','OpenchannelQueueReport','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','crypto','desk.js','querystring'];(function(_0x6b6cf7,_0x30bedb){var _0x1d614f=function(_0x2af031){while(--_0x2af031){_0x6b6cf7['push'](_0x6b6cf7['shift']());}};_0x1d614f(++_0x30bedb);}(_0x8d54,0x1a4));var _0x48d5=function(_0x82f586,_0x382c19){_0x82f586=_0x82f586-0x0;var _0x591ec8=_0x8d54[_0x82f586];return _0x591ec8;};'use strict';var emlformat=require(_0x48d5('0x0'));var rimraf=require(_0x48d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48d5('0x2'));var rp=require('request-promise');var moment=require(_0x48d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x48d5('0x4'));var util=require(_0x48d5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x48d5('0x6'));var ejs=require(_0x48d5('0x7'));var fs=require('fs');var fs_extra=require(_0x48d5('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x48d5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x48d5('0xa'));var toCsv=require('to-csv');var querystring=require(_0x48d5('0xb'));var Papa=require(_0x48d5('0xc'));var Redis=require(_0x48d5('0xd'));var authService=require(_0x48d5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x48d5('0xf'));var hardwareService=require(_0x48d5('0x10'));var logger=require(_0x48d5('0x11'))(_0x48d5('0x12'));var utils=require('../../config/utils');var config=require(_0x48d5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x48d5('0x14'))['db'];function respondWithStatusCode(_0x4e55f1,_0x1f07c8){_0x1f07c8=_0x1f07c8||0xcc;return function(_0x2fadf3){if(_0x2fadf3){return _0x4e55f1['sendStatus'](_0x1f07c8);}return _0x4e55f1['status'](_0x1f07c8)['end']();};}function respondWithResult(_0x454dd5,_0x4e62f5){_0x4e62f5=_0x4e62f5||0xc8;return function(_0x185361){if(_0x185361){return _0x454dd5[_0x48d5('0x15')](_0x4e62f5)[_0x48d5('0x16')](_0x185361);}};}function respondWithFilteredResult(_0x48b549,_0x4fbf9e){return function(_0x598410){if(_0x598410){var _0x296c04=typeof _0x4fbf9e[_0x48d5('0x17')]===_0x48d5('0x18')&&typeof _0x4fbf9e[_0x48d5('0x19')]===_0x48d5('0x18');var _0x22819a=_0x598410[_0x48d5('0x1a')];var _0x5d6c72=_0x296c04?0x0:_0x4fbf9e[_0x48d5('0x17')];var _0x20dca1=_0x296c04?_0x598410['count']:_0x4fbf9e[_0x48d5('0x17')]+_0x4fbf9e[_0x48d5('0x19')];var _0x26fed4;if(_0x20dca1>=_0x22819a){_0x20dca1=_0x22819a;_0x26fed4=0xc8;}else{_0x26fed4=0xce;}_0x48b549[_0x48d5('0x15')](_0x26fed4);return _0x48b549[_0x48d5('0x1b')](_0x48d5('0x1c'),_0x5d6c72+'-'+_0x20dca1+'/'+_0x22819a)[_0x48d5('0x16')](_0x598410);}return null;};}function patchUpdates(_0x23524e){return function(_0x134460){try{jsonpatch[_0x48d5('0x1d')](_0x134460,_0x23524e,!![]);}catch(_0x149407){return BPromise['reject'](_0x149407);}return _0x134460[_0x48d5('0x1e')]();};}function saveUpdates(_0xf7dc0c,_0x192b6f){return function(_0x4f57f7){if(_0x4f57f7){return _0x4f57f7[_0x48d5('0x1f')](_0xf7dc0c)[_0x48d5('0x20')](function(_0x1b7194){return _0x1b7194;});}return null;};}function removeEntity(_0x40bbda,_0x4f6b79){return function(_0x28a284){if(_0x28a284){return _0x28a284['destroy']()[_0x48d5('0x20')](function(){_0x40bbda[_0x48d5('0x15')](0xcc)[_0x48d5('0x21')]();});}};}function handleEntityNotFound(_0x74069e,_0x14d310){return function(_0x4db114){if(!_0x4db114){_0x74069e[_0x48d5('0x22')](0x194);}return _0x4db114;};}function handleError(_0x1e863b,_0x1e6526){_0x1e6526=_0x1e6526||0x1f4;return function(_0x1014b3){logger[_0x48d5('0x23')](_0x1014b3['stack']);if(_0x1014b3[_0x48d5('0x24')]){delete _0x1014b3[_0x48d5('0x24')];}_0x1e863b['status'](_0x1e6526)[_0x48d5('0x25')](_0x1014b3);};}exports[_0x48d5('0x26')]=function(_0xda1123,_0x146806){var _0x16080a={},_0x3f52c1={},_0x19bc00={'count':0x0,'rows':[]};var _0x1ad5a9=_['map'](db[_0x48d5('0x27')]['rawAttributes'],function(_0x4541d1){return{'name':_0x4541d1[_0x48d5('0x28')],'type':_0x4541d1[_0x48d5('0x29')]['key']};});_0x3f52c1[_0x48d5('0x2a')]=_[_0x48d5('0x2b')](_0x1ad5a9,_0x48d5('0x24'));_0x3f52c1[_0x48d5('0x2c')]=_['keys'](_0xda1123['query']);_0x3f52c1['filters']=_[_0x48d5('0x2d')](_0x3f52c1[_0x48d5('0x2a')],_0x3f52c1[_0x48d5('0x2c')]);_0x16080a[_0x48d5('0x2e')]=_[_0x48d5('0x2d')](_0x3f52c1[_0x48d5('0x2a')],qs['fields'](_0xda1123[_0x48d5('0x2c')][_0x48d5('0x2f')]));_0x16080a[_0x48d5('0x2e')]=_0x16080a[_0x48d5('0x2e')][_0x48d5('0x30')]?_0x16080a[_0x48d5('0x2e')]:_0x3f52c1[_0x48d5('0x2a')];if(!_0xda1123[_0x48d5('0x2c')][_0x48d5('0x31')](_0x48d5('0x32'))){_0x16080a['limit']=qs[_0x48d5('0x19')](_0xda1123[_0x48d5('0x2c')][_0x48d5('0x19')]);_0x16080a[_0x48d5('0x17')]=qs['offset'](_0xda1123[_0x48d5('0x2c')][_0x48d5('0x17')]);}_0x16080a[_0x48d5('0x33')]=qs[_0x48d5('0x34')](_0xda1123[_0x48d5('0x2c')][_0x48d5('0x34')]);_0x16080a[_0x48d5('0x35')]=qs[_0x48d5('0x36')](_[_0x48d5('0x37')](_0xda1123['query'],_0x3f52c1['filters']),_0x1ad5a9);if(_0xda1123['query'][_0x48d5('0x38')]){_0x16080a['where']=_[_0x48d5('0x39')](_0x16080a[_0x48d5('0x35')],{'$or':_[_0x48d5('0x2b')](_0x1ad5a9,function(_0x599d7a){if(_0x599d7a['type']!==_0x48d5('0x3a')){var _0x15b835={};_0x15b835[_0x599d7a['name']]={'$like':'%'+_0xda1123[_0x48d5('0x2c')]['filter']+'%'};return _0x15b835;}})});}_0x16080a=_[_0x48d5('0x39')]({},_0x16080a,_0xda1123[_0x48d5('0x3b')]);var _0x27e24b={'where':_0x16080a[_0x48d5('0x35')]};return db[_0x48d5('0x27')][_0x48d5('0x1a')](_0x27e24b)[_0x48d5('0x20')](function(_0x1430aa){_0x19bc00['count']=_0x1430aa;if(_0xda1123[_0x48d5('0x2c')][_0x48d5('0x3c')]){_0x16080a[_0x48d5('0x3d')]=[{'all':!![]}];}return db[_0x48d5('0x27')]['findAll'](_0x16080a);})[_0x48d5('0x20')](function(_0x11c1a9){_0x19bc00[_0x48d5('0x3e')]=_0x11c1a9;return _0x19bc00;})[_0x48d5('0x20')](respondWithFilteredResult(_0x146806,_0x16080a))['catch'](handleError(_0x146806,null));};exports[_0x48d5('0x3f')]=function(_0x4d721e,_0x5890df){var _0x2e1288={'raw':!![],'where':{'id':_0x4d721e[_0x48d5('0x40')]['id']}},_0x526840={};_0x526840[_0x48d5('0x2a')]=_[_0x48d5('0x41')](db['OpenchannelQueueReport']['rawAttributes']);_0x526840['query']=_[_0x48d5('0x41')](_0x4d721e[_0x48d5('0x2c')]);_0x526840[_0x48d5('0x36')]=_[_0x48d5('0x2d')](_0x526840[_0x48d5('0x2a')],_0x526840[_0x48d5('0x2c')]);_0x2e1288[_0x48d5('0x2e')]=_[_0x48d5('0x2d')](_0x526840['model'],qs[_0x48d5('0x2f')](_0x4d721e[_0x48d5('0x2c')][_0x48d5('0x2f')]));_0x2e1288[_0x48d5('0x2e')]=_0x2e1288['attributes'][_0x48d5('0x30')]?_0x2e1288[_0x48d5('0x2e')]:_0x526840[_0x48d5('0x2a')];if(_0x4d721e['query'][_0x48d5('0x3c')]){_0x2e1288['include']=[{'all':!![]}];}_0x2e1288=_[_0x48d5('0x39')]({},_0x2e1288,_0x4d721e[_0x48d5('0x3b')]);return db[_0x48d5('0x27')]['find'](_0x2e1288)[_0x48d5('0x20')](handleEntityNotFound(_0x5890df,null))['then'](respondWithResult(_0x5890df,null))[_0x48d5('0x42')](handleError(_0x5890df,null));};exports[_0x48d5('0x43')]=function(_0x3a17ae,_0x5ce2d5){return db['OpenchannelQueueReport'][_0x48d5('0x43')](_0x3a17ae[_0x48d5('0x44')],{})[_0x48d5('0x20')](respondWithResult(_0x5ce2d5,0xc9))[_0x48d5('0x42')](handleError(_0x5ce2d5,null));};exports['update']=function(_0x1dc929,_0x4a5100){if(_0x1dc929['body']['id']){delete _0x1dc929[_0x48d5('0x44')]['id'];}return db[_0x48d5('0x27')][_0x48d5('0x45')]({'where':{'id':_0x1dc929['params']['id']}})[_0x48d5('0x20')](handleEntityNotFound(_0x4a5100,null))[_0x48d5('0x20')](saveUpdates(_0x1dc929[_0x48d5('0x44')],null))[_0x48d5('0x20')](respondWithResult(_0x4a5100,null))[_0x48d5('0x42')](handleError(_0x4a5100,null));};exports[_0x48d5('0x46')]=function(_0x460d83,_0x4adc83){return db[_0x48d5('0x27')][_0x48d5('0x45')]({'where':{'id':_0x460d83['params']['id']}})[_0x48d5('0x20')](handleEntityNotFound(_0x4adc83,null))[_0x48d5('0x20')](removeEntity(_0x4adc83,null))['catch'](handleError(_0x4adc83,null));};exports[_0x48d5('0x47')]=function(_0x2063b6,_0x92d507){return db['OpenchannelQueueReport'][_0x48d5('0x47')]()[_0x48d5('0x20')](respondWithResult(_0x92d507,null))[_0x48d5('0x42')](handleError(_0x92d507,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b080d82..5a6892a 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x633d6,_0xe6f00e){var _0x31a5e9=function(_0x2804d1){while(--_0x2804d1){_0x633d6['push'](_0x633d6['shift']());}};_0x31a5e9(++_0xe6f00e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x5fc3[_0x311909];return _0x8d3163;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x1e42a4,_0xd48b46){var _0x1e749b=function(_0xd2e5ca){while(--_0xd2e5ca){_0x1e42a4['push'](_0x1e42a4['shift']());}};_0x1e749b(++_0xd48b46);}(_0x7a54,0x106));var _0x47a5=function(_0x4b665d,_0x130f82){_0x4b665d=_0x4b665d-0x0;var _0x37f364=_0x7a54[_0x4b665d];return _0x37f364;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 8cd0c54..9589d5d 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 _0xb6fa=['attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','update','body','where'];(function(_0x566e67,_0xccae9d){var _0x148bf4=function(_0x3708c0){while(--_0x3708c0){_0x566e67['push'](_0x566e67['shift']());}};_0x148bf4(++_0xccae9d);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xb6fa[_0x5ce3c8];return _0xa76867;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}exports[_0xab6f('0x14')]=function(_0x439b73){var _0x3e616c=this;return new Promise(function(_0x2f75c1,_0xbb7af){return db[_0xab6f('0x15')][_0xab6f('0x16')](_0x439b73['body'],{'raw':_0x439b73[_0xab6f('0x17')]?_0x439b73[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x43eda0){logger[_0xab6f('0xb')](_0xab6f('0x14'),_0x439b73);logger[_0xab6f('0x19')](_0xab6f('0x14'),_0x439b73,JSON[_0xab6f('0xe')](_0x43eda0));_0x2f75c1(_0x43eda0);})['catch'](function(_0x4dc7c1){logger[_0xab6f('0xf')](_0xab6f('0x14'),_0x4dc7c1[_0xab6f('0x11')],_0x439b73);_0xbb7af(_0x3e616c[_0xab6f('0xf')](0x1f4,_0x4dc7c1[_0xab6f('0x11')]));});});};exports[_0xab6f('0x1a')]=function(_0xb1ef77){var _0x5634c5=this;return new Promise(function(_0x1294d3,_0xf849b5){return db['OpenchannelQueueReport'][_0xab6f('0x1b')](_0xb1ef77[_0xab6f('0x1c')],{'raw':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1d')]||null:null,'attributes':_0xb1ef77['options']?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1e')]||null:null,'limit':_0xb1ef77[_0xab6f('0x17')]?_0xb1ef77[_0xab6f('0x17')][_0xab6f('0x1f')]||null:null})[_0xab6f('0xa')](function(_0x4952f9){logger[_0xab6f('0xb')]('UpdateOpenchannelQueueReport',_0xb1ef77);logger['debug']('UpdateOpenchannelQueueReport',_0xb1ef77,JSON['stringify'](_0x4952f9));_0x1294d3(_0x4952f9);})['catch'](function(_0x14af68){logger[_0xab6f('0xf')](_0xab6f('0x1a'),_0x14af68[_0xab6f('0x11')],_0xb1ef77);_0xf849b5(_0x5634c5[_0xab6f('0xf')](0x1f4,_0x14af68['message']));});});}; \ No newline at end of file +var _0x3c66=['request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','OpenchannelQueueReport','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','raw','attributes','limit','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x586ea0,_0xc67747){var _0x236932=function(_0x2cf684){while(--_0x2cf684){_0x586ea0['push'](_0x586ea0['shift']());}};_0x236932(++_0xc67747);}(_0x3c66,0x8b));var _0x63c6=function(_0x3e38db,_0x142cc2){_0x3e38db=_0x3e38db-0x0;var _0x403288=_0x3c66[_0x3e38db];return _0x403288;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63c6('0x0'));var rs=require(_0x63c6('0x1'));var fs=require('fs');var Redis=require(_0x63c6('0x2'));var db=require(_0x63c6('0x3'))['db'];var utils=require(_0x63c6('0x4'));var logger=require(_0x63c6('0x5'))(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var jayson=require(_0x63c6('0x8'));var client=jayson[_0x63c6('0x9')][_0x63c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b33e8,_0x47b438,_0x232099){return new BPromise(function(_0x50ff5c,_0x44e826){return client[_0x63c6('0xb')](_0x2b33e8,_0x232099)['then'](function(_0x386110){logger[_0x63c6('0xc')](_0x63c6('0xd'),_0x47b438,_0x63c6('0xe'));logger[_0x63c6('0xf')](_0x63c6('0x10'),_0x47b438,'request\x20sent',JSON[_0x63c6('0x11')](_0x386110));if(_0x386110[_0x63c6('0x12')]){if(_0x386110[_0x63c6('0x12')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x47b438,_0x386110['error']['message']);return _0x44e826(_0x386110['error'][_0x63c6('0x13')]);}logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x386110[_0x63c6('0x12')][_0x63c6('0x13')]);return _0x50ff5c(_0x386110['error'][_0x63c6('0x13')]);}else{logger[_0x63c6('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x47b438,_0x63c6('0xe'));_0x50ff5c(_0x386110['result']['message']);}})[_0x63c6('0x14')](function(_0x571022){logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x571022);_0x44e826(_0x571022);});});}exports['CreateOpenchannelQueueReport']=function(_0xd5a3b5){var _0x2bbda5=this;return new Promise(function(_0x377f6e,_0x35ee57){return db[_0x63c6('0x15')]['create'](_0xd5a3b5['body'],{'raw':_0xd5a3b5['options']?_0xd5a3b5[_0x63c6('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb7ba4f){logger[_0x63c6('0xc')]('CreateOpenchannelQueueReport',_0xd5a3b5);logger[_0x63c6('0xf')](_0x63c6('0x17'),_0xd5a3b5,JSON[_0x63c6('0x11')](_0xb7ba4f));_0x377f6e(_0xb7ba4f);})[_0x63c6('0x14')](function(_0x430a6e){logger['error'](_0x63c6('0x17'),_0x430a6e[_0x63c6('0x13')],_0xd5a3b5);_0x35ee57(_0x2bbda5[_0x63c6('0x12')](0x1f4,_0x430a6e[_0x63c6('0x13')]));});});};exports[_0x63c6('0x18')]=function(_0x2d72c9){var _0x2d2316=this;return new Promise(function(_0x2e3580,_0x4c0d24){return db[_0x63c6('0x15')][_0x63c6('0x19')](_0x2d72c9[_0x63c6('0x1a')],{'raw':_0x2d72c9['options']?_0x2d72c9['options'][_0x63c6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d72c9['options']?_0x2d72c9[_0x63c6('0x16')]['where']||null:null,'attributes':_0x2d72c9['options']?_0x2d72c9[_0x63c6('0x16')][_0x63c6('0x1c')]||null:null,'limit':_0x2d72c9[_0x63c6('0x16')]?_0x2d72c9['options'][_0x63c6('0x1d')]||null:null})['then'](function(_0x1c6a20){logger[_0x63c6('0xc')](_0x63c6('0x18'),_0x2d72c9);logger[_0x63c6('0xf')](_0x63c6('0x18'),_0x2d72c9,JSON[_0x63c6('0x11')](_0x1c6a20));_0x2e3580(_0x1c6a20);})[_0x63c6('0x14')](function(_0xccd510){logger['error'](_0x63c6('0x18'),_0xccd510[_0x63c6('0x13')],_0x2d72c9);_0x4c0d24(_0x2d2316[_0x63c6('0x12')](0x1f4,_0xccd510[_0x63c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1425061..5cfef6e 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 _0xfe66=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','delete'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0xfe66,0x1ba));var _0x6fe6=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xfe66[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require('multer');var util=require(_0x6fe6('0x0'));var path=require(_0x6fe6('0x1'));var timeout=require(_0x6fe6('0x2'));var express=require(_0x6fe6('0x3'));var router=express[_0x6fe6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fe6('0x5'));var interaction=require(_0x6fe6('0x6'));var config=require('../../config/environment');var controller=require(_0x6fe6('0x7'));router['get']('/',auth[_0x6fe6('0x8')](),controller[_0x6fe6('0x9')]);router[_0x6fe6('0xa')](_0x6fe6('0xb'),auth[_0x6fe6('0x8')](),controller['describe']);router['get'](_0x6fe6('0xc'),auth['isAuthenticated'](),controller[_0x6fe6('0xd')]);router[_0x6fe6('0xe')]('/',auth[_0x6fe6('0x8')](),controller[_0x6fe6('0xf')]);router[_0x6fe6('0x10')](_0x6fe6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6fe6('0x11')](_0x6fe6('0xc'),auth[_0x6fe6('0x8')](),controller[_0x6fe6('0x12')]);module[_0x6fe6('0x13')]=router; \ No newline at end of file +var _0x48ad=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x3ba1b7,_0x230567){var _0x2036ff=function(_0x1eaeef){while(--_0x1eaeef){_0x3ba1b7['push'](_0x3ba1b7['shift']());}};_0x2036ff(++_0x230567);}(_0x48ad,0x1bb));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd48a('0x0'));var util=require(_0xd48a('0x1'));var path=require(_0xd48a('0x2'));var timeout=require(_0xd48a('0x3'));var express=require(_0xd48a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd48a('0x5'));var interaction=require(_0xd48a('0x6'));var config=require(_0xd48a('0x7'));var controller=require(_0xd48a('0x8'));router[_0xd48a('0x9')]('/',auth[_0xd48a('0xa')](),controller[_0xd48a('0xb')]);router[_0xd48a('0x9')](_0xd48a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd48a('0x9')](_0xd48a('0xd'),auth[_0xd48a('0xa')](),controller[_0xd48a('0xe')]);router[_0xd48a('0xf')]('/',auth[_0xd48a('0xa')](),controller[_0xd48a('0x10')]);router['put']('/:id',auth[_0xd48a('0xa')](),controller['update']);router[_0xd48a('0x11')](_0xd48a('0xd'),auth['isAuthenticated'](),controller[_0xd48a('0x12')]);module[_0xd48a('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 79ea48c..d59a177 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x43236e,_0x430223){var _0x568711=function(_0x1d6697){while(--_0x1d6697){_0x43236e['push'](_0x43236e['shift']());}};_0x568711(++_0x430223);}(_0x008c,0x188));var _0xc008=function(_0x4e158a,_0x31b81e){_0x4e158a=_0x4e158a-0x0;var _0x168261=_0x008c[_0x4e158a];return _0x168261;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0x54ef,0x112));var _0xf54e=function(_0x8cfdc,_0xeb6ef2){_0x8cfdc=_0x8cfdc-0x0;var _0x5bef13=_0x54ef[_0x8cfdc];return _0x5bef13;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 8f19bd5..c95a6d1 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 _0x3337=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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'];(function(_0x15accd,_0x4b2680){var _0x49dd1f=function(_0x3fe57a){while(--_0x3fe57a){_0x15accd['push'](_0x15accd['shift']());}};_0x49dd1f(++_0x4b2680);}(_0x3337,0x1c7));var _0x7333=function(_0x412818,_0xe8171a){_0x412818=_0x412818-0x0;var _0x2d40d1=_0x3337[_0x412818];return _0x2d40d1;};'use strict';var emlformat=require(_0x7333('0x0'));var rimraf=require(_0x7333('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7333('0x2'));var rp=require(_0x7333('0x3'));var moment=require(_0x7333('0x4'));var BPromise=require(_0x7333('0x5'));var Mustache=require(_0x7333('0x6'));var util=require(_0x7333('0x7'));var path=require(_0x7333('0x8'));var sox=require('sox');var csv=require(_0x7333('0x9'));var ejs=require(_0x7333('0xa'));var fs=require('fs');var fs_extra=require(_0x7333('0xb'));var _=require(_0x7333('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7333('0xd'));var deskjs=require(_0x7333('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7333('0xf'));var Papa=require(_0x7333('0x10'));var Redis=require('ioredis');var authService=require(_0x7333('0x11'));var qs=require(_0x7333('0x12'));var as=require(_0x7333('0x13'));var hardwareService=require(_0x7333('0x14'));var logger=require('../../config/logger')(_0x7333('0x15'));var utils=require(_0x7333('0x16'));var config=require(_0x7333('0x17'));var licenseUtil=require(_0x7333('0x18'));var db=require(_0x7333('0x19'))['db'];function respondWithStatusCode(_0xa29af3,_0x55701f){_0x55701f=_0x55701f||0xcc;return function(_0x1d7574){if(_0x1d7574){return _0xa29af3[_0x7333('0x1a')](_0x55701f);}return _0xa29af3['status'](_0x55701f)[_0x7333('0x1b')]();};}function respondWithResult(_0xd4bc5f,_0x193332){_0x193332=_0x193332||0xc8;return function(_0x36c181){if(_0x36c181){return _0xd4bc5f[_0x7333('0x1c')](_0x193332)[_0x7333('0x1d')](_0x36c181);}};}function respondWithFilteredResult(_0xffa613,_0x48bbe9){return function(_0x5aab22){if(_0x5aab22){var _0x4cbcdc=typeof _0x48bbe9[_0x7333('0x1e')]===_0x7333('0x1f')&&typeof _0x48bbe9[_0x7333('0x20')]===_0x7333('0x1f');var _0x28f968=_0x5aab22[_0x7333('0x21')];var _0x11fe46=_0x4cbcdc?0x0:_0x48bbe9[_0x7333('0x1e')];var _0x33c8bc=_0x4cbcdc?_0x5aab22[_0x7333('0x21')]:_0x48bbe9['offset']+_0x48bbe9[_0x7333('0x20')];var _0x4b7e04;if(_0x33c8bc>=_0x28f968){_0x33c8bc=_0x28f968;_0x4b7e04=0xc8;}else{_0x4b7e04=0xce;}_0xffa613[_0x7333('0x1c')](_0x4b7e04);return _0xffa613[_0x7333('0x22')](_0x7333('0x23'),_0x11fe46+'-'+_0x33c8bc+'/'+_0x28f968)[_0x7333('0x1d')](_0x5aab22);}return null;};}function patchUpdates(_0x250300){return function(_0x5e022f){try{jsonpatch[_0x7333('0x24')](_0x5e022f,_0x250300,!![]);}catch(_0x33d1df){return BPromise[_0x7333('0x25')](_0x33d1df);}return _0x5e022f[_0x7333('0x26')]();};}function saveUpdates(_0x1abcfe,_0x4b4700){return function(_0x87b9ef){if(_0x87b9ef){return _0x87b9ef['update'](_0x1abcfe)[_0x7333('0x27')](function(_0x10adee){return _0x10adee;});}return null;};}function removeEntity(_0x56532c,_0x18715b){return function(_0x1be68c){if(_0x1be68c){return _0x1be68c[_0x7333('0x28')]()[_0x7333('0x27')](function(){_0x56532c[_0x7333('0x1c')](0xcc)[_0x7333('0x1b')]();});}};}function handleEntityNotFound(_0x5d90e8,_0x1ca8b6){return function(_0x10c4e1){if(!_0x10c4e1){_0x5d90e8[_0x7333('0x1a')](0x194);}return _0x10c4e1;};}function handleError(_0x5cf09e,_0xb5d310){_0xb5d310=_0xb5d310||0x1f4;return function(_0x31556){logger[_0x7333('0x29')](_0x31556[_0x7333('0x2a')]);if(_0x31556[_0x7333('0x2b')]){delete _0x31556[_0x7333('0x2b')];}_0x5cf09e[_0x7333('0x1c')](_0xb5d310)[_0x7333('0x2c')](_0x31556);};}exports[_0x7333('0x2d')]=function(_0x2ece2a,_0x5a0d0e){var _0x38724b={},_0x177c9e={},_0x48994f={'count':0x0,'rows':[]};var _0x547b51=_[_0x7333('0x2e')](db[_0x7333('0x2f')]['rawAttributes'],function(_0x496376){return{'name':_0x496376[_0x7333('0x30')],'type':_0x496376[_0x7333('0x31')][_0x7333('0x32')]};});_0x177c9e[_0x7333('0x33')]=_[_0x7333('0x2e')](_0x547b51,_0x7333('0x2b'));_0x177c9e[_0x7333('0x34')]=_[_0x7333('0x35')](_0x2ece2a['query']);_0x177c9e[_0x7333('0x36')]=_[_0x7333('0x37')](_0x177c9e[_0x7333('0x33')],_0x177c9e[_0x7333('0x34')]);_0x38724b[_0x7333('0x38')]=_[_0x7333('0x37')](_0x177c9e[_0x7333('0x33')],qs['fields'](_0x2ece2a[_0x7333('0x34')]['fields']));_0x38724b[_0x7333('0x38')]=_0x38724b[_0x7333('0x38')]['length']?_0x38724b[_0x7333('0x38')]:_0x177c9e[_0x7333('0x33')];if(!_0x2ece2a[_0x7333('0x34')]['hasOwnProperty'](_0x7333('0x39'))){_0x38724b[_0x7333('0x20')]=qs[_0x7333('0x20')](_0x2ece2a[_0x7333('0x34')][_0x7333('0x20')]);_0x38724b[_0x7333('0x1e')]=qs[_0x7333('0x1e')](_0x2ece2a[_0x7333('0x34')][_0x7333('0x1e')]);}_0x38724b[_0x7333('0x3a')]=qs[_0x7333('0x3b')](_0x2ece2a[_0x7333('0x34')][_0x7333('0x3b')]);_0x38724b[_0x7333('0x3c')]=qs[_0x7333('0x36')](_[_0x7333('0x3d')](_0x2ece2a['query'],_0x177c9e[_0x7333('0x36')]),_0x547b51);if(_0x2ece2a[_0x7333('0x34')][_0x7333('0x3e')]){_0x38724b[_0x7333('0x3c')]=_['merge'](_0x38724b['where'],{'$or':_['map'](_0x547b51,function(_0x1c4066){if(_0x1c4066[_0x7333('0x31')]!==_0x7333('0x3f')){var _0x4aff0b={};_0x4aff0b[_0x1c4066[_0x7333('0x2b')]]={'$like':'%'+_0x2ece2a[_0x7333('0x34')][_0x7333('0x3e')]+'%'};return _0x4aff0b;}})});}_0x38724b=_[_0x7333('0x40')]({},_0x38724b,_0x2ece2a[_0x7333('0x41')]);var _0x558cc2={'where':_0x38724b[_0x7333('0x3c')]};return db[_0x7333('0x2f')]['count'](_0x558cc2)[_0x7333('0x27')](function(_0x18d1b0){_0x48994f['count']=_0x18d1b0;if(_0x2ece2a[_0x7333('0x34')]['includeAll']){_0x38724b[_0x7333('0x42')]=[{'all':!![]}];}return db[_0x7333('0x2f')][_0x7333('0x43')](_0x38724b);})[_0x7333('0x27')](function(_0x20ade8){_0x48994f[_0x7333('0x44')]=_0x20ade8;return _0x48994f;})['then'](respondWithFilteredResult(_0x5a0d0e,_0x38724b))[_0x7333('0x45')](handleError(_0x5a0d0e,null));};exports[_0x7333('0x46')]=function(_0xbc21ae,_0x44fa50){var _0x139903={'raw':!![],'where':{'id':_0xbc21ae[_0x7333('0x47')]['id']}},_0x437371={};_0x437371[_0x7333('0x33')]=_[_0x7333('0x35')](db[_0x7333('0x2f')][_0x7333('0x48')]);_0x437371[_0x7333('0x34')]=_['keys'](_0xbc21ae[_0x7333('0x34')]);_0x437371['filters']=_[_0x7333('0x37')](_0x437371[_0x7333('0x33')],_0x437371[_0x7333('0x34')]);_0x139903[_0x7333('0x38')]=_[_0x7333('0x37')](_0x437371['model'],qs['fields'](_0xbc21ae[_0x7333('0x34')][_0x7333('0x49')]));_0x139903[_0x7333('0x38')]=_0x139903[_0x7333('0x38')]['length']?_0x139903['attributes']:_0x437371['model'];if(_0xbc21ae[_0x7333('0x34')][_0x7333('0x4a')]){_0x139903[_0x7333('0x42')]=[{'all':!![]}];}_0x139903=_[_0x7333('0x40')]({},_0x139903,_0xbc21ae[_0x7333('0x41')]);return db[_0x7333('0x2f')][_0x7333('0x4b')](_0x139903)[_0x7333('0x27')](handleEntityNotFound(_0x44fa50,null))[_0x7333('0x27')](respondWithResult(_0x44fa50,null))[_0x7333('0x45')](handleError(_0x44fa50,null));};exports[_0x7333('0x4c')]=function(_0x1f8af7,_0x3c1f51){return db[_0x7333('0x2f')]['create'](_0x1f8af7[_0x7333('0x4d')],{})['then'](respondWithResult(_0x3c1f51,0xc9))['catch'](handleError(_0x3c1f51,null));};exports[_0x7333('0x4e')]=function(_0x151c8b,_0x3a1750){if(_0x151c8b[_0x7333('0x4d')]['id']){delete _0x151c8b[_0x7333('0x4d')]['id'];}return db['OpenchannelTransferReport'][_0x7333('0x4b')]({'where':{'id':_0x151c8b['params']['id']}})[_0x7333('0x27')](handleEntityNotFound(_0x3a1750,null))[_0x7333('0x27')](saveUpdates(_0x151c8b[_0x7333('0x4d')],null))['then'](respondWithResult(_0x3a1750,null))['catch'](handleError(_0x3a1750,null));};exports[_0x7333('0x28')]=function(_0x29c7c0,_0x555927){return db[_0x7333('0x2f')][_0x7333('0x4b')]({'where':{'id':_0x29c7c0['params']['id']}})[_0x7333('0x27')](handleEntityNotFound(_0x555927,null))[_0x7333('0x27')](removeEntity(_0x555927,null))[_0x7333('0x45')](handleError(_0x555927,null));};exports['describe']=function(_0x25d8d7,_0x277133){return db[_0x7333('0x2f')][_0x7333('0x4f')]()[_0x7333('0x27')](respondWithResult(_0x277133,null))[_0x7333('0x45')](handleError(_0x277133,null));}; \ No newline at end of file +var _0x431c=['fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','stack','send','index','map','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','update','describe','zip-dir'];(function(_0x512178,_0x28a618){var _0x2b8818=function(_0x268ce0){while(--_0x268ce0){_0x512178['push'](_0x512178['shift']());}};_0x2b8818(++_0x28a618);}(_0x431c,0x93));var _0xc431=function(_0x3a9ca0,_0x4644ec){_0x3a9ca0=_0x3a9ca0-0x0;var _0x1bacb7=_0x431c[_0x3a9ca0];return _0x1bacb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc431('0x0'));var jsonpatch=require(_0xc431('0x1'));var rp=require(_0xc431('0x2'));var moment=require('moment');var BPromise=require(_0xc431('0x3'));var Mustache=require(_0xc431('0x4'));var util=require(_0xc431('0x5'));var path=require(_0xc431('0x6'));var sox=require('sox');var csv=require(_0xc431('0x7'));var ejs=require(_0xc431('0x8'));var fs=require('fs');var fs_extra=require(_0xc431('0x9'));var _=require(_0xc431('0xa'));var squel=require('squel');var crypto=require(_0xc431('0xb'));var jsforce=require(_0xc431('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc431('0xd'));var Papa=require(_0xc431('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc431('0xf'));var hardwareService=require(_0xc431('0x10'));var logger=require(_0xc431('0x11'))(_0xc431('0x12'));var utils=require('../../config/utils');var config=require(_0xc431('0x13'));var licenseUtil=require(_0xc431('0x14'));var db=require(_0xc431('0x15'))['db'];function respondWithStatusCode(_0x4a7057,_0x3545a2){_0x3545a2=_0x3545a2||0xcc;return function(_0x4641b7){if(_0x4641b7){return _0x4a7057[_0xc431('0x16')](_0x3545a2);}return _0x4a7057['status'](_0x3545a2)[_0xc431('0x17')]();};}function respondWithResult(_0x5c95cc,_0x36b1f6){_0x36b1f6=_0x36b1f6||0xc8;return function(_0x53a67f){if(_0x53a67f){return _0x5c95cc[_0xc431('0x18')](_0x36b1f6)[_0xc431('0x19')](_0x53a67f);}};}function respondWithFilteredResult(_0xf0cbf5,_0x3b24b3){return function(_0x56919d){if(_0x56919d){var _0x23da88=typeof _0x3b24b3[_0xc431('0x1a')]==='undefined'&&typeof _0x3b24b3[_0xc431('0x1b')]===_0xc431('0x1c');var _0x346bfb=_0x56919d[_0xc431('0x1d')];var _0x240cd2=_0x23da88?0x0:_0x3b24b3[_0xc431('0x1a')];var _0x41f42e=_0x23da88?_0x56919d[_0xc431('0x1d')]:_0x3b24b3[_0xc431('0x1a')]+_0x3b24b3[_0xc431('0x1b')];var _0x15aa96;if(_0x41f42e>=_0x346bfb){_0x41f42e=_0x346bfb;_0x15aa96=0xc8;}else{_0x15aa96=0xce;}_0xf0cbf5[_0xc431('0x18')](_0x15aa96);return _0xf0cbf5[_0xc431('0x1e')](_0xc431('0x1f'),_0x240cd2+'-'+_0x41f42e+'/'+_0x346bfb)[_0xc431('0x19')](_0x56919d);}return null;};}function patchUpdates(_0x722da3){return function(_0x22bdc4){try{jsonpatch[_0xc431('0x20')](_0x22bdc4,_0x722da3,!![]);}catch(_0x4a2715){return BPromise['reject'](_0x4a2715);}return _0x22bdc4[_0xc431('0x21')]();};}function saveUpdates(_0x439b71,_0x5bda41){return function(_0x3aa574){if(_0x3aa574){return _0x3aa574['update'](_0x439b71)[_0xc431('0x22')](function(_0x56270a){return _0x56270a;});}return null;};}function removeEntity(_0x301d77,_0x3ae518){return function(_0x54e8d7){if(_0x54e8d7){return _0x54e8d7['destroy']()[_0xc431('0x22')](function(){_0x301d77[_0xc431('0x18')](0xcc)[_0xc431('0x17')]();});}};}function handleEntityNotFound(_0x34c05c,_0x10eed6){return function(_0x2f44aa){if(!_0x2f44aa){_0x34c05c[_0xc431('0x16')](0x194);}return _0x2f44aa;};}function handleError(_0x163056,_0x22e19c){_0x22e19c=_0x22e19c||0x1f4;return function(_0x357bfb){logger[_0xc431('0x23')](_0x357bfb[_0xc431('0x24')]);if(_0x357bfb['name']){delete _0x357bfb['name'];}_0x163056[_0xc431('0x18')](_0x22e19c)[_0xc431('0x25')](_0x357bfb);};}exports[_0xc431('0x26')]=function(_0x4a0af7,_0x238e73){var _0x63791b={},_0x60ac4b={},_0x6e17fa={'count':0x0,'rows':[]};var _0x1fdeb4=_[_0xc431('0x27')](db['OpenchannelTransferReport'][_0xc431('0x28')],function(_0x41cb2f){return{'name':_0x41cb2f['fieldName'],'type':_0x41cb2f[_0xc431('0x29')]['key']};});_0x60ac4b[_0xc431('0x2a')]=_[_0xc431('0x27')](_0x1fdeb4,_0xc431('0x2b'));_0x60ac4b[_0xc431('0x2c')]=_[_0xc431('0x2d')](_0x4a0af7['query']);_0x60ac4b[_0xc431('0x2e')]=_[_0xc431('0x2f')](_0x60ac4b['model'],_0x60ac4b['query']);_0x63791b[_0xc431('0x30')]=_[_0xc431('0x2f')](_0x60ac4b[_0xc431('0x2a')],qs['fields'](_0x4a0af7[_0xc431('0x2c')][_0xc431('0x31')]));_0x63791b[_0xc431('0x30')]=_0x63791b['attributes']['length']?_0x63791b[_0xc431('0x30')]:_0x60ac4b[_0xc431('0x2a')];if(!_0x4a0af7[_0xc431('0x2c')][_0xc431('0x32')](_0xc431('0x33'))){_0x63791b['limit']=qs[_0xc431('0x1b')](_0x4a0af7['query'][_0xc431('0x1b')]);_0x63791b[_0xc431('0x1a')]=qs[_0xc431('0x1a')](_0x4a0af7[_0xc431('0x2c')][_0xc431('0x1a')]);}_0x63791b[_0xc431('0x34')]=qs[_0xc431('0x35')](_0x4a0af7[_0xc431('0x2c')]['sort']);_0x63791b[_0xc431('0x36')]=qs[_0xc431('0x2e')](_[_0xc431('0x37')](_0x4a0af7[_0xc431('0x2c')],_0x60ac4b['filters']),_0x1fdeb4);if(_0x4a0af7[_0xc431('0x2c')]['filter']){_0x63791b[_0xc431('0x36')]=_[_0xc431('0x38')](_0x63791b[_0xc431('0x36')],{'$or':_[_0xc431('0x27')](_0x1fdeb4,function(_0x3aef25){if(_0x3aef25[_0xc431('0x29')]!==_0xc431('0x39')){var _0x16a7d6={};_0x16a7d6[_0x3aef25[_0xc431('0x2b')]]={'$like':'%'+_0x4a0af7[_0xc431('0x2c')][_0xc431('0x3a')]+'%'};return _0x16a7d6;}})});}_0x63791b=_[_0xc431('0x38')]({},_0x63791b,_0x4a0af7['options']);var _0x52210a={'where':_0x63791b[_0xc431('0x36')]};return db[_0xc431('0x3b')][_0xc431('0x1d')](_0x52210a)[_0xc431('0x22')](function(_0xf22a88){_0x6e17fa[_0xc431('0x1d')]=_0xf22a88;if(_0x4a0af7[_0xc431('0x2c')][_0xc431('0x3c')]){_0x63791b[_0xc431('0x3d')]=[{'all':!![]}];}return db[_0xc431('0x3b')][_0xc431('0x3e')](_0x63791b);})[_0xc431('0x22')](function(_0x2a7790){_0x6e17fa[_0xc431('0x3f')]=_0x2a7790;return _0x6e17fa;})['then'](respondWithFilteredResult(_0x238e73,_0x63791b))[_0xc431('0x40')](handleError(_0x238e73,null));};exports[_0xc431('0x41')]=function(_0x1800fa,_0x2030f9){var _0x4ee7aa={'raw':!![],'where':{'id':_0x1800fa[_0xc431('0x42')]['id']}},_0x151167={};_0x151167[_0xc431('0x2a')]=_[_0xc431('0x2d')](db['OpenchannelTransferReport'][_0xc431('0x28')]);_0x151167['query']=_[_0xc431('0x2d')](_0x1800fa['query']);_0x151167[_0xc431('0x2e')]=_[_0xc431('0x2f')](_0x151167[_0xc431('0x2a')],_0x151167[_0xc431('0x2c')]);_0x4ee7aa['attributes']=_[_0xc431('0x2f')](_0x151167[_0xc431('0x2a')],qs[_0xc431('0x31')](_0x1800fa[_0xc431('0x2c')]['fields']));_0x4ee7aa[_0xc431('0x30')]=_0x4ee7aa[_0xc431('0x30')][_0xc431('0x43')]?_0x4ee7aa[_0xc431('0x30')]:_0x151167['model'];if(_0x1800fa[_0xc431('0x2c')]['includeAll']){_0x4ee7aa['include']=[{'all':!![]}];}_0x4ee7aa=_[_0xc431('0x38')]({},_0x4ee7aa,_0x1800fa[_0xc431('0x44')]);return db[_0xc431('0x3b')][_0xc431('0x45')](_0x4ee7aa)[_0xc431('0x22')](handleEntityNotFound(_0x2030f9,null))[_0xc431('0x22')](respondWithResult(_0x2030f9,null))[_0xc431('0x40')](handleError(_0x2030f9,null));};exports['create']=function(_0x36940b,_0x54e46e){return db[_0xc431('0x3b')][_0xc431('0x46')](_0x36940b[_0xc431('0x47')],{})[_0xc431('0x22')](respondWithResult(_0x54e46e,0xc9))[_0xc431('0x40')](handleError(_0x54e46e,null));};exports[_0xc431('0x48')]=function(_0x5b4113,_0x5f2430){if(_0x5b4113[_0xc431('0x47')]['id']){delete _0x5b4113[_0xc431('0x47')]['id'];}return db[_0xc431('0x3b')][_0xc431('0x45')]({'where':{'id':_0x5b4113[_0xc431('0x42')]['id']}})['then'](handleEntityNotFound(_0x5f2430,null))[_0xc431('0x22')](saveUpdates(_0x5b4113[_0xc431('0x47')],null))[_0xc431('0x22')](respondWithResult(_0x5f2430,null))['catch'](handleError(_0x5f2430,null));};exports['destroy']=function(_0x49bbb2,_0x1dbe27){return db['OpenchannelTransferReport'][_0xc431('0x45')]({'where':{'id':_0x49bbb2[_0xc431('0x42')]['id']}})[_0xc431('0x22')](handleEntityNotFound(_0x1dbe27,null))[_0xc431('0x22')](removeEntity(_0x1dbe27,null))[_0xc431('0x40')](handleError(_0x1dbe27,null));};exports[_0xc431('0x49')]=function(_0x472041,_0x5b536a){return db['OpenchannelTransferReport'][_0xc431('0x49')]()['then'](respondWithResult(_0x5b536a,null))[_0xc431('0x40')](handleError(_0x5b536a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 0b66e3e..2eddcc8 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 _0x388c=['exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./openchannelTransferReport.attributes'];(function(_0x502e0f,_0x1ffe21){var _0x31bdaa=function(_0x384e78){while(--_0x384e78){_0x502e0f['push'](_0x502e0f['shift']());}};_0x31bdaa(++_0x1ffe21);}(_0x388c,0x101));var _0xc388=function(_0x52d700,_0xbd5809){_0x52d700=_0x52d700-0x0;var _0x15b7be=_0x388c[_0x52d700];return _0x15b7be;};'use strict';var _=require(_0xc388('0x0'));var util=require('util');var logger=require(_0xc388('0x1'))('api');var moment=require(_0xc388('0x2'));var BPromise=require(_0xc388('0x3'));var rp=require(_0xc388('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc388('0x5'));var config=require('../../config/environment');var attributes=require(_0xc388('0x6'));module[_0xc388('0x7')]=function(_0x3909f0,_0x4631d5){return _0x3909f0[_0xc388('0x8')](_0xc388('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xc388('0xa'),'fields':[_0xc388('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x43dc=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','report_openchannel_transfer','uniqueid'];(function(_0x530b14,_0x530de1){var _0x995d75=function(_0x3f4746){while(--_0x3f4746){_0x530b14['push'](_0x530b14['shift']());}};_0x995d75(++_0x530de1);}(_0x43dc,0x1a4));var _0xc43d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x43dc[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0xc43d('0x0'));var util=require('util');var logger=require(_0xc43d('0x1'))(_0xc43d('0x2'));var moment=require(_0xc43d('0x3'));var BPromise=require(_0xc43d('0x4'));var rp=require(_0xc43d('0x5'));var fs=require('fs');var path=require(_0xc43d('0x6'));var rimraf=require('rimraf');var config=require(_0xc43d('0x7'));var attributes=require(_0xc43d('0x8'));module[_0xc43d('0x9')]=function(_0x30ef96,_0x22d963){return _0x30ef96['define']('OpenchannelTransferReport',attributes,{'tableName':_0xc43d('0xa'),'paranoid':![],'indexes':[{'name':_0xc43d('0xb'),'fields':[_0xc43d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 1bb9933..b856b5d 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 _0x96aa=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cc211,_0xc839c8){var _0x12a817=function(_0x10e4ed){while(--_0x10e4ed){_0x2cc211['push'](_0x2cc211['shift']());}};_0x12a817(++_0xc839c8);}(_0x96aa,0x67));var _0xa96a=function(_0x10c834,_0x22afe5){_0x10c834=_0x10c834-0x0;var _0x5b2eea=_0x96aa[_0x10c834];return _0x5b2eea;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var moment=require('moment');var BPromise=require(_0xa96a('0x2'));var rs=require(_0xa96a('0x3'));var fs=require('fs');var Redis=require(_0xa96a('0x4'));var db=require(_0xa96a('0x5'))['db'];var utils=require(_0xa96a('0x6'));var logger=require('../../config/logger')(_0xa96a('0x7'));var config=require(_0xa96a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa96a('0x9')][_0xa96a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282c8c,_0x3f391e,_0x44fb9d){return new BPromise(function(_0x3c7329,_0x160c16){return client[_0xa96a('0xb')](_0x282c8c,_0x44fb9d)[_0xa96a('0xc')](function(_0x134f9c){logger[_0xa96a('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3f391e,_0xa96a('0xe'));logger['debug'](_0xa96a('0xf'),_0x3f391e,_0xa96a('0xe'),JSON['stringify'](_0x134f9c));if(_0x134f9c[_0xa96a('0x10')]){if(_0x134f9c[_0xa96a('0x10')][_0xa96a('0x11')]===0x1f4){logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x134f9c[_0xa96a('0x10')][_0xa96a('0x13')]);return _0x160c16(_0x134f9c[_0xa96a('0x10')][_0xa96a('0x13')]);}logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x134f9c[_0xa96a('0x10')]['message']);return _0x3c7329(_0x134f9c['error'][_0xa96a('0x13')]);}else{logger['info'](_0xa96a('0x12'),_0x3f391e,'request\x20sent');_0x3c7329(_0x134f9c[_0xa96a('0x14')][_0xa96a('0x13')]);}})[_0xa96a('0x15')](function(_0x3372f9){logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x3372f9);_0x160c16(_0x3372f9);});});} \ No newline at end of file +var _0xee14=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x1ab7dc,_0x1d7475){var _0x2ae103=function(_0x5d4078){while(--_0x5d4078){_0x1ab7dc['push'](_0x1ab7dc['shift']());}};_0x2ae103(++_0x1d7475);}(_0xee14,0x13a));var _0x4ee1=function(_0x2ebd1b,_0x519da9){_0x2ebd1b=_0x2ebd1b-0x0;var _0x26ce87=_0xee14[_0x2ebd1b];return _0x26ce87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ee1('0x0'));var BPromise=require(_0x4ee1('0x1'));var rs=require(_0x4ee1('0x2'));var fs=require('fs');var Redis=require(_0x4ee1('0x3'));var db=require(_0x4ee1('0x4'))['db'];var utils=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var config=require(_0x4ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ee1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){return client[_0x4ee1('0xa')](_0x327c18,_0x187656)['then'](function(_0x33dbe6){logger[_0x4ee1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));logger[_0x4ee1('0xd')](_0x4ee1('0xe'),_0x3a45a3,_0x4ee1('0xc'),JSON['stringify'](_0x33dbe6));if(_0x33dbe6[_0x4ee1('0xf')]){if(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x10')]===0x1f4){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')]['message']);return _0xdfe9c1(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);return _0x293d5f(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}else{logger[_0x4ee1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));_0x293d5f(_0x33dbe6[_0x4ee1('0x13')][_0x4ee1('0x12')]);}})[_0x4ee1('0x14')](function(_0x123c5e){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x123c5e);_0xdfe9c1(_0x123c5e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2f3bf47..d52ea4e 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 _0x1827=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5d0bca,_0x5b55de){var _0x582244=function(_0x2580ea){while(--_0x2580ea){_0x5d0bca['push'](_0x5d0bca['shift']());}};_0x582244(++_0x5b55de);}(_0x1827,0x1dc));var _0x7182=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1827[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7182('0x0'));var path=require(_0x7182('0x1'));var timeout=require(_0x7182('0x2'));var express=require(_0x7182('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7182('0x4'));var interaction=require(_0x7182('0x5'));var config=require(_0x7182('0x6'));var controller=require(_0x7182('0x7'));router[_0x7182('0x8')]('/',auth[_0x7182('0x9')](),controller[_0x7182('0xa')]);router[_0x7182('0x8')](_0x7182('0xb'),auth[_0x7182('0x9')](),controller['show']);router['post']('/',auth[_0x7182('0x9')](),controller['create']);router['put']('/:id',auth[_0x7182('0x9')](),controller['update']);router[_0x7182('0xc')](_0x7182('0xb'),auth[_0x7182('0x9')](),controller[_0x7182('0xd')]);module[_0x7182('0xe')]=router; \ No newline at end of file +var _0x8149=['get','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index'];(function(_0x5b2e1b,_0x547ee7){var _0x5701b8=function(_0x28405f){while(--_0x28405f){_0x5b2e1b['push'](_0x5b2e1b['shift']());}};_0x5701b8(++_0x547ee7);}(_0x8149,0x148));var _0x9814=function(_0x3ab193,_0x51dc97){_0x3ab193=_0x3ab193-0x0;var _0x285833=_0x8149[_0x3ab193];return _0x285833;};'use strict';var multer=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var path=require(_0x9814('0x2'));var timeout=require(_0x9814('0x3'));var express=require(_0x9814('0x4'));var router=express[_0x9814('0x5')]();var fs_extra=require(_0x9814('0x6'));var auth=require(_0x9814('0x7'));var interaction=require(_0x9814('0x8'));var config=require('../../config/environment');var controller=require(_0x9814('0x9'));router['get']('/',auth[_0x9814('0xa')](),controller[_0x9814('0xb')]);router[_0x9814('0xc')](_0x9814('0xd'),auth[_0x9814('0xa')](),controller[_0x9814('0xe')]);router[_0x9814('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9814('0x10')](_0x9814('0xd'),auth[_0x9814('0xa')](),controller[_0x9814('0x11')]);router['delete'](_0x9814('0xd'),auth[_0x9814('0xa')](),controller[_0x9814('0x12')]);module[_0x9814('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d90ef5a..ddc6ac5 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 _0x2d29=['exports','STRING','name','sequelize'];(function(_0x3865bc,_0x269488){var _0x161b7c=function(_0x378659){while(--_0x378659){_0x3865bc['push'](_0x3865bc['shift']());}};_0x161b7c(++_0x269488);}(_0x2d29,0x18f));var _0x92d2=function(_0x117784,_0xd479f0){_0x117784=_0x117784-0x0;var _0xa1fed9=_0x2d29[_0x117784];return _0xa1fed9;};'use strict';var Sequelize=require(_0x92d2('0x0'));module[_0x92d2('0x1')]={'name':{'type':Sequelize[_0x92d2('0x2')],'unique':_0x92d2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x92d2('0x2')]}}; \ No newline at end of file +var _0x8ec2=['STRING','name','sequelize','exports'];(function(_0x2dc024,_0x97f547){var _0x44b423=function(_0x2889a2){while(--_0x2889a2){_0x2dc024['push'](_0x2dc024['shift']());}};_0x44b423(++_0x97f547);}(_0x8ec2,0x1b2));var _0x28ec=function(_0x5f47ea,_0x2e5c20){_0x5f47ea=_0x5f47ea-0x0;var _0x26b92b=_0x8ec2[_0x5f47ea];return _0x26b92b;};'use strict';var Sequelize=require(_0x28ec('0x0'));module[_0x28ec('0x1')]={'name':{'type':Sequelize[_0x28ec('0x2')],'unique':_0x28ec('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x28ec('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 48636be..d086d90 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 _0x4c6c=['get','Pauses','UserProfileResource','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4c6c,0x18e));var _0xc4c6=function(_0x1783ec,_0x55a599){_0x1783ec=_0x1783ec-0x0;var _0x5590dc=_0x4c6c[_0x1783ec];return _0x5590dc;};'use strict';var emlformat=require(_0xc4c6('0x0'));var rimraf=require(_0xc4c6('0x1'));var zipdir=require(_0xc4c6('0x2'));var jsonpatch=require(_0xc4c6('0x3'));var rp=require(_0xc4c6('0x4'));var moment=require('moment');var BPromise=require(_0xc4c6('0x5'));var Mustache=require(_0xc4c6('0x6'));var util=require(_0xc4c6('0x7'));var path=require(_0xc4c6('0x8'));var sox=require('sox');var csv=require(_0xc4c6('0x9'));var ejs=require(_0xc4c6('0xa'));var fs=require('fs');var fs_extra=require(_0xc4c6('0xb'));var _=require(_0xc4c6('0xc'));var squel=require(_0xc4c6('0xd'));var crypto=require('crypto');var jsforce=require(_0xc4c6('0xe'));var deskjs=require(_0xc4c6('0xf'));var toCsv=require(_0xc4c6('0x9'));var querystring=require(_0xc4c6('0x10'));var Papa=require(_0xc4c6('0x11'));var Redis=require(_0xc4c6('0x12'));var authService=require(_0xc4c6('0x13'));var qs=require(_0xc4c6('0x14'));var as=require(_0xc4c6('0x15'));var hardwareService=require(_0xc4c6('0x16'));var logger=require('../../config/logger')(_0xc4c6('0x17'));var utils=require(_0xc4c6('0x18'));var config=require(_0xc4c6('0x19'));var licenseUtil=require(_0xc4c6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e80d2,_0x4ca98d){_0x4ca98d=_0x4ca98d||0xcc;return function(_0x2d028a){if(_0x2d028a){return _0x5e80d2[_0xc4c6('0x1b')](_0x4ca98d);}return _0x5e80d2[_0xc4c6('0x1c')](_0x4ca98d)[_0xc4c6('0x1d')]();};}function respondWithResult(_0x4f31b3,_0x4282e7){_0x4282e7=_0x4282e7||0xc8;return function(_0x595244){if(_0x595244){return _0x4f31b3['status'](_0x4282e7)[_0xc4c6('0x1e')](_0x595244);}};}function respondWithFilteredResult(_0x429a3f,_0xbb8ce2){return function(_0x2a7d49){if(_0x2a7d49){var _0x5b79af=typeof _0xbb8ce2[_0xc4c6('0x1f')]==='undefined'&&typeof _0xbb8ce2[_0xc4c6('0x20')]===_0xc4c6('0x21');var _0x27f74a=_0x2a7d49[_0xc4c6('0x22')];var _0xdf1fc6=_0x5b79af?0x0:_0xbb8ce2[_0xc4c6('0x1f')];var _0xb2e675=_0x5b79af?_0x2a7d49[_0xc4c6('0x22')]:_0xbb8ce2[_0xc4c6('0x1f')]+_0xbb8ce2[_0xc4c6('0x20')];var _0x594a45;if(_0xb2e675>=_0x27f74a){_0xb2e675=_0x27f74a;_0x594a45=0xc8;}else{_0x594a45=0xce;}_0x429a3f[_0xc4c6('0x1c')](_0x594a45);return _0x429a3f[_0xc4c6('0x23')]('Content-Range',_0xdf1fc6+'-'+_0xb2e675+'/'+_0x27f74a)[_0xc4c6('0x1e')](_0x2a7d49);}return null;};}function patchUpdates(_0x4a364c){return function(_0x2f5bc9){try{jsonpatch[_0xc4c6('0x24')](_0x2f5bc9,_0x4a364c,!![]);}catch(_0x153553){return BPromise[_0xc4c6('0x25')](_0x153553);}return _0x2f5bc9[_0xc4c6('0x26')]();};}function saveUpdates(_0x397d25,_0x328183){return function(_0x5b650f){if(_0x5b650f){return _0x5b650f[_0xc4c6('0x27')](_0x397d25)[_0xc4c6('0x28')](function(_0x480b6d){return _0x480b6d;});}return null;};}function removeEntity(_0x1acf74,_0x2f531a){return function(_0x1cbaf3){if(_0x1cbaf3){return _0x1cbaf3[_0xc4c6('0x29')]()[_0xc4c6('0x28')](function(){var _0x5bf379=_0x1cbaf3[_0xc4c6('0x2a')]({'plain':!![]});var _0x1ea9f8=_0xc4c6('0x2b');return db[_0xc4c6('0x2c')][_0xc4c6('0x29')]({'where':{'type':_0x1ea9f8,'resourceId':_0x5bf379['id']}})[_0xc4c6('0x28')](function(){return _0x1cbaf3;});})[_0xc4c6('0x28')](function(){_0x1acf74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb157,_0x65226b){return function(_0x33aafb){if(!_0x33aafb){_0xdb157['sendStatus'](0x194);}return _0x33aafb;};}function handleError(_0x8e202a,_0x91371b){_0x91371b=_0x91371b||0x1f4;return function(_0x572ba2){logger[_0xc4c6('0x2d')](_0x572ba2['stack']);if(_0x572ba2['name']){delete _0x572ba2[_0xc4c6('0x2e')];}_0x8e202a[_0xc4c6('0x1c')](_0x91371b)[_0xc4c6('0x2f')](_0x572ba2);};}exports[_0xc4c6('0x30')]=function(_0x3be731,_0x58d8b5){var _0x10e00a={},_0x443ff4={},_0x2f0d40={'count':0x0,'rows':[]};var _0x3f07bf=_[_0xc4c6('0x31')](db[_0xc4c6('0x32')][_0xc4c6('0x33')],function(_0x280b0b){return{'name':_0x280b0b[_0xc4c6('0x34')],'type':_0x280b0b[_0xc4c6('0x35')][_0xc4c6('0x36')]};});_0x443ff4[_0xc4c6('0x37')]=_[_0xc4c6('0x31')](_0x3f07bf,_0xc4c6('0x2e'));_0x443ff4['query']=_[_0xc4c6('0x38')](_0x3be731[_0xc4c6('0x39')]);_0x443ff4[_0xc4c6('0x3a')]=_['intersection'](_0x443ff4[_0xc4c6('0x37')],_0x443ff4['query']);_0x10e00a[_0xc4c6('0x3b')]=_['intersection'](_0x443ff4[_0xc4c6('0x37')],qs[_0xc4c6('0x3c')](_0x3be731[_0xc4c6('0x39')][_0xc4c6('0x3c')]));_0x10e00a[_0xc4c6('0x3b')]=_0x10e00a[_0xc4c6('0x3b')][_0xc4c6('0x3d')]?_0x10e00a['attributes']:_0x443ff4[_0xc4c6('0x37')];if(!_0x3be731['query'][_0xc4c6('0x3e')](_0xc4c6('0x3f'))){_0x10e00a[_0xc4c6('0x20')]=qs[_0xc4c6('0x20')](_0x3be731['query'][_0xc4c6('0x20')]);_0x10e00a['offset']=qs[_0xc4c6('0x1f')](_0x3be731['query']['offset']);}_0x10e00a[_0xc4c6('0x40')]=qs[_0xc4c6('0x41')](_0x3be731['query'][_0xc4c6('0x41')]);_0x10e00a[_0xc4c6('0x42')]=qs[_0xc4c6('0x3a')](_[_0xc4c6('0x43')](_0x3be731['query'],_0x443ff4['filters']),_0x3f07bf);if(_0x3be731['query'][_0xc4c6('0x44')]){_0x10e00a['where']=_[_0xc4c6('0x45')](_0x10e00a[_0xc4c6('0x42')],{'$or':_[_0xc4c6('0x31')](_0x3f07bf,function(_0x798213){if(_0x798213[_0xc4c6('0x35')]!==_0xc4c6('0x46')){var _0x8a9c3f={};_0x8a9c3f[_0x798213['name']]={'$like':'%'+_0x3be731[_0xc4c6('0x39')][_0xc4c6('0x44')]+'%'};return _0x8a9c3f;}})});}_0x10e00a=_['merge']({},_0x10e00a,_0x3be731[_0xc4c6('0x47')]);var _0x38a786={'where':_0x10e00a['where']};return db[_0xc4c6('0x32')][_0xc4c6('0x22')](_0x38a786)[_0xc4c6('0x28')](function(_0x19a3af){_0x2f0d40[_0xc4c6('0x22')]=_0x19a3af;if(_0x3be731[_0xc4c6('0x39')][_0xc4c6('0x48')]){_0x10e00a[_0xc4c6('0x49')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x10e00a);})['then'](function(_0xc21ea8){_0x2f0d40[_0xc4c6('0x4a')]=_0xc21ea8;return _0x2f0d40;})[_0xc4c6('0x28')](respondWithFilteredResult(_0x58d8b5,_0x10e00a))[_0xc4c6('0x4b')](handleError(_0x58d8b5,null));};exports[_0xc4c6('0x4c')]=function(_0x12f025,_0x58f80a){var _0x9edd4b={'raw':!![],'where':{'id':_0x12f025[_0xc4c6('0x4d')]['id']}},_0x56ad66={};_0x56ad66['model']=_['keys'](db[_0xc4c6('0x32')][_0xc4c6('0x33')]);_0x56ad66[_0xc4c6('0x39')]=_['keys'](_0x12f025['query']);_0x56ad66[_0xc4c6('0x3a')]=_['intersection'](_0x56ad66['model'],_0x56ad66[_0xc4c6('0x39')]);_0x9edd4b[_0xc4c6('0x3b')]=_[_0xc4c6('0x4e')](_0x56ad66[_0xc4c6('0x37')],qs['fields'](_0x12f025[_0xc4c6('0x39')][_0xc4c6('0x3c')]));_0x9edd4b[_0xc4c6('0x3b')]=_0x9edd4b[_0xc4c6('0x3b')]['length']?_0x9edd4b[_0xc4c6('0x3b')]:_0x56ad66['model'];if(_0x12f025[_0xc4c6('0x39')]['includeAll']){_0x9edd4b['include']=[{'all':!![]}];}_0x9edd4b=_[_0xc4c6('0x45')]({},_0x9edd4b,_0x12f025[_0xc4c6('0x47')]);return db[_0xc4c6('0x32')][_0xc4c6('0x4f')](_0x9edd4b)[_0xc4c6('0x28')](handleEntityNotFound(_0x58f80a,null))['then'](respondWithResult(_0x58f80a,null))[_0xc4c6('0x4b')](handleError(_0x58f80a,null));};exports[_0xc4c6('0x50')]=function(_0xb5b549,_0x2ec1a2){return db[_0xc4c6('0x32')]['create'](_0xb5b549['body'],{})[_0xc4c6('0x28')](function(_0xe4f5cb){var _0x5841b6=_0xb5b549[_0xc4c6('0x51')][_0xc4c6('0x2a')]({'plain':!![]});if(!_0x5841b6)throw new Error(_0xc4c6('0x52'));if(_0x5841b6['role']===_0xc4c6('0x51')){var _0x118271=_0xe4f5cb[_0xc4c6('0x2a')]({'plain':!![]});var _0x5e391b=_0xc4c6('0x2b');return db[_0xc4c6('0x53')][_0xc4c6('0x4f')]({'where':{'name':_0x5e391b,'userProfileId':_0x5841b6[_0xc4c6('0x54')]},'raw':!![]})[_0xc4c6('0x28')](function(_0x4e49f2){if(_0x4e49f2&&_0x4e49f2[_0xc4c6('0x55')]===0x0){return db[_0xc4c6('0x2c')][_0xc4c6('0x50')]({'name':_0x118271[_0xc4c6('0x2e')],'resourceId':_0x118271['id'],'type':_0x4e49f2[_0xc4c6('0x2e')],'sectionId':_0x4e49f2['id']},{})[_0xc4c6('0x28')](function(){return _0xe4f5cb;});}else{return _0xe4f5cb;}})[_0xc4c6('0x4b')](function(_0xcefcc5){logger[_0xc4c6('0x2d')](_0xc4c6('0x56'),_0xcefcc5);throw _0xcefcc5;});}return _0xe4f5cb;})[_0xc4c6('0x28')](respondWithResult(_0x2ec1a2,0xc9))['catch'](handleError(_0x2ec1a2,null));};exports['update']=function(_0x44d3c3,_0x3ab3a5){if(_0x44d3c3[_0xc4c6('0x57')]['id']){delete _0x44d3c3[_0xc4c6('0x57')]['id'];}return db['Pause'][_0xc4c6('0x4f')]({'where':{'id':_0x44d3c3['params']['id']}})['then'](handleEntityNotFound(_0x3ab3a5,null))[_0xc4c6('0x28')](saveUpdates(_0x44d3c3['body'],null))[_0xc4c6('0x28')](respondWithResult(_0x3ab3a5,null))[_0xc4c6('0x4b')](handleError(_0x3ab3a5,null));};exports[_0xc4c6('0x29')]=function(_0xa29f0f,_0x561809){return db['Pause'][_0xc4c6('0x4f')]({'where':{'id':_0xa29f0f[_0xc4c6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x561809,null))[_0xc4c6('0x28')](removeEntity(_0x561809,null))[_0xc4c6('0x4b')](handleError(_0x561809,null));}; \ No newline at end of file +var _0xf29a=['update','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','Content-Range','apply','reject','then','destroy','get','Pauses','UserProfileResource','end','error','stack','index','map','type','key','name','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','filter','merge','options','Pause','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4ffd7a,_0x57ae41){var _0x336ecc=function(_0x3417b8){while(--_0x3417b8){_0x4ffd7a['push'](_0x4ffd7a['shift']());}};_0x336ecc(++_0x57ae41);}(_0xf29a,0x1b1));var _0xaf29=function(_0x3e9722,_0x4e5f88){_0x3e9722=_0x3e9722-0x0;var _0x2321dd=_0xf29a[_0x3e9722];return _0x2321dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf29('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf29('0x1'));var moment=require(_0xaf29('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xaf29('0x3'));var util=require('util');var path=require(_0xaf29('0x4'));var sox=require(_0xaf29('0x5'));var csv=require(_0xaf29('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf29('0x7'));var _=require('lodash');var squel=require(_0xaf29('0x8'));var crypto=require(_0xaf29('0x9'));var jsforce=require(_0xaf29('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xaf29('0x6'));var querystring=require('querystring');var Papa=require(_0xaf29('0xb'));var Redis=require(_0xaf29('0xc'));var authService=require(_0xaf29('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaf29('0xe'));var hardwareService=require(_0xaf29('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xaf29('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xaf29('0x11'));var db=require(_0xaf29('0x12'))['db'];function respondWithStatusCode(_0x380e68,_0x2fe6b8){_0x2fe6b8=_0x2fe6b8||0xcc;return function(_0x3b29ba){if(_0x3b29ba){return _0x380e68[_0xaf29('0x13')](_0x2fe6b8);}return _0x380e68[_0xaf29('0x14')](_0x2fe6b8)['end']();};}function respondWithResult(_0x5310f3,_0x510a92){_0x510a92=_0x510a92||0xc8;return function(_0x34d849){if(_0x34d849){return _0x5310f3[_0xaf29('0x14')](_0x510a92)[_0xaf29('0x15')](_0x34d849);}};}function respondWithFilteredResult(_0xcc5530,_0x8e2668){return function(_0x46d080){if(_0x46d080){var _0x4ae8ad=typeof _0x8e2668['offset']==='undefined'&&typeof _0x8e2668[_0xaf29('0x16')]==='undefined';var _0x7f0f53=_0x46d080[_0xaf29('0x17')];var _0x54b74e=_0x4ae8ad?0x0:_0x8e2668[_0xaf29('0x18')];var _0x29021c=_0x4ae8ad?_0x46d080[_0xaf29('0x17')]:_0x8e2668['offset']+_0x8e2668[_0xaf29('0x16')];var _0x421cf5;if(_0x29021c>=_0x7f0f53){_0x29021c=_0x7f0f53;_0x421cf5=0xc8;}else{_0x421cf5=0xce;}_0xcc5530[_0xaf29('0x14')](_0x421cf5);return _0xcc5530['set'](_0xaf29('0x19'),_0x54b74e+'-'+_0x29021c+'/'+_0x7f0f53)[_0xaf29('0x15')](_0x46d080);}return null;};}function patchUpdates(_0x171ad0){return function(_0x18cecd){try{jsonpatch[_0xaf29('0x1a')](_0x18cecd,_0x171ad0,!![]);}catch(_0x444ed8){return BPromise[_0xaf29('0x1b')](_0x444ed8);}return _0x18cecd['save']();};}function saveUpdates(_0x1fc9db,_0x2d5599){return function(_0x15c7e9){if(_0x15c7e9){return _0x15c7e9['update'](_0x1fc9db)[_0xaf29('0x1c')](function(_0x348cea){return _0x348cea;});}return null;};}function removeEntity(_0x28d5a2,_0x280582){return function(_0xc1a2c){if(_0xc1a2c){return _0xc1a2c[_0xaf29('0x1d')]()[_0xaf29('0x1c')](function(){var _0x553984=_0xc1a2c[_0xaf29('0x1e')]({'plain':!![]});var _0x87845b=_0xaf29('0x1f');return db[_0xaf29('0x20')][_0xaf29('0x1d')]({'where':{'type':_0x87845b,'resourceId':_0x553984['id']}})['then'](function(){return _0xc1a2c;});})[_0xaf29('0x1c')](function(){_0x28d5a2[_0xaf29('0x14')](0xcc)[_0xaf29('0x21')]();});}};}function handleEntityNotFound(_0x488900,_0x260a9f){return function(_0x28e4b2){if(!_0x28e4b2){_0x488900['sendStatus'](0x194);}return _0x28e4b2;};}function handleError(_0x3fd3f1,_0x1781c6){_0x1781c6=_0x1781c6||0x1f4;return function(_0x50a20a){logger[_0xaf29('0x22')](_0x50a20a[_0xaf29('0x23')]);if(_0x50a20a['name']){delete _0x50a20a['name'];}_0x3fd3f1[_0xaf29('0x14')](_0x1781c6)['send'](_0x50a20a);};}exports[_0xaf29('0x24')]=function(_0x333b58,_0x3e3b71){var _0x50bae8={},_0x22ad38={},_0x581dde={'count':0x0,'rows':[]};var _0x35051a=_[_0xaf29('0x25')](db['Pause']['rawAttributes'],function(_0x545449){return{'name':_0x545449['fieldName'],'type':_0x545449[_0xaf29('0x26')][_0xaf29('0x27')]};});_0x22ad38['model']=_[_0xaf29('0x25')](_0x35051a,_0xaf29('0x28'));_0x22ad38[_0xaf29('0x29')]=_['keys'](_0x333b58[_0xaf29('0x29')]);_0x22ad38[_0xaf29('0x2a')]=_[_0xaf29('0x2b')](_0x22ad38['model'],_0x22ad38['query']);_0x50bae8[_0xaf29('0x2c')]=_[_0xaf29('0x2b')](_0x22ad38[_0xaf29('0x2d')],qs['fields'](_0x333b58[_0xaf29('0x29')][_0xaf29('0x2e')]));_0x50bae8['attributes']=_0x50bae8[_0xaf29('0x2c')][_0xaf29('0x2f')]?_0x50bae8['attributes']:_0x22ad38[_0xaf29('0x2d')];if(!_0x333b58[_0xaf29('0x29')]['hasOwnProperty'](_0xaf29('0x30'))){_0x50bae8[_0xaf29('0x16')]=qs[_0xaf29('0x16')](_0x333b58[_0xaf29('0x29')]['limit']);_0x50bae8['offset']=qs[_0xaf29('0x18')](_0x333b58['query'][_0xaf29('0x18')]);}_0x50bae8['order']=qs[_0xaf29('0x31')](_0x333b58[_0xaf29('0x29')][_0xaf29('0x31')]);_0x50bae8[_0xaf29('0x32')]=qs[_0xaf29('0x2a')](_['pick'](_0x333b58[_0xaf29('0x29')],_0x22ad38[_0xaf29('0x2a')]),_0x35051a);if(_0x333b58['query'][_0xaf29('0x33')]){_0x50bae8[_0xaf29('0x32')]=_[_0xaf29('0x34')](_0x50bae8[_0xaf29('0x32')],{'$or':_[_0xaf29('0x25')](_0x35051a,function(_0x38861b){if(_0x38861b[_0xaf29('0x26')]!=='VIRTUAL'){var _0x3efc30={};_0x3efc30[_0x38861b['name']]={'$like':'%'+_0x333b58[_0xaf29('0x29')]['filter']+'%'};return _0x3efc30;}})});}_0x50bae8=_[_0xaf29('0x34')]({},_0x50bae8,_0x333b58[_0xaf29('0x35')]);var _0x56d68f={'where':_0x50bae8[_0xaf29('0x32')]};return db[_0xaf29('0x36')][_0xaf29('0x17')](_0x56d68f)[_0xaf29('0x1c')](function(_0x427dce){_0x581dde[_0xaf29('0x17')]=_0x427dce;if(_0x333b58['query']['includeAll']){_0x50bae8[_0xaf29('0x37')]=[{'all':!![]}];}return db[_0xaf29('0x36')][_0xaf29('0x38')](_0x50bae8);})[_0xaf29('0x1c')](function(_0x2ea764){_0x581dde[_0xaf29('0x39')]=_0x2ea764;return _0x581dde;})[_0xaf29('0x1c')](respondWithFilteredResult(_0x3e3b71,_0x50bae8))[_0xaf29('0x3a')](handleError(_0x3e3b71,null));};exports[_0xaf29('0x3b')]=function(_0x1aac51,_0x2f5695){var _0x5ed707={'raw':!![],'where':{'id':_0x1aac51[_0xaf29('0x3c')]['id']}},_0x9126c0={};_0x9126c0[_0xaf29('0x2d')]=_[_0xaf29('0x3d')](db[_0xaf29('0x36')]['rawAttributes']);_0x9126c0[_0xaf29('0x29')]=_[_0xaf29('0x3d')](_0x1aac51[_0xaf29('0x29')]);_0x9126c0[_0xaf29('0x2a')]=_[_0xaf29('0x2b')](_0x9126c0[_0xaf29('0x2d')],_0x9126c0['query']);_0x5ed707[_0xaf29('0x2c')]=_[_0xaf29('0x2b')](_0x9126c0['model'],qs[_0xaf29('0x2e')](_0x1aac51[_0xaf29('0x29')][_0xaf29('0x2e')]));_0x5ed707[_0xaf29('0x2c')]=_0x5ed707[_0xaf29('0x2c')]['length']?_0x5ed707[_0xaf29('0x2c')]:_0x9126c0[_0xaf29('0x2d')];if(_0x1aac51[_0xaf29('0x29')]['includeAll']){_0x5ed707[_0xaf29('0x37')]=[{'all':!![]}];}_0x5ed707=_['merge']({},_0x5ed707,_0x1aac51[_0xaf29('0x35')]);return db[_0xaf29('0x36')][_0xaf29('0x3e')](_0x5ed707)['then'](handleEntityNotFound(_0x2f5695,null))[_0xaf29('0x1c')](respondWithResult(_0x2f5695,null))[_0xaf29('0x3a')](handleError(_0x2f5695,null));};exports[_0xaf29('0x3f')]=function(_0x7afe08,_0x357638){return db[_0xaf29('0x36')][_0xaf29('0x3f')](_0x7afe08[_0xaf29('0x40')],{})[_0xaf29('0x1c')](function(_0x3835f0){var _0x441956=_0x7afe08['user'][_0xaf29('0x1e')]({'plain':!![]});if(!_0x441956)throw new Error(_0xaf29('0x41'));if(_0x441956[_0xaf29('0x42')]===_0xaf29('0x43')){var _0x16b2c5=_0x3835f0[_0xaf29('0x1e')]({'plain':!![]});var _0x37e439=_0xaf29('0x1f');return db['UserProfileSection'][_0xaf29('0x3e')]({'where':{'name':_0x37e439,'userProfileId':_0x441956[_0xaf29('0x44')]},'raw':!![]})[_0xaf29('0x1c')](function(_0x267fe3){if(_0x267fe3&&_0x267fe3[_0xaf29('0x45')]===0x0){return db[_0xaf29('0x20')][_0xaf29('0x3f')]({'name':_0x16b2c5[_0xaf29('0x28')],'resourceId':_0x16b2c5['id'],'type':_0x267fe3[_0xaf29('0x28')],'sectionId':_0x267fe3['id']},{})[_0xaf29('0x1c')](function(){return _0x3835f0;});}else{return _0x3835f0;}})[_0xaf29('0x3a')](function(_0x426362){logger['error'](_0xaf29('0x46'),_0x426362);throw _0x426362;});}return _0x3835f0;})[_0xaf29('0x1c')](respondWithResult(_0x357638,0xc9))[_0xaf29('0x3a')](handleError(_0x357638,null));};exports[_0xaf29('0x47')]=function(_0x333a2f,_0x19af44){if(_0x333a2f[_0xaf29('0x40')]['id']){delete _0x333a2f['body']['id'];}return db[_0xaf29('0x36')]['find']({'where':{'id':_0x333a2f[_0xaf29('0x3c')]['id']}})[_0xaf29('0x1c')](handleEntityNotFound(_0x19af44,null))[_0xaf29('0x1c')](saveUpdates(_0x333a2f[_0xaf29('0x40')],null))[_0xaf29('0x1c')](respondWithResult(_0x19af44,null))[_0xaf29('0x3a')](handleError(_0x19af44,null));};exports[_0xaf29('0x1d')]=function(_0xe07b9a,_0x44cc58){return db[_0xaf29('0x36')][_0xaf29('0x3e')]({'where':{'id':_0xe07b9a[_0xaf29('0x3c')]['id']}})[_0xaf29('0x1c')](handleEntityNotFound(_0x44cc58,null))[_0xaf29('0x1c')](removeEntity(_0x44cc58,null))[_0xaf29('0x3a')](handleError(_0x44cc58,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 69e3a41..d63ecd7 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x146292,_0x395d9e){_0x146292=_0x146292-0x0;var _0x529147=_0x6aa7[_0x146292];return _0x529147;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 08bb669..60a4e2e 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(_0x3b7470,_0x99b7b7){var _0x47358d=function(_0x489adc){while(--_0x489adc){_0x3b7470['push'](_0x3b7470['shift']());}};_0x47358d(++_0x99b7b7);}(_0x7a54,0x106));var _0x47a5=function(_0x2c73ea,_0x4fcf3f){_0x2c73ea=_0x2c73ea-0x0;var _0x3f428d=_0x7a54[_0x2c73ea];return _0x3f428d;};'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(_0x423199,_0x7b3b92){var _0x4f4112=function(_0x54bf4d){while(--_0x54bf4d){_0x423199['push'](_0x423199['shift']());}};_0x4f4112(++_0x7b3b92);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b0165,_0x33a8c0){_0x1b0165=_0x1b0165-0x0;var _0x80ea5c=_0xb10b[_0x1b0165];return _0x80ea5c;};'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 6696636..cdfeb64 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 _0xec56=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x6e06e5,_0x21fa86){var _0x3ddc46=function(_0x54ecd3){while(--_0x54ecd3){_0x6e06e5['push'](_0x6e06e5['shift']());}};_0x3ddc46(++_0x21fa86);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2fbb14,_0x51e12c){_0x2fbb14=_0x2fbb14-0x0;var _0xb59e35=_0xec56[_0x2fbb14];return _0xb59e35;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router[_0x6ec5('0x9')]('/:id/download',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);var upload=multer({'storage':multer[_0x6ec5('0x11')]({'destination':function(_0x1964ae,_0x143b09,_0x181e79){_0x181e79(null,path[_0x6ec5('0x12')](config['root'],_0x6ec5('0x13')));},'filename':function(_0x1d7180,_0x2b1f61,_0xb04ab6){_0x2b1f61[_0x6ec5('0x14')]=_0x2b1f61[_0x6ec5('0x14')][_0x6ec5('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb04ab6(null,util[_0x6ec5('0x16')]('%s-%s%s',path[_0x6ec5('0x17')](_0x2b1f61['originalname'],path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])),Date[_0x6ec5('0x19')](),path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])));}})});router['post']('/',upload[_0x6ec5('0x1a')](_0x6ec5('0x1b')),controller[_0x6ec5('0x1c')]);router[_0x6ec5('0x1d')](_0x6ec5('0xc'),controller[_0x6ec5('0x1e')]);router[_0x6ec5('0x1f')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x20')]);router[_0x6ec5('0x21')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x21')]);module[_0x6ec5('0x22')]=router; \ No newline at end of file +var _0x0e85=['put','update','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x1b4cf1,_0x58164e){var _0x5a3dac=function(_0x34312f){while(--_0x34312f){_0x1b4cf1['push'](_0x1b4cf1['shift']());}};_0x5a3dac(++_0x58164e);}(_0x0e85,0x7c));var _0x50e8=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0e85[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xc')]);router['get'](_0x50e8('0xd'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xe')]);var upload=multer({'storage':multer[_0x50e8('0xf')]({'destination':function(_0x154b9e,_0x194a89,_0x45dc6f){_0x45dc6f(null,path[_0x50e8('0x10')](config['root'],'server/files/plugins'));},'filename':function(_0xfc6bb9,_0x24d381,_0x508377){_0x24d381['originalname']=_0x24d381[_0x50e8('0x11')][_0x50e8('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x508377(null,util[_0x50e8('0x13')](_0x50e8('0x14'),path['basename'](_0x24d381[_0x50e8('0x11')],path[_0x50e8('0x15')](_0x24d381[_0x50e8('0x11')])),Date['now'](),path['extname'](_0x24d381[_0x50e8('0x11')])));}})});router[_0x50e8('0x16')]('/',upload[_0x50e8('0x17')](_0x50e8('0x18')),controller[_0x50e8('0x19')]);router[_0x50e8('0x16')]('/webhook',controller['webhookPost']);router[_0x50e8('0x1a')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x1b')]);router[_0x50e8('0x1c')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['delete']);module[_0x50e8('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ac50ab5..ebdec11 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 _0xe5e7=['ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never','sequelize'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe5e7,0x1ee));var _0x7e5e=function(_0x9afc69,_0x10503c){_0x9afc69=_0x9afc69-0x0;var _0x5e05c7=_0xe5e7[_0x9afc69];return _0x5e05c7;};'use strict';var Sequelize=require(_0x7e5e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7e5e('0x1')]('html',_0x7e5e('0x2'))},'description':{'type':Sequelize[_0x7e5e('0x3')]},'version':{'type':Sequelize[_0x7e5e('0x3')]},'path':{'type':Sequelize[_0x7e5e('0x4')],'comment':_0x7e5e('0x5')},'active':{'type':Sequelize[_0x7e5e('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x7e5e('0x1')](_0x7e5e('0x7'),_0x7e5e('0x8'),_0x7e5e('0x9'),_0x7e5e('0xa')),'defaultValue':_0x7e5e('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x7e5e('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x7e5e('0x4')]},'scriptName':{'type':Sequelize[_0x7e5e('0x4')]},'scriptPath':{'type':Sequelize[_0x7e5e('0x4')]}}; \ No newline at end of file +var _0xf8a2=['STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','sequelize','exports','ENUM','html','script','TEXT'];(function(_0x161885,_0x383938){var _0x45107c=function(_0x34ffe0){while(--_0x34ffe0){_0x161885['push'](_0x161885['shift']());}};_0x45107c(++_0x383938);}(_0xf8a2,0xe8));var _0x2f8a=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xf8a2[_0xdaab62];return _0x13d767;};'use strict';var Sequelize=require(_0x2f8a('0x0'));module[_0x2f8a('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2f8a('0x2')](_0x2f8a('0x3'),_0x2f8a('0x4'))},'description':{'type':Sequelize[_0x2f8a('0x5')]},'version':{'type':Sequelize[_0x2f8a('0x5')]},'path':{'type':Sequelize[_0x2f8a('0x6')],'comment':_0x2f8a('0x7')},'active':{'type':Sequelize[_0x2f8a('0x8')],'defaultValue':0x0,'comment':_0x2f8a('0x9')},'sidebar':{'type':Sequelize[_0x2f8a('0x2')](_0x2f8a('0xa'),_0x2f8a('0xb'),'always',_0x2f8a('0xc')),'defaultValue':_0x2f8a('0xd'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x2f8a('0x6')]},'adminUrl':{'type':Sequelize[_0x2f8a('0x6')]},'agentUrl':{'type':Sequelize[_0x2f8a('0x6')]},'scriptName':{'type':Sequelize[_0x2f8a('0x6')]},'scriptPath':{'type':Sequelize[_0x2f8a('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 3adce4e..a61cda4 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 _0xb5ef=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','sendStatus','status','end','limit','count','offset','set','Content-Range','json','save','update','then','destroy','get','Plugins','error','name','send','index','map','Plugin','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','download','path','join','format','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','root','server/files/plugins','dirname','node_modules/**/*','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb5ef,0x1e0));var _0xfb5e=function(_0x16f22b,_0x5d3599){_0x16f22b=_0x16f22b-0x0;var _0x24068a=_0xb5ef[_0x16f22b];return _0x24068a;};'use strict';var emlformat=require(_0xfb5e('0x0'));var rimraf=require(_0xfb5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb5e('0x2'));var rp=require(_0xfb5e('0x3'));var moment=require(_0xfb5e('0x4'));var BPromise=require(_0xfb5e('0x5'));var Mustache=require(_0xfb5e('0x6'));var util=require(_0xfb5e('0x7'));var path=require('path');var sox=require(_0xfb5e('0x8'));var csv=require(_0xfb5e('0x9'));var ejs=require(_0xfb5e('0xa'));var fs=require('fs');var fs_extra=require(_0xfb5e('0xb'));var _=require(_0xfb5e('0xc'));var squel=require(_0xfb5e('0xd'));var crypto=require(_0xfb5e('0xe'));var jsforce=require(_0xfb5e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb5e('0x9'));var querystring=require(_0xfb5e('0x10'));var Papa=require(_0xfb5e('0x11'));var extract=require('extract-zip');var rimraf=require(_0xfb5e('0x1'));var archiver=require(_0xfb5e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb5e('0x13'));var as=require(_0xfb5e('0x14'));var hardwareService=require(_0xfb5e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfb5e('0x16'));var config=require(_0xfb5e('0x17'));var licenseUtil=require(_0xfb5e('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfb5e('0x19')](config[_0xfb5e('0x1a')],{'host':_0xfb5e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb5e('0x1a')]));require('./plugin.socket')[_0xfb5e('0x1c')](socket);function respondWithStatusCode(_0x30521a,_0x3a21b8){_0x3a21b8=_0x3a21b8||0xcc;return function(_0x3ad923){if(_0x3ad923){return _0x30521a[_0xfb5e('0x1d')](_0x3a21b8);}return _0x30521a[_0xfb5e('0x1e')](_0x3a21b8)[_0xfb5e('0x1f')]();};}function respondWithResult(_0x4811db,_0x56b47d){_0x56b47d=_0x56b47d||0xc8;return function(_0x373d3c){if(_0x373d3c){return _0x4811db['status'](_0x56b47d)['json'](_0x373d3c);}};}function respondWithFilteredResult(_0x59ce6f,_0x4f7433){return function(_0x241a8b){if(_0x241a8b){var _0x3349b3=typeof _0x4f7433['offset']==='undefined'&&typeof _0x4f7433[_0xfb5e('0x20')]==='undefined';var _0x2249eb=_0x241a8b[_0xfb5e('0x21')];var _0x5adb3a=_0x3349b3?0x0:_0x4f7433[_0xfb5e('0x22')];var _0xb4679d=_0x3349b3?_0x241a8b[_0xfb5e('0x21')]:_0x4f7433['offset']+_0x4f7433['limit'];var _0x3db5b2;if(_0xb4679d>=_0x2249eb){_0xb4679d=_0x2249eb;_0x3db5b2=0xc8;}else{_0x3db5b2=0xce;}_0x59ce6f['status'](_0x3db5b2);return _0x59ce6f[_0xfb5e('0x23')](_0xfb5e('0x24'),_0x5adb3a+'-'+_0xb4679d+'/'+_0x2249eb)[_0xfb5e('0x25')](_0x241a8b);}return null;};}function patchUpdates(_0x280523){return function(_0x13a53a){try{jsonpatch['apply'](_0x13a53a,_0x280523,!![]);}catch(_0x374e8f){return BPromise['reject'](_0x374e8f);}return _0x13a53a[_0xfb5e('0x26')]();};}function saveUpdates(_0x5f49d7,_0x3bc801){return function(_0x254f93){if(_0x254f93){return _0x254f93[_0xfb5e('0x27')](_0x5f49d7)[_0xfb5e('0x28')](function(_0x5826f1){return _0x5826f1;});}return null;};}function removeEntity(_0x4e0d71,_0x1f5eca){return function(_0x3be60d){if(_0x3be60d){return _0x3be60d[_0xfb5e('0x29')]()['then'](function(){var _0x4e6655=_0x3be60d[_0xfb5e('0x2a')]({'plain':!![]});var _0x3bfb3d=_0xfb5e('0x2b');return db['UserProfileResource'][_0xfb5e('0x29')]({'where':{'type':_0x3bfb3d,'resourceId':_0x4e6655['id']}})[_0xfb5e('0x28')](function(){return _0x3be60d;});})[_0xfb5e('0x28')](function(){_0x4e0d71[_0xfb5e('0x1e')](0xcc)[_0xfb5e('0x1f')]();});}};}function handleEntityNotFound(_0x37714d,_0x352a89){return function(_0x34052b){if(!_0x34052b){_0x37714d[_0xfb5e('0x1d')](0x194);}return _0x34052b;};}function handleError(_0x2c5d22,_0x55224e){_0x55224e=_0x55224e||0x1f4;return function(_0x1bbf37){logger[_0xfb5e('0x2c')](_0x1bbf37['stack']);if(_0x1bbf37['name']){delete _0x1bbf37[_0xfb5e('0x2d')];}_0x2c5d22[_0xfb5e('0x1e')](_0x55224e)[_0xfb5e('0x2e')](_0x1bbf37);};}exports[_0xfb5e('0x2f')]=function(_0x106401,_0xbd3e11){var _0x58d2f3={},_0xde5378={},_0x3ead74={'count':0x0,'rows':[]};var _0x2f8afb=_[_0xfb5e('0x30')](db[_0xfb5e('0x31')][_0xfb5e('0x32')],function(_0x5c2577){return{'name':_0x5c2577['fieldName'],'type':_0x5c2577[_0xfb5e('0x33')][_0xfb5e('0x34')]};});_0xde5378[_0xfb5e('0x35')]=_[_0xfb5e('0x30')](_0x2f8afb,'name');_0xde5378[_0xfb5e('0x36')]=_[_0xfb5e('0x37')](_0x106401[_0xfb5e('0x36')]);_0xde5378[_0xfb5e('0x38')]=_[_0xfb5e('0x39')](_0xde5378[_0xfb5e('0x35')],_0xde5378[_0xfb5e('0x36')]);_0x58d2f3[_0xfb5e('0x3a')]=_[_0xfb5e('0x39')](_0xde5378[_0xfb5e('0x35')],qs[_0xfb5e('0x3b')](_0x106401[_0xfb5e('0x36')][_0xfb5e('0x3b')]));_0x58d2f3['attributes']=_0x58d2f3[_0xfb5e('0x3a')][_0xfb5e('0x3c')]?_0x58d2f3[_0xfb5e('0x3a')]:_0xde5378[_0xfb5e('0x35')];if(!_0x106401[_0xfb5e('0x36')][_0xfb5e('0x3d')](_0xfb5e('0x3e'))){_0x58d2f3[_0xfb5e('0x20')]=qs[_0xfb5e('0x20')](_0x106401[_0xfb5e('0x36')][_0xfb5e('0x20')]);_0x58d2f3[_0xfb5e('0x22')]=qs[_0xfb5e('0x22')](_0x106401['query'][_0xfb5e('0x22')]);}_0x58d2f3[_0xfb5e('0x3f')]=qs[_0xfb5e('0x40')](_0x106401['query'][_0xfb5e('0x40')]);_0x58d2f3['where']=qs['filters'](_['pick'](_0x106401['query'],_0xde5378[_0xfb5e('0x38')]),_0x2f8afb);if(_0x106401[_0xfb5e('0x36')][_0xfb5e('0x41')]){_0x58d2f3[_0xfb5e('0x42')]=_[_0xfb5e('0x43')](_0x58d2f3[_0xfb5e('0x42')],{'$or':_[_0xfb5e('0x30')](_0x2f8afb,function(_0x3f6414){if(_0x3f6414[_0xfb5e('0x33')]!==_0xfb5e('0x44')){var _0x2073ca={};_0x2073ca[_0x3f6414[_0xfb5e('0x2d')]]={'$like':'%'+_0x106401[_0xfb5e('0x36')][_0xfb5e('0x41')]+'%'};return _0x2073ca;}})});}_0x58d2f3=_[_0xfb5e('0x43')]({},_0x58d2f3,_0x106401[_0xfb5e('0x45')]);var _0x281df7={'where':_0x58d2f3[_0xfb5e('0x42')]};return db['Plugin'][_0xfb5e('0x21')](_0x281df7)[_0xfb5e('0x28')](function(_0x4b7280){_0x3ead74[_0xfb5e('0x21')]=_0x4b7280;if(_0x106401[_0xfb5e('0x36')][_0xfb5e('0x46')]){_0x58d2f3['include']=[{'all':!![]}];}return db[_0xfb5e('0x31')][_0xfb5e('0x47')](_0x58d2f3);})['then'](function(_0x465b1a){_0x3ead74[_0xfb5e('0x48')]=_0x465b1a;return _0x3ead74;})[_0xfb5e('0x28')](respondWithFilteredResult(_0xbd3e11,_0x58d2f3))[_0xfb5e('0x49')](handleError(_0xbd3e11,null));};exports[_0xfb5e('0x4a')]=function(_0x5437fb,_0x57a5fb){var _0x254f70={'raw':!![],'where':{'id':_0x5437fb[_0xfb5e('0x4b')]['id']}},_0x205891={};_0x205891[_0xfb5e('0x35')]=_['keys'](db['Plugin'][_0xfb5e('0x32')]);_0x205891['query']=_[_0xfb5e('0x37')](_0x5437fb[_0xfb5e('0x36')]);_0x205891[_0xfb5e('0x38')]=_[_0xfb5e('0x39')](_0x205891[_0xfb5e('0x35')],_0x205891[_0xfb5e('0x36')]);_0x254f70[_0xfb5e('0x3a')]=_['intersection'](_0x205891[_0xfb5e('0x35')],qs[_0xfb5e('0x3b')](_0x5437fb[_0xfb5e('0x36')][_0xfb5e('0x3b')]));_0x254f70[_0xfb5e('0x3a')]=_0x254f70[_0xfb5e('0x3a')][_0xfb5e('0x3c')]?_0x254f70['attributes']:_0x205891[_0xfb5e('0x35')];if(_0x5437fb['query'][_0xfb5e('0x46')]){_0x254f70[_0xfb5e('0x4c')]=[{'all':!![]}];}_0x254f70=_[_0xfb5e('0x43')]({},_0x254f70,_0x5437fb[_0xfb5e('0x45')]);return db['Plugin'][_0xfb5e('0x4d')](_0x254f70)[_0xfb5e('0x28')](handleEntityNotFound(_0x57a5fb,null))[_0xfb5e('0x28')](respondWithResult(_0x57a5fb,null))[_0xfb5e('0x49')](handleError(_0x57a5fb,null));};exports[_0xfb5e('0x4e')]=function(_0x43eb11,_0x4a77cc,_0x2d2d50){return db['Plugin']['find']({'where':{'id':_0x43eb11[_0xfb5e('0x4b')]['id']},'attributes':[_0xfb5e('0x2d'),_0xfb5e('0x4f')],'raw':!![]})[_0xfb5e('0x28')](handleEntityNotFound(_0x4a77cc,null))[_0xfb5e('0x28')](function(_0x33d37e){if(_0x33d37e){var _0x455f78=path[_0xfb5e('0x50')](config['root'],'server/files/plugins',util[_0xfb5e('0x51')](_0xfb5e('0x52'),path[_0xfb5e('0x53')](_0x33d37e[_0xfb5e('0x4f')])));var _0x25d4be=fs[_0xfb5e('0x54')](_0x455f78);var _0x51e941=archiver(_0xfb5e('0x55'),{'zlib':{'level':0x9}});_0x51e941['on']('warning',function(_0x33e1c6){if(_0x33e1c6['code']===_0xfb5e('0x56')){logger['error'](_0x33e1c6);}else{throw new db[(_0xfb5e('0x57'))][(_0xfb5e('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x51e941['on'](_0xfb5e('0x2c'),function(_0x256445){throw new db[(_0xfb5e('0x57'))][(_0xfb5e('0x58'))](_0xfb5e('0x59'));});_0x51e941[_0xfb5e('0x5a')](_0x25d4be);_0x51e941['glob']('**/*',{'cwd':path[_0xfb5e('0x50')](config[_0xfb5e('0x5b')],_0xfb5e('0x5c'),path[_0xfb5e('0x5d')](_0x33d37e[_0xfb5e('0x4f')])),'ignore':[path[_0xfb5e('0x50')](path[_0xfb5e('0x53')](_0x33d37e[_0xfb5e('0x4f')]),_0xfb5e('0x5e')),path[_0xfb5e('0x50')](path['basename'](_0x33d37e['path']),'attachments/**/*')],'nodir':!![]})['finalize']();_0x25d4be['on'](_0xfb5e('0x5f'),function(){if(!fs[_0xfb5e('0x60')](_0x455f78)){throw new db[(_0xfb5e('0x57'))][(_0xfb5e('0x58'))](_0xfb5e('0x61'));}return _0x4a77cc[_0xfb5e('0x4e')](_0x455f78,util[_0xfb5e('0x51')](_0xfb5e('0x52'),path[_0xfb5e('0x53')](_0x33d37e[_0xfb5e('0x4f')])),function(_0x45c614){if(_0x45c614){throw new db[(_0xfb5e('0x57'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xfb5e('0x62')](_0x455f78);logger[_0xfb5e('0x63')](_0xfb5e('0x64'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x4a77cc,null));};exports[_0xfb5e('0x65')]=function(_0x51f0b6,_0xeedb8,_0x56b69d){var _0x5b31e2=path[_0xfb5e('0x53')](_0x51f0b6[_0xfb5e('0x66')][_0xfb5e('0x67')],path[_0xfb5e('0x68')](_0x51f0b6[_0xfb5e('0x66')][_0xfb5e('0x67')]));var _0x446089=path[_0xfb5e('0x50')](config['root'],_0xfb5e('0x5c'),_0x51f0b6[_0xfb5e('0x66')][_0xfb5e('0x67')]);var _0x3d8162=path['join'](config['root'],_0xfb5e('0x5c'),_0x5b31e2);logger[_0xfb5e('0x63')](_0xfb5e('0x69'),_0x446089);logger['info'](_0xfb5e('0x6a'),_0x3d8162);try{fs[_0xfb5e('0x6b')](_0x446089,parseInt(_0xfb5e('0x6c'),0x8));extract(_0x446089,{'dir':_0x3d8162},function(_0x31de59){if(_0x31de59){logger[_0xfb5e('0x2c')](_0x31de59);handleError(_0x31de59,!![]);};var _0x466aa1=fs[_0xfb5e('0x6d')](_0x3d8162);if(_0x466aa1[_0xfb5e('0x3c')]>0x1){removeReferences(_0x446089,_0x3d8162);logger[_0xfb5e('0x2c')](_0xfb5e('0x6e'));return _0x56b69d(new Error(_0xfb5e('0x6e')));}var _0x2df1d1=fs[_0xfb5e('0x6f')](path['join'](_0x3d8162,_0x466aa1[0x0]));if(_0x2df1d1[_0xfb5e('0x70')]()){removeReferences(_0x446089,_0x3d8162);logger[_0xfb5e('0x2c')](_0xfb5e('0x6e'));return _0x56b69d(new Error(_0xfb5e('0x6e')));}if(_0x2df1d1[_0xfb5e('0x71')]()){var _0x286285=fs[_0xfb5e('0x6d')](path[_0xfb5e('0x50')](_0x3d8162,_0x466aa1[0x0]));if(_0x286285[_0xfb5e('0x3c')]===0x0){removeReferences(_0x446089,_0x3d8162);logger['error']('Invalid\x20plugin\x20structure');return _0x56b69d(new Error(_0xfb5e('0x6e')));}var _0x2036f6=_0x286285[_0xfb5e('0x72')](function(_0x5bcb7c){return _0x5bcb7c==='manifest.json';});if(!_0x2036f6){return _0x56b69d(new Error(_0xfb5e('0x73')));}var _0x3142c4=fs[_0xfb5e('0x74')](path[_0xfb5e('0x50')](_0x3d8162,_0x466aa1[0x0],'manifest.json'));var _0x5f52dc=JSON[_0xfb5e('0x75')](_0x3142c4);if(_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x2d')]){return _0x56b69d(new Error(_0xfb5e('0x77')));}if(_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x33')]){return _0x56b69d(new Error(_0xfb5e('0x78')));}if(_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x79')]){return _0x56b69d(new Error(_0xfb5e('0x7a')));}if(_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x7b')]){return _0x56b69d(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5f52dc[_0xfb5e('0x33')]===_0xfb5e('0x7c')){if(_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x7d')]){return _0x56b69d(new Error(_0xfb5e('0x7e')));}if('undefined'==typeof _0x5f52dc[_0xfb5e('0x7b')]['views'][_0xfb5e('0x7f')]&&_0xfb5e('0x76')==typeof _0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x7d')][_0xfb5e('0x80')]){return _0x56b69d(new Error(_0xfb5e('0x81')));}}else if(_0x5f52dc['type']===_0xfb5e('0x82')){if('undefined'==typeof _0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x83')]){return _0x56b69d(new Error(_0xfb5e('0x84')));}if('undefined'==typeof _0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x85')]){return _0x56b69d(new Error(_0xfb5e('0x86')));}}else{return _0x56b69d(new Error(_0xfb5e('0x87')));}var _0x19d736=_0x5f52dc[_0xfb5e('0x2d')];var _0x173b16=_0x5f52dc['description'];var _0x3027ad=_0x5f52dc[_0xfb5e('0x33')];var _0x4f5668=_0x5f52dc[_0xfb5e('0x88')]?_0x5f52dc[_0xfb5e('0x88')]:_0xfb5e('0x89');var _0x5521d5=_0x5f52dc['icon']?_0x5f52dc['icon']:_0xfb5e('0x8a');var _0x33947b='';var _0x3fab4d='';var _0x2a9804='';var _0x42588e='';var _0x17993f=_0x5f52dc[_0xfb5e('0x79')];if(_0x3027ad==='html'){if(_0xfb5e('0x76')!=typeof _0x5f52dc['parameters'][_0xfb5e('0x7d')]['admin']){var _0x22b06e=_0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x7d')][_0xfb5e('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xfb5e('0x8b')](_0x22b06e)){_0x33947b=path[_0xfb5e('0x50')]('plugins',_0x5b31e2,_0x466aa1[0x0],_0x22b06e);}else{_0x33947b=_0x22b06e;}}else{logger['info'](_0xfb5e('0x8c'));}if(_0xfb5e('0x76')!=typeof _0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x7d')][_0xfb5e('0x80')]){var _0x419110=_0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x7d')][_0xfb5e('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfb5e('0x8b')](_0x419110)){_0x3fab4d=path['join'](_0xfb5e('0x8d'),_0x5b31e2,_0x466aa1[0x0],_0x419110);}else{_0x3fab4d=_0x419110;}}else{logger[_0xfb5e('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3027ad===_0xfb5e('0x82')){_0x2a9804=_0x5f52dc['parameters'][_0xfb5e('0x83')];_0x42588e=_0x5f52dc[_0xfb5e('0x7b')][_0xfb5e('0x85')];if(_0xfb5e('0x76')!=typeof _0x5f52dc['parameters'][_0xfb5e('0x7d')]){if(_0xfb5e('0x76')!=typeof _0x5f52dc[_0xfb5e('0x7b')]['views']['admin']){var _0x22b06e=_0x5f52dc['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xfb5e('0x8b')](_0x22b06e)){_0x33947b=path[_0xfb5e('0x50')]('plugins',_0x5b31e2,_0x466aa1[0x0],_0x22b06e);}else{_0x33947b=_0x22b06e;}}if(_0xfb5e('0x76')!=typeof _0x5f52dc['parameters'][_0xfb5e('0x7d')][_0xfb5e('0x80')]){var _0x419110=_0x5f52dc['parameters'][_0xfb5e('0x7d')][_0xfb5e('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfb5e('0x8b')](_0x419110)){_0x3fab4d=path['join'](_0xfb5e('0x8d'),_0x5b31e2,_0x466aa1[0x0],_0x419110);}else{_0x3fab4d=_0x419110;}}}}var _0x59817a={'name':_0x19d736,'description':_0x173b16,'path':path['join'](_0x5b31e2,_0x466aa1[0x0]),'type':_0x3027ad,'sidebar':_0x4f5668,'icon':_0x5521d5,'adminUrl':_0x33947b,'agentUrl':_0x3fab4d,'scriptName':_0x2a9804,'scriptPath':_0x42588e,'version':_0x17993f};removeReferences(_0x446089,null);return db[_0xfb5e('0x31')][_0xfb5e('0x8e')](_0x59817a)[_0xfb5e('0x28')](function(_0x5abdd6){var _0x3a0bb3={'role':_0x51f0b6[_0xfb5e('0x8f')][_0xfb5e('0x90')],'userProfileId':_0x51f0b6['body'][_0xfb5e('0x91')]};if(!_0x3a0bb3)throw new Error(_0xfb5e('0x92'));if(_0x3a0bb3[_0xfb5e('0x90')]===_0xfb5e('0x93')){var _0x2b963b=_0x5abdd6[_0xfb5e('0x2a')]({'plain':!![]});return db[_0xfb5e('0x94')]['find']({'where':{'name':_0xfb5e('0x2b'),'userProfileId':_0x3a0bb3[_0xfb5e('0x91')]},'raw':!![]})['then'](function(_0x3b8756){if(_0x3b8756&&_0x3b8756[_0xfb5e('0x95')]===0x0){return db[_0xfb5e('0x96')][_0xfb5e('0x8e')]({'name':_0x2b963b['name'],'resourceId':_0x2b963b['id'],'type':_0x3b8756[_0xfb5e('0x2d')],'sectionId':_0x3b8756['id']},{})[_0xfb5e('0x28')](function(){return _0x5abdd6;});}else{return _0x5abdd6;}})[_0xfb5e('0x49')](function(_0x416a7f){logger[_0xfb5e('0x2c')](_0xfb5e('0x97'),_0x416a7f);throw _0x416a7f;});}return _0x5abdd6;})[_0xfb5e('0x28')](respondWithResult(_0xeedb8,null))[_0xfb5e('0x49')](handleError(_0xeedb8,null));}});}catch(_0x20eee7){_0xeedb8[_0xfb5e('0x1e')](0x1f4)[_0xfb5e('0x2e')](_0x20eee7);}};function removeReferences(_0xa8f3e6,_0xba8439){try{if(_0xa8f3e6){fs[_0xfb5e('0x62')](_0xa8f3e6);logger[_0xfb5e('0x63')]('Zip\x20archive\x20removed');}if(_0xba8439){rimraf(_0xba8439,function(){});logger[_0xfb5e('0x63')](_0xfb5e('0x98'));}}catch(_0x18fad3){logger[_0xfb5e('0x2c')](_0x18fad3);}}exports[_0xfb5e('0x27')]=function(_0x223158,_0x2646aa,_0x2747ab){return db[_0xfb5e('0x31')][_0xfb5e('0x4d')]({'where':{'id':_0x223158['params']['id']}})['then'](handleEntityNotFound(_0x2646aa,null))[_0xfb5e('0x28')](saveUpdates(_0x223158[_0xfb5e('0x8f')],null))[_0xfb5e('0x28')](respondWithResult(_0x2646aa,null))[_0xfb5e('0x49')](handleError(_0x2646aa,null));};exports[_0xfb5e('0x99')]=function(_0x36a36d,_0x2bba00,_0x2de917){return db['Plugin']['find']({'where':{'id':_0x36a36d[_0xfb5e('0x4b')]['id']}})['then'](function(_0x116f15){if(_0x116f15){return _0x116f15[_0xfb5e('0x29')]();}})[_0xfb5e('0x28')](function(_0x34c9b3){rimraf(path[_0xfb5e('0x50')](config[_0xfb5e('0x5b')],_0xfb5e('0x5c'),path[_0xfb5e('0x5d')](_0x34c9b3[_0xfb5e('0x4f')])),function(){});return _0x34c9b3;})['then'](handleEntityNotFound(_0x2bba00,null))[_0xfb5e('0x28')](respondWithStatusCode(_0x2bba00,null))[_0xfb5e('0x49')](handleError(_0x2bba00,null));};exports['webhookGet']=function(_0x2a0a68,_0x135c84,_0x2a4588){return BPromise[_0xfb5e('0x9a')]()[_0xfb5e('0x28')](function(){if(!_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2a0a68[_0xfb5e('0x36')]['port']){throw new Error(_0xfb5e('0x9b'));}var _0x98f9fb=_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x9c')]?_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x9c')]+':'+_0x2a0a68[_0xfb5e('0x36')]['port']:_0xfb5e('0x9d')+_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x9e')];var _0x16ceec=_0x2a0a68[_0xfb5e('0x36')]['json']?_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x25')]:!![];var _0x39d81d=_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x9f')]?_0x2a0a68['query'][_0xfb5e('0x9f')]:null;var _0xdb46a2={'method':_0x2a0a68[_0xfb5e('0xa0')],'uri':util[_0xfb5e('0x51')](_0xfb5e('0xa1'),_0x98f9fb,_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x4f')]),'json':_0x16ceec,'resolveWithFullResponse':!![],'encoding':_0x39d81d,'qs':_0x2a0a68[_0xfb5e('0x36')]};if(_0x2a0a68[_0xfb5e('0xa2')]){_0xdb46a2[_0xfb5e('0xa2')]=_0x2a0a68[_0xfb5e('0xa2')];if(_0xdb46a2[_0xfb5e('0xa2')][_0xfb5e('0xa3')]){delete _0xdb46a2[_0xfb5e('0xa2')][_0xfb5e('0xa3')];}}if(_0xdb46a2['headers'][_0xfb5e('0xa4')]){delete _0xdb46a2[_0xfb5e('0xa2')][_0xfb5e('0xa4')];}return rp(_0xdb46a2);})[_0xfb5e('0x28')](function(_0x328f72){if(_0x328f72){_0x135c84[_0xfb5e('0x23')](_0x328f72[_0xfb5e('0xa2')]);logger[_0xfb5e('0x63')](_0x328f72[_0xfb5e('0x8f')]);if(_['endsWith'](_0x2a0a68[_0xfb5e('0x36')][_0xfb5e('0x4f')],'download')&&_0x328f72['statusCode']==0x1f4){return _0x135c84['sendStatus'](_0x328f72[_0xfb5e('0xa5')]);}else{return _0x135c84[_0xfb5e('0x1e')](_0x328f72[_0xfb5e('0xa5')])[_0xfb5e('0x2e')](_0x328f72['body']);}}else{return _0x135c84[_0xfb5e('0x1d')](0xc8);}})[_0xfb5e('0x49')](handleError(_0x135c84,null));};exports[_0xfb5e('0xa6')]=function(_0xa280c7,_0x3203eb,_0x11b949){return BPromise[_0xfb5e('0x9a')]()[_0xfb5e('0x28')](function(){if(!_0xa280c7[_0xfb5e('0x36')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x9e')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x24e43b=_0xa280c7['query']['hostname']?_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x9c')]+':'+_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x9e')]:'http://localhost:'+_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x9e')];var _0x27066e=_0xa280c7['query'][_0xfb5e('0x25')]?_0xa280c7[_0xfb5e('0x36')]['json']:!![];var _0x3031f1=_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x9f')]?_0xa280c7['query'][_0xfb5e('0x9f')]:null;var _0x2fe271={'method':_0xa280c7[_0xfb5e('0xa0')],'uri':util[_0xfb5e('0x51')]('%s%s',_0x24e43b,_0xa280c7[_0xfb5e('0x36')][_0xfb5e('0x4f')]),'json':_0x27066e,'resolveWithFullResponse':!![],'encoding':_0x3031f1,'body':_0xa280c7['body']};if(_0xa280c7['headers']){_0x2fe271['headers']=_0xa280c7[_0xfb5e('0xa2')];if(_0x2fe271[_0xfb5e('0xa2')]['content-length']){delete _0x2fe271[_0xfb5e('0xa2')][_0xfb5e('0xa3')];}}if(_0x2fe271['headers'][_0xfb5e('0xa4')]){delete _0x2fe271['headers'][_0xfb5e('0xa4')];}return rp(_0x2fe271);})[_0xfb5e('0x28')](function(_0x5aa122){if(_0x5aa122){_0x3203eb[_0xfb5e('0x23')](_0x5aa122[_0xfb5e('0xa2')]);logger[_0xfb5e('0x63')](_0x5aa122[_0xfb5e('0x8f')]);return _0x3203eb[_0xfb5e('0x1e')](_0x5aa122[_0xfb5e('0xa5')])[_0xfb5e('0x2e')](_0x5aa122[_0xfb5e('0x8f')]);}else{return _0x3203eb[_0xfb5e('0x1d')](0xc8);}})[_0xfb5e('0x49')](handleError(_0x3203eb,null));}; \ No newline at end of file +var _0x9aac=['method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','then','Plugins','UserProfileResource','error','name','map','Plugin','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','type','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','download','join','server/files/plugins','%s.zip','basename','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','some','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','send','Zip\x20archive\x20removed','update','delete','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding'];(function(_0x47e0e6,_0x1cbadd){var _0x58ee73=function(_0x4a5d1d){while(--_0x4a5d1d){_0x47e0e6['push'](_0x47e0e6['shift']());}};_0x58ee73(++_0x1cbadd);}(_0x9aac,0x1ed));var _0xc9aa=function(_0xe15f82,_0x4b81de){_0xe15f82=_0xe15f82-0x0;var _0x474b1f=_0x9aac[_0xe15f82];return _0x474b1f;};'use strict';var emlformat=require(_0xc9aa('0x0'));var rimraf=require(_0xc9aa('0x1'));var zipdir=require(_0xc9aa('0x2'));var jsonpatch=require(_0xc9aa('0x3'));var rp=require(_0xc9aa('0x4'));var moment=require(_0xc9aa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc9aa('0x6'));var util=require(_0xc9aa('0x7'));var path=require(_0xc9aa('0x8'));var sox=require(_0xc9aa('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc9aa('0xa'));var crypto=require(_0xc9aa('0xb'));var jsforce=require(_0xc9aa('0xc'));var deskjs=require(_0xc9aa('0xd'));var toCsv=require(_0xc9aa('0xe'));var querystring=require(_0xc9aa('0xf'));var Papa=require('papaparse');var extract=require(_0xc9aa('0x10'));var rimraf=require('rimraf');var archiver=require(_0xc9aa('0x11'));var Redis=require(_0xc9aa('0x12'));var authService=require(_0xc9aa('0x13'));var qs=require(_0xc9aa('0x14'));var as=require(_0xc9aa('0x15'));var hardwareService=require(_0xc9aa('0x16'));var logger=require(_0xc9aa('0x17'))(_0xc9aa('0x18'));var utils=require(_0xc9aa('0x19'));var config=require(_0xc9aa('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9aa('0x1b'))['db'];config['redis']=_['defaults'](config[_0xc9aa('0x1c')],{'host':_0xc9aa('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9aa('0x1c')]));require(_0xc9aa('0x1e'))['register'](socket);function respondWithStatusCode(_0x248383,_0x5eeaa6){_0x5eeaa6=_0x5eeaa6||0xcc;return function(_0xdbbd5e){if(_0xdbbd5e){return _0x248383[_0xc9aa('0x1f')](_0x5eeaa6);}return _0x248383['status'](_0x5eeaa6)[_0xc9aa('0x20')]();};}function respondWithResult(_0x17958f,_0x3fb04d){_0x3fb04d=_0x3fb04d||0xc8;return function(_0x7e6d47){if(_0x7e6d47){return _0x17958f[_0xc9aa('0x21')](_0x3fb04d)[_0xc9aa('0x22')](_0x7e6d47);}};}function respondWithFilteredResult(_0x32ffec,_0x1d5b9c){return function(_0x415083){if(_0x415083){var _0x406d78=typeof _0x1d5b9c[_0xc9aa('0x23')]===_0xc9aa('0x24')&&typeof _0x1d5b9c[_0xc9aa('0x25')]==='undefined';var _0x3ad016=_0x415083[_0xc9aa('0x26')];var _0x2bc344=_0x406d78?0x0:_0x1d5b9c[_0xc9aa('0x23')];var _0x2d37e2=_0x406d78?_0x415083['count']:_0x1d5b9c[_0xc9aa('0x23')]+_0x1d5b9c['limit'];var _0x5df8bd;if(_0x2d37e2>=_0x3ad016){_0x2d37e2=_0x3ad016;_0x5df8bd=0xc8;}else{_0x5df8bd=0xce;}_0x32ffec['status'](_0x5df8bd);return _0x32ffec[_0xc9aa('0x27')]('Content-Range',_0x2bc344+'-'+_0x2d37e2+'/'+_0x3ad016)[_0xc9aa('0x22')](_0x415083);}return null;};}function patchUpdates(_0x134055){return function(_0x2ef1aa){try{jsonpatch['apply'](_0x2ef1aa,_0x134055,!![]);}catch(_0x208384){return BPromise['reject'](_0x208384);}return _0x2ef1aa['save']();};}function saveUpdates(_0x19159c,_0x7417de){return function(_0x2d5f16){if(_0x2d5f16){return _0x2d5f16['update'](_0x19159c)['then'](function(_0x44163a){return _0x44163a;});}return null;};}function removeEntity(_0x299246,_0x368eba){return function(_0x25a384){if(_0x25a384){return _0x25a384['destroy']()[_0xc9aa('0x28')](function(){var _0x3cf497=_0x25a384['get']({'plain':!![]});var _0x51d058=_0xc9aa('0x29');return db[_0xc9aa('0x2a')]['destroy']({'where':{'type':_0x51d058,'resourceId':_0x3cf497['id']}})[_0xc9aa('0x28')](function(){return _0x25a384;});})[_0xc9aa('0x28')](function(){_0x299246[_0xc9aa('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10d954,_0x111741){return function(_0x288537){if(!_0x288537){_0x10d954[_0xc9aa('0x1f')](0x194);}return _0x288537;};}function handleError(_0x5ce5bd,_0x282252){_0x282252=_0x282252||0x1f4;return function(_0x5bd265){logger[_0xc9aa('0x2b')](_0x5bd265['stack']);if(_0x5bd265['name']){delete _0x5bd265[_0xc9aa('0x2c')];}_0x5ce5bd[_0xc9aa('0x21')](_0x282252)['send'](_0x5bd265);};}exports['index']=function(_0x303715,_0x44a11a){var _0x5f0581={},_0x5cdda5={},_0x12d4b9={'count':0x0,'rows':[]};var _0x11b2c3=_[_0xc9aa('0x2d')](db[_0xc9aa('0x2e')]['rawAttributes'],function(_0x515aca){return{'name':_0x515aca['fieldName'],'type':_0x515aca['type'][_0xc9aa('0x2f')]};});_0x5cdda5[_0xc9aa('0x30')]=_[_0xc9aa('0x2d')](_0x11b2c3,_0xc9aa('0x2c'));_0x5cdda5[_0xc9aa('0x31')]=_[_0xc9aa('0x32')](_0x303715[_0xc9aa('0x31')]);_0x5cdda5['filters']=_[_0xc9aa('0x33')](_0x5cdda5[_0xc9aa('0x30')],_0x5cdda5[_0xc9aa('0x31')]);_0x5f0581[_0xc9aa('0x34')]=_[_0xc9aa('0x33')](_0x5cdda5[_0xc9aa('0x30')],qs[_0xc9aa('0x35')](_0x303715[_0xc9aa('0x31')][_0xc9aa('0x35')]));_0x5f0581[_0xc9aa('0x34')]=_0x5f0581[_0xc9aa('0x34')][_0xc9aa('0x36')]?_0x5f0581[_0xc9aa('0x34')]:_0x5cdda5[_0xc9aa('0x30')];if(!_0x303715[_0xc9aa('0x31')][_0xc9aa('0x37')](_0xc9aa('0x38'))){_0x5f0581[_0xc9aa('0x25')]=qs['limit'](_0x303715[_0xc9aa('0x31')][_0xc9aa('0x25')]);_0x5f0581[_0xc9aa('0x23')]=qs['offset'](_0x303715['query']['offset']);}_0x5f0581['order']=qs[_0xc9aa('0x39')](_0x303715[_0xc9aa('0x31')][_0xc9aa('0x39')]);_0x5f0581['where']=qs[_0xc9aa('0x3a')](_['pick'](_0x303715[_0xc9aa('0x31')],_0x5cdda5['filters']),_0x11b2c3);if(_0x303715[_0xc9aa('0x31')][_0xc9aa('0x3b')]){_0x5f0581['where']=_[_0xc9aa('0x3c')](_0x5f0581[_0xc9aa('0x3d')],{'$or':_[_0xc9aa('0x2d')](_0x11b2c3,function(_0x40865e){if(_0x40865e[_0xc9aa('0x3e')]!=='VIRTUAL'){var _0x4c90d0={};_0x4c90d0[_0x40865e[_0xc9aa('0x2c')]]={'$like':'%'+_0x303715['query'][_0xc9aa('0x3b')]+'%'};return _0x4c90d0;}})});}_0x5f0581=_[_0xc9aa('0x3c')]({},_0x5f0581,_0x303715[_0xc9aa('0x3f')]);var _0xf214ee={'where':_0x5f0581[_0xc9aa('0x3d')]};return db[_0xc9aa('0x2e')][_0xc9aa('0x26')](_0xf214ee)[_0xc9aa('0x28')](function(_0x5b9608){_0x12d4b9[_0xc9aa('0x26')]=_0x5b9608;if(_0x303715[_0xc9aa('0x31')][_0xc9aa('0x40')]){_0x5f0581['include']=[{'all':!![]}];}return db[_0xc9aa('0x2e')][_0xc9aa('0x41')](_0x5f0581);})[_0xc9aa('0x28')](function(_0x73f622){_0x12d4b9[_0xc9aa('0x42')]=_0x73f622;return _0x12d4b9;})['then'](respondWithFilteredResult(_0x44a11a,_0x5f0581))[_0xc9aa('0x43')](handleError(_0x44a11a,null));};exports[_0xc9aa('0x44')]=function(_0xe3e469,_0x5ea99e){var _0x1e91ad={'raw':!![],'where':{'id':_0xe3e469[_0xc9aa('0x45')]['id']}},_0x15e53c={};_0x15e53c[_0xc9aa('0x30')]=_[_0xc9aa('0x32')](db[_0xc9aa('0x2e')][_0xc9aa('0x46')]);_0x15e53c[_0xc9aa('0x31')]=_[_0xc9aa('0x32')](_0xe3e469[_0xc9aa('0x31')]);_0x15e53c[_0xc9aa('0x3a')]=_[_0xc9aa('0x33')](_0x15e53c[_0xc9aa('0x30')],_0x15e53c[_0xc9aa('0x31')]);_0x1e91ad[_0xc9aa('0x34')]=_[_0xc9aa('0x33')](_0x15e53c[_0xc9aa('0x30')],qs['fields'](_0xe3e469[_0xc9aa('0x31')][_0xc9aa('0x35')]));_0x1e91ad['attributes']=_0x1e91ad[_0xc9aa('0x34')][_0xc9aa('0x36')]?_0x1e91ad['attributes']:_0x15e53c[_0xc9aa('0x30')];if(_0xe3e469['query'][_0xc9aa('0x40')]){_0x1e91ad[_0xc9aa('0x47')]=[{'all':!![]}];}_0x1e91ad=_[_0xc9aa('0x3c')]({},_0x1e91ad,_0xe3e469[_0xc9aa('0x3f')]);return db[_0xc9aa('0x2e')][_0xc9aa('0x48')](_0x1e91ad)[_0xc9aa('0x28')](handleEntityNotFound(_0x5ea99e,null))[_0xc9aa('0x28')](respondWithResult(_0x5ea99e,null))[_0xc9aa('0x43')](handleError(_0x5ea99e,null));};exports[_0xc9aa('0x49')]=function(_0x563961,_0x3ca4d2,_0x368007){return db[_0xc9aa('0x2e')][_0xc9aa('0x48')]({'where':{'id':_0x563961[_0xc9aa('0x45')]['id']},'attributes':[_0xc9aa('0x2c'),_0xc9aa('0x8')],'raw':!![]})[_0xc9aa('0x28')](handleEntityNotFound(_0x3ca4d2,null))[_0xc9aa('0x28')](function(_0x241f9d){if(_0x241f9d){var _0x1bb63a=path[_0xc9aa('0x4a')](config['root'],_0xc9aa('0x4b'),util['format'](_0xc9aa('0x4c'),path[_0xc9aa('0x4d')](_0x241f9d[_0xc9aa('0x8')])));var _0x1898b2=fs['createWriteStream'](_0x1bb63a);var _0x24deda=archiver(_0xc9aa('0x4e'),{'zlib':{'level':0x9}});_0x24deda['on']('warning',function(_0x502c8b){if(_0x502c8b[_0xc9aa('0x4f')]===_0xc9aa('0x50')){logger['error'](_0x502c8b);}else{throw new db[(_0xc9aa('0x51'))][(_0xc9aa('0x52'))](_0xc9aa('0x53'));}});_0x24deda['on']('error',function(_0x43600b){throw new db[(_0xc9aa('0x51'))][(_0xc9aa('0x52'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x24deda[_0xc9aa('0x54')](_0x1898b2);_0x24deda[_0xc9aa('0x55')](_0xc9aa('0x56'),{'cwd':path[_0xc9aa('0x4a')](config[_0xc9aa('0x57')],_0xc9aa('0x4b'),path[_0xc9aa('0x58')](_0x241f9d[_0xc9aa('0x8')])),'ignore':[path['join'](path[_0xc9aa('0x4d')](_0x241f9d[_0xc9aa('0x8')]),'node_modules/**/*'),path[_0xc9aa('0x4a')](path[_0xc9aa('0x4d')](_0x241f9d['path']),_0xc9aa('0x59'))],'nodir':!![]})[_0xc9aa('0x5a')]();_0x1898b2['on'](_0xc9aa('0x5b'),function(){if(!fs[_0xc9aa('0x5c')](_0x1bb63a)){throw new db['Sequelize'][(_0xc9aa('0x52'))](_0xc9aa('0x5d'));}return _0x3ca4d2[_0xc9aa('0x49')](_0x1bb63a,util[_0xc9aa('0x5e')](_0xc9aa('0x4c'),path['basename'](_0x241f9d['path'])),function(_0x84187e){if(_0x84187e){throw new db[(_0xc9aa('0x51'))][(_0xc9aa('0x52'))](_0xc9aa('0x5f'));}fs[_0xc9aa('0x60')](_0x1bb63a);logger[_0xc9aa('0x61')](_0xc9aa('0x62'));logger[_0xc9aa('0x61')](_0xc9aa('0x63'));});});}return null;})[_0xc9aa('0x43')](handleError(_0x3ca4d2,null));};exports[_0xc9aa('0x64')]=function(_0x4a8eca,_0x5c6781,_0x5a82b0){var _0x42921d=path['basename'](_0x4a8eca[_0xc9aa('0x65')][_0xc9aa('0x66')],path[_0xc9aa('0x67')](_0x4a8eca[_0xc9aa('0x65')][_0xc9aa('0x66')]));var _0x27be39=path[_0xc9aa('0x4a')](config[_0xc9aa('0x57')],'server/files/plugins',_0x4a8eca[_0xc9aa('0x65')]['filename']);var _0x33f29d=path['join'](config['root'],_0xc9aa('0x4b'),_0x42921d);logger[_0xc9aa('0x61')](_0xc9aa('0x68'),_0x27be39);logger[_0xc9aa('0x61')](_0xc9aa('0x69'),_0x33f29d);try{fs[_0xc9aa('0x6a')](_0x27be39,parseInt(_0xc9aa('0x6b'),0x8));extract(_0x27be39,{'dir':_0x33f29d},function(_0x4a3a8a){if(_0x4a3a8a){logger[_0xc9aa('0x2b')](_0x4a3a8a);handleError(_0x4a3a8a,!![]);};var _0x399c40=fs['readdirSync'](_0x33f29d);if(_0x399c40[_0xc9aa('0x36')]>0x1){removeReferences(_0x27be39,_0x33f29d);logger[_0xc9aa('0x2b')](_0xc9aa('0x6c'));return _0x5a82b0(new Error(_0xc9aa('0x6c')));}var _0x275f93=fs['lstatSync'](path[_0xc9aa('0x4a')](_0x33f29d,_0x399c40[0x0]));if(_0x275f93[_0xc9aa('0x6d')]()){removeReferences(_0x27be39,_0x33f29d);logger[_0xc9aa('0x2b')](_0xc9aa('0x6c'));return _0x5a82b0(new Error('Invalid\x20plugin\x20structure'));}if(_0x275f93[_0xc9aa('0x6e')]()){var _0x58ea77=fs[_0xc9aa('0x6f')](path[_0xc9aa('0x4a')](_0x33f29d,_0x399c40[0x0]));if(_0x58ea77['length']===0x0){removeReferences(_0x27be39,_0x33f29d);logger[_0xc9aa('0x2b')]('Invalid\x20plugin\x20structure');return _0x5a82b0(new Error('Invalid\x20plugin\x20structure'));}var _0x3d2bc4=_0x58ea77[_0xc9aa('0x70')](function(_0x3f73a6){return _0x3f73a6==='manifest.json';});if(!_0x3d2bc4){return _0x5a82b0(new Error('Plugin\x20manifest\x20missing'));}var _0x1f436f=fs['readFileSync'](path['join'](_0x33f29d,_0x399c40[0x0],_0xc9aa('0x71')));var _0x159033=JSON[_0xc9aa('0x72')](_0x1f436f);if(_0xc9aa('0x24')==typeof _0x159033[_0xc9aa('0x2c')]){return _0x5a82b0(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xc9aa('0x24')==typeof _0x159033[_0xc9aa('0x3e')]){return _0x5a82b0(new Error(_0xc9aa('0x73')));}if(_0xc9aa('0x24')==typeof _0x159033[_0xc9aa('0x74')]){return _0x5a82b0(new Error(_0xc9aa('0x75')));}if(_0xc9aa('0x24')==typeof _0x159033[_0xc9aa('0x76')]){return _0x5a82b0(new Error(_0xc9aa('0x77')));}if(_0x159033[_0xc9aa('0x3e')]===_0xc9aa('0x78')){if(_0xc9aa('0x24')==typeof _0x159033['parameters']['views']){return _0x5a82b0(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xc9aa('0x24')==typeof _0x159033['parameters'][_0xc9aa('0x79')][_0xc9aa('0x7a')]&&_0xc9aa('0x24')==typeof _0x159033[_0xc9aa('0x76')]['views'][_0xc9aa('0x7b')]){return _0x5a82b0(new Error(_0xc9aa('0x7c')));}}else if(_0x159033[_0xc9aa('0x3e')]===_0xc9aa('0x7d')){if('undefined'==typeof _0x159033['parameters'][_0xc9aa('0x7e')]){return _0x5a82b0(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x159033[_0xc9aa('0x76')][_0xc9aa('0x7f')]){return _0x5a82b0(new Error(_0xc9aa('0x80')));}}else{return _0x5a82b0(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x579915=_0x159033[_0xc9aa('0x2c')];var _0x18021c=_0x159033[_0xc9aa('0x81')];var _0x24cc46=_0x159033[_0xc9aa('0x3e')];var _0x32a808=_0x159033[_0xc9aa('0x82')]?_0x159033[_0xc9aa('0x82')]:_0xc9aa('0x83');var _0x7c6ca7=_0x159033[_0xc9aa('0x84')]?_0x159033[_0xc9aa('0x84')]:'icon-apps';var _0x4b789e='';var _0x5ebe38='';var _0x4c79bc='';var _0x36d624='';var _0x1c12ce=_0x159033[_0xc9aa('0x74')];if(_0x24cc46===_0xc9aa('0x78')){if(_0xc9aa('0x24')!=typeof _0x159033[_0xc9aa('0x76')][_0xc9aa('0x79')]['admin']){var _0x15df36=_0x159033[_0xc9aa('0x76')][_0xc9aa('0x79')][_0xc9aa('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xc9aa('0x85')](_0x15df36)){_0x4b789e=path[_0xc9aa('0x4a')](_0xc9aa('0x86'),_0x42921d,_0x399c40[0x0],_0x15df36);}else{_0x4b789e=_0x15df36;}}else{logger[_0xc9aa('0x61')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xc9aa('0x24')!=typeof _0x159033[_0xc9aa('0x76')][_0xc9aa('0x79')][_0xc9aa('0x7b')]){var _0x311d52=_0x159033[_0xc9aa('0x76')][_0xc9aa('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x311d52)){_0x5ebe38=path[_0xc9aa('0x4a')]('plugins',_0x42921d,_0x399c40[0x0],_0x311d52);}else{_0x5ebe38=_0x311d52;}}else{logger[_0xc9aa('0x61')](_0xc9aa('0x87'));}}else if(_0x24cc46===_0xc9aa('0x7d')){_0x4c79bc=_0x159033[_0xc9aa('0x76')][_0xc9aa('0x7e')];_0x36d624=_0x159033[_0xc9aa('0x76')][_0xc9aa('0x7f')];if(_0xc9aa('0x24')!=typeof _0x159033['parameters']['views']){if('undefined'!=typeof _0x159033[_0xc9aa('0x76')][_0xc9aa('0x79')][_0xc9aa('0x7a')]){var _0x15df36=_0x159033[_0xc9aa('0x76')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x15df36)){_0x4b789e=path['join'](_0xc9aa('0x86'),_0x42921d,_0x399c40[0x0],_0x15df36);}else{_0x4b789e=_0x15df36;}}if(_0xc9aa('0x24')!=typeof _0x159033['parameters'][_0xc9aa('0x79')][_0xc9aa('0x7b')]){var _0x311d52=_0x159033['parameters'][_0xc9aa('0x79')][_0xc9aa('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xc9aa('0x85')](_0x311d52)){_0x5ebe38=path['join']('plugins',_0x42921d,_0x399c40[0x0],_0x311d52);}else{_0x5ebe38=_0x311d52;}}}}var _0x9afed5={'name':_0x579915,'description':_0x18021c,'path':path[_0xc9aa('0x4a')](_0x42921d,_0x399c40[0x0]),'type':_0x24cc46,'sidebar':_0x32a808,'icon':_0x7c6ca7,'adminUrl':_0x4b789e,'agentUrl':_0x5ebe38,'scriptName':_0x4c79bc,'scriptPath':_0x36d624,'version':_0x1c12ce};removeReferences(_0x27be39,null);return db['Plugin']['create'](_0x9afed5)[_0xc9aa('0x28')](function(_0x42706e){var _0x31ac5c={'role':_0x4a8eca[_0xc9aa('0x88')][_0xc9aa('0x89')],'userProfileId':_0x4a8eca['body'][_0xc9aa('0x8a')]};if(!_0x31ac5c)throw new Error(_0xc9aa('0x8b'));if(_0x31ac5c[_0xc9aa('0x89')]==='user'){var _0x369c94=_0x42706e[_0xc9aa('0x8c')]({'plain':!![]});return db[_0xc9aa('0x8d')][_0xc9aa('0x48')]({'where':{'name':_0xc9aa('0x29'),'userProfileId':_0x31ac5c[_0xc9aa('0x8a')]},'raw':!![]})[_0xc9aa('0x28')](function(_0x247ab1){if(_0x247ab1&&_0x247ab1['autoAssociation']===0x0){return db[_0xc9aa('0x2a')]['create']({'name':_0x369c94[_0xc9aa('0x2c')],'resourceId':_0x369c94['id'],'type':_0x247ab1[_0xc9aa('0x2c')],'sectionId':_0x247ab1['id']},{})[_0xc9aa('0x28')](function(){return _0x42706e;});}else{return _0x42706e;}})[_0xc9aa('0x43')](function(_0x9bc445){logger[_0xc9aa('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9bc445);throw _0x9bc445;});}return _0x42706e;})[_0xc9aa('0x28')](respondWithResult(_0x5c6781,null))[_0xc9aa('0x43')](handleError(_0x5c6781,null));}});}catch(_0xdf7de4){_0x5c6781['status'](0x1f4)[_0xc9aa('0x8e')](_0xdf7de4);}};function removeReferences(_0x336f4b,_0x181248){try{if(_0x336f4b){fs[_0xc9aa('0x60')](_0x336f4b);logger[_0xc9aa('0x61')](_0xc9aa('0x8f'));}if(_0x181248){rimraf(_0x181248,function(){});logger[_0xc9aa('0x61')]('Extracted\x20folder\x20removed');}}catch(_0x112add){logger[_0xc9aa('0x2b')](_0x112add);}}exports[_0xc9aa('0x90')]=function(_0x2281bb,_0x3f3972,_0xd85d9){return db['Plugin'][_0xc9aa('0x48')]({'where':{'id':_0x2281bb['params']['id']}})[_0xc9aa('0x28')](handleEntityNotFound(_0x3f3972,null))[_0xc9aa('0x28')](saveUpdates(_0x2281bb['body'],null))[_0xc9aa('0x28')](respondWithResult(_0x3f3972,null))[_0xc9aa('0x43')](handleError(_0x3f3972,null));};exports[_0xc9aa('0x91')]=function(_0x47cb18,_0x1606f0,_0x52784c){return db[_0xc9aa('0x2e')][_0xc9aa('0x48')]({'where':{'id':_0x47cb18[_0xc9aa('0x45')]['id']}})['then'](function(_0x5d02a6){if(_0x5d02a6){return _0x5d02a6[_0xc9aa('0x92')]();}})[_0xc9aa('0x28')](function(_0x36da54){rimraf(path[_0xc9aa('0x4a')](config[_0xc9aa('0x57')],_0xc9aa('0x4b'),path['dirname'](_0x36da54[_0xc9aa('0x8')])),function(){});return _0x36da54;})[_0xc9aa('0x28')](handleEntityNotFound(_0x1606f0,null))[_0xc9aa('0x28')](respondWithStatusCode(_0x1606f0,null))[_0xc9aa('0x43')](handleError(_0x1606f0,null));};exports[_0xc9aa('0x93')]=function(_0x3b760b,_0x1c7e08,_0x545fdd){return BPromise[_0xc9aa('0x94')]()[_0xc9aa('0x28')](function(){if(!_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x8')]){throw new Error(_0xc9aa('0x95'));}if(!_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x96')]){throw new Error(_0xc9aa('0x97'));}var _0x41a0a8=_0x3b760b['query'][_0xc9aa('0x98')]?_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x98')]+':'+_0x3b760b[_0xc9aa('0x31')]['port']:_0xc9aa('0x99')+_0x3b760b['query'][_0xc9aa('0x96')];var _0x2ec919=_0x3b760b['query']['json']?_0x3b760b[_0xc9aa('0x31')]['json']:!![];var _0x1d4c07=_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x9a')]?_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x9a')]:null;var _0xb3a94d={'method':_0x3b760b[_0xc9aa('0x9b')],'uri':util[_0xc9aa('0x5e')](_0xc9aa('0x9c'),_0x41a0a8,_0x3b760b['query'][_0xc9aa('0x8')]),'json':_0x2ec919,'resolveWithFullResponse':!![],'encoding':_0x1d4c07,'qs':_0x3b760b[_0xc9aa('0x31')]};if(_0x3b760b[_0xc9aa('0x9d')]){_0xb3a94d[_0xc9aa('0x9d')]=_0x3b760b[_0xc9aa('0x9d')];if(_0xb3a94d[_0xc9aa('0x9d')]['content-length']){delete _0xb3a94d[_0xc9aa('0x9d')][_0xc9aa('0x9e')];}}if(_0xb3a94d[_0xc9aa('0x9d')]['content-type']){delete _0xb3a94d[_0xc9aa('0x9d')][_0xc9aa('0x9f')];}return rp(_0xb3a94d);})[_0xc9aa('0x28')](function(_0x1a771e){if(_0x1a771e){_0x1c7e08['set'](_0x1a771e[_0xc9aa('0x9d')]);logger[_0xc9aa('0x61')](_0x1a771e['body']);if(_[_0xc9aa('0xa0')](_0x3b760b[_0xc9aa('0x31')][_0xc9aa('0x8')],_0xc9aa('0x49'))&&_0x1a771e[_0xc9aa('0xa1')]==0x1f4){return _0x1c7e08['sendStatus'](_0x1a771e['statusCode']);}else{return _0x1c7e08[_0xc9aa('0x21')](_0x1a771e[_0xc9aa('0xa1')])[_0xc9aa('0x8e')](_0x1a771e[_0xc9aa('0x88')]);}}else{return _0x1c7e08[_0xc9aa('0x1f')](0xc8);}})['catch'](handleError(_0x1c7e08,null));};exports['webhookPost']=function(_0x2cd690,_0x48a886,_0x3e250f){return BPromise[_0xc9aa('0x94')]()[_0xc9aa('0x28')](function(){if(!_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x96')]){throw new Error(_0xc9aa('0x97'));}var _0x49c991=_0x2cd690['query']['hostname']?_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x98')]+':'+_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x96')]:_0xc9aa('0x99')+_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x96')];var _0xaf486f=_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x22')]?_0x2cd690[_0xc9aa('0x31')]['json']:!![];var _0xf124d4=_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x9a')]?_0x2cd690[_0xc9aa('0x31')][_0xc9aa('0x9a')]:null;var _0x457938={'method':_0x2cd690['method'],'uri':util['format']('%s%s',_0x49c991,_0x2cd690['query'][_0xc9aa('0x8')]),'json':_0xaf486f,'resolveWithFullResponse':!![],'encoding':_0xf124d4,'body':_0x2cd690[_0xc9aa('0x88')]};if(_0x2cd690['headers']){_0x457938['headers']=_0x2cd690[_0xc9aa('0x9d')];if(_0x457938[_0xc9aa('0x9d')][_0xc9aa('0x9e')]){delete _0x457938[_0xc9aa('0x9d')][_0xc9aa('0x9e')];}}if(_0x457938[_0xc9aa('0x9d')][_0xc9aa('0x9f')]){delete _0x457938[_0xc9aa('0x9d')][_0xc9aa('0x9f')];}return rp(_0x457938);})[_0xc9aa('0x28')](function(_0xa94f44){if(_0xa94f44){_0x48a886['set'](_0xa94f44[_0xc9aa('0x9d')]);logger['info'](_0xa94f44[_0xc9aa('0x88')]);return _0x48a886['status'](_0xa94f44['statusCode'])[_0xc9aa('0x8e')](_0xa94f44[_0xc9aa('0x88')]);}else{return _0x48a886[_0xc9aa('0x1f')](0xc8);}})['catch'](handleError(_0x48a886,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0c03df7..d57a3d4 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 _0x8506=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0xf38c69,_0x3aca65){var _0x3b164a=function(_0x24c898){while(--_0x24c898){_0xf38c69['push'](_0xf38c69['shift']());}};_0x3b164a(++_0x3aca65);}(_0x8506,0xe8));var _0x6850=function(_0x39f032,_0x2af10d){_0x39f032=_0x39f032-0x0;var _0x3e583d=_0x8506[_0x39f032];return _0x3e583d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x6850('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x6850('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6850('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2e0f9d){return function(_0x204a8a,_0x321eff,_0x5e9ff2){PluginEvents[_0x6850('0x3')](_0x2e0f9d+':'+_0x204a8a['id'],_0x204a8a);PluginEvents[_0x6850('0x3')](_0x2e0f9d,_0x204a8a);_0x5e9ff2(null);};}for(var e in events){if(events[_0x6850('0x4')](e)){var event=events[e];Plugin[_0x6850('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','update','remove'];(function(_0x46d208,_0x3654d0){var _0x3bc42f=function(_0x4722bf){while(--_0x4722bf){_0x46d208['push'](_0x46d208['shift']());}};_0x3bc42f(++_0x3654d0);}(_0xd634,0xf4));var _0x4d63=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xd634[_0x48d6a3];return _0x38bfa0;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){PluginEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);PluginEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];Plugin[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 51d7e8b..1091613 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 _0xefd8=['request-promise','path','rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x333965,_0x16e0f5){var _0x50290e=function(_0x1e7c60){while(--_0x1e7c60){_0x333965['push'](_0x333965['shift']());}};_0x50290e(++_0x16e0f5);}(_0xefd8,0x104));var _0x8efd=function(_0x3f0d65,_0x182a58){_0x3f0d65=_0x3f0d65-0x0;var _0x3b9032=_0xefd8[_0x3f0d65];return _0x3b9032;};'use strict';var _=require(_0x8efd('0x0'));var util=require(_0x8efd('0x1'));var logger=require(_0x8efd('0x2'))(_0x8efd('0x3'));var moment=require(_0x8efd('0x4'));var BPromise=require(_0x8efd('0x5'));var rp=require(_0x8efd('0x6'));var fs=require('fs');var path=require(_0x8efd('0x7'));var rimraf=require(_0x8efd('0x8'));var config=require('../../config/environment');var attributes=require(_0x8efd('0x9'));module[_0x8efd('0xa')]=function(_0x1d34b2,_0x44eac8){return _0x1d34b2[_0x8efd('0xb')](_0x8efd('0xc'),attributes,{'tableName':_0x8efd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea7a=['path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','util','api','moment','bluebird','request-promise'];(function(_0x533800,_0x1a7256){var _0x1fd9e4=function(_0x2f5a5e){while(--_0x2f5a5e){_0x533800['push'](_0x533800['shift']());}};_0x1fd9e4(++_0x1a7256);}(_0xea7a,0x1b7));var _0xaea7=function(_0x5733b3,_0x40d979){_0x5733b3=_0x5733b3-0x0;var _0x5d837b=_0xea7a[_0x5733b3];return _0x5d837b;};'use strict';var _=require('lodash');var util=require(_0xaea7('0x0'));var logger=require('../../config/logger')(_0xaea7('0x1'));var moment=require(_0xaea7('0x2'));var BPromise=require(_0xaea7('0x3'));var rp=require(_0xaea7('0x4'));var fs=require('fs');var path=require(_0xaea7('0x5'));var rimraf=require(_0xaea7('0x6'));var config=require(_0xaea7('0x7'));var attributes=require(_0xaea7('0x8'));module[_0xaea7('0x9')]=function(_0x3238c8,_0x1ed322){return _0x3238c8[_0xaea7('0xa')]('Plugin',attributes,{'tableName':_0xaea7('0xb'),'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 63d551e..104aea8 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 _0x62e4=['raw','CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','Plugin','create','body'];(function(_0x49a224,_0x3da510){var _0x2bcdc2=function(_0x2598a5){while(--_0x2598a5){_0x49a224['push'](_0x49a224['shift']());}};_0x2bcdc2(++_0x3da510);}(_0x62e4,0x12b));var _0x462e=function(_0x5a3426,_0x193296){_0x5a3426=_0x5a3426-0x0;var _0x4fc906=_0x62e4[_0x5a3426];return _0x4fc906;};'use strict';var _=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var moment=require(_0x462e('0x2'));var BPromise=require('bluebird');var rs=require(_0x462e('0x3'));var fs=require('fs');var Redis=require(_0x462e('0x4'));var db=require(_0x462e('0x5'))['db'];var utils=require(_0x462e('0x6'));var logger=require(_0x462e('0x7'))(_0x462e('0x8'));var config=require(_0x462e('0x9'));var jayson=require(_0x462e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x462e('0xb')]=_[_0x462e('0xc')](config[_0x462e('0xb')],{'host':_0x462e('0xd'),'port':0x18eb});var socket=require(_0x462e('0xe'))(new Redis(config['redis']));require(_0x462e('0xf'))['register'](socket);function respondWithRpcPromise(_0x26820f,_0x3ea257,_0x363685){return new BPromise(function(_0x156543,_0x261186){return client[_0x462e('0x10')](_0x26820f,_0x363685)[_0x462e('0x11')](function(_0x4e9446){logger['info'](_0x462e('0x12'),_0x3ea257,_0x462e('0x13'));logger[_0x462e('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3ea257,'request\x20sent',JSON[_0x462e('0x15')](_0x4e9446));if(_0x4e9446['error']){if(_0x4e9446['error'][_0x462e('0x16')]===0x1f4){logger['error'](_0x462e('0x12'),_0x3ea257,_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);return _0x261186(_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);}logger[_0x462e('0x17')]('Plugin,\x20%s,\x20%s',_0x3ea257,_0x4e9446['error'][_0x462e('0x18')]);return _0x156543(_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);}else{logger[_0x462e('0x19')](_0x462e('0x12'),_0x3ea257,'request\x20sent');_0x156543(_0x4e9446[_0x462e('0x1a')][_0x462e('0x18')]);}})[_0x462e('0x1b')](function(_0x524cc8){logger[_0x462e('0x17')](_0x462e('0x12'),_0x3ea257,_0x524cc8);_0x261186(_0x524cc8);});});}exports['CreatePlugin']=function(_0x457827){var _0xb6256e=this;return new Promise(function(_0x55101d,_0x5a3393){return db[_0x462e('0x1c')][_0x462e('0x1d')](_0x457827[_0x462e('0x1e')],{'raw':_0x457827['options']?_0x457827['options'][_0x462e('0x1f')]===undefined?!![]:![]:!![]})[_0x462e('0x11')](function(_0xea780f){logger['info']('CreatePlugin',_0x457827);logger[_0x462e('0x14')](_0x462e('0x20'),_0x457827,JSON[_0x462e('0x15')](_0xea780f));_0x55101d(_0xea780f);})[_0x462e('0x1b')](function(_0x3214e6){logger['error'](_0x462e('0x20'),_0x3214e6['message'],_0x457827);_0x5a3393(_0xb6256e[_0x462e('0x17')](0x1f4,_0x3214e6['message']));});});}; \ No newline at end of file +var _0xaec5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','body','options','info','CreatePlugin','lodash','util','moment','bluebird'];(function(_0x292ce1,_0x3dc1d3){var _0x376ebf=function(_0x50bf0a){while(--_0x50bf0a){_0x292ce1['push'](_0x292ce1['shift']());}};_0x376ebf(++_0x3dc1d3);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var moment=require(_0x5aec('0x2'));var BPromise=require(_0x5aec('0x3'));var rs=require(_0x5aec('0x4'));var fs=require('fs');var Redis=require(_0x5aec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5aec('0x6'));var logger=require(_0x5aec('0x7'))(_0x5aec('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5aec('0x9')]=_[_0x5aec('0xa')](config[_0x5aec('0x9')],{'host':_0x5aec('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aec('0x9')]));require(_0x5aec('0xc'))['register'](socket);function respondWithRpcPromise(_0x166267,_0x305523,_0x3dbad5){return new BPromise(function(_0x402408,_0x29b092){return client[_0x5aec('0xd')](_0x166267,_0x3dbad5)[_0x5aec('0xe')](function(_0x5e0542){logger['info'](_0x5aec('0xf'),_0x305523,_0x5aec('0x10'));logger[_0x5aec('0x11')](_0x5aec('0x12'),_0x305523,_0x5aec('0x10'),JSON[_0x5aec('0x13')](_0x5e0542));if(_0x5e0542[_0x5aec('0x14')]){if(_0x5e0542[_0x5aec('0x14')][_0x5aec('0x15')]===0x1f4){logger[_0x5aec('0x14')](_0x5aec('0xf'),_0x305523,_0x5e0542['error'][_0x5aec('0x16')]);return _0x29b092(_0x5e0542[_0x5aec('0x14')]['message']);}logger[_0x5aec('0x14')]('Plugin,\x20%s,\x20%s',_0x305523,_0x5e0542[_0x5aec('0x14')][_0x5aec('0x16')]);return _0x402408(_0x5e0542[_0x5aec('0x14')][_0x5aec('0x16')]);}else{logger['info'](_0x5aec('0xf'),_0x305523,_0x5aec('0x10'));_0x402408(_0x5e0542[_0x5aec('0x17')][_0x5aec('0x16')]);}})[_0x5aec('0x18')](function(_0x5a1e4d){logger[_0x5aec('0x14')](_0x5aec('0xf'),_0x305523,_0x5a1e4d);_0x29b092(_0x5a1e4d);});});}exports['CreatePlugin']=function(_0x1bb81d){var _0x5df394=this;return new Promise(function(_0x29fb35,_0x24368b){return db[_0x5aec('0x19')]['create'](_0x1bb81d[_0x5aec('0x1a')],{'raw':_0x1bb81d['options']?_0x1bb81d[_0x5aec('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x5aec('0xe')](function(_0xb95cb3){logger[_0x5aec('0x1c')](_0x5aec('0x1d'),_0x1bb81d);logger['debug']('CreatePlugin',_0x1bb81d,JSON[_0x5aec('0x13')](_0xb95cb3));_0x29fb35(_0xb95cb3);})[_0x5aec('0x18')](function(_0x1a686d){logger['error']('CreatePlugin',_0x1a686d[_0x5aec('0x16')],_0x1bb81d);_0x24368b(_0x5df394['error'](0x1f4,_0x1a686d[_0x5aec('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 344ccb3..fe47a30 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 _0x0d99=['emit','removeListener','register','plugin:','save','update'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x0d99,0xfa));var _0x90d9=function(_0x5be7db,_0x15d5e6){_0x5be7db=_0x5be7db-0x0;var _0x20379d=_0x0d99[_0x5be7db];return _0x20379d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x90d9('0x0'),'remove',_0x90d9('0x1')];function createListener(_0x9efe4b,_0x2548b3){return function(_0x14193c){_0x2548b3[_0x90d9('0x2')](_0x9efe4b,_0x14193c);};}function removeListener(_0x61c734,_0x4eac95){return function(){PluginEvents[_0x90d9('0x3')](_0x61c734,_0x4eac95);};}exports[_0x90d9('0x4')]=function(_0x6d7f8b){for(var _0x1d4d58=0x0,_0x4a253c=events['length'];_0x1d4d58<_0x4a253c;_0x1d4d58++){var _0x3e74eb=events[_0x1d4d58];var _0x478d3e=createListener(_0x90d9('0x5')+_0x3e74eb,_0x6d7f8b);PluginEvents['on'](_0x3e74eb,_0x478d3e);}}; \ No newline at end of file +var _0x0aa8=['update','removeListener','register','length','plugin:','remove'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x0aa8,0xfb));var _0x80aa=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x0aa8[_0x218994];return _0x3f350b;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x80aa('0x0'),_0x80aa('0x1')];function createListener(_0x668f8,_0x5d0dac){return function(_0x4daa0b){_0x5d0dac['emit'](_0x668f8,_0x4daa0b);};}function removeListener(_0x57e7e8,_0x46d761){return function(){PluginEvents[_0x80aa('0x2')](_0x57e7e8,_0x46d761);};}exports[_0x80aa('0x3')]=function(_0x437c2b){for(var _0x40afea=0x0,_0x326037=events[_0x80aa('0x4')];_0x40afea<_0x326037;_0x40afea++){var _0x4790ba=events[_0x40afea];var _0x4b2549=createListener(_0x80aa('0x5')+_0x4790ba,_0x437c2b);PluginEvents['on'](_0x4790ba,_0x4b2549);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ea24d99..c81294f 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(_0x43ecaf,_0x3c57ff){var _0x11f0d7=function(_0x546d9a){while(--_0x546d9a){_0x43ecaf['push'](_0x43ecaf['shift']());}};_0x11f0d7(++_0x3c57ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x9450c4,_0x178b55){var _0x4aaaa3=function(_0x975411){while(--_0x975411){_0x9450c4['push'](_0x9450c4['shift']());}};_0x4aaaa3(++_0x178b55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 7c44083..af79b88 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 _0xca66=['reject','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','script','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','lodash','api','path','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0xca66,0x8b));var _0x6ca6=function(_0xbbb032,_0x4dcdc6){_0xbbb032=_0xbbb032-0x0;var _0x1832ad=_0xca66[_0xbbb032];return _0x1832ad;};'use strict';var _=require(_0x6ca6('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x6ca6('0x1'));var path=require(_0x6ca6('0x2'));var exec=require(_0x6ca6('0x3'))['exec'];var BPromise=require(_0x6ca6('0x4'));function handleEntityNotFound(_0x4b1a10,_0x3ab489){return function(_0x5569aa){if(!_0x5569aa){_0x4b1a10[_0x6ca6('0x5')](0x194);;}return _0x5569aa;};}function respondWithResult(_0x27d8c6,_0x34836f){_0x34836f=_0x34836f||0xc8;return function(_0x44019c){if(_0x44019c){return _0x27d8c6[_0x6ca6('0x6')](_0x34836f)[_0x6ca6('0x7')](_0x44019c);}return null;};}function handleError(_0x27d280,_0x4f5651){_0x4f5651=_0x4f5651||0x1f4;return function(_0xf69e0f){logger[_0x6ca6('0x8')](_0xf69e0f[_0x6ca6('0x9')]);if(_0xf69e0f[_0x6ca6('0xa')]){delete _0xf69e0f[_0x6ca6('0xa')];}_0x27d280[_0x6ca6('0x6')](_0x4f5651)[_0x6ca6('0xb')](_0xf69e0f);};}function execChildProcess(){return new BPromise(function(_0x55a626,_0x38678e){exec(_0x6ca6('0xc'),function(_0x25d276,_0x46b795,_0x444243){logger[_0x6ca6('0xd')](_0x46b795);logger['info'](_0x444243);if(_0x25d276){logger[_0x6ca6('0x8')](_0x25d276);return _0x38678e(_0x25d276);}return _0x55a626(_0x46b795);});});}exports[_0x6ca6('0xe')]=function(_0x55238b,_0x412986){return pm2[_0x6ca6('0xf')]()[_0x6ca6('0x10')](function(_0x3570f1){if(_0x3570f1){var _0xc774c=_[_0x6ca6('0x11')](_0x3570f1,function(_0x4c053a){return _0x4c053a['name']==='express'||_0x4c053a[_0x6ca6('0xa')]===_0x6ca6('0x12');});return{'rows':_0xc774c,'count':_0xc774c[_0x6ca6('0x13')]};}return null;})[_0x6ca6('0x10')](respondWithResult(_0x412986,null))[_0x6ca6('0x14')](handleError(_0x412986,null));};exports[_0x6ca6('0x15')]=function(_0x25dc6c,_0x4f056d){return pm2[_0x6ca6('0x16')](_0x25dc6c[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](respondWithResult(_0x4f056d,null))[_0x6ca6('0x10')](handleEntityNotFound(_0x4f056d,null))[_0x6ca6('0x14')](handleError(_0x4f056d,null));};exports[_0x6ca6('0x18')]=function(_0x16a3d7,_0x251072){if(_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0xa')]&&_0x16a3d7[_0x6ca6('0x19')]['script']){var _0x28a982=path[_0x6ca6('0x1a')](__dirname,_0x6ca6('0x1b'),_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0x1c')]);var _0x438694=process['cwd']();process[_0x6ca6('0x1d')](path[_0x6ca6('0x1e')](_0x28a982));return execChildProcess()['then'](function(_0x4927c1){process[_0x6ca6('0x1d')](_0x438694);return pm2[_0x6ca6('0x1f')]({'name':_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0xa')],'script':_0x28a982});})[_0x6ca6('0x10')](function(_0x541122){pm2[_0x6ca6('0x20')]();return _0x541122[0x0];})[_0x6ca6('0x10')](respondWithResult(_0x251072,0xc9))[_0x6ca6('0x14')](handleError(_0x251072,null));}else{return _0x251072[_0x6ca6('0x6')](0x1f4)[_0x6ca6('0xb')]({'message':_0x6ca6('0x21')});}};exports[_0x6ca6('0x22')]=function(_0x2a1e2d,_0x516daf){if(_0x2a1e2d['body']['id']){delete _0x2a1e2d[_0x6ca6('0x19')]['id'];}var _0x9467bd={'online':_0x6ca6('0x23'),'stopped':_0x6ca6('0x24')};if(_0x9467bd['hasOwnProperty'](_0x2a1e2d['body'][_0x6ca6('0x6')])){return pm2[_0x9467bd[_0x2a1e2d['body']['status']]](_0x2a1e2d[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](respondWithResult(_0x516daf,0xc8))['catch'](handleError(_0x516daf,null));}else{return _0x516daf[_0x6ca6('0x6')](0x1f4)[_0x6ca6('0xb')]({'message':_0x6ca6('0x25')});}};exports[_0x6ca6('0x26')]=function(_0x484411,_0x28af50){if(_0x484411[_0x6ca6('0x19')]['id']){delete _0x484411[_0x6ca6('0x19')]['id'];}if(_0x484411[_0x6ca6('0x17')]['id']){return pm2['delete'](_0x484411[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](function(_0x3c4af8){pm2[_0x6ca6('0x20')]();return _0x3c4af8[0x0];})['then'](respondWithResult(_0x28af50,null))['catch'](handleError(_0x28af50,null));}else{return _0x28af50['status'](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x6324=['params','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','json','error','stack','status','send','npm\x20install','info','index','list','reject','name','motion2','length','then','catch','describe','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy'];(function(_0x4ccd92,_0x282fdd){var _0x32eb3a=function(_0xa3127d){while(--_0xa3127d){_0x4ccd92['push'](_0x4ccd92['shift']());}};_0x32eb3a(++_0x282fdd);}(_0x6324,0x142));var _0x4632=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0x6324[_0x250071];return _0x34e574;};'use strict';var _=require(_0x4632('0x0'));var pm2=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var path=require('path');var exec=require(_0x4632('0x4'))['exec'];var BPromise=require(_0x4632('0x5'));function handleEntityNotFound(_0x54c200,_0x13b218){return function(_0x592e39){if(!_0x592e39){_0x54c200[_0x4632('0x6')](0x194);;}return _0x592e39;};}function respondWithResult(_0x24aba6,_0x1f3077){_0x1f3077=_0x1f3077||0xc8;return function(_0x126e9a){if(_0x126e9a){return _0x24aba6['status'](_0x1f3077)[_0x4632('0x7')](_0x126e9a);}return null;};}function handleError(_0x44dd6d,_0x390a46){_0x390a46=_0x390a46||0x1f4;return function(_0x5a523b){logger[_0x4632('0x8')](_0x5a523b[_0x4632('0x9')]);if(_0x5a523b['name']){delete _0x5a523b['name'];}_0x44dd6d[_0x4632('0xa')](_0x390a46)[_0x4632('0xb')](_0x5a523b);};}function execChildProcess(){return new BPromise(function(_0x30a7cf,_0x3e26d9){exec(_0x4632('0xc'),function(_0xe28f38,_0x1b2729,_0x17f9d1){logger['info'](_0x1b2729);logger[_0x4632('0xd')](_0x17f9d1);if(_0xe28f38){logger['error'](_0xe28f38);return _0x3e26d9(_0xe28f38);}return _0x30a7cf(_0x1b2729);});});}exports[_0x4632('0xe')]=function(_0x299073,_0x3ef228){return pm2[_0x4632('0xf')]()['then'](function(_0x3ba361){if(_0x3ba361){var _0x255882=_[_0x4632('0x10')](_0x3ba361,function(_0x37d798){return _0x37d798[_0x4632('0x11')]==='express'||_0x37d798['name']===_0x4632('0x12');});return{'rows':_0x255882,'count':_0x255882[_0x4632('0x13')]};}return null;})[_0x4632('0x14')](respondWithResult(_0x3ef228,null))[_0x4632('0x15')](handleError(_0x3ef228,null));};exports['show']=function(_0x158831,_0x113872){return pm2[_0x4632('0x16')](_0x158831['params']['id'])[_0x4632('0x14')](respondWithResult(_0x113872,null))[_0x4632('0x14')](handleEntityNotFound(_0x113872,null))['catch'](handleError(_0x113872,null));};exports['create']=function(_0x1c0523,_0x3cf2bd){if(_0x1c0523[_0x4632('0x17')][_0x4632('0x11')]&&_0x1c0523[_0x4632('0x17')][_0x4632('0x18')]){var _0x9ab826=path[_0x4632('0x19')](__dirname,_0x4632('0x1a'),_0x1c0523[_0x4632('0x17')][_0x4632('0x18')]);var _0x2d656a=process[_0x4632('0x1b')]();process[_0x4632('0x1c')](path[_0x4632('0x1d')](_0x9ab826));return execChildProcess()[_0x4632('0x14')](function(_0x4264d5){process[_0x4632('0x1c')](_0x2d656a);return pm2[_0x4632('0x1e')]({'name':_0x1c0523[_0x4632('0x17')][_0x4632('0x11')],'script':_0x9ab826});})[_0x4632('0x14')](function(_0x3b0823){pm2[_0x4632('0x1f')]();return _0x3b0823[0x0];})[_0x4632('0x14')](respondWithResult(_0x3cf2bd,0xc9))[_0x4632('0x15')](handleError(_0x3cf2bd,null));}else{return _0x3cf2bd[_0x4632('0xa')](0x1f4)[_0x4632('0xb')]({'message':_0x4632('0x20')});}};exports[_0x4632('0x21')]=function(_0x22d0f5,_0x2a0b11){if(_0x22d0f5[_0x4632('0x17')]['id']){delete _0x22d0f5['body']['id'];}var _0x57798a={'online':_0x4632('0x22'),'stopped':_0x4632('0x23')};if(_0x57798a[_0x4632('0x24')](_0x22d0f5[_0x4632('0x17')][_0x4632('0xa')])){return pm2[_0x57798a[_0x22d0f5[_0x4632('0x17')][_0x4632('0xa')]]](_0x22d0f5['params']['id'])[_0x4632('0x14')](respondWithResult(_0x2a0b11,0xc8))[_0x4632('0x15')](handleError(_0x2a0b11,null));}else{return _0x2a0b11['status'](0x1f4)[_0x4632('0xb')]({'message':'Unknown\x20status'});}};exports[_0x4632('0x25')]=function(_0x4cb661,_0x4fda35){if(_0x4cb661[_0x4632('0x17')]['id']){delete _0x4cb661[_0x4632('0x17')]['id'];}if(_0x4cb661[_0x4632('0x26')]['id']){return pm2['delete'](_0x4cb661['params']['id'])[_0x4632('0x14')](function(_0x7671ab){pm2['dump']();return _0x7671ab[0x0];})['then'](respondWithResult(_0x4fda35,null))[_0x4632('0x15')](handleError(_0x4fda35,null));}else{return _0x4fda35[_0x4632('0xa')](0x1f4)['send']({'message':_0x4632('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index b169c1a..4bd084a 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 _0x7bf4=['/queues','isAuthenticated','getQueues','exports','Router','../../components/auth/service','./realtime.controller','get','getAgents'];(function(_0x399895,_0x52e3e2){var _0xa8818e=function(_0x19004b){while(--_0x19004b){_0x399895['push'](_0x399895['shift']());}};_0xa8818e(++_0x52e3e2);}(_0x7bf4,0xaf));var _0x47bf=function(_0x31ce32,_0x471e2c){_0x31ce32=_0x31ce32-0x0;var _0x55d6ba=_0x7bf4[_0x31ce32];return _0x55d6ba;};'use strict';var express=require('express');var router=express[_0x47bf('0x0')]();var auth=require(_0x47bf('0x1'));var controller=require(_0x47bf('0x2'));router[_0x47bf('0x3')]('/agents',auth['isAuthenticated'](),controller[_0x47bf('0x4')]);router['get'](_0x47bf('0x5'),auth[_0x47bf('0x6')](),controller[_0x47bf('0x7')]);module[_0x47bf('0x8')]=router; \ No newline at end of file +var _0x4ac6=['../../components/auth/service','./realtime.controller','getAgents','get','/queues','isAuthenticated','exports','Router'];(function(_0x40f0e9,_0x17b610){var _0x12e67a=function(_0x36dc71){while(--_0x36dc71){_0x40f0e9['push'](_0x40f0e9['shift']());}};_0x12e67a(++_0x17b610);}(_0x4ac6,0x157));var _0x64ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ac6[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x64ac('0x0')]();var auth=require(_0x64ac('0x1'));var controller=require(_0x64ac('0x2'));router['get']('/agents',auth['isAuthenticated'](),controller[_0x64ac('0x3')]);router[_0x64ac('0x4')](_0x64ac('0x5'),auth[_0x64ac('0x6')](),controller['getQueues']);module[_0x64ac('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 1ad0002..32c363d 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 _0x88cc=['VoiceQueuesChannels','loggedIn','available','outbound','push','pTalking','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','paused','loggedInDb','waiting','talking','find','pick','filter','queue','length','busy','some','connectedlinenum','internal','getMembers','UserId','online','voiceStatus','agents','Pause','findAll','idle','unavailable','ringing','isNil','chatPause','faxPause','mailPause','smsPause','voicePause','every','pause','chatStatus','faxStatus','smsStatus','whatsappStatus','unknown','*pause','getAgents','lastLoginAt','lastPauseAt','pauseType','address','openchannelPause','chatCapacity','openchannelCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','whatsappPause','query','sort','includes','globalStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','user','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','rows','orderBy','desc','asc','globalStatusFilter','pauseTypeFilter','getQueues','chat','sms','fax','whatsapp','resolve','channel','toLowerCase','Invalid\x20channel','Queue','QueueCampaigns','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','http','client','undefined','limit','count','offset','status','set','Content-Range','stack','name','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','voice','startCase','Queues','format'];(function(_0x2a4837,_0x3a1b7e){var _0x1ae1a4=function(_0x5ad72){while(--_0x5ad72){_0x2a4837['push'](_0x2a4837['shift']());}};_0x1ae1a4(++_0x3a1b7e);}(_0x88cc,0x117));var _0xc88c=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x88cc[_0x238830];return _0x5917f0;};'use strict';var util=require(_0xc88c('0x0'));var _=require('lodash');var jayson=require(_0xc88c('0x1'));var qs=require(_0xc88c('0x2'));var logger=require(_0xc88c('0x3'))('api');var db=require(_0xc88c('0x4'))['db'];var amiClient=jayson['client'][_0xc88c('0x5')]({'port':0x232a});var routingClient=jayson[_0xc88c('0x6')][_0xc88c('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x39fa58,_0x270f6a){return function(_0x468d8a){if(_0x468d8a){var _0x467389=typeof _0x270f6a['offset']===_0xc88c('0x7')&&typeof _0x270f6a[_0xc88c('0x8')]===_0xc88c('0x7');var _0x16b2c8=_0x468d8a[_0xc88c('0x9')];var _0x367f02=_0x467389?0x0:_0x270f6a[_0xc88c('0xa')];var _0x381e68=_0x467389?_0x468d8a[_0xc88c('0x9')]:_0x270f6a[_0xc88c('0xa')]+_0x270f6a['limit'];var _0x2af1d6;if(_0x381e68>=_0x16b2c8){_0x381e68=_0x16b2c8;_0x2af1d6=0xc8;}else{_0x2af1d6=0xce;}_0x39fa58[_0xc88c('0xb')](_0x2af1d6);return _0x39fa58[_0xc88c('0xc')](_0xc88c('0xd'),_0x367f02+'-'+_0x381e68+'/'+_0x16b2c8)['json'](_0x468d8a);}return null;};}function handleError(_0x26d797,_0x4e4a01){_0x4e4a01=_0x4e4a01||0x1f4;return function(_0x1945cc){logger['error'](_0x1945cc[_0xc88c('0xe')]);if(_0x1945cc[_0xc88c('0xf')]){delete _0x1945cc['name'];}_0x26d797[_0xc88c('0xb')](_0x4e4a01)[_0xc88c('0x10')](_0x1945cc);};}function getRealtimeAgents(){return new Promise(function(_0xff3780,_0x3a1b9d){return amiClient[_0xc88c('0x11')](_0xc88c('0x12'),{})[_0xc88c('0x13')](function(_0x3dcb4e){if(_0x3dcb4e[_0xc88c('0x14')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x1839a5=_0x3dcb4e['result'];return routingClient[_0xc88c('0x11')]('Agents',{})['then'](function(_0x1232f1){if(_0x1232f1[_0xc88c('0x14')])throw new Error(_0xc88c('0x15'));var _0x19f016=_0x1232f1[_0xc88c('0x16')];return _0xff3780(_[_0xc88c('0x17')]({},_0x1839a5,_0x19f016));});})[_0xc88c('0x18')](function(_0xfc2d6){_0x3a1b9d(_0xfc2d6);});});}function getRealtimeQueues(_0x258fdf,_0xc5f49d){return new Promise(function(_0x4bc0df,_0x5e36be){var _0x1b91f6=_0xc5f49d===_0xc88c('0x19')?amiClient:routingClient;return _0x1b91f6['request'](_[_0xc88c('0x1a')](_0xc5f49d)+_0xc88c('0x1b'),_0x258fdf)[_0xc88c('0x13')](function(_0x316cd1){if(_0x316cd1['error'])throw new Error(util[_0xc88c('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xc5f49d));return _0x4bc0df(_0x316cd1[_0xc88c('0x16')]);})[_0xc88c('0x18')](function(_0xc2ffac){_0x5e36be(_0xc2ffac);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5b48b2,_0x4e2377){return amiClient['request'](_0xc88c('0x1d'),{})[_0xc88c('0x13')](function(_0x1e66d9){if(_0x1e66d9[_0xc88c('0x14')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x5b48b2(_0x1e66d9['result']);})[_0xc88c('0x18')](function(_0x1a6505){_0x4e2377(_0x1a6505);});});}function initializeQueues(_0x59833e,_0x2a4d07,_0x32ad62,_0x2cd428){var _0x56e463=[_0xc88c('0x1e'),_0xc88c('0x1f'),'waiting','talking','paused'];if(_0x32ad62===_0xc88c('0x19')&&_0x2cd428===_0xc88c('0x20')){_0x56e463[_0xc88c('0x21')](_0xc88c('0x22'),_0xc88c('0x23'),_0xc88c('0x24'),_0xc88c('0x25'),'dialMethod',_0xc88c('0x26'),_0xc88c('0x27'),_0xc88c('0x28'),_0xc88c('0x29'),_0xc88c('0x2a'),_0xc88c('0x2b'),_0xc88c('0x2c'),_0xc88c('0x2d'),_0xc88c('0x2e'),_0xc88c('0x2f'),'predictiveIntervalAvailable',_0xc88c('0x30'),'predictiveIntervalAnsweredCalls',_0xc88c('0x31'),'predictiveIntervalDroppedCallsCallersExit',_0xc88c('0x32'),_0xc88c('0x33'));}return _0x59833e['map'](function(_0x2700f5){var _0x30cb58=_0x2700f5[_0xc88c('0x34')]({'plain':!![]});_0x30cb58['agents']=[];_0x30cb58[_0xc88c('0x35')]=0x0;_0x30cb58[_0xc88c('0x36')]=0x0;_0x30cb58['loggedIn']=0x0;_0x30cb58[_0xc88c('0x1f')]=0x0;_0x30cb58[_0xc88c('0x37')]=0x0;if(_0x32ad62===_0xc88c('0x19')){_0x30cb58[_0xc88c('0x38')]=0x0;_0x30cb58['busy']=0x0;if(_0x2cd428===_0xc88c('0x20')){_0x30cb58[_0xc88c('0x22')]=0x0;_0x30cb58[_0xc88c('0x23')]=0x0;}}var _0x39cec7=_[_0xc88c('0x39')](_0x2a4d07,['id',_0x30cb58['id']]);if(_0x39cec7)_[_0xc88c('0x17')](_0x30cb58,_[_0xc88c('0x3a')](_0x39cec7,_0x56e463));return _0x30cb58;});}function updateAgentVoiceStatus(_0x24ccda,_0x2a15c6,_0x40a1fe){var _0x3efebd=_[_0xc88c('0x3b')](_0x40a1fe,[_0xc88c('0x3c'),_0x2a15c6[_0xc88c('0xf')]]);if(_0x3efebd[_0xc88c('0x3d')]===0x0)return _0x24ccda[_0xc88c('0x3e')]=!![];if(_[_0xc88c('0x3f')](_0x3efebd,[_0xc88c('0x40'),_0x24ccda[_0xc88c('0x41')]['toString']()]))return _0x24ccda[_0xc88c('0x38')]=!![];if(!_0x24ccda[_0xc88c('0x38')])return _0x24ccda[_0xc88c('0x3e')]=!![];}function getVoiceQueueAgents(_0x14b936,_0x241ccb,_0x5e8d85,_0x39d921){var _0x182b50=_[_0xc88c('0x39')](_0x241ccb,['id',_0x14b936['id']]);if(!_0x182b50)return _0x14b936;return _0x182b50[_0xc88c('0x42')]({'raw':!![]})['then'](function(_0x31a79d){for(var _0x179d62=0x0;_0x179d62<_0x31a79d[_0xc88c('0x3d')];_0x179d62++){var _0x5e5730=_[_0xc88c('0x39')](_0x5e8d85,['id',_0x31a79d[_0x179d62][_0xc88c('0x43')]]);if(!_0x5e5730){_0x5e5730={'id':_0x31a79d[_0x179d62][_0xc88c('0x43')],'name':_0x31a79d[_0x179d62]['UserId'],'accountcode':'','online':![]};}var _0x5597bf={'id':_0x5e5730['id'],'name':_0x5e5730[_0xc88c('0xf')],'internal':_0x5e5730['accountcode'],'online':Boolean(_0x5e5730[_0xc88c('0x44')]),'paused':Boolean(_0x31a79d[_0x179d62][_0xc88c('0x35')])};if(_0x5e5730[_0xc88c('0x45')]===_0xc88c('0x38'))updateAgentVoiceStatus(_0x5597bf,_0x14b936,_0x39d921);if(_0x5597bf['online'])_0x14b936['loggedInDb']++;if(_0x5597bf[_0xc88c('0x3e')])_0x14b936[_0xc88c('0x3e')]++;if(_0x5597bf[_0xc88c('0x35')]&&!_0x5597bf[_0xc88c('0x3e')]&&!_0x5597bf[_0xc88c('0x38')])_0x14b936[_0xc88c('0x35')]++;_0x14b936[_0xc88c('0x46')][_0xc88c('0x21')](_0x5597bf);}return _0x14b936;});}function getQueueAgents(_0x471e33,_0x11cccb,_0x1451a3){var _0x5306e4='User'+_[_0xc88c('0x1a')](_0x1451a3)+'Queue';var _0xde7fc8=_0x1451a3+_0xc88c('0x47');return db[_0x5306e4][_0xc88c('0x48')]({'where':{[_[_0xc88c('0x1a')](_0x1451a3)+'QueueId']:_0x471e33['id']},'raw':!![]})[_0xc88c('0x13')](function(_0x20c81d){for(var _0x5aef09=0x0;_0x5aef09<_0x20c81d[_0xc88c('0x3d')];_0x5aef09++){var _0x39b767=_[_0xc88c('0x39')](_0x11cccb,['id',_0x20c81d[_0x5aef09][_0xc88c('0x43')]]);if(!_0x39b767){_0x39b767={'id':_0x20c81d[_0x5aef09][_0xc88c('0x43')],'name':_0x20c81d[_0x5aef09]['UserId'],'online':![],['pauseField']:![]};}var _0x4e3725={'id':_0x39b767['id'],'name':_0x39b767[_0xc88c('0xf')],'online':Boolean(_0x39b767[_0xc88c('0x44')]),'paused':Boolean(_0x39b767[_0xde7fc8])};if(_0x4e3725[_0xc88c('0x44')])_0x471e33[_0xc88c('0x36')]++;_0x471e33['agents'][_0xc88c('0x21')](_0x4e3725);}return _0x471e33;});}function isIdle(_0x14d36c){return _0x14d36c===_0xc88c('0x49')||_0x14d36c==='unknown'||_0x14d36c===_0xc88c('0x4a')||_0x14d36c===_0xc88c('0x4b')||_[_0xc88c('0x4c')](_0x14d36c);}function isAgentPaused(_0x15ddea,_0x1f4508){var _0x3e6f90=[_0x15ddea[_0xc88c('0x4d')],_0x15ddea[_0xc88c('0x4e')],_0x15ddea[_0xc88c('0x4f')],_0x15ddea['openchannelPause'],_0x15ddea[_0xc88c('0x50')],_0x15ddea[_0xc88c('0x51')],_0x15ddea['whatsappPause']];if(!_0x1f4508)return _[_0xc88c('0x52')](_0x3e6f90);var _0x41add0=_[_0xc88c('0x3b')](_0x3e6f90);return _0x41add0[_0xc88c('0x3d')]>0x0&&_0x41add0['length']<_0x3e6f90[_0xc88c('0x3d')]?!![]:![];}function isAgentIdle(_0x64ec5a){if(_0x64ec5a[_0xc88c('0x45')]!==_0xc88c('0x49')&&_0x64ec5a[_0xc88c('0x51')]){_0x64ec5a[_0xc88c('0x45')]=_0xc88c('0x53');return![];}return _['every']([_0x64ec5a[_0xc88c('0x54')],_0x64ec5a[_0xc88c('0x55')],_0x64ec5a['mailStatus'],_0x64ec5a['openchannelStatus'],_0x64ec5a[_0xc88c('0x56')],_0x64ec5a['voiceStatus'],_0x64ec5a[_0xc88c('0x57')]],isIdle);}function getAgentStatus(_0x1892c3){var _0x2ffbbd=_0xc88c('0x58');if(isAgentPaused(_0x1892c3))_0x2ffbbd=_0xc88c('0x53');else if(isAgentPaused(_0x1892c3,!![]))_0x2ffbbd=_0xc88c('0x59');else if(isAgentIdle(_0x1892c3))_0x2ffbbd=_0xc88c('0x49');else _0x2ffbbd=_0xc88c('0x3e');return _0x2ffbbd;}exports[_0xc88c('0x5a')]=function(_0x5f0e76,_0x233edd){var _0x50e2c4='';var _0x57d3d5={'count':0x0,'rows':[]},_0xcedd23={},_0x138983,_0x232494,_0x10262e=['userpic',_0xc88c('0x44'),_0xc88c('0x5b'),_0xc88c('0x5c'),_0xc88c('0x5d'),'lastPauseAt','internal',_0xc88c('0x5e'),_0xc88c('0x4d'),_0xc88c('0x5f'),_0xc88c('0x4f'),_0xc88c('0x50'),'whatsappPause','faxPause','voicePause',_0xc88c('0x60'),_0xc88c('0x61'),'mailCapacity','smsCapacity',_0xc88c('0x62'),_0xc88c('0x63'),_0xc88c('0x64'),_0xc88c('0x65'),'mailCurrentCapacity',_0xc88c('0x66'),_0xc88c('0x67'),_0xc88c('0x68'),'chatStatus','openchannelStatus',_0xc88c('0x69'),_0xc88c('0x56'),_0xc88c('0x57'),'faxStatus',_0xc88c('0x45'),_0xc88c('0x6a'),_0xc88c('0x6b'),_0xc88c('0x6c'),_0xc88c('0x6d'),'whatsappStatusTime',_0xc88c('0x6e'),'voiceStatusTime',_0xc88c('0x3c'),'destconnectedlinenum',_0xc88c('0x6f'),_0xc88c('0x70'),_0xc88c('0x71'),_0xc88c('0x72')],_0x5551f6=[_0xc88c('0x4d'),'openchannelPause',_0xc88c('0x4f'),_0xc88c('0x50'),_0xc88c('0x73'),'faxPause',_0xc88c('0x51'),_0xc88c('0x44')];if(_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x75')]&&_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x75')][_0xc88c('0x76')](_0xc88c('0x77'))){_0x50e2c4=_0x5f0e76['query'][_0xc88c('0x75')];_0x5f0e76[_0xc88c('0x74')]['sort']='';}Promise['resolve']()[_0xc88c('0x13')](function(){var _0x1e74d4=_[_0xc88c('0x78')](db[_0xc88c('0x79')][_0xc88c('0x7a')],function(_0x1fd8cb){return{'name':_0x1fd8cb[_0xc88c('0x7b')],'type':_0x1fd8cb[_0xc88c('0x7c')][_0xc88c('0x7d')]};});_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x7e')]=_0xc88c('0x7f');_0x5f0e76['query'][_0xc88c('0x44')]=!![];_0xcedd23=qs[_0xc88c('0x80')](_0x1e74d4,_0x5f0e76);_0xcedd23[_0xc88c('0x81')]=!![];if(_0x5f0e76[_0xc88c('0x82')][_0xc88c('0x7e')]==='user'){var _0x2d0060={'params':{'id':_0x5f0e76['user'][_0xc88c('0x83')]},'query':{'section':_0xc88c('0x12'),'role':_0xc88c('0x7f'),'online':!![],'nolimit':_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x84')],'sort':_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x75')],'filter':_0x5f0e76[_0xc88c('0x74')]['filter'],'raw':!![]}};return db[_0xc88c('0x85')][_0xc88c('0x86')](_0x2d0060);}return db[_0xc88c('0x79')][_0xc88c('0x87')](_0xcedd23);})[_0xc88c('0x13')](function(_0x29d7a2){_0x57d3d5['count']=_0x29d7a2[_0xc88c('0x9')];_0x138983=_0x29d7a2[_0xc88c('0x88')];return getRealtimeAgents();})[_0xc88c('0x13')](function(_0x13bc81){_0x232494=_0x13bc81[_0xc88c('0x88')];return _0x138983['map'](function(_0x1cb83b){var _0x31ab5a=_[_0xc88c('0x39')](_0x232494,['id',_0x1cb83b['id']]);if(_0x31ab5a)_['merge'](_0x1cb83b,_[_0xc88c('0x3a')](_['omit'](_0x31ab5a,_0x5551f6),_0x10262e));_0x1cb83b[_0xc88c('0x77')]=getAgentStatus(_0x1cb83b);return _0x1cb83b;});})[_0xc88c('0x13')](function(_0x589de9){if(_0x50e2c4[_0xc88c('0x76')]('globalStatus')){var _0x437889;if(_0x50e2c4[_0xc88c('0x76')]('-'))_0x437889=_[_0xc88c('0x89')](_0x589de9,_0xc88c('0x77'),_0xc88c('0x8a'));else _0x437889=_[_0xc88c('0x89')](_0x589de9,_0xc88c('0x77'),_0xc88c('0x8b'));return _0x437889;}return _0x589de9;})['then'](function(_0x42dc8b){if(_0x5f0e76[_0xc88c('0x74')]['globalStatusFilter']){var _0xf8c8ed=_['filter'](_0x42dc8b,[_0xc88c('0x77'),_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x8c')]]);if(_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x8d')]){_0xf8c8ed=_['filter'](_0xf8c8ed,['pauseType',_0x5f0e76[_0xc88c('0x74')][_0xc88c('0x8d')]]);}}_0x57d3d5[_0xc88c('0x88')]=_0xf8c8ed||_0x42dc8b;return _0x57d3d5;})[_0xc88c('0x13')](respondWithFilteredResult(_0x233edd,_0xcedd23))[_0xc88c('0x18')](handleError(_0x233edd,null));};exports[_0xc88c('0x8e')]=function(_0x45c092,_0x46029f){var _0x199d69=['mail',_0xc88c('0x8f'),_0xc88c('0x90'),'openchannel',_0xc88c('0x91'),_0xc88c('0x92'),_0xc88c('0x19')];var _0x40efb4={'count':0x0,'rows':[]},_0x19e365={},_0x5e2023,_0x1905a7,_0x258bc7,_0x2559c2,_0x578036;Promise[_0xc88c('0x93')]()[_0xc88c('0x13')](function(){if(_0x45c092[_0xc88c('0x74')][_0xc88c('0x94')]){if(!_[_0xc88c('0x76')](_0x199d69,_0x45c092[_0xc88c('0x74')][_0xc88c('0x94')][_0xc88c('0x95')]()))throw new Error(_0xc88c('0x96'));_0x5e2023=_0x45c092['query'][_0xc88c('0x94')][_0xc88c('0x95')]();}var _0x3312f6=_['startCase'](_0x5e2023)+_0xc88c('0x97');var _0x2c132d=_[_0xc88c('0x78')](db[_0x3312f6][_0xc88c('0x7a')],function(_0x355408){return{'name':_0x355408['fieldName'],'type':_0x355408['type'][_0xc88c('0x7d')]};});_0x19e365=qs['getOptions'](_0x2c132d,_0x45c092);if(_0x45c092[_0xc88c('0x82')]['role']===_0xc88c('0x82')){var _0x3592b6={'params':{'id':_0x45c092[_0xc88c('0x82')]['userProfileId']},'query':{'section':_0x5e2023===_0xc88c('0x19')&&_0x45c092[_0xc88c('0x74')][_0xc88c('0x7c')]==='outbound'?_0xc88c('0x98'):_['startCase'](_0x5e2023)+_0xc88c('0x1b'),'type':_0x45c092[_0xc88c('0x74')][_0xc88c('0x7c')],'nolimit':!![],'sort':'name','filter':_0x45c092[_0xc88c('0x74')][_0xc88c('0x3b')]}};return db[_0xc88c('0x85')][_0xc88c('0x86')](_0x3592b6);}return db[_0x3312f6][_0xc88c('0x87')](_0x19e365);})[_0xc88c('0x13')](function(_0x279170){_0x40efb4[_0xc88c('0x9')]=_0x279170[_0xc88c('0x9')];_0x1905a7=_0x279170['rows'];return getRealtimeQueues(_0x45c092,_0x5e2023);})['then'](function(_0xec56c9){_0x2559c2=_0xec56c9[_0xc88c('0x88')];return getRealtimeAgents();})[_0xc88c('0x13')](function(_0x3d82f4){_0x258bc7=_0x3d82f4[_0xc88c('0x88')];if(_0x5e2023!=_0xc88c('0x19'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2d8a29){_0x578036=_0x2d8a29?_0x2d8a29['rows']:[];return initializeQueues(_0x1905a7,_0x2559c2,_0x5e2023,_0x45c092['query']['type']);})[_0xc88c('0x13')](function(_0x19952b){var _0xac2b49=_0x19952b[_0xc88c('0x78')](function(_0x5677ea){if(_0x5e2023===_0xc88c('0x19'))return getVoiceQueueAgents(_0x5677ea,_0x1905a7,_0x258bc7,_0x578036);else return getQueueAgents(_0x5677ea,_0x258bc7,_0x5e2023);});return Promise[_0xc88c('0x99')](_0xac2b49);})[_0xc88c('0x13')](function(_0x573055){_0x40efb4[_0xc88c('0x88')]=_0x573055;return _0x40efb4;})[_0xc88c('0x13')](respondWithFilteredResult(_0x46029f,_0x19e365))[_0xc88c('0x18')](handleError(_0x46029f,null));}; \ No newline at end of file +var _0x64e4=['internal','length','UserId','accountcode','online','voiceStatus','User','Queue','Pause','idle','unknown','isNil','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','chatStatus','faxStatus','openchannelStatus','smsStatus','pause','*pause','lastLoginAt','lastPauseAt','smsPause','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','mailStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','query','sort','globalStatus','resolve','map','rawAttributes','type','key','role','agent','getOptions','user','userProfileId','nolimit','UserProfile','getResources','rows','includes','orderBy','desc','asc','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','chat','sms','openchannel','fax','channel','Invalid\x20channel','startCase','QueueCampaigns','findAndCountAll','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','json','error','name','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','merge','voice','Queues','format','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','agents','waiting','outbound','find','pick','queue','busy','connectedlinenum'];(function(_0x4a4eb6,_0x34e9a3){var _0x105085=function(_0x1122c9){while(--_0x1122c9){_0x4a4eb6['push'](_0x4a4eb6['shift']());}};_0x105085(++_0x34e9a3);}(_0x64e4,0xe2));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x464e('0x0'));var _=require(_0x464e('0x1'));var jayson=require(_0x464e('0x2'));var qs=require(_0x464e('0x3'));var logger=require(_0x464e('0x4'))('api');var db=require(_0x464e('0x5'))['db'];var amiClient=jayson[_0x464e('0x6')][_0x464e('0x7')]({'port':0x232a});var routingClient=jayson[_0x464e('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x3bdc0f,_0x577aef){return function(_0x12ff0f){if(_0x12ff0f){var _0x16d0fb=typeof _0x577aef[_0x464e('0x8')]===_0x464e('0x9')&&typeof _0x577aef[_0x464e('0xa')]===_0x464e('0x9');var _0x1d2d59=_0x12ff0f[_0x464e('0xb')];var _0x3243ad=_0x16d0fb?0x0:_0x577aef[_0x464e('0x8')];var _0x176d0b=_0x16d0fb?_0x12ff0f['count']:_0x577aef[_0x464e('0x8')]+_0x577aef['limit'];var _0x18f4e7;if(_0x176d0b>=_0x1d2d59){_0x176d0b=_0x1d2d59;_0x18f4e7=0xc8;}else{_0x18f4e7=0xce;}_0x3bdc0f[_0x464e('0xc')](_0x18f4e7);return _0x3bdc0f['set']('Content-Range',_0x3243ad+'-'+_0x176d0b+'/'+_0x1d2d59)[_0x464e('0xd')](_0x12ff0f);}return null;};}function handleError(_0x84b042,_0x4af90f){_0x4af90f=_0x4af90f||0x1f4;return function(_0x19c588){logger[_0x464e('0xe')](_0x19c588['stack']);if(_0x19c588[_0x464e('0xf')]){delete _0x19c588['name'];}_0x84b042['status'](_0x4af90f)['send'](_0x19c588);};}function getRealtimeAgents(){return new Promise(function(_0x117403,_0x3e7366){return amiClient[_0x464e('0x10')]('Agents',{})[_0x464e('0x11')](function(_0x19ee1c){if(_0x19ee1c[_0x464e('0xe')])throw new Error(_0x464e('0x12'));var _0x49ea39=_0x19ee1c['result'];return routingClient[_0x464e('0x10')](_0x464e('0x13'),{})[_0x464e('0x11')](function(_0x2760c3){if(_0x2760c3[_0x464e('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x2ee878=_0x2760c3['result'];return _0x117403(_[_0x464e('0x14')]({},_0x49ea39,_0x2ee878));});})['catch'](function(_0x3bc78a){_0x3e7366(_0x3bc78a);});});}function getRealtimeQueues(_0x722d4c,_0x2f27d5){return new Promise(function(_0x1ac06d,_0x2609d0){var _0x116063=_0x2f27d5===_0x464e('0x15')?amiClient:routingClient;return _0x116063[_0x464e('0x10')](_['startCase'](_0x2f27d5)+_0x464e('0x16'),_0x722d4c)['then'](function(_0x3d8ef4){if(_0x3d8ef4[_0x464e('0xe')])throw new Error(util[_0x464e('0x17')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x2f27d5));return _0x1ac06d(_0x3d8ef4[_0x464e('0x18')]);})[_0x464e('0x19')](function(_0xa72f44){_0x2609d0(_0xa72f44);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2ec4a0,_0x209659){return amiClient[_0x464e('0x10')](_0x464e('0x1a'),{})[_0x464e('0x11')](function(_0x563a21){if(_0x563a21[_0x464e('0xe')])throw new Error(_0x464e('0x1b'));return _0x2ec4a0(_0x563a21[_0x464e('0x18')]);})['catch'](function(_0x45fd99){_0x209659(_0x45fd99);});});}function initializeQueues(_0x1eaccf,_0x241cb6,_0x28539b,_0x522669){var _0x2a3df1=[_0x464e('0x1c'),_0x464e('0x1d'),'waiting',_0x464e('0x1e'),_0x464e('0x1f')];if(_0x28539b===_0x464e('0x15')&&_0x522669==='outbound'){_0x2a3df1[_0x464e('0x20')](_0x464e('0x21'),_0x464e('0x22'),_0x464e('0x23'),'dialActive',_0x464e('0x24'),_0x464e('0x25'),_0x464e('0x26'),_0x464e('0x27'),_0x464e('0x28'),'erlangCallToSecond','erlangAbandonmentRate',_0x464e('0x29'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x464e('0x2a'),_0x464e('0x2b'),_0x464e('0x2c'),_0x464e('0x2d'),_0x464e('0x2e'),_0x464e('0x2f'),'predictiveIntervalAvgHoldtime',_0x464e('0x30'));}return _0x1eaccf['map'](function(_0x25b56d){var _0x98a717=_0x25b56d[_0x464e('0x31')]({'plain':!![]});_0x98a717[_0x464e('0x32')]=[];_0x98a717[_0x464e('0x1f')]=0x0;_0x98a717['loggedInDb']=0x0;_0x98a717[_0x464e('0x1c')]=0x0;_0x98a717[_0x464e('0x1d')]=0x0;_0x98a717[_0x464e('0x33')]=0x0;if(_0x28539b==='voice'){_0x98a717['talking']=0x0;_0x98a717['busy']=0x0;if(_0x522669===_0x464e('0x34')){_0x98a717[_0x464e('0x21')]=0x0;_0x98a717['originated']=0x0;}}var _0x328fcf=_[_0x464e('0x35')](_0x241cb6,['id',_0x98a717['id']]);if(_0x328fcf)_[_0x464e('0x14')](_0x98a717,_[_0x464e('0x36')](_0x328fcf,_0x2a3df1));return _0x98a717;});}function updateAgentVoiceStatus(_0x3130a3,_0x5a0294,_0x353994){var _0x462e78=_['filter'](_0x353994,[_0x464e('0x37'),_0x5a0294[_0x464e('0xf')]]);if(_0x462e78['length']===0x0)return _0x3130a3[_0x464e('0x38')]=!![];if(_['some'](_0x462e78,[_0x464e('0x39'),_0x3130a3[_0x464e('0x3a')]['toString']()]))return _0x3130a3['talking']=!![];if(!_0x3130a3['talking'])return _0x3130a3[_0x464e('0x38')]=!![];}function getVoiceQueueAgents(_0x778444,_0x1de0cd,_0x5b40a5,_0x45eb5c){var _0x1de7b2=_[_0x464e('0x35')](_0x1de0cd,['id',_0x778444['id']]);if(!_0x1de7b2)return _0x778444;return _0x1de7b2['getMembers']({'raw':!![]})[_0x464e('0x11')](function(_0x1043e3){for(var _0x3d1f61=0x0;_0x3d1f61<_0x1043e3[_0x464e('0x3b')];_0x3d1f61++){var _0x437b50=_[_0x464e('0x35')](_0x5b40a5,['id',_0x1043e3[_0x3d1f61][_0x464e('0x3c')]]);if(!_0x437b50){_0x437b50={'id':_0x1043e3[_0x3d1f61][_0x464e('0x3c')],'name':_0x1043e3[_0x3d1f61]['UserId'],'accountcode':'','online':![]};}var _0x24a51a={'id':_0x437b50['id'],'name':_0x437b50[_0x464e('0xf')],'internal':_0x437b50[_0x464e('0x3d')],'online':Boolean(_0x437b50[_0x464e('0x3e')]),'paused':Boolean(_0x1043e3[_0x3d1f61][_0x464e('0x1f')])};if(_0x437b50[_0x464e('0x3f')]==='talking')updateAgentVoiceStatus(_0x24a51a,_0x778444,_0x45eb5c);if(_0x24a51a[_0x464e('0x3e')])_0x778444['loggedInDb']++;if(_0x24a51a[_0x464e('0x38')])_0x778444[_0x464e('0x38')]++;if(_0x24a51a['paused']&&!_0x24a51a[_0x464e('0x38')]&&!_0x24a51a[_0x464e('0x1e')])_0x778444['paused']++;_0x778444['agents']['push'](_0x24a51a);}return _0x778444;});}function getQueueAgents(_0x29aff2,_0x3addc0,_0x521971){var _0x1b2eeb=_0x464e('0x40')+_['startCase'](_0x521971)+_0x464e('0x41');var _0x2a2140=_0x521971+_0x464e('0x42');return db[_0x1b2eeb]['findAll']({'where':{[_['startCase'](_0x521971)+'QueueId']:_0x29aff2['id']},'raw':!![]})[_0x464e('0x11')](function(_0x45eb62){for(var _0x100093=0x0;_0x100093<_0x45eb62['length'];_0x100093++){var _0x158705=_[_0x464e('0x35')](_0x3addc0,['id',_0x45eb62[_0x100093][_0x464e('0x3c')]]);if(!_0x158705){_0x158705={'id':_0x45eb62[_0x100093][_0x464e('0x3c')],'name':_0x45eb62[_0x100093][_0x464e('0x3c')],'online':![],['pauseField']:![]};}var _0x2c98b7={'id':_0x158705['id'],'name':_0x158705[_0x464e('0xf')],'online':Boolean(_0x158705[_0x464e('0x3e')]),'paused':Boolean(_0x158705[_0x2a2140])};if(_0x2c98b7[_0x464e('0x3e')])_0x29aff2['loggedInDb']++;_0x29aff2[_0x464e('0x32')]['push'](_0x2c98b7);}return _0x29aff2;});}function isIdle(_0x5c450d){return _0x5c450d===_0x464e('0x43')||_0x5c450d===_0x464e('0x44')||_0x5c450d==='unavailable'||_0x5c450d==='ringing'||_[_0x464e('0x45')](_0x5c450d);}function isAgentPaused(_0x5fb5f,_0x32505d){var _0xfb05ac=[_0x5fb5f[_0x464e('0x46')],_0x5fb5f[_0x464e('0x47')],_0x5fb5f[_0x464e('0x48')],_0x5fb5f[_0x464e('0x49')],_0x5fb5f['smsPause'],_0x5fb5f[_0x464e('0x4a')],_0x5fb5f[_0x464e('0x4b')]];if(!_0x32505d)return _[_0x464e('0x4c')](_0xfb05ac);var _0x48d017=_[_0x464e('0x4d')](_0xfb05ac);return _0x48d017[_0x464e('0x3b')]>0x0&&_0x48d017[_0x464e('0x3b')]<_0xfb05ac['length']?!![]:![];}function isAgentIdle(_0x2e335e){if(_0x2e335e['voiceStatus']!=='idle'&&_0x2e335e[_0x464e('0x4a')]){_0x2e335e[_0x464e('0x3f')]='pause';return![];}return _['every']([_0x2e335e[_0x464e('0x4e')],_0x2e335e[_0x464e('0x4f')],_0x2e335e['mailStatus'],_0x2e335e[_0x464e('0x50')],_0x2e335e[_0x464e('0x51')],_0x2e335e[_0x464e('0x3f')],_0x2e335e['whatsappStatus']],isIdle);}function getAgentStatus(_0x2252c4){var _0x10cd73=_0x464e('0x44');if(isAgentPaused(_0x2252c4))_0x10cd73=_0x464e('0x52');else if(isAgentPaused(_0x2252c4,!![]))_0x10cd73=_0x464e('0x53');else if(isAgentIdle(_0x2252c4))_0x10cd73=_0x464e('0x43');else _0x10cd73=_0x464e('0x38');return _0x10cd73;}exports['getAgents']=function(_0x59838d,_0x1f8172){var _0x5459e0='';var _0x4ad1f0={'count':0x0,'rows':[]},_0x24e584={},_0x3c9819,_0xacd6e6,_0x1dbd6b=['userpic','online',_0x464e('0x54'),_0x464e('0x55'),'pauseType','lastPauseAt',_0x464e('0x3a'),'address',_0x464e('0x46'),_0x464e('0x49'),_0x464e('0x48'),_0x464e('0x56'),_0x464e('0x4b'),_0x464e('0x47'),_0x464e('0x4a'),'chatCapacity',_0x464e('0x57'),'mailCapacity',_0x464e('0x58'),_0x464e('0x59'),_0x464e('0x5a'),_0x464e('0x5b'),_0x464e('0x5c'),_0x464e('0x5d'),_0x464e('0x5e'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus',_0x464e('0x50'),_0x464e('0x5f'),'smsStatus',_0x464e('0x60'),_0x464e('0x4f'),_0x464e('0x3f'),'chatStatusTime',_0x464e('0x61'),_0x464e('0x62'),_0x464e('0x63'),_0x464e('0x64'),_0x464e('0x65'),_0x464e('0x66'),'queue',_0x464e('0x67'),_0x464e('0x68'),_0x464e('0x69'),_0x464e('0x6a'),_0x464e('0x6b')],_0x470bd9=[_0x464e('0x46'),_0x464e('0x49'),_0x464e('0x48'),_0x464e('0x56'),_0x464e('0x4b'),'faxPause','voicePause',_0x464e('0x3e')];if(_0x59838d[_0x464e('0x6c')][_0x464e('0x6d')]&&_0x59838d[_0x464e('0x6c')]['sort']['includes'](_0x464e('0x6e'))){_0x5459e0=_0x59838d[_0x464e('0x6c')][_0x464e('0x6d')];_0x59838d[_0x464e('0x6c')][_0x464e('0x6d')]='';}Promise[_0x464e('0x6f')]()[_0x464e('0x11')](function(){var _0x14ad0e=_[_0x464e('0x70')](db[_0x464e('0x40')][_0x464e('0x71')],function(_0x3f882d){return{'name':_0x3f882d['fieldName'],'type':_0x3f882d[_0x464e('0x72')][_0x464e('0x73')]};});_0x59838d[_0x464e('0x6c')][_0x464e('0x74')]=_0x464e('0x75');_0x59838d[_0x464e('0x6c')][_0x464e('0x3e')]=!![];_0x24e584=qs[_0x464e('0x76')](_0x14ad0e,_0x59838d);_0x24e584['raw']=!![];if(_0x59838d[_0x464e('0x77')][_0x464e('0x74')]===_0x464e('0x77')){var _0x953363={'params':{'id':_0x59838d[_0x464e('0x77')][_0x464e('0x78')]},'query':{'section':_0x464e('0x13'),'role':'agent','online':!![],'nolimit':_0x59838d['query'][_0x464e('0x79')],'sort':_0x59838d['query'][_0x464e('0x6d')],'filter':_0x59838d['query']['filter'],'raw':!![]}};return db[_0x464e('0x7a')][_0x464e('0x7b')](_0x953363);}return db[_0x464e('0x40')]['findAndCountAll'](_0x24e584);})[_0x464e('0x11')](function(_0x2b77a4){_0x4ad1f0[_0x464e('0xb')]=_0x2b77a4[_0x464e('0xb')];_0x3c9819=_0x2b77a4[_0x464e('0x7c')];return getRealtimeAgents();})[_0x464e('0x11')](function(_0x5c389e){_0xacd6e6=_0x5c389e['rows'];return _0x3c9819[_0x464e('0x70')](function(_0x5d1dab){var _0x3ff388=_[_0x464e('0x35')](_0xacd6e6,['id',_0x5d1dab['id']]);if(_0x3ff388)_[_0x464e('0x14')](_0x5d1dab,_[_0x464e('0x36')](_['omit'](_0x3ff388,_0x470bd9),_0x1dbd6b));_0x5d1dab[_0x464e('0x6e')]=getAgentStatus(_0x5d1dab);return _0x5d1dab;});})[_0x464e('0x11')](function(_0x181d73){if(_0x5459e0[_0x464e('0x7d')](_0x464e('0x6e'))){var _0x3807eb;if(_0x5459e0[_0x464e('0x7d')]('-'))_0x3807eb=_[_0x464e('0x7e')](_0x181d73,_0x464e('0x6e'),_0x464e('0x7f'));else _0x3807eb=_[_0x464e('0x7e')](_0x181d73,_0x464e('0x6e'),_0x464e('0x80'));return _0x3807eb;}return _0x181d73;})[_0x464e('0x11')](function(_0x332ed6){if(_0x59838d[_0x464e('0x6c')][_0x464e('0x81')]){var _0x30fdc0=_[_0x464e('0x4d')](_0x332ed6,[_0x464e('0x6e'),_0x59838d[_0x464e('0x6c')][_0x464e('0x81')]]);if(_0x59838d[_0x464e('0x6c')][_0x464e('0x82')]){_0x30fdc0=_[_0x464e('0x4d')](_0x30fdc0,[_0x464e('0x83'),_0x59838d[_0x464e('0x6c')][_0x464e('0x82')]]);}}_0x4ad1f0['rows']=_0x30fdc0||_0x332ed6;return _0x4ad1f0;})[_0x464e('0x11')](respondWithFilteredResult(_0x1f8172,_0x24e584))[_0x464e('0x19')](handleError(_0x1f8172,null));};exports[_0x464e('0x84')]=function(_0x359c6b,_0x38920c){var _0x20cbee=['mail',_0x464e('0x85'),_0x464e('0x86'),_0x464e('0x87'),_0x464e('0x88'),'whatsapp',_0x464e('0x15')];var _0x51f975={'count':0x0,'rows':[]},_0x19c8a9={},_0x4b3d58,_0x13d007,_0x4efc65,_0x4d5afa,_0x2aefa9;Promise[_0x464e('0x6f')]()[_0x464e('0x11')](function(){if(_0x359c6b['query'][_0x464e('0x89')]){if(!_[_0x464e('0x7d')](_0x20cbee,_0x359c6b[_0x464e('0x6c')][_0x464e('0x89')]['toLowerCase']()))throw new Error(_0x464e('0x8a'));_0x4b3d58=_0x359c6b[_0x464e('0x6c')][_0x464e('0x89')]['toLowerCase']();}var _0x41b20b=_[_0x464e('0x8b')](_0x4b3d58)+'Queue';var _0x1c1f29=_[_0x464e('0x70')](db[_0x41b20b][_0x464e('0x71')],function(_0xa6c6ec){return{'name':_0xa6c6ec['fieldName'],'type':_0xa6c6ec[_0x464e('0x72')][_0x464e('0x73')]};});_0x19c8a9=qs[_0x464e('0x76')](_0x1c1f29,_0x359c6b);if(_0x359c6b[_0x464e('0x77')][_0x464e('0x74')]===_0x464e('0x77')){var _0x24bfe7={'params':{'id':_0x359c6b[_0x464e('0x77')][_0x464e('0x78')]},'query':{'section':_0x4b3d58===_0x464e('0x15')&&_0x359c6b[_0x464e('0x6c')][_0x464e('0x72')]===_0x464e('0x34')?_0x464e('0x8c'):_[_0x464e('0x8b')](_0x4b3d58)+_0x464e('0x16'),'type':_0x359c6b[_0x464e('0x6c')]['type'],'nolimit':!![],'sort':_0x464e('0xf'),'filter':_0x359c6b[_0x464e('0x6c')][_0x464e('0x4d')]}};return db[_0x464e('0x7a')][_0x464e('0x7b')](_0x24bfe7);}return db[_0x41b20b][_0x464e('0x8d')](_0x19c8a9);})[_0x464e('0x11')](function(_0x4c567e){_0x51f975[_0x464e('0xb')]=_0x4c567e['count'];_0x13d007=_0x4c567e[_0x464e('0x7c')];return getRealtimeQueues(_0x359c6b,_0x4b3d58);})[_0x464e('0x11')](function(_0x485357){_0x4d5afa=_0x485357[_0x464e('0x7c')];return getRealtimeAgents();})['then'](function(_0x29d681){_0x4efc65=_0x29d681[_0x464e('0x7c')];if(_0x4b3d58!=_0x464e('0x15'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x200e15){_0x2aefa9=_0x200e15?_0x200e15[_0x464e('0x7c')]:[];return initializeQueues(_0x13d007,_0x4d5afa,_0x4b3d58,_0x359c6b['query'][_0x464e('0x72')]);})[_0x464e('0x11')](function(_0x3e8ede){var _0x570183=_0x3e8ede[_0x464e('0x70')](function(_0x3e4a27){if(_0x4b3d58==='voice')return getVoiceQueueAgents(_0x3e4a27,_0x13d007,_0x4efc65,_0x2aefa9);else return getQueueAgents(_0x3e4a27,_0x4efc65,_0x4b3d58);});return Promise['all'](_0x570183);})[_0x464e('0x11')](function(_0xf1448){_0x51f975[_0x464e('0x7c')]=_0xf1448;return _0x51f975;})[_0x464e('0x11')](respondWithFilteredResult(_0x38920c,_0x19c8a9))[_0x464e('0x19')](handleError(_0x38920c,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f0a64bc..9b4533c 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c830d,_0x48405c){var _0x48be30=function(_0x394bfc){while(--_0x394bfc){_0x2c830d['push'](_0x2c830d['shift']());}};_0x48be30(++_0x48405c);}(_0xe706,0xa3));var _0x6e70=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0xe706[_0x5d7747];return _0x291142;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x260d55,_0x25239a){var _0x26c788=function(_0x162323){while(--_0x162323){_0x260d55['push'](_0x260d55['shift']());}};_0x26c788(++_0x25239a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c121535..c319adb 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 _0xab36=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0xfc913b,_0x3ee3fb){var _0x1e84a1=function(_0x2b49ae){while(--_0x2b49ae){_0xfc913b['push'](_0xfc913b['shift']());}};_0x1e84a1(++_0x3ee3fb);}(_0xab36,0x1df));var _0x6ab3=function(_0x252147,_0x44bc9a){_0x252147=_0x252147-0x0;var _0x33e16f=_0xab36[_0x252147];return _0x33e16f;};'use strict';var Sequelize=require(_0x6ab3('0x0'));module[_0x6ab3('0x1')]={'state':{'type':Sequelize[_0x6ab3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6ab3('0x3')]},'scheduledat':{'type':Sequelize[_0x6ab3('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6ab3('0x4')]},'responsetime':{'type':Sequelize[_0x6ab3('0x4')]},'ringtime':{'type':Sequelize[_0x6ab3('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6ab3('0x3')]},'membername':{'type':Sequelize[_0x6ab3('0x3')]}}; \ No newline at end of file +var _0x423b=['STRING','exports'];(function(_0x53c96,_0x1e1e11){var _0x3a22d2=function(_0x24613b){while(--_0x24613b){_0x53c96['push'](_0x53c96['shift']());}};_0x3a22d2(++_0x1e1e11);}(_0x423b,0x12b));var _0xb423=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x423b[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require('sequelize');module[_0xb423('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb423('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xb423('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb423('0x1')]},'campaigntype':{'type':Sequelize[_0xb423('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 699f14c..f4065df 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 _0x4a0c=['exports','define','ReportAgentPreview','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4a0c,0x121));var _0xc4a0=function(_0x5b3265,_0x190095){_0x5b3265=_0x5b3265-0x0;var _0x5cb144=_0x4a0c[_0x5b3265];return _0x5cb144;};'use strict';var _=require(_0xc4a0('0x0'));var util=require(_0xc4a0('0x1'));var logger=require('../../config/logger')(_0xc4a0('0x2'));var moment=require(_0xc4a0('0x3'));var BPromise=require(_0xc4a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc4a0('0x5'));var config=require(_0xc4a0('0x6'));var attributes=require(_0xc4a0('0x7'));module[_0xc4a0('0x8')]=function(_0x1851d3,_0x16ab21){return _0x1851d3[_0xc4a0('0x9')](_0xc4a0('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d52=['bluebird','request-promise','path','rimraf','report_agent_preview','lodash','util','../../config/logger','moment'];(function(_0x4ef55e,_0x36c79d){var _0x54dfc9=function(_0x2ff8ae){while(--_0x2ff8ae){_0x4ef55e['push'](_0x4ef55e['shift']());}};_0x54dfc9(++_0x36c79d);}(_0x0d52,0x137));var _0x20d5=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x0d52[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x20d5('0x0'));var util=require(_0x20d5('0x1'));var logger=require(_0x20d5('0x2'))('api');var moment=require(_0x20d5('0x3'));var BPromise=require(_0x20d5('0x4'));var rp=require(_0x20d5('0x5'));var fs=require('fs');var path=require(_0x20d5('0x6'));var rimraf=require(_0x20d5('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x7c796e,_0x109b1d){return _0x7c796e['define']('ReportAgentPreview',attributes,{'tableName':_0x20d5('0x8'),'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 9fd79f8..334d1ed 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 _0x3cbb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','util'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x3cbb,0xad));var _0xb3cb=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x3cbb[_0x515afd];return _0x536d53;};'use strict';var _=require('lodash');var util=require(_0xb3cb('0x0'));var moment=require('moment');var BPromise=require(_0xb3cb('0x1'));var rs=require(_0xb3cb('0x2'));var fs=require('fs');var Redis=require(_0xb3cb('0x3'));var db=require(_0xb3cb('0x4'))['db'];var utils=require(_0xb3cb('0x5'));var logger=require(_0xb3cb('0x6'))(_0xb3cb('0x7'));var config=require(_0xb3cb('0x8'));var jayson=require(_0xb3cb('0x9'));var client=jayson[_0xb3cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111d1d,_0xa064e9,_0x58675a){return new BPromise(function(_0x316636,_0x50385e){return client['request'](_0x111d1d,_0x58675a)[_0xb3cb('0xb')](function(_0x353e42){logger[_0xb3cb('0xc')](_0xb3cb('0xd'),_0xa064e9,_0xb3cb('0xe'));logger['debug'](_0xb3cb('0xf'),_0xa064e9,_0xb3cb('0xe'),JSON[_0xb3cb('0x10')](_0x353e42));if(_0x353e42[_0xb3cb('0x11')]){if(_0x353e42[_0xb3cb('0x11')][_0xb3cb('0x12')]===0x1f4){logger[_0xb3cb('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0xa064e9,_0x353e42['error'][_0xb3cb('0x13')]);return _0x50385e(_0x353e42['error'][_0xb3cb('0x13')]);}logger['error'](_0xb3cb('0xd'),_0xa064e9,_0x353e42[_0xb3cb('0x11')][_0xb3cb('0x13')]);return _0x316636(_0x353e42[_0xb3cb('0x11')]['message']);}else{logger[_0xb3cb('0xc')](_0xb3cb('0xd'),_0xa064e9,'request\x20sent');_0x316636(_0x353e42[_0xb3cb('0x14')]['message']);}})[_0xb3cb('0x15')](function(_0x3e5e1f){logger[_0xb3cb('0x11')](_0xb3cb('0xd'),_0xa064e9,_0x3e5e1f);_0x50385e(_0x3e5e1f);});});}exports[_0xb3cb('0x16')]=function(_0x2bdd6c){var _0x58652a=this;return new Promise(function(_0x846728,_0x4ba522){return db[_0xb3cb('0x17')][_0xb3cb('0x18')](_0x2bdd6c[_0xb3cb('0x19')],{'raw':_0x2bdd6c[_0xb3cb('0x1a')]?_0x2bdd6c[_0xb3cb('0x1a')][_0xb3cb('0x1b')]===undefined?!![]:![]:!![]})[_0xb3cb('0xb')](function(_0x306250){logger[_0xb3cb('0xc')]('CreateReportAgentPreview',_0x2bdd6c);logger[_0xb3cb('0x1c')](_0xb3cb('0x16'),_0x2bdd6c,JSON[_0xb3cb('0x10')](_0x306250));_0x846728(_0x306250);})[_0xb3cb('0x15')](function(_0x49ca26){logger[_0xb3cb('0x11')](_0xb3cb('0x16'),_0x49ca26[_0xb3cb('0x13')],_0x2bdd6c);_0x4ba522(_0x58652a[_0xb3cb('0x11')](0x1f4,_0x49ca26['message']));});});}; \ No newline at end of file +var _0x103a=['request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x373982,_0x1cd5e2){var _0x475a29=function(_0x44d4da){while(--_0x44d4da){_0x373982['push'](_0x373982['shift']());}};_0x475a29(++_0x1cd5e2);}(_0x103a,0x9e));var _0xa103=function(_0x13e4b0,_0xf4825a){_0x13e4b0=_0x13e4b0-0x0;var _0x240b14=_0x103a[_0x13e4b0];return _0x240b14;};'use strict';var _=require(_0xa103('0x0'));var util=require(_0xa103('0x1'));var moment=require(_0xa103('0x2'));var BPromise=require(_0xa103('0x3'));var rs=require(_0xa103('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa103('0x5'));var logger=require('../../config/logger')(_0xa103('0x6'));var config=require('../../config/environment');var jayson=require(_0xa103('0x7'));var client=jayson[_0xa103('0x8')][_0xa103('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3417a1,_0x30fc7e,_0x37a876){return new BPromise(function(_0x544694,_0x508a8a){return client[_0xa103('0xa')](_0x3417a1,_0x37a876)[_0xa103('0xb')](function(_0x4575a3){logger[_0xa103('0xc')](_0xa103('0xd'),_0x30fc7e,_0xa103('0xe'));logger['debug'](_0xa103('0xf'),_0x30fc7e,'request\x20sent',JSON[_0xa103('0x10')](_0x4575a3));if(_0x4575a3[_0xa103('0x11')]){if(_0x4575a3[_0xa103('0x11')][_0xa103('0x12')]===0x1f4){logger[_0xa103('0x11')](_0xa103('0xd'),_0x30fc7e,_0x4575a3[_0xa103('0x11')][_0xa103('0x13')]);return _0x508a8a(_0x4575a3[_0xa103('0x11')][_0xa103('0x13')]);}logger[_0xa103('0x11')](_0xa103('0xd'),_0x30fc7e,_0x4575a3[_0xa103('0x11')]['message']);return _0x544694(_0x4575a3[_0xa103('0x11')][_0xa103('0x13')]);}else{logger[_0xa103('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x30fc7e,_0xa103('0xe'));_0x544694(_0x4575a3[_0xa103('0x14')]['message']);}})['catch'](function(_0x59b79b){logger[_0xa103('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x30fc7e,_0x59b79b);_0x508a8a(_0x59b79b);});});}exports[_0xa103('0x15')]=function(_0x570dc0){var _0x134cd9=this;return new Promise(function(_0x6f0be2,_0x30caa9){return db[_0xa103('0x16')][_0xa103('0x17')](_0x570dc0[_0xa103('0x18')],{'raw':_0x570dc0[_0xa103('0x19')]?_0x570dc0[_0xa103('0x19')][_0xa103('0x1a')]===undefined?!![]:![]:!![]})[_0xa103('0xb')](function(_0x4c5253){logger[_0xa103('0xc')](_0xa103('0x15'),_0x570dc0);logger[_0xa103('0x1b')]('CreateReportAgentPreview',_0x570dc0,JSON[_0xa103('0x10')](_0x4c5253));_0x6f0be2(_0x4c5253);})['catch'](function(_0x173c35){logger[_0xa103('0x11')]('CreateReportAgentPreview',_0x173c35['message'],_0x570dc0);_0x30caa9(_0x134cd9[_0xa103('0x11')](0x1f4,_0x173c35[_0xa103('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9b4b8cc..f1b4628 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 _0x7bda=['showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id'];(function(_0x4e9265,_0x3bfe50){var _0x3208c5=function(_0x1f3b06){while(--_0x1f3b06){_0x4e9265['push'](_0x4e9265['shift']());}};_0x3208c5(++_0x3bfe50);}(_0x7bda,0x171));var _0xa7bd=function(_0x28c060,_0x37b89b){_0x28c060=_0x28c060-0x0;var _0x351f0a=_0x7bda[_0x28c060];return _0x351f0a;};'use strict';var multer=require(_0xa7bd('0x0'));var util=require(_0xa7bd('0x1'));var path=require('path');var express=require(_0xa7bd('0x2'));var router=express[_0xa7bd('0x3')]();var auth=require(_0xa7bd('0x4'));var controller=require(_0xa7bd('0x5'));router['get'](_0xa7bd('0x6'),auth[_0xa7bd('0x7')](),controller['voiceChannels']);router[_0xa7bd('0x8')](_0xa7bd('0x9'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0xa')]);router[_0xa7bd('0x8')](_0xa7bd('0xb'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0xc')]);router[_0xa7bd('0x8')]('/voice/queues',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0xd')]);router[_0xa7bd('0x8')](_0xa7bd('0xe'),auth[_0xa7bd('0x7')](),controller['chatQueues']);router['get'](_0xa7bd('0xf'),auth['isAuthenticated'](),controller[_0xa7bd('0x10')]);router[_0xa7bd('0x8')](_0xa7bd('0x11'),auth['isAuthenticated'](),controller[_0xa7bd('0x12')]);router[_0xa7bd('0x8')](_0xa7bd('0x13'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x14')]);router['get'](_0xa7bd('0x15'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x16')]);router[_0xa7bd('0x8')]('/whatsapp/queues',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x17')]);router['get'](_0xa7bd('0x18'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x19')]);router[_0xa7bd('0x8')](_0xa7bd('0x1a'),auth['isAuthenticated'](),controller[_0xa7bd('0x1b')]);router[_0xa7bd('0x8')](_0xa7bd('0x1c'),auth['isAuthenticated'](),controller[_0xa7bd('0x1d')]);router[_0xa7bd('0x8')](_0xa7bd('0x1e'),auth[_0xa7bd('0x7')](),controller['voiceQueuesChannel']);router[_0xa7bd('0x8')](_0xa7bd('0x1f'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x20')]);router['get'](_0xa7bd('0x21'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x22')]);router[_0xa7bd('0x8')](_0xa7bd('0x23'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x24')]);router[_0xa7bd('0x25')]('/voice/queues/:id',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x26')]);router[_0xa7bd('0x8')]('/outbound',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x27')]);router[_0xa7bd('0x8')](_0xa7bd('0x28'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x29')]);router['get'](_0xa7bd('0x2a'),auth['isAuthenticated'](),controller['agents']);router['put'](_0xa7bd('0x2b'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x2c')]);router[_0xa7bd('0x8')](_0xa7bd('0x2d'),auth['isAuthenticated'](),controller[_0xa7bd('0x2e')]);router[_0xa7bd('0x8')](_0xa7bd('0x2f'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x30')]);router['get']('/campaigns',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x31')]);router['get'](_0xa7bd('0x32'),auth[_0xa7bd('0x7')](),controller['faxAccounts']);router[_0xa7bd('0x8')]('/chat/queues/waitinginteractions',auth[_0xa7bd('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xa7bd('0x8')](_0xa7bd('0x33'),auth['isAuthenticated'](),controller[_0xa7bd('0x34')]);router[_0xa7bd('0x8')](_0xa7bd('0x35'),auth[_0xa7bd('0x7')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0xa7bd('0x36'),auth[_0xa7bd('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xa7bd('0x8')]('/sms/queues/waitinginteractions',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x37')]);router[_0xa7bd('0x8')](_0xa7bd('0x38'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x39')]);router[_0xa7bd('0x8')](_0xa7bd('0x3a'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3b')]);router['post']('/mail/queues/:id/notify',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3c')]('mail'));router[_0xa7bd('0x8')](_0xa7bd('0x3d'),auth['isAuthenticated'](),controller[_0xa7bd('0x3e')]);router[_0xa7bd('0x3f')](_0xa7bd('0x40'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3c')](_0xa7bd('0x41')));router['get']('/chat/queues/:id',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x42')]);router['post']('/fax/queues/:id/notify',auth[_0xa7bd('0x7')](),controller['queueNotify'](_0xa7bd('0x43')));router[_0xa7bd('0x8')](_0xa7bd('0x44'),auth[_0xa7bd('0x7')](),controller['showFaxQueues']);router[_0xa7bd('0x3f')](_0xa7bd('0x45'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3c')](_0xa7bd('0x46')));router[_0xa7bd('0x8')]('/openchannel/queues/:id',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x47')]);router['post'](_0xa7bd('0x48'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3c')](_0xa7bd('0x49')));router[_0xa7bd('0x3f')]('/whatsapp/queues/:id/notify',auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x3c')]('whatsapp'));router[_0xa7bd('0x8')](_0xa7bd('0x4a'),auth['isAuthenticated'](),controller[_0xa7bd('0x4b')]);router[_0xa7bd('0x8')](_0xa7bd('0x4c'),auth[_0xa7bd('0x7')](),controller[_0xa7bd('0x4d')]);router[_0xa7bd('0x3f')](_0xa7bd('0x4e'),auth['isAuthenticated'](),controller[_0xa7bd('0x4f')]);module[_0xa7bd('0x50')]=router; \ No newline at end of file +var _0xb3ed=['/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','exports','multer','util','path','Router','../../components/auth/service','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0x2b979d,_0x360d76){var _0x4c2a70=function(_0x21ac91){while(--_0x21ac91){_0x2b979d['push'](_0x2b979d['shift']());}};_0x4c2a70(++_0x360d76);}(_0xb3ed,0x194));var _0xdb3e=function(_0xf1be74,_0x4adb4a){_0xf1be74=_0xf1be74-0x0;var _0xf7c62c=_0xb3ed[_0xf1be74];return _0xf7c62c;};'use strict';var multer=require(_0xdb3e('0x0'));var util=require(_0xdb3e('0x1'));var path=require(_0xdb3e('0x2'));var express=require('express');var router=express[_0xdb3e('0x3')]();var auth=require(_0xdb3e('0x4'));var controller=require('./rpc.controller');router[_0xdb3e('0x5')](_0xdb3e('0x6'),auth['isAuthenticated'](),controller[_0xdb3e('0x7')]);router['get'](_0xdb3e('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0xdb3e('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xdb3e('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0xdb3e('0x5')](_0xdb3e('0xa'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0xb')]);router[_0xdb3e('0x5')]('/chat/queues',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0xc')]);router[_0xdb3e('0x5')](_0xdb3e('0xd'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0xe')]);router[_0xdb3e('0x5')]('/mail/accounts',auth[_0xdb3e('0x9')](),controller['mailAccounts']);router[_0xdb3e('0x5')](_0xdb3e('0xf'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0xdb3e('0x5')](_0xdb3e('0x10'),auth['isAuthenticated'](),controller[_0xdb3e('0x11')]);router[_0xdb3e('0x5')]('/whatsapp/queues',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x12')]);router['get'](_0xdb3e('0x13'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x14')]);router[_0xdb3e('0x5')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xdb3e('0x15')]);router[_0xdb3e('0x5')](_0xdb3e('0x16'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xdb3e('0x5')](_0xdb3e('0x17'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x18')]);router[_0xdb3e('0x5')](_0xdb3e('0x19'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x1a')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x1b')]);router[_0xdb3e('0x5')](_0xdb3e('0x1c'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x1d')]);router[_0xdb3e('0x1e')](_0xdb3e('0x1c'),auth['isAuthenticated'](),controller[_0xdb3e('0x1f')]);router['get'](_0xdb3e('0x20'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x21')]);router[_0xdb3e('0x5')](_0xdb3e('0x22'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x23')]);router[_0xdb3e('0x5')](_0xdb3e('0x24'),auth['isAuthenticated'](),controller[_0xdb3e('0x25')]);router['put'](_0xdb3e('0x26'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x27')]);router['get']('/telephones',auth[_0xdb3e('0x9')](),controller['telephones']);router[_0xdb3e('0x5')](_0xdb3e('0x28'),auth['isAuthenticated'](),controller['trunks']);router['get'](_0xdb3e('0x29'),auth[_0xdb3e('0x9')](),controller['campaigns']);router[_0xdb3e('0x5')](_0xdb3e('0x2a'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x2b')]);router[_0xdb3e('0x5')](_0xdb3e('0x2c'),auth[_0xdb3e('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xdb3e('0x5')](_0xdb3e('0x2d'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x2e')]);router[_0xdb3e('0x5')](_0xdb3e('0x2f'),auth['isAuthenticated'](),controller[_0xdb3e('0x30')]);router[_0xdb3e('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x31')]);router['get'](_0xdb3e('0x32'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x33')]);router[_0xdb3e('0x5')](_0xdb3e('0x34'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0xdb3e('0x5')](_0xdb3e('0x35'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x36')]);router[_0xdb3e('0x37')](_0xdb3e('0x38'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')](_0xdb3e('0x3a')));router['get'](_0xdb3e('0x3b'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x3c')]);router['post'](_0xdb3e('0x3d'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')]('chat'));router[_0xdb3e('0x5')](_0xdb3e('0x3e'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x3f')]);router['post']('/fax/queues/:id/notify',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')](_0xdb3e('0x40')));router[_0xdb3e('0x5')](_0xdb3e('0x41'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xdb3e('0x37')](_0xdb3e('0x42'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')](_0xdb3e('0x43')));router[_0xdb3e('0x5')]('/openchannel/queues/:id',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x44')]);router['post']('/sms/queues/:id/notify',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')](_0xdb3e('0x45')));router[_0xdb3e('0x37')]('/whatsapp/queues/:id/notify',auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x39')](_0xdb3e('0x46')));router[_0xdb3e('0x5')](_0xdb3e('0x47'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x48')]);router[_0xdb3e('0x5')](_0xdb3e('0x49'),auth[_0xdb3e('0x9')](),controller[_0xdb3e('0x4a')]);router['post']('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module[_0xdb3e('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 0d04c58..0efccc5 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 _0x3e74=['http','client','then','error','code','message','result','sendStatus','stack','name','status','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','jayson/promise'];(function(_0x17e4c4,_0x12b0a0){var _0x3bd26b=function(_0x36d7eb){while(--_0x36d7eb){_0x17e4c4['push'](_0x17e4c4['shift']());}};_0x3bd26b(++_0x12b0a0);}(_0x3e74,0x175));var _0x43e7=function(_0x18835c,_0x48a4ee){_0x18835c=_0x18835c-0x0;var _0x4efd7f=_0x3e74[_0x18835c];return _0x4efd7f;};'use strict';var BPromise=require(_0x43e7('0x0'));var moment=require('moment');var _=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var db=require(_0x43e7('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x43e7('0x4'));var amiClient=jayson['client'][_0x43e7('0x5')]({'port':0x232a});var mailClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232b});var routingClient=jayson[_0x43e7('0x6')][_0x43e7('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){var _0x21f491=_0x3491d6?_0x3491d6:amiClient;return _0x21f491['request'](_0x503698,_0x45a0d1)[_0x43e7('0x7')](function(_0x554d44){if(_0x554d44['error']){if(_0x554d44[_0x43e7('0x8')][_0x43e7('0x9')]===0x1f4){return _0x8528fc(_0x554d44['error'][_0x43e7('0xa')]);}return _0x2ede2d(_0x554d44['error'][_0x43e7('0xa')]);}else{_0x2ede2d(_0x554d44[_0x43e7('0xb')]);}})['catch'](function(_0x3eb206){_0x8528fc(_0x3eb206);});});}function respondWithResult(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xc8;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['status'](_0x2718d3)['json'](_0x3bb83f);}return _0xc960ea[_0x43e7('0xc')](0x194);};}function handleError(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0x1f4;return function(_0x51b974){logger['error'](_0x51b974[_0x43e7('0xd')]);if(_0x51b974[_0x43e7('0xe')]){delete _0x51b974[_0x43e7('0xe')];}_0x21fdd3[_0x43e7('0xf')](_0x44b0bd)['send'](_0x51b974);};}function findById(_0x5c4eaa){return function(_0xdf16c){if(!_[_0x43e7('0x10')](_0x5c4eaa)&&!_[_0x43e7('0x10')](_0xdf16c)&&!_['isNil'](_0xdf16c['rows'])){return _[_0x43e7('0x11')](_0xdf16c[_0x43e7('0x12')],function(_0x9037d3){return _0x9037d3['id']==_0x5c4eaa;});}return null;};}exports[_0x43e7('0x13')]=function(_0x3776f5,_0x1f24fb){return respondWithRpcPromise(_0x43e7('0x14'),_0x3776f5[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x1f24fb,null))[_0x43e7('0x16')](handleError(_0x1f24fb,null));};exports[_0x43e7('0x17')]=function(_0x177ee1,_0x4b5d64){return respondWithRpcPromise(_0x43e7('0x18'),_[_0x43e7('0x19')](_0x177ee1['query'],_0x177ee1[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4b5d64,null))[_0x43e7('0x16')](handleError(_0x4b5d64,null));};exports[_0x43e7('0x1b')]=function(_0x4077fb,_0x2f4cb4){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x43e7('0x19')](_0x4077fb['query'],_0x4077fb['params']))[_0x43e7('0x7')](respondWithResult(_0x2f4cb4,null))[_0x43e7('0x16')](handleError(_0x2f4cb4,null));};exports['voiceQueues']=function(_0x1f0673,_0x4ca5cf){return respondWithRpcPromise(_0x43e7('0x1c'),_0x1f0673['query'])[_0x43e7('0x7')](respondWithResult(_0x4ca5cf,null))[_0x43e7('0x16')](handleError(_0x4ca5cf,null));};exports[_0x43e7('0x1d')]=function(_0x405f85,_0x51f4d7){return respondWithRpcPromise('VoiceQueues',_0x405f85[_0x43e7('0x15')])['then'](findById(_0x405f85[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x51f4d7,null))[_0x43e7('0x16')](handleError(_0x51f4d7,null));};exports[_0x43e7('0x1e')]=function(_0x5087d7,_0x33a1a5){return respondWithRpcPromise(_0x43e7('0x1f'),_[_0x43e7('0x19')](_0x5087d7[_0x43e7('0x20')],_0x5087d7[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x33a1a5,null))[_0x43e7('0x16')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x21')]=function(_0x3bf475,_0x35dbcd){return respondWithRpcPromise(_0x43e7('0x22'),_[_0x43e7('0x19')](_0x3bf475[_0x43e7('0x15')],_0x3bf475[_0x43e7('0x1a')]))['then'](respondWithResult(_0x35dbcd,null))[_0x43e7('0x16')](handleError(_0x35dbcd,null));};exports[_0x43e7('0x23')]=function(_0x3b8f78,_0x183c81){return respondWithRpcPromise(_0x43e7('0x24'),_0x3b8f78['query'])[_0x43e7('0x7')](respondWithResult(_0x183c81,null))[_0x43e7('0x16')](handleError(_0x183c81,null));};exports[_0x43e7('0x25')]=function(_0x3f280d,_0x4c61b9){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x3f280d[_0x43e7('0x15')],_0x3f280d[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x4c61b9,null))[_0x43e7('0x16')](handleError(_0x4c61b9,null));};exports[_0x43e7('0x26')]=function(_0xde7ed,_0x485c6c){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0xde7ed['query'],_0xde7ed['params']))['then'](respondWithResult(_0x485c6c,null))['catch'](handleError(_0x485c6c,null));};exports[_0x43e7('0x27')]=function(_0x49cda6,_0x2b4bfd){return respondWithRpcPromise(_0x43e7('0x28'),_[_0x43e7('0x19')](_0x49cda6[_0x43e7('0x15')],_0x49cda6[_0x43e7('0x1a')]))[_0x43e7('0x7')](respondWithResult(_0x2b4bfd,null))[_0x43e7('0x16')](handleError(_0x2b4bfd,null));};exports['outbound']=function(_0x5332d9,_0x5d84f4){return respondWithRpcPromise(_0x43e7('0x29'),_0x5332d9[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x5d84f4,null))[_0x43e7('0x16')](handleError(_0x5d84f4,null));};exports[_0x43e7('0x2a')]=function(_0x1ed538,_0x1d4589){return respondWithRpcPromise(_0x43e7('0x2b'),_0x1ed538['query'])[_0x43e7('0x7')](respondWithResult(_0x1d4589,null))[_0x43e7('0x16')](handleError(_0x1d4589,null));};exports['agents']=function(_0x2d54c1,_0x4c0c7a){var _0x44d8e4;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1[_0x43e7('0x15')])[_0x43e7('0x7')](function(_0x35ac85){_0x44d8e4=_0x35ac85;return respondWithRpcPromise(_0x43e7('0x2c'),_0x2d54c1['query'],routingClient);})['then'](function(_0x30dfa9){return _[_0x43e7('0x19')]({},_0x30dfa9,_0x44d8e4);})[_0x43e7('0x7')](respondWithResult(_0x4c0c7a,null))[_0x43e7('0x16')](handleError(_0x4c0c7a,null));};exports[_0x43e7('0x2d')]=function(_0x4a4a85,_0x32a451){if(_0x4a4a85[_0x43e7('0x20')]&&_0x4a4a85['body'][_0x43e7('0x2e')]&&_0x4a4a85['user']&&_0x4a4a85[_0x43e7('0x2f')]['name']){for(var _0x3d81ae in _0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')]){if(_0x4a4a85[_0x43e7('0x20')]['interaction']['hasOwnProperty'](_0x3d81ae)){db[_0x43e7('0x30')][_0x43e7('0x31')]({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae]&&_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x43e7('0x32')]?{'$notIn':_0x4a4a85['body']['interaction'][_0x3d81ae]}:{'$ne':null}}})[_0x43e7('0x7')](function(_0x5ee1c5){var _0x2de14f=moment()[_0x43e7('0x33')](_0x43e7('0x34'));for(var _0x99b9e1=0x0,_0x4fc5e8=_0x5ee1c5[_0x43e7('0x32')];_0x99b9e1<_0x4fc5e8;_0x99b9e1+=0x1){_0x5ee1c5[_0x99b9e1][_0x43e7('0x35')]({'exitAt':_0x2de14f});}});for(var _0x23a611=0x0;_0x23a611<_0x4a4a85[_0x43e7('0x20')][_0x43e7('0x2e')][_0x3d81ae][_0x43e7('0x32')];_0x23a611+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x3d81ae,'membername':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0xe')],'type':_0x43e7('0x36'),'uniqueid':_0x4a4a85['body']['interaction'][_0x3d81ae][_0x23a611],'exitAt':null},'defaults':{'channel':_0x3d81ae,'membername':_0x4a4a85['user'][_0x43e7('0xe')],'interface':_[_0x43e7('0x10')](_0x4a4a85['user'][_0x43e7('0x37')])?util[_0x43e7('0x33')](_0x43e7('0x38'),_0x4a4a85['user']['name']):_0x4a4a85['user']['interface'],'type':_0x43e7('0x36'),'enterAt':moment()[_0x43e7('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x43e7('0x39'),'internal':_0x4a4a85[_0x43e7('0x2f')][_0x43e7('0x3a')],'uniqueid':_0x4a4a85[_0x43e7('0x20')]['interaction'][_0x3d81ae][_0x23a611]}});}}}}return respondWithRpcPromise(_0x43e7('0x3b'),{'id':_0x4a4a85['params']['id'],'capacity':_0x4a4a85['body'][_0x43e7('0x3c')]},routingClient)[_0x43e7('0x7')](respondWithResult(_0x32a451,null))[_0x43e7('0x16')](handleError(_0x32a451,null));};exports[_0x43e7('0x3d')]=function(_0x13503c,_0x2351cf){return respondWithRpcPromise(_0x43e7('0x3e'),_0x13503c[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x2351cf,null))[_0x43e7('0x16')](handleError(_0x2351cf,null));};exports['trunks']=function(_0x119d34,_0x46c910){return respondWithRpcPromise('Trunks',_0x119d34[_0x43e7('0x15')])['then'](respondWithResult(_0x46c910,null))[_0x43e7('0x16')](handleError(_0x46c910,null));};exports[_0x43e7('0x3f')]=function(_0x34e2ec,_0x1f561f){return respondWithRpcPromise(_0x43e7('0x40'),_0x34e2ec['query'])['then'](respondWithResult(_0x1f561f,null))[_0x43e7('0x16')](handleError(_0x1f561f,null));};exports[_0x43e7('0x41')]=function(_0x399942,_0x29c53d){return respondWithRpcPromise(_0x43e7('0x42'),_0x399942[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x29c53d,null))[_0x43e7('0x16')](handleError(_0x29c53d,null));};exports[_0x43e7('0x43')]=function(_0x24e758,_0x312306){return respondWithRpcPromise('ChatQueues',_0x24e758[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x24e758['params']['id']))[_0x43e7('0x7')](respondWithResult(_0x312306,null))[_0x43e7('0x16')](handleError(_0x312306,null));};exports[_0x43e7('0x44')]=function(_0x558d54,_0x5d63c6){return respondWithRpcPromise(_0x43e7('0x45'),_0x558d54[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x5d63c6,null))[_0x43e7('0x16')](handleError(_0x5d63c6,null));};exports['showMailQueues']=function(_0x49a6ce,_0x1fa3f6){return respondWithRpcPromise(_0x43e7('0x45'),_0x49a6ce[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x49a6ce[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1fa3f6,null))[_0x43e7('0x16')](handleError(_0x1fa3f6,null));};exports[_0x43e7('0x46')]=function(_0x4d89bd,_0x20283b){return respondWithRpcPromise(_0x43e7('0x47'),_0x4d89bd[_0x43e7('0x15')],mailClient)['then'](respondWithResult(_0x20283b,null))['catch'](handleError(_0x20283b,null));};exports['openchannelQueues']=function(_0x2ada55,_0x4058ce){return respondWithRpcPromise(_0x43e7('0x48'),_0x2ada55[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x4058ce,null))['catch'](handleError(_0x4058ce,null));};exports[_0x43e7('0x49')]=function(_0x8b50bb,_0x140438){return respondWithRpcPromise(_0x43e7('0x48'),_0x8b50bb['query'],routingClient)[_0x43e7('0x7')](findById(_0x8b50bb[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x140438,null))[_0x43e7('0x16')](handleError(_0x140438,null));};exports[_0x43e7('0x4a')]=function(_0xd41e79,_0x4665db){return respondWithRpcPromise(_0x43e7('0x4b'),_0xd41e79[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x4665db,null))[_0x43e7('0x16')](handleError(_0x4665db,null));};exports['showSmsQueues']=function(_0x5f3824,_0x2b0711){return respondWithRpcPromise('SmsQueues',_0x5f3824['query'],routingClient)['then'](findById(_0x5f3824[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x2b0711,null))['catch'](handleError(_0x2b0711,null));};exports[_0x43e7('0x4c')]=function(_0x135791,_0x1d8438){return respondWithRpcPromise('WhatsappQueues',_0x135791[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x1d8438,null))[_0x43e7('0x16')](handleError(_0x1d8438,null));};exports[_0x43e7('0x4d')]=function(_0x2f43d7,_0x472a19){return respondWithRpcPromise(_0x43e7('0x4e'),_0x2f43d7['query'],routingClient)[_0x43e7('0x7')](findById(_0x2f43d7[_0x43e7('0x1a')]['id']))[_0x43e7('0x7')](respondWithResult(_0x472a19,null))['catch'](handleError(_0x472a19,null));};exports['faxQueues']=function(_0x30377a,_0x5c3ad8){return respondWithRpcPromise('FaxQueues',_0x30377a[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5c3ad8,null))['catch'](handleError(_0x5c3ad8,null));};exports[_0x43e7('0x4f')]=function(_0x28b21d,_0x1e2fed){return respondWithRpcPromise(_0x43e7('0x50'),_0x28b21d[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](findById(_0x28b21d[_0x43e7('0x1a')]['id']))['then'](respondWithResult(_0x1e2fed,null))[_0x43e7('0x16')](handleError(_0x1e2fed,null));};exports[_0x43e7('0x51')]=function(_0x4e5956,_0x418213){return respondWithRpcPromise('FaxAccounts',_0x4e5956[_0x43e7('0x15')])[_0x43e7('0x7')](respondWithResult(_0x418213,null))[_0x43e7('0x16')](handleError(_0x418213,null));};exports[_0x43e7('0x52')]=function(_0x506361,_0x2d25b5){return respondWithRpcPromise(_0x43e7('0x53'),_0x506361[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x2d25b5,null))[_0x43e7('0x16')](handleError(_0x2d25b5,null));};exports[_0x43e7('0x54')]=function(_0x219dc6,_0x703a30){return respondWithRpcPromise(_0x43e7('0x55'),_0x219dc6['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x703a30,null))[_0x43e7('0x16')](handleError(_0x703a30,null));};exports[_0x43e7('0x56')]=function(_0x2499ef,_0x433d3c){return respondWithRpcPromise(_0x43e7('0x57'),_0x2499ef[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x433d3c,null))['catch'](handleError(_0x433d3c,null));};exports[_0x43e7('0x58')]=function(_0x536477,_0x550036){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x536477[_0x43e7('0x15')],routingClient)[_0x43e7('0x7')](function(_0x230fda){if(_0x536477[_0x43e7('0x15')][_0x43e7('0x59')]!==undefined){var _0x1ae0c8=_(_0x230fda['rows'])[_0x43e7('0x5a')]([_0x536477[_0x43e7('0x15')][_0x43e7('0x59')],_0x536477['params']['id']])[_0x43e7('0x5b')](_0x43e7('0x5c'))[_0x43e7('0x5d')]()[_0x43e7('0x5e')]();return _0x230fda[_0x43e7('0x12')][_0x43e7('0x5a')](function(_0x1d4a29){return _0x1ae0c8[_0x43e7('0x5f')](_0x1d4a29['queue_id'])>-0x1;});}else{return _0x230fda['rows']['filter'](function(_0x156074){return _0x156074[_0x43e7('0x5c')]===parseInt(_0x536477['params']['id']);});}})[_0x43e7('0x7')](respondWithResult(_0x550036,null))[_0x43e7('0x16')](handleError(_0x550036,null));};exports[_0x43e7('0x60')]=function(_0x8e60f1,_0x5a5565){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x8e60f1['query'],routingClient)[_0x43e7('0x7')](respondWithResult(_0x5a5565,null))[_0x43e7('0x16')](handleError(_0x5a5565,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x58cbb7,_0x21adf7){return respondWithRpcPromise(_0x43e7('0x61'),_0x58cbb7[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0x21adf7,null))[_0x43e7('0x16')](handleError(_0x21adf7,null));};exports[_0x43e7('0x62')]=function(_0x401654,_0xb04082){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x401654[_0x43e7('0x15')],routingClient)['then'](respondWithResult(_0xb04082,null))[_0x43e7('0x16')](handleError(_0xb04082,null));};exports[_0x43e7('0x63')]=function(_0x24a168){return function(_0x90667c,_0xa7cb2c){var _0x45adef,_0x126133;var _0x5e8d4e=_[_0x43e7('0x64')](_0x24a168);var _0x40257e=_0x24a168===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x5e8d4e+'Queue']['findOne']({'raw':!![],'where':{'id':_0x90667c[_0x43e7('0x1a')]['id']}})['then'](function(_0x240f0d){if(_[_0x43e7('0x10')](_0x240f0d)){throw new Error(_0x5e8d4e+_0x43e7('0x67'));}_0x45adef=_0x240f0d;return db[_0x5e8d4e+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x90667c[_0x43e7('0x20')][_0x43e7('0x6a')]},'include':[{'model':db[_0x5e8d4e+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x5e8d4e+_0x40257e],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x5b3565){if(_[_0x43e7('0x10')](_0x5b3565)){throw new Error(_0x5e8d4e+_0x43e7('0x6d'));}_0x126133=_0x5b3565;return _0x5b3565[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x206e54={'uniqueid':_0x24a168+'.'+_0x126133['id']+'.'+_0x126133['Interaction']['id'],'FromUserId':_0x90667c['user']['id'],'type':_0x43e7('0x6f')};_0x206e54[_0x5e8d4e+_0x43e7('0x70')]=_0x126133['id'];_0x206e54[_0x5e8d4e+'InteractionId']=_0x126133[_0x43e7('0x6b')]['id'];_0x206e54[_0x43e7('0x71')+_0x5e8d4e+_0x40257e+'Id']=_0x126133['Account']['id'];_0x206e54['To'+_0x5e8d4e+'QueueId']=_0x45adef['id'];return db[_0x5e8d4e+_0x43e7('0x72')][_0x43e7('0x73')](_0x206e54);})[_0x43e7('0x7')](function(){return respondWithRpcPromise(_0x43e7('0x74'),{'channel':_0x24a168,'interaction':_0x126133[_0x43e7('0x6b')],'message':_0x126133,'account':_0x126133['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x45adef[_0x43e7('0xe')]+','+(_0x126133[_0x43e7('0x6c')][_0x43e7('0x75')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})['then'](respondWithResult(_0xa7cb2c,null))[_0x43e7('0x16')](handleError(_0xa7cb2c,null));};};exports[_0x43e7('0x77')]=function(_0x1ed590,_0x15ee83){var _0x5bc060,_0x3a4962;if(_[_0x43e7('0x10')](_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')])){throw new Error(_0x43e7('0x79'));}var _0x4ef289=_0x1ed590[_0x43e7('0x20')][_0x43e7('0x78')];var _0x509d8d=_[_0x43e7('0x64')](_0x4ef289);var _0x2ca6fb=_0x4ef289===_0x43e7('0x65')?_0x43e7('0x66'):'Account';return db[_0x43e7('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x1ed590[_0x43e7('0x1a')]['id'],'role':_0x43e7('0x39')}})[_0x43e7('0x7')](function(_0x2614ff){if(_[_0x43e7('0x10')](_0x2614ff)){throw new Error(_0x43e7('0x7b'));}_0x5bc060=_0x2614ff;return db[_0x509d8d+_0x43e7('0x68')][_0x43e7('0x69')]({'where':{'id':_0x1ed590[_0x43e7('0x20')]['messageId']},'include':[{'model':db[_0x509d8d+_0x43e7('0x6b')],'as':_0x43e7('0x6b')},{'model':db[_0x509d8d+_0x2ca6fb],'as':_0x43e7('0x6c')}]});})[_0x43e7('0x7')](function(_0x56593f){if(_['isNil'](_0x56593f)){throw new Error(_0x509d8d+_0x43e7('0x6d'));}_0x3a4962=_0x56593f;return _0x56593f[_0x43e7('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x43e7('0x7')](function(){var _0x4d30f7={'uniqueid':_0x4ef289+'.'+_0x3a4962['id']+'.'+_0x3a4962[_0x43e7('0x6b')]['id'],'FromUserId':_0x1ed590['user']['id'],'type':'queue','ToUserId':_0x5bc060['id']};_0x4d30f7[_0x509d8d+'MessageId']=_0x3a4962['id'];_0x4d30f7[_0x509d8d+_0x43e7('0x7c')]=_0x3a4962['Interaction']['id'];_0x4d30f7[_0x43e7('0x71')+_0x509d8d+_0x2ca6fb+'Id']=_0x3a4962[_0x43e7('0x6c')]['id'];return db[_0x509d8d+_0x43e7('0x72')][_0x43e7('0x73')](_0x4d30f7);})[_0x43e7('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x4ef289,'interaction':_0x3a4962['Interaction'],'message':_0x3a4962,'account':_0x3a4962[_0x43e7('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x43e7('0x39'),'appdata':_0x5bc060['name']+','+(_0x3a4962[_0x43e7('0x6c')][_0x43e7('0x7d')]||0x12c),'interval':_0x43e7('0x76')}]},routingClient);})[_0x43e7('0x7')](respondWithResult(_0x15ee83,null))[_0x43e7('0x16')](handleError(_0x15ee83,null));}; \ No newline at end of file +var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x3fd750,_0x120661){var _0x4f15d9=function(_0x3181b8){while(--_0x3181b8){_0x3fd750['push'](_0x3fd750['shift']());}};_0x4f15d9(++_0x120661);}(_0xa630,0xbe));var _0x0a63=function(_0x1ad741,_0x3933ee){_0x1ad741=_0x1ad741-0x0;var _0x2851a1=_0xa630[_0x1ad741];return _0x2851a1;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a9660bd..6a115e5 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 _0xfb7e=['get','isAuthenticated','index','/:id','/:id/run','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./schedule.controller'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0xfb7e,0x77));var _0xefb7=function(_0x1b6a9a,_0x32f867){_0x1b6a9a=_0x1b6a9a-0x0;var _0x1ecc18=_0xfb7e[_0x1b6a9a];return _0x1ecc18;};'use strict';var multer=require(_0xefb7('0x0'));var util=require(_0xefb7('0x1'));var path=require(_0xefb7('0x2'));var timeout=require(_0xefb7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xefb7('0x4'));var interaction=require(_0xefb7('0x5'));var config=require('../../config/environment');var controller=require(_0xefb7('0x6'));router[_0xefb7('0x7')]('/',auth[_0xefb7('0x8')](),controller[_0xefb7('0x9')]);router['get'](_0xefb7('0xa'),auth[_0xefb7('0x8')](),controller['show']);router[_0xefb7('0x7')](_0xefb7('0xb'),auth[_0xefb7('0x8')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xefb7('0xc')]);router[_0xefb7('0xd')](_0xefb7('0xa'),auth['isAuthenticated'](),controller[_0xefb7('0xe')]);router[_0xefb7('0xf')](_0xefb7('0xa'),auth[_0xefb7('0x8')](),controller[_0xefb7('0x10')]);module[_0xefb7('0x11')]=router; \ No newline at end of file +var _0x5de4=['./schedule.controller','get','isAuthenticated','/:id','show','run','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x3cf458,_0x27a859){var _0x3ba646=function(_0x1e633d){while(--_0x1e633d){_0x3cf458['push'](_0x3cf458['shift']());}};_0x3ba646(++_0x27a859);}(_0x5de4,0xb6));var _0x45de=function(_0x2c455d,_0x4eafd8){_0x2c455d=_0x2c455d-0x0;var _0x4ae72b=_0x5de4[_0x2c455d];return _0x4ae72b;};'use strict';var multer=require(_0x45de('0x0'));var util=require('util');var path=require(_0x45de('0x1'));var timeout=require(_0x45de('0x2'));var express=require(_0x45de('0x3'));var router=express['Router']();var fs_extra=require(_0x45de('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x45de('0x5'));router[_0x45de('0x6')]('/',auth[_0x45de('0x7')](),controller['index']);router[_0x45de('0x6')](_0x45de('0x8'),auth[_0x45de('0x7')](),controller[_0x45de('0x9')]);router[_0x45de('0x6')]('/:id/run',auth[_0x45de('0x7')](),controller[_0x45de('0xa')]);router[_0x45de('0xb')]('/',auth[_0x45de('0x7')](),controller[_0x45de('0xc')]);router['put']('/:id',auth[_0x45de('0x7')](),controller[_0x45de('0xd')]);router[_0x45de('0xe')]('/:id',auth[_0x45de('0x7')](),controller[_0x45de('0xf')]);module[_0x45de('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index fa087e3..8b629dd 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 _0x0e4f=['DATE','INTEGER','ENUM','quarters','months','days','hours','csv','custom','default','BOOLEAN','TEXT','STRING','0\x200\x20*\x20*\x20*'];(function(_0x2a1aac,_0x352a14){var _0x59f577=function(_0x1ba973){while(--_0x1ba973){_0x2a1aac['push'](_0x2a1aac['shift']());}};_0x59f577(++_0x352a14);}(_0x0e4f,0x14e));var _0xf0e4=function(_0x289ec2,_0x5dea8b){_0x289ec2=_0x289ec2-0x0;var _0x3c3709=_0x0e4f[_0x289ec2];return _0x3c3709;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf0e4('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf0e4('0x0')],'allowNull':![],'defaultValue':_0xf0e4('0x1')},'startAt':{'type':Sequelize[_0xf0e4('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf0e4('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf0e4('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf0e4('0x4')]('years',_0xf0e4('0x5'),_0xf0e4('0x6'),'weeks',_0xf0e4('0x7'),_0xf0e4('0x8'),'minutes'),'allowNull':![],'defaultValue':_0xf0e4('0x7')},'output':{'type':Sequelize['ENUM'](_0xf0e4('0x9'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xf0e4('0x9')},'type':{'type':Sequelize['ENUM'](_0xf0e4('0xa'),_0xf0e4('0xb')),'allowNull':![],'defaultValue':_0xf0e4('0xa')},'sendMail':{'type':Sequelize[_0xf0e4('0xc')],'defaultValue':![]},'email':{'type':Sequelize[_0xf0e4('0x0')]},'cc':{'type':Sequelize[_0xf0e4('0xd')]},'bcc':{'type':Sequelize[_0xf0e4('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xf0e4('0xc')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9fd4=['weeks','days','hours','minutes','csv','pdf','xlsx','default','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x6cd910,_0x4222b6){var _0x2989e0=function(_0x3af42e){while(--_0x3af42e){_0x6cd910['push'](_0x6cd910['shift']());}};_0x2989e0(++_0x4222b6);}(_0x9fd4,0x1c3));var _0x49fd=function(_0x118da4,_0x2e192e){_0x118da4=_0x118da4-0x0;var _0x40dfbb=_0x9fd4[_0x118da4];return _0x40dfbb;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'name':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x49fd('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':_0x49fd('0x3')},'startAt':{'type':Sequelize[_0x49fd('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x49fd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x49fd('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x49fd('0x6')](_0x49fd('0x7'),_0x49fd('0x8'),'months',_0x49fd('0x9'),_0x49fd('0xa'),_0x49fd('0xb'),_0x49fd('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x49fd('0x6')](_0x49fd('0xd'),_0x49fd('0xe'),_0x49fd('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x49fd('0x6')]('custom',_0x49fd('0x10')),'allowNull':![],'defaultValue':_0x49fd('0x11')},'sendMail':{'type':Sequelize[_0x49fd('0x12')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x49fd('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x49fd('0x12')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index fcf38cc..be2d608 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 _0x87b5=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','destroy','Scheduler','UserProfileResource','then','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','map','query','filters','model','attributes'];(function(_0x3516bc,_0x33d019){var _0x1d8039=function(_0x1e660b){while(--_0x1e660b){_0x3516bc['push'](_0x3516bc['shift']());}};_0x1d8039(++_0x33d019);}(_0x87b5,0x126));var _0x587b=function(_0x549164,_0x7c943){_0x549164=_0x549164-0x0;var _0x50def4=_0x87b5[_0x549164];return _0x50def4;};'use strict';var emlformat=require(_0x587b('0x0'));var rimraf=require(_0x587b('0x1'));var zipdir=require(_0x587b('0x2'));var jsonpatch=require(_0x587b('0x3'));var rp=require('request-promise');var moment=require(_0x587b('0x4'));var BPromise=require(_0x587b('0x5'));var Mustache=require('mustache');var util=require(_0x587b('0x6'));var path=require(_0x587b('0x7'));var sox=require(_0x587b('0x8'));var csv=require(_0x587b('0x9'));var ejs=require(_0x587b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x587b('0xb'));var squel=require(_0x587b('0xc'));var crypto=require(_0x587b('0xd'));var jsforce=require(_0x587b('0xe'));var deskjs=require(_0x587b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x587b('0x10'));var Papa=require(_0x587b('0x11'));var Redis=require(_0x587b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x587b('0x13'));var as=require(_0x587b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x587b('0x15'))(_0x587b('0x16'));var utils=require(_0x587b('0x17'));var config=require(_0x587b('0x18'));var licenseUtil=require(_0x587b('0x19'));var db=require(_0x587b('0x1a'))['db'];function respondWithStatusCode(_0xf9fb91,_0x396f72){_0x396f72=_0x396f72||0xcc;return function(_0x54f958){if(_0x54f958){return _0xf9fb91[_0x587b('0x1b')](_0x396f72);}return _0xf9fb91[_0x587b('0x1c')](_0x396f72)[_0x587b('0x1d')]();};}function respondWithResult(_0x2bd24f,_0x261a58){_0x261a58=_0x261a58||0xc8;return function(_0x96bff7){if(_0x96bff7){return _0x2bd24f['status'](_0x261a58)[_0x587b('0x1e')](_0x96bff7);}};}function respondWithFilteredResult(_0x5266ac,_0xa71419){return function(_0x52a505){if(_0x52a505){var _0x246514=typeof _0xa71419['offset']==='undefined'&&typeof _0xa71419[_0x587b('0x1f')]===_0x587b('0x20');var _0xccaa2=_0x52a505[_0x587b('0x21')];var _0x4b1eb9=_0x246514?0x0:_0xa71419[_0x587b('0x22')];var _0x53e8fa=_0x246514?_0x52a505['count']:_0xa71419['offset']+_0xa71419['limit'];var _0x1e5cad;if(_0x53e8fa>=_0xccaa2){_0x53e8fa=_0xccaa2;_0x1e5cad=0xc8;}else{_0x1e5cad=0xce;}_0x5266ac['status'](_0x1e5cad);return _0x5266ac[_0x587b('0x23')]('Content-Range',_0x4b1eb9+'-'+_0x53e8fa+'/'+_0xccaa2)[_0x587b('0x1e')](_0x52a505);}return null;};}function patchUpdates(_0x1a729a){return function(_0x4b312e){try{jsonpatch[_0x587b('0x24')](_0x4b312e,_0x1a729a,!![]);}catch(_0x28c11f){return BPromise[_0x587b('0x25')](_0x28c11f);}return _0x4b312e['save']();};}function saveUpdates(_0x292801,_0x47ab8b){return function(_0x384358){if(_0x384358){return _0x384358[_0x587b('0x26')](_0x292801)['then'](function(_0x17bc4f){return _0x17bc4f;});}return null;};}function removeEntity(_0x10c034,_0x11bab7){return function(_0x22e995){if(_0x22e995){return _0x22e995[_0x587b('0x27')]()['then'](function(){var _0x367e68=_0x22e995['get']({'plain':!![]});var _0x5dfd87=_0x587b('0x28');return db[_0x587b('0x29')]['destroy']({'where':{'type':_0x5dfd87,'resourceId':_0x367e68['id']}})[_0x587b('0x2a')](function(){return _0x22e995;});})[_0x587b('0x2a')](function(){_0x10c034[_0x587b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a2c1,_0x3af2ef){return function(_0x2405a8){if(!_0x2405a8){_0x15a2c1['sendStatus'](0x194);}return _0x2405a8;};}function handleError(_0x3c8f14,_0x292cbd){_0x292cbd=_0x292cbd||0x1f4;return function(_0x42b310){logger[_0x587b('0x2b')](_0x42b310[_0x587b('0x2c')]);if(_0x42b310[_0x587b('0x2d')]){delete _0x42b310['name'];}_0x3c8f14[_0x587b('0x1c')](_0x292cbd)[_0x587b('0x2e')](_0x42b310);};}exports[_0x587b('0x2f')]=function(_0x2e1f84,_0x4a2da3){var _0x4573ca={},_0x5a5ce8={},_0x186fa6={'count':0x0,'rows':[]};var _0x1e7e98=_['map'](db[_0x587b('0x30')][_0x587b('0x31')],function(_0x246642){return{'name':_0x246642[_0x587b('0x32')],'type':_0x246642[_0x587b('0x33')][_0x587b('0x34')]};});_0x5a5ce8['model']=_[_0x587b('0x35')](_0x1e7e98,_0x587b('0x2d'));_0x5a5ce8[_0x587b('0x36')]=_['keys'](_0x2e1f84[_0x587b('0x36')]);_0x5a5ce8[_0x587b('0x37')]=_['intersection'](_0x5a5ce8[_0x587b('0x38')],_0x5a5ce8[_0x587b('0x36')]);_0x4573ca[_0x587b('0x39')]=_[_0x587b('0x3a')](_0x5a5ce8['model'],qs[_0x587b('0x3b')](_0x2e1f84[_0x587b('0x36')][_0x587b('0x3b')]));_0x4573ca['attributes']=_0x4573ca['attributes'][_0x587b('0x3c')]?_0x4573ca[_0x587b('0x39')]:_0x5a5ce8['model'];if(!_0x2e1f84[_0x587b('0x36')][_0x587b('0x3d')](_0x587b('0x3e'))){_0x4573ca[_0x587b('0x1f')]=qs['limit'](_0x2e1f84[_0x587b('0x36')]['limit']);_0x4573ca[_0x587b('0x22')]=qs[_0x587b('0x22')](_0x2e1f84[_0x587b('0x36')][_0x587b('0x22')]);}_0x4573ca[_0x587b('0x3f')]=qs[_0x587b('0x40')](_0x2e1f84[_0x587b('0x36')][_0x587b('0x40')]);_0x4573ca[_0x587b('0x41')]=qs[_0x587b('0x37')](_[_0x587b('0x42')](_0x2e1f84[_0x587b('0x36')],_0x5a5ce8['filters']),_0x1e7e98);if(_0x2e1f84[_0x587b('0x36')][_0x587b('0x43')]){_0x4573ca[_0x587b('0x41')]=_[_0x587b('0x44')](_0x4573ca['where'],{'$or':_[_0x587b('0x35')](_0x1e7e98,function(_0x52438a){if(_0x52438a['type']!=='VIRTUAL'){var _0x493755={};_0x493755[_0x52438a['name']]={'$like':'%'+_0x2e1f84[_0x587b('0x36')]['filter']+'%'};return _0x493755;}})});}_0x4573ca=_['merge']({},_0x4573ca,_0x2e1f84[_0x587b('0x45')]);var _0x4589d1={'where':_0x4573ca[_0x587b('0x41')]};return db['Schedule']['count'](_0x4589d1)[_0x587b('0x2a')](function(_0x20eea7){_0x186fa6[_0x587b('0x21')]=_0x20eea7;if(_0x2e1f84['query'][_0x587b('0x46')]){_0x4573ca[_0x587b('0x47')]=[{'all':!![]}];}return db['Schedule'][_0x587b('0x48')](_0x4573ca);})[_0x587b('0x2a')](function(_0x322bd5){_0x186fa6['rows']=_0x322bd5;return _0x186fa6;})[_0x587b('0x2a')](respondWithFilteredResult(_0x4a2da3,_0x4573ca))[_0x587b('0x49')](handleError(_0x4a2da3,null));};exports['show']=function(_0x27e584,_0x58fd10){var _0x33c108={'raw':![],'where':{'id':_0x27e584[_0x587b('0x4a')]['id']}},_0x43dc07={};_0x43dc07[_0x587b('0x38')]=_[_0x587b('0x4b')](db[_0x587b('0x30')][_0x587b('0x31')]);_0x43dc07['query']=_[_0x587b('0x4b')](_0x27e584[_0x587b('0x36')]);_0x43dc07[_0x587b('0x37')]=_[_0x587b('0x3a')](_0x43dc07[_0x587b('0x38')],_0x43dc07[_0x587b('0x36')]);_0x33c108['attributes']=_[_0x587b('0x3a')](_0x43dc07[_0x587b('0x38')],qs[_0x587b('0x3b')](_0x27e584[_0x587b('0x36')]['fields']));_0x33c108[_0x587b('0x39')]=_0x33c108[_0x587b('0x39')][_0x587b('0x3c')]?_0x33c108[_0x587b('0x39')]:_0x43dc07[_0x587b('0x38')];if(_0x27e584[_0x587b('0x36')][_0x587b('0x46')]){_0x33c108[_0x587b('0x47')]=[{'all':!![]}];}_0x33c108=_[_0x587b('0x44')]({},_0x33c108,_0x27e584[_0x587b('0x45')]);return db[_0x587b('0x30')][_0x587b('0x4c')](_0x33c108)[_0x587b('0x2a')](handleEntityNotFound(_0x58fd10,null))[_0x587b('0x2a')](respondWithResult(_0x58fd10,null))[_0x587b('0x49')](handleError(_0x58fd10,null));};exports[_0x587b('0x4d')]=function(_0x34c1ba,_0x1fb4f2){return db[_0x587b('0x30')][_0x587b('0x4d')](_0x34c1ba[_0x587b('0x4e')],{})[_0x587b('0x2a')](function(_0x2c433f){var _0x25c08a=_0x34c1ba['user']['get']({'plain':!![]});if(!_0x25c08a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25c08a[_0x587b('0x4f')]===_0x587b('0x50')){var _0x5c7cd5=_0x2c433f[_0x587b('0x51')]({'plain':!![]});var _0x43807f=_0x587b('0x28');return db[_0x587b('0x52')][_0x587b('0x4c')]({'where':{'name':_0x43807f,'userProfileId':_0x25c08a[_0x587b('0x53')]},'raw':!![]})['then'](function(_0x16ce04){if(_0x16ce04&&_0x16ce04[_0x587b('0x54')]===0x0){return db[_0x587b('0x29')][_0x587b('0x4d')]({'name':_0x5c7cd5['name'],'resourceId':_0x5c7cd5['id'],'type':_0x16ce04['name'],'sectionId':_0x16ce04['id']},{})[_0x587b('0x2a')](function(){return _0x2c433f;});}else{return _0x2c433f;}})[_0x587b('0x49')](function(_0x4dc677){logger['error'](_0x587b('0x55'),_0x4dc677);throw _0x4dc677;});}return _0x2c433f;})[_0x587b('0x2a')](respondWithResult(_0x1fb4f2,0xc9))[_0x587b('0x49')](handleError(_0x1fb4f2,null));};exports[_0x587b('0x26')]=function(_0x1567a4,_0x149446){if(_0x1567a4[_0x587b('0x4e')]['id']){delete _0x1567a4['body']['id'];}return db[_0x587b('0x30')]['find']({'where':{'id':_0x1567a4[_0x587b('0x4a')]['id']}})[_0x587b('0x2a')](handleEntityNotFound(_0x149446,null))[_0x587b('0x2a')](saveUpdates(_0x1567a4['body'],null))[_0x587b('0x2a')](respondWithResult(_0x149446,null))[_0x587b('0x49')](handleError(_0x149446,null));};exports[_0x587b('0x27')]=function(_0x26d856,_0x363483){return db[_0x587b('0x30')][_0x587b('0x4c')]({'where':{'id':_0x26d856[_0x587b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x363483,null))['then'](removeEntity(_0x363483,null))['catch'](handleError(_0x363483,null));};exports[_0x587b('0x56')]=function(_0x591a1b,_0x50ac8a,_0x5895b6){var _0x44c279=require(_0x587b('0x57'));return db[_0x587b('0x30')]['find']({'where':{'id':_0x591a1b[_0x587b('0x4a')]['id']},'raw':!![]})[_0x587b('0x2a')](handleEntityNotFound(_0x50ac8a,null))[_0x587b('0x2a')](function(){_0x44c279[_0x587b('0x56')](_0x591a1b[_0x587b('0x4a')]['id']);})['then'](respondWithStatusCode(_0x50ac8a,null))['catch'](handleError(_0x50ac8a,null));}; \ No newline at end of file +var _0x5e8a=['zip-dir','fast-json-patch','moment','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','Schedule','includeAll','include','findAll','catch','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','run','../../config/schedule','eml-format','rimraf'];(function(_0x48181d,_0x42e154){var _0x514544=function(_0xe69612){while(--_0xe69612){_0x48181d['push'](_0x48181d['shift']());}};_0x514544(++_0x42e154);}(_0x5e8a,0xae));var _0xa5e8=function(_0x1442d7,_0x61d17f){_0x1442d7=_0x1442d7-0x0;var _0x29ce7a=_0x5e8a[_0x1442d7];return _0x29ce7a;};'use strict';var emlformat=require(_0xa5e8('0x0'));var rimraf=require(_0xa5e8('0x1'));var zipdir=require(_0xa5e8('0x2'));var jsonpatch=require(_0xa5e8('0x3'));var rp=require('request-promise');var moment=require(_0xa5e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5e8('0x5'));var sox=require(_0xa5e8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5e8('0x7'));var _=require(_0xa5e8('0x8'));var squel=require('squel');var crypto=require(_0xa5e8('0x9'));var jsforce=require(_0xa5e8('0xa'));var deskjs=require(_0xa5e8('0xb'));var toCsv=require(_0xa5e8('0xc'));var querystring=require(_0xa5e8('0xd'));var Papa=require(_0xa5e8('0xe'));var Redis=require(_0xa5e8('0xf'));var authService=require(_0xa5e8('0x10'));var qs=require(_0xa5e8('0x11'));var as=require(_0xa5e8('0x12'));var hardwareService=require(_0xa5e8('0x13'));var logger=require(_0xa5e8('0x14'))(_0xa5e8('0x15'));var utils=require(_0xa5e8('0x16'));var config=require(_0xa5e8('0x17'));var licenseUtil=require(_0xa5e8('0x18'));var db=require(_0xa5e8('0x19'))['db'];function respondWithStatusCode(_0x1c6d70,_0x10d914){_0x10d914=_0x10d914||0xcc;return function(_0x364223){if(_0x364223){return _0x1c6d70[_0xa5e8('0x1a')](_0x10d914);}return _0x1c6d70[_0xa5e8('0x1b')](_0x10d914)[_0xa5e8('0x1c')]();};}function respondWithResult(_0x5a517c,_0x57b06d){_0x57b06d=_0x57b06d||0xc8;return function(_0x11b049){if(_0x11b049){return _0x5a517c[_0xa5e8('0x1b')](_0x57b06d)[_0xa5e8('0x1d')](_0x11b049);}};}function respondWithFilteredResult(_0x55c0da,_0x90fed2){return function(_0x55bd89){if(_0x55bd89){var _0x14adba=typeof _0x90fed2[_0xa5e8('0x1e')]===_0xa5e8('0x1f')&&typeof _0x90fed2[_0xa5e8('0x20')]===_0xa5e8('0x1f');var _0x18c332=_0x55bd89[_0xa5e8('0x21')];var _0x40da3a=_0x14adba?0x0:_0x90fed2[_0xa5e8('0x1e')];var _0x54d0b7=_0x14adba?_0x55bd89['count']:_0x90fed2[_0xa5e8('0x1e')]+_0x90fed2[_0xa5e8('0x20')];var _0x63e271;if(_0x54d0b7>=_0x18c332){_0x54d0b7=_0x18c332;_0x63e271=0xc8;}else{_0x63e271=0xce;}_0x55c0da['status'](_0x63e271);return _0x55c0da[_0xa5e8('0x22')](_0xa5e8('0x23'),_0x40da3a+'-'+_0x54d0b7+'/'+_0x18c332)[_0xa5e8('0x1d')](_0x55bd89);}return null;};}function patchUpdates(_0x2ecd5e){return function(_0x4fbe41){try{jsonpatch[_0xa5e8('0x24')](_0x4fbe41,_0x2ecd5e,!![]);}catch(_0x5823d9){return BPromise[_0xa5e8('0x25')](_0x5823d9);}return _0x4fbe41[_0xa5e8('0x26')]();};}function saveUpdates(_0x5b6c88,_0x2d928f){return function(_0x14d0a8){if(_0x14d0a8){return _0x14d0a8['update'](_0x5b6c88)['then'](function(_0x22f5bf){return _0x22f5bf;});}return null;};}function removeEntity(_0x1ffff7,_0xf5e038){return function(_0x4c5074){if(_0x4c5074){return _0x4c5074['destroy']()[_0xa5e8('0x27')](function(){var _0x200354=_0x4c5074[_0xa5e8('0x28')]({'plain':!![]});var _0x3250e4='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x3250e4,'resourceId':_0x200354['id']}})[_0xa5e8('0x27')](function(){return _0x4c5074;});})[_0xa5e8('0x27')](function(){_0x1ffff7[_0xa5e8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523778,_0x3a133a){return function(_0x158f3e){if(!_0x158f3e){_0x523778[_0xa5e8('0x1a')](0x194);}return _0x158f3e;};}function handleError(_0x31c8e7,_0x5da3a5){_0x5da3a5=_0x5da3a5||0x1f4;return function(_0x79c0ef){logger[_0xa5e8('0x29')](_0x79c0ef[_0xa5e8('0x2a')]);if(_0x79c0ef[_0xa5e8('0x2b')]){delete _0x79c0ef[_0xa5e8('0x2b')];}_0x31c8e7[_0xa5e8('0x1b')](_0x5da3a5)['send'](_0x79c0ef);};}exports[_0xa5e8('0x2c')]=function(_0x1df324,_0x534817){var _0x4b7db3={},_0x502bd5={},_0x2532ac={'count':0x0,'rows':[]};var _0x41db1d=_[_0xa5e8('0x2d')](db['Schedule'][_0xa5e8('0x2e')],function(_0x259712){return{'name':_0x259712[_0xa5e8('0x2f')],'type':_0x259712[_0xa5e8('0x30')][_0xa5e8('0x31')]};});_0x502bd5['model']=_[_0xa5e8('0x2d')](_0x41db1d,_0xa5e8('0x2b'));_0x502bd5[_0xa5e8('0x32')]=_[_0xa5e8('0x33')](_0x1df324['query']);_0x502bd5[_0xa5e8('0x34')]=_[_0xa5e8('0x35')](_0x502bd5['model'],_0x502bd5[_0xa5e8('0x32')]);_0x4b7db3['attributes']=_['intersection'](_0x502bd5[_0xa5e8('0x36')],qs[_0xa5e8('0x37')](_0x1df324['query']['fields']));_0x4b7db3[_0xa5e8('0x38')]=_0x4b7db3['attributes'][_0xa5e8('0x39')]?_0x4b7db3['attributes']:_0x502bd5[_0xa5e8('0x36')];if(!_0x1df324[_0xa5e8('0x32')][_0xa5e8('0x3a')]('nolimit')){_0x4b7db3['limit']=qs[_0xa5e8('0x20')](_0x1df324[_0xa5e8('0x32')][_0xa5e8('0x20')]);_0x4b7db3[_0xa5e8('0x1e')]=qs[_0xa5e8('0x1e')](_0x1df324[_0xa5e8('0x32')]['offset']);}_0x4b7db3[_0xa5e8('0x3b')]=qs['sort'](_0x1df324['query'][_0xa5e8('0x3c')]);_0x4b7db3['where']=qs[_0xa5e8('0x34')](_[_0xa5e8('0x3d')](_0x1df324[_0xa5e8('0x32')],_0x502bd5[_0xa5e8('0x34')]),_0x41db1d);if(_0x1df324['query'][_0xa5e8('0x3e')]){_0x4b7db3[_0xa5e8('0x3f')]=_[_0xa5e8('0x40')](_0x4b7db3[_0xa5e8('0x3f')],{'$or':_[_0xa5e8('0x2d')](_0x41db1d,function(_0x9d5559){if(_0x9d5559['type']!==_0xa5e8('0x41')){var _0x1c3ffe={};_0x1c3ffe[_0x9d5559[_0xa5e8('0x2b')]]={'$like':'%'+_0x1df324[_0xa5e8('0x32')][_0xa5e8('0x3e')]+'%'};return _0x1c3ffe;}})});}_0x4b7db3=_['merge']({},_0x4b7db3,_0x1df324['options']);var _0x2caf00={'where':_0x4b7db3[_0xa5e8('0x3f')]};return db[_0xa5e8('0x42')]['count'](_0x2caf00)[_0xa5e8('0x27')](function(_0x5af5de){_0x2532ac[_0xa5e8('0x21')]=_0x5af5de;if(_0x1df324[_0xa5e8('0x32')][_0xa5e8('0x43')]){_0x4b7db3[_0xa5e8('0x44')]=[{'all':!![]}];}return db[_0xa5e8('0x42')][_0xa5e8('0x45')](_0x4b7db3);})[_0xa5e8('0x27')](function(_0x5dddb9){_0x2532ac['rows']=_0x5dddb9;return _0x2532ac;})[_0xa5e8('0x27')](respondWithFilteredResult(_0x534817,_0x4b7db3))[_0xa5e8('0x46')](handleError(_0x534817,null));};exports['show']=function(_0x27292b,_0x40ffa5){var _0x1e2cdb={'raw':![],'where':{'id':_0x27292b['params']['id']}},_0x56706b={};_0x56706b[_0xa5e8('0x36')]=_['keys'](db[_0xa5e8('0x42')][_0xa5e8('0x2e')]);_0x56706b[_0xa5e8('0x32')]=_[_0xa5e8('0x33')](_0x27292b[_0xa5e8('0x32')]);_0x56706b[_0xa5e8('0x34')]=_[_0xa5e8('0x35')](_0x56706b[_0xa5e8('0x36')],_0x56706b[_0xa5e8('0x32')]);_0x1e2cdb[_0xa5e8('0x38')]=_[_0xa5e8('0x35')](_0x56706b[_0xa5e8('0x36')],qs[_0xa5e8('0x37')](_0x27292b['query']['fields']));_0x1e2cdb[_0xa5e8('0x38')]=_0x1e2cdb['attributes'][_0xa5e8('0x39')]?_0x1e2cdb[_0xa5e8('0x38')]:_0x56706b[_0xa5e8('0x36')];if(_0x27292b[_0xa5e8('0x32')][_0xa5e8('0x43')]){_0x1e2cdb[_0xa5e8('0x44')]=[{'all':!![]}];}_0x1e2cdb=_[_0xa5e8('0x40')]({},_0x1e2cdb,_0x27292b[_0xa5e8('0x47')]);return db[_0xa5e8('0x42')][_0xa5e8('0x48')](_0x1e2cdb)[_0xa5e8('0x27')](handleEntityNotFound(_0x40ffa5,null))['then'](respondWithResult(_0x40ffa5,null))['catch'](handleError(_0x40ffa5,null));};exports['create']=function(_0x245ce0,_0xebd899){return db[_0xa5e8('0x42')][_0xa5e8('0x49')](_0x245ce0[_0xa5e8('0x4a')],{})[_0xa5e8('0x27')](function(_0x5e30c3){var _0x5d9dd2=_0x245ce0[_0xa5e8('0x4b')][_0xa5e8('0x28')]({'plain':!![]});if(!_0x5d9dd2)throw new Error(_0xa5e8('0x4c'));if(_0x5d9dd2[_0xa5e8('0x4d')]==='user'){var _0x87427d=_0x5e30c3[_0xa5e8('0x28')]({'plain':!![]});var _0x48605d=_0xa5e8('0x4e');return db[_0xa5e8('0x4f')][_0xa5e8('0x48')]({'where':{'name':_0x48605d,'userProfileId':_0x5d9dd2[_0xa5e8('0x50')]},'raw':!![]})[_0xa5e8('0x27')](function(_0x250529){if(_0x250529&&_0x250529[_0xa5e8('0x51')]===0x0){return db[_0xa5e8('0x52')]['create']({'name':_0x87427d[_0xa5e8('0x2b')],'resourceId':_0x87427d['id'],'type':_0x250529[_0xa5e8('0x2b')],'sectionId':_0x250529['id']},{})[_0xa5e8('0x27')](function(){return _0x5e30c3;});}else{return _0x5e30c3;}})[_0xa5e8('0x46')](function(_0x5a2c6b){logger['error'](_0xa5e8('0x53'),_0x5a2c6b);throw _0x5a2c6b;});}return _0x5e30c3;})[_0xa5e8('0x27')](respondWithResult(_0xebd899,0xc9))['catch'](handleError(_0xebd899,null));};exports['update']=function(_0xc1ec1f,_0x4a4083){if(_0xc1ec1f[_0xa5e8('0x4a')]['id']){delete _0xc1ec1f[_0xa5e8('0x4a')]['id'];}return db[_0xa5e8('0x42')]['find']({'where':{'id':_0xc1ec1f[_0xa5e8('0x54')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x4a4083,null))[_0xa5e8('0x27')](saveUpdates(_0xc1ec1f['body'],null))[_0xa5e8('0x27')](respondWithResult(_0x4a4083,null))[_0xa5e8('0x46')](handleError(_0x4a4083,null));};exports[_0xa5e8('0x55')]=function(_0x1f15e1,_0x408de2){return db['Schedule'][_0xa5e8('0x48')]({'where':{'id':_0x1f15e1[_0xa5e8('0x54')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x408de2,null))[_0xa5e8('0x27')](removeEntity(_0x408de2,null))['catch'](handleError(_0x408de2,null));};exports[_0xa5e8('0x56')]=function(_0x309e3c,_0x152845,_0x5f3e2b){var _0x4da6fc=require(_0xa5e8('0x57'));return db[_0xa5e8('0x42')][_0xa5e8('0x48')]({'where':{'id':_0x309e3c[_0xa5e8('0x54')]['id']},'raw':!![]})[_0xa5e8('0x27')](handleEntityNotFound(_0x152845,null))[_0xa5e8('0x27')](function(){_0x4da6fc['run'](_0x309e3c[_0xa5e8('0x54')]['id']);})[_0xa5e8('0x27')](respondWithStatusCode(_0x152845,null))['catch'](handleError(_0x152845,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 87e19c7..d584a78 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 _0x18fc=['util','../../config/logger','moment','request-promise','rimraf','define','Schedule','tools_schedules','lodash'];(function(_0x2561b8,_0x30cd26){var _0x49103a=function(_0x16a5e5){while(--_0x16a5e5){_0x2561b8['push'](_0x2561b8['shift']());}};_0x49103a(++_0x30cd26);}(_0x18fc,0xaa));var _0xc18f=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x18fc[_0x3de7e0];return _0x11d0b3;};'use strict';var _=require(_0xc18f('0x0'));var util=require(_0xc18f('0x1'));var logger=require(_0xc18f('0x2'))('api');var moment=require(_0xc18f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc18f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc18f('0x5'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x51a524,_0x110bb0){return _0x51a524[_0xc18f('0x6')](_0xc18f('0x7'),attributes,{'tableName':_0xc18f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c31=['Schedule','lodash','util','api','moment','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0xc2c1c6,_0x40e6ca){var _0xef8905=function(_0x4f8ec1){while(--_0x4f8ec1){_0xc2c1c6['push'](_0xc2c1c6['shift']());}};_0xef8905(++_0x40e6ca);}(_0x2c31,0x17d));var _0x12c3=function(_0x13f560,_0x2c9aaf){_0x13f560=_0x13f560-0x0;var _0x428445=_0x2c31[_0x13f560];return _0x428445;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require('../../config/logger')(_0x12c3('0x2'));var moment=require(_0x12c3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x12c3('0x4'));var rimraf=require(_0x12c3('0x5'));var config=require(_0x12c3('0x6'));var attributes=require(_0x12c3('0x7'));module[_0x12c3('0x8')]=function(_0x5242b8,_0x190136){return _0x5242b8['define'](_0x12c3('0x9'),attributes,{'tableName':'tools_schedules','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 3f32efc..c4a0d70 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 _0xdbf7=['debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x48a9df,_0x1a9f0a){var _0x2ba41e=function(_0x347e90){while(--_0x347e90){_0x48a9df['push'](_0x48a9df['shift']());}};_0x2ba41e(++_0x1a9f0a);}(_0xdbf7,0x1ec));var _0x7dbf=function(_0x4c5a52,_0x59ef62){_0x4c5a52=_0x4c5a52-0x0;var _0x5b40f5=_0xdbf7[_0x4c5a52];return _0x5b40f5;};'use strict';var _=require(_0x7dbf('0x0'));var util=require('util');var moment=require(_0x7dbf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dbf('0x2'));var db=require(_0x7dbf('0x3'))['db'];var utils=require(_0x7dbf('0x4'));var logger=require(_0x7dbf('0x5'))(_0x7dbf('0x6'));var config=require(_0x7dbf('0x7'));var jayson=require(_0x7dbf('0x8'));var client=jayson[_0x7dbf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22ddc3,_0x9ea2bc,_0x40034e){return new BPromise(function(_0x235ec6,_0x2e8155){return client[_0x7dbf('0xa')](_0x22ddc3,_0x40034e)[_0x7dbf('0xb')](function(_0x366077){logger['info'](_0x7dbf('0xc'),_0x9ea2bc,_0x7dbf('0xd'));logger[_0x7dbf('0xe')](_0x7dbf('0xf'),_0x9ea2bc,_0x7dbf('0xd'),JSON['stringify'](_0x366077));if(_0x366077[_0x7dbf('0x10')]){if(_0x366077[_0x7dbf('0x10')][_0x7dbf('0x11')]===0x1f4){logger[_0x7dbf('0x10')]('Schedule,\x20%s,\x20%s',_0x9ea2bc,_0x366077[_0x7dbf('0x10')][_0x7dbf('0x12')]);return _0x2e8155(_0x366077['error'][_0x7dbf('0x12')]);}logger['error'](_0x7dbf('0xc'),_0x9ea2bc,_0x366077[_0x7dbf('0x10')][_0x7dbf('0x12')]);return _0x235ec6(_0x366077[_0x7dbf('0x10')][_0x7dbf('0x12')]);}else{logger[_0x7dbf('0x13')](_0x7dbf('0xc'),_0x9ea2bc,_0x7dbf('0xd'));_0x235ec6(_0x366077[_0x7dbf('0x14')][_0x7dbf('0x12')]);}})[_0x7dbf('0x15')](function(_0x2fd542){logger['error'](_0x7dbf('0xc'),_0x9ea2bc,_0x2fd542);_0x2e8155(_0x2fd542);});});} \ No newline at end of file +var _0xbb24=['Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0xbb24,0xfa));var _0x4bb2=function(_0x299e41,_0x17c450){_0x299e41=_0x299e41-0x0;var _0x246734=_0xbb24[_0x299e41];return _0x246734;};'use strict';var _=require(_0x4bb2('0x0'));var util=require(_0x4bb2('0x1'));var moment=require('moment');var BPromise=require(_0x4bb2('0x2'));var rs=require(_0x4bb2('0x3'));var fs=require('fs');var Redis=require(_0x4bb2('0x4'));var db=require(_0x4bb2('0x5'))['db'];var utils=require(_0x4bb2('0x6'));var logger=require(_0x4bb2('0x7'))(_0x4bb2('0x8'));var config=require(_0x4bb2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4bb2('0xa')][_0x4bb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d2659,_0x468a12,_0xf2f33c){return new BPromise(function(_0x499949,_0x327b38){return client['request'](_0x5d2659,_0xf2f33c)[_0x4bb2('0xc')](function(_0x25c841){logger[_0x4bb2('0xd')](_0x4bb2('0xe'),_0x468a12,'request\x20sent');logger['debug'](_0x4bb2('0xf'),_0x468a12,'request\x20sent',JSON[_0x4bb2('0x10')](_0x25c841));if(_0x25c841[_0x4bb2('0x11')]){if(_0x25c841[_0x4bb2('0x11')]['code']===0x1f4){logger['error'](_0x4bb2('0xe'),_0x468a12,_0x25c841['error'][_0x4bb2('0x12')]);return _0x327b38(_0x25c841[_0x4bb2('0x11')][_0x4bb2('0x12')]);}logger[_0x4bb2('0x11')]('Schedule,\x20%s,\x20%s',_0x468a12,_0x25c841[_0x4bb2('0x11')][_0x4bb2('0x12')]);return _0x499949(_0x25c841[_0x4bb2('0x11')][_0x4bb2('0x12')]);}else{logger[_0x4bb2('0xd')](_0x4bb2('0xe'),_0x468a12,_0x4bb2('0x13'));_0x499949(_0x25c841[_0x4bb2('0x14')][_0x4bb2('0x12')]);}})[_0x4bb2('0x15')](function(_0x4e79d4){logger['error'](_0x4bb2('0xe'),_0x468a12,_0x4e79d4);_0x327b38(_0x4e79d4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 3d77a90..2bac15f 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 _0xd113=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','put','update','delete','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x37d37d,_0x185b97){var _0x821309=function(_0x42d7f7){while(--_0x42d7f7){_0x37d37d['push'](_0x37d37d['shift']());}};_0x821309(++_0x185b97);}(_0xd113,0xb8));var _0x3d11=function(_0x1414fe,_0x2ce4a4){_0x1414fe=_0x1414fe-0x0;var _0x47f599=_0xd113[_0x1414fe];return _0x47f599;};'use strict';var multer=require('multer');var util=require(_0x3d11('0x0'));var path=require(_0x3d11('0x1'));var timeout=require(_0x3d11('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3d11('0x3'));var config=require(_0x3d11('0x4'));var controller=require(_0x3d11('0x5'));router[_0x3d11('0x6')]('/',auth[_0x3d11('0x7')](),controller[_0x3d11('0x8')]);router[_0x3d11('0x6')](_0x3d11('0x9'),auth[_0x3d11('0x7')](),controller[_0x3d11('0xa')]);router['get'](_0x3d11('0xb'),auth[_0x3d11('0x7')](),controller[_0x3d11('0xc')]);router['get'](_0x3d11('0xd'),auth[_0x3d11('0x7')](),controller['download']);router[_0x3d11('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d11('0xf')](_0x3d11('0xb'),auth[_0x3d11('0x7')](),controller[_0x3d11('0x10')]);router[_0x3d11('0x11')](_0x3d11('0xb'),auth[_0x3d11('0x7')](),controller['destroy']);module[_0x3d11('0x12')]=router; \ No newline at end of file +var _0xc7da=['update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id'];(function(_0x5e3856,_0x41ee77){var _0x266830=function(_0x57c401){while(--_0x57c401){_0x5e3856['push'](_0x5e3856['shift']());}};_0x266830(++_0x41ee77);}(_0xc7da,0x81));var _0xac7d=function(_0xb184ff,_0x50fe54){_0xb184ff=_0xb184ff-0x0;var _0x474c15=_0xc7da[_0xb184ff];return _0x474c15;};'use strict';var multer=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var path=require(_0xac7d('0x2'));var timeout=require('connect-timeout');var express=require(_0xac7d('0x3'));var router=express[_0xac7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xac7d('0x5'));var interaction=require(_0xac7d('0x6'));var config=require(_0xac7d('0x7'));var controller=require(_0xac7d('0x8'));router[_0xac7d('0x9')]('/',auth[_0xac7d('0xa')](),controller[_0xac7d('0xb')]);router[_0xac7d('0x9')]('/describe',auth[_0xac7d('0xa')](),controller['describe']);router['get']('/:id',auth[_0xac7d('0xa')](),controller[_0xac7d('0xc')]);router['get'](_0xac7d('0xd'),auth[_0xac7d('0xa')](),controller[_0xac7d('0xe')]);router[_0xac7d('0xf')]('/',auth[_0xac7d('0xa')](),controller['create']);router[_0xac7d('0x10')](_0xac7d('0x11'),auth[_0xac7d('0xa')](),controller[_0xac7d('0x12')]);router[_0xac7d('0x13')](_0xac7d('0x11'),auth[_0xac7d('0xa')](),controller['destroy']);module[_0xac7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 531b211..d2a3d12 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 _0x7096=['closedAt','updatedAt','moment','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x7096,0x10c));var _0x6709=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7096[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6709('0x0'));var path=require('path');var config=require(_0x6709('0x1'));module['exports']={'format':{'type':Sequelize[_0x6709('0x2')],'get':function(){return this[_0x6709('0x3')](_0x6709('0x4'))?path[_0x6709('0x5')](this[_0x6709('0x3')](_0x6709('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x6709('0x6')]},'channel':{'type':Sequelize[_0x6709('0x6')]},'value':{'type':Sequelize[_0x6709('0x6')],'set':function(_0x3e2223){var _0x11ad23=_0x3e2223[_0x6709('0x7')](/\\/g,'/');this[_0x6709('0x8')]('value',_0x11ad23);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6709('0x9')],'set':function(_0x2d8c0b){this[_0x6709('0x8')](_0x6709('0xa'),moment()[_0x6709('0xb')](_0x2d8c0b,'ms'));this[_0x6709('0x8')]('closedAt',moment());this['setDataValue'](_0x6709('0xc'),_0x2d8c0b);}},'startedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this[_0x6709('0x3')](_0x6709('0xa')))[_0x6709('0xe')](_0x6709('0xf'))[_0x6709('0x10')]();}},'closedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this['getDataValue'](_0x6709('0x11')))[_0x6709('0xe')](_0x6709('0xf'))[_0x6709('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6709('0x3')]('createdAt'))[_0x6709('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x6709('0x10')]();}},'updatedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this[_0x6709('0x3')](_0x6709('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x4f7a=['value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm','createdAt','path','../../config/environment','exports','getDataValue','extname'];(function(_0x302fa5,_0x402c75){var _0x298f09=function(_0x5126a3){while(--_0x5126a3){_0x302fa5['push'](_0x302fa5['shift']());}};_0x298f09(++_0x402c75);}(_0x4f7a,0x105));var _0xa4f7=function(_0x3eb197,_0xd5493e){_0x3eb197=_0x3eb197-0x0;var _0x4b53f4=_0x4f7a[_0x3eb197];return _0x4b53f4;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xa4f7('0x0'));var config=require(_0xa4f7('0x1'));module[_0xa4f7('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa4f7('0x3')]('value')?path[_0xa4f7('0x4')](this[_0xa4f7('0x3')](_0xa4f7('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa4f7('0x6')]},'value':{'type':Sequelize[_0xa4f7('0x6')],'set':function(_0x4c78bd){var _0x58e1c7=_0x4c78bd[_0xa4f7('0x7')](/\\/g,'/');this[_0xa4f7('0x8')](_0xa4f7('0x5'),_0x58e1c7);}},'rating':{'type':Sequelize[_0xa4f7('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa4f7('0x9')],'set':function(_0x498186){this[_0xa4f7('0x8')](_0xa4f7('0xa'),moment()[_0xa4f7('0xb')](_0x498186,'ms'));this[_0xa4f7('0x8')](_0xa4f7('0xc'),moment());this[_0xa4f7('0x8')](_0xa4f7('0xd'),_0x498186);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xa4f7('0xa')))[_0xa4f7('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xa4f7('0xf')]();}},'closedAt':{'type':Sequelize[_0xa4f7('0x10')],'get':function(){return moment(this[_0xa4f7('0x3')]('closedAt'))[_0xa4f7('0xe')](_0xa4f7('0x11'))[_0xa4f7('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa4f7('0x3')](_0xa4f7('0x12')))[_0xa4f7('0xe')](_0xa4f7('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xa4f7('0x10')],'get':function(){return moment(this[_0xa4f7('0x3')]('updatedAt'))['format'](_0xa4f7('0x11'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b727117..c7c11c3 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa630=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','intersection','fields','attributes','length','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','createdAt','value','describe','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','ScreenRecording\x20not\x20found','filename','extname','download','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa630,0xbe));var _0x0a63=function(_0x37293f,_0x42a6a3){_0x37293f=_0x37293f-0x0;var _0x12b505=_0xa630[_0x37293f];return _0x12b505;};'use strict';var emlformat=require(_0x0a63('0x0'));var rimraf=require(_0x0a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x2'));var moment=require('moment');var BPromise=require(_0x0a63('0x3'));var Mustache=require('mustache');var util=require(_0x0a63('0x4'));var path=require(_0x0a63('0x5'));var sox=require(_0x0a63('0x6'));var csv=require(_0x0a63('0x7'));var ejs=require(_0x0a63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x7'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a63('0x18'))['db'];function respondWithStatusCode(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xcc;return function(_0x3d6323){if(_0x3d6323){return _0x420043['sendStatus'](_0x2fce86);}return _0x420043[_0x0a63('0x19')](_0x2fce86)['end']();};}function respondWithResult(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0xc8;return function(_0x26b2bc){if(_0x26b2bc){return _0x331e99[_0x0a63('0x19')](_0x19e922)[_0x0a63('0x1a')](_0x26b2bc);}};}function respondWithFilteredResult(_0x23b49d,_0x552b1f){return function(_0x1e3251){if(_0x1e3251){var _0x524a98=typeof _0x552b1f[_0x0a63('0x1b')]==='undefined'&&typeof _0x552b1f[_0x0a63('0x1c')]===_0x0a63('0x1d');var _0x36a9e8=_0x1e3251[_0x0a63('0x1e')];var _0x1f7481=_0x524a98?0x0:_0x552b1f[_0x0a63('0x1b')];var _0x30f292=_0x524a98?_0x1e3251[_0x0a63('0x1e')]:_0x552b1f[_0x0a63('0x1b')]+_0x552b1f[_0x0a63('0x1c')];var _0x2ad167;if(_0x30f292>=_0x36a9e8){_0x30f292=_0x36a9e8;_0x2ad167=0xc8;}else{_0x2ad167=0xce;}_0x23b49d['status'](_0x2ad167);return _0x23b49d['set'](_0x0a63('0x1f'),_0x1f7481+'-'+_0x30f292+'/'+_0x36a9e8)['json'](_0x1e3251);}return null;};}function patchUpdates(_0x2fc87c){return function(_0x5937df){try{jsonpatch[_0x0a63('0x20')](_0x5937df,_0x2fc87c,!![]);}catch(_0x41d6b8){return BPromise[_0x0a63('0x21')](_0x41d6b8);}return _0x5937df[_0x0a63('0x22')]();};}function saveUpdates(_0x5da46b,_0x398a16){return function(_0x4c225a){if(_0x4c225a){return _0x4c225a[_0x0a63('0x23')](_0x5da46b)[_0x0a63('0x24')](function(_0x1bf64a){return _0x1bf64a;});}return null;};}function removeEntity(_0x20c114,_0x343273){return function(_0x1f929f){if(_0x1f929f){return _0x1f929f[_0x0a63('0x25')]()[_0x0a63('0x24')](function(){_0x20c114['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb70,_0x4c8637){return function(_0xeacfc9){if(!_0xeacfc9){_0x55fb70['sendStatus'](0x194);}return _0xeacfc9;};}function handleError(_0x496c93,_0x2133cf){_0x2133cf=_0x2133cf||0x1f4;return function(_0x1d5448){logger[_0x0a63('0x26')](_0x1d5448[_0x0a63('0x27')]);if(_0x1d5448['name']){delete _0x1d5448[_0x0a63('0x28')];}_0x496c93[_0x0a63('0x19')](_0x2133cf)[_0x0a63('0x29')](_0x1d5448);};}exports['index']=function(_0x34239b,_0xcf409){var _0x1b7bdb={},_0x145090={},_0x32a52b={'count':0x0,'rows':[]};var _0x4577b6=_[_0x0a63('0x2a')](db[_0x0a63('0x2b')]['rawAttributes'],function(_0x58cc71){return{'name':_0x58cc71['fieldName'],'type':_0x58cc71[_0x0a63('0x2c')][_0x0a63('0x2d')]};});_0x145090[_0x0a63('0x2e')]=_[_0x0a63('0x2f')](_[_0x0a63('0x2a')](_0x4577b6,'name'),[_0x0a63('0x30')]);_0x145090[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x34239b[_0x0a63('0x31')]);_0x145090['filters']=_[_0x0a63('0x33')](_0x145090[_0x0a63('0x2e')],_0x145090['query']);_0x1b7bdb['attributes']=_[_0x0a63('0x33')](_0x145090['model'],qs['fields'](_0x34239b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x1b7bdb['attributes']=_0x1b7bdb[_0x0a63('0x35')][_0x0a63('0x36')]?_0x1b7bdb[_0x0a63('0x35')]:_0x145090[_0x0a63('0x2e')];if(!_0x34239b[_0x0a63('0x31')]['hasOwnProperty']('nolimit')){_0x1b7bdb[_0x0a63('0x1c')]=qs[_0x0a63('0x1c')](_0x34239b[_0x0a63('0x31')][_0x0a63('0x1c')]);_0x1b7bdb[_0x0a63('0x1b')]=qs[_0x0a63('0x1b')](_0x34239b['query'][_0x0a63('0x1b')]);}_0x1b7bdb[_0x0a63('0x37')]=qs['sort'](_0x34239b[_0x0a63('0x31')]['sort']);_0x1b7bdb['where']=qs[_0x0a63('0x38')](_[_0x0a63('0x39')](_0x34239b[_0x0a63('0x31')],_0x145090['filters']),_0x4577b6);if(_0x34239b[_0x0a63('0x31')][_0x0a63('0x3a')]){_0x1b7bdb[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x1b7bdb[_0x0a63('0x3b')],{'$or':_[_0x0a63('0x2a')](_0x4577b6,function(_0x604a45){if(_0x604a45['type']!==_0x0a63('0x3d')){var _0x1c7e67={};_0x1c7e67[_0x604a45[_0x0a63('0x28')]]={'$like':'%'+_0x34239b['query']['filter']+'%'};return _0x1c7e67;}})});}_0x1b7bdb=_[_0x0a63('0x3c')]({},_0x1b7bdb,_0x34239b['options']);var _0x1a01f4={'where':_0x1b7bdb[_0x0a63('0x3b')]};return db[_0x0a63('0x2b')]['count'](_0x1a01f4)[_0x0a63('0x24')](function(_0x14c737){_0x32a52b[_0x0a63('0x1e')]=_0x14c737;if(_0x34239b[_0x0a63('0x31')]['includeAll']){_0x1b7bdb[_0x0a63('0x3e')]=[{'all':!![]}];}return db[_0x0a63('0x2b')][_0x0a63('0x3f')](_0x1b7bdb);})[_0x0a63('0x24')](function(_0xf18ace){_0x32a52b[_0x0a63('0x40')]=_0xf18ace;return _0x32a52b;})['then'](respondWithFilteredResult(_0xcf409,_0x1b7bdb))[_0x0a63('0x41')](handleError(_0xcf409,null));};exports[_0x0a63('0x42')]=function(_0x347a0b,_0x793502){var _0x20fa0d={'raw':![],'where':{'id':_0x347a0b[_0x0a63('0x43')]['id']}},_0x2482ca={};_0x2482ca[_0x0a63('0x2e')]=_[_0x0a63('0x32')](db[_0x0a63('0x2b')][_0x0a63('0x44')]);_0x2482ca[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x347a0b[_0x0a63('0x31')]);_0x2482ca[_0x0a63('0x38')]=_[_0x0a63('0x33')](_0x2482ca[_0x0a63('0x2e')],_0x2482ca[_0x0a63('0x31')]);_0x20fa0d['attributes']=_[_0x0a63('0x33')](_0x2482ca['model'],qs['fields'](_0x347a0b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x20fa0d[_0x0a63('0x35')]=_0x20fa0d[_0x0a63('0x35')][_0x0a63('0x36')]?_0x20fa0d[_0x0a63('0x35')]:_0x2482ca[_0x0a63('0x2e')];if(_0x347a0b[_0x0a63('0x31')][_0x0a63('0x45')]){_0x20fa0d[_0x0a63('0x3e')]=[{'all':!![]}];}_0x20fa0d=_[_0x0a63('0x3c')]({},_0x20fa0d,_0x347a0b[_0x0a63('0x46')]);return db[_0x0a63('0x2b')][_0x0a63('0x47')](_0x20fa0d)[_0x0a63('0x24')](handleEntityNotFound(_0x793502,null))[_0x0a63('0x24')](respondWithResult(_0x793502,null))[_0x0a63('0x41')](handleError(_0x793502,null));};exports[_0x0a63('0x48')]=function(_0x366887,_0x148e0a){return db['ScreenRecording'][_0x0a63('0x48')](_0x366887[_0x0a63('0x49')],{})['then'](respondWithResult(_0x148e0a,0xc9))['catch'](handleError(_0x148e0a,null));};exports['update']=function(_0x485f20,_0x36d066){if(_0x485f20[_0x0a63('0x49')]['id']){delete _0x485f20['body']['id'];}delete _0x485f20[_0x0a63('0x49')]['duration'];delete _0x485f20[_0x0a63('0x49')][_0x0a63('0x4a')];delete _0x485f20['body']['closedAt'];delete _0x485f20['body'][_0x0a63('0x4b')];return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':{'id':_0x485f20[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x36d066,null))['then'](saveUpdates(_0x485f20[_0x0a63('0x49')],null))[_0x0a63('0x24')](respondWithResult(_0x36d066,null))[_0x0a63('0x41')](handleError(_0x36d066,null));};exports[_0x0a63('0x4c')]=function(_0x3575ae,_0x4a5b6e){return db[_0x0a63('0x2b')][_0x0a63('0x4c')]()[_0x0a63('0x24')](respondWithResult(_0x4a5b6e,null))[_0x0a63('0x41')](handleError(_0x4a5b6e,null));};exports['download']=function(_0x35b688,_0x3bd10c,_0x337bef){var _0x330550=require(_0x0a63('0x4d'));var _0x258ed3=![];var _0x4d4e20={};if(_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]&&_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]==='uniqueid'){_0x4d4e20['uniqueid']=_0x35b688[_0x0a63('0x43')]['id'];}else{_0x4d4e20['id']=_0x35b688[_0x0a63('0x43')]['id'];}return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':_0x4d4e20,'attributes':['id',_0x0a63('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3bd10c,null))['then'](function(_0x58b3a8){if(_0x58b3a8){var _0x42c1bb=path['join'](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x58b3a8[_0x0a63('0x4b')]);var _0x5d77e3=util['format'](_0x0a63('0x50'),_0x42c1bb);if(fs[_0x0a63('0x51')](_0x5d77e3)){_0x258ed3=!![];return _0x330550[_0x0a63('0x52')](_0x5d77e3,_0x42c1bb,config[_0x0a63('0x53')][_0x0a63('0x54')])[_0x0a63('0x24')](function(){return _0x58b3a8;});}return _0x58b3a8;}})[_0x0a63('0x24')](function(_0xc3415c){if(_0xc3415c){var _0xe454ef=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0xc3415c[_0x0a63('0x4b')]);if(!fs[_0x0a63('0x51')](_0xe454ef)){throw new db['Sequelize']['ValidationError'](_0x0a63('0x56'));}if(_0xc3415c[_0x0a63('0x57')]){return _0x3bd10c['download'](_0xe454ef,_0xc3415c[_0x0a63('0x57')]+path[_0x0a63('0x58')](_0xe454ef),function(){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}else{return _0x3bd10c[_0x0a63('0x59')](_0xe454ef,function(_0x3053e4){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}}})['catch'](function(_0x3b395a){if(_0x3b395a[_0x0a63('0x5a')]===_0x0a63('0x56')){_0x3bd10c['status'](0x194)[_0x0a63('0x29')](_0x0a63('0x5b'));}else{return handleError(_0x3bd10c,null);}});};exports[_0x0a63('0x25')]=function(_0x284dca,_0x15fc2e){return db['ScreenRecording'][_0x0a63('0x47')]({'where':{'id':_0x284dca[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](function(_0x1fa9cd){if(_[_0x0a63('0x5c')](_0x1fa9cd)){throw new ReferenceError(_0x0a63('0x5d'));}return _0x1fa9cd;})[_0x0a63('0x24')](function(_0x57313b){var _0x4571e7=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x57313b[_0x0a63('0x4b')]);logger[_0x0a63('0x5e')](_0x0a63('0x5f'),_0x4571e7);if(!_[_0x0a63('0x5c')](_0x57313b['value'])&&fs['existsSync'](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}_0x4571e7=_0x4571e7+_0x0a63('0x63');if(!_['isNil'](_0x57313b[_0x0a63('0x4b')])&&fs[_0x0a63('0x51')](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}return _0x57313b;})[_0x0a63('0x24')](function(_0xe52dfd){if(!_0xe52dfd)throw new InternalError();return _0xe52dfd[_0x0a63('0x25')]();})[_0x0a63('0x24')](function(){_0x15fc2e[_0x0a63('0x19')](0xcc)['end']();})[_0x0a63('0x41')](handleError(_0x15fc2e,null));}; \ No newline at end of file +var _0x2bd8=['unlink','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','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x1d0ce7,_0x5b3fee){var _0x270738=function(_0xd7d971){while(--_0xd7d971){_0x1d0ce7['push'](_0x1d0ce7['shift']());}};_0x270738(++_0x5b3fee);}(_0x2bd8,0x130));var _0x82bd=function(_0x4566e0,_0x1665bf){_0x4566e0=_0x4566e0-0x0;var _0x3a3fdd=_0x2bd8[_0x4566e0];return _0x3a3fdd;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5210095..4535f49 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 _0x5a21=['define','ScreenRecording','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x42c069,_0xdfa0f9){var _0x4f0740=function(_0x4c9fd9){while(--_0x4c9fd9){_0x42c069['push'](_0x42c069['shift']());}};_0x4f0740(++_0xdfa0f9);}(_0x5a21,0x154));var _0x15a2=function(_0x109b5b,_0x4a6a4f){_0x109b5b=_0x109b5b-0x0;var _0x18c24d=_0x5a21[_0x109b5b];return _0x18c24d;};'use strict';var _=require(_0x15a2('0x0'));var util=require('util');var logger=require(_0x15a2('0x1'))(_0x15a2('0x2'));var moment=require(_0x15a2('0x3'));var BPromise=require(_0x15a2('0x4'));var rp=require(_0x15a2('0x5'));var fs=require('fs');var path=require(_0x15a2('0x6'));var rimraf=require(_0x15a2('0x7'));var config=require(_0x15a2('0x8'));var attributes=require(_0x15a2('0x9'));module[_0x15a2('0xa')]=function(_0x2cbe5a,_0x33bffc){return _0x2cbe5a[_0x15a2('0xb')](_0x15a2('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ff=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x3ca3b3,_0x44105d){var _0x5ac013=function(_0x27fd52){while(--_0x27fd52){_0x3ca3b3['push'](_0x3ca3b3['shift']());}};_0x5ac013(++_0x44105d);}(_0xc6ff,0x91));var _0xfc6f=function(_0x2d0f93,_0x294b30){_0x2d0f93=_0x2d0f93-0x0;var _0x3f001d=_0xc6ff[_0x2d0f93];return _0x3f001d;};'use strict';var _=require(_0xfc6f('0x0'));var util=require(_0xfc6f('0x1'));var logger=require(_0xfc6f('0x2'))(_0xfc6f('0x3'));var moment=require(_0xfc6f('0x4'));var BPromise=require(_0xfc6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfc6f('0x6'));var attributes=require(_0xfc6f('0x7'));module[_0xfc6f('0x8')]=function(_0x1431c1,_0x2de93a){return _0x1431c1[_0xfc6f('0x9')](_0xfc6f('0xa'),attributes,{'tableName':_0xfc6f('0xb'),'paranoid':![],'indexes':[{'name':_0xfc6f('0xc'),'fields':[_0xfc6f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 02b9b59..c62ff7a 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 _0x054d=['stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x054d,0x101));var _0xd054=function(_0x4226d7,_0x40facb){_0x4226d7=_0x4226d7-0x0;var _0x513af2=_0x054d[_0x4226d7];return _0x513af2;};'use strict';var _=require(_0xd054('0x0'));var util=require(_0xd054('0x1'));var moment=require(_0xd054('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd054('0x3'));var db=require(_0xd054('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd054('0x5'))(_0xd054('0x6'));var config=require(_0xd054('0x7'));var jayson=require(_0xd054('0x8'));var client=jayson['client'][_0xd054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x341886,_0x47721c,_0x29087f){return new BPromise(function(_0x488d6d,_0x34f6af){return client['request'](_0x341886,_0x29087f)[_0xd054('0xa')](function(_0x119b28){logger[_0xd054('0xb')](_0xd054('0xc'),_0x47721c,_0xd054('0xd'));logger[_0xd054('0xe')](_0xd054('0xf'),_0x47721c,'request\x20sent',JSON[_0xd054('0x10')](_0x119b28));if(_0x119b28[_0xd054('0x11')]){if(_0x119b28[_0xd054('0x11')]['code']===0x1f4){logger[_0xd054('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x47721c,_0x119b28[_0xd054('0x11')][_0xd054('0x12')]);return _0x34f6af(_0x119b28[_0xd054('0x11')][_0xd054('0x12')]);}logger['error'](_0xd054('0xc'),_0x47721c,_0x119b28[_0xd054('0x11')][_0xd054('0x12')]);return _0x488d6d(_0x119b28[_0xd054('0x11')][_0xd054('0x12')]);}else{logger[_0xd054('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x47721c,_0xd054('0xd'));_0x488d6d(_0x119b28[_0xd054('0x13')][_0xd054('0x12')]);}})[_0xd054('0x14')](function(_0x438428){logger[_0xd054('0x11')](_0xd054('0xc'),_0x47721c,_0x438428);_0x34f6af(_0x438428);});});} \ No newline at end of file +var _0xc710=['rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4c0c82,_0x405ff7){var _0x425043=function(_0x2ce9c1){while(--_0x2ce9c1){_0x4c0c82['push'](_0x4c0c82['shift']());}};_0x425043(++_0x405ff7);}(_0xc710,0x149));var _0x0c71=function(_0x100dd5,_0x14359a){_0x100dd5=_0x100dd5-0x0;var _0x23fcb6=_0xc710[_0x100dd5];return _0x23fcb6;};'use strict';var _=require(_0x0c71('0x0'));var util=require(_0x0c71('0x1'));var moment=require(_0x0c71('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c71('0x3'));var fs=require('fs');var Redis=require(_0x0c71('0x4'));var db=require(_0x0c71('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c71('0x6'))(_0x0c71('0x7'));var config=require(_0x0c71('0x8'));var jayson=require(_0x0c71('0x9'));var client=jayson[_0x0c71('0xa')][_0x0c71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c592,_0x43a502,_0x558392){return new BPromise(function(_0x3da6c4,_0x12ff45){return client['request'](_0x18c592,_0x558392)[_0x0c71('0xc')](function(_0xe21977){logger[_0x0c71('0xd')](_0x0c71('0xe'),_0x43a502,'request\x20sent');logger[_0x0c71('0xf')](_0x0c71('0x10'),_0x43a502,_0x0c71('0x11'),JSON[_0x0c71('0x12')](_0xe21977));if(_0xe21977[_0x0c71('0x13')]){if(_0xe21977[_0x0c71('0x13')][_0x0c71('0x14')]===0x1f4){logger[_0x0c71('0x13')](_0x0c71('0xe'),_0x43a502,_0xe21977[_0x0c71('0x13')][_0x0c71('0x15')]);return _0x12ff45(_0xe21977[_0x0c71('0x13')]['message']);}logger['error'](_0x0c71('0xe'),_0x43a502,_0xe21977['error'][_0x0c71('0x15')]);return _0x3da6c4(_0xe21977[_0x0c71('0x13')][_0x0c71('0x15')]);}else{logger[_0x0c71('0xd')](_0x0c71('0xe'),_0x43a502,_0x0c71('0x11'));_0x3da6c4(_0xe21977[_0x0c71('0x16')]['message']);}})[_0x0c71('0x17')](function(_0x4f594d){logger[_0x0c71('0x13')](_0x0c71('0xe'),_0x43a502,_0x4f594d);_0x12ff45(_0x4f594d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0c5665d..681e5f4 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 _0x6e0f=['logo','extname','originalname','post','single','addLogo','diskStorage','logologin','file','addPreferred','addFavicon','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s'];(function(_0xf67e52,_0x4a4a62){var _0x2b112b=function(_0xa6cc65){while(--_0xa6cc65){_0xf67e52['push'](_0xf67e52['shift']());}};_0x2b112b(++_0x4a4a62);}(_0x6e0f,0x19c));var _0xf6e0=function(_0x34e485,_0x45a486){_0x34e485=_0x34e485-0x0;var _0x56e7bf=_0x6e0f[_0x34e485];return _0x56e7bf;};'use strict';var multer=require(_0xf6e0('0x0'));var util=require(_0xf6e0('0x1'));var path=require('path');var timeout=require(_0xf6e0('0x2'));var express=require('express');var router=express[_0xf6e0('0x3')]();var fs_extra=require(_0xf6e0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6e0('0x5'));var controller=require(_0xf6e0('0x6'));router[_0xf6e0('0x7')]('/',auth[_0xf6e0('0x8')](),controller[_0xf6e0('0x9')]);router[_0xf6e0('0x7')](_0xf6e0('0xa'),controller[_0xf6e0('0xb')]);router['get'](_0xf6e0('0xc'),controller[_0xf6e0('0xd')]);router[_0xf6e0('0x7')](_0xf6e0('0xe'),controller[_0xf6e0('0xf')]);router[_0xf6e0('0x7')](_0xf6e0('0x10'),controller[_0xf6e0('0x11')]);router[_0xf6e0('0x7')](_0xf6e0('0x12'),controller[_0xf6e0('0x13')]);router[_0xf6e0('0x7')](_0xf6e0('0x14'),controller['getPreferred']);router[_0xf6e0('0x7')](_0xf6e0('0x15'),controller[_0xf6e0('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36b661,_0x4d75a9,_0xcc9d48){_0xcc9d48(null,path[_0xf6e0('0x17')](config[_0xf6e0('0x18')],_0xf6e0('0x19')));},'filename':function(_0x472c56,_0x48ee7b,_0x22b5d5){_0x22b5d5(null,util[_0xf6e0('0x1a')](_0xf6e0('0x1b'),_0xf6e0('0x1c'),path[_0xf6e0('0x1d')](_0x48ee7b[_0xf6e0('0x1e')])));}})});router[_0xf6e0('0x1f')](_0xf6e0('0xe'),upload[_0xf6e0('0x20')]('file'),controller[_0xf6e0('0x21')]);var upload=multer({'storage':multer[_0xf6e0('0x22')]({'destination':function(_0x21c742,_0x411b4d,_0x15381c){_0x15381c(null,path['join'](config[_0xf6e0('0x18')],'server/files/images/logos/'));},'filename':function(_0x4d1fe6,_0x5f3e62,_0x19793f){_0x19793f(null,util['format'](_0xf6e0('0x1b'),_0xf6e0('0x23'),path[_0xf6e0('0x1d')](_0x5f3e62[_0xf6e0('0x1e')])));}})});router['post'](_0xf6e0('0x10'),upload[_0xf6e0('0x20')](_0xf6e0('0x24')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xf6e0('0x22')]({'destination':function(_0x4707e1,_0x367527,_0x151d0d){_0x151d0d(null,path[_0xf6e0('0x17')](config[_0xf6e0('0x18')],'server/files/images/logos/'));},'filename':function(_0x317664,_0x401969,_0xcc78af){_0xcc78af(null,util[_0xf6e0('0x1a')](_0xf6e0('0x1b'),'preferred',path['extname'](_0x401969[_0xf6e0('0x1e')])));}})});router[_0xf6e0('0x1f')]('/:id/preferred',upload['single'](_0xf6e0('0x24')),controller[_0xf6e0('0x25')]);var upload=multer({'storage':multer[_0xf6e0('0x22')]({'destination':function(_0x32827b,_0x53c133,_0x35fa8a){_0x35fa8a(null,path[_0xf6e0('0x17')](config[_0xf6e0('0x18')],_0xf6e0('0x19')));},'filename':function(_0x39ac76,_0x47e21a,_0x33ecac){_0x33ecac(null,util[_0xf6e0('0x1a')](_0xf6e0('0x1b'),'favicon',path[_0xf6e0('0x1d')](_0x47e21a['originalname'])));}})});router['post'](_0xf6e0('0x15'),upload[_0xf6e0('0x20')](_0xf6e0('0x24')),controller[_0xf6e0('0x26')]);router['put'](_0xf6e0('0xc'),auth[_0xf6e0('0x8')](),controller['update']);module[_0xf6e0('0x27')]=router; \ No newline at end of file +var _0x3337=['/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','originalname','post','/:id/logo','single','root','format','logologin','extname','/:id/logo_login','addLogoLogin','file','addPreferred','favicon','addFavicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','show','getLogo','getLogoLogin'];(function(_0x2f33ed,_0x5c9be8){var _0x594bf2=function(_0x38a58a){while(--_0x38a58a){_0x2f33ed['push'](_0x2f33ed['shift']());}};_0x594bf2(++_0x5c9be8);}(_0x3337,0xfe));var _0x7333=function(_0xb63c5b,_0x2d4a23){_0xb63c5b=_0xb63c5b-0x0;var _0x15479f=_0x3337[_0xb63c5b];return _0x15479f;};'use strict';var multer=require(_0x7333('0x0'));var util=require(_0x7333('0x1'));var path=require(_0x7333('0x2'));var timeout=require(_0x7333('0x3'));var express=require(_0x7333('0x4'));var router=express[_0x7333('0x5')]();var fs_extra=require(_0x7333('0x6'));var auth=require(_0x7333('0x7'));var interaction=require(_0x7333('0x8'));var config=require('../../config/environment');var controller=require(_0x7333('0x9'));router['get']('/',auth[_0x7333('0xa')](),controller[_0x7333('0xb')]);router[_0x7333('0xc')]('/now',controller['getDate']);router[_0x7333('0xc')]('/:id',controller[_0x7333('0xd')]);router[_0x7333('0xc')]('/:id/logo',controller[_0x7333('0xe')]);router[_0x7333('0xc')]('/:id/logo_login',controller[_0x7333('0xf')]);router['get'](_0x7333('0x10'),controller[_0x7333('0x11')]);router[_0x7333('0xc')](_0x7333('0x12'),controller[_0x7333('0x13')]);router[_0x7333('0xc')](_0x7333('0x14'),controller[_0x7333('0x15')]);var upload=multer({'storage':multer[_0x7333('0x16')]({'destination':function(_0x14b53a,_0x32c8f6,_0x10462b){_0x10462b(null,path[_0x7333('0x17')](config['root'],_0x7333('0x18')));},'filename':function(_0x4faf68,_0x1d5af0,_0x29d5b3){_0x29d5b3(null,util['format'](_0x7333('0x19'),_0x7333('0x1a'),path['extname'](_0x1d5af0[_0x7333('0x1b')])));}})});router[_0x7333('0x1c')](_0x7333('0x1d'),upload[_0x7333('0x1e')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x7333('0x16')]({'destination':function(_0xfbf9c5,_0x569e74,_0x362d33){_0x362d33(null,path[_0x7333('0x17')](config[_0x7333('0x1f')],_0x7333('0x18')));},'filename':function(_0x2ecdff,_0x25f72b,_0x466719){_0x466719(null,util[_0x7333('0x20')]('%s%s',_0x7333('0x21'),path[_0x7333('0x22')](_0x25f72b['originalname'])));}})});router['post'](_0x7333('0x23'),upload['single']('file'),controller[_0x7333('0x24')]);var upload=multer({'storage':multer[_0x7333('0x16')]({'destination':function(_0x4f6081,_0x5da29e,_0xfe96a1){_0xfe96a1(null,path['join'](config['root'],_0x7333('0x18')));},'filename':function(_0x408928,_0x19ae87,_0x29dff6){_0x29dff6(null,util[_0x7333('0x20')]('%s%s','preferred',path[_0x7333('0x22')](_0x19ae87[_0x7333('0x1b')])));}})});router[_0x7333('0x1c')](_0x7333('0x12'),upload[_0x7333('0x1e')](_0x7333('0x25')),controller[_0x7333('0x26')]);var upload=multer({'storage':multer[_0x7333('0x16')]({'destination':function(_0x503517,_0x204f40,_0x5c8ff7){_0x5c8ff7(null,path[_0x7333('0x17')](config[_0x7333('0x1f')],_0x7333('0x18')));},'filename':function(_0x27d73e,_0x24c9e7,_0x1e16d8){_0x1e16d8(null,util[_0x7333('0x20')](_0x7333('0x19'),_0x7333('0x27'),path['extname'](_0x24c9e7[_0x7333('0x1b')])));}})});router[_0x7333('0x1c')]('/:id/favicon',upload[_0x7333('0x1e')](_0x7333('0x25')),controller[_0x7333('0x28')]);router[_0x7333('0x29')](_0x7333('0x2a'),auth[_0x7333('0xa')](),controller[_0x7333('0x2b')]);module[_0x7333('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 1a512fc..79a22d5 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 _0xbc95=['/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x388afc,_0x35f6d8){var _0x292f9b=function(_0x1bae70){while(--_0x1bae70){_0x388afc['push'](_0x388afc['shift']());}};_0x292f9b(++_0x35f6d8);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x9234eb,_0x114d75){_0x9234eb=_0x9234eb-0x0;var _0x214240=_0xbc95[_0x9234eb];return _0x214240;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'min_internal':{'type':Sequelize[_0x5bc9('0x2')](0xb),'unique':_0x5bc9('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5bc9('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x5bc9('0x4')},'logo':{'type':Sequelize[_0x5bc9('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5bc9('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x5bc9('0x5')]},'turnusername':{'type':Sequelize[_0x5bc9('0x5')]},'turnpassword':{'type':Sequelize[_0x5bc9('0x5')]},'pageTitle':{'type':Sequelize[_0x5bc9('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5bc9('0x5')],'defaultValue':_0x5bc9('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5bc9('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5bc9('0x5')]},'defaultFavicon':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x5bc9('0x5')]},'language':{'type':Sequelize[_0x5bc9('0x5')]},'bucket':{'type':Sequelize[_0x5bc9('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x5bc9('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x5bc9('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5bc9('0x2')](0x2)[_0x5bc9('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5bc9('0x2')](0x2)[_0x5bc9('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x5bc9('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0x87e5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x135a34,_0xb0654e){var _0x1c0f9d=function(_0x42f8b1){while(--_0x42f8b1){_0x135a34['push'](_0x135a34['shift']());}};_0x1c0f9d(++_0xb0654e);}(_0x87e5,0xc1));var _0x587e=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0x87e5[_0x2e9187];return _0x1fc3a8;};'use strict';var Sequelize=require(_0x587e('0x0'));module[_0x587e('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x587e('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x587e('0x3')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x587e('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x587e('0x4')],'defaultValue':_0x587e('0x5')},'logo':{'type':Sequelize[_0x587e('0x4')]},'defaultLogo':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x587e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x587e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x587e('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x587e('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x587e('0x4')],'defaultValue':_0x587e('0x7')},'enableEmailPreview':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x587e('0x8')},'chatTimeout':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x587e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x587e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x587e('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x587e('0x3')]},'sentimentRegion':{'type':Sequelize[_0x587e('0x4')]},'language':{'type':Sequelize[_0x587e('0x4')]},'bucket':{'type':Sequelize[_0x587e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x587e('0x3')](0x2)[_0x587e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x587e('0x3')](0x2)[_0x587e('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x587e('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x587e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x587e('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x587e('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9f7bcb1..1ea344f 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 _0xa7d3=['default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','name','send','index','map','Setting','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','length','body','find','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon'];(function(_0x2835c0,_0xc2bb09){var _0x1db2a4=function(_0x4108cc){while(--_0x4108cc){_0x2835c0['push'](_0x2835c0['shift']());}};_0x1db2a4(++_0xc2bb09);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x39c6bb,_0x3168e4){_0x39c6bb=_0x39c6bb-0x0;var _0x9cc25f=_0xa7d3[_0x39c6bb];return _0x9cc25f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a7d('0x0'));var rp=require(_0x3a7d('0x1'));var moment=require(_0x3a7d('0x2'));var BPromise=require(_0x3a7d('0x3'));var Mustache=require(_0x3a7d('0x4'));var util=require(_0x3a7d('0x5'));var path=require(_0x3a7d('0x6'));var sox=require(_0x3a7d('0x7'));var csv=require(_0x3a7d('0x8'));var ejs=require(_0x3a7d('0x9'));var fs=require('fs');var fs_extra=require(_0x3a7d('0xa'));var _=require(_0x3a7d('0xb'));var squel=require('squel');var crypto=require(_0x3a7d('0xc'));var jsforce=require(_0x3a7d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a7d('0x8'));var querystring=require(_0x3a7d('0xe'));var Papa=require(_0x3a7d('0xf'));var Redis=require('ioredis');var authService=require(_0x3a7d('0x10'));var qs=require(_0x3a7d('0x11'));var as=require(_0x3a7d('0x12'));var hardwareService=require(_0x3a7d('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3a7d('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x3a7d('0x15')][_0x3a7d('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x1fbcaa,_0x785dbd,_0x3d26b6,_0x3b9fdb){return new BPromise(function(_0x6772bf,_0x2b0381){var _0x1e1bbb=_0x3b9fdb||client;return _0x1e1bbb[_0x3a7d('0x17')](_0x1fbcaa,_0x3d26b6)[_0x3a7d('0x18')](function(_0x4f5d1a){logger[_0x3a7d('0x19')]('Setting,\x20%s,\x20%s',_0x785dbd,_0x3a7d('0x1a'));logger[_0x3a7d('0x1b')](_0x3a7d('0x1c'),_0x785dbd,_0x3a7d('0x1a'),JSON[_0x3a7d('0x1d')](_0x4f5d1a));if(_0x4f5d1a[_0x3a7d('0x1e')]){if(_0x4f5d1a[_0x3a7d('0x1e')][_0x3a7d('0x1f')]===0x1f4){logger[_0x3a7d('0x1e')](_0x3a7d('0x20'),_0x785dbd,_0x4f5d1a['error'][_0x3a7d('0x21')]);return _0x2b0381(_0x4f5d1a[_0x3a7d('0x1e')][_0x3a7d('0x21')]);}logger[_0x3a7d('0x1e')](_0x3a7d('0x20'),_0x785dbd,_0x4f5d1a[_0x3a7d('0x1e')][_0x3a7d('0x21')]);return _0x6772bf(_0x4f5d1a[_0x3a7d('0x1e')][_0x3a7d('0x21')]);}else{logger[_0x3a7d('0x19')](_0x3a7d('0x20'),_0x785dbd,_0x3a7d('0x1a'));_0x6772bf(_0x4f5d1a[_0x3a7d('0x22')][_0x3a7d('0x21')]);}})[_0x3a7d('0x23')](function(_0x2b2d15){logger[_0x3a7d('0x1e')](_0x3a7d('0x20'),_0x785dbd,_0x2b2d15);_0x2b0381(_0x2b2d15);});});}function respondWithStatusCode(_0x550629,_0x46bcc4){_0x46bcc4=_0x46bcc4||0xcc;return function(_0x6d0bff){if(_0x6d0bff){return _0x550629[_0x3a7d('0x24')](_0x46bcc4);}return _0x550629['status'](_0x46bcc4)[_0x3a7d('0x25')]();};}function respondWithResult(_0x5a79f2,_0x19fbc8){_0x19fbc8=_0x19fbc8||0xc8;return function(_0x1146bb){if(_0x1146bb){return _0x5a79f2[_0x3a7d('0x26')](_0x19fbc8)[_0x3a7d('0x27')](_0x1146bb);}};}function respondWithFilteredResult(_0x14e195,_0x20440a){return function(_0x191cb8){if(_0x191cb8){var _0x219deb=typeof _0x20440a[_0x3a7d('0x28')]==='undefined'&&typeof _0x20440a[_0x3a7d('0x29')]===_0x3a7d('0x2a');var _0x33b395=_0x191cb8[_0x3a7d('0x2b')];var _0x8a69b0=_0x219deb?0x0:_0x20440a[_0x3a7d('0x28')];var _0x381181=_0x219deb?_0x191cb8[_0x3a7d('0x2b')]:_0x20440a[_0x3a7d('0x28')]+_0x20440a[_0x3a7d('0x29')];var _0x4c9341;if(_0x381181>=_0x33b395){_0x381181=_0x33b395;_0x4c9341=0xc8;}else{_0x4c9341=0xce;}_0x14e195[_0x3a7d('0x26')](_0x4c9341);return _0x14e195[_0x3a7d('0x2c')](_0x3a7d('0x2d'),_0x8a69b0+'-'+_0x381181+'/'+_0x33b395)['json'](_0x191cb8);}return null;};}function patchUpdates(_0x2359f2){return function(_0x25c0b4){try{jsonpatch[_0x3a7d('0x2e')](_0x25c0b4,_0x2359f2,!![]);}catch(_0x54cb8a){return BPromise[_0x3a7d('0x2f')](_0x54cb8a);}return _0x25c0b4['save']();};}function saveUpdates(_0x5a3767,_0x2a11ba){return function(_0x59e26b){if(_0x59e26b){return _0x59e26b[_0x3a7d('0x30')](_0x5a3767)[_0x3a7d('0x18')](function(_0x3012fe){return _0x3012fe;});}return null;};}function removeEntity(_0x492609,_0x459f14){return function(_0x2d3247){if(_0x2d3247){return _0x2d3247[_0x3a7d('0x31')]()[_0x3a7d('0x18')](function(){_0x492609[_0x3a7d('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x145c8e,_0x46070a){return function(_0x525905){if(!_0x525905){_0x145c8e[_0x3a7d('0x24')](0x194);}return _0x525905;};}function handleError(_0x33472d,_0x4ee34f){_0x4ee34f=_0x4ee34f||0x1f4;return function(_0x46e3cc){logger[_0x3a7d('0x1e')](_0x46e3cc['stack']);if(_0x46e3cc[_0x3a7d('0x32')]){delete _0x46e3cc[_0x3a7d('0x32')];}_0x33472d['status'](_0x4ee34f)[_0x3a7d('0x33')](_0x46e3cc);};}exports[_0x3a7d('0x34')]=function(_0x7f870e,_0x19f736){var _0x11e94e={},_0x4a1a74={},_0x3c912d={'count':0x0,'rows':[]};var _0x5180a5=_[_0x3a7d('0x35')](db[_0x3a7d('0x36')]['rawAttributes'],function(_0x11647d){return{'name':_0x11647d['fieldName'],'type':_0x11647d[_0x3a7d('0x37')]['key']};});_0x4a1a74[_0x3a7d('0x38')]=_['map'](_0x5180a5,_0x3a7d('0x32'));_0x4a1a74[_0x3a7d('0x39')]=_[_0x3a7d('0x3a')](_0x7f870e['query']);_0x4a1a74[_0x3a7d('0x3b')]=_[_0x3a7d('0x3c')](_0x4a1a74[_0x3a7d('0x38')],_0x4a1a74['query']);_0x11e94e['attributes']=_[_0x3a7d('0x3c')](_0x4a1a74[_0x3a7d('0x38')],qs[_0x3a7d('0x3d')](_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x3d')]));_0x11e94e['attributes']=_0x11e94e['attributes']['length']?_0x11e94e[_0x3a7d('0x3e')]:_0x4a1a74[_0x3a7d('0x38')];if(!_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x3f')](_0x3a7d('0x40'))){_0x11e94e['limit']=qs[_0x3a7d('0x29')](_0x7f870e[_0x3a7d('0x39')]['limit']);_0x11e94e['offset']=qs[_0x3a7d('0x28')](_0x7f870e[_0x3a7d('0x39')]['offset']);}_0x11e94e[_0x3a7d('0x41')]=qs[_0x3a7d('0x42')](_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x42')]);_0x11e94e['where']=qs[_0x3a7d('0x3b')](_['pick'](_0x7f870e[_0x3a7d('0x39')],_0x4a1a74[_0x3a7d('0x3b')]),_0x5180a5);if(_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x43')]){_0x11e94e[_0x3a7d('0x44')]=_[_0x3a7d('0x45')](_0x11e94e[_0x3a7d('0x44')],{'$or':_[_0x3a7d('0x35')](_0x5180a5,function(_0x1ea1e4){if(_0x1ea1e4[_0x3a7d('0x37')]!==_0x3a7d('0x46')){var _0x519b8d={};_0x519b8d[_0x1ea1e4['name']]={'$like':'%'+_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x43')]+'%'};return _0x519b8d;}})});}_0x11e94e=_[_0x3a7d('0x45')]({},_0x11e94e,_0x7f870e[_0x3a7d('0x47')]);var _0x41f36d={'where':_0x11e94e['where']};return db[_0x3a7d('0x36')][_0x3a7d('0x2b')](_0x41f36d)[_0x3a7d('0x18')](function(_0x416055){_0x3c912d[_0x3a7d('0x2b')]=_0x416055;if(_0x7f870e[_0x3a7d('0x39')][_0x3a7d('0x48')]){_0x11e94e[_0x3a7d('0x49')]=[{'all':!![]}];}return db['Setting'][_0x3a7d('0x4a')](_0x11e94e);})[_0x3a7d('0x18')](function(_0x3ef72e){_0x3c912d['rows']=_0x3ef72e;return _0x3c912d;})[_0x3a7d('0x18')](respondWithFilteredResult(_0x19f736,_0x11e94e))['catch'](handleError(_0x19f736,null));};exports[_0x3a7d('0x4b')]=function(_0x127784,_0x52886b){var _0x3cd7ea={'raw':![],'where':{'id':_0x127784[_0x3a7d('0x4c')]['id']}},_0x4b9fe6={};_0x4b9fe6[_0x3a7d('0x38')]=_[_0x3a7d('0x3a')](db[_0x3a7d('0x36')][_0x3a7d('0x4d')]);_0x4b9fe6['query']=_[_0x3a7d('0x3a')](_0x127784[_0x3a7d('0x39')]);_0x4b9fe6[_0x3a7d('0x3b')]=_[_0x3a7d('0x3c')](_0x4b9fe6[_0x3a7d('0x38')],_0x4b9fe6[_0x3a7d('0x39')]);_0x3cd7ea[_0x3a7d('0x3e')]=_[_0x3a7d('0x3c')](_0x4b9fe6['model'],qs[_0x3a7d('0x3d')](_0x127784[_0x3a7d('0x39')][_0x3a7d('0x3d')]));_0x3cd7ea[_0x3a7d('0x3e')]=_0x3cd7ea[_0x3a7d('0x3e')][_0x3a7d('0x4e')]?_0x3cd7ea[_0x3a7d('0x3e')]:_0x4b9fe6[_0x3a7d('0x38')];if(_0x127784[_0x3a7d('0x39')][_0x3a7d('0x48')]){_0x3cd7ea[_0x3a7d('0x49')]=[{'all':!![]}];}_0x3cd7ea=_[_0x3a7d('0x45')]({},_0x3cd7ea,_0x127784[_0x3a7d('0x47')]);return db['Setting']['find'](_0x3cd7ea)[_0x3a7d('0x18')](handleEntityNotFound(_0x52886b,null))['then'](respondWithResult(_0x52886b,null))[_0x3a7d('0x23')](handleError(_0x52886b,null));};exports[_0x3a7d('0x30')]=function(_0xeb032,_0x46e7e4){if(_0xeb032[_0x3a7d('0x4f')]['id']){delete _0xeb032[_0x3a7d('0x4f')]['id'];}return db['Setting'][_0x3a7d('0x50')]({'where':{'id':_0xeb032[_0x3a7d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x46e7e4,null))[_0x3a7d('0x18')](saveUpdates(_0xeb032['body'],null))[_0x3a7d('0x18')](respondWithResult(_0x46e7e4,null))[_0x3a7d('0x23')](handleError(_0x46e7e4,null));};exports['addLogo']=function(_0x2177da,_0x1138ca,_0x316a94){if(_0x2177da[_0x3a7d('0x51')]&&_0x2177da[_0x3a7d('0x51')][_0x3a7d('0x52')]){_0x2177da['body'][_0x3a7d('0x53')]=_0x2177da[_0x3a7d('0x51')][_0x3a7d('0x52')];}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x2177da['params']['id']}})[_0x3a7d('0x18')](handleEntityNotFound(_0x1138ca,null))['then'](saveUpdates(_0x2177da['body'],null))[_0x3a7d('0x18')](respondWithResult(_0x1138ca,null))[_0x3a7d('0x23')](handleError(_0x1138ca,null));};exports[_0x3a7d('0x54')]=function(_0x298396,_0x3258ff,_0x42eb00){if(_0x298396[_0x3a7d('0x51')]&&_0x298396[_0x3a7d('0x51')][_0x3a7d('0x52')]){_0x298396[_0x3a7d('0x4f')][_0x3a7d('0x55')]=_0x298396[_0x3a7d('0x51')]['filename'];}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x298396['params']['id']}})[_0x3a7d('0x18')](handleEntityNotFound(_0x3258ff,null))[_0x3a7d('0x18')](saveUpdates(_0x298396[_0x3a7d('0x4f')],null))[_0x3a7d('0x18')](respondWithResult(_0x3258ff,null))[_0x3a7d('0x23')](handleError(_0x3258ff,null));};var utilLicense=require(_0x3a7d('0x14'));exports['getLogo']=function(_0x43f537,_0x303349,_0x50a4d4){var _0x278846='server/files/images/logos';var _0x4132f2={'custom':![]};return utilLicense[_0x3a7d('0x56')]()[_0x3a7d('0x18')](function(_0xfbc7b6){if(_0xfbc7b6){_0x4132f2=_0xfbc7b6;}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x43f537[_0x3a7d('0x4c')]['id']},'attributes':['logo',_0x3a7d('0x55'),_0x3a7d('0x57'),_0x3a7d('0x58'),_0x3a7d('0x59'),_0x3a7d('0x5a'),_0x3a7d('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x3a7d('0x18')](handleEntityNotFound(_0x303349,null))[_0x3a7d('0x18')](function(_0xb172cc){if(_0xb172cc){var _0x28b7fd=_0xb172cc['logo']&&fs[_0x3a7d('0x5c')](path[_0x3a7d('0x5d')](config['root'],_0x278846,_[_0x3a7d('0x5e')](_0xb172cc[_0x3a7d('0x53')])))?path['join'](config[_0x3a7d('0x5f')],_0x278846,_[_0x3a7d('0x5e')](_0xb172cc[_0x3a7d('0x53')])):path[_0x3a7d('0x5d')](config['root'],_0x278846,_[_0x3a7d('0x5e')](_0x3a7d('0x60')));var _0x29002e=_0x3a7d('0x61')+_['upperFirst'](_0x3a7d('0x53'));if(_0xb172cc[_0x29002e]||!_0x4132f2[_0x3a7d('0x62')]){_0x28b7fd=path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x278846,_['toLower'](_0x3a7d('0x60')));}if(!fs[_0x3a7d('0x5c')](_0x28b7fd)){throw new db[(_0x3a7d('0x63'))][(_0x3a7d('0x64'))](_[_0x3a7d('0x65')](_0x3a7d('0x53'))+_0x3a7d('0x66'));}return _0x303349[_0x3a7d('0x67')](_0x28b7fd);}})[_0x3a7d('0x23')](handleError(_0x303349,null));};var utilLicense=require('../../config/license/util');exports[_0x3a7d('0x68')]=function(_0x19281b,_0x4d675d,_0x45dc75){var _0x1fd715=_0x3a7d('0x69');var _0x496492={'custom':![]};return utilLicense[_0x3a7d('0x56')]()['then'](function(_0x3682c2){if(_0x3682c2){_0x496492=_0x3682c2;}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x19281b[_0x3a7d('0x4c')]['id']},'attributes':[_0x3a7d('0x53'),_0x3a7d('0x55'),'preferred',_0x3a7d('0x58'),_0x3a7d('0x59'),_0x3a7d('0x5a'),_0x3a7d('0x5b'),_0x3a7d('0x6a')],'raw':!![]});})[_0x3a7d('0x18')](handleEntityNotFound(_0x4d675d,null))[_0x3a7d('0x18')](function(_0x35a8f6){if(_0x35a8f6){var _0x518d47=_0x35a8f6['loginLogo']&&fs['existsSync'](path['join'](config[_0x3a7d('0x5f')],_0x1fd715,_[_0x3a7d('0x5e')](_0x35a8f6[_0x3a7d('0x55')])))?path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1fd715,_['toLower'](_0x35a8f6[_0x3a7d('0x55')])):path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1fd715,_[_0x3a7d('0x5e')]('default_loginLogo.svg'));var _0x15dff1='default'+_['upperFirst'](_0x3a7d('0x55'));if(_0x35a8f6[_0x15dff1]||!_0x496492[_0x3a7d('0x62')]){_0x518d47=path['join'](config[_0x3a7d('0x5f')],_0x1fd715,_[_0x3a7d('0x5e')](_0x3a7d('0x6b')));}if(!fs[_0x3a7d('0x5c')](_0x518d47)){throw new db[(_0x3a7d('0x63'))][(_0x3a7d('0x64'))](_[_0x3a7d('0x65')](_0x3a7d('0x55'))+_0x3a7d('0x66'));}return _0x4d675d[_0x3a7d('0x67')](_0x518d47);}})['catch'](handleError(_0x4d675d,null));};exports[_0x3a7d('0x6c')]=function(_0x4c0e79,_0x5135c7){return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x4c0e79[_0x3a7d('0x4c')]['id']},'attributes':[_0x3a7d('0x6d')]})['then'](respondWithResult(_0x5135c7,null))[_0x3a7d('0x23')](handleError(_0x5135c7,null));};exports[_0x3a7d('0x6e')]=function(_0x460242,_0x4fd220,_0x5708a4){if(_0x460242[_0x3a7d('0x51')]&&_0x460242['file'][_0x3a7d('0x52')]){_0x460242[_0x3a7d('0x4f')][_0x3a7d('0x57')]=_0x460242['file']['filename'];}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x460242[_0x3a7d('0x4c')]['id']}})[_0x3a7d('0x18')](handleEntityNotFound(_0x4fd220,null))[_0x3a7d('0x18')](saveUpdates(_0x460242['body'],null))['then'](respondWithResult(_0x4fd220,null))[_0x3a7d('0x23')](handleError(_0x4fd220,null));};var utilLicense=require(_0x3a7d('0x14'));exports[_0x3a7d('0x6f')]=function(_0x5d5f94,_0xd82242,_0x3148ba){var _0x1a8497=_0x3a7d('0x69');var _0x502ae3={'custom':![]};return utilLicense['getLicense']()[_0x3a7d('0x18')](function(_0x2a065b){if(_0x2a065b){_0x502ae3=_0x2a065b;}return db['Setting']['find']({'where':{'id':_0x5d5f94[_0x3a7d('0x4c')]['id']},'attributes':[_0x3a7d('0x53'),_0x3a7d('0x55'),_0x3a7d('0x57'),_0x3a7d('0x58'),_0x3a7d('0x59'),_0x3a7d('0x5a'),_0x3a7d('0x5b'),_0x3a7d('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0xd82242,null))['then'](function(_0x1cd33b){if(_0x1cd33b){var _0x57bdfc=_0x1cd33b[_0x3a7d('0x57')]&&fs[_0x3a7d('0x5c')](path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1a8497,_[_0x3a7d('0x5e')](_0x1cd33b[_0x3a7d('0x57')])))?path[_0x3a7d('0x5d')](config['root'],_0x1a8497,_['toLower'](_0x1cd33b[_0x3a7d('0x57')])):path['join'](config[_0x3a7d('0x5f')],_0x1a8497,_[_0x3a7d('0x5e')](_0x3a7d('0x70')));var _0x6d6a79=_0x3a7d('0x61')+_['upperFirst'](_0x3a7d('0x57'));if(_0x1cd33b[_0x6d6a79]||!_0x502ae3[_0x3a7d('0x62')]||!_0x502ae3[_0x3a7d('0x57')]){_0x57bdfc=path['join'](config['root'],_0x1a8497,_[_0x3a7d('0x5e')](_0x3a7d('0x70')));}if(!fs[_0x3a7d('0x5c')](_0x57bdfc)){throw new db[(_0x3a7d('0x63'))]['ValidationError'](_[_0x3a7d('0x65')](_0x3a7d('0x57'))+_0x3a7d('0x66'));}return _0xd82242[_0x3a7d('0x67')](_0x57bdfc);}})[_0x3a7d('0x23')](handleError(_0xd82242,null));};exports[_0x3a7d('0x71')]=function(_0x6aa361,_0x48cd24,_0x2d8366){if(_0x6aa361[_0x3a7d('0x51')]&&_0x6aa361['file'][_0x3a7d('0x52')]){_0x6aa361['body'][_0x3a7d('0x58')]=_0x6aa361[_0x3a7d('0x51')][_0x3a7d('0x52')];}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x6aa361[_0x3a7d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48cd24,null))[_0x3a7d('0x18')](saveUpdates(_0x6aa361[_0x3a7d('0x4f')],null))[_0x3a7d('0x18')](respondWithResult(_0x48cd24,null))['catch'](handleError(_0x48cd24,null));};var utilLicense=require(_0x3a7d('0x14'));exports[_0x3a7d('0x72')]=function(_0x5d4a2f,_0x465157,_0x1d4e00){var _0x1407ce=_0x3a7d('0x69');var _0x5744af={'custom':![]};return utilLicense[_0x3a7d('0x56')]()[_0x3a7d('0x18')](function(_0xf9ba90){if(_0xf9ba90){_0x5744af=_0xf9ba90;}return db[_0x3a7d('0x36')][_0x3a7d('0x50')]({'where':{'id':_0x5d4a2f[_0x3a7d('0x4c')]['id']},'attributes':[_0x3a7d('0x53'),_0x3a7d('0x55'),_0x3a7d('0x57'),_0x3a7d('0x58'),'defaultLogo',_0x3a7d('0x5a'),_0x3a7d('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x3a7d('0x18')](handleEntityNotFound(_0x465157,null))['then'](function(_0x2cda00){if(_0x2cda00){var _0x338aa9=_0x2cda00['favicon']&&fs[_0x3a7d('0x5c')](path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1407ce,_[_0x3a7d('0x5e')](_0x2cda00[_0x3a7d('0x58')])))?path['join'](config[_0x3a7d('0x5f')],_0x1407ce,_[_0x3a7d('0x5e')](_0x2cda00[_0x3a7d('0x58')])):path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1407ce,_['toLower'](_0x3a7d('0x73')));var _0x4dffd2=_0x3a7d('0x61')+_['upperFirst']('favicon');if(_0x2cda00[_0x4dffd2]||!_0x5744af['custom']){_0x338aa9=path[_0x3a7d('0x5d')](config[_0x3a7d('0x5f')],_0x1407ce,_[_0x3a7d('0x5e')](_0x3a7d('0x73')));}if(!fs[_0x3a7d('0x5c')](_0x338aa9)){throw new db[(_0x3a7d('0x63'))][(_0x3a7d('0x64'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x465157[_0x3a7d('0x67')](_0x338aa9);}})['catch'](handleError(_0x465157,null));};exports[_0x3a7d('0x74')]=function(_0xeef97b,_0x51aa9e){var _0x1b44cc={'offset':moment()[_0x3a7d('0x75')]()};_0x1b44cc[_0x3a7d('0x76')]=moment()[_0x3a7d('0x75')](_0x1b44cc['offset'])[_0x3a7d('0x77')](_0x3a7d('0x78'));return _0x51aa9e['status'](0xc8)[_0x3a7d('0x33')](_0x1b44cc);}; \ No newline at end of file +var _0x575b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','reject','update','then','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','intersection','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','default','upperFirst','custom','join','default_logo.svg','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','defaultLogo','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xac2b4a,_0x2e1a17){var _0x1b868a=function(_0x5178f9){while(--_0x5178f9){_0xac2b4a['push'](_0xac2b4a['shift']());}};_0x1b868a(++_0x2e1a17);}(_0x575b,0x1e0));var _0xb575=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x575b[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xb575('0x0'));var rimraf=require(_0xb575('0x1'));var zipdir=require(_0xb575('0x2'));var jsonpatch=require(_0xb575('0x3'));var rp=require(_0xb575('0x4'));var moment=require('moment');var BPromise=require(_0xb575('0x5'));var Mustache=require(_0xb575('0x6'));var util=require('util');var path=require(_0xb575('0x7'));var sox=require(_0xb575('0x8'));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(_0xb575('0x9'));var crypto=require(_0xb575('0xa'));var jsforce=require(_0xb575('0xb'));var deskjs=require(_0xb575('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb575('0xd'));var Papa=require(_0xb575('0xe'));var Redis=require(_0xb575('0xf'));var authService=require(_0xb575('0x10'));var qs=require(_0xb575('0x11'));var as=require(_0xb575('0x12'));var hardwareService=require(_0xb575('0x13'));var logger=require(_0xb575('0x14'))(_0xb575('0x15'));var utils=require('../../config/utils');var config=require(_0xb575('0x16'));var licenseUtil=require(_0xb575('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb575('0x18'));var client=jayson[_0xb575('0x19')][_0xb575('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2bace2,_0x200b3b,_0x36dfc5,_0x2bff4d){return new BPromise(function(_0x55cc73,_0x4a4911){var _0x3006fb=_0x2bff4d||client;return _0x3006fb[_0xb575('0x1b')](_0x2bace2,_0x36dfc5)['then'](function(_0xe32150){logger[_0xb575('0x1c')](_0xb575('0x1d'),_0x200b3b,_0xb575('0x1e'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x200b3b,'request\x20sent',JSON[_0xb575('0x1f')](_0xe32150));if(_0xe32150[_0xb575('0x20')]){if(_0xe32150[_0xb575('0x20')][_0xb575('0x21')]===0x1f4){logger[_0xb575('0x20')](_0xb575('0x1d'),_0x200b3b,_0xe32150['error'][_0xb575('0x22')]);return _0x4a4911(_0xe32150['error']['message']);}logger[_0xb575('0x20')]('Setting,\x20%s,\x20%s',_0x200b3b,_0xe32150[_0xb575('0x20')][_0xb575('0x22')]);return _0x55cc73(_0xe32150['error'][_0xb575('0x22')]);}else{logger[_0xb575('0x1c')](_0xb575('0x1d'),_0x200b3b,_0xb575('0x1e'));_0x55cc73(_0xe32150[_0xb575('0x23')][_0xb575('0x22')]);}})[_0xb575('0x24')](function(_0xc54a3){logger[_0xb575('0x20')]('Setting,\x20%s,\x20%s',_0x200b3b,_0xc54a3);_0x4a4911(_0xc54a3);});});}function respondWithStatusCode(_0x4ee867,_0x250e70){_0x250e70=_0x250e70||0xcc;return function(_0x57b4cb){if(_0x57b4cb){return _0x4ee867[_0xb575('0x25')](_0x250e70);}return _0x4ee867['status'](_0x250e70)[_0xb575('0x26')]();};}function respondWithResult(_0x1a2eda,_0x2296c8){_0x2296c8=_0x2296c8||0xc8;return function(_0x121065){if(_0x121065){return _0x1a2eda[_0xb575('0x27')](_0x2296c8)[_0xb575('0x28')](_0x121065);}};}function respondWithFilteredResult(_0x37b573,_0x5d9a82){return function(_0x39e725){if(_0x39e725){var _0xad37de=typeof _0x5d9a82['offset']===_0xb575('0x29')&&typeof _0x5d9a82['limit']===_0xb575('0x29');var _0x17d18b=_0x39e725[_0xb575('0x2a')];var _0x583a2d=_0xad37de?0x0:_0x5d9a82[_0xb575('0x2b')];var _0x527d71=_0xad37de?_0x39e725['count']:_0x5d9a82['offset']+_0x5d9a82[_0xb575('0x2c')];var _0x4928be;if(_0x527d71>=_0x17d18b){_0x527d71=_0x17d18b;_0x4928be=0xc8;}else{_0x4928be=0xce;}_0x37b573['status'](_0x4928be);return _0x37b573[_0xb575('0x2d')]('Content-Range',_0x583a2d+'-'+_0x527d71+'/'+_0x17d18b)['json'](_0x39e725);}return null;};}function patchUpdates(_0x5e53c8){return function(_0x7a22a1){try{jsonpatch['apply'](_0x7a22a1,_0x5e53c8,!![]);}catch(_0x405448){return BPromise[_0xb575('0x2e')](_0x405448);}return _0x7a22a1['save']();};}function saveUpdates(_0x49100f,_0x3edd3a){return function(_0x26638f){if(_0x26638f){return _0x26638f[_0xb575('0x2f')](_0x49100f)[_0xb575('0x30')](function(_0x431018){return _0x431018;});}return null;};}function removeEntity(_0x2726a8,_0x342bed){return function(_0x30563f){if(_0x30563f){return _0x30563f[_0xb575('0x31')]()[_0xb575('0x30')](function(){_0x2726a8[_0xb575('0x27')](0xcc)[_0xb575('0x26')]();});}};}function handleEntityNotFound(_0x23cdf8,_0x1646c2){return function(_0x181a00){if(!_0x181a00){_0x23cdf8[_0xb575('0x25')](0x194);}return _0x181a00;};}function handleError(_0x547d50,_0x2aafee){_0x2aafee=_0x2aafee||0x1f4;return function(_0x33f503){logger[_0xb575('0x20')](_0x33f503[_0xb575('0x32')]);if(_0x33f503[_0xb575('0x33')]){delete _0x33f503[_0xb575('0x33')];}_0x547d50[_0xb575('0x27')](_0x2aafee)['send'](_0x33f503);};}exports[_0xb575('0x34')]=function(_0x5b092,_0x4c3a95){var _0x504148={},_0x1cf385={},_0x5740f1={'count':0x0,'rows':[]};var _0x5597ed=_[_0xb575('0x35')](db[_0xb575('0x36')][_0xb575('0x37')],function(_0x9ff40e){return{'name':_0x9ff40e[_0xb575('0x38')],'type':_0x9ff40e['type'][_0xb575('0x39')]};});_0x1cf385[_0xb575('0x3a')]=_[_0xb575('0x35')](_0x5597ed,_0xb575('0x33'));_0x1cf385[_0xb575('0x3b')]=_[_0xb575('0x3c')](_0x5b092[_0xb575('0x3b')]);_0x1cf385[_0xb575('0x3d')]=_['intersection'](_0x1cf385[_0xb575('0x3a')],_0x1cf385[_0xb575('0x3b')]);_0x504148[_0xb575('0x3e')]=_['intersection'](_0x1cf385['model'],qs[_0xb575('0x3f')](_0x5b092[_0xb575('0x3b')][_0xb575('0x3f')]));_0x504148[_0xb575('0x3e')]=_0x504148['attributes'][_0xb575('0x40')]?_0x504148[_0xb575('0x3e')]:_0x1cf385[_0xb575('0x3a')];if(!_0x5b092[_0xb575('0x3b')][_0xb575('0x41')](_0xb575('0x42'))){_0x504148[_0xb575('0x2c')]=qs[_0xb575('0x2c')](_0x5b092[_0xb575('0x3b')][_0xb575('0x2c')]);_0x504148['offset']=qs['offset'](_0x5b092[_0xb575('0x3b')][_0xb575('0x2b')]);}_0x504148[_0xb575('0x43')]=qs[_0xb575('0x44')](_0x5b092[_0xb575('0x3b')][_0xb575('0x44')]);_0x504148[_0xb575('0x45')]=qs[_0xb575('0x3d')](_[_0xb575('0x46')](_0x5b092[_0xb575('0x3b')],_0x1cf385['filters']),_0x5597ed);if(_0x5b092[_0xb575('0x3b')][_0xb575('0x47')]){_0x504148[_0xb575('0x45')]=_[_0xb575('0x48')](_0x504148[_0xb575('0x45')],{'$or':_[_0xb575('0x35')](_0x5597ed,function(_0x29d41e){if(_0x29d41e[_0xb575('0x49')]!==_0xb575('0x4a')){var _0x4dc2b8={};_0x4dc2b8[_0x29d41e[_0xb575('0x33')]]={'$like':'%'+_0x5b092[_0xb575('0x3b')]['filter']+'%'};return _0x4dc2b8;}})});}_0x504148=_['merge']({},_0x504148,_0x5b092[_0xb575('0x4b')]);var _0x57335c={'where':_0x504148[_0xb575('0x45')]};return db[_0xb575('0x36')][_0xb575('0x2a')](_0x57335c)[_0xb575('0x30')](function(_0x1eb6c9){_0x5740f1[_0xb575('0x2a')]=_0x1eb6c9;if(_0x5b092[_0xb575('0x3b')]['includeAll']){_0x504148[_0xb575('0x4c')]=[{'all':!![]}];}return db[_0xb575('0x36')][_0xb575('0x4d')](_0x504148);})[_0xb575('0x30')](function(_0x422906){_0x5740f1[_0xb575('0x4e')]=_0x422906;return _0x5740f1;})['then'](respondWithFilteredResult(_0x4c3a95,_0x504148))['catch'](handleError(_0x4c3a95,null));};exports['show']=function(_0x415ea0,_0x411886){var _0x2d32f4={'raw':![],'where':{'id':_0x415ea0[_0xb575('0x4f')]['id']}},_0x4e424e={};_0x4e424e['model']=_[_0xb575('0x3c')](db[_0xb575('0x36')]['rawAttributes']);_0x4e424e['query']=_[_0xb575('0x3c')](_0x415ea0[_0xb575('0x3b')]);_0x4e424e[_0xb575('0x3d')]=_[_0xb575('0x50')](_0x4e424e[_0xb575('0x3a')],_0x4e424e['query']);_0x2d32f4[_0xb575('0x3e')]=_[_0xb575('0x50')](_0x4e424e['model'],qs['fields'](_0x415ea0[_0xb575('0x3b')][_0xb575('0x3f')]));_0x2d32f4[_0xb575('0x3e')]=_0x2d32f4[_0xb575('0x3e')]['length']?_0x2d32f4[_0xb575('0x3e')]:_0x4e424e[_0xb575('0x3a')];if(_0x415ea0['query']['includeAll']){_0x2d32f4[_0xb575('0x4c')]=[{'all':!![]}];}_0x2d32f4=_[_0xb575('0x48')]({},_0x2d32f4,_0x415ea0[_0xb575('0x4b')]);return db[_0xb575('0x36')][_0xb575('0x51')](_0x2d32f4)[_0xb575('0x30')](handleEntityNotFound(_0x411886,null))[_0xb575('0x30')](respondWithResult(_0x411886,null))[_0xb575('0x24')](handleError(_0x411886,null));};exports[_0xb575('0x2f')]=function(_0x23cc0f,_0x13a6fb){if(_0x23cc0f[_0xb575('0x52')]['id']){delete _0x23cc0f[_0xb575('0x52')]['id'];}return db[_0xb575('0x36')]['find']({'where':{'id':_0x23cc0f[_0xb575('0x4f')]['id']}})[_0xb575('0x30')](handleEntityNotFound(_0x13a6fb,null))[_0xb575('0x30')](saveUpdates(_0x23cc0f[_0xb575('0x52')],null))[_0xb575('0x30')](respondWithResult(_0x13a6fb,null))[_0xb575('0x24')](handleError(_0x13a6fb,null));};exports[_0xb575('0x53')]=function(_0x3c7823,_0x151d01,_0x12df54){if(_0x3c7823[_0xb575('0x54')]&&_0x3c7823['file'][_0xb575('0x55')]){_0x3c7823['body'][_0xb575('0x56')]=_0x3c7823[_0xb575('0x54')][_0xb575('0x55')];}return db[_0xb575('0x36')][_0xb575('0x51')]({'where':{'id':_0x3c7823[_0xb575('0x4f')]['id']}})['then'](handleEntityNotFound(_0x151d01,null))['then'](saveUpdates(_0x3c7823[_0xb575('0x52')],null))[_0xb575('0x30')](respondWithResult(_0x151d01,null))[_0xb575('0x24')](handleError(_0x151d01,null));};exports[_0xb575('0x57')]=function(_0x159534,_0x565690,_0x1a1801){if(_0x159534[_0xb575('0x54')]&&_0x159534['file']['filename']){_0x159534[_0xb575('0x52')][_0xb575('0x58')]=_0x159534[_0xb575('0x54')][_0xb575('0x55')];}return db['Setting'][_0xb575('0x51')]({'where':{'id':_0x159534[_0xb575('0x4f')]['id']}})[_0xb575('0x30')](handleEntityNotFound(_0x565690,null))['then'](saveUpdates(_0x159534[_0xb575('0x52')],null))[_0xb575('0x30')](respondWithResult(_0x565690,null))[_0xb575('0x24')](handleError(_0x565690,null));};var utilLicense=require(_0xb575('0x17'));exports[_0xb575('0x59')]=function(_0x3d6491,_0x10990c,_0x35f702){var _0xee178=_0xb575('0x5a');var _0x3337a0={'custom':![]};return utilLicense['getLicense']()[_0xb575('0x30')](function(_0x1c8037){if(_0x1c8037){_0x3337a0=_0x1c8037;}return db[_0xb575('0x36')][_0xb575('0x51')]({'where':{'id':_0x3d6491[_0xb575('0x4f')]['id']},'attributes':[_0xb575('0x56'),_0xb575('0x58'),_0xb575('0x5b'),_0xb575('0x5c'),'defaultLogo',_0xb575('0x5d'),_0xb575('0x5e'),'defaultFavicon'],'raw':!![]});})[_0xb575('0x30')](handleEntityNotFound(_0x10990c,null))[_0xb575('0x30')](function(_0x10e371){if(_0x10e371){var _0x342e50=_0x10e371[_0xb575('0x56')]&&fs[_0xb575('0x5f')](path['join'](config['root'],_0xee178,_['toLower'](_0x10e371[_0xb575('0x56')])))?path['join'](config[_0xb575('0x60')],_0xee178,_[_0xb575('0x61')](_0x10e371[_0xb575('0x56')])):path['join'](config[_0xb575('0x60')],_0xee178,_['toLower']('default_logo.svg'));var _0x590422=_0xb575('0x62')+_[_0xb575('0x63')](_0xb575('0x56'));if(_0x10e371[_0x590422]||!_0x3337a0[_0xb575('0x64')]){_0x342e50=path[_0xb575('0x65')](config['root'],_0xee178,_['toLower'](_0xb575('0x66')));}if(!fs[_0xb575('0x5f')](_0x342e50)){throw new db['Sequelize'][(_0xb575('0x67'))](_[_0xb575('0x63')]('logo')+_0xb575('0x68'));}return _0x10990c[_0xb575('0x69')](_0x342e50);}})[_0xb575('0x24')](handleError(_0x10990c,null));};var utilLicense=require(_0xb575('0x17'));exports['getLogoLogin']=function(_0x3ad989,_0x17a7a5,_0x578b8a){var _0x42bf1b='server/files/images/logos';var _0x8274b9={'custom':![]};return utilLicense[_0xb575('0x6a')]()[_0xb575('0x30')](function(_0x48b1f0){if(_0x48b1f0){_0x8274b9=_0x48b1f0;}return db['Setting'][_0xb575('0x51')]({'where':{'id':_0x3ad989['params']['id']},'attributes':[_0xb575('0x56'),_0xb575('0x58'),_0xb575('0x5b'),_0xb575('0x5c'),'defaultLogo',_0xb575('0x5d'),_0xb575('0x5e'),'defaultFavicon'],'raw':!![]});})[_0xb575('0x30')](handleEntityNotFound(_0x17a7a5,null))[_0xb575('0x30')](function(_0xb8f891){if(_0xb8f891){var _0x18eac6=_0xb8f891['loginLogo']&&fs['existsSync'](path[_0xb575('0x65')](config[_0xb575('0x60')],_0x42bf1b,_[_0xb575('0x61')](_0xb8f891['loginLogo'])))?path[_0xb575('0x65')](config[_0xb575('0x60')],_0x42bf1b,_[_0xb575('0x61')](_0xb8f891[_0xb575('0x58')])):path[_0xb575('0x65')](config[_0xb575('0x60')],_0x42bf1b,_[_0xb575('0x61')]('default_loginLogo.svg'));var _0x3d4f08=_0xb575('0x62')+_[_0xb575('0x63')](_0xb575('0x58'));if(_0xb8f891[_0x3d4f08]||!_0x8274b9[_0xb575('0x64')]){_0x18eac6=path[_0xb575('0x65')](config[_0xb575('0x60')],_0x42bf1b,_[_0xb575('0x61')](_0xb575('0x6b')));}if(!fs['existsSync'](_0x18eac6)){throw new db[(_0xb575('0x6c'))][(_0xb575('0x67'))](_[_0xb575('0x63')](_0xb575('0x58'))+'\x20not\x20found');}return _0x17a7a5[_0xb575('0x69')](_0x18eac6);}})['catch'](handleError(_0x17a7a5,null));};exports[_0xb575('0x6d')]=function(_0x59f601,_0x23e486){return db[_0xb575('0x36')][_0xb575('0x51')]({'where':{'id':_0x59f601[_0xb575('0x4f')]['id']},'attributes':[_0xb575('0x6e')]})[_0xb575('0x30')](respondWithResult(_0x23e486,null))['catch'](handleError(_0x23e486,null));};exports[_0xb575('0x6f')]=function(_0x5c039f,_0x1a0800,_0x40778b){if(_0x5c039f[_0xb575('0x54')]&&_0x5c039f[_0xb575('0x54')][_0xb575('0x55')]){_0x5c039f[_0xb575('0x52')][_0xb575('0x5b')]=_0x5c039f[_0xb575('0x54')][_0xb575('0x55')];}return db['Setting'][_0xb575('0x51')]({'where':{'id':_0x5c039f['params']['id']}})[_0xb575('0x30')](handleEntityNotFound(_0x1a0800,null))[_0xb575('0x30')](saveUpdates(_0x5c039f[_0xb575('0x52')],null))[_0xb575('0x30')](respondWithResult(_0x1a0800,null))[_0xb575('0x24')](handleError(_0x1a0800,null));};var utilLicense=require(_0xb575('0x17'));exports[_0xb575('0x70')]=function(_0x1ac5d6,_0x561b36,_0x42afff){var _0x58d6b5='server/files/images/logos';var _0x2800ab={'custom':![]};return utilLicense[_0xb575('0x6a')]()['then'](function(_0x4c4748){if(_0x4c4748){_0x2800ab=_0x4c4748;}return db[_0xb575('0x36')][_0xb575('0x51')]({'where':{'id':_0x1ac5d6[_0xb575('0x4f')]['id']},'attributes':[_0xb575('0x56'),_0xb575('0x58'),_0xb575('0x5b'),_0xb575('0x5c'),_0xb575('0x71'),'defaultLoginLogo',_0xb575('0x5e'),_0xb575('0x72')],'raw':!![]});})[_0xb575('0x30')](handleEntityNotFound(_0x561b36,null))[_0xb575('0x30')](function(_0xf60bbf){if(_0xf60bbf){var _0x3f9732=_0xf60bbf[_0xb575('0x5b')]&&fs['existsSync'](path[_0xb575('0x65')](config[_0xb575('0x60')],_0x58d6b5,_[_0xb575('0x61')](_0xf60bbf[_0xb575('0x5b')])))?path['join'](config[_0xb575('0x60')],_0x58d6b5,_[_0xb575('0x61')](_0xf60bbf[_0xb575('0x5b')])):path['join'](config['root'],_0x58d6b5,_['toLower']('default_preferred.png'));var _0x81b332='default'+_['upperFirst'](_0xb575('0x5b'));if(_0xf60bbf[_0x81b332]||!_0x2800ab[_0xb575('0x64')]||!_0x2800ab[_0xb575('0x5b')]){_0x3f9732=path['join'](config['root'],_0x58d6b5,_[_0xb575('0x61')](_0xb575('0x73')));}if(!fs[_0xb575('0x5f')](_0x3f9732)){throw new db[(_0xb575('0x6c'))]['ValidationError'](_[_0xb575('0x63')]('preferred')+_0xb575('0x68'));}return _0x561b36['download'](_0x3f9732);}})[_0xb575('0x24')](handleError(_0x561b36,null));};exports[_0xb575('0x74')]=function(_0x134b82,_0x45d80d,_0x2af15f){if(_0x134b82['file']&&_0x134b82[_0xb575('0x54')][_0xb575('0x55')]){_0x134b82['body'][_0xb575('0x5c')]=_0x134b82[_0xb575('0x54')][_0xb575('0x55')];}return db[_0xb575('0x36')]['find']({'where':{'id':_0x134b82[_0xb575('0x4f')]['id']}})[_0xb575('0x30')](handleEntityNotFound(_0x45d80d,null))[_0xb575('0x30')](saveUpdates(_0x134b82[_0xb575('0x52')],null))[_0xb575('0x30')](respondWithResult(_0x45d80d,null))[_0xb575('0x24')](handleError(_0x45d80d,null));};var utilLicense=require(_0xb575('0x17'));exports[_0xb575('0x75')]=function(_0x3e7a59,_0x20ecee,_0x199b2d){var _0x498cbe=_0xb575('0x5a');var _0x383133={'custom':![]};return utilLicense[_0xb575('0x6a')]()[_0xb575('0x30')](function(_0x4eb9a0){if(_0x4eb9a0){_0x383133=_0x4eb9a0;}return db[_0xb575('0x36')]['find']({'where':{'id':_0x3e7a59['params']['id']},'attributes':[_0xb575('0x56'),_0xb575('0x58'),'preferred',_0xb575('0x5c'),_0xb575('0x71'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xb575('0x30')](handleEntityNotFound(_0x20ecee,null))['then'](function(_0x464914){if(_0x464914){var _0x5d2130=_0x464914[_0xb575('0x5c')]&&fs['existsSync'](path[_0xb575('0x65')](config[_0xb575('0x60')],_0x498cbe,_[_0xb575('0x61')](_0x464914['favicon'])))?path[_0xb575('0x65')](config[_0xb575('0x60')],_0x498cbe,_[_0xb575('0x61')](_0x464914[_0xb575('0x5c')])):path[_0xb575('0x65')](config[_0xb575('0x60')],_0x498cbe,_[_0xb575('0x61')]('default_favicon.ico'));var _0x319045=_0xb575('0x62')+_[_0xb575('0x63')](_0xb575('0x5c'));if(_0x464914[_0x319045]||!_0x383133[_0xb575('0x64')]){_0x5d2130=path[_0xb575('0x65')](config[_0xb575('0x60')],_0x498cbe,_['toLower'](_0xb575('0x76')));}if(!fs[_0xb575('0x5f')](_0x5d2130)){throw new db[(_0xb575('0x6c'))][(_0xb575('0x67'))](_[_0xb575('0x63')](_0xb575('0x5c'))+_0xb575('0x68'));}return _0x20ecee[_0xb575('0x69')](_0x5d2130);}})[_0xb575('0x24')](handleError(_0x20ecee,null));};exports[_0xb575('0x77')]=function(_0x2aee37,_0x30306d){var _0x5650a9={'offset':moment()[_0xb575('0x78')]()};_0x5650a9[_0xb575('0x79')]=moment()[_0xb575('0x78')](_0x5650a9[_0xb575('0x2b')])[_0xb575('0x7a')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x30306d[_0xb575('0x27')](0xc8)[_0xb575('0x7b')](_0x5650a9);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index bb4219d..e471828 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x329935,_0x24b29f){var _0x26d30a=function(_0x4a669f){while(--_0x4a669f){_0x329935['push'](_0x329935['shift']());}};_0x26d30a(++_0x24b29f);}(_0x3e74,0x175));var _0x43e7=function(_0x59c4d5,_0x2bc252){_0x59c4d5=_0x59c4d5-0x0;var _0x5edd81=_0x3e74[_0x59c4d5];return _0x5edd81;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x522ded,_0x338c7b){var _0x174fe8=function(_0x1f5a46){while(--_0x1f5a46){_0x522ded['push'](_0x522ded['shift']());}};_0x174fe8(++_0x338c7b);}(_0xedd9,0xfc));var _0x9edd=function(_0x2aa788,_0x498eb8){_0x2aa788=_0x2aa788-0x0;var _0x5be967=_0xedd9[_0x2aa788];return _0x5be967;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','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 8950a47..f0345b3 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 _0x088a=['attributes','map','debug','lodash','util','bluebird','rpc','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','include','model'];(function(_0x117821,_0xaa1933){var _0x4ae9ff=function(_0x253662){while(--_0x253662){_0x117821['push'](_0x117821['shift']());}};_0x4ae9ff(++_0xaa1933);}(_0x088a,0x125));var _0xa088=function(_0x522b91,_0xc14cd7){_0x522b91=_0x522b91-0x0;var _0x175698=_0x088a[_0x522b91];return _0x175698;};'use strict';var _=require(_0xa088('0x0'));var util=require(_0xa088('0x1'));var moment=require('moment');var BPromise=require(_0xa088('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa088('0x3'));var config=require(_0xa088('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xa088('0x5')][_0xa088('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d8bd4,_0x155dad,_0x460999){return new BPromise(function(_0x2e5f77,_0x463a94){return client[_0xa088('0x7')](_0x3d8bd4,_0x460999)[_0xa088('0x8')](function(_0x5133b5){logger['info'](_0xa088('0x9'),_0x155dad,_0xa088('0xa'));logger['debug'](_0xa088('0xb'),_0x155dad,_0xa088('0xa'),JSON['stringify'](_0x5133b5));if(_0x5133b5['error']){if(_0x5133b5[_0xa088('0xc')][_0xa088('0xd')]===0x1f4){logger[_0xa088('0xc')]('Setting,\x20%s,\x20%s',_0x155dad,_0x5133b5[_0xa088('0xc')]['message']);return _0x463a94(_0x5133b5[_0xa088('0xc')][_0xa088('0xe')]);}logger[_0xa088('0xc')](_0xa088('0x9'),_0x155dad,_0x5133b5[_0xa088('0xc')][_0xa088('0xe')]);return _0x2e5f77(_0x5133b5[_0xa088('0xc')][_0xa088('0xe')]);}else{logger[_0xa088('0xf')](_0xa088('0x9'),_0x155dad,_0xa088('0xa'));_0x2e5f77(_0x5133b5[_0xa088('0x10')]['message']);}})[_0xa088('0x11')](function(_0x43cc08){logger[_0xa088('0xc')]('Setting,\x20%s,\x20%s',_0x155dad,_0x43cc08);_0x463a94(_0x43cc08);});});}exports[_0xa088('0x12')]=function(_0x1dd79b){var _0x3fa0e1=this;return new Promise(function(_0x36a34a,_0x588477){return db[_0xa088('0x13')][_0xa088('0x14')]({'raw':_0x1dd79b['options']?_0x1dd79b[_0xa088('0x15')][_0xa088('0x16')]===undefined?!![]:![]:!![],'where':_0x1dd79b[_0xa088('0x15')]?_0x1dd79b[_0xa088('0x15')][_0xa088('0x17')]||null:null,'attributes':_0x1dd79b['options']?_0x1dd79b['options']['attributes']||null:null,'include':_0x1dd79b['options']?_0x1dd79b[_0xa088('0x15')]['include']?_['map'](_0x1dd79b['options'][_0xa088('0x18')],function(_0x3a5fbb){return{'model':db[_0x3a5fbb[_0xa088('0x19')]],'as':_0x3a5fbb['as'],'attributes':_0x3a5fbb[_0xa088('0x1a')],'include':_0x3a5fbb[_0xa088('0x18')]?_[_0xa088('0x1b')](_0x3a5fbb[_0xa088('0x18')],function(_0x1328d2){return{'model':db[_0x1328d2[_0xa088('0x19')]],'as':_0x1328d2['as'],'attributes':_0x1328d2[_0xa088('0x1a')],'include':_0x1328d2[_0xa088('0x18')]?_['map'](_0x1328d2[_0xa088('0x18')],function(_0x1d2b89){return{'model':db[_0x1d2b89[_0xa088('0x19')]],'as':_0x1d2b89['as'],'attributes':_0x1d2b89[_0xa088('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa088('0x8')](function(_0x4eff76){logger[_0xa088('0xf')](_0xa088('0x12'),_0x1dd79b);logger[_0xa088('0x1c')](_0xa088('0x12'),_0x1dd79b,JSON['stringify'](_0x4eff76));_0x36a34a(_0x4eff76);})['catch'](function(_0x55a20a){logger[_0xa088('0xc')](_0xa088('0x12'),_0x55a20a['message'],_0x1dd79b);_0x588477(_0x3fa0e1['error'](0x1f4,_0x55a20a[_0xa088('0xe')]));});});}; \ No newline at end of file +var _0x47b5=['message','result','catch','Setting','find','options','raw','where','attributes','include','map','model','ShowSetting','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d1cf0,_0x35207f){var _0x32dde9=function(_0xa7d250){while(--_0xa7d250){_0x2d1cf0['push'](_0x2d1cf0['shift']());}};_0x32dde9(++_0x35207f);}(_0x47b5,0x9e));var _0x547b=function(_0x52dcd9,_0x4ae2e7){_0x52dcd9=_0x52dcd9-0x0;var _0x270900=_0x47b5[_0x52dcd9];return _0x270900;};'use strict';var _=require(_0x547b('0x0'));var util=require(_0x547b('0x1'));var moment=require(_0x547b('0x2'));var BPromise=require(_0x547b('0x3'));var rs=require(_0x547b('0x4'));var fs=require('fs');var Redis=require(_0x547b('0x5'));var db=require(_0x547b('0x6'))['db'];var utils=require(_0x547b('0x7'));var logger=require(_0x547b('0x8'))(_0x547b('0x9'));var config=require(_0x547b('0xa'));var jayson=require(_0x547b('0xb'));var client=jayson[_0x547b('0xc')][_0x547b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52d855,_0x5c1fd3,_0x314581){return new BPromise(function(_0x21b470,_0x4799b0){return client[_0x547b('0xe')](_0x52d855,_0x314581)[_0x547b('0xf')](function(_0x43f50e){logger[_0x547b('0x10')](_0x547b('0x11'),_0x5c1fd3,_0x547b('0x12'));logger[_0x547b('0x13')](_0x547b('0x14'),_0x5c1fd3,_0x547b('0x12'),JSON['stringify'](_0x43f50e));if(_0x43f50e[_0x547b('0x15')]){if(_0x43f50e[_0x547b('0x15')]['code']===0x1f4){logger['error'](_0x547b('0x11'),_0x5c1fd3,_0x43f50e['error'][_0x547b('0x16')]);return _0x4799b0(_0x43f50e[_0x547b('0x15')]['message']);}logger['error'](_0x547b('0x11'),_0x5c1fd3,_0x43f50e[_0x547b('0x15')][_0x547b('0x16')]);return _0x21b470(_0x43f50e[_0x547b('0x15')][_0x547b('0x16')]);}else{logger[_0x547b('0x10')](_0x547b('0x11'),_0x5c1fd3,_0x547b('0x12'));_0x21b470(_0x43f50e[_0x547b('0x17')][_0x547b('0x16')]);}})[_0x547b('0x18')](function(_0x909773){logger['error']('Setting,\x20%s,\x20%s',_0x5c1fd3,_0x909773);_0x4799b0(_0x909773);});});}exports['ShowSetting']=function(_0x50d127){var _0xcf4324=this;return new Promise(function(_0x4ac485,_0x4ec966){return db[_0x547b('0x19')][_0x547b('0x1a')]({'raw':_0x50d127[_0x547b('0x1b')]?_0x50d127[_0x547b('0x1b')][_0x547b('0x1c')]===undefined?!![]:![]:!![],'where':_0x50d127['options']?_0x50d127[_0x547b('0x1b')][_0x547b('0x1d')]||null:null,'attributes':_0x50d127[_0x547b('0x1b')]?_0x50d127[_0x547b('0x1b')][_0x547b('0x1e')]||null:null,'include':_0x50d127['options']?_0x50d127[_0x547b('0x1b')][_0x547b('0x1f')]?_[_0x547b('0x20')](_0x50d127[_0x547b('0x1b')]['include'],function(_0x2677ec){return{'model':db[_0x2677ec['model']],'as':_0x2677ec['as'],'attributes':_0x2677ec[_0x547b('0x1e')],'include':_0x2677ec[_0x547b('0x1f')]?_['map'](_0x2677ec[_0x547b('0x1f')],function(_0x399721){return{'model':db[_0x399721[_0x547b('0x21')]],'as':_0x399721['as'],'attributes':_0x399721['attributes'],'include':_0x399721['include']?_[_0x547b('0x20')](_0x399721[_0x547b('0x1f')],function(_0x1426ac){return{'model':db[_0x1426ac[_0x547b('0x21')]],'as':_0x1426ac['as'],'attributes':_0x1426ac[_0x547b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x547b('0xf')](function(_0x38644d){logger['info'](_0x547b('0x22'),_0x50d127);logger[_0x547b('0x13')](_0x547b('0x22'),_0x50d127,JSON[_0x547b('0x23')](_0x38644d));_0x4ac485(_0x38644d);})[_0x547b('0x18')](function(_0x4dd056){logger[_0x547b('0x15')](_0x547b('0x22'),_0x4dd056['message'],_0x50d127);_0x4ec966(_0xcf4324[_0x547b('0x15')](0x1f4,_0x4dd056['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8605c70..fc0d0a6 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 _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(_0x12c9ec,_0x563fcf){var _0x37d15c=function(_0xeae35b){while(--_0xeae35b){_0x12c9ec['push'](_0x12c9ec['shift']());}};_0x37d15c(++_0x563fcf);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 3e7ecc0..0be7588 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 _0x668c=['randomstring','exports','STRING','name','ENUM','twilio','skebby','connectel','clickatell','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','setDataValue','mandatoryDisposition','sequelize'];(function(_0x21d982,_0x1c6cf5){var _0x1b045d=function(_0x2126fb){while(--_0x2126fb){_0x21d982['push'](_0x21d982['shift']());}};_0x1b045d(++_0x1c6cf5);}(_0x668c,0x1b4));var _0xc668=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0x668c[_0x2649e2];return _0x4797d4;};'use strict';var Sequelize=require(_0xc668('0x0'));var rs=require(_0xc668('0x1'));module[_0xc668('0x2')]={'name':{'type':Sequelize[_0xc668('0x3')],'unique':_0xc668('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xc668('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc668('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc668('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc668('0x5')](_0xc668('0x6'),_0xc668('0x7'),_0xc668('0x8'),'clicksend','plivo',_0xc668('0x9'),'bandwidth',_0xc668('0xa'),_0xc668('0xb'),_0xc668('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xc668('0x3')]},'authToken':{'type':Sequelize[_0xc668('0x3')]},'smsMethod':{'type':Sequelize[_0xc668('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc668('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xc668('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xc668('0xd')],'defaultValue':function(){return _0xc668('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc668('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc668('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc668('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc668('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc668('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc668('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc668('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xf7a072){if(!_0xf7a072)this[_0xc668('0x11')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc668('0x12'),_0xf7a072);}}}; \ No newline at end of file +var _0xe717=['name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x4b0388,_0x3749fb){var _0x5c3406=function(_0x446f91){while(--_0x446f91){_0x4b0388['push'](_0x4b0388['shift']());}};_0x5c3406(++_0x3749fb);}(_0xe717,0x128));var _0x7e71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe717[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7e71('0x0'));var rs=require('randomstring');module[_0x7e71('0x1')]={'name':{'type':Sequelize[_0x7e71('0x2')],'unique':_0x7e71('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x7e71('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x7e71('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x7e71('0x2')],'defaultValue':function(){return rs[_0x7e71('0x4')]();}},'phone':{'type':Sequelize[_0x7e71('0x2')]},'type':{'type':Sequelize[_0x7e71('0x5')](_0x7e71('0x6'),_0x7e71('0x7'),_0x7e71('0x8'),_0x7e71('0x9'),_0x7e71('0xa'),_0x7e71('0xb'),'bandwidth',_0x7e71('0xc'),_0x7e71('0xd'),_0x7e71('0xe'))},'accountSid':{'type':Sequelize[_0x7e71('0x2')]},'authId':{'type':Sequelize[_0x7e71('0x2')]},'authToken':{'type':Sequelize[_0x7e71('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x7e71('0x2')]},'password':{'type':Sequelize[_0x7e71('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x7e71('0x2')]},'senderString':{'type':Sequelize[_0x7e71('0x2')]},'deliveryReport':{'type':Sequelize[_0x7e71('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x7e71('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7e71('0x10');}},'notificationSound':{'type':Sequelize[_0x7e71('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7e71('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e71('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7e71('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7e71('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7e71('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e71('0x11')],'comment':_0x7e71('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x7e71('0xf')],'defaultValue':![],'comment':_0x7e71('0x13'),'set':function(_0x79c1ae){if(!_0x79c1ae)this[_0x7e71('0x14')](_0x7e71('0x15'),null);this[_0x7e71('0x14')](_0x7e71('0x16'),_0x79c1ae);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 7a46005..259b167 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 _0x54f5=['reject','save','update','destroy','get','SmsAccounts','end','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','SmsAccount','includeAll','include','findAll','rows','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','SmsAccountId','findOne','Disposition','filter','removeDispositions','ids','addAnswer','order','removeAnswers','notify','Applications','account','priority','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','from','From','MessageSid','skebby','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','text','originatingAddress','clickatell','fromNumber','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','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','groupName','bandwidth','intelepeer','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','apply'];(function(_0x145100,_0xaacc8a){var _0x429ad1=function(_0x54421d){while(--_0x54421d){_0x145100['push'](_0x145100['shift']());}};_0x429ad1(++_0xaacc8a);}(_0x54f5,0x190));var _0x554f=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x54f5[_0x329664];return _0x4e346e;};'use strict';var emlformat=require(_0x554f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x554f('0x1'));var jsonpatch=require(_0x554f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x554f('0x3'));var Mustache=require(_0x554f('0x4'));var util=require(_0x554f('0x5'));var path=require(_0x554f('0x6'));var sox=require(_0x554f('0x7'));var csv=require(_0x554f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x554f('0x9'));var _=require(_0x554f('0xa'));var squel=require(_0x554f('0xb'));var crypto=require('crypto');var jsforce=require(_0x554f('0xc'));var deskjs=require(_0x554f('0xd'));var toCsv=require(_0x554f('0x8'));var querystring=require(_0x554f('0xe'));var Papa=require(_0x554f('0xf'));var Redis=require(_0x554f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x554f('0x11'));var as=require(_0x554f('0x12'));var hardwareService=require(_0x554f('0x13'));var logger=require('../../config/logger')(_0x554f('0x14'));var utils=require(_0x554f('0x15'));var config=require(_0x554f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x554f('0x17')]=_['defaults'](config[_0x554f('0x17')],{'host':_0x554f('0x18'),'port':0x18eb});var socket=require(_0x554f('0x19'))(new Redis(config[_0x554f('0x17')]));require(_0x554f('0x1a'))[_0x554f('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x554f('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x4e8bb3,_0x55ca30,_0x4cb624,_0x40b217){return new BPromise(function(_0x4e308a,_0x2afde1){var _0x5d5c2c=_0x40b217||client;return _0x5d5c2c[_0x554f('0x1d')](_0x4e8bb3,_0x4cb624)[_0x554f('0x1e')](function(_0x268fde){logger[_0x554f('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x55ca30,_0x554f('0x20'));logger['debug'](_0x554f('0x21'),_0x55ca30,_0x554f('0x20'),JSON[_0x554f('0x22')](_0x268fde));if(_0x268fde[_0x554f('0x23')]){if(_0x268fde[_0x554f('0x23')][_0x554f('0x24')]===0x1f4){logger[_0x554f('0x23')](_0x554f('0x25'),_0x55ca30,_0x268fde[_0x554f('0x23')][_0x554f('0x26')]);return _0x2afde1(_0x268fde['error'][_0x554f('0x26')]);}logger[_0x554f('0x23')](_0x554f('0x25'),_0x55ca30,_0x268fde['error'][_0x554f('0x26')]);return _0x4e308a(_0x268fde[_0x554f('0x23')]['message']);}else{logger[_0x554f('0x1f')](_0x554f('0x25'),_0x55ca30,_0x554f('0x20'));_0x4e308a(_0x268fde[_0x554f('0x27')]['message']);}})[_0x554f('0x28')](function(_0x5e04a1){logger[_0x554f('0x23')](_0x554f('0x25'),_0x55ca30,_0x5e04a1);_0x2afde1(_0x5e04a1);});});}function respondWithStatusCode(_0x20acb0,_0x37a175){_0x37a175=_0x37a175||0xcc;return function(_0x46174d){if(_0x46174d){return _0x20acb0[_0x554f('0x29')](_0x37a175);}return _0x20acb0[_0x554f('0x2a')](_0x37a175)['end']();};}function respondWithResult(_0x31bbfe,_0x174065){_0x174065=_0x174065||0xc8;return function(_0x38a49b){if(_0x38a49b){return _0x31bbfe['status'](_0x174065)[_0x554f('0x2b')](_0x38a49b);}};}function respondWithFilteredResult(_0x4f8954,_0x199853){return function(_0x14febb){if(_0x14febb){var _0x56675a=typeof _0x199853[_0x554f('0x2c')]==='undefined'&&typeof _0x199853[_0x554f('0x2d')]===_0x554f('0x2e');var _0x4af3ef=_0x14febb['count'];var _0x206ffa=_0x56675a?0x0:_0x199853['offset'];var _0x437a43=_0x56675a?_0x14febb[_0x554f('0x2f')]:_0x199853[_0x554f('0x2c')]+_0x199853[_0x554f('0x2d')];var _0x47b170;if(_0x437a43>=_0x4af3ef){_0x437a43=_0x4af3ef;_0x47b170=0xc8;}else{_0x47b170=0xce;}_0x4f8954[_0x554f('0x2a')](_0x47b170);return _0x4f8954[_0x554f('0x30')]('Content-Range',_0x206ffa+'-'+_0x437a43+'/'+_0x4af3ef)['json'](_0x14febb);}return null;};}function patchUpdates(_0x61bf87){return function(_0x1af3d8){try{jsonpatch[_0x554f('0x31')](_0x1af3d8,_0x61bf87,!![]);}catch(_0x315937){return BPromise[_0x554f('0x32')](_0x315937);}return _0x1af3d8[_0x554f('0x33')]();};}function saveUpdates(_0x28758c,_0x484236){return function(_0x4e4241){if(_0x4e4241){return _0x4e4241[_0x554f('0x34')](_0x28758c)[_0x554f('0x1e')](function(_0x3656a8){return _0x3656a8;});}return null;};}function removeEntity(_0x3edf63,_0x4922d9){return function(_0x315ca9){if(_0x315ca9){return _0x315ca9[_0x554f('0x35')]()['then'](function(){var _0x7daf2d=_0x315ca9[_0x554f('0x36')]({'plain':!![]});var _0x3a9253=_0x554f('0x37');return db['UserProfileResource'][_0x554f('0x35')]({'where':{'type':_0x3a9253,'resourceId':_0x7daf2d['id']}})[_0x554f('0x1e')](function(){return _0x315ca9;});})['then'](function(){_0x3edf63[_0x554f('0x2a')](0xcc)[_0x554f('0x38')]();});}};}function handleEntityNotFound(_0x264e69,_0x2ae9c1){return function(_0x2beefc){if(!_0x2beefc){_0x264e69[_0x554f('0x29')](0x194);}return _0x2beefc;};}function handleError(_0x59043e,_0x1cfa9f){_0x1cfa9f=_0x1cfa9f||0x1f4;return function(_0x40e17d){logger[_0x554f('0x23')](_0x40e17d[_0x554f('0x39')]);if(_0x40e17d[_0x554f('0x3a')]){delete _0x40e17d[_0x554f('0x3a')];}_0x59043e[_0x554f('0x2a')](_0x1cfa9f)[_0x554f('0x3b')](_0x40e17d);};}exports['index']=function(_0x2d5edb,_0xad3af1){var _0x18abbe={'include':[{'model':db['Pause'],'as':_0x554f('0x3c')}]},_0x466726={},_0x59c1a5={'count':0x0,'rows':[]};var _0x832a4c=_[_0x554f('0x3d')](db['SmsAccount'][_0x554f('0x3e')],function(_0x41cc94){return{'name':_0x41cc94[_0x554f('0x3f')],'type':_0x41cc94[_0x554f('0x40')]['key']};});_0x466726[_0x554f('0x41')]=_['map'](_0x832a4c,_0x554f('0x3a'));_0x466726[_0x554f('0x42')]=_[_0x554f('0x43')](_0x2d5edb['query']);_0x466726[_0x554f('0x44')]=_[_0x554f('0x45')](_0x466726[_0x554f('0x41')],_0x466726[_0x554f('0x42')]);_0x18abbe[_0x554f('0x46')]=_[_0x554f('0x45')](_0x466726[_0x554f('0x41')],qs[_0x554f('0x47')](_0x2d5edb[_0x554f('0x42')][_0x554f('0x47')]));_0x18abbe[_0x554f('0x46')]=_0x18abbe[_0x554f('0x46')][_0x554f('0x48')]?_0x18abbe[_0x554f('0x46')]:_0x466726['model'];if(!_0x2d5edb[_0x554f('0x42')][_0x554f('0x49')](_0x554f('0x4a'))){_0x18abbe['limit']=qs[_0x554f('0x2d')](_0x2d5edb[_0x554f('0x42')][_0x554f('0x2d')]);_0x18abbe['offset']=qs[_0x554f('0x2c')](_0x2d5edb[_0x554f('0x42')][_0x554f('0x2c')]);}_0x18abbe['order']=qs[_0x554f('0x4b')](_0x2d5edb[_0x554f('0x42')]['sort']);_0x18abbe[_0x554f('0x4c')]=qs[_0x554f('0x44')](_[_0x554f('0x4d')](_0x2d5edb[_0x554f('0x42')],_0x466726[_0x554f('0x44')]),_0x832a4c);if(_0x2d5edb[_0x554f('0x42')]['filter']){_0x18abbe[_0x554f('0x4c')]=_[_0x554f('0x4e')](_0x18abbe['where'],{'$or':_['map'](_0x832a4c,function(_0x2f35a9){if(_0x2f35a9[_0x554f('0x40')]!=='VIRTUAL'){var _0x3b34b0={};_0x3b34b0[_0x2f35a9[_0x554f('0x3a')]]={'$like':'%'+_0x2d5edb[_0x554f('0x42')]['filter']+'%'};return _0x3b34b0;}})});}_0x18abbe=_[_0x554f('0x4e')]({},_0x18abbe,_0x2d5edb[_0x554f('0x4f')]);var _0x225196={'where':_0x18abbe[_0x554f('0x4c')]};return db[_0x554f('0x50')][_0x554f('0x2f')](_0x225196)[_0x554f('0x1e')](function(_0x152e1a){_0x59c1a5[_0x554f('0x2f')]=_0x152e1a;if(_0x2d5edb['query'][_0x554f('0x51')]){_0x18abbe[_0x554f('0x52')]=[{'all':!![]}];}return db[_0x554f('0x50')][_0x554f('0x53')](_0x18abbe);})[_0x554f('0x1e')](function(_0x85fcab){_0x59c1a5[_0x554f('0x54')]=_0x85fcab;return _0x59c1a5;})[_0x554f('0x1e')](respondWithFilteredResult(_0xad3af1,_0x18abbe))[_0x554f('0x28')](handleError(_0xad3af1,null));};exports[_0x554f('0x55')]=function(_0xfb03e9,_0x3adad7){var _0x4e0915={'raw':![],'where':{'id':_0xfb03e9[_0x554f('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1294b1={};_0x1294b1[_0x554f('0x41')]=_[_0x554f('0x43')](db[_0x554f('0x50')][_0x554f('0x3e')]);_0x1294b1[_0x554f('0x42')]=_[_0x554f('0x43')](_0xfb03e9[_0x554f('0x42')]);_0x1294b1[_0x554f('0x44')]=_['intersection'](_0x1294b1[_0x554f('0x41')],_0x1294b1['query']);_0x4e0915[_0x554f('0x46')]=_['intersection'](_0x1294b1['model'],qs[_0x554f('0x47')](_0xfb03e9[_0x554f('0x42')]['fields']));_0x4e0915['attributes']=_0x4e0915['attributes'][_0x554f('0x48')]?_0x4e0915[_0x554f('0x46')]:_0x1294b1[_0x554f('0x41')];if(_0xfb03e9[_0x554f('0x42')][_0x554f('0x51')]){_0x4e0915[_0x554f('0x52')]=[{'all':!![]}];}_0x4e0915=_[_0x554f('0x4e')]({},_0x4e0915,_0xfb03e9[_0x554f('0x4f')]);return db[_0x554f('0x50')]['find'](_0x4e0915)[_0x554f('0x1e')](handleEntityNotFound(_0x3adad7,null))['then'](respondWithResult(_0x3adad7,null))[_0x554f('0x28')](handleError(_0x3adad7,null));};exports['create']=function(_0x498855,_0x1e3f22){return db['SmsAccount']['create'](_0x498855[_0x554f('0x57')],{})[_0x554f('0x1e')](function(_0x3a08c0){var _0x224728=_0x498855[_0x554f('0x58')]['get']({'plain':!![]});if(!_0x224728)throw new Error(_0x554f('0x59'));if(_0x224728['role']===_0x554f('0x58')){var _0x103ba5=_0x3a08c0[_0x554f('0x36')]({'plain':!![]});var _0x56db46=_0x554f('0x37');return db[_0x554f('0x5a')][_0x554f('0x5b')]({'where':{'name':_0x56db46,'userProfileId':_0x224728[_0x554f('0x5c')]},'raw':!![]})[_0x554f('0x1e')](function(_0x2c3fe9){if(_0x2c3fe9&&_0x2c3fe9[_0x554f('0x5d')]===0x0){return db[_0x554f('0x5e')][_0x554f('0x5f')]({'name':_0x103ba5[_0x554f('0x3a')],'resourceId':_0x103ba5['id'],'type':_0x2c3fe9[_0x554f('0x3a')],'sectionId':_0x2c3fe9['id']},{})[_0x554f('0x1e')](function(){return _0x3a08c0;});}else{return _0x3a08c0;}})[_0x554f('0x28')](function(_0x403792){logger[_0x554f('0x23')](_0x554f('0x60'),_0x403792);throw _0x403792;});}return _0x3a08c0;})['then'](respondWithResult(_0x1e3f22,0xc9))['catch'](handleError(_0x1e3f22,null));};exports[_0x554f('0x34')]=function(_0x2ecf2f,_0x1c489c){if(_0x2ecf2f['body']['id']){delete _0x2ecf2f['body']['id'];}return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x2ecf2f[_0x554f('0x56')]['id']},'include':[{'model':db[_0x554f('0x61')],'as':'mandatoryDispositionPause'}]})[_0x554f('0x1e')](handleEntityNotFound(_0x1c489c,null))[_0x554f('0x1e')](saveUpdates(_0x2ecf2f[_0x554f('0x57')],null))['then'](respondWithResult(_0x1c489c,null))[_0x554f('0x28')](handleError(_0x1c489c,null));};exports[_0x554f('0x35')]=function(_0x48fd13,_0x46e7e8){return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x48fd13[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x46e7e8,null))[_0x554f('0x1e')](removeEntity(_0x46e7e8,null))['catch'](handleError(_0x46e7e8,null));};exports[_0x554f('0x62')]=function(_0x42fbd7,_0x483a0c){return db[_0x554f('0x50')][_0x554f('0x62')]()[_0x554f('0x1e')](respondWithResult(_0x483a0c,null))[_0x554f('0x28')](handleError(_0x483a0c,null));};exports[_0x554f('0x63')]=function(_0x1ecc51,_0x555a49,_0x188347){if(_0x1ecc51[_0x554f('0x57')]['id']){delete _0x1ecc51[_0x554f('0x57')]['id'];}return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x1ecc51['params']['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x555a49,null))['then'](function(_0x123505){if(_0x123505){_0x1ecc51[_0x554f('0x57')][_0x554f('0x64')]=_0x123505['id'];return db['Disposition'][_0x554f('0x5f')](_0x1ecc51[_0x554f('0x57')]);}})[_0x554f('0x1e')](respondWithResult(_0x555a49,null))['catch'](handleError(_0x555a49,null));};exports['getDispositions']=function(_0xb59612,_0x2f19d5,_0x5867af){var _0x34b310={'raw':![],'where':{}};var _0x2ab6c2={};var _0x1349e4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x554f('0x65')]({'where':{'id':_0xb59612[_0x554f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2f19d5,null))[_0x554f('0x1e')](function(_0x5b95f8){if(_0x5b95f8){_0x2ab6c2[_0x554f('0x41')]=_[_0x554f('0x43')](db[_0x554f('0x66')][_0x554f('0x3e')]);_0x2ab6c2[_0x554f('0x42')]=_[_0x554f('0x43')](_0xb59612[_0x554f('0x42')]);_0x2ab6c2['filters']=_[_0x554f('0x45')](_0x2ab6c2[_0x554f('0x41')],_0x2ab6c2[_0x554f('0x42')]);_0x34b310[_0x554f('0x46')]=_[_0x554f('0x45')](_0x2ab6c2[_0x554f('0x41')],qs[_0x554f('0x47')](_0xb59612[_0x554f('0x42')][_0x554f('0x47')]));_0x34b310[_0x554f('0x46')]=_0x34b310[_0x554f('0x46')][_0x554f('0x48')]?_0x34b310[_0x554f('0x46')]:_0x2ab6c2[_0x554f('0x41')];if(!_0xb59612[_0x554f('0x42')][_0x554f('0x49')](_0x554f('0x4a'))){_0x34b310['limit']=qs[_0x554f('0x2d')](_0xb59612[_0x554f('0x42')]['limit']);_0x34b310['offset']=qs[_0x554f('0x2c')](_0xb59612[_0x554f('0x42')][_0x554f('0x2c')]);}_0x34b310['order']=qs[_0x554f('0x4b')](_0xb59612[_0x554f('0x42')][_0x554f('0x4b')]);_0x34b310[_0x554f('0x4c')]=qs[_0x554f('0x44')](_[_0x554f('0x4d')](_0xb59612[_0x554f('0x42')],_0x2ab6c2[_0x554f('0x44')]));_0x34b310[_0x554f('0x4c')][_0x554f('0x64')]=_0x5b95f8['id'];if(_0xb59612[_0x554f('0x42')][_0x554f('0x67')]){_0x34b310[_0x554f('0x4c')]=_[_0x554f('0x4e')](_0x34b310['where'],{'$or':_[_0x554f('0x3d')](_0x34b310[_0x554f('0x46')],function(_0xb395f9){var _0x554358={};_0x554358[_0xb395f9]={'$like':'%'+_0xb59612[_0x554f('0x42')]['filter']+'%'};return _0x554358;})});}_0x34b310=_[_0x554f('0x4e')]({},_0x34b310,_0xb59612[_0x554f('0x4f')]);return db[_0x554f('0x66')][_0x554f('0x2f')]({'where':_0x34b310[_0x554f('0x4c')]})[_0x554f('0x1e')](function(_0x405cab){_0x1349e4['count']=_0x405cab;if(_0xb59612[_0x554f('0x42')][_0x554f('0x51')]){_0x34b310[_0x554f('0x52')]=[{'all':!![]}];}return db[_0x554f('0x66')][_0x554f('0x53')](_0x34b310);})[_0x554f('0x1e')](function(_0x143b83){_0x1349e4[_0x554f('0x54')]=_0x143b83;return _0x1349e4;});}})[_0x554f('0x1e')](respondWithFilteredResult(_0x2f19d5,_0x34b310))[_0x554f('0x28')](handleError(_0x2f19d5,null));};exports[_0x554f('0x68')]=function(_0x965d0c,_0x351850,_0x3aaa88){return db['SmsAccount'][_0x554f('0x5b')]({'where':{'id':_0x965d0c[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x351850,null))[_0x554f('0x1e')](function(_0x4a1359){if(_0x4a1359){return _0x4a1359[_0x554f('0x68')](_0x965d0c['query'][_0x554f('0x69')]);}})['then'](respondWithStatusCode(_0x351850,null))[_0x554f('0x28')](handleError(_0x351850,null));};exports[_0x554f('0x6a')]=function(_0x5f4b7c,_0x76ccf9,_0x1fa2d8){if(_0x5f4b7c['body']['id']){delete _0x5f4b7c['body']['id'];}return db['SmsAccount'][_0x554f('0x5b')]({'where':{'id':_0x5f4b7c[_0x554f('0x56')]['id']}})['then'](handleEntityNotFound(_0x76ccf9,null))[_0x554f('0x1e')](function(_0x2d3d8c){if(_0x2d3d8c){_0x5f4b7c['body'][_0x554f('0x64')]=_0x2d3d8c['id'];return db['CannedAnswer'][_0x554f('0x5f')](_0x5f4b7c[_0x554f('0x57')]);}})[_0x554f('0x1e')](respondWithResult(_0x76ccf9,null))[_0x554f('0x28')](handleError(_0x76ccf9,null));};exports['getAnswers']=function(_0x5c317a,_0x279ae2,_0x42b952){var _0x3d9556={'raw':![],'where':{}};var _0x31c078={};var _0x1cefbb={'count':0x0,'rows':[]};return db[_0x554f('0x50')][_0x554f('0x65')]({'where':{'id':_0x5c317a[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x279ae2,null))[_0x554f('0x1e')](function(_0x434f70){if(_0x434f70){_0x31c078['model']=_[_0x554f('0x43')](db['CannedAnswer'][_0x554f('0x3e')]);_0x31c078[_0x554f('0x42')]=_['keys'](_0x5c317a['query']);_0x31c078[_0x554f('0x44')]=_['intersection'](_0x31c078[_0x554f('0x41')],_0x31c078[_0x554f('0x42')]);_0x3d9556[_0x554f('0x46')]=_['intersection'](_0x31c078['model'],qs[_0x554f('0x47')](_0x5c317a[_0x554f('0x42')]['fields']));_0x3d9556[_0x554f('0x46')]=_0x3d9556[_0x554f('0x46')][_0x554f('0x48')]?_0x3d9556[_0x554f('0x46')]:_0x31c078[_0x554f('0x41')];if(!_0x5c317a[_0x554f('0x42')]['hasOwnProperty']('nolimit')){_0x3d9556['limit']=qs['limit'](_0x5c317a[_0x554f('0x42')]['limit']);_0x3d9556[_0x554f('0x2c')]=qs[_0x554f('0x2c')](_0x5c317a[_0x554f('0x42')][_0x554f('0x2c')]);}_0x3d9556[_0x554f('0x6b')]=qs[_0x554f('0x4b')](_0x5c317a[_0x554f('0x42')]['sort']);_0x3d9556[_0x554f('0x4c')]=qs[_0x554f('0x44')](_[_0x554f('0x4d')](_0x5c317a['query'],_0x31c078['filters']));_0x3d9556[_0x554f('0x4c')]['SmsAccountId']=_0x434f70['id'];if(_0x5c317a[_0x554f('0x42')]['filter']){_0x3d9556['where']=_[_0x554f('0x4e')](_0x3d9556[_0x554f('0x4c')],{'$or':_[_0x554f('0x3d')](_0x3d9556['attributes'],function(_0x2bfc23){var _0x429ebc={};_0x429ebc[_0x2bfc23]={'$like':'%'+_0x5c317a[_0x554f('0x42')][_0x554f('0x67')]+'%'};return _0x429ebc;})});}_0x3d9556=_[_0x554f('0x4e')]({},_0x3d9556,_0x5c317a[_0x554f('0x4f')]);return db['CannedAnswer'][_0x554f('0x2f')]({'where':_0x3d9556[_0x554f('0x4c')]})[_0x554f('0x1e')](function(_0x2cbf4f){_0x1cefbb[_0x554f('0x2f')]=_0x2cbf4f;if(_0x5c317a[_0x554f('0x42')][_0x554f('0x51')]){_0x3d9556['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x554f('0x53')](_0x3d9556);})[_0x554f('0x1e')](function(_0x164a8f){_0x1cefbb[_0x554f('0x54')]=_0x164a8f;return _0x1cefbb;});}})[_0x554f('0x1e')](respondWithFilteredResult(_0x279ae2,_0x3d9556))[_0x554f('0x28')](handleError(_0x279ae2,null));};exports[_0x554f('0x6c')]=function(_0x103632,_0x4d74b4,_0x289f92){return db['SmsAccount'][_0x554f('0x5b')]({'where':{'id':_0x103632[_0x554f('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d74b4,null))[_0x554f('0x1e')](function(_0x542f93){if(_0x542f93){return _0x542f93[_0x554f('0x6c')](_0x103632[_0x554f('0x42')][_0x554f('0x69')]);}})[_0x554f('0x1e')](respondWithStatusCode(_0x4d74b4,null))['catch'](handleError(_0x4d74b4,null));};exports[_0x554f('0x6d')]=function(_0x3b7574,_0x1aff89,_0x44ec59){var _0x5bfd1c={'channel':'sms'};var _0x1dcccd=[];var _0x2f2e75=[];var _0x4588b9={};return db['SmsAccount'][_0x554f('0x5b')]({'where':{'id':_0x3b7574[_0x554f('0x56')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x554f('0x6e')}]})[_0x554f('0x1e')](handleEntityNotFound(_0x1aff89,null))[_0x554f('0x1e')](function(_0x240e6a){_0x5bfd1c[_0x554f('0x6f')]=_0x240e6a;_0x5bfd1c['applications']=_['orderBy'](_0x240e6a['Applications'],[_0x554f('0x70')],['asc']);if(_0x5bfd1c[_0x554f('0x6f')][_0x554f('0x6e')]){delete _0x5bfd1c[_0x554f('0x6f')][_0x554f('0x6e')];}return db[_0x554f('0x71')][_0x554f('0x62')]();})[_0x554f('0x1e')](function(_0x5e6b52){if(!_0x5e6b52){throw new db[(_0x554f('0x72'))][(_0x554f('0x73'))]('no\x20available\x20attributes');}_0x1dcccd=_['difference'](_['keys'](_0x5e6b52),['createdAt',_0x554f('0x74')]);_0x2f2e75=_[_0x554f('0x75')](_['keys'](_0x5e6b52),[_0x554f('0x76'),'updatedAt',_0x554f('0x77'),_0x554f('0x78')]);_0x5bfd1c['body']={'mapKey':'mobile'};if(_0x5bfd1c[_0x554f('0x6f')]['type']){switch(_0x5bfd1c[_0x554f('0x6f')][_0x554f('0x40')]){case'twilio':_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x7a')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')]['Body'];_0x5bfd1c['body']['messageId']=_0x3b7574[_0x554f('0x57')][_0x554f('0x7b')];break;case _0x554f('0x7c'):_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]='+'+_0x3b7574['body']['sender'];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')]['text'];break;case _0x554f('0x7d'):_0x5bfd1c[_0x554f('0x57')]['from']=_0x3b7574[_0x554f('0x57')][_0x554f('0x79')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x26')];break;case _0x554f('0x7e'):_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x79')];_0x5bfd1c['body'][_0x554f('0x57')]=_0x3b7574['body'][_0x554f('0x57')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x80')];break;case _0x554f('0x81'):_0x5bfd1c['body'][_0x554f('0x79')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x7a')];_0x5bfd1c[_0x554f('0x57')]['body']=_0x3b7574[_0x554f('0x57')][_0x554f('0x82')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x83')];break;case _0x554f('0x84'):_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]='+'+_0x3b7574[_0x554f('0x57')][_0x554f('0x85')][0x0][_0x554f('0x79')];_0x5bfd1c['body'][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')]['results'][0x0][_0x554f('0x86')];_0x5bfd1c['body'][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x85')][0x0][_0x554f('0x7f')];break;case'csc':_0x5bfd1c[_0x554f('0x57')]['from']=_0x3b7574[_0x554f('0x57')][_0x554f('0x87')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')]['segmentedMessage'][_0x554f('0x26')];break;case _0x554f('0x88'):_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x89')];_0x5bfd1c[_0x554f('0x57')]['body']=_0x3b7574['body']['text'];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')]['replyMessageId'];break;case'bandwidth':_0x5bfd1c[_0x554f('0x57')][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')][0x0][_0x554f('0x26')]['id'];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')]=_0x3b7574[_0x554f('0x57')][0x0]['message']['from'];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')][0x0][_0x554f('0x26')][_0x554f('0x86')];break;case'intelepeer':_0x5bfd1c['body'][_0x554f('0x79')]=_0x3b7574['body'][_0x554f('0x79')];_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]=_0x3b7574[_0x554f('0x57')][_0x554f('0x26')];_0x5bfd1c['body'][_0x554f('0x7f')]=_0x3b7574[_0x554f('0x57')]['refid'];break;}}if(_0x5bfd1c[_0x554f('0x57')]['id']){delete _0x5bfd1c['body']['id'];}if(_[_0x554f('0x8a')](_0x5bfd1c['body'][_0x554f('0x79')])){throw new db[(_0x554f('0x72'))][(_0x554f('0x73'))](_0x554f('0x8b'));}if(_[_0x554f('0x8a')](_0x5bfd1c['body'][_0x554f('0x57')])||_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')]===''){throw new db[(_0x554f('0x72'))][(_0x554f('0x73'))](_0x554f('0x8c'));}if(_[_0x554f('0x8a')](_0x5bfd1c[_0x554f('0x57')][_0x554f('0x8d')])){throw new db['Sequelize'][(_0x554f('0x73'))](_0x554f('0x8e')+_0x2f2e75);}if(!_[_0x554f('0x8f')](_0x2f2e75,_0x5bfd1c[_0x554f('0x57')][_0x554f('0x8d')])){throw new db[(_0x554f('0x72'))][(_0x554f('0x73'))](_0x554f('0x90')+_0x2f2e75);}_0x4588b9[_0x5bfd1c[_0x554f('0x57')][_0x554f('0x8d')]]=_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')];return db[_0x554f('0x91')][_0x554f('0x5b')]({'where':{'id':_0x5bfd1c['account']['ListId']},'include':[{'model':db[_0x554f('0x71')],'as':'Contacts','where':_0x4588b9,'limit':0x1,'order':[['updatedAt',_0x554f('0x92')]]}]});})[_0x554f('0x1e')](handleEntityNotFound(_0x1aff89,null))['then'](function(_0x442151){if(_0x442151){_0x5bfd1c[_0x554f('0x93')]=_[_0x554f('0x94')](_0x442151,[_0x554f('0x95')]);if(_0x442151['Contacts']['length']){return _0x442151['Contacts'][0x0];}var _0x2c9def=_['defaults'](_0x5bfd1c[_0x554f('0x57')],{'firstName':_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')],'ListId':_0x442151['id']});_0x2c9def[_0x5bfd1c[_0x554f('0x57')][_0x554f('0x8d')]]=_0x5bfd1c[_0x554f('0x57')][_0x554f('0x79')];return db['CmContact'][_0x554f('0x5f')](_0x2c9def,{'fields':_0x1dcccd,'raw':!![]});}})[_0x554f('0x1e')](handleEntityNotFound(_0x1aff89,null))[_0x554f('0x1e')](function(_0xcb9957){if(_0xcb9957){_0x5bfd1c[_0x554f('0x96')]=_0xcb9957;var _0x55bddf={'ContactId':_0xcb9957['id'],'phone':_0x5bfd1c['body'][_0x554f('0x79')],'SmsAccountId':_0x3b7574[_0x554f('0x56')]['id']};var _0x359c5d={'ContactId':_0xcb9957['id'],'SmsAccountId':_0x3b7574[_0x554f('0x56')]['id'],'closed':![]};return db[_0x554f('0x97')][_0x554f('0x5b')]({'where':_0x359c5d})[_0x554f('0x1e')](function(_0x313d52){if(_0x313d52){return[_0x313d52,![]];}return db[_0x554f('0x97')][_0x554f('0x5f')](_0x55bddf)[_0x554f('0x1e')](function(_0x17a445){return[_0x17a445,!![]];});});}})[_0x554f('0x98')](function(_0x340ad5,_0x1cc14d){_0x5bfd1c[_0x554f('0x99')]=_0x340ad5['get']({'plain':!![]});_0x5bfd1c[_0x554f('0x99')][_0x554f('0x9a')]=![];if(_0x1cc14d){if(_0x5bfd1c[_0x554f('0x6f')][_0x554f('0x9b')]){_0x5bfd1c[_0x554f('0x9c')][_0x554f('0x9d')]({'id':0x0,'priority':_0x5bfd1c[_0x554f('0x9c')]['length']+0x1,'app':_0x554f('0x9e'),'appdata':_0x554f('0x9f'),'interval':'*,*,*,*'});}_0x5bfd1c[_0x554f('0x99')][_0x554f('0x9a')]=!![];}return db['SmsMessage'][_0x554f('0x5f')]({'phone':_0x5bfd1c['body'][_0x554f('0x79')],'messageId':_0x5bfd1c['body'][_0x554f('0x7f')],'body':_0x5bfd1c[_0x554f('0x57')][_0x554f('0x57')],'SmsAccountId':_0x3b7574[_0x554f('0x56')]['id'],'SmsInteractionId':_0x340ad5['id'],'direction':'in','ContactId':_0x340ad5[_0x554f('0xa0')],'AttachmentId':_0x5bfd1c[_0x554f('0x57')][_0x554f('0xa1')]});})[_0x554f('0x1e')](function(_0x452a06){_0x5bfd1c[_0x554f('0x26')]=_0x452a06;if(_0x5bfd1c[_0x554f('0x99')][_0x554f('0xa2')]){return db['User']['find']({'attributes':['id',_0x554f('0x3a')],'where':{'id':_0x5bfd1c[_0x554f('0x99')][_0x554f('0xa2')]}})[_0x554f('0x1e')](function(_0x50d8b2){if(_0x50d8b2){_0x5bfd1c[_0x554f('0x9c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x554f('0xa3'),'appdata':_0x50d8b2[_0x554f('0x3a')]+','+(_0x5bfd1c[_0x554f('0x6f')][_0x554f('0xa4')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x554f('0xa5'),_0x554f('0xa6'),_0x5bfd1c);});}return respondWithRpcPromise(_0x554f('0xa5'),_0x554f('0xa6'),_0x5bfd1c);})[_0x554f('0x1e')](function(_0x49c69e){if(_0x49c69e){var _0xff5eee=0xc8;var _0x4dafaa=_0x554f('0xa7');logger[_0x554f('0x1f')](_0x554f('0x21'),_0x4dafaa,_0xff5eee,'entity\x20found');logger[_0x554f('0xa8')](_0x554f('0xa9'),_0x4dafaa,_0xff5eee,_0x554f('0xaa'),JSON[_0x554f('0x22')](_0x49c69e));if(_0x5bfd1c[_0x554f('0x6f')][_0x554f('0x40')]===_0x554f('0xab')){return _0x1aff89['status'](_0xff5eee)[_0x554f('0x30')](_0x554f('0xac'),_0x554f('0xad'))['send'](_0x554f('0xae'));}else{return _0x1aff89[_0x554f('0x2a')](_0xff5eee)[_0x554f('0x2b')](_0x49c69e);}}})[_0x554f('0x28')](handleError(_0x1aff89,null));};exports[_0x554f('0xaf')]=function(_0x5d7609,_0x5c3f19){var _0x7af976=_0x5d7609[_0x554f('0x56')]['id'];var _0x14cbd5=_0x5d7609[_0x554f('0x57')];var _0x118531=0xc8;var _0x46c09e=null;return db[_0x554f('0xb0')][_0x554f('0xb1')]({'isolationLevel':db['sequelize'][_0x554f('0xb2')][_0x554f('0xb3')][_0x554f('0xb4')]},function(_0xe04940){return db[_0x554f('0x50')]['findOne']({'where':{'id':_0x7af976},'transaction':_0xe04940})[_0x554f('0x1e')](function(_0x23f0a8){if(_0x23f0a8){return db[_0x554f('0xb5')]['destroy']({'where':{'SmsAccountId':_0x7af976},'transaction':_0xe04940})[_0x554f('0x1e')](function(){var _0xcf8d88=_['map'](_0x14cbd5,function(_0x32a54e){_0x32a54e['SmsAccountId']=_0x7af976;return _0x32a54e;});return db[_0x554f('0xb5')][_0x554f('0xb6')](_0xcf8d88,{'transaction':_0xe04940});});}else{_0x118531=0x194;_0x46c09e=[];}});})[_0x554f('0x1e')](function(){if(_0x118531!==0x194){return db['SmsApplication'][_0x554f('0xb7')]({'where':{'SmsAccountId':_0x7af976},'order':_0x554f('0x70')})['then'](function(_0x462c76){_0x46c09e=_0x462c76;});}})[_0x554f('0x28')](function(_0x3e926f){_0x118531=0x1f4;logger[_0x554f('0x23')](_0x3e926f[_0x554f('0x39')]);if(_0x3e926f['name']){delete _0x3e926f[_0x554f('0x3a')];}_0x46c09e=_0x3e926f;})[_0x554f('0xb8')](function(){if(_0x46c09e===null){_0x5c3f19[_0x554f('0x29')](_0x118531);}else{if(_0x118531===0x1f4){_0x5c3f19['status'](_0x118531)[_0x554f('0x3b')](_0x46c09e);}else{_0x5c3f19[_0x554f('0x2a')](_0x118531)['json'](_0x46c09e);}}});};exports[_0x554f('0xb9')]=function(_0x2afc27,_0x8de409,_0x59d343){var _0xd9ef8e={};var _0x77dace={};var _0x24e24f;var _0xcaa5f8;return db[_0x554f('0x50')][_0x554f('0x65')]({'where':{'id':_0x2afc27[_0x554f('0x56')]['id']}})['then'](handleEntityNotFound(_0x8de409,null))['then'](function(_0x9896b4){if(_0x9896b4){_0x24e24f=_0x9896b4;_0x77dace[_0x554f('0x41')]=_[_0x554f('0x43')](db[_0x554f('0xb5')][_0x554f('0x3e')]);_0x77dace[_0x554f('0x42')]=_[_0x554f('0x43')](_0x2afc27['query']);_0x77dace[_0x554f('0x44')]=_[_0x554f('0x45')](_0x77dace['model'],_0x77dace[_0x554f('0x42')]);_0xd9ef8e[_0x554f('0x46')]=_[_0x554f('0x45')](_0x77dace[_0x554f('0x41')],qs[_0x554f('0x47')](_0x2afc27[_0x554f('0x42')]['fields']));_0xd9ef8e['attributes']=_0xd9ef8e['attributes'][_0x554f('0x48')]?_0xd9ef8e['attributes']:_0x77dace[_0x554f('0x41')];_0xd9ef8e[_0x554f('0x6b')]=qs[_0x554f('0x4b')](_0x2afc27[_0x554f('0x42')]['sort']);_0xd9ef8e[_0x554f('0x4c')]=qs[_0x554f('0x44')](_[_0x554f('0x4d')](_0x2afc27[_0x554f('0x42')],_0x77dace[_0x554f('0x44')]));if(_0x2afc27['query'][_0x554f('0x67')]){_0xd9ef8e[_0x554f('0x4c')]=_[_0x554f('0x4e')](_0xd9ef8e[_0x554f('0x4c')],{'$or':_[_0x554f('0x3d')](_0xd9ef8e[_0x554f('0x46')],function(_0x4bc8aa){var _0x3e64df={};_0x3e64df[_0x4bc8aa]={'$like':'%'+_0x2afc27['query'][_0x554f('0x67')]+'%'};return _0x3e64df;})});}_0xd9ef8e=_[_0x554f('0x4e')]({},_0xd9ef8e,_0x2afc27[_0x554f('0x4f')]);return _0x24e24f[_0x554f('0xb9')](_0xd9ef8e);}})[_0x554f('0x1e')](function(_0x2aef02){if(_0x2aef02){_0xcaa5f8=_0x2aef02['length'];if(!_0x2afc27[_0x554f('0x42')][_0x554f('0x49')](_0x554f('0x4a'))){_0xd9ef8e['limit']=qs['limit'](_0x2afc27[_0x554f('0x42')][_0x554f('0x2d')]);_0xd9ef8e[_0x554f('0x2c')]=qs[_0x554f('0x2c')](_0x2afc27[_0x554f('0x42')][_0x554f('0x2c')]);}return _0x24e24f['getApplications'](_0xd9ef8e);}})[_0x554f('0x1e')](function(_0xf5bea){if(_0xf5bea){return _0xf5bea?{'count':_0xcaa5f8,'rows':_0xf5bea}:null;}})[_0x554f('0x1e')](respondWithResult(_0x8de409,null))[_0x554f('0x28')](handleError(_0x8de409,null));};exports[_0x554f('0xba')]=function(_0x2256a2,_0x222e21,_0x39ba54){var _0x38d831={'raw':![],'where':{}};var _0x1aca02={};var _0x32e2a2={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2256a2['params']['id']}})['then'](handleEntityNotFound(_0x222e21,null))[_0x554f('0x1e')](function(_0x9c9923){if(_0x9c9923){_0x1aca02['model']=_[_0x554f('0x43')](db[_0x554f('0x97')]['rawAttributes']);_0x1aca02['query']=_['keys'](_0x2256a2[_0x554f('0x42')]);_0x1aca02[_0x554f('0x44')]=_['intersection'](_0x1aca02[_0x554f('0x41')],_0x1aca02['query']);_0x38d831[_0x554f('0x46')]=_[_0x554f('0x45')](_0x1aca02[_0x554f('0x41')],qs[_0x554f('0x47')](_0x2256a2['query'][_0x554f('0x47')]));_0x38d831[_0x554f('0x46')]=_0x38d831['attributes']['length']?_0x38d831[_0x554f('0x46')]:_0x1aca02[_0x554f('0x41')];if(!_0x2256a2['query'][_0x554f('0x49')](_0x554f('0x4a'))){_0x38d831[_0x554f('0x2d')]=qs['limit'](_0x2256a2[_0x554f('0x42')][_0x554f('0x2d')]);_0x38d831[_0x554f('0x2c')]=qs[_0x554f('0x2c')](_0x2256a2[_0x554f('0x42')][_0x554f('0x2c')]);}_0x38d831[_0x554f('0x6b')]=qs[_0x554f('0x4b')](_0x2256a2[_0x554f('0x42')][_0x554f('0x4b')]);_0x38d831['where']=qs[_0x554f('0x44')](_[_0x554f('0x4d')](_0x2256a2['query'],_0x1aca02[_0x554f('0x44')]));_0x38d831[_0x554f('0x4c')][_0x554f('0x64')]=_0x9c9923['id'];if(_0x2256a2[_0x554f('0x42')]['filter']){_0x38d831[_0x554f('0x4c')]=_['merge'](_0x38d831[_0x554f('0x4c')],{'$or':_[_0x554f('0x3d')](_0x38d831[_0x554f('0x46')],function(_0x517f67){var _0x2af883={};_0x2af883[_0x517f67]={'$like':'%'+_0x2256a2[_0x554f('0x42')][_0x554f('0x67')]+'%'};return _0x2af883;})});}_0x38d831=_[_0x554f('0x4e')]({},_0x38d831,_0x2256a2[_0x554f('0x4f')]);return db['SmsInteraction'][_0x554f('0x2f')]({'where':_0x38d831[_0x554f('0x4c')]})[_0x554f('0x1e')](function(_0x3eaf34){_0x32e2a2[_0x554f('0x2f')]=_0x3eaf34;if(_0x2256a2[_0x554f('0x42')][_0x554f('0x51')]){_0x38d831['include']=[{'model':db[_0x554f('0x71')],'as':_0x554f('0xbb'),'required':![]},{'model':db['User'],'as':_0x554f('0xbc'),'attributes':[_0x554f('0x3a'),_0x554f('0xbd'),_0x554f('0xbe')],'required':![]},{'model':db['Tag'],'as':_0x554f('0xbf'),'attributes':['id',_0x554f('0x3a'),'color'],'where':_0x2256a2[_0x554f('0x42')][_0x554f('0xc0')]?{'id':_0x2256a2[_0x554f('0x42')]['tag']}:undefined,'required':_0x2256a2['query'][_0x554f('0xc0')]?!![]:![]}];}return db[_0x554f('0x97')][_0x554f('0x53')](_0x38d831);})[_0x554f('0x1e')](function(_0x1a6ec5){_0x32e2a2[_0x554f('0x54')]=_0x1a6ec5;return _0x32e2a2;});}})['then'](respondWithFilteredResult(_0x222e21,_0x38d831))['catch'](handleError(_0x222e21,null));};exports[_0x554f('0x3b')]=function(_0x5dbbd2,_0x261c1e,_0x3afa4a){var _0x3a67a5,_0x52db36,_0x401179;if(_[_0x554f('0x8a')](_0x5dbbd2[_0x554f('0x57')][_0x554f('0x57')])||_0x5dbbd2['body'][_0x554f('0x57')]===''){throw new db['Sequelize'][(_0x554f('0x73'))](_0x554f('0x8c'));}if(_[_0x554f('0x8a')](_0x5dbbd2[_0x554f('0x57')]['to'])){throw new db[(_0x554f('0x72'))][(_0x554f('0x73'))](_0x554f('0xc1'));}_0x3a67a5=_0x5dbbd2[_0x554f('0x57')]['to'];return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x5dbbd2[_0x554f('0x56')]['id']},'include':[{'model':db[_0x554f('0x91')],'as':_0x554f('0xc2'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x3a67a5},'limit':0x1,'order':[[_0x554f('0x74'),_0x554f('0x92')]]}]}]})[_0x554f('0x1e')](handleEntityNotFound(_0x261c1e,null))[_0x554f('0x1e')](function(_0x428373){if(_0x428373&&_0x428373[_0x554f('0xc2')]){_0x52db36=_0x428373[_0x554f('0x36')]({'plain':!![]});if(_0x52db36['List']&&_0x52db36[_0x554f('0xc2')][_0x554f('0x95')][_0x554f('0x48')]){return _0x52db36[_0x554f('0xc2')][_0x554f('0x95')][0x0];}return db[_0x554f('0x71')][_0x554f('0x5f')](_['defaults'](_0x5dbbd2['body'],{'firstName':_0x3a67a5,'mobile':_0x3a67a5,'phone':_0x3a67a5,'ListId':_0x52db36['ListId']}));}})[_0x554f('0x1e')](handleEntityNotFound(_0x261c1e,null))[_0x554f('0x1e')](function(_0xb311c4){if(_0xb311c4){_0x401179=_0xb311c4;return db[_0x554f('0x97')][_0x554f('0x5b')]({'where':{'ContactId':_0x401179['id'],'closed':![],'SmsAccountId':_0x52db36['id']}})[_0x554f('0x1e')](function(_0xd5b99b){if(_0xd5b99b){return[_0xd5b99b,![]];}return db[_0x554f('0x97')][_0x554f('0x5f')]({'UserId':_0x5dbbd2[_0x554f('0x58')]['id'],'ContactId':_0x401179['id'],'SmsAccountId':_0x52db36['id'],'phone':_0x3a67a5,'firstMsgDirection':_0x554f('0xc3'),'Messages':[_[_0x554f('0x4e')](_0x5dbbd2[_0x554f('0x57')],{'read':![],'body':_0x5dbbd2[_0x554f('0x57')][_0x554f('0x57')],'phone':_0x3a67a5,'SmsAccountId':_0x52db36['id'],'UserId':_0x5dbbd2[_0x554f('0x58')]['id'],'ContactId':_0x401179['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x554f('0x1e')](function(_0x5953dc){return[_0x5953dc,!![]];});});}})[_0x554f('0x98')](function(_0xefd6ad,_0x4a849f){if(_0x4a849f){return _0xefd6ad;}return db[_0x554f('0xc4')][_0x554f('0x5f')](_['merge'](_0x5dbbd2[_0x554f('0x57')],{'read':![],'body':_0x5dbbd2[_0x554f('0x57')][_0x554f('0x57')],'phone':_0x3a67a5,'SmsAccountId':_0x52db36['id'],'SmsInteractionId':_0xefd6ad['id'],'UserId':_0x5dbbd2[_0x554f('0x58')]['id'],'ContactId':_0x401179['id']}))[_0x554f('0x1e')](function(_0x3f0b70){_0xefd6ad[_0x554f('0xc5')][_0x554f('0xc6')]=[];_0xefd6ad[_0x554f('0xc5')][_0x554f('0xc6')][_0x554f('0x9d')](_0x3f0b70[_0x554f('0xc5')]);return _0xefd6ad;});})[_0x554f('0x1e')](respondWithResult(_0x261c1e,null))[_0x554f('0x28')](handleError(_0x261c1e,null));};exports[_0x554f('0x2a')]=function(_0x1d7e8b,_0x3e25e4,_0x579f2e){if(_0x1d7e8b[_0x554f('0x57')]['id']){delete _0x1d7e8b['body']['id'];}var _0x3a01d0,_0x14c8a1,_0x3036a7;return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x1d7e8b[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x3e25e4,null))[_0x554f('0x1e')](function(_0x599a69){if(_0x599a69){_0x3036a7=_0x599a69;logger['debug'](_0x554f('0x21'),_0x554f('0x2a'),_0x554f('0xc7'),_0x599a69[_0x554f('0x40')],util[_0x554f('0xc8')](_0x1d7e8b[_0x554f('0x57')],{'showHidden':![],'depth':null}));switch(_0x599a69[_0x554f('0x40')]){case'skebby':if(_0x1d7e8b[_0x554f('0x57')][_0x554f('0xc9')]&&_0x1d7e8b[_0x554f('0x57')][_0x554f('0x2a')]){_0x14c8a1=_0x1d7e8b[_0x554f('0x57')][_0x554f('0x2a')];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x1d7e8b['body']['skebby_dispatch_id']}});}break;case _0x554f('0x7d'):if(_0x1d7e8b[_0x554f('0x57')]['requestid']&&_0x1d7e8b[_0x554f('0x57')][_0x554f('0xca')]){_0x14c8a1=_0x1d7e8b[_0x554f('0x57')][_0x554f('0xca')];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x1d7e8b[_0x554f('0x57')][_0x554f('0xcb')]}});}break;case _0x554f('0x7e'):if(_0x1d7e8b[_0x554f('0x57')][_0x554f('0x80')]&&_0x1d7e8b[_0x554f('0x57')]['status_code']){_0x14c8a1=_0x1d7e8b[_0x554f('0x57')]['status_code'];return db[_0x554f('0xc4')]['find']({'where':{'messageId':_0x1d7e8b[_0x554f('0x57')][_0x554f('0x80')]}});}break;case _0x554f('0x84'):var _0x17f4ec=_0x1d7e8b[_0x554f('0x57')][_0x554f('0x85')][0x0];if(_0x17f4ec[_0x554f('0x7f')]&&_0x17f4ec['status'][_0x554f('0xcc')]==='DELIVERED'){_0x14c8a1=_0x17f4ec[_0x554f('0x2a')][_0x554f('0xcc')];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x17f4ec['messageId']}});}break;case _0x554f('0x88'):if(_0x1d7e8b[_0x554f('0x57')][_0x554f('0x7f')]&&_0x1d7e8b[_0x554f('0x57')][_0x554f('0x2a')]){_0x14c8a1=_0x1d7e8b['body']['status'];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x1d7e8b[_0x554f('0x57')]['messageId']}});}break;case _0x554f('0xcd'):if(_0x1d7e8b[_0x554f('0x57')][0x0]['message']['id']){_0x14c8a1=_0x1d7e8b[_0x554f('0x57')][0x0][_0x554f('0x40')];return db['SmsMessage'][_0x554f('0x5b')]({'where':{'messageId':_0x1d7e8b[_0x554f('0x57')][0x0][_0x554f('0x26')]['id']}});}break;case _0x554f('0xce'):if(_0x1d7e8b[_0x554f('0x57')]['redif']&&_0x1d7e8b['body'][_0x554f('0x2a')]){_0x14c8a1=_0x1d7e8b[_0x554f('0x57')][_0x554f('0x2a')];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x1d7e8b[_0x554f('0x57')][_0x554f('0xcf')]}});}break;}}})['then'](handleEntityNotFound(_0x3e25e4,null))[_0x554f('0x1e')](function(_0x3d0906){if(_0x3d0906){_0x3a01d0=_0x3d0906;switch(_0x3036a7[_0x554f('0x40')]){case _0x554f('0x7c'):if(_0x14c8a1===_0x554f('0xd0')){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger[_0x554f('0x23')](_0x554f('0x21'),_0x554f('0x2a'),'skebby',util['inspect'](_0x1d7e8b['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x14c8a1==='1'){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger[_0x554f('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x554f('0x7c'),util[_0x554f('0xc8')](_0x1d7e8b['body'],{'showHidden':![],'depth':null}));}break;case _0x554f('0x7e'):if(!_0x1d7e8b['body']['error_code']&&_0x14c8a1>=0xc8&&_0x14c8a1<=0xce){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger[_0x554f('0x23')](_0x554f('0x21'),'status',_0x554f('0x7e'),util[_0x554f('0xc8')](_0x1d7e8b[_0x554f('0x57')],{'showHidden':![],'depth':null}));}break;case _0x554f('0x84'):var _0x5bee38=_0x1d7e8b[_0x554f('0x57')][_0x554f('0x85')][0x0];if(_0x5bee38[_0x554f('0x2a')][_0x554f('0xcc')]===_0x554f('0xd0')){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger['error'](_0x554f('0x21'),'status',_0x554f('0x84'),util[_0x554f('0xc8')](_0x1d7e8b['body'],{'showHidden':![],'depth':null}));}break;case _0x554f('0x88'):if(_0x14c8a1==_0x554f('0xd1')||_0x14c8a1==_0x554f('0xd2')){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger['error'](_0x554f('0x21'),_0x554f('0x2a'),'clickatell',util[_0x554f('0xc8')](_0x1d7e8b[_0x554f('0x57')],{'showHidden':![],'depth':null}));}break;case _0x554f('0xcd'):if(_0x14c8a1=='message-delivered'){return _0x3a01d0[_0x554f('0x34')]({'read':!![]});}else{logger[_0x554f('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x554f('0x2a'),_0x554f('0xcd'),util['inspect'](_0x1d7e8b[_0x554f('0x57')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x14c8a1===_0x554f('0xd3')||_0x14c8a1===_0x554f('0xd4')){return _0x3a01d0['update']({'read':!![]});}else{logger[_0x554f('0x23')](_0x554f('0x21'),'status',_0x554f('0xce'),util[_0x554f('0xc8')](_0x1d7e8b['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a01d0;}})[_0x554f('0x1e')](respondWithResult(_0x3e25e4,null))[_0x554f('0x28')](handleError(_0x3e25e4,null));};exports[_0x554f('0xd5')]=function(_0x4278a1,_0x5dc92f,_0x5791cd){var _0x40c1fe,_0xae8690,_0x3baea7;return db['SmsAccount'][_0x554f('0x5b')]({'where':{'id':_0x4278a1[_0x554f('0x56')]['id']}})['then'](handleEntityNotFound(_0x5dc92f,null))[_0x554f('0x1e')](function(_0x3bd2fa){if(_0x3bd2fa){_0x3baea7=_0x3bd2fa;logger[_0x554f('0xa8')](_0x554f('0x21'),'status',_0x554f('0xc7'),_0x3bd2fa[_0x554f('0x40')],util[_0x554f('0xc8')](_0x4278a1[_0x554f('0x42')],{'showHidden':![],'depth':null}));switch(_0x3bd2fa['type']){case _0x554f('0xd6'):if(_0x4278a1[_0x554f('0x42')][_0x554f('0xd7')]&&_0x4278a1['query'][_0x554f('0xd8')]){_0xae8690=_0x4278a1[_0x554f('0x42')][_0x554f('0xd8')];return db[_0x554f('0xc4')][_0x554f('0x5b')]({'where':{'messageId':_0x4278a1[_0x554f('0x42')][_0x554f('0xd7')]}});}break;}}})[_0x554f('0x1e')](handleEntityNotFound(_0x5dc92f,null))[_0x554f('0x1e')](function(_0x5a13ab){if(_0x5a13ab){_0x40c1fe=_0x5a13ab;switch(_0x3baea7[_0x554f('0x40')]){case _0x554f('0xd6'):if(_0xae8690==='2'||_0xae8690==='6'){return _0x40c1fe[_0x554f('0x34')]({'read':!![]});}else{logger[_0x554f('0x23')](_0x554f('0x21'),'status','csc',util[_0x554f('0xc8')](_0x4278a1[_0x554f('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x40c1fe;}})[_0x554f('0x1e')](respondWithResult(_0x5dc92f,null))[_0x554f('0x28')](handleError(_0x5dc92f,null));};exports[_0x554f('0xd9')]=function(_0x2c2070,_0x29774d,_0x16bacf){return db[_0x554f('0x50')][_0x554f('0x5b')]({'where':{'id':_0x2c2070['params']['id']}})['then'](handleEntityNotFound(_0x29774d,null))[_0x554f('0x1e')](function(_0x26c128){if(_0x26c128){return _0x26c128[_0x554f('0xd9')](_0x2c2070['body']['ids'],_[_0x554f('0x94')](_0x2c2070['body'],[_0x554f('0x69'),'id'])||{})['spread'](function(_0x12a809){for(var _0x4c6af3=0x0;_0x4c6af3<_0x2c2070['body'][_0x554f('0x69')][_0x554f('0x48')];_0x4c6af3+=0x1){socket[_0x554f('0xda')](_0x554f('0xdb'),{'UserId':Number(_0x2c2070[_0x554f('0x57')][_0x554f('0x69')][_0x4c6af3]),'SmsAccountId':Number(_0x2c2070[_0x554f('0x56')]['id'])});}return _0x12a809;});}})[_0x554f('0x1e')](respondWithResult(_0x29774d,null))['catch'](handleError(_0x29774d,null));};exports[_0x554f('0xdc')]=function(_0x25a953,_0x4564c6,_0x1cd150){return db[_0x554f('0x50')]['find']({'where':{'id':_0x25a953[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x4564c6,null))[_0x554f('0x1e')](function(_0x200d4b){if(_0x200d4b){return _0x200d4b[_0x554f('0xdc')](_0x25a953[_0x554f('0x42')]['ids'])[_0x554f('0x1e')](function(){if(_[_0x554f('0xdd')](_0x25a953['query'][_0x554f('0x69')])){for(var _0x31ab8b=0x0;_0x31ab8b<_0x25a953[_0x554f('0x42')]['ids'][_0x554f('0x48')];_0x31ab8b+=0x1){socket[_0x554f('0xda')](_0x554f('0xde'),{'UserId':Number(_0x25a953[_0x554f('0x42')][_0x554f('0x69')][_0x31ab8b]),'SmsAccountId':Number(_0x25a953[_0x554f('0x56')]['id'])});}}else{socket[_0x554f('0xda')](_0x554f('0xde'),{'UserId':Number(_0x25a953['query']['ids']),'SmsAccountId':Number(_0x25a953[_0x554f('0x56')]['id'])});}});}})[_0x554f('0x1e')](respondWithStatusCode(_0x4564c6,null))[_0x554f('0x28')](handleError(_0x4564c6,null));};exports[_0x554f('0xdf')]=function(_0x33a54d,_0x36091e,_0x5073a4){var _0x5aaf81={};var _0x4f6cc9={};var _0xa4378b;var _0x836f32;return db[_0x554f('0x50')][_0x554f('0x65')]({'where':{'id':_0x33a54d[_0x554f('0x56')]['id']}})[_0x554f('0x1e')](handleEntityNotFound(_0x36091e,null))[_0x554f('0x1e')](function(_0xbec281){if(_0xbec281){_0xa4378b=_0xbec281;_0x4f6cc9[_0x554f('0x41')]=_[_0x554f('0x43')](db[_0x554f('0xe0')][_0x554f('0x3e')]);_0x4f6cc9[_0x554f('0x42')]=_[_0x554f('0x43')](_0x33a54d['query']);_0x4f6cc9[_0x554f('0x44')]=_[_0x554f('0x45')](_0x4f6cc9[_0x554f('0x41')],_0x4f6cc9['query']);_0x5aaf81['attributes']=_[_0x554f('0x45')](_0x4f6cc9[_0x554f('0x41')],qs[_0x554f('0x47')](_0x33a54d['query'][_0x554f('0x47')]));_0x5aaf81['attributes']=_0x5aaf81[_0x554f('0x46')]['length']?_0x5aaf81[_0x554f('0x46')]:_0x4f6cc9[_0x554f('0x41')];_0x5aaf81['order']=qs[_0x554f('0x4b')](_0x33a54d[_0x554f('0x42')][_0x554f('0x4b')]);_0x5aaf81['where']=qs[_0x554f('0x44')](_['pick'](_0x33a54d[_0x554f('0x42')],_0x4f6cc9[_0x554f('0x44')]));if(_0x33a54d[_0x554f('0x42')][_0x554f('0x67')]){_0x5aaf81[_0x554f('0x4c')]=_[_0x554f('0x4e')](_0x5aaf81[_0x554f('0x4c')],{'$or':_[_0x554f('0x3d')](_0x5aaf81[_0x554f('0x46')],function(_0x4260da){var _0x479689={};_0x479689[_0x4260da]={'$like':'%'+_0x33a54d['query'][_0x554f('0x67')]+'%'};return _0x479689;})});}_0x5aaf81=_[_0x554f('0x4e')]({},_0x5aaf81,_0x33a54d['options']);return _0xa4378b[_0x554f('0xdf')](_0x5aaf81);}})[_0x554f('0x1e')](function(_0x47692){if(_0x47692){_0x836f32=_0x47692[_0x554f('0x48')];if(!_0x33a54d[_0x554f('0x42')][_0x554f('0x49')](_0x554f('0x4a'))){_0x5aaf81[_0x554f('0x2d')]=qs[_0x554f('0x2d')](_0x33a54d[_0x554f('0x42')][_0x554f('0x2d')]);_0x5aaf81[_0x554f('0x2c')]=qs[_0x554f('0x2c')](_0x33a54d['query'][_0x554f('0x2c')]);}return _0xa4378b[_0x554f('0xdf')](_0x5aaf81);}})['then'](function(_0x1d1e23){if(_0x1d1e23){return _0x1d1e23?{'count':_0x836f32,'rows':_0x1d1e23}:null;}})[_0x554f('0x1e')](respondWithResult(_0x36091e,null))[_0x554f('0x28')](handleError(_0x36091e,null));}; \ No newline at end of file +var _0x6a51=['removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','get','SmsAccounts','UserProfileResource','then','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','Applications','orderBy','asc','account','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','text','connectel','clicksend','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','DESC','list','Contacts','contact','SmsInteraction','created','applications','push','unmanaged','*,*,*,*','interaction','SmsMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','sequelize','transaction','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','User','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','message_id','groupName','intelepeer','redif','infobip','RECEIVED_BY_RECIPIENT','statusGet','message-id','state','addAgents','omit','emit'];(function(_0x348664,_0x4d6c23){var _0x1df7a5=function(_0x276c0d){while(--_0x276c0d){_0x348664['push'](_0x348664['shift']());}};_0x1df7a5(++_0x4d6c23);}(_0x6a51,0xeb));var _0x16a5=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x6a51[_0x5bfa44];return _0x43815f;};'use strict';var emlformat=require(_0x16a5('0x0'));var rimraf=require(_0x16a5('0x1'));var zipdir=require(_0x16a5('0x2'));var jsonpatch=require(_0x16a5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x16a5('0x4'));var Mustache=require(_0x16a5('0x5'));var util=require(_0x16a5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x16a5('0x7'));var fs=require('fs');var fs_extra=require(_0x16a5('0x8'));var _=require(_0x16a5('0x9'));var squel=require(_0x16a5('0xa'));var crypto=require(_0x16a5('0xb'));var jsforce=require(_0x16a5('0xc'));var deskjs=require(_0x16a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x16a5('0xe'));var Papa=require(_0x16a5('0xf'));var Redis=require(_0x16a5('0x10'));var authService=require(_0x16a5('0x11'));var qs=require(_0x16a5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16a5('0x13'));var logger=require(_0x16a5('0x14'))(_0x16a5('0x15'));var utils=require(_0x16a5('0x16'));var config=require(_0x16a5('0x17'));var licenseUtil=require(_0x16a5('0x18'));var db=require(_0x16a5('0x19'))['db'];config['redis']=_[_0x16a5('0x1a')](config[_0x16a5('0x1b')],{'host':_0x16a5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16a5('0x1d'))[_0x16a5('0x1e')](socket);var jayson=require(_0x16a5('0x1f'));var client=jayson[_0x16a5('0x20')][_0x16a5('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x4d5db0,_0x4453f4,_0x3de6cd,_0x1fdc1e){return new BPromise(function(_0xafcfd6,_0x5d4145){var _0x1c4f22=_0x1fdc1e||client;return _0x1c4f22[_0x16a5('0x22')](_0x4d5db0,_0x3de6cd)['then'](function(_0xebca20){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4453f4,_0x16a5('0x23'));logger[_0x16a5('0x24')](_0x16a5('0x25'),_0x4453f4,_0x16a5('0x23'),JSON[_0x16a5('0x26')](_0xebca20));if(_0xebca20[_0x16a5('0x27')]){if(_0xebca20[_0x16a5('0x27')][_0x16a5('0x28')]===0x1f4){logger['error'](_0x16a5('0x29'),_0x4453f4,_0xebca20[_0x16a5('0x27')]['message']);return _0x5d4145(_0xebca20[_0x16a5('0x27')][_0x16a5('0x2a')]);}logger[_0x16a5('0x27')](_0x16a5('0x29'),_0x4453f4,_0xebca20[_0x16a5('0x27')]['message']);return _0xafcfd6(_0xebca20[_0x16a5('0x27')]['message']);}else{logger[_0x16a5('0x2b')]('SmsAccount,\x20%s,\x20%s',_0x4453f4,_0x16a5('0x23'));_0xafcfd6(_0xebca20[_0x16a5('0x2c')][_0x16a5('0x2a')]);}})[_0x16a5('0x2d')](function(_0x32d080){logger[_0x16a5('0x27')](_0x16a5('0x29'),_0x4453f4,_0x32d080);_0x5d4145(_0x32d080);});});}function respondWithStatusCode(_0x5b5a9b,_0x157403){_0x157403=_0x157403||0xcc;return function(_0x4e76d1){if(_0x4e76d1){return _0x5b5a9b['sendStatus'](_0x157403);}return _0x5b5a9b[_0x16a5('0x2e')](_0x157403)[_0x16a5('0x2f')]();};}function respondWithResult(_0x2086ba,_0x434fca){_0x434fca=_0x434fca||0xc8;return function(_0x2357b2){if(_0x2357b2){return _0x2086ba['status'](_0x434fca)['json'](_0x2357b2);}};}function respondWithFilteredResult(_0x3044a3,_0x421edb){return function(_0x4e317e){if(_0x4e317e){var _0x524c53=typeof _0x421edb[_0x16a5('0x30')]===_0x16a5('0x31')&&typeof _0x421edb[_0x16a5('0x32')]===_0x16a5('0x31');var _0x5c152a=_0x4e317e[_0x16a5('0x33')];var _0x28b261=_0x524c53?0x0:_0x421edb[_0x16a5('0x30')];var _0x2fb0c3=_0x524c53?_0x4e317e[_0x16a5('0x33')]:_0x421edb[_0x16a5('0x30')]+_0x421edb['limit'];var _0x531cff;if(_0x2fb0c3>=_0x5c152a){_0x2fb0c3=_0x5c152a;_0x531cff=0xc8;}else{_0x531cff=0xce;}_0x3044a3[_0x16a5('0x2e')](_0x531cff);return _0x3044a3[_0x16a5('0x34')](_0x16a5('0x35'),_0x28b261+'-'+_0x2fb0c3+'/'+_0x5c152a)[_0x16a5('0x36')](_0x4e317e);}return null;};}function patchUpdates(_0x33bf79){return function(_0x5b7815){try{jsonpatch[_0x16a5('0x37')](_0x5b7815,_0x33bf79,!![]);}catch(_0x583073){return BPromise['reject'](_0x583073);}return _0x5b7815[_0x16a5('0x38')]();};}function saveUpdates(_0x3d6a72,_0x443498){return function(_0xd973d7){if(_0xd973d7){return _0xd973d7['update'](_0x3d6a72)['then'](function(_0x37bf13){return _0x37bf13;});}return null;};}function removeEntity(_0x3af692,_0xd6226a){return function(_0x5bb5b4){if(_0x5bb5b4){return _0x5bb5b4[_0x16a5('0x39')]()['then'](function(){var _0x6806e=_0x5bb5b4[_0x16a5('0x3a')]({'plain':!![]});var _0xc4c1de=_0x16a5('0x3b');return db[_0x16a5('0x3c')][_0x16a5('0x39')]({'where':{'type':_0xc4c1de,'resourceId':_0x6806e['id']}})[_0x16a5('0x3d')](function(){return _0x5bb5b4;});})[_0x16a5('0x3d')](function(){_0x3af692[_0x16a5('0x2e')](0xcc)[_0x16a5('0x2f')]();});}};}function handleEntityNotFound(_0x4fc54d,_0x40be45){return function(_0x2fd13e){if(!_0x2fd13e){_0x4fc54d[_0x16a5('0x3e')](0x194);}return _0x2fd13e;};}function handleError(_0x249d46,_0x3c04eb){_0x3c04eb=_0x3c04eb||0x1f4;return function(_0x4f7ece){logger[_0x16a5('0x27')](_0x4f7ece[_0x16a5('0x3f')]);if(_0x4f7ece[_0x16a5('0x40')]){delete _0x4f7ece[_0x16a5('0x40')];}_0x249d46['status'](_0x3c04eb)[_0x16a5('0x41')](_0x4f7ece);};}exports[_0x16a5('0x42')]=function(_0x322d29,_0x1e4e3f){var _0x8dfea0={'include':[{'model':db[_0x16a5('0x43')],'as':_0x16a5('0x44')}]},_0x31f4e7={},_0x4ec4ff={'count':0x0,'rows':[]};var _0x4bc8b9=_[_0x16a5('0x45')](db[_0x16a5('0x46')][_0x16a5('0x47')],function(_0x21ef31){return{'name':_0x21ef31[_0x16a5('0x48')],'type':_0x21ef31[_0x16a5('0x49')]['key']};});_0x31f4e7[_0x16a5('0x4a')]=_[_0x16a5('0x45')](_0x4bc8b9,_0x16a5('0x40'));_0x31f4e7['query']=_['keys'](_0x322d29[_0x16a5('0x4b')]);_0x31f4e7[_0x16a5('0x4c')]=_[_0x16a5('0x4d')](_0x31f4e7[_0x16a5('0x4a')],_0x31f4e7[_0x16a5('0x4b')]);_0x8dfea0[_0x16a5('0x4e')]=_[_0x16a5('0x4d')](_0x31f4e7['model'],qs[_0x16a5('0x4f')](_0x322d29['query'][_0x16a5('0x4f')]));_0x8dfea0[_0x16a5('0x4e')]=_0x8dfea0[_0x16a5('0x4e')][_0x16a5('0x50')]?_0x8dfea0[_0x16a5('0x4e')]:_0x31f4e7[_0x16a5('0x4a')];if(!_0x322d29['query']['hasOwnProperty']('nolimit')){_0x8dfea0['limit']=qs['limit'](_0x322d29[_0x16a5('0x4b')][_0x16a5('0x32')]);_0x8dfea0['offset']=qs[_0x16a5('0x30')](_0x322d29[_0x16a5('0x4b')][_0x16a5('0x30')]);}_0x8dfea0[_0x16a5('0x51')]=qs[_0x16a5('0x52')](_0x322d29[_0x16a5('0x4b')][_0x16a5('0x52')]);_0x8dfea0[_0x16a5('0x53')]=qs[_0x16a5('0x4c')](_[_0x16a5('0x54')](_0x322d29[_0x16a5('0x4b')],_0x31f4e7['filters']),_0x4bc8b9);if(_0x322d29[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x8dfea0[_0x16a5('0x53')]=_[_0x16a5('0x56')](_0x8dfea0[_0x16a5('0x53')],{'$or':_['map'](_0x4bc8b9,function(_0x273186){if(_0x273186[_0x16a5('0x49')]!==_0x16a5('0x57')){var _0x306d79={};_0x306d79[_0x273186[_0x16a5('0x40')]]={'$like':'%'+_0x322d29[_0x16a5('0x4b')][_0x16a5('0x55')]+'%'};return _0x306d79;}})});}_0x8dfea0=_[_0x16a5('0x56')]({},_0x8dfea0,_0x322d29[_0x16a5('0x58')]);var _0x27f312={'where':_0x8dfea0[_0x16a5('0x53')]};return db[_0x16a5('0x46')][_0x16a5('0x33')](_0x27f312)[_0x16a5('0x3d')](function(_0x5a82b5){_0x4ec4ff[_0x16a5('0x33')]=_0x5a82b5;if(_0x322d29[_0x16a5('0x4b')][_0x16a5('0x59')]){_0x8dfea0[_0x16a5('0x5a')]=[{'all':!![]}];}return db[_0x16a5('0x46')][_0x16a5('0x5b')](_0x8dfea0);})[_0x16a5('0x3d')](function(_0x5c5875){_0x4ec4ff['rows']=_0x5c5875;return _0x4ec4ff;})[_0x16a5('0x3d')](respondWithFilteredResult(_0x1e4e3f,_0x8dfea0))[_0x16a5('0x2d')](handleError(_0x1e4e3f,null));};exports[_0x16a5('0x5c')]=function(_0x289ed7,_0x5bdcc7){var _0x5ac4cb={'raw':![],'where':{'id':_0x289ed7[_0x16a5('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x16a5('0x44')}]},_0x1d082d={};_0x1d082d[_0x16a5('0x4a')]=_[_0x16a5('0x5e')](db[_0x16a5('0x46')][_0x16a5('0x47')]);_0x1d082d[_0x16a5('0x4b')]=_[_0x16a5('0x5e')](_0x289ed7['query']);_0x1d082d['filters']=_[_0x16a5('0x4d')](_0x1d082d[_0x16a5('0x4a')],_0x1d082d['query']);_0x5ac4cb[_0x16a5('0x4e')]=_['intersection'](_0x1d082d['model'],qs['fields'](_0x289ed7[_0x16a5('0x4b')]['fields']));_0x5ac4cb['attributes']=_0x5ac4cb['attributes'][_0x16a5('0x50')]?_0x5ac4cb[_0x16a5('0x4e')]:_0x1d082d[_0x16a5('0x4a')];if(_0x289ed7[_0x16a5('0x4b')][_0x16a5('0x59')]){_0x5ac4cb['include']=[{'all':!![]}];}_0x5ac4cb=_[_0x16a5('0x56')]({},_0x5ac4cb,_0x289ed7[_0x16a5('0x58')]);return db[_0x16a5('0x46')][_0x16a5('0x5f')](_0x5ac4cb)[_0x16a5('0x3d')](handleEntityNotFound(_0x5bdcc7,null))['then'](respondWithResult(_0x5bdcc7,null))[_0x16a5('0x2d')](handleError(_0x5bdcc7,null));};exports['create']=function(_0x1a51ec,_0x48c597){return db[_0x16a5('0x46')][_0x16a5('0x60')](_0x1a51ec[_0x16a5('0x61')],{})[_0x16a5('0x3d')](function(_0xee64d2){var _0x4fe81e=_0x1a51ec[_0x16a5('0x62')][_0x16a5('0x3a')]({'plain':!![]});if(!_0x4fe81e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe81e[_0x16a5('0x63')]===_0x16a5('0x62')){var _0x762f16=_0xee64d2[_0x16a5('0x3a')]({'plain':!![]});var _0x98c548=_0x16a5('0x3b');return db[_0x16a5('0x64')][_0x16a5('0x5f')]({'where':{'name':_0x98c548,'userProfileId':_0x4fe81e[_0x16a5('0x65')]},'raw':!![]})[_0x16a5('0x3d')](function(_0x1f0c82){if(_0x1f0c82&&_0x1f0c82['autoAssociation']===0x0){return db[_0x16a5('0x3c')]['create']({'name':_0x762f16[_0x16a5('0x40')],'resourceId':_0x762f16['id'],'type':_0x1f0c82[_0x16a5('0x40')],'sectionId':_0x1f0c82['id']},{})[_0x16a5('0x3d')](function(){return _0xee64d2;});}else{return _0xee64d2;}})[_0x16a5('0x2d')](function(_0x16486d){logger[_0x16a5('0x27')](_0x16a5('0x66'),_0x16486d);throw _0x16486d;});}return _0xee64d2;})[_0x16a5('0x3d')](respondWithResult(_0x48c597,0xc9))[_0x16a5('0x2d')](handleError(_0x48c597,null));};exports[_0x16a5('0x67')]=function(_0x33aad0,_0x2e10fa){if(_0x33aad0[_0x16a5('0x61')]['id']){delete _0x33aad0[_0x16a5('0x61')]['id'];}return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x33aad0[_0x16a5('0x5d')]['id']},'include':[{'model':db[_0x16a5('0x43')],'as':_0x16a5('0x44')}]})[_0x16a5('0x3d')](handleEntityNotFound(_0x2e10fa,null))[_0x16a5('0x3d')](saveUpdates(_0x33aad0[_0x16a5('0x61')],null))['then'](respondWithResult(_0x2e10fa,null))[_0x16a5('0x2d')](handleError(_0x2e10fa,null));};exports[_0x16a5('0x39')]=function(_0x40c2f8,_0x569d68){return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x40c2f8[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x569d68,null))[_0x16a5('0x3d')](removeEntity(_0x569d68,null))[_0x16a5('0x2d')](handleError(_0x569d68,null));};exports[_0x16a5('0x68')]=function(_0x23d72e,_0x77170d){return db[_0x16a5('0x46')][_0x16a5('0x68')]()[_0x16a5('0x3d')](respondWithResult(_0x77170d,null))[_0x16a5('0x2d')](handleError(_0x77170d,null));};exports[_0x16a5('0x69')]=function(_0x24d301,_0x51a186,_0x434b47){if(_0x24d301[_0x16a5('0x61')]['id']){delete _0x24d301['body']['id'];}return db[_0x16a5('0x46')]['find']({'where':{'id':_0x24d301['params']['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x51a186,null))['then'](function(_0xc4e250){if(_0xc4e250){_0x24d301[_0x16a5('0x61')][_0x16a5('0x6a')]=_0xc4e250['id'];return db['Disposition'][_0x16a5('0x60')](_0x24d301[_0x16a5('0x61')]);}})[_0x16a5('0x3d')](respondWithResult(_0x51a186,null))[_0x16a5('0x2d')](handleError(_0x51a186,null));};exports[_0x16a5('0x6b')]=function(_0x53a2bb,_0x33b45d,_0x4e7e77){var _0x7bfed6={'raw':![],'where':{}};var _0x200bc3={};var _0x437e42={'count':0x0,'rows':[]};return db[_0x16a5('0x46')][_0x16a5('0x6c')]({'where':{'id':_0x53a2bb[_0x16a5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x33b45d,null))[_0x16a5('0x3d')](function(_0x111461){if(_0x111461){_0x200bc3[_0x16a5('0x4a')]=_[_0x16a5('0x5e')](db[_0x16a5('0x6d')][_0x16a5('0x47')]);_0x200bc3[_0x16a5('0x4b')]=_[_0x16a5('0x5e')](_0x53a2bb[_0x16a5('0x4b')]);_0x200bc3[_0x16a5('0x4c')]=_['intersection'](_0x200bc3['model'],_0x200bc3[_0x16a5('0x4b')]);_0x7bfed6[_0x16a5('0x4e')]=_[_0x16a5('0x4d')](_0x200bc3[_0x16a5('0x4a')],qs[_0x16a5('0x4f')](_0x53a2bb['query']['fields']));_0x7bfed6['attributes']=_0x7bfed6['attributes'][_0x16a5('0x50')]?_0x7bfed6[_0x16a5('0x4e')]:_0x200bc3[_0x16a5('0x4a')];if(!_0x53a2bb[_0x16a5('0x4b')][_0x16a5('0x6e')](_0x16a5('0x6f'))){_0x7bfed6[_0x16a5('0x32')]=qs[_0x16a5('0x32')](_0x53a2bb[_0x16a5('0x4b')][_0x16a5('0x32')]);_0x7bfed6[_0x16a5('0x30')]=qs[_0x16a5('0x30')](_0x53a2bb['query'][_0x16a5('0x30')]);}_0x7bfed6[_0x16a5('0x51')]=qs[_0x16a5('0x52')](_0x53a2bb['query'][_0x16a5('0x52')]);_0x7bfed6[_0x16a5('0x53')]=qs[_0x16a5('0x4c')](_[_0x16a5('0x54')](_0x53a2bb[_0x16a5('0x4b')],_0x200bc3[_0x16a5('0x4c')]));_0x7bfed6['where']['SmsAccountId']=_0x111461['id'];if(_0x53a2bb[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x7bfed6[_0x16a5('0x53')]=_['merge'](_0x7bfed6['where'],{'$or':_[_0x16a5('0x45')](_0x7bfed6[_0x16a5('0x4e')],function(_0x307b7c){var _0x2bed22={};_0x2bed22[_0x307b7c]={'$like':'%'+_0x53a2bb[_0x16a5('0x4b')][_0x16a5('0x55')]+'%'};return _0x2bed22;})});}_0x7bfed6=_[_0x16a5('0x56')]({},_0x7bfed6,_0x53a2bb[_0x16a5('0x58')]);return db[_0x16a5('0x6d')]['count']({'where':_0x7bfed6['where']})[_0x16a5('0x3d')](function(_0x145a6e){_0x437e42['count']=_0x145a6e;if(_0x53a2bb['query'][_0x16a5('0x59')]){_0x7bfed6[_0x16a5('0x5a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x7bfed6);})[_0x16a5('0x3d')](function(_0x1b2401){_0x437e42[_0x16a5('0x70')]=_0x1b2401;return _0x437e42;});}})[_0x16a5('0x3d')](respondWithFilteredResult(_0x33b45d,_0x7bfed6))['catch'](handleError(_0x33b45d,null));};exports[_0x16a5('0x71')]=function(_0x50a594,_0x5e4280,_0x291830){return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x50a594[_0x16a5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5e4280,null))[_0x16a5('0x3d')](function(_0x1835d3){if(_0x1835d3){return _0x1835d3['removeDispositions'](_0x50a594[_0x16a5('0x4b')]['ids']);}})[_0x16a5('0x3d')](respondWithStatusCode(_0x5e4280,null))[_0x16a5('0x2d')](handleError(_0x5e4280,null));};exports[_0x16a5('0x72')]=function(_0x42b245,_0x59c444,_0x1eb419){if(_0x42b245['body']['id']){delete _0x42b245[_0x16a5('0x61')]['id'];}return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x42b245[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x59c444,null))[_0x16a5('0x3d')](function(_0x46e81b){if(_0x46e81b){_0x42b245[_0x16a5('0x61')]['SmsAccountId']=_0x46e81b['id'];return db[_0x16a5('0x73')][_0x16a5('0x60')](_0x42b245[_0x16a5('0x61')]);}})[_0x16a5('0x3d')](respondWithResult(_0x59c444,null))[_0x16a5('0x2d')](handleError(_0x59c444,null));};exports[_0x16a5('0x74')]=function(_0x45d2e0,_0x3616c9,_0x1c83ba){var _0x28f2c9={'raw':![],'where':{}};var _0x4bbc08={};var _0x424090={'count':0x0,'rows':[]};return db[_0x16a5('0x46')][_0x16a5('0x6c')]({'where':{'id':_0x45d2e0[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x3616c9,null))[_0x16a5('0x3d')](function(_0x4a94a7){if(_0x4a94a7){_0x4bbc08['model']=_[_0x16a5('0x5e')](db[_0x16a5('0x73')][_0x16a5('0x47')]);_0x4bbc08[_0x16a5('0x4b')]=_['keys'](_0x45d2e0[_0x16a5('0x4b')]);_0x4bbc08['filters']=_[_0x16a5('0x4d')](_0x4bbc08[_0x16a5('0x4a')],_0x4bbc08[_0x16a5('0x4b')]);_0x28f2c9[_0x16a5('0x4e')]=_[_0x16a5('0x4d')](_0x4bbc08[_0x16a5('0x4a')],qs[_0x16a5('0x4f')](_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x4f')]));_0x28f2c9[_0x16a5('0x4e')]=_0x28f2c9[_0x16a5('0x4e')][_0x16a5('0x50')]?_0x28f2c9[_0x16a5('0x4e')]:_0x4bbc08['model'];if(!_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x6e')](_0x16a5('0x6f'))){_0x28f2c9[_0x16a5('0x32')]=qs[_0x16a5('0x32')](_0x45d2e0['query'][_0x16a5('0x32')]);_0x28f2c9[_0x16a5('0x30')]=qs[_0x16a5('0x30')](_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x30')]);}_0x28f2c9['order']=qs[_0x16a5('0x52')](_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x52')]);_0x28f2c9['where']=qs[_0x16a5('0x4c')](_[_0x16a5('0x54')](_0x45d2e0['query'],_0x4bbc08[_0x16a5('0x4c')]));_0x28f2c9[_0x16a5('0x53')][_0x16a5('0x6a')]=_0x4a94a7['id'];if(_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x28f2c9[_0x16a5('0x53')]=_[_0x16a5('0x56')](_0x28f2c9[_0x16a5('0x53')],{'$or':_[_0x16a5('0x45')](_0x28f2c9[_0x16a5('0x4e')],function(_0x1515ee){var _0x101e73={};_0x101e73[_0x1515ee]={'$like':'%'+_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x55')]+'%'};return _0x101e73;})});}_0x28f2c9=_[_0x16a5('0x56')]({},_0x28f2c9,_0x45d2e0[_0x16a5('0x58')]);return db[_0x16a5('0x73')]['count']({'where':_0x28f2c9[_0x16a5('0x53')]})[_0x16a5('0x3d')](function(_0x2a7400){_0x424090[_0x16a5('0x33')]=_0x2a7400;if(_0x45d2e0[_0x16a5('0x4b')][_0x16a5('0x59')]){_0x28f2c9[_0x16a5('0x5a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x28f2c9);})[_0x16a5('0x3d')](function(_0x4ee798){_0x424090[_0x16a5('0x70')]=_0x4ee798;return _0x424090;});}})['then'](respondWithFilteredResult(_0x3616c9,_0x28f2c9))[_0x16a5('0x2d')](handleError(_0x3616c9,null));};exports['removeAnswers']=function(_0x5a7ab0,_0x5db564,_0x8f6e94){return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x5a7ab0[_0x16a5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5db564,null))[_0x16a5('0x3d')](function(_0x6a09a0){if(_0x6a09a0){return _0x6a09a0[_0x16a5('0x75')](_0x5a7ab0['query'][_0x16a5('0x76')]);}})[_0x16a5('0x3d')](respondWithStatusCode(_0x5db564,null))[_0x16a5('0x2d')](handleError(_0x5db564,null));};exports[_0x16a5('0x77')]=function(_0x34da5d,_0x1f71ab,_0x268459){var _0x4ededa={'channel':_0x16a5('0x78')};var _0x5bfac8=[];var _0x10ddb5=[];var _0x5d1d05={};return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x34da5d['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x16a5('0x79')}]})['then'](handleEntityNotFound(_0x1f71ab,null))['then'](function(_0x4909d4){_0x4ededa['account']=_0x4909d4;_0x4ededa['applications']=_[_0x16a5('0x7a')](_0x4909d4[_0x16a5('0x79')],['priority'],[_0x16a5('0x7b')]);if(_0x4ededa[_0x16a5('0x7c')][_0x16a5('0x79')]){delete _0x4ededa[_0x16a5('0x7c')][_0x16a5('0x79')];}return db['CmContact'][_0x16a5('0x68')]();})[_0x16a5('0x3d')](function(_0x242463){if(!_0x242463){throw new db['Sequelize'][(_0x16a5('0x7d'))](_0x16a5('0x7e'));}_0x5bfac8=_[_0x16a5('0x7f')](_['keys'](_0x242463),[_0x16a5('0x80'),_0x16a5('0x81')]);_0x10ddb5=_['difference'](_[_0x16a5('0x5e')](_0x242463),[_0x16a5('0x80'),'updatedAt',_0x16a5('0x82'),_0x16a5('0x83')]);_0x4ededa['body']={'mapKey':_0x16a5('0x84')};if(_0x4ededa['account'][_0x16a5('0x49')]){switch(_0x4ededa[_0x16a5('0x7c')][_0x16a5('0x49')]){case _0x16a5('0x85'):_0x4ededa['body'][_0x16a5('0x86')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x87')];_0x4ededa[_0x16a5('0x61')]['body']=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x88')];_0x4ededa['body'][_0x16a5('0x89')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x8a')];break;case'skebby':_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]='+'+_0x34da5d[_0x16a5('0x61')][_0x16a5('0x8b')];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x8c')];break;case _0x16a5('0x8d'):_0x4ededa['body']['from']=_0x34da5d['body'][_0x16a5('0x86')];_0x4ededa[_0x16a5('0x61')]['body']=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x2a')];break;case _0x16a5('0x8e'):_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x86')];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')]=_0x34da5d[_0x16a5('0x61')]['body'];_0x4ededa[_0x16a5('0x61')]['messageId']=_0x34da5d[_0x16a5('0x61')]['message_id'];break;case _0x16a5('0x8f'):_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d['body'][_0x16a5('0x87')];_0x4ededa[_0x16a5('0x61')]['body']=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x90')];_0x4ededa['body'][_0x16a5('0x89')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x91')];break;case'infobip':_0x4ededa[_0x16a5('0x61')]['from']='+'+_0x34da5d[_0x16a5('0x61')][_0x16a5('0x92')][0x0][_0x16a5('0x86')];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x92')][0x0]['text'];_0x4ededa[_0x16a5('0x61')]['messageId']=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x92')][0x0][_0x16a5('0x89')];break;case _0x16a5('0x93'):_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x94')];_0x4ededa['body']['body']=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x95')]['message'];break;case _0x16a5('0x96'):_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d['body'][_0x16a5('0x97')];_0x4ededa['body'][_0x16a5('0x61')]=_0x34da5d[_0x16a5('0x61')]['text'];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x89')]=_0x34da5d['body'][_0x16a5('0x98')];break;case _0x16a5('0x99'):_0x4ededa[_0x16a5('0x61')][_0x16a5('0x89')]=_0x34da5d['body'][0x0]['message']['id'];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d[_0x16a5('0x61')][0x0][_0x16a5('0x2a')][_0x16a5('0x86')];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')]=_0x34da5d['body'][0x0][_0x16a5('0x2a')][_0x16a5('0x8c')];break;case'intelepeer':_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')]=_0x34da5d[_0x16a5('0x61')]['from'];_0x4ededa['body']['body']=_0x34da5d['body'][_0x16a5('0x2a')];_0x4ededa[_0x16a5('0x61')][_0x16a5('0x89')]=_0x34da5d[_0x16a5('0x61')][_0x16a5('0x9a')];break;}}if(_0x4ededa[_0x16a5('0x61')]['id']){delete _0x4ededa[_0x16a5('0x61')]['id'];}if(_[_0x16a5('0x9b')](_0x4ededa[_0x16a5('0x61')]['from'])){throw new db[(_0x16a5('0x9c'))]['ValidationError'](_0x16a5('0x9d'));}if(_[_0x16a5('0x9b')](_0x4ededa[_0x16a5('0x61')]['body'])||_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')]===''){throw new db['Sequelize'][(_0x16a5('0x7d'))](_0x16a5('0x9e'));}if(_[_0x16a5('0x9b')](_0x4ededa[_0x16a5('0x61')][_0x16a5('0x9f')])){throw new db[(_0x16a5('0x9c'))][(_0x16a5('0x7d'))](_0x16a5('0xa0')+_0x10ddb5);}if(!_[_0x16a5('0xa1')](_0x10ddb5,_0x4ededa['body']['mapKey'])){throw new db[(_0x16a5('0x9c'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10ddb5);}_0x5d1d05[_0x4ededa['body'][_0x16a5('0x9f')]]=_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')];return db[_0x16a5('0xa2')][_0x16a5('0x5f')]({'where':{'id':_0x4ededa[_0x16a5('0x7c')]['ListId']},'include':[{'model':db[_0x16a5('0xa3')],'as':'Contacts','where':_0x5d1d05,'limit':0x1,'order':[['updatedAt',_0x16a5('0xa4')]]}]});})[_0x16a5('0x3d')](handleEntityNotFound(_0x1f71ab,null))[_0x16a5('0x3d')](function(_0x1948ac){if(_0x1948ac){_0x4ededa[_0x16a5('0xa5')]=_['omit'](_0x1948ac,['Contacts']);if(_0x1948ac[_0x16a5('0xa6')][_0x16a5('0x50')]){return _0x1948ac[_0x16a5('0xa6')][0x0];}var _0x34fb7c=_[_0x16a5('0x1a')](_0x4ededa[_0x16a5('0x61')],{'firstName':_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')],'ListId':_0x1948ac['id']});_0x34fb7c[_0x4ededa[_0x16a5('0x61')][_0x16a5('0x9f')]]=_0x4ededa[_0x16a5('0x61')][_0x16a5('0x86')];return db[_0x16a5('0xa3')][_0x16a5('0x60')](_0x34fb7c,{'fields':_0x5bfac8,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f71ab,null))[_0x16a5('0x3d')](function(_0x5a3e1b){if(_0x5a3e1b){_0x4ededa[_0x16a5('0xa7')]=_0x5a3e1b;var _0x3e1716={'ContactId':_0x5a3e1b['id'],'phone':_0x4ededa['body'][_0x16a5('0x86')],'SmsAccountId':_0x34da5d['params']['id']};var _0x2244c9={'ContactId':_0x5a3e1b['id'],'SmsAccountId':_0x34da5d['params']['id'],'closed':![]};return db[_0x16a5('0xa8')][_0x16a5('0x5f')]({'where':_0x2244c9})[_0x16a5('0x3d')](function(_0x1dd2aa){if(_0x1dd2aa){return[_0x1dd2aa,![]];}return db['SmsInteraction']['create'](_0x3e1716)['then'](function(_0x1c4dec){return[_0x1c4dec,!![]];});});}})['spread'](function(_0x1b1f15,_0x1ce6aa){_0x4ededa['interaction']=_0x1b1f15[_0x16a5('0x3a')]({'plain':!![]});_0x4ededa['interaction'][_0x16a5('0xa9')]=![];if(_0x1ce6aa){if(_0x4ededa[_0x16a5('0x7c')]['autoclose']){_0x4ededa[_0x16a5('0xaa')][_0x16a5('0xab')]({'id':0x0,'priority':_0x4ededa[_0x16a5('0xaa')][_0x16a5('0x50')]+0x1,'app':'close','appdata':_0x16a5('0xac'),'interval':_0x16a5('0xad')});}_0x4ededa[_0x16a5('0xae')][_0x16a5('0xa9')]=!![];}return db[_0x16a5('0xaf')]['create']({'phone':_0x4ededa[_0x16a5('0x61')]['from'],'messageId':_0x4ededa['body'][_0x16a5('0x89')],'body':_0x4ededa[_0x16a5('0x61')][_0x16a5('0x61')],'SmsAccountId':_0x34da5d[_0x16a5('0x5d')]['id'],'SmsInteractionId':_0x1b1f15['id'],'direction':'in','ContactId':_0x1b1f15[_0x16a5('0xb0')],'AttachmentId':_0x4ededa[_0x16a5('0x61')]['AttachmentId']});})[_0x16a5('0x3d')](function(_0x5dd8cf){_0x4ededa[_0x16a5('0x2a')]=_0x5dd8cf;if(_0x4ededa[_0x16a5('0xae')][_0x16a5('0xb1')]){return db['User'][_0x16a5('0x5f')]({'attributes':['id','name'],'where':{'id':_0x4ededa['interaction']['UserId']}})[_0x16a5('0x3d')](function(_0x30e929){if(_0x30e929){_0x4ededa[_0x16a5('0xaa')][_0x16a5('0xb2')]({'id':0x0,'priority':0x0,'app':_0x16a5('0xb3'),'appdata':_0x30e929[_0x16a5('0x40')]+','+(_0x4ededa[_0x16a5('0x7c')][_0x16a5('0xb4')]||0xa),'interval':_0x16a5('0xad')});}return respondWithRpcPromise(_0x16a5('0xb5'),_0x16a5('0xb6'),_0x4ededa);});}return respondWithRpcPromise(_0x16a5('0xb5'),_0x16a5('0xb6'),_0x4ededa);})[_0x16a5('0x3d')](function(_0xde3fc6){if(_0xde3fc6){var _0x3b479f=0xc8;var _0x33a569='receiveMessage';logger[_0x16a5('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33a569,_0x3b479f,_0x16a5('0xb7'));logger[_0x16a5('0x24')](_0x16a5('0xb8'),_0x33a569,_0x3b479f,_0x16a5('0xb7'),JSON[_0x16a5('0x26')](_0xde3fc6));if(_0x4ededa['account'][_0x16a5('0x49')]===_0x16a5('0x85')){return _0x1f71ab['status'](_0x3b479f)['set'](_0x16a5('0xb9'),'text/xml')[_0x16a5('0x41')]('\x0a');}else{return _0x1f71ab[_0x16a5('0x2e')](_0x3b479f)[_0x16a5('0x36')](_0xde3fc6);}}})[_0x16a5('0x2d')](handleError(_0x1f71ab,null));};exports['addApplications']=function(_0x259e2b,_0x5a62fc){var _0x3439f0=_0x259e2b[_0x16a5('0x5d')]['id'];var _0x2746f7=_0x259e2b[_0x16a5('0x61')];var _0x153ebd=0xc8;var _0x68388=null;return db[_0x16a5('0xba')][_0x16a5('0xbb')]({'isolationLevel':db[_0x16a5('0xba')][_0x16a5('0xbc')][_0x16a5('0xbd')]['READ_COMMITTED']},function(_0x3f3e11){return db['SmsAccount'][_0x16a5('0x6c')]({'where':{'id':_0x3439f0},'transaction':_0x3f3e11})[_0x16a5('0x3d')](function(_0x1ddb2c){if(_0x1ddb2c){return db[_0x16a5('0xbe')][_0x16a5('0x39')]({'where':{'SmsAccountId':_0x3439f0},'transaction':_0x3f3e11})[_0x16a5('0x3d')](function(){var _0x1f6c5e=_[_0x16a5('0x45')](_0x2746f7,function(_0x1deb5f){_0x1deb5f[_0x16a5('0x6a')]=_0x3439f0;return _0x1deb5f;});return db['SmsApplication'][_0x16a5('0xbf')](_0x1f6c5e,{'transaction':_0x3f3e11});});}else{_0x153ebd=0x194;_0x68388=[];}});})['then'](function(){if(_0x153ebd!==0x194){return db[_0x16a5('0xbe')][_0x16a5('0xc0')]({'where':{'SmsAccountId':_0x3439f0},'order':_0x16a5('0xc1')})[_0x16a5('0x3d')](function(_0x13c933){_0x68388=_0x13c933;});}})[_0x16a5('0x2d')](function(_0x257b23){_0x153ebd=0x1f4;logger[_0x16a5('0x27')](_0x257b23[_0x16a5('0x3f')]);if(_0x257b23[_0x16a5('0x40')]){delete _0x257b23[_0x16a5('0x40')];}_0x68388=_0x257b23;})[_0x16a5('0xc2')](function(){if(_0x68388===null){_0x5a62fc[_0x16a5('0x3e')](_0x153ebd);}else{if(_0x153ebd===0x1f4){_0x5a62fc[_0x16a5('0x2e')](_0x153ebd)[_0x16a5('0x41')](_0x68388);}else{_0x5a62fc['status'](_0x153ebd)[_0x16a5('0x36')](_0x68388);}}});};exports['getApplications']=function(_0x366b17,_0x4668a5,_0x3e36b9){var _0x47a0a4={};var _0xe8605e={};var _0x5b5a26;var _0x484b06;return db[_0x16a5('0x46')][_0x16a5('0x6c')]({'where':{'id':_0x366b17[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x4668a5,null))['then'](function(_0x7b834e){if(_0x7b834e){_0x5b5a26=_0x7b834e;_0xe8605e[_0x16a5('0x4a')]=_[_0x16a5('0x5e')](db['SmsApplication'][_0x16a5('0x47')]);_0xe8605e[_0x16a5('0x4b')]=_[_0x16a5('0x5e')](_0x366b17[_0x16a5('0x4b')]);_0xe8605e[_0x16a5('0x4c')]=_[_0x16a5('0x4d')](_0xe8605e[_0x16a5('0x4a')],_0xe8605e[_0x16a5('0x4b')]);_0x47a0a4[_0x16a5('0x4e')]=_[_0x16a5('0x4d')](_0xe8605e[_0x16a5('0x4a')],qs[_0x16a5('0x4f')](_0x366b17['query'][_0x16a5('0x4f')]));_0x47a0a4['attributes']=_0x47a0a4[_0x16a5('0x4e')]['length']?_0x47a0a4[_0x16a5('0x4e')]:_0xe8605e[_0x16a5('0x4a')];_0x47a0a4['order']=qs[_0x16a5('0x52')](_0x366b17[_0x16a5('0x4b')][_0x16a5('0x52')]);_0x47a0a4[_0x16a5('0x53')]=qs[_0x16a5('0x4c')](_[_0x16a5('0x54')](_0x366b17[_0x16a5('0x4b')],_0xe8605e[_0x16a5('0x4c')]));if(_0x366b17[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x47a0a4['where']=_[_0x16a5('0x56')](_0x47a0a4[_0x16a5('0x53')],{'$or':_['map'](_0x47a0a4[_0x16a5('0x4e')],function(_0x3c51ab){var _0x1943eb={};_0x1943eb[_0x3c51ab]={'$like':'%'+_0x366b17['query']['filter']+'%'};return _0x1943eb;})});}_0x47a0a4=_['merge']({},_0x47a0a4,_0x366b17['options']);return _0x5b5a26[_0x16a5('0xc3')](_0x47a0a4);}})['then'](function(_0x1ec3b1){if(_0x1ec3b1){_0x484b06=_0x1ec3b1[_0x16a5('0x50')];if(!_0x366b17[_0x16a5('0x4b')][_0x16a5('0x6e')](_0x16a5('0x6f'))){_0x47a0a4['limit']=qs['limit'](_0x366b17[_0x16a5('0x4b')]['limit']);_0x47a0a4['offset']=qs['offset'](_0x366b17['query']['offset']);}return _0x5b5a26[_0x16a5('0xc3')](_0x47a0a4);}})['then'](function(_0x2b052d){if(_0x2b052d){return _0x2b052d?{'count':_0x484b06,'rows':_0x2b052d}:null;}})['then'](respondWithResult(_0x4668a5,null))[_0x16a5('0x2d')](handleError(_0x4668a5,null));};exports[_0x16a5('0xc4')]=function(_0xb068bb,_0x2913bd,_0x17402a){var _0x50312d={'raw':![],'where':{}};var _0x3d786c={};var _0x3a0848={'count':0x0,'rows':[]};return db['SmsAccount'][_0x16a5('0x6c')]({'where':{'id':_0xb068bb[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x2913bd,null))['then'](function(_0x372031){if(_0x372031){_0x3d786c[_0x16a5('0x4a')]=_[_0x16a5('0x5e')](db['SmsInteraction'][_0x16a5('0x47')]);_0x3d786c['query']=_['keys'](_0xb068bb['query']);_0x3d786c[_0x16a5('0x4c')]=_[_0x16a5('0x4d')](_0x3d786c[_0x16a5('0x4a')],_0x3d786c[_0x16a5('0x4b')]);_0x50312d[_0x16a5('0x4e')]=_[_0x16a5('0x4d')](_0x3d786c[_0x16a5('0x4a')],qs[_0x16a5('0x4f')](_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x4f')]));_0x50312d['attributes']=_0x50312d['attributes'][_0x16a5('0x50')]?_0x50312d['attributes']:_0x3d786c['model'];if(!_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x6e')](_0x16a5('0x6f'))){_0x50312d[_0x16a5('0x32')]=qs[_0x16a5('0x32')](_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x32')]);_0x50312d[_0x16a5('0x30')]=qs[_0x16a5('0x30')](_0xb068bb['query'][_0x16a5('0x30')]);}_0x50312d[_0x16a5('0x51')]=qs[_0x16a5('0x52')](_0xb068bb[_0x16a5('0x4b')]['sort']);_0x50312d[_0x16a5('0x53')]=qs['filters'](_[_0x16a5('0x54')](_0xb068bb['query'],_0x3d786c[_0x16a5('0x4c')]));_0x50312d[_0x16a5('0x53')]['SmsAccountId']=_0x372031['id'];if(_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x50312d['where']=_[_0x16a5('0x56')](_0x50312d['where'],{'$or':_[_0x16a5('0x45')](_0x50312d[_0x16a5('0x4e')],function(_0xcc7cf2){var _0x45c134={};_0x45c134[_0xcc7cf2]={'$like':'%'+_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x55')]+'%'};return _0x45c134;})});}_0x50312d=_[_0x16a5('0x56')]({},_0x50312d,_0xb068bb[_0x16a5('0x58')]);return db[_0x16a5('0xa8')][_0x16a5('0x33')]({'where':_0x50312d['where']})[_0x16a5('0x3d')](function(_0x988a62){_0x3a0848[_0x16a5('0x33')]=_0x988a62;if(_0xb068bb[_0x16a5('0x4b')][_0x16a5('0x59')]){_0x50312d[_0x16a5('0x5a')]=[{'model':db[_0x16a5('0xa3')],'as':'Contact','required':![]},{'model':db[_0x16a5('0xc5')],'as':'Owner','attributes':['name','fullname',_0x16a5('0xc6')],'required':![]},{'model':db[_0x16a5('0xc7')],'as':'Tags','attributes':['id',_0x16a5('0x40'),_0x16a5('0xc8')],'where':_0xb068bb['query'][_0x16a5('0xc9')]?{'id':_0xb068bb[_0x16a5('0x4b')][_0x16a5('0xc9')]}:undefined,'required':_0xb068bb[_0x16a5('0x4b')][_0x16a5('0xc9')]?!![]:![]}];}return db[_0x16a5('0xa8')]['findAll'](_0x50312d);})['then'](function(_0x537104){_0x3a0848['rows']=_0x537104;return _0x3a0848;});}})[_0x16a5('0x3d')](respondWithFilteredResult(_0x2913bd,_0x50312d))['catch'](handleError(_0x2913bd,null));};exports[_0x16a5('0x41')]=function(_0x5cfa75,_0x1f1fea,_0x16dd4d){var _0x111235,_0x43e823,_0x2c835c;if(_['isNil'](_0x5cfa75[_0x16a5('0x61')][_0x16a5('0x61')])||_0x5cfa75['body'][_0x16a5('0x61')]===''){throw new db['Sequelize'][(_0x16a5('0x7d'))](_0x16a5('0x9e'));}if(_[_0x16a5('0x9b')](_0x5cfa75[_0x16a5('0x61')]['to'])){throw new db[(_0x16a5('0x9c'))]['ValidationError'](_0x16a5('0xca'));}_0x111235=_0x5cfa75[_0x16a5('0x61')]['to'];return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x5cfa75[_0x16a5('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x16a5('0xcb'),'include':[{'model':db[_0x16a5('0xa3')],'as':_0x16a5('0xa6'),'where':{'mobile':_0x111235},'limit':0x1,'order':[['updatedAt',_0x16a5('0xa4')]]}]}]})[_0x16a5('0x3d')](handleEntityNotFound(_0x1f1fea,null))['then'](function(_0x10a271){if(_0x10a271&&_0x10a271[_0x16a5('0xcb')]){_0x43e823=_0x10a271[_0x16a5('0x3a')]({'plain':!![]});if(_0x43e823[_0x16a5('0xcb')]&&_0x43e823['List'][_0x16a5('0xa6')][_0x16a5('0x50')]){return _0x43e823['List']['Contacts'][0x0];}return db['CmContact'][_0x16a5('0x60')](_['defaults'](_0x5cfa75[_0x16a5('0x61')],{'firstName':_0x111235,'mobile':_0x111235,'phone':_0x111235,'ListId':_0x43e823[_0x16a5('0x83')]}));}})[_0x16a5('0x3d')](handleEntityNotFound(_0x1f1fea,null))[_0x16a5('0x3d')](function(_0x167499){if(_0x167499){_0x2c835c=_0x167499;return db[_0x16a5('0xa8')][_0x16a5('0x5f')]({'where':{'ContactId':_0x2c835c['id'],'closed':![],'SmsAccountId':_0x43e823['id']}})['then'](function(_0x12543d){if(_0x12543d){return[_0x12543d,![]];}return db['SmsInteraction'][_0x16a5('0x60')]({'UserId':_0x5cfa75['user']['id'],'ContactId':_0x2c835c['id'],'SmsAccountId':_0x43e823['id'],'phone':_0x111235,'firstMsgDirection':_0x16a5('0xcc'),'Messages':[_[_0x16a5('0x56')](_0x5cfa75['body'],{'read':![],'body':_0x5cfa75[_0x16a5('0x61')][_0x16a5('0x61')],'phone':_0x111235,'SmsAccountId':_0x43e823['id'],'UserId':_0x5cfa75['user']['id'],'ContactId':_0x2c835c['id']})]},{'include':[{'model':db[_0x16a5('0xaf')],'as':_0x16a5('0xcd')}]})['then'](function(_0x4a9883){return[_0x4a9883,!![]];});});}})[_0x16a5('0xce')](function(_0x252015,_0x67fa27){if(_0x67fa27){return _0x252015;}return db[_0x16a5('0xaf')][_0x16a5('0x60')](_[_0x16a5('0x56')](_0x5cfa75['body'],{'read':![],'body':_0x5cfa75[_0x16a5('0x61')]['body'],'phone':_0x111235,'SmsAccountId':_0x43e823['id'],'SmsInteractionId':_0x252015['id'],'UserId':_0x5cfa75[_0x16a5('0x62')]['id'],'ContactId':_0x2c835c['id']}))[_0x16a5('0x3d')](function(_0xdaeb22){_0x252015[_0x16a5('0xcf')][_0x16a5('0xcd')]=[];_0x252015[_0x16a5('0xcf')][_0x16a5('0xcd')][_0x16a5('0xab')](_0xdaeb22[_0x16a5('0xcf')]);return _0x252015;});})[_0x16a5('0x3d')](respondWithResult(_0x1f1fea,null))['catch'](handleError(_0x1f1fea,null));};exports[_0x16a5('0x2e')]=function(_0x360380,_0x214825,_0x841dc2){if(_0x360380['body']['id']){delete _0x360380[_0x16a5('0x61')]['id'];}var _0x505d4d,_0x439f95,_0x322e26;return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x360380['params']['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x214825,null))[_0x16a5('0x3d')](function(_0x2ec262){if(_0x2ec262){_0x322e26=_0x2ec262;logger['debug'](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0xd0'),_0x2ec262[_0x16a5('0x49')],util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x2ec262[_0x16a5('0x49')]){case _0x16a5('0xd2'):if(_0x360380[_0x16a5('0x61')][_0x16a5('0xd3')]&&_0x360380[_0x16a5('0x61')][_0x16a5('0x2e')]){_0x439f95=_0x360380[_0x16a5('0x61')][_0x16a5('0x2e')];return db[_0x16a5('0xaf')][_0x16a5('0x5f')]({'where':{'messageId':_0x360380[_0x16a5('0x61')][_0x16a5('0xd3')]}});}break;case _0x16a5('0x8d'):if(_0x360380[_0x16a5('0x61')][_0x16a5('0xd4')]&&_0x360380[_0x16a5('0x61')][_0x16a5('0xd5')]){_0x439f95=_0x360380[_0x16a5('0x61')]['statusInt'];return db[_0x16a5('0xaf')][_0x16a5('0x5f')]({'where':{'messageId':_0x360380[_0x16a5('0x61')]['requestid']}});}break;case _0x16a5('0x8e'):if(_0x360380[_0x16a5('0x61')]['message_id']&&_0x360380[_0x16a5('0x61')][_0x16a5('0xd6')]){_0x439f95=_0x360380[_0x16a5('0x61')]['status_code'];return db[_0x16a5('0xaf')][_0x16a5('0x5f')]({'where':{'messageId':_0x360380[_0x16a5('0x61')][_0x16a5('0xd7')]}});}break;case'infobip':var _0x38103a=_0x360380[_0x16a5('0x61')]['results'][0x0];if(_0x38103a[_0x16a5('0x89')]&&_0x38103a[_0x16a5('0x2e')]['groupName']==='DELIVERED'){_0x439f95=_0x38103a[_0x16a5('0x2e')][_0x16a5('0xd8')];return db[_0x16a5('0xaf')][_0x16a5('0x5f')]({'where':{'messageId':_0x38103a[_0x16a5('0x89')]}});}break;case _0x16a5('0x96'):if(_0x360380['body'][_0x16a5('0x89')]&&_0x360380[_0x16a5('0x61')][_0x16a5('0x2e')]){_0x439f95=_0x360380[_0x16a5('0x61')]['status'];return db[_0x16a5('0xaf')]['find']({'where':{'messageId':_0x360380[_0x16a5('0x61')]['messageId']}});}break;case'bandwidth':if(_0x360380['body'][0x0][_0x16a5('0x2a')]['id']){_0x439f95=_0x360380['body'][0x0][_0x16a5('0x49')];return db[_0x16a5('0xaf')]['find']({'where':{'messageId':_0x360380[_0x16a5('0x61')][0x0]['message']['id']}});}break;case _0x16a5('0xd9'):if(_0x360380[_0x16a5('0x61')][_0x16a5('0xda')]&&_0x360380[_0x16a5('0x61')][_0x16a5('0x2e')]){_0x439f95=_0x360380[_0x16a5('0x61')][_0x16a5('0x2e')];return db[_0x16a5('0xaf')][_0x16a5('0x5f')]({'where':{'messageId':_0x360380[_0x16a5('0x61')][_0x16a5('0xda')]}});}break;}}})['then'](handleEntityNotFound(_0x214825,null))[_0x16a5('0x3d')](function(_0x28900e){if(_0x28900e){_0x505d4d=_0x28900e;switch(_0x322e26[_0x16a5('0x49')]){case _0x16a5('0xd2'):if(_0x439f95==='DELIVERED'){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0xd2'),util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0x8d'):if(_0x439f95==='1'){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')](_0x16a5('0x25'),_0x16a5('0x2e'),'skebby',util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0x8e'):if(!_0x360380[_0x16a5('0x61')]['error_code']&&_0x439f95>=0xc8&&_0x439f95<=0xce){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0x8e'),util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0xdb'):var _0x5c44b3=_0x360380[_0x16a5('0x61')][_0x16a5('0x92')][0x0];if(_0x5c44b3[_0x16a5('0x2e')][_0x16a5('0xd8')]==='DELIVERED'){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16a5('0x2e'),'infobip',util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0x96'):if(_0x439f95=='DELIVERED_TO_GATEWAY'||_0x439f95==_0x16a5('0xdc')){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0x96'),util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0x99'):if(_0x439f95=='message-delivered'){return _0x505d4d[_0x16a5('0x67')]({'read':!![]});}else{logger[_0x16a5('0x27')](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0x99'),util[_0x16a5('0xd1')](_0x360380[_0x16a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x16a5('0xd9'):if(_0x439f95==='DELIVRD'||_0x439f95==='ACCEPTD'){return _0x505d4d['update']({'read':!![]});}else{logger['error'](_0x16a5('0x25'),'status',_0x16a5('0xd9'),util[_0x16a5('0xd1')](_0x360380['body'],{'showHidden':![],'depth':null}));}break;}return _0x505d4d;}})['then'](respondWithResult(_0x214825,null))[_0x16a5('0x2d')](handleError(_0x214825,null));};exports[_0x16a5('0xdd')]=function(_0x22c4b3,_0x5ef587,_0x10a1f3){var _0x4b4f70,_0x17a53f,_0xdba0e6;return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x22c4b3['params']['id']}})['then'](handleEntityNotFound(_0x5ef587,null))[_0x16a5('0x3d')](function(_0x5de846){if(_0x5de846){_0xdba0e6=_0x5de846;logger[_0x16a5('0x24')](_0x16a5('0x25'),_0x16a5('0x2e'),_0x16a5('0xd0'),_0x5de846[_0x16a5('0x49')],util[_0x16a5('0xd1')](_0x22c4b3[_0x16a5('0x4b')],{'showHidden':![],'depth':null}));switch(_0x5de846[_0x16a5('0x49')]){case _0x16a5('0x93'):if(_0x22c4b3[_0x16a5('0x4b')][_0x16a5('0xde')]&&_0x22c4b3[_0x16a5('0x4b')][_0x16a5('0xdf')]){_0x17a53f=_0x22c4b3[_0x16a5('0x4b')][_0x16a5('0xdf')];return db['SmsMessage'][_0x16a5('0x5f')]({'where':{'messageId':_0x22c4b3['query'][_0x16a5('0xde')]}});}break;}}})[_0x16a5('0x3d')](handleEntityNotFound(_0x5ef587,null))[_0x16a5('0x3d')](function(_0x2545b7){if(_0x2545b7){_0x4b4f70=_0x2545b7;switch(_0xdba0e6[_0x16a5('0x49')]){case'csc':if(_0x17a53f==='2'||_0x17a53f==='6'){return _0x4b4f70['update']({'read':!![]});}else{logger[_0x16a5('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16a5('0x2e'),_0x16a5('0x93'),util[_0x16a5('0xd1')](_0x22c4b3[_0x16a5('0x4b')],{'showHidden':![],'depth':null}));};break;}return _0x4b4f70;}})[_0x16a5('0x3d')](respondWithResult(_0x5ef587,null))[_0x16a5('0x2d')](handleError(_0x5ef587,null));};exports[_0x16a5('0xe0')]=function(_0x468b04,_0x3b30dc,_0x26e383){return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x468b04[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x3b30dc,null))['then'](function(_0x59648){if(_0x59648){return _0x59648[_0x16a5('0xe0')](_0x468b04[_0x16a5('0x61')][_0x16a5('0x76')],_[_0x16a5('0xe1')](_0x468b04[_0x16a5('0x61')],[_0x16a5('0x76'),'id'])||{})[_0x16a5('0xce')](function(_0x3ea0f4){for(var _0x56a07a=0x0;_0x56a07a<_0x468b04['body'][_0x16a5('0x76')][_0x16a5('0x50')];_0x56a07a+=0x1){socket[_0x16a5('0xe2')]('userSmsAccount:save',{'UserId':Number(_0x468b04[_0x16a5('0x61')][_0x16a5('0x76')][_0x56a07a]),'SmsAccountId':Number(_0x468b04[_0x16a5('0x5d')]['id'])});}return _0x3ea0f4;});}})[_0x16a5('0x3d')](respondWithResult(_0x3b30dc,null))['catch'](handleError(_0x3b30dc,null));};exports[_0x16a5('0xe3')]=function(_0x2f546a,_0x2a3285,_0x121037){return db[_0x16a5('0x46')][_0x16a5('0x5f')]({'where':{'id':_0x2f546a[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x2a3285,null))[_0x16a5('0x3d')](function(_0x3a8b60){if(_0x3a8b60){return _0x3a8b60[_0x16a5('0xe3')](_0x2f546a[_0x16a5('0x4b')]['ids'])[_0x16a5('0x3d')](function(){if(_[_0x16a5('0xe4')](_0x2f546a[_0x16a5('0x4b')][_0x16a5('0x76')])){for(var _0x3da4dd=0x0;_0x3da4dd<_0x2f546a[_0x16a5('0x4b')][_0x16a5('0x76')][_0x16a5('0x50')];_0x3da4dd+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2f546a[_0x16a5('0x4b')][_0x16a5('0x76')][_0x3da4dd]),'SmsAccountId':Number(_0x2f546a['params']['id'])});}}else{socket[_0x16a5('0xe2')](_0x16a5('0xe5'),{'UserId':Number(_0x2f546a[_0x16a5('0x4b')][_0x16a5('0x76')]),'SmsAccountId':Number(_0x2f546a[_0x16a5('0x5d')]['id'])});}});}})[_0x16a5('0x3d')](respondWithStatusCode(_0x2a3285,null))[_0x16a5('0x2d')](handleError(_0x2a3285,null));};exports[_0x16a5('0xe6')]=function(_0x1f24ae,_0x4f29e3,_0xffee37){var _0x5e04ad={};var _0x370659={};var _0x48cad2;var _0x277e62;return db[_0x16a5('0x46')][_0x16a5('0x6c')]({'where':{'id':_0x1f24ae[_0x16a5('0x5d')]['id']}})[_0x16a5('0x3d')](handleEntityNotFound(_0x4f29e3,null))[_0x16a5('0x3d')](function(_0x60b07c){if(_0x60b07c){_0x48cad2=_0x60b07c;_0x370659['model']=_[_0x16a5('0x5e')](db[_0x16a5('0xc5')][_0x16a5('0x47')]);_0x370659[_0x16a5('0x4b')]=_[_0x16a5('0x5e')](_0x1f24ae['query']);_0x370659[_0x16a5('0x4c')]=_['intersection'](_0x370659['model'],_0x370659[_0x16a5('0x4b')]);_0x5e04ad[_0x16a5('0x4e')]=_['intersection'](_0x370659[_0x16a5('0x4a')],qs[_0x16a5('0x4f')](_0x1f24ae[_0x16a5('0x4b')][_0x16a5('0x4f')]));_0x5e04ad[_0x16a5('0x4e')]=_0x5e04ad[_0x16a5('0x4e')][_0x16a5('0x50')]?_0x5e04ad[_0x16a5('0x4e')]:_0x370659[_0x16a5('0x4a')];_0x5e04ad['order']=qs['sort'](_0x1f24ae['query']['sort']);_0x5e04ad['where']=qs[_0x16a5('0x4c')](_[_0x16a5('0x54')](_0x1f24ae[_0x16a5('0x4b')],_0x370659[_0x16a5('0x4c')]));if(_0x1f24ae[_0x16a5('0x4b')][_0x16a5('0x55')]){_0x5e04ad[_0x16a5('0x53')]=_[_0x16a5('0x56')](_0x5e04ad[_0x16a5('0x53')],{'$or':_[_0x16a5('0x45')](_0x5e04ad[_0x16a5('0x4e')],function(_0x2ca454){var _0x301118={};_0x301118[_0x2ca454]={'$like':'%'+_0x1f24ae['query'][_0x16a5('0x55')]+'%'};return _0x301118;})});}_0x5e04ad=_[_0x16a5('0x56')]({},_0x5e04ad,_0x1f24ae[_0x16a5('0x58')]);return _0x48cad2['getAgents'](_0x5e04ad);}})['then'](function(_0x9b5149){if(_0x9b5149){_0x277e62=_0x9b5149[_0x16a5('0x50')];if(!_0x1f24ae[_0x16a5('0x4b')][_0x16a5('0x6e')](_0x16a5('0x6f'))){_0x5e04ad['limit']=qs[_0x16a5('0x32')](_0x1f24ae['query'][_0x16a5('0x32')]);_0x5e04ad[_0x16a5('0x30')]=qs['offset'](_0x1f24ae[_0x16a5('0x4b')][_0x16a5('0x30')]);}return _0x48cad2[_0x16a5('0xe6')](_0x5e04ad);}})['then'](function(_0x4775f0){if(_0x4775f0){return _0x4775f0?{'count':_0x277e62,'rows':_0x4775f0}:null;}})['then'](respondWithResult(_0x4f29e3,null))[_0x16a5('0x2d')](handleError(_0x4f29e3,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 4863a4b..89d51b8 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 _0xf990=['emit','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','remove'];(function(_0x4f2828,_0x2a7238){var _0x5d9850=function(_0x5327ed){while(--_0x5327ed){_0x4f2828['push'](_0x4f2828['shift']());}};_0x5d9850(++_0x2a7238);}(_0xf990,0x162));var _0x0f99=function(_0x285c2b,_0x6f1e20){_0x285c2b=_0x285c2b-0x0;var _0x421ee9=_0xf990[_0x285c2b];return _0x421ee9;};'use strict';var EventEmitter=require(_0x0f99('0x0'));var SmsAccount=require(_0x0f99('0x1'))['db'][_0x0f99('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0f99('0x3')](0x0);var events={'afterCreate':_0x0f99('0x4'),'afterUpdate':'update','afterDestroy':_0x0f99('0x5')};function emitEvent(_0x3bb26f){return function(_0x4ddf2e,_0x5f1044,_0x564616){SmsAccountEvents[_0x0f99('0x6')](_0x3bb26f+':'+_0x4ddf2e['id'],_0x4ddf2e);SmsAccountEvents[_0x0f99('0x6')](_0x3bb26f,_0x4ddf2e);_0x564616(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x0f99('0x7')](e,emitEvent(event));}}module[_0x0f99('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x68d1=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x68d1,0x18d));var _0x168d=function(_0x390c42,_0x2e011b){_0x390c42=_0x390c42-0x0;var _0x100b10=_0x68d1[_0x390c42];return _0x100b10;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x168d('0x0'))['db'][_0x168d('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x168d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x6b55d0){return function(_0x182353,_0x1596e4,_0x21a185){SmsAccountEvents[_0x168d('0x3')](_0x6b55d0+':'+_0x182353['id'],_0x182353);SmsAccountEvents[_0x168d('0x3')](_0x6b55d0,_0x182353);_0x21a185(null);};}for(var e in events){if(events[_0x168d('0x4')](e)){var event=events[e];SmsAccount[_0x168d('0x5')](e,emitEvent(event));}}module[_0x168d('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index a758dbe..0214654 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 _0x0aa2=['../../config/environment','./smsAccount.attributes','define','lodash','../../config/logger','bluebird','rimraf'];(function(_0x180c16,_0x306ab2){var _0x4600c1=function(_0x2693b6){while(--_0x2693b6){_0x180c16['push'](_0x180c16['shift']());}};_0x4600c1(++_0x306ab2);}(_0x0aa2,0x1a7));var _0x20aa=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0aa2[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x20aa('0x0'));var util=require('util');var logger=require(_0x20aa('0x1'))('api');var moment=require('moment');var BPromise=require(_0x20aa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20aa('0x3'));var config=require(_0x20aa('0x4'));var attributes=require(_0x20aa('0x5'));module['exports']=function(_0x1f928f,_0x2694a8){return _0x1f928f[_0x20aa('0x6')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe077=['exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','request-promise','path','rimraf','./smsAccount.attributes'];(function(_0x2285e6,_0x34b252){var _0x331b9e=function(_0x5385df){while(--_0x5385df){_0x2285e6['push'](_0x2285e6['shift']());}};_0x331b9e(++_0x34b252);}(_0xe077,0x161));var _0x7e07=function(_0x19c80d,_0x5f1b38){_0x19c80d=_0x19c80d-0x0;var _0x3ca276=_0xe077[_0x19c80d];return _0x3ca276;};'use strict';var _=require(_0x7e07('0x0'));var util=require(_0x7e07('0x1'));var logger=require(_0x7e07('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7e07('0x3'));var fs=require('fs');var path=require(_0x7e07('0x4'));var rimraf=require(_0x7e07('0x5'));var config=require('../../config/environment');var attributes=require(_0x7e07('0x6'));module[_0x7e07('0x7')]=function(_0x4d5ce1,_0x4af71d){return _0x4d5ce1['define'](_0x7e07('0x8'),attributes,{'tableName':_0x7e07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 3c952c9..4dc1742 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 _0x9528=['../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x5948fe,_0x3affae){var _0xb45441=function(_0x2bff25){while(--_0x2bff25){_0x5948fe['push'](_0x5948fe['shift']());}};_0xb45441(++_0x3affae);}(_0x9528,0x1ce));var _0x8952=function(_0x916648,_0x2c8294){_0x916648=_0x916648-0x0;var _0x3f41c5=_0x9528[_0x916648];return _0x3f41c5;};'use strict';var _=require(_0x8952('0x0'));var util=require(_0x8952('0x1'));var moment=require(_0x8952('0x2'));var BPromise=require(_0x8952('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8952('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8952('0x5'));var logger=require(_0x8952('0x6'))(_0x8952('0x7'));var config=require(_0x8952('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8952('0x9')](config['redis'],{'host':_0x8952('0xa'),'port':0x18eb});var socket=require(_0x8952('0xb'))(new Redis(config[_0x8952('0xc')]));require(_0x8952('0xd'))[_0x8952('0xe')](socket);function respondWithRpcPromise(_0x134a90,_0x141389,_0x5eb834){return new BPromise(function(_0x4007f8,_0x50866e){return client[_0x8952('0xf')](_0x134a90,_0x5eb834)['then'](function(_0x2dbfea){logger['info'](_0x8952('0x10'),_0x141389,'request\x20sent');logger[_0x8952('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x141389,_0x8952('0x12'),JSON['stringify'](_0x2dbfea));if(_0x2dbfea[_0x8952('0x13')]){if(_0x2dbfea[_0x8952('0x13')][_0x8952('0x14')]===0x1f4){logger[_0x8952('0x13')](_0x8952('0x10'),_0x141389,_0x2dbfea['error']['message']);return _0x50866e(_0x2dbfea[_0x8952('0x13')]['message']);}logger['error'](_0x8952('0x10'),_0x141389,_0x2dbfea[_0x8952('0x13')][_0x8952('0x15')]);return _0x4007f8(_0x2dbfea[_0x8952('0x13')][_0x8952('0x15')]);}else{logger[_0x8952('0x16')](_0x8952('0x10'),_0x141389,_0x8952('0x12'));_0x4007f8(_0x2dbfea[_0x8952('0x17')][_0x8952('0x15')]);}})[_0x8952('0x18')](function(_0x4086da){logger[_0x8952('0x13')](_0x8952('0x10'),_0x141389,_0x4086da);_0x50866e(_0x4086da);});});}exports[_0x8952('0x19')]=function(_0x500088){var _0x34d560=this;return new Promise(function(_0x2e7b1f,_0xcfd7af){return db[_0x8952('0x1a')][_0x8952('0x1b')]({'raw':_0x500088['options']?_0x500088[_0x8952('0x1c')][_0x8952('0x1d')]===undefined?!![]:![]:!![],'where':_0x500088['options']?_0x500088[_0x8952('0x1c')][_0x8952('0x1e')]||null:null,'attributes':_0x500088[_0x8952('0x1c')]?_0x500088[_0x8952('0x1c')][_0x8952('0x1f')]||null:null,'include':_0x500088['options']?_0x500088[_0x8952('0x1c')][_0x8952('0x20')]?_[_0x8952('0x21')](_0x500088[_0x8952('0x1c')][_0x8952('0x20')],function(_0x590bf6){return{'model':db[_0x590bf6[_0x8952('0x22')]],'as':_0x590bf6['as'],'attributes':_0x590bf6[_0x8952('0x1f')],'include':_0x590bf6[_0x8952('0x20')]?_[_0x8952('0x21')](_0x590bf6[_0x8952('0x20')],function(_0x1716af){return{'model':db[_0x1716af[_0x8952('0x22')]],'as':_0x1716af['as'],'attributes':_0x1716af[_0x8952('0x1f')],'include':_0x1716af[_0x8952('0x20')]?_['map'](_0x1716af[_0x8952('0x20')],function(_0x3dec7f){return{'model':db[_0x3dec7f['model']],'as':_0x3dec7f['as'],'attributes':_0x3dec7f[_0x8952('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c5f0){logger[_0x8952('0x16')](_0x8952('0x19'),_0x500088);logger[_0x8952('0x11')](_0x8952('0x19'),_0x500088,JSON[_0x8952('0x23')](_0x2c5f0));_0x2e7b1f(_0x2c5f0);})[_0x8952('0x18')](function(_0x5af0f9){logger[_0x8952('0x13')]('ShowSmsAccount',_0x5af0f9[_0x8952('0x15')],_0x500088);_0xcfd7af(_0x34d560[_0x8952('0x13')](0x1f4,_0x5af0f9['message']));});});}; \ No newline at end of file +var _0xffe4=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','where','attributes','map','include','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x2ba9cf,_0x423eec){var _0x30f815=function(_0x3c5605){while(--_0x3c5605){_0x2ba9cf['push'](_0x2ba9cf['shift']());}};_0x30f815(++_0x423eec);}(_0xffe4,0x1b6));var _0x4ffe=function(_0x4babb8,_0x261cbc){_0x4babb8=_0x4babb8-0x0;var _0x17c99c=_0xffe4[_0x4babb8];return _0x17c99c;};'use strict';var _=require(_0x4ffe('0x0'));var util=require('util');var moment=require(_0x4ffe('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ffe('0x2'));var fs=require('fs');var Redis=require(_0x4ffe('0x3'));var db=require(_0x4ffe('0x4'))['db'];var utils=require(_0x4ffe('0x5'));var logger=require(_0x4ffe('0x6'))(_0x4ffe('0x7'));var config=require(_0x4ffe('0x8'));var jayson=require(_0x4ffe('0x9'));var client=jayson[_0x4ffe('0xa')][_0x4ffe('0xb')]({'port':0x232a});config['redis']=_[_0x4ffe('0xc')](config[_0x4ffe('0xd')],{'host':_0x4ffe('0xe'),'port':0x18eb});var socket=require(_0x4ffe('0xf'))(new Redis(config[_0x4ffe('0xd')]));require(_0x4ffe('0x10'))[_0x4ffe('0x11')](socket);function respondWithRpcPromise(_0x107f82,_0x16621e,_0x3f3d47){return new BPromise(function(_0x43d2ac,_0x44cfdc){return client['request'](_0x107f82,_0x3f3d47)[_0x4ffe('0x12')](function(_0x1f8fea){logger[_0x4ffe('0x13')](_0x4ffe('0x14'),_0x16621e,_0x4ffe('0x15'));logger['debug'](_0x4ffe('0x16'),_0x16621e,_0x4ffe('0x15'),JSON[_0x4ffe('0x17')](_0x1f8fea));if(_0x1f8fea[_0x4ffe('0x18')]){if(_0x1f8fea[_0x4ffe('0x18')][_0x4ffe('0x19')]===0x1f4){logger[_0x4ffe('0x18')]('SmsAccount,\x20%s,\x20%s',_0x16621e,_0x1f8fea['error']['message']);return _0x44cfdc(_0x1f8fea[_0x4ffe('0x18')][_0x4ffe('0x1a')]);}logger[_0x4ffe('0x18')]('SmsAccount,\x20%s,\x20%s',_0x16621e,_0x1f8fea[_0x4ffe('0x18')][_0x4ffe('0x1a')]);return _0x43d2ac(_0x1f8fea[_0x4ffe('0x18')][_0x4ffe('0x1a')]);}else{logger[_0x4ffe('0x13')](_0x4ffe('0x14'),_0x16621e,_0x4ffe('0x15'));_0x43d2ac(_0x1f8fea[_0x4ffe('0x1b')]['message']);}})[_0x4ffe('0x1c')](function(_0x1d2ac6){logger['error'](_0x4ffe('0x14'),_0x16621e,_0x1d2ac6);_0x44cfdc(_0x1d2ac6);});});}exports[_0x4ffe('0x1d')]=function(_0x2e53b6){var _0x5e5683=this;return new Promise(function(_0x543071,_0xbc1a4a){return db[_0x4ffe('0x1e')]['find']({'raw':_0x2e53b6['options']?_0x2e53b6[_0x4ffe('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2e53b6[_0x4ffe('0x1f')]?_0x2e53b6[_0x4ffe('0x1f')][_0x4ffe('0x20')]||null:null,'attributes':_0x2e53b6[_0x4ffe('0x1f')]?_0x2e53b6['options'][_0x4ffe('0x21')]||null:null,'include':_0x2e53b6['options']?_0x2e53b6[_0x4ffe('0x1f')]['include']?_[_0x4ffe('0x22')](_0x2e53b6[_0x4ffe('0x1f')][_0x4ffe('0x23')],function(_0x2ad271){return{'model':db[_0x2ad271[_0x4ffe('0x24')]],'as':_0x2ad271['as'],'attributes':_0x2ad271[_0x4ffe('0x21')],'include':_0x2ad271['include']?_[_0x4ffe('0x22')](_0x2ad271[_0x4ffe('0x23')],function(_0x45670c){return{'model':db[_0x45670c[_0x4ffe('0x24')]],'as':_0x45670c['as'],'attributes':_0x45670c[_0x4ffe('0x21')],'include':_0x45670c['include']?_[_0x4ffe('0x22')](_0x45670c[_0x4ffe('0x23')],function(_0x104a82){return{'model':db[_0x104a82[_0x4ffe('0x24')]],'as':_0x104a82['as'],'attributes':_0x104a82[_0x4ffe('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4ffe('0x12')](function(_0x13d14c){logger[_0x4ffe('0x13')](_0x4ffe('0x1d'),_0x2e53b6);logger[_0x4ffe('0x25')](_0x4ffe('0x1d'),_0x2e53b6,JSON[_0x4ffe('0x17')](_0x13d14c));_0x543071(_0x13d14c);})[_0x4ffe('0x1c')](function(_0x263d97){logger[_0x4ffe('0x18')](_0x4ffe('0x1d'),_0x263d97[_0x4ffe('0x1a')],_0x2e53b6);_0xbc1a4a(_0x5e5683[_0x4ffe('0x18')](0x1f4,_0x263d97[_0x4ffe('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 4595384..85ae9ca 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 e7dab58..74879cb 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x679fa1,_0x3614fa){var _0x3463b9=function(_0x399529){while(--_0x399529){_0x679fa1['push'](_0x679fa1['shift']());}};_0x3463b9(++_0x3614fa);}(_0x34e8,0x12c));var _0x834e=function(_0x5bbab2,_0x57a62d){_0x5bbab2=_0x5bbab2-0x0;var _0x4a083a=_0x34e8[_0x5bbab2];return _0x4a083a;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3b4567,_0x3f72a7){var _0x2143ac=function(_0x9e9a39){while(--_0x9e9a39){_0x3b4567['push'](_0x3b4567['shift']());}};_0x2143ac(++_0x3f72a7);}(_0xedd9,0xfc));var _0x9edd=function(_0x38a2fa,_0xb21e12){_0x38a2fa=_0x38a2fa-0x0;var _0x1fb3ad=_0xedd9[_0x38a2fa];return _0x1fb3ad;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index cf89b2a..fc1ce19 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 _0x0a1e=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0a1e,0x128));var _0xe0a1=function(_0x36f0e8,_0x23c41f){_0x36f0e8=_0x36f0e8-0x0;var _0x142cbb=_0x0a1e[_0x36f0e8];return _0x142cbb;};'use strict';var Sequelize=require(_0xe0a1('0x0'));module[_0xe0a1('0x1')]={'priority':{'type':Sequelize[_0xe0a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe0a1('0x3')],'allowNull':![],'defaultValue':_0xe0a1('0x4')},'appdata':{'type':Sequelize[_0xe0a1('0x5')]()},'description':{'type':Sequelize[_0xe0a1('0x3')]},'interval':{'type':Sequelize[_0xe0a1('0x3')],'defaultValue':_0xe0a1('0x6')}}; \ No newline at end of file +var _0x7e53=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x466df1,_0x165d7a){var _0x56597b=function(_0x2c6920){while(--_0x2c6920){_0x466df1['push'](_0x466df1['shift']());}};_0x56597b(++_0x165d7a);}(_0x7e53,0xd1));var _0x37e5=function(_0x4c91f6,_0x5d4e0d){_0x4c91f6=_0x4c91f6-0x0;var _0x18ba5e=_0x7e53[_0x4c91f6];return _0x18ba5e;};'use strict';var Sequelize=require(_0x37e5('0x0'));module[_0x37e5('0x1')]={'priority':{'type':Sequelize[_0x37e5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x37e5('0x3')],'allowNull':![],'defaultValue':_0x37e5('0x4')},'appdata':{'type':Sequelize[_0x37e5('0x5')]()},'description':{'type':Sequelize[_0x37e5('0x3')]},'interval':{'type':Sequelize[_0x37e5('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 8a1e954..fd0f301 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 _0x8526=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','crypto'];(function(_0x50f815,_0x3e63fa){var _0x30ae64=function(_0x346868){while(--_0x346868){_0x50f815['push'](_0x50f815['shift']());}};_0x30ae64(++_0x3e63fa);}(_0x8526,0x119));var _0x6852=function(_0x4ce8e7,_0x32e0bc){_0x4ce8e7=_0x4ce8e7-0x0;var _0x4b4217=_0x8526[_0x4ce8e7];return _0x4b4217;};'use strict';var emlformat=require(_0x6852('0x0'));var rimraf=require(_0x6852('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6852('0x2'));var rp=require(_0x6852('0x3'));var moment=require('moment');var BPromise=require(_0x6852('0x4'));var Mustache=require('mustache');var util=require(_0x6852('0x5'));var path=require(_0x6852('0x6'));var sox=require('sox');var csv=require(_0x6852('0x7'));var ejs=require(_0x6852('0x8'));var fs=require('fs');var fs_extra=require(_0x6852('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6852('0xa'));var jsforce=require(_0x6852('0xb'));var deskjs=require(_0x6852('0xc'));var toCsv=require(_0x6852('0x7'));var querystring=require('querystring');var Papa=require(_0x6852('0xd'));var Redis=require('ioredis');var authService=require(_0x6852('0xe'));var qs=require(_0x6852('0xf'));var as=require(_0x6852('0x10'));var hardwareService=require(_0x6852('0x11'));var logger=require(_0x6852('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6852('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13564a,_0x30a0e9){_0x30a0e9=_0x30a0e9||0xcc;return function(_0x36c68d){if(_0x36c68d){return _0x13564a['sendStatus'](_0x30a0e9);}return _0x13564a[_0x6852('0x14')](_0x30a0e9)[_0x6852('0x15')]();};}function respondWithResult(_0x46ae79,_0x338454){_0x338454=_0x338454||0xc8;return function(_0x5e768b){if(_0x5e768b){return _0x46ae79[_0x6852('0x14')](_0x338454)[_0x6852('0x16')](_0x5e768b);}};}function respondWithFilteredResult(_0x19cdee,_0x66a8ae){return function(_0x49781a){if(_0x49781a){var _0x1eee64=typeof _0x66a8ae[_0x6852('0x17')]===_0x6852('0x18')&&typeof _0x66a8ae[_0x6852('0x19')]===_0x6852('0x18');var _0x4e7011=_0x49781a['count'];var _0x278a96=_0x1eee64?0x0:_0x66a8ae['offset'];var _0x55b4fa=_0x1eee64?_0x49781a[_0x6852('0x1a')]:_0x66a8ae[_0x6852('0x17')]+_0x66a8ae['limit'];var _0x452cfc;if(_0x55b4fa>=_0x4e7011){_0x55b4fa=_0x4e7011;_0x452cfc=0xc8;}else{_0x452cfc=0xce;}_0x19cdee['status'](_0x452cfc);return _0x19cdee[_0x6852('0x1b')](_0x6852('0x1c'),_0x278a96+'-'+_0x55b4fa+'/'+_0x4e7011)[_0x6852('0x16')](_0x49781a);}return null;};}function patchUpdates(_0x1132c5){return function(_0x180262){try{jsonpatch['apply'](_0x180262,_0x1132c5,!![]);}catch(_0x19084e){return BPromise[_0x6852('0x1d')](_0x19084e);}return _0x180262[_0x6852('0x1e')]();};}function saveUpdates(_0x5b779a,_0x4bd6ce){return function(_0x3f82aa){if(_0x3f82aa){return _0x3f82aa[_0x6852('0x1f')](_0x5b779a)['then'](function(_0xb6e5bd){return _0xb6e5bd;});}return null;};}function removeEntity(_0x547037,_0x295132){return function(_0x2d9f90){if(_0x2d9f90){return _0x2d9f90[_0x6852('0x20')]()[_0x6852('0x21')](function(){_0x547037[_0x6852('0x14')](0xcc)[_0x6852('0x15')]();});}};}function handleEntityNotFound(_0x5f470f,_0x387e5d){return function(_0x4f0a44){if(!_0x4f0a44){_0x5f470f[_0x6852('0x22')](0x194);}return _0x4f0a44;};}function handleError(_0x46f9c8,_0x39a78e){_0x39a78e=_0x39a78e||0x1f4;return function(_0x3d31cc){logger[_0x6852('0x23')](_0x3d31cc[_0x6852('0x24')]);if(_0x3d31cc[_0x6852('0x25')]){delete _0x3d31cc[_0x6852('0x25')];}_0x46f9c8[_0x6852('0x14')](_0x39a78e)[_0x6852('0x26')](_0x3d31cc);};}exports[_0x6852('0x27')]=function(_0x507eaf,_0x1bc38e){var _0x3cc36f={},_0xe62528={},_0x26c4b2={'count':0x0,'rows':[]};var _0x4f0e3a=_['map'](db[_0x6852('0x28')][_0x6852('0x29')],function(_0x375af0){return{'name':_0x375af0[_0x6852('0x2a')],'type':_0x375af0['type'][_0x6852('0x2b')]};});_0xe62528[_0x6852('0x2c')]=_[_0x6852('0x2d')](_0x4f0e3a,'name');_0xe62528['query']=_[_0x6852('0x2e')](_0x507eaf[_0x6852('0x2f')]);_0xe62528[_0x6852('0x30')]=_[_0x6852('0x31')](_0xe62528[_0x6852('0x2c')],_0xe62528['query']);_0x3cc36f[_0x6852('0x32')]=_[_0x6852('0x31')](_0xe62528[_0x6852('0x2c')],qs[_0x6852('0x33')](_0x507eaf[_0x6852('0x2f')]['fields']));_0x3cc36f['attributes']=_0x3cc36f[_0x6852('0x32')][_0x6852('0x34')]?_0x3cc36f[_0x6852('0x32')]:_0xe62528['model'];if(!_0x507eaf[_0x6852('0x2f')][_0x6852('0x35')](_0x6852('0x36'))){_0x3cc36f[_0x6852('0x19')]=qs[_0x6852('0x19')](_0x507eaf['query']['limit']);_0x3cc36f[_0x6852('0x17')]=qs['offset'](_0x507eaf[_0x6852('0x2f')][_0x6852('0x17')]);}_0x3cc36f[_0x6852('0x37')]=qs[_0x6852('0x38')](_0x507eaf[_0x6852('0x2f')][_0x6852('0x38')]);_0x3cc36f[_0x6852('0x39')]=qs[_0x6852('0x30')](_[_0x6852('0x3a')](_0x507eaf[_0x6852('0x2f')],_0xe62528['filters']),_0x4f0e3a);if(_0x507eaf['query'][_0x6852('0x3b')]){_0x3cc36f[_0x6852('0x39')]=_['merge'](_0x3cc36f['where'],{'$or':_[_0x6852('0x2d')](_0x4f0e3a,function(_0x8b7de2){if(_0x8b7de2[_0x6852('0x3c')]!==_0x6852('0x3d')){var _0x26af28={};_0x26af28[_0x8b7de2[_0x6852('0x25')]]={'$like':'%'+_0x507eaf[_0x6852('0x2f')][_0x6852('0x3b')]+'%'};return _0x26af28;}})});}_0x3cc36f=_[_0x6852('0x3e')]({},_0x3cc36f,_0x507eaf[_0x6852('0x3f')]);var _0x4eb6a3={'where':_0x3cc36f[_0x6852('0x39')]};return db['SmsApplication'][_0x6852('0x1a')](_0x4eb6a3)[_0x6852('0x21')](function(_0x559343){_0x26c4b2['count']=_0x559343;if(_0x507eaf[_0x6852('0x2f')][_0x6852('0x40')]){_0x3cc36f['include']=[{'all':!![]}];}return db[_0x6852('0x28')][_0x6852('0x41')](_0x3cc36f);})['then'](function(_0x5159ad){_0x26c4b2[_0x6852('0x42')]=_0x5159ad;return _0x26c4b2;})[_0x6852('0x21')](respondWithFilteredResult(_0x1bc38e,_0x3cc36f))[_0x6852('0x43')](handleError(_0x1bc38e,null));};exports['show']=function(_0x3dc5df,_0x244cbb){var _0x2b9396={'raw':!![],'where':{'id':_0x3dc5df[_0x6852('0x44')]['id']}},_0x896222={};_0x896222['model']=_[_0x6852('0x2e')](db[_0x6852('0x28')][_0x6852('0x29')]);_0x896222[_0x6852('0x2f')]=_[_0x6852('0x2e')](_0x3dc5df[_0x6852('0x2f')]);_0x896222[_0x6852('0x30')]=_['intersection'](_0x896222[_0x6852('0x2c')],_0x896222[_0x6852('0x2f')]);_0x2b9396['attributes']=_[_0x6852('0x31')](_0x896222[_0x6852('0x2c')],qs[_0x6852('0x33')](_0x3dc5df['query'][_0x6852('0x33')]));_0x2b9396[_0x6852('0x32')]=_0x2b9396[_0x6852('0x32')][_0x6852('0x34')]?_0x2b9396[_0x6852('0x32')]:_0x896222[_0x6852('0x2c')];if(_0x3dc5df[_0x6852('0x2f')][_0x6852('0x40')]){_0x2b9396[_0x6852('0x45')]=[{'all':!![]}];}_0x2b9396=_[_0x6852('0x3e')]({},_0x2b9396,_0x3dc5df[_0x6852('0x3f')]);return db[_0x6852('0x28')][_0x6852('0x46')](_0x2b9396)['then'](handleEntityNotFound(_0x244cbb,null))[_0x6852('0x21')](respondWithResult(_0x244cbb,null))['catch'](handleError(_0x244cbb,null));};exports[_0x6852('0x47')]=function(_0x3fb725,_0xbdcd72){return db[_0x6852('0x28')][_0x6852('0x47')](_0x3fb725[_0x6852('0x48')],{})[_0x6852('0x21')](respondWithResult(_0xbdcd72,0xc9))[_0x6852('0x43')](handleError(_0xbdcd72,null));};exports[_0x6852('0x1f')]=function(_0x410b0b,_0x4e2f97){if(_0x410b0b[_0x6852('0x48')]['id']){delete _0x410b0b[_0x6852('0x48')]['id'];}return db[_0x6852('0x28')][_0x6852('0x46')]({'where':{'id':_0x410b0b['params']['id']}})[_0x6852('0x21')](handleEntityNotFound(_0x4e2f97,null))[_0x6852('0x21')](saveUpdates(_0x410b0b[_0x6852('0x48')],null))[_0x6852('0x21')](respondWithResult(_0x4e2f97,null))[_0x6852('0x43')](handleError(_0x4e2f97,null));};exports[_0x6852('0x20')]=function(_0x16f393,_0x2818ba){return db[_0x6852('0x28')][_0x6852('0x46')]({'where':{'id':_0x16f393['params']['id']}})[_0x6852('0x21')](handleEntityNotFound(_0x2818ba,null))[_0x6852('0x21')](removeEntity(_0x2818ba,null))[_0x6852('0x43')](handleError(_0x2818ba,null));}; \ No newline at end of file +var _0x03a9=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','json','update','then','end','sendStatus','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1e22cd,_0x54c15f){var _0x2788bc=function(_0x5848f7){while(--_0x5848f7){_0x1e22cd['push'](_0x1e22cd['shift']());}};_0x2788bc(++_0x54c15f);}(_0x03a9,0x162));var _0x903a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x03a9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x903a('0x0'));var rimraf=require(_0x903a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x903a('0x2'));var rp=require(_0x903a('0x3'));var moment=require(_0x903a('0x4'));var BPromise=require(_0x903a('0x5'));var Mustache=require(_0x903a('0x6'));var util=require('util');var path=require(_0x903a('0x7'));var sox=require(_0x903a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x903a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x903a('0xa'));var jsforce=require(_0x903a('0xb'));var deskjs=require(_0x903a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x903a('0xd'));var Papa=require('papaparse');var Redis=require(_0x903a('0xe'));var authService=require(_0x903a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x903a('0x10'));var hardwareService=require(_0x903a('0x11'));var logger=require(_0x903a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x903a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x903a('0x14'))['db'];function respondWithStatusCode(_0x3562f0,_0x2d24c3){_0x2d24c3=_0x2d24c3||0xcc;return function(_0x148ddb){if(_0x148ddb){return _0x3562f0['sendStatus'](_0x2d24c3);}return _0x3562f0['status'](_0x2d24c3)['end']();};}function respondWithResult(_0x4f97d2,_0x2dcb15){_0x2dcb15=_0x2dcb15||0xc8;return function(_0x7e50c2){if(_0x7e50c2){return _0x4f97d2[_0x903a('0x15')](_0x2dcb15)['json'](_0x7e50c2);}};}function respondWithFilteredResult(_0x3b19f5,_0x198fde){return function(_0x503655){if(_0x503655){var _0x3058cb=typeof _0x198fde[_0x903a('0x16')]===_0x903a('0x17')&&typeof _0x198fde[_0x903a('0x18')]===_0x903a('0x17');var _0x46f99b=_0x503655[_0x903a('0x19')];var _0x5e3f3d=_0x3058cb?0x0:_0x198fde[_0x903a('0x16')];var _0x1ecd3b=_0x3058cb?_0x503655['count']:_0x198fde[_0x903a('0x16')]+_0x198fde[_0x903a('0x18')];var _0x5f065c;if(_0x1ecd3b>=_0x46f99b){_0x1ecd3b=_0x46f99b;_0x5f065c=0xc8;}else{_0x5f065c=0xce;}_0x3b19f5[_0x903a('0x15')](_0x5f065c);return _0x3b19f5[_0x903a('0x1a')]('Content-Range',_0x5e3f3d+'-'+_0x1ecd3b+'/'+_0x46f99b)[_0x903a('0x1b')](_0x503655);}return null;};}function patchUpdates(_0x480727){return function(_0x34bc95){try{jsonpatch['apply'](_0x34bc95,_0x480727,!![]);}catch(_0xb05f95){return BPromise['reject'](_0xb05f95);}return _0x34bc95['save']();};}function saveUpdates(_0x4b3b82,_0x33ec74){return function(_0x4a2601){if(_0x4a2601){return _0x4a2601[_0x903a('0x1c')](_0x4b3b82)[_0x903a('0x1d')](function(_0x1477d0){return _0x1477d0;});}return null;};}function removeEntity(_0x29e306,_0x286580){return function(_0x501a61){if(_0x501a61){return _0x501a61['destroy']()['then'](function(){_0x29e306[_0x903a('0x15')](0xcc)[_0x903a('0x1e')]();});}};}function handleEntityNotFound(_0x351ac9,_0x1b849c){return function(_0x3e6574){if(!_0x3e6574){_0x351ac9[_0x903a('0x1f')](0x194);}return _0x3e6574;};}function handleError(_0x1ce678,_0x961d35){_0x961d35=_0x961d35||0x1f4;return function(_0x1726dc){logger[_0x903a('0x20')](_0x1726dc['stack']);if(_0x1726dc[_0x903a('0x21')]){delete _0x1726dc[_0x903a('0x21')];}_0x1ce678['status'](_0x961d35)[_0x903a('0x22')](_0x1726dc);};}exports[_0x903a('0x23')]=function(_0x457370,_0x4def48){var _0x5bcac8={},_0x437b18={},_0x4206f4={'count':0x0,'rows':[]};var _0xe22d0b=_[_0x903a('0x24')](db[_0x903a('0x25')][_0x903a('0x26')],function(_0x4ccad4){return{'name':_0x4ccad4[_0x903a('0x27')],'type':_0x4ccad4[_0x903a('0x28')][_0x903a('0x29')]};});_0x437b18[_0x903a('0x2a')]=_[_0x903a('0x24')](_0xe22d0b,_0x903a('0x21'));_0x437b18[_0x903a('0x2b')]=_[_0x903a('0x2c')](_0x457370[_0x903a('0x2b')]);_0x437b18[_0x903a('0x2d')]=_[_0x903a('0x2e')](_0x437b18[_0x903a('0x2a')],_0x437b18[_0x903a('0x2b')]);_0x5bcac8[_0x903a('0x2f')]=_[_0x903a('0x2e')](_0x437b18[_0x903a('0x2a')],qs[_0x903a('0x30')](_0x457370[_0x903a('0x2b')][_0x903a('0x30')]));_0x5bcac8[_0x903a('0x2f')]=_0x5bcac8[_0x903a('0x2f')][_0x903a('0x31')]?_0x5bcac8[_0x903a('0x2f')]:_0x437b18[_0x903a('0x2a')];if(!_0x457370['query'][_0x903a('0x32')](_0x903a('0x33'))){_0x5bcac8[_0x903a('0x18')]=qs['limit'](_0x457370[_0x903a('0x2b')][_0x903a('0x18')]);_0x5bcac8[_0x903a('0x16')]=qs[_0x903a('0x16')](_0x457370[_0x903a('0x2b')]['offset']);}_0x5bcac8[_0x903a('0x34')]=qs[_0x903a('0x35')](_0x457370[_0x903a('0x2b')][_0x903a('0x35')]);_0x5bcac8['where']=qs[_0x903a('0x2d')](_[_0x903a('0x36')](_0x457370[_0x903a('0x2b')],_0x437b18['filters']),_0xe22d0b);if(_0x457370[_0x903a('0x2b')][_0x903a('0x37')]){_0x5bcac8[_0x903a('0x38')]=_[_0x903a('0x39')](_0x5bcac8[_0x903a('0x38')],{'$or':_[_0x903a('0x24')](_0xe22d0b,function(_0x384215){if(_0x384215['type']!==_0x903a('0x3a')){var _0x2bbbe5={};_0x2bbbe5[_0x384215[_0x903a('0x21')]]={'$like':'%'+_0x457370[_0x903a('0x2b')][_0x903a('0x37')]+'%'};return _0x2bbbe5;}})});}_0x5bcac8=_['merge']({},_0x5bcac8,_0x457370[_0x903a('0x3b')]);var _0x3e908f={'where':_0x5bcac8[_0x903a('0x38')]};return db[_0x903a('0x25')]['count'](_0x3e908f)[_0x903a('0x1d')](function(_0x123bba){_0x4206f4[_0x903a('0x19')]=_0x123bba;if(_0x457370[_0x903a('0x2b')][_0x903a('0x3c')]){_0x5bcac8[_0x903a('0x3d')]=[{'all':!![]}];}return db[_0x903a('0x25')]['findAll'](_0x5bcac8);})[_0x903a('0x1d')](function(_0x525430){_0x4206f4['rows']=_0x525430;return _0x4206f4;})['then'](respondWithFilteredResult(_0x4def48,_0x5bcac8))[_0x903a('0x3e')](handleError(_0x4def48,null));};exports[_0x903a('0x3f')]=function(_0x423504,_0x4c7eb3){var _0x163880={'raw':!![],'where':{'id':_0x423504[_0x903a('0x40')]['id']}},_0x2b1552={};_0x2b1552['model']=_[_0x903a('0x2c')](db[_0x903a('0x25')]['rawAttributes']);_0x2b1552[_0x903a('0x2b')]=_[_0x903a('0x2c')](_0x423504[_0x903a('0x2b')]);_0x2b1552[_0x903a('0x2d')]=_[_0x903a('0x2e')](_0x2b1552['model'],_0x2b1552[_0x903a('0x2b')]);_0x163880['attributes']=_[_0x903a('0x2e')](_0x2b1552[_0x903a('0x2a')],qs[_0x903a('0x30')](_0x423504['query'][_0x903a('0x30')]));_0x163880['attributes']=_0x163880[_0x903a('0x2f')][_0x903a('0x31')]?_0x163880[_0x903a('0x2f')]:_0x2b1552[_0x903a('0x2a')];if(_0x423504[_0x903a('0x2b')][_0x903a('0x3c')]){_0x163880[_0x903a('0x3d')]=[{'all':!![]}];}_0x163880=_[_0x903a('0x39')]({},_0x163880,_0x423504[_0x903a('0x3b')]);return db['SmsApplication'][_0x903a('0x41')](_0x163880)['then'](handleEntityNotFound(_0x4c7eb3,null))[_0x903a('0x1d')](respondWithResult(_0x4c7eb3,null))['catch'](handleError(_0x4c7eb3,null));};exports['create']=function(_0x30ff0f,_0x2a9679){return db[_0x903a('0x25')]['create'](_0x30ff0f[_0x903a('0x42')],{})[_0x903a('0x1d')](respondWithResult(_0x2a9679,0xc9))[_0x903a('0x3e')](handleError(_0x2a9679,null));};exports['update']=function(_0x543a3,_0x57f893){if(_0x543a3[_0x903a('0x42')]['id']){delete _0x543a3[_0x903a('0x42')]['id'];}return db['SmsApplication'][_0x903a('0x41')]({'where':{'id':_0x543a3[_0x903a('0x40')]['id']}})['then'](handleEntityNotFound(_0x57f893,null))['then'](saveUpdates(_0x543a3[_0x903a('0x42')],null))['then'](respondWithResult(_0x57f893,null))[_0x903a('0x3e')](handleError(_0x57f893,null));};exports[_0x903a('0x43')]=function(_0x2824b8,_0x3f58ff){return db[_0x903a('0x25')]['find']({'where':{'id':_0x2824b8[_0x903a('0x40')]['id']}})[_0x903a('0x1d')](handleEntityNotFound(_0x3f58ff,null))['then'](removeEntity(_0x3f58ff,null))['catch'](handleError(_0x3f58ff,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 17f68ea..abd728c 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 _0xdb63=['moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4','util','../../config/logger'];(function(_0x1ca810,_0x4ee62d){var _0x449cc1=function(_0x20a874){while(--_0x20a874){_0x1ca810['push'](_0x1ca810['shift']());}};_0x449cc1(++_0x4ee62d);}(_0xdb63,0x18a));var _0x3db6=function(_0x478cac,_0x598fd2){_0x478cac=_0x478cac-0x0;var _0x5094ac=_0xdb63[_0x478cac];return _0x5094ac;};'use strict';var _=require('lodash');var util=require(_0x3db6('0x0'));var logger=require(_0x3db6('0x1'))('api');var moment=require(_0x3db6('0x2'));var BPromise=require(_0x3db6('0x3'));var rp=require(_0x3db6('0x4'));var fs=require('fs');var path=require(_0x3db6('0x5'));var rimraf=require('rimraf');var config=require(_0x3db6('0x6'));var attributes=require(_0x3db6('0x7'));module[_0x3db6('0x8')]=function(_0x167829,_0x524ba1){return _0x167829[_0x3db6('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3db6('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xce41=['exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','../../config/environment','./smsApplication.attributes'];(function(_0x36e0f9,_0x36cc8f){var _0x1e2b66=function(_0x4839fc){while(--_0x4839fc){_0x36e0f9['push'](_0x36e0f9['shift']());}};_0x1e2b66(++_0x36cc8f);}(_0xce41,0xf4));var _0x1ce4=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xce41[_0x421196];return _0x2738af;};'use strict';var _=require(_0x1ce4('0x0'));var util=require(_0x1ce4('0x1'));var logger=require('../../config/logger')(_0x1ce4('0x2'));var moment=require(_0x1ce4('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ce4('0x4'));var fs=require('fs');var path=require(_0x1ce4('0x5'));var rimraf=require('rimraf');var config=require(_0x1ce4('0x6'));var attributes=require(_0x1ce4('0x7'));module[_0x1ce4('0x8')]=function(_0x154b6d,_0x359891){return _0x154b6d[_0x1ce4('0x9')](_0x1ce4('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1ce4('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1709c34..13fa0f4 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 _0xd7d5=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x36b929,_0x424592){var _0x1ebcc1=function(_0x1eddea){while(--_0x1eddea){_0x36b929['push'](_0x36b929['shift']());}};_0x1ebcc1(++_0x424592);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x1c2c97,_0xd5d075){_0x1c2c97=_0x1c2c97-0x0;var _0x1ec212=_0xd7d5[_0x1c2c97];return _0x1ec212;};'use strict';var _=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var moment=require(_0x5d7d('0x2'));var BPromise=require(_0x5d7d('0x3'));var rs=require(_0x5d7d('0x4'));var fs=require('fs');var Redis=require(_0x5d7d('0x5'));var db=require(_0x5d7d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d7d('0x7'))('rpc');var config=require(_0x5d7d('0x8'));var jayson=require(_0x5d7d('0x9'));var client=jayson[_0x5d7d('0xa')][_0x5d7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d2611,_0x5eaf38,_0x1d443e){return new BPromise(function(_0x3aea7b,_0x3168f8){return client[_0x5d7d('0xc')](_0x2d2611,_0x1d443e)['then'](function(_0x414170){logger[_0x5d7d('0xd')](_0x5d7d('0xe'),_0x5eaf38,_0x5d7d('0xf'));logger[_0x5d7d('0x10')](_0x5d7d('0x11'),_0x5eaf38,_0x5d7d('0xf'),JSON[_0x5d7d('0x12')](_0x414170));if(_0x414170[_0x5d7d('0x13')]){if(_0x414170['error'][_0x5d7d('0x14')]===0x1f4){logger[_0x5d7d('0x13')](_0x5d7d('0xe'),_0x5eaf38,_0x414170['error'][_0x5d7d('0x15')]);return _0x3168f8(_0x414170['error']['message']);}logger['error'](_0x5d7d('0xe'),_0x5eaf38,_0x414170[_0x5d7d('0x13')]['message']);return _0x3aea7b(_0x414170['error'][_0x5d7d('0x15')]);}else{logger[_0x5d7d('0xd')](_0x5d7d('0xe'),_0x5eaf38,_0x5d7d('0xf'));_0x3aea7b(_0x414170[_0x5d7d('0x16')]['message']);}})['catch'](function(_0x4dc832){logger[_0x5d7d('0x13')](_0x5d7d('0xe'),_0x5eaf38,_0x4dc832);_0x3168f8(_0x4dc832);});});} \ No newline at end of file +var _0xa329=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x3fc284,_0x3930ca){var _0x1bb4b1=function(_0xe6e189){while(--_0xe6e189){_0x3fc284['push'](_0x3fc284['shift']());}};_0x1bb4b1(++_0x3930ca);}(_0xa329,0x162));var _0x9a32=function(_0x166beb,_0x45874e){_0x166beb=_0x166beb-0x0;var _0x2c9228=_0xa329[_0x166beb];return _0x2c9228;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x235b92,_0x4a8fba,_0x5b8b5e){return new BPromise(function(_0x4dc7f8,_0x344b35){return client[_0x9a32('0xa')](_0x235b92,_0x5b8b5e)['then'](function(_0x38f6cc){logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));logger[_0x9a32('0xe')](_0x9a32('0xf'),_0x4a8fba,'request\x20sent',JSON[_0x9a32('0x10')](_0x38f6cc));if(_0x38f6cc[_0x9a32('0x11')]){if(_0x38f6cc['error']['code']===0x1f4){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error']['message']);return _0x344b35(_0x38f6cc[_0x9a32('0x11')][_0x9a32('0x12')]);}logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x38f6cc['error'][_0x9a32('0x12')]);return _0x4dc7f8(_0x38f6cc[_0x9a32('0x11')]['message']);}else{logger[_0x9a32('0xb')](_0x9a32('0xc'),_0x4a8fba,_0x9a32('0xd'));_0x4dc7f8(_0x38f6cc[_0x9a32('0x13')][_0x9a32('0x12')]);}})[_0x9a32('0x14')](function(_0x4fa645){logger[_0x9a32('0x11')](_0x9a32('0xc'),_0x4a8fba,_0x4fa645);_0x344b35(_0x4fa645);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 4f1f711..a719ddc 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 _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x5c00,0x17e));var _0x05c0=function(_0x7ba032,_0x19c3ae){_0x7ba032=_0x7ba032-0x0;var _0x255dee=_0x5c00[_0x7ba032];return _0x255dee;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file +var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x45f219,_0x197f30){_0x45f219=_0x45f219-0x0;var _0x168be3=_0xd7d1[_0x45f219];return _0x168be3;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 477b145..f144fde 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 _0xb7b6=['STRING','ENUM','out','sequelize','moment','DATE'];(function(_0x3ae1a7,_0x2cb91e){var _0x1fde8a=function(_0x2b6231){while(--_0x2b6231){_0x3ae1a7['push'](_0x3ae1a7['shift']());}};_0x1fde8a(++_0x2cb91e);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x3035c8,_0x5a788a){_0x3035c8=_0x3035c8-0x0;var _0x329111=_0xb7b6[_0x3035c8];return _0x329111;};'use strict';var Sequelize=require(_0x6b7b('0x0'));var moment=require(_0x6b7b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6b7b('0x2')]},'disposition':{'type':Sequelize[_0x6b7b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6b7b('0x3')]},'note':{'type':Sequelize[_0x6b7b('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6b7b('0x4')]('in',_0x6b7b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6b7b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6b7b('0x4')]('in',_0x6b7b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2975=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x107f59,_0x46ab0d){var _0x5cf087=function(_0x3d0913){while(--_0x3d0913){_0x107f59['push'](_0x107f59['shift']());}};_0x5cf087(++_0x46ab0d);}(_0x2975,0x1c5));var _0x5297=function(_0x99b19c,_0x78169b){_0x99b19c=_0x99b19c-0x0;var _0x228324=_0x2975[_0x99b19c];return _0x228324;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5297('0x0'));module[_0x5297('0x1')]={'closed':{'type':Sequelize[_0x5297('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5297('0x3')]},'disposition':{'type':Sequelize[_0x5297('0x4')]},'secondDisposition':{'type':Sequelize[_0x5297('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5297('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5297('0x5')]('in',_0x5297('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5297('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5297('0x5')]('in',_0x5297('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5297('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index a53cbab..73b1271 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 _0xbf83=['ids','omit','getMessages','findOne','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','spread','emit','smsInteractionTags:save','download','unix','join','root','server','files','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','createdAt','direction','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','System','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','then','destroy','end','error','name','send','Users','TagIds','Tags','split','push','catch','waiting','unmanaged','total','closed','UserId','talking','answered','index','map','SmsInteraction','fieldName','type','model','keys','filters','query','attributes','fields','length','hasOwnProperty','sort','where','select','field','color','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','tools_tags','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','compact','isEmpty','SmsAccountId','concat','parse','$gte','$lte','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','count','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','toString','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','rawAttributes','intersection','include','options','describe','SmsMessage'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xbf83,0x11e));var _0x3bf8=function(_0x467eca,_0x27e916){_0x467eca=_0x467eca-0x0;var _0x3cd229=_0xbf83[_0x467eca];return _0x3cd229;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bf8('0x1'));var jsonpatch=require(_0x3bf8('0x2'));var rp=require(_0x3bf8('0x3'));var moment=require(_0x3bf8('0x4'));var BPromise=require(_0x3bf8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bf8('0x6'));var sox=require(_0x3bf8('0x7'));var csv=require(_0x3bf8('0x8'));var ejs=require(_0x3bf8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bf8('0xa'));var crypto=require(_0x3bf8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3bf8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3bf8('0xd'));var Papa=require(_0x3bf8('0xe'));var Redis=require(_0x3bf8('0xf'));var authService=require(_0x3bf8('0x10'));var qs=require(_0x3bf8('0x11'));var as=require(_0x3bf8('0x12'));var pdf=require(_0x3bf8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bf8('0x14'))(_0x3bf8('0x15'));var utils=require('../../config/utils');var config=require(_0x3bf8('0x16'));var licenseUtil=require(_0x3bf8('0x17'));var db=require(_0x3bf8('0x18'))['db'];config[_0x3bf8('0x19')]=_[_0x3bf8('0x1a')](config[_0x3bf8('0x19')],{'host':_0x3bf8('0x1b'),'port':0x18eb});var socket=require(_0x3bf8('0x1c'))(new Redis(config[_0x3bf8('0x19')]));require(_0x3bf8('0x1d'))['register'](socket);function respondWithStatusCode(_0x48c6e0,_0xa75b6a){_0xa75b6a=_0xa75b6a||0xcc;return function(_0x3d18f9){if(_0x3d18f9){return _0x48c6e0[_0x3bf8('0x1e')](_0xa75b6a);}return _0x48c6e0[_0x3bf8('0x1f')](_0xa75b6a)['end']();};}function respondWithResult(_0x44c69f,_0x23ebbb){_0x23ebbb=_0x23ebbb||0xc8;return function(_0x1a77fc){if(_0x1a77fc){return _0x44c69f[_0x3bf8('0x1f')](_0x23ebbb)[_0x3bf8('0x20')](_0x1a77fc);}};}function respondWithFilteredResult(_0x3be5a0,_0x857603){return function(_0x2c942e){if(_0x2c942e){var _0x2f80fa=typeof _0x857603[_0x3bf8('0x21')]===_0x3bf8('0x22')&&typeof _0x857603['limit']===_0x3bf8('0x22');var _0x25e9cd=_0x2c942e['count'];var _0x168780=_0x2f80fa?0x0:_0x857603['offset'];var _0xc7e00d=_0x2f80fa?_0x2c942e['count']:_0x857603[_0x3bf8('0x21')]+_0x857603[_0x3bf8('0x23')];var _0x58040c;if(_0xc7e00d>=_0x25e9cd){_0xc7e00d=_0x25e9cd;_0x58040c=0xc8;}else{_0x58040c=0xce;}_0x3be5a0[_0x3bf8('0x1f')](_0x58040c);return _0x3be5a0[_0x3bf8('0x24')](_0x3bf8('0x25'),_0x168780+'-'+_0xc7e00d+'/'+_0x25e9cd)[_0x3bf8('0x20')](_0x2c942e);}return null;};}function patchUpdates(_0x5169a1){return function(_0x40eecb){try{jsonpatch['apply'](_0x40eecb,_0x5169a1,!![]);}catch(_0xee1dc9){return BPromise['reject'](_0xee1dc9);}return _0x40eecb['save']();};}function saveUpdates(_0xbefdf2,_0x39d836){return function(_0x1ac8d8){if(_0x1ac8d8){return _0x1ac8d8[_0x3bf8('0x26')](_0xbefdf2)[_0x3bf8('0x27')](function(_0x2419cc){return _0x2419cc;});}return null;};}function removeEntity(_0x306b91,_0x825474){return function(_0x190d87){if(_0x190d87){return _0x190d87[_0x3bf8('0x28')]()[_0x3bf8('0x27')](function(){_0x306b91[_0x3bf8('0x1f')](0xcc)[_0x3bf8('0x29')]();});}};}function handleEntityNotFound(_0x1a549d,_0x25442d){return function(_0x51ccba){if(!_0x51ccba){_0x1a549d[_0x3bf8('0x1e')](0x194);}return _0x51ccba;};}function handleError(_0x29be4e,_0x5bfae5){_0x5bfae5=_0x5bfae5||0x1f4;return function(_0x2615a5){logger[_0x3bf8('0x2a')](_0x2615a5['stack']);if(_0x2615a5['name']){delete _0x2615a5[_0x3bf8('0x2b')];}_0x29be4e[_0x3bf8('0x1f')](_0x5bfae5)[_0x3bf8('0x2c')](_0x2615a5);};}function getInteractionUsers(_0x4ae4b7,_0x20c53b){return new BPromise(function(_0x4ba6da,_0xc3586){try{if(_0x20c53b[_0x4ae4b7['id']]){_0x4ae4b7[_0x3bf8('0x2d')]=_['map'](_0x20c53b[_0x4ae4b7['id']],function(_0x5b8a7e){return{'id':_0x5b8a7e['id'],'fullname':_0x5b8a7e['fullname']};});}}catch(_0x247489){_0xc3586(_0x247489);}_0x4ba6da(_0x4ae4b7);});}function getInteractionTags(_0x52fb4e,_0x26ad39){return new BPromise(function(_0x4cf651,_0x4c1b02){try{if(_0x52fb4e[_0x3bf8('0x2e')]){_0x52fb4e[_0x3bf8('0x2f')]=[];_0x52fb4e[_0x3bf8('0x2e')][_0x3bf8('0x30')](',')['forEach'](function(_0x1aac86){_0x52fb4e[_0x3bf8('0x2f')][_0x3bf8('0x31')](_0x26ad39[_0x1aac86]);});}delete _0x52fb4e['TagIds'];}catch(_0x5e4279){_0x4c1b02(_0x5e4279);}_0x4cf651(_0x52fb4e);});}function updateSmsInteraction(_0x538a51,_0x5a9955,_0x323ac7){return new BPromise(function(_0x40d442,_0x2af4cb){return getInteractionUsers(_0x538a51,_0x323ac7)['then'](function(_0x3e5ea1){return getInteractionTags(_0x3e5ea1,_0x5a9955);})[_0x3bf8('0x27')](function(_0x5729bc){return getStateInteraction(_0x5729bc);})['then'](function(_0x42cb0f){_0x40d442(_0x42cb0f);})[_0x3bf8('0x32')](function(_0x156dee){_0x2af4cb(_0x156dee);});});}function getStateInteraction(_0xfe1400){return new BPromise(function(_0x54988d){_0xfe1400[_0x3bf8('0x33')]=0x0;_0xfe1400['talking']=0x0;_0xfe1400['answered']=0x0;_0xfe1400[_0x3bf8('0x34')]=0x0;_0xfe1400[_0x3bf8('0x35')]=0x0;if(!_0xfe1400[_0x3bf8('0x36')]&&!_0xfe1400['UserId']){_0xfe1400[_0x3bf8('0x33')]+=0x1;}if(!_0xfe1400[_0x3bf8('0x36')]&&_0xfe1400[_0x3bf8('0x37')]){_0xfe1400[_0x3bf8('0x38')]+=0x1;if(_0xfe1400[_0x3bf8('0x33')]){_0xfe1400[_0x3bf8('0x33')]-=0x1;}}if(_0xfe1400[_0x3bf8('0x36')]&&_0xfe1400[_0x3bf8('0x37')]){_0xfe1400[_0x3bf8('0x39')]+=0x1;if(_0xfe1400[_0x3bf8('0x38')]){_0xfe1400[_0x3bf8('0x38')]-=0x1;}}if(_0xfe1400['closed']&&!_0xfe1400['UserId']){_0xfe1400[_0x3bf8('0x34')]+=0x1;if(_0xfe1400[_0x3bf8('0x33')]){_0xfe1400['waiting']-=0x1;}}_0xfe1400['total']+=0x1;_0x54988d(_0xfe1400);});}exports[_0x3bf8('0x3a')]=function(_0x359283,_0x41db1f){var _0x2801ac={},_0x25a3b2={},_0x7c6911={'count':0x0,'rows':[]};var _0x1d17e9=_[_0x3bf8('0x3b')](db[_0x3bf8('0x3c')]['rawAttributes'],function(_0x416ee3){return{'name':_0x416ee3[_0x3bf8('0x3d')],'type':_0x416ee3[_0x3bf8('0x3e')]['key']};});_0x25a3b2[_0x3bf8('0x3f')]=_[_0x3bf8('0x3b')](_0x1d17e9,_0x3bf8('0x2b'));_0x25a3b2['query']=_[_0x3bf8('0x40')](_0x359283['query']);_0x25a3b2[_0x3bf8('0x41')]=_['intersection'](_0x25a3b2[_0x3bf8('0x3f')],_0x25a3b2[_0x3bf8('0x42')]);_0x2801ac[_0x3bf8('0x43')]=_['intersection'](_0x25a3b2[_0x3bf8('0x3f')],qs[_0x3bf8('0x44')](_0x359283[_0x3bf8('0x42')][_0x3bf8('0x44')]));_0x2801ac[_0x3bf8('0x43')]=_0x2801ac[_0x3bf8('0x43')][_0x3bf8('0x45')]?_0x2801ac[_0x3bf8('0x43')]:_0x25a3b2[_0x3bf8('0x3f')];if(!_0x359283[_0x3bf8('0x42')][_0x3bf8('0x46')]('nolimit')){_0x2801ac[_0x3bf8('0x23')]=qs[_0x3bf8('0x23')](_0x359283[_0x3bf8('0x42')]['limit']);_0x2801ac[_0x3bf8('0x21')]=qs[_0x3bf8('0x21')](_0x359283[_0x3bf8('0x42')][_0x3bf8('0x21')]);}_0x2801ac['order']=qs[_0x3bf8('0x47')](_0x359283[_0x3bf8('0x42')][_0x3bf8('0x47')]);_0x2801ac[_0x3bf8('0x48')]=qs['filters'](_['pick'](_0x359283[_0x3bf8('0x42')],_0x25a3b2[_0x3bf8('0x41')]),_0x1d17e9);var _0x1ff860=[];var _0x2a3b43=squel[_0x3bf8('0x49')]()[_0x3bf8('0x4a')]('id')['field'](_0x3bf8('0x2b'))['field'](_0x3bf8('0x4b'))[_0x3bf8('0x4c')]('tools_tags');var _0x373dfb=squel[_0x3bf8('0x49')]()[_0x3bf8('0x4a')](_0x3bf8('0x4d'))[_0x3bf8('0x4a')]('u.fullname')[_0x3bf8('0x4a')](_0x3bf8('0x4e'))[_0x3bf8('0x4c')](_0x3bf8('0x4f'),'ui')['left_join']('users','u',_0x3bf8('0x50'));var _0x31c7ec=squel[_0x3bf8('0x49')]()[_0x3bf8('0x4c')](_0x3bf8('0x51'),'i')[_0x3bf8('0x52')](_0x3bf8('0x53'),'c',_0x3bf8('0x54'))[_0x3bf8('0x52')](_0x3bf8('0x55'),'o',_0x3bf8('0x56'))[_0x3bf8('0x52')](_0x3bf8('0x57'),'a',_0x3bf8('0x58'))[_0x3bf8('0x52')](_0x3bf8('0x59'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x3bf8('0x52')](_0x3bf8('0x5a'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x3bf8('0x52')](_0x3bf8('0x5b'),'t','t.id\x20=\x20it.TagId');var _0x435fa9=squel[_0x3bf8('0x5c')]();var _0x360d76=[];var _0x4ba6ed=squel['expr']();var _0x5dff97;if(_0x359283[_0x3bf8('0x42')][_0x3bf8('0x5d')]){_0x5dff97=as[_0x3bf8('0x5e')](_0x359283['query'][_0x3bf8('0x5d')]);var _0x3b4529=_0x5dff97['sqlOperator'];for(var _0x3e830f=0x0;_0x3e830f<_0x5dff97[_0x3bf8('0x5f')]['length'];_0x3e830f++){var _0x40fa59=_0x5dff97['conditions'][_0x3e830f];var _0x9783ad='i';var _0x1dccaa=_[_0x3bf8('0x60')](_0x1d17e9,[_0x3bf8('0x2b'),_0x40fa59[_0x3bf8('0x4a')]]);if(!_0x1dccaa){switch(_0x40fa59['field']){case _0x3bf8('0x61'):if(_0x40fa59[_0x3bf8('0x62')]==0x1){_0x31c7ec[_0x3bf8('0x63')]('`'+_0x40fa59[_0x3bf8('0x4a')]+_0x3bf8('0x64'));}else{_0x31c7ec[_0x3bf8('0x63')]('`'+_0x40fa59[_0x3bf8('0x4a')]+_0x3bf8('0x65'));}break;case _0x3bf8('0x66'):if(_0x40fa59['operator']===_0x3bf8('0x67')){if(_0x40fa59['value']['split']('\x20')['length']>0x1){_0x435fa9[_0x3b4529](_0x3bf8('0x68'),qs[_0x3bf8('0x69')](_0x40fa59[_0x3bf8('0x62')]),null);}else{var _0x8a0a6c='%'+_0x40fa59[_0x3bf8('0x62')]+'%';_0x435fa9[_0x3b4529](_0x3bf8('0x6a'),_0x8a0a6c,_0x8a0a6c,_0x8a0a6c);}}else{_0x1dccaa=_[_0x3bf8('0x60')](_0x1d17e9,['name','ContactId']);_0x40fa59[_0x3bf8('0x4a')]=_0x3bf8('0x6b');_0x532381=as[_0x3bf8('0x6c')](_0x9783ad,_0x1dccaa[_0x3bf8('0x3e')],_0x40fa59);_0x435fa9[_0x3b4529](_0x532381[_0x3bf8('0x6d')],_0x532381[_0x3bf8('0x62')]['start'],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x29')]);}break;case _0x3bf8('0x6e'):var _0x4aae66=_0x40fa59['value'][_0x3bf8('0x30')](',')[_0x3bf8('0x3b')](function(_0xa44cd4){return Number(_0xa44cd4);});_0x4aae66[_0x3bf8('0x6f')](function(_0x360d0d){_0x4ba6ed['or'](_0x3bf8('0x70'),'%,'+_0x360d0d+',%');});_0x360d76=_[_0x3bf8('0x71')](_0x360d76,_0x4aae66);break;case _0x3bf8('0x72'):if(_0x40fa59['operator']==='$substring'){_0x435fa9[_0x3b4529](_0x3bf8('0x73'),'%'+_0x40fa59['value']+'%',null);}else{_0x1dccaa=_['find'](_0x1d17e9,[_0x3bf8('0x2b'),_0x3bf8('0x37')]);_0x40fa59[_0x3bf8('0x4a')]=_0x3bf8('0x37');_0x532381=as[_0x3bf8('0x6c')](_0x9783ad,_0x1dccaa['type'],_0x40fa59);_0x435fa9[_0x3b4529](_0x532381[_0x3bf8('0x6d')],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x74')],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x29')]);}break;case _0x3bf8('0x75'):_0x532381=as[_0x3bf8('0x6c')]('me',null,_0x40fa59);_0x435fa9[_0x3b4529](_0x532381[_0x3bf8('0x6d')],_0x532381['value']['start'],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x29')]);break;}}else{var _0x532381=as['buildExpression'](_0x9783ad,_0x1dccaa['type'],_0x40fa59);_0x435fa9[_0x3b4529](_0x532381[_0x3bf8('0x6d')],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x74')],_0x532381[_0x3bf8('0x62')][_0x3bf8('0x29')]);}}}else{var _0x3096fe=_(_0x359283[_0x3bf8('0x42')])[_0x3bf8('0x40')]()[_0x3bf8('0x3b')](function(_0x326c4b){return _['some'](_0x1d17e9,[_0x3bf8('0x2b'),_0x326c4b])?_0x326c4b:undefined;})[_0x3bf8('0x76')]()['value']();if(!_[_0x3bf8('0x77')](_0x3096fe)){_0x3096fe[_0x3bf8('0x6f')](function(_0x4fabfc){if(_0x4fabfc===_0x3bf8('0x78')){_0x31c7ec[_0x3bf8('0x48')]('i.SmsAccountId\x20IN\x20?',[][_0x3bf8('0x79')](_0x359283[_0x3bf8('0x42')][_0x4fabfc]));}else if(_0x4fabfc==='createdAt'){var _0x43827d=JSON[_0x3bf8('0x7a')](_0x359283[_0x3bf8('0x42')][_0x4fabfc])[_0x3bf8('0x7b')];var _0x197590=JSON[_0x3bf8('0x7a')](_0x359283[_0x3bf8('0x42')][_0x4fabfc])[_0x3bf8('0x7c')];_0x31c7ec[_0x3bf8('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x43827d,_0x197590);}else{if(_0x359283[_0x3bf8('0x42')][_0x4fabfc]===_0x3bf8('0x7d')){_0x31c7ec['where']('i.'+_0x4fabfc+_0x3bf8('0x7e'));}else{_0x31c7ec['where']('i.'+_0x4fabfc+'\x20=\x20?',_0x359283[_0x3bf8('0x42')][_0x4fabfc]);}}});}if(_0x359283[_0x3bf8('0x42')]['read']){if(_0x359283['query']['read']==0x1){_0x31c7ec[_0x3bf8('0x63')](_0x3bf8('0x7f'));}else{_0x31c7ec['having'](_0x3bf8('0x80'));}}if(_0x359283[_0x3bf8('0x42')][_0x3bf8('0x81')]){_0x360d76=_[_0x3bf8('0x82')](_0x359283[_0x3bf8('0x42')]['tag'])?_0x359283[_0x3bf8('0x42')]['tag']:new Array(_0x359283[_0x3bf8('0x42')][_0x3bf8('0x81')]);_0x360d76[_0x3bf8('0x6f')](function(_0x3c2981){_0x4ba6ed['or'](_0x3bf8('0x70'),'%,'+_0x3c2981+',%');});}if(_0x359283['query'][_0x3bf8('0x83')]){var _0x452112=_0x359283[_0x3bf8('0x42')]['filter'][_0x3bf8('0x84')]('\x5c','\x5c\x5c')[_0x3bf8('0x84')](/'/g,'\x27\x27');if(qs[_0x3bf8('0x85')](_0x452112)){_0x435fa9['or'](_0x3bf8('0x86'),_0x452112+'%')['or']('i.phone\x20LIKE\x20?',_0x452112+'%');}else{_0x435fa9['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3bf8('0x69')](_0x452112))['or'](_0x3bf8('0x87'),_0x452112+'%');}}}_0x31c7ec['where'](_0x435fa9);_0x31c7ec[_0x3bf8('0x88')]('i.id');var _0x415e29={'type':db['Sequelize'][_0x3bf8('0x89')][_0x3bf8('0x8a')],'raw':!![]};var _0x335df7=_0x31c7ec[_0x3bf8('0x8b')]();_0x335df7['field'](_0x3bf8('0x8c'));_0x335df7[_0x3bf8('0x4a')](_0x3bf8('0x8d'),_0x3bf8('0x61'));if(_0x2801ac[_0x3bf8('0x8e')]){_0x2801ac['order'][_0x3bf8('0x6f')](function(_0x38c1eb){var _0x4aff6f=_0x38c1eb[0x0]===_0x3bf8('0x8f')?_0x38c1eb[0x0]:'i.'+_0x38c1eb[0x0];_0x31c7ec[_0x3bf8('0x8e')](_0x4aff6f,_0x38c1eb[0x1]===_0x3bf8('0x90')?![]:!![]);});}if(!_[_0x3bf8('0x77')](_0x360d76)){_0x31c7ec[_0x3bf8('0x63')](_0x4ba6ed);_0x335df7[_0x3bf8('0x48')](_0x3bf8('0x91'),_0x360d76);}BPromise[_0x3bf8('0x92')]()[_0x3bf8('0x27')](function(){if(!_0x5dff97){if(_0x359283['query']['SmsAccountId'])return;_0x335df7[_0x3bf8('0x48')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x31c7ec[_0x3bf8('0x48')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x359283[_0x3bf8('0x93')][_0x3bf8('0x94')]!==_0x3bf8('0x95'))return;return _0x359283['user'][_0x3bf8('0x96')]({'attributes':['id'],'raw':!![]})[_0x3bf8('0x27')](function(_0x37851d){if(_[_0x3bf8('0x77')](_0x37851d)){_0x335df7[_0x3bf8('0x48')](_0x3bf8('0x97'));_0x31c7ec[_0x3bf8('0x48')](_0x3bf8('0x97'));}else{_0x335df7[_0x3bf8('0x48')](_0x3bf8('0x98'),_[_0x3bf8('0x3b')](_0x37851d,'id'));_0x31c7ec[_0x3bf8('0x48')](_0x3bf8('0x98'),_[_0x3bf8('0x3b')](_0x37851d,'id'));}});})[_0x3bf8('0x27')](function(){if(_0x359283['user']['role']===_0x3bf8('0x95')&&!_0x5dff97&&!_0x359283[_0x3bf8('0x42')][_0x3bf8('0x78')])return[];return db[_0x3bf8('0x99')][_0x3bf8('0x42')](_0x335df7['toString'](),_0x415e29);})['then'](function(_0x36d861){_0x7c6911[_0x3bf8('0x9a')]=_0x36d861['length'];if(_0x7c6911['count']===0x0)return[];return db[_0x3bf8('0x99')]['query'](_0x2a3b43['toString'](),_0x415e29)[_0x3bf8('0x27')](function(_0x81c98b){_0x1ff860=_[_0x3bf8('0x9b')](_0x81c98b,'id');_0x415e29=_[_0x3bf8('0x9c')](_0x415e29,{'model':db[_0x3bf8('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x359283['query'][_0x3bf8('0x44')]){_0x2801ac['attributes'][_0x3bf8('0x6f')](function(_0x1163bd){_0x31c7ec[_0x3bf8('0x4a')]('i.'+_0x1163bd);});}else{_0x31c7ec['field'](_0x3bf8('0x8d'),'unreadMessages');_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0x9d'),'Account.key');_0x31c7ec['field'](_0x3bf8('0x9e'),_0x3bf8('0x9f'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xa0'),_0x3bf8('0x8f'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xa1'));_0x31c7ec['field'](_0x3bf8('0xa2'),_0x3bf8('0xa3'));_0x31c7ec[_0x3bf8('0x4a')]('c.lastName',_0x3bf8('0xa4'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xa5'),_0x3bf8('0xa6'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xa7'),_0x3bf8('0xa8'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xa9'),_0x3bf8('0xaa'));_0x31c7ec[_0x3bf8('0x4a')]('c.fax',_0x3bf8('0xab'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xac'),_0x3bf8('0xad'));_0x31c7ec[_0x3bf8('0x4a')](_0x3bf8('0xae'),'Owner.internal');_0x31c7ec[_0x3bf8('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3bf8('0x2e'));}if(_0x2801ac[_0x3bf8('0x23')])_0x31c7ec[_0x3bf8('0x23')](_0x2801ac[_0x3bf8('0x23')]);if(_0x2801ac['offset'])_0x31c7ec[_0x3bf8('0x21')](_0x2801ac[_0x3bf8('0x21')]);return db[_0x3bf8('0x99')][_0x3bf8('0x42')](_0x31c7ec[_0x3bf8('0xaf')](),_0x415e29);})[_0x3bf8('0x27')](function(_0x568530){if(_0x568530['length']>0x0)_0x373dfb[_0x3bf8('0x48')](_0x3bf8('0xb0'),_[_0x3bf8('0x3b')](_0x568530,'id'));return db['sequelize']['query'](_0x373dfb[_0x3bf8('0xaf')](),_0x415e29)['then'](function(_0x26a031){var _0x46e865=_['groupBy'](_0x26a031,_0x3bf8('0xb1'));var _0x221cb8=[];_0x568530[_0x3bf8('0x6f')](function(_0x3eb0b0){_0x221cb8[_0x3bf8('0x31')](updateSmsInteraction(_0x3eb0b0,_0x1ff860,_0x46e865));});return BPromise[_0x3bf8('0xb2')](_0x221cb8);});});})['then'](function(_0x415a23){_0x7c6911[_0x3bf8('0xb3')]=_0x415a23;return _0x7c6911;})[_0x3bf8('0x27')](respondWithFilteredResult(_0x41db1f,_0x2801ac))['catch'](handleError(_0x41db1f,null));};exports[_0x3bf8('0xb4')]=function(_0x4b0b15,_0xf3759f){var _0x29b43f={'raw':![],'where':{'id':_0x4b0b15[_0x3bf8('0xb5')]['id']}},_0x4c0315={};_0x4c0315[_0x3bf8('0x3f')]=_[_0x3bf8('0x40')](db[_0x3bf8('0x3c')][_0x3bf8('0xb6')]);_0x4c0315[_0x3bf8('0x42')]=_[_0x3bf8('0x40')](_0x4b0b15[_0x3bf8('0x42')]);_0x4c0315['filters']=_[_0x3bf8('0xb7')](_0x4c0315[_0x3bf8('0x3f')],_0x4c0315[_0x3bf8('0x42')]);_0x29b43f['attributes']=_['intersection'](_0x4c0315[_0x3bf8('0x3f')],qs[_0x3bf8('0x44')](_0x4b0b15[_0x3bf8('0x42')][_0x3bf8('0x44')]));_0x29b43f[_0x3bf8('0x43')]=_0x29b43f['attributes'][_0x3bf8('0x45')]?_0x29b43f[_0x3bf8('0x43')]:_0x4c0315[_0x3bf8('0x3f')];if(_0x4b0b15[_0x3bf8('0x42')]['includeAll']){_0x29b43f[_0x3bf8('0xb8')]=[{'all':!![]}];}_0x29b43f=_['merge']({},_0x29b43f,_0x4b0b15[_0x3bf8('0xb9')]);return db[_0x3bf8('0x3c')][_0x3bf8('0x60')](_0x29b43f)[_0x3bf8('0x27')](handleEntityNotFound(_0xf3759f,null))[_0x3bf8('0x27')](respondWithResult(_0xf3759f,null))['catch'](handleError(_0xf3759f,null));};exports['create']=function(_0x4088a9,_0x538123){return db['SmsInteraction']['create'](_0x4088a9[_0x3bf8('0x75')],{})[_0x3bf8('0x27')](respondWithResult(_0x538123,0xc9))['catch'](handleError(_0x538123,null));};exports[_0x3bf8('0x26')]=function(_0x33a9ee,_0x4419d6){if(_0x33a9ee[_0x3bf8('0x75')]['id']){delete _0x33a9ee[_0x3bf8('0x75')]['id'];}return db[_0x3bf8('0x3c')][_0x3bf8('0x60')]({'where':{'id':_0x33a9ee['params']['id']}})[_0x3bf8('0x27')](handleEntityNotFound(_0x4419d6,null))[_0x3bf8('0x27')](saveUpdates(_0x33a9ee[_0x3bf8('0x75')],null))[_0x3bf8('0x27')](respondWithResult(_0x4419d6,null))['catch'](handleError(_0x4419d6,null));};exports[_0x3bf8('0x28')]=function(_0x3e10be,_0xd27e84){return db[_0x3bf8('0x3c')][_0x3bf8('0x60')]({'where':{'id':_0x3e10be[_0x3bf8('0xb5')]['id']}})['then'](handleEntityNotFound(_0xd27e84,null))['then'](removeEntity(_0xd27e84,null))[_0x3bf8('0x32')](handleError(_0xd27e84,null));};exports[_0x3bf8('0xba')]=function(_0x48a228,_0x125ea1){return db['SmsInteraction'][_0x3bf8('0xba')]()['then'](respondWithResult(_0x125ea1,null))[_0x3bf8('0x32')](handleError(_0x125ea1,null));};exports['addMessage']=function(_0x51fd6b,_0xc08c53,_0x120e62){return db[_0x3bf8('0xbb')]['find']({'where':{'id':_0x51fd6b['params']['id']}})[_0x3bf8('0x27')](handleEntityNotFound(_0xc08c53,null))['then'](function(_0x5a24f2){if(_0x5a24f2){return _0x5a24f2['addMessage'](_0x51fd6b[_0x3bf8('0x75')][_0x3bf8('0xbc')],_[_0x3bf8('0xbd')](_0x51fd6b[_0x3bf8('0x75')],[_0x3bf8('0xbc'),'id'])||{});}})[_0x3bf8('0x27')](respondWithResult(_0xc08c53,null))[_0x3bf8('0x32')](handleError(_0xc08c53,null));};exports[_0x3bf8('0xbe')]=function(_0x376850,_0x33cde4,_0x4a3bbc){var _0x375e05={'raw':![],'where':{}};var _0x1803e4={};var _0xec2425={'count':0x0,'rows':[]};return db[_0x3bf8('0x3c')][_0x3bf8('0xbf')]({'where':{'id':_0x376850[_0x3bf8('0xb5')]['id']}})[_0x3bf8('0x27')](handleEntityNotFound(_0x33cde4,null))[_0x3bf8('0x27')](function(_0x5e7f76){if(_0x5e7f76){_0x1803e4[_0x3bf8('0x3f')]=_[_0x3bf8('0x40')](db[_0x3bf8('0xbb')][_0x3bf8('0xb6')]);_0x1803e4['query']=_['keys'](_0x376850['query']);_0x1803e4[_0x3bf8('0x41')]=_[_0x3bf8('0xb7')](_0x1803e4[_0x3bf8('0x3f')],_0x1803e4[_0x3bf8('0x42')]);_0x375e05['attributes']=_[_0x3bf8('0xb7')](_0x1803e4['model'],qs[_0x3bf8('0x44')](_0x376850[_0x3bf8('0x42')][_0x3bf8('0x44')]));_0x375e05[_0x3bf8('0x43')]=_0x375e05[_0x3bf8('0x43')][_0x3bf8('0x45')]?_0x375e05['attributes']:_0x1803e4[_0x3bf8('0x3f')];if(!_0x376850['query'][_0x3bf8('0x46')](_0x3bf8('0xc0'))){_0x375e05[_0x3bf8('0x23')]=qs[_0x3bf8('0x23')](_0x376850[_0x3bf8('0x42')]['limit']);_0x375e05[_0x3bf8('0x21')]=qs[_0x3bf8('0x21')](_0x376850[_0x3bf8('0x42')][_0x3bf8('0x21')]);}_0x375e05['order']=qs['sort'](_0x376850[_0x3bf8('0x42')][_0x3bf8('0x47')]);_0x375e05[_0x3bf8('0x48')]=qs['filters'](_[_0x3bf8('0xc1')](_0x376850[_0x3bf8('0x42')],_0x1803e4[_0x3bf8('0x41')]));_0x375e05['where']['SmsInteractionId']=_0x5e7f76['id'];if(_0x376850['query'][_0x3bf8('0x83')]){_0x375e05[_0x3bf8('0x48')]=_[_0x3bf8('0x9c')](_0x375e05[_0x3bf8('0x48')],{'$or':_[_0x3bf8('0x3b')](_0x375e05['attributes'],function(_0x95cf89){var _0x4c0909={};_0x4c0909[_0x95cf89]={'$like':'%'+_0x376850[_0x3bf8('0x42')][_0x3bf8('0x83')]+'%'};return _0x4c0909;})});}if(_0x376850['query'][_0x3bf8('0x7b')]){var _0x5c4b59=_0x376850['query'][_0x3bf8('0x7b')][_0x3bf8('0x30')](',');var _0x1675ef={};_0x1675ef[_0x5c4b59[0x0]]={'$gte':moment(_0x5c4b59[0x1])[_0x3bf8('0xc2')](_0x3bf8('0xc3'))};_0x375e05[_0x3bf8('0x48')]=_[_0x3bf8('0x9c')](_0x375e05[_0x3bf8('0x48')],_0x1675ef);}_0x375e05=_[_0x3bf8('0x9c')]({},_0x375e05,_0x376850[_0x3bf8('0xb9')]);return db[_0x3bf8('0xbb')][_0x3bf8('0x9a')]({'where':_0x375e05['where']})['then'](function(_0x427ef8){_0xec2425['count']=_0x427ef8;if(_0x376850['query'][_0x3bf8('0xc4')]){_0x375e05[_0x3bf8('0xb8')]=[{'all':!![]}];}return db['SmsMessage'][_0x3bf8('0xc5')](_0x375e05);})[_0x3bf8('0x27')](function(_0x480ed6){_0xec2425[_0x3bf8('0xb3')]=_0x480ed6;return _0xec2425;});}})[_0x3bf8('0x27')](respondWithFilteredResult(_0x33cde4,_0x375e05))[_0x3bf8('0x32')](handleError(_0x33cde4,null));};exports['addTags']=function(_0x27ddcd,_0xc6095d,_0x51bdd0){return db['SmsInteraction'][_0x3bf8('0x60')]({'where':{'id':_0x27ddcd[_0x3bf8('0xb5')]['id']}})['then'](handleEntityNotFound(_0xc6095d,null))[_0x3bf8('0x27')](function(_0x3aecfe){if(_0x3aecfe){return _0x3aecfe['setTags'](_0x27ddcd[_0x3bf8('0x75')][_0x3bf8('0xbc')],_[_0x3bf8('0xbd')](_0x27ddcd['body'],['ids','id'])||{})[_0x3bf8('0xc6')](function(){return db[_0x3bf8('0x6e')][_0x3bf8('0xc5')]({'attributes':['id','name',_0x3bf8('0x4b')],'where':{'id':_0x27ddcd[_0x3bf8('0x75')]['ids']}});})['then'](function(_0x3c1de6){socket[_0x3bf8('0xc7')](_0x3bf8('0xc8'),{'id':Number(_0x27ddcd[_0x3bf8('0xb5')]['id']),'tags':_0x3c1de6||[]});return{'id':Number(_0x27ddcd[_0x3bf8('0xb5')]['id']),'tags':_0x3c1de6||[]};});}})[_0x3bf8('0x27')](respondWithResult(_0xc6095d,null))[_0x3bf8('0x32')](handleError(_0xc6095d,null));};exports['removeTags']=function(_0xc2480b,_0x430fab,_0xa32fd5){return db['SmsInteraction'][_0x3bf8('0x60')]({'where':{'id':_0xc2480b['params']['id']}})[_0x3bf8('0x27')](handleEntityNotFound(_0x430fab,null))['then'](function(_0x575029){if(_0x575029){return _0x575029['removeTags'](_0xc2480b[_0x3bf8('0x42')][_0x3bf8('0xbc')]);}})[_0x3bf8('0x27')](respondWithStatusCode(_0x430fab,null))[_0x3bf8('0x32')](handleError(_0x430fab,null));};exports[_0x3bf8('0xc9')]=function(_0x439b5b,_0x36ca7c){var _0x35471e=moment()[_0x3bf8('0xca')]()[_0x3bf8('0xaf')]();var _0x259574=path[_0x3bf8('0xcb')](config[_0x3bf8('0xcc')],_0x3bf8('0xcd'),_0x3bf8('0xce'),'tmp');var _0x307d68=path['join'](config[_0x3bf8('0xcc')],_0x3bf8('0xcd'),'files','attachments');var _0x5d43b8=path['join'](_0x259574,_0x35471e);var _0x21bba8=util['format'](_0x3bf8('0xcf'),_0x439b5b[_0x3bf8('0xb5')]['id'],_0x35471e);var _0x1f3ca4=path[_0x3bf8('0xcb')](_0x259574,_0x21bba8);var _0x46d4fc=[];_0x46d4fc[_0x3bf8('0x31')]({'model':db[_0x3bf8('0x72')],'as':_0x3bf8('0x72'),'attributes':['id','fullname'],'raw':!![]});_0x46d4fc[_0x3bf8('0x31')]({'model':db[_0x3bf8('0xd0')],'as':_0x3bf8('0x66'),'attributes':['id',_0x3bf8('0xd1'),_0x3bf8('0xd2')],'raw':!![]});var _0x120fe1=[{'model':db[_0x3bf8('0xbb')],'as':_0x3bf8('0xd3'),'attributes':['id','body',_0x3bf8('0xd4'),_0x3bf8('0xd5'),'secret',_0x3bf8('0xd6')],'include':_0x46d4fc}];_0x120fe1[_0x3bf8('0x31')]({'model':db[_0x3bf8('0xd7')],'as':_0x3bf8('0xd8'),'attributes':['id',_0x3bf8('0x2b')]});_0x120fe1[_0x3bf8('0x31')]({'model':db[_0x3bf8('0x72')],'as':'Owner','attributes':['id',_0x3bf8('0xd9')]});return db[_0x3bf8('0x3c')][_0x3bf8('0x60')]({'where':{'id':_0x439b5b['params']['id']},'include':_0x120fe1})[_0x3bf8('0x27')](handleEntityNotFound(_0x36ca7c,null))[_0x3bf8('0x27')](function(_0x346212){if(_0x346212){var _0xd7338b=_0x346212[_0x3bf8('0xda')]({'plain':!![]});fs[_0x3bf8('0xdb')](_0x5d43b8);var _0x256403={'channel':_0x3bf8('0xdc'),'account':_0xd7338b[_0x3bf8('0xd8')]['name'],'agent':_0xd7338b[_0x3bf8('0xdd')]?_0xd7338b[_0x3bf8('0xdd')][_0x3bf8('0xd9')]:_0x3bf8('0xde'),'createdAt':moment(_0xd7338b[_0x3bf8('0xd4')])[_0x3bf8('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3bf8('0xaf')](),'closedAt':_0xd7338b[_0x3bf8('0x36')]?moment(_0xd7338b[_0x3bf8('0xdf')])[_0x3bf8('0xc2')](_0x3bf8('0xc3'))['toString']():'','disposition':_0xd7338b[_0x3bf8('0xe0')],'messages':_(_0xd7338b[_0x3bf8('0xd3')])['filter']({'secret':![]})['map'](function(_0x4d8559){return{'date':moment(_0x4d8559['createdAt'])[_0x3bf8('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3bf8('0xaf')](),'sender':_0x4d8559[_0x3bf8('0xd5')]==='out'?_0x4d8559[_0x3bf8('0x72')]?_0x4d8559['User'][_0x3bf8('0xd9')]:_0x3bf8('0xe1'):_0x4d8559[_0x3bf8('0x66')]['firstName']+(_0x4d8559['Contact'][_0x3bf8('0xd2')]?'\x20'+_0x4d8559[_0x3bf8('0x66')]['lastName']:''),'body':_0x4d8559['body'],'direction':_0x4d8559[_0x3bf8('0xd5')]===_0x3bf8('0xe2')?'A':'C','secret':_0x4d8559[_0x3bf8('0xe3')],'read':_0x4d8559[_0x3bf8('0xd6')]};})[_0x3bf8('0x62')]()};return ejs[_0x3bf8('0xe4')](path[_0x3bf8('0xcb')](config['root'],'server',_0x3bf8('0xe5'),_0x3bf8('0xe6')),{'interaction':_0x256403})[_0x3bf8('0x27')](function(_0x55ede0){var _0x51f82a=path[_0x3bf8('0xcb')](_0x5d43b8,_0x3bf8('0xe7')+_0xd7338b['id']+'-'+_0x35471e+_0x3bf8('0xe8'));var _0x4f09d2={'path':_0x51f82a,'channel':_0x3bf8('0xdc'),'interactionId':_0xd7338b['id']};return pdf[_0x3bf8('0xe9')](_0x55ede0,_0x4f09d2);})[_0x3bf8('0x27')](function(){return new BPromise(function(_0x221137,_0x5d8475){zipdir(_0x5d43b8,{'saveTo':_0x1f3ca4},function(_0x29256b,_0x3bc7cc){if(_0x29256b)return _0x5d8475(_0x29256b);return _0x221137(_0x3bc7cc);});})[_0x3bf8('0x27')](function(){return new BPromise(function(_0x2748e9,_0x3f1c09){rimraf(_0x5d43b8,function(_0x323f97){if(_0x323f97)_0x3f1c09(_0x323f97);return _0x2748e9();});});})[_0x3bf8('0x27')](function(){return _0x36ca7c[_0x3bf8('0xc9')](_0x1f3ca4,_0x21bba8,function(_0x3153e5){if(_0x3153e5){console[_0x3bf8('0xea')](_0x3bf8('0xeb'),_0x3153e5);}else{fs[_0x3bf8('0xec')](_0x1f3ca4);}});});});}else{return _0x36ca7c[_0x3bf8('0x1e')](0xc8);}})[_0x3bf8('0x32')](handleError(_0x36ca7c,null));}; \ No newline at end of file +var _0xa80d=['o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','ui.SmsInteractionId\x20IN\x20?','groupBy','rows','params','includeAll','include','options','create','body','destroy','addMessage','ids','omit','findOne','SmsMessage','pick','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','smsInteractionTags:save','download','server','tmp','join','root','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','SmsAccount','Account','Owner','fullname','get','mkdirSync','Sms','N.A.','closedAt','out','secret','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','error','name','Users','Tags','split','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','SmsInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax'];(function(_0x1a1076,_0x49e570){var _0x20b00a=function(_0x198f6c){while(--_0x198f6c){_0x1a1076['push'](_0x1a1076['shift']());}};_0x20b00a(++_0x49e570);}(_0xa80d,0x125));var _0xda80=function(_0x471a43,_0x111c3b){_0x471a43=_0x471a43-0x0;var _0x577e12=_0xa80d[_0x471a43];return _0x577e12;};'use strict';var emlformat=require(_0xda80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda80('0x1'));var jsonpatch=require(_0xda80('0x2'));var rp=require(_0xda80('0x3'));var moment=require(_0xda80('0x4'));var BPromise=require(_0xda80('0x5'));var Mustache=require('mustache');var util=require(_0xda80('0x6'));var path=require(_0xda80('0x7'));var sox=require(_0xda80('0x8'));var csv=require(_0xda80('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda80('0xa'));var squel=require('squel');var crypto=require(_0xda80('0xb'));var jsforce=require(_0xda80('0xc'));var deskjs=require(_0xda80('0xd'));var toCsv=require(_0xda80('0x9'));var querystring=require('querystring');var Papa=require(_0xda80('0xe'));var Redis=require(_0xda80('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda80('0x10'));var pdf=require(_0xda80('0x11'));var hardwareService=require(_0xda80('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda80('0x13'))['db'];config[_0xda80('0x14')]=_['defaults'](config[_0xda80('0x14')],{'host':_0xda80('0x15'),'port':0x18eb});var socket=require(_0xda80('0x16'))(new Redis(config[_0xda80('0x14')]));require(_0xda80('0x17'))[_0xda80('0x18')](socket);function respondWithStatusCode(_0x15e901,_0x119bf9){_0x119bf9=_0x119bf9||0xcc;return function(_0x5c52d0){if(_0x5c52d0){return _0x15e901[_0xda80('0x19')](_0x119bf9);}return _0x15e901[_0xda80('0x1a')](_0x119bf9)[_0xda80('0x1b')]();};}function respondWithResult(_0x30aed4,_0x47be9c){_0x47be9c=_0x47be9c||0xc8;return function(_0x465144){if(_0x465144){return _0x30aed4[_0xda80('0x1a')](_0x47be9c)[_0xda80('0x1c')](_0x465144);}};}function respondWithFilteredResult(_0x31cac1,_0x5ae09f){return function(_0x33bf06){if(_0x33bf06){var _0x37c219=typeof _0x5ae09f['offset']==='undefined'&&typeof _0x5ae09f[_0xda80('0x1d')]===_0xda80('0x1e');var _0x3483d1=_0x33bf06['count'];var _0x1b8247=_0x37c219?0x0:_0x5ae09f[_0xda80('0x1f')];var _0x27a740=_0x37c219?_0x33bf06[_0xda80('0x20')]:_0x5ae09f[_0xda80('0x1f')]+_0x5ae09f['limit'];var _0x38a751;if(_0x27a740>=_0x3483d1){_0x27a740=_0x3483d1;_0x38a751=0xc8;}else{_0x38a751=0xce;}_0x31cac1['status'](_0x38a751);return _0x31cac1[_0xda80('0x21')](_0xda80('0x22'),_0x1b8247+'-'+_0x27a740+'/'+_0x3483d1)[_0xda80('0x1c')](_0x33bf06);}return null;};}function patchUpdates(_0x22bd5a){return function(_0x56d9c0){try{jsonpatch[_0xda80('0x23')](_0x56d9c0,_0x22bd5a,!![]);}catch(_0x391c7d){return BPromise['reject'](_0x391c7d);}return _0x56d9c0[_0xda80('0x24')]();};}function saveUpdates(_0x50f308,_0x579398){return function(_0x2498b1){if(_0x2498b1){return _0x2498b1[_0xda80('0x25')](_0x50f308)[_0xda80('0x26')](function(_0xbadd6d){return _0xbadd6d;});}return null;};}function removeEntity(_0x241f12,_0x271099){return function(_0x2b8cf0){if(_0x2b8cf0){return _0x2b8cf0['destroy']()[_0xda80('0x26')](function(){_0x241f12['status'](0xcc)[_0xda80('0x1b')]();});}};}function handleEntityNotFound(_0x30aacd,_0x5da163){return function(_0x4d3ddf){if(!_0x4d3ddf){_0x30aacd[_0xda80('0x19')](0x194);}return _0x4d3ddf;};}function handleError(_0x402cfc,_0x50d3c9){_0x50d3c9=_0x50d3c9||0x1f4;return function(_0x333298){logger[_0xda80('0x27')](_0x333298['stack']);if(_0x333298[_0xda80('0x28')]){delete _0x333298[_0xda80('0x28')];}_0x402cfc[_0xda80('0x1a')](_0x50d3c9)['send'](_0x333298);};}function getInteractionUsers(_0x340774,_0x207ed0){return new BPromise(function(_0x242a76,_0x5f21cc){try{if(_0x207ed0[_0x340774['id']]){_0x340774[_0xda80('0x29')]=_['map'](_0x207ed0[_0x340774['id']],function(_0x3c903b){return{'id':_0x3c903b['id'],'fullname':_0x3c903b['fullname']};});}}catch(_0x45a322){_0x5f21cc(_0x45a322);}_0x242a76(_0x340774);});}function getInteractionTags(_0x1c0bf9,_0x95d7f6){return new BPromise(function(_0x5ba828,_0x394e51){try{if(_0x1c0bf9['TagIds']){_0x1c0bf9[_0xda80('0x2a')]=[];_0x1c0bf9['TagIds'][_0xda80('0x2b')](',')[_0xda80('0x2c')](function(_0x23d02c){_0x1c0bf9['Tags'][_0xda80('0x2d')](_0x95d7f6[_0x23d02c]);});}delete _0x1c0bf9['TagIds'];}catch(_0x442402){_0x394e51(_0x442402);}_0x5ba828(_0x1c0bf9);});}function updateSmsInteraction(_0x2ec106,_0x58917a,_0x150f16){return new BPromise(function(_0x420fbb,_0x440c9b){return getInteractionUsers(_0x2ec106,_0x150f16)['then'](function(_0x373576){return getInteractionTags(_0x373576,_0x58917a);})[_0xda80('0x26')](function(_0x2bf826){return getStateInteraction(_0x2bf826);})[_0xda80('0x26')](function(_0x3d409d){_0x420fbb(_0x3d409d);})[_0xda80('0x2e')](function(_0x113c11){_0x440c9b(_0x113c11);});});}function getStateInteraction(_0x20c58b){return new BPromise(function(_0x219268){_0x20c58b[_0xda80('0x2f')]=0x0;_0x20c58b['talking']=0x0;_0x20c58b[_0xda80('0x30')]=0x0;_0x20c58b[_0xda80('0x31')]=0x0;_0x20c58b[_0xda80('0x32')]=0x0;if(!_0x20c58b[_0xda80('0x33')]&&!_0x20c58b[_0xda80('0x34')]){_0x20c58b[_0xda80('0x2f')]+=0x1;}if(!_0x20c58b[_0xda80('0x33')]&&_0x20c58b[_0xda80('0x34')]){_0x20c58b[_0xda80('0x35')]+=0x1;if(_0x20c58b[_0xda80('0x2f')]){_0x20c58b[_0xda80('0x2f')]-=0x1;}}if(_0x20c58b[_0xda80('0x33')]&&_0x20c58b[_0xda80('0x34')]){_0x20c58b[_0xda80('0x30')]+=0x1;if(_0x20c58b['talking']){_0x20c58b[_0xda80('0x35')]-=0x1;}}if(_0x20c58b[_0xda80('0x33')]&&!_0x20c58b[_0xda80('0x34')]){_0x20c58b[_0xda80('0x31')]+=0x1;if(_0x20c58b[_0xda80('0x2f')]){_0x20c58b['waiting']-=0x1;}}_0x20c58b[_0xda80('0x32')]+=0x1;_0x219268(_0x20c58b);});}exports[_0xda80('0x36')]=function(_0x4b3347,_0x4d8df7){var _0x4fe8e6={},_0x494047={},_0x547fe4={'count':0x0,'rows':[]};var _0x26e3fb=_[_0xda80('0x37')](db['SmsInteraction'][_0xda80('0x38')],function(_0xa86936){return{'name':_0xa86936['fieldName'],'type':_0xa86936[_0xda80('0x39')][_0xda80('0x3a')]};});_0x494047['model']=_[_0xda80('0x37')](_0x26e3fb,_0xda80('0x28'));_0x494047[_0xda80('0x3b')]=_[_0xda80('0x3c')](_0x4b3347[_0xda80('0x3b')]);_0x494047['filters']=_[_0xda80('0x3d')](_0x494047[_0xda80('0x3e')],_0x494047[_0xda80('0x3b')]);_0x4fe8e6[_0xda80('0x3f')]=_[_0xda80('0x3d')](_0x494047['model'],qs[_0xda80('0x40')](_0x4b3347['query'][_0xda80('0x40')]));_0x4fe8e6[_0xda80('0x3f')]=_0x4fe8e6['attributes'][_0xda80('0x41')]?_0x4fe8e6['attributes']:_0x494047[_0xda80('0x3e')];if(!_0x4b3347[_0xda80('0x3b')]['hasOwnProperty'](_0xda80('0x42'))){_0x4fe8e6[_0xda80('0x1d')]=qs[_0xda80('0x1d')](_0x4b3347[_0xda80('0x3b')][_0xda80('0x1d')]);_0x4fe8e6[_0xda80('0x1f')]=qs[_0xda80('0x1f')](_0x4b3347['query'][_0xda80('0x1f')]);}_0x4fe8e6[_0xda80('0x43')]=qs[_0xda80('0x44')](_0x4b3347[_0xda80('0x3b')]['sort']);_0x4fe8e6[_0xda80('0x45')]=qs[_0xda80('0x46')](_['pick'](_0x4b3347[_0xda80('0x3b')],_0x494047['filters']),_0x26e3fb);var _0x5b0ff5=[];var _0x28c339=squel[_0xda80('0x47')]()[_0xda80('0x48')]('id')[_0xda80('0x48')](_0xda80('0x28'))[_0xda80('0x48')](_0xda80('0x49'))[_0xda80('0x4a')]('tools_tags');var _0x233ce8=squel['select']()['field'](_0xda80('0x4b'))[_0xda80('0x48')](_0xda80('0x4c'))[_0xda80('0x48')](_0xda80('0x4d'))[_0xda80('0x4a')](_0xda80('0x4e'),'ui')[_0xda80('0x4f')](_0xda80('0x50'),'u',_0xda80('0x51'));var _0x23b699=squel[_0xda80('0x47')]()['from']('sms_interactions','i')[_0xda80('0x4f')](_0xda80('0x52'),'c',_0xda80('0x53'))[_0xda80('0x4f')](_0xda80('0x50'),'o',_0xda80('0x54'))[_0xda80('0x4f')]('sms_accounts','a',_0xda80('0x55'))[_0xda80('0x4f')](_0xda80('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xda80('0x4f')](_0xda80('0x57'),'it',_0xda80('0x58'))[_0xda80('0x4f')](_0xda80('0x59'),'t',_0xda80('0x5a'));var _0x3da252=squel[_0xda80('0x5b')]();var _0x438978=[];var _0x589d20=squel[_0xda80('0x5b')]();var _0x410297;if(_0x4b3347[_0xda80('0x3b')]['search']){_0x410297=as[_0xda80('0x5c')](_0x4b3347['query'][_0xda80('0x5d')]);var _0x43b640=_0x410297[_0xda80('0x5e')];for(var _0x23d308=0x0;_0x23d308<_0x410297[_0xda80('0x5f')]['length'];_0x23d308++){var _0xdbdec6=_0x410297[_0xda80('0x5f')][_0x23d308];var _0x31572a='i';var _0x5258da=_[_0xda80('0x60')](_0x26e3fb,['name',_0xdbdec6[_0xda80('0x48')]]);if(!_0x5258da){switch(_0xdbdec6[_0xda80('0x48')]){case'unreadMessages':if(_0xdbdec6['value']==0x1){_0x23b699[_0xda80('0x61')]('`'+_0xdbdec6[_0xda80('0x48')]+_0xda80('0x62'));}else{_0x23b699[_0xda80('0x61')]('`'+_0xdbdec6[_0xda80('0x48')]+_0xda80('0x63'));}break;case _0xda80('0x64'):if(_0xdbdec6[_0xda80('0x65')]===_0xda80('0x66')){if(_0xdbdec6[_0xda80('0x67')][_0xda80('0x2b')]('\x20')['length']>0x1){_0x3da252[_0x43b640](_0xda80('0x68'),qs[_0xda80('0x69')](_0xdbdec6[_0xda80('0x67')]),null);}else{var _0x117062='%'+_0xdbdec6[_0xda80('0x67')]+'%';_0x3da252[_0x43b640](_0xda80('0x6a'),_0x117062,_0x117062,_0x117062);}}else{_0x5258da=_[_0xda80('0x60')](_0x26e3fb,[_0xda80('0x28'),_0xda80('0x6b')]);_0xdbdec6[_0xda80('0x48')]=_0xda80('0x6b');_0x95a037=as[_0xda80('0x6c')](_0x31572a,_0x5258da[_0xda80('0x39')],_0xdbdec6);_0x3da252[_0x43b640](_0x95a037[_0xda80('0x6d')],_0x95a037[_0xda80('0x67')][_0xda80('0x6e')],_0x95a037['value'][_0xda80('0x1b')]);}break;case _0xda80('0x6f'):var _0x58fc21=_0xdbdec6[_0xda80('0x67')][_0xda80('0x2b')](',')[_0xda80('0x37')](function(_0x320b15){return Number(_0x320b15);});_0x58fc21['forEach'](function(_0x4f50a3){_0x589d20['or'](_0xda80('0x70'),'%,'+_0x4f50a3+',%');});_0x438978=_[_0xda80('0x71')](_0x438978,_0x58fc21);break;case _0xda80('0x72'):if(_0xdbdec6['operator']===_0xda80('0x66')){_0x3da252[_0x43b640](_0xda80('0x73'),'%'+_0xdbdec6[_0xda80('0x67')]+'%',null);}else{_0x5258da=_[_0xda80('0x60')](_0x26e3fb,[_0xda80('0x28'),_0xda80('0x34')]);_0xdbdec6['field']=_0xda80('0x34');_0x95a037=as[_0xda80('0x6c')](_0x31572a,_0x5258da['type'],_0xdbdec6);_0x3da252[_0x43b640](_0x95a037[_0xda80('0x6d')],_0x95a037['value'][_0xda80('0x6e')],_0x95a037[_0xda80('0x67')][_0xda80('0x1b')]);}break;case'body':_0x95a037=as[_0xda80('0x6c')]('me',null,_0xdbdec6);_0x3da252[_0x43b640](_0x95a037[_0xda80('0x6d')],_0x95a037[_0xda80('0x67')][_0xda80('0x6e')],_0x95a037[_0xda80('0x67')][_0xda80('0x1b')]);break;}}else{var _0x95a037=as[_0xda80('0x6c')](_0x31572a,_0x5258da[_0xda80('0x39')],_0xdbdec6);_0x3da252[_0x43b640](_0x95a037[_0xda80('0x6d')],_0x95a037['value'][_0xda80('0x6e')],_0x95a037['value']['end']);}}}else{var _0x1e3e02=_(_0x4b3347['query'])[_0xda80('0x3c')]()['map'](function(_0x5aa2c6){return _[_0xda80('0x74')](_0x26e3fb,['name',_0x5aa2c6])?_0x5aa2c6:undefined;})[_0xda80('0x75')]()[_0xda80('0x67')]();if(!_['isEmpty'](_0x1e3e02)){_0x1e3e02[_0xda80('0x2c')](function(_0xe75cd7){if(_0xe75cd7===_0xda80('0x76')){_0x23b699[_0xda80('0x45')](_0xda80('0x77'),[][_0xda80('0x78')](_0x4b3347[_0xda80('0x3b')][_0xe75cd7]));}else if(_0xe75cd7===_0xda80('0x79')){var _0x31afe=JSON[_0xda80('0x7a')](_0x4b3347[_0xda80('0x3b')][_0xe75cd7])[_0xda80('0x7b')];var _0x43e806=JSON['parse'](_0x4b3347[_0xda80('0x3b')][_0xe75cd7])[_0xda80('0x7c')];_0x23b699[_0xda80('0x45')](_0xda80('0x7d'),_0x31afe,_0x43e806);}else{if(_0x4b3347['query'][_0xe75cd7]==='null'){_0x23b699[_0xda80('0x45')]('i.'+_0xe75cd7+_0xda80('0x7e'));}else{_0x23b699[_0xda80('0x45')]('i.'+_0xe75cd7+_0xda80('0x7f'),_0x4b3347[_0xda80('0x3b')][_0xe75cd7]);}}});}if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x80')]){if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x80')]==0x1){_0x23b699['having']('`unreadMessages`\x20=\x200');}else{_0x23b699[_0xda80('0x61')](_0xda80('0x81'));}}if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x82')]){_0x438978=_['isArray'](_0x4b3347['query'][_0xda80('0x82')])?_0x4b3347[_0xda80('0x3b')][_0xda80('0x82')]:new Array(_0x4b3347['query'][_0xda80('0x82')]);_0x438978[_0xda80('0x2c')](function(_0xec7068){_0x589d20['or'](_0xda80('0x70'),'%,'+_0xec7068+',%');});}if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x83')]){var _0x474c04=_0x4b3347[_0xda80('0x3b')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xda80('0x84')](_0x474c04)){_0x3da252['or'](_0xda80('0x85'),_0x474c04+'%')['or'](_0xda80('0x86'),_0x474c04+'%');}else{_0x3da252['or'](_0xda80('0x87'),qs['getFullTextValue'](_0x474c04))['or'](_0xda80('0x88'),_0x474c04+'%');}}}_0x23b699[_0xda80('0x45')](_0x3da252);_0x23b699[_0xda80('0x89')](_0xda80('0x8a'));var _0x100c8e={'type':db['Sequelize'][_0xda80('0x8b')][_0xda80('0x8c')],'raw':!![]};var _0x105b3b=_0x23b699[_0xda80('0x8d')]();_0x105b3b['field']('i.id');_0x105b3b[_0xda80('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xda80('0x8e'));if(_0x4fe8e6[_0xda80('0x43')]){_0x4fe8e6[_0xda80('0x43')][_0xda80('0x2c')](function(_0x5ed173){var _0x595412=_0x5ed173[0x0]===_0xda80('0x8f')?_0x5ed173[0x0]:'i.'+_0x5ed173[0x0];_0x23b699[_0xda80('0x43')](_0x595412,_0x5ed173[0x1]===_0xda80('0x90')?![]:!![]);});}if(!_[_0xda80('0x91')](_0x438978)){_0x23b699[_0xda80('0x61')](_0x589d20);_0x105b3b['where'](_0xda80('0x92'),_0x438978);}BPromise[_0xda80('0x93')]()[_0xda80('0x26')](function(){if(!_0x410297){if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x76')])return;_0x105b3b[_0xda80('0x45')](_0xda80('0x94'));_0x23b699[_0xda80('0x45')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4b3347[_0xda80('0x95')][_0xda80('0x96')]!=='agent')return;return _0x4b3347[_0xda80('0x95')][_0xda80('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3c0c82){if(_[_0xda80('0x91')](_0x3c0c82)){_0x105b3b['where'](_0xda80('0x98'));_0x23b699['where'](_0xda80('0x98'));}else{_0x105b3b[_0xda80('0x45')](_0xda80('0x77'),_[_0xda80('0x37')](_0x3c0c82,'id'));_0x23b699['where'](_0xda80('0x77'),_['map'](_0x3c0c82,'id'));}});})[_0xda80('0x26')](function(){if(_0x4b3347[_0xda80('0x95')][_0xda80('0x96')]===_0xda80('0x99')&&!_0x410297&&!_0x4b3347[_0xda80('0x3b')][_0xda80('0x76')])return[];return db[_0xda80('0x9a')][_0xda80('0x3b')](_0x105b3b['toString'](),_0x100c8e);})['then'](function(_0x4cbe75){_0x547fe4[_0xda80('0x20')]=_0x4cbe75['length'];if(_0x547fe4['count']===0x0)return[];return db[_0xda80('0x9a')][_0xda80('0x3b')](_0x28c339[_0xda80('0x9b')](),_0x100c8e)['then'](function(_0x165274){_0x5b0ff5=_[_0xda80('0x9c')](_0x165274,'id');_0x100c8e=_[_0xda80('0x9d')](_0x100c8e,{'model':db[_0xda80('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b3347[_0xda80('0x3b')][_0xda80('0x40')]){_0x4fe8e6[_0xda80('0x3f')]['forEach'](function(_0x4a95f0){_0x23b699[_0xda80('0x48')]('i.'+_0x4a95f0);});}else{_0x23b699[_0xda80('0x48')](_0xda80('0x9f'),_0xda80('0x8e'));_0x23b699[_0xda80('0x48')](_0xda80('0xa0'),'Account.key');_0x23b699[_0xda80('0x48')](_0xda80('0xa1'),_0xda80('0xa2'));_0x23b699[_0xda80('0x48')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x23b699[_0xda80('0x48')]('i.*');_0x23b699[_0xda80('0x48')](_0xda80('0xa3'),_0xda80('0xa4'));_0x23b699[_0xda80('0x48')](_0xda80('0xa5'),'Contact.lastName');_0x23b699['field'](_0xda80('0xa6'),_0xda80('0xa7'));_0x23b699[_0xda80('0x48')](_0xda80('0xa8'),_0xda80('0xa9'));_0x23b699[_0xda80('0x48')]('c.mobile',_0xda80('0xaa'));_0x23b699[_0xda80('0x48')](_0xda80('0xab'),_0xda80('0xac'));_0x23b699[_0xda80('0x48')](_0xda80('0xad'),_0xda80('0xae'));_0x23b699[_0xda80('0x48')](_0xda80('0xaf'),_0xda80('0xb0'));_0x23b699['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xda80('0xb1'));}if(_0x4fe8e6[_0xda80('0x1d')])_0x23b699[_0xda80('0x1d')](_0x4fe8e6[_0xda80('0x1d')]);if(_0x4fe8e6[_0xda80('0x1f')])_0x23b699['offset'](_0x4fe8e6['offset']);return db['sequelize'][_0xda80('0x3b')](_0x23b699[_0xda80('0x9b')](),_0x100c8e);})[_0xda80('0x26')](function(_0x575c2b){if(_0x575c2b[_0xda80('0x41')]>0x0)_0x233ce8[_0xda80('0x45')](_0xda80('0xb2'),_[_0xda80('0x37')](_0x575c2b,'id'));return db[_0xda80('0x9a')][_0xda80('0x3b')](_0x233ce8[_0xda80('0x9b')](),_0x100c8e)[_0xda80('0x26')](function(_0x225d45){var _0x4a0489=_[_0xda80('0xb3')](_0x225d45,'SmsInteractionId');var _0x1b923a=[];_0x575c2b[_0xda80('0x2c')](function(_0xbdd7a5){_0x1b923a[_0xda80('0x2d')](updateSmsInteraction(_0xbdd7a5,_0x5b0ff5,_0x4a0489));});return BPromise['all'](_0x1b923a);});});})[_0xda80('0x26')](function(_0x4ee8f2){_0x547fe4[_0xda80('0xb4')]=_0x4ee8f2;return _0x547fe4;})[_0xda80('0x26')](respondWithFilteredResult(_0x4d8df7,_0x4fe8e6))['catch'](handleError(_0x4d8df7,null));};exports['show']=function(_0x4d0ce9,_0x116371){var _0xa75428={'raw':![],'where':{'id':_0x4d0ce9[_0xda80('0xb5')]['id']}},_0x2d7f73={};_0x2d7f73[_0xda80('0x3e')]=_[_0xda80('0x3c')](db['SmsInteraction'][_0xda80('0x38')]);_0x2d7f73['query']=_[_0xda80('0x3c')](_0x4d0ce9[_0xda80('0x3b')]);_0x2d7f73[_0xda80('0x46')]=_[_0xda80('0x3d')](_0x2d7f73[_0xda80('0x3e')],_0x2d7f73[_0xda80('0x3b')]);_0xa75428['attributes']=_[_0xda80('0x3d')](_0x2d7f73[_0xda80('0x3e')],qs[_0xda80('0x40')](_0x4d0ce9[_0xda80('0x3b')][_0xda80('0x40')]));_0xa75428['attributes']=_0xa75428['attributes'][_0xda80('0x41')]?_0xa75428['attributes']:_0x2d7f73[_0xda80('0x3e')];if(_0x4d0ce9[_0xda80('0x3b')][_0xda80('0xb6')]){_0xa75428[_0xda80('0xb7')]=[{'all':!![]}];}_0xa75428=_[_0xda80('0x9d')]({},_0xa75428,_0x4d0ce9[_0xda80('0xb8')]);return db[_0xda80('0x9e')][_0xda80('0x60')](_0xa75428)[_0xda80('0x26')](handleEntityNotFound(_0x116371,null))[_0xda80('0x26')](respondWithResult(_0x116371,null))[_0xda80('0x2e')](handleError(_0x116371,null));};exports[_0xda80('0xb9')]=function(_0x416b20,_0x2c7fe6){return db[_0xda80('0x9e')][_0xda80('0xb9')](_0x416b20[_0xda80('0xba')],{})[_0xda80('0x26')](respondWithResult(_0x2c7fe6,0xc9))[_0xda80('0x2e')](handleError(_0x2c7fe6,null));};exports[_0xda80('0x25')]=function(_0x5d1304,_0x464b6d){if(_0x5d1304[_0xda80('0xba')]['id']){delete _0x5d1304['body']['id'];}return db[_0xda80('0x9e')][_0xda80('0x60')]({'where':{'id':_0x5d1304[_0xda80('0xb5')]['id']}})[_0xda80('0x26')](handleEntityNotFound(_0x464b6d,null))[_0xda80('0x26')](saveUpdates(_0x5d1304[_0xda80('0xba')],null))['then'](respondWithResult(_0x464b6d,null))['catch'](handleError(_0x464b6d,null));};exports[_0xda80('0xbb')]=function(_0x4a925a,_0x1ed732){return db[_0xda80('0x9e')][_0xda80('0x60')]({'where':{'id':_0x4a925a[_0xda80('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1ed732,null))['then'](removeEntity(_0x1ed732,null))[_0xda80('0x2e')](handleError(_0x1ed732,null));};exports['describe']=function(_0x4d71de,_0x55a359){return db[_0xda80('0x9e')]['describe']()[_0xda80('0x26')](respondWithResult(_0x55a359,null))['catch'](handleError(_0x55a359,null));};exports[_0xda80('0xbc')]=function(_0x518ff5,_0x5ae914,_0x183fdc){return db['SmsMessage'][_0xda80('0x60')]({'where':{'id':_0x518ff5[_0xda80('0xb5')]['id']}})[_0xda80('0x26')](handleEntityNotFound(_0x5ae914,null))[_0xda80('0x26')](function(_0x51c5e5){if(_0x51c5e5){return _0x51c5e5['addMessage'](_0x518ff5[_0xda80('0xba')][_0xda80('0xbd')],_[_0xda80('0xbe')](_0x518ff5[_0xda80('0xba')],[_0xda80('0xbd'),'id'])||{});}})[_0xda80('0x26')](respondWithResult(_0x5ae914,null))[_0xda80('0x2e')](handleError(_0x5ae914,null));};exports['getMessages']=function(_0x35ee09,_0x2781f3,_0x382937){var _0x3640c1={'raw':![],'where':{}};var _0x245040={};var _0x225cb3={'count':0x0,'rows':[]};return db[_0xda80('0x9e')][_0xda80('0xbf')]({'where':{'id':_0x35ee09[_0xda80('0xb5')]['id']}})[_0xda80('0x26')](handleEntityNotFound(_0x2781f3,null))['then'](function(_0x4f0396){if(_0x4f0396){_0x245040[_0xda80('0x3e')]=_['keys'](db[_0xda80('0xc0')][_0xda80('0x38')]);_0x245040[_0xda80('0x3b')]=_[_0xda80('0x3c')](_0x35ee09[_0xda80('0x3b')]);_0x245040['filters']=_[_0xda80('0x3d')](_0x245040[_0xda80('0x3e')],_0x245040[_0xda80('0x3b')]);_0x3640c1[_0xda80('0x3f')]=_[_0xda80('0x3d')](_0x245040[_0xda80('0x3e')],qs[_0xda80('0x40')](_0x35ee09[_0xda80('0x3b')][_0xda80('0x40')]));_0x3640c1[_0xda80('0x3f')]=_0x3640c1[_0xda80('0x3f')]['length']?_0x3640c1[_0xda80('0x3f')]:_0x245040[_0xda80('0x3e')];if(!_0x35ee09[_0xda80('0x3b')]['hasOwnProperty']('nolimit')){_0x3640c1['limit']=qs[_0xda80('0x1d')](_0x35ee09[_0xda80('0x3b')][_0xda80('0x1d')]);_0x3640c1[_0xda80('0x1f')]=qs[_0xda80('0x1f')](_0x35ee09[_0xda80('0x3b')][_0xda80('0x1f')]);}_0x3640c1[_0xda80('0x43')]=qs[_0xda80('0x44')](_0x35ee09['query'][_0xda80('0x44')]);_0x3640c1['where']=qs[_0xda80('0x46')](_[_0xda80('0xc1')](_0x35ee09[_0xda80('0x3b')],_0x245040[_0xda80('0x46')]));_0x3640c1[_0xda80('0x45')][_0xda80('0xc2')]=_0x4f0396['id'];if(_0x35ee09['query'][_0xda80('0x83')]){_0x3640c1[_0xda80('0x45')]=_[_0xda80('0x9d')](_0x3640c1['where'],{'$or':_[_0xda80('0x37')](_0x3640c1[_0xda80('0x3f')],function(_0x1a3513){var _0x5d8a47={};_0x5d8a47[_0x1a3513]={'$like':'%'+_0x35ee09['query'][_0xda80('0x83')]+'%'};return _0x5d8a47;})});}if(_0x35ee09[_0xda80('0x3b')]['$gte']){var _0x46497d=_0x35ee09[_0xda80('0x3b')][_0xda80('0x7b')][_0xda80('0x2b')](',');var _0x17118a={};_0x17118a[_0x46497d[0x0]]={'$gte':moment(_0x46497d[0x1])[_0xda80('0xc3')](_0xda80('0xc4'))};_0x3640c1[_0xda80('0x45')]=_['merge'](_0x3640c1[_0xda80('0x45')],_0x17118a);}_0x3640c1=_['merge']({},_0x3640c1,_0x35ee09[_0xda80('0xb8')]);return db[_0xda80('0xc0')][_0xda80('0x20')]({'where':_0x3640c1[_0xda80('0x45')]})[_0xda80('0x26')](function(_0x5af84b){_0x225cb3[_0xda80('0x20')]=_0x5af84b;if(_0x35ee09[_0xda80('0x3b')]['includeAll']){_0x3640c1[_0xda80('0xb7')]=[{'all':!![]}];}return db[_0xda80('0xc0')][_0xda80('0xc5')](_0x3640c1);})[_0xda80('0x26')](function(_0x6cf05c){_0x225cb3[_0xda80('0xb4')]=_0x6cf05c;return _0x225cb3;});}})[_0xda80('0x26')](respondWithFilteredResult(_0x2781f3,_0x3640c1))[_0xda80('0x2e')](handleError(_0x2781f3,null));};exports['addTags']=function(_0x3db6cd,_0x269398,_0x4bc841){return db['SmsInteraction']['find']({'where':{'id':_0x3db6cd[_0xda80('0xb5')]['id']}})['then'](handleEntityNotFound(_0x269398,null))[_0xda80('0x26')](function(_0x5db6a2){if(_0x5db6a2){return _0x5db6a2[_0xda80('0xc6')](_0x3db6cd['body'][_0xda80('0xbd')],_[_0xda80('0xbe')](_0x3db6cd[_0xda80('0xba')],[_0xda80('0xbd'),'id'])||{})[_0xda80('0xc7')](function(){return db[_0xda80('0x6f')][_0xda80('0xc5')]({'attributes':['id',_0xda80('0x28'),'color'],'where':{'id':_0x3db6cd['body'][_0xda80('0xbd')]}});})['then'](function(_0x501a02){socket[_0xda80('0xc8')](_0xda80('0xc9'),{'id':Number(_0x3db6cd[_0xda80('0xb5')]['id']),'tags':_0x501a02||[]});return{'id':Number(_0x3db6cd[_0xda80('0xb5')]['id']),'tags':_0x501a02||[]};});}})['then'](respondWithResult(_0x269398,null))[_0xda80('0x2e')](handleError(_0x269398,null));};exports['removeTags']=function(_0x27ef50,_0x3086a9,_0x4846b6){return db[_0xda80('0x9e')][_0xda80('0x60')]({'where':{'id':_0x27ef50[_0xda80('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3086a9,null))[_0xda80('0x26')](function(_0xdfd6b8){if(_0xdfd6b8){return _0xdfd6b8['removeTags'](_0x27ef50[_0xda80('0x3b')][_0xda80('0xbd')]);}})['then'](respondWithStatusCode(_0x3086a9,null))['catch'](handleError(_0x3086a9,null));};exports[_0xda80('0xca')]=function(_0x4468c9,_0x3f0727){var _0x4a679d=moment()['unix']()[_0xda80('0x9b')]();var _0x277837=path['join'](config['root'],_0xda80('0xcb'),'files',_0xda80('0xcc'));var _0x2e0475=path[_0xda80('0xcd')](config[_0xda80('0xce')],'server',_0xda80('0xcf'),_0xda80('0xd0'));var _0x4082df=path['join'](_0x277837,_0x4a679d);var _0x10c63b=util['format'](_0xda80('0xd1'),_0x4468c9[_0xda80('0xb5')]['id'],_0x4a679d);var _0x2cb50e=path[_0xda80('0xcd')](_0x277837,_0x10c63b);var _0x1e3476=[];_0x1e3476[_0xda80('0x2d')]({'model':db[_0xda80('0x72')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1e3476[_0xda80('0x2d')]({'model':db[_0xda80('0xd2')],'as':'Contact','attributes':['id',_0xda80('0xd3'),_0xda80('0xd4')],'raw':!![]});var _0x3f0358=[{'model':db[_0xda80('0xc0')],'as':_0xda80('0xd5'),'attributes':['id','body',_0xda80('0x79'),_0xda80('0xd6'),'secret',_0xda80('0x80')],'include':_0x1e3476}];_0x3f0358[_0xda80('0x2d')]({'model':db[_0xda80('0xd7')],'as':_0xda80('0xd8'),'attributes':['id',_0xda80('0x28')]});_0x3f0358[_0xda80('0x2d')]({'model':db[_0xda80('0x72')],'as':_0xda80('0xd9'),'attributes':['id',_0xda80('0xda')]});return db['SmsInteraction'][_0xda80('0x60')]({'where':{'id':_0x4468c9['params']['id']},'include':_0x3f0358})[_0xda80('0x26')](handleEntityNotFound(_0x3f0727,null))[_0xda80('0x26')](function(_0x1940c8){if(_0x1940c8){var _0x51de47=_0x1940c8[_0xda80('0xdb')]({'plain':!![]});fs[_0xda80('0xdc')](_0x4082df);var _0xd3cf6a={'channel':_0xda80('0xdd'),'account':_0x51de47[_0xda80('0xd8')][_0xda80('0x28')],'agent':_0x51de47[_0xda80('0xd9')]?_0x51de47[_0xda80('0xd9')][_0xda80('0xda')]:_0xda80('0xde'),'createdAt':moment(_0x51de47['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xda80('0x9b')](),'closedAt':_0x51de47[_0xda80('0x33')]?moment(_0x51de47[_0xda80('0xdf')])[_0xda80('0xc3')](_0xda80('0xc4'))[_0xda80('0x9b')]():'','disposition':_0x51de47['disposition'],'messages':_(_0x51de47[_0xda80('0xd5')])[_0xda80('0x83')]({'secret':![]})[_0xda80('0x37')](function(_0x47d895){return{'date':moment(_0x47d895[_0xda80('0x79')])['format'](_0xda80('0xc4'))[_0xda80('0x9b')](),'sender':_0x47d895[_0xda80('0xd6')]===_0xda80('0xe0')?_0x47d895['User']?_0x47d895[_0xda80('0x72')][_0xda80('0xda')]:'System':_0x47d895[_0xda80('0x64')][_0xda80('0xd3')]+(_0x47d895[_0xda80('0x64')][_0xda80('0xd4')]?'\x20'+_0x47d895[_0xda80('0x64')][_0xda80('0xd4')]:''),'body':_0x47d895[_0xda80('0xba')],'direction':_0x47d895['direction']===_0xda80('0xe0')?'A':'C','secret':_0x47d895[_0xda80('0xe1')],'read':_0x47d895[_0xda80('0x80')]};})['value']()};return ejs[_0xda80('0xe2')](path[_0xda80('0xcd')](config['root'],_0xda80('0xcb'),_0xda80('0xe3'),_0xda80('0xe4')),{'interaction':_0xd3cf6a})['then'](function(_0x465f20){var _0x5233e2=path[_0xda80('0xcd')](_0x4082df,'transcript-'+_0x51de47['id']+'-'+_0x4a679d+'.pdf');var _0x3c7618={'path':_0x5233e2,'channel':_0xda80('0xdd'),'interactionId':_0x51de47['id']};return pdf[_0xda80('0xe5')](_0x465f20,_0x3c7618);})[_0xda80('0x26')](function(){return new BPromise(function(_0x3a13a3,_0x20e3dc){zipdir(_0x4082df,{'saveTo':_0x2cb50e},function(_0x2fcfe5,_0x109881){if(_0x2fcfe5)return _0x20e3dc(_0x2fcfe5);return _0x3a13a3(_0x109881);});})[_0xda80('0x26')](function(){return new BPromise(function(_0x26d19a,_0x43cf38){rimraf(_0x4082df,function(_0x3b342d){if(_0x3b342d)_0x43cf38(_0x3b342d);return _0x26d19a();});});})[_0xda80('0x26')](function(){return _0x3f0727[_0xda80('0xca')](_0x2cb50e,_0x10c63b,function(_0x4dc5eb){if(_0x4dc5eb){console[_0xda80('0xe6')](_0xda80('0xe7'),_0x4dc5eb);}else{fs[_0xda80('0xe8')](_0x2cb50e);}});});});}else{return _0x3f0727[_0xda80('0x19')](0xc8);}})[_0xda80('0x2e')](handleError(_0x3f0727,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1d995ee..e1b1a41 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 _0x4b17=['SmsInteraction','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x1775b7,_0x936cfd){var _0x66abc0=function(_0x39117d){while(--_0x39117d){_0x1775b7['push'](_0x1775b7['shift']());}};_0x66abc0(++_0x936cfd);}(_0x4b17,0x10f));var _0x74b1=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0x4b17[_0x2d2e85];return _0x3e9f5e;};'use strict';var EventEmitter=require(_0x74b1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x74b1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x74b1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x74b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74b1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fdea2){return function(_0x7b3c36,_0x30d910,_0x379dcc){_0x7b3c36[_0x74b1('0x5')]({'attributes':['id'],'raw':!![]})[_0x74b1('0x6')](function(_0x191d2b){_0x7b3c36[_0x74b1('0x7')]('Users',_0x191d2b[_0x74b1('0x8')](function(_0x98bb33){return{'id':_0x98bb33['id']};}));return SmsMessage[_0x74b1('0x9')]({'where':{'SmsInteractionId':_0x7b3c36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74b1('0x6')](function(_0xc1952){_0x7b3c36['setDataValue'](_0x74b1('0xa'),_0xc1952[_0x74b1('0xb')]);SmsInteractionEvents['emit'](_0x4fdea2+':'+_0x7b3c36['id'],_0x7b3c36);SmsInteractionEvents[_0x74b1('0xc')](_0x4fdea2,_0x7b3c36);_0x379dcc(null);})[_0x74b1('0xd')](_0x379dcc(null));};}for(var e in events){if(events[_0x74b1('0xe')](e)){var event=events[e];SmsInteraction[_0x74b1('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x5a7170,_0x111dd2){var _0x5970fb=function(_0x195a65){while(--_0x195a65){_0x5a7170['push'](_0x5a7170['shift']());}};_0x5970fb(++_0x111dd2);}(_0x583c,0x12b));var _0xc583=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x583c[_0x318840];return _0x223da4;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0a38bab..39630c6 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 _0xaa6f=['closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','SmsInteraction','closed'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaa6f,0x17b));var _0xfaa6=function(_0x2e5b0f,_0x15bd34){_0x2e5b0f=_0x2e5b0f-0x0;var _0x3548b6=_0xaa6f[_0x2e5b0f];return _0x3548b6;};'use strict';var _=require('lodash');var util=require(_0xfaa6('0x0'));var logger=require(_0xfaa6('0x1'))(_0xfaa6('0x2'));var moment=require(_0xfaa6('0x3'));var BPromise=require(_0xfaa6('0x4'));var rp=require(_0xfaa6('0x5'));var fs=require('fs');var path=require(_0xfaa6('0x6'));var rimraf=require(_0xfaa6('0x7'));var config=require('../../config/environment');var attributes=require(_0xfaa6('0x8'));module['exports']=function(_0x59bc5f,_0x297d27){return _0x59bc5f['define'](_0xfaa6('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33bc83,_0x5c4ec7,_0x329e85){if(_0x33bc83['changed'](_0xfaa6('0xa'))){_0x33bc83[_0xfaa6('0xb')]=moment()[_0xfaa6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x329e85(null,_0x33bc83);}}});}; \ No newline at end of file +var _0x64d1=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x574dcf,_0x4813d2){var _0xc65f2c=function(_0x16b626){while(--_0x16b626){_0x574dcf['push'](_0x574dcf['shift']());}};_0xc65f2c(++_0x4813d2);}(_0x64d1,0x1a0));var _0x164d=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x64d1[_0x1ebce2];return _0x4a330c;};'use strict';var _=require(_0x164d('0x0'));var util=require(_0x164d('0x1'));var logger=require(_0x164d('0x2'))(_0x164d('0x3'));var moment=require(_0x164d('0x4'));var BPromise=require(_0x164d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x164d('0x6'));var attributes=require(_0x164d('0x7'));module['exports']=function(_0x977f0f,_0x49e41c){return _0x977f0f[_0x164d('0x8')](_0x164d('0x9'),attributes,{'tableName':_0x164d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d8044,_0x589aa7,_0x5ded74){if(_0x3d8044[_0x164d('0xb')](_0x164d('0xc'))){_0x3d8044[_0x164d('0xd')]=moment()[_0x164d('0xe')](_0x164d('0xf'));}_0x5ded74(null,_0x3d8044);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 35c7089..c278804 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 _0x1976=['UpdateSmsInteraction','SmsInteraction','update','body','options','where','then','catch','AddTagsToSmsInteraction','find','addTags','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x72f3c0,_0x51d9d0){var _0x57e38e=function(_0x379263){while(--_0x379263){_0x72f3c0['push'](_0x72f3c0['shift']());}};_0x57e38e(++_0x51d9d0);}(_0x1976,0x126));var _0x6197=function(_0x802d85,_0x1a6239){_0x802d85=_0x802d85-0x0;var _0x58b956=_0x1976[_0x802d85];return _0x58b956;};'use strict';var _=require(_0x6197('0x0'));var util=require('util');var moment=require(_0x6197('0x1'));var BPromise=require(_0x6197('0x2'));var rs=require(_0x6197('0x3'));var fs=require('fs');var Redis=require(_0x6197('0x4'));var db=require(_0x6197('0x5'))['db'];var utils=require(_0x6197('0x6'));var logger=require(_0x6197('0x7'))('rpc');var config=require(_0x6197('0x8'));var jayson=require(_0x6197('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6197('0xa')]=_[_0x6197('0xb')](config[_0x6197('0xa')],{'host':_0x6197('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6197('0xa')]));require(_0x6197('0xd'))[_0x6197('0xe')](socket);function respondWithRpcPromise(_0x5a8149,_0x6219da,_0x118d91){return new BPromise(function(_0x1847cd,_0x4078b9){return client[_0x6197('0xf')](_0x5a8149,_0x118d91)['then'](function(_0x5a1c9f){logger[_0x6197('0x10')](_0x6197('0x11'),_0x6219da,_0x6197('0x12'));logger[_0x6197('0x13')](_0x6197('0x14'),_0x6219da,_0x6197('0x12'),JSON[_0x6197('0x15')](_0x5a1c9f));if(_0x5a1c9f[_0x6197('0x16')]){if(_0x5a1c9f['error'][_0x6197('0x17')]===0x1f4){logger['error'](_0x6197('0x11'),_0x6219da,_0x5a1c9f[_0x6197('0x16')][_0x6197('0x18')]);return _0x4078b9(_0x5a1c9f[_0x6197('0x16')][_0x6197('0x18')]);}logger[_0x6197('0x16')](_0x6197('0x11'),_0x6219da,_0x5a1c9f['error']['message']);return _0x1847cd(_0x5a1c9f[_0x6197('0x16')]['message']);}else{logger[_0x6197('0x10')](_0x6197('0x11'),_0x6219da,_0x6197('0x12'));_0x1847cd(_0x5a1c9f[_0x6197('0x19')]['message']);}})['catch'](function(_0x34c3d4){logger[_0x6197('0x16')](_0x6197('0x11'),_0x6219da,_0x34c3d4);_0x4078b9(_0x34c3d4);});});}exports[_0x6197('0x1a')]=function(_0x4c3c85){var _0x27e336=this;return new Promise(function(_0x4621eb,_0x9f5f65){return db[_0x6197('0x1b')][_0x6197('0x1c')](_0x4c3c85[_0x6197('0x1d')],{'raw':_0x4c3c85[_0x6197('0x1e')]?_0x4c3c85['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c3c85[_0x6197('0x1e')]?_0x4c3c85[_0x6197('0x1e')][_0x6197('0x1f')]||null:null,'attributes':_0x4c3c85[_0x6197('0x1e')]?_0x4c3c85[_0x6197('0x1e')]['attributes']||null:null,'limit':_0x4c3c85['options']?_0x4c3c85[_0x6197('0x1e')]['limit']||null:null})[_0x6197('0x20')](function(_0x1d1570){logger[_0x6197('0x10')](_0x6197('0x1a'),_0x4c3c85);logger['debug'](_0x6197('0x1a'),_0x4c3c85,JSON[_0x6197('0x15')](_0x1d1570));_0x4621eb(_0x1d1570);})[_0x6197('0x21')](function(_0x459006){logger['error']('UpdateSmsInteraction',_0x459006[_0x6197('0x18')],_0x4c3c85);_0x9f5f65(_0x27e336[_0x6197('0x16')](0x1f4,_0x459006[_0x6197('0x18')]));});});};exports[_0x6197('0x22')]=function(_0x544ae2){return new Promise(function(_0x2c5369,_0x5c939c){return db[_0x6197('0x1b')][_0x6197('0x23')]({'where':_0x544ae2[_0x6197('0x1e')]?_0x544ae2[_0x6197('0x1e')][_0x6197('0x1f')]||null:null})[_0x6197('0x20')](function(_0x2260f0){if(_0x2260f0){return _0x2260f0[_0x6197('0x24')](_0x544ae2[_0x6197('0x1d')]['ids'],_[_0x6197('0x25')](_0x544ae2['body'],['ids','id'])||{});}})[_0x6197('0x26')](function(_0x2e8ad1){logger['info'](_0x6197('0x27'),_0x544ae2);logger[_0x6197('0x13')]('AddTags',_0x544ae2,JSON[_0x6197('0x15')](_0x2e8ad1));_0x2c5369(_0x2e8ad1);})[_0x6197('0x21')](function(_0x26004d){logger[_0x6197('0x16')](_0x6197('0x27'),_0x26004d['message'],_0x544ae2);_0x5c939c(_this[_0x6197('0x16')](0x1f4,_0x26004d[_0x6197('0x18')]));});});}; \ No newline at end of file +var _0xc43b=['redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','update','options','where','attributes','limit','then','find','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b6327,_0x312e03){var _0x2511cf=function(_0x28b84d){while(--_0x28b84d){_0x2b6327['push'](_0x2b6327['shift']());}};_0x2511cf(++_0x312e03);}(_0xc43b,0x1c1));var _0xbc43=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc43b[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xbc43('0x0'));var util=require('util');var moment=require(_0xbc43('0x1'));var BPromise=require(_0xbc43('0x2'));var rs=require(_0xbc43('0x3'));var fs=require('fs');var Redis=require(_0xbc43('0x4'));var db=require(_0xbc43('0x5'))['db'];var utils=require(_0xbc43('0x6'));var logger=require(_0xbc43('0x7'))(_0xbc43('0x8'));var config=require(_0xbc43('0x9'));var jayson=require(_0xbc43('0xa'));var client=jayson[_0xbc43('0xb')][_0xbc43('0xc')]({'port':0x232a});config[_0xbc43('0xd')]=_[_0xbc43('0xe')](config[_0xbc43('0xd')],{'host':_0xbc43('0xf'),'port':0x18eb});var socket=require(_0xbc43('0x10'))(new Redis(config['redis']));require(_0xbc43('0x11'))[_0xbc43('0x12')](socket);function respondWithRpcPromise(_0x2fa773,_0x81f0c6,_0x3c7f7f){return new BPromise(function(_0x20ac31,_0x34f672){return client[_0xbc43('0x13')](_0x2fa773,_0x3c7f7f)['then'](function(_0x4205a0){logger[_0xbc43('0x14')](_0xbc43('0x15'),_0x81f0c6,'request\x20sent');logger[_0xbc43('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x81f0c6,'request\x20sent',JSON[_0xbc43('0x17')](_0x4205a0));if(_0x4205a0['error']){if(_0x4205a0[_0xbc43('0x18')][_0xbc43('0x19')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x81f0c6,_0x4205a0[_0xbc43('0x18')][_0xbc43('0x1a')]);return _0x34f672(_0x4205a0[_0xbc43('0x18')]['message']);}logger['error'](_0xbc43('0x15'),_0x81f0c6,_0x4205a0['error'][_0xbc43('0x1a')]);return _0x20ac31(_0x4205a0[_0xbc43('0x18')]['message']);}else{logger[_0xbc43('0x14')](_0xbc43('0x15'),_0x81f0c6,'request\x20sent');_0x20ac31(_0x4205a0[_0xbc43('0x1b')][_0xbc43('0x1a')]);}})[_0xbc43('0x1c')](function(_0x2de84b){logger['error'](_0xbc43('0x15'),_0x81f0c6,_0x2de84b);_0x34f672(_0x2de84b);});});}exports[_0xbc43('0x1d')]=function(_0x6a4c8b){var _0x5643cb=this;return new Promise(function(_0x1509bc,_0x11e191){return db['SmsInteraction'][_0xbc43('0x1e')](_0x6a4c8b['body'],{'raw':_0x6a4c8b[_0xbc43('0x1f')]?_0x6a4c8b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a4c8b[_0xbc43('0x1f')]?_0x6a4c8b[_0xbc43('0x1f')][_0xbc43('0x20')]||null:null,'attributes':_0x6a4c8b[_0xbc43('0x1f')]?_0x6a4c8b[_0xbc43('0x1f')][_0xbc43('0x21')]||null:null,'limit':_0x6a4c8b[_0xbc43('0x1f')]?_0x6a4c8b[_0xbc43('0x1f')][_0xbc43('0x22')]||null:null})[_0xbc43('0x23')](function(_0x26f69b){logger[_0xbc43('0x14')]('UpdateSmsInteraction',_0x6a4c8b);logger[_0xbc43('0x16')](_0xbc43('0x1d'),_0x6a4c8b,JSON[_0xbc43('0x17')](_0x26f69b));_0x1509bc(_0x26f69b);})['catch'](function(_0x55c1cb){logger[_0xbc43('0x18')]('UpdateSmsInteraction',_0x55c1cb[_0xbc43('0x1a')],_0x6a4c8b);_0x11e191(_0x5643cb[_0xbc43('0x18')](0x1f4,_0x55c1cb[_0xbc43('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x403746){return new Promise(function(_0x189afe,_0x3fedf3){return db['SmsInteraction'][_0xbc43('0x24')]({'where':_0x403746[_0xbc43('0x1f')]?_0x403746[_0xbc43('0x1f')][_0xbc43('0x20')]||null:null})[_0xbc43('0x23')](function(_0x43fe53){if(_0x43fe53){return _0x43fe53['addTags'](_0x403746[_0xbc43('0x25')][_0xbc43('0x26')],_[_0xbc43('0x27')](_0x403746[_0xbc43('0x25')],[_0xbc43('0x26'),'id'])||{});}})[_0xbc43('0x28')](function(_0x3b35c8){logger[_0xbc43('0x14')]('AddTags',_0x403746);logger['debug'](_0xbc43('0x29'),_0x403746,JSON[_0xbc43('0x17')](_0x3b35c8));_0x189afe(_0x3b35c8);})[_0xbc43('0x1c')](function(_0x121bc7){logger[_0xbc43('0x18')]('AddTags',_0x121bc7[_0xbc43('0x1a')],_0x403746);_0x3fedf3(_this[_0xbc43('0x18')](0x1f4,_0x121bc7[_0xbc43('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b1a7ee0..da9b632 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 _0xe776=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xe776,0xbd));var _0x6e77=function(_0x28d05d,_0x63c77d){_0x28d05d=_0x28d05d-0x0;var _0xc5acec=_0xe776[_0x28d05d];return _0xc5acec;};'use strict';var SmsInteractionEvents=require(_0x6e77('0x0'));var events=[_0x6e77('0x1'),_0x6e77('0x2'),'update'];function createListener(_0x1ee57e,_0x22c205){return function(_0x5783ea){_0x22c205[_0x6e77('0x3')](_0x1ee57e,_0x5783ea);};}function removeListener(_0x27da11,_0x3108c7){return function(){SmsInteractionEvents[_0x6e77('0x4')](_0x27da11,_0x3108c7);};}exports[_0x6e77('0x5')]=function(_0x5e86c2){for(var _0x224d62=0x0,_0x2562d7=events[_0x6e77('0x6')];_0x224d62<_0x2562d7;_0x224d62++){var _0x4c6b19=events[_0x224d62];var _0x42dad5=createListener(_0x6e77('0x7')+_0x4c6b19,_0x5e86c2);SmsInteractionEvents['on'](_0x4c6b19,_0x42dad5);}}; \ No newline at end of file +var _0x972e=['save','remove','update','emit','removeListener','smsInteraction:'];(function(_0x580daf,_0x32cc1a){var _0x538712=function(_0x37c631){while(--_0x37c631){_0x580daf['push'](_0x580daf['shift']());}};_0x538712(++_0x32cc1a);}(_0x972e,0x1a4));var _0xe972=function(_0x3188c0,_0x52ad72){_0x3188c0=_0x3188c0-0x0;var _0x3b5340=_0x972e[_0x3188c0];return _0x3b5340;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xe972('0x0'),_0xe972('0x1'),_0xe972('0x2')];function createListener(_0x43baae,_0x4b0fe5){return function(_0x33e8ec){_0x4b0fe5[_0xe972('0x3')](_0x43baae,_0x33e8ec);};}function removeListener(_0x1ccb61,_0x42c37f){return function(){SmsInteractionEvents[_0xe972('0x4')](_0x1ccb61,_0x42c37f);};}exports['register']=function(_0x4239a0){for(var _0x72333d=0x0,_0x44710d=events['length'];_0x72333d<_0x44710d;_0x72333d++){var _0x1bbf1a=events[_0x72333d];var _0x5a3913=createListener(_0xe972('0x5')+_0x1bbf1a,_0x4239a0);SmsInteractionEvents['on'](_0x1bbf1a,_0x5a3913);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 46b8eb5..f467210 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 _0x1724=['update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put'];(function(_0x550bfc,_0x4f6827){var _0xb224c7=function(_0x22d67f){while(--_0x22d67f){_0x550bfc['push'](_0x550bfc['shift']());}};_0xb224c7(++_0x4f6827);}(_0x1724,0xca));var _0x4172=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x1724[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require(_0x4172('0x0'));var util=require('util');var path=require(_0x4172('0x1'));var timeout=require(_0x4172('0x2'));var express=require(_0x4172('0x3'));var router=express['Router']();var fs_extra=require(_0x4172('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4172('0x5'));var config=require(_0x4172('0x6'));var controller=require(_0x4172('0x7'));router[_0x4172('0x8')]('/',auth[_0x4172('0x9')](),controller['index']);router[_0x4172('0x8')](_0x4172('0xa'),auth['isAuthenticated'](),controller[_0x4172('0xb')]);router[_0x4172('0x8')](_0x4172('0xc'),auth[_0x4172('0x9')](),controller[_0x4172('0xd')]);router[_0x4172('0xe')]('/',auth['isAuthenticated'](),interaction[_0x4172('0xf')](_0x4172('0x10'),_0x4172('0x11')),controller[_0x4172('0x12')]);router[_0x4172('0xe')](_0x4172('0x13'),controller[_0x4172('0x14')]);router[_0x4172('0x15')](_0x4172('0xc'),auth[_0x4172('0x9')](),controller[_0x4172('0x16')]);router[_0x4172('0x15')](_0x4172('0x17'),auth['isAuthenticated'](),controller['accept']);router[_0x4172('0x15')](_0x4172('0x18'),auth['isAuthenticated'](),controller[_0x4172('0x19')]);router[_0x4172('0x1a')](_0x4172('0xc'),auth[_0x4172('0x9')](),controller[_0x4172('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x5923=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','/:id','update','put','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0x5923,0x1d7));var _0x3592=function(_0x4c912e,_0x27299d){_0x4c912e=_0x4c912e-0x0;var _0x2fa424=_0x5923[_0x4c912e];return _0x2fa424;};'use strict';var multer=require(_0x3592('0x0'));var util=require(_0x3592('0x1'));var path=require(_0x3592('0x2'));var timeout=require(_0x3592('0x3'));var express=require(_0x3592('0x4'));var router=express[_0x3592('0x5')]();var fs_extra=require(_0x3592('0x6'));var auth=require(_0x3592('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3592('0x8'));var controller=require(_0x3592('0x9'));router[_0x3592('0xa')]('/',auth[_0x3592('0xb')](),controller['index']);router[_0x3592('0xa')](_0x3592('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x3592('0xa')]('/:id',auth[_0x3592('0xb')](),controller[_0x3592('0xd')]);router[_0x3592('0xe')]('/',auth[_0x3592('0xb')](),interaction[_0x3592('0xf')](_0x3592('0x10'),_0x3592('0x11')),controller[_0x3592('0x12')]);router[_0x3592('0xe')](_0x3592('0x13'),controller['status']);router['put'](_0x3592('0x14'),auth[_0x3592('0xb')](),controller[_0x3592('0x15')]);router[_0x3592('0x16')]('/:id/accept',auth[_0x3592('0xb')](),controller[_0x3592('0x17')]);router[_0x3592('0x16')](_0x3592('0x18'),auth[_0x3592('0xb')](),controller[_0x3592('0x19')]);router['delete'](_0x3592('0x14'),auth[_0x3592('0xb')](),controller[_0x3592('0x1a')]);module[_0x3592('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 62de3a1..cdae3f8 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 _0x1f1c=['medium','BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x1f1c,0x17d));var _0xc1f1=function(_0x138820,_0x1bd71c){_0x138820=_0x138820-0x0;var _0x35b229=_0x1f1c[_0x138820];return _0x35b229;};'use strict';var Sequelize=require(_0xc1f1('0x0'));module[_0xc1f1('0x1')]={'body':{'type':Sequelize[_0xc1f1('0x2')](_0xc1f1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc1f1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc1f1('0x5')),'defaultValue':_0xc1f1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc1f1('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc1f1('0x6')]},'readAt':{'type':Sequelize[_0xc1f1('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc1f1('0x6')]},'providerResponse':{'type':Sequelize[_0xc1f1('0x2')]}}; \ No newline at end of file +var _0x5deb=['BOOLEAN','TEXT','sequelize','exports','medium','ENUM','out','STRING'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0x5deb,0x82));var _0xb5de=function(_0x2c2d11,_0x4308ac){_0x2c2d11=_0x2c2d11-0x0;var _0x255f24=_0x5deb[_0x2c2d11];return _0x255f24;};'use strict';var Sequelize=require(_0xb5de('0x0'));module[_0xb5de('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb5de('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb5de('0x3')]('in',_0xb5de('0x4')),'defaultValue':_0xb5de('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb5de('0x5')](0xbe)},'phone':{'type':Sequelize[_0xb5de('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xb5de('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb5de('0x5')]},'providerResponse':{'type':Sequelize[_0xb5de('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1eabb1f..010f976 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 _0xdadc=['register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','end','stack','send','index','map','SmsMessage','rawAttributes','fieldName','key','name','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','UserId','user','agent','get','SmsInteraction','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x17f481,_0x5dc37c){var _0x15abfa=function(_0x401410){while(--_0x401410){_0x17f481['push'](_0x17f481['shift']());}};_0x15abfa(++_0x5dc37c);}(_0xdadc,0x75));var _0xcdad=function(_0x5e20b2,_0x207f61){_0x5e20b2=_0x5e20b2-0x0;var _0x59b650=_0xdadc[_0x5e20b2];return _0x59b650;};'use strict';var emlformat=require(_0xcdad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdad('0x1'));var rp=require(_0xcdad('0x2'));var moment=require(_0xcdad('0x3'));var BPromise=require(_0xcdad('0x4'));var Mustache=require(_0xcdad('0x5'));var util=require(_0xcdad('0x6'));var path=require(_0xcdad('0x7'));var sox=require('sox');var csv=require(_0xcdad('0x8'));var ejs=require(_0xcdad('0x9'));var fs=require('fs');var fs_extra=require(_0xcdad('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcdad('0xb'));var jsforce=require(_0xcdad('0xc'));var deskjs=require(_0xcdad('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcdad('0xe'));var Papa=require(_0xcdad('0xf'));var Redis=require(_0xcdad('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdad('0x11'));var logger=require(_0xcdad('0x12'))(_0xcdad('0x13'));var utils=require(_0xcdad('0x14'));var config=require(_0xcdad('0x15'));var licenseUtil=require(_0xcdad('0x16'));var db=require(_0xcdad('0x17'))['db'];config[_0xcdad('0x18')]=_['defaults'](config['redis'],{'host':_0xcdad('0x19'),'port':0x18eb});var socket=require(_0xcdad('0x1a'))(new Redis(config['redis']));require(_0xcdad('0x1b'))[_0xcdad('0x1c')](socket);var jayson=require(_0xcdad('0x1d'));var client=jayson[_0xcdad('0x1e')][_0xcdad('0x1f')]({'port':0x232c});var client9002=jayson[_0xcdad('0x1e')][_0xcdad('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x53eb63,_0x54b2fe,_0x541a28,_0x2b41b3){return new BPromise(function(_0x9be231,_0x494fb2){var _0x2ca866=_0x2b41b3||client;return _0x2ca866['request'](_0x53eb63,_0x541a28)[_0xcdad('0x20')](function(_0x3eb574){logger[_0xcdad('0x21')](_0xcdad('0x22'),_0x54b2fe,'request\x20sent');logger[_0xcdad('0x23')](_0xcdad('0x24'),_0x54b2fe,_0xcdad('0x25'),JSON[_0xcdad('0x26')](_0x3eb574));if(_0x3eb574[_0xcdad('0x27')]){if(_0x3eb574[_0xcdad('0x27')][_0xcdad('0x28')]===0x1f4){logger[_0xcdad('0x27')](_0xcdad('0x22'),_0x54b2fe,_0x3eb574[_0xcdad('0x27')]['message']);return _0x494fb2(_0x3eb574[_0xcdad('0x27')][_0xcdad('0x29')]);}logger[_0xcdad('0x27')](_0xcdad('0x22'),_0x54b2fe,_0x3eb574[_0xcdad('0x27')][_0xcdad('0x29')]);return _0x9be231(_0x3eb574['error'][_0xcdad('0x29')]);}else{logger['info'](_0xcdad('0x22'),_0x54b2fe,_0xcdad('0x25'));_0x9be231(_0x3eb574['result'][_0xcdad('0x29')]);}})[_0xcdad('0x2a')](function(_0x34661e){logger[_0xcdad('0x27')](_0xcdad('0x22'),_0x54b2fe,_0x34661e);_0x494fb2(_0x34661e);});});}function respondWithStatusCode(_0x5c3f70,_0x5aa0f5){_0x5aa0f5=_0x5aa0f5||0xcc;return function(_0x3a939b){if(_0x3a939b){return _0x5c3f70[_0xcdad('0x2b')](_0x5aa0f5);}return _0x5c3f70['status'](_0x5aa0f5)['end']();};}function respondWithResult(_0x3f1104,_0x3ff588){_0x3ff588=_0x3ff588||0xc8;return function(_0x126773){if(_0x126773){return _0x3f1104['status'](_0x3ff588)[_0xcdad('0x2c')](_0x126773);}};}function respondWithFilteredResult(_0x2be09c,_0x4f47b3){return function(_0x16dc0c){if(_0x16dc0c){var _0x285e42=typeof _0x4f47b3[_0xcdad('0x2d')]===_0xcdad('0x2e')&&typeof _0x4f47b3[_0xcdad('0x2f')]===_0xcdad('0x2e');var _0x139b7a=_0x16dc0c[_0xcdad('0x30')];var _0xa5c510=_0x285e42?0x0:_0x4f47b3['offset'];var _0x290609=_0x285e42?_0x16dc0c[_0xcdad('0x30')]:_0x4f47b3['offset']+_0x4f47b3['limit'];var _0x2ef52c;if(_0x290609>=_0x139b7a){_0x290609=_0x139b7a;_0x2ef52c=0xc8;}else{_0x2ef52c=0xce;}_0x2be09c[_0xcdad('0x31')](_0x2ef52c);return _0x2be09c[_0xcdad('0x32')]('Content-Range',_0xa5c510+'-'+_0x290609+'/'+_0x139b7a)[_0xcdad('0x2c')](_0x16dc0c);}return null;};}function patchUpdates(_0x1a177d){return function(_0x3dbb1a){try{jsonpatch[_0xcdad('0x33')](_0x3dbb1a,_0x1a177d,!![]);}catch(_0x59e465){return BPromise[_0xcdad('0x34')](_0x59e465);}return _0x3dbb1a[_0xcdad('0x35')]();};}function saveUpdates(_0x5aaf08,_0x54d9d8){return function(_0x15c00e){if(_0x15c00e){return _0x15c00e[_0xcdad('0x36')](_0x5aaf08)[_0xcdad('0x20')](function(_0x2ccd5d){return _0x2ccd5d;});}return null;};}function removeEntity(_0x5dcb6c,_0x514340){return function(_0x4c5483){if(_0x4c5483){return _0x4c5483[_0xcdad('0x37')]()[_0xcdad('0x20')](function(){_0x5dcb6c[_0xcdad('0x31')](0xcc)[_0xcdad('0x38')]();});}};}function handleEntityNotFound(_0x2847f7,_0x821a30){return function(_0x28ab33){if(!_0x28ab33){_0x2847f7['sendStatus'](0x194);}return _0x28ab33;};}function handleError(_0x1d5768,_0x2890c2){_0x2890c2=_0x2890c2||0x1f4;return function(_0x239f32){logger['error'](_0x239f32[_0xcdad('0x39')]);if(_0x239f32['name']){delete _0x239f32['name'];}_0x1d5768[_0xcdad('0x31')](_0x2890c2)[_0xcdad('0x3a')](_0x239f32);};}exports[_0xcdad('0x3b')]=function(_0x47caec,_0x415d17){var _0x16e1b1={},_0x48a46b={},_0x4ff815={'count':0x0,'rows':[]};var _0x51f6f0=_[_0xcdad('0x3c')](db[_0xcdad('0x3d')][_0xcdad('0x3e')],function(_0x39f3a1){return{'name':_0x39f3a1[_0xcdad('0x3f')],'type':_0x39f3a1['type'][_0xcdad('0x40')]};});_0x48a46b['model']=_[_0xcdad('0x3c')](_0x51f6f0,_0xcdad('0x41'));_0x48a46b['query']=_[_0xcdad('0x42')](_0x47caec[_0xcdad('0x43')]);_0x48a46b[_0xcdad('0x44')]=_[_0xcdad('0x45')](_0x48a46b[_0xcdad('0x46')],_0x48a46b[_0xcdad('0x43')]);_0x16e1b1[_0xcdad('0x47')]=_[_0xcdad('0x45')](_0x48a46b[_0xcdad('0x46')],qs[_0xcdad('0x48')](_0x47caec[_0xcdad('0x43')]['fields']));_0x16e1b1[_0xcdad('0x47')]=_0x16e1b1[_0xcdad('0x47')][_0xcdad('0x49')]?_0x16e1b1[_0xcdad('0x47')]:_0x48a46b[_0xcdad('0x46')];if(!_0x47caec[_0xcdad('0x43')]['hasOwnProperty']('nolimit')){_0x16e1b1[_0xcdad('0x2f')]=qs[_0xcdad('0x2f')](_0x47caec['query'][_0xcdad('0x2f')]);_0x16e1b1[_0xcdad('0x2d')]=qs[_0xcdad('0x2d')](_0x47caec[_0xcdad('0x43')][_0xcdad('0x2d')]);}_0x16e1b1[_0xcdad('0x4a')]=qs[_0xcdad('0x4b')](_0x47caec[_0xcdad('0x43')]['sort']);_0x16e1b1[_0xcdad('0x4c')]=qs['filters'](_[_0xcdad('0x4d')](_0x47caec[_0xcdad('0x43')],_0x48a46b[_0xcdad('0x44')]),_0x51f6f0);if(_0x47caec['query']['filter']){_0x16e1b1[_0xcdad('0x4c')]=_[_0xcdad('0x4e')](_0x16e1b1[_0xcdad('0x4c')],{'$or':_['map'](_0x51f6f0,function(_0x434e74){if(_0x434e74[_0xcdad('0x4f')]!==_0xcdad('0x50')){var _0x4254d5={};_0x4254d5[_0x434e74['name']]={'$like':'%'+_0x47caec[_0xcdad('0x43')][_0xcdad('0x51')]+'%'};return _0x4254d5;}})});}_0x16e1b1=_[_0xcdad('0x4e')]({},_0x16e1b1,_0x47caec[_0xcdad('0x52')]);var _0x5c119f={'where':_0x16e1b1[_0xcdad('0x4c')]};return db[_0xcdad('0x3d')][_0xcdad('0x30')](_0x5c119f)['then'](function(_0x1d29e8){_0x4ff815['count']=_0x1d29e8;if(_0x47caec[_0xcdad('0x43')]['includeAll']){_0x16e1b1['include']=[{'all':!![]}];}return db[_0xcdad('0x3d')]['findAll'](_0x16e1b1);})['then'](function(_0x1fc509){_0x4ff815[_0xcdad('0x53')]=_0x1fc509;return _0x4ff815;})[_0xcdad('0x20')](respondWithFilteredResult(_0x415d17,_0x16e1b1))[_0xcdad('0x2a')](handleError(_0x415d17,null));};exports[_0xcdad('0x54')]=function(_0x3dcf2b,_0x2d3e19){var _0x4452b2={'raw':!![],'where':{'id':_0x3dcf2b[_0xcdad('0x55')]['id']}},_0x4227d7={};_0x4227d7[_0xcdad('0x46')]=_['keys'](db[_0xcdad('0x3d')][_0xcdad('0x3e')]);_0x4227d7[_0xcdad('0x43')]=_['keys'](_0x3dcf2b[_0xcdad('0x43')]);_0x4227d7[_0xcdad('0x44')]=_['intersection'](_0x4227d7['model'],_0x4227d7[_0xcdad('0x43')]);_0x4452b2[_0xcdad('0x47')]=_[_0xcdad('0x45')](_0x4227d7[_0xcdad('0x46')],qs[_0xcdad('0x48')](_0x3dcf2b[_0xcdad('0x43')][_0xcdad('0x48')]));_0x4452b2[_0xcdad('0x47')]=_0x4452b2[_0xcdad('0x47')]['length']?_0x4452b2[_0xcdad('0x47')]:_0x4227d7[_0xcdad('0x46')];if(_0x3dcf2b['query']['includeAll']){_0x4452b2['include']=[{'all':!![]}];}_0x4452b2=_[_0xcdad('0x4e')]({},_0x4452b2,_0x3dcf2b['options']);return db[_0xcdad('0x3d')][_0xcdad('0x56')](_0x4452b2)['then'](handleEntityNotFound(_0x2d3e19,null))['then'](respondWithResult(_0x2d3e19,null))[_0xcdad('0x2a')](handleError(_0x2d3e19,null));};exports[_0xcdad('0x57')]=function(_0x3e02f5,_0xe0f5e5){return db[_0xcdad('0x3d')]['create'](_0x3e02f5[_0xcdad('0x58')],{})[_0xcdad('0x20')](respondWithResult(_0xe0f5e5,0xc9))[_0xcdad('0x2a')](handleError(_0xe0f5e5,null));};exports[_0xcdad('0x36')]=function(_0x390380,_0x323592){if(_0x390380[_0xcdad('0x58')]['id']){delete _0x390380['body']['id'];}return db[_0xcdad('0x3d')][_0xcdad('0x56')]({'where':{'id':_0x390380[_0xcdad('0x55')]['id']}})[_0xcdad('0x20')](handleEntityNotFound(_0x323592,null))['then'](saveUpdates(_0x390380[_0xcdad('0x58')],null))[_0xcdad('0x20')](respondWithResult(_0x323592,null))[_0xcdad('0x2a')](handleError(_0x323592,null));};exports[_0xcdad('0x37')]=function(_0x5a1f9d,_0x474cc4){return db[_0xcdad('0x3d')][_0xcdad('0x56')]({'where':{'id':_0x5a1f9d[_0xcdad('0x55')]['id']}})['then'](handleEntityNotFound(_0x474cc4,null))[_0xcdad('0x20')](removeEntity(_0x474cc4,null))[_0xcdad('0x2a')](handleError(_0x474cc4,null));};exports['describe']=function(_0x3cc571,_0x5c347d){return db[_0xcdad('0x3d')][_0xcdad('0x59')]()['then'](respondWithResult(_0x5c347d,null))[_0xcdad('0x2a')](handleError(_0x5c347d,null));};var interaction_log=require(_0xcdad('0x12'))(_0xcdad('0x5a'));exports[_0xcdad('0x5b')]=function(_0x121959,_0xa2e007,_0xf3f0ff){var _0x361ec9={'agent':{},'channel':_0xcdad('0x5c')};if(_0x121959[_0xcdad('0x58')]['id']){delete _0x121959[_0xcdad('0x58')]['id'];}_0x121959[_0xcdad('0x58')][_0xcdad('0x5d')]=!![];_0x121959[_0xcdad('0x58')][_0xcdad('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x121959[_0xcdad('0x58')][_0xcdad('0x5f')]=_0x121959[_0xcdad('0x58')]['UserId']||_0x121959[_0xcdad('0x60')]['id'];_0x361ec9[_0xcdad('0x61')]['id']=_0x121959[_0xcdad('0x58')][_0xcdad('0x5f')];return db[_0xcdad('0x3d')][_0xcdad('0x56')]({'where':{'id':_0x121959[_0xcdad('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xa2e007,null))[_0xcdad('0x20')](saveUpdates(_0x121959[_0xcdad('0x58')],null))[_0xcdad('0x20')](function(_0x393207){if(_0x393207){_0x361ec9['message']=_0x393207[_0xcdad('0x62')]({'plain':!![]});return db[_0xcdad('0x63')][_0xcdad('0x56')]({'where':{'id':_0x393207[_0xcdad('0x64')]}});}return null;})[_0xcdad('0x20')](handleEntityNotFound(_0xa2e007,null))[_0xcdad('0x20')](function(_0x403cbd){if(_0x403cbd){return _0x403cbd[_0xcdad('0x36')]({'UserId':_0x121959[_0xcdad('0x58')]['UserId'],'read1stAt':_['isNil'](_0x403cbd['read1stAt'])?moment()[_0xcdad('0x65')](_0xcdad('0x66')):undefined});}return null;})[_0xcdad('0x20')](function(_0x1b42c0){if(_0x1b42c0){_0x361ec9[_0xcdad('0x67')]=_0x1b42c0[_0xcdad('0x62')]({'plain':!![]});interaction_log[_0xcdad('0x21')](_0xcdad('0x68'),_0x121959[_0xcdad('0x60')]['id'],_0x121959[_0xcdad('0x60')][_0xcdad('0x41')],_0x121959[_0xcdad('0x60')][_0xcdad('0x69')],_0x361ec9[_0xcdad('0x67')]['id'],_0x121959['body']?JSON['stringify'](_0x121959[_0xcdad('0x58')]):_0xcdad('0x6a'));return respondWithRpcPromise(_0xcdad('0x6b'),'acceptMessage',_0x361ec9);}return null;})[_0xcdad('0x20')](function(_0x3f641b){var _0x23dbb7=_0xcdad('0x6c')+_0x3f641b[_0xcdad('0x29')][_0xcdad('0x6d')];return db[_0xcdad('0x6e')][_0xcdad('0x43')](_0x23dbb7,{'type':db[_0xcdad('0x6f')]['QueryTypes'][_0xcdad('0x70')],'raw':!![]})['then'](function(_0x2cb93f){return _0x2cb93f;});})[_0xcdad('0x20')](function(_0x292c89){if(_0x292c89){_0x361ec9[_0xcdad('0x29')][_0xcdad('0x71')]=_0x292c89[0x0];if(!_0x121959[_0xcdad('0x58')]['UserId'])return;return db[_0xcdad('0x72')][_0xcdad('0x56')]({'where':{'id':_0x121959[_0xcdad('0x58')]['UserId'],'role':_0xcdad('0x61')},'attributes':['id',_0xcdad('0x41'),'fullname',_0xcdad('0x73'),'internal'],'raw':!![]});}return null;})[_0xcdad('0x20')](function(_0x2069ae){if(!_0x2069ae)return null;_0x361ec9['message'][_0xcdad('0x61')]=_0x2069ae;return _0x361ec9;})[_0xcdad('0x20')](function(_0x2c6a0d){if(_0x2c6a0d){if(_0x121959[_0xcdad('0x58')]['manual']){_0x361ec9[_0xcdad('0x29')][_0xcdad('0x74')]=util[_0xcdad('0x65')](_0xcdad('0x75'),_0x121959[_0xcdad('0x60')][_0xcdad('0x41')]);_0x361ec9[_0xcdad('0x29')][_0xcdad('0x76')]=_0x361ec9[_0xcdad('0x76')];_0x361ec9[_0xcdad('0x29')][_0xcdad('0x77')]=_0x361ec9[_0xcdad('0x76')];_0x361ec9[_0xcdad('0x29')][_0xcdad('0x78')]=_0xcdad('0x5b');return respondWithRpcPromise(_0xcdad('0x79'),_0xcdad('0x79'),{'event':_0xcdad('0x7a'),'message':_0x361ec9[_0xcdad('0x29')]},client9002)[_0xcdad('0x20')](function(){return _0x361ec9;});}return _0x361ec9;}return null;})[_0xcdad('0x20')](respondWithResult(_0xa2e007,null))['catch'](handleError(_0xa2e007,null));};var interaction_log=require('../../config/logger')(_0xcdad('0x5a'));exports[_0xcdad('0x34')]=function(_0x45aebc,_0x586fa8,_0x2083d9){var _0x4be4a7={'agent':{},'channel':'sms'};if(_0x45aebc[_0xcdad('0x58')]['id']){delete _0x45aebc[_0xcdad('0x58')]['id'];}_0x45aebc[_0xcdad('0x58')][_0xcdad('0x5f')]=_0x45aebc[_0xcdad('0x58')][_0xcdad('0x5f')]||_0x45aebc['user']['id'];_0x4be4a7[_0xcdad('0x61')]['id']=_0x45aebc['body'][_0xcdad('0x5f')];return db[_0xcdad('0x3d')][_0xcdad('0x56')]({'where':{'id':_0x45aebc[_0xcdad('0x55')]['id'],'UserId':null}})[_0xcdad('0x20')](handleEntityNotFound(_0x586fa8,null))[_0xcdad('0x20')](function(_0x3ba0b5){if(_0x3ba0b5){_0x4be4a7['message']=_0x3ba0b5[_0xcdad('0x62')]({'plain':!![]});return db[_0xcdad('0x63')]['find']({'where':{'id':_0x3ba0b5[_0xcdad('0x64')]}});}return null;})[_0xcdad('0x20')](handleEntityNotFound(_0x586fa8,null))[_0xcdad('0x20')](function(_0x54ecf3){if(_0x54ecf3){_0x4be4a7[_0xcdad('0x67')]=_0x54ecf3[_0xcdad('0x62')]({'plain':!![]});interaction_log['info'](_0xcdad('0x7b'),_0x45aebc[_0xcdad('0x60')]['id'],_0x45aebc[_0xcdad('0x60')][_0xcdad('0x41')],_0x45aebc[_0xcdad('0x60')][_0xcdad('0x69')],_0x4be4a7[_0xcdad('0x67')]['id'],_0x45aebc[_0xcdad('0x58')]?JSON[_0xcdad('0x26')](_0x45aebc['body']):'null');return respondWithRpcPromise(_0xcdad('0x7c'),_0xcdad('0x7d'),_0x4be4a7);}return null;})[_0xcdad('0x20')](function(_0x371f29){var _0x57013d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x371f29['message'][_0xcdad('0x6d')];return db[_0xcdad('0x6e')][_0xcdad('0x43')](_0x57013d,{'type':db[_0xcdad('0x6f')]['QueryTypes'][_0xcdad('0x70')],'raw':!![]})[_0xcdad('0x20')](function(_0x5f1129){return _0x5f1129;});})[_0xcdad('0x20')](function(_0x44799b){if(_0x44799b){_0x4be4a7[_0xcdad('0x29')][_0xcdad('0x71')]=_0x44799b[0x0];if(!_0x45aebc[_0xcdad('0x58')][_0xcdad('0x5f')])return;return db[_0xcdad('0x72')]['find']({'where':{'id':_0x45aebc['body'][_0xcdad('0x5f')],'role':_0xcdad('0x61')},'attributes':['id',_0xcdad('0x41'),'fullname',_0xcdad('0x73'),_0xcdad('0x7e')],'raw':!![]});}return null;})[_0xcdad('0x20')](function(_0x15d81b){if(!_0x15d81b)return null;_0x4be4a7[_0xcdad('0x29')]['agent']=_0x15d81b;return _0x4be4a7;})[_0xcdad('0x20')](function(_0x22e305){if(_0x22e305){_0x22e305[_0xcdad('0x29')][_0xcdad('0x74')]=util[_0xcdad('0x65')](_0xcdad('0x75'),_0x45aebc[_0xcdad('0x60')][_0xcdad('0x41')]);_0x22e305[_0xcdad('0x29')][_0xcdad('0x76')]=_0x4be4a7[_0xcdad('0x76')];_0x22e305[_0xcdad('0x29')][_0xcdad('0x77')]=_0x4be4a7[_0xcdad('0x76')];_0x22e305[_0xcdad('0x29')][_0xcdad('0x78')]='reject';respondWithRpcPromise(_0xcdad('0x79'),_0xcdad('0x79'),{'event':_0xcdad('0x7f'),'message':_0x22e305[_0xcdad('0x29')]},client9002);return _0x4be4a7;}return null;})[_0xcdad('0x20')](respondWithResult(_0x586fa8,null))['catch'](handleError(_0x586fa8,null));};exports[_0xcdad('0x31')]=function(_0x204211,_0x50b752,_0x2802ba){if(_0x204211[_0xcdad('0x58')]['id']){delete _0x204211[_0xcdad('0x58')]['id'];}var _0x251ff3;return db[_0xcdad('0x3d')][_0xcdad('0x56')]({'where':{'id':_0x204211['params']['id']}})[_0xcdad('0x20')](handleEntityNotFound(_0x50b752,null))[_0xcdad('0x20')](function(_0x235232){if(_0x235232){_0x251ff3=_0x235232;return db[_0xcdad('0x80')][_0xcdad('0x56')]({'where':{'id':_0x235232[_0xcdad('0x81')]}});}})[_0xcdad('0x20')](handleEntityNotFound(_0x50b752,null))[_0xcdad('0x20')](function(_0x235990){if(_0x235990){logger[_0xcdad('0x23')](_0xcdad('0x24'),'status',_0xcdad('0x82'),_0x235990[_0xcdad('0x4f')],util[_0xcdad('0x83')](_0x204211[_0xcdad('0x58')],{'showHidden':![],'depth':null}));switch(_0x235990[_0xcdad('0x4f')]){case _0xcdad('0x84'):if(_0x204211[_0xcdad('0x58')]['MessageSid']&&_0x204211[_0xcdad('0x58')][_0xcdad('0x85')]===_0x251ff3[_0xcdad('0x86')]){return _0x251ff3[_0xcdad('0x36')]({'read':!![]});}else{logger[_0xcdad('0x27')](_0xcdad('0x87'),_0xcdad('0x31'),_0xcdad('0x84'),util[_0xcdad('0x83')](_0x204211[_0xcdad('0x58')],{'showHidden':![],'depth':null}));}break;case _0xcdad('0x88'):if(_0x204211[_0xcdad('0x58')][_0xcdad('0x89')]&&_0x204211[_0xcdad('0x58')]['MessageUUID']===_0x251ff3[_0xcdad('0x86')]&&_['indexOf']([_0xcdad('0x8a'),'delivered'],_0x204211['body'][_0xcdad('0x8b')])>=0x0){return _0x251ff3[_0xcdad('0x36')]({'read':!![]});}else{logger['error'](_0xcdad('0x87'),_0xcdad('0x31'),_0xcdad('0x8c'),util['inspect'](_0x204211['body'],{'showHidden':![],'depth':null}));}break;case _0xcdad('0x8d'):var _0xc3debf=_0x204211[_0xcdad('0x58')][_0xcdad('0x8e')][0x0];if(_0xc3debf[_0xcdad('0x31')][_0xcdad('0x8f')]===_0xcdad('0x90')){return _0x251ff3['update']({'read':!![]});}else{logger[_0xcdad('0x27')](_0xcdad('0x87'),_0xcdad('0x31'),_0xcdad('0x8d'),util[_0xcdad('0x83')](_0x204211['body'],{'showHidden':![],'depth':null}));}break;}return _0x251ff3;}})[_0xcdad('0x20')](respondWithResult(_0x50b752,null))[_0xcdad('0x2a')](handleError(_0x50b752,null));}; \ No newline at end of file +var _0x627e=['readAt','format','UserId','user','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','fullname','email','agent','interface','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','sequelize','Sequelize','contact','internal','SIP/%s','channel','reject','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','update','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','length','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','fields','find','create','body','describe','sms-interactions','accept','sms'];(function(_0x36e0c2,_0x1e76fd){var _0x2561b2=function(_0x257847){while(--_0x257847){_0x36e0c2['push'](_0x36e0c2['shift']());}};_0x2561b2(++_0x1e76fd);}(_0x627e,0x14a));var _0xe627=function(_0x12ba86,_0x730899){_0x12ba86=_0x12ba86-0x0;var _0x12aa18=_0x627e[_0x12ba86];return _0x12aa18;};'use strict';var emlformat=require(_0xe627('0x0'));var rimraf=require(_0xe627('0x1'));var zipdir=require(_0xe627('0x2'));var jsonpatch=require(_0xe627('0x3'));var rp=require(_0xe627('0x4'));var moment=require('moment');var BPromise=require(_0xe627('0x5'));var Mustache=require(_0xe627('0x6'));var util=require(_0xe627('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe627('0x8'));var fs=require('fs');var fs_extra=require(_0xe627('0x9'));var _=require(_0xe627('0xa'));var squel=require(_0xe627('0xb'));var crypto=require(_0xe627('0xc'));var jsforce=require(_0xe627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe627('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe627('0xf'));var authService=require(_0xe627('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe627('0x11'));var logger=require(_0xe627('0x12'))(_0xe627('0x13'));var utils=require(_0xe627('0x14'));var config=require(_0xe627('0x15'));var licenseUtil=require(_0xe627('0x16'));var db=require(_0xe627('0x17'))['db'];config[_0xe627('0x18')]=_[_0xe627('0x19')](config['redis'],{'host':_0xe627('0x1a'),'port':0x18eb});var socket=require(_0xe627('0x1b'))(new Redis(config[_0xe627('0x18')]));require('./smsMessage.socket')[_0xe627('0x1c')](socket);var jayson=require(_0xe627('0x1d'));var client=jayson[_0xe627('0x1e')][_0xe627('0x1f')]({'port':0x232c});var client9002=jayson[_0xe627('0x1e')][_0xe627('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x271325,_0x54720a,_0x241544,_0x29b41c){return new BPromise(function(_0x16c2d7,_0x76fac){var _0x403982=_0x29b41c||client;return _0x403982[_0xe627('0x20')](_0x271325,_0x241544)[_0xe627('0x21')](function(_0x2fe46a){logger['info'](_0xe627('0x22'),_0x54720a,'request\x20sent');logger[_0xe627('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x54720a,'request\x20sent',JSON[_0xe627('0x24')](_0x2fe46a));if(_0x2fe46a['error']){if(_0x2fe46a[_0xe627('0x25')][_0xe627('0x26')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x54720a,_0x2fe46a['error'][_0xe627('0x27')]);return _0x76fac(_0x2fe46a[_0xe627('0x25')]['message']);}logger[_0xe627('0x25')](_0xe627('0x22'),_0x54720a,_0x2fe46a['error'][_0xe627('0x27')]);return _0x16c2d7(_0x2fe46a[_0xe627('0x25')]['message']);}else{logger[_0xe627('0x28')](_0xe627('0x22'),_0x54720a,_0xe627('0x29'));_0x16c2d7(_0x2fe46a['result'][_0xe627('0x27')]);}})[_0xe627('0x2a')](function(_0x1a5081){logger[_0xe627('0x25')]('SmsMessage,\x20%s,\x20%s',_0x54720a,_0x1a5081);_0x76fac(_0x1a5081);});});}function respondWithStatusCode(_0x35cd34,_0x1fe192){_0x1fe192=_0x1fe192||0xcc;return function(_0x1635a0){if(_0x1635a0){return _0x35cd34[_0xe627('0x2b')](_0x1fe192);}return _0x35cd34[_0xe627('0x2c')](_0x1fe192)[_0xe627('0x2d')]();};}function respondWithResult(_0x45c694,_0x44c9f7){_0x44c9f7=_0x44c9f7||0xc8;return function(_0x3e9eda){if(_0x3e9eda){return _0x45c694['status'](_0x44c9f7)[_0xe627('0x2e')](_0x3e9eda);}};}function respondWithFilteredResult(_0x5aeba1,_0x5cd7c8){return function(_0x1e0bd7){if(_0x1e0bd7){var _0xdf63c8=typeof _0x5cd7c8['offset']===_0xe627('0x2f')&&typeof _0x5cd7c8['limit']===_0xe627('0x2f');var _0x498e1f=_0x1e0bd7[_0xe627('0x30')];var _0x26833a=_0xdf63c8?0x0:_0x5cd7c8['offset'];var _0x33e9dd=_0xdf63c8?_0x1e0bd7['count']:_0x5cd7c8[_0xe627('0x31')]+_0x5cd7c8[_0xe627('0x32')];var _0x251606;if(_0x33e9dd>=_0x498e1f){_0x33e9dd=_0x498e1f;_0x251606=0xc8;}else{_0x251606=0xce;}_0x5aeba1[_0xe627('0x2c')](_0x251606);return _0x5aeba1[_0xe627('0x33')](_0xe627('0x34'),_0x26833a+'-'+_0x33e9dd+'/'+_0x498e1f)[_0xe627('0x2e')](_0x1e0bd7);}return null;};}function patchUpdates(_0x3ece9e){return function(_0x11ccbd){try{jsonpatch[_0xe627('0x35')](_0x11ccbd,_0x3ece9e,!![]);}catch(_0x12ebc9){return BPromise['reject'](_0x12ebc9);}return _0x11ccbd['save']();};}function saveUpdates(_0x183fed,_0x52517b){return function(_0x1f1b53){if(_0x1f1b53){return _0x1f1b53['update'](_0x183fed)['then'](function(_0x422451){return _0x422451;});}return null;};}function removeEntity(_0x5cd337,_0x566161){return function(_0x103c0b){if(_0x103c0b){return _0x103c0b[_0xe627('0x36')]()[_0xe627('0x21')](function(){_0x5cd337['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x580c0b,_0x2ff49c){return function(_0x4c746b){if(!_0x4c746b){_0x580c0b[_0xe627('0x2b')](0x194);}return _0x4c746b;};}function handleError(_0x4089ad,_0x5e4512){_0x5e4512=_0x5e4512||0x1f4;return function(_0x3d26ca){logger[_0xe627('0x25')](_0x3d26ca['stack']);if(_0x3d26ca[_0xe627('0x37')]){delete _0x3d26ca[_0xe627('0x37')];}_0x4089ad[_0xe627('0x2c')](_0x5e4512)[_0xe627('0x38')](_0x3d26ca);};}exports[_0xe627('0x39')]=function(_0x28fd59,_0x54ffa0){var _0x16b547={},_0x5ba53f={},_0x26afc2={'count':0x0,'rows':[]};var _0x4eb44c=_[_0xe627('0x3a')](db[_0xe627('0x3b')][_0xe627('0x3c')],function(_0x21a533){return{'name':_0x21a533[_0xe627('0x3d')],'type':_0x21a533[_0xe627('0x3e')][_0xe627('0x3f')]};});_0x5ba53f[_0xe627('0x40')]=_[_0xe627('0x3a')](_0x4eb44c,_0xe627('0x37'));_0x5ba53f[_0xe627('0x41')]=_[_0xe627('0x42')](_0x28fd59[_0xe627('0x41')]);_0x5ba53f['filters']=_['intersection'](_0x5ba53f['model'],_0x5ba53f['query']);_0x16b547['attributes']=_['intersection'](_0x5ba53f[_0xe627('0x40')],qs['fields'](_0x28fd59[_0xe627('0x41')]['fields']));_0x16b547[_0xe627('0x43')]=_0x16b547[_0xe627('0x43')][_0xe627('0x44')]?_0x16b547['attributes']:_0x5ba53f['model'];if(!_0x28fd59[_0xe627('0x41')]['hasOwnProperty']('nolimit')){_0x16b547[_0xe627('0x32')]=qs['limit'](_0x28fd59[_0xe627('0x41')]['limit']);_0x16b547['offset']=qs[_0xe627('0x31')](_0x28fd59[_0xe627('0x41')][_0xe627('0x31')]);}_0x16b547['order']=qs['sort'](_0x28fd59[_0xe627('0x41')]['sort']);_0x16b547['where']=qs[_0xe627('0x45')](_[_0xe627('0x46')](_0x28fd59[_0xe627('0x41')],_0x5ba53f[_0xe627('0x45')]),_0x4eb44c);if(_0x28fd59[_0xe627('0x41')][_0xe627('0x47')]){_0x16b547['where']=_[_0xe627('0x48')](_0x16b547[_0xe627('0x49')],{'$or':_['map'](_0x4eb44c,function(_0x5d08e9){if(_0x5d08e9[_0xe627('0x3e')]!==_0xe627('0x4a')){var _0x1f6ee5={};_0x1f6ee5[_0x5d08e9[_0xe627('0x37')]]={'$like':'%'+_0x28fd59[_0xe627('0x41')][_0xe627('0x47')]+'%'};return _0x1f6ee5;}})});}_0x16b547=_[_0xe627('0x48')]({},_0x16b547,_0x28fd59['options']);var _0x97c5bf={'where':_0x16b547['where']};return db[_0xe627('0x3b')][_0xe627('0x30')](_0x97c5bf)[_0xe627('0x21')](function(_0x4c5185){_0x26afc2[_0xe627('0x30')]=_0x4c5185;if(_0x28fd59['query'][_0xe627('0x4b')]){_0x16b547[_0xe627('0x4c')]=[{'all':!![]}];}return db[_0xe627('0x3b')][_0xe627('0x4d')](_0x16b547);})[_0xe627('0x21')](function(_0x5b52a4){_0x26afc2[_0xe627('0x4e')]=_0x5b52a4;return _0x26afc2;})[_0xe627('0x21')](respondWithFilteredResult(_0x54ffa0,_0x16b547))[_0xe627('0x2a')](handleError(_0x54ffa0,null));};exports[_0xe627('0x4f')]=function(_0x2d6417,_0x148eec){var _0x831df6={'raw':!![],'where':{'id':_0x2d6417[_0xe627('0x50')]['id']}},_0x97171f={};_0x97171f[_0xe627('0x40')]=_['keys'](db[_0xe627('0x3b')][_0xe627('0x3c')]);_0x97171f['query']=_[_0xe627('0x42')](_0x2d6417[_0xe627('0x41')]);_0x97171f['filters']=_[_0xe627('0x51')](_0x97171f[_0xe627('0x40')],_0x97171f['query']);_0x831df6[_0xe627('0x43')]=_[_0xe627('0x51')](_0x97171f['model'],qs[_0xe627('0x52')](_0x2d6417['query']['fields']));_0x831df6['attributes']=_0x831df6['attributes']['length']?_0x831df6[_0xe627('0x43')]:_0x97171f[_0xe627('0x40')];if(_0x2d6417[_0xe627('0x41')][_0xe627('0x4b')]){_0x831df6[_0xe627('0x4c')]=[{'all':!![]}];}_0x831df6=_[_0xe627('0x48')]({},_0x831df6,_0x2d6417['options']);return db[_0xe627('0x3b')][_0xe627('0x53')](_0x831df6)['then'](handleEntityNotFound(_0x148eec,null))['then'](respondWithResult(_0x148eec,null))['catch'](handleError(_0x148eec,null));};exports[_0xe627('0x54')]=function(_0x324b0b,_0x2aead5){return db[_0xe627('0x3b')][_0xe627('0x54')](_0x324b0b[_0xe627('0x55')],{})[_0xe627('0x21')](respondWithResult(_0x2aead5,0xc9))[_0xe627('0x2a')](handleError(_0x2aead5,null));};exports['update']=function(_0x1b1c5a,_0x49649a){if(_0x1b1c5a[_0xe627('0x55')]['id']){delete _0x1b1c5a['body']['id'];}return db[_0xe627('0x3b')][_0xe627('0x53')]({'where':{'id':_0x1b1c5a[_0xe627('0x50')]['id']}})[_0xe627('0x21')](handleEntityNotFound(_0x49649a,null))[_0xe627('0x21')](saveUpdates(_0x1b1c5a[_0xe627('0x55')],null))[_0xe627('0x21')](respondWithResult(_0x49649a,null))[_0xe627('0x2a')](handleError(_0x49649a,null));};exports[_0xe627('0x36')]=function(_0x480ac3,_0xe4c06d){return db[_0xe627('0x3b')][_0xe627('0x53')]({'where':{'id':_0x480ac3[_0xe627('0x50')]['id']}})[_0xe627('0x21')](handleEntityNotFound(_0xe4c06d,null))['then'](removeEntity(_0xe4c06d,null))['catch'](handleError(_0xe4c06d,null));};exports[_0xe627('0x56')]=function(_0x2e787e,_0x5f3fb9){return db[_0xe627('0x3b')][_0xe627('0x56')]()[_0xe627('0x21')](respondWithResult(_0x5f3fb9,null))[_0xe627('0x2a')](handleError(_0x5f3fb9,null));};var interaction_log=require(_0xe627('0x12'))(_0xe627('0x57'));exports[_0xe627('0x58')]=function(_0x25dccf,_0x4bc086,_0x26e6a3){var _0x4f5595={'agent':{},'channel':_0xe627('0x59')};if(_0x25dccf[_0xe627('0x55')]['id']){delete _0x25dccf[_0xe627('0x55')]['id'];}_0x25dccf[_0xe627('0x55')]['read']=!![];_0x25dccf['body'][_0xe627('0x5a')]=moment()[_0xe627('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x25dccf[_0xe627('0x55')][_0xe627('0x5c')]=_0x25dccf['body'][_0xe627('0x5c')]||_0x25dccf[_0xe627('0x5d')]['id'];_0x4f5595['agent']['id']=_0x25dccf['body'][_0xe627('0x5c')];return db['SmsMessage'][_0xe627('0x53')]({'where':{'id':_0x25dccf[_0xe627('0x50')]['id'],'UserId':null}})[_0xe627('0x21')](handleEntityNotFound(_0x4bc086,null))['then'](saveUpdates(_0x25dccf[_0xe627('0x55')],null))[_0xe627('0x21')](function(_0x38384f){if(_0x38384f){_0x4f5595[_0xe627('0x27')]=_0x38384f['get']({'plain':!![]});return db['SmsInteraction'][_0xe627('0x53')]({'where':{'id':_0x38384f[_0xe627('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x4bc086,null))[_0xe627('0x21')](function(_0x48236e){if(_0x48236e){return _0x48236e['update']({'UserId':_0x25dccf[_0xe627('0x55')][_0xe627('0x5c')],'read1stAt':_['isNil'](_0x48236e['read1stAt'])?moment()[_0xe627('0x5b')](_0xe627('0x5f')):undefined});}return null;})[_0xe627('0x21')](function(_0x1bd300){if(_0x1bd300){_0x4f5595[_0xe627('0x60')]=_0x1bd300[_0xe627('0x61')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25dccf['user']['id'],_0x25dccf[_0xe627('0x5d')][_0xe627('0x37')],_0x25dccf['user'][_0xe627('0x62')],_0x4f5595[_0xe627('0x60')]['id'],_0x25dccf[_0xe627('0x55')]?JSON[_0xe627('0x24')](_0x25dccf['body']):_0xe627('0x63'));return respondWithRpcPromise(_0xe627('0x64'),_0xe627('0x65'),_0x4f5595);}return null;})[_0xe627('0x21')](function(_0x574837){var _0x36b75a=_0xe627('0x66')+_0x574837[_0xe627('0x27')]['ContactId'];return db['sequelize']['query'](_0x36b75a,{'type':db['Sequelize']['QueryTypes'][_0xe627('0x67')],'raw':!![]})[_0xe627('0x21')](function(_0x31b03b){return _0x31b03b;});})[_0xe627('0x21')](function(_0x43949a){if(_0x43949a){_0x4f5595[_0xe627('0x27')]['contact']=_0x43949a[0x0];if(!_0x25dccf[_0xe627('0x55')][_0xe627('0x5c')])return;return db[_0xe627('0x68')][_0xe627('0x53')]({'where':{'id':_0x25dccf[_0xe627('0x55')]['UserId'],'role':'agent'},'attributes':['id','name',_0xe627('0x69'),_0xe627('0x6a'),'internal'],'raw':!![]});}return null;})[_0xe627('0x21')](function(_0x1ab1f8){if(!_0x1ab1f8)return null;_0x4f5595[_0xe627('0x27')][_0xe627('0x6b')]=_0x1ab1f8;return _0x4f5595;})['then'](function(_0x4a1bf0){if(_0x4a1bf0){if(_0x25dccf[_0xe627('0x55')]['manual']){_0x4f5595[_0xe627('0x27')][_0xe627('0x6c')]=util[_0xe627('0x5b')]('SIP/%s',_0x25dccf['user'][_0xe627('0x37')]);_0x4f5595['message']['channel']=_0x4f5595['channel'];_0x4f5595[_0xe627('0x27')][_0xe627('0x6d')]=_0x4f5595['channel'];_0x4f5595[_0xe627('0x27')][_0xe627('0x6e')]='accept';return respondWithRpcPromise(_0xe627('0x6f'),_0xe627('0x6f'),{'event':_0xe627('0x70'),'message':_0x4f5595[_0xe627('0x27')]},client9002)[_0xe627('0x21')](function(){return _0x4f5595;});}return _0x4f5595;}return null;})[_0xe627('0x21')](respondWithResult(_0x4bc086,null))['catch'](handleError(_0x4bc086,null));};var interaction_log=require(_0xe627('0x12'))(_0xe627('0x57'));exports['reject']=function(_0x14459f,_0x9d4335,_0x4e477e){var _0x2a5757={'agent':{},'channel':_0xe627('0x59')};if(_0x14459f[_0xe627('0x55')]['id']){delete _0x14459f['body']['id'];}_0x14459f['body'][_0xe627('0x5c')]=_0x14459f[_0xe627('0x55')][_0xe627('0x5c')]||_0x14459f[_0xe627('0x5d')]['id'];_0x2a5757[_0xe627('0x6b')]['id']=_0x14459f[_0xe627('0x55')][_0xe627('0x5c')];return db[_0xe627('0x3b')][_0xe627('0x53')]({'where':{'id':_0x14459f[_0xe627('0x50')]['id'],'UserId':null}})[_0xe627('0x21')](handleEntityNotFound(_0x9d4335,null))['then'](function(_0x451973){if(_0x451973){_0x2a5757[_0xe627('0x27')]=_0x451973[_0xe627('0x61')]({'plain':!![]});return db[_0xe627('0x71')][_0xe627('0x53')]({'where':{'id':_0x451973[_0xe627('0x5e')]}});}return null;})[_0xe627('0x21')](handleEntityNotFound(_0x9d4335,null))['then'](function(_0xced854){if(_0xced854){_0x2a5757[_0xe627('0x60')]=_0xced854[_0xe627('0x61')]({'plain':!![]});interaction_log['info'](_0xe627('0x72'),_0x14459f['user']['id'],_0x14459f['user'][_0xe627('0x37')],_0x14459f[_0xe627('0x5d')][_0xe627('0x62')],_0x2a5757['interaction']['id'],_0x14459f[_0xe627('0x55')]?JSON[_0xe627('0x24')](_0x14459f['body']):_0xe627('0x63'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2a5757);}return null;})[_0xe627('0x21')](function(_0x1df7d7){var _0x3ae47b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1df7d7[_0xe627('0x27')][_0xe627('0x73')];return db[_0xe627('0x74')][_0xe627('0x41')](_0x3ae47b,{'type':db[_0xe627('0x75')]['QueryTypes'][_0xe627('0x67')],'raw':!![]})[_0xe627('0x21')](function(_0x385fff){return _0x385fff;});})[_0xe627('0x21')](function(_0x4658b4){if(_0x4658b4){_0x2a5757[_0xe627('0x27')][_0xe627('0x76')]=_0x4658b4[0x0];if(!_0x14459f[_0xe627('0x55')][_0xe627('0x5c')])return;return db[_0xe627('0x68')]['find']({'where':{'id':_0x14459f['body'][_0xe627('0x5c')],'role':_0xe627('0x6b')},'attributes':['id','name',_0xe627('0x69'),_0xe627('0x6a'),_0xe627('0x77')],'raw':!![]});}return null;})[_0xe627('0x21')](function(_0x2dbd02){if(!_0x2dbd02)return null;_0x2a5757[_0xe627('0x27')][_0xe627('0x6b')]=_0x2dbd02;return _0x2a5757;})[_0xe627('0x21')](function(_0x2b1e02){if(_0x2b1e02){_0x2b1e02[_0xe627('0x27')][_0xe627('0x6c')]=util[_0xe627('0x5b')](_0xe627('0x78'),_0x14459f['user'][_0xe627('0x37')]);_0x2b1e02[_0xe627('0x27')][_0xe627('0x79')]=_0x2a5757['channel'];_0x2b1e02['message'][_0xe627('0x6d')]=_0x2a5757['channel'];_0x2b1e02[_0xe627('0x27')][_0xe627('0x6e')]=_0xe627('0x7a');respondWithRpcPromise('EventManager',_0xe627('0x6f'),{'event':'rejectmessage','message':_0x2b1e02[_0xe627('0x27')]},client9002);return _0x2a5757;}return null;})[_0xe627('0x21')](respondWithResult(_0x9d4335,null))[_0xe627('0x2a')](handleError(_0x9d4335,null));};exports['status']=function(_0x60a9fc,_0x1fd404,_0x4f23fd){if(_0x60a9fc[_0xe627('0x55')]['id']){delete _0x60a9fc[_0xe627('0x55')]['id'];}var _0x857f51;return db['SmsMessage'][_0xe627('0x53')]({'where':{'id':_0x60a9fc['params']['id']}})['then'](handleEntityNotFound(_0x1fd404,null))[_0xe627('0x21')](function(_0x14ab96){if(_0x14ab96){_0x857f51=_0x14ab96;return db[_0xe627('0x7b')][_0xe627('0x53')]({'where':{'id':_0x14ab96[_0xe627('0x7c')]}});}})[_0xe627('0x21')](handleEntityNotFound(_0x1fd404,null))['then'](function(_0x1c76dc){if(_0x1c76dc){logger[_0xe627('0x23')](_0xe627('0x7d'),_0xe627('0x2c'),'received\x20delivery\x20report\x20from',_0x1c76dc[_0xe627('0x3e')],util[_0xe627('0x7e')](_0x60a9fc[_0xe627('0x55')],{'showHidden':![],'depth':null}));switch(_0x1c76dc[_0xe627('0x3e')]){case _0xe627('0x7f'):if(_0x60a9fc[_0xe627('0x55')][_0xe627('0x80')]&&_0x60a9fc['body']['MessageSid']===_0x857f51['messageId']){return _0x857f51[_0xe627('0x81')]({'read':!![]});}else{logger[_0xe627('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe627('0x2c'),_0xe627('0x7f'),util['inspect'](_0x60a9fc['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x60a9fc[_0xe627('0x55')][_0xe627('0x82')]&&_0x60a9fc['body'][_0xe627('0x82')]===_0x857f51['messageId']&&_[_0xe627('0x83')]([_0xe627('0x84'),_0xe627('0x85')],_0x60a9fc[_0xe627('0x55')]['Status'])>=0x0){return _0x857f51[_0xe627('0x81')]({'read':!![]});}else{logger[_0xe627('0x25')](_0xe627('0x86'),_0xe627('0x2c'),_0xe627('0x87'),util[_0xe627('0x7e')](_0x60a9fc['body'],{'showHidden':![],'depth':null}));}break;case _0xe627('0x88'):var _0x434cf9=_0x60a9fc['body'][_0xe627('0x89')][0x0];if(_0x434cf9[_0xe627('0x2c')][_0xe627('0x8a')]===_0xe627('0x8b')){return _0x857f51[_0xe627('0x81')]({'read':!![]});}else{logger['error'](_0xe627('0x86'),'status',_0xe627('0x88'),util[_0xe627('0x7e')](_0x60a9fc[_0xe627('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x857f51;}})[_0xe627('0x21')](respondWithResult(_0x1fd404,null))[_0xe627('0x2a')](handleError(_0x1fd404,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8a72e55..1d2a04c 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 _0xb98e=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1e1be6,_0x51771f){var _0x2d35f3=function(_0x3841a7){while(--_0x3841a7){_0x1e1be6['push'](_0x1e1be6['shift']());}};_0x2d35f3(++_0x51771f);}(_0xb98e,0x92));var _0xeb98=function(_0x335ebb,_0x2341c2){_0x335ebb=_0x335ebb-0x0;var _0x2d49e5=_0xb98e[_0x335ebb];return _0x2d49e5;};'use strict';var EventEmitter=require(_0xeb98('0x0'));var SmsMessage=require(_0xeb98('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeb98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb98('0x3'),'afterDestroy':_0xeb98('0x4')};function emitEvent(_0x85289){return function(_0x17663a,_0x4d1af9,_0xe76d5c){SmsMessageEvents[_0xeb98('0x5')](_0x85289+':'+_0x17663a['id'],_0x17663a);SmsMessageEvents['emit'](_0x85289,_0x17663a);_0xe76d5c(null);};}for(var e in events){if(events[_0xeb98('0x6')](e)){var event=events[e];SmsMessage[_0xeb98('0x7')](e,emitEvent(event));}}module[_0xeb98('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x660a=['../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x337e6d,_0x5df6b9){var _0x5d5921=function(_0x3454d7){while(--_0x3454d7){_0x337e6d['push'](_0x337e6d['shift']());}};_0x5d5921(++_0x5df6b9);}(_0x660a,0xef));var _0xa660=function(_0x97ec0e,_0x10eb67){_0x97ec0e=_0x97ec0e-0x0;var _0x1fd9dd=_0x660a[_0x97ec0e];return _0x1fd9dd;};'use strict';var EventEmitter=require(_0xa660('0x0'));var SmsMessage=require(_0xa660('0x1'))['db'][_0xa660('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa660('0x3')](0x0);var events={'afterCreate':_0xa660('0x4'),'afterUpdate':_0xa660('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ddf1d){return function(_0x241440,_0x2c4434,_0x48b751){SmsMessageEvents['emit'](_0x1ddf1d+':'+_0x241440['id'],_0x241440);SmsMessageEvents[_0xa660('0x6')](_0x1ddf1d,_0x241440);_0x48b751(null);};}for(var e in events){if(events[_0xa660('0x7')](e)){var event=events[e];SmsMessage[_0xa660('0x8')](e,emitEvent(event));}}module[_0xa660('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 23fcc63..7c5cd7c 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 _0x8c15=['remote','/status?token=','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','Basic\x20%s','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','messages'];(function(_0x2f2cdd,_0x4a1dde){var _0x1ba59c=function(_0x1ea496){while(--_0x1ea496){_0x2f2cdd['push'](_0x2f2cdd['shift']());}};_0x1ba59c(++_0x4a1dde);}(_0x8c15,0xcb));var _0x58c1=function(_0x103136,_0x1b9d53){_0x103136=_0x103136-0x0;var _0x76889e=_0x8c15[_0x103136];return _0x76889e;};'use strict';var _=require(_0x58c1('0x0'));var util=require(_0x58c1('0x1'));var logger=require(_0x58c1('0x2'))(_0x58c1('0x3'));var moment=require(_0x58c1('0x4'));var BPromise=require(_0x58c1('0x5'));var rp=require(_0x58c1('0x6'));var fs=require('fs');var path=require(_0x58c1('0x7'));var rimraf=require(_0x58c1('0x8'));var config=require('../../config/environment');var attributes=require(_0x58c1('0x9'));module[_0x58c1('0xa')]=function(_0x3826fe,_0x4d8f76){return _0x3826fe[_0x58c1('0xb')]('SmsMessage',attributes,{'tableName':_0x58c1('0xc'),'paranoid':![],'indexes':[{'name':_0x58c1('0xd'),'fields':[_0x58c1('0xd')]},{'name':_0x58c1('0xe'),'fields':[_0x58c1('0xf')],'type':_0x58c1('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ae9c3,_0x1a9052,_0x44f435){var _0x1e348f=_0x3826fe[_0x58c1('0x11')];var _0x934a3c=_0x3ae9c3['get']({'plain':!![]});if(_0x934a3c[_0x58c1('0x12')][_0x58c1('0x13')]()==='in'||_0x934a3c[_0x58c1('0x12')][_0x58c1('0x13')]()===_0x58c1('0x14')&&!_0x934a3c[_0x58c1('0x15')]&&!_[_0x58c1('0x16')](_0x934a3c[_0x58c1('0x17')])&&!_[_0x58c1('0x16')](_0x934a3c[_0x58c1('0x18')])){_0x1e348f[_0x58c1('0x19')][_0x58c1('0x1a')]({'where':{'id':_0x934a3c['SmsInteractionId']}})['then'](function(_0x57eaed){if(_0x57eaed){_0x57eaed[_0x58c1('0x1b')]({'lastMsgAt':_0x934a3c[_0x58c1('0x1c')],'lastMsgDirection':_0x934a3c['direction'][_0x58c1('0x13')]()});}})[_0x58c1('0x1d')](function(_0x40c77f){console[_0x58c1('0x1e')](_0x40c77f);});}if(_0x934a3c['direction']===_0x58c1('0x14')&&!_0x934a3c[_0x58c1('0x15')]){var _0x4d1e8d;_0x1e348f[_0x58c1('0x1f')][_0x58c1('0x20')]({'where':{'id':_0x934a3c[_0x58c1('0x21')]},'raw':!![]})[_0x58c1('0x22')](function(_0x3a966b){_0x4d1e8d=_0x3a966b;if(_0x4d1e8d&&_0x4d1e8d[_0x58c1('0x23')]){switch(_0x4d1e8d[_0x58c1('0x23')]){case'twilio':var _0x3291cc=require(_0x58c1('0x24'));if(_0x4d1e8d[_0x58c1('0x25')]&&_0x4d1e8d['authToken']&&_0x4d1e8d[_0x58c1('0x26')]){var _0x2a2fd8=new _0x3291cc(_0x4d1e8d[_0x58c1('0x25')],_0x4d1e8d[_0x58c1('0x27')]);_0x2a2fd8[_0x58c1('0x28')]['create']({'body':_0x934a3c[_0x58c1('0xf')],'to':_0x934a3c[_0x58c1('0x26')],'from':_0x4d1e8d[_0x58c1('0x26')],'statusCallback':_0x4d1e8d[_0x58c1('0x29')]+'/api/sms/messages/'+_0x934a3c['id']+_0x58c1('0x2a')+_0x4d1e8d['token']})['then'](function(_0x22f197){if(_0x22f197[_0x58c1('0x2b')]){return _0x3ae9c3[_0x58c1('0x1b')]({'messageId':_0x22f197[_0x58c1('0x2b')]});}})[_0x58c1('0x1d')](function(_0xe2d812){logger[_0x58c1('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x58c1('0x24'),util[_0x58c1('0x2c')](_0xe2d812,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x58c1('0x2f'):var _0x17cfc1=_0x58c1('0x30');if(_0x4d1e8d[_0x58c1('0x31')]&&_0x4d1e8d[_0x58c1('0x32')]){var _0x3a4e5c={'recipient':[_0x934a3c[_0x58c1('0x26')]],'message':_0x934a3c['body'],'message_type':_0x4d1e8d[_0x58c1('0x33')]};if(_0x4d1e8d[_0x58c1('0x33')]&&_0x4d1e8d[_0x58c1('0x33')]!=='SI'){_0x3a4e5c[_0x58c1('0x34')]=_0x4d1e8d[_0x58c1('0x26')];}var _0x1539e1={'url':_0x17cfc1+_0x58c1('0x35')+_0x4d1e8d[_0x58c1('0x31')]+_0x58c1('0x36')+_0x4d1e8d[_0x58c1('0x32')],'method':_0x58c1('0x37')};rp(_0x1539e1)[_0x58c1('0x22')](function(_0x51e1fb){var _0x5c474e=_0x51e1fb[_0x58c1('0x38')](';');var _0x47d10c={'user_key':_0x5c474e[0x0],'session_key':_0x5c474e[0x1]};_0x1539e1={'url':_0x17cfc1+_0x58c1('0x39'),'method':_0x58c1('0x3a'),'headers':{'user_key':_0x47d10c[_0x58c1('0x3b')],'Session_key':_0x47d10c[_0x58c1('0x3c')]},'json':!![],'body':_0x3a4e5c};return rp(_0x1539e1);})[_0x58c1('0x22')](function(_0x14d075){if(_0x14d075['total_sent']>=0x1){var _0x445739={'messageId':_0x14d075[_0x58c1('0x3d')]};if(_0x4d1e8d[_0x58c1('0x33')]!=='GP'||!_0x4d1e8d[_0x58c1('0x3e')]){_0x445739[_0x58c1('0x3f')]=!![];}return _0x3ae9c3[_0x58c1('0x1b')](_0x445739);}else{return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x2f'),util[_0x58c1('0x2c')](_0x14d075,{'showHidden':![],'depth':null}));}})[_0x58c1('0x1d')](function(_0x49d2a9){return logger['error'](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x2f'),util[_0x58c1('0x2c')](_0x49d2a9,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),'afterCreate',_0x58c1('0x2f'),_0x58c1('0x40'));}break;case'connectel':if(_0x4d1e8d[_0x58c1('0x27')]){var _0x4c606e={'recipient':_0x934a3c[_0x58c1('0x26')],'message':_0x934a3c[_0x58c1('0xf')],'sender':_0x4d1e8d[_0x58c1('0x41')]||_0x4d1e8d[_0x58c1('0x26')],'authorization':_0x4d1e8d[_0x58c1('0x27')]};var _0x1a9052={'method':_0x58c1('0x3a'),'uri':_0x58c1('0x42'),'body':_0x4c606e,'json':!![]};rp(_0x1a9052)[_0x58c1('0x22')](function(_0x81badd){var _0x34e91a={'messageId':_0x81badd[_0x58c1('0x43')]};if(!_0x4d1e8d[_0x58c1('0x3e')]){_0x34e91a['read']=!![];}return _0x3ae9c3['update'](_0x34e91a);})[_0x58c1('0x1d')](function(_0x352250){logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x44'),util[_0x58c1('0x2c')](_0x352250,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x58c1('0x44'),'Missing\x20parameters:\x20authToken');}break;case _0x58c1('0x45'):if(_0x4d1e8d['username']&&_0x4d1e8d[_0x58c1('0x32')]){var _0x4c606e={'messages':[{'source':'xCALLY\x20Motion','to':_0x934a3c['phone'],'body':_0x934a3c[_0x58c1('0xf')],'from':_0x4d1e8d[_0x58c1('0x41')]||_0x4d1e8d[_0x58c1('0x26')]}]};var _0x5a853e=util[_0x58c1('0x46')]('%s:%s',_0x4d1e8d[_0x58c1('0x31')],_0x4d1e8d[_0x58c1('0x32')]);var _0x1a9052={'method':_0x58c1('0x3a'),'uri':_0x58c1('0x47'),'body':_0x4c606e,'headers':{'Authorization':util[_0x58c1('0x46')]('Basic\x20%s',new Buffer(_0x5a853e)[_0x58c1('0x48')](_0x58c1('0x49')))},'json':!![]};rp(_0x1a9052)[_0x58c1('0x22')](function(_0x55d50d){if(_0x55d50d[_0x58c1('0x4a')]>=0xc8&&_0x55d50d[_0x58c1('0x4a')]<=0xce){if(_0x55d50d[_0x58c1('0x4b')]&&_0x55d50d['data'][_0x58c1('0x4c')]>0x0){var _0x29f068=_[_0x58c1('0x4d')](_0x55d50d['data'][_0x58c1('0x28')]);var _0x3c6797={'messageId':_0x29f068[_0x58c1('0x4e')]};if(!_0x4d1e8d[_0x58c1('0x3e')]){_0x3c6797[_0x58c1('0x3f')]=!![];}return _0x3ae9c3[_0x58c1('0x1b')](_0x3c6797);}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x4f'),util[_0x58c1('0x2c')](_0x55d50d,{'showHidden':![],'depth':null}));}}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),'afterCreate',_0x58c1('0x4f'),util[_0x58c1('0x2c')](_0x55d50d,{'showHidden':![],'depth':null}));}})[_0x58c1('0x1d')](function(_0x4f859b){logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x4f'),util['inspect'](_0x4f859b,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x4f'),_0x58c1('0x40'));}break;case'plivo':if(_0x4d1e8d[_0x58c1('0x50')]&&_0x4d1e8d[_0x58c1('0x27')]){var _0x4c606e={'dst':_0x934a3c[_0x58c1('0x26')],'text':_0x934a3c['body'],'src':_0x4d1e8d[_0x58c1('0x41')]||_0x4d1e8d[_0x58c1('0x26')],'url':_0x4d1e8d[_0x58c1('0x29')]+'/api/sms/messages/'+_0x934a3c['id']+_0x58c1('0x2a')+_0x4d1e8d[_0x58c1('0x51')]};var _0x5a853e=util[_0x58c1('0x46')](_0x58c1('0x52'),_0x4d1e8d[_0x58c1('0x50')],_0x4d1e8d[_0x58c1('0x27')]);var _0x1a9052={'method':_0x58c1('0x3a'),'uri':util['format'](_0x58c1('0x53'),_0x4d1e8d[_0x58c1('0x50')]),'body':_0x4c606e,'headers':{'Authorization':util[_0x58c1('0x46')]('Basic\x20%s',new Buffer(_0x5a853e)[_0x58c1('0x48')]('base64'))},'json':!![]};rp(_0x1a9052)[_0x58c1('0x22')](function(_0xa9a4a1){var _0x31e15a={'messageId':_0xa9a4a1[_0x58c1('0x54')][0x0]};return _0x3ae9c3[_0x58c1('0x1b')](_0x31e15a);})[_0x58c1('0x1d')](function(_0x20aebf){logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),'plivo',util[_0x58c1('0x2c')](_0x20aebf,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x55'),_0x58c1('0x56'));}break;case'infobip':if(_0x4d1e8d[_0x58c1('0x31')]&&_0x4d1e8d[_0x58c1('0x32')]){if(_0x4d1e8d[_0x58c1('0x57')]){var _0x21ec97={'method':'POST','uri':_0x4d1e8d['baseUrl']+'/auth/1/session','body':{'username':_0x4d1e8d[_0x58c1('0x31')],'password':_0x4d1e8d[_0x58c1('0x32')]},'json':!![]};return rp(_0x21ec97)[_0x58c1('0x22')](function(_0x5dabd3){var _0x31912b={'method':_0x58c1('0x3a'),'uri':_0x4d1e8d[_0x58c1('0x57')]+_0x58c1('0x58'),'body':{'messages':[{'from':_0x4d1e8d['phone'],'destinations':[{'to':_0x934a3c[_0x58c1('0x26')]}],'text':_0x934a3c[_0x58c1('0xf')],'notifyUrl':_0x4d1e8d[_0x58c1('0x29')]+'/api/sms/messages/'+_0x934a3c['id']+_0x58c1('0x2a')+_0x4d1e8d[_0x58c1('0x51')],'notifyContentType':_0x58c1('0x59'),'callbackData':_0x4d1e8d[_0x58c1('0x26')]+';'+_0x934a3c['body']}]},'headers':{'Authorization':_0x58c1('0x5a')+_0x5dabd3['token']},'json':!![]};return rp(_0x31912b)[_0x58c1('0x22')](function(_0x7f000d){if(_0x7f000d[_0x58c1('0x28')]){var _0x4dae81={'messageId':_0x7f000d[_0x58c1('0x28')][0x0][_0x58c1('0xd')]};if(!_0x4d1e8d[_0x58c1('0x3e')]){_0x4dae81[_0x58c1('0x3f')]=!![];}return _0x3ae9c3[_0x58c1('0x1b')](_0x4dae81);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x58c1('0x2e'),_0x58c1('0x5b'),util[_0x58c1('0x2c')](_0x7f000d,{'showHidden':![],'depth':null}));}});})[_0x58c1('0x1d')](function(_0x397682){return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),'infobip',util[_0x58c1('0x2c')](_0x397682,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x5b'),_0x58c1('0x5c'));}}else{logger[_0x58c1('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x58c1('0x2e'),_0x58c1('0x5b'),_0x58c1('0x40'));}break;case'csc':var _0x1180c2=require('crypto');if(_0x4d1e8d[_0x58c1('0x5d')]){var _0x52cdbd={};_0x52cdbd[_0x58c1('0x5e')]=_0x4d1e8d[_0x58c1('0x31')];_0x52cdbd['phone']=_0x934a3c[_0x58c1('0x26')];_0x52cdbd[_0x58c1('0x34')]=_0x4d1e8d[_0x58c1('0x26')];_0x52cdbd[_0x58c1('0x5f')]=_0x934a3c[_0x58c1('0xf')];_0x52cdbd[_0x58c1('0x60')]=+new Date();var _0x1a3a46='';var _0x68e613='';var _0x3d3512=Object[_0x58c1('0x61')](_0x52cdbd);_0x3d3512['sort']();for(var _0x2c83eb=0x0;_0x2c83eb<_0x3d3512[_0x58c1('0x62')];_0x2c83eb++){if(_0x1a3a46!=''){_0x1a3a46+='&';}_0x1a3a46+=_0x3d3512[_0x2c83eb]+'='+encodeURIComponent(_0x52cdbd[_0x3d3512[_0x2c83eb]]);_0x68e613+=_0x52cdbd[_0x3d3512[_0x2c83eb]];}_0x68e613+=_0x4d1e8d[_0x58c1('0x5d')];_0x68e613=_0x1180c2[_0x58c1('0x63')](_0x58c1('0x64'))[_0x58c1('0x1b')](_0x68e613)[_0x58c1('0x65')](_0x58c1('0x66'));if(_0x1a3a46!==''){_0x1a3a46+='&';}_0x1a3a46+='signature='+_0x68e613;var _0x1539e1={'method':'GET','uri':_0x4d1e8d['baseUrl']+_0x58c1('0x67')+_0x1a3a46,'json':!![]};return rp(_0x1539e1)[_0x58c1('0x22')](function(_0x454802){var _0x37c4b2=Object[_0x58c1('0x61')](_0x454802);if(_0x454802[_0x37c4b2[0x0]][_0x58c1('0x1e')]&&parseInt(_0x454802[_0x37c4b2[0x0]][_0x58c1('0x1e')])===0x0){var _0x3aa9c4={'messageId':_0x454802[_0x37c4b2[0x0]][_0x58c1('0x68')]};if(!_0x4d1e8d[_0x58c1('0x3e')]){_0x3aa9c4[_0x58c1('0x3f')]=!![];}return _0x3ae9c3[_0x58c1('0x1b')](_0x3aa9c4);}else{return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),'csc',util[_0x58c1('0x2c')](_0x454802[_0x58c1('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x22a6a1){return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x69'),util[_0x58c1('0x2c')](_0x22a6a1,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x69'),'Missing\x20parameters:\x20apiKey');}break;case _0x58c1('0x6a'):if(_0x4d1e8d[_0x58c1('0x5d')]){var _0x1be5fe={'method':_0x58c1('0x3a'),'uri':_0x58c1('0x6b'),'headers':{'Authorization':_0x4d1e8d[_0x58c1('0x5d')]},'body':{'content':_0x934a3c['body'],'to':[_0x934a3c[_0x58c1('0x26')]],'from':_0x4d1e8d[_0x58c1('0x26')],'binary':![],'clientMessageId':_0x58c1('0x6c'),'charset':_0x58c1('0x6d')},'json':!![]};rp(_0x1be5fe)[_0x58c1('0x22')](function(_0x3e959a){if(!_0x3e959a[_0x58c1('0x1e')]){var _0x2c4648={'messageId':_0x3e959a[_0x58c1('0x28')][0x0]['apiMessageId']};if(!_0x4d1e8d['deliveryReport']){_0x2c4648[_0x58c1('0x3f')]=!![];}return _0x3ae9c3[_0x58c1('0x1b')](_0x2c4648);}else{return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x6a'),util[_0x58c1('0x2c')](_0x3e959a['error'],{'showHidden':![],'depth':null}));}})[_0x58c1('0x1d')](function(_0x53115d){return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),'afterCreate',_0x58c1('0x6a'),util['inspect'](_0x53115d,{'showHidden':![],'depth':null}));});}else{logger[_0x58c1('0x1e')](_0x58c1('0x2d'),'afterCreate',_0x58c1('0x6a'),_0x58c1('0x6e'));}break;case _0x58c1('0x6f'):if(_0x4d1e8d[_0x58c1('0x31')]&&_0x4d1e8d[_0x58c1('0x32')]){var _0x5a853e=util[_0x58c1('0x46')](_0x58c1('0x52'),_0x4d1e8d['username'],_0x4d1e8d[_0x58c1('0x32')]);var _0x1a9052={'method':_0x58c1('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4d1e8d['accountId']+'/messages','body':{'to':[_0x934a3c[_0x58c1('0x26')]],'text':_0x934a3c[_0x58c1('0xf')],'from':_0x4d1e8d['phone'],'applicationId':_0x4d1e8d['applicationId']},'headers':{'Authorization':util[_0x58c1('0x46')](_0x58c1('0x70'),new Buffer(_0x5a853e)['toString'](_0x58c1('0x49')))},'json':!![]};rp(_0x1a9052)[_0x58c1('0x22')](function(_0x534a68){if(_0x534a68['id']){var _0x3adb34={'messageId':_0x534a68['id']};return _0x3ae9c3['update'](_0x3adb34);}else{logger['error'](_0x58c1('0x2d'),_0x58c1('0x2e'),'bandwidth',util[_0x58c1('0x2c')](_0x534a68,{'showHidden':![],'depth':null}));}})[_0x58c1('0x1d')](function(_0x541d72){logger[_0x58c1('0x1e')](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x6f'),util['inspect'](_0x541d72,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x58c1('0x2d'),_0x58c1('0x2e'),_0x58c1('0x6f'),_0x58c1('0x40'));}break;case _0x58c1('0x71'):if(_0x4d1e8d[_0x58c1('0x5d')]){var _0x9fabf1={};var _0x1539e1={'method':_0x58c1('0x3a'),'uri':_0x58c1('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x4d1e8d[_0x58c1('0x5d')],'Content-Type':'application/json'},'body':{'from':_0x4d1e8d[_0x58c1('0x26')],'to':_0x934a3c[_0x58c1('0x26')],'text':_0x934a3c[_0x58c1('0xf')]},'json':!![]};return rp(_0x1539e1)['then'](function(_0x298728){if(_0x298728[_0x58c1('0x73')]==0xca){_0x9fabf1[_0x58c1('0x74')]=_0x298728;var _0x192f5d={'method':_0x58c1('0x3a'),'uri':_0x58c1('0x75'),'headers':{'Authorization':_0x58c1('0x76')+_0x4d1e8d[_0x58c1('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0x9fabf1[_0x58c1('0x74')][_0x58c1('0x77')]},'json':!![]};return rp(_0x192f5d)[_0x58c1('0x22')](function(_0x5aa0f9){_0x9fabf1['status']=_0x5aa0f9;var _0x43427c={'messageId':_0x9fabf1[_0x58c1('0x74')][_0x58c1('0x77')],'read':!![]};return _0x3ae9c3[_0x58c1('0x1b')](_0x43427c);});}else{return logger[_0x58c1('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x58c1('0x71'),util[_0x58c1('0x2c')](_0x298728,{'showHidden':![],'depth':null}));}})[_0x58c1('0x1d')](function(_0xcc3c10){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x58c1('0x2e'),_0x58c1('0x71'),util['inspect'](_0xcc3c10,{'showHidden':![],'depth':null}));});}else{return logger[_0x58c1('0x1e')](_0x58c1('0x2d'),'afterCreate',_0x58c1('0x71'),_0x58c1('0x78'));}break;}}})[_0x58c1('0x79')](function(){_0x44f435();});}else{_0x44f435();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8234=['/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','direction','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','read','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','messages','csc','crypto','apiKey','login','keys','sort','length','createHash','md5','digest','hex','signature=','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','https://messaging.bandwidth.com/api/v2/users/'];(function(_0x49eeb0,_0x14e3c2){var _0x457b4f=function(_0xc55c47){while(--_0xc55c47){_0x49eeb0['push'](_0x49eeb0['shift']());}};_0x457b4f(++_0x14e3c2);}(_0x8234,0x175));var _0x4823=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x8234[_0x1c5142];return _0x1268cb;};'use strict';var _=require(_0x4823('0x0'));var util=require('util');var logger=require(_0x4823('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4823('0x2'));var rp=require(_0x4823('0x3'));var fs=require('fs');var path=require(_0x4823('0x4'));var rimraf=require(_0x4823('0x5'));var config=require(_0x4823('0x6'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x413bdb,_0x399136){return _0x413bdb['define']('SmsMessage',attributes,{'tableName':_0x4823('0x7'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4823('0x8')]},{'name':_0x4823('0x9'),'fields':[_0x4823('0xa')],'type':_0x4823('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c44f4,_0xf18a08,_0xfe4070){var _0x390c15=_0x413bdb[_0x4823('0xc')];var _0x278aa5=_0x4c44f4[_0x4823('0xd')]({'plain':!![]});if(_0x278aa5['direction'][_0x4823('0xe')]()==='in'||_0x278aa5['direction'][_0x4823('0xe')]()===_0x4823('0xf')&&!_0x278aa5[_0x4823('0x10')]&&!_[_0x4823('0x11')](_0x278aa5[_0x4823('0x12')])&&!_['isNil'](_0x278aa5[_0x4823('0x13')])){_0x390c15['SmsInteraction'][_0x4823('0x14')]({'where':{'id':_0x278aa5[_0x4823('0x13')]}})[_0x4823('0x15')](function(_0x4fb515){if(_0x4fb515){_0x4fb515[_0x4823('0x16')]({'lastMsgAt':_0x278aa5[_0x4823('0x17')],'lastMsgDirection':_0x278aa5[_0x4823('0x18')]['toLowerCase']()});}})[_0x4823('0x19')](function(_0x179296){console[_0x4823('0x1a')](_0x179296);});}if(_0x278aa5[_0x4823('0x18')]===_0x4823('0xf')&&!_0x278aa5['secret']){var _0x3fedb0;_0x390c15[_0x4823('0x1b')][_0x4823('0x1c')]({'where':{'id':_0x278aa5[_0x4823('0x1d')]},'raw':!![]})[_0x4823('0x15')](function(_0x168773){_0x3fedb0=_0x168773;if(_0x3fedb0&&_0x3fedb0['type']){switch(_0x3fedb0[_0x4823('0x1e')]){case _0x4823('0x1f'):var _0x785973=require(_0x4823('0x1f'));if(_0x3fedb0[_0x4823('0x20')]&&_0x3fedb0[_0x4823('0x21')]&&_0x3fedb0[_0x4823('0x22')]){var _0x37ddd2=new _0x785973(_0x3fedb0[_0x4823('0x20')],_0x3fedb0[_0x4823('0x21')]);_0x37ddd2['messages'][_0x4823('0x23')]({'body':_0x278aa5['body'],'to':_0x278aa5[_0x4823('0x22')],'from':_0x3fedb0[_0x4823('0x22')],'statusCallback':_0x3fedb0[_0x4823('0x24')]+_0x4823('0x25')+_0x278aa5['id']+'/status?token='+_0x3fedb0[_0x4823('0x26')]})['then'](function(_0x238ef5){if(_0x238ef5['sid']){return _0x4c44f4[_0x4823('0x16')]({'messageId':_0x238ef5['sid']});}})[_0x4823('0x19')](function(_0x5d5e78){logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x1f'),util[_0x4823('0x29')](_0x5d5e78,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4823('0x27'),'afterCreate',_0x4823('0x1f'),_0x4823('0x2a'));}break;case _0x4823('0x2b'):var _0x10530c=_0x4823('0x2c');if(_0x3fedb0[_0x4823('0x2d')]&&_0x3fedb0[_0x4823('0x2e')]){var _0xf421f5={'recipient':[_0x278aa5[_0x4823('0x22')]],'message':_0x278aa5[_0x4823('0xa')],'message_type':_0x3fedb0[_0x4823('0x2f')]};if(_0x3fedb0['smsMethod']&&_0x3fedb0[_0x4823('0x2f')]!=='SI'){_0xf421f5[_0x4823('0x30')]=_0x3fedb0[_0x4823('0x22')];}var _0xb111fc={'url':_0x10530c+_0x4823('0x31')+_0x3fedb0[_0x4823('0x2d')]+_0x4823('0x32')+_0x3fedb0[_0x4823('0x2e')],'method':'GET'};rp(_0xb111fc)['then'](function(_0x21534c){var _0x4544bc=_0x21534c[_0x4823('0x33')](';');var _0x1e387c={'user_key':_0x4544bc[0x0],'session_key':_0x4544bc[0x1]};_0xb111fc={'url':_0x10530c+_0x4823('0x34'),'method':_0x4823('0x35'),'headers':{'user_key':_0x1e387c[_0x4823('0x36')],'Session_key':_0x1e387c[_0x4823('0x37')]},'json':!![],'body':_0xf421f5};return rp(_0xb111fc);})['then'](function(_0x9259ed){if(_0x9259ed[_0x4823('0x38')]>=0x1){var _0x1d5c41={'messageId':_0x9259ed['internal_order_id']};if(_0x3fedb0[_0x4823('0x2f')]!=='GP'||!_0x3fedb0[_0x4823('0x39')]){_0x1d5c41['read']=!![];}return _0x4c44f4[_0x4823('0x16')](_0x1d5c41);}else{return logger[_0x4823('0x1a')](_0x4823('0x27'),'afterCreate',_0x4823('0x2b'),util[_0x4823('0x29')](_0x9259ed,{'showHidden':![],'depth':null}));}})[_0x4823('0x19')](function(_0x28c0ea){return logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x2b'),util[_0x4823('0x29')](_0x28c0ea,{'showHidden':![],'depth':null}));});}else{logger[_0x4823('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x2b'),_0x4823('0x3a'));}break;case'connectel':if(_0x3fedb0[_0x4823('0x21')]){var _0x240ed8={'recipient':_0x278aa5[_0x4823('0x22')],'message':_0x278aa5['body'],'sender':_0x3fedb0['senderString']||_0x3fedb0[_0x4823('0x22')],'authorization':_0x3fedb0[_0x4823('0x21')]};var _0xf18a08={'method':_0x4823('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x240ed8,'json':!![]};rp(_0xf18a08)[_0x4823('0x15')](function(_0x14d3ba){var _0x3d58e6={'messageId':_0x14d3ba['requestid']};if(!_0x3fedb0['deliveryReport']){_0x3d58e6[_0x4823('0x3b')]=!![];}return _0x4c44f4['update'](_0x3d58e6);})['catch'](function(_0x135a62){logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x3c'),util[_0x4823('0x29')](_0x135a62,{'showHidden':![],'depth':null}));});}else{logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),'connectel',_0x4823('0x3d'));}break;case _0x4823('0x3e'):if(_0x3fedb0[_0x4823('0x2d')]&&_0x3fedb0[_0x4823('0x2e')]){var _0x240ed8={'messages':[{'source':_0x4823('0x3f'),'to':_0x278aa5[_0x4823('0x22')],'body':_0x278aa5[_0x4823('0xa')],'from':_0x3fedb0[_0x4823('0x40')]||_0x3fedb0[_0x4823('0x22')]}]};var _0x1bd2db=util[_0x4823('0x41')](_0x4823('0x42'),_0x3fedb0['username'],_0x3fedb0[_0x4823('0x2e')]);var _0xf18a08={'method':'POST','uri':_0x4823('0x43'),'body':_0x240ed8,'headers':{'Authorization':util[_0x4823('0x41')](_0x4823('0x44'),new Buffer(_0x1bd2db)['toString'](_0x4823('0x45')))},'json':!![]};rp(_0xf18a08)[_0x4823('0x15')](function(_0xf44e3a){if(_0xf44e3a[_0x4823('0x46')]>=0xc8&&_0xf44e3a[_0x4823('0x46')]<=0xce){if(_0xf44e3a[_0x4823('0x47')]&&_0xf44e3a[_0x4823('0x47')][_0x4823('0x48')]>0x0){var _0x349c5b=_['head'](_0xf44e3a[_0x4823('0x47')]['messages']);var _0x8d2423={'messageId':_0x349c5b[_0x4823('0x49')]};if(!_0x3fedb0[_0x4823('0x39')]){_0x8d2423[_0x4823('0x3b')]=!![];}return _0x4c44f4['update'](_0x8d2423);}else{logger[_0x4823('0x1a')](_0x4823('0x27'),'afterCreate',_0x4823('0x4a'),util[_0x4823('0x29')](_0xf44e3a,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x4823('0x27'),_0x4823('0x28'),'clickSend',util['inspect'](_0xf44e3a,{'showHidden':![],'depth':null}));}})[_0x4823('0x19')](function(_0x43c451){logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x4a'),util[_0x4823('0x29')](_0x43c451,{'showHidden':![],'depth':null}));});}else{logger[_0x4823('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x4a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4823('0x4b'):if(_0x3fedb0['authId']&&_0x3fedb0[_0x4823('0x21')]){var _0x240ed8={'dst':_0x278aa5[_0x4823('0x22')],'text':_0x278aa5[_0x4823('0xa')],'src':_0x3fedb0[_0x4823('0x40')]||_0x3fedb0['phone'],'url':_0x3fedb0[_0x4823('0x24')]+_0x4823('0x25')+_0x278aa5['id']+'/status?token='+_0x3fedb0[_0x4823('0x26')]};var _0x1bd2db=util[_0x4823('0x41')](_0x4823('0x42'),_0x3fedb0[_0x4823('0x4c')],_0x3fedb0[_0x4823('0x21')]);var _0xf18a08={'method':'POST','uri':util[_0x4823('0x41')](_0x4823('0x4d'),_0x3fedb0['authId']),'body':_0x240ed8,'headers':{'Authorization':util[_0x4823('0x41')](_0x4823('0x44'),new Buffer(_0x1bd2db)[_0x4823('0x4e')](_0x4823('0x45')))},'json':!![]};rp(_0xf18a08)[_0x4823('0x15')](function(_0x4f037f){var _0x5d2265={'messageId':_0x4f037f[_0x4823('0x4f')][0x0]};return _0x4c44f4[_0x4823('0x16')](_0x5d2265);})[_0x4823('0x19')](function(_0x483a38){logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x4b'),util[_0x4823('0x29')](_0x483a38,{'showHidden':![],'depth':null}));});}else{logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),'plivo',_0x4823('0x50'));}break;case _0x4823('0x51'):if(_0x3fedb0[_0x4823('0x2d')]&&_0x3fedb0[_0x4823('0x2e')]){if(_0x3fedb0[_0x4823('0x52')]){var _0x2dd6c9={'method':'POST','uri':_0x3fedb0[_0x4823('0x52')]+_0x4823('0x53'),'body':{'username':_0x3fedb0[_0x4823('0x2d')],'password':_0x3fedb0['password']},'json':!![]};return rp(_0x2dd6c9)[_0x4823('0x15')](function(_0x54452b){var _0x315b06={'method':'POST','uri':_0x3fedb0['baseUrl']+_0x4823('0x54'),'body':{'messages':[{'from':_0x3fedb0[_0x4823('0x22')],'destinations':[{'to':_0x278aa5[_0x4823('0x22')]}],'text':_0x278aa5[_0x4823('0xa')],'notifyUrl':_0x3fedb0[_0x4823('0x24')]+_0x4823('0x25')+_0x278aa5['id']+_0x4823('0x55')+_0x3fedb0['token'],'notifyContentType':_0x4823('0x56'),'callbackData':_0x3fedb0[_0x4823('0x22')]+';'+_0x278aa5[_0x4823('0xa')]}]},'headers':{'Authorization':_0x4823('0x57')+_0x54452b['token']},'json':!![]};return rp(_0x315b06)[_0x4823('0x15')](function(_0x446205){if(_0x446205[_0x4823('0x58')]){var _0x14bf8d={'messageId':_0x446205[_0x4823('0x58')][0x0][_0x4823('0x8')]};if(!_0x3fedb0[_0x4823('0x39')]){_0x14bf8d[_0x4823('0x3b')]=!![];}return _0x4c44f4[_0x4823('0x16')](_0x14bf8d);}else{return logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x51'),util['inspect'](_0x446205,{'showHidden':![],'depth':null}));}});})[_0x4823('0x19')](function(_0x25b003){return logger[_0x4823('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x51'),util['inspect'](_0x25b003,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4823('0x27'),_0x4823('0x28'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x51'),_0x4823('0x3a'));}break;case _0x4823('0x59'):var _0x21f2a1=require(_0x4823('0x5a'));if(_0x3fedb0[_0x4823('0x5b')]){var _0x41aa90={};_0x41aa90[_0x4823('0x5c')]=_0x3fedb0[_0x4823('0x2d')];_0x41aa90[_0x4823('0x22')]=_0x278aa5['phone'];_0x41aa90[_0x4823('0x30')]=_0x3fedb0[_0x4823('0x22')];_0x41aa90['text']=_0x278aa5[_0x4823('0xa')];_0x41aa90['timestamp']=+new Date();var _0x1a99b3='';var _0x274961='';var _0x40f1f7=Object[_0x4823('0x5d')](_0x41aa90);_0x40f1f7[_0x4823('0x5e')]();for(var _0x2bfacc=0x0;_0x2bfacc<_0x40f1f7[_0x4823('0x5f')];_0x2bfacc++){if(_0x1a99b3!=''){_0x1a99b3+='&';}_0x1a99b3+=_0x40f1f7[_0x2bfacc]+'='+encodeURIComponent(_0x41aa90[_0x40f1f7[_0x2bfacc]]);_0x274961+=_0x41aa90[_0x40f1f7[_0x2bfacc]];}_0x274961+=_0x3fedb0[_0x4823('0x5b')];_0x274961=_0x21f2a1[_0x4823('0x60')](_0x4823('0x61'))[_0x4823('0x16')](_0x274961)[_0x4823('0x62')](_0x4823('0x63'));if(_0x1a99b3!==''){_0x1a99b3+='&';}_0x1a99b3+=_0x4823('0x64')+_0x274961;var _0xb111fc={'method':'GET','uri':_0x3fedb0['baseUrl']+'/external/get/send.php?'+_0x1a99b3,'json':!![]};return rp(_0xb111fc)['then'](function(_0x5e2771){var _0x226e2a=Object[_0x4823('0x5d')](_0x5e2771);if(_0x5e2771[_0x226e2a[0x0]]['error']&&parseInt(_0x5e2771[_0x226e2a[0x0]][_0x4823('0x1a')])===0x0){var _0x59465f={'messageId':_0x5e2771[_0x226e2a[0x0]]['id_sms']};if(!_0x3fedb0[_0x4823('0x39')]){_0x59465f[_0x4823('0x3b')]=!![];}return _0x4c44f4[_0x4823('0x16')](_0x59465f);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),'csc',util[_0x4823('0x29')](_0x5e2771['error'],{'showHidden':![],'depth':null}));}})[_0x4823('0x19')](function(_0x508a44){return logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x59'),util[_0x4823('0x29')](_0x508a44,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4823('0x59'),_0x4823('0x65'));}break;case _0x4823('0x66'):if(_0x3fedb0[_0x4823('0x5b')]){var _0x4ca06d={'method':_0x4823('0x35'),'uri':_0x4823('0x67'),'headers':{'Authorization':_0x3fedb0[_0x4823('0x5b')]},'body':{'content':_0x278aa5[_0x4823('0xa')],'to':[_0x278aa5[_0x4823('0x22')]],'from':_0x3fedb0[_0x4823('0x22')],'binary':![],'clientMessageId':_0x4823('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x4ca06d)[_0x4823('0x15')](function(_0x5da9a9){if(!_0x5da9a9['error']){var _0x482148={'messageId':_0x5da9a9['messages'][0x0][_0x4823('0x69')]};if(!_0x3fedb0['deliveryReport']){_0x482148['read']=!![];}return _0x4c44f4[_0x4823('0x16')](_0x482148);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x66'),util[_0x4823('0x29')](_0x5da9a9['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x56c8f4){return logger[_0x4823('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x66'),util[_0x4823('0x29')](_0x56c8f4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4823('0x66'),_0x4823('0x65'));}break;case'bandwidth':if(_0x3fedb0[_0x4823('0x2d')]&&_0x3fedb0[_0x4823('0x2e')]){var _0x1bd2db=util[_0x4823('0x41')](_0x4823('0x42'),_0x3fedb0[_0x4823('0x2d')],_0x3fedb0['password']);var _0xf18a08={'method':_0x4823('0x35'),'uri':_0x4823('0x6a')+_0x3fedb0['accountId']+_0x4823('0x6b'),'body':{'to':[_0x278aa5[_0x4823('0x22')]],'text':_0x278aa5[_0x4823('0xa')],'from':_0x3fedb0[_0x4823('0x22')],'applicationId':_0x3fedb0[_0x4823('0x6c')]},'headers':{'Authorization':util[_0x4823('0x41')]('Basic\x20%s',new Buffer(_0x1bd2db)['toString']('base64'))},'json':!![]};rp(_0xf18a08)[_0x4823('0x15')](function(_0x355058){if(_0x355058['id']){var _0x1b5742={'messageId':_0x355058['id']};return _0x4c44f4[_0x4823('0x16')](_0x1b5742);}else{logger[_0x4823('0x1a')](_0x4823('0x27'),'afterCreate','bandwidth',util[_0x4823('0x29')](_0x355058,{'showHidden':![],'depth':null}));}})[_0x4823('0x19')](function(_0x206361){logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x6d'),util[_0x4823('0x29')](_0x206361,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4823('0x28'),_0x4823('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x3fedb0[_0x4823('0x5b')]){var _0x4e4c61={};var _0xb111fc={'method':_0x4823('0x35'),'uri':_0x4823('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x3fedb0[_0x4823('0x5b')],'Content-Type':_0x4823('0x56')},'body':{'from':_0x3fedb0[_0x4823('0x22')],'to':_0x278aa5['phone'],'text':_0x278aa5['body']},'json':!![]};return rp(_0xb111fc)[_0x4823('0x15')](function(_0x548e5a){if(_0x548e5a[_0x4823('0x6f')]==0xca){_0x4e4c61[_0x4823('0x70')]=_0x548e5a;var _0x584bfb={'method':_0x4823('0x35'),'uri':_0x4823('0x71'),'headers':{'Authorization':_0x4823('0x72')+_0x3fedb0[_0x4823('0x5b')],'Content-Type':_0x4823('0x56')},'body':{'refid':_0x4e4c61[_0x4823('0x70')]['refid']},'json':!![]};return rp(_0x584bfb)[_0x4823('0x15')](function(_0xc81b8c){_0x4e4c61['status']=_0xc81b8c;var _0x2f9e79={'messageId':_0x4e4c61['message'][_0x4823('0x73')],'read':!![]};return _0x4c44f4[_0x4823('0x16')](_0x2f9e79);});}else{return logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x74'),util[_0x4823('0x29')](_0x548e5a,{'showHidden':![],'depth':null}));}})[_0x4823('0x19')](function(_0x296cd8){return logger[_0x4823('0x1a')](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x74'),util[_0x4823('0x29')](_0x296cd8,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x4823('0x27'),_0x4823('0x28'),_0x4823('0x74'),_0x4823('0x75'));}break;}}})[_0x4823('0x76')](function(){_0xfe4070();});}else{_0xfe4070();}}},'charset':'utf8mb4','collate':_0x4823('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7ba7e36..7f83e63 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 _0xd375=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xd375,0xd9));var _0x5d37=function(_0xe70754,_0x21f65a){_0xe70754=_0xe70754-0x0;var _0x3a759b=_0xd375[_0xe70754];return _0x3a759b;};'use strict';var _=require(_0x5d37('0x0'));var util=require('util');var moment=require(_0x5d37('0x1'));var BPromise=require(_0x5d37('0x2'));var rs=require(_0x5d37('0x3'));var fs=require('fs');var Redis=require(_0x5d37('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d37('0x5'))(_0x5d37('0x6'));var config=require(_0x5d37('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d37('0x8')][_0x5d37('0x9')]({'port':0x232a});config['redis']=_[_0x5d37('0xa')](config['redis'],{'host':_0x5d37('0xb'),'port':0x18eb});var socket=require(_0x5d37('0xc'))(new Redis(config[_0x5d37('0xd')]));require(_0x5d37('0xe'))['register'](socket);function respondWithRpcPromise(_0x43ad0f,_0x42b3e0,_0x2162c4){return new BPromise(function(_0x426364,_0x283864){return client[_0x5d37('0xf')](_0x43ad0f,_0x2162c4)[_0x5d37('0x10')](function(_0x884fcf){logger[_0x5d37('0x11')](_0x5d37('0x12'),_0x42b3e0,_0x5d37('0x13'));logger[_0x5d37('0x14')](_0x5d37('0x15'),_0x42b3e0,_0x5d37('0x13'),JSON[_0x5d37('0x16')](_0x884fcf));if(_0x884fcf[_0x5d37('0x17')]){if(_0x884fcf['error'][_0x5d37('0x18')]===0x1f4){logger[_0x5d37('0x17')](_0x5d37('0x12'),_0x42b3e0,_0x884fcf[_0x5d37('0x17')]['message']);return _0x283864(_0x884fcf['error'][_0x5d37('0x19')]);}logger[_0x5d37('0x17')](_0x5d37('0x12'),_0x42b3e0,_0x884fcf[_0x5d37('0x17')]['message']);return _0x426364(_0x884fcf[_0x5d37('0x17')]['message']);}else{logger[_0x5d37('0x11')](_0x5d37('0x12'),_0x42b3e0,_0x5d37('0x13'));_0x426364(_0x884fcf[_0x5d37('0x1a')][_0x5d37('0x19')]);}})[_0x5d37('0x1b')](function(_0x21f23e){logger[_0x5d37('0x17')]('SmsMessage,\x20%s,\x20%s',_0x42b3e0,_0x21f23e);_0x283864(_0x21f23e);});});}exports[_0x5d37('0x1c')]=function(_0x57fadc){var _0x40fda1=this;return new Promise(function(_0x5013df,_0x6c6f23){return db[_0x5d37('0x1d')][_0x5d37('0x1e')](_0x57fadc[_0x5d37('0x1f')],{'raw':_0x57fadc[_0x5d37('0x20')]?_0x57fadc[_0x5d37('0x20')][_0x5d37('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x218a60){logger['info'](_0x5d37('0x1c'),_0x57fadc);logger[_0x5d37('0x14')](_0x5d37('0x1c'),_0x57fadc,JSON[_0x5d37('0x16')](_0x218a60));_0x5013df(_0x218a60);})['catch'](function(_0x53f7a0){logger[_0x5d37('0x17')](_0x5d37('0x1c'),_0x53f7a0[_0x5d37('0x19')],_0x57fadc);_0x6c6f23(_0x40fda1[_0x5d37('0x17')](0x1f4,_0x53f7a0[_0x5d37('0x19')]));});});}; \ No newline at end of file +var _0xe9ef=['redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsMessage','create','options','raw','CreateSmsMessage','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe9ef,0x1b7));var _0xfe9e=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0xe9ef[_0x2ac71a];return _0x3ee904;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe9e('0x0'));var BPromise=require(_0xfe9e('0x1'));var rs=require(_0xfe9e('0x2'));var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9e('0x4'));var logger=require(_0xfe9e('0x5'))('rpc');var config=require(_0xfe9e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe9e('0x7')][_0xfe9e('0x8')]({'port':0x232a});config[_0xfe9e('0x9')]=_[_0xfe9e('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe9e('0xb'))(new Redis(config[_0xfe9e('0x9')]));require(_0xfe9e('0xc'))[_0xfe9e('0xd')](socket);function respondWithRpcPromise(_0x1bf1c7,_0x4da9ad,_0x4eb2e7){return new BPromise(function(_0x5870cc,_0x118da1){return client[_0xfe9e('0xe')](_0x1bf1c7,_0x4eb2e7)[_0xfe9e('0xf')](function(_0x5698c5){logger[_0xfe9e('0x10')](_0xfe9e('0x11'),_0x4da9ad,_0xfe9e('0x12'));logger[_0xfe9e('0x13')](_0xfe9e('0x14'),_0x4da9ad,'request\x20sent',JSON[_0xfe9e('0x15')](_0x5698c5));if(_0x5698c5[_0xfe9e('0x16')]){if(_0x5698c5['error'][_0xfe9e('0x17')]===0x1f4){logger['error'](_0xfe9e('0x11'),_0x4da9ad,_0x5698c5[_0xfe9e('0x16')]['message']);return _0x118da1(_0x5698c5['error'][_0xfe9e('0x18')]);}logger[_0xfe9e('0x16')](_0xfe9e('0x11'),_0x4da9ad,_0x5698c5[_0xfe9e('0x16')][_0xfe9e('0x18')]);return _0x5870cc(_0x5698c5[_0xfe9e('0x16')][_0xfe9e('0x18')]);}else{logger[_0xfe9e('0x10')](_0xfe9e('0x11'),_0x4da9ad,'request\x20sent');_0x5870cc(_0x5698c5[_0xfe9e('0x19')]['message']);}})['catch'](function(_0x1e230a){logger[_0xfe9e('0x16')](_0xfe9e('0x11'),_0x4da9ad,_0x1e230a);_0x118da1(_0x1e230a);});});}exports['CreateSmsMessage']=function(_0x2cbd32){var _0x15bf77=this;return new Promise(function(_0x48c417,_0x1eb64c){return db[_0xfe9e('0x1a')][_0xfe9e('0x1b')](_0x2cbd32['body'],{'raw':_0x2cbd32[_0xfe9e('0x1c')]?_0x2cbd32[_0xfe9e('0x1c')][_0xfe9e('0x1d')]===undefined?!![]:![]:!![]})[_0xfe9e('0xf')](function(_0x2af0d9){logger[_0xfe9e('0x10')](_0xfe9e('0x1e'),_0x2cbd32);logger[_0xfe9e('0x13')](_0xfe9e('0x1e'),_0x2cbd32,JSON['stringify'](_0x2af0d9));_0x48c417(_0x2af0d9);})[_0xfe9e('0x1f')](function(_0x2e4ee1){logger[_0xfe9e('0x16')](_0xfe9e('0x1e'),_0x2e4ee1[_0xfe9e('0x18')],_0x2cbd32);_0x1eb64c(_0x15bf77[_0xfe9e('0x16')](0x1f4,_0x2e4ee1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 21b753e..5bf7eab 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 _0x2368=['register','length','smsMessage:','emit','removeListener'];(function(_0x37ff5a,_0x234f43){var _0x4f860e=function(_0x2b934a){while(--_0x2b934a){_0x37ff5a['push'](_0x37ff5a['shift']());}};_0x4f860e(++_0x234f43);}(_0x2368,0x1cf));var _0x8236=function(_0x4b7c3d,_0x85a56a){_0x4b7c3d=_0x4b7c3d-0x0;var _0x585130=_0x2368[_0x4b7c3d];return _0x585130;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove','update'];function createListener(_0x3b3447,_0x7bae4f){return function(_0x6103db){_0x7bae4f[_0x8236('0x0')](_0x3b3447,_0x6103db);};}function removeListener(_0x1ecceb,_0x551115){return function(){SmsMessageEvents[_0x8236('0x1')](_0x1ecceb,_0x551115);};}exports[_0x8236('0x2')]=function(_0x3e7c9e){for(var _0x21b071=0x0,_0x4d9953=events[_0x8236('0x3')];_0x21b071<_0x4d9953;_0x21b071++){var _0x1da2be=events[_0x21b071];var _0x523e34=createListener(_0x8236('0x4')+_0x1da2be,_0x3e7c9e);SmsMessageEvents['on'](_0x1da2be,_0x523e34);}}; \ No newline at end of file +var _0x3f93=['save','remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x2b1551,_0x1776fe){var _0x2fc2a1=function(_0x5d43c8){while(--_0x5d43c8){_0x2b1551['push'](_0x2b1551['shift']());}};_0x2fc2a1(++_0x1776fe);}(_0x3f93,0xaf));var _0x33f9=function(_0x392579,_0x45b1f5){_0x392579=_0x392579-0x0;var _0x476159=_0x3f93[_0x392579];return _0x476159;};'use strict';var SmsMessageEvents=require(_0x33f9('0x0'));var events=[_0x33f9('0x1'),_0x33f9('0x2'),'update'];function createListener(_0x1c569e,_0x1262c2){return function(_0x44b6f6){_0x1262c2[_0x33f9('0x3')](_0x1c569e,_0x44b6f6);};}function removeListener(_0x2e062b,_0x4cc008){return function(){SmsMessageEvents[_0x33f9('0x4')](_0x2e062b,_0x4cc008);};}exports[_0x33f9('0x5')]=function(_0x240e95){for(var _0x1def77=0x0,_0x2114d9=events[_0x33f9('0x6')];_0x1def77<_0x2114d9;_0x1def77++){var _0xdcc83d=events[_0x1def77];var _0x483eed=createListener(_0x33f9('0x7')+_0xdcc83d,_0x240e95);SmsMessageEvents['on'](_0xdcc83d,_0x483eed);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6a10c78..0b064d8 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 _0xbd60=['describe','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x35114d,_0x259367){var _0x49ed72=function(_0x5ea3e7){while(--_0x5ea3e7){_0x35114d['push'](_0x35114d['shift']());}};_0x49ed72(++_0x259367);}(_0xbd60,0x1f2));var _0x0bd6=function(_0x400b64,_0x5eb1bf){_0x400b64=_0x400b64-0x0;var _0x1d615d=_0xbd60[_0x400b64];return _0x1d615d;};'use strict';var multer=require(_0x0bd6('0x0'));var util=require(_0x0bd6('0x1'));var path=require('path');var timeout=require(_0x0bd6('0x2'));var express=require('express');var router=express[_0x0bd6('0x3')]();var fs_extra=require(_0x0bd6('0x4'));var auth=require(_0x0bd6('0x5'));var interaction=require(_0x0bd6('0x6'));var config=require(_0x0bd6('0x7'));var controller=require('./smsQueue.controller');router[_0x0bd6('0x8')]('/',auth[_0x0bd6('0x9')](),controller[_0x0bd6('0xa')]);router[_0x0bd6('0x8')](_0x0bd6('0xb'),auth[_0x0bd6('0x9')](),controller[_0x0bd6('0xc')]);router[_0x0bd6('0x8')]('/:id',auth[_0x0bd6('0x9')](),controller[_0x0bd6('0xd')]);router[_0x0bd6('0x8')](_0x0bd6('0xe'),auth['isAuthenticated'](),controller[_0x0bd6('0xf')]);router[_0x0bd6('0x8')]('/:id/teams',auth[_0x0bd6('0x9')](),controller['getTeams']);router[_0x0bd6('0x8')](_0x0bd6('0x10'),auth['isAuthenticated'](),controller[_0x0bd6('0x11')]);router[_0x0bd6('0x12')]('/',auth['isAuthenticated'](),controller[_0x0bd6('0x13')]);router[_0x0bd6('0x12')](_0x0bd6('0x14'),auth[_0x0bd6('0x9')](),controller[_0x0bd6('0x15')]);router[_0x0bd6('0x12')](_0x0bd6('0x10'),auth[_0x0bd6('0x9')](),controller[_0x0bd6('0x16')]);router[_0x0bd6('0x17')](_0x0bd6('0x18'),auth['isAuthenticated'](),controller[_0x0bd6('0x19')]);router[_0x0bd6('0x1a')](_0x0bd6('0x18'),auth[_0x0bd6('0x9')](),controller[_0x0bd6('0x1b')]);router[_0x0bd6('0x1a')](_0x0bd6('0x14'),auth[_0x0bd6('0x9')](),controller['removeTeams']);router[_0x0bd6('0x1a')](_0x0bd6('0x10'),auth[_0x0bd6('0x9')](),controller[_0x0bd6('0x1c')]);module[_0x0bd6('0x1d')]=router; \ No newline at end of file +var _0xbe6f=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports'];(function(_0x2662ce,_0x1dcfb5){var _0x516d96=function(_0x23330f){while(--_0x23330f){_0x2662ce['push'](_0x2662ce['shift']());}};_0x516d96(++_0x1dcfb5);}(_0xbe6f,0x105));var _0xfbe6=function(_0x29e9f8,_0x46f264){_0x29e9f8=_0x29e9f8-0x0;var _0x5a2806=_0xbe6f[_0x29e9f8];return _0x5a2806;};'use strict';var multer=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var path=require('path');var timeout=require(_0xfbe6('0x2'));var express=require('express');var router=express[_0xfbe6('0x3')]();var fs_extra=require(_0xfbe6('0x4'));var auth=require(_0xfbe6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbe6('0x6'));var controller=require('./smsQueue.controller');router[_0xfbe6('0x7')]('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x9')]);router[_0xfbe6('0x7')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xb')]);router[_0xfbe6('0x7')](_0xfbe6('0xc'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xd')]);router[_0xfbe6('0x7')](_0xfbe6('0xe'),auth['isAuthenticated'](),controller[_0xfbe6('0xf')]);router[_0xfbe6('0x7')](_0xfbe6('0x10'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x11')]);router[_0xfbe6('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x12')]);router[_0xfbe6('0x13')](_0xfbe6('0x10'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x14')]);router[_0xfbe6('0x13')](_0xfbe6('0x15'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x16')]);router[_0xfbe6('0x17')](_0xfbe6('0xc'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x18')]);router[_0xfbe6('0x19')]('/:id',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x1a')]);router[_0xfbe6('0x19')](_0xfbe6('0x10'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x1b')]);router['delete'](_0xfbe6('0x15'),auth[_0xfbe6('0x8')](),controller['removeAgents']);module[_0xfbe6('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 d94b21f..65cc596 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 _0x4332=['exports','name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x2e6300,_0x21fdb5){var _0x57f545=function(_0x3e2eb1){while(--_0x3e2eb1){_0x2e6300['push'](_0x2e6300['shift']());}};_0x57f545(++_0x21fdb5);}(_0x4332,0x1e7));var _0x2433=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4332[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2433('0x0'));module[_0x2433('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2433('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2433('0x3')]},'timeout':{'type':Sequelize[_0x2433('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2433('0x5')]('rrmemory',_0x2433('0x6'),_0x2433('0x7'))}}; \ No newline at end of file +var _0xf596=['roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x2c0d99,_0x23fd8e){var _0x108b80=function(_0x3205a6){while(--_0x3205a6){_0x2c0d99['push'](_0x2c0d99['shift']());}};_0x108b80(++_0x23fd8e);}(_0xf596,0x1ab));var _0x6f59=function(_0x4ababa,_0x32b76e){_0x4ababa=_0x4ababa-0x0;var _0xfeb83=_0xf596[_0x4ababa];return _0xfeb83;};'use strict';var Sequelize=require(_0x6f59('0x0'));module[_0x6f59('0x1')]={'name':{'type':Sequelize[_0x6f59('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f59('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6f59('0x3')](_0x6f59('0x4'),'beepall',_0x6f59('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e99de52..a67d59f 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 _0x5bf4=['apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','type','options','SmsQueue','includeAll','include','findAll','rows','catch','show','params','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','describe','UserSmsQueue','hasOwnProperty','nolimit','pick','SmsQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','smsPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x1f7494,_0x5b816b){var _0x3b364e=function(_0x49757b){while(--_0x49757b){_0x1f7494['push'](_0x1f7494['shift']());}};_0x3b364e(++_0x5b816b);}(_0x5bf4,0x6c));var _0x45bf=function(_0x4b7ec4,_0x1c2cf7){_0x4b7ec4=_0x4b7ec4-0x0;var _0x4e7b2f=_0x5bf4[_0x4b7ec4];return _0x4e7b2f;};'use strict';var emlformat=require(_0x45bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45bf('0x2'));var moment=require(_0x45bf('0x3'));var BPromise=require(_0x45bf('0x4'));var Mustache=require(_0x45bf('0x5'));var util=require(_0x45bf('0x6'));var path=require('path');var sox=require(_0x45bf('0x7'));var csv=require(_0x45bf('0x8'));var ejs=require(_0x45bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45bf('0xa'));var squel=require('squel');var crypto=require(_0x45bf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x45bf('0xc'));var toCsv=require(_0x45bf('0x8'));var querystring=require('querystring');var Papa=require(_0x45bf('0xd'));var Redis=require(_0x45bf('0xe'));var authService=require(_0x45bf('0xf'));var qs=require(_0x45bf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45bf('0x11'));var logger=require(_0x45bf('0x12'))(_0x45bf('0x13'));var utils=require(_0x45bf('0x14'));var config=require(_0x45bf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x45bf('0x16'))['db'];config[_0x45bf('0x17')]=_['defaults'](config['redis'],{'host':_0x45bf('0x18'),'port':0x18eb});var socket=require(_0x45bf('0x19'))(new Redis(config['redis']));require(_0x45bf('0x1a'))['register'](socket);function respondWithStatusCode(_0x5e71dd,_0x509282){_0x509282=_0x509282||0xcc;return function(_0x2c8c81){if(_0x2c8c81){return _0x5e71dd[_0x45bf('0x1b')](_0x509282);}return _0x5e71dd[_0x45bf('0x1c')](_0x509282)[_0x45bf('0x1d')]();};}function respondWithResult(_0x2be4a5,_0x12ff4d){_0x12ff4d=_0x12ff4d||0xc8;return function(_0x276ac1){if(_0x276ac1){return _0x2be4a5[_0x45bf('0x1c')](_0x12ff4d)['json'](_0x276ac1);}};}function respondWithFilteredResult(_0x5b419d,_0x43a51f){return function(_0x5a8402){if(_0x5a8402){var _0xa3e32d=typeof _0x43a51f[_0x45bf('0x1e')]===_0x45bf('0x1f')&&typeof _0x43a51f[_0x45bf('0x20')]===_0x45bf('0x1f');var _0x23dc94=_0x5a8402[_0x45bf('0x21')];var _0x36f3b3=_0xa3e32d?0x0:_0x43a51f[_0x45bf('0x1e')];var _0x29c8f1=_0xa3e32d?_0x5a8402['count']:_0x43a51f['offset']+_0x43a51f[_0x45bf('0x20')];var _0x2ee176;if(_0x29c8f1>=_0x23dc94){_0x29c8f1=_0x23dc94;_0x2ee176=0xc8;}else{_0x2ee176=0xce;}_0x5b419d[_0x45bf('0x1c')](_0x2ee176);return _0x5b419d[_0x45bf('0x22')](_0x45bf('0x23'),_0x36f3b3+'-'+_0x29c8f1+'/'+_0x23dc94)[_0x45bf('0x24')](_0x5a8402);}return null;};}function patchUpdates(_0x585657){return function(_0x573754){try{jsonpatch[_0x45bf('0x25')](_0x573754,_0x585657,!![]);}catch(_0x598ce7){return BPromise[_0x45bf('0x26')](_0x598ce7);}return _0x573754[_0x45bf('0x27')]();};}function saveUpdates(_0x1dd82a,_0x4767fa){return function(_0x49f8a){if(_0x49f8a){return _0x49f8a[_0x45bf('0x28')](_0x1dd82a)[_0x45bf('0x29')](function(_0x2b44a0){return _0x2b44a0;});}return null;};}function removeEntity(_0x61d1ba,_0x1e6dd0){return function(_0xa8b1c3){if(_0xa8b1c3){return _0xa8b1c3[_0x45bf('0x2a')]()[_0x45bf('0x29')](function(){var _0x2a739d=_0xa8b1c3[_0x45bf('0x2b')]({'plain':!![]});var _0x2dfc6=_0x45bf('0x2c');return db[_0x45bf('0x2d')][_0x45bf('0x2a')]({'where':{'type':_0x2dfc6,'resourceId':_0x2a739d['id']}})['then'](function(){return _0xa8b1c3;});})[_0x45bf('0x29')](function(){_0x61d1ba[_0x45bf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecb5f,_0x1b176d){return function(_0x566508){if(!_0x566508){_0x3ecb5f[_0x45bf('0x1b')](0x194);}return _0x566508;};}function handleError(_0x4d5c58,_0x467bf1){_0x467bf1=_0x467bf1||0x1f4;return function(_0xf10347){logger[_0x45bf('0x2e')](_0xf10347[_0x45bf('0x2f')]);if(_0xf10347[_0x45bf('0x30')]){delete _0xf10347[_0x45bf('0x30')];}_0x4d5c58[_0x45bf('0x1c')](_0x467bf1)['send'](_0xf10347);};}exports[_0x45bf('0x31')]=function(_0x53f6e9,_0x10f573){var _0x407746={},_0xe1bc4={},_0x59c07d={'count':0x0,'rows':[]};var _0x5d2664=_['map'](db['SmsQueue'][_0x45bf('0x32')],function(_0x7cad5b){return{'name':_0x7cad5b[_0x45bf('0x33')],'type':_0x7cad5b['type']['key']};});_0xe1bc4[_0x45bf('0x34')]=_[_0x45bf('0x35')](_0x5d2664,_0x45bf('0x30'));_0xe1bc4[_0x45bf('0x36')]=_[_0x45bf('0x37')](_0x53f6e9[_0x45bf('0x36')]);_0xe1bc4[_0x45bf('0x38')]=_[_0x45bf('0x39')](_0xe1bc4[_0x45bf('0x34')],_0xe1bc4[_0x45bf('0x36')]);_0x407746[_0x45bf('0x3a')]=_[_0x45bf('0x39')](_0xe1bc4['model'],qs[_0x45bf('0x3b')](_0x53f6e9[_0x45bf('0x36')][_0x45bf('0x3b')]));_0x407746[_0x45bf('0x3a')]=_0x407746[_0x45bf('0x3a')][_0x45bf('0x3c')]?_0x407746[_0x45bf('0x3a')]:_0xe1bc4[_0x45bf('0x34')];if(!_0x53f6e9['query']['hasOwnProperty']('nolimit')){_0x407746['limit']=qs[_0x45bf('0x20')](_0x53f6e9[_0x45bf('0x36')][_0x45bf('0x20')]);_0x407746[_0x45bf('0x1e')]=qs['offset'](_0x53f6e9[_0x45bf('0x36')]['offset']);}_0x407746[_0x45bf('0x3d')]=qs[_0x45bf('0x3e')](_0x53f6e9[_0x45bf('0x36')][_0x45bf('0x3e')]);_0x407746[_0x45bf('0x3f')]=qs[_0x45bf('0x38')](_['pick'](_0x53f6e9[_0x45bf('0x36')],_0xe1bc4[_0x45bf('0x38')]),_0x5d2664);if(_0x53f6e9[_0x45bf('0x36')]['filter']){_0x407746[_0x45bf('0x3f')]=_[_0x45bf('0x40')](_0x407746[_0x45bf('0x3f')],{'$or':_[_0x45bf('0x35')](_0x5d2664,function(_0x5a1379){if(_0x5a1379[_0x45bf('0x41')]!=='VIRTUAL'){var _0x1014ea={};_0x1014ea[_0x5a1379['name']]={'$like':'%'+_0x53f6e9[_0x45bf('0x36')]['filter']+'%'};return _0x1014ea;}})});}_0x407746=_[_0x45bf('0x40')]({},_0x407746,_0x53f6e9[_0x45bf('0x42')]);var _0x588d5d={'where':_0x407746['where']};return db[_0x45bf('0x43')]['count'](_0x588d5d)['then'](function(_0x344e4f){_0x59c07d[_0x45bf('0x21')]=_0x344e4f;if(_0x53f6e9[_0x45bf('0x36')][_0x45bf('0x44')]){_0x407746[_0x45bf('0x45')]=[{'all':!![]}];}return db[_0x45bf('0x43')][_0x45bf('0x46')](_0x407746);})[_0x45bf('0x29')](function(_0x3e680f){_0x59c07d[_0x45bf('0x47')]=_0x3e680f;return _0x59c07d;})['then'](respondWithFilteredResult(_0x10f573,_0x407746))[_0x45bf('0x48')](handleError(_0x10f573,null));};exports[_0x45bf('0x49')]=function(_0x54af5c,_0x343743){var _0x2d761b={'raw':!![],'where':{'id':_0x54af5c[_0x45bf('0x4a')]['id']}},_0x125bff={};_0x125bff['model']=_[_0x45bf('0x37')](db[_0x45bf('0x43')][_0x45bf('0x32')]);_0x125bff['query']=_['keys'](_0x54af5c[_0x45bf('0x36')]);_0x125bff[_0x45bf('0x38')]=_[_0x45bf('0x39')](_0x125bff[_0x45bf('0x34')],_0x125bff[_0x45bf('0x36')]);_0x2d761b[_0x45bf('0x3a')]=_[_0x45bf('0x39')](_0x125bff['model'],qs[_0x45bf('0x3b')](_0x54af5c[_0x45bf('0x36')][_0x45bf('0x3b')]));_0x2d761b['attributes']=_0x2d761b['attributes'][_0x45bf('0x3c')]?_0x2d761b[_0x45bf('0x3a')]:_0x125bff[_0x45bf('0x34')];if(_0x54af5c[_0x45bf('0x36')]['includeAll']){_0x2d761b[_0x45bf('0x45')]=[{'all':!![]}];}_0x2d761b=_[_0x45bf('0x40')]({},_0x2d761b,_0x54af5c[_0x45bf('0x42')]);return db['SmsQueue']['find'](_0x2d761b)[_0x45bf('0x29')](handleEntityNotFound(_0x343743,null))[_0x45bf('0x29')](respondWithResult(_0x343743,null))[_0x45bf('0x48')](handleError(_0x343743,null));};exports['create']=function(_0x23ba83,_0x2ebd68){return db[_0x45bf('0x43')][_0x45bf('0x4b')](_0x23ba83[_0x45bf('0x4c')],{})[_0x45bf('0x29')](function(_0x2552fc){var _0x19ac94=_0x23ba83[_0x45bf('0x4d')][_0x45bf('0x2b')]({'plain':!![]});if(!_0x19ac94)throw new Error(_0x45bf('0x4e'));if(_0x19ac94[_0x45bf('0x4f')]===_0x45bf('0x4d')){var _0x3f45e6=_0x2552fc['get']({'plain':!![]});var _0x49e0d5=_0x45bf('0x2c');return db[_0x45bf('0x50')][_0x45bf('0x51')]({'where':{'name':_0x49e0d5,'userProfileId':_0x19ac94[_0x45bf('0x52')]},'raw':!![]})[_0x45bf('0x29')](function(_0x435950){if(_0x435950&&_0x435950[_0x45bf('0x53')]===0x0){return db[_0x45bf('0x2d')][_0x45bf('0x4b')]({'name':_0x3f45e6[_0x45bf('0x30')],'resourceId':_0x3f45e6['id'],'type':_0x435950[_0x45bf('0x30')],'sectionId':_0x435950['id']},{})[_0x45bf('0x29')](function(){return _0x2552fc;});}else{return _0x2552fc;}})[_0x45bf('0x48')](function(_0x1952fe){logger[_0x45bf('0x2e')](_0x45bf('0x54'),_0x1952fe);throw _0x1952fe;});}return _0x2552fc;})['then'](respondWithResult(_0x2ebd68,0xc9))['catch'](handleError(_0x2ebd68,null));};exports[_0x45bf('0x28')]=function(_0x25796d,_0x426032){if(_0x25796d[_0x45bf('0x4c')]['id']){delete _0x25796d[_0x45bf('0x4c')]['id'];}return db[_0x45bf('0x43')][_0x45bf('0x51')]({'where':{'id':_0x25796d[_0x45bf('0x4a')]['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x426032,null))[_0x45bf('0x29')](saveUpdates(_0x25796d[_0x45bf('0x4c')],null))[_0x45bf('0x29')](respondWithResult(_0x426032,null))[_0x45bf('0x48')](handleError(_0x426032,null));};exports['destroy']=function(_0x533b54,_0x2bc1ac){return db[_0x45bf('0x43')][_0x45bf('0x51')]({'where':{'id':_0x533b54['params']['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x2bc1ac,null))[_0x45bf('0x29')](removeEntity(_0x2bc1ac,null))[_0x45bf('0x48')](handleError(_0x2bc1ac,null));};exports['describe']=function(_0x4f3afe,_0x4be471){return db['SmsQueue'][_0x45bf('0x55')]()[_0x45bf('0x29')](respondWithResult(_0x4be471,null))['catch'](handleError(_0x4be471,null));};exports['getMembers']=function(_0x18fe6e,_0x3a3cc0,_0x3e2058){var _0xc92959={'raw':!![],'where':{}},_0x1e2b11={},_0x4d9fca;return db[_0x45bf('0x43')]['findOne']({'where':{'id':_0x18fe6e['params']['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x3a3cc0,null))[_0x45bf('0x29')](function(_0x4fd5ad){if(_0x4fd5ad){_0x4d9fca=_0x4fd5ad[_0x45bf('0x2b')]({'plain':!![]});_0x1e2b11[_0x45bf('0x34')]=_['keys'](db[_0x45bf('0x56')][_0x45bf('0x32')]);_0x1e2b11[_0x45bf('0x36')]=_[_0x45bf('0x37')](_0x18fe6e['query']);_0x1e2b11['filters']=_[_0x45bf('0x39')](_0x1e2b11[_0x45bf('0x34')],_0x1e2b11['query']);_0xc92959['attributes']=_[_0x45bf('0x39')](_0x1e2b11[_0x45bf('0x34')],qs[_0x45bf('0x3b')](_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x3b')]));_0xc92959[_0x45bf('0x3a')]=_0xc92959[_0x45bf('0x3a')][_0x45bf('0x3c')]?_0xc92959[_0x45bf('0x3a')]:_0x1e2b11['model'];if(!_0x18fe6e['query'][_0x45bf('0x57')](_0x45bf('0x58'))){_0xc92959[_0x45bf('0x20')]=qs[_0x45bf('0x20')](_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x20')]);_0xc92959['offset']=qs[_0x45bf('0x1e')](_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x1e')]);}_0xc92959['order']=qs[_0x45bf('0x3e')](_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x3e')]);_0xc92959[_0x45bf('0x3f')]=qs[_0x45bf('0x38')](_[_0x45bf('0x59')](_0x18fe6e['query'],_0x1e2b11[_0x45bf('0x38')]));_0xc92959[_0x45bf('0x3f')][_0x45bf('0x5a')]=_0x4fd5ad['id'];if(_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x5b')]){_0xc92959[_0x45bf('0x3f')]=_[_0x45bf('0x40')](_0xc92959[_0x45bf('0x3f')],{'$or':_[_0x45bf('0x35')](_0xc92959[_0x45bf('0x3a')],function(_0x1c55ed){var _0x2fb06b={};_0x2fb06b[_0x1c55ed]={'$like':'%'+_0x18fe6e[_0x45bf('0x36')][_0x45bf('0x5b')]+'%'};return _0x2fb06b;})});}_0xc92959=_[_0x45bf('0x40')]({},_0xc92959,_0x18fe6e[_0x45bf('0x42')]);return db[_0x45bf('0x56')][_0x45bf('0x46')](_0xc92959);}})[_0x45bf('0x29')](function(_0x14acf8){if(_0x14acf8){return db[_0x45bf('0x5c')][_0x45bf('0x5d')]({'where':{'id':_[_0x45bf('0x35')](_0x14acf8,_0x45bf('0x5e')),'role':_0x45bf('0x5f')},'attributes':['id','name','smsPause',_0x45bf('0x60'),_0x45bf('0x61')]});}})[_0x45bf('0x29')](function(_0xa8fda5){if(_0xa8fda5){return{'count':_0xa8fda5['count'],'rows':_[_0x45bf('0x35')](_0xa8fda5[_0x45bf('0x47')],function(_0xf1cb5a){return{'membername':_0xf1cb5a['name'],'UserId':_0xf1cb5a['id'],'queue_name':_0x4d9fca[_0x45bf('0x30')],'SmsQueueId':_0x4d9fca['id'],'interface':util[_0x45bf('0x62')]('%s/%s',_0x45bf('0x63'),_0xf1cb5a['name']),'penalty':0x0,'paused':_0xf1cb5a[_0x45bf('0x64')],'createdAt':_0xf1cb5a['createdAt'],'updatedAt':_0xf1cb5a[_0x45bf('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a3cc0,_0xc92959))['catch'](handleError(_0x3a3cc0,null));};exports[_0x45bf('0x65')]=function(_0x4e1634,_0x3d2e4b,_0xa9cd5a){var _0x19349a={};var _0x12020a={};var _0x525424;var _0x508bd2;return db[_0x45bf('0x43')]['findOne']({'where':{'id':_0x4e1634[_0x45bf('0x4a')]['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x3d2e4b,null))[_0x45bf('0x29')](function(_0x31197b){if(_0x31197b){_0x525424=_0x31197b;_0x12020a[_0x45bf('0x34')]=_[_0x45bf('0x37')](db[_0x45bf('0x66')][_0x45bf('0x32')]);_0x12020a['query']=_[_0x45bf('0x37')](_0x4e1634['query']);_0x12020a['filters']=_[_0x45bf('0x39')](_0x12020a['model'],_0x12020a[_0x45bf('0x36')]);_0x19349a[_0x45bf('0x3a')]=_['intersection'](_0x12020a['model'],qs[_0x45bf('0x3b')](_0x4e1634['query']['fields']));_0x19349a[_0x45bf('0x3a')]=_0x19349a[_0x45bf('0x3a')][_0x45bf('0x3c')]?_0x19349a['attributes']:_0x12020a['model'];_0x19349a[_0x45bf('0x3d')]=qs[_0x45bf('0x3e')](_0x4e1634[_0x45bf('0x36')][_0x45bf('0x3e')]);_0x19349a[_0x45bf('0x3f')]=qs[_0x45bf('0x38')](_['pick'](_0x4e1634[_0x45bf('0x36')],_0x12020a[_0x45bf('0x38')]));if(_0x4e1634[_0x45bf('0x36')]['filter']){_0x19349a[_0x45bf('0x3f')]=_['merge'](_0x19349a['where'],{'$or':_['map'](_0x19349a[_0x45bf('0x3a')],function(_0x3e76b6){var _0x4fd7a9={};_0x4fd7a9[_0x3e76b6]={'$like':'%'+_0x4e1634['query'][_0x45bf('0x5b')]+'%'};return _0x4fd7a9;})});}_0x19349a=_['merge']({},_0x19349a,_0x4e1634['options']);return _0x525424[_0x45bf('0x65')](_0x19349a);}})[_0x45bf('0x29')](function(_0x3d679d){if(_0x3d679d){_0x508bd2=_0x3d679d[_0x45bf('0x3c')];if(!_0x4e1634[_0x45bf('0x36')][_0x45bf('0x57')](_0x45bf('0x58'))){_0x19349a['limit']=qs['limit'](_0x4e1634[_0x45bf('0x36')][_0x45bf('0x20')]);_0x19349a[_0x45bf('0x1e')]=qs[_0x45bf('0x1e')](_0x4e1634[_0x45bf('0x36')][_0x45bf('0x1e')]);}return _0x525424[_0x45bf('0x65')](_0x19349a);}})['then'](function(_0x5819f7){if(_0x5819f7){return _0x5819f7?{'count':_0x508bd2,'rows':_0x5819f7}:null;}})[_0x45bf('0x29')](respondWithResult(_0x3d2e4b,null))['catch'](handleError(_0x3d2e4b,null));};exports[_0x45bf('0x67')]=function(_0x29ce87,_0xca3049,_0x5bf663){var _0x3ed775=_0x29ce87['body'][_0x45bf('0x68')];return db[_0x45bf('0x66')][_0x45bf('0x46')]({'where':{'id':_0x3ed775},'attributes':['id'],'include':[{'model':db['User'],'as':_0x45bf('0x69'),'attributes':['id',_0x45bf('0x30'),_0x45bf('0x6a'),_0x45bf('0x6b'),_0x45bf('0x6c')],'raw':!![]}]})[_0x45bf('0x29')](function(_0x6b314b){if(_0x6b314b){var _0x4b6e22=_['flatMap'](_0x6b314b,function(_0x5d5c7c){var _0x13058e=_0x5d5c7c[_0x45bf('0x2b')]({'plain':!![]});return _0x13058e['Agents'];});return db[_0x45bf('0x43')][_0x45bf('0x51')]({'where':{'id':_0x29ce87['params']['id']}})[_0x45bf('0x29')](function(_0x4e882a){return db[_0x45bf('0x6d')][_0x45bf('0x6e')](function(_0x58bdb5){return _0x4e882a[_0x45bf('0x67')](_0x3ed775,{'transaction':_0x58bdb5})[_0x45bf('0x29')](function(){return BPromise[_0x45bf('0x6f')](_0x4b6e22,function(_0x40afae){return db[_0x45bf('0x56')][_0x45bf('0x70')]({'where':{'UserId':_0x40afae['id'],'SmsQueueId':_0x29ce87[_0x45bf('0x4a')]['id']},'transaction':_0x58bdb5});});})[_0x45bf('0x29')](function(){_0x4b6e22[_0x45bf('0x71')](function(_0x5dcda1){socket['emit'](_0x45bf('0x72'),{'UserId':_0x5dcda1['id'],'SmsQueueId':_0x4e882a['id']});});});});});}})[_0x45bf('0x29')](respondWithStatusCode(_0xca3049,null))['catch'](handleError(_0xca3049,null));};exports[_0x45bf('0x73')]=function(_0x205689,_0x993268,_0x5b2416){return db['Team']['findAll']({'where':{'id':_0x205689[_0x45bf('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x45bf('0x5c')],'as':_0x45bf('0x69'),'attributes':['id'],'raw':!![]}]})[_0x45bf('0x29')](handleEntityNotFound(_0x993268,null))['then'](function(_0x35a1ca){var _0x4d5511=_[_0x45bf('0x35')](_0x35a1ca,'id');var _0x154d21=[];var _0x4ae681=[];var _0x4d56c0=squel['select']();_0x4d56c0[_0x45bf('0x74')](_0x45bf('0x75'))[_0x45bf('0x76')](_0x45bf('0x77'),'tq')[_0x45bf('0x78')](_0x45bf('0x79'),'ut',_0x45bf('0x7a'))[_0x45bf('0x3f')]('SmsQueueId\x20=\x20?',_0x205689['params']['id']);for(var _0x14cc01=0x0;_0x14cc01<_0x35a1ca[_0x45bf('0x3c')];_0x14cc01+=0x1){let _0x9dc27d=_0x35a1ca[_0x14cc01];for(var _0x5cc082=0x0;_0x5cc082<_0x9dc27d[_0x45bf('0x69')]['length'];_0x5cc082+=0x1){let _0x256035=_0x9dc27d['Agents'][_0x5cc082];var _0x20a831=_0x4d56c0['clone']();_0x20a831[_0x45bf('0x3f')](_0x45bf('0x7b'),_0x256035['id']);_0x4ae681[_0x45bf('0x7c')](db['sequelize'][_0x45bf('0x36')](_0x20a831[_0x45bf('0x7d')](),{'type':db['sequelize'][_0x45bf('0x7e')][_0x45bf('0x7f')]})[_0x45bf('0x29')](function(_0xba79ab){if(_0xba79ab[_0x45bf('0x3c')]===0x1){return _0x256035['id'];}else{var _0x265fe8=_[_0x45bf('0x80')](_[_0x45bf('0x35')](_0xba79ab,_0x45bf('0x81')),function(_0x433b0b){return _[_0x45bf('0x82')](_0x4d5511,_0x433b0b);});if(_0x265fe8){return _0x256035['id'];}}}));}}return BPromise[_0x45bf('0x83')](_0x4ae681)[_0x45bf('0x29')](function(_0x36b0c3){_0x154d21=_(_0x154d21)[_0x45bf('0x84')](_0x36b0c3)[_0x45bf('0x85')]()[_0x45bf('0x86')]();return db[_0x45bf('0x43')]['find']({'where':{'id':_0x205689[_0x45bf('0x4a')]['id']}})['then'](function(_0x54d49d){return db['sequelize'][_0x45bf('0x6e')](function(_0x3ad41d){return _0x54d49d[_0x45bf('0x73')](_0x205689[_0x45bf('0x36')]['ids'],{'transaction':_0x3ad41d})['then'](function(){if(!_[_0x45bf('0x87')](_0x154d21)){return _0x54d49d[_0x45bf('0x88')](_0x154d21,{'transaction':_0x3ad41d});}})[_0x45bf('0x29')](function(){_0x154d21[_0x45bf('0x71')](function(_0x2c436a){socket[_0x45bf('0x89')](_0x45bf('0x8a'),{'UserId':_0x2c436a,'SmsQueueId':_0x54d49d['id']});});});});});});})[_0x45bf('0x29')](respondWithStatusCode(_0x993268,null))[_0x45bf('0x48')](handleError(_0x993268,null));};exports[_0x45bf('0x8b')]=function(_0x132947,_0x2b73f4,_0x4e8dd0){return db['SmsQueue'][_0x45bf('0x51')]({'where':{'id':_0x132947[_0x45bf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b73f4,null))[_0x45bf('0x29')](function(_0x3101f5){if(_0x3101f5){return _0x3101f5[_0x45bf('0x8b')](_0x132947[_0x45bf('0x4c')][_0x45bf('0x68')],_[_0x45bf('0x8c')](_0x132947[_0x45bf('0x4c')],[_0x45bf('0x68'),'id'])||{})[_0x45bf('0x8d')](function(_0x2283e2){for(var _0x3e9713=0x0;_0x3e9713<_0x132947[_0x45bf('0x4c')][_0x45bf('0x68')][_0x45bf('0x3c')];_0x3e9713+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x132947['body'][_0x45bf('0x68')][_0x3e9713]),'SmsQueueId':Number(_0x132947[_0x45bf('0x4a')]['id'])});}return _0x2283e2;});}})[_0x45bf('0x29')](respondWithResult(_0x2b73f4,null))['catch'](handleError(_0x2b73f4,null));};exports['removeAgents']=function(_0x256d25,_0x46db14,_0x5dbf18){return db['SmsQueue'][_0x45bf('0x51')]({'where':{'id':_0x256d25[_0x45bf('0x4a')]['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x46db14,null))['then'](function(_0x5e838c){if(_0x5e838c){return _0x5e838c['removeAgents'](_0x256d25[_0x45bf('0x36')][_0x45bf('0x68')])[_0x45bf('0x29')](function(){if(_[_0x45bf('0x8e')](_0x256d25[_0x45bf('0x36')][_0x45bf('0x68')])){for(var _0x5f0a52=0x0;_0x5f0a52<_0x256d25['query'][_0x45bf('0x68')]['length'];_0x5f0a52+=0x1){socket[_0x45bf('0x89')](_0x45bf('0x8a'),{'UserId':Number(_0x256d25['query'][_0x45bf('0x68')][_0x5f0a52]),'SmsQueueId':Number(_0x256d25[_0x45bf('0x4a')]['id'])});}}else{socket[_0x45bf('0x89')](_0x45bf('0x8a'),{'UserId':Number(_0x256d25[_0x45bf('0x36')][_0x45bf('0x68')]),'SmsQueueId':Number(_0x256d25[_0x45bf('0x4a')]['id'])});}});}})[_0x45bf('0x29')](respondWithStatusCode(_0x46db14,null))['catch'](handleError(_0x46db14,null));};exports[_0x45bf('0x8f')]=function(_0x1e5146,_0x94216b,_0x275df5){var _0x1131b3={};var _0x28445a={};var _0x531954;var _0xb52260;return db['SmsQueue'][_0x45bf('0x90')]({'where':{'id':_0x1e5146['params']['id']}})[_0x45bf('0x29')](handleEntityNotFound(_0x94216b,null))['then'](function(_0x18769e){if(_0x18769e){_0x531954=_0x18769e;_0x28445a['model']=_[_0x45bf('0x37')](db['User'][_0x45bf('0x32')]);_0x28445a[_0x45bf('0x36')]=_[_0x45bf('0x37')](_0x1e5146[_0x45bf('0x36')]);_0x28445a[_0x45bf('0x38')]=_[_0x45bf('0x39')](_0x28445a[_0x45bf('0x34')],_0x28445a[_0x45bf('0x36')]);_0x1131b3[_0x45bf('0x3a')]=_[_0x45bf('0x39')](_0x28445a[_0x45bf('0x34')],qs['fields'](_0x1e5146[_0x45bf('0x36')][_0x45bf('0x3b')]));_0x1131b3[_0x45bf('0x3a')]=_0x1131b3['attributes'][_0x45bf('0x3c')]?_0x1131b3[_0x45bf('0x3a')]:_0x28445a[_0x45bf('0x34')];_0x1131b3[_0x45bf('0x3d')]=qs[_0x45bf('0x3e')](_0x1e5146['query'][_0x45bf('0x3e')]);_0x1131b3[_0x45bf('0x3f')]=qs[_0x45bf('0x38')](_['pick'](_0x1e5146[_0x45bf('0x36')],_0x28445a['filters']));if(_0x1e5146[_0x45bf('0x36')][_0x45bf('0x5b')]){_0x1131b3[_0x45bf('0x3f')]=_['merge'](_0x1131b3[_0x45bf('0x3f')],{'$or':_[_0x45bf('0x35')](_0x1131b3[_0x45bf('0x3a')],function(_0x4b011b){var _0x32e6ca={};_0x32e6ca[_0x4b011b]={'$like':'%'+_0x1e5146[_0x45bf('0x36')]['filter']+'%'};return _0x32e6ca;})});}_0x1131b3=_['merge']({},_0x1131b3,_0x1e5146[_0x45bf('0x42')]);return _0x531954[_0x45bf('0x8f')](_0x1131b3);}})[_0x45bf('0x29')](function(_0x1e33e3){if(_0x1e33e3){_0xb52260=_0x1e33e3['length'];if(!_0x1e5146[_0x45bf('0x36')]['hasOwnProperty'](_0x45bf('0x58'))){_0x1131b3[_0x45bf('0x20')]=qs[_0x45bf('0x20')](_0x1e5146['query']['limit']);_0x1131b3['offset']=qs[_0x45bf('0x1e')](_0x1e5146[_0x45bf('0x36')]['offset']);}return _0x531954['getAgents'](_0x1131b3);}})[_0x45bf('0x29')](function(_0x4ca5d8){if(_0x4ca5d8){return _0x4ca5d8?{'count':_0xb52260,'rows':_0x4ca5d8}:null;}})[_0x45bf('0x29')](respondWithResult(_0x94216b,null))[_0x45bf('0x48')](handleError(_0x94216b,null));}; \ No newline at end of file +var _0x9fbe=['role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserSmsQueue','pick','findAll','User','smsPause','updatedAt','createdAt','format','%s/%s','findOne','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','value','addAgents','spread','removeAgents','isArray','userSmsQueue:remove','getAgents','zip-dir','bluebird','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','name','send','index','SmsQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','VIRTUAL','filter','merge','includeAll','include','rows','params','keys','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x362c14,_0x30e038){var _0xf9d18e=function(_0x389996){while(--_0x389996){_0x362c14['push'](_0x362c14['shift']());}};_0xf9d18e(++_0x30e038);}(_0x9fbe,0x140));var _0xe9fb=function(_0x3e4006,_0x6690ec){_0x3e4006=_0x3e4006-0x0;var _0x2553c2=_0x9fbe[_0x3e4006];return _0x2553c2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9fb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9fb('0x1'));var Mustache=require('mustache');var util=require(_0xe9fb('0x2'));var path=require(_0xe9fb('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9fb('0x4'));var _=require(_0xe9fb('0x5'));var squel=require(_0xe9fb('0x6'));var crypto=require(_0xe9fb('0x7'));var jsforce=require(_0xe9fb('0x8'));var deskjs=require(_0xe9fb('0x9'));var toCsv=require('to-csv');var querystring=require(_0xe9fb('0xa'));var Papa=require(_0xe9fb('0xb'));var Redis=require('ioredis');var authService=require(_0xe9fb('0xc'));var qs=require(_0xe9fb('0xd'));var as=require(_0xe9fb('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9fb('0xf'))(_0xe9fb('0x10'));var utils=require(_0xe9fb('0x11'));var config=require(_0xe9fb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9fb('0x13'))['db'];config[_0xe9fb('0x14')]=_['defaults'](config['redis'],{'host':_0xe9fb('0x15'),'port':0x18eb});var socket=require(_0xe9fb('0x16'))(new Redis(config[_0xe9fb('0x14')]));require(_0xe9fb('0x17'))['register'](socket);function respondWithStatusCode(_0x6b2d29,_0x3a1d47){_0x3a1d47=_0x3a1d47||0xcc;return function(_0x2a9b17){if(_0x2a9b17){return _0x6b2d29[_0xe9fb('0x18')](_0x3a1d47);}return _0x6b2d29[_0xe9fb('0x19')](_0x3a1d47)[_0xe9fb('0x1a')]();};}function respondWithResult(_0x3e3aff,_0x5827e5){_0x5827e5=_0x5827e5||0xc8;return function(_0x152702){if(_0x152702){return _0x3e3aff[_0xe9fb('0x19')](_0x5827e5)[_0xe9fb('0x1b')](_0x152702);}};}function respondWithFilteredResult(_0x3a1386,_0x586fcf){return function(_0x4ca34c){if(_0x4ca34c){var _0x53de52=typeof _0x586fcf[_0xe9fb('0x1c')]==='undefined'&&typeof _0x586fcf[_0xe9fb('0x1d')]==='undefined';var _0x2c7332=_0x4ca34c[_0xe9fb('0x1e')];var _0x3b956b=_0x53de52?0x0:_0x586fcf['offset'];var _0x5fa277=_0x53de52?_0x4ca34c[_0xe9fb('0x1e')]:_0x586fcf['offset']+_0x586fcf[_0xe9fb('0x1d')];var _0x548556;if(_0x5fa277>=_0x2c7332){_0x5fa277=_0x2c7332;_0x548556=0xc8;}else{_0x548556=0xce;}_0x3a1386[_0xe9fb('0x19')](_0x548556);return _0x3a1386[_0xe9fb('0x1f')](_0xe9fb('0x20'),_0x3b956b+'-'+_0x5fa277+'/'+_0x2c7332)['json'](_0x4ca34c);}return null;};}function patchUpdates(_0x5aab2e){return function(_0xec8c3f){try{jsonpatch[_0xe9fb('0x21')](_0xec8c3f,_0x5aab2e,!![]);}catch(_0x3d02f3){return BPromise[_0xe9fb('0x22')](_0x3d02f3);}return _0xec8c3f[_0xe9fb('0x23')]();};}function saveUpdates(_0x25c6b7,_0x52ac2a){return function(_0x3aa110){if(_0x3aa110){return _0x3aa110['update'](_0x25c6b7)[_0xe9fb('0x24')](function(_0x3f2a12){return _0x3f2a12;});}return null;};}function removeEntity(_0x113754,_0x1204e0){return function(_0x501c33){if(_0x501c33){return _0x501c33[_0xe9fb('0x25')]()[_0xe9fb('0x24')](function(){var _0x373900=_0x501c33[_0xe9fb('0x26')]({'plain':!![]});var _0x175faf=_0xe9fb('0x27');return db[_0xe9fb('0x28')]['destroy']({'where':{'type':_0x175faf,'resourceId':_0x373900['id']}})[_0xe9fb('0x24')](function(){return _0x501c33;});})[_0xe9fb('0x24')](function(){_0x113754[_0xe9fb('0x19')](0xcc)[_0xe9fb('0x1a')]();});}};}function handleEntityNotFound(_0x366ad6,_0x522912){return function(_0x2b7029){if(!_0x2b7029){_0x366ad6['sendStatus'](0x194);}return _0x2b7029;};}function handleError(_0x9fa431,_0x26ec85){_0x26ec85=_0x26ec85||0x1f4;return function(_0x1f21a0){logger['error'](_0x1f21a0['stack']);if(_0x1f21a0[_0xe9fb('0x29')]){delete _0x1f21a0[_0xe9fb('0x29')];}_0x9fa431[_0xe9fb('0x19')](_0x26ec85)[_0xe9fb('0x2a')](_0x1f21a0);};}exports[_0xe9fb('0x2b')]=function(_0x44d500,_0x25ec7e){var _0x373c17={},_0x5ccb95={},_0x2b6089={'count':0x0,'rows':[]};var _0x370471=_['map'](db[_0xe9fb('0x2c')]['rawAttributes'],function(_0x21d5a0){return{'name':_0x21d5a0[_0xe9fb('0x2d')],'type':_0x21d5a0['type'][_0xe9fb('0x2e')]};});_0x5ccb95[_0xe9fb('0x2f')]=_['map'](_0x370471,_0xe9fb('0x29'));_0x5ccb95[_0xe9fb('0x30')]=_['keys'](_0x44d500[_0xe9fb('0x30')]);_0x5ccb95[_0xe9fb('0x31')]=_[_0xe9fb('0x32')](_0x5ccb95['model'],_0x5ccb95[_0xe9fb('0x30')]);_0x373c17[_0xe9fb('0x33')]=_['intersection'](_0x5ccb95[_0xe9fb('0x2f')],qs['fields'](_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x34')]));_0x373c17[_0xe9fb('0x33')]=_0x373c17[_0xe9fb('0x33')][_0xe9fb('0x35')]?_0x373c17[_0xe9fb('0x33')]:_0x5ccb95['model'];if(!_0x44d500['query'][_0xe9fb('0x36')](_0xe9fb('0x37'))){_0x373c17[_0xe9fb('0x1d')]=qs['limit'](_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x1d')]);_0x373c17['offset']=qs[_0xe9fb('0x1c')](_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x1c')]);}_0x373c17[_0xe9fb('0x38')]=qs[_0xe9fb('0x39')](_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x39')]);_0x373c17[_0xe9fb('0x3a')]=qs[_0xe9fb('0x31')](_['pick'](_0x44d500['query'],_0x5ccb95[_0xe9fb('0x31')]),_0x370471);if(_0x44d500[_0xe9fb('0x30')]['filter']){_0x373c17[_0xe9fb('0x3a')]=_['merge'](_0x373c17[_0xe9fb('0x3a')],{'$or':_[_0xe9fb('0x3b')](_0x370471,function(_0x139eb2){if(_0x139eb2['type']!==_0xe9fb('0x3c')){var _0x43b583={};_0x43b583[_0x139eb2['name']]={'$like':'%'+_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x3d')]+'%'};return _0x43b583;}})});}_0x373c17=_[_0xe9fb('0x3e')]({},_0x373c17,_0x44d500['options']);var _0x274d1a={'where':_0x373c17[_0xe9fb('0x3a')]};return db[_0xe9fb('0x2c')][_0xe9fb('0x1e')](_0x274d1a)['then'](function(_0x59b227){_0x2b6089[_0xe9fb('0x1e')]=_0x59b227;if(_0x44d500[_0xe9fb('0x30')][_0xe9fb('0x3f')]){_0x373c17[_0xe9fb('0x40')]=[{'all':!![]}];}return db[_0xe9fb('0x2c')]['findAll'](_0x373c17);})[_0xe9fb('0x24')](function(_0xf40b78){_0x2b6089[_0xe9fb('0x41')]=_0xf40b78;return _0x2b6089;})[_0xe9fb('0x24')](respondWithFilteredResult(_0x25ec7e,_0x373c17))['catch'](handleError(_0x25ec7e,null));};exports['show']=function(_0xb54e24,_0x4c36b0){var _0x5c9bb6={'raw':!![],'where':{'id':_0xb54e24[_0xe9fb('0x42')]['id']}},_0x33c831={};_0x33c831[_0xe9fb('0x2f')]=_[_0xe9fb('0x43')](db[_0xe9fb('0x2c')][_0xe9fb('0x44')]);_0x33c831['query']=_['keys'](_0xb54e24[_0xe9fb('0x30')]);_0x33c831[_0xe9fb('0x31')]=_[_0xe9fb('0x32')](_0x33c831[_0xe9fb('0x2f')],_0x33c831[_0xe9fb('0x30')]);_0x5c9bb6[_0xe9fb('0x33')]=_[_0xe9fb('0x32')](_0x33c831[_0xe9fb('0x2f')],qs[_0xe9fb('0x34')](_0xb54e24[_0xe9fb('0x30')][_0xe9fb('0x34')]));_0x5c9bb6['attributes']=_0x5c9bb6[_0xe9fb('0x33')][_0xe9fb('0x35')]?_0x5c9bb6[_0xe9fb('0x33')]:_0x33c831[_0xe9fb('0x2f')];if(_0xb54e24[_0xe9fb('0x30')][_0xe9fb('0x3f')]){_0x5c9bb6[_0xe9fb('0x40')]=[{'all':!![]}];}_0x5c9bb6=_[_0xe9fb('0x3e')]({},_0x5c9bb6,_0xb54e24[_0xe9fb('0x45')]);return db['SmsQueue'][_0xe9fb('0x46')](_0x5c9bb6)['then'](handleEntityNotFound(_0x4c36b0,null))[_0xe9fb('0x24')](respondWithResult(_0x4c36b0,null))[_0xe9fb('0x47')](handleError(_0x4c36b0,null));};exports[_0xe9fb('0x48')]=function(_0x296d21,_0x577a27){return db[_0xe9fb('0x2c')][_0xe9fb('0x48')](_0x296d21[_0xe9fb('0x49')],{})[_0xe9fb('0x24')](function(_0x2c88d4){var _0x2f5cc5=_0x296d21[_0xe9fb('0x4a')]['get']({'plain':!![]});if(!_0x2f5cc5)throw new Error(_0xe9fb('0x4b'));if(_0x2f5cc5[_0xe9fb('0x4c')]==='user'){var _0x4ff916=_0x2c88d4['get']({'plain':!![]});var _0x503208=_0xe9fb('0x27');return db[_0xe9fb('0x4d')]['find']({'where':{'name':_0x503208,'userProfileId':_0x2f5cc5[_0xe9fb('0x4e')]},'raw':!![]})[_0xe9fb('0x24')](function(_0x2c9c2c){if(_0x2c9c2c&&_0x2c9c2c[_0xe9fb('0x4f')]===0x0){return db['UserProfileResource'][_0xe9fb('0x48')]({'name':_0x4ff916[_0xe9fb('0x29')],'resourceId':_0x4ff916['id'],'type':_0x2c9c2c['name'],'sectionId':_0x2c9c2c['id']},{})['then'](function(){return _0x2c88d4;});}else{return _0x2c88d4;}})[_0xe9fb('0x47')](function(_0x4928ec){logger[_0xe9fb('0x50')](_0xe9fb('0x51'),_0x4928ec);throw _0x4928ec;});}return _0x2c88d4;})[_0xe9fb('0x24')](respondWithResult(_0x577a27,0xc9))[_0xe9fb('0x47')](handleError(_0x577a27,null));};exports['update']=function(_0x515e04,_0x464ddc){if(_0x515e04['body']['id']){delete _0x515e04[_0xe9fb('0x49')]['id'];}return db['SmsQueue'][_0xe9fb('0x46')]({'where':{'id':_0x515e04['params']['id']}})[_0xe9fb('0x24')](handleEntityNotFound(_0x464ddc,null))[_0xe9fb('0x24')](saveUpdates(_0x515e04[_0xe9fb('0x49')],null))[_0xe9fb('0x24')](respondWithResult(_0x464ddc,null))[_0xe9fb('0x47')](handleError(_0x464ddc,null));};exports[_0xe9fb('0x25')]=function(_0x158a05,_0x24f9aa){return db[_0xe9fb('0x2c')]['find']({'where':{'id':_0x158a05[_0xe9fb('0x42')]['id']}})[_0xe9fb('0x24')](handleEntityNotFound(_0x24f9aa,null))[_0xe9fb('0x24')](removeEntity(_0x24f9aa,null))[_0xe9fb('0x47')](handleError(_0x24f9aa,null));};exports[_0xe9fb('0x52')]=function(_0x820a6e,_0x435af0){return db['SmsQueue']['describe']()[_0xe9fb('0x24')](respondWithResult(_0x435af0,null))[_0xe9fb('0x47')](handleError(_0x435af0,null));};exports['getMembers']=function(_0x10610c,_0x419d0d,_0x23341f){var _0x4f7b48={'raw':!![],'where':{}},_0x59a619={},_0x8b367f;return db[_0xe9fb('0x2c')]['findOne']({'where':{'id':_0x10610c['params']['id']}})['then'](handleEntityNotFound(_0x419d0d,null))[_0xe9fb('0x24')](function(_0x3d9e99){if(_0x3d9e99){_0x8b367f=_0x3d9e99['get']({'plain':!![]});_0x59a619[_0xe9fb('0x2f')]=_[_0xe9fb('0x43')](db[_0xe9fb('0x53')]['rawAttributes']);_0x59a619[_0xe9fb('0x30')]=_[_0xe9fb('0x43')](_0x10610c[_0xe9fb('0x30')]);_0x59a619[_0xe9fb('0x31')]=_[_0xe9fb('0x32')](_0x59a619[_0xe9fb('0x2f')],_0x59a619[_0xe9fb('0x30')]);_0x4f7b48['attributes']=_['intersection'](_0x59a619[_0xe9fb('0x2f')],qs['fields'](_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x34')]));_0x4f7b48[_0xe9fb('0x33')]=_0x4f7b48[_0xe9fb('0x33')][_0xe9fb('0x35')]?_0x4f7b48[_0xe9fb('0x33')]:_0x59a619['model'];if(!_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x36')]('nolimit')){_0x4f7b48['limit']=qs['limit'](_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x1d')]);_0x4f7b48['offset']=qs[_0xe9fb('0x1c')](_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x1c')]);}_0x4f7b48[_0xe9fb('0x38')]=qs[_0xe9fb('0x39')](_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x39')]);_0x4f7b48[_0xe9fb('0x3a')]=qs[_0xe9fb('0x31')](_[_0xe9fb('0x54')](_0x10610c[_0xe9fb('0x30')],_0x59a619['filters']));_0x4f7b48[_0xe9fb('0x3a')]['SmsQueueId']=_0x3d9e99['id'];if(_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x3d')]){_0x4f7b48[_0xe9fb('0x3a')]=_[_0xe9fb('0x3e')](_0x4f7b48[_0xe9fb('0x3a')],{'$or':_[_0xe9fb('0x3b')](_0x4f7b48[_0xe9fb('0x33')],function(_0x56d621){var _0x24bbe4={};_0x24bbe4[_0x56d621]={'$like':'%'+_0x10610c[_0xe9fb('0x30')][_0xe9fb('0x3d')]+'%'};return _0x24bbe4;})});}_0x4f7b48=_['merge']({},_0x4f7b48,_0x10610c[_0xe9fb('0x45')]);return db[_0xe9fb('0x53')][_0xe9fb('0x55')](_0x4f7b48);}})[_0xe9fb('0x24')](function(_0x2f7609){if(_0x2f7609){return db[_0xe9fb('0x56')]['findAndCountAll']({'where':{'id':_[_0xe9fb('0x3b')](_0x2f7609,'UserId'),'role':'agent'},'attributes':['id','name',_0xe9fb('0x57'),_0xe9fb('0x58'),_0xe9fb('0x59')]});}})[_0xe9fb('0x24')](function(_0x217ed2){if(_0x217ed2){return{'count':_0x217ed2[_0xe9fb('0x1e')],'rows':_[_0xe9fb('0x3b')](_0x217ed2[_0xe9fb('0x41')],function(_0x1c193c){return{'membername':_0x1c193c['name'],'UserId':_0x1c193c['id'],'queue_name':_0x8b367f[_0xe9fb('0x29')],'SmsQueueId':_0x8b367f['id'],'interface':util[_0xe9fb('0x5a')](_0xe9fb('0x5b'),'SIP',_0x1c193c[_0xe9fb('0x29')]),'penalty':0x0,'paused':_0x1c193c[_0xe9fb('0x57')],'createdAt':_0x1c193c[_0xe9fb('0x59')],'updatedAt':_0x1c193c[_0xe9fb('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x419d0d,_0x4f7b48))['catch'](handleError(_0x419d0d,null));};exports['getTeams']=function(_0x5d21dc,_0x705449,_0x4bd69c){var _0xa5d48b={};var _0x2d7291={};var _0x2afecf;var _0x287f62;return db[_0xe9fb('0x2c')][_0xe9fb('0x5c')]({'where':{'id':_0x5d21dc['params']['id']}})[_0xe9fb('0x24')](handleEntityNotFound(_0x705449,null))[_0xe9fb('0x24')](function(_0x10397d){if(_0x10397d){_0x2afecf=_0x10397d;_0x2d7291[_0xe9fb('0x2f')]=_[_0xe9fb('0x43')](db[_0xe9fb('0x5d')][_0xe9fb('0x44')]);_0x2d7291[_0xe9fb('0x30')]=_['keys'](_0x5d21dc[_0xe9fb('0x30')]);_0x2d7291[_0xe9fb('0x31')]=_[_0xe9fb('0x32')](_0x2d7291['model'],_0x2d7291[_0xe9fb('0x30')]);_0xa5d48b['attributes']=_[_0xe9fb('0x32')](_0x2d7291[_0xe9fb('0x2f')],qs[_0xe9fb('0x34')](_0x5d21dc['query'][_0xe9fb('0x34')]));_0xa5d48b[_0xe9fb('0x33')]=_0xa5d48b['attributes'][_0xe9fb('0x35')]?_0xa5d48b[_0xe9fb('0x33')]:_0x2d7291[_0xe9fb('0x2f')];_0xa5d48b[_0xe9fb('0x38')]=qs[_0xe9fb('0x39')](_0x5d21dc[_0xe9fb('0x30')]['sort']);_0xa5d48b[_0xe9fb('0x3a')]=qs[_0xe9fb('0x31')](_[_0xe9fb('0x54')](_0x5d21dc[_0xe9fb('0x30')],_0x2d7291['filters']));if(_0x5d21dc[_0xe9fb('0x30')][_0xe9fb('0x3d')]){_0xa5d48b[_0xe9fb('0x3a')]=_[_0xe9fb('0x3e')](_0xa5d48b[_0xe9fb('0x3a')],{'$or':_[_0xe9fb('0x3b')](_0xa5d48b[_0xe9fb('0x33')],function(_0x1bebed){var _0x4574bc={};_0x4574bc[_0x1bebed]={'$like':'%'+_0x5d21dc[_0xe9fb('0x30')]['filter']+'%'};return _0x4574bc;})});}_0xa5d48b=_['merge']({},_0xa5d48b,_0x5d21dc[_0xe9fb('0x45')]);return _0x2afecf['getTeams'](_0xa5d48b);}})['then'](function(_0x2b8513){if(_0x2b8513){_0x287f62=_0x2b8513[_0xe9fb('0x35')];if(!_0x5d21dc[_0xe9fb('0x30')][_0xe9fb('0x36')](_0xe9fb('0x37'))){_0xa5d48b[_0xe9fb('0x1d')]=qs[_0xe9fb('0x1d')](_0x5d21dc['query'][_0xe9fb('0x1d')]);_0xa5d48b['offset']=qs['offset'](_0x5d21dc[_0xe9fb('0x30')][_0xe9fb('0x1c')]);}return _0x2afecf[_0xe9fb('0x5e')](_0xa5d48b);}})[_0xe9fb('0x24')](function(_0x2a3055){if(_0x2a3055){return _0x2a3055?{'count':_0x287f62,'rows':_0x2a3055}:null;}})[_0xe9fb('0x24')](respondWithResult(_0x705449,null))[_0xe9fb('0x47')](handleError(_0x705449,null));};exports[_0xe9fb('0x5f')]=function(_0x3b280c,_0x183cac,_0x497f53){var _0x939c6f=_0x3b280c['body']['ids'];return db['Team'][_0xe9fb('0x55')]({'where':{'id':_0x939c6f},'attributes':['id'],'include':[{'model':db[_0xe9fb('0x56')],'as':'Agents','attributes':['id',_0xe9fb('0x29'),_0xe9fb('0x60'),_0xe9fb('0x61'),_0xe9fb('0x62')],'raw':!![]}]})[_0xe9fb('0x24')](function(_0x1f0160){if(_0x1f0160){var _0x4efd20=_[_0xe9fb('0x63')](_0x1f0160,function(_0x1650b1){var _0x251608=_0x1650b1[_0xe9fb('0x26')]({'plain':!![]});return _0x251608[_0xe9fb('0x64')];});return db['SmsQueue'][_0xe9fb('0x46')]({'where':{'id':_0x3b280c[_0xe9fb('0x42')]['id']}})[_0xe9fb('0x24')](function(_0x56d595){return db[_0xe9fb('0x65')][_0xe9fb('0x66')](function(_0x2f14cc){return _0x56d595[_0xe9fb('0x5f')](_0x939c6f,{'transaction':_0x2f14cc})[_0xe9fb('0x24')](function(){return BPromise[_0xe9fb('0x67')](_0x4efd20,function(_0x436a6d){return db[_0xe9fb('0x53')][_0xe9fb('0x68')]({'where':{'UserId':_0x436a6d['id'],'SmsQueueId':_0x3b280c['params']['id']},'transaction':_0x2f14cc});});})[_0xe9fb('0x24')](function(){_0x4efd20[_0xe9fb('0x69')](function(_0x54b4f2){socket[_0xe9fb('0x6a')](_0xe9fb('0x6b'),{'UserId':_0x54b4f2['id'],'SmsQueueId':_0x56d595['id']});});});});});}})[_0xe9fb('0x24')](respondWithStatusCode(_0x183cac,null))[_0xe9fb('0x47')](handleError(_0x183cac,null));};exports[_0xe9fb('0x6c')]=function(_0x53f5d4,_0x5ab9a2,_0x5951bf){return db[_0xe9fb('0x5d')][_0xe9fb('0x55')]({'where':{'id':_0x53f5d4[_0xe9fb('0x30')][_0xe9fb('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe9fb('0x64'),'attributes':['id'],'raw':!![]}]})[_0xe9fb('0x24')](handleEntityNotFound(_0x5ab9a2,null))[_0xe9fb('0x24')](function(_0x58f3a5){var _0x4b13c4=_['map'](_0x58f3a5,'id');var _0x501e78=[];var _0x633729=[];var _0x285ed8=squel['select']();_0x285ed8['field'](_0xe9fb('0x6e'))[_0xe9fb('0x6f')](_0xe9fb('0x70'),'tq')['join'](_0xe9fb('0x71'),'ut',_0xe9fb('0x72'))['where'](_0xe9fb('0x73'),_0x53f5d4[_0xe9fb('0x42')]['id']);for(var _0x1161c2=0x0;_0x1161c2<_0x58f3a5[_0xe9fb('0x35')];_0x1161c2+=0x1){let _0x455b63=_0x58f3a5[_0x1161c2];for(var _0xdcb3e2=0x0;_0xdcb3e2<_0x455b63['Agents'][_0xe9fb('0x35')];_0xdcb3e2+=0x1){let _0x30d1cb=_0x455b63[_0xe9fb('0x64')][_0xdcb3e2];var _0x333c87=_0x285ed8[_0xe9fb('0x74')]();_0x333c87[_0xe9fb('0x3a')](_0xe9fb('0x75'),_0x30d1cb['id']);_0x633729[_0xe9fb('0x76')](db[_0xe9fb('0x65')]['query'](_0x333c87[_0xe9fb('0x77')](),{'type':db[_0xe9fb('0x65')]['QueryTypes']['SELECT']})['then'](function(_0x1dc6b2){if(_0x1dc6b2[_0xe9fb('0x35')]===0x1){return _0x30d1cb['id'];}else{var _0x4bb5fb=_[_0xe9fb('0x78')](_[_0xe9fb('0x3b')](_0x1dc6b2,_0xe9fb('0x79')),function(_0x5ad8e1){return _[_0xe9fb('0x7a')](_0x4b13c4,_0x5ad8e1);});if(_0x4bb5fb){return _0x30d1cb['id'];}}}));}}return BPromise['all'](_0x633729)[_0xe9fb('0x24')](function(_0x41024a){_0x501e78=_(_0x501e78)[_0xe9fb('0x7b')](_0x41024a)[_0xe9fb('0x7c')]()[_0xe9fb('0x7d')]();return db[_0xe9fb('0x2c')][_0xe9fb('0x46')]({'where':{'id':_0x53f5d4[_0xe9fb('0x42')]['id']}})['then'](function(_0x1f603d){return db[_0xe9fb('0x65')][_0xe9fb('0x66')](function(_0x47fb1d){return _0x1f603d['removeTeams'](_0x53f5d4[_0xe9fb('0x30')]['ids'],{'transaction':_0x47fb1d})[_0xe9fb('0x24')](function(){if(!_['isEmpty'](_0x501e78)){return _0x1f603d['removeAgents'](_0x501e78,{'transaction':_0x47fb1d});}})[_0xe9fb('0x24')](function(){_0x501e78[_0xe9fb('0x69')](function(_0x3de1f1){socket[_0xe9fb('0x6a')]('userSmsQueue:remove',{'UserId':_0x3de1f1,'SmsQueueId':_0x1f603d['id']});});});});});});})[_0xe9fb('0x24')](respondWithStatusCode(_0x5ab9a2,null))['catch'](handleError(_0x5ab9a2,null));};exports['addAgents']=function(_0x2e7579,_0x24afbc,_0x44ba18){return db[_0xe9fb('0x2c')][_0xe9fb('0x46')]({'where':{'id':_0x2e7579['params']['id']}})['then'](handleEntityNotFound(_0x24afbc,null))['then'](function(_0x3f813d){if(_0x3f813d){return _0x3f813d[_0xe9fb('0x7e')](_0x2e7579[_0xe9fb('0x49')][_0xe9fb('0x6d')],_['omit'](_0x2e7579[_0xe9fb('0x49')],['ids','id'])||{})[_0xe9fb('0x7f')](function(_0x1393bf){for(var _0x1d7ce3=0x0;_0x1d7ce3<_0x2e7579[_0xe9fb('0x49')][_0xe9fb('0x6d')][_0xe9fb('0x35')];_0x1d7ce3+=0x1){socket['emit'](_0xe9fb('0x6b'),{'UserId':Number(_0x2e7579[_0xe9fb('0x49')][_0xe9fb('0x6d')][_0x1d7ce3]),'SmsQueueId':Number(_0x2e7579['params']['id'])});}return _0x1393bf;});}})[_0xe9fb('0x24')](respondWithResult(_0x24afbc,null))['catch'](handleError(_0x24afbc,null));};exports[_0xe9fb('0x80')]=function(_0x25991c,_0x5eb871,_0x329096){return db[_0xe9fb('0x2c')][_0xe9fb('0x46')]({'where':{'id':_0x25991c[_0xe9fb('0x42')]['id']}})[_0xe9fb('0x24')](handleEntityNotFound(_0x5eb871,null))['then'](function(_0x3e616e){if(_0x3e616e){return _0x3e616e[_0xe9fb('0x80')](_0x25991c[_0xe9fb('0x30')][_0xe9fb('0x6d')])[_0xe9fb('0x24')](function(){if(_[_0xe9fb('0x81')](_0x25991c['query'][_0xe9fb('0x6d')])){for(var _0x429fef=0x0;_0x429fef<_0x25991c[_0xe9fb('0x30')][_0xe9fb('0x6d')][_0xe9fb('0x35')];_0x429fef+=0x1){socket[_0xe9fb('0x6a')](_0xe9fb('0x82'),{'UserId':Number(_0x25991c['query'][_0xe9fb('0x6d')][_0x429fef]),'SmsQueueId':Number(_0x25991c[_0xe9fb('0x42')]['id'])});}}else{socket[_0xe9fb('0x6a')](_0xe9fb('0x82'),{'UserId':Number(_0x25991c[_0xe9fb('0x30')][_0xe9fb('0x6d')]),'SmsQueueId':Number(_0x25991c['params']['id'])});}});}})[_0xe9fb('0x24')](respondWithStatusCode(_0x5eb871,null))[_0xe9fb('0x47')](handleError(_0x5eb871,null));};exports[_0xe9fb('0x83')]=function(_0x2ca70d,_0x349d8c,_0xd1f616){var _0x1570e3={};var _0x50d008={};var _0x20d94b;var _0x3aec9d;return db[_0xe9fb('0x2c')][_0xe9fb('0x5c')]({'where':{'id':_0x2ca70d['params']['id']}})[_0xe9fb('0x24')](handleEntityNotFound(_0x349d8c,null))[_0xe9fb('0x24')](function(_0x59e694){if(_0x59e694){_0x20d94b=_0x59e694;_0x50d008[_0xe9fb('0x2f')]=_['keys'](db[_0xe9fb('0x56')][_0xe9fb('0x44')]);_0x50d008[_0xe9fb('0x30')]=_['keys'](_0x2ca70d['query']);_0x50d008[_0xe9fb('0x31')]=_[_0xe9fb('0x32')](_0x50d008[_0xe9fb('0x2f')],_0x50d008[_0xe9fb('0x30')]);_0x1570e3[_0xe9fb('0x33')]=_['intersection'](_0x50d008[_0xe9fb('0x2f')],qs[_0xe9fb('0x34')](_0x2ca70d[_0xe9fb('0x30')][_0xe9fb('0x34')]));_0x1570e3[_0xe9fb('0x33')]=_0x1570e3[_0xe9fb('0x33')]['length']?_0x1570e3[_0xe9fb('0x33')]:_0x50d008['model'];_0x1570e3[_0xe9fb('0x38')]=qs['sort'](_0x2ca70d['query'][_0xe9fb('0x39')]);_0x1570e3[_0xe9fb('0x3a')]=qs[_0xe9fb('0x31')](_[_0xe9fb('0x54')](_0x2ca70d['query'],_0x50d008[_0xe9fb('0x31')]));if(_0x2ca70d['query'][_0xe9fb('0x3d')]){_0x1570e3['where']=_[_0xe9fb('0x3e')](_0x1570e3[_0xe9fb('0x3a')],{'$or':_[_0xe9fb('0x3b')](_0x1570e3[_0xe9fb('0x33')],function(_0x123e1c){var _0x9a7383={};_0x9a7383[_0x123e1c]={'$like':'%'+_0x2ca70d[_0xe9fb('0x30')]['filter']+'%'};return _0x9a7383;})});}_0x1570e3=_[_0xe9fb('0x3e')]({},_0x1570e3,_0x2ca70d['options']);return _0x20d94b[_0xe9fb('0x83')](_0x1570e3);}})['then'](function(_0x54c41f){if(_0x54c41f){_0x3aec9d=_0x54c41f['length'];if(!_0x2ca70d[_0xe9fb('0x30')][_0xe9fb('0x36')](_0xe9fb('0x37'))){_0x1570e3[_0xe9fb('0x1d')]=qs[_0xe9fb('0x1d')](_0x2ca70d[_0xe9fb('0x30')]['limit']);_0x1570e3['offset']=qs['offset'](_0x2ca70d['query'][_0xe9fb('0x1c')]);}return _0x20d94b[_0xe9fb('0x83')](_0x1570e3);}})[_0xe9fb('0x24')](function(_0x44c831){if(_0x44c831){return _0x44c831?{'count':_0x3aec9d,'rows':_0x44c831}:null;}})[_0xe9fb('0x24')](respondWithResult(_0x349d8c,null))[_0xe9fb('0x47')](handleError(_0x349d8c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 2d5c5ce..ebafa6e 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 _0x9034=['emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save','remove'];(function(_0x3ae048,_0xe1cbc3){var _0x45f7dd=function(_0x46377d){while(--_0x46377d){_0x3ae048['push'](_0x3ae048['shift']());}};_0x45f7dd(++_0xe1cbc3);}(_0x9034,0x94));var _0x4903=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9034[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x4903('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x4903('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4903('0x2')](0x0);var events={'afterCreate':_0x4903('0x3'),'afterUpdate':'update','afterDestroy':_0x4903('0x4')};function emitEvent(_0x5bb850){return function(_0x1db55f,_0x5ed1a0,_0x5b028d){SmsQueueEvents[_0x4903('0x5')](_0x5bb850+':'+_0x1db55f['id'],_0x1db55f);SmsQueueEvents[_0x4903('0x5')](_0x5bb850,_0x1db55f);_0x5b028d(null);};}for(var e in events){if(events[_0x4903('0x6')](e)){var event=events[e];SmsQueue[_0x4903('0x7')](e,emitEvent(event));}}module[_0x4903('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xfc91=['SmsQueue','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xfc91,0x142));var _0x1fc9=function(_0x105b14,_0x49869d){_0x105b14=_0x105b14-0x0;var _0x4c5474=_0xfc91[_0x105b14];return _0x4c5474;};'use strict';var EventEmitter=require(_0x1fc9('0x0'));var SmsQueue=require(_0x1fc9('0x1'))['db'][_0x1fc9('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fc9('0x3'),'afterDestroy':_0x1fc9('0x4')};function emitEvent(_0x2c8362){return function(_0x168173,_0x53f406,_0x285df2){SmsQueueEvents['emit'](_0x2c8362+':'+_0x168173['id'],_0x168173);SmsQueueEvents[_0x1fc9('0x5')](_0x2c8362,_0x168173);_0x285df2(null);};}for(var e in events){if(events[_0x1fc9('0x6')](e)){var event=events[e];SmsQueue[_0x1fc9('0x7')](e,emitEvent(event));}}module[_0x1fc9('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 8d895b5..0b625e0 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 _0x8eba=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x1de4e0,_0x49a337){var _0xbbf6d5=function(_0x24d5eb){while(--_0x24d5eb){_0x1de4e0['push'](_0x1de4e0['shift']());}};_0xbbf6d5(++_0x49a337);}(_0x8eba,0x1c4));var _0xa8eb=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x8eba[_0x1fb4e1];return _0x22d1b0;};'use strict';var _=require(_0xa8eb('0x0'));var util=require(_0xa8eb('0x1'));var logger=require(_0xa8eb('0x2'))(_0xa8eb('0x3'));var moment=require(_0xa8eb('0x4'));var BPromise=require(_0xa8eb('0x5'));var rp=require(_0xa8eb('0x6'));var fs=require('fs');var path=require(_0xa8eb('0x7'));var rimraf=require(_0xa8eb('0x8'));var config=require(_0xa8eb('0x9'));var attributes=require(_0xa8eb('0xa'));module[_0xa8eb('0xb')]=function(_0x231146,_0x1e74b9){return _0x231146['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0679=['bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment'];(function(_0x1906f2,_0x519cc1){var _0x1e3f83=function(_0x5bc2e2){while(--_0x5bc2e2){_0x1906f2['push'](_0x1906f2['shift']());}};_0x1e3f83(++_0x519cc1);}(_0x0679,0xf3));var _0x9067=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x0679[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x9067('0x0'));var util=require('util');var logger=require(_0x9067('0x1'))(_0x9067('0x2'));var moment=require(_0x9067('0x3'));var BPromise=require(_0x9067('0x4'));var rp=require(_0x9067('0x5'));var fs=require('fs');var path=require(_0x9067('0x6'));var rimraf=require(_0x9067('0x7'));var config=require('../../config/environment');var attributes=require(_0x9067('0x8'));module[_0x9067('0x9')]=function(_0x4cf799,_0x2828a7){return _0x4cf799[_0x9067('0xa')](_0x9067('0xb'),attributes,{'tableName':_0x9067('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 4e8b515..1c9ed13 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 _0x777e=['register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowSmsQueue','find','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x777e,0x16f));var _0xe777=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x777e[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xe777('0x0'));var util=require(_0xe777('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe777('0x2'))['db'];var utils=require(_0xe777('0x3'));var logger=require(_0xe777('0x4'))(_0xe777('0x5'));var config=require('../../config/environment');var jayson=require(_0xe777('0x6'));var client=jayson[_0xe777('0x7')]['http']({'port':0x232a});config[_0xe777('0x8')]=_[_0xe777('0x9')](config['redis'],{'host':_0xe777('0xa'),'port':0x18eb});var socket=require(_0xe777('0xb'))(new Redis(config[_0xe777('0x8')]));require(_0xe777('0xc'))[_0xe777('0xd')](socket);function respondWithRpcPromise(_0x427d24,_0xa07d08,_0x18eb52){return new BPromise(function(_0x3c3ed7,_0x24a0d4){return client['request'](_0x427d24,_0x18eb52)['then'](function(_0x389cf9){logger[_0xe777('0xe')](_0xe777('0xf'),_0xa07d08,_0xe777('0x10'));logger['debug'](_0xe777('0x11'),_0xa07d08,_0xe777('0x10'),JSON[_0xe777('0x12')](_0x389cf9));if(_0x389cf9[_0xe777('0x13')]){if(_0x389cf9['error'][_0xe777('0x14')]===0x1f4){logger[_0xe777('0x13')](_0xe777('0xf'),_0xa07d08,_0x389cf9[_0xe777('0x13')][_0xe777('0x15')]);return _0x24a0d4(_0x389cf9[_0xe777('0x13')][_0xe777('0x15')]);}logger[_0xe777('0x13')](_0xe777('0xf'),_0xa07d08,_0x389cf9[_0xe777('0x13')][_0xe777('0x15')]);return _0x3c3ed7(_0x389cf9[_0xe777('0x13')][_0xe777('0x15')]);}else{logger[_0xe777('0xe')]('SmsQueue,\x20%s,\x20%s',_0xa07d08,_0xe777('0x10'));_0x3c3ed7(_0x389cf9['result'][_0xe777('0x15')]);}})[_0xe777('0x16')](function(_0xe884c2){logger[_0xe777('0x13')](_0xe777('0xf'),_0xa07d08,_0xe884c2);_0x24a0d4(_0xe884c2);});});}exports[_0xe777('0x17')]=function(_0x5e8508){var _0x239c43=this;return new Promise(function(_0x29d632,_0x18c6b5){return db[_0xe777('0x18')][_0xe777('0x19')]({'raw':_0x5e8508[_0xe777('0x1a')]?_0x5e8508['options'][_0xe777('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e8508['options']?_0x5e8508[_0xe777('0x1a')][_0xe777('0x1c')]||null:null,'attributes':_0x5e8508['options']?_0x5e8508[_0xe777('0x1a')][_0xe777('0x1d')]||null:null,'limit':_0x5e8508[_0xe777('0x1a')]?_0x5e8508[_0xe777('0x1a')][_0xe777('0x1e')]||null:null,'include':_0x5e8508['options']?_0x5e8508[_0xe777('0x1a')][_0xe777('0x1f')]?_[_0xe777('0x20')](_0x5e8508[_0xe777('0x1a')][_0xe777('0x1f')],function(_0x4b64fb){return{'model':db[_0x4b64fb[_0xe777('0x21')]],'as':_0x4b64fb['as'],'attributes':_0x4b64fb[_0xe777('0x1d')],'include':_0x4b64fb[_0xe777('0x1f')]?_[_0xe777('0x20')](_0x4b64fb[_0xe777('0x1f')],function(_0x23aa3c){return{'model':db[_0x23aa3c[_0xe777('0x21')]],'as':_0x23aa3c['as'],'attributes':_0x23aa3c[_0xe777('0x1d')],'include':_0x23aa3c[_0xe777('0x1f')]?_[_0xe777('0x20')](_0x23aa3c[_0xe777('0x1f')],function(_0x4d1396){return{'model':db[_0x4d1396['model']],'as':_0x4d1396['as'],'attributes':_0x4d1396[_0xe777('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe777('0x22')](function(_0x46ff05){logger[_0xe777('0xe')](_0xe777('0x17'),_0x5e8508);logger[_0xe777('0x23')](_0xe777('0x17'),_0x5e8508,JSON[_0xe777('0x12')](_0x46ff05));_0x29d632(_0x46ff05);})[_0xe777('0x16')](function(_0x4ceec3){logger['error'](_0xe777('0x17'),_0x4ceec3[_0xe777('0x15')],_0x5e8508);_0x18c6b5(_0x239c43[_0xe777('0x13')](0x1f4,_0x4ceec3[_0xe777('0x15')]));});});};exports[_0xe777('0x24')]=function(_0x6e0f62){var _0x49c9ce=this;return new Promise(function(_0x594d5d,_0x2be861){return db[_0xe777('0x18')][_0xe777('0x25')]({'raw':_0x6e0f62[_0xe777('0x1a')]?_0x6e0f62['options'][_0xe777('0x1b')]===undefined?!![]:![]:!![],'where':_0x6e0f62['options']?_0x6e0f62[_0xe777('0x1a')][_0xe777('0x1c')]||null:null,'attributes':_0x6e0f62[_0xe777('0x1a')]?_0x6e0f62[_0xe777('0x1a')][_0xe777('0x1d')]||null:null,'include':_0x6e0f62[_0xe777('0x1a')]?_0x6e0f62[_0xe777('0x1a')][_0xe777('0x1f')]?_[_0xe777('0x20')](_0x6e0f62[_0xe777('0x1a')][_0xe777('0x1f')],function(_0x1b7b54){return{'model':db[_0x1b7b54['model']],'as':_0x1b7b54['as'],'attributes':_0x1b7b54[_0xe777('0x1d')],'include':_0x1b7b54[_0xe777('0x1f')]?_[_0xe777('0x20')](_0x1b7b54['include'],function(_0x2fffc3){return{'model':db[_0x2fffc3[_0xe777('0x21')]],'as':_0x2fffc3['as'],'attributes':_0x2fffc3[_0xe777('0x1d')],'include':_0x2fffc3[_0xe777('0x1f')]?_[_0xe777('0x20')](_0x2fffc3['include'],function(_0x394e15){return{'model':db[_0x394e15[_0xe777('0x21')]],'as':_0x394e15['as'],'attributes':_0x394e15['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55325f){logger[_0xe777('0xe')](_0xe777('0x24'),_0x6e0f62);logger['debug'](_0xe777('0x24'),_0x6e0f62,JSON[_0xe777('0x12')](_0x55325f));_0x594d5d(_0x55325f);})[_0xe777('0x16')](function(_0x3343a2){logger[_0xe777('0x13')](_0xe777('0x24'),_0x3343a2[_0xe777('0x15')],_0x6e0f62);_0x2be861(_0x49c9ce[_0xe777('0x13')](0x1f4,_0x3343a2[_0xe777('0x15')]));});});}; \ No newline at end of file +var _0x82a9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','include','map','model','ShowSmsQueue','lodash','moment','bluebird'];(function(_0x163829,_0x4659c7){var _0x2eb8ed=function(_0x122610){while(--_0x122610){_0x163829['push'](_0x163829['shift']());}};_0x2eb8ed(++_0x4659c7);}(_0x82a9,0x165));var _0x982a=function(_0x1be9c1,_0x31d712){_0x1be9c1=_0x1be9c1-0x0;var _0x2c53e5=_0x82a9[_0x1be9c1];return _0x2c53e5;};'use strict';var _=require(_0x982a('0x0'));var util=require('util');var moment=require(_0x982a('0x1'));var BPromise=require(_0x982a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x982a('0x3'));var db=require(_0x982a('0x4'))['db'];var utils=require(_0x982a('0x5'));var logger=require(_0x982a('0x6'))(_0x982a('0x7'));var config=require('../../config/environment');var jayson=require(_0x982a('0x8'));var client=jayson[_0x982a('0x9')]['http']({'port':0x232a});config[_0x982a('0xa')]=_[_0x982a('0xb')](config[_0x982a('0xa')],{'host':_0x982a('0xc'),'port':0x18eb});var socket=require(_0x982a('0xd'))(new Redis(config[_0x982a('0xa')]));require(_0x982a('0xe'))['register'](socket);function respondWithRpcPromise(_0x59979a,_0x3508f6,_0x18d220){return new BPromise(function(_0xfca2fd,_0x4b07bf){return client['request'](_0x59979a,_0x18d220)[_0x982a('0xf')](function(_0x183c79){logger[_0x982a('0x10')](_0x982a('0x11'),_0x3508f6,_0x982a('0x12'));logger[_0x982a('0x13')](_0x982a('0x14'),_0x3508f6,_0x982a('0x12'),JSON[_0x982a('0x15')](_0x183c79));if(_0x183c79[_0x982a('0x16')]){if(_0x183c79[_0x982a('0x16')]['code']===0x1f4){logger[_0x982a('0x16')](_0x982a('0x11'),_0x3508f6,_0x183c79[_0x982a('0x16')]['message']);return _0x4b07bf(_0x183c79[_0x982a('0x16')][_0x982a('0x17')]);}logger[_0x982a('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3508f6,_0x183c79['error'][_0x982a('0x17')]);return _0xfca2fd(_0x183c79[_0x982a('0x16')][_0x982a('0x17')]);}else{logger[_0x982a('0x10')](_0x982a('0x11'),_0x3508f6,_0x982a('0x12'));_0xfca2fd(_0x183c79[_0x982a('0x18')]['message']);}})[_0x982a('0x19')](function(_0x20873f){logger[_0x982a('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3508f6,_0x20873f);_0x4b07bf(_0x20873f);});});}exports[_0x982a('0x1a')]=function(_0x1abf11){var _0x30c61a=this;return new Promise(function(_0xf4d535,_0x5af7e0){return db[_0x982a('0x1b')]['findAll']({'raw':_0x1abf11[_0x982a('0x1c')]?_0x1abf11[_0x982a('0x1c')][_0x982a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1abf11[_0x982a('0x1c')]?_0x1abf11[_0x982a('0x1c')][_0x982a('0x1e')]||null:null,'attributes':_0x1abf11[_0x982a('0x1c')]?_0x1abf11[_0x982a('0x1c')][_0x982a('0x1f')]||null:null,'limit':_0x1abf11[_0x982a('0x1c')]?_0x1abf11[_0x982a('0x1c')]['limit']||null:null,'include':_0x1abf11['options']?_0x1abf11[_0x982a('0x1c')][_0x982a('0x20')]?_[_0x982a('0x21')](_0x1abf11[_0x982a('0x1c')][_0x982a('0x20')],function(_0x4f3c0d){return{'model':db[_0x4f3c0d[_0x982a('0x22')]],'as':_0x4f3c0d['as'],'attributes':_0x4f3c0d[_0x982a('0x1f')],'include':_0x4f3c0d[_0x982a('0x20')]?_[_0x982a('0x21')](_0x4f3c0d[_0x982a('0x20')],function(_0xa70e7e){return{'model':db[_0xa70e7e[_0x982a('0x22')]],'as':_0xa70e7e['as'],'attributes':_0xa70e7e[_0x982a('0x1f')],'include':_0xa70e7e[_0x982a('0x20')]?_[_0x982a('0x21')](_0xa70e7e[_0x982a('0x20')],function(_0x496da9){return{'model':db[_0x496da9[_0x982a('0x22')]],'as':_0x496da9['as'],'attributes':_0x496da9[_0x982a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x982a('0xf')](function(_0x41f010){logger[_0x982a('0x10')]('GetSmsQueue',_0x1abf11);logger[_0x982a('0x13')](_0x982a('0x1a'),_0x1abf11,JSON[_0x982a('0x15')](_0x41f010));_0xf4d535(_0x41f010);})['catch'](function(_0x497b8f){logger[_0x982a('0x16')](_0x982a('0x1a'),_0x497b8f[_0x982a('0x17')],_0x1abf11);_0x5af7e0(_0x30c61a[_0x982a('0x16')](0x1f4,_0x497b8f[_0x982a('0x17')]));});});};exports[_0x982a('0x23')]=function(_0x4160e8){var _0xadf0d8=this;return new Promise(function(_0x166695,_0x53aa05){return db[_0x982a('0x1b')]['find']({'raw':_0x4160e8[_0x982a('0x1c')]?_0x4160e8[_0x982a('0x1c')][_0x982a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4160e8['options']?_0x4160e8[_0x982a('0x1c')][_0x982a('0x1e')]||null:null,'attributes':_0x4160e8['options']?_0x4160e8[_0x982a('0x1c')][_0x982a('0x1f')]||null:null,'include':_0x4160e8[_0x982a('0x1c')]?_0x4160e8[_0x982a('0x1c')][_0x982a('0x20')]?_[_0x982a('0x21')](_0x4160e8[_0x982a('0x1c')][_0x982a('0x20')],function(_0x5a9fff){return{'model':db[_0x5a9fff[_0x982a('0x22')]],'as':_0x5a9fff['as'],'attributes':_0x5a9fff[_0x982a('0x1f')],'include':_0x5a9fff[_0x982a('0x20')]?_['map'](_0x5a9fff['include'],function(_0x3c6ebb){return{'model':db[_0x3c6ebb[_0x982a('0x22')]],'as':_0x3c6ebb['as'],'attributes':_0x3c6ebb[_0x982a('0x1f')],'include':_0x3c6ebb['include']?_[_0x982a('0x21')](_0x3c6ebb[_0x982a('0x20')],function(_0x44b731){return{'model':db[_0x44b731[_0x982a('0x22')]],'as':_0x44b731['as'],'attributes':_0x44b731[_0x982a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fb1de){logger['info'](_0x982a('0x23'),_0x4160e8);logger[_0x982a('0x13')](_0x982a('0x23'),_0x4160e8,JSON[_0x982a('0x15')](_0x4fb1de));_0x166695(_0x4fb1de);})[_0x982a('0x19')](function(_0x6096aa){logger[_0x982a('0x16')](_0x982a('0x23'),_0x6096aa['message'],_0x4160e8);_0x53aa05(_0xadf0d8[_0x982a('0x16')](0x1f4,_0x6096aa[_0x982a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 06184c3..84f79c3 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 _0xa8d2=['removeListener','register','length','save','remove','update','emit'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xa8d2,0x1ae));var _0x2a8d=function(_0x391baf,_0x413147){_0x391baf=_0x391baf-0x0;var _0x5d0dbe=_0xa8d2[_0x391baf];return _0x5d0dbe;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x2a8d('0x0'),_0x2a8d('0x1'),_0x2a8d('0x2')];function createListener(_0x1d9909,_0x51533d){return function(_0x110df4){_0x51533d[_0x2a8d('0x3')](_0x1d9909,_0x110df4);};}function removeListener(_0x51f0f5,_0x53414a){return function(){SmsQueueEvents[_0x2a8d('0x4')](_0x51f0f5,_0x53414a);};}exports[_0x2a8d('0x5')]=function(_0x145f64){for(var _0x5b8460=0x0,_0x12e88=events[_0x2a8d('0x6')];_0x5b8460<_0x12e88;_0x5b8460++){var _0x4ff862=events[_0x5b8460];var _0x27578f=createListener('smsQueue:'+_0x4ff862,_0x145f64);SmsQueueEvents['on'](_0x4ff862,_0x27578f);}}; \ No newline at end of file +var _0xc1b6=['update','emit','removeListener','register','smsQueue:','./smsQueue.events','save','remove'];(function(_0x14217e,_0x56a9d3){var _0x3976a7=function(_0x1e647c){while(--_0x1e647c){_0x14217e['push'](_0x14217e['shift']());}};_0x3976a7(++_0x56a9d3);}(_0xc1b6,0x115));var _0x6c1b=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0xc1b6[_0x4207f4];return _0x29a621;};'use strict';var SmsQueueEvents=require(_0x6c1b('0x0'));var events=[_0x6c1b('0x1'),_0x6c1b('0x2'),_0x6c1b('0x3')];function createListener(_0xcc19b4,_0x3844b6){return function(_0x3272c0){_0x3844b6[_0x6c1b('0x4')](_0xcc19b4,_0x3272c0);};}function removeListener(_0x59c61e,_0x587cda){return function(){SmsQueueEvents[_0x6c1b('0x5')](_0x59c61e,_0x587cda);};}exports[_0x6c1b('0x6')]=function(_0x14ce9a){for(var _0x40660a=0x0,_0xb93307=events['length'];_0x40660a<_0xb93307;_0x40660a++){var _0x44b028=events[_0x40660a];var _0x45c761=createListener(_0x6c1b('0x7')+_0x44b028,_0x14ce9a);SmsQueueEvents['on'](_0x44b028,_0x45c761);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 063588f..ef40474 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 _0x120b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x239adb,_0xf295f4){var _0x16c495=function(_0x1bfe7e){while(--_0x1bfe7e){_0x239adb['push'](_0x239adb['shift']());}};_0x16c495(++_0xf295f4);}(_0x120b,0x8f));var _0xb120=function(_0x3bfb0d,_0x366472){_0x3bfb0d=_0x3bfb0d-0x0;var _0x5f321f=_0x120b[_0x3bfb0d];return _0x5f321f;};'use strict';var multer=require(_0xb120('0x0'));var util=require(_0xb120('0x1'));var path=require('path');var timeout=require(_0xb120('0x2'));var express=require(_0xb120('0x3'));var router=express[_0xb120('0x4')]();var fs_extra=require(_0xb120('0x5'));var auth=require(_0xb120('0x6'));var interaction=require(_0xb120('0x7'));var config=require(_0xb120('0x8'));var controller=require(_0xb120('0x9'));router[_0xb120('0xa')]('/',auth[_0xb120('0xb')](),controller[_0xb120('0xc')]);router['get'](_0xb120('0xd'),auth[_0xb120('0xb')](),controller[_0xb120('0xe')]);router['get'](_0xb120('0xf'),auth[_0xb120('0xb')](),controller['show']);router['post']('/',auth[_0xb120('0xb')](),controller[_0xb120('0x10')]);router[_0xb120('0x11')](_0xb120('0xf'),auth[_0xb120('0xb')](),controller[_0xb120('0x12')]);router['delete']('/:id',auth[_0xb120('0xb')](),controller[_0xb120('0x13')]);module[_0xb120('0x14')]=router; \ No newline at end of file +var _0x88b0=['../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','destroy','multer','util','express','Router','fs-extra'];(function(_0x478970,_0x5df032){var _0x1759f1=function(_0x58579d){while(--_0x58579d){_0x478970['push'](_0x478970['shift']());}};_0x1759f1(++_0x5df032);}(_0x88b0,0x1cb));var _0x088b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x88b0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x088b('0x0'));var util=require(_0x088b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x088b('0x2'));var router=express[_0x088b('0x3')]();var fs_extra=require(_0x088b('0x4'));var auth=require(_0x088b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x088b('0x6'));var controller=require(_0x088b('0x7'));router[_0x088b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x088b('0x8')](_0x088b('0x9'),auth[_0x088b('0xa')](),controller[_0x088b('0xb')]);router[_0x088b('0x8')](_0x088b('0xc'),auth[_0x088b('0xa')](),controller['show']);router[_0x088b('0xd')]('/',auth['isAuthenticated'](),controller[_0x088b('0xe')]);router['put'](_0x088b('0xc'),auth[_0x088b('0xa')](),controller['update']);router['delete'](_0x088b('0xc'),auth[_0x088b('0xa')](),controller[_0x088b('0xf')]);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 9d92fad..1ce6d55 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 _0xce5f=['STRING','DATE','moment','sequelize'];(function(_0x3f670b,_0x10f414){var _0x1c0978=function(_0x5c1276){while(--_0x5c1276){_0x3f670b['push'](_0x3f670b['shift']());}};_0x1c0978(++_0x10f414);}(_0xce5f,0x152));var _0xfce5=function(_0x1b3e8a,_0x54e0b4){_0x1b3e8a=_0x1b3e8a-0x0;var _0xc33f21=_0xce5f[_0x1b3e8a];return _0xc33f21;};'use strict';var moment=require(_0xfce5('0x0'));var Sequelize=require(_0xfce5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xfce5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfce5('0x3')]},'leaveAt':{'type':Sequelize[_0xfce5('0x3')]},'acceptAt':{'type':Sequelize[_0xfce5('0x3')]},'exitAt':{'type':Sequelize[_0xfce5('0x3')]},'reason':{'type':Sequelize[_0xfce5('0x2')]}}; \ No newline at end of file +var _0xa545=['sequelize','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa545,0x14a));var _0x5a54=function(_0x54727f,_0x81ee6f){_0x54727f=_0x54727f-0x0;var _0x5900df=_0xa545[_0x54727f];return _0x5900df;};'use strict';var moment=require('moment');var Sequelize=require(_0x5a54('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5a54('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5a54('0x1')]},'joinAt':{'type':Sequelize[_0x5a54('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5a54('0x2')]},'exitAt':{'type':Sequelize[_0x5a54('0x2')]},'reason':{'type':Sequelize[_0x5a54('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index cd3640d..493d70d 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 _0x8c42=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','key','model','keys','query'];(function(_0x2d3b91,_0x18135c){var _0x2f9607=function(_0x346cfd){while(--_0x346cfd){_0x2d3b91['push'](_0x2d3b91['shift']());}};_0x2f9607(++_0x18135c);}(_0x8c42,0x186));var _0x28c4=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x8c42[_0x271537];return _0x19dc22;};'use strict';var emlformat=require(_0x28c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28c4('0x1'));var jsonpatch=require(_0x28c4('0x2'));var rp=require('request-promise');var moment=require(_0x28c4('0x3'));var BPromise=require(_0x28c4('0x4'));var Mustache=require(_0x28c4('0x5'));var util=require(_0x28c4('0x6'));var path=require(_0x28c4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x28c4('0x8'));var fs=require('fs');var fs_extra=require(_0x28c4('0x9'));var _=require(_0x28c4('0xa'));var squel=require(_0x28c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x28c4('0xc'));var deskjs=require(_0x28c4('0xd'));var toCsv=require(_0x28c4('0xe'));var querystring=require('querystring');var Papa=require(_0x28c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28c4('0x10'));var hardwareService=require(_0x28c4('0x11'));var logger=require('../../config/logger')(_0x28c4('0x12'));var utils=require(_0x28c4('0x13'));var config=require(_0x28c4('0x14'));var licenseUtil=require(_0x28c4('0x15'));var db=require(_0x28c4('0x16'))['db'];function respondWithStatusCode(_0x30b6ca,_0x5f3e3c){_0x5f3e3c=_0x5f3e3c||0xcc;return function(_0x5db3a6){if(_0x5db3a6){return _0x30b6ca[_0x28c4('0x17')](_0x5f3e3c);}return _0x30b6ca[_0x28c4('0x18')](_0x5f3e3c)['end']();};}function respondWithResult(_0x574497,_0xba116){_0xba116=_0xba116||0xc8;return function(_0x2bbee9){if(_0x2bbee9){return _0x574497['status'](_0xba116)[_0x28c4('0x19')](_0x2bbee9);}};}function respondWithFilteredResult(_0x5c667f,_0xf93529){return function(_0x26e5ca){if(_0x26e5ca){var _0x2adb57=typeof _0xf93529[_0x28c4('0x1a')]===_0x28c4('0x1b')&&typeof _0xf93529[_0x28c4('0x1c')]===_0x28c4('0x1b');var _0xec552f=_0x26e5ca[_0x28c4('0x1d')];var _0x4d6498=_0x2adb57?0x0:_0xf93529[_0x28c4('0x1a')];var _0x3c3ff5=_0x2adb57?_0x26e5ca[_0x28c4('0x1d')]:_0xf93529[_0x28c4('0x1a')]+_0xf93529[_0x28c4('0x1c')];var _0x3a1b33;if(_0x3c3ff5>=_0xec552f){_0x3c3ff5=_0xec552f;_0x3a1b33=0xc8;}else{_0x3a1b33=0xce;}_0x5c667f[_0x28c4('0x18')](_0x3a1b33);return _0x5c667f['set'](_0x28c4('0x1e'),_0x4d6498+'-'+_0x3c3ff5+'/'+_0xec552f)['json'](_0x26e5ca);}return null;};}function patchUpdates(_0x121bc3){return function(_0x509483){try{jsonpatch[_0x28c4('0x1f')](_0x509483,_0x121bc3,!![]);}catch(_0x2fc767){return BPromise[_0x28c4('0x20')](_0x2fc767);}return _0x509483['save']();};}function saveUpdates(_0x33b462,_0x2a9930){return function(_0x26c54b){if(_0x26c54b){return _0x26c54b[_0x28c4('0x21')](_0x33b462)['then'](function(_0x111476){return _0x111476;});}return null;};}function removeEntity(_0x48ae3b,_0x45876f){return function(_0x4f3e2a){if(_0x4f3e2a){return _0x4f3e2a[_0x28c4('0x22')]()[_0x28c4('0x23')](function(){_0x48ae3b[_0x28c4('0x18')](0xcc)[_0x28c4('0x24')]();});}};}function handleEntityNotFound(_0x175b13,_0x4f2780){return function(_0x15339d){if(!_0x15339d){_0x175b13['sendStatus'](0x194);}return _0x15339d;};}function handleError(_0x2c3c82,_0xe49295){_0xe49295=_0xe49295||0x1f4;return function(_0x43061b){logger[_0x28c4('0x25')](_0x43061b['stack']);if(_0x43061b[_0x28c4('0x26')]){delete _0x43061b[_0x28c4('0x26')];}_0x2c3c82['status'](_0xe49295)[_0x28c4('0x27')](_0x43061b);};}exports['index']=function(_0x55f7d1,_0x3e3e05){var _0x169b83={},_0x382614={},_0x4b9c5b={'count':0x0,'rows':[]};var _0x1b8156=_[_0x28c4('0x28')](db[_0x28c4('0x29')][_0x28c4('0x2a')],function(_0x2451e0){return{'name':_0x2451e0[_0x28c4('0x2b')],'type':_0x2451e0['type'][_0x28c4('0x2c')]};});_0x382614[_0x28c4('0x2d')]=_[_0x28c4('0x28')](_0x1b8156,_0x28c4('0x26'));_0x382614['query']=_[_0x28c4('0x2e')](_0x55f7d1[_0x28c4('0x2f')]);_0x382614[_0x28c4('0x30')]=_['intersection'](_0x382614[_0x28c4('0x2d')],_0x382614['query']);_0x169b83['attributes']=_[_0x28c4('0x31')](_0x382614[_0x28c4('0x2d')],qs[_0x28c4('0x32')](_0x55f7d1[_0x28c4('0x2f')][_0x28c4('0x32')]));_0x169b83[_0x28c4('0x33')]=_0x169b83['attributes']['length']?_0x169b83[_0x28c4('0x33')]:_0x382614['model'];if(!_0x55f7d1['query'][_0x28c4('0x34')](_0x28c4('0x35'))){_0x169b83[_0x28c4('0x1c')]=qs[_0x28c4('0x1c')](_0x55f7d1['query'][_0x28c4('0x1c')]);_0x169b83[_0x28c4('0x1a')]=qs[_0x28c4('0x1a')](_0x55f7d1['query'][_0x28c4('0x1a')]);}_0x169b83[_0x28c4('0x36')]=qs[_0x28c4('0x37')](_0x55f7d1[_0x28c4('0x2f')]['sort']);_0x169b83[_0x28c4('0x38')]=qs['filters'](_[_0x28c4('0x39')](_0x55f7d1[_0x28c4('0x2f')],_0x382614[_0x28c4('0x30')]),_0x1b8156);if(_0x55f7d1['query'][_0x28c4('0x3a')]){_0x169b83[_0x28c4('0x38')]=_[_0x28c4('0x3b')](_0x169b83['where'],{'$or':_[_0x28c4('0x28')](_0x1b8156,function(_0x71834c){if(_0x71834c[_0x28c4('0x3c')]!=='VIRTUAL'){var _0x14dda7={};_0x14dda7[_0x71834c[_0x28c4('0x26')]]={'$like':'%'+_0x55f7d1[_0x28c4('0x2f')][_0x28c4('0x3a')]+'%'};return _0x14dda7;}})});}_0x169b83=_[_0x28c4('0x3b')]({},_0x169b83,_0x55f7d1[_0x28c4('0x3d')]);var _0x2e080d={'where':_0x169b83[_0x28c4('0x38')]};return db['SmsQueueReport']['count'](_0x2e080d)['then'](function(_0x5bf3ae){_0x4b9c5b['count']=_0x5bf3ae;if(_0x55f7d1[_0x28c4('0x2f')][_0x28c4('0x3e')]){_0x169b83[_0x28c4('0x3f')]=[{'all':!![]}];}return db[_0x28c4('0x29')][_0x28c4('0x40')](_0x169b83);})[_0x28c4('0x23')](function(_0x24e7ae){_0x4b9c5b[_0x28c4('0x41')]=_0x24e7ae;return _0x4b9c5b;})[_0x28c4('0x23')](respondWithFilteredResult(_0x3e3e05,_0x169b83))[_0x28c4('0x42')](handleError(_0x3e3e05,null));};exports['show']=function(_0x1aa065,_0x24fe99){var _0x3ecc0b={'raw':!![],'where':{'id':_0x1aa065[_0x28c4('0x43')]['id']}},_0x309a6b={};_0x309a6b[_0x28c4('0x2d')]=_[_0x28c4('0x2e')](db[_0x28c4('0x29')]['rawAttributes']);_0x309a6b[_0x28c4('0x2f')]=_[_0x28c4('0x2e')](_0x1aa065[_0x28c4('0x2f')]);_0x309a6b[_0x28c4('0x30')]=_['intersection'](_0x309a6b[_0x28c4('0x2d')],_0x309a6b['query']);_0x3ecc0b[_0x28c4('0x33')]=_['intersection'](_0x309a6b[_0x28c4('0x2d')],qs[_0x28c4('0x32')](_0x1aa065['query'][_0x28c4('0x32')]));_0x3ecc0b['attributes']=_0x3ecc0b[_0x28c4('0x33')][_0x28c4('0x44')]?_0x3ecc0b['attributes']:_0x309a6b[_0x28c4('0x2d')];if(_0x1aa065['query'][_0x28c4('0x3e')]){_0x3ecc0b[_0x28c4('0x3f')]=[{'all':!![]}];}_0x3ecc0b=_[_0x28c4('0x3b')]({},_0x3ecc0b,_0x1aa065[_0x28c4('0x3d')]);return db[_0x28c4('0x29')][_0x28c4('0x45')](_0x3ecc0b)[_0x28c4('0x23')](handleEntityNotFound(_0x24fe99,null))[_0x28c4('0x23')](respondWithResult(_0x24fe99,null))[_0x28c4('0x42')](handleError(_0x24fe99,null));};exports[_0x28c4('0x46')]=function(_0xaeeb65,_0xa68ee){return db[_0x28c4('0x29')][_0x28c4('0x46')](_0xaeeb65[_0x28c4('0x47')],{})['then'](respondWithResult(_0xa68ee,0xc9))[_0x28c4('0x42')](handleError(_0xa68ee,null));};exports[_0x28c4('0x21')]=function(_0x3b33a2,_0xeef4ff){if(_0x3b33a2[_0x28c4('0x47')]['id']){delete _0x3b33a2[_0x28c4('0x47')]['id'];}return db[_0x28c4('0x29')]['find']({'where':{'id':_0x3b33a2[_0x28c4('0x43')]['id']}})[_0x28c4('0x23')](handleEntityNotFound(_0xeef4ff,null))['then'](saveUpdates(_0x3b33a2[_0x28c4('0x47')],null))[_0x28c4('0x23')](respondWithResult(_0xeef4ff,null))['catch'](handleError(_0xeef4ff,null));};exports[_0x28c4('0x22')]=function(_0x4dbf32,_0x233ca2){return db['SmsQueueReport'][_0x28c4('0x45')]({'where':{'id':_0x4dbf32[_0x28c4('0x43')]['id']}})[_0x28c4('0x23')](handleEntityNotFound(_0x233ca2,null))[_0x28c4('0x23')](removeEntity(_0x233ca2,null))[_0x28c4('0x42')](handleError(_0x233ca2,null));};exports[_0x28c4('0x48')]=function(_0x3c917,_0x3e002f){return db[_0x28c4('0x29')][_0x28c4('0x48')]()[_0x28c4('0x23')](respondWithResult(_0x3e002f,null))[_0x28c4('0x42')](handleError(_0x3e002f,null));}; \ No newline at end of file +var _0x658d=['query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','merge','filter','findAll','rows','catch','show','params','length','options','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','name','send','map','SmsQueueReport','rawAttributes','type','key'];(function(_0x4ab4a2,_0x41b416){var _0x57f331=function(_0xa67444){while(--_0xa67444){_0x4ab4a2['push'](_0x4ab4a2['shift']());}};_0x57f331(++_0x41b416);}(_0x658d,0x181));var _0xd658=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x658d[_0x288f5e];return _0x476cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd658('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd658('0x1'));var rp=require(_0xd658('0x2'));var moment=require(_0xd658('0x3'));var BPromise=require(_0xd658('0x4'));var Mustache=require(_0xd658('0x5'));var util=require('util');var path=require(_0xd658('0x6'));var sox=require(_0xd658('0x7'));var csv=require(_0xd658('0x8'));var ejs=require(_0xd658('0x9'));var fs=require('fs');var fs_extra=require(_0xd658('0xa'));var _=require(_0xd658('0xb'));var squel=require(_0xd658('0xc'));var crypto=require(_0xd658('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd658('0xe'));var toCsv=require(_0xd658('0x8'));var querystring=require(_0xd658('0xf'));var Papa=require('papaparse');var Redis=require(_0xd658('0x10'));var authService=require(_0xd658('0x11'));var qs=require(_0xd658('0x12'));var as=require(_0xd658('0x13'));var hardwareService=require(_0xd658('0x14'));var logger=require(_0xd658('0x15'))(_0xd658('0x16'));var utils=require('../../config/utils');var config=require(_0xd658('0x17'));var licenseUtil=require(_0xd658('0x18'));var db=require(_0xd658('0x19'))['db'];function respondWithStatusCode(_0x151cda,_0x5db4fe){_0x5db4fe=_0x5db4fe||0xcc;return function(_0x2bab5b){if(_0x2bab5b){return _0x151cda[_0xd658('0x1a')](_0x5db4fe);}return _0x151cda[_0xd658('0x1b')](_0x5db4fe)[_0xd658('0x1c')]();};}function respondWithResult(_0xf665c2,_0xa9fc36){_0xa9fc36=_0xa9fc36||0xc8;return function(_0x50d24c){if(_0x50d24c){return _0xf665c2[_0xd658('0x1b')](_0xa9fc36)[_0xd658('0x1d')](_0x50d24c);}};}function respondWithFilteredResult(_0x32ece5,_0x29ec42){return function(_0x50e356){if(_0x50e356){var _0x45c99f=typeof _0x29ec42['offset']==='undefined'&&typeof _0x29ec42[_0xd658('0x1e')]===_0xd658('0x1f');var _0x148a99=_0x50e356[_0xd658('0x20')];var _0x246e93=_0x45c99f?0x0:_0x29ec42['offset'];var _0xc92b7=_0x45c99f?_0x50e356[_0xd658('0x20')]:_0x29ec42[_0xd658('0x21')]+_0x29ec42[_0xd658('0x1e')];var _0x432af7;if(_0xc92b7>=_0x148a99){_0xc92b7=_0x148a99;_0x432af7=0xc8;}else{_0x432af7=0xce;}_0x32ece5[_0xd658('0x1b')](_0x432af7);return _0x32ece5['set'](_0xd658('0x22'),_0x246e93+'-'+_0xc92b7+'/'+_0x148a99)[_0xd658('0x1d')](_0x50e356);}return null;};}function patchUpdates(_0x5db168){return function(_0x3466f0){try{jsonpatch[_0xd658('0x23')](_0x3466f0,_0x5db168,!![]);}catch(_0x11fe4d){return BPromise[_0xd658('0x24')](_0x11fe4d);}return _0x3466f0[_0xd658('0x25')]();};}function saveUpdates(_0x395786,_0x547038){return function(_0x38b650){if(_0x38b650){return _0x38b650['update'](_0x395786)[_0xd658('0x26')](function(_0x49aa2f){return _0x49aa2f;});}return null;};}function removeEntity(_0x383cf2,_0x423c7e){return function(_0x12b0f8){if(_0x12b0f8){return _0x12b0f8[_0xd658('0x27')]()[_0xd658('0x26')](function(){_0x383cf2[_0xd658('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ad86,_0x5c3976){return function(_0x26e3f6){if(!_0x26e3f6){_0x37ad86[_0xd658('0x1a')](0x194);}return _0x26e3f6;};}function handleError(_0x431de5,_0x5bb13c){_0x5bb13c=_0x5bb13c||0x1f4;return function(_0x30fa1d){logger['error'](_0x30fa1d['stack']);if(_0x30fa1d['name']){delete _0x30fa1d[_0xd658('0x28')];}_0x431de5[_0xd658('0x1b')](_0x5bb13c)[_0xd658('0x29')](_0x30fa1d);};}exports['index']=function(_0x3b1617,_0x4b8c6f){var _0x1a41d7={},_0x3b9779={},_0x49699f={'count':0x0,'rows':[]};var _0x932690=_[_0xd658('0x2a')](db[_0xd658('0x2b')][_0xd658('0x2c')],function(_0x57b548){return{'name':_0x57b548['fieldName'],'type':_0x57b548[_0xd658('0x2d')][_0xd658('0x2e')]};});_0x3b9779['model']=_[_0xd658('0x2a')](_0x932690,_0xd658('0x28'));_0x3b9779[_0xd658('0x2f')]=_[_0xd658('0x30')](_0x3b1617[_0xd658('0x2f')]);_0x3b9779[_0xd658('0x31')]=_[_0xd658('0x32')](_0x3b9779[_0xd658('0x33')],_0x3b9779[_0xd658('0x2f')]);_0x1a41d7[_0xd658('0x34')]=_[_0xd658('0x32')](_0x3b9779[_0xd658('0x33')],qs[_0xd658('0x35')](_0x3b1617[_0xd658('0x2f')][_0xd658('0x35')]));_0x1a41d7[_0xd658('0x34')]=_0x1a41d7[_0xd658('0x34')]['length']?_0x1a41d7[_0xd658('0x34')]:_0x3b9779[_0xd658('0x33')];if(!_0x3b1617[_0xd658('0x2f')][_0xd658('0x36')]('nolimit')){_0x1a41d7[_0xd658('0x1e')]=qs[_0xd658('0x1e')](_0x3b1617[_0xd658('0x2f')][_0xd658('0x1e')]);_0x1a41d7['offset']=qs['offset'](_0x3b1617['query']['offset']);}_0x1a41d7['order']=qs['sort'](_0x3b1617[_0xd658('0x2f')][_0xd658('0x37')]);_0x1a41d7[_0xd658('0x38')]=qs[_0xd658('0x31')](_[_0xd658('0x39')](_0x3b1617['query'],_0x3b9779[_0xd658('0x31')]),_0x932690);if(_0x3b1617[_0xd658('0x2f')]['filter']){_0x1a41d7['where']=_[_0xd658('0x3a')](_0x1a41d7[_0xd658('0x38')],{'$or':_[_0xd658('0x2a')](_0x932690,function(_0x292b66){if(_0x292b66['type']!=='VIRTUAL'){var _0x369ece={};_0x369ece[_0x292b66[_0xd658('0x28')]]={'$like':'%'+_0x3b1617['query'][_0xd658('0x3b')]+'%'};return _0x369ece;}})});}_0x1a41d7=_[_0xd658('0x3a')]({},_0x1a41d7,_0x3b1617['options']);var _0x46e197={'where':_0x1a41d7[_0xd658('0x38')]};return db['SmsQueueReport'][_0xd658('0x20')](_0x46e197)['then'](function(_0x38e40d){_0x49699f[_0xd658('0x20')]=_0x38e40d;if(_0x3b1617['query']['includeAll']){_0x1a41d7['include']=[{'all':!![]}];}return db[_0xd658('0x2b')][_0xd658('0x3c')](_0x1a41d7);})[_0xd658('0x26')](function(_0x5b2800){_0x49699f[_0xd658('0x3d')]=_0x5b2800;return _0x49699f;})[_0xd658('0x26')](respondWithFilteredResult(_0x4b8c6f,_0x1a41d7))[_0xd658('0x3e')](handleError(_0x4b8c6f,null));};exports[_0xd658('0x3f')]=function(_0x28709b,_0x36d897){var _0x46fd64={'raw':!![],'where':{'id':_0x28709b[_0xd658('0x40')]['id']}},_0x573ffc={};_0x573ffc[_0xd658('0x33')]=_['keys'](db[_0xd658('0x2b')][_0xd658('0x2c')]);_0x573ffc[_0xd658('0x2f')]=_[_0xd658('0x30')](_0x28709b[_0xd658('0x2f')]);_0x573ffc[_0xd658('0x31')]=_['intersection'](_0x573ffc['model'],_0x573ffc[_0xd658('0x2f')]);_0x46fd64[_0xd658('0x34')]=_[_0xd658('0x32')](_0x573ffc[_0xd658('0x33')],qs[_0xd658('0x35')](_0x28709b[_0xd658('0x2f')][_0xd658('0x35')]));_0x46fd64['attributes']=_0x46fd64['attributes'][_0xd658('0x41')]?_0x46fd64[_0xd658('0x34')]:_0x573ffc['model'];if(_0x28709b['query']['includeAll']){_0x46fd64['include']=[{'all':!![]}];}_0x46fd64=_[_0xd658('0x3a')]({},_0x46fd64,_0x28709b[_0xd658('0x42')]);return db[_0xd658('0x2b')][_0xd658('0x43')](_0x46fd64)[_0xd658('0x26')](handleEntityNotFound(_0x36d897,null))[_0xd658('0x26')](respondWithResult(_0x36d897,null))[_0xd658('0x3e')](handleError(_0x36d897,null));};exports[_0xd658('0x44')]=function(_0x11b3d0,_0x305cee){return db[_0xd658('0x2b')]['create'](_0x11b3d0[_0xd658('0x45')],{})[_0xd658('0x26')](respondWithResult(_0x305cee,0xc9))['catch'](handleError(_0x305cee,null));};exports[_0xd658('0x46')]=function(_0x3ace75,_0x11efc7){if(_0x3ace75[_0xd658('0x45')]['id']){delete _0x3ace75[_0xd658('0x45')]['id'];}return db['SmsQueueReport'][_0xd658('0x43')]({'where':{'id':_0x3ace75[_0xd658('0x40')]['id']}})[_0xd658('0x26')](handleEntityNotFound(_0x11efc7,null))[_0xd658('0x26')](saveUpdates(_0x3ace75[_0xd658('0x45')],null))[_0xd658('0x26')](respondWithResult(_0x11efc7,null))['catch'](handleError(_0x11efc7,null));};exports['destroy']=function(_0x4a25c8,_0xae13b3){return db['SmsQueueReport'][_0xd658('0x43')]({'where':{'id':_0x4a25c8['params']['id']}})['then'](handleEntityNotFound(_0xae13b3,null))[_0xd658('0x26')](removeEntity(_0xae13b3,null))[_0xd658('0x3e')](handleError(_0xae13b3,null));};exports[_0xd658('0x47')]=function(_0x33a684,_0x5f3a9d){return db[_0xd658('0x2b')][_0xd658('0x47')]()['then'](respondWithResult(_0x5f3a9d,null))[_0xd658('0x3e')](handleError(_0x5f3a9d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3ca1da2..20bb5c4 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4bbb89,_0x4c7c9d){var _0x44f090=function(_0x5b4fa1){while(--_0x5b4fa1){_0x4bbb89['push'](_0x4bbb89['shift']());}};_0x44f090(++_0x4c7c9d);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 67126ac..223bd24 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 _0x0d01=['then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','message','error','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2f24c6,_0x12c28a){var _0x3e3cef=function(_0x274673){while(--_0x274673){_0x2f24c6['push'](_0x2f24c6['shift']());}};_0x3e3cef(++_0x12c28a);}(_0x0d01,0x175));var _0x10d0=function(_0x3f9f39,_0x4530bc){_0x3f9f39=_0x3f9f39-0x0;var _0x28f1b7=_0x0d01[_0x3f9f39];return _0x28f1b7;};'use strict';var _=require('lodash');var util=require(_0x10d0('0x0'));var moment=require(_0x10d0('0x1'));var BPromise=require(_0x10d0('0x2'));var rs=require(_0x10d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x10d0('0x4'));var logger=require(_0x10d0('0x5'))(_0x10d0('0x6'));var config=require(_0x10d0('0x7'));var jayson=require(_0x10d0('0x8'));var client=jayson['client'][_0x10d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54dc4e,_0x49fa8b,_0x456f3b){return new BPromise(function(_0x177860,_0x3c5810){return client[_0x10d0('0xa')](_0x54dc4e,_0x456f3b)[_0x10d0('0xb')](function(_0x426802){logger[_0x10d0('0xc')](_0x10d0('0xd'),_0x49fa8b,_0x10d0('0xe'));logger[_0x10d0('0xf')](_0x10d0('0x10'),_0x49fa8b,_0x10d0('0xe'),JSON['stringify'](_0x426802));if(_0x426802['error']){if(_0x426802['error'][_0x10d0('0x11')]===0x1f4){logger['error'](_0x10d0('0xd'),_0x49fa8b,_0x426802['error'][_0x10d0('0x12')]);return _0x3c5810(_0x426802[_0x10d0('0x13')][_0x10d0('0x12')]);}logger[_0x10d0('0x13')](_0x10d0('0xd'),_0x49fa8b,_0x426802[_0x10d0('0x13')][_0x10d0('0x12')]);return _0x177860(_0x426802['error'][_0x10d0('0x12')]);}else{logger['info'](_0x10d0('0xd'),_0x49fa8b,'request\x20sent');_0x177860(_0x426802['result'][_0x10d0('0x12')]);}})[_0x10d0('0x14')](function(_0x3d240d){logger[_0x10d0('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x49fa8b,_0x3d240d);_0x3c5810(_0x3d240d);});});}exports[_0x10d0('0x15')]=function(_0x16fba8){var _0x12af08=this;return new Promise(function(_0x1eabfd,_0x3945a9){return db['SmsQueueReport'][_0x10d0('0x16')](_0x16fba8[_0x10d0('0x17')],{'raw':_0x16fba8[_0x10d0('0x18')]?_0x16fba8[_0x10d0('0x18')][_0x10d0('0x19')]===undefined?!![]:![]:!![]})[_0x10d0('0xb')](function(_0xa9ec72){logger[_0x10d0('0xc')]('CreateSmsQueueReport',_0x16fba8);logger[_0x10d0('0xf')](_0x10d0('0x15'),_0x16fba8,JSON['stringify'](_0xa9ec72));_0x1eabfd(_0xa9ec72);})[_0x10d0('0x14')](function(_0x31fba2){logger['error'](_0x10d0('0x15'),_0x31fba2[_0x10d0('0x12')],_0x16fba8);_0x3945a9(_0x12af08[_0x10d0('0x13')](0x1f4,_0x31fba2[_0x10d0('0x12')]));});});};exports[_0x10d0('0x1a')]=function(_0x458da0){var _0x577689=this;return new Promise(function(_0x34ddaf,_0x34e34e){return db['SmsQueueReport'][_0x10d0('0x1b')](_0x458da0[_0x10d0('0x17')],{'raw':_0x458da0[_0x10d0('0x18')]?_0x458da0[_0x10d0('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x458da0['options']?_0x458da0['options'][_0x10d0('0x1c')]||null:null,'attributes':_0x458da0[_0x10d0('0x18')]?_0x458da0[_0x10d0('0x18')][_0x10d0('0x1d')]||null:null,'limit':_0x458da0[_0x10d0('0x18')]?_0x458da0[_0x10d0('0x18')][_0x10d0('0x1e')]||null:null})['then'](function(_0x21df32){logger[_0x10d0('0xc')]('UpdateSmsQueueReport',_0x458da0);logger[_0x10d0('0xf')](_0x10d0('0x1a'),_0x458da0,JSON[_0x10d0('0x1f')](_0x21df32));_0x34ddaf(_0x21df32);})[_0x10d0('0x14')](function(_0x44b6b4){logger[_0x10d0('0x13')](_0x10d0('0x1a'),_0x44b6b4[_0x10d0('0x12')],_0x458da0);_0x34e34e(_0x577689['error'](0x1f4,_0x44b6b4['message']));});});}; \ No newline at end of file +var _0xd91f=['client','http','request','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','UpdateSmsQueueReport','update','body','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17727f,_0x5afb4f){var _0x19fd72=function(_0x104beb){while(--_0x104beb){_0x17727f['push'](_0x17727f['shift']());}};_0x19fd72(++_0x5afb4f);}(_0xd91f,0x1ed));var _0xfd91=function(_0x26d034,_0x2c22db){_0x26d034=_0x26d034-0x0;var _0x3015aa=_0xd91f[_0x26d034];return _0x3015aa;};'use strict';var _=require(_0xfd91('0x0'));var util=require('util');var moment=require(_0xfd91('0x1'));var BPromise=require(_0xfd91('0x2'));var rs=require(_0xfd91('0x3'));var fs=require('fs');var Redis=require(_0xfd91('0x4'));var db=require(_0xfd91('0x5'))['db'];var utils=require(_0xfd91('0x6'));var logger=require(_0xfd91('0x7'))(_0xfd91('0x8'));var config=require(_0xfd91('0x9'));var jayson=require(_0xfd91('0xa'));var client=jayson[_0xfd91('0xb')][_0xfd91('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x73cc52,_0x4bdd65,_0x51a33c){return new BPromise(function(_0x9b1b0f,_0xbee5a6){return client[_0xfd91('0xd')](_0x73cc52,_0x51a33c)['then'](function(_0x4ca1ab){logger[_0xfd91('0xe')](_0xfd91('0xf'),_0x4bdd65,'request\x20sent');logger['debug'](_0xfd91('0x10'),_0x4bdd65,'request\x20sent',JSON[_0xfd91('0x11')](_0x4ca1ab));if(_0x4ca1ab[_0xfd91('0x12')]){if(_0x4ca1ab['error'][_0xfd91('0x13')]===0x1f4){logger[_0xfd91('0x12')](_0xfd91('0xf'),_0x4bdd65,_0x4ca1ab['error'][_0xfd91('0x14')]);return _0xbee5a6(_0x4ca1ab[_0xfd91('0x12')][_0xfd91('0x14')]);}logger[_0xfd91('0x12')](_0xfd91('0xf'),_0x4bdd65,_0x4ca1ab['error'][_0xfd91('0x14')]);return _0x9b1b0f(_0x4ca1ab['error'][_0xfd91('0x14')]);}else{logger[_0xfd91('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x4bdd65,_0xfd91('0x15'));_0x9b1b0f(_0x4ca1ab[_0xfd91('0x16')][_0xfd91('0x14')]);}})[_0xfd91('0x17')](function(_0x242b10){logger[_0xfd91('0x12')](_0xfd91('0xf'),_0x4bdd65,_0x242b10);_0xbee5a6(_0x242b10);});});}exports[_0xfd91('0x18')]=function(_0x38fb21){var _0x380a1d=this;return new Promise(function(_0x15406c,_0x5effa3){return db[_0xfd91('0x19')][_0xfd91('0x1a')](_0x38fb21['body'],{'raw':_0x38fb21[_0xfd91('0x1b')]?_0x38fb21[_0xfd91('0x1b')][_0xfd91('0x1c')]===undefined?!![]:![]:!![]})[_0xfd91('0x1d')](function(_0x2baf85){logger['info'](_0xfd91('0x18'),_0x38fb21);logger['debug'](_0xfd91('0x18'),_0x38fb21,JSON[_0xfd91('0x11')](_0x2baf85));_0x15406c(_0x2baf85);})['catch'](function(_0x4ceb31){logger[_0xfd91('0x12')]('CreateSmsQueueReport',_0x4ceb31['message'],_0x38fb21);_0x5effa3(_0x380a1d[_0xfd91('0x12')](0x1f4,_0x4ceb31[_0xfd91('0x14')]));});});};exports[_0xfd91('0x1e')]=function(_0xbca4a4){var _0xb04845=this;return new Promise(function(_0x18119e,_0x22ac76){return db[_0xfd91('0x19')][_0xfd91('0x1f')](_0xbca4a4[_0xfd91('0x20')],{'raw':_0xbca4a4['options']?_0xbca4a4[_0xfd91('0x1b')][_0xfd91('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbca4a4['options']?_0xbca4a4['options']['where']||null:null,'attributes':_0xbca4a4[_0xfd91('0x1b')]?_0xbca4a4['options'][_0xfd91('0x21')]||null:null,'limit':_0xbca4a4['options']?_0xbca4a4[_0xfd91('0x1b')][_0xfd91('0x22')]||null:null})[_0xfd91('0x1d')](function(_0x18adb2){logger[_0xfd91('0xe')](_0xfd91('0x1e'),_0xbca4a4);logger[_0xfd91('0x23')](_0xfd91('0x1e'),_0xbca4a4,JSON[_0xfd91('0x11')](_0x18adb2));_0x18119e(_0x18adb2);})[_0xfd91('0x17')](function(_0x462f1d){logger['error'](_0xfd91('0x1e'),_0x462f1d['message'],_0xbca4a4);_0x22ac76(_0xb04845[_0xfd91('0x12')](0x1f4,_0x462f1d[_0xfd91('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f25f49c..1e074ac 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 _0xa3e6=['express','Router','fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','describe','put','update','delete','/:id','destroy','multer','path'];(function(_0x53d4cf,_0x1866a7){var _0x50d044=function(_0x3c2644){while(--_0x3c2644){_0x53d4cf['push'](_0x53d4cf['shift']());}};_0x50d044(++_0x1866a7);}(_0xa3e6,0xbe));var _0x6a3e=function(_0xc9b292,_0x3897de){_0xc9b292=_0xc9b292-0x0;var _0x36e10e=_0xa3e6[_0xc9b292];return _0x36e10e;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var fs_extra=require(_0x6a3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3e('0x5'));var config=require('../../config/environment');var controller=require(_0x6a3e('0x6'));router[_0x6a3e('0x7')]('/',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0x9')]);router[_0x6a3e('0x7')]('/describe',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xa')]);router['get']('/:id',auth[_0x6a3e('0x8')](),controller['show']);router['post']('/',auth[_0x6a3e('0x8')](),controller['create']);router[_0x6a3e('0xb')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xc')]);router[_0x6a3e('0xd')](_0x6a3e('0xe'),auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x3ba796,_0x12555b){var _0x336a07=function(_0x1ca760){while(--_0x1ca760){_0x3ba796['push'](_0x3ba796['shift']());}};_0x336a07(++_0x12555b);}(_0xaba6,0xe2));var _0x6aba=function(_0x14f456,_0x3b6bb7){_0x14f456=_0x14f456-0x0;var _0x444e80=_0xaba6[_0x14f456];return _0x444e80;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 89a108f..9cf019b 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0xc02932,_0x163072){var _0x5e416b=function(_0x89d02c){while(--_0x89d02c){_0xc02932['push'](_0xc02932['shift']());}};_0x5e416b(++_0x163072);}(_0xe706,0xa3));var _0x6e70=function(_0x3e4e5c,_0x4d2966){_0x3e4e5c=_0x3e4e5c-0x0;var _0x46f0bf=_0xe706[_0x3e4e5c];return _0x46f0bf;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0xaa88,0x137));var _0x8aa8=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xaa88[_0x737a1f];return _0x16eba1;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b3e0f3f..b967802 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 _0x93a6=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsTransferReport','includeAll','findAll','rows','catch','params','keys','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','index','map'];(function(_0x43037d,_0x36c76f){var _0x13d7e6=function(_0x24b5e0){while(--_0x24b5e0){_0x43037d['push'](_0x43037d['shift']());}};_0x13d7e6(++_0x36c76f);}(_0x93a6,0x1ac));var _0x693a=function(_0x513789,_0x3d7067){_0x513789=_0x513789-0x0;var _0xbdc2f3=_0x93a6[_0x513789];return _0xbdc2f3;};'use strict';var emlformat=require(_0x693a('0x0'));var rimraf=require(_0x693a('0x1'));var zipdir=require(_0x693a('0x2'));var jsonpatch=require(_0x693a('0x3'));var rp=require('request-promise');var moment=require(_0x693a('0x4'));var BPromise=require(_0x693a('0x5'));var Mustache=require(_0x693a('0x6'));var util=require(_0x693a('0x7'));var path=require(_0x693a('0x8'));var sox=require(_0x693a('0x9'));var csv=require(_0x693a('0xa'));var ejs=require(_0x693a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x693a('0xc'));var squel=require(_0x693a('0xd'));var crypto=require(_0x693a('0xe'));var jsforce=require(_0x693a('0xf'));var deskjs=require(_0x693a('0x10'));var toCsv=require(_0x693a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x693a('0x11'));var authService=require(_0x693a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x693a('0x13'));var hardwareService=require(_0x693a('0x14'));var logger=require(_0x693a('0x15'))(_0x693a('0x16'));var utils=require(_0x693a('0x17'));var config=require(_0x693a('0x18'));var licenseUtil=require(_0x693a('0x19'));var db=require(_0x693a('0x1a'))['db'];function respondWithStatusCode(_0x222111,_0x2dbc7a){_0x2dbc7a=_0x2dbc7a||0xcc;return function(_0x168cc4){if(_0x168cc4){return _0x222111[_0x693a('0x1b')](_0x2dbc7a);}return _0x222111[_0x693a('0x1c')](_0x2dbc7a)[_0x693a('0x1d')]();};}function respondWithResult(_0x306648,_0x6650d8){_0x6650d8=_0x6650d8||0xc8;return function(_0x45a11c){if(_0x45a11c){return _0x306648[_0x693a('0x1c')](_0x6650d8)[_0x693a('0x1e')](_0x45a11c);}};}function respondWithFilteredResult(_0x6cfc2a,_0x21716d){return function(_0x48bdee){if(_0x48bdee){var _0x224913=typeof _0x21716d['offset']===_0x693a('0x1f')&&typeof _0x21716d[_0x693a('0x20')]==='undefined';var _0x4e4af0=_0x48bdee[_0x693a('0x21')];var _0x5d7d5=_0x224913?0x0:_0x21716d[_0x693a('0x22')];var _0x483b4e=_0x224913?_0x48bdee[_0x693a('0x21')]:_0x21716d[_0x693a('0x22')]+_0x21716d[_0x693a('0x20')];var _0x456ead;if(_0x483b4e>=_0x4e4af0){_0x483b4e=_0x4e4af0;_0x456ead=0xc8;}else{_0x456ead=0xce;}_0x6cfc2a['status'](_0x456ead);return _0x6cfc2a[_0x693a('0x23')](_0x693a('0x24'),_0x5d7d5+'-'+_0x483b4e+'/'+_0x4e4af0)['json'](_0x48bdee);}return null;};}function patchUpdates(_0x548396){return function(_0x23bd41){try{jsonpatch[_0x693a('0x25')](_0x23bd41,_0x548396,!![]);}catch(_0x3d7a0c){return BPromise[_0x693a('0x26')](_0x3d7a0c);}return _0x23bd41['save']();};}function saveUpdates(_0x3a2d05,_0x3f23b9){return function(_0x26a1de){if(_0x26a1de){return _0x26a1de[_0x693a('0x27')](_0x3a2d05)['then'](function(_0x43df52){return _0x43df52;});}return null;};}function removeEntity(_0x4e7667,_0x227291){return function(_0x2e56b1){if(_0x2e56b1){return _0x2e56b1[_0x693a('0x28')]()[_0x693a('0x29')](function(){_0x4e7667[_0x693a('0x1c')](0xcc)[_0x693a('0x1d')]();});}};}function handleEntityNotFound(_0x27ca40,_0x1b2f98){return function(_0x2b1848){if(!_0x2b1848){_0x27ca40['sendStatus'](0x194);}return _0x2b1848;};}function handleError(_0x279f10,_0x20d81f){_0x20d81f=_0x20d81f||0x1f4;return function(_0xb40a63){logger[_0x693a('0x2a')](_0xb40a63['stack']);if(_0xb40a63['name']){delete _0xb40a63[_0x693a('0x2b')];}_0x279f10[_0x693a('0x1c')](_0x20d81f)['send'](_0xb40a63);};}exports[_0x693a('0x2c')]=function(_0x13ae45,_0x1aef6f){var _0xf829e9={},_0x5b314b={},_0x166a3c={'count':0x0,'rows':[]};var _0x26dbd5=_[_0x693a('0x2d')](db['SmsTransferReport'][_0x693a('0x2e')],function(_0x55739a){return{'name':_0x55739a[_0x693a('0x2f')],'type':_0x55739a[_0x693a('0x30')][_0x693a('0x31')]};});_0x5b314b[_0x693a('0x32')]=_[_0x693a('0x2d')](_0x26dbd5,_0x693a('0x2b'));_0x5b314b[_0x693a('0x33')]=_['keys'](_0x13ae45['query']);_0x5b314b[_0x693a('0x34')]=_[_0x693a('0x35')](_0x5b314b[_0x693a('0x32')],_0x5b314b[_0x693a('0x33')]);_0xf829e9[_0x693a('0x36')]=_[_0x693a('0x35')](_0x5b314b[_0x693a('0x32')],qs[_0x693a('0x37')](_0x13ae45[_0x693a('0x33')][_0x693a('0x37')]));_0xf829e9['attributes']=_0xf829e9['attributes'][_0x693a('0x38')]?_0xf829e9[_0x693a('0x36')]:_0x5b314b[_0x693a('0x32')];if(!_0x13ae45[_0x693a('0x33')][_0x693a('0x39')](_0x693a('0x3a'))){_0xf829e9[_0x693a('0x20')]=qs[_0x693a('0x20')](_0x13ae45[_0x693a('0x33')]['limit']);_0xf829e9[_0x693a('0x22')]=qs[_0x693a('0x22')](_0x13ae45[_0x693a('0x33')][_0x693a('0x22')]);}_0xf829e9[_0x693a('0x3b')]=qs[_0x693a('0x3c')](_0x13ae45[_0x693a('0x33')]['sort']);_0xf829e9[_0x693a('0x3d')]=qs['filters'](_[_0x693a('0x3e')](_0x13ae45[_0x693a('0x33')],_0x5b314b[_0x693a('0x34')]),_0x26dbd5);if(_0x13ae45['query'][_0x693a('0x3f')]){_0xf829e9[_0x693a('0x3d')]=_['merge'](_0xf829e9[_0x693a('0x3d')],{'$or':_['map'](_0x26dbd5,function(_0x40ff61){if(_0x40ff61['type']!==_0x693a('0x40')){var _0x5be5ee={};_0x5be5ee[_0x40ff61[_0x693a('0x2b')]]={'$like':'%'+_0x13ae45[_0x693a('0x33')][_0x693a('0x3f')]+'%'};return _0x5be5ee;}})});}_0xf829e9=_[_0x693a('0x41')]({},_0xf829e9,_0x13ae45[_0x693a('0x42')]);var _0xe2f77f={'where':_0xf829e9['where']};return db[_0x693a('0x43')][_0x693a('0x21')](_0xe2f77f)[_0x693a('0x29')](function(_0x2bf651){_0x166a3c[_0x693a('0x21')]=_0x2bf651;if(_0x13ae45['query'][_0x693a('0x44')]){_0xf829e9['include']=[{'all':!![]}];}return db[_0x693a('0x43')][_0x693a('0x45')](_0xf829e9);})[_0x693a('0x29')](function(_0x588eb4){_0x166a3c[_0x693a('0x46')]=_0x588eb4;return _0x166a3c;})[_0x693a('0x29')](respondWithFilteredResult(_0x1aef6f,_0xf829e9))[_0x693a('0x47')](handleError(_0x1aef6f,null));};exports['show']=function(_0x1f2e0f,_0x4df839){var _0x5e4f85={'raw':!![],'where':{'id':_0x1f2e0f[_0x693a('0x48')]['id']}},_0x471903={};_0x471903[_0x693a('0x32')]=_['keys'](db[_0x693a('0x43')]['rawAttributes']);_0x471903['query']=_[_0x693a('0x49')](_0x1f2e0f[_0x693a('0x33')]);_0x471903[_0x693a('0x34')]=_['intersection'](_0x471903[_0x693a('0x32')],_0x471903['query']);_0x5e4f85['attributes']=_[_0x693a('0x35')](_0x471903[_0x693a('0x32')],qs[_0x693a('0x37')](_0x1f2e0f[_0x693a('0x33')][_0x693a('0x37')]));_0x5e4f85[_0x693a('0x36')]=_0x5e4f85[_0x693a('0x36')]['length']?_0x5e4f85[_0x693a('0x36')]:_0x471903[_0x693a('0x32')];if(_0x1f2e0f[_0x693a('0x33')][_0x693a('0x44')]){_0x5e4f85[_0x693a('0x4a')]=[{'all':!![]}];}_0x5e4f85=_['merge']({},_0x5e4f85,_0x1f2e0f[_0x693a('0x42')]);return db[_0x693a('0x43')]['find'](_0x5e4f85)[_0x693a('0x29')](handleEntityNotFound(_0x4df839,null))[_0x693a('0x29')](respondWithResult(_0x4df839,null))['catch'](handleError(_0x4df839,null));};exports[_0x693a('0x4b')]=function(_0x220316,_0x45c83e){return db[_0x693a('0x43')][_0x693a('0x4b')](_0x220316['body'],{})[_0x693a('0x29')](respondWithResult(_0x45c83e,0xc9))[_0x693a('0x47')](handleError(_0x45c83e,null));};exports[_0x693a('0x27')]=function(_0x1cf361,_0xf4805b){if(_0x1cf361[_0x693a('0x4c')]['id']){delete _0x1cf361[_0x693a('0x4c')]['id'];}return db[_0x693a('0x43')][_0x693a('0x4d')]({'where':{'id':_0x1cf361[_0x693a('0x48')]['id']}})['then'](handleEntityNotFound(_0xf4805b,null))[_0x693a('0x29')](saveUpdates(_0x1cf361[_0x693a('0x4c')],null))[_0x693a('0x29')](respondWithResult(_0xf4805b,null))[_0x693a('0x47')](handleError(_0xf4805b,null));};exports['destroy']=function(_0x209c9d,_0x5ebf7c){return db['SmsTransferReport'][_0x693a('0x4d')]({'where':{'id':_0x209c9d[_0x693a('0x48')]['id']}})[_0x693a('0x29')](handleEntityNotFound(_0x5ebf7c,null))[_0x693a('0x29')](removeEntity(_0x5ebf7c,null))[_0x693a('0x47')](handleError(_0x5ebf7c,null));};exports['describe']=function(_0x239b57,_0x1990d8){return db['SmsTransferReport'][_0x693a('0x4e')]()[_0x693a('0x29')](respondWithResult(_0x1990d8,null))[_0x693a('0x47')](handleError(_0x1990d8,null));}; \ No newline at end of file +var _0x66d6=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4649ad,_0x14f390){var _0x419bf9=function(_0x36ac01){while(--_0x36ac01){_0x4649ad['push'](_0x4649ad['shift']());}};_0x419bf9(++_0x14f390);}(_0x66d6,0x16d));var _0x666d=function(_0x456492,_0x41ea6f){_0x456492=_0x456492-0x0;var _0x36dbb3=_0x66d6[_0x456492];return _0x36dbb3;};'use strict';var emlformat=require(_0x666d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x666d('0x1'));var jsonpatch=require(_0x666d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x666d('0x3'));var Mustache=require(_0x666d('0x4'));var util=require(_0x666d('0x5'));var path=require('path');var sox=require(_0x666d('0x6'));var csv=require(_0x666d('0x7'));var ejs=require(_0x666d('0x8'));var fs=require('fs');var fs_extra=require(_0x666d('0x9'));var _=require(_0x666d('0xa'));var squel=require(_0x666d('0xb'));var crypto=require(_0x666d('0xc'));var jsforce=require(_0x666d('0xd'));var deskjs=require(_0x666d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x666d('0xf'));var Papa=require('papaparse');var Redis=require(_0x666d('0x10'));var authService=require(_0x666d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x666d('0x12'));var hardwareService=require(_0x666d('0x13'));var logger=require(_0x666d('0x14'))(_0x666d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x666d('0x16'));var db=require(_0x666d('0x17'))['db'];function respondWithStatusCode(_0x21bcdb,_0x125619){_0x125619=_0x125619||0xcc;return function(_0x497fef){if(_0x497fef){return _0x21bcdb[_0x666d('0x18')](_0x125619);}return _0x21bcdb[_0x666d('0x19')](_0x125619)['end']();};}function respondWithResult(_0x498ac0,_0x70569f){_0x70569f=_0x70569f||0xc8;return function(_0xedba33){if(_0xedba33){return _0x498ac0[_0x666d('0x19')](_0x70569f)['json'](_0xedba33);}};}function respondWithFilteredResult(_0x64cb19,_0x38b398){return function(_0x58cee1){if(_0x58cee1){var _0x14c7a6=typeof _0x38b398[_0x666d('0x1a')]===_0x666d('0x1b')&&typeof _0x38b398[_0x666d('0x1c')]===_0x666d('0x1b');var _0x6445b4=_0x58cee1[_0x666d('0x1d')];var _0x5ba092=_0x14c7a6?0x0:_0x38b398[_0x666d('0x1a')];var _0x1a41b4=_0x14c7a6?_0x58cee1[_0x666d('0x1d')]:_0x38b398[_0x666d('0x1a')]+_0x38b398['limit'];var _0x1a5225;if(_0x1a41b4>=_0x6445b4){_0x1a41b4=_0x6445b4;_0x1a5225=0xc8;}else{_0x1a5225=0xce;}_0x64cb19[_0x666d('0x19')](_0x1a5225);return _0x64cb19[_0x666d('0x1e')]('Content-Range',_0x5ba092+'-'+_0x1a41b4+'/'+_0x6445b4)[_0x666d('0x1f')](_0x58cee1);}return null;};}function patchUpdates(_0x532855){return function(_0x451bcb){try{jsonpatch[_0x666d('0x20')](_0x451bcb,_0x532855,!![]);}catch(_0x209cb0){return BPromise[_0x666d('0x21')](_0x209cb0);}return _0x451bcb[_0x666d('0x22')]();};}function saveUpdates(_0x4a653a,_0x19f7cc){return function(_0x4aaf33){if(_0x4aaf33){return _0x4aaf33['update'](_0x4a653a)[_0x666d('0x23')](function(_0x47ba59){return _0x47ba59;});}return null;};}function removeEntity(_0x9e5835,_0x3dc061){return function(_0x2a0b8a){if(_0x2a0b8a){return _0x2a0b8a[_0x666d('0x24')]()[_0x666d('0x23')](function(){_0x9e5835['status'](0xcc)[_0x666d('0x25')]();});}};}function handleEntityNotFound(_0xb4ae5c,_0x27f49d){return function(_0xa25851){if(!_0xa25851){_0xb4ae5c['sendStatus'](0x194);}return _0xa25851;};}function handleError(_0x43d58d,_0x3c62f5){_0x3c62f5=_0x3c62f5||0x1f4;return function(_0x19a3bc){logger[_0x666d('0x26')](_0x19a3bc[_0x666d('0x27')]);if(_0x19a3bc[_0x666d('0x28')]){delete _0x19a3bc['name'];}_0x43d58d[_0x666d('0x19')](_0x3c62f5)[_0x666d('0x29')](_0x19a3bc);};}exports[_0x666d('0x2a')]=function(_0x12495a,_0x528f7f){var _0x434423={},_0x177830={},_0xf7baf6={'count':0x0,'rows':[]};var _0x39165c=_['map'](db[_0x666d('0x2b')][_0x666d('0x2c')],function(_0x1a3031){return{'name':_0x1a3031[_0x666d('0x2d')],'type':_0x1a3031[_0x666d('0x2e')]['key']};});_0x177830[_0x666d('0x2f')]=_['map'](_0x39165c,_0x666d('0x28'));_0x177830[_0x666d('0x30')]=_[_0x666d('0x31')](_0x12495a[_0x666d('0x30')]);_0x177830[_0x666d('0x32')]=_[_0x666d('0x33')](_0x177830['model'],_0x177830['query']);_0x434423[_0x666d('0x34')]=_['intersection'](_0x177830[_0x666d('0x2f')],qs[_0x666d('0x35')](_0x12495a[_0x666d('0x30')][_0x666d('0x35')]));_0x434423[_0x666d('0x34')]=_0x434423[_0x666d('0x34')][_0x666d('0x36')]?_0x434423['attributes']:_0x177830[_0x666d('0x2f')];if(!_0x12495a[_0x666d('0x30')][_0x666d('0x37')]('nolimit')){_0x434423['limit']=qs[_0x666d('0x1c')](_0x12495a['query'][_0x666d('0x1c')]);_0x434423[_0x666d('0x1a')]=qs[_0x666d('0x1a')](_0x12495a[_0x666d('0x30')][_0x666d('0x1a')]);}_0x434423[_0x666d('0x38')]=qs[_0x666d('0x39')](_0x12495a[_0x666d('0x30')][_0x666d('0x39')]);_0x434423[_0x666d('0x3a')]=qs[_0x666d('0x32')](_[_0x666d('0x3b')](_0x12495a[_0x666d('0x30')],_0x177830[_0x666d('0x32')]),_0x39165c);if(_0x12495a[_0x666d('0x30')][_0x666d('0x3c')]){_0x434423[_0x666d('0x3a')]=_[_0x666d('0x3d')](_0x434423['where'],{'$or':_[_0x666d('0x3e')](_0x39165c,function(_0x10c693){if(_0x10c693[_0x666d('0x2e')]!==_0x666d('0x3f')){var _0x35e6bc={};_0x35e6bc[_0x10c693[_0x666d('0x28')]]={'$like':'%'+_0x12495a[_0x666d('0x30')]['filter']+'%'};return _0x35e6bc;}})});}_0x434423=_[_0x666d('0x3d')]({},_0x434423,_0x12495a[_0x666d('0x40')]);var _0x361043={'where':_0x434423['where']};return db['SmsTransferReport']['count'](_0x361043)['then'](function(_0x24de09){_0xf7baf6[_0x666d('0x1d')]=_0x24de09;if(_0x12495a[_0x666d('0x30')][_0x666d('0x41')]){_0x434423[_0x666d('0x42')]=[{'all':!![]}];}return db[_0x666d('0x2b')][_0x666d('0x43')](_0x434423);})[_0x666d('0x23')](function(_0x223481){_0xf7baf6['rows']=_0x223481;return _0xf7baf6;})[_0x666d('0x23')](respondWithFilteredResult(_0x528f7f,_0x434423))[_0x666d('0x44')](handleError(_0x528f7f,null));};exports[_0x666d('0x45')]=function(_0x513020,_0x418b10){var _0x10be33={'raw':!![],'where':{'id':_0x513020[_0x666d('0x46')]['id']}},_0xfb8418={};_0xfb8418[_0x666d('0x2f')]=_[_0x666d('0x31')](db['SmsTransferReport'][_0x666d('0x2c')]);_0xfb8418[_0x666d('0x30')]=_[_0x666d('0x31')](_0x513020['query']);_0xfb8418[_0x666d('0x32')]=_['intersection'](_0xfb8418[_0x666d('0x2f')],_0xfb8418[_0x666d('0x30')]);_0x10be33[_0x666d('0x34')]=_[_0x666d('0x33')](_0xfb8418[_0x666d('0x2f')],qs[_0x666d('0x35')](_0x513020['query']['fields']));_0x10be33[_0x666d('0x34')]=_0x10be33[_0x666d('0x34')][_0x666d('0x36')]?_0x10be33[_0x666d('0x34')]:_0xfb8418[_0x666d('0x2f')];if(_0x513020[_0x666d('0x30')][_0x666d('0x41')]){_0x10be33[_0x666d('0x42')]=[{'all':!![]}];}_0x10be33=_['merge']({},_0x10be33,_0x513020[_0x666d('0x40')]);return db[_0x666d('0x2b')][_0x666d('0x47')](_0x10be33)[_0x666d('0x23')](handleEntityNotFound(_0x418b10,null))['then'](respondWithResult(_0x418b10,null))[_0x666d('0x44')](handleError(_0x418b10,null));};exports['create']=function(_0x1d88eb,_0x1266e1){return db[_0x666d('0x2b')][_0x666d('0x48')](_0x1d88eb[_0x666d('0x49')],{})[_0x666d('0x23')](respondWithResult(_0x1266e1,0xc9))[_0x666d('0x44')](handleError(_0x1266e1,null));};exports[_0x666d('0x4a')]=function(_0x99e388,_0x232bb5){if(_0x99e388[_0x666d('0x49')]['id']){delete _0x99e388[_0x666d('0x49')]['id'];}return db[_0x666d('0x2b')][_0x666d('0x47')]({'where':{'id':_0x99e388[_0x666d('0x46')]['id']}})[_0x666d('0x23')](handleEntityNotFound(_0x232bb5,null))['then'](saveUpdates(_0x99e388[_0x666d('0x49')],null))[_0x666d('0x23')](respondWithResult(_0x232bb5,null))['catch'](handleError(_0x232bb5,null));};exports[_0x666d('0x24')]=function(_0x3d0169,_0x5464ff){return db[_0x666d('0x2b')]['find']({'where':{'id':_0x3d0169[_0x666d('0x46')]['id']}})[_0x666d('0x23')](handleEntityNotFound(_0x5464ff,null))[_0x666d('0x23')](removeEntity(_0x5464ff,null))[_0x666d('0x44')](handleError(_0x5464ff,null));};exports[_0x666d('0x4b')]=function(_0x528677,_0x9225d5){return db[_0x666d('0x2b')][_0x666d('0x4b')]()[_0x666d('0x23')](respondWithResult(_0x9225d5,null))[_0x666d('0x44')](handleError(_0x9225d5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 188ac46..5241b30 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 _0x6cf2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6cf2,0x7c));var _0x26cf=function(_0x4fb599,_0x4f299d){_0x4fb599=_0x4fb599-0x0;var _0x1dded2=_0x6cf2[_0x4fb599];return _0x1dded2;};'use strict';var _=require('lodash');var util=require(_0x26cf('0x0'));var logger=require(_0x26cf('0x1'))(_0x26cf('0x2'));var moment=require(_0x26cf('0x3'));var BPromise=require(_0x26cf('0x4'));var rp=require(_0x26cf('0x5'));var fs=require('fs');var path=require(_0x26cf('0x6'));var rimraf=require(_0x26cf('0x7'));var config=require(_0x26cf('0x8'));var attributes=require(_0x26cf('0x9'));module[_0x26cf('0xa')]=function(_0x3b5c2f,_0x2b519b){return _0x3b5c2f[_0x26cf('0xb')](_0x26cf('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x26cf('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc911=['moment','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x157624,_0x3ee799){var _0x517e0c=function(_0x21c462){while(--_0x21c462){_0x157624['push'](_0x157624['shift']());}};_0x517e0c(++_0x3ee799);}(_0xc911,0x1ea));var _0x1c91=function(_0x239ff4,_0x19b042){_0x239ff4=_0x239ff4-0x0;var _0x2c54d5=_0xc911[_0x239ff4];return _0x2c54d5;};'use strict';var _=require(_0x1c91('0x0'));var util=require(_0x1c91('0x1'));var logger=require(_0x1c91('0x2'))(_0x1c91('0x3'));var moment=require(_0x1c91('0x4'));var BPromise=require(_0x1c91('0x5'));var rp=require(_0x1c91('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c91('0x7'));var attributes=require(_0x1c91('0x8'));module[_0x1c91('0x9')]=function(_0x569fb6,_0xb69f7){return _0x569fb6[_0x1c91('0xa')](_0x1c91('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x1c91('0xc'),'fields':[_0x1c91('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e8948a7..4a4b061 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 _0x6c32=['request','info','request\x20sent','debug','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x26e804,_0x5c78b9){var _0x3d6b60=function(_0x41ccef){while(--_0x41ccef){_0x26e804['push'](_0x26e804['shift']());}};_0x3d6b60(++_0x5c78b9);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var moment=require(_0x26c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c3('0x3'))['db'];var utils=require(_0x26c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26c3('0x5'));var jayson=require(_0x26c3('0x6'));var client=jayson[_0x26c3('0x7')][_0x26c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17bc12,_0x2756e5,_0x438a89){return new BPromise(function(_0x11ed3d,_0x2134b8){return client[_0x26c3('0x9')](_0x17bc12,_0x438a89)['then'](function(_0x561496){logger[_0x26c3('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'));logger[_0x26c3('0xc')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'),JSON[_0x26c3('0xd')](_0x561496));if(_0x561496[_0x26c3('0xe')]){if(_0x561496[_0x26c3('0xe')][_0x26c3('0xf')]===0x1f4){logger['error'](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);return _0x2134b8(_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);}logger[_0x26c3('0xe')](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')]['message']);return _0x11ed3d(_0x561496['error'][_0x26c3('0x11')]);}else{logger[_0x26c3('0xa')](_0x26c3('0x10'),_0x2756e5,_0x26c3('0xb'));_0x11ed3d(_0x561496[_0x26c3('0x12')][_0x26c3('0x11')]);}})['catch'](function(_0x2edaca){logger[_0x26c3('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2756e5,_0x2edaca);_0x2134b8(_0x2edaca);});});} \ No newline at end of file +var _0x6bdc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x46ac5e,_0x16533b){_0x46ac5e=_0x46ac5e-0x0;var _0x4437ee=_0x6bdc[_0x46ac5e];return _0x4437ee;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var moment=require(_0xc6bd('0x2'));var BPromise=require(_0xc6bd('0x3'));var rs=require(_0xc6bd('0x4'));var fs=require('fs');var Redis=require(_0xc6bd('0x5'));var db=require(_0xc6bd('0x6'))['db'];var utils=require(_0xc6bd('0x7'));var logger=require(_0xc6bd('0x8'))(_0xc6bd('0x9'));var config=require('../../config/environment');var jayson=require(_0xc6bd('0xa'));var client=jayson[_0xc6bd('0xb')][_0xc6bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f5327,_0x2c1c68,_0x8bd379){return new BPromise(function(_0x5ca385,_0x374067){return client[_0xc6bd('0xd')](_0x3f5327,_0x8bd379)[_0xc6bd('0xe')](function(_0x5e92e8){logger['info'](_0xc6bd('0xf'),_0x2c1c68,'request\x20sent');logger[_0xc6bd('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c1c68,_0xc6bd('0x11'),JSON[_0xc6bd('0x12')](_0x5e92e8));if(_0x5e92e8[_0xc6bd('0x13')]){if(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x14')]===0x1f4){logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);return _0x374067(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);}logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')]['message']);return _0x5ca385(_0x5e92e8[_0xc6bd('0x13')]['message']);}else{logger['info'](_0xc6bd('0xf'),_0x2c1c68,_0xc6bd('0x11'));_0x5ca385(_0x5e92e8[_0xc6bd('0x16')][_0xc6bd('0x15')]);}})[_0xc6bd('0x17')](function(_0x5795bc){logger['error'](_0xc6bd('0xf'),_0x2c1c68,_0x5795bc);_0x374067(_0x5795bc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index bdd10a9..3615434 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 _0x231c=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x4d22af,_0x2da329){var _0x1aa3f4=function(_0x58538c){while(--_0x58538c){_0x4d22af['push'](_0x4d22af['shift']());}};_0x1aa3f4(++_0x2da329);}(_0x231c,0x134));var _0xc231=function(_0x4cddff,_0x1bf9c4){_0x4cddff=_0x4cddff-0x0;var _0x268a87=_0x231c[_0x4cddff];return _0x268a87;};'use strict';var multer=require(_0xc231('0x0'));var util=require(_0xc231('0x1'));var path=require(_0xc231('0x2'));var timeout=require(_0xc231('0x3'));var express=require(_0xc231('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc231('0x5'));var interaction=require(_0xc231('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0xc231('0x7')](),controller[_0xc231('0x8')]);router[_0xc231('0x9')](_0xc231('0xa'),auth[_0xc231('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xc231('0x7')](),controller[_0xc231('0xb')]);var upload=multer({'storage':multer[_0xc231('0xc')]({'destination':function(_0x170c09,_0x49591d,_0x16765d){_0x16765d(null,path[_0xc231('0xd')](config[_0xc231('0xe')],_0xc231('0xf')));},'filename':function(_0x440250,_0x8817a2,_0x230f86){_0x8817a2[_0xc231('0x10')]=_0x8817a2[_0xc231('0x10')][_0xc231('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x230f86(null,util['format'](_0xc231('0x12'),path[_0xc231('0x13')](_0x8817a2[_0xc231('0x10')],path[_0xc231('0x14')](_0x8817a2['originalname'])),Date[_0xc231('0x15')](),path['extname'](_0x8817a2['originalname'])));}})});router[_0xc231('0x16')]('/',upload[_0xc231('0x17')](_0xc231('0x18')),controller[_0xc231('0x19')]);router[_0xc231('0x1a')](_0xc231('0xa'),auth[_0xc231('0x7')](),controller[_0xc231('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc231('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x1f5d=['diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1f5d,0x98));var _0xd1f5=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0x1f5d[_0x3d8ca8];return _0x517e45;};'use strict';var multer=require(_0xd1f5('0x0'));var util=require(_0xd1f5('0x1'));var path=require(_0xd1f5('0x2'));var timeout=require(_0xd1f5('0x3'));var express=require(_0xd1f5('0x4'));var router=express[_0xd1f5('0x5')]();var fs_extra=require(_0xd1f5('0x6'));var auth=require(_0xd1f5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd1f5('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0xd1f5('0x9')](),controller[_0xd1f5('0xa')]);router[_0xd1f5('0xb')](_0xd1f5('0xc'),auth[_0xd1f5('0x9')](),controller[_0xd1f5('0xd')]);router[_0xd1f5('0xb')](_0xd1f5('0xe'),auth[_0xd1f5('0x9')](),controller[_0xd1f5('0xf')]);var upload=multer({'storage':multer[_0xd1f5('0x10')]({'destination':function(_0x410a87,_0x3d3bf7,_0x52db91){_0x52db91(null,path[_0xd1f5('0x11')](config[_0xd1f5('0x12')],_0xd1f5('0x13')));},'filename':function(_0x36a12e,_0x11d39b,_0x31d802){_0x11d39b[_0xd1f5('0x14')]=_0x11d39b[_0xd1f5('0x14')][_0xd1f5('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x31d802(null,util[_0xd1f5('0x16')]('%s-%s%s',path[_0xd1f5('0x17')](_0x11d39b[_0xd1f5('0x14')],path['extname'](_0x11d39b['originalname'])),Date['now'](),path['extname'](_0x11d39b[_0xd1f5('0x14')])));}})});router['post']('/',upload['single']('file'),controller[_0xd1f5('0x18')]);router[_0xd1f5('0x19')](_0xd1f5('0xc'),auth[_0xd1f5('0x9')](),controller[_0xd1f5('0x1a')]);router['delete'](_0xd1f5('0xc'),auth[_0xd1f5('0x9')](),controller[_0xd1f5('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6393074..b61b5f3 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 _0xea4c=['name','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x11bfe9,_0x4ffd0b){var _0xfd3b29=function(_0x590649){while(--_0x590649){_0x11bfe9['push'](_0x11bfe9['shift']());}};_0xfd3b29(++_0x4ffd0b);}(_0xea4c,0xc3));var _0xcea4=function(_0x1f0228,_0x25f3e6){_0x1f0228=_0x1f0228-0x0;var _0x2fe8f6=_0xea4c[_0x1f0228];return _0x2fe8f6;};'use strict';var Sequelize=require(_0xcea4('0x0'));module[_0xcea4('0x1')]={'name':{'type':Sequelize[_0xcea4('0x2')],'unique':_0xcea4('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcea4('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xcea4('0x2')]},'original_format':{'type':Sequelize[_0xcea4('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xcea4('0x4')]},'original_bitRate':{'type':Sequelize[_0xcea4('0x5')]},'original_sampleRate':{'type':Sequelize[_0xcea4('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xcea4('0x5')]},'converted_channelCount':{'type':Sequelize[_0xcea4('0x4')]},'converted_bitRate':{'type':Sequelize[_0xcea4('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1f75=['BIGINT','INTEGER','sequelize','STRING','name','FLOAT'];(function(_0x50ff04,_0x52e85c){var _0x3d4d1b=function(_0x1cf328){while(--_0x1cf328){_0x50ff04['push'](_0x50ff04['shift']());}};_0x3d4d1b(++_0x52e85c);}(_0x1f75,0xc2));var _0x51f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f75[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x51f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x51f7('0x1')],'unique':_0x51f7('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x51f7('0x1')]},'display_name':{'type':Sequelize[_0x51f7('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x51f7('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x51f7('0x3')]},'original_sampleCount':{'type':Sequelize[_0x51f7('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x51f7('0x4')]},'original_sampleRate':{'type':Sequelize[_0x51f7('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x51f7('0x4')]},'converted_channelCount':{'type':Sequelize[_0x51f7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x51f7('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 383ef6d..148b330 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 _0x82c0=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','end','json','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','Sounds','UserProfileResource','sendStatus','error','stack','name','index','Sound','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','save_name','existsSync','join','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','root','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x82c0,0x166));var _0x082c=function(_0x8a9853,_0x1391e3){_0x8a9853=_0x8a9853-0x0;var _0x3539ba=_0x82c0[_0x8a9853];return _0x3539ba;};'use strict';var emlformat=require(_0x082c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x082c('0x1'));var jsonpatch=require(_0x082c('0x2'));var rp=require(_0x082c('0x3'));var moment=require(_0x082c('0x4'));var BPromise=require(_0x082c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x082c('0x6'));var csv=require(_0x082c('0x7'));var ejs=require(_0x082c('0x8'));var fs=require('fs');var fs_extra=require(_0x082c('0x9'));var _=require(_0x082c('0xa'));var squel=require(_0x082c('0xb'));var crypto=require(_0x082c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x082c('0xd'));var toCsv=require(_0x082c('0x7'));var querystring=require(_0x082c('0xe'));var Papa=require(_0x082c('0xf'));var Redis=require(_0x082c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x082c('0x11'));var as=require(_0x082c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x082c('0x13'))(_0x082c('0x14'));var utils=require(_0x082c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6a8a,_0x29ed0a){_0x29ed0a=_0x29ed0a||0xcc;return function(_0x5a2b59){if(_0x5a2b59){return _0x4c6a8a['sendStatus'](_0x29ed0a);}return _0x4c6a8a[_0x082c('0x16')](_0x29ed0a)[_0x082c('0x17')]();};}function respondWithResult(_0xb444a3,_0x4b0d6a){_0x4b0d6a=_0x4b0d6a||0xc8;return function(_0x3c1eff){if(_0x3c1eff){return _0xb444a3['status'](_0x4b0d6a)[_0x082c('0x18')](_0x3c1eff);}};}function respondWithFilteredResult(_0xb77fb0,_0x553ea0){return function(_0x213795){if(_0x213795){var _0x46b41c=typeof _0x553ea0['offset']==='undefined'&&typeof _0x553ea0[_0x082c('0x19')]==='undefined';var _0x59ed1a=_0x213795['count'];var _0x520e27=_0x46b41c?0x0:_0x553ea0[_0x082c('0x1a')];var _0x5cc4a0=_0x46b41c?_0x213795[_0x082c('0x1b')]:_0x553ea0[_0x082c('0x1a')]+_0x553ea0[_0x082c('0x19')];var _0x1c588e;if(_0x5cc4a0>=_0x59ed1a){_0x5cc4a0=_0x59ed1a;_0x1c588e=0xc8;}else{_0x1c588e=0xce;}_0xb77fb0[_0x082c('0x16')](_0x1c588e);return _0xb77fb0[_0x082c('0x1c')](_0x082c('0x1d'),_0x520e27+'-'+_0x5cc4a0+'/'+_0x59ed1a)[_0x082c('0x18')](_0x213795);}return null;};}function patchUpdates(_0x41a322){return function(_0x2e9808){try{jsonpatch[_0x082c('0x1e')](_0x2e9808,_0x41a322,!![]);}catch(_0x5f1ee9){return BPromise[_0x082c('0x1f')](_0x5f1ee9);}return _0x2e9808[_0x082c('0x20')]();};}function saveUpdates(_0x211efc,_0x44e802){return function(_0x1eae88){if(_0x1eae88){return _0x1eae88['update'](_0x211efc)['then'](function(_0x101a73){return _0x101a73;});}return null;};}function removeEntity(_0x15314b,_0x537867){return function(_0x52268c){if(_0x52268c){return _0x52268c[_0x082c('0x21')]()[_0x082c('0x22')](function(){var _0x42c23e=_0x52268c['get']({'plain':!![]});var _0xa5ce5d=_0x082c('0x23');return db[_0x082c('0x24')]['destroy']({'where':{'type':_0xa5ce5d,'resourceId':_0x42c23e['id']}})['then'](function(){return _0x52268c;});})[_0x082c('0x22')](function(){_0x15314b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x571362,_0x6d99e4){return function(_0x4b41d9){if(!_0x4b41d9){_0x571362[_0x082c('0x25')](0x194);}return _0x4b41d9;};}function handleError(_0x2c7ae4,_0x562584){_0x562584=_0x562584||0x1f4;return function(_0x353bb7){logger[_0x082c('0x26')](_0x353bb7[_0x082c('0x27')]);if(_0x353bb7[_0x082c('0x28')]){delete _0x353bb7[_0x082c('0x28')];}_0x2c7ae4['status'](_0x562584)['send'](_0x353bb7);};}exports[_0x082c('0x29')]=function(_0x564575,_0x3e4f12){var _0x4c8328={},_0x14d0b4={},_0x2dedcb={'count':0x0,'rows':[]};var _0x1348b2=_['map'](db[_0x082c('0x2a')]['rawAttributes'],function(_0x19fb32){return{'name':_0x19fb32['fieldName'],'type':_0x19fb32[_0x082c('0x2b')][_0x082c('0x2c')]};});_0x14d0b4[_0x082c('0x2d')]=_['map'](_0x1348b2,'name');_0x14d0b4[_0x082c('0x2e')]=_[_0x082c('0x2f')](_0x564575[_0x082c('0x2e')]);_0x14d0b4[_0x082c('0x30')]=_[_0x082c('0x31')](_0x14d0b4['model'],_0x14d0b4['query']);_0x4c8328['attributes']=_[_0x082c('0x31')](_0x14d0b4[_0x082c('0x2d')],qs[_0x082c('0x32')](_0x564575[_0x082c('0x2e')][_0x082c('0x32')]));_0x4c8328[_0x082c('0x33')]=_0x4c8328[_0x082c('0x33')][_0x082c('0x34')]?_0x4c8328[_0x082c('0x33')]:_0x14d0b4[_0x082c('0x2d')];if(!_0x564575['query']['hasOwnProperty']('nolimit')){_0x4c8328[_0x082c('0x19')]=qs[_0x082c('0x19')](_0x564575[_0x082c('0x2e')][_0x082c('0x19')]);_0x4c8328[_0x082c('0x1a')]=qs[_0x082c('0x1a')](_0x564575[_0x082c('0x2e')][_0x082c('0x1a')]);}_0x4c8328['order']=qs[_0x082c('0x35')](_0x564575[_0x082c('0x2e')][_0x082c('0x35')]);_0x4c8328[_0x082c('0x36')]=qs['filters'](_[_0x082c('0x37')](_0x564575[_0x082c('0x2e')],_0x14d0b4[_0x082c('0x30')]),_0x1348b2);if(_0x564575[_0x082c('0x2e')][_0x082c('0x38')]){_0x4c8328['where']=_[_0x082c('0x39')](_0x4c8328[_0x082c('0x36')],{'$or':_[_0x082c('0x3a')](_0x1348b2,function(_0x2e95d3){if(_0x2e95d3[_0x082c('0x2b')]!==_0x082c('0x3b')){var _0x52a647={};_0x52a647[_0x2e95d3[_0x082c('0x28')]]={'$like':'%'+_0x564575['query'][_0x082c('0x38')]+'%'};return _0x52a647;}})});}_0x4c8328=_['merge']({},_0x4c8328,_0x564575[_0x082c('0x3c')]);var _0x2f3fe7={'where':_0x4c8328[_0x082c('0x36')]};return db['Sound'][_0x082c('0x1b')](_0x2f3fe7)[_0x082c('0x22')](function(_0x46b9ad){_0x2dedcb[_0x082c('0x1b')]=_0x46b9ad;if(_0x564575[_0x082c('0x2e')][_0x082c('0x3d')]){_0x4c8328[_0x082c('0x3e')]=[{'all':!![]}];}return db[_0x082c('0x2a')][_0x082c('0x3f')](_0x4c8328);})[_0x082c('0x22')](function(_0x470ba9){_0x2dedcb[_0x082c('0x40')]=_0x470ba9;return _0x2dedcb;})[_0x082c('0x22')](respondWithFilteredResult(_0x3e4f12,_0x4c8328))[_0x082c('0x41')](handleError(_0x3e4f12,null));};exports[_0x082c('0x42')]=function(_0x4d20e0,_0x284d8b){var _0x40fe16={'raw':!![],'where':{'id':_0x4d20e0[_0x082c('0x43')]['id']}},_0x2450d1={};_0x2450d1[_0x082c('0x2d')]=_[_0x082c('0x2f')](db[_0x082c('0x2a')][_0x082c('0x44')]);_0x2450d1[_0x082c('0x2e')]=_[_0x082c('0x2f')](_0x4d20e0[_0x082c('0x2e')]);_0x2450d1[_0x082c('0x30')]=_[_0x082c('0x31')](_0x2450d1[_0x082c('0x2d')],_0x2450d1[_0x082c('0x2e')]);_0x40fe16[_0x082c('0x33')]=_[_0x082c('0x31')](_0x2450d1[_0x082c('0x2d')],qs[_0x082c('0x32')](_0x4d20e0[_0x082c('0x2e')][_0x082c('0x32')]));_0x40fe16[_0x082c('0x33')]=_0x40fe16['attributes']['length']?_0x40fe16[_0x082c('0x33')]:_0x2450d1[_0x082c('0x2d')];if(_0x4d20e0[_0x082c('0x2e')]['includeAll']){_0x40fe16['include']=[{'all':!![]}];}_0x40fe16=_[_0x082c('0x39')]({},_0x40fe16,_0x4d20e0[_0x082c('0x3c')]);return db[_0x082c('0x2a')][_0x082c('0x45')](_0x40fe16)[_0x082c('0x22')](handleEntityNotFound(_0x284d8b,null))[_0x082c('0x22')](respondWithResult(_0x284d8b,null))[_0x082c('0x41')](handleError(_0x284d8b,null));};exports['download']=function(_0x4bafee,_0x17d02e,_0xbc98a8){return db['Sound'][_0x082c('0x45')]({'where':{'id':_0x4bafee[_0x082c('0x43')]['id']},'attributes':[_0x082c('0x28'),_0x082c('0x46'),'converted_format'],'raw':!![]})[_0x082c('0x22')](handleEntityNotFound(_0x17d02e,null))[_0x082c('0x22')](function(_0x4f2b6f){if(_0x4f2b6f){if(!fs[_0x082c('0x47')](path[_0x082c('0x48')](config['root'],_0x082c('0x49'),_0x4f2b6f[_0x082c('0x46')]+'.'+_0x4f2b6f[_0x082c('0x4a')]))){throw new db[(_0x082c('0x4b'))][(_0x082c('0x4c'))](_0x082c('0x4d'));}return _0x17d02e['download'](path[_0x082c('0x48')](config['root'],_0x082c('0x49'),util['format']('%s.%s',_0x4f2b6f['save_name'],_0x4f2b6f[_0x082c('0x4a')])),util[_0x082c('0x4e')](_0x082c('0x4f'),_0x4f2b6f[_0x082c('0x28')],_0x4f2b6f[_0x082c('0x4a')]));}return null;})['catch'](handleError(_0x17d02e,null));};exports[_0x082c('0x50')]=function(_0x3281fd,_0x5bd73f,_0x4b9da7){var _0x3be7a8={'name':path[_0x082c('0x51')](_0x3281fd[_0x082c('0x52')][_0x082c('0x53')],path[_0x082c('0x54')](_0x3281fd['file'][_0x082c('0x53')])),'save_name':path[_0x082c('0x51')](_0x3281fd[_0x082c('0x52')][_0x082c('0x55')],path[_0x082c('0x54')](_0x3281fd[_0x082c('0x52')]['filename'])),'original_format':path[_0x082c('0x54')](_0x3281fd['file']['originalname'])[_0x082c('0x56')](0x1),'converted_format':_0x082c('0x57')};var _0x186a8e=path[_0x082c('0x48')](config[_0x082c('0x58')],'server/files/sounds/original',_0x3281fd[_0x082c('0x52')][_0x082c('0x55')]);var _0xcf4750=path['join'](config[_0x082c('0x58')],_0x082c('0x49'),util[_0x082c('0x4e')](_0x082c('0x4f'),path['basename'](_0x3281fd['file']['filename'],path[_0x082c('0x54')](_0x3281fd[_0x082c('0x52')][_0x082c('0x55')])),_0x3be7a8['converted_format']));logger[_0x082c('0x59')](_0x082c('0x5a'),_0x186a8e);logger['info'](_0x082c('0x5b'),_0xcf4750);try{fs['chmodSync'](_0x186a8e,parseInt(_0x082c('0x5c'),0x8));var _0x234066=sox[_0x082c('0x5d')](_0x186a8e,_0xcf4750,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x234066['on']('error',function(_0x1afd38){fs[_0x082c('0x5e')](_0x186a8e);_0x5bd73f[_0x082c('0x16')](0x1f4)[_0x082c('0x5f')](_0x1afd38);});_0x234066['on'](_0x082c('0x60'),function(_0x166a08){_0x3be7a8[_0x082c('0x61')]=isNaN(_0x166a08[_0x082c('0x62')])?null:_0x166a08[_0x082c('0x62')]*0x3e8;_0x3be7a8[_0x082c('0x63')]=isNaN(_0x166a08[_0x082c('0x64')])?null:_0x166a08[_0x082c('0x64')];_0x3be7a8['original_channelCount']=isNaN(_0x166a08['channelCount'])?null:_0x166a08[_0x082c('0x65')];_0x3be7a8['original_bitRate']=isNaN(_0x166a08[_0x082c('0x66')])?null:_0x166a08['bitRate'];_0x3be7a8[_0x082c('0x67')]=isNaN(_0x166a08[_0x082c('0x68')])?null:_0x166a08['sampleRate'];});_0x234066['on'](_0x082c('0x69'),function(_0x54e681){_0x3be7a8[_0x082c('0x6a')]=isNaN(_0x54e681['duration'])?null:_0x54e681[_0x082c('0x62')]*0x3e8;_0x3be7a8[_0x082c('0x6b')]=isNaN(_0x54e681[_0x082c('0x64')])?null:_0x54e681[_0x082c('0x64')];_0x3be7a8[_0x082c('0x6c')]=isNaN(_0x54e681[_0x082c('0x65')])?null:_0x54e681[_0x082c('0x65')];_0x3be7a8['converted_bitRate']=isNaN(_0x54e681['bitRate'])?null:_0x54e681[_0x082c('0x66')];_0x3be7a8[_0x082c('0x6d')]=isNaN(_0x54e681[_0x082c('0x68')])?null:_0x54e681['sampleRate'];});_0x234066['on']('end',function(){fs[_0x082c('0x6e')](_0xcf4750,parseInt('0777',0x8));return db['Sound']['create'](_0x3be7a8)[_0x082c('0x22')](function(_0x3f3211){var _0x43086a={'role':_0x3281fd[_0x082c('0x6f')]['role'],'userProfileId':_0x3281fd[_0x082c('0x6f')][_0x082c('0x70')]};if(!_0x43086a)throw new Error(_0x082c('0x71'));if(_0x43086a[_0x082c('0x72')]==='user'){var _0x408b61=_0x3f3211['get']({'plain':!![]});return db[_0x082c('0x73')][_0x082c('0x45')]({'where':{'name':_0x082c('0x23'),'userProfileId':_0x43086a[_0x082c('0x70')]},'raw':!![]})[_0x082c('0x22')](function(_0x2af6b0){if(_0x2af6b0&&_0x2af6b0[_0x082c('0x74')]===0x0){return db[_0x082c('0x24')][_0x082c('0x50')]({'name':_0x408b61[_0x082c('0x28')],'resourceId':_0x408b61['id'],'type':_0x2af6b0[_0x082c('0x28')],'sectionId':_0x2af6b0['id']},{})[_0x082c('0x22')](function(){return _0x3f3211;});}else{return _0x3f3211;}})[_0x082c('0x41')](function(_0x440f18){logger[_0x082c('0x26')](_0x082c('0x75'),_0x440f18);throw _0x440f18;});}return _0x3f3211;})[_0x082c('0x22')](respondWithResult(_0x5bd73f,null))[_0x082c('0x41')](handleError(_0x5bd73f,null));});_0x234066['start']();}catch(_0x368d04){_0x5bd73f['status'](0x1f4)[_0x082c('0x5f')](_0x368d04);}};exports['update']=function(_0x5f0af0,_0x678bb3,_0x5026c5){return db[_0x082c('0x2a')]['find']({'where':{'id':_0x5f0af0[_0x082c('0x43')]['id']}})[_0x082c('0x22')](handleEntityNotFound(_0x678bb3,null))[_0x082c('0x22')](saveUpdates(_['pick'](_0x5f0af0[_0x082c('0x6f')],[_0x082c('0x28'),_0x082c('0x76')]),null))[_0x082c('0x22')](respondWithResult(_0x678bb3,null))[_0x082c('0x41')](handleError(_0x678bb3,null));};exports[_0x082c('0x77')]=function(_0x226882,_0x1e4f03,_0x50f5b2){return db['Sound'][_0x082c('0x45')]({'where':{'id':_0x226882[_0x082c('0x43')]['id']}})[_0x082c('0x22')](function(_0x1cbe31){if(_0x1cbe31){return _0x1cbe31[_0x082c('0x21')]();}})[_0x082c('0x22')](function(_0x1a46ee){var _0x19a138=path[_0x082c('0x48')](config[_0x082c('0x58')],_0x082c('0x78'),util['format'](_0x082c('0x4f'),_0x1a46ee[_0x082c('0x46')],_0x1a46ee[_0x082c('0x79')]));var _0x502879=path[_0x082c('0x48')](config[_0x082c('0x58')],_0x082c('0x49'),util[_0x082c('0x4e')](_0x082c('0x4f'),_0x1a46ee[_0x082c('0x46')],_0x1a46ee['converted_format']));fs[_0x082c('0x5e')](_0x19a138);fs['unlinkSync'](_0x502879);return _0x1a46ee;})[_0x082c('0x22')](function(_0xc56b33){if(_0xc56b33){return _0x1e4f03[_0x082c('0x16')](0xcc)[_0x082c('0x17')]();}})[_0x082c('0x22')](handleEntityNotFound(_0x1e4f03,null))[_0x082c('0x41')](handleError(_0x1e4f03,null));}; \ No newline at end of file +var _0x0fd5=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','update','destroy','then','get','Sounds','UserProfileResource','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','fields','include','find','download','converted_format','join','root','save_name','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x6dd1a3,_0x220e33){var _0x3ee09a=function(_0x572bca){while(--_0x572bca){_0x6dd1a3['push'](_0x6dd1a3['shift']());}};_0x3ee09a(++_0x220e33);}(_0x0fd5,0x1ea));var _0x50fd=function(_0x48d27f,_0x321299){_0x48d27f=_0x48d27f-0x0;var _0x4c2a3d=_0x0fd5[_0x48d27f];return _0x4c2a3d;};'use strict';var emlformat=require(_0x50fd('0x0'));var rimraf=require(_0x50fd('0x1'));var zipdir=require(_0x50fd('0x2'));var jsonpatch=require(_0x50fd('0x3'));var rp=require('request-promise');var moment=require(_0x50fd('0x4'));var BPromise=require(_0x50fd('0x5'));var Mustache=require(_0x50fd('0x6'));var util=require('util');var path=require(_0x50fd('0x7'));var sox=require(_0x50fd('0x8'));var csv=require(_0x50fd('0x9'));var ejs=require(_0x50fd('0xa'));var fs=require('fs');var fs_extra=require(_0x50fd('0xb'));var _=require(_0x50fd('0xc'));var squel=require(_0x50fd('0xd'));var crypto=require(_0x50fd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50fd('0x9'));var querystring=require('querystring');var Papa=require(_0x50fd('0xf'));var Redis=require(_0x50fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x50fd('0x11'));var as=require(_0x50fd('0x12'));var hardwareService=require(_0x50fd('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x50fd('0x14'));var config=require(_0x50fd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x50fd('0x16'))['db'];function respondWithStatusCode(_0x3907d4,_0xbcfd5e){_0xbcfd5e=_0xbcfd5e||0xcc;return function(_0x352928){if(_0x352928){return _0x3907d4[_0x50fd('0x17')](_0xbcfd5e);}return _0x3907d4['status'](_0xbcfd5e)[_0x50fd('0x18')]();};}function respondWithResult(_0x3b2239,_0x47ebae){_0x47ebae=_0x47ebae||0xc8;return function(_0x5e33b6){if(_0x5e33b6){return _0x3b2239[_0x50fd('0x19')](_0x47ebae)[_0x50fd('0x1a')](_0x5e33b6);}};}function respondWithFilteredResult(_0x27168c,_0x3ecfce){return function(_0x1352c6){if(_0x1352c6){var _0x53b973=typeof _0x3ecfce['offset']==='undefined'&&typeof _0x3ecfce['limit']==='undefined';var _0x5a087d=_0x1352c6[_0x50fd('0x1b')];var _0x20bcc6=_0x53b973?0x0:_0x3ecfce[_0x50fd('0x1c')];var _0x509b74=_0x53b973?_0x1352c6[_0x50fd('0x1b')]:_0x3ecfce[_0x50fd('0x1c')]+_0x3ecfce[_0x50fd('0x1d')];var _0x289cdf;if(_0x509b74>=_0x5a087d){_0x509b74=_0x5a087d;_0x289cdf=0xc8;}else{_0x289cdf=0xce;}_0x27168c[_0x50fd('0x19')](_0x289cdf);return _0x27168c[_0x50fd('0x1e')]('Content-Range',_0x20bcc6+'-'+_0x509b74+'/'+_0x5a087d)[_0x50fd('0x1a')](_0x1352c6);}return null;};}function patchUpdates(_0x4b2e99){return function(_0x3ba5e6){try{jsonpatch['apply'](_0x3ba5e6,_0x4b2e99,!![]);}catch(_0x37ccd0){return BPromise[_0x50fd('0x1f')](_0x37ccd0);}return _0x3ba5e6['save']();};}function saveUpdates(_0x32602c,_0x501a3c){return function(_0x159997){if(_0x159997){return _0x159997[_0x50fd('0x20')](_0x32602c)['then'](function(_0xb0ee33){return _0xb0ee33;});}return null;};}function removeEntity(_0x53aaeb,_0x5636bd){return function(_0x546ec6){if(_0x546ec6){return _0x546ec6[_0x50fd('0x21')]()[_0x50fd('0x22')](function(){var _0x24a9a9=_0x546ec6[_0x50fd('0x23')]({'plain':!![]});var _0x264ee1=_0x50fd('0x24');return db[_0x50fd('0x25')][_0x50fd('0x21')]({'where':{'type':_0x264ee1,'resourceId':_0x24a9a9['id']}})[_0x50fd('0x22')](function(){return _0x546ec6;});})[_0x50fd('0x22')](function(){_0x53aaeb[_0x50fd('0x19')](0xcc)[_0x50fd('0x18')]();});}};}function handleEntityNotFound(_0xfe9e0,_0x210ced){return function(_0x46b68e){if(!_0x46b68e){_0xfe9e0['sendStatus'](0x194);}return _0x46b68e;};}function handleError(_0x2ba2bf,_0x151cd6){_0x151cd6=_0x151cd6||0x1f4;return function(_0x31ad0a){logger['error'](_0x31ad0a['stack']);if(_0x31ad0a[_0x50fd('0x26')]){delete _0x31ad0a[_0x50fd('0x26')];}_0x2ba2bf['status'](_0x151cd6)['send'](_0x31ad0a);};}exports[_0x50fd('0x27')]=function(_0x95c2e8,_0x1d91bb){var _0x258b21={},_0x4903f2={},_0x1d17a8={'count':0x0,'rows':[]};var _0x46c223=_[_0x50fd('0x28')](db[_0x50fd('0x29')][_0x50fd('0x2a')],function(_0x3610c8){return{'name':_0x3610c8[_0x50fd('0x2b')],'type':_0x3610c8[_0x50fd('0x2c')][_0x50fd('0x2d')]};});_0x4903f2[_0x50fd('0x2e')]=_[_0x50fd('0x28')](_0x46c223,_0x50fd('0x26'));_0x4903f2[_0x50fd('0x2f')]=_[_0x50fd('0x30')](_0x95c2e8[_0x50fd('0x2f')]);_0x4903f2[_0x50fd('0x31')]=_['intersection'](_0x4903f2[_0x50fd('0x2e')],_0x4903f2[_0x50fd('0x2f')]);_0x258b21[_0x50fd('0x32')]=_[_0x50fd('0x33')](_0x4903f2[_0x50fd('0x2e')],qs['fields'](_0x95c2e8[_0x50fd('0x2f')]['fields']));_0x258b21['attributes']=_0x258b21[_0x50fd('0x32')][_0x50fd('0x34')]?_0x258b21[_0x50fd('0x32')]:_0x4903f2[_0x50fd('0x2e')];if(!_0x95c2e8[_0x50fd('0x2f')][_0x50fd('0x35')](_0x50fd('0x36'))){_0x258b21['limit']=qs[_0x50fd('0x1d')](_0x95c2e8['query'][_0x50fd('0x1d')]);_0x258b21[_0x50fd('0x1c')]=qs[_0x50fd('0x1c')](_0x95c2e8[_0x50fd('0x2f')][_0x50fd('0x1c')]);}_0x258b21['order']=qs[_0x50fd('0x37')](_0x95c2e8['query'][_0x50fd('0x37')]);_0x258b21[_0x50fd('0x38')]=qs[_0x50fd('0x31')](_[_0x50fd('0x39')](_0x95c2e8[_0x50fd('0x2f')],_0x4903f2['filters']),_0x46c223);if(_0x95c2e8[_0x50fd('0x2f')]['filter']){_0x258b21[_0x50fd('0x38')]=_[_0x50fd('0x3a')](_0x258b21[_0x50fd('0x38')],{'$or':_['map'](_0x46c223,function(_0x4772f2){if(_0x4772f2[_0x50fd('0x2c')]!==_0x50fd('0x3b')){var _0x1b4980={};_0x1b4980[_0x4772f2['name']]={'$like':'%'+_0x95c2e8[_0x50fd('0x2f')][_0x50fd('0x3c')]+'%'};return _0x1b4980;}})});}_0x258b21=_[_0x50fd('0x3a')]({},_0x258b21,_0x95c2e8[_0x50fd('0x3d')]);var _0x36e8c9={'where':_0x258b21[_0x50fd('0x38')]};return db['Sound'][_0x50fd('0x1b')](_0x36e8c9)[_0x50fd('0x22')](function(_0x1e9844){_0x1d17a8[_0x50fd('0x1b')]=_0x1e9844;if(_0x95c2e8[_0x50fd('0x2f')][_0x50fd('0x3e')]){_0x258b21['include']=[{'all':!![]}];}return db[_0x50fd('0x29')][_0x50fd('0x3f')](_0x258b21);})[_0x50fd('0x22')](function(_0x477cac){_0x1d17a8[_0x50fd('0x40')]=_0x477cac;return _0x1d17a8;})[_0x50fd('0x22')](respondWithFilteredResult(_0x1d91bb,_0x258b21))[_0x50fd('0x41')](handleError(_0x1d91bb,null));};exports['show']=function(_0xc83cd8,_0x750049){var _0x2fb996={'raw':!![],'where':{'id':_0xc83cd8[_0x50fd('0x42')]['id']}},_0x43698b={};_0x43698b[_0x50fd('0x2e')]=_[_0x50fd('0x30')](db[_0x50fd('0x29')][_0x50fd('0x2a')]);_0x43698b[_0x50fd('0x2f')]=_[_0x50fd('0x30')](_0xc83cd8[_0x50fd('0x2f')]);_0x43698b[_0x50fd('0x31')]=_[_0x50fd('0x33')](_0x43698b[_0x50fd('0x2e')],_0x43698b['query']);_0x2fb996['attributes']=_[_0x50fd('0x33')](_0x43698b[_0x50fd('0x2e')],qs[_0x50fd('0x43')](_0xc83cd8['query'][_0x50fd('0x43')]));_0x2fb996[_0x50fd('0x32')]=_0x2fb996[_0x50fd('0x32')]['length']?_0x2fb996[_0x50fd('0x32')]:_0x43698b[_0x50fd('0x2e')];if(_0xc83cd8['query'][_0x50fd('0x3e')]){_0x2fb996[_0x50fd('0x44')]=[{'all':!![]}];}_0x2fb996=_[_0x50fd('0x3a')]({},_0x2fb996,_0xc83cd8['options']);return db[_0x50fd('0x29')][_0x50fd('0x45')](_0x2fb996)['then'](handleEntityNotFound(_0x750049,null))[_0x50fd('0x22')](respondWithResult(_0x750049,null))[_0x50fd('0x41')](handleError(_0x750049,null));};exports[_0x50fd('0x46')]=function(_0x3f067d,_0x264a38,_0x2ac0b6){return db[_0x50fd('0x29')]['find']({'where':{'id':_0x3f067d['params']['id']},'attributes':[_0x50fd('0x26'),'save_name',_0x50fd('0x47')],'raw':!![]})[_0x50fd('0x22')](handleEntityNotFound(_0x264a38,null))[_0x50fd('0x22')](function(_0x3e0698){if(_0x3e0698){if(!fs['existsSync'](path[_0x50fd('0x48')](config[_0x50fd('0x49')],'server/files/sounds/converted',_0x3e0698[_0x50fd('0x4a')]+'.'+_0x3e0698[_0x50fd('0x47')]))){throw new db[(_0x50fd('0x4b'))][(_0x50fd('0x4c'))](_0x50fd('0x4d'));}return _0x264a38[_0x50fd('0x46')](path[_0x50fd('0x48')](config[_0x50fd('0x49')],_0x50fd('0x4e'),util[_0x50fd('0x4f')](_0x50fd('0x50'),_0x3e0698[_0x50fd('0x4a')],_0x3e0698[_0x50fd('0x47')])),util[_0x50fd('0x4f')](_0x50fd('0x50'),_0x3e0698[_0x50fd('0x26')],_0x3e0698['converted_format']));}return null;})[_0x50fd('0x41')](handleError(_0x264a38,null));};exports['create']=function(_0x5b0591,_0x1641f2,_0x12b0e3){var _0xb07214={'name':path['basename'](_0x5b0591[_0x50fd('0x51')][_0x50fd('0x52')],path[_0x50fd('0x53')](_0x5b0591['file'][_0x50fd('0x52')])),'save_name':path[_0x50fd('0x54')](_0x5b0591[_0x50fd('0x51')][_0x50fd('0x55')],path[_0x50fd('0x53')](_0x5b0591[_0x50fd('0x51')][_0x50fd('0x55')])),'original_format':path['extname'](_0x5b0591[_0x50fd('0x51')]['originalname'])[_0x50fd('0x56')](0x1),'converted_format':_0x50fd('0x57')};var _0x6ef536=path[_0x50fd('0x48')](config[_0x50fd('0x49')],'server/files/sounds/original',_0x5b0591['file'][_0x50fd('0x55')]);var _0x475bc0=path['join'](config['root'],_0x50fd('0x4e'),util[_0x50fd('0x4f')]('%s.%s',path['basename'](_0x5b0591[_0x50fd('0x51')][_0x50fd('0x55')],path['extname'](_0x5b0591[_0x50fd('0x51')][_0x50fd('0x55')])),_0xb07214[_0x50fd('0x47')]));logger[_0x50fd('0x58')](_0x50fd('0x59'),_0x6ef536);logger['info'](_0x50fd('0x5a'),_0x475bc0);try{fs[_0x50fd('0x5b')](_0x6ef536,parseInt(_0x50fd('0x5c'),0x8));var _0xd133e2=sox[_0x50fd('0x5d')](_0x6ef536,_0x475bc0,{'sampleRate':0x1f40,'format':_0x50fd('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xd133e2['on'](_0x50fd('0x5e'),function(_0x20dcc4){fs[_0x50fd('0x5f')](_0x6ef536);_0x1641f2[_0x50fd('0x19')](0x1f4)['send'](_0x20dcc4);});_0xd133e2['on'](_0x50fd('0x60'),function(_0x41d4cd){_0xb07214[_0x50fd('0x61')]=isNaN(_0x41d4cd[_0x50fd('0x62')])?null:_0x41d4cd[_0x50fd('0x62')]*0x3e8;_0xb07214[_0x50fd('0x63')]=isNaN(_0x41d4cd[_0x50fd('0x64')])?null:_0x41d4cd[_0x50fd('0x64')];_0xb07214[_0x50fd('0x65')]=isNaN(_0x41d4cd[_0x50fd('0x66')])?null:_0x41d4cd[_0x50fd('0x66')];_0xb07214[_0x50fd('0x67')]=isNaN(_0x41d4cd[_0x50fd('0x68')])?null:_0x41d4cd[_0x50fd('0x68')];_0xb07214[_0x50fd('0x69')]=isNaN(_0x41d4cd['sampleRate'])?null:_0x41d4cd[_0x50fd('0x6a')];});_0xd133e2['on'](_0x50fd('0x6b'),function(_0x506c9e){_0xb07214[_0x50fd('0x6c')]=isNaN(_0x506c9e['duration'])?null:_0x506c9e['duration']*0x3e8;_0xb07214[_0x50fd('0x6d')]=isNaN(_0x506c9e[_0x50fd('0x64')])?null:_0x506c9e[_0x50fd('0x64')];_0xb07214[_0x50fd('0x6e')]=isNaN(_0x506c9e[_0x50fd('0x66')])?null:_0x506c9e[_0x50fd('0x66')];_0xb07214[_0x50fd('0x6f')]=isNaN(_0x506c9e[_0x50fd('0x68')])?null:_0x506c9e[_0x50fd('0x68')];_0xb07214[_0x50fd('0x70')]=isNaN(_0x506c9e[_0x50fd('0x6a')])?null:_0x506c9e['sampleRate'];});_0xd133e2['on'](_0x50fd('0x18'),function(){fs['chmodSync'](_0x475bc0,parseInt(_0x50fd('0x5c'),0x8));return db[_0x50fd('0x29')][_0x50fd('0x71')](_0xb07214)[_0x50fd('0x22')](function(_0x2e0ec3){var _0x50e0cb={'role':_0x5b0591[_0x50fd('0x72')]['role'],'userProfileId':_0x5b0591[_0x50fd('0x72')]['userProfileId']};if(!_0x50e0cb)throw new Error(_0x50fd('0x73'));if(_0x50e0cb['role']===_0x50fd('0x74')){var _0x45f54d=_0x2e0ec3[_0x50fd('0x23')]({'plain':!![]});return db[_0x50fd('0x75')][_0x50fd('0x45')]({'where':{'name':_0x50fd('0x24'),'userProfileId':_0x50e0cb[_0x50fd('0x76')]},'raw':!![]})[_0x50fd('0x22')](function(_0x544198){if(_0x544198&&_0x544198[_0x50fd('0x77')]===0x0){return db[_0x50fd('0x25')][_0x50fd('0x71')]({'name':_0x45f54d['name'],'resourceId':_0x45f54d['id'],'type':_0x544198[_0x50fd('0x26')],'sectionId':_0x544198['id']},{})['then'](function(){return _0x2e0ec3;});}else{return _0x2e0ec3;}})[_0x50fd('0x41')](function(_0x5a92f6){logger['error'](_0x50fd('0x78'),_0x5a92f6);throw _0x5a92f6;});}return _0x2e0ec3;})['then'](respondWithResult(_0x1641f2,null))[_0x50fd('0x41')](handleError(_0x1641f2,null));});_0xd133e2['start']();}catch(_0x3124aa){_0x1641f2[_0x50fd('0x19')](0x1f4)[_0x50fd('0x79')](_0x3124aa);}};exports[_0x50fd('0x20')]=function(_0x233975,_0x4a7f80,_0x2ddeaf){return db[_0x50fd('0x29')][_0x50fd('0x45')]({'where':{'id':_0x233975[_0x50fd('0x42')]['id']}})[_0x50fd('0x22')](handleEntityNotFound(_0x4a7f80,null))[_0x50fd('0x22')](saveUpdates(_['pick'](_0x233975[_0x50fd('0x72')],[_0x50fd('0x26'),'description']),null))[_0x50fd('0x22')](respondWithResult(_0x4a7f80,null))[_0x50fd('0x41')](handleError(_0x4a7f80,null));};exports[_0x50fd('0x7a')]=function(_0x27252e,_0x31e411,_0x313084){return db[_0x50fd('0x29')]['find']({'where':{'id':_0x27252e[_0x50fd('0x42')]['id']}})[_0x50fd('0x22')](function(_0x132514){if(_0x132514){return _0x132514[_0x50fd('0x21')]();}})[_0x50fd('0x22')](function(_0x285cda){var _0x391dec=path['join'](config[_0x50fd('0x49')],'server/files/sounds/original',util['format'](_0x50fd('0x50'),_0x285cda['save_name'],_0x285cda[_0x50fd('0x7b')]));var _0x522096=path[_0x50fd('0x48')](config[_0x50fd('0x49')],_0x50fd('0x4e'),util[_0x50fd('0x4f')](_0x50fd('0x50'),_0x285cda[_0x50fd('0x4a')],_0x285cda[_0x50fd('0x47')]));fs[_0x50fd('0x5f')](_0x391dec);fs[_0x50fd('0x5f')](_0x522096);return _0x285cda;})[_0x50fd('0x22')](function(_0x5abdbd){if(_0x5abdbd){return _0x31e411[_0x50fd('0x19')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x31e411,null))['catch'](handleError(_0x31e411,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1679743..1218852 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 _0xebbf=['exports','define','Sound','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x2a1baa,_0x1658ba){var _0x4e4dff=function(_0x2cfe29){while(--_0x2cfe29){_0x2a1baa['push'](_0x2a1baa['shift']());}};_0x4e4dff(++_0x1658ba);}(_0xebbf,0x163));var _0xfebb=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xebbf[_0x163040];return _0x364667;};'use strict';var _=require('lodash');var util=require(_0xfebb('0x0'));var logger=require(_0xfebb('0x1'))(_0xfebb('0x2'));var moment=require(_0xfebb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfebb('0x4'));var rimraf=require(_0xfebb('0x5'));var config=require(_0xfebb('0x6'));var attributes=require(_0xfebb('0x7'));module[_0xfebb('0x8')]=function(_0x51e4b0,_0x146c1b){return _0x51e4b0[_0xfebb('0x9')](_0xfebb('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x061f=['Sound','tools_sounds','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x582689,_0x20c7b4){var _0x1041ca=function(_0x1ff4da){while(--_0x1ff4da){_0x582689['push'](_0x582689['shift']());}};_0x1041ca(++_0x20c7b4);}(_0x061f,0x199));var _0xf061=function(_0x13c06c,_0x3db76f){_0x13c06c=_0x13c06c-0x0;var _0x1184fd=_0x061f[_0x13c06c];return _0x1184fd;};'use strict';var _=require('lodash');var util=require(_0xf061('0x0'));var logger=require(_0xf061('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf061('0x2'));var rp=require(_0xf061('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf061('0x4'));var config=require(_0xf061('0x5'));var attributes=require(_0xf061('0x6'));module[_0xf061('0x7')]=function(_0xbed4a3,_0x3407fd){return _0xbed4a3[_0xf061('0x8')](_0xf061('0x9'),attributes,{'tableName':_0xf061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 58ee4d0..b1580ea 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 _0x9fbe=['model','debug','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','error','code','message','ShowSound','Sound','options','raw','where','attributes','include','map'];(function(_0x3be693,_0x98c90b){var _0x4da2ee=function(_0x4357d9){while(--_0x4357d9){_0x3be693['push'](_0x3be693['shift']());}};_0x4da2ee(++_0x98c90b);}(_0x9fbe,0x88));var _0xe9fb=function(_0x549ed3,_0x2f93b6){_0x549ed3=_0x549ed3-0x0;var _0x430546=_0x9fbe[_0x549ed3];return _0x430546;};'use strict';var _=require(_0xe9fb('0x0'));var util=require(_0xe9fb('0x1'));var moment=require(_0xe9fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9fb('0x3'));var fs=require('fs');var Redis=require(_0xe9fb('0x4'));var db=require(_0xe9fb('0x5'))['db'];var utils=require(_0xe9fb('0x6'));var logger=require(_0xe9fb('0x7'))(_0xe9fb('0x8'));var config=require(_0xe9fb('0x9'));var jayson=require(_0xe9fb('0xa'));var client=jayson[_0xe9fb('0xb')][_0xe9fb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3467b9,_0x94c587,_0x401d3e){return new BPromise(function(_0x311d78,_0xc6a481){return client[_0xe9fb('0xd')](_0x3467b9,_0x401d3e)[_0xe9fb('0xe')](function(_0x1288df){logger[_0xe9fb('0xf')](_0xe9fb('0x10'),_0x94c587,'request\x20sent');logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x94c587,_0xe9fb('0x11'),JSON['stringify'](_0x1288df));if(_0x1288df['error']){if(_0x1288df[_0xe9fb('0x12')][_0xe9fb('0x13')]===0x1f4){logger[_0xe9fb('0x12')](_0xe9fb('0x10'),_0x94c587,_0x1288df[_0xe9fb('0x12')][_0xe9fb('0x14')]);return _0xc6a481(_0x1288df[_0xe9fb('0x12')][_0xe9fb('0x14')]);}logger[_0xe9fb('0x12')]('Sound,\x20%s,\x20%s',_0x94c587,_0x1288df[_0xe9fb('0x12')][_0xe9fb('0x14')]);return _0x311d78(_0x1288df['error'][_0xe9fb('0x14')]);}else{logger[_0xe9fb('0xf')](_0xe9fb('0x10'),_0x94c587,'request\x20sent');_0x311d78(_0x1288df['result'][_0xe9fb('0x14')]);}})['catch'](function(_0x46886a){logger['error'](_0xe9fb('0x10'),_0x94c587,_0x46886a);_0xc6a481(_0x46886a);});});}exports[_0xe9fb('0x15')]=function(_0x2299bd){var _0x4a0681=this;return new Promise(function(_0x1a8c6f,_0xbfa1d3){return db[_0xe9fb('0x16')]['find']({'raw':_0x2299bd[_0xe9fb('0x17')]?_0x2299bd[_0xe9fb('0x17')][_0xe9fb('0x18')]===undefined?!![]:![]:!![],'where':_0x2299bd[_0xe9fb('0x17')]?_0x2299bd[_0xe9fb('0x17')][_0xe9fb('0x19')]||null:null,'attributes':_0x2299bd[_0xe9fb('0x17')]?_0x2299bd['options'][_0xe9fb('0x1a')]||null:null,'include':_0x2299bd[_0xe9fb('0x17')]?_0x2299bd[_0xe9fb('0x17')][_0xe9fb('0x1b')]?_[_0xe9fb('0x1c')](_0x2299bd[_0xe9fb('0x17')][_0xe9fb('0x1b')],function(_0x1962d4){return{'model':db[_0x1962d4[_0xe9fb('0x1d')]],'as':_0x1962d4['as'],'attributes':_0x1962d4[_0xe9fb('0x1a')],'include':_0x1962d4[_0xe9fb('0x1b')]?_[_0xe9fb('0x1c')](_0x1962d4['include'],function(_0x23873c){return{'model':db[_0x23873c[_0xe9fb('0x1d')]],'as':_0x23873c['as'],'attributes':_0x23873c[_0xe9fb('0x1a')],'include':_0x23873c[_0xe9fb('0x1b')]?_['map'](_0x23873c[_0xe9fb('0x1b')],function(_0x1a0cf3){return{'model':db[_0x1a0cf3[_0xe9fb('0x1d')]],'as':_0x1a0cf3['as'],'attributes':_0x1a0cf3['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9fb('0xe')](function(_0x30b6bd){logger[_0xe9fb('0xf')](_0xe9fb('0x15'),_0x2299bd);logger[_0xe9fb('0x1e')](_0xe9fb('0x15'),_0x2299bd,JSON[_0xe9fb('0x1f')](_0x30b6bd));_0x1a8c6f(_0x30b6bd);})[_0xe9fb('0x20')](function(_0x4a108b){logger['error'](_0xe9fb('0x15'),_0x4a108b[_0xe9fb('0x14')],_0x2299bd);_0xbfa1d3(_0x4a0681['error'](0x1f4,_0x4a108b['message']));});});}; \ No newline at end of file +var _0x1b14=['then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http'];(function(_0x57ea24,_0x5231d9){var _0x43ea0c=function(_0x6f56e1){while(--_0x6f56e1){_0x57ea24['push'](_0x57ea24['shift']());}};_0x43ea0c(++_0x5231d9);}(_0x1b14,0x6e));var _0x41b1=function(_0x1b7f32,_0x486c01){_0x1b7f32=_0x1b7f32-0x0;var _0x379d93=_0x1b14[_0x1b7f32];return _0x379d93;};'use strict';var _=require(_0x41b1('0x0'));var util=require(_0x41b1('0x1'));var moment=require(_0x41b1('0x2'));var BPromise=require(_0x41b1('0x3'));var rs=require(_0x41b1('0x4'));var fs=require('fs');var Redis=require(_0x41b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x41b1('0x6'))('rpc');var config=require(_0x41b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x41b1('0x8')][_0x41b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41ccbb,_0x34b715,_0x442e1c){return new BPromise(function(_0x5409a1,_0x538213){return client['request'](_0x41ccbb,_0x442e1c)[_0x41b1('0xa')](function(_0xe2ce11){logger[_0x41b1('0xb')](_0x41b1('0xc'),_0x34b715,_0x41b1('0xd'));logger[_0x41b1('0xe')](_0x41b1('0xf'),_0x34b715,_0x41b1('0xd'),JSON['stringify'](_0xe2ce11));if(_0xe2ce11[_0x41b1('0x10')]){if(_0xe2ce11['error'][_0x41b1('0x11')]===0x1f4){logger['error'](_0x41b1('0xc'),_0x34b715,_0xe2ce11[_0x41b1('0x10')][_0x41b1('0x12')]);return _0x538213(_0xe2ce11[_0x41b1('0x10')][_0x41b1('0x12')]);}logger[_0x41b1('0x10')](_0x41b1('0xc'),_0x34b715,_0xe2ce11[_0x41b1('0x10')][_0x41b1('0x12')]);return _0x5409a1(_0xe2ce11[_0x41b1('0x10')][_0x41b1('0x12')]);}else{logger[_0x41b1('0xb')](_0x41b1('0xc'),_0x34b715,_0x41b1('0xd'));_0x5409a1(_0xe2ce11['result'][_0x41b1('0x12')]);}})[_0x41b1('0x13')](function(_0x4595e9){logger['error'](_0x41b1('0xc'),_0x34b715,_0x4595e9);_0x538213(_0x4595e9);});});}exports[_0x41b1('0x14')]=function(_0x36310a){var _0x9e3e29=this;return new Promise(function(_0x40744f,_0x2923e2){return db[_0x41b1('0x15')]['find']({'raw':_0x36310a[_0x41b1('0x16')]?_0x36310a['options'][_0x41b1('0x17')]===undefined?!![]:![]:!![],'where':_0x36310a[_0x41b1('0x16')]?_0x36310a['options'][_0x41b1('0x18')]||null:null,'attributes':_0x36310a[_0x41b1('0x16')]?_0x36310a[_0x41b1('0x16')][_0x41b1('0x19')]||null:null,'include':_0x36310a[_0x41b1('0x16')]?_0x36310a[_0x41b1('0x16')][_0x41b1('0x1a')]?_[_0x41b1('0x1b')](_0x36310a[_0x41b1('0x16')][_0x41b1('0x1a')],function(_0x714906){return{'model':db[_0x714906[_0x41b1('0x1c')]],'as':_0x714906['as'],'attributes':_0x714906['attributes'],'include':_0x714906[_0x41b1('0x1a')]?_[_0x41b1('0x1b')](_0x714906[_0x41b1('0x1a')],function(_0xab4b4){return{'model':db[_0xab4b4[_0x41b1('0x1c')]],'as':_0xab4b4['as'],'attributes':_0xab4b4[_0x41b1('0x19')],'include':_0xab4b4[_0x41b1('0x1a')]?_[_0x41b1('0x1b')](_0xab4b4[_0x41b1('0x1a')],function(_0x5ac895){return{'model':db[_0x5ac895[_0x41b1('0x1c')]],'as':_0x5ac895['as'],'attributes':_0x5ac895[_0x41b1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58af5b){logger[_0x41b1('0xb')](_0x41b1('0x14'),_0x36310a);logger[_0x41b1('0xe')](_0x41b1('0x14'),_0x36310a,JSON[_0x41b1('0x1d')](_0x58af5b));_0x40744f(_0x58af5b);})[_0x41b1('0x13')](function(_0x55ce7b){logger['error'](_0x41b1('0x14'),_0x55ce7b[_0x41b1('0x12')],_0x36310a);_0x2923e2(_0x9e3e29[_0x41b1('0x10')](0x1f4,_0x55ce7b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 8fe1b24..b2a66ca 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x5e57c4,_0x23b6d3){var _0x31284e=function(_0x17e085){while(--_0x17e085){_0x5e57c4['push'](_0x5e57c4['shift']());}};_0x31284e(++_0x23b6d3);}(_0x5eb8,0xb0));var _0x85eb=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x5eb8[_0xa4f636];return _0x37e02a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +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(_0x5ae93d,_0x48a929){var _0x3bc344=function(_0x37d1e8){while(--_0x37d1e8){_0x5ae93d['push'](_0x5ae93d['shift']());}};_0x3bc344(++_0x48a929);}(_0x4fc2,0x111));var _0x24fc=function(_0x5cacd3,_0x292f47){_0x5cacd3=_0x5cacd3-0x0;var _0x3a40ba=_0x4fc2[_0x5cacd3];return _0x3a40ba;};'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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a0cf8cc..a85e2c1 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 _0x64eb=['sequelize','exports','TEXT','out','STRING'];(function(_0x55b12b,_0x4565a8){var _0x1a196d=function(_0x10cbe5){while(--_0x10cbe5){_0x55b12b['push'](_0x55b12b['shift']());}};_0x1a196d(++_0x4565a8);}(_0x64eb,0x91));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb64e('0x0'));module[_0xb64e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xb64e('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb64e('0x3')),'defaultValue':_0xb64e('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb64e('0x4')]},'providerResponse':{'type':Sequelize[_0xb64e('0x2')]}}; \ No newline at end of file +var _0xf170=['sequelize','exports','STRING','ENUM','out','TEXT'];(function(_0x432aa9,_0x1eecdd){var _0x8b4ee5=function(_0x2cd5c1){while(--_0x2cd5c1){_0x432aa9['push'](_0x432aa9['shift']());}};_0x8b4ee5(++_0x1eecdd);}(_0xf170,0x78));var _0x0f17=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0xf170[_0x456032];return _0x1a53cd;};'use strict';var Sequelize=require(_0x0f17('0x0'));module[_0x0f17('0x1')]={'uniqueid':{'type':Sequelize[_0x0f17('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x0f17('0x3')]('in',_0x0f17('0x4')),'defaultValue':_0x0f17('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0f17('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 9298c11..130ae6a 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 _0x605b=['sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','stack','name','send','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x11099f,_0x4416b9){var _0x273f0a=function(_0xc4acbd){while(--_0xc4acbd){_0x11099f['push'](_0x11099f['shift']());}};_0x273f0a(++_0x4416b9);}(_0x605b,0xf4));var _0xb605=function(_0x44dd34,_0x189599){_0x44dd34=_0x44dd34-0x0;var _0x210295=_0x605b[_0x44dd34];return _0x210295;};'use strict';var emlformat=require(_0xb605('0x0'));var rimraf=require(_0xb605('0x1'));var zipdir=require(_0xb605('0x2'));var jsonpatch=require(_0xb605('0x3'));var rp=require('request-promise');var moment=require(_0xb605('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb605('0x5'));var path=require('path');var sox=require(_0xb605('0x6'));var csv=require(_0xb605('0x7'));var ejs=require(_0xb605('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb605('0x9'));var squel=require(_0xb605('0xa'));var crypto=require(_0xb605('0xb'));var jsforce=require(_0xb605('0xc'));var deskjs=require(_0xb605('0xd'));var toCsv=require(_0xb605('0x7'));var querystring=require(_0xb605('0xe'));var Papa=require(_0xb605('0xf'));var Redis=require(_0xb605('0x10'));var authService=require(_0xb605('0x11'));var qs=require(_0xb605('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb605('0x13'));var logger=require(_0xb605('0x14'))('api');var utils=require(_0xb605('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb605('0x16'));var db=require(_0xb605('0x17'))['db'];function respondWithStatusCode(_0x2d4a24,_0x26fee1){_0x26fee1=_0x26fee1||0xcc;return function(_0x5b7a5c){if(_0x5b7a5c){return _0x2d4a24[_0xb605('0x18')](_0x26fee1);}return _0x2d4a24['status'](_0x26fee1)[_0xb605('0x19')]();};}function respondWithResult(_0x1ac276,_0x2b740c){_0x2b740c=_0x2b740c||0xc8;return function(_0x42e1b9){if(_0x42e1b9){return _0x1ac276[_0xb605('0x1a')](_0x2b740c)[_0xb605('0x1b')](_0x42e1b9);}};}function respondWithFilteredResult(_0x41120b,_0x3d721f){return function(_0x2e177b){if(_0x2e177b){var _0x341612=typeof _0x3d721f[_0xb605('0x1c')]===_0xb605('0x1d')&&typeof _0x3d721f['limit']===_0xb605('0x1d');var _0x3cab37=_0x2e177b[_0xb605('0x1e')];var _0x1d39a4=_0x341612?0x0:_0x3d721f[_0xb605('0x1c')];var _0x294f20=_0x341612?_0x2e177b['count']:_0x3d721f[_0xb605('0x1c')]+_0x3d721f[_0xb605('0x1f')];var _0x5ded89;if(_0x294f20>=_0x3cab37){_0x294f20=_0x3cab37;_0x5ded89=0xc8;}else{_0x5ded89=0xce;}_0x41120b[_0xb605('0x1a')](_0x5ded89);return _0x41120b[_0xb605('0x20')](_0xb605('0x21'),_0x1d39a4+'-'+_0x294f20+'/'+_0x3cab37)[_0xb605('0x1b')](_0x2e177b);}return null;};}function patchUpdates(_0x24a798){return function(_0x44ca79){try{jsonpatch['apply'](_0x44ca79,_0x24a798,!![]);}catch(_0x154026){return BPromise[_0xb605('0x22')](_0x154026);}return _0x44ca79[_0xb605('0x23')]();};}function saveUpdates(_0x55293f,_0x296665){return function(_0x36bafa){if(_0x36bafa){return _0x36bafa[_0xb605('0x24')](_0x55293f)[_0xb605('0x25')](function(_0x23857a){return _0x23857a;});}return null;};}function removeEntity(_0xb32ca2,_0x3fbefb){return function(_0x209284){if(_0x209284){return _0x209284['destroy']()[_0xb605('0x25')](function(){_0xb32ca2[_0xb605('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3391e2,_0x3ff449){return function(_0x284aeb){if(!_0x284aeb){_0x3391e2[_0xb605('0x18')](0x194);}return _0x284aeb;};}function handleError(_0x4caeee,_0x19f141){_0x19f141=_0x19f141||0x1f4;return function(_0x340389){logger['error'](_0x340389[_0xb605('0x26')]);if(_0x340389[_0xb605('0x27')]){delete _0x340389[_0xb605('0x27')];}_0x4caeee[_0xb605('0x1a')](_0x19f141)[_0xb605('0x28')](_0x340389);};}exports['index']=function(_0x269e28,_0x4f2936){var _0x1123d6={},_0x54ac84={},_0x24c9cc={'count':0x0,'rows':[]};var _0x4f372d=_[_0xb605('0x29')](db['SquareMessage'][_0xb605('0x2a')],function(_0x35a60d){return{'name':_0x35a60d[_0xb605('0x2b')],'type':_0x35a60d['type']['key']};});_0x54ac84[_0xb605('0x2c')]=_['map'](_0x4f372d,'name');_0x54ac84[_0xb605('0x2d')]=_['keys'](_0x269e28[_0xb605('0x2d')]);_0x54ac84['filters']=_[_0xb605('0x2e')](_0x54ac84[_0xb605('0x2c')],_0x54ac84[_0xb605('0x2d')]);_0x1123d6[_0xb605('0x2f')]=_[_0xb605('0x2e')](_0x54ac84[_0xb605('0x2c')],qs['fields'](_0x269e28[_0xb605('0x2d')][_0xb605('0x30')]));_0x1123d6[_0xb605('0x2f')]=_0x1123d6[_0xb605('0x2f')]['length']?_0x1123d6[_0xb605('0x2f')]:_0x54ac84[_0xb605('0x2c')];if(!_0x269e28['query'][_0xb605('0x31')](_0xb605('0x32'))){_0x1123d6[_0xb605('0x1f')]=qs[_0xb605('0x1f')](_0x269e28[_0xb605('0x2d')]['limit']);_0x1123d6[_0xb605('0x1c')]=qs[_0xb605('0x1c')](_0x269e28[_0xb605('0x2d')][_0xb605('0x1c')]);}_0x1123d6[_0xb605('0x33')]=qs['sort'](_0x269e28[_0xb605('0x2d')][_0xb605('0x34')]);_0x1123d6[_0xb605('0x35')]=qs[_0xb605('0x36')](_[_0xb605('0x37')](_0x269e28[_0xb605('0x2d')],_0x54ac84[_0xb605('0x36')]),_0x4f372d);if(_0x269e28[_0xb605('0x2d')][_0xb605('0x38')]){_0x1123d6[_0xb605('0x35')]=_[_0xb605('0x39')](_0x1123d6['where'],{'$or':_[_0xb605('0x29')](_0x4f372d,function(_0x333bca){if(_0x333bca[_0xb605('0x3a')]!==_0xb605('0x3b')){var _0x149039={};_0x149039[_0x333bca[_0xb605('0x27')]]={'$like':'%'+_0x269e28[_0xb605('0x2d')][_0xb605('0x38')]+'%'};return _0x149039;}})});}_0x1123d6=_[_0xb605('0x39')]({},_0x1123d6,_0x269e28[_0xb605('0x3c')]);var _0x3ad29a={'where':_0x1123d6[_0xb605('0x35')]};return db[_0xb605('0x3d')]['count'](_0x3ad29a)[_0xb605('0x25')](function(_0x27ad4b){_0x24c9cc[_0xb605('0x1e')]=_0x27ad4b;if(_0x269e28[_0xb605('0x2d')][_0xb605('0x3e')]){_0x1123d6['include']=[{'all':!![]}];}return db[_0xb605('0x3d')][_0xb605('0x3f')](_0x1123d6);})['then'](function(_0x3b8605){_0x24c9cc[_0xb605('0x40')]=_0x3b8605;return _0x24c9cc;})[_0xb605('0x25')](respondWithFilteredResult(_0x4f2936,_0x1123d6))[_0xb605('0x41')](handleError(_0x4f2936,null));};exports['show']=function(_0xf4bf6b,_0x3309f7){var _0x5813b3={'raw':!![],'where':{'id':_0xf4bf6b[_0xb605('0x42')]['id']}},_0x5aa1de={};_0x5aa1de[_0xb605('0x2c')]=_[_0xb605('0x43')](db['SquareMessage'][_0xb605('0x2a')]);_0x5aa1de[_0xb605('0x2d')]=_[_0xb605('0x43')](_0xf4bf6b['query']);_0x5aa1de[_0xb605('0x36')]=_[_0xb605('0x2e')](_0x5aa1de[_0xb605('0x2c')],_0x5aa1de[_0xb605('0x2d')]);_0x5813b3[_0xb605('0x2f')]=_[_0xb605('0x2e')](_0x5aa1de[_0xb605('0x2c')],qs[_0xb605('0x30')](_0xf4bf6b[_0xb605('0x2d')]['fields']));_0x5813b3[_0xb605('0x2f')]=_0x5813b3['attributes'][_0xb605('0x44')]?_0x5813b3['attributes']:_0x5aa1de[_0xb605('0x2c')];if(_0xf4bf6b[_0xb605('0x2d')][_0xb605('0x3e')]){_0x5813b3[_0xb605('0x45')]=[{'all':!![]}];}_0x5813b3=_['merge']({},_0x5813b3,_0xf4bf6b[_0xb605('0x3c')]);return db[_0xb605('0x3d')][_0xb605('0x46')](_0x5813b3)[_0xb605('0x25')](handleEntityNotFound(_0x3309f7,null))['then'](respondWithResult(_0x3309f7,null))[_0xb605('0x41')](handleError(_0x3309f7,null));};exports[_0xb605('0x47')]=function(_0x2aa40d,_0xb8c4d8){return db[_0xb605('0x3d')][_0xb605('0x47')](_0x2aa40d[_0xb605('0x48')],{})[_0xb605('0x25')](respondWithResult(_0xb8c4d8,0xc9))[_0xb605('0x41')](handleError(_0xb8c4d8,null));};exports['update']=function(_0x4b78ea,_0x2f8f28){if(_0x4b78ea['body']['id']){delete _0x4b78ea[_0xb605('0x48')]['id'];}return db[_0xb605('0x3d')][_0xb605('0x46')]({'where':{'id':_0x4b78ea['params']['id']}})[_0xb605('0x25')](handleEntityNotFound(_0x2f8f28,null))[_0xb605('0x25')](saveUpdates(_0x4b78ea[_0xb605('0x48')],null))['then'](respondWithResult(_0x2f8f28,null))[_0xb605('0x41')](handleError(_0x2f8f28,null));};exports[_0xb605('0x49')]=function(_0x4b40e7,_0x4b817e){return db[_0xb605('0x3d')][_0xb605('0x46')]({'where':{'id':_0x4b40e7['params']['id']}})[_0xb605('0x25')](handleEntityNotFound(_0x4b817e,null))[_0xb605('0x25')](removeEntity(_0x4b817e,null))[_0xb605('0x41')](handleError(_0x4b817e,null));}; \ No newline at end of file +var _0x2761=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','undefined','limit','count','offset','json','apply','reject','save','then','destroy','end','error','stack','name','send','map','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SquareMessage','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x161bba,_0x104e86){var _0x50e735=function(_0x2590f5){while(--_0x2590f5){_0x161bba['push'](_0x161bba['shift']());}};_0x50e735(++_0x104e86);}(_0x2761,0x1c1));var _0x1276=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2761[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x1276('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1276('0x1'));var jsonpatch=require(_0x1276('0x2'));var rp=require(_0x1276('0x3'));var moment=require(_0x1276('0x4'));var BPromise=require(_0x1276('0x5'));var Mustache=require(_0x1276('0x6'));var util=require(_0x1276('0x7'));var path=require(_0x1276('0x8'));var sox=require('sox');var csv=require(_0x1276('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1276('0xa'));var _=require(_0x1276('0xb'));var squel=require(_0x1276('0xc'));var crypto=require(_0x1276('0xd'));var jsforce=require(_0x1276('0xe'));var deskjs=require(_0x1276('0xf'));var toCsv=require(_0x1276('0x9'));var querystring=require(_0x1276('0x10'));var Papa=require('papaparse');var Redis=require(_0x1276('0x11'));var authService=require(_0x1276('0x12'));var qs=require(_0x1276('0x13'));var as=require(_0x1276('0x14'));var hardwareService=require(_0x1276('0x15'));var logger=require(_0x1276('0x16'))(_0x1276('0x17'));var utils=require(_0x1276('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1276('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd792a5,_0x42e03e){_0x42e03e=_0x42e03e||0xcc;return function(_0xbbca35){if(_0xbbca35){return _0xd792a5[_0x1276('0x1a')](_0x42e03e);}return _0xd792a5['status'](_0x42e03e)['end']();};}function respondWithResult(_0x15f7cc,_0x311159){_0x311159=_0x311159||0xc8;return function(_0x12042b){if(_0x12042b){return _0x15f7cc[_0x1276('0x1b')](_0x311159)['json'](_0x12042b);}};}function respondWithFilteredResult(_0x2f3db0,_0x223618){return function(_0x439e5c){if(_0x439e5c){var _0x1bc720=typeof _0x223618['offset']===_0x1276('0x1c')&&typeof _0x223618[_0x1276('0x1d')]==='undefined';var _0x3122a9=_0x439e5c[_0x1276('0x1e')];var _0x6d2374=_0x1bc720?0x0:_0x223618[_0x1276('0x1f')];var _0x1ff52a=_0x1bc720?_0x439e5c[_0x1276('0x1e')]:_0x223618[_0x1276('0x1f')]+_0x223618['limit'];var _0x3e2486;if(_0x1ff52a>=_0x3122a9){_0x1ff52a=_0x3122a9;_0x3e2486=0xc8;}else{_0x3e2486=0xce;}_0x2f3db0[_0x1276('0x1b')](_0x3e2486);return _0x2f3db0['set']('Content-Range',_0x6d2374+'-'+_0x1ff52a+'/'+_0x3122a9)[_0x1276('0x20')](_0x439e5c);}return null;};}function patchUpdates(_0x2cfc9f){return function(_0x2843a9){try{jsonpatch[_0x1276('0x21')](_0x2843a9,_0x2cfc9f,!![]);}catch(_0x10b4eb){return BPromise[_0x1276('0x22')](_0x10b4eb);}return _0x2843a9[_0x1276('0x23')]();};}function saveUpdates(_0x160cf8,_0x395fb4){return function(_0x457383){if(_0x457383){return _0x457383['update'](_0x160cf8)[_0x1276('0x24')](function(_0x46b545){return _0x46b545;});}return null;};}function removeEntity(_0x344e79,_0x262961){return function(_0x13e7e0){if(_0x13e7e0){return _0x13e7e0[_0x1276('0x25')]()[_0x1276('0x24')](function(){_0x344e79[_0x1276('0x1b')](0xcc)[_0x1276('0x26')]();});}};}function handleEntityNotFound(_0x5bde32,_0xf84cff){return function(_0x5a7a25){if(!_0x5a7a25){_0x5bde32[_0x1276('0x1a')](0x194);}return _0x5a7a25;};}function handleError(_0x4d06fb,_0x336fd2){_0x336fd2=_0x336fd2||0x1f4;return function(_0x434aee){logger[_0x1276('0x27')](_0x434aee[_0x1276('0x28')]);if(_0x434aee[_0x1276('0x29')]){delete _0x434aee['name'];}_0x4d06fb[_0x1276('0x1b')](_0x336fd2)[_0x1276('0x2a')](_0x434aee);};}exports['index']=function(_0x17b418,_0x454e19){var _0x5a6349={},_0x27f948={},_0x419e51={'count':0x0,'rows':[]};var _0x567bd3=_[_0x1276('0x2b')](db['SquareMessage']['rawAttributes'],function(_0x5992de){return{'name':_0x5992de['fieldName'],'type':_0x5992de[_0x1276('0x2c')][_0x1276('0x2d')]};});_0x27f948[_0x1276('0x2e')]=_['map'](_0x567bd3,'name');_0x27f948[_0x1276('0x2f')]=_[_0x1276('0x30')](_0x17b418[_0x1276('0x2f')]);_0x27f948['filters']=_[_0x1276('0x31')](_0x27f948[_0x1276('0x2e')],_0x27f948['query']);_0x5a6349['attributes']=_[_0x1276('0x31')](_0x27f948[_0x1276('0x2e')],qs['fields'](_0x17b418[_0x1276('0x2f')][_0x1276('0x32')]));_0x5a6349[_0x1276('0x33')]=_0x5a6349[_0x1276('0x33')][_0x1276('0x34')]?_0x5a6349[_0x1276('0x33')]:_0x27f948[_0x1276('0x2e')];if(!_0x17b418[_0x1276('0x2f')][_0x1276('0x35')](_0x1276('0x36'))){_0x5a6349[_0x1276('0x1d')]=qs['limit'](_0x17b418[_0x1276('0x2f')][_0x1276('0x1d')]);_0x5a6349[_0x1276('0x1f')]=qs[_0x1276('0x1f')](_0x17b418[_0x1276('0x2f')][_0x1276('0x1f')]);}_0x5a6349[_0x1276('0x37')]=qs[_0x1276('0x38')](_0x17b418[_0x1276('0x2f')][_0x1276('0x38')]);_0x5a6349[_0x1276('0x39')]=qs[_0x1276('0x3a')](_[_0x1276('0x3b')](_0x17b418['query'],_0x27f948['filters']),_0x567bd3);if(_0x17b418[_0x1276('0x2f')][_0x1276('0x3c')]){_0x5a6349[_0x1276('0x39')]=_[_0x1276('0x3d')](_0x5a6349['where'],{'$or':_[_0x1276('0x2b')](_0x567bd3,function(_0x468d20){if(_0x468d20[_0x1276('0x2c')]!==_0x1276('0x3e')){var _0x352819={};_0x352819[_0x468d20[_0x1276('0x29')]]={'$like':'%'+_0x17b418['query'][_0x1276('0x3c')]+'%'};return _0x352819;}})});}_0x5a6349=_['merge']({},_0x5a6349,_0x17b418['options']);var _0x1a2a96={'where':_0x5a6349[_0x1276('0x39')]};return db[_0x1276('0x3f')][_0x1276('0x1e')](_0x1a2a96)[_0x1276('0x24')](function(_0x4f0f23){_0x419e51[_0x1276('0x1e')]=_0x4f0f23;if(_0x17b418[_0x1276('0x2f')][_0x1276('0x40')]){_0x5a6349[_0x1276('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x5a6349);})[_0x1276('0x24')](function(_0x58e8fd){_0x419e51[_0x1276('0x42')]=_0x58e8fd;return _0x419e51;})[_0x1276('0x24')](respondWithFilteredResult(_0x454e19,_0x5a6349))[_0x1276('0x43')](handleError(_0x454e19,null));};exports[_0x1276('0x44')]=function(_0x4b2329,_0x3e7f54){var _0x5dedc3={'raw':!![],'where':{'id':_0x4b2329[_0x1276('0x45')]['id']}},_0x369716={};_0x369716[_0x1276('0x2e')]=_['keys'](db[_0x1276('0x3f')][_0x1276('0x46')]);_0x369716[_0x1276('0x2f')]=_[_0x1276('0x30')](_0x4b2329[_0x1276('0x2f')]);_0x369716[_0x1276('0x3a')]=_['intersection'](_0x369716[_0x1276('0x2e')],_0x369716[_0x1276('0x2f')]);_0x5dedc3[_0x1276('0x33')]=_[_0x1276('0x31')](_0x369716['model'],qs[_0x1276('0x32')](_0x4b2329['query'][_0x1276('0x32')]));_0x5dedc3[_0x1276('0x33')]=_0x5dedc3[_0x1276('0x33')][_0x1276('0x34')]?_0x5dedc3['attributes']:_0x369716[_0x1276('0x2e')];if(_0x4b2329[_0x1276('0x2f')][_0x1276('0x40')]){_0x5dedc3['include']=[{'all':!![]}];}_0x5dedc3=_[_0x1276('0x3d')]({},_0x5dedc3,_0x4b2329[_0x1276('0x47')]);return db[_0x1276('0x3f')]['find'](_0x5dedc3)[_0x1276('0x24')](handleEntityNotFound(_0x3e7f54,null))[_0x1276('0x24')](respondWithResult(_0x3e7f54,null))[_0x1276('0x43')](handleError(_0x3e7f54,null));};exports[_0x1276('0x48')]=function(_0x9c302,_0x2e0dda){return db['SquareMessage']['create'](_0x9c302[_0x1276('0x49')],{})[_0x1276('0x24')](respondWithResult(_0x2e0dda,0xc9))[_0x1276('0x43')](handleError(_0x2e0dda,null));};exports[_0x1276('0x4a')]=function(_0x52489d,_0x3fff59){if(_0x52489d['body']['id']){delete _0x52489d[_0x1276('0x49')]['id'];}return db[_0x1276('0x3f')]['find']({'where':{'id':_0x52489d['params']['id']}})['then'](handleEntityNotFound(_0x3fff59,null))[_0x1276('0x24')](saveUpdates(_0x52489d['body'],null))[_0x1276('0x24')](respondWithResult(_0x3fff59,null))[_0x1276('0x43')](handleError(_0x3fff59,null));};exports['destroy']=function(_0x3a7659,_0x2141ca){return db[_0x1276('0x3f')][_0x1276('0x4b')]({'where':{'id':_0x3a7659['params']['id']}})[_0x1276('0x24')](handleEntityNotFound(_0x2141ca,null))['then'](removeEntity(_0x2141ca,null))['catch'](handleError(_0x2141ca,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4600ce7..b5fe96b 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 _0xb7e1=['path','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','api','bluebird'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xb7e1,0x95));var _0x1b7e=function(_0x582bd5,_0x1c99ac){_0x582bd5=_0x582bd5-0x0;var _0x14ce83=_0xb7e1[_0x582bd5];return _0x14ce83;};'use strict';var _=require(_0x1b7e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1b7e('0x1'));var moment=require('moment');var BPromise=require(_0x1b7e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b7e('0x3'));var rimraf=require('rimraf');var config=require(_0x1b7e('0x4'));var attributes=require(_0x1b7e('0x5'));module['exports']=function(_0x44c862,_0x274136){return _0x44c862[_0x1b7e('0x6')](_0x1b7e('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a5d=['bluebird','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x5a5d,0xa4));var _0xd5a5=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x5a5d[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xd5a5('0x0'));var util=require(_0xd5a5('0x1'));var logger=require(_0xd5a5('0x2'))(_0xd5a5('0x3'));var moment=require(_0xd5a5('0x4'));var BPromise=require(_0xd5a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5a5('0x6'));var rimraf=require('rimraf');var config=require(_0xd5a5('0x7'));var attributes=require(_0xd5a5('0x8'));module[_0xd5a5('0x9')]=function(_0x5aeef5,_0x269d2f){return _0x5aeef5[_0xd5a5('0xa')](_0xd5a5('0xb'),attributes,{'tableName':_0xd5a5('0xc'),'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 bb60fa1..d8e6e85 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 _0xe555=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage'];(function(_0xfa271d,_0x5508a4){var _0x3b1ae3=function(_0x5ea66b){while(--_0x5ea66b){_0xfa271d['push'](_0xfa271d['shift']());}};_0x3b1ae3(++_0x5508a4);}(_0xe555,0x1b2));var _0x5e55=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xe555[_0x233cb1];return _0x29ee7e;};'use strict';var _=require(_0x5e55('0x0'));var util=require(_0x5e55('0x1'));var moment=require(_0x5e55('0x2'));var BPromise=require(_0x5e55('0x3'));var rs=require(_0x5e55('0x4'));var fs=require('fs');var Redis=require(_0x5e55('0x5'));var db=require(_0x5e55('0x6'))['db'];var utils=require(_0x5e55('0x7'));var logger=require(_0x5e55('0x8'))(_0x5e55('0x9'));var config=require(_0x5e55('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5e55('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacd8b,_0x35c312,_0x1e38e4){return new BPromise(function(_0x6b52d1,_0x25f689){return client[_0x5e55('0xc')](_0xacd8b,_0x1e38e4)[_0x5e55('0xd')](function(_0x4e518f){logger['info'](_0x5e55('0xe'),_0x35c312,_0x5e55('0xf'));logger[_0x5e55('0x10')](_0x5e55('0x11'),_0x35c312,_0x5e55('0xf'),JSON[_0x5e55('0x12')](_0x4e518f));if(_0x4e518f[_0x5e55('0x13')]){if(_0x4e518f[_0x5e55('0x13')][_0x5e55('0x14')]===0x1f4){logger['error'](_0x5e55('0xe'),_0x35c312,_0x4e518f[_0x5e55('0x13')][_0x5e55('0x15')]);return _0x25f689(_0x4e518f[_0x5e55('0x13')][_0x5e55('0x15')]);}logger[_0x5e55('0x13')](_0x5e55('0xe'),_0x35c312,_0x4e518f[_0x5e55('0x13')]['message']);return _0x6b52d1(_0x4e518f[_0x5e55('0x13')][_0x5e55('0x15')]);}else{logger[_0x5e55('0x16')](_0x5e55('0xe'),_0x35c312,_0x5e55('0xf'));_0x6b52d1(_0x4e518f[_0x5e55('0x17')]['message']);}})[_0x5e55('0x18')](function(_0x40c365){logger['error'](_0x5e55('0xe'),_0x35c312,_0x40c365);_0x25f689(_0x40c365);});});}exports['CreateSquareMessage']=function(_0x107308){var _0x2dbc01=this;return new Promise(function(_0x3367fc,_0x34b1c7){return db[_0x5e55('0x19')][_0x5e55('0x1a')](_0x107308[_0x5e55('0x1b')],{'raw':_0x107308['options']?_0x107308[_0x5e55('0x1c')][_0x5e55('0x1d')]===undefined?!![]:![]:!![]})[_0x5e55('0xd')](function(_0x55ce41){logger[_0x5e55('0x16')](_0x5e55('0x1e'),_0x107308);logger[_0x5e55('0x10')]('CreateSquareMessage',_0x107308,JSON[_0x5e55('0x12')](_0x55ce41));_0x3367fc(_0x55ce41);})['catch'](function(_0x51e96e){logger[_0x5e55('0x13')](_0x5e55('0x1e'),_0x51e96e[_0x5e55('0x15')],_0x107308);_0x34b1c7(_0x2dbc01[_0x5e55('0x13')](0x1f4,_0x51e96e[_0x5e55('0x15')]));});});}; \ No newline at end of file +var _0x489b=['options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body'];(function(_0x2c4e67,_0x1215ca){var _0x1bea56=function(_0x147262){while(--_0x147262){_0x2c4e67['push'](_0x2c4e67['shift']());}};_0x1bea56(++_0x1215ca);}(_0x489b,0x1a6));var _0xb489=function(_0x170561,_0x361f2b){_0x170561=_0x170561-0x0;var _0x2af4cf=_0x489b[_0x170561];return _0x2af4cf;};'use strict';var _=require(_0xb489('0x0'));var util=require(_0xb489('0x1'));var moment=require(_0xb489('0x2'));var BPromise=require('bluebird');var rs=require(_0xb489('0x3'));var fs=require('fs');var Redis=require(_0xb489('0x4'));var db=require(_0xb489('0x5'))['db'];var utils=require(_0xb489('0x6'));var logger=require(_0xb489('0x7'))(_0xb489('0x8'));var config=require('../../config/environment');var jayson=require(_0xb489('0x9'));var client=jayson[_0xb489('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5883d9,_0x22483f,_0x4b1752){return new BPromise(function(_0x3852b0,_0x1e75b8){return client[_0xb489('0xb')](_0x5883d9,_0x4b1752)['then'](function(_0x489dc0){logger['info'](_0xb489('0xc'),_0x22483f,'request\x20sent');logger[_0xb489('0xd')](_0xb489('0xe'),_0x22483f,'request\x20sent',JSON[_0xb489('0xf')](_0x489dc0));if(_0x489dc0[_0xb489('0x10')]){if(_0x489dc0[_0xb489('0x10')][_0xb489('0x11')]===0x1f4){logger[_0xb489('0x10')](_0xb489('0xc'),_0x22483f,_0x489dc0[_0xb489('0x10')][_0xb489('0x12')]);return _0x1e75b8(_0x489dc0[_0xb489('0x10')][_0xb489('0x12')]);}logger['error'](_0xb489('0xc'),_0x22483f,_0x489dc0[_0xb489('0x10')][_0xb489('0x12')]);return _0x3852b0(_0x489dc0[_0xb489('0x10')][_0xb489('0x12')]);}else{logger[_0xb489('0x13')](_0xb489('0xc'),_0x22483f,'request\x20sent');_0x3852b0(_0x489dc0[_0xb489('0x14')][_0xb489('0x12')]);}})[_0xb489('0x15')](function(_0x4a3237){logger[_0xb489('0x10')](_0xb489('0xc'),_0x22483f,_0x4a3237);_0x1e75b8(_0x4a3237);});});}exports[_0xb489('0x16')]=function(_0x29946d){var _0x107aea=this;return new Promise(function(_0x19539d,_0x529962){return db[_0xb489('0x17')][_0xb489('0x18')](_0x29946d[_0xb489('0x19')],{'raw':_0x29946d[_0xb489('0x1a')]?_0x29946d['options'][_0xb489('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x328b8a){logger['info'](_0xb489('0x16'),_0x29946d);logger[_0xb489('0xd')](_0xb489('0x16'),_0x29946d,JSON['stringify'](_0x328b8a));_0x19539d(_0x328b8a);})[_0xb489('0x15')](function(_0x34db69){logger['error'](_0xb489('0x16'),_0x34db69[_0xb489('0x12')],_0x29946d);_0x529962(_0x107aea[_0xb489('0x10')](0x1f4,_0x34db69['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 101aeee..f919b87 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 _0x374c=['fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x374c,0x9b));var _0xc374=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x374c[_0x3305de];return _0x3b5a84;};'use strict';var multer=require(_0xc374('0x0'));var util=require(_0xc374('0x1'));var path=require(_0xc374('0x2'));var timeout=require(_0xc374('0x3'));var express=require(_0xc374('0x4'));var router=express[_0xc374('0x5')]();var fs_extra=require(_0xc374('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc374('0x7'));var config=require(_0xc374('0x8'));var controller=require(_0xc374('0x9'));router[_0xc374('0xa')]('/',auth[_0xc374('0xb')](),controller[_0xc374('0xc')]);router['get'](_0xc374('0xd'),auth[_0xc374('0xb')](),controller[_0xc374('0xe')]);router[_0xc374('0xa')](_0xc374('0xf'),auth['isAuthenticated'](),timeout(_0xc374('0x10')),controller[_0xc374('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc374('0x12')]);router[_0xc374('0x13')](_0xc374('0xd'),auth['isAuthenticated'](),controller[_0xc374('0x14')]);router[_0xc374('0x15')](_0xc374('0xd'),auth[_0xc374('0xb')](),controller['destroy']);module[_0xc374('0x16')]=router; \ No newline at end of file +var _0x616c=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create'];(function(_0x5a921f,_0x308479){var _0x16784f=function(_0xb161d){while(--_0xb161d){_0x5a921f['push'](_0x5a921f['shift']());}};_0x16784f(++_0x308479);}(_0x616c,0xbc));var _0xc616=function(_0x71768d,_0x15c50f){_0x71768d=_0x71768d-0x0;var _0x3540b5=_0x616c[_0x71768d];return _0x3540b5;};'use strict';var multer=require(_0xc616('0x0'));var util=require(_0xc616('0x1'));var path=require(_0xc616('0x2'));var timeout=require(_0xc616('0x3'));var express=require(_0xc616('0x4'));var router=express[_0xc616('0x5')]();var fs_extra=require(_0xc616('0x6'));var auth=require(_0xc616('0x7'));var interaction=require(_0xc616('0x8'));var config=require('../../config/environment');var controller=require(_0xc616('0x9'));router[_0xc616('0xa')]('/',auth[_0xc616('0xb')](),controller[_0xc616('0xc')]);router[_0xc616('0xa')](_0xc616('0xd'),auth[_0xc616('0xb')](),controller[_0xc616('0xe')]);router[_0xc616('0xa')]('/:id/test',auth[_0xc616('0xb')](),timeout(_0xc616('0xf')),controller[_0xc616('0x10')]);router[_0xc616('0x11')]('/',auth[_0xc616('0xb')](),controller[_0xc616('0x12')]);router[_0xc616('0x13')](_0xc616('0xd'),auth[_0xc616('0xb')](),controller[_0xc616('0x14')]);router[_0xc616('0x15')](_0xc616('0xd'),auth[_0xc616('0xb')](),controller['destroy']);module[_0xc616('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 08bceb0..cda2573 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 _0xdb76=['name','sequelize','STRING'];(function(_0x27ae0e,_0x38d538){var _0xd4a521=function(_0x39dbc2){while(--_0x39dbc2){_0x27ae0e['push'](_0x27ae0e['shift']());}};_0xd4a521(++_0x38d538);}(_0xdb76,0x178));var _0x6db7=function(_0x46f4ee,_0x16dcc2){_0x46f4ee=_0x46f4ee-0x0;var _0x173d49=_0xdb76[_0x46f4ee];return _0x173d49;};'use strict';var Sequelize=require(_0x6db7('0x0'));module['exports']={'name':{'type':Sequelize[_0x6db7('0x1')],'unique':_0x6db7('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6db7('0x1')]}}; \ No newline at end of file +var _0x63fc=['exports','STRING','sequelize'];(function(_0x1071d6,_0x293323){var _0x4c6be4=function(_0x43a973){while(--_0x43a973){_0x1071d6['push'](_0x1071d6['shift']());}};_0x4c6be4(++_0x293323);}(_0x63fc,0x10a));var _0xc63f=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x63fc[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0xc63f('0x0'));module[_0xc63f('0x1')]={'name':{'type':Sequelize[_0xc63f('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc63f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 7e8d121..90accfa 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 _0xaa9d=['status','json','undefined','limit','count','offset','Content-Range','reject','save','get','ODBC','UserProfileResource','destroy','then','name','send','index','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0xaa9d,0x1a1));var _0xdaa9=function(_0x21f5c6,_0x425f25){_0x21f5c6=_0x21f5c6-0x0;var _0xa07a64=_0xaa9d[_0x21f5c6];return _0xa07a64;};'use strict';var emlformat=require(_0xdaa9('0x0'));var rimraf=require(_0xdaa9('0x1'));var zipdir=require(_0xdaa9('0x2'));var jsonpatch=require(_0xdaa9('0x3'));var rp=require(_0xdaa9('0x4'));var moment=require(_0xdaa9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdaa9('0x6'));var util=require(_0xdaa9('0x7'));var path=require(_0xdaa9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdaa9('0x9'));var fs=require('fs');var fs_extra=require(_0xdaa9('0xa'));var _=require(_0xdaa9('0xb'));var squel=require(_0xdaa9('0xc'));var crypto=require(_0xdaa9('0xd'));var jsforce=require(_0xdaa9('0xe'));var deskjs=require(_0xdaa9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdaa9('0x10'));var Papa=require(_0xdaa9('0x11'));var Redis=require('ioredis');var authService=require(_0xdaa9('0x12'));var qs=require(_0xdaa9('0x13'));var as=require(_0xdaa9('0x14'));var hardwareService=require(_0xdaa9('0x15'));var logger=require(_0xdaa9('0x16'))(_0xdaa9('0x17'));var utils=require(_0xdaa9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdaa9('0x19'));var db=require(_0xdaa9('0x1a'))['db'];function respondWithStatusCode(_0xdd89cc,_0x2d9ec9){_0x2d9ec9=_0x2d9ec9||0xcc;return function(_0x547e0c){if(_0x547e0c){return _0xdd89cc[_0xdaa9('0x1b')](_0x2d9ec9);}return _0xdd89cc[_0xdaa9('0x1c')](_0x2d9ec9)['end']();};}function respondWithResult(_0x2fa0b5,_0x455e58){_0x455e58=_0x455e58||0xc8;return function(_0x1bcb7d){if(_0x1bcb7d){return _0x2fa0b5[_0xdaa9('0x1c')](_0x455e58)[_0xdaa9('0x1d')](_0x1bcb7d);}};}function respondWithFilteredResult(_0x25060e,_0x57b9c9){return function(_0x6dfe59){if(_0x6dfe59){var _0x327dad=typeof _0x57b9c9['offset']===_0xdaa9('0x1e')&&typeof _0x57b9c9[_0xdaa9('0x1f')]==='undefined';var _0x5a4668=_0x6dfe59[_0xdaa9('0x20')];var _0x37c4a9=_0x327dad?0x0:_0x57b9c9['offset'];var _0x42fb20=_0x327dad?_0x6dfe59[_0xdaa9('0x20')]:_0x57b9c9[_0xdaa9('0x21')]+_0x57b9c9[_0xdaa9('0x1f')];var _0x205ff8;if(_0x42fb20>=_0x5a4668){_0x42fb20=_0x5a4668;_0x205ff8=0xc8;}else{_0x205ff8=0xce;}_0x25060e['status'](_0x205ff8);return _0x25060e['set'](_0xdaa9('0x22'),_0x37c4a9+'-'+_0x42fb20+'/'+_0x5a4668)[_0xdaa9('0x1d')](_0x6dfe59);}return null;};}function patchUpdates(_0x5c8213){return function(_0x27f08c){try{jsonpatch['apply'](_0x27f08c,_0x5c8213,!![]);}catch(_0x21b3fb){return BPromise[_0xdaa9('0x23')](_0x21b3fb);}return _0x27f08c[_0xdaa9('0x24')]();};}function saveUpdates(_0x26c4c9,_0x1402ab){return function(_0x2300ca){if(_0x2300ca){return _0x2300ca['update'](_0x26c4c9)['then'](function(_0x360fab){return _0x360fab;});}return null;};}function removeEntity(_0x6c71c3,_0x3dcf02){return function(_0xa9b3ac){if(_0xa9b3ac){return _0xa9b3ac['destroy']()['then'](function(){var _0x23606b=_0xa9b3ac[_0xdaa9('0x25')]({'plain':!![]});var _0x29b281=_0xdaa9('0x26');return db[_0xdaa9('0x27')][_0xdaa9('0x28')]({'where':{'type':_0x29b281,'resourceId':_0x23606b['id']}})[_0xdaa9('0x29')](function(){return _0xa9b3ac;});})[_0xdaa9('0x29')](function(){_0x6c71c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x522bb9,_0x3b852b){return function(_0x13869e){if(!_0x13869e){_0x522bb9[_0xdaa9('0x1b')](0x194);}return _0x13869e;};}function handleError(_0x16d3c2,_0x135763){_0x135763=_0x135763||0x1f4;return function(_0x16c134){logger['error'](_0x16c134['stack']);if(_0x16c134[_0xdaa9('0x2a')]){delete _0x16c134['name'];}_0x16d3c2[_0xdaa9('0x1c')](_0x135763)[_0xdaa9('0x2b')](_0x16c134);};}exports[_0xdaa9('0x2c')]=function(_0x6058c4,_0x29753b){var _0x4e5bac={},_0x3ea3e4={},_0x313681={'count':0x0,'rows':[]};var _0x2533ef=_[_0xdaa9('0x2d')](db[_0xdaa9('0x2e')]['rawAttributes'],function(_0xe02092){return{'name':_0xe02092[_0xdaa9('0x2f')],'type':_0xe02092[_0xdaa9('0x30')][_0xdaa9('0x31')]};});_0x3ea3e4[_0xdaa9('0x32')]=_['map'](_0x2533ef,_0xdaa9('0x2a'));_0x3ea3e4[_0xdaa9('0x33')]=_[_0xdaa9('0x34')](_0x6058c4[_0xdaa9('0x33')]);_0x3ea3e4[_0xdaa9('0x35')]=_['intersection'](_0x3ea3e4[_0xdaa9('0x32')],_0x3ea3e4[_0xdaa9('0x33')]);_0x4e5bac[_0xdaa9('0x36')]=_['intersection'](_0x3ea3e4[_0xdaa9('0x32')],qs[_0xdaa9('0x37')](_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x37')]));_0x4e5bac[_0xdaa9('0x36')]=_0x4e5bac[_0xdaa9('0x36')][_0xdaa9('0x38')]?_0x4e5bac[_0xdaa9('0x36')]:_0x3ea3e4[_0xdaa9('0x32')];if(!_0x6058c4['query'][_0xdaa9('0x39')](_0xdaa9('0x3a'))){_0x4e5bac[_0xdaa9('0x1f')]=qs['limit'](_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x1f')]);_0x4e5bac[_0xdaa9('0x21')]=qs[_0xdaa9('0x21')](_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x21')]);}_0x4e5bac['order']=qs['sort'](_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x3b')]);_0x4e5bac['where']=qs[_0xdaa9('0x35')](_[_0xdaa9('0x3c')](_0x6058c4[_0xdaa9('0x33')],_0x3ea3e4['filters']),_0x2533ef);if(_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x3d')]){_0x4e5bac[_0xdaa9('0x3e')]=_[_0xdaa9('0x3f')](_0x4e5bac[_0xdaa9('0x3e')],{'$or':_['map'](_0x2533ef,function(_0x2a977c){if(_0x2a977c[_0xdaa9('0x30')]!=='VIRTUAL'){var _0x3b752d={};_0x3b752d[_0x2a977c[_0xdaa9('0x2a')]]={'$like':'%'+_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x3d')]+'%'};return _0x3b752d;}})});}_0x4e5bac=_[_0xdaa9('0x3f')]({},_0x4e5bac,_0x6058c4['options']);var _0x2e1340={'where':_0x4e5bac['where']};return db[_0xdaa9('0x2e')][_0xdaa9('0x20')](_0x2e1340)[_0xdaa9('0x29')](function(_0x115d19){_0x313681['count']=_0x115d19;if(_0x6058c4[_0xdaa9('0x33')][_0xdaa9('0x40')]){_0x4e5bac['include']=[{'all':!![]}];}return db[_0xdaa9('0x2e')][_0xdaa9('0x41')](_0x4e5bac);})['then'](function(_0x578fb3){_0x313681[_0xdaa9('0x42')]=_0x578fb3;return _0x313681;})[_0xdaa9('0x29')](respondWithFilteredResult(_0x29753b,_0x4e5bac))[_0xdaa9('0x43')](handleError(_0x29753b,null));};exports[_0xdaa9('0x44')]=function(_0x134a27,_0x2907aa){var _0x51799a={'raw':!![],'where':{'id':_0x134a27[_0xdaa9('0x45')]['id']}},_0x491a04={};_0x491a04['model']=_[_0xdaa9('0x34')](db['SquareOdbc'][_0xdaa9('0x46')]);_0x491a04[_0xdaa9('0x33')]=_['keys'](_0x134a27[_0xdaa9('0x33')]);_0x491a04['filters']=_['intersection'](_0x491a04[_0xdaa9('0x32')],_0x491a04['query']);_0x51799a[_0xdaa9('0x36')]=_[_0xdaa9('0x47')](_0x491a04['model'],qs[_0xdaa9('0x37')](_0x134a27[_0xdaa9('0x33')][_0xdaa9('0x37')]));_0x51799a[_0xdaa9('0x36')]=_0x51799a[_0xdaa9('0x36')][_0xdaa9('0x38')]?_0x51799a[_0xdaa9('0x36')]:_0x491a04['model'];if(_0x134a27[_0xdaa9('0x33')]['includeAll']){_0x51799a['include']=[{'all':!![]}];}_0x51799a=_[_0xdaa9('0x3f')]({},_0x51799a,_0x134a27[_0xdaa9('0x48')]);return db[_0xdaa9('0x2e')][_0xdaa9('0x49')](_0x51799a)[_0xdaa9('0x29')](handleEntityNotFound(_0x2907aa,null))[_0xdaa9('0x29')](respondWithResult(_0x2907aa,null))[_0xdaa9('0x43')](handleError(_0x2907aa,null));};exports[_0xdaa9('0x4a')]=function(_0x45e611,_0x591960){return db['SquareOdbc']['create'](_0x45e611['body'],{})[_0xdaa9('0x29')](function(_0x2e1d47){var _0x3cd702=_0x45e611[_0xdaa9('0x4b')][_0xdaa9('0x25')]({'plain':!![]});if(!_0x3cd702)throw new Error(_0xdaa9('0x4c'));if(_0x3cd702[_0xdaa9('0x4d')]==='user'){var _0x4687db=_0x2e1d47[_0xdaa9('0x25')]({'plain':!![]});var _0x4a7324='ODBC';return db['UserProfileSection'][_0xdaa9('0x49')]({'where':{'name':_0x4a7324,'userProfileId':_0x3cd702[_0xdaa9('0x4e')]},'raw':!![]})[_0xdaa9('0x29')](function(_0x4b61ee){if(_0x4b61ee&&_0x4b61ee[_0xdaa9('0x4f')]===0x0){return db[_0xdaa9('0x27')][_0xdaa9('0x4a')]({'name':_0x4687db['name'],'resourceId':_0x4687db['id'],'type':_0x4b61ee[_0xdaa9('0x2a')],'sectionId':_0x4b61ee['id']},{})['then'](function(){return _0x2e1d47;});}else{return _0x2e1d47;}})[_0xdaa9('0x43')](function(_0x6421bf){logger[_0xdaa9('0x50')](_0xdaa9('0x51'),_0x6421bf);throw _0x6421bf;});}return _0x2e1d47;})[_0xdaa9('0x29')](respondWithResult(_0x591960,0xc9))['catch'](handleError(_0x591960,null));};exports[_0xdaa9('0x52')]=function(_0x5f472f,_0x1475cf){if(_0x5f472f['body']['id']){delete _0x5f472f[_0xdaa9('0x53')]['id'];}return db[_0xdaa9('0x2e')][_0xdaa9('0x49')]({'where':{'id':_0x5f472f[_0xdaa9('0x45')]['id']}})['then'](handleEntityNotFound(_0x1475cf,null))[_0xdaa9('0x29')](saveUpdates(_0x5f472f[_0xdaa9('0x53')],null))[_0xdaa9('0x29')](respondWithResult(_0x1475cf,null))[_0xdaa9('0x43')](handleError(_0x1475cf,null));};exports[_0xdaa9('0x28')]=function(_0x448787,_0x4a39c3){return db[_0xdaa9('0x2e')][_0xdaa9('0x49')]({'where':{'id':_0x448787['params']['id']}})[_0xdaa9('0x29')](handleEntityNotFound(_0x4a39c3,null))[_0xdaa9('0x29')](removeEntity(_0x4a39c3,null))[_0xdaa9('0x43')](handleError(_0x4a39c3,null));};exports[_0xdaa9('0x54')]=function(_0x1d4e47,_0x384f19,_0x4c8924){var _0x5e67ae;return db[_0xdaa9('0x2e')][_0xdaa9('0x49')]({'where':{'id':_0x1d4e47[_0xdaa9('0x45')]['id']},'attributes':['id',_0xdaa9('0x55')]})[_0xdaa9('0x29')](handleEntityNotFound(_0x384f19,null))[_0xdaa9('0x29')](function(_0x1ddf60){if(_0x1ddf60){var _0x1ec771=require(_0xdaa9('0x56'))();_0x1ec771[_0xdaa9('0x57')](_0x1ddf60[_0xdaa9('0x55')]);_0x1ec771[_0xdaa9('0x58')]();return _0x1ddf60;}})[_0xdaa9('0x29')](respondWithResult(_0x384f19,null))[_0xdaa9('0x43')](handleError(_0x384f19,null));}; \ No newline at end of file +var _0x0961=['query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','merge','SquareOdbc','findAll','show','params','length','includeAll','include','options','catch','create','body','user','get','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model'];(function(_0x1ec904,_0x524ad0){var _0x3f11c1=function(_0x2250a5){while(--_0x2250a5){_0x1ec904['push'](_0x1ec904['shift']());}};_0x3f11c1(++_0x524ad0);}(_0x0961,0x120));var _0x1096=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x0961[_0x2ec2bf];return _0x2c279c;};'use strict';var emlformat=require(_0x1096('0x0'));var rimraf=require(_0x1096('0x1'));var zipdir=require(_0x1096('0x2'));var jsonpatch=require(_0x1096('0x3'));var rp=require(_0x1096('0x4'));var moment=require(_0x1096('0x5'));var BPromise=require(_0x1096('0x6'));var Mustache=require(_0x1096('0x7'));var util=require(_0x1096('0x8'));var path=require(_0x1096('0x9'));var sox=require('sox');var csv=require(_0x1096('0xa'));var ejs=require(_0x1096('0xb'));var fs=require('fs');var fs_extra=require(_0x1096('0xc'));var _=require(_0x1096('0xd'));var squel=require('squel');var crypto=require(_0x1096('0xe'));var jsforce=require(_0x1096('0xf'));var deskjs=require(_0x1096('0x10'));var toCsv=require(_0x1096('0xa'));var querystring=require('querystring');var Papa=require(_0x1096('0x11'));var Redis=require('ioredis');var authService=require(_0x1096('0x12'));var qs=require(_0x1096('0x13'));var as=require(_0x1096('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1096('0x15'))(_0x1096('0x16'));var utils=require('../../config/utils');var config=require(_0x1096('0x17'));var licenseUtil=require(_0x1096('0x18'));var db=require(_0x1096('0x19'))['db'];function respondWithStatusCode(_0x3a05e6,_0x37b308){_0x37b308=_0x37b308||0xcc;return function(_0x2763c9){if(_0x2763c9){return _0x3a05e6[_0x1096('0x1a')](_0x37b308);}return _0x3a05e6[_0x1096('0x1b')](_0x37b308)[_0x1096('0x1c')]();};}function respondWithResult(_0x2c9732,_0x87636c){_0x87636c=_0x87636c||0xc8;return function(_0x18b56f){if(_0x18b56f){return _0x2c9732[_0x1096('0x1b')](_0x87636c)[_0x1096('0x1d')](_0x18b56f);}};}function respondWithFilteredResult(_0x5df854,_0x2315a1){return function(_0x1fd03a){if(_0x1fd03a){var _0x4f6d77=typeof _0x2315a1[_0x1096('0x1e')]===_0x1096('0x1f')&&typeof _0x2315a1[_0x1096('0x20')]==='undefined';var _0x18c8b0=_0x1fd03a[_0x1096('0x21')];var _0x3c94d0=_0x4f6d77?0x0:_0x2315a1[_0x1096('0x1e')];var _0x1032ad=_0x4f6d77?_0x1fd03a[_0x1096('0x21')]:_0x2315a1[_0x1096('0x1e')]+_0x2315a1[_0x1096('0x20')];var _0x282f9d;if(_0x1032ad>=_0x18c8b0){_0x1032ad=_0x18c8b0;_0x282f9d=0xc8;}else{_0x282f9d=0xce;}_0x5df854['status'](_0x282f9d);return _0x5df854['set'](_0x1096('0x22'),_0x3c94d0+'-'+_0x1032ad+'/'+_0x18c8b0)['json'](_0x1fd03a);}return null;};}function patchUpdates(_0x1998a4){return function(_0x51ea9e){try{jsonpatch[_0x1096('0x23')](_0x51ea9e,_0x1998a4,!![]);}catch(_0x210eb2){return BPromise[_0x1096('0x24')](_0x210eb2);}return _0x51ea9e[_0x1096('0x25')]();};}function saveUpdates(_0x309ddb,_0x53eabd){return function(_0xb8c714){if(_0xb8c714){return _0xb8c714[_0x1096('0x26')](_0x309ddb)[_0x1096('0x27')](function(_0x336545){return _0x336545;});}return null;};}function removeEntity(_0x16442c,_0x12fc5b){return function(_0xd6be57){if(_0xd6be57){return _0xd6be57[_0x1096('0x28')]()[_0x1096('0x27')](function(){var _0x5252b8=_0xd6be57['get']({'plain':!![]});var _0x1aed9a=_0x1096('0x29');return db[_0x1096('0x2a')][_0x1096('0x28')]({'where':{'type':_0x1aed9a,'resourceId':_0x5252b8['id']}})[_0x1096('0x27')](function(){return _0xd6be57;});})['then'](function(){_0x16442c['status'](0xcc)[_0x1096('0x1c')]();});}};}function handleEntityNotFound(_0x2a5563,_0x3d4e0a){return function(_0x21477d){if(!_0x21477d){_0x2a5563[_0x1096('0x1a')](0x194);}return _0x21477d;};}function handleError(_0x34c347,_0x3be02c){_0x3be02c=_0x3be02c||0x1f4;return function(_0x2dc259){logger[_0x1096('0x2b')](_0x2dc259[_0x1096('0x2c')]);if(_0x2dc259[_0x1096('0x2d')]){delete _0x2dc259[_0x1096('0x2d')];}_0x34c347[_0x1096('0x1b')](_0x3be02c)[_0x1096('0x2e')](_0x2dc259);};}exports['index']=function(_0x34afea,_0x1dcbd8){var _0x40151e={},_0x318362={},_0x1227b8={'count':0x0,'rows':[]};var _0x416dab=_[_0x1096('0x2f')](db['SquareOdbc'][_0x1096('0x30')],function(_0x35a928){return{'name':_0x35a928['fieldName'],'type':_0x35a928[_0x1096('0x31')][_0x1096('0x32')]};});_0x318362[_0x1096('0x33')]=_[_0x1096('0x2f')](_0x416dab,_0x1096('0x2d'));_0x318362[_0x1096('0x34')]=_[_0x1096('0x35')](_0x34afea[_0x1096('0x34')]);_0x318362['filters']=_['intersection'](_0x318362[_0x1096('0x33')],_0x318362['query']);_0x40151e['attributes']=_[_0x1096('0x36')](_0x318362[_0x1096('0x33')],qs[_0x1096('0x37')](_0x34afea[_0x1096('0x34')]['fields']));_0x40151e[_0x1096('0x38')]=_0x40151e[_0x1096('0x38')]['length']?_0x40151e[_0x1096('0x38')]:_0x318362['model'];if(!_0x34afea[_0x1096('0x34')][_0x1096('0x39')](_0x1096('0x3a'))){_0x40151e[_0x1096('0x20')]=qs[_0x1096('0x20')](_0x34afea[_0x1096('0x34')][_0x1096('0x20')]);_0x40151e[_0x1096('0x1e')]=qs[_0x1096('0x1e')](_0x34afea[_0x1096('0x34')][_0x1096('0x1e')]);}_0x40151e[_0x1096('0x3b')]=qs['sort'](_0x34afea[_0x1096('0x34')]['sort']);_0x40151e[_0x1096('0x3c')]=qs[_0x1096('0x3d')](_[_0x1096('0x3e')](_0x34afea[_0x1096('0x34')],_0x318362[_0x1096('0x3d')]),_0x416dab);if(_0x34afea[_0x1096('0x34')]['filter']){_0x40151e[_0x1096('0x3c')]=_[_0x1096('0x3f')](_0x40151e[_0x1096('0x3c')],{'$or':_[_0x1096('0x2f')](_0x416dab,function(_0x19212a){if(_0x19212a[_0x1096('0x31')]!=='VIRTUAL'){var _0x27f7a8={};_0x27f7a8[_0x19212a['name']]={'$like':'%'+_0x34afea[_0x1096('0x34')]['filter']+'%'};return _0x27f7a8;}})});}_0x40151e=_[_0x1096('0x3f')]({},_0x40151e,_0x34afea['options']);var _0x327ecb={'where':_0x40151e[_0x1096('0x3c')]};return db[_0x1096('0x40')]['count'](_0x327ecb)[_0x1096('0x27')](function(_0xfdfeb5){_0x1227b8[_0x1096('0x21')]=_0xfdfeb5;if(_0x34afea['query']['includeAll']){_0x40151e['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x1096('0x41')](_0x40151e);})['then'](function(_0x3ef19b){_0x1227b8['rows']=_0x3ef19b;return _0x1227b8;})[_0x1096('0x27')](respondWithFilteredResult(_0x1dcbd8,_0x40151e))['catch'](handleError(_0x1dcbd8,null));};exports[_0x1096('0x42')]=function(_0x1558e2,_0x4b2624){var _0x44e82a={'raw':!![],'where':{'id':_0x1558e2[_0x1096('0x43')]['id']}},_0x552b41={};_0x552b41['model']=_[_0x1096('0x35')](db[_0x1096('0x40')][_0x1096('0x30')]);_0x552b41[_0x1096('0x34')]=_[_0x1096('0x35')](_0x1558e2['query']);_0x552b41['filters']=_['intersection'](_0x552b41[_0x1096('0x33')],_0x552b41[_0x1096('0x34')]);_0x44e82a[_0x1096('0x38')]=_[_0x1096('0x36')](_0x552b41[_0x1096('0x33')],qs[_0x1096('0x37')](_0x1558e2[_0x1096('0x34')]['fields']));_0x44e82a['attributes']=_0x44e82a['attributes'][_0x1096('0x44')]?_0x44e82a['attributes']:_0x552b41['model'];if(_0x1558e2[_0x1096('0x34')][_0x1096('0x45')]){_0x44e82a[_0x1096('0x46')]=[{'all':!![]}];}_0x44e82a=_[_0x1096('0x3f')]({},_0x44e82a,_0x1558e2[_0x1096('0x47')]);return db[_0x1096('0x40')]['find'](_0x44e82a)[_0x1096('0x27')](handleEntityNotFound(_0x4b2624,null))[_0x1096('0x27')](respondWithResult(_0x4b2624,null))[_0x1096('0x48')](handleError(_0x4b2624,null));};exports[_0x1096('0x49')]=function(_0x2040d7,_0x18164c){return db[_0x1096('0x40')][_0x1096('0x49')](_0x2040d7[_0x1096('0x4a')],{})[_0x1096('0x27')](function(_0x120393){var _0x5b802c=_0x2040d7[_0x1096('0x4b')][_0x1096('0x4c')]({'plain':!![]});if(!_0x5b802c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b802c[_0x1096('0x4d')]===_0x1096('0x4b')){var _0x6eeaf4=_0x120393[_0x1096('0x4c')]({'plain':!![]});var _0x2ea58b=_0x1096('0x29');return db[_0x1096('0x4e')][_0x1096('0x4f')]({'where':{'name':_0x2ea58b,'userProfileId':_0x5b802c[_0x1096('0x50')]},'raw':!![]})[_0x1096('0x27')](function(_0x3785ea){if(_0x3785ea&&_0x3785ea['autoAssociation']===0x0){return db[_0x1096('0x2a')]['create']({'name':_0x6eeaf4[_0x1096('0x2d')],'resourceId':_0x6eeaf4['id'],'type':_0x3785ea['name'],'sectionId':_0x3785ea['id']},{})[_0x1096('0x27')](function(){return _0x120393;});}else{return _0x120393;}})[_0x1096('0x48')](function(_0x37c177){logger['error'](_0x1096('0x51'),_0x37c177);throw _0x37c177;});}return _0x120393;})[_0x1096('0x27')](respondWithResult(_0x18164c,0xc9))[_0x1096('0x48')](handleError(_0x18164c,null));};exports[_0x1096('0x26')]=function(_0x2987f1,_0x21b6d0){if(_0x2987f1[_0x1096('0x4a')]['id']){delete _0x2987f1['body']['id'];}return db[_0x1096('0x40')][_0x1096('0x4f')]({'where':{'id':_0x2987f1[_0x1096('0x43')]['id']}})[_0x1096('0x27')](handleEntityNotFound(_0x21b6d0,null))['then'](saveUpdates(_0x2987f1[_0x1096('0x4a')],null))[_0x1096('0x27')](respondWithResult(_0x21b6d0,null))['catch'](handleError(_0x21b6d0,null));};exports['destroy']=function(_0x19aa68,_0x53f6c2){return db[_0x1096('0x40')][_0x1096('0x4f')]({'where':{'id':_0x19aa68['params']['id']}})[_0x1096('0x27')](handleEntityNotFound(_0x53f6c2,null))['then'](removeEntity(_0x53f6c2,null))[_0x1096('0x48')](handleError(_0x53f6c2,null));};exports[_0x1096('0x52')]=function(_0x6d28c6,_0x86b07d,_0x3f91dd){var _0xe8a84c;return db[_0x1096('0x40')][_0x1096('0x4f')]({'where':{'id':_0x6d28c6[_0x1096('0x43')]['id']},'attributes':['id',_0x1096('0x53')]})[_0x1096('0x27')](handleEntityNotFound(_0x86b07d,null))[_0x1096('0x27')](function(_0x209045){if(_0x209045){var _0x37788f=require(_0x1096('0x54'))();_0x37788f['openSync'](_0x209045['dsn']);_0x37788f['closeSync']();return _0x209045;}})[_0x1096('0x27')](respondWithResult(_0x86b07d,null))[_0x1096('0x48')](handleError(_0x86b07d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f48854f..ab368b1 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 _0x6897=['./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6897,0x163));var _0x7689=function(_0x416a99,_0x3396f0){_0x416a99=_0x416a99-0x0;var _0x5ed42b=_0x6897[_0x416a99];return _0x5ed42b;};'use strict';var _=require(_0x7689('0x0'));var util=require(_0x7689('0x1'));var logger=require(_0x7689('0x2'))(_0x7689('0x3'));var moment=require(_0x7689('0x4'));var BPromise=require(_0x7689('0x5'));var rp=require(_0x7689('0x6'));var fs=require('fs');var path=require(_0x7689('0x7'));var rimraf=require('rimraf');var config=require(_0x7689('0x8'));var attributes=require(_0x7689('0x9'));module[_0x7689('0xa')]=function(_0x1499bc,_0x44025a){return _0x1499bc[_0x7689('0xb')](_0x7689('0xc'),attributes,{'tableName':_0x7689('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ccb=['path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','moment','request-promise'];(function(_0x189197,_0x4b399d){var _0x16083e=function(_0x57d8dd){while(--_0x57d8dd){_0x189197['push'](_0x189197['shift']());}};_0x16083e(++_0x4b399d);}(_0x3ccb,0x1bf));var _0xb3cc=function(_0x185327,_0x3e0451){_0x185327=_0x185327-0x0;var _0x13ac92=_0x3ccb[_0x185327];return _0x13ac92;};'use strict';var _=require(_0xb3cc('0x0'));var util=require(_0xb3cc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb3cc('0x2'));var BPromise=require('bluebird');var rp=require(_0xb3cc('0x3'));var fs=require('fs');var path=require(_0xb3cc('0x4'));var rimraf=require(_0xb3cc('0x5'));var config=require(_0xb3cc('0x6'));var attributes=require(_0xb3cc('0x7'));module[_0xb3cc('0x8')]=function(_0x4547a5,_0x1ab13a){return _0x4547a5[_0xb3cc('0x9')](_0xb3cc('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 75aa64c..4860d86 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 _0x421a=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SquareOdbc','find','options','raw','where','include','map','attributes','model','then','ShowSquareOdbc','catch','lodash','util'];(function(_0x37b219,_0x3cbd3c){var _0x395c79=function(_0x187dcd){while(--_0x187dcd){_0x37b219['push'](_0x37b219['shift']());}};_0x395c79(++_0x3cbd3c);}(_0x421a,0x19e));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa421('0x0'));var util=require(_0xa421('0x1'));var moment=require(_0xa421('0x2'));var BPromise=require(_0xa421('0x3'));var rs=require(_0xa421('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa421('0x5'));var logger=require('../../config/logger')(_0xa421('0x6'));var config=require(_0xa421('0x7'));var jayson=require(_0xa421('0x8'));var client=jayson[_0xa421('0x9')][_0xa421('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cbbb0,_0x54f8f5,_0x50d980){return new BPromise(function(_0xedc2e8,_0x16d77d){return client[_0xa421('0xb')](_0x2cbbb0,_0x50d980)['then'](function(_0x2640f7){logger[_0xa421('0xc')](_0xa421('0xd'),_0x54f8f5,_0xa421('0xe'));logger['debug'](_0xa421('0xf'),_0x54f8f5,_0xa421('0xe'),JSON[_0xa421('0x10')](_0x2640f7));if(_0x2640f7['error']){if(_0x2640f7[_0xa421('0x11')]['code']===0x1f4){logger['error'](_0xa421('0xd'),_0x54f8f5,_0x2640f7[_0xa421('0x11')][_0xa421('0x12')]);return _0x16d77d(_0x2640f7[_0xa421('0x11')][_0xa421('0x12')]);}logger[_0xa421('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x54f8f5,_0x2640f7[_0xa421('0x11')]['message']);return _0xedc2e8(_0x2640f7[_0xa421('0x11')][_0xa421('0x12')]);}else{logger[_0xa421('0xc')](_0xa421('0xd'),_0x54f8f5,_0xa421('0xe'));_0xedc2e8(_0x2640f7[_0xa421('0x13')][_0xa421('0x12')]);}})['catch'](function(_0x13b641){logger[_0xa421('0x11')](_0xa421('0xd'),_0x54f8f5,_0x13b641);_0x16d77d(_0x13b641);});});}exports['ShowSquareOdbc']=function(_0x448990){var _0x5e62a6=this;return new Promise(function(_0x177d46,_0x38aa5d){return db[_0xa421('0x14')][_0xa421('0x15')]({'raw':_0x448990['options']?_0x448990[_0xa421('0x16')][_0xa421('0x17')]===undefined?!![]:![]:!![],'where':_0x448990[_0xa421('0x16')]?_0x448990[_0xa421('0x16')][_0xa421('0x18')]||null:null,'attributes':_0x448990[_0xa421('0x16')]?_0x448990[_0xa421('0x16')]['attributes']||null:null,'include':_0x448990[_0xa421('0x16')]?_0x448990[_0xa421('0x16')][_0xa421('0x19')]?_[_0xa421('0x1a')](_0x448990[_0xa421('0x16')][_0xa421('0x19')],function(_0x5bd6f8){return{'model':db[_0x5bd6f8['model']],'as':_0x5bd6f8['as'],'attributes':_0x5bd6f8[_0xa421('0x1b')],'include':_0x5bd6f8[_0xa421('0x19')]?_[_0xa421('0x1a')](_0x5bd6f8['include'],function(_0x2f4566){return{'model':db[_0x2f4566['model']],'as':_0x2f4566['as'],'attributes':_0x2f4566[_0xa421('0x1b')],'include':_0x2f4566[_0xa421('0x19')]?_[_0xa421('0x1a')](_0x2f4566[_0xa421('0x19')],function(_0x414da2){return{'model':db[_0x414da2[_0xa421('0x1c')]],'as':_0x414da2['as'],'attributes':_0x414da2[_0xa421('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa421('0x1d')](function(_0x4373a1){logger[_0xa421('0xc')](_0xa421('0x1e'),_0x448990);logger['debug'](_0xa421('0x1e'),_0x448990,JSON['stringify'](_0x4373a1));_0x177d46(_0x4373a1);})[_0xa421('0x1f')](function(_0x449dc4){logger[_0xa421('0x11')]('ShowSquareOdbc',_0x449dc4[_0xa421('0x12')],_0x448990);_0x38aa5d(_0x5e62a6['error'](0x1f4,_0x449dc4[_0xa421('0x12')]));});});}; \ No newline at end of file +var _0xf655=['ShowSquareOdbc','find','options','where','attributes','map','include','model','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch'];(function(_0x4832b8,_0x1cde29){var _0x425045=function(_0x27a709){while(--_0x27a709){_0x4832b8['push'](_0x4832b8['shift']());}};_0x425045(++_0x1cde29);}(_0xf655,0xaa));var _0x5f65=function(_0x28ba9b,_0x3c0681){_0x28ba9b=_0x28ba9b-0x0;var _0x3c0068=_0xf655[_0x28ba9b];return _0x3c0068;};'use strict';var _=require('lodash');var util=require(_0x5f65('0x0'));var moment=require(_0x5f65('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f65('0x2'));var db=require(_0x5f65('0x3'))['db'];var utils=require(_0x5f65('0x4'));var logger=require('../../config/logger')(_0x5f65('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5f65('0x6')][_0x5f65('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ad67d,_0x4b82f1,_0x3f3925){return new BPromise(function(_0x307711,_0x26c013){return client['request'](_0x5ad67d,_0x3f3925)[_0x5f65('0x8')](function(_0x5c3a92){logger[_0x5f65('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x4b82f1,_0x5f65('0xa'));logger['debug'](_0x5f65('0xb'),_0x4b82f1,_0x5f65('0xa'),JSON[_0x5f65('0xc')](_0x5c3a92));if(_0x5c3a92[_0x5f65('0xd')]){if(_0x5c3a92['error'][_0x5f65('0xe')]===0x1f4){logger[_0x5f65('0xd')](_0x5f65('0xf'),_0x4b82f1,_0x5c3a92[_0x5f65('0xd')][_0x5f65('0x10')]);return _0x26c013(_0x5c3a92['error'][_0x5f65('0x10')]);}logger[_0x5f65('0xd')](_0x5f65('0xf'),_0x4b82f1,_0x5c3a92[_0x5f65('0xd')]['message']);return _0x307711(_0x5c3a92['error'][_0x5f65('0x10')]);}else{logger[_0x5f65('0x9')](_0x5f65('0xf'),_0x4b82f1,_0x5f65('0xa'));_0x307711(_0x5c3a92[_0x5f65('0x11')][_0x5f65('0x10')]);}})[_0x5f65('0x12')](function(_0x4ef855){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4b82f1,_0x4ef855);_0x26c013(_0x4ef855);});});}exports[_0x5f65('0x13')]=function(_0x1361a1){var _0x2d61a0=this;return new Promise(function(_0x52f323,_0x2eb633){return db['SquareOdbc'][_0x5f65('0x14')]({'raw':_0x1361a1[_0x5f65('0x15')]?_0x1361a1[_0x5f65('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1361a1[_0x5f65('0x15')]?_0x1361a1[_0x5f65('0x15')][_0x5f65('0x16')]||null:null,'attributes':_0x1361a1[_0x5f65('0x15')]?_0x1361a1[_0x5f65('0x15')][_0x5f65('0x17')]||null:null,'include':_0x1361a1[_0x5f65('0x15')]?_0x1361a1['options']['include']?_[_0x5f65('0x18')](_0x1361a1[_0x5f65('0x15')][_0x5f65('0x19')],function(_0x274647){return{'model':db[_0x274647[_0x5f65('0x1a')]],'as':_0x274647['as'],'attributes':_0x274647[_0x5f65('0x17')],'include':_0x274647[_0x5f65('0x19')]?_[_0x5f65('0x18')](_0x274647['include'],function(_0x5c8cf7){return{'model':db[_0x5c8cf7['model']],'as':_0x5c8cf7['as'],'attributes':_0x5c8cf7[_0x5f65('0x17')],'include':_0x5c8cf7[_0x5f65('0x19')]?_[_0x5f65('0x18')](_0x5c8cf7[_0x5f65('0x19')],function(_0x5abc6c){return{'model':db[_0x5abc6c[_0x5f65('0x1a')]],'as':_0x5abc6c['as'],'attributes':_0x5abc6c[_0x5f65('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x95f320){logger[_0x5f65('0x9')](_0x5f65('0x13'),_0x1361a1);logger['debug']('ShowSquareOdbc',_0x1361a1,JSON['stringify'](_0x95f320));_0x52f323(_0x95f320);})[_0x5f65('0x12')](function(_0x377f83){logger[_0x5f65('0xd')](_0x5f65('0x13'),_0x377f83['message'],_0x1361a1);_0x2eb633(_0x2d61a0[_0x5f65('0xd')](0x1f4,_0x377f83['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 73fcf20..2eaa044 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 _0xcbe2=['put','update','delete','destroy','removeUsers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','post','create','addUsers'];(function(_0xbfa54f,_0x5896e4){var _0x192f42=function(_0x3329bb){while(--_0x3329bb){_0xbfa54f['push'](_0xbfa54f['shift']());}};_0x192f42(++_0x5896e4);}(_0xcbe2,0x148));var _0x2cbe=function(_0x20b6b4,_0x74843b){_0x20b6b4=_0x20b6b4-0x0;var _0x5dc831=_0xcbe2[_0x20b6b4];return _0x5dc831;};'use strict';var multer=require(_0x2cbe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2cbe('0x1'));var express=require(_0x2cbe('0x2'));var router=express[_0x2cbe('0x3')]();var fs_extra=require(_0x2cbe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cbe('0x5'));var config=require(_0x2cbe('0x6'));var controller=require(_0x2cbe('0x7'));router[_0x2cbe('0x8')]('/',auth[_0x2cbe('0x9')](),controller[_0x2cbe('0xa')]);router['get'](_0x2cbe('0xb'),auth[_0x2cbe('0x9')](),controller[_0x2cbe('0xc')]);router[_0x2cbe('0x8')](_0x2cbe('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x2cbe('0xe')]('/',auth['isAuthenticated'](),controller[_0x2cbe('0xf')]);router[_0x2cbe('0xe')](_0x2cbe('0xd'),auth['isAuthenticated'](),controller[_0x2cbe('0x10')]);router[_0x2cbe('0x11')](_0x2cbe('0xb'),auth[_0x2cbe('0x9')](),controller[_0x2cbe('0x12')]);router[_0x2cbe('0x13')]('/:id',auth[_0x2cbe('0x9')](),controller[_0x2cbe('0x14')]);router[_0x2cbe('0x13')](_0x2cbe('0xd'),auth[_0x2cbe('0x9')](),controller[_0x2cbe('0x15')]);module[_0x2cbe('0x16')]=router; \ No newline at end of file +var _0x9512=['show','/:id/users','getUsers','create','post','addUsers','put','/:id','update','destroy','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x16427b,_0x405eb1){var _0x1d99ff=function(_0x1b290d){while(--_0x1b290d){_0x16427b['push'](_0x16427b['shift']());}};_0x1d99ff(++_0x405eb1);}(_0x9512,0x75));var _0x2951=function(_0x4efc87,_0x17a7d1){_0x4efc87=_0x4efc87-0x0;var _0x191fc4=_0x9512[_0x4efc87];return _0x191fc4;};'use strict';var multer=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var path=require(_0x2951('0x2'));var timeout=require(_0x2951('0x3'));var express=require(_0x2951('0x4'));var router=express[_0x2951('0x5')]();var fs_extra=require(_0x2951('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2951('0x7'));var config=require(_0x2951('0x8'));var controller=require(_0x2951('0x9'));router[_0x2951('0xa')]('/',auth[_0x2951('0xb')](),controller[_0x2951('0xc')]);router[_0x2951('0xa')]('/:id',auth[_0x2951('0xb')](),controller[_0x2951('0xd')]);router[_0x2951('0xa')](_0x2951('0xe'),auth[_0x2951('0xb')](),controller[_0x2951('0xf')]);router['post']('/',auth[_0x2951('0xb')](),controller[_0x2951('0x10')]);router[_0x2951('0x11')](_0x2951('0xe'),auth['isAuthenticated'](),controller[_0x2951('0x12')]);router[_0x2951('0x13')](_0x2951('0x14'),auth[_0x2951('0xb')](),controller[_0x2951('0x15')]);router['delete'](_0x2951('0x14'),auth[_0x2951('0xb')](),controller[_0x2951('0x16')]);router[_0x2951('0x17')](_0x2951('0xe'),auth[_0x2951('0xb')](),controller[_0x2951('0x18')]);module[_0x2951('0x19')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 57630d3..ec12f65 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 _0x6a98=['long','preproduction','utf8','getDataValue','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x5daf1f,_0x1fd74f){var _0x23b221=function(_0x3e8fe8){while(--_0x3e8fe8){_0x5daf1f['push'](_0x5daf1f['shift']());}};_0x23b221(++_0x1fd74f);}(_0x6a98,0x118));var _0x86a9=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x6a98[_0x55daf2];return _0x1c8500;};'use strict';var Sequelize=require(_0x86a9('0x0'));module[_0x86a9('0x1')]={'name':{'type':Sequelize[_0x86a9('0x2')],'unique':_0x86a9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x86a9('0x2')]},'notes':{'type':Sequelize[_0x86a9('0x4')]},'preproduction':{'type':Sequelize[_0x86a9('0x5')](_0x86a9('0x6')),'get':function(){if(this['getDataValue'](_0x86a9('0x7'))){return this['getDataValue'](_0x86a9('0x7'))['toString'](_0x86a9('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x86a9('0x6')),'get':function(){if(this[_0x86a9('0x9')]('production')){return this[_0x86a9('0x9')](_0x86a9('0xa'))[_0x86a9('0xb')](_0x86a9('0x8'));}}},'savedAt':{'type':Sequelize[_0x86a9('0xc')]},'publishedAt':{'type':Sequelize[_0x86a9('0xc')]}}; \ No newline at end of file +var _0xb554=['getDataValue','preproduction','utf8','production','DATE','sequelize','STRING','name','BLOB','long'];(function(_0x3521f6,_0x2676da){var _0x73d85c=function(_0x46d497){while(--_0x46d497){_0x3521f6['push'](_0x3521f6['shift']());}};_0x73d85c(++_0x2676da);}(_0xb554,0x73));var _0x4b55=function(_0x24fa0c,_0x118231){_0x24fa0c=_0x24fa0c-0x0;var _0x5b8ae1=_0xb554[_0x24fa0c];return _0x5b8ae1;};'use strict';var Sequelize=require(_0x4b55('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b55('0x1')],'unique':_0x4b55('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4b55('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x4b55('0x3')](_0x4b55('0x4')),'get':function(){if(this[_0x4b55('0x5')](_0x4b55('0x6'))){return this[_0x4b55('0x5')](_0x4b55('0x6'))['toString'](_0x4b55('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0x4b55('0x4')),'get':function(){if(this[_0x4b55('0x5')](_0x4b55('0x8'))){return this[_0x4b55('0x5')](_0x4b55('0x8'))['toString'](_0x4b55('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4b55('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 5deae6f..3edd957 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 _0x8cde=['lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','get','SquareProjects','UserProfileResource','end','error','stack','name','send','net','Socket','agi','port','127.0.0.1','index','SquareProject','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','pick','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne'];(function(_0x49cf85,_0xfdf2d7){var _0x24f687=function(_0x2126ae){while(--_0x2126ae){_0x49cf85['push'](_0x49cf85['shift']());}};_0x24f687(++_0xfdf2d7);}(_0x8cde,0xfc));var _0xe8cd=function(_0xe7d655,_0x184955){_0xe7d655=_0xe7d655-0x0;var _0x3e4804=_0x8cde[_0xe7d655];return _0x3e4804;};'use strict';var _=require(_0xe8cd('0x0'));var Redis=require(_0xe8cd('0x1'));var qs=require(_0xe8cd('0x2'));var logger=require('../../config/logger')(_0xe8cd('0x3'));var config=require(_0xe8cd('0x4'));var db=require(_0xe8cd('0x5'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe8cd('0x6'),'port':0x18eb});var socket=require(_0xe8cd('0x7'))(new Redis(config[_0xe8cd('0x8')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x883413,_0x129b2b){_0x129b2b=_0x129b2b||0xcc;return function(_0x2eb358){if(_0x2eb358){return _0x883413[_0xe8cd('0x9')](_0x129b2b);}return _0x883413[_0xe8cd('0xa')](_0x129b2b)['end']();};}function respondWithResult(_0x263534,_0x4c9236){_0x4c9236=_0x4c9236||0xc8;return function(_0x300e41){if(_0x300e41){return _0x263534[_0xe8cd('0xa')](_0x4c9236)[_0xe8cd('0xb')](_0x300e41);}};}function respondWithFilteredResult(_0x340caa,_0x280328){return function(_0x4e8bdc){if(_0x4e8bdc){var _0x5cd008=typeof _0x280328[_0xe8cd('0xc')]===_0xe8cd('0xd')&&typeof _0x280328[_0xe8cd('0xe')]===_0xe8cd('0xd');var _0x2aa9f8=_0x4e8bdc[_0xe8cd('0xf')];var _0x24a57b=_0x5cd008?0x0:_0x280328['offset'];var _0x5070e4=_0x5cd008?_0x4e8bdc[_0xe8cd('0xf')]:_0x280328[_0xe8cd('0xc')]+_0x280328[_0xe8cd('0xe')];var _0x50797a;if(_0x5070e4>=_0x2aa9f8){_0x5070e4=_0x2aa9f8;_0x50797a=0xc8;}else{_0x50797a=0xce;}_0x340caa[_0xe8cd('0xa')](_0x50797a);return _0x340caa[_0xe8cd('0x10')]('Content-Range',_0x24a57b+'-'+_0x5070e4+'/'+_0x2aa9f8)[_0xe8cd('0xb')](_0x4e8bdc);}return null;};}function saveUpdates(_0x452252){return function(_0x91c29){if(_0x91c29){return _0x91c29[_0xe8cd('0x11')](_0x452252)[_0xe8cd('0x12')](function(_0x25b64e){return _0x25b64e;});}return null;};}function removeEntity(_0xe7b49d){return function(_0x444d90){if(_0x444d90){return _0x444d90[_0xe8cd('0x13')]()[_0xe8cd('0x12')](function(){var _0x39471a=_0x444d90[_0xe8cd('0x14')]({'plain':!![]});var _0x1738d2=_0xe8cd('0x15');return db[_0xe8cd('0x16')]['destroy']({'where':{'type':_0x1738d2,'resourceId':_0x39471a['id']}})[_0xe8cd('0x12')](function(){return _0x444d90;});})[_0xe8cd('0x12')](function(){return createAgiSocket();})['then'](function(_0x478c55){_0x478c55['end'](JSON['stringify']({'id':_0x444d90['id'],'deleted':!![]}));})[_0xe8cd('0x12')](function(){_0xe7b49d[_0xe8cd('0xa')](0xcc)[_0xe8cd('0x17')]();});}};}function handleEntityNotFound(_0x561232){return function(_0x220356){if(!_0x220356){_0x561232[_0xe8cd('0x9')](0x194);}return _0x220356;};}function handleError(_0x2b336b,_0x28ac57){_0x28ac57=_0x28ac57||0x1f4;return function(_0x3dd7ba){logger[_0xe8cd('0x18')](_0x3dd7ba[_0xe8cd('0x19')]);if(_0x3dd7ba[_0xe8cd('0x1a')]){delete _0x3dd7ba['name'];}_0x2b336b['status'](_0x28ac57)[_0xe8cd('0x1b')](_0x3dd7ba);};}function createAgiSocket(){try{var _0xea7e7f=require(_0xe8cd('0x1c'));var _0x5b563e=new _0xea7e7f[(_0xe8cd('0x1d'))]();return _0x5b563e['connect'](config[_0xe8cd('0x1e')][_0xe8cd('0x1f')]||0x11dd,_0xe8cd('0x20'));}catch(_0x138daa){throw _0x138daa;}}exports[_0xe8cd('0x21')]=function(_0x895beb,_0x2f2c10){var _0x454bc4={},_0x47256f={},_0x445e5e={'count':0x0,'rows':[]};var _0x2cbb39=_['map'](db[_0xe8cd('0x22')][_0xe8cd('0x23')],function(_0x4093be){return{'name':_0x4093be[_0xe8cd('0x24')],'type':_0x4093be['type'][_0xe8cd('0x25')]};});_0x47256f[_0xe8cd('0x26')]=_[_0xe8cd('0x27')](_0x2cbb39,_0xe8cd('0x1a'));_0x47256f[_0xe8cd('0x28')]=_['keys'](_0x895beb['query']);_0x47256f[_0xe8cd('0x29')]=_[_0xe8cd('0x2a')](_0x47256f['model'],_0x47256f['query']);_0x454bc4['attributes']=_[_0xe8cd('0x2a')](_0x47256f[_0xe8cd('0x26')],qs['fields'](_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x2b')]));_0x454bc4[_0xe8cd('0x2c')]=_0x454bc4['attributes']['length']?_0x454bc4[_0xe8cd('0x2c')]:_0x47256f[_0xe8cd('0x26')];if(!_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x2d')](_0xe8cd('0x2e'))){_0x454bc4[_0xe8cd('0xe')]=qs[_0xe8cd('0xe')](_0x895beb[_0xe8cd('0x28')][_0xe8cd('0xe')]);_0x454bc4[_0xe8cd('0xc')]=qs[_0xe8cd('0xc')](_0x895beb[_0xe8cd('0x28')]['offset']);}_0x454bc4[_0xe8cd('0x2f')]=qs[_0xe8cd('0x30')](_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x30')]);_0x454bc4[_0xe8cd('0x31')]=qs[_0xe8cd('0x29')](_['pick'](_0x895beb[_0xe8cd('0x28')],_0x47256f[_0xe8cd('0x29')]),_0x2cbb39);if(_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x32')]){_0x454bc4['where']=_[_0xe8cd('0x33')](_0x454bc4[_0xe8cd('0x31')],{'$or':_[_0xe8cd('0x27')](_0x2cbb39,function(_0x33e920){if(_0x33e920[_0xe8cd('0x34')]!==_0xe8cd('0x35')){var _0x34def8={};_0x34def8[_0x33e920[_0xe8cd('0x1a')]]={'$like':'%'+_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x32')]+'%'};return _0x34def8;}})});}_0x454bc4=_['merge']({},_0x454bc4,_0x895beb[_0xe8cd('0x36')]);var _0x3262f4={'where':_0x454bc4[_0xe8cd('0x31')]};return db[_0xe8cd('0x22')][_0xe8cd('0xf')](_0x3262f4)[_0xe8cd('0x12')](function(_0x126068){_0x445e5e[_0xe8cd('0xf')]=_0x126068;if(_0x895beb[_0xe8cd('0x28')][_0xe8cd('0x37')]){_0x454bc4['include']=[{'all':!![]}];}return db[_0xe8cd('0x22')][_0xe8cd('0x38')](_0x454bc4);})['then'](function(_0xf10ba4){_0x445e5e[_0xe8cd('0x39')]=_0xf10ba4;return _0x445e5e;})[_0xe8cd('0x12')](respondWithFilteredResult(_0x2f2c10,_0x454bc4))[_0xe8cd('0x3a')](handleError(_0x2f2c10,null));};exports[_0xe8cd('0x3b')]=function(_0x3d1faa,_0x2cb953){var _0x882279={'raw':![],'where':{'id':_0x3d1faa[_0xe8cd('0x3c')]['id']}},_0x3753e1={};_0x3753e1[_0xe8cd('0x26')]=_[_0xe8cd('0x3d')](db['SquareProject']['rawAttributes']);_0x3753e1[_0xe8cd('0x28')]=_[_0xe8cd('0x3d')](_0x3d1faa[_0xe8cd('0x28')]);_0x3753e1[_0xe8cd('0x29')]=_[_0xe8cd('0x2a')](_0x3753e1[_0xe8cd('0x26')],_0x3753e1[_0xe8cd('0x28')]);_0x882279[_0xe8cd('0x2c')]=_[_0xe8cd('0x2a')](_0x3753e1['model'],qs['fields'](_0x3d1faa['query']['fields']));_0x882279['attributes']=_0x882279['attributes'][_0xe8cd('0x3e')]?_0x882279[_0xe8cd('0x2c')]:_0x3753e1['model'];if(_0x3d1faa[_0xe8cd('0x28')][_0xe8cd('0x37')]){_0x882279[_0xe8cd('0x3f')]=[{'all':!![]}];}_0x882279=_[_0xe8cd('0x33')]({},_0x882279,_0x3d1faa[_0xe8cd('0x36')]);return db['SquareProject'][_0xe8cd('0x40')](_0x882279)[_0xe8cd('0x12')](handleEntityNotFound(_0x2cb953,null))[_0xe8cd('0x12')](respondWithResult(_0x2cb953,null))[_0xe8cd('0x3a')](handleError(_0x2cb953,null));};exports[_0xe8cd('0x41')]=function(_0x593033,_0x32f569){return db['SquareProject'][_0xe8cd('0x41')](_0x593033[_0xe8cd('0x42')],{})[_0xe8cd('0x12')](function(_0x5a38e9){var _0x4d582b=_0x593033['user']['get']({'plain':!![]});if(!_0x4d582b)throw new Error(_0xe8cd('0x43'));if(_0x4d582b[_0xe8cd('0x44')]===_0xe8cd('0x45')){var _0x198d49=_0x5a38e9[_0xe8cd('0x14')]({'plain':!![]});var _0x3e7233=_0xe8cd('0x15');return db[_0xe8cd('0x46')][_0xe8cd('0x40')]({'where':{'name':_0x3e7233,'userProfileId':_0x4d582b[_0xe8cd('0x47')]},'raw':!![]})[_0xe8cd('0x12')](function(_0x38de2e){if(_0x38de2e&&_0x38de2e[_0xe8cd('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x198d49['name'],'resourceId':_0x198d49['id'],'type':_0x38de2e[_0xe8cd('0x1a')],'sectionId':_0x38de2e['id']},{})[_0xe8cd('0x12')](function(){return _0x5a38e9;});}else{return _0x5a38e9;}})[_0xe8cd('0x3a')](function(_0x13fcee){logger[_0xe8cd('0x18')](_0xe8cd('0x49'),_0x13fcee);throw _0x13fcee;});}return _0x5a38e9;})[_0xe8cd('0x12')](respondWithResult(_0x32f569,0xc9))[_0xe8cd('0x3a')](handleError(_0x32f569,null));};exports['update']=function(_0x4cc265,_0x20c298){if(_0x4cc265[_0xe8cd('0x42')]['id']){delete _0x4cc265['body']['id'];}return db[_0xe8cd('0x22')][_0xe8cd('0x40')]({'where':{'id':_0x4cc265[_0xe8cd('0x3c')]['id']}})[_0xe8cd('0x12')](handleEntityNotFound(_0x20c298,null))[_0xe8cd('0x12')](saveUpdates(_0x4cc265[_0xe8cd('0x42')],null))['then'](function(_0x31e628){if(!_0x31e628)return;var _0x56cc78=_0x31e628[_0xe8cd('0x14')]({'plain':!![]});return[createAgiSocket(),_0x56cc78];})[_0xe8cd('0x4a')](function(_0x24ee03,_0x241655){_0x24ee03['end'](JSON['stringify'](_[_0xe8cd('0x4b')](_0x241655,['id',_0xe8cd('0x1a'),'production'])));return _0x241655;})[_0xe8cd('0x12')](respondWithResult(_0x20c298,null))[_0xe8cd('0x3a')](handleError(_0x20c298,null));};exports[_0xe8cd('0x13')]=function(_0x559e73,_0x192728){return db[_0xe8cd('0x22')][_0xe8cd('0x40')]({'where':{'id':_0x559e73[_0xe8cd('0x3c')]['id']}})[_0xe8cd('0x12')](handleEntityNotFound(_0x192728,null))[_0xe8cd('0x12')](removeEntity(_0x192728,null))[_0xe8cd('0x3a')](handleError(_0x192728,null));};exports['addUsers']=function(_0x386e82,_0xe0774c){return db[_0xe8cd('0x22')][_0xe8cd('0x40')]({'where':{'id':_0x386e82['params']['id']}})['then'](handleEntityNotFound(_0xe0774c,null))[_0xe8cd('0x12')](function(_0x2287e1){if(_0x2287e1){return _0x2287e1[_0xe8cd('0x4c')](_0x386e82[_0xe8cd('0x42')][_0xe8cd('0x4d')],_[_0xe8cd('0x4e')](_0x386e82[_0xe8cd('0x42')],['ids','id'])||{});}})['then'](respondWithResult(_0xe0774c,null))[_0xe8cd('0x3a')](handleError(_0xe0774c,null));};exports[_0xe8cd('0x4f')]=function(_0x980817,_0x581b64){return db['SquareProject'][_0xe8cd('0x40')]({'where':{'id':_0x980817[_0xe8cd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x581b64,null))[_0xe8cd('0x12')](function(_0x478f82){if(_0x478f82){return _0x478f82['removeUsers'](_0x980817[_0xe8cd('0x28')][_0xe8cd('0x4d')])['then'](function(){if(_['isArray'](_0x980817[_0xe8cd('0x28')]['ids'])){for(var _0x543b20=0x0;_0x543b20<_0x980817['query']['ids'][_0xe8cd('0x3e')];_0x543b20+=0x1){socket[_0xe8cd('0x50')](_0xe8cd('0x51'),{'UserId':Number(_0x980817[_0xe8cd('0x28')]['ids'][_0x543b20]),'SquareProjectId':Number(_0x980817[_0xe8cd('0x3c')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x980817['query'][_0xe8cd('0x4d')]),'SquareProjectId':Number(_0x980817[_0xe8cd('0x3c')]['id'])});}});}})[_0xe8cd('0x12')](respondWithStatusCode(_0x581b64,null))[_0xe8cd('0x3a')](handleError(_0x581b64,null));};exports[_0xe8cd('0x52')]=function(_0x4d9add,_0x438fc7){var _0x394b3f={};var _0x574a45={};var _0x3c5ac4;var _0x363f3e;return db[_0xe8cd('0x22')][_0xe8cd('0x53')]({'where':{'id':_0x4d9add[_0xe8cd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x438fc7,null))[_0xe8cd('0x12')](function(_0x345e8c){if(_0x345e8c){_0x3c5ac4=_0x345e8c;_0x574a45['model']=_[_0xe8cd('0x3d')](db['User'][_0xe8cd('0x23')]);_0x574a45['query']=_[_0xe8cd('0x3d')](_0x4d9add[_0xe8cd('0x28')]);_0x574a45[_0xe8cd('0x29')]=_[_0xe8cd('0x2a')](_0x574a45['model'],_0x574a45['query']);_0x394b3f[_0xe8cd('0x2c')]=_['intersection'](_0x574a45[_0xe8cd('0x26')],qs[_0xe8cd('0x2b')](_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0x2b')]));_0x394b3f[_0xe8cd('0x2c')]=_0x394b3f[_0xe8cd('0x2c')]['length']?_0x394b3f[_0xe8cd('0x2c')]:_0x574a45[_0xe8cd('0x26')];_0x394b3f['order']=qs['sort'](_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0x30')]);_0x394b3f['where']=qs[_0xe8cd('0x29')](_[_0xe8cd('0x4b')](_0x4d9add[_0xe8cd('0x28')],_0x574a45['filters']));if(_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0x32')]){_0x394b3f[_0xe8cd('0x31')]=_[_0xe8cd('0x33')](_0x394b3f[_0xe8cd('0x31')],{'$or':_[_0xe8cd('0x27')](_0x394b3f[_0xe8cd('0x2c')],function(_0x21b8a1){var _0x5cc81e={};_0x5cc81e[_0x21b8a1]={'$like':'%'+_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0x32')]+'%'};return _0x5cc81e;})});}_0x394b3f=_['merge']({},_0x394b3f,_0x4d9add[_0xe8cd('0x36')]);return _0x3c5ac4['getUsers'](_0x394b3f);}})[_0xe8cd('0x12')](function(_0xb469c){if(_0xb469c){_0x363f3e=_0xb469c['length'];if(!_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0x2d')](_0xe8cd('0x2e'))){_0x394b3f[_0xe8cd('0xe')]=qs[_0xe8cd('0xe')](_0x4d9add['query']['limit']);_0x394b3f['offset']=qs[_0xe8cd('0xc')](_0x4d9add[_0xe8cd('0x28')][_0xe8cd('0xc')]);}return _0x3c5ac4['getUsers'](_0x394b3f);}})[_0xe8cd('0x12')](function(_0x3e6294){if(_0x3e6294){return _0x3e6294?{'count':_0x363f3e,'rows':_0x3e6294}:null;}})['then'](respondWithResult(_0x438fc7,null))[_0xe8cd('0x3a')](handleError(_0x438fc7,null));}; \ No newline at end of file +var _0x9162=['type','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','filter','lodash','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','UserProfileResource','then','stringify','error','name','send','net','Socket','connect','agi','index','map','SquareProject','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge'];(function(_0x57570f,_0x459c54){var _0x5d0206=function(_0x2efcf6){while(--_0x2efcf6){_0x57570f['push'](_0x57570f['shift']());}};_0x5d0206(++_0x459c54);}(_0x9162,0xca));var _0x2916=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9162[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2916('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2916('0x1'))(_0x2916('0x2'));var config=require('../../config/environment');var db=require(_0x2916('0x3'))['db'];config[_0x2916('0x4')]=_[_0x2916('0x5')](config[_0x2916('0x4')],{'host':_0x2916('0x6'),'port':0x18eb});var socket=require(_0x2916('0x7'))(new Redis(config[_0x2916('0x4')]));require(_0x2916('0x8'))[_0x2916('0x9')](socket);function respondWithStatusCode(_0x3223b3,_0x282bea){_0x282bea=_0x282bea||0xcc;return function(_0x2be56e){if(_0x2be56e){return _0x3223b3[_0x2916('0xa')](_0x282bea);}return _0x3223b3[_0x2916('0xb')](_0x282bea)[_0x2916('0xc')]();};}function respondWithResult(_0x589847,_0x5b1546){_0x5b1546=_0x5b1546||0xc8;return function(_0x352369){if(_0x352369){return _0x589847['status'](_0x5b1546)[_0x2916('0xd')](_0x352369);}};}function respondWithFilteredResult(_0x183740,_0x256e8a){return function(_0x46cd29){if(_0x46cd29){var _0x453c36=typeof _0x256e8a[_0x2916('0xe')]===_0x2916('0xf')&&typeof _0x256e8a[_0x2916('0x10')]===_0x2916('0xf');var _0x16ecd1=_0x46cd29[_0x2916('0x11')];var _0x336993=_0x453c36?0x0:_0x256e8a['offset'];var _0xa8728f=_0x453c36?_0x46cd29[_0x2916('0x11')]:_0x256e8a[_0x2916('0xe')]+_0x256e8a['limit'];var _0x492854;if(_0xa8728f>=_0x16ecd1){_0xa8728f=_0x16ecd1;_0x492854=0xc8;}else{_0x492854=0xce;}_0x183740['status'](_0x492854);return _0x183740['set'](_0x2916('0x12'),_0x336993+'-'+_0xa8728f+'/'+_0x16ecd1)[_0x2916('0xd')](_0x46cd29);}return null;};}function saveUpdates(_0x374ad6){return function(_0x47adae){if(_0x47adae){return _0x47adae[_0x2916('0x13')](_0x374ad6)['then'](function(_0x3868b5){return _0x3868b5;});}return null;};}function removeEntity(_0x29447f){return function(_0x463d93){if(_0x463d93){return _0x463d93[_0x2916('0x14')]()['then'](function(){var _0x2d676b=_0x463d93['get']({'plain':!![]});var _0x3a58c5='SquareProjects';return db[_0x2916('0x15')]['destroy']({'where':{'type':_0x3a58c5,'resourceId':_0x2d676b['id']}})[_0x2916('0x16')](function(){return _0x463d93;});})[_0x2916('0x16')](function(){return createAgiSocket();})['then'](function(_0x1b4719){_0x1b4719[_0x2916('0xc')](JSON[_0x2916('0x17')]({'id':_0x463d93['id'],'deleted':!![]}));})[_0x2916('0x16')](function(){_0x29447f[_0x2916('0xb')](0xcc)[_0x2916('0xc')]();});}};}function handleEntityNotFound(_0x33df6b){return function(_0x1b5404){if(!_0x1b5404){_0x33df6b[_0x2916('0xa')](0x194);}return _0x1b5404;};}function handleError(_0xf6d3c3,_0x3cae67){_0x3cae67=_0x3cae67||0x1f4;return function(_0x5b1ebd){logger[_0x2916('0x18')](_0x5b1ebd['stack']);if(_0x5b1ebd[_0x2916('0x19')]){delete _0x5b1ebd[_0x2916('0x19')];}_0xf6d3c3[_0x2916('0xb')](_0x3cae67)[_0x2916('0x1a')](_0x5b1ebd);};}function createAgiSocket(){try{var _0x56fd39=require(_0x2916('0x1b'));var _0x50e8df=new _0x56fd39[(_0x2916('0x1c'))]();return _0x50e8df[_0x2916('0x1d')](config[_0x2916('0x1e')]['port']||0x11dd,'127.0.0.1');}catch(_0x4ed4a8){throw _0x4ed4a8;}}exports[_0x2916('0x1f')]=function(_0x1461d8,_0x2f09d5){var _0x5c5f15={},_0x182ee0={},_0x307540={'count':0x0,'rows':[]};var _0x1f6e33=_[_0x2916('0x20')](db[_0x2916('0x21')][_0x2916('0x22')],function(_0x39eb6d){return{'name':_0x39eb6d[_0x2916('0x23')],'type':_0x39eb6d['type'][_0x2916('0x24')]};});_0x182ee0[_0x2916('0x25')]=_[_0x2916('0x20')](_0x1f6e33,_0x2916('0x19'));_0x182ee0['query']=_[_0x2916('0x26')](_0x1461d8[_0x2916('0x27')]);_0x182ee0[_0x2916('0x28')]=_[_0x2916('0x29')](_0x182ee0[_0x2916('0x25')],_0x182ee0[_0x2916('0x27')]);_0x5c5f15[_0x2916('0x2a')]=_['intersection'](_0x182ee0[_0x2916('0x25')],qs['fields'](_0x1461d8['query'][_0x2916('0x2b')]));_0x5c5f15[_0x2916('0x2a')]=_0x5c5f15[_0x2916('0x2a')]['length']?_0x5c5f15[_0x2916('0x2a')]:_0x182ee0['model'];if(!_0x1461d8[_0x2916('0x27')]['hasOwnProperty'](_0x2916('0x2c'))){_0x5c5f15[_0x2916('0x10')]=qs[_0x2916('0x10')](_0x1461d8['query']['limit']);_0x5c5f15['offset']=qs['offset'](_0x1461d8[_0x2916('0x27')][_0x2916('0xe')]);}_0x5c5f15[_0x2916('0x2d')]=qs[_0x2916('0x2e')](_0x1461d8[_0x2916('0x27')][_0x2916('0x2e')]);_0x5c5f15[_0x2916('0x2f')]=qs[_0x2916('0x28')](_[_0x2916('0x30')](_0x1461d8[_0x2916('0x27')],_0x182ee0[_0x2916('0x28')]),_0x1f6e33);if(_0x1461d8[_0x2916('0x27')]['filter']){_0x5c5f15[_0x2916('0x2f')]=_[_0x2916('0x31')](_0x5c5f15['where'],{'$or':_[_0x2916('0x20')](_0x1f6e33,function(_0x3aa59){if(_0x3aa59[_0x2916('0x32')]!==_0x2916('0x33')){var _0x2578d6={};_0x2578d6[_0x3aa59[_0x2916('0x19')]]={'$like':'%'+_0x1461d8['query']['filter']+'%'};return _0x2578d6;}})});}_0x5c5f15=_[_0x2916('0x31')]({},_0x5c5f15,_0x1461d8['options']);var _0xa4f093={'where':_0x5c5f15[_0x2916('0x2f')]};return db[_0x2916('0x21')][_0x2916('0x11')](_0xa4f093)[_0x2916('0x16')](function(_0x4e42f8){_0x307540[_0x2916('0x11')]=_0x4e42f8;if(_0x1461d8[_0x2916('0x27')]['includeAll']){_0x5c5f15[_0x2916('0x34')]=[{'all':!![]}];}return db[_0x2916('0x21')][_0x2916('0x35')](_0x5c5f15);})[_0x2916('0x16')](function(_0x529274){_0x307540[_0x2916('0x36')]=_0x529274;return _0x307540;})['then'](respondWithFilteredResult(_0x2f09d5,_0x5c5f15))[_0x2916('0x37')](handleError(_0x2f09d5,null));};exports[_0x2916('0x38')]=function(_0x3b90e1,_0x6e3f94){var _0x11c89f={'raw':![],'where':{'id':_0x3b90e1[_0x2916('0x39')]['id']}},_0x3d8f74={};_0x3d8f74[_0x2916('0x25')]=_['keys'](db[_0x2916('0x21')][_0x2916('0x22')]);_0x3d8f74[_0x2916('0x27')]=_['keys'](_0x3b90e1[_0x2916('0x27')]);_0x3d8f74[_0x2916('0x28')]=_['intersection'](_0x3d8f74[_0x2916('0x25')],_0x3d8f74['query']);_0x11c89f[_0x2916('0x2a')]=_[_0x2916('0x29')](_0x3d8f74[_0x2916('0x25')],qs[_0x2916('0x2b')](_0x3b90e1[_0x2916('0x27')][_0x2916('0x2b')]));_0x11c89f[_0x2916('0x2a')]=_0x11c89f['attributes'][_0x2916('0x3a')]?_0x11c89f['attributes']:_0x3d8f74[_0x2916('0x25')];if(_0x3b90e1[_0x2916('0x27')][_0x2916('0x3b')]){_0x11c89f[_0x2916('0x34')]=[{'all':!![]}];}_0x11c89f=_['merge']({},_0x11c89f,_0x3b90e1[_0x2916('0x3c')]);return db[_0x2916('0x21')][_0x2916('0x3d')](_0x11c89f)[_0x2916('0x16')](handleEntityNotFound(_0x6e3f94,null))[_0x2916('0x16')](respondWithResult(_0x6e3f94,null))[_0x2916('0x37')](handleError(_0x6e3f94,null));};exports[_0x2916('0x3e')]=function(_0x3888bf,_0x9c884){return db[_0x2916('0x21')][_0x2916('0x3e')](_0x3888bf[_0x2916('0x3f')],{})[_0x2916('0x16')](function(_0x11b1b5){var _0x24cbc7=_0x3888bf[_0x2916('0x40')][_0x2916('0x41')]({'plain':!![]});if(!_0x24cbc7)throw new Error(_0x2916('0x42'));if(_0x24cbc7[_0x2916('0x43')]===_0x2916('0x40')){var _0x1d7343=_0x11b1b5[_0x2916('0x41')]({'plain':!![]});var _0x168691=_0x2916('0x44');return db[_0x2916('0x45')][_0x2916('0x3d')]({'where':{'name':_0x168691,'userProfileId':_0x24cbc7['userProfileId']},'raw':!![]})[_0x2916('0x16')](function(_0x1d63b1){if(_0x1d63b1&&_0x1d63b1[_0x2916('0x46')]===0x0){return db[_0x2916('0x15')][_0x2916('0x3e')]({'name':_0x1d7343[_0x2916('0x19')],'resourceId':_0x1d7343['id'],'type':_0x1d63b1['name'],'sectionId':_0x1d63b1['id']},{})['then'](function(){return _0x11b1b5;});}else{return _0x11b1b5;}})['catch'](function(_0x49d230){logger['error'](_0x2916('0x47'),_0x49d230);throw _0x49d230;});}return _0x11b1b5;})[_0x2916('0x16')](respondWithResult(_0x9c884,0xc9))[_0x2916('0x37')](handleError(_0x9c884,null));};exports['update']=function(_0x3a157e,_0x52e526){if(_0x3a157e[_0x2916('0x3f')]['id']){delete _0x3a157e[_0x2916('0x3f')]['id'];}return db[_0x2916('0x21')]['find']({'where':{'id':_0x3a157e['params']['id']}})[_0x2916('0x16')](handleEntityNotFound(_0x52e526,null))['then'](saveUpdates(_0x3a157e[_0x2916('0x3f')],null))[_0x2916('0x16')](function(_0x3529c5){if(!_0x3529c5)return;var _0x138a7d=_0x3529c5[_0x2916('0x41')]({'plain':!![]});return[createAgiSocket(),_0x138a7d];})[_0x2916('0x48')](function(_0x41b9df,_0x2361e8){_0x41b9df[_0x2916('0xc')](JSON[_0x2916('0x17')](_[_0x2916('0x30')](_0x2361e8,['id',_0x2916('0x19'),'production'])));return _0x2361e8;})['then'](respondWithResult(_0x52e526,null))['catch'](handleError(_0x52e526,null));};exports[_0x2916('0x14')]=function(_0x2aee87,_0xc71859){return db[_0x2916('0x21')]['find']({'where':{'id':_0x2aee87[_0x2916('0x39')]['id']}})['then'](handleEntityNotFound(_0xc71859,null))[_0x2916('0x16')](removeEntity(_0xc71859,null))[_0x2916('0x37')](handleError(_0xc71859,null));};exports[_0x2916('0x49')]=function(_0x2a46dc,_0x3e6ea8){return db[_0x2916('0x21')][_0x2916('0x3d')]({'where':{'id':_0x2a46dc[_0x2916('0x39')]['id']}})[_0x2916('0x16')](handleEntityNotFound(_0x3e6ea8,null))[_0x2916('0x16')](function(_0x23159d){if(_0x23159d){return _0x23159d[_0x2916('0x49')](_0x2a46dc['body'][_0x2916('0x4a')],_[_0x2916('0x4b')](_0x2a46dc[_0x2916('0x3f')],['ids','id'])||{});}})[_0x2916('0x16')](respondWithResult(_0x3e6ea8,null))[_0x2916('0x37')](handleError(_0x3e6ea8,null));};exports[_0x2916('0x4c')]=function(_0x158c62,_0x3cfa5d){return db[_0x2916('0x21')][_0x2916('0x3d')]({'where':{'id':_0x158c62[_0x2916('0x39')]['id']}})[_0x2916('0x16')](handleEntityNotFound(_0x3cfa5d,null))[_0x2916('0x16')](function(_0x5587f9){if(_0x5587f9){return _0x5587f9[_0x2916('0x4c')](_0x158c62['query']['ids'])[_0x2916('0x16')](function(){if(_[_0x2916('0x4d')](_0x158c62[_0x2916('0x27')][_0x2916('0x4a')])){for(var _0x56f254=0x0;_0x56f254<_0x158c62['query'][_0x2916('0x4a')][_0x2916('0x3a')];_0x56f254+=0x1){socket[_0x2916('0x4e')](_0x2916('0x4f'),{'UserId':Number(_0x158c62[_0x2916('0x27')][_0x2916('0x4a')][_0x56f254]),'SquareProjectId':Number(_0x158c62['params']['id'])});}}else{socket['emit'](_0x2916('0x4f'),{'UserId':Number(_0x158c62['query'][_0x2916('0x4a')]),'SquareProjectId':Number(_0x158c62['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3cfa5d,null))[_0x2916('0x37')](handleError(_0x3cfa5d,null));};exports[_0x2916('0x50')]=function(_0x23dc14,_0x744d66){var _0x3a0d37={};var _0x257efb={};var _0x3f2564;var _0x112b5d;return db['SquareProject'][_0x2916('0x51')]({'where':{'id':_0x23dc14[_0x2916('0x39')]['id']}})['then'](handleEntityNotFound(_0x744d66,null))['then'](function(_0x34f6db){if(_0x34f6db){_0x3f2564=_0x34f6db;_0x257efb[_0x2916('0x25')]=_[_0x2916('0x26')](db[_0x2916('0x52')]['rawAttributes']);_0x257efb[_0x2916('0x27')]=_[_0x2916('0x26')](_0x23dc14[_0x2916('0x27')]);_0x257efb[_0x2916('0x28')]=_[_0x2916('0x29')](_0x257efb[_0x2916('0x25')],_0x257efb[_0x2916('0x27')]);_0x3a0d37[_0x2916('0x2a')]=_[_0x2916('0x29')](_0x257efb[_0x2916('0x25')],qs[_0x2916('0x2b')](_0x23dc14[_0x2916('0x27')][_0x2916('0x2b')]));_0x3a0d37[_0x2916('0x2a')]=_0x3a0d37[_0x2916('0x2a')][_0x2916('0x3a')]?_0x3a0d37[_0x2916('0x2a')]:_0x257efb[_0x2916('0x25')];_0x3a0d37[_0x2916('0x2d')]=qs[_0x2916('0x2e')](_0x23dc14[_0x2916('0x27')]['sort']);_0x3a0d37[_0x2916('0x2f')]=qs[_0x2916('0x28')](_[_0x2916('0x30')](_0x23dc14[_0x2916('0x27')],_0x257efb[_0x2916('0x28')]));if(_0x23dc14[_0x2916('0x27')][_0x2916('0x53')]){_0x3a0d37['where']=_['merge'](_0x3a0d37[_0x2916('0x2f')],{'$or':_['map'](_0x3a0d37[_0x2916('0x2a')],function(_0x286550){var _0x20395a={};_0x20395a[_0x286550]={'$like':'%'+_0x23dc14[_0x2916('0x27')]['filter']+'%'};return _0x20395a;})});}_0x3a0d37=_[_0x2916('0x31')]({},_0x3a0d37,_0x23dc14['options']);return _0x3f2564[_0x2916('0x50')](_0x3a0d37);}})[_0x2916('0x16')](function(_0x252781){if(_0x252781){_0x112b5d=_0x252781[_0x2916('0x3a')];if(!_0x23dc14[_0x2916('0x27')]['hasOwnProperty'](_0x2916('0x2c'))){_0x3a0d37[_0x2916('0x10')]=qs[_0x2916('0x10')](_0x23dc14['query']['limit']);_0x3a0d37[_0x2916('0xe')]=qs['offset'](_0x23dc14[_0x2916('0x27')][_0x2916('0xe')]);}return _0x3f2564['getUsers'](_0x3a0d37);}})['then'](function(_0x5c5e2b){if(_0x5c5e2b){return _0x5c5e2b?{'count':_0x112b5d,'rows':_0x5c5e2b}:null;}})[_0x2916('0x16')](respondWithResult(_0x744d66,null))[_0x2916('0x37')](handleError(_0x744d66,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1e96719..59ff1fa 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 _0x26f7=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x26f7,0x128));var _0x726f=function(_0x28b3f6,_0x1ca77c){_0x28b3f6=_0x28b3f6-0x0;var _0x3089b4=_0x26f7[_0x28b3f6];return _0x3089b4;};'use strict';var EventEmitter=require(_0x726f('0x0'));var SquareProject=require(_0x726f('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x726f('0x2'),'afterUpdate':_0x726f('0x3'),'afterDestroy':_0x726f('0x4')};function emitEvent(_0x3f248e){return function(_0x1978db,_0x288c8a,_0x38c4d1){SquareProjectEvents[_0x726f('0x5')](_0x3f248e+':'+_0x1978db['id'],_0x1978db);SquareProjectEvents['emit'](_0x3f248e,_0x1978db);_0x38c4d1(null);};}for(var e in events){if(events[_0x726f('0x6')](e)){var event=events[e];SquareProject[_0x726f('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xcbe0=['remove','emit','hasOwnProperty','hook','events','save','update'];(function(_0x31a565,_0x13af56){var _0x475439=function(_0x21ce97){while(--_0x21ce97){_0x31a565['push'](_0x31a565['shift']());}};_0x475439(++_0x13af56);}(_0xcbe0,0x138));var _0x0cbe=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0xcbe0[_0x2085f3];return _0x384e3c;};'use strict';var EventEmitter=require(_0x0cbe('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0cbe('0x1'),'afterUpdate':_0x0cbe('0x2'),'afterDestroy':_0x0cbe('0x3')};function emitEvent(_0x150873){return function(_0x19cf02,_0x1cd17c,_0x3c4fc1){SquareProjectEvents['emit'](_0x150873+':'+_0x19cf02['id'],_0x19cf02);SquareProjectEvents[_0x0cbe('0x4')](_0x150873,_0x19cf02);_0x3c4fc1(null);};}for(var e in events){if(events[_0x0cbe('0x5')](e)){var event=events[e];SquareProject[_0x0cbe('0x6')](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 93165d2..8a3df39 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 _0x8cb4=['bluebird','request-promise','path','rimraf','../../config/environment','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cb4,0xf3));var _0x48cb=function(_0x112852,_0x3fbcf7){_0x112852=_0x112852-0x0;var _0x333827=_0x8cb4[_0x112852];return _0x333827;};'use strict';var _=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var logger=require(_0x48cb('0x2'))('api');var moment=require(_0x48cb('0x3'));var BPromise=require(_0x48cb('0x4'));var rp=require(_0x48cb('0x5'));var fs=require('fs');var path=require(_0x48cb('0x6'));var rimraf=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x5907b3,_0x2fd844){return _0x5907b3[_0x48cb('0x9')](_0x48cb('0xa'),attributes,{'tableName':_0x48cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55c457,_0x4f8a75,_0x16bd9b){if(_0x55c457[_0x48cb('0xc')](_0x48cb('0xd'))){_0x55c457[_0x48cb('0xe')]=moment()[_0x48cb('0xf')](_0x48cb('0x10'));}if(_0x55c457[_0x48cb('0xc')](_0x48cb('0x11'))){_0x55c457[_0x48cb('0x12')]=moment()[_0x48cb('0xf')](_0x48cb('0x10'));}_0x16bd9b(null,_0x55c457);}}});}; \ No newline at end of file +var _0x4be0=['changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','request-promise','path','rimraf','./squareProject.attributes','define','SquareProject'];(function(_0xca78c8,_0x2a441f){var _0x2c0fe5=function(_0x1b8585){while(--_0x1b8585){_0xca78c8['push'](_0xca78c8['shift']());}};_0x2c0fe5(++_0x2a441f);}(_0x4be0,0x196));var _0x04be=function(_0x552a5b,_0x374e8e){_0x552a5b=_0x552a5b-0x0;var _0x6e2061=_0x4be0[_0x552a5b];return _0x6e2061;};'use strict';var _=require(_0x04be('0x0'));var util=require(_0x04be('0x1'));var logger=require(_0x04be('0x2'))(_0x04be('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x04be('0x4'));var fs=require('fs');var path=require(_0x04be('0x5'));var rimraf=require(_0x04be('0x6'));var config=require('../../config/environment');var attributes=require(_0x04be('0x7'));module['exports']=function(_0x11a2c6,_0x3ea5a9){return _0x11a2c6[_0x04be('0x8')](_0x04be('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x211365,_0x25c254,_0x5b9514){if(_0x211365[_0x04be('0xa')]('preproduction')){_0x211365[_0x04be('0xb')]=moment()[_0x04be('0xc')](_0x04be('0xd'));}if(_0x211365[_0x04be('0xa')](_0x04be('0xe'))){_0x211365[_0x04be('0xf')]=moment()[_0x04be('0xc')](_0x04be('0xd'));}_0x5b9514(null,_0x211365);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 7c416eb..ae7bc92 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 _0xa1ab=['then','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','include','map','model','info','debug','stringify','catch','error','message','ShowSquareProject'];(function(_0x18ec41,_0x1471e8){var _0x43a8c0=function(_0x5569d6){while(--_0x5569d6){_0x18ec41['push'](_0x18ec41['shift']());}};_0x43a8c0(++_0x1471e8);}(_0xa1ab,0x10f));var _0xba1a=function(_0xdd2f61,_0x4f2aff){_0xdd2f61=_0xdd2f61-0x0;var _0x4b34bf=_0xa1ab[_0xdd2f61];return _0x4b34bf;};'use strict';var _=require(_0xba1a('0x0'));var Redis=require('ioredis');var db=require(_0xba1a('0x1'))['db'];var logger=require(_0xba1a('0x2'))(_0xba1a('0x3'));var config=require(_0xba1a('0x4'));config[_0xba1a('0x5')]=_['defaults'](config[_0xba1a('0x5')],{'host':_0xba1a('0x6'),'port':0x18eb});var socket=require(_0xba1a('0x7'))(new Redis(config['redis']));require('./squareProject.socket')[_0xba1a('0x8')](socket);exports[_0xba1a('0x9')]=function(_0x1d59fe){var _0x39d143=this;return new Promise(function(_0x1a907d,_0x50d4c8){return db[_0xba1a('0xa')][_0xba1a('0xb')]({'raw':_0x1d59fe[_0xba1a('0xc')]?_0x1d59fe[_0xba1a('0xc')][_0xba1a('0xd')]===undefined?!![]:![]:!![],'where':_0x1d59fe[_0xba1a('0xc')]?_0x1d59fe[_0xba1a('0xc')]['where']||null:null,'attributes':_0x1d59fe[_0xba1a('0xc')]?_0x1d59fe['options'][_0xba1a('0xe')]||null:null,'limit':_0x1d59fe[_0xba1a('0xc')]?_0x1d59fe[_0xba1a('0xc')][_0xba1a('0xf')]||null:null,'include':_0x1d59fe['options']?_0x1d59fe[_0xba1a('0xc')][_0xba1a('0x10')]?_[_0xba1a('0x11')](_0x1d59fe[_0xba1a('0xc')][_0xba1a('0x10')],function(_0x412564){return{'model':db[_0x412564[_0xba1a('0x12')]],'as':_0x412564['as'],'attributes':_0x412564[_0xba1a('0xe')],'include':_0x412564[_0xba1a('0x10')]?_['map'](_0x412564[_0xba1a('0x10')],function(_0x16d351){return{'model':db[_0x16d351[_0xba1a('0x12')]],'as':_0x16d351['as'],'attributes':_0x16d351['attributes'],'include':_0x16d351['include']?_[_0xba1a('0x11')](_0x16d351[_0xba1a('0x10')],function(_0x3330ad){return{'model':db[_0x3330ad[_0xba1a('0x12')]],'as':_0x3330ad['as'],'attributes':_0x3330ad[_0xba1a('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35459a){logger[_0xba1a('0x13')](_0xba1a('0x9'),_0x1d59fe);logger[_0xba1a('0x14')](_0xba1a('0x9'),_0x1d59fe,JSON[_0xba1a('0x15')](_0x35459a));_0x1a907d(_0x35459a);})[_0xba1a('0x16')](function(_0x40141c){logger[_0xba1a('0x17')]('GetSquareProjects',_0x40141c[_0xba1a('0x18')],_0x1d59fe);_0x50d4c8(_0x39d143[_0xba1a('0x17')](0x1f4,_0x40141c[_0xba1a('0x18')]));});});};exports[_0xba1a('0x19')]=function(_0x1d5971){var _0x5461ce=this;return new Promise(function(_0x54473f,_0x1f1337){return db[_0xba1a('0xa')]['find']({'raw':_0x1d5971[_0xba1a('0xc')]?_0x1d5971['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d5971[_0xba1a('0xc')]?_0x1d5971[_0xba1a('0xc')]['where']||null:null,'attributes':_0x1d5971[_0xba1a('0xc')]?_0x1d5971[_0xba1a('0xc')][_0xba1a('0xe')]||null:null,'include':_0x1d5971[_0xba1a('0xc')]?_0x1d5971['options']['include']?_[_0xba1a('0x11')](_0x1d5971['options'][_0xba1a('0x10')],function(_0x1b6b05){return{'model':db[_0x1b6b05[_0xba1a('0x12')]],'as':_0x1b6b05['as'],'attributes':_0x1b6b05[_0xba1a('0xe')],'include':_0x1b6b05['include']?_[_0xba1a('0x11')](_0x1b6b05[_0xba1a('0x10')],function(_0x1f9333){return{'model':db[_0x1f9333[_0xba1a('0x12')]],'as':_0x1f9333['as'],'attributes':_0x1f9333[_0xba1a('0xe')],'include':_0x1f9333[_0xba1a('0x10')]?_['map'](_0x1f9333[_0xba1a('0x10')],function(_0x35b9ad){return{'model':db[_0x35b9ad[_0xba1a('0x12')]],'as':_0x35b9ad['as'],'attributes':_0x35b9ad[_0xba1a('0xe')]};}):[]};}):[]};}):[]:[]})[_0xba1a('0x1a')](function(_0x4da27c){logger[_0xba1a('0x13')](_0xba1a('0x19'),_0x1d5971);logger[_0xba1a('0x14')](_0xba1a('0x19'),_0x1d5971,JSON[_0xba1a('0x15')](_0x4da27c));_0x54473f(_0x4da27c);})[_0xba1a('0x16')](function(_0x126b55){logger[_0xba1a('0x17')]('ShowSquareProject',_0x126b55[_0xba1a('0x18')],_0x1d5971);_0x1f1337(_0x5461ce[_0xba1a('0x17')](0x1f4,_0x126b55[_0xba1a('0x18')]));});});}; \ No newline at end of file +var _0x1eee=['findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject'];(function(_0x12f9e3,_0x3fadc1){var _0x2de0c8=function(_0x31b5c5){while(--_0x31b5c5){_0x12f9e3['push'](_0x12f9e3['shift']());}};_0x2de0c8(++_0x3fadc1);}(_0x1eee,0xf1));var _0xe1ee=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x1eee[_0x365be9];return _0x185c12;};'use strict';var _=require(_0xe1ee('0x0'));var Redis=require(_0xe1ee('0x1'));var db=require(_0xe1ee('0x2'))['db'];var logger=require(_0xe1ee('0x3'))('rpc');var config=require('../../config/environment');config[_0xe1ee('0x4')]=_['defaults'](config[_0xe1ee('0x4')],{'host':_0xe1ee('0x5'),'port':0x18eb});var socket=require(_0xe1ee('0x6'))(new Redis(config['redis']));require(_0xe1ee('0x7'))[_0xe1ee('0x8')](socket);exports[_0xe1ee('0x9')]=function(_0x5abb09){var _0x16c991=this;return new Promise(function(_0x4d8bab,_0x56b441){return db[_0xe1ee('0xa')][_0xe1ee('0xb')]({'raw':_0x5abb09[_0xe1ee('0xc')]?_0x5abb09['options'][_0xe1ee('0xd')]===undefined?!![]:![]:!![],'where':_0x5abb09['options']?_0x5abb09['options'][_0xe1ee('0xe')]||null:null,'attributes':_0x5abb09['options']?_0x5abb09[_0xe1ee('0xc')][_0xe1ee('0xf')]||null:null,'limit':_0x5abb09[_0xe1ee('0xc')]?_0x5abb09[_0xe1ee('0xc')][_0xe1ee('0x10')]||null:null,'include':_0x5abb09[_0xe1ee('0xc')]?_0x5abb09[_0xe1ee('0xc')][_0xe1ee('0x11')]?_[_0xe1ee('0x12')](_0x5abb09[_0xe1ee('0xc')][_0xe1ee('0x11')],function(_0x3e5323){return{'model':db[_0x3e5323[_0xe1ee('0x13')]],'as':_0x3e5323['as'],'attributes':_0x3e5323[_0xe1ee('0xf')],'include':_0x3e5323[_0xe1ee('0x11')]?_[_0xe1ee('0x12')](_0x3e5323[_0xe1ee('0x11')],function(_0x36788d){return{'model':db[_0x36788d[_0xe1ee('0x13')]],'as':_0x36788d['as'],'attributes':_0x36788d['attributes'],'include':_0x36788d[_0xe1ee('0x11')]?_[_0xe1ee('0x12')](_0x36788d['include'],function(_0x14ad53){return{'model':db[_0x14ad53[_0xe1ee('0x13')]],'as':_0x14ad53['as'],'attributes':_0x14ad53['attributes']};}):[]};}):[]};}):[]:[]})[_0xe1ee('0x14')](function(_0xc701bf){logger[_0xe1ee('0x15')](_0xe1ee('0x9'),_0x5abb09);logger['debug'](_0xe1ee('0x9'),_0x5abb09,JSON[_0xe1ee('0x16')](_0xc701bf));_0x4d8bab(_0xc701bf);})[_0xe1ee('0x17')](function(_0x3830df){logger[_0xe1ee('0x18')]('GetSquareProjects',_0x3830df[_0xe1ee('0x19')],_0x5abb09);_0x56b441(_0x16c991[_0xe1ee('0x18')](0x1f4,_0x3830df[_0xe1ee('0x19')]));});});};exports[_0xe1ee('0x1a')]=function(_0x4b5aaf){var _0x3fee7d=this;return new Promise(function(_0x44569e,_0x176a3a){return db[_0xe1ee('0xa')][_0xe1ee('0x1b')]({'raw':_0x4b5aaf['options']?_0x4b5aaf[_0xe1ee('0xc')][_0xe1ee('0xd')]===undefined?!![]:![]:!![],'where':_0x4b5aaf[_0xe1ee('0xc')]?_0x4b5aaf[_0xe1ee('0xc')][_0xe1ee('0xe')]||null:null,'attributes':_0x4b5aaf['options']?_0x4b5aaf[_0xe1ee('0xc')][_0xe1ee('0xf')]||null:null,'include':_0x4b5aaf[_0xe1ee('0xc')]?_0x4b5aaf[_0xe1ee('0xc')]['include']?_['map'](_0x4b5aaf[_0xe1ee('0xc')]['include'],function(_0xf96e88){return{'model':db[_0xf96e88[_0xe1ee('0x13')]],'as':_0xf96e88['as'],'attributes':_0xf96e88[_0xe1ee('0xf')],'include':_0xf96e88[_0xe1ee('0x11')]?_['map'](_0xf96e88[_0xe1ee('0x11')],function(_0x480229){return{'model':db[_0x480229[_0xe1ee('0x13')]],'as':_0x480229['as'],'attributes':_0x480229['attributes'],'include':_0x480229[_0xe1ee('0x11')]?_[_0xe1ee('0x12')](_0x480229[_0xe1ee('0x11')],function(_0x22f2ed){return{'model':db[_0x22f2ed[_0xe1ee('0x13')]],'as':_0x22f2ed['as'],'attributes':_0x22f2ed[_0xe1ee('0xf')]};}):[]};}):[]};}):[]:[]})[_0xe1ee('0x14')](function(_0x1691d2){logger['info'](_0xe1ee('0x1a'),_0x4b5aaf);logger['debug'](_0xe1ee('0x1a'),_0x4b5aaf,JSON[_0xe1ee('0x16')](_0x1691d2));_0x44569e(_0x1691d2);})[_0xe1ee('0x17')](function(_0x1a0931){logger[_0xe1ee('0x18')](_0xe1ee('0x1a'),_0x1a0931[_0xe1ee('0x19')],_0x4b5aaf);_0x176a3a(_0x3fee7d[_0xe1ee('0x18')](0x1f4,_0x1a0931['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 328faf1..8ac7fb0 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 _0x1008=['squareProject:','./squareProject.events','remove','update','emit','removeListener','length'];(function(_0x502417,_0x3b4a19){var _0x32e1f8=function(_0x5d2b6d){while(--_0x5d2b6d){_0x502417['push'](_0x502417['shift']());}};_0x32e1f8(++_0x3b4a19);}(_0x1008,0x143));var _0x8100=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x1008[_0x2cfb48];return _0xc4594f;};'use strict';var SquareProjectEvents=require(_0x8100('0x0'));var events=['save',_0x8100('0x1'),_0x8100('0x2')];function createListener(_0x2b987c,_0x3f4d99){return function(_0x4ee0d0){_0x3f4d99[_0x8100('0x3')](_0x2b987c,_0x4ee0d0);};}function removeListener(_0x4964fa,_0x26e1f8){return function(){SquareProjectEvents[_0x8100('0x4')](_0x4964fa,_0x26e1f8);};}exports['register']=function(_0x5f50a4){for(var _0x1c4883=0x0,_0x125621=events[_0x8100('0x5')];_0x1c4883<_0x125621;_0x1c4883++){var _0x9dd883=events[_0x1c4883];var _0x517a9a=createListener(_0x8100('0x6')+_0x9dd883,_0x5f50a4);SquareProjectEvents['on'](_0x9dd883,_0x517a9a);}}; \ No newline at end of file +var _0x1555=['save','update','emit','removeListener','length','squareProject:','./squareProject.events'];(function(_0x3b0c93,_0x1d4e5d){var _0x14fd4a=function(_0x22ed7c){while(--_0x22ed7c){_0x3b0c93['push'](_0x3b0c93['shift']());}};_0x14fd4a(++_0x1d4e5d);}(_0x1555,0x1aa));var _0x5155=function(_0x4a3631,_0x1a5bc5){_0x4a3631=_0x4a3631-0x0;var _0x37d60e=_0x1555[_0x4a3631];return _0x37d60e;};'use strict';var SquareProjectEvents=require(_0x5155('0x0'));var events=[_0x5155('0x1'),'remove',_0x5155('0x2')];function createListener(_0x3fc57f,_0x32a685){return function(_0x1f7248){_0x32a685[_0x5155('0x3')](_0x3fc57f,_0x1f7248);};}function removeListener(_0x1b3cca,_0x55cb9f){return function(){SquareProjectEvents[_0x5155('0x4')](_0x1b3cca,_0x55cb9f);};}exports['register']=function(_0x36a6b9){for(var _0x52073a=0x0,_0x70971c=events[_0x5155('0x5')];_0x52073a<_0x70971c;_0x52073a++){var _0x248517=events[_0x52073a];var _0x48c174=createListener(_0x5155('0x6')+_0x248517,_0x36a6b9);SquareProjectEvents['on'](_0x248517,_0x48c174);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 3103b37..0d590db 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4a01b0,_0x27961b){var _0x585fb6=function(_0x375edb){while(--_0x375edb){_0x4a01b0['push'](_0x4a01b0['shift']());}};_0x585fb6(++_0x27961b);}(_0x326f,0xd1));var _0xf326=function(_0x400446,_0x41410e){_0x400446=_0x400446-0x0;var _0xb135df=_0x326f[_0x400446];return _0xb135df;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x508e48,_0x1d1314){var _0x38e747=function(_0x458a0a){while(--_0x458a0a){_0x508e48['push'](_0x508e48['shift']());}};_0x38e747(++_0x1d1314);}(_0x1261,0x144));var _0x1126=function(_0x5dbd4b,_0x2fb8fe){_0x5dbd4b=_0x5dbd4b-0x0;var _0x5d2723=_0x1261[_0x5dbd4b];return _0x5d2723;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f0325bd..e49c823 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 _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x482ad9,_0x4aa818){var _0x53f7fa=function(_0x397651){while(--_0x397651){_0x482ad9['push'](_0x482ad9['shift']());}};_0x53f7fa(++_0x4aa818);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4be6f4,_0x385b23){_0x4be6f4=_0x4be6f4-0x0;var _0x3e9098=_0xeec6[_0x4be6f4];return _0x3e9098;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0x81bd=['STRING','VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports'];(function(_0x740c7a,_0x28f13a){var _0x171e6f=function(_0x54f656){while(--_0x54f656){_0x740c7a['push'](_0x740c7a['shift']());}};_0x171e6f(++_0x28f13a);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x81bd[_0x1e9424];return _0x1bd96c;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'uniqueid':{'type':Sequelize[_0xd81b('0x2')]},'callerid':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize[_0xd81b('0x2')]},'context':{'type':Sequelize[_0xd81b('0x2')]},'extension':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd81b('0x2')]},'dnid':{'type':Sequelize[_0xd81b('0x2')]},'projectName':{'type':Sequelize[_0xd81b('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xd81b('0x2')]},'savePath':{'type':Sequelize[_0xd81b('0x2')]},'format':{'type':Sequelize[_0xd81b('0x3')],'get':function(){var _0x562084='';var _0x5e14e8=this[_0xd81b('0x4')]('savePath');if(_0x5e14e8){_0x562084=_0x5e14e8[_0xd81b('0x5')](_0x5e14e8[_0xd81b('0x6')]('.'));}return _0x562084;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 166c769..28d22cd 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 _0xe3fa=['Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareRecording','include','findAll','rows','catch','show','params','create','body','update','find','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','secrets'];(function(_0x261702,_0x28819f){var _0x8e8442=function(_0x17c913){while(--_0x17c913){_0x261702['push'](_0x261702['shift']());}};_0x8e8442(++_0x28819f);}(_0xe3fa,0x1e8));var _0xae3f=function(_0x4a3ac9,_0x5d6809){_0x4a3ac9=_0x4a3ac9-0x0;var _0x4d7f5b=_0xe3fa[_0x4a3ac9];return _0x4d7f5b;};'use strict';var emlformat=require(_0xae3f('0x0'));var rimraf=require(_0xae3f('0x1'));var zipdir=require(_0xae3f('0x2'));var jsonpatch=require(_0xae3f('0x3'));var rp=require(_0xae3f('0x4'));var moment=require(_0xae3f('0x5'));var BPromise=require(_0xae3f('0x6'));var Mustache=require(_0xae3f('0x7'));var util=require(_0xae3f('0x8'));var path=require(_0xae3f('0x9'));var sox=require(_0xae3f('0xa'));var csv=require(_0xae3f('0xb'));var ejs=require(_0xae3f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae3f('0xd'));var squel=require('squel');var crypto=require(_0xae3f('0xe'));var jsforce=require(_0xae3f('0xf'));var deskjs=require(_0xae3f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xae3f('0x11'));var Papa=require(_0xae3f('0x12'));var Redis=require('ioredis');var authService=require(_0xae3f('0x13'));var qs=require(_0xae3f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae3f('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xae3f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xae3f('0x17'))['db'];function respondWithStatusCode(_0x2e0ce6,_0x4171a5){_0x4171a5=_0x4171a5||0xcc;return function(_0x4a496f){if(_0x4a496f){return _0x2e0ce6[_0xae3f('0x18')](_0x4171a5);}return _0x2e0ce6[_0xae3f('0x19')](_0x4171a5)[_0xae3f('0x1a')]();};}function respondWithResult(_0x25d4f2,_0x266617){_0x266617=_0x266617||0xc8;return function(_0x99b276){if(_0x99b276){return _0x25d4f2[_0xae3f('0x19')](_0x266617)['json'](_0x99b276);}};}function respondWithFilteredResult(_0x1ec919,_0x388528){return function(_0xdea99b){if(_0xdea99b){var _0x4c2022=typeof _0x388528[_0xae3f('0x1b')]==='undefined'&&typeof _0x388528[_0xae3f('0x1c')]==='undefined';var _0x2dd11f=_0xdea99b[_0xae3f('0x1d')];var _0x305400=_0x4c2022?0x0:_0x388528[_0xae3f('0x1b')];var _0x245203=_0x4c2022?_0xdea99b[_0xae3f('0x1d')]:_0x388528[_0xae3f('0x1b')]+_0x388528[_0xae3f('0x1c')];var _0x4bf3c0;if(_0x245203>=_0x2dd11f){_0x245203=_0x2dd11f;_0x4bf3c0=0xc8;}else{_0x4bf3c0=0xce;}_0x1ec919[_0xae3f('0x19')](_0x4bf3c0);return _0x1ec919[_0xae3f('0x1e')](_0xae3f('0x1f'),_0x305400+'-'+_0x245203+'/'+_0x2dd11f)[_0xae3f('0x20')](_0xdea99b);}return null;};}function patchUpdates(_0x37fc17){return function(_0x2a789e){try{jsonpatch[_0xae3f('0x21')](_0x2a789e,_0x37fc17,!![]);}catch(_0x58a41e){return BPromise[_0xae3f('0x22')](_0x58a41e);}return _0x2a789e['save']();};}function saveUpdates(_0x489184,_0x132a5f){return function(_0x27739e){if(_0x27739e){return _0x27739e['update'](_0x489184)[_0xae3f('0x23')](function(_0x3ea27e){return _0x3ea27e;});}return null;};}function removeEntity(_0x52428e,_0x515cae){return function(_0x541b43){if(_0x541b43){return _0x541b43[_0xae3f('0x24')]()[_0xae3f('0x23')](function(){_0x52428e[_0xae3f('0x19')](0xcc)[_0xae3f('0x1a')]();});}};}function handleEntityNotFound(_0x414f7b,_0x43fa3d){return function(_0x46b65a){if(!_0x46b65a){_0x414f7b[_0xae3f('0x18')](0x194);}return _0x46b65a;};}function handleError(_0xd72ccc,_0x299bc0){_0x299bc0=_0x299bc0||0x1f4;return function(_0x38d3d4){logger[_0xae3f('0x25')](_0x38d3d4[_0xae3f('0x26')]);if(_0x38d3d4['name']){delete _0x38d3d4[_0xae3f('0x27')];}_0xd72ccc[_0xae3f('0x19')](_0x299bc0)[_0xae3f('0x28')](_0x38d3d4);};}exports[_0xae3f('0x29')]=function(_0x2a6832,_0x522fa5){var _0x438700={},_0x265072={},_0x12c33c={'count':0x0,'rows':[]};var _0x567673=_['map'](db['SquareRecording'][_0xae3f('0x2a')],function(_0xf985a8){return{'name':_0xf985a8['fieldName'],'type':_0xf985a8[_0xae3f('0x2b')][_0xae3f('0x2c')]};});_0x265072[_0xae3f('0x2d')]=_['map'](_0x567673,_0xae3f('0x27'));_0x265072[_0xae3f('0x2e')]=_[_0xae3f('0x2f')](_0x2a6832[_0xae3f('0x2e')]);_0x265072[_0xae3f('0x30')]=_['intersection'](_0x265072[_0xae3f('0x2d')],_0x265072[_0xae3f('0x2e')]);_0x438700[_0xae3f('0x31')]=_[_0xae3f('0x32')](_0x265072[_0xae3f('0x2d')],qs[_0xae3f('0x33')](_0x2a6832[_0xae3f('0x2e')][_0xae3f('0x33')]));_0x438700[_0xae3f('0x31')]=_0x438700[_0xae3f('0x31')][_0xae3f('0x34')]?_0x438700[_0xae3f('0x31')]:_0x265072['model'];if(!_0x2a6832['query']['hasOwnProperty'](_0xae3f('0x35'))){_0x438700['limit']=qs[_0xae3f('0x1c')](_0x2a6832['query']['limit']);_0x438700[_0xae3f('0x1b')]=qs['offset'](_0x2a6832[_0xae3f('0x2e')]['offset']);}_0x438700[_0xae3f('0x36')]=qs[_0xae3f('0x37')](_0x2a6832[_0xae3f('0x2e')][_0xae3f('0x37')]);_0x438700[_0xae3f('0x38')]=qs[_0xae3f('0x30')](_[_0xae3f('0x39')](_0x2a6832[_0xae3f('0x2e')],_0x265072[_0xae3f('0x30')]),_0x567673);if(_0x2a6832[_0xae3f('0x2e')][_0xae3f('0x3a')]){_0x438700['where']=_[_0xae3f('0x3b')](_0x438700['where'],{'$or':_['map'](_0x567673,function(_0x4d6833){if(_0x4d6833['type']!==_0xae3f('0x3c')){var _0x11e9bc={};_0x11e9bc[_0x4d6833['name']]={'$like':'%'+_0x2a6832[_0xae3f('0x2e')][_0xae3f('0x3a')]+'%'};return _0x11e9bc;}})});}_0x438700=_['merge']({},_0x438700,_0x2a6832[_0xae3f('0x3d')]);var _0xa9306b={'where':_0x438700[_0xae3f('0x38')]};return db[_0xae3f('0x3e')][_0xae3f('0x1d')](_0xa9306b)[_0xae3f('0x23')](function(_0x26149e){_0x12c33c[_0xae3f('0x1d')]=_0x26149e;if(_0x2a6832[_0xae3f('0x2e')]['includeAll']){_0x438700[_0xae3f('0x3f')]=[{'all':!![]}];}return db[_0xae3f('0x3e')][_0xae3f('0x40')](_0x438700);})[_0xae3f('0x23')](function(_0x2274c9){_0x12c33c[_0xae3f('0x41')]=_0x2274c9;return _0x12c33c;})[_0xae3f('0x23')](respondWithFilteredResult(_0x522fa5,_0x438700))[_0xae3f('0x42')](handleError(_0x522fa5,null));};exports[_0xae3f('0x43')]=function(_0x237ffc,_0x3e8d0e){var _0x199c91={'raw':!![],'where':{'id':_0x237ffc[_0xae3f('0x44')]['id']}},_0x568d41={};_0x568d41[_0xae3f('0x2d')]=_['keys'](db[_0xae3f('0x3e')]['rawAttributes']);_0x568d41['query']=_['keys'](_0x237ffc[_0xae3f('0x2e')]);_0x568d41['filters']=_['intersection'](_0x568d41[_0xae3f('0x2d')],_0x568d41[_0xae3f('0x2e')]);_0x199c91[_0xae3f('0x31')]=_['intersection'](_0x568d41[_0xae3f('0x2d')],qs[_0xae3f('0x33')](_0x237ffc[_0xae3f('0x2e')][_0xae3f('0x33')]));_0x199c91['attributes']=_0x199c91[_0xae3f('0x31')]['length']?_0x199c91[_0xae3f('0x31')]:_0x568d41[_0xae3f('0x2d')];if(_0x237ffc[_0xae3f('0x2e')]['includeAll']){_0x199c91[_0xae3f('0x3f')]=[{'all':!![]}];}_0x199c91=_[_0xae3f('0x3b')]({},_0x199c91,_0x237ffc[_0xae3f('0x3d')]);return db[_0xae3f('0x3e')]['find'](_0x199c91)['then'](handleEntityNotFound(_0x3e8d0e,null))[_0xae3f('0x23')](respondWithResult(_0x3e8d0e,null))[_0xae3f('0x42')](handleError(_0x3e8d0e,null));};exports['create']=function(_0x5f15cf,_0x142f08){return db[_0xae3f('0x3e')][_0xae3f('0x45')](_0x5f15cf[_0xae3f('0x46')],{})[_0xae3f('0x23')](respondWithResult(_0x142f08,0xc9))[_0xae3f('0x42')](handleError(_0x142f08,null));};exports[_0xae3f('0x47')]=function(_0x3a3812,_0x2e50cc){if(_0x3a3812[_0xae3f('0x46')]['id']){delete _0x3a3812[_0xae3f('0x46')]['id'];}return db[_0xae3f('0x3e')][_0xae3f('0x48')]({'where':{'id':_0x3a3812[_0xae3f('0x44')]['id']}})[_0xae3f('0x23')](handleEntityNotFound(_0x2e50cc,null))['then'](saveUpdates(_0x3a3812['body'],null))['then'](respondWithResult(_0x2e50cc,null))[_0xae3f('0x42')](handleError(_0x2e50cc,null));};exports[_0xae3f('0x49')]=function(_0x4d751d,_0x3fef96,_0x2de291){var _0x5cfa40=require(_0xae3f('0x4a'));var _0x328ad5=![];var _0x5eb716={};if(_0x4d751d[_0xae3f('0x2e')][_0xae3f('0x2b')]&&_0x4d751d['query'][_0xae3f('0x2b')]===_0xae3f('0x4b')){_0x5eb716[_0xae3f('0x4b')]=_0x4d751d[_0xae3f('0x44')]['id'];}else{_0x5eb716['id']=_0x4d751d[_0xae3f('0x44')]['id'];}return db[_0xae3f('0x3e')][_0xae3f('0x48')]({'where':_0x5eb716,'attributes':['id','savePath',_0xae3f('0x4c')],'raw':!![]})[_0xae3f('0x23')](handleEntityNotFound(_0x3fef96,null))[_0xae3f('0x23')](function(_0x459c3d){if(_0x459c3d){var _0x2fd8b0=_0x459c3d[_0xae3f('0x4d')];var _0x42afc4=util[_0xae3f('0x4e')](_0xae3f('0x4f'),_0x2fd8b0);if(fs[_0xae3f('0x50')](_0x42afc4)){_0x328ad5=!![];return _0x5cfa40['decryptFile'](_0x42afc4,_0x2fd8b0,config[_0xae3f('0x51')]['recording'])[_0xae3f('0x23')](function(){return _0x459c3d;});}return _0x459c3d;}})[_0xae3f('0x23')](function(_0x2e58bc){if(_0x2e58bc){var _0x30af40=_0x2e58bc[_0xae3f('0x4d')];if(!fs['existsSync'](_0x30af40)){throw new db[(_0xae3f('0x52'))][(_0xae3f('0x53'))](_0xae3f('0x54'));}if(_0x2e58bc[_0xae3f('0x4c')]){return _0x3fef96[_0xae3f('0x49')](_0x30af40,_0x2e58bc[_0xae3f('0x4c')]+path['extname'](_0x30af40),function(){if(_0x328ad5){fs[_0xae3f('0x55')](_0x30af40);}});}else{return _0x3fef96[_0xae3f('0x49')](_0x30af40,function(_0x1a8f72){if(_0x328ad5){fs[_0xae3f('0x55')](_0x30af40);}});}}})['catch'](function(_0x1b99d5){if(_0x1b99d5[_0xae3f('0x56')]===_0xae3f('0x54')){_0x3fef96[_0xae3f('0x19')](0x194)[_0xae3f('0x28')](_0xae3f('0x57'));}else{return handleError(_0x3fef96,null);}});};exports[_0xae3f('0x24')]=function(_0x1259cd,_0xdeebfc){return db[_0xae3f('0x3e')]['find']({'where':{'id':_0x1259cd[_0xae3f('0x44')]['id']}})['then'](function(_0xb436a){if(_[_0xae3f('0x58')](_0xb436a)){throw new ReferenceError(_0xae3f('0x59'));}return _0xb436a;})[_0xae3f('0x23')](function(_0x287c32){var _0x2a3942=_0x287c32[_0xae3f('0x4d')];logger[_0xae3f('0x5a')](_0xae3f('0x5b'),_0x2a3942);if(!_['isNil'](_0x287c32[_0xae3f('0x4d')])&&fs['existsSync'](_0x2a3942)){logger[_0xae3f('0x5a')](_0xae3f('0x5c')+_0x2a3942+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xae3f('0x5d')](_0x2a3942);}_0x2a3942=_0x2a3942+'.cypher';if(!_[_0xae3f('0x58')](_0x287c32['savePath'])&&fs[_0xae3f('0x50')](_0x2a3942)){logger[_0xae3f('0x5a')](_0xae3f('0x5c')+_0x2a3942+_0xae3f('0x5e'));fs[_0xae3f('0x5d')](_0x2a3942);}return _0x287c32;})[_0xae3f('0x23')](function(_0x335ad2){if(!_0x335ad2)throw new InternalError();return _0x335ad2[_0xae3f('0x24')]();})[_0xae3f('0x23')](function(){_0xdeebfc[_0xae3f('0x19')](0xcc)['end']();})[_0xae3f('0x42')](handleError(_0xdeebfc,null));}; \ No newline at end of file +var _0x2418=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x31af51,_0x2c1dde){var _0x51516b=function(_0x2066ae){while(--_0x2066ae){_0x31af51['push'](_0x31af51['shift']());}};_0x51516b(++_0x2c1dde);}(_0x2418,0x104));var _0x8241=function(_0x174ba4,_0x5ccde1){_0x174ba4=_0x174ba4-0x0;var _0x14a321=_0x2418[_0x174ba4];return _0x14a321;};'use strict';var emlformat=require(_0x8241('0x0'));var rimraf=require(_0x8241('0x1'));var zipdir=require(_0x8241('0x2'));var jsonpatch=require(_0x8241('0x3'));var rp=require(_0x8241('0x4'));var moment=require(_0x8241('0x5'));var BPromise=require(_0x8241('0x6'));var Mustache=require(_0x8241('0x7'));var util=require('util');var path=require(_0x8241('0x8'));var sox=require(_0x8241('0x9'));var csv=require('to-csv');var ejs=require(_0x8241('0xa'));var fs=require('fs');var fs_extra=require(_0x8241('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8241('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8241('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8241('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8241('0xf'));var hardwareService=require(_0x8241('0x10'));var logger=require(_0x8241('0x11'))(_0x8241('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8241('0x13'))['db'];function respondWithStatusCode(_0x29a8b3,_0x46c715){_0x46c715=_0x46c715||0xcc;return function(_0x140045){if(_0x140045){return _0x29a8b3[_0x8241('0x14')](_0x46c715);}return _0x29a8b3[_0x8241('0x15')](_0x46c715)[_0x8241('0x16')]();};}function respondWithResult(_0x5c56f6,_0x1a6cdb){_0x1a6cdb=_0x1a6cdb||0xc8;return function(_0x22acc1){if(_0x22acc1){return _0x5c56f6[_0x8241('0x15')](_0x1a6cdb)[_0x8241('0x17')](_0x22acc1);}};}function respondWithFilteredResult(_0x51bc78,_0xae77da){return function(_0x5ef982){if(_0x5ef982){var _0x4bd8ee=typeof _0xae77da[_0x8241('0x18')]===_0x8241('0x19')&&typeof _0xae77da[_0x8241('0x1a')]===_0x8241('0x19');var _0x1eb849=_0x5ef982[_0x8241('0x1b')];var _0x3b7b72=_0x4bd8ee?0x0:_0xae77da[_0x8241('0x18')];var _0x3ed8cd=_0x4bd8ee?_0x5ef982[_0x8241('0x1b')]:_0xae77da[_0x8241('0x18')]+_0xae77da[_0x8241('0x1a')];var _0x1a8b6f;if(_0x3ed8cd>=_0x1eb849){_0x3ed8cd=_0x1eb849;_0x1a8b6f=0xc8;}else{_0x1a8b6f=0xce;}_0x51bc78[_0x8241('0x15')](_0x1a8b6f);return _0x51bc78[_0x8241('0x1c')]('Content-Range',_0x3b7b72+'-'+_0x3ed8cd+'/'+_0x1eb849)['json'](_0x5ef982);}return null;};}function patchUpdates(_0x2e5588){return function(_0x342f39){try{jsonpatch[_0x8241('0x1d')](_0x342f39,_0x2e5588,!![]);}catch(_0x37093a){return BPromise[_0x8241('0x1e')](_0x37093a);}return _0x342f39[_0x8241('0x1f')]();};}function saveUpdates(_0x183b7e,_0x265826){return function(_0x78c883){if(_0x78c883){return _0x78c883[_0x8241('0x20')](_0x183b7e)[_0x8241('0x21')](function(_0x36d135){return _0x36d135;});}return null;};}function removeEntity(_0x3df6a9,_0x21faaa){return function(_0x237fe4){if(_0x237fe4){return _0x237fe4[_0x8241('0x22')]()['then'](function(){_0x3df6a9[_0x8241('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x159ac2,_0x17f9de){return function(_0x46c4c5){if(!_0x46c4c5){_0x159ac2['sendStatus'](0x194);}return _0x46c4c5;};}function handleError(_0x32eab8,_0x14d8d2){_0x14d8d2=_0x14d8d2||0x1f4;return function(_0x253675){logger[_0x8241('0x23')](_0x253675[_0x8241('0x24')]);if(_0x253675['name']){delete _0x253675['name'];}_0x32eab8[_0x8241('0x15')](_0x14d8d2)[_0x8241('0x25')](_0x253675);};}exports['index']=function(_0x4259a9,_0x46bb87){var _0x21b0f6={},_0x45dafa={},_0xba4edc={'count':0x0,'rows':[]};var _0x404c23=_[_0x8241('0x26')](db[_0x8241('0x27')][_0x8241('0x28')],function(_0x1067c8){return{'name':_0x1067c8[_0x8241('0x29')],'type':_0x1067c8[_0x8241('0x2a')][_0x8241('0x2b')]};});_0x45dafa[_0x8241('0x2c')]=_[_0x8241('0x26')](_0x404c23,_0x8241('0x2d'));_0x45dafa['query']=_[_0x8241('0x2e')](_0x4259a9['query']);_0x45dafa[_0x8241('0x2f')]=_[_0x8241('0x30')](_0x45dafa[_0x8241('0x2c')],_0x45dafa[_0x8241('0x31')]);_0x21b0f6[_0x8241('0x32')]=_[_0x8241('0x30')](_0x45dafa[_0x8241('0x2c')],qs[_0x8241('0x33')](_0x4259a9[_0x8241('0x31')][_0x8241('0x33')]));_0x21b0f6[_0x8241('0x32')]=_0x21b0f6[_0x8241('0x32')][_0x8241('0x34')]?_0x21b0f6[_0x8241('0x32')]:_0x45dafa[_0x8241('0x2c')];if(!_0x4259a9[_0x8241('0x31')][_0x8241('0x35')]('nolimit')){_0x21b0f6[_0x8241('0x1a')]=qs[_0x8241('0x1a')](_0x4259a9[_0x8241('0x31')][_0x8241('0x1a')]);_0x21b0f6[_0x8241('0x18')]=qs[_0x8241('0x18')](_0x4259a9[_0x8241('0x31')][_0x8241('0x18')]);}_0x21b0f6[_0x8241('0x36')]=qs[_0x8241('0x37')](_0x4259a9[_0x8241('0x31')][_0x8241('0x37')]);_0x21b0f6[_0x8241('0x38')]=qs['filters'](_[_0x8241('0x39')](_0x4259a9[_0x8241('0x31')],_0x45dafa[_0x8241('0x2f')]),_0x404c23);if(_0x4259a9[_0x8241('0x31')][_0x8241('0x3a')]){_0x21b0f6['where']=_[_0x8241('0x3b')](_0x21b0f6['where'],{'$or':_[_0x8241('0x26')](_0x404c23,function(_0x5ad083){if(_0x5ad083['type']!==_0x8241('0x3c')){var _0xfe3190={};_0xfe3190[_0x5ad083[_0x8241('0x2d')]]={'$like':'%'+_0x4259a9[_0x8241('0x31')][_0x8241('0x3a')]+'%'};return _0xfe3190;}})});}_0x21b0f6=_[_0x8241('0x3b')]({},_0x21b0f6,_0x4259a9['options']);var _0x2e17d1={'where':_0x21b0f6[_0x8241('0x38')]};return db['SquareRecording'][_0x8241('0x1b')](_0x2e17d1)[_0x8241('0x21')](function(_0x2df5ab){_0xba4edc['count']=_0x2df5ab;if(_0x4259a9[_0x8241('0x31')]['includeAll']){_0x21b0f6[_0x8241('0x3d')]=[{'all':!![]}];}return db[_0x8241('0x27')][_0x8241('0x3e')](_0x21b0f6);})[_0x8241('0x21')](function(_0x58bdcc){_0xba4edc[_0x8241('0x3f')]=_0x58bdcc;return _0xba4edc;})[_0x8241('0x21')](respondWithFilteredResult(_0x46bb87,_0x21b0f6))[_0x8241('0x40')](handleError(_0x46bb87,null));};exports[_0x8241('0x41')]=function(_0x36bd50,_0x4e4557){var _0x2c7e5c={'raw':!![],'where':{'id':_0x36bd50['params']['id']}},_0x354e1b={};_0x354e1b[_0x8241('0x2c')]=_[_0x8241('0x2e')](db[_0x8241('0x27')][_0x8241('0x28')]);_0x354e1b[_0x8241('0x31')]=_['keys'](_0x36bd50[_0x8241('0x31')]);_0x354e1b[_0x8241('0x2f')]=_['intersection'](_0x354e1b[_0x8241('0x2c')],_0x354e1b[_0x8241('0x31')]);_0x2c7e5c[_0x8241('0x32')]=_[_0x8241('0x30')](_0x354e1b[_0x8241('0x2c')],qs[_0x8241('0x33')](_0x36bd50[_0x8241('0x31')][_0x8241('0x33')]));_0x2c7e5c[_0x8241('0x32')]=_0x2c7e5c['attributes'][_0x8241('0x34')]?_0x2c7e5c[_0x8241('0x32')]:_0x354e1b[_0x8241('0x2c')];if(_0x36bd50[_0x8241('0x31')][_0x8241('0x42')]){_0x2c7e5c['include']=[{'all':!![]}];}_0x2c7e5c=_['merge']({},_0x2c7e5c,_0x36bd50[_0x8241('0x43')]);return db['SquareRecording'][_0x8241('0x44')](_0x2c7e5c)[_0x8241('0x21')](handleEntityNotFound(_0x4e4557,null))[_0x8241('0x21')](respondWithResult(_0x4e4557,null))['catch'](handleError(_0x4e4557,null));};exports[_0x8241('0x45')]=function(_0x559798,_0x66015a){return db[_0x8241('0x27')][_0x8241('0x45')](_0x559798['body'],{})[_0x8241('0x21')](respondWithResult(_0x66015a,0xc9))['catch'](handleError(_0x66015a,null));};exports[_0x8241('0x20')]=function(_0x24b730,_0x2a4f62){if(_0x24b730[_0x8241('0x46')]['id']){delete _0x24b730[_0x8241('0x46')]['id'];}return db['SquareRecording'][_0x8241('0x44')]({'where':{'id':_0x24b730[_0x8241('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a4f62,null))[_0x8241('0x21')](saveUpdates(_0x24b730['body'],null))[_0x8241('0x21')](respondWithResult(_0x2a4f62,null))[_0x8241('0x40')](handleError(_0x2a4f62,null));};exports[_0x8241('0x48')]=function(_0x47fe26,_0x56eb59,_0x5ed291){var _0x16dcfe=require(_0x8241('0x49'));var _0x20a963=![];var _0x201dee={};if(_0x47fe26[_0x8241('0x31')][_0x8241('0x2a')]&&_0x47fe26[_0x8241('0x31')][_0x8241('0x2a')]===_0x8241('0x4a')){_0x201dee[_0x8241('0x4a')]=_0x47fe26['params']['id'];}else{_0x201dee['id']=_0x47fe26[_0x8241('0x47')]['id'];}return db[_0x8241('0x27')][_0x8241('0x44')]({'where':_0x201dee,'attributes':['id',_0x8241('0x4b'),'filename'],'raw':!![]})[_0x8241('0x21')](handleEntityNotFound(_0x56eb59,null))[_0x8241('0x21')](function(_0xf41603){if(_0xf41603){var _0x84f124=_0xf41603[_0x8241('0x4b')];var _0x4dabb6=util['format'](_0x8241('0x4c'),_0x84f124);if(fs[_0x8241('0x4d')](_0x4dabb6)){_0x20a963=!![];return _0x16dcfe[_0x8241('0x4e')](_0x4dabb6,_0x84f124,config['secrets'][_0x8241('0x4f')])[_0x8241('0x21')](function(){return _0xf41603;});}return _0xf41603;}})[_0x8241('0x21')](function(_0x20eb0b){if(_0x20eb0b){var _0x34ecd4=_0x20eb0b['savePath'];if(!fs[_0x8241('0x4d')](_0x34ecd4)){throw new db[(_0x8241('0x50'))][(_0x8241('0x51'))]('SquareRecording\x20not\x20found');}if(_0x20eb0b['filename']){return _0x56eb59[_0x8241('0x48')](_0x34ecd4,_0x20eb0b['filename']+path[_0x8241('0x52')](_0x34ecd4),function(){if(_0x20a963){fs['unlink'](_0x34ecd4);}});}else{return _0x56eb59[_0x8241('0x48')](_0x34ecd4,function(_0x3a256c){if(_0x20a963){fs[_0x8241('0x53')](_0x34ecd4);}});}}})[_0x8241('0x40')](function(_0x5cbdd8){if(_0x5cbdd8['message']==='SquareRecording\x20not\x20found'){_0x56eb59['status'](0x194)[_0x8241('0x25')](_0x8241('0x54'));}else{return handleError(_0x56eb59,null);}});};exports['destroy']=function(_0x53a84a,_0x4fdef4){return db[_0x8241('0x27')][_0x8241('0x44')]({'where':{'id':_0x53a84a['params']['id']}})[_0x8241('0x21')](function(_0xfad6a1){if(_[_0x8241('0x55')](_0xfad6a1)){throw new ReferenceError(_0x8241('0x56'));}return _0xfad6a1;})[_0x8241('0x21')](function(_0x3e6df5){var _0x221797=_0x3e6df5[_0x8241('0x4b')];logger[_0x8241('0x57')](_0x8241('0x58'),_0x221797);if(!_[_0x8241('0x55')](_0x3e6df5[_0x8241('0x4b')])&&fs[_0x8241('0x4d')](_0x221797)){logger[_0x8241('0x57')](_0x8241('0x59')+_0x221797+_0x8241('0x5a'));fs[_0x8241('0x5b')](_0x221797);}_0x221797=_0x221797+_0x8241('0x5c');if(!_['isNil'](_0x3e6df5[_0x8241('0x4b')])&&fs[_0x8241('0x4d')](_0x221797)){logger[_0x8241('0x57')](_0x8241('0x59')+_0x221797+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8241('0x5b')](_0x221797);}return _0x3e6df5;})['then'](function(_0x439ec7){if(!_0x439ec7)throw new InternalError();return _0x439ec7[_0x8241('0x22')]();})[_0x8241('0x21')](function(){_0x4fdef4[_0x8241('0x15')](0xcc)[_0x8241('0x16')]();})[_0x8241('0x40')](handleError(_0x4fdef4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f697315..af111dc 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 _0x9bb8=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x1fc41e,_0xee0cda){var _0x2ff76e=function(_0x4ea8ab){while(--_0x4ea8ab){_0x1fc41e['push'](_0x1fc41e['shift']());}};_0x2ff76e(++_0xee0cda);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x89bb('0x0'));var util=require(_0x89bb('0x1'));var logger=require(_0x89bb('0x2'))(_0x89bb('0x3'));var moment=require(_0x89bb('0x4'));var BPromise=require(_0x89bb('0x5'));var rp=require(_0x89bb('0x6'));var fs=require('fs');var path=require(_0x89bb('0x7'));var rimraf=require(_0x89bb('0x8'));var config=require(_0x89bb('0x9'));var attributes=require(_0x89bb('0xa'));module[_0x89bb('0xb')]=function(_0x4e2aeb,_0x4271c5){return _0x4e2aeb[_0x89bb('0xc')](_0x89bb('0xd'),attributes,{'tableName':_0x89bb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29b7=['exports','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x29b7,0x17d));var _0x729b=function(_0x23e9de,_0x2d9c3f){_0x23e9de=_0x23e9de-0x0;var _0x3a2176=_0x29b7[_0x23e9de];return _0x3a2176;};'use strict';var _=require('lodash');var util=require(_0x729b('0x0'));var logger=require(_0x729b('0x1'))(_0x729b('0x2'));var moment=require(_0x729b('0x3'));var BPromise=require(_0x729b('0x4'));var rp=require(_0x729b('0x5'));var fs=require('fs');var path=require(_0x729b('0x6'));var rimraf=require(_0x729b('0x7'));var config=require('../../config/environment');var attributes=require(_0x729b('0x8'));module[_0x729b('0x9')]=function(_0x47ef25,_0x1fdba3){return _0x47ef25[_0x729b('0xa')](_0x729b('0xb'),attributes,{'tableName':_0x729b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 92a79dd..24ba7c9 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 _0xc482=['request','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','create','body','options','raw','then','CreateSquareRecording','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0xc482,0x1d2));var _0x2c48=function(_0x321017,_0x20117e){_0x321017=_0x321017-0x0;var _0x137110=_0xc482[_0x321017];return _0x137110;};'use strict';var _=require('lodash');var util=require(_0x2c48('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c48('0x1'));var fs=require('fs');var Redis=require(_0x2c48('0x2'));var db=require(_0x2c48('0x3'))['db'];var utils=require(_0x2c48('0x4'));var logger=require(_0x2c48('0x5'))(_0x2c48('0x6'));var config=require(_0x2c48('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2c48('0x8')][_0x2c48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363631,_0x48dc86,_0x58848f){return new BPromise(function(_0x52391a,_0x49094e){return client[_0x2c48('0xa')](_0x363631,_0x58848f)['then'](function(_0x16a782){logger['info'](_0x2c48('0xb'),_0x48dc86,'request\x20sent');logger[_0x2c48('0xc')](_0x2c48('0xd'),_0x48dc86,_0x2c48('0xe'),JSON[_0x2c48('0xf')](_0x16a782));if(_0x16a782['error']){if(_0x16a782[_0x2c48('0x10')][_0x2c48('0x11')]===0x1f4){logger[_0x2c48('0x10')](_0x2c48('0xb'),_0x48dc86,_0x16a782[_0x2c48('0x10')][_0x2c48('0x12')]);return _0x49094e(_0x16a782[_0x2c48('0x10')][_0x2c48('0x12')]);}logger[_0x2c48('0x10')]('SquareRecording,\x20%s,\x20%s',_0x48dc86,_0x16a782['error']['message']);return _0x52391a(_0x16a782[_0x2c48('0x10')]['message']);}else{logger[_0x2c48('0x13')](_0x2c48('0xb'),_0x48dc86,'request\x20sent');_0x52391a(_0x16a782[_0x2c48('0x14')][_0x2c48('0x12')]);}})[_0x2c48('0x15')](function(_0x22b05b){logger[_0x2c48('0x10')](_0x2c48('0xb'),_0x48dc86,_0x22b05b);_0x49094e(_0x22b05b);});});}exports['CreateSquareRecording']=function(_0x351025){var _0x4685f3=this;return new Promise(function(_0x59980b,_0x3e2600){return db['SquareRecording'][_0x2c48('0x16')](_0x351025[_0x2c48('0x17')],{'raw':_0x351025[_0x2c48('0x18')]?_0x351025[_0x2c48('0x18')][_0x2c48('0x19')]===undefined?!![]:![]:!![]})[_0x2c48('0x1a')](function(_0x2bfcf9){logger[_0x2c48('0x13')](_0x2c48('0x1b'),_0x351025);logger['debug'](_0x2c48('0x1b'),_0x351025,JSON[_0x2c48('0xf')](_0x2bfcf9));_0x59980b(_0x2bfcf9);})[_0x2c48('0x15')](function(_0x43d4f4){logger[_0x2c48('0x10')](_0x2c48('0x1b'),_0x43d4f4['message'],_0x351025);_0x3e2600(_0x4685f3[_0x2c48('0x10')](0x1f4,_0x43d4f4['message']));});});}; \ No newline at end of file +var _0x6ac8=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ac8,0x194));var _0x86ac=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6ac8[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x86ac('0x0'));var util=require('util');var moment=require(_0x86ac('0x1'));var BPromise=require(_0x86ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86ac('0x3'));var db=require(_0x86ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x86ac('0x5'))('rpc');var config=require(_0x86ac('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86ac('0x7')][_0x86ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57270a,_0x814bbd,_0x475c89){return new BPromise(function(_0x1dc246,_0x499e99){return client[_0x86ac('0x9')](_0x57270a,_0x475c89)[_0x86ac('0xa')](function(_0x31f9c7){logger[_0x86ac('0xb')](_0x86ac('0xc'),_0x814bbd,_0x86ac('0xd'));logger[_0x86ac('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x814bbd,'request\x20sent',JSON[_0x86ac('0xf')](_0x31f9c7));if(_0x31f9c7[_0x86ac('0x10')]){if(_0x31f9c7['error'][_0x86ac('0x11')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x814bbd,_0x31f9c7['error'][_0x86ac('0x12')]);return _0x499e99(_0x31f9c7['error'][_0x86ac('0x12')]);}logger[_0x86ac('0x10')](_0x86ac('0xc'),_0x814bbd,_0x31f9c7[_0x86ac('0x10')][_0x86ac('0x12')]);return _0x1dc246(_0x31f9c7[_0x86ac('0x10')]['message']);}else{logger[_0x86ac('0xb')](_0x86ac('0xc'),_0x814bbd,_0x86ac('0xd'));_0x1dc246(_0x31f9c7[_0x86ac('0x13')][_0x86ac('0x12')]);}})[_0x86ac('0x14')](function(_0x36b753){logger[_0x86ac('0x10')](_0x86ac('0xc'),_0x814bbd,_0x36b753);_0x499e99(_0x36b753);});});}exports[_0x86ac('0x15')]=function(_0x1b861b){var _0x925840=this;return new Promise(function(_0xaf53a6,_0x3e0914){return db[_0x86ac('0x16')][_0x86ac('0x17')](_0x1b861b['body'],{'raw':_0x1b861b[_0x86ac('0x18')]?_0x1b861b['options'][_0x86ac('0x19')]===undefined?!![]:![]:!![]})[_0x86ac('0xa')](function(_0x238df3){logger[_0x86ac('0xb')](_0x86ac('0x15'),_0x1b861b);logger[_0x86ac('0xe')](_0x86ac('0x15'),_0x1b861b,JSON[_0x86ac('0xf')](_0x238df3));_0xaf53a6(_0x238df3);})[_0x86ac('0x14')](function(_0xfd3f87){logger[_0x86ac('0x10')]('CreateSquareRecording',_0xfd3f87['message'],_0x1b861b);_0x3e0914(_0x925840[_0x86ac('0x10')](0x1f4,_0xfd3f87[_0x86ac('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8b0da56..0e27d31 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4f764b,_0x30dbea){var _0x4406b1=function(_0x310fd0){while(--_0x310fd0){_0x4f764b['push'](_0x4f764b['shift']());}};_0x4406b1(++_0x30dbea);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3f8231,_0xe8cc9){var _0x196142=function(_0x57395e){while(--_0x57395e){_0x3f8231['push'](_0x3f8231['shift']());}};_0x196142(++_0xe8cc9);}(_0xb10b,0x12a));var _0xbb10=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0xb10b[_0x213721];return _0x6435ee;};'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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index f965194..920b377 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 _0xd8f8=['exports','STRING','DATE','BOOLEAN'];(function(_0x3a81e0,_0x5db2c4){var _0x2fd57f=function(_0x239000){while(--_0x239000){_0x3a81e0['push'](_0x3a81e0['shift']());}};_0x2fd57f(++_0x5db2c4);}(_0xd8f8,0x1f0));var _0x8d8f=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xd8f8[_0x5a9c0c];return _0x53c77d;};'use strict';var Sequelize=require('sequelize');module[_0x8d8f('0x0')]={'network':{'type':Sequelize[_0x8d8f('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x8d8f('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8d8f('0x1')]},'type':{'type':Sequelize[_0x8d8f('0x1')]},'uniqueid':{'type':Sequelize[_0x8d8f('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8d8f('0x1')]},'calleridname':{'type':Sequelize[_0x8d8f('0x1')]},'callingpres':{'type':Sequelize[_0x8d8f('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x8d8f('0x1')]},'callingtns':{'type':Sequelize[_0x8d8f('0x1')]},'dnid':{'type':Sequelize[_0x8d8f('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8d8f('0x1')]},'extension':{'type':Sequelize[_0x8d8f('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x8d8f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x8d8f('0x1')]},'project_name':{'type':Sequelize[_0x8d8f('0x1')]},'joinAt':{'type':Sequelize[_0x8d8f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x8d8f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5203=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5203,0x109));var _0x3520=function(_0x170061,_0x362cf6){_0x170061=_0x170061-0x0;var _0x1660e7=_0x5203[_0x170061];return _0x1660e7;};'use strict';var Sequelize=require(_0x3520('0x0'));module[_0x3520('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x3520('0x2')]},'request':{'type':Sequelize[_0x3520('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3520('0x2')]},'type':{'type':Sequelize[_0x3520('0x2')]},'uniqueid':{'type':Sequelize[_0x3520('0x2')]},'version':{'type':Sequelize[_0x3520('0x2')]},'callerid':{'type':Sequelize[_0x3520('0x2')]},'calleridname':{'type':Sequelize[_0x3520('0x2')]},'callingpres':{'type':Sequelize[_0x3520('0x2')]},'callingani2':{'type':Sequelize[_0x3520('0x2')]},'callington':{'type':Sequelize[_0x3520('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x3520('0x2')]},'rdnis':{'type':Sequelize[_0x3520('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3520('0x2')]},'priority':{'type':Sequelize[_0x3520('0x2')]},'enhanced':{'type':Sequelize[_0x3520('0x2')]},'accountcode':{'type':Sequelize[_0x3520('0x2')]},'threadid':{'type':Sequelize[_0x3520('0x2')]},'project_name':{'type':Sequelize[_0x3520('0x2')]},'joinAt':{'type':Sequelize[_0x3520('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x3520('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index efe4da4..6823df3 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 _0xb5ff=['index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','show','params','intersection','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send'];(function(_0x1c3e42,_0x1a4fe9){var _0x348fdc=function(_0x597394){while(--_0x597394){_0x1c3e42['push'](_0x1c3e42['shift']());}};_0x348fdc(++_0x1a4fe9);}(_0xb5ff,0xba));var _0xfb5f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb5ff[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xfb5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb5f('0x1'));var jsonpatch=require(_0xfb5f('0x2'));var rp=require(_0xfb5f('0x3'));var moment=require(_0xfb5f('0x4'));var BPromise=require(_0xfb5f('0x5'));var Mustache=require(_0xfb5f('0x6'));var util=require(_0xfb5f('0x7'));var path=require(_0xfb5f('0x8'));var sox=require(_0xfb5f('0x9'));var csv=require(_0xfb5f('0xa'));var ejs=require(_0xfb5f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfb5f('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb5f('0xd'));var deskjs=require(_0xfb5f('0xe'));var toCsv=require(_0xfb5f('0xa'));var querystring=require('querystring');var Papa=require(_0xfb5f('0xf'));var Redis=require(_0xfb5f('0x10'));var authService=require(_0xfb5f('0x11'));var qs=require(_0xfb5f('0x12'));var as=require(_0xfb5f('0x13'));var hardwareService=require(_0xfb5f('0x14'));var logger=require(_0xfb5f('0x15'))('api');var utils=require(_0xfb5f('0x16'));var config=require(_0xfb5f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c4a28,_0x295e8a){_0x295e8a=_0x295e8a||0xcc;return function(_0x36ed9a){if(_0x36ed9a){return _0x4c4a28['sendStatus'](_0x295e8a);}return _0x4c4a28[_0xfb5f('0x18')](_0x295e8a)[_0xfb5f('0x19')]();};}function respondWithResult(_0x3d325a,_0x4859d7){_0x4859d7=_0x4859d7||0xc8;return function(_0x53dba0){if(_0x53dba0){return _0x3d325a[_0xfb5f('0x18')](_0x4859d7)[_0xfb5f('0x1a')](_0x53dba0);}};}function respondWithFilteredResult(_0x545014,_0x2d1d8e){return function(_0x98afc5){if(_0x98afc5){var _0x5e346d=typeof _0x2d1d8e[_0xfb5f('0x1b')]===_0xfb5f('0x1c')&&typeof _0x2d1d8e[_0xfb5f('0x1d')]==='undefined';var _0x4478e3=_0x98afc5['count'];var _0x5f995e=_0x5e346d?0x0:_0x2d1d8e['offset'];var _0x146625=_0x5e346d?_0x98afc5[_0xfb5f('0x1e')]:_0x2d1d8e[_0xfb5f('0x1b')]+_0x2d1d8e[_0xfb5f('0x1d')];var _0x16f38a;if(_0x146625>=_0x4478e3){_0x146625=_0x4478e3;_0x16f38a=0xc8;}else{_0x16f38a=0xce;}_0x545014[_0xfb5f('0x18')](_0x16f38a);return _0x545014[_0xfb5f('0x1f')](_0xfb5f('0x20'),_0x5f995e+'-'+_0x146625+'/'+_0x4478e3)[_0xfb5f('0x1a')](_0x98afc5);}return null;};}function patchUpdates(_0x35f2de){return function(_0x4de077){try{jsonpatch[_0xfb5f('0x21')](_0x4de077,_0x35f2de,!![]);}catch(_0x298dad){return BPromise[_0xfb5f('0x22')](_0x298dad);}return _0x4de077['save']();};}function saveUpdates(_0x8524ac,_0x534e1e){return function(_0x2a6d52){if(_0x2a6d52){return _0x2a6d52[_0xfb5f('0x23')](_0x8524ac)[_0xfb5f('0x24')](function(_0x4123af){return _0x4123af;});}return null;};}function removeEntity(_0x2a549b,_0x2e812b){return function(_0x47524b){if(_0x47524b){return _0x47524b[_0xfb5f('0x25')]()[_0xfb5f('0x24')](function(){_0x2a549b[_0xfb5f('0x18')](0xcc)[_0xfb5f('0x19')]();});}};}function handleEntityNotFound(_0xcb7401,_0x5ef4d9){return function(_0x467c31){if(!_0x467c31){_0xcb7401[_0xfb5f('0x26')](0x194);}return _0x467c31;};}function handleError(_0x4ec475,_0x1c5f35){_0x1c5f35=_0x1c5f35||0x1f4;return function(_0x10ac06){logger['error'](_0x10ac06[_0xfb5f('0x27')]);if(_0x10ac06[_0xfb5f('0x28')]){delete _0x10ac06['name'];}_0x4ec475[_0xfb5f('0x18')](_0x1c5f35)[_0xfb5f('0x29')](_0x10ac06);};}exports[_0xfb5f('0x2a')]=function(_0x217c16,_0x14b570){var _0x15758f={},_0x5b94a6={},_0x4ae013={'count':0x0,'rows':[]};var _0x455af5=_[_0xfb5f('0x2b')](db[_0xfb5f('0x2c')][_0xfb5f('0x2d')],function(_0x407869){return{'name':_0x407869[_0xfb5f('0x2e')],'type':_0x407869[_0xfb5f('0x2f')][_0xfb5f('0x30')]};});_0x5b94a6[_0xfb5f('0x31')]=_[_0xfb5f('0x2b')](_0x455af5,_0xfb5f('0x28'));_0x5b94a6[_0xfb5f('0x32')]=_[_0xfb5f('0x33')](_0x217c16['query']);_0x5b94a6['filters']=_['intersection'](_0x5b94a6[_0xfb5f('0x31')],_0x5b94a6['query']);_0x15758f[_0xfb5f('0x34')]=_['intersection'](_0x5b94a6['model'],qs[_0xfb5f('0x35')](_0x217c16[_0xfb5f('0x32')][_0xfb5f('0x35')]));_0x15758f[_0xfb5f('0x34')]=_0x15758f[_0xfb5f('0x34')][_0xfb5f('0x36')]?_0x15758f['attributes']:_0x5b94a6[_0xfb5f('0x31')];if(!_0x217c16[_0xfb5f('0x32')][_0xfb5f('0x37')](_0xfb5f('0x38'))){_0x15758f[_0xfb5f('0x1d')]=qs[_0xfb5f('0x1d')](_0x217c16[_0xfb5f('0x32')][_0xfb5f('0x1d')]);_0x15758f[_0xfb5f('0x1b')]=qs['offset'](_0x217c16[_0xfb5f('0x32')]['offset']);}_0x15758f[_0xfb5f('0x39')]=qs[_0xfb5f('0x3a')](_0x217c16[_0xfb5f('0x32')]['sort']);_0x15758f[_0xfb5f('0x3b')]=qs['filters'](_[_0xfb5f('0x3c')](_0x217c16[_0xfb5f('0x32')],_0x5b94a6[_0xfb5f('0x3d')]),_0x455af5);if(_0x217c16[_0xfb5f('0x32')][_0xfb5f('0x3e')]){_0x15758f[_0xfb5f('0x3b')]=_['merge'](_0x15758f['where'],{'$or':_[_0xfb5f('0x2b')](_0x455af5,function(_0x8ccdac){if(_0x8ccdac[_0xfb5f('0x2f')]!=='VIRTUAL'){var _0x533a8e={};_0x533a8e[_0x8ccdac[_0xfb5f('0x28')]]={'$like':'%'+_0x217c16['query'][_0xfb5f('0x3e')]+'%'};return _0x533a8e;}})});}_0x15758f=_[_0xfb5f('0x3f')]({},_0x15758f,_0x217c16[_0xfb5f('0x40')]);var _0x51aa14={'where':_0x15758f[_0xfb5f('0x3b')]};return db[_0xfb5f('0x2c')][_0xfb5f('0x1e')](_0x51aa14)['then'](function(_0x388d71){_0x4ae013[_0xfb5f('0x1e')]=_0x388d71;if(_0x217c16[_0xfb5f('0x32')][_0xfb5f('0x41')]){_0x15758f[_0xfb5f('0x42')]=[{'all':!![]}];}return db[_0xfb5f('0x2c')]['findAll'](_0x15758f);})[_0xfb5f('0x24')](function(_0x47a23c){_0x4ae013[_0xfb5f('0x43')]=_0x47a23c;return _0x4ae013;})[_0xfb5f('0x24')](respondWithFilteredResult(_0x14b570,_0x15758f))['catch'](handleError(_0x14b570,null));};exports[_0xfb5f('0x44')]=function(_0x35428c,_0xedf4e1){var _0x5595bd={'raw':!![],'where':{'id':_0x35428c[_0xfb5f('0x45')]['id']}},_0x18bee5={};_0x18bee5[_0xfb5f('0x31')]=_[_0xfb5f('0x33')](db[_0xfb5f('0x2c')][_0xfb5f('0x2d')]);_0x18bee5[_0xfb5f('0x32')]=_[_0xfb5f('0x33')](_0x35428c['query']);_0x18bee5[_0xfb5f('0x3d')]=_[_0xfb5f('0x46')](_0x18bee5[_0xfb5f('0x31')],_0x18bee5[_0xfb5f('0x32')]);_0x5595bd['attributes']=_[_0xfb5f('0x46')](_0x18bee5[_0xfb5f('0x31')],qs[_0xfb5f('0x35')](_0x35428c[_0xfb5f('0x32')][_0xfb5f('0x35')]));_0x5595bd[_0xfb5f('0x34')]=_0x5595bd[_0xfb5f('0x34')][_0xfb5f('0x36')]?_0x5595bd[_0xfb5f('0x34')]:_0x18bee5[_0xfb5f('0x31')];if(_0x35428c[_0xfb5f('0x32')][_0xfb5f('0x41')]){_0x5595bd[_0xfb5f('0x42')]=[{'all':!![]}];}_0x5595bd=_[_0xfb5f('0x3f')]({},_0x5595bd,_0x35428c[_0xfb5f('0x40')]);return db['SquareReport']['find'](_0x5595bd)[_0xfb5f('0x24')](handleEntityNotFound(_0xedf4e1,null))[_0xfb5f('0x24')](respondWithResult(_0xedf4e1,null))[_0xfb5f('0x47')](handleError(_0xedf4e1,null));};exports[_0xfb5f('0x48')]=function(_0x357454,_0x4bd96d){return db['SquareReport']['create'](_0x357454['body'],{})[_0xfb5f('0x24')](respondWithResult(_0x4bd96d,0xc9))['catch'](handleError(_0x4bd96d,null));};exports[_0xfb5f('0x23')]=function(_0x191d0e,_0x171dfa){if(_0x191d0e[_0xfb5f('0x49')]['id']){delete _0x191d0e[_0xfb5f('0x49')]['id'];}return db[_0xfb5f('0x2c')][_0xfb5f('0x4a')]({'where':{'id':_0x191d0e[_0xfb5f('0x45')]['id']}})[_0xfb5f('0x24')](handleEntityNotFound(_0x171dfa,null))[_0xfb5f('0x24')](saveUpdates(_0x191d0e[_0xfb5f('0x49')],null))[_0xfb5f('0x24')](respondWithResult(_0x171dfa,null))[_0xfb5f('0x47')](handleError(_0x171dfa,null));};exports[_0xfb5f('0x25')]=function(_0x297f4f,_0x547138){return db[_0xfb5f('0x2c')]['find']({'where':{'id':_0x297f4f[_0xfb5f('0x45')]['id']}})['then'](handleEntityNotFound(_0x547138,null))[_0xfb5f('0x24')](removeEntity(_0x547138,null))[_0xfb5f('0x47')](handleError(_0x547138,null));};exports[_0xfb5f('0x4b')]=function(_0x4486c9,_0x238adc){return db[_0xfb5f('0x2c')][_0xfb5f('0x4b')]()[_0xfb5f('0x24')](respondWithResult(_0x238adc,null))['catch'](handleError(_0x238adc,null));}; \ No newline at end of file +var _0x9ac9=['count','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','rows','show','params','includeAll','include','create','catch','body','find','then','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x9ac9,0x1a9));var _0x99ac=function(_0x13e8d5,_0x1492ab){_0x13e8d5=_0x13e8d5-0x0;var _0x319452=_0x9ac9[_0x13e8d5];return _0x319452;};'use strict';var emlformat=require(_0x99ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99ac('0x1'));var jsonpatch=require(_0x99ac('0x2'));var rp=require(_0x99ac('0x3'));var moment=require(_0x99ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x99ac('0x5'));var util=require(_0x99ac('0x6'));var path=require(_0x99ac('0x7'));var sox=require(_0x99ac('0x8'));var csv=require(_0x99ac('0x9'));var ejs=require(_0x99ac('0xa'));var fs=require('fs');var fs_extra=require(_0x99ac('0xb'));var _=require(_0x99ac('0xc'));var squel=require(_0x99ac('0xd'));var crypto=require(_0x99ac('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x99ac('0xf'));var toCsv=require('to-csv');var querystring=require(_0x99ac('0x10'));var Papa=require('papaparse');var Redis=require(_0x99ac('0x11'));var authService=require(_0x99ac('0x12'));var qs=require(_0x99ac('0x13'));var as=require(_0x99ac('0x14'));var hardwareService=require(_0x99ac('0x15'));var logger=require(_0x99ac('0x16'))(_0x99ac('0x17'));var utils=require(_0x99ac('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x99ac('0x19'));var db=require(_0x99ac('0x1a'))['db'];function respondWithStatusCode(_0x2eff03,_0x23c7d5){_0x23c7d5=_0x23c7d5||0xcc;return function(_0x3a46ad){if(_0x3a46ad){return _0x2eff03['sendStatus'](_0x23c7d5);}return _0x2eff03[_0x99ac('0x1b')](_0x23c7d5)['end']();};}function respondWithResult(_0x546e69,_0x5302ac){_0x5302ac=_0x5302ac||0xc8;return function(_0x10021c){if(_0x10021c){return _0x546e69['status'](_0x5302ac)['json'](_0x10021c);}};}function respondWithFilteredResult(_0xbdbd6d,_0x7db60b){return function(_0x48b248){if(_0x48b248){var _0x8c44be=typeof _0x7db60b[_0x99ac('0x1c')]===_0x99ac('0x1d')&&typeof _0x7db60b[_0x99ac('0x1e')]===_0x99ac('0x1d');var _0x236a8d=_0x48b248[_0x99ac('0x1f')];var _0x2fc61a=_0x8c44be?0x0:_0x7db60b[_0x99ac('0x1c')];var _0x128d12=_0x8c44be?_0x48b248[_0x99ac('0x1f')]:_0x7db60b['offset']+_0x7db60b[_0x99ac('0x1e')];var _0x27a9ec;if(_0x128d12>=_0x236a8d){_0x128d12=_0x236a8d;_0x27a9ec=0xc8;}else{_0x27a9ec=0xce;}_0xbdbd6d[_0x99ac('0x1b')](_0x27a9ec);return _0xbdbd6d[_0x99ac('0x20')](_0x99ac('0x21'),_0x2fc61a+'-'+_0x128d12+'/'+_0x236a8d)['json'](_0x48b248);}return null;};}function patchUpdates(_0x3a97fa){return function(_0x4023e6){try{jsonpatch[_0x99ac('0x22')](_0x4023e6,_0x3a97fa,!![]);}catch(_0x547851){return BPromise[_0x99ac('0x23')](_0x547851);}return _0x4023e6[_0x99ac('0x24')]();};}function saveUpdates(_0x279ad7,_0x17850a){return function(_0x2def68){if(_0x2def68){return _0x2def68[_0x99ac('0x25')](_0x279ad7)['then'](function(_0x53ee4b){return _0x53ee4b;});}return null;};}function removeEntity(_0x34dbf3,_0x575262){return function(_0x222875){if(_0x222875){return _0x222875[_0x99ac('0x26')]()['then'](function(){_0x34dbf3[_0x99ac('0x1b')](0xcc)[_0x99ac('0x27')]();});}};}function handleEntityNotFound(_0x3bc740,_0x253ebc){return function(_0x301e07){if(!_0x301e07){_0x3bc740[_0x99ac('0x28')](0x194);}return _0x301e07;};}function handleError(_0x26f83f,_0x1cb4b5){_0x1cb4b5=_0x1cb4b5||0x1f4;return function(_0x4d5fcf){logger[_0x99ac('0x29')](_0x4d5fcf[_0x99ac('0x2a')]);if(_0x4d5fcf[_0x99ac('0x2b')]){delete _0x4d5fcf['name'];}_0x26f83f[_0x99ac('0x1b')](_0x1cb4b5)[_0x99ac('0x2c')](_0x4d5fcf);};}exports[_0x99ac('0x2d')]=function(_0x3257b5,_0x28de4c){var _0x484384={},_0x413064={},_0x582638={'count':0x0,'rows':[]};var _0x233ccd=_[_0x99ac('0x2e')](db[_0x99ac('0x2f')][_0x99ac('0x30')],function(_0x5cf020){return{'name':_0x5cf020['fieldName'],'type':_0x5cf020[_0x99ac('0x31')][_0x99ac('0x32')]};});_0x413064[_0x99ac('0x33')]=_[_0x99ac('0x2e')](_0x233ccd,_0x99ac('0x2b'));_0x413064['query']=_[_0x99ac('0x34')](_0x3257b5['query']);_0x413064[_0x99ac('0x35')]=_[_0x99ac('0x36')](_0x413064[_0x99ac('0x33')],_0x413064[_0x99ac('0x37')]);_0x484384[_0x99ac('0x38')]=_[_0x99ac('0x36')](_0x413064[_0x99ac('0x33')],qs[_0x99ac('0x39')](_0x3257b5[_0x99ac('0x37')][_0x99ac('0x39')]));_0x484384[_0x99ac('0x38')]=_0x484384[_0x99ac('0x38')][_0x99ac('0x3a')]?_0x484384[_0x99ac('0x38')]:_0x413064[_0x99ac('0x33')];if(!_0x3257b5[_0x99ac('0x37')][_0x99ac('0x3b')]('nolimit')){_0x484384[_0x99ac('0x1e')]=qs[_0x99ac('0x1e')](_0x3257b5[_0x99ac('0x37')]['limit']);_0x484384[_0x99ac('0x1c')]=qs['offset'](_0x3257b5['query'][_0x99ac('0x1c')]);}_0x484384[_0x99ac('0x3c')]=qs[_0x99ac('0x3d')](_0x3257b5['query'][_0x99ac('0x3d')]);_0x484384[_0x99ac('0x3e')]=qs[_0x99ac('0x35')](_['pick'](_0x3257b5['query'],_0x413064['filters']),_0x233ccd);if(_0x3257b5['query']['filter']){_0x484384[_0x99ac('0x3e')]=_[_0x99ac('0x3f')](_0x484384[_0x99ac('0x3e')],{'$or':_[_0x99ac('0x2e')](_0x233ccd,function(_0x3f7edb){if(_0x3f7edb[_0x99ac('0x31')]!=='VIRTUAL'){var _0x57f299={};_0x57f299[_0x3f7edb[_0x99ac('0x2b')]]={'$like':'%'+_0x3257b5[_0x99ac('0x37')]['filter']+'%'};return _0x57f299;}})});}_0x484384=_[_0x99ac('0x3f')]({},_0x484384,_0x3257b5[_0x99ac('0x40')]);var _0x4bd978={'where':_0x484384['where']};return db[_0x99ac('0x2f')]['count'](_0x4bd978)['then'](function(_0x35778d){_0x582638[_0x99ac('0x1f')]=_0x35778d;if(_0x3257b5['query']['includeAll']){_0x484384['include']=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x484384);})['then'](function(_0x47a485){_0x582638[_0x99ac('0x41')]=_0x47a485;return _0x582638;})['then'](respondWithFilteredResult(_0x28de4c,_0x484384))['catch'](handleError(_0x28de4c,null));};exports[_0x99ac('0x42')]=function(_0x437a2b,_0x22811b){var _0x5693c9={'raw':!![],'where':{'id':_0x437a2b[_0x99ac('0x43')]['id']}},_0x430881={};_0x430881[_0x99ac('0x33')]=_[_0x99ac('0x34')](db[_0x99ac('0x2f')][_0x99ac('0x30')]);_0x430881[_0x99ac('0x37')]=_[_0x99ac('0x34')](_0x437a2b[_0x99ac('0x37')]);_0x430881['filters']=_[_0x99ac('0x36')](_0x430881[_0x99ac('0x33')],_0x430881[_0x99ac('0x37')]);_0x5693c9[_0x99ac('0x38')]=_['intersection'](_0x430881[_0x99ac('0x33')],qs['fields'](_0x437a2b['query'][_0x99ac('0x39')]));_0x5693c9[_0x99ac('0x38')]=_0x5693c9[_0x99ac('0x38')]['length']?_0x5693c9[_0x99ac('0x38')]:_0x430881[_0x99ac('0x33')];if(_0x437a2b[_0x99ac('0x37')][_0x99ac('0x44')]){_0x5693c9[_0x99ac('0x45')]=[{'all':!![]}];}_0x5693c9=_[_0x99ac('0x3f')]({},_0x5693c9,_0x437a2b['options']);return db['SquareReport']['find'](_0x5693c9)['then'](handleEntityNotFound(_0x22811b,null))['then'](respondWithResult(_0x22811b,null))['catch'](handleError(_0x22811b,null));};exports[_0x99ac('0x46')]=function(_0x420916,_0x5537a6){return db[_0x99ac('0x2f')][_0x99ac('0x46')](_0x420916['body'],{})['then'](respondWithResult(_0x5537a6,0xc9))[_0x99ac('0x47')](handleError(_0x5537a6,null));};exports[_0x99ac('0x25')]=function(_0x40837d,_0x3d5dc6){if(_0x40837d[_0x99ac('0x48')]['id']){delete _0x40837d[_0x99ac('0x48')]['id'];}return db['SquareReport'][_0x99ac('0x49')]({'where':{'id':_0x40837d[_0x99ac('0x43')]['id']}})[_0x99ac('0x4a')](handleEntityNotFound(_0x3d5dc6,null))[_0x99ac('0x4a')](saveUpdates(_0x40837d[_0x99ac('0x48')],null))['then'](respondWithResult(_0x3d5dc6,null))[_0x99ac('0x47')](handleError(_0x3d5dc6,null));};exports[_0x99ac('0x26')]=function(_0x79913d,_0x2b89f6){return db[_0x99ac('0x2f')]['find']({'where':{'id':_0x79913d[_0x99ac('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b89f6,null))[_0x99ac('0x4a')](removeEntity(_0x2b89f6,null))[_0x99ac('0x47')](handleError(_0x2b89f6,null));};exports[_0x99ac('0x4b')]=function(_0x442da1,_0x15e2bc){return db[_0x99ac('0x2f')]['describe']()[_0x99ac('0x4a')](respondWithResult(_0x15e2bc,null))[_0x99ac('0x47')](handleError(_0x15e2bc,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 04c32be..755ce42 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 _0xc717=['util','../../config/logger','moment','bluebird','../../config/environment','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash'];(function(_0xabf81,_0x525d91){var _0x2bad3e=function(_0x341830){while(--_0x341830){_0xabf81['push'](_0xabf81['shift']());}};_0x2bad3e(++_0x525d91);}(_0xc717,0xdc));var _0x7c71=function(_0x1f4b80,_0x529fcb){_0x1f4b80=_0x1f4b80-0x0;var _0x123fc4=_0xc717[_0x1f4b80];return _0x123fc4;};'use strict';var _=require(_0x7c71('0x0'));var util=require(_0x7c71('0x1'));var logger=require(_0x7c71('0x2'))('api');var moment=require(_0x7c71('0x3'));var BPromise=require(_0x7c71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c71('0x5'));var attributes=require('./squareReport.attributes');module[_0x7c71('0x6')]=function(_0x14b850,_0x14a653){return _0x14b850[_0x7c71('0x7')](_0x7c71('0x8'),attributes,{'tableName':_0x7c71('0x9'),'paranoid':![],'indexes':[{'name':_0x7c71('0xa'),'fields':['uniqueid',_0x7c71('0xb')]},{'name':_0x7c71('0xc'),'fields':[_0x7c71('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x926f=['report_square','project_name','leaveAt','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SquareReport'];(function(_0xecd440,_0x5a33ac){var _0x4872c7=function(_0x3e1a92){while(--_0x3e1a92){_0xecd440['push'](_0xecd440['shift']());}};_0x4872c7(++_0x5a33ac);}(_0x926f,0x1d1));var _0xf926=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x926f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xf926('0x0'));var logger=require(_0xf926('0x1'))(_0xf926('0x2'));var moment=require(_0xf926('0x3'));var BPromise=require(_0xf926('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf926('0x5'));var rimraf=require(_0xf926('0x6'));var config=require(_0xf926('0x7'));var attributes=require('./squareReport.attributes');module[_0xf926('0x8')]=function(_0x64316,_0x128e2b){return _0x64316[_0xf926('0x9')](_0xf926('0xa'),attributes,{'tableName':_0xf926('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xf926('0xc')]},{'name':_0xf926('0xd'),'fields':[_0xf926('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 188e0ff..bd364fe 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 _0x0abf=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','body','options','raw','CreateSquareReport','debug','UpdateSquareReport','SquareReport','update','where','attributes','limit','stringify','util'];(function(_0x4dfcc4,_0x208d04){var _0x575ea4=function(_0x19b3e0){while(--_0x19b3e0){_0x4dfcc4['push'](_0x4dfcc4['shift']());}};_0x575ea4(++_0x208d04);}(_0x0abf,0x13f));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xf0ab('0x0'));var moment=require(_0xf0ab('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ab('0x2'));var db=require(_0xf0ab('0x3'))['db'];var utils=require(_0xf0ab('0x4'));var logger=require('../../config/logger')(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a779e,_0x2a08ed,_0x2f68a7){return new BPromise(function(_0x317236,_0x29a463){return client[_0xf0ab('0xa')](_0x4a779e,_0x2f68a7)[_0xf0ab('0xb')](function(_0x8b5a6e){logger[_0xf0ab('0xc')](_0xf0ab('0xd'),_0x2a08ed,_0xf0ab('0xe'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x2a08ed,_0xf0ab('0xe'),JSON['stringify'](_0x8b5a6e));if(_0x8b5a6e[_0xf0ab('0xf')]){if(_0x8b5a6e[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xd'),_0x2a08ed,_0x8b5a6e['error'][_0xf0ab('0x11')]);return _0x29a463(_0x8b5a6e[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xd'),_0x2a08ed,_0x8b5a6e['error'][_0xf0ab('0x11')]);return _0x317236(_0x8b5a6e['error']['message']);}else{logger[_0xf0ab('0xc')]('SquareReport,\x20%s,\x20%s',_0x2a08ed,_0xf0ab('0xe'));_0x317236(_0x8b5a6e[_0xf0ab('0x12')][_0xf0ab('0x11')]);}})[_0xf0ab('0x13')](function(_0x2626c7){logger[_0xf0ab('0xf')](_0xf0ab('0xd'),_0x2a08ed,_0x2626c7);_0x29a463(_0x2626c7);});});}exports['CreateSquareReport']=function(_0x50545a){var _0x111fbf=this;return new Promise(function(_0x3dfd05,_0x1ab2b5){return db['SquareReport']['create'](_0x50545a[_0xf0ab('0x14')],{'raw':_0x50545a[_0xf0ab('0x15')]?_0x50545a[_0xf0ab('0x15')][_0xf0ab('0x16')]===undefined?!![]:![]:!![]})[_0xf0ab('0xb')](function(_0x1054fe){logger[_0xf0ab('0xc')](_0xf0ab('0x17'),_0x50545a);logger[_0xf0ab('0x18')](_0xf0ab('0x17'),_0x50545a,JSON['stringify'](_0x1054fe));_0x3dfd05(_0x1054fe);})[_0xf0ab('0x13')](function(_0x493920){logger[_0xf0ab('0xf')](_0xf0ab('0x17'),_0x493920[_0xf0ab('0x11')],_0x50545a);_0x1ab2b5(_0x111fbf[_0xf0ab('0xf')](0x1f4,_0x493920[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x19')]=function(_0x31f370){var _0xdb0401=this;return new Promise(function(_0x2818f9,_0x4a50a8){return db[_0xf0ab('0x1a')][_0xf0ab('0x1b')](_0x31f370['body'],{'raw':_0x31f370[_0xf0ab('0x15')]?_0x31f370[_0xf0ab('0x15')][_0xf0ab('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31f370[_0xf0ab('0x15')]?_0x31f370['options'][_0xf0ab('0x1c')]||null:null,'attributes':_0x31f370[_0xf0ab('0x15')]?_0x31f370[_0xf0ab('0x15')][_0xf0ab('0x1d')]||null:null,'limit':_0x31f370['options']?_0x31f370[_0xf0ab('0x15')][_0xf0ab('0x1e')]||null:null})[_0xf0ab('0xb')](function(_0x11bfd8){logger['info'](_0xf0ab('0x19'),_0x31f370);logger['debug'](_0xf0ab('0x19'),_0x31f370,JSON[_0xf0ab('0x1f')](_0x11bfd8));_0x2818f9(_0x11bfd8);})[_0xf0ab('0x13')](function(_0x43681d){logger[_0xf0ab('0xf')](_0xf0ab('0x19'),_0x43681d[_0xf0ab('0x11')],_0x31f370);_0x4a50a8(_0xdb0401['error'](0x1f4,_0x43681d[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0xa3c1=['UpdateSquareReport','SquareReport','limit','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','body','options','raw'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa3c1,0x94));var _0x1a3c=function(_0x25043e,_0x5ea170){_0x25043e=_0x25043e-0x0;var _0x58b023=_0xa3c1[_0x25043e];return _0x58b023;};'use strict';var _=require(_0x1a3c('0x0'));var util=require('util');var moment=require(_0x1a3c('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a3c('0x2'));var fs=require('fs');var Redis=require(_0x1a3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a3c('0x4'))(_0x1a3c('0x5'));var config=require(_0x1a3c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1a3c('0x7')][_0x1a3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54e157,_0x15bab5,_0x4c61ba){return new BPromise(function(_0x237f1e,_0x3e6cd6){return client[_0x1a3c('0x9')](_0x54e157,_0x4c61ba)[_0x1a3c('0xa')](function(_0x27068e){logger[_0x1a3c('0xb')](_0x1a3c('0xc'),_0x15bab5,_0x1a3c('0xd'));logger[_0x1a3c('0xe')](_0x1a3c('0xf'),_0x15bab5,_0x1a3c('0xd'),JSON[_0x1a3c('0x10')](_0x27068e));if(_0x27068e[_0x1a3c('0x11')]){if(_0x27068e[_0x1a3c('0x11')][_0x1a3c('0x12')]===0x1f4){logger['error'](_0x1a3c('0xc'),_0x15bab5,_0x27068e[_0x1a3c('0x11')]['message']);return _0x3e6cd6(_0x27068e[_0x1a3c('0x11')][_0x1a3c('0x13')]);}logger[_0x1a3c('0x11')](_0x1a3c('0xc'),_0x15bab5,_0x27068e[_0x1a3c('0x11')]['message']);return _0x237f1e(_0x27068e[_0x1a3c('0x11')][_0x1a3c('0x13')]);}else{logger[_0x1a3c('0xb')](_0x1a3c('0xc'),_0x15bab5,_0x1a3c('0xd'));_0x237f1e(_0x27068e[_0x1a3c('0x14')][_0x1a3c('0x13')]);}})[_0x1a3c('0x15')](function(_0x543c45){logger[_0x1a3c('0x11')](_0x1a3c('0xc'),_0x15bab5,_0x543c45);_0x3e6cd6(_0x543c45);});});}exports[_0x1a3c('0x16')]=function(_0x46435c){var _0x5ad167=this;return new Promise(function(_0x13a003,_0x8ad024){return db['SquareReport']['create'](_0x46435c[_0x1a3c('0x17')],{'raw':_0x46435c[_0x1a3c('0x18')]?_0x46435c[_0x1a3c('0x18')][_0x1a3c('0x19')]===undefined?!![]:![]:!![]})[_0x1a3c('0xa')](function(_0x2b1449){logger[_0x1a3c('0xb')](_0x1a3c('0x16'),_0x46435c);logger[_0x1a3c('0xe')](_0x1a3c('0x16'),_0x46435c,JSON['stringify'](_0x2b1449));_0x13a003(_0x2b1449);})['catch'](function(_0x32caae){logger[_0x1a3c('0x11')](_0x1a3c('0x16'),_0x32caae[_0x1a3c('0x13')],_0x46435c);_0x8ad024(_0x5ad167[_0x1a3c('0x11')](0x1f4,_0x32caae['message']));});});};exports[_0x1a3c('0x1a')]=function(_0x534a74){var _0x3c0eda=this;return new Promise(function(_0x347bf4,_0xe677ef){return db[_0x1a3c('0x1b')]['update'](_0x534a74['body'],{'raw':_0x534a74[_0x1a3c('0x18')]?_0x534a74[_0x1a3c('0x18')][_0x1a3c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x534a74[_0x1a3c('0x18')]?_0x534a74[_0x1a3c('0x18')]['where']||null:null,'attributes':_0x534a74[_0x1a3c('0x18')]?_0x534a74['options']['attributes']||null:null,'limit':_0x534a74[_0x1a3c('0x18')]?_0x534a74[_0x1a3c('0x18')][_0x1a3c('0x1c')]||null:null})['then'](function(_0x5e5e26){logger['info'](_0x1a3c('0x1a'),_0x534a74);logger['debug'](_0x1a3c('0x1a'),_0x534a74,JSON[_0x1a3c('0x10')](_0x5e5e26));_0x347bf4(_0x5e5e26);})[_0x1a3c('0x15')](function(_0xf637c5){logger['error'](_0x1a3c('0x1a'),_0xf637c5[_0x1a3c('0x13')],_0x534a74);_0xe677ef(_0x3c0eda[_0x1a3c('0x11')](0x1f4,_0xf637c5[_0x1a3c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 416b6cf..85267f1 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 _0x91ec=['describe','/:id','show','post','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','isAuthenticated'];(function(_0x5edcf4,_0x4affb1){var _0x55e8bb=function(_0x1a15be){while(--_0x1a15be){_0x5edcf4['push'](_0x5edcf4['shift']());}};_0x55e8bb(++_0x4affb1);}(_0x91ec,0x1bf));var _0xc91e=function(_0x2e456a,_0x5b0a2){_0x2e456a=_0x2e456a-0x0;var _0x44a81f=_0x91ec[_0x2e456a];return _0x44a81f;};'use strict';var multer=require(_0xc91e('0x0'));var util=require('util');var path=require(_0xc91e('0x1'));var timeout=require(_0xc91e('0x2'));var express=require(_0xc91e('0x3'));var router=express[_0xc91e('0x4')]();var fs_extra=require(_0xc91e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc91e('0x6'));var config=require(_0xc91e('0x7'));var controller=require(_0xc91e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc91e('0x9')]);router[_0xc91e('0xa')](_0xc91e('0xb'),auth[_0xc91e('0xc')](),controller[_0xc91e('0xd')]);router['get'](_0xc91e('0xe'),auth['isAuthenticated'](),controller[_0xc91e('0xf')]);router[_0xc91e('0x10')]('/',auth[_0xc91e('0xc')](),controller['create']);router['put'](_0xc91e('0xe'),auth[_0xc91e('0xc')](),controller[_0xc91e('0x11')]);router[_0xc91e('0x12')]('/:id',auth[_0xc91e('0xc')](),controller['destroy']);module[_0xc91e('0x13')]=router; \ No newline at end of file +var _0x6c5c=['isAuthenticated','index','/describe','describe','post','create','/:id','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0x5d341b,_0x4e6401){var _0x261d8c=function(_0x209a6e){while(--_0x209a6e){_0x5d341b['push'](_0x5d341b['shift']());}};_0x261d8c(++_0x4e6401);}(_0x6c5c,0x1e4));var _0xc6c5=function(_0x42dc11,_0x14b100){_0x42dc11=_0x42dc11-0x0;var _0xb58926=_0x6c5c[_0x42dc11];return _0xb58926;};'use strict';var multer=require('multer');var util=require(_0xc6c5('0x0'));var path=require('path');var timeout=require(_0xc6c5('0x1'));var express=require(_0xc6c5('0x2'));var router=express[_0xc6c5('0x3')]();var fs_extra=require(_0xc6c5('0x4'));var auth=require(_0xc6c5('0x5'));var interaction=require(_0xc6c5('0x6'));var config=require(_0xc6c5('0x7'));var controller=require(_0xc6c5('0x8'));router[_0xc6c5('0x9')]('/',auth[_0xc6c5('0xa')](),controller[_0xc6c5('0xb')]);router['get'](_0xc6c5('0xc'),auth[_0xc6c5('0xa')](),controller[_0xc6c5('0xd')]);router[_0xc6c5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc6c5('0xe')]('/',auth['isAuthenticated'](),controller[_0xc6c5('0xf')]);router['put'](_0xc6c5('0x10'),auth['isAuthenticated'](),controller[_0xc6c5('0x11')]);router['delete'](_0xc6c5('0x10'),auth['isAuthenticated'](),controller[_0xc6c5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 29c1cf8..ef507ab 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 _0x61bf=['TEXT','sequelize','STRING'];(function(_0x41bd87,_0x4b840f){var _0x46c83d=function(_0x56cbff){while(--_0x56cbff){_0x41bd87['push'](_0x41bd87['shift']());}};_0x46c83d(++_0x4b840f);}(_0x61bf,0x97));var _0xf61b=function(_0x3c4c9e,_0x56568c){_0x3c4c9e=_0x3c4c9e-0x0;var _0x2e3f8a=_0x61bf[_0x3c4c9e];return _0x2e3f8a;};'use strict';var Sequelize=require(_0xf61b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf61b('0x1')]},'node':{'type':Sequelize[_0xf61b('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf61b('0x2')]},'project_name':{'type':Sequelize[_0xf61b('0x1')]},'callerid':{'type':Sequelize[_0xf61b('0x1')]}}; \ No newline at end of file +var _0x939b=['exports','STRING','TEXT','sequelize'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x939b,0xef));var _0xb939=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x939b[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xb939('0x0'));module[_0xb939('0x1')]={'uniqueid':{'type':Sequelize[_0xb939('0x2')]},'node':{'type':Sequelize[_0xb939('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xb939('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb939('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 5143ad4..00a4cb4 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 _0x98d5=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','SquareDetailsReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','catch','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2f0092,_0x356d2a){var _0x6ede26=function(_0x17e15e){while(--_0x17e15e){_0x2f0092['push'](_0x2f0092['shift']());}};_0x6ede26(++_0x356d2a);}(_0x98d5,0x1df));var _0x598d=function(_0x51e30d,_0x4587d1){_0x51e30d=_0x51e30d-0x0;var _0x5f0350=_0x98d5[_0x51e30d];return _0x5f0350;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x598d('0x0'));var zipdir=require(_0x598d('0x1'));var jsonpatch=require(_0x598d('0x2'));var rp=require(_0x598d('0x3'));var moment=require('moment');var BPromise=require(_0x598d('0x4'));var Mustache=require(_0x598d('0x5'));var util=require(_0x598d('0x6'));var path=require(_0x598d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x598d('0x8'));var squel=require(_0x598d('0x9'));var crypto=require(_0x598d('0xa'));var jsforce=require(_0x598d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x598d('0xc'));var querystring=require(_0x598d('0xd'));var Papa=require('papaparse');var Redis=require(_0x598d('0xe'));var authService=require(_0x598d('0xf'));var qs=require(_0x598d('0x10'));var as=require(_0x598d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x598d('0x12'));var utils=require(_0x598d('0x13'));var config=require(_0x598d('0x14'));var licenseUtil=require(_0x598d('0x15'));var db=require(_0x598d('0x16'))['db'];function respondWithStatusCode(_0x61750e,_0x111320){_0x111320=_0x111320||0xcc;return function(_0x5cbbbc){if(_0x5cbbbc){return _0x61750e[_0x598d('0x17')](_0x111320);}return _0x61750e[_0x598d('0x18')](_0x111320)[_0x598d('0x19')]();};}function respondWithResult(_0x7e219a,_0x1ca5bd){_0x1ca5bd=_0x1ca5bd||0xc8;return function(_0x2cce09){if(_0x2cce09){return _0x7e219a[_0x598d('0x18')](_0x1ca5bd)[_0x598d('0x1a')](_0x2cce09);}};}function respondWithFilteredResult(_0x34a749,_0x3d53a8){return function(_0xf74476){if(_0xf74476){var _0x2ca73b=typeof _0x3d53a8['offset']===_0x598d('0x1b')&&typeof _0x3d53a8[_0x598d('0x1c')]===_0x598d('0x1b');var _0x45d635=_0xf74476[_0x598d('0x1d')];var _0x5a2088=_0x2ca73b?0x0:_0x3d53a8[_0x598d('0x1e')];var _0x1daf6c=_0x2ca73b?_0xf74476['count']:_0x3d53a8[_0x598d('0x1e')]+_0x3d53a8[_0x598d('0x1c')];var _0x4be555;if(_0x1daf6c>=_0x45d635){_0x1daf6c=_0x45d635;_0x4be555=0xc8;}else{_0x4be555=0xce;}_0x34a749[_0x598d('0x18')](_0x4be555);return _0x34a749[_0x598d('0x1f')](_0x598d('0x20'),_0x5a2088+'-'+_0x1daf6c+'/'+_0x45d635)['json'](_0xf74476);}return null;};}function patchUpdates(_0x1deb71){return function(_0x42a215){try{jsonpatch[_0x598d('0x21')](_0x42a215,_0x1deb71,!![]);}catch(_0x8afd21){return BPromise['reject'](_0x8afd21);}return _0x42a215['save']();};}function saveUpdates(_0x5119e2,_0x2247c2){return function(_0x296594){if(_0x296594){return _0x296594[_0x598d('0x22')](_0x5119e2)['then'](function(_0x51c4fe){return _0x51c4fe;});}return null;};}function removeEntity(_0xdfbac,_0x28341c){return function(_0x4934f1){if(_0x4934f1){return _0x4934f1[_0x598d('0x23')]()[_0x598d('0x24')](function(){_0xdfbac['status'](0xcc)[_0x598d('0x19')]();});}};}function handleEntityNotFound(_0x16c6b1,_0x175859){return function(_0x650231){if(!_0x650231){_0x16c6b1[_0x598d('0x17')](0x194);}return _0x650231;};}function handleError(_0x1a055d,_0x3e28ba){_0x3e28ba=_0x3e28ba||0x1f4;return function(_0x1bcd8f){logger['error'](_0x1bcd8f[_0x598d('0x25')]);if(_0x1bcd8f[_0x598d('0x26')]){delete _0x1bcd8f[_0x598d('0x26')];}_0x1a055d[_0x598d('0x18')](_0x3e28ba)[_0x598d('0x27')](_0x1bcd8f);};}exports['index']=function(_0x166bae,_0x4ab16a){var _0x54d444={},_0x318181={},_0x1df24d={'count':0x0,'rows':[]};var _0x4df9a7=_['map'](db[_0x598d('0x28')]['rawAttributes'],function(_0xbce694){return{'name':_0xbce694[_0x598d('0x29')],'type':_0xbce694['type'][_0x598d('0x2a')]};});_0x318181[_0x598d('0x2b')]=_[_0x598d('0x2c')](_0x4df9a7,_0x598d('0x26'));_0x318181[_0x598d('0x2d')]=_[_0x598d('0x2e')](_0x166bae[_0x598d('0x2d')]);_0x318181[_0x598d('0x2f')]=_[_0x598d('0x30')](_0x318181[_0x598d('0x2b')],_0x318181[_0x598d('0x2d')]);_0x54d444[_0x598d('0x31')]=_[_0x598d('0x30')](_0x318181[_0x598d('0x2b')],qs[_0x598d('0x32')](_0x166bae[_0x598d('0x2d')]['fields']));_0x54d444[_0x598d('0x31')]=_0x54d444[_0x598d('0x31')][_0x598d('0x33')]?_0x54d444['attributes']:_0x318181[_0x598d('0x2b')];if(!_0x166bae[_0x598d('0x2d')][_0x598d('0x34')]('nolimit')){_0x54d444[_0x598d('0x1c')]=qs['limit'](_0x166bae['query'][_0x598d('0x1c')]);_0x54d444['offset']=qs[_0x598d('0x1e')](_0x166bae[_0x598d('0x2d')][_0x598d('0x1e')]);}_0x54d444[_0x598d('0x35')]=qs[_0x598d('0x36')](_0x166bae[_0x598d('0x2d')][_0x598d('0x36')]);_0x54d444['where']=qs[_0x598d('0x2f')](_[_0x598d('0x37')](_0x166bae[_0x598d('0x2d')],_0x318181[_0x598d('0x2f')]),_0x4df9a7);if(_0x166bae['query'][_0x598d('0x38')]){_0x54d444[_0x598d('0x39')]=_[_0x598d('0x3a')](_0x54d444[_0x598d('0x39')],{'$or':_['map'](_0x4df9a7,function(_0x56fa6a){if(_0x56fa6a[_0x598d('0x3b')]!=='VIRTUAL'){var _0x4c15ac={};_0x4c15ac[_0x56fa6a[_0x598d('0x26')]]={'$like':'%'+_0x166bae[_0x598d('0x2d')][_0x598d('0x38')]+'%'};return _0x4c15ac;}})});}_0x54d444=_[_0x598d('0x3a')]({},_0x54d444,_0x166bae[_0x598d('0x3c')]);var _0x42e7a9={'where':_0x54d444[_0x598d('0x39')]};return db['SquareDetailsReport']['count'](_0x42e7a9)['then'](function(_0x15a85a){_0x1df24d[_0x598d('0x1d')]=_0x15a85a;if(_0x166bae[_0x598d('0x2d')][_0x598d('0x3d')]){_0x54d444['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x598d('0x3e')](_0x54d444);})['then'](function(_0x592d19){_0x1df24d[_0x598d('0x3f')]=_0x592d19;return _0x1df24d;})[_0x598d('0x24')](respondWithFilteredResult(_0x4ab16a,_0x54d444))[_0x598d('0x40')](handleError(_0x4ab16a,null));};exports['show']=function(_0x1a84dc,_0x451a1e){var _0x20a5e0={'raw':!![],'where':{'id':_0x1a84dc['params']['id']}},_0x4491d6={};_0x4491d6[_0x598d('0x2b')]=_[_0x598d('0x2e')](db['SquareDetailsReport']['rawAttributes']);_0x4491d6[_0x598d('0x2d')]=_[_0x598d('0x2e')](_0x1a84dc['query']);_0x4491d6[_0x598d('0x2f')]=_[_0x598d('0x30')](_0x4491d6['model'],_0x4491d6[_0x598d('0x2d')]);_0x20a5e0[_0x598d('0x31')]=_['intersection'](_0x4491d6[_0x598d('0x2b')],qs[_0x598d('0x32')](_0x1a84dc[_0x598d('0x2d')][_0x598d('0x32')]));_0x20a5e0[_0x598d('0x31')]=_0x20a5e0[_0x598d('0x31')][_0x598d('0x33')]?_0x20a5e0[_0x598d('0x31')]:_0x4491d6[_0x598d('0x2b')];if(_0x1a84dc['query'][_0x598d('0x3d')]){_0x20a5e0[_0x598d('0x41')]=[{'all':!![]}];}_0x20a5e0=_[_0x598d('0x3a')]({},_0x20a5e0,_0x1a84dc[_0x598d('0x3c')]);return db[_0x598d('0x28')][_0x598d('0x42')](_0x20a5e0)[_0x598d('0x24')](handleEntityNotFound(_0x451a1e,null))[_0x598d('0x24')](respondWithResult(_0x451a1e,null))[_0x598d('0x40')](handleError(_0x451a1e,null));};exports[_0x598d('0x43')]=function(_0xc75a1e,_0x50b222){return db[_0x598d('0x28')]['create'](_0xc75a1e[_0x598d('0x44')],{})['then'](respondWithResult(_0x50b222,0xc9))[_0x598d('0x40')](handleError(_0x50b222,null));};exports[_0x598d('0x22')]=function(_0x1bd0cc,_0x85086f){if(_0x1bd0cc[_0x598d('0x44')]['id']){delete _0x1bd0cc[_0x598d('0x44')]['id'];}return db[_0x598d('0x28')][_0x598d('0x42')]({'where':{'id':_0x1bd0cc['params']['id']}})['then'](handleEntityNotFound(_0x85086f,null))['then'](saveUpdates(_0x1bd0cc[_0x598d('0x44')],null))[_0x598d('0x24')](respondWithResult(_0x85086f,null))[_0x598d('0x40')](handleError(_0x85086f,null));};exports[_0x598d('0x23')]=function(_0x4463bd,_0x27f2b4){return db['SquareDetailsReport'][_0x598d('0x42')]({'where':{'id':_0x4463bd[_0x598d('0x45')]['id']}})[_0x598d('0x24')](handleEntityNotFound(_0x27f2b4,null))[_0x598d('0x24')](removeEntity(_0x27f2b4,null))[_0x598d('0x40')](handleError(_0x27f2b4,null));};exports[_0x598d('0x46')]=function(_0x3f46d0,_0x480019){return db[_0x598d('0x28')][_0x598d('0x46')]()[_0x598d('0x24')](respondWithResult(_0x480019,null))[_0x598d('0x40')](handleError(_0x480019,null));}; \ No newline at end of file +var _0x3684=['count','limit','set','Content-Range','save','update','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x328c9b,_0x12cecb){var _0x2c5ea8=function(_0x1f16af){while(--_0x1f16af){_0x328c9b['push'](_0x328c9b['shift']());}};_0x2c5ea8(++_0x12cecb);}(_0x3684,0xff));var _0x4368=function(_0x2f273b,_0x913f1d){_0x2f273b=_0x2f273b-0x0;var _0x46a48b=_0x3684[_0x2f273b];return _0x46a48b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4368('0x0'));var zipdir=require(_0x4368('0x1'));var jsonpatch=require(_0x4368('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4368('0x3'));var util=require('util');var path=require(_0x4368('0x4'));var sox=require('sox');var csv=require(_0x4368('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4368('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4368('0x7'));var deskjs=require(_0x4368('0x8'));var toCsv=require(_0x4368('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4368('0x9'));var authService=require(_0x4368('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x4368('0xb'));var hardwareService=require(_0x4368('0xc'));var logger=require(_0x4368('0xd'))(_0x4368('0xe'));var utils=require(_0x4368('0xf'));var config=require(_0x4368('0x10'));var licenseUtil=require(_0x4368('0x11'));var db=require(_0x4368('0x12'))['db'];function respondWithStatusCode(_0x2344fe,_0x35705e){_0x35705e=_0x35705e||0xcc;return function(_0x300c9c){if(_0x300c9c){return _0x2344fe[_0x4368('0x13')](_0x35705e);}return _0x2344fe[_0x4368('0x14')](_0x35705e)[_0x4368('0x15')]();};}function respondWithResult(_0x5e2959,_0x119de1){_0x119de1=_0x119de1||0xc8;return function(_0x317a2b){if(_0x317a2b){return _0x5e2959[_0x4368('0x14')](_0x119de1)[_0x4368('0x16')](_0x317a2b);}};}function respondWithFilteredResult(_0x21a489,_0x1f69f9){return function(_0x29bc46){if(_0x29bc46){var _0x9a5cb=typeof _0x1f69f9[_0x4368('0x17')]==='undefined'&&typeof _0x1f69f9['limit']===_0x4368('0x18');var _0x5a7090=_0x29bc46[_0x4368('0x19')];var _0x2f1ef6=_0x9a5cb?0x0:_0x1f69f9[_0x4368('0x17')];var _0x2b3887=_0x9a5cb?_0x29bc46['count']:_0x1f69f9[_0x4368('0x17')]+_0x1f69f9[_0x4368('0x1a')];var _0x4c1ba9;if(_0x2b3887>=_0x5a7090){_0x2b3887=_0x5a7090;_0x4c1ba9=0xc8;}else{_0x4c1ba9=0xce;}_0x21a489[_0x4368('0x14')](_0x4c1ba9);return _0x21a489[_0x4368('0x1b')](_0x4368('0x1c'),_0x2f1ef6+'-'+_0x2b3887+'/'+_0x5a7090)['json'](_0x29bc46);}return null;};}function patchUpdates(_0x2ed185){return function(_0x544f8c){try{jsonpatch['apply'](_0x544f8c,_0x2ed185,!![]);}catch(_0x270852){return BPromise['reject'](_0x270852);}return _0x544f8c[_0x4368('0x1d')]();};}function saveUpdates(_0x40d929,_0x43fc95){return function(_0x50f1bd){if(_0x50f1bd){return _0x50f1bd[_0x4368('0x1e')](_0x40d929)[_0x4368('0x1f')](function(_0x19368c){return _0x19368c;});}return null;};}function removeEntity(_0x36977b,_0x12f0e6){return function(_0x5ab825){if(_0x5ab825){return _0x5ab825['destroy']()[_0x4368('0x1f')](function(){_0x36977b['status'](0xcc)[_0x4368('0x15')]();});}};}function handleEntityNotFound(_0x1339e1,_0x2caff1){return function(_0x188e8d){if(!_0x188e8d){_0x1339e1['sendStatus'](0x194);}return _0x188e8d;};}function handleError(_0x49f22a,_0x2855ba){_0x2855ba=_0x2855ba||0x1f4;return function(_0x107086){logger[_0x4368('0x20')](_0x107086[_0x4368('0x21')]);if(_0x107086[_0x4368('0x22')]){delete _0x107086['name'];}_0x49f22a[_0x4368('0x14')](_0x2855ba)[_0x4368('0x23')](_0x107086);};}exports[_0x4368('0x24')]=function(_0x15f6d1,_0x433197){var _0x58e03b={},_0x422621={},_0xd0f7cf={'count':0x0,'rows':[]};var _0x531118=_[_0x4368('0x25')](db[_0x4368('0x26')][_0x4368('0x27')],function(_0x42bcf2){return{'name':_0x42bcf2[_0x4368('0x28')],'type':_0x42bcf2[_0x4368('0x29')]['key']};});_0x422621[_0x4368('0x2a')]=_[_0x4368('0x25')](_0x531118,_0x4368('0x22'));_0x422621[_0x4368('0x2b')]=_['keys'](_0x15f6d1[_0x4368('0x2b')]);_0x422621[_0x4368('0x2c')]=_[_0x4368('0x2d')](_0x422621[_0x4368('0x2a')],_0x422621[_0x4368('0x2b')]);_0x58e03b[_0x4368('0x2e')]=_[_0x4368('0x2d')](_0x422621[_0x4368('0x2a')],qs[_0x4368('0x2f')](_0x15f6d1[_0x4368('0x2b')][_0x4368('0x2f')]));_0x58e03b['attributes']=_0x58e03b[_0x4368('0x2e')][_0x4368('0x30')]?_0x58e03b[_0x4368('0x2e')]:_0x422621[_0x4368('0x2a')];if(!_0x15f6d1[_0x4368('0x2b')][_0x4368('0x31')](_0x4368('0x32'))){_0x58e03b[_0x4368('0x1a')]=qs[_0x4368('0x1a')](_0x15f6d1[_0x4368('0x2b')][_0x4368('0x1a')]);_0x58e03b[_0x4368('0x17')]=qs[_0x4368('0x17')](_0x15f6d1['query'][_0x4368('0x17')]);}_0x58e03b[_0x4368('0x33')]=qs[_0x4368('0x34')](_0x15f6d1[_0x4368('0x2b')]['sort']);_0x58e03b[_0x4368('0x35')]=qs[_0x4368('0x2c')](_[_0x4368('0x36')](_0x15f6d1[_0x4368('0x2b')],_0x422621[_0x4368('0x2c')]),_0x531118);if(_0x15f6d1['query']['filter']){_0x58e03b[_0x4368('0x35')]=_[_0x4368('0x37')](_0x58e03b[_0x4368('0x35')],{'$or':_[_0x4368('0x25')](_0x531118,function(_0x4baa9d){if(_0x4baa9d[_0x4368('0x29')]!==_0x4368('0x38')){var _0x52aae1={};_0x52aae1[_0x4baa9d[_0x4368('0x22')]]={'$like':'%'+_0x15f6d1[_0x4368('0x2b')][_0x4368('0x39')]+'%'};return _0x52aae1;}})});}_0x58e03b=_[_0x4368('0x37')]({},_0x58e03b,_0x15f6d1[_0x4368('0x3a')]);var _0x29fa4d={'where':_0x58e03b[_0x4368('0x35')]};return db[_0x4368('0x26')]['count'](_0x29fa4d)[_0x4368('0x1f')](function(_0x5df48b){_0xd0f7cf[_0x4368('0x19')]=_0x5df48b;if(_0x15f6d1[_0x4368('0x2b')][_0x4368('0x3b')]){_0x58e03b[_0x4368('0x3c')]=[{'all':!![]}];}return db[_0x4368('0x26')][_0x4368('0x3d')](_0x58e03b);})[_0x4368('0x1f')](function(_0x5e0ef5){_0xd0f7cf['rows']=_0x5e0ef5;return _0xd0f7cf;})[_0x4368('0x1f')](respondWithFilteredResult(_0x433197,_0x58e03b))['catch'](handleError(_0x433197,null));};exports[_0x4368('0x3e')]=function(_0x2648b5,_0xdc1e1a){var _0x3e8871={'raw':!![],'where':{'id':_0x2648b5[_0x4368('0x3f')]['id']}},_0x7ca153={};_0x7ca153[_0x4368('0x2a')]=_['keys'](db[_0x4368('0x26')]['rawAttributes']);_0x7ca153[_0x4368('0x2b')]=_[_0x4368('0x40')](_0x2648b5[_0x4368('0x2b')]);_0x7ca153[_0x4368('0x2c')]=_[_0x4368('0x2d')](_0x7ca153[_0x4368('0x2a')],_0x7ca153['query']);_0x3e8871[_0x4368('0x2e')]=_['intersection'](_0x7ca153[_0x4368('0x2a')],qs[_0x4368('0x2f')](_0x2648b5[_0x4368('0x2b')][_0x4368('0x2f')]));_0x3e8871[_0x4368('0x2e')]=_0x3e8871[_0x4368('0x2e')]['length']?_0x3e8871[_0x4368('0x2e')]:_0x7ca153['model'];if(_0x2648b5[_0x4368('0x2b')][_0x4368('0x3b')]){_0x3e8871[_0x4368('0x3c')]=[{'all':!![]}];}_0x3e8871=_[_0x4368('0x37')]({},_0x3e8871,_0x2648b5[_0x4368('0x3a')]);return db[_0x4368('0x26')][_0x4368('0x41')](_0x3e8871)[_0x4368('0x1f')](handleEntityNotFound(_0xdc1e1a,null))[_0x4368('0x1f')](respondWithResult(_0xdc1e1a,null))[_0x4368('0x42')](handleError(_0xdc1e1a,null));};exports[_0x4368('0x43')]=function(_0x2e545b,_0x507b67){return db[_0x4368('0x26')][_0x4368('0x43')](_0x2e545b[_0x4368('0x44')],{})[_0x4368('0x1f')](respondWithResult(_0x507b67,0xc9))['catch'](handleError(_0x507b67,null));};exports[_0x4368('0x1e')]=function(_0xc448c,_0x55c88e){if(_0xc448c['body']['id']){delete _0xc448c['body']['id'];}return db[_0x4368('0x26')][_0x4368('0x41')]({'where':{'id':_0xc448c['params']['id']}})[_0x4368('0x1f')](handleEntityNotFound(_0x55c88e,null))['then'](saveUpdates(_0xc448c[_0x4368('0x44')],null))[_0x4368('0x1f')](respondWithResult(_0x55c88e,null))[_0x4368('0x42')](handleError(_0x55c88e,null));};exports['destroy']=function(_0xc5bebf,_0x54a82b){return db[_0x4368('0x26')][_0x4368('0x41')]({'where':{'id':_0xc5bebf[_0x4368('0x3f')]['id']}})[_0x4368('0x1f')](handleEntityNotFound(_0x54a82b,null))[_0x4368('0x1f')](removeEntity(_0x54a82b,null))[_0x4368('0x42')](handleError(_0x54a82b,null));};exports[_0x4368('0x45')]=function(_0x10cb74,_0x5b92e2){return db[_0x4368('0x26')][_0x4368('0x45')]()[_0x4368('0x1f')](respondWithResult(_0x5b92e2,null))[_0x4368('0x42')](handleError(_0x5b92e2,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 839c951..5609093 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 _0xff2d=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0xff2d,0x1f1));var _0xdff2=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xff2d[_0x369151];return _0x4292d5;};'use strict';var _=require(_0xdff2('0x0'));var util=require(_0xdff2('0x1'));var logger=require(_0xdff2('0x2'))('api');var moment=require(_0xdff2('0x3'));var BPromise=require(_0xdff2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdff2('0x5'));var rimraf=require(_0xdff2('0x6'));var config=require(_0xdff2('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0xdff2('0x8')]=function(_0x4314c6,_0x42d001){return _0x4314c6['define'](_0xdff2('0x9'),attributes,{'tableName':_0xdff2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc4e=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','api','moment','request-promise','path'];(function(_0x49a861,_0x46272f){var _0x5c6b2a=function(_0x48003f){while(--_0x48003f){_0x49a861['push'](_0x49a861['shift']());}};_0x5c6b2a(++_0x46272f);}(_0xbc4e,0xea));var _0xebc4=function(_0x1e9391,_0x361d06){_0x1e9391=_0x1e9391-0x0;var _0x3fd5d8=_0xbc4e[_0x1e9391];return _0x3fd5d8;};'use strict';var _=require(_0xebc4('0x0'));var util=require(_0xebc4('0x1'));var logger=require('../../config/logger')(_0xebc4('0x2'));var moment=require(_0xebc4('0x3'));var BPromise=require('bluebird');var rp=require(_0xebc4('0x4'));var fs=require('fs');var path=require(_0xebc4('0x5'));var rimraf=require(_0xebc4('0x6'));var config=require(_0xebc4('0x7'));var attributes=require(_0xebc4('0x8'));module[_0xebc4('0x9')]=function(_0x411622,_0x1fb4e1){return _0x411622[_0xebc4('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xebc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 922b155..16625fc 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 _0xfcbb=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x439739,_0x49ec1a){_0x439739=_0x439739-0x0;var _0x30621d=_0xfcbb[_0x439739];return _0x30621d;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateSquareDetailsReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});}; \ No newline at end of file +var _0xd070=['code','message','result','catch','create','options','CreateSquareDetailsReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x26913d,_0x306f60){var _0x242cec=function(_0x30e185){while(--_0x30e185){_0x26913d['push'](_0x26913d['shift']());}};_0x242cec(++_0x306f60);}(_0xd070,0x8e));var _0x0d07=function(_0x22ac4c,_0x4ea1cd){_0x22ac4c=_0x22ac4c-0x0;var _0xc0cc75=_0xd070[_0x22ac4c];return _0xc0cc75;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['CreateSquareDetailsReport']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['SquareDetailsReport'][_0x0d07('0x18')](_0x187df2['body'],{'raw':_0x187df2['options']?_0x187df2[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d07('0xd')](function(_0x54790f){logger[_0x0d07('0xe')]('CreateSquareDetailsReport',_0x187df2);logger['debug'](_0x0d07('0x1a'),_0x187df2,JSON[_0x0d07('0x12')](_0x54790f));_0x52cb4b(_0x54790f);})[_0x0d07('0x17')](function(_0x57e997){logger[_0x0d07('0x13')]('CreateSquareDetailsReport',_0x57e997['message'],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x57e997[_0x0d07('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a6c15d6..e89018c 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 _0x62aa=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','../../components/auth/service','./system.controller','get','index'];(function(_0xde0a78,_0xf9f31d){var _0x5e7ecd=function(_0x30662a){while(--_0x30662a){_0xde0a78['push'](_0xde0a78['shift']());}};_0x5e7ecd(++_0xf9f31d);}(_0x62aa,0x1cf));var _0xa62a=function(_0x22065d,_0x11f74b){_0x22065d=_0x22065d-0x0;var _0x132f4b=_0x62aa[_0x22065d];return _0x132f4b;};'use strict';var express=require(_0xa62a('0x0'));var router=express['Router']();var auth=require(_0xa62a('0x1'));var controller=require(_0xa62a('0x2'));router[_0xa62a('0x3')]('/',auth['isAuthenticated'](),controller[_0xa62a('0x4')]);router['get'](_0xa62a('0x5'),auth[_0xa62a('0x6')](),controller[_0xa62a('0x7')]);module[_0xa62a('0x8')]=router; \ No newline at end of file +var _0x1fad=['get','index','/process/:pid/kill','exports','express','Router','./system.controller'];(function(_0xc1ede1,_0x27c567){var _0x36f293=function(_0x1fe28c){while(--_0x1fe28c){_0xc1ede1['push'](_0xc1ede1['shift']());}};_0x36f293(++_0x27c567);}(_0x1fad,0x177));var _0xd1fa=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x1fad[_0x2d91c6];return _0x3a8d19;};'use strict';var express=require(_0xd1fa('0x0'));var router=express[_0xd1fa('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd1fa('0x2'));router[_0xd1fa('0x3')]('/',auth['isAuthenticated'](),controller[_0xd1fa('0x4')]);router['get'](_0xd1fa('0x5'),auth['isAuthenticated'](),controller['killProcess']);module[_0xd1fa('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index ff0f438..64ff6a9 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 _0x0061=['systeminformation','child_process','exec','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0061,0x190));var _0x1006=function(_0x3c1246,_0x1c1a8c){_0x3c1246=_0x3c1246-0x0;var _0x5c7dbf=_0x0061[_0x3c1246];return _0x5c7dbf;};'use strict';var info=require(_0x1006('0x0'));var exec=require(_0x1006('0x1'))[_0x1006('0x2')];var logger=require('../../config/logger')(_0x1006('0x3'));var util=require(_0x1006('0x4'));var BPromise=require(_0x1006('0x5'));var _=require(_0x1006('0x6'));function handleError(_0x931b78,_0x1179b2,_0x3d4166){_0x1179b2=_0x1179b2||0x1f4;return function(_0x383e17){logger['error'](_0x1006('0x7'),_0x3d4166,_0x1179b2,util['inspect'](_0x383e17,{'showHidden':![],'depth':null}));delete _0x383e17['name'];_0x931b78[_0x1006('0x8')](_0x1179b2)['send'](_0x383e17);};}exports[_0x1006('0x9')]=function(_0x8d6098,_0x187188){return info[_0x1006('0xa')]()[_0x1006('0xb')](function(_0x207d88){return _0x187188[_0x1006('0x8')](0xc8)[_0x1006('0xc')](_0x207d88);})['catch'](function(_0x1007cf){return _0x187188['status'](0x1f4)['json'](_0x1007cf);});};exports[_0x1006('0xd')]=function(_0x9b9510,_0x133672){var _0x3b1ac3=[_0x1006('0xe')];return new BPromise(function(_0x519070,_0xd18dcd){return exec(util[_0x1006('0xf')](_0x1006('0x10'),_0x9b9510[_0x1006('0x11')][_0x1006('0x12')]),function(_0x53a8bf,_0x668236,_0x39c089){if(_0x53a8bf){return _0xd18dcd(_0x53a8bf);}return _0x519070(_0x668236);});})[_0x1006('0xb')](function(_0xb60ac6){var _0x1a18c8=![];var _0x22d510=_0xb60ac6[_0x1006('0x13')](/\n/);for(var _0x5a30e8=0x0,_0x35c510=_0x3b1ac3['length'];_0x5a30e8<_0x35c510,_0x1a18c8===![];_0x5a30e8+=0x1){if(_0xb60ac6[_0x1006('0x14')](_0x3b1ac3[_0x5a30e8])>=0x0){_0x1a18c8=!![];}}if(!_0x1a18c8){throw new Error(util[_0x1006('0xf')](_0x1006('0x15'),_0x9b9510[_0x1006('0x11')][_0x1006('0x12')]));}process['kill'](_0x9b9510[_0x1006('0x11')][_0x1006('0x12')],_0x1006('0x16'));return _0x133672[_0x1006('0x8')](0xc8)[_0x1006('0xc')]({'message':util['format'](_0x1006('0x17'),_0x9b9510['params'][_0x1006('0x12')])});})[_0x1006('0x18')](handleError(_0x133672,null,_0x1006('0xd')));}; \ No newline at end of file +var _0xf903=['catch','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','lodash','error','inspect','name','index','getAllData','then','json'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf903,0x14e));var _0x3f90=function(_0x5f3e2b,_0x269bc0){_0x5f3e2b=_0x5f3e2b-0x0;var _0x13b396=_0xf903[_0x5f3e2b];return _0x13b396;};'use strict';var info=require(_0x3f90('0x0'));var exec=require('child_process')[_0x3f90('0x1')];var logger=require('../../config/logger')(_0x3f90('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x3f90('0x3'));function handleError(_0x2542c4,_0x1af380,_0x472151){_0x1af380=_0x1af380||0x1f4;return function(_0x1b204b){logger[_0x3f90('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x472151,_0x1af380,util[_0x3f90('0x5')](_0x1b204b,{'showHidden':![],'depth':null}));delete _0x1b204b[_0x3f90('0x6')];_0x2542c4['status'](_0x1af380)['send'](_0x1b204b);};}exports[_0x3f90('0x7')]=function(_0x24fefa,_0x29c626){return info[_0x3f90('0x8')]()[_0x3f90('0x9')](function(_0x29883f){return _0x29c626['status'](0xc8)[_0x3f90('0xa')](_0x29883f);})[_0x3f90('0xb')](function(_0x39d18f){return _0x29c626[_0x3f90('0xc')](0x1f4)[_0x3f90('0xa')](_0x39d18f);});};exports[_0x3f90('0xd')]=function(_0x4855c2,_0xbbec4c){var _0x1bbebf=[_0x3f90('0xe')];return new BPromise(function(_0x57f843,_0x4398cc){return exec(util[_0x3f90('0xf')](_0x3f90('0x10'),_0x4855c2[_0x3f90('0x11')][_0x3f90('0x12')]),function(_0x564401,_0x45a052,_0x1ef9ad){if(_0x564401){return _0x4398cc(_0x564401);}return _0x57f843(_0x45a052);});})['then'](function(_0xc83a11){var _0x2c0621=![];var _0x145559=_0xc83a11[_0x3f90('0x13')](/\n/);for(var _0x29fc78=0x0,_0x3f54e4=_0x1bbebf['length'];_0x29fc78<_0x3f54e4,_0x2c0621===![];_0x29fc78+=0x1){if(_0xc83a11[_0x3f90('0x14')](_0x1bbebf[_0x29fc78])>=0x0){_0x2c0621=!![];}}if(!_0x2c0621){throw new Error(util[_0x3f90('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4855c2['params'][_0x3f90('0x12')]));}process['kill'](_0x4855c2[_0x3f90('0x11')][_0x3f90('0x12')],_0x3f90('0x15'));return _0xbbec4c[_0x3f90('0xc')](0xc8)[_0x3f90('0xa')]({'message':util[_0x3f90('0xf')](_0x3f90('0x16'),_0x4855c2[_0x3f90('0x11')][_0x3f90('0x12')])});})[_0x3f90('0xb')](handleError(_0xbbec4c,null,_0x3f90('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b8b1457..7fbb846 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 _0x0c9d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util','path','express','Router'];(function(_0x33f9fe,_0x117bb4){var _0x2ad85f=function(_0xb3f46b){while(--_0xb3f46b){_0x33f9fe['push'](_0x33f9fe['shift']());}};_0x2ad85f(++_0x117bb4);}(_0x0c9d,0x14f));var _0xd0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd0c9('0x0'));var util=require(_0xd0c9('0x1'));var path=require(_0xd0c9('0x2'));var timeout=require('connect-timeout');var express=require(_0xd0c9('0x3'));var router=express[_0xd0c9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd0c9('0x5'));var interaction=require(_0xd0c9('0x6'));var config=require(_0xd0c9('0x7'));var controller=require(_0xd0c9('0x8'));router[_0xd0c9('0x9')]('/',auth[_0xd0c9('0xa')](),controller[_0xd0c9('0xb')]);router[_0xd0c9('0x9')](_0xd0c9('0xc'),auth[_0xd0c9('0xa')](),controller[_0xd0c9('0xd')]);router[_0xd0c9('0xe')]('/',auth[_0xd0c9('0xa')](),controller['create']);router[_0xd0c9('0xf')](_0xd0c9('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd0c9('0xc'),auth[_0xd0c9('0xa')](),controller['destroy']);module[_0xd0c9('0x10')]=router; \ No newline at end of file +var _0x5713=['/:id','post','create','put','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x31b640,_0x1e0350){var _0x3b7a98=function(_0x2e4414){while(--_0x2e4414){_0x31b640['push'](_0x31b640['shift']());}};_0x3b7a98(++_0x1e0350);}(_0x5713,0x1c7));var _0x3571=function(_0x4e4618,_0x5506f3){_0x4e4618=_0x4e4618-0x0;var _0x5a1df9=_0x5713[_0x4e4618];return _0x5a1df9;};'use strict';var multer=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var path=require('path');var timeout=require(_0x3571('0x2'));var express=require('express');var router=express[_0x3571('0x3')]();var fs_extra=require(_0x3571('0x4'));var auth=require(_0x3571('0x5'));var interaction=require(_0x3571('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x3571('0x7')]('/',auth[_0x3571('0x8')](),controller[_0x3571('0x9')]);router[_0x3571('0x7')](_0x3571('0xa'),auth[_0x3571('0x8')](),controller['show']);router[_0x3571('0xb')]('/',auth[_0x3571('0x8')](),controller[_0x3571('0xc')]);router[_0x3571('0xd')](_0x3571('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3571('0xe')](_0x3571('0xa'),auth[_0x3571('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7ed7619..cb65594 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 _0x236c=['#0091EA','sequelize','STRING','name'];(function(_0xd32e47,_0x4510f3){var _0x50ac4a=function(_0x346aa5){while(--_0x346aa5){_0xd32e47['push'](_0xd32e47['shift']());}};_0x50ac4a(++_0x4510f3);}(_0x236c,0x155));var _0xc236=function(_0x3dc0a0,_0x19b6b5){_0x3dc0a0=_0x3dc0a0-0x0;var _0x31b959=_0x236c[_0x3dc0a0];return _0x31b959;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc236('0x1')],'defaultValue':_0xc236('0x3')},'description':{'type':Sequelize[_0xc236('0x1')]}}; \ No newline at end of file +var _0x407f=['STRING','#0091EA','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x407f,0xc2));var _0xf407=function(_0x21e9cf,_0x19387e){_0x21e9cf=_0x21e9cf-0x0;var _0x3515a9=_0x407f[_0x21e9cf];return _0x3515a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf407('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf407('0x1')],'defaultValue':_0xf407('0x2')},'description':{'type':Sequelize[_0xf407('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 0e394b7..cf00c07 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 _0x2121=['include','findAll','rows','catch','show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','create','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x1e9ce7,_0x4bceb8){var _0x500893=function(_0x2a0b91){while(--_0x2a0b91){_0x1e9ce7['push'](_0x1e9ce7['shift']());}};_0x500893(++_0x4bceb8);}(_0x2121,0x1b4));var _0x1212=function(_0x2f904c,_0xf18a92){_0x2f904c=_0x2f904c-0x0;var _0x8cbf0b=_0x2121[_0x2f904c];return _0x8cbf0b;};'use strict';var emlformat=require(_0x1212('0x0'));var rimraf=require(_0x1212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1212('0x2'));var moment=require(_0x1212('0x3'));var BPromise=require(_0x1212('0x4'));var Mustache=require(_0x1212('0x5'));var util=require(_0x1212('0x6'));var path=require('path');var sox=require(_0x1212('0x7'));var csv=require('to-csv');var ejs=require(_0x1212('0x8'));var fs=require('fs');var fs_extra=require(_0x1212('0x9'));var _=require(_0x1212('0xa'));var squel=require(_0x1212('0xb'));var crypto=require(_0x1212('0xc'));var jsforce=require(_0x1212('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1212('0xe'));var querystring=require(_0x1212('0xf'));var Papa=require(_0x1212('0x10'));var Redis=require(_0x1212('0x11'));var authService=require(_0x1212('0x12'));var qs=require(_0x1212('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1212('0x14'))(_0x1212('0x15'));var utils=require(_0x1212('0x16'));var config=require(_0x1212('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1212('0x18'))['db'];function respondWithStatusCode(_0x3cb42e,_0x17882d){_0x17882d=_0x17882d||0xcc;return function(_0x3e33fe){if(_0x3e33fe){return _0x3cb42e[_0x1212('0x19')](_0x17882d);}return _0x3cb42e[_0x1212('0x1a')](_0x17882d)[_0x1212('0x1b')]();};}function respondWithResult(_0x3ee480,_0x469cf6){_0x469cf6=_0x469cf6||0xc8;return function(_0x35b8ac){if(_0x35b8ac){return _0x3ee480[_0x1212('0x1a')](_0x469cf6)[_0x1212('0x1c')](_0x35b8ac);}};}function respondWithFilteredResult(_0x5ecfe5,_0x13e062){return function(_0x1919e1){if(_0x1919e1){var _0x5cc246=typeof _0x13e062['offset']==='undefined'&&typeof _0x13e062[_0x1212('0x1d')]===_0x1212('0x1e');var _0x768995=_0x1919e1[_0x1212('0x1f')];var _0x3cf284=_0x5cc246?0x0:_0x13e062[_0x1212('0x20')];var _0xb0dc88=_0x5cc246?_0x1919e1[_0x1212('0x1f')]:_0x13e062[_0x1212('0x20')]+_0x13e062['limit'];var _0x3c638a;if(_0xb0dc88>=_0x768995){_0xb0dc88=_0x768995;_0x3c638a=0xc8;}else{_0x3c638a=0xce;}_0x5ecfe5[_0x1212('0x1a')](_0x3c638a);return _0x5ecfe5[_0x1212('0x21')](_0x1212('0x22'),_0x3cf284+'-'+_0xb0dc88+'/'+_0x768995)[_0x1212('0x1c')](_0x1919e1);}return null;};}function patchUpdates(_0x2e656f){return function(_0x7d0810){try{jsonpatch[_0x1212('0x23')](_0x7d0810,_0x2e656f,!![]);}catch(_0x4e5437){return BPromise[_0x1212('0x24')](_0x4e5437);}return _0x7d0810[_0x1212('0x25')]();};}function saveUpdates(_0x46d6df,_0x5d15ca){return function(_0x1571fd){if(_0x1571fd){return _0x1571fd[_0x1212('0x26')](_0x46d6df)[_0x1212('0x27')](function(_0x28c92b){return _0x28c92b;});}return null;};}function removeEntity(_0x52132b,_0x58ab5b){return function(_0x59cd01){if(_0x59cd01){return _0x59cd01['destroy']()['then'](function(){var _0xec5b8d=_0x59cd01[_0x1212('0x28')]({'plain':!![]});var _0x4c32a7=_0x1212('0x29');return db[_0x1212('0x2a')]['destroy']({'where':{'type':_0x4c32a7,'resourceId':_0xec5b8d['id']}})[_0x1212('0x27')](function(){return _0x59cd01;});})[_0x1212('0x27')](function(){_0x52132b[_0x1212('0x1a')](0xcc)[_0x1212('0x1b')]();});}};}function handleEntityNotFound(_0x3a0ddf,_0x3f6be3){return function(_0x2750b0){if(!_0x2750b0){_0x3a0ddf[_0x1212('0x19')](0x194);}return _0x2750b0;};}function handleError(_0x53aa25,_0x156b50){_0x156b50=_0x156b50||0x1f4;return function(_0x7706a0){logger[_0x1212('0x2b')](_0x7706a0[_0x1212('0x2c')]);if(_0x7706a0[_0x1212('0x2d')]){delete _0x7706a0[_0x1212('0x2d')];}_0x53aa25[_0x1212('0x1a')](_0x156b50)[_0x1212('0x2e')](_0x7706a0);};}exports[_0x1212('0x2f')]=function(_0x1e3506,_0x4b8e34){var _0x5a9b18={},_0x365232={},_0x5769a9={'count':0x0,'rows':[]};var _0x339d58=_['map'](db[_0x1212('0x30')]['rawAttributes'],function(_0x2c9313){return{'name':_0x2c9313[_0x1212('0x31')],'type':_0x2c9313[_0x1212('0x32')][_0x1212('0x33')]};});_0x365232['model']=_[_0x1212('0x34')](_0x339d58,_0x1212('0x2d'));_0x365232[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1e3506[_0x1212('0x35')]);_0x365232['filters']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],_0x365232[_0x1212('0x35')]);_0x5a9b18['attributes']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],qs[_0x1212('0x39')](_0x1e3506[_0x1212('0x35')]['fields']));_0x5a9b18[_0x1212('0x3a')]=_0x5a9b18[_0x1212('0x3a')]['length']?_0x5a9b18[_0x1212('0x3a')]:_0x365232[_0x1212('0x38')];if(!_0x1e3506[_0x1212('0x35')]['hasOwnProperty'](_0x1212('0x3b'))){_0x5a9b18[_0x1212('0x1d')]=qs[_0x1212('0x1d')](_0x1e3506['query'][_0x1212('0x1d')]);_0x5a9b18['offset']=qs[_0x1212('0x20')](_0x1e3506[_0x1212('0x35')]['offset']);}_0x5a9b18['order']=qs[_0x1212('0x3c')](_0x1e3506['query'][_0x1212('0x3c')]);_0x5a9b18[_0x1212('0x3d')]=qs[_0x1212('0x3e')](_[_0x1212('0x3f')](_0x1e3506[_0x1212('0x35')],_0x365232[_0x1212('0x3e')]),_0x339d58);if(_0x1e3506[_0x1212('0x35')][_0x1212('0x40')]){_0x5a9b18[_0x1212('0x3d')]=_[_0x1212('0x41')](_0x5a9b18[_0x1212('0x3d')],{'$or':_[_0x1212('0x34')](_0x339d58,function(_0x4995e1){if(_0x4995e1[_0x1212('0x32')]!==_0x1212('0x42')){var _0x42b95a={};_0x42b95a[_0x4995e1[_0x1212('0x2d')]]={'$like':'%'+_0x1e3506[_0x1212('0x35')]['filter']+'%'};return _0x42b95a;}})});}_0x5a9b18=_[_0x1212('0x41')]({},_0x5a9b18,_0x1e3506['options']);var _0x50fc00={'where':_0x5a9b18[_0x1212('0x3d')]};return db[_0x1212('0x30')][_0x1212('0x1f')](_0x50fc00)[_0x1212('0x27')](function(_0x469fcd){_0x5769a9['count']=_0x469fcd;if(_0x1e3506['query'][_0x1212('0x43')]){_0x5a9b18[_0x1212('0x44')]=[{'all':!![]}];}return db[_0x1212('0x30')][_0x1212('0x45')](_0x5a9b18);})[_0x1212('0x27')](function(_0x640717){_0x5769a9[_0x1212('0x46')]=_0x640717;return _0x5769a9;})[_0x1212('0x27')](respondWithFilteredResult(_0x4b8e34,_0x5a9b18))[_0x1212('0x47')](handleError(_0x4b8e34,null));};exports[_0x1212('0x48')]=function(_0x1af6ae,_0x15e1ce){var _0x4e1a32={'raw':!![],'where':{'id':_0x1af6ae[_0x1212('0x49')]['id']}},_0x584d32={};_0x584d32[_0x1212('0x38')]=_['keys'](db[_0x1212('0x30')]['rawAttributes']);_0x584d32[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1af6ae[_0x1212('0x35')]);_0x584d32[_0x1212('0x3e')]=_[_0x1212('0x37')](_0x584d32['model'],_0x584d32[_0x1212('0x35')]);_0x4e1a32[_0x1212('0x3a')]=_[_0x1212('0x37')](_0x584d32['model'],qs[_0x1212('0x39')](_0x1af6ae[_0x1212('0x35')]['fields']));_0x4e1a32[_0x1212('0x3a')]=_0x4e1a32[_0x1212('0x3a')][_0x1212('0x4a')]?_0x4e1a32[_0x1212('0x3a')]:_0x584d32[_0x1212('0x38')];if(_0x1af6ae[_0x1212('0x35')]['includeAll']){_0x4e1a32[_0x1212('0x44')]=[{'all':!![]}];}_0x4e1a32=_[_0x1212('0x41')]({},_0x4e1a32,_0x1af6ae[_0x1212('0x4b')]);return db['Tag']['find'](_0x4e1a32)[_0x1212('0x27')](handleEntityNotFound(_0x15e1ce,null))['then'](respondWithResult(_0x15e1ce,null))[_0x1212('0x47')](handleError(_0x15e1ce,null));};exports['create']=function(_0x50a8ef,_0x19a24f){return db[_0x1212('0x30')]['create'](_0x50a8ef[_0x1212('0x4c')],{})['then'](function(_0x2972a3){var _0x24cae5=_0x50a8ef['user']['get']({'plain':!![]});if(!_0x24cae5)throw new Error(_0x1212('0x4d'));if(_0x24cae5['role']===_0x1212('0x4e')){var _0x53a46f=_0x2972a3[_0x1212('0x28')]({'plain':!![]});var _0x49b71b=_0x1212('0x29');return db[_0x1212('0x4f')][_0x1212('0x50')]({'where':{'name':_0x49b71b,'userProfileId':_0x24cae5[_0x1212('0x51')]},'raw':!![]})[_0x1212('0x27')](function(_0xcc376d){if(_0xcc376d&&_0xcc376d['autoAssociation']===0x0){return db['UserProfileResource'][_0x1212('0x52')]({'name':_0x53a46f[_0x1212('0x2d')],'resourceId':_0x53a46f['id'],'type':_0xcc376d[_0x1212('0x2d')],'sectionId':_0xcc376d['id']},{})[_0x1212('0x27')](function(){return _0x2972a3;});}else{return _0x2972a3;}})[_0x1212('0x47')](function(_0x3c1acf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1acf);throw _0x3c1acf;});}return _0x2972a3;})['then'](respondWithResult(_0x19a24f,0xc9))[_0x1212('0x47')](handleError(_0x19a24f,null));};exports[_0x1212('0x26')]=function(_0x233854,_0x160cb8){if(_0x233854[_0x1212('0x4c')]['id']){delete _0x233854['body']['id'];}return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x233854[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x160cb8,null))[_0x1212('0x27')](saveUpdates(_0x233854[_0x1212('0x4c')],null))['then'](respondWithResult(_0x160cb8,null))[_0x1212('0x47')](handleError(_0x160cb8,null));};exports[_0x1212('0x53')]=function(_0x31d8be,_0x4a86bd){return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x31d8be[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x4a86bd,null))['then'](removeEntity(_0x4a86bd,null))[_0x1212('0x47')](handleError(_0x4a86bd,null));}; \ No newline at end of file +var _0x9c5e=['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','get','UserProfileResource','end','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x5bb551,_0x39495a){var _0x312415=function(_0x22e5e1){while(--_0x22e5e1){_0x5bb551['push'](_0x5bb551['shift']());}};_0x312415(++_0x39495a);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x352cc7,_0x202916){_0x352cc7=_0x352cc7-0x0;var _0x2eb52b=_0x9c5e[_0x352cc7];return _0x2eb52b;};'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(){var _0x1cd9c4=_0x245161[_0xe9c5('0x28')]({'plain':!![]});var _0x5a3caa='Tags';return db[_0xe9c5('0x29')][_0xe9c5('0x27')]({'where':{'type':_0x5a3caa,'resourceId':_0x1cd9c4['id']}})[_0xe9c5('0x26')](function(){return _0x245161;});})[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x2a')]();});}};}function handleEntityNotFound(_0x493108,_0x2c3fcb){return function(_0x480187){if(!_0x480187){_0x493108[_0xe9c5('0x19')](0x194);}return _0x480187;};}function handleError(_0x50256b,_0x4fa0c2){_0x4fa0c2=_0x4fa0c2||0x1f4;return function(_0x2112a6){logger['error'](_0x2112a6[_0xe9c5('0x2b')]);if(_0x2112a6[_0xe9c5('0x2c')]){delete _0x2112a6[_0xe9c5('0x2c')];}_0x50256b[_0xe9c5('0x1a')](_0x4fa0c2)[_0xe9c5('0x2d')](_0x2112a6);};}exports['index']=function(_0xe3464c,_0x4fcabd){var _0x46d3e6={},_0x5088a6={},_0x348fee={'count':0x0,'rows':[]};var _0x32e267=_[_0xe9c5('0x2e')](db[_0xe9c5('0x2f')][_0xe9c5('0x30')],function(_0x4e6043){return{'name':_0x4e6043[_0xe9c5('0x31')],'type':_0x4e6043[_0xe9c5('0x32')][_0xe9c5('0x33')]};});_0x5088a6[_0xe9c5('0x34')]=_[_0xe9c5('0x2e')](_0x32e267,'name');_0x5088a6['query']=_[_0xe9c5('0x35')](_0xe3464c[_0xe9c5('0x36')]);_0x5088a6[_0xe9c5('0x37')]=_[_0xe9c5('0x38')](_0x5088a6[_0xe9c5('0x34')],_0x5088a6[_0xe9c5('0x36')]);_0x46d3e6[_0xe9c5('0x39')]=_[_0xe9c5('0x38')](_0x5088a6['model'],qs[_0xe9c5('0x3a')](_0xe3464c[_0xe9c5('0x36')]['fields']));_0x46d3e6[_0xe9c5('0x39')]=_0x46d3e6['attributes'][_0xe9c5('0x3b')]?_0x46d3e6[_0xe9c5('0x39')]:_0x5088a6[_0xe9c5('0x34')];if(!_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x3c')](_0xe9c5('0x3d'))){_0x46d3e6[_0xe9c5('0x1d')]=qs[_0xe9c5('0x1d')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x1d')]);_0x46d3e6[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x1f')]);}_0x46d3e6[_0xe9c5('0x3e')]=qs[_0xe9c5('0x3f')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x3f')]);_0x46d3e6[_0xe9c5('0x40')]=qs['filters'](_[_0xe9c5('0x41')](_0xe3464c[_0xe9c5('0x36')],_0x5088a6[_0xe9c5('0x37')]),_0x32e267);if(_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x42')]){_0x46d3e6[_0xe9c5('0x40')]=_['merge'](_0x46d3e6[_0xe9c5('0x40')],{'$or':_[_0xe9c5('0x2e')](_0x32e267,function(_0x3a8be8){if(_0x3a8be8['type']!==_0xe9c5('0x43')){var _0x1bf7c5={};_0x1bf7c5[_0x3a8be8[_0xe9c5('0x2c')]]={'$like':'%'+_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x42')]+'%'};return _0x1bf7c5;}})});}_0x46d3e6=_[_0xe9c5('0x44')]({},_0x46d3e6,_0xe3464c[_0xe9c5('0x45')]);var _0x1fdf92={'where':_0x46d3e6[_0xe9c5('0x40')]};return db[_0xe9c5('0x2f')][_0xe9c5('0x1e')](_0x1fdf92)['then'](function(_0x51dd18){_0x348fee[_0xe9c5('0x1e')]=_0x51dd18;if(_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x46')]){_0x46d3e6[_0xe9c5('0x47')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x46d3e6);})[_0xe9c5('0x26')](function(_0x144e85){_0x348fee['rows']=_0x144e85;return _0x348fee;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x4fcabd,_0x46d3e6))['catch'](handleError(_0x4fcabd,null));};exports['show']=function(_0x5c395d,_0x3c7e42){var _0x232ab0={'raw':!![],'where':{'id':_0x5c395d[_0xe9c5('0x48')]['id']}},_0x1d081a={};_0x1d081a['model']=_[_0xe9c5('0x35')](db[_0xe9c5('0x2f')][_0xe9c5('0x30')]);_0x1d081a[_0xe9c5('0x36')]=_[_0xe9c5('0x35')](_0x5c395d[_0xe9c5('0x36')]);_0x1d081a[_0xe9c5('0x37')]=_[_0xe9c5('0x38')](_0x1d081a['model'],_0x1d081a[_0xe9c5('0x36')]);_0x232ab0[_0xe9c5('0x39')]=_[_0xe9c5('0x38')](_0x1d081a[_0xe9c5('0x34')],qs[_0xe9c5('0x3a')](_0x5c395d[_0xe9c5('0x36')]['fields']));_0x232ab0['attributes']=_0x232ab0['attributes']['length']?_0x232ab0[_0xe9c5('0x39')]:_0x1d081a[_0xe9c5('0x34')];if(_0x5c395d[_0xe9c5('0x36')]['includeAll']){_0x232ab0[_0xe9c5('0x47')]=[{'all':!![]}];}_0x232ab0=_[_0xe9c5('0x44')]({},_0x232ab0,_0x5c395d[_0xe9c5('0x45')]);return db[_0xe9c5('0x2f')][_0xe9c5('0x49')](_0x232ab0)[_0xe9c5('0x26')](handleEntityNotFound(_0x3c7e42,null))['then'](respondWithResult(_0x3c7e42,null))[_0xe9c5('0x4a')](handleError(_0x3c7e42,null));};exports[_0xe9c5('0x4b')]=function(_0x1da6a3,_0x249940){return db['Tag'][_0xe9c5('0x4b')](_0x1da6a3[_0xe9c5('0x4c')],{})[_0xe9c5('0x26')](function(_0x2d68be){var _0x38396f=_0x1da6a3[_0xe9c5('0x4d')]['get']({'plain':!![]});if(!_0x38396f)throw new Error(_0xe9c5('0x4e'));if(_0x38396f[_0xe9c5('0x4f')]===_0xe9c5('0x4d')){var _0x9d0154=_0x2d68be['get']({'plain':!![]});var _0x375f60=_0xe9c5('0x50');return db[_0xe9c5('0x51')][_0xe9c5('0x49')]({'where':{'name':_0x375f60,'userProfileId':_0x38396f[_0xe9c5('0x52')]},'raw':!![]})[_0xe9c5('0x26')](function(_0x581f8f){if(_0x581f8f&&_0x581f8f['autoAssociation']===0x0){return db[_0xe9c5('0x29')][_0xe9c5('0x4b')]({'name':_0x9d0154[_0xe9c5('0x2c')],'resourceId':_0x9d0154['id'],'type':_0x581f8f[_0xe9c5('0x2c')],'sectionId':_0x581f8f['id']},{})[_0xe9c5('0x26')](function(){return _0x2d68be;});}else{return _0x2d68be;}})[_0xe9c5('0x4a')](function(_0x2a9260){logger[_0xe9c5('0x53')](_0xe9c5('0x54'),_0x2a9260);throw _0x2a9260;});}return _0x2d68be;})[_0xe9c5('0x26')](respondWithResult(_0x249940,0xc9))[_0xe9c5('0x4a')](handleError(_0x249940,null));};exports[_0xe9c5('0x25')]=function(_0x2086fd,_0x3cd72b){if(_0x2086fd[_0xe9c5('0x4c')]['id']){delete _0x2086fd[_0xe9c5('0x4c')]['id'];}return db['Tag']['find']({'where':{'id':_0x2086fd['params']['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x3cd72b,null))[_0xe9c5('0x26')](saveUpdates(_0x2086fd[_0xe9c5('0x4c')],null))['then'](respondWithResult(_0x3cd72b,null))[_0xe9c5('0x4a')](handleError(_0x3cd72b,null));};exports['destroy']=function(_0x227370,_0xbac8ef){return db[_0xe9c5('0x2f')][_0xe9c5('0x49')]({'where':{'id':_0x227370[_0xe9c5('0x48')]['id']}})['then'](handleEntityNotFound(_0xbac8ef,null))[_0xe9c5('0x26')](removeEntity(_0xbac8ef,null))[_0xe9c5('0x4a')](handleError(_0xbac8ef,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2aefad8..4fb9f44 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 _0xb812=['./tag.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0xb812,0xf5));var _0x2b81=function(_0x38c60a,_0x1af373){_0x38c60a=_0x38c60a-0x0;var _0xa31639=_0xb812[_0x38c60a];return _0xa31639;};'use strict';var _=require('lodash');var util=require(_0x2b81('0x0'));var logger=require(_0x2b81('0x1'))(_0x2b81('0x2'));var moment=require(_0x2b81('0x3'));var BPromise=require(_0x2b81('0x4'));var rp=require(_0x2b81('0x5'));var fs=require('fs');var path=require(_0x2b81('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b81('0x7'));module['exports']=function(_0x2a136e,_0x1d5864){return _0x2a136e[_0x2b81('0x8')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x981b=['tools_tags','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x981b,0xfd));var _0xb981=function(_0x53d4b3,_0x944298){_0x53d4b3=_0x53d4b3-0x0;var _0x1228bb=_0x981b[_0x53d4b3];return _0x1228bb;};'use strict';var _=require(_0xb981('0x0'));var util=require(_0xb981('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb981('0x2'));var BPromise=require(_0xb981('0x3'));var rp=require(_0xb981('0x4'));var fs=require('fs');var path=require(_0xb981('0x5'));var rimraf=require(_0xb981('0x6'));var config=require(_0xb981('0x7'));var attributes=require(_0xb981('0x8'));module[_0xb981('0x9')]=function(_0x25054a,_0x19d116){return _0x25054a['define'](_0xb981('0xa'),attributes,{'tableName':_0xb981('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 6e1b8a6..24bc62f 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 _0x0a12=['error','code','message','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x279ed1,_0x49b430){var _0x3e5dc9=function(_0x570be8){while(--_0x570be8){_0x279ed1['push'](_0x279ed1['shift']());}};_0x3e5dc9(++_0x49b430);}(_0x0a12,0xb8));var _0x20a1=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0a12[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20a1('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x20a1('0x2'));var logger=require(_0x20a1('0x3'))(_0x20a1('0x4'));var config=require(_0x20a1('0x5'));var jayson=require(_0x20a1('0x6'));var client=jayson[_0x20a1('0x7')][_0x20a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51f7db,_0x494314,_0x28ed27){return new BPromise(function(_0x52fb53,_0x548be6){return client[_0x20a1('0x9')](_0x51f7db,_0x28ed27)[_0x20a1('0xa')](function(_0x26c1df){logger[_0x20a1('0xb')](_0x20a1('0xc'),_0x494314,_0x20a1('0xd'));logger[_0x20a1('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x494314,_0x20a1('0xd'),JSON[_0x20a1('0xf')](_0x26c1df));if(_0x26c1df[_0x20a1('0x10')]){if(_0x26c1df[_0x20a1('0x10')][_0x20a1('0x11')]===0x1f4){logger[_0x20a1('0x10')]('Tag,\x20%s,\x20%s',_0x494314,_0x26c1df[_0x20a1('0x10')][_0x20a1('0x12')]);return _0x548be6(_0x26c1df[_0x20a1('0x10')][_0x20a1('0x12')]);}logger[_0x20a1('0x10')](_0x20a1('0xc'),_0x494314,_0x26c1df[_0x20a1('0x10')][_0x20a1('0x12')]);return _0x52fb53(_0x26c1df[_0x20a1('0x10')][_0x20a1('0x12')]);}else{logger[_0x20a1('0xb')](_0x20a1('0xc'),_0x494314,_0x20a1('0xd'));_0x52fb53(_0x26c1df[_0x20a1('0x13')]['message']);}})['catch'](function(_0x5b26af){logger['error']('Tag,\x20%s,\x20%s',_0x494314,_0x5b26af);_0x548be6(_0x5b26af);});});} \ No newline at end of file +var _0x2d17=['Tag,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39d518,_0x32b600){var _0x2feade=function(_0x272839){while(--_0x272839){_0x39d518['push'](_0x39d518['shift']());}};_0x2feade(++_0x32b600);}(_0x2d17,0x17e));var _0x72d1=function(_0x54d308,_0x4486fa){_0x54d308=_0x54d308-0x0;var _0xdc98c0=_0x2d17[_0x54d308];return _0xdc98c0;};'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')]('Tag,\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/team/index.js b/server/api/team/index.js index e8576c5..18fec40 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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['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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 252b8e0..8caae54 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(_0x78665d,_0x259080){var _0x51eb1f=function(_0x360032){while(--_0x360032){_0x78665d['push'](_0x78665d['shift']());}};_0x51eb1f(++_0x259080);}(_0x757a,0xde));var _0xa757=function(_0x1d2fd6,_0x3ccfbb){_0x1d2fd6=_0x1d2fd6-0x0;var _0x27f3ef=_0x757a[_0x1d2fd6];return _0x27f3ef;};'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 _0xbaf0=['name','exports','STRING'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4a49459..d49a2e1 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 _0x867f=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','error','stack','name','index','map','Team','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','sequelize','transaction','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','destroy','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','addQueues','Unknown\x20channel','add','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Queue:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x3253a4,_0x43a815){var _0xb6a170=function(_0x224a14){while(--_0x224a14){_0x3253a4['push'](_0x3253a4['shift']());}};_0xb6a170(++_0x43a815);}(_0x867f,0x11e));var _0xf867=function(_0x3d4a2b,_0xca71a8){_0x3d4a2b=_0x3d4a2b-0x0;var _0x5c55c6=_0x867f[_0x3d4a2b];return _0x5c55c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf867('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var Mustache=require(_0xf867('0x4'));var util=require(_0xf867('0x5'));var path=require(_0xf867('0x6'));var sox=require(_0xf867('0x7'));var csv=require(_0xf867('0x8'));var ejs=require(_0xf867('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf867('0xa'));var squel=require(_0xf867('0xb'));var crypto=require(_0xf867('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf867('0xd'));var toCsv=require(_0xf867('0x8'));var querystring=require('querystring');var Papa=require(_0xf867('0xe'));var Redis=require(_0xf867('0xf'));var authService=require(_0xf867('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf867('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf867('0x12'))(_0xf867('0x13'));var utils=require(_0xf867('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf867('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf867('0x16')](config[_0xf867('0x17')],{'host':_0xf867('0x18'),'port':0x18eb});var socket=require(_0xf867('0x19'))(new Redis(config[_0xf867('0x17')]));require(_0xf867('0x1a'))['register'](socket);function respondWithStatusCode(_0x3d9b47,_0x4b6352){_0x4b6352=_0x4b6352||0xcc;return function(_0x2f598c){if(_0x2f598c){return _0x3d9b47[_0xf867('0x1b')](_0x4b6352);}return _0x3d9b47['status'](_0x4b6352)[_0xf867('0x1c')]();};}function respondWithResult(_0x426da5,_0x48bbfb){_0x48bbfb=_0x48bbfb||0xc8;return function(_0x278d0b){if(_0x278d0b){return _0x426da5['status'](_0x48bbfb)[_0xf867('0x1d')](_0x278d0b);}};}function respondWithFilteredResult(_0x35d5bc,_0x3f8bc6){return function(_0x27afc2){if(_0x27afc2){var _0x29e1ea=typeof _0x3f8bc6[_0xf867('0x1e')]===_0xf867('0x1f')&&typeof _0x3f8bc6[_0xf867('0x20')]==='undefined';var _0x59fe43=_0x27afc2[_0xf867('0x21')];var _0x25dc71=_0x29e1ea?0x0:_0x3f8bc6[_0xf867('0x1e')];var _0x112c30=_0x29e1ea?_0x27afc2[_0xf867('0x21')]:_0x3f8bc6['offset']+_0x3f8bc6['limit'];var _0xb5b558;if(_0x112c30>=_0x59fe43){_0x112c30=_0x59fe43;_0xb5b558=0xc8;}else{_0xb5b558=0xce;}_0x35d5bc[_0xf867('0x22')](_0xb5b558);return _0x35d5bc[_0xf867('0x23')](_0xf867('0x24'),_0x25dc71+'-'+_0x112c30+'/'+_0x59fe43)[_0xf867('0x1d')](_0x27afc2);}return null;};}function patchUpdates(_0x307250){return function(_0x3491a0){try{jsonpatch['apply'](_0x3491a0,_0x307250,!![]);}catch(_0x3c5ef3){return BPromise[_0xf867('0x25')](_0x3c5ef3);}return _0x3491a0[_0xf867('0x26')]();};}function saveUpdates(_0x54f67c,_0x5b8148){return function(_0x1acf44){if(_0x1acf44){return _0x1acf44[_0xf867('0x27')](_0x54f67c)[_0xf867('0x28')](function(_0x42af4){return _0x42af4;});}return null;};}function handleEntityNotFound(_0x36da15,_0x2ad7cc){return function(_0x4890f8){if(!_0x4890f8){_0x36da15[_0xf867('0x1b')](0x194);}return _0x4890f8;};}function handleError(_0x38cabc,_0x1ca171){_0x1ca171=_0x1ca171||0x1f4;return function(_0x1b9bc6){logger[_0xf867('0x29')](_0x1b9bc6[_0xf867('0x2a')]);if(_0x1b9bc6['name']){delete _0x1b9bc6[_0xf867('0x2b')];}_0x38cabc[_0xf867('0x22')](_0x1ca171)['send'](_0x1b9bc6);};}exports[_0xf867('0x2c')]=function(_0x1e4edc,_0x3b0622){var _0x1e0ae8={},_0xbeffac={},_0x26fd99={'count':0x0,'rows':[]};var _0xcca071=_[_0xf867('0x2d')](db[_0xf867('0x2e')][_0xf867('0x2f')],function(_0x252083){return{'name':_0x252083['fieldName'],'type':_0x252083[_0xf867('0x30')][_0xf867('0x31')]};});_0xbeffac[_0xf867('0x32')]=_[_0xf867('0x2d')](_0xcca071,_0xf867('0x2b'));_0xbeffac[_0xf867('0x33')]=_[_0xf867('0x34')](_0x1e4edc[_0xf867('0x33')]);_0xbeffac[_0xf867('0x35')]=_[_0xf867('0x36')](_0xbeffac[_0xf867('0x32')],_0xbeffac['query']);_0x1e0ae8[_0xf867('0x37')]=_[_0xf867('0x36')](_0xbeffac['model'],qs[_0xf867('0x38')](_0x1e4edc[_0xf867('0x33')]['fields']));_0x1e0ae8['attributes']=_0x1e0ae8[_0xf867('0x37')][_0xf867('0x39')]?_0x1e0ae8['attributes']:_0xbeffac[_0xf867('0x32')];if(!_0x1e4edc['query'][_0xf867('0x3a')](_0xf867('0x3b'))){_0x1e0ae8['limit']=qs[_0xf867('0x20')](_0x1e4edc[_0xf867('0x33')][_0xf867('0x20')]);_0x1e0ae8['offset']=qs['offset'](_0x1e4edc[_0xf867('0x33')][_0xf867('0x1e')]);}_0x1e0ae8[_0xf867('0x3c')]=qs[_0xf867('0x3d')](_0x1e4edc[_0xf867('0x33')]['sort']);_0x1e0ae8[_0xf867('0x3e')]=qs[_0xf867('0x35')](_[_0xf867('0x3f')](_0x1e4edc[_0xf867('0x33')],_0xbeffac[_0xf867('0x35')]),_0xcca071);if(_0x1e4edc[_0xf867('0x33')][_0xf867('0x40')]){_0x1e0ae8['where']=_[_0xf867('0x41')](_0x1e0ae8[_0xf867('0x3e')],{'$or':_[_0xf867('0x2d')](_0xcca071,function(_0x54d53a){if(_0x54d53a[_0xf867('0x30')]!==_0xf867('0x42')){var _0x374ba3={};_0x374ba3[_0x54d53a[_0xf867('0x2b')]]={'$like':'%'+_0x1e4edc['query'][_0xf867('0x40')]+'%'};return _0x374ba3;}})});}_0x1e0ae8=_[_0xf867('0x41')]({},_0x1e0ae8,_0x1e4edc[_0xf867('0x43')]);var _0xab1be7={'where':_0x1e0ae8[_0xf867('0x3e')]};return db[_0xf867('0x2e')]['count'](_0xab1be7)['then'](function(_0x2859d1){_0x26fd99['count']=_0x2859d1;if(_0x1e4edc[_0xf867('0x33')][_0xf867('0x44')]){_0x1e0ae8[_0xf867('0x45')]=[{'all':!![]}];}return db[_0xf867('0x2e')][_0xf867('0x46')](_0x1e0ae8);})[_0xf867('0x28')](function(_0x57cf5b){_0x26fd99[_0xf867('0x47')]=_0x57cf5b;return _0x26fd99;})['then'](respondWithFilteredResult(_0x3b0622,_0x1e0ae8))[_0xf867('0x48')](handleError(_0x3b0622,null));};exports['show']=function(_0x42f4e0,_0x12e9f9){var _0x3d0f93={'raw':![],'where':{'id':_0x42f4e0['params']['id']}},_0x24de01={};_0x24de01['model']=_[_0xf867('0x34')](db['Team'][_0xf867('0x2f')]);_0x24de01[_0xf867('0x33')]=_['keys'](_0x42f4e0['query']);_0x24de01[_0xf867('0x35')]=_['intersection'](_0x24de01['model'],_0x24de01['query']);_0x3d0f93['attributes']=_[_0xf867('0x36')](_0x24de01[_0xf867('0x32')],qs[_0xf867('0x38')](_0x42f4e0['query']['fields']));_0x3d0f93[_0xf867('0x37')]=_0x3d0f93[_0xf867('0x37')][_0xf867('0x39')]?_0x3d0f93[_0xf867('0x37')]:_0x24de01[_0xf867('0x32')];if(_0x42f4e0[_0xf867('0x33')]['includeAll']){_0x3d0f93[_0xf867('0x45')]=[{'all':!![]}];}_0x3d0f93=_[_0xf867('0x41')]({},_0x3d0f93,_0x42f4e0[_0xf867('0x43')]);return db[_0xf867('0x2e')][_0xf867('0x49')](_0x3d0f93)[_0xf867('0x28')](handleEntityNotFound(_0x12e9f9,null))['then'](respondWithResult(_0x12e9f9,null))[_0xf867('0x48')](handleError(_0x12e9f9,null));};exports[_0xf867('0x4a')]=function(_0x2390f3,_0x2a7886){return db[_0xf867('0x2e')][_0xf867('0x4a')](_0x2390f3[_0xf867('0x4b')],{})[_0xf867('0x28')](function(_0x1e1323){var _0x3eb69a=_0x2390f3['user'][_0xf867('0x4c')]({'plain':!![]});if(!_0x3eb69a)throw new Error(_0xf867('0x4d'));if(_0x3eb69a[_0xf867('0x4e')]==='user'){var _0x49f7a7=_0x1e1323[_0xf867('0x4c')]({'plain':!![]});var _0x2d21af=_0xf867('0x4f');return db[_0xf867('0x50')]['find']({'where':{'name':_0x2d21af,'userProfileId':_0x3eb69a[_0xf867('0x51')]},'raw':!![]})[_0xf867('0x28')](function(_0x229ff9){if(_0x229ff9&&_0x229ff9['autoAssociation']===0x0){return db[_0xf867('0x52')]['create']({'name':_0x49f7a7[_0xf867('0x2b')],'resourceId':_0x49f7a7['id'],'type':_0x229ff9[_0xf867('0x2b')],'sectionId':_0x229ff9['id']},{})[_0xf867('0x28')](function(){return _0x1e1323;});}else{return _0x1e1323;}})[_0xf867('0x48')](function(_0x398a7c){logger['error'](_0xf867('0x53'),_0x398a7c);throw _0x398a7c;});}return _0x1e1323;})[_0xf867('0x28')](respondWithResult(_0x2a7886,0xc9))[_0xf867('0x48')](handleError(_0x2a7886,null));};exports[_0xf867('0x27')]=function(_0x195832,_0x2c00b2){if(_0x195832[_0xf867('0x4b')]['id']){delete _0x195832[_0xf867('0x4b')]['id'];}return db[_0xf867('0x2e')]['find']({'where':{'id':_0x195832[_0xf867('0x54')]['id']}})[_0xf867('0x28')](handleEntityNotFound(_0x2c00b2,null))['then'](saveUpdates(_0x195832[_0xf867('0x4b')],null))['then'](respondWithResult(_0x2c00b2,null))[_0xf867('0x48')](handleError(_0x2c00b2,null));};exports['destroy']=function(_0x20adfc,_0x3d4463){var _0x22d08f=_0x20adfc['params']['id'];var _0xdb6f=[];return db[_0xf867('0x55')][_0xf867('0x56')](function(_0x4e979b){var _0x4be17d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x4be17d,{'type':db[_0xf867('0x57')][_0xf867('0x58')][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b})[_0xf867('0x28')](function(_0x2d76eb){_0xdb6f=_[_0xf867('0x2d')](_0x2d76eb,function(_0x564623){return Number(_0x564623['UserId']);});})[_0xf867('0x28')](function(){var _0x3836c2=_0xf867('0x5a')+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x3836c2,{'type':db['Sequelize']['QueryTypes'][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0xabafc3){var _0x124838=_[_0xf867('0x2d')](_0xabafc3,function(_0x2d9422){return Number(_0x2d9422[_0xf867('0x5b')]);});return db[_0xf867('0x5c')]['destroy']({'where':{'UserId':{'$in':_0xdb6f},'VoiceQueueId':{'$in':_0x124838}},'transaction':_0x4e979b});})['then'](function(){var _0x40bcfb='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x40bcfb,{'type':db['Sequelize'][_0xf867('0x58')]['SELECT'],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x432f97){var _0x717c87=_['map'](_0x432f97,function(_0x7d6e1f){return Number(_0x7d6e1f['MailQueueId']);});return db[_0xf867('0x5d')]['destroy']({'where':{'UserId':{'$in':_0xdb6f},'MailQueueId':{'$in':_0x717c87}},'transaction':_0x4e979b});})[_0xf867('0x28')](function(){var _0x462353=_0xf867('0x5e')+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x462353,{'type':db[_0xf867('0x57')]['QueryTypes'][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x57f19b){var _0x247c5d=_[_0xf867('0x2d')](_0x57f19b,function(_0x1bba2d){return Number(_0x1bba2d[_0xf867('0x5f')]);});return db['UserSmsQueue'][_0xf867('0x60')]({'where':{'UserId':{'$in':_0xdb6f},'SmsQueueId':{'$in':_0x247c5d}},'transaction':_0x4e979b});})['then'](function(){var _0x2f28ea='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x2f28ea,{'type':db[_0xf867('0x57')]['QueryTypes'][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x45ea49){var _0x4bcf26=_[_0xf867('0x2d')](_0x45ea49,function(_0x4cf632){return Number(_0x4cf632['ChatQueueId']);});return db[_0xf867('0x61')][_0xf867('0x60')]({'where':{'UserId':{'$in':_0xdb6f},'ChatQueueId':{'$in':_0x4bcf26}},'transaction':_0x4e979b});})[_0xf867('0x28')](function(){var _0x5b480e=_0xf867('0x62')+_0x22d08f;return db[_0xf867('0x55')][_0xf867('0x33')](_0x5b480e,{'type':db[_0xf867('0x57')][_0xf867('0x58')]['SELECT'],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x5c0402){var _0x31ce6f=_[_0xf867('0x2d')](_0x5c0402,function(_0x806fc){return Number(_0x806fc['FaxQueueId']);});return db[_0xf867('0x63')]['destroy']({'where':{'UserId':{'$in':_0xdb6f},'FaxQueueId':{'$in':_0x31ce6f}},'transaction':_0x4e979b});})[_0xf867('0x28')](function(){var _0x242ab0=_0xf867('0x64')+_0x22d08f;return db['sequelize'][_0xf867('0x33')](_0x242ab0,{'type':db[_0xf867('0x57')]['QueryTypes'][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x54c841){var _0x49eda1=_[_0xf867('0x2d')](_0x54c841,function(_0x29bba0){return Number(_0x29bba0['OpenchannelQueueId']);});return db[_0xf867('0x65')]['destroy']({'where':{'UserId':{'$in':_0xdb6f},'OpenchannelQueueId':{'$in':_0x49eda1}},'transaction':_0x4e979b});})[_0xf867('0x28')](function(){var _0x30625f=_0xf867('0x66')+_0x22d08f;return db[_0xf867('0x55')]['query'](_0x30625f,{'type':db[_0xf867('0x57')][_0xf867('0x58')][_0xf867('0x59')],'raw':!![],'transaction':_0x4e979b});})['then'](function(_0x230a9e){var _0x54f1f5=_[_0xf867('0x2d')](_0x230a9e,function(_0x183c7b){return Number(_0x183c7b[_0xf867('0x67')]);});return db[_0xf867('0x68')][_0xf867('0x60')]({'where':{'UserId':{'$in':_0xdb6f},'WhatsappQueueId':{'$in':_0x54f1f5}},'transaction':_0x4e979b});})[_0xf867('0x28')](function(){return db[_0xf867('0x69')][_0xf867('0x49')]({'where':{'TeamId':_0x22d08f}});})[_0xf867('0x28')](function(_0x1e7ba8){if(_0x1e7ba8===null){return;}return db[_0xf867('0x6a')]['destroy']({'where':{'UserId':{'$in':_0xdb6f},'VoicePrefixId':_0x1e7ba8[_0xf867('0x6b')]},'transaction':_0x4e979b});})['then'](function(){return db[_0xf867('0x2e')]['destroy']({'where':{'id':_0x22d08f},'cascade':!![],'transaction':_0x4e979b});})[_0xf867('0x28')](function(_0x543d91){if(_0x543d91===0x0){_0x3d4463['sendStatus'](0x194);}else{return db['UserProfileResource'][_0xf867('0x60')]({'where':{'type':'Teams','resourceId':_0x22d08f},'cascade':!![],'transaction':_0x4e979b})['then'](function(){_0x3d4463[_0xf867('0x22')](0xcc)[_0xf867('0x1c')]();});}})[_0xf867('0x48')](function(_0x17d1a5){_0x3d4463[_0xf867('0x22')](0x1f4)[_0xf867('0x6c')](_0x17d1a5);});});};exports[_0xf867('0x6d')]=function(_0x5ee8c3,_0x2aa120,_0x41c2b6){return db[_0xf867('0x2e')][_0xf867('0x6e')]({'where':{'id':_0x5ee8c3[_0xf867('0x54')]['id']}})[_0xf867('0x28')](handleEntityNotFound(_0x2aa120,null))[_0xf867('0x28')](function(_0x373e6e){if(!_0x5ee8c3[_0xf867('0x33')][_0xf867('0x6f')]||!utils[_0xf867('0x70')](_0x5ee8c3[_0xf867('0x33')][_0xf867('0x6f')])){throw new db[(_0xf867('0x57'))][(_0xf867('0x71'))]('Unknown\x20channel');}var _0x1e0076={};var _0x2c6780={};_0x2c6780[_0xf867('0x32')]=_[_0xf867('0x34')](db[_[_0xf867('0x72')](_0x5ee8c3[_0xf867('0x33')]['channel']['toLowerCase']())+'Queue'][_0xf867('0x2f')]);_0x2c6780['query']=_['keys'](_0x5ee8c3[_0xf867('0x33')]);_0x2c6780['filters']=_[_0xf867('0x36')](_0x2c6780[_0xf867('0x32')],_0x2c6780['query']);_0x1e0076['attributes']=_['intersection'](_0x2c6780[_0xf867('0x32')],qs['fields'](_0x5ee8c3[_0xf867('0x33')][_0xf867('0x38')]));_0x1e0076[_0xf867('0x37')]=_0x1e0076[_0xf867('0x37')][_0xf867('0x39')]?_0x1e0076[_0xf867('0x37')]:_0x2c6780[_0xf867('0x32')];_0x1e0076[_0xf867('0x20')]=qs['limit'](_0x5ee8c3[_0xf867('0x33')][_0xf867('0x20')]);_0x1e0076[_0xf867('0x1e')]=qs[_0xf867('0x1e')](_0x5ee8c3[_0xf867('0x33')][_0xf867('0x1e')]);_0x1e0076[_0xf867('0x3c')]=qs['sort'](_0x5ee8c3[_0xf867('0x33')][_0xf867('0x3d')]);_0x1e0076[_0xf867('0x3e')]=qs[_0xf867('0x35')](_[_0xf867('0x3f')](_0x5ee8c3[_0xf867('0x33')],_0x2c6780[_0xf867('0x35')]));_0x1e0076=_[_0xf867('0x41')]({},_0x1e0076,_0x5ee8c3[_0xf867('0x43')]);return _0x373e6e[_0xf867('0x4c')+_[_0xf867('0x72')](_0x5ee8c3[_0xf867('0x33')]['channel'][_0xf867('0x73')]())+'Queues'](_0x1e0076);})[_0xf867('0x28')](respondWithResult(_0x2aa120,null))[_0xf867('0x48')](handleError(_0x2aa120,null));};exports[_0xf867('0x74')]=function(_0x413329,_0x261c46,_0x232668){return db[_0xf867('0x2e')][_0xf867('0x6e')]({'where':{'id':_0x413329['params']['id']}})[_0xf867('0x28')](function(_0x5d165d){if(_0x5d165d){if(!_0x413329['body'][_0xf867('0x6f')]||!utils[_0xf867('0x70')](_0x413329[_0xf867('0x4b')][_0xf867('0x6f')])){throw new db[(_0xf867('0x57'))][(_0xf867('0x71'))](_0xf867('0x75'));}return _0x5d165d[_0xf867('0x76')+_['capitalize'](_0x413329['body'][_0xf867('0x6f')][_0xf867('0x73')]())+_0xf867('0x77')](_0x413329[_0xf867('0x4b')][_0xf867('0x78')]);}return null;})[_0xf867('0x28')](handleEntityNotFound(_0x261c46,null))[_0xf867('0x28')](respondWithStatusCode(_0x261c46,null))[_0xf867('0x48')](handleError(_0x261c46,null));};exports[_0xf867('0x79')]=function(_0x7b01a2,_0x3f67a8,_0x28c53b){return db[_0xf867('0x2e')][_0xf867('0x6e')]({'where':{'id':_0x7b01a2[_0xf867('0x54')]['id']}})[_0xf867('0x28')](function(_0x3ba827){if(_0x3ba827){if(!_0x7b01a2[_0xf867('0x33')][_0xf867('0x6f')]||!utils[_0xf867('0x70')](_0x7b01a2[_0xf867('0x33')]['channel'])){throw new db[(_0xf867('0x57'))][(_0xf867('0x71'))]('Unknown\x20channel');}return _0x3ba827[_0xf867('0x7a')+_['capitalize'](_0x7b01a2[_0xf867('0x33')][_0xf867('0x6f')][_0xf867('0x73')]())+_0xf867('0x77')](_0x7b01a2[_0xf867('0x33')][_0xf867('0x78')]);}return null;})[_0xf867('0x28')](handleEntityNotFound(_0x3f67a8,null))[_0xf867('0x28')](respondWithStatusCode(_0x3f67a8,null))['catch'](handleError(_0x3f67a8,null));};exports[_0xf867('0x7b')]=function(_0x507df5,_0x16c9f7){var _0x1bc6ef=_[_0xf867('0x7c')](_0x507df5[_0xf867('0x4b')]['ids'])?_0x507df5[_0xf867('0x4b')]['ids']:[_0x507df5[_0xf867('0x4b')][_0xf867('0x78')]];var _0x4d5853=_0x507df5['params']['id'];return db[_0xf867('0x2e')][_0xf867('0x49')]({'where':{'id':_0x4d5853}})[_0xf867('0x28')](handleEntityNotFound(_0x16c9f7,null))['then'](function(_0x9a5c4f){if(_0x9a5c4f){var _0x42608a=[_0xf867('0x7d'),_0xf867('0x7e'),_0xf867('0x7f'),_0xf867('0x80'),_0xf867('0x81'),'Openchannel',_0xf867('0x82')];return db[_0xf867('0x55')][_0xf867('0x56')](function(_0x43d9ce){var _0x5b2d1f=_['map'](_0x42608a,function(_0x1ede2c){var _0x12b702={'attributes':['id',_0xf867('0x2b')]};if(_0x1ede2c===_0xf867('0x7d')){_0x12b702['through']={'attributes':[_0xf867('0x83')]};}return _0x9a5c4f['get'+_0x1ede2c+'Queues'](_0x12b702)[_0xf867('0x28')](function(_0xb8c963){var _0x41dd0e=_[_0xf867('0x2d')](_0xb8c963,function(_0x2c1d13){var _0x14a883=_[_0xf867('0x2d')](_0x1bc6ef,function(_0x149f95){var _0x106e5f={'where':{'UserId':_0x149f95,[_0x1ede2c+_0xf867('0x84')]:_0x2c1d13['id']},'transaction':_0x43d9ce};if(_0x1ede2c===_0xf867('0x7d')){_0x106e5f['defaults']={'penalty':_0x2c1d13[_0xf867('0x85')][_0xf867('0x83')]};}return db[_0xf867('0x86')+_0x1ede2c+_0xf867('0x87')][_0xf867('0x88')](_0x106e5f)[_0xf867('0x28')](function(){socket[_0xf867('0x89')]('user'+_0x1ede2c+_0xf867('0x8a'),{'UserId':_0x149f95,[_0x1ede2c+_0xf867('0x84')]:_0x2c1d13['id']});if(_0x1ede2c!=='Voice'){return;}return db[_0xf867('0x86')]['findAll']({'where':{'id':_0x1bc6ef,'online':0x1},'attributes':['id',_0xf867('0x2b'),_0xf867('0x8b'),_0xf867('0x8c'),_0xf867('0x8d')],'raw':!![]})['then'](function(_0x4b4f52){var _0x5b32fb=_[_0xf867('0x2d')](_0x4b4f52,function(_0x3eb75c){return db[_0xf867('0x8e')][_0xf867('0x8f')]({'membername':_0x3eb75c[_0xf867('0x2b')],'UserId':_0x3eb75c['id'],'queue_name':_0x2c1d13[_0xf867('0x2b')],'VoiceQueueId':_0x2c1d13['id'],'interface':_[_0xf867('0x90')](_0x3eb75c['interface'])?util[_0xf867('0x91')](_0xf867('0x92'),_0x3eb75c[_0xf867('0x2b')]):_0x3eb75c[_0xf867('0x8d')],'paused':_0x3eb75c[_0xf867('0x8c')]||![],'penalty':_0x2c1d13['TeamVoiceQueue']['penalty']},{'transaction':_0x43d9ce});});return Promise['all'](_0x5b32fb);});});});return Promise[_0xf867('0x93')](_0x14a883);});return Promise[_0xf867('0x93')](_0x41dd0e);})[_0xf867('0x28')](function(){return db[_0xf867('0x69')][_0xf867('0x6e')]({'where':{'teamId':_0x4d5853}})[_0xf867('0x28')](function(_0x1f518f){if(_0x1f518f){var _0x4fafe1=_[_0xf867('0x2d')](_0x1bc6ef,function(_0x13c8a1){db[_0xf867('0x6a')][_0xf867('0x8f')]({'UserId':_0x13c8a1,'VoicePrefixId':_0x1f518f[_0xf867('0x6b')]});});return Promise[_0xf867('0x93')](_0x4fafe1);}});});});return Promise['all'](_0x5b2d1f)[_0xf867('0x28')](function(){return _0x9a5c4f[_0xf867('0x7b')](_0x1bc6ef,{'transaction':_0x43d9ce})['spread'](function(_0x3d63a3){return _0x3d63a3;});});});}})[_0xf867('0x28')](respondWithResult(_0x16c9f7,null))['catch'](handleError(_0x16c9f7,null));};exports[_0xf867('0x94')]=function(_0x27a369,_0x3decd1){var _0x1a2ead=_['isArray'](_0x27a369[_0xf867('0x33')][_0xf867('0x78')])?_0x27a369[_0xf867('0x33')][_0xf867('0x78')]:[_0x27a369[_0xf867('0x33')][_0xf867('0x78')]];var _0x53c031=_0x27a369[_0xf867('0x54')]['id'];return db['Team'][_0xf867('0x49')]({'where':{'id':_0x53c031}})['then'](handleEntityNotFound(_0x3decd1,null))[_0xf867('0x28')](function(_0x27dbda){if(_0x27dbda){var _0x32856d=['Voice',_0xf867('0x7e'),'Mail',_0xf867('0x80'),_0xf867('0x81'),'Openchannel',_0xf867('0x82')];return db[_0xf867('0x55')][_0xf867('0x56')](function(_0x22c1f6){var _0x20e248=_[_0xf867('0x2d')](_0x32856d,function(_0x59120a){var _0x30445a={'attributes':['id',_0xf867('0x2b')]};return _0x27dbda[_0xf867('0x4c')+_0x59120a+_0xf867('0x77')](_0x30445a)['then'](function(_0x4e5466){var _0x49b782=_['map'](_0x4e5466,function(_0x698088){return _0x698088['removeAgents'](_0x1a2ead,{'transaction':_0x22c1f6})[_0xf867('0x28')](function(){var _0xca0d8e=_[_0xf867('0x2d')](_0x1a2ead,function(_0x491a62){socket[_0xf867('0x89')]('user'+_0x59120a+_0xf867('0x95'),{'UserId':Number(_0x491a62),[_0x59120a+_0xf867('0x84')]:_0x698088['id']});if(_0x59120a!==_0xf867('0x7d')){return;}return db[_0xf867('0x8e')][_0xf867('0x60')]({'where':{'VoiceQueueId':_0x698088['id'],'UserId':_0x491a62},'transaction':_0x22c1f6});});return Promise[_0xf867('0x93')](_0xca0d8e);});});return Promise[_0xf867('0x93')](_0x49b782);});});return Promise['all'](_0x20e248)[_0xf867('0x28')](function(){return _0x27dbda[_0xf867('0x94')](_0x1a2ead,{'transaction':_0x22c1f6});})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x53c031}})['then'](function(_0x51f15e){if(_0x51f15e){var _0x1e379b=_[_0xf867('0x2d')](_0x1a2ead,function(_0x51210d){db['UserVoicePrefix'][_0xf867('0x60')]({'where':{'UserId':_0x51210d,'VoicePrefixId':_0x51f15e[_0xf867('0x6b')]}});});return Promise[_0xf867('0x93')](_0x1e379b);}});});});}})[_0xf867('0x28')](respondWithStatusCode(_0x3decd1,null))['catch'](handleError(_0x3decd1,null));};exports[_0xf867('0x96')]=function(_0x3fbf1d,_0x1ef081,_0x2e62a1){var _0x4ad709={};var _0x5e4849={};var _0x20c71c;var _0x3c14b6;return db[_0xf867('0x2e')][_0xf867('0x6e')]({'where':{'id':_0x3fbf1d[_0xf867('0x54')]['id']}})[_0xf867('0x28')](handleEntityNotFound(_0x1ef081,null))['then'](function(_0x167282){if(_0x167282){_0x20c71c=_0x167282;_0x5e4849[_0xf867('0x32')]=_['keys'](db[_0xf867('0x86')][_0xf867('0x2f')]);_0x5e4849['query']=_['keys'](_0x3fbf1d[_0xf867('0x33')]);_0x5e4849['filters']=_[_0xf867('0x36')](_0x5e4849[_0xf867('0x32')],_0x5e4849[_0xf867('0x33')]);_0x4ad709[_0xf867('0x37')]=_[_0xf867('0x36')](_0x5e4849[_0xf867('0x32')],qs[_0xf867('0x38')](_0x3fbf1d[_0xf867('0x33')][_0xf867('0x38')]));_0x4ad709[_0xf867('0x37')]=_0x4ad709[_0xf867('0x37')][_0xf867('0x39')]?_0x4ad709[_0xf867('0x37')]:_0x5e4849[_0xf867('0x32')];_0x4ad709['order']=qs[_0xf867('0x3d')](_0x3fbf1d['query'][_0xf867('0x3d')]);_0x4ad709[_0xf867('0x3e')]=qs[_0xf867('0x35')](_[_0xf867('0x3f')](_0x3fbf1d['query'],_0x5e4849[_0xf867('0x35')]));if(_0x3fbf1d[_0xf867('0x33')][_0xf867('0x40')]){_0x4ad709[_0xf867('0x3e')]=_['merge'](_0x4ad709['where'],{'$or':_[_0xf867('0x2d')](_0x4ad709[_0xf867('0x37')],function(_0x5a0f4f){var _0x26aef5={};_0x26aef5[_0x5a0f4f]={'$like':'%'+_0x3fbf1d[_0xf867('0x33')][_0xf867('0x40')]+'%'};return _0x26aef5;})});}_0x4ad709=_[_0xf867('0x41')]({},_0x4ad709,_0x3fbf1d['options']);return _0x20c71c[_0xf867('0x96')](_0x4ad709);}})[_0xf867('0x28')](function(_0x4ce217){if(_0x4ce217){_0x3c14b6=_0x4ce217['length'];if(!_0x3fbf1d[_0xf867('0x33')]['hasOwnProperty'](_0xf867('0x3b'))){_0x4ad709['limit']=qs[_0xf867('0x20')](_0x3fbf1d[_0xf867('0x33')][_0xf867('0x20')]);_0x4ad709[_0xf867('0x1e')]=qs[_0xf867('0x1e')](_0x3fbf1d['query'][_0xf867('0x1e')]);}return _0x20c71c[_0xf867('0x96')](_0x4ad709);}})[_0xf867('0x28')](function(_0x10dd89){if(_0x10dd89){return _0x10dd89?{'count':_0x3c14b6,'rows':_0x10dd89}:null;}})[_0xf867('0x28')](respondWithResult(_0x1ef081,null))['catch'](handleError(_0x1ef081,null));}; \ No newline at end of file +var _0x1dfb=['./team.socket','register','end','undefined','limit','offset','count','status','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Team','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isValidChannel','channel','ValidationError','capitalize','Queue','pick','toLowerCase','Queues','addQueues','findOne','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','removeAgents','Queue:remove','User','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x1dfb,0x122));var _0xb1df=function(_0x48d850,_0x4a987){_0x48d850=_0x48d850-0x0;var _0x141bc8=_0x1dfb[_0x48d850];return _0x141bc8;};'use strict';var emlformat=require(_0xb1df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1df('0x1'));var jsonpatch=require(_0xb1df('0x2'));var rp=require(_0xb1df('0x3'));var moment=require(_0xb1df('0x4'));var BPromise=require(_0xb1df('0x5'));var Mustache=require(_0xb1df('0x6'));var util=require(_0xb1df('0x7'));var path=require(_0xb1df('0x8'));var sox=require(_0xb1df('0x9'));var csv=require(_0xb1df('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1df('0xb'));var _=require(_0xb1df('0xc'));var squel=require(_0xb1df('0xd'));var crypto=require(_0xb1df('0xe'));var jsforce=require(_0xb1df('0xf'));var deskjs=require(_0xb1df('0x10'));var toCsv=require(_0xb1df('0xa'));var querystring=require('querystring');var Papa=require(_0xb1df('0x11'));var Redis=require(_0xb1df('0x12'));var authService=require(_0xb1df('0x13'));var qs=require(_0xb1df('0x14'));var as=require(_0xb1df('0x15'));var hardwareService=require(_0xb1df('0x16'));var logger=require(_0xb1df('0x17'))('api');var utils=require(_0xb1df('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb1df('0x19'));var db=require('../../mysqldb')['db'];config[_0xb1df('0x1a')]=_[_0xb1df('0x1b')](config[_0xb1df('0x1a')],{'host':_0xb1df('0x1c'),'port':0x18eb});var socket=require(_0xb1df('0x1d'))(new Redis(config[_0xb1df('0x1a')]));require(_0xb1df('0x1e'))[_0xb1df('0x1f')](socket);function respondWithStatusCode(_0x548b86,_0x4817d3){_0x4817d3=_0x4817d3||0xcc;return function(_0x549b32){if(_0x549b32){return _0x548b86['sendStatus'](_0x4817d3);}return _0x548b86['status'](_0x4817d3)[_0xb1df('0x20')]();};}function respondWithResult(_0x70b765,_0x6afe96){_0x6afe96=_0x6afe96||0xc8;return function(_0x22c21d){if(_0x22c21d){return _0x70b765['status'](_0x6afe96)['json'](_0x22c21d);}};}function respondWithFilteredResult(_0x3cbdd1,_0x518c9a){return function(_0x44fc38){if(_0x44fc38){var _0x252542=typeof _0x518c9a['offset']===_0xb1df('0x21')&&typeof _0x518c9a[_0xb1df('0x22')]===_0xb1df('0x21');var _0x495fcb=_0x44fc38['count'];var _0x132df9=_0x252542?0x0:_0x518c9a[_0xb1df('0x23')];var _0x5b050b=_0x252542?_0x44fc38[_0xb1df('0x24')]:_0x518c9a[_0xb1df('0x23')]+_0x518c9a[_0xb1df('0x22')];var _0x914fd5;if(_0x5b050b>=_0x495fcb){_0x5b050b=_0x495fcb;_0x914fd5=0xc8;}else{_0x914fd5=0xce;}_0x3cbdd1[_0xb1df('0x25')](_0x914fd5);return _0x3cbdd1['set']('Content-Range',_0x132df9+'-'+_0x5b050b+'/'+_0x495fcb)[_0xb1df('0x26')](_0x44fc38);}return null;};}function patchUpdates(_0x343619){return function(_0x4b766d){try{jsonpatch[_0xb1df('0x27')](_0x4b766d,_0x343619,!![]);}catch(_0x11024d){return BPromise[_0xb1df('0x28')](_0x11024d);}return _0x4b766d[_0xb1df('0x29')]();};}function saveUpdates(_0x94b20d,_0x3b3ab1){return function(_0x142d8a){if(_0x142d8a){return _0x142d8a[_0xb1df('0x2a')](_0x94b20d)[_0xb1df('0x2b')](function(_0x12cd01){return _0x12cd01;});}return null;};}function handleEntityNotFound(_0x7a6ba,_0x75c701){return function(_0x308c33){if(!_0x308c33){_0x7a6ba[_0xb1df('0x2c')](0x194);}return _0x308c33;};}function handleError(_0x3955f9,_0x460783){_0x460783=_0x460783||0x1f4;return function(_0x2dad7a){logger[_0xb1df('0x2d')](_0x2dad7a[_0xb1df('0x2e')]);if(_0x2dad7a[_0xb1df('0x2f')]){delete _0x2dad7a[_0xb1df('0x2f')];}_0x3955f9[_0xb1df('0x25')](_0x460783)[_0xb1df('0x30')](_0x2dad7a);};}exports[_0xb1df('0x31')]=function(_0x4cd93b,_0x55e8a0){var _0x1122ee={},_0x32cc94={},_0x4a53b0={'count':0x0,'rows':[]};var _0x308202=_[_0xb1df('0x32')](db['Team'][_0xb1df('0x33')],function(_0x4f7b7e){return{'name':_0x4f7b7e[_0xb1df('0x34')],'type':_0x4f7b7e[_0xb1df('0x35')][_0xb1df('0x36')]};});_0x32cc94[_0xb1df('0x37')]=_[_0xb1df('0x32')](_0x308202,_0xb1df('0x2f'));_0x32cc94[_0xb1df('0x38')]=_['keys'](_0x4cd93b['query']);_0x32cc94[_0xb1df('0x39')]=_['intersection'](_0x32cc94[_0xb1df('0x37')],_0x32cc94[_0xb1df('0x38')]);_0x1122ee[_0xb1df('0x3a')]=_[_0xb1df('0x3b')](_0x32cc94['model'],qs[_0xb1df('0x3c')](_0x4cd93b[_0xb1df('0x38')][_0xb1df('0x3c')]));_0x1122ee[_0xb1df('0x3a')]=_0x1122ee['attributes'][_0xb1df('0x3d')]?_0x1122ee[_0xb1df('0x3a')]:_0x32cc94[_0xb1df('0x37')];if(!_0x4cd93b[_0xb1df('0x38')]['hasOwnProperty'](_0xb1df('0x3e'))){_0x1122ee['limit']=qs[_0xb1df('0x22')](_0x4cd93b[_0xb1df('0x38')][_0xb1df('0x22')]);_0x1122ee[_0xb1df('0x23')]=qs[_0xb1df('0x23')](_0x4cd93b[_0xb1df('0x38')]['offset']);}_0x1122ee[_0xb1df('0x3f')]=qs[_0xb1df('0x40')](_0x4cd93b[_0xb1df('0x38')][_0xb1df('0x40')]);_0x1122ee[_0xb1df('0x41')]=qs[_0xb1df('0x39')](_['pick'](_0x4cd93b[_0xb1df('0x38')],_0x32cc94[_0xb1df('0x39')]),_0x308202);if(_0x4cd93b['query']['filter']){_0x1122ee[_0xb1df('0x41')]=_[_0xb1df('0x42')](_0x1122ee[_0xb1df('0x41')],{'$or':_[_0xb1df('0x32')](_0x308202,function(_0x87da85){if(_0x87da85['type']!==_0xb1df('0x43')){var _0x26b88c={};_0x26b88c[_0x87da85[_0xb1df('0x2f')]]={'$like':'%'+_0x4cd93b[_0xb1df('0x38')][_0xb1df('0x44')]+'%'};return _0x26b88c;}})});}_0x1122ee=_[_0xb1df('0x42')]({},_0x1122ee,_0x4cd93b[_0xb1df('0x45')]);var _0x54ad07={'where':_0x1122ee[_0xb1df('0x41')]};return db[_0xb1df('0x46')]['count'](_0x54ad07)['then'](function(_0x131280){_0x4a53b0['count']=_0x131280;if(_0x4cd93b[_0xb1df('0x38')]['includeAll']){_0x1122ee[_0xb1df('0x47')]=[{'all':!![]}];}return db[_0xb1df('0x46')][_0xb1df('0x48')](_0x1122ee);})[_0xb1df('0x2b')](function(_0x5b2934){_0x4a53b0[_0xb1df('0x49')]=_0x5b2934;return _0x4a53b0;})[_0xb1df('0x2b')](respondWithFilteredResult(_0x55e8a0,_0x1122ee))[_0xb1df('0x4a')](handleError(_0x55e8a0,null));};exports[_0xb1df('0x4b')]=function(_0x4b8ec0,_0x48cad8){var _0x1a2c6b={'raw':![],'where':{'id':_0x4b8ec0[_0xb1df('0x4c')]['id']}},_0x104d3e={};_0x104d3e[_0xb1df('0x37')]=_['keys'](db[_0xb1df('0x46')][_0xb1df('0x33')]);_0x104d3e['query']=_[_0xb1df('0x4d')](_0x4b8ec0[_0xb1df('0x38')]);_0x104d3e[_0xb1df('0x39')]=_[_0xb1df('0x3b')](_0x104d3e[_0xb1df('0x37')],_0x104d3e['query']);_0x1a2c6b['attributes']=_[_0xb1df('0x3b')](_0x104d3e[_0xb1df('0x37')],qs[_0xb1df('0x3c')](_0x4b8ec0[_0xb1df('0x38')][_0xb1df('0x3c')]));_0x1a2c6b[_0xb1df('0x3a')]=_0x1a2c6b[_0xb1df('0x3a')][_0xb1df('0x3d')]?_0x1a2c6b['attributes']:_0x104d3e['model'];if(_0x4b8ec0[_0xb1df('0x38')][_0xb1df('0x4e')]){_0x1a2c6b['include']=[{'all':!![]}];}_0x1a2c6b=_['merge']({},_0x1a2c6b,_0x4b8ec0[_0xb1df('0x45')]);return db[_0xb1df('0x46')][_0xb1df('0x4f')](_0x1a2c6b)[_0xb1df('0x2b')](handleEntityNotFound(_0x48cad8,null))[_0xb1df('0x2b')](respondWithResult(_0x48cad8,null))[_0xb1df('0x4a')](handleError(_0x48cad8,null));};exports[_0xb1df('0x50')]=function(_0x403b05,_0xa7c843){return db['Team'][_0xb1df('0x50')](_0x403b05[_0xb1df('0x51')],{})['then'](function(_0x440e99){var _0x4106e7=_0x403b05[_0xb1df('0x52')][_0xb1df('0x53')]({'plain':!![]});if(!_0x4106e7)throw new Error(_0xb1df('0x54'));if(_0x4106e7['role']===_0xb1df('0x52')){var _0x3fa125=_0x440e99['get']({'plain':!![]});var _0x2e2818=_0xb1df('0x55');return db['UserProfileSection'][_0xb1df('0x4f')]({'where':{'name':_0x2e2818,'userProfileId':_0x4106e7[_0xb1df('0x56')]},'raw':!![]})['then'](function(_0x461690){if(_0x461690&&_0x461690[_0xb1df('0x57')]===0x0){return db[_0xb1df('0x58')]['create']({'name':_0x3fa125[_0xb1df('0x2f')],'resourceId':_0x3fa125['id'],'type':_0x461690[_0xb1df('0x2f')],'sectionId':_0x461690['id']},{})[_0xb1df('0x2b')](function(){return _0x440e99;});}else{return _0x440e99;}})[_0xb1df('0x4a')](function(_0x489955){logger[_0xb1df('0x2d')](_0xb1df('0x59'),_0x489955);throw _0x489955;});}return _0x440e99;})[_0xb1df('0x2b')](respondWithResult(_0xa7c843,0xc9))['catch'](handleError(_0xa7c843,null));};exports[_0xb1df('0x2a')]=function(_0x25e2e2,_0x17b929){if(_0x25e2e2[_0xb1df('0x51')]['id']){delete _0x25e2e2[_0xb1df('0x51')]['id'];}return db[_0xb1df('0x46')][_0xb1df('0x4f')]({'where':{'id':_0x25e2e2['params']['id']}})[_0xb1df('0x2b')](handleEntityNotFound(_0x17b929,null))[_0xb1df('0x2b')](saveUpdates(_0x25e2e2[_0xb1df('0x51')],null))[_0xb1df('0x2b')](respondWithResult(_0x17b929,null))[_0xb1df('0x4a')](handleError(_0x17b929,null));};exports[_0xb1df('0x5a')]=function(_0x1dd7dc,_0x4c9d89){var _0x3bf6b7=_0x1dd7dc['params']['id'];var _0x4e6eed=[];return db[_0xb1df('0x5b')]['transaction'](function(_0x2525dc){var _0x436945=_0xb1df('0x5c')+_0x3bf6b7;return db[_0xb1df('0x5b')][_0xb1df('0x38')](_0x436945,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc})[_0xb1df('0x2b')](function(_0x1b115e){_0x4e6eed=_[_0xb1df('0x32')](_0x1b115e,function(_0x211691){return Number(_0x211691['UserId']);});})[_0xb1df('0x2b')](function(){var _0x5cd710=_0xb1df('0x60')+_0x3bf6b7;return db[_0xb1df('0x5b')]['query'](_0x5cd710,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x3fbde1){var _0x7d5648=_[_0xb1df('0x32')](_0x3fbde1,function(_0x9f8e74){return Number(_0x9f8e74[_0xb1df('0x61')]);});return db[_0xb1df('0x62')]['destroy']({'where':{'UserId':{'$in':_0x4e6eed},'VoiceQueueId':{'$in':_0x7d5648}},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){var _0x6e5583='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3bf6b7;return db[_0xb1df('0x5b')][_0xb1df('0x38')](_0x6e5583,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x3f90bb){var _0x42ac7f=_[_0xb1df('0x32')](_0x3f90bb,function(_0xbfff15){return Number(_0xbfff15[_0xb1df('0x63')]);});return db[_0xb1df('0x64')][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'MailQueueId':{'$in':_0x42ac7f}},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){var _0x49fb69='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3bf6b7;return db['sequelize'][_0xb1df('0x38')](_0x49fb69,{'type':db[_0xb1df('0x5d')]['QueryTypes'][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x22c7fa){var _0x3a93ef=_[_0xb1df('0x32')](_0x22c7fa,function(_0x2221ec){return Number(_0x2221ec['SmsQueueId']);});return db[_0xb1df('0x65')][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'SmsQueueId':{'$in':_0x3a93ef}},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){var _0x32ad86=_0xb1df('0x66')+_0x3bf6b7;return db['sequelize']['query'](_0x32ad86,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x3cb05d){var _0x27a1aa=_[_0xb1df('0x32')](_0x3cb05d,function(_0x3d270e){return Number(_0x3d270e[_0xb1df('0x67')]);});return db[_0xb1df('0x68')][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'ChatQueueId':{'$in':_0x27a1aa}},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){var _0x1ff90a=_0xb1df('0x69')+_0x3bf6b7;return db[_0xb1df('0x5b')][_0xb1df('0x38')](_0x1ff90a,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})['then'](function(_0x4dc008){var _0x1ac58c=_['map'](_0x4dc008,function(_0x5f07c3){return Number(_0x5f07c3[_0xb1df('0x6a')]);});return db['UserFaxQueue'][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'FaxQueueId':{'$in':_0x1ac58c}},'transaction':_0x2525dc});})['then'](function(){var _0x5cc9a5=_0xb1df('0x6b')+_0x3bf6b7;return db[_0xb1df('0x5b')][_0xb1df('0x38')](_0x5cc9a5,{'type':db[_0xb1df('0x5d')][_0xb1df('0x5e')]['SELECT'],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x2744b7){var _0xc0a0bc=_[_0xb1df('0x32')](_0x2744b7,function(_0x1f67f9){return Number(_0x1f67f9[_0xb1df('0x6c')]);});return db[_0xb1df('0x6d')][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'OpenchannelQueueId':{'$in':_0xc0a0bc}},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){var _0x1a4776=_0xb1df('0x6e')+_0x3bf6b7;return db['sequelize'][_0xb1df('0x38')](_0x1a4776,{'type':db['Sequelize'][_0xb1df('0x5e')][_0xb1df('0x5f')],'raw':!![],'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(_0x28eba5){var _0x9fd22b=_[_0xb1df('0x32')](_0x28eba5,function(_0xd28b75){return Number(_0xd28b75[_0xb1df('0x6f')]);});return db[_0xb1df('0x70')]['destroy']({'where':{'UserId':{'$in':_0x4e6eed},'WhatsappQueueId':{'$in':_0x9fd22b}},'transaction':_0x2525dc});})['then'](function(){return db[_0xb1df('0x71')][_0xb1df('0x4f')]({'where':{'TeamId':_0x3bf6b7}});})[_0xb1df('0x2b')](function(_0x232146){if(_0x232146===null){return;}return db[_0xb1df('0x72')][_0xb1df('0x5a')]({'where':{'UserId':{'$in':_0x4e6eed},'VoicePrefixId':_0x232146[_0xb1df('0x73')]},'transaction':_0x2525dc});})[_0xb1df('0x2b')](function(){return db['Team'][_0xb1df('0x5a')]({'where':{'id':_0x3bf6b7},'cascade':!![],'transaction':_0x2525dc});})['then'](function(_0x3ec06a){if(_0x3ec06a===0x0){_0x4c9d89[_0xb1df('0x2c')](0x194);}else{return db[_0xb1df('0x58')][_0xb1df('0x5a')]({'where':{'type':_0xb1df('0x55'),'resourceId':_0x3bf6b7},'cascade':!![],'transaction':_0x2525dc})[_0xb1df('0x2b')](function(){_0x4c9d89[_0xb1df('0x25')](0xcc)[_0xb1df('0x20')]();});}})[_0xb1df('0x4a')](function(_0x3136fc){_0x4c9d89['status'](0x1f4)[_0xb1df('0x30')](_0x3136fc);});});};exports['getQueues']=function(_0x4a1777,_0x369b28,_0x3af28f){return db['Team']['findOne']({'where':{'id':_0x4a1777[_0xb1df('0x4c')]['id']}})[_0xb1df('0x2b')](handleEntityNotFound(_0x369b28,null))[_0xb1df('0x2b')](function(_0x509444){if(!_0x4a1777['query']['channel']||!utils[_0xb1df('0x74')](_0x4a1777['query'][_0xb1df('0x75')])){throw new db[(_0xb1df('0x5d'))][(_0xb1df('0x76'))]('Unknown\x20channel');}var _0xe0ae8b={};var _0x2005ad={};_0x2005ad['model']=_['keys'](db[_[_0xb1df('0x77')](_0x4a1777[_0xb1df('0x38')]['channel']['toLowerCase']())+_0xb1df('0x78')][_0xb1df('0x33')]);_0x2005ad[_0xb1df('0x38')]=_[_0xb1df('0x4d')](_0x4a1777[_0xb1df('0x38')]);_0x2005ad[_0xb1df('0x39')]=_[_0xb1df('0x3b')](_0x2005ad[_0xb1df('0x37')],_0x2005ad['query']);_0xe0ae8b[_0xb1df('0x3a')]=_[_0xb1df('0x3b')](_0x2005ad[_0xb1df('0x37')],qs[_0xb1df('0x3c')](_0x4a1777[_0xb1df('0x38')][_0xb1df('0x3c')]));_0xe0ae8b[_0xb1df('0x3a')]=_0xe0ae8b[_0xb1df('0x3a')][_0xb1df('0x3d')]?_0xe0ae8b[_0xb1df('0x3a')]:_0x2005ad['model'];_0xe0ae8b[_0xb1df('0x22')]=qs[_0xb1df('0x22')](_0x4a1777[_0xb1df('0x38')][_0xb1df('0x22')]);_0xe0ae8b[_0xb1df('0x23')]=qs[_0xb1df('0x23')](_0x4a1777[_0xb1df('0x38')][_0xb1df('0x23')]);_0xe0ae8b[_0xb1df('0x3f')]=qs[_0xb1df('0x40')](_0x4a1777[_0xb1df('0x38')]['sort']);_0xe0ae8b[_0xb1df('0x41')]=qs['filters'](_[_0xb1df('0x79')](_0x4a1777[_0xb1df('0x38')],_0x2005ad[_0xb1df('0x39')]));_0xe0ae8b=_[_0xb1df('0x42')]({},_0xe0ae8b,_0x4a1777[_0xb1df('0x45')]);return _0x509444[_0xb1df('0x53')+_[_0xb1df('0x77')](_0x4a1777['query'][_0xb1df('0x75')][_0xb1df('0x7a')]())+_0xb1df('0x7b')](_0xe0ae8b);})[_0xb1df('0x2b')](respondWithResult(_0x369b28,null))['catch'](handleError(_0x369b28,null));};exports[_0xb1df('0x7c')]=function(_0x43b94a,_0x138327,_0x40a4b8){return db['Team'][_0xb1df('0x7d')]({'where':{'id':_0x43b94a[_0xb1df('0x4c')]['id']}})[_0xb1df('0x2b')](function(_0x3f438f){if(_0x3f438f){if(!_0x43b94a[_0xb1df('0x51')][_0xb1df('0x75')]||!utils['isValidChannel'](_0x43b94a[_0xb1df('0x51')]['channel'])){throw new db['Sequelize'][(_0xb1df('0x76'))](_0xb1df('0x7e'));}return _0x3f438f[_0xb1df('0x7f')+_['capitalize'](_0x43b94a[_0xb1df('0x51')][_0xb1df('0x75')][_0xb1df('0x7a')]())+_0xb1df('0x7b')](_0x43b94a[_0xb1df('0x51')][_0xb1df('0x80')]);}return null;})[_0xb1df('0x2b')](handleEntityNotFound(_0x138327,null))['then'](respondWithStatusCode(_0x138327,null))[_0xb1df('0x4a')](handleError(_0x138327,null));};exports[_0xb1df('0x81')]=function(_0x235c93,_0x16ca79,_0x590e34){return db[_0xb1df('0x46')][_0xb1df('0x7d')]({'where':{'id':_0x235c93['params']['id']}})[_0xb1df('0x2b')](function(_0x2a3ca6){if(_0x2a3ca6){if(!_0x235c93['query'][_0xb1df('0x75')]||!utils['isValidChannel'](_0x235c93[_0xb1df('0x38')][_0xb1df('0x75')])){throw new db[(_0xb1df('0x5d'))]['ValidationError']('Unknown\x20channel');}return _0x2a3ca6[_0xb1df('0x82')+_[_0xb1df('0x77')](_0x235c93[_0xb1df('0x38')][_0xb1df('0x75')][_0xb1df('0x7a')]())+_0xb1df('0x7b')](_0x235c93[_0xb1df('0x38')][_0xb1df('0x80')]);}return null;})['then'](handleEntityNotFound(_0x16ca79,null))[_0xb1df('0x2b')](respondWithStatusCode(_0x16ca79,null))['catch'](handleError(_0x16ca79,null));};exports[_0xb1df('0x83')]=function(_0x144454,_0x1c0315){var _0x45abff=_[_0xb1df('0x84')](_0x144454[_0xb1df('0x51')][_0xb1df('0x80')])?_0x144454[_0xb1df('0x51')][_0xb1df('0x80')]:[_0x144454[_0xb1df('0x51')][_0xb1df('0x80')]];var _0x787d27=_0x144454[_0xb1df('0x4c')]['id'];return db['Team'][_0xb1df('0x4f')]({'where':{'id':_0x787d27}})[_0xb1df('0x2b')](handleEntityNotFound(_0x1c0315,null))[_0xb1df('0x2b')](function(_0xef63c0){if(_0xef63c0){var _0x526084=[_0xb1df('0x85'),_0xb1df('0x86'),_0xb1df('0x87'),_0xb1df('0x88'),_0xb1df('0x89'),_0xb1df('0x8a'),_0xb1df('0x8b')];return db[_0xb1df('0x5b')]['transaction'](function(_0x40b5f6){var _0x3fad42=_['map'](_0x526084,function(_0x47bbb6){var _0x7051b0={'attributes':['id',_0xb1df('0x2f')]};if(_0x47bbb6==='Voice'){_0x7051b0[_0xb1df('0x8c')]={'attributes':['penalty']};}return _0xef63c0['get'+_0x47bbb6+'Queues'](_0x7051b0)['then'](function(_0x4b921f){var _0x3d7674=_['map'](_0x4b921f,function(_0x14c1f1){var _0x464b9f=_['map'](_0x45abff,function(_0x42fb11){var _0x20cc7f={'where':{'UserId':_0x42fb11,[_0x47bbb6+_0xb1df('0x8d')]:_0x14c1f1['id']},'transaction':_0x40b5f6};if(_0x47bbb6===_0xb1df('0x85')){_0x20cc7f[_0xb1df('0x1b')]={'penalty':_0x14c1f1[_0xb1df('0x8e')][_0xb1df('0x8f')]};}return db['User'+_0x47bbb6+'Queue']['findOrCreate'](_0x20cc7f)['then'](function(){socket[_0xb1df('0x90')]('user'+_0x47bbb6+_0xb1df('0x91'),{'UserId':_0x42fb11,[_0x47bbb6+_0xb1df('0x8d')]:_0x14c1f1['id']});if(_0x47bbb6!=='Voice'){return;}return db['User'][_0xb1df('0x48')]({'where':{'id':_0x45abff,'online':0x1},'attributes':['id',_0xb1df('0x2f'),_0xb1df('0x92'),_0xb1df('0x93'),'interface'],'raw':!![]})['then'](function(_0x1e9922){var _0x508c24=_[_0xb1df('0x32')](_0x1e9922,function(_0x3a3abc){return db[_0xb1df('0x94')][_0xb1df('0x95')]({'membername':_0x3a3abc[_0xb1df('0x2f')],'UserId':_0x3a3abc['id'],'queue_name':_0x14c1f1[_0xb1df('0x2f')],'VoiceQueueId':_0x14c1f1['id'],'interface':_[_0xb1df('0x96')](_0x3a3abc[_0xb1df('0x97')])?util[_0xb1df('0x98')](_0xb1df('0x99'),_0x3a3abc[_0xb1df('0x2f')]):_0x3a3abc[_0xb1df('0x97')],'paused':_0x3a3abc[_0xb1df('0x93')]||![],'penalty':_0x14c1f1[_0xb1df('0x8e')][_0xb1df('0x8f')]},{'transaction':_0x40b5f6});});return Promise[_0xb1df('0x9a')](_0x508c24);});});});return Promise[_0xb1df('0x9a')](_0x464b9f);});return Promise[_0xb1df('0x9a')](_0x3d7674);})['then'](function(){return db[_0xb1df('0x71')][_0xb1df('0x7d')]({'where':{'teamId':_0x787d27}})[_0xb1df('0x2b')](function(_0x138bef){if(_0x138bef){var _0x5d4109=_[_0xb1df('0x32')](_0x45abff,function(_0x432050){db[_0xb1df('0x72')][_0xb1df('0x95')]({'UserId':_0x432050,'VoicePrefixId':_0x138bef['VoicePrefixId']});});return Promise[_0xb1df('0x9a')](_0x5d4109);}});});});return Promise[_0xb1df('0x9a')](_0x3fad42)['then'](function(){return _0xef63c0[_0xb1df('0x83')](_0x45abff,{'transaction':_0x40b5f6})['spread'](function(_0x1fb276){return _0x1fb276;});});});}})['then'](respondWithResult(_0x1c0315,null))[_0xb1df('0x4a')](handleError(_0x1c0315,null));};exports[_0xb1df('0x9b')]=function(_0x3bb228,_0x42496d){var _0x3452c8=_[_0xb1df('0x84')](_0x3bb228[_0xb1df('0x38')]['ids'])?_0x3bb228[_0xb1df('0x38')][_0xb1df('0x80')]:[_0x3bb228[_0xb1df('0x38')]['ids']];var _0x58ca0e=_0x3bb228['params']['id'];return db[_0xb1df('0x46')]['find']({'where':{'id':_0x58ca0e}})['then'](handleEntityNotFound(_0x42496d,null))[_0xb1df('0x2b')](function(_0x2a753a){if(_0x2a753a){var _0x2fe428=[_0xb1df('0x85'),_0xb1df('0x86'),_0xb1df('0x87'),_0xb1df('0x88'),_0xb1df('0x89'),_0xb1df('0x8a'),_0xb1df('0x8b')];return db['sequelize']['transaction'](function(_0x56a4fd){var _0x45a28b=_[_0xb1df('0x32')](_0x2fe428,function(_0x372dee){var _0x66a782={'attributes':['id','name']};return _0x2a753a[_0xb1df('0x53')+_0x372dee+_0xb1df('0x7b')](_0x66a782)[_0xb1df('0x2b')](function(_0x4ad916){var _0x44fcc6=_[_0xb1df('0x32')](_0x4ad916,function(_0x19262f){return _0x19262f['removeAgents'](_0x3452c8,{'transaction':_0x56a4fd})[_0xb1df('0x2b')](function(){var _0xd99a5c=_[_0xb1df('0x32')](_0x3452c8,function(_0xa39a27){socket[_0xb1df('0x90')](_0xb1df('0x52')+_0x372dee+_0xb1df('0x9c'),{'UserId':Number(_0xa39a27),[_0x372dee+'QueueId']:_0x19262f['id']});if(_0x372dee!=='Voice'){return;}return db['UserVoiceQueueRt'][_0xb1df('0x5a')]({'where':{'VoiceQueueId':_0x19262f['id'],'UserId':_0xa39a27},'transaction':_0x56a4fd});});return Promise['all'](_0xd99a5c);});});return Promise[_0xb1df('0x9a')](_0x44fcc6);});});return Promise[_0xb1df('0x9a')](_0x45a28b)['then'](function(){return _0x2a753a[_0xb1df('0x9b')](_0x3452c8,{'transaction':_0x56a4fd});})[_0xb1df('0x2b')](function(){return db['TeamVoicePrefix'][_0xb1df('0x7d')]({'where':{'teamId':_0x58ca0e}})['then'](function(_0x1f90ad){if(_0x1f90ad){var _0x25bf32=_[_0xb1df('0x32')](_0x3452c8,function(_0x2713cd){db[_0xb1df('0x72')][_0xb1df('0x5a')]({'where':{'UserId':_0x2713cd,'VoicePrefixId':_0x1f90ad[_0xb1df('0x73')]}});});return Promise['all'](_0x25bf32);}});});});}})[_0xb1df('0x2b')](respondWithStatusCode(_0x42496d,null))[_0xb1df('0x4a')](handleError(_0x42496d,null));};exports['getAgents']=function(_0x42c576,_0x59b445,_0x1524e1){var _0x339e39={};var _0x92ce9b={};var _0x4c1a74;var _0x1eecc5;return db['Team']['findOne']({'where':{'id':_0x42c576[_0xb1df('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59b445,null))['then'](function(_0x2ec490){if(_0x2ec490){_0x4c1a74=_0x2ec490;_0x92ce9b[_0xb1df('0x37')]=_[_0xb1df('0x4d')](db[_0xb1df('0x9d')][_0xb1df('0x33')]);_0x92ce9b['query']=_[_0xb1df('0x4d')](_0x42c576[_0xb1df('0x38')]);_0x92ce9b[_0xb1df('0x39')]=_['intersection'](_0x92ce9b['model'],_0x92ce9b[_0xb1df('0x38')]);_0x339e39[_0xb1df('0x3a')]=_['intersection'](_0x92ce9b[_0xb1df('0x37')],qs[_0xb1df('0x3c')](_0x42c576[_0xb1df('0x38')][_0xb1df('0x3c')]));_0x339e39[_0xb1df('0x3a')]=_0x339e39[_0xb1df('0x3a')]['length']?_0x339e39[_0xb1df('0x3a')]:_0x92ce9b[_0xb1df('0x37')];_0x339e39[_0xb1df('0x3f')]=qs[_0xb1df('0x40')](_0x42c576[_0xb1df('0x38')][_0xb1df('0x40')]);_0x339e39[_0xb1df('0x41')]=qs['filters'](_[_0xb1df('0x79')](_0x42c576[_0xb1df('0x38')],_0x92ce9b['filters']));if(_0x42c576['query']['filter']){_0x339e39[_0xb1df('0x41')]=_['merge'](_0x339e39['where'],{'$or':_[_0xb1df('0x32')](_0x339e39[_0xb1df('0x3a')],function(_0x5ef29a){var _0x3fdf04={};_0x3fdf04[_0x5ef29a]={'$like':'%'+_0x42c576[_0xb1df('0x38')][_0xb1df('0x44')]+'%'};return _0x3fdf04;})});}_0x339e39=_['merge']({},_0x339e39,_0x42c576[_0xb1df('0x45')]);return _0x4c1a74[_0xb1df('0x9e')](_0x339e39);}})[_0xb1df('0x2b')](function(_0x4569e0){if(_0x4569e0){_0x1eecc5=_0x4569e0[_0xb1df('0x3d')];if(!_0x42c576[_0xb1df('0x38')][_0xb1df('0x9f')]('nolimit')){_0x339e39[_0xb1df('0x22')]=qs[_0xb1df('0x22')](_0x42c576['query'][_0xb1df('0x22')]);_0x339e39[_0xb1df('0x23')]=qs[_0xb1df('0x23')](_0x42c576['query'][_0xb1df('0x23')]);}return _0x4c1a74[_0xb1df('0x9e')](_0x339e39);}})['then'](function(_0x5f50ef){if(_0x5f50ef){return _0x5f50ef?{'count':_0x1eecc5,'rows':_0x5f50ef}:null;}})[_0xb1df('0x2b')](respondWithResult(_0x59b445,null))['catch'](handleError(_0x59b445,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 4b785b7..8316f0f 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 _0xa1b1=['../../mysqldb','setMaxListeners','save','update','remove','exports','events'];(function(_0x12a491,_0x13135e){var _0x3cda65=function(_0x394b06){while(--_0x394b06){_0x12a491['push'](_0x12a491['shift']());}};_0x3cda65(++_0x13135e);}(_0xa1b1,0x7d));var _0x1a1b=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0xa1b1[_0x5a19fc];return _0x34b413;};'use strict';var EventEmitter=require(_0x1a1b('0x0'));var Team=require(_0x1a1b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x1a1b('0x2')](0x0);var events={'afterCreate':_0x1a1b('0x3'),'afterUpdate':_0x1a1b('0x4'),'afterDestroy':_0x1a1b('0x5')};function emitEvent(_0x566d4c){return function(_0x274a85,_0x195fa3,_0x5216fd){TeamEvents['emit'](_0x566d4c+':'+_0x274a85['id'],_0x274a85);TeamEvents['emit'](_0x566d4c,_0x274a85);_0x5216fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x1a1b('0x6')]=TeamEvents; \ No newline at end of file +var _0xe98f=['remove','emit','hook','exports','../../mysqldb','Team','setMaxListeners','save'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xe98f,0x84));var _0xfe98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var Team=require(_0xfe98('0x0'))['db'][_0xfe98('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xfe98('0x2')](0x0);var events={'afterCreate':_0xfe98('0x3'),'afterUpdate':'update','afterDestroy':_0xfe98('0x4')};function emitEvent(_0x15bf6f){return function(_0x388a18,_0x32853e,_0x2e4acb){TeamEvents[_0xfe98('0x5')](_0x15bf6f+':'+_0x388a18['id'],_0x388a18);TeamEvents[_0xfe98('0x5')](_0x15bf6f,_0x388a18);_0x2e4acb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xfe98('0x6')](e,emitEvent(event));}}module[_0xfe98('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index af8a11e..1b0a51e 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 _0x0359=['teams','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','Team'];(function(_0xec10a6,_0x5e1108){var _0x2e6f1e=function(_0x2bf713){while(--_0x2bf713){_0xec10a6['push'](_0xec10a6['shift']());}};_0x2e6f1e(++_0x5e1108);}(_0x0359,0xdd));var _0x9035=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0359[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x9035('0x0'));var util=require(_0x9035('0x1'));var logger=require(_0x9035('0x2'))('api');var moment=require(_0x9035('0x3'));var BPromise=require(_0x9035('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9035('0x5'));var rimraf=require(_0x9035('0x6'));var config=require(_0x9035('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0x1ad51c,_0x4be155){return _0x1ad51c[_0x9035('0x8')](_0x9035('0x9'),attributes,{'tableName':_0x9035('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3af=['rimraf','../../config/environment','exports','define','Team','teams','lodash','util','moment','bluebird','request-promise','path'];(function(_0x206162,_0x30078d){var _0x55ab78=function(_0x4cd532){while(--_0x4cd532){_0x206162['push'](_0x206162['shift']());}};_0x55ab78(++_0x30078d);}(_0xf3af,0xc6));var _0xff3a=function(_0x14e75e,_0x43a34d){_0x14e75e=_0x14e75e-0x0;var _0x5fc83b=_0xf3af[_0x14e75e];return _0x5fc83b;};'use strict';var _=require(_0xff3a('0x0'));var util=require(_0xff3a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xff3a('0x2'));var BPromise=require(_0xff3a('0x3'));var rp=require(_0xff3a('0x4'));var fs=require('fs');var path=require(_0xff3a('0x5'));var rimraf=require(_0xff3a('0x6'));var config=require(_0xff3a('0x7'));var attributes=require('./team.attributes');module[_0xff3a('0x8')]=function(_0x49d99f,_0x54ae09){return _0x49d99f[_0xff3a('0x9')](_0xff3a('0xa'),attributes,{'tableName':_0xff3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b870333..eab4a27 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 _0xdffe=['Team,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0xdffe,0x1d2));var _0xedff=function(_0x186872,_0x50a406){_0x186872=_0x186872-0x0;var _0x2f440d=_0xdffe[_0x186872];return _0x2f440d;};'use strict';var _=require('lodash');var util=require(_0xedff('0x0'));var moment=require('moment');var BPromise=require(_0xedff('0x1'));var rs=require(_0xedff('0x2'));var fs=require('fs');var Redis=require(_0xedff('0x3'));var db=require(_0xedff('0x4'))['db'];var utils=require(_0xedff('0x5'));var logger=require(_0xedff('0x6'))('rpc');var config=require(_0xedff('0x7'));var jayson=require(_0xedff('0x8'));var client=jayson[_0xedff('0x9')][_0xedff('0xa')]({'port':0x232a});config['redis']=_[_0xedff('0xb')](config[_0xedff('0xc')],{'host':_0xedff('0xd'),'port':0x18eb});var socket=require(_0xedff('0xe'))(new Redis(config[_0xedff('0xc')]));require(_0xedff('0xf'))[_0xedff('0x10')](socket);function respondWithRpcPromise(_0x26a8be,_0x242b12,_0x2369d7){return new BPromise(function(_0xeca35b,_0x29759c){return client[_0xedff('0x11')](_0x26a8be,_0x2369d7)[_0xedff('0x12')](function(_0x26cde1){logger[_0xedff('0x13')](_0xedff('0x14'),_0x242b12,_0xedff('0x15'));logger[_0xedff('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x242b12,_0xedff('0x15'),JSON['stringify'](_0x26cde1));if(_0x26cde1['error']){if(_0x26cde1[_0xedff('0x17')]['code']===0x1f4){logger[_0xedff('0x17')](_0xedff('0x14'),_0x242b12,_0x26cde1['error'][_0xedff('0x18')]);return _0x29759c(_0x26cde1[_0xedff('0x17')][_0xedff('0x18')]);}logger[_0xedff('0x17')](_0xedff('0x14'),_0x242b12,_0x26cde1[_0xedff('0x17')][_0xedff('0x18')]);return _0xeca35b(_0x26cde1['error']['message']);}else{logger[_0xedff('0x13')](_0xedff('0x14'),_0x242b12,'request\x20sent');_0xeca35b(_0x26cde1[_0xedff('0x19')][_0xedff('0x18')]);}})[_0xedff('0x1a')](function(_0xfe8758){logger[_0xedff('0x17')](_0xedff('0x14'),_0x242b12,_0xfe8758);_0x29759c(_0xfe8758);});});} \ No newline at end of file +var _0xa644=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','ioredis','../../config/utils'];(function(_0x1af6b9,_0xb293ec){var _0x53aec1=function(_0x3a06eb){while(--_0x3a06eb){_0x1af6b9['push'](_0x1af6b9['shift']());}};_0x53aec1(++_0xb293ec);}(_0xa644,0x15b));var _0x4a64=function(_0x138dbb,_0x52e813){_0x138dbb=_0x138dbb-0x0;var _0x38d59d=_0xa644[_0x138dbb];return _0x38d59d;};'use strict';var _=require(_0x4a64('0x0'));var util=require(_0x4a64('0x1'));var moment=require('moment');var BPromise=require(_0x4a64('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a64('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a64('0x4'));var logger=require(_0x4a64('0x5'))(_0x4a64('0x6'));var config=require(_0x4a64('0x7'));var jayson=require(_0x4a64('0x8'));var client=jayson[_0x4a64('0x9')]['http']({'port':0x232a});config[_0x4a64('0xa')]=_['defaults'](config['redis'],{'host':_0x4a64('0xb'),'port':0x18eb});var socket=require(_0x4a64('0xc'))(new Redis(config[_0x4a64('0xa')]));require('./team.socket')[_0x4a64('0xd')](socket);function respondWithRpcPromise(_0x54054f,_0x1be26b,_0x287bbc){return new BPromise(function(_0x5c2767,_0x374989){return client[_0x4a64('0xe')](_0x54054f,_0x287bbc)['then'](function(_0x2f539f){logger[_0x4a64('0xf')](_0x4a64('0x10'),_0x1be26b,_0x4a64('0x11'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x1be26b,'request\x20sent',JSON[_0x4a64('0x12')](_0x2f539f));if(_0x2f539f[_0x4a64('0x13')]){if(_0x2f539f[_0x4a64('0x13')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x1be26b,_0x2f539f[_0x4a64('0x13')]['message']);return _0x374989(_0x2f539f[_0x4a64('0x13')][_0x4a64('0x14')]);}logger[_0x4a64('0x13')](_0x4a64('0x10'),_0x1be26b,_0x2f539f[_0x4a64('0x13')][_0x4a64('0x14')]);return _0x5c2767(_0x2f539f[_0x4a64('0x13')][_0x4a64('0x14')]);}else{logger[_0x4a64('0xf')](_0x4a64('0x10'),_0x1be26b,'request\x20sent');_0x5c2767(_0x2f539f[_0x4a64('0x15')]['message']);}})['catch'](function(_0x4c768b){logger[_0x4a64('0x13')](_0x4a64('0x10'),_0x1be26b,_0x4c768b);_0x374989(_0x4c768b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 70eff6a..5c47e0d 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 _0x752f=['length','./team.events','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x752f,0x6a));var _0xf752=function(_0xcbf22,_0x421ab6){_0xcbf22=_0xcbf22-0x0;var _0x50c66b=_0x752f[_0xcbf22];return _0x50c66b;};'use strict';var TeamEvents=require(_0xf752('0x0'));var events=['save','remove',_0xf752('0x1')];function createListener(_0x2bafb5,_0x37b168){return function(_0x3b2327){_0x37b168[_0xf752('0x2')](_0x2bafb5,_0x3b2327);};}function removeListener(_0x5b2d82,_0x5792fe){return function(){TeamEvents[_0xf752('0x3')](_0x5b2d82,_0x5792fe);};}exports['register']=function(_0xa5b7ea){for(var _0x434e57=0x0,_0x23de1a=events[_0xf752('0x4')];_0x434e57<_0x23de1a;_0x434e57++){var _0x13277c=events[_0x434e57];var _0x20949d=createListener('team:'+_0x13277c,_0xa5b7ea);TeamEvents['on'](_0x13277c,_0x20949d);}}; \ No newline at end of file +var _0x93f1=['save','remove','update','emit','register','length','./team.events'];(function(_0x13ea0c,_0x2c543b){var _0x5d9427=function(_0x368c2e){while(--_0x368c2e){_0x13ea0c['push'](_0x13ea0c['shift']());}};_0x5d9427(++_0x2c543b);}(_0x93f1,0x1b1));var _0x193f=function(_0x1eac64,_0x272f94){_0x1eac64=_0x1eac64-0x0;var _0x4482e0=_0x93f1[_0x1eac64];return _0x4482e0;};'use strict';var TeamEvents=require(_0x193f('0x0'));var events=[_0x193f('0x1'),_0x193f('0x2'),_0x193f('0x3')];function createListener(_0x26e50d,_0x16e617){return function(_0x5d7d53){_0x16e617[_0x193f('0x4')](_0x26e50d,_0x5d7d53);};}function removeListener(_0x591be9,_0x388a9c){return function(){TeamEvents['removeListener'](_0x591be9,_0x388a9c);};}exports[_0x193f('0x5')]=function(_0x5670ea){for(var _0xd9bc2d=0x0,_0xddcb90=events[_0x193f('0x6')];_0xd9bc2d<_0xddcb90;_0xd9bc2d++){var _0xf6027d=events[_0xd9bc2d];var _0x186e72=createListener('team:'+_0xf6027d,_0x5670ea);TeamEvents['on'](_0xf6027d,_0x186e72);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 19cbefd..6d816fa 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 _0xdae9=['exports','INTEGER'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xdae9,0x15e));var _0x9dae=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xdae9[_0x28669c];return _0x4a3af6;};'use strict';var Sequelize=require('sequelize');module[_0x9dae('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9dae('0x1')]}}; \ No newline at end of file +var _0xd138=['exports','INTEGER','sequelize'];(function(_0x4eaa9c,_0x3a879a){var _0x46b796=function(_0x41f4bc){while(--_0x41f4bc){_0x4eaa9c['push'](_0x4eaa9c['shift']());}};_0x46b796(++_0x3a879a);}(_0xd138,0x1dc));var _0x8d13=function(_0x93f2d,_0x29490c){_0x93f2d=_0x93f2d-0x0;var _0x155a1a=_0xd138[_0x93f2d];return _0x155a1a;};'use strict';var Sequelize=require(_0x8d13('0x0'));module[_0x8d13('0x1')]={'TeamId':{'type':Sequelize[_0x8d13('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 1066b64..b3785d5 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 _0xa788=['request-promise','rimraf','../../config/environment','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x2fdd1f,_0x21fdc9){var _0x142d90=function(_0x2647a4){while(--_0x2647a4){_0x2fdd1f['push'](_0x2fdd1f['shift']());}};_0x142d90(++_0x21fdc9);}(_0xa788,0x70));var _0x8a78=function(_0x127b49,_0x420ce6){_0x127b49=_0x127b49-0x0;var _0x30d554=_0xa788[_0x127b49];return _0x30d554;};'use strict';var _=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var logger=require(_0x8a78('0x2'))(_0x8a78('0x3'));var moment=require('moment');var BPromise=require(_0x8a78('0x4'));var rp=require(_0x8a78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a78('0x6'));var config=require(_0x8a78('0x7'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x506edf,_0x316a62){return _0x506edf[_0x8a78('0x8')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc893=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','bluebird','request-promise'];(function(_0x13f637,_0x19b1b2){var _0x430b61=function(_0x4c3e78){while(--_0x4c3e78){_0x13f637['push'](_0x13f637['shift']());}};_0x430b61(++_0x19b1b2);}(_0xc893,0x194));var _0x3c89=function(_0x40b5fb,_0xee0f70){_0x40b5fb=_0x40b5fb-0x0;var _0x66d775=_0xc893[_0x40b5fb];return _0x66d775;};'use strict';var _=require('lodash');var util=require(_0x3c89('0x0'));var logger=require(_0x3c89('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3c89('0x2'));var rp=require(_0x3c89('0x3'));var fs=require('fs');var path=require(_0x3c89('0x4'));var rimraf=require(_0x3c89('0x5'));var config=require(_0x3c89('0x6'));var attributes=require(_0x3c89('0x7'));module[_0x3c89('0x8')]=function(_0x5f2803,_0x2e156d){return _0x5f2803[_0x3c89('0x9')](_0x3c89('0xa'),attributes,{'tableName':_0x3c89('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 a9e1c33..dc17007 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x522b3b,_0x42f02e){var _0x5e5836=function(_0x4d6719){while(--_0x4d6719){_0x522b3b['push'](_0x522b3b['shift']());}};_0x5e5836(++_0x42f02e);}(_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(_0x43d3fe,_0x48ff68){var _0x228abc=function(_0x2c0b9a){while(--_0x2c0b9a){_0x43d3fe['push'](_0x43d3fe['shift']());}};_0x228abc(++_0x48ff68);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e661c,_0x4a1e6d){_0x3e661c=_0x3e661c-0x0;var _0xae0f6a=_0xedd9[_0x3e661c];return _0xae0f6a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 944f8a8..b4cfa28 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 _0x8e09=['INTEGER','sequelize'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x8e09,0x149));var _0x98e0=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x8e09[_0x480bc8];return _0x28c245;};'use strict';var Sequelize=require(_0x98e0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x98e0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9649=['INTEGER','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9649,0x19f));var _0x9964=function(_0x448666,_0x456af2){_0x448666=_0x448666-0x0;var _0x5b4735=_0x9649[_0x448666];return _0x5b4735;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'penalty':{'type':Sequelize[_0x9964('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d5a9f44..d0db402 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 _0x2b37=['../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5dd9b1,_0x18b97d){var _0x527f9b=function(_0x38ba40){while(--_0x38ba40){_0x5dd9b1['push'](_0x5dd9b1['shift']());}};_0x527f9b(++_0x18b97d);}(_0x2b37,0x12b));var _0x72b3=function(_0x1b3475,_0x311d88){_0x1b3475=_0x1b3475-0x0;var _0x2b846e=_0x2b37[_0x1b3475];return _0x2b846e;};'use strict';var _=require(_0x72b3('0x0'));var util=require(_0x72b3('0x1'));var logger=require(_0x72b3('0x2'))(_0x72b3('0x3'));var moment=require(_0x72b3('0x4'));var BPromise=require(_0x72b3('0x5'));var rp=require(_0x72b3('0x6'));var fs=require('fs');var path=require(_0x72b3('0x7'));var rimraf=require(_0x72b3('0x8'));var config=require(_0x72b3('0x9'));var attributes=require('./teamVoiceQueue.attributes');module[_0x72b3('0xa')]=function(_0x2ab374,_0x50bccb){return _0x2ab374[_0x72b3('0xb')](_0x72b3('0xc'),attributes,{'tableName':_0x72b3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48ea=['TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x4bad01,_0x368ba5){var _0x56d8d9=function(_0x18333a){while(--_0x18333a){_0x4bad01['push'](_0x4bad01['shift']());}};_0x56d8d9(++_0x368ba5);}(_0x48ea,0x9c));var _0xa48e=function(_0x1be583,_0x329266){_0x1be583=_0x1be583-0x0;var _0x48012f=_0x48ea[_0x1be583];return _0x48012f;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var moment=require(_0xa48e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa48e('0x4'));var rimraf=require('rimraf');var config=require(_0xa48e('0x5'));var attributes=require(_0xa48e('0x6'));module[_0xa48e('0x7')]=function(_0x4387b5,_0x2b058d){return _0x4387b5[_0xa48e('0x8')](_0xa48e('0x9'),attributes,{'tableName':_0xa48e('0xa'),'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 043b9b0..5d1566f 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 _0x5127=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x5127,0x18f));var _0x7512=function(_0x45ffc0,_0x4f090b){_0x45ffc0=_0x45ffc0-0x0;var _0x1f0074=_0x5127[_0x45ffc0];return _0x1f0074;};'use strict';var _=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var moment=require(_0x7512('0x2'));var BPromise=require(_0x7512('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7512('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7512('0x5'))(_0x7512('0x6'));var config=require(_0x7512('0x7'));var jayson=require(_0x7512('0x8'));var client=jayson[_0x7512('0x9')][_0x7512('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6779,_0x4d0765,_0x2d2e88){return new BPromise(function(_0x543586,_0x43ce62){return client['request'](_0x4e6779,_0x2d2e88)[_0x7512('0xb')](function(_0x1e41b5){logger[_0x7512('0xc')](_0x7512('0xd'),_0x4d0765,_0x7512('0xe'));logger[_0x7512('0xf')](_0x7512('0x10'),_0x4d0765,_0x7512('0xe'),JSON[_0x7512('0x11')](_0x1e41b5));if(_0x1e41b5[_0x7512('0x12')]){if(_0x1e41b5[_0x7512('0x12')][_0x7512('0x13')]===0x1f4){logger[_0x7512('0x12')](_0x7512('0xd'),_0x4d0765,_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);return _0x43ce62(_0x1e41b5[_0x7512('0x12')]['message']);}logger[_0x7512('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4d0765,_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);return _0x543586(_0x1e41b5[_0x7512('0x12')][_0x7512('0x14')]);}else{logger[_0x7512('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4d0765,'request\x20sent');_0x543586(_0x1e41b5[_0x7512('0x15')][_0x7512('0x14')]);}})[_0x7512('0x16')](function(_0x3f8f8f){logger['error'](_0x7512('0xd'),_0x4d0765,_0x3f8f8f);_0x43ce62(_0x3f8f8f);});});} \ No newline at end of file +var _0xc36a=['request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x20e07d,_0x465e25){var _0x841d00=function(_0x215b31){while(--_0x215b31){_0x20e07d['push'](_0x20e07d['shift']());}};_0x841d00(++_0x465e25);}(_0xc36a,0x180));var _0xac36=function(_0x22507a,_0x22fb47){_0x22507a=_0x22507a-0x0;var _0x5ba884=_0xc36a[_0x22507a];return _0x5ba884;};'use strict';var _=require(_0xac36('0x0'));var util=require(_0xac36('0x1'));var moment=require('moment');var BPromise=require(_0xac36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac36('0x3'));var db=require(_0xac36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac36('0x5'));var config=require('../../config/environment');var jayson=require(_0xac36('0x6'));var client=jayson[_0xac36('0x7')][_0xac36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2f50e,_0x4a72ab,_0x5b8700){return new BPromise(function(_0xe6d230,_0x5e406c){return client['request'](_0xa2f50e,_0x5b8700)[_0xac36('0x9')](function(_0x53c15f){logger[_0xac36('0xa')](_0xac36('0xb'),_0x4a72ab,_0xac36('0xc'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4a72ab,_0xac36('0xc'),JSON[_0xac36('0xd')](_0x53c15f));if(_0x53c15f[_0xac36('0xe')]){if(_0x53c15f[_0xac36('0xe')]['code']===0x1f4){logger[_0xac36('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4a72ab,_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);return _0x5e406c(_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);}logger[_0xac36('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4a72ab,_0x53c15f[_0xac36('0xe')][_0xac36('0xf')]);return _0xe6d230(_0x53c15f[_0xac36('0xe')]['message']);}else{logger['info'](_0xac36('0xb'),_0x4a72ab,'request\x20sent');_0xe6d230(_0x53c15f[_0xac36('0x10')][_0xac36('0xf')]);}})[_0xac36('0x11')](function(_0x19366b){logger[_0xac36('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4a72ab,_0x19366b);_0x5e406c(_0x19366b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d4005f9..b7c1e20 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 _0x1893=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x1893,0xa2));var _0x3189=function(_0x39bcb5,_0x149d76){_0x39bcb5=_0x39bcb5-0x0;var _0x18a7b4=_0x1893[_0x39bcb5];return _0x18a7b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['post']('/',auth[_0x3189('0x9')](),controller['create']);router[_0x3189('0xd')]('/:id',auth[_0x3189('0x9')](),controller[_0x3189('0xe')]);router[_0x3189('0xf')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x10')]);module[_0x3189('0x11')]=router; \ No newline at end of file +var _0x0120=['../../config/environment','./template.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7db43b,_0x1f44ab){var _0x375655=function(_0x25e6ef){while(--_0x25e6ef){_0x7db43b['push'](_0x7db43b['shift']());}};_0x375655(++_0x1f44ab);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var fs_extra=require(_0x0012('0x6'));var auth=require(_0x0012('0x7'));var interaction=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var controller=require(_0x0012('0xa'));router[_0x0012('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0xe')]);router[_0x0012('0xf')]('/',auth[_0x0012('0xd')](),controller['create']);router[_0x0012('0x10')](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0x11')]);router['delete'](_0x0012('0xc'),auth['isAuthenticated'](),controller[_0x0012('0x12')]);module[_0x0012('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 62fbef7..dfca3e0 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 _0x3817=['STRING','TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3817,0xb3));var _0x7381=function(_0x5dbdb,_0x11f942){_0x5dbdb=_0x5dbdb-0x0;var _0x1c15c6=_0x3817[_0x5dbdb];return _0x1c15c6;};'use strict';var Sequelize=require(_0x7381('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7381('0x1')]},'html':{'type':Sequelize[_0x7381('0x2')]}}; \ No newline at end of file +var _0xb5d1=['STRING','TEXT','exports'];(function(_0x285db,_0x4f4926){var _0x2ebec6=function(_0x3a08c3){while(--_0x3a08c3){_0x285db['push'](_0x285db['shift']());}};_0x2ebec6(++_0x4f4926);}(_0xb5d1,0x10a));var _0x1b5d=function(_0x44c3cb,_0x38808f){_0x44c3cb=_0x44c3cb-0x0;var _0x17ed6f=_0xb5d1[_0x44c3cb];return _0x17ed6f;};'use strict';var Sequelize=require('sequelize');module[_0x1b5d('0x0')]={'name':{'type':Sequelize[_0x1b5d('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x1b5d('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 96bafaa..934cd7e 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 _0x6cb1=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','UserProfileResource','error','name','send','map','Template','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel'];(function(_0x4918ff,_0x2da0fb){var _0x3d2d89=function(_0x203dd2){while(--_0x203dd2){_0x4918ff['push'](_0x4918ff['shift']());}};_0x3d2d89(++_0x2da0fb);}(_0x6cb1,0xee));var _0x16cb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6cb1[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16cb('0x0'));var zipdir=require(_0x16cb('0x1'));var jsonpatch=require(_0x16cb('0x2'));var rp=require(_0x16cb('0x3'));var moment=require(_0x16cb('0x4'));var BPromise=require(_0x16cb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x16cb('0x6'));var csv=require(_0x16cb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16cb('0x8'));var _=require(_0x16cb('0x9'));var squel=require(_0x16cb('0xa'));var crypto=require(_0x16cb('0xb'));var jsforce=require(_0x16cb('0xc'));var deskjs=require(_0x16cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x16cb('0xe'));var Papa=require(_0x16cb('0xf'));var Redis=require(_0x16cb('0x10'));var authService=require(_0x16cb('0x11'));var qs=require(_0x16cb('0x12'));var as=require(_0x16cb('0x13'));var hardwareService=require(_0x16cb('0x14'));var logger=require(_0x16cb('0x15'))('api');var utils=require(_0x16cb('0x16'));var config=require(_0x16cb('0x17'));var licenseUtil=require(_0x16cb('0x18'));var db=require(_0x16cb('0x19'))['db'];function respondWithStatusCode(_0x108b81,_0x29d002){_0x29d002=_0x29d002||0xcc;return function(_0x4e17ae){if(_0x4e17ae){return _0x108b81[_0x16cb('0x1a')](_0x29d002);}return _0x108b81[_0x16cb('0x1b')](_0x29d002)[_0x16cb('0x1c')]();};}function respondWithResult(_0x156e86,_0x48aac2){_0x48aac2=_0x48aac2||0xc8;return function(_0x226c53){if(_0x226c53){return _0x156e86[_0x16cb('0x1b')](_0x48aac2)[_0x16cb('0x1d')](_0x226c53);}};}function respondWithFilteredResult(_0x24578a,_0x1df17e){return function(_0xdaa10b){if(_0xdaa10b){var _0x10f987=typeof _0x1df17e[_0x16cb('0x1e')]===_0x16cb('0x1f')&&typeof _0x1df17e[_0x16cb('0x20')]===_0x16cb('0x1f');var _0x4b3388=_0xdaa10b['count'];var _0x543852=_0x10f987?0x0:_0x1df17e['offset'];var _0x2c112d=_0x10f987?_0xdaa10b[_0x16cb('0x21')]:_0x1df17e[_0x16cb('0x1e')]+_0x1df17e[_0x16cb('0x20')];var _0x486537;if(_0x2c112d>=_0x4b3388){_0x2c112d=_0x4b3388;_0x486537=0xc8;}else{_0x486537=0xce;}_0x24578a['status'](_0x486537);return _0x24578a[_0x16cb('0x22')](_0x16cb('0x23'),_0x543852+'-'+_0x2c112d+'/'+_0x4b3388)[_0x16cb('0x1d')](_0xdaa10b);}return null;};}function patchUpdates(_0xb6bf9f){return function(_0x5773e7){try{jsonpatch[_0x16cb('0x24')](_0x5773e7,_0xb6bf9f,!![]);}catch(_0x153de2){return BPromise['reject'](_0x153de2);}return _0x5773e7[_0x16cb('0x25')]();};}function saveUpdates(_0x1b7604,_0x1de94c){return function(_0x41e9da){if(_0x41e9da){return _0x41e9da['update'](_0x1b7604)[_0x16cb('0x26')](function(_0x1541db){return _0x1541db;});}return null;};}function removeEntity(_0x265453,_0x54cbf4){return function(_0x254596){if(_0x254596){return _0x254596['destroy']()[_0x16cb('0x26')](function(){var _0x47d3ca=_0x254596['get']({'plain':!![]});var _0x238e48='Templates';return db[_0x16cb('0x27')]['destroy']({'where':{'type':_0x238e48,'resourceId':_0x47d3ca['id']}})[_0x16cb('0x26')](function(){return _0x254596;});})[_0x16cb('0x26')](function(){_0x265453['status'](0xcc)[_0x16cb('0x1c')]();});}};}function handleEntityNotFound(_0x534069,_0x2aa10d){return function(_0x136ec0){if(!_0x136ec0){_0x534069[_0x16cb('0x1a')](0x194);}return _0x136ec0;};}function handleError(_0x5b6496,_0x3633fc){_0x3633fc=_0x3633fc||0x1f4;return function(_0x2b0c44){logger[_0x16cb('0x28')](_0x2b0c44['stack']);if(_0x2b0c44[_0x16cb('0x29')]){delete _0x2b0c44['name'];}_0x5b6496['status'](_0x3633fc)[_0x16cb('0x2a')](_0x2b0c44);};}exports['index']=function(_0x238187,_0x43d24d){var _0x236ff1={},_0x3a4286={},_0x44d5f2={'count':0x0,'rows':[]};var _0x2655aa=_[_0x16cb('0x2b')](db[_0x16cb('0x2c')]['rawAttributes'],function(_0x477752){return{'name':_0x477752[_0x16cb('0x2d')],'type':_0x477752[_0x16cb('0x2e')][_0x16cb('0x2f')]};});_0x3a4286['model']=_[_0x16cb('0x2b')](_0x2655aa,'name');_0x3a4286['query']=_[_0x16cb('0x30')](_0x238187[_0x16cb('0x31')]);_0x3a4286[_0x16cb('0x32')]=_['intersection'](_0x3a4286[_0x16cb('0x33')],_0x3a4286[_0x16cb('0x31')]);_0x236ff1[_0x16cb('0x34')]=_[_0x16cb('0x35')](_0x3a4286[_0x16cb('0x33')],qs[_0x16cb('0x36')](_0x238187['query'][_0x16cb('0x36')]));_0x236ff1[_0x16cb('0x34')]=_0x236ff1[_0x16cb('0x34')][_0x16cb('0x37')]?_0x236ff1[_0x16cb('0x34')]:_0x3a4286[_0x16cb('0x33')];if(!_0x238187[_0x16cb('0x31')][_0x16cb('0x38')](_0x16cb('0x39'))){_0x236ff1[_0x16cb('0x20')]=qs[_0x16cb('0x20')](_0x238187[_0x16cb('0x31')]['limit']);_0x236ff1[_0x16cb('0x1e')]=qs[_0x16cb('0x1e')](_0x238187[_0x16cb('0x31')][_0x16cb('0x1e')]);}_0x236ff1[_0x16cb('0x3a')]=qs[_0x16cb('0x3b')](_0x238187[_0x16cb('0x31')][_0x16cb('0x3b')]);_0x236ff1[_0x16cb('0x3c')]=qs[_0x16cb('0x32')](_[_0x16cb('0x3d')](_0x238187['query'],_0x3a4286[_0x16cb('0x32')]),_0x2655aa);if(_0x238187[_0x16cb('0x31')][_0x16cb('0x3e')]){_0x236ff1['where']=_[_0x16cb('0x3f')](_0x236ff1[_0x16cb('0x3c')],{'$or':_[_0x16cb('0x2b')](_0x2655aa,function(_0x2bb7d5){if(_0x2bb7d5['type']!==_0x16cb('0x40')){var _0x3e65d2={};_0x3e65d2[_0x2bb7d5['name']]={'$like':'%'+_0x238187[_0x16cb('0x31')][_0x16cb('0x3e')]+'%'};return _0x3e65d2;}})});}_0x236ff1=_[_0x16cb('0x3f')]({},_0x236ff1,_0x238187[_0x16cb('0x41')]);var _0x9a6184={'where':_0x236ff1['where']};return db[_0x16cb('0x2c')][_0x16cb('0x21')](_0x9a6184)[_0x16cb('0x26')](function(_0x528e66){_0x44d5f2[_0x16cb('0x21')]=_0x528e66;if(_0x238187['query'][_0x16cb('0x42')]){_0x236ff1[_0x16cb('0x43')]=[{'all':!![]}];}return db[_0x16cb('0x2c')][_0x16cb('0x44')](_0x236ff1);})[_0x16cb('0x26')](function(_0x4e8662){_0x44d5f2['rows']=_0x4e8662;return _0x44d5f2;})['then'](respondWithFilteredResult(_0x43d24d,_0x236ff1))[_0x16cb('0x45')](handleError(_0x43d24d,null));};exports['show']=function(_0x50820e,_0x413659){var _0x8fad82={'raw':!![],'where':{'id':_0x50820e[_0x16cb('0x46')]['id']}},_0x581f77={};_0x581f77[_0x16cb('0x33')]=_[_0x16cb('0x30')](db[_0x16cb('0x2c')][_0x16cb('0x47')]);_0x581f77['query']=_[_0x16cb('0x30')](_0x50820e[_0x16cb('0x31')]);_0x581f77[_0x16cb('0x32')]=_[_0x16cb('0x35')](_0x581f77['model'],_0x581f77[_0x16cb('0x31')]);_0x8fad82[_0x16cb('0x34')]=_[_0x16cb('0x35')](_0x581f77['model'],qs[_0x16cb('0x36')](_0x50820e[_0x16cb('0x31')][_0x16cb('0x36')]));_0x8fad82[_0x16cb('0x34')]=_0x8fad82[_0x16cb('0x34')][_0x16cb('0x37')]?_0x8fad82[_0x16cb('0x34')]:_0x581f77['model'];if(_0x50820e['query'][_0x16cb('0x42')]){_0x8fad82[_0x16cb('0x43')]=[{'all':!![]}];}_0x8fad82=_[_0x16cb('0x3f')]({},_0x8fad82,_0x50820e[_0x16cb('0x41')]);return db[_0x16cb('0x2c')][_0x16cb('0x48')](_0x8fad82)[_0x16cb('0x26')](handleEntityNotFound(_0x413659,null))[_0x16cb('0x26')](respondWithResult(_0x413659,null))[_0x16cb('0x45')](handleError(_0x413659,null));};exports[_0x16cb('0x49')]=function(_0x5f5459,_0x177e86){return db[_0x16cb('0x2c')]['create'](_0x5f5459[_0x16cb('0x4a')],{})['then'](function(_0x2c79bb){var _0x2456bb=_0x5f5459[_0x16cb('0x4b')][_0x16cb('0x4c')]({'plain':!![]});if(!_0x2456bb)throw new Error(_0x16cb('0x4d'));if(_0x2456bb[_0x16cb('0x4e')]===_0x16cb('0x4b')){var _0x21bbdd=_0x2c79bb[_0x16cb('0x4c')]({'plain':!![]});var _0xe8e36a='Templates';return db['UserProfileSection'][_0x16cb('0x48')]({'where':{'name':_0xe8e36a,'userProfileId':_0x2456bb[_0x16cb('0x4f')]},'raw':!![]})[_0x16cb('0x26')](function(_0x39637c){if(_0x39637c&&_0x39637c[_0x16cb('0x50')]===0x0){return db[_0x16cb('0x27')][_0x16cb('0x49')]({'name':_0x21bbdd[_0x16cb('0x29')],'resourceId':_0x21bbdd['id'],'type':_0x39637c[_0x16cb('0x29')],'sectionId':_0x39637c['id']},{})[_0x16cb('0x26')](function(){return _0x2c79bb;});}else{return _0x2c79bb;}})[_0x16cb('0x45')](function(_0x201b74){logger[_0x16cb('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x201b74);throw _0x201b74;});}return _0x2c79bb;})[_0x16cb('0x26')](respondWithResult(_0x177e86,0xc9))[_0x16cb('0x45')](handleError(_0x177e86,null));};exports[_0x16cb('0x51')]=function(_0x41cf12,_0x226319){if(_0x41cf12[_0x16cb('0x4a')]['id']){delete _0x41cf12[_0x16cb('0x4a')]['id'];}return db[_0x16cb('0x2c')][_0x16cb('0x48')]({'where':{'id':_0x41cf12['params']['id']}})[_0x16cb('0x26')](handleEntityNotFound(_0x226319,null))['then'](saveUpdates(_0x41cf12[_0x16cb('0x4a')],null))['then'](respondWithResult(_0x226319,null))[_0x16cb('0x45')](handleError(_0x226319,null));};exports[_0x16cb('0x52')]=function(_0x42a68a,_0x221d85){return db[_0x16cb('0x2c')][_0x16cb('0x48')]({'where':{'id':_0x42a68a[_0x16cb('0x46')]['id']}})[_0x16cb('0x26')](handleEntityNotFound(_0x221d85,null))[_0x16cb('0x26')](removeEntity(_0x221d85,null))[_0x16cb('0x45')](handleError(_0x221d85,null));}; \ No newline at end of file +var _0x8fda=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','offset','count','set','Content-Range','json','save','update','then','Templates','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','Template','findAll','rows','params','intersection','options','find','catch','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x2880d4,_0x22bdd3){var _0x18b0ad=function(_0x477bc9){while(--_0x477bc9){_0x2880d4['push'](_0x2880d4['shift']());}};_0x18b0ad(++_0x22bdd3);}(_0x8fda,0xfb));var _0xa8fd=function(_0x543f91,_0x15e789){_0x543f91=_0x543f91-0x0;var _0xd40d59=_0x8fda[_0x543f91];return _0xd40d59;};'use strict';var emlformat=require(_0xa8fd('0x0'));var rimraf=require(_0xa8fd('0x1'));var zipdir=require(_0xa8fd('0x2'));var jsonpatch=require(_0xa8fd('0x3'));var rp=require(_0xa8fd('0x4'));var moment=require(_0xa8fd('0x5'));var BPromise=require(_0xa8fd('0x6'));var Mustache=require('mustache');var util=require(_0xa8fd('0x7'));var path=require(_0xa8fd('0x8'));var sox=require(_0xa8fd('0x9'));var csv=require(_0xa8fd('0xa'));var ejs=require(_0xa8fd('0xb'));var fs=require('fs');var fs_extra=require(_0xa8fd('0xc'));var _=require(_0xa8fd('0xd'));var squel=require(_0xa8fd('0xe'));var crypto=require(_0xa8fd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa8fd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa8fd('0x11'));var Redis=require(_0xa8fd('0x12'));var authService=require(_0xa8fd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa8fd('0x14'));var hardwareService=require(_0xa8fd('0x15'));var logger=require(_0xa8fd('0x16'))(_0xa8fd('0x17'));var utils=require(_0xa8fd('0x18'));var config=require(_0xa8fd('0x19'));var licenseUtil=require(_0xa8fd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xedee8d,_0x5cddbe){_0x5cddbe=_0x5cddbe||0xcc;return function(_0x8995e2){if(_0x8995e2){return _0xedee8d['sendStatus'](_0x5cddbe);}return _0xedee8d[_0xa8fd('0x1b')](_0x5cddbe)[_0xa8fd('0x1c')]();};}function respondWithResult(_0x24cc1b,_0x560225){_0x560225=_0x560225||0xc8;return function(_0xdf900a){if(_0xdf900a){return _0x24cc1b[_0xa8fd('0x1b')](_0x560225)['json'](_0xdf900a);}};}function respondWithFilteredResult(_0x3a6f85,_0x20a83d){return function(_0x113c27){if(_0x113c27){var _0xafb06a=typeof _0x20a83d['offset']===_0xa8fd('0x1d')&&typeof _0x20a83d[_0xa8fd('0x1e')]===_0xa8fd('0x1d');var _0x4fe6ef=_0x113c27['count'];var _0x4810b3=_0xafb06a?0x0:_0x20a83d[_0xa8fd('0x1f')];var _0x2d1f95=_0xafb06a?_0x113c27[_0xa8fd('0x20')]:_0x20a83d[_0xa8fd('0x1f')]+_0x20a83d[_0xa8fd('0x1e')];var _0x38a160;if(_0x2d1f95>=_0x4fe6ef){_0x2d1f95=_0x4fe6ef;_0x38a160=0xc8;}else{_0x38a160=0xce;}_0x3a6f85[_0xa8fd('0x1b')](_0x38a160);return _0x3a6f85[_0xa8fd('0x21')](_0xa8fd('0x22'),_0x4810b3+'-'+_0x2d1f95+'/'+_0x4fe6ef)[_0xa8fd('0x23')](_0x113c27);}return null;};}function patchUpdates(_0x3f0f5b){return function(_0x525e42){try{jsonpatch['apply'](_0x525e42,_0x3f0f5b,!![]);}catch(_0x154d93){return BPromise['reject'](_0x154d93);}return _0x525e42[_0xa8fd('0x24')]();};}function saveUpdates(_0x57a831,_0xe0ba8e){return function(_0x857ec8){if(_0x857ec8){return _0x857ec8[_0xa8fd('0x25')](_0x57a831)[_0xa8fd('0x26')](function(_0x3eb762){return _0x3eb762;});}return null;};}function removeEntity(_0x2bf121,_0x4f3a30){return function(_0x4cd86c){if(_0x4cd86c){return _0x4cd86c['destroy']()['then'](function(){var _0x3e6884=_0x4cd86c['get']({'plain':!![]});var _0x42cf08=_0xa8fd('0x27');return db[_0xa8fd('0x28')][_0xa8fd('0x29')]({'where':{'type':_0x42cf08,'resourceId':_0x3e6884['id']}})[_0xa8fd('0x26')](function(){return _0x4cd86c;});})[_0xa8fd('0x26')](function(){_0x2bf121['status'](0xcc)[_0xa8fd('0x1c')]();});}};}function handleEntityNotFound(_0x51a606,_0x41af55){return function(_0x3936ac){if(!_0x3936ac){_0x51a606[_0xa8fd('0x2a')](0x194);}return _0x3936ac;};}function handleError(_0x15a5d8,_0x147315){_0x147315=_0x147315||0x1f4;return function(_0x40144f){logger[_0xa8fd('0x2b')](_0x40144f[_0xa8fd('0x2c')]);if(_0x40144f['name']){delete _0x40144f[_0xa8fd('0x2d')];}_0x15a5d8[_0xa8fd('0x1b')](_0x147315)[_0xa8fd('0x2e')](_0x40144f);};}exports[_0xa8fd('0x2f')]=function(_0x3a6bf1,_0x1a8729){var _0x109788={},_0x42ae7c={},_0x57e1ad={'count':0x0,'rows':[]};var _0x4cc9b9=_['map'](db['Template'][_0xa8fd('0x30')],function(_0x417de5){return{'name':_0x417de5[_0xa8fd('0x31')],'type':_0x417de5[_0xa8fd('0x32')][_0xa8fd('0x33')]};});_0x42ae7c[_0xa8fd('0x34')]=_['map'](_0x4cc9b9,_0xa8fd('0x2d'));_0x42ae7c[_0xa8fd('0x35')]=_[_0xa8fd('0x36')](_0x3a6bf1[_0xa8fd('0x35')]);_0x42ae7c[_0xa8fd('0x37')]=_['intersection'](_0x42ae7c[_0xa8fd('0x34')],_0x42ae7c[_0xa8fd('0x35')]);_0x109788[_0xa8fd('0x38')]=_['intersection'](_0x42ae7c[_0xa8fd('0x34')],qs[_0xa8fd('0x39')](_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x39')]));_0x109788[_0xa8fd('0x38')]=_0x109788[_0xa8fd('0x38')][_0xa8fd('0x3a')]?_0x109788[_0xa8fd('0x38')]:_0x42ae7c[_0xa8fd('0x34')];if(!_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x3b')](_0xa8fd('0x3c'))){_0x109788[_0xa8fd('0x1e')]=qs[_0xa8fd('0x1e')](_0x3a6bf1[_0xa8fd('0x35')]['limit']);_0x109788[_0xa8fd('0x1f')]=qs['offset'](_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x1f')]);}_0x109788[_0xa8fd('0x3d')]=qs['sort'](_0x3a6bf1[_0xa8fd('0x35')]['sort']);_0x109788[_0xa8fd('0x3e')]=qs[_0xa8fd('0x37')](_[_0xa8fd('0x3f')](_0x3a6bf1[_0xa8fd('0x35')],_0x42ae7c['filters']),_0x4cc9b9);if(_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x40')]){_0x109788[_0xa8fd('0x3e')]=_[_0xa8fd('0x41')](_0x109788[_0xa8fd('0x3e')],{'$or':_['map'](_0x4cc9b9,function(_0x311d5d){if(_0x311d5d[_0xa8fd('0x32')]!==_0xa8fd('0x42')){var _0x45e422={};_0x45e422[_0x311d5d['name']]={'$like':'%'+_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x40')]+'%'};return _0x45e422;}})});}_0x109788=_['merge']({},_0x109788,_0x3a6bf1['options']);var _0x3969b0={'where':_0x109788['where']};return db['Template'][_0xa8fd('0x20')](_0x3969b0)[_0xa8fd('0x26')](function(_0x4b21e0){_0x57e1ad[_0xa8fd('0x20')]=_0x4b21e0;if(_0x3a6bf1[_0xa8fd('0x35')][_0xa8fd('0x43')]){_0x109788[_0xa8fd('0x44')]=[{'all':!![]}];}return db[_0xa8fd('0x45')][_0xa8fd('0x46')](_0x109788);})[_0xa8fd('0x26')](function(_0x36d7ed){_0x57e1ad[_0xa8fd('0x47')]=_0x36d7ed;return _0x57e1ad;})[_0xa8fd('0x26')](respondWithFilteredResult(_0x1a8729,_0x109788))['catch'](handleError(_0x1a8729,null));};exports['show']=function(_0x2462c3,_0x270a31){var _0x37a060={'raw':!![],'where':{'id':_0x2462c3[_0xa8fd('0x48')]['id']}},_0x6fe4c6={};_0x6fe4c6[_0xa8fd('0x34')]=_[_0xa8fd('0x36')](db[_0xa8fd('0x45')][_0xa8fd('0x30')]);_0x6fe4c6['query']=_[_0xa8fd('0x36')](_0x2462c3[_0xa8fd('0x35')]);_0x6fe4c6[_0xa8fd('0x37')]=_[_0xa8fd('0x49')](_0x6fe4c6[_0xa8fd('0x34')],_0x6fe4c6['query']);_0x37a060[_0xa8fd('0x38')]=_['intersection'](_0x6fe4c6['model'],qs['fields'](_0x2462c3[_0xa8fd('0x35')][_0xa8fd('0x39')]));_0x37a060['attributes']=_0x37a060[_0xa8fd('0x38')][_0xa8fd('0x3a')]?_0x37a060[_0xa8fd('0x38')]:_0x6fe4c6[_0xa8fd('0x34')];if(_0x2462c3[_0xa8fd('0x35')][_0xa8fd('0x43')]){_0x37a060[_0xa8fd('0x44')]=[{'all':!![]}];}_0x37a060=_[_0xa8fd('0x41')]({},_0x37a060,_0x2462c3[_0xa8fd('0x4a')]);return db[_0xa8fd('0x45')][_0xa8fd('0x4b')](_0x37a060)[_0xa8fd('0x26')](handleEntityNotFound(_0x270a31,null))[_0xa8fd('0x26')](respondWithResult(_0x270a31,null))[_0xa8fd('0x4c')](handleError(_0x270a31,null));};exports['create']=function(_0xbcd678,_0x3d46dd){return db[_0xa8fd('0x45')]['create'](_0xbcd678['body'],{})[_0xa8fd('0x26')](function(_0x5e4f8e){var _0x3c5585=_0xbcd678[_0xa8fd('0x4d')][_0xa8fd('0x4e')]({'plain':!![]});if(!_0x3c5585)throw new Error(_0xa8fd('0x4f'));if(_0x3c5585[_0xa8fd('0x50')]===_0xa8fd('0x4d')){var _0x23ed91=_0x5e4f8e[_0xa8fd('0x4e')]({'plain':!![]});var _0x4471cf=_0xa8fd('0x27');return db[_0xa8fd('0x51')][_0xa8fd('0x4b')]({'where':{'name':_0x4471cf,'userProfileId':_0x3c5585[_0xa8fd('0x52')]},'raw':!![]})[_0xa8fd('0x26')](function(_0x3e1abc){if(_0x3e1abc&&_0x3e1abc[_0xa8fd('0x53')]===0x0){return db[_0xa8fd('0x28')][_0xa8fd('0x54')]({'name':_0x23ed91[_0xa8fd('0x2d')],'resourceId':_0x23ed91['id'],'type':_0x3e1abc[_0xa8fd('0x2d')],'sectionId':_0x3e1abc['id']},{})[_0xa8fd('0x26')](function(){return _0x5e4f8e;});}else{return _0x5e4f8e;}})['catch'](function(_0x2af2db){logger[_0xa8fd('0x2b')](_0xa8fd('0x55'),_0x2af2db);throw _0x2af2db;});}return _0x5e4f8e;})['then'](respondWithResult(_0x3d46dd,0xc9))[_0xa8fd('0x4c')](handleError(_0x3d46dd,null));};exports[_0xa8fd('0x25')]=function(_0x46a388,_0x11e415){if(_0x46a388[_0xa8fd('0x56')]['id']){delete _0x46a388[_0xa8fd('0x56')]['id'];}return db['Template']['find']({'where':{'id':_0x46a388['params']['id']}})['then'](handleEntityNotFound(_0x11e415,null))[_0xa8fd('0x26')](saveUpdates(_0x46a388['body'],null))[_0xa8fd('0x26')](respondWithResult(_0x11e415,null))[_0xa8fd('0x4c')](handleError(_0x11e415,null));};exports[_0xa8fd('0x29')]=function(_0x38b852,_0x237f49){return db[_0xa8fd('0x45')][_0xa8fd('0x4b')]({'where':{'id':_0x38b852[_0xa8fd('0x48')]['id']}})[_0xa8fd('0x26')](handleEntityNotFound(_0x237f49,null))[_0xa8fd('0x26')](removeEntity(_0x237f49,null))[_0xa8fd('0x4c')](handleError(_0x237f49,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2fcc416..5887027 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 _0x8604=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Template','api'];(function(_0x174384,_0x690a91){var _0x530455=function(_0x5ec615){while(--_0x5ec615){_0x174384['push'](_0x174384['shift']());}};_0x530455(++_0x690a91);}(_0x8604,0xa9));var _0x4860=function(_0x1430e4,_0x5c7281){_0x1430e4=_0x1430e4-0x0;var _0x186e50=_0x8604[_0x1430e4];return _0x186e50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4860('0x0'));var moment=require(_0x4860('0x1'));var BPromise=require(_0x4860('0x2'));var rp=require(_0x4860('0x3'));var fs=require('fs');var path=require(_0x4860('0x4'));var rimraf=require(_0x4860('0x5'));var config=require(_0x4860('0x6'));var attributes=require('./template.attributes');module[_0x4860('0x7')]=function(_0x22d2d5,_0x2d6585){return _0x22d2d5[_0x4860('0x8')](_0x4860('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbff8=['tools_templates','lodash','util','moment','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0xbff8,0x79));var _0x8bff=function(_0x1f23fe,_0x43d619){_0x1f23fe=_0x1f23fe-0x0;var _0x510ec1=_0xbff8[_0x1f23fe];return _0x510ec1;};'use strict';var _=require(_0x8bff('0x0'));var util=require(_0x8bff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8bff('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8bff('0x3'));var config=require(_0x8bff('0x4'));var attributes=require(_0x8bff('0x5'));module[_0x8bff('0x6')]=function(_0x52f552,_0x5be2b6){return _0x52f552[_0x8bff('0x7')](_0x8bff('0x8'),attributes,{'tableName':_0x8bff('0x9'),'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 dda2d9d..319f7a3 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 _0xdb90=['lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','then','catch'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xdb90,0xf8));var _0x0db9=function(_0x1a4ad1,_0x4df6a5){_0x1a4ad1=_0x1a4ad1-0x0;var _0x32b225=_0xdb90[_0x1a4ad1];return _0x32b225;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var moment=require('moment');var BPromise=require(_0x0db9('0x2'));var rs=require(_0x0db9('0x3'));var fs=require('fs');var Redis=require(_0x0db9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0db9('0x5'))('rpc');var config=require(_0x0db9('0x6'));var jayson=require(_0x0db9('0x7'));var client=jayson[_0x0db9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301aed,_0x3ed6f3,_0x429d6b){return new BPromise(function(_0x1386ed,_0x4f973d){return client[_0x0db9('0x9')](_0x301aed,_0x429d6b)['then'](function(_0x15ea70){logger['info'](_0x0db9('0xa'),_0x3ed6f3,_0x0db9('0xb'));logger[_0x0db9('0xc')](_0x0db9('0xd'),_0x3ed6f3,_0x0db9('0xb'),JSON[_0x0db9('0xe')](_0x15ea70));if(_0x15ea70[_0x0db9('0xf')]){if(_0x15ea70[_0x0db9('0xf')]['code']===0x1f4){logger['error'](_0x0db9('0xa'),_0x3ed6f3,_0x15ea70[_0x0db9('0xf')]['message']);return _0x4f973d(_0x15ea70[_0x0db9('0xf')][_0x0db9('0x10')]);}logger[_0x0db9('0xf')](_0x0db9('0xa'),_0x3ed6f3,_0x15ea70[_0x0db9('0xf')][_0x0db9('0x10')]);return _0x1386ed(_0x15ea70[_0x0db9('0xf')]['message']);}else{logger[_0x0db9('0x11')](_0x0db9('0xa'),_0x3ed6f3,_0x0db9('0xb'));_0x1386ed(_0x15ea70[_0x0db9('0x12')]['message']);}})['catch'](function(_0x458c0b){logger[_0x0db9('0xf')](_0x0db9('0xa'),_0x3ed6f3,_0x458c0b);_0x4f973d(_0x458c0b);});});}exports[_0x0db9('0x13')]=function(_0x3b2e75){var _0x4ad919=this;return new Promise(function(_0x5e5ef8,_0x525527){return db[_0x0db9('0x14')]['findAll']({'raw':_0x3b2e75[_0x0db9('0x15')]?_0x3b2e75[_0x0db9('0x15')][_0x0db9('0x16')]===undefined?!![]:![]:!![],'where':_0x3b2e75[_0x0db9('0x15')]?_0x3b2e75['options'][_0x0db9('0x17')]||null:null,'attributes':_0x3b2e75[_0x0db9('0x15')]?_0x3b2e75[_0x0db9('0x15')][_0x0db9('0x18')]||null:null,'limit':_0x3b2e75[_0x0db9('0x15')]?_0x3b2e75[_0x0db9('0x15')][_0x0db9('0x19')]||null:null,'include':_0x3b2e75[_0x0db9('0x15')]?_0x3b2e75[_0x0db9('0x15')][_0x0db9('0x1a')]?_[_0x0db9('0x1b')](_0x3b2e75[_0x0db9('0x15')][_0x0db9('0x1a')],function(_0x4fc3d5){return{'model':db[_0x4fc3d5[_0x0db9('0x1c')]],'as':_0x4fc3d5['as'],'attributes':_0x4fc3d5[_0x0db9('0x18')],'include':_0x4fc3d5[_0x0db9('0x1a')]?_[_0x0db9('0x1b')](_0x4fc3d5[_0x0db9('0x1a')],function(_0x2ad3e8){return{'model':db[_0x2ad3e8[_0x0db9('0x1c')]],'as':_0x2ad3e8['as'],'attributes':_0x2ad3e8[_0x0db9('0x18')],'include':_0x2ad3e8[_0x0db9('0x1a')]?_[_0x0db9('0x1b')](_0x2ad3e8['include'],function(_0x216dd1){return{'model':db[_0x216dd1[_0x0db9('0x1c')]],'as':_0x216dd1['as'],'attributes':_0x216dd1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0db9('0x1d')](function(_0x522ad5){logger[_0x0db9('0x11')](_0x0db9('0x13'),_0x3b2e75);logger[_0x0db9('0xc')](_0x0db9('0x13'),_0x3b2e75,JSON['stringify'](_0x522ad5));_0x5e5ef8(_0x522ad5);})[_0x0db9('0x1e')](function(_0xea5d3f){logger[_0x0db9('0xf')](_0x0db9('0x13'),_0xea5d3f[_0x0db9('0x10')],_0x3b2e75);_0x525527(_0x4ad919['error'](0x1f4,_0xea5d3f['message']));});});}; \ No newline at end of file +var _0xcbb5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','Template','findAll','options','raw','where','limit','include','map','model','attributes','GetTemplate','lodash','moment','bluebird','ioredis'];(function(_0x9bca53,_0x59b4f8){var _0x3894bc=function(_0x1ae67d){while(--_0x1ae67d){_0x9bca53['push'](_0x9bca53['shift']());}};_0x3894bc(++_0x59b4f8);}(_0xcbb5,0xa1));var _0x5cbb=function(_0x11fcdd,_0x4ec696){_0x11fcdd=_0x11fcdd-0x0;var _0x4fefcd=_0xcbb5[_0x11fcdd];return _0x4fefcd;};'use strict';var _=require(_0x5cbb('0x0'));var util=require('util');var moment=require(_0x5cbb('0x1'));var BPromise=require(_0x5cbb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cbb('0x3'));var db=require(_0x5cbb('0x4'))['db'];var utils=require(_0x5cbb('0x5'));var logger=require(_0x5cbb('0x6'))(_0x5cbb('0x7'));var config=require(_0x5cbb('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51533d,_0x4fa651,_0x6a64db){return new BPromise(function(_0x27b04b,_0x13ce8a){return client[_0x5cbb('0x9')](_0x51533d,_0x6a64db)[_0x5cbb('0xa')](function(_0x5eac39){logger[_0x5cbb('0xb')](_0x5cbb('0xc'),_0x4fa651,'request\x20sent');logger[_0x5cbb('0xd')](_0x5cbb('0xe'),_0x4fa651,'request\x20sent',JSON[_0x5cbb('0xf')](_0x5eac39));if(_0x5eac39[_0x5cbb('0x10')]){if(_0x5eac39['error'][_0x5cbb('0x11')]===0x1f4){logger[_0x5cbb('0x10')](_0x5cbb('0xc'),_0x4fa651,_0x5eac39['error']['message']);return _0x13ce8a(_0x5eac39[_0x5cbb('0x10')][_0x5cbb('0x12')]);}logger[_0x5cbb('0x10')](_0x5cbb('0xc'),_0x4fa651,_0x5eac39[_0x5cbb('0x10')][_0x5cbb('0x12')]);return _0x27b04b(_0x5eac39[_0x5cbb('0x10')][_0x5cbb('0x12')]);}else{logger[_0x5cbb('0xb')](_0x5cbb('0xc'),_0x4fa651,_0x5cbb('0x13'));_0x27b04b(_0x5eac39[_0x5cbb('0x14')][_0x5cbb('0x12')]);}})[_0x5cbb('0x15')](function(_0x446a4c){logger['error']('Template,\x20%s,\x20%s',_0x4fa651,_0x446a4c);_0x13ce8a(_0x446a4c);});});}exports['GetTemplate']=function(_0x21a23f){var _0x3b9048=this;return new Promise(function(_0x30ddb1,_0x412543){return db[_0x5cbb('0x16')][_0x5cbb('0x17')]({'raw':_0x21a23f['options']?_0x21a23f[_0x5cbb('0x18')][_0x5cbb('0x19')]===undefined?!![]:![]:!![],'where':_0x21a23f[_0x5cbb('0x18')]?_0x21a23f[_0x5cbb('0x18')][_0x5cbb('0x1a')]||null:null,'attributes':_0x21a23f[_0x5cbb('0x18')]?_0x21a23f[_0x5cbb('0x18')]['attributes']||null:null,'limit':_0x21a23f[_0x5cbb('0x18')]?_0x21a23f[_0x5cbb('0x18')][_0x5cbb('0x1b')]||null:null,'include':_0x21a23f['options']?_0x21a23f[_0x5cbb('0x18')][_0x5cbb('0x1c')]?_[_0x5cbb('0x1d')](_0x21a23f[_0x5cbb('0x18')]['include'],function(_0x2fd574){return{'model':db[_0x2fd574['model']],'as':_0x2fd574['as'],'attributes':_0x2fd574['attributes'],'include':_0x2fd574[_0x5cbb('0x1c')]?_['map'](_0x2fd574[_0x5cbb('0x1c')],function(_0x5d28ea){return{'model':db[_0x5d28ea[_0x5cbb('0x1e')]],'as':_0x5d28ea['as'],'attributes':_0x5d28ea[_0x5cbb('0x1f')],'include':_0x5d28ea[_0x5cbb('0x1c')]?_[_0x5cbb('0x1d')](_0x5d28ea[_0x5cbb('0x1c')],function(_0x4ca99d){return{'model':db[_0x4ca99d['model']],'as':_0x4ca99d['as'],'attributes':_0x4ca99d[_0x5cbb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5cbb('0xa')](function(_0x4259b3){logger[_0x5cbb('0xb')](_0x5cbb('0x20'),_0x21a23f);logger[_0x5cbb('0xd')](_0x5cbb('0x20'),_0x21a23f,JSON['stringify'](_0x4259b3));_0x30ddb1(_0x4259b3);})['catch'](function(_0x3fc9f5){logger[_0x5cbb('0x10')](_0x5cbb('0x20'),_0x3fc9f5[_0x5cbb('0x12')],_0x21a23f);_0x412543(_0x3b9048['error'](0x1f4,_0x3fc9f5[_0x5cbb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e873b27..bcfd80a 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 _0x0a80=['index','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','post','addAnyCondition','/:id/actions','addAction','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0a80,0x1e8));var _0x00a8=function(_0x5190e3,_0x5aa3f6){_0x5190e3=_0x5190e3-0x0;var _0x12d24c=_0x0a80[_0x5190e3];return _0x12d24c;};'use strict';var multer=require(_0x00a8('0x0'));var util=require(_0x00a8('0x1'));var path=require(_0x00a8('0x2'));var timeout=require(_0x00a8('0x3'));var express=require(_0x00a8('0x4'));var router=express[_0x00a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x00a8('0x6'));var interaction=require(_0x00a8('0x7'));var config=require(_0x00a8('0x8'));var controller=require(_0x00a8('0x9'));router[_0x00a8('0xa')]('/',auth[_0x00a8('0xb')](),controller[_0x00a8('0xc')]);router[_0x00a8('0xa')](_0x00a8('0xd'),auth['isAuthenticated'](),controller[_0x00a8('0xe')]);router[_0x00a8('0xa')](_0x00a8('0xf'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x00a8('0xa')](_0x00a8('0x10'),auth[_0x00a8('0xb')](),controller[_0x00a8('0x11')]);router[_0x00a8('0xa')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x00a8('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x00a8('0x12')]('/:id/all_conditions',auth[_0x00a8('0xb')](),controller['addAllCondition']);router[_0x00a8('0x12')](_0x00a8('0x10'),auth['isAuthenticated'](),controller[_0x00a8('0x13')]);router[_0x00a8('0x12')](_0x00a8('0x14'),auth[_0x00a8('0xb')](),controller[_0x00a8('0x15')]);router['put'](_0x00a8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x00a8('0x16')]('/:id',auth[_0x00a8('0xb')](),controller[_0x00a8('0x17')]);module[_0x00a8('0x18')]=router; \ No newline at end of file +var _0x6888=['addAnyCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0x6888,0xd2));var _0x8688=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x6888[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x8688('0x0'));var util=require('util');var path=require(_0x8688('0x1'));var timeout=require(_0x8688('0x2'));var express=require(_0x8688('0x3'));var router=express[_0x8688('0x4')]();var fs_extra=require(_0x8688('0x5'));var auth=require(_0x8688('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8688('0x7'));router[_0x8688('0x8')]('/',auth[_0x8688('0x9')](),controller[_0x8688('0xa')]);router[_0x8688('0x8')](_0x8688('0xb'),auth['isAuthenticated'](),controller[_0x8688('0xc')]);router[_0x8688('0x8')](_0x8688('0xd'),auth[_0x8688('0x9')](),controller[_0x8688('0xe')]);router['get']('/:id/any_conditions',auth[_0x8688('0x9')](),controller[_0x8688('0xf')]);router[_0x8688('0x8')](_0x8688('0x10'),auth[_0x8688('0x9')](),controller[_0x8688('0x11')]);router[_0x8688('0x12')]('/',auth[_0x8688('0x9')](),controller[_0x8688('0x13')]);router['post'](_0x8688('0xd'),auth[_0x8688('0x9')](),controller[_0x8688('0x14')]);router[_0x8688('0x12')](_0x8688('0x15'),auth[_0x8688('0x9')](),controller[_0x8688('0x16')]);router[_0x8688('0x12')](_0x8688('0x10'),auth[_0x8688('0x9')](),controller[_0x8688('0x17')]);router[_0x8688('0x18')]('/:id',auth[_0x8688('0x9')](),controller[_0x8688('0x19')]);router[_0x8688('0x1a')](_0x8688('0xb'),auth[_0x8688('0x9')](),controller[_0x8688('0x1b')]);module[_0x8688('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index dcb2bb4..9f19907 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 _0xf311=['STRING','BOOLEAN','sequelize','exports'];(function(_0x524313,_0x1fdea2){var _0x3fc794=function(_0x35597b){while(--_0x35597b){_0x524313['push'](_0x524313['shift']());}};_0x3fc794(++_0x1fdea2);}(_0xf311,0x106));var _0x1f31=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf311[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x1f31('0x0'));module[_0x1f31('0x1')]={'name':{'type':Sequelize[_0x1f31('0x2')]},'channel':{'type':Sequelize[_0x1f31('0x2')]},'description':{'type':Sequelize[_0x1f31('0x2')]},'status':{'type':Sequelize[_0x1f31('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xee73=['STRING','BOOLEAN','sequelize','exports'];(function(_0x13888f,_0x1b16ed){var _0x4ae367=function(_0x403211){while(--_0x403211){_0x13888f['push'](_0x13888f['shift']());}};_0x4ae367(++_0x1b16ed);}(_0xee73,0x196));var _0x3ee7=function(_0x305d8c,_0x153576){_0x305d8c=_0x305d8c-0x0;var _0x1e6143=_0xee73[_0x305d8c];return _0x1e6143;};'use strict';var Sequelize=require(_0x3ee7('0x0'));module[_0x3ee7('0x1')]={'name':{'type':Sequelize[_0x3ee7('0x2')]},'channel':{'type':Sequelize[_0x3ee7('0x2')]},'description':{'type':Sequelize[_0x3ee7('0x2')]},'status':{'type':Sequelize[_0x3ee7('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 578cea4..7151176 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 _0xf3cc=['getAllConditions','findOne','hasOwnProperty','order','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','name','index','map','Trigger','rawAttributes','type','model','query','filters','attributes','intersection','length','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','fields','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId'];(function(_0x5ef9f9,_0x472b0c){var _0x1a22f0=function(_0x1dd29b){while(--_0x1dd29b){_0x5ef9f9['push'](_0x5ef9f9['shift']());}};_0x1a22f0(++_0x472b0c);}(_0xf3cc,0xc6));var _0xcf3c=function(_0x35c1cf,_0x197400){_0x35c1cf=_0x35c1cf-0x0;var _0x56bc59=_0xf3cc[_0x35c1cf];return _0x56bc59;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf3c('0x5'));var util=require(_0xcf3c('0x6'));var path=require(_0xcf3c('0x7'));var sox=require('sox');var csv=require(_0xcf3c('0x8'));var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcf3c('0xa'));var crypto=require(_0xcf3c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcf3c('0xc'));var toCsv=require(_0xcf3c('0x8'));var querystring=require(_0xcf3c('0xd'));var Papa=require(_0xcf3c('0xe'));var Redis=require(_0xcf3c('0xf'));var authService=require(_0xcf3c('0x10'));var qs=require(_0xcf3c('0x11'));var as=require(_0xcf3c('0x12'));var hardwareService=require(_0xcf3c('0x13'));var logger=require(_0xcf3c('0x14'))(_0xcf3c('0x15'));var utils=require('../../config/utils');var config=require(_0xcf3c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf3c('0x17'))['db'];function respondWithStatusCode(_0x39ee66,_0x5b0b01){_0x5b0b01=_0x5b0b01||0xcc;return function(_0x2da487){if(_0x2da487){return _0x39ee66[_0xcf3c('0x18')](_0x5b0b01);}return _0x39ee66['status'](_0x5b0b01)[_0xcf3c('0x19')]();};}function respondWithResult(_0x537c69,_0x2bb5a6){_0x2bb5a6=_0x2bb5a6||0xc8;return function(_0x21a3c0){if(_0x21a3c0){return _0x537c69[_0xcf3c('0x1a')](_0x2bb5a6)[_0xcf3c('0x1b')](_0x21a3c0);}};}function respondWithFilteredResult(_0x47a4ee,_0x3394e0){return function(_0x80bef9){if(_0x80bef9){var _0xe4122c=typeof _0x3394e0[_0xcf3c('0x1c')]===_0xcf3c('0x1d')&&typeof _0x3394e0['limit']===_0xcf3c('0x1d');var _0x4f6bec=_0x80bef9['count'];var _0x4648d8=_0xe4122c?0x0:_0x3394e0[_0xcf3c('0x1c')];var _0x3f4e73=_0xe4122c?_0x80bef9[_0xcf3c('0x1e')]:_0x3394e0[_0xcf3c('0x1c')]+_0x3394e0[_0xcf3c('0x1f')];var _0x5ec2db;if(_0x3f4e73>=_0x4f6bec){_0x3f4e73=_0x4f6bec;_0x5ec2db=0xc8;}else{_0x5ec2db=0xce;}_0x47a4ee[_0xcf3c('0x1a')](_0x5ec2db);return _0x47a4ee[_0xcf3c('0x20')](_0xcf3c('0x21'),_0x4648d8+'-'+_0x3f4e73+'/'+_0x4f6bec)['json'](_0x80bef9);}return null;};}function patchUpdates(_0x139078){return function(_0x5002b2){try{jsonpatch[_0xcf3c('0x22')](_0x5002b2,_0x139078,!![]);}catch(_0x1ea806){return BPromise[_0xcf3c('0x23')](_0x1ea806);}return _0x5002b2[_0xcf3c('0x24')]();};}function saveUpdates(_0x243294,_0x470564){return function(_0x3aede4){if(_0x3aede4){return _0x3aede4[_0xcf3c('0x25')](_0x243294)['then'](function(_0x3afaac){return _0x3afaac;});}return null;};}function removeEntity(_0x3fa0b2,_0x554442){return function(_0x73d0d6){if(_0x73d0d6){return _0x73d0d6['destroy']()[_0xcf3c('0x26')](function(){var _0x30f18c=_0x73d0d6[_0xcf3c('0x27')]({'plain':!![]});var _0xa8c224=_0xcf3c('0x28');return db[_0xcf3c('0x29')][_0xcf3c('0x2a')]({'where':{'type':_0xa8c224,'resourceId':_0x30f18c['id']}})[_0xcf3c('0x26')](function(){return _0x73d0d6;});})[_0xcf3c('0x26')](function(){_0x3fa0b2['status'](0xcc)[_0xcf3c('0x19')]();});}};}function handleEntityNotFound(_0x24c2e1,_0x16b256){return function(_0x189ece){if(!_0x189ece){_0x24c2e1['sendStatus'](0x194);}return _0x189ece;};}function handleError(_0x3d7256,_0x3a96d8){_0x3a96d8=_0x3a96d8||0x1f4;return function(_0x26b0ed){logger[_0xcf3c('0x2b')](_0x26b0ed['stack']);if(_0x26b0ed['name']){delete _0x26b0ed[_0xcf3c('0x2c')];}_0x3d7256[_0xcf3c('0x1a')](_0x3a96d8)['send'](_0x26b0ed);};}exports[_0xcf3c('0x2d')]=function(_0x9aaecd,_0x1cc13d){var _0x2b7e5a={},_0x57fa6d={},_0xefbe3e={'count':0x0,'rows':[]};var _0x4e7258=_[_0xcf3c('0x2e')](db[_0xcf3c('0x2f')][_0xcf3c('0x30')],function(_0x28f526){return{'name':_0x28f526['fieldName'],'type':_0x28f526[_0xcf3c('0x31')]['key']};});_0x57fa6d[_0xcf3c('0x32')]=_['map'](_0x4e7258,_0xcf3c('0x2c'));_0x57fa6d[_0xcf3c('0x33')]=_['keys'](_0x9aaecd[_0xcf3c('0x33')]);_0x57fa6d[_0xcf3c('0x34')]=_['intersection'](_0x57fa6d[_0xcf3c('0x32')],_0x57fa6d['query']);_0x2b7e5a[_0xcf3c('0x35')]=_[_0xcf3c('0x36')](_0x57fa6d[_0xcf3c('0x32')],qs['fields'](_0x9aaecd[_0xcf3c('0x33')]['fields']));_0x2b7e5a[_0xcf3c('0x35')]=_0x2b7e5a['attributes'][_0xcf3c('0x37')]?_0x2b7e5a['attributes']:_0x57fa6d[_0xcf3c('0x32')];if(!_0x9aaecd['query']['hasOwnProperty'](_0xcf3c('0x38'))){_0x2b7e5a[_0xcf3c('0x1f')]=qs[_0xcf3c('0x1f')](_0x9aaecd[_0xcf3c('0x33')][_0xcf3c('0x1f')]);_0x2b7e5a[_0xcf3c('0x1c')]=qs[_0xcf3c('0x1c')](_0x9aaecd['query']['offset']);}_0x2b7e5a['order']=qs[_0xcf3c('0x39')](_0x9aaecd[_0xcf3c('0x33')][_0xcf3c('0x39')]);_0x2b7e5a[_0xcf3c('0x3a')]=qs['filters'](_[_0xcf3c('0x3b')](_0x9aaecd['query'],_0x57fa6d[_0xcf3c('0x34')]),_0x4e7258);if(_0x9aaecd['query'][_0xcf3c('0x3c')]){_0x2b7e5a[_0xcf3c('0x3a')]=_[_0xcf3c('0x3d')](_0x2b7e5a[_0xcf3c('0x3a')],{'$or':_[_0xcf3c('0x2e')](_0x4e7258,function(_0x4a9003){if(_0x4a9003[_0xcf3c('0x31')]!=='VIRTUAL'){var _0x13f321={};_0x13f321[_0x4a9003[_0xcf3c('0x2c')]]={'$like':'%'+_0x9aaecd['query'][_0xcf3c('0x3c')]+'%'};return _0x13f321;}})});}_0x2b7e5a=_['merge']({},_0x2b7e5a,_0x9aaecd['options']);var _0x288458={'where':_0x2b7e5a[_0xcf3c('0x3a')]};return db['Trigger'][_0xcf3c('0x1e')](_0x288458)[_0xcf3c('0x26')](function(_0xe41efb){_0xefbe3e[_0xcf3c('0x1e')]=_0xe41efb;if(_0x9aaecd[_0xcf3c('0x33')][_0xcf3c('0x3e')]){_0x2b7e5a[_0xcf3c('0x3f')]=[{'all':!![]}];}return db[_0xcf3c('0x2f')][_0xcf3c('0x40')](_0x2b7e5a);})[_0xcf3c('0x26')](function(_0x4e43ab){_0xefbe3e[_0xcf3c('0x41')]=_0x4e43ab;return _0xefbe3e;})[_0xcf3c('0x26')](respondWithFilteredResult(_0x1cc13d,_0x2b7e5a))[_0xcf3c('0x42')](handleError(_0x1cc13d,null));};exports[_0xcf3c('0x43')]=function(_0xe35f97,_0x1e2498){var _0x5a9c31={'raw':![],'where':{'id':_0xe35f97[_0xcf3c('0x44')]['id']}},_0x1da673={};_0x1da673[_0xcf3c('0x32')]=_[_0xcf3c('0x45')](db['Trigger'][_0xcf3c('0x30')]);_0x1da673[_0xcf3c('0x33')]=_[_0xcf3c('0x45')](_0xe35f97[_0xcf3c('0x33')]);_0x1da673[_0xcf3c('0x34')]=_['intersection'](_0x1da673[_0xcf3c('0x32')],_0x1da673[_0xcf3c('0x33')]);_0x5a9c31['attributes']=_['intersection'](_0x1da673[_0xcf3c('0x32')],qs[_0xcf3c('0x46')](_0xe35f97[_0xcf3c('0x33')][_0xcf3c('0x46')]));_0x5a9c31[_0xcf3c('0x35')]=_0x5a9c31[_0xcf3c('0x35')][_0xcf3c('0x37')]?_0x5a9c31[_0xcf3c('0x35')]:_0x1da673[_0xcf3c('0x32')];if(_0xe35f97[_0xcf3c('0x33')][_0xcf3c('0x3e')]){_0x5a9c31[_0xcf3c('0x3f')]=[{'all':!![]}];}_0x5a9c31=_[_0xcf3c('0x3d')]({},_0x5a9c31,_0xe35f97[_0xcf3c('0x47')]);return db['Trigger']['find'](_0x5a9c31)[_0xcf3c('0x26')](handleEntityNotFound(_0x1e2498,null))['then'](respondWithResult(_0x1e2498,null))[_0xcf3c('0x42')](handleError(_0x1e2498,null));};exports[_0xcf3c('0x48')]=function(_0x12f577,_0x3b3106){return db[_0xcf3c('0x2f')][_0xcf3c('0x48')](_0x12f577['body'],{})[_0xcf3c('0x26')](function(_0x474891){var _0x1695f7=_0x12f577[_0xcf3c('0x49')]['get']({'plain':!![]});if(!_0x1695f7)throw new Error(_0xcf3c('0x4a'));if(_0x1695f7[_0xcf3c('0x4b')]===_0xcf3c('0x49')){var _0x5cb6d7=_0x474891[_0xcf3c('0x27')]({'plain':!![]});var _0x56433e=_0xcf3c('0x28');return db[_0xcf3c('0x4c')][_0xcf3c('0x4d')]({'where':{'name':_0x56433e,'userProfileId':_0x1695f7[_0xcf3c('0x4e')]},'raw':!![]})[_0xcf3c('0x26')](function(_0x181287){if(_0x181287&&_0x181287[_0xcf3c('0x4f')]===0x0){return db[_0xcf3c('0x29')][_0xcf3c('0x48')]({'name':_0x5cb6d7[_0xcf3c('0x2c')],'resourceId':_0x5cb6d7['id'],'type':_0x181287[_0xcf3c('0x2c')],'sectionId':_0x181287['id']},{})['then'](function(){return _0x474891;});}else{return _0x474891;}})['catch'](function(_0x3e17f3){logger[_0xcf3c('0x2b')](_0xcf3c('0x50'),_0x3e17f3);throw _0x3e17f3;});}return _0x474891;})['then'](respondWithResult(_0x3b3106,0xc9))[_0xcf3c('0x42')](handleError(_0x3b3106,null));};exports[_0xcf3c('0x25')]=function(_0x482b7c,_0x3b939a){if(_0x482b7c[_0xcf3c('0x51')]['id']){delete _0x482b7c['body']['id'];}return db[_0xcf3c('0x2f')][_0xcf3c('0x4d')]({'where':{'id':_0x482b7c[_0xcf3c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b939a,null))[_0xcf3c('0x26')](saveUpdates(_0x482b7c['body'],null))[_0xcf3c('0x26')](respondWithResult(_0x3b939a,null))[_0xcf3c('0x42')](handleError(_0x3b939a,null));};exports['destroy']=function(_0x18a565,_0x5edd41){return db[_0xcf3c('0x2f')]['find']({'where':{'id':_0x18a565[_0xcf3c('0x44')]['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x5edd41,null))[_0xcf3c('0x26')](removeEntity(_0x5edd41,null))[_0xcf3c('0x42')](handleError(_0x5edd41,null));};exports[_0xcf3c('0x52')]=function(_0x261b4c,_0x43fe0e,_0x563bf1){if(_0x261b4c[_0xcf3c('0x51')]['id']){delete _0x261b4c[_0xcf3c('0x51')]['id'];}return db[_0xcf3c('0x2f')][_0xcf3c('0x4d')]({'where':{'id':_0x261b4c[_0xcf3c('0x44')]['id']}})['then'](handleEntityNotFound(_0x43fe0e,null))['then'](function(_0xd45f56){if(_0xd45f56){_0x261b4c[_0xcf3c('0x51')][_0xcf3c('0x53')]=_0xd45f56['id'];return db[_0xcf3c('0x54')][_0xcf3c('0x48')](_0x261b4c['body']);}})[_0xcf3c('0x26')](respondWithResult(_0x43fe0e,null))[_0xcf3c('0x42')](handleError(_0x43fe0e,null));};exports[_0xcf3c('0x55')]=function(_0x599c80,_0x33211d,_0x192405){if(_0x599c80[_0xcf3c('0x51')]['id']){delete _0x599c80[_0xcf3c('0x51')]['id'];}return db[_0xcf3c('0x2f')][_0xcf3c('0x4d')]({'where':{'id':_0x599c80[_0xcf3c('0x44')]['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x33211d,null))['then'](function(_0x20fce0){if(_0x20fce0){_0x599c80[_0xcf3c('0x51')][_0xcf3c('0x56')]=_0x20fce0['id'];return db[_0xcf3c('0x54')][_0xcf3c('0x48')](_0x599c80[_0xcf3c('0x51')]);}})[_0xcf3c('0x26')](respondWithResult(_0x33211d,null))[_0xcf3c('0x42')](handleError(_0x33211d,null));};exports[_0xcf3c('0x57')]=function(_0x3dde4e,_0x2e859f,_0x4cd951){var _0x5d05d7={};var _0xc46141={};var _0x55dc1d;var _0x8c2455;return db['Trigger'][_0xcf3c('0x58')]({'where':{'id':_0x3dde4e[_0xcf3c('0x44')]['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x2e859f,null))['then'](function(_0x294ac2){if(_0x294ac2){_0x55dc1d=_0x294ac2;_0xc46141[_0xcf3c('0x32')]=_[_0xcf3c('0x45')](db[_0xcf3c('0x54')]['rawAttributes']);_0xc46141['query']=_[_0xcf3c('0x45')](_0x3dde4e['query']);_0xc46141[_0xcf3c('0x34')]=_[_0xcf3c('0x36')](_0xc46141[_0xcf3c('0x32')],_0xc46141[_0xcf3c('0x33')]);_0x5d05d7[_0xcf3c('0x35')]=_[_0xcf3c('0x36')](_0xc46141[_0xcf3c('0x32')],qs['fields'](_0x3dde4e[_0xcf3c('0x33')][_0xcf3c('0x46')]));_0x5d05d7[_0xcf3c('0x35')]=_0x5d05d7['attributes']['length']?_0x5d05d7[_0xcf3c('0x35')]:_0xc46141[_0xcf3c('0x32')];_0x5d05d7['order']=qs[_0xcf3c('0x39')](_0x3dde4e['query'][_0xcf3c('0x39')]);_0x5d05d7['where']=qs['filters'](_['pick'](_0x3dde4e[_0xcf3c('0x33')],_0xc46141['filters']));if(_0x3dde4e['query'][_0xcf3c('0x3c')]){_0x5d05d7[_0xcf3c('0x3a')]=_['merge'](_0x5d05d7[_0xcf3c('0x3a')],{'$or':_['map'](_0x5d05d7[_0xcf3c('0x35')],function(_0x13b49b){var _0x52020b={};_0x52020b[_0x13b49b]={'$like':'%'+_0x3dde4e[_0xcf3c('0x33')][_0xcf3c('0x3c')]+'%'};return _0x52020b;})});}_0x5d05d7=_[_0xcf3c('0x3d')]({},_0x5d05d7,_0x3dde4e['options']);return _0x55dc1d[_0xcf3c('0x57')](_0x5d05d7);}})['then'](function(_0x1c51e7){if(_0x1c51e7){_0x8c2455=_0x1c51e7['length'];if(!_0x3dde4e[_0xcf3c('0x33')][_0xcf3c('0x59')](_0xcf3c('0x38'))){_0x5d05d7[_0xcf3c('0x1f')]=qs[_0xcf3c('0x1f')](_0x3dde4e[_0xcf3c('0x33')][_0xcf3c('0x1f')]);_0x5d05d7[_0xcf3c('0x1c')]=qs['offset'](_0x3dde4e[_0xcf3c('0x33')]['offset']);}return _0x55dc1d[_0xcf3c('0x57')](_0x5d05d7);}})['then'](function(_0x1447d9){if(_0x1447d9){return _0x1447d9?{'count':_0x8c2455,'rows':_0x1447d9}:null;}})['then'](respondWithResult(_0x2e859f,null))[_0xcf3c('0x42')](handleError(_0x2e859f,null));};exports['getAnyConditions']=function(_0x24d40b,_0x5cd5a8,_0x5ec8b9){var _0x1cc423={};var _0x5a8545={};var _0x173662;var _0x16dd2d;return db[_0xcf3c('0x2f')][_0xcf3c('0x58')]({'where':{'id':_0x24d40b['params']['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x5cd5a8,null))[_0xcf3c('0x26')](function(_0x3e1e55){if(_0x3e1e55){_0x173662=_0x3e1e55;_0x5a8545['model']=_[_0xcf3c('0x45')](db['Condition'][_0xcf3c('0x30')]);_0x5a8545['query']=_[_0xcf3c('0x45')](_0x24d40b[_0xcf3c('0x33')]);_0x5a8545[_0xcf3c('0x34')]=_[_0xcf3c('0x36')](_0x5a8545[_0xcf3c('0x32')],_0x5a8545[_0xcf3c('0x33')]);_0x1cc423[_0xcf3c('0x35')]=_['intersection'](_0x5a8545['model'],qs[_0xcf3c('0x46')](_0x24d40b['query']['fields']));_0x1cc423[_0xcf3c('0x35')]=_0x1cc423[_0xcf3c('0x35')]['length']?_0x1cc423[_0xcf3c('0x35')]:_0x5a8545[_0xcf3c('0x32')];_0x1cc423[_0xcf3c('0x5a')]=qs[_0xcf3c('0x39')](_0x24d40b[_0xcf3c('0x33')]['sort']);_0x1cc423[_0xcf3c('0x3a')]=qs[_0xcf3c('0x34')](_[_0xcf3c('0x3b')](_0x24d40b[_0xcf3c('0x33')],_0x5a8545[_0xcf3c('0x34')]));if(_0x24d40b['query'][_0xcf3c('0x3c')]){_0x1cc423[_0xcf3c('0x3a')]=_[_0xcf3c('0x3d')](_0x1cc423[_0xcf3c('0x3a')],{'$or':_['map'](_0x1cc423['attributes'],function(_0x3e9e09){var _0x3f274d={};_0x3f274d[_0x3e9e09]={'$like':'%'+_0x24d40b[_0xcf3c('0x33')][_0xcf3c('0x3c')]+'%'};return _0x3f274d;})});}_0x1cc423=_[_0xcf3c('0x3d')]({},_0x1cc423,_0x24d40b[_0xcf3c('0x47')]);return _0x173662['getAnyConditions'](_0x1cc423);}})['then'](function(_0x489e2c){if(_0x489e2c){_0x16dd2d=_0x489e2c[_0xcf3c('0x37')];if(!_0x24d40b[_0xcf3c('0x33')][_0xcf3c('0x59')](_0xcf3c('0x38'))){_0x1cc423[_0xcf3c('0x1f')]=qs[_0xcf3c('0x1f')](_0x24d40b[_0xcf3c('0x33')][_0xcf3c('0x1f')]);_0x1cc423[_0xcf3c('0x1c')]=qs[_0xcf3c('0x1c')](_0x24d40b[_0xcf3c('0x33')][_0xcf3c('0x1c')]);}return _0x173662['getAnyConditions'](_0x1cc423);}})['then'](function(_0x121794){if(_0x121794){return _0x121794?{'count':_0x16dd2d,'rows':_0x121794}:null;}})[_0xcf3c('0x26')](respondWithResult(_0x5cd5a8,null))[_0xcf3c('0x42')](handleError(_0x5cd5a8,null));};exports[_0xcf3c('0x5b')]=function(_0x17f9c7,_0x2e7a23,_0xfd54cc){if(_0x17f9c7[_0xcf3c('0x51')]['id']){delete _0x17f9c7[_0xcf3c('0x51')]['id'];}return db[_0xcf3c('0x2f')][_0xcf3c('0x4d')]({'where':{'id':_0x17f9c7[_0xcf3c('0x44')]['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x2e7a23,null))[_0xcf3c('0x26')](function(_0x18183c){if(_0x18183c){_0x17f9c7['body'][_0xcf3c('0x5c')]=_0x18183c['id'];return db['Action'][_0xcf3c('0x48')](_0x17f9c7[_0xcf3c('0x51')]);}})[_0xcf3c('0x26')](respondWithResult(_0x2e7a23,null))['catch'](handleError(_0x2e7a23,null));};exports['getActions']=function(_0x246d94,_0x2c2662,_0x425c92){var _0x3f4bae={};var _0x415aee={};var _0x1add9b;var _0x19c993;return db[_0xcf3c('0x2f')][_0xcf3c('0x58')]({'where':{'id':_0x246d94['params']['id']}})[_0xcf3c('0x26')](handleEntityNotFound(_0x2c2662,null))['then'](function(_0x3cbcb2){if(_0x3cbcb2){_0x1add9b=_0x3cbcb2;_0x415aee[_0xcf3c('0x32')]=_['keys'](db[_0xcf3c('0x5d')]['rawAttributes']);_0x415aee[_0xcf3c('0x33')]=_['keys'](_0x246d94['query']);_0x415aee[_0xcf3c('0x34')]=_[_0xcf3c('0x36')](_0x415aee[_0xcf3c('0x32')],_0x415aee[_0xcf3c('0x33')]);_0x3f4bae[_0xcf3c('0x35')]=_[_0xcf3c('0x36')](_0x415aee[_0xcf3c('0x32')],qs['fields'](_0x246d94[_0xcf3c('0x33')][_0xcf3c('0x46')]));_0x3f4bae[_0xcf3c('0x35')]=_0x3f4bae[_0xcf3c('0x35')]['length']?_0x3f4bae[_0xcf3c('0x35')]:_0x415aee[_0xcf3c('0x32')];_0x3f4bae['order']=qs['sort'](_0x246d94['query']['sort']);_0x3f4bae['where']=qs[_0xcf3c('0x34')](_['pick'](_0x246d94[_0xcf3c('0x33')],_0x415aee[_0xcf3c('0x34')]));if(_0x246d94[_0xcf3c('0x33')]['filter']){_0x3f4bae[_0xcf3c('0x3a')]=_['merge'](_0x3f4bae['where'],{'$or':_['map'](_0x3f4bae[_0xcf3c('0x35')],function(_0x20e0e4){var _0x5d8278={};_0x5d8278[_0x20e0e4]={'$like':'%'+_0x246d94[_0xcf3c('0x33')][_0xcf3c('0x3c')]+'%'};return _0x5d8278;})});}_0x3f4bae=_[_0xcf3c('0x3d')]({},_0x3f4bae,_0x246d94[_0xcf3c('0x47')]);return _0x1add9b['getActions'](_0x3f4bae);}})[_0xcf3c('0x26')](function(_0x3a61cd){if(_0x3a61cd){_0x19c993=_0x3a61cd[_0xcf3c('0x37')];if(!_0x246d94[_0xcf3c('0x33')][_0xcf3c('0x59')]('nolimit')){_0x3f4bae['limit']=qs[_0xcf3c('0x1f')](_0x246d94[_0xcf3c('0x33')][_0xcf3c('0x1f')]);_0x3f4bae[_0xcf3c('0x1c')]=qs[_0xcf3c('0x1c')](_0x246d94[_0xcf3c('0x33')][_0xcf3c('0x1c')]);}return _0x1add9b[_0xcf3c('0x5e')](_0x3f4bae);}})[_0xcf3c('0x26')](function(_0x31670c){if(_0x31670c){return _0x31670c?{'count':_0x19c993,'rows':_0x31670c}:null;}})[_0xcf3c('0x26')](respondWithResult(_0x2c2662,null))[_0xcf3c('0x42')](handleError(_0x2c2662,null));}; \ No newline at end of file +var _0x243b=['include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAnyId','findOne','Condition','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','filters'];(function(_0x1e5ccf,_0x2e2b15){var _0x48dd74=function(_0x4adc03){while(--_0x4adc03){_0x1e5ccf['push'](_0x1e5ccf['shift']());}};_0x48dd74(++_0x2e2b15);}(_0x243b,0x17e));var _0xb243=function(_0x19ff4e,_0x36c118){_0x19ff4e=_0x19ff4e-0x0;var _0xeb9ee8=_0x243b[_0x19ff4e];return _0xeb9ee8;};'use strict';var emlformat=require(_0xb243('0x0'));var rimraf=require(_0xb243('0x1'));var zipdir=require(_0xb243('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb243('0x3'));var moment=require(_0xb243('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb243('0x5'));var path=require(_0xb243('0x6'));var sox=require(_0xb243('0x7'));var csv=require(_0xb243('0x8'));var ejs=require(_0xb243('0x9'));var fs=require('fs');var fs_extra=require(_0xb243('0xa'));var _=require(_0xb243('0xb'));var squel=require(_0xb243('0xc'));var crypto=require(_0xb243('0xd'));var jsforce=require(_0xb243('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb243('0xf'));var Papa=require('papaparse');var Redis=require(_0xb243('0x10'));var authService=require(_0xb243('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb243('0x12'));var hardwareService=require(_0xb243('0x13'));var logger=require('../../config/logger')(_0xb243('0x14'));var utils=require('../../config/utils');var config=require(_0xb243('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb243('0x16'))['db'];function respondWithStatusCode(_0x35a320,_0x47806a){_0x47806a=_0x47806a||0xcc;return function(_0x465b8e){if(_0x465b8e){return _0x35a320[_0xb243('0x17')](_0x47806a);}return _0x35a320[_0xb243('0x18')](_0x47806a)[_0xb243('0x19')]();};}function respondWithResult(_0x7e61e8,_0x1d2592){_0x1d2592=_0x1d2592||0xc8;return function(_0x34ff06){if(_0x34ff06){return _0x7e61e8[_0xb243('0x18')](_0x1d2592)[_0xb243('0x1a')](_0x34ff06);}};}function respondWithFilteredResult(_0x2e0528,_0x50e0e2){return function(_0x3644be){if(_0x3644be){var _0x18f7fb=typeof _0x50e0e2[_0xb243('0x1b')]==='undefined'&&typeof _0x50e0e2[_0xb243('0x1c')]===_0xb243('0x1d');var _0x53fa17=_0x3644be[_0xb243('0x1e')];var _0x2a8661=_0x18f7fb?0x0:_0x50e0e2['offset'];var _0x4fb41=_0x18f7fb?_0x3644be[_0xb243('0x1e')]:_0x50e0e2['offset']+_0x50e0e2[_0xb243('0x1c')];var _0x1d915f;if(_0x4fb41>=_0x53fa17){_0x4fb41=_0x53fa17;_0x1d915f=0xc8;}else{_0x1d915f=0xce;}_0x2e0528['status'](_0x1d915f);return _0x2e0528[_0xb243('0x1f')](_0xb243('0x20'),_0x2a8661+'-'+_0x4fb41+'/'+_0x53fa17)['json'](_0x3644be);}return null;};}function patchUpdates(_0x41f9d1){return function(_0x3718c5){try{jsonpatch[_0xb243('0x21')](_0x3718c5,_0x41f9d1,!![]);}catch(_0x1cd2b1){return BPromise['reject'](_0x1cd2b1);}return _0x3718c5['save']();};}function saveUpdates(_0x431a7a,_0x5297aa){return function(_0x1f0bdb){if(_0x1f0bdb){return _0x1f0bdb[_0xb243('0x22')](_0x431a7a)[_0xb243('0x23')](function(_0x5c56e2){return _0x5c56e2;});}return null;};}function removeEntity(_0x305c0d,_0x11ff55){return function(_0x56384e){if(_0x56384e){return _0x56384e[_0xb243('0x24')]()[_0xb243('0x23')](function(){var _0x35676e=_0x56384e[_0xb243('0x25')]({'plain':!![]});var _0x494a36=_0xb243('0x26');return db[_0xb243('0x27')]['destroy']({'where':{'type':_0x494a36,'resourceId':_0x35676e['id']}})['then'](function(){return _0x56384e;});})['then'](function(){_0x305c0d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3344,_0x2548f9){return function(_0x3594b1){if(!_0x3594b1){_0x3b3344[_0xb243('0x17')](0x194);}return _0x3594b1;};}function handleError(_0xe8731a,_0x4c1367){_0x4c1367=_0x4c1367||0x1f4;return function(_0x374b2d){logger[_0xb243('0x28')](_0x374b2d[_0xb243('0x29')]);if(_0x374b2d['name']){delete _0x374b2d[_0xb243('0x2a')];}_0xe8731a['status'](_0x4c1367)[_0xb243('0x2b')](_0x374b2d);};}exports[_0xb243('0x2c')]=function(_0x343cbe,_0x31cabb){var _0x3ee390={},_0x5c0a20={},_0x4579fe={'count':0x0,'rows':[]};var _0x101192=_[_0xb243('0x2d')](db[_0xb243('0x2e')][_0xb243('0x2f')],function(_0x44b99a){return{'name':_0x44b99a[_0xb243('0x30')],'type':_0x44b99a[_0xb243('0x31')]['key']};});_0x5c0a20[_0xb243('0x32')]=_[_0xb243('0x2d')](_0x101192,_0xb243('0x2a'));_0x5c0a20[_0xb243('0x33')]=_['keys'](_0x343cbe[_0xb243('0x33')]);_0x5c0a20['filters']=_[_0xb243('0x34')](_0x5c0a20[_0xb243('0x32')],_0x5c0a20['query']);_0x3ee390[_0xb243('0x35')]=_[_0xb243('0x34')](_0x5c0a20[_0xb243('0x32')],qs[_0xb243('0x36')](_0x343cbe[_0xb243('0x33')][_0xb243('0x36')]));_0x3ee390['attributes']=_0x3ee390[_0xb243('0x35')][_0xb243('0x37')]?_0x3ee390[_0xb243('0x35')]:_0x5c0a20[_0xb243('0x32')];if(!_0x343cbe['query']['hasOwnProperty'](_0xb243('0x38'))){_0x3ee390[_0xb243('0x1c')]=qs[_0xb243('0x1c')](_0x343cbe['query']['limit']);_0x3ee390[_0xb243('0x1b')]=qs['offset'](_0x343cbe['query']['offset']);}_0x3ee390[_0xb243('0x39')]=qs[_0xb243('0x3a')](_0x343cbe[_0xb243('0x33')][_0xb243('0x3a')]);_0x3ee390[_0xb243('0x3b')]=qs['filters'](_[_0xb243('0x3c')](_0x343cbe[_0xb243('0x33')],_0x5c0a20['filters']),_0x101192);if(_0x343cbe[_0xb243('0x33')][_0xb243('0x3d')]){_0x3ee390['where']=_[_0xb243('0x3e')](_0x3ee390[_0xb243('0x3b')],{'$or':_[_0xb243('0x2d')](_0x101192,function(_0x30ae70){if(_0x30ae70[_0xb243('0x31')]!==_0xb243('0x3f')){var _0x48e73f={};_0x48e73f[_0x30ae70[_0xb243('0x2a')]]={'$like':'%'+_0x343cbe['query']['filter']+'%'};return _0x48e73f;}})});}_0x3ee390=_[_0xb243('0x3e')]({},_0x3ee390,_0x343cbe[_0xb243('0x40')]);var _0x34be6a={'where':_0x3ee390['where']};return db[_0xb243('0x2e')][_0xb243('0x1e')](_0x34be6a)[_0xb243('0x23')](function(_0x1d6e7c){_0x4579fe[_0xb243('0x1e')]=_0x1d6e7c;if(_0x343cbe[_0xb243('0x33')][_0xb243('0x41')]){_0x3ee390['include']=[{'all':!![]}];}return db['Trigger'][_0xb243('0x42')](_0x3ee390);})[_0xb243('0x23')](function(_0x26651a){_0x4579fe[_0xb243('0x43')]=_0x26651a;return _0x4579fe;})[_0xb243('0x23')](respondWithFilteredResult(_0x31cabb,_0x3ee390))[_0xb243('0x44')](handleError(_0x31cabb,null));};exports[_0xb243('0x45')]=function(_0x1395b0,_0x129b22){var _0x39fa6e={'raw':![],'where':{'id':_0x1395b0[_0xb243('0x46')]['id']}},_0x441e9f={};_0x441e9f[_0xb243('0x32')]=_[_0xb243('0x47')](db[_0xb243('0x2e')]['rawAttributes']);_0x441e9f[_0xb243('0x33')]=_[_0xb243('0x47')](_0x1395b0['query']);_0x441e9f[_0xb243('0x48')]=_[_0xb243('0x34')](_0x441e9f[_0xb243('0x32')],_0x441e9f[_0xb243('0x33')]);_0x39fa6e['attributes']=_[_0xb243('0x34')](_0x441e9f[_0xb243('0x32')],qs[_0xb243('0x36')](_0x1395b0[_0xb243('0x33')][_0xb243('0x36')]));_0x39fa6e[_0xb243('0x35')]=_0x39fa6e[_0xb243('0x35')][_0xb243('0x37')]?_0x39fa6e[_0xb243('0x35')]:_0x441e9f[_0xb243('0x32')];if(_0x1395b0[_0xb243('0x33')][_0xb243('0x41')]){_0x39fa6e[_0xb243('0x49')]=[{'all':!![]}];}_0x39fa6e=_[_0xb243('0x3e')]({},_0x39fa6e,_0x1395b0[_0xb243('0x40')]);return db['Trigger'][_0xb243('0x4a')](_0x39fa6e)[_0xb243('0x23')](handleEntityNotFound(_0x129b22,null))['then'](respondWithResult(_0x129b22,null))[_0xb243('0x44')](handleError(_0x129b22,null));};exports['create']=function(_0x166e14,_0x4985a1){return db[_0xb243('0x2e')][_0xb243('0x4b')](_0x166e14[_0xb243('0x4c')],{})[_0xb243('0x23')](function(_0x2c3b24){var _0x565525=_0x166e14[_0xb243('0x4d')][_0xb243('0x25')]({'plain':!![]});if(!_0x565525)throw new Error(_0xb243('0x4e'));if(_0x565525['role']===_0xb243('0x4d')){var _0x4f3e8e=_0x2c3b24[_0xb243('0x25')]({'plain':!![]});var _0x37045b=_0xb243('0x26');return db['UserProfileSection'][_0xb243('0x4a')]({'where':{'name':_0x37045b,'userProfileId':_0x565525[_0xb243('0x4f')]},'raw':!![]})[_0xb243('0x23')](function(_0x126f0e){if(_0x126f0e&&_0x126f0e[_0xb243('0x50')]===0x0){return db[_0xb243('0x27')][_0xb243('0x4b')]({'name':_0x4f3e8e['name'],'resourceId':_0x4f3e8e['id'],'type':_0x126f0e[_0xb243('0x2a')],'sectionId':_0x126f0e['id']},{})[_0xb243('0x23')](function(){return _0x2c3b24;});}else{return _0x2c3b24;}})[_0xb243('0x44')](function(_0x4ccf14){logger[_0xb243('0x28')](_0xb243('0x51'),_0x4ccf14);throw _0x4ccf14;});}return _0x2c3b24;})[_0xb243('0x23')](respondWithResult(_0x4985a1,0xc9))[_0xb243('0x44')](handleError(_0x4985a1,null));};exports[_0xb243('0x22')]=function(_0x63f9dc,_0x59c7a7){if(_0x63f9dc[_0xb243('0x4c')]['id']){delete _0x63f9dc['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x63f9dc[_0xb243('0x46')]['id']}})['then'](handleEntityNotFound(_0x59c7a7,null))[_0xb243('0x23')](saveUpdates(_0x63f9dc['body'],null))['then'](respondWithResult(_0x59c7a7,null))['catch'](handleError(_0x59c7a7,null));};exports['destroy']=function(_0x37dd43,_0x444aaf){return db[_0xb243('0x2e')][_0xb243('0x4a')]({'where':{'id':_0x37dd43[_0xb243('0x46')]['id']}})['then'](handleEntityNotFound(_0x444aaf,null))['then'](removeEntity(_0x444aaf,null))[_0xb243('0x44')](handleError(_0x444aaf,null));};exports['addAllCondition']=function(_0x40f8de,_0x457e8d,_0x3dce10){if(_0x40f8de[_0xb243('0x4c')]['id']){delete _0x40f8de['body']['id'];}return db[_0xb243('0x2e')][_0xb243('0x4a')]({'where':{'id':_0x40f8de[_0xb243('0x46')]['id']}})[_0xb243('0x23')](handleEntityNotFound(_0x457e8d,null))[_0xb243('0x23')](function(_0x5b856d){if(_0x5b856d){_0x40f8de[_0xb243('0x4c')]['TriggerAllId']=_0x5b856d['id'];return db['Condition'][_0xb243('0x4b')](_0x40f8de[_0xb243('0x4c')]);}})[_0xb243('0x23')](respondWithResult(_0x457e8d,null))[_0xb243('0x44')](handleError(_0x457e8d,null));};exports['addAnyCondition']=function(_0x3ce5f5,_0x5de62a,_0x4ce747){if(_0x3ce5f5[_0xb243('0x4c')]['id']){delete _0x3ce5f5[_0xb243('0x4c')]['id'];}return db[_0xb243('0x2e')][_0xb243('0x4a')]({'where':{'id':_0x3ce5f5[_0xb243('0x46')]['id']}})[_0xb243('0x23')](handleEntityNotFound(_0x5de62a,null))[_0xb243('0x23')](function(_0xf53211){if(_0xf53211){_0x3ce5f5[_0xb243('0x4c')][_0xb243('0x52')]=_0xf53211['id'];return db['Condition'][_0xb243('0x4b')](_0x3ce5f5[_0xb243('0x4c')]);}})[_0xb243('0x23')](respondWithResult(_0x5de62a,null))[_0xb243('0x44')](handleError(_0x5de62a,null));};exports['getAllConditions']=function(_0x42ac37,_0x527837,_0x3ab712){var _0x4658ab={};var _0x13db89={};var _0x204140;var _0x24f50b;return db[_0xb243('0x2e')][_0xb243('0x53')]({'where':{'id':_0x42ac37[_0xb243('0x46')]['id']}})['then'](handleEntityNotFound(_0x527837,null))['then'](function(_0x246d2b){if(_0x246d2b){_0x204140=_0x246d2b;_0x13db89[_0xb243('0x32')]=_[_0xb243('0x47')](db[_0xb243('0x54')][_0xb243('0x2f')]);_0x13db89[_0xb243('0x33')]=_[_0xb243('0x47')](_0x42ac37[_0xb243('0x33')]);_0x13db89[_0xb243('0x48')]=_[_0xb243('0x34')](_0x13db89[_0xb243('0x32')],_0x13db89[_0xb243('0x33')]);_0x4658ab[_0xb243('0x35')]=_[_0xb243('0x34')](_0x13db89[_0xb243('0x32')],qs[_0xb243('0x36')](_0x42ac37[_0xb243('0x33')][_0xb243('0x36')]));_0x4658ab[_0xb243('0x35')]=_0x4658ab[_0xb243('0x35')]['length']?_0x4658ab[_0xb243('0x35')]:_0x13db89['model'];_0x4658ab[_0xb243('0x39')]=qs[_0xb243('0x3a')](_0x42ac37[_0xb243('0x33')][_0xb243('0x3a')]);_0x4658ab[_0xb243('0x3b')]=qs[_0xb243('0x48')](_[_0xb243('0x3c')](_0x42ac37[_0xb243('0x33')],_0x13db89['filters']));if(_0x42ac37['query'][_0xb243('0x3d')]){_0x4658ab[_0xb243('0x3b')]=_[_0xb243('0x3e')](_0x4658ab[_0xb243('0x3b')],{'$or':_[_0xb243('0x2d')](_0x4658ab[_0xb243('0x35')],function(_0x336436){var _0x3690aa={};_0x3690aa[_0x336436]={'$like':'%'+_0x42ac37[_0xb243('0x33')][_0xb243('0x3d')]+'%'};return _0x3690aa;})});}_0x4658ab=_['merge']({},_0x4658ab,_0x42ac37[_0xb243('0x40')]);return _0x204140['getAllConditions'](_0x4658ab);}})[_0xb243('0x23')](function(_0x34ec7c){if(_0x34ec7c){_0x24f50b=_0x34ec7c[_0xb243('0x37')];if(!_0x42ac37['query'][_0xb243('0x55')](_0xb243('0x38'))){_0x4658ab[_0xb243('0x1c')]=qs['limit'](_0x42ac37['query'][_0xb243('0x1c')]);_0x4658ab['offset']=qs['offset'](_0x42ac37[_0xb243('0x33')][_0xb243('0x1b')]);}return _0x204140['getAllConditions'](_0x4658ab);}})[_0xb243('0x23')](function(_0x55e824){if(_0x55e824){return _0x55e824?{'count':_0x24f50b,'rows':_0x55e824}:null;}})[_0xb243('0x23')](respondWithResult(_0x527837,null))[_0xb243('0x44')](handleError(_0x527837,null));};exports['getAnyConditions']=function(_0x49ff1a,_0x15f394,_0x11fb0f){var _0x726366={};var _0x23176c={};var _0x1b00be;var _0x2625a8;return db['Trigger'][_0xb243('0x53')]({'where':{'id':_0x49ff1a[_0xb243('0x46')]['id']}})[_0xb243('0x23')](handleEntityNotFound(_0x15f394,null))[_0xb243('0x23')](function(_0x1af9ce){if(_0x1af9ce){_0x1b00be=_0x1af9ce;_0x23176c[_0xb243('0x32')]=_[_0xb243('0x47')](db[_0xb243('0x54')][_0xb243('0x2f')]);_0x23176c['query']=_[_0xb243('0x47')](_0x49ff1a[_0xb243('0x33')]);_0x23176c[_0xb243('0x48')]=_['intersection'](_0x23176c[_0xb243('0x32')],_0x23176c[_0xb243('0x33')]);_0x726366['attributes']=_['intersection'](_0x23176c['model'],qs[_0xb243('0x36')](_0x49ff1a[_0xb243('0x33')][_0xb243('0x36')]));_0x726366['attributes']=_0x726366[_0xb243('0x35')][_0xb243('0x37')]?_0x726366[_0xb243('0x35')]:_0x23176c['model'];_0x726366[_0xb243('0x39')]=qs[_0xb243('0x3a')](_0x49ff1a[_0xb243('0x33')]['sort']);_0x726366[_0xb243('0x3b')]=qs[_0xb243('0x48')](_['pick'](_0x49ff1a[_0xb243('0x33')],_0x23176c[_0xb243('0x48')]));if(_0x49ff1a[_0xb243('0x33')][_0xb243('0x3d')]){_0x726366[_0xb243('0x3b')]=_[_0xb243('0x3e')](_0x726366['where'],{'$or':_['map'](_0x726366['attributes'],function(_0x184f61){var _0x26aa3a={};_0x26aa3a[_0x184f61]={'$like':'%'+_0x49ff1a['query']['filter']+'%'};return _0x26aa3a;})});}_0x726366=_[_0xb243('0x3e')]({},_0x726366,_0x49ff1a[_0xb243('0x40')]);return _0x1b00be[_0xb243('0x56')](_0x726366);}})[_0xb243('0x23')](function(_0x267c4b){if(_0x267c4b){_0x2625a8=_0x267c4b['length'];if(!_0x49ff1a[_0xb243('0x33')]['hasOwnProperty'](_0xb243('0x38'))){_0x726366['limit']=qs[_0xb243('0x1c')](_0x49ff1a[_0xb243('0x33')][_0xb243('0x1c')]);_0x726366[_0xb243('0x1b')]=qs[_0xb243('0x1b')](_0x49ff1a[_0xb243('0x33')][_0xb243('0x1b')]);}return _0x1b00be[_0xb243('0x56')](_0x726366);}})[_0xb243('0x23')](function(_0xeca770){if(_0xeca770){return _0xeca770?{'count':_0x2625a8,'rows':_0xeca770}:null;}})[_0xb243('0x23')](respondWithResult(_0x15f394,null))[_0xb243('0x44')](handleError(_0x15f394,null));};exports[_0xb243('0x57')]=function(_0x1cb418,_0x3abccc,_0x5b084d){if(_0x1cb418['body']['id']){delete _0x1cb418[_0xb243('0x4c')]['id'];}return db[_0xb243('0x2e')]['find']({'where':{'id':_0x1cb418[_0xb243('0x46')]['id']}})[_0xb243('0x23')](handleEntityNotFound(_0x3abccc,null))[_0xb243('0x23')](function(_0x1ca020){if(_0x1ca020){_0x1cb418[_0xb243('0x4c')][_0xb243('0x58')]=_0x1ca020['id'];return db[_0xb243('0x59')][_0xb243('0x4b')](_0x1cb418[_0xb243('0x4c')]);}})['then'](respondWithResult(_0x3abccc,null))[_0xb243('0x44')](handleError(_0x3abccc,null));};exports[_0xb243('0x5a')]=function(_0x3efbcd,_0x4ff491,_0x303494){var _0xb64710={};var _0x56d2a4={};var _0x4b0bf0;var _0x5943c8;return db[_0xb243('0x2e')][_0xb243('0x53')]({'where':{'id':_0x3efbcd[_0xb243('0x46')]['id']}})[_0xb243('0x23')](handleEntityNotFound(_0x4ff491,null))['then'](function(_0x2ae6d8){if(_0x2ae6d8){_0x4b0bf0=_0x2ae6d8;_0x56d2a4[_0xb243('0x32')]=_['keys'](db[_0xb243('0x59')][_0xb243('0x2f')]);_0x56d2a4[_0xb243('0x33')]=_[_0xb243('0x47')](_0x3efbcd[_0xb243('0x33')]);_0x56d2a4[_0xb243('0x48')]=_[_0xb243('0x34')](_0x56d2a4[_0xb243('0x32')],_0x56d2a4[_0xb243('0x33')]);_0xb64710[_0xb243('0x35')]=_[_0xb243('0x34')](_0x56d2a4[_0xb243('0x32')],qs[_0xb243('0x36')](_0x3efbcd['query'][_0xb243('0x36')]));_0xb64710[_0xb243('0x35')]=_0xb64710[_0xb243('0x35')][_0xb243('0x37')]?_0xb64710[_0xb243('0x35')]:_0x56d2a4[_0xb243('0x32')];_0xb64710['order']=qs[_0xb243('0x3a')](_0x3efbcd['query'][_0xb243('0x3a')]);_0xb64710['where']=qs[_0xb243('0x48')](_[_0xb243('0x3c')](_0x3efbcd['query'],_0x56d2a4[_0xb243('0x48')]));if(_0x3efbcd[_0xb243('0x33')][_0xb243('0x3d')]){_0xb64710['where']=_[_0xb243('0x3e')](_0xb64710[_0xb243('0x3b')],{'$or':_[_0xb243('0x2d')](_0xb64710[_0xb243('0x35')],function(_0x46d35d){var _0x394810={};_0x394810[_0x46d35d]={'$like':'%'+_0x3efbcd[_0xb243('0x33')][_0xb243('0x3d')]+'%'};return _0x394810;})});}_0xb64710=_[_0xb243('0x3e')]({},_0xb64710,_0x3efbcd[_0xb243('0x40')]);return _0x4b0bf0[_0xb243('0x5a')](_0xb64710);}})[_0xb243('0x23')](function(_0x351947){if(_0x351947){_0x5943c8=_0x351947[_0xb243('0x37')];if(!_0x3efbcd['query']['hasOwnProperty']('nolimit')){_0xb64710[_0xb243('0x1c')]=qs[_0xb243('0x1c')](_0x3efbcd['query'][_0xb243('0x1c')]);_0xb64710[_0xb243('0x1b')]=qs['offset'](_0x3efbcd[_0xb243('0x33')][_0xb243('0x1b')]);}return _0x4b0bf0[_0xb243('0x5a')](_0xb64710);}})[_0xb243('0x23')](function(_0x149772){if(_0x149772){return _0x149772?{'count':_0x5943c8,'rows':_0x149772}:null;}})[_0xb243('0x23')](respondWithResult(_0x4ff491,null))['catch'](handleError(_0x4ff491,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 60acd38..f67d614 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 _0x212b=['api','moment','bluebird','path','rimraf','../../config/environment','exports','Trigger','tools_triggers','lodash','../../config/logger'];(function(_0x4d0b5b,_0xf881c4){var _0x521856=function(_0x2e5d01){while(--_0x2e5d01){_0x4d0b5b['push'](_0x4d0b5b['shift']());}};_0x521856(++_0xf881c4);}(_0x212b,0x148));var _0xb212=function(_0x1ce00b,_0x403eb3){_0x1ce00b=_0x1ce00b-0x0;var _0x522990=_0x212b[_0x1ce00b];return _0x522990;};'use strict';var _=require(_0xb212('0x0'));var util=require('util');var logger=require(_0xb212('0x1'))(_0xb212('0x2'));var moment=require(_0xb212('0x3'));var BPromise=require(_0xb212('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb212('0x5'));var rimraf=require(_0xb212('0x6'));var config=require(_0xb212('0x7'));var attributes=require('./trigger.attributes');module[_0xb212('0x8')]=function(_0x49a13c,_0x21825a){return _0x49a13c['define'](_0xb212('0x9'),attributes,{'tableName':_0xb212('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b6d=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x46bccd,_0x240cc0){var _0x1651d6=function(_0x33d233){while(--_0x33d233){_0x46bccd['push'](_0x46bccd['shift']());}};_0x1651d6(++_0x240cc0);}(_0x9b6d,0x105));var _0xd9b6=function(_0x5ab5d2,_0x42e6d2){_0x5ab5d2=_0x5ab5d2-0x0;var _0x210194=_0x9b6d[_0x5ab5d2];return _0x210194;};'use strict';var _=require('lodash');var util=require(_0xd9b6('0x0'));var logger=require(_0xd9b6('0x1'))(_0xd9b6('0x2'));var moment=require(_0xd9b6('0x3'));var BPromise=require(_0xd9b6('0x4'));var rp=require(_0xd9b6('0x5'));var fs=require('fs');var path=require(_0xd9b6('0x6'));var rimraf=require(_0xd9b6('0x7'));var config=require(_0xd9b6('0x8'));var attributes=require(_0xd9b6('0x9'));module[_0xd9b6('0xa')]=function(_0x5724e3,_0x2d38ce){return _0x5724e3[_0xd9b6('0xb')](_0xd9b6('0xc'),attributes,{'tableName':_0xd9b6('0xd'),'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 9a11036..0808250 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 _0x2269=['model','then','GetTrigger','Trigger','find','map','debug','ShowTrigger','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','where','attributes','include'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x2269,0x18a));var _0x9226=function(_0x124b1a,_0x1e68af){_0x124b1a=_0x124b1a-0x0;var _0x1d67fe=_0x2269[_0x124b1a];return _0x1d67fe;};'use strict';var _=require(_0x9226('0x0'));var util=require(_0x9226('0x1'));var moment=require(_0x9226('0x2'));var BPromise=require(_0x9226('0x3'));var rs=require(_0x9226('0x4'));var fs=require('fs');var Redis=require(_0x9226('0x5'));var db=require(_0x9226('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9226('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9226('0x8'));var client=jayson[_0x9226('0x9')][_0x9226('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x112e29,_0x1a92cf,_0x34d995){return new BPromise(function(_0x2755b2,_0x49a904){return client[_0x9226('0xb')](_0x112e29,_0x34d995)['then'](function(_0x49e717){logger[_0x9226('0xc')](_0x9226('0xd'),_0x1a92cf,_0x9226('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x1a92cf,'request\x20sent',JSON[_0x9226('0xf')](_0x49e717));if(_0x49e717[_0x9226('0x10')]){if(_0x49e717[_0x9226('0x10')][_0x9226('0x11')]===0x1f4){logger[_0x9226('0x10')]('Trigger,\x20%s,\x20%s',_0x1a92cf,_0x49e717[_0x9226('0x10')][_0x9226('0x12')]);return _0x49a904(_0x49e717[_0x9226('0x10')][_0x9226('0x12')]);}logger[_0x9226('0x10')](_0x9226('0xd'),_0x1a92cf,_0x49e717[_0x9226('0x10')][_0x9226('0x12')]);return _0x2755b2(_0x49e717[_0x9226('0x10')][_0x9226('0x12')]);}else{logger[_0x9226('0xc')](_0x9226('0xd'),_0x1a92cf,_0x9226('0xe'));_0x2755b2(_0x49e717[_0x9226('0x13')]['message']);}})['catch'](function(_0xbec2d9){logger[_0x9226('0x10')](_0x9226('0xd'),_0x1a92cf,_0xbec2d9);_0x49a904(_0xbec2d9);});});}exports['GetTrigger']=function(_0x5b402f){var _0x380141=this;return new Promise(function(_0x4c9cb4,_0x4632e9){return db['Trigger'][_0x9226('0x14')]({'raw':_0x5b402f['options']?_0x5b402f[_0x9226('0x15')][_0x9226('0x16')]===undefined?!![]:![]:!![],'where':_0x5b402f[_0x9226('0x15')]?_0x5b402f[_0x9226('0x15')][_0x9226('0x17')]||null:null,'attributes':_0x5b402f['options']?_0x5b402f[_0x9226('0x15')][_0x9226('0x18')]||null:null,'limit':_0x5b402f[_0x9226('0x15')]?_0x5b402f[_0x9226('0x15')]['limit']||null:null,'include':_0x5b402f[_0x9226('0x15')]?_0x5b402f[_0x9226('0x15')][_0x9226('0x19')]?_['map'](_0x5b402f[_0x9226('0x15')]['include'],function(_0x4ce2c0){return{'model':db[_0x4ce2c0[_0x9226('0x1a')]],'as':_0x4ce2c0['as'],'attributes':_0x4ce2c0[_0x9226('0x18')],'include':_0x4ce2c0['include']?_['map'](_0x4ce2c0[_0x9226('0x19')],function(_0x48657d){return{'model':db[_0x48657d[_0x9226('0x1a')]],'as':_0x48657d['as'],'attributes':_0x48657d[_0x9226('0x18')],'include':_0x48657d['include']?_['map'](_0x48657d[_0x9226('0x19')],function(_0x42c61f){return{'model':db[_0x42c61f['model']],'as':_0x42c61f['as'],'attributes':_0x42c61f[_0x9226('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9226('0x1b')](function(_0x25c50d){logger[_0x9226('0xc')](_0x9226('0x1c'),_0x5b402f);logger['debug'](_0x9226('0x1c'),_0x5b402f,JSON['stringify'](_0x25c50d));_0x4c9cb4(_0x25c50d);})['catch'](function(_0x1838fb){logger[_0x9226('0x10')](_0x9226('0x1c'),_0x1838fb['message'],_0x5b402f);_0x4632e9(_0x380141['error'](0x1f4,_0x1838fb[_0x9226('0x12')]));});});};exports['ShowTrigger']=function(_0x5f3f38){var _0x463696=this;return new Promise(function(_0x1b47ee,_0x28e6b3){return db[_0x9226('0x1d')][_0x9226('0x1e')]({'raw':_0x5f3f38[_0x9226('0x15')]?_0x5f3f38['options'][_0x9226('0x16')]===undefined?!![]:![]:!![],'where':_0x5f3f38[_0x9226('0x15')]?_0x5f3f38[_0x9226('0x15')][_0x9226('0x17')]||null:null,'attributes':_0x5f3f38[_0x9226('0x15')]?_0x5f3f38[_0x9226('0x15')][_0x9226('0x18')]||null:null,'include':_0x5f3f38[_0x9226('0x15')]?_0x5f3f38[_0x9226('0x15')][_0x9226('0x19')]?_['map'](_0x5f3f38[_0x9226('0x15')][_0x9226('0x19')],function(_0x1ad763){return{'model':db[_0x1ad763['model']],'as':_0x1ad763['as'],'attributes':_0x1ad763[_0x9226('0x18')],'include':_0x1ad763[_0x9226('0x19')]?_[_0x9226('0x1f')](_0x1ad763['include'],function(_0x4c3f6c){return{'model':db[_0x4c3f6c['model']],'as':_0x4c3f6c['as'],'attributes':_0x4c3f6c[_0x9226('0x18')],'include':_0x4c3f6c[_0x9226('0x19')]?_[_0x9226('0x1f')](_0x4c3f6c[_0x9226('0x19')],function(_0x2b7dca){return{'model':db[_0x2b7dca['model']],'as':_0x2b7dca['as'],'attributes':_0x2b7dca[_0x9226('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9226('0x1b')](function(_0x25aab0){logger['info']('ShowTrigger',_0x5f3f38);logger[_0x9226('0x20')](_0x9226('0x21'),_0x5f3f38,JSON['stringify'](_0x25aab0));_0x1b47ee(_0x25aab0);})[_0x9226('0x22')](function(_0x38ef75){logger[_0x9226('0x10')](_0x9226('0x21'),_0x38ef75[_0x9226('0x12')],_0x5f3f38);_0x28e6b3(_0x463696['error'](0x1f4,_0x38ef75[_0x9226('0x12')]));});});}; \ No newline at end of file +var _0xa785=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','find','then','ShowTrigger','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0xa785,0x18c));var _0x5a78=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xa785[_0x3bf925];return _0x2128a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a78('0x0'));var BPromise=require(_0x5a78('0x1'));var rs=require(_0x5a78('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a78('0x3'))['db'];var utils=require(_0x5a78('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a78('0x5'));var jayson=require(_0x5a78('0x6'));var client=jayson[_0x5a78('0x7')][_0x5a78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x515e26,_0x252964,_0x2932e1){return new BPromise(function(_0x49da73,_0x2806d0){return client[_0x5a78('0x9')](_0x515e26,_0x2932e1)['then'](function(_0x7a654){logger[_0x5a78('0xa')](_0x5a78('0xb'),_0x252964,_0x5a78('0xc'));logger[_0x5a78('0xd')](_0x5a78('0xe'),_0x252964,_0x5a78('0xc'),JSON[_0x5a78('0xf')](_0x7a654));if(_0x7a654[_0x5a78('0x10')]){if(_0x7a654[_0x5a78('0x10')]['code']===0x1f4){logger['error'](_0x5a78('0xb'),_0x252964,_0x7a654['error'][_0x5a78('0x11')]);return _0x2806d0(_0x7a654[_0x5a78('0x10')][_0x5a78('0x11')]);}logger[_0x5a78('0x10')](_0x5a78('0xb'),_0x252964,_0x7a654['error'][_0x5a78('0x11')]);return _0x49da73(_0x7a654[_0x5a78('0x10')][_0x5a78('0x11')]);}else{logger[_0x5a78('0xa')](_0x5a78('0xb'),_0x252964,_0x5a78('0xc'));_0x49da73(_0x7a654[_0x5a78('0x12')][_0x5a78('0x11')]);}})[_0x5a78('0x13')](function(_0x30a65f){logger[_0x5a78('0x10')](_0x5a78('0xb'),_0x252964,_0x30a65f);_0x2806d0(_0x30a65f);});});}exports[_0x5a78('0x14')]=function(_0x3055c){var _0x1f13fd=this;return new Promise(function(_0x344f0d,_0x3567df){return db[_0x5a78('0x15')][_0x5a78('0x16')]({'raw':_0x3055c[_0x5a78('0x17')]?_0x3055c[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![],'where':_0x3055c[_0x5a78('0x17')]?_0x3055c[_0x5a78('0x17')][_0x5a78('0x19')]||null:null,'attributes':_0x3055c['options']?_0x3055c['options'][_0x5a78('0x1a')]||null:null,'limit':_0x3055c[_0x5a78('0x17')]?_0x3055c[_0x5a78('0x17')][_0x5a78('0x1b')]||null:null,'include':_0x3055c[_0x5a78('0x17')]?_0x3055c[_0x5a78('0x17')][_0x5a78('0x1c')]?_['map'](_0x3055c[_0x5a78('0x17')]['include'],function(_0xb77971){return{'model':db[_0xb77971[_0x5a78('0x1d')]],'as':_0xb77971['as'],'attributes':_0xb77971[_0x5a78('0x1a')],'include':_0xb77971[_0x5a78('0x1c')]?_[_0x5a78('0x1e')](_0xb77971['include'],function(_0x2d5c67){return{'model':db[_0x2d5c67['model']],'as':_0x2d5c67['as'],'attributes':_0x2d5c67[_0x5a78('0x1a')],'include':_0x2d5c67[_0x5a78('0x1c')]?_[_0x5a78('0x1e')](_0x2d5c67[_0x5a78('0x1c')],function(_0x3cc0aa){return{'model':db[_0x3cc0aa[_0x5a78('0x1d')]],'as':_0x3cc0aa['as'],'attributes':_0x3cc0aa[_0x5a78('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x440197){logger['info'](_0x5a78('0x14'),_0x3055c);logger[_0x5a78('0xd')]('GetTrigger',_0x3055c,JSON['stringify'](_0x440197));_0x344f0d(_0x440197);})[_0x5a78('0x13')](function(_0x2269e4){logger['error'](_0x5a78('0x14'),_0x2269e4[_0x5a78('0x11')],_0x3055c);_0x3567df(_0x1f13fd['error'](0x1f4,_0x2269e4[_0x5a78('0x11')]));});});};exports['ShowTrigger']=function(_0x2c5e84){var _0x4568ed=this;return new Promise(function(_0x16f69a,_0x43d6e6){return db[_0x5a78('0x15')][_0x5a78('0x1f')]({'raw':_0x2c5e84[_0x5a78('0x17')]?_0x2c5e84[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![],'where':_0x2c5e84[_0x5a78('0x17')]?_0x2c5e84['options'][_0x5a78('0x19')]||null:null,'attributes':_0x2c5e84[_0x5a78('0x17')]?_0x2c5e84[_0x5a78('0x17')]['attributes']||null:null,'include':_0x2c5e84[_0x5a78('0x17')]?_0x2c5e84[_0x5a78('0x17')][_0x5a78('0x1c')]?_['map'](_0x2c5e84[_0x5a78('0x17')]['include'],function(_0x4c65a7){return{'model':db[_0x4c65a7[_0x5a78('0x1d')]],'as':_0x4c65a7['as'],'attributes':_0x4c65a7[_0x5a78('0x1a')],'include':_0x4c65a7[_0x5a78('0x1c')]?_[_0x5a78('0x1e')](_0x4c65a7[_0x5a78('0x1c')],function(_0x2ea4b7){return{'model':db[_0x2ea4b7[_0x5a78('0x1d')]],'as':_0x2ea4b7['as'],'attributes':_0x2ea4b7[_0x5a78('0x1a')],'include':_0x2ea4b7[_0x5a78('0x1c')]?_[_0x5a78('0x1e')](_0x2ea4b7['include'],function(_0xb8ebd){return{'model':db[_0xb8ebd[_0x5a78('0x1d')]],'as':_0xb8ebd['as'],'attributes':_0xb8ebd[_0x5a78('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5a78('0x20')](function(_0x52f82d){logger[_0x5a78('0xa')](_0x5a78('0x21'),_0x2c5e84);logger['debug'](_0x5a78('0x21'),_0x2c5e84,JSON['stringify'](_0x52f82d));_0x16f69a(_0x52f82d);})['catch'](function(_0x1b2ad2){logger[_0x5a78('0x10')](_0x5a78('0x21'),_0x1b2ad2[_0x5a78('0x11')],_0x2c5e84);_0x43d6e6(_0x4568ed[_0x5a78('0x10')](0x1f4,_0x1b2ad2['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index a26e0d4..fe34eda 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 _0xb177=['Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','update','destroy','exports','util','path','connect-timeout'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0xb177,0x1b7));var _0x7b17=function(_0x39bfdf,_0x3c5551){_0x39bfdf=_0x39bfdf-0x0;var _0x49b1ca=_0xb177[_0x39bfdf];return _0x49b1ca;};'use strict';var multer=require('multer');var util=require(_0x7b17('0x0'));var path=require(_0x7b17('0x1'));var timeout=require(_0x7b17('0x2'));var express=require('express');var router=express[_0x7b17('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7b17('0x4'));var interaction=require(_0x7b17('0x5'));var config=require('../../config/environment');var controller=require(_0x7b17('0x6'));router[_0x7b17('0x7')]('/',auth[_0x7b17('0x8')](),controller[_0x7b17('0x9')]);router['get'](_0x7b17('0xa'),auth[_0x7b17('0x8')](),controller['show']);router[_0x7b17('0xb')](_0x7b17('0xc'),auth[_0x7b17('0x8')](),controller[_0x7b17('0xd')]);router[_0x7b17('0xb')]('/',auth[_0x7b17('0x8')](),controller['create']);router['put']('/:id',auth[_0x7b17('0x8')](),controller[_0x7b17('0xe')]);router['delete'](_0x7b17('0xa'),auth[_0x7b17('0x8')](),controller[_0x7b17('0xf')]);module[_0x7b17('0x10')]=router; \ No newline at end of file +var _0x78e5=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','put','delete','destroy','exports','multer'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x78e5,0x17b));var _0x578e=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x78e5[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x578e('0x0'));var util=require(_0x578e('0x1'));var path=require(_0x578e('0x2'));var timeout=require('connect-timeout');var express=require(_0x578e('0x3'));var router=express[_0x578e('0x4')]();var fs_extra=require(_0x578e('0x5'));var auth=require(_0x578e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x578e('0x7'));var controller=require(_0x578e('0x8'));router[_0x578e('0x9')]('/',auth['isAuthenticated'](),controller[_0x578e('0xa')]);router[_0x578e('0x9')](_0x578e('0xb'),auth[_0x578e('0xc')](),controller[_0x578e('0xd')]);router[_0x578e('0xe')](_0x578e('0xf'),auth[_0x578e('0xc')](),controller['clone']);router['post']('/',auth[_0x578e('0xc')](),controller['create']);router[_0x578e('0x10')](_0x578e('0xb'),auth[_0x578e('0xc')](),controller['update']);router[_0x578e('0x11')](_0x578e('0xb'),auth[_0x578e('0xc')](),controller[_0x578e('0x12')]);module[_0x578e('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 47723e6..2e88703 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 _0x83c7=['update','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x83c7,0xd3));var _0x783c=function(_0x3c6b70,_0x197be0){_0x3c6b70=_0x3c6b70-0x0;var _0x207ac2=_0x83c7[_0x3c6b70];return _0x207ac2;};'use strict';var Sequelize=require('sequelize');module[_0x783c('0x0')]={'name':{'type':Sequelize[_0x783c('0x1')],'allowNull':![],'unique':_0x783c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x783c('0x3')]('friend',_0x783c('0x4'),_0x783c('0x5')),'allowNull':![],'defaultValue':_0x783c('0x6')},'context':{'type':Sequelize[_0x783c('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x7'),'ALLOWED_PASSED_SCREEN',_0x783c('0x8'),_0x783c('0x9'),'PROHIB_NOT_SCREENED',_0x783c('0xa'),'PROHIB_FAILED_SCREEN',_0x783c('0xb'))},'deny':{'type':Sequelize[_0x783c('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x783c('0x1')]},'md5secret':{'type':Sequelize[_0x783c('0x1')]},'remotesecret':{'type':Sequelize[_0x783c('0x1')]},'transport':{'type':Sequelize[_0x783c('0x1')],'defaultValue':_0x783c('0xc'),'set':function(_0x5ed541){this[_0x783c('0xd')](_0x783c('0xe'),_0x5ed541?_0x5ed541[_0x783c('0xf')](','):null);},'get':function(){return this[_0x783c('0x10')](_0x783c('0xe'))?this[_0x783c('0x10')](_0x783c('0xe'))[_0x783c('0x11')](','):null;},'comment':_0x783c('0x12')},'dtmfmode':{'type':Sequelize[_0x783c('0x3')]('rfc2833','info',_0x783c('0x13'),'inband','auto'),'defaultValue':_0x783c('0x14')},'directmedia':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no',_0x783c('0x16'),'update',_0x783c('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x783c('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x783c('0x1')],'defaultValue':_0x783c('0x18'),'set':function(_0x514d9d){this[_0x783c('0xd')]('nat',_0x514d9d?_0x514d9d[_0x783c('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x783c('0x19'))?this[_0x783c('0x10')](_0x783c('0x19'))['split'](','):null;},'comment':_0x783c('0x1a')},'callgroup':{'type':Sequelize[_0x783c('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x783c('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x783c('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x783c('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x783c('0x1c'),'set':function(_0x5ee83f){this[_0x783c('0xd')]('allow',_0x5ee83f?_0x5ee83f[_0x783c('0xf')](';'):_0x783c('0x1c'));},'get':function(){return this[_0x783c('0x10')](_0x783c('0x1d'))?this[_0x783c('0x10')](_0x783c('0x1d'))[_0x783c('0x11')](';'):null;},'comment':_0x783c('0x1e')},'autoframing':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x783c('0x1f'),'set':function(_0x190468){this[_0x783c('0xd')]('insecure',_0x190468?_0x190468['join'](','):null);},'get':function(){return this[_0x783c('0x10')](_0x783c('0x20'))?this[_0x783c('0x10')](_0x783c('0x20'))[_0x783c('0x11')](','):null;},'comment':_0x783c('0x21')},'trustrpid':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x783c('0x15'),'no',_0x783c('0x22'))},'promiscredir':{'type':Sequelize[_0x783c('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'accountcode':{'type':Sequelize[_0x783c('0x23')](0xb)},'setvar':{'type':Sequelize[_0x783c('0x1')]},'callerid':{'type':Sequelize[_0x783c('0x1')],'defaultValue':_0x783c('0x24')},'amaflags':{'type':Sequelize[_0x783c('0x1')]},'callcounter':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':_0x783c('0x15')},'busylevel':{'type':Sequelize[_0x783c('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x783c('0x1')]},'template':{'type':Sequelize[_0x783c('0x1')]},'videosupport':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no',_0x783c('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x783c('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x783c('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x783c('0x1')]},'session_timers':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x26'),_0x783c('0x27'),_0x783c('0x28'))},'session_expires':{'type':Sequelize[_0x783c('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x783c('0x29'),_0x783c('0x2a')),'defaultValue':_0x783c('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x783c('0x1')]},'fromdomain':{'type':Sequelize[_0x783c('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x783c('0x23')](0x5)},'qualify':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':_0x783c('0x15')},'keepalive':{'type':Sequelize[_0x783c('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x783c('0x1')]},'defaultuser':{'type':Sequelize[_0x783c('0x1')]},'rtptimeout':{'type':Sequelize[_0x783c('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x783c('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no',_0x783c('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x783c('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x783c('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x783c('0x1')]},'contactdeny':{'type':Sequelize[_0x783c('0x1')]},'contactacl':{'type':Sequelize[_0x783c('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x783c('0x1')]},'maxforwards':{'type':Sequelize[_0x783c('0x23')](0xb)},'encryption':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'force_avp':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'icesupport':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x783c('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no',_0x783c('0x2c'),_0x783c('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x783c('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x783c('0x1')]},'dtlscipher':{'type':Sequelize[_0x783c('0x1')]},'dtlscafile':{'type':Sequelize[_0x783c('0x1')]},'dtlscapath':{'type':Sequelize[_0x783c('0x1')]},'dtlssetup':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x2e'),'passive',_0x783c('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x783c('0x1')]},'usereqphone':{'type':Sequelize[_0x783c('0x3')](_0x783c('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x783c('0x1')]},'recordofffeature':{'type':Sequelize[_0x783c('0x1')]},'call_limit':{'type':Sequelize[_0x783c('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x783c('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x783c('0x1')]},'mohinterpret':{'type':Sequelize[_0x783c('0x1')]},'mohsuggest':{'type':Sequelize[_0x783c('0x1')]},'parkinglot':{'type':Sequelize[_0x783c('0x1')]},'description':{'type':Sequelize[_0x783c('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x783c('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0x783c('0x15'),'no','nonat',_0x783c('0x31'),_0x783c('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x783c('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x783c('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xb458=['certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','originate','uac','uas','pai'];(function(_0x1fa18f,_0x33faf1){var _0x2d8713=function(_0x26e97a){while(--_0x26e97a){_0x1fa18f['push'](_0x1fa18f['shift']());}};_0x2d8713(++_0x33faf1);}(_0xb458,0x1a6));var _0x8b45=function(_0x4bc0e6,_0x1fcd91){_0x4bc0e6=_0x4bc0e6-0x0;var _0x3257de=_0xb458[_0x4bc0e6];return _0x3257de;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'allowNull':![],'unique':_0x8b45('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8b45('0x4')]('friend',_0x8b45('0x5'),_0x8b45('0x6')),'allowNull':![],'defaultValue':_0x8b45('0x7')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8b45('0x8')},'callingpres':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x9'),_0x8b45('0xa'),_0x8b45('0xb'),_0x8b45('0xc'),_0x8b45('0xd'),'PROHIB_PASSED_SCREEN',_0x8b45('0xe'),_0x8b45('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x8b45('0x2')]},'secret':{'type':Sequelize[_0x8b45('0x2')]},'md5secret':{'type':Sequelize[_0x8b45('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':_0x8b45('0x10'),'set':function(_0x2cb0de){this[_0x8b45('0x11')](_0x8b45('0x12'),_0x2cb0de?_0x2cb0de[_0x8b45('0x13')](','):null);},'get':function(){return this[_0x8b45('0x14')]('transport')?this[_0x8b45('0x14')](_0x8b45('0x12'))[_0x8b45('0x15')](','):null;},'comment':_0x8b45('0x16')},'dtmfmode':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x17'),_0x8b45('0x18'),_0x8b45('0x19'),_0x8b45('0x1a'),'auto'),'defaultValue':_0x8b45('0x17')},'directmedia':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no',_0x8b45('0x1c'),_0x8b45('0x1d'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8b45('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8b45('0x2')]},'directmediadeny':{'type':Sequelize[_0x8b45('0x2')]},'nat':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x4a2d50){this[_0x8b45('0x11')](_0x8b45('0x1e'),_0x4a2d50?_0x4a2d50['join'](','):null);},'get':function(){return this['getDataValue'](_0x8b45('0x1e'))?this[_0x8b45('0x14')](_0x8b45('0x1e'))[_0x8b45('0x15')](','):null;},'comment':_0x8b45('0x1f')},'callgroup':{'type':Sequelize[_0x8b45('0x2')]},'namedcallgroup':{'type':Sequelize[_0x8b45('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x8b45('0x2')]},'language':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8b45('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':_0x8b45('0x20')},'allow':{'type':Sequelize[_0x8b45('0x2')],'allowNull':![],'defaultValue':_0x8b45('0x21'),'set':function(_0xd53b78){this[_0x8b45('0x11')](_0x8b45('0x22'),_0xd53b78?_0xd53b78['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8b45('0x14')](_0x8b45('0x22'))?this['getDataValue'](_0x8b45('0x22'))[_0x8b45('0x15')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x8b45('0x23'),'set':function(_0x13d6dc){this[_0x8b45('0x11')](_0x8b45('0x24'),_0x13d6dc?_0x13d6dc[_0x8b45('0x13')](','):null);},'get':function(){return this['getDataValue'](_0x8b45('0x24'))?this[_0x8b45('0x14')](_0x8b45('0x24'))[_0x8b45('0x15')](','):null;},'comment':_0x8b45('0x25')},'trustrpid':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no',_0x8b45('0x26'))},'promiscredir':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x8b45('0x27')](0xb)},'setvar':{'type':Sequelize[_0x8b45('0x2')]},'callerid':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':_0x8b45('0x28')},'amaflags':{'type':Sequelize[_0x8b45('0x2')]},'callcounter':{'type':Sequelize[_0x8b45('0x4')]('yes','no'),'defaultValue':_0x8b45('0x1b')},'busylevel':{'type':Sequelize[_0x8b45('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x8b45('0x2')]},'videosupport':{'type':Sequelize[_0x8b45('0x4')]('yes','no',_0x8b45('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8b45('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x8b45('0x4')]('accept','refuse',_0x8b45('0x2a'))},'session_expires':{'type':Sequelize[_0x8b45('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x8b45('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x8b45('0x2b'),_0x8b45('0x2c')),'defaultValue':_0x8b45('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x8b45('0x2')]},'regexten':{'type':Sequelize[_0x8b45('0x2')]},'fromdomain':{'type':Sequelize[_0x8b45('0x2')]},'fromuser':{'type':Sequelize[_0x8b45('0x2')]},'port':{'type':Sequelize[_0x8b45('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no'),'defaultValue':_0x8b45('0x1b')},'keepalive':{'type':Sequelize[_0x8b45('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x8b45('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8b45('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x8b45('0x4')]('yes','no',_0x8b45('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x8b45('0x2')]},'timert1':{'type':Sequelize[_0x8b45('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x8b45('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x8b45('0x2')]},'contactdeny':{'type':Sequelize[_0x8b45('0x2')]},'contactacl':{'type':Sequelize[_0x8b45('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x8b45('0x2')]},'use_q850_reason':{'type':Sequelize[_0x8b45('0x2')]},'maxforwards':{'type':Sequelize[_0x8b45('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no','fingerprint',_0x8b45('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x8b45('0x27')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x8b45('0x2')]},'dtlscipher':{'type':Sequelize[_0x8b45('0x2')]},'dtlscafile':{'type':Sequelize[_0x8b45('0x2')]},'dtlscapath':{'type':Sequelize[_0x8b45('0x2')]},'dtlssetup':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x2f'),_0x8b45('0x30'),_0x8b45('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8b45('0x2')]},'usereqphone':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x8b45('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x8b45('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x8b45('0x2')]},'mohinterpret':{'type':Sequelize[_0x8b45('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b45('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x8b45('0x32')},'canreinvite':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x1b'),'no',_0x8b45('0x1c'),_0x8b45('0x1d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8b45('0x2')]},'otherFields':{'type':Sequelize[_0x8b45('0x2')]},'active':{'type':Sequelize[_0x8b45('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8b45('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 05a08b6..8181b68 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 _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x19a654,_0x35d610){var _0x72d657=function(_0x3239e8){while(--_0x3239e8){_0x19a654['push'](_0x19a654['shift']());}};_0x72d657(++_0x35d610);}(_0x425d,0x1e0));var _0xd425=function(_0x251f7d,_0x50ac61){_0x251f7d=_0x251f7d-0x0;var _0x57160d=_0x425d[_0x251f7d];return _0x57160d;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x5d33e6,_0x21db63){var _0x13a51b=function(_0x5e490f){while(--_0x5e490f){_0x5d33e6['push'](_0x5d33e6['shift']());}};_0x13a51b(++_0x21db63);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4498b0,_0x24750c){_0x4498b0=_0x4498b0-0x0;var _0x4d5d58=_0xd6d6[_0x4498b0];return _0x4d5d58;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 32f69bf..40580d6 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 _0xff7d=['request-promise','path','./trunk.attributes','exports','define','Trunk','tools_trunks','util','moment'];(function(_0x36e275,_0x48cd3a){var _0x537f96=function(_0x52648f){while(--_0x52648f){_0x36e275['push'](_0x36e275['shift']());}};_0x537f96(++_0x48cd3a);}(_0xff7d,0x1ae));var _0xdff7=function(_0x54c9d9,_0x2943f4){_0x54c9d9=_0x54c9d9-0x0;var _0x3af162=_0xff7d[_0x54c9d9];return _0x3af162;};'use strict';var _=require('lodash');var util=require(_0xdff7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdff7('0x1'));var BPromise=require('bluebird');var rp=require(_0xdff7('0x2'));var fs=require('fs');var path=require(_0xdff7('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdff7('0x4'));module[_0xdff7('0x5')]=function(_0x14fe2f,_0x32818a){return _0x14fe2f[_0xdff7('0x6')](_0xdff7('0x7'),attributes,{'tableName':_0xdff7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b00=['tools_trunks','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','define'];(function(_0x1c82d4,_0xc329b5){var _0x22ae29=function(_0x2aa74f){while(--_0x2aa74f){_0x1c82d4['push'](_0x1c82d4['shift']());}};_0x22ae29(++_0xc329b5);}(_0x2b00,0x1da));var _0x02b0=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x2b00[_0x25701b];return _0x3a8a2c;};'use strict';var _=require(_0x02b0('0x0'));var util=require(_0x02b0('0x1'));var logger=require(_0x02b0('0x2'))('api');var moment=require(_0x02b0('0x3'));var BPromise=require(_0x02b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02b0('0x5'));var rimraf=require(_0x02b0('0x6'));var config=require(_0x02b0('0x7'));var attributes=require(_0x02b0('0x8'));module['exports']=function(_0x543ad7,_0x297696){return _0x543ad7[_0x02b0('0x9')]('Trunk',attributes,{'tableName':_0x02b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 577027c..5a7de4e 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 _0x104b=['rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','ShowTrunk','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf42142,_0x448cd8){var _0x195537=function(_0x5d3598){while(--_0x5d3598){_0xf42142['push'](_0xf42142['shift']());}};_0x195537(++_0x448cd8);}(_0x104b,0xb1));var _0xb104=function(_0x577979,_0x266c4b){_0x577979=_0x577979-0x0;var _0x486b09=_0x104b[_0x577979];return _0x486b09;};'use strict';var _=require(_0xb104('0x0'));var util=require('util');var moment=require(_0xb104('0x1'));var BPromise=require(_0xb104('0x2'));var rs=require(_0xb104('0x3'));var fs=require('fs');var Redis=require(_0xb104('0x4'));var db=require(_0xb104('0x5'))['db'];var utils=require(_0xb104('0x6'));var logger=require(_0xb104('0x7'))(_0xb104('0x8'));var config=require(_0xb104('0x9'));var jayson=require(_0xb104('0xa'));var client=jayson[_0xb104('0xb')][_0xb104('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14053e,_0x63bc87,_0x470a02){return new BPromise(function(_0x346591,_0x48b81a){return client['request'](_0x14053e,_0x470a02)[_0xb104('0xd')](function(_0x3c7941){logger[_0xb104('0xe')](_0xb104('0xf'),_0x63bc87,'request\x20sent');logger[_0xb104('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x63bc87,'request\x20sent',JSON['stringify'](_0x3c7941));if(_0x3c7941[_0xb104('0x11')]){if(_0x3c7941[_0xb104('0x11')][_0xb104('0x12')]===0x1f4){logger[_0xb104('0x11')](_0xb104('0xf'),_0x63bc87,_0x3c7941[_0xb104('0x11')][_0xb104('0x13')]);return _0x48b81a(_0x3c7941[_0xb104('0x11')][_0xb104('0x13')]);}logger[_0xb104('0x11')](_0xb104('0xf'),_0x63bc87,_0x3c7941['error'][_0xb104('0x13')]);return _0x346591(_0x3c7941['error']['message']);}else{logger[_0xb104('0xe')](_0xb104('0xf'),_0x63bc87,_0xb104('0x14'));_0x346591(_0x3c7941[_0xb104('0x15')][_0xb104('0x13')]);}})['catch'](function(_0x5302ae){logger[_0xb104('0x11')](_0xb104('0xf'),_0x63bc87,_0x5302ae);_0x48b81a(_0x5302ae);});});}exports[_0xb104('0x16')]=function(_0x59174b){var _0x6d1eff=this;return new Promise(function(_0x55a72d,_0x4512e4){return db[_0xb104('0x17')][_0xb104('0x18')]({'raw':_0x59174b[_0xb104('0x19')]?_0x59174b[_0xb104('0x19')][_0xb104('0x1a')]===undefined?!![]:![]:!![],'where':_0x59174b[_0xb104('0x19')]?_0x59174b['options'][_0xb104('0x1b')]||null:null,'attributes':_0x59174b[_0xb104('0x19')]?_0x59174b['options']['attributes']||null:null,'limit':_0x59174b['options']?_0x59174b[_0xb104('0x19')][_0xb104('0x1c')]||null:null,'include':_0x59174b[_0xb104('0x19')]?_0x59174b[_0xb104('0x19')][_0xb104('0x1d')]?_[_0xb104('0x1e')](_0x59174b['options']['include'],function(_0x334f8d){return{'model':db[_0x334f8d[_0xb104('0x1f')]],'as':_0x334f8d['as'],'attributes':_0x334f8d[_0xb104('0x20')],'include':_0x334f8d[_0xb104('0x1d')]?_[_0xb104('0x1e')](_0x334f8d[_0xb104('0x1d')],function(_0x30732a){return{'model':db[_0x30732a[_0xb104('0x1f')]],'as':_0x30732a['as'],'attributes':_0x30732a[_0xb104('0x20')],'include':_0x30732a[_0xb104('0x1d')]?_[_0xb104('0x1e')](_0x30732a[_0xb104('0x1d')],function(_0x5e39e5){return{'model':db[_0x5e39e5[_0xb104('0x1f')]],'as':_0x5e39e5['as'],'attributes':_0x5e39e5[_0xb104('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb104('0xd')](function(_0x374ccf){logger[_0xb104('0xe')](_0xb104('0x16'),_0x59174b);logger[_0xb104('0x10')](_0xb104('0x16'),_0x59174b,JSON[_0xb104('0x21')](_0x374ccf));_0x55a72d(_0x374ccf);})[_0xb104('0x22')](function(_0x3abd58){logger['error'](_0xb104('0x16'),_0x3abd58['message'],_0x59174b);_0x4512e4(_0x6d1eff[_0xb104('0x11')](0x1f4,_0x3abd58['message']));});});};exports[_0xb104('0x23')]=function(_0x60f17e){var _0x413889=this;return new Promise(function(_0x289c9f,_0x1a80fa){return db[_0xb104('0x17')][_0xb104('0x24')]({'raw':_0x60f17e['options']?_0x60f17e[_0xb104('0x19')][_0xb104('0x1a')]===undefined?!![]:![]:!![],'where':_0x60f17e[_0xb104('0x19')]?_0x60f17e[_0xb104('0x19')][_0xb104('0x1b')]||null:null,'attributes':_0x60f17e['options']?_0x60f17e[_0xb104('0x19')][_0xb104('0x20')]||null:null,'include':_0x60f17e[_0xb104('0x19')]?_0x60f17e[_0xb104('0x19')]['include']?_[_0xb104('0x1e')](_0x60f17e[_0xb104('0x19')][_0xb104('0x1d')],function(_0x2ebd8a){return{'model':db[_0x2ebd8a[_0xb104('0x1f')]],'as':_0x2ebd8a['as'],'attributes':_0x2ebd8a['attributes'],'include':_0x2ebd8a['include']?_['map'](_0x2ebd8a['include'],function(_0x453aef){return{'model':db[_0x453aef[_0xb104('0x1f')]],'as':_0x453aef['as'],'attributes':_0x453aef[_0xb104('0x20')],'include':_0x453aef[_0xb104('0x1d')]?_[_0xb104('0x1e')](_0x453aef[_0xb104('0x1d')],function(_0x1645d1){return{'model':db[_0x1645d1['model']],'as':_0x1645d1['as'],'attributes':_0x1645d1[_0xb104('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb104('0xd')](function(_0x244a2a){logger['info'](_0xb104('0x23'),_0x60f17e);logger['debug'](_0xb104('0x23'),_0x60f17e,JSON['stringify'](_0x244a2a));_0x289c9f(_0x244a2a);})[_0xb104('0x22')](function(_0x36fce5){logger['error'](_0xb104('0x23'),_0x36fce5['message'],_0x60f17e);_0x1a80fa(_0x413889[_0xb104('0x11')](0x1f4,_0x36fce5[_0xb104('0x13')]));});});}; \ No newline at end of file +var _0x7822=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trunk','options','attributes','include','map','model','GetTrunk','find','raw','where','ShowTrunk','lodash','util'];(function(_0x113a69,_0x4599e4){var _0x4d259c=function(_0x4499b0){while(--_0x4499b0){_0x113a69['push'](_0x113a69['shift']());}};_0x4d259c(++_0x4599e4);}(_0x7822,0x1c5));var _0x2782=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7822[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2782('0x0'));var util=require(_0x2782('0x1'));var moment=require(_0x2782('0x2'));var BPromise=require(_0x2782('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2782('0x4'))['db'];var utils=require(_0x2782('0x5'));var logger=require(_0x2782('0x6'))('rpc');var config=require(_0x2782('0x7'));var jayson=require(_0x2782('0x8'));var client=jayson[_0x2782('0x9')][_0x2782('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b75d,_0x572fbc,_0x326a21){return new BPromise(function(_0x31bfa9,_0x41b4c3){return client[_0x2782('0xb')](_0x40b75d,_0x326a21)[_0x2782('0xc')](function(_0x3dcc14){logger[_0x2782('0xd')](_0x2782('0xe'),_0x572fbc,_0x2782('0xf'));logger[_0x2782('0x10')](_0x2782('0x11'),_0x572fbc,_0x2782('0xf'),JSON[_0x2782('0x12')](_0x3dcc14));if(_0x3dcc14[_0x2782('0x13')]){if(_0x3dcc14[_0x2782('0x13')][_0x2782('0x14')]===0x1f4){logger[_0x2782('0x13')](_0x2782('0xe'),_0x572fbc,_0x3dcc14[_0x2782('0x13')][_0x2782('0x15')]);return _0x41b4c3(_0x3dcc14[_0x2782('0x13')][_0x2782('0x15')]);}logger[_0x2782('0x13')](_0x2782('0xe'),_0x572fbc,_0x3dcc14['error'][_0x2782('0x15')]);return _0x31bfa9(_0x3dcc14[_0x2782('0x13')]['message']);}else{logger[_0x2782('0xd')](_0x2782('0xe'),_0x572fbc,_0x2782('0xf'));_0x31bfa9(_0x3dcc14[_0x2782('0x16')][_0x2782('0x15')]);}})[_0x2782('0x17')](function(_0x5f336f){logger[_0x2782('0x13')](_0x2782('0xe'),_0x572fbc,_0x5f336f);_0x41b4c3(_0x5f336f);});});}exports['GetTrunk']=function(_0x418267){var _0x48edf0=this;return new Promise(function(_0x3d4e46,_0x2f8491){return db[_0x2782('0x18')]['findAll']({'raw':_0x418267['options']?_0x418267[_0x2782('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x418267['options']?_0x418267[_0x2782('0x19')]['where']||null:null,'attributes':_0x418267[_0x2782('0x19')]?_0x418267[_0x2782('0x19')][_0x2782('0x1a')]||null:null,'limit':_0x418267[_0x2782('0x19')]?_0x418267[_0x2782('0x19')]['limit']||null:null,'include':_0x418267[_0x2782('0x19')]?_0x418267[_0x2782('0x19')][_0x2782('0x1b')]?_[_0x2782('0x1c')](_0x418267[_0x2782('0x19')]['include'],function(_0x587b6b){return{'model':db[_0x587b6b[_0x2782('0x1d')]],'as':_0x587b6b['as'],'attributes':_0x587b6b[_0x2782('0x1a')],'include':_0x587b6b[_0x2782('0x1b')]?_[_0x2782('0x1c')](_0x587b6b['include'],function(_0xd42fc9){return{'model':db[_0xd42fc9[_0x2782('0x1d')]],'as':_0xd42fc9['as'],'attributes':_0xd42fc9['attributes'],'include':_0xd42fc9['include']?_[_0x2782('0x1c')](_0xd42fc9[_0x2782('0x1b')],function(_0x6d3749){return{'model':db[_0x6d3749[_0x2782('0x1d')]],'as':_0x6d3749['as'],'attributes':_0x6d3749[_0x2782('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x209dfe){logger[_0x2782('0xd')]('GetTrunk',_0x418267);logger[_0x2782('0x10')](_0x2782('0x1e'),_0x418267,JSON[_0x2782('0x12')](_0x209dfe));_0x3d4e46(_0x209dfe);})['catch'](function(_0x2aef95){logger['error'](_0x2782('0x1e'),_0x2aef95[_0x2782('0x15')],_0x418267);_0x2f8491(_0x48edf0[_0x2782('0x13')](0x1f4,_0x2aef95[_0x2782('0x15')]));});});};exports['ShowTrunk']=function(_0x54fd73){var _0x450069=this;return new Promise(function(_0x59a4a4,_0x5ddd79){return db['Trunk'][_0x2782('0x1f')]({'raw':_0x54fd73[_0x2782('0x19')]?_0x54fd73[_0x2782('0x19')][_0x2782('0x20')]===undefined?!![]:![]:!![],'where':_0x54fd73[_0x2782('0x19')]?_0x54fd73[_0x2782('0x19')][_0x2782('0x21')]||null:null,'attributes':_0x54fd73['options']?_0x54fd73[_0x2782('0x19')][_0x2782('0x1a')]||null:null,'include':_0x54fd73[_0x2782('0x19')]?_0x54fd73[_0x2782('0x19')]['include']?_[_0x2782('0x1c')](_0x54fd73[_0x2782('0x19')][_0x2782('0x1b')],function(_0x53b909){return{'model':db[_0x53b909[_0x2782('0x1d')]],'as':_0x53b909['as'],'attributes':_0x53b909['attributes'],'include':_0x53b909[_0x2782('0x1b')]?_[_0x2782('0x1c')](_0x53b909[_0x2782('0x1b')],function(_0x3d8d3c){return{'model':db[_0x3d8d3c[_0x2782('0x1d')]],'as':_0x3d8d3c['as'],'attributes':_0x3d8d3c[_0x2782('0x1a')],'include':_0x3d8d3c[_0x2782('0x1b')]?_['map'](_0x3d8d3c['include'],function(_0x5d2b89){return{'model':db[_0x5d2b89['model']],'as':_0x5d2b89['as'],'attributes':_0x5d2b89[_0x2782('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2782('0xc')](function(_0x4b7e59){logger[_0x2782('0xd')](_0x2782('0x22'),_0x54fd73);logger[_0x2782('0x10')](_0x2782('0x22'),_0x54fd73,JSON[_0x2782('0x12')](_0x4b7e59));_0x59a4a4(_0x4b7e59);})['catch'](function(_0x260c25){logger['error'](_0x2782('0x22'),_0x260c25[_0x2782('0x15')],_0x54fd73);_0x5ddd79(_0x450069[_0x2782('0x13')](0x1f4,_0x260c25[_0x2782('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 09611a3..f34dd25 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 _0xcb47=['put','/:id','update','Router','../../components/auth/service'];(function(_0x1dc422,_0x379f18){var _0x299f0a=function(_0x45c38b){while(--_0x45c38b){_0x1dc422['push'](_0x1dc422['shift']());}};_0x299f0a(++_0x379f18);}(_0xcb47,0x143));var _0x7cb4=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0xcb47[_0x178668];return _0x26107d;};'use strict';var express=require('express');var router=express[_0x7cb4('0x0')]();var auth=require(_0x7cb4('0x1'));var controller=require('./user-setting.controller');router[_0x7cb4('0x2')](_0x7cb4('0x3'),auth['isAuthenticated'](),controller[_0x7cb4('0x4')]);module['exports']=router; \ No newline at end of file +var _0xbb55=['../../components/auth/service','put','/:id','isAuthenticated','express'];(function(_0x4c48b,_0x4c0245){var _0x288af9=function(_0x43a03a){while(--_0x43a03a){_0x4c48b['push'](_0x4c48b['shift']());}};_0x288af9(++_0x4c0245);}(_0xbb55,0xfe));var _0x5bb5=function(_0x5f57ae,_0x287296){_0x5f57ae=_0x5f57ae-0x0;var _0x514487=_0xbb55[_0x5f57ae];return _0x514487;};'use strict';var express=require(_0x5bb5('0x0'));var router=express['Router']();var auth=require(_0x5bb5('0x1'));var controller=require('./user-setting.controller');router[_0x5bb5('0x2')](_0x5bb5('0x3'),auth[_0x5bb5('0x4')](),controller['update']);module['exports']=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 610aaac..62565e9 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 _0xe8f3=['INTEGER','UserId','sequelize','info','debug','exports','ENUM','TEXT'];(function(_0x52b708,_0x23c273){var _0x4f131e=function(_0xf2e9b5){while(--_0xf2e9b5){_0x52b708['push'](_0x52b708['shift']());}};_0x4f131e(++_0x23c273);}(_0xe8f3,0x11a));var _0x3e8f=function(_0xa7efd7,_0x45c885){_0xa7efd7=_0xa7efd7-0x0;var _0x572019=_0xe8f3[_0xa7efd7];return _0x572019;};'use strict';var Sequelize=require(_0x3e8f('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0x3e8f('0x1'),_0x3e8f('0x2')];module[_0x3e8f('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3e8f('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3e8f('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3e8f('0x6')],'unique':_0x3e8f('0x7')}}; \ No newline at end of file +var _0xedec=['exports','ENUM','error','BOOLEAN','DATE','INTEGER','UserId','sequelize','info','debug'];(function(_0x2260e5,_0x45a10d){var _0x4c4f51=function(_0x34c6ec){while(--_0x34c6ec){_0x2260e5['push'](_0x2260e5['shift']());}};_0x4c4f51(++_0x45a10d);}(_0xedec,0xcf));var _0xcede=function(_0x4c19a1,_0x15197f){_0x4c19a1=_0x4c19a1-0x0;var _0x58ac50=_0xedec[_0x4c19a1];return _0x58ac50;};'use strict';var Sequelize=require(_0xcede('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0xcede('0x1'),_0xcede('0x2')];module[_0xcede('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xcede('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xcede('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xcede('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xcede('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xcede('0x8')],'unique':_0xcede('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 847eabe..45e0067 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 _0xa9e0=['json','update','then','sendStatus','stack','name','status','send','user','role','admin','Unauthorized','params','UserSetting','body','catch','lodash','ioredis','../../config/logger','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost'];(function(_0xc5e7af,_0x44380a){var _0x1f2342=function(_0x3256d7){while(--_0x3256d7){_0xc5e7af['push'](_0xc5e7af['shift']());}};_0x1f2342(++_0x44380a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var Redis=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x4')]));require(_0x0a9e('0x5'))[_0x0a9e('0x6')](socket);config[_0x0a9e('0x4')]=_[_0x0a9e('0x7')](config['redis'],{'host':_0x0a9e('0x8'),'port':0x18eb});function respondWithResult(_0x441e3a,_0x2cc193){_0x2cc193=_0x2cc193||0xc8;return function(_0x5f41ea){if(_0x5f41ea){return _0x441e3a['status'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea);}};}function saveUpdates(_0x56465b){return function(_0x52cace){if(_0x52cace){return _0x52cace[_0x0a9e('0xa')](_0x56465b)[_0x0a9e('0xb')](function(_0x307b3e){return _0x307b3e;});}return null;};}function handleEntityNotFound(_0x3ab53f){return function(_0xfeb75b){if(!_0xfeb75b){_0x3ab53f[_0x0a9e('0xc')](0x194);}return _0xfeb75b;};}function handleError(_0x4a4c56,_0x50dfb2){_0x50dfb2=_0x50dfb2||0x1f4;return function(_0x527cdd){logger['error'](_0x527cdd[_0x0a9e('0xd')]);if(_0x527cdd[_0x0a9e('0xe')]){delete _0x527cdd[_0x0a9e('0xe')];}_0x4a4c56[_0x0a9e('0xf')](_0x50dfb2)[_0x0a9e('0x10')](_0x527cdd);};}exports[_0x0a9e('0xa')]=function(_0x5db4b0,_0x4283ce){if(_0x5db4b0[_0x0a9e('0x11')][_0x0a9e('0x12')]!==_0x0a9e('0x13'))throw new Error(_0x0a9e('0x14'));if(isNaN(Number(_0x5db4b0[_0x0a9e('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x0a9e('0x16')]['find']({'where':{'id':_0x5db4b0[_0x0a9e('0x15')]['id']}})['then'](handleEntityNotFound(_0x4283ce,null))[_0x0a9e('0xb')](saveUpdates(_0x5db4b0[_0x0a9e('0x17')],null))['then'](respondWithResult(_0x4283ce,null))[_0x0a9e('0x18')](handleError(_0x4283ce,null));}; \ No newline at end of file +var _0xcf1c=['then','sendStatus','stack','name','send','user','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','params','body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','localhost','status','json','update'];(function(_0x1dec20,_0x2595a5){var _0x38d80d=function(_0x11031f){while(--_0x11031f){_0x1dec20['push'](_0x1dec20['shift']());}};_0x38d80d(++_0x2595a5);}(_0xcf1c,0x18d));var _0xccf1=function(_0x3e2e82,_0x369bbe){_0x3e2e82=_0x3e2e82-0x0;var _0xba15aa=_0xcf1c[_0x3e2e82];return _0xba15aa;};'use strict';var _=require(_0xccf1('0x0'));var Redis=require(_0xccf1('0x1'));var logger=require('../../config/logger')(_0xccf1('0x2'));var config=require(_0xccf1('0x3'));var db=require(_0xccf1('0x4'))['db'];var socket=require(_0xccf1('0x5'))(new Redis(config['redis']));require('./user-setting.socket')['register'](socket);config[_0xccf1('0x6')]=_['defaults'](config[_0xccf1('0x6')],{'host':_0xccf1('0x7'),'port':0x18eb});function respondWithResult(_0x2c381f,_0x439e91){_0x439e91=_0x439e91||0xc8;return function(_0x1ee241){if(_0x1ee241){return _0x2c381f[_0xccf1('0x8')](_0x439e91)[_0xccf1('0x9')](_0x1ee241);}};}function saveUpdates(_0x2ed2a0){return function(_0x31f820){if(_0x31f820){return _0x31f820[_0xccf1('0xa')](_0x2ed2a0)[_0xccf1('0xb')](function(_0x1aa1f3){return _0x1aa1f3;});}return null;};}function handleEntityNotFound(_0x16d856){return function(_0x303d34){if(!_0x303d34){_0x16d856[_0xccf1('0xc')](0x194);}return _0x303d34;};}function handleError(_0x2292d7,_0x103c62){_0x103c62=_0x103c62||0x1f4;return function(_0x5bbd8f){logger['error'](_0x5bbd8f[_0xccf1('0xd')]);if(_0x5bbd8f[_0xccf1('0xe')]){delete _0x5bbd8f[_0xccf1('0xe')];}_0x2292d7[_0xccf1('0x8')](_0x103c62)[_0xccf1('0xf')](_0x5bbd8f);};}exports['update']=function(_0x592a7e,_0x41b3e4){if(_0x592a7e[_0xccf1('0x10')][_0xccf1('0x11')]!==_0xccf1('0x12'))throw new Error(_0xccf1('0x13'));if(isNaN(Number(_0x592a7e['params']['id'])))throw new Error(_0xccf1('0x14'));return db['UserSetting']['find']({'where':{'id':_0x592a7e[_0xccf1('0x15')]['id']}})[_0xccf1('0xb')](handleEntityNotFound(_0x41b3e4,null))[_0xccf1('0xb')](saveUpdates(_0x592a7e[_0xccf1('0x16')],null))[_0xccf1('0xb')](respondWithResult(_0x41b3e4,null))[_0xccf1('0x17')](handleError(_0x41b3e4,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 45295c6..b8dc7d1 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 _0x5c5c=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x58a096,_0x764ab4){var _0x40ea62=function(_0x252c54){while(--_0x252c54){_0x58a096['push'](_0x58a096['shift']());}};_0x40ea62(++_0x764ab4);}(_0x5c5c,0xdb));var _0xc5c5=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x5c5c[_0xc14df7];return _0x34a445;};'use strict';var EventEmitter=require(_0xc5c5('0x0'));var UserSetting=require(_0xc5c5('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc5c5('0x2')](0x0);var events={'afterCreate':_0xc5c5('0x3'),'afterUpdate':_0xc5c5('0x4'),'afterDestroy':_0xc5c5('0x5')};function emitEvent(_0x4034d9){return function(_0x2bf1c4,_0x33e11f,_0x3a3a28){UserSettingEvents[_0xc5c5('0x6')](_0x4034d9+':'+_0x2bf1c4['id'],_0x2bf1c4);UserSettingEvents['emit'](_0x4034d9,_0x2bf1c4);_0x3a3a28(null);};}for(var e in events){if(events[_0xc5c5('0x7')](e)){var event=events[e];UserSetting[_0xc5c5('0x8')](e,emitEvent(event));}}module[_0xc5c5('0x9')]=UserSettingEvents; \ No newline at end of file +var _0xf3c3=['emit','hook','events','../../mysqldb','UserSetting','setMaxListeners','save','update'];(function(_0xf5cdfc,_0x1c43ed){var _0x5d8fd8=function(_0x5a678b){while(--_0x5a678b){_0xf5cdfc['push'](_0xf5cdfc['shift']());}};_0x5d8fd8(++_0x1c43ed);}(_0xf3c3,0x9a));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3f3c('0x0'));var UserSetting=require(_0x3f3c('0x1'))['db'][_0x3f3c('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3f3c('0x3')](0x0);var events={'afterCreate':_0x3f3c('0x4'),'afterUpdate':_0x3f3c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x206902){return function(_0x5e423c,_0xadd72d,_0x39d980){UserSettingEvents['emit'](_0x206902+':'+_0x5e423c['id'],_0x5e423c);UserSettingEvents[_0x3f3c('0x6')](_0x206902,_0x5e423c);_0x39d980(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3f3c('0x7')](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 554e4dc..5fe7db1 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 _0xa699=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings'];(function(_0x5de80d,_0x3dab95){var _0x262fdd=function(_0x708de5){while(--_0x708de5){_0x5de80d['push'](_0x5de80d['shift']());}};_0x262fdd(++_0x3dab95);}(_0xa699,0x6b));var _0x9a69=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xa699[_0x4854d6];return _0x3885c0;};'use strict';var attributes=require(_0x9a69('0x0'));module[_0x9a69('0x1')]=function(_0x331c94){return _0x331c94[_0x9a69('0x2')](_0x9a69('0x3'),attributes,{'tableName':_0x9a69('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19916a){if(!_0x19916a[_0x9a69('0x5')])_0x19916a[_0x9a69('0x6')]=null;else if(_0x19916a[_0x9a69('0x6')]===null)_0x19916a[_0x9a69('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x2917=['define','UserSetting','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x2917,0x142));var _0x7291=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x2917[_0x589248];return _0x486750;};'use strict';var attributes=require(_0x7291('0x0'));module[_0x7291('0x1')]=function(_0x292b68){return _0x292b68[_0x7291('0x2')](_0x7291('0x3'),attributes,{'tableName':_0x7291('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x90e67){if(!_0x90e67['clientSideLoggingEnabled'])_0x90e67['clientSideLoggingEnabledSince']=null;else if(_0x90e67[_0x7291('0x5')]===null)_0x90e67[_0x7291('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 5121160..39c848e 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 _0x24b6=['user-setting:update:user-','UserId','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x17f59e,_0x40a674){var _0x1d9532=function(_0x191b8d){while(--_0x191b8d){_0x17f59e['push'](_0x17f59e['shift']());}};_0x1d9532(++_0x40a674);}(_0x24b6,0x1c5));var _0x624b=function(_0x4d5489,_0x1897f6){_0x4d5489=_0x4d5489-0x0;var _0x3107ae=_0x24b6[_0x4d5489];return _0x3107ae;};'use strict';var UserSettingEvents=require(_0x624b('0x0'));var events=[_0x624b('0x1'),_0x624b('0x2'),_0x624b('0x3')];function createListener(_0x38c3bf,_0x596938){return function(_0xb66cc5){_0x596938[_0x624b('0x4')](_0x38c3bf,_0xb66cc5);if(_0x38c3bf===_0x624b('0x5')){_0x596938[_0x624b('0x4')](_0x624b('0x6')+_0xb66cc5[_0x624b('0x7')],_0xb66cc5);}};}exports['register']=function(_0x32d105){for(var _0x25dbb7=0x0,_0xf12b1a=events['length'];_0x25dbb7<_0xf12b1a;_0x25dbb7++){var _0x52b75d=events[_0x25dbb7];var _0xabb454=createListener(_0x624b('0x8')+_0x52b75d,_0x32d105);UserSettingEvents['on'](_0x52b75d,_0xabb454);}}; \ No newline at end of file +var _0x217f=['./user-setting.events','save','remove','update','user-setting:update','emit','length','user-setting:'];(function(_0x4b0d8f,_0x17cf48){var _0x430f3e=function(_0x68ff){while(--_0x68ff){_0x4b0d8f['push'](_0x4b0d8f['shift']());}};_0x430f3e(++_0x17cf48);}(_0x217f,0xd0));var _0xf217=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x217f[_0x20a584];return _0x4b41a8;};'use strict';var UserSettingEvents=require(_0xf217('0x0'));var events=[_0xf217('0x1'),_0xf217('0x2'),_0xf217('0x3')];function createListener(_0x5bf63c,_0x3d540d){return function(_0x2a040c){_0x3d540d['emit'](_0x5bf63c,_0x2a040c);if(_0x5bf63c===_0xf217('0x4')){_0x3d540d[_0xf217('0x5')]('user-setting:update:user-'+_0x2a040c['UserId'],_0x2a040c);}};}exports['register']=function(_0x5c9cbf){for(var _0x2f32a9=0x0,_0x5a6032=events[_0xf217('0x6')];_0x2f32a9<_0x5a6032;_0x2f32a9++){var _0x18d330=events[_0x2f32a9];var _0x308c28=createListener(_0xf217('0x7')+_0x18d330,_0x5c9cbf);UserSettingEvents['on'](_0x18d330,_0x308c28);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9fd2fde..7e19d75 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 _0xa042=['removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','/presence','getPresence','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','addContacts','create','post','/create_many','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions'];(function(_0x57a1e0,_0x3be8e6){var _0x542443=function(_0x527f63){while(--_0x527f63){_0x57a1e0['push'](_0x57a1e0['shift']());}};_0x542443(++_0x3be8e6);}(_0xa042,0x7b));var _0x2a04=function(_0x4bdd6f,_0x305a94){_0x4bdd6f=_0x4bdd6f-0x0;var _0x52048a=_0xa042[_0x4bdd6f];return _0x52048a;};'use strict';var multer=require(_0x2a04('0x0'));var util=require(_0x2a04('0x1'));var path=require(_0x2a04('0x2'));var timeout=require(_0x2a04('0x3'));var express=require(_0x2a04('0x4'));var router=express['Router']();var fs_extra=require(_0x2a04('0x5'));var auth=require(_0x2a04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a04('0x7'));var controller=require(_0x2a04('0x8'));router['get']('/',auth[_0x2a04('0x9')](),controller[_0x2a04('0xa')]);router[_0x2a04('0xb')](_0x2a04('0xc'),auth['isAuthenticated'](),controller[_0x2a04('0xd')]);router[_0x2a04('0xb')](_0x2a04('0xe'),auth[_0x2a04('0x9')](),controller['whoami']);router[_0x2a04('0xb')](_0x2a04('0xf'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x10')]);router['get']('/:id',auth[_0x2a04('0x9')](),controller[_0x2a04('0x11')]);router['get']('/:id/avatar',controller[_0x2a04('0x12')]);router[_0x2a04('0xb')](_0x2a04('0x13'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x14')]);router['get'](_0x2a04('0x15'),auth[_0x2a04('0x9')](),controller['getContacts']);router[_0x2a04('0xb')](_0x2a04('0x16'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x17')]);router[_0x2a04('0xb')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x2a04('0x18')]);router[_0x2a04('0xb')]('/:id/groups',auth[_0x2a04('0x9')](),controller[_0x2a04('0x19')]);router[_0x2a04('0xb')]('/:id/recordings',auth[_0x2a04('0x9')](),controller[_0x2a04('0x1a')]);router[_0x2a04('0xb')]('/:id/screen_recordings',auth[_0x2a04('0x9')](),controller[_0x2a04('0x1b')]);router[_0x2a04('0xb')](_0x2a04('0x1c'),auth[_0x2a04('0x9')](),controller['getChatInteractions']);router[_0x2a04('0xb')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x2a04('0x1d')]);router['get'](_0x2a04('0x1e'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x1f')]);router[_0x2a04('0xb')](_0x2a04('0x20'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x21')]);router[_0x2a04('0xb')](_0x2a04('0x22'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x23')]);router['get'](_0x2a04('0x24'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x25')]);router[_0x2a04('0xb')](_0x2a04('0x26'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x27')]);router['get'](_0x2a04('0x28'),auth[_0x2a04('0x9')](),controller['getLists']);router[_0x2a04('0xb')](_0x2a04('0x29'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x2a')]);router[_0x2a04('0xb')](_0x2a04('0x2b'),auth[_0x2a04('0x9')](),controller['getVoicePrefixes']);router[_0x2a04('0xb')](_0x2a04('0x2c'),auth['isAuthenticated'](),controller[_0x2a04('0x2d')]);router[_0x2a04('0xb')](_0x2a04('0x2e'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x2f')]);router[_0x2a04('0xb')]('/:id/openchannel_accounts',auth[_0x2a04('0x9')](),controller[_0x2a04('0x30')]);router[_0x2a04('0xb')](_0x2a04('0x31'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x32')]);router[_0x2a04('0xb')](_0x2a04('0x33'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x34')]);router[_0x2a04('0xb')](_0x2a04('0x35'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x2a04('0xb')](_0x2a04('0x36'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x37')]);router[_0x2a04('0xb')]('/:id/scheduled_calls',auth[_0x2a04('0x9')](),controller[_0x2a04('0x38')]);router[_0x2a04('0xb')](_0x2a04('0x39'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x3a')]);router['post'](_0x2a04('0x15'),auth['isAuthenticated'](),controller[_0x2a04('0x3b')]);router['post']('/',auth[_0x2a04('0x9')](),controller[_0x2a04('0x3c')]);router[_0x2a04('0x3d')](_0x2a04('0x3e'),auth[_0x2a04('0x9')](),controller['bulkCreate']);router['post'](_0x2a04('0x16'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x3f')]);var upload=multer({'storage':multer[_0x2a04('0x40')]({'destination':function(_0xf63b34,_0x10ab78,_0x417665){_0x417665(null,path[_0x2a04('0x41')](config[_0x2a04('0x42')],_0x2a04('0x43')));},'filename':function(_0x47d665,_0x51cc2d,_0x228494){_0x228494(null,util[_0x2a04('0x44')](_0x2a04('0x45'),Date[_0x2a04('0x46')](),_0x51cc2d[_0x2a04('0x47')]));}})});router[_0x2a04('0x3d')](_0x2a04('0x48'),upload['single']('file'),controller[_0x2a04('0x49')]);router[_0x2a04('0x3d')](_0x2a04('0x4a'),auth['isAuthenticated'](),controller[_0x2a04('0x4b')]);router[_0x2a04('0x3d')](_0x2a04('0x4c'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x4d')]);router['post']('/:id/pause',auth[_0x2a04('0x9')](),controller[_0x2a04('0x4e')]);router[_0x2a04('0x3d')](_0x2a04('0x4f'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x50')]);router['post'](_0x2a04('0x26'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x51')]);router['post']('/:id/chat_interactions',auth[_0x2a04('0x9')](),controller[_0x2a04('0x52')]);router[_0x2a04('0x3d')](_0x2a04('0x53'),auth['isAuthenticated'](),controller[_0x2a04('0x54')]);router[_0x2a04('0x3d')]('/:id/fax_interactions',auth[_0x2a04('0x9')](),controller[_0x2a04('0x55')]);router['post'](_0x2a04('0x56'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x57')]);router[_0x2a04('0x3d')](_0x2a04('0x58'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x2a04('0x3d')]('/:id/whatsapp_interactions',auth[_0x2a04('0x9')](),controller[_0x2a04('0x59')]);router['post']('/:id/fax_accounts',auth[_0x2a04('0x9')](),controller['addFaxAccounts']);router['post'](_0x2a04('0x2e'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x5a')]);router[_0x2a04('0x3d')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x2a04('0x5b')]);router[_0x2a04('0x3d')]('/:id/sms_accounts',auth[_0x2a04('0x9')](),controller['addSmsAccounts']);router[_0x2a04('0x3d')](_0x2a04('0x33'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x5c')]);router[_0x2a04('0x3d')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x2a04('0x5d')]);router[_0x2a04('0x3d')](_0x2a04('0x36'),auth[_0x2a04('0x9')](),controller['addSquareProjects']);router[_0x2a04('0x3d')](_0x2a04('0x39'),auth['isAuthenticated'](),controller[_0x2a04('0x5e')]);router[_0x2a04('0x5f')]('/:id',auth[_0x2a04('0x9')](),controller['update']);router[_0x2a04('0x5f')](_0x2a04('0x60'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x61')]);router[_0x2a04('0x62')](_0x2a04('0x16'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x63')]);router[_0x2a04('0x62')](_0x2a04('0x26'),auth[_0x2a04('0x9')](),controller['removeTeams']);router[_0x2a04('0x62')]('/:id',auth[_0x2a04('0x9')](),controller[_0x2a04('0x64')]);router[_0x2a04('0x62')](_0x2a04('0x65'),auth['isAuthenticated'](),controller[_0x2a04('0x66')]);router['delete'](_0x2a04('0x53'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x67')]);router[_0x2a04('0x62')]('/:id/fax_interactions',auth[_0x2a04('0x9')](),controller[_0x2a04('0x68')]);router['delete'](_0x2a04('0x56'),auth[_0x2a04('0x9')](),controller['removeSmsInteractions']);router['delete'](_0x2a04('0x58'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x69')]);router[_0x2a04('0x62')]('/:id/whatsapp_interactions',auth[_0x2a04('0x9')](),controller['removeWhatsappInteractions']);router['delete'](_0x2a04('0x2c'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x6a')]);router['delete']('/:id/mail_accounts',auth[_0x2a04('0x9')](),controller[_0x2a04('0x6b')]);router[_0x2a04('0x62')](_0x2a04('0x6c'),auth['isAuthenticated'](),controller[_0x2a04('0x6d')]);router[_0x2a04('0x62')](_0x2a04('0x31'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x6e')]);router[_0x2a04('0x62')](_0x2a04('0x33'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x2a04('0x62')]('/:id/whatsapp_accounts',auth[_0x2a04('0x9')](),controller[_0x2a04('0x6f')]);router['delete'](_0x2a04('0x36'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x70')]);router[_0x2a04('0x62')](_0x2a04('0x39'),auth[_0x2a04('0x9')](),controller['removeApiKey']);module[_0x2a04('0x71')]=router; \ No newline at end of file +var _0x5c1a=['removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','server/files/images/','format','now','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','update','put','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts'];(function(_0x3ffad0,_0x3433ab){var _0x41c698=function(_0x594cce){while(--_0x594cce){_0x3ffad0['push'](_0x3ffad0['shift']());}};_0x41c698(++_0x3433ab);}(_0x5c1a,0x76));var _0xa5c1=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x5c1a[_0x51b0dc];return _0x13fa89;};'use strict';var multer=require(_0xa5c1('0x0'));var util=require(_0xa5c1('0x1'));var path=require(_0xa5c1('0x2'));var timeout=require(_0xa5c1('0x3'));var express=require('express');var router=express[_0xa5c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa5c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa5c1('0x6'));var controller=require(_0xa5c1('0x7'));router['get']('/',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x9')]);router[_0xa5c1('0xa')](_0xa5c1('0xb'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0xc')]);router[_0xa5c1('0xa')]('/whoami',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0xd')]);router[_0xa5c1('0xa')]('/presence',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0xe')]);router[_0xa5c1('0xa')](_0xa5c1('0xf'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x10')]);router[_0xa5c1('0xa')](_0xa5c1('0x11'),controller[_0xa5c1('0x12')]);router['get']('/:id/open_tabs',auth[_0xa5c1('0x8')](),controller['getOpenTabs']);router[_0xa5c1('0xa')](_0xa5c1('0x13'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x14')]);router[_0xa5c1('0xa')](_0xa5c1('0x15'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x16')]);router['get'](_0xa5c1('0x17'),auth['isAuthenticated'](),controller[_0xa5c1('0x18')]);router[_0xa5c1('0xa')]('/:id/groups',auth['isAuthenticated'](),controller[_0xa5c1('0x19')]);router[_0xa5c1('0xa')]('/:id/recordings',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x1a')]);router[_0xa5c1('0xa')](_0xa5c1('0x1b'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x1c')]);router[_0xa5c1('0xa')](_0xa5c1('0x1d'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x1e')]);router[_0xa5c1('0xa')]('/:id/openchannel/interactions',auth[_0xa5c1('0x8')](),controller['getOpenchannelInteractions']);router[_0xa5c1('0xa')](_0xa5c1('0x1f'),auth['isAuthenticated'](),controller[_0xa5c1('0x20')]);router[_0xa5c1('0xa')]('/:id/sms/interactions',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x21')]);router[_0xa5c1('0xa')](_0xa5c1('0x22'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x23')]);router[_0xa5c1('0xa')](_0xa5c1('0x24'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x25')]);router[_0xa5c1('0xa')](_0xa5c1('0x26'),auth[_0xa5c1('0x8')](),controller['getTeams']);router[_0xa5c1('0xa')]('/:id/lists',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x27')]);router['get'](_0xa5c1('0x28'),auth[_0xa5c1('0x8')](),controller['getAgents']);router[_0xa5c1('0xa')](_0xa5c1('0x29'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x2a')]);router[_0xa5c1('0xa')](_0xa5c1('0x2b'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x2c')]);router[_0xa5c1('0xa')](_0xa5c1('0x2d'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x2e')]);router[_0xa5c1('0xa')](_0xa5c1('0x2f'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x30')]);router[_0xa5c1('0xa')](_0xa5c1('0x31'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x32')]);router[_0xa5c1('0xa')](_0xa5c1('0x33'),auth['isAuthenticated'](),controller[_0xa5c1('0x34')]);router[_0xa5c1('0xa')](_0xa5c1('0x35'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x36')]);router[_0xa5c1('0xa')](_0xa5c1('0x37'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x38')]);router[_0xa5c1('0xa')]('/:id/scheduled_calls',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x39')]);router[_0xa5c1('0xa')]('/:id/api_key',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x3a')]);router[_0xa5c1('0x3b')](_0xa5c1('0x13'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x3c')]);router[_0xa5c1('0x3b')]('/',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x3d')]);router[_0xa5c1('0x3b')](_0xa5c1('0x3e'),auth['isAuthenticated'](),controller[_0xa5c1('0x3f')]);router[_0xa5c1('0x3b')]('/:id/queues',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x40')]);var upload=multer({'storage':multer[_0xa5c1('0x41')]({'destination':function(_0x1d6e19,_0x27fb00,_0x12b5fa){_0x12b5fa(null,path['join'](config['root'],_0xa5c1('0x42')));},'filename':function(_0x5c5734,_0x1449c1,_0xc6764a){_0xc6764a(null,util[_0xa5c1('0x43')]('%s-%s',Date[_0xa5c1('0x44')](),_0x1449c1['originalname']));}})});router[_0xa5c1('0x3b')]('/:id/avatar',upload[_0xa5c1('0x45')](_0xa5c1('0x46')),controller['addAvatar']);router['post'](_0xa5c1('0x47'),auth['isAuthenticated'](),controller[_0xa5c1('0x48')]);router['post'](_0xa5c1('0x49'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x4a')]);router[_0xa5c1('0x3b')](_0xa5c1('0x4b'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x4c')]);router['post'](_0xa5c1('0x4d'),auth['isAuthenticated'](),controller[_0xa5c1('0x4e')]);router[_0xa5c1('0x3b')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xa5c1('0x3b')](_0xa5c1('0x4f'),auth['isAuthenticated'](),controller[_0xa5c1('0x50')]);router['post'](_0xa5c1('0x51'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x52')]);router[_0xa5c1('0x3b')](_0xa5c1('0x53'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0xa5c1('0x3b')](_0xa5c1('0x54'),auth[_0xa5c1('0x8')](),controller['addSmsInteractions']);router[_0xa5c1('0x3b')](_0xa5c1('0x55'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x56')]);router[_0xa5c1('0x3b')](_0xa5c1('0x57'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x58')]);router[_0xa5c1('0x3b')](_0xa5c1('0x2b'),auth[_0xa5c1('0x8')](),controller['addFaxAccounts']);router[_0xa5c1('0x3b')](_0xa5c1('0x2d'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x59')]);router[_0xa5c1('0x3b')](_0xa5c1('0x2f'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x5a')]);router[_0xa5c1('0x3b')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xa5c1('0x5b')]);router[_0xa5c1('0x3b')](_0xa5c1('0x33'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x5c')]);router[_0xa5c1('0x3b')](_0xa5c1('0x35'),auth[_0xa5c1('0x8')](),controller['addWhatsappAccounts']);router[_0xa5c1('0x3b')](_0xa5c1('0x37'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x5d')]);router[_0xa5c1('0x3b')](_0xa5c1('0x5e'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x5f')]);router['put'](_0xa5c1('0xf'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x60')]);router[_0xa5c1('0x61')]('/:id/password',auth['isAuthenticated'](),controller[_0xa5c1('0x62')]);router['delete']('/:id/queues',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x63')]);router[_0xa5c1('0x64')](_0xa5c1('0x26'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x65')]);router['delete']('/:id',auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x66')]);router[_0xa5c1('0x64')](_0xa5c1('0x4f'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x67')]);router[_0xa5c1('0x64')](_0xa5c1('0x51'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x68')]);router[_0xa5c1('0x64')](_0xa5c1('0x53'),auth[_0xa5c1('0x8')](),controller['removeFaxInteractions']);router[_0xa5c1('0x64')](_0xa5c1('0x54'),auth['isAuthenticated'](),controller[_0xa5c1('0x69')]);router['delete'](_0xa5c1('0x55'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6a')]);router[_0xa5c1('0x64')](_0xa5c1('0x57'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6b')]);router[_0xa5c1('0x64')](_0xa5c1('0x2b'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6c')]);router[_0xa5c1('0x64')](_0xa5c1('0x2d'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6d')]);router[_0xa5c1('0x64')](_0xa5c1('0x2f'),auth[_0xa5c1('0x8')](),controller['removeOpenchannelAccounts']);router[_0xa5c1('0x64')](_0xa5c1('0x31'),auth[_0xa5c1('0x8')](),controller['removeSmsAccounts']);router[_0xa5c1('0x64')](_0xa5c1('0x33'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6e')]);router[_0xa5c1('0x64')](_0xa5c1('0x35'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x6f')]);router[_0xa5c1('0x64')](_0xa5c1('0x37'),auth[_0xa5c1('0x8')](),controller[_0xa5c1('0x70')]);router[_0xa5c1('0x64')](_0xa5c1('0x5e'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0xa5c1('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f2afd0b..80c29cf 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 _0xc758=['avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','wss','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','local','accountcode','format','fullname','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','refuse','originate','uas','fingerprint','certificate','passive','actpass','TEXT','showWebBar','isArray','encryption'];(function(_0x3847ae,_0x17d740){var _0x431cac=function(_0x3c25f8){while(--_0x3c25f8){_0x3847ae['push'](_0x3847ae['shift']());}};_0x431cac(++_0x17d740);}(_0xc758,0xc5));var _0x8c75=function(_0x246fdc,_0x48cd27){_0x246fdc=_0x246fdc-0x0;var _0x30ba2a=_0xc758[_0x246fdc];return _0x30ba2a;};'use strict';var Sequelize=require(_0x8c75('0x0'));var moment=require(_0x8c75('0x1'));var util=require(_0x8c75('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x26298e){this[_0x8c75('0x3')]('name',_0x26298e);this[_0x8c75('0x3')](_0x8c75('0x4'),_0x26298e);},'comment':_0x8c75('0x5')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4ad8ca){this['setDataValue']('fullname',_0x4ad8ca);this['setDataValue'](_0x8c75('0x6'),util['format']('\x22%s\x22\x20<%s>',_0x4ad8ca,this[_0x8c75('0x7')](_0x8c75('0x8'))));}},'alias':{'type':Sequelize[_0x8c75('0x9')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0xd33cff){if(_0xd33cff){this[_0x8c75('0x3')](_0x8c75('0xa'),_0xd33cff[_0x8c75('0xb')]());}}},'role':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0xd'),_0x8c75('0xe'),_0x8c75('0xf'),_0x8c75('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x8c75('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8c75('0x9')],'defaultValue':_0x8c75('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x8c75('0x8'),'set':function(_0x272e84){this['setDataValue'](_0x8c75('0x8'),_0x272e84);this[_0x8c75('0x3')](_0x8c75('0x12'),_0x272e84);this[_0x8c75('0x3')](_0x8c75('0x6'),util[_0x8c75('0x13')]('\x22%s\x22\x20<%s>',this[_0x8c75('0x7')](_0x8c75('0x14')),_0x272e84));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8c75('0x9')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x8c75('0x9')]},'zipcode':{'type':Sequelize[_0x8c75('0x9')]},'userpic':{'type':Sequelize[_0x8c75('0x9')]},'city':{'type':Sequelize[_0x8c75('0x9')]},'country':{'type':Sequelize[_0x8c75('0x9')]},'online':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x8c75('0x16')]},'voicePause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8c75('0x9')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8c75('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![],'defaultValue':_0x8c75('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x8c75('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x19'),_0x8c75('0xe'),_0x8c75('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8c75('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x8c75('0x1c'),_0x8c75('0x1d'),'ALLOWED_FAILED_SCREEN',_0x8c75('0x1e'),'PROHIB_NOT_SCREENED',_0x8c75('0x1f'),'PROHIB_FAILED_SCREEN',_0x8c75('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8c75('0x21'),'set':function(_0x5dd555){this['setDataValue'](_0x8c75('0x22'),_0x5dd555?_0x5dd555[_0x8c75('0x23')](','):null);},'get':function(){return this[_0x8c75('0x7')](_0x8c75('0x22'))?this[_0x8c75('0x7')]('transport')[_0x8c75('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x8c75('0xc')]('rfc2833',_0x8c75('0x25'),_0x8c75('0x26'),_0x8c75('0x27'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x8c75('0x28'),'no',_0x8c75('0x29'),_0x8c75('0x2a'),_0x8c75('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![],'defaultValue':_0x8c75('0x2c'),'set':function(_0x2a0e64){this['setDataValue'](_0x8c75('0x2d'),_0x2a0e64?_0x2a0e64[_0x8c75('0x23')](','):null);},'get':function(){return this[_0x8c75('0x7')](_0x8c75('0x2d'))?this[_0x8c75('0x7')]('nat')[_0x8c75('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8c75('0x9')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8c75('0x9')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8c75('0x9')]},'disallow':{'type':Sequelize[_0x8c75('0x9')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x8c75('0x9')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3ce33f){this[_0x8c75('0x3')](_0x8c75('0x2e'),_0x3ce33f?_0x3ce33f[_0x8c75('0x23')](';'):_0x8c75('0x2f'));},'get':function(){return this[_0x8c75('0x7')]('allow')?this[_0x8c75('0x7')](_0x8c75('0x2e'))[_0x8c75('0x24')](';'):null;},'comment':_0x8c75('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x8c75('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![],'set':function(_0x46881f){this[_0x8c75('0x3')](_0x8c75('0x31'),_0x46881f?_0x46881f[_0x8c75('0x23')](','):null);},'get':function(){return this[_0x8c75('0x7')]('insecure')?this[_0x8c75('0x7')](_0x8c75('0x31'))[_0x8c75('0x24')](','):null;},'comment':_0x8c75('0x32')},'trustrpid':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8c75('0xc')]('yes','no',_0x8c75('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x8c75('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![],'defaultValue':_0x8c75('0x34')},'amaflags':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':_0x8c75('0x28')},'busylevel':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8c75('0xc')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x8c75('0xc')]('accept',_0x8c75('0x35'),_0x8c75('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0x8c75('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':_0x8c75('0x28')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8c75('0xc')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8c75('0xc')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x8c75('0xc')]('yes','no',_0x8c75('0x38'),_0x8c75('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8c75('0xc')]('active',_0x8c75('0x3a'),_0x8c75('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x8c75('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8c75('0xc')](_0x8c75('0x28'),'no',_0x8c75('0x29'),_0x8c75('0x2a'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x8c75('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0x8c75('0x16')]},'passwordResetAt':{'type':Sequelize[_0x8c75('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8c75('0x3c')]},'showWebBar':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0,'set':function(_0x3f17a9){this[_0x8c75('0x3')](_0x8c75('0x3d'),_0x3f17a9);var _0x1fb0d4=this['get']({'plain':!![]});switch(_0x3f17a9){case 0x0:case 0x1:var _0x255f39=_0x1fb0d4[_0x8c75('0x22')]?_[_0x8c75('0x3e')](_0x1fb0d4[_0x8c75('0x22')])?_0x1fb0d4[_0x8c75('0x22')]['join']():_0x1fb0d4[_0x8c75('0x22')]:_0x8c75('0x21');if(_0x255f39==='wss'){_0x255f39='udp';}this[_0x8c75('0x3')]('transport',_0x255f39);this['setDataValue'](_0x8c75('0x3f'),'no');this[_0x8c75('0x3')](_0x8c75('0x40'),null);this[_0x8c75('0x3')](_0x8c75('0x41'),null);this[_0x8c75('0x3')](_0x8c75('0x42'),null);this[_0x8c75('0x3')](_0x8c75('0x43'),null);this['setDataValue'](_0x8c75('0x44'),null);this['setDataValue'](_0x8c75('0x45'),null);this[_0x8c75('0x3')](_0x8c75('0x46'),null);this[_0x8c75('0x3')]('dtlsprivatekey',null);this[_0x8c75('0x3')](_0x8c75('0x47'),'no');break;case 0x2:this[_0x8c75('0x3')](_0x8c75('0x22'),_0x8c75('0x48'));this[_0x8c75('0x3')](_0x8c75('0x3f'),'yes');this[_0x8c75('0x3')](_0x8c75('0x40'),_0x8c75('0x28'));this['setDataValue'](_0x8c75('0x41'),'yes');this[_0x8c75('0x3')](_0x8c75('0x42'),'yes');this[_0x8c75('0x3')]('dtlsenable','yes');this[_0x8c75('0x3')]('dtlsverify','no');this[_0x8c75('0x3')](_0x8c75('0x45'),_0x8c75('0x3b'));this['setDataValue']('dtlscertfile',_0x1fb0d4[_0x8c75('0x46')]||_0x8c75('0x49'));this['setDataValue'](_0x8c75('0x4a'),_0x1fb0d4[_0x8c75('0x4a')]||_0x8c75('0x4b'));this[_0x8c75('0x3')]('rtcp_mux',_0x8c75('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x8c75('0x3c')],'set':function(_0x268e5f){this[_0x8c75('0x3')](_0x8c75('0x4c'),_0x268e5f?_0x268e5f[_0x8c75('0x23')](','):[]);},'get':function(){return this[_0x8c75('0x7')](_0x8c75('0x4c'))?_[_0x8c75('0x4d')](this[_0x8c75('0x7')]('permissions')[_0x8c75('0x24')](','),function(_0x33a7d0){return parseInt(_0x33a7d0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8c75('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x8c75('0x9')]},'phoneBarBusyNumber':{'type':Sequelize[_0x8c75('0x9')]},'phoneBarUnconditional':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8c75('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8c75('0xc')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8c75('0x9')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8c75('0x4e')],'get':function(){return this[_0x8c75('0x7')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x8c75('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x8c75('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8c75('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x2945aa){if(typeof _0x2945aa===_0x8c75('0x50')){var _0x1f2212=_0x2945aa==='1'?!![]:_0x2945aa==='0'?![]:_0x2945aa==='true'?!![]:_0x2945aa===_0x8c75('0x51')?![]:![];this[_0x8c75('0x3')](_0x8c75('0x52'),_0x1f2212);}else{this[_0x8c75('0x3')](_0x8c75('0x52'),_0x2945aa);}}},'blocked':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![],'set':function(_0x5f32a4){this[_0x8c75('0x3')](_0x8c75('0x53'),_0x5f32a4);if(_0x5f32a4===!![]){this['setDataValue']('blockedAt',moment());this['setDataValue'](_0x8c75('0x54'),0x0);}else{this[_0x8c75('0x3')](_0x8c75('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x8c75('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8c75('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8c75('0x17')](0x5)[_0x8c75('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8c75('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0x17b5=['info','shortinfo','inband','auto','rfc2833','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','dynamic','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split'];(function(_0x239269,_0x4e2582){var _0x407c16=function(_0x44f60c){while(--_0x44f60c){_0x239269['push'](_0x239269['shift']());}};_0x407c16(++_0x4e2582);}(_0x17b5,0x92));var _0x517b=function(_0x2e38e3,_0x5c443e){_0x2e38e3=_0x2e38e3-0x0;var _0x5cb83c=_0x17b5[_0x2e38e3];return _0x5cb83c;};'use strict';var Sequelize=require(_0x517b('0x0'));var moment=require(_0x517b('0x1'));var util=require('util');var _=require(_0x517b('0x2'));module[_0x517b('0x3')]={'name':{'type':Sequelize[_0x517b('0x4')],'allowNull':![],'unique':_0x517b('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x41aa43){this[_0x517b('0x6')](_0x517b('0x5'),_0x41aa43);this[_0x517b('0x6')](_0x517b('0x7'),_0x41aa43);},'comment':_0x517b('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1761c6){this[_0x517b('0x6')](_0x517b('0x9'),_0x1761c6);this[_0x517b('0x6')](_0x517b('0xa'),util[_0x517b('0xb')](_0x517b('0xc'),_0x1761c6,this[_0x517b('0xd')](_0x517b('0xe'))));}},'alias':{'type':Sequelize[_0x517b('0x4')]},'email':{'type':Sequelize[_0x517b('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1b4ffc){if(_0x1b4ffc){this['setDataValue'](_0x517b('0xf'),_0x1b4ffc[_0x517b('0x10')]());}}},'role':{'type':Sequelize[_0x517b('0x11')]('admin','user',_0x517b('0x12'),_0x517b('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x517b('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x517b('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x19b5e4){this[_0x517b('0x6')](_0x517b('0xe'),_0x19b5e4);this[_0x517b('0x6')](_0x517b('0x15'),_0x19b5e4);this[_0x517b('0x6')](_0x517b('0xa'),util[_0x517b('0xb')](_0x517b('0xc'),this['getDataValue']('fullname'),_0x19b5e4));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x517b('0x4')]},'mobile':{'type':Sequelize[_0x517b('0x4')]},'address':{'type':Sequelize[_0x517b('0x4')]},'zipcode':{'type':Sequelize[_0x517b('0x4')]},'userpic':{'type':Sequelize[_0x517b('0x4')]},'city':{'type':Sequelize[_0x517b('0x4')]},'country':{'type':Sequelize[_0x517b('0x4')]},'online':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x517b('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x517b('0x17')]},'chatCapacity':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x517b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x517b('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x517b('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x517b('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0x517b('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![],'defaultValue':_0x517b('0x1a')},'callingpres':{'type':Sequelize['ENUM'](_0x517b('0x1b'),'ALLOWED_PASSED_SCREEN',_0x517b('0x1c'),_0x517b('0x1d'),_0x517b('0x1e'),_0x517b('0x1f'),_0x517b('0x20'),_0x517b('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x517b('0x22'),'set':function(_0x31d262){this[_0x517b('0x6')]('transport',_0x31d262?_0x31d262[_0x517b('0x23')](','):null);},'get':function(){return this[_0x517b('0xd')](_0x517b('0x24'))?this[_0x517b('0xd')](_0x517b('0x24'))[_0x517b('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x517b('0x11')]('rfc2833',_0x517b('0x26'),_0x517b('0x27'),_0x517b('0x28'),_0x517b('0x29')),'allowNull':!![],'defaultValue':_0x517b('0x2a')},'directmedia':{'type':Sequelize[_0x517b('0x11')]('yes','no',_0x517b('0x2b'),_0x517b('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![],'defaultValue':_0x517b('0x2e'),'set':function(_0x20f26e){this[_0x517b('0x6')](_0x517b('0x2f'),_0x20f26e?_0x20f26e['join'](','):null);},'get':function(){return this['getDataValue'](_0x517b('0x2f'))?this[_0x517b('0xd')](_0x517b('0x2f'))[_0x517b('0x25')](','):null;},'comment':_0x517b('0x30')},'callgroup':{'type':Sequelize[_0x517b('0x4')]},'namedcallgroup':{'type':Sequelize[_0x517b('0x4')]},'pickupgroup':{'type':Sequelize[_0x517b('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x517b('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x517b('0x32'),'set':function(_0x492223){this['setDataValue'](_0x517b('0x33'),_0x492223?_0x492223[_0x517b('0x23')](';'):_0x517b('0x32'));},'get':function(){return this[_0x517b('0xd')](_0x517b('0x33'))?this[_0x517b('0xd')]('allow')[_0x517b('0x25')](';'):null;},'comment':_0x517b('0x34')},'autoframing':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![],'set':function(_0x2ff651){this[_0x517b('0x6')](_0x517b('0x35'),_0x2ff651?_0x2ff651[_0x517b('0x23')](','):null);},'get':function(){return this[_0x517b('0xd')](_0x517b('0x35'))?this['getDataValue']('insecure')[_0x517b('0x25')](','):null;},'comment':_0x517b('0x36')},'trustrpid':{'type':Sequelize[_0x517b('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no',_0x517b('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x517b('0x38')},'amaflags':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x517b('0x11')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no',_0x517b('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x3a'),_0x517b('0x3b'),_0x517b('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x3d'),_0x517b('0x3e')),'allowNull':!![],'defaultValue':_0x517b('0x3e')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x517b('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x517b('0x11')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no','fingerprint',_0x517b('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x40'),_0x517b('0x41'),_0x517b('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x517b('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x517b('0x2d'),'no',_0x517b('0x2b'),_0x517b('0x2c'),_0x517b('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x517b('0x17')]},'passwordResetAt':{'type':Sequelize[_0x517b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x517b('0x44')]},'showWebBar':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0,'set':function(_0x447710){this['setDataValue']('showWebBar',_0x447710);var _0x25bf85=this[_0x517b('0x45')]({'plain':!![]});switch(_0x447710){case 0x0:case 0x1:var _0x128025=_0x25bf85['transport']?_[_0x517b('0x46')](_0x25bf85[_0x517b('0x24')])?_0x25bf85['transport'][_0x517b('0x23')]():_0x25bf85[_0x517b('0x24')]:_0x517b('0x22');if(_0x128025===_0x517b('0x47')){_0x128025=_0x517b('0x22');}this[_0x517b('0x6')](_0x517b('0x24'),_0x128025);this[_0x517b('0x6')](_0x517b('0x48'),'no');this[_0x517b('0x6')](_0x517b('0x49'),null);this['setDataValue'](_0x517b('0x4a'),null);this['setDataValue'](_0x517b('0x4b'),null);this[_0x517b('0x6')](_0x517b('0x4c'),null);this[_0x517b('0x6')]('dtlsverify',null);this[_0x517b('0x6')](_0x517b('0x4d'),null);this['setDataValue'](_0x517b('0x4e'),null);this[_0x517b('0x6')](_0x517b('0x4f'),null);this[_0x517b('0x6')](_0x517b('0x50'),'no');break;case 0x2:this['setDataValue'](_0x517b('0x24'),_0x517b('0x47'));this['setDataValue'](_0x517b('0x48'),_0x517b('0x2d'));this[_0x517b('0x6')](_0x517b('0x49'),_0x517b('0x2d'));this['setDataValue'](_0x517b('0x4a'),'yes');this[_0x517b('0x6')](_0x517b('0x4b'),_0x517b('0x2d'));this[_0x517b('0x6')](_0x517b('0x4c'),_0x517b('0x2d'));this['setDataValue']('dtlsverify','no');this['setDataValue'](_0x517b('0x4d'),_0x517b('0x42'));this[_0x517b('0x6')](_0x517b('0x4e'),_0x25bf85[_0x517b('0x4e')]||_0x517b('0x51'));this[_0x517b('0x6')](_0x517b('0x4f'),_0x25bf85[_0x517b('0x4f')]||_0x517b('0x52'));this[_0x517b('0x6')](_0x517b('0x50'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x49a797){this['setDataValue'](_0x517b('0x53'),_0x49a797?_0x49a797['join'](','):[]);},'get':function(){return this[_0x517b('0xd')](_0x517b('0x53'))?_['map'](this[_0x517b('0xd')](_0x517b('0x53'))[_0x517b('0x25')](','),function(_0x3f5f82){return parseInt(_0x3f5f82,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x517b('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x517b('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x517b('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x517b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x517b('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x517b('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x517b('0x11')](_0x517b('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x517b('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x517b('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x517b('0x54'))?this['getDataValue'](_0x517b('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x517b('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x55e111){if(typeof _0x55e111===_0x517b('0x55')){var _0x171dbf=_0x55e111==='1'?!![]:_0x55e111==='0'?![]:_0x55e111==='true'?!![]:_0x55e111===_0x517b('0x56')?![]:![];this['setDataValue'](_0x517b('0x57'),_0x171dbf);}else{this[_0x517b('0x6')](_0x517b('0x57'),_0x55e111);}}},'blocked':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![],'set':function(_0xf4402d){this['setDataValue'](_0x517b('0x58'),_0xf4402d);if(_0xf4402d===!![]){this['setDataValue'](_0x517b('0x59'),moment());this[_0x517b('0x6')](_0x517b('0x5a'),0x0);}else{this[_0x517b('0x6')](_0x517b('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0x517b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x517b('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x517b('0x14')](0x5)[_0x517b('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x517b('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x517b('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'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 1153cef..fec2551 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 _0x9735=['sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','fullname','email','permissions','101','102','103','113','110','104','105','106','107','109','100','111','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','each','some','UserProfileSection','findAll','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','ids','penalty','QueueId','VoiceQueue','voice','format','upsert','removeQueues','channel','Queues','isArray','emit','Queue:remove','addAvatar','userpic','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','whatsapp','mail','ChatOpenTabs','CHAT','createdAt','FAX','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','pick','hasOwnProperty','includeAll','List','Tag','Tags','tag','nolimit','getQueues','sort','Queue','get','UserVoiceQueueRt','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','getDataValue','Voice','Queue:save','TeamVoicePrefix','VoicePrefixId','removeTeams','transaction','removeAgent','getLists','getAgents','values','addChatInteractions','spread','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','firstName','lastName','Contact','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','toString','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','SELECT','select','field','ui.','ui.createdAt','_interactions','ui.UserId\x20=\x20?','moment','bluebird','util','path','lodash','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','socket.io-emitter','./user.socket','redis','localhost','client','http','request','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','role','admin','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','find','UserProfileResource','stack','name','send','User','rawAttributes','fieldName','type','key','salt','where','query','include','userSetting','true','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','openchannel','all','show','params','model','differenceBy','keys','password','filters','intersection','fields','UserSetting','merge','options','body','describe','addContacts','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9735,0x12f));var _0x5973=function(_0x368e33,_0x154e19){_0x368e33=_0x368e33-0x0;var _0x2e6bf5=_0x9735[_0x368e33];return _0x2e6bf5;};'use strict';var moment=require(_0x5973('0x0'));var BPromise=require(_0x5973('0x1'));var util=require(_0x5973('0x2'));var path=require(_0x5973('0x3'));var fs=require('fs');var _=require(_0x5973('0x4'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0x5973('0x5'));var qs=require(_0x5973('0x6'));var logger=require('../../config/logger')(_0x5973('0x7'));var utils=require(_0x5973('0x8'));var config=require(_0x5973('0x9'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x5973('0xa'))(new Redis(config['redis']));require(_0x5973('0xb'))['register'](socket);config[_0x5973('0xc')]=_['defaults'](config['redis'],{'host':_0x5973('0xd'),'port':0x18eb});var client=jayson[_0x5973('0xe')][_0x5973('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5acd21,_0x3bba6f,_0x4fc13b,_0x38bc15){return new BPromise(function(_0x5f3928,_0x36aedc){var _0x518d29=_0x38bc15||client;return _0x518d29[_0x5973('0x10')](_0x5acd21,_0x4fc13b)['then'](function(_0x54158e){logger['info'](_0x5973('0x11'),_0x3bba6f,'request\x20sent');logger['debug'](_0x5973('0x12'),_0x3bba6f,_0x5973('0x13'),JSON[_0x5973('0x14')](_0x54158e));if(_0x54158e['error']){if(_0x54158e['error'][_0x5973('0x15')]===0x1f4){logger[_0x5973('0x16')](_0x5973('0x11'),_0x3bba6f,_0x54158e[_0x5973('0x16')]['message']);return _0x36aedc(_0x54158e['error']['message']);}logger[_0x5973('0x16')](_0x5973('0x11'),_0x3bba6f,_0x54158e['error']['message']);return _0x5f3928(_0x54158e['error'][_0x5973('0x17')]);}else{logger['info'](_0x5973('0x11'),_0x3bba6f,_0x5973('0x13'));_0x5f3928(_0x54158e[_0x5973('0x18')][_0x5973('0x17')]);}})[_0x5973('0x19')](function(_0x4f3407){logger[_0x5973('0x16')]('User,\x20%s,\x20%s',_0x3bba6f,_0x4f3407);_0x36aedc(_0x4f3407);});});}function respondWithStatusCode(_0x22a35d,_0x1770b2){_0x1770b2=_0x1770b2||0xcc;return function(_0x6ff56b){if(_0x6ff56b){return _0x22a35d[_0x5973('0x1a')](_0x1770b2);}return _0x22a35d['status'](_0x1770b2)[_0x5973('0x1b')]();};}function respondWithResult(_0x19e54a,_0x405808){_0x405808=_0x405808||0xc8;return function(_0x5991d5){if(_0x5991d5){return _0x19e54a[_0x5973('0x1c')](_0x405808)[_0x5973('0x1d')](_0x5991d5);}};}function respondWithFilteredResult(_0x55ee29,_0x9502b1){return function(_0x44b730){if(_0x44b730){var _0x3751b6=typeof _0x9502b1[_0x5973('0x1e')]===_0x5973('0x1f')&&typeof _0x9502b1[_0x5973('0x20')]===_0x5973('0x1f');var _0x35379d=_0x44b730[_0x5973('0x21')];var _0x519d0b=_0x3751b6?0x0:_0x9502b1[_0x5973('0x1e')];var _0x434728=_0x3751b6?_0x44b730[_0x5973('0x21')]:_0x9502b1[_0x5973('0x1e')]+_0x9502b1[_0x5973('0x20')];var _0x5d5988;if(_0x434728>=_0x35379d){_0x434728=_0x35379d;_0x5d5988=0xc8;}else{_0x5d5988=0xce;}_0x55ee29[_0x5973('0x1c')](_0x5d5988);return _0x55ee29[_0x5973('0x22')](_0x5973('0x23'),_0x519d0b+'-'+_0x434728+'/'+_0x35379d)[_0x5973('0x1d')](_0x44b730);}return null;};}function saveUpdates(_0x3db216){return function(_0x2f85a5){if(_0x2f85a5){return _0x2f85a5[_0x5973('0x24')](_0x3db216)[_0x5973('0x25')](function(_0x164191){return _0x164191;});}return null;};}function removeEntity(_0x2fbb55){return function(_0x2cd710){if(_0x2cd710){return _0x2cd710[_0x5973('0x26')]()[_0x5973('0x25')](function(){var _0x1bf69f=_0x2cd710['get']({'plain':!![]});if(_0x1bf69f[_0x5973('0x27')]===_0x5973('0x28'))return;var _0x696b02=[{'name':'Users','value':_0x5973('0x29'),'ignore':!![]},{'name':_0x5973('0x2a'),'value':_0x5973('0x2b'),'ignore':![]},{'name':_0x5973('0x2c'),'value':_0x5973('0x2d'),'ignore':![]}];var _0x4bc4f1=_(_0x696b02)[_0x5973('0x2e')](_0x5973('0x2f'))[_0x5973('0x30')]('value')[_0x5973('0x31')]();if(_[_0x5973('0x32')](_0x4bc4f1,_0x1bf69f[_0x5973('0x27')])){return;}var _0x1bd31c=_[_0x5973('0x33')](_0x696b02,[_0x5973('0x31'),_0x1bf69f['role']])['name'];return db[_0x5973('0x34')][_0x5973('0x26')]({'where':{'type':_0x1bd31c,'resourceId':_0x1bf69f['id']}})['then'](function(){return _0x2cd710;});})['then'](function(){_0x2fbb55[_0x5973('0x1c')](0xcc)[_0x5973('0x1b')]();});}};}function handleEntityNotFound(_0x3d2fa9){return function(_0x2189a2){if(!_0x2189a2){_0x3d2fa9[_0x5973('0x1a')](0x194);}return _0x2189a2;};}function handleError(_0x991daf,_0x289151){_0x289151=_0x289151||0x1f4;return function(_0xc170c3){logger[_0x5973('0x16')](_0xc170c3[_0x5973('0x35')]);if(_0xc170c3[_0x5973('0x36')]){delete _0xc170c3['name'];}_0x991daf[_0x5973('0x1c')](_0x289151)[_0x5973('0x37')](_0xc170c3);};}exports['index']=function(_0x209ae4,_0x3b54ce){var _0x174246={},_0x45991f={'count':0x0,'rows':[]};var _0x44611e=_(db[_0x5973('0x38')][_0x5973('0x39')])[_0x5973('0x30')](function(_0x213113){return{'name':_0x213113[_0x5973('0x3a')],'type':_0x213113[_0x5973('0x3b')][_0x5973('0x3c')]};})['filter'](function(_0x3d2d00){return!_[_0x5973('0x32')](['password',_0x5973('0x3d')],_0x3d2d00['name']);})[_0x5973('0x31')]();_0x174246=qs['getOptions'](_0x44611e,_0x209ae4);var _0xd64c30={'where':_0x174246[_0x5973('0x3e')]};return db[_0x5973('0x38')]['count'](_0xd64c30)[_0x5973('0x25')](function(_0x253df6){_0x45991f[_0x5973('0x21')]=_0x253df6;if(_0x209ae4[_0x5973('0x3f')]['includeAll']){_0x174246[_0x5973('0x40')]=[{'all':!![]}];}if(_0x209ae4[_0x5973('0x3f')][_0x5973('0x41')]===_0x5973('0x42')){_0x174246[_0x5973('0x40')]=[{'model':db['UserSetting'],'as':_0x5973('0x41')}];}if(!_['includes'](_0x174246[_0x5973('0x43')],'id')){_0x174246['attributes'][_0x5973('0x44')]('id');}return db[_0x5973('0x38')]['findAll'](_0x174246);})[_0x5973('0x25')](function(_0x2c90a8){_0x45991f[_0x5973('0x45')]=_0x2c90a8;if(_0x209ae4['query'][_0x5973('0x46')]===_0x5973('0x42')){var _0x4f007d=[];for(var _0x7889d3=0x0;_0x7889d3<_0x45991f[_0x5973('0x45')][_0x5973('0x47')];_0x7889d3++){_0x4f007d[_0x5973('0x44')](get_open_tabs(_0x5973('0x48'),_0x45991f['rows'][_0x7889d3][_0x5973('0x49')]));_0x4f007d[_0x5973('0x44')](get_open_tabs(_0x5973('0x4a'),_0x45991f['rows'][_0x7889d3][_0x5973('0x49')]));_0x4f007d[_0x5973('0x44')](get_open_tabs(_0x5973('0x4b'),_0x45991f['rows'][_0x7889d3][_0x5973('0x49')]));_0x4f007d[_0x5973('0x44')](get_open_tabs('mail',_0x45991f['rows'][_0x7889d3][_0x5973('0x49')]));_0x4f007d[_0x5973('0x44')](get_open_tabs(_0x5973('0x4c'),_0x45991f[_0x5973('0x45')][_0x7889d3]['dataValues']));_0x4f007d[_0x5973('0x44')](get_open_tabs('whatsapp',_0x45991f['rows'][_0x7889d3][_0x5973('0x49')]));}return BPromise[_0x5973('0x4d')](_0x4f007d)[_0x5973('0x25')](function(){return _0x45991f;});}else{return _0x45991f;}})['then'](respondWithFilteredResult(_0x3b54ce,_0x174246))[_0x5973('0x19')](handleError(_0x3b54ce,null));};exports[_0x5973('0x4e')]=function(_0x7259fe,_0x35be0c){var _0x54d74b={'raw':![],'where':{'id':_0x7259fe[_0x5973('0x4f')]['id']}},_0x4d49dc={};_0x4d49dc[_0x5973('0x50')]=_[_0x5973('0x51')](_[_0x5973('0x52')](db[_0x5973('0x38')][_0x5973('0x39')]),[_0x5973('0x53'),_0x5973('0x3d')]);_0x4d49dc[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x7259fe[_0x5973('0x3f')]);_0x4d49dc[_0x5973('0x54')]=_['intersection'](_0x4d49dc[_0x5973('0x50')],_0x4d49dc['query']);_0x54d74b[_0x5973('0x43')]=_[_0x5973('0x55')](_0x4d49dc[_0x5973('0x50')],qs[_0x5973('0x56')](_0x7259fe[_0x5973('0x3f')][_0x5973('0x56')]));_0x54d74b[_0x5973('0x43')]=_0x54d74b['attributes'][_0x5973('0x47')]?_0x54d74b[_0x5973('0x43')]:_0x4d49dc[_0x5973('0x50')];if(_0x7259fe[_0x5973('0x3f')]['includeAll']){_0x54d74b[_0x5973('0x40')]=[{'all':!![]}];}if(_0x7259fe['query'][_0x5973('0x41')]==='true'){_0x54d74b[_0x5973('0x40')]=[{'model':db[_0x5973('0x57')],'as':_0x5973('0x41')}];}_0x54d74b=_[_0x5973('0x58')]({},_0x54d74b,_0x7259fe[_0x5973('0x59')]);if(!_[_0x5973('0x32')](_0x54d74b[_0x5973('0x43')],'id')){_0x54d74b[_0x5973('0x43')][_0x5973('0x44')]('id');}return db[_0x5973('0x38')][_0x5973('0x33')](_0x54d74b)[_0x5973('0x25')](handleEntityNotFound(_0x35be0c,null))[_0x5973('0x25')](function(_0x14f0b3){var _0x2dfdb3=[];values=_0x14f0b3;if(_0x7259fe[_0x5973('0x3f')][_0x5973('0x46')]==='true'){_0x2dfdb3[_0x5973('0x44')](get_open_tabs('chat',_0x14f0b3['dataValues']));_0x2dfdb3['push'](get_open_tabs(_0x5973('0x4a'),_0x14f0b3['dataValues']));_0x2dfdb3[_0x5973('0x44')](get_open_tabs(_0x5973('0x4c'),_0x14f0b3['dataValues']));_0x2dfdb3['push'](get_open_tabs('whatsapp',_0x14f0b3[_0x5973('0x49')]));_0x2dfdb3['push'](get_open_tabs(_0x5973('0x4b'),_0x14f0b3[_0x5973('0x49')]));_0x2dfdb3['push'](get_open_tabs('mail',_0x14f0b3[_0x5973('0x49')]));return BPromise[_0x5973('0x4d')](_0x2dfdb3);}else{return values;}})[_0x5973('0x25')](function(){return values;})[_0x5973('0x25')](respondWithResult(_0x35be0c,null))[_0x5973('0x19')](handleError(_0x35be0c,null));};exports[_0x5973('0x24')]=function(_0x558131,_0x106a9b){if(_0x558131[_0x5973('0x5a')]['id']){delete _0x558131['body']['id'];}delete _0x558131[_0x5973('0x5a')][_0x5973('0x27')];return db['User'][_0x5973('0x33')]({'where':{'id':_0x558131[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x106a9b,null))['then'](saveUpdates(_0x558131['body'],null))[_0x5973('0x25')](respondWithResult(_0x106a9b,null))[_0x5973('0x19')](handleError(_0x106a9b,null));};exports['describe']=function(_0x5a160a,_0x155024){return db['User'][_0x5973('0x5b')]()[_0x5973('0x25')](respondWithResult(_0x155024,null))[_0x5973('0x19')](handleError(_0x155024,null));};exports[_0x5973('0x5c')]=function(_0xce919f,_0x8c1aca){return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0xce919f['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x8c1aca,null))[_0x5973('0x25')](function(_0x484335){if(_0x484335){return _0x484335[_0x5973('0x5c')](_0xce919f['body']['ids'],_[_0x5973('0x5d')](_0xce919f[_0x5973('0x5a')],['ids','id'])||{});}})[_0x5973('0x25')](respondWithResult(_0x8c1aca,null))[_0x5973('0x19')](handleError(_0x8c1aca,null));};function validateUser(_0x1ae36f){return new BPromise(function(_0x4fa1ad,_0x5f0b3c){if(_0x1ae36f[_0x5973('0x5e')])return _0x4fa1ad(_0x1ae36f);return db[_0x5973('0x5f')][_0x5973('0x60')](0x1)['then'](function(_0x639d09){if(_0x639d09[_0x5973('0x61')])authService[_0x5973('0x62')](_0x1ae36f['password']);db[_0x5973('0x38')]['max'](_0x5973('0x5e'))['then'](function(_0x12dbe2){if(_[_0x5973('0x63')](_0x12dbe2)){_0x1ae36f['internal']=_0x639d09['min_internal']||0x1;return;}if(_['isNil'](_0x639d09[_0x5973('0x64')])||_0x639d09[_0x5973('0x64')]===_0x12dbe2){_0x1ae36f[_0x5973('0x5e')]=_0x12dbe2+0x1;return;}if(_0x639d09[_0x5973('0x64')]>_0x12dbe2){_0x1ae36f['internal']=_0x639d09['min_internal'];return;}return db[_0x5973('0x65')][_0x5973('0x3f')](_0x5973('0x66'),{'type':db['sequelize'][_0x5973('0x67')]['SELECT']})[_0x5973('0x25')](function(_0x2f7057){if(_0x2f7057&&_0x2f7057[_0x5973('0x47')]){for(var _0x155f36=0x0,_0x4942cd=_0x2f7057['length'];_0x155f36<_0x4942cd&&_[_0x5973('0x63')](_0x1ae36f[_0x5973('0x5e')]);_0x155f36++){if(_0x639d09[_0x5973('0x64')]<=_0x2f7057[_0x155f36][_0x5973('0x68')]){_0x1ae36f[_0x5973('0x5e')]=_0x2f7057[_0x155f36]['from'];}else if(_0x639d09[_0x5973('0x64')]>_0x2f7057[_0x155f36][_0x5973('0x68')]&&_0x639d09[_0x5973('0x64')]<=_0x2f7057[_0x155f36]['to']){_0x1ae36f['internal']=_0x639d09[_0x5973('0x64')];}}}if(_['isNil'](_0x1ae36f[_0x5973('0x5e')])){_0x1ae36f[_0x5973('0x5e')]=_0x12dbe2+0x1;}return _0x4fa1ad(_0x1ae36f);});});})[_0x5973('0x19')](function(_0x5a0448){_0x5f0b3c(_0x5a0448);});});}function updateUser(_0x34bdb9){return new BPromise(function(_0x26788e,_0x5b36ef){try{if(_0x34bdb9['voicemail']){_0x34bdb9[_0x5973('0x69')]=_0x34bdb9[_0x5973('0x5e')];_0x34bdb9['VoiceMail']={'mailbox':_0x34bdb9[_0x5973('0x5e')],'password':_0x34bdb9[_0x5973('0x53')],'fullname':_0x34bdb9[_0x5973('0x6a')],'email':_0x34bdb9[_0x5973('0x6b')]};}if(_0x34bdb9[_0x5973('0x27')]===_0x5973('0x2b')){if(!_0x34bdb9[_0x5973('0x6c')])_0x34bdb9[_0x5973('0x6c')]=[_0x5973('0x6d'),_0x5973('0x6e'),_0x5973('0x6f'),_0x5973('0x70'),_0x5973('0x71'),_0x5973('0x72'),_0x5973('0x73'),_0x5973('0x74'),_0x5973('0x75'),'108',_0x5973('0x76'),_0x5973('0x77'),_0x5973('0x78'),_0x5973('0x79'),'115'];}_0x26788e(_0x34bdb9);}catch(_0x2aa869){_0x5b36ef(_0x2aa869);}});}exports[_0x5973('0x7a')]=function(_0x1deb2c,_0x341a86){if(_0x1deb2c[_0x5973('0x29')][_0x5973('0x27')]===_0x5973('0x2b'))throw new Error(_0x5973('0x7b'));if(_0x1deb2c[_0x5973('0x5a')]['role']===_0x5973('0x29')&&_0x1deb2c[_0x5973('0x29')][_0x5973('0x27')]!==_0x5973('0x28')){throw new Error(_0x5973('0x7c'));}if(_0x1deb2c[_0x5973('0x5a')]['role']===_0x5973('0x28')&&_0x1deb2c[_0x5973('0x29')]['role']!==_0x5973('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x5973('0x7d')]([_0x1deb2c[_0x5973('0x5a')]])[_0x5973('0x25')](function(){return validateUser(_0x1deb2c[_0x5973('0x5a')]);})[_0x5973('0x25')](function(_0x5db4a6){return updateUser(_0x5db4a6)[_0x5973('0x25')](function(_0xb11ede){if(_0xb11ede[_0x5973('0x27')]===_0x5973('0x28')){_0xb11ede[_0x5973('0x7e')]=_0x1deb2c[_0x5973('0x29')]['settingsEnabled'];delete _0xb11ede[_0x5973('0x7f')];}return _0xb11ede;});})[_0x5973('0x25')](function(_0x531683){return db['User'][_0x5973('0x7a')](_0x531683,{'include':[{'model':db[_0x5973('0x80')],'as':'VoiceMail'}]});})[_0x5973('0x25')](function(_0x4e5e1c){if(_0x1deb2c[_0x5973('0x5a')][_0x5973('0x27')]===_0x5973('0x29'))return _0x4e5e1c;if(_0x1deb2c['user'][_0x5973('0x27')]!==_0x5973('0x29'))return _0x4e5e1c;return db['UserProfileSection']['find']({'where':{'name':_0x4e5e1c[_0x5973('0x27')]===_0x5973('0x2b')?_0x5973('0x2a'):'Telephones','userProfileId':_0x1deb2c[_0x5973('0x29')][_0x5973('0x7f')]},'raw':!![]})[_0x5973('0x25')](function(_0x570d4a){if(!_0x570d4a||_0x570d4a[_0x5973('0x81')]!=0x0)return _0x4e5e1c;return db[_0x5973('0x34')][_0x5973('0x7a')]({'name':_0x4e5e1c['name'],'resourceId':_0x4e5e1c['id'],'type':_0x570d4a['name'],'sectionId':_0x570d4a['id']},{})[_0x5973('0x25')](function(){return _0x4e5e1c;});})[_0x5973('0x19')](function(_0x4dc697){logger[_0x5973('0x16')](_0x5973('0x82'),_0x4dc697);throw _0x4dc697;});})[_0x5973('0x25')](respondWithResult(_0x341a86,0xc9))[_0x5973('0x19')](handleError(_0x341a86,null));};exports['bulkCreate']=function(_0x3e9b28,_0x33b763){var _0x183cf4=_0x3e9b28[_0x5973('0x5a')];var _0x1e1ab0=[];if(_0x3e9b28[_0x5973('0x29')]['role']===_0x5973('0x2b'))throw new Error(_0x5973('0x7b'));if(_['some'](_0x183cf4,[_0x5973('0x27'),_0x5973('0x29')])&&_0x3e9b28[_0x5973('0x29')][_0x5973('0x27')]!==_0x5973('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x183cf4,[_0x5973('0x27'),_0x5973('0x28')])&&_0x3e9b28[_0x5973('0x29')][_0x5973('0x27')]!==_0x5973('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x5973('0x7d')](_0x183cf4)[_0x5973('0x25')](function(){return validateUser(_0x183cf4[0x0]);})[_0x5973('0x25')](function(){for(var _0x2b689d=0x1;_0x2b689d<_0x183cf4[_0x5973('0x47')];_0x2b689d++){var _0x185d84=_0x183cf4[_0x2b689d-0x1][_0x5973('0x5e')];if(!_0x183cf4[_0x2b689d]['internal'])_0x183cf4[_0x2b689d][_0x5973('0x5e')]=_0x185d84+0x1;_0x1e1ab0[_0x5973('0x44')](validateUser(_0x183cf4[_0x2b689d]));}return BPromise['all'](_0x1e1ab0);})[_0x5973('0x25')](function(){_0x1e1ab0=[];for(var _0x4e4cea=0x0;_0x4e4cea<_0x183cf4['length'];_0x4e4cea++){_0x1e1ab0[_0x5973('0x44')](updateUser(_0x183cf4[_0x4e4cea]));}return BPromise['all'](_0x1e1ab0);})[_0x5973('0x25')](function(){return BPromise[_0x5973('0x83')](_0x183cf4,function(_0x552c6c){return db[_0x5973('0x38')][_0x5973('0x7a')](_0x552c6c,{'include':[{'model':db[_0x5973('0x80')],'as':_0x5973('0x80')}]})['then'](function(_0x577f6f){_0x552c6c['id']=_0x577f6f['id'];return _0x552c6c;});});})['then'](function(_0x9e44a4){if(_0x3e9b28[_0x5973('0x5a')][_0x5973('0x27')]==='user')return _0x9e44a4;if(_0x3e9b28['user'][_0x5973('0x27')]!==_0x5973('0x29'))return _0x9e44a4;var _0x13a9c4=_[_0x5973('0x84')](_0x9e44a4,function(_0x37ea4a){return _0x37ea4a['role']===_0x5973('0x2b')||_0x37ea4a[_0x5973('0x27')]===_0x5973('0x2d');});if(!_0x13a9c4)return _0x9e44a4;return db[_0x5973('0x85')][_0x5973('0x86')]({'where':{'name':{'$or':['Agents',_0x5973('0x2c')]},'userProfileId':_0x3e9b28[_0x5973('0x29')]['userProfileId']},'raw':!![]})[_0x5973('0x25')](function(_0x414a96){if(_['isEmpty'](_0x414a96)||!_[_0x5973('0x84')](_0x414a96,[_0x5973('0x81'),0x0]))return _0x9e44a4;_0x1e1ab0=[];var _0x4eb65d=_(_0x414a96)['map'](function(_0x4f49fb){if(_0x4f49fb[_0x5973('0x81')]===0x1)return;return _0x4f49fb[_0x5973('0x36')]===_0x5973('0x2a')?_0x5973('0x2b'):_0x5973('0x2d');})['compact']()[_0x5973('0x31')]();for(var _0x53f0ac=0x0;_0x53f0ac<_0x9e44a4[_0x5973('0x47')];_0x53f0ac++){if(!_[_0x5973('0x32')](_0x4eb65d,_0x9e44a4[_0x53f0ac][_0x5973('0x27')]))return;var _0x29713c=_0x9e44a4[_0x53f0ac][_0x5973('0x27')]==='agent'?_0x5973('0x2a'):_0x5973('0x2c');_0x1e1ab0[_0x5973('0x44')](db[_0x5973('0x34')]['create']({'name':_0x9e44a4[_0x53f0ac][_0x5973('0x36')],'resourceId':_0x9e44a4[_0x53f0ac]['id'],'type':_0x29713c,'sectionId':_[_0x5973('0x33')](_0x414a96,[_0x5973('0x36'),_0x29713c])['id']},{}));}return BPromise['all'](_0x1e1ab0);});})[_0x5973('0x25')](respondWithResult(_0x33b763,0xc9))[_0x5973('0x19')](handleError(_0x33b763,null));};exports[_0x5973('0x87')]=function(_0x5b508c,_0x26b546){if(_0x5b508c[_0x5973('0x5a')]['id']){delete _0x5b508c['body']['id'];}return db['User']['find']({'where':{'id':_0x5b508c[_0x5973('0x4f')]['id']}})['then'](function(_0x372ec4){if(!_0x372ec4)return null;if(_0x372ec4['id']===_0x5b508c['user']['id']){if(!_0x5b508c['body'][_0x5973('0x88')]||!_0x5b508c[_0x5973('0x5a')][_0x5973('0x89')]){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x372ec4[_0x5973('0x8c')](_0x5b508c[_0x5973('0x5a')][_0x5973('0x88')])){throw new db[(_0x5973('0x8a'))]['ValidationError'](_0x5973('0x8d'));}if(_0x5b508c['body'][_0x5973('0x88')]===_0x5b508c['body'][_0x5973('0x89')]){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))](_0x5973('0x8e'));}}else if(_0x5b508c[_0x5973('0x29')][_0x5973('0x27')]===_0x5973('0x28')){if(!_0x5b508c[_0x5973('0x5a')]['newPassword']){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))](_0x5973('0x8f'));}}else if(_0x5b508c[_0x5973('0x29')][_0x5973('0x27')]==='user'){if(!_0x5b508c[_0x5973('0x5a')][_0x5973('0x89')]){throw new db['Sequelize'][(_0x5973('0x8b'))](_0x5973('0x8f'));}if(_0x372ec4[_0x5973('0x27')]!==_0x5973('0x2b')){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0x5973('0x8b'))](_0x5973('0x7b'));}return _0x372ec4;})['then'](handleEntityNotFound(_0x26b546,null))[_0x5973('0x25')](function(_0x5d4c33){return db[_0x5973('0x5f')][_0x5973('0x90')]({'attributes':['id',_0x5973('0x61'),_0x5973('0x91'),_0x5973('0x92')]})[_0x5973('0x25')](function(_0x424ec6){if(_0x424ec6[_0x5973('0x61')])authService[_0x5973('0x62')](_0x5b508c[_0x5973('0x5a')][_0x5973('0x89')]);if(!_0x424ec6[_0x5973('0x91')]||!_0x5d4c33[_0x5973('0x93')])return _0x5d4c33;authService['validatePasswordHistory'](_0x5b508c[_0x5973('0x5a')][_0x5973('0x89')],_0x5d4c33[_0x5973('0x93')],_0x424ec6['passwordHistoryLimit']);return _0x5d4c33;})[_0x5973('0x25')](saveUpdates({'password':_0x5b508c[_0x5973('0x5a')][_0x5973('0x89')],'passwordResetAt':_0x5b508c['user']['id']==_0x5b508c[_0x5973('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x5973('0x94')](_0x5b508c[_0x5973('0x5a')]['newPassword'],_0x5d4c33[_0x5973('0x93')])},null));})[_0x5973('0x25')](respondWithResult(_0x26b546,null))['catch'](handleError(_0x26b546,null));};exports['addQueues']=function(_0x38d9ea,_0x3cd075){var _0x1b0035=_0x38d9ea[_0x5973('0x5a')]['channel'];return db['User'][_0x5973('0x33')]({'where':{'id':_0x38d9ea[_0x5973('0x4f')]['id']},'attributes':['id',_0x5973('0x36'),_0x5973('0x27'),_0x5973('0x95'),'loginInPause',_0x5973('0x96'),_0x5973('0x97')]})[_0x5973('0x25')](handleEntityNotFound(_0x3cd075,null))[_0x5973('0x25')](function(_0x450969){if(_0x450969){if(!utils[_0x5973('0x98')](_0x1b0035)){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))](_0x5973('0x99'));}return _0x450969[_0x5973('0x9a')+_[_0x5973('0x9b')](_0x1b0035[_0x5973('0x9c')]())+'Queues'](_0x38d9ea['body'][_0x5973('0x9d')],{'penalty':_0x38d9ea[_0x5973('0x5a')][_0x5973('0x9e')]||0x0})['spread'](function(_0x304c99){for(var _0x31b4e6=0x0;_0x31b4e6<_0x38d9ea[_0x5973('0x5a')][_0x5973('0x9d')][_0x5973('0x47')];_0x31b4e6+=0x1){var _0x216839={'UserId':Number(_0x38d9ea['params']['id'])};_0x216839[_[_0x5973('0x9b')](_0x1b0035[_0x5973('0x9c')]())+_0x5973('0x9f')]=Number(_0x38d9ea[_0x5973('0x5a')][_0x5973('0x9d')][_0x31b4e6]);socket['emit'](_0x5973('0x29')+_[_0x5973('0x9b')](_0x1b0035['toLowerCase']())+'Queue:save',_0x216839);}return _0x304c99;})[_0x5973('0x25')](function(){if(_0x1b0035==='voice'){return db[_0x5973('0xa0')]['findAll']({'where':{'id':_0x38d9ea[_0x5973('0x5a')][_0x5973('0x9d')]||[]},'raw':!![],'attributes':['id',_0x5973('0x36')]});}})[_0x5973('0x25')](function(_0x2c4d01){var _0x48d799=_0x450969['get']({'plain':!![]});var _0xed69f5=[];if(_0x1b0035===_0x5973('0xa1')&&_0x48d799[_0x5973('0x27')]==='agent'&&_0x48d799[_0x5973('0x95')]){for(var _0x4f7eee=0x0;_0x4f7eee<_0x2c4d01[_0x5973('0x47')];_0x4f7eee+=0x1){_0xed69f5[_0x5973('0x44')]({'membername':_0x48d799[_0x5973('0x36')],'UserId':_0x48d799['id'],'queue_name':_0x2c4d01[_0x4f7eee][_0x5973('0x36')],'VoiceQueueId':_0x2c4d01[_0x4f7eee]['id'],'interface':_[_0x5973('0x63')](_0x48d799[_0x5973('0x97')])?util[_0x5973('0xa2')]('SIP/%s',_0x48d799[_0x5973('0x36')]):_0x48d799[_0x5973('0x97')],'paused':_0x48d799[_0x5973('0x96')]||![],'penalty':_0x38d9ea[_0x5973('0x5a')][_0x5973('0x9e')]||0x0});}return BPromise[_0x5973('0x83')](_0xed69f5,function(_0x1e18ad){return db['UserVoiceQueueRt'][_0x5973('0xa3')](_0x1e18ad);});}return _0x450969;});}})[_0x5973('0x25')](respondWithStatusCode(_0x3cd075,null))[_0x5973('0x19')](handleError(_0x3cd075,null));};exports[_0x5973('0xa4')]=function(_0x21e123,_0x101469){var _0x43a25a,_0x26979a;return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0x21e123[_0x5973('0x4f')]['id']},'attributes':['id',_0x5973('0x36'),'role']})[_0x5973('0x25')](handleEntityNotFound(_0x101469,null))[_0x5973('0x25')](function(_0x4a4387){if(_0x4a4387){_0x43a25a=_0x4a4387;if(!_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')]||!utils[_0x5973('0x98')](_0x21e123['query']['channel'])){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))](_0x5973('0x99'));}return _0x4a4387['remove'+_['capitalize'](_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')][_0x5973('0x9c')]())+_0x5973('0xa6')](_0x21e123['query'][_0x5973('0x9d')]);}})['then'](function(_0x5a8dcd){if(_[_0x5973('0xa7')](_0x21e123[_0x5973('0x3f')]['ids'])){for(var _0x385054=0x0;_0x385054<_0x21e123[_0x5973('0x3f')][_0x5973('0x9d')][_0x5973('0x47')];_0x385054+=0x1){_0x26979a={'UserId':Number(_0x21e123[_0x5973('0x4f')]['id'])};_0x26979a[_[_0x5973('0x9b')](_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')][_0x5973('0x9c')]())+_0x5973('0x9f')]=Number(_0x21e123[_0x5973('0x3f')][_0x5973('0x9d')][_0x385054]);socket[_0x5973('0xa8')](_0x5973('0x29')+_[_0x5973('0x9b')](_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')]['toLowerCase']())+_0x5973('0xa9'),_0x26979a);}}else{_0x26979a={'UserId':Number(_0x21e123[_0x5973('0x4f')]['id'])};_0x26979a[_[_0x5973('0x9b')](_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')][_0x5973('0x9c')]())+_0x5973('0x9f')]=Number(_0x21e123[_0x5973('0x3f')]['ids']);socket[_0x5973('0xa8')](_0x5973('0x29')+_['capitalize'](_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')][_0x5973('0x9c')]())+_0x5973('0xa9'),_0x26979a);}return _0x5a8dcd;})[_0x5973('0x25')](function(){if(_0x21e123[_0x5973('0x3f')][_0x5973('0xa5')]===_0x5973('0xa1')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x21e123['params']['id'],'VoiceQueueId':_0x21e123[_0x5973('0x3f')][_0x5973('0x9d')]},'individualHooks':!![]})['then'](function(){return _0x43a25a;});}return _0x43a25a;})[_0x5973('0x25')](respondWithStatusCode(_0x101469,null))[_0x5973('0x19')](handleError(_0x101469,null));};exports[_0x5973('0xaa')]=function(_0x3aa4d8,_0x520475){_0x3aa4d8[_0x5973('0x5a')][_0x5973('0xab')]=_0x3aa4d8['file'][_0x5973('0xac')];return db[_0x5973('0x38')]['find']({'where':{'id':_0x3aa4d8['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x520475,null))[_0x5973('0x25')](saveUpdates(_0x3aa4d8['body'],null))[_0x5973('0x25')](respondWithResult(_0x520475,null))['catch'](handleError(_0x520475,null));};exports['getAvatar']=function(_0x371918,_0x3068b8){var _0x2951f4=path[_0x5973('0xad')](config[_0x5973('0xae')],_0x5973('0xaf'));return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0x371918[_0x5973('0x4f')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x3068b8,null))[_0x5973('0x25')](function(_0x17480e){if(_0x17480e){if(_[_0x5973('0x63')](_0x17480e[_0x5973('0xab')])){return _0x3068b8[_0x5973('0xb0')](_0x2951f4);}else{if(!fs[_0x5973('0xb1')](path[_0x5973('0xad')](config[_0x5973('0xae')],_0x5973('0xb2'),_0x17480e['userpic']))){return _0x3068b8['download'](_0x2951f4);}return _0x3068b8[_0x5973('0xb0')](path[_0x5973('0xad')](config[_0x5973('0xae')],_0x5973('0xb2'),_0x17480e[_0x5973('0xab')]));}}})['catch'](handleError(_0x3068b8,null));};exports['getOpenTabs']=function(_0x365544,_0x2e2b6d){return db[_0x5973('0x38')]['find']({'where':{'id':_0x365544[_0x5973('0x4f')]['id']},'attributes':['id']})[_0x5973('0x25')](handleEntityNotFound(_0x2e2b6d,null))['then'](function(_0xb906e3){var _0x508584=[];values=_0xb906e3[_0x5973('0x49')];_0x508584['push'](get_open_tabs(_0x5973('0x48'),_0xb906e3['dataValues']));_0x508584[_0x5973('0x44')](get_open_tabs(_0x5973('0x4a'),_0xb906e3['dataValues']));_0x508584[_0x5973('0x44')](get_open_tabs(_0x5973('0x4c'),_0xb906e3[_0x5973('0x49')]));_0x508584[_0x5973('0x44')](get_open_tabs(_0x5973('0xb3'),_0xb906e3[_0x5973('0x49')]));_0x508584['push'](get_open_tabs(_0x5973('0x4b'),_0xb906e3['dataValues']));_0x508584['push'](get_open_tabs(_0x5973('0xb4'),_0xb906e3[_0x5973('0x49')]));return BPromise[_0x5973('0x4d')](_0x508584);})['then'](function(_0x4001fd){if(_0x4001fd){var _0x921d4c=_[_0x5973('0x30')](values[_0x5973('0xb5')],function(_0x48f375){return{'channel':_0x5973('0xb6'),'id':_0x48f375['id'],'createdAt':_0x48f375[_0x5973('0xb7')]};});var _0x1db8c3=_[_0x5973('0x30')](values['FaxOpenTabs'],function(_0x2cb807){return{'channel':_0x5973('0xb8'),'id':_0x2cb807['id'],'createdAt':_0x2cb807[_0x5973('0xb7')]};});var _0xc49abb=_['map'](values['OpenchannelOpenTabs'],function(_0x22f553){return{'channel':_0x5973('0xb9'),'id':_0x22f553['id'],'createdAt':_0x22f553[_0x5973('0xb7')]};});var _0xe4435a=_[_0x5973('0x30')](values['MailOpenTabs'],function(_0x14e415){return{'channel':_0x5973('0xba'),'id':_0x14e415['id'],'createdAt':_0x14e415[_0x5973('0xb7')]};});var _0x56259e=_[_0x5973('0x30')](values[_0x5973('0xbb')],function(_0x1ddd8e){return{'channel':_0x5973('0xbc'),'id':_0x1ddd8e['id'],'createdAt':_0x1ddd8e['createdAt']};});var _0x49bfba=_['map'](values[_0x5973('0xbd')],function(_0x48a0cd){return{'channel':_0x5973('0xbe'),'id':_0x48a0cd['id'],'createdAt':_0x48a0cd[_0x5973('0xb7')]};});var _0x488d05=_[_0x5973('0xbf')](_0x921d4c,_0x1db8c3,_0xc49abb,_0xe4435a,_0x56259e,_0x49bfba);var _0x4558ff={'count':_0x488d05['length'],'rows':_0x488d05};return _0x4558ff;}else return null;})[_0x5973('0x25')](respondWithResult(_0x2e2b6d,null))[_0x5973('0x19')](handleError(_0x2e2b6d,null));};exports[_0x5973('0xc0')]=function(_0x42bd70,_0x3a5eb8){var _0x3486e6={};var _0x51bb93={};var _0x286de0;var _0x43e330;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x42bd70[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x3a5eb8,null))[_0x5973('0x25')](function(_0x5e7271){if(_0x5e7271){_0x286de0=_0x5e7271;_0x51bb93[_0x5973('0x50')]=_[_0x5973('0x52')](db[_0x5973('0xc1')][_0x5973('0x39')]);_0x51bb93['query']=_[_0x5973('0x52')](_0x42bd70[_0x5973('0x3f')]);_0x51bb93[_0x5973('0x54')]=_['intersection'](_0x51bb93[_0x5973('0x50')],_0x51bb93[_0x5973('0x3f')]);_0x3486e6[_0x5973('0x43')]=_['intersection'](_0x51bb93[_0x5973('0x50')],qs[_0x5973('0x56')](_0x42bd70[_0x5973('0x3f')]['fields']));_0x3486e6[_0x5973('0x43')]=_0x3486e6[_0x5973('0x43')][_0x5973('0x47')]?_0x3486e6['attributes']:_0x51bb93[_0x5973('0x50')];_0x3486e6[_0x5973('0xc2')]=qs['sort'](_0x42bd70['query']['sort']);_0x3486e6[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x42bd70[_0x5973('0x3f')],_0x51bb93[_0x5973('0x54')]));if(_0x42bd70[_0x5973('0x3f')][_0x5973('0x2e')]){_0x3486e6[_0x5973('0x3e')]=_['merge'](_0x3486e6['where'],{'$or':_[_0x5973('0x30')](_0x3486e6[_0x5973('0x43')],function(_0x1fe82a){var _0x5545dd={};_0x5545dd[_0x1fe82a]={'$like':'%'+_0x42bd70['query'][_0x5973('0x2e')]+'%'};return _0x5545dd;})});}_0x3486e6=_[_0x5973('0x58')]({},_0x3486e6,_0x42bd70[_0x5973('0x59')]);return _0x286de0[_0x5973('0xc0')](_0x3486e6);}})[_0x5973('0x25')](function(_0xed73d0){if(_0xed73d0){_0x43e330=_0xed73d0[_0x5973('0x47')];if(_0x42bd70[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xc5'))){_0x3486e6[_0x5973('0x40')]=[{'model':db['CmList'],'as':_0x5973('0xc6'),'required':![]},{'model':db[_0x5973('0xc7')],'as':_0x5973('0xc8'),'attributes':['id',_0x5973('0x36'),'color'],'where':_0x42bd70['query'][_0x5973('0xc9')]?{'id':_0x42bd70['query'][_0x5973('0xc9')]}:undefined,'required':_0x42bd70[_0x5973('0x3f')][_0x5973('0xc9')]?!![]:![]}];}if(!_0x42bd70['query']['hasOwnProperty'](_0x5973('0xca'))){_0x3486e6[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x42bd70[_0x5973('0x3f')][_0x5973('0x20')]);_0x3486e6[_0x5973('0x1e')]=qs[_0x5973('0x1e')](_0x42bd70['query'][_0x5973('0x1e')]);}return _0x286de0['getContacts'](_0x3486e6);}})['then'](function(_0x8fa948){if(_0x8fa948){return _0x8fa948?{'count':_0x43e330,'rows':_0x8fa948}:null;}})[_0x5973('0x25')](respondWithResult(_0x3a5eb8,null))[_0x5973('0x19')](handleError(_0x3a5eb8,null));};exports[_0x5973('0xcb')]=function(_0x3214af,_0x3d19a9){var _0x1ca415;var _0x2a1d03={};var _0x27a6b9;return db[_0x5973('0x38')]['findOne']({'where':{'id':_0x3214af[_0x5973('0x4f')]['id']},'attributes':['id',_0x5973('0x36'),_0x5973('0x27')]})[_0x5973('0x25')](handleEntityNotFound(_0x3d19a9,null))[_0x5973('0x25')](function(_0x999a2d){if(!utils['isValidChannel'](_0x3214af[_0x5973('0x3f')][_0x5973('0xa5')])){throw new db[(_0x5973('0x8a'))]['ValidationError'](_0x5973('0x99'));}_0x1ca415=_0x999a2d;var _0x113c08={};_0x113c08[_0x5973('0x50')]=_[_0x5973('0x52')](db[_[_0x5973('0x9b')](_0x3214af[_0x5973('0x3f')][_0x5973('0xa5')])+'Queue']['rawAttributes']);_0x113c08['query']=_[_0x5973('0x52')](_0x3214af[_0x5973('0x3f')]);_0x113c08[_0x5973('0x54')]=_['intersection'](_0x113c08['model'],_0x113c08[_0x5973('0x3f')]);_0x2a1d03[_0x5973('0x43')]=_[_0x5973('0x55')](_0x113c08[_0x5973('0x50')],qs['fields'](_0x3214af[_0x5973('0x3f')][_0x5973('0x56')]));_0x2a1d03['attributes']=_0x2a1d03[_0x5973('0x43')][_0x5973('0x47')]?_0x2a1d03[_0x5973('0x43')]:_0x113c08[_0x5973('0x50')];_0x2a1d03[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x3214af[_0x5973('0x3f')]['sort']);_0x2a1d03[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x3214af[_0x5973('0x3f')],_0x113c08[_0x5973('0x54')]));if(_0x3214af[_0x5973('0x3f')][_0x5973('0x2e')]){_0x2a1d03[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x2a1d03['where'],{'$or':_[_0x5973('0x30')](_0x2a1d03['attributes'],function(_0x4b0f2b){var _0x2bf75f={};_0x2bf75f[_0x4b0f2b]={'$like':'%'+_0x3214af[_0x5973('0x3f')]['filter']+'%'};return _0x2bf75f;})});}_0x2a1d03=_['merge']({},_0x2a1d03,_0x3214af[_0x5973('0x59')]);switch(_0x1ca415[_0x5973('0x27')]){case _0x5973('0x28'):return db[_[_0x5973('0x9b')](_0x3214af[_0x5973('0x3f')][_0x5973('0xa5')])+_0x5973('0xcd')][_0x5973('0x86')](_0x2a1d03);case _0x5973('0x29'):case _0x5973('0x2b'):return _0x1ca415[_0x5973('0xce')+_[_0x5973('0x9b')](_0x3214af[_0x5973('0x3f')][_0x5973('0xa5')])+_0x5973('0xa6')](_0x2a1d03);default:throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))]('Unknown\x20role');}})[_0x5973('0x25')](function(_0x58f9f2){_0x27a6b9=_0x58f9f2['length'];if(!_0x3214af['query'][_0x5973('0xc4')]('nolimit')){_0x2a1d03[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x3214af[_0x5973('0x3f')][_0x5973('0x20')]);_0x2a1d03[_0x5973('0x1e')]=qs[_0x5973('0x1e')](_0x3214af[_0x5973('0x3f')]['offset']);}switch(_0x1ca415[_0x5973('0x27')]){case'admin':return db[_[_0x5973('0x9b')](_0x3214af[_0x5973('0x3f')][_0x5973('0xa5')])+_0x5973('0xcd')][_0x5973('0x86')](_0x2a1d03);case _0x5973('0x29'):case _0x5973('0x2b'):return _0x1ca415['get'+_[_0x5973('0x9b')](_0x3214af[_0x5973('0x3f')]['channel'])+_0x5973('0xa6')](_0x2a1d03);}})['then'](function(_0x5b77bb){return{'count':_0x27a6b9,'rows':_0x5b77bb};})[_0x5973('0x25')](respondWithResult(_0x3d19a9,null))['catch'](handleError(_0x3d19a9,null));};exports['getVoiceQueuesRt']=function(_0x4a3bc5,_0x1ac60b){var _0x2a954a={};var _0x1484e4={};var _0xf09d26;var _0x16c808;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x4a3bc5['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x1ac60b,null))[_0x5973('0x25')](function(_0x5ab117){if(_0x5ab117){_0xf09d26=_0x5ab117;_0x1484e4['model']=_[_0x5973('0x52')](db[_0x5973('0xcf')]['rawAttributes']);_0x1484e4['query']=_['keys'](_0x4a3bc5[_0x5973('0x3f')]);_0x1484e4[_0x5973('0x54')]=_['intersection'](_0x1484e4[_0x5973('0x50')],_0x1484e4[_0x5973('0x3f')]);_0x2a954a[_0x5973('0x43')]=_[_0x5973('0x55')](_0x1484e4['model'],qs[_0x5973('0x56')](_0x4a3bc5[_0x5973('0x3f')][_0x5973('0x56')]));_0x2a954a['attributes']=_0x2a954a[_0x5973('0x43')][_0x5973('0x47')]?_0x2a954a['attributes']:_0x1484e4[_0x5973('0x50')];_0x2a954a[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x4a3bc5[_0x5973('0x3f')][_0x5973('0xcc')]);_0x2a954a[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x4a3bc5[_0x5973('0x3f')],_0x1484e4[_0x5973('0x54')]));if(_0x4a3bc5['query'][_0x5973('0x2e')]){_0x2a954a[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x2a954a['where'],{'$or':_[_0x5973('0x30')](_0x2a954a['attributes'],function(_0x5d283e){var _0x72f59d={};_0x72f59d[_0x5d283e]={'$like':'%'+_0x4a3bc5[_0x5973('0x3f')][_0x5973('0x2e')]+'%'};return _0x72f59d;})});}_0x2a954a=_[_0x5973('0x58')]({},_0x2a954a,_0x4a3bc5[_0x5973('0x59')]);return _0xf09d26[_0x5973('0xd0')](_0x2a954a);}})[_0x5973('0x25')](function(_0x3cc7ef){if(_0x3cc7ef){_0x16c808=_0x3cc7ef['length'];if(!_0x4a3bc5['query'][_0x5973('0xc4')](_0x5973('0xca'))){_0x2a954a[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x4a3bc5[_0x5973('0x3f')][_0x5973('0x20')]);_0x2a954a[_0x5973('0x1e')]=qs['offset'](_0x4a3bc5['query'][_0x5973('0x1e')]);}return _0xf09d26[_0x5973('0xd0')](_0x2a954a);}})['then'](function(_0x45e930){if(_0x45e930){return _0x45e930?{'count':_0x16c808,'rows':_0x45e930}:null;}})[_0x5973('0x25')](respondWithResult(_0x1ac60b,null))['catch'](handleError(_0x1ac60b,null));};exports[_0x5973('0xd1')]=function(_0x50c5db,_0x33a8b4){var _0x30527c={};var _0x1cd4dc={};var _0x265f9e;var _0x14d739;return db['User'][_0x5973('0x90')]({'where':{'id':_0x50c5db[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x33a8b4,null))['then'](function(_0x31b5d6){if(_0x31b5d6){_0x265f9e=_0x31b5d6;_0x1cd4dc[_0x5973('0x50')]=_[_0x5973('0x52')](db[_0x5973('0xd2')][_0x5973('0x39')]);_0x1cd4dc[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x50c5db[_0x5973('0x3f')]);_0x1cd4dc[_0x5973('0x54')]=_['intersection'](_0x1cd4dc[_0x5973('0x50')],_0x1cd4dc[_0x5973('0x3f')]);_0x30527c[_0x5973('0x43')]=_[_0x5973('0x55')](_0x1cd4dc[_0x5973('0x50')],qs[_0x5973('0x56')](_0x50c5db[_0x5973('0x3f')][_0x5973('0x56')]));_0x30527c[_0x5973('0x43')]=_0x30527c[_0x5973('0x43')]['length']?_0x30527c[_0x5973('0x43')]:_0x1cd4dc[_0x5973('0x50')];_0x30527c[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x50c5db['query']['sort']);_0x30527c[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x50c5db[_0x5973('0x3f')],_0x1cd4dc[_0x5973('0x54')]));if(_0x50c5db[_0x5973('0x3f')]['filter']){_0x30527c[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x30527c[_0x5973('0x3e')],{'$or':_['map'](_0x30527c['attributes'],function(_0x8b4dd8){var _0x33d763={};_0x33d763[_0x8b4dd8]={'$like':'%'+_0x50c5db['query'][_0x5973('0x2e')]+'%'};return _0x33d763;})});}_0x30527c=_[_0x5973('0x58')]({},_0x30527c,_0x50c5db[_0x5973('0x59')]);return _0x265f9e[_0x5973('0xd1')](_0x30527c);}})[_0x5973('0x25')](function(_0x13ae24){if(_0x13ae24){_0x14d739=_0x13ae24[_0x5973('0x47')];if(!_0x50c5db['query'][_0x5973('0xc4')](_0x5973('0xca'))){_0x30527c[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x50c5db[_0x5973('0x3f')][_0x5973('0x20')]);_0x30527c['offset']=qs['offset'](_0x50c5db[_0x5973('0x3f')]['offset']);}return _0x265f9e[_0x5973('0xd1')](_0x30527c);}})[_0x5973('0x25')](function(_0x487a64){if(_0x487a64){return _0x487a64?{'count':_0x14d739,'rows':_0x487a64}:null;}})[_0x5973('0x25')](respondWithResult(_0x33a8b4,null))['catch'](handleError(_0x33a8b4,null));};exports[_0x5973('0xd3')]=function(_0x378516,_0x1b5ffc){var _0xc279a3={'raw':!![],'where':{}};var _0x3dd6a7={};var _0x4a2f19={'count':0x0,'rows':[]};return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x378516['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x1b5ffc,null))[_0x5973('0x25')](function(_0x43e7cf){if(_0x43e7cf){_0x3dd6a7['model']=_[_0x5973('0x52')](db[_0x5973('0xd4')][_0x5973('0x39')]);_0x3dd6a7[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x378516[_0x5973('0x3f')]);_0x3dd6a7['filters']=_['intersection'](_0x3dd6a7['model'],_0x3dd6a7['query']);_0xc279a3['attributes']=_['intersection'](_0x3dd6a7['model'],qs[_0x5973('0x56')](_0x378516[_0x5973('0x3f')][_0x5973('0x56')]));_0xc279a3[_0x5973('0x43')]=_0xc279a3['attributes'][_0x5973('0x47')]?_0xc279a3[_0x5973('0x43')]:_0x3dd6a7[_0x5973('0x50')];if(!_0x378516['query'][_0x5973('0xc4')]('nolimit')){_0xc279a3[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x378516['query'][_0x5973('0x20')]);_0xc279a3[_0x5973('0x1e')]=qs['offset'](_0x378516['query'][_0x5973('0x1e')]);}_0xc279a3[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x378516[_0x5973('0x3f')]['sort']);_0xc279a3[_0x5973('0x3e')]=qs['filters'](_[_0x5973('0xc3')](_0x378516[_0x5973('0x3f')],_0x3dd6a7[_0x5973('0x54')]));_0xc279a3[_0x5973('0x3e')][_0x5973('0xd5')]=_0x43e7cf['id'];if(_0x378516[_0x5973('0x3f')][_0x5973('0x2e')]){_0xc279a3['where']=_[_0x5973('0x58')](_0xc279a3[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0xc279a3[_0x5973('0x43')],function(_0x2262c4){var _0x256bb7={};_0x256bb7[_0x2262c4]={'$like':'%'+_0x378516['query'][_0x5973('0x2e')]+'%'};return _0x256bb7;})});}_0xc279a3=_[_0x5973('0x58')]({},_0xc279a3,_0x378516[_0x5973('0x59')]);return db['VoiceRecording'][_0x5973('0x21')]({'where':_0xc279a3[_0x5973('0x3e')]})[_0x5973('0x25')](function(_0x571847){_0x4a2f19[_0x5973('0x21')]=_0x571847;if(_0x378516[_0x5973('0x3f')][_0x5973('0xc5')]){_0xc279a3[_0x5973('0x40')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0xc279a3);})[_0x5973('0x25')](function(_0x2a75e2){_0x4a2f19['rows']=_0x2a75e2;return _0x4a2f19;});}})[_0x5973('0x25')](respondWithFilteredResult(_0x1b5ffc,_0xc279a3))[_0x5973('0x19')](handleError(_0x1b5ffc,null));};exports[_0x5973('0xd6')]=function(_0x42b6ad,_0x3df653){var _0x139252={'raw':!![],'where':{}};var _0x59f74e={};var _0x480c4d={'count':0x0,'rows':[]};return db['User'][_0x5973('0x90')]({'where':{'id':_0x42b6ad[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x3df653,null))[_0x5973('0x25')](function(_0x2550d4){if(_0x2550d4){_0x59f74e[_0x5973('0x50')]=_[_0x5973('0x52')](db['ScreenRecording'][_0x5973('0x39')]);_0x59f74e['query']=_[_0x5973('0x52')](_0x42b6ad[_0x5973('0x3f')]);_0x59f74e[_0x5973('0x54')]=_[_0x5973('0x55')](_0x59f74e['model'],_0x59f74e[_0x5973('0x3f')]);_0x139252[_0x5973('0x43')]=_[_0x5973('0x55')](_0x59f74e[_0x5973('0x50')],qs['fields'](_0x42b6ad[_0x5973('0x3f')][_0x5973('0x56')]));_0x139252[_0x5973('0x43')]=_0x139252[_0x5973('0x43')][_0x5973('0x47')]?_0x139252[_0x5973('0x43')]:_0x59f74e['model'];if(!_0x42b6ad[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xca'))){_0x139252[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x42b6ad[_0x5973('0x3f')][_0x5973('0x20')]);_0x139252[_0x5973('0x1e')]=qs[_0x5973('0x1e')](_0x42b6ad[_0x5973('0x3f')][_0x5973('0x1e')]);}_0x139252[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x42b6ad[_0x5973('0x3f')]['sort']);_0x139252['where']=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x42b6ad[_0x5973('0x3f')],_0x59f74e[_0x5973('0x54')]));_0x139252[_0x5973('0x3e')][_0x5973('0xd5')]=_0x2550d4['id'];if(_0x42b6ad[_0x5973('0x3f')]['filter']){_0x139252[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x139252[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x139252['attributes'],function(_0x37cfdc){var _0x5498a2={};_0x5498a2[_0x37cfdc]={'$like':'%'+_0x42b6ad[_0x5973('0x3f')][_0x5973('0x2e')]+'%'};return _0x5498a2;})});}_0x139252=_['merge']({},_0x139252,_0x42b6ad['options']);return db[_0x5973('0xd7')][_0x5973('0x21')]({'where':_0x139252[_0x5973('0x3e')]})['then'](function(_0x4e3e90){_0x480c4d[_0x5973('0x21')]=_0x4e3e90;if(_0x42b6ad[_0x5973('0x3f')][_0x5973('0xc5')]){_0x139252[_0x5973('0x40')]=[{'all':!![]}];}return db[_0x5973('0xd7')][_0x5973('0x86')](_0x139252);})['then'](function(_0x250477){_0x480c4d[_0x5973('0x45')]=_0x250477;return _0x480c4d;});}})[_0x5973('0x25')](respondWithFilteredResult(_0x3df653,_0x139252))[_0x5973('0x19')](handleError(_0x3df653,null));};exports[_0x5973('0xd8')]=function(_0xe3d5fe,_0x401ea4){var _0x22f0a4={};var _0x5ed513={};var _0xf591d6;var _0x1872dc;return db['User']['findOne']({'where':{'id':_0xe3d5fe[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x401ea4,null))[_0x5973('0x25')](function(_0x5ce223){if(_0x5ce223){_0xf591d6=_0x5ce223;_0x5ed513['model']=_['keys'](db[_0x5973('0xd9')][_0x5973('0x39')]);_0x5ed513['query']=_[_0x5973('0x52')](_0xe3d5fe[_0x5973('0x3f')]);_0x5ed513[_0x5973('0x54')]=_[_0x5973('0x55')](_0x5ed513[_0x5973('0x50')],_0x5ed513[_0x5973('0x3f')]);_0x22f0a4[_0x5973('0x43')]=_[_0x5973('0x55')](_0x5ed513[_0x5973('0x50')],qs[_0x5973('0x56')](_0xe3d5fe[_0x5973('0x3f')][_0x5973('0x56')]));_0x22f0a4[_0x5973('0x43')]=_0x22f0a4[_0x5973('0x43')]['length']?_0x22f0a4[_0x5973('0x43')]:_0x5ed513[_0x5973('0x50')];_0x22f0a4[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0xe3d5fe[_0x5973('0x3f')][_0x5973('0xcc')]);_0x22f0a4[_0x5973('0x3e')]=qs['filters'](_[_0x5973('0xc3')](_0xe3d5fe[_0x5973('0x3f')],_0x5ed513[_0x5973('0x54')]));if(_0xe3d5fe['query'][_0x5973('0x2e')]){_0x22f0a4[_0x5973('0x3e')]=_['merge'](_0x22f0a4[_0x5973('0x3e')],{'$or':_['map'](_0x22f0a4[_0x5973('0x43')],function(_0x1a8a8d){var _0x4b4b3e={};_0x4b4b3e[_0x1a8a8d]={'$like':'%'+_0xe3d5fe['query'][_0x5973('0x2e')]+'%'};return _0x4b4b3e;})});}_0x22f0a4=_['merge']({},_0x22f0a4,_0xe3d5fe[_0x5973('0x59')]);return _0xf591d6[_0x5973('0xd8')](_0x22f0a4);}})['then'](function(_0x12ce49){if(_0x12ce49){_0x1872dc=_0x12ce49['length'];if(!_0xe3d5fe[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xca'))){_0x22f0a4[_0x5973('0x20')]=qs['limit'](_0xe3d5fe[_0x5973('0x3f')][_0x5973('0x20')]);_0x22f0a4['offset']=qs[_0x5973('0x1e')](_0xe3d5fe['query']['offset']);}return _0xf591d6[_0x5973('0xd8')](_0x22f0a4);}})[_0x5973('0x25')](function(_0x4f74e1){if(_0x4f74e1){return _0x4f74e1?{'count':_0x1872dc,'rows':_0x4f74e1}:null;}})[_0x5973('0x25')](respondWithResult(_0x401ea4,null))[_0x5973('0x19')](handleError(_0x401ea4,null));};exports[_0x5973('0xda')]=function(_0x2b5813,_0x5f522c){var _0x4cca0c={};var _0x1266d1={};var _0x22e32d;var _0x1fe7ba;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x2b5813[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x5f522c,null))[_0x5973('0x25')](function(_0x4e4c5e){if(_0x4e4c5e){_0x22e32d=_0x4e4c5e;_0x1266d1[_0x5973('0x50')]=_[_0x5973('0x52')](db[_0x5973('0xdb')]['rawAttributes']);_0x1266d1[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x2b5813[_0x5973('0x3f')]);_0x1266d1[_0x5973('0x54')]=_[_0x5973('0x55')](_0x1266d1['model'],_0x1266d1[_0x5973('0x3f')]);_0x4cca0c[_0x5973('0x43')]=_['intersection'](_0x1266d1['model'],qs[_0x5973('0x56')](_0x2b5813[_0x5973('0x3f')][_0x5973('0x56')]));_0x4cca0c[_0x5973('0x43')]=_0x4cca0c[_0x5973('0x43')]['length']?_0x4cca0c['attributes']:_0x1266d1[_0x5973('0x50')];_0x4cca0c['order']=qs['sort'](_0x2b5813[_0x5973('0x3f')][_0x5973('0xcc')]);_0x4cca0c['where']=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x2b5813[_0x5973('0x3f')],_0x1266d1[_0x5973('0x54')]));if(_0x2b5813[_0x5973('0x3f')][_0x5973('0x2e')]){_0x4cca0c[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x4cca0c[_0x5973('0x3e')],{'$or':_['map'](_0x4cca0c['attributes'],function(_0x47b50a){var _0x240181={};_0x240181[_0x47b50a]={'$like':'%'+_0x2b5813['query']['filter']+'%'};return _0x240181;})});}_0x4cca0c=_['merge']({},_0x4cca0c,_0x2b5813[_0x5973('0x59')]);return _0x22e32d[_0x5973('0xda')](_0x4cca0c);}})[_0x5973('0x25')](function(_0x3c1e17){if(_0x3c1e17){_0x1fe7ba=_0x3c1e17[_0x5973('0x47')];if(!_0x2b5813[_0x5973('0x3f')]['hasOwnProperty'](_0x5973('0xca'))){_0x4cca0c[_0x5973('0x20')]=qs['limit'](_0x2b5813['query']['limit']);_0x4cca0c['offset']=qs[_0x5973('0x1e')](_0x2b5813[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x22e32d[_0x5973('0xda')](_0x4cca0c);}})['then'](function(_0x44eba6){if(_0x44eba6){return _0x44eba6?{'count':_0x1fe7ba,'rows':_0x44eba6}:null;}})[_0x5973('0x25')](respondWithResult(_0x5f522c,null))[_0x5973('0x19')](handleError(_0x5f522c,null));};exports[_0x5973('0xdc')]=function(_0x4cbafb,_0x2a25dd){var _0x38957d={'raw':!![],'where':{}};var _0x383544={};var _0x326acb={'count':0x0,'rows':[]};return db['User'][_0x5973('0x90')]({'where':{'id':_0x4cbafb['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x2a25dd,null))[_0x5973('0x25')](function(_0x13b20d){if(_0x13b20d){_0x383544[_0x5973('0x50')]=_['keys'](db[_0x5973('0xdd')][_0x5973('0x39')]);_0x383544[_0x5973('0x3f')]=_['keys'](_0x4cbafb[_0x5973('0x3f')]);_0x383544['filters']=_[_0x5973('0x55')](_0x383544[_0x5973('0x50')],_0x383544['query']);_0x38957d['attributes']=_[_0x5973('0x55')](_0x383544[_0x5973('0x50')],qs[_0x5973('0x56')](_0x4cbafb[_0x5973('0x3f')][_0x5973('0x56')]));_0x38957d[_0x5973('0x43')]=_0x38957d[_0x5973('0x43')][_0x5973('0x47')]?_0x38957d[_0x5973('0x43')]:_0x383544[_0x5973('0x50')];if(!_0x4cbafb['query'][_0x5973('0xc4')]('nolimit')){_0x38957d[_0x5973('0x20')]=qs['limit'](_0x4cbafb[_0x5973('0x3f')][_0x5973('0x20')]);_0x38957d['offset']=qs[_0x5973('0x1e')](_0x4cbafb['query'][_0x5973('0x1e')]);}_0x38957d[_0x5973('0xc2')]=qs['sort'](_0x4cbafb[_0x5973('0x3f')][_0x5973('0xcc')]);_0x38957d[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x4cbafb[_0x5973('0x3f')],_0x383544['filters']));_0x38957d[_0x5973('0x3e')][_0x5973('0xd5')]=_0x13b20d['id'];if(_0x4cbafb['query']['filter']){_0x38957d[_0x5973('0x3e')]=_['merge'](_0x38957d[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x38957d['attributes'],function(_0x49ae84){var _0x2f5de3={};_0x2f5de3[_0x49ae84]={'$like':'%'+_0x4cbafb[_0x5973('0x3f')][_0x5973('0x2e')]+'%'};return _0x2f5de3;})});}_0x38957d=_[_0x5973('0x58')]({},_0x38957d,_0x4cbafb[_0x5973('0x59')]);return db[_0x5973('0xdd')]['count']({'where':_0x38957d[_0x5973('0x3e')]})[_0x5973('0x25')](function(_0x3d336a){_0x326acb[_0x5973('0x21')]=_0x3d336a;if(_0x4cbafb['query'][_0x5973('0xc5')]){_0x38957d[_0x5973('0x40')]=[{'all':!![]}];}return db[_0x5973('0xdd')]['findAll'](_0x38957d);})[_0x5973('0x25')](function(_0x9f56dc){_0x326acb[_0x5973('0x45')]=_0x9f56dc;return _0x326acb;});}})[_0x5973('0x25')](respondWithFilteredResult(_0x2a25dd,_0x38957d))[_0x5973('0x19')](handleError(_0x2a25dd,null));};exports[_0x5973('0xde')]=function(_0x3d34c1,_0x56bc47){var _0xfb8609={};var _0x26ba42={};var _0x309538;var _0x933f60;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x3d34c1['params']['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x56bc47,null))[_0x5973('0x25')](function(_0x4aaa5f){if(_0x4aaa5f){_0x309538=_0x4aaa5f;_0x26ba42[_0x5973('0x50')]=_[_0x5973('0x52')](db['SmsInteraction'][_0x5973('0x39')]);_0x26ba42['query']=_[_0x5973('0x52')](_0x3d34c1[_0x5973('0x3f')]);_0x26ba42[_0x5973('0x54')]=_[_0x5973('0x55')](_0x26ba42['model'],_0x26ba42[_0x5973('0x3f')]);_0xfb8609[_0x5973('0x43')]=_[_0x5973('0x55')](_0x26ba42[_0x5973('0x50')],qs[_0x5973('0x56')](_0x3d34c1[_0x5973('0x3f')][_0x5973('0x56')]));_0xfb8609['attributes']=_0xfb8609[_0x5973('0x43')][_0x5973('0x47')]?_0xfb8609[_0x5973('0x43')]:_0x26ba42['model'];_0xfb8609[_0x5973('0xc2')]=qs['sort'](_0x3d34c1[_0x5973('0x3f')][_0x5973('0xcc')]);_0xfb8609[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x3d34c1[_0x5973('0x3f')],_0x26ba42[_0x5973('0x54')]));if(_0x3d34c1[_0x5973('0x3f')][_0x5973('0x2e')]){_0xfb8609[_0x5973('0x3e')]=_[_0x5973('0x58')](_0xfb8609[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0xfb8609[_0x5973('0x43')],function(_0x4583c9){var _0x5d575d={};_0x5d575d[_0x4583c9]={'$like':'%'+_0x3d34c1[_0x5973('0x3f')][_0x5973('0x2e')]+'%'};return _0x5d575d;})});}_0xfb8609=_[_0x5973('0x58')]({},_0xfb8609,_0x3d34c1[_0x5973('0x59')]);return _0x309538[_0x5973('0xde')](_0xfb8609);}})[_0x5973('0x25')](function(_0x671c2a){if(_0x671c2a){_0x933f60=_0x671c2a[_0x5973('0x47')];if(!_0x3d34c1['query']['hasOwnProperty'](_0x5973('0xca'))){_0xfb8609[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x3d34c1[_0x5973('0x3f')][_0x5973('0x20')]);_0xfb8609[_0x5973('0x1e')]=qs[_0x5973('0x1e')](_0x3d34c1[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x309538['getSmsInteractions'](_0xfb8609);}})[_0x5973('0x25')](function(_0x1d6c34){if(_0x1d6c34){return _0x1d6c34?{'count':_0x933f60,'rows':_0x1d6c34}:null;}})[_0x5973('0x25')](respondWithResult(_0x56bc47,null))[_0x5973('0x19')](handleError(_0x56bc47,null));};exports['getFaxInteractions']=function(_0x554f46,_0x142ccc){var _0x2adc45={};var _0x5c23ce={};var _0x55a1da;var _0x12c24a;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x554f46['params']['id']}})['then'](handleEntityNotFound(_0x142ccc,null))[_0x5973('0x25')](function(_0x3bc76e){if(_0x3bc76e){_0x55a1da=_0x3bc76e;_0x5c23ce[_0x5973('0x50')]=_[_0x5973('0x52')](db[_0x5973('0xdf')]['rawAttributes']);_0x5c23ce[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x554f46[_0x5973('0x3f')]);_0x5c23ce[_0x5973('0x54')]=_[_0x5973('0x55')](_0x5c23ce[_0x5973('0x50')],_0x5c23ce['query']);_0x2adc45[_0x5973('0x43')]=_[_0x5973('0x55')](_0x5c23ce[_0x5973('0x50')],qs['fields'](_0x554f46[_0x5973('0x3f')][_0x5973('0x56')]));_0x2adc45[_0x5973('0x43')]=_0x2adc45[_0x5973('0x43')][_0x5973('0x47')]?_0x2adc45[_0x5973('0x43')]:_0x5c23ce[_0x5973('0x50')];_0x2adc45[_0x5973('0xc2')]=qs['sort'](_0x554f46[_0x5973('0x3f')][_0x5973('0xcc')]);_0x2adc45[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x554f46[_0x5973('0x3f')],_0x5c23ce['filters']));if(_0x554f46['query'][_0x5973('0x2e')]){_0x2adc45[_0x5973('0x3e')]=_['merge'](_0x2adc45[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x2adc45[_0x5973('0x43')],function(_0x553a75){var _0x525dc5={};_0x525dc5[_0x553a75]={'$like':'%'+_0x554f46[_0x5973('0x3f')]['filter']+'%'};return _0x525dc5;})});}_0x2adc45=_[_0x5973('0x58')]({},_0x2adc45,_0x554f46[_0x5973('0x59')]);return _0x55a1da[_0x5973('0xe0')](_0x2adc45);}})[_0x5973('0x25')](function(_0x25bd67){if(_0x25bd67){_0x12c24a=_0x25bd67[_0x5973('0x47')];if(!_0x554f46[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xca'))){_0x2adc45[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x554f46['query'][_0x5973('0x20')]);_0x2adc45[_0x5973('0x1e')]=qs['offset'](_0x554f46[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x55a1da[_0x5973('0xe0')](_0x2adc45);}})['then'](function(_0x35d2b6){if(_0x35d2b6){return _0x35d2b6?{'count':_0x12c24a,'rows':_0x35d2b6}:null;}})['then'](respondWithResult(_0x142ccc,null))['catch'](handleError(_0x142ccc,null));};exports[_0x5973('0xe1')]=function(_0xf72bf4,_0x56d50f){var _0x46c973={};var _0x2d01db={};var _0x247a48;var _0x401fce;return db[_0x5973('0x38')]['findOne']({'where':{'id':_0xf72bf4['params']['id']}})['then'](handleEntityNotFound(_0x56d50f,null))[_0x5973('0x25')](function(_0x29ec88){if(_0x29ec88){_0x247a48=_0x29ec88;_0x2d01db[_0x5973('0x50')]=_[_0x5973('0x52')](db['WhatsappInteraction'][_0x5973('0x39')]);_0x2d01db['query']=_['keys'](_0xf72bf4[_0x5973('0x3f')]);_0x2d01db['filters']=_[_0x5973('0x55')](_0x2d01db[_0x5973('0x50')],_0x2d01db['query']);_0x46c973['attributes']=_[_0x5973('0x55')](_0x2d01db[_0x5973('0x50')],qs[_0x5973('0x56')](_0xf72bf4[_0x5973('0x3f')][_0x5973('0x56')]));_0x46c973[_0x5973('0x43')]=_0x46c973[_0x5973('0x43')][_0x5973('0x47')]?_0x46c973[_0x5973('0x43')]:_0x2d01db[_0x5973('0x50')];_0x46c973[_0x5973('0xc2')]=qs['sort'](_0xf72bf4[_0x5973('0x3f')][_0x5973('0xcc')]);_0x46c973[_0x5973('0x3e')]=qs['filters'](_[_0x5973('0xc3')](_0xf72bf4[_0x5973('0x3f')],_0x2d01db[_0x5973('0x54')]));if(_0xf72bf4['query'][_0x5973('0x2e')]){_0x46c973[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x46c973[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x46c973['attributes'],function(_0x1261c3){var _0x4c3e57={};_0x4c3e57[_0x1261c3]={'$like':'%'+_0xf72bf4[_0x5973('0x3f')][_0x5973('0x2e')]+'%'};return _0x4c3e57;})});}_0x46c973=_[_0x5973('0x58')]({},_0x46c973,_0xf72bf4[_0x5973('0x59')]);return _0x247a48[_0x5973('0xe1')](_0x46c973);}})[_0x5973('0x25')](function(_0x2ffdbd){if(_0x2ffdbd){_0x401fce=_0x2ffdbd[_0x5973('0x47')];if(!_0xf72bf4[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xca'))){_0x46c973[_0x5973('0x20')]=qs[_0x5973('0x20')](_0xf72bf4[_0x5973('0x3f')][_0x5973('0x20')]);_0x46c973['offset']=qs[_0x5973('0x1e')](_0xf72bf4[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x247a48['getWhatsappInteractions'](_0x46c973);}})[_0x5973('0x25')](function(_0x2b2e4a){if(_0x2b2e4a){return _0x2b2e4a?{'count':_0x401fce,'rows':_0x2b2e4a}:null;}})[_0x5973('0x25')](respondWithResult(_0x56d50f,null))[_0x5973('0x19')](handleError(_0x56d50f,null));};exports[_0x5973('0xe2')]=function(_0x57b15f,_0x428092,_0x48d0fd){var _0x5afca4;var _0x3a4f8b;var _0x2a7835;var _0xf5aa57=!_[_0x5973('0x63')](_0x57b15f[_0x5973('0x4f')]['id'])?_0x57b15f['params']['id']:!_[_0x5973('0x63')](_0x57b15f['user']['id'])?_0x57b15f['user']['id']:null;return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0xf5aa57,'role':{'$or':[_0x5973('0x28'),_0x5973('0x29'),_0x5973('0x2b')]}},'attributes':['id',_0x5973('0x36'),_0x5973('0xe3'),_0x5973('0xe4'),'role',_0x5973('0x5e'),_0x5973('0xe5')]})[_0x5973('0x25')](function(_0x47e0db){if(_0x47e0db){if(_0x47e0db[_0x5973('0x27')]===_0x5973('0x2b')){_0x5afca4=_0x47e0db;if(_0x57b15f[_0x5973('0x5a')]['interface']){_0x2a7835=util[_0x5973('0xa2')](_0x5973('0xe6'),_0x5afca4[_0x57b15f[_0x5973('0x5a')][_0x5973('0x97')]]);}else if(_0x57b15f[_0x5973('0x5a')][_0x5973('0xe7')]){_0x2a7835=util['format']('SIP/%s',_0x57b15f[_0x5973('0x5a')][_0x5973('0xe7')]);}else{_0x2a7835=util['format'](_0x5973('0xe8'),_0x5afca4[_0x5973('0x36')]);}socket['to'](util['format'](_0x5973('0xe9'),_0x5afca4[_0x5973('0x36')]))[_0x5973('0xa8')](_0x5973('0xea'),{'user':{'id':_0x5afca4['id'],'name':_0x5afca4[_0x5973('0x36')]},'ip':_0x57b15f[_0x5973('0xeb')]['x-forwarded-for']||_0x57b15f[_0x5973('0xec')][_0x5973('0xed')]||_0x57b15f[_0x5973('0xee')]['remoteAddress']||_0x57b15f[_0x5973('0xec')][_0x5973('0xee')]['remoteAddress']});return db[_0x5973('0xcf')][_0x5973('0x26')]({'where':{'membername':_0x5afca4[_0x5973('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x5973('0x8a'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x5973('0x25')](function(){if(_0x5afca4){return _0x5afca4[_0x5973('0xef')]({'raw':!![]});}})['then'](function(_0x5d0c6c){if(_0x5afca4){var _0x1988d8=[];if(_0x5d0c6c){_0x3a4f8b=_0x5d0c6c;if(_0x3a4f8b[_0x5973('0x47')]){for(var _0x4b9c9e=0x0;_0x4b9c9e<_0x3a4f8b['length'];_0x4b9c9e++){_0x1988d8[_0x5973('0x44')]({'membername':_0x5afca4[_0x5973('0x36')],'UserId':_0x5afca4['id'],'queue_name':_0x3a4f8b[_0x4b9c9e][_0x5973('0x36')],'VoiceQueueId':_0x3a4f8b[_0x4b9c9e]['id'],'interface':_0x2a7835,'paused':_0x5afca4['loginInPause']||![],'penalty':_0x3a4f8b[_0x4b9c9e]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x5973('0x83')](_0x1988d8,function(_0x26fa34){return db[_0x5973('0xcf')][_0x5973('0xa3')](_0x26fa34);});}}}})[_0x5973('0x25')](function(){if(_0x5afca4){return db[_0x5973('0xf0')][_0x5973('0x86')]({'where':{'membername':_0x5afca4['name'],'exitAt':null}});}})[_0x5973('0x25')](function(_0x578943){if(_0x5afca4){var _0x2cdb4b=[];_0x578943[_0x5973('0xf1')](function(_0x43ff6b){_0x2cdb4b[_0x5973('0x44')](_0x43ff6b[_0x5973('0x24')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x2cdb4b);}})['then'](function(){if(_0x5afca4){var _0x55d040=[];var _0x3fd19e=[];var _0x461a97=utils[_0x5973('0xf2')]();var _0x5a9edb={'membername':_0x5afca4[_0x5973('0x36')],'interface':_0x2a7835,'enterAt':moment()['format'](_0x5973('0xf3')),'role':_0x5afca4[_0x5973('0x27')],'internal':_0x5afca4['internal']};_0x461a97[_0x5973('0xf1')](function(_0xab1737){_0x55d040[_0x5973('0x44')](_['merge']({'channel':_0xab1737,'type':_0x5973('0xf4'),'data1':_0x57b15f[_0x5973('0x5a')][_0x5973('0xf5')],'data2':_0x2a7835},_0x5a9edb));if(_0x5afca4[_0x5973('0xe5')]){_0x3fd19e[_0x5973('0x44')](_['merge']({'channel':_0xab1737,'type':_0x5973('0xf6'),'data1':_0x5973('0xf7')},_0x5a9edb));}});return db[_0x5973('0xf0')][_0x5973('0xf8')](_0x55d040[_0x5973('0xbf')](_0x3fd19e),{'individualHooks':!![]});}})[_0x5973('0x25')](function(){if(_0x5afca4){return _0x5afca4[_0x5973('0x24')]({'online':!![],'lastLoginAt':moment()[_0x5973('0xa2')](_0x5973('0xf3')),'voicePause':_0x5afca4[_0x5973('0xe5')]||![],'mailPause':_0x5afca4[_0x5973('0xe5')]||![],'chatPause':_0x5afca4[_0x5973('0xe5')]||![],'faxPause':_0x5afca4[_0x5973('0xe5')]||![],'smsPause':_0x5afca4[_0x5973('0xe5')]||![],'openchannelPause':_0x5afca4[_0x5973('0xe5')]||![],'whatsappPause':_0x5afca4['loginInPause']||![],'pauseType':_0x5afca4[_0x5973('0xe5')]?'LOGININPAUSE':null,'interface':_0x2a7835,'lastPauseAt':moment()[_0x5973('0xa2')](_0x5973('0xf3'))});}})[_0x5973('0x25')](function(_0x554184){if(_0x57b15f[_0x5973('0xf9')]){return _0x48d0fd();}else{return BPromise[_0x5973('0xfa')](_0x554184)['then'](respondWithResult(_0x428092,null));}})[_0x5973('0x19')](handleError(_0x428092,null));};exports[_0x5973('0xfb')]=function(_0x2eb88b,_0x824664){var _0x4f91a4;return db['User'][_0x5973('0x33')]({'where':{'id':_0x2eb88b[_0x5973('0x4f')]['id'],'role':_0x5973('0x2b')},'attributes':['id',_0x5973('0x36'),'role']})[_0x5973('0x25')](handleEntityNotFound(_0x824664,null))[_0x5973('0x25')](function(_0x3ab715){if(_0x3ab715){_0x4f91a4=_0x3ab715;return db[_0x5973('0xcf')][_0x5973('0x26')]({'where':{'membername':_0x4f91a4['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x5973('0xf0')][_0x5973('0x86')]({'where':{'membername':_0x4f91a4[_0x5973('0x36')],'exitAt':null}});})['then'](function(_0xd0613f){var _0x589e5f=[];_0xd0613f[_0x5973('0xf1')](function(_0x4de6e2){_0x589e5f[_0x5973('0x44')](_0x4de6e2['update']({'exitAt':moment()[_0x5973('0xa2')](_0x5973('0xf3'))}));});return BPromise['all'](_0x589e5f);})[_0x5973('0x25')](function(){return _0x4f91a4[_0x5973('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5973('0x25')](respondWithResult(_0x824664,null))[_0x5973('0x19')](handleError(_0x824664,null));};exports[_0x5973('0xfc')]=function(_0x179156,_0xf561cf){var _0xcb3920;return db[_0x5973('0xcf')][_0x5973('0x24')]({'paused':0x1},{'where':{'UserId':_0x179156[_0x5973('0x4f')]['id']},'individualHooks':!![]})[_0x5973('0x25')](function(){return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0x179156[_0x5973('0x4f')]['id'],'role':'agent'},'attributes':['id','name',_0x5973('0x27'),_0x5973('0x5e'),_0x5973('0x97')]});})[_0x5973('0x25')](handleEntityNotFound(_0xf561cf,null))[_0x5973('0x25')](function(_0xb4297f){if(_0xb4297f){_0xcb3920=_0xb4297f;return respondWithRpcPromise('QueuePause',_0x5973('0xfc'),{'id':_0xcb3920['id'],'name':_0xcb3920['name'],'pause':!![]});}})[_0x5973('0x25')](function(){if(_0xcb3920){return db[_0x5973('0xf0')][_0x5973('0x86')]({'where':{'membername':_0xcb3920['name'],'type':_0x5973('0xf6'),'exitAt':null}});}})['then'](function(_0x1b638a){if(_0x1b638a[_0x5973('0x47')]){var _0x46c05b=moment()[_0x5973('0xa2')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xe75a2a=0x0,_0x3418ce=_0x1b638a[_0x5973('0x47')];_0xe75a2a<_0x3418ce;_0xe75a2a++){_0x1b638a[_0xe75a2a][_0x5973('0xfd')]({'exitAt':_0x46c05b});}}})[_0x5973('0x25')](function(){var _0x3e495c=[];var _0x46b3c0=utils[_0x5973('0xf2')]();_0x46b3c0[_0x5973('0xf1')](function(_0x5180d2){_0x3e495c[_0x5973('0x44')]({'channel':_0x5180d2,'membername':_0xcb3920[_0x5973('0x36')],'interface':_[_0x5973('0x63')](_0xcb3920[_0x5973('0x97')])?util[_0x5973('0xa2')](_0x5973('0xe8'),_0xcb3920[_0x5973('0x36')]):_0xcb3920['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x5973('0xf3')),'data1':_0x179156[_0x5973('0x5a')]['type']||_0x5973('0xfe'),'role':_0xcb3920[_0x5973('0x27')],'internal':_0xcb3920['internal']});});return db[_0x5973('0xf0')][_0x5973('0xf8')](_0x3e495c,{'individualHooks':!![]});})[_0x5973('0x25')](function(){return _0xcb3920[_0x5973('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x179156['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x5973('0xa2')](_0x5973('0xf3'))});})[_0x5973('0x25')](respondWithResult(_0xf561cf,null))['catch'](handleError(_0xf561cf,null));};exports[_0x5973('0xff')]=function(_0x425248,_0x3c09b4){var _0x363557;return db[_0x5973('0x38')][_0x5973('0x33')]({'where':{'id':_0x425248[_0x5973('0x4f')]['id']},'attributes':['id','name',_0x5973('0x27'),_0x5973('0x96'),_0x5973('0x100'),'chatPause','faxPause',_0x5973('0x101'),_0x5973('0x102'),_0x5973('0x103'),_0x5973('0x104'),_0x5973('0x105')]})['then'](handleEntityNotFound(_0x3c09b4,null))[_0x5973('0x25')](function(_0x32c2e6){if(_0x32c2e6){_0x363557=_0x32c2e6;if(_0x425248['body']['channel']&&!utils[_0x5973('0x98')](_0x425248[_0x5973('0x5a')][_0x5973('0xa5')])){throw new db[(_0x5973('0x8a'))][(_0x5973('0x8b'))]('Unknown\x20channel');}switch(_0x425248[_0x5973('0x5a')][_0x5973('0xa5')]){case _0x5973('0xa1'):return respondWithRpcPromise('QueuePause',_0x5973('0xff'),{'id':_0x363557['id'],'name':_0x363557[_0x5973('0x36')],'pause':![]})[_0x5973('0x25')](function(){return db[_0x5973('0xcf')][_0x5973('0x24')]({'paused':0x0},{'where':{'UserId':_0x363557['id']},'individualHooks':!![]});})[_0x5973('0x25')](function(){return db[_0x5973('0xf0')][_0x5973('0x33')]({'where':{'channel':_0x425248['body']['channel'],'membername':_0x363557[_0x5973('0x36')],'type':_0x5973('0xf6'),'exitAt':null}});})[_0x5973('0x25')](function(_0xf3c63c){if(_0xf3c63c){return _0xf3c63c[_0x5973('0x24')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5973('0x106')},{'individualHooks':!![]});}return null;})[_0x5973('0x25')](function(){return _0x363557['update']({'voicePause':![]});});case'mail':case _0x5973('0x48'):case _0x5973('0x4b'):case _0x5973('0x4a'):case _0x5973('0xb3'):case'openchannel':return db[_0x5973('0xf0')]['find']({'where':{'channel':_0x425248[_0x5973('0x5a')]['channel'],'membername':_0x363557[_0x5973('0x36')],'type':_0x5973('0xf6'),'exitAt':null}})[_0x5973('0x25')](function(_0x26d512){if(_0x26d512){return _0x26d512[_0x5973('0x24')]({'exitAt':moment()['format'](_0x5973('0xf3')),'data2':_0x5973('0x106')},{'individualHooks':!![]});}return null;})[_0x5973('0x25')](function(){var _0x5b6784={};_[_0x5973('0x22')](_0x5b6784,util[_0x5973('0xa2')](_0x5973('0x107'),_0x425248[_0x5973('0x5a')]['channel'],_0x5973('0x108')),![]);return _0x363557[_0x5973('0x24')](_0x5b6784);});default:return respondWithRpcPromise('QueuePause',_0x5973('0xff'),{'id':_0x363557['id'],'name':_0x363557[_0x5973('0x36')],'pause':![]})[_0x5973('0x25')](function(){return db[_0x5973('0xcf')]['update']({'paused':0x0},{'where':{'UserId':_0x363557['id']}});})[_0x5973('0x25')](function(){return db[_0x5973('0xf0')]['findAll']({'where':{'membername':_0x363557[_0x5973('0x36')],'type':_0x5973('0xf6'),'exitAt':null}});})[_0x5973('0x25')](function(_0x5e7538){var _0x19482b=[];_0x5e7538[_0x5973('0xf1')](function(_0x3e3c70){_0x19482b['push'](_0x3e3c70[_0x5973('0x24')]({'exitAt':moment()[_0x5973('0xa2')](_0x5973('0xf3')),'data2':_0x5973('0x106')}));});return BPromise[_0x5973('0x4d')](_0x19482b);})[_0x5973('0x25')](function(){return _0x363557[_0x5973('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x3c09b4,null))[_0x5973('0x19')](handleError(_0x3c09b4,null));};exports[_0x5973('0x109')]=function(_0x50b353,_0x2c78cd){var _0x263372={};var _0x4aad5c={};var _0x1d2c0d;var _0x4a99a8;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x50b353[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x2c78cd,null))['then'](function(_0x568ee3){if(_0x568ee3){_0x1d2c0d=_0x568ee3;_0x4aad5c[_0x5973('0x50')]=_[_0x5973('0x52')](db[_0x5973('0x10a')]['rawAttributes']);_0x4aad5c['query']=_[_0x5973('0x52')](_0x50b353[_0x5973('0x3f')]);_0x4aad5c[_0x5973('0x54')]=_[_0x5973('0x55')](_0x4aad5c['model'],_0x4aad5c[_0x5973('0x3f')]);_0x263372[_0x5973('0x43')]=_[_0x5973('0x55')](_0x4aad5c[_0x5973('0x50')],qs['fields'](_0x50b353[_0x5973('0x3f')][_0x5973('0x56')]));_0x263372[_0x5973('0x43')]=_0x263372['attributes']['length']?_0x263372['attributes']:_0x4aad5c[_0x5973('0x50')];_0x263372[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x50b353[_0x5973('0x3f')][_0x5973('0xcc')]);_0x263372[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x50b353[_0x5973('0x3f')],_0x4aad5c[_0x5973('0x54')]));if(_0x50b353[_0x5973('0x3f')][_0x5973('0x2e')]){_0x263372['where']=_[_0x5973('0x58')](_0x263372[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x263372[_0x5973('0x43')],function(_0x184fc9){var _0x32a4c2={};_0x32a4c2[_0x184fc9]={'$like':'%'+_0x50b353['query'][_0x5973('0x2e')]+'%'};return _0x32a4c2;})});}_0x263372=_[_0x5973('0x58')]({},_0x263372,_0x50b353[_0x5973('0x59')]);return _0x1d2c0d['getTeams'](_0x263372);}})[_0x5973('0x25')](function(_0x2493be){if(_0x2493be){_0x4a99a8=_0x2493be['length'];if(!_0x50b353[_0x5973('0x3f')][_0x5973('0xc4')](_0x5973('0xca'))){_0x263372[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x50b353[_0x5973('0x3f')][_0x5973('0x20')]);_0x263372['offset']=qs[_0x5973('0x1e')](_0x50b353[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x1d2c0d['getTeams'](_0x263372);}})['then'](function(_0x1b96af){if(_0x1b96af){return _0x1b96af?{'count':_0x4a99a8,'rows':_0x1b96af}:null;}})[_0x5973('0x25')](respondWithResult(_0x2c78cd,null))[_0x5973('0x19')](handleError(_0x2c78cd,null));};exports[_0x5973('0x10b')]=function(_0x33cf87,_0x5a102f){return db['User'][_0x5973('0x33')]({'where':{'id':_0x33cf87[_0x5973('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a102f,null))[_0x5973('0x25')](function(_0x22bfee){if(_0x22bfee){var _0x41b628=_0x22bfee[_0x5973('0xce')]({'plain':!![]});return _0x22bfee[_0x5973('0x10b')](_0x33cf87[_0x5973('0x5a')][_0x5973('0x9d')],_[_0x5973('0x5d')](_0x33cf87[_0x5973('0x5a')],[_0x5973('0x9d'),'id'])||{})['then'](function(){for(var _0x29a686=0x0;_0x29a686<_0x33cf87['body'][_0x5973('0x9d')]['length'];_0x29a686++){var _0x55e6da=[];var _0x1ab23f={};db[_0x5973('0x10a')]['findOne']({'where':{'id':_0x33cf87[_0x5973('0x5a')][_0x5973('0x9d')][_0x29a686]}})[_0x5973('0x25')](function(_0x1b0b99){_0x1ab23f=_0x1b0b99[_0x5973('0x49')];_0x55e6da[_0x5973('0x44')](_0x1b0b99[_0x5973('0xef')]()[_0x5973('0x25')](function(_0xbc393c){for(var _0x1f00db=0x0;_0x1f00db<_0xbc393c[_0x5973('0x47')];_0x1f00db++){_0xbc393c[_0x1f00db][_0x5973('0x10c')](_0x5973('0xa5'),'Voice');}return _0xbc393c;}));_0x55e6da[_0x5973('0x44')](_0x1b0b99[_0x5973('0x10d')]()[_0x5973('0x25')](function(_0x5d5b0e){for(var _0x43520e=0x0;_0x43520e<_0x5d5b0e['length'];_0x43520e++){_0x5d5b0e[_0x43520e][_0x5973('0x10c')](_0x5973('0xa5'),_0x5973('0x10e'));}return _0x5d5b0e;}));_0x55e6da[_0x5973('0x44')](_0x1b0b99[_0x5973('0x10f')]()[_0x5973('0x25')](function(_0x920e9b){for(var _0x27e036=0x0;_0x27e036<_0x920e9b['length'];_0x27e036++){_0x920e9b[_0x27e036][_0x5973('0x10c')]('channel',_0x5973('0x110'));}return _0x920e9b;}));_0x55e6da['push'](_0x1b0b99[_0x5973('0x111')]()[_0x5973('0x25')](function(_0x646df3){for(var _0x29f613=0x0;_0x29f613<_0x646df3[_0x5973('0x47')];_0x29f613++){_0x646df3[_0x29f613]['setDataValue'](_0x5973('0xa5'),_0x5973('0x112'));}return _0x646df3;}));_0x55e6da[_0x5973('0x44')](_0x1b0b99[_0x5973('0x113')]()['then'](function(_0x11fb8b){for(var _0x5158dd=0x0;_0x5158dd<_0x11fb8b['length'];_0x5158dd++){_0x11fb8b[_0x5158dd][_0x5973('0x10c')]('channel',_0x5973('0x114'));}return _0x11fb8b;}));_0x55e6da['push'](_0x1b0b99[_0x5973('0x115')]()['then'](function(_0x164479){for(var _0x38ff2a=0x0;_0x38ff2a<_0x164479[_0x5973('0x47')];_0x38ff2a++){_0x164479[_0x38ff2a]['setDataValue'](_0x5973('0xa5'),_0x5973('0x116'));}return _0x164479;}));_0x55e6da[_0x5973('0x44')](_0x1b0b99[_0x5973('0x117')]()[_0x5973('0x25')](function(_0x1b530f){for(var _0x5362fa=0x0;_0x5362fa<_0x1b530f['length'];_0x5362fa++){_0x1b530f[_0x5362fa][_0x5973('0x10c')](_0x5973('0xa5'),_0x5973('0x118'));}return _0x1b530f;}));return BPromise[_0x5973('0x4d')](_0x55e6da);})['then'](function(_0x69b348){var _0x5727ae=_[_0x5973('0x119')](_0x69b348);_0x55e6da=[];return db[_0x5973('0x65')]['transaction'](function(_0x12fd4d){for(var _0x2046fc=0x0;_0x2046fc<_0x5727ae[_0x5973('0x47')];_0x2046fc++){_0x55e6da[_0x5973('0x44')](_0x5727ae[_0x2046fc]['addAgent'](_0x41b628['id']),{'transaction':_0x12fd4d});}return BPromise['all'](_0x55e6da)[_0x5973('0x25')](function(){if(_0x41b628[_0x5973('0x95')]){return BPromise[_0x5973('0x83')](_[_0x5973('0x2e')](_0x5727ae,function(_0x104202){return _0x104202[_0x5973('0x11a')](_0x5973('0xa5'))===_0x5973('0x11b');}),function(_0x6fea48){return db[_0x5973('0xcf')]['upsert']({'membername':_0x41b628[_0x5973('0x36')],'UserId':_0x41b628['id'],'queue_name':_0x6fea48[_0x5973('0x36')],'VoiceQueueId':_0x6fea48['id'],'interface':_[_0x5973('0x63')](_0x41b628[_0x5973('0x97')])?util[_0x5973('0xa2')]('SIP/%s',_0x41b628['name']):_0x41b628[_0x5973('0x97')],'paused':_0x41b628[_0x5973('0x96')]||![],'penalty':_0x41b628['penalty']},{'transaction':_0x12fd4d});});}else{return;}})[_0x5973('0x25')](function(){for(var _0xd6ce3e=0x0;_0xd6ce3e<_0x5727ae[_0x5973('0x47')];_0xd6ce3e++){var _0x54d9b8=_0x5727ae[_0xd6ce3e][_0x5973('0x11a')](_0x5973('0xa5'));var _0x5d3cfe=_0x54d9b8+'QueueId';socket[_0x5973('0xa8')](_0x5973('0x29')+_0x54d9b8+_0x5973('0x11c'),{'UserId':_0x41b628['id'],['queueField']:_0x5727ae[_0xd6ce3e]['id']});}});});})['then'](function(){db[_0x5973('0x11d')][_0x5973('0x90')]({'where':{'teamId':_0x1ab23f['id']}})[_0x5973('0x25')](function(_0x457d50){if(_0x457d50){db['UserVoicePrefix'][_0x5973('0x7a')]({'UserId':_0x33cf87[_0x5973('0x4f')]['id'],'VoicePrefixId':_0x457d50[_0x5973('0x11e')]});}});});}});}})[_0x5973('0x25')](respondWithStatusCode(_0x5a102f,null))['catch'](handleError(_0x5a102f,null));};exports[_0x5973('0x11f')]=function(_0x5a300e,_0x388d9b){return db['User']['findOne']({'where':{'id':_0x5a300e[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x388d9b,null))['then'](function(_0x2005a0){if(_0x2005a0){var _0x19e45e=_0x2005a0[_0x5973('0xce')]({'plain':!![]});var _0x167c28=_0x5a300e['query']['ids'];return _0x2005a0['removeTeams'](_0x167c28)[_0x5973('0x25')](function(){for(var _0x3b7d06=0x0;_0x3b7d06<_0x167c28[_0x5973('0x47')];_0x3b7d06++){var _0x472332=[];var _0x17a84c={};db[_0x5973('0x10a')][_0x5973('0x90')]({'where':{'id':_0x167c28[_0x3b7d06]}})[_0x5973('0x25')](function(_0x8a3f89){_0x17a84c=_0x8a3f89[_0x5973('0x49')];_0x472332[_0x5973('0x44')](_0x8a3f89[_0x5973('0xef')]()[_0x5973('0x25')](function(_0x1ba0ba){for(var _0x182867=0x0;_0x182867<_0x1ba0ba[_0x5973('0x47')];_0x182867++){_0x1ba0ba[_0x182867][_0x5973('0x10c')](_0x5973('0xa5'),_0x5973('0x11b'));}return _0x1ba0ba;}));_0x472332[_0x5973('0x44')](_0x8a3f89[_0x5973('0x10d')]()[_0x5973('0x25')](function(_0x1c5fe8){for(var _0x6c3e6=0x0;_0x6c3e6<_0x1c5fe8[_0x5973('0x47')];_0x6c3e6++){_0x1c5fe8[_0x6c3e6][_0x5973('0x10c')]('channel','Chat');}return _0x1c5fe8;}));_0x472332[_0x5973('0x44')](_0x8a3f89['getMailQueues']()[_0x5973('0x25')](function(_0x122037){for(var _0x243f95=0x0;_0x243f95<_0x122037['length'];_0x243f95++){_0x122037[_0x243f95][_0x5973('0x10c')]('channel',_0x5973('0x110'));}return _0x122037;}));_0x472332[_0x5973('0x44')](_0x8a3f89[_0x5973('0x111')]()[_0x5973('0x25')](function(_0x257aa0){for(var _0x3658ab=0x0;_0x3658ab<_0x257aa0[_0x5973('0x47')];_0x3658ab++){_0x257aa0[_0x3658ab][_0x5973('0x10c')](_0x5973('0xa5'),'Sms');}return _0x257aa0;}));_0x472332['push'](_0x8a3f89[_0x5973('0x113')]()[_0x5973('0x25')](function(_0x383410){for(var _0xeda09d=0x0;_0xeda09d<_0x383410[_0x5973('0x47')];_0xeda09d++){_0x383410[_0xeda09d][_0x5973('0x10c')](_0x5973('0xa5'),'Whatsapp');}return _0x383410;}));_0x472332[_0x5973('0x44')](_0x8a3f89['getFaxQueues']()[_0x5973('0x25')](function(_0x152c44){for(var _0x4a3534=0x0;_0x4a3534<_0x152c44[_0x5973('0x47')];_0x4a3534++){_0x152c44[_0x4a3534][_0x5973('0x10c')](_0x5973('0xa5'),_0x5973('0x116'));}return _0x152c44;}));_0x472332[_0x5973('0x44')](_0x8a3f89['getOpenchannelQueues']()['then'](function(_0x505f9e){for(var _0x5d5614=0x0;_0x5d5614<_0x505f9e[_0x5973('0x47')];_0x5d5614++){_0x505f9e[_0x5d5614]['setDataValue']('channel',_0x5973('0x118'));}return _0x505f9e;}));return BPromise[_0x5973('0x4d')](_0x472332);})[_0x5973('0x25')](function(_0x2a1b3b){var _0x3a9a93=_[_0x5973('0x119')](_0x2a1b3b);_0x472332=[];return db[_0x5973('0x65')][_0x5973('0x120')](function(_0x3f4e3c){for(var _0x18eba4=0x0;_0x18eba4<_0x3a9a93['length'];_0x18eba4++){_0x472332[_0x5973('0x44')](_0x3a9a93[_0x18eba4][_0x5973('0x121')](_0x19e45e['id']),{'transaction':_0x3f4e3c});}return BPromise[_0x5973('0x4d')](_0x472332)[_0x5973('0x25')](function(){if(_0x19e45e[_0x5973('0x95')]){return BPromise[_0x5973('0x83')](_[_0x5973('0x2e')](_0x3a9a93,function(_0x2b1cde){return _0x2b1cde[_0x5973('0x11a')](_0x5973('0xa5'))===_0x5973('0x11b');}),function(_0x2ba163){return db[_0x5973('0xcf')]['destroy']({'where':{'VoiceQueueId':_0x2ba163['id'],'UserId':_0x19e45e['id']},'transaction':_0x3f4e3c});});}else{return;}})[_0x5973('0x25')](function(){db[_0x5973('0x11d')][_0x5973('0x90')]({'where':{'teamId':_0x17a84c['id']}})[_0x5973('0x25')](function(_0x8bc788){if(_0x8bc788){return db['UserVoicePrefix'][_0x5973('0x26')]({'where':{'UserId':_0x19e45e['id'],'VoicePrefixId':_0x8bc788[_0x5973('0x49')][_0x5973('0x11e')]}});}});})[_0x5973('0x25')](function(){for(var _0x519688=0x0;_0x519688<_0x3a9a93[_0x5973('0x47')];_0x519688++){var _0x33c532=_0x3a9a93[_0x519688][_0x5973('0x11a')](_0x5973('0xa5'));var _0x8315a5=_0x33c532+_0x5973('0x9f');socket[_0x5973('0xa8')](_0x5973('0x29')+_0x33c532+'Queue:remove',{'UserId':_0x19e45e['id'],['queueField']:_0x3a9a93[_0x519688]['id']});}});});});}});}})[_0x5973('0x25')](respondWithStatusCode(_0x388d9b,null))[_0x5973('0x19')](handleError(_0x388d9b,null));};exports['getLists']=function(_0x285758,_0x4384af){var _0x38d206={};var _0x508ab2={};var _0x117c3a;var _0x294d91;return db[_0x5973('0x38')]['findOne']({'where':{'id':_0x285758[_0x5973('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4384af,null))[_0x5973('0x25')](function(_0x21b2a4){if(_0x21b2a4){_0x117c3a=_0x21b2a4;_0x508ab2['model']=_[_0x5973('0x52')](db['CmList'][_0x5973('0x39')]);_0x508ab2[_0x5973('0x3f')]=_[_0x5973('0x52')](_0x285758[_0x5973('0x3f')]);_0x508ab2[_0x5973('0x54')]=_[_0x5973('0x55')](_0x508ab2[_0x5973('0x50')],_0x508ab2['query']);_0x38d206[_0x5973('0x43')]=_[_0x5973('0x55')](_0x508ab2[_0x5973('0x50')],qs[_0x5973('0x56')](_0x285758['query'][_0x5973('0x56')]));_0x38d206[_0x5973('0x43')]=_0x38d206[_0x5973('0x43')][_0x5973('0x47')]?_0x38d206['attributes']:_0x508ab2[_0x5973('0x50')];_0x38d206[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x285758['query'][_0x5973('0xcc')]);_0x38d206[_0x5973('0x3e')]=qs[_0x5973('0x54')](_[_0x5973('0xc3')](_0x285758[_0x5973('0x3f')],_0x508ab2[_0x5973('0x54')]));if(_0x285758['query'][_0x5973('0x2e')]){_0x38d206['where']=_[_0x5973('0x58')](_0x38d206[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x38d206[_0x5973('0x43')],function(_0x466c82){var _0x406a0d={};_0x406a0d[_0x466c82]={'$like':'%'+_0x285758['query'][_0x5973('0x2e')]+'%'};return _0x406a0d;})});}_0x38d206=_['merge']({},_0x38d206,_0x285758[_0x5973('0x59')]);return _0x117c3a['getLists'](_0x38d206);}})['then'](function(_0x3c4e4f){if(_0x3c4e4f){_0x294d91=_0x3c4e4f[_0x5973('0x47')];if(!_0x285758[_0x5973('0x3f')]['hasOwnProperty'](_0x5973('0xca'))){_0x38d206[_0x5973('0x20')]=qs[_0x5973('0x20')](_0x285758[_0x5973('0x3f')][_0x5973('0x20')]);_0x38d206[_0x5973('0x1e')]=qs[_0x5973('0x1e')](_0x285758[_0x5973('0x3f')][_0x5973('0x1e')]);}return _0x117c3a[_0x5973('0x122')](_0x38d206);}})[_0x5973('0x25')](function(_0x55684d){if(_0x55684d){return _0x55684d?{'count':_0x294d91,'rows':_0x55684d}:null;}})[_0x5973('0x25')](respondWithResult(_0x4384af,null))[_0x5973('0x19')](handleError(_0x4384af,null));};exports[_0x5973('0x123')]=function(_0x54eeb2,_0x5b0af8){var _0x3a7ee2={};var _0x512d5f={};var _0x20b037;return db[_0x5973('0x38')][_0x5973('0x90')]({'where':{'id':_0x54eeb2[_0x5973('0x4f')]['id']}})[_0x5973('0x25')](handleEntityNotFound(_0x5b0af8,null))[_0x5973('0x25')](function(_0x2b0690){if(_0x2b0690){_0x20b037=_0x2b0690;_0x512d5f[_0x5973('0x50')]=_[_0x5973('0x52')](db['User'][_0x5973('0x39')]);_0x512d5f['query']=_[_0x5973('0x52')](_0x54eeb2['query']);_0x512d5f[_0x5973('0x54')]=_['intersection'](_0x512d5f[_0x5973('0x50')],_0x512d5f[_0x5973('0x3f')]);_0x3a7ee2[_0x5973('0x43')]=_[_0x5973('0x55')](_0x512d5f[_0x5973('0x50')],qs[_0x5973('0x56')](_0x54eeb2[_0x5973('0x3f')]['fields']));_0x3a7ee2['attributes']=_0x3a7ee2[_0x5973('0x43')][_0x5973('0x47')]?_0x3a7ee2[_0x5973('0x43')]:_0x512d5f[_0x5973('0x50')];_0x3a7ee2[_0x5973('0xc2')]=qs[_0x5973('0xcc')](_0x54eeb2[_0x5973('0x3f')][_0x5973('0xcc')]);_0x3a7ee2[_0x5973('0x3e')]=qs[_0x5973('0x54')](_['pick'](_0x54eeb2[_0x5973('0x3f')],_0x512d5f[_0x5973('0x54')]));if(_0x54eeb2[_0x5973('0x3f')][_0x5973('0x2e')]){_0x3a7ee2[_0x5973('0x3e')]=_[_0x5973('0x58')](_0x3a7ee2[_0x5973('0x3e')],{'$or':_[_0x5973('0x30')](_0x3a7ee2['attributes'],function(_0x13631a){var _0x554dd2={};_0x554dd2[_0x13631a]={'$like':'%'+_0x54eeb2['query'][_0x5973('0x2e')]+'%'};return _0x554dd2;})});}_0x3a7ee2[_0x5973('0x50')]=db['User'];_0x3a7ee2['as']='Agents';_0x3a7ee2=_[_0x5973('0x58')]({},_0x3a7ee2,_0x54eeb2['options']);return _0x20b037['getVoiceQueues']({'include':[_0x3a7ee2]});}})[_0x5973('0x25')](function(_0x266bb1){if(_0x266bb1){var _0x491e1e={},_0x9ff1d3=[];for(var _0x1133a8=0x0;_0x1133a8<_0x266bb1[_0x5973('0x47')];_0x1133a8+=0x1){for(var _0x23b855=0x0,_0x2bf5b6;_0x23b855<_0x266bb1[_0x1133a8]['Agents'][_0x5973('0x47')];_0x23b855+=0x1){_0x2bf5b6=_0x266bb1[_0x1133a8]['Agents'][_0x23b855][_0x5973('0xce')]({'plain':!![]});_0x491e1e[_0x2bf5b6['id']]=_0x2bf5b6;}}_0x491e1e=_[_0x5973('0x124')](_0x491e1e);for(var _0x4dad9f=qs[_0x5973('0x1e')](_0x54eeb2['query'][_0x5973('0x1e')]);_0x4dad9f<_0x491e1e[_0x5973('0x47')]&&_0x9ff1d3[_0x5973('0x47')]=_0x426d03){_0x1ff155=_0x426d03;_0x44d83b=0xc8;}else{_0x44d83b=0xce;}_0x39081d[_0xbe91('0x21')](_0x44d83b);return _0x39081d['set']('Content-Range',_0x3ddf5d+'-'+_0x1ff155+'/'+_0x426d03)[_0xbe91('0x22')](_0x9582ca);}return null;};}function saveUpdates(_0x28506){return function(_0x5a7a70){if(_0x5a7a70){return _0x5a7a70[_0xbe91('0x27')](_0x28506)[_0xbe91('0x15')](function(_0x5eb552){return _0x5eb552;});}return null;};}function removeEntity(_0x23a14){return function(_0x25953e){if(_0x25953e){return _0x25953e['destroy']()[_0xbe91('0x15')](function(){var _0x5ad310=_0x25953e[_0xbe91('0x28')]({'plain':!![]});if(_0x5ad310['role']==='admin')return;var _0x2e7469=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':_0xbe91('0x29'),'ignore':![]},{'name':_0xbe91('0x2a'),'value':_0xbe91('0x2b'),'ignore':![]}];var _0x28ac86=_(_0x2e7469)[_0xbe91('0x2c')](_0xbe91('0x2d'))[_0xbe91('0x2e')](_0xbe91('0x2f'))['value']();if(_['includes'](_0x28ac86,_0x5ad310[_0xbe91('0x30')])){return;}var _0x21af29=_[_0xbe91('0x31')](_0x2e7469,['value',_0x5ad310[_0xbe91('0x30')]])['name'];return db[_0xbe91('0x32')][_0xbe91('0x33')]({'where':{'type':_0x21af29,'resourceId':_0x5ad310['id']}})[_0xbe91('0x15')](function(){return _0x25953e;});})[_0xbe91('0x15')](function(){_0x23a14[_0xbe91('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34431d){return function(_0x5e3aaa){if(!_0x5e3aaa){_0x34431d[_0xbe91('0x20')](0x194);}return _0x5e3aaa;};}function handleError(_0x3abfa7,_0x94d890){_0x94d890=_0x94d890||0x1f4;return function(_0x501ec9){logger[_0xbe91('0x1b')](_0x501ec9[_0xbe91('0x34')]);if(_0x501ec9['name']){delete _0x501ec9[_0xbe91('0x35')];}_0x3abfa7[_0xbe91('0x21')](_0x94d890)[_0xbe91('0x36')](_0x501ec9);};}exports[_0xbe91('0x37')]=function(_0x518b49,_0x292726){var _0x212299={},_0x4eb59d={'count':0x0,'rows':[]};var _0x168594=_(db[_0xbe91('0x38')][_0xbe91('0x39')])[_0xbe91('0x2e')](function(_0x1f9a48){return{'name':_0x1f9a48['fieldName'],'type':_0x1f9a48[_0xbe91('0x3a')]['key']};})['filter'](function(_0x310261){return!_[_0xbe91('0x3b')]([_0xbe91('0x3c'),_0xbe91('0x3d')],_0x310261['name']);})[_0xbe91('0x2f')]();_0x212299=qs['getOptions'](_0x168594,_0x518b49);var _0x113f0e={'where':_0x212299[_0xbe91('0x3e')]};return db[_0xbe91('0x38')][_0xbe91('0x26')](_0x113f0e)['then'](function(_0x3312c8){_0x4eb59d[_0xbe91('0x26')]=_0x3312c8;if(_0x518b49[_0xbe91('0x3f')][_0xbe91('0x40')]){_0x212299[_0xbe91('0x41')]=[{'all':!![]}];}if(_0x518b49[_0xbe91('0x3f')][_0xbe91('0x42')]===_0xbe91('0x43')){_0x212299[_0xbe91('0x41')]=[{'model':db[_0xbe91('0x44')],'as':_0xbe91('0x42')}];}if(!_['includes'](_0x212299[_0xbe91('0x45')],'id')){_0x212299[_0xbe91('0x45')]['push']('id');}return db[_0xbe91('0x38')][_0xbe91('0x46')](_0x212299);})['then'](function(_0x2ead74){_0x4eb59d[_0xbe91('0x47')]=_0x2ead74;if(_0x518b49[_0xbe91('0x3f')][_0xbe91('0x48')]===_0xbe91('0x43')){var _0x35405d=[];for(var _0x46ba66=0x0;_0x46ba66<_0x4eb59d['rows'][_0xbe91('0x49')];_0x46ba66++){_0x35405d[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4b'),_0x4eb59d[_0xbe91('0x47')][_0x46ba66]['dataValues']));_0x35405d['push'](get_open_tabs(_0xbe91('0x4c'),_0x4eb59d[_0xbe91('0x47')][_0x46ba66][_0xbe91('0x4d')]));_0x35405d[_0xbe91('0x4a')](get_open_tabs('fax',_0x4eb59d[_0xbe91('0x47')][_0x46ba66]['dataValues']));_0x35405d['push'](get_open_tabs(_0xbe91('0x4e'),_0x4eb59d['rows'][_0x46ba66][_0xbe91('0x4d')]));_0x35405d[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4f'),_0x4eb59d['rows'][_0x46ba66][_0xbe91('0x4d')]));_0x35405d[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x50'),_0x4eb59d['rows'][_0x46ba66][_0xbe91('0x4d')]));}return BPromise[_0xbe91('0x51')](_0x35405d)[_0xbe91('0x15')](function(){return _0x4eb59d;});}else{return _0x4eb59d;}})['then'](respondWithFilteredResult(_0x292726,_0x212299))['catch'](handleError(_0x292726,null));};exports[_0xbe91('0x52')]=function(_0x108d9a,_0x5cd73d){var _0x2186ba={'raw':![],'where':{'id':_0x108d9a[_0xbe91('0x53')]['id']}},_0xd9197d={};_0xd9197d[_0xbe91('0x54')]=_[_0xbe91('0x55')](_['keys'](db[_0xbe91('0x38')][_0xbe91('0x39')]),[_0xbe91('0x3c'),'salt']);_0xd9197d[_0xbe91('0x3f')]=_['keys'](_0x108d9a[_0xbe91('0x3f')]);_0xd9197d[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0xd9197d['model'],_0xd9197d[_0xbe91('0x3f')]);_0x2186ba[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0xd9197d[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x108d9a['query'][_0xbe91('0x58')]));_0x2186ba[_0xbe91('0x45')]=_0x2186ba['attributes'][_0xbe91('0x49')]?_0x2186ba[_0xbe91('0x45')]:_0xd9197d[_0xbe91('0x54')];if(_0x108d9a[_0xbe91('0x3f')][_0xbe91('0x40')]){_0x2186ba[_0xbe91('0x41')]=[{'all':!![]}];}if(_0x108d9a[_0xbe91('0x3f')]['userSetting']===_0xbe91('0x43')){_0x2186ba[_0xbe91('0x41')]=[{'model':db['UserSetting'],'as':_0xbe91('0x42')}];}_0x2186ba=_[_0xbe91('0x59')]({},_0x2186ba,_0x108d9a['options']);if(!_[_0xbe91('0x3b')](_0x2186ba['attributes'],'id')){_0x2186ba['attributes'][_0xbe91('0x4a')]('id');}return db[_0xbe91('0x38')][_0xbe91('0x31')](_0x2186ba)[_0xbe91('0x15')](handleEntityNotFound(_0x5cd73d,null))['then'](function(_0x47cf63){var _0x5601ef=[];values=_0x47cf63;if(_0x108d9a[_0xbe91('0x3f')][_0xbe91('0x48')]==='true'){_0x5601ef[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4b'),_0x47cf63[_0xbe91('0x4d')]));_0x5601ef[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4c'),_0x47cf63[_0xbe91('0x4d')]));_0x5601ef[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4f'),_0x47cf63[_0xbe91('0x4d')]));_0x5601ef['push'](get_open_tabs(_0xbe91('0x50'),_0x47cf63['dataValues']));_0x5601ef[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x5a'),_0x47cf63[_0xbe91('0x4d')]));_0x5601ef['push'](get_open_tabs(_0xbe91('0x4e'),_0x47cf63['dataValues']));return BPromise['all'](_0x5601ef);}else{return values;}})[_0xbe91('0x15')](function(){return values;})[_0xbe91('0x15')](respondWithResult(_0x5cd73d,null))['catch'](handleError(_0x5cd73d,null));};exports[_0xbe91('0x27')]=function(_0x4d1743,_0xb1e836){if(_0x4d1743[_0xbe91('0x5b')]['id']){delete _0x4d1743[_0xbe91('0x5b')]['id'];}delete _0x4d1743[_0xbe91('0x5b')]['role'];return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x4d1743[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0xb1e836,null))[_0xbe91('0x15')](saveUpdates(_0x4d1743[_0xbe91('0x5b')],null))[_0xbe91('0x15')](respondWithResult(_0xb1e836,null))['catch'](handleError(_0xb1e836,null));};exports[_0xbe91('0x5c')]=function(_0x29970d,_0x3b1dd9){return db[_0xbe91('0x38')][_0xbe91('0x5c')]()[_0xbe91('0x15')](respondWithResult(_0x3b1dd9,null))[_0xbe91('0x5d')](handleError(_0x3b1dd9,null));};exports[_0xbe91('0x5e')]=function(_0x2cdffb,_0x5b7866){return db['User']['find']({'where':{'id':_0x2cdffb['params']['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x5b7866,null))[_0xbe91('0x15')](function(_0x282e26){if(_0x282e26){return _0x282e26['addContacts'](_0x2cdffb[_0xbe91('0x5b')]['ids'],_[_0xbe91('0x5f')](_0x2cdffb[_0xbe91('0x5b')],['ids','id'])||{});}})[_0xbe91('0x15')](respondWithResult(_0x5b7866,null))[_0xbe91('0x5d')](handleError(_0x5b7866,null));};function validateUser(_0x2f225b){return new BPromise(function(_0x5e881a,_0x2caf77){if(_0x2f225b[_0xbe91('0x60')])return _0x5e881a(_0x2f225b);return db[_0xbe91('0x61')][_0xbe91('0x62')](0x1)['then'](function(_0x1a57e9){if(_0x1a57e9[_0xbe91('0x63')])authService[_0xbe91('0x64')](_0x2f225b[_0xbe91('0x3c')]);db['User'][_0xbe91('0x65')]('internal')['then'](function(_0x225b32){if(_[_0xbe91('0x66')](_0x225b32)){_0x2f225b[_0xbe91('0x60')]=_0x1a57e9['min_internal']||0x1;return;}if(_['isNil'](_0x1a57e9[_0xbe91('0x67')])||_0x1a57e9[_0xbe91('0x67')]===_0x225b32){_0x2f225b['internal']=_0x225b32+0x1;return;}if(_0x1a57e9[_0xbe91('0x67')]>_0x225b32){_0x2f225b[_0xbe91('0x60')]=_0x1a57e9[_0xbe91('0x67')];return;}return db['sequelize'][_0xbe91('0x3f')](_0xbe91('0x68'),{'type':db[_0xbe91('0x69')][_0xbe91('0x6a')][_0xbe91('0x6b')]})[_0xbe91('0x15')](function(_0x328458){if(_0x328458&&_0x328458[_0xbe91('0x49')]){for(var _0x174584=0x0,_0x20bb21=_0x328458['length'];_0x174584<_0x20bb21&&_['isNil'](_0x2f225b[_0xbe91('0x60')]);_0x174584++){if(_0x1a57e9[_0xbe91('0x67')]<=_0x328458[_0x174584]['from']){_0x2f225b[_0xbe91('0x60')]=_0x328458[_0x174584][_0xbe91('0x6c')];}else if(_0x1a57e9[_0xbe91('0x67')]>_0x328458[_0x174584][_0xbe91('0x6c')]&&_0x1a57e9[_0xbe91('0x67')]<=_0x328458[_0x174584]['to']){_0x2f225b[_0xbe91('0x60')]=_0x1a57e9[_0xbe91('0x67')];}}}if(_[_0xbe91('0x66')](_0x2f225b['internal'])){_0x2f225b['internal']=_0x225b32+0x1;}return _0x5e881a(_0x2f225b);});});})[_0xbe91('0x5d')](function(_0x3c51a6){_0x2caf77(_0x3c51a6);});});}function updateUser(_0x2de09d){return new BPromise(function(_0x56b370,_0x5c68a0){try{if(_0x2de09d[_0xbe91('0x6d')]){_0x2de09d[_0xbe91('0x6e')]=_0x2de09d[_0xbe91('0x60')];_0x2de09d[_0xbe91('0x6f')]={'mailbox':_0x2de09d['internal'],'password':_0x2de09d['password'],'fullname':_0x2de09d[_0xbe91('0x70')],'email':_0x2de09d[_0xbe91('0x71')]};}if(_0x2de09d[_0xbe91('0x30')]===_0xbe91('0x29')){if(!_0x2de09d[_0xbe91('0x72')])_0x2de09d[_0xbe91('0x72')]=['101','102','103',_0xbe91('0x73'),'110',_0xbe91('0x74'),'105',_0xbe91('0x75'),_0xbe91('0x76'),_0xbe91('0x77'),'109','100',_0xbe91('0x78'),_0xbe91('0x79'),_0xbe91('0x7a')];}_0x56b370(_0x2de09d);}catch(_0x5b4041){_0x5c68a0(_0x5b4041);}});}exports[_0xbe91('0x7b')]=function(_0x342e16,_0x3f525d){if(_0x342e16[_0xbe91('0x7c')][_0xbe91('0x30')]===_0xbe91('0x29'))throw new Error(_0xbe91('0x7d'));if(_0x342e16[_0xbe91('0x5b')]['role']==='user'&&_0x342e16['user']['role']!==_0xbe91('0x7e')){throw new Error(_0xbe91('0x7f'));}if(_0x342e16['body'][_0xbe91('0x30')]===_0xbe91('0x7e')&&_0x342e16[_0xbe91('0x7c')][_0xbe91('0x30')]!==_0xbe91('0x7e')){throw new Error(_0xbe91('0x80'));}return licenseUtil[_0xbe91('0x81')]([_0x342e16[_0xbe91('0x5b')]])[_0xbe91('0x15')](function(){return validateUser(_0x342e16[_0xbe91('0x5b')]);})[_0xbe91('0x15')](function(_0x573b2f){return updateUser(_0x573b2f)[_0xbe91('0x15')](function(_0xf81307){if(_0xf81307['role']===_0xbe91('0x7e')){_0xf81307[_0xbe91('0x82')]=_0x342e16[_0xbe91('0x7c')][_0xbe91('0x82')];delete _0xf81307[_0xbe91('0x83')];}return _0xf81307;});})[_0xbe91('0x15')](function(_0x123d10){return db[_0xbe91('0x38')]['create'](_0x123d10,{'include':[{'model':db['VoiceMail'],'as':_0xbe91('0x6f')}]});})[_0xbe91('0x15')](function(_0x5df935){if(_0x342e16[_0xbe91('0x5b')][_0xbe91('0x30')]===_0xbe91('0x7c'))return _0x5df935;if(_0x342e16[_0xbe91('0x7c')]['role']!==_0xbe91('0x7c'))return _0x5df935;return db[_0xbe91('0x84')][_0xbe91('0x31')]({'where':{'name':_0x5df935[_0xbe91('0x30')]===_0xbe91('0x29')?_0xbe91('0x85'):'Telephones','userProfileId':_0x342e16[_0xbe91('0x7c')][_0xbe91('0x83')]},'raw':!![]})['then'](function(_0x5b7796){if(!_0x5b7796||_0x5b7796[_0xbe91('0x86')]!=0x0)return _0x5df935;return db[_0xbe91('0x32')][_0xbe91('0x7b')]({'name':_0x5df935[_0xbe91('0x35')],'resourceId':_0x5df935['id'],'type':_0x5b7796['name'],'sectionId':_0x5b7796['id']},{})[_0xbe91('0x15')](function(){return _0x5df935;});})['catch'](function(_0x3f0405){logger[_0xbe91('0x1b')](_0xbe91('0x87'),_0x3f0405);throw _0x3f0405;});})[_0xbe91('0x15')](respondWithResult(_0x3f525d,0xc9))[_0xbe91('0x5d')](handleError(_0x3f525d,null));};exports[_0xbe91('0x88')]=function(_0xf4abad,_0x577477){var _0x5ad880=_0xf4abad['body'];var _0x43687a=[];if(_0xf4abad[_0xbe91('0x7c')]['role']==='agent')throw new Error(_0xbe91('0x7d'));if(_['some'](_0x5ad880,['role',_0xbe91('0x7c')])&&_0xf4abad[_0xbe91('0x7c')]['role']!==_0xbe91('0x7e')){throw new Error(_0xbe91('0x7f'));}if(_[_0xbe91('0x89')](_0x5ad880,[_0xbe91('0x30'),_0xbe91('0x7e')])&&_0xf4abad[_0xbe91('0x7c')]['role']!==_0xbe91('0x7e')){throw new Error(_0xbe91('0x8a'));}return licenseUtil[_0xbe91('0x81')](_0x5ad880)['then'](function(){return validateUser(_0x5ad880[0x0]);})[_0xbe91('0x15')](function(){for(var _0x5cad07=0x1;_0x5cad07<_0x5ad880[_0xbe91('0x49')];_0x5cad07++){var _0x156049=_0x5ad880[_0x5cad07-0x1][_0xbe91('0x60')];if(!_0x5ad880[_0x5cad07]['internal'])_0x5ad880[_0x5cad07][_0xbe91('0x60')]=_0x156049+0x1;_0x43687a['push'](validateUser(_0x5ad880[_0x5cad07]));}return BPromise[_0xbe91('0x51')](_0x43687a);})[_0xbe91('0x15')](function(){_0x43687a=[];for(var _0x3780c8=0x0;_0x3780c8<_0x5ad880[_0xbe91('0x49')];_0x3780c8++){_0x43687a[_0xbe91('0x4a')](updateUser(_0x5ad880[_0x3780c8]));}return BPromise[_0xbe91('0x51')](_0x43687a);})[_0xbe91('0x15')](function(){return BPromise[_0xbe91('0x8b')](_0x5ad880,function(_0x205816){return db[_0xbe91('0x38')][_0xbe91('0x7b')](_0x205816,{'include':[{'model':db[_0xbe91('0x6f')],'as':'VoiceMail'}]})[_0xbe91('0x15')](function(_0x1fff81){_0x205816['id']=_0x1fff81['id'];return _0x205816;});});})['then'](function(_0x18f5b8){if(_0xf4abad[_0xbe91('0x5b')][_0xbe91('0x30')]===_0xbe91('0x7c'))return _0x18f5b8;if(_0xf4abad[_0xbe91('0x7c')][_0xbe91('0x30')]!==_0xbe91('0x7c'))return _0x18f5b8;var _0x181bef=_['some'](_0x18f5b8,function(_0x122073){return _0x122073[_0xbe91('0x30')]===_0xbe91('0x29')||_0x122073['role']===_0xbe91('0x2b');});if(!_0x181bef)return _0x18f5b8;return db[_0xbe91('0x84')][_0xbe91('0x46')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0xf4abad['user'][_0xbe91('0x83')]},'raw':!![]})[_0xbe91('0x15')](function(_0x1bd363){if(_[_0xbe91('0x8c')](_0x1bd363)||!_[_0xbe91('0x89')](_0x1bd363,[_0xbe91('0x86'),0x0]))return _0x18f5b8;_0x43687a=[];var _0x379c18=_(_0x1bd363)['map'](function(_0x1076d5){if(_0x1076d5[_0xbe91('0x86')]===0x1)return;return _0x1076d5[_0xbe91('0x35')]==='Agents'?_0xbe91('0x29'):_0xbe91('0x2b');})[_0xbe91('0x8d')]()[_0xbe91('0x2f')]();for(var _0x578df0=0x0;_0x578df0<_0x18f5b8[_0xbe91('0x49')];_0x578df0++){if(!_[_0xbe91('0x3b')](_0x379c18,_0x18f5b8[_0x578df0]['role']))return;var _0x53468a=_0x18f5b8[_0x578df0][_0xbe91('0x30')]===_0xbe91('0x29')?_0xbe91('0x85'):_0xbe91('0x2a');_0x43687a[_0xbe91('0x4a')](db[_0xbe91('0x32')][_0xbe91('0x7b')]({'name':_0x18f5b8[_0x578df0]['name'],'resourceId':_0x18f5b8[_0x578df0]['id'],'type':_0x53468a,'sectionId':_[_0xbe91('0x31')](_0x1bd363,['name',_0x53468a])['id']},{}));}return BPromise['all'](_0x43687a);});})[_0xbe91('0x15')](respondWithResult(_0x577477,0xc9))[_0xbe91('0x5d')](handleError(_0x577477,null));};exports['changePassword']=function(_0x4084c0,_0xf4526f){if(_0x4084c0[_0xbe91('0x5b')]['id']){delete _0x4084c0[_0xbe91('0x5b')]['id'];}return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x4084c0[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](function(_0x5d6c3c){if(!_0x5d6c3c)return null;if(_0x5d6c3c['id']===_0x4084c0['user']['id']){if(!_0x4084c0[_0xbe91('0x5b')][_0xbe91('0x8e')]||!_0x4084c0[_0xbe91('0x5b')]['newPassword']){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0x91'));}if(!_0x5d6c3c[_0xbe91('0x92')](_0x4084c0['body'][_0xbe91('0x8e')])){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0x93'));}if(_0x4084c0[_0xbe91('0x5b')][_0xbe91('0x8e')]===_0x4084c0[_0xbe91('0x5b')][_0xbe91('0x94')]){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0x95'));}}else if(_0x4084c0['user']['role']===_0xbe91('0x7e')){if(!_0x4084c0[_0xbe91('0x5b')][_0xbe91('0x94')]){throw new db[(_0xbe91('0x8f'))]['ValidationError'](_0xbe91('0x96'));}}else if(_0x4084c0['user'][_0xbe91('0x30')]===_0xbe91('0x7c')){if(!_0x4084c0[_0xbe91('0x5b')][_0xbe91('0x94')]){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0x96'));}if(_0x5d6c3c[_0xbe91('0x30')]!==_0xbe91('0x29')){throw new db[(_0xbe91('0x8f'))]['ValidationError'](_0xbe91('0x7d'));}}else{throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0x7d'));}return _0x5d6c3c;})[_0xbe91('0x15')](handleEntityNotFound(_0xf4526f,null))['then'](function(_0x373131){return db[_0xbe91('0x61')][_0xbe91('0x97')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xbe91('0x98')]})[_0xbe91('0x15')](function(_0x3e72fc){if(_0x3e72fc[_0xbe91('0x63')])authService['validatePasswordPattern'](_0x4084c0[_0xbe91('0x5b')]['newPassword']);if(!_0x3e72fc['enforcePasswordHistory']||!_0x373131[_0xbe91('0x99')])return _0x373131;authService['validatePasswordHistory'](_0x4084c0[_0xbe91('0x5b')]['newPassword'],_0x373131[_0xbe91('0x99')],_0x3e72fc[_0xbe91('0x98')]);return _0x373131;})[_0xbe91('0x15')](saveUpdates({'password':_0x4084c0['body'][_0xbe91('0x94')],'passwordResetAt':_0x4084c0[_0xbe91('0x7c')]['id']==_0x4084c0[_0xbe91('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4084c0['body'][_0xbe91('0x94')],_0x373131[_0xbe91('0x99')])},null));})['then'](respondWithResult(_0xf4526f,null))[_0xbe91('0x5d')](handleError(_0xf4526f,null));};exports[_0xbe91('0x9a')]=function(_0x287a06,_0x3bd2bd){var _0x2fe847=_0x287a06[_0xbe91('0x5b')][_0xbe91('0x9b')];return db['User'][_0xbe91('0x31')]({'where':{'id':_0x287a06[_0xbe91('0x53')]['id']},'attributes':['id',_0xbe91('0x35'),_0xbe91('0x30'),_0xbe91('0x9c'),_0xbe91('0x9d'),_0xbe91('0x9e'),'interface']})[_0xbe91('0x15')](handleEntityNotFound(_0x3bd2bd,null))[_0xbe91('0x15')](function(_0x28bba1){if(_0x28bba1){if(!utils[_0xbe91('0x9f')](_0x2fe847)){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0xa0'));}return _0x28bba1['add'+_[_0xbe91('0xa1')](_0x2fe847[_0xbe91('0xa2')]())+'Queues'](_0x287a06['body'][_0xbe91('0xa3')],{'penalty':_0x287a06['body'][_0xbe91('0xa4')]||0x0})[_0xbe91('0xa5')](function(_0x5cde69){for(var _0x1d5233=0x0;_0x1d5233<_0x287a06['body']['ids']['length'];_0x1d5233+=0x1){var _0x39815d={'UserId':Number(_0x287a06[_0xbe91('0x53')]['id'])};_0x39815d[_[_0xbe91('0xa1')](_0x2fe847[_0xbe91('0xa2')]())+'QueueId']=Number(_0x287a06[_0xbe91('0x5b')][_0xbe91('0xa3')][_0x1d5233]);socket['emit']('user'+_['capitalize'](_0x2fe847[_0xbe91('0xa2')]())+_0xbe91('0xa6'),_0x39815d);}return _0x5cde69;})[_0xbe91('0x15')](function(){if(_0x2fe847==='voice'){return db[_0xbe91('0xa7')][_0xbe91('0x46')]({'where':{'id':_0x287a06[_0xbe91('0x5b')][_0xbe91('0xa3')]||[]},'raw':!![],'attributes':['id',_0xbe91('0x35')]});}})[_0xbe91('0x15')](function(_0xd95dbe){var _0x3eb705=_0x28bba1['get']({'plain':!![]});var _0x57771a=[];if(_0x2fe847===_0xbe91('0xa8')&&_0x3eb705['role']==='agent'&&_0x3eb705[_0xbe91('0x9c')]){for(var _0x55d1ac=0x0;_0x55d1ac<_0xd95dbe[_0xbe91('0x49')];_0x55d1ac+=0x1){_0x57771a['push']({'membername':_0x3eb705[_0xbe91('0x35')],'UserId':_0x3eb705['id'],'queue_name':_0xd95dbe[_0x55d1ac][_0xbe91('0x35')],'VoiceQueueId':_0xd95dbe[_0x55d1ac]['id'],'interface':_[_0xbe91('0x66')](_0x3eb705[_0xbe91('0xa9')])?util[_0xbe91('0xaa')]('SIP/%s',_0x3eb705[_0xbe91('0x35')]):_0x3eb705[_0xbe91('0xa9')],'paused':_0x3eb705[_0xbe91('0x9e')]||![],'penalty':_0x287a06[_0xbe91('0x5b')][_0xbe91('0xa4')]||0x0});}return BPromise[_0xbe91('0x8b')](_0x57771a,function(_0x3f5cd5){return db[_0xbe91('0xab')][_0xbe91('0xac')](_0x3f5cd5);});}return _0x28bba1;});}})['then'](respondWithStatusCode(_0x3bd2bd,null))[_0xbe91('0x5d')](handleError(_0x3bd2bd,null));};exports['removeQueues']=function(_0x3b002b,_0x327bad){var _0x37de04,_0x5e3cd8;return db[_0xbe91('0x38')]['find']({'where':{'id':_0x3b002b[_0xbe91('0x53')]['id']},'attributes':['id','name',_0xbe91('0x30')]})[_0xbe91('0x15')](handleEntityNotFound(_0x327bad,null))[_0xbe91('0x15')](function(_0x1e9f5c){if(_0x1e9f5c){_0x37de04=_0x1e9f5c;if(!_0x3b002b['query'][_0xbe91('0x9b')]||!utils[_0xbe91('0x9f')](_0x3b002b[_0xbe91('0x3f')][_0xbe91('0x9b')])){throw new db['Sequelize'][(_0xbe91('0x90'))](_0xbe91('0xa0'));}return _0x1e9f5c[_0xbe91('0xad')+_['capitalize'](_0x3b002b['query'][_0xbe91('0x9b')][_0xbe91('0xa2')]())+_0xbe91('0xae')](_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')]);}})[_0xbe91('0x15')](function(_0x5bcae4){if(_[_0xbe91('0xaf')](_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')])){for(var _0x5e3a42=0x0;_0x5e3a42<_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')][_0xbe91('0x49')];_0x5e3a42+=0x1){_0x5e3cd8={'UserId':Number(_0x3b002b[_0xbe91('0x53')]['id'])};_0x5e3cd8[_[_0xbe91('0xa1')](_0x3b002b['query'][_0xbe91('0x9b')]['toLowerCase']())+'QueueId']=Number(_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')][_0x5e3a42]);socket[_0xbe91('0xb0')](_0xbe91('0x7c')+_[_0xbe91('0xa1')](_0x3b002b['query'][_0xbe91('0x9b')][_0xbe91('0xa2')]())+'Queue:remove',_0x5e3cd8);}}else{_0x5e3cd8={'UserId':Number(_0x3b002b[_0xbe91('0x53')]['id'])};_0x5e3cd8[_['capitalize'](_0x3b002b[_0xbe91('0x3f')][_0xbe91('0x9b')][_0xbe91('0xa2')]())+_0xbe91('0xb1')]=Number(_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')]);socket['emit'](_0xbe91('0x7c')+_[_0xbe91('0xa1')](_0x3b002b[_0xbe91('0x3f')][_0xbe91('0x9b')]['toLowerCase']())+_0xbe91('0xb2'),_0x5e3cd8);}return _0x5bcae4;})[_0xbe91('0x15')](function(){if(_0x3b002b[_0xbe91('0x3f')]['channel']==='voice'){return db['UserVoiceQueueRt'][_0xbe91('0x33')]({'where':{'UserId':_0x3b002b[_0xbe91('0x53')]['id'],'VoiceQueueId':_0x3b002b[_0xbe91('0x3f')][_0xbe91('0xa3')]},'individualHooks':!![]})[_0xbe91('0x15')](function(){return _0x37de04;});}return _0x37de04;})[_0xbe91('0x15')](respondWithStatusCode(_0x327bad,null))['catch'](handleError(_0x327bad,null));};exports[_0xbe91('0xb3')]=function(_0x5a1358,_0x45cfd6){_0x5a1358['body'][_0xbe91('0xb4')]=_0x5a1358[_0xbe91('0xb5')][_0xbe91('0xb6')];return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x5a1358[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x45cfd6,null))[_0xbe91('0x15')](saveUpdates(_0x5a1358[_0xbe91('0x5b')],null))[_0xbe91('0x15')](respondWithResult(_0x45cfd6,null))[_0xbe91('0x5d')](handleError(_0x45cfd6,null));};exports[_0xbe91('0xb7')]=function(_0x561494,_0x1135a4){var _0x4bca4a=path[_0xbe91('0xb8')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xbe91('0x38')]['find']({'where':{'id':_0x561494[_0xbe91('0x53')]['id']},'attributes':['id',_0xbe91('0xb4')],'raw':!![]})[_0xbe91('0x15')](handleEntityNotFound(_0x1135a4,null))[_0xbe91('0x15')](function(_0x1db049){if(_0x1db049){if(_[_0xbe91('0x66')](_0x1db049[_0xbe91('0xb4')])){return _0x1135a4[_0xbe91('0xb9')](_0x4bca4a);}else{if(!fs['existsSync'](path['join'](config[_0xbe91('0xba')],'server/files/images/',_0x1db049['userpic']))){return _0x1135a4[_0xbe91('0xb9')](_0x4bca4a);}return _0x1135a4['download'](path[_0xbe91('0xb8')](config[_0xbe91('0xba')],_0xbe91('0xbb'),_0x1db049[_0xbe91('0xb4')]));}}})['catch'](handleError(_0x1135a4,null));};exports[_0xbe91('0xbc')]=function(_0xc766a,_0x566908){return db['User'][_0xbe91('0x31')]({'where':{'id':_0xc766a[_0xbe91('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x566908,null))[_0xbe91('0x15')](function(_0x345487){var _0x4a2487=[];values=_0x345487[_0xbe91('0x4d')];_0x4a2487[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4b'),_0x345487[_0xbe91('0x4d')]));_0x4a2487[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x4c'),_0x345487['dataValues']));_0x4a2487['push'](get_open_tabs(_0xbe91('0x4f'),_0x345487[_0xbe91('0x4d')]));_0x4a2487[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x50'),_0x345487[_0xbe91('0x4d')]));_0x4a2487[_0xbe91('0x4a')](get_open_tabs(_0xbe91('0x5a'),_0x345487[_0xbe91('0x4d')]));_0x4a2487[_0xbe91('0x4a')](get_open_tabs('mail',_0x345487[_0xbe91('0x4d')]));return BPromise[_0xbe91('0x51')](_0x4a2487);})[_0xbe91('0x15')](function(_0x308041){if(_0x308041){var _0x377ce4=_[_0xbe91('0x2e')](values[_0xbe91('0xbd')],function(_0x220f35){return{'channel':'CHAT','id':_0x220f35['id'],'createdAt':_0x220f35[_0xbe91('0xbe')]};});var _0x42e161=_[_0xbe91('0x2e')](values[_0xbe91('0xbf')],function(_0x40bef6){return{'channel':'FAX','id':_0x40bef6['id'],'createdAt':_0x40bef6[_0xbe91('0xbe')]};});var _0x5c1598=_[_0xbe91('0x2e')](values['OpenchannelOpenTabs'],function(_0x20ba8c){return{'channel':_0xbe91('0xc0'),'id':_0x20ba8c['id'],'createdAt':_0x20ba8c[_0xbe91('0xbe')]};});var _0x301bfb=_[_0xbe91('0x2e')](values[_0xbe91('0xc1')],function(_0xd3e2f9){return{'channel':_0xbe91('0xc2'),'id':_0xd3e2f9['id'],'createdAt':_0xd3e2f9['createdAt']};});var _0x48a052=_[_0xbe91('0x2e')](values[_0xbe91('0xc3')],function(_0x14e8d4){return{'channel':_0xbe91('0xc4'),'id':_0x14e8d4['id'],'createdAt':_0x14e8d4[_0xbe91('0xbe')]};});var _0x38faa9=_[_0xbe91('0x2e')](values['WhatsappOpenTabs'],function(_0x514a9a){return{'channel':_0xbe91('0xc5'),'id':_0x514a9a['id'],'createdAt':_0x514a9a[_0xbe91('0xbe')]};});var _0x424558=_[_0xbe91('0xc6')](_0x377ce4,_0x42e161,_0x5c1598,_0x301bfb,_0x48a052,_0x38faa9);var _0x34d415={'count':_0x424558['length'],'rows':_0x424558};return _0x34d415;}else return null;})[_0xbe91('0x15')](respondWithResult(_0x566908,null))[_0xbe91('0x5d')](handleError(_0x566908,null));};exports['getContacts']=function(_0x444f52,_0x18bd30){var _0x31130d={};var _0x2b4bac={};var _0x1cee5f;var _0x13b403;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x444f52[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x18bd30,null))[_0xbe91('0x15')](function(_0x306465){if(_0x306465){_0x1cee5f=_0x306465;_0x2b4bac[_0xbe91('0x54')]=_['keys'](db[_0xbe91('0xc7')]['rawAttributes']);_0x2b4bac[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x444f52[_0xbe91('0x3f')]);_0x2b4bac['filters']=_[_0xbe91('0x57')](_0x2b4bac[_0xbe91('0x54')],_0x2b4bac[_0xbe91('0x3f')]);_0x31130d[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x2b4bac[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x444f52[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x31130d['attributes']=_0x31130d[_0xbe91('0x45')][_0xbe91('0x49')]?_0x31130d['attributes']:_0x2b4bac[_0xbe91('0x54')];_0x31130d[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x444f52[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x31130d[_0xbe91('0x3e')]=qs['filters'](_[_0xbe91('0xcb')](_0x444f52[_0xbe91('0x3f')],_0x2b4bac[_0xbe91('0x56')]));if(_0x444f52[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x31130d[_0xbe91('0x3e')]=_['merge'](_0x31130d[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x31130d[_0xbe91('0x45')],function(_0x221159){var _0x47c71d={};_0x47c71d[_0x221159]={'$like':'%'+_0x444f52[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x47c71d;})});}_0x31130d=_[_0xbe91('0x59')]({},_0x31130d,_0x444f52[_0xbe91('0xcc')]);return _0x1cee5f[_0xbe91('0xcd')](_0x31130d);}})[_0xbe91('0x15')](function(_0x19450d){if(_0x19450d){_0x13b403=_0x19450d[_0xbe91('0x49')];if(_0x444f52[_0xbe91('0x3f')][_0xbe91('0xce')]('includeAll')){_0x31130d[_0xbe91('0x41')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xbe91('0xcf')],'as':_0xbe91('0xd0'),'attributes':['id','name',_0xbe91('0xd1')],'where':_0x444f52[_0xbe91('0x3f')][_0xbe91('0xd2')]?{'id':_0x444f52[_0xbe91('0x3f')][_0xbe91('0xd2')]}:undefined,'required':_0x444f52['query'][_0xbe91('0xd2')]?!![]:![]}];}if(!_0x444f52[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x31130d[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x444f52[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x31130d[_0xbe91('0x23')]=qs['offset'](_0x444f52[_0xbe91('0x3f')][_0xbe91('0x23')]);}return _0x1cee5f[_0xbe91('0xcd')](_0x31130d);}})[_0xbe91('0x15')](function(_0xf8a28b){if(_0xf8a28b){return _0xf8a28b?{'count':_0x13b403,'rows':_0xf8a28b}:null;}})[_0xbe91('0x15')](respondWithResult(_0x18bd30,null))[_0xbe91('0x5d')](handleError(_0x18bd30,null));};exports[_0xbe91('0xd4')]=function(_0x5aef90,_0x239513){var _0x25c8a5;var _0xed8558={};var _0x1d4f16;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x5aef90[_0xbe91('0x53')]['id']},'attributes':['id',_0xbe91('0x35'),'role']})[_0xbe91('0x15')](handleEntityNotFound(_0x239513,null))[_0xbe91('0x15')](function(_0x3a7fab){if(!utils[_0xbe91('0x9f')](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x9b')])){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))]('Unknown\x20channel');}_0x25c8a5=_0x3a7fab;var _0x1a4480={};_0x1a4480[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_[_0xbe91('0xa1')](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x9b')])+_0xbe91('0xd5')]['rawAttributes']);_0x1a4480[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x5aef90[_0xbe91('0x3f')]);_0x1a4480[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x1a4480['model'],_0x1a4480[_0xbe91('0x3f')]);_0xed8558[_0xbe91('0x45')]=_['intersection'](_0x1a4480[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x58')]));_0xed8558[_0xbe91('0x45')]=_0xed8558[_0xbe91('0x45')]['length']?_0xed8558[_0xbe91('0x45')]:_0x1a4480[_0xbe91('0x54')];_0xed8558[_0xbe91('0xc9')]=qs['sort'](_0x5aef90[_0xbe91('0x3f')]['sort']);_0xed8558[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_['pick'](_0x5aef90[_0xbe91('0x3f')],_0x1a4480[_0xbe91('0x56')]));if(_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0xed8558['where']=_[_0xbe91('0x59')](_0xed8558[_0xbe91('0x3e')],{'$or':_['map'](_0xed8558['attributes'],function(_0x3c05c5){var _0x2d7cb8={};_0x2d7cb8[_0x3c05c5]={'$like':'%'+_0x5aef90[_0xbe91('0x3f')]['filter']+'%'};return _0x2d7cb8;})});}_0xed8558=_['merge']({},_0xed8558,_0x5aef90[_0xbe91('0xcc')]);switch(_0x25c8a5[_0xbe91('0x30')]){case _0xbe91('0x7e'):return db[_['capitalize'](_0x5aef90['query'][_0xbe91('0x9b')])+'Queue'][_0xbe91('0x46')](_0xed8558);case _0xbe91('0x7c'):case _0xbe91('0x29'):return _0x25c8a5[_0xbe91('0x28')+_['capitalize'](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x9b')])+_0xbe91('0xae')](_0xed8558);default:throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))]('Unknown\x20role');}})[_0xbe91('0x15')](function(_0x2e3bd5){_0x1d4f16=_0x2e3bd5[_0xbe91('0x49')];if(!_0x5aef90[_0xbe91('0x3f')]['hasOwnProperty'](_0xbe91('0xd3'))){_0xed8558['limit']=qs['limit'](_0x5aef90['query'][_0xbe91('0x25')]);_0xed8558[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x23')]);}switch(_0x25c8a5[_0xbe91('0x30')]){case'admin':return db[_['capitalize'](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x9b')])+_0xbe91('0xd5')][_0xbe91('0x46')](_0xed8558);case _0xbe91('0x7c'):case _0xbe91('0x29'):return _0x25c8a5[_0xbe91('0x28')+_['capitalize'](_0x5aef90[_0xbe91('0x3f')][_0xbe91('0x9b')])+_0xbe91('0xae')](_0xed8558);}})['then'](function(_0x4b23d9){return{'count':_0x1d4f16,'rows':_0x4b23d9};})[_0xbe91('0x15')](respondWithResult(_0x239513,null))[_0xbe91('0x5d')](handleError(_0x239513,null));};exports[_0xbe91('0xd6')]=function(_0x36f21c,_0x1dc4db){var _0x402263={};var _0x572e50={};var _0x34ab6a;var _0x48feca;return db['User'][_0xbe91('0x97')]({'where':{'id':_0x36f21c['params']['id']}})['then'](handleEntityNotFound(_0x1dc4db,null))[_0xbe91('0x15')](function(_0x58c1cd){if(_0x58c1cd){_0x34ab6a=_0x58c1cd;_0x572e50[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db['UserVoiceQueueRt'][_0xbe91('0x39')]);_0x572e50[_0xbe91('0x3f')]=_['keys'](_0x36f21c['query']);_0x572e50[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x572e50['model'],_0x572e50[_0xbe91('0x3f')]);_0x402263[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x572e50[_0xbe91('0x54')],qs['fields'](_0x36f21c[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x402263['attributes']=_0x402263[_0xbe91('0x45')][_0xbe91('0x49')]?_0x402263[_0xbe91('0x45')]:_0x572e50[_0xbe91('0x54')];_0x402263[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x36f21c[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x402263['where']=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x36f21c[_0xbe91('0x3f')],_0x572e50['filters']));if(_0x36f21c[_0xbe91('0x3f')]['filter']){_0x402263[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x402263[_0xbe91('0x3e')],{'$or':_['map'](_0x402263[_0xbe91('0x45')],function(_0x56e6af){var _0x838b9d={};_0x838b9d[_0x56e6af]={'$like':'%'+_0x36f21c[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x838b9d;})});}_0x402263=_[_0xbe91('0x59')]({},_0x402263,_0x36f21c[_0xbe91('0xcc')]);return _0x34ab6a[_0xbe91('0xd6')](_0x402263);}})[_0xbe91('0x15')](function(_0x4117d0){if(_0x4117d0){_0x48feca=_0x4117d0['length'];if(!_0x36f21c[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x402263[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x36f21c[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x402263[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x36f21c[_0xbe91('0x3f')][_0xbe91('0x23')]);}return _0x34ab6a[_0xbe91('0xd6')](_0x402263);}})[_0xbe91('0x15')](function(_0x45a9f0){if(_0x45a9f0){return _0x45a9f0?{'count':_0x48feca,'rows':_0x45a9f0}:null;}})[_0xbe91('0x15')](respondWithResult(_0x1dc4db,null))['catch'](handleError(_0x1dc4db,null));};exports[_0xbe91('0xd7')]=function(_0x26cee7,_0x22c6cc){var _0x1b640d={};var _0xd18fed={};var _0xa74c96;var _0x4f82b4;return db['User'][_0xbe91('0x97')]({'where':{'id':_0x26cee7[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x22c6cc,null))[_0xbe91('0x15')](function(_0x51e1de){if(_0x51e1de){_0xa74c96=_0x51e1de;_0xd18fed['model']=_[_0xbe91('0xc8')](db[_0xbe91('0xd8')][_0xbe91('0x39')]);_0xd18fed[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x26cee7[_0xbe91('0x3f')]);_0xd18fed[_0xbe91('0x56')]=_['intersection'](_0xd18fed[_0xbe91('0x54')],_0xd18fed['query']);_0x1b640d[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0xd18fed[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x26cee7['query']['fields']));_0x1b640d[_0xbe91('0x45')]=_0x1b640d['attributes'][_0xbe91('0x49')]?_0x1b640d[_0xbe91('0x45')]:_0xd18fed['model'];_0x1b640d['order']=qs[_0xbe91('0xca')](_0x26cee7[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x1b640d['where']=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x26cee7[_0xbe91('0x3f')],_0xd18fed[_0xbe91('0x56')]));if(_0x26cee7[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x1b640d[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x1b640d[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x1b640d[_0xbe91('0x45')],function(_0x407fd5){var _0x4bf0cf={};_0x4bf0cf[_0x407fd5]={'$like':'%'+_0x26cee7[_0xbe91('0x3f')]['filter']+'%'};return _0x4bf0cf;})});}_0x1b640d=_[_0xbe91('0x59')]({},_0x1b640d,_0x26cee7['options']);return _0xa74c96[_0xbe91('0xd7')](_0x1b640d);}})[_0xbe91('0x15')](function(_0x2034e4){if(_0x2034e4){_0x4f82b4=_0x2034e4['length'];if(!_0x26cee7[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x1b640d[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x26cee7['query']['limit']);_0x1b640d[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x26cee7[_0xbe91('0x3f')]['offset']);}return _0xa74c96[_0xbe91('0xd7')](_0x1b640d);}})[_0xbe91('0x15')](function(_0x349473){if(_0x349473){return _0x349473?{'count':_0x4f82b4,'rows':_0x349473}:null;}})[_0xbe91('0x15')](respondWithResult(_0x22c6cc,null))[_0xbe91('0x5d')](handleError(_0x22c6cc,null));};exports[_0xbe91('0xd9')]=function(_0x5c1d66,_0x2bcde7){var _0x5a3179={'raw':!![],'where':{}};var _0x9ff655={};var _0x1e4ab0={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5c1d66[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x2bcde7,null))[_0xbe91('0x15')](function(_0x57f323){if(_0x57f323){_0x9ff655[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0xda')][_0xbe91('0x39')]);_0x9ff655['query']=_[_0xbe91('0xc8')](_0x5c1d66['query']);_0x9ff655['filters']=_[_0xbe91('0x57')](_0x9ff655['model'],_0x9ff655[_0xbe91('0x3f')]);_0x5a3179[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x9ff655[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x5c1d66['query']['fields']));_0x5a3179[_0xbe91('0x45')]=_0x5a3179['attributes'][_0xbe91('0x49')]?_0x5a3179[_0xbe91('0x45')]:_0x9ff655[_0xbe91('0x54')];if(!_0x5c1d66[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x5a3179[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x5c1d66[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x5a3179[_0xbe91('0x23')]=qs['offset'](_0x5c1d66[_0xbe91('0x3f')][_0xbe91('0x23')]);}_0x5a3179[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x5c1d66[_0xbe91('0x3f')]['sort']);_0x5a3179['where']=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x5c1d66['query'],_0x9ff655[_0xbe91('0x56')]));_0x5a3179[_0xbe91('0x3e')][_0xbe91('0xdb')]=_0x57f323['id'];if(_0x5c1d66[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x5a3179[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x5a3179[_0xbe91('0x3e')],{'$or':_['map'](_0x5a3179[_0xbe91('0x45')],function(_0x344d90){var _0x483698={};_0x483698[_0x344d90]={'$like':'%'+_0x5c1d66['query'][_0xbe91('0x2c')]+'%'};return _0x483698;})});}_0x5a3179=_[_0xbe91('0x59')]({},_0x5a3179,_0x5c1d66['options']);return db[_0xbe91('0xda')][_0xbe91('0x26')]({'where':_0x5a3179[_0xbe91('0x3e')]})[_0xbe91('0x15')](function(_0x197bbe){_0x1e4ab0[_0xbe91('0x26')]=_0x197bbe;if(_0x5c1d66['query']['includeAll']){_0x5a3179[_0xbe91('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0xbe91('0x46')](_0x5a3179);})[_0xbe91('0x15')](function(_0x46817e){_0x1e4ab0[_0xbe91('0x47')]=_0x46817e;return _0x1e4ab0;});}})['then'](respondWithFilteredResult(_0x2bcde7,_0x5a3179))['catch'](handleError(_0x2bcde7,null));};exports['getScreenRecordings']=function(_0x51e750,_0x5db386){var _0x1ff73b={'raw':!![],'where':{}};var _0x3d6c9c={};var _0x40cd13={'count':0x0,'rows':[]};return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x51e750[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x5db386,null))['then'](function(_0x411998){if(_0x411998){_0x3d6c9c[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0xdc')][_0xbe91('0x39')]);_0x3d6c9c['query']=_[_0xbe91('0xc8')](_0x51e750[_0xbe91('0x3f')]);_0x3d6c9c['filters']=_[_0xbe91('0x57')](_0x3d6c9c[_0xbe91('0x54')],_0x3d6c9c[_0xbe91('0x3f')]);_0x1ff73b['attributes']=_[_0xbe91('0x57')](_0x3d6c9c[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x51e750['query'][_0xbe91('0x58')]));_0x1ff73b[_0xbe91('0x45')]=_0x1ff73b[_0xbe91('0x45')][_0xbe91('0x49')]?_0x1ff73b['attributes']:_0x3d6c9c[_0xbe91('0x54')];if(!_0x51e750[_0xbe91('0x3f')]['hasOwnProperty']('nolimit')){_0x1ff73b[_0xbe91('0x25')]=qs['limit'](_0x51e750[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x1ff73b[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x51e750[_0xbe91('0x3f')][_0xbe91('0x23')]);}_0x1ff73b[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x51e750[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x1ff73b[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x51e750[_0xbe91('0x3f')],_0x3d6c9c[_0xbe91('0x56')]));_0x1ff73b['where'][_0xbe91('0xdb')]=_0x411998['id'];if(_0x51e750[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x1ff73b[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x1ff73b['where'],{'$or':_['map'](_0x1ff73b[_0xbe91('0x45')],function(_0x36aa4b){var _0xb53cf9={};_0xb53cf9[_0x36aa4b]={'$like':'%'+_0x51e750[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0xb53cf9;})});}_0x1ff73b=_['merge']({},_0x1ff73b,_0x51e750[_0xbe91('0xcc')]);return db[_0xbe91('0xdc')]['count']({'where':_0x1ff73b[_0xbe91('0x3e')]})[_0xbe91('0x15')](function(_0x1ab9a1){_0x40cd13[_0xbe91('0x26')]=_0x1ab9a1;if(_0x51e750[_0xbe91('0x3f')][_0xbe91('0x40')]){_0x1ff73b[_0xbe91('0x41')]=[{'all':!![]}];}return db[_0xbe91('0xdc')][_0xbe91('0x46')](_0x1ff73b);})[_0xbe91('0x15')](function(_0x24c294){_0x40cd13[_0xbe91('0x47')]=_0x24c294;return _0x40cd13;});}})[_0xbe91('0x15')](respondWithFilteredResult(_0x5db386,_0x1ff73b))[_0xbe91('0x5d')](handleError(_0x5db386,null));};exports[_0xbe91('0xdd')]=function(_0x7e5984,_0x255cf8){var _0x2a2bd8={};var _0x152c31={};var _0x435478;var _0x21c221;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x7e5984[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x255cf8,null))[_0xbe91('0x15')](function(_0x5ed0c3){if(_0x5ed0c3){_0x435478=_0x5ed0c3;_0x152c31[_0xbe91('0x54')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x152c31[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x7e5984[_0xbe91('0x3f')]);_0x152c31['filters']=_[_0xbe91('0x57')](_0x152c31[_0xbe91('0x54')],_0x152c31[_0xbe91('0x3f')]);_0x2a2bd8['attributes']=_[_0xbe91('0x57')](_0x152c31[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x7e5984[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x2a2bd8[_0xbe91('0x45')]=_0x2a2bd8[_0xbe91('0x45')]['length']?_0x2a2bd8['attributes']:_0x152c31[_0xbe91('0x54')];_0x2a2bd8['order']=qs[_0xbe91('0xca')](_0x7e5984[_0xbe91('0x3f')]['sort']);_0x2a2bd8[_0xbe91('0x3e')]=qs['filters'](_[_0xbe91('0xcb')](_0x7e5984[_0xbe91('0x3f')],_0x152c31[_0xbe91('0x56')]));if(_0x7e5984[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x2a2bd8[_0xbe91('0x3e')]=_['merge'](_0x2a2bd8[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x2a2bd8['attributes'],function(_0x210c8c){var _0xe252f2={};_0xe252f2[_0x210c8c]={'$like':'%'+_0x7e5984[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0xe252f2;})});}_0x2a2bd8=_['merge']({},_0x2a2bd8,_0x7e5984[_0xbe91('0xcc')]);return _0x435478[_0xbe91('0xdd')](_0x2a2bd8);}})[_0xbe91('0x15')](function(_0x463e54){if(_0x463e54){_0x21c221=_0x463e54[_0xbe91('0x49')];if(!_0x7e5984[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x2a2bd8[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x7e5984[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x2a2bd8['offset']=qs['offset'](_0x7e5984[_0xbe91('0x3f')]['offset']);}return _0x435478[_0xbe91('0xdd')](_0x2a2bd8);}})['then'](function(_0xe6a9ca){if(_0xe6a9ca){return _0xe6a9ca?{'count':_0x21c221,'rows':_0xe6a9ca}:null;}})['then'](respondWithResult(_0x255cf8,null))[_0xbe91('0x5d')](handleError(_0x255cf8,null));};exports[_0xbe91('0xde')]=function(_0x4e5836,_0x20ca61){var _0x28cd2b={};var _0x36063b={};var _0x5ed020;var _0x19f290;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x4e5836['params']['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x20ca61,null))[_0xbe91('0x15')](function(_0xe6e19f){if(_0xe6e19f){_0x5ed020=_0xe6e19f;_0x36063b[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0xdf')]['rawAttributes']);_0x36063b['query']=_[_0xbe91('0xc8')](_0x4e5836[_0xbe91('0x3f')]);_0x36063b[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x36063b[_0xbe91('0x54')],_0x36063b[_0xbe91('0x3f')]);_0x28cd2b[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x36063b[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x4e5836['query'][_0xbe91('0x58')]));_0x28cd2b[_0xbe91('0x45')]=_0x28cd2b[_0xbe91('0x45')]['length']?_0x28cd2b[_0xbe91('0x45')]:_0x36063b[_0xbe91('0x54')];_0x28cd2b[_0xbe91('0xc9')]=qs['sort'](_0x4e5836[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x28cd2b[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x4e5836[_0xbe91('0x3f')],_0x36063b['filters']));if(_0x4e5836[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x28cd2b['where']=_[_0xbe91('0x59')](_0x28cd2b[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x28cd2b['attributes'],function(_0x4b42ca){var _0x584ed2={};_0x584ed2[_0x4b42ca]={'$like':'%'+_0x4e5836['query'][_0xbe91('0x2c')]+'%'};return _0x584ed2;})});}_0x28cd2b=_['merge']({},_0x28cd2b,_0x4e5836[_0xbe91('0xcc')]);return _0x5ed020['getOpenchannelInteractions'](_0x28cd2b);}})['then'](function(_0x94ea61){if(_0x94ea61){_0x19f290=_0x94ea61[_0xbe91('0x49')];if(!_0x4e5836[_0xbe91('0x3f')]['hasOwnProperty'](_0xbe91('0xd3'))){_0x28cd2b[_0xbe91('0x25')]=qs['limit'](_0x4e5836['query'][_0xbe91('0x25')]);_0x28cd2b[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x4e5836[_0xbe91('0x3f')]['offset']);}return _0x5ed020[_0xbe91('0xde')](_0x28cd2b);}})[_0xbe91('0x15')](function(_0x4ef39a){if(_0x4ef39a){return _0x4ef39a?{'count':_0x19f290,'rows':_0x4ef39a}:null;}})[_0xbe91('0x15')](respondWithResult(_0x20ca61,null))[_0xbe91('0x5d')](handleError(_0x20ca61,null));};exports[_0xbe91('0xe0')]=function(_0x3292ab,_0x51c7a5){var _0x4da444={'raw':!![],'where':{}};var _0x106211={};var _0x151e10={'count':0x0,'rows':[]};return db['User'][_0xbe91('0x97')]({'where':{'id':_0x3292ab[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x51c7a5,null))[_0xbe91('0x15')](function(_0x2e0560){if(_0x2e0560){_0x106211[_0xbe91('0x54')]=_['keys'](db[_0xbe91('0xe1')][_0xbe91('0x39')]);_0x106211[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x3292ab[_0xbe91('0x3f')]);_0x106211[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x106211['model'],_0x106211[_0xbe91('0x3f')]);_0x4da444['attributes']=_[_0xbe91('0x57')](_0x106211[_0xbe91('0x54')],qs['fields'](_0x3292ab[_0xbe91('0x3f')]['fields']));_0x4da444[_0xbe91('0x45')]=_0x4da444[_0xbe91('0x45')][_0xbe91('0x49')]?_0x4da444[_0xbe91('0x45')]:_0x106211[_0xbe91('0x54')];if(!_0x3292ab['query'][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x4da444[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x3292ab[_0xbe91('0x3f')]['limit']);_0x4da444['offset']=qs['offset'](_0x3292ab[_0xbe91('0x3f')]['offset']);}_0x4da444['order']=qs[_0xbe91('0xca')](_0x3292ab[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x4da444[_0xbe91('0x3e')]=qs['filters'](_['pick'](_0x3292ab['query'],_0x106211[_0xbe91('0x56')]));_0x4da444[_0xbe91('0x3e')][_0xbe91('0xdb')]=_0x2e0560['id'];if(_0x3292ab[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x4da444[_0xbe91('0x3e')]=_['merge'](_0x4da444[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x4da444[_0xbe91('0x45')],function(_0xb25160){var _0x406291={};_0x406291[_0xb25160]={'$like':'%'+_0x3292ab[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x406291;})});}_0x4da444=_[_0xbe91('0x59')]({},_0x4da444,_0x3292ab[_0xbe91('0xcc')]);return db[_0xbe91('0xe1')]['count']({'where':_0x4da444[_0xbe91('0x3e')]})['then'](function(_0x5c6cf7){_0x151e10[_0xbe91('0x26')]=_0x5c6cf7;if(_0x3292ab[_0xbe91('0x3f')][_0xbe91('0x40')]){_0x4da444[_0xbe91('0x41')]=[{'all':!![]}];}return db[_0xbe91('0xe1')][_0xbe91('0x46')](_0x4da444);})['then'](function(_0x780b6a){_0x151e10['rows']=_0x780b6a;return _0x151e10;});}})[_0xbe91('0x15')](respondWithFilteredResult(_0x51c7a5,_0x4da444))[_0xbe91('0x5d')](handleError(_0x51c7a5,null));};exports[_0xbe91('0xe2')]=function(_0x234faf,_0x3e4209){var _0x4cd7a1={};var _0x558d56={};var _0x5efe70;var _0x342773;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x234faf[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x3e4209,null))[_0xbe91('0x15')](function(_0x147e8d){if(_0x147e8d){_0x5efe70=_0x147e8d;_0x558d56[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0xe3')]['rawAttributes']);_0x558d56['query']=_[_0xbe91('0xc8')](_0x234faf[_0xbe91('0x3f')]);_0x558d56['filters']=_[_0xbe91('0x57')](_0x558d56[_0xbe91('0x54')],_0x558d56[_0xbe91('0x3f')]);_0x4cd7a1[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x558d56[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x234faf[_0xbe91('0x3f')]['fields']));_0x4cd7a1[_0xbe91('0x45')]=_0x4cd7a1[_0xbe91('0x45')]['length']?_0x4cd7a1[_0xbe91('0x45')]:_0x558d56[_0xbe91('0x54')];_0x4cd7a1[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x234faf[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x4cd7a1[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_['pick'](_0x234faf[_0xbe91('0x3f')],_0x558d56[_0xbe91('0x56')]));if(_0x234faf[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x4cd7a1[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x4cd7a1['where'],{'$or':_['map'](_0x4cd7a1[_0xbe91('0x45')],function(_0x4404d8){var _0x50d929={};_0x50d929[_0x4404d8]={'$like':'%'+_0x234faf[_0xbe91('0x3f')]['filter']+'%'};return _0x50d929;})});}_0x4cd7a1=_[_0xbe91('0x59')]({},_0x4cd7a1,_0x234faf[_0xbe91('0xcc')]);return _0x5efe70[_0xbe91('0xe2')](_0x4cd7a1);}})[_0xbe91('0x15')](function(_0x37f600){if(_0x37f600){_0x342773=_0x37f600[_0xbe91('0x49')];if(!_0x234faf[_0xbe91('0x3f')]['hasOwnProperty'](_0xbe91('0xd3'))){_0x4cd7a1[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x234faf[_0xbe91('0x3f')]['limit']);_0x4cd7a1[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x234faf[_0xbe91('0x3f')][_0xbe91('0x23')]);}return _0x5efe70[_0xbe91('0xe2')](_0x4cd7a1);}})[_0xbe91('0x15')](function(_0x1c5740){if(_0x1c5740){return _0x1c5740?{'count':_0x342773,'rows':_0x1c5740}:null;}})['then'](respondWithResult(_0x3e4209,null))['catch'](handleError(_0x3e4209,null));};exports[_0xbe91('0xe4')]=function(_0x52840d,_0x53cecd){var _0x536bd5={};var _0x5c1c2={};var _0x4b7f29;var _0x599511;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x52840d[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x53cecd,null))[_0xbe91('0x15')](function(_0x1bd097){if(_0x1bd097){_0x4b7f29=_0x1bd097;_0x5c1c2[_0xbe91('0x54')]=_['keys'](db[_0xbe91('0xe5')][_0xbe91('0x39')]);_0x5c1c2['query']=_[_0xbe91('0xc8')](_0x52840d[_0xbe91('0x3f')]);_0x5c1c2[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x5c1c2[_0xbe91('0x54')],_0x5c1c2['query']);_0x536bd5[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x5c1c2[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x52840d[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x536bd5[_0xbe91('0x45')]=_0x536bd5['attributes']['length']?_0x536bd5[_0xbe91('0x45')]:_0x5c1c2[_0xbe91('0x54')];_0x536bd5[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x52840d['query'][_0xbe91('0xca')]);_0x536bd5[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_['pick'](_0x52840d[_0xbe91('0x3f')],_0x5c1c2[_0xbe91('0x56')]));if(_0x52840d[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x536bd5[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x536bd5[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x536bd5[_0xbe91('0x45')],function(_0x200678){var _0x301afd={};_0x301afd[_0x200678]={'$like':'%'+_0x52840d[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x301afd;})});}_0x536bd5=_[_0xbe91('0x59')]({},_0x536bd5,_0x52840d['options']);return _0x4b7f29[_0xbe91('0xe4')](_0x536bd5);}})[_0xbe91('0x15')](function(_0x25e2d8){if(_0x25e2d8){_0x599511=_0x25e2d8['length'];if(!_0x52840d['query']['hasOwnProperty']('nolimit')){_0x536bd5[_0xbe91('0x25')]=qs[_0xbe91('0x25')](_0x52840d[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x536bd5[_0xbe91('0x23')]=qs[_0xbe91('0x23')](_0x52840d['query'][_0xbe91('0x23')]);}return _0x4b7f29['getFaxInteractions'](_0x536bd5);}})[_0xbe91('0x15')](function(_0x5c76eb){if(_0x5c76eb){return _0x5c76eb?{'count':_0x599511,'rows':_0x5c76eb}:null;}})['then'](respondWithResult(_0x53cecd,null))[_0xbe91('0x5d')](handleError(_0x53cecd,null));};exports[_0xbe91('0xe6')]=function(_0x493853,_0x4c3916){var _0x59bd62={};var _0x28fadf={};var _0x1fda54;var _0x3ed8fc;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x493853[_0xbe91('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c3916,null))[_0xbe91('0x15')](function(_0x53fea3){if(_0x53fea3){_0x1fda54=_0x53fea3;_0x28fadf[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0xe7')][_0xbe91('0x39')]);_0x28fadf['query']=_[_0xbe91('0xc8')](_0x493853[_0xbe91('0x3f')]);_0x28fadf[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x28fadf['model'],_0x28fadf[_0xbe91('0x3f')]);_0x59bd62[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x28fadf[_0xbe91('0x54')],qs['fields'](_0x493853[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x59bd62[_0xbe91('0x45')]=_0x59bd62[_0xbe91('0x45')][_0xbe91('0x49')]?_0x59bd62['attributes']:_0x28fadf[_0xbe91('0x54')];_0x59bd62['order']=qs[_0xbe91('0xca')](_0x493853[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x59bd62[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x493853[_0xbe91('0x3f')],_0x28fadf['filters']));if(_0x493853[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x59bd62[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x59bd62[_0xbe91('0x3e')],{'$or':_['map'](_0x59bd62[_0xbe91('0x45')],function(_0x28b93e){var _0x28215f={};_0x28215f[_0x28b93e]={'$like':'%'+_0x493853[_0xbe91('0x3f')]['filter']+'%'};return _0x28215f;})});}_0x59bd62=_[_0xbe91('0x59')]({},_0x59bd62,_0x493853['options']);return _0x1fda54[_0xbe91('0xe6')](_0x59bd62);}})['then'](function(_0x467e65){if(_0x467e65){_0x3ed8fc=_0x467e65[_0xbe91('0x49')];if(!_0x493853[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x59bd62[_0xbe91('0x25')]=qs['limit'](_0x493853[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x59bd62[_0xbe91('0x23')]=qs['offset'](_0x493853['query'][_0xbe91('0x23')]);}return _0x1fda54[_0xbe91('0xe6')](_0x59bd62);}})['then'](function(_0x9b4f99){if(_0x9b4f99){return _0x9b4f99?{'count':_0x3ed8fc,'rows':_0x9b4f99}:null;}})[_0xbe91('0x15')](respondWithResult(_0x4c3916,null))[_0xbe91('0x5d')](handleError(_0x4c3916,null));};exports[_0xbe91('0xe8')]=function(_0x4177c6,_0x19cfee,_0x2e0720){var _0x1da65e;var _0x409899;var _0x1ddee0;var _0x5c7731=!_[_0xbe91('0x66')](_0x4177c6['params']['id'])?_0x4177c6[_0xbe91('0x53')]['id']:!_[_0xbe91('0x66')](_0x4177c6[_0xbe91('0x7c')]['id'])?_0x4177c6[_0xbe91('0x7c')]['id']:null;return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x5c7731,'role':{'$or':[_0xbe91('0x7e'),'user',_0xbe91('0x29')]}},'attributes':['id','name',_0xbe91('0xe9'),_0xbe91('0xea'),_0xbe91('0x30'),_0xbe91('0x60'),'loginInPause']})[_0xbe91('0x15')](function(_0x343cf9){if(_0x343cf9){if(_0x343cf9[_0xbe91('0x30')]===_0xbe91('0x29')){_0x1da65e=_0x343cf9;if(_0x4177c6[_0xbe91('0x5b')][_0xbe91('0xa9')]){_0x1ddee0=util[_0xbe91('0xaa')](_0xbe91('0xeb'),_0x1da65e[_0x4177c6[_0xbe91('0x5b')][_0xbe91('0xa9')]]);}else if(_0x4177c6['body']['intrf']){_0x1ddee0=util['format'](_0xbe91('0xec'),_0x4177c6[_0xbe91('0x5b')][_0xbe91('0xed')]);}else{_0x1ddee0=util[_0xbe91('0xaa')](_0xbe91('0xec'),_0x1da65e[_0xbe91('0x35')]);}socket['to'](util[_0xbe91('0xaa')](_0xbe91('0xee'),_0x1da65e['name']))['emit'](_0xbe91('0xef'),{'user':{'id':_0x1da65e['id'],'name':_0x1da65e[_0xbe91('0x35')]},'ip':_0x4177c6[_0xbe91('0xf0')][_0xbe91('0xf1')]||_0x4177c6[_0xbe91('0xf2')]['remoteAddress']||_0x4177c6['socket'][_0xbe91('0xf3')]||_0x4177c6[_0xbe91('0xf2')][_0xbe91('0xf4')][_0xbe91('0xf3')]});return db['UserVoiceQueueRt'][_0xbe91('0x33')]({'where':{'membername':_0x1da65e[_0xbe91('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xbe91('0x15')](function(){if(_0x1da65e){return _0x1da65e[_0xbe91('0xf5')]({'raw':!![]});}})[_0xbe91('0x15')](function(_0x2937e9){if(_0x1da65e){var _0x26cc57=[];if(_0x2937e9){_0x409899=_0x2937e9;if(_0x409899['length']){for(var _0x521f57=0x0;_0x521f57<_0x409899[_0xbe91('0x49')];_0x521f57++){_0x26cc57[_0xbe91('0x4a')]({'membername':_0x1da65e['name'],'UserId':_0x1da65e['id'],'queue_name':_0x409899[_0x521f57][_0xbe91('0x35')],'VoiceQueueId':_0x409899[_0x521f57]['id'],'interface':_0x1ddee0,'paused':_0x1da65e[_0xbe91('0x9d')]||![],'penalty':_0x409899[_0x521f57][_0xbe91('0xf6')]||0x0});}return BPromise[_0xbe91('0x8b')](_0x26cc57,function(_0x48b947){return db[_0xbe91('0xab')][_0xbe91('0xac')](_0x48b947);});}}}})[_0xbe91('0x15')](function(){if(_0x1da65e){return db[_0xbe91('0xf7')]['findAll']({'where':{'membername':_0x1da65e[_0xbe91('0x35')],'exitAt':null}});}})[_0xbe91('0x15')](function(_0x23f23e){if(_0x1da65e){var _0x144de5=[];_0x23f23e[_0xbe91('0xf8')](function(_0x168afa){_0x144de5[_0xbe91('0x4a')](_0x168afa[_0xbe91('0x27')]({'exitAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9'))}));});return BPromise[_0xbe91('0x51')](_0x144de5);}})['then'](function(){if(_0x1da65e){var _0x3d0c34=[];var _0x3735cf=[];var _0x569a8a=utils['getChannels']();var _0x4b19e8={'membername':_0x1da65e[_0xbe91('0x35')],'interface':_0x1ddee0,'enterAt':moment()[_0xbe91('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1da65e[_0xbe91('0x30')],'internal':_0x1da65e[_0xbe91('0x60')]};_0x569a8a[_0xbe91('0xf8')](function(_0x51b46b){_0x3d0c34['push'](_[_0xbe91('0x59')]({'channel':_0x51b46b,'type':'LOGIN','data1':_0x4177c6[_0xbe91('0x5b')][_0xbe91('0xfa')],'data2':_0x1ddee0},_0x4b19e8));if(_0x1da65e[_0xbe91('0x9d')]){_0x3735cf['push'](_[_0xbe91('0x59')]({'channel':_0x51b46b,'type':_0xbe91('0xfb'),'data1':_0xbe91('0xfc')},_0x4b19e8));}});return db['MemberReport'][_0xbe91('0x88')](_0x3d0c34[_0xbe91('0xc6')](_0x3735cf),{'individualHooks':!![]});}})[_0xbe91('0x15')](function(){if(_0x1da65e){return _0x1da65e[_0xbe91('0x27')]({'online':!![],'lastLoginAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9')),'voicePause':_0x1da65e['loginInPause']||![],'mailPause':_0x1da65e[_0xbe91('0x9d')]||![],'chatPause':_0x1da65e['loginInPause']||![],'faxPause':_0x1da65e[_0xbe91('0x9d')]||![],'smsPause':_0x1da65e[_0xbe91('0x9d')]||![],'openchannelPause':_0x1da65e[_0xbe91('0x9d')]||![],'whatsappPause':_0x1da65e['loginInPause']||![],'pauseType':_0x1da65e[_0xbe91('0x9d')]?_0xbe91('0xfc'):null,'interface':_0x1ddee0,'lastPauseAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9'))});}})[_0xbe91('0x15')](function(_0x5d6e42){if(_0x4177c6[_0xbe91('0xfd')]){return _0x2e0720();}else{return BPromise[_0xbe91('0xfe')](_0x5d6e42)[_0xbe91('0x15')](respondWithResult(_0x19cfee,null));}})[_0xbe91('0x5d')](handleError(_0x19cfee,null));};exports['logout']=function(_0x37a245,_0x97c635){var _0x2789f2;return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x37a245['params']['id'],'role':_0xbe91('0x29')},'attributes':['id','name',_0xbe91('0x30')]})[_0xbe91('0x15')](handleEntityNotFound(_0x97c635,null))[_0xbe91('0x15')](function(_0x1f6196){if(_0x1f6196){_0x2789f2=_0x1f6196;return db[_0xbe91('0xab')][_0xbe91('0x33')]({'where':{'membername':_0x2789f2[_0xbe91('0x35')]},'individualHooks':!![]});}})[_0xbe91('0x15')](function(){return db[_0xbe91('0xf7')][_0xbe91('0x46')]({'where':{'membername':_0x2789f2['name'],'exitAt':null}});})['then'](function(_0x53f0ae){var _0x573802=[];_0x53f0ae['forEach'](function(_0xc319df){_0x573802[_0xbe91('0x4a')](_0xc319df[_0xbe91('0x27')]({'exitAt':moment()[_0xbe91('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xbe91('0x51')](_0x573802);})[_0xbe91('0x15')](function(){return _0x2789f2['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xbe91('0x15')](respondWithResult(_0x97c635,null))[_0xbe91('0x5d')](handleError(_0x97c635,null));};exports['pause']=function(_0x104e9e,_0x5a460a){var _0x61e92a;return db[_0xbe91('0xab')][_0xbe91('0x27')]({'paused':0x1},{'where':{'UserId':_0x104e9e[_0xbe91('0x53')]['id']},'individualHooks':!![]})[_0xbe91('0x15')](function(){return db[_0xbe91('0x38')]['find']({'where':{'id':_0x104e9e[_0xbe91('0x53')]['id'],'role':_0xbe91('0x29')},'attributes':['id',_0xbe91('0x35'),_0xbe91('0x30'),_0xbe91('0x60'),_0xbe91('0xa9')]});})[_0xbe91('0x15')](handleEntityNotFound(_0x5a460a,null))[_0xbe91('0x15')](function(_0x1164e5){if(_0x1164e5){_0x61e92a=_0x1164e5;return respondWithRpcPromise(_0xbe91('0xff'),_0xbe91('0x100'),{'id':_0x61e92a['id'],'name':_0x61e92a[_0xbe91('0x35')],'pause':!![]});}})['then'](function(){if(_0x61e92a){return db[_0xbe91('0xf7')][_0xbe91('0x46')]({'where':{'membername':_0x61e92a['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x42e1d6){if(_0x42e1d6[_0xbe91('0x49')]){var _0x39a398=moment()[_0xbe91('0xaa')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x32d1d7=0x0,_0x4203b=_0x42e1d6['length'];_0x32d1d7<_0x4203b;_0x32d1d7++){_0x42e1d6[_0x32d1d7]['updateAttributes']({'exitAt':_0x39a398});}}})[_0xbe91('0x15')](function(){var _0x251237=[];var _0x581615=utils[_0xbe91('0x101')]();_0x581615['forEach'](function(_0x12491c){_0x251237[_0xbe91('0x4a')]({'channel':_0x12491c,'membername':_0x61e92a[_0xbe91('0x35')],'interface':_['isNil'](_0x61e92a['interface'])?util['format'](_0xbe91('0xec'),_0x61e92a[_0xbe91('0x35')]):_0x61e92a[_0xbe91('0xa9')],'type':_0xbe91('0xfb'),'enterAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9')),'data1':_0x104e9e[_0xbe91('0x5b')][_0xbe91('0x3a')]||_0xbe91('0x102'),'role':_0x61e92a['role'],'internal':_0x61e92a[_0xbe91('0x60')]});});return db['MemberReport'][_0xbe91('0x88')](_0x251237,{'individualHooks':!![]});})[_0xbe91('0x15')](function(){return _0x61e92a[_0xbe91('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x104e9e['body'][_0xbe91('0x3a')]||_0xbe91('0x102'),'lastPauseAt':moment()[_0xbe91('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xbe91('0x15')](respondWithResult(_0x5a460a,null))[_0xbe91('0x5d')](handleError(_0x5a460a,null));};exports[_0xbe91('0x103')]=function(_0x37ee42,_0x50f1a0){var _0x50cfee;return db[_0xbe91('0x38')][_0xbe91('0x31')]({'where':{'id':_0x37ee42[_0xbe91('0x53')]['id']},'attributes':['id','name',_0xbe91('0x30'),_0xbe91('0x9e'),_0xbe91('0x104'),_0xbe91('0x105'),'faxPause',_0xbe91('0x106'),_0xbe91('0x107'),_0xbe91('0x108'),_0xbe91('0x109'),'lastPauseAt']})[_0xbe91('0x15')](handleEntityNotFound(_0x50f1a0,null))[_0xbe91('0x15')](function(_0x31ae70){if(_0x31ae70){_0x50cfee=_0x31ae70;if(_0x37ee42[_0xbe91('0x5b')][_0xbe91('0x9b')]&&!utils[_0xbe91('0x9f')](_0x37ee42['body'][_0xbe91('0x9b')])){throw new db[(_0xbe91('0x8f'))][(_0xbe91('0x90'))](_0xbe91('0xa0'));}switch(_0x37ee42[_0xbe91('0x5b')]['channel']){case _0xbe91('0xa8'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x50cfee['id'],'name':_0x50cfee['name'],'pause':![]})[_0xbe91('0x15')](function(){return db[_0xbe91('0xab')][_0xbe91('0x27')]({'paused':0x0},{'where':{'UserId':_0x50cfee['id']},'individualHooks':!![]});})[_0xbe91('0x15')](function(){return db['MemberReport'][_0xbe91('0x31')]({'where':{'channel':_0x37ee42[_0xbe91('0x5b')][_0xbe91('0x9b')],'membername':_0x50cfee[_0xbe91('0x35')],'type':_0xbe91('0xfb'),'exitAt':null}});})[_0xbe91('0x15')](function(_0x50341f){if(_0x50341f){return _0x50341f[_0xbe91('0x27')]({'exitAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9')),'data2':_0xbe91('0x10a')},{'individualHooks':!![]});}return null;})[_0xbe91('0x15')](function(){return _0x50cfee['update']({'voicePause':![]});});case _0xbe91('0x4e'):case _0xbe91('0x4b'):case _0xbe91('0x5a'):case _0xbe91('0x4c'):case _0xbe91('0x50'):case _0xbe91('0x4f'):return db['MemberReport'][_0xbe91('0x31')]({'where':{'channel':_0x37ee42[_0xbe91('0x5b')][_0xbe91('0x9b')],'membername':_0x50cfee['name'],'type':_0xbe91('0xfb'),'exitAt':null}})['then'](function(_0x4bf7ae){if(_0x4bf7ae){return _0x4bf7ae['update']({'exitAt':moment()[_0xbe91('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbe91('0x10a')},{'individualHooks':!![]});}return null;})[_0xbe91('0x15')](function(){var _0x3ac379={};_[_0xbe91('0x10b')](_0x3ac379,util[_0xbe91('0xaa')](_0xbe91('0x10c'),_0x37ee42[_0xbe91('0x5b')][_0xbe91('0x9b')],_0xbe91('0x10d')),![]);return _0x50cfee[_0xbe91('0x27')](_0x3ac379);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x50cfee['id'],'name':_0x50cfee[_0xbe91('0x35')],'pause':![]})[_0xbe91('0x15')](function(){return db[_0xbe91('0xab')]['update']({'paused':0x0},{'where':{'UserId':_0x50cfee['id']}});})[_0xbe91('0x15')](function(){return db[_0xbe91('0xf7')]['findAll']({'where':{'membername':_0x50cfee[_0xbe91('0x35')],'type':'PAUSE','exitAt':null}});})[_0xbe91('0x15')](function(_0x11db60){var _0x2ccae0=[];_0x11db60[_0xbe91('0xf8')](function(_0x2b8873){_0x2ccae0[_0xbe91('0x4a')](_0x2b8873['update']({'exitAt':moment()[_0xbe91('0xaa')](_0xbe91('0xf9')),'data2':_0xbe91('0x10a')}));});return BPromise[_0xbe91('0x51')](_0x2ccae0);})['then'](function(){return _0x50cfee[_0xbe91('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xbe91('0x15')](respondWithResult(_0x50f1a0,null))[_0xbe91('0x5d')](handleError(_0x50f1a0,null));};exports['getTeams']=function(_0x37c29f,_0xb18fa7){var _0x586616={};var _0x29084f={};var _0x2a1da1;var _0x488fee;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x37c29f[_0xbe91('0x53')]['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0xb18fa7,null))[_0xbe91('0x15')](function(_0x370725){if(_0x370725){_0x2a1da1=_0x370725;_0x29084f['model']=_[_0xbe91('0xc8')](db[_0xbe91('0x10e')][_0xbe91('0x39')]);_0x29084f[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x37c29f[_0xbe91('0x3f')]);_0x29084f[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x29084f[_0xbe91('0x54')],_0x29084f[_0xbe91('0x3f')]);_0x586616[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x29084f[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x37c29f[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x586616[_0xbe91('0x45')]=_0x586616[_0xbe91('0x45')][_0xbe91('0x49')]?_0x586616[_0xbe91('0x45')]:_0x29084f['model'];_0x586616[_0xbe91('0xc9')]=qs['sort'](_0x37c29f[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x586616[_0xbe91('0x3e')]=qs[_0xbe91('0x56')](_['pick'](_0x37c29f['query'],_0x29084f[_0xbe91('0x56')]));if(_0x37c29f[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x586616[_0xbe91('0x3e')]=_[_0xbe91('0x59')](_0x586616['where'],{'$or':_[_0xbe91('0x2e')](_0x586616[_0xbe91('0x45')],function(_0x3b19d9){var _0x3c73c4={};_0x3c73c4[_0x3b19d9]={'$like':'%'+_0x37c29f[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x3c73c4;})});}_0x586616=_[_0xbe91('0x59')]({},_0x586616,_0x37c29f[_0xbe91('0xcc')]);return _0x2a1da1[_0xbe91('0x10f')](_0x586616);}})[_0xbe91('0x15')](function(_0x592fd4){if(_0x592fd4){_0x488fee=_0x592fd4['length'];if(!_0x37c29f[_0xbe91('0x3f')]['hasOwnProperty'](_0xbe91('0xd3'))){_0x586616['limit']=qs[_0xbe91('0x25')](_0x37c29f[_0xbe91('0x3f')][_0xbe91('0x25')]);_0x586616['offset']=qs['offset'](_0x37c29f[_0xbe91('0x3f')][_0xbe91('0x23')]);}return _0x2a1da1[_0xbe91('0x10f')](_0x586616);}})[_0xbe91('0x15')](function(_0x552a5c){if(_0x552a5c){return _0x552a5c?{'count':_0x488fee,'rows':_0x552a5c}:null;}})[_0xbe91('0x15')](respondWithResult(_0xb18fa7,null))[_0xbe91('0x5d')](handleError(_0xb18fa7,null));};exports['addTeams']=function(_0xfd6a7f,_0x27ced5){return db['User']['find']({'where':{'id':_0xfd6a7f[_0xbe91('0x53')]['id']}})['then'](handleEntityNotFound(_0x27ced5,null))[_0xbe91('0x15')](function(_0x9c964f){if(_0x9c964f){var _0x49fad9=_0x9c964f[_0xbe91('0x28')]({'plain':!![]});return _0x9c964f[_0xbe91('0x110')](_0xfd6a7f[_0xbe91('0x5b')]['ids'],_[_0xbe91('0x5f')](_0xfd6a7f[_0xbe91('0x5b')],[_0xbe91('0xa3'),'id'])||{})[_0xbe91('0x15')](function(){for(var _0x169f12=0x0;_0x169f12<_0xfd6a7f['body'][_0xbe91('0xa3')]['length'];_0x169f12++){var _0x25a14a=[];var _0x2e0ccd={};db['Team']['findOne']({'where':{'id':_0xfd6a7f['body'][_0xbe91('0xa3')][_0x169f12]}})[_0xbe91('0x15')](function(_0x51a7c3){_0x2e0ccd=_0x51a7c3['dataValues'];_0x25a14a[_0xbe91('0x4a')](_0x51a7c3['getVoiceQueues']()[_0xbe91('0x15')](function(_0x120f13){for(var _0x4d3027=0x0;_0x4d3027<_0x120f13[_0xbe91('0x49')];_0x4d3027++){_0x120f13[_0x4d3027][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x112'));}return _0x120f13;}));_0x25a14a[_0xbe91('0x4a')](_0x51a7c3[_0xbe91('0x113')]()[_0xbe91('0x15')](function(_0x2046e5){for(var _0x5641eb=0x0;_0x5641eb<_0x2046e5['length'];_0x5641eb++){_0x2046e5[_0x5641eb][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x114'));}return _0x2046e5;}));_0x25a14a['push'](_0x51a7c3[_0xbe91('0x115')]()[_0xbe91('0x15')](function(_0x379fde){for(var _0x1d595f=0x0;_0x1d595f<_0x379fde['length'];_0x1d595f++){_0x379fde[_0x1d595f][_0xbe91('0x111')]('channel',_0xbe91('0x116'));}return _0x379fde;}));_0x25a14a[_0xbe91('0x4a')](_0x51a7c3[_0xbe91('0x117')]()[_0xbe91('0x15')](function(_0x68b25f){for(var _0x48a857=0x0;_0x48a857<_0x68b25f[_0xbe91('0x49')];_0x48a857++){_0x68b25f[_0x48a857][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x118'));}return _0x68b25f;}));_0x25a14a[_0xbe91('0x4a')](_0x51a7c3[_0xbe91('0x119')]()[_0xbe91('0x15')](function(_0x472504){for(var _0x350436=0x0;_0x350436<_0x472504['length'];_0x350436++){_0x472504[_0x350436][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x11a'));}return _0x472504;}));_0x25a14a[_0xbe91('0x4a')](_0x51a7c3['getFaxQueues']()['then'](function(_0x17ccd1){for(var _0x8628a4=0x0;_0x8628a4<_0x17ccd1[_0xbe91('0x49')];_0x8628a4++){_0x17ccd1[_0x8628a4]['setDataValue'](_0xbe91('0x9b'),_0xbe91('0x11b'));}return _0x17ccd1;}));_0x25a14a[_0xbe91('0x4a')](_0x51a7c3[_0xbe91('0x11c')]()[_0xbe91('0x15')](function(_0x3c5abe){for(var _0xc09efe=0x0;_0xc09efe<_0x3c5abe[_0xbe91('0x49')];_0xc09efe++){_0x3c5abe[_0xc09efe][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x11d'));}return _0x3c5abe;}));return BPromise[_0xbe91('0x51')](_0x25a14a);})['then'](function(_0x52cab5){var _0x3df7c6=_[_0xbe91('0x11e')](_0x52cab5);_0x25a14a=[];return db[_0xbe91('0x69')][_0xbe91('0x11f')](function(_0x23943c){for(var _0x3f5544=0x0;_0x3f5544<_0x3df7c6[_0xbe91('0x49')];_0x3f5544++){_0x25a14a['push'](_0x3df7c6[_0x3f5544][_0xbe91('0x120')](_0x49fad9['id']),{'transaction':_0x23943c});}return BPromise[_0xbe91('0x51')](_0x25a14a)[_0xbe91('0x15')](function(){if(_0x49fad9[_0xbe91('0x9c')]){return BPromise['each'](_[_0xbe91('0x2c')](_0x3df7c6,function(_0x2426ab){return _0x2426ab['getDataValue'](_0xbe91('0x9b'))==='Voice';}),function(_0x356757){return db[_0xbe91('0xab')]['upsert']({'membername':_0x49fad9[_0xbe91('0x35')],'UserId':_0x49fad9['id'],'queue_name':_0x356757[_0xbe91('0x35')],'VoiceQueueId':_0x356757['id'],'interface':_['isNil'](_0x49fad9[_0xbe91('0xa9')])?util['format'](_0xbe91('0xec'),_0x49fad9[_0xbe91('0x35')]):_0x49fad9[_0xbe91('0xa9')],'paused':_0x49fad9[_0xbe91('0x9e')]||![],'penalty':_0x49fad9['penalty']},{'transaction':_0x23943c});});}else{return;}})[_0xbe91('0x15')](function(){for(var _0x41deed=0x0;_0x41deed<_0x3df7c6[_0xbe91('0x49')];_0x41deed++){var _0x84a32c=_0x3df7c6[_0x41deed]['getDataValue']('channel');var _0x31e69b=_0x84a32c+_0xbe91('0xb1');socket[_0xbe91('0xb0')](_0xbe91('0x7c')+_0x84a32c+_0xbe91('0xa6'),{'UserId':_0x49fad9['id'],['queueField']:_0x3df7c6[_0x41deed]['id']});}});});})[_0xbe91('0x15')](function(){db['TeamVoicePrefix'][_0xbe91('0x97')]({'where':{'teamId':_0x2e0ccd['id']}})['then'](function(_0x6d6523){if(_0x6d6523){db[_0xbe91('0x121')][_0xbe91('0x7b')]({'UserId':_0xfd6a7f[_0xbe91('0x53')]['id'],'VoicePrefixId':_0x6d6523['VoicePrefixId']});}});});}});}})[_0xbe91('0x15')](respondWithStatusCode(_0x27ced5,null))['catch'](handleError(_0x27ced5,null));};exports[_0xbe91('0x122')]=function(_0xefbeae,_0x3fec2a){return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0xefbeae['params']['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x3fec2a,null))[_0xbe91('0x15')](function(_0x7ac152){if(_0x7ac152){var _0x175df1=_0x7ac152[_0xbe91('0x28')]({'plain':!![]});var _0x135de2=_0xefbeae[_0xbe91('0x3f')][_0xbe91('0xa3')];return _0x7ac152['removeTeams'](_0x135de2)[_0xbe91('0x15')](function(){for(var _0x2f5107=0x0;_0x2f5107<_0x135de2['length'];_0x2f5107++){var _0x3c420e=[];var _0x3f5ae5={};db['Team'][_0xbe91('0x97')]({'where':{'id':_0x135de2[_0x2f5107]}})['then'](function(_0x2b6665){_0x3f5ae5=_0x2b6665['dataValues'];_0x3c420e['push'](_0x2b6665['getVoiceQueues']()[_0xbe91('0x15')](function(_0x268f27){for(var _0x37d513=0x0;_0x37d513<_0x268f27[_0xbe91('0x49')];_0x37d513++){_0x268f27[_0x37d513][_0xbe91('0x111')]('channel',_0xbe91('0x112'));}return _0x268f27;}));_0x3c420e['push'](_0x2b6665[_0xbe91('0x113')]()[_0xbe91('0x15')](function(_0x129fa0){for(var _0x56f8c7=0x0;_0x56f8c7<_0x129fa0[_0xbe91('0x49')];_0x56f8c7++){_0x129fa0[_0x56f8c7][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x114'));}return _0x129fa0;}));_0x3c420e[_0xbe91('0x4a')](_0x2b6665[_0xbe91('0x115')]()[_0xbe91('0x15')](function(_0x563398){for(var _0x20dcdf=0x0;_0x20dcdf<_0x563398[_0xbe91('0x49')];_0x20dcdf++){_0x563398[_0x20dcdf][_0xbe91('0x111')]('channel',_0xbe91('0x116'));}return _0x563398;}));_0x3c420e[_0xbe91('0x4a')](_0x2b6665[_0xbe91('0x117')]()[_0xbe91('0x15')](function(_0x4d77d5){for(var _0x3d27f2=0x0;_0x3d27f2<_0x4d77d5['length'];_0x3d27f2++){_0x4d77d5[_0x3d27f2]['setDataValue'](_0xbe91('0x9b'),_0xbe91('0x118'));}return _0x4d77d5;}));_0x3c420e[_0xbe91('0x4a')](_0x2b6665[_0xbe91('0x119')]()[_0xbe91('0x15')](function(_0x8a3f3d){for(var _0x487f6e=0x0;_0x487f6e<_0x8a3f3d['length'];_0x487f6e++){_0x8a3f3d[_0x487f6e][_0xbe91('0x111')]('channel',_0xbe91('0x11a'));}return _0x8a3f3d;}));_0x3c420e['push'](_0x2b6665[_0xbe91('0x123')]()[_0xbe91('0x15')](function(_0x50b6ab){for(var _0x104463=0x0;_0x104463<_0x50b6ab['length'];_0x104463++){_0x50b6ab[_0x104463]['setDataValue'](_0xbe91('0x9b'),'Fax');}return _0x50b6ab;}));_0x3c420e['push'](_0x2b6665[_0xbe91('0x11c')]()[_0xbe91('0x15')](function(_0x23569c){for(var _0x35f3de=0x0;_0x35f3de<_0x23569c[_0xbe91('0x49')];_0x35f3de++){_0x23569c[_0x35f3de][_0xbe91('0x111')](_0xbe91('0x9b'),_0xbe91('0x11d'));}return _0x23569c;}));return BPromise['all'](_0x3c420e);})[_0xbe91('0x15')](function(_0xdf2dfb){var _0x27a999=_[_0xbe91('0x11e')](_0xdf2dfb);_0x3c420e=[];return db[_0xbe91('0x69')][_0xbe91('0x11f')](function(_0x327919){for(var _0x344b11=0x0;_0x344b11<_0x27a999[_0xbe91('0x49')];_0x344b11++){_0x3c420e['push'](_0x27a999[_0x344b11][_0xbe91('0x124')](_0x175df1['id']),{'transaction':_0x327919});}return BPromise[_0xbe91('0x51')](_0x3c420e)['then'](function(){if(_0x175df1[_0xbe91('0x9c')]){return BPromise[_0xbe91('0x8b')](_[_0xbe91('0x2c')](_0x27a999,function(_0x59ce2e){return _0x59ce2e['getDataValue']('channel')===_0xbe91('0x112');}),function(_0x3e6657){return db[_0xbe91('0xab')][_0xbe91('0x33')]({'where':{'VoiceQueueId':_0x3e6657['id'],'UserId':_0x175df1['id']},'transaction':_0x327919});});}else{return;}})['then'](function(){db['TeamVoicePrefix'][_0xbe91('0x97')]({'where':{'teamId':_0x3f5ae5['id']}})['then'](function(_0x12875f){if(_0x12875f){return db[_0xbe91('0x121')][_0xbe91('0x33')]({'where':{'UserId':_0x175df1['id'],'VoicePrefixId':_0x12875f[_0xbe91('0x4d')][_0xbe91('0x125')]}});}});})['then'](function(){for(var _0x8043a7=0x0;_0x8043a7<_0x27a999[_0xbe91('0x49')];_0x8043a7++){var _0x400317=_0x27a999[_0x8043a7][_0xbe91('0x126')](_0xbe91('0x9b'));var _0x5d13ef=_0x400317+'QueueId';socket[_0xbe91('0xb0')](_0xbe91('0x7c')+_0x400317+_0xbe91('0xb2'),{'UserId':_0x175df1['id'],['queueField']:_0x27a999[_0x8043a7]['id']});}});});});}});}})[_0xbe91('0x15')](respondWithStatusCode(_0x3fec2a,null))['catch'](handleError(_0x3fec2a,null));};exports[_0xbe91('0x127')]=function(_0x376a63,_0x501af7){var _0x285310={};var _0x1b844c={};var _0x21fbb7;var _0x3e26dd;return db['User'][_0xbe91('0x97')]({'where':{'id':_0x376a63['params']['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0x501af7,null))[_0xbe91('0x15')](function(_0x33e4db){if(_0x33e4db){_0x21fbb7=_0x33e4db;_0x1b844c[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0x128')][_0xbe91('0x39')]);_0x1b844c[_0xbe91('0x3f')]=_['keys'](_0x376a63[_0xbe91('0x3f')]);_0x1b844c['filters']=_[_0xbe91('0x57')](_0x1b844c[_0xbe91('0x54')],_0x1b844c['query']);_0x285310[_0xbe91('0x45')]=_[_0xbe91('0x57')](_0x1b844c[_0xbe91('0x54')],qs['fields'](_0x376a63[_0xbe91('0x3f')][_0xbe91('0x58')]));_0x285310[_0xbe91('0x45')]=_0x285310[_0xbe91('0x45')][_0xbe91('0x49')]?_0x285310[_0xbe91('0x45')]:_0x1b844c[_0xbe91('0x54')];_0x285310[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x376a63['query'][_0xbe91('0xca')]);_0x285310['where']=qs[_0xbe91('0x56')](_[_0xbe91('0xcb')](_0x376a63[_0xbe91('0x3f')],_0x1b844c['filters']));if(_0x376a63[_0xbe91('0x3f')]['filter']){_0x285310[_0xbe91('0x3e')]=_['merge'](_0x285310[_0xbe91('0x3e')],{'$or':_['map'](_0x285310[_0xbe91('0x45')],function(_0x305190){var _0x5d8b09={};_0x5d8b09[_0x305190]={'$like':'%'+_0x376a63[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x5d8b09;})});}_0x285310=_[_0xbe91('0x59')]({},_0x285310,_0x376a63[_0xbe91('0xcc')]);return _0x21fbb7[_0xbe91('0x127')](_0x285310);}})[_0xbe91('0x15')](function(_0x3e490c){if(_0x3e490c){_0x3e26dd=_0x3e490c['length'];if(!_0x376a63[_0xbe91('0x3f')][_0xbe91('0xce')](_0xbe91('0xd3'))){_0x285310[_0xbe91('0x25')]=qs['limit'](_0x376a63[_0xbe91('0x3f')]['limit']);_0x285310[_0xbe91('0x23')]=qs['offset'](_0x376a63['query'][_0xbe91('0x23')]);}return _0x21fbb7[_0xbe91('0x127')](_0x285310);}})[_0xbe91('0x15')](function(_0x281864){if(_0x281864){return _0x281864?{'count':_0x3e26dd,'rows':_0x281864}:null;}})[_0xbe91('0x15')](respondWithResult(_0x501af7,null))['catch'](handleError(_0x501af7,null));};exports[_0xbe91('0x129')]=function(_0x1b0d31,_0xe69d8f){var _0x1f1af7={};var _0x225e5a={};var _0xd0655a;return db[_0xbe91('0x38')][_0xbe91('0x97')]({'where':{'id':_0x1b0d31['params']['id']}})[_0xbe91('0x15')](handleEntityNotFound(_0xe69d8f,null))[_0xbe91('0x15')](function(_0x500635){if(_0x500635){_0xd0655a=_0x500635;_0x225e5a[_0xbe91('0x54')]=_[_0xbe91('0xc8')](db[_0xbe91('0x38')][_0xbe91('0x39')]);_0x225e5a[_0xbe91('0x3f')]=_[_0xbe91('0xc8')](_0x1b0d31[_0xbe91('0x3f')]);_0x225e5a[_0xbe91('0x56')]=_[_0xbe91('0x57')](_0x225e5a['model'],_0x225e5a['query']);_0x1f1af7['attributes']=_['intersection'](_0x225e5a[_0xbe91('0x54')],qs[_0xbe91('0x58')](_0x1b0d31['query'][_0xbe91('0x58')]));_0x1f1af7[_0xbe91('0x45')]=_0x1f1af7[_0xbe91('0x45')]['length']?_0x1f1af7[_0xbe91('0x45')]:_0x225e5a['model'];_0x1f1af7[_0xbe91('0xc9')]=qs[_0xbe91('0xca')](_0x1b0d31[_0xbe91('0x3f')][_0xbe91('0xca')]);_0x1f1af7[_0xbe91('0x3e')]=qs['filters'](_[_0xbe91('0xcb')](_0x1b0d31['query'],_0x225e5a['filters']));if(_0x1b0d31[_0xbe91('0x3f')][_0xbe91('0x2c')]){_0x1f1af7['where']=_[_0xbe91('0x59')](_0x1f1af7[_0xbe91('0x3e')],{'$or':_[_0xbe91('0x2e')](_0x1f1af7[_0xbe91('0x45')],function(_0x1e0670){var _0x22b649={};_0x22b649[_0x1e0670]={'$like':'%'+_0x1b0d31[_0xbe91('0x3f')][_0xbe91('0x2c')]+'%'};return _0x22b649;})});}_0x1f1af7[_0xbe91('0x54')]=db[_0xbe91('0x38')];_0x1f1af7['as']='Agents';_0x1f1af7=_[_0xbe91('0x59')]({},_0x1f1af7,_0x1b0d31['options']);return _0xd0655a[_0xbe91('0xf5')]({'include':[_0x1f1af7]});}})[_0xbe91('0x15')](function(_0x351893){if(_0x351893){var _0x3f8a7e={},_0x5055b5=[];for(var _0xc732d6=0x0;_0xc732d6<_0x351893['length'];_0xc732d6+=0x1){for(var _0x3ea86c=0x0,_0x11af9f;_0x3ea86c<_0x351893[_0xc732d6][_0xbe91('0x85')][_0xbe91('0x49')];_0x3ea86c+=0x1){_0x11af9f=_0x351893[_0xc732d6][_0xbe91('0x85')][_0x3ea86c][_0xbe91('0x28')]({'plain':!![]});_0x3f8a7e[_0x11af9f['id']]=_0x11af9f;}}_0x3f8a7e=_[_0xbe91('0x12a')](_0x3f8a7e);for(var _0x34cdb7=qs['offset'](_0x1b0d31[_0xbe91('0x3f')][_0xbe91('0x23')]);_0x34cdb7<_0x3f8a7e['length']&&_0x5055b5[_0xbe91('0x49')]=_0x5454ee[_0x1236('0x55')]){throw new Error(_0x1236('0x56'));}})[_0x1236('0x12')](function(){if(_0x4e320b){return db[_0x1236('0x2b')]['destroy']({'where':{'membername':_0x4e320b[_0x1236('0x27')]},'individualHooks':!![]});}})[_0x1236('0x12')](function(){if(_0x4e320b){return _0x4e320b['getVoiceQueues']({'raw':!![]});}})[_0x1236('0x12')](function(_0x5bd8c7){if(_0x4e320b){if(_0x5bd8c7){var _0x204b42=[];_0x5d2e46=_0x5bd8c7;if(_0x5d2e46['length']){for(var _0x53d053=0x0;_0x53d053<_0x5d2e46[_0x1236('0x2f')];_0x53d053++){_0x204b42[_0x1236('0x34')](db[_0x1236('0x2b')]['upsert']({'membername':_0x4e320b[_0x1236('0x27')],'UserId':_0x4e320b['id'],'queue_name':_0x5d2e46[_0x53d053][_0x1236('0x27')],'VoiceQueueId':_0x5d2e46[_0x53d053]['id'],'interface':_0x22532e,'paused':_0x4e320b['loginInPause']||![],'penalty':_0x5d2e46[_0x53d053][_0x1236('0x57')]||0x0}));}return BPromise[_0x1236('0x4b')](_0x204b42);}}}})[_0x1236('0x12')](function(){if(_0x4e320b){return db[_0x1236('0x2c')][_0x1236('0x2d')]({'where':{'membername':_0x4e320b[_0x1236('0x27')],'exitAt':null}});}})[_0x1236('0x12')](function(_0x135dbf){if(_0x4e320b){if(_0x135dbf&&_0x135dbf[_0x1236('0x2f')]){var _0x264fcb=[];_0x135dbf[_0x1236('0x33')](function(_0x321f6e){_0x264fcb[_0x1236('0x34')](_0x321f6e[_0x1236('0x3d')]({'exitAt':moment()[_0x1236('0x30')](_0x1236('0x37'))}));});return BPromise[_0x1236('0x4b')](_0x264fcb);}}})[_0x1236('0x12')](function(_0x2fd6c6){if(_0x4e320b){var _0x2a738d=[];var _0x25f543=[];var _0x2f31bd=utils[_0x1236('0x32')]();var _0x27a295={'membername':_0x4e320b[_0x1236('0x27')],'interface':_0x22532e,'enterAt':moment()[_0x1236('0x30')](_0x1236('0x37')),'role':_0x4e320b[_0x1236('0x28')],'internal':_0x4e320b[_0x1236('0x29')]};_0x2f31bd[_0x1236('0x33')](function(_0x3b6b10){_0x2a738d[_0x1236('0x34')](_['merge']({'channel':_0x3b6b10,'type':'LOGIN','data1':'callysquare','data2':_0x22532e},_0x27a295));if(_0x4e320b[_0x1236('0x50')]){_0x25f543[_0x1236('0x34')](_[_0x1236('0x58')]({'channel':_0x3b6b10,'type':'PAUSE','data1':'LOGININPAUSE'},_0x27a295));}});return db[_0x1236('0x2c')][_0x1236('0x3c')](_0x2a738d[_0x1236('0x59')](_0x25f543),{'individualHooks':!![]});}})[_0x1236('0x12')](function(){if(_0x4e320b){return _0x4e320b[_0x1236('0x3d')]({'online':!![],'lastLoginAt':moment()[_0x1236('0x30')](_0x1236('0x37')),'voicePause':_0x4e320b[_0x1236('0x50')]||![],'mailPause':_0x4e320b[_0x1236('0x50')]||![],'chatPause':_0x4e320b[_0x1236('0x50')]||![],'faxPause':_0x4e320b[_0x1236('0x50')]||![],'smsPause':_0x4e320b['loginInPause']||![],'openchannelPause':_0x4e320b[_0x1236('0x50')]||![],'pauseType':_0x4e320b[_0x1236('0x50')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x22532e});}})['then'](function(_0x3a0f49){_0x59cbdd(_0x3a0f49);})[_0x1236('0x1a')](function(_0x47eb7e){_0x33abe3(_0x3bdc42['error'](0x1f4,_0x47eb7e[_0x1236('0x18')]));});});}; \ No newline at end of file +var _0x8d3c=['getVoiceQueues','upsert','LOGIN','callysquare','merge','concat','LOGININPAUSE','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./user.socket','register','request','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','info','result','catch','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowUser','PauseUser','name','role','interface','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','body','findOne','channel','isValidChannel','Unknown\x20channel','UserVoiceQueueRt','chat','fax','sms','openchannel','whatsapp','system','set','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0xc150d3,_0x2f83ea){var _0x55e9ee=function(_0x494cbb){while(--_0x494cbb){_0xc150d3['push'](_0xc150d3['shift']());}};_0x55e9ee(++_0x2f83ea);}(_0x8d3c,0x183));var _0xc8d3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8d3c[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xc8d3('0x0'));var moment=require(_0xc8d3('0x1'));var BPromise=require(_0xc8d3('0x2'));var rs=require(_0xc8d3('0x3'));var fs=require('fs');var Redis=require(_0xc8d3('0x4'));var db=require(_0xc8d3('0x5'))['db'];var utils=require(_0xc8d3('0x6'));var logger=require(_0xc8d3('0x7'))(_0xc8d3('0x8'));var config=require(_0xc8d3('0x9'));var jayson=require(_0xc8d3('0xa'));var client=jayson[_0xc8d3('0xb')][_0xc8d3('0xc')]({'port':0x232a});config[_0xc8d3('0xd')]=_['defaults'](config[_0xc8d3('0xd')],{'host':_0xc8d3('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8d3('0xd')]));require(_0xc8d3('0xf'))[_0xc8d3('0x10')](socket);function respondWithRpcPromise(_0x1626d7,_0x3050d8,_0x2f2930){return new BPromise(function(_0x266927,_0x101a1e){return client[_0xc8d3('0x11')](_0x1626d7,_0x2f2930)[_0xc8d3('0x12')](function(_0x46a5d4){logger['info']('User,\x20%s,\x20%s',_0x3050d8,_0xc8d3('0x13'));logger[_0xc8d3('0x14')](_0xc8d3('0x15'),_0x3050d8,'request\x20sent',JSON['stringify'](_0x46a5d4));if(_0x46a5d4[_0xc8d3('0x16')]){if(_0x46a5d4[_0xc8d3('0x16')][_0xc8d3('0x17')]===0x1f4){logger[_0xc8d3('0x16')](_0xc8d3('0x18'),_0x3050d8,_0x46a5d4['error'][_0xc8d3('0x19')]);return _0x101a1e(_0x46a5d4['error'][_0xc8d3('0x19')]);}logger[_0xc8d3('0x16')](_0xc8d3('0x18'),_0x3050d8,_0x46a5d4['error'][_0xc8d3('0x19')]);return _0x266927(_0x46a5d4[_0xc8d3('0x16')][_0xc8d3('0x19')]);}else{logger[_0xc8d3('0x1a')](_0xc8d3('0x18'),_0x3050d8,_0xc8d3('0x13'));_0x266927(_0x46a5d4[_0xc8d3('0x1b')]['message']);}})[_0xc8d3('0x1c')](function(_0x2b7a0b){logger[_0xc8d3('0x16')](_0xc8d3('0x18'),_0x3050d8,_0x2b7a0b);_0x101a1e(_0x2b7a0b);});});}exports[_0xc8d3('0x1d')]=function(_0x510cb3){var _0x329b1e=this;return new Promise(function(_0x38cb41,_0x2e5277){return db[_0xc8d3('0x1e')][_0xc8d3('0x1f')]({'raw':_0x510cb3[_0xc8d3('0x20')]?_0x510cb3['options'][_0xc8d3('0x21')]===undefined?!![]:![]:!![],'where':_0x510cb3[_0xc8d3('0x20')]?_0x510cb3[_0xc8d3('0x20')][_0xc8d3('0x22')]||null:null,'attributes':_0x510cb3[_0xc8d3('0x20')]?_0x510cb3[_0xc8d3('0x20')]['attributes']||null:null,'limit':_0x510cb3[_0xc8d3('0x20')]?_0x510cb3[_0xc8d3('0x20')][_0xc8d3('0x23')]||null:null,'include':_0x510cb3[_0xc8d3('0x20')]?_0x510cb3['options'][_0xc8d3('0x24')]?_[_0xc8d3('0x25')](_0x510cb3['options']['include'],function(_0x33b06a){return{'model':db[_0x33b06a[_0xc8d3('0x26')]],'as':_0x33b06a['as'],'attributes':_0x33b06a[_0xc8d3('0x27')],'include':_0x33b06a['include']?_[_0xc8d3('0x25')](_0x33b06a[_0xc8d3('0x24')],function(_0xe0998e){return{'model':db[_0xe0998e[_0xc8d3('0x26')]],'as':_0xe0998e['as'],'attributes':_0xe0998e[_0xc8d3('0x27')],'include':_0xe0998e['include']?_[_0xc8d3('0x25')](_0xe0998e[_0xc8d3('0x24')],function(_0x3be553){return{'model':db[_0x3be553[_0xc8d3('0x26')]],'as':_0x3be553['as'],'attributes':_0x3be553[_0xc8d3('0x27')]};}):[]};}):[]};}):[]:[]})[_0xc8d3('0x12')](function(_0x433daa){logger[_0xc8d3('0x1a')](_0xc8d3('0x1d'),_0x510cb3);logger[_0xc8d3('0x14')]('GetUser',_0x510cb3,JSON[_0xc8d3('0x28')](_0x433daa));_0x38cb41(_0x433daa);})[_0xc8d3('0x1c')](function(_0x436c9f){logger[_0xc8d3('0x16')](_0xc8d3('0x1d'),_0x436c9f['message'],_0x510cb3);_0x2e5277(_0x329b1e['error'](0x1f4,_0x436c9f[_0xc8d3('0x19')]));});});};exports['ShowUser']=function(_0x42babd){var _0xbdf1b6=this;return new Promise(function(_0xb03ef1,_0x2bc0e8){return db[_0xc8d3('0x1e')][_0xc8d3('0x29')]({'raw':_0x42babd[_0xc8d3('0x20')]?_0x42babd['options'][_0xc8d3('0x21')]===undefined?!![]:![]:!![],'where':_0x42babd['options']?_0x42babd[_0xc8d3('0x20')][_0xc8d3('0x22')]||null:null,'attributes':_0x42babd['options']?_0x42babd['options'][_0xc8d3('0x27')]||null:null,'include':_0x42babd[_0xc8d3('0x20')]?_0x42babd[_0xc8d3('0x20')][_0xc8d3('0x24')]?_[_0xc8d3('0x25')](_0x42babd[_0xc8d3('0x20')][_0xc8d3('0x24')],function(_0x46a80b){return{'model':db[_0x46a80b[_0xc8d3('0x26')]],'as':_0x46a80b['as'],'attributes':_0x46a80b[_0xc8d3('0x27')],'include':_0x46a80b[_0xc8d3('0x24')]?_[_0xc8d3('0x25')](_0x46a80b[_0xc8d3('0x24')],function(_0x264803){return{'model':db[_0x264803[_0xc8d3('0x26')]],'as':_0x264803['as'],'attributes':_0x264803[_0xc8d3('0x27')],'include':_0x264803[_0xc8d3('0x24')]?_[_0xc8d3('0x25')](_0x264803[_0xc8d3('0x24')],function(_0x4e0eb4){return{'model':db[_0x4e0eb4[_0xc8d3('0x26')]],'as':_0x4e0eb4['as'],'attributes':_0x4e0eb4[_0xc8d3('0x27')]};}):[]};}):[]};}):[]:[]})[_0xc8d3('0x12')](function(_0x480c01){logger[_0xc8d3('0x1a')](_0xc8d3('0x2a'),_0x42babd);logger[_0xc8d3('0x14')](_0xc8d3('0x2a'),_0x42babd,JSON['stringify'](_0x480c01));_0xb03ef1(_0x480c01);})[_0xc8d3('0x1c')](function(_0x3b4f83){logger[_0xc8d3('0x16')]('ShowUser',_0x3b4f83[_0xc8d3('0x19')],_0x42babd);_0x2bc0e8(_0xbdf1b6[_0xc8d3('0x16')](0x1f4,_0x3b4f83[_0xc8d3('0x19')]));});});};exports[_0xc8d3('0x2b')]=function(_0x1264a8){var _0x25b263=this;return new Promise(function(_0x607c64,_0x14f7f4){var _0xe18a4;return db[_0xc8d3('0x1e')][_0xc8d3('0x29')]({'where':_0x1264a8[_0xc8d3('0x20')][_0xc8d3('0x22')]||{},'attributes':['id',_0xc8d3('0x2c'),_0xc8d3('0x2d'),'internal',_0xc8d3('0x2e')]})[_0xc8d3('0x12')](function(_0x3016ce){if(_0x3016ce){_0xe18a4=_0x3016ce;return db['UserVoiceQueueRt'][_0xc8d3('0x2f')]({'paused':0x1},{'where':{'UserId':_0xe18a4['id']},'individualHooks':!![]});}})[_0xc8d3('0x12')](function(){if(_0xe18a4){return db[_0xc8d3('0x30')][_0xc8d3('0x1f')]({'where':{'membername':_0xe18a4[_0xc8d3('0x2c')],'type':_0xc8d3('0x31'),'exitAt':null}});}})[_0xc8d3('0x12')](function(_0xe9d6b4){if(_0xe18a4){if(_0xe9d6b4&&_0xe9d6b4[_0xc8d3('0x32')]){var _0x57501b=moment()[_0xc8d3('0x33')](_0xc8d3('0x34'));for(var _0x1e0636=0x0,_0x1093e7=_0xe9d6b4['length'];_0x1e0636<_0x1093e7;_0x1e0636++){_0xe9d6b4[_0x1e0636][_0xc8d3('0x35')]({'exitAt':_0x57501b});}}}})['then'](function(){if(_0xe18a4){var _0x3933e7=[];var _0x5e15d7=utils[_0xc8d3('0x36')]();_0x5e15d7[_0xc8d3('0x37')](function(_0x715662){_0x3933e7[_0xc8d3('0x38')]({'channel':_0x715662,'membername':_0xe18a4[_0xc8d3('0x2c')],'interface':_[_0xc8d3('0x39')](_0xe18a4[_0xc8d3('0x2e')])?util[_0xc8d3('0x33')](_0xc8d3('0x3a'),_0xe18a4[_0xc8d3('0x2c')]):_0xe18a4[_0xc8d3('0x2e')],'type':'PAUSE','enterAt':moment()[_0xc8d3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1264a8['body'][_0xc8d3('0x3b')]||_0xc8d3('0x3c'),'role':_0xe18a4['role'],'internal':_0xe18a4['internal'],'uniqueid':_0x1264a8['body'][_0xc8d3('0x3d')]||null});});return db[_0xc8d3('0x30')][_0xc8d3('0x3e')](_0x3933e7,{'individualHooks':!![]});}})['then'](function(){if(_0xe18a4){return _0xe18a4[_0xc8d3('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1264a8[_0xc8d3('0x3f')][_0xc8d3('0x3b')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xc8d3('0x33')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xc8d3('0x12')](function(_0x542cb5){_0x607c64(_0x542cb5);})[_0xc8d3('0x1c')](function(_0x4ac4d2){_0x14f7f4(_0x25b263[_0xc8d3('0x16')](0x1f4,_0x4ac4d2['message']));});});};exports['UnpauseUser']=function(_0x27bb69){var _0x154dca=this;return new Promise(function(_0x4f95d4,_0x553e8d){var _0x186051;return db[_0xc8d3('0x1e')][_0xc8d3('0x40')]({'where':_0x27bb69[_0xc8d3('0x20')]['where']||{},'attributes':['id','name']})[_0xc8d3('0x12')](function(_0x54ebfe){if(_0x54ebfe){_0x186051=_0x54ebfe;if(_0x27bb69[_0xc8d3('0x3f')][_0xc8d3('0x41')]&&!utils[_0xc8d3('0x42')](_0x27bb69[_0xc8d3('0x3f')][_0xc8d3('0x41')])){throw new Error(_0xc8d3('0x43'));}switch(_0x27bb69[_0xc8d3('0x3f')][_0xc8d3('0x41')]){case'voice':return db[_0xc8d3('0x44')][_0xc8d3('0x2f')]({'paused':0x0},{'where':{'UserId':_0x186051['id']}})[_0xc8d3('0x12')](function(){return db[_0xc8d3('0x30')][_0xc8d3('0x29')]({'where':{'channel':_0x27bb69[_0xc8d3('0x3f')][_0xc8d3('0x41')],'membername':_0x186051[_0xc8d3('0x2c')],'type':_0xc8d3('0x31'),'exitAt':null}});})[_0xc8d3('0x12')](function(_0x345271){if(_0x345271){return _0x345271[_0xc8d3('0x2f')]({'exitAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x186051['update']({'voicePause':![]});});case'mail':case _0xc8d3('0x45'):case _0xc8d3('0x46'):case _0xc8d3('0x47'):case _0xc8d3('0x48'):case _0xc8d3('0x49'):return db[_0xc8d3('0x30')]['find']({'where':{'channel':_0x27bb69['body'][_0xc8d3('0x41')],'membername':_0x186051[_0xc8d3('0x2c')],'type':_0xc8d3('0x31'),'exitAt':null}})[_0xc8d3('0x12')](function(_0x405edb){return _0x405edb[_0xc8d3('0x2f')]({'exitAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'data2':_0xc8d3('0x4a')},{'individualHooks':!![]});})[_0xc8d3('0x12')](function(){var _0x5b8d72={};_[_0xc8d3('0x4b')](_0x5b8d72,util[_0xc8d3('0x33')]('%s%s',_0x27bb69['body'][_0xc8d3('0x41')],_0xc8d3('0x4c')),![]);return _0x186051[_0xc8d3('0x2f')](_0x5b8d72);});default:return db[_0xc8d3('0x44')][_0xc8d3('0x2f')]({'paused':0x0},{'where':{'UserId':_0x186051['id']}})[_0xc8d3('0x12')](function(){return db['MemberReport'][_0xc8d3('0x1f')]({'where':{'membername':_0x186051[_0xc8d3('0x2c')],'type':_0xc8d3('0x31'),'exitAt':null}});})[_0xc8d3('0x12')](function(_0x5b0fd9){var _0x175864=[];_0x5b0fd9[_0xc8d3('0x37')](function(_0x2c1e2d){_0x175864['push'](_0x2c1e2d[_0xc8d3('0x2f')]({'exitAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'data2':_0xc8d3('0x4a')}));});return BPromise[_0xc8d3('0x4d')](_0x175864);})[_0xc8d3('0x12')](function(){return _0x186051[_0xc8d3('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xc8d3('0x12')](function(_0x18a0cb){_0x4f95d4(_0x18a0cb);})[_0xc8d3('0x1c')](function(_0x1c39da){_0x553e8d(_0x154dca['error'](0x1f4,_0x1c39da['message']));});});};exports[_0xc8d3('0x4e')]=function(_0x108ee6){var _0x51f770=this;return new Promise(function(_0x19be6c,_0x404548){var _0x11327f;return db[_0xc8d3('0x1e')][_0xc8d3('0x40')]({'where':_0x108ee6[_0xc8d3('0x20')][_0xc8d3('0x22')]||{},'attributes':['id',_0xc8d3('0x2c')]})['then'](function(_0x393e59){if(_0x393e59){_0x11327f=_0x393e59;return db['UserVoiceQueueRt'][_0xc8d3('0x4f')]({'where':{'membername':_0x11327f['name']},'individualHooks':!![]});}})[_0xc8d3('0x12')](function(){if(_0x11327f){return db[_0xc8d3('0x30')][_0xc8d3('0x1f')]({'where':{'membername':_0x11327f[_0xc8d3('0x2c')],'exitAt':null}});}})[_0xc8d3('0x12')](function(_0x1f979e){if(_0x11327f){if(_0x1f979e&&_0x1f979e['length']){var _0x3f44c6=[];_0x1f979e['forEach'](function(_0x36cb65){_0x3f44c6[_0xc8d3('0x38')](_0x36cb65[_0xc8d3('0x2f')]({'exitAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34'))}));});return BPromise['all'](_0x3f44c6);}}})[_0xc8d3('0x12')](function(){if(_0x11327f){return _0x11327f[_0xc8d3('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xc8d3('0x12')](function(_0x102c26){_0x19be6c(_0x102c26);})['catch'](function(_0x45f513){_0x404548(_0x51f770[_0xc8d3('0x16')](0x1f4,_0x45f513[_0xc8d3('0x19')]));});});};exports[_0xc8d3('0x50')]=function(_0x66affd){var _0x3dc6fe=this;return new Promise(function(_0x4a4a8d,_0x278a6b){var _0x4b233d;var _0x37fb07;var _0x3b031d;var _0x394ed4;return db['User'][_0xc8d3('0x40')]({'where':_0x66affd['options'][_0xc8d3('0x22')]||{},'attributes':['id','name',_0xc8d3('0x2d'),_0xc8d3('0x51'),_0xc8d3('0x52'),'internal',_0xc8d3('0x53'),_0xc8d3('0x2e')]})[_0xc8d3('0x12')](function(_0x1cf33c){if(_0x1cf33c){_0x4b233d=_0x1cf33c;_0x394ed4=_0x66affd[_0xc8d3('0x3f')][_0xc8d3('0x2e')]?_0x66affd[_0xc8d3('0x3f')][_0xc8d3('0x2e')]:util[_0xc8d3('0x33')](_0xc8d3('0x3a'),_0x4b233d['name']);return db[_0xc8d3('0x1e')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4b233d['id']}}});}})['then'](function(_0x9e6447){if(_0x9e6447){_0x3b031d=_0x9e6447;return require(_0xc8d3('0x54'))[_0xc8d3('0x55')]();}})['then'](function(_0x266c99){if(_0x266c99&&_0x266c99[_0xc8d3('0x56')]&&_0x3b031d>=_0x266c99[_0xc8d3('0x56')]){throw new Error(_0xc8d3('0x57'));}})[_0xc8d3('0x12')](function(){if(_0x4b233d){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4b233d[_0xc8d3('0x2c')]},'individualHooks':!![]});}})[_0xc8d3('0x12')](function(){if(_0x4b233d){return _0x4b233d[_0xc8d3('0x58')]({'raw':!![]});}})['then'](function(_0x5116a6){if(_0x4b233d){if(_0x5116a6){var _0x52f086=[];_0x37fb07=_0x5116a6;if(_0x37fb07[_0xc8d3('0x32')]){for(var _0x9b29f7=0x0;_0x9b29f7<_0x37fb07['length'];_0x9b29f7++){_0x52f086[_0xc8d3('0x38')](db['UserVoiceQueueRt'][_0xc8d3('0x59')]({'membername':_0x4b233d[_0xc8d3('0x2c')],'UserId':_0x4b233d['id'],'queue_name':_0x37fb07[_0x9b29f7][_0xc8d3('0x2c')],'VoiceQueueId':_0x37fb07[_0x9b29f7]['id'],'interface':_0x394ed4,'paused':_0x4b233d['loginInPause']||![],'penalty':_0x37fb07[_0x9b29f7]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xc8d3('0x4d')](_0x52f086);}}}})[_0xc8d3('0x12')](function(){if(_0x4b233d){return db[_0xc8d3('0x30')][_0xc8d3('0x1f')]({'where':{'membername':_0x4b233d[_0xc8d3('0x2c')],'exitAt':null}});}})[_0xc8d3('0x12')](function(_0x3346d0){if(_0x4b233d){if(_0x3346d0&&_0x3346d0['length']){var _0x49ca0e=[];_0x3346d0[_0xc8d3('0x37')](function(_0x2a1e51){_0x49ca0e['push'](_0x2a1e51['update']({'exitAt':moment()['format'](_0xc8d3('0x34'))}));});return BPromise[_0xc8d3('0x4d')](_0x49ca0e);}}})['then'](function(_0x453b57){if(_0x4b233d){var _0x33b1f5=[];var _0x522483=[];var _0x4440fc=utils['getChannels']();var _0x255947={'membername':_0x4b233d[_0xc8d3('0x2c')],'interface':_0x394ed4,'enterAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'role':_0x4b233d[_0xc8d3('0x2d')],'internal':_0x4b233d['internal']};_0x4440fc[_0xc8d3('0x37')](function(_0x11f323){_0x33b1f5[_0xc8d3('0x38')](_['merge']({'channel':_0x11f323,'type':_0xc8d3('0x5a'),'data1':_0xc8d3('0x5b'),'data2':_0x394ed4},_0x255947));if(_0x4b233d[_0xc8d3('0x53')]){_0x522483[_0xc8d3('0x38')](_[_0xc8d3('0x5c')]({'channel':_0x11f323,'type':_0xc8d3('0x31'),'data1':'LOGININPAUSE'},_0x255947));}});return db['MemberReport'][_0xc8d3('0x3e')](_0x33b1f5[_0xc8d3('0x5d')](_0x522483),{'individualHooks':!![]});}})[_0xc8d3('0x12')](function(){if(_0x4b233d){return _0x4b233d[_0xc8d3('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'voicePause':_0x4b233d['loginInPause']||![],'mailPause':_0x4b233d[_0xc8d3('0x53')]||![],'chatPause':_0x4b233d[_0xc8d3('0x53')]||![],'faxPause':_0x4b233d[_0xc8d3('0x53')]||![],'smsPause':_0x4b233d[_0xc8d3('0x53')]||![],'openchannelPause':_0x4b233d['loginInPause']||![],'pauseType':_0x4b233d[_0xc8d3('0x53')]?_0xc8d3('0x5e'):null,'lastPauseAt':moment()[_0xc8d3('0x33')](_0xc8d3('0x34')),'interface':_0x394ed4});}})['then'](function(_0x526b2c){_0x4a4a8d(_0x526b2c);})[_0xc8d3('0x1c')](function(_0x3a1df9){_0x278a6b(_0x3dc6fe[_0xc8d3('0x16')](0x1f4,_0x3a1df9[_0xc8d3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 724f10f..7bee8c0 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 _0x2b12=['removeListener','register','length','user:','save','remove','update'];(function(_0x10f686,_0x541b76){var _0x325a7a=function(_0x46438c){while(--_0x46438c){_0x10f686['push'](_0x10f686['shift']());}};_0x325a7a(++_0x541b76);}(_0x2b12,0xd6));var _0x22b1=function(_0x1cffa9,_0x4458a1){_0x1cffa9=_0x1cffa9-0x0;var _0x5dc170=_0x2b12[_0x1cffa9];return _0x5dc170;};'use strict';var UserEvents=require('./user.events');var events=[_0x22b1('0x0'),_0x22b1('0x1'),_0x22b1('0x2')];function createListener(_0x5c4665,_0xe8acb1){return function(_0x572512){_0xe8acb1['emit'](_0x5c4665,_0x572512);};}function removeListener(_0x5352d9,_0x18c53f){return function(){UserEvents[_0x22b1('0x3')](_0x5352d9,_0x18c53f);};}exports[_0x22b1('0x4')]=function(_0xd7e031){for(var _0x46b6c8=0x0,_0x5e0c12=events[_0x22b1('0x5')];_0x46b6c8<_0x5e0c12;_0x46b6c8++){var _0x10baff=events[_0x46b6c8];var _0x954d25=createListener(_0x22b1('0x6')+_0x10baff,_0xd7e031);UserEvents['on'](_0x10baff,_0x954d25);}}; \ No newline at end of file +var _0x36b2=['emit','removeListener','register','length','user:','./user.events','update'];(function(_0x317b63,_0x2acf92){var _0x36a2e2=function(_0x11024b){while(--_0x11024b){_0x317b63['push'](_0x317b63['shift']());}};_0x36a2e2(++_0x2acf92);}(_0x36b2,0xad));var _0x236b=function(_0x123144,_0x166d6b){_0x123144=_0x123144-0x0;var _0x5d209e=_0x36b2[_0x123144];return _0x5d209e;};'use strict';var UserEvents=require(_0x236b('0x0'));var events=['save','remove',_0x236b('0x1')];function createListener(_0x23a08a,_0x4ac703){return function(_0x206f0f){_0x4ac703[_0x236b('0x2')](_0x23a08a,_0x206f0f);};}function removeListener(_0x5a4783,_0x1d9972){return function(){UserEvents[_0x236b('0x3')](_0x5a4783,_0x1d9972);};}exports[_0x236b('0x4')]=function(_0x4b1453){for(var _0x140fae=0x0,_0x58fab4=events[_0x236b('0x5')];_0x140fae<_0x58fab4;_0x140fae++){var _0x37eed4=events[_0x140fae];var _0x4982e3=createListener(_0x236b('0x6')+_0x37eed4,_0x4b1453);UserEvents['on'](_0x37eed4,_0x4982e3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index bbc90a3..41e340e 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf96f3c,_0x1ae991){var _0x37e88a=function(_0x4897d1){while(--_0x4897d1){_0xf96f3c['push'](_0xf96f3c['shift']());}};_0x37e88a(++_0x1ae991);}(_0xe706,0xa3));var _0x6e70=function(_0x1a4a0b,_0x5e8e4f){_0x1a4a0b=_0x1a4a0b-0x0;var _0x15d52a=_0xe706[_0x1a4a0b];return _0x15d52a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2abcaa,_0x3c7d7d){var _0x2c0834=function(_0x2e227e){while(--_0x2e227e){_0x2abcaa['push'](_0x2abcaa['shift']());}};_0x2c0834(++_0x3c7d7d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xcb91[_0x1dbaf7];return _0x593f05;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 753c1f4..44c009e 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 _0xe011=['exports','INTEGER','sequelize'];(function(_0x26625e,_0x2c763c){var _0x24345f=function(_0x28a085){while(--_0x28a085){_0x26625e['push'](_0x26625e['shift']());}};_0x24345f(++_0x2c763c);}(_0xe011,0x14c));var _0x1e01=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0xe011[_0x15106b];return _0x521203;};'use strict';var Sequelize=require(_0x1e01('0x0'));module[_0x1e01('0x1')]={'penalty':{'type':Sequelize[_0x1e01('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1a96=['exports','INTEGER','sequelize'];(function(_0x20fcec,_0x33eb9b){var _0x346870=function(_0x378099){while(--_0x378099){_0x20fcec['push'](_0x20fcec['shift']());}};_0x346870(++_0x33eb9b);}(_0x1a96,0x1a3));var _0x61a9=function(_0x2ec482,_0xdb9131){_0x2ec482=_0x2ec482-0x0;var _0x64a1df=_0x1a96[_0x2ec482];return _0x64a1df;};'use strict';var Sequelize=require(_0x61a9('0x0'));module[_0x61a9('0x1')]={'penalty':{'type':Sequelize[_0x61a9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index f6071a9..817aff0 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 _0x2de0=['moment','bluebird','path','user_has_chat_queues','lodash'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x2de0,0x13a));var _0x02de=function(_0x1862b8,_0x1c2c13){_0x1862b8=_0x1862b8-0x0;var _0x557104=_0x2de0[_0x1862b8];return _0x557104;};'use strict';var _=require(_0x02de('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x02de('0x1'));var BPromise=require(_0x02de('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02de('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x3e3fc3,_0x108c9b){return _0x3e3fc3['define']('UserChatQueue',attributes,{'tableName':_0x02de('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96d7=['bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','util','../../config/logger','api'];(function(_0x8678bf,_0x4265a5){var _0x115686=function(_0x5a20e0){while(--_0x5a20e0){_0x8678bf['push'](_0x8678bf['shift']());}};_0x115686(++_0x4265a5);}(_0x96d7,0x1d1));var _0x796d=function(_0x1eb6f9,_0x3c953a){_0x1eb6f9=_0x1eb6f9-0x0;var _0x3a8b48=_0x96d7[_0x1eb6f9];return _0x3a8b48;};'use strict';var _=require('lodash');var util=require(_0x796d('0x0'));var logger=require(_0x796d('0x1'))(_0x796d('0x2'));var moment=require('moment');var BPromise=require(_0x796d('0x3'));var rp=require(_0x796d('0x4'));var fs=require('fs');var path=require(_0x796d('0x5'));var rimraf=require(_0x796d('0x6'));var config=require('../../config/environment');var attributes=require(_0x796d('0x7'));module[_0x796d('0x8')]=function(_0x55fb25,_0x763f3c){return _0x55fb25['define']('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','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 26a5881..827223a 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 _0xd605=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x12a85e,_0x51e2dd){var _0x3a3794=function(_0x335d73){while(--_0x335d73){_0x12a85e['push'](_0x12a85e['shift']());}};_0x3a3794(++_0x51e2dd);}(_0xd605,0x174));var _0x5d60=function(_0x2cf942,_0x4a8f0d){_0x2cf942=_0x2cf942-0x0;var _0x5a6fda=_0xd605[_0x2cf942];return _0x5a6fda;};'use strict';var _=require('lodash');var util=require(_0x5d60('0x0'));var moment=require(_0x5d60('0x1'));var BPromise=require(_0x5d60('0x2'));var rs=require(_0x5d60('0x3'));var fs=require('fs');var Redis=require(_0x5d60('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d60('0x5'));var logger=require('../../config/logger')(_0x5d60('0x6'));var config=require(_0x5d60('0x7'));var jayson=require(_0x5d60('0x8'));var client=jayson[_0x5d60('0x9')][_0x5d60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f49,_0x531085,_0x551565){return new BPromise(function(_0x39ddb9,_0x283d8f){return client['request'](_0x4c6f49,_0x551565)[_0x5d60('0xb')](function(_0x5d6aae){logger[_0x5d60('0xc')](_0x5d60('0xd'),_0x531085,_0x5d60('0xe'));logger[_0x5d60('0xf')](_0x5d60('0x10'),_0x531085,'request\x20sent',JSON[_0x5d60('0x11')](_0x5d6aae));if(_0x5d6aae['error']){if(_0x5d6aae[_0x5d60('0x12')][_0x5d60('0x13')]===0x1f4){logger[_0x5d60('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x531085,_0x5d6aae['error'][_0x5d60('0x14')]);return _0x283d8f(_0x5d6aae[_0x5d60('0x12')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x531085,_0x5d6aae[_0x5d60('0x12')][_0x5d60('0x14')]);return _0x39ddb9(_0x5d6aae[_0x5d60('0x12')][_0x5d60('0x14')]);}else{logger[_0x5d60('0xc')](_0x5d60('0xd'),_0x531085,'request\x20sent');_0x39ddb9(_0x5d6aae[_0x5d60('0x15')][_0x5d60('0x14')]);}})[_0x5d60('0x16')](function(_0x1227ae){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x531085,_0x1227ae);_0x283d8f(_0x1227ae);});});} \ No newline at end of file +var _0xce97=['../../config/logger','rpc','jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','../../config/utils'];(function(_0x131bb1,_0x5c91cc){var _0x4b006b=function(_0x236496){while(--_0x236496){_0x131bb1['push'](_0x131bb1['shift']());}};_0x4b006b(++_0x5c91cc);}(_0xce97,0xc2));var _0x7ce9=function(_0x10af91,_0x2bd270){_0x10af91=_0x10af91-0x0;var _0x47cd9a=_0xce97[_0x10af91];return _0x47cd9a;};'use strict';var _=require(_0x7ce9('0x0'));var util=require('util');var moment=require(_0x7ce9('0x1'));var BPromise=require(_0x7ce9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ce9('0x3'));var logger=require(_0x7ce9('0x4'))(_0x7ce9('0x5'));var config=require('../../config/environment');var jayson=require(_0x7ce9('0x6'));var client=jayson[_0x7ce9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf52f99,_0x45c274,_0x1de5c2){return new BPromise(function(_0x37753d,_0x509a0e){return client[_0x7ce9('0x8')](_0xf52f99,_0x1de5c2)['then'](function(_0x4bea1d){logger[_0x7ce9('0x9')](_0x7ce9('0xa'),_0x45c274,_0x7ce9('0xb'));logger[_0x7ce9('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x45c274,_0x7ce9('0xb'),JSON[_0x7ce9('0xd')](_0x4bea1d));if(_0x4bea1d[_0x7ce9('0xe')]){if(_0x4bea1d[_0x7ce9('0xe')][_0x7ce9('0xf')]===0x1f4){logger['error'](_0x7ce9('0xa'),_0x45c274,_0x4bea1d['error'][_0x7ce9('0x10')]);return _0x509a0e(_0x4bea1d[_0x7ce9('0xe')]['message']);}logger[_0x7ce9('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x45c274,_0x4bea1d[_0x7ce9('0xe')][_0x7ce9('0x10')]);return _0x37753d(_0x4bea1d[_0x7ce9('0xe')][_0x7ce9('0x10')]);}else{logger[_0x7ce9('0x9')](_0x7ce9('0xa'),_0x45c274,_0x7ce9('0xb'));_0x37753d(_0x4bea1d['result']['message']);}})[_0x7ce9('0x11')](function(_0x1314d3){logger[_0x7ce9('0xe')](_0x7ce9('0xa'),_0x45c274,_0x1314d3);_0x509a0e(_0x1314d3);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6464efd..5673369 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c6d64,_0x574cfc){var _0x56bb96=function(_0x189c2f){while(--_0x189c2f){_0x3c6d64['push'](_0x3c6d64['shift']());}};_0x56bb96(++_0x574cfc);}(_0xe706,0xa3));var _0x6e70=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xe706[_0x5235dd];return _0x13059d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1f27ce,_0xbb120d){var _0x15c31e=function(_0x20006c){while(--_0x20006c){_0x1f27ce['push'](_0x1f27ce['shift']());}};_0x15c31e(++_0xbb120d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0xcb91[_0x50f0a9];return _0x5a33d9;};'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 6c11095..7164275 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 _0x954e=['INTEGER','sequelize'];(function(_0x3da2df,_0x16268a){var _0x15e805=function(_0x26be30){while(--_0x26be30){_0x3da2df['push'](_0x3da2df['shift']());}};_0x15e805(++_0x16268a);}(_0x954e,0x1eb));var _0xe954=function(_0x1977c2,_0x19446a){_0x1977c2=_0x1977c2-0x0;var _0x1f591c=_0x954e[_0x1977c2];return _0x1f591c;};'use strict';var Sequelize=require(_0xe954('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe954('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8918=['INTEGER','sequelize'];(function(_0x27f150,_0x292ec0){var _0x4ceb6b=function(_0x42f498){while(--_0x42f498){_0x27f150['push'](_0x27f150['shift']());}};_0x4ceb6b(++_0x292ec0);}(_0x8918,0x6f));var _0x8891=function(_0x1b9c27,_0x126fd0){_0x1b9c27=_0x1b9c27-0x0;var _0x34d9c3=_0x8918[_0x1b9c27];return _0x34d9c3;};'use strict';var Sequelize=require(_0x8891('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8891('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 704df5d..5c23ee7 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 _0x545e=['request-promise','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x188178,_0x3e529d){var _0x4c19d2=function(_0x1fe369){while(--_0x1fe369){_0x188178['push'](_0x188178['shift']());}};_0x4c19d2(++_0x3e529d);}(_0x545e,0x132));var _0xe545=function(_0x17bd29,_0x802b15){_0x17bd29=_0x17bd29-0x0;var _0x417efa=_0x545e[_0x17bd29];return _0x417efa;};'use strict';var _=require(_0xe545('0x0'));var util=require(_0xe545('0x1'));var logger=require(_0xe545('0x2'))(_0xe545('0x3'));var moment=require(_0xe545('0x4'));var BPromise=require(_0xe545('0x5'));var rp=require(_0xe545('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe545('0x7'));var config=require(_0xe545('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0xe545('0x9')]=function(_0x203ad9,_0x314923){return _0x203ad9[_0xe545('0xa')](_0xe545('0xb'),attributes,{'tableName':_0xe545('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf22e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues'];(function(_0x2ca2af,_0x333ab2){var _0x4b21af=function(_0xdcf9ff){while(--_0xdcf9ff){_0x2ca2af['push'](_0x2ca2af['shift']());}};_0x4b21af(++_0x333ab2);}(_0xf22e,0xb6));var _0xef22=function(_0x15bc14,_0x1642fa){_0x15bc14=_0x15bc14-0x0;var _0x5c37dc=_0xf22e[_0x15bc14];return _0x5c37dc;};'use strict';var _=require(_0xef22('0x0'));var util=require(_0xef22('0x1'));var logger=require(_0xef22('0x2'))(_0xef22('0x3'));var moment=require(_0xef22('0x4'));var BPromise=require(_0xef22('0x5'));var rp=require(_0xef22('0x6'));var fs=require('fs');var path=require(_0xef22('0x7'));var rimraf=require(_0xef22('0x8'));var config=require(_0xef22('0x9'));var attributes=require(_0xef22('0xa'));module[_0xef22('0xb')]=function(_0x2faef8,_0x467bc8){return _0x2faef8[_0xef22('0xc')]('UserFaxQueue',attributes,{'tableName':_0xef22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index f31491b..ab27a76 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 _0x9b52=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x9b52,0x10f));var _0x29b5=function(_0x4588bd,_0x57222b){_0x4588bd=_0x4588bd-0x0;var _0x1becaa=_0x9b52[_0x4588bd];return _0x1becaa;};'use strict';var _=require(_0x29b5('0x0'));var util=require(_0x29b5('0x1'));var moment=require(_0x29b5('0x2'));var BPromise=require(_0x29b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29b5('0x4'));var logger=require(_0x29b5('0x5'))(_0x29b5('0x6'));var config=require(_0x29b5('0x7'));var jayson=require(_0x29b5('0x8'));var client=jayson['client'][_0x29b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47ffca,_0x423c5e,_0x4ca13d){return new BPromise(function(_0x282d41,_0x2afcb6){return client[_0x29b5('0xa')](_0x47ffca,_0x4ca13d)[_0x29b5('0xb')](function(_0x13a00f){logger[_0x29b5('0xc')](_0x29b5('0xd'),_0x423c5e,_0x29b5('0xe'));logger[_0x29b5('0xf')](_0x29b5('0x10'),_0x423c5e,_0x29b5('0xe'),JSON[_0x29b5('0x11')](_0x13a00f));if(_0x13a00f[_0x29b5('0x12')]){if(_0x13a00f[_0x29b5('0x12')][_0x29b5('0x13')]===0x1f4){logger[_0x29b5('0x12')](_0x29b5('0xd'),_0x423c5e,_0x13a00f[_0x29b5('0x12')][_0x29b5('0x14')]);return _0x2afcb6(_0x13a00f['error']['message']);}logger[_0x29b5('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x423c5e,_0x13a00f[_0x29b5('0x12')][_0x29b5('0x14')]);return _0x282d41(_0x13a00f[_0x29b5('0x12')][_0x29b5('0x14')]);}else{logger[_0x29b5('0xc')](_0x29b5('0xd'),_0x423c5e,'request\x20sent');_0x282d41(_0x13a00f[_0x29b5('0x15')]['message']);}})[_0x29b5('0x16')](function(_0x4e9391){logger[_0x29b5('0x12')](_0x29b5('0xd'),_0x423c5e,_0x4e9391);_0x2afcb6(_0x4e9391);});});} \ No newline at end of file +var _0x34c7=['code','message','info','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21f071,_0x58e5ec){var _0x52e042=function(_0x5141ea){while(--_0x5141ea){_0x21f071['push'](_0x21f071['shift']());}};_0x52e042(++_0x58e5ec);}(_0x34c7,0x147));var _0x734c=function(_0x3754dd,_0x152fe6){_0x3754dd=_0x3754dd-0x0;var _0x178d6b=_0x34c7[_0x3754dd];return _0x178d6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734c('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x734c('0x1'));var db=require(_0x734c('0x2'))['db'];var utils=require(_0x734c('0x3'));var logger=require(_0x734c('0x4'))(_0x734c('0x5'));var config=require(_0x734c('0x6'));var jayson=require(_0x734c('0x7'));var client=jayson[_0x734c('0x8')][_0x734c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521f88,_0x30007d,_0x1329b0){return new BPromise(function(_0x4f499f,_0x5c58e6){return client[_0x734c('0xa')](_0x521f88,_0x1329b0)[_0x734c('0xb')](function(_0x3eef73){logger['info'](_0x734c('0xc'),_0x30007d,_0x734c('0xd'));logger[_0x734c('0xe')](_0x734c('0xf'),_0x30007d,_0x734c('0xd'),JSON[_0x734c('0x10')](_0x3eef73));if(_0x3eef73['error']){if(_0x3eef73[_0x734c('0x11')][_0x734c('0x12')]===0x1f4){logger[_0x734c('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x30007d,_0x3eef73[_0x734c('0x11')][_0x734c('0x13')]);return _0x5c58e6(_0x3eef73[_0x734c('0x11')]['message']);}logger[_0x734c('0x11')](_0x734c('0xc'),_0x30007d,_0x3eef73['error'][_0x734c('0x13')]);return _0x4f499f(_0x3eef73[_0x734c('0x11')][_0x734c('0x13')]);}else{logger[_0x734c('0x14')](_0x734c('0xc'),_0x30007d,_0x734c('0xd'));_0x4f499f(_0x3eef73[_0x734c('0x15')][_0x734c('0x13')]);}})[_0x734c('0x16')](function(_0x32118c){logger[_0x734c('0x11')](_0x734c('0xc'),_0x30007d,_0x32118c);_0x5c58e6(_0x32118c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 0262232..b92e343 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x13e14a,_0x3fdb2e){var _0x46f346=function(_0x225e19){while(--_0x225e19){_0x13e14a['push'](_0x13e14a['shift']());}};_0x46f346(++_0x3fdb2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x412250,_0xa015b2){var _0x3f1d4f=function(_0x466aae){while(--_0x466aae){_0x412250['push'](_0x412250['shift']());}};_0x3f1d4f(++_0xa015b2);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 0d92825..407b6cb 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 _0x3468=['sequelize'];(function(_0x4fabd8,_0x3be1df){var _0x245b41=function(_0x3eaeff){while(--_0x3eaeff){_0x4fabd8['push'](_0x4fabd8['shift']());}};_0x245b41(++_0x3be1df);}(_0x3468,0x8d));var _0x8346=function(_0x1f3045,_0x418dce){_0x1f3045=_0x1f3045-0x0;var _0x34d2f4=_0x3468[_0x1f3045];return _0x34d2f4;};'use strict';var Sequelize=require(_0x8346('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1759=['INTEGER','sequelize','exports'];(function(_0x3ebd7f,_0x1567e3){var _0x428414=function(_0x39fef3){while(--_0x39fef3){_0x3ebd7f['push'](_0x3ebd7f['shift']());}};_0x428414(++_0x1567e3);}(_0x1759,0x1d8));var _0x9175=function(_0x37e307,_0x378e6c){_0x37e307=_0x37e307-0x0;var _0x44a38c=_0x1759[_0x37e307];return _0x44a38c;};'use strict';var Sequelize=require(_0x9175('0x0'));module[_0x9175('0x1')]={'penalty':{'type':Sequelize[_0x9175('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 c20b83a..af6dbf6 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 _0xdea2=['./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1cf890,_0x37e8aa){var _0x2fab7c=function(_0xda89df){while(--_0xda89df){_0x1cf890['push'](_0x1cf890['shift']());}};_0x2fab7c(++_0x37e8aa);}(_0xdea2,0x12d));var _0x2dea=function(_0x5087b7,_0x117485){_0x5087b7=_0x5087b7-0x0;var _0x3b4c2b=_0xdea2[_0x5087b7];return _0x3b4c2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2dea('0x0'))(_0x2dea('0x1'));var moment=require(_0x2dea('0x2'));var BPromise=require(_0x2dea('0x3'));var rp=require(_0x2dea('0x4'));var fs=require('fs');var path=require(_0x2dea('0x5'));var rimraf=require('rimraf');var config=require(_0x2dea('0x6'));var attributes=require(_0x2dea('0x7'));module[_0x2dea('0x8')]=function(_0x1361e9,_0x64334a){return _0x1361e9['define'](_0x2dea('0x9'),attributes,{'tableName':_0x2dea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3766=['moment','bluebird','path','../../config/environment','./userMailQueue.attributes','define','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x4b4a2c,_0x46d5ca){var _0x5ecbf7=function(_0x3eb06a){while(--_0x3eb06a){_0x4b4a2c['push'](_0x4b4a2c['shift']());}};_0x5ecbf7(++_0x46d5ca);}(_0x3766,0xe3));var _0x6376=function(_0x46261b,_0xd68542){_0x46261b=_0x46261b-0x0;var _0x31e36f=_0x3766[_0x46261b];return _0x31e36f;};'use strict';var _=require(_0x6376('0x0'));var util=require('util');var logger=require(_0x6376('0x1'))(_0x6376('0x2'));var moment=require(_0x6376('0x3'));var BPromise=require(_0x6376('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6376('0x5'));var rimraf=require('rimraf');var config=require(_0x6376('0x6'));var attributes=require(_0x6376('0x7'));module['exports']=function(_0x4e6d56,_0x58b011){return _0x4e6d56[_0x6376('0x8')]('UserMailQueue',attributes,{'tableName':_0x6376('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index c91ba8a..630ffe2 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5021c3,_0x473d36){var _0xfc75fb=function(_0x129198){while(--_0x129198){_0x5021c3['push'](_0x5021c3['shift']());}};_0xfc75fb(++_0x473d36);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x5fc3[_0x3b87f4];return _0x63d16e;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('UserMailQueue,\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']('UserMailQueue,\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);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 1ac7e23..1339976 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 _0x3f3f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x31f598,_0x267f5a){var _0x581ffc=function(_0x404b73){while(--_0x404b73){_0x31f598['push'](_0x31f598['shift']());}};_0x581ffc(++_0x267f5a);}(_0x3f3f,0x11f));var _0xf3f3=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x3f3f[_0x1d930e];return _0x5bbd66;};'use strict';var multer=require(_0xf3f3('0x0'));var util=require(_0xf3f3('0x1'));var path=require(_0xf3f3('0x2'));var timeout=require(_0xf3f3('0x3'));var express=require(_0xf3f3('0x4'));var router=express[_0xf3f3('0x5')]();var fs_extra=require(_0xf3f3('0x6'));var auth=require(_0xf3f3('0x7'));var interaction=require(_0xf3f3('0x8'));var config=require(_0xf3f3('0x9'));var controller=require(_0xf3f3('0xa'));router[_0xf3f3('0xb')]('/',auth[_0xf3f3('0xc')](),controller[_0xf3f3('0xd')]);module['exports']=router; \ No newline at end of file +var _0xaaa7=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer','util'];(function(_0x1ab62b,_0x126701){var _0x220040=function(_0x555d4f){while(--_0x555d4f){_0x1ab62b['push'](_0x1ab62b['shift']());}};_0x220040(++_0x126701);}(_0xaaa7,0xbb));var _0x7aaa=function(_0x5dba73,_0x2c8f47){_0x5dba73=_0x5dba73-0x0;var _0x404ba3=_0xaaa7[_0x5dba73];return _0x404ba3;};'use strict';var multer=require(_0x7aaa('0x0'));var util=require(_0x7aaa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7aaa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7aaa('0x3'));var interaction=require(_0x7aaa('0x4'));var config=require(_0x7aaa('0x5'));var controller=require(_0x7aaa('0x6'));router['post']('/',auth[_0x7aaa('0x7')](),controller['sendUserNotification']);module[_0x7aaa('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c7d81b7..2a62259 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 _0x6178=['exports','TEXT','STRING','BOOLEAN'];(function(_0xeeed6d,_0x3ff4b4){var _0x32989d=function(_0x9f872d){while(--_0x9f872d){_0xeeed6d['push'](_0xeeed6d['shift']());}};_0x32989d(++_0x3ff4b4);}(_0x6178,0xc4));var _0x8617=function(_0x15d505,_0x1bb444){_0x15d505=_0x15d505-0x0;var _0x2b37b4=_0x6178[_0x15d505];return _0x2b37b4;};'use strict';var Sequelize=require('sequelize');module[_0x8617('0x0')]={'body':{'type':Sequelize[_0x8617('0x1')]},'senderName':{'type':Sequelize[_0x8617('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8617('0x2')]},'beep':{'type':Sequelize[_0x8617('0x3')]}}; \ No newline at end of file +var _0x4933=['STRING','sequelize','TEXT'];(function(_0x6b8cab,_0xd36b53){var _0x29420c=function(_0x4867a5){while(--_0x4867a5){_0x6b8cab['push'](_0x6b8cab['shift']());}};_0x29420c(++_0xd36b53);}(_0x4933,0xca));var _0x3493=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x4933[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x3493('0x0'));module['exports']={'body':{'type':Sequelize[_0x3493('0x1')]},'senderName':{'type':Sequelize[_0x3493('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x3493('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 01cd81b..8e56cca 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 _0xc209=['eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','create','userNotification:send','catch','text','Template','findOne','html','forEach','User','ids','includes','queue','replace','Queue','push','union','flatten','getAgents','map'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0xc209,0x17c));var _0x9c20=function(_0x142e13,_0x211cde){_0x142e13=_0x142e13-0x0;var _0x51f6e1=_0xc209[_0x142e13];return _0x51f6e1;};'use strict';var emlformat=require(_0x9c20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c20('0x1'));var jsonpatch=require(_0x9c20('0x2'));var rp=require(_0x9c20('0x3'));var moment=require(_0x9c20('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9c20('0x5'));var path=require(_0x9c20('0x6'));var sox=require(_0x9c20('0x7'));var csv=require('to-csv');var ejs=require(_0x9c20('0x8'));var fs=require('fs');var fs_extra=require(_0x9c20('0x9'));var _=require(_0x9c20('0xa'));var squel=require(_0x9c20('0xb'));var crypto=require(_0x9c20('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9c20('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9c20('0xe'));var Papa=require(_0x9c20('0xf'));var Redis=require(_0x9c20('0x10'));var authService=require(_0x9c20('0x11'));var qs=require(_0x9c20('0x12'));var as=require(_0x9c20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c20('0x14'));var utils=require(_0x9c20('0x15'));var config=require(_0x9c20('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c20('0x17'))['db'];config['redis']=_['defaults'](config[_0x9c20('0x18')],{'host':_0x9c20('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9c20('0x1a'))[_0x9c20('0x1b')](socket);function respondWithStatusCode(_0x4051d5,_0x2c6e3f){_0x2c6e3f=_0x2c6e3f||0xcc;return function(_0x5ace50){if(_0x5ace50){return _0x4051d5['sendStatus'](_0x2c6e3f);}return _0x4051d5[_0x9c20('0x1c')](_0x2c6e3f)[_0x9c20('0x1d')]();};}function respondWithResult(_0x1aab8a,_0x2f95c3){_0x2f95c3=_0x2f95c3||0xc8;return function(_0x4739f3){if(_0x4739f3){return _0x1aab8a[_0x9c20('0x1c')](_0x2f95c3)[_0x9c20('0x1e')](_0x4739f3);}};}function respondWithFilteredResult(_0x8a3697,_0x48238f){return function(_0x18f6e1){if(_0x18f6e1){var _0x4242de=typeof _0x48238f[_0x9c20('0x1f')]===_0x9c20('0x20')&&typeof _0x48238f[_0x9c20('0x21')]===_0x9c20('0x20');var _0x291b49=_0x18f6e1[_0x9c20('0x22')];var _0x3e1541=_0x4242de?0x0:_0x48238f[_0x9c20('0x1f')];var _0x3547a3=_0x4242de?_0x18f6e1[_0x9c20('0x22')]:_0x48238f['offset']+_0x48238f[_0x9c20('0x21')];var _0x43f544;if(_0x3547a3>=_0x291b49){_0x3547a3=_0x291b49;_0x43f544=0xc8;}else{_0x43f544=0xce;}_0x8a3697['status'](_0x43f544);return _0x8a3697[_0x9c20('0x23')](_0x9c20('0x24'),_0x3e1541+'-'+_0x3547a3+'/'+_0x291b49)[_0x9c20('0x1e')](_0x18f6e1);}return null;};}function patchUpdates(_0x413545){return function(_0x1897c1){try{jsonpatch[_0x9c20('0x25')](_0x1897c1,_0x413545,!![]);}catch(_0x3a8c75){return BPromise[_0x9c20('0x26')](_0x3a8c75);}return _0x1897c1[_0x9c20('0x27')]();};}function saveUpdates(_0x2ffe07,_0x13fbdc){return function(_0x908fb7){if(_0x908fb7){return _0x908fb7[_0x9c20('0x28')](_0x2ffe07)['then'](function(_0x56ece8){return _0x56ece8;});}return null;};}function removeEntity(_0x3158ff,_0x6c1872){return function(_0x255b47){if(_0x255b47){return _0x255b47['destroy']()[_0x9c20('0x29')](function(){_0x3158ff['status'](0xcc)[_0x9c20('0x1d')]();});}};}function handleEntityNotFound(_0x33cbb4,_0x17db09){return function(_0x70b310){if(!_0x70b310){_0x33cbb4['sendStatus'](0x194);}return _0x70b310;};}function handleError(_0x4940a3,_0xabc6b3){_0xabc6b3=_0xabc6b3||0x1f4;return function(_0x1b69b0){logger['error'](_0x1b69b0['stack']);if(_0x1b69b0['name']){delete _0x1b69b0[_0x9c20('0x2a')];}_0x4940a3['status'](_0xabc6b3)[_0x9c20('0x2b')](_0x1b69b0);};}exports[_0x9c20('0x2c')]=function(_0xfdc07e,_0x3ce4f2,_0x576ff4){if(!_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x2e')]('text')&&!_0xfdc07e['body'][_0x9c20('0x2e')](_0x9c20('0x2f'))){throw new db[(_0x9c20('0x30'))][(_0x9c20('0x31'))](_0x9c20('0x32'));}else{if(_0xfdc07e[_0x9c20('0x2d')]['hasOwnProperty'](_0x9c20('0x2f'))&&!_0xfdc07e[_0x9c20('0x2d')]['hasOwnProperty'](_0x9c20('0x33'))){throw new db['Sequelize'][(_0x9c20('0x31'))](_0x9c20('0x34'));}if(!_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x2e')](_0x9c20('0x35'))){throw new db[(_0x9c20('0x30'))]['ValidationError'](_0x9c20('0x36'));}else{try{var _0x12de27=JSON['parse'](_0xfdc07e['body'][_0x9c20('0x35')]);}catch(_0x5132d8){logger[_0x9c20('0x37')](_0x5132d8);throw new db[(_0x9c20('0x30'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x49bc23=[_0x9c20('0x38'),_0x9c20('0x39'),_0x9c20('0x3a'),_0x9c20('0x3b'),_0x9c20('0x3c'),_0x9c20('0x3d'),'whatsappqueue','team',_0x9c20('0x3e')];if(_[_0x9c20('0x3f')](_0x12de27,function(_0x2831f6){return!_['includes'](_0x49bc23,_0x2831f6[_0x9c20('0x40')][_0x9c20('0x41')]());})){throw new db['Sequelize']['ValidationError'](_0x9c20('0x42'));}}}var _0x428c24={};_0x428c24[_0x9c20('0x43')]=_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x2e')](_0x9c20('0x43'))?_0xfdc07e[_0x9c20('0x2d')]['senderName']:_0xfdc07e[_0x9c20('0x3e')][_0x9c20('0x44')];_0x428c24[_0x9c20('0x45')]=_[_0x9c20('0x46')](_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x45')])?null:_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x45')];_0x428c24[_0x9c20('0x47')]=_0xfdc07e[_0x9c20('0x2d')][_0x9c20('0x47')]||![];_0x428c24['SenderId']=_0xfdc07e[_0x9c20('0x3e')]['id'];return getContent(_0xfdc07e[_0x9c20('0x2d')])[_0x9c20('0x29')](function(_0x21a9ee){_0x428c24['body']=_0x21a9ee;return getRecipients(_0x12de27);})[_0x9c20('0x29')](function(_0x42b8bb){_0x428c24[_0x9c20('0x48')]=_[_0x9c20('0x49')](_0x42b8bb)[_0x9c20('0x4a')](',');return db[_0x9c20('0x4b')]['transaction'](function(_0x57e4a6){return db['UserNotification'][_0x9c20('0x4c')](_0x428c24,{'raw':!![],'transaction':_0x57e4a6})[_0x9c20('0x29')](function(_0x435141){var _0x6b7f8d={'sender':_0x428c24[_0x9c20('0x43')],'description':_0x428c24[_0x9c20('0x45')],'content':_0x428c24[_0x9c20('0x2d')],'beep':_0x428c24[_0x9c20('0x47')]};_0x42b8bb['forEach'](function(_0x13e9c2){_0x6b7f8d['recipient']=_0x13e9c2;socket['emit'](_0x9c20('0x4d'),_0x6b7f8d);});return _0x435141;});});})[_0x9c20('0x29')](respondWithResult(_0x3ce4f2,0xc9))[_0x9c20('0x4e')](handleError(_0x3ce4f2,null));};function getContent(_0x183f7f){return new BPromise(function(_0x4e1c71,_0x3527a4){if(_0x183f7f[_0x9c20('0x4f')]){_0x4e1c71(_0x183f7f[_0x9c20('0x4f')]);return;}return db[_0x9c20('0x50')][_0x9c20('0x51')]({'attributes':[_0x9c20('0x52')],'where':{'id':_0x183f7f[_0x9c20('0x2f')]},'raw':!![]})[_0x9c20('0x29')](function(_0x66380){if(!_0x66380)throw new db[(_0x9c20('0x30'))][(_0x9c20('0x31'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1c3a21=Mustache['render'](_0x66380['html'],_0x183f7f[_0x9c20('0x33')]);_0x4e1c71(_0x1c3a21);})[_0x9c20('0x4e')](function(_0xce76d5){_0x3527a4(_0xce76d5);});});}function getRecipients(_0x5883a1){return new BPromise(function(_0x4bc721,_0x329682){var _0x4a1956=[];var _0x1a2e46=[];_0x5883a1[_0x9c20('0x53')](function(_0x3ded70){var _0x3164e7=_['startCase'](_0x3ded70[_0x9c20('0x40')][_0x9c20('0x41')]());if(_0x3164e7===_0x9c20('0x54')){_0x4a1956=_['union'](_0x4a1956,_0x3ded70[_0x9c20('0x55')]);}else{if(_[_0x9c20('0x56')](_0x3164e7,_0x9c20('0x57')))_0x3164e7=_0x3164e7[_0x9c20('0x58')](_0x9c20('0x57'),_0x9c20('0x59'));_0x3ded70[_0x9c20('0x55')][_0x9c20('0x53')](function(_0x19d4f0){_0x1a2e46[_0x9c20('0x5a')](getAgents(_0x3164e7,_0x19d4f0));});}});return BPromise['all'](_0x1a2e46)[_0x9c20('0x29')](function(_0x441ce6){_0x4a1956=_[_0x9c20('0x5b')](_0x4a1956,_[_0x9c20('0x5c')](_0x441ce6));_0x4bc721(_0x4a1956);})[_0x9c20('0x4e')](function(_0x565961){_0x329682(_0x565961);});});}function getAgents(_0x4fa6aa,_0x221e6b){return new BPromise(function(_0x3fa2ce,_0x2e85f4){return db[_0x4fa6aa]['findOne']({'where':{'id':_0x221e6b}})[_0x9c20('0x29')](function(_0x2540a1){return _0x2540a1[_0x9c20('0x5d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4a51fa){var _0x22d48d=_[_0x9c20('0x5e')](_0x4a51fa,'id');_0x3fa2ce(_0x22d48d);});})[_0x9c20('0x4e')](function(_0x231003){_0x2e85f4(_0x231003);});});} \ No newline at end of file +var _0xf183=['ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','sortBy','join','sequelize','transaction','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','ids','queue','replace','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','TemplateId','view'];(function(_0x23db02,_0xc49cbb){var _0x26f386=function(_0x4184d8){while(--_0x4184d8){_0x23db02['push'](_0x23db02['shift']());}};_0x26f386(++_0xc49cbb);}(_0xf183,0x98));var _0x3f18=function(_0x3b3fce,_0x1c712c){_0x3b3fce=_0x3b3fce-0x0;var _0x3caf05=_0xf183[_0x3b3fce];return _0x3caf05;};'use strict';var emlformat=require(_0x3f18('0x0'));var rimraf=require(_0x3f18('0x1'));var zipdir=require(_0x3f18('0x2'));var jsonpatch=require(_0x3f18('0x3'));var rp=require(_0x3f18('0x4'));var moment=require(_0x3f18('0x5'));var BPromise=require(_0x3f18('0x6'));var Mustache=require(_0x3f18('0x7'));var util=require(_0x3f18('0x8'));var path=require(_0x3f18('0x9'));var sox=require('sox');var csv=require(_0x3f18('0xa'));var ejs=require(_0x3f18('0xb'));var fs=require('fs');var fs_extra=require(_0x3f18('0xc'));var _=require(_0x3f18('0xd'));var squel=require('squel');var crypto=require(_0x3f18('0xe'));var jsforce=require(_0x3f18('0xf'));var deskjs=require(_0x3f18('0x10'));var toCsv=require(_0x3f18('0xa'));var querystring=require(_0x3f18('0x11'));var Papa=require(_0x3f18('0x12'));var Redis=require(_0x3f18('0x13'));var authService=require(_0x3f18('0x14'));var qs=require(_0x3f18('0x15'));var as=require(_0x3f18('0x16'));var hardwareService=require(_0x3f18('0x17'));var logger=require(_0x3f18('0x18'))(_0x3f18('0x19'));var utils=require(_0x3f18('0x1a'));var config=require(_0x3f18('0x1b'));var licenseUtil=require(_0x3f18('0x1c'));var db=require(_0x3f18('0x1d'))['db'];config[_0x3f18('0x1e')]=_[_0x3f18('0x1f')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3f18('0x20'))(new Redis(config['redis']));require(_0x3f18('0x21'))[_0x3f18('0x22')](socket);function respondWithStatusCode(_0x455fdc,_0x305749){_0x305749=_0x305749||0xcc;return function(_0x3c5664){if(_0x3c5664){return _0x455fdc[_0x3f18('0x23')](_0x305749);}return _0x455fdc[_0x3f18('0x24')](_0x305749)[_0x3f18('0x25')]();};}function respondWithResult(_0x57bb7f,_0xada355){_0xada355=_0xada355||0xc8;return function(_0xcef65e){if(_0xcef65e){return _0x57bb7f[_0x3f18('0x24')](_0xada355)[_0x3f18('0x26')](_0xcef65e);}};}function respondWithFilteredResult(_0x4e21e9,_0x474b42){return function(_0x1cddb5){if(_0x1cddb5){var _0x4b7b2b=typeof _0x474b42['offset']===_0x3f18('0x27')&&typeof _0x474b42[_0x3f18('0x28')]===_0x3f18('0x27');var _0x3d5fba=_0x1cddb5['count'];var _0x392f43=_0x4b7b2b?0x0:_0x474b42[_0x3f18('0x29')];var _0x119d1f=_0x4b7b2b?_0x1cddb5['count']:_0x474b42['offset']+_0x474b42['limit'];var _0x346cba;if(_0x119d1f>=_0x3d5fba){_0x119d1f=_0x3d5fba;_0x346cba=0xc8;}else{_0x346cba=0xce;}_0x4e21e9[_0x3f18('0x24')](_0x346cba);return _0x4e21e9[_0x3f18('0x2a')](_0x3f18('0x2b'),_0x392f43+'-'+_0x119d1f+'/'+_0x3d5fba)[_0x3f18('0x26')](_0x1cddb5);}return null;};}function patchUpdates(_0x382b77){return function(_0x1aba03){try{jsonpatch[_0x3f18('0x2c')](_0x1aba03,_0x382b77,!![]);}catch(_0x54ef40){return BPromise[_0x3f18('0x2d')](_0x54ef40);}return _0x1aba03[_0x3f18('0x2e')]();};}function saveUpdates(_0x39cac0,_0x231240){return function(_0x24e9eb){if(_0x24e9eb){return _0x24e9eb[_0x3f18('0x2f')](_0x39cac0)['then'](function(_0x292429){return _0x292429;});}return null;};}function removeEntity(_0x4ce0d3,_0x149895){return function(_0x4283f2){if(_0x4283f2){return _0x4283f2[_0x3f18('0x30')]()['then'](function(){_0x4ce0d3['status'](0xcc)[_0x3f18('0x25')]();});}};}function handleEntityNotFound(_0x325f26,_0x37ae95){return function(_0x375b9d){if(!_0x375b9d){_0x325f26['sendStatus'](0x194);}return _0x375b9d;};}function handleError(_0x37e986,_0x1aeb9b){_0x1aeb9b=_0x1aeb9b||0x1f4;return function(_0x1f73aa){logger[_0x3f18('0x31')](_0x1f73aa[_0x3f18('0x32')]);if(_0x1f73aa[_0x3f18('0x33')]){delete _0x1f73aa[_0x3f18('0x33')];}_0x37e986['status'](_0x1aeb9b)[_0x3f18('0x34')](_0x1f73aa);};}exports[_0x3f18('0x35')]=function(_0x1c4330,_0x491f15,_0xa808c7){if(!_0x1c4330[_0x3f18('0x36')][_0x3f18('0x37')](_0x3f18('0x38'))&&!_0x1c4330[_0x3f18('0x36')][_0x3f18('0x37')]('TemplateId')){throw new db[(_0x3f18('0x39'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1c4330['body'][_0x3f18('0x37')](_0x3f18('0x3a'))&&!_0x1c4330[_0x3f18('0x36')][_0x3f18('0x37')](_0x3f18('0x3b'))){throw new db[(_0x3f18('0x39'))][(_0x3f18('0x3c'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1c4330[_0x3f18('0x36')]['hasOwnProperty']('recipients')){throw new db[(_0x3f18('0x39'))][(_0x3f18('0x3c'))](_0x3f18('0x3d'));}else{try{var _0x8a2b2a=JSON[_0x3f18('0x3e')](_0x1c4330['body']['recipients']);}catch(_0x1d802c){logger['error'](_0x1d802c);throw new db['Sequelize'][(_0x3f18('0x3c'))](_0x3f18('0x3f'));}var _0x69d1d0=['chatqueue',_0x3f18('0x40'),'mailqueue',_0x3f18('0x41'),_0x3f18('0x42'),_0x3f18('0x43'),_0x3f18('0x44'),_0x3f18('0x45'),_0x3f18('0x46')];if(_[_0x3f18('0x47')](_0x8a2b2a,function(_0x3adc07){return!_[_0x3f18('0x48')](_0x69d1d0,_0x3adc07[_0x3f18('0x49')][_0x3f18('0x4a')]());})){throw new db['Sequelize'][(_0x3f18('0x3c'))](_0x3f18('0x4b'));}}}var _0x539d3d={};_0x539d3d[_0x3f18('0x4c')]=_0x1c4330['body'][_0x3f18('0x37')](_0x3f18('0x4c'))?_0x1c4330[_0x3f18('0x36')][_0x3f18('0x4c')]:_0x1c4330['user'][_0x3f18('0x4d')];_0x539d3d[_0x3f18('0x4e')]=_[_0x3f18('0x4f')](_0x1c4330['body']['recipientsDescription'])?null:_0x1c4330[_0x3f18('0x36')][_0x3f18('0x4e')];_0x539d3d[_0x3f18('0x50')]=_0x1c4330[_0x3f18('0x36')]['beep']||![];_0x539d3d[_0x3f18('0x51')]=_0x1c4330[_0x3f18('0x46')]['id'];return getContent(_0x1c4330[_0x3f18('0x36')])[_0x3f18('0x52')](function(_0x2e1d65){_0x539d3d[_0x3f18('0x36')]=_0x2e1d65;return getRecipients(_0x8a2b2a);})['then'](function(_0x16a6a6){_0x539d3d[_0x3f18('0x53')]=_[_0x3f18('0x54')](_0x16a6a6)[_0x3f18('0x55')](',');return db[_0x3f18('0x56')][_0x3f18('0x57')](function(_0x39f6df){return db['UserNotification']['create'](_0x539d3d,{'raw':!![],'transaction':_0x39f6df})[_0x3f18('0x52')](function(_0x15a434){var _0x1b5f80={'sender':_0x539d3d[_0x3f18('0x4c')],'description':_0x539d3d[_0x3f18('0x4e')],'content':_0x539d3d['body'],'beep':_0x539d3d[_0x3f18('0x50')]};_0x16a6a6['forEach'](function(_0x140a4e){_0x1b5f80['recipient']=_0x140a4e;socket[_0x3f18('0x58')](_0x3f18('0x59'),_0x1b5f80);});return _0x15a434;});});})[_0x3f18('0x52')](respondWithResult(_0x491f15,0xc9))[_0x3f18('0x5a')](handleError(_0x491f15,null));};function getContent(_0x1a2710){return new BPromise(function(_0xf5584a,_0x823c16){if(_0x1a2710[_0x3f18('0x38')]){_0xf5584a(_0x1a2710[_0x3f18('0x38')]);return;}return db[_0x3f18('0x5b')][_0x3f18('0x5c')]({'attributes':['html'],'where':{'id':_0x1a2710['TemplateId']},'raw':!![]})[_0x3f18('0x52')](function(_0x59f60e){if(!_0x59f60e)throw new db[(_0x3f18('0x39'))][(_0x3f18('0x3c'))](_0x3f18('0x5d'));var _0x112c93=Mustache[_0x3f18('0x5e')](_0x59f60e['html'],_0x1a2710[_0x3f18('0x3b')]);_0xf5584a(_0x112c93);})[_0x3f18('0x5a')](function(_0x1a6f26){_0x823c16(_0x1a6f26);});});}function getRecipients(_0x37611c){return new BPromise(function(_0x2eb78e,_0x392716){var _0x58edbc=[];var _0x13b23d=[];_0x37611c[_0x3f18('0x5f')](function(_0x5136b4){var _0x260a80=_[_0x3f18('0x60')](_0x5136b4['model']['toLowerCase']());if(_0x260a80===_0x3f18('0x61')){_0x58edbc=_['union'](_0x58edbc,_0x5136b4[_0x3f18('0x62')]);}else{if(_[_0x3f18('0x48')](_0x260a80,_0x3f18('0x63')))_0x260a80=_0x260a80[_0x3f18('0x64')]('queue','Queue');_0x5136b4[_0x3f18('0x62')][_0x3f18('0x5f')](function(_0x4385d4){_0x13b23d['push'](getAgents(_0x260a80,_0x4385d4));});}});return BPromise[_0x3f18('0x65')](_0x13b23d)[_0x3f18('0x52')](function(_0x2dac12){_0x58edbc=_[_0x3f18('0x66')](_0x58edbc,_[_0x3f18('0x67')](_0x2dac12));_0x2eb78e(_0x58edbc);})[_0x3f18('0x5a')](function(_0x7fb804){_0x392716(_0x7fb804);});});}function getAgents(_0xbeebd0,_0x372e59){return new BPromise(function(_0x3520d5,_0x2831b0){return db[_0xbeebd0][_0x3f18('0x5c')]({'where':{'id':_0x372e59}})['then'](function(_0x67b1dc){return _0x67b1dc[_0x3f18('0x68')]({'attributes':['id'],'raw':!![]})[_0x3f18('0x52')](function(_0x7e58ce){var _0x52babd=_[_0x3f18('0x69')](_0x7e58ce,'id');_0x3520d5(_0x52babd);});})[_0x3f18('0x5a')](function(_0x45959){_0x2831b0(_0x45959);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c068422..de26384 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 _0x2ec7=['setMaxListeners','update','remove','emit','exports','UserNotification'];(function(_0x5b1612,_0x54e35d){var _0x5de9d7=function(_0x3e5434){while(--_0x3e5434){_0x5b1612['push'](_0x5b1612['shift']());}};_0x5de9d7(++_0x54e35d);}(_0x2ec7,0x1eb));var _0x72ec=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x2ec7[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x72ec('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x72ec('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x72ec('0x2'),'afterDestroy':_0x72ec('0x3')};function emitEvent(_0x44a76e){return function(_0x33343e,_0x48dd47,_0x15ffb8){UserNotificationEvents[_0x72ec('0x4')](_0x44a76e+':'+_0x33343e['id'],_0x33343e);UserNotificationEvents[_0x72ec('0x4')](_0x44a76e,_0x33343e);_0x15ffb8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x72ec('0x5')]=UserNotificationEvents; \ No newline at end of file +var _0x1f44=['UserNotification','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x5a6005,_0x564174){var _0x514353=function(_0x4d07b8){while(--_0x4d07b8){_0x5a6005['push'](_0x5a6005['shift']());}};_0x514353(++_0x564174);}(_0x1f44,0x10f));var _0x41f4=function(_0x16b769,_0x317c59){_0x16b769=_0x16b769-0x0;var _0x46f8df=_0x1f44[_0x16b769];return _0x46f8df;};'use strict';var EventEmitter=require(_0x41f4('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x41f4('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x41f4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x41f4('0x3'),'afterDestroy':_0x41f4('0x4')};function emitEvent(_0x575029){return function(_0x5b643b,_0x4b1f8a,_0x416e9f){UserNotificationEvents[_0x41f4('0x5')](_0x575029+':'+_0x5b643b['id'],_0x5b643b);UserNotificationEvents['emit'](_0x575029,_0x5b643b);_0x416e9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x41f4('0x6')](e,emitEvent(event));}}module[_0x41f4('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index c5148b8..f546e39 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 _0x617c=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x617c,0x1e2));var _0xc617=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x617c[_0x65c0bb];return _0x320bd5;};'use strict';var _=require(_0xc617('0x0'));var util=require(_0xc617('0x1'));var logger=require(_0xc617('0x2'))(_0xc617('0x3'));var moment=require(_0xc617('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc617('0x5'));var rimraf=require(_0xc617('0x6'));var config=require(_0xc617('0x7'));var attributes=require(_0xc617('0x8'));module[_0xc617('0x9')]=function(_0x56e67c,_0x31c8a6){return _0x56e67c[_0xc617('0xa')](_0xc617('0xb'),attributes,{'tableName':_0xc617('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc617('0xd'),'collate':_0xc617('0xe')});}; \ No newline at end of file +var _0x3514=['rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','moment','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3514,0x1db));var _0x4351=function(_0x18d0ae,_0x500548){_0x18d0ae=_0x18d0ae-0x0;var _0x1ff0d=_0x3514[_0x18d0ae];return _0x1ff0d;};'use strict';var _=require(_0x4351('0x0'));var util=require(_0x4351('0x1'));var logger=require(_0x4351('0x2'))('api');var moment=require(_0x4351('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4351('0x4'));var rimraf=require(_0x4351('0x5'));var config=require(_0x4351('0x6'));var attributes=require(_0x4351('0x7'));module['exports']=function(_0x56baeb,_0x3f0aec){return _0x56baeb[_0x4351('0x8')](_0x4351('0x9'),attributes,{'tableName':_0x4351('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4351('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 672b1ad..1503d39 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 _0xee02=['request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis'];(function(_0x1ebc79,_0x1f252e){var _0x49047a=function(_0x4714bc){while(--_0x4714bc){_0x1ebc79['push'](_0x1ebc79['shift']());}};_0x49047a(++_0x1f252e);}(_0xee02,0x143));var _0x2ee0=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xee02[_0x4c4037];return _0x357862;};'use strict';var _=require(_0x2ee0('0x0'));var util=require(_0x2ee0('0x1'));var moment=require(_0x2ee0('0x2'));var BPromise=require(_0x2ee0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ee0('0x4'))['db'];var utils=require(_0x2ee0('0x5'));var logger=require('../../config/logger')(_0x2ee0('0x6'));var config=require(_0x2ee0('0x7'));var jayson=require(_0x2ee0('0x8'));var client=jayson['client'][_0x2ee0('0x9')]({'port':0x232a});config['redis']=_[_0x2ee0('0xa')](config['redis'],{'host':_0x2ee0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ee0('0xc')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x515c96,_0x157f74,_0x304ade){return new BPromise(function(_0x3cc4ce,_0x2aa9d7){return client[_0x2ee0('0xd')](_0x515c96,_0x304ade)[_0x2ee0('0xe')](function(_0x1c7dd9){logger['info'](_0x2ee0('0xf'),_0x157f74,_0x2ee0('0x10'));logger['debug'](_0x2ee0('0x11'),_0x157f74,_0x2ee0('0x10'),JSON[_0x2ee0('0x12')](_0x1c7dd9));if(_0x1c7dd9[_0x2ee0('0x13')]){if(_0x1c7dd9[_0x2ee0('0x13')][_0x2ee0('0x14')]===0x1f4){logger[_0x2ee0('0x13')](_0x2ee0('0xf'),_0x157f74,_0x1c7dd9[_0x2ee0('0x13')]['message']);return _0x2aa9d7(_0x1c7dd9[_0x2ee0('0x13')][_0x2ee0('0x15')]);}logger[_0x2ee0('0x13')]('UserNotification,\x20%s,\x20%s',_0x157f74,_0x1c7dd9[_0x2ee0('0x13')]['message']);return _0x3cc4ce(_0x1c7dd9[_0x2ee0('0x13')][_0x2ee0('0x15')]);}else{logger[_0x2ee0('0x16')](_0x2ee0('0xf'),_0x157f74,_0x2ee0('0x10'));_0x3cc4ce(_0x1c7dd9['result'][_0x2ee0('0x15')]);}})[_0x2ee0('0x17')](function(_0x2f8146){logger[_0x2ee0('0x13')](_0x2ee0('0xf'),_0x157f74,_0x2f8146);_0x2aa9d7(_0x2f8146);});});} \ No newline at end of file +var _0xf100=['request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xf100,0x15f));var _0x0f10=function(_0x6290dd,_0x476a53){_0x6290dd=_0x6290dd-0x0;var _0x52ffb0=_0xf100[_0x6290dd];return _0x52ffb0;};'use strict';var _=require(_0x0f10('0x0'));var util=require(_0x0f10('0x1'));var moment=require('moment');var BPromise=require(_0x0f10('0x2'));var rs=require(_0x0f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f10('0x4'))['db'];var utils=require(_0x0f10('0x5'));var logger=require(_0x0f10('0x6'))(_0x0f10('0x7'));var config=require(_0x0f10('0x8'));var jayson=require(_0x0f10('0x9'));var client=jayson[_0x0f10('0xa')][_0x0f10('0xb')]({'port':0x232a});config[_0x0f10('0xc')]=_[_0x0f10('0xd')](config['redis'],{'host':_0x0f10('0xe'),'port':0x18eb});var socket=require(_0x0f10('0xf'))(new Redis(config['redis']));require(_0x0f10('0x10'))[_0x0f10('0x11')](socket);function respondWithRpcPromise(_0x3bb5de,_0x1b14fc,_0x3cdae1){return new BPromise(function(_0x356c88,_0x5535f6){return client[_0x0f10('0x12')](_0x3bb5de,_0x3cdae1)[_0x0f10('0x13')](function(_0x2a0a03){logger['info'](_0x0f10('0x14'),_0x1b14fc,_0x0f10('0x15'));logger[_0x0f10('0x16')](_0x0f10('0x17'),_0x1b14fc,'request\x20sent',JSON[_0x0f10('0x18')](_0x2a0a03));if(_0x2a0a03['error']){if(_0x2a0a03[_0x0f10('0x19')][_0x0f10('0x1a')]===0x1f4){logger[_0x0f10('0x19')](_0x0f10('0x14'),_0x1b14fc,_0x2a0a03['error'][_0x0f10('0x1b')]);return _0x5535f6(_0x2a0a03[_0x0f10('0x19')][_0x0f10('0x1b')]);}logger['error'](_0x0f10('0x14'),_0x1b14fc,_0x2a0a03[_0x0f10('0x19')][_0x0f10('0x1b')]);return _0x356c88(_0x2a0a03[_0x0f10('0x19')][_0x0f10('0x1b')]);}else{logger[_0x0f10('0x1c')](_0x0f10('0x14'),_0x1b14fc,_0x0f10('0x15'));_0x356c88(_0x2a0a03[_0x0f10('0x1d')]['message']);}})[_0x0f10('0x1e')](function(_0x58fc85){logger[_0x0f10('0x19')](_0x0f10('0x14'),_0x1b14fc,_0x58fc85);_0x5535f6(_0x58fc85);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 5545bb4..957f07f 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 _0x7572=['update','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x5e1872,_0x51eee1){var _0x26d810=function(_0x25d2f1){while(--_0x25d2f1){_0x5e1872['push'](_0x5e1872['shift']());}};_0x26d810(++_0x51eee1);}(_0x7572,0xcd));var _0x2757=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x7572[_0x393500];return _0x120d3b;};'use strict';var UserNotificationEvents=require(_0x2757('0x0'));var events=[_0x2757('0x1'),_0x2757('0x2'),_0x2757('0x3')];function createListener(_0x1f995c,_0x21fbf3){return function(_0x53966c){_0x21fbf3['emit'](_0x1f995c,_0x53966c);};}function removeListener(_0x11350e,_0x2d09cb){return function(){UserNotificationEvents[_0x2757('0x4')](_0x11350e,_0x2d09cb);};}exports[_0x2757('0x5')]=function(_0x30af14){for(var _0x5b26bd=0x0,_0x344667=events[_0x2757('0x6')];_0x5b26bd<_0x344667;_0x5b26bd++){var _0x4f62ad=events[_0x5b26bd];var _0x332d9e=createListener(_0x2757('0x7')+_0x4f62ad,_0x30af14);UserNotificationEvents['on'](_0x4f62ad,_0x332d9e);}}; \ No newline at end of file +var _0x4acf=['save','remove','emit','removeListener','length','userNotification:','./userNotification.events'];(function(_0x34a315,_0x38418a){var _0x364254=function(_0x4c66fa){while(--_0x4c66fa){_0x34a315['push'](_0x34a315['shift']());}};_0x364254(++_0x38418a);}(_0x4acf,0x18e));var _0xf4ac=function(_0x51296f,_0x238064){_0x51296f=_0x51296f-0x0;var _0x1dfa83=_0x4acf[_0x51296f];return _0x1dfa83;};'use strict';var UserNotificationEvents=require(_0xf4ac('0x0'));var events=[_0xf4ac('0x1'),_0xf4ac('0x2'),'update'];function createListener(_0x2a8b85,_0x51b126){return function(_0x500630){_0x51b126[_0xf4ac('0x3')](_0x2a8b85,_0x500630);};}function removeListener(_0x30c656,_0x2d4249){return function(){UserNotificationEvents[_0xf4ac('0x4')](_0x30c656,_0x2d4249);};}exports['register']=function(_0x540194){for(var _0x48c473=0x0,_0x2945cb=events[_0xf4ac('0x5')];_0x48c473<_0x2945cb;_0x48c473++){var _0x4edda2=events[_0x48c473];var _0x1619fe=createListener(_0xf4ac('0x6')+_0x4edda2,_0x540194);UserNotificationEvents['on'](_0x4edda2,_0x1619fe);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ea4b658..427bc3b 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x40b00c,_0x287c0e){var _0x3d3993=function(_0x35e2d3){while(--_0x35e2d3){_0x40b00c['push'](_0x40b00c['shift']());}};_0x3d3993(++_0x287c0e);}(_0xedd9,0xfc));var _0x9edd=function(_0x49fe11,_0x1ce6d2){_0x49fe11=_0x49fe11-0x0;var _0x2b599d=_0xedd9[_0x49fe11];return _0x2b599d;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x19077e,_0x1ae7cd){var _0x440fc3=function(_0x31a1fe){while(--_0x31a1fe){_0x19077e['push'](_0x19077e['shift']());}};_0x440fc3(++_0x1ae7cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 3848e6c..47b0725 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 _0x2628=['INTEGER'];(function(_0x3a7201,_0x5dbbfb){var _0x2253c7=function(_0x2ea374){while(--_0x2ea374){_0x3a7201['push'](_0x3a7201['shift']());}};_0x2253c7(++_0x5dbbfb);}(_0x2628,0x1d2));var _0x8262=function(_0x32d886,_0x167b1f){_0x32d886=_0x32d886-0x0;var _0x5c0353=_0x2628[_0x32d886];return _0x5c0353;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8262('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb84=['exports','INTEGER','sequelize'];(function(_0x5514ad,_0x1930f0){var _0x59face=function(_0x287021){while(--_0x287021){_0x5514ad['push'](_0x5514ad['shift']());}};_0x59face(++_0x1930f0);}(_0xeb84,0x194));var _0x4eb8=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xeb84[_0xbb9dbf];return _0x30223c;};'use strict';var Sequelize=require(_0x4eb8('0x0'));module[_0x4eb8('0x1')]={'penalty':{'type':Sequelize[_0x4eb8('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 949ae17..184390e 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 _0x8632=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x33f840,_0x3ec48c){var _0x4b293b=function(_0xa8885){while(--_0xa8885){_0x33f840['push'](_0x33f840['shift']());}};_0x4b293b(++_0x3ec48c);}(_0x8632,0x104));var _0x2863=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0x8632[_0x1cb0b4];return _0x525b60;};'use strict';var _=require(_0x2863('0x0'));var util=require(_0x2863('0x1'));var logger=require('../../config/logger')(_0x2863('0x2'));var moment=require(_0x2863('0x3'));var BPromise=require(_0x2863('0x4'));var rp=require(_0x2863('0x5'));var fs=require('fs');var path=require(_0x2863('0x6'));var rimraf=require(_0x2863('0x7'));var config=require(_0x2863('0x8'));var attributes=require(_0x2863('0x9'));module[_0x2863('0xa')]=function(_0x11ab0c,_0x177692){return _0x11ab0c[_0x2863('0xb')](_0x2863('0xc'),attributes,{'tableName':_0x2863('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a6b=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x2e0f65,_0x27af29){var _0x7fd3d8=function(_0x2a6bc4){while(--_0x2a6bc4){_0x2e0f65['push'](_0x2e0f65['shift']());}};_0x7fd3d8(++_0x27af29);}(_0x1a6b,0xb9));var _0xb1a6=function(_0x2abb35,_0x1930b3){_0x2abb35=_0x2abb35-0x0;var _0x3b4568=_0x1a6b[_0x2abb35];return _0x3b4568;};'use strict';var _=require(_0xb1a6('0x0'));var util=require(_0xb1a6('0x1'));var logger=require(_0xb1a6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb1a6('0x3'));var rp=require(_0xb1a6('0x4'));var fs=require('fs');var path=require(_0xb1a6('0x5'));var rimraf=require(_0xb1a6('0x6'));var config=require(_0xb1a6('0x7'));var attributes=require(_0xb1a6('0x8'));module[_0xb1a6('0x9')]=function(_0x29437f,_0x2a590b){return _0x29437f[_0xb1a6('0xa')](_0xb1a6('0xb'),attributes,{'tableName':_0xb1a6('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 f57565c..1fb274d 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 _0x51d5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x2efbd9,_0x3a2604){var _0x180dc5=function(_0x5ce4a5){while(--_0x5ce4a5){_0x2efbd9['push'](_0x2efbd9['shift']());}};_0x180dc5(++_0x3a2604);}(_0x51d5,0x148));var _0x551d=function(_0x1b2fbf,_0x239760){_0x1b2fbf=_0x1b2fbf-0x0;var _0x27d6bc=_0x51d5[_0x1b2fbf];return _0x27d6bc;};'use strict';var _=require(_0x551d('0x0'));var util=require(_0x551d('0x1'));var moment=require('moment');var BPromise=require(_0x551d('0x2'));var rs=require(_0x551d('0x3'));var fs=require('fs');var Redis=require(_0x551d('0x4'));var db=require(_0x551d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x551d('0x6'))(_0x551d('0x7'));var config=require('../../config/environment');var jayson=require(_0x551d('0x8'));var client=jayson['client'][_0x551d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x234531,_0x383e03,_0x4ed532){return new BPromise(function(_0x5b0236,_0x4a3f3b){return client[_0x551d('0xa')](_0x234531,_0x4ed532)[_0x551d('0xb')](function(_0x2c804e){logger[_0x551d('0xc')](_0x551d('0xd'),_0x383e03,'request\x20sent');logger[_0x551d('0xe')](_0x551d('0xf'),_0x383e03,_0x551d('0x10'),JSON[_0x551d('0x11')](_0x2c804e));if(_0x2c804e[_0x551d('0x12')]){if(_0x2c804e[_0x551d('0x12')]['code']===0x1f4){logger[_0x551d('0x12')](_0x551d('0xd'),_0x383e03,_0x2c804e[_0x551d('0x12')][_0x551d('0x13')]);return _0x4a3f3b(_0x2c804e['error']['message']);}logger[_0x551d('0x12')](_0x551d('0xd'),_0x383e03,_0x2c804e[_0x551d('0x12')][_0x551d('0x13')]);return _0x5b0236(_0x2c804e[_0x551d('0x12')][_0x551d('0x13')]);}else{logger[_0x551d('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x383e03,_0x551d('0x10'));_0x5b0236(_0x2c804e[_0x551d('0x14')][_0x551d('0x13')]);}})[_0x551d('0x15')](function(_0x22e89c){logger[_0x551d('0x12')](_0x551d('0xd'),_0x383e03,_0x22e89c);_0x4a3f3b(_0x22e89c);});});} \ No newline at end of file +var _0xa23e=['../../mysqldb','rpc','../../config/environment','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa23e,0xf3));var _0xea23=function(_0x494a88,_0x5d0613){_0x494a88=_0x494a88-0x0;var _0x465885=_0xa23e[_0x494a88];return _0x465885;};'use strict';var _=require(_0xea23('0x0'));var util=require(_0xea23('0x1'));var moment=require(_0xea23('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea23('0x3'));var db=require(_0xea23('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea23('0x5'));var config=require(_0xea23('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xea23('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5923a0,_0x22b869,_0xee1c4b){return new BPromise(function(_0x3d64d1,_0x30afce){return client[_0xea23('0x8')](_0x5923a0,_0xee1c4b)[_0xea23('0x9')](function(_0x10cbce){logger[_0xea23('0xa')](_0xea23('0xb'),_0x22b869,'request\x20sent');logger['debug'](_0xea23('0xc'),_0x22b869,_0xea23('0xd'),JSON[_0xea23('0xe')](_0x10cbce));if(_0x10cbce[_0xea23('0xf')]){if(_0x10cbce[_0xea23('0xf')][_0xea23('0x10')]===0x1f4){logger[_0xea23('0xf')](_0xea23('0xb'),_0x22b869,_0x10cbce[_0xea23('0xf')]['message']);return _0x30afce(_0x10cbce[_0xea23('0xf')][_0xea23('0x11')]);}logger['error'](_0xea23('0xb'),_0x22b869,_0x10cbce[_0xea23('0xf')][_0xea23('0x11')]);return _0x3d64d1(_0x10cbce['error']['message']);}else{logger['info'](_0xea23('0xb'),_0x22b869,_0xea23('0xd'));_0x3d64d1(_0x10cbce[_0xea23('0x12')][_0xea23('0x11')]);}})['catch'](function(_0x193e11){logger[_0xea23('0xf')](_0xea23('0xb'),_0x22b869,_0x193e11);_0x30afce(_0x193e11);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c009ae7..9e7caea 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 _0xb04c=['/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xb04c,0x109));var _0xcb04=function(_0x158e4e,_0x4c281e){_0x158e4e=_0x158e4e-0x0;var _0x52f5f6=_0xb04c[_0x158e4e];return _0x52f5f6;};'use strict';var multer=require(_0xcb04('0x0'));var util=require(_0xcb04('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcb04('0x2'));var router=express[_0xcb04('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcb04('0x4'));var interaction=require(_0xcb04('0x5'));var config=require(_0xcb04('0x6'));var controller=require(_0xcb04('0x7'));router[_0xcb04('0x8')]('/',auth[_0xcb04('0x9')](),controller['index']);router[_0xcb04('0x8')](_0xcb04('0xa'),auth['isAuthenticated'](),controller[_0xcb04('0xb')]);router[_0xcb04('0x8')](_0xcb04('0xc'),auth[_0xcb04('0x9')](),controller[_0xcb04('0xd')]);router[_0xcb04('0x8')](_0xcb04('0xe'),auth[_0xcb04('0x9')](),controller['getSections']);router[_0xcb04('0x8')](_0xcb04('0xf'),auth[_0xcb04('0x9')](),controller[_0xcb04('0x10')]);router[_0xcb04('0x11')]('/',auth['isAuthenticated'](),controller[_0xcb04('0x12')]);router[_0xcb04('0x11')](_0xcb04('0x13'),auth[_0xcb04('0x9')](),controller['clone']);router[_0xcb04('0x11')](_0xcb04('0xe'),auth['isAuthenticated'](),controller[_0xcb04('0x14')]);router['post'](_0xcb04('0xf'),auth['isAuthenticated'](),controller[_0xcb04('0x15')]);router[_0xcb04('0x16')]('/:id',auth[_0xcb04('0x9')](),controller[_0xcb04('0x17')]);router[_0xcb04('0x18')](_0xcb04('0xc'),auth[_0xcb04('0x9')](),controller[_0xcb04('0x19')]);router[_0xcb04('0x18')](_0xcb04('0xe'),auth[_0xcb04('0x9')](),controller[_0xcb04('0x1a')]);router[_0xcb04('0x18')](_0xcb04('0xf'),auth[_0xcb04('0x9')](),controller['removeResources']);module[_0xcb04('0x1b')]=router; \ No newline at end of file +var _0xf675=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources'];(function(_0x3c5a7a,_0x47f782){var _0x4eeb5f=function(_0x19c7b9){while(--_0x19c7b9){_0x3c5a7a['push'](_0x3c5a7a['shift']());}};_0x4eeb5f(++_0x47f782);}(_0xf675,0x199));var _0x5f67=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xf675[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var path=require(_0x5f67('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f67('0x3'));var router=express['Router']();var fs_extra=require(_0x5f67('0x4'));var auth=require(_0x5f67('0x5'));var interaction=require(_0x5f67('0x6'));var config=require('../../config/environment');var controller=require(_0x5f67('0x7'));router[_0x5f67('0x8')]('/',auth[_0x5f67('0x9')](),controller[_0x5f67('0xa')]);router['get'](_0x5f67('0xb'),auth[_0x5f67('0x9')](),controller['describe']);router['get'](_0x5f67('0xc'),auth[_0x5f67('0x9')](),controller['show']);router['get'](_0x5f67('0xd'),auth[_0x5f67('0x9')](),controller[_0x5f67('0xe')]);router['get']('/:id/resources',auth['isAuthenticated'](),controller[_0x5f67('0xf')]);router[_0x5f67('0x10')]('/',auth['isAuthenticated'](),controller[_0x5f67('0x11')]);router['post'](_0x5f67('0x12'),auth['isAuthenticated'](),controller[_0x5f67('0x13')]);router[_0x5f67('0x10')](_0x5f67('0xd'),auth['isAuthenticated'](),controller[_0x5f67('0x14')]);router['post'](_0x5f67('0x15'),auth['isAuthenticated'](),controller[_0x5f67('0x16')]);router['put'](_0x5f67('0xc'),auth[_0x5f67('0x9')](),controller[_0x5f67('0x17')]);router[_0x5f67('0x18')](_0x5f67('0xc'),auth[_0x5f67('0x9')](),controller[_0x5f67('0x19')]);router[_0x5f67('0x18')](_0x5f67('0xd'),auth[_0x5f67('0x9')](),controller['removeSections']);router['delete'](_0x5f67('0x15'),auth[_0x5f67('0x9')](),controller['removeResources']);module[_0x5f67('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 a0c730d..4462706 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 _0x5f01=['name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x5f01,0x6a));var _0x15f0=function(_0x469562,_0x3542e8){_0x469562=_0x469562-0x0;var _0x719e35=_0x5f01[_0x469562];return _0x719e35;};'use strict';var Sequelize=require(_0x15f0('0x0'));module['exports']={'name':{'type':Sequelize[_0x15f0('0x1')],'allowNull':![],'unique':_0x15f0('0x2')},'crudPermissions':{'type':Sequelize[_0x15f0('0x1')],'set':function(_0x2e7e24){this[_0x15f0('0x3')](_0x15f0('0x4'),_0x2e7e24?_0x2e7e24[_0x15f0('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x15f0('0x4'))?this[_0x15f0('0x6')](_0x15f0('0x4'))[_0x15f0('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x15f0('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x15f0('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7748=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x7148b6,_0xa61534){var _0x111019=function(_0x452d96){while(--_0x452d96){_0x7148b6['push'](_0x7148b6['shift']());}};_0x111019(++_0xa61534);}(_0x7748,0x1f2));var _0x8774=function(_0x26332c,_0x2b3173){_0x26332c=_0x26332c-0x0;var _0x4995e1=_0x7748[_0x26332c];return _0x4995e1;};'use strict';var Sequelize=require('sequelize');module[_0x8774('0x0')]={'name':{'type':Sequelize[_0x8774('0x1')],'allowNull':![],'unique':_0x8774('0x2')},'crudPermissions':{'type':Sequelize[_0x8774('0x1')],'set':function(_0x5321ea){this[_0x8774('0x3')](_0x8774('0x4'),_0x5321ea?_0x5321ea[_0x8774('0x5')](''):[]);},'get':function(){return this[_0x8774('0x6')](_0x8774('0x4'))?this[_0x8774('0x6')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8774('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8774('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8774('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8774('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8774('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8774('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8774('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 855d008..772b208 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 _0x7c71=['removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','options','include','catch','show','params','create','body','clone','includeAll','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','destroy','describe','addSections'];(function(_0xec8e24,_0x55f9fb){var _0x3690cf=function(_0x2b600b){while(--_0x2b600b){_0xec8e24['push'](_0xec8e24['shift']());}};_0x3690cf(++_0x55f9fb);}(_0x7c71,0x177));var _0x17c7=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x7c71[_0x3825a8];return _0xabc9bc;};'use strict';var emlformat=require(_0x17c7('0x0'));var rimraf=require(_0x17c7('0x1'));var zipdir=require(_0x17c7('0x2'));var jsonpatch=require(_0x17c7('0x3'));var rp=require('request-promise');var moment=require(_0x17c7('0x4'));var BPromise=require(_0x17c7('0x5'));var Mustache=require(_0x17c7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17c7('0x7'));var csv=require(_0x17c7('0x8'));var ejs=require(_0x17c7('0x9'));var fs=require('fs');var fs_extra=require(_0x17c7('0xa'));var _=require(_0x17c7('0xb'));var squel=require(_0x17c7('0xc'));var crypto=require(_0x17c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x17c7('0xe'));var toCsv=require(_0x17c7('0x8'));var querystring=require(_0x17c7('0xf'));var Papa=require(_0x17c7('0x10'));var Redis=require(_0x17c7('0x11'));var authService=require(_0x17c7('0x12'));var qs=require(_0x17c7('0x13'));var as=require(_0x17c7('0x14'));var hardwareService=require(_0x17c7('0x15'));var logger=require(_0x17c7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x17c7('0x17'));var licenseUtil=require(_0x17c7('0x18'));var db=require('../../mysqldb')['db'];config[_0x17c7('0x19')]=_[_0x17c7('0x1a')](config['redis'],{'host':_0x17c7('0x1b'),'port':0x18eb});var socket=require(_0x17c7('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0x17c7('0x1d')](socket);function respondWithStatusCode(_0x2d980d,_0x257c43){_0x257c43=_0x257c43||0xcc;return function(_0x19e219){if(_0x19e219){return _0x2d980d[_0x17c7('0x1e')](_0x257c43);}return _0x2d980d[_0x17c7('0x1f')](_0x257c43)[_0x17c7('0x20')]();};}function respondWithResult(_0x295168,_0xa06e65){_0xa06e65=_0xa06e65||0xc8;return function(_0x30bb1d){if(_0x30bb1d){return _0x295168[_0x17c7('0x1f')](_0xa06e65)[_0x17c7('0x21')](_0x30bb1d);}};}function respondWithFilteredResult(_0x5470ab,_0x1e50e8){return function(_0x81d998){if(_0x81d998){var _0x5a2daf=typeof _0x1e50e8[_0x17c7('0x22')]===_0x17c7('0x23')&&typeof _0x1e50e8[_0x17c7('0x24')]===_0x17c7('0x23');var _0x5b9e72=_0x81d998['count'];var _0x2580ec=_0x5a2daf?0x0:_0x1e50e8[_0x17c7('0x22')];var _0x13b756=_0x5a2daf?_0x81d998[_0x17c7('0x25')]:_0x1e50e8[_0x17c7('0x22')]+_0x1e50e8[_0x17c7('0x24')];var _0x357c27;if(_0x13b756>=_0x5b9e72){_0x13b756=_0x5b9e72;_0x357c27=0xc8;}else{_0x357c27=0xce;}_0x5470ab['status'](_0x357c27);return _0x5470ab[_0x17c7('0x26')](_0x17c7('0x27'),_0x2580ec+'-'+_0x13b756+'/'+_0x5b9e72)[_0x17c7('0x21')](_0x81d998);}return null;};}function patchUpdates(_0x16700d){return function(_0x4342b2){try{jsonpatch[_0x17c7('0x28')](_0x4342b2,_0x16700d,!![]);}catch(_0x29a4ac){return BPromise[_0x17c7('0x29')](_0x29a4ac);}return _0x4342b2['save']();};}function saveUpdates(_0x312373,_0x11bcf0){return function(_0x26e280){if(_0x26e280){return _0x26e280[_0x17c7('0x2a')](_0x312373)[_0x17c7('0x2b')](function(_0xa6cfe5){return _0xa6cfe5;});}return null;};}function removeEntity(_0x4eb516,_0x36236d){return function(_0x58de90){if(_0x58de90){return _0x58de90['destroy']()[_0x17c7('0x2b')](function(){_0x4eb516['status'](0xcc)[_0x17c7('0x20')]();});}};}function handleEntityNotFound(_0x2e2c7a,_0x4a61f4){return function(_0x42b7f2){if(!_0x42b7f2){_0x2e2c7a[_0x17c7('0x1e')](0x194);}return _0x42b7f2;};}function handleError(_0x29dc53,_0x1d471d){_0x1d471d=_0x1d471d||0x1f4;return function(_0xe6f177){logger[_0x17c7('0x2c')](_0xe6f177[_0x17c7('0x2d')]);if(_0xe6f177[_0x17c7('0x2e')]){delete _0xe6f177[_0x17c7('0x2e')];}_0x29dc53[_0x17c7('0x1f')](_0x1d471d)[_0x17c7('0x2f')](_0xe6f177);};}exports[_0x17c7('0x30')]=function(_0xf4c5ff,_0xd38b0b){var _0x5c7706={},_0x1386be={},_0x4831d7={'count':0x0,'rows':[]};var _0xe06a5b=_[_0x17c7('0x31')](db[_0x17c7('0x32')][_0x17c7('0x33')],function(_0x22d057){return{'name':_0x22d057['fieldName'],'type':_0x22d057['type'][_0x17c7('0x34')]};});_0x1386be[_0x17c7('0x35')]=_[_0x17c7('0x31')](_0xe06a5b,_0x17c7('0x2e'));_0x1386be[_0x17c7('0x36')]=_[_0x17c7('0x37')](_0xf4c5ff[_0x17c7('0x36')]);_0x1386be[_0x17c7('0x38')]=_[_0x17c7('0x39')](_0x1386be['model'],_0x1386be[_0x17c7('0x36')]);_0x5c7706[_0x17c7('0x3a')]=_[_0x17c7('0x39')](_0x1386be['model'],qs[_0x17c7('0x3b')](_0xf4c5ff[_0x17c7('0x36')][_0x17c7('0x3b')]));_0x5c7706[_0x17c7('0x3a')]=_0x5c7706[_0x17c7('0x3a')][_0x17c7('0x3c')]?_0x5c7706[_0x17c7('0x3a')]:_0x1386be['model'];if(!_0xf4c5ff['query']['hasOwnProperty'](_0x17c7('0x3d'))){_0x5c7706['limit']=qs[_0x17c7('0x24')](_0xf4c5ff[_0x17c7('0x36')][_0x17c7('0x24')]);_0x5c7706['offset']=qs[_0x17c7('0x22')](_0xf4c5ff['query']['offset']);}_0x5c7706[_0x17c7('0x3e')]=qs[_0x17c7('0x3f')](_0xf4c5ff[_0x17c7('0x36')][_0x17c7('0x3f')]);_0x5c7706[_0x17c7('0x40')]=qs[_0x17c7('0x38')](_[_0x17c7('0x41')](_0xf4c5ff[_0x17c7('0x36')],_0x1386be[_0x17c7('0x38')]),_0xe06a5b);if(_0xf4c5ff[_0x17c7('0x36')]['filter']){_0x5c7706[_0x17c7('0x40')]=_[_0x17c7('0x42')](_0x5c7706[_0x17c7('0x40')],{'$or':_[_0x17c7('0x31')](_0xe06a5b,function(_0xf78354){if(_0xf78354[_0x17c7('0x43')]!=='VIRTUAL'){var _0x305a26={};_0x305a26[_0xf78354[_0x17c7('0x2e')]]={'$like':'%'+_0xf4c5ff[_0x17c7('0x36')][_0x17c7('0x44')]+'%'};return _0x305a26;}})});}_0x5c7706=_[_0x17c7('0x42')]({},_0x5c7706,_0xf4c5ff[_0x17c7('0x45')]);var _0x2c0f92={'where':_0x5c7706['where']};return db['UserProfile'][_0x17c7('0x25')](_0x2c0f92)[_0x17c7('0x2b')](function(_0xef91f1){_0x4831d7[_0x17c7('0x25')]=_0xef91f1;if(_0xf4c5ff[_0x17c7('0x36')]['includeAll']){_0x5c7706[_0x17c7('0x46')]=[{'all':!![]}];}return db[_0x17c7('0x32')]['findAll'](_0x5c7706);})[_0x17c7('0x2b')](function(_0x3d4f9d){_0x4831d7['rows']=_0x3d4f9d;return _0x4831d7;})[_0x17c7('0x2b')](respondWithFilteredResult(_0xd38b0b,_0x5c7706))[_0x17c7('0x47')](handleError(_0xd38b0b,null));};exports[_0x17c7('0x48')]=function(_0x4c0a44,_0x5f3b2f){var _0x105b32={'raw':![],'where':{'id':_0x4c0a44[_0x17c7('0x49')]['id']}},_0x40d579={};_0x40d579['model']=_[_0x17c7('0x37')](db['UserProfile'][_0x17c7('0x33')]);_0x40d579['query']=_[_0x17c7('0x37')](_0x4c0a44[_0x17c7('0x36')]);_0x40d579[_0x17c7('0x38')]=_['intersection'](_0x40d579[_0x17c7('0x35')],_0x40d579[_0x17c7('0x36')]);_0x105b32[_0x17c7('0x3a')]=_[_0x17c7('0x39')](_0x40d579[_0x17c7('0x35')],qs[_0x17c7('0x3b')](_0x4c0a44[_0x17c7('0x36')][_0x17c7('0x3b')]));_0x105b32[_0x17c7('0x3a')]=_0x105b32[_0x17c7('0x3a')]['length']?_0x105b32[_0x17c7('0x3a')]:_0x40d579['model'];if(_0x4c0a44[_0x17c7('0x36')]['includeAll']){_0x105b32[_0x17c7('0x46')]=[{'all':!![]}];}_0x105b32=_['merge']({},_0x105b32,_0x4c0a44[_0x17c7('0x45')]);return db[_0x17c7('0x32')]['find'](_0x105b32)['then'](handleEntityNotFound(_0x5f3b2f,null))[_0x17c7('0x2b')](respondWithResult(_0x5f3b2f,null))[_0x17c7('0x47')](handleError(_0x5f3b2f,null));};exports[_0x17c7('0x4a')]=function(_0x32d007,_0x2f1136){return db[_0x17c7('0x32')][_0x17c7('0x4a')](_0x32d007[_0x17c7('0x4b')],{})['then'](respondWithResult(_0x2f1136,0xc9))[_0x17c7('0x47')](handleError(_0x2f1136,null));};exports[_0x17c7('0x4c')]=function(_0x1ac1ff,_0x4821b0){var _0x1c7ed9={'where':{'id':_0x1ac1ff[_0x17c7('0x49')]['id']}},_0x1754b5={};_0x1754b5['model']=_[_0x17c7('0x37')](db[_0x17c7('0x32')]['rawAttributes']);_0x1c7ed9[_0x17c7('0x3a')]=_['intersection'](_0x1754b5[_0x17c7('0x35')],qs[_0x17c7('0x3b')](_0x1ac1ff[_0x17c7('0x36')][_0x17c7('0x3b')]));_0x1c7ed9[_0x17c7('0x3a')]=_0x1c7ed9[_0x17c7('0x3a')][_0x17c7('0x3c')]?_0x1c7ed9[_0x17c7('0x3a')]:_0x1754b5[_0x17c7('0x35')];if(_0x1ac1ff['query'][_0x17c7('0x4d')]){_0x1c7ed9['include']=[{'all':!![]}];}_0x1c7ed9=_[_0x17c7('0x42')]({},_0x1c7ed9,_0x1ac1ff[_0x17c7('0x45')]);return db[_0x17c7('0x32')][_0x17c7('0x4e')](_0x1c7ed9)[_0x17c7('0x2b')](handleEntityNotFound(_0x4821b0,null))['then'](function(_0x51b7ca){if(_0x51b7ca){var _0x41a7ed=_0x51b7ca[_0x17c7('0x4f')]({'plain':!![]});_0x41a7ed=qs[_0x17c7('0x50')](_0x41a7ed,['id',_0x17c7('0x51'),_0x17c7('0x52'),_0x17c7('0x53')]);_0x1ac1ff[_0x17c7('0x4b')]=_[_0x17c7('0x50')](_0x1ac1ff[_0x17c7('0x4b')],['id','createdAt',_0x17c7('0x52')]);return db[_0x17c7('0x54')][_0x17c7('0x55')](function(_0x4606db){return db['UserProfile'][_0x17c7('0x4a')](_[_0x17c7('0x42')](_0x41a7ed,_0x1ac1ff['body']),{'include':_0x1ac1ff[_0x17c7('0x36')][_0x17c7('0x4d')]?[{'all':!![]}]:undefined,'transaction':_0x4606db})['then'](function(_0x1b3488){var _0x2cffe5=_0x1b3488[_0x17c7('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0x17c7('0x56')]({'where':{'userProfileId':_0x1ac1ff[_0x17c7('0x49')]['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x233d69){if(_0x233d69){return BPromise[_0x17c7('0x57')](_0x233d69,function(_0x8f035f){return new BPromise(function(_0x1de21b,_0x36d6f2){if(_0x8f035f[_0x17c7('0x58')]===null||_0x8f035f[_0x17c7('0x58')]===0x1)_0x1de21b(null);return db[_0x17c7('0x59')][_0x17c7('0x56')]({'where':{'sectionId':_0x8f035f['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x301b47){var _0x403ab8=_[_0x17c7('0x31')](_0x301b47,function(_0x31a4eb){return qs['omit'](_0x31a4eb,['id',_0x17c7('0x51'),_0x17c7('0x52'),_0x17c7('0x5a')]);});_0x1de21b(_0x403ab8);})[_0x17c7('0x47')](function(_0xcdfc39){_0x36d6f2(_0xcdfc39);});})[_0x17c7('0x2b')](function(_0x177d1f){var _0x4e3ec9=qs['omit'](_0x8f035f,['id',_0x17c7('0x51'),_0x17c7('0x52')]);_0x4e3ec9[_0x17c7('0x5b')]=_0x2cffe5['id'];if(_0x177d1f)_0x4e3ec9[_0x17c7('0x5c')]=_0x177d1f;return _0x4e3ec9;})['then'](function(_0x243863){return db[_0x17c7('0x5d')][_0x17c7('0x4a')](_0x243863,{'include':[{'model':db[_0x17c7('0x59')],'as':_0x17c7('0x5c')}],'raw':!![],'transaction':_0x4606db});});})['then'](function(){return _0x2cffe5;});}});});});}})[_0x17c7('0x2b')](respondWithResult(_0x4821b0,0xc9))[_0x17c7('0x47')](handleError(_0x4821b0,null));};exports['update']=function(_0xc8d6e2,_0x27becb){if(_0xc8d6e2[_0x17c7('0x4b')]['id']){delete _0xc8d6e2[_0x17c7('0x4b')]['id'];}return db[_0x17c7('0x32')][_0x17c7('0x4e')]({'where':{'id':_0xc8d6e2[_0x17c7('0x49')]['id']}})[_0x17c7('0x2b')](handleEntityNotFound(_0x27becb,null))[_0x17c7('0x2b')](saveUpdates(_0xc8d6e2[_0x17c7('0x4b')],null))[_0x17c7('0x2b')](respondWithResult(_0x27becb,null))['catch'](handleError(_0x27becb,null));};exports[_0x17c7('0x5e')]=function(_0x32ed16,_0x24bf75){return db[_0x17c7('0x32')][_0x17c7('0x4e')]({'where':{'id':_0x32ed16[_0x17c7('0x49')]['id']}})[_0x17c7('0x2b')](handleEntityNotFound(_0x24bf75,null))[_0x17c7('0x2b')](removeEntity(_0x24bf75,null))[_0x17c7('0x47')](handleError(_0x24bf75,null));};exports[_0x17c7('0x5f')]=function(_0x35a428,_0x1aa869){return db['UserProfile'][_0x17c7('0x5f')]()[_0x17c7('0x2b')](respondWithResult(_0x1aa869,null))[_0x17c7('0x47')](handleError(_0x1aa869,null));};exports[_0x17c7('0x60')]=function(_0xae7f1a,_0x37f4d4){var _0x338cfe=_0xae7f1a[_0x17c7('0x4b')];return db[_0x17c7('0x32')][_0x17c7('0x4e')]({'where':{'id':_0xae7f1a[_0x17c7('0x49')]['id']}})[_0x17c7('0x2b')](handleEntityNotFound(_0x37f4d4,null))[_0x17c7('0x2b')](function(_0x202766){if(_0x202766){return db[_0x17c7('0x54')]['transaction'](function(_0x3a1400){return db[_0x17c7('0x5d')][_0x17c7('0x5e')]({'where':{'userProfileId':_0xae7f1a[_0x17c7('0x49')]['id'],'sectionId':_[_0x17c7('0x31')](_0x338cfe,function(_0x304c14){return _0x304c14['sectionId'];})},'transaction':_0x3a1400})[_0x17c7('0x2b')](function(){var _0x2b57a0=_['map'](_0x338cfe,function(_0x23521d){_0x23521d[_0x17c7('0x5b')]=_0xae7f1a[_0x17c7('0x49')]['id'];return _0x23521d;});var _0x3a8e29=[];return BPromise[_0x17c7('0x57')](_0x2b57a0,function(_0x45eb5b){return db[_0x17c7('0x5d')][_0x17c7('0x4a')](_0x45eb5b,{'include':[{'model':db[_0x17c7('0x59')],'as':_0x17c7('0x5c')}],'raw':!![],'transaction':_0x3a1400})['then'](function(_0x1baf62){_0x3a8e29['push'](_0x1baf62['get']({'plain':!![]}));});})['then'](function(){return _0x3a8e29;});});});}})[_0x17c7('0x2b')](function(_0x545b9c){return _0x545b9c;})[_0x17c7('0x2b')](respondWithResult(_0x37f4d4,null))['catch'](handleError(_0x37f4d4,null));};exports[_0x17c7('0x61')]=function(_0x4c3742,_0x3d3985){var _0x40044;return db['UserProfile'][_0x17c7('0x4e')]({'where':{'id':_0x4c3742[_0x17c7('0x49')]['id']},'attributes':['id',_0x17c7('0x2e')]})[_0x17c7('0x2b')](handleEntityNotFound(_0x3d3985,null))[_0x17c7('0x2b')](function(_0x1b3507){if(_0x1b3507){_0x40044=_0x1b3507;return db[_0x17c7('0x5d')]['destroy']({'where':{'userProfileId':_0x4c3742[_0x17c7('0x49')]['id'],'sectionId':_0x4c3742[_0x17c7('0x36')][_0x17c7('0x62')]}});}})[_0x17c7('0x2b')](function(){return _0x40044;})['then'](respondWithStatusCode(_0x3d3985,null))[_0x17c7('0x47')](handleError(_0x3d3985,null));};exports[_0x17c7('0x63')]=function(_0x2c24ef,_0x48a2f5){var _0x1a3f6c=[];var _0x5b3873=[];return db[_0x17c7('0x5d')][_0x17c7('0x56')]({'where':{'userProfileId':_0x2c24ef[_0x17c7('0x49')]['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x4f8796){_0x1a3f6c=_['filter'](_0x4f8796,function(_0x4158cb){return _0x4158cb[_0x17c7('0x64')]===0x1||_[_0x17c7('0x65')]([0x3eb,0x709],_0x4158cb['sectionId']);});if(!_[_0x17c7('0x66')](_0x1a3f6c)){return _[_0x17c7('0x31')](_0x1a3f6c,function(_0x5a41bb){return _0x5a41bb[_0x17c7('0x5a')];});}else{return;}})[_0x17c7('0x2b')](function(_0x162f91){if(_0x162f91)_0x5b3873=_0x162f91;if(_[_0x17c7('0x65')](_0x5b3873,0x64)){var _0x4bce0c=_[_0x17c7('0x4e')](_0x1a3f6c,{'sectionId':0x64});return hasDefaultDashboard(_0x4bce0c)[_0x17c7('0x2b')](function(_0x596cd5){return _['map'](_0x1a3f6c,function(_0x3d484b){if(_0x3d484b[_0x17c7('0x5a')]===0x64){_0x3d484b[_0x17c7('0x67')]=_0x596cd5;}return _0x3d484b;});});}else{return;}})[_0x17c7('0x2b')](function(_0x30ce00){if(_0x30ce00)_0x1a3f6c=_0x30ce00;if(_[_0x17c7('0x65')](_0x5b3873,0x3eb)){var _0x378211=_['find'](_0x1a3f6c,{'sectionId':0x3eb});return getCustomDashboards(_0x378211)[_0x17c7('0x2b')](function(_0x1e4175){return _[_0x17c7('0x31')](_0x1a3f6c,function(_0x2dd39d){if(_0x378211[_0x17c7('0x64')]){if(_0x2dd39d[_0x17c7('0x5a')]===0x3eb){_0x2dd39d[_0x17c7('0x67')]=_0x1e4175;}}else{if(_0x2dd39d[_0x17c7('0x5a')]===0x64){_0x2dd39d['subsections']=_0x1e4175;}}return _0x2dd39d;});});}else{return;}})[_0x17c7('0x2b')](function(_0xeb7659){if(_0xeb7659)_0x1a3f6c=_0xeb7659;if(_[_0x17c7('0x65')](_0x5b3873,0x709)){var _0x306da3=_[_0x17c7('0x4e')](_0x1a3f6c,{'sectionId':0x709});return getPlugins(_0x306da3)[_0x17c7('0x2b')](function(_0x554d97){if(_0x306da3[_0x17c7('0x64')]){return _[_0x17c7('0x31')](_0x1a3f6c,function(_0x2d1d09){if(_0x2d1d09[_0x17c7('0x5a')]===0x709){_0x2d1d09[_0x17c7('0x67')]=_0x554d97;}return _0x2d1d09;});}else{var _0x18b538={'sectionId':0x76c,'enabled':0x1,'subsections':_0x554d97};var _0x172f09=_[_0x17c7('0x31')](_0x1a3f6c);_0x172f09[_0x17c7('0x68')](_0x18b538);return _0x172f09;}});}else{return;}})['then'](function(_0x16ff4c){if(_0x16ff4c)_0x1a3f6c=_0x16ff4c;return _[_0x17c7('0x44')](_0x1a3f6c,[_0x17c7('0x64'),0x1]);})[_0x17c7('0x2b')](respondWithResult(_0x48a2f5,null))['catch'](handleError(_0x48a2f5,null));};function hasDefaultDashboard(_0x5be779){var _0x581e0=[0x65];return new BPromise(function(_0x2a9e03,_0x563738){try{if(_0x5be779[_0x17c7('0x58')]){_0x2a9e03(_0x581e0);}else{return db[_0x17c7('0x59')][_0x17c7('0x69')]({'where':{'sectionId':_0x5be779['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x54e1c0){_0x54e1c0?_0x2a9e03(_0x581e0):_0x2a9e03();});}}catch(_0x5933bc){_0x563738(_0x5933bc);}});}function getCustomDashboards(_0x2295e3){var _0x43a97d=[];return new BPromise(function(_0x4485fe,_0x59d3df){try{if(_0x2295e3['autoAssociation']){return db[_0x17c7('0x6a')][_0x17c7('0x56')]({'raw':!![]})[_0x17c7('0x2b')](function(_0x5b990d){_0x5b990d[_0x17c7('0x6b')](function(_0xab607b){_0x43a97d[_0x17c7('0x68')](_0xab607b['id']+0x1869f);});_0x4485fe(_0x43a97d);});}else{return db[_0x17c7('0x59')][_0x17c7('0x56')]({'where':{'sectionId':_0x2295e3['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x499c2f){_0x499c2f[_0x17c7('0x6b')](function(_0x617b15){_0x43a97d[_0x17c7('0x68')](_0x617b15[_0x17c7('0x6c')]+0x1869f);});_0x4485fe(_0x43a97d);});}}catch(_0x37462a){_0x59d3df(_0x37462a);}});}function getPlugins(_0x1b5d2e){var _0x30c280=[];return new BPromise(function(_0x370111,_0xb8ab91){try{if(_0x1b5d2e[_0x17c7('0x58')]){return db[_0x17c7('0x6d')]['findAll']({'raw':!![]})[_0x17c7('0x2b')](function(_0x19cd5b){_0x19cd5b['forEach'](function(_0x4712fa){_0x30c280[_0x17c7('0x68')](_0x4712fa['id']+0x15b38);});_0x370111(_0x30c280);});}else{return db[_0x17c7('0x59')]['findAll']({'where':{'sectionId':_0x1b5d2e['id']},'raw':!![]})[_0x17c7('0x2b')](function(_0x293aa8){_0x293aa8[_0x17c7('0x6b')](function(_0x34ccec){_0x30c280[_0x17c7('0x68')](_0x34ccec[_0x17c7('0x6c')]+0x15b38);});_0x370111(_0x30c280);});}}catch(_0x3a2bd9){_0xb8ab91(_0x3a2bd9);}});}exports[_0x17c7('0x6e')]=function(_0x1e1aad,_0x515f68){return db[_0x17c7('0x32')][_0x17c7('0x4e')]({'where':{'id':_0x1e1aad[_0x17c7('0x49')]['id']}})[_0x17c7('0x2b')](handleEntityNotFound(_0x515f68,null))[_0x17c7('0x2b')](function(_0x3e75f4){if(_0x3e75f4){return db[_0x17c7('0x54')][_0x17c7('0x55')](function(_0x5583c8){return db['UserProfileSection'][_0x17c7('0x56')]({'where':{'userProfileId':_0x1e1aad['params']['id']},'attributes':['id'],'raw':!![]})[_0x17c7('0x2b')](function(_0xa02e8a){if(_0xa02e8a){return db['UserProfileSection'][_0x17c7('0x5e')]({'where':{'userProfileId':_0x1e1aad['params']['id'],'id':_[_0x17c7('0x31')](_0xa02e8a,function(_0x1b8d02){return _0x1b8d02['id'];})},'transaction':_0x5583c8});}})[_0x17c7('0x2b')](function(_0x284957){var _0x2f549e=_[_0x17c7('0x31')](_0x1e1aad[_0x17c7('0x4b')],function(_0x1df117){_0x1df117['userProfileId']=_0x1e1aad[_0x17c7('0x49')]['id'];return _0x1df117;});return db[_0x17c7('0x5d')][_0x17c7('0x6f')](_0x2f549e,{'raw':!![],'transaction':_0x5583c8});})['then'](function(_0x579b50){var _0x3834ca=_[_0x17c7('0x44')](_[_0x17c7('0x31')](_0x579b50,function(_0x290f0e){return _0x290f0e[_0x17c7('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3834ca){return db[_0x17c7('0x5d')][_0x17c7('0x56')]({'where':{'userProfileId':_0x1e1aad[_0x17c7('0x49')]['id'],'sectionId':_[_0x17c7('0x31')](_0x3834ca,function(_0x44c72a){return _0x44c72a[_0x17c7('0x5a')];})},'attributes':['id',_0x17c7('0x5a')],'raw':!![]})['then'](function(_0x5d1f7d){var _0x2a8cd1=_[_0x17c7('0x31')](_0x1e1aad[_0x17c7('0x4b')],function(_0x409a23){_0x409a23['userProfileId']=_0x1e1aad['params']['id'];return _0x409a23;});return db[_0x17c7('0x59')][_0x17c7('0x6f')](_0x2a8cd1,{'raw':!![],'transaction':_0x5583c8});});}})['catch'](handleError(_0x515f68,null));});}})['then'](function(_0x44858c){var _0x2b81ba=_[_0x17c7('0x31')](_0x44858c,function(_0x461bc7){return _0x461bc7[_0x17c7('0x4f')]({'plain':!![]});});})['then'](respondWithResult(_0x515f68,null))[_0x17c7('0x47')](handleError(_0x515f68,null));};exports[_0x17c7('0x70')]=function(_0x280216,_0x553bf1,_0x36ede2){return db[_0x17c7('0x32')]['find']({'where':{'id':_0x280216['params']['id']}})['then'](handleEntityNotFound(_0x553bf1,null))['then'](function(_0xcf0cad){if(_0xcf0cad){return _0xcf0cad[_0x17c7('0x70')](_0x280216[_0x17c7('0x36')][_0x17c7('0x62')]);}})['then'](respondWithStatusCode(_0x553bf1,null))[_0x17c7('0x47')](handleError(_0x553bf1,null));};exports[_0x17c7('0x71')]=function(_0x57936d,_0x1cb969){var _0x1a8d7a={};if(!_0x57936d[_0x17c7('0x36')][_0x17c7('0x72')])throw new Error(_0x17c7('0x73'));if(!_0x57936d['query'][_0x17c7('0x74')](_0x17c7('0x3d'))){_0x1a8d7a['limit']=qs['limit'](_0x57936d[_0x17c7('0x36')]['limit']);_0x1a8d7a[_0x17c7('0x22')]=qs[_0x17c7('0x22')](_0x57936d[_0x17c7('0x36')][_0x17c7('0x22')]);}return db[_0x17c7('0x32')]['find']({'where':{'id':_0x57936d[_0x17c7('0x49')]['id']}})['then'](function(_0xabc93d){if(!_0xabc93d)throw new Error(_0x17c7('0x75')+_0x57936d[_0x17c7('0x49')]['id']);return db['UserProfile'][_0x17c7('0x71')](_0x57936d);})[_0x17c7('0x2b')](respondWithFilteredResult(_0x1cb969,_0x1a8d7a))[_0x17c7('0x47')](handleError(_0x1cb969,null));}; \ No newline at end of file +var _0xdf4d=['../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','index','UserProfile','rawAttributes','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','intersection','find','create','get','createdAt','updatedAt','crudPermissions','body','omit','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','addSections','destroy','userProfileId','push','removeSections','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x21b025,_0x3bbf4a){var _0x348338=function(_0x58da84){while(--_0x58da84){_0x21b025['push'](_0x21b025['shift']());}};_0x348338(++_0x3bbf4a);}(_0xdf4d,0xcb));var _0xddf4=function(_0x5e205b,_0x38a55f){_0x5e205b=_0x5e205b-0x0;var _0x3f3fa5=_0xdf4d[_0x5e205b];return _0x3f3fa5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddf4('0x0'));var zipdir=require(_0xddf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddf4('0x2'));var moment=require(_0xddf4('0x3'));var BPromise=require(_0xddf4('0x4'));var Mustache=require(_0xddf4('0x5'));var util=require(_0xddf4('0x6'));var path=require(_0xddf4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xddf4('0x8'));var fs=require('fs');var fs_extra=require(_0xddf4('0x9'));var _=require(_0xddf4('0xa'));var squel=require(_0xddf4('0xb'));var crypto=require(_0xddf4('0xc'));var jsforce=require(_0xddf4('0xd'));var deskjs=require(_0xddf4('0xe'));var toCsv=require(_0xddf4('0xf'));var querystring=require(_0xddf4('0x10'));var Papa=require(_0xddf4('0x11'));var Redis=require(_0xddf4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xddf4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf4('0x14'));var logger=require(_0xddf4('0x15'))(_0xddf4('0x16'));var utils=require(_0xddf4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xddf4('0x18'));var db=require(_0xddf4('0x19'))['db'];config[_0xddf4('0x1a')]=_[_0xddf4('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xddf4('0x1c'))(new Redis(config['redis']));require(_0xddf4('0x1d'))[_0xddf4('0x1e')](socket);function respondWithStatusCode(_0x3754f5,_0x276ab2){_0x276ab2=_0x276ab2||0xcc;return function(_0x3ef3a1){if(_0x3ef3a1){return _0x3754f5['sendStatus'](_0x276ab2);}return _0x3754f5[_0xddf4('0x1f')](_0x276ab2)['end']();};}function respondWithResult(_0x13c576,_0x464288){_0x464288=_0x464288||0xc8;return function(_0x111e2e){if(_0x111e2e){return _0x13c576[_0xddf4('0x1f')](_0x464288)[_0xddf4('0x20')](_0x111e2e);}};}function respondWithFilteredResult(_0x29ff35,_0x28f3fb){return function(_0x4d76b1){if(_0x4d76b1){var _0x49e4d3=typeof _0x28f3fb[_0xddf4('0x21')]===_0xddf4('0x22')&&typeof _0x28f3fb['limit']==='undefined';var _0x5cb24f=_0x4d76b1[_0xddf4('0x23')];var _0x412dab=_0x49e4d3?0x0:_0x28f3fb[_0xddf4('0x21')];var _0x254c7a=_0x49e4d3?_0x4d76b1[_0xddf4('0x23')]:_0x28f3fb['offset']+_0x28f3fb[_0xddf4('0x24')];var _0x5b1aee;if(_0x254c7a>=_0x5cb24f){_0x254c7a=_0x5cb24f;_0x5b1aee=0xc8;}else{_0x5b1aee=0xce;}_0x29ff35[_0xddf4('0x1f')](_0x5b1aee);return _0x29ff35[_0xddf4('0x25')](_0xddf4('0x26'),_0x412dab+'-'+_0x254c7a+'/'+_0x5cb24f)['json'](_0x4d76b1);}return null;};}function patchUpdates(_0x1f7a04){return function(_0x60b240){try{jsonpatch[_0xddf4('0x27')](_0x60b240,_0x1f7a04,!![]);}catch(_0x4ccad2){return BPromise[_0xddf4('0x28')](_0x4ccad2);}return _0x60b240[_0xddf4('0x29')]();};}function saveUpdates(_0x149a0e,_0x3d37da){return function(_0x321b6c){if(_0x321b6c){return _0x321b6c[_0xddf4('0x2a')](_0x149a0e)[_0xddf4('0x2b')](function(_0x898311){return _0x898311;});}return null;};}function removeEntity(_0x44bb39,_0x1757f6){return function(_0x2c76c6){if(_0x2c76c6){return _0x2c76c6['destroy']()[_0xddf4('0x2b')](function(){_0x44bb39['status'](0xcc)[_0xddf4('0x2c')]();});}};}function handleEntityNotFound(_0x1d9edd,_0x345d35){return function(_0x67dbb1){if(!_0x67dbb1){_0x1d9edd[_0xddf4('0x2d')](0x194);}return _0x67dbb1;};}function handleError(_0x19cfb7,_0x215f34){_0x215f34=_0x215f34||0x1f4;return function(_0x1e8945){logger[_0xddf4('0x2e')](_0x1e8945[_0xddf4('0x2f')]);if(_0x1e8945[_0xddf4('0x30')]){delete _0x1e8945['name'];}_0x19cfb7['status'](_0x215f34)['send'](_0x1e8945);};}exports[_0xddf4('0x31')]=function(_0x4c2ad9,_0xbcbbaa){var _0x10311d={},_0x3e2680={},_0x1be3e7={'count':0x0,'rows':[]};var _0x48de86=_['map'](db[_0xddf4('0x32')][_0xddf4('0x33')],function(_0x4fc988){return{'name':_0x4fc988['fieldName'],'type':_0x4fc988[_0xddf4('0x34')][_0xddf4('0x35')]};});_0x3e2680[_0xddf4('0x36')]=_['map'](_0x48de86,_0xddf4('0x30'));_0x3e2680[_0xddf4('0x37')]=_['keys'](_0x4c2ad9['query']);_0x3e2680[_0xddf4('0x38')]=_['intersection'](_0x3e2680[_0xddf4('0x36')],_0x3e2680[_0xddf4('0x37')]);_0x10311d['attributes']=_['intersection'](_0x3e2680[_0xddf4('0x36')],qs['fields'](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x39')]));_0x10311d[_0xddf4('0x3a')]=_0x10311d[_0xddf4('0x3a')][_0xddf4('0x3b')]?_0x10311d[_0xddf4('0x3a')]:_0x3e2680[_0xddf4('0x36')];if(!_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x3c')](_0xddf4('0x3d'))){_0x10311d['limit']=qs[_0xddf4('0x24')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x24')]);_0x10311d[_0xddf4('0x21')]=qs[_0xddf4('0x21')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x21')]);}_0x10311d[_0xddf4('0x3e')]=qs[_0xddf4('0x3f')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x3f')]);_0x10311d[_0xddf4('0x40')]=qs[_0xddf4('0x38')](_['pick'](_0x4c2ad9[_0xddf4('0x37')],_0x3e2680[_0xddf4('0x38')]),_0x48de86);if(_0x4c2ad9['query'][_0xddf4('0x41')]){_0x10311d[_0xddf4('0x40')]=_[_0xddf4('0x42')](_0x10311d[_0xddf4('0x40')],{'$or':_[_0xddf4('0x43')](_0x48de86,function(_0xd7e337){if(_0xd7e337[_0xddf4('0x34')]!==_0xddf4('0x44')){var _0x5b7bd2={};_0x5b7bd2[_0xd7e337[_0xddf4('0x30')]]={'$like':'%'+_0x4c2ad9['query']['filter']+'%'};return _0x5b7bd2;}})});}_0x10311d=_[_0xddf4('0x42')]({},_0x10311d,_0x4c2ad9[_0xddf4('0x45')]);var _0x3cd53f={'where':_0x10311d[_0xddf4('0x40')]};return db[_0xddf4('0x32')]['count'](_0x3cd53f)[_0xddf4('0x2b')](function(_0x1195d4){_0x1be3e7[_0xddf4('0x23')]=_0x1195d4;if(_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x46')]){_0x10311d[_0xddf4('0x47')]=[{'all':!![]}];}return db[_0xddf4('0x32')][_0xddf4('0x48')](_0x10311d);})[_0xddf4('0x2b')](function(_0x2f9588){_0x1be3e7[_0xddf4('0x49')]=_0x2f9588;return _0x1be3e7;})[_0xddf4('0x2b')](respondWithFilteredResult(_0xbcbbaa,_0x10311d))[_0xddf4('0x4a')](handleError(_0xbcbbaa,null));};exports['show']=function(_0x1bcb35,_0x284134){var _0x59d876={'raw':![],'where':{'id':_0x1bcb35[_0xddf4('0x4b')]['id']}},_0x8e38ea={};_0x8e38ea[_0xddf4('0x36')]=_[_0xddf4('0x4c')](db[_0xddf4('0x32')][_0xddf4('0x33')]);_0x8e38ea[_0xddf4('0x37')]=_[_0xddf4('0x4c')](_0x1bcb35[_0xddf4('0x37')]);_0x8e38ea[_0xddf4('0x38')]=_[_0xddf4('0x4d')](_0x8e38ea[_0xddf4('0x36')],_0x8e38ea['query']);_0x59d876['attributes']=_[_0xddf4('0x4d')](_0x8e38ea[_0xddf4('0x36')],qs[_0xddf4('0x39')](_0x1bcb35[_0xddf4('0x37')][_0xddf4('0x39')]));_0x59d876[_0xddf4('0x3a')]=_0x59d876['attributes'][_0xddf4('0x3b')]?_0x59d876[_0xddf4('0x3a')]:_0x8e38ea['model'];if(_0x1bcb35[_0xddf4('0x37')][_0xddf4('0x46')]){_0x59d876[_0xddf4('0x47')]=[{'all':!![]}];}_0x59d876=_[_0xddf4('0x42')]({},_0x59d876,_0x1bcb35['options']);return db[_0xddf4('0x32')][_0xddf4('0x4e')](_0x59d876)['then'](handleEntityNotFound(_0x284134,null))['then'](respondWithResult(_0x284134,null))[_0xddf4('0x4a')](handleError(_0x284134,null));};exports['create']=function(_0x288c8a,_0x27b30a){return db[_0xddf4('0x32')][_0xddf4('0x4f')](_0x288c8a['body'],{})[_0xddf4('0x2b')](respondWithResult(_0x27b30a,0xc9))[_0xddf4('0x4a')](handleError(_0x27b30a,null));};exports['clone']=function(_0x3943dc,_0x5b1552){var _0x203eed={'where':{'id':_0x3943dc[_0xddf4('0x4b')]['id']}},_0x1efc8d={};_0x1efc8d['model']=_[_0xddf4('0x4c')](db['UserProfile'][_0xddf4('0x33')]);_0x203eed['attributes']=_[_0xddf4('0x4d')](_0x1efc8d[_0xddf4('0x36')],qs[_0xddf4('0x39')](_0x3943dc[_0xddf4('0x37')][_0xddf4('0x39')]));_0x203eed['attributes']=_0x203eed[_0xddf4('0x3a')][_0xddf4('0x3b')]?_0x203eed[_0xddf4('0x3a')]:_0x1efc8d['model'];if(_0x3943dc[_0xddf4('0x37')]['includeAll']){_0x203eed[_0xddf4('0x47')]=[{'all':!![]}];}_0x203eed=_[_0xddf4('0x42')]({},_0x203eed,_0x3943dc[_0xddf4('0x45')]);return db[_0xddf4('0x32')][_0xddf4('0x4e')](_0x203eed)[_0xddf4('0x2b')](handleEntityNotFound(_0x5b1552,null))['then'](function(_0x193a18){if(_0x193a18){var _0x2a58c8=_0x193a18[_0xddf4('0x50')]({'plain':!![]});_0x2a58c8=qs['omit'](_0x2a58c8,['id',_0xddf4('0x51'),_0xddf4('0x52'),_0xddf4('0x53')]);_0x3943dc[_0xddf4('0x54')]=_[_0xddf4('0x55')](_0x3943dc['body'],['id','createdAt','updatedAt']);return db[_0xddf4('0x56')][_0xddf4('0x57')](function(_0x29dc36){return db[_0xddf4('0x32')][_0xddf4('0x4f')](_['merge'](_0x2a58c8,_0x3943dc[_0xddf4('0x54')]),{'include':_0x3943dc[_0xddf4('0x37')][_0xddf4('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x29dc36})['then'](function(_0x364812){var _0x3fb248=_0x364812[_0xddf4('0x50')]({'plain':!![]});return db['UserProfileSection'][_0xddf4('0x48')]({'where':{'userProfileId':_0x3943dc[_0xddf4('0x4b')]['id']},'raw':!![]})['then'](function(_0x30ae8a){if(_0x30ae8a){return BPromise[_0xddf4('0x58')](_0x30ae8a,function(_0x3e9d8a){return new BPromise(function(_0x1d06ea,_0x11893f){if(_0x3e9d8a['autoAssociation']===null||_0x3e9d8a[_0xddf4('0x59')]===0x1)_0x1d06ea(null);return db[_0xddf4('0x5a')][_0xddf4('0x48')]({'where':{'sectionId':_0x3e9d8a['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x4c2080){var _0x32dfbf=_[_0xddf4('0x43')](_0x4c2080,function(_0x2eca89){return qs[_0xddf4('0x55')](_0x2eca89,['id',_0xddf4('0x51'),_0xddf4('0x52'),_0xddf4('0x5b')]);});_0x1d06ea(_0x32dfbf);})[_0xddf4('0x4a')](function(_0x90745b){_0x11893f(_0x90745b);});})[_0xddf4('0x2b')](function(_0x21db53){var _0x605e2c=qs['omit'](_0x3e9d8a,['id',_0xddf4('0x51'),'updatedAt']);_0x605e2c['userProfileId']=_0x3fb248['id'];if(_0x21db53)_0x605e2c[_0xddf4('0x5c')]=_0x21db53;return _0x605e2c;})['then'](function(_0x48d54a){return db[_0xddf4('0x5d')][_0xddf4('0x4f')](_0x48d54a,{'include':[{'model':db[_0xddf4('0x5a')],'as':_0xddf4('0x5c')}],'raw':!![],'transaction':_0x29dc36});});})[_0xddf4('0x2b')](function(){return _0x3fb248;});}});});});}})['then'](respondWithResult(_0x5b1552,0xc9))['catch'](handleError(_0x5b1552,null));};exports[_0xddf4('0x2a')]=function(_0x545cf8,_0x42ff2a){if(_0x545cf8[_0xddf4('0x54')]['id']){delete _0x545cf8['body']['id'];}return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x545cf8[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x42ff2a,null))[_0xddf4('0x2b')](saveUpdates(_0x545cf8[_0xddf4('0x54')],null))['then'](respondWithResult(_0x42ff2a,null))['catch'](handleError(_0x42ff2a,null));};exports['destroy']=function(_0x4a5837,_0x223028){return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x4a5837[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x223028,null))[_0xddf4('0x2b')](removeEntity(_0x223028,null))[_0xddf4('0x4a')](handleError(_0x223028,null));};exports['describe']=function(_0x82d699,_0x313551){return db[_0xddf4('0x32')]['describe']()[_0xddf4('0x2b')](respondWithResult(_0x313551,null))['catch'](handleError(_0x313551,null));};exports[_0xddf4('0x5e')]=function(_0x48f6c5,_0x1c480a){var _0xcef0c2=_0x48f6c5[_0xddf4('0x54')];return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x48f6c5[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x1c480a,null))[_0xddf4('0x2b')](function(_0x38e3a6){if(_0x38e3a6){return db[_0xddf4('0x56')][_0xddf4('0x57')](function(_0x37b462){return db[_0xddf4('0x5d')][_0xddf4('0x5f')]({'where':{'userProfileId':_0x48f6c5[_0xddf4('0x4b')]['id'],'sectionId':_[_0xddf4('0x43')](_0xcef0c2,function(_0x353c30){return _0x353c30['sectionId'];})},'transaction':_0x37b462})['then'](function(){var _0x33f4b3=_[_0xddf4('0x43')](_0xcef0c2,function(_0x1a700b){_0x1a700b[_0xddf4('0x60')]=_0x48f6c5[_0xddf4('0x4b')]['id'];return _0x1a700b;});var _0x446f12=[];return BPromise['each'](_0x33f4b3,function(_0x397b25){return db[_0xddf4('0x5d')][_0xddf4('0x4f')](_0x397b25,{'include':[{'model':db['UserProfileResource'],'as':_0xddf4('0x5c')}],'raw':!![],'transaction':_0x37b462})[_0xddf4('0x2b')](function(_0xd71e22){_0x446f12[_0xddf4('0x61')](_0xd71e22[_0xddf4('0x50')]({'plain':!![]}));});})[_0xddf4('0x2b')](function(){return _0x446f12;});});});}})[_0xddf4('0x2b')](function(_0x53619b){return _0x53619b;})[_0xddf4('0x2b')](respondWithResult(_0x1c480a,null))[_0xddf4('0x4a')](handleError(_0x1c480a,null));};exports[_0xddf4('0x62')]=function(_0x21efbe,_0x58dc5b){var _0x525548;return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x21efbe['params']['id']},'attributes':['id',_0xddf4('0x30')]})[_0xddf4('0x2b')](handleEntityNotFound(_0x58dc5b,null))[_0xddf4('0x2b')](function(_0x1b83ca){if(_0x1b83ca){_0x525548=_0x1b83ca;return db[_0xddf4('0x5d')]['destroy']({'where':{'userProfileId':_0x21efbe['params']['id'],'sectionId':_0x21efbe[_0xddf4('0x37')][_0xddf4('0x63')]}});}})['then'](function(){return _0x525548;})[_0xddf4('0x2b')](respondWithStatusCode(_0x58dc5b,null))[_0xddf4('0x4a')](handleError(_0x58dc5b,null));};exports['getSections']=function(_0x2572da,_0x536dc2){var _0x44d0b3=[];var _0x589ccc=[];return db[_0xddf4('0x5d')]['findAll']({'where':{'userProfileId':_0x2572da['params']['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x7cd11d){_0x44d0b3=_[_0xddf4('0x41')](_0x7cd11d,function(_0x49d894){return _0x49d894[_0xddf4('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x49d894[_0xddf4('0x5b')]);});if(!_['isEmpty'](_0x44d0b3)){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x4d5d0a){return _0x4d5d0a[_0xddf4('0x5b')];});}else{return;}})[_0xddf4('0x2b')](function(_0x5bffb4){if(_0x5bffb4)_0x589ccc=_0x5bffb4;if(_[_0xddf4('0x65')](_0x589ccc,0x64)){var _0x1b98d6=_['find'](_0x44d0b3,{'sectionId':0x64});return hasDefaultDashboard(_0x1b98d6)[_0xddf4('0x2b')](function(_0x2af3bd){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x31a74b){if(_0x31a74b[_0xddf4('0x5b')]===0x64){_0x31a74b[_0xddf4('0x66')]=_0x2af3bd;}return _0x31a74b;});});}else{return;}})['then'](function(_0x3f6d68){if(_0x3f6d68)_0x44d0b3=_0x3f6d68;if(_['includes'](_0x589ccc,0x3eb)){var _0x1f769a=_[_0xddf4('0x4e')](_0x44d0b3,{'sectionId':0x3eb});return getCustomDashboards(_0x1f769a)[_0xddf4('0x2b')](function(_0x4ffd49){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x3a5ea7){if(_0x1f769a[_0xddf4('0x64')]){if(_0x3a5ea7['sectionId']===0x3eb){_0x3a5ea7[_0xddf4('0x66')]=_0x4ffd49;}}else{if(_0x3a5ea7[_0xddf4('0x5b')]===0x64){_0x3a5ea7[_0xddf4('0x66')]=_0x4ffd49;}}return _0x3a5ea7;});});}else{return;}})[_0xddf4('0x2b')](function(_0x4d20fa){if(_0x4d20fa)_0x44d0b3=_0x4d20fa;if(_[_0xddf4('0x65')](_0x589ccc,0x709)){var _0x579f66=_[_0xddf4('0x4e')](_0x44d0b3,{'sectionId':0x709});return getPlugins(_0x579f66)[_0xddf4('0x2b')](function(_0xa771f4){if(_0x579f66[_0xddf4('0x64')]){return _['map'](_0x44d0b3,function(_0x436cee){if(_0x436cee['sectionId']===0x709){_0x436cee['subsections']=_0xa771f4;}return _0x436cee;});}else{var _0x453932={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa771f4};var _0x2c431c=_[_0xddf4('0x43')](_0x44d0b3);_0x2c431c[_0xddf4('0x61')](_0x453932);return _0x2c431c;}});}else{return;}})[_0xddf4('0x2b')](function(_0x46d3ec){if(_0x46d3ec)_0x44d0b3=_0x46d3ec;return _[_0xddf4('0x41')](_0x44d0b3,['enabled',0x1]);})[_0xddf4('0x2b')](respondWithResult(_0x536dc2,null))[_0xddf4('0x4a')](handleError(_0x536dc2,null));};function hasDefaultDashboard(_0x357d09){var _0xa687cb=[0x65];return new BPromise(function(_0x1b98be,_0x226dfa){try{if(_0x357d09['autoAssociation']){_0x1b98be(_0xa687cb);}else{return db[_0xddf4('0x5a')][_0xddf4('0x67')]({'where':{'sectionId':_0x357d09['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x57dbf2){_0x57dbf2?_0x1b98be(_0xa687cb):_0x1b98be();});}}catch(_0x162f99){_0x226dfa(_0x162f99);}});}function getCustomDashboards(_0x3414fe){var _0x1caf26=[];return new BPromise(function(_0xb4f02,_0x1d4e7b){try{if(_0x3414fe['autoAssociation']){return db[_0xddf4('0x68')][_0xddf4('0x48')]({'raw':!![]})[_0xddf4('0x2b')](function(_0x233e74){_0x233e74[_0xddf4('0x69')](function(_0x327a6a){_0x1caf26[_0xddf4('0x61')](_0x327a6a['id']+0x1869f);});_0xb4f02(_0x1caf26);});}else{return db['UserProfileResource'][_0xddf4('0x48')]({'where':{'sectionId':_0x3414fe['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0xbdd3f2){_0xbdd3f2[_0xddf4('0x69')](function(_0x29f726){_0x1caf26[_0xddf4('0x61')](_0x29f726[_0xddf4('0x6a')]+0x1869f);});_0xb4f02(_0x1caf26);});}}catch(_0x5a4fc9){_0x1d4e7b(_0x5a4fc9);}});}function getPlugins(_0x131ce4){var _0x1bd8fb=[];return new BPromise(function(_0xa0e1cf,_0x107c2f){try{if(_0x131ce4[_0xddf4('0x59')]){return db[_0xddf4('0x6b')][_0xddf4('0x48')]({'raw':!![]})[_0xddf4('0x2b')](function(_0x19c91b){_0x19c91b[_0xddf4('0x69')](function(_0xb9976c){_0x1bd8fb[_0xddf4('0x61')](_0xb9976c['id']+0x15b38);});_0xa0e1cf(_0x1bd8fb);});}else{return db[_0xddf4('0x5a')][_0xddf4('0x48')]({'where':{'sectionId':_0x131ce4['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x598bde){_0x598bde[_0xddf4('0x69')](function(_0x370ae5){_0x1bd8fb[_0xddf4('0x61')](_0x370ae5[_0xddf4('0x6a')]+0x15b38);});_0xa0e1cf(_0x1bd8fb);});}}catch(_0xd0ba87){_0x107c2f(_0xd0ba87);}});}exports['addResources']=function(_0x474a38,_0xa815b0){return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x474a38['params']['id']}})['then'](handleEntityNotFound(_0xa815b0,null))[_0xddf4('0x2b')](function(_0x2adfe5){if(_0x2adfe5){return db[_0xddf4('0x56')]['transaction'](function(_0x2ad6e5){return db['UserProfileSection'][_0xddf4('0x48')]({'where':{'userProfileId':_0x474a38['params']['id']},'attributes':['id'],'raw':!![]})[_0xddf4('0x2b')](function(_0xbd1c13){if(_0xbd1c13){return db[_0xddf4('0x5d')][_0xddf4('0x5f')]({'where':{'userProfileId':_0x474a38[_0xddf4('0x4b')]['id'],'id':_['map'](_0xbd1c13,function(_0x272f73){return _0x272f73['id'];})},'transaction':_0x2ad6e5});}})[_0xddf4('0x2b')](function(_0x2a1c01){var _0x168b08=_[_0xddf4('0x43')](_0x474a38['body'],function(_0x13045f){_0x13045f[_0xddf4('0x60')]=_0x474a38['params']['id'];return _0x13045f;});return db[_0xddf4('0x5d')][_0xddf4('0x6c')](_0x168b08,{'raw':!![],'transaction':_0x2ad6e5});})[_0xddf4('0x2b')](function(_0x1bd078){var _0x15c09b=_[_0xddf4('0x41')](_[_0xddf4('0x43')](_0x1bd078,function(_0xcf9229){return _0xcf9229['get']({'plain':!![]});}),{'includeAll':![]});if(_0x15c09b){return db[_0xddf4('0x5d')][_0xddf4('0x48')]({'where':{'userProfileId':_0x474a38['params']['id'],'sectionId':_[_0xddf4('0x43')](_0x15c09b,function(_0x4ff838){return _0x4ff838[_0xddf4('0x5b')];})},'attributes':['id',_0xddf4('0x5b')],'raw':!![]})[_0xddf4('0x2b')](function(_0x3481cc){var _0x73a093=_['map'](_0x474a38[_0xddf4('0x54')],function(_0x1c590b){_0x1c590b[_0xddf4('0x60')]=_0x474a38['params']['id'];return _0x1c590b;});return db['UserProfileResource'][_0xddf4('0x6c')](_0x73a093,{'raw':!![],'transaction':_0x2ad6e5});});}})[_0xddf4('0x4a')](handleError(_0xa815b0,null));});}})['then'](function(_0x29477f){var _0x37d6b5=_[_0xddf4('0x43')](_0x29477f,function(_0xadd6e8){return _0xadd6e8[_0xddf4('0x50')]({'plain':!![]});});})[_0xddf4('0x2b')](respondWithResult(_0xa815b0,null))[_0xddf4('0x4a')](handleError(_0xa815b0,null));};exports[_0xddf4('0x6d')]=function(_0x527217,_0x31ced0,_0x3b00e8){return db['UserProfile'][_0xddf4('0x4e')]({'where':{'id':_0x527217['params']['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x31ced0,null))[_0xddf4('0x2b')](function(_0x49d378){if(_0x49d378){return _0x49d378['removeResources'](_0x527217[_0xddf4('0x37')][_0xddf4('0x63')]);}})['then'](respondWithStatusCode(_0x31ced0,null))[_0xddf4('0x4a')](handleError(_0x31ced0,null));};exports['getResources']=function(_0x313052,_0x437188){var _0x135298={};if(!_0x313052[_0xddf4('0x37')][_0xddf4('0x6e')])throw new Error(_0xddf4('0x6f'));if(!_0x313052[_0xddf4('0x37')][_0xddf4('0x3c')](_0xddf4('0x3d'))){_0x135298['limit']=qs[_0xddf4('0x24')](_0x313052[_0xddf4('0x37')][_0xddf4('0x24')]);_0x135298['offset']=qs[_0xddf4('0x21')](_0x313052[_0xddf4('0x37')]['offset']);}return db[_0xddf4('0x32')]['find']({'where':{'id':_0x313052[_0xddf4('0x4b')]['id']}})['then'](function(_0x295783){if(!_0x295783)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x313052['params']['id']);return db[_0xddf4('0x32')][_0xddf4('0x70')](_0x313052);})[_0xddf4('0x2b')](respondWithFilteredResult(_0x437188,_0x135298))['catch'](handleError(_0x437188,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 34e3774..a53be0e 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 _0x4991=['emit','hasOwnProperty','hook','exports','events','UserProfile','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4991,0xf7));var _0x1499=function(_0x2aedf9,_0x599351){_0x2aedf9=_0x2aedf9-0x0;var _0x2b7d76=_0x4991[_0x2aedf9];return _0x2b7d76;};'use strict';var EventEmitter=require(_0x1499('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x1499('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1499('0x2'),'afterUpdate':_0x1499('0x3'),'afterDestroy':_0x1499('0x4')};function emitEvent(_0x47272e){return function(_0x1b291f,_0x158134,_0x19adff){UserProfileEvents[_0x1499('0x5')](_0x47272e+':'+_0x1b291f['id'],_0x1b291f);UserProfileEvents['emit'](_0x47272e,_0x1b291f);_0x19adff(null);};}for(var e in events){if(events[_0x1499('0x6')](e)){var event=events[e];UserProfile[_0x1499('0x7')](e,emitEvent(event));}}module[_0x1499('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x85de=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','hasOwnProperty'];(function(_0x28307e,_0x531964){var _0x15cea5=function(_0x27557a){while(--_0x27557a){_0x28307e['push'](_0x28307e['shift']());}};_0x15cea5(++_0x531964);}(_0x85de,0x65));var _0xe85d=function(_0x291b93,_0x44b715){_0x291b93=_0x291b93-0x0;var _0x4183c8=_0x85de[_0x291b93];return _0x4183c8;};'use strict';var EventEmitter=require(_0xe85d('0x0'));var UserProfile=require(_0xe85d('0x1'))['db'][_0xe85d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe85d('0x3')](0x0);var events={'afterCreate':_0xe85d('0x4'),'afterUpdate':_0xe85d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x244fdd){return function(_0x241b12,_0x2c4902,_0x5de80e){UserProfileEvents['emit'](_0x244fdd+':'+_0x241b12['id'],_0x241b12);UserProfileEvents['emit'](_0x244fdd,_0x241b12);_0x5de80e(null);};}for(var e in events){if(events[_0xe85d('0x6')](e)){var event=events[e];UserProfile[_0xe85d('0x7')](e,emitEvent(event));}}module[_0xe85d('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 2f94329..29df044 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 _0xac02=['FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','OpenTabs','UserProfile','user_profiles','query','raw','mergeResources','isEmpty','length','push','UserProfileSection','find','params','ignore','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','CustomReports','count','includeAll','color','tag','Tag','ThroughTags','rows','openTabs','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','exports','models','filter','value','findAll','then','associatedResources','map','catch','field','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','voicemails','Agents','membername','User','role','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailsubstatuses','openchannelqueues','openchannelaccounts','smsqueues','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','telephones','admin','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts'];(function(_0x40afc7,_0xa29f3){var _0x35a5d6=function(_0x90ffe3){while(--_0x90ffe3){_0x40afc7['push'](_0x40afc7['shift']());}};_0x35a5d6(++_0xa29f3);}(_0xac02,0x11d));var _0x2ac0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xac02[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var attributes=require(_0x2ac0('0x0'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x2ac0('0x1')]=function(_0x2260b3){var _0x457150=_0x2260b3[_0x2ac0('0x2')];function _0x188cf0(_0x45d7f1,_0x1b126d){return new Promise(function(_0x5a4bcb,_0x2fe8a5){if(!_0x1b126d)return _0x5a4bcb(null);var _0x3ef157=_0x1b126d[_0x2ac0('0x3')]?{[_0x1b126d[_0x2ac0('0x3')]['field']]:_0x1b126d[_0x2ac0('0x3')][_0x2ac0('0x4')]}:undefined;return _0x457150[_0x45d7f1][_0x2ac0('0x5')]({'where':_0x3ef157,'raw':!![]})[_0x2ac0('0x6')](function(_0x4b5279){_0x1b126d[_0x2ac0('0x7')]=_[_0x2ac0('0x8')](_0x4b5279,'id');_0x5a4bcb(_0x1b126d);})[_0x2ac0('0x9')](function(_0x1c82c1){_0x2fe8a5(_0x1c82c1);});});}function _0x3ca39b(_0x3642db,_0x4cefb9){return new Promise(function(_0x4786a8,_0x48438c){var _0x1a2e35=_0x3642db[_0x2ac0('0x3')]?{[_0x3642db['filter'][_0x2ac0('0xa')]]:_0x3642db[_0x2ac0('0x3')]['value']}:undefined;return _0x457150[_0x3642db[_0x2ac0('0xb')]][_0x2ac0('0x5')]({'where':_0x1a2e35,'raw':!![]})['then'](function(_0x4f0be0){_0x4cefb9[_0x2ac0('0x7')]=_['map'](_0x4f0be0,function(_0x549698){return _0x549698[_0x2ac0('0xc')];});_0x4786a8(_0x4cefb9);})[_0x2ac0('0x9')](function(_0x199a13){_0x48438c(_0x199a13);});});}function _0x501190(_0x20c319,_0x49d90f,_0x4a6f9a){if(!_0x49d90f)return Promise['resolve'](null);return new Promise(function(_0x50b5e4,_0x413d96){return _0x457150[_0x2ac0('0xd')][_0x2ac0('0x5')]({'where':{'sectionId':_0x49d90f['id']},'raw':!![]})['then'](function(_0x4c9816){if(_0x20c319[_0x2ac0('0xa')]&&_0x20c319[_0x2ac0('0xa')]!=='id'){_0x49d90f[_0x2ac0('0x7')]=_[_0x2ac0('0x8')](_0x4c9816,function(_0x27c175){return _0x27c175[_0x20c319[_0x2ac0('0xa')]];});}else{if(_0x4a6f9a===_0x2ac0('0xe')){_0x49d90f[_0x2ac0('0x7')]=_[_0x2ac0('0x8')](_0x4c9816,function(_0x1dd84b){return{'id':_0x1dd84b[_0x2ac0('0xf')],'type':_0x1dd84b[_0x2ac0('0x10')]};});}else{_0x49d90f[_0x2ac0('0x7')]=_[_0x2ac0('0x8')](_0x4c9816,function(_0x10d093){return _0x10d093[_0x2ac0('0xf')];});}}_0x50b5e4(_0x49d90f);})[_0x2ac0('0x9')](function(_0x3b9979){_0x413d96(_0x3b9979);});});}function _0x2c1cf3(_0x3880cc,_0x4cd98a){var _0x460add={'parentSections':[]};switch(_0x3880cc[_0x2ac0('0x11')]()){case _0x2ac0('0x12'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x14');break;case _0x2ac0('0x15'):_0x460add['childModel']=_0x2ac0('0x16');break;case _0x2ac0('0x17'):_0x460add[_0x2ac0('0x13')]='SquareRecording';_0x460add[_0x2ac0('0x18')]=[{'name':'SquareProjects','field':_0x2ac0('0xc'),'foreignKey':'projectName'}];break;case _0x2ac0('0x19'):_0x460add['childModel']=_0x2ac0('0x1a');break;case _0x2ac0('0x1b'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x1c');_0x460add['parentSections']=[{'name':_0x2ac0('0x1d'),'field':'id','foreignKey':_0x2ac0('0x1e')}];break;case _0x2ac0('0x1f'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x20');break;case _0x2ac0('0x21'):_0x460add[_0x2ac0('0x13')]='CmCompany';break;case _0x2ac0('0x22'):_0x460add['childModel']=_0x2ac0('0x23');break;case'chatqueues':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x24');break;case _0x2ac0('0x25'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x26');break;case _0x2ac0('0x27'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x28');break;case _0x2ac0('0x29'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x2a');break;case _0x2ac0('0x2b'):case'internalroutes':case'outboundroutes':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x2c');break;case _0x2ac0('0x2d'):_0x460add[_0x2ac0('0x13')]='VoiceContext';break;case _0x2ac0('0x2e'):_0x460add[_0x2ac0('0x13')]='VoiceMail';break;case'voicerecordings':_0x460add[_0x2ac0('0x13')]='VoiceRecording';_0x460add['parentSections']=[{'name':_0x2ac0('0x2f'),'field':_0x2ac0('0xc'),'foreignKey':_0x2ac0('0x30'),'model':_0x2ac0('0x31'),'filter':{'field':_0x2ac0('0x32'),'value':['agent']}},{'name':'Telephones','field':_0x2ac0('0xc'),'foreignKey':_0x2ac0('0x30'),'model':_0x2ac0('0x31'),'filter':{'field':_0x2ac0('0x32'),'value':['telephone']}},{'name':_0x2ac0('0x33'),'field':_0x2ac0('0xc'),'foreignKey':_0x2ac0('0x34'),'model':_0x2ac0('0x35'),'filter':{'field':_0x2ac0('0x10'),'value':[_0x2ac0('0x36')]}},{'name':_0x2ac0('0x37'),'field':'name','foreignKey':'queue','model':_0x2ac0('0x35'),'filter':{'field':_0x2ac0('0x10'),'value':[_0x2ac0('0x38')]}}];break;case _0x2ac0('0x39'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x3a');break;case'chanspies':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x3b');break;case'voiceprefixes':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x3c');break;case _0x2ac0('0x3d'):_0x460add[_0x2ac0('0x13')]='Campaign';break;case _0x2ac0('0x3e'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x3f');break;case'mailaccounts':_0x460add[_0x2ac0('0x13')]='MailAccount';break;case _0x2ac0('0x40'):_0x460add['childModel']='MailSubstatus';break;case _0x2ac0('0x41'):_0x460add[_0x2ac0('0x13')]='OpenchannelQueue';break;case _0x2ac0('0x42'):_0x460add[_0x2ac0('0x13')]='OpenchannelAccount';break;case _0x2ac0('0x43'):_0x460add[_0x2ac0('0x13')]='SmsQueue';break;case _0x2ac0('0x44'):_0x460add['childModel']='SmsAccount';break;case'whatsappqueues':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x45');break;case _0x2ac0('0x46'):_0x460add['childModel']=_0x2ac0('0x47');break;case _0x2ac0('0x48'):_0x460add['childModel']=_0x2ac0('0x49');break;case _0x2ac0('0x4a'):case'queuecampaigns':_0x460add['childModel']=_0x2ac0('0x35');if(_0x4cd98a){_0x460add[_0x2ac0('0x18')]=[{'name':'VoiceQueues'},{'name':_0x2ac0('0x37')}];}break;case _0x2ac0('0x4b'):case'agents':case _0x2ac0('0x4c'):_0x460add[_0x2ac0('0x13')]='User';if(_0x4cd98a){_0x460add[_0x2ac0('0x18')]=[{'name':'Users','filter':{'field':_0x2ac0('0x32'),'value':[_0x2ac0('0x4d'),'user']},'ignore':!![]},{'name':_0x2ac0('0x2f')},{'name':_0x2ac0('0x4e')}];}break;case _0x2ac0('0x4f'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x50');break;case'salesforceaccounts':_0x460add['childModel']=_0x2ac0('0x51');break;case _0x2ac0('0x52'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x53');break;case _0x2ac0('0x54'):_0x460add['childModel']=_0x2ac0('0x55');break;case _0x2ac0('0x56'):_0x460add['childModel']='DeskAccount';break;case _0x2ac0('0x57'):_0x460add['childModel']=_0x2ac0('0x58');break;case _0x2ac0('0x59'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x31');break;case _0x2ac0('0x5a'):_0x460add['childModel']=_0x2ac0('0x5b');break;case _0x2ac0('0x5c'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x5d');break;case _0x2ac0('0x5e'):_0x460add['childModel']=_0x2ac0('0x5f');break;case _0x2ac0('0x60'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x61');break;case _0x2ac0('0x62'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x63');break;case _0x2ac0('0x64'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x65');break;case _0x2ac0('0x66'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x67');break;case _0x2ac0('0x68'):_0x460add[_0x2ac0('0x13')]='Tag';break;case _0x2ac0('0x69'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x6a');break;case'triggers':_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x6b');break;case _0x2ac0('0x6c'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x6d');break;case _0x2ac0('0x6e'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x6f');break;case'plugins':_0x460add['childModel']=_0x2ac0('0x70');break;case _0x2ac0('0x71'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0xe');_0x460add['parentSections']=[{'name':_0x2ac0('0x72'),'field':'id','foreignKey':_0x2ac0('0x73')}];break;case _0x2ac0('0x74'):_0x460add[_0x2ac0('0x13')]=_0x2ac0('0x75');break;}return _0x460add;}function _0x9e30a1(_0x2b9572,_0x2cf419){var _0x475741=_0x2b9572[_0x2ac0('0x76')](0x0)[_0x2ac0('0x77')]()+_0x2b9572[_0x2ac0('0x78')](0x1);var _0x8bcdf6={'type':_0x457150[_0x2ac0('0x79')][_0x2ac0('0x7a')][_0x2ac0('0x7b')],'raw':!![]};return new Promise(function(_0x31905c,_0xf74c25){var _0x42b8b6=squel[_0x2ac0('0x7c')]()[_0x2ac0('0xa')]('ui.'+_0x475741+'InteractionId','id')['field'](_0x2ac0('0x7d'))[_0x2ac0('0x7e')](_0x2ac0('0x7f')+_0x2b9572+_0x2ac0('0x80'),'ui')[_0x2ac0('0x81')](_0x2ac0('0x82'),_0x2cf419['id']);return _0x457150[_0x2ac0('0x83')]['query'](_0x42b8b6['toString'](),_0x8bcdf6)[_0x2ac0('0x6')](function(_0x3ba77d){_0x2cf419[_0x475741+_0x2ac0('0x84')]=_0x3ba77d;_0x31905c(_0x3ba77d);})[_0x2ac0('0x9')](function(_0x544a04){_0xf74c25(_0x544a04);});});}return _0x2260b3['define'](_0x2ac0('0x85'),attributes,{'tableName':_0x2ac0('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x56503c){var _0x527946={'raw':_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x88')],'where':{}};var _0xde781c={};var _0x3db996={'count':0x0,'rows':[]};var _0x580324=_0x56503c['query']['section'];var _0x423232=_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x89')]||![];var _0x5a3241=_0x2c1cf3(_0x580324,_0x423232);if(!_0x5a3241[_0x2ac0('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x580324+'\x27');var _0x5e75b2=[{'name':_0x580324}];if(!_[_0x2ac0('0x8a')](_0x5a3241[_0x2ac0('0x18')]))_0x5e75b2=_0x5a3241['parentSections'];var _0x416f9f=[];for(var _0x1cfac2=0x0;_0x1cfac2<_0x5e75b2[_0x2ac0('0x8b')];_0x1cfac2++){_0x416f9f[_0x2ac0('0x8c')](_0x457150[_0x2ac0('0x8d')][_0x2ac0('0x8e')]({'where':{'userProfileId':_0x56503c[_0x2ac0('0x8f')]['id'],'name':_0x5e75b2[_0x1cfac2][_0x2ac0('0xc')]},'raw':!![]}));}return Promise['all'](_0x416f9f)[_0x2ac0('0x6')](function(_0x44ed44){var _0x559eb0=_[_0x2ac0('0x3')](_0x44ed44,function(_0x510a5f){return _0x510a5f?_0x510a5f:undefined;});var _0x520444=_[_0x2ac0('0x3')](_0x5e75b2,[_0x2ac0('0x90'),!![]]);var _0x4c4ddc=_[_0x2ac0('0x8a')](_0x559eb0)&&_[_0x2ac0('0x8a')](_0x520444)?null:_['union'](_0x520444,_0x559eb0);if(!_0x4c4ddc)return null;var _0x149025=[];for(var _0x45ed62=0x0;_0x45ed62<_0x4c4ddc[_0x2ac0('0x8b')];_0x45ed62++){var _0x2edc08=_[_0x2ac0('0x8e')](_0x5e75b2,function(_0x193a7e){return _0x4c4ddc[_0x45ed62]?_0x193a7e[_0x2ac0('0xc')]===_0x4c4ddc[_0x45ed62][_0x2ac0('0xc')]:null;});if(_0x2edc08){if(_0x4c4ddc[_0x45ed62]['ignore']){_0x149025[_0x2ac0('0x8c')](_0x188cf0(_0x5a3241[_0x2ac0('0x13')],_0x4c4ddc[_0x45ed62]));}else{if(!_0x4c4ddc[_0x45ed62][_0x2ac0('0x91')]){_0x149025[_0x2ac0('0x8c')](_0x501190(_0x2edc08,_0x4c4ddc[_0x45ed62],_0x5a3241[_0x2ac0('0x13')]));}else{if(_0x2edc08[_0x2ac0('0xb')]){_0x149025['push'](_0x3ca39b(_0x2edc08,_0x4c4ddc[_0x45ed62]));}}}}}return Promise[_0x2ac0('0x92')](_0x149025);})[_0x2ac0('0x6')](function(_0x3fb1fb){var _0x5b80b0=_0x3fb1fb;var _0x156559=null;if(_0x5b80b0){_0x156559=_0x5b80b0[_0x2ac0('0x8b')]===0x1?_0x5b80b0[0x0]:null;}if(!_0x156559&&!_0x5b80b0)return _0x3db996;var _0x44c09b=_0x457150[_0x5a3241['childModel']][_0x2ac0('0x93')];_0xde781c[_0x2ac0('0xb')]=_[_0x2ac0('0x94')](_0x44c09b);_0xde781c[_0x2ac0('0x87')]=_['keys'](_0x56503c[_0x2ac0('0x87')]);_0xde781c[_0x2ac0('0x95')]=_[_0x2ac0('0x96')](_0xde781c[_0x2ac0('0xb')],_0xde781c['query']);_0x527946[_0x2ac0('0x97')]=_[_0x2ac0('0x96')](_0xde781c[_0x2ac0('0xb')],qs[_0x2ac0('0x98')](_0x56503c['query'][_0x2ac0('0x98')]));_0x527946[_0x2ac0('0x97')]=_0x527946[_0x2ac0('0x97')]['length']?_0x527946[_0x2ac0('0x97')]:_0xde781c[_0x2ac0('0xb')];if(!_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x99')]('nolimit')){_0x527946[_0x2ac0('0x9a')]=qs[_0x2ac0('0x9a')](_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x9a')]);_0x527946[_0x2ac0('0x9b')]=qs['offset'](_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x9b')]);}_0x527946[_0x2ac0('0x9c')]=qs[_0x2ac0('0x9d')](_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x9d')]);_0x527946[_0x2ac0('0x81')]=qs[_0x2ac0('0x95')](_[_0x2ac0('0x9e')](_0x56503c[_0x2ac0('0x87')],_0xde781c[_0x2ac0('0x95')]));if(_0x56503c[_0x2ac0('0x87')][_0x2ac0('0x3')]){_0x527946[_0x2ac0('0x81')]=_[_0x2ac0('0x9f')](_0x527946[_0x2ac0('0x81')],{'$or':_[_0x2ac0('0x8')](_0x44c09b,function(_0x52e2e1){if(_0x52e2e1[_0x2ac0('0x10')][_0x2ac0('0xa0')]!=='VIRTUAL'){var _0x398a53={};_0x398a53[_0x52e2e1[_0x2ac0('0xa')]]={'$like':'%'+_0x56503c['query']['filter']+'%'};return _0x398a53;}})});}var _0x248889=[];var _0x2c6661=null;var _0x5de6ec={};if(_0x156559){_0x2c6661=_[_0x2ac0('0x8e')](_0x5e75b2,['name',_0x156559['name']]);if(_0x2c6661[_0x2ac0('0xa')]){_0x5de6ec={};if(_0x5a3241[_0x2ac0('0x13')]===_0x2ac0('0xe')){_0x5de6ec[_0x2c6661[_0x2ac0('0xa1')]]=_['map'](_0x156559[_0x2ac0('0x7')],'id');}else{_0x5de6ec[_0x2c6661['foreignKey']]=_0x156559[_0x2ac0('0x7')];}_0x248889[_0x2ac0('0x8c')](_0x5de6ec);}else{_0x527946[_0x2ac0('0x81')]['id']=_0x156559[_0x2ac0('0x7')];}}else{for(var _0xa90fde=0x0;_0xa90fde<_0x5b80b0[_0x2ac0('0x8b')];_0xa90fde++){_0x2c6661=_[_0x2ac0('0x8e')](_0x5e75b2,['name',_0x5b80b0[_0xa90fde][_0x2ac0('0xc')]]);if(_0x2c6661['field']){_0x5de6ec={};_0x5de6ec[_0x2c6661[_0x2ac0('0xa1')]]=_0x5b80b0[_0xa90fde][_0x2ac0('0x7')];_0x248889[_0x2ac0('0x8c')](_0x5de6ec);}else{if(!_0x527946[_0x2ac0('0x81')]['id'])_0x527946['where']['id']=[];_0x5b80b0[_0xa90fde][_0x2ac0('0x7')][_0x2ac0('0xa2')](function(_0x9b80db){_0x527946[_0x2ac0('0x81')]['id'][_0x2ac0('0x8c')](_0x9b80db);});}}}if(!_[_0x2ac0('0x8a')](_0x248889)){_0x527946[_0x2ac0('0x81')]=_[_0x2ac0('0x9f')](_0x527946[_0x2ac0('0x81')],{'$and':{'$or':_0x248889}});}_0x527946=_[_0x2ac0('0x9f')]({},_0x527946,_0x56503c[_0x2ac0('0xa3')]);if(_0x156559&&!_0x156559[_0x2ac0('0x91')]&&_0x5a3241[_0x2ac0('0x13')]===_0x2ac0('0xe')){if(_0x56503c[_0x2ac0('0x87')]['includeAll']){_0x527946[_0x2ac0('0xa4')]=[{'all':!![]}];}return _0x457150[_0x5a3241['childModel']][_0x2ac0('0x5')](_0x527946)[_0x2ac0('0x6')](function(_0x4c456c){var _0x4ddef9=[];_0x4c456c['forEach'](function(_0x2e19b4){var _0x1e3a01;switch(_0x2e19b4[_0x2ac0('0xa5')]){case _0x2ac0('0xa6'):_0x1e3a01=_[_0x2ac0('0x8e')](_0x156559[_0x2ac0('0x7')],function(_0xc2d6e7){return _0xc2d6e7['id']===_0x2e19b4['reportId']&&_0xc2d6e7['type']===_0x2ac0('0xa7');});break;case _0x2ac0('0xa8'):_0x1e3a01=_['find'](_0x156559[_0x2ac0('0x7')],function(_0x590d56){return _0x590d56['id']===_0x2e19b4[_0x2ac0('0x73')]&&_0x590d56['type']===_0x2ac0('0xa9');});break;}if(_0x1e3a01)_0x4ddef9[_0x2ac0('0x8c')](_0x2e19b4);});_0x3db996['count']=_0x4ddef9[_0x2ac0('0x8b')];_0x3db996['rows']=_0x4ddef9;return _0x3db996;});}else{return _0x457150[_0x5a3241['childModel']][_0x2ac0('0xaa')]({'where':_0x527946[_0x2ac0('0x81')]})[_0x2ac0('0x6')](function(_0x56a3b4){_0x3db996['count']=_0x56a3b4;if(_0x56503c[_0x2ac0('0x87')][_0x2ac0('0xab')]){if(_0x5a3241[_0x2ac0('0x13')]==='CmContact'){_0x527946[_0x2ac0('0xa4')]=[{'model':_0x457150['Tag'],'as':'Tags','attributes':['id',_0x2ac0('0xc'),_0x2ac0('0xac')],'required':_0x56503c[_0x2ac0('0x87')][_0x2ac0('0xad')]?!![]:![]},{'model':_0x457150[_0x2ac0('0xae')],'as':_0x2ac0('0xaf'),'attributes':['id','name',_0x2ac0('0xac')],'through':_0x56503c[_0x2ac0('0x87')][_0x2ac0('0xad')]?{'attributes':[],'where':{'TagId':_0x56503c['query'][_0x2ac0('0xad')]||undefined}}:{},'required':_0x56503c['query']['tag']?!![]:![]}];}else{_0x527946[_0x2ac0('0xa4')]=[{'all':!![]}];}}return _0x457150[_0x5a3241['childModel']][_0x2ac0('0x5')](_0x527946);})[_0x2ac0('0x6')](function(_0x4728b1){_0x3db996[_0x2ac0('0xb0')]=_0x4728b1;if(_0x580324===_0x2ac0('0x2f')&&_0x56503c['query'][_0x2ac0('0xb1')]==='true'){var _0x3c17e2=[];for(var _0x170498=0x0;_0x170498<_0x3db996['rows']['length'];_0x170498++){_0x3c17e2['push'](_0x9e30a1('chat',_0x3db996[_0x2ac0('0xb0')][_0x170498][_0x2ac0('0xb2')]));_0x3c17e2[_0x2ac0('0x8c')](_0x9e30a1(_0x2ac0('0xb3'),_0x3db996['rows'][_0x170498]['dataValues']));_0x3c17e2['push'](_0x9e30a1(_0x2ac0('0xb4'),_0x3db996['rows'][_0x170498][_0x2ac0('0xb2')]));_0x3c17e2[_0x2ac0('0x8c')](_0x9e30a1(_0x2ac0('0xb5'),_0x3db996[_0x2ac0('0xb0')][_0x170498]['dataValues']));_0x3c17e2['push'](_0x9e30a1(_0x2ac0('0xb6'),_0x3db996[_0x2ac0('0xb0')][_0x170498][_0x2ac0('0xb2')]));_0x3c17e2['push'](_0x9e30a1(_0x2ac0('0xb7'),_0x3db996[_0x2ac0('0xb0')][_0x170498][_0x2ac0('0xb2')]));}return Promise[_0x2ac0('0x92')](_0x3c17e2)[_0x2ac0('0x6')](function(){return _0x3db996;});}return _0x3db996;});}});}}});}; \ No newline at end of file +var _0xae00=['outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','role','agent','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','tags','Tag','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','reportId','AnalyticMetric','charAt','Sequelize','QueryTypes','ui.','InteractionId','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','all','isEmpty','union','ignore','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','filters','pick','key','VIRTUAL','foreignKey','merge','options','forEach','reportType','DefaultReports','custom','CustomReports','count','rows','includeAll','include','Tags','tag','ThroughTags','color','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','UserProfileResource','resourceId','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes'];(function(_0x477aab,_0x4d08fd){var _0x2cd294=function(_0x4e0c85){while(--_0x4e0c85){_0x477aab['push'](_0x477aab['shift']());}};_0x2cd294(++_0x4d08fd);}(_0xae00,0x143));var _0x0ae0=function(_0x68a0b0,_0x2bba91){_0x68a0b0=_0x68a0b0-0x0;var _0x4b4ee6=_0xae00[_0x68a0b0];return _0x4b4ee6;};'use strict';var _=require(_0x0ae0('0x0'));var attributes=require(_0x0ae0('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x0ae0('0x2'));module['exports']=function(_0x5b3dde){var _0x4a5bd5=_0x5b3dde[_0x0ae0('0x3')];function _0x342506(_0x538fbf,_0x43e664){return new Promise(function(_0x35cc94,_0x2b1360){if(!_0x43e664)return _0x35cc94(null);var _0x3a5c5b=_0x43e664[_0x0ae0('0x4')]?{[_0x43e664[_0x0ae0('0x4')][_0x0ae0('0x5')]]:_0x43e664[_0x0ae0('0x4')][_0x0ae0('0x6')]}:undefined;return _0x4a5bd5[_0x538fbf][_0x0ae0('0x7')]({'where':_0x3a5c5b,'raw':!![]})[_0x0ae0('0x8')](function(_0x3fd245){_0x43e664[_0x0ae0('0x9')]=_['map'](_0x3fd245,'id');_0x35cc94(_0x43e664);})[_0x0ae0('0xa')](function(_0x49fbb2){_0x2b1360(_0x49fbb2);});});}function _0x51875e(_0x93058f,_0x3519d6){return new Promise(function(_0x3910e1,_0x870efa){var _0x4e3c80=_0x93058f['filter']?{[_0x93058f[_0x0ae0('0x4')]['field']]:_0x93058f[_0x0ae0('0x4')][_0x0ae0('0x6')]}:undefined;return _0x4a5bd5[_0x93058f[_0x0ae0('0xb')]][_0x0ae0('0x7')]({'where':_0x4e3c80,'raw':!![]})['then'](function(_0x2f51cd){_0x3519d6[_0x0ae0('0x9')]=_[_0x0ae0('0xc')](_0x2f51cd,function(_0x58bedf){return _0x58bedf[_0x0ae0('0xd')];});_0x3910e1(_0x3519d6);})[_0x0ae0('0xa')](function(_0x5b0239){_0x870efa(_0x5b0239);});});}function _0x230bbe(_0x4556f8,_0x1ccdf7,_0x415330){if(!_0x1ccdf7)return Promise[_0x0ae0('0xe')](null);return new Promise(function(_0x4dcddc,_0x212f3b){return _0x4a5bd5[_0x0ae0('0xf')][_0x0ae0('0x7')]({'where':{'sectionId':_0x1ccdf7['id']},'raw':!![]})[_0x0ae0('0x8')](function(_0x180de0){if(_0x4556f8['field']&&_0x4556f8['field']!=='id'){_0x1ccdf7[_0x0ae0('0x9')]=_['map'](_0x180de0,function(_0x5263f8){return _0x5263f8[_0x4556f8[_0x0ae0('0x5')]];});}else{if(_0x415330==='AnalyticExtractedReport'){_0x1ccdf7[_0x0ae0('0x9')]=_[_0x0ae0('0xc')](_0x180de0,function(_0x25b4cf){return{'id':_0x25b4cf[_0x0ae0('0x10')],'type':_0x25b4cf[_0x0ae0('0x11')]};});}else{_0x1ccdf7['associatedResources']=_[_0x0ae0('0xc')](_0x180de0,function(_0x4a31c9){return _0x4a31c9[_0x0ae0('0x10')];});}}_0x4dcddc(_0x1ccdf7);})[_0x0ae0('0xa')](function(_0x2ed321){_0x212f3b(_0x2ed321);});});}function _0x2cde88(_0x368929,_0x3c6c14){var _0x411603={'parentSections':[]};switch(_0x368929['toLowerCase']()){case'squareprojects':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x13');break;case _0x0ae0('0x14'):_0x411603['childModel']=_0x0ae0('0x15');break;case _0x0ae0('0x16'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x17');_0x411603[_0x0ae0('0x18')]=[{'name':_0x0ae0('0x19'),'field':'name','foreignKey':_0x0ae0('0x1a')}];break;case _0x0ae0('0x1b'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x1c');break;case'contacts':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x1d');_0x411603[_0x0ae0('0x18')]=[{'name':_0x0ae0('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x0ae0('0x1f'):_0x411603['childModel']=_0x0ae0('0x20');break;case _0x0ae0('0x21'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x22');break;case'globalcustomfields':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x23');break;case _0x0ae0('0x24'):_0x411603[_0x0ae0('0x12')]='ChatQueue';break;case'chatwebsites':_0x411603['childModel']=_0x0ae0('0x25');break;case _0x0ae0('0x26'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x27');break;case _0x0ae0('0x28'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x29');break;case'inboundroutes':case _0x0ae0('0x2a'):case _0x0ae0('0x2b'):_0x411603[_0x0ae0('0x12')]='VoiceExtension';break;case _0x0ae0('0x2c'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x2d');break;case _0x0ae0('0x2e'):_0x411603['childModel']='VoiceMail';break;case _0x0ae0('0x2f'):_0x411603['childModel']=_0x0ae0('0x30');_0x411603[_0x0ae0('0x18')]=[{'name':_0x0ae0('0x31'),'field':_0x0ae0('0xd'),'foreignKey':'membername','model':_0x0ae0('0x32'),'filter':{'field':_0x0ae0('0x33'),'value':[_0x0ae0('0x34')]}},{'name':'Telephones','field':_0x0ae0('0xd'),'foreignKey':'membername','model':_0x0ae0('0x32'),'filter':{'field':_0x0ae0('0x33'),'value':['telephone']}},{'name':_0x0ae0('0x35'),'field':_0x0ae0('0xd'),'foreignKey':_0x0ae0('0x36'),'model':_0x0ae0('0x37'),'filter':{'field':_0x0ae0('0x11'),'value':[_0x0ae0('0x38')]}},{'name':_0x0ae0('0x39'),'field':_0x0ae0('0xd'),'foreignKey':'queue','model':_0x0ae0('0x37'),'filter':{'field':_0x0ae0('0x11'),'value':[_0x0ae0('0x3a')]}}];break;case'musiconholds':_0x411603['childModel']='VoiceMusicOnHold';break;case'chanspies':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x3b');break;case'voiceprefixes':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x3c');break;case _0x0ae0('0x3d'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x3e');break;case _0x0ae0('0x3f'):_0x411603['childModel']=_0x0ae0('0x40');break;case'mailaccounts':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x41');break;case _0x0ae0('0x42'):_0x411603['childModel']=_0x0ae0('0x43');break;case'openchannelqueues':_0x411603[_0x0ae0('0x12')]='OpenchannelQueue';break;case'openchannelaccounts':_0x411603['childModel']=_0x0ae0('0x44');break;case _0x0ae0('0x45'):_0x411603['childModel']='SmsQueue';break;case _0x0ae0('0x46'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x47');break;case _0x0ae0('0x48'):_0x411603[_0x0ae0('0x12')]='WhatsappQueue';break;case _0x0ae0('0x49'):_0x411603[_0x0ae0('0x12')]='WhatsappAccount';break;case _0x0ae0('0x4a'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x4b');break;case _0x0ae0('0x4c'):case _0x0ae0('0x4d'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x37');if(_0x3c6c14){_0x411603[_0x0ae0('0x18')]=[{'name':_0x0ae0('0x35')},{'name':_0x0ae0('0x39')}];}break;case _0x0ae0('0x4e'):case _0x0ae0('0x4f'):case'telephones':_0x411603['childModel']='User';if(_0x3c6c14){_0x411603[_0x0ae0('0x18')]=[{'name':_0x0ae0('0x50'),'filter':{'field':_0x0ae0('0x33'),'value':[_0x0ae0('0x51'),_0x0ae0('0x52')]},'ignore':!![]},{'name':'Agents'},{'name':_0x0ae0('0x53')}];}break;case _0x0ae0('0x54'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x55');break;case _0x0ae0('0x56'):_0x411603['childModel']=_0x0ae0('0x57');break;case _0x0ae0('0x58'):_0x411603['childModel']=_0x0ae0('0x59');break;case _0x0ae0('0x5a'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x5b');break;case'deskaccounts':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x5c');break;case _0x0ae0('0x5d'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x5e');break;case _0x0ae0('0x5f'):_0x411603[_0x0ae0('0x12')]='User';break;case _0x0ae0('0x60'):_0x411603['childModel']=_0x0ae0('0x61');break;case _0x0ae0('0x62'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x63');break;case _0x0ae0('0x64'):_0x411603['childModel']=_0x0ae0('0x65');break;case _0x0ae0('0x66'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x67');break;case _0x0ae0('0x68'):_0x411603['childModel']=_0x0ae0('0x69');break;case'scheduler':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x6a');break;case'sounds':_0x411603[_0x0ae0('0x12')]='Sound';break;case _0x0ae0('0x6b'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x6c');break;case'templates':_0x411603['childModel']=_0x0ae0('0x6d');break;case _0x0ae0('0x6e'):_0x411603[_0x0ae0('0x12')]='Trigger';break;case _0x0ae0('0x6f'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x70');break;case _0x0ae0('0x71'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x72');break;case _0x0ae0('0x73'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x74');break;case _0x0ae0('0x75'):_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x76');_0x411603['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x0ae0('0x77')}];break;case'metrics':_0x411603[_0x0ae0('0x12')]=_0x0ae0('0x78');break;}return _0x411603;}function _0x308e81(_0x172a51,_0x240a5d){var _0x7767c6=_0x172a51[_0x0ae0('0x79')](0x0)['toUpperCase']()+_0x172a51['slice'](0x1);var _0x23e4cf={'type':_0x4a5bd5[_0x0ae0('0x7a')][_0x0ae0('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x5708d2,_0x34e632){var _0x1c629f=squel['select']()[_0x0ae0('0x5')](_0x0ae0('0x7c')+_0x7767c6+_0x0ae0('0x7d'),'id')[_0x0ae0('0x5')]('ui.createdAt')['from'](_0x0ae0('0x7e')+_0x172a51+'_interactions','ui')[_0x0ae0('0x7f')](_0x0ae0('0x80'),_0x240a5d['id']);return _0x4a5bd5['sequelize'][_0x0ae0('0x81')](_0x1c629f[_0x0ae0('0x82')](),_0x23e4cf)[_0x0ae0('0x8')](function(_0x4ab64c){_0x240a5d[_0x7767c6+_0x0ae0('0x83')]=_0x4ab64c;_0x5708d2(_0x4ab64c);})[_0x0ae0('0xa')](function(_0x3daa51){_0x34e632(_0x3daa51);});});}return _0x5b3dde[_0x0ae0('0x84')](_0x0ae0('0x85'),attributes,{'tableName':_0x0ae0('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x537417){var _0x35f8e9={'raw':_0x537417[_0x0ae0('0x81')][_0x0ae0('0x87')],'where':{}};var _0x3b951e={};var _0x2a2a94={'count':0x0,'rows':[]};var _0x210aa9=_0x537417['query']['section'];var _0x552eb0=_0x537417[_0x0ae0('0x81')][_0x0ae0('0x88')]||![];var _0x5b6082=_0x2cde88(_0x210aa9,_0x552eb0);if(!_0x5b6082['childModel'])throw new Error(_0x0ae0('0x89')+_0x210aa9+'\x27');var _0x2fae62=[{'name':_0x210aa9}];if(!_['isEmpty'](_0x5b6082['parentSections']))_0x2fae62=_0x5b6082[_0x0ae0('0x18')];var _0x8eaa1=[];for(var _0x1268b4=0x0;_0x1268b4<_0x2fae62[_0x0ae0('0x8a')];_0x1268b4++){_0x8eaa1[_0x0ae0('0x8b')](_0x4a5bd5[_0x0ae0('0x8c')][_0x0ae0('0x8d')]({'where':{'userProfileId':_0x537417['params']['id'],'name':_0x2fae62[_0x1268b4]['name']},'raw':!![]}));}return Promise[_0x0ae0('0x8e')](_0x8eaa1)[_0x0ae0('0x8')](function(_0x3abc3a){var _0x274ffd=_[_0x0ae0('0x4')](_0x3abc3a,function(_0x462834){return _0x462834?_0x462834:undefined;});var _0x1df4b1=_[_0x0ae0('0x4')](_0x2fae62,['ignore',!![]]);var _0x5d41ac=_[_0x0ae0('0x8f')](_0x274ffd)&&_[_0x0ae0('0x8f')](_0x1df4b1)?null:_[_0x0ae0('0x90')](_0x1df4b1,_0x274ffd);if(!_0x5d41ac)return null;var _0x1369b4=[];for(var _0x32768e=0x0;_0x32768e<_0x5d41ac[_0x0ae0('0x8a')];_0x32768e++){var _0x1e8a52=_[_0x0ae0('0x8d')](_0x2fae62,function(_0x20cdc9){return _0x5d41ac[_0x32768e]?_0x20cdc9['name']===_0x5d41ac[_0x32768e]['name']:null;});if(_0x1e8a52){if(_0x5d41ac[_0x32768e][_0x0ae0('0x91')]){_0x1369b4[_0x0ae0('0x8b')](_0x342506(_0x5b6082['childModel'],_0x5d41ac[_0x32768e]));}else{if(!_0x5d41ac[_0x32768e]['autoAssociation']){_0x1369b4['push'](_0x230bbe(_0x1e8a52,_0x5d41ac[_0x32768e],_0x5b6082[_0x0ae0('0x12')]));}else{if(_0x1e8a52[_0x0ae0('0xb')]){_0x1369b4[_0x0ae0('0x8b')](_0x51875e(_0x1e8a52,_0x5d41ac[_0x32768e]));}}}}}return Promise[_0x0ae0('0x8e')](_0x1369b4);})[_0x0ae0('0x8')](function(_0xdd507b){var _0xf851a8=_0xdd507b;var _0x27bcc2=null;if(_0xf851a8){_0x27bcc2=_0xf851a8[_0x0ae0('0x8a')]===0x1?_0xf851a8[0x0]:null;}if(!_0x27bcc2&&!_0xf851a8)return _0x2a2a94;var _0x2bb3f2=_0x4a5bd5[_0x5b6082[_0x0ae0('0x12')]]['rawAttributes'];_0x3b951e[_0x0ae0('0xb')]=_[_0x0ae0('0x92')](_0x2bb3f2);_0x3b951e[_0x0ae0('0x81')]=_[_0x0ae0('0x92')](_0x537417['query']);_0x3b951e['filters']=_[_0x0ae0('0x93')](_0x3b951e[_0x0ae0('0xb')],_0x3b951e[_0x0ae0('0x81')]);_0x35f8e9[_0x0ae0('0x94')]=_[_0x0ae0('0x93')](_0x3b951e[_0x0ae0('0xb')],qs[_0x0ae0('0x95')](_0x537417[_0x0ae0('0x81')][_0x0ae0('0x95')]));_0x35f8e9[_0x0ae0('0x94')]=_0x35f8e9[_0x0ae0('0x94')]['length']?_0x35f8e9[_0x0ae0('0x94')]:_0x3b951e[_0x0ae0('0xb')];if(!_0x537417[_0x0ae0('0x81')][_0x0ae0('0x96')](_0x0ae0('0x97'))){_0x35f8e9['limit']=qs[_0x0ae0('0x98')](_0x537417['query'][_0x0ae0('0x98')]);_0x35f8e9[_0x0ae0('0x99')]=qs[_0x0ae0('0x99')](_0x537417[_0x0ae0('0x81')][_0x0ae0('0x99')]);}_0x35f8e9['order']=qs[_0x0ae0('0x9a')](_0x537417[_0x0ae0('0x81')][_0x0ae0('0x9a')]);_0x35f8e9[_0x0ae0('0x7f')]=qs[_0x0ae0('0x9b')](_[_0x0ae0('0x9c')](_0x537417['query'],_0x3b951e[_0x0ae0('0x9b')]));if(_0x537417[_0x0ae0('0x81')]['filter']){_0x35f8e9[_0x0ae0('0x7f')]=_['merge'](_0x35f8e9[_0x0ae0('0x7f')],{'$or':_[_0x0ae0('0xc')](_0x2bb3f2,function(_0x9b9aa4){if(_0x9b9aa4[_0x0ae0('0x11')][_0x0ae0('0x9d')]!==_0x0ae0('0x9e')){var _0x1317ed={};_0x1317ed[_0x9b9aa4[_0x0ae0('0x5')]]={'$like':'%'+_0x537417[_0x0ae0('0x81')][_0x0ae0('0x4')]+'%'};return _0x1317ed;}})});}var _0x42c428=[];var _0x420aab=null;var _0x229143={};if(_0x27bcc2){_0x420aab=_[_0x0ae0('0x8d')](_0x2fae62,[_0x0ae0('0xd'),_0x27bcc2[_0x0ae0('0xd')]]);if(_0x420aab[_0x0ae0('0x5')]){_0x229143={};if(_0x5b6082['childModel']===_0x0ae0('0x76')){_0x229143[_0x420aab[_0x0ae0('0x9f')]]=_[_0x0ae0('0xc')](_0x27bcc2[_0x0ae0('0x9')],'id');}else{_0x229143[_0x420aab[_0x0ae0('0x9f')]]=_0x27bcc2[_0x0ae0('0x9')];}_0x42c428['push'](_0x229143);}else{_0x35f8e9[_0x0ae0('0x7f')]['id']=_0x27bcc2['associatedResources'];}}else{for(var _0x3e5039=0x0;_0x3e5039<_0xf851a8['length'];_0x3e5039++){_0x420aab=_[_0x0ae0('0x8d')](_0x2fae62,[_0x0ae0('0xd'),_0xf851a8[_0x3e5039][_0x0ae0('0xd')]]);if(_0x420aab['field']){_0x229143={};_0x229143[_0x420aab[_0x0ae0('0x9f')]]=_0xf851a8[_0x3e5039][_0x0ae0('0x9')];_0x42c428[_0x0ae0('0x8b')](_0x229143);}else{if(!_0x35f8e9[_0x0ae0('0x7f')]['id'])_0x35f8e9[_0x0ae0('0x7f')]['id']=[];_0xf851a8[_0x3e5039][_0x0ae0('0x9')]['forEach'](function(_0x406d97){_0x35f8e9['where']['id'][_0x0ae0('0x8b')](_0x406d97);});}}}if(!_[_0x0ae0('0x8f')](_0x42c428)){_0x35f8e9[_0x0ae0('0x7f')]=_[_0x0ae0('0xa0')](_0x35f8e9[_0x0ae0('0x7f')],{'$and':{'$or':_0x42c428}});}_0x35f8e9=_['merge']({},_0x35f8e9,_0x537417[_0x0ae0('0xa1')]);if(_0x27bcc2&&!_0x27bcc2['autoAssociation']&&_0x5b6082[_0x0ae0('0x12')]==='AnalyticExtractedReport'){if(_0x537417[_0x0ae0('0x81')]['includeAll']){_0x35f8e9['include']=[{'all':!![]}];}return _0x4a5bd5[_0x5b6082[_0x0ae0('0x12')]][_0x0ae0('0x7')](_0x35f8e9)['then'](function(_0x287cfb){var _0x2af5cb=[];_0x287cfb[_0x0ae0('0xa2')](function(_0x39bb41){var _0x56f7a5;switch(_0x39bb41[_0x0ae0('0xa3')]){case'default':_0x56f7a5=_[_0x0ae0('0x8d')](_0x27bcc2[_0x0ae0('0x9')],function(_0x4b69a3){return _0x4b69a3['id']===_0x39bb41['reportId']&&_0x4b69a3[_0x0ae0('0x11')]===_0x0ae0('0xa4');});break;case _0x0ae0('0xa5'):_0x56f7a5=_[_0x0ae0('0x8d')](_0x27bcc2[_0x0ae0('0x9')],function(_0x34206f){return _0x34206f['id']===_0x39bb41[_0x0ae0('0x77')]&&_0x34206f[_0x0ae0('0x11')]===_0x0ae0('0xa6');});break;}if(_0x56f7a5)_0x2af5cb[_0x0ae0('0x8b')](_0x39bb41);});_0x2a2a94[_0x0ae0('0xa7')]=_0x2af5cb[_0x0ae0('0x8a')];_0x2a2a94[_0x0ae0('0xa8')]=_0x2af5cb;return _0x2a2a94;});}else{return _0x4a5bd5[_0x5b6082[_0x0ae0('0x12')]][_0x0ae0('0xa7')]({'where':_0x35f8e9[_0x0ae0('0x7f')]})[_0x0ae0('0x8')](function(_0x42d532){_0x2a2a94[_0x0ae0('0xa7')]=_0x42d532;if(_0x537417[_0x0ae0('0x81')][_0x0ae0('0xa9')]){if(_0x5b6082[_0x0ae0('0x12')]==='CmContact'){_0x35f8e9[_0x0ae0('0xaa')]=[{'model':_0x4a5bd5['Tag'],'as':_0x0ae0('0xab'),'attributes':['id','name','color'],'required':_0x537417[_0x0ae0('0x81')][_0x0ae0('0xac')]?!![]:![]},{'model':_0x4a5bd5[_0x0ae0('0x6c')],'as':_0x0ae0('0xad'),'attributes':['id','name',_0x0ae0('0xae')],'through':_0x537417['query'][_0x0ae0('0xac')]?{'attributes':[],'where':{'TagId':_0x537417[_0x0ae0('0x81')][_0x0ae0('0xac')]||undefined}}:{},'required':_0x537417['query']['tag']?!![]:![]}];}else{_0x35f8e9[_0x0ae0('0xaa')]=[{'all':!![]}];}}return _0x4a5bd5[_0x5b6082['childModel']][_0x0ae0('0x7')](_0x35f8e9);})[_0x0ae0('0x8')](function(_0x382039){_0x2a2a94[_0x0ae0('0xa8')]=_0x382039;if(_0x210aa9==='Agents'&&_0x537417[_0x0ae0('0x81')][_0x0ae0('0xaf')]===_0x0ae0('0xb0')){var _0x4de49b=[];for(var _0x27f6db=0x0;_0x27f6db<_0x2a2a94[_0x0ae0('0xa8')][_0x0ae0('0x8a')];_0x27f6db++){_0x4de49b['push'](_0x308e81(_0x0ae0('0xb1'),_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db][_0x0ae0('0xb2')]));_0x4de49b[_0x0ae0('0x8b')](_0x308e81(_0x0ae0('0xb3'),_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db][_0x0ae0('0xb2')]));_0x4de49b[_0x0ae0('0x8b')](_0x308e81('fax',_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db][_0x0ae0('0xb2')]));_0x4de49b[_0x0ae0('0x8b')](_0x308e81(_0x0ae0('0xb4'),_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db][_0x0ae0('0xb2')]));_0x4de49b[_0x0ae0('0x8b')](_0x308e81(_0x0ae0('0xb5'),_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db]['dataValues']));_0x4de49b['push'](_0x308e81(_0x0ae0('0xb6'),_0x2a2a94[_0x0ae0('0xa8')][_0x27f6db][_0x0ae0('0xb2')]));}return Promise['all'](_0x4de49b)['then'](function(){return _0x2a2a94;});}return _0x2a2a94;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6d257b7..ffd6bfc 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 _0x57b7=['UserProfile,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','info','request\x20sent','debug','error','message'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x57b7,0x160));var _0x757b=function(_0x396f22,_0x4d87a8){_0x396f22=_0x396f22-0x0;var _0x7aeaa6=_0x57b7[_0x396f22];return _0x7aeaa6;};'use strict';var _=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var moment=require(_0x757b('0x2'));var BPromise=require(_0x757b('0x3'));var rs=require(_0x757b('0x4'));var fs=require('fs');var Redis=require(_0x757b('0x5'));var db=require(_0x757b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x757b('0x7'))(_0x757b('0x8'));var config=require(_0x757b('0x9'));var jayson=require(_0x757b('0xa'));var client=jayson['client'][_0x757b('0xb')]({'port':0x232a});config[_0x757b('0xc')]=_[_0x757b('0xd')](config[_0x757b('0xc')],{'host':_0x757b('0xe'),'port':0x18eb});var socket=require(_0x757b('0xf'))(new Redis(config[_0x757b('0xc')]));require(_0x757b('0x10'))['register'](socket);function respondWithRpcPromise(_0x1f048,_0x2bd3bc,_0x5d1f89){return new BPromise(function(_0x14b8e8,_0x5a0164){return client[_0x757b('0x11')](_0x1f048,_0x5d1f89)['then'](function(_0x2a440d){logger[_0x757b('0x12')]('UserProfile,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'));logger[_0x757b('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'),JSON['stringify'](_0x2a440d));if(_0x2a440d[_0x757b('0x15')]){if(_0x2a440d[_0x757b('0x15')]['code']===0x1f4){logger[_0x757b('0x15')]('UserProfile,\x20%s,\x20%s',_0x2bd3bc,_0x2a440d[_0x757b('0x15')][_0x757b('0x16')]);return _0x5a0164(_0x2a440d[_0x757b('0x15')]['message']);}logger[_0x757b('0x15')](_0x757b('0x17'),_0x2bd3bc,_0x2a440d['error'][_0x757b('0x16')]);return _0x14b8e8(_0x2a440d['error']['message']);}else{logger[_0x757b('0x12')]('UserProfile,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'));_0x14b8e8(_0x2a440d[_0x757b('0x18')][_0x757b('0x16')]);}})['catch'](function(_0x5c86f8){logger[_0x757b('0x15')](_0x757b('0x17'),_0x2bd3bc,_0x5c86f8);_0x5a0164(_0x5c86f8);});});} \ No newline at end of file +var _0xc177=['localhost','socket.io-emitter','./userProfile.socket','register','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','UserProfile,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis'];(function(_0x536a3e,_0x27eadb){var _0x52f426=function(_0x275d6d){while(--_0x275d6d){_0x536a3e['push'](_0x536a3e['shift']());}};_0x52f426(++_0x27eadb);}(_0xc177,0x1b2));var _0x7c17=function(_0x446bfc,_0x22f7d9){_0x446bfc=_0x446bfc-0x0;var _0x40fee6=_0xc177[_0x446bfc];return _0x40fee6;};'use strict';var _=require(_0x7c17('0x0'));var util=require(_0x7c17('0x1'));var moment=require(_0x7c17('0x2'));var BPromise=require(_0x7c17('0x3'));var rs=require(_0x7c17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c17('0x5'))['db'];var utils=require(_0x7c17('0x6'));var logger=require(_0x7c17('0x7'))(_0x7c17('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c17('0x9'));var client=jayson[_0x7c17('0xa')][_0x7c17('0xb')]({'port':0x232a});config['redis']=_[_0x7c17('0xc')](config[_0x7c17('0xd')],{'host':_0x7c17('0xe'),'port':0x18eb});var socket=require(_0x7c17('0xf'))(new Redis(config[_0x7c17('0xd')]));require(_0x7c17('0x10'))[_0x7c17('0x11')](socket);function respondWithRpcPromise(_0x4005e7,_0x2da413,_0x39e320){return new BPromise(function(_0x502793,_0x5ec150){return client['request'](_0x4005e7,_0x39e320)[_0x7c17('0x12')](function(_0x23c870){logger[_0x7c17('0x13')]('UserProfile,\x20%s,\x20%s',_0x2da413,_0x7c17('0x14'));logger[_0x7c17('0x15')](_0x7c17('0x16'),_0x2da413,'request\x20sent',JSON['stringify'](_0x23c870));if(_0x23c870[_0x7c17('0x17')]){if(_0x23c870[_0x7c17('0x17')]['code']===0x1f4){logger[_0x7c17('0x17')]('UserProfile,\x20%s,\x20%s',_0x2da413,_0x23c870[_0x7c17('0x17')]['message']);return _0x5ec150(_0x23c870[_0x7c17('0x17')][_0x7c17('0x18')]);}logger[_0x7c17('0x17')](_0x7c17('0x19'),_0x2da413,_0x23c870[_0x7c17('0x17')][_0x7c17('0x18')]);return _0x502793(_0x23c870[_0x7c17('0x17')][_0x7c17('0x18')]);}else{logger[_0x7c17('0x13')](_0x7c17('0x19'),_0x2da413,_0x7c17('0x14'));_0x502793(_0x23c870[_0x7c17('0x1a')][_0x7c17('0x18')]);}})[_0x7c17('0x1b')](function(_0x59ef3d){logger[_0x7c17('0x17')](_0x7c17('0x19'),_0x2da413,_0x59ef3d);_0x5ec150(_0x59ef3d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5e3fc07..6e78405 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 _0x17b5=['register','length','userProfile:','./userProfile.events','remove','emit','removeListener'];(function(_0x3e2c63,_0x542643){var _0x253c55=function(_0x3f17fa){while(--_0x3f17fa){_0x3e2c63['push'](_0x3e2c63['shift']());}};_0x253c55(++_0x542643);}(_0x17b5,0x161));var _0x517b=function(_0xc587ed,_0x11cbc2){_0xc587ed=_0xc587ed-0x0;var _0x41d137=_0x17b5[_0xc587ed];return _0x41d137;};'use strict';var UserProfileEvents=require(_0x517b('0x0'));var events=['save',_0x517b('0x1'),'update'];function createListener(_0x1430f7,_0x32c059){return function(_0xa438bd){_0x32c059[_0x517b('0x2')](_0x1430f7,_0xa438bd);};}function removeListener(_0x656808,_0x304c16){return function(){UserProfileEvents[_0x517b('0x3')](_0x656808,_0x304c16);};}exports[_0x517b('0x4')]=function(_0x1feee1){for(var _0xc66cbf=0x0,_0x311f3a=events[_0x517b('0x5')];_0xc66cbf<_0x311f3a;_0xc66cbf++){var _0x2d0e48=events[_0xc66cbf];var _0x593b80=createListener(_0x517b('0x6')+_0x2d0e48,_0x1feee1);UserProfileEvents['on'](_0x2d0e48,_0x593b80);}}; \ No newline at end of file +var _0x60fb=['length','userProfile:','save','remove'];(function(_0x2c4288,_0x2c6714){var _0x3e352a=function(_0x452880){while(--_0x452880){_0x2c4288['push'](_0x2c4288['shift']());}};_0x3e352a(++_0x2c6714);}(_0x60fb,0x13a));var _0xb60f=function(_0x175085,_0x1aeda6){_0x175085=_0x175085-0x0;var _0x217a50=_0x60fb[_0x175085];return _0x217a50;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xb60f('0x0'),_0xb60f('0x1'),'update'];function createListener(_0x411a03,_0x4f7c0e){return function(_0x321438){_0x4f7c0e['emit'](_0x411a03,_0x321438);};}function removeListener(_0x3d4346,_0x3e8cc3){return function(){UserProfileEvents['removeListener'](_0x3d4346,_0x3e8cc3);};}exports['register']=function(_0x509ee3){for(var _0x4e0459=0x0,_0x4a4174=events[_0xb60f('0x2')];_0x4e0459<_0x4a4174;_0x4e0459++){var _0x4ee175=events[_0x4e0459];var _0x371be4=createListener(_0xb60f('0x3')+_0x4ee175,_0x509ee3);UserProfileEvents['on'](_0x4ee175,_0x371be4);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 3625283..4c4e10a 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 _0x9b1b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','/:id','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2f8bfa,_0x29ac7b){var _0x4be40a=function(_0x4c1c96){while(--_0x4c1c96){_0x2f8bfa['push'](_0x2f8bfa['shift']());}};_0x4be40a(++_0x29ac7b);}(_0x9b1b,0x66));var _0xb9b1=function(_0x4ef912,_0x109180){_0x4ef912=_0x4ef912-0x0;var _0x5416ed=_0x9b1b[_0x4ef912];return _0x5416ed;};'use strict';var multer=require(_0xb9b1('0x0'));var util=require(_0xb9b1('0x1'));var path=require(_0xb9b1('0x2'));var timeout=require(_0xb9b1('0x3'));var express=require(_0xb9b1('0x4'));var router=express[_0xb9b1('0x5')]();var fs_extra=require(_0xb9b1('0x6'));var auth=require(_0xb9b1('0x7'));var interaction=require(_0xb9b1('0x8'));var config=require(_0xb9b1('0x9'));var controller=require(_0xb9b1('0xa'));router['get']('/',auth[_0xb9b1('0xb')](),controller[_0xb9b1('0xc')]);router[_0xb9b1('0xd')](_0xb9b1('0xe'),auth[_0xb9b1('0xb')](),controller['describe']);router[_0xb9b1('0xd')](_0xb9b1('0xf'),auth[_0xb9b1('0xb')](),controller['show']);router['post']('/',auth[_0xb9b1('0xb')](),controller['create']);router[_0xb9b1('0x10')](_0xb9b1('0xf'),auth[_0xb9b1('0xb')](),controller[_0xb9b1('0x11')]);router[_0xb9b1('0x12')](_0xb9b1('0xf'),auth['isAuthenticated'](),controller[_0xb9b1('0x13')]);module[_0xb9b1('0x14')]=router; \ No newline at end of file +var _0x7297=['/describe','isAuthenticated','/:id','post','create','put','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x47e7df,_0x3ee27f){var _0x2ce095=function(_0x17f17d){while(--_0x17f17d){_0x47e7df['push'](_0x47e7df['shift']());}};_0x2ce095(++_0x3ee27f);}(_0x7297,0xc3));var _0x7729=function(_0x50e3f7,_0x33713e){_0x50e3f7=_0x50e3f7-0x0;var _0x31efb4=_0x7297[_0x50e3f7];return _0x31efb4;};'use strict';var multer=require(_0x7729('0x0'));var util=require(_0x7729('0x1'));var path=require(_0x7729('0x2'));var timeout=require('connect-timeout');var express=require(_0x7729('0x3'));var router=express['Router']();var fs_extra=require(_0x7729('0x4'));var auth=require(_0x7729('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7729('0x6'));var controller=require('./userProfileResource.controller');router[_0x7729('0x7')]('/',auth['isAuthenticated'](),controller[_0x7729('0x8')]);router['get'](_0x7729('0x9'),auth[_0x7729('0xa')](),controller['describe']);router[_0x7729('0x7')](_0x7729('0xb'),auth[_0x7729('0xa')](),controller['show']);router[_0x7729('0xc')]('/',auth[_0x7729('0xa')](),controller[_0x7729('0xd')]);router[_0x7729('0xe')](_0x7729('0xb'),auth[_0x7729('0xa')](),controller[_0x7729('0xf')]);router['delete']('/:id',auth[_0x7729('0xa')](),controller['destroy']);module[_0x7729('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 78a3e46..1ea824b 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 _0xbfab=['exports','STRING','INTEGER','sequelize'];(function(_0x37b6f2,_0x21036a){var _0x10be7e=function(_0x5ec454){while(--_0x5ec454){_0x37b6f2['push'](_0x37b6f2['shift']());}};_0x10be7e(++_0x21036a);}(_0xbfab,0x1a3));var _0xbbfa=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xbfab[_0x4eaa4c];return _0x15aec6;};'use strict';var Sequelize=require(_0xbbfa('0x0'));module[_0xbbfa('0x1')]={'name':{'type':Sequelize[_0xbbfa('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xbbfa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbbfa('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd47f=['INTEGER','STRING','sequelize','exports'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xd47f,0x9a));var _0xfd47=function(_0x3094e2,_0x198632){_0x3094e2=_0x3094e2-0x0;var _0x65f4f9=_0xd47f[_0x3094e2];return _0x65f4f9;};'use strict';var Sequelize=require(_0xfd47('0x0'));module[_0xfd47('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfd47('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfd47('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index accef9b..63fc671 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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','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'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xba34,0x119));var _0x4ba3=function(_0x5a52e6,_0x425add){_0x5a52e6=_0x5a52e6-0x0;var _0x48c61a=_0xba34[_0x5a52e6];return _0x48c61a;};'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'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file +var _0xc6ac=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','UserProfileResource','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x411254,_0x3a5bf3){_0x411254=_0x411254-0x0;var _0x1cd917=_0xc6ac[_0x411254];return _0x1cd917;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['UserProfileResource'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};exports[_0xcc6a('0x4f')]=function(_0x34531d,_0x14f5e5){return db[_0xcc6a('0x2d')]['describe']()['then'](respondWithResult(_0x14f5e5,null))[_0xcc6a('0x4b')](handleError(_0x14f5e5,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cfc2c65..0b088ae 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 _0x1542=['bluebird','request-promise','path','rimraf','exports','define','user_profile_has_resources','resourceId','sectionId','util','../../config/logger'];(function(_0x78c72f,_0x535d3b){var _0x1129f0=function(_0x2c8357){while(--_0x2c8357){_0x78c72f['push'](_0x78c72f['shift']());}};_0x1129f0(++_0x535d3b);}(_0x1542,0x82));var _0x2154=function(_0x588a02,_0x5bbc44){_0x588a02=_0x588a02-0x0;var _0x324657=_0x1542[_0x588a02];return _0x324657;};'use strict';var _=require('lodash');var util=require(_0x2154('0x0'));var logger=require(_0x2154('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2154('0x2'));var rp=require(_0x2154('0x3'));var fs=require('fs');var path=require(_0x2154('0x4'));var rimraf=require(_0x2154('0x5'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x2154('0x6')]=function(_0x505334,_0x19ebbf){return _0x505334[_0x2154('0x7')]('UserProfileResource',attributes,{'tableName':_0x2154('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x2154('0x9'),_0x2154('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d33=['define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','util','../../config/logger','api','moment','bluebird','path','./userProfileResource.attributes','exports'];(function(_0x150bae,_0x306fbd){var _0x110dc8=function(_0x819a32){while(--_0x819a32){_0x150bae['push'](_0x150bae['shift']());}};_0x110dc8(++_0x306fbd);}(_0x2d33,0x87));var _0x32d3=function(_0x10f705,_0x14bc87){_0x10f705=_0x10f705-0x0;var _0x26f52a=_0x2d33[_0x10f705];return _0x26f52a;};'use strict';var _=require('lodash');var util=require(_0x32d3('0x0'));var logger=require(_0x32d3('0x1'))(_0x32d3('0x2'));var moment=require(_0x32d3('0x3'));var BPromise=require(_0x32d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32d3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x32d3('0x6'));module[_0x32d3('0x7')]=function(_0x4b7c0c,_0x14b4f0){return _0x4b7c0c[_0x32d3('0x8')](_0x32d3('0x9'),attributes,{'tableName':_0x32d3('0xa'),'paranoid':![],'indexes':[{'name':_0x32d3('0xb'),'fields':[_0x32d3('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index afb0227..98c66d4 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 _0x1f75=['UserProfileResource,\x20%s,\x20%s,\x20%s','code','error','message','info','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x42f3bd,_0x1ace0b){var _0x756422=function(_0x2c6511){while(--_0x2c6511){_0x42f3bd['push'](_0x42f3bd['shift']());}};_0x756422(++_0x1ace0b);}(_0x1f75,0x138));var _0x51f7=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x1f75[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x51f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51f7('0x1'));var db=require(_0x51f7('0x2'))['db'];var utils=require(_0x51f7('0x3'));var logger=require(_0x51f7('0x4'))(_0x51f7('0x5'));var config=require('../../config/environment');var jayson=require(_0x51f7('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe1240c,_0x54c480,_0x453edb){return new BPromise(function(_0x1ed286,_0x47965f){return client[_0x51f7('0x7')](_0xe1240c,_0x453edb)[_0x51f7('0x8')](function(_0x38a5a7){logger['info'](_0x51f7('0x9'),_0x54c480,_0x51f7('0xa'));logger[_0x51f7('0xb')](_0x51f7('0xc'),_0x54c480,_0x51f7('0xa'),JSON['stringify'](_0x38a5a7));if(_0x38a5a7['error']){if(_0x38a5a7['error'][_0x51f7('0xd')]===0x1f4){logger[_0x51f7('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x54c480,_0x38a5a7['error'][_0x51f7('0xf')]);return _0x47965f(_0x38a5a7[_0x51f7('0xe')][_0x51f7('0xf')]);}logger['error'](_0x51f7('0x9'),_0x54c480,_0x38a5a7[_0x51f7('0xe')][_0x51f7('0xf')]);return _0x1ed286(_0x38a5a7[_0x51f7('0xe')][_0x51f7('0xf')]);}else{logger[_0x51f7('0x10')](_0x51f7('0x9'),_0x54c480,'request\x20sent');_0x1ed286(_0x38a5a7['result'][_0x51f7('0xf')]);}})[_0x51f7('0x11')](function(_0x4e9eb7){logger[_0x51f7('0xe')](_0x51f7('0x9'),_0x54c480,_0x4e9eb7);_0x47965f(_0x4e9eb7);});});} \ No newline at end of file +var _0x7c70=['debug','error','UserProfileResource,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x376bbb,_0x34a0cf){var _0x486e71=function(_0x47d86f){while(--_0x47d86f){_0x376bbb['push'](_0x376bbb['shift']());}};_0x486e71(++_0x34a0cf);}(_0x7c70,0x1d5));var _0x07c7=function(_0x3132c4,_0x321a8d){_0x3132c4=_0x3132c4-0x0;var _0xb0d3c=_0x7c70[_0x3132c4];return _0xb0d3c;};'use strict';var _=require(_0x07c7('0x0'));var util=require(_0x07c7('0x1'));var moment=require(_0x07c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x07c7('0x3'));var fs=require('fs');var Redis=require(_0x07c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x07c7('0x5'));var logger=require('../../config/logger')(_0x07c7('0x6'));var config=require(_0x07c7('0x7'));var jayson=require(_0x07c7('0x8'));var client=jayson[_0x07c7('0x9')][_0x07c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa99309,_0x4f5b19,_0x210d88){return new BPromise(function(_0x5a4190,_0x59c108){return client[_0x07c7('0xb')](_0xa99309,_0x210d88)[_0x07c7('0xc')](function(_0x487748){logger[_0x07c7('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x4f5b19,'request\x20sent');logger[_0x07c7('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4f5b19,'request\x20sent',JSON['stringify'](_0x487748));if(_0x487748['error']){if(_0x487748[_0x07c7('0xf')]['code']===0x1f4){logger[_0x07c7('0xf')](_0x07c7('0x10'),_0x4f5b19,_0x487748[_0x07c7('0xf')]['message']);return _0x59c108(_0x487748[_0x07c7('0xf')]['message']);}logger[_0x07c7('0xf')](_0x07c7('0x10'),_0x4f5b19,_0x487748[_0x07c7('0xf')][_0x07c7('0x11')]);return _0x5a4190(_0x487748['error'][_0x07c7('0x11')]);}else{logger[_0x07c7('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x4f5b19,_0x07c7('0x12'));_0x5a4190(_0x487748[_0x07c7('0x13')]['message']);}})[_0x07c7('0x14')](function(_0xa72371){logger[_0x07c7('0xf')](_0x07c7('0x10'),_0x4f5b19,_0xa72371);_0x59c108(_0xa72371);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ba466e5..4eec76a 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 _0x5535=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x5535,0xac));var _0x5553=function(_0x15639a,_0x1b36ae){_0x15639a=_0x15639a-0x0;var _0x4a9c29=_0x5535[_0x15639a];return _0x4a9c29;};'use strict';var multer=require('multer');var util=require(_0x5553('0x0'));var path=require(_0x5553('0x1'));var timeout=require(_0x5553('0x2'));var express=require(_0x5553('0x3'));var router=express['Router']();var fs_extra=require(_0x5553('0x4'));var auth=require(_0x5553('0x5'));var interaction=require(_0x5553('0x6'));var config=require(_0x5553('0x7'));var controller=require('./userProfileSection.controller');router[_0x5553('0x8')]('/',auth[_0x5553('0x9')](),controller[_0x5553('0xa')]);router[_0x5553('0x8')](_0x5553('0xb'),auth[_0x5553('0x9')](),controller[_0x5553('0xc')]);router[_0x5553('0x8')](_0x5553('0xd'),auth[_0x5553('0x9')](),controller[_0x5553('0xe')]);router[_0x5553('0xf')]('/',auth[_0x5553('0x9')](),controller[_0x5553('0x10')]);router['put']('/:id',auth[_0x5553('0x9')](),controller['update']);router['delete'](_0x5553('0xd'),auth[_0x5553('0x9')](),controller[_0x5553('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd1cf=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','destroy','exports','multer','util','connect-timeout'];(function(_0x240f7e,_0x1d31c8){var _0x57bcf6=function(_0x577e3f){while(--_0x577e3f){_0x240f7e['push'](_0x240f7e['shift']());}};_0x57bcf6(++_0x1d31c8);}(_0xd1cf,0x82));var _0xfd1c=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0xd1cf[_0x290fa6];return _0x47f1f3;};'use strict';var multer=require(_0xfd1c('0x0'));var util=require(_0xfd1c('0x1'));var path=require('path');var timeout=require(_0xfd1c('0x2'));var express=require(_0xfd1c('0x3'));var router=express[_0xfd1c('0x4')]();var fs_extra=require(_0xfd1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd1c('0x6'));var config=require(_0xfd1c('0x7'));var controller=require(_0xfd1c('0x8'));router[_0xfd1c('0x9')]('/',auth[_0xfd1c('0xa')](),controller[_0xfd1c('0xb')]);router[_0xfd1c('0x9')](_0xfd1c('0xc'),auth['isAuthenticated'](),controller[_0xfd1c('0xd')]);router['get'](_0xfd1c('0xe'),auth[_0xfd1c('0xa')](),controller[_0xfd1c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd1c('0x10')]);router['put'](_0xfd1c('0xe'),auth[_0xfd1c('0xa')](),controller['update']);router['delete']('/:id',auth[_0xfd1c('0xa')](),controller[_0xfd1c('0x11')]);module[_0xfd1c('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f69e8d8..9d55108 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 _0xeb74=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x1c8c11,_0x23092b){var _0x1491c3=function(_0x31467c){while(--_0x31467c){_0x1c8c11['push'](_0x1c8c11['shift']());}};_0x1491c3(++_0x23092b);}(_0xeb74,0xe3));var _0x4eb7=function(_0x34d7a3,_0x5ba555){_0x34d7a3=_0x34d7a3-0x0;var _0x42fb29=_0xeb74[_0x34d7a3];return _0x42fb29;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x35c7ca){this[_0x4eb7('0x5')](_0x4eb7('0x6'),_0x35c7ca?_0x35c7ca[_0x4eb7('0x7')](''):[]);},'get':function(){return this[_0x4eb7('0x8')]('crudPermissions')?this[_0x4eb7('0x8')]('crudPermissions')[_0x4eb7('0x9')](''):[];}}}; \ No newline at end of file +var _0x7916=['getDataValue','sequelize','STRING','BOOLEAN','crudPermissions'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7916,0x128));var _0x6791=function(_0x4d8951,_0x119d49){_0x4d8951=_0x4d8951-0x0;var _0xd159de=_0x7916[_0x4d8951];return _0xd159de;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x6791('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6791('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6791('0x1')],'set':function(_0x330476){this['setDataValue'](_0x6791('0x3'),_0x330476?_0x330476['join'](''):[]);},'get':function(){return this[_0x6791('0x4')](_0x6791('0x3'))?this['getDataValue'](_0x6791('0x3'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7b771d4..00bc43f 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 _0x5b42=['fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','UserProfileSection','rawAttributes','fieldName','type','map','keys','query','intersection','model','attributes'];(function(_0x469d90,_0x4ddc77){var _0xb98ba5=function(_0x6979c3){while(--_0x6979c3){_0x469d90['push'](_0x469d90['shift']());}};_0xb98ba5(++_0x4ddc77);}(_0x5b42,0xfe));var _0x25b4=function(_0xd572df,_0x1f6536){_0xd572df=_0xd572df-0x0;var _0xdacf5=_0x5b42[_0xd572df];return _0xdacf5;};'use strict';var emlformat=require(_0x25b4('0x0'));var rimraf=require(_0x25b4('0x1'));var zipdir=require(_0x25b4('0x2'));var jsonpatch=require(_0x25b4('0x3'));var rp=require(_0x25b4('0x4'));var moment=require('moment');var BPromise=require(_0x25b4('0x5'));var Mustache=require('mustache');var util=require(_0x25b4('0x6'));var path=require('path');var sox=require(_0x25b4('0x7'));var csv=require(_0x25b4('0x8'));var ejs=require(_0x25b4('0x9'));var fs=require('fs');var fs_extra=require(_0x25b4('0xa'));var _=require(_0x25b4('0xb'));var squel=require(_0x25b4('0xc'));var crypto=require(_0x25b4('0xd'));var jsforce=require(_0x25b4('0xe'));var deskjs=require(_0x25b4('0xf'));var toCsv=require(_0x25b4('0x8'));var querystring=require('querystring');var Papa=require(_0x25b4('0x10'));var Redis=require(_0x25b4('0x11'));var authService=require(_0x25b4('0x12'));var qs=require(_0x25b4('0x13'));var as=require(_0x25b4('0x14'));var hardwareService=require(_0x25b4('0x15'));var logger=require('../../config/logger')(_0x25b4('0x16'));var utils=require(_0x25b4('0x17'));var config=require(_0x25b4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x25b4('0x19'))['db'];function respondWithStatusCode(_0x49a50e,_0x59fc53){_0x59fc53=_0x59fc53||0xcc;return function(_0x35ccae){if(_0x35ccae){return _0x49a50e[_0x25b4('0x1a')](_0x59fc53);}return _0x49a50e[_0x25b4('0x1b')](_0x59fc53)[_0x25b4('0x1c')]();};}function respondWithResult(_0x39384d,_0x4d09b4){_0x4d09b4=_0x4d09b4||0xc8;return function(_0x3f95e1){if(_0x3f95e1){return _0x39384d[_0x25b4('0x1b')](_0x4d09b4)[_0x25b4('0x1d')](_0x3f95e1);}};}function respondWithFilteredResult(_0x7bf955,_0x147b81){return function(_0x2692ec){if(_0x2692ec){var _0x51c44d=typeof _0x147b81[_0x25b4('0x1e')]===_0x25b4('0x1f')&&typeof _0x147b81[_0x25b4('0x20')]===_0x25b4('0x1f');var _0x3b8610=_0x2692ec[_0x25b4('0x21')];var _0x4cbfc1=_0x51c44d?0x0:_0x147b81['offset'];var _0x33008e=_0x51c44d?_0x2692ec['count']:_0x147b81[_0x25b4('0x1e')]+_0x147b81[_0x25b4('0x20')];var _0x1f75fa;if(_0x33008e>=_0x3b8610){_0x33008e=_0x3b8610;_0x1f75fa=0xc8;}else{_0x1f75fa=0xce;}_0x7bf955[_0x25b4('0x1b')](_0x1f75fa);return _0x7bf955['set'](_0x25b4('0x22'),_0x4cbfc1+'-'+_0x33008e+'/'+_0x3b8610)['json'](_0x2692ec);}return null;};}function patchUpdates(_0x288691){return function(_0x177cf7){try{jsonpatch[_0x25b4('0x23')](_0x177cf7,_0x288691,!![]);}catch(_0x11bcbc){return BPromise[_0x25b4('0x24')](_0x11bcbc);}return _0x177cf7[_0x25b4('0x25')]();};}function saveUpdates(_0xbc31e6,_0x5a8ce4){return function(_0x27463d){if(_0x27463d){return _0x27463d['update'](_0xbc31e6)[_0x25b4('0x26')](function(_0x1558dc){return _0x1558dc;});}return null;};}function removeEntity(_0x3fef07,_0x5b30b8){return function(_0x46dc99){if(_0x46dc99){return _0x46dc99[_0x25b4('0x27')]()['then'](function(){_0x3fef07[_0x25b4('0x1b')](0xcc)[_0x25b4('0x1c')]();});}};}function handleEntityNotFound(_0x3758f8,_0x30b3a0){return function(_0x45f435){if(!_0x45f435){_0x3758f8['sendStatus'](0x194);}return _0x45f435;};}function handleError(_0x2053f6,_0x5da327){_0x5da327=_0x5da327||0x1f4;return function(_0x455458){logger[_0x25b4('0x28')](_0x455458[_0x25b4('0x29')]);if(_0x455458[_0x25b4('0x2a')]){delete _0x455458[_0x25b4('0x2a')];}_0x2053f6[_0x25b4('0x1b')](_0x5da327)[_0x25b4('0x2b')](_0x455458);};}exports['index']=function(_0x51a5c2,_0x4be9c5){var _0x2e3d41={},_0x53e6a8={},_0x414269={'count':0x0,'rows':[]};var _0x1b49a5=_['map'](db[_0x25b4('0x2c')][_0x25b4('0x2d')],function(_0x506011){return{'name':_0x506011[_0x25b4('0x2e')],'type':_0x506011[_0x25b4('0x2f')]['key']};});_0x53e6a8['model']=_[_0x25b4('0x30')](_0x1b49a5,_0x25b4('0x2a'));_0x53e6a8['query']=_[_0x25b4('0x31')](_0x51a5c2[_0x25b4('0x32')]);_0x53e6a8['filters']=_[_0x25b4('0x33')](_0x53e6a8[_0x25b4('0x34')],_0x53e6a8[_0x25b4('0x32')]);_0x2e3d41[_0x25b4('0x35')]=_[_0x25b4('0x33')](_0x53e6a8[_0x25b4('0x34')],qs[_0x25b4('0x36')](_0x51a5c2[_0x25b4('0x32')]['fields']));_0x2e3d41['attributes']=_0x2e3d41[_0x25b4('0x35')][_0x25b4('0x37')]?_0x2e3d41['attributes']:_0x53e6a8['model'];if(!_0x51a5c2[_0x25b4('0x32')][_0x25b4('0x38')]('nolimit')){_0x2e3d41[_0x25b4('0x20')]=qs[_0x25b4('0x20')](_0x51a5c2[_0x25b4('0x32')]['limit']);_0x2e3d41[_0x25b4('0x1e')]=qs[_0x25b4('0x1e')](_0x51a5c2[_0x25b4('0x32')][_0x25b4('0x1e')]);}_0x2e3d41[_0x25b4('0x39')]=qs['sort'](_0x51a5c2[_0x25b4('0x32')][_0x25b4('0x3a')]);_0x2e3d41[_0x25b4('0x3b')]=qs[_0x25b4('0x3c')](_[_0x25b4('0x3d')](_0x51a5c2['query'],_0x53e6a8['filters']),_0x1b49a5);if(_0x51a5c2['query'][_0x25b4('0x3e')]){_0x2e3d41[_0x25b4('0x3b')]=_[_0x25b4('0x3f')](_0x2e3d41[_0x25b4('0x3b')],{'$or':_[_0x25b4('0x30')](_0x1b49a5,function(_0x3eb043){if(_0x3eb043[_0x25b4('0x2f')]!==_0x25b4('0x40')){var _0x16ee4b={};_0x16ee4b[_0x3eb043[_0x25b4('0x2a')]]={'$like':'%'+_0x51a5c2[_0x25b4('0x32')][_0x25b4('0x3e')]+'%'};return _0x16ee4b;}})});}_0x2e3d41=_[_0x25b4('0x3f')]({},_0x2e3d41,_0x51a5c2[_0x25b4('0x41')]);var _0x14de32={'where':_0x2e3d41[_0x25b4('0x3b')]};return db[_0x25b4('0x2c')][_0x25b4('0x21')](_0x14de32)[_0x25b4('0x26')](function(_0xfd5cf2){_0x414269[_0x25b4('0x21')]=_0xfd5cf2;if(_0x51a5c2['query'][_0x25b4('0x42')]){_0x2e3d41[_0x25b4('0x43')]=[{'all':!![]}];}return db[_0x25b4('0x2c')][_0x25b4('0x44')](_0x2e3d41);})[_0x25b4('0x26')](function(_0x201013){_0x414269[_0x25b4('0x45')]=_0x201013;return _0x414269;})[_0x25b4('0x26')](respondWithFilteredResult(_0x4be9c5,_0x2e3d41))[_0x25b4('0x46')](handleError(_0x4be9c5,null));};exports[_0x25b4('0x47')]=function(_0x2fdd0b,_0x21a95e){var _0x7eea6d={'raw':![],'where':{'id':_0x2fdd0b[_0x25b4('0x48')]['id']}},_0x1af019={};_0x1af019[_0x25b4('0x34')]=_[_0x25b4('0x31')](db[_0x25b4('0x2c')][_0x25b4('0x2d')]);_0x1af019['query']=_['keys'](_0x2fdd0b[_0x25b4('0x32')]);_0x1af019[_0x25b4('0x3c')]=_[_0x25b4('0x33')](_0x1af019[_0x25b4('0x34')],_0x1af019[_0x25b4('0x32')]);_0x7eea6d[_0x25b4('0x35')]=_[_0x25b4('0x33')](_0x1af019[_0x25b4('0x34')],qs[_0x25b4('0x36')](_0x2fdd0b['query'][_0x25b4('0x36')]));_0x7eea6d['attributes']=_0x7eea6d[_0x25b4('0x35')][_0x25b4('0x37')]?_0x7eea6d['attributes']:_0x1af019[_0x25b4('0x34')];if(_0x2fdd0b['query'][_0x25b4('0x42')]){_0x7eea6d[_0x25b4('0x43')]=[{'all':!![]}];}_0x7eea6d=_[_0x25b4('0x3f')]({},_0x7eea6d,_0x2fdd0b[_0x25b4('0x41')]);return db['UserProfileSection']['find'](_0x7eea6d)[_0x25b4('0x26')](handleEntityNotFound(_0x21a95e,null))[_0x25b4('0x26')](respondWithResult(_0x21a95e,null))[_0x25b4('0x46')](handleError(_0x21a95e,null));};exports[_0x25b4('0x49')]=function(_0x2c71c9,_0x558bc4){return db['UserProfileSection'][_0x25b4('0x49')](_0x2c71c9[_0x25b4('0x4a')],{})['then'](respondWithResult(_0x558bc4,0xc9))['catch'](handleError(_0x558bc4,null));};exports['update']=function(_0x459ec2,_0x4321d7){if(_0x459ec2[_0x25b4('0x4a')]['id']){delete _0x459ec2['body']['id'];}return db['UserProfileSection'][_0x25b4('0x4b')]({'where':{'id':_0x459ec2[_0x25b4('0x48')]['id']}})[_0x25b4('0x26')](handleEntityNotFound(_0x4321d7,null))[_0x25b4('0x26')](saveUpdates(_0x459ec2[_0x25b4('0x4a')],null))[_0x25b4('0x26')](respondWithResult(_0x4321d7,null))[_0x25b4('0x46')](handleError(_0x4321d7,null));};exports[_0x25b4('0x27')]=function(_0x3a0e40,_0x3abdb7){return db[_0x25b4('0x2c')][_0x25b4('0x4b')]({'where':{'id':_0x3a0e40['params']['id']}})[_0x25b4('0x26')](handleEntityNotFound(_0x3abdb7,null))[_0x25b4('0x26')](removeEntity(_0x3abdb7,null))[_0x25b4('0x46')](handleError(_0x3abdb7,null));};exports[_0x25b4('0x4c')]=function(_0x5c7fae,_0x3bc942){return db[_0x25b4('0x2c')][_0x25b4('0x4c')]()[_0x25b4('0x26')](respondWithResult(_0x3bc942,null))['catch'](handleError(_0x3bc942,null));}; \ No newline at end of file +var _0xfce8=['then','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject'];(function(_0x4a09ae,_0x209cbc){var _0x5225c0=function(_0x82afc7){while(--_0x82afc7){_0x4a09ae['push'](_0x4a09ae['shift']());}};_0x5225c0(++_0x209cbc);}(_0xfce8,0x1a8));var _0x8fce=function(_0x230629,_0x49037b){_0x230629=_0x230629-0x0;var _0xf564d9=_0xfce8[_0x230629];return _0xf564d9;};'use strict';var emlformat=require(_0x8fce('0x0'));var rimraf=require(_0x8fce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fce('0x2'));var rp=require(_0x8fce('0x3'));var moment=require('moment');var BPromise=require(_0x8fce('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8fce('0x5'));var sox=require(_0x8fce('0x6'));var csv=require(_0x8fce('0x7'));var ejs=require(_0x8fce('0x8'));var fs=require('fs');var fs_extra=require(_0x8fce('0x9'));var _=require(_0x8fce('0xa'));var squel=require('squel');var crypto=require(_0x8fce('0xb'));var jsforce=require(_0x8fce('0xc'));var deskjs=require(_0x8fce('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fce('0xe'));var Papa=require(_0x8fce('0xf'));var Redis=require(_0x8fce('0x10'));var authService=require(_0x8fce('0x11'));var qs=require(_0x8fce('0x12'));var as=require(_0x8fce('0x13'));var hardwareService=require(_0x8fce('0x14'));var logger=require(_0x8fce('0x15'))(_0x8fce('0x16'));var utils=require(_0x8fce('0x17'));var config=require(_0x8fce('0x18'));var licenseUtil=require(_0x8fce('0x19'));var db=require(_0x8fce('0x1a'))['db'];function respondWithStatusCode(_0x1ae86e,_0x4636f3){_0x4636f3=_0x4636f3||0xcc;return function(_0x54512d){if(_0x54512d){return _0x1ae86e[_0x8fce('0x1b')](_0x4636f3);}return _0x1ae86e[_0x8fce('0x1c')](_0x4636f3)[_0x8fce('0x1d')]();};}function respondWithResult(_0x4e020b,_0x10b13e){_0x10b13e=_0x10b13e||0xc8;return function(_0x18bd32){if(_0x18bd32){return _0x4e020b[_0x8fce('0x1c')](_0x10b13e)['json'](_0x18bd32);}};}function respondWithFilteredResult(_0x521673,_0x1b361b){return function(_0x5b91d8){if(_0x5b91d8){var _0x56617d=typeof _0x1b361b[_0x8fce('0x1e')]==='undefined'&&typeof _0x1b361b[_0x8fce('0x1f')]===_0x8fce('0x20');var _0x387601=_0x5b91d8[_0x8fce('0x21')];var _0x33aef5=_0x56617d?0x0:_0x1b361b['offset'];var _0x5263c0=_0x56617d?_0x5b91d8[_0x8fce('0x21')]:_0x1b361b[_0x8fce('0x1e')]+_0x1b361b[_0x8fce('0x1f')];var _0x29f596;if(_0x5263c0>=_0x387601){_0x5263c0=_0x387601;_0x29f596=0xc8;}else{_0x29f596=0xce;}_0x521673[_0x8fce('0x1c')](_0x29f596);return _0x521673['set'](_0x8fce('0x22'),_0x33aef5+'-'+_0x5263c0+'/'+_0x387601)[_0x8fce('0x23')](_0x5b91d8);}return null;};}function patchUpdates(_0x27bcb1){return function(_0x37b7ef){try{jsonpatch[_0x8fce('0x24')](_0x37b7ef,_0x27bcb1,!![]);}catch(_0x22eade){return BPromise[_0x8fce('0x25')](_0x22eade);}return _0x37b7ef['save']();};}function saveUpdates(_0x1dc9ae,_0x27d095){return function(_0xb70b26){if(_0xb70b26){return _0xb70b26['update'](_0x1dc9ae)['then'](function(_0x55d27a){return _0x55d27a;});}return null;};}function removeEntity(_0x42a758,_0x480e25){return function(_0x5efbc4){if(_0x5efbc4){return _0x5efbc4['destroy']()[_0x8fce('0x26')](function(){_0x42a758['status'](0xcc)[_0x8fce('0x1d')]();});}};}function handleEntityNotFound(_0x1cded9,_0x3c5a78){return function(_0xf770c){if(!_0xf770c){_0x1cded9[_0x8fce('0x1b')](0x194);}return _0xf770c;};}function handleError(_0x4ca84c,_0x2c307d){_0x2c307d=_0x2c307d||0x1f4;return function(_0x56b817){logger[_0x8fce('0x27')](_0x56b817[_0x8fce('0x28')]);if(_0x56b817[_0x8fce('0x29')]){delete _0x56b817[_0x8fce('0x29')];}_0x4ca84c['status'](_0x2c307d)[_0x8fce('0x2a')](_0x56b817);};}exports['index']=function(_0x5d1b54,_0x90f5ae){var _0x4b80c5={},_0x405bd2={},_0x790040={'count':0x0,'rows':[]};var _0x521afb=_[_0x8fce('0x2b')](db['UserProfileSection'][_0x8fce('0x2c')],function(_0x21d84f){return{'name':_0x21d84f['fieldName'],'type':_0x21d84f[_0x8fce('0x2d')][_0x8fce('0x2e')]};});_0x405bd2['model']=_[_0x8fce('0x2b')](_0x521afb,'name');_0x405bd2[_0x8fce('0x2f')]=_[_0x8fce('0x30')](_0x5d1b54[_0x8fce('0x2f')]);_0x405bd2[_0x8fce('0x31')]=_[_0x8fce('0x32')](_0x405bd2[_0x8fce('0x33')],_0x405bd2['query']);_0x4b80c5[_0x8fce('0x34')]=_['intersection'](_0x405bd2[_0x8fce('0x33')],qs[_0x8fce('0x35')](_0x5d1b54['query'][_0x8fce('0x35')]));_0x4b80c5[_0x8fce('0x34')]=_0x4b80c5['attributes'][_0x8fce('0x36')]?_0x4b80c5[_0x8fce('0x34')]:_0x405bd2[_0x8fce('0x33')];if(!_0x5d1b54[_0x8fce('0x2f')][_0x8fce('0x37')](_0x8fce('0x38'))){_0x4b80c5[_0x8fce('0x1f')]=qs['limit'](_0x5d1b54[_0x8fce('0x2f')][_0x8fce('0x1f')]);_0x4b80c5[_0x8fce('0x1e')]=qs[_0x8fce('0x1e')](_0x5d1b54[_0x8fce('0x2f')][_0x8fce('0x1e')]);}_0x4b80c5[_0x8fce('0x39')]=qs[_0x8fce('0x3a')](_0x5d1b54['query'][_0x8fce('0x3a')]);_0x4b80c5[_0x8fce('0x3b')]=qs['filters'](_[_0x8fce('0x3c')](_0x5d1b54[_0x8fce('0x2f')],_0x405bd2[_0x8fce('0x31')]),_0x521afb);if(_0x5d1b54[_0x8fce('0x2f')][_0x8fce('0x3d')]){_0x4b80c5['where']=_[_0x8fce('0x3e')](_0x4b80c5[_0x8fce('0x3b')],{'$or':_[_0x8fce('0x2b')](_0x521afb,function(_0x4cfd3a){if(_0x4cfd3a[_0x8fce('0x2d')]!==_0x8fce('0x3f')){var _0x335415={};_0x335415[_0x4cfd3a['name']]={'$like':'%'+_0x5d1b54[_0x8fce('0x2f')][_0x8fce('0x3d')]+'%'};return _0x335415;}})});}_0x4b80c5=_['merge']({},_0x4b80c5,_0x5d1b54[_0x8fce('0x40')]);var _0x1eb3de={'where':_0x4b80c5[_0x8fce('0x3b')]};return db[_0x8fce('0x41')][_0x8fce('0x21')](_0x1eb3de)[_0x8fce('0x26')](function(_0x32fe8a){_0x790040[_0x8fce('0x21')]=_0x32fe8a;if(_0x5d1b54[_0x8fce('0x2f')]['includeAll']){_0x4b80c5[_0x8fce('0x42')]=[{'all':!![]}];}return db[_0x8fce('0x41')][_0x8fce('0x43')](_0x4b80c5);})[_0x8fce('0x26')](function(_0x5bab42){_0x790040[_0x8fce('0x44')]=_0x5bab42;return _0x790040;})[_0x8fce('0x26')](respondWithFilteredResult(_0x90f5ae,_0x4b80c5))[_0x8fce('0x45')](handleError(_0x90f5ae,null));};exports[_0x8fce('0x46')]=function(_0x2fdc40,_0x282829){var _0x533c89={'raw':![],'where':{'id':_0x2fdc40[_0x8fce('0x47')]['id']}},_0x1f69c6={};_0x1f69c6[_0x8fce('0x33')]=_[_0x8fce('0x30')](db['UserProfileSection'][_0x8fce('0x2c')]);_0x1f69c6[_0x8fce('0x2f')]=_[_0x8fce('0x30')](_0x2fdc40['query']);_0x1f69c6['filters']=_[_0x8fce('0x32')](_0x1f69c6[_0x8fce('0x33')],_0x1f69c6['query']);_0x533c89[_0x8fce('0x34')]=_[_0x8fce('0x32')](_0x1f69c6[_0x8fce('0x33')],qs[_0x8fce('0x35')](_0x2fdc40[_0x8fce('0x2f')][_0x8fce('0x35')]));_0x533c89[_0x8fce('0x34')]=_0x533c89[_0x8fce('0x34')][_0x8fce('0x36')]?_0x533c89['attributes']:_0x1f69c6['model'];if(_0x2fdc40[_0x8fce('0x2f')][_0x8fce('0x48')]){_0x533c89[_0x8fce('0x42')]=[{'all':!![]}];}_0x533c89=_[_0x8fce('0x3e')]({},_0x533c89,_0x2fdc40[_0x8fce('0x40')]);return db[_0x8fce('0x41')][_0x8fce('0x49')](_0x533c89)['then'](handleEntityNotFound(_0x282829,null))['then'](respondWithResult(_0x282829,null))['catch'](handleError(_0x282829,null));};exports[_0x8fce('0x4a')]=function(_0x5938d9,_0xa0ae18){return db['UserProfileSection']['create'](_0x5938d9[_0x8fce('0x4b')],{})[_0x8fce('0x26')](respondWithResult(_0xa0ae18,0xc9))[_0x8fce('0x45')](handleError(_0xa0ae18,null));};exports['update']=function(_0x2a9cbe,_0x38210a){if(_0x2a9cbe[_0x8fce('0x4b')]['id']){delete _0x2a9cbe['body']['id'];}return db[_0x8fce('0x41')][_0x8fce('0x49')]({'where':{'id':_0x2a9cbe[_0x8fce('0x47')]['id']}})[_0x8fce('0x26')](handleEntityNotFound(_0x38210a,null))[_0x8fce('0x26')](saveUpdates(_0x2a9cbe[_0x8fce('0x4b')],null))[_0x8fce('0x26')](respondWithResult(_0x38210a,null))['catch'](handleError(_0x38210a,null));};exports['destroy']=function(_0x1a029e,_0x1b5d29){return db[_0x8fce('0x41')][_0x8fce('0x49')]({'where':{'id':_0x1a029e[_0x8fce('0x47')]['id']}})[_0x8fce('0x26')](handleEntityNotFound(_0x1b5d29,null))[_0x8fce('0x26')](removeEntity(_0x1b5d29,null))[_0x8fce('0x45')](handleError(_0x1b5d29,null));};exports[_0x8fce('0x4c')]=function(_0x57797b,_0x67597b){return db['UserProfileSection'][_0x8fce('0x4c')]()['then'](respondWithResult(_0x67597b,null))['catch'](handleError(_0x67597b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5f87829..ac4a50e 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 _0xd7f6=['../../config/environment','./userProfileSection.attributes','define','user_profile_has_sections','compositeIndex','sectionId','lodash','api','moment','bluebird'];(function(_0x41b35b,_0x1665b1){var _0x4a7dee=function(_0x38b343){while(--_0x38b343){_0x41b35b['push'](_0x41b35b['shift']());}};_0x4a7dee(++_0x1665b1);}(_0xd7f6,0x18c));var _0x6d7f=function(_0x750162,_0x4c2af0){_0x750162=_0x750162-0x0;var _0x1b5cd3=_0xd7f6[_0x750162];return _0x1b5cd3;};'use strict';var _=require(_0x6d7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6d7f('0x1'));var moment=require(_0x6d7f('0x2'));var BPromise=require(_0x6d7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6d7f('0x4'));var attributes=require(_0x6d7f('0x5'));module['exports']=function(_0x5bd43e,_0x17b44d){return _0x5bd43e[_0x6d7f('0x6')]('UserProfileSection',attributes,{'tableName':_0x6d7f('0x7'),'paranoid':![],'indexes':[{'name':_0x6d7f('0x8'),'fields':[_0x6d7f('0x9'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xace5=['../../config/logger','api','moment','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','util'];(function(_0x506c3b,_0x4010a6){var _0x3f793f=function(_0x4d892c){while(--_0x4d892c){_0x506c3b['push'](_0x506c3b['shift']());}};_0x3f793f(++_0x4010a6);}(_0xace5,0x110));var _0x5ace=function(_0x14a55e,_0x3dc929){_0x14a55e=_0x14a55e-0x0;var _0x483d83=_0xace5[_0x14a55e];return _0x483d83;};'use strict';var _=require('lodash');var util=require(_0x5ace('0x0'));var logger=require(_0x5ace('0x1'))(_0x5ace('0x2'));var moment=require(_0x5ace('0x3'));var BPromise=require('bluebird');var rp=require(_0x5ace('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ace('0x5'));var attributes=require(_0x5ace('0x6'));module[_0x5ace('0x7')]=function(_0x543484,_0x99ccaa){return _0x543484[_0x5ace('0x8')](_0x5ace('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x5ace('0xa'),'fields':[_0x5ace('0xb'),_0x5ace('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 549eb4f..870a655 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 _0x847f=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','request\x20sent'];(function(_0x47c492,_0x311a27){var _0x32105d=function(_0x5b0289){while(--_0x5b0289){_0x47c492['push'](_0x47c492['shift']());}};_0x32105d(++_0x311a27);}(_0x847f,0x182));var _0xf847=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0x847f[_0x15ddc9];return _0x2fc9e8;};'use strict';var _=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var moment=require(_0xf847('0x2'));var BPromise=require('bluebird');var rs=require(_0xf847('0x3'));var fs=require('fs');var Redis=require(_0xf847('0x4'));var db=require(_0xf847('0x5'))['db'];var utils=require(_0xf847('0x6'));var logger=require(_0xf847('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf847('0x8'));var client=jayson[_0xf847('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e7c87,_0x491c65,_0x381905){return new BPromise(function(_0xe8df2f,_0x18d9a7){return client['request'](_0x5e7c87,_0x381905)[_0xf847('0xa')](function(_0x1e5a6e){logger[_0xf847('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x491c65,_0xf847('0xc'));logger['debug'](_0xf847('0xd'),_0x491c65,_0xf847('0xc'),JSON[_0xf847('0xe')](_0x1e5a6e));if(_0x1e5a6e['error']){if(_0x1e5a6e[_0xf847('0xf')]['code']===0x1f4){logger[_0xf847('0xf')](_0xf847('0x10'),_0x491c65,_0x1e5a6e[_0xf847('0xf')][_0xf847('0x11')]);return _0x18d9a7(_0x1e5a6e[_0xf847('0xf')][_0xf847('0x11')]);}logger[_0xf847('0xf')](_0xf847('0x10'),_0x491c65,_0x1e5a6e[_0xf847('0xf')][_0xf847('0x11')]);return _0xe8df2f(_0x1e5a6e[_0xf847('0xf')][_0xf847('0x11')]);}else{logger[_0xf847('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x491c65,_0xf847('0xc'));_0xe8df2f(_0x1e5a6e[_0xf847('0x12')][_0xf847('0x11')]);}})['catch'](function(_0x4e8201){logger[_0xf847('0xf')](_0xf847('0x10'),_0x491c65,_0x4e8201);_0x18d9a7(_0x4e8201);});});} \ No newline at end of file +var _0x3739=['client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x563822,_0x3f0071){var _0xf58f1d=function(_0x378b3f){while(--_0x378b3f){_0x563822['push'](_0x563822['shift']());}};_0xf58f1d(++_0x3f0071);}(_0x3739,0x1f1));var _0x9373=function(_0x614ffd,_0x2beae8){_0x614ffd=_0x614ffd-0x0;var _0x312de9=_0x3739[_0x614ffd];return _0x312de9;};'use strict';var _=require(_0x9373('0x0'));var util=require('util');var moment=require(_0x9373('0x1'));var BPromise=require(_0x9373('0x2'));var rs=require(_0x9373('0x3'));var fs=require('fs');var Redis=require(_0x9373('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9373('0x5'))(_0x9373('0x6'));var config=require(_0x9373('0x7'));var jayson=require(_0x9373('0x8'));var client=jayson[_0x9373('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb221,_0x375ce3,_0x183b3d){return new BPromise(function(_0x54f409,_0x8eb171){return client['request'](_0x3cb221,_0x183b3d)[_0x9373('0xa')](function(_0x583623){logger[_0x9373('0xb')](_0x9373('0xc'),_0x375ce3,_0x9373('0xd'));logger[_0x9373('0xe')](_0x9373('0xf'),_0x375ce3,'request\x20sent',JSON[_0x9373('0x10')](_0x583623));if(_0x583623[_0x9373('0x11')]){if(_0x583623[_0x9373('0x11')][_0x9373('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x375ce3,_0x583623[_0x9373('0x11')][_0x9373('0x13')]);return _0x8eb171(_0x583623['error']['message']);}logger[_0x9373('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x375ce3,_0x583623[_0x9373('0x11')][_0x9373('0x13')]);return _0x54f409(_0x583623[_0x9373('0x11')][_0x9373('0x13')]);}else{logger[_0x9373('0xb')](_0x9373('0xc'),_0x375ce3,_0x9373('0xd'));_0x54f409(_0x583623[_0x9373('0x14')][_0x9373('0x13')]);}})[_0x9373('0x15')](function(_0x58a73f){logger[_0x9373('0x11')](_0x9373('0xc'),_0x375ce3,_0x58a73f);_0x8eb171(_0x58a73f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 8e19907..63b005f 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f4a8e,_0x507c39){var _0x7f68fd=function(_0x29890f){while(--_0x29890f){_0x3f4a8e['push'](_0x3f4a8e['shift']());}};_0x7f68fd(++_0x507c39);}(_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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3acd4c,_0x59c868){var _0x5c793a=function(_0x228e94){while(--_0x228e94){_0x3acd4c['push'](_0x3acd4c['shift']());}};_0x5c793a(++_0x59c868);}(_0x70e0,0x17b));var _0x070e=function(_0x2c24ef,_0x2205f7){_0x2c24ef=_0x2c24ef-0x0;var _0x4e06de=_0x70e0[_0x2c24ef];return _0x4e06de;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4a35be2..d903ebb 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 _0x061c=['sequelize','exports','INTEGER'];(function(_0x1a6a6a,_0x541bfe){var _0x35f70e=function(_0x3fa3ed){while(--_0x3fa3ed){_0x1a6a6a['push'](_0x1a6a6a['shift']());}};_0x35f70e(++_0x541bfe);}(_0x061c,0xc0));var _0xc061=function(_0x2654b4,_0x51c2de){_0x2654b4=_0x2654b4-0x0;var _0x4ab160=_0x061c[_0x2654b4];return _0x4ab160;};'use strict';var Sequelize=require(_0xc061('0x0'));module[_0xc061('0x1')]={'penalty':{'type':Sequelize[_0xc061('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e04=['INTEGER','sequelize'];(function(_0x296edc,_0x58a014){var _0xe52d62=function(_0x40a11f){while(--_0x40a11f){_0x296edc['push'](_0x296edc['shift']());}};_0xe52d62(++_0x58a014);}(_0x6e04,0x99));var _0x46e0=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x6e04[_0xee3051];return _0x139e81;};'use strict';var Sequelize=require(_0x46e0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x46e0('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 349ddff..60c655b 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 _0x583c=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','lodash'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x583c,0x12b));var _0xc583=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x583c[_0xf0ec6e];return _0x8bbc27;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));module['exports']=function(_0xd3a750,_0x365ed6){return _0xd3a750[_0xc583('0x8')](_0xc583('0x9'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x1cd787,_0x44b45f){var _0x3a03fd=function(_0x2ae1b2){while(--_0x2ae1b2){_0x1cd787['push'](_0x1cd787['shift']());}};_0x3a03fd(++_0x44b45f);}(_0xd9fb,0x189));var _0xbd9f=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xd9fb[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var logger=require(_0xbd9f('0x2'))(_0xbd9f('0x3'));var moment=require(_0xbd9f('0x4'));var BPromise=require(_0xbd9f('0x5'));var rp=require(_0xbd9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0xbd9f('0x9')]=function(_0x5b6052,_0x2e7eea){return _0x5b6052[_0xbd9f('0xa')]('UserSmsQueue',attributes,{'tableName':_0xbd9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index b917411..f41c509 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 _0x1d15=['UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x9e61fc,_0x2e0c62){var _0x8badf9=function(_0x3f489b){while(--_0x3f489b){_0x9e61fc['push'](_0x9e61fc['shift']());}};_0x8badf9(++_0x2e0c62);}(_0x1d15,0x163));var _0x51d1=function(_0x18f882,_0x1a3559){_0x18f882=_0x18f882-0x0;var _0x2dfed4=_0x1d15[_0x18f882];return _0x2dfed4;};'use strict';var _=require(_0x51d1('0x0'));var util=require(_0x51d1('0x1'));var moment=require('moment');var BPromise=require(_0x51d1('0x2'));var rs=require(_0x51d1('0x3'));var fs=require('fs');var Redis=require(_0x51d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51d1('0x5'));var logger=require(_0x51d1('0x6'))(_0x51d1('0x7'));var config=require(_0x51d1('0x8'));var jayson=require(_0x51d1('0x9'));var client=jayson[_0x51d1('0xa')][_0x51d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ef550,_0x2f5e46,_0x58e39f){return new BPromise(function(_0xf979e0,_0x724769){return client[_0x51d1('0xc')](_0x4ef550,_0x58e39f)['then'](function(_0x4fe22b){logger['info'](_0x51d1('0xd'),_0x2f5e46,'request\x20sent');logger[_0x51d1('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2f5e46,_0x51d1('0xf'),JSON[_0x51d1('0x10')](_0x4fe22b));if(_0x4fe22b[_0x51d1('0x11')]){if(_0x4fe22b[_0x51d1('0x11')][_0x51d1('0x12')]===0x1f4){logger[_0x51d1('0x11')](_0x51d1('0xd'),_0x2f5e46,_0x4fe22b['error'][_0x51d1('0x13')]);return _0x724769(_0x4fe22b[_0x51d1('0x11')][_0x51d1('0x13')]);}logger[_0x51d1('0x11')](_0x51d1('0xd'),_0x2f5e46,_0x4fe22b['error'][_0x51d1('0x13')]);return _0xf979e0(_0x4fe22b[_0x51d1('0x11')][_0x51d1('0x13')]);}else{logger[_0x51d1('0x14')](_0x51d1('0xd'),_0x2f5e46,_0x51d1('0xf'));_0xf979e0(_0x4fe22b[_0x51d1('0x15')][_0x51d1('0x13')]);}})[_0x51d1('0x16')](function(_0x136ea9){logger[_0x51d1('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x2f5e46,_0x136ea9);_0x724769(_0x136ea9);});});} \ No newline at end of file +var _0x8098=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x13206d,_0x4c0ca4){var _0x4f47e8=function(_0x278bf6){while(--_0x278bf6){_0x13206d['push'](_0x13206d['shift']());}};_0x4f47e8(++_0x4c0ca4);}(_0x8098,0x7b));var _0x8809=function(_0x2f8141,_0x1052ab){_0x2f8141=_0x2f8141-0x0;var _0x9761da=_0x8098[_0x2f8141];return _0x9761da;};'use strict';var _=require(_0x8809('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8809('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8809('0x2'))['db'];var utils=require(_0x8809('0x3'));var logger=require(_0x8809('0x4'))('rpc');var config=require(_0x8809('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8809('0x6')][_0x8809('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1527de,_0x554ac4,_0x1b24ad){return new BPromise(function(_0x2c54a1,_0x4a28c7){return client[_0x8809('0x8')](_0x1527de,_0x1b24ad)[_0x8809('0x9')](function(_0x2e580f){logger[_0x8809('0xa')](_0x8809('0xb'),_0x554ac4,_0x8809('0xc'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x554ac4,_0x8809('0xc'),JSON[_0x8809('0xd')](_0x2e580f));if(_0x2e580f[_0x8809('0xe')]){if(_0x2e580f['error'][_0x8809('0xf')]===0x1f4){logger[_0x8809('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x554ac4,_0x2e580f[_0x8809('0xe')]['message']);return _0x4a28c7(_0x2e580f[_0x8809('0xe')][_0x8809('0x10')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x554ac4,_0x2e580f[_0x8809('0xe')][_0x8809('0x10')]);return _0x2c54a1(_0x2e580f['error'][_0x8809('0x10')]);}else{logger[_0x8809('0xa')](_0x8809('0xb'),_0x554ac4,_0x8809('0xc'));_0x2c54a1(_0x2e580f[_0x8809('0x11')][_0x8809('0x10')]);}})[_0x8809('0x12')](function(_0x307b83){logger[_0x8809('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x554ac4,_0x307b83);_0x4a28c7(_0x307b83);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ec65958..092af0f 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 _0x3ef6=['exports','INTEGER','sequelize'];(function(_0x491ec2,_0x540c00){var _0x1748db=function(_0x5a6258){while(--_0x5a6258){_0x491ec2['push'](_0x491ec2['shift']());}};_0x1748db(++_0x540c00);}(_0x3ef6,0x191));var _0x63ef=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x3ef6[_0x36da00];return _0x4b72c5;};'use strict';var Sequelize=require(_0x63ef('0x0'));module[_0x63ef('0x1')]={'UserId':{'type':Sequelize[_0x63ef('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x63ef('0x2')]}}; \ No newline at end of file +var _0x03c4=['INTEGER','exports'];(function(_0x1c981a,_0x142aaa){var _0x23c267=function(_0x1deb4a){while(--_0x1deb4a){_0x1c981a['push'](_0x1c981a['shift']());}};_0x23c267(++_0x142aaa);}(_0x03c4,0x199));var _0x403c=function(_0xe89020,_0x39de1a){_0xe89020=_0xe89020-0x0;var _0x1a87e3=_0x03c4[_0xe89020];return _0x1a87e3;};'use strict';var Sequelize=require('sequelize');module[_0x403c('0x0')]={'UserId':{'type':Sequelize[_0x403c('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 26a726a..08c6d00 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(_0x3c2bef,_0x31363e){var _0x358a8a=function(_0x3a750b){while(--_0x3a750b){_0x3c2bef['push'](_0x3c2bef['shift']());}};_0x358a8a(++_0x31363e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x50964,_0x2c6c11){var _0x2afba2=function(_0x352810){while(--_0x352810){_0x50964['push'](_0x50964['shift']());}};_0x2afba2(++_0x2c6c11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 901b10e..4e73708 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x145c37,_0x4b5bf4){var _0x4a5eaf=function(_0x2f5265){while(--_0x2f5265){_0x145c37['push'](_0x145c37['shift']());}};_0x4a5eaf(++_0x4b5bf4);}(_0xe706,0xa3));var _0x6e70=function(_0x1168c2,_0x1ed2ce){_0x1168c2=_0x1168c2-0x0;var _0x5ab8b5=_0xe706[_0x1168c2];return _0x5ab8b5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xe06dc6,_0x42e862){var _0x55694b=function(_0x4817dd){while(--_0x4817dd){_0xe06dc6['push'](_0xe06dc6['shift']());}};_0x55694b(++_0x42e862);}(_0xe706,0xa3));var _0x6e70=function(_0x356beb,_0x308032){_0x356beb=_0x356beb-0x0;var _0x4e2281=_0xe706[_0x356beb];return _0x4e2281;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0bbf135..168a580 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 _0x5e53=['exports','sequelize'];(function(_0x4e0fd0,_0x234f70){var _0xbab40c=function(_0xf96311){while(--_0xf96311){_0x4e0fd0['push'](_0x4e0fd0['shift']());}};_0xbab40c(++_0x234f70);}(_0x5e53,0xa7));var _0x35e5=function(_0x485e3c,_0x1eeb89){_0x485e3c=_0x485e3c-0x0;var _0x4c67d5=_0x5e53[_0x485e3c];return _0x4c67d5;};'use strict';var Sequelize=require(_0x35e5('0x0'));module[_0x35e5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf773=['INTEGER','sequelize','exports'];(function(_0x5b29de,_0x3d7711){var _0x1d2ec4=function(_0x4976a8){while(--_0x4976a8){_0x5b29de['push'](_0x5b29de['shift']());}};_0x1d2ec4(++_0x3d7711);}(_0xf773,0x154));var _0x3f77=function(_0xddeb6d,_0x25ff96){_0xddeb6d=_0xddeb6d-0x0;var _0x7a60a3=_0xf773[_0xddeb6d];return _0x7a60a3;};'use strict';var Sequelize=require(_0x3f77('0x0'));module[_0x3f77('0x1')]={'penalty':{'type':Sequelize[_0x3f77('0x2')],'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 39a12bb..c28f872 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 _0xce94=['bluebird','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xce94,0x6b));var _0x4ce9=function(_0x251d24,_0x5ceba9){_0x251d24=_0x251d24-0x0;var _0x191cab=_0xce94[_0x251d24];return _0x191cab;};'use strict';var _=require('lodash');var util=require(_0x4ce9('0x0'));var logger=require(_0x4ce9('0x1'))('api');var moment=require(_0x4ce9('0x2'));var BPromise=require(_0x4ce9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ce9('0x4'));var rimraf=require(_0x4ce9('0x5'));var config=require('../../config/environment');var attributes=require(_0x4ce9('0x6'));module[_0x4ce9('0x7')]=function(_0x4faf79,_0x405a46){return _0x4faf79[_0x4ce9('0x8')](_0x4ce9('0x9'),attributes,{'tableName':_0x4ce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe516=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0x12f0d8,_0x594acb){var _0x259e23=function(_0x3a5fcf){while(--_0x3a5fcf){_0x12f0d8['push'](_0x12f0d8['shift']());}};_0x259e23(++_0x594acb);}(_0xe516,0x129));var _0x6e51=function(_0x3c7d53,_0x2826d0){_0x3c7d53=_0x3c7d53-0x0;var _0x2c8387=_0xe516[_0x3c7d53];return _0x2c8387;};'use strict';var _=require('lodash');var util=require(_0x6e51('0x0'));var logger=require(_0x6e51('0x1'))(_0x6e51('0x2'));var moment=require(_0x6e51('0x3'));var BPromise=require(_0x6e51('0x4'));var rp=require(_0x6e51('0x5'));var fs=require('fs');var path=require(_0x6e51('0x6'));var rimraf=require(_0x6e51('0x7'));var config=require(_0x6e51('0x8'));var attributes=require(_0x6e51('0x9'));module[_0x6e51('0xa')]=function(_0x2ce3f4,_0x1c3d87){return _0x2ce3f4['define'](_0x6e51('0xb'),attributes,{'tableName':_0x6e51('0xc'),'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 d18d730..9953df0 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 _0x8d75=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x4659cc,_0xe17ce6){var _0xfd26ae=function(_0x56f233){while(--_0x56f233){_0x4659cc['push'](_0x4659cc['shift']());}};_0xfd26ae(++_0xe17ce6);}(_0x8d75,0x177));var _0x58d7=function(_0x3722bc,_0x43b0d4){_0x3722bc=_0x3722bc-0x0;var _0x272e33=_0x8d75[_0x3722bc];return _0x272e33;};'use strict';var _=require(_0x58d7('0x0'));var util=require(_0x58d7('0x1'));var moment=require(_0x58d7('0x2'));var BPromise=require(_0x58d7('0x3'));var rs=require(_0x58d7('0x4'));var fs=require('fs');var Redis=require(_0x58d7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58d7('0x6'));var logger=require(_0x58d7('0x7'))(_0x58d7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x58d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc78f,_0x21e420,_0x522410){return new BPromise(function(_0x4fb14d,_0x3e9fc1){return client[_0x58d7('0xa')](_0x2dc78f,_0x522410)['then'](function(_0x15e4cc){logger[_0x58d7('0xb')](_0x58d7('0xc'),_0x21e420,'request\x20sent');logger[_0x58d7('0xd')](_0x58d7('0xe'),_0x21e420,'request\x20sent',JSON['stringify'](_0x15e4cc));if(_0x15e4cc[_0x58d7('0xf')]){if(_0x15e4cc[_0x58d7('0xf')][_0x58d7('0x10')]===0x1f4){logger['error'](_0x58d7('0xc'),_0x21e420,_0x15e4cc[_0x58d7('0xf')][_0x58d7('0x11')]);return _0x3e9fc1(_0x15e4cc[_0x58d7('0xf')][_0x58d7('0x11')]);}logger[_0x58d7('0xf')](_0x58d7('0xc'),_0x21e420,_0x15e4cc[_0x58d7('0xf')]['message']);return _0x4fb14d(_0x15e4cc['error'][_0x58d7('0x11')]);}else{logger['info'](_0x58d7('0xc'),_0x21e420,_0x58d7('0x12'));_0x4fb14d(_0x15e4cc[_0x58d7('0x13')][_0x58d7('0x11')]);}})[_0x58d7('0x14')](function(_0x116edf){logger['error'](_0x58d7('0xc'),_0x21e420,_0x116edf);_0x3e9fc1(_0x116edf);});});} \ No newline at end of file +var _0x558b=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','UserVoiceQueue,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x56a862,_0x57e8ce){var _0x1a9219=function(_0x3e2c53){while(--_0x3e2c53){_0x56a862['push'](_0x56a862['shift']());}};_0x1a9219(++_0x57e8ce);}(_0x558b,0xee));var _0xb558=function(_0x295be0,_0x57eff3){_0x295be0=_0x295be0-0x0;var _0x2d1768=_0x558b[_0x295be0];return _0x2d1768;};'use strict';var _=require(_0xb558('0x0'));var util=require(_0xb558('0x1'));var moment=require(_0xb558('0x2'));var BPromise=require('bluebird');var rs=require(_0xb558('0x3'));var fs=require('fs');var Redis=require(_0xb558('0x4'));var db=require(_0xb558('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb558('0x6'))(_0xb558('0x7'));var config=require('../../config/environment');var jayson=require(_0xb558('0x8'));var client=jayson[_0xb558('0x9')][_0xb558('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20ca84,_0x5cb684,_0x36c44e){return new BPromise(function(_0x1e2d9d,_0x4c4640){return client[_0xb558('0xb')](_0x20ca84,_0x36c44e)[_0xb558('0xc')](function(_0x4b459d){logger[_0xb558('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x5cb684,_0xb558('0xe'));logger[_0xb558('0xf')](_0xb558('0x10'),_0x5cb684,_0xb558('0xe'),JSON['stringify'](_0x4b459d));if(_0x4b459d['error']){if(_0x4b459d[_0xb558('0x11')]['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x5cb684,_0x4b459d[_0xb558('0x11')][_0xb558('0x12')]);return _0x4c4640(_0x4b459d[_0xb558('0x11')][_0xb558('0x12')]);}logger[_0xb558('0x11')](_0xb558('0x13'),_0x5cb684,_0x4b459d[_0xb558('0x11')]['message']);return _0x1e2d9d(_0x4b459d[_0xb558('0x11')][_0xb558('0x12')]);}else{logger[_0xb558('0xd')](_0xb558('0x13'),_0x5cb684,_0xb558('0xe'));_0x1e2d9d(_0x4b459d[_0xb558('0x14')][_0xb558('0x12')]);}})['catch'](function(_0x5ca343){logger['error'](_0xb558('0x13'),_0x5cb684,_0x5ca343);_0x4c4640(_0x5ca343);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6392708..9dbb290 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(_0x4c660e,_0xf9298a){var _0x10a16d=function(_0x594e9d){while(--_0x594e9d){_0x4c660e['push'](_0x4c660e['shift']());}};_0x10a16d(++_0xf9298a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x958357,_0x220a52){var _0x566c5f=function(_0x521814){while(--_0x521814){_0x958357['push'](_0x958357['shift']());}};_0x566c5f(++_0x220a52);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xcb91[_0x60286b];return _0x5dff69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b77e7ce..274feef 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 _0xff2e=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x44e2c4,_0x3c5c0a){var _0x21cb29=function(_0x30ab5e){while(--_0x30ab5e){_0x44e2c4['push'](_0x44e2c4['shift']());}};_0x21cb29(++_0x3c5c0a);}(_0xff2e,0xf6));var _0xeff2=function(_0x4046cd,_0x23524c){_0x4046cd=_0x4046cd-0x0;var _0x13a5e5=_0xff2e[_0x4046cd];return _0x13a5e5;};'use strict';var Sequelize=require(_0xeff2('0x0'));module[_0xeff2('0x1')]={'uniqueid':{'type':Sequelize[_0xeff2('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xeff2('0x3')},'membername':{'type':Sequelize[_0xeff2('0x4')],'allowNull':![],'comment':_0xeff2('0x3')},'UserId':{'type':Sequelize[_0xeff2('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xeff2('0x4')],'allowNull':![],'unique':_0xeff2('0x5'),'comment':_0xeff2('0x3')},'VoiceQueueId':{'type':Sequelize[_0xeff2('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xeff2('0x4')],'allowNull':![],'unique':_0xeff2('0x5'),'comment':_0xeff2('0x3')},'penalty':{'type':Sequelize[_0xeff2('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xeff2('0x2')](0xb),'defaultValue':0x0,'comment':_0xeff2('0x3')}}; \ No newline at end of file +var _0x4cbc=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x2c0b5e,_0x5a6104){var _0x27811a=function(_0x19d179){while(--_0x19d179){_0x2c0b5e['push'](_0x2c0b5e['shift']());}};_0x27811a(++_0x5a6104);}(_0x4cbc,0x1f0));var _0xc4cb=function(_0x2b86c5,_0x2b2da4){_0x2b86c5=_0x2b86c5-0x0;var _0x10de15=_0x4cbc[_0x2b86c5];return _0x10de15;};'use strict';var Sequelize=require(_0xc4cb('0x0'));module[_0xc4cb('0x1')]={'uniqueid':{'type':Sequelize[_0xc4cb('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc4cb('0x3')},'membername':{'type':Sequelize[_0xc4cb('0x4')],'allowNull':![],'comment':_0xc4cb('0x3')},'UserId':{'type':Sequelize[_0xc4cb('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc4cb('0x4')],'allowNull':![],'unique':_0xc4cb('0x5'),'comment':_0xc4cb('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc4cb('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc4cb('0x5'),'comment':_0xc4cb('0x3')},'penalty':{'type':Sequelize[_0xc4cb('0x2')](0xb),'defaultValue':0x0,'comment':_0xc4cb('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6aa2190..52bbbc9 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 _0xcbcb=['save','update','remove','emit','hook','exports','../../mysqldb','UserVoiceQueueRt'];(function(_0x28aec9,_0x12585){var _0xda2c10=function(_0x278eb5){while(--_0x278eb5){_0x28aec9['push'](_0x28aec9['shift']());}};_0xda2c10(++_0x12585);}(_0xcbcb,0x19e));var _0xbcbc=function(_0xf11961,_0x28f919){_0xf11961=_0xf11961-0x0;var _0x1bf540=_0xcbcb[_0xf11961];return _0x1bf540;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xbcbc('0x0'))['db'][_0xbcbc('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbcbc('0x2'),'afterUpdate':_0xbcbc('0x3'),'afterDestroy':_0xbcbc('0x4')};function emitEvent(_0x203bb1){return function(_0xbb563b,_0x5b3be8,_0x48c5e8){UserVoiceQueueRtEvents[_0xbcbc('0x5')](_0x203bb1+':'+_0xbb563b['id'],_0xbb563b);UserVoiceQueueRtEvents[_0xbcbc('0x5')](_0x203bb1,_0xbb563b);_0x48c5e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xbcbc('0x6')](e,emitEvent(event));}}module[_0xbcbc('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x67bb=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0xcfed91,_0x29b51b){var _0x42e245=function(_0x1a131c){while(--_0x1a131c){_0xcfed91['push'](_0xcfed91['shift']());}};_0x42e245(++_0x29b51b);}(_0x67bb,0x159));var _0xb67b=function(_0x218455,_0x45fdc6){_0x218455=_0x218455-0x0;var _0x378113=_0x67bb[_0x218455];return _0x378113;};'use strict';var EventEmitter=require(_0xb67b('0x0'));var UserVoiceQueueRt=require(_0xb67b('0x1'))['db'][_0xb67b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb67b('0x3')](0x0);var events={'afterCreate':_0xb67b('0x4'),'afterUpdate':_0xb67b('0x5'),'afterDestroy':_0xb67b('0x6')};function emitEvent(_0xd6e9db){return function(_0x2796fa,_0x405b3e,_0x39f361){UserVoiceQueueRtEvents['emit'](_0xd6e9db+':'+_0x2796fa['id'],_0x2796fa);UserVoiceQueueRtEvents[_0xb67b('0x7')](_0xd6e9db,_0x2796fa);_0x39f361(null);};}for(var e in events){if(events[_0xb67b('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xb67b('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b4147b4..e11b1df 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 _0x1ac0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1ac0,0xc1));var _0x01ac=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1ac0[_0x432682];return _0x463d05;};'use strict';var _=require(_0x01ac('0x0'));var util=require(_0x01ac('0x1'));var logger=require(_0x01ac('0x2'))(_0x01ac('0x3'));var moment=require(_0x01ac('0x4'));var BPromise=require(_0x01ac('0x5'));var rp=require(_0x01ac('0x6'));var fs=require('fs');var path=require(_0x01ac('0x7'));var rimraf=require(_0x01ac('0x8'));var config=require(_0x01ac('0x9'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x01ac('0xa')]=function(_0x2195a6,_0x4f5ccf){return _0x2195a6[_0x01ac('0xb')](_0x01ac('0xc'),attributes,{'tableName':_0x01ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60d1=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x5c9f9c,_0x2193ed){var _0x20350a=function(_0x4b7419){while(--_0x4b7419){_0x5c9f9c['push'](_0x5c9f9c['shift']());}};_0x20350a(++_0x2193ed);}(_0x60d1,0x160));var _0x160d=function(_0x5afca9,_0xc5e2eb){_0x5afca9=_0x5afca9-0x0;var _0x59d15d=_0x60d1[_0x5afca9];return _0x59d15d;};'use strict';var _=require('lodash');var util=require(_0x160d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x160d('0x1'));var BPromise=require(_0x160d('0x2'));var rp=require(_0x160d('0x3'));var fs=require('fs');var path=require(_0x160d('0x4'));var rimraf=require(_0x160d('0x5'));var config=require(_0x160d('0x6'));var attributes=require(_0x160d('0x7'));module['exports']=function(_0x94e787,_0x5b8c5f){return _0x94e787[_0x160d('0x8')](_0x160d('0x9'),attributes,{'tableName':_0x160d('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 615da76..73b2a9f 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 _0x4ac1=['http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueueRt,\x20%s,\x20%s','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x4ac1,0x82));var _0x14ac=function(_0x16abb2,_0x2143c6){_0x16abb2=_0x16abb2-0x0;var _0x42649f=_0x4ac1[_0x16abb2];return _0x42649f;};'use strict';var _=require(_0x14ac('0x0'));var util=require(_0x14ac('0x1'));var moment=require(_0x14ac('0x2'));var BPromise=require(_0x14ac('0x3'));var rs=require(_0x14ac('0x4'));var fs=require('fs');var Redis=require(_0x14ac('0x5'));var db=require(_0x14ac('0x6'))['db'];var utils=require(_0x14ac('0x7'));var logger=require('../../config/logger')(_0x14ac('0x8'));var config=require('../../config/environment');var jayson=require(_0x14ac('0x9'));var client=jayson['client'][_0x14ac('0xa')]({'port':0x232a});config[_0x14ac('0xb')]=_[_0x14ac('0xc')](config['redis'],{'host':_0x14ac('0xd'),'port':0x18eb});var socket=require(_0x14ac('0xe'))(new Redis(config['redis']));require(_0x14ac('0xf'))[_0x14ac('0x10')](socket);function respondWithRpcPromise(_0x295844,_0x16ff67,_0x548e74){return new BPromise(function(_0x37daca,_0x292997){return client[_0x14ac('0x11')](_0x295844,_0x548e74)['then'](function(_0x121291){logger[_0x14ac('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x16ff67,_0x14ac('0x13'));logger['debug'](_0x14ac('0x14'),_0x16ff67,_0x14ac('0x13'),JSON[_0x14ac('0x15')](_0x121291));if(_0x121291[_0x14ac('0x16')]){if(_0x121291['error']['code']===0x1f4){logger[_0x14ac('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x16ff67,_0x121291[_0x14ac('0x16')][_0x14ac('0x17')]);return _0x292997(_0x121291[_0x14ac('0x16')][_0x14ac('0x17')]);}logger[_0x14ac('0x16')](_0x14ac('0x18'),_0x16ff67,_0x121291[_0x14ac('0x16')][_0x14ac('0x17')]);return _0x37daca(_0x121291[_0x14ac('0x16')]['message']);}else{logger['info'](_0x14ac('0x18'),_0x16ff67,_0x14ac('0x13'));_0x37daca(_0x121291['result'][_0x14ac('0x17')]);}})[_0x14ac('0x19')](function(_0x1efcd1){logger[_0x14ac('0x16')](_0x14ac('0x18'),_0x16ff67,_0x1efcd1);_0x292997(_0x1efcd1);});});}exports['GetVoiceQueueRtPauses']=function(_0x45cdd8){var _0x51f240=this;return new Promise(function(_0x3038b9,_0x1d74cb){return db[_0x14ac('0x1a')][_0x14ac('0x1b')]({'raw':_0x45cdd8[_0x14ac('0x1c')]?_0x45cdd8[_0x14ac('0x1c')][_0x14ac('0x1d')]===undefined?!![]:![]:!![],'where':_0x45cdd8[_0x14ac('0x1c')]?_0x45cdd8[_0x14ac('0x1c')][_0x14ac('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x14ac('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x14ac('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x14ac('0x21')]]})['then'](function(_0x20e56c){logger[_0x14ac('0x12')](_0x14ac('0x22'),_0x45cdd8);logger['debug']('GetVoiceQueueRtPauses',_0x45cdd8,JSON[_0x14ac('0x15')](_0x20e56c));_0x3038b9(_0x20e56c);})[_0x14ac('0x19')](function(_0x13ef7e){logger[_0x14ac('0x16')]('GetVoiceQueueRtPauses',_0x13ef7e['message'],_0x45cdd8);_0x1d74cb(_0x51f240[_0x14ac('0x16')](0x1f4,_0x13ef7e['message']));});});}; \ No newline at end of file +var _0x94ff=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3e0e6a,_0x2d178c){var _0x34deeb=function(_0x32d809){while(--_0x32d809){_0x3e0e6a['push'](_0x3e0e6a['shift']());}};_0x34deeb(++_0x2d178c);}(_0x94ff,0x95));var _0xf94f=function(_0x1b3b32,_0x2a2fa6){_0x1b3b32=_0x1b3b32-0x0;var _0x4b7e9b=_0x94ff[_0x1b3b32];return _0x4b7e9b;};'use strict';var _=require(_0xf94f('0x0'));var util=require(_0xf94f('0x1'));var moment=require(_0xf94f('0x2'));var BPromise=require(_0xf94f('0x3'));var rs=require(_0xf94f('0x4'));var fs=require('fs');var Redis=require(_0xf94f('0x5'));var db=require(_0xf94f('0x6'))['db'];var utils=require(_0xf94f('0x7'));var logger=require(_0xf94f('0x8'))(_0xf94f('0x9'));var config=require(_0xf94f('0xa'));var jayson=require(_0xf94f('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xf94f('0xc')]=_[_0xf94f('0xd')](config[_0xf94f('0xc')],{'host':_0xf94f('0xe'),'port':0x18eb});var socket=require(_0xf94f('0xf'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xf94f('0x10')](socket);function respondWithRpcPromise(_0x2f628d,_0x3ca574,_0x4179dc){return new BPromise(function(_0x1c9fd3,_0x3c9b0b){return client[_0xf94f('0x11')](_0x2f628d,_0x4179dc)['then'](function(_0x1dbd18){logger[_0xf94f('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ca574,_0xf94f('0x13'));logger['debug'](_0xf94f('0x14'),_0x3ca574,_0xf94f('0x13'),JSON['stringify'](_0x1dbd18));if(_0x1dbd18[_0xf94f('0x15')]){if(_0x1dbd18[_0xf94f('0x15')][_0xf94f('0x16')]===0x1f4){logger[_0xf94f('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ca574,_0x1dbd18[_0xf94f('0x15')][_0xf94f('0x17')]);return _0x3c9b0b(_0x1dbd18[_0xf94f('0x15')]['message']);}logger[_0xf94f('0x15')](_0xf94f('0x18'),_0x3ca574,_0x1dbd18['error']['message']);return _0x1c9fd3(_0x1dbd18[_0xf94f('0x15')][_0xf94f('0x17')]);}else{logger['info'](_0xf94f('0x18'),_0x3ca574,'request\x20sent');_0x1c9fd3(_0x1dbd18[_0xf94f('0x19')][_0xf94f('0x17')]);}})[_0xf94f('0x1a')](function(_0x2342c2){logger[_0xf94f('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ca574,_0x2342c2);_0x3c9b0b(_0x2342c2);});});}exports['GetVoiceQueueRtPauses']=function(_0x285e1a){var _0x46e6c3=this;return new Promise(function(_0x3418fe,_0x185368){return db[_0xf94f('0x1b')][_0xf94f('0x1c')]({'raw':_0x285e1a['options']?_0x285e1a[_0xf94f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x285e1a['options']?_0x285e1a['options'][_0xf94f('0x1e')]||null:null,'attributes':[[db[_0xf94f('0x1f')]['fn'](_0xf94f('0x20'),db[_0xf94f('0x1f')]['fn']('IF',db[_0xf94f('0x1f')][_0xf94f('0x21')](_0xf94f('0x22')))),_0xf94f('0x23')]]})[_0xf94f('0x24')](function(_0x204818){logger[_0xf94f('0x12')]('GetVoiceQueueRtPauses',_0x285e1a);logger[_0xf94f('0x25')]('GetVoiceQueueRtPauses',_0x285e1a,JSON['stringify'](_0x204818));_0x3418fe(_0x204818);})[_0xf94f('0x1a')](function(_0x37cec1){logger[_0xf94f('0x15')](_0xf94f('0x26'),_0x37cec1[_0xf94f('0x17')],_0x285e1a);_0x185368(_0x46e6c3[_0xf94f('0x15')](0x1f4,_0x37cec1[_0xf94f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6b2c3e3..2d4c131 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 _0x0c75=['length','save','update','emit','register'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0c75,0x6a));var _0x50c7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0c75[_0x2641f9];return _0x585741;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x50c7('0x0'),'remove',_0x50c7('0x1')];function createListener(_0x14220a,_0x2c59b1){return function(_0x23b0ec){_0x2c59b1[_0x50c7('0x2')](_0x14220a,_0x23b0ec);};}function removeListener(_0x344563,_0x3c0314){return function(){UserVoiceQueueRtEvents['removeListener'](_0x344563,_0x3c0314);};}exports[_0x50c7('0x3')]=function(_0x4c062f){for(var _0x29982f=0x0,_0x594830=events[_0x50c7('0x4')];_0x29982f<_0x594830;_0x29982f++){var _0x172856=events[_0x29982f];var _0x44d102=createListener('userVoiceQueueRt:'+_0x172856,_0x4c062f);UserVoiceQueueRtEvents['on'](_0x172856,_0x44d102);}}; \ No newline at end of file +var _0x744c=['save','remove','update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x31db27,_0x3c6118){var _0x43fd03=function(_0x9a13a9){while(--_0x9a13a9){_0x31db27['push'](_0x31db27['shift']());}};_0x43fd03(++_0x3c6118);}(_0x744c,0xa0));var _0xc744=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0x744c[_0x1a30c7];return _0x3be1e6;};'use strict';var UserVoiceQueueRtEvents=require(_0xc744('0x0'));var events=[_0xc744('0x1'),_0xc744('0x2'),_0xc744('0x3')];function createListener(_0x4b6a83,_0x1f52c6){return function(_0x423eac){_0x1f52c6[_0xc744('0x4')](_0x4b6a83,_0x423eac);};}function removeListener(_0xde4228,_0x4f1c94){return function(){UserVoiceQueueRtEvents['removeListener'](_0xde4228,_0x4f1c94);};}exports[_0xc744('0x5')]=function(_0x1cc521){for(var _0x471094=0x0,_0x5d5009=events['length'];_0x471094<_0x5d5009;_0x471094++){var _0x5a85d6=events[_0x471094];var _0x2bb565=createListener(_0xc744('0x6')+_0x5a85d6,_0x1cc521);UserVoiceQueueRtEvents['on'](_0x5a85d6,_0x2bb565);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index b13c513..99eb1a5 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x52adce,_0x5fe2fe){var _0x1d9490=function(_0x211ee1){while(--_0x211ee1){_0x52adce['push'](_0x52adce['shift']());}};_0x1d9490(++_0x5fe2fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1711d6,_0x36fe0e){var _0x5ad445=function(_0x54c078){while(--_0x54c078){_0x1711d6['push'](_0x1711d6['shift']());}};_0x5ad445(++_0x36fe0e);}(_0xedd9,0xfc));var _0x9edd=function(_0x30f77b,_0xa003a2){_0x30f77b=_0x30f77b-0x0;var _0x117084=_0xedd9[_0x30f77b];return _0x117084;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0d742e3..46f32d1 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 _0xe8f7=['INTEGER','sequelize'];(function(_0x47de3f,_0x242244){var _0x14beae=function(_0x2d1c0d){while(--_0x2d1c0d){_0x47de3f['push'](_0x47de3f['shift']());}};_0x14beae(++_0x242244);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe8f7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7e8f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7617=['exports','sequelize'];(function(_0x617e4a,_0x1a040f){var _0x3e08ce=function(_0xf3c6d7){while(--_0xf3c6d7){_0x617e4a['push'](_0x617e4a['shift']());}};_0x3e08ce(++_0x1a040f);}(_0x7617,0x1cd));var _0x7761=function(_0x425b5b,_0x4a1f8a){_0x425b5b=_0x425b5b-0x0;var _0x233be1=_0x7617[_0x425b5b];return _0x233be1;};'use strict';var Sequelize=require(_0x7761('0x0'));module[_0x7761('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index f147064..a958c8a 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 _0xbccd=['user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x3483bb,_0x5351c2){var _0x30e798=function(_0x5deb16){while(--_0x5deb16){_0x3483bb['push'](_0x3483bb['shift']());}};_0x30e798(++_0x5351c2);}(_0xbccd,0x11f));var _0xdbcc=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbccd[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xdbcc('0x0'));var util=require(_0xdbcc('0x1'));var logger=require(_0xdbcc('0x2'))('api');var moment=require(_0xdbcc('0x3'));var BPromise=require(_0xdbcc('0x4'));var rp=require(_0xdbcc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdbcc('0x6'));var attributes=require(_0xdbcc('0x7'));module[_0xdbcc('0x8')]=function(_0x1ce471,_0x45725e){return _0x1ce471['define'](_0xdbcc('0x9'),attributes,{'tableName':_0xdbcc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x704f=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x704f,0xf0));var _0xf704=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x704f[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var logger=require(_0xf704('0x2'))(_0xf704('0x3'));var moment=require(_0xf704('0x4'));var BPromise=require(_0xf704('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf704('0x6'));var rimraf=require(_0xf704('0x7'));var config=require(_0xf704('0x8'));var attributes=require(_0xf704('0x9'));module[_0xf704('0xa')]=function(_0x49810c,_0x4c592f){return _0x49810c[_0xf704('0xb')](_0xf704('0xc'),attributes,{'tableName':_0xf704('0xd'),'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 8e958e2..8823ee6 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 _0xe6af=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0x441a2e,_0xf09670){var _0x422f81=function(_0x5ec610){while(--_0x5ec610){_0x441a2e['push'](_0x441a2e['shift']());}};_0x422f81(++_0xf09670);}(_0xe6af,0x14f));var _0xfe6a=function(_0x37064c,_0x2cce44){_0x37064c=_0x37064c-0x0;var _0x25918d=_0xe6af[_0x37064c];return _0x25918d;};'use strict';var _=require(_0xfe6a('0x0'));var util=require(_0xfe6a('0x1'));var moment=require(_0xfe6a('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe6a('0x3'));var fs=require('fs');var Redis=require(_0xfe6a('0x4'));var db=require(_0xfe6a('0x5'))['db'];var utils=require(_0xfe6a('0x6'));var logger=require(_0xfe6a('0x7'))('rpc');var config=require(_0xfe6a('0x8'));var jayson=require(_0xfe6a('0x9'));var client=jayson[_0xfe6a('0xa')][_0xfe6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5989e9,_0x320687,_0x532a85){return new BPromise(function(_0x1f3bc1,_0x697a9c){return client['request'](_0x5989e9,_0x532a85)[_0xfe6a('0xc')](function(_0x5d8988){logger[_0xfe6a('0xd')](_0xfe6a('0xe'),_0x320687,'request\x20sent');logger['debug'](_0xfe6a('0xf'),_0x320687,_0xfe6a('0x10'),JSON[_0xfe6a('0x11')](_0x5d8988));if(_0x5d8988[_0xfe6a('0x12')]){if(_0x5d8988['error'][_0xfe6a('0x13')]===0x1f4){logger[_0xfe6a('0x12')](_0xfe6a('0xe'),_0x320687,_0x5d8988[_0xfe6a('0x12')][_0xfe6a('0x14')]);return _0x697a9c(_0x5d8988['error'][_0xfe6a('0x14')]);}logger['error'](_0xfe6a('0xe'),_0x320687,_0x5d8988[_0xfe6a('0x12')][_0xfe6a('0x14')]);return _0x1f3bc1(_0x5d8988[_0xfe6a('0x12')][_0xfe6a('0x14')]);}else{logger[_0xfe6a('0xd')](_0xfe6a('0xe'),_0x320687,_0xfe6a('0x10'));_0x1f3bc1(_0x5d8988['result'][_0xfe6a('0x14')]);}})['catch'](function(_0x189b39){logger[_0xfe6a('0x12')](_0xfe6a('0xe'),_0x320687,_0x189b39);_0x697a9c(_0x189b39);});});} \ No newline at end of file +var _0xea5f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x3fba1a,_0x53e6b2){var _0x472731=function(_0x1f0c85){while(--_0x1f0c85){_0x3fba1a['push'](_0x3fba1a['shift']());}};_0x472731(++_0x53e6b2);}(_0xea5f,0x19e));var _0xfea5=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xea5f[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xfea5('0x0'));var util=require('util');var moment=require(_0xfea5('0x1'));var BPromise=require('bluebird');var rs=require(_0xfea5('0x2'));var fs=require('fs');var Redis=require(_0xfea5('0x3'));var db=require(_0xfea5('0x4'))['db'];var utils=require(_0xfea5('0x5'));var logger=require(_0xfea5('0x6'))(_0xfea5('0x7'));var config=require(_0xfea5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfea5('0x9')][_0xfea5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14186,_0x227e10,_0x20ba51){return new BPromise(function(_0xf72d9c,_0xf3c29f){return client['request'](_0x14186,_0x20ba51)[_0xfea5('0xb')](function(_0x1a10d2){logger[_0xfea5('0xc')](_0xfea5('0xd'),_0x227e10,'request\x20sent');logger['debug'](_0xfea5('0xe'),_0x227e10,_0xfea5('0xf'),JSON[_0xfea5('0x10')](_0x1a10d2));if(_0x1a10d2[_0xfea5('0x11')]){if(_0x1a10d2[_0xfea5('0x11')][_0xfea5('0x12')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x227e10,_0x1a10d2[_0xfea5('0x11')]['message']);return _0xf3c29f(_0x1a10d2[_0xfea5('0x11')][_0xfea5('0x13')]);}logger[_0xfea5('0x11')](_0xfea5('0xd'),_0x227e10,_0x1a10d2['error'][_0xfea5('0x13')]);return _0xf72d9c(_0x1a10d2[_0xfea5('0x11')]['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x227e10,_0xfea5('0xf'));_0xf72d9c(_0x1a10d2[_0xfea5('0x14')]['message']);}})[_0xfea5('0x15')](function(_0x274b26){logger[_0xfea5('0x11')](_0xfea5('0xd'),_0x227e10,_0x274b26);_0xf3c29f(_0x274b26);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 6a2880f..c5c9e4d 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 _0x1c42=['isAuthenticated','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x295bbd,_0x6bd2d8){var _0x1a57df=function(_0x2c896e){while(--_0x2c896e){_0x295bbd['push'](_0x295bbd['shift']());}};_0x1a57df(++_0x6bd2d8);}(_0x1c42,0x13a));var _0x21c4=function(_0x120434,_0x48550c){_0x120434=_0x120434-0x0;var _0x7838b4=_0x1c42[_0x120434];return _0x7838b4;};'use strict';var multer=require('multer');var util=require(_0x21c4('0x0'));var path=require(_0x21c4('0x1'));var timeout=require(_0x21c4('0x2'));var express=require('express');var router=express[_0x21c4('0x3')]();var fs_extra=require(_0x21c4('0x4'));var auth=require(_0x21c4('0x5'));var interaction=require(_0x21c4('0x6'));var config=require(_0x21c4('0x7'));var controller=require(_0x21c4('0x8'));router[_0x21c4('0x9')]('/',auth[_0x21c4('0xa')](),controller['index']);router[_0x21c4('0x9')](_0x21c4('0xb'),auth['isAuthenticated'](),controller[_0x21c4('0xc')]);router['post']('/',auth[_0x21c4('0xa')](),controller[_0x21c4('0xd')]);router[_0x21c4('0xe')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller[_0x21c4('0xf')]);router[_0x21c4('0x10')](_0x21c4('0xb'),auth[_0x21c4('0xa')](),controller['destroy']);module[_0x21c4('0x11')]=router; \ No newline at end of file +var _0xece0=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x45dbe3,_0xd2bf96){var _0x1e71cf=function(_0x47d46d){while(--_0x47d46d){_0x45dbe3['push'](_0x45dbe3['shift']());}};_0x1e71cf(++_0xd2bf96);}(_0xece0,0xa5));var _0x0ece=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0xece0[_0x541260];return _0x1dd2b5;};'use strict';var multer=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var path=require('path');var timeout=require(_0x0ece('0x2'));var express=require(_0x0ece('0x3'));var router=express['Router']();var fs_extra=require(_0x0ece('0x4'));var auth=require(_0x0ece('0x5'));var interaction=require(_0x0ece('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x0ece('0x7')]('/',auth[_0x0ece('0x8')](),controller[_0x0ece('0x9')]);router[_0x0ece('0x7')](_0x0ece('0xa'),auth[_0x0ece('0x8')](),controller[_0x0ece('0xb')]);router[_0x0ece('0xc')]('/',auth[_0x0ece('0x8')](),controller[_0x0ece('0xd')]);router[_0x0ece('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0ece('0xf')]);router[_0x0ece('0x10')](_0x0ece('0xa'),auth[_0x0ece('0x8')](),controller[_0x0ece('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b66284d..39fa8cf 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 _0x4fb6=['name','STRING'];(function(_0x15d715,_0x2d8999){var _0x201502=function(_0x2d6c4a){while(--_0x2d6c4a){_0x15d715['push'](_0x15d715['shift']());}};_0x201502(++_0x2d8999);}(_0x4fb6,0x15f));var _0x64fb=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x4fb6[_0x35fabd];return _0x61a8ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x64fb('0x0')],'unique':_0x64fb('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x64fb('0x0')]}}; \ No newline at end of file +var _0xde64=['sequelize','exports','STRING','name'];(function(_0x95e715,_0xf1a527){var _0x51d8c2=function(_0x20d3eb){while(--_0x20d3eb){_0x95e715['push'](_0x95e715['shift']());}};_0x51d8c2(++_0xf1a527);}(_0xde64,0x17c));var _0x4de6=function(_0x30372e,_0x899eef){_0x30372e=_0x30372e-0x0;var _0x28c1af=_0xde64[_0x30372e];return _0x28c1af;};'use strict';var Sequelize=require(_0x4de6('0x0'));module[_0x4de6('0x1')]={'name':{'type':Sequelize[_0x4de6('0x2')],'unique':_0x4de6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4de6('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 5cef58c..a096c7c 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 _0x04b8=['pick','filter','merge','type','options','include','show','params','includeAll','find','catch','create','body','role','user','Variables','userProfileId','zip-dir','fast-json-patch','moment','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','where'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x04b8,0x145));var _0x804b=function(_0x5261a7,_0x2d06bd){_0x5261a7=_0x5261a7-0x0;var _0x1d8ad7=_0x04b8[_0x5261a7];return _0x1d8ad7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x804b('0x0'));var jsonpatch=require(_0x804b('0x1'));var rp=require('request-promise');var moment=require(_0x804b('0x2'));var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require(_0x804b('0x5'));var path=require(_0x804b('0x6'));var sox=require(_0x804b('0x7'));var csv=require(_0x804b('0x8'));var ejs=require(_0x804b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x804b('0xa'));var squel=require(_0x804b('0xb'));var crypto=require('crypto');var jsforce=require(_0x804b('0xc'));var deskjs=require(_0x804b('0xd'));var toCsv=require(_0x804b('0x8'));var querystring=require('querystring');var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require(_0x804b('0x18'))['db'];function respondWithStatusCode(_0x548490,_0x4b55ff){_0x4b55ff=_0x4b55ff||0xcc;return function(_0x4401a8){if(_0x4401a8){return _0x548490[_0x804b('0x19')](_0x4b55ff);}return _0x548490[_0x804b('0x1a')](_0x4b55ff)[_0x804b('0x1b')]();};}function respondWithResult(_0x2b86a9,_0x4d1903){_0x4d1903=_0x4d1903||0xc8;return function(_0x55f754){if(_0x55f754){return _0x2b86a9[_0x804b('0x1a')](_0x4d1903)[_0x804b('0x1c')](_0x55f754);}};}function respondWithFilteredResult(_0x2aecc5,_0x3d1a6b){return function(_0x321e02){if(_0x321e02){var _0x1767ee=typeof _0x3d1a6b[_0x804b('0x1d')]===_0x804b('0x1e')&&typeof _0x3d1a6b[_0x804b('0x1f')]===_0x804b('0x1e');var _0x1b31c0=_0x321e02[_0x804b('0x20')];var _0x53c7b6=_0x1767ee?0x0:_0x3d1a6b['offset'];var _0x48f5d9=_0x1767ee?_0x321e02[_0x804b('0x20')]:_0x3d1a6b[_0x804b('0x1d')]+_0x3d1a6b['limit'];var _0x2d9808;if(_0x48f5d9>=_0x1b31c0){_0x48f5d9=_0x1b31c0;_0x2d9808=0xc8;}else{_0x2d9808=0xce;}_0x2aecc5['status'](_0x2d9808);return _0x2aecc5[_0x804b('0x21')](_0x804b('0x22'),_0x53c7b6+'-'+_0x48f5d9+'/'+_0x1b31c0)[_0x804b('0x1c')](_0x321e02);}return null;};}function patchUpdates(_0x22cb36){return function(_0x2ba8ea){try{jsonpatch['apply'](_0x2ba8ea,_0x22cb36,!![]);}catch(_0x247439){return BPromise['reject'](_0x247439);}return _0x2ba8ea[_0x804b('0x23')]();};}function saveUpdates(_0x169295,_0x33d585){return function(_0x46b5ef){if(_0x46b5ef){return _0x46b5ef['update'](_0x169295)['then'](function(_0x24ee81){return _0x24ee81;});}return null;};}function removeEntity(_0x3dcc38,_0x5bbc12){return function(_0x3e38b5){if(_0x3e38b5){return _0x3e38b5[_0x804b('0x24')]()[_0x804b('0x25')](function(){var _0x5ae073=_0x3e38b5[_0x804b('0x26')]({'plain':!![]});var _0x535e3d='Variables';return db[_0x804b('0x27')]['destroy']({'where':{'type':_0x535e3d,'resourceId':_0x5ae073['id']}})[_0x804b('0x25')](function(){return _0x3e38b5;});})['then'](function(){_0x3dcc38[_0x804b('0x1a')](0xcc)[_0x804b('0x1b')]();});}};}function handleEntityNotFound(_0x58d222,_0xa8bce4){return function(_0x23b53b){if(!_0x23b53b){_0x58d222[_0x804b('0x19')](0x194);}return _0x23b53b;};}function handleError(_0x5418fb,_0x1f6eaf){_0x1f6eaf=_0x1f6eaf||0x1f4;return function(_0x17c88b){logger[_0x804b('0x28')](_0x17c88b[_0x804b('0x29')]);if(_0x17c88b[_0x804b('0x2a')]){delete _0x17c88b[_0x804b('0x2a')];}_0x5418fb[_0x804b('0x1a')](_0x1f6eaf)[_0x804b('0x2b')](_0x17c88b);};}exports[_0x804b('0x2c')]=function(_0x3467d5,_0x16621e){var _0x43097d={},_0x1359a6={},_0x5d6c3c={'count':0x0,'rows':[]};var _0xb606fe=_[_0x804b('0x2d')](db[_0x804b('0x2e')][_0x804b('0x2f')],function(_0x1114c3){return{'name':_0x1114c3['fieldName'],'type':_0x1114c3['type'][_0x804b('0x30')]};});_0x1359a6['model']=_[_0x804b('0x2d')](_0xb606fe,_0x804b('0x2a'));_0x1359a6['query']=_[_0x804b('0x31')](_0x3467d5['query']);_0x1359a6[_0x804b('0x32')]=_['intersection'](_0x1359a6[_0x804b('0x33')],_0x1359a6[_0x804b('0x34')]);_0x43097d[_0x804b('0x35')]=_[_0x804b('0x36')](_0x1359a6[_0x804b('0x33')],qs[_0x804b('0x37')](_0x3467d5[_0x804b('0x34')][_0x804b('0x37')]));_0x43097d[_0x804b('0x35')]=_0x43097d[_0x804b('0x35')]['length']?_0x43097d[_0x804b('0x35')]:_0x1359a6[_0x804b('0x33')];if(!_0x3467d5['query'][_0x804b('0x38')]('nolimit')){_0x43097d[_0x804b('0x1f')]=qs['limit'](_0x3467d5[_0x804b('0x34')][_0x804b('0x1f')]);_0x43097d[_0x804b('0x1d')]=qs['offset'](_0x3467d5['query'][_0x804b('0x1d')]);}_0x43097d[_0x804b('0x39')]=qs[_0x804b('0x3a')](_0x3467d5[_0x804b('0x34')][_0x804b('0x3a')]);_0x43097d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x3c')](_0x3467d5['query'],_0x1359a6['filters']),_0xb606fe);if(_0x3467d5[_0x804b('0x34')][_0x804b('0x3d')]){_0x43097d[_0x804b('0x3b')]=_[_0x804b('0x3e')](_0x43097d[_0x804b('0x3b')],{'$or':_['map'](_0xb606fe,function(_0x582649){if(_0x582649[_0x804b('0x3f')]!=='VIRTUAL'){var _0x84b940={};_0x84b940[_0x582649[_0x804b('0x2a')]]={'$like':'%'+_0x3467d5[_0x804b('0x34')][_0x804b('0x3d')]+'%'};return _0x84b940;}})});}_0x43097d=_['merge']({},_0x43097d,_0x3467d5[_0x804b('0x40')]);var _0x57199f={'where':_0x43097d[_0x804b('0x3b')]};return db[_0x804b('0x2e')][_0x804b('0x20')](_0x57199f)['then'](function(_0x5446c9){_0x5d6c3c['count']=_0x5446c9;if(_0x3467d5['query']['includeAll']){_0x43097d[_0x804b('0x41')]=[{'all':!![]}];}return db[_0x804b('0x2e')]['findAll'](_0x43097d);})[_0x804b('0x25')](function(_0x143602){_0x5d6c3c['rows']=_0x143602;return _0x5d6c3c;})[_0x804b('0x25')](respondWithFilteredResult(_0x16621e,_0x43097d))['catch'](handleError(_0x16621e,null));};exports[_0x804b('0x42')]=function(_0x3ee88b,_0x17fc64){var _0x40a0e3={'raw':!![],'where':{'id':_0x3ee88b[_0x804b('0x43')]['id']}},_0x428d8b={};_0x428d8b[_0x804b('0x33')]=_['keys'](db[_0x804b('0x2e')]['rawAttributes']);_0x428d8b['query']=_[_0x804b('0x31')](_0x3ee88b[_0x804b('0x34')]);_0x428d8b[_0x804b('0x32')]=_[_0x804b('0x36')](_0x428d8b['model'],_0x428d8b[_0x804b('0x34')]);_0x40a0e3[_0x804b('0x35')]=_['intersection'](_0x428d8b[_0x804b('0x33')],qs['fields'](_0x3ee88b[_0x804b('0x34')][_0x804b('0x37')]));_0x40a0e3[_0x804b('0x35')]=_0x40a0e3[_0x804b('0x35')]['length']?_0x40a0e3[_0x804b('0x35')]:_0x428d8b[_0x804b('0x33')];if(_0x3ee88b[_0x804b('0x34')][_0x804b('0x44')]){_0x40a0e3[_0x804b('0x41')]=[{'all':!![]}];}_0x40a0e3=_[_0x804b('0x3e')]({},_0x40a0e3,_0x3ee88b[_0x804b('0x40')]);return db[_0x804b('0x2e')][_0x804b('0x45')](_0x40a0e3)[_0x804b('0x25')](handleEntityNotFound(_0x17fc64,null))[_0x804b('0x25')](respondWithResult(_0x17fc64,null))[_0x804b('0x46')](handleError(_0x17fc64,null));};exports['create']=function(_0x44d1ae,_0x155c4d){return db[_0x804b('0x2e')][_0x804b('0x47')](_0x44d1ae[_0x804b('0x48')],{})[_0x804b('0x25')](function(_0x481f8b){var _0x539927=_0x44d1ae['user'][_0x804b('0x26')]({'plain':!![]});if(!_0x539927)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x539927[_0x804b('0x49')]===_0x804b('0x4a')){var _0x5ea33=_0x481f8b['get']({'plain':!![]});var _0x507329=_0x804b('0x4b');return db['UserProfileSection'][_0x804b('0x45')]({'where':{'name':_0x507329,'userProfileId':_0x539927[_0x804b('0x4c')]},'raw':!![]})[_0x804b('0x25')](function(_0x1bbfcf){if(_0x1bbfcf&&_0x1bbfcf['autoAssociation']===0x0){return db['UserProfileResource'][_0x804b('0x47')]({'name':_0x5ea33['name'],'resourceId':_0x5ea33['id'],'type':_0x1bbfcf['name'],'sectionId':_0x1bbfcf['id']},{})[_0x804b('0x25')](function(){return _0x481f8b;});}else{return _0x481f8b;}})[_0x804b('0x46')](function(_0xa051a3){logger[_0x804b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa051a3);throw _0xa051a3;});}return _0x481f8b;})[_0x804b('0x25')](respondWithResult(_0x155c4d,0xc9))[_0x804b('0x46')](handleError(_0x155c4d,null));};exports['update']=function(_0x200210,_0x2597e0){if(_0x200210[_0x804b('0x48')]['id']){delete _0x200210[_0x804b('0x48')]['id'];}return db['Variable'][_0x804b('0x45')]({'where':{'id':_0x200210['params']['id']}})['then'](handleEntityNotFound(_0x2597e0,null))[_0x804b('0x25')](saveUpdates(_0x200210[_0x804b('0x48')],null))[_0x804b('0x25')](respondWithResult(_0x2597e0,null))[_0x804b('0x46')](handleError(_0x2597e0,null));};exports[_0x804b('0x24')]=function(_0x531297,_0x324aa3){return db[_0x804b('0x2e')][_0x804b('0x45')]({'where':{'id':_0x531297[_0x804b('0x43')]['id']}})[_0x804b('0x25')](handleEntityNotFound(_0x324aa3,null))[_0x804b('0x25')](removeEntity(_0x324aa3,null))[_0x804b('0x46')](handleError(_0x324aa3,null));}; \ No newline at end of file +var _0x3dd5=['length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','Variable','fieldName','type','model','query','intersection','attributes','fields'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x3dd5,0x6e));var _0x53dd=function(_0x7afe45,_0x1fae99){_0x7afe45=_0x7afe45-0x0;var _0x336c04=_0x3dd5[_0x7afe45];return _0x336c04;};'use strict';var emlformat=require(_0x53dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53dd('0x1'));var jsonpatch=require(_0x53dd('0x2'));var rp=require('request-promise');var moment=require(_0x53dd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x53dd('0x4'));var util=require('util');var path=require(_0x53dd('0x5'));var sox=require(_0x53dd('0x6'));var csv=require(_0x53dd('0x7'));var ejs=require(_0x53dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53dd('0x9'));var squel=require('squel');var crypto=require(_0x53dd('0xa'));var jsforce=require(_0x53dd('0xb'));var deskjs=require(_0x53dd('0xc'));var toCsv=require(_0x53dd('0x7'));var querystring=require(_0x53dd('0xd'));var Papa=require('papaparse');var Redis=require(_0x53dd('0xe'));var authService=require(_0x53dd('0xf'));var qs=require(_0x53dd('0x10'));var as=require(_0x53dd('0x11'));var hardwareService=require(_0x53dd('0x12'));var logger=require(_0x53dd('0x13'))(_0x53dd('0x14'));var utils=require(_0x53dd('0x15'));var config=require(_0x53dd('0x16'));var licenseUtil=require(_0x53dd('0x17'));var db=require(_0x53dd('0x18'))['db'];function respondWithStatusCode(_0x4594f5,_0x5c1f49){_0x5c1f49=_0x5c1f49||0xcc;return function(_0xc894d7){if(_0xc894d7){return _0x4594f5[_0x53dd('0x19')](_0x5c1f49);}return _0x4594f5[_0x53dd('0x1a')](_0x5c1f49)['end']();};}function respondWithResult(_0x2c0b4c,_0x5b92a2){_0x5b92a2=_0x5b92a2||0xc8;return function(_0x56d9de){if(_0x56d9de){return _0x2c0b4c[_0x53dd('0x1a')](_0x5b92a2)[_0x53dd('0x1b')](_0x56d9de);}};}function respondWithFilteredResult(_0x12a25e,_0x60721d){return function(_0x4dc063){if(_0x4dc063){var _0xaca5de=typeof _0x60721d[_0x53dd('0x1c')]===_0x53dd('0x1d')&&typeof _0x60721d[_0x53dd('0x1e')]===_0x53dd('0x1d');var _0x2df177=_0x4dc063[_0x53dd('0x1f')];var _0x89aee1=_0xaca5de?0x0:_0x60721d[_0x53dd('0x1c')];var _0x1af828=_0xaca5de?_0x4dc063[_0x53dd('0x1f')]:_0x60721d[_0x53dd('0x1c')]+_0x60721d['limit'];var _0x4d711b;if(_0x1af828>=_0x2df177){_0x1af828=_0x2df177;_0x4d711b=0xc8;}else{_0x4d711b=0xce;}_0x12a25e['status'](_0x4d711b);return _0x12a25e[_0x53dd('0x20')](_0x53dd('0x21'),_0x89aee1+'-'+_0x1af828+'/'+_0x2df177)[_0x53dd('0x1b')](_0x4dc063);}return null;};}function patchUpdates(_0x5a575e){return function(_0x3fc50a){try{jsonpatch[_0x53dd('0x22')](_0x3fc50a,_0x5a575e,!![]);}catch(_0x22bb11){return BPromise[_0x53dd('0x23')](_0x22bb11);}return _0x3fc50a[_0x53dd('0x24')]();};}function saveUpdates(_0x19448b,_0x2b3081){return function(_0x33e885){if(_0x33e885){return _0x33e885[_0x53dd('0x25')](_0x19448b)[_0x53dd('0x26')](function(_0x1ac355){return _0x1ac355;});}return null;};}function removeEntity(_0x3de495,_0x445db9){return function(_0x409d4f){if(_0x409d4f){return _0x409d4f[_0x53dd('0x27')]()[_0x53dd('0x26')](function(){var _0x44da16=_0x409d4f[_0x53dd('0x28')]({'plain':!![]});var _0x189cb6='Variables';return db[_0x53dd('0x29')][_0x53dd('0x27')]({'where':{'type':_0x189cb6,'resourceId':_0x44da16['id']}})[_0x53dd('0x26')](function(){return _0x409d4f;});})[_0x53dd('0x26')](function(){_0x3de495[_0x53dd('0x1a')](0xcc)[_0x53dd('0x2a')]();});}};}function handleEntityNotFound(_0x37f7c1,_0x5327d5){return function(_0x3ace37){if(!_0x3ace37){_0x37f7c1[_0x53dd('0x19')](0x194);}return _0x3ace37;};}function handleError(_0x520a12,_0x5448b6){_0x5448b6=_0x5448b6||0x1f4;return function(_0x3f59de){logger[_0x53dd('0x2b')](_0x3f59de[_0x53dd('0x2c')]);if(_0x3f59de[_0x53dd('0x2d')]){delete _0x3f59de[_0x53dd('0x2d')];}_0x520a12['status'](_0x5448b6)['send'](_0x3f59de);};}exports[_0x53dd('0x2e')]=function(_0x410c9f,_0x37694c){var _0x28e35d={},_0x368942={},_0x12378f={'count':0x0,'rows':[]};var _0x315c2d=_[_0x53dd('0x2f')](db[_0x53dd('0x30')]['rawAttributes'],function(_0x156824){return{'name':_0x156824[_0x53dd('0x31')],'type':_0x156824[_0x53dd('0x32')]['key']};});_0x368942[_0x53dd('0x33')]=_[_0x53dd('0x2f')](_0x315c2d,_0x53dd('0x2d'));_0x368942[_0x53dd('0x34')]=_['keys'](_0x410c9f[_0x53dd('0x34')]);_0x368942['filters']=_[_0x53dd('0x35')](_0x368942['model'],_0x368942[_0x53dd('0x34')]);_0x28e35d[_0x53dd('0x36')]=_[_0x53dd('0x35')](_0x368942[_0x53dd('0x33')],qs[_0x53dd('0x37')](_0x410c9f[_0x53dd('0x34')][_0x53dd('0x37')]));_0x28e35d[_0x53dd('0x36')]=_0x28e35d[_0x53dd('0x36')][_0x53dd('0x38')]?_0x28e35d[_0x53dd('0x36')]:_0x368942[_0x53dd('0x33')];if(!_0x410c9f[_0x53dd('0x34')][_0x53dd('0x39')](_0x53dd('0x3a'))){_0x28e35d['limit']=qs[_0x53dd('0x1e')](_0x410c9f[_0x53dd('0x34')][_0x53dd('0x1e')]);_0x28e35d[_0x53dd('0x1c')]=qs[_0x53dd('0x1c')](_0x410c9f[_0x53dd('0x34')][_0x53dd('0x1c')]);}_0x28e35d['order']=qs[_0x53dd('0x3b')](_0x410c9f['query'][_0x53dd('0x3b')]);_0x28e35d[_0x53dd('0x3c')]=qs[_0x53dd('0x3d')](_['pick'](_0x410c9f[_0x53dd('0x34')],_0x368942['filters']),_0x315c2d);if(_0x410c9f[_0x53dd('0x34')]['filter']){_0x28e35d[_0x53dd('0x3c')]=_[_0x53dd('0x3e')](_0x28e35d[_0x53dd('0x3c')],{'$or':_['map'](_0x315c2d,function(_0x20384a){if(_0x20384a[_0x53dd('0x32')]!==_0x53dd('0x3f')){var _0x4b5e2f={};_0x4b5e2f[_0x20384a[_0x53dd('0x2d')]]={'$like':'%'+_0x410c9f[_0x53dd('0x34')]['filter']+'%'};return _0x4b5e2f;}})});}_0x28e35d=_['merge']({},_0x28e35d,_0x410c9f[_0x53dd('0x40')]);var _0x55b44e={'where':_0x28e35d[_0x53dd('0x3c')]};return db[_0x53dd('0x30')][_0x53dd('0x1f')](_0x55b44e)[_0x53dd('0x26')](function(_0x2494e2){_0x12378f['count']=_0x2494e2;if(_0x410c9f[_0x53dd('0x34')][_0x53dd('0x41')]){_0x28e35d['include']=[{'all':!![]}];}return db['Variable'][_0x53dd('0x42')](_0x28e35d);})[_0x53dd('0x26')](function(_0x1e0d10){_0x12378f[_0x53dd('0x43')]=_0x1e0d10;return _0x12378f;})['then'](respondWithFilteredResult(_0x37694c,_0x28e35d))['catch'](handleError(_0x37694c,null));};exports[_0x53dd('0x44')]=function(_0x40c210,_0x1a1452){var _0x52bf8b={'raw':!![],'where':{'id':_0x40c210[_0x53dd('0x45')]['id']}},_0x39d04c={};_0x39d04c['model']=_[_0x53dd('0x46')](db[_0x53dd('0x30')][_0x53dd('0x47')]);_0x39d04c[_0x53dd('0x34')]=_[_0x53dd('0x46')](_0x40c210[_0x53dd('0x34')]);_0x39d04c['filters']=_['intersection'](_0x39d04c['model'],_0x39d04c['query']);_0x52bf8b[_0x53dd('0x36')]=_[_0x53dd('0x35')](_0x39d04c[_0x53dd('0x33')],qs['fields'](_0x40c210['query'][_0x53dd('0x37')]));_0x52bf8b['attributes']=_0x52bf8b[_0x53dd('0x36')][_0x53dd('0x38')]?_0x52bf8b[_0x53dd('0x36')]:_0x39d04c['model'];if(_0x40c210['query'][_0x53dd('0x41')]){_0x52bf8b[_0x53dd('0x48')]=[{'all':!![]}];}_0x52bf8b=_['merge']({},_0x52bf8b,_0x40c210[_0x53dd('0x40')]);return db['Variable'][_0x53dd('0x49')](_0x52bf8b)['then'](handleEntityNotFound(_0x1a1452,null))[_0x53dd('0x26')](respondWithResult(_0x1a1452,null))[_0x53dd('0x4a')](handleError(_0x1a1452,null));};exports[_0x53dd('0x4b')]=function(_0x296bca,_0x546a9c){return db['Variable'][_0x53dd('0x4b')](_0x296bca[_0x53dd('0x4c')],{})[_0x53dd('0x26')](function(_0x4520b6){var _0x5466f8=_0x296bca[_0x53dd('0x4d')][_0x53dd('0x28')]({'plain':!![]});if(!_0x5466f8)throw new Error(_0x53dd('0x4e'));if(_0x5466f8[_0x53dd('0x4f')]===_0x53dd('0x4d')){var _0x3de082=_0x4520b6[_0x53dd('0x28')]({'plain':!![]});var _0x41fb4c='Variables';return db['UserProfileSection'][_0x53dd('0x49')]({'where':{'name':_0x41fb4c,'userProfileId':_0x5466f8[_0x53dd('0x50')]},'raw':!![]})[_0x53dd('0x26')](function(_0xf71238){if(_0xf71238&&_0xf71238[_0x53dd('0x51')]===0x0){return db[_0x53dd('0x29')][_0x53dd('0x4b')]({'name':_0x3de082[_0x53dd('0x2d')],'resourceId':_0x3de082['id'],'type':_0xf71238[_0x53dd('0x2d')],'sectionId':_0xf71238['id']},{})[_0x53dd('0x26')](function(){return _0x4520b6;});}else{return _0x4520b6;}})[_0x53dd('0x4a')](function(_0x536aa0){logger[_0x53dd('0x2b')](_0x53dd('0x52'),_0x536aa0);throw _0x536aa0;});}return _0x4520b6;})['then'](respondWithResult(_0x546a9c,0xc9))['catch'](handleError(_0x546a9c,null));};exports['update']=function(_0x4f3653,_0x5f2f90){if(_0x4f3653[_0x53dd('0x4c')]['id']){delete _0x4f3653['body']['id'];}return db[_0x53dd('0x30')]['find']({'where':{'id':_0x4f3653[_0x53dd('0x45')]['id']}})[_0x53dd('0x26')](handleEntityNotFound(_0x5f2f90,null))['then'](saveUpdates(_0x4f3653[_0x53dd('0x4c')],null))[_0x53dd('0x26')](respondWithResult(_0x5f2f90,null))['catch'](handleError(_0x5f2f90,null));};exports['destroy']=function(_0x100b65,_0x44d740){return db[_0x53dd('0x30')][_0x53dd('0x49')]({'where':{'id':_0x100b65[_0x53dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x44d740,null))[_0x53dd('0x26')](removeEntity(_0x44d740,null))['catch'](handleError(_0x44d740,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6de9465..3162195 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 _0xff84=['moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger'];(function(_0x3f3a47,_0x28f84b){var _0x57a682=function(_0x1175d3){while(--_0x1175d3){_0x3f3a47['push'](_0x3f3a47['shift']());}};_0x57a682(++_0x28f84b);}(_0xff84,0x99));var _0x4ff8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xff84[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var logger=require(_0x4ff8('0x2'))('api');var moment=require(_0x4ff8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ff8('0x4'));var fs=require('fs');var path=require(_0x4ff8('0x5'));var rimraf=require(_0x4ff8('0x6'));var config=require(_0x4ff8('0x7'));var attributes=require(_0x4ff8('0x8'));module[_0x4ff8('0x9')]=function(_0x1c292f,_0xc1ee81){return _0x1c292f[_0x4ff8('0xa')]('Variable',attributes,{'tableName':_0x4ff8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x514a=['define','tools_variables','lodash','api','bluebird','rimraf','./variable.attributes','exports'];(function(_0x5a364a,_0x1269aa){var _0xb5ae53=function(_0x4fbd0f){while(--_0x4fbd0f){_0x5a364a['push'](_0x5a364a['shift']());}};_0xb5ae53(++_0x1269aa);}(_0x514a,0xd2));var _0xa514=function(_0x11f632,_0x32526f){_0x11f632=_0x11f632-0x0;var _0x24b98a=_0x514a[_0x11f632];return _0x24b98a;};'use strict';var _=require(_0xa514('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa514('0x1'));var moment=require('moment');var BPromise=require(_0xa514('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa514('0x3'));var config=require('../../config/environment');var attributes=require(_0xa514('0x4'));module[_0xa514('0x5')]=function(_0x13c048,_0x58e2e5){return _0x13c048[_0xa514('0x6')]('Variable',attributes,{'tableName':_0xa514('0x7'),'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 b807ac3..be8e990 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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x2cb8ed,_0x4640f4){var _0x32f29f=function(_0x3c0561){while(--_0x3c0561){_0x2cb8ed['push'](_0x2cb8ed['shift']());}};_0x32f29f(++_0x4640f4);}(_0x6aa7,0x178));var _0x76aa=function(_0x3ce573,_0x59a4d4){_0x3ce573=_0x3ce573-0x0;var _0x110cc8=_0x6aa7[_0x3ce573];return _0x110cc8;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20e1fd,_0x506bf0){var _0x3be635=function(_0x530079){while(--_0x530079){_0x20e1fd['push'](_0x20e1fd['shift']());}};_0x3be635(++_0x506bf0);}(_0x8ef6,0xf2));var _0x68ef=function(_0x205a48,_0xca80ba){_0x205a48=_0x205a48-0x0;var _0x559c6c=_0x8ef6[_0x205a48];return _0x559c6c;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 06bbb6e..9a2045a 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 _0x2c24=['exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','/restart','/migrations'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2c24,0x197));var _0x42c2=function(_0x31c9f0,_0x454aa7){_0x31c9f0=_0x31c9f0-0x0;var _0x4e6a59=_0x2c24[_0x31c9f0];return _0x4e6a59;};'use strict';var express=require(_0x42c2('0x0'));var router=express[_0x42c2('0x1')]();var auth=require(_0x42c2('0x2'));var controller=require('./version.controller');router[_0x42c2('0x3')]('/',controller[_0x42c2('0x4')]);router[_0x42c2('0x3')](_0x42c2('0x5'),auth[_0x42c2('0x6')](),auth[_0x42c2('0x7')](),controller[_0x42c2('0x8')]);router['get']('/reset',auth[_0x42c2('0x6')](),auth[_0x42c2('0x7')](),controller[_0x42c2('0x9')]);router[_0x42c2('0x3')](_0x42c2('0xa'),auth[_0x42c2('0x6')](),auth[_0x42c2('0x7')](),controller['pull']);router[_0x42c2('0x3')](_0x42c2('0xb'),auth[_0x42c2('0x6')](),controller['restart']);router['get'](_0x42c2('0xc'),controller['migrations']);module[_0x42c2('0xd')]=router; \ No newline at end of file +var _0x91dc=['express','Router','../../components/auth/service','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','restart','/migrations','migrations','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x91dc,0x1b0));var _0xc91d=function(_0x28624b,_0x5555c7){_0x28624b=_0x28624b-0x0;var _0x4e0602=_0x91dc[_0x28624b];return _0x4e0602;};'use strict';var express=require(_0xc91d('0x0'));var router=express[_0xc91d('0x1')]();var auth=require(_0xc91d('0x2'));var controller=require('./version.controller');router[_0xc91d('0x3')]('/',controller[_0xc91d('0x4')]);router[_0xc91d('0x3')]('/fetch',auth[_0xc91d('0x5')](),auth[_0xc91d('0x6')](),controller[_0xc91d('0x7')]);router[_0xc91d('0x3')](_0xc91d('0x8'),auth[_0xc91d('0x5')](),auth[_0xc91d('0x6')](),controller[_0xc91d('0x9')]);router['get'](_0xc91d('0xa'),auth[_0xc91d('0x5')](),auth[_0xc91d('0x6')](),controller[_0xc91d('0xb')]);router[_0xc91d('0x3')]('/restart',auth[_0xc91d('0x5')](),controller[_0xc91d('0xc')]);router['get'](_0xc91d('0xd'),controller[_0xc91d('0xe')]);module[_0xc91d('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 950a399..8b1b758 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 _0x4e74=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','catch','migrations','join','server','push','length','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','.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/pm2','../../config/logger','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x4e74,0xde));var _0x44e7=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x4e74[_0x5959c9];return _0x4ffcbc;};'use strict';var Umzug=require(_0x44e7('0x0'));var path=require(_0x44e7('0x1'));var fs=require('fs');var _=require(_0x44e7('0x2'));var pkginfo=require(_0x44e7('0x3'))(module,_0x44e7('0x4'));var compareVersions=require(_0x44e7('0x5'));var exec=require(_0x44e7('0x6'))[_0x44e7('0x7')];var db=require(_0x44e7('0x8'))['db'];var config=require('../../config/environment');var pm2=require(_0x44e7('0x9'));var logger=require(_0x44e7('0xa'))('update');var git=require('simple-git')(config[_0x44e7('0xb')]);exports[_0x44e7('0xc')]=function(_0x5242b9,_0x525653){var _0xec544a={'current':module[_0x44e7('0xd')][_0x44e7('0x4')],'phonebar':0x2};if(_0x5242b9[_0x44e7('0xe')]&&_0x5242b9[_0x44e7('0xe')][_0x44e7('0xf')]){return git[_0x44e7('0x10')]()[_0x44e7('0x11')](function(_0x3614d5,_0x254990){_0xec544a['latest']=(_0x3614d5?module[_0x44e7('0xd')][_0x44e7('0x4')]:_0x254990[_0x44e7('0xf')])||_0x44e7('0x12');return _0x525653['status'](0xc8)[_0x44e7('0x13')](_0xec544a);});}else{return _0x525653[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')](_0xec544a);}};exports[_0x44e7('0x10')]=function(_0x4bda35,_0xf6b9dc){return git[_0x44e7('0x10')]([_0x44e7('0x15'),'master'],function(_0x4b0cf0){if(_0x4b0cf0){logger[_0x44e7('0x16')](_0x4b0cf0);return _0xf6b9dc[_0x44e7('0x14')](0x1f4)['json'](_0x4b0cf0);}logger[_0x44e7('0x17')](_0x44e7('0x18'));return _0xf6b9dc[_0x44e7('0x14')](0xc8)['json']({'output':_0x44e7('0x19')});});};exports['reset']=function(_0x4b3253,_0x263d76){return git[_0x44e7('0x1a')](['--hard',_0x44e7('0x1b')],function(_0x20801f){if(_0x20801f){logger[_0x44e7('0x16')](_0x20801f);return _0x263d76[_0x44e7('0x14')](0x1f4)[_0x44e7('0x13')](_0x20801f);}logger['info'](_0x44e7('0x1c'));return _0x263d76[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')]({'output':_0x44e7('0x1d')});});};exports[_0x44e7('0x1e')]=function(_0x320c35,_0x2bdccb){exec(_0x44e7('0x1f'),function(_0x3427d4,_0x44c2ce,_0x57e3ef){logger[_0x44e7('0x17')](_0x44c2ce);logger[_0x44e7('0x17')](_0x57e3ef);if(_0x3427d4){logger[_0x44e7('0x16')](_0x3427d4);return _0x2bdccb['status'](0x1f4)[_0x44e7('0x13')](_0x3427d4);}return _0x2bdccb['status'](0xc8)[_0x44e7('0x13')]({'output':_0x44c2ce});});};exports[_0x44e7('0x20')]=function(_0x267206,_0x3a660d){return pm2[_0x44e7('0x20')]('motion2')['then'](function(_0x573ff6){logger[_0x44e7('0x17')](_0x44e7('0x21'),_0x573ff6);return _0x3a660d[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x44e7('0x22')](function(_0xae5020){logger[_0x44e7('0x16')](_0xae5020);return _0x3a660d[_0x44e7('0x14')](0x1f4)[_0x44e7('0x13')](_0xae5020);});};exports[_0x44e7('0x23')]=function(_0x32a5ec,_0x15304e){var _0x4bdccc=fs['readdirSync'](path[_0x44e7('0x24')](config[_0x44e7('0xb')],_0x44e7('0x25'),_0x44e7('0x23')));var _0xdf4ecf=[];for(var _0x5ce820=0x0;_0x5ce820<_0x4bdccc['length'];_0x5ce820++){var _0x383f77=_0x4bdccc[_0x5ce820]['replace']('.js','');if(compareVersions(module[_0x44e7('0xd')]['version'],_0x383f77)===-0x1){_0xdf4ecf[_0x44e7('0x26')](_0x383f77);}}if(_0xdf4ecf[_0x44e7('0x27')]){var _0x411485=_0xdf4ecf['sort'](compareVersions);var _0x46ef62=new Umzug({'storage':_0x44e7('0x28'),'storageOptions':{'model':db[_0x44e7('0x29')],'modelName':_0x44e7('0x29'),'columnName':_0x44e7('0x4')},'migrations':{'params':[db[_0x44e7('0x28')]['getQueryInterface'](),db['sequelize'][_0x44e7('0x2a')],function(){throw new Error(_0x44e7('0x2b'));}],'path':path[_0x44e7('0x24')](config[_0x44e7('0xb')],_0x44e7('0x25'),_0x44e7('0x23')),'pattern':/\.js$/}});_0x46ef62['up']({'migrations':_['map'](_0x411485,function(_0x41ba85){return _0x41ba85+_0x44e7('0x2c');})})['then'](function(){return _0x15304e[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')]({'output':_0x44e7('0x2d')+module['exports'][_0x44e7('0x4')]+_0x44e7('0x2e')+_[_0x44e7('0x2f')](_0x411485),'migrations':_['join'](_0x411485)});})[_0x44e7('0x22')](function(_0x3dfeba){if(_0x3dfeba instanceof db[_0x44e7('0x28')][_0x44e7('0x30')]){return _0x15304e[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')]({'output':_0x44e7('0x31')});}else{return _0x15304e[_0x44e7('0x14')](0x1f4)[_0x44e7('0x13')](_0x3dfeba);}});}else{return _0x15304e[_0x44e7('0x14')](0xc8)[_0x44e7('0x13')]({'output':_0x44e7('0x31')});}}; \ No newline at end of file +var _0x52bb=['lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x52bb,0xda));var _0xb52b=function(_0x490e39,_0x4b511a){_0x490e39=_0x490e39-0x0;var _0x30e0c4=_0x52bb[_0x490e39];return _0x30e0c4;};'use strict';var Umzug=require(_0xb52b('0x0'));var path=require(_0xb52b('0x1'));var fs=require('fs');var _=require(_0xb52b('0x2'));var pkginfo=require(_0xb52b('0x3'))(module,_0xb52b('0x4'));var compareVersions=require(_0xb52b('0x5'));var exec=require('child_process')[_0xb52b('0x6')];var db=require(_0xb52b('0x7'))['db'];var config=require(_0xb52b('0x8'));var pm2=require(_0xb52b('0x9'));var logger=require(_0xb52b('0xa'))(_0xb52b('0xb'));var git=require(_0xb52b('0xc'))(config['root']);exports[_0xb52b('0xd')]=function(_0x22d61b,_0xfaf988){var _0xcdb71e={'current':module[_0xb52b('0xe')][_0xb52b('0x4')],'phonebar':0x2};if(_0x22d61b[_0xb52b('0xf')]&&_0x22d61b[_0xb52b('0xf')][_0xb52b('0x10')]){return git[_0xb52b('0x11')]()[_0xb52b('0x12')](function(_0x117fd3,_0x3627e8){_0xcdb71e[_0xb52b('0x10')]=(_0x117fd3?module[_0xb52b('0xe')][_0xb52b('0x4')]:_0x3627e8[_0xb52b('0x10')])||_0xb52b('0x13');return _0xfaf988[_0xb52b('0x14')](0xc8)['json'](_0xcdb71e);});}else{return _0xfaf988['status'](0xc8)[_0xb52b('0x15')](_0xcdb71e);}};exports[_0xb52b('0x11')]=function(_0xf0efdb,_0x251245){return git[_0xb52b('0x11')]([_0xb52b('0x16'),_0xb52b('0x17')],function(_0x3b8415){if(_0x3b8415){logger['error'](_0x3b8415);return _0x251245[_0xb52b('0x14')](0x1f4)[_0xb52b('0x15')](_0x3b8415);}logger[_0xb52b('0x18')]('git\x20fetch');return _0x251245[_0xb52b('0x14')](0xc8)[_0xb52b('0x15')]({'output':_0xb52b('0x19')});});};exports['reset']=function(_0x20278f,_0xeb77e6){return git['reset']([_0xb52b('0x1a'),_0xb52b('0x1b')],function(_0x30d9f6){if(_0x30d9f6){logger[_0xb52b('0x1c')](_0x30d9f6);return _0xeb77e6[_0xb52b('0x14')](0x1f4)['json'](_0x30d9f6);}logger[_0xb52b('0x18')](_0xb52b('0x1d'));return _0xeb77e6['status'](0xc8)[_0xb52b('0x15')]({'output':_0xb52b('0x1e')});});};exports[_0xb52b('0x1f')]=function(_0x43f7fd,_0x422262){exec('npm\x20install\x20--production',function(_0x400d42,_0x4b8448,_0x3df36d){logger['info'](_0x4b8448);logger[_0xb52b('0x18')](_0x3df36d);if(_0x400d42){logger[_0xb52b('0x1c')](_0x400d42);return _0x422262[_0xb52b('0x14')](0x1f4)[_0xb52b('0x15')](_0x400d42);}return _0x422262[_0xb52b('0x14')](0xc8)[_0xb52b('0x15')]({'output':_0x4b8448});});};exports['restart']=function(_0x662b44,_0x3ee424){return pm2['restart'](_0xb52b('0x20'))['then'](function(_0x26dd05){logger[_0xb52b('0x18')](_0xb52b('0x21'),_0x26dd05);return _0x3ee424[_0xb52b('0x14')](0xc8)[_0xb52b('0x15')]({'output':_0xb52b('0x22')});})[_0xb52b('0x23')](function(_0x2c9ea0){logger[_0xb52b('0x1c')](_0x2c9ea0);return _0x3ee424['status'](0x1f4)[_0xb52b('0x15')](_0x2c9ea0);});};exports[_0xb52b('0x24')]=function(_0x15049e,_0x4fa639){var _0x164d18=fs[_0xb52b('0x25')](path[_0xb52b('0x26')](config[_0xb52b('0x27')],_0xb52b('0x28'),_0xb52b('0x24')));var _0x2ea71a=[];for(var _0x2aa2ad=0x0;_0x2aa2ad<_0x164d18[_0xb52b('0x29')];_0x2aa2ad++){var _0x17d602=_0x164d18[_0x2aa2ad][_0xb52b('0x2a')](_0xb52b('0x2b'),'');if(compareVersions(module['exports'][_0xb52b('0x4')],_0x17d602)===-0x1){_0x2ea71a[_0xb52b('0x2c')](_0x17d602);}}if(_0x2ea71a[_0xb52b('0x29')]){var _0x398e2e=_0x2ea71a[_0xb52b('0x2d')](compareVersions);var _0x33d798=new Umzug({'storage':_0xb52b('0x2e'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xb52b('0x2e')][_0xb52b('0x2f')](),db['sequelize']['constructor'],function(){throw new Error(_0xb52b('0x30'));}],'path':path[_0xb52b('0x26')](config[_0xb52b('0x27')],'server',_0xb52b('0x24')),'pattern':/\.js$/}});_0x33d798['up']({'migrations':_[_0xb52b('0x31')](_0x398e2e,function(_0x269fca){return _0x269fca+'.js';})})[_0xb52b('0x32')](function(){return _0x4fa639['status'](0xc8)[_0xb52b('0x15')]({'output':_0xb52b('0x33')+module[_0xb52b('0xe')][_0xb52b('0x4')]+'\x20to\x20'+_[_0xb52b('0x34')](_0x398e2e),'migrations':_[_0xb52b('0x26')](_0x398e2e)});})['catch'](function(_0x494de2){if(_0x494de2 instanceof db[_0xb52b('0x2e')][_0xb52b('0x35')]){return _0x4fa639[_0xb52b('0x14')](0xc8)['json']({'output':_0xb52b('0x36')});}else{return _0x4fa639[_0xb52b('0x14')](0x1f4)[_0xb52b('0x15')](_0x494de2);}});}else{return _0x4fa639['status'](0xc8)[_0xb52b('0x15')]({'output':_0xb52b('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 529df50..698d9d7 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 _0x6375=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x661503,_0x2eb445){var _0x3c840d=function(_0x8629b){while(--_0x8629b){_0x661503['push'](_0x661503['shift']());}};_0x3c840d(++_0x2eb445);}(_0x6375,0x99));var _0x5637=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x6375[_0x2f3ecd];return _0xffdc44;};'use strict';var multer=require('multer');var util=require(_0x5637('0x0'));var path=require(_0x5637('0x1'));var timeout=require(_0x5637('0x2'));var express=require('express');var router=express[_0x5637('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5637('0x4'));var interaction=require(_0x5637('0x5'));var config=require(_0x5637('0x6'));var controller=require(_0x5637('0x7'));router[_0x5637('0x8')]('/',auth[_0x5637('0x9')](),controller[_0x5637('0xa')]);router[_0x5637('0x8')](_0x5637('0xb'),auth[_0x5637('0x9')](),controller['describe']);router[_0x5637('0x8')]('/:id',auth[_0x5637('0x9')](),controller[_0x5637('0xc')]);router[_0x5637('0xd')]('/',auth[_0x5637('0x9')](),controller[_0x5637('0xe')]);router[_0x5637('0xf')]('/:id',auth[_0x5637('0x9')](),controller[_0x5637('0x10')]);router['delete'](_0x5637('0x11'),auth[_0x5637('0x9')](),controller[_0x5637('0x12')]);module[_0x5637('0x13')]=router; \ No newline at end of file +var _0x5f07=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x17d314,_0x4c6cc8){var _0x58e7d3=function(_0x33a2c3){while(--_0x33a2c3){_0x17d314['push'](_0x17d314['shift']());}};_0x58e7d3(++_0x4c6cc8);}(_0x5f07,0x96));var _0x75f0=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x5f07[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x75f0('0x0'));var util=require(_0x75f0('0x1'));var path=require(_0x75f0('0x2'));var timeout=require(_0x75f0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x75f0('0x4'));var auth=require(_0x75f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x75f0('0x6'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x75f0('0x7')](),controller[_0x75f0('0x8')]);router[_0x75f0('0x9')](_0x75f0('0xa'),auth[_0x75f0('0x7')](),controller[_0x75f0('0xb')]);router[_0x75f0('0x9')](_0x75f0('0xc'),auth[_0x75f0('0x7')](),controller[_0x75f0('0xd')]);router[_0x75f0('0xe')]('/',auth['isAuthenticated'](),controller[_0x75f0('0xf')]);router[_0x75f0('0x10')](_0x75f0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x75f0('0x11')](_0x75f0('0xc'),auth[_0x75f0('0x7')](),controller[_0x75f0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 616ded2..7552212 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 _0x3cae=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x273760,_0x35383c){var _0xa04872=function(_0x344a30){while(--_0x344a30){_0x273760['push'](_0x273760['shift']());}};_0xa04872(++_0x35383c);}(_0x3cae,0x117));var _0xe3ca=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x3cae[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'type':{'type':Sequelize[_0xe3ca('0x2')]},'uniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'calleridnum':{'type':Sequelize[_0xe3ca('0x2')]},'calleridname':{'type':Sequelize[_0xe3ca('0x2')]},'queue':{'type':Sequelize[_0xe3ca('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe3ca('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe3ca('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xe3ca('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe3ca('0x3')]},'holdtime':{'type':Sequelize[_0xe3ca('0x4')]},'agentcomplete':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe3ca('0x4')]},'agentacw':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe3ca('0x4')]},'reason':{'type':Sequelize[_0xe3ca('0x2')]},'lastevent':{'type':Sequelize[_0xe3ca('0x2')]},'channel':{'type':Sequelize[_0xe3ca('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe3ca('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe3ca('0x2')]},'language':{'type':Sequelize[_0xe3ca('0x2')]},'accountcode':{'type':Sequelize[_0xe3ca('0x2')]},'context':{'type':Sequelize[_0xe3ca('0x2')]},'exten':{'type':Sequelize[_0xe3ca('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe3ca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe3ca('0x2')]},'destcalleridname':{'type':Sequelize[_0xe3ca('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe3ca('0x2')]},'destlanguage':{'type':Sequelize[_0xe3ca('0x2')]},'destaccountcode':{'type':Sequelize[_0xe3ca('0x2')]},'destcontext':{'type':Sequelize[_0xe3ca('0x2')]},'destexten':{'type':Sequelize[_0xe3ca('0x2')]},'destpriority':{'type':Sequelize[_0xe3ca('0x2')]},'destuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe3ca('0x2')],'comment':_0xe3ca('0x6')},'transferexten':{'type':Sequelize[_0xe3ca('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'agententerreason':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc692=['DATE','BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc692,0x15f));var _0x2c69=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xc692[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'type':{'type':Sequelize[_0x2c69('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2c69('0x2')]},'queue':{'type':Sequelize[_0x2c69('0x2')]},'interface':{'type':Sequelize[_0x2c69('0x2')]},'membername':{'type':Sequelize[_0x2c69('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2c69('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2c69('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x2c69('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x2c69('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x2c69('0x5')]},'agentacw':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2c69('0x5')]},'reason':{'type':Sequelize[_0x2c69('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2c69('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2c69('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2c69('0x2')]},'language':{'type':Sequelize[_0x2c69('0x2')]},'accountcode':{'type':Sequelize[_0x2c69('0x2')]},'context':{'type':Sequelize[_0x2c69('0x2')]},'exten':{'type':Sequelize[_0x2c69('0x2')]},'priority':{'type':Sequelize[_0x2c69('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2c69('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x2c69('0x2')]},'destcalleridname':{'type':Sequelize[_0x2c69('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2c69('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2c69('0x2')]},'destlanguage':{'type':Sequelize[_0x2c69('0x2')]},'destaccountcode':{'type':Sequelize[_0x2c69('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2c69('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2c69('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2c69('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2c69('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2c69('0x2')]},'agententerreason':{'type':Sequelize[_0x2c69('0x5')],'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 ca4b2e4..cf3ced9 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(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 0782272..8dd59fb 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 _0xb4c7=['moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','report_agent','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5b9d32,_0x2ac591){var _0x3e0a34=function(_0x4efac5){while(--_0x4efac5){_0x5b9d32['push'](_0x5b9d32['shift']());}};_0x3e0a34(++_0x2ac591);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x19b6e2,_0x5bd732){_0x19b6e2=_0x19b6e2-0x0;var _0xe9ba2=_0xb4c7[_0x19b6e2];return _0xe9ba2;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7b4c('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb99=['../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x3ea673,_0x5d17cd){var _0x57e43d=function(_0x3c27f8){while(--_0x3c27f8){_0x3ea673['push'](_0x3ea673['shift']());}};_0x57e43d(++_0x5d17cd);}(_0xcb99,0x8b));var _0x9cb9=function(_0x554b32,_0x577efd){_0x554b32=_0x554b32-0x0;var _0x2d896d=_0xcb99[_0x554b32];return _0x2d896d;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x9cb9('0xa'),_0x9cb9('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 6329eae..b6cb210 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 _0x6481=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','limit'];(function(_0xd4393f,_0x15acbb){var _0x293c96=function(_0x43f1c2){while(--_0x43f1c2){_0xd4393f['push'](_0xd4393f['shift']());}};_0x293c96(++_0x15acbb);}(_0x6481,0xc6));var _0x1648=function(_0x2be05d,_0x1c69aa){_0x2be05d=_0x2be05d-0x0;var _0x3d5f7a=_0x6481[_0x2be05d];return _0x3d5f7a;};'use strict';var _=require('lodash');var util=require(_0x1648('0x0'));var moment=require(_0x1648('0x1'));var BPromise=require(_0x1648('0x2'));var rs=require(_0x1648('0x3'));var fs=require('fs');var Redis=require(_0x1648('0x4'));var db=require(_0x1648('0x5'))['db'];var utils=require(_0x1648('0x6'));var logger=require(_0x1648('0x7'))(_0x1648('0x8'));var config=require(_0x1648('0x9'));var jayson=require(_0x1648('0xa'));var client=jayson[_0x1648('0xb')][_0x1648('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x217f4c,_0xd82861,_0x166612){return new BPromise(function(_0x14967f,_0x475101){return client[_0x1648('0xd')](_0x217f4c,_0x166612)[_0x1648('0xe')](function(_0x150ef4){logger[_0x1648('0xf')](_0x1648('0x10'),_0xd82861,_0x1648('0x11'));logger[_0x1648('0x12')](_0x1648('0x13'),_0xd82861,'request\x20sent',JSON[_0x1648('0x14')](_0x150ef4));if(_0x150ef4['error']){if(_0x150ef4[_0x1648('0x15')][_0x1648('0x16')]===0x1f4){logger[_0x1648('0x15')](_0x1648('0x10'),_0xd82861,_0x150ef4[_0x1648('0x15')]['message']);return _0x475101(_0x150ef4[_0x1648('0x15')][_0x1648('0x17')]);}logger[_0x1648('0x15')](_0x1648('0x10'),_0xd82861,_0x150ef4[_0x1648('0x15')][_0x1648('0x17')]);return _0x14967f(_0x150ef4[_0x1648('0x15')][_0x1648('0x17')]);}else{logger[_0x1648('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0xd82861,_0x1648('0x11'));_0x14967f(_0x150ef4['result'][_0x1648('0x17')]);}})[_0x1648('0x18')](function(_0x155107){logger['error'](_0x1648('0x10'),_0xd82861,_0x155107);_0x475101(_0x155107);});});}exports['CreateVoiceAgentReport']=function(_0x28752d){var _0x546098=this;return new Promise(function(_0x4be25c,_0x501290){return db[_0x1648('0x19')][_0x1648('0x1a')](_0x28752d[_0x1648('0x1b')],{'raw':_0x28752d[_0x1648('0x1c')]?_0x28752d[_0x1648('0x1c')][_0x1648('0x1d')]===undefined?!![]:![]:!![]})[_0x1648('0xe')](function(_0x437866){logger['info'](_0x1648('0x1e'),_0x28752d);logger[_0x1648('0x12')]('CreateVoiceAgentReport',_0x28752d,JSON[_0x1648('0x14')](_0x437866));_0x4be25c(_0x437866);})[_0x1648('0x18')](function(_0x25f9ad){logger[_0x1648('0x15')]('CreateVoiceAgentReport',_0x25f9ad['message'],_0x28752d);_0x501290(_0x546098['error'](0x1f4,_0x25f9ad[_0x1648('0x17')]));});});};exports[_0x1648('0x1f')]=function(_0x121d43){var _0x1a9529=this;return new Promise(function(_0x3642b1,_0x520454){return db[_0x1648('0x19')]['update'](_0x121d43[_0x1648('0x1b')],{'raw':_0x121d43[_0x1648('0x1c')]?_0x121d43[_0x1648('0x1c')][_0x1648('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x121d43[_0x1648('0x1c')]?_0x121d43[_0x1648('0x1c')]['where']||null:null,'attributes':_0x121d43[_0x1648('0x1c')]?_0x121d43['options']['attributes']||null:null,'limit':_0x121d43['options']?_0x121d43['options'][_0x1648('0x20')]||null:null})[_0x1648('0xe')](function(_0x4a39d4){logger[_0x1648('0xf')](_0x1648('0x1f'),_0x121d43);logger[_0x1648('0x12')]('UpdateVoiceAgentReport',_0x121d43,JSON[_0x1648('0x14')](_0x4a39d4));_0x3642b1(_0x4a39d4);})[_0x1648('0x18')](function(_0x7c0e06){logger['error'](_0x1648('0x1f'),_0x7c0e06['message'],_0x121d43);_0x520454(_0x1a9529[_0x1648('0x15')](0x1f4,_0x7c0e06['message']));});});}; \ No newline at end of file +var _0x9a6f=['then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceAgentReport','body','options','raw','debug','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x854c83,_0x17f38e){var _0x4cd760=function(_0x4ca413){while(--_0x4ca413){_0x854c83['push'](_0x854c83['shift']());}};_0x4cd760(++_0x17f38e);}(_0x9a6f,0x1ac));var _0xf9a6=function(_0xf482c1,_0x32cbca){_0xf482c1=_0xf482c1-0x0;var _0x184548=_0x9a6f[_0xf482c1];return _0x184548;};'use strict';var _=require(_0xf9a6('0x0'));var util=require(_0xf9a6('0x1'));var moment=require(_0xf9a6('0x2'));var BPromise=require(_0xf9a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9a6('0x4'));var db=require(_0xf9a6('0x5'))['db'];var utils=require(_0xf9a6('0x6'));var logger=require(_0xf9a6('0x7'))(_0xf9a6('0x8'));var config=require(_0xf9a6('0x9'));var jayson=require(_0xf9a6('0xa'));var client=jayson[_0xf9a6('0xb')][_0xf9a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xea2175,_0x42149e,_0x551d65){return new BPromise(function(_0x124d60,_0x508675){return client[_0xf9a6('0xd')](_0xea2175,_0x551d65)[_0xf9a6('0xe')](function(_0x432b9d){logger[_0xf9a6('0xf')](_0xf9a6('0x10'),_0x42149e,_0xf9a6('0x11'));logger['debug'](_0xf9a6('0x12'),_0x42149e,_0xf9a6('0x11'),JSON['stringify'](_0x432b9d));if(_0x432b9d[_0xf9a6('0x13')]){if(_0x432b9d[_0xf9a6('0x13')][_0xf9a6('0x14')]===0x1f4){logger['error'](_0xf9a6('0x10'),_0x42149e,_0x432b9d[_0xf9a6('0x13')][_0xf9a6('0x15')]);return _0x508675(_0x432b9d[_0xf9a6('0x13')][_0xf9a6('0x15')]);}logger['error'](_0xf9a6('0x10'),_0x42149e,_0x432b9d['error']['message']);return _0x124d60(_0x432b9d[_0xf9a6('0x13')]['message']);}else{logger[_0xf9a6('0xf')](_0xf9a6('0x10'),_0x42149e,_0xf9a6('0x11'));_0x124d60(_0x432b9d['result'][_0xf9a6('0x15')]);}})[_0xf9a6('0x16')](function(_0x4473a9){logger[_0xf9a6('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x42149e,_0x4473a9);_0x508675(_0x4473a9);});});}exports[_0xf9a6('0x17')]=function(_0x165bd6){var _0x1cfb5e=this;return new Promise(function(_0x47e781,_0x4c246d){return db['VoiceAgentReport']['create'](_0x165bd6[_0xf9a6('0x18')],{'raw':_0x165bd6[_0xf9a6('0x19')]?_0x165bd6['options'][_0xf9a6('0x1a')]===undefined?!![]:![]:!![]})[_0xf9a6('0xe')](function(_0x3c2ab1){logger[_0xf9a6('0xf')](_0xf9a6('0x17'),_0x165bd6);logger[_0xf9a6('0x1b')](_0xf9a6('0x17'),_0x165bd6,JSON[_0xf9a6('0x1c')](_0x3c2ab1));_0x47e781(_0x3c2ab1);})['catch'](function(_0x2a4353){logger[_0xf9a6('0x13')](_0xf9a6('0x17'),_0x2a4353[_0xf9a6('0x15')],_0x165bd6);_0x4c246d(_0x1cfb5e[_0xf9a6('0x13')](0x1f4,_0x2a4353[_0xf9a6('0x15')]));});});};exports[_0xf9a6('0x1d')]=function(_0x230514){var _0x578cf7=this;return new Promise(function(_0xf52cb4,_0x107ca8){return db[_0xf9a6('0x1e')][_0xf9a6('0x1f')](_0x230514[_0xf9a6('0x18')],{'raw':_0x230514[_0xf9a6('0x19')]?_0x230514['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x230514[_0xf9a6('0x19')]?_0x230514['options']['where']||null:null,'attributes':_0x230514[_0xf9a6('0x19')]?_0x230514['options'][_0xf9a6('0x20')]||null:null,'limit':_0x230514['options']?_0x230514[_0xf9a6('0x19')][_0xf9a6('0x21')]||null:null})[_0xf9a6('0xe')](function(_0x2929eb){logger[_0xf9a6('0xf')](_0xf9a6('0x1d'),_0x230514);logger[_0xf9a6('0x1b')](_0xf9a6('0x1d'),_0x230514,JSON['stringify'](_0x2929eb));_0xf52cb4(_0x2929eb);})['catch'](function(_0x16e2f2){logger['error'](_0xf9a6('0x1d'),_0x16e2f2[_0xf9a6('0x15')],_0x230514);_0x107ca8(_0x578cf7['error'](0x1f4,_0x16e2f2[_0xf9a6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 7693fae..18b5424 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 _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0xaced19,_0x4fa58f){var _0x352cda=function(_0x26e45f){while(--_0x26e45f){_0xaced19['push'](_0xaced19['shift']());}};_0x352cda(++_0x4fa58f);}(_0x4c4e,0x152));var _0xe4c4=function(_0x3ac616,_0x2811f){_0x3ac616=_0x3ac616-0x0;var _0x2dce01=_0x4c4e[_0x3ac616];return _0x2dce01;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb66c=['./voiceCallReport.controller','get','/describe','isAuthenticated','describe','show','post','create','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xb66c,0x175));var _0xcb66=function(_0x42eed7,_0x1b67d1){_0x42eed7=_0x42eed7-0x0;var _0x2eee1d=_0xb66c[_0x42eed7];return _0x2eee1d;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),auth[_0xcb66('0xa')](),controller[_0xcb66('0xb')]);router[_0xcb66('0x8')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0xc')]);router[_0xcb66('0xd')]('/',auth[_0xcb66('0xa')](),controller[_0xcb66('0xe')]);router['put'](_0xcb66('0xf'),auth[_0xcb66('0xa')](),controller[_0xcb66('0x10')]);router[_0xcb66('0x11')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0x12')]);module[_0xcb66('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b248eaf..25a7fe5 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 _0xc8f8=['STRING','ENUM','internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x540dbb,_0x3e3903){var _0x3969f1=function(_0x484919){while(--_0x484919){_0x540dbb['push'](_0x540dbb['shift']());}};_0x3969f1(++_0x3e3903);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc8f8[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x8c8f('0x0'));module[_0x8c8f('0x1')]={'uniqueid':{'type':Sequelize[_0x8c8f('0x2')]},'type':{'type':Sequelize[_0x8c8f('0x3')]('inbound',_0x8c8f('0x4'),_0x8c8f('0x5'),'inbound-fax',_0x8c8f('0x6'),_0x8c8f('0x7'))},'tag':{'type':Sequelize[_0x8c8f('0x2')]},'accountcode':{'type':Sequelize[_0x8c8f('0x2')]},'source':{'type':Sequelize[_0x8c8f('0x2')]},'destination':{'type':Sequelize[_0x8c8f('0x2')]},'destinationcontext':{'type':Sequelize[_0x8c8f('0x2')]},'callerid':{'type':Sequelize[_0x8c8f('0x2')]},'channel':{'type':Sequelize[_0x8c8f('0x2')]},'destinationchannel':{'type':Sequelize[_0x8c8f('0x2')]},'lastapplication':{'type':Sequelize[_0x8c8f('0x2')]},'lastdata':{'type':Sequelize[_0x8c8f('0x8')]},'starttime':{'type':Sequelize[_0x8c8f('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8c8f('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x8c8f('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8c8f('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8c8f('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8c8f('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x8c8f('0xa')]},'sipcallid':{'type':Sequelize[_0x8c8f('0x2')]}}; \ No newline at end of file +var _0x7a98=['STRING','TEXT','DATE','INTEGER','sequelize','exports','inbound','internal','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x1068d3,_0xc47158){var _0xba37f4=function(_0x29b6b5){while(--_0x29b6b5){_0x1068d3['push'](_0x1068d3['shift']());}};_0xba37f4(++_0xc47158);}(_0x7a98,0x190));var _0x87a9=function(_0x55db78,_0xbd0462){_0x55db78=_0x55db78-0x0;var _0x3f995f=_0x7a98[_0x55db78];return _0x3f995f;};'use strict';var Sequelize=require(_0x87a9('0x0'));module[_0x87a9('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x87a9('0x2'),_0x87a9('0x3'),_0x87a9('0x4'),_0x87a9('0x5'),_0x87a9('0x6'),_0x87a9('0x7'))},'tag':{'type':Sequelize[_0x87a9('0x8')]},'accountcode':{'type':Sequelize[_0x87a9('0x8')]},'source':{'type':Sequelize[_0x87a9('0x8')]},'destination':{'type':Sequelize[_0x87a9('0x8')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x87a9('0x8')]},'lastapplication':{'type':Sequelize[_0x87a9('0x8')]},'lastdata':{'type':Sequelize[_0x87a9('0x9')]},'starttime':{'type':Sequelize[_0x87a9('0xa')]},'systemanswertime':{'type':Sequelize[_0x87a9('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x87a9('0xa')]},'duration':{'type':Sequelize[_0x87a9('0xb')]},'billableseconds':{'type':Sequelize[_0x87a9('0xb')]},'mohtime':{'type':Sequelize[_0x87a9('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x87a9('0x8')]},'userfield':{'type':Sequelize[_0x87a9('0x8')]},'userDisposition':{'type':Sequelize[_0x87a9('0x8')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x87a9('0x8')]},'note':{'type':Sequelize[_0x87a9('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x87a9('0xb')]},'sipcallid':{'type':Sequelize[_0x87a9('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ca15e96..da31d96 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a401c,_0x525ba9){_0x5a401c=_0x5a401c-0x0;var _0x5c38b6=_0x5f2f[_0x5a401c];return _0x5c38b6;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5c1efb,_0x4c7c72){_0x5c1efb=_0x5c1efb-0x0;var _0x522f68=_0x2032[_0x5c1efb];return _0x522f68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index fd18b0d..7c4537c 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 _0x0971=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x190780,_0xbbf4e){var _0x2e8350=function(_0x43608d){while(--_0x43608d){_0x190780['push'](_0x190780['shift']());}};_0x2e8350(++_0xbbf4e);}(_0x0971,0xc3));var _0x1097=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0971[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var logger=require(_0x1097('0x2'))(_0x1097('0x3'));var moment=require(_0x1097('0x4'));var BPromise=require(_0x1097('0x5'));var rp=require(_0x1097('0x6'));var fs=require('fs');var path=require(_0x1097('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1097('0x8'));module[_0x1097('0x9')]=function(_0x33a4c1,_0x1fe715){return _0x33a4c1[_0x1097('0xa')](_0x1097('0xb'),attributes,{'tableName':_0x1097('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x23f4=['../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0x29eb10,_0x190cb3){var _0x5371a2=function(_0x3109ea){while(--_0x3109ea){_0x29eb10['push'](_0x29eb10['shift']());}};_0x5371a2(++_0x190cb3);}(_0x23f4,0x6e));var _0x423f=function(_0x2ceb3b,_0x3a910b){_0x2ceb3b=_0x2ceb3b-0x0;var _0x29ca0d=_0x23f4[_0x2ceb3b];return _0x29ca0d;};'use strict';var _=require(_0x423f('0x0'));var util=require(_0x423f('0x1'));var logger=require(_0x423f('0x2'))(_0x423f('0x3'));var moment=require('moment');var BPromise=require(_0x423f('0x4'));var rp=require(_0x423f('0x5'));var fs=require('fs');var path=require(_0x423f('0x6'));var rimraf=require(_0x423f('0x7'));var config=require('../../config/environment');var attributes=require(_0x423f('0x8'));module[_0x423f('0x9')]=function(_0x39a58b,_0x58d236){return _0x39a58b[_0x423f('0xa')](_0x423f('0xb'),attributes,{'tableName':_0x423f('0xc'),'paranoid':![],'indexes':[{'fields':[_0x423f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index fc9d971..350ebc5 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 _0xa4d0=['include','map','attributes','model','GetVoiceCallReport','VoiceCallReport','raw','debug','CreateVoiceCallReport','UpdateVoiceCallReport','body','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','findAll','options','where','limit'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xa4d0,0x133));var _0x0a4d=function(_0x13f890,_0x3d6b97){_0x13f890=_0x13f890-0x0;var _0x4d97f9=_0xa4d0[_0x13f890];return _0x4d97f9;};'use strict';var _=require('lodash');var util=require(_0x0a4d('0x0'));var moment=require(_0x0a4d('0x1'));var BPromise=require('bluebird');var rs=require(_0x0a4d('0x2'));var fs=require('fs');var Redis=require(_0x0a4d('0x3'));var db=require(_0x0a4d('0x4'))['db'];var utils=require(_0x0a4d('0x5'));var logger=require(_0x0a4d('0x6'))(_0x0a4d('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a4d('0x8'));var client=jayson[_0x0a4d('0x9')][_0x0a4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34a8c9,_0x4b6080,_0x55e2f4){return new BPromise(function(_0x5a68f2,_0x61eeab){return client[_0x0a4d('0xb')](_0x34a8c9,_0x55e2f4)[_0x0a4d('0xc')](function(_0x540089){logger[_0x0a4d('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x4b6080,_0x0a4d('0xe'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4b6080,'request\x20sent',JSON[_0x0a4d('0xf')](_0x540089));if(_0x540089[_0x0a4d('0x10')]){if(_0x540089['error'][_0x0a4d('0x11')]===0x1f4){logger['error'](_0x0a4d('0x12'),_0x4b6080,_0x540089['error'][_0x0a4d('0x13')]);return _0x61eeab(_0x540089[_0x0a4d('0x10')]['message']);}logger[_0x0a4d('0x10')](_0x0a4d('0x12'),_0x4b6080,_0x540089['error'][_0x0a4d('0x13')]);return _0x5a68f2(_0x540089[_0x0a4d('0x10')][_0x0a4d('0x13')]);}else{logger[_0x0a4d('0xd')](_0x0a4d('0x12'),_0x4b6080,_0x0a4d('0xe'));_0x5a68f2(_0x540089[_0x0a4d('0x14')]['message']);}})[_0x0a4d('0x15')](function(_0x5f1cbe){logger[_0x0a4d('0x10')](_0x0a4d('0x12'),_0x4b6080,_0x5f1cbe);_0x61eeab(_0x5f1cbe);});});}exports['GetVoiceCallReport']=function(_0xf79947){var _0x2ff3a8=this;return new Promise(function(_0x47de30,_0x4dfb40){return db['VoiceCallReport'][_0x0a4d('0x16')]({'raw':_0xf79947[_0x0a4d('0x17')]?_0xf79947[_0x0a4d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xf79947['options']?_0xf79947[_0x0a4d('0x17')][_0x0a4d('0x18')]||null:null,'attributes':_0xf79947['options']?_0xf79947[_0x0a4d('0x17')]['attributes']||null:null,'limit':_0xf79947[_0x0a4d('0x17')]?_0xf79947[_0x0a4d('0x17')][_0x0a4d('0x19')]||null:null,'include':_0xf79947['options']?_0xf79947[_0x0a4d('0x17')][_0x0a4d('0x1a')]?_[_0x0a4d('0x1b')](_0xf79947[_0x0a4d('0x17')]['include'],function(_0x1c4583){return{'model':db[_0x1c4583['model']],'as':_0x1c4583['as'],'attributes':_0x1c4583[_0x0a4d('0x1c')],'include':_0x1c4583['include']?_[_0x0a4d('0x1b')](_0x1c4583['include'],function(_0x4f1509){return{'model':db[_0x4f1509[_0x0a4d('0x1d')]],'as':_0x4f1509['as'],'attributes':_0x4f1509['attributes'],'include':_0x4f1509[_0x0a4d('0x1a')]?_[_0x0a4d('0x1b')](_0x4f1509[_0x0a4d('0x1a')],function(_0x1216a8){return{'model':db[_0x1216a8[_0x0a4d('0x1d')]],'as':_0x1216a8['as'],'attributes':_0x1216a8[_0x0a4d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0a4d('0xc')](function(_0x4ef55f){logger[_0x0a4d('0xd')](_0x0a4d('0x1e'),_0xf79947);logger['debug'](_0x0a4d('0x1e'),_0xf79947,JSON[_0x0a4d('0xf')](_0x4ef55f));_0x47de30(_0x4ef55f);})[_0x0a4d('0x15')](function(_0x378878){logger[_0x0a4d('0x10')](_0x0a4d('0x1e'),_0x378878['message'],_0xf79947);_0x4dfb40(_0x2ff3a8[_0x0a4d('0x10')](0x1f4,_0x378878['message']));});});};exports['CreateVoiceCallReport']=function(_0x5371c1){var _0x293338=this;return new Promise(function(_0x590ad7,_0x56a2dd){return db[_0x0a4d('0x1f')]['create'](_0x5371c1['body'],{'raw':_0x5371c1[_0x0a4d('0x17')]?_0x5371c1['options'][_0x0a4d('0x20')]===undefined?!![]:![]:!![]})[_0x0a4d('0xc')](function(_0x39126d){logger[_0x0a4d('0xd')]('CreateVoiceCallReport',_0x5371c1);logger[_0x0a4d('0x21')](_0x0a4d('0x22'),_0x5371c1,JSON[_0x0a4d('0xf')](_0x39126d));_0x590ad7(_0x39126d);})[_0x0a4d('0x15')](function(_0x522e8d){logger[_0x0a4d('0x10')](_0x0a4d('0x22'),_0x522e8d[_0x0a4d('0x13')],_0x5371c1);_0x56a2dd(_0x293338[_0x0a4d('0x10')](0x1f4,_0x522e8d[_0x0a4d('0x13')]));});});};exports[_0x0a4d('0x23')]=function(_0x2a264a){var _0x22b5e6=this;return new Promise(function(_0x3a9e2c,_0x2ed2ac){return db[_0x0a4d('0x1f')]['update'](_0x2a264a[_0x0a4d('0x24')],{'raw':_0x2a264a['options']?_0x2a264a['options'][_0x0a4d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a264a[_0x0a4d('0x17')]?_0x2a264a[_0x0a4d('0x17')][_0x0a4d('0x18')]||null:null,'attributes':_0x2a264a[_0x0a4d('0x17')]?_0x2a264a[_0x0a4d('0x17')][_0x0a4d('0x1c')]||null:null,'limit':_0x2a264a[_0x0a4d('0x17')]?_0x2a264a[_0x0a4d('0x17')]['limit']||null:null})[_0x0a4d('0xc')](function(_0x1377c7){logger[_0x0a4d('0xd')](_0x0a4d('0x23'),_0x2a264a);logger[_0x0a4d('0x21')](_0x0a4d('0x23'),_0x2a264a,JSON['stringify'](_0x1377c7));_0x3a9e2c(_0x1377c7);})[_0x0a4d('0x15')](function(_0x1f067d){logger[_0x0a4d('0x10')](_0x0a4d('0x23'),_0x1f067d['message'],_0x2a264a);_0x2ed2ac(_0x22b5e6[_0x0a4d('0x10')](0x1f4,_0x1f067d['message']));});});}; \ No newline at end of file +var _0x7730=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','attributes','limit','include','map','model','GetVoiceCallReport','stringify','VoiceCallReport','create','body','raw','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7730,0x1e0));var _0x0773=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0x7730[_0x1a0c59];return _0xed67c9;};'use strict';var _=require(_0x0773('0x0'));var util=require(_0x0773('0x1'));var moment=require(_0x0773('0x2'));var BPromise=require('bluebird');var rs=require(_0x0773('0x3'));var fs=require('fs');var Redis=require(_0x0773('0x4'));var db=require(_0x0773('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0773('0x6'))(_0x0773('0x7'));var config=require('../../config/environment');var jayson=require(_0x0773('0x8'));var client=jayson['client'][_0x0773('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38d281,_0x461690,_0x11e93e){return new BPromise(function(_0x3ba01c,_0xd3644){return client[_0x0773('0xa')](_0x38d281,_0x11e93e)[_0x0773('0xb')](function(_0x486353){logger[_0x0773('0xc')](_0x0773('0xd'),_0x461690,_0x0773('0xe'));logger[_0x0773('0xf')](_0x0773('0x10'),_0x461690,_0x0773('0xe'),JSON['stringify'](_0x486353));if(_0x486353['error']){if(_0x486353[_0x0773('0x11')][_0x0773('0x12')]===0x1f4){logger[_0x0773('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x461690,_0x486353[_0x0773('0x11')][_0x0773('0x13')]);return _0xd3644(_0x486353[_0x0773('0x11')][_0x0773('0x13')]);}logger[_0x0773('0x11')](_0x0773('0xd'),_0x461690,_0x486353['error']['message']);return _0x3ba01c(_0x486353[_0x0773('0x11')][_0x0773('0x13')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x461690,_0x0773('0xe'));_0x3ba01c(_0x486353[_0x0773('0x14')]['message']);}})[_0x0773('0x15')](function(_0x4a2826){logger['error'](_0x0773('0xd'),_0x461690,_0x4a2826);_0xd3644(_0x4a2826);});});}exports['GetVoiceCallReport']=function(_0x2acecd){var _0x2e2adb=this;return new Promise(function(_0x5168e5,_0x3010e4){return db['VoiceCallReport'][_0x0773('0x16')]({'raw':_0x2acecd[_0x0773('0x17')]?_0x2acecd['options']['raw']===undefined?!![]:![]:!![],'where':_0x2acecd[_0x0773('0x17')]?_0x2acecd[_0x0773('0x17')]['where']||null:null,'attributes':_0x2acecd[_0x0773('0x17')]?_0x2acecd['options'][_0x0773('0x18')]||null:null,'limit':_0x2acecd[_0x0773('0x17')]?_0x2acecd['options'][_0x0773('0x19')]||null:null,'include':_0x2acecd['options']?_0x2acecd['options'][_0x0773('0x1a')]?_[_0x0773('0x1b')](_0x2acecd[_0x0773('0x17')]['include'],function(_0x1665ae){return{'model':db[_0x1665ae[_0x0773('0x1c')]],'as':_0x1665ae['as'],'attributes':_0x1665ae[_0x0773('0x18')],'include':_0x1665ae[_0x0773('0x1a')]?_[_0x0773('0x1b')](_0x1665ae[_0x0773('0x1a')],function(_0x2e21cb){return{'model':db[_0x2e21cb['model']],'as':_0x2e21cb['as'],'attributes':_0x2e21cb['attributes'],'include':_0x2e21cb[_0x0773('0x1a')]?_[_0x0773('0x1b')](_0x2e21cb[_0x0773('0x1a')],function(_0x316852){return{'model':db[_0x316852['model']],'as':_0x316852['as'],'attributes':_0x316852[_0x0773('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0773('0xb')](function(_0x29d3f7){logger[_0x0773('0xc')](_0x0773('0x1d'),_0x2acecd);logger['debug'](_0x0773('0x1d'),_0x2acecd,JSON[_0x0773('0x1e')](_0x29d3f7));_0x5168e5(_0x29d3f7);})[_0x0773('0x15')](function(_0x37a4c8){logger[_0x0773('0x11')]('GetVoiceCallReport',_0x37a4c8[_0x0773('0x13')],_0x2acecd);_0x3010e4(_0x2e2adb['error'](0x1f4,_0x37a4c8[_0x0773('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x4ac0d9){var _0x294d91=this;return new Promise(function(_0x2aaa96,_0x55e310){return db[_0x0773('0x1f')][_0x0773('0x20')](_0x4ac0d9[_0x0773('0x21')],{'raw':_0x4ac0d9[_0x0773('0x17')]?_0x4ac0d9[_0x0773('0x17')][_0x0773('0x22')]===undefined?!![]:![]:!![]})[_0x0773('0xb')](function(_0x2ef814){logger[_0x0773('0xc')](_0x0773('0x23'),_0x4ac0d9);logger['debug'](_0x0773('0x23'),_0x4ac0d9,JSON[_0x0773('0x1e')](_0x2ef814));_0x2aaa96(_0x2ef814);})[_0x0773('0x15')](function(_0x481419){logger[_0x0773('0x11')](_0x0773('0x23'),_0x481419[_0x0773('0x13')],_0x4ac0d9);_0x55e310(_0x294d91[_0x0773('0x11')](0x1f4,_0x481419[_0x0773('0x13')]));});});};exports[_0x0773('0x24')]=function(_0x4d4a45){var _0x4ef4d0=this;return new Promise(function(_0x318292,_0xf310e4){return db[_0x0773('0x1f')][_0x0773('0x25')](_0x4d4a45[_0x0773('0x21')],{'raw':_0x4d4a45[_0x0773('0x17')]?_0x4d4a45['options'][_0x0773('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4a45[_0x0773('0x17')]?_0x4d4a45[_0x0773('0x17')]['where']||null:null,'attributes':_0x4d4a45[_0x0773('0x17')]?_0x4d4a45[_0x0773('0x17')]['attributes']||null:null,'limit':_0x4d4a45[_0x0773('0x17')]?_0x4d4a45[_0x0773('0x17')][_0x0773('0x19')]||null:null})['then'](function(_0x5439ac){logger[_0x0773('0xc')]('UpdateVoiceCallReport',_0x4d4a45);logger[_0x0773('0xf')](_0x0773('0x24'),_0x4d4a45,JSON[_0x0773('0x1e')](_0x5439ac));_0x318292(_0x5439ac);})[_0x0773('0x15')](function(_0x56fcc9){logger[_0x0773('0x11')](_0x0773('0x24'),_0x56fcc9[_0x0773('0x13')],_0x4d4a45);_0xf310e4(_0x4ef4d0['error'](0x1f4,_0x56fcc9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d9aad15..e90bfd3 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 _0x074a=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d9bca,_0x28d26f){var _0x22b41b=function(_0x425566){while(--_0x425566){_0x5d9bca['push'](_0x5d9bca['shift']());}};_0x22b41b(++_0x28d26f);}(_0x074a,0x125));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var path=require(_0xa074('0x2'));var timeout=require(_0xa074('0x3'));var express=require(_0xa074('0x4'));var router=express[_0xa074('0x5')]();var fs_extra=require(_0xa074('0x6'));var auth=require(_0xa074('0x7'));var interaction=require(_0xa074('0x8'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xa074('0x9')]('/',auth[_0xa074('0xa')](),controller[_0xa074('0xb')]);router[_0xa074('0x9')](_0xa074('0xc'),auth[_0xa074('0xa')](),controller[_0xa074('0xd')]);router[_0xa074('0xe')]('/',auth[_0xa074('0xa')](),controller[_0xa074('0xf')]);router[_0xa074('0x10')](_0xa074('0xc'),auth[_0xa074('0xa')](),controller[_0xa074('0x11')]);router[_0xa074('0x12')](_0xa074('0xc'),auth[_0xa074('0xa')](),controller['destroy']);module[_0xa074('0x13')]=router; \ No newline at end of file +var _0xbecb=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4e5589,_0x94a166){var _0x1b8b90=function(_0x5cf3a5){while(--_0x5cf3a5){_0x4e5589['push'](_0x4e5589['shift']());}};_0x1b8b90(++_0x94a166);}(_0xbecb,0x117));var _0xbbec=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbecb[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xbbec('0x0'));var util=require(_0xbbec('0x1'));var path=require(_0xbbec('0x2'));var timeout=require(_0xbbec('0x3'));var express=require(_0xbbec('0x4'));var router=express[_0xbbec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbbec('0x6'));var interaction=require(_0xbbec('0x7'));var config=require('../../config/environment');var controller=require(_0xbbec('0x8'));router[_0xbbec('0x9')]('/',auth[_0xbbec('0xa')](),controller[_0xbbec('0xb')]);router[_0xbbec('0x9')](_0xbbec('0xc'),auth[_0xbbec('0xa')](),controller[_0xbbec('0xd')]);router[_0xbbec('0xe')]('/',auth[_0xbbec('0xa')](),controller[_0xbbec('0xf')]);router[_0xbbec('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbbec('0x11')]);router[_0xbbec('0x12')](_0xbbec('0xc'),auth[_0xbbec('0xa')](),controller[_0xbbec('0x13')]);module[_0xbbec('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ec564bc..72fc0ef 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 _0x9ce7=['sequelize','exports','name','STRING','setDataValue','join','getDataValue','options','split','BOOLEAN'];(function(_0x4a7722,_0xfe13a9){var _0x5310d7=function(_0x536579){while(--_0x536579){_0x4a7722['push'](_0x4a7722['shift']());}};_0x5310d7(++_0xfe13a9);}(_0x9ce7,0x14a));var _0x79ce=function(_0x4c3155,_0x444029){_0x4c3155=_0x4c3155-0x0;var _0x39be26=_0x9ce7[_0x4c3155];return _0x39be26;};'use strict';var Sequelize=require(_0x79ce('0x0'));module[_0x79ce('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x79ce('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x79ce('0x3')],'set':function(_0x50c202){this[_0x79ce('0x4')]('options',_0x50c202?_0x50c202[_0x79ce('0x5')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x79ce('0x6')](_0x79ce('0x7'))[_0x79ce('0x8')](''):[];}},'auth':{'type':Sequelize[_0x79ce('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x79ce('0x3')]},'record':{'type':Sequelize[_0x79ce('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x79ce('0x3')]},'description':{'type':Sequelize[_0x79ce('0x3')]}}; \ No newline at end of file +var _0xfb41=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xfb41,0x1bd));var _0x1fb4=function(_0xdf4058,_0x3d913d){_0xdf4058=_0xdf4058-0x0;var _0x141888=_0xfb41[_0xdf4058];return _0x141888;};'use strict';var Sequelize=require(_0x1fb4('0x0'));module[_0x1fb4('0x1')]={'name':{'type':Sequelize[_0x1fb4('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x1fb4('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x1fb4('0x2')],'set':function(_0x212f29){this[_0x1fb4('0x4')](_0x1fb4('0x5'),_0x212f29?_0x212f29[_0x1fb4('0x6')](''):[]);},'get':function(){return this[_0x1fb4('0x7')](_0x1fb4('0x5'))?this['getDataValue'](_0x1fb4('0x5'))[_0x1fb4('0x8')](''):[];}},'auth':{'type':Sequelize[_0x1fb4('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x1fb4('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 627ecfb..163f008 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 _0xb010=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','where','pick','merge','type','VIRTUAL','filter','options','VoiceChanSpy','include','findAll','rows','catch','show','params','keys','attributes','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','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','sendStatus','status','end'];(function(_0x1a7fa7,_0x231925){var _0x4051de=function(_0x110b45){while(--_0x110b45){_0x1a7fa7['push'](_0x1a7fa7['shift']());}};_0x4051de(++_0x231925);}(_0xb010,0x8b));var _0x0b01=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb010[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b01('0x1'));var rp=require('request-promise');var moment=require(_0x0b01('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0b01('0x3'));var util=require(_0x0b01('0x4'));var path=require(_0x0b01('0x5'));var sox=require(_0x0b01('0x6'));var csv=require(_0x0b01('0x7'));var ejs=require(_0x0b01('0x8'));var fs=require('fs');var fs_extra=require(_0x0b01('0x9'));var _=require(_0x0b01('0xa'));var squel=require(_0x0b01('0xb'));var crypto=require(_0x0b01('0xc'));var jsforce=require(_0x0b01('0xd'));var deskjs=require(_0x0b01('0xe'));var toCsv=require(_0x0b01('0x7'));var querystring=require('querystring');var Papa=require(_0x0b01('0xf'));var Redis=require(_0x0b01('0x10'));var authService=require(_0x0b01('0x11'));var qs=require(_0x0b01('0x12'));var as=require(_0x0b01('0x13'));var hardwareService=require(_0x0b01('0x14'));var logger=require(_0x0b01('0x15'))(_0x0b01('0x16'));var utils=require(_0x0b01('0x17'));var config=require(_0x0b01('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b01('0x19'))['db'];function respondWithStatusCode(_0x462720,_0x8834b5){_0x8834b5=_0x8834b5||0xcc;return function(_0x1da264){if(_0x1da264){return _0x462720[_0x0b01('0x1a')](_0x8834b5);}return _0x462720[_0x0b01('0x1b')](_0x8834b5)[_0x0b01('0x1c')]();};}function respondWithResult(_0x53372e,_0xfc0d4f){_0xfc0d4f=_0xfc0d4f||0xc8;return function(_0x3fc8cb){if(_0x3fc8cb){return _0x53372e[_0x0b01('0x1b')](_0xfc0d4f)[_0x0b01('0x1d')](_0x3fc8cb);}};}function respondWithFilteredResult(_0x4074c2,_0x2448a4){return function(_0x24c0d4){if(_0x24c0d4){var _0x2348ef=typeof _0x2448a4[_0x0b01('0x1e')]===_0x0b01('0x1f')&&typeof _0x2448a4[_0x0b01('0x20')]===_0x0b01('0x1f');var _0x55aceb=_0x24c0d4[_0x0b01('0x21')];var _0x21139b=_0x2348ef?0x0:_0x2448a4[_0x0b01('0x1e')];var _0x4a288c=_0x2348ef?_0x24c0d4['count']:_0x2448a4['offset']+_0x2448a4[_0x0b01('0x20')];var _0x217eac;if(_0x4a288c>=_0x55aceb){_0x4a288c=_0x55aceb;_0x217eac=0xc8;}else{_0x217eac=0xce;}_0x4074c2[_0x0b01('0x1b')](_0x217eac);return _0x4074c2[_0x0b01('0x22')](_0x0b01('0x23'),_0x21139b+'-'+_0x4a288c+'/'+_0x55aceb)[_0x0b01('0x1d')](_0x24c0d4);}return null;};}function patchUpdates(_0x5a68c1){return function(_0x29dae4){try{jsonpatch[_0x0b01('0x24')](_0x29dae4,_0x5a68c1,!![]);}catch(_0xc91328){return BPromise[_0x0b01('0x25')](_0xc91328);}return _0x29dae4[_0x0b01('0x26')]();};}function saveUpdates(_0x589324,_0x5f4cf1){return function(_0x3e966c){if(_0x3e966c){return _0x3e966c[_0x0b01('0x27')](_0x589324)[_0x0b01('0x28')](function(_0x220615){return _0x220615;});}return null;};}function removeEntity(_0x51bbaf,_0x5034fc){return function(_0x47f13a){if(_0x47f13a){return _0x47f13a[_0x0b01('0x29')]()['then'](function(){var _0x4af9f6=_0x47f13a['get']({'plain':!![]});var _0x2a165f=_0x0b01('0x2a');return db[_0x0b01('0x2b')][_0x0b01('0x29')]({'where':{'type':_0x2a165f,'resourceId':_0x4af9f6['id']}})[_0x0b01('0x28')](function(){return _0x47f13a;});})[_0x0b01('0x28')](function(){_0x51bbaf[_0x0b01('0x1b')](0xcc)[_0x0b01('0x1c')]();});}};}function handleEntityNotFound(_0x5cff03,_0xe33073){return function(_0x3d42e6){if(!_0x3d42e6){_0x5cff03[_0x0b01('0x1a')](0x194);}return _0x3d42e6;};}function handleError(_0x513f07,_0x53b17a){_0x53b17a=_0x53b17a||0x1f4;return function(_0x29799c){logger['error'](_0x29799c['stack']);if(_0x29799c[_0x0b01('0x2c')]){delete _0x29799c[_0x0b01('0x2c')];}_0x513f07[_0x0b01('0x1b')](_0x53b17a)['send'](_0x29799c);};}exports[_0x0b01('0x2d')]=function(_0x3ef977,_0x177bc1){var _0x1b9ecf={},_0x65488={},_0x2f5551={'count':0x0,'rows':[]};var _0x41e532=_[_0x0b01('0x2e')](db['VoiceChanSpy'][_0x0b01('0x2f')],function(_0x471897){return{'name':_0x471897[_0x0b01('0x30')],'type':_0x471897['type'][_0x0b01('0x31')]};});_0x65488['model']=_[_0x0b01('0x2e')](_0x41e532,'name');_0x65488[_0x0b01('0x32')]=_['keys'](_0x3ef977[_0x0b01('0x32')]);_0x65488[_0x0b01('0x33')]=_[_0x0b01('0x34')](_0x65488['model'],_0x65488[_0x0b01('0x32')]);_0x1b9ecf['attributes']=_[_0x0b01('0x34')](_0x65488[_0x0b01('0x35')],qs[_0x0b01('0x36')](_0x3ef977[_0x0b01('0x32')]['fields']));_0x1b9ecf['attributes']=_0x1b9ecf['attributes'][_0x0b01('0x37')]?_0x1b9ecf['attributes']:_0x65488[_0x0b01('0x35')];if(!_0x3ef977['query'][_0x0b01('0x38')](_0x0b01('0x39'))){_0x1b9ecf[_0x0b01('0x20')]=qs[_0x0b01('0x20')](_0x3ef977[_0x0b01('0x32')]['limit']);_0x1b9ecf['offset']=qs[_0x0b01('0x1e')](_0x3ef977[_0x0b01('0x32')][_0x0b01('0x1e')]);}_0x1b9ecf['order']=qs['sort'](_0x3ef977[_0x0b01('0x32')]['sort']);_0x1b9ecf[_0x0b01('0x3a')]=qs[_0x0b01('0x33')](_[_0x0b01('0x3b')](_0x3ef977['query'],_0x65488[_0x0b01('0x33')]),_0x41e532);if(_0x3ef977[_0x0b01('0x32')]['filter']){_0x1b9ecf[_0x0b01('0x3a')]=_[_0x0b01('0x3c')](_0x1b9ecf[_0x0b01('0x3a')],{'$or':_[_0x0b01('0x2e')](_0x41e532,function(_0x3e9fa2){if(_0x3e9fa2[_0x0b01('0x3d')]!==_0x0b01('0x3e')){var _0x41314f={};_0x41314f[_0x3e9fa2['name']]={'$like':'%'+_0x3ef977[_0x0b01('0x32')][_0x0b01('0x3f')]+'%'};return _0x41314f;}})});}_0x1b9ecf=_[_0x0b01('0x3c')]({},_0x1b9ecf,_0x3ef977[_0x0b01('0x40')]);var _0x4848f9={'where':_0x1b9ecf[_0x0b01('0x3a')]};return db[_0x0b01('0x41')][_0x0b01('0x21')](_0x4848f9)[_0x0b01('0x28')](function(_0x19e706){_0x2f5551['count']=_0x19e706;if(_0x3ef977['query']['includeAll']){_0x1b9ecf[_0x0b01('0x42')]=[{'all':!![]}];}return db[_0x0b01('0x41')][_0x0b01('0x43')](_0x1b9ecf);})[_0x0b01('0x28')](function(_0xa8d23c){_0x2f5551[_0x0b01('0x44')]=_0xa8d23c;return _0x2f5551;})[_0x0b01('0x28')](respondWithFilteredResult(_0x177bc1,_0x1b9ecf))[_0x0b01('0x45')](handleError(_0x177bc1,null));};exports[_0x0b01('0x46')]=function(_0xcbfeab,_0x3144ad){var _0x2e73d8={'raw':![],'where':{'id':_0xcbfeab[_0x0b01('0x47')]['id']}},_0x29085f={};_0x29085f['model']=_[_0x0b01('0x48')](db[_0x0b01('0x41')]['rawAttributes']);_0x29085f[_0x0b01('0x32')]=_[_0x0b01('0x48')](_0xcbfeab[_0x0b01('0x32')]);_0x29085f['filters']=_[_0x0b01('0x34')](_0x29085f[_0x0b01('0x35')],_0x29085f[_0x0b01('0x32')]);_0x2e73d8['attributes']=_[_0x0b01('0x34')](_0x29085f[_0x0b01('0x35')],qs['fields'](_0xcbfeab['query'][_0x0b01('0x36')]));_0x2e73d8[_0x0b01('0x49')]=_0x2e73d8[_0x0b01('0x49')]['length']?_0x2e73d8[_0x0b01('0x49')]:_0x29085f[_0x0b01('0x35')];if(_0xcbfeab[_0x0b01('0x32')][_0x0b01('0x4a')]){_0x2e73d8[_0x0b01('0x42')]=[{'all':!![]}];}_0x2e73d8=_['merge']({},_0x2e73d8,_0xcbfeab[_0x0b01('0x40')]);return db['VoiceChanSpy'][_0x0b01('0x4b')](_0x2e73d8)['then'](handleEntityNotFound(_0x3144ad,null))['then'](respondWithResult(_0x3144ad,null))['catch'](handleError(_0x3144ad,null));};exports[_0x0b01('0x4c')]=function(_0x5b1b17,_0x449320){return db[_0x0b01('0x41')][_0x0b01('0x4c')](_0x5b1b17[_0x0b01('0x4d')],{})[_0x0b01('0x28')](function(_0x589232){var _0x40a7f8=_0x5b1b17['user'][_0x0b01('0x4e')]({'plain':!![]});if(!_0x40a7f8)throw new Error(_0x0b01('0x4f'));if(_0x40a7f8['role']==='user'){var _0x85b840=_0x589232['get']({'plain':!![]});var _0x39702a=_0x0b01('0x2a');return db[_0x0b01('0x50')][_0x0b01('0x4b')]({'where':{'name':_0x39702a,'userProfileId':_0x40a7f8[_0x0b01('0x51')]},'raw':!![]})[_0x0b01('0x28')](function(_0x1fef69){if(_0x1fef69&&_0x1fef69[_0x0b01('0x52')]===0x0){return db[_0x0b01('0x2b')][_0x0b01('0x4c')]({'name':_0x85b840[_0x0b01('0x2c')],'resourceId':_0x85b840['id'],'type':_0x1fef69['name'],'sectionId':_0x1fef69['id']},{})[_0x0b01('0x28')](function(){return _0x589232;});}else{return _0x589232;}})[_0x0b01('0x45')](function(_0x3b743a){logger['error'](_0x0b01('0x53'),_0x3b743a);throw _0x3b743a;});}return _0x589232;})['then'](respondWithResult(_0x449320,0xc9))[_0x0b01('0x45')](handleError(_0x449320,null));};exports[_0x0b01('0x27')]=function(_0x29f9bf,_0x5caa90){if(_0x29f9bf[_0x0b01('0x4d')]['id']){delete _0x29f9bf[_0x0b01('0x4d')]['id'];}return db[_0x0b01('0x41')]['find']({'where':{'id':_0x29f9bf[_0x0b01('0x47')]['id']}})[_0x0b01('0x28')](handleEntityNotFound(_0x5caa90,null))['then'](saveUpdates(_0x29f9bf[_0x0b01('0x4d')],null))[_0x0b01('0x28')](respondWithResult(_0x5caa90,null))[_0x0b01('0x45')](handleError(_0x5caa90,null));};exports['destroy']=function(_0x2a4f64,_0x44633c){return db['VoiceChanSpy'][_0x0b01('0x4b')]({'where':{'id':_0x2a4f64[_0x0b01('0x47')]['id']}})['then'](handleEntityNotFound(_0x44633c,null))[_0x0b01('0x28')](removeEntity(_0x44633c,null))[_0x0b01('0x45')](handleError(_0x44633c,null));}; \ No newline at end of file +var _0x26c2=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1ce924,_0x220d57){var _0x2a8240=function(_0x320eba){while(--_0x320eba){_0x1ce924['push'](_0x1ce924['shift']());}};_0x2a8240(++_0x220d57);}(_0x26c2,0x130));var _0x226c=function(_0x36f504,_0x1a6cd6){_0x36f504=_0x36f504-0x0;var _0x5a5ef3=_0x26c2[_0x36f504];return _0x5a5ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x226c('0x0'));var rp=require(_0x226c('0x1'));var moment=require(_0x226c('0x2'));var BPromise=require(_0x226c('0x3'));var Mustache=require('mustache');var util=require(_0x226c('0x4'));var path=require(_0x226c('0x5'));var sox=require('sox');var csv=require(_0x226c('0x6'));var ejs=require(_0x226c('0x7'));var fs=require('fs');var fs_extra=require(_0x226c('0x8'));var _=require(_0x226c('0x9'));var squel=require(_0x226c('0xa'));var crypto=require('crypto');var jsforce=require(_0x226c('0xb'));var deskjs=require(_0x226c('0xc'));var toCsv=require(_0x226c('0x6'));var querystring=require(_0x226c('0xd'));var Papa=require(_0x226c('0xe'));var Redis=require('ioredis');var authService=require(_0x226c('0xf'));var qs=require(_0x226c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x226c('0x11'))(_0x226c('0x12'));var utils=require(_0x226c('0x13'));var config=require(_0x226c('0x14'));var licenseUtil=require(_0x226c('0x15'));var db=require(_0x226c('0x16'))['db'];function respondWithStatusCode(_0x2964c2,_0x57dbc4){_0x57dbc4=_0x57dbc4||0xcc;return function(_0x481496){if(_0x481496){return _0x2964c2[_0x226c('0x17')](_0x57dbc4);}return _0x2964c2[_0x226c('0x18')](_0x57dbc4)[_0x226c('0x19')]();};}function respondWithResult(_0x36af55,_0x4eb557){_0x4eb557=_0x4eb557||0xc8;return function(_0x4bfd5c){if(_0x4bfd5c){return _0x36af55[_0x226c('0x18')](_0x4eb557)[_0x226c('0x1a')](_0x4bfd5c);}};}function respondWithFilteredResult(_0x15e13b,_0x55697c){return function(_0x5d6c21){if(_0x5d6c21){var _0x694eef=typeof _0x55697c[_0x226c('0x1b')]===_0x226c('0x1c')&&typeof _0x55697c[_0x226c('0x1d')]===_0x226c('0x1c');var _0x4832f5=_0x5d6c21['count'];var _0x5989e0=_0x694eef?0x0:_0x55697c[_0x226c('0x1b')];var _0x813b69=_0x694eef?_0x5d6c21[_0x226c('0x1e')]:_0x55697c[_0x226c('0x1b')]+_0x55697c['limit'];var _0x7fc168;if(_0x813b69>=_0x4832f5){_0x813b69=_0x4832f5;_0x7fc168=0xc8;}else{_0x7fc168=0xce;}_0x15e13b[_0x226c('0x18')](_0x7fc168);return _0x15e13b[_0x226c('0x1f')](_0x226c('0x20'),_0x5989e0+'-'+_0x813b69+'/'+_0x4832f5)[_0x226c('0x1a')](_0x5d6c21);}return null;};}function patchUpdates(_0x3d412a){return function(_0x4dabf3){try{jsonpatch[_0x226c('0x21')](_0x4dabf3,_0x3d412a,!![]);}catch(_0x34253b){return BPromise[_0x226c('0x22')](_0x34253b);}return _0x4dabf3[_0x226c('0x23')]();};}function saveUpdates(_0x272f26,_0x57eb9f){return function(_0x575c7a){if(_0x575c7a){return _0x575c7a['update'](_0x272f26)[_0x226c('0x24')](function(_0x52985c){return _0x52985c;});}return null;};}function removeEntity(_0x4da72c,_0xbaee21){return function(_0x5b3919){if(_0x5b3919){return _0x5b3919[_0x226c('0x25')]()[_0x226c('0x24')](function(){var _0x2a570a=_0x5b3919['get']({'plain':!![]});var _0x25165d='ChanSpies';return db[_0x226c('0x26')]['destroy']({'where':{'type':_0x25165d,'resourceId':_0x2a570a['id']}})[_0x226c('0x24')](function(){return _0x5b3919;});})[_0x226c('0x24')](function(){_0x4da72c[_0x226c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c49b,_0x4a0b38){return function(_0xbe7c35){if(!_0xbe7c35){_0x14c49b['sendStatus'](0x194);}return _0xbe7c35;};}function handleError(_0x431875,_0x539e59){_0x539e59=_0x539e59||0x1f4;return function(_0x40a095){logger[_0x226c('0x27')](_0x40a095['stack']);if(_0x40a095['name']){delete _0x40a095[_0x226c('0x28')];}_0x431875[_0x226c('0x18')](_0x539e59)[_0x226c('0x29')](_0x40a095);};}exports[_0x226c('0x2a')]=function(_0x1e78f5,_0x253aeb){var _0x2ff83b={},_0x3a28d8={},_0x5fdaf5={'count':0x0,'rows':[]};var _0x1bd25d=_[_0x226c('0x2b')](db[_0x226c('0x2c')]['rawAttributes'],function(_0xabaf14){return{'name':_0xabaf14[_0x226c('0x2d')],'type':_0xabaf14[_0x226c('0x2e')][_0x226c('0x2f')]};});_0x3a28d8[_0x226c('0x30')]=_['map'](_0x1bd25d,_0x226c('0x28'));_0x3a28d8[_0x226c('0x31')]=_[_0x226c('0x32')](_0x1e78f5['query']);_0x3a28d8[_0x226c('0x33')]=_['intersection'](_0x3a28d8[_0x226c('0x30')],_0x3a28d8[_0x226c('0x31')]);_0x2ff83b[_0x226c('0x34')]=_[_0x226c('0x35')](_0x3a28d8[_0x226c('0x30')],qs[_0x226c('0x36')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x36')]));_0x2ff83b[_0x226c('0x34')]=_0x2ff83b[_0x226c('0x34')][_0x226c('0x37')]?_0x2ff83b[_0x226c('0x34')]:_0x3a28d8[_0x226c('0x30')];if(!_0x1e78f5[_0x226c('0x31')]['hasOwnProperty'](_0x226c('0x38'))){_0x2ff83b[_0x226c('0x1d')]=qs[_0x226c('0x1d')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x1d')]);_0x2ff83b[_0x226c('0x1b')]=qs[_0x226c('0x1b')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x1b')]);}_0x2ff83b['order']=qs['sort'](_0x1e78f5[_0x226c('0x31')][_0x226c('0x39')]);_0x2ff83b[_0x226c('0x3a')]=qs[_0x226c('0x33')](_[_0x226c('0x3b')](_0x1e78f5[_0x226c('0x31')],_0x3a28d8[_0x226c('0x33')]),_0x1bd25d);if(_0x1e78f5[_0x226c('0x31')][_0x226c('0x3c')]){_0x2ff83b['where']=_[_0x226c('0x3d')](_0x2ff83b['where'],{'$or':_[_0x226c('0x2b')](_0x1bd25d,function(_0x1a7d0d){if(_0x1a7d0d[_0x226c('0x2e')]!=='VIRTUAL'){var _0x507aa8={};_0x507aa8[_0x1a7d0d[_0x226c('0x28')]]={'$like':'%'+_0x1e78f5[_0x226c('0x31')]['filter']+'%'};return _0x507aa8;}})});}_0x2ff83b=_[_0x226c('0x3d')]({},_0x2ff83b,_0x1e78f5[_0x226c('0x3e')]);var _0x190605={'where':_0x2ff83b[_0x226c('0x3a')]};return db['VoiceChanSpy'][_0x226c('0x1e')](_0x190605)[_0x226c('0x24')](function(_0x12f34d){_0x5fdaf5['count']=_0x12f34d;if(_0x1e78f5[_0x226c('0x31')][_0x226c('0x3f')]){_0x2ff83b[_0x226c('0x40')]=[{'all':!![]}];}return db[_0x226c('0x2c')][_0x226c('0x41')](_0x2ff83b);})['then'](function(_0x5ea01f){_0x5fdaf5['rows']=_0x5ea01f;return _0x5fdaf5;})[_0x226c('0x24')](respondWithFilteredResult(_0x253aeb,_0x2ff83b))[_0x226c('0x42')](handleError(_0x253aeb,null));};exports[_0x226c('0x43')]=function(_0x17e1a8,_0x345514){var _0x3145f4={'raw':![],'where':{'id':_0x17e1a8[_0x226c('0x44')]['id']}},_0x16ae23={};_0x16ae23[_0x226c('0x30')]=_['keys'](db['VoiceChanSpy'][_0x226c('0x45')]);_0x16ae23[_0x226c('0x31')]=_['keys'](_0x17e1a8[_0x226c('0x31')]);_0x16ae23['filters']=_['intersection'](_0x16ae23[_0x226c('0x30')],_0x16ae23['query']);_0x3145f4[_0x226c('0x34')]=_[_0x226c('0x35')](_0x16ae23[_0x226c('0x30')],qs[_0x226c('0x36')](_0x17e1a8[_0x226c('0x31')][_0x226c('0x36')]));_0x3145f4['attributes']=_0x3145f4[_0x226c('0x34')]['length']?_0x3145f4[_0x226c('0x34')]:_0x16ae23[_0x226c('0x30')];if(_0x17e1a8[_0x226c('0x31')][_0x226c('0x3f')]){_0x3145f4['include']=[{'all':!![]}];}_0x3145f4=_[_0x226c('0x3d')]({},_0x3145f4,_0x17e1a8['options']);return db[_0x226c('0x2c')][_0x226c('0x46')](_0x3145f4)[_0x226c('0x24')](handleEntityNotFound(_0x345514,null))[_0x226c('0x24')](respondWithResult(_0x345514,null))[_0x226c('0x42')](handleError(_0x345514,null));};exports[_0x226c('0x47')]=function(_0x4f99f5,_0x21c046){return db[_0x226c('0x2c')][_0x226c('0x47')](_0x4f99f5[_0x226c('0x48')],{})[_0x226c('0x24')](function(_0x27ccb8){var _0xfa1394=_0x4f99f5[_0x226c('0x49')][_0x226c('0x4a')]({'plain':!![]});if(!_0xfa1394)throw new Error(_0x226c('0x4b'));if(_0xfa1394[_0x226c('0x4c')]===_0x226c('0x49')){var _0x5f3434=_0x27ccb8['get']({'plain':!![]});var _0x486510=_0x226c('0x4d');return db[_0x226c('0x4e')][_0x226c('0x46')]({'where':{'name':_0x486510,'userProfileId':_0xfa1394['userProfileId']},'raw':!![]})[_0x226c('0x24')](function(_0x42710d){if(_0x42710d&&_0x42710d['autoAssociation']===0x0){return db[_0x226c('0x26')][_0x226c('0x47')]({'name':_0x5f3434[_0x226c('0x28')],'resourceId':_0x5f3434['id'],'type':_0x42710d[_0x226c('0x28')],'sectionId':_0x42710d['id']},{})[_0x226c('0x24')](function(){return _0x27ccb8;});}else{return _0x27ccb8;}})[_0x226c('0x42')](function(_0x3e60bf){logger[_0x226c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e60bf);throw _0x3e60bf;});}return _0x27ccb8;})[_0x226c('0x24')](respondWithResult(_0x21c046,0xc9))[_0x226c('0x42')](handleError(_0x21c046,null));};exports['update']=function(_0x3b902a,_0x3e5304){if(_0x3b902a[_0x226c('0x48')]['id']){delete _0x3b902a[_0x226c('0x48')]['id'];}return db[_0x226c('0x2c')][_0x226c('0x46')]({'where':{'id':_0x3b902a['params']['id']}})[_0x226c('0x24')](handleEntityNotFound(_0x3e5304,null))['then'](saveUpdates(_0x3b902a['body'],null))[_0x226c('0x24')](respondWithResult(_0x3e5304,null))[_0x226c('0x42')](handleError(_0x3e5304,null));};exports['destroy']=function(_0x3861be,_0x17cfc1){return db[_0x226c('0x2c')]['find']({'where':{'id':_0x3861be[_0x226c('0x44')]['id']}})[_0x226c('0x24')](handleEntityNotFound(_0x17cfc1,null))[_0x226c('0x24')](removeEntity(_0x17cfc1,null))[_0x226c('0x42')](handleError(_0x17cfc1,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7d8a9b6..4f0d987 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 _0xc487=['merge','Set','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','StopMixMonitor','length','internal','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push'];(function(_0x285299,_0x796bcf){var _0x5a91f9=function(_0x535a7c){while(--_0x535a7c){_0x285299['push'](_0x285299['shift']());}};_0x5a91f9(++_0x796bcf);}(_0xc487,0x120));var _0x7c48=function(_0x595ab7,_0x3a7304){_0x595ab7=_0x595ab7-0x0;var _0x1b564c=_0xc487[_0x595ab7];return _0x1b564c;};'use strict';var _=require(_0x7c48('0x0'));var util=require('util');var BPromise=require(_0x7c48('0x1'));var attributes=require(_0x7c48('0x2'));var getUserApplications=function(_0x472664,_0x59d902,_0xe2bf41){var _0x1062c6=0x1;var _0x3bb9bc=[];var _0x329fc1={'context':_0x59d902[_0x7c48('0x3')]||'from-sip','exten':util[_0x7c48('0x4')](_0x7c48('0x5'),_0x472664[_0x7c48('0x6')],_0xe2bf41),'type':_0x7c48('0x7'),'isApp':![],'ChanSpyId':_0x472664['id'],'UserId':_0x59d902['id']};_0x3bb9bc[_0x7c48('0x8')](_[_0x7c48('0x9')]({'app':_0x7c48('0xa'),'appdata':util[_0x7c48('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x1062c6++},_0x329fc1));if(_0x472664[_0x7c48('0xb')]){_0x3bb9bc['push'](_[_0x7c48('0x9')]({'app':_0x7c48('0xc'),'appdata':util['format'](_0x7c48('0xd'),_0x472664[_0x7c48('0xe')]),'priority':_0x1062c6++},_0x329fc1));}if(_0x472664[_0x7c48('0xf')]){_0x3bb9bc[_0x7c48('0x8')](_[_0x7c48('0x9')]({'app':'Authenticate','appdata':_0x472664[_0x7c48('0x10')],'priority':_0x1062c6++},_0x329fc1));}_0x3bb9bc['push'](_['merge']({'app':_0x7c48('0x11'),'appdata':util[_0x7c48('0x4')]('SIP/%s,%s',_0x59d902[_0x7c48('0x12')],_0x472664[_0x7c48('0x13')]?_0x472664[_0x7c48('0x13')]['join'](''):''),'priority':_0x1062c6++},_0x329fc1));if(_0x472664[_0x7c48('0xb')]){_0x3bb9bc[_0x7c48('0x8')](_[_0x7c48('0x9')]({'app':_0x7c48('0x14'),'priority':_0x1062c6++},_0x329fc1));}return _0x3bb9bc;};var getChanSpyApplications=function(_0x15cdab,_0x521987){var _0x2dc747=[];for(var _0x435fe7=0x0,_0x54e061=0x1;_0x435fe7<_0x521987[_0x7c48('0x15')];_0x435fe7++,_0x54e061=0x1){_0x2dc747=_0x2dc747['concat'](getUserApplications(_0x15cdab,_0x521987[_0x435fe7],_0x521987[_0x435fe7][_0x7c48('0x16')]));if(_0x521987[_0x435fe7][_0x7c48('0x16')]!=_0x521987[_0x435fe7][_0x7c48('0x12')]){_0x2dc747=_0x2dc747['concat'](getUserApplications(_0x15cdab,_0x521987[_0x435fe7],_0x521987[_0x435fe7][_0x7c48('0x12')]));}}return _0x2dc747;};var getChanSpyPromise=function(_0x151e9c,_0x55e353){return new BPromise(function(_0xb79c72,_0x474205){return _0x151e9c[_0x7c48('0x17')][_0x7c48('0x18')]({'attributes':['id','name',_0x7c48('0x16')],'where':{'role':_0x7c48('0x19'),'chanspy':!![]},'raw':!![]})[_0x7c48('0x1a')](function(_0x2668d9){if(_0x2668d9){return _0xb79c72(getChanSpyApplications(_0x55e353,_0x2668d9));}return _0xb79c72([]);})[_0x7c48('0x1b')](function(_0x3013a){_0x474205(_0x3013a);});});};module[_0x7c48('0x1c')]=function(_0x5894f8,_0x538dca){var _0x2c9898=_0x5894f8[_0x7c48('0x1d')];return _0x5894f8['define'](_0x7c48('0x1e'),attributes,{'tableName':_0x7c48('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x11d4c8,_0x1a382e,_0x8ecc44){return getChanSpyPromise(_0x2c9898,_0x11d4c8)[_0x7c48('0x1a')](function(_0x3fe076){if(_0x3fe076&&_0x3fe076[_0x7c48('0x15')]){return _0x2c9898[_0x7c48('0x20')]['bulkCreate'](_0x3fe076);}})[_0x7c48('0x1a')](function(){_0x8ecc44();})[_0x7c48('0x1b')](function(_0x47d957){_0x8ecc44(_0x47d957);});},'afterUpdate':function(_0x4f5689,_0x58831c,_0x30dd48){return _0x2c9898[_0x7c48('0x20')]['destroy']({'where':{'ChanSpyId':_0x4f5689['id']}})[_0x7c48('0x1a')](function(){return getChanSpyPromise(_0x2c9898,_0x4f5689);})[_0x7c48('0x1a')](function(_0x54f331){if(_0x54f331&&_0x54f331[_0x7c48('0x15')]){return _0x2c9898[_0x7c48('0x20')]['bulkCreate'](_0x54f331);}})[_0x7c48('0x1a')](function(){_0x30dd48();})[_0x7c48('0x1b')](function(_0x3bb8fb){_0x30dd48(_0x3bb8fb);});},'afterDestroy':function(_0x12a1ff,_0x4e60dc,_0x5411cf){return _0x2c9898[_0x7c48('0x20')]['destroy']({'where':{'ChanSpyId':_0x12a1ff['id']}})['then'](function(){_0x5411cf();})[_0x7c48('0x1b')](function(_0x41b440){_0x5411cf(_0x41b440);});}}});}; \ No newline at end of file +var _0x57a1=['voice_chanspy','length','VoiceExtension','destroy','bulkCreate','util','context','from-sip','%s%s','prefix','system','push','Set','format','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','concat','internal','findAll','agent','then','catch','exports','models','define','VoiceChanSpy'];(function(_0x33f4bb,_0xe5f31d){var _0x2a297d=function(_0x460cc8){while(--_0x460cc8){_0x33f4bb['push'](_0x33f4bb['shift']());}};_0x2a297d(++_0xe5f31d);}(_0x57a1,0x1a9));var _0x157a=function(_0x35d568,_0x4d47ae){_0x35d568=_0x35d568-0x0;var _0x5dac84=_0x57a1[_0x35d568];return _0x5dac84;};'use strict';var _=require('lodash');var util=require(_0x157a('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x351de1,_0x11db22,_0x59aeae){var _0x405d3d=0x1;var _0x77652f=[];var _0x32591a={'context':_0x11db22[_0x157a('0x1')]||_0x157a('0x2'),'exten':util['format'](_0x157a('0x3'),_0x351de1[_0x157a('0x4')],_0x59aeae),'type':_0x157a('0x5'),'isApp':![],'ChanSpyId':_0x351de1['id'],'UserId':_0x11db22['id']};_0x77652f[_0x157a('0x6')](_['merge']({'app':_0x157a('0x7'),'appdata':util[_0x157a('0x8')](_0x157a('0x9'),'chanspy'),'priority':_0x405d3d++},_0x32591a));if(_0x351de1[_0x157a('0xa')]){_0x77652f[_0x157a('0x6')](_[_0x157a('0xb')]({'app':_0x157a('0xc'),'appdata':util[_0x157a('0x8')](_0x157a('0xd'),_0x351de1[_0x157a('0xe')]),'priority':_0x405d3d++},_0x32591a));}if(_0x351de1['auth']){_0x77652f[_0x157a('0x6')](_['merge']({'app':'Authenticate','appdata':_0x351de1[_0x157a('0xf')],'priority':_0x405d3d++},_0x32591a));}_0x77652f[_0x157a('0x6')](_[_0x157a('0xb')]({'app':_0x157a('0x10'),'appdata':util[_0x157a('0x8')](_0x157a('0x11'),_0x11db22[_0x157a('0x12')],_0x351de1[_0x157a('0x13')]?_0x351de1['options']['join'](''):''),'priority':_0x405d3d++},_0x32591a));if(_0x351de1[_0x157a('0xa')]){_0x77652f[_0x157a('0x6')](_[_0x157a('0xb')]({'app':'StopMixMonitor','priority':_0x405d3d++},_0x32591a));}return _0x77652f;};var getChanSpyApplications=function(_0xbf81ab,_0x28c520){var _0x408422=[];for(var _0x50c2de=0x0,_0x154b4f=0x1;_0x50c2de<_0x28c520['length'];_0x50c2de++,_0x154b4f=0x1){_0x408422=_0x408422[_0x157a('0x14')](getUserApplications(_0xbf81ab,_0x28c520[_0x50c2de],_0x28c520[_0x50c2de][_0x157a('0x15')]));if(_0x28c520[_0x50c2de][_0x157a('0x15')]!=_0x28c520[_0x50c2de][_0x157a('0x12')]){_0x408422=_0x408422[_0x157a('0x14')](getUserApplications(_0xbf81ab,_0x28c520[_0x50c2de],_0x28c520[_0x50c2de][_0x157a('0x12')]));}}return _0x408422;};var getChanSpyPromise=function(_0x19c50c,_0x295c38){return new BPromise(function(_0x1bb0c6,_0x388f6a){return _0x19c50c['User'][_0x157a('0x16')]({'attributes':['id',_0x157a('0x12'),_0x157a('0x15')],'where':{'role':_0x157a('0x17'),'chanspy':!![]},'raw':!![]})[_0x157a('0x18')](function(_0x33b886){if(_0x33b886){return _0x1bb0c6(getChanSpyApplications(_0x295c38,_0x33b886));}return _0x1bb0c6([]);})[_0x157a('0x19')](function(_0x1fe072){_0x388f6a(_0x1fe072);});});};module[_0x157a('0x1a')]=function(_0x777b8f,_0x1bdfc8){var _0x4c2f1d=_0x777b8f[_0x157a('0x1b')];return _0x777b8f[_0x157a('0x1c')](_0x157a('0x1d'),attributes,{'tableName':_0x157a('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a0971,_0xa98a98,_0x5ab744){return getChanSpyPromise(_0x4c2f1d,_0x2a0971)['then'](function(_0x5c9d75){if(_0x5c9d75&&_0x5c9d75[_0x157a('0x1f')]){return _0x4c2f1d['VoiceExtension']['bulkCreate'](_0x5c9d75);}})[_0x157a('0x18')](function(){_0x5ab744();})[_0x157a('0x19')](function(_0x2c9600){_0x5ab744(_0x2c9600);});},'afterUpdate':function(_0x1cfeb0,_0x114ccf,_0x4909d7){return _0x4c2f1d[_0x157a('0x20')][_0x157a('0x21')]({'where':{'ChanSpyId':_0x1cfeb0['id']}})[_0x157a('0x18')](function(){return getChanSpyPromise(_0x4c2f1d,_0x1cfeb0);})[_0x157a('0x18')](function(_0x3b340b){if(_0x3b340b&&_0x3b340b[_0x157a('0x1f')]){return _0x4c2f1d[_0x157a('0x20')][_0x157a('0x22')](_0x3b340b);}})[_0x157a('0x18')](function(){_0x4909d7();})[_0x157a('0x19')](function(_0x103ea3){_0x4909d7(_0x103ea3);});},'afterDestroy':function(_0x26d587,_0x58db3b,_0x35bdca){return _0x4c2f1d['VoiceExtension'][_0x157a('0x21')]({'where':{'ChanSpyId':_0x26d587['id']}})[_0x157a('0x18')](function(){_0x35bdca();})[_0x157a('0x19')](function(_0x593b0b){_0x35bdca(_0x593b0b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9a80751..b78c1b7 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 _0xad8a=['../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26893a,_0x29d3cf){var _0x443af0=function(_0x287226){while(--_0x287226){_0x26893a['push'](_0x26893a['shift']());}};_0x443af0(++_0x29d3cf);}(_0xad8a,0xb0));var _0xaad8=function(_0x2a5913,_0x1e1a7b){_0x2a5913=_0x2a5913-0x0;var _0x2f47a1=_0xad8a[_0x2a5913];return _0x2f47a1;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var moment=require(_0xaad8('0x2'));var BPromise=require(_0xaad8('0x3'));var rs=require(_0xaad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad8('0x5'))['db'];var utils=require(_0xaad8('0x6'));var logger=require(_0xaad8('0x7'))('rpc');var config=require(_0xaad8('0x8'));var jayson=require(_0xaad8('0x9'));var client=jayson[_0xaad8('0xa')][_0xaad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x95aef9,_0x39c599,_0x28f3a1){return new BPromise(function(_0xf3a6c7,_0x11408a){return client[_0xaad8('0xc')](_0x95aef9,_0x28f3a1)['then'](function(_0x52477f){logger[_0xaad8('0xd')](_0xaad8('0xe'),_0x39c599,_0xaad8('0xf'));logger[_0xaad8('0x10')](_0xaad8('0x11'),_0x39c599,_0xaad8('0xf'),JSON[_0xaad8('0x12')](_0x52477f));if(_0x52477f[_0xaad8('0x13')]){if(_0x52477f[_0xaad8('0x13')]['code']===0x1f4){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0x11408a(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0xf3a6c7(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}else{logger[_0xaad8('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x39c599,_0xaad8('0xf'));_0xf3a6c7(_0x52477f[_0xaad8('0x15')]['message']);}})[_0xaad8('0x16')](function(_0x2a8e12){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x2a8e12);_0x11408a(_0x2a8e12);});});} \ No newline at end of file +var _0x1339=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x7059d1,_0x4d7886){var _0x3b94b8=function(_0x294574){while(--_0x294574){_0x7059d1['push'](_0x7059d1['shift']());}};_0x3b94b8(++_0x4d7886);}(_0x1339,0x1ed));var _0x9133=function(_0x37271e,_0x2c2d9d){_0x37271e=_0x37271e-0x0;var _0x528391=_0x1339[_0x37271e];return _0x528391;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e26a71f..40cc7fb 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 _0x6583=['isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceContext.controller'];(function(_0x2ca95c,_0x4553aa){var _0x5a6d00=function(_0x3df782){while(--_0x3df782){_0x2ca95c['push'](_0x2ca95c['shift']());}};_0x5a6d00(++_0x4553aa);}(_0x6583,0x1ec));var _0x3658=function(_0x5c4d30,_0x2bc47a){_0x5c4d30=_0x5c4d30-0x0;var _0x120851=_0x6583[_0x5c4d30];return _0x120851;};'use strict';var multer=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var path=require(_0x3658('0x2'));var timeout=require(_0x3658('0x3'));var express=require(_0x3658('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3658('0x5'));var interaction=require(_0x3658('0x6'));var config=require('../../config/environment');var controller=require(_0x3658('0x7'));router['get']('/',auth[_0x3658('0x8')](),controller[_0x3658('0x9')]);router[_0x3658('0xa')]('/:id',auth[_0x3658('0x8')](),controller[_0x3658('0xb')]);router[_0x3658('0xc')]('/',auth[_0x3658('0x8')](),controller[_0x3658('0xd')]);router[_0x3658('0xe')](_0x3658('0xf'),auth[_0x3658('0x8')](),controller[_0x3658('0x10')]);router[_0x3658('0x11')](_0x3658('0xf'),auth[_0x3658('0x8')](),controller[_0x3658('0x12')]);module[_0x3658('0x13')]=router; \ No newline at end of file +var _0x27db=['./voiceContext.controller','get','isAuthenticated','index','/:id','post','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16819b,_0x1c5454){var _0x1f238e=function(_0x141df6){while(--_0x141df6){_0x16819b['push'](_0x16819b['shift']());}};_0x1f238e(++_0x1c5454);}(_0x27db,0x88));var _0xb27d=function(_0x2f65e0,_0xb62de2){_0x2f65e0=_0x2f65e0-0x0;var _0x3fbef7=_0x27db[_0x2f65e0];return _0x3fbef7;};'use strict';var multer=require('multer');var util=require(_0xb27d('0x0'));var path=require(_0xb27d('0x1'));var timeout=require(_0xb27d('0x2'));var express=require(_0xb27d('0x3'));var router=express[_0xb27d('0x4')]();var fs_extra=require(_0xb27d('0x5'));var auth=require(_0xb27d('0x6'));var interaction=require(_0xb27d('0x7'));var config=require('../../config/environment');var controller=require(_0xb27d('0x8'));router[_0xb27d('0x9')]('/',auth[_0xb27d('0xa')](),controller[_0xb27d('0xb')]);router[_0xb27d('0x9')](_0xb27d('0xc'),auth[_0xb27d('0xa')](),controller['show']);router[_0xb27d('0xd')]('/',auth[_0xb27d('0xa')](),controller['create']);router[_0xb27d('0xe')](_0xb27d('0xc'),auth['isAuthenticated'](),controller[_0xb27d('0xf')]);router[_0xb27d('0x10')]('/:id',auth[_0xb27d('0xa')](),controller['destroy']);module[_0xb27d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e798c63..fa39caa 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 _0x1ef0=['exports','STRING','name'];(function(_0x24e8db,_0x89fc47){var _0x576cc1=function(_0x58f214){while(--_0x58f214){_0x24e8db['push'](_0x24e8db['shift']());}};_0x576cc1(++_0x89fc47);}(_0x1ef0,0x138));var _0x01ef=function(_0x33a0bb,_0x5c268b){_0x33a0bb=_0x33a0bb-0x0;var _0x229f56=_0x1ef0[_0x33a0bb];return _0x229f56;};'use strict';var Sequelize=require('sequelize');module[_0x01ef('0x0')]={'name':{'type':Sequelize[_0x01ef('0x1')],'unique':_0x01ef('0x2')},'description':{'type':Sequelize[_0x01ef('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x298e=['name','BOOLEAN','sequelize','STRING'];(function(_0x586de3,_0x21b54e){var _0x496199=function(_0xd906ca){while(--_0xd906ca){_0x586de3['push'](_0x586de3['shift']());}};_0x496199(++_0x21b54e);}(_0x298e,0xfe));var _0xe298=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x298e[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xe298('0x0'));module['exports']={'name':{'type':Sequelize[_0xe298('0x1')],'unique':_0xe298('0x2')},'description':{'type':Sequelize[_0xe298('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe298('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index a5cc497..b9304eb 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 _0x1515=['hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','show','params','create','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','readFileSync','root','utf8','writeFileSync','Reload','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length'];(function(_0x2f6445,_0x1bfd22){var _0x4fb590=function(_0x5c1358){while(--_0x5c1358){_0x2f6445['push'](_0x2f6445['shift']());}};_0x4fb590(++_0x1bfd22);}(_0x1515,0x86));var _0x5151=function(_0xa0c114,_0x316cc2){_0xa0c114=_0xa0c114-0x0;var _0x55702b=_0x1515[_0xa0c114];return _0x55702b;};'use strict';var emlformat=require(_0x5151('0x0'));var rimraf=require(_0x5151('0x1'));var zipdir=require(_0x5151('0x2'));var jsonpatch=require(_0x5151('0x3'));var rp=require(_0x5151('0x4'));var moment=require(_0x5151('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5151('0x6'));var util=require(_0x5151('0x7'));var path=require(_0x5151('0x8'));var sox=require(_0x5151('0x9'));var csv=require('to-csv');var ejs=require(_0x5151('0xa'));var fs=require('fs');var fs_extra=require(_0x5151('0xb'));var _=require(_0x5151('0xc'));var squel=require(_0x5151('0xd'));var crypto=require(_0x5151('0xe'));var jsforce=require(_0x5151('0xf'));var deskjs=require(_0x5151('0x10'));var toCsv=require(_0x5151('0x11'));var querystring=require(_0x5151('0x12'));var Papa=require(_0x5151('0x13'));var Redis=require(_0x5151('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5151('0x15'));var as=require(_0x5151('0x16'));var hardwareService=require(_0x5151('0x17'));var logger=require(_0x5151('0x18'))('api');var utils=require(_0x5151('0x19'));var config=require(_0x5151('0x1a'));var licenseUtil=require(_0x5151('0x1b'));var db=require(_0x5151('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33951c,_0x35735d,_0x1e18ad,_0x2ed2c6){return new BPromise(function(_0x4a5c8d,_0x4d19b6){var _0x211996=_0x2ed2c6||client;return _0x211996[_0x5151('0x1d')](_0x33951c,_0x1e18ad)[_0x5151('0x1e')](function(_0x4440e4){logger[_0x5151('0x1f')](_0x5151('0x20'),_0x35735d,_0x5151('0x21'));logger[_0x5151('0x22')](_0x5151('0x23'),_0x35735d,_0x5151('0x21'),JSON['stringify'](_0x4440e4));if(_0x4440e4[_0x5151('0x24')]){if(_0x4440e4[_0x5151('0x24')][_0x5151('0x25')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x35735d,_0x4440e4[_0x5151('0x24')]['message']);return _0x4d19b6(_0x4440e4['error'][_0x5151('0x26')]);}logger['error'](_0x5151('0x20'),_0x35735d,_0x4440e4['error']['message']);return _0x4a5c8d(_0x4440e4['error'][_0x5151('0x26')]);}else{logger[_0x5151('0x1f')](_0x5151('0x20'),_0x35735d,_0x5151('0x21'));_0x4a5c8d(_0x4440e4[_0x5151('0x27')][_0x5151('0x26')]);}})[_0x5151('0x28')](function(_0x452bcd){logger[_0x5151('0x24')](_0x5151('0x20'),_0x35735d,_0x452bcd);_0x4d19b6(_0x452bcd);});});}function respondWithStatusCode(_0x4924a0,_0x4fe99b){_0x4fe99b=_0x4fe99b||0xcc;return function(_0x55b131){if(_0x55b131){return _0x4924a0[_0x5151('0x29')](_0x4fe99b);}return _0x4924a0[_0x5151('0x2a')](_0x4fe99b)[_0x5151('0x2b')]();};}function respondWithResult(_0x85acb4,_0xabfab4){_0xabfab4=_0xabfab4||0xc8;return function(_0x21b538){if(_0x21b538){return _0x85acb4[_0x5151('0x2a')](_0xabfab4)['json'](_0x21b538);}};}function respondWithFilteredResult(_0x300df6,_0x20b8ff){return function(_0x3f9f2b){if(_0x3f9f2b){var _0x186986=typeof _0x20b8ff[_0x5151('0x2c')]===_0x5151('0x2d')&&typeof _0x20b8ff[_0x5151('0x2e')]===_0x5151('0x2d');var _0x21b2ac=_0x3f9f2b[_0x5151('0x2f')];var _0x4af288=_0x186986?0x0:_0x20b8ff[_0x5151('0x2c')];var _0x113620=_0x186986?_0x3f9f2b[_0x5151('0x2f')]:_0x20b8ff[_0x5151('0x2c')]+_0x20b8ff['limit'];var _0x128ba8;if(_0x113620>=_0x21b2ac){_0x113620=_0x21b2ac;_0x128ba8=0xc8;}else{_0x128ba8=0xce;}_0x300df6[_0x5151('0x2a')](_0x128ba8);return _0x300df6[_0x5151('0x30')]('Content-Range',_0x4af288+'-'+_0x113620+'/'+_0x21b2ac)['json'](_0x3f9f2b);}return null;};}function patchUpdates(_0x4547ff){return function(_0x576e28){try{jsonpatch[_0x5151('0x31')](_0x576e28,_0x4547ff,!![]);}catch(_0xee2965){return BPromise[_0x5151('0x32')](_0xee2965);}return _0x576e28[_0x5151('0x33')]();};}function saveUpdates(_0x44a7a4,_0x43fcc8){return function(_0x34f338){if(_0x34f338){return _0x34f338['update'](_0x44a7a4)[_0x5151('0x1e')](function(_0x218779){return _0x218779;});}return null;};}function removeEntity(_0x4a8e90,_0x21aae1){return function(_0x2e4915){if(_0x2e4915){return _0x2e4915[_0x5151('0x34')]()[_0x5151('0x1e')](function(){var _0x4becba=_0x2e4915[_0x5151('0x35')]({'plain':!![]});var _0x4e46c8='Contexts';return db[_0x5151('0x36')]['destroy']({'where':{'type':_0x4e46c8,'resourceId':_0x4becba['id']}})[_0x5151('0x1e')](function(){return _0x2e4915;});})[_0x5151('0x1e')](function(){_0x4a8e90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x593fce,_0x467c1b){return function(_0xb67c07){if(!_0xb67c07){_0x593fce[_0x5151('0x29')](0x194);}return _0xb67c07;};}function handleError(_0x38de01,_0x1b3c6c){_0x1b3c6c=_0x1b3c6c||0x1f4;return function(_0x233262){logger[_0x5151('0x24')](_0x233262[_0x5151('0x37')]);if(_0x233262[_0x5151('0x38')]){delete _0x233262['name'];}_0x38de01[_0x5151('0x2a')](_0x1b3c6c)[_0x5151('0x39')](_0x233262);};}exports[_0x5151('0x3a')]=function(_0x26ed75,_0x59a882){var _0x4619b1={},_0x5f58f1={},_0x5bee88={'count':0x0,'rows':[]};var _0x33dfe1=_[_0x5151('0x3b')](db[_0x5151('0x3c')]['rawAttributes'],function(_0x2e86ba){return{'name':_0x2e86ba[_0x5151('0x3d')],'type':_0x2e86ba[_0x5151('0x3e')][_0x5151('0x3f')]};});_0x5f58f1['model']=_[_0x5151('0x3b')](_0x33dfe1,'name');_0x5f58f1[_0x5151('0x40')]=_[_0x5151('0x41')](_0x26ed75['query']);_0x5f58f1[_0x5151('0x42')]=_[_0x5151('0x43')](_0x5f58f1['model'],_0x5f58f1[_0x5151('0x40')]);_0x4619b1['attributes']=_[_0x5151('0x43')](_0x5f58f1[_0x5151('0x44')],qs[_0x5151('0x45')](_0x26ed75[_0x5151('0x40')][_0x5151('0x45')]));_0x4619b1[_0x5151('0x46')]=_0x4619b1[_0x5151('0x46')][_0x5151('0x47')]?_0x4619b1['attributes']:_0x5f58f1[_0x5151('0x44')];if(!_0x26ed75['query'][_0x5151('0x48')](_0x5151('0x49'))){_0x4619b1['limit']=qs[_0x5151('0x2e')](_0x26ed75[_0x5151('0x40')][_0x5151('0x2e')]);_0x4619b1['offset']=qs[_0x5151('0x2c')](_0x26ed75[_0x5151('0x40')][_0x5151('0x2c')]);}_0x4619b1[_0x5151('0x4a')]=qs[_0x5151('0x4b')](_0x26ed75[_0x5151('0x40')][_0x5151('0x4b')]);_0x4619b1[_0x5151('0x4c')]=qs[_0x5151('0x42')](_['pick'](_0x26ed75[_0x5151('0x40')],_0x5f58f1[_0x5151('0x42')]),_0x33dfe1);if(_0x26ed75[_0x5151('0x40')][_0x5151('0x4d')]){_0x4619b1[_0x5151('0x4c')]=_['merge'](_0x4619b1['where'],{'$or':_[_0x5151('0x3b')](_0x33dfe1,function(_0x3c815a){if(_0x3c815a[_0x5151('0x3e')]!==_0x5151('0x4e')){var _0x5ae900={};_0x5ae900[_0x3c815a[_0x5151('0x38')]]={'$like':'%'+_0x26ed75['query'][_0x5151('0x4d')]+'%'};return _0x5ae900;}})});}_0x4619b1=_[_0x5151('0x4f')]({},_0x4619b1,_0x26ed75['options']);var _0x5bf2d5={'where':_0x4619b1[_0x5151('0x4c')]};return db[_0x5151('0x3c')][_0x5151('0x2f')](_0x5bf2d5)[_0x5151('0x1e')](function(_0x4fdf05){_0x5bee88['count']=_0x4fdf05;if(_0x26ed75[_0x5151('0x40')]['includeAll']){_0x4619b1[_0x5151('0x50')]=[{'all':!![]}];}return db[_0x5151('0x3c')][_0x5151('0x51')](_0x4619b1);})['then'](function(_0xe684de){_0x5bee88[_0x5151('0x52')]=_0xe684de;return _0x5bee88;})['then'](respondWithFilteredResult(_0x59a882,_0x4619b1))[_0x5151('0x28')](handleError(_0x59a882,null));};exports[_0x5151('0x53')]=function(_0xaa67f0,_0x285209){var _0x32269f={'raw':![],'where':{'id':_0xaa67f0[_0x5151('0x54')]['id']}},_0x59c8d1={};_0x59c8d1[_0x5151('0x44')]=_['keys'](db[_0x5151('0x3c')]['rawAttributes']);_0x59c8d1[_0x5151('0x40')]=_[_0x5151('0x41')](_0xaa67f0[_0x5151('0x40')]);_0x59c8d1[_0x5151('0x42')]=_[_0x5151('0x43')](_0x59c8d1[_0x5151('0x44')],_0x59c8d1[_0x5151('0x40')]);_0x32269f[_0x5151('0x46')]=_[_0x5151('0x43')](_0x59c8d1[_0x5151('0x44')],qs['fields'](_0xaa67f0['query'][_0x5151('0x45')]));_0x32269f[_0x5151('0x46')]=_0x32269f['attributes'][_0x5151('0x47')]?_0x32269f[_0x5151('0x46')]:_0x59c8d1['model'];if(_0xaa67f0[_0x5151('0x40')]['includeAll']){_0x32269f[_0x5151('0x50')]=[{'all':!![]}];}_0x32269f=_[_0x5151('0x4f')]({},_0x32269f,_0xaa67f0['options']);return db[_0x5151('0x3c')]['find'](_0x32269f)[_0x5151('0x1e')](handleEntityNotFound(_0x285209,null))['then'](respondWithResult(_0x285209,null))[_0x5151('0x28')](handleError(_0x285209,null));};exports[_0x5151('0x55')]=function(_0x3b5578,_0x163753,_0x23783d){var _0x32de24;return db[_0x5151('0x3c')][_0x5151('0x55')](_0x3b5578['body'],{'raw':!![]})[_0x5151('0x1e')](function(_0x1cc916){_0x32de24=_0x1cc916;return db['VoiceContext'][_0x5151('0x51')]({'raw':!![]});})[_0x5151('0x1e')](function(_0x300653){var _0x521577=fs['readFileSync'](path['join'](config['root'],_0x5151('0x56')),'utf8');var _0x393993=ejs[_0x5151('0x57')](_0x521577,{'contexts':_0x300653||[]});fs['writeFileSync'](_0x5151('0x58'),_0x393993);})['then'](function(){return respondWithRpcPromise('Reload',_0x5151('0x55'),{'module':_0x5151('0x59')});})[_0x5151('0x1e')](function(){var _0x1da57e=_0x3b5578[_0x5151('0x5a')]['get']({'plain':!![]});if(!_0x1da57e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da57e[_0x5151('0x5b')]===_0x5151('0x5a')){var _0x169b8c=_0x32de24[_0x5151('0x35')]({'plain':!![]});return db[_0x5151('0x5c')]['find']({'where':{'name':'Contexts','userProfileId':_0x1da57e['userProfileId']},'raw':!![]})[_0x5151('0x1e')](function(_0x3b41bd){if(_0x3b41bd&&_0x3b41bd[_0x5151('0x5d')]===0x0){return db['UserProfileResource'][_0x5151('0x55')]({'name':_0x169b8c[_0x5151('0x38')],'resourceId':_0x169b8c['id'],'type':_0x3b41bd[_0x5151('0x38')],'sectionId':_0x3b41bd['id']},{})['then'](function(){return _0x32de24;});}else{return _0x32de24;}})[_0x5151('0x28')](function(_0x4be29f){logger['error'](_0x5151('0x5e'),_0x4be29f);throw _0x4be29f;});}return _0x32de24;})[_0x5151('0x1e')](respondWithResult(_0x163753,0xc9))[_0x5151('0x28')](handleError(_0x163753,null));};exports[_0x5151('0x5f')]=function(_0xef081f,_0x4814d7,_0x46c0a4){var _0x42e36a;return db['VoiceContext']['find']({'where':{'id':_0xef081f[_0x5151('0x54')]['id']}})[_0x5151('0x1e')](handleEntityNotFound(_0x4814d7,null))[_0x5151('0x1e')](saveUpdates(_0xef081f[_0x5151('0x60')],null))[_0x5151('0x1e')](function(_0x31252d){if(_0x31252d){_0x42e36a=_0x31252d;return db['VoiceContext'][_0x5151('0x51')]({'raw':!![]});}})['then'](function(_0x1a819b){var _0x3d0e67=fs[_0x5151('0x61')](path['join'](config[_0x5151('0x62')],_0x5151('0x56')),_0x5151('0x63'));var _0x3e5522=ejs[_0x5151('0x57')](_0x3d0e67,{'contexts':_0x1a819b||[]});fs[_0x5151('0x64')](_0x5151('0x58'),_0x3e5522);})[_0x5151('0x1e')](function(){return respondWithRpcPromise(_0x5151('0x65'),_0x5151('0x5f'),{'module':'chan_sip.so'});})['then'](function(){return _0x42e36a;})[_0x5151('0x1e')](respondWithResult(_0x4814d7,null))[_0x5151('0x28')](handleError(_0x4814d7,null));};exports['destroy']=function(_0x494e17,_0x10f434,_0x2c1a21){var _0xd7e879;return db[_0x5151('0x3c')]['find']({'where':{'id':_0x494e17[_0x5151('0x54')]['id']}})[_0x5151('0x1e')](handleEntityNotFound(_0x10f434,null))[_0x5151('0x1e')](removeEntity(_0x10f434,null))['then'](function(){return db[_0x5151('0x3c')]['findAll']({'raw':!![]});})[_0x5151('0x1e')](function(_0x5e15e0){var _0x90be3d=fs[_0x5151('0x61')](path[_0x5151('0x66')](config[_0x5151('0x62')],_0x5151('0x56')),_0x5151('0x63'));var _0x5a54c1=ejs[_0x5151('0x57')](_0x90be3d,{'contexts':_0x5e15e0});fs['writeFileSync'](_0x5151('0x58'),_0x5a54c1);return respondWithRpcPromise('Reload',_0x5151('0x34'),{'module':_0x5151('0x59')});})[_0x5151('0x28')](handleError(_0x10f434,null));}; \ No newline at end of file +var _0x1e18=['params','body','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','sendStatus','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','length','create','readFileSync','join','root','utf8','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Contexts','userProfileId','UserProfileResource'];(function(_0x254a19,_0x7b092b){var _0xba020a=function(_0x231bb3){while(--_0x231bb3){_0x254a19['push'](_0x254a19['shift']());}};_0xba020a(++_0x7b092b);}(_0x1e18,0xd7));var _0x81e1=function(_0xffdec4,_0x322bec){_0xffdec4=_0xffdec4-0x0;var _0x479138=_0x1e18[_0xffdec4];return _0x479138;};'use strict';var emlformat=require(_0x81e1('0x0'));var rimraf=require(_0x81e1('0x1'));var zipdir=require(_0x81e1('0x2'));var jsonpatch=require(_0x81e1('0x3'));var rp=require(_0x81e1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81e1('0x5'));var util=require('util');var path=require(_0x81e1('0x6'));var sox=require(_0x81e1('0x7'));var csv=require('to-csv');var ejs=require(_0x81e1('0x8'));var fs=require('fs');var fs_extra=require(_0x81e1('0x9'));var _=require(_0x81e1('0xa'));var squel=require(_0x81e1('0xb'));var crypto=require(_0x81e1('0xc'));var jsforce=require(_0x81e1('0xd'));var deskjs=require(_0x81e1('0xe'));var toCsv=require(_0x81e1('0xf'));var querystring=require(_0x81e1('0x10'));var Papa=require(_0x81e1('0x11'));var Redis=require('ioredis');var authService=require(_0x81e1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x81e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81e1('0x14'))(_0x81e1('0x15'));var utils=require('../../config/utils');var config=require(_0x81e1('0x16'));var licenseUtil=require(_0x81e1('0x17'));var db=require(_0x81e1('0x18'))['db'];var jayson=require(_0x81e1('0x19'));var client=jayson[_0x81e1('0x1a')][_0x81e1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1d35ba,_0x4415c3,_0x24f58c,_0x3545d2){return new BPromise(function(_0x2e1eb3,_0x22f460){var _0x55fe7c=_0x3545d2||client;return _0x55fe7c['request'](_0x1d35ba,_0x24f58c)[_0x81e1('0x1c')](function(_0x46bc05){logger[_0x81e1('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x4415c3,_0x81e1('0x1e'));logger[_0x81e1('0x1f')](_0x81e1('0x20'),_0x4415c3,_0x81e1('0x1e'),JSON[_0x81e1('0x21')](_0x46bc05));if(_0x46bc05[_0x81e1('0x22')]){if(_0x46bc05[_0x81e1('0x22')][_0x81e1('0x23')]===0x1f4){logger['error'](_0x81e1('0x24'),_0x4415c3,_0x46bc05['error'][_0x81e1('0x25')]);return _0x22f460(_0x46bc05[_0x81e1('0x22')][_0x81e1('0x25')]);}logger[_0x81e1('0x22')](_0x81e1('0x24'),_0x4415c3,_0x46bc05['error'][_0x81e1('0x25')]);return _0x2e1eb3(_0x46bc05['error'][_0x81e1('0x25')]);}else{logger[_0x81e1('0x1d')](_0x81e1('0x24'),_0x4415c3,_0x81e1('0x1e'));_0x2e1eb3(_0x46bc05[_0x81e1('0x26')][_0x81e1('0x25')]);}})[_0x81e1('0x27')](function(_0x12f79e){logger['error'](_0x81e1('0x24'),_0x4415c3,_0x12f79e);_0x22f460(_0x12f79e);});});}function respondWithStatusCode(_0x4a3352,_0x41bd64){_0x41bd64=_0x41bd64||0xcc;return function(_0x43a73a){if(_0x43a73a){return _0x4a3352['sendStatus'](_0x41bd64);}return _0x4a3352[_0x81e1('0x28')](_0x41bd64)[_0x81e1('0x29')]();};}function respondWithResult(_0x45b23e,_0x5886d0){_0x5886d0=_0x5886d0||0xc8;return function(_0x2962de){if(_0x2962de){return _0x45b23e[_0x81e1('0x28')](_0x5886d0)[_0x81e1('0x2a')](_0x2962de);}};}function respondWithFilteredResult(_0x11a683,_0x248f96){return function(_0x528547){if(_0x528547){var _0x383945=typeof _0x248f96[_0x81e1('0x2b')]===_0x81e1('0x2c')&&typeof _0x248f96[_0x81e1('0x2d')]==='undefined';var _0x884a70=_0x528547[_0x81e1('0x2e')];var _0x172385=_0x383945?0x0:_0x248f96['offset'];var _0x599ed1=_0x383945?_0x528547['count']:_0x248f96[_0x81e1('0x2b')]+_0x248f96['limit'];var _0x5c1502;if(_0x599ed1>=_0x884a70){_0x599ed1=_0x884a70;_0x5c1502=0xc8;}else{_0x5c1502=0xce;}_0x11a683[_0x81e1('0x28')](_0x5c1502);return _0x11a683[_0x81e1('0x2f')](_0x81e1('0x30'),_0x172385+'-'+_0x599ed1+'/'+_0x884a70)['json'](_0x528547);}return null;};}function patchUpdates(_0x48e57a){return function(_0xd5fc79){try{jsonpatch['apply'](_0xd5fc79,_0x48e57a,!![]);}catch(_0x3d9852){return BPromise[_0x81e1('0x31')](_0x3d9852);}return _0xd5fc79[_0x81e1('0x32')]();};}function saveUpdates(_0x118ea2,_0x2d8bba){return function(_0x10fb4c){if(_0x10fb4c){return _0x10fb4c[_0x81e1('0x33')](_0x118ea2)['then'](function(_0x3d1c6b){return _0x3d1c6b;});}return null;};}function removeEntity(_0x23cac9,_0x49531a){return function(_0x19f662){if(_0x19f662){return _0x19f662[_0x81e1('0x34')]()[_0x81e1('0x1c')](function(){var _0x5212a9=_0x19f662[_0x81e1('0x35')]({'plain':!![]});var _0x532319='Contexts';return db['UserProfileResource'][_0x81e1('0x34')]({'where':{'type':_0x532319,'resourceId':_0x5212a9['id']}})[_0x81e1('0x1c')](function(){return _0x19f662;});})['then'](function(){_0x23cac9[_0x81e1('0x28')](0xcc)[_0x81e1('0x29')]();});}};}function handleEntityNotFound(_0x5552a2,_0x550fb8){return function(_0x1c931a){if(!_0x1c931a){_0x5552a2[_0x81e1('0x36')](0x194);}return _0x1c931a;};}function handleError(_0x1a7a4b,_0x367f4e){_0x367f4e=_0x367f4e||0x1f4;return function(_0x3e8659){logger[_0x81e1('0x22')](_0x3e8659[_0x81e1('0x37')]);if(_0x3e8659[_0x81e1('0x38')]){delete _0x3e8659[_0x81e1('0x38')];}_0x1a7a4b[_0x81e1('0x28')](_0x367f4e)[_0x81e1('0x39')](_0x3e8659);};}exports[_0x81e1('0x3a')]=function(_0x48569d,_0x50febd){var _0x49dba4={},_0x3f7832={},_0x190b8e={'count':0x0,'rows':[]};var _0x1a9a96=_['map'](db[_0x81e1('0x3b')][_0x81e1('0x3c')],function(_0x3cacfa){return{'name':_0x3cacfa[_0x81e1('0x3d')],'type':_0x3cacfa[_0x81e1('0x3e')][_0x81e1('0x3f')]};});_0x3f7832[_0x81e1('0x40')]=_[_0x81e1('0x41')](_0x1a9a96,_0x81e1('0x38'));_0x3f7832[_0x81e1('0x42')]=_['keys'](_0x48569d[_0x81e1('0x42')]);_0x3f7832[_0x81e1('0x43')]=_[_0x81e1('0x44')](_0x3f7832[_0x81e1('0x40')],_0x3f7832[_0x81e1('0x42')]);_0x49dba4[_0x81e1('0x45')]=_['intersection'](_0x3f7832[_0x81e1('0x40')],qs[_0x81e1('0x46')](_0x48569d[_0x81e1('0x42')]['fields']));_0x49dba4['attributes']=_0x49dba4[_0x81e1('0x45')]['length']?_0x49dba4[_0x81e1('0x45')]:_0x3f7832[_0x81e1('0x40')];if(!_0x48569d[_0x81e1('0x42')][_0x81e1('0x47')](_0x81e1('0x48'))){_0x49dba4[_0x81e1('0x2d')]=qs[_0x81e1('0x2d')](_0x48569d[_0x81e1('0x42')][_0x81e1('0x2d')]);_0x49dba4[_0x81e1('0x2b')]=qs[_0x81e1('0x2b')](_0x48569d['query'][_0x81e1('0x2b')]);}_0x49dba4['order']=qs['sort'](_0x48569d[_0x81e1('0x42')]['sort']);_0x49dba4['where']=qs[_0x81e1('0x43')](_[_0x81e1('0x49')](_0x48569d[_0x81e1('0x42')],_0x3f7832[_0x81e1('0x43')]),_0x1a9a96);if(_0x48569d['query'][_0x81e1('0x4a')]){_0x49dba4[_0x81e1('0x4b')]=_[_0x81e1('0x4c')](_0x49dba4['where'],{'$or':_['map'](_0x1a9a96,function(_0x3a6d2d){if(_0x3a6d2d['type']!==_0x81e1('0x4d')){var _0x59b7a2={};_0x59b7a2[_0x3a6d2d[_0x81e1('0x38')]]={'$like':'%'+_0x48569d['query'][_0x81e1('0x4a')]+'%'};return _0x59b7a2;}})});}_0x49dba4=_[_0x81e1('0x4c')]({},_0x49dba4,_0x48569d['options']);var _0x2a0760={'where':_0x49dba4[_0x81e1('0x4b')]};return db['VoiceContext'][_0x81e1('0x2e')](_0x2a0760)[_0x81e1('0x1c')](function(_0xc9d558){_0x190b8e['count']=_0xc9d558;if(_0x48569d[_0x81e1('0x42')][_0x81e1('0x4e')]){_0x49dba4[_0x81e1('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x81e1('0x50')](_0x49dba4);})[_0x81e1('0x1c')](function(_0x348ff9){_0x190b8e[_0x81e1('0x51')]=_0x348ff9;return _0x190b8e;})['then'](respondWithFilteredResult(_0x50febd,_0x49dba4))['catch'](handleError(_0x50febd,null));};exports[_0x81e1('0x52')]=function(_0x5bb110,_0x184193){var _0x3a521a={'raw':![],'where':{'id':_0x5bb110['params']['id']}},_0x57a267={};_0x57a267[_0x81e1('0x40')]=_[_0x81e1('0x53')](db[_0x81e1('0x3b')][_0x81e1('0x3c')]);_0x57a267[_0x81e1('0x42')]=_['keys'](_0x5bb110['query']);_0x57a267[_0x81e1('0x43')]=_['intersection'](_0x57a267[_0x81e1('0x40')],_0x57a267['query']);_0x3a521a[_0x81e1('0x45')]=_[_0x81e1('0x44')](_0x57a267['model'],qs[_0x81e1('0x46')](_0x5bb110['query']['fields']));_0x3a521a[_0x81e1('0x45')]=_0x3a521a[_0x81e1('0x45')][_0x81e1('0x54')]?_0x3a521a[_0x81e1('0x45')]:_0x57a267[_0x81e1('0x40')];if(_0x5bb110['query'][_0x81e1('0x4e')]){_0x3a521a[_0x81e1('0x4f')]=[{'all':!![]}];}_0x3a521a=_[_0x81e1('0x4c')]({},_0x3a521a,_0x5bb110['options']);return db[_0x81e1('0x3b')]['find'](_0x3a521a)['then'](handleEntityNotFound(_0x184193,null))['then'](respondWithResult(_0x184193,null))[_0x81e1('0x27')](handleError(_0x184193,null));};exports[_0x81e1('0x55')]=function(_0x21dd9c,_0x32d912,_0x18d6bc){var _0x314a63;return db[_0x81e1('0x3b')]['create'](_0x21dd9c['body'],{'raw':!![]})['then'](function(_0x74deb7){_0x314a63=_0x74deb7;return db[_0x81e1('0x3b')][_0x81e1('0x50')]({'raw':!![]});})[_0x81e1('0x1c')](function(_0x24f2a2){var _0x31b594=fs[_0x81e1('0x56')](path[_0x81e1('0x57')](config[_0x81e1('0x58')],'server/files/templates/context.ejs'),_0x81e1('0x59'));var _0x4544c4=ejs['render'](_0x31b594,{'contexts':_0x24f2a2||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x4544c4);})[_0x81e1('0x1c')](function(){return respondWithRpcPromise(_0x81e1('0x5a'),_0x81e1('0x55'),{'module':_0x81e1('0x5b')});})[_0x81e1('0x1c')](function(){var _0x451c0c=_0x21dd9c[_0x81e1('0x5c')][_0x81e1('0x35')]({'plain':!![]});if(!_0x451c0c)throw new Error(_0x81e1('0x5d'));if(_0x451c0c[_0x81e1('0x5e')]===_0x81e1('0x5c')){var _0x171afa=_0x314a63['get']({'plain':!![]});return db[_0x81e1('0x5f')][_0x81e1('0x60')]({'where':{'name':_0x81e1('0x61'),'userProfileId':_0x451c0c[_0x81e1('0x62')]},'raw':!![]})[_0x81e1('0x1c')](function(_0x66710b){if(_0x66710b&&_0x66710b['autoAssociation']===0x0){return db[_0x81e1('0x63')][_0x81e1('0x55')]({'name':_0x171afa[_0x81e1('0x38')],'resourceId':_0x171afa['id'],'type':_0x66710b[_0x81e1('0x38')],'sectionId':_0x66710b['id']},{})[_0x81e1('0x1c')](function(){return _0x314a63;});}else{return _0x314a63;}})[_0x81e1('0x27')](function(_0x535b67){logger[_0x81e1('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x535b67);throw _0x535b67;});}return _0x314a63;})[_0x81e1('0x1c')](respondWithResult(_0x32d912,0xc9))['catch'](handleError(_0x32d912,null));};exports[_0x81e1('0x33')]=function(_0x3a6149,_0x2b3d60,_0x2b12cb){var _0x37811f;return db['VoiceContext']['find']({'where':{'id':_0x3a6149[_0x81e1('0x64')]['id']}})[_0x81e1('0x1c')](handleEntityNotFound(_0x2b3d60,null))[_0x81e1('0x1c')](saveUpdates(_0x3a6149[_0x81e1('0x65')],null))[_0x81e1('0x1c')](function(_0x180a7e){if(_0x180a7e){_0x37811f=_0x180a7e;return db[_0x81e1('0x3b')][_0x81e1('0x50')]({'raw':!![]});}})[_0x81e1('0x1c')](function(_0x5dcc3c){var _0x12d823=fs[_0x81e1('0x56')](path[_0x81e1('0x57')](config[_0x81e1('0x58')],_0x81e1('0x66')),_0x81e1('0x59'));var _0x28f4b0=ejs['render'](_0x12d823,{'contexts':_0x5dcc3c||[]});fs['writeFileSync'](_0x81e1('0x67'),_0x28f4b0);})['then'](function(){return respondWithRpcPromise(_0x81e1('0x5a'),_0x81e1('0x33'),{'module':_0x81e1('0x5b')});})[_0x81e1('0x1c')](function(){return _0x37811f;})['then'](respondWithResult(_0x2b3d60,null))[_0x81e1('0x27')](handleError(_0x2b3d60,null));};exports[_0x81e1('0x34')]=function(_0x53829f,_0x3d4e14,_0x34f7d2){var _0x5b0e42;return db['VoiceContext']['find']({'where':{'id':_0x53829f['params']['id']}})[_0x81e1('0x1c')](handleEntityNotFound(_0x3d4e14,null))[_0x81e1('0x1c')](removeEntity(_0x3d4e14,null))['then'](function(){return db[_0x81e1('0x3b')][_0x81e1('0x50')]({'raw':!![]});})[_0x81e1('0x1c')](function(_0x2ab459){var _0x94741c=fs['readFileSync'](path['join'](config[_0x81e1('0x58')],_0x81e1('0x66')),_0x81e1('0x59'));var _0x246e49=ejs['render'](_0x94741c,{'contexts':_0x2ab459});fs[_0x81e1('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x246e49);return respondWithRpcPromise('Reload',_0x81e1('0x34'),{'module':_0x81e1('0x5b')});})[_0x81e1('0x27')](handleError(_0x3d4e14,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 9083abe..eda899d 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 _0xa3e8=['path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x308bdd,_0x4fd4bc){var _0x435bdd=function(_0x29f493){while(--_0x29f493){_0x308bdd['push'](_0x308bdd['shift']());}};_0x435bdd(++_0x4fd4bc);}(_0xa3e8,0x1a7));var _0x8a3e=function(_0x542de5,_0x1708bb){_0x542de5=_0x542de5-0x0;var _0x5e081b=_0xa3e8[_0x542de5];return _0x5e081b;};'use strict';var _=require(_0x8a3e('0x0'));var util=require('util');var logger=require(_0x8a3e('0x1'))(_0x8a3e('0x2'));var moment=require(_0x8a3e('0x3'));var BPromise=require(_0x8a3e('0x4'));var rp=require(_0x8a3e('0x5'));var fs=require('fs');var path=require(_0x8a3e('0x6'));var rimraf=require(_0x8a3e('0x7'));var config=require(_0x8a3e('0x8'));var attributes=require(_0x8a3e('0x9'));module['exports']=function(_0x57b9f4,_0x1f6a8e){return _0x57b9f4[_0x8a3e('0xa')](_0x8a3e('0xb'),attributes,{'tableName':_0x8a3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c67=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52ec16,_0x5b93f6){var _0x4763cb=function(_0x369ce8){while(--_0x369ce8){_0x52ec16['push'](_0x52ec16['shift']());}};_0x4763cb(++_0x5b93f6);}(_0x4c67,0x95));var _0x74c6=function(_0x1799b2,_0x5c2909){_0x1799b2=_0x1799b2-0x0;var _0x456d42=_0x4c67[_0x1799b2];return _0x456d42;};'use strict';var _=require(_0x74c6('0x0'));var util=require(_0x74c6('0x1'));var logger=require(_0x74c6('0x2'))('api');var moment=require(_0x74c6('0x3'));var BPromise=require(_0x74c6('0x4'));var rp=require(_0x74c6('0x5'));var fs=require('fs');var path=require(_0x74c6('0x6'));var rimraf=require(_0x74c6('0x7'));var config=require(_0x74c6('0x8'));var attributes=require(_0x74c6('0x9'));module[_0x74c6('0xa')]=function(_0x49cc28,_0x221618){return _0x49cc28[_0x74c6('0xb')](_0x74c6('0xc'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3c4b594..a6691a9 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 _0x5e30=['client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18be96,_0x15e628){var _0x4b9baa=function(_0x2791b9){while(--_0x2791b9){_0x18be96['push'](_0x18be96['shift']());}};_0x4b9baa(++_0x15e628);}(_0x5e30,0x7b));var _0x05e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e30[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05e3('0x0'));var util=require(_0x05e3('0x1'));var moment=require(_0x05e3('0x2'));var BPromise=require(_0x05e3('0x3'));var rs=require(_0x05e3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x05e3('0x5'))(_0x05e3('0x6'));var config=require(_0x05e3('0x7'));var jayson=require(_0x05e3('0x8'));var client=jayson[_0x05e3('0x9')][_0x05e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52757e,_0x4d59a1,_0xa03016){return new BPromise(function(_0x2eb9fa,_0x4e946e){return client[_0x05e3('0xb')](_0x52757e,_0xa03016)[_0x05e3('0xc')](function(_0x14e007){logger[_0x05e3('0xd')]('VoiceContext,\x20%s,\x20%s',_0x4d59a1,'request\x20sent');logger[_0x05e3('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4d59a1,_0x05e3('0xf'),JSON[_0x05e3('0x10')](_0x14e007));if(_0x14e007[_0x05e3('0x11')]){if(_0x14e007['error'][_0x05e3('0x12')]===0x1f4){logger[_0x05e3('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4d59a1,_0x14e007[_0x05e3('0x11')]['message']);return _0x4e946e(_0x14e007[_0x05e3('0x11')][_0x05e3('0x13')]);}logger[_0x05e3('0x11')](_0x05e3('0x14'),_0x4d59a1,_0x14e007['error'][_0x05e3('0x13')]);return _0x2eb9fa(_0x14e007['error'][_0x05e3('0x13')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x4d59a1,_0x05e3('0xf'));_0x2eb9fa(_0x14e007[_0x05e3('0x15')][_0x05e3('0x13')]);}})['catch'](function(_0x1684d2){logger[_0x05e3('0x11')](_0x05e3('0x14'),_0x4d59a1,_0x1684d2);_0x4e946e(_0x1684d2);});});} \ No newline at end of file +var _0x6b20=['request','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd6431f,_0x437d76){var _0x2b1148=function(_0x1511ff){while(--_0x1511ff){_0xd6431f['push'](_0xd6431f['shift']());}};_0x2b1148(++_0x437d76);}(_0x6b20,0xd1));var _0x06b2=function(_0x3592a1,_0x2b7f26){_0x3592a1=_0x3592a1-0x0;var _0x1e71f3=_0x6b20[_0x3592a1];return _0x1e71f3;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VoiceContext,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c26e9bf..2afd525 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 _0xb81d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x36c06c,_0x26e049){var _0x1bd92f=function(_0x3784d5){while(--_0x3784d5){_0x36c06c['push'](_0x36c06c['shift']());}};_0x1bd92f(++_0x26e049);}(_0xb81d,0xb4));var _0xdb81=function(_0x41f62e,_0x359095){_0x41f62e=_0x41f62e-0x0;var _0x1bd945=_0xb81d[_0x41f62e];return _0x1bd945;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb81('0x0'));var timeout=require(_0xdb81('0x1'));var express=require(_0xdb81('0x2'));var router=express['Router']();var fs_extra=require(_0xdb81('0x3'));var auth=require(_0xdb81('0x4'));var interaction=require(_0xdb81('0x5'));var config=require(_0xdb81('0x6'));var controller=require(_0xdb81('0x7'));router[_0xdb81('0x8')]('/',auth[_0xdb81('0x9')](),controller['index']);router[_0xdb81('0x8')](_0xdb81('0xa'),auth[_0xdb81('0x9')](),controller[_0xdb81('0xb')]);router[_0xdb81('0x8')](_0xdb81('0xc'),auth[_0xdb81('0x9')](),controller[_0xdb81('0xd')]);router['post']('/',auth[_0xdb81('0x9')](),controller[_0xdb81('0xe')]);router[_0xdb81('0xf')](_0xdb81('0xc'),auth['isAuthenticated'](),controller[_0xdb81('0x10')]);router[_0xdb81('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xdb81('0x12')]);module[_0xdb81('0x13')]=router; \ No newline at end of file +var _0x79f7=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show','post','put','/:id'];(function(_0xc399a7,_0xa1a1c4){var _0x29c718=function(_0x41b17b){while(--_0x41b17b){_0xc399a7['push'](_0xc399a7['shift']());}};_0x29c718(++_0xa1a1c4);}(_0x79f7,0xbb));var _0x779f=function(_0x59733e,_0x14cb59){_0x59733e=_0x59733e-0x0;var _0x1fde0b=_0x79f7[_0x59733e];return _0x1fde0b;};'use strict';var multer=require('multer');var util=require(_0x779f('0x0'));var path=require(_0x779f('0x1'));var timeout=require(_0x779f('0x2'));var express=require('express');var router=express[_0x779f('0x3')]();var fs_extra=require(_0x779f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x779f('0x5'));var config=require(_0x779f('0x6'));var controller=require(_0x779f('0x7'));router[_0x779f('0x8')]('/',auth['isAuthenticated'](),controller[_0x779f('0x9')]);router[_0x779f('0x8')](_0x779f('0xa'),auth[_0x779f('0xb')](),controller[_0x779f('0xc')]);router[_0x779f('0x8')]('/:id',auth[_0x779f('0xb')](),controller[_0x779f('0xd')]);router[_0x779f('0xe')]('/',auth[_0x779f('0xb')](),controller['create']);router[_0x779f('0xf')](_0x779f('0x10'),auth[_0x779f('0xb')](),controller['update']);router['delete'](_0x779f('0x10'),auth[_0x779f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f0f2ea7..551b442 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 _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3d85b3,_0x251831){var _0x1ebfb4=function(_0x5b5225){while(--_0x5b5225){_0x3d85b3['push'](_0x3d85b3['shift']());}};_0x1ebfb4(++_0x251831);}(_0x9a19,0x114));var _0x99a1=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x9a19[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x8ef6,0xf2));var _0x68ef=function(_0x589bf4,_0x4f182c){_0x589bf4=_0x589bf4-0x0;var _0x26ecfa=_0x8ef6[_0x589bf4];return _0x26ecfa;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 683a858..81be083 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 _0x7a67=['Content-Range','apply','reject','update','destroy','then','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0xc09425,_0x488626){var _0x11f8c1=function(_0x14f0e6){while(--_0x14f0e6){_0xc09425['push'](_0xc09425['shift']());}};_0x11f8c1(++_0x488626);}(_0x7a67,0xc2));var _0x77a6=function(_0x227bb5,_0x3ff5e5){_0x227bb5=_0x227bb5-0x0;var _0x28d243=_0x7a67[_0x227bb5];return _0x28d243;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77a6('0x0'));var zipdir=require(_0x77a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77a6('0x2'));var moment=require(_0x77a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x77a6('0x4'));var util=require('util');var path=require(_0x77a6('0x5'));var sox=require(_0x77a6('0x6'));var csv=require(_0x77a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77a6('0x8'));var _=require(_0x77a6('0x9'));var squel=require(_0x77a6('0xa'));var crypto=require(_0x77a6('0xb'));var jsforce=require(_0x77a6('0xc'));var deskjs=require(_0x77a6('0xd'));var toCsv=require(_0x77a6('0x7'));var querystring=require('querystring');var Papa=require(_0x77a6('0xe'));var Redis=require(_0x77a6('0xf'));var authService=require(_0x77a6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x77a6('0x11'));var hardwareService=require(_0x77a6('0x12'));var logger=require(_0x77a6('0x13'))(_0x77a6('0x14'));var utils=require(_0x77a6('0x15'));var config=require(_0x77a6('0x16'));var licenseUtil=require(_0x77a6('0x17'));var db=require(_0x77a6('0x18'))['db'];function respondWithStatusCode(_0x2ae0e5,_0x3a91e7){_0x3a91e7=_0x3a91e7||0xcc;return function(_0x55c933){if(_0x55c933){return _0x2ae0e5[_0x77a6('0x19')](_0x3a91e7);}return _0x2ae0e5[_0x77a6('0x1a')](_0x3a91e7)[_0x77a6('0x1b')]();};}function respondWithResult(_0x30dd13,_0x41db91){_0x41db91=_0x41db91||0xc8;return function(_0x333362){if(_0x333362){return _0x30dd13[_0x77a6('0x1a')](_0x41db91)[_0x77a6('0x1c')](_0x333362);}};}function respondWithFilteredResult(_0x3aff39,_0x332eec){return function(_0xcfe0f8){if(_0xcfe0f8){var _0x4aaeb8=typeof _0x332eec[_0x77a6('0x1d')]===_0x77a6('0x1e')&&typeof _0x332eec[_0x77a6('0x1f')]===_0x77a6('0x1e');var _0x81b99d=_0xcfe0f8[_0x77a6('0x20')];var _0x9d88a0=_0x4aaeb8?0x0:_0x332eec['offset'];var _0x57d6ba=_0x4aaeb8?_0xcfe0f8[_0x77a6('0x20')]:_0x332eec['offset']+_0x332eec['limit'];var _0x1638bc;if(_0x57d6ba>=_0x81b99d){_0x57d6ba=_0x81b99d;_0x1638bc=0xc8;}else{_0x1638bc=0xce;}_0x3aff39[_0x77a6('0x1a')](_0x1638bc);return _0x3aff39[_0x77a6('0x21')](_0x77a6('0x22'),_0x9d88a0+'-'+_0x57d6ba+'/'+_0x81b99d)[_0x77a6('0x1c')](_0xcfe0f8);}return null;};}function patchUpdates(_0x50e6a6){return function(_0x18423b){try{jsonpatch[_0x77a6('0x23')](_0x18423b,_0x50e6a6,!![]);}catch(_0x59fab2){return BPromise[_0x77a6('0x24')](_0x59fab2);}return _0x18423b['save']();};}function saveUpdates(_0x4bdf01,_0xcf65c6){return function(_0x1238bc){if(_0x1238bc){return _0x1238bc[_0x77a6('0x25')](_0x4bdf01)['then'](function(_0x3fd68b){return _0x3fd68b;});}return null;};}function removeEntity(_0x4dfbf2,_0x512a52){return function(_0x4b0190){if(_0x4b0190){return _0x4b0190[_0x77a6('0x26')]()[_0x77a6('0x27')](function(){_0x4dfbf2[_0x77a6('0x1a')](0xcc)[_0x77a6('0x1b')]();});}};}function handleEntityNotFound(_0x5b07aa,_0xca45b){return function(_0x646d02){if(!_0x646d02){_0x5b07aa[_0x77a6('0x19')](0x194);}return _0x646d02;};}function handleError(_0x4477f6,_0x30e11e){_0x30e11e=_0x30e11e||0x1f4;return function(_0x406c29){logger[_0x77a6('0x28')](_0x406c29[_0x77a6('0x29')]);if(_0x406c29['name']){delete _0x406c29['name'];}_0x4477f6['status'](_0x30e11e)[_0x77a6('0x2a')](_0x406c29);};}exports[_0x77a6('0x2b')]=function(_0xd0a436,_0x470b21){var _0x328885={},_0x3d4b1b={},_0x150028={'count':0x0,'rows':[]};var _0x5a9089=_[_0x77a6('0x2c')](db[_0x77a6('0x2d')][_0x77a6('0x2e')],function(_0x516416){return{'name':_0x516416[_0x77a6('0x2f')],'type':_0x516416[_0x77a6('0x30')]['key']};});_0x3d4b1b[_0x77a6('0x31')]=_[_0x77a6('0x2c')](_0x5a9089,_0x77a6('0x32'));_0x3d4b1b[_0x77a6('0x33')]=_['keys'](_0xd0a436['query']);_0x3d4b1b[_0x77a6('0x34')]=_[_0x77a6('0x35')](_0x3d4b1b[_0x77a6('0x31')],_0x3d4b1b['query']);_0x328885[_0x77a6('0x36')]=_[_0x77a6('0x35')](_0x3d4b1b[_0x77a6('0x31')],qs[_0x77a6('0x37')](_0xd0a436[_0x77a6('0x33')][_0x77a6('0x37')]));_0x328885['attributes']=_0x328885[_0x77a6('0x36')][_0x77a6('0x38')]?_0x328885[_0x77a6('0x36')]:_0x3d4b1b[_0x77a6('0x31')];if(!_0xd0a436[_0x77a6('0x33')]['hasOwnProperty'](_0x77a6('0x39'))){_0x328885[_0x77a6('0x1f')]=qs[_0x77a6('0x1f')](_0xd0a436['query'][_0x77a6('0x1f')]);_0x328885[_0x77a6('0x1d')]=qs[_0x77a6('0x1d')](_0xd0a436[_0x77a6('0x33')]['offset']);}_0x328885[_0x77a6('0x3a')]=qs[_0x77a6('0x3b')](_0xd0a436[_0x77a6('0x33')][_0x77a6('0x3b')]);_0x328885[_0x77a6('0x3c')]=qs[_0x77a6('0x34')](_[_0x77a6('0x3d')](_0xd0a436[_0x77a6('0x33')],_0x3d4b1b[_0x77a6('0x34')]),_0x5a9089);if(_0xd0a436[_0x77a6('0x33')][_0x77a6('0x3e')]){_0x328885[_0x77a6('0x3c')]=_[_0x77a6('0x3f')](_0x328885[_0x77a6('0x3c')],{'$or':_[_0x77a6('0x2c')](_0x5a9089,function(_0x8a5fed){if(_0x8a5fed[_0x77a6('0x30')]!==_0x77a6('0x40')){var _0x143d2e={};_0x143d2e[_0x8a5fed[_0x77a6('0x32')]]={'$like':'%'+_0xd0a436['query'][_0x77a6('0x3e')]+'%'};return _0x143d2e;}})});}_0x328885=_[_0x77a6('0x3f')]({},_0x328885,_0xd0a436[_0x77a6('0x41')]);var _0x478e10={'where':_0x328885[_0x77a6('0x3c')]};return db[_0x77a6('0x2d')]['count'](_0x478e10)[_0x77a6('0x27')](function(_0x4d605d){_0x150028[_0x77a6('0x20')]=_0x4d605d;if(_0xd0a436[_0x77a6('0x33')][_0x77a6('0x42')]){_0x328885['include']=[{'all':!![]}];}return db[_0x77a6('0x2d')]['findAll'](_0x328885);})[_0x77a6('0x27')](function(_0x58eeb6){_0x150028[_0x77a6('0x43')]=_0x58eeb6;return _0x150028;})[_0x77a6('0x27')](respondWithFilteredResult(_0x470b21,_0x328885))[_0x77a6('0x44')](handleError(_0x470b21,null));};exports[_0x77a6('0x45')]=function(_0x17489b,_0x455ddb){var _0x599fa4={'raw':!![],'where':{'id':_0x17489b[_0x77a6('0x46')]['id']}},_0x209af2={};_0x209af2['model']=_[_0x77a6('0x47')](db[_0x77a6('0x2d')][_0x77a6('0x2e')]);_0x209af2[_0x77a6('0x33')]=_[_0x77a6('0x47')](_0x17489b[_0x77a6('0x33')]);_0x209af2[_0x77a6('0x34')]=_[_0x77a6('0x35')](_0x209af2[_0x77a6('0x31')],_0x209af2['query']);_0x599fa4[_0x77a6('0x36')]=_[_0x77a6('0x35')](_0x209af2['model'],qs[_0x77a6('0x37')](_0x17489b[_0x77a6('0x33')][_0x77a6('0x37')]));_0x599fa4[_0x77a6('0x36')]=_0x599fa4['attributes']['length']?_0x599fa4[_0x77a6('0x36')]:_0x209af2[_0x77a6('0x31')];if(_0x17489b[_0x77a6('0x33')]['includeAll']){_0x599fa4['include']=[{'all':!![]}];}_0x599fa4=_['merge']({},_0x599fa4,_0x17489b[_0x77a6('0x41')]);return db['VoiceDialReport'][_0x77a6('0x48')](_0x599fa4)[_0x77a6('0x27')](handleEntityNotFound(_0x455ddb,null))['then'](respondWithResult(_0x455ddb,null))[_0x77a6('0x44')](handleError(_0x455ddb,null));};exports[_0x77a6('0x49')]=function(_0x4eb7c2,_0x56fc4e){return db['VoiceDialReport'][_0x77a6('0x49')](_0x4eb7c2['body'],{})['then'](respondWithResult(_0x56fc4e,0xc9))[_0x77a6('0x44')](handleError(_0x56fc4e,null));};exports['update']=function(_0x47cb02,_0x254252){if(_0x47cb02[_0x77a6('0x4a')]['id']){delete _0x47cb02['body']['id'];}return db['VoiceDialReport'][_0x77a6('0x48')]({'where':{'id':_0x47cb02[_0x77a6('0x46')]['id']}})[_0x77a6('0x27')](handleEntityNotFound(_0x254252,null))[_0x77a6('0x27')](saveUpdates(_0x47cb02[_0x77a6('0x4a')],null))[_0x77a6('0x27')](respondWithResult(_0x254252,null))[_0x77a6('0x44')](handleError(_0x254252,null));};exports[_0x77a6('0x26')]=function(_0x165c70,_0x18e324){return db['VoiceDialReport'][_0x77a6('0x48')]({'where':{'id':_0x165c70[_0x77a6('0x46')]['id']}})[_0x77a6('0x27')](handleEntityNotFound(_0x18e324,null))[_0x77a6('0x27')](removeEntity(_0x18e324,null))[_0x77a6('0x44')](handleError(_0x18e324,null));};exports[_0x77a6('0x4b')]=function(_0xf13bcd,_0x2b3199){return db[_0x77a6('0x2d')]['describe']()[_0x77a6('0x27')](respondWithResult(_0x2b3199,null))[_0x77a6('0x44')](handleError(_0x2b3199,null));}; \ No newline at end of file +var _0xa711=['reject','save','update','destroy','then','error','stack','name','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xa711,0x109));var _0x1a71=function(_0x1af72d,_0x5e252f){_0x1af72d=_0x1af72d-0x0;var _0x7714b9=_0xa711[_0x1af72d];return _0x7714b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a71('0x0'));var zipdir=require(_0x1a71('0x1'));var jsonpatch=require(_0x1a71('0x2'));var rp=require(_0x1a71('0x3'));var moment=require(_0x1a71('0x4'));var BPromise=require(_0x1a71('0x5'));var Mustache=require(_0x1a71('0x6'));var util=require('util');var path=require(_0x1a71('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a71('0x8'));var fs=require('fs');var fs_extra=require(_0x1a71('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a71('0xa'));var jsforce=require(_0x1a71('0xb'));var deskjs=require(_0x1a71('0xc'));var toCsv=require(_0x1a71('0xd'));var querystring=require(_0x1a71('0xe'));var Papa=require(_0x1a71('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a71('0x10'));var hardwareService=require(_0x1a71('0x11'));var logger=require(_0x1a71('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1a71('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a71('0x14'))['db'];function respondWithStatusCode(_0xd4a6a1,_0x105779){_0x105779=_0x105779||0xcc;return function(_0x5d22fa){if(_0x5d22fa){return _0xd4a6a1[_0x1a71('0x15')](_0x105779);}return _0xd4a6a1['status'](_0x105779)[_0x1a71('0x16')]();};}function respondWithResult(_0x1488ee,_0x5255ee){_0x5255ee=_0x5255ee||0xc8;return function(_0x4dc53b){if(_0x4dc53b){return _0x1488ee['status'](_0x5255ee)[_0x1a71('0x17')](_0x4dc53b);}};}function respondWithFilteredResult(_0x57242b,_0x5581b3){return function(_0x5dec11){if(_0x5dec11){var _0x141bdc=typeof _0x5581b3[_0x1a71('0x18')]===_0x1a71('0x19')&&typeof _0x5581b3[_0x1a71('0x1a')]===_0x1a71('0x19');var _0x10e53e=_0x5dec11[_0x1a71('0x1b')];var _0xb1f724=_0x141bdc?0x0:_0x5581b3['offset'];var _0x22e4b0=_0x141bdc?_0x5dec11[_0x1a71('0x1b')]:_0x5581b3['offset']+_0x5581b3[_0x1a71('0x1a')];var _0x198f48;if(_0x22e4b0>=_0x10e53e){_0x22e4b0=_0x10e53e;_0x198f48=0xc8;}else{_0x198f48=0xce;}_0x57242b[_0x1a71('0x1c')](_0x198f48);return _0x57242b[_0x1a71('0x1d')]('Content-Range',_0xb1f724+'-'+_0x22e4b0+'/'+_0x10e53e)[_0x1a71('0x17')](_0x5dec11);}return null;};}function patchUpdates(_0x86a1df){return function(_0xbfaf28){try{jsonpatch[_0x1a71('0x1e')](_0xbfaf28,_0x86a1df,!![]);}catch(_0x13c6ee){return BPromise[_0x1a71('0x1f')](_0x13c6ee);}return _0xbfaf28[_0x1a71('0x20')]();};}function saveUpdates(_0x150b91,_0x1b683a){return function(_0x4a4a18){if(_0x4a4a18){return _0x4a4a18[_0x1a71('0x21')](_0x150b91)['then'](function(_0x484df4){return _0x484df4;});}return null;};}function removeEntity(_0xdf370c,_0x357cd2){return function(_0x4090b8){if(_0x4090b8){return _0x4090b8[_0x1a71('0x22')]()[_0x1a71('0x23')](function(){_0xdf370c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a7c4,_0x520fc8){return function(_0x440bab){if(!_0x440bab){_0x44a7c4[_0x1a71('0x15')](0x194);}return _0x440bab;};}function handleError(_0x4deb47,_0xa4bb1b){_0xa4bb1b=_0xa4bb1b||0x1f4;return function(_0x3e23e4){logger[_0x1a71('0x24')](_0x3e23e4[_0x1a71('0x25')]);if(_0x3e23e4[_0x1a71('0x26')]){delete _0x3e23e4[_0x1a71('0x26')];}_0x4deb47[_0x1a71('0x1c')](_0xa4bb1b)['send'](_0x3e23e4);};}exports[_0x1a71('0x27')]=function(_0x417bc6,_0xb2561b){var _0x129e8e={},_0x33ef7f={},_0x4dd577={'count':0x0,'rows':[]};var _0x1aa26f=_['map'](db[_0x1a71('0x28')][_0x1a71('0x29')],function(_0x448d94){return{'name':_0x448d94[_0x1a71('0x2a')],'type':_0x448d94[_0x1a71('0x2b')][_0x1a71('0x2c')]};});_0x33ef7f[_0x1a71('0x2d')]=_[_0x1a71('0x2e')](_0x1aa26f,_0x1a71('0x26'));_0x33ef7f[_0x1a71('0x2f')]=_[_0x1a71('0x30')](_0x417bc6[_0x1a71('0x2f')]);_0x33ef7f[_0x1a71('0x31')]=_[_0x1a71('0x32')](_0x33ef7f[_0x1a71('0x2d')],_0x33ef7f['query']);_0x129e8e['attributes']=_[_0x1a71('0x32')](_0x33ef7f[_0x1a71('0x2d')],qs[_0x1a71('0x33')](_0x417bc6['query'][_0x1a71('0x33')]));_0x129e8e['attributes']=_0x129e8e[_0x1a71('0x34')][_0x1a71('0x35')]?_0x129e8e[_0x1a71('0x34')]:_0x33ef7f[_0x1a71('0x2d')];if(!_0x417bc6['query'][_0x1a71('0x36')]('nolimit')){_0x129e8e[_0x1a71('0x1a')]=qs[_0x1a71('0x1a')](_0x417bc6['query']['limit']);_0x129e8e[_0x1a71('0x18')]=qs[_0x1a71('0x18')](_0x417bc6['query']['offset']);}_0x129e8e[_0x1a71('0x37')]=qs['sort'](_0x417bc6['query'][_0x1a71('0x38')]);_0x129e8e['where']=qs['filters'](_[_0x1a71('0x39')](_0x417bc6['query'],_0x33ef7f['filters']),_0x1aa26f);if(_0x417bc6[_0x1a71('0x2f')][_0x1a71('0x3a')]){_0x129e8e['where']=_[_0x1a71('0x3b')](_0x129e8e[_0x1a71('0x3c')],{'$or':_[_0x1a71('0x2e')](_0x1aa26f,function(_0x1ebc1c){if(_0x1ebc1c[_0x1a71('0x2b')]!==_0x1a71('0x3d')){var _0x41a70a={};_0x41a70a[_0x1ebc1c['name']]={'$like':'%'+_0x417bc6['query'][_0x1a71('0x3a')]+'%'};return _0x41a70a;}})});}_0x129e8e=_[_0x1a71('0x3b')]({},_0x129e8e,_0x417bc6[_0x1a71('0x3e')]);var _0x1fb2b1={'where':_0x129e8e[_0x1a71('0x3c')]};return db[_0x1a71('0x28')]['count'](_0x1fb2b1)[_0x1a71('0x23')](function(_0x34d3f5){_0x4dd577[_0x1a71('0x1b')]=_0x34d3f5;if(_0x417bc6[_0x1a71('0x2f')][_0x1a71('0x3f')]){_0x129e8e[_0x1a71('0x40')]=[{'all':!![]}];}return db[_0x1a71('0x28')][_0x1a71('0x41')](_0x129e8e);})['then'](function(_0x3cec41){_0x4dd577[_0x1a71('0x42')]=_0x3cec41;return _0x4dd577;})[_0x1a71('0x23')](respondWithFilteredResult(_0xb2561b,_0x129e8e))['catch'](handleError(_0xb2561b,null));};exports[_0x1a71('0x43')]=function(_0x2745d3,_0x1fe621){var _0x5c9997={'raw':!![],'where':{'id':_0x2745d3['params']['id']}},_0x3c80b6={};_0x3c80b6[_0x1a71('0x2d')]=_[_0x1a71('0x30')](db[_0x1a71('0x28')][_0x1a71('0x29')]);_0x3c80b6[_0x1a71('0x2f')]=_['keys'](_0x2745d3[_0x1a71('0x2f')]);_0x3c80b6[_0x1a71('0x31')]=_[_0x1a71('0x32')](_0x3c80b6[_0x1a71('0x2d')],_0x3c80b6[_0x1a71('0x2f')]);_0x5c9997[_0x1a71('0x34')]=_[_0x1a71('0x32')](_0x3c80b6[_0x1a71('0x2d')],qs[_0x1a71('0x33')](_0x2745d3[_0x1a71('0x2f')][_0x1a71('0x33')]));_0x5c9997[_0x1a71('0x34')]=_0x5c9997[_0x1a71('0x34')][_0x1a71('0x35')]?_0x5c9997['attributes']:_0x3c80b6['model'];if(_0x2745d3['query'][_0x1a71('0x3f')]){_0x5c9997[_0x1a71('0x40')]=[{'all':!![]}];}_0x5c9997=_[_0x1a71('0x3b')]({},_0x5c9997,_0x2745d3[_0x1a71('0x3e')]);return db['VoiceDialReport'][_0x1a71('0x44')](_0x5c9997)[_0x1a71('0x23')](handleEntityNotFound(_0x1fe621,null))['then'](respondWithResult(_0x1fe621,null))[_0x1a71('0x45')](handleError(_0x1fe621,null));};exports[_0x1a71('0x46')]=function(_0x16bb75,_0x49c284){return db[_0x1a71('0x28')][_0x1a71('0x46')](_0x16bb75[_0x1a71('0x47')],{})['then'](respondWithResult(_0x49c284,0xc9))['catch'](handleError(_0x49c284,null));};exports[_0x1a71('0x21')]=function(_0x4ccaaf,_0x59b16b){if(_0x4ccaaf[_0x1a71('0x47')]['id']){delete _0x4ccaaf['body']['id'];}return db[_0x1a71('0x28')]['find']({'where':{'id':_0x4ccaaf[_0x1a71('0x48')]['id']}})[_0x1a71('0x23')](handleEntityNotFound(_0x59b16b,null))[_0x1a71('0x23')](saveUpdates(_0x4ccaaf['body'],null))[_0x1a71('0x23')](respondWithResult(_0x59b16b,null))[_0x1a71('0x45')](handleError(_0x59b16b,null));};exports[_0x1a71('0x22')]=function(_0x14901b,_0x58a66c){return db[_0x1a71('0x28')]['find']({'where':{'id':_0x14901b[_0x1a71('0x48')]['id']}})[_0x1a71('0x23')](handleEntityNotFound(_0x58a66c,null))['then'](removeEntity(_0x58a66c,null))[_0x1a71('0x45')](handleError(_0x58a66c,null));};exports[_0x1a71('0x49')]=function(_0x1dfbd9,_0x2367e4){return db['VoiceDialReport'][_0x1a71('0x49')]()[_0x1a71('0x23')](respondWithResult(_0x2367e4,null))[_0x1a71('0x45')](handleError(_0x2367e4,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ae3f5c1..558b0e9 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 _0x2918=['VoiceDialReport','report_dial','uniqueid','util','../../config/logger','moment','path','../../config/environment','exports','define'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2918,0x1d9));var _0x8291=function(_0x216341,_0x5a8d18){_0x216341=_0x216341-0x0;var _0x5977c7=_0x2918[_0x216341];return _0x5977c7;};'use strict';var _=require('lodash');var util=require(_0x8291('0x0'));var logger=require(_0x8291('0x1'))('api');var moment=require(_0x8291('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8291('0x3'));var rimraf=require('rimraf');var config=require(_0x8291('0x4'));var attributes=require('./voiceDialReport.attributes');module[_0x8291('0x5')]=function(_0x8250ab,_0x566689){return _0x8250ab[_0x8291('0x6')](_0x8291('0x7'),attributes,{'tableName':_0x8291('0x8'),'paranoid':![],'indexes':[{'fields':[_0x8291('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8ee=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4bc4f3,_0xb93bd2){var _0x478fab=function(_0x2404ea){while(--_0x2404ea){_0x4bc4f3['push'](_0x4bc4f3['shift']());}};_0x478fab(++_0xb93bd2);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x342c52,_0x571d7a){_0x342c52=_0x342c52-0x0;var _0x3ee49a=_0xd8ee[_0x342c52];return _0x3ee49a;};'use strict';var _=require(_0xed8e('0x0'));var util=require('util');var logger=require(_0xed8e('0x1'))(_0xed8e('0x2'));var moment=require(_0xed8e('0x3'));var BPromise=require('bluebird');var rp=require(_0xed8e('0x4'));var fs=require('fs');var path=require(_0xed8e('0x5'));var rimraf=require(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var attributes=require(_0xed8e('0x8'));module[_0xed8e('0x9')]=function(_0x576b26,_0x3a030a){return _0x576b26[_0xed8e('0xa')](_0xed8e('0xb'),attributes,{'tableName':_0xed8e('0xc'),'paranoid':![],'indexes':[{'fields':[_0xed8e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 6eea7a5..0f41d4f 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 _0x29ab=['CreateVoiceDialReport','VoiceDialReport','options','raw','debug','stringify','catch','UpdateVoiceDialReport','update','body','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x2b6888,_0x1bf34c){var _0x275234=function(_0x1ad884){while(--_0x1ad884){_0x2b6888['push'](_0x2b6888['shift']());}};_0x275234(++_0x1bf34c);}(_0x29ab,0x101));var _0xb29a=function(_0x4ca11b,_0x553e18){_0x4ca11b=_0x4ca11b-0x0;var _0x1c8593=_0x29ab[_0x4ca11b];return _0x1c8593;};'use strict';var _=require(_0xb29a('0x0'));var util=require(_0xb29a('0x1'));var moment=require('moment');var BPromise=require(_0xb29a('0x2'));var rs=require(_0xb29a('0x3'));var fs=require('fs');var Redis=require(_0xb29a('0x4'));var db=require(_0xb29a('0x5'))['db'];var utils=require(_0xb29a('0x6'));var logger=require(_0xb29a('0x7'))(_0xb29a('0x8'));var config=require(_0xb29a('0x9'));var jayson=require(_0xb29a('0xa'));var client=jayson[_0xb29a('0xb')][_0xb29a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a61a0,_0x3f1bb7,_0x5daeae){return new BPromise(function(_0x3f9bd4,_0x1cf816){return client[_0xb29a('0xd')](_0x3a61a0,_0x5daeae)[_0xb29a('0xe')](function(_0x113886){logger[_0xb29a('0xf')](_0xb29a('0x10'),_0x3f1bb7,'request\x20sent');logger['debug'](_0xb29a('0x11'),_0x3f1bb7,_0xb29a('0x12'),JSON['stringify'](_0x113886));if(_0x113886[_0xb29a('0x13')]){if(_0x113886[_0xb29a('0x13')][_0xb29a('0x14')]===0x1f4){logger['error'](_0xb29a('0x10'),_0x3f1bb7,_0x113886[_0xb29a('0x13')][_0xb29a('0x15')]);return _0x1cf816(_0x113886[_0xb29a('0x13')][_0xb29a('0x15')]);}logger[_0xb29a('0x13')](_0xb29a('0x10'),_0x3f1bb7,_0x113886[_0xb29a('0x13')][_0xb29a('0x15')]);return _0x3f9bd4(_0x113886[_0xb29a('0x13')]['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3f1bb7,_0xb29a('0x12'));_0x3f9bd4(_0x113886[_0xb29a('0x16')][_0xb29a('0x15')]);}})['catch'](function(_0x5c7d3e){logger[_0xb29a('0x13')](_0xb29a('0x10'),_0x3f1bb7,_0x5c7d3e);_0x1cf816(_0x5c7d3e);});});}exports[_0xb29a('0x17')]=function(_0x38719a){var _0x3fd0b0=this;return new Promise(function(_0x3d408a,_0x265f4d){return db[_0xb29a('0x18')]['create'](_0x38719a['body'],{'raw':_0x38719a[_0xb29a('0x19')]?_0x38719a['options'][_0xb29a('0x1a')]===undefined?!![]:![]:!![]})[_0xb29a('0xe')](function(_0x5ca4e5){logger[_0xb29a('0xf')](_0xb29a('0x17'),_0x38719a);logger[_0xb29a('0x1b')](_0xb29a('0x17'),_0x38719a,JSON[_0xb29a('0x1c')](_0x5ca4e5));_0x3d408a(_0x5ca4e5);})[_0xb29a('0x1d')](function(_0x8d5cd3){logger[_0xb29a('0x13')]('CreateVoiceDialReport',_0x8d5cd3[_0xb29a('0x15')],_0x38719a);_0x265f4d(_0x3fd0b0[_0xb29a('0x13')](0x1f4,_0x8d5cd3[_0xb29a('0x15')]));});});};exports[_0xb29a('0x1e')]=function(_0xbb4d18){var _0x551c49=this;return new Promise(function(_0x3b3654,_0xddbd5f){return db[_0xb29a('0x18')][_0xb29a('0x1f')](_0xbb4d18[_0xb29a('0x20')],{'raw':_0xbb4d18['options']?_0xbb4d18[_0xb29a('0x19')][_0xb29a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb4d18['options']?_0xbb4d18[_0xb29a('0x19')]['where']||null:null,'attributes':_0xbb4d18[_0xb29a('0x19')]?_0xbb4d18['options'][_0xb29a('0x21')]||null:null,'limit':_0xbb4d18[_0xb29a('0x19')]?_0xbb4d18['options'][_0xb29a('0x22')]||null:null})[_0xb29a('0xe')](function(_0x7b1d74){logger['info'](_0xb29a('0x1e'),_0xbb4d18);logger[_0xb29a('0x1b')](_0xb29a('0x1e'),_0xbb4d18,JSON[_0xb29a('0x1c')](_0x7b1d74));_0x3b3654(_0x7b1d74);})['catch'](function(_0x5103ed){logger[_0xb29a('0x13')](_0xb29a('0x1e'),_0x5103ed[_0xb29a('0x15')],_0xbb4d18);_0xddbd5f(_0x551c49[_0xb29a('0x13')](0x1f4,_0x5103ed[_0xb29a('0x15')]));});});}; \ No newline at end of file +var _0xcaef=['body','options','raw','info','update','attributes','UpdateVoiceDialReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0xcaef,0x1c9));var _0xfcae=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcaef[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0xfcae('0x0'));var moment=require(_0xfcae('0x1'));var BPromise=require(_0xfcae('0x2'));var rs=require(_0xfcae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcae('0x5'))(_0xfcae('0x6'));var config=require('../../config/environment');var jayson=require(_0xfcae('0x7'));var client=jayson[_0xfcae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f0938,_0x5d9a45,_0x516d1e){return new BPromise(function(_0x30dd6e,_0x24dde0){return client[_0xfcae('0x9')](_0x2f0938,_0x516d1e)['then'](function(_0xb305f5){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x5d9a45,_0xfcae('0xa'));logger[_0xfcae('0xb')](_0xfcae('0xc'),_0x5d9a45,_0xfcae('0xa'),JSON[_0xfcae('0xd')](_0xb305f5));if(_0xb305f5[_0xfcae('0xe')]){if(_0xb305f5[_0xfcae('0xe')][_0xfcae('0xf')]===0x1f4){logger[_0xfcae('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x5d9a45,_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);return _0x24dde0(_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);}logger[_0xfcae('0xe')](_0xfcae('0x11'),_0x5d9a45,_0xb305f5[_0xfcae('0xe')][_0xfcae('0x10')]);return _0x30dd6e(_0xb305f5['error'][_0xfcae('0x10')]);}else{logger['info'](_0xfcae('0x11'),_0x5d9a45,_0xfcae('0xa'));_0x30dd6e(_0xb305f5[_0xfcae('0x12')][_0xfcae('0x10')]);}})[_0xfcae('0x13')](function(_0x23c404){logger[_0xfcae('0xe')](_0xfcae('0x11'),_0x5d9a45,_0x23c404);_0x24dde0(_0x23c404);});});}exports[_0xfcae('0x14')]=function(_0x4d2a5e){var _0x24f607=this;return new Promise(function(_0x5f4a8b,_0x3176d6){return db[_0xfcae('0x15')][_0xfcae('0x16')](_0x4d2a5e[_0xfcae('0x17')],{'raw':_0x4d2a5e[_0xfcae('0x18')]?_0x4d2a5e[_0xfcae('0x18')][_0xfcae('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x53cb65){logger[_0xfcae('0x1a')](_0xfcae('0x14'),_0x4d2a5e);logger[_0xfcae('0xb')](_0xfcae('0x14'),_0x4d2a5e,JSON[_0xfcae('0xd')](_0x53cb65));_0x5f4a8b(_0x53cb65);})[_0xfcae('0x13')](function(_0xc2d0ed){logger[_0xfcae('0xe')](_0xfcae('0x14'),_0xc2d0ed['message'],_0x4d2a5e);_0x3176d6(_0x24f607[_0xfcae('0xe')](0x1f4,_0xc2d0ed[_0xfcae('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x49e534){var _0x51776e=this;return new Promise(function(_0x337324,_0x5a19be){return db[_0xfcae('0x15')][_0xfcae('0x1b')](_0x49e534[_0xfcae('0x17')],{'raw':_0x49e534['options']?_0x49e534[_0xfcae('0x18')][_0xfcae('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e534[_0xfcae('0x18')]?_0x49e534[_0xfcae('0x18')]['where']||null:null,'attributes':_0x49e534['options']?_0x49e534['options'][_0xfcae('0x1c')]||null:null,'limit':_0x49e534['options']?_0x49e534[_0xfcae('0x18')]['limit']||null:null})['then'](function(_0x409dd6){logger[_0xfcae('0x1a')](_0xfcae('0x1d'),_0x49e534);logger['debug'](_0xfcae('0x1d'),_0x49e534,JSON['stringify'](_0x409dd6));_0x337324(_0x409dd6);})['catch'](function(_0x57079c){logger[_0xfcae('0xe')](_0xfcae('0x1d'),_0x57079c[_0xfcae('0x10')],_0x49e534);_0x5a19be(_0x51776e[_0xfcae('0xe')](0x1f4,_0x57079c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 8c858c8..c8f3495 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 _0x3d74=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','addApplications','put','destroy','exports'];(function(_0xaff1bd,_0x5380c4){var _0x52ad89=function(_0x50720e){while(--_0x50720e){_0xaff1bd['push'](_0xaff1bd['shift']());}};_0x52ad89(++_0x5380c4);}(_0x3d74,0x1a4));var _0x43d7=function(_0xfe4dbb,_0x268f3f){_0xfe4dbb=_0xfe4dbb-0x0;var _0x17d5a6=_0x3d74[_0xfe4dbb];return _0x17d5a6;};'use strict';var multer=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var path=require(_0x43d7('0x2'));var timeout=require(_0x43d7('0x3'));var express=require(_0x43d7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43d7('0x5'));var interaction=require(_0x43d7('0x6'));var config=require(_0x43d7('0x7'));var controller=require(_0x43d7('0x8'));router[_0x43d7('0x9')]('/',auth[_0x43d7('0xa')](),controller[_0x43d7('0xb')]);router['get'](_0x43d7('0xc'),auth[_0x43d7('0xa')](),controller[_0x43d7('0xd')]);router[_0x43d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x43d7('0xf')]);router[_0x43d7('0xe')]('/:id/applications',auth[_0x43d7('0xa')](),controller[_0x43d7('0x10')]);router[_0x43d7('0x11')](_0x43d7('0xc'),auth[_0x43d7('0xa')](),controller['update']);router['delete']('/:id',auth[_0x43d7('0xa')](),controller[_0x43d7('0x12')]);module[_0x43d7('0x13')]=router; \ No newline at end of file +var _0x5b65=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','post','create','/:id/applications','addApplications','put','delete','destroy'];(function(_0xa92e52,_0x2a9c47){var _0x5049e5=function(_0x5695c0){while(--_0x5695c0){_0xa92e52['push'](_0xa92e52['shift']());}};_0x5049e5(++_0x2a9c47);}(_0x5b65,0xf8));var _0x55b6=function(_0x57a505,_0x27e538){_0x57a505=_0x57a505-0x0;var _0x1f10b2=_0x5b65[_0x57a505];return _0x1f10b2;};'use strict';var multer=require('multer');var util=require(_0x55b6('0x0'));var path=require(_0x55b6('0x1'));var timeout=require(_0x55b6('0x2'));var express=require(_0x55b6('0x3'));var router=express[_0x55b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x55b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x55b6('0x6'));var controller=require(_0x55b6('0x7'));router[_0x55b6('0x8')]('/',auth[_0x55b6('0x9')](),controller['index']);router[_0x55b6('0x8')](_0x55b6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x55b6('0xb')]('/',auth['isAuthenticated'](),controller[_0x55b6('0xc')]);router[_0x55b6('0xb')](_0x55b6('0xd'),auth[_0x55b6('0x9')](),controller[_0x55b6('0xe')]);router[_0x55b6('0xf')](_0x55b6('0xa'),auth[_0x55b6('0x9')](),controller['update']);router[_0x55b6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x55b6('0x11')]);module[_0x55b6('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ac03943..87eb874 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 _0x8426=['outbound','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM'];(function(_0x2d3792,_0x2922db){var _0x2783c4=function(_0x4cfc54){while(--_0x4cfc54){_0x2d3792['push'](_0x2d3792['shift']());}};_0x2783c4(++_0x2922db);}(_0x8426,0x64));var _0x6842=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8426[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x6842('0x0'));module['exports']={'context':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'unique':_0x6842('0x2')},'priority':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x6842('0x2')},'tag':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'defaultValue':_0x6842('0x3')},'appdata':{'type':Sequelize[_0x6842('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6842('0x4')]('inbound',_0x6842('0x5'),'internal',_0x6842('0x6'),_0x6842('0x7'),_0x6842('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x6842('0x1')]},'interval':{'type':Sequelize[_0x6842('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x6842('0x9')]},'isApp':{'type':Sequelize[_0x6842('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6842('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6842('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6842('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x6842('0xb')},'answer':{'type':Sequelize[_0x6842('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6842('0xc')],'get':function(_0x2b91a6){return this[_0x6842('0xd')](_0x6842('0xe'));}},'alias':{'type':Sequelize[_0x6842('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x404d=['sequelize','STRING','compositeIndex','NoOp','inbound','internal','inbound-fax','outbound-fax','BOOLEAN','wav','getDataValue','exten'];(function(_0x2a4cb6,_0x2e0ffd){var _0x10b205=function(_0x2a1a1d){while(--_0x2a1a1d){_0x2a4cb6['push'](_0x2a4cb6['shift']());}};_0x10b205(++_0x2e0ffd);}(_0x404d,0x6c));var _0xd404=function(_0x2c56d4,_0x2b3670){_0x2c56d4=_0x2c56d4-0x0;var _0x2b092d=_0x404d[_0x2c56d4];return _0x2b092d;};'use strict';var Sequelize=require(_0xd404('0x0'));module['exports']={'context':{'type':Sequelize[_0xd404('0x1')],'allowNull':![],'unique':_0xd404('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd404('0x1')],'allowNull':![],'unique':_0xd404('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xd404('0x2')},'tag':{'type':Sequelize[_0xd404('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd404('0x1')],'allowNull':![],'defaultValue':_0xd404('0x3')},'appdata':{'type':Sequelize[_0xd404('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xd404('0x4'),'outbound',_0xd404('0x5'),_0xd404('0x6'),_0xd404('0x7'),'system','any'),'allowNull':![]},'description':{'type':Sequelize[_0xd404('0x1')]},'interval':{'type':Sequelize[_0xd404('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xd404('0x8')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd404('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd404('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xd404('0x8')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xd404('0x1')],'defaultValue':_0xd404('0x9')},'answer':{'type':Sequelize[_0xd404('0x8')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x179244){return this[_0xd404('0xa')](_0xd404('0xb'));}},'alias':{'type':Sequelize[_0xd404('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f20697a..953d511 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 _0xf12c=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','../../config/logger','api','redis','localhost','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','find','type','name','end','error','send','index','VoiceExtension','fieldName','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf12c,0xcb));var _0xcf12=function(_0xa4f047,_0x30cffe){_0xa4f047=_0xa4f047-0x0;var _0x280a03=_0xf12c[_0xa4f047];return _0x280a03;};'use strict';var _=require(_0xcf12('0x0'));var Redis=require(_0xcf12('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xcf12('0x2'))(_0xcf12('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xcf12('0x4')]=_['defaults'](config['redis'],{'host':_0xcf12('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf12('0x6'))[_0xcf12('0x7')](socket);function respondWithStatusCode(_0x4060f4,_0x693d3d){_0x693d3d=_0x693d3d||0xcc;return function(_0x435929){if(_0x435929){return _0x4060f4[_0xcf12('0x8')](_0x693d3d);}return _0x4060f4[_0xcf12('0x9')](_0x693d3d)['end']();};}function respondWithResult(_0x2901eb,_0x3b1dbc){_0x3b1dbc=_0x3b1dbc||0xc8;return function(_0xbf2a41){if(_0xbf2a41){return _0x2901eb[_0xcf12('0x9')](_0x3b1dbc)[_0xcf12('0xa')](_0xbf2a41);}};}function respondWithFilteredResult(_0x2fc82d,_0x1d018a){return function(_0x3473af){if(_0x3473af){var _0x40f6f9=typeof _0x1d018a[_0xcf12('0xb')]===_0xcf12('0xc')&&typeof _0x1d018a[_0xcf12('0xd')]===_0xcf12('0xc');var _0x39a381=_0x3473af[_0xcf12('0xe')];var _0xbe0d4d=_0x40f6f9?0x0:_0x1d018a[_0xcf12('0xb')];var _0xdbc5ba=_0x40f6f9?_0x3473af[_0xcf12('0xe')]:_0x1d018a[_0xcf12('0xb')]+_0x1d018a[_0xcf12('0xd')];var _0x13e3be;if(_0xdbc5ba>=_0x39a381){_0xdbc5ba=_0x39a381;_0x13e3be=0xc8;}else{_0x13e3be=0xce;}_0x2fc82d[_0xcf12('0x9')](_0x13e3be);return _0x2fc82d[_0xcf12('0xf')](_0xcf12('0x10'),_0xbe0d4d+'-'+_0xdbc5ba+'/'+_0x39a381)['json'](_0x3473af);}return null;};}function removeEntity(_0x23b42c){return function(_0x541e49){if(_0x541e49){return _0x541e49[_0xcf12('0x11')]()[_0xcf12('0x12')](function(){var _0xbca507=_0x541e49[_0xcf12('0x13')]({'plain':!![]});var _0x2afae6=[{'name':_0xcf12('0x14'),'value':'inbound','ignore':![]},{'name':_0xcf12('0x15'),'value':_0xcf12('0x16'),'ignore':![]},{'name':_0xcf12('0x17'),'value':_0xcf12('0x18'),'ignore':![]}];var _0x19a43a=_(_0x2afae6)[_0xcf12('0x19')](_0xcf12('0x1a'))['map'](_0xcf12('0x1b'))[_0xcf12('0x1b')]();if(_[_0xcf12('0x1c')](_0x19a43a,_0xbca507['type'])){return;}var _0x1efe43=_[_0xcf12('0x1d')](_0x2afae6,[_0xcf12('0x1b'),_0xbca507[_0xcf12('0x1e')]])[_0xcf12('0x1f')];return db['UserProfileResource'][_0xcf12('0x11')]({'where':{'type':_0x1efe43,'resourceId':_0xbca507['id']}})[_0xcf12('0x12')](function(){return _0x541e49;});})[_0xcf12('0x12')](function(){_0x23b42c[_0xcf12('0x9')](0xcc)[_0xcf12('0x20')]();});}};}function handleEntityNotFound(_0x4565c2){return function(_0x52f618){if(!_0x52f618){_0x4565c2[_0xcf12('0x8')](0x194);}return _0x52f618;};}function handleError(_0x23b772,_0x261125){_0x261125=_0x261125||0x1f4;return function(_0x3e7a57){logger[_0xcf12('0x21')](_0x3e7a57['stack']);if(_0x3e7a57[_0xcf12('0x1f')]){delete _0x3e7a57['name'];}_0x23b772[_0xcf12('0x9')](_0x261125)[_0xcf12('0x22')](_0x3e7a57);};}exports[_0xcf12('0x23')]=function(_0x10f34f,_0x3146c5){var _0x3c83b3={},_0xa0a41={},_0x3826de={'count':0x0,'rows':[]};var _0x3d4e99=_['map'](db[_0xcf12('0x24')]['rawAttributes'],function(_0x528834){return{'name':_0x528834[_0xcf12('0x25')],'type':_0x528834[_0xcf12('0x1e')]['key']};});_0xa0a41[_0xcf12('0x26')]=_[_0xcf12('0x27')](_0x3d4e99,_0xcf12('0x1f'));_0xa0a41['query']=_[_0xcf12('0x28')](_0x10f34f[_0xcf12('0x29')]);_0xa0a41[_0xcf12('0x2a')]=_[_0xcf12('0x2b')](_0xa0a41[_0xcf12('0x26')],_0xa0a41[_0xcf12('0x29')]);_0x3c83b3[_0xcf12('0x2c')]=_[_0xcf12('0x2b')](_0xa0a41[_0xcf12('0x26')],qs[_0xcf12('0x2d')](_0x10f34f[_0xcf12('0x29')][_0xcf12('0x2d')]));_0x3c83b3[_0xcf12('0x2c')]=_0x3c83b3[_0xcf12('0x2c')]['length']?_0x3c83b3[_0xcf12('0x2c')]:_0xa0a41['model'];if(!_0x10f34f[_0xcf12('0x29')][_0xcf12('0x2e')]('nolimit')){_0x3c83b3['limit']=qs['limit'](_0x10f34f[_0xcf12('0x29')][_0xcf12('0xd')]);_0x3c83b3['offset']=qs[_0xcf12('0xb')](_0x10f34f[_0xcf12('0x29')][_0xcf12('0xb')]);}_0x3c83b3[_0xcf12('0x2f')]=qs[_0xcf12('0x30')](_0x10f34f['query'][_0xcf12('0x30')]);_0x3c83b3[_0xcf12('0x31')]=qs['filters'](_[_0xcf12('0x32')](_0x10f34f[_0xcf12('0x29')],_0xa0a41['filters']),_0x3d4e99);if(_0x10f34f[_0xcf12('0x29')][_0xcf12('0x19')]){_0x3c83b3[_0xcf12('0x31')]=_['merge'](_0x3c83b3[_0xcf12('0x31')],{'$or':_[_0xcf12('0x27')](_0x3d4e99,function(_0x2b2609){if(_0x2b2609[_0xcf12('0x1e')]!==_0xcf12('0x33')){var _0x14e944={};_0x14e944[_0x2b2609['name']]={'$like':'%'+_0x10f34f[_0xcf12('0x29')][_0xcf12('0x19')]+'%'};return _0x14e944;}})});}_0x3c83b3=_[_0xcf12('0x34')]({},_0x3c83b3,_0x10f34f['options']);var _0x53c1cf={'where':_0x3c83b3['where']};return db[_0xcf12('0x24')][_0xcf12('0xe')](_0x53c1cf)[_0xcf12('0x12')](function(_0x561b6a){_0x3826de['count']=_0x561b6a;if(_0x10f34f['query'][_0xcf12('0x35')]){_0x3c83b3[_0xcf12('0x36')]=[{'all':!![]}];}return db[_0xcf12('0x24')][_0xcf12('0x37')](_0x3c83b3);})[_0xcf12('0x12')](function(_0x1210bf){_0x3826de[_0xcf12('0x38')]=_0x1210bf;return _0x3826de;})[_0xcf12('0x12')](respondWithFilteredResult(_0x3146c5,_0x3c83b3))[_0xcf12('0x39')](handleError(_0x3146c5,null));};exports[_0xcf12('0x3a')]=function(_0x409468,_0x45f1eb){var _0xb5b1e1={'raw':![],'where':{'id':_0x409468[_0xcf12('0x3b')]['id']}},_0x339db6={};_0x339db6['model']=_['keys'](db['VoiceExtension'][_0xcf12('0x3c')]);_0x339db6[_0xcf12('0x29')]=_['keys'](_0x409468[_0xcf12('0x29')]);_0x339db6[_0xcf12('0x2a')]=_[_0xcf12('0x2b')](_0x339db6[_0xcf12('0x26')],_0x339db6[_0xcf12('0x29')]);_0xb5b1e1[_0xcf12('0x2c')]=_[_0xcf12('0x2b')](_0x339db6[_0xcf12('0x26')],qs[_0xcf12('0x2d')](_0x409468[_0xcf12('0x29')][_0xcf12('0x2d')]));_0xb5b1e1[_0xcf12('0x2c')]=_0xb5b1e1[_0xcf12('0x2c')][_0xcf12('0x3d')]?_0xb5b1e1['attributes']:_0x339db6[_0xcf12('0x26')];if(_0x409468[_0xcf12('0x29')]['includeAll']){_0xb5b1e1[_0xcf12('0x36')]=[{'all':!![]}];}_0xb5b1e1=_['merge']({},_0xb5b1e1,_0x409468[_0xcf12('0x3e')]);return db[_0xcf12('0x24')][_0xcf12('0x1d')](_0xb5b1e1)[_0xcf12('0x12')](handleEntityNotFound(_0x45f1eb,null))[_0xcf12('0x12')](respondWithResult(_0x45f1eb,null))[_0xcf12('0x39')](handleError(_0x45f1eb,null));};exports[_0xcf12('0x11')]=function(_0x4da640,_0x2be6a8){return db['VoiceExtension'][_0xcf12('0x1d')]({'where':{'id':_0x4da640['params']['id']}})['then'](handleEntityNotFound(_0x2be6a8,null))['then'](removeEntity(_0x2be6a8,null))[_0xcf12('0x39')](handleError(_0x2be6a8,null));};exports[_0xcf12('0x3f')]=function(_0x4ce0a5,_0x571a59){if(_0x4ce0a5[_0xcf12('0x40')][_0xcf12('0x1e')]==='outbound'&&!_[_0xcf12('0x41')](_0x4ce0a5['body'][_0xcf12('0x42')],'_')){_0x4ce0a5[_0xcf12('0x40')][_0xcf12('0x42')]='_'['concat'](_0x4ce0a5[_0xcf12('0x40')]['exten']);}return db[_0xcf12('0x24')][_0xcf12('0x3f')](_0x4ce0a5[_0xcf12('0x40')],{'raw':![]})[_0xcf12('0x12')](function(_0x56ba61){var _0x42c053=_0x4ce0a5[_0xcf12('0x43')][_0xcf12('0x13')]({'plain':!![]});if(!_0x42c053)throw new Error(_0xcf12('0x44'));if(_0x42c053[_0xcf12('0x45')]==='user'){var _0xdbc5c9=_0x56ba61[_0xcf12('0x13')]({'plain':!![]});var _0x15095e=[{'name':_0xcf12('0x14'),'value':'inbound'},{'name':_0xcf12('0x15'),'value':_0xcf12('0x16')},{'name':_0xcf12('0x17'),'value':_0xcf12('0x18')}];var _0x1f08df=_[_0xcf12('0x1d')](_0x15095e,[_0xcf12('0x1b'),_0xdbc5c9['type']])[_0xcf12('0x1f')];return db[_0xcf12('0x46')][_0xcf12('0x1d')]({'where':{'name':_0x1f08df,'userProfileId':_0x42c053[_0xcf12('0x47')]},'raw':!![]})[_0xcf12('0x12')](function(_0x3e3cfb){if(_0x3e3cfb&&_0x3e3cfb[_0xcf12('0x48')]===0x0){return db[_0xcf12('0x49')][_0xcf12('0x3f')]({'name':_0xdbc5c9[_0xcf12('0x1f')],'resourceId':_0xdbc5c9['id'],'type':_0x3e3cfb[_0xcf12('0x1f')],'sectionId':_0x3e3cfb['id']},{})[_0xcf12('0x12')](function(){return _0x56ba61;});}else{return _0x56ba61;}})['catch'](function(_0x19693f){logger[_0xcf12('0x21')](_0xcf12('0x4a'),_0x19693f);throw _0x19693f;});}return _0x56ba61;})[_0xcf12('0x12')](respondWithResult(_0x571a59,0xc9))['catch'](handleError(_0x571a59,null));};exports[_0xcf12('0x4b')]=function(_0x577564,_0x4ca296){if(_0x577564[_0xcf12('0x40')]['id']){delete _0x577564[_0xcf12('0x40')]['id'];}return db['VoiceExtension'][_0xcf12('0x1d')]({'where':{'id':_0x577564[_0xcf12('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4ca296,null))[_0xcf12('0x12')](function(_0x499b8a){if(_0x499b8a){return db['VoiceExtension']['update'](_[_0xcf12('0x32')](_0x577564[_0xcf12('0x40')],[_0xcf12('0x42'),_0xcf12('0x4c'),_0xcf12('0x4d'),_0xcf12('0x4e'),_0xcf12('0x4f'),_0xcf12('0x50'),'alias']),{'where':{'context':_0x499b8a['context'],'exten':_0x499b8a[_0xcf12('0x42')]},'individualHooks':!![]})[_0xcf12('0x12')](function(_0x174134){return _0x174134;});}return null;})[_0xcf12('0x12')](respondWithStatusCode(_0x4ca296,null))[_0xcf12('0x39')](handleError(_0x4ca296,null));};exports[_0xcf12('0x51')]=function(_0xc313ee,_0x1a5f3b){var _0x30108b=_0xc313ee['params']['id'];var _0x4caa9c=_0xc313ee[_0xcf12('0x40')];var _0x221a44=0xc8;var _0x4d90ef=null;return db['sequelize'][_0xcf12('0x52')]({'isolationLevel':db['sequelize'][_0xcf12('0x53')][_0xcf12('0x54')][_0xcf12('0x55')]},function(_0x2f66dd){return db[_0xcf12('0x24')][_0xcf12('0x56')]({'where':{'id':_0x30108b},'transaction':_0x2f66dd})[_0xcf12('0x12')](function(_0x255db7){if(_0x255db7){return db[_0xcf12('0x24')][_0xcf12('0x11')]({'where':{'VoiceExtensionId':_0x30108b},'transaction':_0x2f66dd})['then'](function(){var _0x26694a=_[_0xcf12('0x27')](_0x4caa9c,function(_0x4743cf){_0x4743cf['VoiceExtensionId']=_0x30108b;_0x4743cf['isApp']=!![];return _0x4743cf;});return _0x255db7['createRouting'](_0x26694a);})[_0xcf12('0x12')](function(_0x5ba1ff){return db[_0xcf12('0x24')][_0xcf12('0x57')](_0x5ba1ff,{'transaction':_0x2f66dd});});}else{_0x221a44=0x194;_0x4d90ef=[];}});})[_0xcf12('0x12')](function(){if(_0x221a44!==0x194){return db[_0xcf12('0x24')][_0xcf12('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x30108b},'order':_0xcf12('0x59')})['then'](function(_0x3b9c31){_0x4d90ef=_0x3b9c31;});}})[_0xcf12('0x39')](function(_0x19f11c){_0x221a44=0x1f4;logger[_0xcf12('0x21')](_0x19f11c[_0xcf12('0x5a')]);if(_0x19f11c[_0xcf12('0x1f')]){delete _0x19f11c['name'];}_0x4d90ef=_0x19f11c;})[_0xcf12('0x5b')](function(){if(_0x4d90ef===null){_0x1a5f3b[_0xcf12('0x8')](_0x221a44);}else{if(_0x221a44===0x1f4){_0x1a5f3b['status'](_0x221a44)[_0xcf12('0x22')](_0x4d90ef);}else{_0x1a5f3b[_0xcf12('0x9')](_0x221a44)[_0xcf12('0xa')](_0x4d90ef);}}});}; \ No newline at end of file +var _0x944b=['role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','lodash','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','value','includes','type','find','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x944b,0x18d));var _0xb944=function(_0x31b8c3,_0x267422){_0x31b8c3=_0x31b8c3-0x0;var _0x18fa67=_0x944b[_0x31b8c3];return _0x18fa67;};'use strict';var _=require(_0xb944('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xb944('0x1'))(_0xb944('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb944('0x3')]=_[_0xb944('0x4')](config[_0xb944('0x3')],{'host':_0xb944('0x5'),'port':0x18eb});var socket=require(_0xb944('0x6'))(new Redis(config[_0xb944('0x3')]));require(_0xb944('0x7'))[_0xb944('0x8')](socket);function respondWithStatusCode(_0x2f41b6,_0x3d37d1){_0x3d37d1=_0x3d37d1||0xcc;return function(_0x1229d5){if(_0x1229d5){return _0x2f41b6[_0xb944('0x9')](_0x3d37d1);}return _0x2f41b6[_0xb944('0xa')](_0x3d37d1)['end']();};}function respondWithResult(_0x3c8acd,_0x2c4469){_0x2c4469=_0x2c4469||0xc8;return function(_0x5b7492){if(_0x5b7492){return _0x3c8acd[_0xb944('0xa')](_0x2c4469)[_0xb944('0xb')](_0x5b7492);}};}function respondWithFilteredResult(_0x412287,_0xb367a3){return function(_0x53ac5d){if(_0x53ac5d){var _0xdca843=typeof _0xb367a3[_0xb944('0xc')]===_0xb944('0xd')&&typeof _0xb367a3[_0xb944('0xe')]===_0xb944('0xd');var _0x331c50=_0x53ac5d[_0xb944('0xf')];var _0x421463=_0xdca843?0x0:_0xb367a3[_0xb944('0xc')];var _0x14f048=_0xdca843?_0x53ac5d[_0xb944('0xf')]:_0xb367a3['offset']+_0xb367a3[_0xb944('0xe')];var _0x54873d;if(_0x14f048>=_0x331c50){_0x14f048=_0x331c50;_0x54873d=0xc8;}else{_0x54873d=0xce;}_0x412287[_0xb944('0xa')](_0x54873d);return _0x412287[_0xb944('0x10')]('Content-Range',_0x421463+'-'+_0x14f048+'/'+_0x331c50)[_0xb944('0xb')](_0x53ac5d);}return null;};}function removeEntity(_0x24d83f){return function(_0x512a97){if(_0x512a97){return _0x512a97[_0xb944('0x11')]()[_0xb944('0x12')](function(){var _0x3524c0=_0x512a97[_0xb944('0x13')]({'plain':!![]});var _0x4bf5f1=[{'name':_0xb944('0x14'),'value':_0xb944('0x15'),'ignore':![]},{'name':_0xb944('0x16'),'value':_0xb944('0x17'),'ignore':![]},{'name':_0xb944('0x18'),'value':_0xb944('0x19'),'ignore':![]}];var _0x11c503=_(_0x4bf5f1)[_0xb944('0x1a')]('ignore')['map']('value')[_0xb944('0x1b')]();if(_[_0xb944('0x1c')](_0x11c503,_0x3524c0[_0xb944('0x1d')])){return;}var _0x4179f0=_[_0xb944('0x1e')](_0x4bf5f1,[_0xb944('0x1b'),_0x3524c0['type']])['name'];return db[_0xb944('0x1f')][_0xb944('0x11')]({'where':{'type':_0x4179f0,'resourceId':_0x3524c0['id']}})['then'](function(){return _0x512a97;});})['then'](function(){_0x24d83f[_0xb944('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c7827){return function(_0x4fea1e){if(!_0x4fea1e){_0x5c7827[_0xb944('0x9')](0x194);}return _0x4fea1e;};}function handleError(_0x21fea3,_0x426d19){_0x426d19=_0x426d19||0x1f4;return function(_0x3587a7){logger[_0xb944('0x20')](_0x3587a7[_0xb944('0x21')]);if(_0x3587a7[_0xb944('0x22')]){delete _0x3587a7[_0xb944('0x22')];}_0x21fea3[_0xb944('0xa')](_0x426d19)[_0xb944('0x23')](_0x3587a7);};}exports[_0xb944('0x24')]=function(_0x2cd00d,_0x22452d){var _0xfbff03={},_0xba3d14={},_0x289f87={'count':0x0,'rows':[]};var _0x5dd4e2=_['map'](db[_0xb944('0x25')][_0xb944('0x26')],function(_0x16f746){return{'name':_0x16f746[_0xb944('0x27')],'type':_0x16f746[_0xb944('0x1d')][_0xb944('0x28')]};});_0xba3d14[_0xb944('0x29')]=_['map'](_0x5dd4e2,_0xb944('0x22'));_0xba3d14['query']=_['keys'](_0x2cd00d[_0xb944('0x2a')]);_0xba3d14[_0xb944('0x2b')]=_[_0xb944('0x2c')](_0xba3d14[_0xb944('0x29')],_0xba3d14[_0xb944('0x2a')]);_0xfbff03[_0xb944('0x2d')]=_[_0xb944('0x2c')](_0xba3d14[_0xb944('0x29')],qs[_0xb944('0x2e')](_0x2cd00d[_0xb944('0x2a')][_0xb944('0x2e')]));_0xfbff03['attributes']=_0xfbff03['attributes'][_0xb944('0x2f')]?_0xfbff03[_0xb944('0x2d')]:_0xba3d14[_0xb944('0x29')];if(!_0x2cd00d[_0xb944('0x2a')][_0xb944('0x30')](_0xb944('0x31'))){_0xfbff03[_0xb944('0xe')]=qs[_0xb944('0xe')](_0x2cd00d[_0xb944('0x2a')][_0xb944('0xe')]);_0xfbff03[_0xb944('0xc')]=qs[_0xb944('0xc')](_0x2cd00d[_0xb944('0x2a')][_0xb944('0xc')]);}_0xfbff03[_0xb944('0x32')]=qs[_0xb944('0x33')](_0x2cd00d['query'][_0xb944('0x33')]);_0xfbff03[_0xb944('0x34')]=qs[_0xb944('0x2b')](_[_0xb944('0x35')](_0x2cd00d['query'],_0xba3d14[_0xb944('0x2b')]),_0x5dd4e2);if(_0x2cd00d[_0xb944('0x2a')][_0xb944('0x1a')]){_0xfbff03['where']=_[_0xb944('0x36')](_0xfbff03[_0xb944('0x34')],{'$or':_[_0xb944('0x37')](_0x5dd4e2,function(_0x19a09e){if(_0x19a09e['type']!==_0xb944('0x38')){var _0x252c72={};_0x252c72[_0x19a09e[_0xb944('0x22')]]={'$like':'%'+_0x2cd00d[_0xb944('0x2a')][_0xb944('0x1a')]+'%'};return _0x252c72;}})});}_0xfbff03=_[_0xb944('0x36')]({},_0xfbff03,_0x2cd00d[_0xb944('0x39')]);var _0x251d08={'where':_0xfbff03[_0xb944('0x34')]};return db[_0xb944('0x25')][_0xb944('0xf')](_0x251d08)[_0xb944('0x12')](function(_0x21c6a7){_0x289f87[_0xb944('0xf')]=_0x21c6a7;if(_0x2cd00d[_0xb944('0x2a')][_0xb944('0x3a')]){_0xfbff03[_0xb944('0x3b')]=[{'all':!![]}];}return db[_0xb944('0x25')][_0xb944('0x3c')](_0xfbff03);})['then'](function(_0x65bc3e){_0x289f87[_0xb944('0x3d')]=_0x65bc3e;return _0x289f87;})[_0xb944('0x12')](respondWithFilteredResult(_0x22452d,_0xfbff03))['catch'](handleError(_0x22452d,null));};exports[_0xb944('0x3e')]=function(_0x4265a5,_0x19016e){var _0x27d7c9={'raw':![],'where':{'id':_0x4265a5[_0xb944('0x3f')]['id']}},_0x5cdb19={};_0x5cdb19[_0xb944('0x29')]=_[_0xb944('0x40')](db[_0xb944('0x25')][_0xb944('0x26')]);_0x5cdb19[_0xb944('0x2a')]=_['keys'](_0x4265a5[_0xb944('0x2a')]);_0x5cdb19[_0xb944('0x2b')]=_['intersection'](_0x5cdb19['model'],_0x5cdb19[_0xb944('0x2a')]);_0x27d7c9[_0xb944('0x2d')]=_[_0xb944('0x2c')](_0x5cdb19[_0xb944('0x29')],qs[_0xb944('0x2e')](_0x4265a5[_0xb944('0x2a')][_0xb944('0x2e')]));_0x27d7c9[_0xb944('0x2d')]=_0x27d7c9[_0xb944('0x2d')][_0xb944('0x2f')]?_0x27d7c9[_0xb944('0x2d')]:_0x5cdb19[_0xb944('0x29')];if(_0x4265a5[_0xb944('0x2a')][_0xb944('0x3a')]){_0x27d7c9[_0xb944('0x3b')]=[{'all':!![]}];}_0x27d7c9=_[_0xb944('0x36')]({},_0x27d7c9,_0x4265a5[_0xb944('0x39')]);return db[_0xb944('0x25')][_0xb944('0x1e')](_0x27d7c9)[_0xb944('0x12')](handleEntityNotFound(_0x19016e,null))[_0xb944('0x12')](respondWithResult(_0x19016e,null))[_0xb944('0x41')](handleError(_0x19016e,null));};exports[_0xb944('0x11')]=function(_0x55ad4f,_0x50e26d){return db[_0xb944('0x25')]['find']({'where':{'id':_0x55ad4f[_0xb944('0x3f')]['id']}})[_0xb944('0x12')](handleEntityNotFound(_0x50e26d,null))[_0xb944('0x12')](removeEntity(_0x50e26d,null))['catch'](handleError(_0x50e26d,null));};exports[_0xb944('0x42')]=function(_0x1ac629,_0x4043cc){if(_0x1ac629[_0xb944('0x43')][_0xb944('0x1d')]===_0xb944('0x17')&&!_[_0xb944('0x44')](_0x1ac629[_0xb944('0x43')][_0xb944('0x45')],'_')){_0x1ac629[_0xb944('0x43')][_0xb944('0x45')]='_'[_0xb944('0x46')](_0x1ac629[_0xb944('0x43')]['exten']);}return db[_0xb944('0x25')][_0xb944('0x42')](_0x1ac629['body'],{'raw':![]})[_0xb944('0x12')](function(_0x1e745){var _0x25048e=_0x1ac629[_0xb944('0x47')][_0xb944('0x13')]({'plain':!![]});if(!_0x25048e)throw new Error(_0xb944('0x48'));if(_0x25048e[_0xb944('0x49')]===_0xb944('0x47')){var _0x25ba11=_0x1e745[_0xb944('0x13')]({'plain':!![]});var _0x43cec3=[{'name':_0xb944('0x14'),'value':'inbound'},{'name':_0xb944('0x16'),'value':_0xb944('0x17')},{'name':_0xb944('0x18'),'value':_0xb944('0x19')}];var _0x57acb2=_[_0xb944('0x1e')](_0x43cec3,[_0xb944('0x1b'),_0x25ba11['type']])[_0xb944('0x22')];return db[_0xb944('0x4a')][_0xb944('0x1e')]({'where':{'name':_0x57acb2,'userProfileId':_0x25048e['userProfileId']},'raw':!![]})[_0xb944('0x12')](function(_0x654601){if(_0x654601&&_0x654601['autoAssociation']===0x0){return db['UserProfileResource'][_0xb944('0x42')]({'name':_0x25ba11[_0xb944('0x22')],'resourceId':_0x25ba11['id'],'type':_0x654601[_0xb944('0x22')],'sectionId':_0x654601['id']},{})[_0xb944('0x12')](function(){return _0x1e745;});}else{return _0x1e745;}})[_0xb944('0x41')](function(_0x5d7925){logger['error'](_0xb944('0x4b'),_0x5d7925);throw _0x5d7925;});}return _0x1e745;})[_0xb944('0x12')](respondWithResult(_0x4043cc,0xc9))[_0xb944('0x41')](handleError(_0x4043cc,null));};exports[_0xb944('0x4c')]=function(_0x518d44,_0x261a47){if(_0x518d44['body']['id']){delete _0x518d44[_0xb944('0x43')]['id'];}return db[_0xb944('0x25')][_0xb944('0x1e')]({'where':{'id':_0x518d44['params']['id']}})['then'](handleEntityNotFound(_0x261a47,null))[_0xb944('0x12')](function(_0x4f6dd9){if(_0x4f6dd9){return db[_0xb944('0x25')][_0xb944('0x4c')](_['pick'](_0x518d44[_0xb944('0x43')],[_0xb944('0x45'),_0xb944('0x4d'),_0xb944('0x4e'),_0xb944('0x4f'),_0xb944('0x50'),_0xb944('0x51'),_0xb944('0x52')]),{'where':{'context':_0x4f6dd9[_0xb944('0x4d')],'exten':_0x4f6dd9[_0xb944('0x45')]},'individualHooks':!![]})[_0xb944('0x12')](function(_0x36f252){return _0x36f252;});}return null;})[_0xb944('0x12')](respondWithStatusCode(_0x261a47,null))['catch'](handleError(_0x261a47,null));};exports[_0xb944('0x53')]=function(_0x41ebb0,_0x19059f){var _0x289e00=_0x41ebb0[_0xb944('0x3f')]['id'];var _0x2db80c=_0x41ebb0[_0xb944('0x43')];var _0x6b34cd=0xc8;var _0x24ffac=null;return db[_0xb944('0x54')][_0xb944('0x55')]({'isolationLevel':db[_0xb944('0x54')][_0xb944('0x56')][_0xb944('0x57')][_0xb944('0x58')]},function(_0x11a7f9){return db[_0xb944('0x25')][_0xb944('0x59')]({'where':{'id':_0x289e00},'transaction':_0x11a7f9})[_0xb944('0x12')](function(_0xae9aa5){if(_0xae9aa5){return db[_0xb944('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x289e00},'transaction':_0x11a7f9})[_0xb944('0x12')](function(){var _0x19309a=_[_0xb944('0x37')](_0x2db80c,function(_0x1037d2){_0x1037d2['VoiceExtensionId']=_0x289e00;_0x1037d2[_0xb944('0x5a')]=!![];return _0x1037d2;});return _0xae9aa5[_0xb944('0x5b')](_0x19309a);})['then'](function(_0x569c53){return db['VoiceExtension'][_0xb944('0x5c')](_0x569c53,{'transaction':_0x11a7f9});});}else{_0x6b34cd=0x194;_0x24ffac=[];}});})[_0xb944('0x12')](function(){if(_0x6b34cd!==0x194){return db[_0xb944('0x25')][_0xb944('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x289e00},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x2e6ca6){_0x24ffac=_0x2e6ca6;});}})['catch'](function(_0x592c83){_0x6b34cd=0x1f4;logger[_0xb944('0x20')](_0x592c83[_0xb944('0x21')]);if(_0x592c83[_0xb944('0x22')]){delete _0x592c83[_0xb944('0x22')];}_0x24ffac=_0x592c83;})['finally'](function(){if(_0x24ffac===null){_0x19059f[_0xb944('0x9')](_0x6b34cd);}else{if(_0x6b34cd===0x1f4){_0x19059f[_0xb944('0xa')](_0x6b34cd)[_0xb944('0x23')](_0x24ffac);}else{_0x19059f[_0xb944('0xa')](_0x6b34cd)[_0xb944('0xb')](_0x24ffac);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4e2d525..d5b327c 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 _0x5715=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x411867,_0x4665f5){var _0x4d3f61=function(_0x513490){while(--_0x513490){_0x411867['push'](_0x411867['shift']());}};_0x4d3f61(++_0x4665f5);}(_0x5715,0x9a));var _0x5571=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0x5715[_0x1fd9e7];return _0x1781f2;};'use strict';var EventEmitter=require(_0x5571('0x0'));var VoiceExtension=require(_0x5571('0x1'))['db'][_0x5571('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5571('0x3')](0x0);var events={'afterCreate':_0x5571('0x4'),'afterUpdate':_0x5571('0x5'),'afterDestroy':'remove'};function emitEvent(_0x556436){return function(_0x56c6bd,_0x593a2b,_0x370439){VoiceExtensionEvents['emit'](_0x556436+':'+_0x56c6bd['id'],_0x56c6bd);VoiceExtensionEvents[_0x5571('0x6')](_0x556436,_0x56c6bd);_0x370439(null);};}for(var e in events){if(events[_0x5571('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x5571('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xed96=['events','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1fe66f,_0x56bfe0){var _0x2882de=function(_0x37e3be){while(--_0x37e3be){_0x1fe66f['push'](_0x1fe66f['shift']());}};_0x2882de(++_0x56bfe0);}(_0xed96,0x138));var _0x6ed9=function(_0x1d8a5d,_0x59a110){_0x1d8a5d=_0x1d8a5d-0x0;var _0x54d59f=_0xed96[_0x1d8a5d];return _0x54d59f;};'use strict';var EventEmitter=require(_0x6ed9('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x6ed9('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6ed9('0x2')](0x0);var events={'afterCreate':_0x6ed9('0x3'),'afterUpdate':'update','afterDestroy':_0x6ed9('0x4')};function emitEvent(_0x393510){return function(_0x122510,_0x3e1ccd,_0x3f826a){VoiceExtensionEvents[_0x6ed9('0x5')](_0x393510+':'+_0x122510['id'],_0x122510);VoiceExtensionEvents['emit'](_0x393510,_0x122510);_0x3f826a(null);};}for(var e in events){if(events[_0x6ed9('0x6')](e)){var event=events[e];VoiceExtension[_0x6ed9('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c72c1fe..7f62340 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 _0xbbd7=['CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','length','phone','param','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','intervals','map','toLowerCase','hasOwnProperty','tag','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','last','priority','catch','VoiceExtension','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push'];(function(_0x4df654,_0x3d7ce5){var _0x4f7184=function(_0x1b3afc){while(--_0x1b3afc){_0x4df654['push'](_0x4df654['shift']());}};_0x4f7184(++_0x3d7ce5);}(_0xbbd7,0x8c));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require(_0x7bbd('0x0'));module[_0x7bbd('0x1')]=function(_0x4c82c9){var _0x5d5d6b=_0x4c82c9['models'];function _0x3f78a5(_0x2c5d1f){var _0xf52fd0=0x2;var _0xd082df=[{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x4')+_0x2c5d1f['type'],'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x2c5d1f[_0x7bbd('0x7')]?'Set':'NoOp','appdata':_0x2c5d1f[_0x7bbd('0x7')]?_0x7bbd('0x8')+_0x2c5d1f['alias']:_0x7bbd('0x9'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f['exten'],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']}];if(_0x2c5d1f[_0x7bbd('0x2')]===_0x7bbd('0xa')){_0xd082df[_0x7bbd('0xb')]({'type':_0x7bbd('0xa'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xc')+_0x2c5d1f['id'],'context':_0x2c5d1f['context'],'exten':_0x2c5d1f['exten'],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']});}_0xd082df[_0x7bbd('0xb')]({'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xd'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f[_0x7bbd('0x2')],'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']},{'type':_0x2c5d1f['type'],'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xe'),'context':_0x2c5d1f[_0x7bbd('0x5')],'exten':_0x2c5d1f[_0x7bbd('0x6')],'priority':_0xf52fd0++,'VoiceExtensionId':_0x2c5d1f['id']});return _0xd082df;}function _0x269faa(_0x10d5c8){var _0x55b3b5=0x2;var _0x4752a5=[{'type':_0x7bbd('0xf'),'app':'Set','appdata':_0x7bbd('0x10'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x10d5c8[_0x7bbd('0x7')]?_0x7bbd('0x3'):_0x7bbd('0x11'),'appdata':_0x10d5c8['alias']?_0x7bbd('0x8')+_0x10d5c8[_0x7bbd('0x7')]:_0x7bbd('0x9'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x12')+(_0x10d5c8['cutdigits']?_0x7bbd('0x13')+_0x10d5c8[_0x7bbd('0x14')]+'}':_0x7bbd('0x15')),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xc')+_0x10d5c8['id'],'context':_0x10d5c8['context'],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':'ExecIf','appdata':_0x7bbd('0x16')+(_0x55b3b5+0x2)+'):Goto('+(_0x55b3b5+0x1)+')','context':_0x10d5c8['context'],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':'Set','appdata':_0x10d5c8['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x10d5c8[_0x7bbd('0x14')]+'}':_0x7bbd('0x17'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0xd'),'context':_0x10d5c8['context'],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x18'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x19')+_0x10d5c8['id'],'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']}];if(_0x10d5c8['hasOwnProperty'](_0x7bbd('0x1a'))&&_0x10d5c8[_0x7bbd('0x1a')]!==_0x7bbd('0x1b')){_0x4752a5[_0x7bbd('0xb')]({'type':_0x7bbd('0xf'),'app':_0x7bbd('0x3'),'appdata':_0x7bbd('0x1c'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8['exten'],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']},{'type':'outbound','app':_0x7bbd('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x10d5c8[_0x7bbd('0x1a')]||_0x7bbd('0x1d'),'context':_0x10d5c8[_0x7bbd('0x5')],'exten':_0x10d5c8[_0x7bbd('0x6')],'priority':_0x55b3b5++,'VoiceExtensionId':_0x10d5c8['id']});}return _0x4752a5;}function _0x21ed16(_0x41a549,_0x2e4f3c){var _0x32636d=[{'name':_0x7bbd('0x1e'),'param':0x0},{'name':_0x7bbd('0x1f'),'param':0x1},{'name':_0x7bbd('0x20'),'param':0x2},{'name':_0x7bbd('0x21'),'param':0x3}];var _0x1339de={};var _0x4dea53=_0x2e4f3c[_0x7bbd('0x22')](',');var _0x1de6a6=[];for(var _0x3cf62f=0x0;_0x3cf62f<_0x32636d[_0x7bbd('0x23')];_0x3cf62f++){switch(_0x32636d[_0x3cf62f]['name']){case'trunk':_0x1339de[_0x7bbd('0x1e')]=_0x4dea53[_0x32636d[_0x3cf62f]['param']]['split']('/')[0x1];_0x1339de[_0x7bbd('0x24')]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]][_0x7bbd('0x22')]('/')[0x2];_0x1339de['prefix']=_0x1339de[_0x7bbd('0x24')]?_0x1339de[_0x7bbd('0x24')][_0x7bbd('0x22')]('$')[0x0]:undefined;_0x1339de[_0x7bbd('0x24')]=_0x41a549[_0x7bbd('0x14')]?(_0x1339de['prefix']||'')+_0x7bbd('0x13')+_0x41a549[_0x7bbd('0x14')]+'}':(_0x1339de[_0x7bbd('0x26')]||'')+_0x7bbd('0x15');_0x1de6a6[_0x32636d[_0x3cf62f]['param']]=[_0x7bbd('0x27'),_0x1339de[_0x7bbd('0x1e')],_0x1339de['phone']][_0x7bbd('0x28')]('/');break;case _0x7bbd('0x20'):_0x1339de[_0x7bbd('0x20')]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]];if(_0x41a549['recordingFormat']!=='none'){if(_0x1339de[_0x7bbd('0x20')][_0x7bbd('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x1339de[_0x7bbd('0x20')]+=_0x7bbd('0x2a');}}else{_0x1339de[_0x7bbd('0x20')]=_0x1339de['options'][_0x7bbd('0x2b')](_0x7bbd('0x2a'),'');}_0x1de6a6[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]]=_0x1339de['options'];break;default:_0x1de6a6[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]]=_0x4dea53[_0x32636d[_0x3cf62f][_0x7bbd('0x25')]];}}return _0x1de6a6[_0x7bbd('0x28')](',');}function _0x3dbbb9(_0x436857,_0x3e396e,_0x526e94){return new Promise(function(_0x28551e,_0x285e81){var _0x17cd2b=[];if(_[_0x7bbd('0x2c')](_0x3e396e))return _0x28551e(_0x17cd2b);_0x5d5d6b[_0x7bbd('0x2d')]['findAll']({'attributes':['id',_0x7bbd('0x2e'),_0x7bbd('0x2f')],'raw':!![]})[_0x7bbd('0x30')](function(_0x539ae9){for(var _0x58bc69=0x0,_0x39310b=0x0;_0x58bc69<_0x3e396e[_0x7bbd('0x23')];_0x58bc69++,_0x39310b=0x0){var _0x429f9c=_0x3e396e[_0x58bc69];var _0x3f71cd=[];var _0x4e956a=[];delete _0x429f9c['id'];if(_0x429f9c['interval']!=='*,*,*,*'){_0x429f9c[_0x7bbd('0x31')]=[_0x429f9c[_0x7bbd('0x2e')]];}else{_0x429f9c['intervals']=_0x429f9c['IntervalId']?_[_0x7bbd('0x32')](_['filter'](_0x539ae9,{'IntervalId':_0x429f9c['IntervalId']}),_0x7bbd('0x2e')):[];}_0x429f9c[_0x7bbd('0x5')]=_0x436857['context'];_0x429f9c[_0x7bbd('0x6')]=_0x436857[_0x7bbd('0x6')];if(_0x429f9c[_0x7bbd('0x2')])_0x429f9c['type']=_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')]();if(_0x436857[_0x7bbd('0x2')]===_0x7bbd('0xf')){if(_0x429f9c[_0x7bbd('0x34')](_0x7bbd('0x35'))&&_0x429f9c['tag']&&_0x429f9c['tag']!=='--'){_0x3f71cd['push']({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x3'),'appdata':'CDR(tag)='+_0x429f9c[_0x7bbd('0x35')],'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x429f9c[_0x7bbd('0x37')]?_0x7bbd('0x38')+_0x429f9c[_0x7bbd('0x37')]+')':_0x7bbd('0x39')),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}else{if(_0x429f9c['hasOwnProperty'](_0x7bbd('0x3a'))){if(['queue','playback']['includes'](_0x429f9c[_0x7bbd('0x3b')]['toLowerCase']())&&_0x429f9c[_0x7bbd('0x3c')]!==_0x7bbd('0x3d')){if(_0x429f9c[_0x7bbd('0x3a')]){_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':_0x7bbd('0x3e'),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c['type'][_0x7bbd('0x33')](),'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}else{_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')][_0x7bbd('0x33')](),'app':_0x7bbd('0x36'),'appdata':_0x7bbd('0x3f'),'context':_0x436857[_0x7bbd('0x5')],'exten':_0x436857[_0x7bbd('0x6')],'priority':_0x429f9c['intervals'][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});_0x3f71cd[_0x7bbd('0xb')]({'type':_0x429f9c[_0x7bbd('0x2')]['toLowerCase'](),'app':_0x7bbd('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x436857['context'],'exten':_0x436857['exten'],'priority':_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]+_0x526e94+_0x39310b++,'VoiceExtensionId':_0x436857['id']});}}}}for(var _0x42aebc=0x0;_0x42aebc<_0x429f9c['intervals']['length'];_0x42aebc++){var _0x21e04a=_0x526e94+_0x429f9c['intervals'][_0x7bbd('0x23')];var _0x541310=_0x42aebc===_0x429f9c[_0x7bbd('0x31')][_0x7bbd('0x23')]-0x1?_0x526e94+_0x3f71cd[_0x7bbd('0x23')]+_0x4e956a[_0x7bbd('0x23')]+0x2:_0x526e94+_0x42aebc+0x1;_0x3f71cd[_0x7bbd('0x40')](_0x42aebc,0x0,{'type':_0x436857[_0x7bbd('0x2')],'app':'GotoIfTime','appdata':_0x429f9c[_0x7bbd('0x31')][_0x42aebc]+'?'+_0x436857[_0x7bbd('0x5')]+',${EXTEN},'+_0x21e04a+':'+_0x436857[_0x7bbd('0x5')]+_0x7bbd('0x41')+_0x541310,'exten':_0x436857['exten'],'context':_0x436857['context'],'priority':_0x526e94+_0x42aebc,'VoiceExtensionId':_0x436857['id']});}if(_0x429f9c[_0x7bbd('0x3c')]===_0x7bbd('0x42'))_0x429f9c['appdata']=_0x21ed16(_0x436857,_0x429f9c[_0x7bbd('0x43')]);_0x429f9c['priority']=_0x3f71cd[_0x7bbd('0x23')]?_[_0x7bbd('0x44')](_0x3f71cd)[_0x7bbd('0x45')]+0x1:_0x526e94;_0x17cd2b=_['concat'](_0x17cd2b,_0x3f71cd,[_0x429f9c],_0x4e956a);_0x526e94=_['last'](_0x17cd2b)[_0x7bbd('0x45')]+0x1;}return _0x28551e(_0x17cd2b);})[_0x7bbd('0x46')](function(_0x56d828){_0x285e81(_0x56d828);});});}return _0x4c82c9['define'](_0x7bbd('0x47'),attributes,{'tableName':_0x7bbd('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x47554e){var _0x439b0b=this[_0x7bbd('0x49')]({'plain':!![]});var _0x1e0f2d=_0x439b0b[_0x7bbd('0x2')]===_0x7bbd('0xf')?_0x269faa(_0x439b0b):_0x3f78a5(_0x439b0b);return _0x3dbbb9(_0x439b0b,_0x47554e,_['last'](_0x1e0f2d)[_0x7bbd('0x45')]+0x1)['then'](function(_0x3561e0){var _0x3df747=_[_0x7bbd('0x4a')](_0x1e0f2d,_0x3561e0);_0x3df747[_0x7bbd('0xb')]({'type':_0x439b0b[_0x7bbd('0x2')],'app':_0x7bbd('0x4b'),'exten':_0x439b0b[_0x7bbd('0x6')],'context':_0x439b0b[_0x7bbd('0x5')],'priority':_['last'](_0x3df747)[_0x7bbd('0x45')]+0x1,'VoiceExtensionId':_0x439b0b['id']});return _0x3df747;});}}});}; \ No newline at end of file +var _0x56e7=['name','trunk','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','IntervalId','intervals','map','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','push','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','options','url','split','length'];(function(_0x3f670b,_0x10f414){var _0x1c0978=function(_0x5c1276){while(--_0x5c1276){_0x3f670b['push'](_0x3f670b['shift']());}};_0x1c0978(++_0x10f414);}(_0x56e7,0x7b));var _0x756e=function(_0x3828df,_0x453607){_0x3828df=_0x3828df-0x0;var _0x132d03=_0x56e7[_0x3828df];return _0x132d03;};'use strict';var _=require('lodash');var attributes=require(_0x756e('0x0'));module[_0x756e('0x1')]=function(_0x590286){var _0x2eadee=_0x590286[_0x756e('0x2')];function _0x46a672(_0xb850c9){var _0x11ce5f=0x2;var _0x38546a=[{'type':_0xb850c9[_0x756e('0x3')],'app':'Set','appdata':_0x756e('0x4')+_0xb850c9[_0x756e('0x3')],'context':_0xb850c9[_0x756e('0x5')],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']},{'type':_0xb850c9['type'],'app':_0xb850c9[_0x756e('0x7')]?'Set':_0x756e('0x8'),'appdata':_0xb850c9[_0x756e('0x7')]?_0x756e('0x9')+_0xb850c9[_0x756e('0x7')]:'No\x20alias\x20set','context':_0xb850c9['context'],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']}];if(_0xb850c9[_0x756e('0x3')]===_0x756e('0xa')){_0x38546a['push']({'type':_0x756e('0xa'),'app':_0x756e('0xb'),'appdata':'CDR(routeid)='+_0xb850c9['id'],'context':_0xb850c9['context'],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']});}_0x38546a['push']({'type':_0xb850c9[_0x756e('0x3')],'app':_0x756e('0xb'),'appdata':_0x756e('0xc'),'context':_0xb850c9[_0x756e('0x5')],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']},{'type':_0xb850c9['type'],'app':'Set','appdata':_0x756e('0xd'),'context':_0xb850c9[_0x756e('0x5')],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']},{'type':_0xb850c9['type'],'app':'Set','appdata':_0x756e('0xe'),'context':_0xb850c9[_0x756e('0x5')],'exten':_0xb850c9[_0x756e('0x6')],'priority':_0x11ce5f++,'VoiceExtensionId':_0xb850c9['id']});return _0x38546a;}function _0x296b14(_0x42114e){var _0x285290=0x2;var _0x124ac0=[{'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':'CDR(type)=outbound','context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e['exten'],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':'outbound','app':_0x42114e[_0x756e('0x7')]?_0x756e('0xb'):_0x756e('0x8'),'appdata':_0x42114e[_0x756e('0x7')]?_0x756e('0x9')+_0x42114e[_0x756e('0x7')]:_0x756e('0x10'),'context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':_0x756e('0x11')+(_0x42114e[_0x756e('0x12')]?_0x756e('0x13')+_0x42114e[_0x756e('0x12')]+'}':_0x756e('0x14')),'context':_0x42114e['context'],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':'outbound','app':_0x756e('0xb'),'appdata':_0x756e('0x15')+_0x42114e['id'],'context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':'outbound','app':_0x756e('0x16'),'appdata':_0x756e('0x17')+(_0x285290+0x2)+_0x756e('0x18')+(_0x285290+0x1)+')','context':_0x42114e['context'],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':_0x42114e['cutdigits']?_0x756e('0x19')+_0x42114e[_0x756e('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':'Set','appdata':_0x756e('0xc'),'context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e['exten'],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':_0x756e('0xe'),'context':_0x42114e['context'],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':'outbound','app':'Set','appdata':_0x756e('0x1a')+_0x42114e['id'],'context':_0x42114e['context'],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']}];if(_0x42114e[_0x756e('0x1b')](_0x756e('0x1c'))&&_0x42114e[_0x756e('0x1c')]!==_0x756e('0x1d')){_0x124ac0[_0x756e('0x1e')]({'type':_0x756e('0xf'),'app':_0x756e('0xb'),'appdata':_0x756e('0x1f'),'context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']},{'type':_0x756e('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x42114e[_0x756e('0x1c')]||_0x756e('0x20'),'context':_0x42114e[_0x756e('0x5')],'exten':_0x42114e[_0x756e('0x6')],'priority':_0x285290++,'VoiceExtensionId':_0x42114e['id']});}return _0x124ac0;}function _0x254efe(_0x31a507,_0x1e977a){var _0x55a763=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x756e('0x21'),'param':0x2},{'name':_0x756e('0x22'),'param':0x3}];var _0x1866a5={};var _0x4fadda=_0x1e977a[_0x756e('0x23')](',');var _0x2d8a29=[];for(var _0x5d1575=0x0;_0x5d1575<_0x55a763[_0x756e('0x24')];_0x5d1575++){switch(_0x55a763[_0x5d1575][_0x756e('0x25')]){case _0x756e('0x26'):_0x1866a5[_0x756e('0x26')]=_0x4fadda[_0x55a763[_0x5d1575][_0x756e('0x27')]][_0x756e('0x23')]('/')[0x1];_0x1866a5[_0x756e('0x28')]=_0x4fadda[_0x55a763[_0x5d1575][_0x756e('0x27')]]['split']('/')[0x2];_0x1866a5[_0x756e('0x29')]=_0x1866a5[_0x756e('0x28')]?_0x1866a5[_0x756e('0x28')][_0x756e('0x23')]('$')[0x0]:undefined;_0x1866a5[_0x756e('0x28')]=_0x31a507[_0x756e('0x12')]?(_0x1866a5[_0x756e('0x29')]||'')+_0x756e('0x13')+_0x31a507[_0x756e('0x12')]+'}':(_0x1866a5[_0x756e('0x29')]||'')+'${EXTEN}';_0x2d8a29[_0x55a763[_0x5d1575][_0x756e('0x27')]]=[_0x756e('0x2a'),_0x1866a5['trunk'],_0x1866a5[_0x756e('0x28')]][_0x756e('0x2b')]('/');break;case _0x756e('0x21'):_0x1866a5['options']=_0x4fadda[_0x55a763[_0x5d1575][_0x756e('0x27')]];if(_0x31a507[_0x756e('0x1c')]!==_0x756e('0x1d')){if(_0x1866a5['options'][_0x756e('0x2c')](_0x756e('0x2d'))<0x0){_0x1866a5[_0x756e('0x21')]+=_0x756e('0x2d');}}else{_0x1866a5[_0x756e('0x21')]=_0x1866a5[_0x756e('0x21')]['replace'](_0x756e('0x2d'),'');}_0x2d8a29[_0x55a763[_0x5d1575][_0x756e('0x27')]]=_0x1866a5['options'];break;default:_0x2d8a29[_0x55a763[_0x5d1575][_0x756e('0x27')]]=_0x4fadda[_0x55a763[_0x5d1575][_0x756e('0x27')]];}}return _0x2d8a29[_0x756e('0x2b')](',');}function _0x3b3a17(_0x3084fc,_0x1dfa00,_0x3ecb8c){return new Promise(function(_0x260096,_0x29611e){var _0x52d21e=[];if(_[_0x756e('0x2e')](_0x1dfa00))return _0x260096(_0x52d21e);_0x2eadee['Interval'][_0x756e('0x2f')]({'attributes':['id',_0x756e('0x30'),_0x756e('0x31')],'raw':!![]})['then'](function(_0x3fc697){for(var _0x184823=0x0,_0xf68a24=0x0;_0x184823<_0x1dfa00['length'];_0x184823++,_0xf68a24=0x0){var _0x5801e7=_0x1dfa00[_0x184823];var _0x107efd=[];var _0x3f92fe=[];delete _0x5801e7['id'];if(_0x5801e7['interval']!=='*,*,*,*'){_0x5801e7[_0x756e('0x32')]=[_0x5801e7[_0x756e('0x30')]];}else{_0x5801e7[_0x756e('0x32')]=_0x5801e7['IntervalId']?_[_0x756e('0x33')](_['filter'](_0x3fc697,{'IntervalId':_0x5801e7[_0x756e('0x31')]}),_0x756e('0x30')):[];}_0x5801e7[_0x756e('0x5')]=_0x3084fc['context'];_0x5801e7[_0x756e('0x6')]=_0x3084fc['exten'];if(_0x5801e7['type'])_0x5801e7[_0x756e('0x3')]=_0x5801e7['type'][_0x756e('0x34')]();if(_0x3084fc[_0x756e('0x3')]===_0x756e('0xf')){if(_0x5801e7[_0x756e('0x1b')](_0x756e('0x35'))&&_0x5801e7[_0x756e('0x35')]&&_0x5801e7['tag']!=='--'){_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7['type'][_0x756e('0x34')](),'app':'Set','appdata':_0x756e('0x36')+_0x5801e7['tag'],'context':_0x3084fc[_0x756e('0x5')],'exten':_0x3084fc['exten'],'priority':_0x5801e7[_0x756e('0x32')][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});}_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7['type'][_0x756e('0x34')](),'app':_0x756e('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x5801e7['callerID']?_0x756e('0x37')+_0x5801e7[_0x756e('0x38')]+')':_0x756e('0x39')),'context':_0x3084fc[_0x756e('0x5')],'exten':_0x3084fc[_0x756e('0x6')],'priority':_0x5801e7[_0x756e('0x32')][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});}else{if(_0x5801e7[_0x756e('0x1b')](_0x756e('0x3a'))){if(['queue',_0x756e('0x3b')][_0x756e('0x3c')](_0x5801e7[_0x756e('0x3d')][_0x756e('0x34')]())&&_0x5801e7[_0x756e('0x3e')]!==_0x756e('0x3f')){if(_0x5801e7[_0x756e('0x3a')]){_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7['type'][_0x756e('0x34')](),'app':_0x756e('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3084fc[_0x756e('0x5')],'exten':_0x3084fc['exten'],'priority':_0x5801e7[_0x756e('0x32')][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7['type'][_0x756e('0x34')](),'app':_0x756e('0xb'),'appdata':_0x756e('0x40'),'context':_0x3084fc['context'],'exten':_0x3084fc[_0x756e('0x6')],'priority':_0x5801e7['intervals'][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});}else{_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7[_0x756e('0x3')][_0x756e('0x34')](),'app':_0x756e('0x16'),'appdata':_0x756e('0x41'),'context':_0x3084fc[_0x756e('0x5')],'exten':_0x3084fc[_0x756e('0x6')],'priority':_0x5801e7['intervals'][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});_0x107efd[_0x756e('0x1e')]({'type':_0x5801e7[_0x756e('0x3')][_0x756e('0x34')](),'app':_0x756e('0xb'),'appdata':_0x756e('0x42'),'context':_0x3084fc[_0x756e('0x5')],'exten':_0x3084fc[_0x756e('0x6')],'priority':_0x5801e7[_0x756e('0x32')][_0x756e('0x24')]+_0x3ecb8c+_0xf68a24++,'VoiceExtensionId':_0x3084fc['id']});}}}}for(var _0x237a29=0x0;_0x237a29<_0x5801e7[_0x756e('0x32')][_0x756e('0x24')];_0x237a29++){var _0x4020cd=_0x3ecb8c+_0x5801e7['intervals'][_0x756e('0x24')];var _0x9b1c8a=_0x237a29===_0x5801e7[_0x756e('0x32')][_0x756e('0x24')]-0x1?_0x3ecb8c+_0x107efd[_0x756e('0x24')]+_0x3f92fe[_0x756e('0x24')]+0x2:_0x3ecb8c+_0x237a29+0x1;_0x107efd['splice'](_0x237a29,0x0,{'type':_0x3084fc[_0x756e('0x3')],'app':_0x756e('0x43'),'appdata':_0x5801e7[_0x756e('0x32')][_0x237a29]+'?'+_0x3084fc[_0x756e('0x5')]+',${EXTEN},'+_0x4020cd+':'+_0x3084fc['context']+_0x756e('0x44')+_0x9b1c8a,'exten':_0x3084fc[_0x756e('0x6')],'context':_0x3084fc[_0x756e('0x5')],'priority':_0x3ecb8c+_0x237a29,'VoiceExtensionId':_0x3084fc['id']});}if(_0x5801e7[_0x756e('0x3e')]==='outboundDial')_0x5801e7[_0x756e('0x45')]=_0x254efe(_0x3084fc,_0x5801e7[_0x756e('0x45')]);_0x5801e7[_0x756e('0x46')]=_0x107efd[_0x756e('0x24')]?_['last'](_0x107efd)['priority']+0x1:_0x3ecb8c;_0x52d21e=_[_0x756e('0x47')](_0x52d21e,_0x107efd,[_0x5801e7],_0x3f92fe);_0x3ecb8c=_[_0x756e('0x48')](_0x52d21e)[_0x756e('0x46')]+0x1;}return _0x260096(_0x52d21e);})[_0x756e('0x49')](function(_0x21863a){_0x29611e(_0x21863a);});});}return _0x590286[_0x756e('0x4a')](_0x756e('0x4b'),attributes,{'tableName':_0x756e('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5178a2){var _0x5bd7f3=this[_0x756e('0x4d')]({'plain':!![]});var _0x86477e=_0x5bd7f3[_0x756e('0x3')]===_0x756e('0xf')?_0x296b14(_0x5bd7f3):_0x46a672(_0x5bd7f3);return _0x3b3a17(_0x5bd7f3,_0x5178a2,_[_0x756e('0x48')](_0x86477e)[_0x756e('0x46')]+0x1)[_0x756e('0x4e')](function(_0x580b66){var _0x469da7=_['concat'](_0x86477e,_0x580b66);_0x469da7[_0x756e('0x1e')]({'type':_0x5bd7f3['type'],'app':_0x756e('0x4f'),'exten':_0x5bd7f3[_0x756e('0x6')],'context':_0x5bd7f3[_0x756e('0x5')],'priority':_['last'](_0x469da7)[_0x756e('0x46')]+0x1,'VoiceExtensionId':_0x5bd7f3['id']});return _0x469da7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d1f1bea..25400c7 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 _0x3eea=['jayson/promise','client','defaults','localhost','redis','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3f07cb,_0xb9fd24){var _0x5319ec=function(_0x1c34ad){while(--_0x1c34ad){_0x3f07cb['push'](_0x3f07cb['shift']());}};_0x5319ec(++_0xb9fd24);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x439ad9,_0x116a24){_0x439ad9=_0x439ad9-0x0;var _0x3cb9ea=_0x3eea[_0x439ad9];return _0x3cb9ea;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var moment=require(_0xa3ee('0x1'));var BPromise=require(_0xa3ee('0x2'));var rs=require(_0xa3ee('0x3'));var fs=require('fs');var Redis=require(_0xa3ee('0x4'));var db=require(_0xa3ee('0x5'))['db'];var utils=require(_0xa3ee('0x6'));var logger=require(_0xa3ee('0x7'))(_0xa3ee('0x8'));var config=require(_0xa3ee('0x9'));var jayson=require(_0xa3ee('0xa'));var client=jayson[_0xa3ee('0xb')]['http']({'port':0x232a});config['redis']=_[_0xa3ee('0xc')](config['redis'],{'host':_0xa3ee('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3ee('0xe')]));require('./voiceExtension.socket')[_0xa3ee('0xf')](socket);function respondWithRpcPromise(_0x5ef236,_0x28aeb1,_0x1a3ab0){return new BPromise(function(_0x188966,_0x50f5e6){return client[_0xa3ee('0x10')](_0x5ef236,_0x1a3ab0)[_0xa3ee('0x11')](function(_0x4dc361){logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));logger[_0xa3ee('0x14')](_0xa3ee('0x15'),_0x28aeb1,'request\x20sent',JSON[_0xa3ee('0x16')](_0x4dc361));if(_0x4dc361['error']){if(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x18')]===0x1f4){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4dc361['error'][_0xa3ee('0x19')]);return _0x50f5e6(_0x4dc361[_0xa3ee('0x17')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x28aeb1,_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);return _0x188966(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);}else{logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));_0x188966(_0x4dc361[_0xa3ee('0x1a')][_0xa3ee('0x19')]);}})[_0xa3ee('0x1b')](function(_0x4aac0e){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4aac0e);_0x50f5e6(_0x4aac0e);});});}exports[_0xa3ee('0x1c')]=function(_0xad8187){var _0x216b7d=this;return new Promise(function(_0x3195a7,_0x4f8c56){return db[_0xa3ee('0x1d')][_0xa3ee('0x1e')]({'raw':_0xad8187['options']?_0xad8187[_0xa3ee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x20')]||null:null,'attributes':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x21')]||null:null,'limit':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x22')]||null:null,'include':_0xad8187[_0xa3ee('0x1f')]?_0xad8187['options'][_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x23')],function(_0x2c48db){return{'model':db[_0x2c48db['model']],'as':_0x2c48db['as'],'attributes':_0x2c48db[_0xa3ee('0x21')],'include':_0x2c48db[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x2c48db[_0xa3ee('0x23')],function(_0x42e97c){return{'model':db[_0x42e97c[_0xa3ee('0x25')]],'as':_0x42e97c['as'],'attributes':_0x42e97c[_0xa3ee('0x21')],'include':_0x42e97c[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x42e97c[_0xa3ee('0x23')],function(_0x59c6f9){return{'model':db[_0x59c6f9['model']],'as':_0x59c6f9['as'],'attributes':_0x59c6f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x11')](function(_0x481358){logger[_0xa3ee('0x26')](_0xa3ee('0x1c'),_0xad8187);logger[_0xa3ee('0x14')](_0xa3ee('0x1c'),_0xad8187,JSON[_0xa3ee('0x16')](_0x481358));_0x3195a7(_0x481358);})[_0xa3ee('0x1b')](function(_0x30ba4e){logger[_0xa3ee('0x17')](_0xa3ee('0x1c'),_0x30ba4e[_0xa3ee('0x19')],_0xad8187);_0x4f8c56(_0x216b7d['error'](0x1f4,_0x30ba4e[_0xa3ee('0x19')]));});});}; \ No newline at end of file +var _0x48e3=['include','model','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','attributes','limit','map'];(function(_0x305650,_0x1e30f1){var _0x24505d=function(_0x24d8d2){while(--_0x24d8d2){_0x305650['push'](_0x305650['shift']());}};_0x24505d(++_0x1e30f1);}(_0x48e3,0xe9));var _0x348e=function(_0x4d5890,_0x57f937){_0x4d5890=_0x4d5890-0x0;var _0x5ca4bb=_0x48e3[_0x4d5890];return _0x5ca4bb;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var moment=require('moment');var BPromise=require(_0x348e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x348e('0x3'))['db'];var utils=require(_0x348e('0x4'));var logger=require(_0x348e('0x5'))(_0x348e('0x6'));var config=require('../../config/environment');var jayson=require(_0x348e('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x348e('0x8')]=_['defaults'](config['redis'],{'host':_0x348e('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x348e('0x8')]));require(_0x348e('0xa'))[_0x348e('0xb')](socket);function respondWithRpcPromise(_0x9d9093,_0x2987d1,_0x69d401){return new BPromise(function(_0x2a91dd,_0x3b7f06){return client[_0x348e('0xc')](_0x9d9093,_0x69d401)[_0x348e('0xd')](function(_0x1dbfdb){logger[_0x348e('0xe')](_0x348e('0xf'),_0x2987d1,_0x348e('0x10'));logger['debug'](_0x348e('0x11'),_0x2987d1,_0x348e('0x10'),JSON[_0x348e('0x12')](_0x1dbfdb));if(_0x1dbfdb['error']){if(_0x1dbfdb[_0x348e('0x13')][_0x348e('0x14')]===0x1f4){logger[_0x348e('0x13')](_0x348e('0xf'),_0x2987d1,_0x1dbfdb[_0x348e('0x13')]['message']);return _0x3b7f06(_0x1dbfdb['error'][_0x348e('0x15')]);}logger[_0x348e('0x13')](_0x348e('0xf'),_0x2987d1,_0x1dbfdb[_0x348e('0x13')]['message']);return _0x2a91dd(_0x1dbfdb[_0x348e('0x13')]['message']);}else{logger[_0x348e('0xe')](_0x348e('0xf'),_0x2987d1,_0x348e('0x10'));_0x2a91dd(_0x1dbfdb['result'][_0x348e('0x15')]);}})['catch'](function(_0x579857){logger['error'](_0x348e('0xf'),_0x2987d1,_0x579857);_0x3b7f06(_0x579857);});});}exports[_0x348e('0x16')]=function(_0x3e27a6){var _0x33c5c0=this;return new Promise(function(_0x366bee,_0x3a5907){return db[_0x348e('0x17')][_0x348e('0x18')]({'raw':_0x3e27a6['options']?_0x3e27a6['options'][_0x348e('0x19')]===undefined?!![]:![]:!![],'where':_0x3e27a6[_0x348e('0x1a')]?_0x3e27a6[_0x348e('0x1a')][_0x348e('0x1b')]||null:null,'attributes':_0x3e27a6['options']?_0x3e27a6[_0x348e('0x1a')][_0x348e('0x1c')]||null:null,'limit':_0x3e27a6[_0x348e('0x1a')]?_0x3e27a6[_0x348e('0x1a')][_0x348e('0x1d')]||null:null,'include':_0x3e27a6[_0x348e('0x1a')]?_0x3e27a6[_0x348e('0x1a')]['include']?_[_0x348e('0x1e')](_0x3e27a6[_0x348e('0x1a')][_0x348e('0x1f')],function(_0x49ba87){return{'model':db[_0x49ba87[_0x348e('0x20')]],'as':_0x49ba87['as'],'attributes':_0x49ba87[_0x348e('0x1c')],'include':_0x49ba87[_0x348e('0x1f')]?_[_0x348e('0x1e')](_0x49ba87['include'],function(_0x1de341){return{'model':db[_0x1de341[_0x348e('0x20')]],'as':_0x1de341['as'],'attributes':_0x1de341[_0x348e('0x1c')],'include':_0x1de341[_0x348e('0x1f')]?_[_0x348e('0x1e')](_0x1de341[_0x348e('0x1f')],function(_0xcf5f40){return{'model':db[_0xcf5f40['model']],'as':_0xcf5f40['as'],'attributes':_0xcf5f40[_0x348e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x348e('0xd')](function(_0x4e7ae3){logger[_0x348e('0xe')](_0x348e('0x16'),_0x3e27a6);logger['debug'](_0x348e('0x16'),_0x3e27a6,JSON[_0x348e('0x12')](_0x4e7ae3));_0x366bee(_0x4e7ae3);})['catch'](function(_0x408641){logger[_0x348e('0x13')](_0x348e('0x16'),_0x408641[_0x348e('0x15')],_0x3e27a6);_0x3a5907(_0x33c5c0[_0x348e('0x13')](0x1f4,_0x408641[_0x348e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 21566ed..c701806 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x56211a,_0x586b80){var _0x4c850e=function(_0xb10e3c){while(--_0xb10e3c){_0x56211a['push'](_0x56211a['shift']());}};_0x4c850e(++_0x586b80);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x814b,0x1a2));var _0xb814=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x814b[_0x5c6022];return _0x4ab5af;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 60aee71..74d1e06 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 _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ad93b,_0x56bee2){var _0x5c83a3=function(_0x425765){while(--_0x425765){_0x1ad93b['push'](_0x1ad93b['shift']());}};_0x5c83a3(++_0x56bee2);}(_0xb016,0x159));var _0x6b01=function(_0x1d9550,_0x455067){_0x1d9550=_0x1d9550-0x0;var _0x2668a1=_0xb016[_0x1d9550];return _0x2668a1;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3a6d=['/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','post','create'];(function(_0x2b01b0,_0x670bd7){var _0x45e5c5=function(_0x356b7e){while(--_0x356b7e){_0x2b01b0['push'](_0x2b01b0['shift']());}};_0x45e5c5(++_0x670bd7);}(_0x3a6d,0x143));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/:id',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x10')]);router['put'](_0xd3a6('0x11'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x12')]);router[_0xd3a6('0x13')](_0xd3a6('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 7b3573c..178e8bd 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 _0x4d5d=['from-voicemail','contest_mailbox','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING'];(function(_0x22ce53,_0x68ca2a){var _0x375246=function(_0x2c5b4b){while(--_0x2c5b4b){_0x22ce53['push'](_0x22ce53['shift']());}};_0x375246(++_0x68ca2a);}(_0x4d5d,0x184));var _0xd4d5=function(_0x533852,_0x5e1347){_0x533852=_0x533852-0x0;var _0x3b39f2=_0x4d5d[_0x533852];return _0x3b39f2;};'use strict';var Sequelize=require(_0xd4d5('0x0'));module[_0xd4d5('0x1')]={'customer_id':{'type':Sequelize[_0xd4d5('0x2')]},'context':{'type':Sequelize[_0xd4d5('0x2')],'defaultValue':_0xd4d5('0x3'),'unique':_0xd4d5('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xd4d5('0x4')},'password':{'type':Sequelize[_0xd4d5('0x2')]},'fullname':{'type':Sequelize[_0xd4d5('0x2')]},'email':{'type':Sequelize[_0xd4d5('0x2')],'validate':{'isEmail':!![]},'set':function(_0xc7679e){this['setDataValue']('email',typeof _0xc7679e==='string'&&_0xc7679e['trim']()?_0xc7679e[_0xd4d5('0x5')]():null);}},'pager':{'type':Sequelize[_0xd4d5('0x2')]},'tz':{'type':Sequelize[_0xd4d5('0x2')],'defaultValue':_0xd4d5('0x6')},'attach':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xd4d5('0x2')]},'review':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xd4d5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd4d5('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd4d5('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd4d5('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd4d5('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xd4d5('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd4d5('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd4d5('0x7')](_0xd4d5('0x8'),'no'),'defaultValue':_0xd4d5('0x8'),'allowNull':![]},'stamp':{'type':_0xd4d5('0xa')},'emailsubject':{'type':Sequelize[_0xd4d5('0x2')]},'emailbody':{'type':Sequelize[_0xd4d5('0x2')]},'maxsecs':{'type':Sequelize[_0xd4d5('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd4d5('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd4d5('0xc')],'get':function(){return this[_0xd4d5('0xd')](_0xd4d5('0xe'))+_0xd4d5('0xf')+this[_0xd4d5('0xd')](_0xd4d5('0x10'));}}}; \ No newline at end of file +var _0x04ac=['central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim'];(function(_0x4f6bb0,_0x13da2c){var _0x3f8029=function(_0x2c7de8){while(--_0x2c7de8){_0x4f6bb0['push'](_0x4f6bb0['shift']());}};_0x3f8029(++_0x13da2c);}(_0x04ac,0x1ac));var _0xc04a=function(_0x91cac5,_0x5cf505){_0x91cac5=_0x91cac5-0x0;var _0x46a318=_0x04ac[_0x91cac5];return _0x46a318;};'use strict';var Sequelize=require(_0xc04a('0x0'));module[_0xc04a('0x1')]={'customer_id':{'type':Sequelize[_0xc04a('0x2')]},'context':{'type':Sequelize[_0xc04a('0x2')],'defaultValue':_0xc04a('0x3'),'unique':_0xc04a('0x4')},'mailbox':{'type':Sequelize[_0xc04a('0x2')],'defaultValue':'','allowNull':![],'unique':_0xc04a('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xc04a('0x2')]},'email':{'type':Sequelize[_0xc04a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1ba5f0){this[_0xc04a('0x5')]('email',typeof _0x1ba5f0==='string'&&_0x1ba5f0[_0xc04a('0x6')]()?_0x1ba5f0[_0xc04a('0x6')]():null);}},'pager':{'type':Sequelize[_0xc04a('0x2')]},'tz':{'type':Sequelize[_0xc04a('0x2')],'defaultValue':_0xc04a('0x7')},'attach':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':_0xc04a('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc04a('0x8')]('yes','no'),'defaultValue':_0xc04a('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xc04a('0x2')]},'review':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xc04a('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xc04a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc04a('0x8')](_0xc04a('0x9'),'no'),'defaultValue':_0xc04a('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xc04a('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc04a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc04a('0xb')],'get':function(){return this['getDataValue'](_0xc04a('0xc'))+_0xc04a('0xd')+this['getDataValue'](_0xc04a('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ae20237..b88e1e4 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 _0x282b=['json','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','VoiceMail','includeAll','include','findAll','catch','show','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x282b,0xec));var _0xb282=function(_0x3123bb,_0x5d4992){_0x3123bb=_0x3123bb-0x0;var _0x52d4cd=_0x282b[_0x3123bb];return _0x52d4cd;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){var _0x5e828e=_0x360f15[_0xb282('0x25')]({'plain':!![]});var _0x114f77=_0xb282('0x26');return db[_0xb282('0x27')][_0xb282('0x24')]({'where':{'type':_0x114f77,'resourceId':_0x5e828e['id']}})[_0xb282('0x23')](function(){return _0x360f15;});})['then'](function(){_0x56645f[_0xb282('0x18')](0xcc)[_0xb282('0x28')]();});}};}function handleEntityNotFound(_0x50bd73,_0x22d895){return function(_0x38a1f8){if(!_0x38a1f8){_0x50bd73[_0xb282('0x17')](0x194);}return _0x38a1f8;};}function handleError(_0x280940,_0x59644e){_0x59644e=_0x59644e||0x1f4;return function(_0x1520b1){logger[_0xb282('0x29')](_0x1520b1[_0xb282('0x2a')]);if(_0x1520b1[_0xb282('0x2b')]){delete _0x1520b1[_0xb282('0x2b')];}_0x280940[_0xb282('0x18')](_0x59644e)[_0xb282('0x2c')](_0x1520b1);};}exports['index']=function(_0x1b15b5,_0x1e2861){var _0x3eb294={},_0xd8780b={},_0x42ef75={'count':0x0,'rows':[]};var _0x5f3ddf=_[_0xb282('0x2d')](db['VoiceMail'][_0xb282('0x2e')],function(_0x1bf721){return{'name':_0x1bf721[_0xb282('0x2f')],'type':_0x1bf721['type'][_0xb282('0x30')]};});_0xd8780b['model']=_[_0xb282('0x2d')](_0x5f3ddf,_0xb282('0x2b'));_0xd8780b[_0xb282('0x31')]=_[_0xb282('0x32')](_0x1b15b5[_0xb282('0x31')]);_0xd8780b[_0xb282('0x33')]=_['intersection'](_0xd8780b[_0xb282('0x34')],_0xd8780b[_0xb282('0x31')]);_0x3eb294['attributes']=_['intersection'](_0xd8780b[_0xb282('0x34')],qs[_0xb282('0x35')](_0x1b15b5[_0xb282('0x31')]['fields']));_0x3eb294['attributes']=_0x3eb294['attributes'][_0xb282('0x36')]?_0x3eb294[_0xb282('0x37')]:_0xd8780b[_0xb282('0x34')];if(!_0x1b15b5[_0xb282('0x31')][_0xb282('0x38')](_0xb282('0x39'))){_0x3eb294[_0xb282('0x1b')]=qs['limit'](_0x1b15b5[_0xb282('0x31')]['limit']);_0x3eb294[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1b15b5[_0xb282('0x31')]['offset']);}_0x3eb294[_0xb282('0x3a')]=qs['sort'](_0x1b15b5[_0xb282('0x31')][_0xb282('0x3b')]);_0x3eb294[_0xb282('0x3c')]=qs[_0xb282('0x33')](_['pick'](_0x1b15b5['query'],_0xd8780b[_0xb282('0x33')]),_0x5f3ddf);if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]){_0x3eb294[_0xb282('0x3c')]=_['merge'](_0x3eb294[_0xb282('0x3c')],{'$or':_['map'](_0x5f3ddf,function(_0x475895){if(_0x475895[_0xb282('0x3e')]!=='VIRTUAL'){var _0x41f2c4={};_0x41f2c4[_0x475895[_0xb282('0x2b')]]={'$like':'%'+_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]+'%'};return _0x41f2c4;}})});}_0x3eb294=_[_0xb282('0x3f')]({},_0x3eb294,_0x1b15b5[_0xb282('0x40')]);var _0x43e87e={'where':_0x3eb294[_0xb282('0x3c')]};return db[_0xb282('0x41')][_0xb282('0x1c')](_0x43e87e)[_0xb282('0x23')](function(_0x91fe43){_0x42ef75[_0xb282('0x1c')]=_0x91fe43;if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x42')]){_0x3eb294[_0xb282('0x43')]=[{'all':!![]}];}return db[_0xb282('0x41')][_0xb282('0x44')](_0x3eb294);})['then'](function(_0x310ad1){_0x42ef75['rows']=_0x310ad1;return _0x42ef75;})[_0xb282('0x23')](respondWithFilteredResult(_0x1e2861,_0x3eb294))[_0xb282('0x45')](handleError(_0x1e2861,null));};exports[_0xb282('0x46')]=function(_0x2f2ce8,_0x197472){var _0x3ddf56={'raw':!![],'where':{'id':_0x2f2ce8['params']['id']}},_0x5a6c0d={};_0x5a6c0d[_0xb282('0x34')]=_['keys'](db[_0xb282('0x41')][_0xb282('0x2e')]);_0x5a6c0d['query']=_[_0xb282('0x32')](_0x2f2ce8[_0xb282('0x31')]);_0x5a6c0d[_0xb282('0x33')]=_['intersection'](_0x5a6c0d['model'],_0x5a6c0d[_0xb282('0x31')]);_0x3ddf56['attributes']=_[_0xb282('0x47')](_0x5a6c0d[_0xb282('0x34')],qs[_0xb282('0x35')](_0x2f2ce8[_0xb282('0x31')][_0xb282('0x35')]));_0x3ddf56[_0xb282('0x37')]=_0x3ddf56['attributes'][_0xb282('0x36')]?_0x3ddf56[_0xb282('0x37')]:_0x5a6c0d[_0xb282('0x34')];if(_0x2f2ce8['query'][_0xb282('0x42')]){_0x3ddf56['include']=[{'all':!![]}];}_0x3ddf56=_[_0xb282('0x3f')]({},_0x3ddf56,_0x2f2ce8['options']);return db[_0xb282('0x41')]['find'](_0x3ddf56)['then'](handleEntityNotFound(_0x197472,null))['then'](respondWithResult(_0x197472,null))[_0xb282('0x45')](handleError(_0x197472,null));};exports[_0xb282('0x48')]=function(_0x42d99f,_0x7a5aa4){return db['VoiceMail']['create'](_0x42d99f['body'],{})[_0xb282('0x23')](function(_0x255ad5){var _0x3bed8d=_0x42d99f[_0xb282('0x49')]['get']({'plain':!![]});if(!_0x3bed8d)throw new Error(_0xb282('0x4a'));if(_0x3bed8d[_0xb282('0x4b')]==='user'){var _0x33bded=_0x255ad5[_0xb282('0x25')]({'plain':!![]});var _0x16f66b=_0xb282('0x26');return db[_0xb282('0x4c')]['find']({'where':{'name':_0x16f66b,'userProfileId':_0x3bed8d[_0xb282('0x4d')]},'raw':!![]})[_0xb282('0x23')](function(_0x465209){if(_0x465209&&_0x465209[_0xb282('0x4e')]===0x0){return db[_0xb282('0x27')][_0xb282('0x48')]({'name':_0x33bded['name'],'resourceId':_0x33bded['id'],'type':_0x465209[_0xb282('0x2b')],'sectionId':_0x465209['id']},{})['then'](function(){return _0x255ad5;});}else{return _0x255ad5;}})[_0xb282('0x45')](function(_0x1e6ade){logger['error'](_0xb282('0x4f'),_0x1e6ade);throw _0x1e6ade;});}return _0x255ad5;})[_0xb282('0x23')](respondWithResult(_0x7a5aa4,0xc9))[_0xb282('0x45')](handleError(_0x7a5aa4,null));};exports['update']=function(_0x51cbb0,_0x1028b9){if(_0x51cbb0[_0xb282('0x50')]['id']){delete _0x51cbb0[_0xb282('0x50')]['id'];}return db['VoiceMail'][_0xb282('0x51')]({'where':{'id':_0x51cbb0['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x1028b9,null))[_0xb282('0x23')](saveUpdates(_0x51cbb0['body'],null))[_0xb282('0x23')](respondWithResult(_0x1028b9,null))['catch'](handleError(_0x1028b9,null));};exports[_0xb282('0x24')]=function(_0x34b31a,_0x2e6eaa){return db[_0xb282('0x41')][_0xb282('0x51')]({'where':{'id':_0x34b31a[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e6eaa,null))[_0xb282('0x23')](removeEntity(_0x2e6eaa,null))['catch'](handleError(_0x2e6eaa,null));};exports[_0xb282('0x53')]=function(_0x34baf2,_0x53d50a,_0x597793){return db[_0xb282('0x41')][_0xb282('0x54')]({'where':{'id':_0x34baf2[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x53d50a,null))['then'](function(_0x40ae87){var _0x2dbbc4;var _0x3716b0={},_0x5d6a78={};_0x5d6a78[_0xb282('0x34')]=_['keys'](db[_0xb282('0x55')][_0xb282('0x2e')]);_0x5d6a78[_0xb282('0x31')]=_[_0xb282('0x32')](_0x34baf2[_0xb282('0x31')]);_0x5d6a78[_0xb282('0x33')]=_[_0xb282('0x47')](_0x5d6a78['model'],_0x5d6a78[_0xb282('0x31')]);_0x3716b0[_0xb282('0x37')]=_[_0xb282('0x47')](_0x5d6a78['model'],qs['fields'](_0x34baf2[_0xb282('0x31')][_0xb282('0x35')]));_0x3716b0[_0xb282('0x37')]=_0x3716b0['attributes']['length']?_0x3716b0[_0xb282('0x37')]:_0x5d6a78[_0xb282('0x34')];if(!_0x34baf2['query'][_0xb282('0x38')](_0xb282('0x39'))){_0x3716b0[_0xb282('0x1b')]=qs['limit'](_0x34baf2[_0xb282('0x31')][_0xb282('0x1b')]);_0x3716b0['offset']=qs[_0xb282('0x19')](_0x34baf2[_0xb282('0x31')][_0xb282('0x19')]);}_0x3716b0[_0xb282('0x3a')]=qs['sort'](_0x34baf2['query'][_0xb282('0x3b')]);_0x3716b0[_0xb282('0x3c')]=qs['filters'](_[_0xb282('0x56')](_0x34baf2[_0xb282('0x31')],_0x5d6a78[_0xb282('0x33')]));if(_0x34baf2[_0xb282('0x31')][_0xb282('0x3d')]){_0x3716b0[_0xb282('0x3c')]=_[_0xb282('0x3f')](_0x3716b0[_0xb282('0x3c')],{'$or':_['map'](_0x3716b0[_0xb282('0x37')],function(_0xb22721){var _0x18f33d={};_0x18f33d[_0xb22721]={'$like':'%'+_0x34baf2['query'][_0xb282('0x3d')]+'%'};return _0x18f33d;})});}_0x3716b0[_0xb282('0x3c')]=_['merge'](_0x3716b0['where'],{'mailboxuser':_0x40ae87[_0xb282('0x57')]});_0x3716b0=_[_0xb282('0x3f')]({},_0x3716b0,_0x34baf2[_0xb282('0x40')]);return db[_0xb282('0x55')][_0xb282('0x58')](_0x3716b0)[_0xb282('0x23')](respondWithFilteredResult(_0x53d50a,_0x3716b0));})[_0xb282('0x45')](handleError(_0x53d50a,null));}; \ No newline at end of file +var _0x351d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','get','Voicemails','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis'];(function(_0x1d6f1a,_0x527436){var _0x344a90=function(_0x578030){while(--_0x578030){_0x1d6f1a['push'](_0x1d6f1a['shift']());}};_0x344a90(++_0x527436);}(_0x351d,0x90));var _0xd351=function(_0x56bea3,_0x56ad64){_0x56bea3=_0x56bea3-0x0;var _0x468187=_0x351d[_0x56bea3];return _0x468187;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){var _0x4626c4=_0x59fb6d[_0xd351('0x20')]({'plain':!![]});var _0x489c9a=_0xd351('0x21');return db['UserProfileResource'][_0xd351('0x1e')]({'where':{'type':_0x489c9a,'resourceId':_0x4626c4['id']}})[_0xd351('0x1f')](function(){return _0x59fb6d;});})['then'](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d67e,_0x1d0cb1){return function(_0x560be9){if(!_0x560be9){_0x50d67e['sendStatus'](0x194);}return _0x560be9;};}function handleError(_0x134580,_0x555a50){_0x555a50=_0x555a50||0x1f4;return function(_0x38471c){logger[_0xd351('0x22')](_0x38471c[_0xd351('0x23')]);if(_0x38471c['name']){delete _0x38471c[_0xd351('0x24')];}_0x134580['status'](_0x555a50)[_0xd351('0x25')](_0x38471c);};}exports['index']=function(_0x5f07b1,_0xeb4da9){var _0x38c82f={},_0x3f9ef3={},_0x33b43d={'count':0x0,'rows':[]};var _0x48aa96=_[_0xd351('0x26')](db[_0xd351('0x27')][_0xd351('0x28')],function(_0x41da60){return{'name':_0x41da60[_0xd351('0x29')],'type':_0x41da60[_0xd351('0x2a')][_0xd351('0x2b')]};});_0x3f9ef3[_0xd351('0x2c')]=_[_0xd351('0x26')](_0x48aa96,'name');_0x3f9ef3[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5f07b1[_0xd351('0x2d')]);_0x3f9ef3[_0xd351('0x2f')]=_['intersection'](_0x3f9ef3[_0xd351('0x2c')],_0x3f9ef3[_0xd351('0x2d')]);_0x38c82f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x3f9ef3[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x32')]));_0x38c82f[_0xd351('0x30')]=_0x38c82f['attributes']['length']?_0x38c82f[_0xd351('0x30')]:_0x3f9ef3[_0xd351('0x2c')];if(!_0x5f07b1[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x38c82f[_0xd351('0x17')]=qs['limit'](_0x5f07b1['query'][_0xd351('0x17')]);_0x38c82f['offset']=qs[_0xd351('0x19')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x38c82f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x36')]);_0x38c82f[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x5f07b1[_0xd351('0x2d')],_0x3f9ef3['filters']),_0x48aa96);if(_0x5f07b1[_0xd351('0x2d')]['filter']){_0x38c82f[_0xd351('0x37')]=_[_0xd351('0x39')](_0x38c82f[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x48aa96,function(_0x3b42e7){if(_0x3b42e7[_0xd351('0x2a')]!=='VIRTUAL'){var _0x3ad98e={};_0x3ad98e[_0x3b42e7[_0xd351('0x24')]]={'$like':'%'+_0x5f07b1['query'][_0xd351('0x3a')]+'%'};return _0x3ad98e;}})});}_0x38c82f=_[_0xd351('0x39')]({},_0x38c82f,_0x5f07b1[_0xd351('0x3b')]);var _0x1fc216={'where':_0x38c82f[_0xd351('0x37')]};return db['VoiceMail']['count'](_0x1fc216)[_0xd351('0x1f')](function(_0x3935aa){_0x33b43d['count']=_0x3935aa;if(_0x5f07b1['query'][_0xd351('0x3c')]){_0x38c82f[_0xd351('0x3d')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x38c82f);})[_0xd351('0x1f')](function(_0x18f9d1){_0x33b43d[_0xd351('0x3e')]=_0x18f9d1;return _0x33b43d;})[_0xd351('0x1f')](respondWithFilteredResult(_0xeb4da9,_0x38c82f))[_0xd351('0x3f')](handleError(_0xeb4da9,null));};exports[_0xd351('0x40')]=function(_0x6192c3,_0x110458){var _0x129605={'raw':!![],'where':{'id':_0x6192c3['params']['id']}},_0x553360={};_0x553360[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x553360[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x6192c3[_0xd351('0x2d')]);_0x553360[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],_0x553360[_0xd351('0x2d')]);_0x129605[_0xd351('0x30')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x6192c3[_0xd351('0x2d')]['fields']));_0x129605[_0xd351('0x30')]=_0x129605[_0xd351('0x30')][_0xd351('0x41')]?_0x129605['attributes']:_0x553360[_0xd351('0x2c')];if(_0x6192c3[_0xd351('0x2d')][_0xd351('0x3c')]){_0x129605[_0xd351('0x3d')]=[{'all':!![]}];}_0x129605=_[_0xd351('0x39')]({},_0x129605,_0x6192c3['options']);return db[_0xd351('0x27')]['find'](_0x129605)[_0xd351('0x1f')](handleEntityNotFound(_0x110458,null))[_0xd351('0x1f')](respondWithResult(_0x110458,null))['catch'](handleError(_0x110458,null));};exports['create']=function(_0x1bd727,_0x444206){return db[_0xd351('0x27')]['create'](_0x1bd727[_0xd351('0x42')],{})[_0xd351('0x1f')](function(_0x548d90){var _0xf3ce5=_0x1bd727['user'][_0xd351('0x20')]({'plain':!![]});if(!_0xf3ce5)throw new Error(_0xd351('0x43'));if(_0xf3ce5['role']==='user'){var _0x25ea1e=_0x548d90['get']({'plain':!![]});var _0xf9f375=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0xf9f375,'userProfileId':_0xf3ce5[_0xd351('0x45')]},'raw':!![]})['then'](function(_0x5527da){if(_0x5527da&&_0x5527da['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x25ea1e[_0xd351('0x24')],'resourceId':_0x25ea1e['id'],'type':_0x5527da['name'],'sectionId':_0x5527da['id']},{})['then'](function(){return _0x548d90;});}else{return _0x548d90;}})[_0xd351('0x3f')](function(_0x42f248){logger['error'](_0xd351('0x48'),_0x42f248);throw _0x42f248;});}return _0x548d90;})[_0xd351('0x1f')](respondWithResult(_0x444206,0xc9))['catch'](handleError(_0x444206,null));};exports[_0xd351('0x1d')]=function(_0x59ab0f,_0x22394e){if(_0x59ab0f['body']['id']){delete _0x59ab0f[_0xd351('0x42')]['id'];}return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x59ab0f[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x22394e,null))[_0xd351('0x1f')](saveUpdates(_0x59ab0f[_0xd351('0x42')],null))['then'](respondWithResult(_0x22394e,null))['catch'](handleError(_0x22394e,null));};exports[_0xd351('0x1e')]=function(_0x624224,_0x53a9da){return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x624224[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53a9da,null))[_0xd351('0x1f')](removeEntity(_0x53a9da,null))['catch'](handleError(_0x53a9da,null));};exports['getMessages']=function(_0x2c0cb1,_0x434465,_0x4d5a60){return db[_0xd351('0x27')][_0xd351('0x4b')]({'where':{'id':_0x2c0cb1[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x434465,null))[_0xd351('0x1f')](function(_0x2dc745){var _0x505622;var _0x1e1173={},_0x2a7390={};_0x2a7390[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x4c')][_0xd351('0x28')]);_0x2a7390[_0xd351('0x2d')]=_['keys'](_0x2c0cb1[_0xd351('0x2d')]);_0x2a7390['filters']=_[_0xd351('0x31')](_0x2a7390[_0xd351('0x2c')],_0x2a7390[_0xd351('0x2d')]);_0x1e1173[_0xd351('0x30')]=_[_0xd351('0x31')](_0x2a7390['model'],qs[_0xd351('0x32')](_0x2c0cb1['query'][_0xd351('0x32')]));_0x1e1173[_0xd351('0x30')]=_0x1e1173[_0xd351('0x30')][_0xd351('0x41')]?_0x1e1173[_0xd351('0x30')]:_0x2a7390['model'];if(!_0x2c0cb1['query'][_0xd351('0x33')](_0xd351('0x34'))){_0x1e1173['limit']=qs[_0xd351('0x17')](_0x2c0cb1[_0xd351('0x2d')][_0xd351('0x17')]);_0x1e1173['offset']=qs[_0xd351('0x19')](_0x2c0cb1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x1e1173[_0xd351('0x35')]=qs['sort'](_0x2c0cb1['query'][_0xd351('0x36')]);_0x1e1173[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x2c0cb1[_0xd351('0x2d')],_0x2a7390[_0xd351('0x2f')]));if(_0x2c0cb1[_0xd351('0x2d')]['filter']){_0x1e1173[_0xd351('0x37')]=_['merge'](_0x1e1173['where'],{'$or':_[_0xd351('0x26')](_0x1e1173[_0xd351('0x30')],function(_0x4799ae){var _0x182bdc={};_0x182bdc[_0x4799ae]={'$like':'%'+_0x2c0cb1['query']['filter']+'%'};return _0x182bdc;})});}_0x1e1173['where']=_[_0xd351('0x39')](_0x1e1173[_0xd351('0x37')],{'mailboxuser':_0x2dc745[_0xd351('0x4d')]});_0x1e1173=_['merge']({},_0x1e1173,_0x2c0cb1[_0xd351('0x3b')]);return db[_0xd351('0x4c')][_0xd351('0x4e')](_0x1e1173)[_0xd351('0x1f')](respondWithFilteredResult(_0x434465,_0x1e1173));})[_0xd351('0x3f')](handleError(_0x434465,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 63b095c..56156ea 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 _0x6b73=['api','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','lodash','util'];(function(_0x5afd15,_0x109655){var _0x58f28b=function(_0x1e1c00){while(--_0x1e1c00){_0x5afd15['push'](_0x5afd15['shift']());}};_0x58f28b(++_0x109655);}(_0x6b73,0x82));var _0x36b7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b73[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x36b7('0x0'));var util=require(_0x36b7('0x1'));var logger=require('../../config/logger')(_0x36b7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x36b7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36b7('0x4'));var config=require(_0x36b7('0x5'));var attributes=require(_0x36b7('0x6'));module[_0x36b7('0x7')]=function(_0x3582db,_0x3c0f9b){return _0x3582db['define']('VoiceMail',attributes,{'tableName':_0x36b7('0x8'),'paranoid':![],'indexes':[{'name':_0x36b7('0x9'),'fields':[_0x36b7('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x83c9=['./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','util','api','moment','bluebird','path','../../config/environment'];(function(_0x45a3ab,_0x26e95a){var _0x5ea016=function(_0x55d99f){while(--_0x55d99f){_0x45a3ab['push'](_0x45a3ab['shift']());}};_0x5ea016(++_0x26e95a);}(_0x83c9,0x16e));var _0x983c=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0x83c9[_0x168478];return _0x29c2f8;};'use strict';var _=require('lodash');var util=require(_0x983c('0x0'));var logger=require('../../config/logger')(_0x983c('0x1'));var moment=require(_0x983c('0x2'));var BPromise=require(_0x983c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x983c('0x4'));var rimraf=require('rimraf');var config=require(_0x983c('0x5'));var attributes=require(_0x983c('0x6'));module[_0x983c('0x7')]=function(_0x65cd2c,_0x4eb5cb){return _0x65cd2c[_0x983c('0x8')](_0x983c('0x9'),attributes,{'tableName':_0x983c('0xa'),'paranoid':![],'indexes':[{'name':_0x983c('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index d216937..78e767e 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 _0x876c=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x578c33,_0x19c9ff){var _0x24dae3=function(_0xa02bad){while(--_0xa02bad){_0x578c33['push'](_0x578c33['shift']());}};_0x24dae3(++_0x19c9ff);}(_0x876c,0x134));var _0xc876=function(_0x3faf72,_0x25c53a){_0x3faf72=_0x3faf72-0x0;var _0x46b183=_0x876c[_0x3faf72];return _0x46b183;};'use strict';var _=require(_0xc876('0x0'));var util=require(_0xc876('0x1'));var moment=require(_0xc876('0x2'));var BPromise=require(_0xc876('0x3'));var rs=require(_0xc876('0x4'));var fs=require('fs');var Redis=require(_0xc876('0x5'));var db=require(_0xc876('0x6'))['db'];var utils=require(_0xc876('0x7'));var logger=require('../../config/logger')(_0xc876('0x8'));var config=require(_0xc876('0x9'));var jayson=require(_0xc876('0xa'));var client=jayson[_0xc876('0xb')][_0xc876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43ab2c,_0x272d2d,_0x5a4eb5){return new BPromise(function(_0x1641e6,_0x13944e){return client[_0xc876('0xd')](_0x43ab2c,_0x5a4eb5)[_0xc876('0xe')](function(_0x504640){logger[_0xc876('0xf')](_0xc876('0x10'),_0x272d2d,_0xc876('0x11'));logger[_0xc876('0x12')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x272d2d,_0xc876('0x11'),JSON[_0xc876('0x13')](_0x504640));if(_0x504640[_0xc876('0x14')]){if(_0x504640[_0xc876('0x14')]['code']===0x1f4){logger[_0xc876('0x14')](_0xc876('0x10'),_0x272d2d,_0x504640[_0xc876('0x14')]['message']);return _0x13944e(_0x504640[_0xc876('0x14')][_0xc876('0x15')]);}logger[_0xc876('0x14')](_0xc876('0x10'),_0x272d2d,_0x504640[_0xc876('0x14')][_0xc876('0x15')]);return _0x1641e6(_0x504640[_0xc876('0x14')][_0xc876('0x15')]);}else{logger[_0xc876('0xf')]('VoiceMail,\x20%s,\x20%s',_0x272d2d,_0xc876('0x11'));_0x1641e6(_0x504640[_0xc876('0x16')][_0xc876('0x15')]);}})[_0xc876('0x17')](function(_0x23f554){logger[_0xc876('0x14')]('VoiceMail,\x20%s,\x20%s',_0x272d2d,_0x23f554);_0x13944e(_0x23f554);});});} \ No newline at end of file +var _0x3bcf=['stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x43df21,_0x258445){var _0x52cc27=function(_0x5388bd){while(--_0x5388bd){_0x43df21['push'](_0x43df21['shift']());}};_0x52cc27(++_0x258445);}(_0x3bcf,0x196));var _0xf3bc=function(_0x5e1562,_0x143562){_0x5e1562=_0x5e1562-0x0;var _0x165135=_0x3bcf[_0x5e1562];return _0x165135;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf3bc('0x0'));var BPromise=require(_0xf3bc('0x1'));var rs=require(_0xf3bc('0x2'));var fs=require('fs');var Redis=require(_0xf3bc('0x3'));var db=require(_0xf3bc('0x4'))['db'];var utils=require(_0xf3bc('0x5'));var logger=require(_0xf3bc('0x6'))(_0xf3bc('0x7'));var config=require(_0xf3bc('0x8'));var jayson=require(_0xf3bc('0x9'));var client=jayson[_0xf3bc('0xa')][_0xf3bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c0124,_0x23d8cd,_0x23bf58){return new BPromise(function(_0x447c5b,_0x20a042){return client['request'](_0x1c0124,_0x23bf58)['then'](function(_0x317f58){logger['info'](_0xf3bc('0xc'),_0x23d8cd,_0xf3bc('0xd'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x23d8cd,'request\x20sent',JSON[_0xf3bc('0xe')](_0x317f58));if(_0x317f58[_0xf3bc('0xf')]){if(_0x317f58[_0xf3bc('0xf')][_0xf3bc('0x10')]===0x1f4){logger[_0xf3bc('0xf')](_0xf3bc('0xc'),_0x23d8cd,_0x317f58['error'][_0xf3bc('0x11')]);return _0x20a042(_0x317f58[_0xf3bc('0xf')]['message']);}logger['error'](_0xf3bc('0xc'),_0x23d8cd,_0x317f58['error'][_0xf3bc('0x11')]);return _0x447c5b(_0x317f58['error']['message']);}else{logger[_0xf3bc('0x12')](_0xf3bc('0xc'),_0x23d8cd,_0xf3bc('0xd'));_0x447c5b(_0x317f58[_0xf3bc('0x13')]['message']);}})[_0xf3bc('0x14')](function(_0x356a6f){logger[_0xf3bc('0xf')](_0xf3bc('0xc'),_0x23d8cd,_0x356a6f);_0x20a042(_0x356a6f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 5a4e4a5..7c39d86 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 _0x26d3=['post','create','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x26d3,0xf5));var _0x326d=function(_0x255121,_0x3dd03b){_0x255121=_0x255121-0x0;var _0x52ebb9=_0x26d3[_0x255121];return _0x52ebb9;};'use strict';var multer=require(_0x326d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x326d('0x1'));var express=require(_0x326d('0x2'));var router=express[_0x326d('0x3')]();var fs_extra=require(_0x326d('0x4'));var auth=require(_0x326d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x326d('0x6'));var controller=require(_0x326d('0x7'));router[_0x326d('0x8')]('/',auth[_0x326d('0x9')](),controller[_0x326d('0xa')]);router[_0x326d('0x8')](_0x326d('0xb'),auth['isAuthenticated'](),controller[_0x326d('0xc')]);router[_0x326d('0x8')](_0x326d('0xd'),auth['isAuthenticated'](),controller[_0x326d('0xe')]);router[_0x326d('0xf')]('/',auth[_0x326d('0x9')](),controller[_0x326d('0x10')]);router[_0x326d('0x11')](_0x326d('0xb'),auth[_0x326d('0x9')](),controller[_0x326d('0x12')]);router['delete'](_0x326d('0xb'),auth['isAuthenticated'](),controller[_0x326d('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8b3f=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x64a7d4,_0x1b3520){var _0x537e7b=function(_0x245150){while(--_0x245150){_0x64a7d4['push'](_0x64a7d4['shift']());}};_0x537e7b(++_0x1b3520);}(_0x8b3f,0x1b9));var _0xf8b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b3f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf8b3('0x0'));var path=require(_0xf8b3('0x1'));var timeout=require(_0xf8b3('0x2'));var express=require(_0xf8b3('0x3'));var router=express[_0xf8b3('0x4')]();var fs_extra=require(_0xf8b3('0x5'));var auth=require(_0xf8b3('0x6'));var interaction=require(_0xf8b3('0x7'));var config=require(_0xf8b3('0x8'));var controller=require(_0xf8b3('0x9'));router[_0xf8b3('0xa')]('/',auth[_0xf8b3('0xb')](),controller[_0xf8b3('0xc')]);router[_0xf8b3('0xa')](_0xf8b3('0xd'),auth['isAuthenticated'](),controller[_0xf8b3('0xe')]);router[_0xf8b3('0xa')]('/:id/download',auth[_0xf8b3('0xb')](),controller['download']);router[_0xf8b3('0xf')]('/',auth[_0xf8b3('0xb')](),controller[_0xf8b3('0x10')]);router['put'](_0xf8b3('0xd'),auth[_0xf8b3('0xb')](),controller[_0xf8b3('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf8b3('0x12')]);module[_0xf8b3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 81c27ae..ab2f6bb 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 _0xe19d=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','STRING','long','TIMESTAMP','literal'];(function(_0x38e47a,_0xc032eb){var _0x1b0649=function(_0x392ba2){while(--_0x392ba2){_0x38e47a['push'](_0x38e47a['shift']());}};_0x1b0649(++_0xc032eb);}(_0xe19d,0x7f));var _0xde19=function(_0x1f42bc,_0x208463){_0x1f42bc=_0x1f42bc-0x0;var _0x23f159=_0xe19d[_0x1f42bc];return _0x23f159;};'use strict';var Sequelize=require(_0xde19('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x18884d){return this[_0xde19('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xde19('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0xde19('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xde19('0x4'),'defaultValue':Sequelize[_0xde19('0x5')](_0xde19('0x6'))}}; \ No newline at end of file +var _0xb94d=['long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb94d,0x16b));var _0xdb94=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xb94d[_0x296897];return _0x2b44ab;};'use strict';var Sequelize=require(_0xdb94('0x0'));module[_0xdb94('0x1')]={'name':{'type':Sequelize[_0xdb94('0x2')],'get':function(_0x526cba){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xdb94('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xdb94('0x5')](_0xdb94('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xdb94('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xdb94('0x7')](_0xdb94('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5d169eb..bf0392f 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 _0x652c=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','create','catch','body','params','download','recording','ValidationError','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','VoiceMailMessage','rawAttributes','fieldName','type','differenceBy','map','keys','filters','intersection','model','query','attributes','fields'];(function(_0x457045,_0x3faa6f){var _0xb8cc8e=function(_0xe691dc){while(--_0xe691dc){_0x457045['push'](_0x457045['shift']());}};_0xb8cc8e(++_0x3faa6f);}(_0x652c,0xc9));var _0xc652=function(_0x4c0c83,_0xde3b2e){_0x4c0c83=_0x4c0c83-0x0;var _0x2d72c0=_0x652c[_0x4c0c83];return _0x2d72c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc652('0x0'));var zipdir=require(_0xc652('0x1'));var jsonpatch=require(_0xc652('0x2'));var rp=require(_0xc652('0x3'));var moment=require(_0xc652('0x4'));var BPromise=require(_0xc652('0x5'));var Mustache=require('mustache');var util=require(_0xc652('0x6'));var path=require(_0xc652('0x7'));var sox=require(_0xc652('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc652('0x9'));var _=require(_0xc652('0xa'));var squel=require(_0xc652('0xb'));var crypto=require(_0xc652('0xc'));var jsforce=require(_0xc652('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc652('0xe'));var querystring=require(_0xc652('0xf'));var Papa=require(_0xc652('0x10'));var Redis=require(_0xc652('0x11'));var authService=require(_0xc652('0x12'));var qs=require(_0xc652('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc652('0x14'));var logger=require(_0xc652('0x15'))(_0xc652('0x16'));var utils=require(_0xc652('0x17'));var config=require(_0xc652('0x18'));var licenseUtil=require(_0xc652('0x19'));var db=require(_0xc652('0x1a'))['db'];function respondWithStatusCode(_0x1cc3ed,_0x34d51f){_0x34d51f=_0x34d51f||0xcc;return function(_0x5c104f){if(_0x5c104f){return _0x1cc3ed[_0xc652('0x1b')](_0x34d51f);}return _0x1cc3ed['status'](_0x34d51f)[_0xc652('0x1c')]();};}function respondWithResult(_0x32dacf,_0x4caafc){_0x4caafc=_0x4caafc||0xc8;return function(_0x2ace0d){if(_0x2ace0d){return _0x32dacf[_0xc652('0x1d')](_0x4caafc)[_0xc652('0x1e')](_0x2ace0d);}};}function respondWithFilteredResult(_0xd40039,_0x4e35d6){return function(_0x5bc8ca){if(_0x5bc8ca){var _0x12998b=typeof _0x4e35d6[_0xc652('0x1f')]===_0xc652('0x20')&&typeof _0x4e35d6['limit']===_0xc652('0x20');var _0xc7317c=_0x5bc8ca[_0xc652('0x21')];var _0x12fc0e=_0x12998b?0x0:_0x4e35d6[_0xc652('0x1f')];var _0x36eeaf=_0x12998b?_0x5bc8ca['count']:_0x4e35d6['offset']+_0x4e35d6[_0xc652('0x22')];var _0x1aece8;if(_0x36eeaf>=_0xc7317c){_0x36eeaf=_0xc7317c;_0x1aece8=0xc8;}else{_0x1aece8=0xce;}_0xd40039['status'](_0x1aece8);return _0xd40039[_0xc652('0x23')](_0xc652('0x24'),_0x12fc0e+'-'+_0x36eeaf+'/'+_0xc7317c)[_0xc652('0x1e')](_0x5bc8ca);}return null;};}function patchUpdates(_0x5226fc){return function(_0x59445f){try{jsonpatch[_0xc652('0x25')](_0x59445f,_0x5226fc,!![]);}catch(_0x4cb093){return BPromise[_0xc652('0x26')](_0x4cb093);}return _0x59445f[_0xc652('0x27')]();};}function saveUpdates(_0x49c3e6,_0x52b478){return function(_0x4d2940){if(_0x4d2940){return _0x4d2940['update'](_0x49c3e6)[_0xc652('0x28')](function(_0x55fd51){return _0x55fd51;});}return null;};}function removeEntity(_0x54803e,_0x14e568){return function(_0x2dfab7){if(_0x2dfab7){return _0x2dfab7['destroy']()[_0xc652('0x28')](function(){_0x54803e[_0xc652('0x1d')](0xcc)[_0xc652('0x1c')]();});}};}function handleEntityNotFound(_0x3db1dd,_0x504ffb){return function(_0xc98352){if(!_0xc98352){_0x3db1dd[_0xc652('0x1b')](0x194);}return _0xc98352;};}function handleError(_0x305efc,_0x4a94d5){_0x4a94d5=_0x4a94d5||0x1f4;return function(_0x58566d){logger[_0xc652('0x29')](_0x58566d['stack']);if(_0x58566d[_0xc652('0x2a')]){delete _0x58566d[_0xc652('0x2a')];}_0x305efc[_0xc652('0x1d')](_0x4a94d5)['send'](_0x58566d);};}exports[_0xc652('0x2b')]=function(_0x48fa6c,_0x348e53){var _0xf1fc3f={},_0x457720={},_0x51705e={'count':0x0,'rows':[]};var _0x2f6f78=_['map'](db[_0xc652('0x2c')][_0xc652('0x2d')],function(_0x1f8c8b){return{'name':_0x1f8c8b[_0xc652('0x2e')],'type':_0x1f8c8b[_0xc652('0x2f')]['key']};});_0x457720['model']=_[_0xc652('0x30')](_[_0xc652('0x31')](_0x2f6f78,_0xc652('0x2a')),[_0xc652('0x2a')]);_0x457720['query']=_[_0xc652('0x32')](_0x48fa6c['query']);_0x457720[_0xc652('0x33')]=_[_0xc652('0x34')](_0x457720[_0xc652('0x35')],_0x457720[_0xc652('0x36')]);_0xf1fc3f[_0xc652('0x37')]=_[_0xc652('0x34')](_0x457720[_0xc652('0x35')],qs[_0xc652('0x38')](_0x48fa6c[_0xc652('0x36')][_0xc652('0x38')]));_0xf1fc3f[_0xc652('0x37')]=_0xf1fc3f[_0xc652('0x37')][_0xc652('0x39')]?_0xf1fc3f[_0xc652('0x37')]:_0x457720[_0xc652('0x35')];if(!_0x48fa6c[_0xc652('0x36')][_0xc652('0x3a')](_0xc652('0x3b'))){_0xf1fc3f[_0xc652('0x22')]=qs['limit'](_0x48fa6c[_0xc652('0x36')][_0xc652('0x22')]);_0xf1fc3f[_0xc652('0x1f')]=qs['offset'](_0x48fa6c[_0xc652('0x36')][_0xc652('0x1f')]);}_0xf1fc3f[_0xc652('0x3c')]=qs['sort'](_0x48fa6c[_0xc652('0x36')][_0xc652('0x3d')]);_0xf1fc3f[_0xc652('0x3e')]=qs[_0xc652('0x33')](_[_0xc652('0x3f')](_0x48fa6c[_0xc652('0x36')],_0x457720[_0xc652('0x33')]),_0x2f6f78);if(_0x48fa6c['query'][_0xc652('0x40')]){_0xf1fc3f[_0xc652('0x3e')]=_[_0xc652('0x41')](_0xf1fc3f[_0xc652('0x3e')],{'$or':_[_0xc652('0x31')](_0x2f6f78,function(_0x1f8007){if(_0x1f8007[_0xc652('0x2f')]!=='VIRTUAL'){var _0x3d81bf={};_0x3d81bf[_0x1f8007[_0xc652('0x2a')]]={'$like':'%'+_0x48fa6c[_0xc652('0x36')]['filter']+'%'};return _0x3d81bf;}})});}_0xf1fc3f=_['merge']({},_0xf1fc3f,_0x48fa6c[_0xc652('0x42')]);var _0x467e75={'where':_0xf1fc3f[_0xc652('0x3e')]};return db[_0xc652('0x2c')][_0xc652('0x21')](_0x467e75)[_0xc652('0x28')](function(_0x388162){_0x51705e[_0xc652('0x21')]=_0x388162;if(_0x48fa6c[_0xc652('0x36')][_0xc652('0x43')]){_0xf1fc3f[_0xc652('0x44')]=[{'all':!![]}];}return db[_0xc652('0x2c')][_0xc652('0x45')](_0xf1fc3f);})[_0xc652('0x28')](function(_0x11d850){_0x51705e[_0xc652('0x46')]=_0x11d850;return _0x51705e;})[_0xc652('0x28')](respondWithFilteredResult(_0x348e53,_0xf1fc3f))['catch'](handleError(_0x348e53,null));};exports[_0xc652('0x47')]=function(_0x362d0a,_0x2cff24){var _0x3d4563={'raw':!![],'where':{'id':_0x362d0a['params']['id']}},_0x416eb0={};_0x416eb0['model']=_[_0xc652('0x32')](db[_0xc652('0x2c')][_0xc652('0x2d')]);_0x416eb0[_0xc652('0x36')]=_[_0xc652('0x32')](_0x362d0a[_0xc652('0x36')]);_0x416eb0[_0xc652('0x33')]=_[_0xc652('0x34')](_0x416eb0[_0xc652('0x35')],_0x416eb0[_0xc652('0x36')]);_0x3d4563[_0xc652('0x37')]=_['intersection'](_0x416eb0[_0xc652('0x35')],qs['fields'](_0x362d0a[_0xc652('0x36')][_0xc652('0x38')]));_0x3d4563[_0xc652('0x37')]=_0x3d4563[_0xc652('0x37')][_0xc652('0x39')]?_0x3d4563['attributes']:_0x416eb0[_0xc652('0x35')];if(_0x362d0a[_0xc652('0x36')][_0xc652('0x43')]){_0x3d4563[_0xc652('0x44')]=[{'all':!![]}];}_0x3d4563=_[_0xc652('0x41')]({},_0x3d4563,_0x362d0a[_0xc652('0x42')]);return db[_0xc652('0x2c')][_0xc652('0x48')](_0x3d4563)['then'](handleEntityNotFound(_0x2cff24,null))[_0xc652('0x28')](respondWithResult(_0x2cff24,null))['catch'](handleError(_0x2cff24,null));};exports[_0xc652('0x49')]=function(_0x4b7507,_0x4ba9e0){return db[_0xc652('0x2c')][_0xc652('0x49')](_0x4b7507['body'],{})[_0xc652('0x28')](respondWithResult(_0x4ba9e0,0xc9))[_0xc652('0x4a')](handleError(_0x4ba9e0,null));};exports['update']=function(_0x17db3b,_0x1632d2){if(_0x17db3b['body']['id']){delete _0x17db3b[_0xc652('0x4b')]['id'];}return db[_0xc652('0x2c')][_0xc652('0x48')]({'where':{'id':_0x17db3b[_0xc652('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1632d2,null))['then'](saveUpdates(_0x17db3b[_0xc652('0x4b')],null))[_0xc652('0x28')](respondWithResult(_0x1632d2,null))[_0xc652('0x4a')](handleError(_0x1632d2,null));};exports['destroy']=function(_0x261c40,_0x5b74c0){return db[_0xc652('0x2c')]['find']({'where':{'id':_0x261c40['params']['id']}})[_0xc652('0x28')](handleEntityNotFound(_0x5b74c0,null))[_0xc652('0x28')](removeEntity(_0x5b74c0,null))[_0xc652('0x4a')](handleError(_0x5b74c0,null));};exports[_0xc652('0x4d')]=function(_0x14f300,_0x7159d9,_0x251ab4){return db[_0xc652('0x2c')]['find']({'where':{'id':_0x14f300['params']['id']},'attributes':['id',_0xc652('0x4e'),'msg_id']})[_0xc652('0x28')](handleEntityNotFound(_0x7159d9,null))['then'](function(_0x2c9f9d){if(_0x2c9f9d){if(!_0x2c9f9d[_0xc652('0x4e')]){throw new db['Sequelize'][(_0xc652('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x257da9={'Content-Type':'audio/wav','Content-Disposition':_0xc652('0x50')};if(_0x2c9f9d[_0xc652('0x51')]){_0x257da9[_0xc652('0x52')]=_0xc652('0x53')+_0x2c9f9d['msg_id']+_0xc652('0x54');}_0x7159d9[_0xc652('0x23')](_0x257da9);return _0x7159d9[_0xc652('0x55')](new Buffer(_0x2c9f9d['recording']));}})[_0xc652('0x4a')](handleError(_0x7159d9,null));}; \ No newline at end of file +var _0xc3e3=['rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','include','create','catch','body','params','find','download','Sequelize','ValidationError','msg_id','Content-Disposition','attachment;\x20filename=\x22','recording','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','VoiceMailMessage'];(function(_0x29a134,_0x194c27){var _0x136398=function(_0x1def82){while(--_0x1def82){_0x29a134['push'](_0x29a134['shift']());}};_0x136398(++_0x194c27);}(_0xc3e3,0x11f));var _0x3c3e=function(_0x5b5ed5,_0x5ea1c0){_0x5b5ed5=_0x5b5ed5-0x0;var _0x448ea9=_0xc3e3[_0x5b5ed5];return _0x448ea9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c3e('0x0'));var zipdir=require(_0x3c3e('0x1'));var jsonpatch=require(_0x3c3e('0x2'));var rp=require(_0x3c3e('0x3'));var moment=require(_0x3c3e('0x4'));var BPromise=require(_0x3c3e('0x5'));var Mustache=require(_0x3c3e('0x6'));var util=require('util');var path=require(_0x3c3e('0x7'));var sox=require('sox');var csv=require(_0x3c3e('0x8'));var ejs=require(_0x3c3e('0x9'));var fs=require('fs');var fs_extra=require(_0x3c3e('0xa'));var _=require(_0x3c3e('0xb'));var squel=require('squel');var crypto=require(_0x3c3e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3c3e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c3e('0xe'));var Redis=require(_0x3c3e('0xf'));var authService=require(_0x3c3e('0x10'));var qs=require(_0x3c3e('0x11'));var as=require(_0x3c3e('0x12'));var hardwareService=require(_0x3c3e('0x13'));var logger=require(_0x3c3e('0x14'))('api');var utils=require(_0x3c3e('0x15'));var config=require(_0x3c3e('0x16'));var licenseUtil=require(_0x3c3e('0x17'));var db=require(_0x3c3e('0x18'))['db'];function respondWithStatusCode(_0xb4c533,_0x170f6a){_0x170f6a=_0x170f6a||0xcc;return function(_0x2d7154){if(_0x2d7154){return _0xb4c533[_0x3c3e('0x19')](_0x170f6a);}return _0xb4c533[_0x3c3e('0x1a')](_0x170f6a)['end']();};}function respondWithResult(_0x49a75f,_0x450bb8){_0x450bb8=_0x450bb8||0xc8;return function(_0xe144f8){if(_0xe144f8){return _0x49a75f[_0x3c3e('0x1a')](_0x450bb8)['json'](_0xe144f8);}};}function respondWithFilteredResult(_0x23a9d6,_0x2db94f){return function(_0x13083a){if(_0x13083a){var _0x31daa1=typeof _0x2db94f[_0x3c3e('0x1b')]===_0x3c3e('0x1c')&&typeof _0x2db94f[_0x3c3e('0x1d')]===_0x3c3e('0x1c');var _0xe02025=_0x13083a[_0x3c3e('0x1e')];var _0x286c68=_0x31daa1?0x0:_0x2db94f[_0x3c3e('0x1b')];var _0x46bc96=_0x31daa1?_0x13083a[_0x3c3e('0x1e')]:_0x2db94f[_0x3c3e('0x1b')]+_0x2db94f['limit'];var _0x5aeb7b;if(_0x46bc96>=_0xe02025){_0x46bc96=_0xe02025;_0x5aeb7b=0xc8;}else{_0x5aeb7b=0xce;}_0x23a9d6[_0x3c3e('0x1a')](_0x5aeb7b);return _0x23a9d6[_0x3c3e('0x1f')](_0x3c3e('0x20'),_0x286c68+'-'+_0x46bc96+'/'+_0xe02025)[_0x3c3e('0x21')](_0x13083a);}return null;};}function patchUpdates(_0x4f54a5){return function(_0x5341f6){try{jsonpatch[_0x3c3e('0x22')](_0x5341f6,_0x4f54a5,!![]);}catch(_0x24aa9f){return BPromise[_0x3c3e('0x23')](_0x24aa9f);}return _0x5341f6['save']();};}function saveUpdates(_0x4cf066,_0x5a69c4){return function(_0x3ac934){if(_0x3ac934){return _0x3ac934[_0x3c3e('0x24')](_0x4cf066)[_0x3c3e('0x25')](function(_0x155b09){return _0x155b09;});}return null;};}function removeEntity(_0x250276,_0x401a12){return function(_0x2e2002){if(_0x2e2002){return _0x2e2002[_0x3c3e('0x26')]()[_0x3c3e('0x25')](function(){_0x250276['status'](0xcc)[_0x3c3e('0x27')]();});}};}function handleEntityNotFound(_0x2b6941,_0x288ff6){return function(_0x2f34c6){if(!_0x2f34c6){_0x2b6941['sendStatus'](0x194);}return _0x2f34c6;};}function handleError(_0x2c39be,_0x3bf531){_0x3bf531=_0x3bf531||0x1f4;return function(_0x313ff4){logger[_0x3c3e('0x28')](_0x313ff4[_0x3c3e('0x29')]);if(_0x313ff4[_0x3c3e('0x2a')]){delete _0x313ff4['name'];}_0x2c39be[_0x3c3e('0x1a')](_0x3bf531)[_0x3c3e('0x2b')](_0x313ff4);};}exports['index']=function(_0x218a1b,_0x2f8c58){var _0x25e97e={},_0x146fc1={},_0x29c953={'count':0x0,'rows':[]};var _0x1ba426=_['map'](db[_0x3c3e('0x2c')][_0x3c3e('0x2d')],function(_0x5afc2a){return{'name':_0x5afc2a[_0x3c3e('0x2e')],'type':_0x5afc2a[_0x3c3e('0x2f')][_0x3c3e('0x30')]};});_0x146fc1[_0x3c3e('0x31')]=_[_0x3c3e('0x32')](_[_0x3c3e('0x33')](_0x1ba426,_0x3c3e('0x2a')),[_0x3c3e('0x2a')]);_0x146fc1[_0x3c3e('0x34')]=_[_0x3c3e('0x35')](_0x218a1b['query']);_0x146fc1[_0x3c3e('0x36')]=_[_0x3c3e('0x37')](_0x146fc1[_0x3c3e('0x31')],_0x146fc1[_0x3c3e('0x34')]);_0x25e97e['attributes']=_['intersection'](_0x146fc1[_0x3c3e('0x31')],qs[_0x3c3e('0x38')](_0x218a1b[_0x3c3e('0x34')][_0x3c3e('0x38')]));_0x25e97e[_0x3c3e('0x39')]=_0x25e97e[_0x3c3e('0x39')][_0x3c3e('0x3a')]?_0x25e97e[_0x3c3e('0x39')]:_0x146fc1[_0x3c3e('0x31')];if(!_0x218a1b[_0x3c3e('0x34')][_0x3c3e('0x3b')]('nolimit')){_0x25e97e[_0x3c3e('0x1d')]=qs['limit'](_0x218a1b[_0x3c3e('0x34')]['limit']);_0x25e97e[_0x3c3e('0x1b')]=qs[_0x3c3e('0x1b')](_0x218a1b[_0x3c3e('0x34')][_0x3c3e('0x1b')]);}_0x25e97e[_0x3c3e('0x3c')]=qs['sort'](_0x218a1b[_0x3c3e('0x34')][_0x3c3e('0x3d')]);_0x25e97e[_0x3c3e('0x3e')]=qs[_0x3c3e('0x36')](_[_0x3c3e('0x3f')](_0x218a1b[_0x3c3e('0x34')],_0x146fc1['filters']),_0x1ba426);if(_0x218a1b['query'][_0x3c3e('0x40')]){_0x25e97e[_0x3c3e('0x3e')]=_[_0x3c3e('0x41')](_0x25e97e['where'],{'$or':_[_0x3c3e('0x33')](_0x1ba426,function(_0x3e5cda){if(_0x3e5cda[_0x3c3e('0x2f')]!==_0x3c3e('0x42')){var _0x1dc13a={};_0x1dc13a[_0x3e5cda[_0x3c3e('0x2a')]]={'$like':'%'+_0x218a1b[_0x3c3e('0x34')]['filter']+'%'};return _0x1dc13a;}})});}_0x25e97e=_['merge']({},_0x25e97e,_0x218a1b['options']);var _0x5a540b={'where':_0x25e97e['where']};return db['VoiceMailMessage'][_0x3c3e('0x1e')](_0x5a540b)[_0x3c3e('0x25')](function(_0x3dd5cc){_0x29c953[_0x3c3e('0x1e')]=_0x3dd5cc;if(_0x218a1b[_0x3c3e('0x34')][_0x3c3e('0x43')]){_0x25e97e['include']=[{'all':!![]}];}return db[_0x3c3e('0x2c')][_0x3c3e('0x44')](_0x25e97e);})[_0x3c3e('0x25')](function(_0x146687){_0x29c953['rows']=_0x146687;return _0x29c953;})['then'](respondWithFilteredResult(_0x2f8c58,_0x25e97e))['catch'](handleError(_0x2f8c58,null));};exports[_0x3c3e('0x45')]=function(_0x388ab2,_0x45dd5c){var _0x2ff290={'raw':!![],'where':{'id':_0x388ab2['params']['id']}},_0x30c2f3={};_0x30c2f3[_0x3c3e('0x31')]=_[_0x3c3e('0x35')](db[_0x3c3e('0x2c')]['rawAttributes']);_0x30c2f3['query']=_[_0x3c3e('0x35')](_0x388ab2[_0x3c3e('0x34')]);_0x30c2f3[_0x3c3e('0x36')]=_['intersection'](_0x30c2f3[_0x3c3e('0x31')],_0x30c2f3[_0x3c3e('0x34')]);_0x2ff290[_0x3c3e('0x39')]=_['intersection'](_0x30c2f3['model'],qs[_0x3c3e('0x38')](_0x388ab2[_0x3c3e('0x34')][_0x3c3e('0x38')]));_0x2ff290[_0x3c3e('0x39')]=_0x2ff290[_0x3c3e('0x39')][_0x3c3e('0x3a')]?_0x2ff290['attributes']:_0x30c2f3[_0x3c3e('0x31')];if(_0x388ab2[_0x3c3e('0x34')][_0x3c3e('0x43')]){_0x2ff290[_0x3c3e('0x46')]=[{'all':!![]}];}_0x2ff290=_[_0x3c3e('0x41')]({},_0x2ff290,_0x388ab2['options']);return db['VoiceMailMessage']['find'](_0x2ff290)[_0x3c3e('0x25')](handleEntityNotFound(_0x45dd5c,null))['then'](respondWithResult(_0x45dd5c,null))['catch'](handleError(_0x45dd5c,null));};exports[_0x3c3e('0x47')]=function(_0x5f93a7,_0x307ba6){return db[_0x3c3e('0x2c')][_0x3c3e('0x47')](_0x5f93a7['body'],{})[_0x3c3e('0x25')](respondWithResult(_0x307ba6,0xc9))[_0x3c3e('0x48')](handleError(_0x307ba6,null));};exports[_0x3c3e('0x24')]=function(_0x4f071d,_0x5bc5d4){if(_0x4f071d[_0x3c3e('0x49')]['id']){delete _0x4f071d[_0x3c3e('0x49')]['id'];}return db[_0x3c3e('0x2c')]['find']({'where':{'id':_0x4f071d[_0x3c3e('0x4a')]['id']}})[_0x3c3e('0x25')](handleEntityNotFound(_0x5bc5d4,null))['then'](saveUpdates(_0x4f071d[_0x3c3e('0x49')],null))[_0x3c3e('0x25')](respondWithResult(_0x5bc5d4,null))[_0x3c3e('0x48')](handleError(_0x5bc5d4,null));};exports[_0x3c3e('0x26')]=function(_0x4b7543,_0x4624ec){return db[_0x3c3e('0x2c')][_0x3c3e('0x4b')]({'where':{'id':_0x4b7543[_0x3c3e('0x4a')]['id']}})[_0x3c3e('0x25')](handleEntityNotFound(_0x4624ec,null))['then'](removeEntity(_0x4624ec,null))[_0x3c3e('0x48')](handleError(_0x4624ec,null));};exports[_0x3c3e('0x4c')]=function(_0x4c37ea,_0x161f75,_0x1b9799){return db[_0x3c3e('0x2c')][_0x3c3e('0x4b')]({'where':{'id':_0x4c37ea[_0x3c3e('0x4a')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x161f75,null))['then'](function(_0x443824){if(_0x443824){if(!_0x443824['recording']){throw new db[(_0x3c3e('0x4d'))][(_0x3c3e('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0xfedde={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x443824[_0x3c3e('0x4f')]){_0xfedde[_0x3c3e('0x50')]=_0x3c3e('0x51')+_0x443824['msg_id']+'.wav\x22';}_0x161f75['set'](_0xfedde);return _0x161f75[_0x3c3e('0x2b')](new Buffer(_0x443824[_0x3c3e('0x52')]));}})[_0x3c3e('0x48')](handleError(_0x161f75,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index d107a4f..24642dd 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 _0xd99c=['rimraf','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0xd99c,0x163));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd99('0x0'));var util=require('util');var logger=require(_0xcd99('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcd99('0x2'));var rp=require(_0xcd99('0x3'));var fs=require('fs');var path=require(_0xcd99('0x4'));var rimraf=require(_0xcd99('0x5'));var config=require(_0xcd99('0x6'));var attributes=require(_0xcd99('0x7'));module['exports']=function(_0x5e8d88,_0x5f1b6f){return _0x5e8d88['define'](_0xcd99('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xc3f6=['../../config/logger','moment','bluebird','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','util'];(function(_0x26ce6f,_0x8e23c3){var _0x436b87=function(_0x253090){while(--_0x253090){_0x26ce6f['push'](_0x26ce6f['shift']());}};_0x436b87(++_0x8e23c3);}(_0xc3f6,0x1a5));var _0x6c3f=function(_0x5d58d7,_0x3e6c73){_0x5d58d7=_0x5d58d7-0x0;var _0x465cdc=_0xc3f6[_0x5d58d7];return _0x465cdc;};'use strict';var _=require(_0x6c3f('0x0'));var util=require(_0x6c3f('0x1'));var logger=require(_0x6c3f('0x2'))('api');var moment=require(_0x6c3f('0x3'));var BPromise=require(_0x6c3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c3f('0x5'));module[_0x6c3f('0x6')]=function(_0x3a0d18,_0x19162c){return _0x3a0d18['define']('VoiceMailMessage',attributes,{'tableName':_0x6c3f('0x7'),'paranoid':![],'indexes':[{'name':_0x6c3f('0x8'),'fields':[_0x6c3f('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5bf3e13..169b49d 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 _0x1502=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4cd846,_0x4a0f50){var _0x2f2a7d=function(_0x106507){while(--_0x106507){_0x4cd846['push'](_0x4cd846['shift']());}};_0x2f2a7d(++_0x4a0f50);}(_0x1502,0x1bb));var _0x2150=function(_0x2d1b5f,_0x5712b4){_0x2d1b5f=_0x2d1b5f-0x0;var _0x58c40e=_0x1502[_0x2d1b5f];return _0x58c40e;};'use strict';var _=require('lodash');var util=require(_0x2150('0x0'));var moment=require(_0x2150('0x1'));var BPromise=require('bluebird');var rs=require(_0x2150('0x2'));var fs=require('fs');var Redis=require(_0x2150('0x3'));var db=require(_0x2150('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2150('0x5'));var config=require(_0x2150('0x6'));var jayson=require(_0x2150('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x282296,_0x3c9dfd,_0x6d80e2){return new BPromise(function(_0x269992,_0x204ab5){return client[_0x2150('0x8')](_0x282296,_0x6d80e2)['then'](function(_0x287417){logger[_0x2150('0x9')](_0x2150('0xa'),_0x3c9dfd,_0x2150('0xb'));logger['debug'](_0x2150('0xc'),_0x3c9dfd,_0x2150('0xb'),JSON[_0x2150('0xd')](_0x287417));if(_0x287417[_0x2150('0xe')]){if(_0x287417[_0x2150('0xe')][_0x2150('0xf')]===0x1f4){logger['error'](_0x2150('0xa'),_0x3c9dfd,_0x287417['error'][_0x2150('0x10')]);return _0x204ab5(_0x287417[_0x2150('0xe')][_0x2150('0x10')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3c9dfd,_0x287417[_0x2150('0xe')]['message']);return _0x269992(_0x287417[_0x2150('0xe')][_0x2150('0x10')]);}else{logger[_0x2150('0x9')](_0x2150('0xa'),_0x3c9dfd,_0x2150('0xb'));_0x269992(_0x287417[_0x2150('0x11')][_0x2150('0x10')]);}})[_0x2150('0x12')](function(_0x5b0171){logger['error'](_0x2150('0xa'),_0x3c9dfd,_0x5b0171);_0x204ab5(_0x5b0171);});});} \ No newline at end of file +var _0x70a2=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x38cce4,_0x41ef17){var _0x1611c0=function(_0x2c6213){while(--_0x2c6213){_0x38cce4['push'](_0x38cce4['shift']());}};_0x1611c0(++_0x41ef17);}(_0x70a2,0x9b));var _0x270a=function(_0x323430,_0x3d2b6d){_0x323430=_0x323430-0x0;var _0x9eecd1=_0x70a2[_0x323430];return _0x9eecd1;};'use strict';var _=require(_0x270a('0x0'));var util=require(_0x270a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x270a('0x2'));var fs=require('fs');var Redis=require(_0x270a('0x3'));var db=require(_0x270a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x270a('0x5'))('rpc');var config=require(_0x270a('0x6'));var jayson=require(_0x270a('0x7'));var client=jayson[_0x270a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7c7a32,_0xb7015,_0xc9e8e7){return new BPromise(function(_0x580ec5,_0x13cc48){return client[_0x270a('0x9')](_0x7c7a32,_0xc9e8e7)[_0x270a('0xa')](function(_0x42559c){logger[_0x270a('0xb')](_0x270a('0xc'),_0xb7015,_0x270a('0xd'));logger[_0x270a('0xe')](_0x270a('0xf'),_0xb7015,_0x270a('0xd'),JSON[_0x270a('0x10')](_0x42559c));if(_0x42559c[_0x270a('0x11')]){if(_0x42559c[_0x270a('0x11')][_0x270a('0x12')]===0x1f4){logger[_0x270a('0x11')](_0x270a('0xc'),_0xb7015,_0x42559c[_0x270a('0x11')][_0x270a('0x13')]);return _0x13cc48(_0x42559c[_0x270a('0x11')][_0x270a('0x13')]);}logger[_0x270a('0x11')](_0x270a('0xc'),_0xb7015,_0x42559c[_0x270a('0x11')][_0x270a('0x13')]);return _0x580ec5(_0x42559c[_0x270a('0x11')][_0x270a('0x13')]);}else{logger[_0x270a('0xb')](_0x270a('0xc'),_0xb7015,_0x270a('0xd'));_0x580ec5(_0x42559c['result']['message']);}})['catch'](function(_0x4c3512){logger[_0x270a('0x11')](_0x270a('0xc'),_0xb7015,_0x4c3512);_0x13cc48(_0x4c3512);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c97f15f..79554d8 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 _0xf368=['./voiceMusicOnHold.controller','get','/:id','show','/:id/sounds','getSounds','post','isAuthenticated','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0xd12fa8,_0x968639){var _0x56d8e7=function(_0x11cee4){while(--_0x11cee4){_0xd12fa8['push'](_0xd12fa8['shift']());}};_0x56d8e7(++_0x968639);}(_0xf368,0x125));var _0x8f36=function(_0x5cc35c,_0x4ba950){_0x5cc35c=_0x5cc35c-0x0;var _0x51d93d=_0xf368[_0x5cc35c];return _0x51d93d;};'use strict';var multer=require(_0x8f36('0x0'));var util=require(_0x8f36('0x1'));var path=require(_0x8f36('0x2'));var timeout=require(_0x8f36('0x3'));var express=require(_0x8f36('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8f36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8f36('0x6'));var controller=require(_0x8f36('0x7'));router[_0x8f36('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f36('0x9'),auth['isAuthenticated'](),controller[_0x8f36('0xa')]);router[_0x8f36('0x8')](_0x8f36('0xb'),auth['isAuthenticated'](),controller[_0x8f36('0xc')]);router[_0x8f36('0xd')]('/',auth[_0x8f36('0xe')](),controller['create']);router[_0x8f36('0xd')]('/:id/sounds',auth[_0x8f36('0xe')](),controller['addSound']);router['put'](_0x8f36('0x9'),auth[_0x8f36('0xe')](),controller[_0x8f36('0xf')]);router[_0x8f36('0x10')]('/:id',auth[_0x8f36('0xe')](),controller['destroy']);router[_0x8f36('0x10')](_0x8f36('0x11'),auth['isAuthenticated'](),controller[_0x8f36('0x12')]);module[_0x8f36('0x13')]=router; \ No newline at end of file +var _0xb137=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','destroy','delete','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ec801,_0x2bb02d){var _0x1796f9=function(_0xd24952){while(--_0xd24952){_0x2ec801['push'](_0x2ec801['shift']());}};_0x1796f9(++_0x2bb02d);}(_0xb137,0x124));var _0x7b13=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xb137[_0x1678c8];return _0x387aa9;};'use strict';var multer=require(_0x7b13('0x0'));var util=require(_0x7b13('0x1'));var path=require(_0x7b13('0x2'));var timeout=require(_0x7b13('0x3'));var express=require(_0x7b13('0x4'));var router=express['Router']();var fs_extra=require(_0x7b13('0x5'));var auth=require(_0x7b13('0x6'));var interaction=require(_0x7b13('0x7'));var config=require(_0x7b13('0x8'));var controller=require(_0x7b13('0x9'));router[_0x7b13('0xa')]('/',auth[_0x7b13('0xb')](),controller[_0x7b13('0xc')]);router[_0x7b13('0xa')](_0x7b13('0xd'),auth[_0x7b13('0xb')](),controller[_0x7b13('0xe')]);router['get'](_0x7b13('0xf'),auth[_0x7b13('0xb')](),controller[_0x7b13('0x10')]);router[_0x7b13('0x11')]('/',auth[_0x7b13('0xb')](),controller[_0x7b13('0x12')]);router['post'](_0x7b13('0xf'),auth[_0x7b13('0xb')](),controller[_0x7b13('0x13')]);router['put'](_0x7b13('0xd'),auth[_0x7b13('0xb')](),controller[_0x7b13('0x14')]);router['delete'](_0x7b13('0xd'),auth[_0x7b13('0xb')](),controller[_0x7b13('0x15')]);router[_0x7b13('0x16')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x7b13('0x17')]);module[_0x7b13('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 7012afa..942543b 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 _0x3032=['exports','STRING','custom','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0xb28ffb,_0xb018c3){var _0x2fba78=function(_0x560454){while(--_0x560454){_0xb28ffb['push'](_0xb28ffb['shift']());}};_0x2fba78(++_0xb018c3);}(_0x3032,0x77));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2303('0x0'));module[_0x2303('0x1')]={'name':{'type':Sequelize[_0x2303('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x2303('0x3'),'files',_0x2303('0x4'),_0x2303('0x5'),'quietmp3',_0x2303('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x2303('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x2303('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2303('0x2')],'allowNull':!![],'defaultValue':_0x2303('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x2303('0x8')},'defaultEntry':{'type':Sequelize[_0x2303('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6225=['ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name'];(function(_0x13deff,_0x4db4cb){var _0xa45882=function(_0x576eaf){while(--_0x576eaf){_0x13deff['push'](_0x13deff['shift']());}};_0xa45882(++_0x4db4cb);}(_0x6225,0xc9));var _0x5622=function(_0x2f0f28,_0x37df9c){_0x2f0f28=_0x2f0f28-0x0;var _0x13b38e=_0x6225[_0x2f0f28];return _0x13b38e;};'use strict';var Sequelize=require('sequelize');module[_0x5622('0x0')]={'name':{'type':Sequelize[_0x5622('0x1')],'allowNull':![],'unique':_0x5622('0x2')},'mode':{'type':Sequelize[_0x5622('0x3')](_0x5622('0x4'),_0x5622('0x5'),_0x5622('0x6'),_0x5622('0x7'),'quietmp3',_0x5622('0x8')),'allowNull':!![],'defaultValue':_0x5622('0x5')},'directory':{'type':Sequelize[_0x5622('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x5622('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x5622('0x1')],'allowNull':!![],'defaultValue':_0x5622('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x5622('0xa')},'defaultEntry':{'type':Sequelize[_0x5622('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 b8005c1..adf192e 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 _0x7e33=['desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','MusicOnHolds','UserProfileResource','destroy','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','body','create','mode','join','root','files','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','format','basename','extname','%s.%s','symlinkSync','Sequelize','removeSound','id2','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0x7e33,0x145));var _0x37e3=function(_0x5c9f44,_0x12e49a){_0x5c9f44=_0x5c9f44-0x0;var _0x1022ee=_0x7e33[_0x5c9f44];return _0x1022ee;};'use strict';var emlformat=require(_0x37e3('0x0'));var rimraf=require(_0x37e3('0x1'));var zipdir=require(_0x37e3('0x2'));var jsonpatch=require(_0x37e3('0x3'));var rp=require(_0x37e3('0x4'));var moment=require(_0x37e3('0x5'));var BPromise=require(_0x37e3('0x6'));var Mustache=require(_0x37e3('0x7'));var util=require(_0x37e3('0x8'));var path=require(_0x37e3('0x9'));var sox=require('sox');var csv=require(_0x37e3('0xa'));var ejs=require(_0x37e3('0xb'));var fs=require('fs');var fs_extra=require(_0x37e3('0xc'));var _=require(_0x37e3('0xd'));var squel=require(_0x37e3('0xe'));var crypto=require(_0x37e3('0xf'));var jsforce=require(_0x37e3('0x10'));var deskjs=require(_0x37e3('0x11'));var toCsv=require(_0x37e3('0xa'));var querystring=require(_0x37e3('0x12'));var Papa=require('papaparse');var Redis=require(_0x37e3('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x37e3('0x14'));var hardwareService=require(_0x37e3('0x15'));var logger=require(_0x37e3('0x16'))(_0x37e3('0x17'));var utils=require('../../config/utils');var config=require(_0x37e3('0x18'));var licenseUtil=require(_0x37e3('0x19'));var db=require(_0x37e3('0x1a'))['db'];function respondWithStatusCode(_0x12882d,_0x44184b){_0x44184b=_0x44184b||0xcc;return function(_0xce1b8){if(_0xce1b8){return _0x12882d[_0x37e3('0x1b')](_0x44184b);}return _0x12882d['status'](_0x44184b)[_0x37e3('0x1c')]();};}function respondWithResult(_0xfe8a04,_0x9fada){_0x9fada=_0x9fada||0xc8;return function(_0x40ae6b){if(_0x40ae6b){return _0xfe8a04[_0x37e3('0x1d')](_0x9fada)[_0x37e3('0x1e')](_0x40ae6b);}};}function respondWithFilteredResult(_0x18b415,_0x209b4f){return function(_0x3360a9){if(_0x3360a9){var _0x351399=typeof _0x209b4f[_0x37e3('0x1f')]===_0x37e3('0x20')&&typeof _0x209b4f[_0x37e3('0x21')]==='undefined';var _0x388cf8=_0x3360a9[_0x37e3('0x22')];var _0x5319b3=_0x351399?0x0:_0x209b4f[_0x37e3('0x1f')];var _0x1ce821=_0x351399?_0x3360a9[_0x37e3('0x22')]:_0x209b4f[_0x37e3('0x1f')]+_0x209b4f[_0x37e3('0x21')];var _0x3322fb;if(_0x1ce821>=_0x388cf8){_0x1ce821=_0x388cf8;_0x3322fb=0xc8;}else{_0x3322fb=0xce;}_0x18b415[_0x37e3('0x1d')](_0x3322fb);return _0x18b415['set'](_0x37e3('0x23'),_0x5319b3+'-'+_0x1ce821+'/'+_0x388cf8)['json'](_0x3360a9);}return null;};}function patchUpdates(_0x47e973){return function(_0x1e58db){try{jsonpatch['apply'](_0x1e58db,_0x47e973,!![]);}catch(_0x32480a){return BPromise[_0x37e3('0x24')](_0x32480a);}return _0x1e58db['save']();};}function saveUpdates(_0xb36572,_0x11d1f1){return function(_0x43a733){if(_0x43a733){return _0x43a733[_0x37e3('0x25')](_0xb36572)[_0x37e3('0x26')](function(_0x334d3a){return _0x334d3a;});}return null;};}function removeEntity(_0x430440,_0x34defd){return function(_0x5f5677){if(_0x5f5677){return _0x5f5677['destroy']()[_0x37e3('0x26')](function(){var _0x20813d=_0x5f5677['get']({'plain':!![]});var _0x527e71=_0x37e3('0x27');return db[_0x37e3('0x28')][_0x37e3('0x29')]({'where':{'type':_0x527e71,'resourceId':_0x20813d['id']}})[_0x37e3('0x26')](function(){return _0x5f5677;});})[_0x37e3('0x26')](function(){_0x430440[_0x37e3('0x1d')](0xcc)[_0x37e3('0x1c')]();});}};}function handleEntityNotFound(_0x5aae80,_0x57f598){return function(_0x961f41){if(!_0x961f41){_0x5aae80[_0x37e3('0x1b')](0x194);}return _0x961f41;};}function handleError(_0x2deb83,_0x31b10b){_0x31b10b=_0x31b10b||0x1f4;return function(_0x3fcdc1){logger[_0x37e3('0x2a')](_0x3fcdc1[_0x37e3('0x2b')]);if(_0x3fcdc1[_0x37e3('0x2c')]){delete _0x3fcdc1['name'];}_0x2deb83['status'](_0x31b10b)['send'](_0x3fcdc1);};}exports[_0x37e3('0x2d')]=function(_0x15a655,_0x7d59c2){var _0x5a01f4={},_0xe0a81f={},_0x1d8423={'count':0x0,'rows':[]};var _0x3ec546=_[_0x37e3('0x2e')](db[_0x37e3('0x2f')][_0x37e3('0x30')],function(_0x15e7e1){return{'name':_0x15e7e1[_0x37e3('0x31')],'type':_0x15e7e1['type'][_0x37e3('0x32')]};});_0xe0a81f[_0x37e3('0x33')]=_['map'](_0x3ec546,_0x37e3('0x2c'));_0xe0a81f[_0x37e3('0x34')]=_['keys'](_0x15a655[_0x37e3('0x34')]);_0xe0a81f[_0x37e3('0x35')]=_[_0x37e3('0x36')](_0xe0a81f[_0x37e3('0x33')],_0xe0a81f[_0x37e3('0x34')]);_0x5a01f4[_0x37e3('0x37')]=_[_0x37e3('0x36')](_0xe0a81f[_0x37e3('0x33')],qs['fields'](_0x15a655[_0x37e3('0x34')][_0x37e3('0x38')]));_0x5a01f4[_0x37e3('0x37')]=_0x5a01f4[_0x37e3('0x37')][_0x37e3('0x39')]?_0x5a01f4[_0x37e3('0x37')]:_0xe0a81f[_0x37e3('0x33')];if(!_0x15a655[_0x37e3('0x34')][_0x37e3('0x3a')](_0x37e3('0x3b'))){_0x5a01f4[_0x37e3('0x21')]=qs[_0x37e3('0x21')](_0x15a655[_0x37e3('0x34')][_0x37e3('0x21')]);_0x5a01f4[_0x37e3('0x1f')]=qs[_0x37e3('0x1f')](_0x15a655[_0x37e3('0x34')][_0x37e3('0x1f')]);}_0x5a01f4[_0x37e3('0x3c')]=qs[_0x37e3('0x3d')](_0x15a655[_0x37e3('0x34')]['sort']);delete _0x15a655[_0x37e3('0x34')][_0x37e3('0x3d')];_0x5a01f4[_0x37e3('0x3e')]=qs[_0x37e3('0x35')](_['pick'](_0x15a655[_0x37e3('0x34')],_0xe0a81f[_0x37e3('0x35')]),_0x3ec546);if(_0x15a655[_0x37e3('0x34')][_0x37e3('0x3f')]){_0x5a01f4[_0x37e3('0x3e')]=_[_0x37e3('0x40')](_0x5a01f4['where'],{'$or':_[_0x37e3('0x2e')](_0x3ec546,function(_0x3a2ed9){if(_0x3a2ed9[_0x37e3('0x41')]!==_0x37e3('0x42')){var _0x286a55={};_0x286a55[_0x3a2ed9['name']]={'$like':'%'+_0x15a655[_0x37e3('0x34')][_0x37e3('0x3f')]+'%'};return _0x286a55;}})});}_0x5a01f4=_[_0x37e3('0x40')]({},_0x5a01f4,_0x15a655[_0x37e3('0x43')]);var _0x3e50b8={'where':_0x5a01f4['where']};return db[_0x37e3('0x2f')]['count'](_0x3e50b8)[_0x37e3('0x26')](function(_0x3cb631){_0x1d8423[_0x37e3('0x22')]=_0x3cb631;if(_0x15a655['query'][_0x37e3('0x44')]){_0x5a01f4[_0x37e3('0x45')]=[{'all':!![]}];}return db[_0x37e3('0x2f')][_0x37e3('0x46')](_0x5a01f4);})[_0x37e3('0x26')](function(_0x40d135){_0x1d8423[_0x37e3('0x47')]=_0x40d135;return _0x1d8423;})[_0x37e3('0x26')](respondWithFilteredResult(_0x7d59c2,_0x5a01f4))[_0x37e3('0x48')](handleError(_0x7d59c2,null));};exports['show']=function(_0x14321d,_0x52885e){var _0xf23975={'raw':![],'where':{'id':_0x14321d['params']['id']}},_0x459a16={};_0x459a16['model']=_[_0x37e3('0x49')](db['VoiceMusicOnHold'][_0x37e3('0x30')]);_0x459a16[_0x37e3('0x34')]=_[_0x37e3('0x49')](_0x14321d[_0x37e3('0x34')]);_0x459a16[_0x37e3('0x35')]=_['intersection'](_0x459a16[_0x37e3('0x33')],_0x459a16[_0x37e3('0x34')]);_0xf23975[_0x37e3('0x37')]=_['intersection'](_0x459a16[_0x37e3('0x33')],qs['fields'](_0x14321d[_0x37e3('0x34')]['fields']));_0xf23975[_0x37e3('0x37')]=_0xf23975[_0x37e3('0x37')][_0x37e3('0x39')]?_0xf23975[_0x37e3('0x37')]:_0x459a16[_0x37e3('0x33')];if(_0x14321d[_0x37e3('0x34')][_0x37e3('0x44')]){_0xf23975[_0x37e3('0x45')]=[{'all':!![]}];}_0xf23975=_['merge']({},_0xf23975,_0x14321d[_0x37e3('0x43')]);return db['VoiceMusicOnHold']['find'](_0xf23975)[_0x37e3('0x26')](handleEntityNotFound(_0x52885e,null))[_0x37e3('0x26')](respondWithResult(_0x52885e,null))[_0x37e3('0x48')](handleError(_0x52885e,null));};exports[_0x37e3('0x25')]=function(_0x4081d1,_0x6c9f2f){if(_0x4081d1['body']['id']){delete _0x4081d1['body']['id'];}return db['VoiceMusicOnHold'][_0x37e3('0x4a')]({'where':{'id':_0x4081d1[_0x37e3('0x4b')]['id']}})[_0x37e3('0x26')](handleEntityNotFound(_0x6c9f2f,null))[_0x37e3('0x26')](saveUpdates(_0x4081d1[_0x37e3('0x4c')],null))[_0x37e3('0x26')](respondWithResult(_0x6c9f2f,null))[_0x37e3('0x48')](handleError(_0x6c9f2f,null));};exports[_0x37e3('0x4d')]=function(_0x5b2d6b,_0x150a7c,_0x379805){return db['sequelize']['transaction'](function(_0x1f958f){if(_0x5b2d6b[_0x37e3('0x4c')][_0x37e3('0x4e')]==='files'){_0x5b2d6b['body']['directory']=path[_0x37e3('0x4f')](config[_0x37e3('0x50')],'server/files/moh',_0x5b2d6b[_0x37e3('0x4c')]['name']);}return db[_0x37e3('0x2f')]['create'](_0x5b2d6b[_0x37e3('0x4c')],{'transaction':_0x1f958f})[_0x37e3('0x26')](function(_0x32e77f){if(_0x5b2d6b[_0x37e3('0x4c')][_0x37e3('0x4e')]===_0x37e3('0x51')){fs[_0x37e3('0x52')](_0x32e77f[_0x37e3('0x53')],parseInt(_0x37e3('0x54'),0x8));}var _0x1cc0d5=_0x5b2d6b[_0x37e3('0x55')][_0x37e3('0x56')]({'plain':!![]});if(!_0x1cc0d5)throw new Error(_0x37e3('0x57'));if(_0x1cc0d5[_0x37e3('0x58')]===_0x37e3('0x55')){var _0x1277f6=_0x32e77f[_0x37e3('0x56')]({'plain':!![]});return db[_0x37e3('0x59')]['find']({'where':{'name':_0x37e3('0x27'),'userProfileId':_0x1cc0d5[_0x37e3('0x5a')]},'raw':!![]})['then'](function(_0x1b1ece){if(_0x1b1ece&&_0x1b1ece['autoAssociation']===0x0){return db['UserProfileResource'][_0x37e3('0x4d')]({'name':_0x1277f6[_0x37e3('0x2c')],'resourceId':_0x1277f6['id'],'type':_0x1b1ece[_0x37e3('0x2c')],'sectionId':_0x1b1ece['id']},{})[_0x37e3('0x26')](function(){return _0x32e77f;});}else{return _0x32e77f;}})[_0x37e3('0x48')](function(_0x1aa976){logger[_0x37e3('0x2a')](_0x37e3('0x5b'),_0x1aa976);});}return _0x32e77f;});})[_0x37e3('0x26')](respondWithResult(_0x150a7c,0xc9))['catch'](handleError(_0x150a7c,null));};exports['destroy']=function(_0x5a2892,_0x1e661a,_0x3b0b02){var _0x4ab5b7;return db[_0x37e3('0x2f')][_0x37e3('0x4a')]({'where':{'id':_0x5a2892[_0x37e3('0x4b')]['id']}})[_0x37e3('0x26')](function(_0x4fedee){if(_0x4fedee){return db[_0x37e3('0x5c')][_0x37e3('0x5d')](function(_0x47ec3f){return _0x4fedee['destroy']({'transaction':_0x47ec3f,'raw':!![]})[_0x37e3('0x26')](function(_0x2c0201){if(_0x2c0201[_0x37e3('0x53')]){fs['readdirSync'](_0x2c0201[_0x37e3('0x53')])[_0x37e3('0x5e')](function(_0x456bb8){fs[_0x37e3('0x5f')](path[_0x37e3('0x4f')](_0x2c0201[_0x37e3('0x53')],_0x456bb8));});fs[_0x37e3('0x60')](_0x2c0201['directory']);}return _0x2c0201;});})['catch'](function(_0x4bc0df){throw new db['Sequelize'][(_0x37e3('0x61'))](_0x4bc0df[_0x37e3('0x62')]);});}})['then'](handleEntityNotFound(_0x1e661a,null))[_0x37e3('0x26')](removeEntity(_0x1e661a,null))['catch'](handleError(_0x1e661a,null));};exports[_0x37e3('0x63')]=function(_0x2f21b6,_0x1e6e3b,_0x4d86ed){return db['sequelize']['transaction'](function(_0x40968b){var _0x42b03a;return db['VoiceMusicOnHold'][_0x37e3('0x4a')]({'where':{'id':_0x2f21b6['params']['id']}})[_0x37e3('0x26')](function(_0x18cffa){if(_0x18cffa){_0x42b03a=_0x18cffa;return _0x18cffa[_0x37e3('0x63')](_0x2f21b6[_0x37e3('0x4c')]['id'],{'transaction':_0x40968b});}})[_0x37e3('0x26')](function(_0x4b266d){if(_0x4b266d){return db[_0x37e3('0x64')][_0x37e3('0x65')]({'where':{'id':_0x2f21b6[_0x37e3('0x4c')]['id']},'attributes':['id',_0x37e3('0x2c'),_0x37e3('0x66'),_0x37e3('0x67'),'createdAt'],'raw':!![]});}})['then'](function(_0x4c9529){if(_0x4c9529){var _0x1a8ef4=path[_0x37e3('0x4f')](config[_0x37e3('0x50')],'server/files/sounds/converted',util[_0x37e3('0x68')]('%s.%s',path[_0x37e3('0x69')](_0x4c9529[_0x37e3('0x66')],path[_0x37e3('0x6a')](_0x4c9529[_0x37e3('0x66')])),_0x4c9529['converted_format']));var _0x382b03=path[_0x37e3('0x4f')](config[_0x37e3('0x50')],'server/files/moh',_0x42b03a[_0x37e3('0x2c')],util[_0x37e3('0x68')](_0x37e3('0x6b'),_0x4c9529[_0x37e3('0x2c')],_0x4c9529['converted_format']));fs[_0x37e3('0x6c')](_0x1a8ef4,_0x382b03);return _0x4c9529;}})[_0x37e3('0x48')](function(_0x2acb9f){throw new db[(_0x37e3('0x6d'))][(_0x37e3('0x61'))](_0x2acb9f[_0x37e3('0x62')]);});})['then'](handleEntityNotFound(_0x1e6e3b,null))[_0x37e3('0x26')](respondWithResult(_0x1e6e3b,0xc9))[_0x37e3('0x48')](handleError(_0x1e6e3b,null));};exports[_0x37e3('0x6e')]=function(_0x19d321,_0x1a6693,_0x30f4e9){return db['sequelize'][_0x37e3('0x5d')](function(_0x4d4c25){var _0x3e540c;return db['VoiceMusicOnHold'][_0x37e3('0x65')]({'where':{'id':_0x19d321[_0x37e3('0x4b')]['id']}})[_0x37e3('0x26')](handleEntityNotFound(_0x1a6693,null))[_0x37e3('0x26')](function(_0x4efc2e){if(_0x4efc2e){_0x3e540c=_0x4efc2e;return _0x4efc2e[_0x37e3('0x6e')](_0x19d321['params']['id2']);}})['then'](function(_0x371e91){if(_0x371e91){return db[_0x37e3('0x64')][_0x37e3('0x65')]({'where':{'id':_0x19d321[_0x37e3('0x4b')][_0x37e3('0x6f')]},'attributes':['id',_0x37e3('0x2c'),_0x37e3('0x66'),_0x37e3('0x67'),'createdAt'],'raw':!![]});}})[_0x37e3('0x26')](function(_0x3d5c3a){if(_0x3d5c3a){fs[_0x37e3('0x5f')](path[_0x37e3('0x4f')](_0x3e540c[_0x37e3('0x53')],util[_0x37e3('0x68')]('%s.%s',_0x3d5c3a[_0x37e3('0x2c')],_0x3d5c3a[_0x37e3('0x67')])));return _0x3d5c3a;}})[_0x37e3('0x48')](function(_0x29ab02){throw new db[(_0x37e3('0x6d'))]['ValidationError'](_0x29ab02[_0x37e3('0x62')]);});})[_0x37e3('0x26')](handleEntityNotFound(_0x1a6693,null))[_0x37e3('0x26')](respondWithStatusCode(_0x1a6693,0xcc))[_0x37e3('0x48')](handleError(_0x1a6693,null));};exports[_0x37e3('0x70')]=function(_0x260786,_0x4f72f,_0x253eb9){var _0x2460b8={};var _0x935c89={};var _0x5d5b93;var _0x2d1df7;return db[_0x37e3('0x2f')]['findOne']({'where':{'id':_0x260786[_0x37e3('0x4b')]['id']}})[_0x37e3('0x26')](handleEntityNotFound(_0x4f72f,null))[_0x37e3('0x26')](function(_0x446979){if(_0x446979){_0x5d5b93=_0x446979;_0x935c89[_0x37e3('0x33')]=_[_0x37e3('0x49')](db[_0x37e3('0x64')][_0x37e3('0x30')]);_0x935c89[_0x37e3('0x34')]=_[_0x37e3('0x49')](_0x260786[_0x37e3('0x34')]);_0x935c89[_0x37e3('0x35')]=_[_0x37e3('0x36')](_0x935c89[_0x37e3('0x33')],_0x935c89[_0x37e3('0x34')]);_0x2460b8[_0x37e3('0x37')]=_[_0x37e3('0x36')](_0x935c89[_0x37e3('0x33')],qs[_0x37e3('0x38')](_0x260786['query'][_0x37e3('0x38')]));_0x2460b8[_0x37e3('0x37')]=_0x2460b8[_0x37e3('0x37')]['length']?_0x2460b8['attributes']:_0x935c89['model'];_0x2460b8[_0x37e3('0x3c')]=qs['sort'](_0x260786[_0x37e3('0x34')]['sort']);_0x2460b8[_0x37e3('0x3e')]=qs[_0x37e3('0x35')](_[_0x37e3('0x71')](_0x260786[_0x37e3('0x34')],_0x935c89[_0x37e3('0x35')]));if(_0x260786['query']['filter']){_0x2460b8[_0x37e3('0x3e')]=_[_0x37e3('0x40')](_0x2460b8[_0x37e3('0x3e')],{'$or':_[_0x37e3('0x2e')](_0x2460b8[_0x37e3('0x37')],function(_0x49b384){var _0x929dac={};_0x929dac[_0x49b384]={'$like':'%'+_0x260786[_0x37e3('0x34')][_0x37e3('0x3f')]+'%'};return _0x929dac;})});}_0x2460b8=_['merge']({},_0x2460b8,_0x260786[_0x37e3('0x43')]);return _0x5d5b93['getSounds'](_0x2460b8);}})['then'](function(_0x590f06){if(_0x590f06){_0x2d1df7=_0x590f06[_0x37e3('0x39')];if(!_0x260786[_0x37e3('0x34')][_0x37e3('0x3a')]('nolimit')){_0x2460b8[_0x37e3('0x21')]=qs[_0x37e3('0x21')](_0x260786['query'][_0x37e3('0x21')]);_0x2460b8[_0x37e3('0x1f')]=qs[_0x37e3('0x1f')](_0x260786['query'][_0x37e3('0x1f')]);}return _0x5d5b93[_0x37e3('0x70')](_0x2460b8);}})[_0x37e3('0x26')](function(_0x301603){if(_0x301603){return _0x301603?{'count':_0x2d1df7,'rows':_0x301603}:null;}})[_0x37e3('0x26')](respondWithResult(_0x4f72f,null))[_0x37e3('0x48')](handleError(_0x4f72f,null));}; \ No newline at end of file +var _0x4b3d=['include','VoiceMusicOnHold','findAll','rows','show','params','intersection','catch','body','find','create','sequelize','transaction','files','join','root','server/files/moh','mode','directory','0777','user','get','role','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','Sequelize','message','addSound','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','removeSound','id2','findOne','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','error','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4b3d,0x16b));var _0xd4b3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4b3d[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xd4b3('0x0'));var rimraf=require(_0xd4b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4b3('0x2'));var rp=require(_0xd4b3('0x3'));var moment=require(_0xd4b3('0x4'));var BPromise=require(_0xd4b3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4b3('0x6'));var sox=require('sox');var csv=require(_0xd4b3('0x7'));var ejs=require(_0xd4b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4b3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4b3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd4b3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd4b3('0xb'));var authService=require(_0xd4b3('0xc'));var qs=require(_0xd4b3('0xd'));var as=require(_0xd4b3('0xe'));var hardwareService=require(_0xd4b3('0xf'));var logger=require(_0xd4b3('0x10'))(_0xd4b3('0x11'));var utils=require(_0xd4b3('0x12'));var config=require(_0xd4b3('0x13'));var licenseUtil=require(_0xd4b3('0x14'));var db=require(_0xd4b3('0x15'))['db'];function respondWithStatusCode(_0x7614f2,_0x3c31b8){_0x3c31b8=_0x3c31b8||0xcc;return function(_0x4a21eb){if(_0x4a21eb){return _0x7614f2[_0xd4b3('0x16')](_0x3c31b8);}return _0x7614f2['status'](_0x3c31b8)[_0xd4b3('0x17')]();};}function respondWithResult(_0x2a5859,_0x317230){_0x317230=_0x317230||0xc8;return function(_0x4bb3ed){if(_0x4bb3ed){return _0x2a5859[_0xd4b3('0x18')](_0x317230)[_0xd4b3('0x19')](_0x4bb3ed);}};}function respondWithFilteredResult(_0x6eaa12,_0x56aee3){return function(_0x452815){if(_0x452815){var _0x32fff7=typeof _0x56aee3[_0xd4b3('0x1a')]===_0xd4b3('0x1b')&&typeof _0x56aee3['limit']===_0xd4b3('0x1b');var _0x36343f=_0x452815[_0xd4b3('0x1c')];var _0x5b5e01=_0x32fff7?0x0:_0x56aee3[_0xd4b3('0x1a')];var _0x4ea6d1=_0x32fff7?_0x452815[_0xd4b3('0x1c')]:_0x56aee3[_0xd4b3('0x1a')]+_0x56aee3['limit'];var _0x49be5f;if(_0x4ea6d1>=_0x36343f){_0x4ea6d1=_0x36343f;_0x49be5f=0xc8;}else{_0x49be5f=0xce;}_0x6eaa12[_0xd4b3('0x18')](_0x49be5f);return _0x6eaa12['set'](_0xd4b3('0x1d'),_0x5b5e01+'-'+_0x4ea6d1+'/'+_0x36343f)[_0xd4b3('0x19')](_0x452815);}return null;};}function patchUpdates(_0xce5d24){return function(_0x4a862d){try{jsonpatch[_0xd4b3('0x1e')](_0x4a862d,_0xce5d24,!![]);}catch(_0xf64889){return BPromise[_0xd4b3('0x1f')](_0xf64889);}return _0x4a862d['save']();};}function saveUpdates(_0xcce642,_0x7ee15c){return function(_0x326497){if(_0x326497){return _0x326497[_0xd4b3('0x20')](_0xcce642)[_0xd4b3('0x21')](function(_0x4cba14){return _0x4cba14;});}return null;};}function removeEntity(_0x48c730,_0x33f411){return function(_0x484cff){if(_0x484cff){return _0x484cff[_0xd4b3('0x22')]()[_0xd4b3('0x21')](function(){var _0x566688=_0x484cff['get']({'plain':!![]});var _0x1027f4=_0xd4b3('0x23');return db['UserProfileResource'][_0xd4b3('0x22')]({'where':{'type':_0x1027f4,'resourceId':_0x566688['id']}})[_0xd4b3('0x21')](function(){return _0x484cff;});})['then'](function(){_0x48c730[_0xd4b3('0x18')](0xcc)[_0xd4b3('0x17')]();});}};}function handleEntityNotFound(_0x284100,_0x493e9a){return function(_0x5b7c1c){if(!_0x5b7c1c){_0x284100['sendStatus'](0x194);}return _0x5b7c1c;};}function handleError(_0x364781,_0x322776){_0x322776=_0x322776||0x1f4;return function(_0x32b6b1){logger[_0xd4b3('0x24')](_0x32b6b1[_0xd4b3('0x25')]);if(_0x32b6b1[_0xd4b3('0x26')]){delete _0x32b6b1[_0xd4b3('0x26')];}_0x364781[_0xd4b3('0x18')](_0x322776)['send'](_0x32b6b1);};}exports[_0xd4b3('0x27')]=function(_0x1e1274,_0x5095d6){var _0x449958={},_0x32bae0={},_0x139b49={'count':0x0,'rows':[]};var _0x11e647=_[_0xd4b3('0x28')](db['VoiceMusicOnHold'][_0xd4b3('0x29')],function(_0x4ec739){return{'name':_0x4ec739[_0xd4b3('0x2a')],'type':_0x4ec739[_0xd4b3('0x2b')]['key']};});_0x32bae0['model']=_['map'](_0x11e647,_0xd4b3('0x26'));_0x32bae0[_0xd4b3('0x2c')]=_[_0xd4b3('0x2d')](_0x1e1274[_0xd4b3('0x2c')]);_0x32bae0[_0xd4b3('0x2e')]=_['intersection'](_0x32bae0['model'],_0x32bae0['query']);_0x449958[_0xd4b3('0x2f')]=_['intersection'](_0x32bae0[_0xd4b3('0x30')],qs[_0xd4b3('0x31')](_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x31')]));_0x449958[_0xd4b3('0x2f')]=_0x449958[_0xd4b3('0x2f')][_0xd4b3('0x32')]?_0x449958[_0xd4b3('0x2f')]:_0x32bae0[_0xd4b3('0x30')];if(!_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x33')](_0xd4b3('0x34'))){_0x449958['limit']=qs['limit'](_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x35')]);_0x449958['offset']=qs[_0xd4b3('0x1a')](_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x1a')]);}_0x449958[_0xd4b3('0x36')]=qs[_0xd4b3('0x37')](_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x37')]);delete _0x1e1274[_0xd4b3('0x2c')]['sort'];_0x449958[_0xd4b3('0x38')]=qs[_0xd4b3('0x2e')](_['pick'](_0x1e1274['query'],_0x32bae0[_0xd4b3('0x2e')]),_0x11e647);if(_0x1e1274['query'][_0xd4b3('0x39')]){_0x449958[_0xd4b3('0x38')]=_[_0xd4b3('0x3a')](_0x449958[_0xd4b3('0x38')],{'$or':_[_0xd4b3('0x28')](_0x11e647,function(_0x454f76){if(_0x454f76[_0xd4b3('0x2b')]!=='VIRTUAL'){var _0x40f982={};_0x40f982[_0x454f76['name']]={'$like':'%'+_0x1e1274['query'][_0xd4b3('0x39')]+'%'};return _0x40f982;}})});}_0x449958=_['merge']({},_0x449958,_0x1e1274[_0xd4b3('0x3b')]);var _0x522597={'where':_0x449958[_0xd4b3('0x38')]};return db['VoiceMusicOnHold'][_0xd4b3('0x1c')](_0x522597)[_0xd4b3('0x21')](function(_0x34a06d){_0x139b49[_0xd4b3('0x1c')]=_0x34a06d;if(_0x1e1274[_0xd4b3('0x2c')][_0xd4b3('0x3c')]){_0x449958[_0xd4b3('0x3d')]=[{'all':!![]}];}return db[_0xd4b3('0x3e')][_0xd4b3('0x3f')](_0x449958);})['then'](function(_0x5de93e){_0x139b49[_0xd4b3('0x40')]=_0x5de93e;return _0x139b49;})[_0xd4b3('0x21')](respondWithFilteredResult(_0x5095d6,_0x449958))['catch'](handleError(_0x5095d6,null));};exports[_0xd4b3('0x41')]=function(_0x456c30,_0x11fa09){var _0x1251e3={'raw':![],'where':{'id':_0x456c30[_0xd4b3('0x42')]['id']}},_0x54abac={};_0x54abac[_0xd4b3('0x30')]=_[_0xd4b3('0x2d')](db[_0xd4b3('0x3e')]['rawAttributes']);_0x54abac['query']=_[_0xd4b3('0x2d')](_0x456c30[_0xd4b3('0x2c')]);_0x54abac[_0xd4b3('0x2e')]=_['intersection'](_0x54abac[_0xd4b3('0x30')],_0x54abac[_0xd4b3('0x2c')]);_0x1251e3[_0xd4b3('0x2f')]=_[_0xd4b3('0x43')](_0x54abac[_0xd4b3('0x30')],qs[_0xd4b3('0x31')](_0x456c30[_0xd4b3('0x2c')][_0xd4b3('0x31')]));_0x1251e3[_0xd4b3('0x2f')]=_0x1251e3[_0xd4b3('0x2f')]['length']?_0x1251e3['attributes']:_0x54abac[_0xd4b3('0x30')];if(_0x456c30[_0xd4b3('0x2c')][_0xd4b3('0x3c')]){_0x1251e3[_0xd4b3('0x3d')]=[{'all':!![]}];}_0x1251e3=_[_0xd4b3('0x3a')]({},_0x1251e3,_0x456c30['options']);return db[_0xd4b3('0x3e')]['find'](_0x1251e3)[_0xd4b3('0x21')](handleEntityNotFound(_0x11fa09,null))[_0xd4b3('0x21')](respondWithResult(_0x11fa09,null))[_0xd4b3('0x44')](handleError(_0x11fa09,null));};exports[_0xd4b3('0x20')]=function(_0xdbb6ee,_0x7fd036){if(_0xdbb6ee['body']['id']){delete _0xdbb6ee[_0xd4b3('0x45')]['id'];}return db[_0xd4b3('0x3e')][_0xd4b3('0x46')]({'where':{'id':_0xdbb6ee[_0xd4b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x7fd036,null))[_0xd4b3('0x21')](saveUpdates(_0xdbb6ee[_0xd4b3('0x45')],null))['then'](respondWithResult(_0x7fd036,null))[_0xd4b3('0x44')](handleError(_0x7fd036,null));};exports[_0xd4b3('0x47')]=function(_0x16e77f,_0x4837a6,_0xec41be){return db[_0xd4b3('0x48')][_0xd4b3('0x49')](function(_0x2b7817){if(_0x16e77f['body']['mode']===_0xd4b3('0x4a')){_0x16e77f[_0xd4b3('0x45')]['directory']=path[_0xd4b3('0x4b')](config[_0xd4b3('0x4c')],_0xd4b3('0x4d'),_0x16e77f[_0xd4b3('0x45')]['name']);}return db['VoiceMusicOnHold'][_0xd4b3('0x47')](_0x16e77f[_0xd4b3('0x45')],{'transaction':_0x2b7817})[_0xd4b3('0x21')](function(_0x2a17cd){if(_0x16e77f['body'][_0xd4b3('0x4e')]===_0xd4b3('0x4a')){fs['mkdirSync'](_0x2a17cd[_0xd4b3('0x4f')],parseInt(_0xd4b3('0x50'),0x8));}var _0x2ab8c=_0x16e77f[_0xd4b3('0x51')][_0xd4b3('0x52')]({'plain':!![]});if(!_0x2ab8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ab8c[_0xd4b3('0x53')]===_0xd4b3('0x51')){var _0x4c4136=_0x2a17cd[_0xd4b3('0x52')]({'plain':!![]});return db['UserProfileSection'][_0xd4b3('0x46')]({'where':{'name':_0xd4b3('0x23'),'userProfileId':_0x2ab8c[_0xd4b3('0x54')]},'raw':!![]})['then'](function(_0xd9c27e){if(_0xd9c27e&&_0xd9c27e[_0xd4b3('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c4136['name'],'resourceId':_0x4c4136['id'],'type':_0xd9c27e[_0xd4b3('0x26')],'sectionId':_0xd9c27e['id']},{})['then'](function(){return _0x2a17cd;});}else{return _0x2a17cd;}})[_0xd4b3('0x44')](function(_0x131393){logger[_0xd4b3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x131393);});}return _0x2a17cd;});})[_0xd4b3('0x21')](respondWithResult(_0x4837a6,0xc9))[_0xd4b3('0x44')](handleError(_0x4837a6,null));};exports[_0xd4b3('0x22')]=function(_0x4b8e2a,_0x16d7ef,_0x3a2163){var _0xd5077b;return db[_0xd4b3('0x3e')][_0xd4b3('0x46')]({'where':{'id':_0x4b8e2a['params']['id']}})['then'](function(_0x49b737){if(_0x49b737){return db[_0xd4b3('0x48')][_0xd4b3('0x49')](function(_0x32b500){return _0x49b737['destroy']({'transaction':_0x32b500,'raw':!![]})[_0xd4b3('0x21')](function(_0x59673b){if(_0x59673b[_0xd4b3('0x4f')]){fs[_0xd4b3('0x56')](_0x59673b['directory'])[_0xd4b3('0x57')](function(_0x11240e){fs[_0xd4b3('0x58')](path[_0xd4b3('0x4b')](_0x59673b[_0xd4b3('0x4f')],_0x11240e));});fs['rmdirSync'](_0x59673b['directory']);}return _0x59673b;});})['catch'](function(_0x3724a0){throw new db[(_0xd4b3('0x59'))]['ValidationError'](_0x3724a0[_0xd4b3('0x5a')]);});}})[_0xd4b3('0x21')](handleEntityNotFound(_0x16d7ef,null))['then'](removeEntity(_0x16d7ef,null))['catch'](handleError(_0x16d7ef,null));};exports[_0xd4b3('0x5b')]=function(_0x1ab1cb,_0x3f3c76,_0xf2b668){return db[_0xd4b3('0x48')][_0xd4b3('0x49')](function(_0x40aed1){var _0x45918d;return db[_0xd4b3('0x3e')][_0xd4b3('0x46')]({'where':{'id':_0x1ab1cb[_0xd4b3('0x42')]['id']}})[_0xd4b3('0x21')](function(_0x333665){if(_0x333665){_0x45918d=_0x333665;return _0x333665[_0xd4b3('0x5b')](_0x1ab1cb['body']['id'],{'transaction':_0x40aed1});}})['then'](function(_0x27f9b5){if(_0x27f9b5){return db['Sound']['findOne']({'where':{'id':_0x1ab1cb['body']['id']},'attributes':['id','name',_0xd4b3('0x5c'),'converted_format',_0xd4b3('0x5d')],'raw':!![]});}})['then'](function(_0x447d0a){if(_0x447d0a){var _0x22ee6c=path[_0xd4b3('0x4b')](config['root'],_0xd4b3('0x5e'),util[_0xd4b3('0x5f')](_0xd4b3('0x60'),path[_0xd4b3('0x61')](_0x447d0a['save_name'],path[_0xd4b3('0x62')](_0x447d0a[_0xd4b3('0x5c')])),_0x447d0a[_0xd4b3('0x63')]));var _0x4b3aff=path['join'](config[_0xd4b3('0x4c')],_0xd4b3('0x4d'),_0x45918d[_0xd4b3('0x26')],util['format'](_0xd4b3('0x60'),_0x447d0a[_0xd4b3('0x26')],_0x447d0a[_0xd4b3('0x63')]));fs[_0xd4b3('0x64')](_0x22ee6c,_0x4b3aff);return _0x447d0a;}})[_0xd4b3('0x44')](function(_0xb1441e){throw new db['Sequelize'][(_0xd4b3('0x65'))](_0xb1441e[_0xd4b3('0x5a')]);});})['then'](handleEntityNotFound(_0x3f3c76,null))[_0xd4b3('0x21')](respondWithResult(_0x3f3c76,0xc9))[_0xd4b3('0x44')](handleError(_0x3f3c76,null));};exports[_0xd4b3('0x66')]=function(_0x5e37ec,_0x1b6af4,_0x1976c7){return db[_0xd4b3('0x48')][_0xd4b3('0x49')](function(_0x338f72){var _0x3f872d;return db[_0xd4b3('0x3e')]['findOne']({'where':{'id':_0x5e37ec['params']['id']}})[_0xd4b3('0x21')](handleEntityNotFound(_0x1b6af4,null))[_0xd4b3('0x21')](function(_0xd997ee){if(_0xd997ee){_0x3f872d=_0xd997ee;return _0xd997ee[_0xd4b3('0x66')](_0x5e37ec['params'][_0xd4b3('0x67')]);}})[_0xd4b3('0x21')](function(_0x1db4fe){if(_0x1db4fe){return db['Sound'][_0xd4b3('0x68')]({'where':{'id':_0x5e37ec[_0xd4b3('0x42')][_0xd4b3('0x67')]},'attributes':['id','name',_0xd4b3('0x5c'),'converted_format',_0xd4b3('0x5d')],'raw':!![]});}})[_0xd4b3('0x21')](function(_0x3bbf93){if(_0x3bbf93){fs[_0xd4b3('0x58')](path[_0xd4b3('0x4b')](_0x3f872d[_0xd4b3('0x4f')],util[_0xd4b3('0x5f')](_0xd4b3('0x60'),_0x3bbf93[_0xd4b3('0x26')],_0x3bbf93[_0xd4b3('0x63')])));return _0x3bbf93;}})[_0xd4b3('0x44')](function(_0x4890a0){throw new db[(_0xd4b3('0x59'))]['ValidationError'](_0x4890a0[_0xd4b3('0x5a')]);});})[_0xd4b3('0x21')](handleEntityNotFound(_0x1b6af4,null))['then'](respondWithStatusCode(_0x1b6af4,0xcc))[_0xd4b3('0x44')](handleError(_0x1b6af4,null));};exports[_0xd4b3('0x69')]=function(_0x31358f,_0x24e8d2,_0x332acf){var _0x4fa1d3={};var _0x534d5f={};var _0x5887cf;var _0x2ee457;return db['VoiceMusicOnHold'][_0xd4b3('0x68')]({'where':{'id':_0x31358f[_0xd4b3('0x42')]['id']}})[_0xd4b3('0x21')](handleEntityNotFound(_0x24e8d2,null))[_0xd4b3('0x21')](function(_0x44facc){if(_0x44facc){_0x5887cf=_0x44facc;_0x534d5f[_0xd4b3('0x30')]=_['keys'](db['Sound']['rawAttributes']);_0x534d5f[_0xd4b3('0x2c')]=_['keys'](_0x31358f['query']);_0x534d5f[_0xd4b3('0x2e')]=_[_0xd4b3('0x43')](_0x534d5f[_0xd4b3('0x30')],_0x534d5f[_0xd4b3('0x2c')]);_0x4fa1d3[_0xd4b3('0x2f')]=_['intersection'](_0x534d5f[_0xd4b3('0x30')],qs['fields'](_0x31358f['query'][_0xd4b3('0x31')]));_0x4fa1d3[_0xd4b3('0x2f')]=_0x4fa1d3[_0xd4b3('0x2f')][_0xd4b3('0x32')]?_0x4fa1d3['attributes']:_0x534d5f['model'];_0x4fa1d3['order']=qs[_0xd4b3('0x37')](_0x31358f['query'][_0xd4b3('0x37')]);_0x4fa1d3[_0xd4b3('0x38')]=qs[_0xd4b3('0x2e')](_['pick'](_0x31358f[_0xd4b3('0x2c')],_0x534d5f['filters']));if(_0x31358f[_0xd4b3('0x2c')][_0xd4b3('0x39')]){_0x4fa1d3[_0xd4b3('0x38')]=_[_0xd4b3('0x3a')](_0x4fa1d3[_0xd4b3('0x38')],{'$or':_[_0xd4b3('0x28')](_0x4fa1d3[_0xd4b3('0x2f')],function(_0xfdb8af){var _0x1de5c7={};_0x1de5c7[_0xfdb8af]={'$like':'%'+_0x31358f[_0xd4b3('0x2c')]['filter']+'%'};return _0x1de5c7;})});}_0x4fa1d3=_[_0xd4b3('0x3a')]({},_0x4fa1d3,_0x31358f['options']);return _0x5887cf[_0xd4b3('0x69')](_0x4fa1d3);}})[_0xd4b3('0x21')](function(_0x5706c4){if(_0x5706c4){_0x2ee457=_0x5706c4[_0xd4b3('0x32')];if(!_0x31358f[_0xd4b3('0x2c')][_0xd4b3('0x33')]('nolimit')){_0x4fa1d3['limit']=qs[_0xd4b3('0x35')](_0x31358f[_0xd4b3('0x2c')][_0xd4b3('0x35')]);_0x4fa1d3[_0xd4b3('0x1a')]=qs['offset'](_0x31358f[_0xd4b3('0x2c')][_0xd4b3('0x1a')]);}return _0x5887cf[_0xd4b3('0x69')](_0x4fa1d3);}})[_0xd4b3('0x21')](function(_0x3ab2e9){if(_0x3ab2e9){return _0x3ab2e9?{'count':_0x2ee457,'rows':_0x3ab2e9}:null;}})[_0xd4b3('0x21')](respondWithResult(_0x24e8d2,null))[_0xd4b3('0x44')](handleError(_0x24e8d2,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3a66802..1ccb473 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 _0xb8f1=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb8f1,0x111));var _0x1b8f=function(_0x3c42f0,_0x421a98){_0x3c42f0=_0x3c42f0-0x0;var _0x2e39da=_0xb8f1[_0x3c42f0];return _0x2e39da;};'use strict';var _=require(_0x1b8f('0x0'));var util=require(_0x1b8f('0x1'));var logger=require(_0x1b8f('0x2'))(_0x1b8f('0x3'));var moment=require(_0x1b8f('0x4'));var BPromise=require(_0x1b8f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b8f('0x6'));var config=require(_0x1b8f('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x58b2c7,_0x3da3c9){return _0x58b2c7[_0x1b8f('0x8')](_0x1b8f('0x9'),attributes,{'tableName':_0x1b8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24da=['api','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x24da,0x11d));var _0xa24d=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x24da[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0xa24d('0x0'));var util=require(_0xa24d('0x1'));var logger=require(_0xa24d('0x2'))(_0xa24d('0x3'));var moment=require(_0xa24d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa24d('0x5'));var rimraf=require(_0xa24d('0x6'));var config=require(_0xa24d('0x7'));var attributes=require(_0xa24d('0x8'));module['exports']=function(_0x270583,_0x1ee25f){return _0x270583[_0xa24d('0x9')](_0xa24d('0xa'),attributes,{'tableName':_0xa24d('0xb'),'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 ca72326..ccb44b8 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x9d9b59,_0x3a0059){var _0x331b25=function(_0x1d90ac){while(--_0x1d90ac){_0x9d9b59['push'](_0x9d9b59['shift']());}};_0x331b25(++_0x3a0059);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x40fc92,_0x194c41){var _0x53f051=function(_0x2e0f50){while(--_0x2e0f50){_0x40fc92['push'](_0x40fc92['shift']());}};_0x53f051(++_0x194c41);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b7ce1,_0x4dc1c0){_0x2b7ce1=_0x2b7ce1-0x0;var _0x2c7f96=_0xedd9[_0x2b7ce1];return _0x2c7f96;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2ef38b2..9e9a54c 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 _0xf874=['/:id/users','getAgents','/:id/teams','create','post','addAgents','addTeams','delete','destroy','removeAgents','removeTeams','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x4d148b,_0x4522e5){var _0x40c68d=function(_0x4da2d1){while(--_0x4da2d1){_0x4d148b['push'](_0x4d148b['shift']());}};_0x40c68d(++_0x4522e5);}(_0xf874,0xed));var _0x4f87=function(_0x486a22,_0x3ab347){_0x486a22=_0x486a22-0x0;var _0x4f485b=_0xf874[_0x486a22];return _0x4f485b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f87('0x0'));var timeout=require(_0x4f87('0x1'));var express=require(_0x4f87('0x2'));var router=express[_0x4f87('0x3')]();var fs_extra=require(_0x4f87('0x4'));var auth=require(_0x4f87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f87('0x6'));var controller=require(_0x4f87('0x7'));router[_0x4f87('0x8')]('/',auth[_0x4f87('0x9')](),controller[_0x4f87('0xa')]);router[_0x4f87('0x8')]('/describe',auth[_0x4f87('0x9')](),controller[_0x4f87('0xb')]);router['get'](_0x4f87('0xc'),auth[_0x4f87('0x9')](),controller['show']);router[_0x4f87('0x8')](_0x4f87('0xd'),auth[_0x4f87('0x9')](),controller[_0x4f87('0xe')]);router[_0x4f87('0x8')](_0x4f87('0xf'),auth[_0x4f87('0x9')](),controller['getTeams']);router['post']('/',auth[_0x4f87('0x9')](),controller[_0x4f87('0x10')]);router[_0x4f87('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x4f87('0x12')]);router[_0x4f87('0x11')](_0x4f87('0xf'),auth['isAuthenticated'](),controller[_0x4f87('0x13')]);router['put'](_0x4f87('0xc'),auth[_0x4f87('0x9')](),controller['update']);router[_0x4f87('0x14')](_0x4f87('0xc'),auth[_0x4f87('0x9')](),controller[_0x4f87('0x15')]);router[_0x4f87('0x14')](_0x4f87('0xd'),auth['isAuthenticated'](),controller[_0x4f87('0x16')]);router['delete'](_0x4f87('0xf'),auth[_0x4f87('0x9')](),controller[_0x4f87('0x17')]);module[_0x4f87('0x18')]=router; \ No newline at end of file +var _0x6f2d=['create','addAgents','/:id/teams','addTeams','delete','removeAgents','removeTeams','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','post'];(function(_0x4f60b9,_0x3f926d){var _0x4f06e1=function(_0x9925c5){while(--_0x9925c5){_0x4f60b9['push'](_0x4f60b9['shift']());}};_0x4f06e1(++_0x3f926d);}(_0x6f2d,0x182));var _0xd6f2=function(_0x473e31,_0x70e4e1){_0x473e31=_0x473e31-0x0;var _0x550d7=_0x6f2d[_0x473e31];return _0x550d7;};'use strict';var multer=require(_0xd6f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd6f2('0x1'));var express=require('express');var router=express[_0xd6f2('0x2')]();var fs_extra=require(_0xd6f2('0x3'));var auth=require(_0xd6f2('0x4'));var interaction=require(_0xd6f2('0x5'));var config=require(_0xd6f2('0x6'));var controller=require(_0xd6f2('0x7'));router[_0xd6f2('0x8')]('/',auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xa')]);router[_0xd6f2('0x8')](_0xd6f2('0xb'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xc')]);router[_0xd6f2('0x8')](_0xd6f2('0xd'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xe')]);router[_0xd6f2('0x8')](_0xd6f2('0xf'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x10')]);router[_0xd6f2('0x8')]('/:id/teams',auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x11')]);router[_0xd6f2('0x12')]('/',auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x13')]);router[_0xd6f2('0x12')](_0xd6f2('0xf'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x14')]);router[_0xd6f2('0x12')](_0xd6f2('0x15'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x16')]);router['put'](_0xd6f2('0xd'),auth[_0xd6f2('0x9')](),controller['update']);router[_0xd6f2('0x17')](_0xd6f2('0xd'),auth[_0xd6f2('0x9')](),controller['destroy']);router['delete'](_0xd6f2('0xf'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x18')]);router[_0xd6f2('0x17')](_0xd6f2('0x15'),auth['isAuthenticated'](),controller[_0xd6f2('0x19')]);module[_0xd6f2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 9caf32a..1ba93ef 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 _0x9527=['STRING','VIRTUAL','getDataValue','name','sequelize','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9527,0x10c));var _0x7952=function(_0x11eb25,_0xbf8925){_0x11eb25=_0x11eb25-0x0;var _0x453e78=_0x9527[_0x11eb25];return _0x453e78;};'use strict';var Sequelize=require(_0x7952('0x0'));module[_0x7952('0x1')]={'name':{'type':Sequelize[_0x7952('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x7952('0x3')],'get':function(_0x33de07){return'system-'+this[_0x7952('0x4')](_0x7952('0x5'))+'-';}},'description':{'type':Sequelize[_0x7952('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xca43=['VIRTUAL','system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca43,0xce));var _0x3ca4=function(_0x5509a7,_0x4a2c74){_0x5509a7=_0x5509a7-0x0;var _0x34ac3e=_0xca43[_0x5509a7];return _0x34ac3e;};'use strict';var Sequelize=require(_0x3ca4('0x0'));module[_0x3ca4('0x1')]={'name':{'type':Sequelize[_0x3ca4('0x2')],'allowNull':![],'unique':_0x3ca4('0x3')},'prefix':{'type':Sequelize[_0x3ca4('0x4')],'get':function(_0x536634){return _0x3ca4('0x5')+this[_0x3ca4('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x3ca4('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 21e8199..f887fe2 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8603,0x190));var _0x3860=function(_0x372e7b,_0x37289d){_0x372e7b=_0x372e7b-0x0;var _0x36b1c2=_0x8603[_0x372e7b];return _0x36b1c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0x9f0e=['limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoicePrefix','rawAttributes','key','keys','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','filters','options','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','order','pick','getAgents','getTeams','Team','User','Agents','flatMap','addTeams','each','TeamVoicePrefix','upsert','forEach','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','union','value','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','status','end','json','undefined'];(function(_0x289a1f,_0x1b4dc6){var _0x5a44ec=function(_0x341c20){while(--_0x341c20){_0x289a1f['push'](_0x289a1f['shift']());}};_0x5a44ec(++_0x1b4dc6);}(_0x9f0e,0x116));var _0xe9f0=function(_0x8a749d,_0x444b52){_0x8a749d=_0x8a749d-0x0;var _0x3d5b1c=_0x9f0e[_0x8a749d];return _0x3d5b1c;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];config['redis']=_[_0xe9f0('0x19')](config[_0xe9f0('0x1a')],{'host':_0xe9f0('0x1b'),'port':0x18eb});var socket=require(_0xe9f0('0x1c'))(new Redis(config['redis']));require(_0xe9f0('0x1d'))['register'](socket);function respondWithStatusCode(_0x1e3ba8,_0x23914b){_0x23914b=_0x23914b||0xcc;return function(_0x3800e8){if(_0x3800e8){return _0x1e3ba8['sendStatus'](_0x23914b);}return _0x1e3ba8[_0xe9f0('0x1e')](_0x23914b)[_0xe9f0('0x1f')]();};}function respondWithResult(_0x2e68ef,_0x598eee){_0x598eee=_0x598eee||0xc8;return function(_0xaa7aa6){if(_0xaa7aa6){return _0x2e68ef[_0xe9f0('0x1e')](_0x598eee)[_0xe9f0('0x20')](_0xaa7aa6);}};}function respondWithFilteredResult(_0xd71ac8,_0x3ed69a){return function(_0x2ab12b){if(_0x2ab12b){var _0x3da237=typeof _0x3ed69a['offset']===_0xe9f0('0x21')&&typeof _0x3ed69a[_0xe9f0('0x22')]===_0xe9f0('0x21');var _0x5c4182=_0x2ab12b[_0xe9f0('0x23')];var _0x30b8c7=_0x3da237?0x0:_0x3ed69a[_0xe9f0('0x24')];var _0x43f399=_0x3da237?_0x2ab12b['count']:_0x3ed69a[_0xe9f0('0x24')]+_0x3ed69a[_0xe9f0('0x22')];var _0x583687;if(_0x43f399>=_0x5c4182){_0x43f399=_0x5c4182;_0x583687=0xc8;}else{_0x583687=0xce;}_0xd71ac8['status'](_0x583687);return _0xd71ac8['set'](_0xe9f0('0x25'),_0x30b8c7+'-'+_0x43f399+'/'+_0x5c4182)[_0xe9f0('0x20')](_0x2ab12b);}return null;};}function patchUpdates(_0x1211ae){return function(_0x316cdf){try{jsonpatch[_0xe9f0('0x26')](_0x316cdf,_0x1211ae,!![]);}catch(_0x4a5c27){return BPromise[_0xe9f0('0x27')](_0x4a5c27);}return _0x316cdf[_0xe9f0('0x28')]();};}function saveUpdates(_0x437d43,_0x10801b){return function(_0x3ca991){if(_0x3ca991){return _0x3ca991[_0xe9f0('0x29')](_0x437d43)[_0xe9f0('0x2a')](function(_0x1321bb){return _0x1321bb;});}return null;};}function removeEntity(_0x3c4ba9,_0x3fce54){return function(_0x48128a){if(_0x48128a){return _0x48128a[_0xe9f0('0x2b')]()[_0xe9f0('0x2a')](function(){var _0x2ddfba=_0x48128a[_0xe9f0('0x2c')]({'plain':!![]});var _0x4cf1b1=_0xe9f0('0x2d');return db[_0xe9f0('0x2e')][_0xe9f0('0x2b')]({'where':{'type':_0x4cf1b1,'resourceId':_0x2ddfba['id']}})[_0xe9f0('0x2a')](function(){return _0x48128a;});})[_0xe9f0('0x2a')](function(){_0x3c4ba9['status'](0xcc)[_0xe9f0('0x1f')]();});}};}function handleEntityNotFound(_0xdc16bc,_0x44fb5b){return function(_0xab3d81){if(!_0xab3d81){_0xdc16bc[_0xe9f0('0x2f')](0x194);}return _0xab3d81;};}function handleError(_0xd19788,_0x1d788a){_0x1d788a=_0x1d788a||0x1f4;return function(_0x2efd33){logger[_0xe9f0('0x30')](_0x2efd33[_0xe9f0('0x31')]);if(_0x2efd33[_0xe9f0('0x32')]){delete _0x2efd33[_0xe9f0('0x32')];}_0xd19788[_0xe9f0('0x1e')](_0x1d788a)[_0xe9f0('0x33')](_0x2efd33);};}exports[_0xe9f0('0x34')]=function(_0x2097c4,_0x80e3ac){var _0x3e1846={},_0x2e7535={},_0x19d799={'count':0x0,'rows':[]};var _0x4089cc=_[_0xe9f0('0x35')](db[_0xe9f0('0x36')][_0xe9f0('0x37')],function(_0x5480ce){return{'name':_0x5480ce['fieldName'],'type':_0x5480ce['type'][_0xe9f0('0x38')]};});_0x2e7535['model']=_[_0xe9f0('0x35')](_0x4089cc,_0xe9f0('0x32'));_0x2e7535['query']=_[_0xe9f0('0x39')](_0x2097c4['query']);_0x2e7535['filters']=_['intersection'](_0x2e7535[_0xe9f0('0x3a')],_0x2e7535[_0xe9f0('0x3b')]);_0x3e1846['attributes']=_[_0xe9f0('0x3c')](_0x2e7535[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x2097c4['query']['fields']));_0x3e1846[_0xe9f0('0x3e')]=_0x3e1846[_0xe9f0('0x3e')][_0xe9f0('0x3f')]?_0x3e1846['attributes']:_0x2e7535[_0xe9f0('0x3a')];if(!_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x40')](_0xe9f0('0x41'))){_0x3e1846[_0xe9f0('0x22')]=qs['limit'](_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0x3e1846[_0xe9f0('0x24')]=qs['offset'](_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x24')]);}_0x3e1846['order']=qs[_0xe9f0('0x42')](_0x2097c4['query'][_0xe9f0('0x42')]);_0x3e1846['where']=qs['filters'](_['pick'](_0x2097c4['query'],_0x2e7535['filters']),_0x4089cc);if(_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0x3e1846[_0xe9f0('0x44')]=_[_0xe9f0('0x45')](_0x3e1846[_0xe9f0('0x44')],{'$or':_[_0xe9f0('0x35')](_0x4089cc,function(_0x3d4eb7){if(_0x3d4eb7[_0xe9f0('0x46')]!==_0xe9f0('0x47')){var _0x4e1c68={};_0x4e1c68[_0x3d4eb7[_0xe9f0('0x32')]]={'$like':'%'+_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x4e1c68;}})});}_0x3e1846=_['merge']({},_0x3e1846,_0x2097c4['options']);var _0x3cbf49={'where':_0x3e1846['where']};return db[_0xe9f0('0x36')][_0xe9f0('0x23')](_0x3cbf49)[_0xe9f0('0x2a')](function(_0x42d9d2){_0x19d799['count']=_0x42d9d2;if(_0x2097c4[_0xe9f0('0x3b')][_0xe9f0('0x48')]){_0x3e1846[_0xe9f0('0x49')]=[{'all':!![]}];}return db[_0xe9f0('0x36')][_0xe9f0('0x4a')](_0x3e1846);})['then'](function(_0x60a40d){_0x19d799[_0xe9f0('0x4b')]=_0x60a40d;return _0x19d799;})[_0xe9f0('0x2a')](respondWithFilteredResult(_0x80e3ac,_0x3e1846))[_0xe9f0('0x4c')](handleError(_0x80e3ac,null));};exports[_0xe9f0('0x4d')]=function(_0x4ffc17,_0x3a8d1d){var _0x54ab8f={'raw':![],'where':{'id':_0x4ffc17[_0xe9f0('0x4e')]['id']}},_0x54e432={};_0x54e432[_0xe9f0('0x3a')]=_['keys'](db[_0xe9f0('0x36')][_0xe9f0('0x37')]);_0x54e432[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x4ffc17[_0xe9f0('0x3b')]);_0x54e432[_0xe9f0('0x4f')]=_[_0xe9f0('0x3c')](_0x54e432['model'],_0x54e432[_0xe9f0('0x3b')]);_0x54ab8f['attributes']=_[_0xe9f0('0x3c')](_0x54e432['model'],qs[_0xe9f0('0x3d')](_0x4ffc17['query'][_0xe9f0('0x3d')]));_0x54ab8f[_0xe9f0('0x3e')]=_0x54ab8f[_0xe9f0('0x3e')]['length']?_0x54ab8f[_0xe9f0('0x3e')]:_0x54e432[_0xe9f0('0x3a')];if(_0x4ffc17[_0xe9f0('0x3b')][_0xe9f0('0x48')]){_0x54ab8f[_0xe9f0('0x49')]=[{'all':!![]}];}_0x54ab8f=_[_0xe9f0('0x45')]({},_0x54ab8f,_0x4ffc17[_0xe9f0('0x50')]);return db[_0xe9f0('0x36')][_0xe9f0('0x51')](_0x54ab8f)[_0xe9f0('0x2a')](handleEntityNotFound(_0x3a8d1d,null))[_0xe9f0('0x2a')](respondWithResult(_0x3a8d1d,null))[_0xe9f0('0x4c')](handleError(_0x3a8d1d,null));};exports['destroy']=function(_0x55e898,_0x31aa19){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x55e898['params']['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x31aa19,null))['then'](removeEntity(_0x31aa19,null))[_0xe9f0('0x4c')](handleError(_0x31aa19,null));};exports[_0xe9f0('0x52')]=function(_0x31770f,_0x4e8416){return db['VoicePrefix'][_0xe9f0('0x52')]()[_0xe9f0('0x2a')](respondWithResult(_0x4e8416,null))['catch'](handleError(_0x4e8416,null));};exports[_0xe9f0('0x53')]=function(_0xafb4d7,_0x33f26c){var _0xa26972;return db['sequelize'][_0xe9f0('0x54')](function(_0x3a5d19){return db[_0xe9f0('0x36')][_0xe9f0('0x53')](_0xafb4d7[_0xe9f0('0x55')],{'transaction':_0x3a5d19})[_0xe9f0('0x2a')](function(_0x1cba23){_0xa26972=_0x1cba23[_0xe9f0('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0xe9f0('0x51')]({'where':{'id':_0xa26972[_0xe9f0('0x56')]},'raw':!![]})[_0xe9f0('0x2a')](function(_0x4728e7){return createVoicePrefixExtensions(_0xa26972,_0x4728e7,_0x3a5d19);});});})[_0xe9f0('0x2a')](function(){var _0xe67052=_0xafb4d7[_0xe9f0('0x57')][_0xe9f0('0x2c')]({'plain':!![]});if(!_0xe67052)throw new Error(_0xe9f0('0x58'));if(_0xe67052[_0xe9f0('0x59')]===_0xe9f0('0x57')){var _0x3c26ac=_0xa26972;return db[_0xe9f0('0x5a')][_0xe9f0('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0xe67052[_0xe9f0('0x5b')]},'raw':!![]})[_0xe9f0('0x2a')](function(_0x52bcce){if(_0x52bcce&&_0x52bcce['autoAssociation']===0x0){return db['UserProfileResource'][_0xe9f0('0x53')]({'name':_0x3c26ac['name'],'resourceId':_0x3c26ac['id'],'type':_0x52bcce[_0xe9f0('0x32')],'sectionId':_0x52bcce['id']},{})[_0xe9f0('0x2a')](function(){return _0xa26972;});}else{return _0xa26972;}})[_0xe9f0('0x4c')](function(_0x4c983e){logger[_0xe9f0('0x30')](_0xe9f0('0x5c'),_0x4c983e);throw _0x4c983e;});}return _0xa26972;})[_0xe9f0('0x2a')](respondWithResult(_0x33f26c,null))[_0xe9f0('0x4c')](handleError(_0x33f26c,null));};function Extension(_0x4bb39d,_0x392eae,_0x3a05e7,_0x28a66e){this[_0xe9f0('0x5d')]='from-sip';this['exten']=_0x4bb39d;this[_0xe9f0('0x5e')]=_0x3a05e7;this[_0xe9f0('0x46')]=_0xe9f0('0x5f');this[_0xe9f0('0x60')]=_0xe9f0('0x61');this['priority']=_0x392eae;this[_0xe9f0('0x62')]=_0x28a66e;}function createVoicePrefixExtensions(_0x55ce2d,_0x16b3c0,_0x5858a9){return new BPromise(function(_0x7c05aa,_0x15ece3){var _0x8b26f2=new Extension(formatPrefixName(_0x55ce2d[_0xe9f0('0x63')]),0x1,_0xe9f0('0x64'),'Voice\x20Prefix');_0x8b26f2['VoicePrefixId']=_0x55ce2d['id'];return db['VoiceExtension'][_0xe9f0('0x53')](_0x8b26f2,{'transaction':_0x5858a9})[_0xe9f0('0x2a')](function(_0x4f6f7c){var _0x2fd3b2=_0x4f6f7c['get']({'plain':!![]});var _0x4f6a5b=_[_0xe9f0('0x35')](addVoicePrefixExtensions(_0x55ce2d,_0x16b3c0),function(_0x329e9e){_0x329e9e[_0xe9f0('0x56')]=_0x2fd3b2['id'];_0x329e9e[_0xe9f0('0x65')]=_0x55ce2d['id'];return _0x329e9e;});return db[_0xe9f0('0x66')][_0xe9f0('0x67')](_0x4f6a5b,{'transaction':_0x5858a9})['then'](function(_0x5e4ad4){if(!_0x5e4ad4){return _0x15ece3(_0xe9f0('0x68'));}else{return _0x7c05aa(_0x5e4ad4);}})[_0xe9f0('0x4c')](function(_0x12d40a){return _0x15ece3(_0x12d40a);});});;});};function addVoicePrefixExtensions(_0x1f57a1,_0x55dae1){var _0xb9b439=[];var _0x83dea9=formatPrefixName(_0x1f57a1[_0xe9f0('0x63')]);_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x2,_0xe9f0('0x6a'),_0xe9f0('0x6b')+_0x1f57a1['name']));if(_0x1f57a1[_0xe9f0('0x6c')]){_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x3,_0xe9f0('0x6a'),_0xe9f0('0x6d')+_0x1f57a1[_0xe9f0('0x6c')]));}else{_0xb9b439['push'](new Extension(_0x83dea9,0x3,_0xe9f0('0x64'),_0xe9f0('0x6e')));}_0xb9b439[_0xe9f0('0x69')](new Extension(_0x83dea9,0x4,_0xe9f0('0x6f'),_0x55dae1[_0xe9f0('0x5d')]+','+_0xe9f0('0x70')+(0x8+_0x1f57a1[_0xe9f0('0x32')][_0xe9f0('0x3f')])+'}'+','+0x1));return _0xb9b439;}function formatPrefixName(_0x2eaead){var _0x27e6bc='_';for(var _0xeaab41=0x0;_0xeaab41<_0x2eaead[_0xe9f0('0x3f')];_0xeaab41++){if(_0x2eaead['charAt'](_0xeaab41)=='-'){_0x27e6bc+=_0x2eaead[_0xe9f0('0x71')](_0xeaab41);}else{_0x27e6bc+='['+_0x2eaead[_0xe9f0('0x71')](_0xeaab41)+']';}}_0x27e6bc+='.';return _0x27e6bc;}exports[_0xe9f0('0x29')]=function(_0x116ec5,_0x3c700e,_0x2428aa){var _0x158e44=_0x116ec5['body'];_0x158e44[_0xe9f0('0x63')]=_0xe9f0('0x72')+_0x158e44['name']+'-';return db[_0xe9f0('0x73')][_0xe9f0('0x54')](function(_0x442b78){return db['VoicePrefix'][_0xe9f0('0x29')](_0x158e44,{'where':{'id':_0x158e44['id']},'transaction':_0x442b78})[_0xe9f0('0x2a')](function(){return db['VoiceExtension'][_0xe9f0('0x2b')]({'where':{'VoicePrefixId':_0x158e44['id']},'transaction':_0x442b78})[_0xe9f0('0x2a')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x158e44[_0xe9f0('0x56')]},'raw':!![]})['then'](function(_0x386d7b){return createVoicePrefixExtensions(_0x158e44,_0x386d7b,_0x442b78);});});});})[_0xe9f0('0x2a')](function(){return db['VoicePrefix'][_0xe9f0('0x74')](_0x158e44['id']);})[_0xe9f0('0x2a')](respondWithResult(_0x3c700e,null))[_0xe9f0('0x4c')](handleError(_0x3c700e,null));};exports[_0xe9f0('0x75')]=function(_0x161ee4,_0x8096c2,_0x42e4e9){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x161ee4['params']['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x8096c2,null))[_0xe9f0('0x2a')](function(_0xe7fdb){if(_0xe7fdb){return _0xe7fdb[_0xe9f0('0x75')](_0x161ee4[_0xe9f0('0x55')][_0xe9f0('0x76')],_[_0xe9f0('0x77')](_0x161ee4[_0xe9f0('0x55')],['ids','id'])||{})[_0xe9f0('0x78')](function(_0x17c18c){for(var _0x2ce60c=0x0;_0x2ce60c<_0x161ee4[_0xe9f0('0x55')][_0xe9f0('0x76')][_0xe9f0('0x3f')];_0x2ce60c+=0x1){socket['emit'](_0xe9f0('0x79'),{'UserId':Number(_0x161ee4['body']['ids'][_0x2ce60c]),'VoicePrefixId':Number(_0x161ee4['params']['id'])});}return _0x17c18c;});}})[_0xe9f0('0x2a')](respondWithResult(_0x8096c2,null))[_0xe9f0('0x4c')](handleError(_0x8096c2,null));};exports[_0xe9f0('0x7a')]=function(_0x3b5b57,_0x2bf006,_0x8f8df5){return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x3b5b57[_0xe9f0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2bf006,null))[_0xe9f0('0x2a')](function(_0x29eee2){if(_0x29eee2){return _0x29eee2[_0xe9f0('0x7a')](_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')])[_0xe9f0('0x2a')](function(){if(_[_0xe9f0('0x7b')](_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')])){for(var _0x1a4217=0x0;_0x1a4217<_0x3b5b57['query']['ids'][_0xe9f0('0x3f')];_0x1a4217+=0x1){socket[_0xe9f0('0x7c')](_0xe9f0('0x7d'),{'UserId':Number(_0x3b5b57[_0xe9f0('0x3b')][_0xe9f0('0x76')][_0x1a4217]),'VoicePrefixId':Number(_0x3b5b57[_0xe9f0('0x4e')]['id'])});}}else{socket[_0xe9f0('0x7c')](_0xe9f0('0x7d'),{'UserId':Number(_0x3b5b57['query']['ids']),'VoicePrefixId':Number(_0x3b5b57[_0xe9f0('0x4e')]['id'])});}});}})[_0xe9f0('0x2a')](respondWithStatusCode(_0x2bf006,null))['catch'](handleError(_0x2bf006,null));};exports['getAgents']=function(_0x2c9d84,_0x145040,_0x3ed26a){var _0xab92b={};var _0x2f73cd={};var _0x5553df;var _0x20c026;return db[_0xe9f0('0x36')][_0xe9f0('0x7e')]({'where':{'id':_0x2c9d84[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](handleEntityNotFound(_0x145040,null))[_0xe9f0('0x2a')](function(_0x2aca09){if(_0x2aca09){_0x5553df=_0x2aca09;_0x2f73cd['model']=_['keys'](db['User'][_0xe9f0('0x37')]);_0x2f73cd[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x2c9d84[_0xe9f0('0x3b')]);_0x2f73cd['filters']=_[_0xe9f0('0x3c')](_0x2f73cd['model'],_0x2f73cd[_0xe9f0('0x3b')]);_0xab92b['attributes']=_[_0xe9f0('0x3c')](_0x2f73cd[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x3d')]));_0xab92b[_0xe9f0('0x3e')]=_0xab92b['attributes'][_0xe9f0('0x3f')]?_0xab92b[_0xe9f0('0x3e')]:_0x2f73cd[_0xe9f0('0x3a')];_0xab92b[_0xe9f0('0x7f')]=qs[_0xe9f0('0x42')](_0x2c9d84['query'][_0xe9f0('0x42')]);_0xab92b[_0xe9f0('0x44')]=qs['filters'](_[_0xe9f0('0x80')](_0x2c9d84['query'],_0x2f73cd[_0xe9f0('0x4f')]));if(_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0xab92b['where']=_[_0xe9f0('0x45')](_0xab92b[_0xe9f0('0x44')],{'$or':_[_0xe9f0('0x35')](_0xab92b['attributes'],function(_0x2a5d79){var _0x473f78={};_0x473f78[_0x2a5d79]={'$like':'%'+_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x473f78;})});}_0xab92b=_[_0xe9f0('0x45')]({},_0xab92b,_0x2c9d84[_0xe9f0('0x50')]);return _0x5553df[_0xe9f0('0x81')](_0xab92b);}})['then'](function(_0x4a416c){if(_0x4a416c){_0x20c026=_0x4a416c[_0xe9f0('0x3f')];if(!_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x40')]('nolimit')){_0xab92b[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0xab92b['offset']=qs['offset'](_0x2c9d84[_0xe9f0('0x3b')][_0xe9f0('0x24')]);}return _0x5553df['getAgents'](_0xab92b);}})[_0xe9f0('0x2a')](function(_0x5b26b1){if(_0x5b26b1){return _0x5b26b1?{'count':_0x20c026,'rows':_0x5b26b1}:null;}})['then'](respondWithResult(_0x145040,null))[_0xe9f0('0x4c')](handleError(_0x145040,null));};exports[_0xe9f0('0x82')]=function(_0x77b59d,_0x32ad0e,_0x10c4cf){var _0x563f55={};var _0x5761d3={};var _0x3e323e;var _0x41c1a9;return db[_0xe9f0('0x36')][_0xe9f0('0x7e')]({'where':{'id':_0x77b59d[_0xe9f0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32ad0e,null))['then'](function(_0x5ae1ce){if(_0x5ae1ce){_0x3e323e=_0x5ae1ce;_0x5761d3[_0xe9f0('0x3a')]=_['keys'](db[_0xe9f0('0x83')][_0xe9f0('0x37')]);_0x5761d3[_0xe9f0('0x3b')]=_[_0xe9f0('0x39')](_0x77b59d[_0xe9f0('0x3b')]);_0x5761d3[_0xe9f0('0x4f')]=_['intersection'](_0x5761d3['model'],_0x5761d3[_0xe9f0('0x3b')]);_0x563f55[_0xe9f0('0x3e')]=_[_0xe9f0('0x3c')](_0x5761d3[_0xe9f0('0x3a')],qs[_0xe9f0('0x3d')](_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x3d')]));_0x563f55[_0xe9f0('0x3e')]=_0x563f55[_0xe9f0('0x3e')][_0xe9f0('0x3f')]?_0x563f55[_0xe9f0('0x3e')]:_0x5761d3[_0xe9f0('0x3a')];_0x563f55[_0xe9f0('0x7f')]=qs[_0xe9f0('0x42')](_0x77b59d['query'][_0xe9f0('0x42')]);_0x563f55[_0xe9f0('0x44')]=qs[_0xe9f0('0x4f')](_[_0xe9f0('0x80')](_0x77b59d[_0xe9f0('0x3b')],_0x5761d3[_0xe9f0('0x4f')]));if(_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x43')]){_0x563f55[_0xe9f0('0x44')]=_[_0xe9f0('0x45')](_0x563f55[_0xe9f0('0x44')],{'$or':_['map'](_0x563f55[_0xe9f0('0x3e')],function(_0x2b9c16){var _0x41ef5b={};_0x41ef5b[_0x2b9c16]={'$like':'%'+_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x43')]+'%'};return _0x41ef5b;})});}_0x563f55=_[_0xe9f0('0x45')]({},_0x563f55,_0x77b59d[_0xe9f0('0x50')]);return _0x3e323e[_0xe9f0('0x82')](_0x563f55);}})['then'](function(_0x5c5ac9){if(_0x5c5ac9){_0x41c1a9=_0x5c5ac9[_0xe9f0('0x3f')];if(!_0x77b59d[_0xe9f0('0x3b')]['hasOwnProperty']('nolimit')){_0x563f55[_0xe9f0('0x22')]=qs[_0xe9f0('0x22')](_0x77b59d[_0xe9f0('0x3b')][_0xe9f0('0x22')]);_0x563f55[_0xe9f0('0x24')]=qs[_0xe9f0('0x24')](_0x77b59d['query'][_0xe9f0('0x24')]);}return _0x3e323e[_0xe9f0('0x82')](_0x563f55);}})['then'](function(_0x4d59c0){if(_0x4d59c0){return _0x4d59c0?{'count':_0x41c1a9,'rows':_0x4d59c0}:null;}})[_0xe9f0('0x2a')](respondWithResult(_0x32ad0e,null))[_0xe9f0('0x4c')](handleError(_0x32ad0e,null));};exports['addTeams']=function(_0x17013a,_0x63e374,_0x34eda8){var _0x5a38f4=_0x17013a[_0xe9f0('0x55')][_0xe9f0('0x76')];var _0x2a607b;return db[_0xe9f0('0x83')]['findAll']({'where':{'id':_0x5a38f4},'attributes':['id'],'include':[{'model':db[_0xe9f0('0x84')],'as':_0xe9f0('0x85'),'attributes':['id',_0xe9f0('0x32'),'online','voicePause','interface'],'raw':!![]}]})[_0xe9f0('0x2a')](function(_0x58db9d){if(_0x58db9d){_0x2a607b=_0x58db9d;var _0x4820a1=_[_0xe9f0('0x86')](_0x58db9d,function(_0x4cd8bc){var _0x1b2532=_0x4cd8bc[_0xe9f0('0x2c')]({'plain':!![]});return _0x1b2532[_0xe9f0('0x85')];});return db[_0xe9f0('0x36')]['find']({'where':{'id':_0x17013a[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](function(_0x231d94){return db[_0xe9f0('0x73')][_0xe9f0('0x54')](function(_0x25c2f6){return _0x231d94[_0xe9f0('0x87')](_0x5a38f4,{'transaction':_0x25c2f6})[_0xe9f0('0x2a')](function(){return BPromise[_0xe9f0('0x88')](_0x2a607b,function(_0x2cd0a5){return db[_0xe9f0('0x89')][_0xe9f0('0x8a')]({'TeamId':_0x2cd0a5['id'],'VoicePrefixId':_0x17013a[_0xe9f0('0x4e')]['id']},{'transaction':_0x25c2f6});});})['then'](function(){return BPromise[_0xe9f0('0x88')](_0x4820a1,function(_0x1d8fb5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x1d8fb5['id'],'VoicePrefixId':_0x17013a[_0xe9f0('0x4e')]['id']},'transaction':_0x25c2f6});});})[_0xe9f0('0x2a')](function(){_0x4820a1[_0xe9f0('0x8b')](function(_0x1c0db4){socket['emit'](_0xe9f0('0x79'),{'UserId':_0x1c0db4['id'],'VoicePrefixId':_0x231d94['id']});});});});});}})[_0xe9f0('0x2a')](respondWithStatusCode(_0x63e374,null))[_0xe9f0('0x4c')](handleError(_0x63e374,null));};exports['removeTeams']=function(_0x448834,_0x116aec,_0x4398fd){return db[_0xe9f0('0x83')][_0xe9f0('0x4a')]({'where':{'id':_0x448834['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe9f0('0x84')],'as':_0xe9f0('0x85'),'attributes':['id'],'raw':!![]}]})[_0xe9f0('0x2a')](handleEntityNotFound(_0x116aec,null))[_0xe9f0('0x2a')](function(_0x13ad0d){var _0x1b4977=_[_0xe9f0('0x35')](_0x13ad0d,'id');var _0x34f99d=[];var _0x5ae9f1=[];var _0x1aacfa=squel['select']();_0x1aacfa['field'](_0xe9f0('0x8c'))[_0xe9f0('0x8d')](_0xe9f0('0x8e'),'tq')['join'](_0xe9f0('0x8f'),'ut',_0xe9f0('0x90'))['where'](_0xe9f0('0x91'),_0x448834[_0xe9f0('0x4e')]['id']);for(var _0x14e369=0x0;_0x14e369<_0x13ad0d[_0xe9f0('0x3f')];_0x14e369+=0x1){let _0x56e09f=_0x13ad0d[_0x14e369];for(var _0x25750e=0x0;_0x25750e<_0x56e09f['Agents'][_0xe9f0('0x3f')];_0x25750e+=0x1){let _0x56e47c=_0x56e09f['Agents'][_0x25750e];var _0x58d863=_0x1aacfa[_0xe9f0('0x92')]();_0x58d863[_0xe9f0('0x44')]('ut.UserId\x20=\x20?',_0x56e47c['id']);_0x5ae9f1[_0xe9f0('0x69')](db[_0xe9f0('0x73')][_0xe9f0('0x3b')](_0x58d863[_0xe9f0('0x93')](),{'type':db[_0xe9f0('0x73')][_0xe9f0('0x94')][_0xe9f0('0x95')]})['then'](function(_0x5b10a5){if(_0x5b10a5[_0xe9f0('0x3f')]===0x1){return _0x56e47c['id'];}else{var _0x32eb6c=_['every'](_[_0xe9f0('0x35')](_0x5b10a5,_0xe9f0('0x96')),function(_0x96e959){return _['includes'](_0x1b4977,_0x96e959);});if(_0x32eb6c){return _0x56e47c['id'];}}}));}}return BPromise[_0xe9f0('0x97')](_0x5ae9f1)[_0xe9f0('0x2a')](function(_0x59fbca){_0x34f99d=_(_0x34f99d)[_0xe9f0('0x98')](_0x59fbca)['compact']()[_0xe9f0('0x99')]();return db[_0xe9f0('0x36')][_0xe9f0('0x51')]({'where':{'id':_0x448834[_0xe9f0('0x4e')]['id']}})[_0xe9f0('0x2a')](function(_0x305d2f){return db['sequelize'][_0xe9f0('0x54')](function(_0x17f9bd){return _0x305d2f[_0xe9f0('0x9a')](_0x448834[_0xe9f0('0x3b')][_0xe9f0('0x76')],{'transaction':_0x17f9bd})[_0xe9f0('0x2a')](function(){if(!_[_0xe9f0('0x9b')](_0x34f99d)){return _0x305d2f['removeAgents'](_0x34f99d,{'transaction':_0x17f9bd});}})['then'](function(){_0x34f99d[_0xe9f0('0x8b')](function(_0x3e8745){socket['emit'](_0xe9f0('0x7d'),{'UserId':_0x3e8745,'VoicePrefixId':_0x305d2f['id']});});});});});});})['then'](respondWithStatusCode(_0x116aec,null))[_0xe9f0('0x4c')](handleError(_0x116aec,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a6b970c..65bd66e 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 _0x8dcc=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x3dfa11,_0x506b2d){var _0x4edd90=function(_0x1841e9){while(--_0x1841e9){_0x3dfa11['push'](_0x3dfa11['shift']());}};_0x4edd90(++_0x506b2d);}(_0x8dcc,0x13a));var _0xc8dc=function(_0x284e5f,_0x130a54){_0x284e5f=_0x284e5f-0x0;var _0x86d83=_0x8dcc[_0x284e5f];return _0x86d83;};'use strict';var EventEmitter=require(_0xc8dc('0x0'));var VoicePrefix=require(_0xc8dc('0x1'))['db'][_0xc8dc('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc8dc('0x3')](0x0);var events={'afterCreate':_0xc8dc('0x4'),'afterUpdate':_0xc8dc('0x5'),'afterDestroy':_0xc8dc('0x6')};function emitEvent(_0x2b5ba5){return function(_0x447f69,_0xbaa565,_0x3f1311){VoicePrefixEvents[_0xc8dc('0x7')](_0x2b5ba5+':'+_0x447f69['id'],_0x447f69);VoicePrefixEvents[_0xc8dc('0x7')](_0x2b5ba5,_0x447f69);_0x3f1311(null);};}for(var e in events){if(events[_0xc8dc('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xa2f8=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa2f8,0x1df));var _0x8a2f=function(_0x3b7295,_0x4ed9cc){_0x3b7295=_0x3b7295-0x0;var _0x26e3cf=_0xa2f8[_0x3b7295];return _0x26e3cf;};'use strict';var EventEmitter=require(_0x8a2f('0x0'));var VoicePrefix=require(_0x8a2f('0x1'))['db'][_0x8a2f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8a2f('0x3')](0x0);var events={'afterCreate':_0x8a2f('0x4'),'afterUpdate':_0x8a2f('0x5'),'afterDestroy':_0x8a2f('0x6')};function emitEvent(_0x370048){return function(_0x4958e0,_0x3e3c6b,_0x1aa7ac){VoicePrefixEvents[_0x8a2f('0x7')](_0x370048+':'+_0x4958e0['id'],_0x4958e0);VoicePrefixEvents['emit'](_0x370048,_0x4958e0);_0x1aa7ac(null);};}for(var e in events){if(events[_0x8a2f('0x8')](e)){var event=events[e];VoicePrefix[_0x8a2f('0x9')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f87459c..9c234d8 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 _0x3d13=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x40d075,_0x146ebf){var _0xfebe63=function(_0x4199ed){while(--_0x4199ed){_0x40d075['push'](_0x40d075['shift']());}};_0xfebe63(++_0x146ebf);}(_0x3d13,0x6d));var _0x33d1=function(_0x232147,_0x241aaa){_0x232147=_0x232147-0x0;var _0x462788=_0x3d13[_0x232147];return _0x462788;};'use strict';var _=require('lodash');var util=require(_0x33d1('0x0'));var logger=require(_0x33d1('0x1'))(_0x33d1('0x2'));var moment=require(_0x33d1('0x3'));var BPromise=require(_0x33d1('0x4'));var rp=require(_0x33d1('0x5'));var fs=require('fs');var path=require(_0x33d1('0x6'));var rimraf=require(_0x33d1('0x7'));var config=require(_0x33d1('0x8'));var attributes=require(_0x33d1('0x9'));module[_0x33d1('0xa')]=function(_0x312a58,_0x256280){return _0x312a58[_0x33d1('0xb')](_0x33d1('0xc'),attributes,{'tableName':_0x33d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2485=['../../config/environment','exports','define','VoicePrefix','lodash','util','api','moment','rimraf'];(function(_0x1ccfc0,_0x5d9ec4){var _0x41b00e=function(_0x1a05c3){while(--_0x1a05c3){_0x1ccfc0['push'](_0x1ccfc0['shift']());}};_0x41b00e(++_0x5d9ec4);}(_0x2485,0x148));var _0x5248=function(_0x438075,_0x59ca9e){_0x438075=_0x438075-0x0;var _0x3c2ff0=_0x2485[_0x438075];return _0x3c2ff0;};'use strict';var _=require(_0x5248('0x0'));var util=require(_0x5248('0x1'));var logger=require('../../config/logger')(_0x5248('0x2'));var moment=require(_0x5248('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5248('0x4'));var config=require(_0x5248('0x5'));var attributes=require('./voicePrefix.attributes');module[_0x5248('0x6')]=function(_0x16482d,_0x532421){return _0x16482d[_0x5248('0x7')](_0x5248('0x8'),attributes,{'tableName':'voice_prefixes','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 84aba97..57dc46d 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 _0x36fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x2042e7,_0x2cfeb1){var _0x4cbe86=function(_0x55bf81){while(--_0x55bf81){_0x2042e7['push'](_0x2042e7['shift']());}};_0x4cbe86(++_0x2cfeb1);}(_0x36fe,0x127));var _0xe36f=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x36fe[_0x274dd7];return _0x148829;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});config[_0xe36f('0xc')]=_[_0xe36f('0xd')](config['redis'],{'host':_0xe36f('0xe'),'port':0x18eb});var socket=require(_0xe36f('0xf'))(new Redis(config['redis']));require(_0xe36f('0x10'))[_0xe36f('0x11')](socket);function respondWithRpcPromise(_0xa26c3d,_0x44bc2f,_0x3d036f){return new BPromise(function(_0x5b23ff,_0x212ff9){return client['request'](_0xa26c3d,_0x3d036f)[_0xe36f('0x12')](function(_0x2b1c1c){logger[_0xe36f('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'));logger[_0xe36f('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'),JSON[_0xe36f('0x16')](_0x2b1c1c));if(_0x2b1c1c[_0xe36f('0x17')]){if(_0x2b1c1c[_0xe36f('0x17')]['code']===0x1f4){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')]['message']);return _0x212ff9(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}logger['error'](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);return _0x5b23ff(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}else{logger[_0xe36f('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x44bc2f,'request\x20sent');_0x5b23ff(_0x2b1c1c['result']['message']);}})[_0xe36f('0x1a')](function(_0x2d6409){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2d6409);_0x212ff9(_0x2d6409);});});} \ No newline at end of file +var _0x1c01=['jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x1d120f,_0x110650){var _0x5abe48=function(_0x277dce){while(--_0x277dce){_0x1d120f['push'](_0x1d120f['shift']());}};_0x5abe48(++_0x110650);}(_0x1c01,0x190));var _0x11c0=function(_0x46f20e,_0x2c567c){_0x46f20e=_0x46f20e-0x0;var _0x53de74=_0x1c01[_0x46f20e];return _0x53de74;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});config[_0x11c0('0xa')]=_['defaults'](config[_0x11c0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x11c0('0xb'))(new Redis(config['redis']));require(_0x11c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x5de14e,_0xba38f,_0x5e8002){return new BPromise(function(_0x426122,_0x39b2ac){return client[_0x11c0('0xd')](_0x5de14e,_0x5e8002)[_0x11c0('0xe')](function(_0x3cc04b){logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));logger[_0x11c0('0x11')](_0x11c0('0x12'),_0xba38f,'request\x20sent',JSON['stringify'](_0x3cc04b));if(_0x3cc04b[_0x11c0('0x13')]){if(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x14')]===0x1f4){logger[_0x11c0('0x13')](_0x11c0('0xf'),_0xba38f,_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);return _0x39b2ac(_0x3cc04b['error'][_0x11c0('0x15')]);}logger['error'](_0x11c0('0xf'),_0xba38f,_0x3cc04b['error'][_0x11c0('0x15')]);return _0x426122(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);}else{logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));_0x426122(_0x3cc04b[_0x11c0('0x16')][_0x11c0('0x15')]);}})[_0x11c0('0x17')](function(_0x3d0a2e){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xba38f,_0x3d0a2e);_0x39b2ac(_0x3d0a2e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 240ebb8..f08eb8f 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 _0x6324=['./voicePrefix.events','save','remove','update','emit','register','voicePrefix:'];(function(_0x499f34,_0xcace62){var _0x1a9aae=function(_0x1b870b){while(--_0x1b870b){_0x499f34['push'](_0x499f34['shift']());}};_0x1a9aae(++_0xcace62);}(_0x6324,0x142));var _0x4632=function(_0x31a4fd,_0x4e25ab){_0x31a4fd=_0x31a4fd-0x0;var _0x529fb2=_0x6324[_0x31a4fd];return _0x529fb2;};'use strict';var VoicePrefixEvents=require(_0x4632('0x0'));var events=[_0x4632('0x1'),_0x4632('0x2'),_0x4632('0x3')];function createListener(_0x551054,_0x1805c5){return function(_0x48e508){_0x1805c5[_0x4632('0x4')](_0x551054,_0x48e508);};}function removeListener(_0x54c200,_0x13b218){return function(){VoicePrefixEvents['removeListener'](_0x54c200,_0x13b218);};}exports[_0x4632('0x5')]=function(_0x24aba6){for(var _0x1f3077=0x0,_0x126e9a=events['length'];_0x1f3077<_0x126e9a;_0x1f3077++){var _0x17e860=events[_0x1f3077];var _0x44dd6d=createListener(_0x4632('0x6')+_0x17e860,_0x24aba6);VoicePrefixEvents['on'](_0x17e860,_0x44dd6d);}}; \ No newline at end of file +var _0x579c=['voicePrefix:','./voicePrefix.events','save','remove','update','removeListener','register'];(function(_0x7c2159,_0x8fcf7d){var _0x32b147=function(_0x529b6e){while(--_0x529b6e){_0x7c2159['push'](_0x7c2159['shift']());}};_0x32b147(++_0x8fcf7d);}(_0x579c,0xda));var _0xc579=function(_0x859db3,_0x32484e){_0x859db3=_0x859db3-0x0;var _0x5e9f2a=_0x579c[_0x859db3];return _0x5e9f2a;};'use strict';var VoicePrefixEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){VoicePrefixEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);VoicePrefixEvents['on'](_0x1c6d9c,_0x293c4a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 06388a8..f4022f9 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x7738a7,_0x2fc935){var _0x4302a2=function(_0x44d40c){while(--_0x44d40c){_0x7738a7['push'](_0x7738a7['shift']());}};_0x4302a2(++_0x2fc935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0xf75919,_0x9e603){var _0x3fdea4=function(_0x275a72){while(--_0x275a72){_0xf75919['push'](_0xf75919['shift']());}};_0x3fdea4(++_0x9e603);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 1fde6c6..0fdef7d 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 _0xa4f3=['TEXT','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','outbound','default','ringall','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xa4f3,0x11e));var _0x3a4f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa4f3[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0x3a4f('0x0'));module[_0x3a4f('0x1')]={'name':{'type':Sequelize[_0x3a4f('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x3a4f('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x3a4f('0x4')},'announce':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x3a4f('0x5'),'leastrecent','fewestcalls',_0x3a4f('0x6'),_0x3a4f('0x7'),_0x3a4f('0x8'),_0x3a4f('0x9'),_0x3a4f('0xa')),'allowNull':![],'defaultValue':_0x3a4f('0x5'),'set':function(_0xf7a1d8){this[_0x3a4f('0xb')](_0x3a4f('0xc'),_0xf7a1d8?_0xf7a1d8:_0x3a4f('0x7'));},'get':function(){var _0x75a04e=this['getDataValue'](_0x3a4f('0xd'));var _0x452bad=this[_0x3a4f('0xe')](_0x3a4f('0xf'));var _0x2b03ac=this[_0x3a4f('0xe')](_0x3a4f('0xc'));if(_0x75a04e===_0x3a4f('0x10')){return _0x2b03ac;}if(_0x452bad===_0x3a4f('0x11')&&_0x2b03ac==='rrmemory'||_0x452bad==='booked'&&_0x2b03ac===_0x3a4f('0x12')){return _0x2b03ac;}if(_0x452bad===_0x3a4f('0x13')||_0x452bad===_0x3a4f('0x14')||_0x452bad===_0x3a4f('0x15')){return _0x2b03ac;}return null;}},'servicelevel':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3a4f('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3a4f('0x2')]},'weight':{'type':Sequelize[_0x3a4f('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':_0x3a4f('0x18')},'autopause':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no',_0x3a4f('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3a4f('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x3a4f('0x17')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3a4f('0x17')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3a4f('0x17')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3a4f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3a4f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':_0x3a4f('0x18')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x3a4f('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3a4f('0x17')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3a4f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3a4f('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3a4f('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3a4f('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3a4f('0x2')]},'queue_less_than':{'type':Sequelize[_0x3a4f('0x2')]},'periodic_announce':{'type':Sequelize[_0x3a4f('0x1a')],'set':function(_0x5054ba){this[_0x3a4f('0xb')](_0x3a4f('0x1b'),_0x5054ba?_0x5054ba[_0x3a4f('0x1c')](','):[]);},'get':function(){return this[_0x3a4f('0xe')]('periodic_announce')?this[_0x3a4f('0xe')](_0x3a4f('0x1b'))[_0x3a4f('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':_0x3a4f('0x18'),'set':function(_0x4c08cf){this['setDataValue']('joinempty',_0x4c08cf?_0x4c08cf['join'](','):undefined);},'get':function(){return this[_0x3a4f('0xe')](_0x3a4f('0x1e'))?this['getDataValue'](_0x3a4f('0x1e'))[_0x3a4f('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':'no','set':function(_0x402ef6){this[_0x3a4f('0xb')](_0x3a4f('0x1f'),_0x402ef6?_0x402ef6[_0x3a4f('0x1c')](','):undefined);},'get':function(){return this[_0x3a4f('0xe')]('leavewhenempty')?this['getDataValue'](_0x3a4f('0x1f'))[_0x3a4f('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3a4f('0x2')]},'description':{'type':Sequelize[_0x3a4f('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x45f620){this[_0x3a4f('0xb')]('acw',_0x45f620);if(_0x45f620){if(this[_0x3a4f('0xe')](_0x3a4f('0x20'))<0x2){this[_0x3a4f('0xb')](_0x3a4f('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3a4f('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3a4f('0x21')],'defaultValue':0x0,'comment':_0x3a4f('0x22')},'dialMethod':{'type':Sequelize[_0x3a4f('0x17')]('preview',_0x3a4f('0x13'),_0x3a4f('0x15'),'predictive',_0x3a4f('0x11')),'defaultValue':_0x3a4f('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3a4f('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x3a4f('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3a4f('0x24')},'dialPowerLevel':{'type':Sequelize[_0x3a4f('0x25')](0x2)[_0x3a4f('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3a4f('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x27'),_0x3a4f('0x28')),'defaultValue':_0x3a4f('0x28'),'comment':_0x3a4f('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3a4f('0x25')](0x2)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3a4f('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3a4f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3a4f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x2c')},'dialQueueProject':{'type':Sequelize[_0x3a4f('0x2')],'comment':_0x3a4f('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'comment':_0x3a4f('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3a4f('0x34')},'dialTimezone':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x3a4f('0x35')},'dialPrefix':{'type':Sequelize[_0x3a4f('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3a4f('0x17')](_0x3a4f('0x36'),_0x3a4f('0x37'),_0x3a4f('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x3a4f('0x21')],'defaultValue':0x0,'comment':_0x3a4f('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x3a4f('0x16')](0x9)[_0x3a4f('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3a4f('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x3a4f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3a4f('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3a4f('0x16')](0x9)[_0x3a4f('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3a4f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3a4f('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x3a4f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3a4f('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3a4f('0x16')](0x9)[_0x3a4f('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3a4f('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3a4f('0x16')](0x9)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3a4f('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3a4f('0x16')](0x9)[_0x3a4f('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3a4f('0x40')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3a4f('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x3a4f('0x21')],'defaultValue':0x0,'comment':_0x3a4f('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3a4f('0x17')]('DESC',_0x3a4f('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3a4f('0x2')],'comment':_0x3a4f('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3a4f('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3a4f('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3a4f('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3a4f('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3a4f('0x16')](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3a4f('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3a4f('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3a4f('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a4f('0x16')],'allowNull':!![],'comment':_0x3a4f('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x3a4f('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5bad04){if(!_0x5bad04)this[_0x3a4f('0xb')](_0x3a4f('0x4c'),null);this[_0x3a4f('0xb')](_0x3a4f('0x4d'),_0x5bad04);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3a4f('0x16')](0x3)[_0x3a4f('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3a4f('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x96ca=['inbound','default','ringall','fewestcalls','rrmemory','linear','wrandom','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','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','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','STRING','ENUM'];(function(_0x1020f8,_0x3ce839){var _0x5425a9=function(_0x1cfe6f){while(--_0x1cfe6f){_0x1020f8['push'](_0x1020f8['shift']());}};_0x5425a9(++_0x3ce839);}(_0x96ca,0x1c5));var _0xa96c=function(_0xbf3f74,_0x1ae4bf){_0xbf3f74=_0xbf3f74-0x0;var _0xd26ead=_0x96ca[_0xbf3f74];return _0xd26ead;};'use strict';var Sequelize=require(_0xa96c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa96c('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xa96c('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xa96c('0x4')},'announce':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa96c('0x2')]('rr',_0xa96c('0x5'),'leastrecent',_0xa96c('0x6'),'random',_0xa96c('0x7'),_0xa96c('0x8'),_0xa96c('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0xa96c('0x5'),'set':function(_0x2cd30c){this['setDataValue'](_0xa96c('0xa'),_0x2cd30c?_0x2cd30c:'rrmemory');},'get':function(){var _0x49ac6a=this[_0xa96c('0xb')](_0xa96c('0xc'));var _0x469198=this[_0xa96c('0xb')](_0xa96c('0xd'));var _0x39109e=this[_0xa96c('0xb')]('strategy');if(_0x49ac6a==='inbound'){return _0x39109e;}if(_0x469198===_0xa96c('0xe')&&_0x39109e===_0xa96c('0x7')||_0x469198===_0xa96c('0xe')&&_0x39109e===_0xa96c('0xf')){return _0x39109e;}if(_0x469198==='progressive'||_0x469198===_0xa96c('0x10')||_0x469198===_0xa96c('0x11')){return _0x39109e;}return null;}},'servicelevel':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no',_0xa96c('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xa96c('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa96c('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xa96c('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa96c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa96c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no',_0xa96c('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0xa96c('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa96c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa96c('0x1')]},'queue_youarenext':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa96c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa96c('0x1')]},'queue_quantity1':{'type':Sequelize[_0xa96c('0x1')]},'queue_quantity2':{'type':Sequelize[_0xa96c('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xa96c('0x1')]},'periodic_announce':{'type':Sequelize[_0xa96c('0x16')],'set':function(_0xce6d3e){this[_0xa96c('0x17')]('periodic_announce',_0xce6d3e?_0xce6d3e[_0xa96c('0x18')](','):[]);},'get':function(){return this[_0xa96c('0xb')](_0xa96c('0x19'))?this['getDataValue'](_0xa96c('0x19'))[_0xa96c('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':_0xa96c('0x13'),'set':function(_0x1df6b0){this['setDataValue'](_0xa96c('0x1b'),_0x1df6b0?_0x1df6b0[_0xa96c('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0xa96c('0x1b'))?this[_0xa96c('0xb')](_0xa96c('0x1b'))[_0xa96c('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':'no','set':function(_0x4eddc2){this['setDataValue']('leavewhenempty',_0x4eddc2?_0x4eddc2[_0xa96c('0x18')](','):undefined);},'get':function(){return this[_0xa96c('0xb')](_0xa96c('0x1c'))?this['getDataValue'](_0xa96c('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xa96c('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa96c('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa96c('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':0x0,'set':function(_0x3b897a){this[_0xa96c('0x17')]('acw',_0x3b897a);if(_0x3b897a){if(this[_0xa96c('0xb')](_0xa96c('0x1e'))<0x2){this[_0xa96c('0x17')](_0xa96c('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa96c('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':0x0,'comment':_0xa96c('0x1f')},'dialMethod':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x20'),'progressive','power',_0xa96c('0x10'),'booked'),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xa96c('0x12')](0x4)[_0xa96c('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa96c('0x22')},'dialLimitQueue':{'type':Sequelize[_0xa96c('0x12')](0x4)[_0xa96c('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa96c('0x23')},'dialPowerLevel':{'type':Sequelize[_0xa96c('0x24')](0x2)[_0xa96c('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa96c('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x26'),_0xa96c('0x27')),'defaultValue':_0xa96c('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa96c('0x24')](0x2)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa96c('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa96c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa96c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x29')},'dialQueueOptions':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':'tTxX','comment':_0xa96c('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xa96c('0x1')],'comment':_0xa96c('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x2c')},'dialBusyMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa96c('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa96c('0x31')},'dialTimezone':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xa96c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa96c('0x2')]('always',_0xa96c('0x32'),_0xa96c('0x33')),'defaultValue':_0xa96c('0x34')},'dialAMDActive':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':0x0,'comment':_0xa96c('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xa96c('0x12')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa96c('0x12')](0x9)[_0xa96c('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa96c('0x12')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa96c('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa96c('0x12')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa96c('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0xa96c('0x12')](0x9)[_0xa96c('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa96c('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa96c('0x12')](0x9)[_0xa96c('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa96c('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa96c('0x12')](0x9)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa96c('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa96c('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa96c('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':0x0,'comment':_0xa96c('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa96c('0x2')](_0xa96c('0x3d'),_0xa96c('0x3e')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xa96c('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa96c('0x3f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xa96c('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa96c('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)[_0xa96c('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa96c('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa96c('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa96c('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa96c('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':![],'comment':_0xa96c('0x4b'),'set':function(_0x705d92){if(!_0x705d92)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa96c('0x17')]('mandatoryDisposition',_0x705d92);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa96c('0x12')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa96c('0x12')](0x3)[_0xa96c('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa96c('0x1d')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index bdc1dce..bd54fd3 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 _0x12fa=['TeamVoiceQueue','upsert','each','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','NOW()','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','onlyIfOpen','into','phone\x20NOT\x20IN\x20(?)','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','redis','defaults','localhost','register','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','type','find','value','UserProfileResource','error','stack','name','send','index','map','VoiceQueue','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','rows','catch','params','includeAll','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction'];(function(_0x4ad05f,_0x2dbf78){var _0x4afc02=function(_0x5d7735){while(--_0x5d7735){_0x4ad05f['push'](_0x4ad05f['shift']());}};_0x4afc02(++_0x2dbf78);}(_0x12fa,0xfb));var _0xa12f=function(_0xb31209,_0x5d4200){_0xb31209=_0xb31209-0x0;var _0x531276=_0x12fa[_0xb31209];return _0x531276;};'use strict';var emlformat=require(_0xa12f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa12f('0x1'));var jsonpatch=require(_0xa12f('0x2'));var rp=require(_0xa12f('0x3'));var moment=require(_0xa12f('0x4'));var BPromise=require(_0xa12f('0x5'));var Mustache=require(_0xa12f('0x6'));var util=require(_0xa12f('0x7'));var path=require('path');var sox=require(_0xa12f('0x8'));var csv=require(_0xa12f('0x9'));var ejs=require(_0xa12f('0xa'));var fs=require('fs');var fs_extra=require(_0xa12f('0xb'));var _=require(_0xa12f('0xc'));var squel=require(_0xa12f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa12f('0xe'));var deskjs=require(_0xa12f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa12f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa12f('0x11'));var qs=require(_0xa12f('0x12'));var as=require(_0xa12f('0x13'));var hardwareService=require(_0xa12f('0x14'));var logger=require(_0xa12f('0x15'))(_0xa12f('0x16'));var utils=require(_0xa12f('0x17'));var config=require(_0xa12f('0x18'));var licenseUtil=require(_0xa12f('0x19'));var db=require(_0xa12f('0x1a'))['db'];config[_0xa12f('0x1b')]=_[_0xa12f('0x1c')](config[_0xa12f('0x1b')],{'host':_0xa12f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa12f('0x1b')]));require('./voiceQueue.socket')[_0xa12f('0x1e')](socket);function respondWithStatusCode(_0x387a9b,_0x3383d8){_0x3383d8=_0x3383d8||0xcc;return function(_0x517e68){if(_0x517e68){return _0x387a9b['sendStatus'](_0x3383d8);}return _0x387a9b[_0xa12f('0x1f')](_0x3383d8)[_0xa12f('0x20')]();};}function respondWithResult(_0x394e7f,_0x47f1cc){_0x47f1cc=_0x47f1cc||0xc8;return function(_0x5c62da){if(_0x5c62da){return _0x394e7f[_0xa12f('0x1f')](_0x47f1cc)[_0xa12f('0x21')](_0x5c62da);}};}function respondWithFilteredResult(_0x57baa2,_0x5a4dc8){return function(_0x594dc7){if(_0x594dc7){var _0x26c2ec=typeof _0x5a4dc8[_0xa12f('0x22')]==='undefined'&&typeof _0x5a4dc8[_0xa12f('0x23')]==='undefined';var _0xd3705f=_0x594dc7[_0xa12f('0x24')];var _0xf4fd09=_0x26c2ec?0x0:_0x5a4dc8[_0xa12f('0x22')];var _0x49e73f=_0x26c2ec?_0x594dc7['count']:_0x5a4dc8[_0xa12f('0x22')]+_0x5a4dc8[_0xa12f('0x23')];var _0xb54083;if(_0x49e73f>=_0xd3705f){_0x49e73f=_0xd3705f;_0xb54083=0xc8;}else{_0xb54083=0xce;}_0x57baa2[_0xa12f('0x1f')](_0xb54083);return _0x57baa2['set'](_0xa12f('0x25'),_0xf4fd09+'-'+_0x49e73f+'/'+_0xd3705f)[_0xa12f('0x21')](_0x594dc7);}return null;};}function patchUpdates(_0x3957e0){return function(_0x2bc93d){try{jsonpatch['apply'](_0x2bc93d,_0x3957e0,!![]);}catch(_0x123aaa){return BPromise[_0xa12f('0x26')](_0x123aaa);}return _0x2bc93d[_0xa12f('0x27')]();};}function saveUpdates(_0x3408f4,_0x39e444){return function(_0x105197){if(_0x105197){return _0x105197[_0xa12f('0x28')](_0x3408f4)[_0xa12f('0x29')](function(_0x29442f){return _0x29442f;});}return null;};}function removeEntity(_0x1bea79,_0x16b6b3){return function(_0x56ca40){if(_0x56ca40){return _0x56ca40[_0xa12f('0x2a')]()[_0xa12f('0x29')](function(){var _0x3cf68b=_0x56ca40[_0xa12f('0x2b')]({'plain':!![]});var _0x383dde=[{'name':_0xa12f('0x2c'),'value':_0xa12f('0x2d'),'ignore':![]},{'name':_0xa12f('0x2e'),'value':_0xa12f('0x2f'),'ignore':![]}];var _0x51f47c=_(_0x383dde)[_0xa12f('0x30')]('ignore')['map']('value')['value']();if(_['includes'](_0x51f47c,_0x3cf68b[_0xa12f('0x31')])){return;}var _0x52c6df=_[_0xa12f('0x32')](_0x383dde,[_0xa12f('0x33'),_0x3cf68b[_0xa12f('0x31')]])['name'];return db[_0xa12f('0x34')][_0xa12f('0x2a')]({'where':{'type':_0x52c6df,'resourceId':_0x3cf68b['id']}})[_0xa12f('0x29')](function(){return _0x56ca40;});})[_0xa12f('0x29')](function(){_0x1bea79['status'](0xcc)[_0xa12f('0x20')]();});}};}function handleEntityNotFound(_0x561f8a,_0x810d6f){return function(_0x42eba2){if(!_0x42eba2){_0x561f8a['sendStatus'](0x194);}return _0x42eba2;};}function handleError(_0x5229c2,_0x1f24a5){_0x1f24a5=_0x1f24a5||0x1f4;return function(_0x3f7a46){logger[_0xa12f('0x35')](_0x3f7a46[_0xa12f('0x36')]);if(_0x3f7a46[_0xa12f('0x37')]){delete _0x3f7a46['name'];}_0x5229c2['status'](_0x1f24a5)[_0xa12f('0x38')](_0x3f7a46);};}exports[_0xa12f('0x39')]=function(_0x3b2a50,_0xcd8db5){var _0x15664d={},_0x240b4f={},_0x37c0d9={'count':0x0,'rows':[]};var _0x544b4c=_[_0xa12f('0x3a')](db[_0xa12f('0x3b')][_0xa12f('0x3c')],function(_0x4cee6f){return{'name':_0x4cee6f[_0xa12f('0x3d')],'type':_0x4cee6f[_0xa12f('0x31')][_0xa12f('0x3e')]};});_0x240b4f['model']=_[_0xa12f('0x3a')](_0x544b4c,'name');_0x240b4f['query']=_[_0xa12f('0x3f')](_0x3b2a50[_0xa12f('0x40')]);_0x240b4f['filters']=_[_0xa12f('0x41')](_0x240b4f[_0xa12f('0x42')],_0x240b4f[_0xa12f('0x40')]);_0x15664d[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x240b4f[_0xa12f('0x42')],qs['fields'](_0x3b2a50[_0xa12f('0x40')][_0xa12f('0x44')]));_0x15664d[_0xa12f('0x43')]=_0x15664d[_0xa12f('0x43')][_0xa12f('0x45')]?_0x15664d[_0xa12f('0x43')]:_0x240b4f['model'];if(!_0x3b2a50[_0xa12f('0x40')][_0xa12f('0x46')](_0xa12f('0x47'))){_0x15664d[_0xa12f('0x23')]=qs[_0xa12f('0x23')](_0x3b2a50['query'][_0xa12f('0x23')]);_0x15664d[_0xa12f('0x22')]=qs[_0xa12f('0x22')](_0x3b2a50[_0xa12f('0x40')][_0xa12f('0x22')]);}_0x15664d[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0x3b2a50[_0xa12f('0x40')][_0xa12f('0x49')]);_0x15664d[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x3b2a50[_0xa12f('0x40')],_0x240b4f['filters']),_0x544b4c);if(_0x3b2a50[_0xa12f('0x40')][_0xa12f('0x30')]){_0x15664d[_0xa12f('0x4a')]=_[_0xa12f('0x4d')](_0x15664d[_0xa12f('0x4a')],{'$or':_[_0xa12f('0x3a')](_0x544b4c,function(_0x3be5ca){if(_0x3be5ca[_0xa12f('0x31')]!==_0xa12f('0x4e')){var _0x532fde={};_0x532fde[_0x3be5ca[_0xa12f('0x37')]]={'$like':'%'+_0x3b2a50[_0xa12f('0x40')]['filter']+'%'};return _0x532fde;}})});}_0x15664d=_[_0xa12f('0x4d')]({},_0x15664d,_0x3b2a50[_0xa12f('0x4f')]);var _0x2fbb69={'where':_0x15664d[_0xa12f('0x4a')]};return db['VoiceQueue'][_0xa12f('0x24')](_0x2fbb69)[_0xa12f('0x29')](function(_0x316ffc){_0x37c0d9[_0xa12f('0x24')]=_0x316ffc;if(_0x3b2a50[_0xa12f('0x40')]['includeAll']){_0x15664d['include']=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x15664d);})[_0xa12f('0x29')](function(_0x4d4c2b){_0x37c0d9[_0xa12f('0x50')]=_0x4d4c2b;return _0x37c0d9;})[_0xa12f('0x29')](respondWithFilteredResult(_0xcd8db5,_0x15664d))[_0xa12f('0x51')](handleError(_0xcd8db5,null));};exports['show']=function(_0x5530dd,_0x5efc4d){var _0x62bed0={'raw':![],'where':{'id':_0x5530dd[_0xa12f('0x52')]['id']}},_0x5eeac9={};_0x5eeac9[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0x3b')]['rawAttributes']);_0x5eeac9[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x5530dd[_0xa12f('0x40')]);_0x5eeac9[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x5eeac9['model'],_0x5eeac9[_0xa12f('0x40')]);_0x62bed0[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x5eeac9[_0xa12f('0x42')],qs[_0xa12f('0x44')](_0x5530dd[_0xa12f('0x40')][_0xa12f('0x44')]));_0x62bed0[_0xa12f('0x43')]=_0x62bed0[_0xa12f('0x43')][_0xa12f('0x45')]?_0x62bed0[_0xa12f('0x43')]:_0x5eeac9[_0xa12f('0x42')];if(_0x5530dd[_0xa12f('0x40')][_0xa12f('0x53')]){_0x62bed0[_0xa12f('0x54')]=[{'all':!![]}];}_0x62bed0=_[_0xa12f('0x4d')]({},_0x62bed0,_0x5530dd['options']);return db[_0xa12f('0x3b')][_0xa12f('0x32')](_0x62bed0)['then'](handleEntityNotFound(_0x5efc4d,null))[_0xa12f('0x29')](respondWithResult(_0x5efc4d,null))[_0xa12f('0x51')](handleError(_0x5efc4d,null));};exports['create']=function(_0x91d723,_0xfe31a3){return db[_0xa12f('0x3b')]['create'](_0x91d723[_0xa12f('0x55')],{})['then'](function(_0x374118){var _0xdf766a=_0x91d723[_0xa12f('0x56')][_0xa12f('0x2b')]({'plain':!![]});if(!_0xdf766a)throw new Error(_0xa12f('0x57'));if(_0xdf766a['role']==='user'){var _0x55ed38=_0x374118[_0xa12f('0x2b')]({'plain':!![]});var _0x5ab99d=[{'name':_0xa12f('0x2c'),'value':_0xa12f('0x2d')},{'name':_0xa12f('0x2e'),'value':_0xa12f('0x2f')}];var _0x56ecb4=_[_0xa12f('0x32')](_0x5ab99d,[_0xa12f('0x33'),_0x55ed38[_0xa12f('0x31')]])[_0xa12f('0x37')];return db[_0xa12f('0x58')]['find']({'where':{'name':_0x56ecb4,'userProfileId':_0xdf766a[_0xa12f('0x59')]},'raw':!![]})[_0xa12f('0x29')](function(_0x4dd30){if(_0x4dd30&&_0x4dd30[_0xa12f('0x5a')]===0x0){return db[_0xa12f('0x34')][_0xa12f('0x5b')]({'name':_0x55ed38[_0xa12f('0x37')],'resourceId':_0x55ed38['id'],'type':_0x4dd30[_0xa12f('0x37')],'sectionId':_0x4dd30['id']},{})[_0xa12f('0x29')](function(){return _0x374118;});}else{return _0x374118;}})['catch'](function(_0x4f34b0){logger[_0xa12f('0x35')](_0xa12f('0x5c'),_0x4f34b0);throw _0x4f34b0;});}return _0x374118;})[_0xa12f('0x29')](respondWithResult(_0xfe31a3,0xc9))['catch'](handleError(_0xfe31a3,null));};exports[_0xa12f('0x5d')]=function(_0x107903,_0x2c7fda){var _0x4d2f74={'where':{'id':_0x107903[_0xa12f('0x52')]['id']}},_0x357c06={};_0x357c06['model']=_['keys'](db[_0xa12f('0x3b')][_0xa12f('0x3c')]);_0x4d2f74[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x357c06[_0xa12f('0x42')],qs[_0xa12f('0x44')](_0x107903['query'][_0xa12f('0x44')]));_0x4d2f74['attributes']=_0x4d2f74[_0xa12f('0x43')]['length']?_0x4d2f74[_0xa12f('0x43')]:_0x357c06[_0xa12f('0x42')];if(_0x107903[_0xa12f('0x40')][_0xa12f('0x53')]){_0x4d2f74[_0xa12f('0x54')]=[{'all':!![]}];}_0x4d2f74=_['merge']({},_0x4d2f74,_0x107903['options']);return db[_0xa12f('0x3b')][_0xa12f('0x32')](_0x4d2f74)[_0xa12f('0x29')](handleEntityNotFound(_0x2c7fda,null))[_0xa12f('0x29')](function(_0x1d0387){if(_0x1d0387){var _0x5c931d=_0x1d0387[_0xa12f('0x2b')]({'plain':!![]});_0x5c931d=qs[_0xa12f('0x5e')](_0x5c931d,['id',_0xa12f('0x5f'),_0xa12f('0x60')]);_0x107903[_0xa12f('0x55')]=_[_0xa12f('0x5e')](_0x107903['body'],['id',_0xa12f('0x5f'),'updatedAt']);return db[_0xa12f('0x3b')][_0xa12f('0x5b')](_['merge'](_0x5c931d,_0x107903[_0xa12f('0x55')]),{'include':_0x107903[_0xa12f('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x16605b){var _0x26ab9c=_0x107903[_0xa12f('0x56')][_0xa12f('0x2b')]({'plain':!![]});if(!_0x26ab9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ab9c['role']===_0xa12f('0x56')){var _0x49b9ae=_0x16605b[_0xa12f('0x2b')]({'plain':!![]});var _0x15264b=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xa12f('0x2e'),'value':'outbound'}];var _0x317e4a=_[_0xa12f('0x32')](_0x15264b,['value',_0x49b9ae[_0xa12f('0x31')]])[_0xa12f('0x37')];return db[_0xa12f('0x58')][_0xa12f('0x32')]({'where':{'name':_0x317e4a,'userProfileId':_0x26ab9c[_0xa12f('0x59')]},'raw':!![]})['then'](function(_0x4b561b){if(_0x4b561b&&_0x4b561b['autoAssociation']===0x0){return db['UserProfileResource'][_0xa12f('0x5b')]({'name':_0x49b9ae[_0xa12f('0x37')],'resourceId':_0x49b9ae['id'],'type':_0x4b561b[_0xa12f('0x37')],'sectionId':_0x4b561b['id']},{})['then'](function(){return _0x16605b;});}else{return _0x16605b;}})['catch'](function(_0x5d54ad){logger[_0xa12f('0x35')](_0xa12f('0x5c'),_0x5d54ad);throw _0x5d54ad;});}return _0x16605b;});}})[_0xa12f('0x29')](respondWithResult(_0x2c7fda,0xc9))[_0xa12f('0x51')](handleError(_0x2c7fda,null));};exports[_0xa12f('0x28')]=function(_0x211ddd,_0x79dd9a){if(_0x211ddd['body']['id']){delete _0x211ddd['body']['id'];}return db[_0xa12f('0x3b')][_0xa12f('0x32')]({'where':{'id':_0x211ddd[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x79dd9a,null))[_0xa12f('0x29')](saveUpdates(_0x211ddd['body'],null))[_0xa12f('0x29')](respondWithResult(_0x79dd9a,null))[_0xa12f('0x51')](handleError(_0x79dd9a,null));};exports[_0xa12f('0x2a')]=function(_0x4f7d6a,_0x5217f7){return db[_0xa12f('0x3b')]['find']({'where':{'id':_0x4f7d6a['params']['id']}})['then'](handleEntityNotFound(_0x5217f7,null))['then'](removeEntity(_0x5217f7,null))['catch'](handleError(_0x5217f7,null));};exports[_0xa12f('0x61')]=function(_0x14130e,_0x542899,_0x34a42a){var _0x11d503={'raw':![],'where':{}};var _0x20e5bf={};var _0x484345={'count':0x0,'rows':[]};return db[_0xa12f('0x3b')][_0xa12f('0x62')]({'where':{'id':_0x14130e[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x542899,null))[_0xa12f('0x29')](function(_0x240995){if(_0x240995){_0x20e5bf['model']=_['keys'](db[_0xa12f('0x63')]['rawAttributes']);_0x20e5bf[_0xa12f('0x40')]=_['keys'](_0x14130e[_0xa12f('0x40')]);_0x20e5bf[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x20e5bf[_0xa12f('0x42')],_0x20e5bf[_0xa12f('0x40')]);_0x11d503[_0xa12f('0x43')]=_['intersection'](_0x20e5bf[_0xa12f('0x42')],qs['fields'](_0x14130e['query']['fields']));_0x11d503[_0xa12f('0x43')]=_0x11d503[_0xa12f('0x43')][_0xa12f('0x45')]?_0x11d503['attributes']:_0x20e5bf[_0xa12f('0x42')];if(!_0x14130e[_0xa12f('0x40')][_0xa12f('0x46')](_0xa12f('0x47'))){_0x11d503[_0xa12f('0x23')]=qs[_0xa12f('0x23')](_0x14130e[_0xa12f('0x40')][_0xa12f('0x23')]);_0x11d503[_0xa12f('0x22')]=qs['offset'](_0x14130e[_0xa12f('0x40')][_0xa12f('0x22')]);}_0x11d503['order']=qs[_0xa12f('0x49')](_0x14130e['query'][_0xa12f('0x49')]);_0x11d503[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x14130e[_0xa12f('0x40')],_0x20e5bf[_0xa12f('0x4b')]));_0x11d503['where'][_0xa12f('0x64')]=_0x240995['id'];if(_0x14130e['query'][_0xa12f('0x30')]){_0x11d503['where']=_[_0xa12f('0x4d')](_0x11d503[_0xa12f('0x4a')],{'$or':_[_0xa12f('0x3a')](_0x11d503[_0xa12f('0x43')],function(_0x32c873){var _0xb40ebe={};_0xb40ebe[_0x32c873]={'$like':'%'+_0x14130e[_0xa12f('0x40')][_0xa12f('0x30')]+'%'};return _0xb40ebe;})});}_0x11d503=_[_0xa12f('0x4d')]({},_0x11d503,_0x14130e['options']);return db[_0xa12f('0x63')][_0xa12f('0x24')]({'where':_0x11d503['where']})[_0xa12f('0x29')](function(_0x3bcdbb){_0x484345[_0xa12f('0x24')]=_0x3bcdbb;if(_0x14130e[_0xa12f('0x40')]['includeAll']){_0x11d503[_0xa12f('0x54')]=[{'all':!![]}];}return db[_0xa12f('0x63')][_0xa12f('0x65')](_0x11d503);})['then'](function(_0x8e9555){_0x484345[_0xa12f('0x50')]=_0x8e9555;return _0x484345;});}})[_0xa12f('0x29')](respondWithFilteredResult(_0x542899,_0x11d503))[_0xa12f('0x51')](handleError(_0x542899,null));};exports[_0xa12f('0x66')]=function(_0xef3bf8,_0x2408f0,_0x5c5ba2){var _0x3ab795={'raw':!![],'where':{}};var _0x2c2be5={};var _0x271860={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa12f('0x62')]({'where':{'id':_0xef3bf8['params']['id']}})['then'](handleEntityNotFound(_0x2408f0,null))[_0xa12f('0x29')](function(_0xa85209){if(_0xa85209){_0x2c2be5[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0x67')][_0xa12f('0x3c')]);_0x2c2be5[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0xef3bf8[_0xa12f('0x40')]);_0x2c2be5['filters']=_[_0xa12f('0x41')](_0x2c2be5[_0xa12f('0x42')],_0x2c2be5[_0xa12f('0x40')]);_0x3ab795['attributes']=_[_0xa12f('0x41')](_0x2c2be5[_0xa12f('0x42')],qs[_0xa12f('0x44')](_0xef3bf8[_0xa12f('0x40')]['fields']));_0x3ab795[_0xa12f('0x43')]=_0x3ab795[_0xa12f('0x43')]['length']?_0x3ab795[_0xa12f('0x43')]:_0x2c2be5[_0xa12f('0x42')];if(!_0xef3bf8['query'][_0xa12f('0x46')](_0xa12f('0x47'))){_0x3ab795[_0xa12f('0x23')]=qs['limit'](_0xef3bf8[_0xa12f('0x40')][_0xa12f('0x23')]);_0x3ab795[_0xa12f('0x22')]=qs[_0xa12f('0x22')](_0xef3bf8['query'][_0xa12f('0x22')]);}_0x3ab795[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0xef3bf8[_0xa12f('0x40')]['sort']);_0x3ab795['where']=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0xef3bf8['query'],_0x2c2be5[_0xa12f('0x4b')]));_0x3ab795[_0xa12f('0x4a')][_0xa12f('0x64')]=_0xa85209['id'];if(_0xef3bf8['query'][_0xa12f('0x30')]){_0x3ab795[_0xa12f('0x4a')]=_[_0xa12f('0x4d')](_0x3ab795[_0xa12f('0x4a')],{'$or':_[_0xa12f('0x3a')](_0x3ab795[_0xa12f('0x43')],function(_0x25f4c4){var _0x89409b={};_0x89409b[_0x25f4c4]={'$like':'%'+_0xef3bf8[_0xa12f('0x40')]['filter']+'%'};return _0x89409b;})});}_0x3ab795=_[_0xa12f('0x4d')]({},_0x3ab795,_0xef3bf8[_0xa12f('0x4f')]);return db['CmHopperHistory']['count']({'where':_0x3ab795[_0xa12f('0x4a')]})[_0xa12f('0x29')](function(_0x16f19f){_0x271860[_0xa12f('0x24')]=_0x16f19f;if(_0xef3bf8['query'][_0xa12f('0x53')]){_0x3ab795[_0xa12f('0x54')]=[{'all':!![]}];}return db[_0xa12f('0x67')]['findAll'](_0x3ab795);})['then'](function(_0x364601){_0x271860['rows']=_0x364601;return _0x271860;});}})[_0xa12f('0x29')](respondWithFilteredResult(_0x2408f0,_0x3ab795))[_0xa12f('0x51')](handleError(_0x2408f0,null));};exports[_0xa12f('0x68')]=function(_0x4e5a74,_0xb69683,_0x325339){var _0x2e7aee={'raw':!![],'where':{}};var _0x340204={};var _0x1c2992={'count':0x0,'rows':[]};return db[_0xa12f('0x3b')][_0xa12f('0x62')]({'where':{'id':_0x4e5a74[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0xb69683,null))[_0xa12f('0x29')](function(_0x50d779){if(_0x50d779){_0x340204[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0x69')]['rawAttributes']);_0x340204[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x4e5a74[_0xa12f('0x40')]);_0x340204[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x340204['model'],_0x340204[_0xa12f('0x40')]);_0x2e7aee[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x340204['model'],qs[_0xa12f('0x44')](_0x4e5a74[_0xa12f('0x40')][_0xa12f('0x44')]));_0x2e7aee[_0xa12f('0x43')]=_0x2e7aee[_0xa12f('0x43')][_0xa12f('0x45')]?_0x2e7aee[_0xa12f('0x43')]:_0x340204[_0xa12f('0x42')];if(!_0x4e5a74[_0xa12f('0x40')][_0xa12f('0x46')](_0xa12f('0x47'))){_0x2e7aee[_0xa12f('0x23')]=qs['limit'](_0x4e5a74['query'][_0xa12f('0x23')]);_0x2e7aee[_0xa12f('0x22')]=qs['offset'](_0x4e5a74[_0xa12f('0x40')][_0xa12f('0x22')]);}_0x2e7aee[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0x4e5a74['query']['sort']);_0x2e7aee[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x4e5a74[_0xa12f('0x40')],_0x340204['filters']));_0x2e7aee[_0xa12f('0x4a')]['VoiceQueueId']=_0x50d779['id'];if(_0x4e5a74[_0xa12f('0x40')]['filter']){_0x2e7aee[_0xa12f('0x4a')]=_[_0xa12f('0x4d')](_0x2e7aee['where'],{'$or':_['map'](_0x2e7aee[_0xa12f('0x43')],function(_0x1c2e56){var _0x184582={};_0x184582[_0x1c2e56]={'$like':'%'+_0x4e5a74[_0xa12f('0x40')][_0xa12f('0x30')]+'%'};return _0x184582;})});}_0x2e7aee=_[_0xa12f('0x4d')]({},_0x2e7aee,_0x4e5a74[_0xa12f('0x4f')]);return db[_0xa12f('0x69')][_0xa12f('0x24')]({'where':_0x2e7aee['where']})[_0xa12f('0x29')](function(_0x49581a){_0x1c2992['count']=_0x49581a;if(_0x4e5a74[_0xa12f('0x40')]['includeAll']){_0x2e7aee['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2e7aee);})[_0xa12f('0x29')](function(_0x33ebd7){_0x1c2992['rows']=_0x33ebd7;return _0x1c2992;});}})[_0xa12f('0x29')](respondWithFilteredResult(_0xb69683,_0x2e7aee))[_0xa12f('0x51')](handleError(_0xb69683,null));};exports[_0xa12f('0x6a')]=function(_0xb49257,_0x4fce23,_0xce499e){var _0x1fa842={'raw':!![],'where':{}};var _0x5a7c7e={};var _0x342055={'count':0x0,'rows':[]};return db[_0xa12f('0x3b')][_0xa12f('0x62')]({'where':{'id':_0xb49257['params']['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x4fce23,null))[_0xa12f('0x29')](function(_0x5233ea){if(_0x5233ea){_0x5a7c7e['model']=_[_0xa12f('0x3f')](db[_0xa12f('0x6b')][_0xa12f('0x3c')]);_0x5a7c7e[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0xb49257['query']);_0x5a7c7e['filters']=_[_0xa12f('0x41')](_0x5a7c7e[_0xa12f('0x42')],_0x5a7c7e[_0xa12f('0x40')]);_0x1fa842[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x5a7c7e['model'],qs['fields'](_0xb49257[_0xa12f('0x40')]['fields']));_0x1fa842[_0xa12f('0x43')]=_0x1fa842[_0xa12f('0x43')][_0xa12f('0x45')]?_0x1fa842[_0xa12f('0x43')]:_0x5a7c7e[_0xa12f('0x42')];if(!_0xb49257['query'][_0xa12f('0x46')](_0xa12f('0x47'))){_0x1fa842[_0xa12f('0x23')]=qs['limit'](_0xb49257[_0xa12f('0x40')][_0xa12f('0x23')]);_0x1fa842['offset']=qs[_0xa12f('0x22')](_0xb49257[_0xa12f('0x40')][_0xa12f('0x22')]);}_0x1fa842[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0xb49257[_0xa12f('0x40')]['sort']);_0x1fa842[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0xb49257[_0xa12f('0x40')],_0x5a7c7e[_0xa12f('0x4b')]));_0x1fa842[_0xa12f('0x4a')][_0xa12f('0x64')]=_0x5233ea['id'];if(_0xb49257['query']['filter']){_0x1fa842[_0xa12f('0x4a')]=_[_0xa12f('0x4d')](_0x1fa842[_0xa12f('0x4a')],{'$or':_['map'](_0x1fa842[_0xa12f('0x43')],function(_0x17314c){var _0x3daadd={};_0x3daadd[_0x17314c]={'$like':'%'+_0xb49257['query']['filter']+'%'};return _0x3daadd;})});}_0x1fa842=_[_0xa12f('0x4d')]({},_0x1fa842,_0xb49257[_0xa12f('0x4f')]);return db['CmHopperBlack']['count']({'where':_0x1fa842[_0xa12f('0x4a')]})[_0xa12f('0x29')](function(_0x1dadbe){_0x342055[_0xa12f('0x24')]=_0x1dadbe;if(_0xb49257[_0xa12f('0x40')]['includeAll']){_0x1fa842['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xa12f('0x65')](_0x1fa842);})[_0xa12f('0x29')](function(_0x3a47f5){_0x342055[_0xa12f('0x50')]=_0x3a47f5;return _0x342055;});}})['then'](respondWithFilteredResult(_0x4fce23,_0x1fa842))[_0xa12f('0x51')](handleError(_0x4fce23,null));};exports[_0xa12f('0x6c')]=function(_0x4005b4,_0x422466,_0x19c88e){var _0x4b536f={};var _0x58350e={};var _0x5a4199;var _0x267234;return db[_0xa12f('0x3b')]['findOne']({'where':{'id':_0x4005b4['params']['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x422466,null))[_0xa12f('0x29')](function(_0x37901d){if(_0x37901d){_0x5a4199=_0x37901d;_0x58350e['model']=_[_0xa12f('0x3f')](db[_0xa12f('0x6d')][_0xa12f('0x3c')]);_0x58350e[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x4005b4[_0xa12f('0x40')]);_0x58350e[_0xa12f('0x4b')]=_['intersection'](_0x58350e['model'],_0x58350e['query']);_0x4b536f['attributes']=_[_0xa12f('0x41')](_0x58350e[_0xa12f('0x42')],qs['fields'](_0x4005b4[_0xa12f('0x40')]['fields']));_0x4b536f[_0xa12f('0x43')]=_0x4b536f[_0xa12f('0x43')]['length']?_0x4b536f[_0xa12f('0x43')]:_0x58350e[_0xa12f('0x42')];_0x4b536f[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0x4005b4[_0xa12f('0x40')][_0xa12f('0x49')]);_0x4b536f['where']=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x4005b4[_0xa12f('0x40')],_0x58350e['filters']));if(_0x4005b4[_0xa12f('0x40')]['filter']){_0x4b536f['where']=_[_0xa12f('0x4d')](_0x4b536f[_0xa12f('0x4a')],{'$or':_[_0xa12f('0x3a')](_0x4b536f[_0xa12f('0x43')],function(_0xe3dc9){var _0x49eb36={};_0x49eb36[_0xe3dc9]={'$like':'%'+_0x4005b4[_0xa12f('0x40')][_0xa12f('0x30')]+'%'};return _0x49eb36;})});}_0x4b536f=_[_0xa12f('0x4d')]({},_0x4b536f,_0x4005b4[_0xa12f('0x4f')]);return _0x5a4199[_0xa12f('0x6c')](_0x4b536f);}})['then'](function(_0x2ba8fa){if(_0x2ba8fa){_0x267234=_0x2ba8fa[_0xa12f('0x45')];if(!_0x4005b4['query']['hasOwnProperty'](_0xa12f('0x47'))){_0x4b536f[_0xa12f('0x23')]=qs[_0xa12f('0x23')](_0x4005b4[_0xa12f('0x40')][_0xa12f('0x23')]);_0x4b536f[_0xa12f('0x22')]=qs[_0xa12f('0x22')](_0x4005b4['query']['offset']);}return _0x5a4199['getTeams'](_0x4b536f);}})['then'](function(_0x117c44){if(_0x117c44){return _0x117c44?{'count':_0x267234,'rows':_0x117c44}:null;}})[_0xa12f('0x29')](respondWithResult(_0x422466,null))['catch'](handleError(_0x422466,null));};exports[_0xa12f('0x6e')]=function(_0x19a5bf,_0x12eb22,_0xc732bd){var _0x333700=_0x19a5bf[_0xa12f('0x55')][_0xa12f('0x6f')];var _0x236aa0=_['map'](_0x333700,'id');return db['Team'][_0xa12f('0x65')]({'where':{'id':_0x236aa0},'attributes':['id'],'include':[{'model':db[_0xa12f('0x70')],'as':_0xa12f('0x71'),'attributes':['id','name',_0xa12f('0x72'),'voicePause',_0xa12f('0x73')],'raw':!![]}]})[_0xa12f('0x29')](function(_0x345652){if(_0x345652){var _0x57d65f=_[_0xa12f('0x74')](_0x345652,function(_0x17321c){var _0x344d01=_0x17321c[_0xa12f('0x2b')]({'plain':!![]});_0x344d01[_0xa12f('0x71')][_0xa12f('0x75')](function(_0xba127f){_0xba127f[_0xa12f('0x76')]=_[_0xa12f('0x32')](_0x333700,{'id':_0x344d01['id']})['penalty'];});return _0x344d01['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x19a5bf['params']['id']}})['then'](function(_0x38954a){return db[_0xa12f('0x77')][_0xa12f('0x78')](function(_0x562799){return _0x38954a[_0xa12f('0x6e')](_0x236aa0,{'transaction':_0x562799})[_0xa12f('0x29')](function(){return BPromise['each'](_0x333700,function(_0xe3e4f1){return db[_0xa12f('0x79')][_0xa12f('0x7a')]({'TeamId':_0xe3e4f1['id'],'VoiceQueueId':_0x19a5bf[_0xa12f('0x52')]['id'],'penalty':_0xe3e4f1[_0xa12f('0x76')]},{'transaction':_0x562799});});})[_0xa12f('0x29')](function(){return BPromise[_0xa12f('0x7b')](_0x57d65f,function(_0x1a7ff7){return db['UserVoiceQueue'][_0xa12f('0x7c')]({'where':{'UserId':_0x1a7ff7['id'],'VoiceQueueId':_0x19a5bf[_0xa12f('0x52')]['id']},'defaults':{'penalty':_0x1a7ff7[_0xa12f('0x76')]},'transaction':_0x562799});});})[_0xa12f('0x29')](function(){return BPromise[_0xa12f('0x7b')](_[_0xa12f('0x30')](_0x57d65f,{'online':!![]}),function(_0xfa83e2){return db[_0xa12f('0x7d')]['upsert']({'membername':_0xfa83e2[_0xa12f('0x37')],'UserId':_0xfa83e2['id'],'queue_name':_0x38954a[_0xa12f('0x37')],'VoiceQueueId':_0x38954a['id'],'interface':_[_0xa12f('0x7e')](_0xfa83e2[_0xa12f('0x73')])?util[_0xa12f('0x7f')](_0xa12f('0x80'),_0xfa83e2[_0xa12f('0x37')]):_0xfa83e2[_0xa12f('0x73')],'paused':_0xfa83e2[_0xa12f('0x81')]||![],'penalty':_0xfa83e2[_0xa12f('0x76')]},{'transaction':_0x562799});});})[_0xa12f('0x29')](function(){_0x57d65f[_0xa12f('0x75')](function(_0x233636){socket[_0xa12f('0x82')](_0xa12f('0x83'),{'UserId':_0x233636['id'],'VoiceQueueId':_0x38954a['id']});});});});});}})[_0xa12f('0x29')](respondWithStatusCode(_0x12eb22,null))[_0xa12f('0x51')](handleError(_0x12eb22,null));};exports[_0xa12f('0x84')]=function(_0x3f9249,_0x593fa4,_0x19a999){return db[_0xa12f('0x6d')][_0xa12f('0x65')]({'where':{'id':_0x3f9249[_0xa12f('0x40')][_0xa12f('0x85')]},'attributes':['id'],'include':[{'model':db[_0xa12f('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa12f('0x29')](handleEntityNotFound(_0x593fa4,null))[_0xa12f('0x29')](function(_0x509e78){var _0x10db9f=_['map'](_0x509e78,'id');var _0x3b1cda=[];var _0x2d424c=[];var _0x3b1950=squel[_0xa12f('0x86')]();_0x3b1950[_0xa12f('0x87')]('tq.TeamId')[_0xa12f('0x88')](_0xa12f('0x89'),'tq')[_0xa12f('0x8a')](_0xa12f('0x8b'),'ut',_0xa12f('0x8c'))['where'](_0xa12f('0x8d'),_0x3f9249[_0xa12f('0x52')]['id']);for(var _0x1ac328=0x0;_0x1ac328<_0x509e78[_0xa12f('0x45')];_0x1ac328+=0x1){let _0x45fa81=_0x509e78[_0x1ac328];for(var _0x2335e7=0x0;_0x2335e7<_0x45fa81[_0xa12f('0x71')][_0xa12f('0x45')];_0x2335e7+=0x1){let _0x3b2faf=_0x45fa81[_0xa12f('0x71')][_0x2335e7];var _0xb98c4f=_0x3b1950[_0xa12f('0x5d')]();_0xb98c4f[_0xa12f('0x4a')](_0xa12f('0x8e'),_0x3b2faf['id']);_0x2d424c[_0xa12f('0x8f')](db[_0xa12f('0x77')][_0xa12f('0x40')](_0xb98c4f['toString'](),{'type':db[_0xa12f('0x77')][_0xa12f('0x90')][_0xa12f('0x91')]})[_0xa12f('0x29')](function(_0x5cc0ec){if(_0x5cc0ec[_0xa12f('0x45')]===0x1){return _0x3b2faf['id'];}else{var _0x9e0b11=_[_0xa12f('0x92')](_[_0xa12f('0x3a')](_0x5cc0ec,_0xa12f('0x93')),function(_0x5d6afe){return _[_0xa12f('0x94')](_0x10db9f,_0x5d6afe);});if(_0x9e0b11){return _0x3b2faf['id'];}}}));}}return BPromise[_0xa12f('0x95')](_0x2d424c)['then'](function(_0x360344){_0x3b1cda=_(_0x3b1cda)[_0xa12f('0x96')](_0x360344)[_0xa12f('0x97')]()[_0xa12f('0x33')]();return db['VoiceQueue'][_0xa12f('0x32')]({'where':{'id':_0x3f9249['params']['id']}})[_0xa12f('0x29')](function(_0x16de06){return db[_0xa12f('0x77')][_0xa12f('0x78')](function(_0x1f093b){return _0x16de06[_0xa12f('0x84')](_0x3f9249[_0xa12f('0x40')][_0xa12f('0x85')],{'transaction':_0x1f093b})[_0xa12f('0x29')](function(){if(!_[_0xa12f('0x98')](_0x3b1cda)){return _0x16de06[_0xa12f('0x99')](_0x3b1cda,{'transaction':_0x1f093b})[_0xa12f('0x29')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3f9249['params']['id'],'UserId':_0x3b1cda},'transaction':_0x1f093b});});}})[_0xa12f('0x29')](function(){_0x3b1cda[_0xa12f('0x75')](function(_0x515250){socket[_0xa12f('0x82')]('userVoiceQueue:remove',{'UserId':_0x515250,'VoiceQueueId':_0x16de06['id']});});});});});});})[_0xa12f('0x29')](respondWithStatusCode(_0x593fa4,null))[_0xa12f('0x51')](handleError(_0x593fa4,null));};exports['addAgents']=function(_0x14adbb,_0x80dfa0,_0x47fd49){var _0x2d0a8c,_0x4178b2;return db[_0xa12f('0x3b')]['find']({'where':{'id':_0x14adbb[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x80dfa0,null))[_0xa12f('0x29')](function(_0xfe89a4){if(_0xfe89a4){_0x4178b2=_0xfe89a4;return _0xfe89a4[_0xa12f('0x9a')](_0x14adbb[_0xa12f('0x55')]['ids'],_[_0xa12f('0x5e')](_0x14adbb['body'],[_0xa12f('0x85'),'id'])||{})[_0xa12f('0x9b')](function(_0x3acd34){for(var _0x1fe131=0x0;_0x1fe131<_0x14adbb['body'][_0xa12f('0x85')][_0xa12f('0x45')];_0x1fe131+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x14adbb[_0xa12f('0x55')][_0xa12f('0x85')][_0x1fe131]),'VoiceQueueId':Number(_0x14adbb[_0xa12f('0x52')]['id'])});}return _0x3acd34;});}})[_0xa12f('0x29')](function(_0x2f7053){_0x2d0a8c=_0x2f7053||[];if(_0x4178b2){return db[_0xa12f('0x70')][_0xa12f('0x65')]({'where':{'id':_0x14adbb[_0xa12f('0x55')]['ids']},'attributes':['id',_0xa12f('0x37'),_0xa12f('0x72'),_0xa12f('0x81'),_0xa12f('0x73')],'raw':!![]});}})[_0xa12f('0x29')](function(_0x63f249){if(!_['isEmpty'](_0x63f249)){var _0x5ae073=[];for(var _0x5b9061=0x0;_0x5b9061<_0x63f249[_0xa12f('0x45')];_0x5b9061++){if(_0x63f249[_0x5b9061]['online']){_0x5ae073[_0xa12f('0x8f')](db['UserVoiceQueueRt'][_0xa12f('0x7a')]({'membername':_0x63f249[_0x5b9061][_0xa12f('0x37')],'UserId':_0x63f249[_0x5b9061]['id'],'queue_name':_0x4178b2['name'],'VoiceQueueId':_0x4178b2['id'],'interface':_[_0xa12f('0x7e')](_0x63f249[_0x5b9061][_0xa12f('0x73')])?util[_0xa12f('0x7f')](_0xa12f('0x80'),_0x63f249[_0x5b9061]['name']):_0x63f249[_0x5b9061][_0xa12f('0x73')],'paused':_0x63f249[_0x5b9061][_0xa12f('0x81')]||![],'penalty':_0x14adbb[_0xa12f('0x55')][_0xa12f('0x76')]||0x0}));}}return BPromise['all'](_0x5ae073);}})[_0xa12f('0x29')](function(){return _0x2d0a8c;})[_0xa12f('0x29')](respondWithResult(_0x80dfa0,null))[_0xa12f('0x51')](handleError(_0x80dfa0,null));};exports['removeAgents']=function(_0x1ca779,_0xea98a3,_0x4c412c){return db[_0xa12f('0x3b')][_0xa12f('0x32')]({'where':{'id':_0x1ca779[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0xea98a3,null))['then'](function(_0x3e4ab3){if(_0x3e4ab3){return _0x3e4ab3[_0xa12f('0x99')](_0x1ca779[_0xa12f('0x40')]['ids'])['then'](function(){if(_['isArray'](_0x1ca779[_0xa12f('0x40')]['ids'])){for(var _0x202fd2=0x0;_0x202fd2<_0x1ca779['query'][_0xa12f('0x85')][_0xa12f('0x45')];_0x202fd2+=0x1){socket['emit'](_0xa12f('0x9c'),{'UserId':Number(_0x1ca779['query'][_0xa12f('0x85')][_0x202fd2]),'VoiceQueueId':Number(_0x1ca779[_0xa12f('0x52')]['id'])});}}else{socket[_0xa12f('0x82')](_0xa12f('0x9c'),{'UserId':Number(_0x1ca779[_0xa12f('0x40')][_0xa12f('0x85')]),'VoiceQueueId':Number(_0x1ca779['params']['id'])});}});}})['then'](function(_0x2226e3){return db[_0xa12f('0x7d')][_0xa12f('0x2a')]({'where':{'VoiceQueueId':_0x1ca779[_0xa12f('0x52')]['id'],'UserId':_0x1ca779[_0xa12f('0x40')][_0xa12f('0x85')]}})[_0xa12f('0x29')](function(){return _0x2226e3;});})[_0xa12f('0x29')](respondWithStatusCode(_0xea98a3,null))[_0xa12f('0x51')](handleError(_0xea98a3,null));};exports[_0xa12f('0x9d')]=function(_0x444020,_0x554c23,_0x10c34d){var _0x465e23={};var _0x1dc0a7={};var _0x1e4cce;var _0x213cc1;return db['VoiceQueue']['findOne']({'where':{'id':_0x444020[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x554c23,null))[_0xa12f('0x29')](function(_0x1f38db){if(_0x1f38db){_0x1e4cce=_0x1f38db;_0x1dc0a7[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0x70')]['rawAttributes']);_0x1dc0a7[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x444020[_0xa12f('0x40')]);_0x1dc0a7[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x1dc0a7['model'],_0x1dc0a7[_0xa12f('0x40')]);_0x465e23[_0xa12f('0x43')]=_['intersection'](_0x1dc0a7['model'],qs[_0xa12f('0x44')](_0x444020[_0xa12f('0x40')][_0xa12f('0x44')]));_0x465e23[_0xa12f('0x43')]=_0x465e23[_0xa12f('0x43')][_0xa12f('0x45')]?_0x465e23['attributes']:_0x1dc0a7[_0xa12f('0x42')];_0x465e23['order']=qs[_0xa12f('0x49')](_0x444020['query'][_0xa12f('0x49')]);_0x465e23[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x444020['query'],_0x1dc0a7[_0xa12f('0x4b')]));if(_0x444020['query']['filter']){_0x465e23['where']=_[_0xa12f('0x4d')](_0x465e23['where'],{'$or':_['map'](_0x465e23[_0xa12f('0x43')],function(_0x2b7e12){var _0x557899={};_0x557899[_0x2b7e12]={'$like':'%'+_0x444020[_0xa12f('0x40')]['filter']+'%'};return _0x557899;})});}_0x465e23=_[_0xa12f('0x4d')]({},_0x465e23,_0x444020[_0xa12f('0x4f')]);return _0x1e4cce[_0xa12f('0x9d')](_0x465e23);}})[_0xa12f('0x29')](function(_0x4841de){if(_0x4841de){_0x213cc1=_0x4841de[_0xa12f('0x45')];if(!_0x444020[_0xa12f('0x40')]['hasOwnProperty'](_0xa12f('0x47'))){_0x465e23['limit']=qs[_0xa12f('0x23')](_0x444020[_0xa12f('0x40')][_0xa12f('0x23')]);_0x465e23[_0xa12f('0x22')]=qs['offset'](_0x444020['query'][_0xa12f('0x22')]);}return _0x1e4cce['getAgents'](_0x465e23);}})[_0xa12f('0x29')](function(_0x20e9c5){if(_0x20e9c5){return _0x20e9c5?{'count':_0x213cc1,'rows':_0x20e9c5}:null;}})['then'](respondWithResult(_0x554c23,null))[_0xa12f('0x51')](handleError(_0x554c23,null));};exports[_0xa12f('0x9e')]=function(_0x392af9,_0x4ee031,_0x501343){var _0x14dbbc={};var _0x2f3113={};var _0x2eb217;var _0x9fa6c1;return db[_0xa12f('0x3b')]['findOne']({'where':{'id':_0x392af9[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x4ee031,null))['then'](function(_0x133be0){if(_0x133be0){_0x2eb217=_0x133be0;_0x2f3113[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0x7d')][_0xa12f('0x3c')]);_0x2f3113[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x392af9[_0xa12f('0x40')]);_0x2f3113[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x2f3113[_0xa12f('0x42')],_0x2f3113[_0xa12f('0x40')]);_0x14dbbc[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x2f3113['model'],qs[_0xa12f('0x44')](_0x392af9[_0xa12f('0x40')][_0xa12f('0x44')]));_0x14dbbc['attributes']=_0x14dbbc['attributes']['length']?_0x14dbbc[_0xa12f('0x43')]:_0x2f3113[_0xa12f('0x42')];_0x14dbbc[_0xa12f('0x48')]=qs[_0xa12f('0x49')](_0x392af9[_0xa12f('0x40')][_0xa12f('0x49')]);_0x14dbbc[_0xa12f('0x4a')]=qs['filters'](_['pick'](_0x392af9[_0xa12f('0x40')],_0x2f3113[_0xa12f('0x4b')]));if(_0x392af9[_0xa12f('0x40')][_0xa12f('0x30')]){_0x14dbbc[_0xa12f('0x4a')]=_['merge'](_0x14dbbc[_0xa12f('0x4a')],{'$or':_['map'](_0x14dbbc[_0xa12f('0x43')],function(_0x219fac){var _0x5c4b50={};_0x5c4b50[_0x219fac]={'$like':'%'+_0x392af9['query'][_0xa12f('0x30')]+'%'};return _0x5c4b50;})});}_0x14dbbc=_[_0xa12f('0x4d')]({},_0x14dbbc,_0x392af9[_0xa12f('0x4f')]);return _0x2eb217[_0xa12f('0x9e')](_0x14dbbc);}})[_0xa12f('0x29')](function(_0x5f4cc0){if(_0x5f4cc0){_0x9fa6c1=_0x5f4cc0[_0xa12f('0x45')];if(!_0x392af9[_0xa12f('0x40')][_0xa12f('0x46')](_0xa12f('0x47'))){_0x14dbbc[_0xa12f('0x23')]=qs[_0xa12f('0x23')](_0x392af9[_0xa12f('0x40')]['limit']);_0x14dbbc['offset']=qs[_0xa12f('0x22')](_0x392af9[_0xa12f('0x40')][_0xa12f('0x22')]);}return _0x2eb217['getMembers'](_0x14dbbc);}})[_0xa12f('0x29')](function(_0x46215e){return _0x46215e?{'count':_0x9fa6c1,'rows':_0x46215e}:null;})[_0xa12f('0x29')](respondWithResult(_0x4ee031,null))[_0xa12f('0x51')](handleError(_0x4ee031,null));};exports['getLists']=function(_0x3f01c3,_0x19b630,_0xd9565f){var _0x52e6bb={};var _0xc0d6b8={};var _0x5593ee;var _0x43ba19;return db['VoiceQueue'][_0xa12f('0x62')]({'where':{'id':_0x3f01c3[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x19b630,null))['then'](function(_0x9365fb){if(_0x9365fb){_0x5593ee=_0x9365fb;_0xc0d6b8[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db['CmList'][_0xa12f('0x3c')]);_0xc0d6b8[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x3f01c3['query']);_0xc0d6b8['filters']=_['intersection'](_0xc0d6b8[_0xa12f('0x42')],_0xc0d6b8[_0xa12f('0x40')]);_0x52e6bb[_0xa12f('0x43')]=_['intersection'](_0xc0d6b8['model'],qs['fields'](_0x3f01c3[_0xa12f('0x40')][_0xa12f('0x44')]));_0x52e6bb['attributes']=_0x52e6bb['attributes'][_0xa12f('0x45')]?_0x52e6bb[_0xa12f('0x43')]:_0xc0d6b8[_0xa12f('0x42')];_0x52e6bb[_0xa12f('0x48')]=qs['sort'](_0x3f01c3[_0xa12f('0x40')][_0xa12f('0x49')]);_0x52e6bb[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x3f01c3[_0xa12f('0x40')],_0xc0d6b8[_0xa12f('0x4b')]));if(_0x3f01c3[_0xa12f('0x40')][_0xa12f('0x30')]){_0x52e6bb['where']=_[_0xa12f('0x4d')](_0x52e6bb[_0xa12f('0x4a')],{'$or':_['map'](_0x52e6bb[_0xa12f('0x43')],function(_0xfe324f){var _0x4c9731={};_0x4c9731[_0xfe324f]={'$like':'%'+_0x3f01c3[_0xa12f('0x40')][_0xa12f('0x30')]+'%'};return _0x4c9731;})});}_0x52e6bb=_[_0xa12f('0x4d')]({},_0x52e6bb,_0x3f01c3['options']);return _0x5593ee[_0xa12f('0x9f')](_0x52e6bb);}})[_0xa12f('0x29')](function(_0x2ee8e9){if(_0x2ee8e9){_0x43ba19=_0x2ee8e9[_0xa12f('0x45')];if(!_0x3f01c3['query'][_0xa12f('0x46')](_0xa12f('0x47'))){_0x52e6bb['limit']=qs[_0xa12f('0x23')](_0x3f01c3[_0xa12f('0x40')]['limit']);_0x52e6bb[_0xa12f('0x22')]=qs[_0xa12f('0x22')](_0x3f01c3[_0xa12f('0x40')][_0xa12f('0x22')]);}return _0x5593ee['getLists'](_0x52e6bb);}})[_0xa12f('0x29')](function(_0x101ca0){if(_0x101ca0){return _0x101ca0?{'count':_0x43ba19,'rows':_0x101ca0}:null;}})['then'](respondWithResult(_0x19b630,null))[_0xa12f('0x51')](handleError(_0x19b630,null));};exports['addLists']=function(_0x1b3062,_0x115b1d,_0x5a9d99){var _0x2ee455,_0x8c3e73;return db[_0xa12f('0x3b')]['find']({'where':{'id':_0x1b3062[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x115b1d,null))[_0xa12f('0x29')](function(_0x54e2ff){if(_0x54e2ff){_0x8c3e73=_0x54e2ff;return _0x54e2ff[_0xa12f('0xa0')](_0x1b3062[_0xa12f('0x55')][_0xa12f('0x85')],_['omit'](_0x1b3062[_0xa12f('0x55')],['ids','id'])||{});}return null;})[_0xa12f('0x9b')](function(_0x41e91f){var _0x4eeb40;_0x2ee455=_0x41e91f||[];var _0x3e732a=[];if(_0x41e91f){for(var _0xa74c8d=0x0;_0xa74c8d<_0x41e91f[_0xa12f('0x45')];_0xa74c8d+=0x1){var _0x3fac4c=_0x41e91f[_0xa74c8d][_0xa12f('0x2b')]({'plain':!![]});_0x8c3e73['dialCheckDuplicateType']=_0x1b3062['body'][_0xa12f('0xa1')]?_0x1b3062[_0xa12f('0x55')][_0xa12f('0xa1')]:_0x8c3e73[_0xa12f('0xa1')];switch(_0x8c3e73[_0xa12f('0xa1')]){case'always':_0x4eeb40=squel[_0xa12f('0xa2')]()['into'](_0xa12f('0xa3'))[_0xa12f('0xa4')]([_0xa12f('0xa5'),_0xa12f('0xa6'),'ContactId','ListId','VoiceQueueId',_0xa12f('0x5f'),_0xa12f('0x60')],squel[_0xa12f('0x86')]()['field'](_0xa12f('0xa5'),_0xa12f('0xa5'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0xa6'))[_0xa12f('0x87')]('id',_0xa12f('0xa8'))['field'](_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')](),_0xa12f('0xab'))['field'](_0x1b3062[_0xa12f('0x52')]['id'][_0xa12f('0xaa')](),_0xa12f('0x64'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x5f'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x60'))[_0xa12f('0x88')](_0xa12f('0xac'))[_0xa12f('0x4a')](_0xa12f('0xad'))[_0xa12f('0x4a')](_0xa12f('0xae'),_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')]())[_0xa12f('0x4a')](_0xa12f('0xaf'))[_0xa12f('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa12f('0x86')]()[_0xa12f('0x87')]('COALESCE(calleridnum,\x27\x27)')[_0xa12f('0x88')]('cm_hopper_final')[_0xa12f('0x4a')](_0xa12f('0x8d'),_0x1b3062[_0xa12f('0x52')]['id']['toString']()))[_0xa12f('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa12f('0x86')]()['field'](_0xa12f('0xb0'))[_0xa12f('0x88')](_0xa12f('0xa3'))[_0xa12f('0x4a')](_0xa12f('0x8d'),_0x1b3062[_0xa12f('0x52')]['id'][_0xa12f('0xaa')]())))[_0xa12f('0xaa')]();break;case _0xa12f('0xb1'):_0x4eeb40=squel[_0xa12f('0xa2')]()[_0xa12f('0xb2')](_0xa12f('0xa3'))[_0xa12f('0xa4')](['phone',_0xa12f('0xa6'),_0xa12f('0xa8'),_0xa12f('0xab'),_0xa12f('0x64'),'createdAt',_0xa12f('0x60')],squel['select']()[_0xa12f('0x87')](_0xa12f('0xa5'),'phone')[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0xa6'))[_0xa12f('0x87')]('id',_0xa12f('0xa8'))[_0xa12f('0x87')](_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')](),_0xa12f('0xab'))[_0xa12f('0x87')](_0x1b3062[_0xa12f('0x52')]['id'][_0xa12f('0xaa')](),_0xa12f('0x64'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x5f'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x60'))[_0xa12f('0x88')](_0xa12f('0xac'))[_0xa12f('0x4a')]('deletedAt\x20IS\x20NULL')[_0xa12f('0x4a')](_0xa12f('0xae'),_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')]())[_0xa12f('0x4a')](_0xa12f('0xaf'))[_0xa12f('0x4a')](_0xa12f('0xb3'),squel[_0xa12f('0x86')]()[_0xa12f('0x87')](_0xa12f('0xb0'))['from']('cm_hopper')['where'](_0xa12f('0x8d'),_0x1b3062['params']['id']['toString']())))['toString']();break;default:_0x4eeb40=squel['insert']()[_0xa12f('0xb2')](_0xa12f('0xa3'))['fromQuery']([_0xa12f('0xa5'),_0xa12f('0xa6'),'ContactId','ListId',_0xa12f('0x64'),'createdAt',_0xa12f('0x60')],squel[_0xa12f('0x86')]()[_0xa12f('0x87')](_0xa12f('0xa5'),_0xa12f('0xa5'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0xa6'))['field']('id','ContactId')[_0xa12f('0x87')](_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')](),'ListId')[_0xa12f('0x87')](_0x1b3062[_0xa12f('0x52')]['id'][_0xa12f('0xaa')](),_0xa12f('0x64'))['field'](_0xa12f('0xa7'),_0xa12f('0x5f'))['field'](_0xa12f('0xa7'),'updatedAt')[_0xa12f('0x88')](_0xa12f('0xac'))[_0xa12f('0x4a')](_0xa12f('0xad'))[_0xa12f('0x4a')](_0xa12f('0xae'),_0x3fac4c[_0xa12f('0xa9')][_0xa12f('0xaa')]())['where'](_0xa12f('0xaf')))['toString']();}_0x3e732a[_0xa12f('0x8f')](db[_0xa12f('0x77')][_0xa12f('0x40')](_0x4eeb40));}return BPromise[_0xa12f('0x95')](_0x3e732a);}})[_0xa12f('0x29')](function(){return _0x2ee455;})[_0xa12f('0x29')](respondWithResult(_0x115b1d,null))['catch'](handleError(_0x115b1d,null));};exports[_0xa12f('0xb4')]=function(_0x45a2c8,_0x5c7077,_0x3833b4){return db['VoiceQueue']['find']({'where':{'id':_0x45a2c8[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x5c7077,null))['then'](function(_0x403b55){if(_0x403b55){return _0x403b55[_0xa12f('0xb4')](_0x45a2c8['query'][_0xa12f('0x85')]);}})['then'](function(_0x168400){if(_0x168400){return db[_0xa12f('0x63')]['destroy']({'where':{'ListId':_0x45a2c8[_0xa12f('0x40')][_0xa12f('0x85')],'VoiceQueueId':_0x45a2c8[_0xa12f('0x52')]['id']}})['then'](function(){return _0x168400;});}})[_0xa12f('0x29')](respondWithStatusCode(_0x5c7077,null))[_0xa12f('0x51')](handleError(_0x5c7077,null));};exports['getBlackLists']=function(_0x5c6680,_0x5d1821,_0x1f91c3){var _0x5c0aa5={};var _0x3923c4={};var _0xf969c2;var _0x3b5156;return db[_0xa12f('0x3b')][_0xa12f('0x62')]({'where':{'id':_0x5c6680[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x5d1821,null))[_0xa12f('0x29')](function(_0x460091){if(_0x460091){_0xf969c2=_0x460091;_0x3923c4[_0xa12f('0x42')]=_[_0xa12f('0x3f')](db[_0xa12f('0xb5')][_0xa12f('0x3c')]);_0x3923c4[_0xa12f('0x40')]=_[_0xa12f('0x3f')](_0x5c6680[_0xa12f('0x40')]);_0x3923c4[_0xa12f('0x4b')]=_[_0xa12f('0x41')](_0x3923c4[_0xa12f('0x42')],_0x3923c4['query']);_0x5c0aa5[_0xa12f('0x43')]=_[_0xa12f('0x41')](_0x3923c4[_0xa12f('0x42')],qs['fields'](_0x5c6680[_0xa12f('0x40')][_0xa12f('0x44')]));_0x5c0aa5[_0xa12f('0x43')]=_0x5c0aa5[_0xa12f('0x43')][_0xa12f('0x45')]?_0x5c0aa5[_0xa12f('0x43')]:_0x3923c4[_0xa12f('0x42')];_0x5c0aa5['order']=qs['sort'](_0x5c6680[_0xa12f('0x40')]['sort']);_0x5c0aa5[_0xa12f('0x4a')]=qs[_0xa12f('0x4b')](_[_0xa12f('0x4c')](_0x5c6680['query'],_0x3923c4[_0xa12f('0x4b')]));if(_0x5c6680[_0xa12f('0x40')]['filter']){_0x5c0aa5['where']=_['merge'](_0x5c0aa5[_0xa12f('0x4a')],{'$or':_[_0xa12f('0x3a')](_0x5c0aa5[_0xa12f('0x43')],function(_0x3f9c83){var _0x5df6d8={};_0x5df6d8[_0x3f9c83]={'$like':'%'+_0x5c6680['query'][_0xa12f('0x30')]+'%'};return _0x5df6d8;})});}_0x5c0aa5=_['merge']({},_0x5c0aa5,_0x5c6680[_0xa12f('0x4f')]);return _0xf969c2[_0xa12f('0xb6')](_0x5c0aa5);}})[_0xa12f('0x29')](function(_0xf91ed2){if(_0xf91ed2){_0x3b5156=_0xf91ed2[_0xa12f('0x45')];if(!_0x5c6680[_0xa12f('0x40')][_0xa12f('0x46')](_0xa12f('0x47'))){_0x5c0aa5[_0xa12f('0x23')]=qs[_0xa12f('0x23')](_0x5c6680[_0xa12f('0x40')]['limit']);_0x5c0aa5[_0xa12f('0x22')]=qs[_0xa12f('0x22')](_0x5c6680[_0xa12f('0x40')][_0xa12f('0x22')]);}return _0xf969c2[_0xa12f('0xb6')](_0x5c0aa5);}})['then'](function(_0x3037a4){if(_0x3037a4){return _0x3037a4?{'count':_0x3b5156,'rows':_0x3037a4}:null;}})[_0xa12f('0x29')](respondWithResult(_0x5d1821,null))[_0xa12f('0x51')](handleError(_0x5d1821,null));};exports[_0xa12f('0xb7')]=function(_0x159ee5,_0x344066,_0x54df6c){var _0x4bd914,_0x3c5dcc;return db[_0xa12f('0x3b')][_0xa12f('0x32')]({'where':{'id':_0x159ee5[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](handleEntityNotFound(_0x344066,null))[_0xa12f('0x29')](function(_0x34e111){if(_0x34e111){_0x3c5dcc=_0x34e111;return _0x34e111[_0xa12f('0xb7')](_0x159ee5[_0xa12f('0x55')][_0xa12f('0x85')],_[_0xa12f('0x5e')](_0x159ee5[_0xa12f('0x55')],['ids','id'])||{});}return null;})[_0xa12f('0x9b')](function(_0x12963f){var _0x58dcca;_0x4bd914=_0x12963f||[];var _0x160127=[];if(_0x12963f){for(var _0x281cdc=0x0;_0x281cdc<_0x12963f['length'];_0x281cdc+=0x1){var _0x23db85=_0x12963f[_0x281cdc]['get']({'plain':!![]});_0x58dcca=squel[_0xa12f('0xa2')]()[_0xa12f('0xb2')](_0xa12f('0xb8'))[_0xa12f('0xa4')](['phone',_0xa12f('0xa8'),_0xa12f('0xab'),'VoiceQueueId',_0xa12f('0x5f'),_0xa12f('0x60')],squel[_0xa12f('0x86')]()[_0xa12f('0x87')](_0xa12f('0xa5'),'phone')['field']('id',_0xa12f('0xa8'))['field'](_0x23db85[_0xa12f('0xa9')][_0xa12f('0xaa')](),_0xa12f('0xab'))['field'](_0x159ee5[_0xa12f('0x52')]['id'][_0xa12f('0xaa')](),'VoiceQueueId')[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x5f'))[_0xa12f('0x87')](_0xa12f('0xa7'),_0xa12f('0x60'))['from'](_0xa12f('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0xa12f('0x4a')](_0xa12f('0xae'),_0x23db85['CmListId'][_0xa12f('0xaa')]())[_0xa12f('0x4a')](_0xa12f('0xaf')))['toString']();_0x160127['push'](db[_0xa12f('0x77')][_0xa12f('0x40')](_0x58dcca));}return BPromise['all'](_0x160127);}})[_0xa12f('0x29')](function(){return _0x4bd914;})['then'](respondWithResult(_0x344066,null))[_0xa12f('0x51')](handleError(_0x344066,null));};exports['removeBlackLists']=function(_0x3869b2,_0x5ed0d8,_0x2b0373){return db[_0xa12f('0x3b')][_0xa12f('0x32')]({'where':{'id':_0x3869b2[_0xa12f('0x52')]['id']}})['then'](handleEntityNotFound(_0x5ed0d8,null))[_0xa12f('0x29')](function(_0x1d7771){if(_0x1d7771){return _0x1d7771[_0xa12f('0xb9')](_0x3869b2[_0xa12f('0x40')]['ids']);}})['then'](function(_0x1c2a07){if(_0x1c2a07){return db[_0xa12f('0x6b')][_0xa12f('0x2a')]({'where':{'ListId':_0x3869b2['query'][_0xa12f('0x85')],'VoiceQueueId':_0x3869b2[_0xa12f('0x52')]['id']}})[_0xa12f('0x29')](function(){return _0x1c2a07;});}})['then'](respondWithStatusCode(_0x5ed0d8,null))[_0xa12f('0x51')](handleError(_0x5ed0d8,null));}; \ No newline at end of file +var _0xe1cf=['SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','all','compact','isEmpty','removeAgents','addAgents','spread','voicePause','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','find','type','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','includeAll','include','catch','show','params','keys','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','findOne','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','interface','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format'];(function(_0x4b917f,_0x4a1145){var _0x5e50b2=function(_0x2b0cfe){while(--_0x2b0cfe){_0x4b917f['push'](_0x4b917f['shift']());}};_0x5e50b2(++_0x4a1145);}(_0xe1cf,0xef));var _0xfe1c=function(_0x3a18cc,_0xce7b9d){_0x3a18cc=_0x3a18cc-0x0;var _0x4978df=_0xe1cf[_0x3a18cc];return _0x4978df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe1c('0x0'));var zipdir=require(_0xfe1c('0x1'));var jsonpatch=require(_0xfe1c('0x2'));var rp=require(_0xfe1c('0x3'));var moment=require(_0xfe1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe1c('0x5'));var path=require(_0xfe1c('0x6'));var sox=require(_0xfe1c('0x7'));var csv=require(_0xfe1c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe1c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe1c('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfe1c('0xb'));var Redis=require(_0xfe1c('0xc'));var authService=require(_0xfe1c('0xd'));var qs=require(_0xfe1c('0xe'));var as=require(_0xfe1c('0xf'));var hardwareService=require(_0xfe1c('0x10'));var logger=require(_0xfe1c('0x11'))(_0xfe1c('0x12'));var utils=require(_0xfe1c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfe1c('0x14'));var db=require(_0xfe1c('0x15'))['db'];config[_0xfe1c('0x16')]=_['defaults'](config['redis'],{'host':_0xfe1c('0x17'),'port':0x18eb});var socket=require(_0xfe1c('0x18'))(new Redis(config[_0xfe1c('0x16')]));require(_0xfe1c('0x19'))[_0xfe1c('0x1a')](socket);function respondWithStatusCode(_0x5ec0cc,_0x48573c){_0x48573c=_0x48573c||0xcc;return function(_0x4080fc){if(_0x4080fc){return _0x5ec0cc[_0xfe1c('0x1b')](_0x48573c);}return _0x5ec0cc[_0xfe1c('0x1c')](_0x48573c)[_0xfe1c('0x1d')]();};}function respondWithResult(_0x18c084,_0x308cd4){_0x308cd4=_0x308cd4||0xc8;return function(_0x52f849){if(_0x52f849){return _0x18c084[_0xfe1c('0x1c')](_0x308cd4)[_0xfe1c('0x1e')](_0x52f849);}};}function respondWithFilteredResult(_0x905187,_0xbf51f6){return function(_0x67b426){if(_0x67b426){var _0x41358e=typeof _0xbf51f6[_0xfe1c('0x1f')]===_0xfe1c('0x20')&&typeof _0xbf51f6[_0xfe1c('0x21')]==='undefined';var _0x16c6f2=_0x67b426['count'];var _0x2e3bea=_0x41358e?0x0:_0xbf51f6['offset'];var _0x58cbb2=_0x41358e?_0x67b426[_0xfe1c('0x22')]:_0xbf51f6[_0xfe1c('0x1f')]+_0xbf51f6[_0xfe1c('0x21')];var _0x15696f;if(_0x58cbb2>=_0x16c6f2){_0x58cbb2=_0x16c6f2;_0x15696f=0xc8;}else{_0x15696f=0xce;}_0x905187[_0xfe1c('0x1c')](_0x15696f);return _0x905187[_0xfe1c('0x23')]('Content-Range',_0x2e3bea+'-'+_0x58cbb2+'/'+_0x16c6f2)[_0xfe1c('0x1e')](_0x67b426);}return null;};}function patchUpdates(_0x4fe9d6){return function(_0x1fbcae){try{jsonpatch[_0xfe1c('0x24')](_0x1fbcae,_0x4fe9d6,!![]);}catch(_0x52e61c){return BPromise['reject'](_0x52e61c);}return _0x1fbcae[_0xfe1c('0x25')]();};}function saveUpdates(_0x23ba19,_0x3eff99){return function(_0x26b894){if(_0x26b894){return _0x26b894[_0xfe1c('0x26')](_0x23ba19)[_0xfe1c('0x27')](function(_0xd8bccb){return _0xd8bccb;});}return null;};}function removeEntity(_0x2d64b7,_0x44f579){return function(_0x1a5694){if(_0x1a5694){return _0x1a5694[_0xfe1c('0x28')]()[_0xfe1c('0x27')](function(){var _0x53411d=_0x1a5694[_0xfe1c('0x29')]({'plain':!![]});var _0x2e5484=[{'name':_0xfe1c('0x2a'),'value':_0xfe1c('0x2b'),'ignore':![]},{'name':_0xfe1c('0x2c'),'value':_0xfe1c('0x2d'),'ignore':![]}];var _0x59547b=_(_0x2e5484)[_0xfe1c('0x2e')]('ignore')[_0xfe1c('0x2f')](_0xfe1c('0x30'))[_0xfe1c('0x30')]();if(_['includes'](_0x59547b,_0x53411d['type'])){return;}var _0x23cd0d=_[_0xfe1c('0x31')](_0x2e5484,[_0xfe1c('0x30'),_0x53411d[_0xfe1c('0x32')]])[_0xfe1c('0x33')];return db[_0xfe1c('0x34')][_0xfe1c('0x28')]({'where':{'type':_0x23cd0d,'resourceId':_0x53411d['id']}})[_0xfe1c('0x27')](function(){return _0x1a5694;});})[_0xfe1c('0x27')](function(){_0x2d64b7[_0xfe1c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19bf32,_0xe506de){return function(_0x5b65ef){if(!_0x5b65ef){_0x19bf32[_0xfe1c('0x1b')](0x194);}return _0x5b65ef;};}function handleError(_0x2703a9,_0x4967c1){_0x4967c1=_0x4967c1||0x1f4;return function(_0x3dfd04){logger['error'](_0x3dfd04[_0xfe1c('0x35')]);if(_0x3dfd04['name']){delete _0x3dfd04[_0xfe1c('0x33')];}_0x2703a9[_0xfe1c('0x1c')](_0x4967c1)[_0xfe1c('0x36')](_0x3dfd04);};}exports[_0xfe1c('0x37')]=function(_0x3e004f,_0xf39200){var _0x419bb3={},_0x49cd95={},_0x19eeec={'count':0x0,'rows':[]};var _0x35cc88=_[_0xfe1c('0x2f')](db[_0xfe1c('0x38')][_0xfe1c('0x39')],function(_0x26ccb5){return{'name':_0x26ccb5[_0xfe1c('0x3a')],'type':_0x26ccb5[_0xfe1c('0x32')][_0xfe1c('0x3b')]};});_0x49cd95[_0xfe1c('0x3c')]=_[_0xfe1c('0x2f')](_0x35cc88,'name');_0x49cd95['query']=_['keys'](_0x3e004f[_0xfe1c('0x3d')]);_0x49cd95['filters']=_['intersection'](_0x49cd95['model'],_0x49cd95[_0xfe1c('0x3d')]);_0x419bb3[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x49cd95['model'],qs[_0xfe1c('0x40')](_0x3e004f['query'][_0xfe1c('0x40')]));_0x419bb3['attributes']=_0x419bb3['attributes']['length']?_0x419bb3[_0xfe1c('0x3e')]:_0x49cd95[_0xfe1c('0x3c')];if(!_0x3e004f['query'][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x419bb3[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x3e004f[_0xfe1c('0x3d')]['limit']);_0x419bb3['offset']=qs['offset'](_0x3e004f[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}_0x419bb3[_0xfe1c('0x43')]=qs['sort'](_0x3e004f['query'][_0xfe1c('0x44')]);_0x419bb3[_0xfe1c('0x45')]=qs[_0xfe1c('0x46')](_[_0xfe1c('0x47')](_0x3e004f[_0xfe1c('0x3d')],_0x49cd95[_0xfe1c('0x46')]),_0x35cc88);if(_0x3e004f[_0xfe1c('0x3d')][_0xfe1c('0x2e')]){_0x419bb3[_0xfe1c('0x45')]=_['merge'](_0x419bb3['where'],{'$or':_[_0xfe1c('0x2f')](_0x35cc88,function(_0x53a538){if(_0x53a538['type']!=='VIRTUAL'){var _0x3651a5={};_0x3651a5[_0x53a538['name']]={'$like':'%'+_0x3e004f[_0xfe1c('0x3d')][_0xfe1c('0x2e')]+'%'};return _0x3651a5;}})});}_0x419bb3=_[_0xfe1c('0x48')]({},_0x419bb3,_0x3e004f['options']);var _0x2fbd6a={'where':_0x419bb3[_0xfe1c('0x45')]};return db[_0xfe1c('0x38')]['count'](_0x2fbd6a)['then'](function(_0x222322){_0x19eeec[_0xfe1c('0x22')]=_0x222322;if(_0x3e004f['query'][_0xfe1c('0x49')]){_0x419bb3[_0xfe1c('0x4a')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x419bb3);})[_0xfe1c('0x27')](function(_0x709df5){_0x19eeec['rows']=_0x709df5;return _0x19eeec;})[_0xfe1c('0x27')](respondWithFilteredResult(_0xf39200,_0x419bb3))[_0xfe1c('0x4b')](handleError(_0xf39200,null));};exports[_0xfe1c('0x4c')]=function(_0x34bc80,_0x356c63){var _0x16eeae={'raw':![],'where':{'id':_0x34bc80[_0xfe1c('0x4d')]['id']}},_0x9485bd={};_0x9485bd[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x38')][_0xfe1c('0x39')]);_0x9485bd['query']=_[_0xfe1c('0x4e')](_0x34bc80[_0xfe1c('0x3d')]);_0x9485bd[_0xfe1c('0x46')]=_['intersection'](_0x9485bd[_0xfe1c('0x3c')],_0x9485bd['query']);_0x16eeae[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x9485bd['model'],qs[_0xfe1c('0x40')](_0x34bc80[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x16eeae['attributes']=_0x16eeae[_0xfe1c('0x3e')][_0xfe1c('0x4f')]?_0x16eeae['attributes']:_0x9485bd['model'];if(_0x34bc80[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0x16eeae[_0xfe1c('0x4a')]=[{'all':!![]}];}_0x16eeae=_[_0xfe1c('0x48')]({},_0x16eeae,_0x34bc80[_0xfe1c('0x50')]);return db[_0xfe1c('0x38')]['find'](_0x16eeae)[_0xfe1c('0x27')](handleEntityNotFound(_0x356c63,null))['then'](respondWithResult(_0x356c63,null))[_0xfe1c('0x4b')](handleError(_0x356c63,null));};exports[_0xfe1c('0x51')]=function(_0xe62ff9,_0x22f73f){return db[_0xfe1c('0x38')]['create'](_0xe62ff9[_0xfe1c('0x52')],{})[_0xfe1c('0x27')](function(_0x729f1d){var _0x51c0bf=_0xe62ff9[_0xfe1c('0x53')][_0xfe1c('0x29')]({'plain':!![]});if(!_0x51c0bf)throw new Error(_0xfe1c('0x54'));if(_0x51c0bf[_0xfe1c('0x55')]===_0xfe1c('0x53')){var _0x1d4673=_0x729f1d[_0xfe1c('0x29')]({'plain':!![]});var _0x2c177d=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xfe1c('0x2c'),'value':'outbound'}];var _0x1d97bc=_[_0xfe1c('0x31')](_0x2c177d,[_0xfe1c('0x30'),_0x1d4673[_0xfe1c('0x32')]])[_0xfe1c('0x33')];return db[_0xfe1c('0x56')][_0xfe1c('0x31')]({'where':{'name':_0x1d97bc,'userProfileId':_0x51c0bf[_0xfe1c('0x57')]},'raw':!![]})[_0xfe1c('0x27')](function(_0x4cc804){if(_0x4cc804&&_0x4cc804[_0xfe1c('0x58')]===0x0){return db[_0xfe1c('0x34')][_0xfe1c('0x51')]({'name':_0x1d4673[_0xfe1c('0x33')],'resourceId':_0x1d4673['id'],'type':_0x4cc804['name'],'sectionId':_0x4cc804['id']},{})['then'](function(){return _0x729f1d;});}else{return _0x729f1d;}})['catch'](function(_0x989aef){logger[_0xfe1c('0x59')](_0xfe1c('0x5a'),_0x989aef);throw _0x989aef;});}return _0x729f1d;})['then'](respondWithResult(_0x22f73f,0xc9))[_0xfe1c('0x4b')](handleError(_0x22f73f,null));};exports[_0xfe1c('0x5b')]=function(_0x4a710f,_0x38dba5){var _0x489a48={'where':{'id':_0x4a710f[_0xfe1c('0x4d')]['id']}},_0x187fdb={};_0x187fdb[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db['VoiceQueue'][_0xfe1c('0x39')]);_0x489a48[_0xfe1c('0x3e')]=_['intersection'](_0x187fdb['model'],qs[_0xfe1c('0x40')](_0x4a710f[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x489a48[_0xfe1c('0x3e')]=_0x489a48['attributes'][_0xfe1c('0x4f')]?_0x489a48[_0xfe1c('0x3e')]:_0x187fdb['model'];if(_0x4a710f[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0x489a48[_0xfe1c('0x4a')]=[{'all':!![]}];}_0x489a48=_[_0xfe1c('0x48')]({},_0x489a48,_0x4a710f[_0xfe1c('0x50')]);return db[_0xfe1c('0x38')][_0xfe1c('0x31')](_0x489a48)[_0xfe1c('0x27')](handleEntityNotFound(_0x38dba5,null))[_0xfe1c('0x27')](function(_0x19b314){if(_0x19b314){var _0x189666=_0x19b314[_0xfe1c('0x29')]({'plain':!![]});_0x189666=qs[_0xfe1c('0x5c')](_0x189666,['id',_0xfe1c('0x5d'),_0xfe1c('0x5e')]);_0x4a710f[_0xfe1c('0x52')]=_['omit'](_0x4a710f['body'],['id',_0xfe1c('0x5d'),_0xfe1c('0x5e')]);return db[_0xfe1c('0x38')][_0xfe1c('0x51')](_[_0xfe1c('0x48')](_0x189666,_0x4a710f['body']),{'include':_0x4a710f[_0xfe1c('0x3d')][_0xfe1c('0x49')]?[{'all':!![]}]:undefined})[_0xfe1c('0x27')](function(_0x1f3663){var _0x4af5e8=_0x4a710f[_0xfe1c('0x53')][_0xfe1c('0x29')]({'plain':!![]});if(!_0x4af5e8)throw new Error(_0xfe1c('0x54'));if(_0x4af5e8[_0xfe1c('0x55')]===_0xfe1c('0x53')){var _0x69dbe3=_0x1f3663[_0xfe1c('0x29')]({'plain':!![]});var _0x272dd5=[{'name':_0xfe1c('0x2a'),'value':'inbound'},{'name':_0xfe1c('0x2c'),'value':'outbound'}];var _0x4bbf08=_['find'](_0x272dd5,[_0xfe1c('0x30'),_0x69dbe3[_0xfe1c('0x32')]])[_0xfe1c('0x33')];return db[_0xfe1c('0x56')][_0xfe1c('0x31')]({'where':{'name':_0x4bbf08,'userProfileId':_0x4af5e8[_0xfe1c('0x57')]},'raw':!![]})[_0xfe1c('0x27')](function(_0x1e6e6b){if(_0x1e6e6b&&_0x1e6e6b[_0xfe1c('0x58')]===0x0){return db['UserProfileResource'][_0xfe1c('0x51')]({'name':_0x69dbe3[_0xfe1c('0x33')],'resourceId':_0x69dbe3['id'],'type':_0x1e6e6b[_0xfe1c('0x33')],'sectionId':_0x1e6e6b['id']},{})[_0xfe1c('0x27')](function(){return _0x1f3663;});}else{return _0x1f3663;}})[_0xfe1c('0x4b')](function(_0x573e5c){logger['error'](_0xfe1c('0x5a'),_0x573e5c);throw _0x573e5c;});}return _0x1f3663;});}})[_0xfe1c('0x27')](respondWithResult(_0x38dba5,0xc9))[_0xfe1c('0x4b')](handleError(_0x38dba5,null));};exports[_0xfe1c('0x26')]=function(_0x2e1715,_0x3de8f6){if(_0x2e1715['body']['id']){delete _0x2e1715[_0xfe1c('0x52')]['id'];}return db[_0xfe1c('0x38')][_0xfe1c('0x31')]({'where':{'id':_0x2e1715[_0xfe1c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3de8f6,null))[_0xfe1c('0x27')](saveUpdates(_0x2e1715[_0xfe1c('0x52')],null))[_0xfe1c('0x27')](respondWithResult(_0x3de8f6,null))['catch'](handleError(_0x3de8f6,null));};exports[_0xfe1c('0x28')]=function(_0x35b79f,_0x349292){return db[_0xfe1c('0x38')]['find']({'where':{'id':_0x35b79f[_0xfe1c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x349292,null))['then'](removeEntity(_0x349292,null))[_0xfe1c('0x4b')](handleError(_0x349292,null));};exports[_0xfe1c('0x5f')]=function(_0x32628b,_0x56d558,_0xe9546c){var _0x17c06b={'raw':![],'where':{}};var _0x4b6da1={};var _0xc14f21={'count':0x0,'rows':[]};return db[_0xfe1c('0x38')]['findOne']({'where':{'id':_0x32628b[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x56d558,null))[_0xfe1c('0x27')](function(_0x4c867f){if(_0x4c867f){_0x4b6da1[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x60')][_0xfe1c('0x39')]);_0x4b6da1['query']=_[_0xfe1c('0x4e')](_0x32628b[_0xfe1c('0x3d')]);_0x4b6da1[_0xfe1c('0x46')]=_['intersection'](_0x4b6da1[_0xfe1c('0x3c')],_0x4b6da1[_0xfe1c('0x3d')]);_0x17c06b[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x4b6da1[_0xfe1c('0x3c')],qs['fields'](_0x32628b[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x17c06b[_0xfe1c('0x3e')]=_0x17c06b[_0xfe1c('0x3e')][_0xfe1c('0x4f')]?_0x17c06b[_0xfe1c('0x3e')]:_0x4b6da1[_0xfe1c('0x3c')];if(!_0x32628b[_0xfe1c('0x3d')][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x17c06b[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x32628b[_0xfe1c('0x3d')][_0xfe1c('0x21')]);_0x17c06b[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x32628b[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}_0x17c06b[_0xfe1c('0x43')]=qs[_0xfe1c('0x44')](_0x32628b['query'][_0xfe1c('0x44')]);_0x17c06b['where']=qs[_0xfe1c('0x46')](_['pick'](_0x32628b[_0xfe1c('0x3d')],_0x4b6da1['filters']));_0x17c06b[_0xfe1c('0x45')]['VoiceQueueId']=_0x4c867f['id'];if(_0x32628b['query'][_0xfe1c('0x2e')]){_0x17c06b[_0xfe1c('0x45')]=_['merge'](_0x17c06b[_0xfe1c('0x45')],{'$or':_['map'](_0x17c06b[_0xfe1c('0x3e')],function(_0x447826){var _0x22e6c8={};_0x22e6c8[_0x447826]={'$like':'%'+_0x32628b[_0xfe1c('0x3d')]['filter']+'%'};return _0x22e6c8;})});}_0x17c06b=_['merge']({},_0x17c06b,_0x32628b[_0xfe1c('0x50')]);return db[_0xfe1c('0x60')]['count']({'where':_0x17c06b['where']})[_0xfe1c('0x27')](function(_0x66986e){_0xc14f21[_0xfe1c('0x22')]=_0x66986e;if(_0x32628b[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0x17c06b[_0xfe1c('0x4a')]=[{'all':!![]}];}return db[_0xfe1c('0x60')][_0xfe1c('0x61')](_0x17c06b);})[_0xfe1c('0x27')](function(_0x2984a8){_0xc14f21[_0xfe1c('0x62')]=_0x2984a8;return _0xc14f21;});}})[_0xfe1c('0x27')](respondWithFilteredResult(_0x56d558,_0x17c06b))[_0xfe1c('0x4b')](handleError(_0x56d558,null));};exports[_0xfe1c('0x63')]=function(_0x374949,_0x42072d,_0x59c23b){var _0x4f5141={'raw':!![],'where':{}};var _0x535ff8={};var _0x586c01={'count':0x0,'rows':[]};return db[_0xfe1c('0x38')]['findOne']({'where':{'id':_0x374949[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x42072d,null))[_0xfe1c('0x27')](function(_0x55adbe){if(_0x55adbe){_0x535ff8[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x64')][_0xfe1c('0x39')]);_0x535ff8[_0xfe1c('0x3d')]=_[_0xfe1c('0x4e')](_0x374949[_0xfe1c('0x3d')]);_0x535ff8['filters']=_[_0xfe1c('0x3f')](_0x535ff8['model'],_0x535ff8['query']);_0x4f5141['attributes']=_[_0xfe1c('0x3f')](_0x535ff8['model'],qs[_0xfe1c('0x40')](_0x374949[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x4f5141['attributes']=_0x4f5141['attributes']['length']?_0x4f5141[_0xfe1c('0x3e')]:_0x535ff8[_0xfe1c('0x3c')];if(!_0x374949['query']['hasOwnProperty'](_0xfe1c('0x42'))){_0x4f5141[_0xfe1c('0x21')]=qs['limit'](_0x374949['query']['limit']);_0x4f5141[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x374949[_0xfe1c('0x3d')]['offset']);}_0x4f5141[_0xfe1c('0x43')]=qs[_0xfe1c('0x44')](_0x374949[_0xfe1c('0x3d')]['sort']);_0x4f5141[_0xfe1c('0x45')]=qs['filters'](_[_0xfe1c('0x47')](_0x374949[_0xfe1c('0x3d')],_0x535ff8[_0xfe1c('0x46')]));_0x4f5141[_0xfe1c('0x45')][_0xfe1c('0x65')]=_0x55adbe['id'];if(_0x374949[_0xfe1c('0x3d')]['filter']){_0x4f5141[_0xfe1c('0x45')]=_['merge'](_0x4f5141[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x4f5141[_0xfe1c('0x3e')],function(_0x45cb5e){var _0x525b27={};_0x525b27[_0x45cb5e]={'$like':'%'+_0x374949['query'][_0xfe1c('0x2e')]+'%'};return _0x525b27;})});}_0x4f5141=_[_0xfe1c('0x48')]({},_0x4f5141,_0x374949[_0xfe1c('0x50')]);return db[_0xfe1c('0x64')]['count']({'where':_0x4f5141[_0xfe1c('0x45')]})['then'](function(_0x2ff234){_0x586c01['count']=_0x2ff234;if(_0x374949[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0x4f5141[_0xfe1c('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xfe1c('0x61')](_0x4f5141);})[_0xfe1c('0x27')](function(_0x533d49){_0x586c01['rows']=_0x533d49;return _0x586c01;});}})[_0xfe1c('0x27')](respondWithFilteredResult(_0x42072d,_0x4f5141))[_0xfe1c('0x4b')](handleError(_0x42072d,null));};exports[_0xfe1c('0x66')]=function(_0x422004,_0x1665de,_0x3a36d7){var _0xde9c87={'raw':!![],'where':{}};var _0x1fbdc1={};var _0x5ce481={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x422004[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x1665de,null))[_0xfe1c('0x27')](function(_0x13bb1c){if(_0x13bb1c){_0x1fbdc1[_0xfe1c('0x3c')]=_['keys'](db[_0xfe1c('0x67')][_0xfe1c('0x39')]);_0x1fbdc1[_0xfe1c('0x3d')]=_[_0xfe1c('0x4e')](_0x422004[_0xfe1c('0x3d')]);_0x1fbdc1['filters']=_[_0xfe1c('0x3f')](_0x1fbdc1[_0xfe1c('0x3c')],_0x1fbdc1[_0xfe1c('0x3d')]);_0xde9c87[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x1fbdc1[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0xde9c87['attributes']=_0xde9c87[_0xfe1c('0x3e')][_0xfe1c('0x4f')]?_0xde9c87[_0xfe1c('0x3e')]:_0x1fbdc1[_0xfe1c('0x3c')];if(!_0x422004['query']['hasOwnProperty'](_0xfe1c('0x42'))){_0xde9c87[_0xfe1c('0x21')]=qs['limit'](_0x422004['query']['limit']);_0xde9c87['offset']=qs[_0xfe1c('0x1f')](_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}_0xde9c87[_0xfe1c('0x43')]=qs[_0xfe1c('0x44')](_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0xde9c87[_0xfe1c('0x45')]=qs[_0xfe1c('0x46')](_['pick'](_0x422004[_0xfe1c('0x3d')],_0x1fbdc1[_0xfe1c('0x46')]));_0xde9c87[_0xfe1c('0x45')][_0xfe1c('0x65')]=_0x13bb1c['id'];if(_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x2e')]){_0xde9c87[_0xfe1c('0x45')]=_[_0xfe1c('0x48')](_0xde9c87[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0xde9c87['attributes'],function(_0x5ae528){var _0x48242c={};_0x48242c[_0x5ae528]={'$like':'%'+_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x2e')]+'%'};return _0x48242c;})});}_0xde9c87=_[_0xfe1c('0x48')]({},_0xde9c87,_0x422004[_0xfe1c('0x50')]);return db[_0xfe1c('0x67')][_0xfe1c('0x22')]({'where':_0xde9c87['where']})['then'](function(_0x19a11c){_0x5ce481['count']=_0x19a11c;if(_0x422004[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0xde9c87['include']=[{'all':!![]}];}return db[_0xfe1c('0x67')][_0xfe1c('0x61')](_0xde9c87);})[_0xfe1c('0x27')](function(_0xd82092){_0x5ce481[_0xfe1c('0x62')]=_0xd82092;return _0x5ce481;});}})['then'](respondWithFilteredResult(_0x1665de,_0xde9c87))[_0xfe1c('0x4b')](handleError(_0x1665de,null));};exports[_0xfe1c('0x68')]=function(_0x4d1076,_0x39a9ab,_0x4f9f04){var _0x22ef82={'raw':!![],'where':{}};var _0x1c3758={};var _0x31da58={'count':0x0,'rows':[]};return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x4d1076[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x39a9ab,null))[_0xfe1c('0x27')](function(_0x914ff1){if(_0x914ff1){_0x1c3758[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db['CmHopperBlack'][_0xfe1c('0x39')]);_0x1c3758[_0xfe1c('0x3d')]=_['keys'](_0x4d1076[_0xfe1c('0x3d')]);_0x1c3758['filters']=_[_0xfe1c('0x3f')](_0x1c3758['model'],_0x1c3758[_0xfe1c('0x3d')]);_0x22ef82[_0xfe1c('0x3e')]=_['intersection'](_0x1c3758[_0xfe1c('0x3c')],qs['fields'](_0x4d1076['query'][_0xfe1c('0x40')]));_0x22ef82[_0xfe1c('0x3e')]=_0x22ef82['attributes']['length']?_0x22ef82[_0xfe1c('0x3e')]:_0x1c3758[_0xfe1c('0x3c')];if(!_0x4d1076[_0xfe1c('0x3d')][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x22ef82[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x4d1076['query']['limit']);_0x22ef82[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x4d1076[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}_0x22ef82['order']=qs[_0xfe1c('0x44')](_0x4d1076[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0x22ef82[_0xfe1c('0x45')]=qs['filters'](_[_0xfe1c('0x47')](_0x4d1076[_0xfe1c('0x3d')],_0x1c3758[_0xfe1c('0x46')]));_0x22ef82[_0xfe1c('0x45')][_0xfe1c('0x65')]=_0x914ff1['id'];if(_0x4d1076['query']['filter']){_0x22ef82['where']=_[_0xfe1c('0x48')](_0x22ef82[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x22ef82[_0xfe1c('0x3e')],function(_0x40f581){var _0x450e07={};_0x450e07[_0x40f581]={'$like':'%'+_0x4d1076[_0xfe1c('0x3d')][_0xfe1c('0x2e')]+'%'};return _0x450e07;})});}_0x22ef82=_[_0xfe1c('0x48')]({},_0x22ef82,_0x4d1076['options']);return db[_0xfe1c('0x6a')][_0xfe1c('0x22')]({'where':_0x22ef82[_0xfe1c('0x45')]})['then'](function(_0x26eef6){_0x31da58[_0xfe1c('0x22')]=_0x26eef6;if(_0x4d1076[_0xfe1c('0x3d')][_0xfe1c('0x49')]){_0x22ef82[_0xfe1c('0x4a')]=[{'all':!![]}];}return db[_0xfe1c('0x6a')][_0xfe1c('0x61')](_0x22ef82);})[_0xfe1c('0x27')](function(_0x4e8c65){_0x31da58['rows']=_0x4e8c65;return _0x31da58;});}})[_0xfe1c('0x27')](respondWithFilteredResult(_0x39a9ab,_0x22ef82))[_0xfe1c('0x4b')](handleError(_0x39a9ab,null));};exports['getTeams']=function(_0x570a90,_0x4d92d7,_0x4f2f87){var _0x277d9a={};var _0x177828={};var _0xe1d96b;var _0x207aa1;return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x570a90['params']['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x4d92d7,null))['then'](function(_0x748a2b){if(_0x748a2b){_0xe1d96b=_0x748a2b;_0x177828[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x6b')]['rawAttributes']);_0x177828[_0xfe1c('0x3d')]=_['keys'](_0x570a90[_0xfe1c('0x3d')]);_0x177828[_0xfe1c('0x46')]=_[_0xfe1c('0x3f')](_0x177828[_0xfe1c('0x3c')],_0x177828[_0xfe1c('0x3d')]);_0x277d9a[_0xfe1c('0x3e')]=_['intersection'](_0x177828[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x570a90[_0xfe1c('0x3d')]['fields']));_0x277d9a[_0xfe1c('0x3e')]=_0x277d9a[_0xfe1c('0x3e')]['length']?_0x277d9a[_0xfe1c('0x3e')]:_0x177828[_0xfe1c('0x3c')];_0x277d9a[_0xfe1c('0x43')]=qs[_0xfe1c('0x44')](_0x570a90[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0x277d9a[_0xfe1c('0x45')]=qs['filters'](_[_0xfe1c('0x47')](_0x570a90[_0xfe1c('0x3d')],_0x177828['filters']));if(_0x570a90[_0xfe1c('0x3d')][_0xfe1c('0x2e')]){_0x277d9a['where']=_[_0xfe1c('0x48')](_0x277d9a[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x277d9a['attributes'],function(_0x445818){var _0x4d3e86={};_0x4d3e86[_0x445818]={'$like':'%'+_0x570a90[_0xfe1c('0x3d')][_0xfe1c('0x2e')]+'%'};return _0x4d3e86;})});}_0x277d9a=_[_0xfe1c('0x48')]({},_0x277d9a,_0x570a90[_0xfe1c('0x50')]);return _0xe1d96b['getTeams'](_0x277d9a);}})[_0xfe1c('0x27')](function(_0x19c8d3){if(_0x19c8d3){_0x207aa1=_0x19c8d3[_0xfe1c('0x4f')];if(!_0x570a90[_0xfe1c('0x3d')][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x277d9a[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x570a90['query']['limit']);_0x277d9a['offset']=qs[_0xfe1c('0x1f')](_0x570a90[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}return _0xe1d96b[_0xfe1c('0x6c')](_0x277d9a);}})['then'](function(_0x3939b4){if(_0x3939b4){return _0x3939b4?{'count':_0x207aa1,'rows':_0x3939b4}:null;}})[_0xfe1c('0x27')](respondWithResult(_0x4d92d7,null))[_0xfe1c('0x4b')](handleError(_0x4d92d7,null));};exports[_0xfe1c('0x6d')]=function(_0x37895e,_0x3dfb09,_0x5bace5){var _0x420e26=_0x37895e[_0xfe1c('0x52')][_0xfe1c('0x6e')];var _0x1738eb=_[_0xfe1c('0x2f')](_0x420e26,'id');return db['Team'][_0xfe1c('0x61')]({'where':{'id':_0x1738eb},'attributes':['id'],'include':[{'model':db[_0xfe1c('0x6f')],'as':_0xfe1c('0x70'),'attributes':['id',_0xfe1c('0x33'),_0xfe1c('0x71'),'voicePause',_0xfe1c('0x72')],'raw':!![]}]})[_0xfe1c('0x27')](function(_0x2a731e){if(_0x2a731e){var _0x47f3a0=_['flatMap'](_0x2a731e,function(_0x33264a){var _0x2e65df=_0x33264a[_0xfe1c('0x29')]({'plain':!![]});_0x2e65df['Agents'][_0xfe1c('0x73')](function(_0x316b82){_0x316b82[_0xfe1c('0x74')]=_['find'](_0x420e26,{'id':_0x2e65df['id']})[_0xfe1c('0x74')];});return _0x2e65df[_0xfe1c('0x70')];});return db['VoiceQueue'][_0xfe1c('0x31')]({'where':{'id':_0x37895e[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](function(_0x4db6c5){return db['sequelize'][_0xfe1c('0x75')](function(_0x3ce10d){return _0x4db6c5[_0xfe1c('0x6d')](_0x1738eb,{'transaction':_0x3ce10d})[_0xfe1c('0x27')](function(){return BPromise[_0xfe1c('0x76')](_0x420e26,function(_0x62187b){return db[_0xfe1c('0x77')][_0xfe1c('0x78')]({'TeamId':_0x62187b['id'],'VoiceQueueId':_0x37895e[_0xfe1c('0x4d')]['id'],'penalty':_0x62187b[_0xfe1c('0x74')]},{'transaction':_0x3ce10d});});})[_0xfe1c('0x27')](function(){return BPromise[_0xfe1c('0x76')](_0x47f3a0,function(_0x55c7de){return db[_0xfe1c('0x79')]['findOrCreate']({'where':{'UserId':_0x55c7de['id'],'VoiceQueueId':_0x37895e[_0xfe1c('0x4d')]['id']},'defaults':{'penalty':_0x55c7de[_0xfe1c('0x74')]},'transaction':_0x3ce10d});});})[_0xfe1c('0x27')](function(){return BPromise['each'](_[_0xfe1c('0x2e')](_0x47f3a0,{'online':!![]}),function(_0x279063){return db[_0xfe1c('0x7a')][_0xfe1c('0x78')]({'membername':_0x279063['name'],'UserId':_0x279063['id'],'queue_name':_0x4db6c5[_0xfe1c('0x33')],'VoiceQueueId':_0x4db6c5['id'],'interface':_[_0xfe1c('0x7b')](_0x279063[_0xfe1c('0x72')])?util[_0xfe1c('0x7c')](_0xfe1c('0x7d'),_0x279063[_0xfe1c('0x33')]):_0x279063[_0xfe1c('0x72')],'paused':_0x279063['voicePause']||![],'penalty':_0x279063[_0xfe1c('0x74')]},{'transaction':_0x3ce10d});});})[_0xfe1c('0x27')](function(){_0x47f3a0['forEach'](function(_0x3d2cba){socket[_0xfe1c('0x7e')](_0xfe1c('0x7f'),{'UserId':_0x3d2cba['id'],'VoiceQueueId':_0x4db6c5['id']});});});});});}})['then'](respondWithStatusCode(_0x3dfb09,null))['catch'](handleError(_0x3dfb09,null));};exports['removeTeams']=function(_0x26aacf,_0x23ad3b,_0x2404cf){return db[_0xfe1c('0x6b')][_0xfe1c('0x61')]({'where':{'id':_0x26aacf[_0xfe1c('0x3d')][_0xfe1c('0x80')]},'attributes':['id'],'include':[{'model':db[_0xfe1c('0x6f')],'as':_0xfe1c('0x70'),'attributes':['id'],'raw':!![]}]})[_0xfe1c('0x27')](handleEntityNotFound(_0x23ad3b,null))[_0xfe1c('0x27')](function(_0x243a71){var _0x3343d9=_['map'](_0x243a71,'id');var _0x14c534=[];var _0x22d3d8=[];var _0x33e644=squel[_0xfe1c('0x81')]();_0x33e644[_0xfe1c('0x82')](_0xfe1c('0x83'))['from']('team_has_voice_queues','tq')[_0xfe1c('0x84')](_0xfe1c('0x85'),'ut',_0xfe1c('0x86'))[_0xfe1c('0x45')](_0xfe1c('0x87'),_0x26aacf[_0xfe1c('0x4d')]['id']);for(var _0x456cf0=0x0;_0x456cf0<_0x243a71[_0xfe1c('0x4f')];_0x456cf0+=0x1){let _0x4dd16b=_0x243a71[_0x456cf0];for(var _0x49ad2c=0x0;_0x49ad2c<_0x4dd16b['Agents']['length'];_0x49ad2c+=0x1){let _0x21d8bc=_0x4dd16b[_0xfe1c('0x70')][_0x49ad2c];var _0x50c049=_0x33e644[_0xfe1c('0x5b')]();_0x50c049[_0xfe1c('0x45')](_0xfe1c('0x88'),_0x21d8bc['id']);_0x22d3d8[_0xfe1c('0x89')](db[_0xfe1c('0x8a')][_0xfe1c('0x3d')](_0x50c049[_0xfe1c('0x8b')](),{'type':db[_0xfe1c('0x8a')][_0xfe1c('0x8c')][_0xfe1c('0x8d')]})[_0xfe1c('0x27')](function(_0x416237){if(_0x416237[_0xfe1c('0x4f')]===0x1){return _0x21d8bc['id'];}else{var _0x4b6ec3=_[_0xfe1c('0x8e')](_[_0xfe1c('0x2f')](_0x416237,'TeamId'),function(_0x1a00af){return _['includes'](_0x3343d9,_0x1a00af);});if(_0x4b6ec3){return _0x21d8bc['id'];}}}));}}return BPromise[_0xfe1c('0x8f')](_0x22d3d8)[_0xfe1c('0x27')](function(_0x1ea07c){_0x14c534=_(_0x14c534)['union'](_0x1ea07c)[_0xfe1c('0x90')]()['value']();return db['VoiceQueue'][_0xfe1c('0x31')]({'where':{'id':_0x26aacf['params']['id']}})[_0xfe1c('0x27')](function(_0x44c5ff){return db[_0xfe1c('0x8a')]['transaction'](function(_0x562ea6){return _0x44c5ff['removeTeams'](_0x26aacf[_0xfe1c('0x3d')][_0xfe1c('0x80')],{'transaction':_0x562ea6})[_0xfe1c('0x27')](function(){if(!_[_0xfe1c('0x91')](_0x14c534)){return _0x44c5ff[_0xfe1c('0x92')](_0x14c534,{'transaction':_0x562ea6})[_0xfe1c('0x27')](function(){return db[_0xfe1c('0x7a')][_0xfe1c('0x28')]({'where':{'VoiceQueueId':_0x26aacf[_0xfe1c('0x4d')]['id'],'UserId':_0x14c534},'transaction':_0x562ea6});});}})[_0xfe1c('0x27')](function(){_0x14c534[_0xfe1c('0x73')](function(_0x1b483a){socket['emit']('userVoiceQueue:remove',{'UserId':_0x1b483a,'VoiceQueueId':_0x44c5ff['id']});});});});});});})[_0xfe1c('0x27')](respondWithStatusCode(_0x23ad3b,null))[_0xfe1c('0x4b')](handleError(_0x23ad3b,null));};exports['addAgents']=function(_0x2e7cc1,_0x2482e6,_0x1fdc1a){var _0x1323c7,_0x4e9bac;return db[_0xfe1c('0x38')]['find']({'where':{'id':_0x2e7cc1[_0xfe1c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2482e6,null))[_0xfe1c('0x27')](function(_0xc66f95){if(_0xc66f95){_0x4e9bac=_0xc66f95;return _0xc66f95[_0xfe1c('0x93')](_0x2e7cc1[_0xfe1c('0x52')][_0xfe1c('0x80')],_[_0xfe1c('0x5c')](_0x2e7cc1[_0xfe1c('0x52')],['ids','id'])||{})[_0xfe1c('0x94')](function(_0x5ca78e){for(var _0x4502f0=0x0;_0x4502f0<_0x2e7cc1['body']['ids'][_0xfe1c('0x4f')];_0x4502f0+=0x1){socket[_0xfe1c('0x7e')](_0xfe1c('0x7f'),{'UserId':Number(_0x2e7cc1[_0xfe1c('0x52')]['ids'][_0x4502f0]),'VoiceQueueId':Number(_0x2e7cc1[_0xfe1c('0x4d')]['id'])});}return _0x5ca78e;});}})[_0xfe1c('0x27')](function(_0x51fb10){_0x1323c7=_0x51fb10||[];if(_0x4e9bac){return db[_0xfe1c('0x6f')][_0xfe1c('0x61')]({'where':{'id':_0x2e7cc1[_0xfe1c('0x52')][_0xfe1c('0x80')]},'attributes':['id','name',_0xfe1c('0x71'),_0xfe1c('0x95'),_0xfe1c('0x72')],'raw':!![]});}})['then'](function(_0x53d0ad){if(!_[_0xfe1c('0x91')](_0x53d0ad)){var _0x1715b4=[];for(var _0x32a0f5=0x0;_0x32a0f5<_0x53d0ad[_0xfe1c('0x4f')];_0x32a0f5++){if(_0x53d0ad[_0x32a0f5][_0xfe1c('0x71')]){_0x1715b4[_0xfe1c('0x89')](db[_0xfe1c('0x7a')][_0xfe1c('0x78')]({'membername':_0x53d0ad[_0x32a0f5][_0xfe1c('0x33')],'UserId':_0x53d0ad[_0x32a0f5]['id'],'queue_name':_0x4e9bac['name'],'VoiceQueueId':_0x4e9bac['id'],'interface':_[_0xfe1c('0x7b')](_0x53d0ad[_0x32a0f5]['interface'])?util[_0xfe1c('0x7c')](_0xfe1c('0x7d'),_0x53d0ad[_0x32a0f5][_0xfe1c('0x33')]):_0x53d0ad[_0x32a0f5]['interface'],'paused':_0x53d0ad[_0x32a0f5][_0xfe1c('0x95')]||![],'penalty':_0x2e7cc1[_0xfe1c('0x52')][_0xfe1c('0x74')]||0x0}));}}return BPromise['all'](_0x1715b4);}})[_0xfe1c('0x27')](function(){return _0x1323c7;})[_0xfe1c('0x27')](respondWithResult(_0x2482e6,null))['catch'](handleError(_0x2482e6,null));};exports[_0xfe1c('0x92')]=function(_0x276b26,_0x4d7b24,_0x2dfd0e){return db[_0xfe1c('0x38')][_0xfe1c('0x31')]({'where':{'id':_0x276b26[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x4d7b24,null))['then'](function(_0x132977){if(_0x132977){return _0x132977['removeAgents'](_0x276b26[_0xfe1c('0x3d')]['ids'])[_0xfe1c('0x27')](function(){if(_[_0xfe1c('0x96')](_0x276b26['query']['ids'])){for(var _0x720786=0x0;_0x720786<_0x276b26[_0xfe1c('0x3d')][_0xfe1c('0x80')][_0xfe1c('0x4f')];_0x720786+=0x1){socket[_0xfe1c('0x7e')](_0xfe1c('0x97'),{'UserId':Number(_0x276b26[_0xfe1c('0x3d')][_0xfe1c('0x80')][_0x720786]),'VoiceQueueId':Number(_0x276b26['params']['id'])});}}else{socket['emit'](_0xfe1c('0x97'),{'UserId':Number(_0x276b26[_0xfe1c('0x3d')]['ids']),'VoiceQueueId':Number(_0x276b26[_0xfe1c('0x4d')]['id'])});}});}})[_0xfe1c('0x27')](function(_0x3b6f51){return db[_0xfe1c('0x7a')][_0xfe1c('0x28')]({'where':{'VoiceQueueId':_0x276b26[_0xfe1c('0x4d')]['id'],'UserId':_0x276b26[_0xfe1c('0x3d')]['ids']}})[_0xfe1c('0x27')](function(){return _0x3b6f51;});})[_0xfe1c('0x27')](respondWithStatusCode(_0x4d7b24,null))['catch'](handleError(_0x4d7b24,null));};exports[_0xfe1c('0x98')]=function(_0x348dc6,_0x3bc4ec,_0x48f6b7){var _0x4c4162={};var _0x59fe57={};var _0x575788;var _0x5bde4b;return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x348dc6[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x3bc4ec,null))['then'](function(_0x138c28){if(_0x138c28){_0x575788=_0x138c28;_0x59fe57[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x6f')][_0xfe1c('0x39')]);_0x59fe57[_0xfe1c('0x3d')]=_[_0xfe1c('0x4e')](_0x348dc6[_0xfe1c('0x3d')]);_0x59fe57[_0xfe1c('0x46')]=_['intersection'](_0x59fe57[_0xfe1c('0x3c')],_0x59fe57['query']);_0x4c4162['attributes']=_[_0xfe1c('0x3f')](_0x59fe57[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x348dc6[_0xfe1c('0x3d')]['fields']));_0x4c4162[_0xfe1c('0x3e')]=_0x4c4162[_0xfe1c('0x3e')]['length']?_0x4c4162[_0xfe1c('0x3e')]:_0x59fe57[_0xfe1c('0x3c')];_0x4c4162[_0xfe1c('0x43')]=qs['sort'](_0x348dc6[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0x4c4162[_0xfe1c('0x45')]=qs['filters'](_['pick'](_0x348dc6[_0xfe1c('0x3d')],_0x59fe57[_0xfe1c('0x46')]));if(_0x348dc6['query']['filter']){_0x4c4162[_0xfe1c('0x45')]=_['merge'](_0x4c4162[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x4c4162[_0xfe1c('0x3e')],function(_0x4110cd){var _0x463568={};_0x463568[_0x4110cd]={'$like':'%'+_0x348dc6[_0xfe1c('0x3d')][_0xfe1c('0x2e')]+'%'};return _0x463568;})});}_0x4c4162=_[_0xfe1c('0x48')]({},_0x4c4162,_0x348dc6[_0xfe1c('0x50')]);return _0x575788['getAgents'](_0x4c4162);}})['then'](function(_0x396f2d){if(_0x396f2d){_0x5bde4b=_0x396f2d[_0xfe1c('0x4f')];if(!_0x348dc6[_0xfe1c('0x3d')][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x4c4162[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x348dc6['query'][_0xfe1c('0x21')]);_0x4c4162[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x348dc6[_0xfe1c('0x3d')]['offset']);}return _0x575788['getAgents'](_0x4c4162);}})[_0xfe1c('0x27')](function(_0x147ff3){if(_0x147ff3){return _0x147ff3?{'count':_0x5bde4b,'rows':_0x147ff3}:null;}})['then'](respondWithResult(_0x3bc4ec,null))[_0xfe1c('0x4b')](handleError(_0x3bc4ec,null));};exports[_0xfe1c('0x99')]=function(_0x4749aa,_0x17723b,_0x24aee3){var _0x3f1f4f={};var _0x41de13={};var _0x1498ee;var _0x4fe634;return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x4749aa['params']['id']}})['then'](handleEntityNotFound(_0x17723b,null))[_0xfe1c('0x27')](function(_0x14f880){if(_0x14f880){_0x1498ee=_0x14f880;_0x41de13[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db[_0xfe1c('0x7a')][_0xfe1c('0x39')]);_0x41de13[_0xfe1c('0x3d')]=_['keys'](_0x4749aa[_0xfe1c('0x3d')]);_0x41de13['filters']=_[_0xfe1c('0x3f')](_0x41de13[_0xfe1c('0x3c')],_0x41de13[_0xfe1c('0x3d')]);_0x3f1f4f[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x41de13[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x4749aa[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x3f1f4f['attributes']=_0x3f1f4f[_0xfe1c('0x3e')][_0xfe1c('0x4f')]?_0x3f1f4f[_0xfe1c('0x3e')]:_0x41de13[_0xfe1c('0x3c')];_0x3f1f4f[_0xfe1c('0x43')]=qs[_0xfe1c('0x44')](_0x4749aa['query']['sort']);_0x3f1f4f[_0xfe1c('0x45')]=qs[_0xfe1c('0x46')](_['pick'](_0x4749aa[_0xfe1c('0x3d')],_0x41de13[_0xfe1c('0x46')]));if(_0x4749aa[_0xfe1c('0x3d')][_0xfe1c('0x2e')]){_0x3f1f4f[_0xfe1c('0x45')]=_[_0xfe1c('0x48')](_0x3f1f4f[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x3f1f4f[_0xfe1c('0x3e')],function(_0x231079){var _0x258e62={};_0x258e62[_0x231079]={'$like':'%'+_0x4749aa['query']['filter']+'%'};return _0x258e62;})});}_0x3f1f4f=_[_0xfe1c('0x48')]({},_0x3f1f4f,_0x4749aa['options']);return _0x1498ee['getMembers'](_0x3f1f4f);}})[_0xfe1c('0x27')](function(_0x2483a7){if(_0x2483a7){_0x4fe634=_0x2483a7['length'];if(!_0x4749aa[_0xfe1c('0x3d')][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x3f1f4f[_0xfe1c('0x21')]=qs['limit'](_0x4749aa['query'][_0xfe1c('0x21')]);_0x3f1f4f[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x4749aa[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}return _0x1498ee[_0xfe1c('0x99')](_0x3f1f4f);}})[_0xfe1c('0x27')](function(_0x5c9e97){return _0x5c9e97?{'count':_0x4fe634,'rows':_0x5c9e97}:null;})['then'](respondWithResult(_0x17723b,null))['catch'](handleError(_0x17723b,null));};exports[_0xfe1c('0x9a')]=function(_0x2501ca,_0x5ba7d1,_0x429f25){var _0x560e2c={};var _0x3d320f={};var _0x1319f5;var _0x369f91;return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x2501ca[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x5ba7d1,null))['then'](function(_0x4cc019){if(_0x4cc019){_0x1319f5=_0x4cc019;_0x3d320f[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db['CmList']['rawAttributes']);_0x3d320f[_0xfe1c('0x3d')]=_[_0xfe1c('0x4e')](_0x2501ca[_0xfe1c('0x3d')]);_0x3d320f['filters']=_[_0xfe1c('0x3f')](_0x3d320f['model'],_0x3d320f[_0xfe1c('0x3d')]);_0x560e2c[_0xfe1c('0x3e')]=_['intersection'](_0x3d320f[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x2501ca[_0xfe1c('0x3d')][_0xfe1c('0x40')]));_0x560e2c[_0xfe1c('0x3e')]=_0x560e2c['attributes'][_0xfe1c('0x4f')]?_0x560e2c['attributes']:_0x3d320f[_0xfe1c('0x3c')];_0x560e2c['order']=qs[_0xfe1c('0x44')](_0x2501ca[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0x560e2c[_0xfe1c('0x45')]=qs['filters'](_[_0xfe1c('0x47')](_0x2501ca['query'],_0x3d320f[_0xfe1c('0x46')]));if(_0x2501ca[_0xfe1c('0x3d')]['filter']){_0x560e2c[_0xfe1c('0x45')]=_[_0xfe1c('0x48')](_0x560e2c[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x560e2c['attributes'],function(_0x197916){var _0x122038={};_0x122038[_0x197916]={'$like':'%'+_0x2501ca['query']['filter']+'%'};return _0x122038;})});}_0x560e2c=_['merge']({},_0x560e2c,_0x2501ca[_0xfe1c('0x50')]);return _0x1319f5[_0xfe1c('0x9a')](_0x560e2c);}})[_0xfe1c('0x27')](function(_0x4dfad9){if(_0x4dfad9){_0x369f91=_0x4dfad9[_0xfe1c('0x4f')];if(!_0x2501ca['query'][_0xfe1c('0x41')](_0xfe1c('0x42'))){_0x560e2c[_0xfe1c('0x21')]=qs[_0xfe1c('0x21')](_0x2501ca[_0xfe1c('0x3d')][_0xfe1c('0x21')]);_0x560e2c[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x2501ca[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}return _0x1319f5['getLists'](_0x560e2c);}})[_0xfe1c('0x27')](function(_0x19e56c){if(_0x19e56c){return _0x19e56c?{'count':_0x369f91,'rows':_0x19e56c}:null;}})[_0xfe1c('0x27')](respondWithResult(_0x5ba7d1,null))[_0xfe1c('0x4b')](handleError(_0x5ba7d1,null));};exports['addLists']=function(_0x5bf68b,_0x58685e,_0x580f08){var _0x40bf4c,_0x6c8d4d;return db[_0xfe1c('0x38')]['find']({'where':{'id':_0x5bf68b[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x58685e,null))[_0xfe1c('0x27')](function(_0x202653){if(_0x202653){_0x6c8d4d=_0x202653;return _0x202653[_0xfe1c('0x9b')](_0x5bf68b[_0xfe1c('0x52')][_0xfe1c('0x80')],_[_0xfe1c('0x5c')](_0x5bf68b[_0xfe1c('0x52')],[_0xfe1c('0x80'),'id'])||{});}return null;})[_0xfe1c('0x94')](function(_0x3c46b0){var _0x2d5a10;_0x40bf4c=_0x3c46b0||[];var _0x3e953a=[];if(_0x3c46b0){for(var _0x908b63=0x0;_0x908b63<_0x3c46b0[_0xfe1c('0x4f')];_0x908b63+=0x1){var _0x572442=_0x3c46b0[_0x908b63]['get']({'plain':!![]});_0x6c8d4d[_0xfe1c('0x9c')]=_0x5bf68b[_0xfe1c('0x52')][_0xfe1c('0x9c')]?_0x5bf68b['body'][_0xfe1c('0x9c')]:_0x6c8d4d['dialCheckDuplicateType'];switch(_0x6c8d4d['dialCheckDuplicateType']){case'always':_0x2d5a10=squel[_0xfe1c('0x9d')]()[_0xfe1c('0x9e')](_0xfe1c('0x9f'))[_0xfe1c('0xa0')]([_0xfe1c('0xa1'),_0xfe1c('0xa2'),'ContactId',_0xfe1c('0xa3'),'VoiceQueueId',_0xfe1c('0x5d'),'updatedAt'],squel[_0xfe1c('0x81')]()[_0xfe1c('0x82')](_0xfe1c('0xa1'),_0xfe1c('0xa1'))[_0xfe1c('0x82')]('NOW()',_0xfe1c('0xa2'))[_0xfe1c('0x82')]('id',_0xfe1c('0xa4'))[_0xfe1c('0x82')](_0x572442[_0xfe1c('0xa5')][_0xfe1c('0x8b')](),_0xfe1c('0xa3'))[_0xfe1c('0x82')](_0x5bf68b[_0xfe1c('0x4d')]['id'][_0xfe1c('0x8b')](),_0xfe1c('0x65'))[_0xfe1c('0x82')](_0xfe1c('0xa6'),_0xfe1c('0x5d'))['field'](_0xfe1c('0xa6'),_0xfe1c('0x5e'))[_0xfe1c('0xa7')](_0xfe1c('0xa8'))[_0xfe1c('0x45')]('deletedAt\x20IS\x20NULL')[_0xfe1c('0x45')](_0xfe1c('0xa9'),_0x572442['CmListId'][_0xfe1c('0x8b')]())[_0xfe1c('0x45')](_0xfe1c('0xaa'))[_0xfe1c('0x45')](_0xfe1c('0xab'),squel[_0xfe1c('0x81')]()['field'](_0xfe1c('0xac'))[_0xfe1c('0xa7')](_0xfe1c('0xad'))[_0xfe1c('0x45')](_0xfe1c('0x87'),_0x5bf68b[_0xfe1c('0x4d')]['id'][_0xfe1c('0x8b')]()))[_0xfe1c('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfe1c('0x81')]()[_0xfe1c('0x82')](_0xfe1c('0xae'))[_0xfe1c('0xa7')](_0xfe1c('0x9f'))[_0xfe1c('0x45')](_0xfe1c('0x87'),_0x5bf68b[_0xfe1c('0x4d')]['id'][_0xfe1c('0x8b')]())))['toString']();break;case _0xfe1c('0xaf'):_0x2d5a10=squel['insert']()[_0xfe1c('0x9e')](_0xfe1c('0x9f'))['fromQuery'](['phone',_0xfe1c('0xa2'),_0xfe1c('0xa4'),_0xfe1c('0xa3'),_0xfe1c('0x65'),_0xfe1c('0x5d'),'updatedAt'],squel['select']()[_0xfe1c('0x82')](_0xfe1c('0xa1'),_0xfe1c('0xa1'))['field'](_0xfe1c('0xa6'),_0xfe1c('0xa2'))[_0xfe1c('0x82')]('id',_0xfe1c('0xa4'))[_0xfe1c('0x82')](_0x572442['CmListId']['toString'](),'ListId')['field'](_0x5bf68b['params']['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xfe1c('0x5d'))[_0xfe1c('0x82')](_0xfe1c('0xa6'),'updatedAt')[_0xfe1c('0xa7')](_0xfe1c('0xa8'))[_0xfe1c('0x45')](_0xfe1c('0xb0'))['where']('ListId\x20=\x20?',_0x572442[_0xfe1c('0xa5')][_0xfe1c('0x8b')]())[_0xfe1c('0x45')](_0xfe1c('0xaa'))[_0xfe1c('0x45')](_0xfe1c('0xab'),squel[_0xfe1c('0x81')]()[_0xfe1c('0x82')](_0xfe1c('0xae'))[_0xfe1c('0xa7')]('cm_hopper')[_0xfe1c('0x45')](_0xfe1c('0x87'),_0x5bf68b[_0xfe1c('0x4d')]['id'][_0xfe1c('0x8b')]())))[_0xfe1c('0x8b')]();break;default:_0x2d5a10=squel['insert']()[_0xfe1c('0x9e')]('cm_hopper')['fromQuery']([_0xfe1c('0xa1'),_0xfe1c('0xa2'),'ContactId','ListId',_0xfe1c('0x65'),_0xfe1c('0x5d'),_0xfe1c('0x5e')],squel[_0xfe1c('0x81')]()['field'](_0xfe1c('0xa1'),_0xfe1c('0xa1'))[_0xfe1c('0x82')](_0xfe1c('0xa6'),_0xfe1c('0xa2'))[_0xfe1c('0x82')]('id','ContactId')[_0xfe1c('0x82')](_0x572442[_0xfe1c('0xa5')][_0xfe1c('0x8b')](),_0xfe1c('0xa3'))[_0xfe1c('0x82')](_0x5bf68b[_0xfe1c('0x4d')]['id']['toString'](),_0xfe1c('0x65'))[_0xfe1c('0x82')](_0xfe1c('0xa6'),_0xfe1c('0x5d'))[_0xfe1c('0x82')](_0xfe1c('0xa6'),'updatedAt')[_0xfe1c('0xa7')]('cm_contacts')['where'](_0xfe1c('0xb0'))[_0xfe1c('0x45')](_0xfe1c('0xa9'),_0x572442[_0xfe1c('0xa5')][_0xfe1c('0x8b')]())[_0xfe1c('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xfe1c('0x8b')]();}_0x3e953a[_0xfe1c('0x89')](db[_0xfe1c('0x8a')]['query'](_0x2d5a10));}return BPromise[_0xfe1c('0x8f')](_0x3e953a);}})['then'](function(){return _0x40bf4c;})['then'](respondWithResult(_0x58685e,null))[_0xfe1c('0x4b')](handleError(_0x58685e,null));};exports[_0xfe1c('0xb1')]=function(_0x2aefb0,_0x11515d,_0xc6c95b){return db[_0xfe1c('0x38')]['find']({'where':{'id':_0x2aefb0['params']['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x11515d,null))[_0xfe1c('0x27')](function(_0x637653){if(_0x637653){return _0x637653[_0xfe1c('0xb1')](_0x2aefb0['query'][_0xfe1c('0x80')]);}})['then'](function(_0x4cf9c8){if(_0x4cf9c8){return db['CmHopper'][_0xfe1c('0x28')]({'where':{'ListId':_0x2aefb0[_0xfe1c('0x3d')][_0xfe1c('0x80')],'VoiceQueueId':_0x2aefb0[_0xfe1c('0x4d')]['id']}})['then'](function(){return _0x4cf9c8;});}})[_0xfe1c('0x27')](respondWithStatusCode(_0x11515d,null))[_0xfe1c('0x4b')](handleError(_0x11515d,null));};exports[_0xfe1c('0xb2')]=function(_0x2a8758,_0x469e06,_0x305378){var _0x3abdbd={};var _0x35024e={};var _0x4cf35c;var _0x5cb71d;return db[_0xfe1c('0x38')][_0xfe1c('0x69')]({'where':{'id':_0x2a8758['params']['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x469e06,null))[_0xfe1c('0x27')](function(_0x5efe77){if(_0x5efe77){_0x4cf35c=_0x5efe77;_0x35024e[_0xfe1c('0x3c')]=_[_0xfe1c('0x4e')](db['CmList']['rawAttributes']);_0x35024e[_0xfe1c('0x3d')]=_[_0xfe1c('0x4e')](_0x2a8758[_0xfe1c('0x3d')]);_0x35024e[_0xfe1c('0x46')]=_[_0xfe1c('0x3f')](_0x35024e[_0xfe1c('0x3c')],_0x35024e[_0xfe1c('0x3d')]);_0x3abdbd[_0xfe1c('0x3e')]=_[_0xfe1c('0x3f')](_0x35024e[_0xfe1c('0x3c')],qs[_0xfe1c('0x40')](_0x2a8758[_0xfe1c('0x3d')]['fields']));_0x3abdbd[_0xfe1c('0x3e')]=_0x3abdbd[_0xfe1c('0x3e')][_0xfe1c('0x4f')]?_0x3abdbd[_0xfe1c('0x3e')]:_0x35024e[_0xfe1c('0x3c')];_0x3abdbd['order']=qs[_0xfe1c('0x44')](_0x2a8758[_0xfe1c('0x3d')][_0xfe1c('0x44')]);_0x3abdbd['where']=qs[_0xfe1c('0x46')](_[_0xfe1c('0x47')](_0x2a8758[_0xfe1c('0x3d')],_0x35024e['filters']));if(_0x2a8758[_0xfe1c('0x3d')][_0xfe1c('0x2e')]){_0x3abdbd[_0xfe1c('0x45')]=_['merge'](_0x3abdbd[_0xfe1c('0x45')],{'$or':_[_0xfe1c('0x2f')](_0x3abdbd[_0xfe1c('0x3e')],function(_0x19c8d1){var _0x547827={};_0x547827[_0x19c8d1]={'$like':'%'+_0x2a8758[_0xfe1c('0x3d')]['filter']+'%'};return _0x547827;})});}_0x3abdbd=_[_0xfe1c('0x48')]({},_0x3abdbd,_0x2a8758[_0xfe1c('0x50')]);return _0x4cf35c['getBlackLists'](_0x3abdbd);}})[_0xfe1c('0x27')](function(_0x1a0eed){if(_0x1a0eed){_0x5cb71d=_0x1a0eed['length'];if(!_0x2a8758[_0xfe1c('0x3d')]['hasOwnProperty'](_0xfe1c('0x42'))){_0x3abdbd[_0xfe1c('0x21')]=qs['limit'](_0x2a8758[_0xfe1c('0x3d')]['limit']);_0x3abdbd[_0xfe1c('0x1f')]=qs[_0xfe1c('0x1f')](_0x2a8758[_0xfe1c('0x3d')][_0xfe1c('0x1f')]);}return _0x4cf35c[_0xfe1c('0xb2')](_0x3abdbd);}})[_0xfe1c('0x27')](function(_0x43ea4e){if(_0x43ea4e){return _0x43ea4e?{'count':_0x5cb71d,'rows':_0x43ea4e}:null;}})[_0xfe1c('0x27')](respondWithResult(_0x469e06,null))[_0xfe1c('0x4b')](handleError(_0x469e06,null));};exports['addBlackLists']=function(_0x38a0de,_0x521a50,_0x57f26f){var _0x224615,_0x260702;return db[_0xfe1c('0x38')]['find']({'where':{'id':_0x38a0de['params']['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x521a50,null))[_0xfe1c('0x27')](function(_0x15cdc9){if(_0x15cdc9){_0x260702=_0x15cdc9;return _0x15cdc9[_0xfe1c('0xb3')](_0x38a0de[_0xfe1c('0x52')][_0xfe1c('0x80')],_[_0xfe1c('0x5c')](_0x38a0de[_0xfe1c('0x52')],['ids','id'])||{});}return null;})['spread'](function(_0x49551e){var _0x5c5cdc;_0x224615=_0x49551e||[];var _0x488dcc=[];if(_0x49551e){for(var _0x2af373=0x0;_0x2af373<_0x49551e[_0xfe1c('0x4f')];_0x2af373+=0x1){var _0x8db01d=_0x49551e[_0x2af373][_0xfe1c('0x29')]({'plain':!![]});_0x5c5cdc=squel[_0xfe1c('0x9d')]()['into'](_0xfe1c('0xb4'))[_0xfe1c('0xa0')](['phone',_0xfe1c('0xa4'),_0xfe1c('0xa3'),'VoiceQueueId','createdAt',_0xfe1c('0x5e')],squel[_0xfe1c('0x81')]()[_0xfe1c('0x82')](_0xfe1c('0xa1'),_0xfe1c('0xa1'))[_0xfe1c('0x82')]('id','ContactId')[_0xfe1c('0x82')](_0x8db01d[_0xfe1c('0xa5')][_0xfe1c('0x8b')](),_0xfe1c('0xa3'))[_0xfe1c('0x82')](_0x38a0de[_0xfe1c('0x4d')]['id'][_0xfe1c('0x8b')](),_0xfe1c('0x65'))['field'](_0xfe1c('0xa6'),'createdAt')[_0xfe1c('0x82')]('NOW()','updatedAt')[_0xfe1c('0xa7')](_0xfe1c('0xa8'))[_0xfe1c('0x45')]('deletedAt\x20IS\x20NULL')[_0xfe1c('0x45')](_0xfe1c('0xa9'),_0x8db01d[_0xfe1c('0xa5')][_0xfe1c('0x8b')]())[_0xfe1c('0x45')](_0xfe1c('0xaa')))[_0xfe1c('0x8b')]();_0x488dcc[_0xfe1c('0x89')](db[_0xfe1c('0x8a')][_0xfe1c('0x3d')](_0x5c5cdc));}return BPromise[_0xfe1c('0x8f')](_0x488dcc);}})[_0xfe1c('0x27')](function(){return _0x224615;})['then'](respondWithResult(_0x521a50,null))[_0xfe1c('0x4b')](handleError(_0x521a50,null));};exports[_0xfe1c('0xb5')]=function(_0x1e515f,_0x2ff62f,_0x1b7fe5){return db[_0xfe1c('0x38')][_0xfe1c('0x31')]({'where':{'id':_0x1e515f[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](handleEntityNotFound(_0x2ff62f,null))[_0xfe1c('0x27')](function(_0x20b9c7){if(_0x20b9c7){return _0x20b9c7['removeBlackLists'](_0x1e515f[_0xfe1c('0x3d')][_0xfe1c('0x80')]);}})[_0xfe1c('0x27')](function(_0x42a192){if(_0x42a192){return db[_0xfe1c('0x6a')][_0xfe1c('0x28')]({'where':{'ListId':_0x1e515f[_0xfe1c('0x3d')][_0xfe1c('0x80')],'VoiceQueueId':_0x1e515f[_0xfe1c('0x4d')]['id']}})[_0xfe1c('0x27')](function(){return _0x42a192;});}})[_0xfe1c('0x27')](respondWithStatusCode(_0x2ff62f,null))[_0xfe1c('0x4b')](handleError(_0x2ff62f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d118cab..bc97440 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 _0x7aef=['save','remove','emit','hook','../../mysqldb'];(function(_0x271cec,_0x221359){var _0xe920cf=function(_0x26fe27){while(--_0x26fe27){_0x271cec['push'](_0x271cec['shift']());}};_0xe920cf(++_0x221359);}(_0x7aef,0x108));var _0xf7ae=function(_0x3c0ab9,_0x319545){_0x3c0ab9=_0x3c0ab9-0x0;var _0x229156=_0x7aef[_0x3c0ab9];return _0x229156;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xf7ae('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7ae('0x1'),'afterUpdate':'update','afterDestroy':_0xf7ae('0x2')};function emitEvent(_0x9ad5f6){return function(_0x3d49bf,_0x226483,_0x4b14c8){VoiceQueueEvents[_0xf7ae('0x3')](_0x9ad5f6+':'+_0x3d49bf['id'],_0x3d49bf);VoiceQueueEvents[_0xf7ae('0x3')](_0x9ad5f6,_0x3d49bf);_0x4b14c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf7ae('0x4')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x86b7=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x238f05,_0x3acc6d){var _0x5b71aa=function(_0x544b48){while(--_0x544b48){_0x238f05['push'](_0x238f05['shift']());}};_0x5b71aa(++_0x3acc6d);}(_0x86b7,0x1a7));var _0x786b=function(_0x577719,_0x1aba92){_0x577719=_0x577719-0x0;var _0x3d9899=_0x86b7[_0x577719];return _0x3d9899;};'use strict';var EventEmitter=require(_0x786b('0x0'));var VoiceQueue=require(_0x786b('0x1'))['db'][_0x786b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x786b('0x3')](0x0);var events={'afterCreate':_0x786b('0x4'),'afterUpdate':'update','afterDestroy':_0x786b('0x5')};function emitEvent(_0x515a84){return function(_0x21b007,_0xee5384,_0x5c8b6e){VoiceQueueEvents[_0x786b('0x6')](_0x515a84+':'+_0x21b007['id'],_0x21b007);VoiceQueueEvents['emit'](_0x515a84,_0x21b007);_0x5c8b6e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x786b('0x7')](e,emitEvent(event));}}module[_0x786b('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 1fb0783..f668b82 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(_0x122aab,_0x168c24){var _0x3ca037=function(_0xe60f3f){while(--_0xe60f3f){_0x122aab['push'](_0x122aab['shift']());}};_0x3ca037(++_0x168c24);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x4d72aa,_0x5752e3){var _0x22c759=function(_0x27d06f){while(--_0x27d06f){_0x4d72aa['push'](_0x4d72aa['shift']());}};_0x22c759(++_0x5752e3);}(_0x70e0,0x17b));var _0x070e=function(_0x3dfc91,_0x408059){_0x3dfc91=_0x3dfc91-0x0;var _0x36b87a=_0x70e0[_0x3dfc91];return _0x36b87a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 32604b4..7d0b670 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 _0x356c=['find','ShowVoiceQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','attributes','model'];(function(_0x537f6f,_0x10b756){var _0x212d3f=function(_0x22f172){while(--_0x22f172){_0x537f6f['push'](_0x537f6f['shift']());}};_0x212d3f(++_0x10b756);}(_0x356c,0x14a));var _0xc356=function(_0x50fbc8,_0x2507cf){_0x50fbc8=_0x50fbc8-0x0;var _0x2af23e=_0x356c[_0x50fbc8];return _0x2af23e;};'use strict';var _=require(_0xc356('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc356('0x1'));var rs=require(_0xc356('0x2'));var fs=require('fs');var Redis=require(_0xc356('0x3'));var db=require(_0xc356('0x4'))['db'];var utils=require(_0xc356('0x5'));var logger=require(_0xc356('0x6'))(_0xc356('0x7'));var config=require(_0xc356('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc356('0x9')][_0xc356('0xa')]({'port':0x232a});config[_0xc356('0xb')]=_[_0xc356('0xc')](config[_0xc356('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc356('0xd'))(new Redis(config['redis']));require(_0xc356('0xe'))[_0xc356('0xf')](socket);function respondWithRpcPromise(_0x3b1980,_0x4772c6,_0x22919f){return new BPromise(function(_0xe14d18,_0x270bed){return client['request'](_0x3b1980,_0x22919f)[_0xc356('0x10')](function(_0x1ebf7d){logger['info'](_0xc356('0x11'),_0x4772c6,_0xc356('0x12'));logger[_0xc356('0x13')](_0xc356('0x14'),_0x4772c6,_0xc356('0x12'),JSON[_0xc356('0x15')](_0x1ebf7d));if(_0x1ebf7d['error']){if(_0x1ebf7d[_0xc356('0x16')][_0xc356('0x17')]===0x1f4){logger[_0xc356('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x4772c6,_0x1ebf7d[_0xc356('0x16')][_0xc356('0x18')]);return _0x270bed(_0x1ebf7d[_0xc356('0x16')][_0xc356('0x18')]);}logger['error'](_0xc356('0x11'),_0x4772c6,_0x1ebf7d[_0xc356('0x16')]['message']);return _0xe14d18(_0x1ebf7d[_0xc356('0x16')][_0xc356('0x18')]);}else{logger[_0xc356('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x4772c6,_0xc356('0x12'));_0xe14d18(_0x1ebf7d[_0xc356('0x1a')][_0xc356('0x18')]);}})[_0xc356('0x1b')](function(_0x5303ed){logger['error'](_0xc356('0x11'),_0x4772c6,_0x5303ed);_0x270bed(_0x5303ed);});});}exports[_0xc356('0x1c')]=function(_0x2177ea){var _0x16234e=this;return new Promise(function(_0xe7a292,_0x2d9a6e){return db[_0xc356('0x1d')][_0xc356('0x1e')]({'raw':_0x2177ea['options']?_0x2177ea[_0xc356('0x1f')][_0xc356('0x20')]===undefined?!![]:![]:!![],'where':_0x2177ea[_0xc356('0x1f')]?_0x2177ea[_0xc356('0x1f')][_0xc356('0x21')]||null:null,'attributes':_0x2177ea[_0xc356('0x1f')]?_0x2177ea[_0xc356('0x1f')]['attributes']||null:null,'limit':_0x2177ea[_0xc356('0x1f')]?_0x2177ea[_0xc356('0x1f')][_0xc356('0x22')]||null:null,'include':_0x2177ea[_0xc356('0x1f')]?_0x2177ea['options'][_0xc356('0x23')]?_[_0xc356('0x24')](_0x2177ea['options'][_0xc356('0x23')],function(_0x1a5ae5){return{'model':db[_0x1a5ae5['model']],'as':_0x1a5ae5['as'],'attributes':_0x1a5ae5[_0xc356('0x25')],'include':_0x1a5ae5[_0xc356('0x23')]?_[_0xc356('0x24')](_0x1a5ae5[_0xc356('0x23')],function(_0x5acc8e){return{'model':db[_0x5acc8e[_0xc356('0x26')]],'as':_0x5acc8e['as'],'attributes':_0x5acc8e[_0xc356('0x25')],'include':_0x5acc8e['include']?_[_0xc356('0x24')](_0x5acc8e['include'],function(_0x19a9b6){return{'model':db[_0x19a9b6[_0xc356('0x26')]],'as':_0x19a9b6['as'],'attributes':_0x19a9b6[_0xc356('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34ae61){logger[_0xc356('0x19')](_0xc356('0x1c'),_0x2177ea);logger['debug'](_0xc356('0x1c'),_0x2177ea,JSON[_0xc356('0x15')](_0x34ae61));_0xe7a292(_0x34ae61);})[_0xc356('0x1b')](function(_0x1fee04){logger[_0xc356('0x16')](_0xc356('0x1c'),_0x1fee04[_0xc356('0x18')],_0x2177ea);_0x2d9a6e(_0x16234e[_0xc356('0x16')](0x1f4,_0x1fee04[_0xc356('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x55f818){var _0x458a5f=this;return new Promise(function(_0x760826,_0x271614){return db[_0xc356('0x1d')][_0xc356('0x27')]({'raw':_0x55f818[_0xc356('0x1f')]?_0x55f818['options']['raw']===undefined?!![]:![]:!![],'where':_0x55f818[_0xc356('0x1f')]?_0x55f818['options'][_0xc356('0x21')]||null:null,'attributes':_0x55f818[_0xc356('0x1f')]?_0x55f818[_0xc356('0x1f')][_0xc356('0x25')]||null:null,'include':_0x55f818[_0xc356('0x1f')]?_0x55f818[_0xc356('0x1f')][_0xc356('0x23')]?_['map'](_0x55f818[_0xc356('0x1f')][_0xc356('0x23')],function(_0x4aac24){return{'model':db[_0x4aac24[_0xc356('0x26')]],'as':_0x4aac24['as'],'attributes':_0x4aac24[_0xc356('0x25')],'include':_0x4aac24[_0xc356('0x23')]?_[_0xc356('0x24')](_0x4aac24[_0xc356('0x23')],function(_0x45b845){return{'model':db[_0x45b845[_0xc356('0x26')]],'as':_0x45b845['as'],'attributes':_0x45b845['attributes'],'include':_0x45b845[_0xc356('0x23')]?_['map'](_0x45b845[_0xc356('0x23')],function(_0x231650){return{'model':db[_0x231650[_0xc356('0x26')]],'as':_0x231650['as'],'attributes':_0x231650[_0xc356('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc356('0x10')](function(_0x59f1f7){logger[_0xc356('0x19')](_0xc356('0x28'),_0x55f818);logger[_0xc356('0x13')](_0xc356('0x28'),_0x55f818,JSON[_0xc356('0x15')](_0x59f1f7));_0x760826(_0x59f1f7);})[_0xc356('0x1b')](function(_0xa53ac3){logger['error'](_0xc356('0x28'),_0xa53ac3[_0xc356('0x18')],_0x55f818);_0x271614(_0x458a5f[_0xc356('0x16')](0x1f4,_0xa53ac3[_0xc356('0x18')]));});});}; \ No newline at end of file +var _0xb17e=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xb17e,0x18b));var _0xeb17=function(_0x3fc2b8,_0x3c8446){_0x3fc2b8=_0x3fc2b8-0x0;var _0x102a22=_0xb17e[_0x3fc2b8];return _0x102a22;};'use strict';var _=require(_0xeb17('0x0'));var util=require('util');var moment=require(_0xeb17('0x1'));var BPromise=require(_0xeb17('0x2'));var rs=require(_0xeb17('0x3'));var fs=require('fs');var Redis=require(_0xeb17('0x4'));var db=require(_0xeb17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb17('0x6'))(_0xeb17('0x7'));var config=require('../../config/environment');var jayson=require(_0xeb17('0x8'));var client=jayson[_0xeb17('0x9')][_0xeb17('0xa')]({'port':0x232a});config[_0xeb17('0xb')]=_[_0xeb17('0xc')](config['redis'],{'host':_0xeb17('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeb17('0xe'))[_0xeb17('0xf')](socket);function respondWithRpcPromise(_0x37ef3f,_0xa1ec96,_0x562377){return new BPromise(function(_0x4b91d6,_0x52bc9b){return client[_0xeb17('0x10')](_0x37ef3f,_0x562377)[_0xeb17('0x11')](function(_0x180944){logger[_0xeb17('0x12')](_0xeb17('0x13'),_0xa1ec96,_0xeb17('0x14'));logger[_0xeb17('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xa1ec96,_0xeb17('0x14'),JSON[_0xeb17('0x16')](_0x180944));if(_0x180944[_0xeb17('0x17')]){if(_0x180944[_0xeb17('0x17')][_0xeb17('0x18')]===0x1f4){logger[_0xeb17('0x17')](_0xeb17('0x13'),_0xa1ec96,_0x180944[_0xeb17('0x17')][_0xeb17('0x19')]);return _0x52bc9b(_0x180944[_0xeb17('0x17')][_0xeb17('0x19')]);}logger['error'](_0xeb17('0x13'),_0xa1ec96,_0x180944['error']['message']);return _0x4b91d6(_0x180944[_0xeb17('0x17')][_0xeb17('0x19')]);}else{logger[_0xeb17('0x12')](_0xeb17('0x13'),_0xa1ec96,_0xeb17('0x14'));_0x4b91d6(_0x180944[_0xeb17('0x1a')][_0xeb17('0x19')]);}})[_0xeb17('0x1b')](function(_0x44aea3){logger[_0xeb17('0x17')]('VoiceQueue,\x20%s,\x20%s',_0xa1ec96,_0x44aea3);_0x52bc9b(_0x44aea3);});});}exports[_0xeb17('0x1c')]=function(_0x49f223){var _0x5cd485=this;return new Promise(function(_0x41fa7d,_0x2fc095){return db[_0xeb17('0x1d')][_0xeb17('0x1e')]({'raw':_0x49f223[_0xeb17('0x1f')]?_0x49f223[_0xeb17('0x1f')][_0xeb17('0x20')]===undefined?!![]:![]:!![],'where':_0x49f223[_0xeb17('0x1f')]?_0x49f223[_0xeb17('0x1f')][_0xeb17('0x21')]||null:null,'attributes':_0x49f223['options']?_0x49f223[_0xeb17('0x1f')][_0xeb17('0x22')]||null:null,'limit':_0x49f223['options']?_0x49f223[_0xeb17('0x1f')][_0xeb17('0x23')]||null:null,'include':_0x49f223[_0xeb17('0x1f')]?_0x49f223[_0xeb17('0x1f')][_0xeb17('0x24')]?_[_0xeb17('0x25')](_0x49f223[_0xeb17('0x1f')][_0xeb17('0x24')],function(_0x15a404){return{'model':db[_0x15a404[_0xeb17('0x26')]],'as':_0x15a404['as'],'attributes':_0x15a404[_0xeb17('0x22')],'include':_0x15a404['include']?_['map'](_0x15a404['include'],function(_0x340322){return{'model':db[_0x340322[_0xeb17('0x26')]],'as':_0x340322['as'],'attributes':_0x340322[_0xeb17('0x22')],'include':_0x340322['include']?_[_0xeb17('0x25')](_0x340322[_0xeb17('0x24')],function(_0x326274){return{'model':db[_0x326274['model']],'as':_0x326274['as'],'attributes':_0x326274['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x392ce0){logger[_0xeb17('0x12')](_0xeb17('0x1c'),_0x49f223);logger['debug'](_0xeb17('0x1c'),_0x49f223,JSON[_0xeb17('0x16')](_0x392ce0));_0x41fa7d(_0x392ce0);})[_0xeb17('0x1b')](function(_0x382364){logger[_0xeb17('0x17')](_0xeb17('0x1c'),_0x382364['message'],_0x49f223);_0x2fc095(_0x5cd485['error'](0x1f4,_0x382364[_0xeb17('0x19')]));});});};exports[_0xeb17('0x27')]=function(_0x51edfa){var _0x52eb09=this;return new Promise(function(_0x5f073f,_0x5676f1){return db[_0xeb17('0x1d')][_0xeb17('0x28')]({'raw':_0x51edfa[_0xeb17('0x1f')]?_0x51edfa['options'][_0xeb17('0x20')]===undefined?!![]:![]:!![],'where':_0x51edfa[_0xeb17('0x1f')]?_0x51edfa['options'][_0xeb17('0x21')]||null:null,'attributes':_0x51edfa[_0xeb17('0x1f')]?_0x51edfa[_0xeb17('0x1f')][_0xeb17('0x22')]||null:null,'include':_0x51edfa[_0xeb17('0x1f')]?_0x51edfa[_0xeb17('0x1f')][_0xeb17('0x24')]?_[_0xeb17('0x25')](_0x51edfa['options'][_0xeb17('0x24')],function(_0x109cdb){return{'model':db[_0x109cdb['model']],'as':_0x109cdb['as'],'attributes':_0x109cdb[_0xeb17('0x22')],'include':_0x109cdb['include']?_[_0xeb17('0x25')](_0x109cdb[_0xeb17('0x24')],function(_0x2f3534){return{'model':db[_0x2f3534[_0xeb17('0x26')]],'as':_0x2f3534['as'],'attributes':_0x2f3534['attributes'],'include':_0x2f3534[_0xeb17('0x24')]?_['map'](_0x2f3534['include'],function(_0x57abe8){return{'model':db[_0x57abe8[_0xeb17('0x26')]],'as':_0x57abe8['as'],'attributes':_0x57abe8['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb17('0x11')](function(_0x7a14b3){logger[_0xeb17('0x12')](_0xeb17('0x27'),_0x51edfa);logger[_0xeb17('0x15')](_0xeb17('0x27'),_0x51edfa,JSON['stringify'](_0x7a14b3));_0x5f073f(_0x7a14b3);})[_0xeb17('0x1b')](function(_0x58c0bf){logger[_0xeb17('0x17')](_0xeb17('0x27'),_0x58c0bf['message'],_0x51edfa);_0x5676f1(_0x52eb09[_0xeb17('0x17')](0x1f4,_0x58c0bf['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d6f8abf..5b02e12 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 _0xbc2a=['save','remove','update','emit','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbc2a,0x16f));var _0xabc2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc2a[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0xabc2('0x0'));var events=[_0xabc2('0x1'),_0xabc2('0x2'),_0xabc2('0x3')];function createListener(_0x10305d,_0x5245d7){return function(_0x58e374){_0x5245d7[_0xabc2('0x4')](_0x10305d,_0x58e374);};}function removeListener(_0x134d70,_0x4cef7d){return function(){VoiceQueueEvents['removeListener'](_0x134d70,_0x4cef7d);};}exports[_0xabc2('0x5')]=function(_0x2214ee){for(var _0x25fd77=0x0,_0x3d005c=events[_0xabc2('0x6')];_0x25fd77<_0x3d005c;_0x25fd77++){var _0x2c57f3=events[_0x25fd77];var _0x44c304=createListener(_0xabc2('0x7')+_0x2c57f3,_0x2214ee);VoiceQueueEvents['on'](_0x2c57f3,_0x44c304);}}; \ No newline at end of file +var _0x7302=['removeListener','register','./voiceQueue.events','save','remove','update'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x7302,0x9e));var _0x2730=function(_0x2031ad,_0x3d1279){_0x2031ad=_0x2031ad-0x0;var _0x372bea=_0x7302[_0x2031ad];return _0x372bea;};'use strict';var VoiceQueueEvents=require(_0x2730('0x0'));var events=[_0x2730('0x1'),_0x2730('0x2'),_0x2730('0x3')];function createListener(_0x3fd7fa,_0x5013f8){return function(_0x6d6249){_0x5013f8['emit'](_0x3fd7fa,_0x6d6249);};}function removeListener(_0x3ff299,_0x2019f0){return function(){VoiceQueueEvents[_0x2730('0x4')](_0x3ff299,_0x2019f0);};}exports[_0x2730('0x5')]=function(_0x381888){for(var _0x4d8cde=0x0,_0x243422=events['length'];_0x4d8cde<_0x243422;_0x4d8cde++){var _0x1fed75=events[_0x4d8cde];var _0x3a824d=createListener('voiceQueue:'+_0x1fed75,_0x381888);VoiceQueueEvents['on'](_0x1fed75,_0x3a824d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 6ee540f..e58e376 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 _0xeded=['create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','post'];(function(_0x514c61,_0x90f7b5){var _0x450d43=function(_0x36884f){while(--_0x36884f){_0x514c61['push'](_0x514c61['shift']());}};_0x450d43(++_0x90f7b5);}(_0xeded,0x13f));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var path=require(_0xdede('0x2'));var timeout=require(_0xdede('0x3'));var express=require(_0xdede('0x4'));var router=express[_0xdede('0x5')]();var fs_extra=require(_0xdede('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdede('0x7'));var config=require(_0xdede('0x8'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xdede('0x9')](),controller[_0xdede('0xa')]);router[_0xdede('0xb')](_0xdede('0xc'),auth[_0xdede('0x9')](),controller[_0xdede('0xd')]);router[_0xdede('0xb')]('/index',auth['isAuthenticated'](),controller[_0xdede('0xe')]);router['get'](_0xdede('0xf'),auth[_0xdede('0x9')](),controller['show']);router[_0xdede('0x10')]('/',auth[_0xdede('0x9')](),controller[_0xdede('0x11')]);router['put']('/:id',auth[_0xdede('0x9')](),controller[_0xdede('0x12')]);router['delete'](_0xdede('0xf'),auth[_0xdede('0x9')](),controller[_0xdede('0x13')]);module[_0xdede('0x14')]=router; \ No newline at end of file +var _0xcc97=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x1b3645,_0x260808){_0x1b3645=_0x1b3645-0x0;var _0x2602c8=_0xcc97[_0x1b3645];return _0x2602c8;};'use strict';var multer=require(_0x7cc9('0x0'));var util=require(_0x7cc9('0x1'));var path=require('path');var timeout=require(_0x7cc9('0x2'));var express=require(_0x7cc9('0x3'));var router=express[_0x7cc9('0x4')]();var fs_extra=require(_0x7cc9('0x5'));var auth=require(_0x7cc9('0x6'));var interaction=require(_0x7cc9('0x7'));var config=require(_0x7cc9('0x8'));var controller=require(_0x7cc9('0x9'));router[_0x7cc9('0xa')]('/',auth[_0x7cc9('0xb')](),controller[_0x7cc9('0xc')]);router['get'](_0x7cc9('0xd'),auth[_0x7cc9('0xb')](),controller[_0x7cc9('0xe')]);router[_0x7cc9('0xa')](_0x7cc9('0xf'),auth['isAuthenticated'](),controller[_0x7cc9('0x10')]);router['get'](_0x7cc9('0x11'),auth[_0x7cc9('0xb')](),controller[_0x7cc9('0x12')]);router[_0x7cc9('0x13')]('/',auth[_0x7cc9('0xb')](),controller[_0x7cc9('0x14')]);router[_0x7cc9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x7cc9('0x16')]);router['delete'](_0x7cc9('0x11'),auth['isAuthenticated'](),controller[_0x7cc9('0x17')]);module[_0x7cc9('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 43805fb..46e4578 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 _0xa4f1=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa4f1,0xa3));var _0x1a4f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xa4f1[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x1a4f('0x0'));var moment=require(_0x1a4f('0x1'));module[_0x1a4f('0x2')]={'type':{'type':Sequelize[_0x1a4f('0x3')]},'uniqueid':{'type':Sequelize[_0x1a4f('0x3')]},'calleridnum':{'type':Sequelize[_0x1a4f('0x3')]},'calleridname':{'type':Sequelize[_0x1a4f('0x3')]},'queue':{'type':Sequelize[_0x1a4f('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x1a4f('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x50664d){var _0x1d9aa2=moment(_0x50664d);var _0xdf29e3=moment(this[_0x1a4f('0x5')](_0x1a4f('0x6')))[_0x1a4f('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x29d1a3=_0x1d9aa2[_0x1a4f('0x8')](_0xdf29e3,'seconds');this['setDataValue'](_0x1a4f('0x9'),_0x50664d);this[_0x1a4f('0xa')]('holdtime',_0x29d1a3||null);}},'position':{'type':Sequelize[_0x1a4f('0xb')]},'count':{'type':Sequelize[_0x1a4f('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x1a4f('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x1a4f('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1a4f('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x1a4f('0xd')},'originalposition':{'type':Sequelize[_0x1a4f('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1a4f('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1a4f('0x3')]},'context':{'type':Sequelize[_0x1a4f('0x3')]},'exten':{'type':Sequelize[_0x1a4f('0x3')]},'priority':{'type':Sequelize[_0x1a4f('0x3')]},'holdtime':{'type':Sequelize[_0x1a4f('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1a4f('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1a4f('0x3')]},'transfer':{'type':Sequelize[_0x1a4f('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1a4f('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1a4f('0x3')]},'disposition':{'type':Sequelize[_0x1a4f('0x3')]},'secondDisposition':{'type':Sequelize[_0x1a4f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1a4f('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x1a4f('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74da=['YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x593f83,_0x5bcd40){var _0x3b2740=function(_0x1e36cc){while(--_0x1e36cc){_0x593f83['push'](_0x593f83['shift']());}};_0x3b2740(++_0x5bcd40);}(_0x74da,0x198));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa74d('0x0'));var moment=require(_0xa74d('0x1'));module[_0xa74d('0x2')]={'type':{'type':Sequelize[_0xa74d('0x3')]},'uniqueid':{'type':Sequelize[_0xa74d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa74d('0x3')]},'queue':{'type':Sequelize[_0xa74d('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa74d('0x4')],'set':function(_0x223c05){var _0xc67629=moment(_0x223c05);var _0x2209b4=moment(this[_0xa74d('0x5')](_0xa74d('0x6')))[_0xa74d('0x7')](_0xa74d('0x8'));var _0x49ea5e=_0xc67629['diff'](_0x2209b4,_0xa74d('0x9'));this[_0xa74d('0xa')](_0xa74d('0xb'),_0x223c05);this[_0xa74d('0xa')](_0xa74d('0xc'),_0x49ea5e||null);}},'position':{'type':Sequelize[_0xa74d('0xd')]},'count':{'type':Sequelize[_0xa74d('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xa74d('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa74d('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa74d('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa74d('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa74d('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xa74d('0x3')],'comment':_0xa74d('0xf')},'originalposition':{'type':Sequelize[_0xa74d('0xd')]},'channel':{'type':Sequelize[_0xa74d('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa74d('0x3')]},'accountcode':{'type':Sequelize[_0xa74d('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa74d('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xa74d('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa74d('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa74d('0x3')]},'transfer':{'type':Sequelize[_0xa74d('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa74d('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa74d('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa74d('0x3')]},'disposition':{'type':Sequelize[_0xa74d('0x3')]},'secondDisposition':{'type':Sequelize[_0xa74d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa74d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xa74d('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index dcb9e3b..54cee95 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 _0x761e=['type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','VoiceQueueReport','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','map'];(function(_0x27fe26,_0x3b8ca7){var _0x4fcb35=function(_0x35e0ae){while(--_0x35e0ae){_0x27fe26['push'](_0x27fe26['shift']());}};_0x4fcb35(++_0x3b8ca7);}(_0x761e,0x124));var _0xe761=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x761e[_0x55ff3e];return _0x2709eb;};'use strict';var emlformat=require(_0xe761('0x0'));var rimraf=require(_0xe761('0x1'));var zipdir=require(_0xe761('0x2'));var jsonpatch=require(_0xe761('0x3'));var rp=require('request-promise');var moment=require(_0xe761('0x4'));var BPromise=require(_0xe761('0x5'));var Mustache=require(_0xe761('0x6'));var util=require(_0xe761('0x7'));var path=require(_0xe761('0x8'));var sox=require(_0xe761('0x9'));var csv=require('to-csv');var ejs=require(_0xe761('0xa'));var fs=require('fs');var fs_extra=require(_0xe761('0xb'));var _=require(_0xe761('0xc'));var squel=require(_0xe761('0xd'));var crypto=require(_0xe761('0xe'));var jsforce=require(_0xe761('0xf'));var deskjs=require(_0xe761('0x10'));var toCsv=require(_0xe761('0x11'));var querystring=require(_0xe761('0x12'));var Papa=require(_0xe761('0x13'));var Redis=require('ioredis');var authService=require(_0xe761('0x14'));var qs=require(_0xe761('0x15'));var as=require(_0xe761('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe761('0x17'))(_0xe761('0x18'));var utils=require(_0xe761('0x19'));var config=require(_0xe761('0x1a'));var licenseUtil=require(_0xe761('0x1b'));var db=require('../../mysqldb')['db'];config[_0xe761('0x1c')]=_[_0xe761('0x1d')](config[_0xe761('0x1c')],{'host':_0xe761('0x1e'),'port':0x18eb});var socket=require(_0xe761('0x1f'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xe761('0x20')](socket);function respondWithStatusCode(_0xea7196,_0x5b09cc){_0x5b09cc=_0x5b09cc||0xcc;return function(_0x559dab){if(_0x559dab){return _0xea7196[_0xe761('0x21')](_0x5b09cc);}return _0xea7196[_0xe761('0x22')](_0x5b09cc)[_0xe761('0x23')]();};}function respondWithResult(_0x197407,_0x28e66e){_0x28e66e=_0x28e66e||0xc8;return function(_0x14d54d){if(_0x14d54d){return _0x197407[_0xe761('0x22')](_0x28e66e)[_0xe761('0x24')](_0x14d54d);}};}function respondWithFilteredResult(_0x531747,_0x1707c8){return function(_0x42c12d){if(_0x42c12d){var _0x2405f4=typeof _0x1707c8[_0xe761('0x25')]===_0xe761('0x26')&&typeof _0x1707c8[_0xe761('0x27')]===_0xe761('0x26');var _0x601f4c=_0x42c12d['count'];var _0x2e19c8=_0x2405f4?0x0:_0x1707c8['offset'];var _0x1f996e=_0x2405f4?_0x42c12d[_0xe761('0x28')]:_0x1707c8['offset']+_0x1707c8[_0xe761('0x27')];var _0x4adae3;if(_0x1f996e>=_0x601f4c){_0x1f996e=_0x601f4c;_0x4adae3=0xc8;}else{_0x4adae3=0xce;}_0x531747[_0xe761('0x22')](_0x4adae3);return _0x531747[_0xe761('0x29')](_0xe761('0x2a'),_0x2e19c8+'-'+_0x1f996e+'/'+_0x601f4c)[_0xe761('0x24')](_0x42c12d);}return null;};}function patchUpdates(_0x248f08){return function(_0x1ee730){try{jsonpatch['apply'](_0x1ee730,_0x248f08,!![]);}catch(_0x56bbd4){return BPromise[_0xe761('0x2b')](_0x56bbd4);}return _0x1ee730[_0xe761('0x2c')]();};}function saveUpdates(_0xd12234,_0x522bfe){return function(_0x3eb0e5){if(_0x3eb0e5){return _0x3eb0e5[_0xe761('0x2d')](_0xd12234)[_0xe761('0x2e')](function(_0x135419){return _0x135419;});}return null;};}function removeEntity(_0x306877,_0x5be0b9){return function(_0x19978c){if(_0x19978c){return _0x19978c['destroy']()[_0xe761('0x2e')](function(){_0x306877[_0xe761('0x22')](0xcc)[_0xe761('0x23')]();});}};}function handleEntityNotFound(_0x5d55e6,_0x299739){return function(_0x3f2eaf){if(!_0x3f2eaf){_0x5d55e6[_0xe761('0x21')](0x194);}return _0x3f2eaf;};}function handleError(_0x3aae28,_0x37d604){_0x37d604=_0x37d604||0x1f4;return function(_0x3de519){logger[_0xe761('0x2f')](_0x3de519[_0xe761('0x30')]);if(_0x3de519[_0xe761('0x31')]){delete _0x3de519[_0xe761('0x31')];}_0x3aae28[_0xe761('0x22')](_0x37d604)[_0xe761('0x32')](_0x3de519);};}exports['index']=function(_0x422e77,_0x114ec5){var _0x31b113={},_0x46f35d={},_0x544815={'count':0x0,'rows':[]};var _0x2775bd=_[_0xe761('0x33')](db['VoiceQueueReport']['rawAttributes'],function(_0x265b4f){return{'name':_0x265b4f['fieldName'],'type':_0x265b4f[_0xe761('0x34')][_0xe761('0x35')]};});_0x46f35d[_0xe761('0x36')]=_[_0xe761('0x33')](_0x2775bd,_0xe761('0x31'));_0x46f35d[_0xe761('0x37')]=_[_0xe761('0x38')](_0x422e77[_0xe761('0x37')]);_0x46f35d[_0xe761('0x39')]=_[_0xe761('0x3a')](_0x46f35d[_0xe761('0x36')],_0x46f35d[_0xe761('0x37')]);_0x31b113[_0xe761('0x3b')]=_['intersection'](_0x46f35d['model'],qs['fields'](_0x422e77[_0xe761('0x37')][_0xe761('0x3c')]));_0x31b113['attributes']=_0x31b113[_0xe761('0x3b')]['length']?_0x31b113[_0xe761('0x3b')]:_0x46f35d[_0xe761('0x36')];if(!_0x422e77[_0xe761('0x37')][_0xe761('0x3d')]('nolimit')){_0x31b113[_0xe761('0x27')]=qs[_0xe761('0x27')](_0x422e77[_0xe761('0x37')][_0xe761('0x27')]);_0x31b113[_0xe761('0x25')]=qs['offset'](_0x422e77[_0xe761('0x37')][_0xe761('0x25')]);}_0x31b113[_0xe761('0x3e')]=qs['sort'](_0x422e77[_0xe761('0x37')][_0xe761('0x3f')]);_0x31b113[_0xe761('0x40')]=qs[_0xe761('0x39')](_['pick'](_0x422e77[_0xe761('0x37')],_0x46f35d[_0xe761('0x39')]),_0x2775bd);if(_0x422e77['query'][_0xe761('0x41')]){_0x31b113[_0xe761('0x40')]=_[_0xe761('0x42')](_0x31b113[_0xe761('0x40')],{'$or':_['map'](_0x2775bd,function(_0x556074){if(_0x556074['type']!==_0xe761('0x43')){var _0x37fd62={};_0x37fd62[_0x556074[_0xe761('0x31')]]={'$like':'%'+_0x422e77[_0xe761('0x37')][_0xe761('0x41')]+'%'};return _0x37fd62;}})});}_0x31b113=_['merge']({},_0x31b113,_0x422e77['options']);var _0x4c46ef={'where':_0x31b113[_0xe761('0x40')]};return db[_0xe761('0x44')][_0xe761('0x28')](_0x4c46ef)['then'](function(_0x17f701){_0x544815[_0xe761('0x28')]=_0x17f701;if(_0x422e77[_0xe761('0x37')]['includeAll']){_0x31b113['include']=[{'all':!![]}];}return db[_0xe761('0x44')][_0xe761('0x45')](_0x31b113);})[_0xe761('0x2e')](function(_0x570ee2){_0x544815[_0xe761('0x46')]=_0x570ee2;return _0x544815;})[_0xe761('0x2e')](respondWithFilteredResult(_0x114ec5,_0x31b113))[_0xe761('0x47')](handleError(_0x114ec5,null));};exports[_0xe761('0x48')]=function(_0x1a1d44,_0x397547){var _0x50f86f={'raw':![],'where':{'id':_0x1a1d44[_0xe761('0x49')]['id']}},_0x43abf7={};_0x43abf7[_0xe761('0x36')]=_[_0xe761('0x38')](db[_0xe761('0x44')][_0xe761('0x4a')]);_0x43abf7[_0xe761('0x37')]=_[_0xe761('0x38')](_0x1a1d44['query']);_0x43abf7[_0xe761('0x39')]=_[_0xe761('0x3a')](_0x43abf7[_0xe761('0x36')],_0x43abf7[_0xe761('0x37')]);_0x50f86f['attributes']=_[_0xe761('0x3a')](_0x43abf7[_0xe761('0x36')],qs[_0xe761('0x3c')](_0x1a1d44[_0xe761('0x37')][_0xe761('0x3c')]));_0x50f86f['attributes']=_0x50f86f[_0xe761('0x3b')][_0xe761('0x4b')]?_0x50f86f[_0xe761('0x3b')]:_0x43abf7[_0xe761('0x36')];if(_0x1a1d44[_0xe761('0x37')]['includeAll']){_0x50f86f[_0xe761('0x4c')]=[{'all':!![]}];}_0x50f86f=_['merge']({},_0x50f86f,_0x1a1d44[_0xe761('0x4d')]);return db[_0xe761('0x44')][_0xe761('0x4e')](_0x50f86f)[_0xe761('0x2e')](handleEntityNotFound(_0x397547,null))['then'](respondWithResult(_0x397547,null))[_0xe761('0x47')](handleError(_0x397547,null));};exports[_0xe761('0x4f')]=function(_0x540479,_0x2ea524){return db['VoiceQueueReport'][_0xe761('0x4f')](_0x540479[_0xe761('0x50')],{})[_0xe761('0x2e')](respondWithResult(_0x2ea524,0xc9))[_0xe761('0x47')](handleError(_0x2ea524,null));};exports[_0xe761('0x2d')]=function(_0x29e807,_0x295c0e){if(_0x29e807[_0xe761('0x50')]['id']){delete _0x29e807[_0xe761('0x50')]['id'];}return db[_0xe761('0x44')][_0xe761('0x4e')]({'where':{'id':_0x29e807[_0xe761('0x49')]['id']}})[_0xe761('0x2e')](handleEntityNotFound(_0x295c0e,null))[_0xe761('0x2e')](saveUpdates(_0x29e807['body'],null))[_0xe761('0x2e')](respondWithResult(_0x295c0e,null))['catch'](handleError(_0x295c0e,null));};exports[_0xe761('0x51')]=function(_0x199a5f,_0x4b9f47){return db['VoiceQueueReport']['find']({'where':{'id':_0x199a5f[_0xe761('0x49')]['id']}})[_0xe761('0x2e')](handleEntityNotFound(_0x4b9f47,null))[_0xe761('0x2e')](removeEntity(_0x4b9f47,null))[_0xe761('0x47')](handleError(_0x4b9f47,null));};exports[_0xe761('0x52')]=function(_0xbcfb23,_0x459992){return db[_0xe761('0x44')][_0xe761('0x52')]()[_0xe761('0x2e')](respondWithResult(_0x459992,null))[_0xe761('0x47')](handleError(_0x459992,null));};exports[_0xe761('0x53')]=function(_0x4657f1,_0xa92c79){var _0x3cc056={},_0x301b15={},_0x5975cf={'count':0x0,'rows':[]};_0x301b15[_0xe761('0x36')]=_[_0xe761('0x38')](db['VoiceQueueReport'][_0xe761('0x4a')]);_0x301b15[_0xe761('0x37')]=_[_0xe761('0x38')](_0x4657f1[_0xe761('0x37')]);_0x301b15[_0xe761('0x39')]=_['intersection'](_0x301b15['model'],_0x301b15[_0xe761('0x37')]);_0x3cc056['attributes']=_[_0xe761('0x3a')](_0x301b15[_0xe761('0x36')],qs[_0xe761('0x3c')](_0x4657f1['query'][_0xe761('0x3c')]));_0x3cc056[_0xe761('0x3b')]=_0x3cc056[_0xe761('0x3b')]['length']?_0x3cc056['attributes']:_0x301b15[_0xe761('0x36')];if(!_0x4657f1[_0xe761('0x37')]['hasOwnProperty'](_0xe761('0x54'))){_0x3cc056[_0xe761('0x27')]=qs['limit'](_0x4657f1[_0xe761('0x37')][_0xe761('0x27')]);_0x3cc056[_0xe761('0x25')]=qs[_0xe761('0x25')](_0x4657f1[_0xe761('0x37')]['offset']);}_0x3cc056[_0xe761('0x3e')]=qs['sort'](_0x4657f1[_0xe761('0x37')][_0xe761('0x3f')]);_0x3cc056[_0xe761('0x40')]=qs[_0xe761('0x39')](_['pick'](_0x4657f1[_0xe761('0x37')],_0x301b15[_0xe761('0x39')]));if(_0x4657f1['query']['filter']){_0x3cc056[_0xe761('0x40')]=_['merge'](_0x3cc056[_0xe761('0x40')],{'$or':_[_0xe761('0x33')](_0x3cc056[_0xe761('0x3b')],function(_0x636c9e){var _0x2995f1={};_0x2995f1[_0x636c9e]={'$like':'%'+_0x4657f1[_0xe761('0x37')]['filter']+'%'};return _0x2995f1;})});}_0x3cc056=_[_0xe761('0x42')]({},_0x3cc056,_0x4657f1['options']);var _0x516b0d={'where':_0x3cc056['where']};return db[_0xe761('0x44')][_0xe761('0x28')](_0x516b0d)[_0xe761('0x2e')](function(_0x136f8d){_0x5975cf[_0xe761('0x28')]=_0x136f8d;if(_0x4657f1[_0xe761('0x37')][_0xe761('0x55')]){_0x3cc056['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe761('0x45')](_0x3cc056);})['then'](function(_0x38de90){_0x5975cf[_0xe761('0x46')]=_0x38de90;return _0x5975cf;})[_0xe761('0x2e')](respondWithFilteredResult(_0xa92c79,_0x3cc056,_0xe761('0x53')))[_0xe761('0x47')](handleError(_0xa92c79,null,_0xe761('0x53')));}; \ No newline at end of file +var _0x544b=['offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','VoiceQueueReport','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','getVoiceQueuesReport','length','order','includeAll','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x544b,0xd0));var _0xb544=function(_0x39717c,_0x25b60b){_0x39717c=_0x39717c-0x0;var _0x16e937=_0x544b[_0x39717c];return _0x16e937;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb544('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb544('0x1'));var rp=require(_0xb544('0x2'));var moment=require(_0xb544('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb544('0x4'));var util=require('util');var path=require(_0xb544('0x5'));var sox=require('sox');var csv=require(_0xb544('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb544('0x7'));var squel=require('squel');var crypto=require(_0xb544('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb544('0x9'));var toCsv=require(_0xb544('0x6'));var querystring=require(_0xb544('0xa'));var Papa=require(_0xb544('0xb'));var Redis=require('ioredis');var authService=require(_0xb544('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb544('0xd'));var logger=require(_0xb544('0xe'))(_0xb544('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb544('0x10'));var db=require(_0xb544('0x11'))['db'];config[_0xb544('0x12')]=_[_0xb544('0x13')](config['redis'],{'host':_0xb544('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb544('0x12')]));require(_0xb544('0x15'))[_0xb544('0x16')](socket);function respondWithStatusCode(_0x12756a,_0x1652cc){_0x1652cc=_0x1652cc||0xcc;return function(_0x39eb46){if(_0x39eb46){return _0x12756a[_0xb544('0x17')](_0x1652cc);}return _0x12756a[_0xb544('0x18')](_0x1652cc)[_0xb544('0x19')]();};}function respondWithResult(_0x3308,_0x379f42){_0x379f42=_0x379f42||0xc8;return function(_0x330f97){if(_0x330f97){return _0x3308[_0xb544('0x18')](_0x379f42)['json'](_0x330f97);}};}function respondWithFilteredResult(_0x463e54,_0x24df78){return function(_0xe2707a){if(_0xe2707a){var _0x37236c=typeof _0x24df78[_0xb544('0x1a')]===_0xb544('0x1b')&&typeof _0x24df78[_0xb544('0x1c')]===_0xb544('0x1b');var _0xf17b73=_0xe2707a[_0xb544('0x1d')];var _0x34462c=_0x37236c?0x0:_0x24df78[_0xb544('0x1a')];var _0x3f9895=_0x37236c?_0xe2707a[_0xb544('0x1d')]:_0x24df78['offset']+_0x24df78[_0xb544('0x1c')];var _0x478cc4;if(_0x3f9895>=_0xf17b73){_0x3f9895=_0xf17b73;_0x478cc4=0xc8;}else{_0x478cc4=0xce;}_0x463e54[_0xb544('0x18')](_0x478cc4);return _0x463e54[_0xb544('0x1e')](_0xb544('0x1f'),_0x34462c+'-'+_0x3f9895+'/'+_0xf17b73)[_0xb544('0x20')](_0xe2707a);}return null;};}function patchUpdates(_0x315b33){return function(_0xa78d0e){try{jsonpatch[_0xb544('0x21')](_0xa78d0e,_0x315b33,!![]);}catch(_0x14e721){return BPromise['reject'](_0x14e721);}return _0xa78d0e[_0xb544('0x22')]();};}function saveUpdates(_0x2176bd,_0x3326a5){return function(_0x3a8245){if(_0x3a8245){return _0x3a8245[_0xb544('0x23')](_0x2176bd)[_0xb544('0x24')](function(_0x1fe87b){return _0x1fe87b;});}return null;};}function removeEntity(_0x1bcf9f,_0x5abcb9){return function(_0x2b32ba){if(_0x2b32ba){return _0x2b32ba['destroy']()['then'](function(){_0x1bcf9f[_0xb544('0x18')](0xcc)[_0xb544('0x19')]();});}};}function handleEntityNotFound(_0x249995,_0x868251){return function(_0x478505){if(!_0x478505){_0x249995[_0xb544('0x17')](0x194);}return _0x478505;};}function handleError(_0xd1c5b6,_0x1fa0a2){_0x1fa0a2=_0x1fa0a2||0x1f4;return function(_0x18335c){logger[_0xb544('0x25')](_0x18335c['stack']);if(_0x18335c[_0xb544('0x26')]){delete _0x18335c[_0xb544('0x26')];}_0xd1c5b6['status'](_0x1fa0a2)[_0xb544('0x27')](_0x18335c);};}exports[_0xb544('0x28')]=function(_0x3fa040,_0x22c7fd){var _0x28d614={},_0x11389f={},_0x54d25a={'count':0x0,'rows':[]};var _0x5cc350=_[_0xb544('0x29')](db['VoiceQueueReport'][_0xb544('0x2a')],function(_0x15c1c3){return{'name':_0x15c1c3[_0xb544('0x2b')],'type':_0x15c1c3[_0xb544('0x2c')][_0xb544('0x2d')]};});_0x11389f['model']=_[_0xb544('0x29')](_0x5cc350,_0xb544('0x26'));_0x11389f[_0xb544('0x2e')]=_['keys'](_0x3fa040[_0xb544('0x2e')]);_0x11389f[_0xb544('0x2f')]=_['intersection'](_0x11389f[_0xb544('0x30')],_0x11389f[_0xb544('0x2e')]);_0x28d614[_0xb544('0x31')]=_[_0xb544('0x32')](_0x11389f[_0xb544('0x30')],qs['fields'](_0x3fa040['query'][_0xb544('0x33')]));_0x28d614[_0xb544('0x31')]=_0x28d614[_0xb544('0x31')]['length']?_0x28d614['attributes']:_0x11389f[_0xb544('0x30')];if(!_0x3fa040[_0xb544('0x2e')][_0xb544('0x34')](_0xb544('0x35'))){_0x28d614[_0xb544('0x1c')]=qs[_0xb544('0x1c')](_0x3fa040[_0xb544('0x2e')][_0xb544('0x1c')]);_0x28d614[_0xb544('0x1a')]=qs[_0xb544('0x1a')](_0x3fa040[_0xb544('0x2e')][_0xb544('0x1a')]);}_0x28d614['order']=qs[_0xb544('0x36')](_0x3fa040[_0xb544('0x2e')][_0xb544('0x36')]);_0x28d614[_0xb544('0x37')]=qs['filters'](_[_0xb544('0x38')](_0x3fa040[_0xb544('0x2e')],_0x11389f['filters']),_0x5cc350);if(_0x3fa040[_0xb544('0x2e')]['filter']){_0x28d614[_0xb544('0x37')]=_[_0xb544('0x39')](_0x28d614['where'],{'$or':_[_0xb544('0x29')](_0x5cc350,function(_0x5321d0){if(_0x5321d0['type']!==_0xb544('0x3a')){var _0xe3395e={};_0xe3395e[_0x5321d0[_0xb544('0x26')]]={'$like':'%'+_0x3fa040[_0xb544('0x2e')][_0xb544('0x3b')]+'%'};return _0xe3395e;}})});}_0x28d614=_[_0xb544('0x39')]({},_0x28d614,_0x3fa040[_0xb544('0x3c')]);var _0x411e26={'where':_0x28d614[_0xb544('0x37')]};return db[_0xb544('0x3d')]['count'](_0x411e26)[_0xb544('0x24')](function(_0x588c9d){_0x54d25a[_0xb544('0x1d')]=_0x588c9d;if(_0x3fa040[_0xb544('0x2e')]['includeAll']){_0x28d614[_0xb544('0x3e')]=[{'all':!![]}];}return db[_0xb544('0x3d')][_0xb544('0x3f')](_0x28d614);})['then'](function(_0x428509){_0x54d25a[_0xb544('0x40')]=_0x428509;return _0x54d25a;})[_0xb544('0x24')](respondWithFilteredResult(_0x22c7fd,_0x28d614))[_0xb544('0x41')](handleError(_0x22c7fd,null));};exports[_0xb544('0x42')]=function(_0x14ea75,_0x4ade5c){var _0x50deeb={'raw':![],'where':{'id':_0x14ea75[_0xb544('0x43')]['id']}},_0x5cd1ae={};_0x5cd1ae[_0xb544('0x30')]=_[_0xb544('0x44')](db[_0xb544('0x3d')][_0xb544('0x2a')]);_0x5cd1ae[_0xb544('0x2e')]=_['keys'](_0x14ea75[_0xb544('0x2e')]);_0x5cd1ae[_0xb544('0x2f')]=_[_0xb544('0x32')](_0x5cd1ae[_0xb544('0x30')],_0x5cd1ae[_0xb544('0x2e')]);_0x50deeb[_0xb544('0x31')]=_['intersection'](_0x5cd1ae['model'],qs[_0xb544('0x33')](_0x14ea75[_0xb544('0x2e')][_0xb544('0x33')]));_0x50deeb['attributes']=_0x50deeb[_0xb544('0x31')]['length']?_0x50deeb[_0xb544('0x31')]:_0x5cd1ae[_0xb544('0x30')];if(_0x14ea75['query']['includeAll']){_0x50deeb[_0xb544('0x3e')]=[{'all':!![]}];}_0x50deeb=_['merge']({},_0x50deeb,_0x14ea75[_0xb544('0x3c')]);return db[_0xb544('0x3d')][_0xb544('0x45')](_0x50deeb)[_0xb544('0x24')](handleEntityNotFound(_0x4ade5c,null))['then'](respondWithResult(_0x4ade5c,null))['catch'](handleError(_0x4ade5c,null));};exports[_0xb544('0x46')]=function(_0x3c304b,_0x2cdcb6){return db['VoiceQueueReport'][_0xb544('0x46')](_0x3c304b[_0xb544('0x47')],{})[_0xb544('0x24')](respondWithResult(_0x2cdcb6,0xc9))[_0xb544('0x41')](handleError(_0x2cdcb6,null));};exports['update']=function(_0x47f959,_0x1146c9){if(_0x47f959['body']['id']){delete _0x47f959[_0xb544('0x47')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x47f959['params']['id']}})['then'](handleEntityNotFound(_0x1146c9,null))[_0xb544('0x24')](saveUpdates(_0x47f959[_0xb544('0x47')],null))[_0xb544('0x24')](respondWithResult(_0x1146c9,null))[_0xb544('0x41')](handleError(_0x1146c9,null));};exports[_0xb544('0x48')]=function(_0x4cc9cc,_0x28dc8f){return db[_0xb544('0x3d')][_0xb544('0x45')]({'where':{'id':_0x4cc9cc[_0xb544('0x43')]['id']}})[_0xb544('0x24')](handleEntityNotFound(_0x28dc8f,null))[_0xb544('0x24')](removeEntity(_0x28dc8f,null))[_0xb544('0x41')](handleError(_0x28dc8f,null));};exports[_0xb544('0x49')]=function(_0x31a9df,_0x1d7856){return db[_0xb544('0x3d')][_0xb544('0x49')]()[_0xb544('0x24')](respondWithResult(_0x1d7856,null))[_0xb544('0x41')](handleError(_0x1d7856,null));};exports[_0xb544('0x4a')]=function(_0x1bb214,_0x2c1cbb){var _0xb19842={},_0x456334={},_0x17dcb4={'count':0x0,'rows':[]};_0x456334[_0xb544('0x30')]=_[_0xb544('0x44')](db['VoiceQueueReport']['rawAttributes']);_0x456334[_0xb544('0x2e')]=_['keys'](_0x1bb214[_0xb544('0x2e')]);_0x456334[_0xb544('0x2f')]=_[_0xb544('0x32')](_0x456334['model'],_0x456334[_0xb544('0x2e')]);_0xb19842[_0xb544('0x31')]=_['intersection'](_0x456334[_0xb544('0x30')],qs[_0xb544('0x33')](_0x1bb214['query'][_0xb544('0x33')]));_0xb19842['attributes']=_0xb19842['attributes'][_0xb544('0x4b')]?_0xb19842[_0xb544('0x31')]:_0x456334['model'];if(!_0x1bb214['query'][_0xb544('0x34')](_0xb544('0x35'))){_0xb19842[_0xb544('0x1c')]=qs[_0xb544('0x1c')](_0x1bb214[_0xb544('0x2e')][_0xb544('0x1c')]);_0xb19842[_0xb544('0x1a')]=qs[_0xb544('0x1a')](_0x1bb214[_0xb544('0x2e')][_0xb544('0x1a')]);}_0xb19842[_0xb544('0x4c')]=qs[_0xb544('0x36')](_0x1bb214[_0xb544('0x2e')][_0xb544('0x36')]);_0xb19842['where']=qs[_0xb544('0x2f')](_['pick'](_0x1bb214[_0xb544('0x2e')],_0x456334[_0xb544('0x2f')]));if(_0x1bb214[_0xb544('0x2e')][_0xb544('0x3b')]){_0xb19842[_0xb544('0x37')]=_[_0xb544('0x39')](_0xb19842[_0xb544('0x37')],{'$or':_[_0xb544('0x29')](_0xb19842[_0xb544('0x31')],function(_0x367163){var _0x2c3b9f={};_0x2c3b9f[_0x367163]={'$like':'%'+_0x1bb214[_0xb544('0x2e')][_0xb544('0x3b')]+'%'};return _0x2c3b9f;})});}_0xb19842=_[_0xb544('0x39')]({},_0xb19842,_0x1bb214['options']);var _0x3313e3={'where':_0xb19842[_0xb544('0x37')]};return db[_0xb544('0x3d')][_0xb544('0x1d')](_0x3313e3)[_0xb544('0x24')](function(_0x381ee2){_0x17dcb4[_0xb544('0x1d')]=_0x381ee2;if(_0x1bb214[_0xb544('0x2e')][_0xb544('0x4d')]){_0xb19842[_0xb544('0x3e')]=[{'all':!![]}];}return db[_0xb544('0x3d')][_0xb544('0x3f')](_0xb19842);})[_0xb544('0x24')](function(_0x2e6934){_0x17dcb4['rows']=_0x2e6934;return _0x17dcb4;})[_0xb544('0x24')](respondWithFilteredResult(_0x2c1cbb,_0xb19842,_0xb544('0x4a')))['catch'](handleError(_0x2c1cbb,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 07c420f..6885555 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 _0xaf1e=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','hasOwnProperty'];(function(_0x2ecb26,_0x3db364){var _0x18e39a=function(_0x5e6af){while(--_0x5e6af){_0x2ecb26['push'](_0x2ecb26['shift']());}};_0x18e39a(++_0x3db364);}(_0xaf1e,0x86));var _0xeaf1=function(_0x5c1b62,_0x19577d){_0x5c1b62=_0x5c1b62-0x0;var _0x11ef77=_0xaf1e[_0x5c1b62];return _0x11ef77;};'use strict';var EventEmitter=require(_0xeaf1('0x0'));var VoiceQueueReport=require(_0xeaf1('0x1'))['db'][_0xeaf1('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeaf1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaf1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x135d87){return function(_0x306f99,_0x4a4613,_0x16f6e8){VoiceQueueReportEvents['emit'](_0x135d87+':'+_0x306f99['id'],_0x306f99);VoiceQueueReportEvents['emit'](_0x135d87,_0x306f99);_0x16f6e8(null);};}for(var e in events){if(events[_0xeaf1('0x5')](e)){var event=events[e];VoiceQueueReport[_0xeaf1('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x33fb=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x2d01df,_0x429d33){var _0x56e944=function(_0x538aad){while(--_0x538aad){_0x2d01df['push'](_0x2d01df['shift']());}};_0x56e944(++_0x429d33);}(_0x33fb,0x1af));var _0xb33f=function(_0x55a8f4,_0x549031){_0x55a8f4=_0x55a8f4-0x0;var _0xb05235=_0x33fb[_0x55a8f4];return _0xb05235;};'use strict';var EventEmitter=require(_0xb33f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xb33f('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb33f('0x2')](0x0);var events={'afterCreate':_0xb33f('0x3'),'afterUpdate':_0xb33f('0x4'),'afterDestroy':_0xb33f('0x5')};function emitEvent(_0x42af89){return function(_0x102127,_0x16c54a,_0x3008fd){VoiceQueueReportEvents[_0xb33f('0x6')](_0x42af89+':'+_0x102127['id'],_0x102127);VoiceQueueReportEvents['emit'](_0x42af89,_0x102127);_0x3008fd(null);};}for(var e in events){if(events[_0xb33f('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](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 9e02db6..5b4cf10 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 _0x4d0b=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird'];(function(_0x44f353,_0x5b6c2f){var _0x26a635=function(_0x32726e){while(--_0x32726e){_0x44f353['push'](_0x44f353['shift']());}};_0x26a635(++_0x5b6c2f);}(_0x4d0b,0x127));var _0xb4d0=function(_0x48e0eb,_0x30e9cd){_0x48e0eb=_0x48e0eb-0x0;var _0x5cdff2=_0x4d0b[_0x48e0eb];return _0x5cdff2;};'use strict';var _=require('lodash');var util=require(_0xb4d0('0x0'));var logger=require(_0xb4d0('0x1'))(_0xb4d0('0x2'));var moment=require(_0xb4d0('0x3'));var BPromise=require(_0xb4d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4d0('0x5'));var rimraf=require(_0xb4d0('0x6'));var config=require(_0xb4d0('0x7'));var attributes=require(_0xb4d0('0x8'));module[_0xb4d0('0x9')]=function(_0x3d59cd,_0x11ba71){return _0x3d59cd[_0xb4d0('0xa')](_0xb4d0('0xb'),attributes,{'tableName':_0xb4d0('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb4d0('0xd')]},{'fields':[_0xb4d0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x32c9=['../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4190b6,_0x51bff5){var _0xc038a1=function(_0x5e8c54){while(--_0x5e8c54){_0x4190b6['push'](_0x4190b6['shift']());}};_0xc038a1(++_0x51bff5);}(_0x32c9,0x105));var _0x932c=function(_0x413da3,_0x2cd7ac){_0x413da3=_0x413da3-0x0;var _0x33bd91=_0x32c9[_0x413da3];return _0x33bd91;};'use strict';var _=require(_0x932c('0x0'));var util=require(_0x932c('0x1'));var logger=require(_0x932c('0x2'))(_0x932c('0x3'));var moment=require(_0x932c('0x4'));var BPromise=require(_0x932c('0x5'));var rp=require(_0x932c('0x6'));var fs=require('fs');var path=require(_0x932c('0x7'));var rimraf=require(_0x932c('0x8'));var config=require(_0x932c('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x932c('0xa')]=function(_0x24419d,_0x4918a6){return _0x24419d[_0x932c('0xb')](_0x932c('0xc'),attributes,{'tableName':_0x932c('0xd'),'paranoid':![],'indexes':[{'fields':[_0x932c('0xe')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 9e4cd8b..0ab22b7 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 _0x87c9=['CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','debug'];(function(_0x18a0af,_0x1df0b9){var _0x5cb655=function(_0xd1543){while(--_0xd1543){_0x18a0af['push'](_0x18a0af['shift']());}};_0x5cb655(++_0x1df0b9);}(_0x87c9,0xd7));var _0x987c=function(_0x43f138,_0x3a2499){_0x43f138=_0x43f138-0x0;var _0x1802f2=_0x87c9[_0x43f138];return _0x1802f2;};'use strict';var _=require('lodash');var util=require(_0x987c('0x0'));var moment=require(_0x987c('0x1'));var BPromise=require('bluebird');var rs=require(_0x987c('0x2'));var fs=require('fs');var Redis=require(_0x987c('0x3'));var db=require(_0x987c('0x4'))['db'];var utils=require(_0x987c('0x5'));var logger=require(_0x987c('0x6'))(_0x987c('0x7'));var config=require(_0x987c('0x8'));var jayson=require(_0x987c('0x9'));var client=jayson[_0x987c('0xa')][_0x987c('0xb')]({'port':0x232a});config[_0x987c('0xc')]=_['defaults'](config[_0x987c('0xc')],{'host':_0x987c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x987c('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x1c4046,_0x2a4350,_0x3fb41c){return new BPromise(function(_0x50af51,_0x106e1b){return client[_0x987c('0xe')](_0x1c4046,_0x3fb41c)[_0x987c('0xf')](function(_0x265fb7){logger[_0x987c('0x10')](_0x987c('0x11'),_0x2a4350,_0x987c('0x12'));logger['debug'](_0x987c('0x13'),_0x2a4350,_0x987c('0x12'),JSON[_0x987c('0x14')](_0x265fb7));if(_0x265fb7[_0x987c('0x15')]){if(_0x265fb7[_0x987c('0x15')][_0x987c('0x16')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2a4350,_0x265fb7['error']['message']);return _0x106e1b(_0x265fb7[_0x987c('0x15')][_0x987c('0x17')]);}logger[_0x987c('0x15')](_0x987c('0x11'),_0x2a4350,_0x265fb7[_0x987c('0x15')]['message']);return _0x50af51(_0x265fb7['error'][_0x987c('0x17')]);}else{logger[_0x987c('0x10')](_0x987c('0x11'),_0x2a4350,_0x987c('0x12'));_0x50af51(_0x265fb7[_0x987c('0x18')][_0x987c('0x17')]);}})[_0x987c('0x19')](function(_0x2d00b7){logger[_0x987c('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x2a4350,_0x2d00b7);_0x106e1b(_0x2d00b7);});});}exports[_0x987c('0x1a')]=function(_0x84b9a2){var _0x416bbc=this;return new Promise(function(_0x4fba58,_0x4122dd){return db[_0x987c('0x1b')]['findAll']({'raw':_0x84b9a2[_0x987c('0x1c')]?_0x84b9a2[_0x987c('0x1c')][_0x987c('0x1d')]===undefined?!![]:![]:!![],'where':_0x84b9a2['options']?_0x84b9a2[_0x987c('0x1c')][_0x987c('0x1e')]||null:null,'attributes':_0x84b9a2[_0x987c('0x1c')]?_0x84b9a2[_0x987c('0x1c')][_0x987c('0x1f')]||null:null,'limit':_0x84b9a2[_0x987c('0x1c')]?_0x84b9a2['options'][_0x987c('0x20')]||null:null,'include':_0x84b9a2[_0x987c('0x1c')]?_0x84b9a2['options'][_0x987c('0x21')]?_[_0x987c('0x22')](_0x84b9a2[_0x987c('0x1c')][_0x987c('0x21')],function(_0x2730a4){return{'model':db[_0x2730a4['model']],'as':_0x2730a4['as'],'attributes':_0x2730a4[_0x987c('0x1f')],'include':_0x2730a4[_0x987c('0x21')]?_['map'](_0x2730a4[_0x987c('0x21')],function(_0x51e701){return{'model':db[_0x51e701[_0x987c('0x23')]],'as':_0x51e701['as'],'attributes':_0x51e701[_0x987c('0x1f')],'include':_0x51e701[_0x987c('0x21')]?_[_0x987c('0x22')](_0x51e701[_0x987c('0x21')],function(_0x5e78b8){return{'model':db[_0x5e78b8[_0x987c('0x23')]],'as':_0x5e78b8['as'],'attributes':_0x5e78b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x987c('0xf')](function(_0x48a9ac){logger[_0x987c('0x10')](_0x987c('0x1a'),_0x84b9a2);logger[_0x987c('0x24')](_0x987c('0x1a'),_0x84b9a2,JSON[_0x987c('0x14')](_0x48a9ac));_0x4fba58(_0x48a9ac);})[_0x987c('0x19')](function(_0x4379d9){logger[_0x987c('0x15')](_0x987c('0x1a'),_0x4379d9[_0x987c('0x17')],_0x84b9a2);_0x4122dd(_0x416bbc[_0x987c('0x15')](0x1f4,_0x4379d9[_0x987c('0x17')]));});});};exports[_0x987c('0x25')]=function(_0x4c9228){var _0xa8abe6=this;return new Promise(function(_0x8837fa,_0x242d0b){return db['VoiceQueueReport'][_0x987c('0x26')](_0x4c9228[_0x987c('0x27')],{'raw':_0x4c9228[_0x987c('0x1c')]?_0x4c9228['options'][_0x987c('0x1d')]===undefined?!![]:![]:!![]})[_0x987c('0xf')](function(_0x1d6743){logger[_0x987c('0x10')](_0x987c('0x25'),_0x4c9228);logger[_0x987c('0x24')](_0x987c('0x25'),_0x4c9228,JSON['stringify'](_0x1d6743));_0x8837fa(_0x1d6743);})['catch'](function(_0x2c6984){logger[_0x987c('0x15')](_0x987c('0x25'),_0x2c6984['message'],_0x4c9228);_0x242d0b(_0xa8abe6[_0x987c('0x15')](0x1f4,_0x2c6984[_0x987c('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x44214d){var _0xc58423=this;return new Promise(function(_0x253d2b,_0x30bdec){return db['VoiceQueueReport'][_0x987c('0x28')](_0x44214d[_0x987c('0x27')],{'raw':_0x44214d['options']?_0x44214d[_0x987c('0x1c')][_0x987c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44214d[_0x987c('0x1c')]?_0x44214d['options']['where']||null:null,'attributes':_0x44214d[_0x987c('0x1c')]?_0x44214d[_0x987c('0x1c')][_0x987c('0x1f')]||null:null,'limit':_0x44214d[_0x987c('0x1c')]?_0x44214d[_0x987c('0x1c')][_0x987c('0x20')]||null:null})[_0x987c('0xf')](function(_0x4c02c9){logger[_0x987c('0x10')]('UpdateVoiceQueueReport',_0x44214d);logger[_0x987c('0x24')]('UpdateVoiceQueueReport',_0x44214d,JSON[_0x987c('0x14')](_0x4c02c9));_0x253d2b(_0x4c02c9);})[_0x987c('0x19')](function(_0x46aa41){logger[_0x987c('0x15')](_0x987c('0x29'),_0x46aa41[_0x987c('0x17')],_0x44214d);_0x30bdec(_0xc58423['error'](0x1f4,_0x46aa41['message']));});});}; \ No newline at end of file +var _0x539b=['UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','findAll','options','attributes','limit','include','model','map','VoiceQueueReport','create','raw','CreateVoiceQueueReport'];(function(_0x554411,_0x563412){var _0xa552dd=function(_0xc33328){while(--_0xc33328){_0x554411['push'](_0x554411['shift']());}};_0xa552dd(++_0x563412);}(_0x539b,0x14c));var _0xb539=function(_0x5d7a65,_0x3afd8e){_0x5d7a65=_0x5d7a65-0x0;var _0x56d949=_0x539b[_0x5d7a65];return _0x56d949;};'use strict';var _=require(_0xb539('0x0'));var util=require(_0xb539('0x1'));var moment=require(_0xb539('0x2'));var BPromise=require(_0xb539('0x3'));var rs=require(_0xb539('0x4'));var fs=require('fs');var Redis=require(_0xb539('0x5'));var db=require(_0xb539('0x6'))['db'];var utils=require(_0xb539('0x7'));var logger=require(_0xb539('0x8'))('rpc');var config=require(_0xb539('0x9'));var jayson=require(_0xb539('0xa'));var client=jayson[_0xb539('0xb')][_0xb539('0xc')]({'port':0x232a});config[_0xb539('0xd')]=_[_0xb539('0xe')](config[_0xb539('0xd')],{'host':_0xb539('0xf'),'port':0x18eb});var socket=require(_0xb539('0x10'))(new Redis(config[_0xb539('0xd')]));require(_0xb539('0x11'))[_0xb539('0x12')](socket);function respondWithRpcPromise(_0x1ff47b,_0x2c2ba2,_0x412092){return new BPromise(function(_0x9f59cc,_0x45d3f5){return client[_0xb539('0x13')](_0x1ff47b,_0x412092)[_0xb539('0x14')](function(_0x6895b4){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x2c2ba2,'request\x20sent');logger[_0xb539('0x15')](_0xb539('0x16'),_0x2c2ba2,_0xb539('0x17'),JSON[_0xb539('0x18')](_0x6895b4));if(_0x6895b4[_0xb539('0x19')]){if(_0x6895b4[_0xb539('0x19')][_0xb539('0x1a')]===0x1f4){logger[_0xb539('0x19')](_0xb539('0x1b'),_0x2c2ba2,_0x6895b4[_0xb539('0x19')][_0xb539('0x1c')]);return _0x45d3f5(_0x6895b4[_0xb539('0x19')]['message']);}logger[_0xb539('0x19')](_0xb539('0x1b'),_0x2c2ba2,_0x6895b4[_0xb539('0x19')][_0xb539('0x1c')]);return _0x9f59cc(_0x6895b4['error']['message']);}else{logger[_0xb539('0x1d')](_0xb539('0x1b'),_0x2c2ba2,_0xb539('0x17'));_0x9f59cc(_0x6895b4[_0xb539('0x1e')][_0xb539('0x1c')]);}})[_0xb539('0x1f')](function(_0x4c9ba6){logger[_0xb539('0x19')](_0xb539('0x1b'),_0x2c2ba2,_0x4c9ba6);_0x45d3f5(_0x4c9ba6);});});}exports[_0xb539('0x20')]=function(_0x3d390e){var _0x55466c=this;return new Promise(function(_0x3b5486,_0x2b6cfe){return db['VoiceQueueReport'][_0xb539('0x21')]({'raw':_0x3d390e['options']?_0x3d390e[_0xb539('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x3d390e['options']?_0x3d390e[_0xb539('0x22')]['where']||null:null,'attributes':_0x3d390e[_0xb539('0x22')]?_0x3d390e[_0xb539('0x22')][_0xb539('0x23')]||null:null,'limit':_0x3d390e['options']?_0x3d390e[_0xb539('0x22')][_0xb539('0x24')]||null:null,'include':_0x3d390e[_0xb539('0x22')]?_0x3d390e[_0xb539('0x22')][_0xb539('0x25')]?_['map'](_0x3d390e[_0xb539('0x22')]['include'],function(_0x8d7432){return{'model':db[_0x8d7432[_0xb539('0x26')]],'as':_0x8d7432['as'],'attributes':_0x8d7432['attributes'],'include':_0x8d7432[_0xb539('0x25')]?_[_0xb539('0x27')](_0x8d7432['include'],function(_0x282b0e){return{'model':db[_0x282b0e[_0xb539('0x26')]],'as':_0x282b0e['as'],'attributes':_0x282b0e[_0xb539('0x23')],'include':_0x282b0e['include']?_[_0xb539('0x27')](_0x282b0e['include'],function(_0x5477b3){return{'model':db[_0x5477b3[_0xb539('0x26')]],'as':_0x5477b3['as'],'attributes':_0x5477b3[_0xb539('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54717a){logger['info'](_0xb539('0x20'),_0x3d390e);logger[_0xb539('0x15')]('GetVoiceQueueReport',_0x3d390e,JSON[_0xb539('0x18')](_0x54717a));_0x3b5486(_0x54717a);})[_0xb539('0x1f')](function(_0x4fb86f){logger[_0xb539('0x19')](_0xb539('0x20'),_0x4fb86f[_0xb539('0x1c')],_0x3d390e);_0x2b6cfe(_0x55466c[_0xb539('0x19')](0x1f4,_0x4fb86f[_0xb539('0x1c')]));});});};exports['CreateVoiceQueueReport']=function(_0x4be6c7){var _0x39a34e=this;return new Promise(function(_0x12cf48,_0x583639){return db[_0xb539('0x28')][_0xb539('0x29')](_0x4be6c7['body'],{'raw':_0x4be6c7[_0xb539('0x22')]?_0x4be6c7[_0xb539('0x22')][_0xb539('0x2a')]===undefined?!![]:![]:!![]})[_0xb539('0x14')](function(_0x34de87){logger[_0xb539('0x1d')](_0xb539('0x2b'),_0x4be6c7);logger[_0xb539('0x15')](_0xb539('0x2b'),_0x4be6c7,JSON[_0xb539('0x18')](_0x34de87));_0x12cf48(_0x34de87);})['catch'](function(_0x194fea){logger[_0xb539('0x19')](_0xb539('0x2b'),_0x194fea['message'],_0x4be6c7);_0x583639(_0x39a34e[_0xb539('0x19')](0x1f4,_0x194fea[_0xb539('0x1c')]));});});};exports[_0xb539('0x2c')]=function(_0x5f4815){var _0x53116d=this;return new Promise(function(_0x40e629,_0x392326){return db['VoiceQueueReport'][_0xb539('0x2d')](_0x5f4815[_0xb539('0x2e')],{'raw':_0x5f4815['options']?_0x5f4815[_0xb539('0x22')][_0xb539('0x2a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f4815[_0xb539('0x22')]?_0x5f4815[_0xb539('0x22')]['where']||null:null,'attributes':_0x5f4815[_0xb539('0x22')]?_0x5f4815[_0xb539('0x22')][_0xb539('0x23')]||null:null,'limit':_0x5f4815[_0xb539('0x22')]?_0x5f4815[_0xb539('0x22')][_0xb539('0x24')]||null:null})[_0xb539('0x14')](function(_0x5405d9){logger[_0xb539('0x1d')](_0xb539('0x2c'),_0x5f4815);logger[_0xb539('0x15')]('UpdateVoiceQueueReport',_0x5f4815,JSON[_0xb539('0x18')](_0x5405d9));_0x40e629(_0x5405d9);})['catch'](function(_0x42b8dc){logger['error'](_0xb539('0x2c'),_0x42b8dc[_0xb539('0x1c')],_0x5f4815);_0x392326(_0x53116d[_0xb539('0x19')](0x1f4,_0x42b8dc[_0xb539('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 51bb70e..a22dc77 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 _0x919e=['save','remove','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x2d09ee,_0x43daba){var _0x74fa7d=function(_0x34c0b6){while(--_0x34c0b6){_0x2d09ee['push'](_0x2d09ee['shift']());}};_0x74fa7d(++_0x43daba);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueReportEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){VoiceQueueReportEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);VoiceQueueReportEvents['on'](_0x2ceb41,_0x57c3fe);}}; \ No newline at end of file +var _0x433a=['removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','emit'];(function(_0x18caac,_0x21caf4){var _0x14ac14=function(_0x14354b){while(--_0x14354b){_0x18caac['push'](_0x18caac['shift']());}};_0x14ac14(++_0x21caf4);}(_0x433a,0x14c));var _0xa433=function(_0xf9955e,_0x10cff2){_0xf9955e=_0xf9955e-0x0;var _0x23f23c=_0x433a[_0xf9955e];return _0x23f23c;};'use strict';var VoiceQueueReportEvents=require(_0xa433('0x0'));var events=[_0xa433('0x1'),_0xa433('0x2'),'update'];function createListener(_0x29307f,_0x44c87a){return function(_0x22ac7b){_0x44c87a[_0xa433('0x3')](_0x29307f,_0x22ac7b);};}function removeListener(_0x4a4d5c,_0x22f282){return function(){VoiceQueueReportEvents[_0xa433('0x4')](_0x4a4d5c,_0x22f282);};}exports['register']=function(_0x333987){for(var _0x4117cb=0x0,_0x406fd6=events[_0xa433('0x5')];_0x4117cb<_0x406fd6;_0x4117cb++){var _0x29fb63=events[_0x4117cb];var _0x59fbe9=createListener(_0xa433('0x6')+_0x29fb63,_0x333987);VoiceQueueReportEvents['on'](_0x29fb63,_0x59fbe9);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index f21a4ea..ef0ee1d 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 _0x7fac=['show','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x7fac,0x137));var _0xc7fa=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x7fac[_0x1aed80];return _0x43961e;};'use strict';var multer=require(_0xc7fa('0x0'));var util=require('util');var path=require(_0xc7fa('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7fa('0x2'));var router=express[_0xc7fa('0x3')]();var fs_extra=require(_0xc7fa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7fa('0x5'));var config=require(_0xc7fa('0x6'));var controller=require(_0xc7fa('0x7'));router[_0xc7fa('0x8')]('/',auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xa')]);router[_0xc7fa('0x8')](_0xc7fa('0xb'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xc')]);router['post']('/',auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xd')]);router[_0xc7fa('0xe')](_0xc7fa('0xb'),auth['isAuthenticated'](),controller[_0xc7fa('0xf')]);router[_0xc7fa('0x10')](_0xc7fa('0xb'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0x11')]);module[_0xc7fa('0x12')]=router; \ No newline at end of file +var _0x2b52=['get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueuesLog.controller'];(function(_0x5d6353,_0x4402b7){var _0x594751=function(_0x35e60a){while(--_0x35e60a){_0x5d6353['push'](_0x5d6353['shift']());}};_0x594751(++_0x4402b7);}(_0x2b52,0x12a));var _0x22b5=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x2b52[_0x31b5a5];return _0x364cc9;};'use strict';var multer=require(_0x22b5('0x0'));var util=require(_0x22b5('0x1'));var path=require('path');var timeout=require(_0x22b5('0x2'));var express=require(_0x22b5('0x3'));var router=express[_0x22b5('0x4')]();var fs_extra=require(_0x22b5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22b5('0x6'));var controller=require(_0x22b5('0x7'));router[_0x22b5('0x8')]('/',auth[_0x22b5('0x9')](),controller[_0x22b5('0xa')]);router[_0x22b5('0x8')]('/:id',auth[_0x22b5('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x22b5('0xb')]);router[_0x22b5('0xc')](_0x22b5('0xd'),auth[_0x22b5('0x9')](),controller[_0x22b5('0xe')]);router[_0x22b5('0xf')](_0x22b5('0xd'),auth[_0x22b5('0x9')](),controller['destroy']);module[_0x22b5('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 3c175ab..27350d6 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 _0x4148=['exports','STRING','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4148,0xc6));var _0x8414=function(_0x4c76ad,_0x24bdab){_0x4c76ad=_0x4c76ad-0x0;var _0xde0a18=_0x4148[_0x4c76ad];return _0xde0a18;};'use strict';var Sequelize=require(_0x8414('0x0'));var moment=require(_0x8414('0x1'));module[_0x8414('0x2')]={'time':{'type':Sequelize[_0x8414('0x3')]},'callid':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8414('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()['format'](_0x8414('0x4'))}}; \ No newline at end of file +var _0xd470=['format','moment','exports','STRING','DATE'];(function(_0x3f0c12,_0xea4b1d){var _0x2b90e0=function(_0x57ea6a){while(--_0x57ea6a){_0x3f0c12['push'](_0x3f0c12['shift']());}};_0x2b90e0(++_0xea4b1d);}(_0xd470,0x1b4));var _0x0d47=function(_0x295ea9,_0x3dd3ac){_0x295ea9=_0x295ea9-0x0;var _0x36e2b9=_0xd470[_0x295ea9];return _0x36e2b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0d47('0x0'));module[_0x0d47('0x1')]={'time':{'type':Sequelize[_0x0d47('0x2')]},'callid':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0d47('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0d47('0x3')],'allowNull':![],'defaultValue':moment()[_0x0d47('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a9d6eb6..068751f 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 _0xafe9=['bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','map','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','where','pick','VIRTUAL','merge','options','VoiceQueuesLog','includeAll','include','rows','show','params','rawAttributes','length','find','create','body','catch','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4676ae,_0x43de9b){var _0xc44cf8=function(_0xb5f294){while(--_0xb5f294){_0x4676ae['push'](_0x4676ae['shift']());}};_0xc44cf8(++_0x43de9b);}(_0xafe9,0x1ac));var _0x9afe=function(_0x191912,_0xbf1b85){_0x191912=_0x191912-0x0;var _0x4101ea=_0xafe9[_0x191912];return _0x4101ea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9afe('0x0'));var jsonpatch=require(_0x9afe('0x1'));var rp=require(_0x9afe('0x2'));var moment=require(_0x9afe('0x3'));var BPromise=require(_0x9afe('0x4'));var Mustache=require(_0x9afe('0x5'));var util=require(_0x9afe('0x6'));var path=require(_0x9afe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9afe('0x8'));var fs=require('fs');var fs_extra=require(_0x9afe('0x9'));var _=require(_0x9afe('0xa'));var squel=require(_0x9afe('0xb'));var crypto=require(_0x9afe('0xc'));var jsforce=require(_0x9afe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9afe('0xe'));var querystring=require(_0x9afe('0xf'));var Papa=require(_0x9afe('0x10'));var Redis=require('ioredis');var authService=require(_0x9afe('0x11'));var qs=require(_0x9afe('0x12'));var as=require(_0x9afe('0x13'));var hardwareService=require(_0x9afe('0x14'));var logger=require(_0x9afe('0x15'))(_0x9afe('0x16'));var utils=require('../../config/utils');var config=require(_0x9afe('0x17'));var licenseUtil=require(_0x9afe('0x18'));var db=require(_0x9afe('0x19'))['db'];function respondWithStatusCode(_0x5db412,_0x4ad39e){_0x4ad39e=_0x4ad39e||0xcc;return function(_0x29f9a5){if(_0x29f9a5){return _0x5db412[_0x9afe('0x1a')](_0x4ad39e);}return _0x5db412[_0x9afe('0x1b')](_0x4ad39e)[_0x9afe('0x1c')]();};}function respondWithResult(_0x4caf54,_0x250760){_0x250760=_0x250760||0xc8;return function(_0x595b29){if(_0x595b29){return _0x4caf54[_0x9afe('0x1b')](_0x250760)[_0x9afe('0x1d')](_0x595b29);}};}function respondWithFilteredResult(_0x8d47c7,_0x825255){return function(_0xb1b2c5){if(_0xb1b2c5){var _0x80276d=typeof _0x825255[_0x9afe('0x1e')]===_0x9afe('0x1f')&&typeof _0x825255[_0x9afe('0x20')]===_0x9afe('0x1f');var _0x1e02a4=_0xb1b2c5[_0x9afe('0x21')];var _0x4660a8=_0x80276d?0x0:_0x825255[_0x9afe('0x1e')];var _0x1f5d99=_0x80276d?_0xb1b2c5[_0x9afe('0x21')]:_0x825255[_0x9afe('0x1e')]+_0x825255[_0x9afe('0x20')];var _0x52b818;if(_0x1f5d99>=_0x1e02a4){_0x1f5d99=_0x1e02a4;_0x52b818=0xc8;}else{_0x52b818=0xce;}_0x8d47c7[_0x9afe('0x1b')](_0x52b818);return _0x8d47c7[_0x9afe('0x22')](_0x9afe('0x23'),_0x4660a8+'-'+_0x1f5d99+'/'+_0x1e02a4)['json'](_0xb1b2c5);}return null;};}function patchUpdates(_0x3e1903){return function(_0x39267b){try{jsonpatch[_0x9afe('0x24')](_0x39267b,_0x3e1903,!![]);}catch(_0x42b497){return BPromise['reject'](_0x42b497);}return _0x39267b[_0x9afe('0x25')]();};}function saveUpdates(_0x314bcf,_0x1f9989){return function(_0x8bb525){if(_0x8bb525){return _0x8bb525[_0x9afe('0x26')](_0x314bcf)['then'](function(_0x33e868){return _0x33e868;});}return null;};}function removeEntity(_0x47b79d,_0x4fd746){return function(_0x506903){if(_0x506903){return _0x506903[_0x9afe('0x27')]()[_0x9afe('0x28')](function(){_0x47b79d[_0x9afe('0x1b')](0xcc)[_0x9afe('0x1c')]();});}};}function handleEntityNotFound(_0xb42e4e,_0x4b9ece){return function(_0x1e0d69){if(!_0x1e0d69){_0xb42e4e[_0x9afe('0x1a')](0x194);}return _0x1e0d69;};}function handleError(_0x3e42b6,_0x1997e0){_0x1997e0=_0x1997e0||0x1f4;return function(_0x33747f){logger[_0x9afe('0x29')](_0x33747f['stack']);if(_0x33747f[_0x9afe('0x2a')]){delete _0x33747f['name'];}_0x3e42b6[_0x9afe('0x1b')](_0x1997e0)['send'](_0x33747f);};}exports['index']=function(_0xb229c1,_0x3a5e22){var _0x23505c={},_0x4cbf5a={},_0x5a39fa={'count':0x0,'rows':[]};var _0x5964e0=_[_0x9afe('0x2b')](db['VoiceQueuesLog']['rawAttributes'],function(_0x3cbd48){return{'name':_0x3cbd48['fieldName'],'type':_0x3cbd48[_0x9afe('0x2c')][_0x9afe('0x2d')]};});_0x4cbf5a[_0x9afe('0x2e')]=_['map'](_0x5964e0,_0x9afe('0x2a'));_0x4cbf5a[_0x9afe('0x2f')]=_[_0x9afe('0x30')](_0xb229c1[_0x9afe('0x2f')]);_0x4cbf5a[_0x9afe('0x31')]=_[_0x9afe('0x32')](_0x4cbf5a['model'],_0x4cbf5a[_0x9afe('0x2f')]);_0x23505c['attributes']=_[_0x9afe('0x32')](_0x4cbf5a[_0x9afe('0x2e')],qs[_0x9afe('0x33')](_0xb229c1['query'][_0x9afe('0x33')]));_0x23505c['attributes']=_0x23505c[_0x9afe('0x34')]['length']?_0x23505c['attributes']:_0x4cbf5a['model'];if(!_0xb229c1[_0x9afe('0x2f')]['hasOwnProperty'](_0x9afe('0x35'))){_0x23505c['limit']=qs[_0x9afe('0x20')](_0xb229c1[_0x9afe('0x2f')][_0x9afe('0x20')]);_0x23505c[_0x9afe('0x1e')]=qs[_0x9afe('0x1e')](_0xb229c1['query']['offset']);}_0x23505c[_0x9afe('0x36')]=qs['sort'](_0xb229c1[_0x9afe('0x2f')]['sort']);_0x23505c[_0x9afe('0x37')]=qs['filters'](_[_0x9afe('0x38')](_0xb229c1[_0x9afe('0x2f')],_0x4cbf5a[_0x9afe('0x31')]),_0x5964e0);if(_0xb229c1[_0x9afe('0x2f')]['filter']){_0x23505c[_0x9afe('0x37')]=_['merge'](_0x23505c[_0x9afe('0x37')],{'$or':_[_0x9afe('0x2b')](_0x5964e0,function(_0x33c004){if(_0x33c004['type']!==_0x9afe('0x39')){var _0x8e8b83={};_0x8e8b83[_0x33c004[_0x9afe('0x2a')]]={'$like':'%'+_0xb229c1[_0x9afe('0x2f')]['filter']+'%'};return _0x8e8b83;}})});}_0x23505c=_[_0x9afe('0x3a')]({},_0x23505c,_0xb229c1[_0x9afe('0x3b')]);var _0x11927f={'where':_0x23505c[_0x9afe('0x37')]};return db[_0x9afe('0x3c')]['count'](_0x11927f)[_0x9afe('0x28')](function(_0x1925fd){_0x5a39fa[_0x9afe('0x21')]=_0x1925fd;if(_0xb229c1[_0x9afe('0x2f')][_0x9afe('0x3d')]){_0x23505c[_0x9afe('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x23505c);})['then'](function(_0xefef50){_0x5a39fa[_0x9afe('0x3f')]=_0xefef50;return _0x5a39fa;})[_0x9afe('0x28')](respondWithFilteredResult(_0x3a5e22,_0x23505c))['catch'](handleError(_0x3a5e22,null));};exports[_0x9afe('0x40')]=function(_0x4010d1,_0x35844e){var _0x10c2c6={'raw':!![],'where':{'id':_0x4010d1[_0x9afe('0x41')]['id']}},_0x1492c5={};_0x1492c5[_0x9afe('0x2e')]=_[_0x9afe('0x30')](db[_0x9afe('0x3c')][_0x9afe('0x42')]);_0x1492c5['query']=_[_0x9afe('0x30')](_0x4010d1[_0x9afe('0x2f')]);_0x1492c5[_0x9afe('0x31')]=_[_0x9afe('0x32')](_0x1492c5[_0x9afe('0x2e')],_0x1492c5[_0x9afe('0x2f')]);_0x10c2c6[_0x9afe('0x34')]=_[_0x9afe('0x32')](_0x1492c5[_0x9afe('0x2e')],qs[_0x9afe('0x33')](_0x4010d1[_0x9afe('0x2f')][_0x9afe('0x33')]));_0x10c2c6[_0x9afe('0x34')]=_0x10c2c6[_0x9afe('0x34')][_0x9afe('0x43')]?_0x10c2c6['attributes']:_0x1492c5[_0x9afe('0x2e')];if(_0x4010d1[_0x9afe('0x2f')][_0x9afe('0x3d')]){_0x10c2c6[_0x9afe('0x3e')]=[{'all':!![]}];}_0x10c2c6=_[_0x9afe('0x3a')]({},_0x10c2c6,_0x4010d1[_0x9afe('0x3b')]);return db[_0x9afe('0x3c')][_0x9afe('0x44')](_0x10c2c6)['then'](handleEntityNotFound(_0x35844e,null))[_0x9afe('0x28')](respondWithResult(_0x35844e,null))['catch'](handleError(_0x35844e,null));};exports[_0x9afe('0x45')]=function(_0x381628,_0x3e8d69){return db[_0x9afe('0x3c')][_0x9afe('0x45')](_0x381628['body'],{})['then'](respondWithResult(_0x3e8d69,0xc9))['catch'](handleError(_0x3e8d69,null));};exports[_0x9afe('0x26')]=function(_0x163af5,_0x484249){if(_0x163af5[_0x9afe('0x46')]['id']){delete _0x163af5[_0x9afe('0x46')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x163af5[_0x9afe('0x41')]['id']}})[_0x9afe('0x28')](handleEntityNotFound(_0x484249,null))[_0x9afe('0x28')](saveUpdates(_0x163af5['body'],null))['then'](respondWithResult(_0x484249,null))[_0x9afe('0x47')](handleError(_0x484249,null));};exports[_0x9afe('0x27')]=function(_0x1c8abe,_0x59240c){return db[_0x9afe('0x3c')]['find']({'where':{'id':_0x1c8abe['params']['id']}})[_0x9afe('0x28')](handleEntityNotFound(_0x59240c,null))[_0x9afe('0x28')](removeEntity(_0x59240c,null))[_0x9afe('0x47')](handleError(_0x59240c,null));}; \ No newline at end of file +var _0xca99=['path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xca99,0x129));var _0x9ca9=function(_0x119f1c,_0x34e245){_0x119f1c=_0x119f1c-0x0;var _0x5833e2=_0xca99[_0x119f1c];return _0x5833e2;};'use strict';var emlformat=require(_0x9ca9('0x0'));var rimraf=require(_0x9ca9('0x1'));var zipdir=require(_0x9ca9('0x2'));var jsonpatch=require(_0x9ca9('0x3'));var rp=require(_0x9ca9('0x4'));var moment=require(_0x9ca9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9ca9('0x6'));var util=require('util');var path=require(_0x9ca9('0x7'));var sox=require('sox');var csv=require(_0x9ca9('0x8'));var ejs=require(_0x9ca9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ca9('0xa'));var squel=require(_0x9ca9('0xb'));var crypto=require('crypto');var jsforce=require(_0x9ca9('0xc'));var deskjs=require(_0x9ca9('0xd'));var toCsv=require(_0x9ca9('0x8'));var querystring=require(_0x9ca9('0xe'));var Papa=require(_0x9ca9('0xf'));var Redis=require(_0x9ca9('0x10'));var authService=require(_0x9ca9('0x11'));var qs=require(_0x9ca9('0x12'));var as=require(_0x9ca9('0x13'));var hardwareService=require(_0x9ca9('0x14'));var logger=require(_0x9ca9('0x15'))('api');var utils=require(_0x9ca9('0x16'));var config=require(_0x9ca9('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599381,_0x21b0a8){_0x21b0a8=_0x21b0a8||0xcc;return function(_0x141a55){if(_0x141a55){return _0x599381[_0x9ca9('0x18')](_0x21b0a8);}return _0x599381[_0x9ca9('0x19')](_0x21b0a8)[_0x9ca9('0x1a')]();};}function respondWithResult(_0x80c56e,_0x4d649c){_0x4d649c=_0x4d649c||0xc8;return function(_0x2f8722){if(_0x2f8722){return _0x80c56e[_0x9ca9('0x19')](_0x4d649c)[_0x9ca9('0x1b')](_0x2f8722);}};}function respondWithFilteredResult(_0x812201,_0x422fe0){return function(_0x5bac2d){if(_0x5bac2d){var _0x57010c=typeof _0x422fe0['offset']==='undefined'&&typeof _0x422fe0[_0x9ca9('0x1c')]==='undefined';var _0x50b55f=_0x5bac2d['count'];var _0x205982=_0x57010c?0x0:_0x422fe0[_0x9ca9('0x1d')];var _0x28b686=_0x57010c?_0x5bac2d['count']:_0x422fe0[_0x9ca9('0x1d')]+_0x422fe0['limit'];var _0xc3a00e;if(_0x28b686>=_0x50b55f){_0x28b686=_0x50b55f;_0xc3a00e=0xc8;}else{_0xc3a00e=0xce;}_0x812201[_0x9ca9('0x19')](_0xc3a00e);return _0x812201[_0x9ca9('0x1e')](_0x9ca9('0x1f'),_0x205982+'-'+_0x28b686+'/'+_0x50b55f)[_0x9ca9('0x1b')](_0x5bac2d);}return null;};}function patchUpdates(_0x3788af){return function(_0x3b46e7){try{jsonpatch[_0x9ca9('0x20')](_0x3b46e7,_0x3788af,!![]);}catch(_0x432401){return BPromise[_0x9ca9('0x21')](_0x432401);}return _0x3b46e7[_0x9ca9('0x22')]();};}function saveUpdates(_0x69b0d6,_0x2e113c){return function(_0x46115d){if(_0x46115d){return _0x46115d[_0x9ca9('0x23')](_0x69b0d6)[_0x9ca9('0x24')](function(_0x43ddca){return _0x43ddca;});}return null;};}function removeEntity(_0x203a56,_0x256838){return function(_0x236d7b){if(_0x236d7b){return _0x236d7b[_0x9ca9('0x25')]()[_0x9ca9('0x24')](function(){_0x203a56[_0x9ca9('0x19')](0xcc)[_0x9ca9('0x1a')]();});}};}function handleEntityNotFound(_0x732d01,_0x27c658){return function(_0x3f03d1){if(!_0x3f03d1){_0x732d01[_0x9ca9('0x18')](0x194);}return _0x3f03d1;};}function handleError(_0x5c8f97,_0x2d1daa){_0x2d1daa=_0x2d1daa||0x1f4;return function(_0xe8f602){logger[_0x9ca9('0x26')](_0xe8f602[_0x9ca9('0x27')]);if(_0xe8f602['name']){delete _0xe8f602[_0x9ca9('0x28')];}_0x5c8f97[_0x9ca9('0x19')](_0x2d1daa)[_0x9ca9('0x29')](_0xe8f602);};}exports['index']=function(_0x3e7429,_0x1b5225){var _0x47d46a={},_0x439885={},_0x5b413e={'count':0x0,'rows':[]};var _0x17b414=_[_0x9ca9('0x2a')](db[_0x9ca9('0x2b')][_0x9ca9('0x2c')],function(_0x35399e){return{'name':_0x35399e[_0x9ca9('0x2d')],'type':_0x35399e[_0x9ca9('0x2e')][_0x9ca9('0x2f')]};});_0x439885[_0x9ca9('0x30')]=_[_0x9ca9('0x2a')](_0x17b414,_0x9ca9('0x28'));_0x439885[_0x9ca9('0x31')]=_[_0x9ca9('0x32')](_0x3e7429[_0x9ca9('0x31')]);_0x439885[_0x9ca9('0x33')]=_[_0x9ca9('0x34')](_0x439885[_0x9ca9('0x30')],_0x439885['query']);_0x47d46a[_0x9ca9('0x35')]=_[_0x9ca9('0x34')](_0x439885['model'],qs[_0x9ca9('0x36')](_0x3e7429[_0x9ca9('0x31')][_0x9ca9('0x36')]));_0x47d46a[_0x9ca9('0x35')]=_0x47d46a[_0x9ca9('0x35')][_0x9ca9('0x37')]?_0x47d46a[_0x9ca9('0x35')]:_0x439885[_0x9ca9('0x30')];if(!_0x3e7429[_0x9ca9('0x31')][_0x9ca9('0x38')](_0x9ca9('0x39'))){_0x47d46a[_0x9ca9('0x1c')]=qs[_0x9ca9('0x1c')](_0x3e7429['query'][_0x9ca9('0x1c')]);_0x47d46a[_0x9ca9('0x1d')]=qs[_0x9ca9('0x1d')](_0x3e7429[_0x9ca9('0x31')][_0x9ca9('0x1d')]);}_0x47d46a[_0x9ca9('0x3a')]=qs[_0x9ca9('0x3b')](_0x3e7429[_0x9ca9('0x31')][_0x9ca9('0x3b')]);_0x47d46a[_0x9ca9('0x3c')]=qs['filters'](_[_0x9ca9('0x3d')](_0x3e7429[_0x9ca9('0x31')],_0x439885[_0x9ca9('0x33')]),_0x17b414);if(_0x3e7429[_0x9ca9('0x31')]['filter']){_0x47d46a[_0x9ca9('0x3c')]=_[_0x9ca9('0x3e')](_0x47d46a[_0x9ca9('0x3c')],{'$or':_[_0x9ca9('0x2a')](_0x17b414,function(_0x3ee031){if(_0x3ee031['type']!==_0x9ca9('0x3f')){var _0xa390d8={};_0xa390d8[_0x3ee031[_0x9ca9('0x28')]]={'$like':'%'+_0x3e7429['query'][_0x9ca9('0x40')]+'%'};return _0xa390d8;}})});}_0x47d46a=_[_0x9ca9('0x3e')]({},_0x47d46a,_0x3e7429[_0x9ca9('0x41')]);var _0x18e5a8={'where':_0x47d46a[_0x9ca9('0x3c')]};return db[_0x9ca9('0x2b')]['count'](_0x18e5a8)[_0x9ca9('0x24')](function(_0x1f4ded){_0x5b413e[_0x9ca9('0x42')]=_0x1f4ded;if(_0x3e7429[_0x9ca9('0x31')][_0x9ca9('0x43')]){_0x47d46a[_0x9ca9('0x44')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x47d46a);})[_0x9ca9('0x24')](function(_0x411c08){_0x5b413e[_0x9ca9('0x45')]=_0x411c08;return _0x5b413e;})[_0x9ca9('0x24')](respondWithFilteredResult(_0x1b5225,_0x47d46a))[_0x9ca9('0x46')](handleError(_0x1b5225,null));};exports[_0x9ca9('0x47')]=function(_0x17d1c0,_0x2249fb){var _0x5766e5={'raw':!![],'where':{'id':_0x17d1c0[_0x9ca9('0x48')]['id']}},_0x52684c={};_0x52684c[_0x9ca9('0x30')]=_[_0x9ca9('0x32')](db[_0x9ca9('0x2b')]['rawAttributes']);_0x52684c[_0x9ca9('0x31')]=_[_0x9ca9('0x32')](_0x17d1c0[_0x9ca9('0x31')]);_0x52684c['filters']=_['intersection'](_0x52684c[_0x9ca9('0x30')],_0x52684c[_0x9ca9('0x31')]);_0x5766e5[_0x9ca9('0x35')]=_[_0x9ca9('0x34')](_0x52684c[_0x9ca9('0x30')],qs[_0x9ca9('0x36')](_0x17d1c0['query'][_0x9ca9('0x36')]));_0x5766e5[_0x9ca9('0x35')]=_0x5766e5[_0x9ca9('0x35')][_0x9ca9('0x37')]?_0x5766e5['attributes']:_0x52684c[_0x9ca9('0x30')];if(_0x17d1c0[_0x9ca9('0x31')][_0x9ca9('0x43')]){_0x5766e5[_0x9ca9('0x44')]=[{'all':!![]}];}_0x5766e5=_[_0x9ca9('0x3e')]({},_0x5766e5,_0x17d1c0[_0x9ca9('0x41')]);return db[_0x9ca9('0x2b')][_0x9ca9('0x49')](_0x5766e5)['then'](handleEntityNotFound(_0x2249fb,null))[_0x9ca9('0x24')](respondWithResult(_0x2249fb,null))['catch'](handleError(_0x2249fb,null));};exports[_0x9ca9('0x4a')]=function(_0x573811,_0x2d8cb0){return db['VoiceQueuesLog'][_0x9ca9('0x4a')](_0x573811[_0x9ca9('0x4b')],{})[_0x9ca9('0x24')](respondWithResult(_0x2d8cb0,0xc9))[_0x9ca9('0x46')](handleError(_0x2d8cb0,null));};exports[_0x9ca9('0x23')]=function(_0x4ddbe2,_0x4dbc3f){if(_0x4ddbe2['body']['id']){delete _0x4ddbe2[_0x9ca9('0x4b')]['id'];}return db[_0x9ca9('0x2b')][_0x9ca9('0x49')]({'where':{'id':_0x4ddbe2[_0x9ca9('0x48')]['id']}})[_0x9ca9('0x24')](handleEntityNotFound(_0x4dbc3f,null))[_0x9ca9('0x24')](saveUpdates(_0x4ddbe2[_0x9ca9('0x4b')],null))[_0x9ca9('0x24')](respondWithResult(_0x4dbc3f,null))[_0x9ca9('0x46')](handleError(_0x4dbc3f,null));};exports[_0x9ca9('0x25')]=function(_0x3c55ba,_0x567119){return db[_0x9ca9('0x2b')][_0x9ca9('0x49')]({'where':{'id':_0x3c55ba[_0x9ca9('0x48')]['id']}})[_0x9ca9('0x24')](handleEntityNotFound(_0x567119,null))[_0x9ca9('0x24')](removeEntity(_0x567119,null))[_0x9ca9('0x46')](handleError(_0x567119,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 45fff8d..a8b1926 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 _0x8c04=['moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8c04,0x155));var _0x48c0=function(_0x120647,_0x5ab0d0){_0x120647=_0x120647-0x0;var _0x3f7cba=_0x8c04[_0x120647];return _0x3f7cba;};'use strict';var _=require(_0x48c0('0x0'));var util=require(_0x48c0('0x1'));var logger=require(_0x48c0('0x2'))(_0x48c0('0x3'));var moment=require(_0x48c0('0x4'));var BPromise=require('bluebird');var rp=require(_0x48c0('0x5'));var fs=require('fs');var path=require(_0x48c0('0x6'));var rimraf=require(_0x48c0('0x7'));var config=require(_0x48c0('0x8'));var attributes=require(_0x48c0('0x9'));module[_0x48c0('0xa')]=function(_0x276104,_0x4ebf37){return _0x276104['define'](_0x48c0('0xb'),attributes,{'tableName':_0x48c0('0xc'),'paranoid':![],'indexes':[{'name':_0x48c0('0xd'),'fields':[_0x48c0('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x7a2c=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','voice_queues_log','event_dtm','event'];(function(_0xe1dfdf,_0xf1f9a2){var _0x5e1564=function(_0x966e74){while(--_0x966e74){_0xe1dfdf['push'](_0xe1dfdf['shift']());}};_0x5e1564(++_0xf1f9a2);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x62d2b9,_0x1b3637){_0x62d2b9=_0x62d2b9-0x0;var _0x24378d=_0x7a2c[_0x62d2b9];return _0x24378d;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('VoiceQueuesLog',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[{'name':_0xc7a2('0xb'),'fields':[_0xc7a2('0xc'),_0xc7a2('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index db70df2..b4674a4 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 _0x75be=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','debug'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x75be,0x197));var _0xe75b=function(_0x19eb59,_0x247591){_0x19eb59=_0x19eb59-0x0;var _0x3a34fb=_0x75be[_0x19eb59];return _0x3a34fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe75b('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe75b('0x1'));var db=require(_0xe75b('0x2'))['db'];var utils=require(_0xe75b('0x3'));var logger=require(_0xe75b('0x4'))(_0xe75b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe75b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c5e6b,_0x2cad34,_0x2cff18){return new BPromise(function(_0x3ba8e0,_0x68b45c){return client[_0xe75b('0x7')](_0x2c5e6b,_0x2cff18)[_0xe75b('0x8')](function(_0x28566b){logger[_0xe75b('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2cad34,'request\x20sent');logger[_0xe75b('0xa')](_0xe75b('0xb'),_0x2cad34,_0xe75b('0xc'),JSON[_0xe75b('0xd')](_0x28566b));if(_0x28566b[_0xe75b('0xe')]){if(_0x28566b[_0xe75b('0xe')][_0xe75b('0xf')]===0x1f4){logger[_0xe75b('0xe')](_0xe75b('0x10'),_0x2cad34,_0x28566b[_0xe75b('0xe')]['message']);return _0x68b45c(_0x28566b[_0xe75b('0xe')][_0xe75b('0x11')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2cad34,_0x28566b['error'][_0xe75b('0x11')]);return _0x3ba8e0(_0x28566b[_0xe75b('0xe')]['message']);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x2cad34,_0xe75b('0xc'));_0x3ba8e0(_0x28566b[_0xe75b('0x12')][_0xe75b('0x11')]);}})['catch'](function(_0x287ca3){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2cad34,_0x287ca3);_0x68b45c(_0x287ca3);});});} \ No newline at end of file +var _0xa1f1=['client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dd2f5,_0x307e1e){var _0x1d9c4c=function(_0x161d28){while(--_0x161d28){_0x2dd2f5['push'](_0x2dd2f5['shift']());}};_0x1d9c4c(++_0x307e1e);}(_0xa1f1,0x7b));var _0x1a1f=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0xa1f1[_0x4429e0];return _0x51a5b3;};'use strict';var _=require('lodash');var util=require(_0x1a1f('0x0'));var moment=require(_0x1a1f('0x1'));var BPromise=require(_0x1a1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a1f('0x3'))['db'];var utils=require(_0x1a1f('0x4'));var logger=require(_0x1a1f('0x5'))(_0x1a1f('0x6'));var config=require(_0x1a1f('0x7'));var jayson=require(_0x1a1f('0x8'));var client=jayson[_0x1a1f('0x9')][_0x1a1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x187398,_0x3ec84e,_0x536442){return new BPromise(function(_0x1e608b,_0x8ecdd3){return client[_0x1a1f('0xb')](_0x187398,_0x536442)['then'](function(_0x42c485){logger[_0x1a1f('0xc')](_0x1a1f('0xd'),_0x3ec84e,_0x1a1f('0xe'));logger['debug'](_0x1a1f('0xf'),_0x3ec84e,_0x1a1f('0xe'),JSON[_0x1a1f('0x10')](_0x42c485));if(_0x42c485[_0x1a1f('0x11')]){if(_0x42c485[_0x1a1f('0x11')][_0x1a1f('0x12')]===0x1f4){logger[_0x1a1f('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3ec84e,_0x42c485[_0x1a1f('0x11')][_0x1a1f('0x13')]);return _0x8ecdd3(_0x42c485[_0x1a1f('0x11')][_0x1a1f('0x13')]);}logger[_0x1a1f('0x11')](_0x1a1f('0xd'),_0x3ec84e,_0x42c485[_0x1a1f('0x11')][_0x1a1f('0x13')]);return _0x1e608b(_0x42c485[_0x1a1f('0x11')][_0x1a1f('0x13')]);}else{logger['info'](_0x1a1f('0xd'),_0x3ec84e,_0x1a1f('0xe'));_0x1e608b(_0x42c485[_0x1a1f('0x14')][_0x1a1f('0x13')]);}})[_0x1a1f('0x15')](function(_0x1f878d){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x3ec84e,_0x1f878d);_0x8ecdd3(_0x1f878d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 74b937b..8e0b46e 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 _0x5dc3=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1408b4,_0x22e866){var _0x39276b=function(_0x5d7918){while(--_0x5d7918){_0x1408b4['push'](_0x1408b4['shift']());}};_0x39276b(++_0x22e866);}(_0x5dc3,0xf3));var _0x35dc=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x5dc3[_0x2f6f50];return _0x2cf365;};'use strict';var multer=require(_0x35dc('0x0'));var util=require(_0x35dc('0x1'));var path=require(_0x35dc('0x2'));var timeout=require(_0x35dc('0x3'));var express=require('express');var router=express[_0x35dc('0x4')]();var fs_extra=require(_0x35dc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x35dc('0x6'));var config=require(_0x35dc('0x7'));var controller=require(_0x35dc('0x8'));router[_0x35dc('0x9')]('/',auth[_0x35dc('0xa')](),controller[_0x35dc('0xb')]);router[_0x35dc('0x9')](_0x35dc('0xc'),auth[_0x35dc('0xa')](),controller[_0x35dc('0xd')]);router[_0x35dc('0x9')](_0x35dc('0xe'),auth[_0x35dc('0xa')](),controller['show']);router['get']('/:id/download',auth[_0x35dc('0xa')](),controller[_0x35dc('0xf')]);router[_0x35dc('0x9')](_0x35dc('0x10'),controller[_0x35dc('0x11')]);router[_0x35dc('0x9')](_0x35dc('0x12'),auth['isAuthenticated'](),controller[_0x35dc('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x35dc('0x14')]);router['post']('/:id/transcribe',auth[_0x35dc('0xa')](),controller[_0x35dc('0x15')]);router['put']('/:id',auth[_0x35dc('0xa')](),controller['update']);router[_0x35dc('0x16')](_0x35dc('0xe'),auth[_0x35dc('0xa')](),controller[_0x35dc('0x17')]);module[_0x35dc('0x18')]=router; \ No newline at end of file +var _0xb6ab=['isAuthenticated','index','get','describe','/:id','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ab33b,_0x22036b){var _0x3aa539=function(_0x2397b4){while(--_0x2397b4){_0x1ab33b['push'](_0x1ab33b['shift']());}};_0x3aa539(++_0x22036b);}(_0xb6ab,0xf6));var _0xbb6a=function(_0x2ac911,_0x4aceed){_0x2ac911=_0x2ac911-0x0;var _0x313702=_0xb6ab[_0x2ac911];return _0x313702;};'use strict';var multer=require(_0xbb6a('0x0'));var util=require(_0xbb6a('0x1'));var path=require('path');var timeout=require(_0xbb6a('0x2'));var express=require(_0xbb6a('0x3'));var router=express[_0xbb6a('0x4')]();var fs_extra=require(_0xbb6a('0x5'));var auth=require(_0xbb6a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth[_0xbb6a('0x7')](),controller[_0xbb6a('0x8')]);router[_0xbb6a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xbb6a('0xa')]);router[_0xbb6a('0x9')](_0xbb6a('0xb'),auth['isAuthenticated'](),controller[_0xbb6a('0xc')]);router['get']('/:id/download',auth[_0xbb6a('0x7')](),controller[_0xbb6a('0xd')]);router[_0xbb6a('0x9')](_0xbb6a('0xe'),controller['downloads']);router[_0xbb6a('0x9')](_0xbb6a('0xf'),auth[_0xbb6a('0x7')](),controller[_0xbb6a('0x10')]);router[_0xbb6a('0x11')]('/',auth[_0xbb6a('0x7')](),controller[_0xbb6a('0x12')]);router[_0xbb6a('0x11')](_0xbb6a('0xf'),auth['isAuthenticated'](),controller[_0xbb6a('0x13')]);router[_0xbb6a('0x14')](_0xbb6a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbb6a('0x15')](_0xbb6a('0xb'),auth[_0xbb6a('0x7')](),controller['destroy']);module[_0xbb6a('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index df2ce57..7f942dd 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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 55f8732..29b8967 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 _0x7192=['sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','describe','../../components/encryptor','find','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','TranscribeService','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','aws-sdk','../../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','update','then','destroy','error','stack','name','index','VoiceRecording','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x576c2c,_0x1a29e3){var _0x120751=function(_0x19cd7c){while(--_0x19cd7c){_0x576c2c['push'](_0x576c2c['shift']());}};_0x120751(++_0x1a29e3);}(_0x7192,0x183));var _0x2719=function(_0x3998ef,_0x5baf23){_0x3998ef=_0x3998ef-0x0;var _0x3f2586=_0x7192[_0x3998ef];return _0x3f2586;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2719('0x0'));var zipdir=require(_0x2719('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2719('0x2'));var moment=require(_0x2719('0x3'));var BPromise=require(_0x2719('0x4'));var Mustache=require(_0x2719('0x5'));var util=require(_0x2719('0x6'));var path=require(_0x2719('0x7'));var sox=require(_0x2719('0x8'));var csv=require(_0x2719('0x9'));var ejs=require(_0x2719('0xa'));var fs=require('fs');var fs_extra=require(_0x2719('0xb'));var _=require(_0x2719('0xc'));var squel=require(_0x2719('0xd'));var crypto=require(_0x2719('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2719('0x9'));var querystring=require('querystring');var Papa=require(_0x2719('0xf'));var AWS=require(_0x2719('0x10'));var uuidv4=require('uuid/v4');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(_0x2719('0x11'));var logger=require(_0x2719('0x12'))(_0x2719('0x13'));var utils=require(_0x2719('0x14'));var config=require(_0x2719('0x15'));var licenseUtil=require(_0x2719('0x16'));var db=require(_0x2719('0x17'))['db'];function respondWithStatusCode(_0x5cc3ef,_0x573a06){_0x573a06=_0x573a06||0xcc;return function(_0x59dc4e){if(_0x59dc4e){return _0x5cc3ef[_0x2719('0x18')](_0x573a06);}return _0x5cc3ef[_0x2719('0x19')](_0x573a06)[_0x2719('0x1a')]();};}function respondWithResult(_0x5523a2,_0x2f388e){_0x2f388e=_0x2f388e||0xc8;return function(_0x1f6e4e){if(_0x1f6e4e){return _0x5523a2['status'](_0x2f388e)[_0x2719('0x1b')](_0x1f6e4e);}};}function respondWithFilteredResult(_0x52c34,_0x2596df){return function(_0x99e26b){if(_0x99e26b){var _0x55d3d0=typeof _0x2596df[_0x2719('0x1c')]===_0x2719('0x1d')&&typeof _0x2596df['limit']==='undefined';var _0x2d9291=_0x99e26b[_0x2719('0x1e')];var _0x383d2e=_0x55d3d0?0x0:_0x2596df['offset'];var _0xd9418a=_0x55d3d0?_0x99e26b['count']:_0x2596df['offset']+_0x2596df[_0x2719('0x1f')];var _0x2c3c1c;if(_0xd9418a>=_0x2d9291){_0xd9418a=_0x2d9291;_0x2c3c1c=0xc8;}else{_0x2c3c1c=0xce;}_0x52c34[_0x2719('0x19')](_0x2c3c1c);return _0x52c34[_0x2719('0x20')](_0x2719('0x21'),_0x383d2e+'-'+_0xd9418a+'/'+_0x2d9291)[_0x2719('0x1b')](_0x99e26b);}return null;};}function patchUpdates(_0x5126d3){return function(_0x15d3dd){try{jsonpatch[_0x2719('0x22')](_0x15d3dd,_0x5126d3,!![]);}catch(_0x2924a9){return BPromise['reject'](_0x2924a9);}return _0x15d3dd['save']();};}function saveUpdates(_0xff7b37,_0x55628e){return function(_0x4aaad8){if(_0x4aaad8){return _0x4aaad8[_0x2719('0x23')](_0xff7b37)[_0x2719('0x24')](function(_0xbceb84){return _0xbceb84;});}return null;};}function removeEntity(_0x22d671,_0x2f8d1e){return function(_0x486980){if(_0x486980){return _0x486980[_0x2719('0x25')]()[_0x2719('0x24')](function(){_0x22d671[_0x2719('0x19')](0xcc)[_0x2719('0x1a')]();});}};}function handleEntityNotFound(_0x25f8be,_0xbe26df){return function(_0x235747){if(!_0x235747){_0x25f8be['sendStatus'](0x194);}return _0x235747;};}function handleError(_0x2084a8,_0x4ca1ae){_0x4ca1ae=_0x4ca1ae||0x1f4;return function(_0x3947a7){logger[_0x2719('0x26')](_0x3947a7[_0x2719('0x27')]);if(_0x3947a7[_0x2719('0x28')]){delete _0x3947a7[_0x2719('0x28')];}_0x2084a8[_0x2719('0x19')](_0x4ca1ae)['send'](_0x3947a7);};}exports[_0x2719('0x29')]=function(_0x4c2cdb,_0x304c19){var _0x2126ea={},_0x5adcbd={},_0x38a6df={'count':0x0,'rows':[]};var _0x4a0262=_['map'](db[_0x2719('0x2a')][_0x2719('0x2b')],function(_0x189891){return{'name':_0x189891[_0x2719('0x2c')],'type':_0x189891[_0x2719('0x2d')]['key']};});_0x5adcbd[_0x2719('0x2e')]=_['differenceBy'](_[_0x2719('0x2f')](_0x4a0262,_0x2719('0x28')),['format']);_0x5adcbd['query']=_['keys'](_0x4c2cdb[_0x2719('0x30')]);_0x5adcbd['filters']=_[_0x2719('0x31')](_0x5adcbd['model'],_0x5adcbd[_0x2719('0x30')]);_0x2126ea[_0x2719('0x32')]=_[_0x2719('0x31')](_0x5adcbd[_0x2719('0x2e')],qs[_0x2719('0x33')](_0x4c2cdb[_0x2719('0x30')][_0x2719('0x33')]));_0x2126ea[_0x2719('0x32')]=_0x2126ea['attributes']['length']?_0x2126ea[_0x2719('0x32')]:_0x5adcbd[_0x2719('0x2e')];if(!_0x4c2cdb[_0x2719('0x30')][_0x2719('0x34')](_0x2719('0x35'))){_0x2126ea[_0x2719('0x1f')]=qs['limit'](_0x4c2cdb[_0x2719('0x30')][_0x2719('0x1f')]);_0x2126ea['offset']=qs[_0x2719('0x1c')](_0x4c2cdb[_0x2719('0x30')][_0x2719('0x1c')]);}_0x2126ea['order']=qs['sort'](_0x4c2cdb['query'][_0x2719('0x36')]);_0x2126ea[_0x2719('0x37')]=qs['filters'](_['pick'](_0x4c2cdb['query'],_0x5adcbd[_0x2719('0x38')]),_0x4a0262);if(_0x4c2cdb[_0x2719('0x30')][_0x2719('0x39')]){_0x2126ea[_0x2719('0x37')]=_[_0x2719('0x3a')](_0x2126ea[_0x2719('0x37')],{'$or':_['map'](_0x4a0262,function(_0x4e7bf8){if(_0x4e7bf8['type']!==_0x2719('0x3b')){var _0x491cae={};_0x491cae[_0x4e7bf8[_0x2719('0x28')]]={'$like':'%'+_0x4c2cdb[_0x2719('0x30')][_0x2719('0x39')]+'%'};return _0x491cae;}})});}_0x2126ea=_[_0x2719('0x3a')]({},_0x2126ea,_0x4c2cdb[_0x2719('0x3c')]);var _0x5e6f8c={'where':_0x2126ea[_0x2719('0x37')]};return db[_0x2719('0x2a')][_0x2719('0x1e')](_0x5e6f8c)[_0x2719('0x24')](function(_0x38796d){_0x38a6df['count']=_0x38796d;if(_0x4c2cdb['query'][_0x2719('0x3d')]){_0x2126ea[_0x2719('0x3e')]=[{'all':!![]}];}return db[_0x2719('0x2a')][_0x2719('0x3f')](_0x2126ea);})['then'](function(_0x326423){_0x38a6df[_0x2719('0x40')]=_0x326423;return _0x38a6df;})[_0x2719('0x24')](respondWithFilteredResult(_0x304c19,_0x2126ea))[_0x2719('0x41')](handleError(_0x304c19,null));};exports['show']=function(_0x130119,_0x139fa8){var _0x3a63de={'raw':![],'where':{'id':_0x130119[_0x2719('0x42')]['id']}},_0x5a5c12={};_0x5a5c12[_0x2719('0x2e')]=_['keys'](db[_0x2719('0x2a')][_0x2719('0x2b')]);_0x5a5c12[_0x2719('0x30')]=_[_0x2719('0x43')](_0x130119['query']);_0x5a5c12['filters']=_[_0x2719('0x31')](_0x5a5c12[_0x2719('0x2e')],_0x5a5c12[_0x2719('0x30')]);_0x3a63de[_0x2719('0x32')]=_[_0x2719('0x31')](_0x5a5c12[_0x2719('0x2e')],qs[_0x2719('0x33')](_0x130119[_0x2719('0x30')][_0x2719('0x33')]));_0x3a63de[_0x2719('0x32')]=_0x3a63de['attributes']['length']?_0x3a63de[_0x2719('0x32')]:_0x5a5c12[_0x2719('0x2e')];if(_0x130119[_0x2719('0x30')][_0x2719('0x3d')]){_0x3a63de[_0x2719('0x3e')]=[{'all':!![]}];}_0x3a63de=_[_0x2719('0x3a')]({},_0x3a63de,_0x130119[_0x2719('0x3c')]);return db[_0x2719('0x2a')]['find'](_0x3a63de)['then'](handleEntityNotFound(_0x139fa8,null))[_0x2719('0x24')](respondWithResult(_0x139fa8,null))[_0x2719('0x41')](handleError(_0x139fa8,null));};exports[_0x2719('0x44')]=function(_0x3128be,_0x5c5d2d){return db[_0x2719('0x2a')][_0x2719('0x44')](_0x3128be[_0x2719('0x45')],{})[_0x2719('0x24')](respondWithResult(_0x5c5d2d,0xc9))['catch'](handleError(_0x5c5d2d,null));};exports[_0x2719('0x23')]=function(_0x256162,_0x38dbbc){if(_0x256162['body']['id']){delete _0x256162[_0x2719('0x45')]['id'];}return db[_0x2719('0x2a')]['find']({'where':{'id':_0x256162[_0x2719('0x42')]['id']}})[_0x2719('0x24')](handleEntityNotFound(_0x38dbbc,null))[_0x2719('0x24')](saveUpdates(_0x256162[_0x2719('0x45')],null))[_0x2719('0x24')](respondWithResult(_0x38dbbc,null))[_0x2719('0x41')](handleError(_0x38dbbc,null));};exports[_0x2719('0x46')]=function(_0x388f0f,_0x3fbff6){return db[_0x2719('0x2a')][_0x2719('0x46')]()[_0x2719('0x24')](respondWithResult(_0x3fbff6,null))[_0x2719('0x41')](handleError(_0x3fbff6,null));};exports['download']=function(_0x4228eb,_0x12a55f,_0x12e81b){var _0x48274e=require(_0x2719('0x47'));var _0x531c=![];var _0x5b8659={};if(_0x4228eb[_0x2719('0x30')]['type']&&_0x4228eb['query'][_0x2719('0x2d')]==='uniqueid'){_0x5b8659['uniqueid']=_0x4228eb['params']['id'];}else{_0x5b8659['id']=_0x4228eb[_0x2719('0x42')]['id'];}return db['VoiceRecording'][_0x2719('0x48')]({'where':_0x5b8659,'attributes':['id',_0x2719('0x49')],'raw':!![]})[_0x2719('0x24')](handleEntityNotFound(_0x12a55f,null))[_0x2719('0x24')](function(_0x2b19e6){if(_0x2b19e6){var _0x29de0f=_0x2b19e6['value'];var _0x533aa9=util[_0x2719('0x4a')](_0x2719('0x4b'),_0x29de0f);if(fs[_0x2719('0x4c')](_0x533aa9)){_0x531c=!![];return _0x48274e[_0x2719('0x4d')](_0x533aa9,_0x29de0f,config[_0x2719('0x4e')][_0x2719('0x4f')])['then'](function(){return _0x2b19e6;});}return _0x2b19e6;}})[_0x2719('0x24')](function(_0x582de6){if(_0x582de6){var _0x1e4e50=_0x582de6[_0x2719('0x49')];if(!fs[_0x2719('0x4c')](_0x1e4e50)){throw new db[(_0x2719('0x50'))][(_0x2719('0x51'))](_0x2719('0x52'));}if(_0x582de6['filename']){return _0x12a55f[_0x2719('0x53')](_0x1e4e50,_0x582de6[_0x2719('0x54')]+path[_0x2719('0x55')](_0x1e4e50),function(){if(_0x531c){fs[_0x2719('0x56')](_0x1e4e50);}});}else{return _0x12a55f['download'](_0x1e4e50,function(_0xfad1fb){if(_0x531c){fs[_0x2719('0x56')](_0x1e4e50);}});}}})[_0x2719('0x41')](function(_0x247326){if(_0x247326[_0x2719('0x57')]===_0x2719('0x52')){_0x12a55f[_0x2719('0x19')](0x194)['send'](_0x2719('0x58'));}else{return handleError(_0x12a55f,null);}});};exports[_0x2719('0x59')]=function(_0x5cb0b6,_0x4523a5,_0x49b7ec){var _0x4fafa3=require('../../components/encryptor');var _0x3c96f9=![];var _0x226268={'$and':[db[_0x2719('0x5a')][_0x2719('0x37')](db['sequelize']['fn']('MD5',db[_0x2719('0x5a')][_0x2719('0x5b')]('uniqueid')),_0x5cb0b6[_0x2719('0x30')][_0x2719('0x5c')])]};if(_0x5cb0b6[_0x2719('0x30')]['type']&&_0x5cb0b6[_0x2719('0x30')]['type']==='uniqueid'){_0x226268[_0x2719('0x5d')][_0x2719('0x5e')]({'uniqueid':_0x5cb0b6[_0x2719('0x42')]['id']});}else{_0x226268[_0x2719('0x5d')][_0x2719('0x5e')]({'id':_0x5cb0b6[_0x2719('0x42')]['id']});}return db[_0x2719('0x2a')][_0x2719('0x48')]({'where':_0x226268,'attributes':['id',_0x2719('0x49')],'raw':!![]})[_0x2719('0x24')](handleEntityNotFound(_0x4523a5,null))[_0x2719('0x24')](function(_0x33d18f){if(_0x33d18f){var _0x335ba2=util['format'](_0x2719('0x4b'),_0x33d18f[_0x2719('0x49')]);if(fs[_0x2719('0x4c')](_0x335ba2)){_0x3c96f9=!![];return _0x4fafa3[_0x2719('0x4d')](_0x335ba2,_0x33d18f['value'],config[_0x2719('0x4e')]['recording'])[_0x2719('0x24')](function(){return _0x33d18f;});}return _0x33d18f;}})[_0x2719('0x24')](function(_0x389fba){if(_0x389fba){if(!fs[_0x2719('0x4c')](_0x389fba[_0x2719('0x49')])){throw new db[(_0x2719('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x389fba['filename']){return _0x4523a5[_0x2719('0x53')](_0x389fba[_0x2719('0x49')],_0x389fba[_0x2719('0x54')]+path[_0x2719('0x55')](_0x389fba[_0x2719('0x49')]),function(){if(_0x3c96f9){fs[_0x2719('0x56')](_0x389fba[_0x2719('0x49')]);}});}else{return _0x4523a5[_0x2719('0x53')](_0x389fba[_0x2719('0x49')],function(_0xf0d904){if(_0x3c96f9){fs[_0x2719('0x56')](_0x389fba[_0x2719('0x49')]);}});}}})[_0x2719('0x41')](handleError(_0x4523a5,null));};exports[_0x2719('0x25')]=function(_0x57fca6,_0x4934bc){return db['VoiceRecording'][_0x2719('0x48')]({'where':{'id':_0x57fca6[_0x2719('0x42')]['id']}})['then'](function(_0x2dca67){if(_[_0x2719('0x5f')](_0x2dca67)){throw new ReferenceError(_0x2719('0x60'));}return _0x2dca67;})[_0x2719('0x24')](function(_0x5d8cfa){var _0x550d7a=_0x5d8cfa[_0x2719('0x49')];logger[_0x2719('0x61')]('cancellazione\x20fisica\x20documento\x20%s',_0x550d7a);if(!_[_0x2719('0x5f')](_0x5d8cfa[_0x2719('0x49')])&&fs[_0x2719('0x4c')](_0x550d7a)){logger[_0x2719('0x61')](_0x2719('0x62')+_0x550d7a+_0x2719('0x63'));fs['unlinkSync'](_0x550d7a);}_0x550d7a=_0x550d7a+_0x2719('0x64');if(!_['isNil'](_0x5d8cfa[_0x2719('0x49')])&&fs[_0x2719('0x4c')](_0x550d7a)){logger['info'](_0x2719('0x62')+_0x550d7a+_0x2719('0x63'));fs['unlinkSync'](_0x550d7a);}return _0x5d8cfa;})[_0x2719('0x24')](function(_0x3790bc){if(!_0x3790bc)throw new InternalError();return _0x3790bc['destroy']();})['then'](function(){_0x4934bc[_0x2719('0x19')](0xcc)[_0x2719('0x1a')]();})[_0x2719('0x41')](handleError(_0x4934bc,null));};function getBucketslist(_0x4b4441,_0x21ded6,_0x43a27d){return new Promise(function(_0x1cf7a6,_0x37c36a){var _0x243fb6=new AWS['S3']({'accessKeyId':_0x21ded6,'secretAccessKey':_0x4b4441,'region':_0x43a27d});_0x243fb6[_0x2719('0x65')]({},function(_0x58530b,_0x3a1495){if(_0x58530b){return _0x37c36a(_0x58530b);}else{return _0x1cf7a6(_0x3a1495);}});});}function createBucket(_0xb5397b,_0x573c7b,_0xb58db0,_0x4f3ea3){return new Promise(function(_0x336d7c,_0x55d3de){var _0x3cdbf0=new AWS['S3']({'accessKeyId':_0x573c7b,'secretAccessKey':_0xb5397b,'region':_0xb58db0});_0x3cdbf0[_0x2719('0x66')]({'Bucket':_0x4f3ea3},function(_0x26b406,_0x44ae06){if(_0x26b406){return _0x55d3de(_0x26b406);}else{return _0x336d7c(_0x44ae06);}});});}function uploadFile(_0x5e2178,_0xe1b099,_0xbc16ea,_0x48af61,_0x51f217,_0x111349){return new Promise(function(_0x5a4329,_0x1bce64){var _0x203804=new AWS['S3']({'accessKeyId':_0xe1b099,'secretAccessKey':_0x5e2178,'region':_0xbc16ea});_0x203804[_0x2719('0x67')]({'Bucket':_0x48af61,'Key':_0x51f217,'Body':_0x111349},function(_0x42a589,_0x4ca414){if(_0x42a589){return _0x1bce64(_0x42a589);}else{return _0x5a4329(_0x4ca414);}});});}function startTranscribe(_0x523be8,_0xf2bc6f,_0x542def,_0x81fe20,_0x59de25,_0x2ef887){return new Promise(function(_0x5bb2e7,_0xc97824){var _0x6eeead=new AWS[(_0x2719('0x68'))]({'accessKeyId':_0xf2bc6f,'secretAccessKey':_0x523be8,'region':_0x542def});_0x6eeead['startTranscriptionJob']({'TranscriptionJobName':_0x81fe20,'LanguageCode':_0x59de25,'Media':{'MediaFileUri':_0x2ef887}},function(_0x4514c9,_0x59473d){if(_0x4514c9){return _0xc97824(_0x4514c9);}else{return _0x5bb2e7(_0x59473d);}});});}function transcribe(_0x54af1a,_0x25ba97,_0x5e2266,_0x2bb7bd,_0x145641,_0xb576f0,_0x22cbef){return new Promise(function(_0x36769c,_0x367336){var _0x216631={};logger[_0x2719('0x61')](util[_0x2719('0x4a')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x54af1a,_0x145641));return uploadFile(_0x25ba97,_0x5e2266,_0x2bb7bd,_0x145641,path[_0x2719('0x69')](_0xb576f0),fs[_0x2719('0x6a')](_0xb576f0))[_0x2719('0x24')](function(_0x1e6d7f){logger[_0x2719('0x61')](util['format'](_0x2719('0x6b'),_0x54af1a,_0x145641,_0x1e6d7f[_0x2719('0x6c')]));_0x216631['bucket']=_0x1e6d7f[_0x2719('0x6d')];_0x216631[_0x2719('0x6e')]=_0x1e6d7f[_0x2719('0x6c')];logger[_0x2719('0x61')](util[_0x2719('0x4a')](_0x2719('0x6f'),_0x54af1a));return startTranscribe(_0x25ba97,_0x5e2266,_0x2bb7bd,uuidv4(),_0x22cbef,_0x1e6d7f[_0x2719('0x6c')]);})['then'](function(_0xb5326e){logger[_0x2719('0x61')](util[_0x2719('0x4a')](_0x2719('0x70'),_0x54af1a,_0xb5326e[_0x2719('0x71')][_0x2719('0x72')]));_0x216631[_0x2719('0x73')]=_0xb5326e[_0x2719('0x71')][_0x2719('0x72')];_0x216631['transcribeStatus']=_0xb5326e[_0x2719('0x71')]['TranscriptionJobStatus'];return _0x36769c(_0x216631);})[_0x2719('0x41')](function(_0x15d5ea){return _0x367336(_0x15d5ea);});});}exports[_0x2719('0x74')]=function(_0x6b5de6,_0x342074,_0x64e6d0){var _0x2e1984;var _0x558667;var _0x4d3d63;var _0x47177e=require(_0x2719('0x47'));return db[_0x2719('0x2a')][_0x2719('0x75')]({'where':{'id':_0x6b5de6[_0x2719('0x42')]['id']}})[_0x2719('0x24')](function(_0x259755){if(_0x259755){var _0x554aeb=util[_0x2719('0x4a')]('%s.cypher',_0x259755[_0x2719('0x49')]);if(fs['existsSync'](_0x554aeb)){cypher=!![];return _0x47177e['decryptFile'](_0x554aeb,_0x259755[_0x2719('0x49')],config[_0x2719('0x4e')][_0x2719('0x4f')])[_0x2719('0x24')](function(){return _0x259755;});}return _0x259755;}})[_0x2719('0x24')](function(_0x14c07e){if(!_0x14c07e){throw new db[(_0x2719('0x50'))][(_0x2719('0x51'))](_0x2719('0x76'));}_0x558667=_0x14c07e;return db[_0x2719('0x77')][_0x2719('0x75')]({'where':{'id':0x1}});})[_0x2719('0x24')](handleEntityNotFound(_0x342074,null))['then'](function(_0xec041d){if(_0xec041d){_0x2e1984=_0xec041d;if(!_0x2e1984[_0x2719('0x78')]||!_0x2e1984[_0x2719('0x79')]||!_0x2e1984['transcribeRegion']||!_0x2e1984[_0x2719('0x7a')]||!_0x2e1984[_0x2719('0x7b')]){throw new db['Sequelize'][(_0x2719('0x51'))](_0x2719('0x7c'));}if(_0x6b5de6[_0x2719('0x45')][_0x2719('0x7d')]&&(!_0x2e1984[_0x2719('0x7e')]||!_0x2e1984[_0x2719('0x7f')]||!_0x2e1984[_0x2719('0x80')]||!_0x2e1984[_0x2719('0x7a')]||!_0x2e1984[_0x2719('0x7b')])){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x2719('0x81')][_0x2719('0x75')]({'where':{'id':_0x2e1984[_0x2719('0x79')]}});}})[_0x2719('0x24')](function(_0x3deaf3){if(!_0x3deaf3){throw new db['Sequelize'][(_0x2719('0x51'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3deaf3[_0x2719('0x82')]||!_0x3deaf3[_0x2719('0x83')]){throw new db[(_0x2719('0x50'))][(_0x2719('0x51'))](_0x2719('0x84'));}_0x4d3d63=_0x3deaf3;return getBucketslist(_0x4d3d63['data1'],_0x4d3d63[_0x2719('0x83')],_0x2e1984[_0x2719('0x85')]);})[_0x2719('0x24')](function(_0x57388d){if(_0x57388d&&_0x57388d[_0x2719('0x86')]){var _0x33086c=_[_0x2719('0x48')](_0x57388d[_0x2719('0x86')],function(_0x2cb3d9){return _0x2cb3d9['Name']===_0x2e1984[_0x2719('0x7b')];});if(!_0x33086c){logger[_0x2719('0x61')](util[_0x2719('0x4a')](_0x2719('0x87'),_0x6b5de6['params']['id'],_0x2e1984[_0x2719('0x7b')]));return createBucket(_0x4d3d63['data1'],_0x4d3d63[_0x2719('0x83')],_0x2e1984[_0x2719('0x85')],_0x2e1984[_0x2719('0x7b')]);}logger['info'](util[_0x2719('0x4a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x6b5de6[_0x2719('0x42')]['id'],_0x2e1984['bucket']));return;}})[_0x2719('0x24')](function(_0x829e3f){if(_0x558667[_0x2719('0x88')]===_0x2719('0x89')){return transcribe(_0x6b5de6[_0x2719('0x42')]['id'],_0x4d3d63['data1'],_0x4d3d63[_0x2719('0x83')],_0x2e1984[_0x2719('0x85')],_0x2e1984['bucket'],_0x558667[_0x2719('0x49')],_0x2e1984[_0x2719('0x7a')]);}else{logger[_0x2719('0x61')](util[_0x2719('0x4a')](_0x2719('0x8a'),_0x6b5de6['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x48ba10){if(_0x48ba10){_0x48ba10[_0x2719('0x8b')]=_0x6b5de6[_0x2719('0x45')]['runSentiment'];return _0x558667[_0x2719('0x8c')](_0x48ba10);}})['then'](respondWithResult(_0x342074,null))[_0x2719('0x41')](handleError(_0x342074,null));};function writeFile(_0x290fe5,_0x4a8760){return new Promise(function(_0x2065ae,_0x2d9c13){fs[_0x2719('0x8d')](_0x4a8760,_0x290fe5,function(_0x350c60,_0xb66a6e){if(_0x350c60){return _0x2d9c13(_0x350c60);}else{return _0x2065ae(_0xb66a6e);}});});}exports['downloadTranscribe']=function(_0x57f1a0,_0xdcebec,_0x2b5205){return db[_0x2719('0x2a')]['findOne']({'where':{'id':_0x57f1a0[_0x2719('0x42')]['id']}})[_0x2719('0x24')](handleEntityNotFound(_0xdcebec))[_0x2719('0x24')](function(_0x472e6f){if(_0x472e6f&&_0x472e6f['fileText']){var _0x2709dd=_0x472e6f[_0x2719('0x8e')];var _0x3fac10=config[_0x2719('0x8f')]+_0x2719('0x90')+_0x472e6f['id']+_0x2719('0x91');if(fs[_0x2719('0x4c')](_0x3fac10)){return _0x3fac10;}return writeFile(_0x2709dd,_0x3fac10)['then'](function(){return _0x3fac10;});}else{throw new db['Sequelize'][(_0x2719('0x51'))](_0x2719('0x92'));}})[_0x2719('0x24')](function(_0xeb3f38){return _0xdcebec[_0x2719('0x53')](_0xeb3f38);})['catch'](handleError(_0xdcebec));}; \ No newline at end of file +var _0x7b35=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','push','recording','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','[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','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20configured','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','aws-sdk','uuid/v4','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','destroy','then','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','keys'];(function(_0x165609,_0x4a3146){var _0x2eddd6=function(_0x3bd09f){while(--_0x3bd09f){_0x165609['push'](_0x165609['shift']());}};_0x2eddd6(++_0x4a3146);}(_0x7b35,0x64));var _0x57b3=function(_0x445a9a,_0x1c1f11){_0x445a9a=_0x445a9a-0x0;var _0x5d801a=_0x7b35[_0x445a9a];return _0x5d801a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57b3('0x0'));var zipdir=require(_0x57b3('0x1'));var jsonpatch=require(_0x57b3('0x2'));var rp=require(_0x57b3('0x3'));var moment=require(_0x57b3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x57b3('0x5'));var csv=require(_0x57b3('0x6'));var ejs=require(_0x57b3('0x7'));var fs=require('fs');var fs_extra=require(_0x57b3('0x8'));var _=require(_0x57b3('0x9'));var squel=require('squel');var crypto=require(_0x57b3('0xa'));var jsforce=require(_0x57b3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x57b3('0x6'));var querystring=require(_0x57b3('0xc'));var Papa=require('papaparse');var AWS=require(_0x57b3('0xd'));var uuidv4=require(_0x57b3('0xe'));var Redis=require(_0x57b3('0xf'));var authService=require(_0x57b3('0x10'));var qs=require(_0x57b3('0x11'));var as=require(_0x57b3('0x12'));var hardwareService=require(_0x57b3('0x13'));var logger=require(_0x57b3('0x14'))(_0x57b3('0x15'));var utils=require(_0x57b3('0x16'));var config=require(_0x57b3('0x17'));var licenseUtil=require(_0x57b3('0x18'));var db=require(_0x57b3('0x19'))['db'];function respondWithStatusCode(_0x161ab9,_0x45f7fe){_0x45f7fe=_0x45f7fe||0xcc;return function(_0x37f0c6){if(_0x37f0c6){return _0x161ab9[_0x57b3('0x1a')](_0x45f7fe);}return _0x161ab9[_0x57b3('0x1b')](_0x45f7fe)['end']();};}function respondWithResult(_0x53fa71,_0xc9ad93){_0xc9ad93=_0xc9ad93||0xc8;return function(_0xabc0be){if(_0xabc0be){return _0x53fa71['status'](_0xc9ad93)[_0x57b3('0x1c')](_0xabc0be);}};}function respondWithFilteredResult(_0x5a7525,_0x32b620){return function(_0x346835){if(_0x346835){var _0x5db290=typeof _0x32b620['offset']===_0x57b3('0x1d')&&typeof _0x32b620[_0x57b3('0x1e')]===_0x57b3('0x1d');var _0xb42e86=_0x346835[_0x57b3('0x1f')];var _0x4d92c7=_0x5db290?0x0:_0x32b620[_0x57b3('0x20')];var _0x45250c=_0x5db290?_0x346835[_0x57b3('0x1f')]:_0x32b620[_0x57b3('0x20')]+_0x32b620['limit'];var _0x5034cc;if(_0x45250c>=_0xb42e86){_0x45250c=_0xb42e86;_0x5034cc=0xc8;}else{_0x5034cc=0xce;}_0x5a7525['status'](_0x5034cc);return _0x5a7525[_0x57b3('0x21')](_0x57b3('0x22'),_0x4d92c7+'-'+_0x45250c+'/'+_0xb42e86)['json'](_0x346835);}return null;};}function patchUpdates(_0x50a1b2){return function(_0x47234d){try{jsonpatch[_0x57b3('0x23')](_0x47234d,_0x50a1b2,!![]);}catch(_0x49538e){return BPromise[_0x57b3('0x24')](_0x49538e);}return _0x47234d[_0x57b3('0x25')]();};}function saveUpdates(_0x5eb857,_0x5f480c){return function(_0x3571ad){if(_0x3571ad){return _0x3571ad[_0x57b3('0x26')](_0x5eb857)['then'](function(_0x19295a){return _0x19295a;});}return null;};}function removeEntity(_0x4efcb6,_0x12e242){return function(_0x552291){if(_0x552291){return _0x552291[_0x57b3('0x27')]()[_0x57b3('0x28')](function(){_0x4efcb6[_0x57b3('0x1b')](0xcc)[_0x57b3('0x29')]();});}};}function handleEntityNotFound(_0x3b58a5,_0x36278b){return function(_0x192c46){if(!_0x192c46){_0x3b58a5[_0x57b3('0x1a')](0x194);}return _0x192c46;};}function handleError(_0x245d3f,_0x4b9616){_0x4b9616=_0x4b9616||0x1f4;return function(_0x501021){logger[_0x57b3('0x2a')](_0x501021[_0x57b3('0x2b')]);if(_0x501021['name']){delete _0x501021[_0x57b3('0x2c')];}_0x245d3f[_0x57b3('0x1b')](_0x4b9616)[_0x57b3('0x2d')](_0x501021);};}exports[_0x57b3('0x2e')]=function(_0x23b43a,_0x4a9319){var _0x161c5b={},_0x29c56b={},_0x25f8ec={'count':0x0,'rows':[]};var _0x3a32bf=_[_0x57b3('0x2f')](db[_0x57b3('0x30')][_0x57b3('0x31')],function(_0x54e0b6){return{'name':_0x54e0b6[_0x57b3('0x32')],'type':_0x54e0b6[_0x57b3('0x33')]['key']};});_0x29c56b[_0x57b3('0x34')]=_[_0x57b3('0x35')](_[_0x57b3('0x2f')](_0x3a32bf,_0x57b3('0x2c')),[_0x57b3('0x36')]);_0x29c56b['query']=_[_0x57b3('0x37')](_0x23b43a[_0x57b3('0x38')]);_0x29c56b[_0x57b3('0x39')]=_[_0x57b3('0x3a')](_0x29c56b[_0x57b3('0x34')],_0x29c56b[_0x57b3('0x38')]);_0x161c5b['attributes']=_[_0x57b3('0x3a')](_0x29c56b[_0x57b3('0x34')],qs['fields'](_0x23b43a[_0x57b3('0x38')][_0x57b3('0x3b')]));_0x161c5b[_0x57b3('0x3c')]=_0x161c5b[_0x57b3('0x3c')]['length']?_0x161c5b[_0x57b3('0x3c')]:_0x29c56b['model'];if(!_0x23b43a['query'][_0x57b3('0x3d')](_0x57b3('0x3e'))){_0x161c5b[_0x57b3('0x1e')]=qs[_0x57b3('0x1e')](_0x23b43a[_0x57b3('0x38')][_0x57b3('0x1e')]);_0x161c5b[_0x57b3('0x20')]=qs['offset'](_0x23b43a['query'][_0x57b3('0x20')]);}_0x161c5b[_0x57b3('0x3f')]=qs[_0x57b3('0x40')](_0x23b43a[_0x57b3('0x38')][_0x57b3('0x40')]);_0x161c5b[_0x57b3('0x41')]=qs[_0x57b3('0x39')](_[_0x57b3('0x42')](_0x23b43a[_0x57b3('0x38')],_0x29c56b['filters']),_0x3a32bf);if(_0x23b43a['query'][_0x57b3('0x43')]){_0x161c5b[_0x57b3('0x41')]=_[_0x57b3('0x44')](_0x161c5b[_0x57b3('0x41')],{'$or':_[_0x57b3('0x2f')](_0x3a32bf,function(_0x2f0b5e){if(_0x2f0b5e['type']!==_0x57b3('0x45')){var _0x42ca9a={};_0x42ca9a[_0x2f0b5e[_0x57b3('0x2c')]]={'$like':'%'+_0x23b43a[_0x57b3('0x38')][_0x57b3('0x43')]+'%'};return _0x42ca9a;}})});}_0x161c5b=_[_0x57b3('0x44')]({},_0x161c5b,_0x23b43a[_0x57b3('0x46')]);var _0x2321cb={'where':_0x161c5b[_0x57b3('0x41')]};return db[_0x57b3('0x30')]['count'](_0x2321cb)[_0x57b3('0x28')](function(_0x10fa68){_0x25f8ec[_0x57b3('0x1f')]=_0x10fa68;if(_0x23b43a[_0x57b3('0x38')][_0x57b3('0x47')]){_0x161c5b[_0x57b3('0x48')]=[{'all':!![]}];}return db[_0x57b3('0x30')][_0x57b3('0x49')](_0x161c5b);})[_0x57b3('0x28')](function(_0x414b5d){_0x25f8ec[_0x57b3('0x4a')]=_0x414b5d;return _0x25f8ec;})['then'](respondWithFilteredResult(_0x4a9319,_0x161c5b))[_0x57b3('0x4b')](handleError(_0x4a9319,null));};exports[_0x57b3('0x4c')]=function(_0x3e9405,_0x2c59a0){var _0x5c53f9={'raw':![],'where':{'id':_0x3e9405[_0x57b3('0x4d')]['id']}},_0xb3b809={};_0xb3b809[_0x57b3('0x34')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0xb3b809['query']=_[_0x57b3('0x37')](_0x3e9405[_0x57b3('0x38')]);_0xb3b809[_0x57b3('0x39')]=_[_0x57b3('0x3a')](_0xb3b809[_0x57b3('0x34')],_0xb3b809[_0x57b3('0x38')]);_0x5c53f9[_0x57b3('0x3c')]=_[_0x57b3('0x3a')](_0xb3b809[_0x57b3('0x34')],qs[_0x57b3('0x3b')](_0x3e9405[_0x57b3('0x38')]['fields']));_0x5c53f9[_0x57b3('0x3c')]=_0x5c53f9[_0x57b3('0x3c')][_0x57b3('0x4e')]?_0x5c53f9[_0x57b3('0x3c')]:_0xb3b809[_0x57b3('0x34')];if(_0x3e9405[_0x57b3('0x38')]['includeAll']){_0x5c53f9[_0x57b3('0x48')]=[{'all':!![]}];}_0x5c53f9=_[_0x57b3('0x44')]({},_0x5c53f9,_0x3e9405[_0x57b3('0x46')]);return db[_0x57b3('0x30')][_0x57b3('0x4f')](_0x5c53f9)[_0x57b3('0x28')](handleEntityNotFound(_0x2c59a0,null))[_0x57b3('0x28')](respondWithResult(_0x2c59a0,null))[_0x57b3('0x4b')](handleError(_0x2c59a0,null));};exports[_0x57b3('0x50')]=function(_0x4b22f8,_0x4d4744){return db[_0x57b3('0x30')][_0x57b3('0x50')](_0x4b22f8['body'],{})[_0x57b3('0x28')](respondWithResult(_0x4d4744,0xc9))[_0x57b3('0x4b')](handleError(_0x4d4744,null));};exports[_0x57b3('0x26')]=function(_0x3ac0ba,_0x313b4e){if(_0x3ac0ba[_0x57b3('0x51')]['id']){delete _0x3ac0ba[_0x57b3('0x51')]['id'];}return db[_0x57b3('0x30')]['find']({'where':{'id':_0x3ac0ba['params']['id']}})['then'](handleEntityNotFound(_0x313b4e,null))['then'](saveUpdates(_0x3ac0ba[_0x57b3('0x51')],null))[_0x57b3('0x28')](respondWithResult(_0x313b4e,null))[_0x57b3('0x4b')](handleError(_0x313b4e,null));};exports[_0x57b3('0x52')]=function(_0x260fb6,_0x58de43){return db['VoiceRecording'][_0x57b3('0x52')]()[_0x57b3('0x28')](respondWithResult(_0x58de43,null))[_0x57b3('0x4b')](handleError(_0x58de43,null));};exports['download']=function(_0x26421c,_0x348b5e,_0xe4a847){var _0x3b5487=require('../../components/encryptor');var _0x399480=![];var _0x309616={};if(_0x26421c['query'][_0x57b3('0x33')]&&_0x26421c[_0x57b3('0x38')][_0x57b3('0x33')]===_0x57b3('0x53')){_0x309616[_0x57b3('0x53')]=_0x26421c[_0x57b3('0x4d')]['id'];}else{_0x309616['id']=_0x26421c['params']['id'];}return db[_0x57b3('0x30')][_0x57b3('0x4f')]({'where':_0x309616,'attributes':['id',_0x57b3('0x54')],'raw':!![]})[_0x57b3('0x28')](handleEntityNotFound(_0x348b5e,null))[_0x57b3('0x28')](function(_0x2bc1bc){if(_0x2bc1bc){var _0x400148=_0x2bc1bc[_0x57b3('0x54')];var _0x759f97=util[_0x57b3('0x36')](_0x57b3('0x55'),_0x400148);if(fs['existsSync'](_0x759f97)){_0x399480=!![];return _0x3b5487[_0x57b3('0x56')](_0x759f97,_0x400148,config[_0x57b3('0x57')]['recording'])['then'](function(){return _0x2bc1bc;});}return _0x2bc1bc;}})[_0x57b3('0x28')](function(_0x49bcd6){if(_0x49bcd6){var _0x2cad11=_0x49bcd6[_0x57b3('0x54')];if(!fs[_0x57b3('0x58')](_0x2cad11)){throw new db[(_0x57b3('0x59'))][(_0x57b3('0x5a'))](_0x57b3('0x5b'));}if(_0x49bcd6[_0x57b3('0x5c')]){return _0x348b5e[_0x57b3('0x5d')](_0x2cad11,_0x49bcd6[_0x57b3('0x5c')]+path[_0x57b3('0x5e')](_0x2cad11),function(){if(_0x399480){fs['unlink'](_0x2cad11);}});}else{return _0x348b5e['download'](_0x2cad11,function(_0x3fc874){if(_0x399480){fs[_0x57b3('0x5f')](_0x2cad11);}});}}})[_0x57b3('0x4b')](function(_0x3d5ffa){if(_0x3d5ffa['message']===_0x57b3('0x5b')){_0x348b5e[_0x57b3('0x1b')](0x194)[_0x57b3('0x2d')](_0x57b3('0x60'));}else{return handleError(_0x348b5e,null);}});};exports[_0x57b3('0x61')]=function(_0x50895e,_0x278182,_0x4bf75f){var _0x1f00dd=require(_0x57b3('0x62'));var _0xef8c5=![];var _0x35c349={'$and':[db[_0x57b3('0x63')][_0x57b3('0x41')](db[_0x57b3('0x63')]['fn'](_0x57b3('0x64'),db['sequelize'][_0x57b3('0x65')](_0x57b3('0x53'))),_0x50895e[_0x57b3('0x38')]['token'])]};if(_0x50895e[_0x57b3('0x38')][_0x57b3('0x33')]&&_0x50895e[_0x57b3('0x38')][_0x57b3('0x33')]==='uniqueid'){_0x35c349[_0x57b3('0x66')]['push']({'uniqueid':_0x50895e[_0x57b3('0x4d')]['id']});}else{_0x35c349[_0x57b3('0x66')][_0x57b3('0x67')]({'id':_0x50895e['params']['id']});}return db[_0x57b3('0x30')][_0x57b3('0x4f')]({'where':_0x35c349,'attributes':['id',_0x57b3('0x54')],'raw':!![]})[_0x57b3('0x28')](handleEntityNotFound(_0x278182,null))[_0x57b3('0x28')](function(_0x40276c){if(_0x40276c){var _0x4b1ae3=util[_0x57b3('0x36')](_0x57b3('0x55'),_0x40276c[_0x57b3('0x54')]);if(fs['existsSync'](_0x4b1ae3)){_0xef8c5=!![];return _0x1f00dd[_0x57b3('0x56')](_0x4b1ae3,_0x40276c[_0x57b3('0x54')],config[_0x57b3('0x57')][_0x57b3('0x68')])[_0x57b3('0x28')](function(){return _0x40276c;});}return _0x40276c;}})['then'](function(_0x4a1969){if(_0x4a1969){if(!fs['existsSync'](_0x4a1969['value'])){throw new db['Sequelize']['ValidationError'](_0x57b3('0x5b'));}if(_0x4a1969[_0x57b3('0x5c')]){return _0x278182['download'](_0x4a1969[_0x57b3('0x54')],_0x4a1969[_0x57b3('0x5c')]+path[_0x57b3('0x5e')](_0x4a1969[_0x57b3('0x54')]),function(){if(_0xef8c5){fs[_0x57b3('0x5f')](_0x4a1969[_0x57b3('0x54')]);}});}else{return _0x278182[_0x57b3('0x5d')](_0x4a1969[_0x57b3('0x54')],function(_0x2a8e91){if(_0xef8c5){fs[_0x57b3('0x5f')](_0x4a1969['value']);}});}}})[_0x57b3('0x4b')](handleError(_0x278182,null));};exports[_0x57b3('0x27')]=function(_0x228f45,_0x4801f4){return db[_0x57b3('0x30')][_0x57b3('0x4f')]({'where':{'id':_0x228f45['params']['id']}})['then'](function(_0x54f173){if(_[_0x57b3('0x69')](_0x54f173)){throw new ReferenceError(_0x57b3('0x6a'));}return _0x54f173;})[_0x57b3('0x28')](function(_0xb2f85){var _0x2a718a=_0xb2f85[_0x57b3('0x54')];logger[_0x57b3('0x6b')]('cancellazione\x20fisica\x20documento\x20%s',_0x2a718a);if(!_[_0x57b3('0x69')](_0xb2f85[_0x57b3('0x54')])&&fs['existsSync'](_0x2a718a)){logger['info'](_0x57b3('0x6c')+_0x2a718a+_0x57b3('0x6d'));fs['unlinkSync'](_0x2a718a);}_0x2a718a=_0x2a718a+_0x57b3('0x6e');if(!_[_0x57b3('0x69')](_0xb2f85[_0x57b3('0x54')])&&fs[_0x57b3('0x58')](_0x2a718a)){logger[_0x57b3('0x6b')]('File:\x20\x22'+_0x2a718a+_0x57b3('0x6d'));fs[_0x57b3('0x6f')](_0x2a718a);}return _0xb2f85;})[_0x57b3('0x28')](function(_0xad0618){if(!_0xad0618)throw new InternalError();return _0xad0618[_0x57b3('0x27')]();})[_0x57b3('0x28')](function(){_0x4801f4[_0x57b3('0x1b')](0xcc)[_0x57b3('0x29')]();})[_0x57b3('0x4b')](handleError(_0x4801f4,null));};function getBucketslist(_0x1f5bcb,_0x31904b,_0x29e5f6){return new Promise(function(_0x57fdf1,_0x2c718d){var _0x5328ba=new AWS['S3']({'accessKeyId':_0x31904b,'secretAccessKey':_0x1f5bcb,'region':_0x29e5f6});_0x5328ba[_0x57b3('0x70')]({},function(_0x6b07ec,_0x4ced49){if(_0x6b07ec){return _0x2c718d(_0x6b07ec);}else{return _0x57fdf1(_0x4ced49);}});});}function createBucket(_0x13f562,_0x305b92,_0x45b0e1,_0x3d5cca){return new Promise(function(_0x109de4,_0x4273df){var _0x35cc1e=new AWS['S3']({'accessKeyId':_0x305b92,'secretAccessKey':_0x13f562,'region':_0x45b0e1});_0x35cc1e[_0x57b3('0x71')]({'Bucket':_0x3d5cca},function(_0x4ea9fb,_0xc2b749){if(_0x4ea9fb){return _0x4273df(_0x4ea9fb);}else{return _0x109de4(_0xc2b749);}});});}function uploadFile(_0x1ffa0b,_0x15038b,_0x55b021,_0x29605a,_0x45ea48,_0x534c2a){return new Promise(function(_0x296dc1,_0x88d9e3){var _0x11ea3c=new AWS['S3']({'accessKeyId':_0x15038b,'secretAccessKey':_0x1ffa0b,'region':_0x55b021});_0x11ea3c['upload']({'Bucket':_0x29605a,'Key':_0x45ea48,'Body':_0x534c2a},function(_0x38fadc,_0x2bb19e){if(_0x38fadc){return _0x88d9e3(_0x38fadc);}else{return _0x296dc1(_0x2bb19e);}});});}function startTranscribe(_0x4a96d1,_0x41764f,_0x3c6eab,_0xad121b,_0x108c65,_0x265c57){return new Promise(function(_0x1414ff,_0xb8a9e4){var _0x244b9b=new AWS['TranscribeService']({'accessKeyId':_0x41764f,'secretAccessKey':_0x4a96d1,'region':_0x3c6eab});_0x244b9b['startTranscriptionJob']({'TranscriptionJobName':_0xad121b,'LanguageCode':_0x108c65,'Media':{'MediaFileUri':_0x265c57}},function(_0x5f493e,_0x196c3c){if(_0x5f493e){return _0xb8a9e4(_0x5f493e);}else{return _0x1414ff(_0x196c3c);}});});}function transcribe(_0x3cd1a4,_0x2e245e,_0x3459fb,_0x1b55bf,_0x3322b3,_0x2eedd0,_0x2d342f){return new Promise(function(_0xd70423,_0x50753c){var _0x1e7d8a={};logger[_0x57b3('0x6b')](util['format'](_0x57b3('0x72'),_0x3cd1a4,_0x3322b3));return uploadFile(_0x2e245e,_0x3459fb,_0x1b55bf,_0x3322b3,path[_0x57b3('0x73')](_0x2eedd0),fs[_0x57b3('0x74')](_0x2eedd0))[_0x57b3('0x28')](function(_0x38f626){logger[_0x57b3('0x6b')](util[_0x57b3('0x36')](_0x57b3('0x75'),_0x3cd1a4,_0x3322b3,_0x38f626[_0x57b3('0x76')]));_0x1e7d8a[_0x57b3('0x77')]=_0x38f626['Bucket'];_0x1e7d8a[_0x57b3('0x78')]=_0x38f626['Location'];logger['info'](util[_0x57b3('0x36')](_0x57b3('0x79'),_0x3cd1a4));return startTranscribe(_0x2e245e,_0x3459fb,_0x1b55bf,uuidv4(),_0x2d342f,_0x38f626[_0x57b3('0x76')]);})[_0x57b3('0x28')](function(_0x545692){logger[_0x57b3('0x6b')](util[_0x57b3('0x36')](_0x57b3('0x7a'),_0x3cd1a4,_0x545692['TranscriptionJob'][_0x57b3('0x7b')]));_0x1e7d8a[_0x57b3('0x7c')]=_0x545692[_0x57b3('0x7d')][_0x57b3('0x7b')];_0x1e7d8a[_0x57b3('0x7e')]=_0x545692['TranscriptionJob'][_0x57b3('0x7f')];return _0xd70423(_0x1e7d8a);})['catch'](function(_0x2973e6){return _0x50753c(_0x2973e6);});});}exports[_0x57b3('0x80')]=function(_0x513dd2,_0x27e474,_0x1b93e8){var _0xdff27c;var _0xc20e8d;var _0x401391;var _0x471cc8=require('../../components/encryptor');return db[_0x57b3('0x30')][_0x57b3('0x81')]({'where':{'id':_0x513dd2[_0x57b3('0x4d')]['id']}})['then'](function(_0x16a673){if(_0x16a673){var _0x1b0377=util[_0x57b3('0x36')](_0x57b3('0x55'),_0x16a673[_0x57b3('0x54')]);if(fs[_0x57b3('0x58')](_0x1b0377)){cypher=!![];return _0x471cc8[_0x57b3('0x56')](_0x1b0377,_0x16a673[_0x57b3('0x54')],config[_0x57b3('0x57')][_0x57b3('0x68')])[_0x57b3('0x28')](function(){return _0x16a673;});}return _0x16a673;}})[_0x57b3('0x28')](function(_0x30ff1e){if(!_0x30ff1e){throw new db[(_0x57b3('0x59'))]['ValidationError'](_0x57b3('0x82'));}_0xc20e8d=_0x30ff1e;return db[_0x57b3('0x83')][_0x57b3('0x81')]({'where':{'id':0x1}});})[_0x57b3('0x28')](handleEntityNotFound(_0x27e474,null))[_0x57b3('0x28')](function(_0x3e4049){if(_0x3e4049){_0xdff27c=_0x3e4049;if(!_0xdff27c[_0x57b3('0x84')]||!_0xdff27c['transcribeAccountId']||!_0xdff27c['transcribeRegion']||!_0xdff27c['language']||!_0xdff27c[_0x57b3('0x77')]){throw new db[(_0x57b3('0x59'))][(_0x57b3('0x5a'))](_0x57b3('0x85'));}if(_0x513dd2[_0x57b3('0x51')][_0x57b3('0x86')]&&(!_0xdff27c[_0x57b3('0x87')]||!_0xdff27c[_0x57b3('0x88')]||!_0xdff27c['sentimentRegion']||!_0xdff27c[_0x57b3('0x89')]||!_0xdff27c[_0x57b3('0x77')])){throw new db[(_0x57b3('0x59'))]['ValidationError'](_0x57b3('0x8a'));}return db[_0x57b3('0x8b')]['findOne']({'where':{'id':_0xdff27c['transcribeAccountId']}});}})[_0x57b3('0x28')](function(_0x1b6bb4){if(!_0x1b6bb4){throw new db[(_0x57b3('0x59'))][(_0x57b3('0x5a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1b6bb4['data1']||!_0x1b6bb4['data2']){throw new db[(_0x57b3('0x59'))][(_0x57b3('0x5a'))](_0x57b3('0x8c'));}_0x401391=_0x1b6bb4;return getBucketslist(_0x401391[_0x57b3('0x8d')],_0x401391[_0x57b3('0x8e')],_0xdff27c[_0x57b3('0x8f')]);})[_0x57b3('0x28')](function(_0x2c4eaf){if(_0x2c4eaf&&_0x2c4eaf[_0x57b3('0x90')]){var _0x2d80cf=_['find'](_0x2c4eaf[_0x57b3('0x90')],function(_0xf96c49){return _0xf96c49[_0x57b3('0x91')]===_0xdff27c[_0x57b3('0x77')];});if(!_0x2d80cf){logger[_0x57b3('0x6b')](util[_0x57b3('0x36')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x513dd2[_0x57b3('0x4d')]['id'],_0xdff27c['bucket']));return createBucket(_0x401391[_0x57b3('0x8d')],_0x401391[_0x57b3('0x8e')],_0xdff27c[_0x57b3('0x8f')],_0xdff27c[_0x57b3('0x77')]);}logger['info'](util['format'](_0x57b3('0x92'),_0x513dd2[_0x57b3('0x4d')]['id'],_0xdff27c[_0x57b3('0x77')]));return;}})[_0x57b3('0x28')](function(_0x852bdc){if(_0xc20e8d[_0x57b3('0x7e')]===_0x57b3('0x93')){return transcribe(_0x513dd2[_0x57b3('0x4d')]['id'],_0x401391[_0x57b3('0x8d')],_0x401391[_0x57b3('0x8e')],_0xdff27c['transcribeRegion'],_0xdff27c[_0x57b3('0x77')],_0xc20e8d[_0x57b3('0x54')],_0xdff27c[_0x57b3('0x89')]);}else{logger['info'](util[_0x57b3('0x36')](_0x57b3('0x94'),_0x513dd2['params']['id']));return{'transcribeStatus':_0x57b3('0x95')};}})[_0x57b3('0x28')](function(_0x22e51d){if(_0x22e51d){_0x22e51d['tempSentiment']=_0x513dd2[_0x57b3('0x51')][_0x57b3('0x86')];return _0xc20e8d[_0x57b3('0x96')](_0x22e51d);}})[_0x57b3('0x28')](respondWithResult(_0x27e474,null))[_0x57b3('0x4b')](handleError(_0x27e474,null));};function writeFile(_0x13157e,_0x3b3e33){return new Promise(function(_0x5224f4,_0x512b75){fs[_0x57b3('0x97')](_0x3b3e33,_0x13157e,function(_0x18e496,_0x4e6366){if(_0x18e496){return _0x512b75(_0x18e496);}else{return _0x5224f4(_0x4e6366);}});});}exports['downloadTranscribe']=function(_0x41cb4c,_0x3323a0,_0x1f683a){return db['VoiceRecording'][_0x57b3('0x81')]({'where':{'id':_0x41cb4c['params']['id']}})[_0x57b3('0x28')](handleEntityNotFound(_0x3323a0))[_0x57b3('0x28')](function(_0x5e1bd4){if(_0x5e1bd4&&_0x5e1bd4[_0x57b3('0x98')]){var _0x53fa32=_0x5e1bd4[_0x57b3('0x98')];var _0x44ef47=config[_0x57b3('0x99')]+_0x57b3('0x9a')+_0x5e1bd4['id']+_0x57b3('0x9b');if(fs[_0x57b3('0x58')](_0x44ef47)){return _0x44ef47;}return writeFile(_0x53fa32,_0x44ef47)['then'](function(){return _0x44ef47;});}else{throw new db[(_0x57b3('0x59'))][(_0x57b3('0x5a'))]('Transcript\x20not\x20available');}})['then'](function(_0x16c49d){return _0x3323a0[_0x57b3('0x5d')](_0x16c49d);})[_0x57b3('0x4b')](handleError(_0x3323a0));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index cb8fd10..61bd07f 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 _0x1675=['lodash','util','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x28d99b,_0x3a673a){var _0x31843d=function(_0x5ab728){while(--_0x5ab728){_0x28d99b['push'](_0x28d99b['shift']());}};_0x31843d(++_0x3a673a);}(_0x1675,0x1a4));var _0x5167=function(_0x494ffe,_0x557e9e){_0x494ffe=_0x494ffe-0x0;var _0x1a3f2b=_0x1675[_0x494ffe];return _0x1a3f2b;};'use strict';var _=require(_0x5167('0x0'));var util=require(_0x5167('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5167('0x2'));var rp=require(_0x5167('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5167('0x4'));var config=require(_0x5167('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x5167('0x6')]=function(_0x14a5ce,_0x232c33){return _0x14a5ce['define'](_0x5167('0x7'),attributes,{'tableName':_0x5167('0x8'),'paranoid':![],'indexes':[{'name':_0x5167('0x9'),'fields':[_0x5167('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdbe=['../../config/logger','moment','request-promise','rimraf','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xbdbe[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xebdb('0x0'));var util=require('util');var logger=require(_0xebdb('0x1'))('api');var moment=require(_0xebdb('0x2'));var BPromise=require('bluebird');var rp=require(_0xebdb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebdb('0x4'));var config=require('../../config/environment');var attributes=require(_0xebdb('0x5'));module['exports']=function(_0x230454,_0xbc1822){return _0x230454[_0xebdb('0x6')](_0xebdb('0x7'),attributes,{'tableName':_0xebdb('0x8'),'paranoid':![],'indexes':[{'name':_0xebdb('0x9'),'fields':[_0xebdb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d56b786..335f016 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 _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0xe3159a,_0x57a149){var _0x20474b=function(_0x5c7df8){while(--_0x5c7df8){_0xe3159a['push'](_0xe3159a['shift']());}};_0x20474b(++_0x57a149);}(_0x81c6,0x1d5));var _0x681c=function(_0x2eeed4,_0x28dc98){_0x2eeed4=_0x2eeed4-0x0;var _0x56099d=_0x81c6[_0x2eeed4];return _0x56099d;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});}; \ No newline at end of file +var _0x5fdc=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5fdc,0x127));var _0xc5fd=function(_0x3ffc4c,_0x549510){_0x3ffc4c=_0x3ffc4c-0x0;var _0x3b198f=_0x5fdc[_0x3ffc4c];return _0x3b198f;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['update'](_0x27f611[_0xc5fd('0x1b')],{'raw':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f611[_0xc5fd('0x1c')]?_0x27f611['options'][_0xc5fd('0x1e')]||null:null,'attributes':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1f')]||null:null,'limit':_0x27f611['options']?_0x27f611['options'][_0xc5fd('0x20')]||null:null})[_0xc5fd('0xf')](function(_0x3d7211){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')]('UpdateVoiceRecording',_0x27f611,JSON[_0xc5fd('0x13')](_0x3d7211));_0x2ee392(_0x3d7211);})[_0xc5fd('0x21')](function(_0x1a5174){logger[_0xc5fd('0x14')](_0xc5fd('0x19'),_0x1a5174[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x1a5174['message']));});});};exports[_0xc5fd('0x22')]=function(_0x48cd1d){var _0x2ee700=this;return new Promise(function(_0x231368,_0x44681d){var _0x2bee22=require('../../components/encryptor');var _0x176313;return db[_0xc5fd('0x23')][_0xc5fd('0x24')]({'attributes':['id',_0xc5fd('0x25')],'where':{'id':0x1},'raw':!![]})[_0xc5fd('0xf')](function(_0x209975){_0x176313=_0x209975;return db['VoiceRecording'][_0xc5fd('0x26')](_0x48cd1d['body']);})['then'](function(_0x12a962){if(_0x176313[_0xc5fd('0x25')]&&fs[_0xc5fd('0x27')](_0x12a962[_0xc5fd('0x28')])){var _0x7693c4=util[_0xc5fd('0x29')](_0xc5fd('0x2a'),_0x12a962[_0xc5fd('0x28')]);return _0x2bee22['encryptFile'](_0x12a962[_0xc5fd('0x28')],_0x7693c4,config[_0xc5fd('0x2b')][_0xc5fd('0x2c')])[_0xc5fd('0xf')](function(){fs[_0xc5fd('0x2d')](_0x12a962[_0xc5fd('0x28')]);logger[_0xc5fd('0x18')](_0xc5fd('0x2e'));return _0x12a962;});}return _0x12a962;})[_0xc5fd('0xf')](function(_0x466aa1){logger[_0xc5fd('0x18')](_0xc5fd('0x22'),_0x48cd1d);logger['debug'](_0xc5fd('0x22'),_0x48cd1d,JSON[_0xc5fd('0x13')](_0x466aa1));_0x231368(_0x466aa1);})[_0xc5fd('0x21')](function(_0x1fa329){logger[_0xc5fd('0x14')](_0xc5fd('0x22'),_0x1fa329[_0xc5fd('0x16')],_0x48cd1d);_0x44681d(_0x2ee700[_0xc5fd('0x14')](0x1f4,_0x1fa329[_0xc5fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 298bd53..2ef96ed 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 _0x1475=['create','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1475,0x108));var _0x5147=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x1475[_0x56c70f];return _0x3812ed;};'use strict';var multer=require(_0x5147('0x0'));var util=require(_0x5147('0x1'));var path=require(_0x5147('0x2'));var timeout=require(_0x5147('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5147('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5147('0x5'));var config=require(_0x5147('0x6'));var controller=require(_0x5147('0x7'));router[_0x5147('0x8')]('/',auth[_0x5147('0x9')](),controller[_0x5147('0xa')]);router[_0x5147('0x8')](_0x5147('0xb'),auth[_0x5147('0x9')](),controller[_0x5147('0xc')]);router['get'](_0x5147('0xd'),auth['isAuthenticated'](),controller[_0x5147('0xe')]);router[_0x5147('0xf')]('/',auth[_0x5147('0x9')](),controller[_0x5147('0x10')]);router[_0x5147('0x11')](_0x5147('0xd'),auth[_0x5147('0x9')](),controller[_0x5147('0x12')]);router['delete'](_0x5147('0xd'),auth[_0x5147('0x9')](),controller[_0x5147('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf9d9=['create','put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4c29cd,_0x3255bc){var _0x5e787d=function(_0x22ac6e){while(--_0x22ac6e){_0x4c29cd['push'](_0x4c29cd['shift']());}};_0x5e787d(++_0x3255bc);}(_0xf9d9,0xfc));var _0x9f9d=function(_0x43ad18,_0x21f334){_0x43ad18=_0x43ad18-0x0;var _0x3bdc6a=_0xf9d9[_0x43ad18];return _0x3bdc6a;};'use strict';var multer=require('multer');var util=require(_0x9f9d('0x0'));var path=require(_0x9f9d('0x1'));var timeout=require(_0x9f9d('0x2'));var express=require(_0x9f9d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f9d('0x4'));var interaction=require(_0x9f9d('0x5'));var config=require('../../config/environment');var controller=require(_0x9f9d('0x6'));router[_0x9f9d('0x7')]('/',auth[_0x9f9d('0x8')](),controller[_0x9f9d('0x9')]);router[_0x9f9d('0x7')](_0x9f9d('0xa'),auth[_0x9f9d('0x8')](),controller[_0x9f9d('0xb')]);router['get'](_0x9f9d('0xc'),auth[_0x9f9d('0x8')](),controller[_0x9f9d('0xd')]);router['post']('/',auth[_0x9f9d('0x8')](),controller[_0x9f9d('0xe')]);router[_0x9f9d('0xf')](_0x9f9d('0xc'),auth[_0x9f9d('0x8')](),controller[_0x9f9d('0x10')]);router[_0x9f9d('0x11')](_0x9f9d('0xc'),auth[_0x9f9d('0x8')](),controller['destroy']);module[_0x9f9d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index eb09672..5385879 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 _0x276f=['blind','attended','STRING','Yes','sequelize','exports','ENUM'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x276f,0x1af));var _0xf276=function(_0x466d82,_0x32c16e){_0x466d82=_0x466d82-0x0;var _0x4404f0=_0x276f[_0x466d82];return _0x4404f0;};'use strict';var Sequelize=require(_0xf276('0x0'));var moment=require('moment');module[_0xf276('0x1')]={'type':{'type':Sequelize[_0xf276('0x2')](_0xf276('0x3'),_0xf276('0x4'))},'result':{'type':Sequelize[_0xf276('0x5')]},'transfererchannel':{'type':Sequelize[_0xf276('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xf276('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf276('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf276('0x5')]},'transfererexten':{'type':Sequelize[_0xf276('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xf276('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xf276('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf276('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf276('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xf276('0x5')]},'transfereecontext':{'type':Sequelize[_0xf276('0x5')]},'transfereeexten':{'type':Sequelize[_0xf276('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xf276('0x2')](_0xf276('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf276('0x5')]}}; \ No newline at end of file +var _0xc8c1=['attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0xe842d2,_0xf36b08){var _0x7ac53e=function(_0x256a96){while(--_0x256a96){_0xe842d2['push'](_0xe842d2['shift']());}};_0x7ac53e(++_0xf36b08);}(_0xc8c1,0xed));var _0x1c8c=function(_0x31b356,_0x102699){_0x31b356=_0x31b356-0x0;var _0x35f063=_0xc8c1[_0x31b356];return _0x35f063;};'use strict';var Sequelize=require(_0x1c8c('0x0'));var moment=require(_0x1c8c('0x1'));module['exports']={'type':{'type':Sequelize[_0x1c8c('0x2')]('blind',_0x1c8c('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x1c8c('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1c8c('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1c8c('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1c8c('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1c8c('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1c8c('0x4')]},'transfererexten':{'type':Sequelize[_0x1c8c('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1c8c('0x4')]},'transfereechannel':{'type':Sequelize[_0x1c8c('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1c8c('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1c8c('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1c8c('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x1c8c('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x1c8c('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 122f6c0..7308c51 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 _0x1d5d=['count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceTransferReport','findAll','rows','catch','show','keys','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0x1d5d,0x1ee));var _0xd1d5=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x1d5d[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xd1d5('0x0'));var rimraf=require(_0xd1d5('0x1'));var zipdir=require(_0xd1d5('0x2'));var jsonpatch=require(_0xd1d5('0x3'));var rp=require(_0xd1d5('0x4'));var moment=require('moment');var BPromise=require(_0xd1d5('0x5'));var Mustache=require(_0xd1d5('0x6'));var util=require(_0xd1d5('0x7'));var path=require(_0xd1d5('0x8'));var sox=require(_0xd1d5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1d5('0xa'));var _=require(_0xd1d5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd1d5('0xc'));var toCsv=require(_0xd1d5('0xd'));var querystring=require(_0xd1d5('0xe'));var Papa=require(_0xd1d5('0xf'));var Redis=require('ioredis');var authService=require(_0xd1d5('0x10'));var qs=require(_0xd1d5('0x11'));var as=require(_0xd1d5('0x12'));var hardwareService=require(_0xd1d5('0x13'));var logger=require(_0xd1d5('0x14'))(_0xd1d5('0x15'));var utils=require(_0xd1d5('0x16'));var config=require(_0xd1d5('0x17'));var licenseUtil=require(_0xd1d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf03c1c,_0x1e161c){_0x1e161c=_0x1e161c||0xcc;return function(_0x22a643){if(_0x22a643){return _0xf03c1c[_0xd1d5('0x19')](_0x1e161c);}return _0xf03c1c[_0xd1d5('0x1a')](_0x1e161c)[_0xd1d5('0x1b')]();};}function respondWithResult(_0x30d233,_0x10182e){_0x10182e=_0x10182e||0xc8;return function(_0x477a91){if(_0x477a91){return _0x30d233['status'](_0x10182e)[_0xd1d5('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x25cb79,_0x14c90c){return function(_0x42e81c){if(_0x42e81c){var _0x355a2d=typeof _0x14c90c['offset']===_0xd1d5('0x1d')&&typeof _0x14c90c[_0xd1d5('0x1e')]==='undefined';var _0x253744=_0x42e81c[_0xd1d5('0x1f')];var _0x2ea8df=_0x355a2d?0x0:_0x14c90c[_0xd1d5('0x20')];var _0x37be67=_0x355a2d?_0x42e81c[_0xd1d5('0x1f')]:_0x14c90c[_0xd1d5('0x20')]+_0x14c90c[_0xd1d5('0x1e')];var _0x36ac47;if(_0x37be67>=_0x253744){_0x37be67=_0x253744;_0x36ac47=0xc8;}else{_0x36ac47=0xce;}_0x25cb79[_0xd1d5('0x1a')](_0x36ac47);return _0x25cb79[_0xd1d5('0x21')](_0xd1d5('0x22'),_0x2ea8df+'-'+_0x37be67+'/'+_0x253744)[_0xd1d5('0x1c')](_0x42e81c);}return null;};}function patchUpdates(_0x5e8a09){return function(_0x41da13){try{jsonpatch[_0xd1d5('0x23')](_0x41da13,_0x5e8a09,!![]);}catch(_0x4741da){return BPromise[_0xd1d5('0x24')](_0x4741da);}return _0x41da13[_0xd1d5('0x25')]();};}function saveUpdates(_0x41227a,_0x282fd3){return function(_0x1a84a9){if(_0x1a84a9){return _0x1a84a9[_0xd1d5('0x26')](_0x41227a)[_0xd1d5('0x27')](function(_0x5b00f9){return _0x5b00f9;});}return null;};}function removeEntity(_0xfe6ad7,_0x58c72e){return function(_0x3e585f){if(_0x3e585f){return _0x3e585f['destroy']()[_0xd1d5('0x27')](function(){_0xfe6ad7['status'](0xcc)[_0xd1d5('0x1b')]();});}};}function handleEntityNotFound(_0x212e62,_0x16a06c){return function(_0x48ee09){if(!_0x48ee09){_0x212e62[_0xd1d5('0x19')](0x194);}return _0x48ee09;};}function handleError(_0x69ad47,_0x4fba56){_0x4fba56=_0x4fba56||0x1f4;return function(_0xedf0ee){logger[_0xd1d5('0x28')](_0xedf0ee[_0xd1d5('0x29')]);if(_0xedf0ee[_0xd1d5('0x2a')]){delete _0xedf0ee[_0xd1d5('0x2a')];}_0x69ad47[_0xd1d5('0x1a')](_0x4fba56)['send'](_0xedf0ee);};}exports['index']=function(_0x7145b,_0x144587){var _0x54a189={},_0x431a93={},_0x43cc8a={'count':0x0,'rows':[]};var _0x13e768=_['map'](db['VoiceTransferReport'][_0xd1d5('0x2b')],function(_0x3cc339){return{'name':_0x3cc339[_0xd1d5('0x2c')],'type':_0x3cc339[_0xd1d5('0x2d')][_0xd1d5('0x2e')]};});_0x431a93[_0xd1d5('0x2f')]=_[_0xd1d5('0x30')](_0x13e768,_0xd1d5('0x2a'));_0x431a93[_0xd1d5('0x31')]=_['keys'](_0x7145b[_0xd1d5('0x31')]);_0x431a93[_0xd1d5('0x32')]=_[_0xd1d5('0x33')](_0x431a93['model'],_0x431a93[_0xd1d5('0x31')]);_0x54a189['attributes']=_[_0xd1d5('0x33')](_0x431a93[_0xd1d5('0x2f')],qs['fields'](_0x7145b['query'][_0xd1d5('0x34')]));_0x54a189[_0xd1d5('0x35')]=_0x54a189['attributes']['length']?_0x54a189[_0xd1d5('0x35')]:_0x431a93[_0xd1d5('0x2f')];if(!_0x7145b['query']['hasOwnProperty'](_0xd1d5('0x36'))){_0x54a189[_0xd1d5('0x1e')]=qs[_0xd1d5('0x1e')](_0x7145b[_0xd1d5('0x31')][_0xd1d5('0x1e')]);_0x54a189['offset']=qs[_0xd1d5('0x20')](_0x7145b['query'][_0xd1d5('0x20')]);}_0x54a189[_0xd1d5('0x37')]=qs['sort'](_0x7145b['query'][_0xd1d5('0x38')]);_0x54a189[_0xd1d5('0x39')]=qs['filters'](_[_0xd1d5('0x3a')](_0x7145b[_0xd1d5('0x31')],_0x431a93['filters']),_0x13e768);if(_0x7145b['query'][_0xd1d5('0x3b')]){_0x54a189[_0xd1d5('0x39')]=_['merge'](_0x54a189[_0xd1d5('0x39')],{'$or':_[_0xd1d5('0x30')](_0x13e768,function(_0x1b1682){if(_0x1b1682[_0xd1d5('0x2d')]!==_0xd1d5('0x3c')){var _0x399477={};_0x399477[_0x1b1682[_0xd1d5('0x2a')]]={'$like':'%'+_0x7145b[_0xd1d5('0x31')][_0xd1d5('0x3b')]+'%'};return _0x399477;}})});}_0x54a189=_[_0xd1d5('0x3d')]({},_0x54a189,_0x7145b[_0xd1d5('0x3e')]);var _0x4ba0fa={'where':_0x54a189['where']};return db['VoiceTransferReport']['count'](_0x4ba0fa)['then'](function(_0x288a50){_0x43cc8a[_0xd1d5('0x1f')]=_0x288a50;if(_0x7145b[_0xd1d5('0x31')][_0xd1d5('0x3f')]){_0x54a189[_0xd1d5('0x40')]=[{'all':!![]}];}return db[_0xd1d5('0x41')][_0xd1d5('0x42')](_0x54a189);})[_0xd1d5('0x27')](function(_0x21b4c4){_0x43cc8a[_0xd1d5('0x43')]=_0x21b4c4;return _0x43cc8a;})[_0xd1d5('0x27')](respondWithFilteredResult(_0x144587,_0x54a189))[_0xd1d5('0x44')](handleError(_0x144587,null));};exports[_0xd1d5('0x45')]=function(_0x86697b,_0x2085f2){var _0x15d796={'raw':!![],'where':{'id':_0x86697b['params']['id']}},_0xe9d63c={};_0xe9d63c[_0xd1d5('0x2f')]=_[_0xd1d5('0x46')](db[_0xd1d5('0x41')]['rawAttributes']);_0xe9d63c[_0xd1d5('0x31')]=_[_0xd1d5('0x46')](_0x86697b[_0xd1d5('0x31')]);_0xe9d63c['filters']=_['intersection'](_0xe9d63c[_0xd1d5('0x2f')],_0xe9d63c[_0xd1d5('0x31')]);_0x15d796[_0xd1d5('0x35')]=_[_0xd1d5('0x33')](_0xe9d63c[_0xd1d5('0x2f')],qs[_0xd1d5('0x34')](_0x86697b[_0xd1d5('0x31')][_0xd1d5('0x34')]));_0x15d796['attributes']=_0x15d796[_0xd1d5('0x35')]['length']?_0x15d796[_0xd1d5('0x35')]:_0xe9d63c[_0xd1d5('0x2f')];if(_0x86697b[_0xd1d5('0x31')][_0xd1d5('0x3f')]){_0x15d796[_0xd1d5('0x40')]=[{'all':!![]}];}_0x15d796=_['merge']({},_0x15d796,_0x86697b[_0xd1d5('0x3e')]);return db[_0xd1d5('0x41')][_0xd1d5('0x47')](_0x15d796)[_0xd1d5('0x27')](handleEntityNotFound(_0x2085f2,null))[_0xd1d5('0x27')](respondWithResult(_0x2085f2,null))[_0xd1d5('0x44')](handleError(_0x2085f2,null));};exports['create']=function(_0x454dd0,_0x4002fb){return db[_0xd1d5('0x41')]['create'](_0x454dd0[_0xd1d5('0x48')],{})['then'](respondWithResult(_0x4002fb,0xc9))[_0xd1d5('0x44')](handleError(_0x4002fb,null));};exports['update']=function(_0x1728a4,_0x4a946b){if(_0x1728a4[_0xd1d5('0x48')]['id']){delete _0x1728a4[_0xd1d5('0x48')]['id'];}return db['VoiceTransferReport'][_0xd1d5('0x47')]({'where':{'id':_0x1728a4['params']['id']}})[_0xd1d5('0x27')](handleEntityNotFound(_0x4a946b,null))['then'](saveUpdates(_0x1728a4[_0xd1d5('0x48')],null))['then'](respondWithResult(_0x4a946b,null))[_0xd1d5('0x44')](handleError(_0x4a946b,null));};exports['destroy']=function(_0x2ae6bc,_0x29facd){return db[_0xd1d5('0x41')][_0xd1d5('0x47')]({'where':{'id':_0x2ae6bc[_0xd1d5('0x49')]['id']}})[_0xd1d5('0x27')](handleEntityNotFound(_0x29facd,null))['then'](removeEntity(_0x29facd,null))[_0xd1d5('0x44')](handleError(_0x29facd,null));};exports[_0xd1d5('0x4a')]=function(_0x69eb80,_0x551d2){return db['VoiceTransferReport']['describe']()[_0xd1d5('0x27')](respondWithResult(_0x551d2,null))[_0xd1d5('0x44')](handleError(_0x551d2,null));}; \ No newline at end of file +var _0xdf40=['includeAll','findAll','rows','catch','show','params','keys','intersection','create','update','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0xca6f81,_0x50c7ce){var _0x372806=function(_0x113800){while(--_0x113800){_0xca6f81['push'](_0xca6f81['shift']());}};_0x372806(++_0x50c7ce);}(_0xdf40,0x18e));var _0x0df4=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0xdf40[_0x4fe19c];return _0x952ac7;};'use strict';var emlformat=require(_0x0df4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0df4('0x1'));var jsonpatch=require(_0x0df4('0x2'));var rp=require(_0x0df4('0x3'));var moment=require(_0x0df4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0df4('0x5'));var util=require(_0x0df4('0x6'));var path=require(_0x0df4('0x7'));var sox=require(_0x0df4('0x8'));var csv=require(_0x0df4('0x9'));var ejs=require(_0x0df4('0xa'));var fs=require('fs');var fs_extra=require(_0x0df4('0xb'));var _=require(_0x0df4('0xc'));var squel=require(_0x0df4('0xd'));var crypto=require(_0x0df4('0xe'));var jsforce=require(_0x0df4('0xf'));var deskjs=require(_0x0df4('0x10'));var toCsv=require(_0x0df4('0x9'));var querystring=require('querystring');var Papa=require(_0x0df4('0x11'));var Redis=require(_0x0df4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0df4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0df4('0x14'))(_0x0df4('0x15'));var utils=require(_0x0df4('0x16'));var config=require(_0x0df4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0df4('0x18'))['db'];function respondWithStatusCode(_0x51d939,_0x447c25){_0x447c25=_0x447c25||0xcc;return function(_0x47dfd2){if(_0x47dfd2){return _0x51d939[_0x0df4('0x19')](_0x447c25);}return _0x51d939[_0x0df4('0x1a')](_0x447c25)[_0x0df4('0x1b')]();};}function respondWithResult(_0x1ce0f9,_0x2b0dd2){_0x2b0dd2=_0x2b0dd2||0xc8;return function(_0x3532d1){if(_0x3532d1){return _0x1ce0f9[_0x0df4('0x1a')](_0x2b0dd2)[_0x0df4('0x1c')](_0x3532d1);}};}function respondWithFilteredResult(_0x3668da,_0x136850){return function(_0x4fb777){if(_0x4fb777){var _0xf60649=typeof _0x136850[_0x0df4('0x1d')]===_0x0df4('0x1e')&&typeof _0x136850[_0x0df4('0x1f')]===_0x0df4('0x1e');var _0x4d2741=_0x4fb777[_0x0df4('0x20')];var _0x2d0127=_0xf60649?0x0:_0x136850[_0x0df4('0x1d')];var _0x243ab8=_0xf60649?_0x4fb777['count']:_0x136850['offset']+_0x136850[_0x0df4('0x1f')];var _0x4c425a;if(_0x243ab8>=_0x4d2741){_0x243ab8=_0x4d2741;_0x4c425a=0xc8;}else{_0x4c425a=0xce;}_0x3668da[_0x0df4('0x1a')](_0x4c425a);return _0x3668da[_0x0df4('0x21')](_0x0df4('0x22'),_0x2d0127+'-'+_0x243ab8+'/'+_0x4d2741)['json'](_0x4fb777);}return null;};}function patchUpdates(_0x71b7d9){return function(_0xd2fd22){try{jsonpatch[_0x0df4('0x23')](_0xd2fd22,_0x71b7d9,!![]);}catch(_0x3ed0e6){return BPromise[_0x0df4('0x24')](_0x3ed0e6);}return _0xd2fd22['save']();};}function saveUpdates(_0x5720ad,_0x758382){return function(_0x36410){if(_0x36410){return _0x36410['update'](_0x5720ad)[_0x0df4('0x25')](function(_0x1cb8bd){return _0x1cb8bd;});}return null;};}function removeEntity(_0x256e6c,_0x2e533f){return function(_0x131f71){if(_0x131f71){return _0x131f71['destroy']()[_0x0df4('0x25')](function(){_0x256e6c[_0x0df4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25222c,_0x4f5e29){return function(_0x5cda45){if(!_0x5cda45){_0x25222c['sendStatus'](0x194);}return _0x5cda45;};}function handleError(_0x63e34b,_0x44a780){_0x44a780=_0x44a780||0x1f4;return function(_0x1ff2b7){logger[_0x0df4('0x26')](_0x1ff2b7[_0x0df4('0x27')]);if(_0x1ff2b7['name']){delete _0x1ff2b7[_0x0df4('0x28')];}_0x63e34b['status'](_0x44a780)[_0x0df4('0x29')](_0x1ff2b7);};}exports[_0x0df4('0x2a')]=function(_0xf8fb11,_0x3b7b7a){var _0x4f7a78={},_0x237ed0={},_0x3b5493={'count':0x0,'rows':[]};var _0xa64198=_[_0x0df4('0x2b')](db[_0x0df4('0x2c')][_0x0df4('0x2d')],function(_0x5a8e03){return{'name':_0x5a8e03[_0x0df4('0x2e')],'type':_0x5a8e03[_0x0df4('0x2f')][_0x0df4('0x30')]};});_0x237ed0[_0x0df4('0x31')]=_[_0x0df4('0x2b')](_0xa64198,'name');_0x237ed0[_0x0df4('0x32')]=_['keys'](_0xf8fb11[_0x0df4('0x32')]);_0x237ed0[_0x0df4('0x33')]=_['intersection'](_0x237ed0[_0x0df4('0x31')],_0x237ed0[_0x0df4('0x32')]);_0x4f7a78['attributes']=_['intersection'](_0x237ed0[_0x0df4('0x31')],qs[_0x0df4('0x34')](_0xf8fb11[_0x0df4('0x32')]['fields']));_0x4f7a78[_0x0df4('0x35')]=_0x4f7a78[_0x0df4('0x35')][_0x0df4('0x36')]?_0x4f7a78['attributes']:_0x237ed0[_0x0df4('0x31')];if(!_0xf8fb11[_0x0df4('0x32')][_0x0df4('0x37')]('nolimit')){_0x4f7a78[_0x0df4('0x1f')]=qs[_0x0df4('0x1f')](_0xf8fb11[_0x0df4('0x32')][_0x0df4('0x1f')]);_0x4f7a78['offset']=qs[_0x0df4('0x1d')](_0xf8fb11['query'][_0x0df4('0x1d')]);}_0x4f7a78[_0x0df4('0x38')]=qs[_0x0df4('0x39')](_0xf8fb11[_0x0df4('0x32')]['sort']);_0x4f7a78[_0x0df4('0x3a')]=qs[_0x0df4('0x33')](_[_0x0df4('0x3b')](_0xf8fb11[_0x0df4('0x32')],_0x237ed0[_0x0df4('0x33')]),_0xa64198);if(_0xf8fb11[_0x0df4('0x32')]['filter']){_0x4f7a78[_0x0df4('0x3a')]=_['merge'](_0x4f7a78[_0x0df4('0x3a')],{'$or':_[_0x0df4('0x2b')](_0xa64198,function(_0x56f459){if(_0x56f459['type']!==_0x0df4('0x3c')){var _0xb39137={};_0xb39137[_0x56f459[_0x0df4('0x28')]]={'$like':'%'+_0xf8fb11[_0x0df4('0x32')][_0x0df4('0x3d')]+'%'};return _0xb39137;}})});}_0x4f7a78=_[_0x0df4('0x3e')]({},_0x4f7a78,_0xf8fb11[_0x0df4('0x3f')]);var _0x3be2df={'where':_0x4f7a78[_0x0df4('0x3a')]};return db[_0x0df4('0x2c')]['count'](_0x3be2df)[_0x0df4('0x25')](function(_0x488504){_0x3b5493[_0x0df4('0x20')]=_0x488504;if(_0xf8fb11[_0x0df4('0x32')][_0x0df4('0x40')]){_0x4f7a78['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0df4('0x41')](_0x4f7a78);})[_0x0df4('0x25')](function(_0x248e0d){_0x3b5493[_0x0df4('0x42')]=_0x248e0d;return _0x3b5493;})[_0x0df4('0x25')](respondWithFilteredResult(_0x3b7b7a,_0x4f7a78))[_0x0df4('0x43')](handleError(_0x3b7b7a,null));};exports[_0x0df4('0x44')]=function(_0x36d05f,_0x1cba60){var _0x436943={'raw':!![],'where':{'id':_0x36d05f[_0x0df4('0x45')]['id']}},_0x558a6e={};_0x558a6e[_0x0df4('0x31')]=_['keys'](db[_0x0df4('0x2c')][_0x0df4('0x2d')]);_0x558a6e[_0x0df4('0x32')]=_[_0x0df4('0x46')](_0x36d05f['query']);_0x558a6e[_0x0df4('0x33')]=_[_0x0df4('0x47')](_0x558a6e[_0x0df4('0x31')],_0x558a6e[_0x0df4('0x32')]);_0x436943[_0x0df4('0x35')]=_[_0x0df4('0x47')](_0x558a6e['model'],qs['fields'](_0x36d05f[_0x0df4('0x32')][_0x0df4('0x34')]));_0x436943['attributes']=_0x436943['attributes'][_0x0df4('0x36')]?_0x436943[_0x0df4('0x35')]:_0x558a6e[_0x0df4('0x31')];if(_0x36d05f['query'][_0x0df4('0x40')]){_0x436943['include']=[{'all':!![]}];}_0x436943=_[_0x0df4('0x3e')]({},_0x436943,_0x36d05f[_0x0df4('0x3f')]);return db[_0x0df4('0x2c')]['find'](_0x436943)[_0x0df4('0x25')](handleEntityNotFound(_0x1cba60,null))['then'](respondWithResult(_0x1cba60,null))['catch'](handleError(_0x1cba60,null));};exports[_0x0df4('0x48')]=function(_0x49894,_0x16bb17){return db[_0x0df4('0x2c')][_0x0df4('0x48')](_0x49894['body'],{})['then'](respondWithResult(_0x16bb17,0xc9))[_0x0df4('0x43')](handleError(_0x16bb17,null));};exports[_0x0df4('0x49')]=function(_0x224d0e,_0x46e2fb){if(_0x224d0e['body']['id']){delete _0x224d0e[_0x0df4('0x4a')]['id'];}return db[_0x0df4('0x2c')][_0x0df4('0x4b')]({'where':{'id':_0x224d0e[_0x0df4('0x45')]['id']}})[_0x0df4('0x25')](handleEntityNotFound(_0x46e2fb,null))[_0x0df4('0x25')](saveUpdates(_0x224d0e[_0x0df4('0x4a')],null))[_0x0df4('0x25')](respondWithResult(_0x46e2fb,null))['catch'](handleError(_0x46e2fb,null));};exports[_0x0df4('0x4c')]=function(_0x326f87,_0x42addb){return db[_0x0df4('0x2c')][_0x0df4('0x4b')]({'where':{'id':_0x326f87[_0x0df4('0x45')]['id']}})[_0x0df4('0x25')](handleEntityNotFound(_0x42addb,null))[_0x0df4('0x25')](removeEntity(_0x42addb,null))[_0x0df4('0x43')](handleError(_0x42addb,null));};exports['describe']=function(_0x1fc87e,_0x2828b6){return db[_0x0df4('0x2c')]['describe']()[_0x0df4('0x25')](respondWithResult(_0x2828b6,null))[_0x0df4('0x43')](handleError(_0x2828b6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index aa10746..b5b373f 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 _0x1e1f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash'];(function(_0x5b11e0,_0x48afdf){var _0x40256b=function(_0x565609){while(--_0x565609){_0x5b11e0['push'](_0x5b11e0['shift']());}};_0x40256b(++_0x48afdf);}(_0x1e1f,0x15e));var _0xf1e1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1e1f[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xf1e1('0x0'));var util=require(_0xf1e1('0x1'));var logger=require(_0xf1e1('0x2'))(_0xf1e1('0x3'));var moment=require(_0xf1e1('0x4'));var BPromise=require(_0xf1e1('0x5'));var rp=require(_0xf1e1('0x6'));var fs=require('fs');var path=require(_0xf1e1('0x7'));var rimraf=require(_0xf1e1('0x8'));var config=require(_0xf1e1('0x9'));var attributes=require(_0xf1e1('0xa'));module[_0xf1e1('0xb')]=function(_0x5329c3,_0x13c031){return _0x5329c3[_0xf1e1('0xc')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x865a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceTransferReport','util','../../config/logger'];(function(_0x12ff78,_0x36809c){var _0x16e69f=function(_0xa5a471){while(--_0xa5a471){_0x12ff78['push'](_0x12ff78['shift']());}};_0x16e69f(++_0x36809c);}(_0x865a,0x134));var _0xa865=function(_0x219284,_0x405a12){_0x219284=_0x219284-0x0;var _0x1ee003=_0x865a[_0x219284];return _0x1ee003;};'use strict';var _=require('lodash');var util=require(_0xa865('0x0'));var logger=require(_0xa865('0x1'))('api');var moment=require(_0xa865('0x2'));var BPromise=require(_0xa865('0x3'));var rp=require(_0xa865('0x4'));var fs=require('fs');var path=require(_0xa865('0x5'));var rimraf=require(_0xa865('0x6'));var config=require(_0xa865('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xa865('0x8')]=function(_0x3face1,_0xf8fb97){return _0x3face1['define'](_0xa865('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index b1f1578..5f83070 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 _0x5b7b=['error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0x5b7b,0x1a2));var _0xb5b7=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x5b7b[_0xe15270];return _0x1e813b;};'use strict';var _=require('lodash');var util=require(_0xb5b7('0x0'));var moment=require(_0xb5b7('0x1'));var BPromise=require(_0xb5b7('0x2'));var rs=require(_0xb5b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5b7('0x4'))['db'];var utils=require(_0xb5b7('0x5'));var logger=require(_0xb5b7('0x6'))(_0xb5b7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb5b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x109e38,_0x11c15b,_0x3a7c8b){return new BPromise(function(_0x40a39e,_0x4b8c9b){return client[_0xb5b7('0x9')](_0x109e38,_0x3a7c8b)['then'](function(_0x206c2a){logger[_0xb5b7('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x11c15b,_0xb5b7('0xb'));logger['debug'](_0xb5b7('0xc'),_0x11c15b,_0xb5b7('0xb'),JSON[_0xb5b7('0xd')](_0x206c2a));if(_0x206c2a[_0xb5b7('0xe')]){if(_0x206c2a['error'][_0xb5b7('0xf')]===0x1f4){logger['error'](_0xb5b7('0x10'),_0x11c15b,_0x206c2a[_0xb5b7('0xe')][_0xb5b7('0x11')]);return _0x4b8c9b(_0x206c2a[_0xb5b7('0xe')][_0xb5b7('0x11')]);}logger[_0xb5b7('0xe')](_0xb5b7('0x10'),_0x11c15b,_0x206c2a[_0xb5b7('0xe')][_0xb5b7('0x11')]);return _0x40a39e(_0x206c2a[_0xb5b7('0xe')][_0xb5b7('0x11')]);}else{logger[_0xb5b7('0xa')](_0xb5b7('0x10'),_0x11c15b,'request\x20sent');_0x40a39e(_0x206c2a[_0xb5b7('0x12')][_0xb5b7('0x11')]);}})[_0xb5b7('0x13')](function(_0x92d097){logger[_0xb5b7('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x11c15b,_0x92d097);_0x4b8c9b(_0x92d097);});});}exports[_0xb5b7('0x14')]=function(_0x3c139a){var _0x15bfed=this;return new Promise(function(_0x5b1fed,_0x57cd68){return db[_0xb5b7('0x15')][_0xb5b7('0x16')](_0x3c139a['body'],{'raw':_0x3c139a['options']?_0x3c139a[_0xb5b7('0x17')][_0xb5b7('0x18')]===undefined?!![]:![]:!![]})[_0xb5b7('0x19')](function(_0x2be758){logger[_0xb5b7('0xa')](_0xb5b7('0x14'),_0x3c139a);logger[_0xb5b7('0x1a')]('CreateVoiceTransferReport',_0x3c139a,JSON['stringify'](_0x2be758));_0x5b1fed(_0x2be758);})[_0xb5b7('0x13')](function(_0x533b32){logger[_0xb5b7('0xe')]('CreateVoiceTransferReport',_0x533b32[_0xb5b7('0x11')],_0x3c139a);_0x57cd68(_0x15bfed['error'](0x1f4,_0x533b32[_0xb5b7('0x11')]));});});}; \ No newline at end of file +var _0x0781=['message','result','catch','CreateVoiceTransferReport','create','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x201f73,_0x17489c){var _0x24516d=function(_0x347913){while(--_0x347913){_0x201f73['push'](_0x201f73['shift']());}};_0x24516d(++_0x17489c);}(_0x0781,0x13b));var _0x1078=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0781[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1078('0x0'));var util=require(_0x1078('0x1'));var moment=require(_0x1078('0x2'));var BPromise=require('bluebird');var rs=require(_0x1078('0x3'));var fs=require('fs');var Redis=require(_0x1078('0x4'));var db=require(_0x1078('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1078('0x6'))(_0x1078('0x7'));var config=require(_0x1078('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1078('0x9')][_0x1078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448bc4,_0x1f5aca,_0x326f7b){return new BPromise(function(_0x3c6318,_0x3f5ee6){return client[_0x1078('0xb')](_0x448bc4,_0x326f7b)[_0x1078('0xc')](function(_0x3360d9){logger[_0x1078('0xd')](_0x1078('0xe'),_0x1f5aca,_0x1078('0xf'));logger[_0x1078('0x10')](_0x1078('0x11'),_0x1f5aca,_0x1078('0xf'),JSON[_0x1078('0x12')](_0x3360d9));if(_0x3360d9[_0x1078('0x13')]){if(_0x3360d9[_0x1078('0x13')][_0x1078('0x14')]===0x1f4){logger['error'](_0x1078('0xe'),_0x1f5aca,_0x3360d9['error']['message']);return _0x3f5ee6(_0x3360d9[_0x1078('0x13')][_0x1078('0x15')]);}logger['error'](_0x1078('0xe'),_0x1f5aca,_0x3360d9['error'][_0x1078('0x15')]);return _0x3c6318(_0x3360d9[_0x1078('0x13')]['message']);}else{logger[_0x1078('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x1f5aca,_0x1078('0xf'));_0x3c6318(_0x3360d9[_0x1078('0x16')][_0x1078('0x15')]);}})[_0x1078('0x17')](function(_0x375167){logger[_0x1078('0x13')](_0x1078('0xe'),_0x1f5aca,_0x375167);_0x3f5ee6(_0x375167);});});}exports[_0x1078('0x18')]=function(_0xe4f792){var _0x1bfdae=this;return new Promise(function(_0x263e72,_0x243abb){return db['VoiceTransferReport'][_0x1078('0x19')](_0xe4f792[_0x1078('0x1a')],{'raw':_0xe4f792[_0x1078('0x1b')]?_0xe4f792[_0x1078('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1078('0xc')](function(_0x57964d){logger[_0x1078('0xd')](_0x1078('0x18'),_0xe4f792);logger['debug'](_0x1078('0x18'),_0xe4f792,JSON['stringify'](_0x57964d));_0x263e72(_0x57964d);})[_0x1078('0x17')](function(_0x22577b){logger[_0x1078('0x13')]('CreateVoiceTransferReport',_0x22577b[_0x1078('0x15')],_0xe4f792);_0x243abb(_0x1bfdae[_0x1078('0x13')](0x1f4,_0x22577b[_0x1078('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ab3c795..de4bf09 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 _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x22152e,_0x2b7d4b){var _0x3d8dbe=function(_0x5ac4ec){while(--_0x5ac4ec){_0x22152e['push'](_0x22152e['shift']());}};_0x3d8dbe(++_0x2b7d4b);}(_0xf109,0xce));var _0x9f10=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xf109[_0x4ed520];return _0x4415a6;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file +var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x28cfef,_0x434a62){var _0x120cf1=function(_0x54ee6d){while(--_0x54ee6d){_0x28cfef['push'](_0x28cfef['shift']());}};_0x120cf1(++_0x434a62);}(_0xaa88,0x137));var _0x8aa8=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0xaa88[_0x35e92e];return _0x1205a8;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 1c93ade..54854e1 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 _0xb332=['../../config/environment','bluebird','client','../../config/logger','ioredis','redis','defaults','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','stack','name','send','status','NotFound','request','then','error','code','message','result','User','agent','VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','json','originate\x20executed!','hangup\x20fired:','user:%s','catch','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','path','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb332,0xd9));var _0x2b33=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xb332[_0x41cfd4];return _0x190f48;};'use strict';var path=require(_0x2b33('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x2b33('0x1'))['db'];var config=require(_0x2b33('0x2'));var util=require('util');var BPromise=require(_0x2b33('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x2b33('0x4')]['http']({'port':0x232a});var logger=require(_0x2b33('0x5'))('webbarapi');var Redis=require(_0x2b33('0x6'));config[_0x2b33('0x7')]=_[_0x2b33('0x8')](config[_0x2b33('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2b33('0x7')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]},'callNumber':{'type':_0x2b33('0xb'),'required':[!![],_0x2b33('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x2b33('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]},'sessionId':{'type':_0x2b33('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]},'sessionId':{'type':_0x2b33('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]},'sessionId':{'type':_0x2b33('0xb'),'required':[!![],_0x2b33('0xd')]},'transferNumber':{'type':'string','required':[!![],_0x2b33('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2b33('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2b33('0x9'),'required':[!![],_0x2b33('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x1d8e75,_0x1d50d0,_0x409428){logger[_0x2b33('0xf')](_0x1d8e75,_0x1d50d0,JSON[_0x2b33('0x10')](_0x409428));io['to'](_0x1d8e75)['emit'](_0x1d50d0,_0x409428);}function handleError(_0x554ab3){return function(_0x59f0b6){console[_0x2b33('0x11')]('handleError:',_0x59f0b6,_0x59f0b6 instanceof RangeError);logger['error'](_0x59f0b6[_0x2b33('0x12')]);if(_0x59f0b6 instanceof RangeError){if(_0x59f0b6[_0x2b33('0x13')]){delete _0x59f0b6[_0x2b33('0x13')];}_0x554ab3['status'](0x194)[_0x2b33('0x14')](_0x59f0b6);}else{if(_0x59f0b6['name']){delete _0x59f0b6[_0x2b33('0x13')];}_0x554ab3[_0x2b33('0x15')](0x1f4)[_0x2b33('0x14')](_0x59f0b6);}};}function checkError(){return function(_0x2998dd){if(!_0x2998dd){throw new RangeError(_0x2b33('0x16'));}return _0x2998dd;};}function respondWithRpcPromise(_0x6d20b,_0x39567f){return new BPromise(function(_0x4fb725,_0x23024c){var _0x1d9c98=amiClient;return _0x1d9c98[_0x2b33('0x17')](_0x6d20b,_0x39567f)[_0x2b33('0x18')](function(_0x58998e){if(_0x58998e[_0x2b33('0x19')]){if(_0x58998e[_0x2b33('0x19')][_0x2b33('0x1a')]===0x1f4){return _0x23024c(_0x58998e['error'][_0x2b33('0x1b')]);}return _0x4fb725(_0x58998e[_0x2b33('0x19')][_0x2b33('0x1b')]);}else{_0x4fb725(_0x58998e[_0x2b33('0x1c')]);}})['catch'](function(_0x2ec9db){_0x23024c(_0x2ec9db);});});}function getAgent(_0x530098){return db[_0x2b33('0x1d')]['findOne']({'where':{'id':_0x530098,'role':_0x2b33('0x1e')}})[_0x2b33('0x18')](checkError());}function getAgentCheckSession(_0x5d8d05,_0x195aa2){return new BPromise(function(_0x53c2ad,_0x267969){var _0x5b16a8=respondWithRpcPromise(_0x2b33('0x1f'));var _0xa109f4=getAgent(_0x5d8d05);Promise[_0x2b33('0x20')]([_0x5b16a8,_0xa109f4])[_0x2b33('0x18')](function(_0xaa6643){var _0x312d4d=_0xaa6643[0x0];var _0x2be034=_0xaa6643[0x1];var _0x1fadc5=_[_0x2b33('0x21')](_0x312d4d[_0x2b33('0x22')],function(_0x4cf72f){return _0x4cf72f['UserId']==_0x2be034['id']&&_0x4cf72f[_0x2b33('0x23')]==_0x195aa2;});if(_0x1fadc5[_0x2b33('0x24')]==0x1){_0x53c2ad(_0x2be034);}else{_0x267969(new RangeError(_0x2b33('0x25')+_0x195aa2+_0x2b33('0x26')));}});});}exports[_0x2b33('0x27')]=function(_0x5893bc,_0x570765){logger[_0x2b33('0xf')](_0x2b33('0x28'),_0x5893bc[_0x2b33('0x29')]);var _0x1d2168=originateValidation[_0x2b33('0x2a')](_0x5893bc[_0x2b33('0x29')]);if(_0x1d2168['length']>0x0){return _0x570765[_0x2b33('0x15')](0x190)['json'](_0x1d2168);}var _0x370faf=_0x5893bc[_0x2b33('0x29')][_0x2b33('0x2b')];var _0x23ba3e=_0x5893bc[_0x2b33('0x29')][_0x2b33('0x2c')];var _0x2bfdda=_0x5893bc[_0x2b33('0x29')][_0x2b33('0x2d')];var _0x2b9af8=_0x5893bc[_0x2b33('0x29')][_0x2b33('0x2e')];return getAgent(_0x370faf)[_0x2b33('0x18')](function(_0x19e351){logger[_0x2b33('0xf')](_0x2b33('0x2f'),_0x19e351['name']);emit(util['format']('user:%s',_0x19e351[_0x2b33('0x13')]),_0x2b33('0x30'),{'callNumber':_0x23ba3e,'callerId':_0x2bfdda,'callbackUrl':_0x2b9af8});return _0x570765[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':_0x2b33('0x32')});})['catch'](handleError(_0x570765));};exports['hangup']=function(_0x1cfe5c,_0x4c3997){logger[_0x2b33('0xf')](_0x2b33('0x33'),_0x1cfe5c[_0x2b33('0x29')]);var _0xa638d6=hangupValidation[_0x2b33('0x2a')](_0x1cfe5c[_0x2b33('0x29')]);if(_0xa638d6[_0x2b33('0x24')]>0x0){return _0x4c3997[_0x2b33('0x15')](0x190)[_0x2b33('0x31')](_0xa638d6);}var _0x17bd1e=_0x1cfe5c['body'][_0x2b33('0x2b')];var _0x4661eb=_0x1cfe5c[_0x2b33('0x29')]['sessionId'];return getAgent(_0x17bd1e)['then'](function(_0x3afaa5){logger['info'](_0x2b33('0x2f'),_0x3afaa5[_0x2b33('0x13')]);emit(util['format'](_0x2b33('0x34'),_0x3afaa5[_0x2b33('0x13')]),'webbar:hangup',{'sessionId':_0x4661eb});return _0x4c3997[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':'hangup\x20executed!'});})[_0x2b33('0x35')](handleError(_0x4c3997));};exports[_0x2b33('0x36')]=function(_0x264e64,_0x49348c){logger[_0x2b33('0xf')](_0x2b33('0x37'),_0x264e64[_0x2b33('0x29')]);var _0x22f321=answerValidation[_0x2b33('0x2a')](_0x264e64['body']);if(_0x22f321[_0x2b33('0x24')]>0x0){return _0x49348c[_0x2b33('0x15')](0x190)[_0x2b33('0x31')](_0x22f321);}var _0x5ad3b2=_0x264e64[_0x2b33('0x29')][_0x2b33('0x2b')];var _0x3c61d6=_0x264e64[_0x2b33('0x29')]['sessionId'];return getAgent(_0x5ad3b2)[_0x2b33('0x18')](function(_0x416f3e){logger['info']('entityFound:',_0x416f3e['name']);emit(util[_0x2b33('0x38')]('user:%s',_0x416f3e[_0x2b33('0x13')]),_0x2b33('0x39'),{'sessionId':_0x3c61d6});return _0x49348c[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':_0x2b33('0x3a')});})[_0x2b33('0x35')](handleError(_0x49348c));};exports[_0x2b33('0x3b')]=function(_0x13bb23,_0x56224a){logger[_0x2b33('0xf')](_0x2b33('0x3c'),_0x13bb23[_0x2b33('0x29')]);var _0x83de95=holdValidation[_0x2b33('0x2a')](_0x13bb23[_0x2b33('0x29')]);if(_0x83de95['length']>0x0){return _0x56224a['status'](0x190)['json'](_0x83de95);}var _0x493123=_0x13bb23[_0x2b33('0x29')]['userId'];var _0x1c5019=_0x13bb23['body']['sessionId'];return getAgent(_0x493123)[_0x2b33('0x18')](function(_0xd15da9){logger[_0x2b33('0xf')]('entityFound:',_0xd15da9[_0x2b33('0x13')]);emit(util['format'](_0x2b33('0x34'),_0xd15da9[_0x2b33('0x13')]),_0x2b33('0x3d'),{'sessionId':_0x1c5019});return _0x56224a[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':_0x2b33('0x3e')});})['catch'](handleError(_0x56224a));};exports[_0x2b33('0x3f')]=function(_0x27f766,_0xc3fd2e){logger['info'](_0x2b33('0x40'),_0x27f766[_0x2b33('0x29')]);var _0x434f0f=unholdValidation['validate'](_0x27f766[_0x2b33('0x29')]);if(_0x434f0f['length']>0x0){return _0xc3fd2e['status'](0x190)[_0x2b33('0x31')](_0x434f0f);}var _0x108d9a=_0x27f766[_0x2b33('0x29')][_0x2b33('0x2b')];var _0x307370=_0x27f766[_0x2b33('0x29')][_0x2b33('0x23')];return getAgent(_0x108d9a)[_0x2b33('0x18')](function(_0x486f74){logger[_0x2b33('0xf')](_0x2b33('0x2f'),_0x486f74['name']);emit(util[_0x2b33('0x38')](_0x2b33('0x34'),_0x486f74['name']),_0x2b33('0x41'),{'sessionId':_0x307370});return _0xc3fd2e[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':_0x2b33('0x42')});})['catch'](handleError(_0xc3fd2e));};exports[_0x2b33('0x43')]=function(_0x1d55fd,_0x5528fe){logger[_0x2b33('0xf')](_0x2b33('0x44'),_0x5528fe[_0x2b33('0x29')]);var _0x26e0ca=callsValidation[_0x2b33('0x2a')](_0x1d55fd[_0x2b33('0x29')]);if(_0x26e0ca[_0x2b33('0x24')]>0x0){return _0x5528fe['status'](0x190)['json'](_0x26e0ca);}var _0x3b0877=_0x1d55fd[_0x2b33('0x29')]['userId'];var _0x3ba2c6=respondWithRpcPromise(_0x2b33('0x1f'));var _0x2b4d10=getAgent(_0x3b0877);return Promise['all']([_0x3ba2c6,_0x2b4d10])[_0x2b33('0x18')](function(_0x134c48){var _0x59aca5=_0x134c48[0x0];var _0x1af9a3=_0x134c48[0x1];var _0x464ac8=_[_0x2b33('0x21')](_0x59aca5[_0x2b33('0x22')],function(_0x150695){return _0x150695['UserId']==_0x1af9a3['id'];});return _0x5528fe['status'](0xc8)[_0x2b33('0x31')]({'count':_0x464ac8[_0x2b33('0x24')],'rows':_0x464ac8});})[_0x2b33('0x35')](handleError(_0x5528fe));};exports[_0x2b33('0x45')]=function(_0x280b85,_0x4e7971){logger['info'](_0x2b33('0x46'),_0x280b85[_0x2b33('0x29')]);var _0x2eafb2=conferenceValidation[_0x2b33('0x2a')](_0x280b85[_0x2b33('0x29')]);if(_0x2eafb2[_0x2b33('0x24')]>0x0){return _0x4e7971['status'](0x190)[_0x2b33('0x31')](_0x2eafb2);}var _0x2e0e12=_0x280b85[_0x2b33('0x29')][_0x2b33('0x2b')];return getAgent(_0x2e0e12)[_0x2b33('0x18')](function(_0x5c8246){logger[_0x2b33('0xf')](_0x2b33('0x2f'),_0x5c8246[_0x2b33('0x13')]);emit(util[_0x2b33('0x38')]('user:%s',_0x5c8246[_0x2b33('0x13')]),'webbar:conference');return _0x4e7971[_0x2b33('0x15')](0xc8)[_0x2b33('0x31')]({'error':![],'message':_0x2b33('0x47')});})[_0x2b33('0x35')](handleError(_0x4e7971));};exports[_0x2b33('0x48')]=function(_0x321940,_0x23fdb7){logger[_0x2b33('0xf')]('transfer\x20fired:',_0x321940[_0x2b33('0x29')]);var _0x22d518=transferValidation[_0x2b33('0x2a')](_0x321940[_0x2b33('0x29')]);if(_0x22d518[_0x2b33('0x24')]>0x0){return _0x23fdb7[_0x2b33('0x15')](0x190)[_0x2b33('0x31')](_0x22d518);}var _0x3305c5=_0x321940[_0x2b33('0x29')][_0x2b33('0x2b')];var _0xfd05df=_0x321940[_0x2b33('0x29')]['sessionId'];var _0x452cca=_0x321940['body']['transferNumber'];return getAgent(_0x3305c5)[_0x2b33('0x18')](function(_0x5404f8){logger[_0x2b33('0xf')]('entityFound:',_0x5404f8[_0x2b33('0x13')]);emit(util[_0x2b33('0x38')](_0x2b33('0x34'),_0x5404f8[_0x2b33('0x13')]),'webbar:transfer',{'sessionId':_0xfd05df,'transferNumber':_0x452cca});return _0x23fdb7['status'](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x23fdb7));}; \ No newline at end of file +var _0xf109=['message','result','catch','then','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','info','emit','log','error','name','send','status','NotFound','request'];(function(_0x3d28fa,_0x32ceef){var _0x9ea870=function(_0x4fcf76){while(--_0x4fcf76){_0x3d28fa['push'](_0x3d28fa['shift']());}};_0x9ea870(++_0x32ceef);}(_0xf109,0xce));var _0x9f10=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf109[_0x9c2427];return _0x51984f;};'use strict';var path=require(_0x9f10('0x0'));var fs=require('fs');var _=require(_0x9f10('0x1'));var db=require(_0x9f10('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x9f10('0x3'));var amiClient=jayson[_0x9f10('0x4')][_0x9f10('0x5')]({'port':0x232a});var logger=require(_0x9f10('0x6'))(_0x9f10('0x7'));var Redis=require(_0x9f10('0x8'));config[_0x9f10('0x9')]=_[_0x9f10('0xa')](config[_0x9f10('0x9')],{'host':_0x9f10('0xb'),'port':0x18eb});var io=require(_0x9f10('0xc'))(new Redis(config['redis']));var Schema=require(_0x9f10('0xd'));var originateValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'callNumber':{'type':_0x9f10('0x10'),'required':[!![],_0x9f10('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9f10('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9f10('0xf')]},'sessionId':{'type':_0x9f10('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9f10('0x10'),'required':[!![],_0x9f10('0x12')]},'transferNumber':{'type':_0x9f10('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],_0x9f10('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9f10('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9f10('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x11154b,_0x5ae255,_0x14d3fe){logger[_0x9f10('0x13')](_0x11154b,_0x5ae255,JSON['stringify'](_0x14d3fe));io['to'](_0x11154b)[_0x9f10('0x14')](_0x5ae255,_0x14d3fe);}function handleError(_0xd2950c){return function(_0x509fba){console[_0x9f10('0x15')]('handleError:',_0x509fba,_0x509fba instanceof RangeError);logger[_0x9f10('0x16')](_0x509fba['stack']);if(_0x509fba instanceof RangeError){if(_0x509fba[_0x9f10('0x17')]){delete _0x509fba['name'];}_0xd2950c['status'](0x194)[_0x9f10('0x18')](_0x509fba);}else{if(_0x509fba[_0x9f10('0x17')]){delete _0x509fba[_0x9f10('0x17')];}_0xd2950c[_0x9f10('0x19')](0x1f4)[_0x9f10('0x18')](_0x509fba);}};}function checkError(){return function(_0x332575){if(!_0x332575){throw new RangeError(_0x9f10('0x1a'));}return _0x332575;};}function respondWithRpcPromise(_0x4cdc00,_0x366044){return new BPromise(function(_0x58e6ba,_0x293990){var _0x36ace4=amiClient;return _0x36ace4[_0x9f10('0x1b')](_0x4cdc00,_0x366044)['then'](function(_0x2f31fb){if(_0x2f31fb[_0x9f10('0x16')]){if(_0x2f31fb[_0x9f10('0x16')]['code']===0x1f4){return _0x293990(_0x2f31fb[_0x9f10('0x16')][_0x9f10('0x1c')]);}return _0x58e6ba(_0x2f31fb[_0x9f10('0x16')]['message']);}else{_0x58e6ba(_0x2f31fb[_0x9f10('0x1d')]);}})[_0x9f10('0x1e')](function(_0x11cae7){_0x293990(_0x11cae7);});});}function getAgent(_0x1647c0){return db['User']['findOne']({'where':{'id':_0x1647c0,'role':'agent'}})[_0x9f10('0x1f')](checkError());}function getAgentCheckSession(_0x4a0407,_0x314794){return new BPromise(function(_0x1de75a,_0x45fffc){var _0x2ed95b=respondWithRpcPromise(_0x9f10('0x20'));var _0x4f6b0c=getAgent(_0x4a0407);Promise[_0x9f10('0x21')]([_0x2ed95b,_0x4f6b0c])[_0x9f10('0x1f')](function(_0x40f96b){var _0xfbb37f=_0x40f96b[0x0];var _0x181aec=_0x40f96b[0x1];var _0x2c4373=_['filter'](_0xfbb37f[_0x9f10('0x22')],function(_0x501ee){return _0x501ee[_0x9f10('0x23')]==_0x181aec['id']&&_0x501ee[_0x9f10('0x24')]==_0x314794;});if(_0x2c4373['length']==0x1){_0x1de75a(_0x181aec);}else{_0x45fffc(new RangeError(_0x9f10('0x25')+_0x314794+_0x9f10('0x26')));}});});}exports[_0x9f10('0x27')]=function(_0x5dd404,_0x434128){logger['info'](_0x9f10('0x28'),_0x5dd404[_0x9f10('0x29')]);var _0x13532b=originateValidation['validate'](_0x5dd404[_0x9f10('0x29')]);if(_0x13532b[_0x9f10('0x2a')]>0x0){return _0x434128[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x13532b);}var _0x148a5b=_0x5dd404['body'][_0x9f10('0x2c')];var _0x4b54b7=_0x5dd404[_0x9f10('0x29')][_0x9f10('0x2d')];var _0x1990da=_0x5dd404[_0x9f10('0x29')][_0x9f10('0x2e')];var _0x12c486=_0x5dd404['body'][_0x9f10('0x2f')];return getAgent(_0x148a5b)[_0x9f10('0x1f')](function(_0x1b8018){logger['info'](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x17')]);emit(util['format'](_0x9f10('0x31'),_0x1b8018['name']),_0x9f10('0x32'),{'callNumber':_0x4b54b7,'callerId':_0x1990da,'callbackUrl':_0x12c486});return _0x434128[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x33')});})[_0x9f10('0x1e')](handleError(_0x434128));};exports[_0x9f10('0x34')]=function(_0x12036c,_0x1db955){logger['info'](_0x9f10('0x35'),_0x12036c[_0x9f10('0x29')]);var _0x2fa4bf=hangupValidation['validate'](_0x12036c[_0x9f10('0x29')]);if(_0x2fa4bf[_0x9f10('0x2a')]>0x0){return _0x1db955['status'](0x190)[_0x9f10('0x2b')](_0x2fa4bf);}var _0x26f0ba=_0x12036c[_0x9f10('0x29')]['userId'];var _0x5c516c=_0x12036c[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x26f0ba)[_0x9f10('0x1f')](function(_0x433e70){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x433e70[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x433e70[_0x9f10('0x17')]),_0x9f10('0x37'),{'sessionId':_0x5c516c});return _0x1db955[_0x9f10('0x19')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x1db955));};exports[_0x9f10('0x38')]=function(_0x5c8c44,_0x420027){logger[_0x9f10('0x13')](_0x9f10('0x39'),_0x5c8c44['body']);var _0x3cfce6=answerValidation[_0x9f10('0xd')](_0x5c8c44[_0x9f10('0x29')]);if(_0x3cfce6[_0x9f10('0x2a')]>0x0){return _0x420027[_0x9f10('0x19')](0x190)['json'](_0x3cfce6);}var _0x578368=_0x5c8c44['body'][_0x9f10('0x2c')];var _0x5d08fb=_0x5c8c44[_0x9f10('0x29')]['sessionId'];return getAgent(_0x578368)[_0x9f10('0x1f')](function(_0x3e8d3c){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x3e8d3c['name']);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x3e8d3c['name']),_0x9f10('0x3a'),{'sessionId':_0x5d08fb});return _0x420027[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x3b')});})[_0x9f10('0x1e')](handleError(_0x420027));};exports[_0x9f10('0x3c')]=function(_0x4bedbe,_0x281da4){logger[_0x9f10('0x13')](_0x9f10('0x3d'),_0x4bedbe['body']);var _0x181eab=holdValidation[_0x9f10('0xd')](_0x4bedbe['body']);if(_0x181eab[_0x9f10('0x2a')]>0x0){return _0x281da4[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x181eab);}var _0x1807b3=_0x4bedbe['body'][_0x9f10('0x2c')];var _0x2ae710=_0x4bedbe[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x1807b3)[_0x9f10('0x1f')](function(_0x43cb31){logger['info'](_0x9f10('0x30'),_0x43cb31[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')](_0x9f10('0x31'),_0x43cb31[_0x9f10('0x17')]),_0x9f10('0x3e'),{'sessionId':_0x2ae710});return _0x281da4['status'](0xc8)[_0x9f10('0x2b')]({'error':![],'message':_0x9f10('0x3f')});})[_0x9f10('0x1e')](handleError(_0x281da4));};exports[_0x9f10('0x40')]=function(_0x39dae3,_0x15d676){logger[_0x9f10('0x13')](_0x9f10('0x41'),_0x39dae3['body']);var _0xd1da11=unholdValidation['validate'](_0x39dae3[_0x9f10('0x29')]);if(_0xd1da11['length']>0x0){return _0x15d676[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0xd1da11);}var _0x30fad9=_0x39dae3[_0x9f10('0x29')][_0x9f10('0x2c')];var _0x497260=_0x39dae3[_0x9f10('0x29')][_0x9f10('0x24')];return getAgent(_0x30fad9)[_0x9f10('0x1f')](function(_0x3818dc){logger['info']('entityFound:',_0x3818dc[_0x9f10('0x17')]);emit(util[_0x9f10('0x36')]('user:%s',_0x3818dc['name']),_0x9f10('0x42'),{'sessionId':_0x497260});return _0x15d676[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':'unhold\x20executed!'});})[_0x9f10('0x1e')](handleError(_0x15d676));};exports[_0x9f10('0x43')]=function(_0x7611e8,_0x4c3d18){logger[_0x9f10('0x13')](_0x9f10('0x44'),_0x4c3d18[_0x9f10('0x29')]);var _0x48a76e=callsValidation[_0x9f10('0xd')](_0x7611e8[_0x9f10('0x29')]);if(_0x48a76e['length']>0x0){return _0x4c3d18[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x48a76e);}var _0xcd8ae7=_0x7611e8[_0x9f10('0x29')][_0x9f10('0x2c')];var _0x55cb99=respondWithRpcPromise(_0x9f10('0x20'));var _0x53c384=getAgent(_0xcd8ae7);return Promise['all']([_0x55cb99,_0x53c384])[_0x9f10('0x1f')](function(_0x19b489){var _0x1f109a=_0x19b489[0x0];var _0x277a86=_0x19b489[0x1];var _0x2ed385=_[_0x9f10('0x45')](_0x1f109a[_0x9f10('0x22')],function(_0x4ef6c3){return _0x4ef6c3['UserId']==_0x277a86['id'];});return _0x4c3d18[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'count':_0x2ed385[_0x9f10('0x2a')],'rows':_0x2ed385});})[_0x9f10('0x1e')](handleError(_0x4c3d18));};exports[_0x9f10('0x46')]=function(_0x2094c9,_0x35460a){logger['info'](_0x9f10('0x47'),_0x2094c9[_0x9f10('0x29')]);var _0x5a777a=conferenceValidation[_0x9f10('0xd')](_0x2094c9[_0x9f10('0x29')]);if(_0x5a777a['length']>0x0){return _0x35460a[_0x9f10('0x19')](0x190)[_0x9f10('0x2b')](_0x5a777a);}var _0x58b3b4=_0x2094c9[_0x9f10('0x29')]['userId'];return getAgent(_0x58b3b4)[_0x9f10('0x1f')](function(_0x2325aa){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x2325aa[_0x9f10('0x17')]);emit(util['format'](_0x9f10('0x31'),_0x2325aa[_0x9f10('0x17')]),_0x9f10('0x48'));return _0x35460a['status'](0xc8)['json']({'error':![],'message':_0x9f10('0x49')});})[_0x9f10('0x1e')](handleError(_0x35460a));};exports[_0x9f10('0x4a')]=function(_0x20045f,_0xd627a2){logger[_0x9f10('0x13')](_0x9f10('0x4b'),_0x20045f['body']);var _0x3635f9=transferValidation[_0x9f10('0xd')](_0x20045f['body']);if(_0x3635f9[_0x9f10('0x2a')]>0x0){return _0xd627a2['status'](0x190)[_0x9f10('0x2b')](_0x3635f9);}var _0x354220=_0x20045f['body'][_0x9f10('0x2c')];var _0x4cbe80=_0x20045f[_0x9f10('0x29')][_0x9f10('0x24')];var _0x163165=_0x20045f['body'][_0x9f10('0x4c')];return getAgent(_0x354220)['then'](function(_0x2d704b){logger[_0x9f10('0x13')](_0x9f10('0x30'),_0x2d704b['name']);emit(util[_0x9f10('0x36')]('user:%s',_0x2d704b['name']),_0x9f10('0x4d'),{'sessionId':_0x4cbe80,'transferNumber':_0x163165});return _0xd627a2[_0x9f10('0x19')](0xc8)[_0x9f10('0x2b')]({'error':![],'message':'transfer\x20executed!'});})[_0x9f10('0x1e')](handleError(_0xd627a2));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index de9d7f6..b821580 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 _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x1580a9,_0x22f441){var _0x8c82ba=function(_0x40538d){while(--_0x40538d){_0x1580a9['push'](_0x1580a9['shift']());}};_0x8c82ba(++_0x22f441);}(_0x33af,0xec));var _0xf33a=function(_0x1f1a63,_0x3b5924){_0x1f1a63=_0x1f1a63-0x0;var _0x21492a=_0x33af[_0x1f1a63];return _0x21492a;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router; \ No newline at end of file +var _0x2542=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x15a57b,_0x415b25){var _0x4dd677=function(_0x23fdae){while(--_0x23fdae){_0x15a57b['push'](_0x15a57b['shift']());}};_0x4dd677(++_0x415b25);}(_0x2542,0x169));var _0x2254=function(_0x672e9b,_0x5667cb){_0x672e9b=_0x672e9b-0x0;var _0x57421a=_0x2542[_0x672e9b];return _0x57421a;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getAnswers']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x9')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['getApplications']);router[_0x2254('0x16')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x16')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x16')](_0x2254('0x12'),auth['isAuthenticated'](),controller[_0x2254('0x18')]);router['post'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x19')]);router[_0x2254('0x16')](_0x2254('0x15'),auth[_0x2254('0xc')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2254('0x1a')]);router[_0x2254('0x16')](_0x2254('0x1b'),auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);router[_0x2254('0x1d')]('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x1e')]);router[_0x2254('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2254('0x1f')](_0x2254('0x10'),auth[_0x2254('0xc')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x20')]);module[_0x2254('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3f7044c..9c17627 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 _0x0aa7=['twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM'];(function(_0x4eefe6,_0x2893c2){var _0x1819b9=function(_0x4e1f64){while(--_0x4e1f64){_0x4eefe6['push'](_0x4eefe6['shift']());}};_0x1819b9(++_0x2893c2);}(_0x0aa7,0x7b));var _0x70aa=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x0aa7[_0x35b18a];return _0x4db1bd;};'use strict';var Sequelize=require(_0x70aa('0x0'));var rs=require(_0x70aa('0x1'));module[_0x70aa('0x2')]={'name':{'type':Sequelize[_0x70aa('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x70aa('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x70aa('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x70aa('0x3')]},'type':{'type':Sequelize[_0x70aa('0x4')](_0x70aa('0x5'),_0x70aa('0x6'))},'accountSid':{'type':Sequelize[_0x70aa('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x70aa('0x3')]},'notificationTemplate':{'type':Sequelize[_0x70aa('0x7')],'defaultValue':function(){return _0x70aa('0x8');}},'notificationSound':{'type':Sequelize[_0x70aa('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x70aa('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x70aa('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x70aa('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x70aa('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x70aa('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x70aa('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x70aa('0xa')],'comment':_0x70aa('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x70aa('0x9')],'defaultValue':![],'comment':_0x70aa('0xc'),'set':function(_0x5c9ef1){if(!_0x5c9ef1){this[_0x70aa('0xd')](_0x70aa('0xe'),null);}this[_0x70aa('0xd')](_0x70aa('0xf'),_0x5c9ef1);}},'description':{'type':Sequelize[_0x70aa('0x3')]}}; \ No newline at end of file +var _0x3913=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3913,0x189));var _0x3391=function(_0x52c930,_0x1f4abc){_0x52c930=_0x52c930-0x0;var _0x6bfdfb=_0x3913[_0x52c930];return _0x6bfdfb;};'use strict';var Sequelize=require(_0x3391('0x0'));var rs=require(_0x3391('0x1'));module[_0x3391('0x2')]={'name':{'type':Sequelize[_0x3391('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x3391('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x3391('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x3391('0x3')]},'type':{'type':Sequelize[_0x3391('0x4')](_0x3391('0x5'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3391('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3391('0x6')],'defaultValue':function(){return _0x3391('0x7');}},'notificationSound':{'type':Sequelize[_0x3391('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3391('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3391('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3391('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3391('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3391('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3391('0x9')],'comment':_0x3391('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x3391('0x8')],'defaultValue':![],'comment':_0x3391('0xb'),'set':function(_0x316ef7){if(!_0x316ef7){this[_0x3391('0xc')](_0x3391('0xd'),null);}this[_0x3391('0xc')](_0x3391('0xe'),_0x316ef7);}},'description':{'type':Sequelize[_0x3391('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 69ef6bc..d9aa4fb 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 _0x4b1b=['jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','apply','reject','save','then','destroy','get','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','create','body','user','role','WhatsappAccounts','UserProfileSection','find','userProfileId','UserProfileResource','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','userWhatsappAccount:save','removeAgents','emit','userWhatsappAccount:remove','getAgents','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','asc','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','replace','whatsapp:','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','receiveMessage','entity\x20found','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register'];(function(_0x39f108,_0x2cdb80){var _0x443e86=function(_0x409e16){while(--_0x409e16){_0x39f108['push'](_0x39f108['shift']());}};_0x443e86(++_0x2cdb80);}(_0x4b1b,0xa8));var _0xb4b1=function(_0x38d73d,_0x187b15){_0x38d73d=_0x38d73d-0x0;var _0x303e68=_0x4b1b[_0x38d73d];return _0x303e68;};'use strict';var emlformat=require(_0xb4b1('0x0'));var rimraf=require(_0xb4b1('0x1'));var zipdir=require(_0xb4b1('0x2'));var jsonpatch=require(_0xb4b1('0x3'));var rp=require(_0xb4b1('0x4'));var moment=require(_0xb4b1('0x5'));var BPromise=require(_0xb4b1('0x6'));var Mustache=require('mustache');var util=require(_0xb4b1('0x7'));var path=require(_0xb4b1('0x8'));var sox=require(_0xb4b1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4b1('0xa'));var squel=require(_0xb4b1('0xb'));var crypto=require(_0xb4b1('0xc'));var jsforce=require(_0xb4b1('0xd'));var deskjs=require(_0xb4b1('0xe'));var toCsv=require(_0xb4b1('0xf'));var querystring=require('querystring');var Papa=require(_0xb4b1('0x10'));var Redis=require(_0xb4b1('0x11'));var authService=require(_0xb4b1('0x12'));var qs=require(_0xb4b1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4b1('0x14'));var logger=require(_0xb4b1('0x15'))(_0xb4b1('0x16'));var utils=require(_0xb4b1('0x17'));var config=require(_0xb4b1('0x18'));var licenseUtil=require(_0xb4b1('0x19'));var db=require(_0xb4b1('0x1a'))['db'];config[_0xb4b1('0x1b')]=_[_0xb4b1('0x1c')](config[_0xb4b1('0x1b')],{'host':_0xb4b1('0x1d'),'port':0x18eb});var socket=require(_0xb4b1('0x1e'))(new Redis(config[_0xb4b1('0x1b')]));require(_0xb4b1('0x1f'))[_0xb4b1('0x20')](socket);var jayson=require(_0xb4b1('0x21'));var client=jayson['client'][_0xb4b1('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x6ba909,_0x3ab4b6,_0x4645d1,_0x6872d5){return new BPromise(function(_0x3606b7,_0x137306){var _0x5882a5=_0x6872d5||client;return _0x5882a5[_0xb4b1('0x23')](_0x6ba909,_0x4645d1)['then'](function(_0x255072){logger[_0xb4b1('0x24')](_0xb4b1('0x25'),_0x3ab4b6,_0xb4b1('0x26'));logger[_0xb4b1('0x27')](_0xb4b1('0x28'),_0x3ab4b6,_0xb4b1('0x26'),JSON[_0xb4b1('0x29')](_0x255072));if(_0x255072[_0xb4b1('0x2a')]){if(_0x255072[_0xb4b1('0x2a')][_0xb4b1('0x2b')]===0x1f4){logger[_0xb4b1('0x2a')](_0xb4b1('0x25'),_0x3ab4b6,_0x255072[_0xb4b1('0x2a')][_0xb4b1('0x2c')]);return _0x137306(_0x255072['error']['message']);}logger[_0xb4b1('0x2a')](_0xb4b1('0x25'),_0x3ab4b6,_0x255072[_0xb4b1('0x2a')][_0xb4b1('0x2c')]);return _0x3606b7(_0x255072['error'][_0xb4b1('0x2c')]);}else{logger[_0xb4b1('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x3ab4b6,_0xb4b1('0x26'));_0x3606b7(_0x255072[_0xb4b1('0x2d')][_0xb4b1('0x2c')]);}})[_0xb4b1('0x2e')](function(_0x45cbab){logger[_0xb4b1('0x2a')]('WhatsappAccount,\x20%s,\x20%s',_0x3ab4b6,_0x45cbab);_0x137306(_0x45cbab);});});}function respondWithStatusCode(_0x35df1b,_0x55b4f9){_0x55b4f9=_0x55b4f9||0xcc;return function(_0x1a56ed){if(_0x1a56ed){return _0x35df1b['sendStatus'](_0x55b4f9);}return _0x35df1b[_0xb4b1('0x2f')](_0x55b4f9)[_0xb4b1('0x30')]();};}function respondWithResult(_0x4ae88e,_0x460e1d){_0x460e1d=_0x460e1d||0xc8;return function(_0x5203b3){if(_0x5203b3){return _0x4ae88e[_0xb4b1('0x2f')](_0x460e1d)[_0xb4b1('0x31')](_0x5203b3);}};}function respondWithFilteredResult(_0x21dcff,_0x50887e){return function(_0x299083){if(_0x299083){var _0x3c24cd=typeof _0x50887e[_0xb4b1('0x32')]===_0xb4b1('0x33')&&typeof _0x50887e[_0xb4b1('0x34')]===_0xb4b1('0x33');var _0x255d81=_0x299083['count'];var _0x54ff25=_0x3c24cd?0x0:_0x50887e[_0xb4b1('0x32')];var _0x5c33f2=_0x3c24cd?_0x299083['count']:_0x50887e[_0xb4b1('0x32')]+_0x50887e[_0xb4b1('0x34')];var _0x6a8ba2;if(_0x5c33f2>=_0x255d81){_0x5c33f2=_0x255d81;_0x6a8ba2=0xc8;}else{_0x6a8ba2=0xce;}_0x21dcff[_0xb4b1('0x2f')](_0x6a8ba2);return _0x21dcff[_0xb4b1('0x35')]('Content-Range',_0x54ff25+'-'+_0x5c33f2+'/'+_0x255d81)[_0xb4b1('0x31')](_0x299083);}return null;};}function patchUpdates(_0x16d3ce){return function(_0x3f6d77){try{jsonpatch[_0xb4b1('0x36')](_0x3f6d77,_0x16d3ce,!![]);}catch(_0x49c8fb){return BPromise[_0xb4b1('0x37')](_0x49c8fb);}return _0x3f6d77[_0xb4b1('0x38')]();};}function saveUpdates(_0x44a5d9,_0x30e9da){return function(_0x2defb2){if(_0x2defb2){return _0x2defb2['update'](_0x44a5d9)[_0xb4b1('0x39')](function(_0x52ef27){return _0x52ef27;});}return null;};}function removeEntity(_0x254dce,_0x459800){return function(_0x1e98fa){if(_0x1e98fa){return _0x1e98fa[_0xb4b1('0x3a')]()[_0xb4b1('0x39')](function(){var _0x94bf40=_0x1e98fa[_0xb4b1('0x3b')]({'plain':!![]});var _0xea5862='WhatsappAccounts';return db['UserProfileResource'][_0xb4b1('0x3a')]({'where':{'type':_0xea5862,'resourceId':_0x94bf40['id']}})['then'](function(){return _0x1e98fa;});})['then'](function(){_0x254dce[_0xb4b1('0x2f')](0xcc)[_0xb4b1('0x30')]();});}};}function handleEntityNotFound(_0x2b0911,_0x500954){return function(_0x16ba67){if(!_0x16ba67){_0x2b0911[_0xb4b1('0x3c')](0x194);}return _0x16ba67;};}function handleError(_0x3bab01,_0x203201){_0x203201=_0x203201||0x1f4;return function(_0x3047dc){logger[_0xb4b1('0x2a')](_0x3047dc[_0xb4b1('0x3d')]);if(_0x3047dc[_0xb4b1('0x3e')]){delete _0x3047dc['name'];}_0x3bab01[_0xb4b1('0x2f')](_0x203201)['send'](_0x3047dc);};}exports[_0xb4b1('0x3f')]=function(_0x4e747b,_0x284f6a){var _0xd4138c={'include':[{'model':db[_0xb4b1('0x40')],'as':_0xb4b1('0x41')}]},_0x39dfc5={},_0x1af312={'count':0x0,'rows':[]};var _0x33ce21=_[_0xb4b1('0x42')](db[_0xb4b1('0x43')][_0xb4b1('0x44')],function(_0x30d94c){return{'name':_0x30d94c[_0xb4b1('0x45')],'type':_0x30d94c[_0xb4b1('0x46')][_0xb4b1('0x47')]};});_0x39dfc5[_0xb4b1('0x48')]=_['map'](_0x33ce21,_0xb4b1('0x3e'));_0x39dfc5[_0xb4b1('0x49')]=_[_0xb4b1('0x4a')](_0x4e747b[_0xb4b1('0x49')]);_0x39dfc5[_0xb4b1('0x4b')]=_[_0xb4b1('0x4c')](_0x39dfc5['model'],_0x39dfc5['query']);_0xd4138c[_0xb4b1('0x4d')]=_[_0xb4b1('0x4c')](_0x39dfc5['model'],qs[_0xb4b1('0x4e')](_0x4e747b[_0xb4b1('0x49')][_0xb4b1('0x4e')]));_0xd4138c[_0xb4b1('0x4d')]=_0xd4138c['attributes'][_0xb4b1('0x4f')]?_0xd4138c[_0xb4b1('0x4d')]:_0x39dfc5[_0xb4b1('0x48')];if(!_0x4e747b[_0xb4b1('0x49')][_0xb4b1('0x50')](_0xb4b1('0x51'))){_0xd4138c['limit']=qs[_0xb4b1('0x34')](_0x4e747b['query'][_0xb4b1('0x34')]);_0xd4138c[_0xb4b1('0x32')]=qs[_0xb4b1('0x32')](_0x4e747b[_0xb4b1('0x49')]['offset']);}_0xd4138c[_0xb4b1('0x52')]=qs[_0xb4b1('0x53')](_0x4e747b[_0xb4b1('0x49')]['sort']);_0xd4138c[_0xb4b1('0x54')]=qs[_0xb4b1('0x4b')](_[_0xb4b1('0x55')](_0x4e747b[_0xb4b1('0x49')],_0x39dfc5[_0xb4b1('0x4b')]),_0x33ce21);if(_0x4e747b['query']['filter']){_0xd4138c[_0xb4b1('0x54')]=_[_0xb4b1('0x56')](_0xd4138c[_0xb4b1('0x54')],{'$or':_['map'](_0x33ce21,function(_0x138ba2){if(_0x138ba2['type']!==_0xb4b1('0x57')){var _0x2e9315={};_0x2e9315[_0x138ba2['name']]={'$like':'%'+_0x4e747b[_0xb4b1('0x49')]['filter']+'%'};return _0x2e9315;}})});}_0xd4138c=_[_0xb4b1('0x56')]({},_0xd4138c,_0x4e747b[_0xb4b1('0x58')]);var _0x25cdd8={'where':_0xd4138c[_0xb4b1('0x54')]};return db['WhatsappAccount'][_0xb4b1('0x59')](_0x25cdd8)['then'](function(_0x4d20fa){_0x1af312[_0xb4b1('0x59')]=_0x4d20fa;if(_0x4e747b[_0xb4b1('0x49')][_0xb4b1('0x5a')]){_0xd4138c[_0xb4b1('0x5b')]=[{'all':!![]}];}return db[_0xb4b1('0x43')][_0xb4b1('0x5c')](_0xd4138c);})['then'](function(_0x3903b1){_0x1af312[_0xb4b1('0x5d')]=_0x3903b1;return _0x1af312;})['then'](respondWithFilteredResult(_0x284f6a,_0xd4138c))[_0xb4b1('0x2e')](handleError(_0x284f6a,null));};exports[_0xb4b1('0x5e')]=function(_0x3529fe,_0x3587eb){var _0x202e37={'raw':![],'where':{'id':_0x3529fe[_0xb4b1('0x5f')]['id']},'include':[{'model':db[_0xb4b1('0x40')],'as':_0xb4b1('0x41')}]},_0x408c3f={};_0x408c3f['model']=_[_0xb4b1('0x4a')](db['WhatsappAccount'][_0xb4b1('0x44')]);_0x408c3f[_0xb4b1('0x49')]=_[_0xb4b1('0x4a')](_0x3529fe[_0xb4b1('0x49')]);_0x408c3f[_0xb4b1('0x4b')]=_[_0xb4b1('0x4c')](_0x408c3f[_0xb4b1('0x48')],_0x408c3f['query']);_0x202e37['attributes']=_[_0xb4b1('0x4c')](_0x408c3f[_0xb4b1('0x48')],qs[_0xb4b1('0x4e')](_0x3529fe['query'][_0xb4b1('0x4e')]));_0x202e37[_0xb4b1('0x4d')]=_0x202e37['attributes'][_0xb4b1('0x4f')]?_0x202e37['attributes']:_0x408c3f[_0xb4b1('0x48')];if(_0x3529fe[_0xb4b1('0x49')][_0xb4b1('0x5a')]){_0x202e37[_0xb4b1('0x5b')]=[{'all':!![]}];}_0x202e37=_[_0xb4b1('0x56')]({},_0x202e37,_0x3529fe[_0xb4b1('0x58')]);return db[_0xb4b1('0x43')]['find'](_0x202e37)[_0xb4b1('0x39')](handleEntityNotFound(_0x3587eb,null))['then'](respondWithResult(_0x3587eb,null))[_0xb4b1('0x2e')](handleError(_0x3587eb,null));};exports[_0xb4b1('0x60')]=function(_0x3d6717,_0x1efbe1){return db[_0xb4b1('0x43')][_0xb4b1('0x60')](_0x3d6717[_0xb4b1('0x61')],{})[_0xb4b1('0x39')](function(_0x1c051a){var _0x437293=_0x3d6717[_0xb4b1('0x62')][_0xb4b1('0x3b')]({'plain':!![]});if(!_0x437293)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x437293[_0xb4b1('0x63')]===_0xb4b1('0x62')){var _0x322fbb=_0x1c051a[_0xb4b1('0x3b')]({'plain':!![]});var _0x1abce3=_0xb4b1('0x64');return db[_0xb4b1('0x65')][_0xb4b1('0x66')]({'where':{'name':_0x1abce3,'userProfileId':_0x437293[_0xb4b1('0x67')]},'raw':!![]})[_0xb4b1('0x39')](function(_0x72948a){if(_0x72948a&&_0x72948a['autoAssociation']===0x0){return db[_0xb4b1('0x68')][_0xb4b1('0x60')]({'name':_0x322fbb[_0xb4b1('0x3e')],'resourceId':_0x322fbb['id'],'type':_0x72948a['name'],'sectionId':_0x72948a['id']},{})[_0xb4b1('0x39')](function(){return _0x1c051a;});}else{return _0x1c051a;}})[_0xb4b1('0x2e')](function(_0x303e09){logger[_0xb4b1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x303e09);throw _0x303e09;});}return _0x1c051a;})[_0xb4b1('0x39')](respondWithResult(_0x1efbe1,0xc9))[_0xb4b1('0x2e')](handleError(_0x1efbe1,null));};exports[_0xb4b1('0x69')]=function(_0x3fe8bf,_0x1523d7){if(_0x3fe8bf[_0xb4b1('0x61')]['id']){delete _0x3fe8bf['body']['id'];}return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0x3fe8bf['params']['id']},'include':[{'model':db[_0xb4b1('0x40')],'as':_0xb4b1('0x41')}]})[_0xb4b1('0x39')](handleEntityNotFound(_0x1523d7,null))[_0xb4b1('0x39')](saveUpdates(_0x3fe8bf['body'],null))[_0xb4b1('0x39')](respondWithResult(_0x1523d7,null))['catch'](handleError(_0x1523d7,null));};exports[_0xb4b1('0x3a')]=function(_0xeb0f9e,_0x529655){return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0xeb0f9e['params']['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x529655,null))[_0xb4b1('0x39')](removeEntity(_0x529655,null))[_0xb4b1('0x2e')](handleError(_0x529655,null));};exports[_0xb4b1('0x6a')]=function(_0x310139,_0x583788){return db[_0xb4b1('0x43')][_0xb4b1('0x6a')]()[_0xb4b1('0x39')](respondWithResult(_0x583788,null))[_0xb4b1('0x2e')](handleError(_0x583788,null));};exports[_0xb4b1('0x6b')]=function(_0x58e6b7,_0x3db5d8,_0x176360){if(_0x58e6b7[_0xb4b1('0x61')]['id']){delete _0x58e6b7['body']['id'];}return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0x58e6b7[_0xb4b1('0x5f')]['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x3db5d8,null))[_0xb4b1('0x39')](function(_0x50522b){if(_0x50522b){_0x58e6b7[_0xb4b1('0x61')][_0xb4b1('0x6c')]=_0x50522b['id'];return db[_0xb4b1('0x6d')]['create'](_0x58e6b7[_0xb4b1('0x61')]);}})['then'](respondWithResult(_0x3db5d8,null))['catch'](handleError(_0x3db5d8,null));};exports[_0xb4b1('0x6e')]=function(_0x484f01,_0x5402b0,_0x29e895){var _0x533f6d={'raw':![],'where':{}};var _0x378a3={};var _0x2493d8={'count':0x0,'rows':[]};return db[_0xb4b1('0x43')][_0xb4b1('0x6f')]({'where':{'id':_0x484f01[_0xb4b1('0x5f')]['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x5402b0,null))[_0xb4b1('0x39')](function(_0x49859f){if(_0x49859f){_0x378a3['model']=_[_0xb4b1('0x4a')](db[_0xb4b1('0x6d')][_0xb4b1('0x44')]);_0x378a3[_0xb4b1('0x49')]=_[_0xb4b1('0x4a')](_0x484f01[_0xb4b1('0x49')]);_0x378a3[_0xb4b1('0x4b')]=_[_0xb4b1('0x4c')](_0x378a3[_0xb4b1('0x48')],_0x378a3[_0xb4b1('0x49')]);_0x533f6d[_0xb4b1('0x4d')]=_[_0xb4b1('0x4c')](_0x378a3[_0xb4b1('0x48')],qs[_0xb4b1('0x4e')](_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x4e')]));_0x533f6d[_0xb4b1('0x4d')]=_0x533f6d[_0xb4b1('0x4d')][_0xb4b1('0x4f')]?_0x533f6d[_0xb4b1('0x4d')]:_0x378a3[_0xb4b1('0x48')];if(!_0x484f01['query']['hasOwnProperty'](_0xb4b1('0x51'))){_0x533f6d[_0xb4b1('0x34')]=qs[_0xb4b1('0x34')](_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x34')]);_0x533f6d[_0xb4b1('0x32')]=qs[_0xb4b1('0x32')](_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x32')]);}_0x533f6d[_0xb4b1('0x52')]=qs[_0xb4b1('0x53')](_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x53')]);_0x533f6d[_0xb4b1('0x54')]=qs[_0xb4b1('0x4b')](_[_0xb4b1('0x55')](_0x484f01[_0xb4b1('0x49')],_0x378a3[_0xb4b1('0x4b')]));_0x533f6d[_0xb4b1('0x54')][_0xb4b1('0x6c')]=_0x49859f['id'];if(_0x484f01['query'][_0xb4b1('0x70')]){_0x533f6d[_0xb4b1('0x54')]=_[_0xb4b1('0x56')](_0x533f6d['where'],{'$or':_[_0xb4b1('0x42')](_0x533f6d[_0xb4b1('0x4d')],function(_0x4e6c25){var _0x1e95a1={};_0x1e95a1[_0x4e6c25]={'$like':'%'+_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x70')]+'%'};return _0x1e95a1;})});}_0x533f6d=_[_0xb4b1('0x56')]({},_0x533f6d,_0x484f01[_0xb4b1('0x58')]);return db['Disposition']['count']({'where':_0x533f6d[_0xb4b1('0x54')]})[_0xb4b1('0x39')](function(_0x1aa193){_0x2493d8[_0xb4b1('0x59')]=_0x1aa193;if(_0x484f01[_0xb4b1('0x49')][_0xb4b1('0x5a')]){_0x533f6d[_0xb4b1('0x5b')]=[{'all':!![]}];}return db[_0xb4b1('0x6d')][_0xb4b1('0x5c')](_0x533f6d);})[_0xb4b1('0x39')](function(_0x5af51d){_0x2493d8[_0xb4b1('0x5d')]=_0x5af51d;return _0x2493d8;});}})[_0xb4b1('0x39')](respondWithFilteredResult(_0x5402b0,_0x533f6d))[_0xb4b1('0x2e')](handleError(_0x5402b0,null));};exports[_0xb4b1('0x71')]=function(_0x35486f,_0x5966a9,_0x30668f){return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0x35486f[_0xb4b1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5966a9,null))[_0xb4b1('0x39')](function(_0x5d3906){if(_0x5d3906){return _0x5d3906[_0xb4b1('0x71')](_0x35486f[_0xb4b1('0x49')]['ids']);}})[_0xb4b1('0x39')](respondWithStatusCode(_0x5966a9,null))['catch'](handleError(_0x5966a9,null));};exports[_0xb4b1('0x72')]=function(_0x10947c,_0x5a98ec,_0x47c12c){if(_0x10947c['body']['id']){delete _0x10947c['body']['id'];}return db['WhatsappAccount'][_0xb4b1('0x66')]({'where':{'id':_0x10947c[_0xb4b1('0x5f')]['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x5a98ec,null))[_0xb4b1('0x39')](function(_0x36f271){if(_0x36f271){_0x10947c['body'][_0xb4b1('0x6c')]=_0x36f271['id'];return db[_0xb4b1('0x73')][_0xb4b1('0x60')](_0x10947c[_0xb4b1('0x61')]);}})[_0xb4b1('0x39')](respondWithResult(_0x5a98ec,null))[_0xb4b1('0x2e')](handleError(_0x5a98ec,null));};exports[_0xb4b1('0x74')]=function(_0x177455,_0x1d9102,_0xc0b85b){var _0x220f19={'raw':![],'where':{}};var _0x38ea38={};var _0x565613={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xb4b1('0x6f')]({'where':{'id':_0x177455['params']['id']}})['then'](handleEntityNotFound(_0x1d9102,null))['then'](function(_0x32ed86){if(_0x32ed86){_0x38ea38[_0xb4b1('0x48')]=_[_0xb4b1('0x4a')](db[_0xb4b1('0x73')][_0xb4b1('0x44')]);_0x38ea38[_0xb4b1('0x49')]=_['keys'](_0x177455[_0xb4b1('0x49')]);_0x38ea38[_0xb4b1('0x4b')]=_['intersection'](_0x38ea38['model'],_0x38ea38[_0xb4b1('0x49')]);_0x220f19[_0xb4b1('0x4d')]=_[_0xb4b1('0x4c')](_0x38ea38[_0xb4b1('0x48')],qs[_0xb4b1('0x4e')](_0x177455['query'][_0xb4b1('0x4e')]));_0x220f19[_0xb4b1('0x4d')]=_0x220f19[_0xb4b1('0x4d')]['length']?_0x220f19[_0xb4b1('0x4d')]:_0x38ea38[_0xb4b1('0x48')];if(!_0x177455[_0xb4b1('0x49')]['hasOwnProperty'](_0xb4b1('0x51'))){_0x220f19[_0xb4b1('0x34')]=qs[_0xb4b1('0x34')](_0x177455[_0xb4b1('0x49')][_0xb4b1('0x34')]);_0x220f19['offset']=qs[_0xb4b1('0x32')](_0x177455[_0xb4b1('0x49')][_0xb4b1('0x32')]);}_0x220f19[_0xb4b1('0x52')]=qs[_0xb4b1('0x53')](_0x177455[_0xb4b1('0x49')]['sort']);_0x220f19[_0xb4b1('0x54')]=qs['filters'](_['pick'](_0x177455[_0xb4b1('0x49')],_0x38ea38['filters']));_0x220f19[_0xb4b1('0x54')][_0xb4b1('0x6c')]=_0x32ed86['id'];if(_0x177455[_0xb4b1('0x49')]['filter']){_0x220f19['where']=_[_0xb4b1('0x56')](_0x220f19[_0xb4b1('0x54')],{'$or':_[_0xb4b1('0x42')](_0x220f19[_0xb4b1('0x4d')],function(_0x70507e){var _0x27ded7={};_0x27ded7[_0x70507e]={'$like':'%'+_0x177455['query'][_0xb4b1('0x70')]+'%'};return _0x27ded7;})});}_0x220f19=_[_0xb4b1('0x56')]({},_0x220f19,_0x177455[_0xb4b1('0x58')]);return db[_0xb4b1('0x73')][_0xb4b1('0x59')]({'where':_0x220f19['where']})['then'](function(_0x88ef79){_0x565613[_0xb4b1('0x59')]=_0x88ef79;if(_0x177455['query'][_0xb4b1('0x5a')]){_0x220f19[_0xb4b1('0x5b')]=[{'all':!![]}];}return db[_0xb4b1('0x73')][_0xb4b1('0x5c')](_0x220f19);})[_0xb4b1('0x39')](function(_0x4c7eab){_0x565613[_0xb4b1('0x5d')]=_0x4c7eab;return _0x565613;});}})['then'](respondWithFilteredResult(_0x1d9102,_0x220f19))[_0xb4b1('0x2e')](handleError(_0x1d9102,null));};exports[_0xb4b1('0x75')]=function(_0x181404,_0x32c44a,_0x16d8c4){return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0x181404['params']['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x32c44a,null))['then'](function(_0x41194a){if(_0x41194a){return _0x41194a[_0xb4b1('0x75')](_0x181404[_0xb4b1('0x49')][_0xb4b1('0x76')]);}})[_0xb4b1('0x39')](respondWithStatusCode(_0x32c44a,null))[_0xb4b1('0x2e')](handleError(_0x32c44a,null));};exports[_0xb4b1('0x77')]=function(_0x435ee1,_0x3dcd4c,_0x3733f9){return db[_0xb4b1('0x43')]['find']({'where':{'id':_0x435ee1[_0xb4b1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3dcd4c,null))[_0xb4b1('0x39')](function(_0x19d36e){if(_0x19d36e){return _0x19d36e[_0xb4b1('0x77')](_0x435ee1[_0xb4b1('0x61')]['ids'],_['omit'](_0x435ee1[_0xb4b1('0x61')],[_0xb4b1('0x76'),'id'])||{})['spread'](function(_0xe0f181){for(var _0x377820=0x0;_0x377820<_0x435ee1['body'][_0xb4b1('0x76')]['length'];_0x377820+=0x1){socket['emit'](_0xb4b1('0x78'),{'UserId':Number(_0x435ee1[_0xb4b1('0x61')][_0xb4b1('0x76')][_0x377820]),'WhatsappAccountId':Number(_0x435ee1['params']['id'])});}return _0xe0f181;});}})['then'](respondWithResult(_0x3dcd4c,null))[_0xb4b1('0x2e')](handleError(_0x3dcd4c,null));};exports[_0xb4b1('0x79')]=function(_0x39f51e,_0x2cf0f7,_0x1bb774){return db['WhatsappAccount']['find']({'where':{'id':_0x39f51e[_0xb4b1('0x5f')]['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x2cf0f7,null))[_0xb4b1('0x39')](function(_0x551f5e){if(_0x551f5e){return _0x551f5e[_0xb4b1('0x79')](_0x39f51e[_0xb4b1('0x49')][_0xb4b1('0x76')])[_0xb4b1('0x39')](function(){if(_['isArray'](_0x39f51e[_0xb4b1('0x49')][_0xb4b1('0x76')])){for(var _0x1d13f3=0x0;_0x1d13f3<_0x39f51e['query']['ids'][_0xb4b1('0x4f')];_0x1d13f3+=0x1){socket[_0xb4b1('0x7a')](_0xb4b1('0x7b'),{'UserId':Number(_0x39f51e['query']['ids'][_0x1d13f3]),'WhatsappAccountId':Number(_0x39f51e[_0xb4b1('0x5f')]['id'])});}}else{socket[_0xb4b1('0x7a')](_0xb4b1('0x7b'),{'UserId':Number(_0x39f51e[_0xb4b1('0x49')][_0xb4b1('0x76')]),'WhatsappAccountId':Number(_0x39f51e[_0xb4b1('0x5f')]['id'])});}});}})[_0xb4b1('0x39')](respondWithStatusCode(_0x2cf0f7,null))[_0xb4b1('0x2e')](handleError(_0x2cf0f7,null));};exports[_0xb4b1('0x7c')]=function(_0x30fb2d,_0x4711ed,_0x215e2d){var _0x4eda41={};var _0x229145={};var _0x428cb4;var _0x3b33f9;return db['WhatsappAccount'][_0xb4b1('0x6f')]({'where':{'id':_0x30fb2d['params']['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x4711ed,null))[_0xb4b1('0x39')](function(_0x4312c3){if(_0x4312c3){_0x428cb4=_0x4312c3;_0x229145[_0xb4b1('0x48')]=_[_0xb4b1('0x4a')](db['User']['rawAttributes']);_0x229145[_0xb4b1('0x49')]=_[_0xb4b1('0x4a')](_0x30fb2d[_0xb4b1('0x49')]);_0x229145[_0xb4b1('0x4b')]=_[_0xb4b1('0x4c')](_0x229145[_0xb4b1('0x48')],_0x229145['query']);_0x4eda41[_0xb4b1('0x4d')]=_['intersection'](_0x229145[_0xb4b1('0x48')],qs[_0xb4b1('0x4e')](_0x30fb2d[_0xb4b1('0x49')][_0xb4b1('0x4e')]));_0x4eda41[_0xb4b1('0x4d')]=_0x4eda41[_0xb4b1('0x4d')][_0xb4b1('0x4f')]?_0x4eda41['attributes']:_0x229145['model'];_0x4eda41[_0xb4b1('0x52')]=qs[_0xb4b1('0x53')](_0x30fb2d[_0xb4b1('0x49')][_0xb4b1('0x53')]);_0x4eda41['where']=qs[_0xb4b1('0x4b')](_['pick'](_0x30fb2d[_0xb4b1('0x49')],_0x229145[_0xb4b1('0x4b')]));if(_0x30fb2d[_0xb4b1('0x49')]['filter']){_0x4eda41['where']=_[_0xb4b1('0x56')](_0x4eda41[_0xb4b1('0x54')],{'$or':_[_0xb4b1('0x42')](_0x4eda41['attributes'],function(_0x331ef8){var _0x34154a={};_0x34154a[_0x331ef8]={'$like':'%'+_0x30fb2d[_0xb4b1('0x49')]['filter']+'%'};return _0x34154a;})});}_0x4eda41=_['merge']({},_0x4eda41,_0x30fb2d[_0xb4b1('0x58')]);return _0x428cb4['getAgents'](_0x4eda41);}})[_0xb4b1('0x39')](function(_0xa02d1c){if(_0xa02d1c){_0x3b33f9=_0xa02d1c[_0xb4b1('0x4f')];if(!_0x30fb2d[_0xb4b1('0x49')][_0xb4b1('0x50')](_0xb4b1('0x51'))){_0x4eda41[_0xb4b1('0x34')]=qs[_0xb4b1('0x34')](_0x30fb2d[_0xb4b1('0x49')][_0xb4b1('0x34')]);_0x4eda41[_0xb4b1('0x32')]=qs[_0xb4b1('0x32')](_0x30fb2d[_0xb4b1('0x49')][_0xb4b1('0x32')]);}return _0x428cb4[_0xb4b1('0x7c')](_0x4eda41);}})[_0xb4b1('0x39')](function(_0x5d977e){if(_0x5d977e){return _0x5d977e?{'count':_0x3b33f9,'rows':_0x5d977e}:null;}})['then'](respondWithResult(_0x4711ed,null))[_0xb4b1('0x2e')](handleError(_0x4711ed,null));};exports[_0xb4b1('0x7d')]=function(_0x5d16a7,_0x374a97){var _0xf66ba8=_0x5d16a7[_0xb4b1('0x5f')]['id'];var _0x38fa32=_0x5d16a7[_0xb4b1('0x61')];var _0x5aec38=0xc8;var _0x192ac4=null;return db['sequelize'][_0xb4b1('0x7e')]({'isolationLevel':db[_0xb4b1('0x7f')][_0xb4b1('0x80')]['ISOLATION_LEVELS'][_0xb4b1('0x81')]},function(_0x144735){return db[_0xb4b1('0x43')][_0xb4b1('0x6f')]({'where':{'id':_0xf66ba8},'transaction':_0x144735})['then'](function(_0x52aeca){if(_0x52aeca){return db[_0xb4b1('0x82')]['destroy']({'where':{'WhatsappAccountId':_0xf66ba8},'transaction':_0x144735})['then'](function(){var _0x27a0e8=_[_0xb4b1('0x42')](_0x38fa32,function(_0x4b1346){_0x4b1346[_0xb4b1('0x6c')]=_0xf66ba8;return _0x4b1346;});return db['WhatsappApplication']['bulkCreate'](_0x27a0e8,{'transaction':_0x144735});});}else{_0x5aec38=0x194;_0x192ac4=[];}});})[_0xb4b1('0x39')](function(){if(_0x5aec38!==0x194){return db[_0xb4b1('0x82')][_0xb4b1('0x83')]({'where':{'WhatsappAccountId':_0xf66ba8},'order':_0xb4b1('0x84')})[_0xb4b1('0x39')](function(_0x3b70f9){_0x192ac4=_0x3b70f9;});}})['catch'](function(_0x44713e){_0x5aec38=0x1f4;logger[_0xb4b1('0x2a')](_0x44713e[_0xb4b1('0x3d')]);if(_0x44713e[_0xb4b1('0x3e')]){delete _0x44713e[_0xb4b1('0x3e')];}_0x192ac4=_0x44713e;})[_0xb4b1('0x85')](function(){if(_0x192ac4===null){_0x374a97['sendStatus'](_0x5aec38);}else{if(_0x5aec38===0x1f4){_0x374a97['status'](_0x5aec38)[_0xb4b1('0x86')](_0x192ac4);}else{_0x374a97[_0xb4b1('0x2f')](_0x5aec38)[_0xb4b1('0x31')](_0x192ac4);}}});};exports[_0xb4b1('0x87')]=function(_0x126cd7,_0x15029e,_0x30a55b){var _0x5b3b20={};var _0x25e4ed={};var _0x5de5dd;var _0x569713;return db[_0xb4b1('0x43')]['findOne']({'where':{'id':_0x126cd7[_0xb4b1('0x5f')]['id']}})[_0xb4b1('0x39')](handleEntityNotFound(_0x15029e,null))['then'](function(_0x102e2e){if(_0x102e2e){_0x5de5dd=_0x102e2e;_0x25e4ed[_0xb4b1('0x48')]=_['keys'](db[_0xb4b1('0x82')]['rawAttributes']);_0x25e4ed['query']=_[_0xb4b1('0x4a')](_0x126cd7['query']);_0x25e4ed[_0xb4b1('0x4b')]=_[_0xb4b1('0x4c')](_0x25e4ed[_0xb4b1('0x48')],_0x25e4ed[_0xb4b1('0x49')]);_0x5b3b20[_0xb4b1('0x4d')]=_[_0xb4b1('0x4c')](_0x25e4ed['model'],qs[_0xb4b1('0x4e')](_0x126cd7[_0xb4b1('0x49')][_0xb4b1('0x4e')]));_0x5b3b20[_0xb4b1('0x4d')]=_0x5b3b20[_0xb4b1('0x4d')][_0xb4b1('0x4f')]?_0x5b3b20[_0xb4b1('0x4d')]:_0x25e4ed[_0xb4b1('0x48')];_0x5b3b20['order']=qs['sort'](_0x126cd7[_0xb4b1('0x49')][_0xb4b1('0x53')]);_0x5b3b20['where']=qs[_0xb4b1('0x4b')](_['pick'](_0x126cd7['query'],_0x25e4ed[_0xb4b1('0x4b')]));if(_0x126cd7[_0xb4b1('0x49')][_0xb4b1('0x70')]){_0x5b3b20[_0xb4b1('0x54')]=_['merge'](_0x5b3b20[_0xb4b1('0x54')],{'$or':_[_0xb4b1('0x42')](_0x5b3b20['attributes'],function(_0x57daee){var _0x3fc03a={};_0x3fc03a[_0x57daee]={'$like':'%'+_0x126cd7['query'][_0xb4b1('0x70')]+'%'};return _0x3fc03a;})});}_0x5b3b20=_['merge']({},_0x5b3b20,_0x126cd7[_0xb4b1('0x58')]);return _0x5de5dd[_0xb4b1('0x87')](_0x5b3b20);}})[_0xb4b1('0x39')](function(_0xfebfdd){if(_0xfebfdd){_0x569713=_0xfebfdd[_0xb4b1('0x4f')];if(!_0x126cd7['query'][_0xb4b1('0x50')](_0xb4b1('0x51'))){_0x5b3b20[_0xb4b1('0x34')]=qs['limit'](_0x126cd7[_0xb4b1('0x49')][_0xb4b1('0x34')]);_0x5b3b20['offset']=qs[_0xb4b1('0x32')](_0x126cd7[_0xb4b1('0x49')][_0xb4b1('0x32')]);}return _0x5de5dd['getApplications'](_0x5b3b20);}})['then'](function(_0x47197d){if(_0x47197d){return _0x47197d?{'count':_0x569713,'rows':_0x47197d}:null;}})[_0xb4b1('0x39')](respondWithResult(_0x15029e,null))[_0xb4b1('0x2e')](handleError(_0x15029e,null));};exports[_0xb4b1('0x88')]=function(_0x2f4e59,_0x481143,_0x5de4ab){var _0xa15ac2={'channel':_0xb4b1('0x89')};var _0x4a0776=[];var _0x418933=[];var _0x39d7de={};return db[_0xb4b1('0x43')][_0xb4b1('0x66')]({'where':{'id':_0x2f4e59[_0xb4b1('0x5f')]['id']},'include':[{'model':db[_0xb4b1('0x82')],'as':_0xb4b1('0x8a')}]})[_0xb4b1('0x39')](handleEntityNotFound(_0x481143,null))[_0xb4b1('0x39')](function(_0x52dc74){_0xa15ac2[_0xb4b1('0x8b')]=_0x52dc74;if(_0xa15ac2[_0xb4b1('0x8b')]&&_0xa15ac2[_0xb4b1('0x8b')]['type']===_0xb4b1('0x8c')&&_0x2f4e59['body']['statuses']){if(_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0x8d')][_0xb4b1('0x4f')]===0x0)return;if(_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0x8d')][0x0][_0xb4b1('0x8e')]!==_0xb4b1('0x8f'))return;return db['WhatsappMessage'][_0xb4b1('0x69')]({'read':!![],'readAt':_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0x8d')][0x0][_0xb4b1('0x90')]},{'where':{'messageId':_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0x8d')][0x0][_0xb4b1('0x91')]},'individualHooks':!![]})['then'](function(_0x29f398){return _0x481143['status'](0xc8)[_0xb4b1('0x31')](_0x29f398);});}_0xa15ac2[_0xb4b1('0x92')]=_['orderBy'](_0x52dc74['Applications'],['priority'],[_0xb4b1('0x93')]);if(_0xa15ac2[_0xb4b1('0x8b')][_0xb4b1('0x8a')]){delete _0xa15ac2[_0xb4b1('0x8b')][_0xb4b1('0x8a')];}return db['CmContact'][_0xb4b1('0x6a')]()[_0xb4b1('0x39')](function(_0x197c37){if(!_0x197c37){throw new db[(_0xb4b1('0x94'))]['ValidationError'](_0xb4b1('0x95'));}_0x4a0776=_['difference'](_[_0xb4b1('0x4a')](_0x197c37),[_0xb4b1('0x96'),_0xb4b1('0x97')]);_0x418933=_[_0xb4b1('0x98')](_[_0xb4b1('0x4a')](_0x197c37),[_0xb4b1('0x96'),_0xb4b1('0x97'),_0xb4b1('0x99'),_0xb4b1('0x9a')]);_0xa15ac2[_0xb4b1('0x61')]={'mapKey':_0xb4b1('0x9b')};if(_0xa15ac2[_0xb4b1('0x8b')]&&_0xa15ac2[_0xb4b1('0x8b')]['type']===_0xb4b1('0x9c')){_0xa15ac2[_0xb4b1('0x61')]['from']=_0x2f4e59[_0xb4b1('0x61')]['From'][_0xb4b1('0x9d')](_0xb4b1('0x9e'),'');_0xa15ac2[_0xb4b1('0x61')]['body']=_0x2f4e59['body']['Body'];_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0x9f')]=_0x2f4e59['body'][_0xb4b1('0xa0')];}if(_0xa15ac2[_0xb4b1('0x8b')]&&_0xa15ac2['account'][_0xb4b1('0x46')]===_0xb4b1('0x8c')){_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa1')]=_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0xa2')][0x0][_0xb4b1('0xa1')];_0xa15ac2[_0xb4b1('0x61')]['body']=_0x2f4e59['body'][_0xb4b1('0xa2')][0x0][_0xb4b1('0x2c')]['body'];_0xa15ac2[_0xb4b1('0x61')]['messageId']=_0x2f4e59[_0xb4b1('0x61')][_0xb4b1('0xa2')][0x0]['message_id'];}if(_0xa15ac2[_0xb4b1('0x61')]['id']){delete _0xa15ac2[_0xb4b1('0x61')]['id'];}if(_[_0xb4b1('0xa3')](_0xa15ac2[_0xb4b1('0x61')]['from'])){throw new db[(_0xb4b1('0x94'))]['ValidationError'](_0xb4b1('0xa4'));}if(_[_0xb4b1('0xa3')](_0xa15ac2['body'][_0xb4b1('0x61')])||_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0x61')]===''){throw new db[(_0xb4b1('0x94'))][(_0xb4b1('0xa5'))](_0xb4b1('0xa6'));}if(_[_0xb4b1('0xa3')](_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa7')])){throw new db[(_0xb4b1('0x94'))]['ValidationError'](_0xb4b1('0xa8')+_0x418933);}if(!_[_0xb4b1('0xa9')](_0x418933,_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa7')])){throw new db[(_0xb4b1('0x94'))][(_0xb4b1('0xa5'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x418933);}_0x39d7de[_0xa15ac2['body']['mapKey']]=_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa1')];return db[_0xb4b1('0xaa')][_0xb4b1('0x66')]({'where':{'id':_0xa15ac2[_0xb4b1('0x8b')][_0xb4b1('0x9a')]},'include':[{'model':db[_0xb4b1('0xab')],'as':_0xb4b1('0xac'),'where':_0x39d7de,'limit':0x1,'order':[[_0xb4b1('0x97'),_0xb4b1('0xad')]]}]});})[_0xb4b1('0x39')](handleEntityNotFound(_0x481143,null))['then'](function(_0x60d6b9){if(_0x60d6b9){_0xa15ac2[_0xb4b1('0xae')]=_['omit'](_0x60d6b9,[_0xb4b1('0xac')]);if(_0x60d6b9[_0xb4b1('0xac')][_0xb4b1('0x4f')]){return _0x60d6b9[_0xb4b1('0xac')][0x0];}var _0x3fa490=_[_0xb4b1('0x1c')](_0xa15ac2[_0xb4b1('0x61')],{'firstName':_0xa15ac2['body'][_0xb4b1('0xa1')],'ListId':_0x60d6b9['id']});_0x3fa490[_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa7')]]=_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa1')];return db[_0xb4b1('0xab')][_0xb4b1('0x60')](_0x3fa490,{'fields':_0x4a0776,'raw':!![]});}})[_0xb4b1('0x39')](handleEntityNotFound(_0x481143,null))['then'](function(_0x485d6d){if(_0x485d6d){_0xa15ac2[_0xb4b1('0xaf')]=_0x485d6d;var _0x3dba9e={'ContactId':_0x485d6d['id'],'phone':_0xa15ac2['body']['from'],'WhatsappAccountId':_0x2f4e59[_0xb4b1('0x5f')]['id']};var _0x136edc={'ContactId':_0x485d6d['id'],'WhatsappAccountId':_0x2f4e59[_0xb4b1('0x5f')]['id'],'closed':![]};return db[_0xb4b1('0xb0')][_0xb4b1('0x66')]({'where':_0x136edc})[_0xb4b1('0x39')](function(_0x1e7250){if(_0x1e7250){return[_0x1e7250,![]];}return db['WhatsappInteraction']['create'](_0x3dba9e)[_0xb4b1('0x39')](function(_0x5091fd){return[_0x5091fd,!![]];});});}})['spread'](function(_0x4995a1,_0x59bff6){_0xa15ac2[_0xb4b1('0xb1')]=_0x4995a1[_0xb4b1('0x3b')]({'plain':!![]});_0xa15ac2[_0xb4b1('0xb1')]['created']=![];if(_0x59bff6){if(_0xa15ac2['account']['autoclose']){_0xa15ac2[_0xb4b1('0x92')]['push']({'id':0x0,'priority':_0xa15ac2[_0xb4b1('0x92')][_0xb4b1('0x4f')]+0x1,'app':_0xb4b1('0xb2'),'appdata':_0xb4b1('0xb3'),'interval':_0xb4b1('0xb4')});}_0xa15ac2[_0xb4b1('0xb1')][_0xb4b1('0xb5')]=!![];}return db[_0xb4b1('0xb6')][_0xb4b1('0x60')]({'phone':_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0xa1')],'messageId':_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0x9f')],'body':_0xa15ac2[_0xb4b1('0x61')][_0xb4b1('0x61')],'WhatsappAccountId':_0x2f4e59[_0xb4b1('0x5f')]['id'],'WhatsappInteractionId':_0x4995a1['id'],'direction':'in','ContactId':_0x4995a1[_0xb4b1('0xb7')],'AttachmentId':_0xa15ac2['body'][_0xb4b1('0xb8')]});})[_0xb4b1('0x39')](function(_0x248445){_0xa15ac2[_0xb4b1('0x2c')]=_0x248445;if(_0xa15ac2[_0xb4b1('0xb1')][_0xb4b1('0xb9')]){return db[_0xb4b1('0xba')][_0xb4b1('0x66')]({'attributes':['id',_0xb4b1('0x3e')],'where':{'id':_0xa15ac2[_0xb4b1('0xb1')]['UserId']}})['then'](function(_0x1aaf1c){if(_0x1aaf1c){_0xa15ac2[_0xb4b1('0x92')][_0xb4b1('0xbb')]({'id':0x0,'priority':0x0,'app':_0xb4b1('0xbc'),'appdata':_0x1aaf1c[_0xb4b1('0x3e')]+','+(_0xa15ac2[_0xb4b1('0x8b')][_0xb4b1('0xbd')]||0xa),'interval':_0xb4b1('0xb4')});}return respondWithRpcPromise(_0xb4b1('0xbe'),'startRouting',_0xa15ac2);});}return respondWithRpcPromise(_0xb4b1('0xbe'),'startRouting',_0xa15ac2);})[_0xb4b1('0x39')](function(_0x36c5cd){if(_0x36c5cd){var _0x529515=0xc8;var _0x3cb764=_0xb4b1('0xbf');logger[_0xb4b1('0x24')](_0xb4b1('0x28'),_0x3cb764,_0x529515,_0xb4b1('0xc0'));logger[_0xb4b1('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3cb764,_0x529515,'entity\x20found',JSON[_0xb4b1('0x29')](_0x36c5cd));if(_0xa15ac2[_0xb4b1('0x8b')]['type']==='twilio'){return _0x481143[_0xb4b1('0x2f')](_0x529515)[_0xb4b1('0x35')](_0xb4b1('0xc1'),'text/xml')['send'](_0xb4b1('0xc2'));}else{return _0x481143[_0xb4b1('0x2f')](_0x529515)[_0xb4b1('0x31')](_0x36c5cd);}}});})[_0xb4b1('0x2e')](handleError(_0x481143,null));};exports['send']=function(_0x1b6dd4,_0x23eb0e,_0x311b13){var _0x2361cd,_0x1dab4c,_0x29386a;if(_[_0xb4b1('0xa3')](_0x1b6dd4[_0xb4b1('0x61')]['body'])||_0x1b6dd4['body'][_0xb4b1('0x61')]===''){throw new db[(_0xb4b1('0x94'))][(_0xb4b1('0xa5'))](_0xb4b1('0xa6'));}if(_['isNil'](_0x1b6dd4[_0xb4b1('0x61')]['to'])){throw new db[(_0xb4b1('0x94'))][(_0xb4b1('0xa5'))](_0xb4b1('0xc3'));}_0x2361cd=_0x1b6dd4[_0xb4b1('0x61')]['to'];return db['WhatsappAccount'][_0xb4b1('0x66')]({'where':{'id':_0x1b6dd4[_0xb4b1('0x5f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xb4b1('0xac'),'where':{'mobile':_0x2361cd},'limit':0x1,'order':[['updatedAt',_0xb4b1('0xad')]]}]}]})[_0xb4b1('0x39')](handleEntityNotFound(_0x23eb0e,null))[_0xb4b1('0x39')](function(_0x20b474){if(_0x20b474&&_0x20b474[_0xb4b1('0xc4')]){_0x1dab4c=_0x20b474[_0xb4b1('0x3b')]({'plain':!![]});if(_0x1dab4c['List']&&_0x1dab4c[_0xb4b1('0xc4')]['Contacts']['length']){return _0x1dab4c[_0xb4b1('0xc4')]['Contacts'][0x0];}return db[_0xb4b1('0xab')][_0xb4b1('0x60')](_[_0xb4b1('0x1c')](_0x1b6dd4[_0xb4b1('0x61')],{'firstName':_0x2361cd,'mobile':_0x2361cd,'phone':_0x2361cd,'ListId':_0x1dab4c[_0xb4b1('0x9a')]}));}})['then'](handleEntityNotFound(_0x23eb0e,null))[_0xb4b1('0x39')](function(_0x7549dd){if(_0x7549dd){_0x29386a=_0x7549dd;return db['WhatsappInteraction'][_0xb4b1('0x66')]({'where':{'ContactId':_0x29386a['id'],'closed':![],'WhatsappAccountId':_0x1dab4c['id']}})[_0xb4b1('0x39')](function(_0x2c961e){if(_0x2c961e){return[_0x2c961e,![]];}return db['WhatsappInteraction'][_0xb4b1('0x60')]({'UserId':_0x1b6dd4[_0xb4b1('0x62')]['id'],'ContactId':_0x29386a['id'],'WhatsappAccountId':_0x1dab4c['id'],'phone':_0x2361cd,'firstMsgDirection':_0xb4b1('0xc5'),'Messages':[_[_0xb4b1('0x56')](_0x1b6dd4['body'],{'read':![],'body':_0x1b6dd4[_0xb4b1('0x61')][_0xb4b1('0x61')],'phone':_0x2361cd,'WhatsappAccountId':_0x1dab4c['id'],'UserId':_0x1b6dd4[_0xb4b1('0x62')]['id'],'ContactId':_0x29386a['id']})]},{'include':[{'model':db[_0xb4b1('0xb6')],'as':_0xb4b1('0xc6')}]})[_0xb4b1('0x39')](function(_0x509261){return[_0x509261,!![]];});});}})[_0xb4b1('0xc7')](function(_0x17fb7a,_0x55b30f){if(_0x55b30f){return _0x17fb7a;}return db[_0xb4b1('0xb6')][_0xb4b1('0x60')](_[_0xb4b1('0x56')](_0x1b6dd4[_0xb4b1('0x61')],{'read':![],'body':_0x1b6dd4[_0xb4b1('0x61')][_0xb4b1('0x61')],'phone':_0x2361cd,'WhatsappAccountId':_0x1dab4c['id'],'WhatsappInteractionId':_0x17fb7a['id'],'UserId':_0x1b6dd4[_0xb4b1('0x62')]['id'],'ContactId':_0x29386a['id']}))[_0xb4b1('0x39')](function(_0x4bfd54){_0x17fb7a[_0xb4b1('0xc8')][_0xb4b1('0xc6')]=[];_0x17fb7a['dataValues'][_0xb4b1('0xc6')]['push'](_0x4bfd54['dataValues']);return _0x17fb7a;});})['then'](respondWithResult(_0x23eb0e,null))[_0xb4b1('0x2e')](handleError(_0x23eb0e,null));}; \ No newline at end of file +var _0x3482=['then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','describe','Disposition','create','getDispositions','findOne','order','WhatsappAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','replace','Body','messageId','MessageSid','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','CmContact','contact','WhatsappInteraction','interaction','created','push','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','List','DESC','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','defaults','socket.io-emitter','redis','register','jayson/promise','client','http','request'];(function(_0x9cd148,_0x5982a9){var _0x76a87f=function(_0x1af3db){while(--_0x1af3db){_0x9cd148['push'](_0x9cd148['shift']());}};_0x76a87f(++_0x5982a9);}(_0x3482,0xa0));var _0x2348=function(_0x4c7e32,_0x44dca3){_0x4c7e32=_0x4c7e32-0x0;var _0x3ff8fd=_0x3482[_0x4c7e32];return _0x3ff8fd;};'use strict';var emlformat=require(_0x2348('0x0'));var rimraf=require(_0x2348('0x1'));var zipdir=require(_0x2348('0x2'));var jsonpatch=require(_0x2348('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2348('0x4'));var Mustache=require(_0x2348('0x5'));var util=require('util');var path=require(_0x2348('0x6'));var sox=require(_0x2348('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2348('0x8'));var crypto=require(_0x2348('0x9'));var jsforce=require(_0x2348('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2348('0xb'));var authService=require(_0x2348('0xc'));var qs=require(_0x2348('0xd'));var as=require(_0x2348('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2348('0xf'))('api');var utils=require(_0x2348('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2348('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2348('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2348('0x13'))(new Redis(config[_0x2348('0x14')]));require('./whatsappAccount.socket')[_0x2348('0x15')](socket);var jayson=require(_0x2348('0x16'));var client=jayson[_0x2348('0x17')][_0x2348('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x5dba77,_0x86424d,_0x3de598,_0x58c19b){return new BPromise(function(_0x257b09,_0x93e5bf){var _0xb7bf78=_0x58c19b||client;return _0xb7bf78[_0x2348('0x19')](_0x5dba77,_0x3de598)[_0x2348('0x1a')](function(_0x54e74f){logger[_0x2348('0x1b')](_0x2348('0x1c'),_0x86424d,'request\x20sent');logger['debug'](_0x2348('0x1d'),_0x86424d,'request\x20sent',JSON[_0x2348('0x1e')](_0x54e74f));if(_0x54e74f[_0x2348('0x1f')]){if(_0x54e74f['error'][_0x2348('0x20')]===0x1f4){logger[_0x2348('0x1f')](_0x2348('0x1c'),_0x86424d,_0x54e74f[_0x2348('0x1f')][_0x2348('0x21')]);return _0x93e5bf(_0x54e74f[_0x2348('0x1f')][_0x2348('0x21')]);}logger[_0x2348('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x86424d,_0x54e74f[_0x2348('0x1f')][_0x2348('0x21')]);return _0x257b09(_0x54e74f[_0x2348('0x1f')][_0x2348('0x21')]);}else{logger['info'](_0x2348('0x1c'),_0x86424d,_0x2348('0x22'));_0x257b09(_0x54e74f['result'][_0x2348('0x21')]);}})[_0x2348('0x23')](function(_0x5d7b8b){logger[_0x2348('0x1f')](_0x2348('0x1c'),_0x86424d,_0x5d7b8b);_0x93e5bf(_0x5d7b8b);});});}function respondWithStatusCode(_0x1badb7,_0x37e30b){_0x37e30b=_0x37e30b||0xcc;return function(_0x57b3f7){if(_0x57b3f7){return _0x1badb7[_0x2348('0x24')](_0x37e30b);}return _0x1badb7[_0x2348('0x25')](_0x37e30b)['end']();};}function respondWithResult(_0x5afe2b,_0x4672a1){_0x4672a1=_0x4672a1||0xc8;return function(_0xe002ba){if(_0xe002ba){return _0x5afe2b[_0x2348('0x25')](_0x4672a1)['json'](_0xe002ba);}};}function respondWithFilteredResult(_0x2f740a,_0x456029){return function(_0x307fc5){if(_0x307fc5){var _0xf428ee=typeof _0x456029[_0x2348('0x26')]===_0x2348('0x27')&&typeof _0x456029[_0x2348('0x28')]===_0x2348('0x27');var _0x547993=_0x307fc5[_0x2348('0x29')];var _0x5f209b=_0xf428ee?0x0:_0x456029['offset'];var _0x49e1d6=_0xf428ee?_0x307fc5[_0x2348('0x29')]:_0x456029['offset']+_0x456029['limit'];var _0x396492;if(_0x49e1d6>=_0x547993){_0x49e1d6=_0x547993;_0x396492=0xc8;}else{_0x396492=0xce;}_0x2f740a[_0x2348('0x25')](_0x396492);return _0x2f740a[_0x2348('0x2a')](_0x2348('0x2b'),_0x5f209b+'-'+_0x49e1d6+'/'+_0x547993)['json'](_0x307fc5);}return null;};}function patchUpdates(_0x297282){return function(_0x5545ea){try{jsonpatch[_0x2348('0x2c')](_0x5545ea,_0x297282,!![]);}catch(_0x39975d){return BPromise[_0x2348('0x2d')](_0x39975d);}return _0x5545ea[_0x2348('0x2e')]();};}function saveUpdates(_0x287205,_0x5be131){return function(_0x1cac79){if(_0x1cac79){return _0x1cac79[_0x2348('0x2f')](_0x287205)[_0x2348('0x1a')](function(_0x4c0bc8){return _0x4c0bc8;});}return null;};}function removeEntity(_0x19d353,_0x39dc3a){return function(_0x8880c3){if(_0x8880c3){return _0x8880c3['destroy']()[_0x2348('0x1a')](function(){var _0x3d1d70=_0x8880c3[_0x2348('0x30')]({'plain':!![]});var _0xd6beb1=_0x2348('0x31');return db[_0x2348('0x32')]['destroy']({'where':{'type':_0xd6beb1,'resourceId':_0x3d1d70['id']}})[_0x2348('0x1a')](function(){return _0x8880c3;});})[_0x2348('0x1a')](function(){_0x19d353[_0x2348('0x25')](0xcc)[_0x2348('0x33')]();});}};}function handleEntityNotFound(_0x23e717,_0x12cd02){return function(_0x314b7d){if(!_0x314b7d){_0x23e717[_0x2348('0x24')](0x194);}return _0x314b7d;};}function handleError(_0x3ad2d8,_0x680a06){_0x680a06=_0x680a06||0x1f4;return function(_0x3e9b4b){logger[_0x2348('0x1f')](_0x3e9b4b[_0x2348('0x34')]);if(_0x3e9b4b[_0x2348('0x35')]){delete _0x3e9b4b[_0x2348('0x35')];}_0x3ad2d8['status'](_0x680a06)[_0x2348('0x36')](_0x3e9b4b);};}exports[_0x2348('0x37')]=function(_0x2534b9,_0x40263d){var _0x2efb21={'include':[{'model':db[_0x2348('0x38')],'as':_0x2348('0x39')}]},_0x79fb6={},_0x265b8c={'count':0x0,'rows':[]};var _0x30a619=_[_0x2348('0x3a')](db[_0x2348('0x3b')][_0x2348('0x3c')],function(_0x204b98){return{'name':_0x204b98['fieldName'],'type':_0x204b98[_0x2348('0x3d')][_0x2348('0x3e')]};});_0x79fb6['model']=_['map'](_0x30a619,_0x2348('0x35'));_0x79fb6[_0x2348('0x3f')]=_['keys'](_0x2534b9[_0x2348('0x3f')]);_0x79fb6[_0x2348('0x40')]=_[_0x2348('0x41')](_0x79fb6[_0x2348('0x42')],_0x79fb6[_0x2348('0x3f')]);_0x2efb21['attributes']=_[_0x2348('0x41')](_0x79fb6[_0x2348('0x42')],qs['fields'](_0x2534b9[_0x2348('0x3f')][_0x2348('0x43')]));_0x2efb21[_0x2348('0x44')]=_0x2efb21['attributes'][_0x2348('0x45')]?_0x2efb21[_0x2348('0x44')]:_0x79fb6['model'];if(!_0x2534b9[_0x2348('0x3f')][_0x2348('0x46')](_0x2348('0x47'))){_0x2efb21[_0x2348('0x28')]=qs[_0x2348('0x28')](_0x2534b9[_0x2348('0x3f')][_0x2348('0x28')]);_0x2efb21[_0x2348('0x26')]=qs[_0x2348('0x26')](_0x2534b9['query'][_0x2348('0x26')]);}_0x2efb21['order']=qs[_0x2348('0x48')](_0x2534b9[_0x2348('0x3f')][_0x2348('0x48')]);_0x2efb21[_0x2348('0x49')]=qs['filters'](_[_0x2348('0x4a')](_0x2534b9[_0x2348('0x3f')],_0x79fb6[_0x2348('0x40')]),_0x30a619);if(_0x2534b9[_0x2348('0x3f')][_0x2348('0x4b')]){_0x2efb21[_0x2348('0x49')]=_['merge'](_0x2efb21[_0x2348('0x49')],{'$or':_[_0x2348('0x3a')](_0x30a619,function(_0x2fc1ba){if(_0x2fc1ba[_0x2348('0x3d')]!==_0x2348('0x4c')){var _0x1adca0={};_0x1adca0[_0x2fc1ba[_0x2348('0x35')]]={'$like':'%'+_0x2534b9[_0x2348('0x3f')]['filter']+'%'};return _0x1adca0;}})});}_0x2efb21=_[_0x2348('0x4d')]({},_0x2efb21,_0x2534b9[_0x2348('0x4e')]);var _0x25d857={'where':_0x2efb21['where']};return db[_0x2348('0x3b')][_0x2348('0x29')](_0x25d857)[_0x2348('0x1a')](function(_0x1e0fe3){_0x265b8c[_0x2348('0x29')]=_0x1e0fe3;if(_0x2534b9[_0x2348('0x3f')][_0x2348('0x4f')]){_0x2efb21[_0x2348('0x50')]=[{'all':!![]}];}return db[_0x2348('0x3b')][_0x2348('0x51')](_0x2efb21);})[_0x2348('0x1a')](function(_0x1f47d1){_0x265b8c[_0x2348('0x52')]=_0x1f47d1;return _0x265b8c;})['then'](respondWithFilteredResult(_0x40263d,_0x2efb21))['catch'](handleError(_0x40263d,null));};exports[_0x2348('0x53')]=function(_0x16f65d,_0x4b5fd0){var _0x3f3e76={'raw':![],'where':{'id':_0x16f65d[_0x2348('0x54')]['id']},'include':[{'model':db[_0x2348('0x38')],'as':_0x2348('0x39')}]},_0x11d4ae={};_0x11d4ae[_0x2348('0x42')]=_[_0x2348('0x55')](db['WhatsappAccount'][_0x2348('0x3c')]);_0x11d4ae[_0x2348('0x3f')]=_[_0x2348('0x55')](_0x16f65d[_0x2348('0x3f')]);_0x11d4ae[_0x2348('0x40')]=_['intersection'](_0x11d4ae['model'],_0x11d4ae[_0x2348('0x3f')]);_0x3f3e76['attributes']=_[_0x2348('0x41')](_0x11d4ae[_0x2348('0x42')],qs[_0x2348('0x43')](_0x16f65d['query'][_0x2348('0x43')]));_0x3f3e76[_0x2348('0x44')]=_0x3f3e76['attributes'][_0x2348('0x45')]?_0x3f3e76[_0x2348('0x44')]:_0x11d4ae['model'];if(_0x16f65d[_0x2348('0x3f')][_0x2348('0x4f')]){_0x3f3e76[_0x2348('0x50')]=[{'all':!![]}];}_0x3f3e76=_[_0x2348('0x4d')]({},_0x3f3e76,_0x16f65d[_0x2348('0x4e')]);return db['WhatsappAccount'][_0x2348('0x56')](_0x3f3e76)[_0x2348('0x1a')](handleEntityNotFound(_0x4b5fd0,null))[_0x2348('0x1a')](respondWithResult(_0x4b5fd0,null))[_0x2348('0x23')](handleError(_0x4b5fd0,null));};exports['create']=function(_0x4c49ab,_0x29cc55){return db[_0x2348('0x3b')]['create'](_0x4c49ab[_0x2348('0x57')],{})[_0x2348('0x1a')](function(_0x5075a9){var _0x4be76b=_0x4c49ab[_0x2348('0x58')][_0x2348('0x30')]({'plain':!![]});if(!_0x4be76b)throw new Error(_0x2348('0x59'));if(_0x4be76b[_0x2348('0x5a')]===_0x2348('0x58')){var _0x20bbdc=_0x5075a9[_0x2348('0x30')]({'plain':!![]});var _0x48147f=_0x2348('0x31');return db[_0x2348('0x5b')][_0x2348('0x56')]({'where':{'name':_0x48147f,'userProfileId':_0x4be76b[_0x2348('0x5c')]},'raw':!![]})[_0x2348('0x1a')](function(_0xa406d0){if(_0xa406d0&&_0xa406d0['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x20bbdc[_0x2348('0x35')],'resourceId':_0x20bbdc['id'],'type':_0xa406d0[_0x2348('0x35')],'sectionId':_0xa406d0['id']},{})[_0x2348('0x1a')](function(){return _0x5075a9;});}else{return _0x5075a9;}})[_0x2348('0x23')](function(_0x426071){logger[_0x2348('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426071);throw _0x426071;});}return _0x5075a9;})['then'](respondWithResult(_0x29cc55,0xc9))[_0x2348('0x23')](handleError(_0x29cc55,null));};exports[_0x2348('0x2f')]=function(_0x195342,_0x3cbd5){if(_0x195342['body']['id']){delete _0x195342['body']['id'];}return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x195342[_0x2348('0x54')]['id']},'include':[{'model':db[_0x2348('0x38')],'as':_0x2348('0x39')}]})[_0x2348('0x1a')](handleEntityNotFound(_0x3cbd5,null))[_0x2348('0x1a')](saveUpdates(_0x195342[_0x2348('0x57')],null))['then'](respondWithResult(_0x3cbd5,null))['catch'](handleError(_0x3cbd5,null));};exports[_0x2348('0x5d')]=function(_0x40dc35,_0x3b7e61){return db['WhatsappAccount'][_0x2348('0x56')]({'where':{'id':_0x40dc35[_0x2348('0x54')]['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x3b7e61,null))[_0x2348('0x1a')](removeEntity(_0x3b7e61,null))[_0x2348('0x23')](handleError(_0x3b7e61,null));};exports[_0x2348('0x5e')]=function(_0x12423d,_0x16ae44){return db[_0x2348('0x3b')][_0x2348('0x5e')]()[_0x2348('0x1a')](respondWithResult(_0x16ae44,null))[_0x2348('0x23')](handleError(_0x16ae44,null));};exports['addDisposition']=function(_0x580824,_0xe4c45f,_0x2d6536){if(_0x580824['body']['id']){delete _0x580824[_0x2348('0x57')]['id'];}return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x580824[_0x2348('0x54')]['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0xe4c45f,null))['then'](function(_0x44c5d6){if(_0x44c5d6){_0x580824[_0x2348('0x57')]['WhatsappAccountId']=_0x44c5d6['id'];return db[_0x2348('0x5f')][_0x2348('0x60')](_0x580824['body']);}})[_0x2348('0x1a')](respondWithResult(_0xe4c45f,null))['catch'](handleError(_0xe4c45f,null));};exports[_0x2348('0x61')]=function(_0x208121,_0x489fcd,_0x16b506){var _0x594624={'raw':![],'where':{}};var _0x11a86e={};var _0x4102d1={'count':0x0,'rows':[]};return db[_0x2348('0x3b')][_0x2348('0x62')]({'where':{'id':_0x208121['params']['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x489fcd,null))['then'](function(_0x5c054b){if(_0x5c054b){_0x11a86e['model']=_[_0x2348('0x55')](db[_0x2348('0x5f')]['rawAttributes']);_0x11a86e[_0x2348('0x3f')]=_[_0x2348('0x55')](_0x208121[_0x2348('0x3f')]);_0x11a86e[_0x2348('0x40')]=_['intersection'](_0x11a86e[_0x2348('0x42')],_0x11a86e[_0x2348('0x3f')]);_0x594624[_0x2348('0x44')]=_[_0x2348('0x41')](_0x11a86e[_0x2348('0x42')],qs[_0x2348('0x43')](_0x208121['query']['fields']));_0x594624['attributes']=_0x594624[_0x2348('0x44')]['length']?_0x594624[_0x2348('0x44')]:_0x11a86e[_0x2348('0x42')];if(!_0x208121[_0x2348('0x3f')][_0x2348('0x46')](_0x2348('0x47'))){_0x594624[_0x2348('0x28')]=qs[_0x2348('0x28')](_0x208121[_0x2348('0x3f')][_0x2348('0x28')]);_0x594624[_0x2348('0x26')]=qs['offset'](_0x208121[_0x2348('0x3f')][_0x2348('0x26')]);}_0x594624[_0x2348('0x63')]=qs[_0x2348('0x48')](_0x208121[_0x2348('0x3f')][_0x2348('0x48')]);_0x594624['where']=qs[_0x2348('0x40')](_[_0x2348('0x4a')](_0x208121['query'],_0x11a86e[_0x2348('0x40')]));_0x594624['where'][_0x2348('0x64')]=_0x5c054b['id'];if(_0x208121[_0x2348('0x3f')][_0x2348('0x4b')]){_0x594624[_0x2348('0x49')]=_['merge'](_0x594624['where'],{'$or':_[_0x2348('0x3a')](_0x594624['attributes'],function(_0xf5ca12){var _0x5550b9={};_0x5550b9[_0xf5ca12]={'$like':'%'+_0x208121['query'][_0x2348('0x4b')]+'%'};return _0x5550b9;})});}_0x594624=_[_0x2348('0x4d')]({},_0x594624,_0x208121[_0x2348('0x4e')]);return db[_0x2348('0x5f')]['count']({'where':_0x594624['where']})['then'](function(_0x38c5ca){_0x4102d1[_0x2348('0x29')]=_0x38c5ca;if(_0x208121[_0x2348('0x3f')][_0x2348('0x4f')]){_0x594624[_0x2348('0x50')]=[{'all':!![]}];}return db[_0x2348('0x5f')][_0x2348('0x51')](_0x594624);})['then'](function(_0x1e5693){_0x4102d1[_0x2348('0x52')]=_0x1e5693;return _0x4102d1;});}})['then'](respondWithFilteredResult(_0x489fcd,_0x594624))[_0x2348('0x23')](handleError(_0x489fcd,null));};exports[_0x2348('0x65')]=function(_0x56566a,_0xc35e32,_0x4f6627){return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x56566a['params']['id']}})['then'](handleEntityNotFound(_0xc35e32,null))[_0x2348('0x1a')](function(_0x329ac1){if(_0x329ac1){return _0x329ac1[_0x2348('0x65')](_0x56566a['query'][_0x2348('0x66')]);}})[_0x2348('0x1a')](respondWithStatusCode(_0xc35e32,null))[_0x2348('0x23')](handleError(_0xc35e32,null));};exports[_0x2348('0x67')]=function(_0x5a9a3e,_0x164754,_0x7b0900){if(_0x5a9a3e['body']['id']){delete _0x5a9a3e[_0x2348('0x57')]['id'];}return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x5a9a3e[_0x2348('0x54')]['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x164754,null))['then'](function(_0x1acc47){if(_0x1acc47){_0x5a9a3e['body'][_0x2348('0x64')]=_0x1acc47['id'];return db['CannedAnswer'][_0x2348('0x60')](_0x5a9a3e[_0x2348('0x57')]);}})['then'](respondWithResult(_0x164754,null))[_0x2348('0x23')](handleError(_0x164754,null));};exports[_0x2348('0x68')]=function(_0x3c2e99,_0x375bfe,_0x46e0ef){var _0x3b7ba9={'raw':![],'where':{}};var _0x109652={};var _0x40100a={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2348('0x62')]({'where':{'id':_0x3c2e99[_0x2348('0x54')]['id']}})['then'](handleEntityNotFound(_0x375bfe,null))[_0x2348('0x1a')](function(_0x106ce0){if(_0x106ce0){_0x109652['model']=_[_0x2348('0x55')](db[_0x2348('0x69')][_0x2348('0x3c')]);_0x109652[_0x2348('0x3f')]=_[_0x2348('0x55')](_0x3c2e99[_0x2348('0x3f')]);_0x109652[_0x2348('0x40')]=_[_0x2348('0x41')](_0x109652[_0x2348('0x42')],_0x109652[_0x2348('0x3f')]);_0x3b7ba9['attributes']=_[_0x2348('0x41')](_0x109652[_0x2348('0x42')],qs[_0x2348('0x43')](_0x3c2e99[_0x2348('0x3f')][_0x2348('0x43')]));_0x3b7ba9[_0x2348('0x44')]=_0x3b7ba9[_0x2348('0x44')][_0x2348('0x45')]?_0x3b7ba9[_0x2348('0x44')]:_0x109652['model'];if(!_0x3c2e99['query'][_0x2348('0x46')](_0x2348('0x47'))){_0x3b7ba9[_0x2348('0x28')]=qs[_0x2348('0x28')](_0x3c2e99[_0x2348('0x3f')]['limit']);_0x3b7ba9[_0x2348('0x26')]=qs[_0x2348('0x26')](_0x3c2e99['query']['offset']);}_0x3b7ba9[_0x2348('0x63')]=qs[_0x2348('0x48')](_0x3c2e99[_0x2348('0x3f')][_0x2348('0x48')]);_0x3b7ba9[_0x2348('0x49')]=qs[_0x2348('0x40')](_[_0x2348('0x4a')](_0x3c2e99['query'],_0x109652[_0x2348('0x40')]));_0x3b7ba9[_0x2348('0x49')][_0x2348('0x64')]=_0x106ce0['id'];if(_0x3c2e99[_0x2348('0x3f')][_0x2348('0x4b')]){_0x3b7ba9[_0x2348('0x49')]=_[_0x2348('0x4d')](_0x3b7ba9['where'],{'$or':_['map'](_0x3b7ba9[_0x2348('0x44')],function(_0x187591){var _0x3b91e3={};_0x3b91e3[_0x187591]={'$like':'%'+_0x3c2e99['query']['filter']+'%'};return _0x3b91e3;})});}_0x3b7ba9=_['merge']({},_0x3b7ba9,_0x3c2e99['options']);return db[_0x2348('0x69')][_0x2348('0x29')]({'where':_0x3b7ba9['where']})[_0x2348('0x1a')](function(_0x13cd7c){_0x40100a['count']=_0x13cd7c;if(_0x3c2e99['query'][_0x2348('0x4f')]){_0x3b7ba9[_0x2348('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2348('0x51')](_0x3b7ba9);})['then'](function(_0x5127fb){_0x40100a[_0x2348('0x52')]=_0x5127fb;return _0x40100a;});}})[_0x2348('0x1a')](respondWithFilteredResult(_0x375bfe,_0x3b7ba9))['catch'](handleError(_0x375bfe,null));};exports[_0x2348('0x6a')]=function(_0x1d3a6a,_0x515943,_0x8ab436){return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x1d3a6a['params']['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x515943,null))[_0x2348('0x1a')](function(_0x3c5f13){if(_0x3c5f13){return _0x3c5f13[_0x2348('0x6a')](_0x1d3a6a['query'][_0x2348('0x66')]);}})['then'](respondWithStatusCode(_0x515943,null))[_0x2348('0x23')](handleError(_0x515943,null));};exports['addAgents']=function(_0x44fdfa,_0x495c01,_0x487f6f){return db[_0x2348('0x3b')][_0x2348('0x56')]({'where':{'id':_0x44fdfa[_0x2348('0x54')]['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x495c01,null))[_0x2348('0x1a')](function(_0x4f0c50){if(_0x4f0c50){return _0x4f0c50[_0x2348('0x6b')](_0x44fdfa[_0x2348('0x57')]['ids'],_[_0x2348('0x6c')](_0x44fdfa[_0x2348('0x57')],[_0x2348('0x66'),'id'])||{})[_0x2348('0x6d')](function(_0x103d5c){for(var _0x30f4e9=0x0;_0x30f4e9<_0x44fdfa[_0x2348('0x57')][_0x2348('0x66')][_0x2348('0x45')];_0x30f4e9+=0x1){socket[_0x2348('0x6e')](_0x2348('0x6f'),{'UserId':Number(_0x44fdfa[_0x2348('0x57')]['ids'][_0x30f4e9]),'WhatsappAccountId':Number(_0x44fdfa[_0x2348('0x54')]['id'])});}return _0x103d5c;});}})[_0x2348('0x1a')](respondWithResult(_0x495c01,null))[_0x2348('0x23')](handleError(_0x495c01,null));};exports['removeAgents']=function(_0x3e6e4b,_0x3e0c46,_0x5ce872){return db['WhatsappAccount']['find']({'where':{'id':_0x3e6e4b['params']['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x3e0c46,null))[_0x2348('0x1a')](function(_0x32e676){if(_0x32e676){return _0x32e676[_0x2348('0x70')](_0x3e6e4b[_0x2348('0x3f')][_0x2348('0x66')])['then'](function(){if(_['isArray'](_0x3e6e4b['query'][_0x2348('0x66')])){for(var _0x4b949e=0x0;_0x4b949e<_0x3e6e4b[_0x2348('0x3f')][_0x2348('0x66')][_0x2348('0x45')];_0x4b949e+=0x1){socket['emit'](_0x2348('0x71'),{'UserId':Number(_0x3e6e4b[_0x2348('0x3f')][_0x2348('0x66')][_0x4b949e]),'WhatsappAccountId':Number(_0x3e6e4b[_0x2348('0x54')]['id'])});}}else{socket[_0x2348('0x6e')](_0x2348('0x71'),{'UserId':Number(_0x3e6e4b[_0x2348('0x3f')][_0x2348('0x66')]),'WhatsappAccountId':Number(_0x3e6e4b[_0x2348('0x54')]['id'])});}});}})[_0x2348('0x1a')](respondWithStatusCode(_0x3e0c46,null))[_0x2348('0x23')](handleError(_0x3e0c46,null));};exports[_0x2348('0x72')]=function(_0x5b68d1,_0x45d6df,_0x13cde3){var _0x1cc2f6={};var _0x4340b7={};var _0x94ddcc;var _0x2fa91f;return db[_0x2348('0x3b')]['findOne']({'where':{'id':_0x5b68d1['params']['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x45d6df,null))[_0x2348('0x1a')](function(_0x386ebd){if(_0x386ebd){_0x94ddcc=_0x386ebd;_0x4340b7[_0x2348('0x42')]=_[_0x2348('0x55')](db['User'][_0x2348('0x3c')]);_0x4340b7['query']=_[_0x2348('0x55')](_0x5b68d1[_0x2348('0x3f')]);_0x4340b7['filters']=_['intersection'](_0x4340b7[_0x2348('0x42')],_0x4340b7[_0x2348('0x3f')]);_0x1cc2f6[_0x2348('0x44')]=_[_0x2348('0x41')](_0x4340b7[_0x2348('0x42')],qs['fields'](_0x5b68d1[_0x2348('0x3f')][_0x2348('0x43')]));_0x1cc2f6[_0x2348('0x44')]=_0x1cc2f6[_0x2348('0x44')][_0x2348('0x45')]?_0x1cc2f6[_0x2348('0x44')]:_0x4340b7['model'];_0x1cc2f6[_0x2348('0x63')]=qs[_0x2348('0x48')](_0x5b68d1['query'][_0x2348('0x48')]);_0x1cc2f6['where']=qs[_0x2348('0x40')](_[_0x2348('0x4a')](_0x5b68d1['query'],_0x4340b7[_0x2348('0x40')]));if(_0x5b68d1['query']['filter']){_0x1cc2f6['where']=_[_0x2348('0x4d')](_0x1cc2f6[_0x2348('0x49')],{'$or':_[_0x2348('0x3a')](_0x1cc2f6[_0x2348('0x44')],function(_0x3daa4b){var _0x2ccfea={};_0x2ccfea[_0x3daa4b]={'$like':'%'+_0x5b68d1['query']['filter']+'%'};return _0x2ccfea;})});}_0x1cc2f6=_[_0x2348('0x4d')]({},_0x1cc2f6,_0x5b68d1[_0x2348('0x4e')]);return _0x94ddcc[_0x2348('0x72')](_0x1cc2f6);}})['then'](function(_0x2ed2ec){if(_0x2ed2ec){_0x2fa91f=_0x2ed2ec[_0x2348('0x45')];if(!_0x5b68d1[_0x2348('0x3f')][_0x2348('0x46')](_0x2348('0x47'))){_0x1cc2f6[_0x2348('0x28')]=qs[_0x2348('0x28')](_0x5b68d1[_0x2348('0x3f')][_0x2348('0x28')]);_0x1cc2f6[_0x2348('0x26')]=qs[_0x2348('0x26')](_0x5b68d1[_0x2348('0x3f')]['offset']);}return _0x94ddcc[_0x2348('0x72')](_0x1cc2f6);}})[_0x2348('0x1a')](function(_0x239b0c){if(_0x239b0c){return _0x239b0c?{'count':_0x2fa91f,'rows':_0x239b0c}:null;}})['then'](respondWithResult(_0x45d6df,null))[_0x2348('0x23')](handleError(_0x45d6df,null));};exports['addApplications']=function(_0x25b6f8,_0x5d107c){var _0x25e421=_0x25b6f8[_0x2348('0x54')]['id'];var _0x128d6d=_0x25b6f8[_0x2348('0x57')];var _0x970558=0xc8;var _0x357662=null;return db[_0x2348('0x73')]['transaction']({'isolationLevel':db[_0x2348('0x73')][_0x2348('0x74')][_0x2348('0x75')]['READ_COMMITTED']},function(_0x10a240){return db[_0x2348('0x3b')][_0x2348('0x62')]({'where':{'id':_0x25e421},'transaction':_0x10a240})['then'](function(_0x400326){if(_0x400326){return db[_0x2348('0x76')]['destroy']({'where':{'WhatsappAccountId':_0x25e421},'transaction':_0x10a240})[_0x2348('0x1a')](function(){var _0x8c3096=_['map'](_0x128d6d,function(_0x3da28b){_0x3da28b[_0x2348('0x64')]=_0x25e421;return _0x3da28b;});return db[_0x2348('0x76')][_0x2348('0x77')](_0x8c3096,{'transaction':_0x10a240});});}else{_0x970558=0x194;_0x357662=[];}});})[_0x2348('0x1a')](function(){if(_0x970558!==0x194){return db[_0x2348('0x76')][_0x2348('0x78')]({'where':{'WhatsappAccountId':_0x25e421},'order':_0x2348('0x79')})[_0x2348('0x1a')](function(_0x531198){_0x357662=_0x531198;});}})['catch'](function(_0x293858){_0x970558=0x1f4;logger[_0x2348('0x1f')](_0x293858[_0x2348('0x34')]);if(_0x293858[_0x2348('0x35')]){delete _0x293858[_0x2348('0x35')];}_0x357662=_0x293858;})[_0x2348('0x7a')](function(){if(_0x357662===null){_0x5d107c['sendStatus'](_0x970558);}else{if(_0x970558===0x1f4){_0x5d107c[_0x2348('0x25')](_0x970558)[_0x2348('0x36')](_0x357662);}else{_0x5d107c['status'](_0x970558)[_0x2348('0x7b')](_0x357662);}}});};exports[_0x2348('0x7c')]=function(_0x24cbc9,_0x4c721e,_0x262ab8){var _0x26b79a={};var _0x74cd4f={};var _0x50b87a;var _0x48986f;return db[_0x2348('0x3b')]['findOne']({'where':{'id':_0x24cbc9[_0x2348('0x54')]['id']}})[_0x2348('0x1a')](handleEntityNotFound(_0x4c721e,null))[_0x2348('0x1a')](function(_0x27f77c){if(_0x27f77c){_0x50b87a=_0x27f77c;_0x74cd4f[_0x2348('0x42')]=_[_0x2348('0x55')](db[_0x2348('0x76')]['rawAttributes']);_0x74cd4f[_0x2348('0x3f')]=_[_0x2348('0x55')](_0x24cbc9['query']);_0x74cd4f[_0x2348('0x40')]=_[_0x2348('0x41')](_0x74cd4f['model'],_0x74cd4f['query']);_0x26b79a[_0x2348('0x44')]=_[_0x2348('0x41')](_0x74cd4f[_0x2348('0x42')],qs[_0x2348('0x43')](_0x24cbc9['query']['fields']));_0x26b79a['attributes']=_0x26b79a[_0x2348('0x44')][_0x2348('0x45')]?_0x26b79a[_0x2348('0x44')]:_0x74cd4f[_0x2348('0x42')];_0x26b79a[_0x2348('0x63')]=qs[_0x2348('0x48')](_0x24cbc9[_0x2348('0x3f')][_0x2348('0x48')]);_0x26b79a[_0x2348('0x49')]=qs['filters'](_[_0x2348('0x4a')](_0x24cbc9[_0x2348('0x3f')],_0x74cd4f[_0x2348('0x40')]));if(_0x24cbc9['query'][_0x2348('0x4b')]){_0x26b79a[_0x2348('0x49')]=_['merge'](_0x26b79a[_0x2348('0x49')],{'$or':_[_0x2348('0x3a')](_0x26b79a[_0x2348('0x44')],function(_0x2df696){var _0x7b7fc3={};_0x7b7fc3[_0x2df696]={'$like':'%'+_0x24cbc9[_0x2348('0x3f')][_0x2348('0x4b')]+'%'};return _0x7b7fc3;})});}_0x26b79a=_[_0x2348('0x4d')]({},_0x26b79a,_0x24cbc9[_0x2348('0x4e')]);return _0x50b87a[_0x2348('0x7c')](_0x26b79a);}})[_0x2348('0x1a')](function(_0x12f4f2){if(_0x12f4f2){_0x48986f=_0x12f4f2[_0x2348('0x45')];if(!_0x24cbc9[_0x2348('0x3f')][_0x2348('0x46')](_0x2348('0x47'))){_0x26b79a['limit']=qs[_0x2348('0x28')](_0x24cbc9[_0x2348('0x3f')][_0x2348('0x28')]);_0x26b79a[_0x2348('0x26')]=qs['offset'](_0x24cbc9['query'][_0x2348('0x26')]);}return _0x50b87a[_0x2348('0x7c')](_0x26b79a);}})['then'](function(_0x16d3f3){if(_0x16d3f3){return _0x16d3f3?{'count':_0x48986f,'rows':_0x16d3f3}:null;}})['then'](respondWithResult(_0x4c721e,null))['catch'](handleError(_0x4c721e,null));};exports[_0x2348('0x7d')]=function(_0x449fba,_0x217a42,_0x135483){var _0x39e8b4={'channel':_0x2348('0x7e')};var _0x270ebf=[];var _0x499c7a=[];var _0x1b096e={};return db['WhatsappAccount'][_0x2348('0x56')]({'where':{'id':_0x449fba[_0x2348('0x54')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x2348('0x7f')}]})[_0x2348('0x1a')](handleEntityNotFound(_0x217a42,null))[_0x2348('0x1a')](function(_0x59198d){_0x39e8b4[_0x2348('0x80')]=_0x59198d;if(_0x39e8b4[_0x2348('0x80')]&&_0x39e8b4[_0x2348('0x80')][_0x2348('0x3d')]===_0x2348('0x81')&&_0x449fba[_0x2348('0x57')][_0x2348('0x82')]){if(_0x449fba[_0x2348('0x57')][_0x2348('0x82')][_0x2348('0x45')]===0x0)return;if(_0x449fba['body']['statuses'][0x0][_0x2348('0x83')]!==_0x2348('0x84'))return;return db[_0x2348('0x85')][_0x2348('0x2f')]({'read':!![],'readAt':_0x449fba[_0x2348('0x57')]['statuses'][0x0][_0x2348('0x86')]},{'where':{'messageId':_0x449fba['body']['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x3ae508){return _0x217a42[_0x2348('0x25')](0xc8)[_0x2348('0x7b')](_0x3ae508);});}_0x39e8b4[_0x2348('0x87')]=_[_0x2348('0x88')](_0x59198d['Applications'],[_0x2348('0x79')],[_0x2348('0x89')]);if(_0x39e8b4['account'][_0x2348('0x7f')]){delete _0x39e8b4['account']['Applications'];}return db['CmContact'][_0x2348('0x5e')]()['then'](function(_0x5bff4d){if(!_0x5bff4d){throw new db[(_0x2348('0x8a'))]['ValidationError'](_0x2348('0x8b'));}_0x270ebf=_[_0x2348('0x8c')](_[_0x2348('0x55')](_0x5bff4d),[_0x2348('0x8d'),_0x2348('0x8e')]);_0x499c7a=_[_0x2348('0x8c')](_['keys'](_0x5bff4d),['createdAt',_0x2348('0x8e'),_0x2348('0x8f'),_0x2348('0x90')]);_0x39e8b4[_0x2348('0x57')]={'mapKey':'mobile'};if(_0x39e8b4[_0x2348('0x80')]&&_0x39e8b4[_0x2348('0x80')][_0x2348('0x3d')]===_0x2348('0x91')){_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')]=_0x449fba[_0x2348('0x57')]['From'][_0x2348('0x93')]('whatsapp:','');_0x39e8b4['body']['body']=_0x449fba[_0x2348('0x57')][_0x2348('0x94')];_0x39e8b4[_0x2348('0x57')][_0x2348('0x95')]=_0x449fba[_0x2348('0x57')][_0x2348('0x96')];}if(_0x39e8b4['account']&&_0x39e8b4['account'][_0x2348('0x3d')]==='sinch'){_0x39e8b4['body'][_0x2348('0x92')]=_0x449fba[_0x2348('0x57')][_0x2348('0x97')][0x0][_0x2348('0x92')];_0x39e8b4[_0x2348('0x57')][_0x2348('0x57')]=_0x449fba['body'][_0x2348('0x97')][0x0][_0x2348('0x21')][_0x2348('0x57')];_0x39e8b4[_0x2348('0x57')]['messageId']=_0x449fba[_0x2348('0x57')][_0x2348('0x97')][0x0]['message_id'];}if(_0x39e8b4[_0x2348('0x57')]['id']){delete _0x39e8b4[_0x2348('0x57')]['id'];}if(_[_0x2348('0x98')](_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')])){throw new db[(_0x2348('0x8a'))][(_0x2348('0x99'))](_0x2348('0x9a'));}if(_[_0x2348('0x98')](_0x39e8b4[_0x2348('0x57')][_0x2348('0x57')])||_0x39e8b4[_0x2348('0x57')][_0x2348('0x57')]===''){throw new db[(_0x2348('0x8a'))]['ValidationError'](_0x2348('0x9b'));}if(_[_0x2348('0x98')](_0x39e8b4['body'][_0x2348('0x9c')])){throw new db[(_0x2348('0x8a'))][(_0x2348('0x99'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x499c7a);}if(!_['includes'](_0x499c7a,_0x39e8b4[_0x2348('0x57')]['mapKey'])){throw new db['Sequelize'][(_0x2348('0x99'))](_0x2348('0x9d')+_0x499c7a);}_0x1b096e[_0x39e8b4[_0x2348('0x57')][_0x2348('0x9c')]]=_0x39e8b4[_0x2348('0x57')]['from'];return db[_0x2348('0x9e')][_0x2348('0x56')]({'where':{'id':_0x39e8b4[_0x2348('0x80')][_0x2348('0x90')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1b096e,'limit':0x1,'order':[[_0x2348('0x8e'),'DESC']]}]});})[_0x2348('0x1a')](handleEntityNotFound(_0x217a42,null))[_0x2348('0x1a')](function(_0xb88f77){if(_0xb88f77){_0x39e8b4[_0x2348('0x9f')]=_[_0x2348('0x6c')](_0xb88f77,[_0x2348('0xa0')]);if(_0xb88f77['Contacts'][_0x2348('0x45')]){return _0xb88f77[_0x2348('0xa0')][0x0];}var _0x1e1169=_[_0x2348('0x12')](_0x39e8b4['body'],{'firstName':_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')],'ListId':_0xb88f77['id']});_0x1e1169[_0x39e8b4[_0x2348('0x57')][_0x2348('0x9c')]]=_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')];return db[_0x2348('0xa1')][_0x2348('0x60')](_0x1e1169,{'fields':_0x270ebf,'raw':!![]});}})[_0x2348('0x1a')](handleEntityNotFound(_0x217a42,null))[_0x2348('0x1a')](function(_0x469ad1){if(_0x469ad1){_0x39e8b4[_0x2348('0xa2')]=_0x469ad1;var _0x4f0cfc={'ContactId':_0x469ad1['id'],'phone':_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')],'WhatsappAccountId':_0x449fba[_0x2348('0x54')]['id']};var _0x33ed40={'ContactId':_0x469ad1['id'],'WhatsappAccountId':_0x449fba[_0x2348('0x54')]['id'],'closed':![]};return db[_0x2348('0xa3')][_0x2348('0x56')]({'where':_0x33ed40})['then'](function(_0x335ef3){if(_0x335ef3){return[_0x335ef3,![]];}return db[_0x2348('0xa3')][_0x2348('0x60')](_0x4f0cfc)['then'](function(_0x1d6937){return[_0x1d6937,!![]];});});}})[_0x2348('0x6d')](function(_0x46071b,_0x246068){_0x39e8b4['interaction']=_0x46071b['get']({'plain':!![]});_0x39e8b4[_0x2348('0xa4')][_0x2348('0xa5')]=![];if(_0x246068){if(_0x39e8b4[_0x2348('0x80')]['autoclose']){_0x39e8b4[_0x2348('0x87')][_0x2348('0xa6')]({'id':0x0,'priority':_0x39e8b4['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x2348('0xa7')});}_0x39e8b4[_0x2348('0xa4')][_0x2348('0xa5')]=!![];}return db[_0x2348('0x85')]['create']({'phone':_0x39e8b4[_0x2348('0x57')][_0x2348('0x92')],'messageId':_0x39e8b4['body'][_0x2348('0x95')],'body':_0x39e8b4['body'][_0x2348('0x57')],'WhatsappAccountId':_0x449fba['params']['id'],'WhatsappInteractionId':_0x46071b['id'],'direction':'in','ContactId':_0x46071b[_0x2348('0xa8')],'AttachmentId':_0x39e8b4['body'][_0x2348('0xa9')]});})[_0x2348('0x1a')](function(_0x4cea21){_0x39e8b4[_0x2348('0x21')]=_0x4cea21;if(_0x39e8b4[_0x2348('0xa4')][_0x2348('0xaa')]){return db[_0x2348('0xab')][_0x2348('0x56')]({'attributes':['id',_0x2348('0x35')],'where':{'id':_0x39e8b4[_0x2348('0xa4')][_0x2348('0xaa')]}})[_0x2348('0x1a')](function(_0x10b60c){if(_0x10b60c){_0x39e8b4[_0x2348('0x87')][_0x2348('0xac')]({'id':0x0,'priority':0x0,'app':_0x2348('0xad'),'appdata':_0x10b60c[_0x2348('0x35')]+','+(_0x39e8b4['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2348('0xae'),_0x2348('0xaf'),_0x39e8b4);});}return respondWithRpcPromise('Start','startRouting',_0x39e8b4);})[_0x2348('0x1a')](function(_0x186e2e){if(_0x186e2e){var _0x4b41e4=0xc8;var _0x264f1e=_0x2348('0xb0');logger[_0x2348('0x1b')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x264f1e,_0x4b41e4,_0x2348('0xb1'));logger[_0x2348('0xb2')](_0x2348('0xb3'),_0x264f1e,_0x4b41e4,_0x2348('0xb1'),JSON[_0x2348('0x1e')](_0x186e2e));if(_0x39e8b4[_0x2348('0x80')][_0x2348('0x3d')]===_0x2348('0x91')){return _0x217a42[_0x2348('0x25')](_0x4b41e4)[_0x2348('0x2a')](_0x2348('0xb4'),'text/xml')[_0x2348('0x36')](_0x2348('0xb5'));}else{return _0x217a42[_0x2348('0x25')](_0x4b41e4)['json'](_0x186e2e);}}});})[_0x2348('0x23')](handleError(_0x217a42,null));};exports['send']=function(_0x3a9443,_0x128d4a,_0x5c7d0e){var _0x443765,_0x59d098,_0x39ca5f;if(_['isNil'](_0x3a9443[_0x2348('0x57')][_0x2348('0x57')])||_0x3a9443[_0x2348('0x57')][_0x2348('0x57')]===''){throw new db[(_0x2348('0x8a'))][(_0x2348('0x99'))](_0x2348('0x9b'));}if(_[_0x2348('0x98')](_0x3a9443['body']['to'])){throw new db[(_0x2348('0x8a'))]['ValidationError']('to\x20is\x20mandatory');}_0x443765=_0x3a9443[_0x2348('0x57')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x3a9443[_0x2348('0x54')]['id']},'include':[{'model':db[_0x2348('0x9e')],'as':_0x2348('0xb6'),'include':[{'model':db[_0x2348('0xa1')],'as':'Contacts','where':{'mobile':_0x443765},'limit':0x1,'order':[[_0x2348('0x8e'),_0x2348('0xb7')]]}]}]})[_0x2348('0x1a')](handleEntityNotFound(_0x128d4a,null))[_0x2348('0x1a')](function(_0x4843d9){if(_0x4843d9&&_0x4843d9['List']){_0x59d098=_0x4843d9[_0x2348('0x30')]({'plain':!![]});if(_0x59d098['List']&&_0x59d098['List'][_0x2348('0xa0')]['length']){return _0x59d098[_0x2348('0xb6')][_0x2348('0xa0')][0x0];}return db[_0x2348('0xa1')]['create'](_[_0x2348('0x12')](_0x3a9443[_0x2348('0x57')],{'firstName':_0x443765,'mobile':_0x443765,'phone':_0x443765,'ListId':_0x59d098[_0x2348('0x90')]}));}})[_0x2348('0x1a')](handleEntityNotFound(_0x128d4a,null))['then'](function(_0x2d61b9){if(_0x2d61b9){_0x39ca5f=_0x2d61b9;return db['WhatsappInteraction'][_0x2348('0x56')]({'where':{'ContactId':_0x39ca5f['id'],'closed':![],'WhatsappAccountId':_0x59d098['id']}})['then'](function(_0x1f5901){if(_0x1f5901){return[_0x1f5901,![]];}return db[_0x2348('0xa3')]['create']({'UserId':_0x3a9443[_0x2348('0x58')]['id'],'ContactId':_0x39ca5f['id'],'WhatsappAccountId':_0x59d098['id'],'phone':_0x443765,'firstMsgDirection':'out','Messages':[_['merge'](_0x3a9443[_0x2348('0x57')],{'read':![],'body':_0x3a9443[_0x2348('0x57')][_0x2348('0x57')],'phone':_0x443765,'WhatsappAccountId':_0x59d098['id'],'UserId':_0x3a9443[_0x2348('0x58')]['id'],'ContactId':_0x39ca5f['id']})]},{'include':[{'model':db[_0x2348('0x85')],'as':'Messages'}]})[_0x2348('0x1a')](function(_0x2a8374){return[_0x2a8374,!![]];});});}})['spread'](function(_0x5077e2,_0x3b9c2f){if(_0x3b9c2f){return _0x5077e2;}return db[_0x2348('0x85')][_0x2348('0x60')](_[_0x2348('0x4d')](_0x3a9443['body'],{'read':![],'body':_0x3a9443['body'][_0x2348('0x57')],'phone':_0x443765,'WhatsappAccountId':_0x59d098['id'],'WhatsappInteractionId':_0x5077e2['id'],'UserId':_0x3a9443['user']['id'],'ContactId':_0x39ca5f['id']}))['then'](function(_0x39daec){_0x5077e2[_0x2348('0xb8')]['Messages']=[];_0x5077e2[_0x2348('0xb8')][_0x2348('0xb9')][_0x2348('0xa6')](_0x39daec[_0x2348('0xb8')]);return _0x5077e2;});})[_0x2348('0x1a')](respondWithResult(_0x128d4a,null))[_0x2348('0x23')](handleError(_0x128d4a,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ed8c5c7..f235e9e 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 _0xf783=['update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save'];(function(_0x46ebdd,_0x1e07dc){var _0x41d84e=function(_0x58237a){while(--_0x58237a){_0x46ebdd['push'](_0x46ebdd['shift']());}};_0x41d84e(++_0x1e07dc);}(_0xf783,0x146));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3f78('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x3f78('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x3f78('0x2')](0x0);var events={'afterCreate':_0x3f78('0x3'),'afterUpdate':_0x3f78('0x4'),'afterDestroy':_0x3f78('0x5')};function emitEvent(_0x4b2504){return function(_0x416103,_0x4d4bf6,_0x4f1f52){WhatsappAccountEvents['emit'](_0x4b2504+':'+_0x416103['id'],_0x416103);WhatsappAccountEvents[_0x3f78('0x6')](_0x4b2504,_0x416103);_0x4f1f52(null);};}for(var e in events){if(events[_0x3f78('0x7')](e)){var event=events[e];WhatsappAccount[_0x3f78('0x8')](e,emitEvent(event));}}module[_0x3f78('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x80ad=['save','remove','emit','hook','exports','events','WhatsappAccount','setMaxListeners'];(function(_0x4944d6,_0x3e699b){var _0x4c988f=function(_0x451dca){while(--_0x451dca){_0x4944d6['push'](_0x4944d6['shift']());}};_0x4c988f(++_0x3e699b);}(_0x80ad,0x6d));var _0xd80a=function(_0x376c18,_0x2bf6ba){_0x376c18=_0x376c18-0x0;var _0x4aee4c=_0x80ad[_0x376c18];return _0x4aee4c;};'use strict';var EventEmitter=require(_0xd80a('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xd80a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd80a('0x2')](0x0);var events={'afterCreate':_0xd80a('0x3'),'afterUpdate':'update','afterDestroy':_0xd80a('0x4')};function emitEvent(_0x211a35){return function(_0x42a71a,_0x5abc03,_0x545359){WhatsappAccountEvents[_0xd80a('0x5')](_0x211a35+':'+_0x42a71a['id'],_0x42a71a);WhatsappAccountEvents[_0xd80a('0x5')](_0x211a35,_0x42a71a);_0x545359(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xd80a('0x6')](e,emitEvent(event));}}module[_0xd80a('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 97fac90..f826bbf 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 _0xab8f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x2866d3,_0x1ddcdf){var _0x1fc932=function(_0x22cda9){while(--_0x22cda9){_0x2866d3['push'](_0x2866d3['shift']());}};_0x1fc932(++_0x1ddcdf);}(_0xab8f,0x11e));var _0xfab8=function(_0x46032b,_0x134ff2){_0x46032b=_0x46032b-0x0;var _0x443303=_0xab8f[_0x46032b];return _0x443303;};'use strict';var _=require(_0xfab8('0x0'));var util=require(_0xfab8('0x1'));var logger=require(_0xfab8('0x2'))(_0xfab8('0x3'));var moment=require('moment');var BPromise=require(_0xfab8('0x4'));var rp=require(_0xfab8('0x5'));var fs=require('fs');var path=require(_0xfab8('0x6'));var rimraf=require(_0xfab8('0x7'));var config=require(_0xfab8('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0xfab8('0x9')]=function(_0x5976be,_0x34129a){return _0x5976be[_0xfab8('0xa')](_0xfab8('0xb'),attributes,{'tableName':_0xfab8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc04=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xbc04,0x1a3));var _0x4bc0=function(_0x46e41b,_0x496cf9){_0x46e41b=_0x46e41b-0x0;var _0x13e4e5=_0xbc04[_0x46e41b];return _0x13e4e5;};'use strict';var _=require(_0x4bc0('0x0'));var util=require(_0x4bc0('0x1'));var logger=require('../../config/logger')(_0x4bc0('0x2'));var moment=require(_0x4bc0('0x3'));var BPromise=require(_0x4bc0('0x4'));var rp=require(_0x4bc0('0x5'));var fs=require('fs');var path=require(_0x4bc0('0x6'));var rimraf=require(_0x4bc0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4bc0('0x8'));module[_0x4bc0('0x9')]=function(_0x7dac6a,_0x160c72){return _0x7dac6a[_0x4bc0('0xa')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index fd451c0..546db48 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 _0xb46c=['code','message','ShowWhatsappAccount','find','options','raw','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xb46c,0x17d));var _0xcb46=function(_0x355ef1,_0x5e5a74){_0x355ef1=_0x355ef1-0x0;var _0x666a44=_0xb46c[_0x355ef1];return _0x666a44;};'use strict';var _=require(_0xcb46('0x0'));var util=require('util');var moment=require(_0xcb46('0x1'));var BPromise=require(_0xcb46('0x2'));var rs=require(_0xcb46('0x3'));var fs=require('fs');var Redis=require(_0xcb46('0x4'));var db=require(_0xcb46('0x5'))['db'];var utils=require(_0xcb46('0x6'));var logger=require(_0xcb46('0x7'))(_0xcb46('0x8'));var config=require(_0xcb46('0x9'));var jayson=require(_0xcb46('0xa'));var client=jayson['client'][_0xcb46('0xb')]({'port':0x232a});config[_0xcb46('0xc')]=_[_0xcb46('0xd')](config['redis'],{'host':_0xcb46('0xe'),'port':0x18eb});var socket=require(_0xcb46('0xf'))(new Redis(config[_0xcb46('0xc')]));require(_0xcb46('0x10'))[_0xcb46('0x11')](socket);function respondWithRpcPromise(_0x25f575,_0x3d9f93,_0x2c598f){return new BPromise(function(_0xd5b26b,_0x3dd8d5){return client[_0xcb46('0x12')](_0x25f575,_0x2c598f)[_0xcb46('0x13')](function(_0x38de6b){logger[_0xcb46('0x14')](_0xcb46('0x15'),_0x3d9f93,_0xcb46('0x16'));logger[_0xcb46('0x17')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3d9f93,_0xcb46('0x16'),JSON[_0xcb46('0x18')](_0x38de6b));if(_0x38de6b[_0xcb46('0x19')]){if(_0x38de6b[_0xcb46('0x19')][_0xcb46('0x1a')]===0x1f4){logger[_0xcb46('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x3d9f93,_0x38de6b['error'][_0xcb46('0x1b')]);return _0x3dd8d5(_0x38de6b[_0xcb46('0x19')][_0xcb46('0x1b')]);}logger[_0xcb46('0x19')](_0xcb46('0x15'),_0x3d9f93,_0x38de6b[_0xcb46('0x19')][_0xcb46('0x1b')]);return _0xd5b26b(_0x38de6b[_0xcb46('0x19')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x3d9f93,_0xcb46('0x16'));_0xd5b26b(_0x38de6b['result'][_0xcb46('0x1b')]);}})['catch'](function(_0x9c06a1){logger[_0xcb46('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x3d9f93,_0x9c06a1);_0x3dd8d5(_0x9c06a1);});});}exports[_0xcb46('0x1c')]=function(_0x1469cb){var _0xaca67f=this;return new Promise(function(_0x1eb586,_0x53f2a4){return db['WhatsappAccount'][_0xcb46('0x1d')]({'raw':_0x1469cb[_0xcb46('0x1e')]?_0x1469cb[_0xcb46('0x1e')][_0xcb46('0x1f')]===undefined?!![]:![]:!![],'where':_0x1469cb[_0xcb46('0x1e')]?_0x1469cb[_0xcb46('0x1e')]['where']||null:null,'attributes':_0x1469cb[_0xcb46('0x1e')]?_0x1469cb[_0xcb46('0x1e')][_0xcb46('0x20')]||null:null,'include':_0x1469cb[_0xcb46('0x1e')]?_0x1469cb['options'][_0xcb46('0x21')]?_[_0xcb46('0x22')](_0x1469cb['options'][_0xcb46('0x21')],function(_0x1220be){return{'model':db[_0x1220be[_0xcb46('0x23')]],'as':_0x1220be['as'],'attributes':_0x1220be['attributes'],'include':_0x1220be[_0xcb46('0x21')]?_[_0xcb46('0x22')](_0x1220be['include'],function(_0x38b81a){return{'model':db[_0x38b81a[_0xcb46('0x23')]],'as':_0x38b81a['as'],'attributes':_0x38b81a[_0xcb46('0x20')],'include':_0x38b81a[_0xcb46('0x21')]?_[_0xcb46('0x22')](_0x38b81a[_0xcb46('0x21')],function(_0x17af19){return{'model':db[_0x17af19[_0xcb46('0x23')]],'as':_0x17af19['as'],'attributes':_0x17af19[_0xcb46('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x412652){logger[_0xcb46('0x14')](_0xcb46('0x1c'),_0x1469cb);logger[_0xcb46('0x17')](_0xcb46('0x1c'),_0x1469cb,JSON['stringify'](_0x412652));_0x1eb586(_0x412652);})[_0xcb46('0x24')](function(_0x34e659){logger[_0xcb46('0x19')](_0xcb46('0x1c'),_0x34e659[_0xcb46('0x1b')],_0x1469cb);_0x53f2a4(_0xaca67f['error'](0x1f4,_0x34e659[_0xcb46('0x1b')]));});});}; \ No newline at end of file +var _0x100c=['redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','lodash','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x325a08,_0x571fff){var _0x436e01=function(_0x2c7719){while(--_0x2c7719){_0x325a08['push'](_0x325a08['shift']());}};_0x436e01(++_0x571fff);}(_0x100c,0x15f));var _0xc100=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x100c[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xc100('0x0'));var util=require(_0xc100('0x1'));var moment=require(_0xc100('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc100('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc100('0x4'));var config=require(_0xc100('0x5'));var jayson=require(_0xc100('0x6'));var client=jayson[_0xc100('0x7')][_0xc100('0x8')]({'port':0x232a});config[_0xc100('0x9')]=_[_0xc100('0xa')](config['redis'],{'host':_0xc100('0xb'),'port':0x18eb});var socket=require(_0xc100('0xc'))(new Redis(config[_0xc100('0x9')]));require(_0xc100('0xd'))[_0xc100('0xe')](socket);function respondWithRpcPromise(_0x8a167b,_0x3dc7d9,_0x143c3c){return new BPromise(function(_0x482c0a,_0x11b60c){return client[_0xc100('0xf')](_0x8a167b,_0x143c3c)[_0xc100('0x10')](function(_0x4d991f){logger['info'](_0xc100('0x11'),_0x3dc7d9,_0xc100('0x12'));logger[_0xc100('0x13')](_0xc100('0x14'),_0x3dc7d9,_0xc100('0x12'),JSON[_0xc100('0x15')](_0x4d991f));if(_0x4d991f[_0xc100('0x16')]){if(_0x4d991f['error'][_0xc100('0x17')]===0x1f4){logger[_0xc100('0x16')](_0xc100('0x11'),_0x3dc7d9,_0x4d991f[_0xc100('0x16')][_0xc100('0x18')]);return _0x11b60c(_0x4d991f[_0xc100('0x16')][_0xc100('0x18')]);}logger[_0xc100('0x16')](_0xc100('0x11'),_0x3dc7d9,_0x4d991f['error'][_0xc100('0x18')]);return _0x482c0a(_0x4d991f[_0xc100('0x16')][_0xc100('0x18')]);}else{logger[_0xc100('0x19')](_0xc100('0x11'),_0x3dc7d9,_0xc100('0x12'));_0x482c0a(_0x4d991f[_0xc100('0x1a')][_0xc100('0x18')]);}})['catch'](function(_0x4f8992){logger['error'](_0xc100('0x11'),_0x3dc7d9,_0x4f8992);_0x11b60c(_0x4f8992);});});}exports[_0xc100('0x1b')]=function(_0x529a97){var _0x4d02f7=this;return new Promise(function(_0x457323,_0x10af94){return db[_0xc100('0x1c')][_0xc100('0x1d')]({'raw':_0x529a97['options']?_0x529a97[_0xc100('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x529a97[_0xc100('0x1e')]?_0x529a97[_0xc100('0x1e')][_0xc100('0x1f')]||null:null,'attributes':_0x529a97[_0xc100('0x1e')]?_0x529a97[_0xc100('0x1e')][_0xc100('0x20')]||null:null,'include':_0x529a97[_0xc100('0x1e')]?_0x529a97[_0xc100('0x1e')][_0xc100('0x21')]?_[_0xc100('0x22')](_0x529a97[_0xc100('0x1e')][_0xc100('0x21')],function(_0x45980f){return{'model':db[_0x45980f['model']],'as':_0x45980f['as'],'attributes':_0x45980f[_0xc100('0x20')],'include':_0x45980f[_0xc100('0x21')]?_[_0xc100('0x22')](_0x45980f[_0xc100('0x21')],function(_0x4a74bb){return{'model':db[_0x4a74bb[_0xc100('0x23')]],'as':_0x4a74bb['as'],'attributes':_0x4a74bb[_0xc100('0x20')],'include':_0x4a74bb[_0xc100('0x21')]?_['map'](_0x4a74bb[_0xc100('0x21')],function(_0x598750){return{'model':db[_0x598750[_0xc100('0x23')]],'as':_0x598750['as'],'attributes':_0x598750[_0xc100('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc100('0x10')](function(_0x3debbf){logger['info']('ShowWhatsappAccount',_0x529a97);logger[_0xc100('0x13')](_0xc100('0x1b'),_0x529a97,JSON[_0xc100('0x15')](_0x3debbf));_0x457323(_0x3debbf);})['catch'](function(_0x49c30a){logger[_0xc100('0x16')]('ShowWhatsappAccount',_0x49c30a['message'],_0x529a97);_0x10af94(_0x4d02f7[_0xc100('0x16')](0x1f4,_0x49c30a[_0xc100('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index aac1d2a..87c847b 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 _0xcfc4=['whatsappAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xcfc4,0xd1));var _0x4cfc=function(_0x4ccb19,_0x17fb1a){_0x4ccb19=_0x4ccb19-0x0;var _0x3f38f8=_0xcfc4[_0x4ccb19];return _0x3f38f8;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x4cfc('0x0'),_0x4cfc('0x1'),_0x4cfc('0x2')];function createListener(_0x2a5018,_0x1facbc){return function(_0x440a35){_0x1facbc[_0x4cfc('0x3')](_0x2a5018,_0x440a35);};}function removeListener(_0x338b49,_0x6b4ceb){return function(){WhatsappAccountEvents[_0x4cfc('0x4')](_0x338b49,_0x6b4ceb);};}exports[_0x4cfc('0x5')]=function(_0x3616c9){for(var _0x4fa7c2=0x0,_0x340ff7=events[_0x4cfc('0x6')];_0x4fa7c2<_0x340ff7;_0x4fa7c2++){var _0x44cfd0=events[_0x4fa7c2];var _0x4f8014=createListener(_0x4cfc('0x7')+_0x44cfd0,_0x3616c9);WhatsappAccountEvents['on'](_0x44cfd0,_0x4f8014);}}; \ No newline at end of file +var _0xd80d=['register','length','whatsappAccount:','./whatsappAccount.events','save','emit','removeListener'];(function(_0xd58823,_0x15c483){var _0x249c0a=function(_0x4b8b67){while(--_0x4b8b67){_0xd58823['push'](_0xd58823['shift']());}};_0x249c0a(++_0x15c483);}(_0xd80d,0x96));var _0xdd80=function(_0x11991f,_0xa603b9){_0x11991f=_0x11991f-0x0;var _0xc79c67=_0xd80d[_0x11991f];return _0xc79c67;};'use strict';var WhatsappAccountEvents=require(_0xdd80('0x0'));var events=[_0xdd80('0x1'),'remove','update'];function createListener(_0xb5f066,_0xdd3a44){return function(_0x46b6f8){_0xdd3a44[_0xdd80('0x2')](_0xb5f066,_0x46b6f8);};}function removeListener(_0x44ce36,_0x8d88b1){return function(){WhatsappAccountEvents[_0xdd80('0x3')](_0x44ce36,_0x8d88b1);};}exports[_0xdd80('0x4')]=function(_0x51da33){for(var _0x48090f=0x0,_0x5d4a63=events[_0xdd80('0x5')];_0x48090f<_0x5d4a63;_0x48090f++){var _0x792df5=events[_0x48090f];var _0x318f4f=createListener(_0xdd80('0x6')+_0x792df5,_0x51da33);WhatsappAccountEvents['on'](_0x792df5,_0x318f4f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ef2d021..bf56b7f 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 _0x96d7=['express','Router','fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x96d7,0x18b));var _0x796d=function(_0x4bfde8,_0x44ad67){_0x4bfde8=_0x4bfde8-0x0;var _0x13e75d=_0x96d7[_0x4bfde8];return _0x13e75d;};'use strict';var multer=require(_0x796d('0x0'));var util=require(_0x796d('0x1'));var path=require(_0x796d('0x2'));var timeout=require(_0x796d('0x3'));var express=require(_0x796d('0x4'));var router=express[_0x796d('0x5')]();var fs_extra=require(_0x796d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x796d('0x7'));var config=require('../../config/environment');var controller=require(_0x796d('0x8'));router[_0x796d('0x9')]('/',auth[_0x796d('0xa')](),controller[_0x796d('0xb')]);router[_0x796d('0x9')](_0x796d('0xc'),auth[_0x796d('0xa')](),controller[_0x796d('0xd')]);router[_0x796d('0xe')]('/',auth[_0x796d('0xa')](),controller[_0x796d('0xf')]);router[_0x796d('0x10')](_0x796d('0xc'),auth[_0x796d('0xa')](),controller[_0x796d('0x11')]);router[_0x796d('0x12')](_0x796d('0xc'),auth[_0x796d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf95d=['./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e41e1,_0x17f951){var _0x1fb2b4=function(_0x34243e){while(--_0x34243e){_0x1e41e1['push'](_0x1e41e1['shift']());}};_0x1fb2b4(++_0x17f951);}(_0xf95d,0x10f));var _0xdf95=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xf95d[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0xdf95('0x0'));var util=require(_0xdf95('0x1'));var path=require(_0xdf95('0x2'));var timeout=require(_0xdf95('0x3'));var express=require(_0xdf95('0x4'));var router=express[_0xdf95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf95('0x6'));var interaction=require(_0xdf95('0x7'));var config=require(_0xdf95('0x8'));var controller=require(_0xdf95('0x9'));router[_0xdf95('0xa')]('/',auth['isAuthenticated'](),controller[_0xdf95('0xb')]);router['get'](_0xdf95('0xc'),auth[_0xdf95('0xd')](),controller[_0xdf95('0xe')]);router[_0xdf95('0xf')]('/',auth[_0xdf95('0xd')](),controller['create']);router[_0xdf95('0x10')](_0xdf95('0xc'),auth['isAuthenticated'](),controller[_0xdf95('0x11')]);router[_0xdf95('0x12')](_0xdf95('0xc'),auth[_0xdf95('0xd')](),controller['destroy']);module[_0xdf95('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ea9e5a3..f2299ba 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 _0x7847=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x518c25,_0x357f50){var _0x57b95a=function(_0x1cf374){while(--_0x1cf374){_0x518c25['push'](_0x518c25['shift']());}};_0x57b95a(++_0x357f50);}(_0x7847,0x153));var _0x7784=function(_0x347ff3,_0x1cf44b){_0x347ff3=_0x347ff3-0x0;var _0xe8c4d3=_0x7847[_0x347ff3];return _0xe8c4d3;};'use strict';var Sequelize=require(_0x7784('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7784('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7784('0x2')],'allowNull':![],'defaultValue':_0x7784('0x3')},'appdata':{'type':Sequelize[_0x7784('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7784('0x2')],'defaultValue':_0x7784('0x5')}}; \ No newline at end of file +var _0xf922=['sequelize','exports','STRING','noop','TEXT'];(function(_0x3c7a73,_0x3cd0f5){var _0xd0e2b6=function(_0x5df90d){while(--_0x5df90d){_0x3c7a73['push'](_0x3c7a73['shift']());}};_0xd0e2b6(++_0x3cd0f5);}(_0xf922,0x6e));var _0x2f92=function(_0x3c2cff,_0x36a387){_0x3c2cff=_0x3c2cff-0x0;var _0x366fcd=_0xf922[_0x3c2cff];return _0x366fcd;};'use strict';var Sequelize=require(_0x2f92('0x0'));module[_0x2f92('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2f92('0x2')],'allowNull':![],'defaultValue':_0x2f92('0x3')},'appdata':{'type':Sequelize[_0x2f92('0x4')]()},'description':{'type':Sequelize[_0x2f92('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 9199421..31464f4 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 _0x583c=['body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','WhatsappApplication','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create'];(function(_0x555304,_0x17486d){var _0x45d3c9=function(_0x58953e){while(--_0x58953e){_0x555304['push'](_0x555304['shift']());}};_0x45d3c9(++_0x17486d);}(_0x583c,0x12b));var _0xc583=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x583c[_0x25701b];return _0x3a8a2c;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];function respondWithStatusCode(_0x87632d,_0x24343b){_0x24343b=_0x24343b||0xcc;return function(_0x267da0){if(_0x267da0){return _0x87632d[_0xc583('0x18')](_0x24343b);}return _0x87632d[_0xc583('0x19')](_0x24343b)[_0xc583('0x1a')]();};}function respondWithResult(_0xf81809,_0x1c6b79){_0x1c6b79=_0x1c6b79||0xc8;return function(_0x5403a3){if(_0x5403a3){return _0xf81809[_0xc583('0x19')](_0x1c6b79)['json'](_0x5403a3);}};}function respondWithFilteredResult(_0x19f46a,_0x299fa1){return function(_0x510090){if(_0x510090){var _0x263552=typeof _0x299fa1[_0xc583('0x1b')]==='undefined'&&typeof _0x299fa1[_0xc583('0x1c')]===_0xc583('0x1d');var _0x5127fa=_0x510090[_0xc583('0x1e')];var _0x8a2d84=_0x263552?0x0:_0x299fa1[_0xc583('0x1b')];var _0x36e0fd=_0x263552?_0x510090['count']:_0x299fa1[_0xc583('0x1b')]+_0x299fa1['limit'];var _0x227ec2;if(_0x36e0fd>=_0x5127fa){_0x36e0fd=_0x5127fa;_0x227ec2=0xc8;}else{_0x227ec2=0xce;}_0x19f46a[_0xc583('0x19')](_0x227ec2);return _0x19f46a[_0xc583('0x1f')](_0xc583('0x20'),_0x8a2d84+'-'+_0x36e0fd+'/'+_0x5127fa)[_0xc583('0x21')](_0x510090);}return null;};}function patchUpdates(_0x12b910){return function(_0x3ce81b){try{jsonpatch[_0xc583('0x22')](_0x3ce81b,_0x12b910,!![]);}catch(_0x37fcd4){return BPromise[_0xc583('0x23')](_0x37fcd4);}return _0x3ce81b[_0xc583('0x24')]();};}function saveUpdates(_0x3b31bc,_0x21466f){return function(_0x478ee1){if(_0x478ee1){return _0x478ee1['update'](_0x3b31bc)[_0xc583('0x25')](function(_0x3e075c){return _0x3e075c;});}return null;};}function removeEntity(_0x8443dc,_0x5ceef1){return function(_0x1521e2){if(_0x1521e2){return _0x1521e2[_0xc583('0x26')]()[_0xc583('0x25')](function(){_0x8443dc[_0xc583('0x19')](0xcc)[_0xc583('0x1a')]();});}};}function handleEntityNotFound(_0x48c95e,_0x4cad36){return function(_0x45871c){if(!_0x45871c){_0x48c95e['sendStatus'](0x194);}return _0x45871c;};}function handleError(_0x45ef74,_0xcbe9b2){_0xcbe9b2=_0xcbe9b2||0x1f4;return function(_0xbabf24){logger[_0xc583('0x27')](_0xbabf24[_0xc583('0x28')]);if(_0xbabf24['name']){delete _0xbabf24[_0xc583('0x29')];}_0x45ef74[_0xc583('0x19')](_0xcbe9b2)['send'](_0xbabf24);};}exports[_0xc583('0x2a')]=function(_0x483357,_0x2c9088){var _0x8d4ecb={},_0x1c80b1={},_0x3ed083={'count':0x0,'rows':[]};var _0x1b2b49=_[_0xc583('0x2b')](db[_0xc583('0x2c')]['rawAttributes'],function(_0x529dbe){return{'name':_0x529dbe[_0xc583('0x2d')],'type':_0x529dbe[_0xc583('0x2e')][_0xc583('0x2f')]};});_0x1c80b1[_0xc583('0x30')]=_[_0xc583('0x2b')](_0x1b2b49,'name');_0x1c80b1[_0xc583('0x31')]=_['keys'](_0x483357['query']);_0x1c80b1[_0xc583('0x32')]=_[_0xc583('0x33')](_0x1c80b1[_0xc583('0x30')],_0x1c80b1[_0xc583('0x31')]);_0x8d4ecb[_0xc583('0x34')]=_['intersection'](_0x1c80b1[_0xc583('0x30')],qs[_0xc583('0x35')](_0x483357[_0xc583('0x31')]['fields']));_0x8d4ecb[_0xc583('0x34')]=_0x8d4ecb['attributes'][_0xc583('0x36')]?_0x8d4ecb[_0xc583('0x34')]:_0x1c80b1[_0xc583('0x30')];if(!_0x483357[_0xc583('0x31')][_0xc583('0x37')]('nolimit')){_0x8d4ecb[_0xc583('0x1c')]=qs['limit'](_0x483357[_0xc583('0x31')]['limit']);_0x8d4ecb[_0xc583('0x1b')]=qs[_0xc583('0x1b')](_0x483357[_0xc583('0x31')][_0xc583('0x1b')]);}_0x8d4ecb[_0xc583('0x38')]=qs[_0xc583('0x39')](_0x483357['query']['sort']);_0x8d4ecb[_0xc583('0x3a')]=qs[_0xc583('0x32')](_['pick'](_0x483357[_0xc583('0x31')],_0x1c80b1[_0xc583('0x32')]),_0x1b2b49);if(_0x483357[_0xc583('0x31')][_0xc583('0x3b')]){_0x8d4ecb[_0xc583('0x3a')]=_[_0xc583('0x3c')](_0x8d4ecb['where'],{'$or':_[_0xc583('0x2b')](_0x1b2b49,function(_0x595351){if(_0x595351[_0xc583('0x2e')]!==_0xc583('0x3d')){var _0x39bed4={};_0x39bed4[_0x595351['name']]={'$like':'%'+_0x483357['query']['filter']+'%'};return _0x39bed4;}})});}_0x8d4ecb=_[_0xc583('0x3c')]({},_0x8d4ecb,_0x483357[_0xc583('0x3e')]);var _0x2b957d={'where':_0x8d4ecb[_0xc583('0x3a')]};return db['WhatsappApplication'][_0xc583('0x1e')](_0x2b957d)[_0xc583('0x25')](function(_0x594a0b){_0x3ed083['count']=_0x594a0b;if(_0x483357[_0xc583('0x31')]['includeAll']){_0x8d4ecb[_0xc583('0x3f')]=[{'all':!![]}];}return db[_0xc583('0x2c')][_0xc583('0x40')](_0x8d4ecb);})[_0xc583('0x25')](function(_0x58553e){_0x3ed083[_0xc583('0x41')]=_0x58553e;return _0x3ed083;})[_0xc583('0x25')](respondWithFilteredResult(_0x2c9088,_0x8d4ecb))[_0xc583('0x42')](handleError(_0x2c9088,null));};exports[_0xc583('0x43')]=function(_0x2c1c22,_0x5e6e7e){var _0x3ffeb7={'raw':!![],'where':{'id':_0x2c1c22['params']['id']}},_0x5f5a97={};_0x5f5a97[_0xc583('0x30')]=_[_0xc583('0x44')](db['WhatsappApplication']['rawAttributes']);_0x5f5a97[_0xc583('0x31')]=_[_0xc583('0x44')](_0x2c1c22[_0xc583('0x31')]);_0x5f5a97[_0xc583('0x32')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],_0x5f5a97['query']);_0x3ffeb7[_0xc583('0x34')]=_['intersection'](_0x5f5a97[_0xc583('0x30')],qs[_0xc583('0x35')](_0x2c1c22[_0xc583('0x31')][_0xc583('0x35')]));_0x3ffeb7[_0xc583('0x34')]=_0x3ffeb7['attributes'][_0xc583('0x36')]?_0x3ffeb7[_0xc583('0x34')]:_0x5f5a97[_0xc583('0x30')];if(_0x2c1c22['query']['includeAll']){_0x3ffeb7['include']=[{'all':!![]}];}_0x3ffeb7=_[_0xc583('0x3c')]({},_0x3ffeb7,_0x2c1c22['options']);return db[_0xc583('0x2c')][_0xc583('0x45')](_0x3ffeb7)[_0xc583('0x25')](handleEntityNotFound(_0x5e6e7e,null))[_0xc583('0x25')](respondWithResult(_0x5e6e7e,null))[_0xc583('0x42')](handleError(_0x5e6e7e,null));};exports[_0xc583('0x46')]=function(_0x302038,_0x32cfbf){return db[_0xc583('0x2c')][_0xc583('0x46')](_0x302038[_0xc583('0x47')],{})['then'](respondWithResult(_0x32cfbf,0xc9))[_0xc583('0x42')](handleError(_0x32cfbf,null));};exports[_0xc583('0x48')]=function(_0x453df7,_0x230a45){if(_0x453df7['body']['id']){delete _0x453df7[_0xc583('0x47')]['id'];}return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x453df7[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x230a45,null))[_0xc583('0x25')](saveUpdates(_0x453df7[_0xc583('0x47')],null))[_0xc583('0x25')](respondWithResult(_0x230a45,null))[_0xc583('0x42')](handleError(_0x230a45,null));};exports['destroy']=function(_0x1f4901,_0x1919fa){return db[_0xc583('0x2c')][_0xc583('0x45')]({'where':{'id':_0x1f4901[_0xc583('0x49')]['id']}})[_0xc583('0x25')](handleEntityNotFound(_0x1919fa,null))[_0xc583('0x25')](removeEntity(_0x1919fa,null))[_0xc583('0x42')](handleError(_0x1919fa,null));}; \ No newline at end of file +var _0x7cdc=['hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','merge','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x5b7e31,_0xe8ff6){var _0x3f8990=function(_0x2da0b0){while(--_0x2da0b0){_0x5b7e31['push'](_0x5b7e31['shift']());}};_0x3f8990(++_0xe8ff6);}(_0x7cdc,0x190));var _0xc7cd=function(_0x84b023,_0x4142e9){_0x84b023=_0x84b023-0x0;var _0xc82847=_0x7cdc[_0x84b023];return _0xc82847;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7cd('0x0'));var zipdir=require(_0xc7cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7cd('0x2'));var moment=require(_0xc7cd('0x3'));var BPromise=require(_0xc7cd('0x4'));var Mustache=require('mustache');var util=require(_0xc7cd('0x5'));var path=require(_0xc7cd('0x6'));var sox=require('sox');var csv=require(_0xc7cd('0x7'));var ejs=require(_0xc7cd('0x8'));var fs=require('fs');var fs_extra=require(_0xc7cd('0x9'));var _=require(_0xc7cd('0xa'));var squel=require(_0xc7cd('0xb'));var crypto=require(_0xc7cd('0xc'));var jsforce=require(_0xc7cd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc7cd('0x7'));var querystring=require('querystring');var Papa=require(_0xc7cd('0xe'));var Redis=require(_0xc7cd('0xf'));var authService=require(_0xc7cd('0x10'));var qs=require(_0xc7cd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7cd('0x12'));var logger=require(_0xc7cd('0x13'))(_0xc7cd('0x14'));var utils=require(_0xc7cd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7cd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464334,_0x712437){_0x712437=_0x712437||0xcc;return function(_0x1e2d07){if(_0x1e2d07){return _0x464334[_0xc7cd('0x17')](_0x712437);}return _0x464334['status'](_0x712437)[_0xc7cd('0x18')]();};}function respondWithResult(_0x39427e,_0x4bd895){_0x4bd895=_0x4bd895||0xc8;return function(_0x3c9781){if(_0x3c9781){return _0x39427e['status'](_0x4bd895)[_0xc7cd('0x19')](_0x3c9781);}};}function respondWithFilteredResult(_0x55f39a,_0x2a4aef){return function(_0x2bbe07){if(_0x2bbe07){var _0x2f04cb=typeof _0x2a4aef[_0xc7cd('0x1a')]==='undefined'&&typeof _0x2a4aef[_0xc7cd('0x1b')]===_0xc7cd('0x1c');var _0x3c7d5c=_0x2bbe07[_0xc7cd('0x1d')];var _0xe93ad5=_0x2f04cb?0x0:_0x2a4aef[_0xc7cd('0x1a')];var _0x2d5825=_0x2f04cb?_0x2bbe07[_0xc7cd('0x1d')]:_0x2a4aef[_0xc7cd('0x1a')]+_0x2a4aef['limit'];var _0x409673;if(_0x2d5825>=_0x3c7d5c){_0x2d5825=_0x3c7d5c;_0x409673=0xc8;}else{_0x409673=0xce;}_0x55f39a['status'](_0x409673);return _0x55f39a[_0xc7cd('0x1e')](_0xc7cd('0x1f'),_0xe93ad5+'-'+_0x2d5825+'/'+_0x3c7d5c)[_0xc7cd('0x19')](_0x2bbe07);}return null;};}function patchUpdates(_0x1177a2){return function(_0x449e15){try{jsonpatch['apply'](_0x449e15,_0x1177a2,!![]);}catch(_0x27b5d5){return BPromise[_0xc7cd('0x20')](_0x27b5d5);}return _0x449e15[_0xc7cd('0x21')]();};}function saveUpdates(_0x20fc95,_0x5b06b3){return function(_0x255330){if(_0x255330){return _0x255330[_0xc7cd('0x22')](_0x20fc95)[_0xc7cd('0x23')](function(_0x388a0d){return _0x388a0d;});}return null;};}function removeEntity(_0x571911,_0x4e47b0){return function(_0x4f2259){if(_0x4f2259){return _0x4f2259[_0xc7cd('0x24')]()['then'](function(){_0x571911[_0xc7cd('0x25')](0xcc)[_0xc7cd('0x18')]();});}};}function handleEntityNotFound(_0x2932fe,_0x2601b8){return function(_0x4450a5){if(!_0x4450a5){_0x2932fe[_0xc7cd('0x17')](0x194);}return _0x4450a5;};}function handleError(_0x5d16e3,_0x2d2c1c){_0x2d2c1c=_0x2d2c1c||0x1f4;return function(_0x33c1ca){logger[_0xc7cd('0x26')](_0x33c1ca[_0xc7cd('0x27')]);if(_0x33c1ca['name']){delete _0x33c1ca[_0xc7cd('0x28')];}_0x5d16e3[_0xc7cd('0x25')](_0x2d2c1c)[_0xc7cd('0x29')](_0x33c1ca);};}exports[_0xc7cd('0x2a')]=function(_0x4ed88b,_0x19aa4a){var _0x22be13={},_0x5ab9a2={},_0x4d3f3c={'count':0x0,'rows':[]};var _0x3eeeff=_[_0xc7cd('0x2b')](db[_0xc7cd('0x2c')][_0xc7cd('0x2d')],function(_0x5c177a){return{'name':_0x5c177a[_0xc7cd('0x2e')],'type':_0x5c177a[_0xc7cd('0x2f')]['key']};});_0x5ab9a2[_0xc7cd('0x30')]=_['map'](_0x3eeeff,_0xc7cd('0x28'));_0x5ab9a2[_0xc7cd('0x31')]=_[_0xc7cd('0x32')](_0x4ed88b[_0xc7cd('0x31')]);_0x5ab9a2[_0xc7cd('0x33')]=_[_0xc7cd('0x34')](_0x5ab9a2[_0xc7cd('0x30')],_0x5ab9a2[_0xc7cd('0x31')]);_0x22be13['attributes']=_['intersection'](_0x5ab9a2[_0xc7cd('0x30')],qs['fields'](_0x4ed88b['query'][_0xc7cd('0x35')]));_0x22be13[_0xc7cd('0x36')]=_0x22be13[_0xc7cd('0x36')][_0xc7cd('0x37')]?_0x22be13['attributes']:_0x5ab9a2[_0xc7cd('0x30')];if(!_0x4ed88b[_0xc7cd('0x31')][_0xc7cd('0x38')](_0xc7cd('0x39'))){_0x22be13[_0xc7cd('0x1b')]=qs['limit'](_0x4ed88b[_0xc7cd('0x31')][_0xc7cd('0x1b')]);_0x22be13['offset']=qs[_0xc7cd('0x1a')](_0x4ed88b[_0xc7cd('0x31')][_0xc7cd('0x1a')]);}_0x22be13[_0xc7cd('0x3a')]=qs['sort'](_0x4ed88b[_0xc7cd('0x31')][_0xc7cd('0x3b')]);_0x22be13[_0xc7cd('0x3c')]=qs[_0xc7cd('0x33')](_[_0xc7cd('0x3d')](_0x4ed88b[_0xc7cd('0x31')],_0x5ab9a2[_0xc7cd('0x33')]),_0x3eeeff);if(_0x4ed88b[_0xc7cd('0x31')][_0xc7cd('0x3e')]){_0x22be13[_0xc7cd('0x3c')]=_['merge'](_0x22be13[_0xc7cd('0x3c')],{'$or':_['map'](_0x3eeeff,function(_0x4afe92){if(_0x4afe92[_0xc7cd('0x2f')]!==_0xc7cd('0x3f')){var _0x3b6ed4={};_0x3b6ed4[_0x4afe92[_0xc7cd('0x28')]]={'$like':'%'+_0x4ed88b[_0xc7cd('0x31')]['filter']+'%'};return _0x3b6ed4;}})});}_0x22be13=_['merge']({},_0x22be13,_0x4ed88b[_0xc7cd('0x40')]);var _0x3c46eb={'where':_0x22be13[_0xc7cd('0x3c')]};return db['WhatsappApplication'][_0xc7cd('0x1d')](_0x3c46eb)[_0xc7cd('0x23')](function(_0x33bebe){_0x4d3f3c[_0xc7cd('0x1d')]=_0x33bebe;if(_0x4ed88b[_0xc7cd('0x31')]['includeAll']){_0x22be13['include']=[{'all':!![]}];}return db[_0xc7cd('0x2c')][_0xc7cd('0x41')](_0x22be13);})[_0xc7cd('0x23')](function(_0x58023b){_0x4d3f3c[_0xc7cd('0x42')]=_0x58023b;return _0x4d3f3c;})[_0xc7cd('0x23')](respondWithFilteredResult(_0x19aa4a,_0x22be13))[_0xc7cd('0x43')](handleError(_0x19aa4a,null));};exports[_0xc7cd('0x44')]=function(_0x2761de,_0x1d9c74){var _0x4d96ab={'raw':!![],'where':{'id':_0x2761de[_0xc7cd('0x45')]['id']}},_0x2ae7eb={};_0x2ae7eb[_0xc7cd('0x30')]=_['keys'](db['WhatsappApplication'][_0xc7cd('0x2d')]);_0x2ae7eb[_0xc7cd('0x31')]=_[_0xc7cd('0x32')](_0x2761de[_0xc7cd('0x31')]);_0x2ae7eb[_0xc7cd('0x33')]=_['intersection'](_0x2ae7eb['model'],_0x2ae7eb[_0xc7cd('0x31')]);_0x4d96ab[_0xc7cd('0x36')]=_[_0xc7cd('0x34')](_0x2ae7eb[_0xc7cd('0x30')],qs[_0xc7cd('0x35')](_0x2761de[_0xc7cd('0x31')]['fields']));_0x4d96ab[_0xc7cd('0x36')]=_0x4d96ab[_0xc7cd('0x36')][_0xc7cd('0x37')]?_0x4d96ab[_0xc7cd('0x36')]:_0x2ae7eb[_0xc7cd('0x30')];if(_0x2761de[_0xc7cd('0x31')][_0xc7cd('0x46')]){_0x4d96ab[_0xc7cd('0x47')]=[{'all':!![]}];}_0x4d96ab=_[_0xc7cd('0x48')]({},_0x4d96ab,_0x2761de[_0xc7cd('0x40')]);return db[_0xc7cd('0x2c')][_0xc7cd('0x49')](_0x4d96ab)[_0xc7cd('0x23')](handleEntityNotFound(_0x1d9c74,null))[_0xc7cd('0x23')](respondWithResult(_0x1d9c74,null))['catch'](handleError(_0x1d9c74,null));};exports[_0xc7cd('0x4a')]=function(_0x1bbf06,_0x51adde){return db[_0xc7cd('0x2c')][_0xc7cd('0x4a')](_0x1bbf06[_0xc7cd('0x4b')],{})[_0xc7cd('0x23')](respondWithResult(_0x51adde,0xc9))[_0xc7cd('0x43')](handleError(_0x51adde,null));};exports[_0xc7cd('0x22')]=function(_0x3a52eb,_0x2af607){if(_0x3a52eb[_0xc7cd('0x4b')]['id']){delete _0x3a52eb[_0xc7cd('0x4b')]['id'];}return db[_0xc7cd('0x2c')][_0xc7cd('0x49')]({'where':{'id':_0x3a52eb[_0xc7cd('0x45')]['id']}})[_0xc7cd('0x23')](handleEntityNotFound(_0x2af607,null))['then'](saveUpdates(_0x3a52eb['body'],null))['then'](respondWithResult(_0x2af607,null))['catch'](handleError(_0x2af607,null));};exports[_0xc7cd('0x24')]=function(_0x2b9675,_0x34f7c7){return db[_0xc7cd('0x2c')][_0xc7cd('0x49')]({'where':{'id':_0x2b9675[_0xc7cd('0x45')]['id']}})[_0xc7cd('0x23')](handleEntityNotFound(_0x34f7c7,null))[_0xc7cd('0x23')](removeEntity(_0x34f7c7,null))[_0xc7cd('0x43')](handleError(_0x34f7c7,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 3ac481c..bdf090c 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 _0xd6d2=['rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise'];(function(_0x17232d,_0x3b360b){var _0xa7568e=function(_0x227c53){while(--_0x227c53){_0x17232d['push'](_0x17232d['shift']());}};_0xa7568e(++_0x3b360b);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x3fd0f5,_0x26bb88){_0x3fd0f5=_0x3fd0f5-0x0;var _0x3363d7=_0xd6d2[_0x3fd0f5];return _0x3363d7;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var logger=require('../../config/logger')(_0x2d6d('0x2'));var moment=require(_0x2d6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var attributes=require(_0x2d6d('0x7'));module['exports']=function(_0xfcdb1d,_0x132361){return _0xfcdb1d[_0x2d6d('0x8')](_0x2d6d('0x9'),attributes,{'tableName':_0x2d6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d6d('0xb'),'collate':_0x2d6d('0xc')});}; \ No newline at end of file +var _0x885a=['./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa885('0xc'),'collate':_0xa885('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 75c2393..9a4568a 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 _0xb458=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb458,0x103));var _0x8b45=function(_0x19e15a,_0x20cf89){_0x19e15a=_0x19e15a-0x0;var _0xaedcc9=_0xb458[_0x19e15a];return _0xaedcc9;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});} \ No newline at end of file +var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3f1a55,_0x385dab){var _0x362ad8=function(_0x3ca567){while(--_0x3ca567){_0x3f1a55['push'](_0x3f1a55['shift']());}};_0x362ad8(++_0x385dab);}(_0xac9d,0x14d));var _0xdac9=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xac9d[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 830df8c..5b0f105 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 _0x41fe=['addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','download','post','create','/:id/messages'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x41fe,0xd1));var _0xe41f=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x41fe[_0x342700];return _0x53406f;};'use strict';var multer=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var path=require(_0xe41f('0x2'));var timeout=require(_0xe41f('0x3'));var express=require(_0xe41f('0x4'));var router=express[_0xe41f('0x5')]();var fs_extra=require(_0xe41f('0x6'));var auth=require(_0xe41f('0x7'));var interaction=require(_0xe41f('0x8'));var config=require(_0xe41f('0x9'));var controller=require(_0xe41f('0xa'));router[_0xe41f('0xb')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0xd')]);router[_0xe41f('0xb')](_0xe41f('0xe'),auth[_0xe41f('0xc')](),controller['describe']);router[_0xe41f('0xb')](_0xe41f('0xf'),auth['isAuthenticated'](),controller[_0xe41f('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xe41f('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xe41f('0x12')]);router[_0xe41f('0x13')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0x14')]);router[_0xe41f('0x13')](_0xe41f('0x15'),auth[_0xe41f('0xc')](),controller[_0xe41f('0x16')]);router[_0xe41f('0x13')](_0xe41f('0x17'),auth['isAuthenticated'](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),'whatsappinteraction:addtags'),controller[_0xe41f('0x1a')]);router[_0xe41f('0x1b')](_0xe41f('0xf'),auth[_0xe41f('0xc')](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),_0xe41f('0x1c')),controller['update']);router['delete'](_0xe41f('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0xe41f('0x19'),_0xe41f('0x1d')),controller[_0xe41f('0x1e')]);router[_0xe41f('0x1f')](_0xe41f('0x17'),auth['isAuthenticated'](),controller[_0xe41f('0x20')]);module['exports']=router; \ No newline at end of file +var _0xf69d=['put','whatsappinteraction:update','delete','tracked','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','/:id/messages','addMessage','post','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0x2950d9,_0x3f3e30){var _0x3f6ad6=function(_0x43366a){while(--_0x43366a){_0x2950d9['push'](_0x2950d9['shift']());}};_0x3f6ad6(++_0x3f3e30);}(_0xf69d,0xd3));var _0xdf69=function(_0x5a6812,_0x20822a){_0x5a6812=_0x5a6812-0x0;var _0x59d66c=_0xf69d[_0x5a6812];return _0x59d66c;};'use strict';var multer=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var path=require(_0xdf69('0x2'));var timeout=require(_0xdf69('0x3'));var express=require(_0xdf69('0x4'));var router=express['Router']();var fs_extra=require(_0xdf69('0x5'));var auth=require(_0xdf69('0x6'));var interaction=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var controller=require(_0xdf69('0x9'));router[_0xdf69('0xa')]('/',auth[_0xdf69('0xb')](),controller[_0xdf69('0xc')]);router[_0xdf69('0xa')](_0xdf69('0xd'),auth[_0xdf69('0xb')](),controller[_0xdf69('0xe')]);router[_0xdf69('0xa')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x10')]);router[_0xdf69('0xa')]('/:id/messages',auth[_0xdf69('0xb')](),controller[_0xdf69('0x11')]);router[_0xdf69('0xa')](_0xdf69('0x12'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xdf69('0x14'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x15')]);router[_0xdf69('0x16')](_0xdf69('0x17'),auth[_0xdf69('0xb')](),interaction['tracked'](_0xdf69('0x18'),_0xdf69('0x19')),controller[_0xdf69('0x1a')]);router[_0xdf69('0x1b')]('/:id',auth[_0xdf69('0xb')](),interaction['tracked'](_0xdf69('0x18'),_0xdf69('0x1c')),controller['update']);router[_0xdf69('0x1d')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),interaction[_0xdf69('0x1e')]('whatsapp','whatsappinteraction:destroy'),controller[_0xdf69('0x1f')]);router[_0xdf69('0x1d')]('/:id/tags',auth[_0xdf69('0xb')](),controller[_0xdf69('0x20')]);module[_0xdf69('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 453b866..dc2a706 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 _0x7923=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x5f1eb1,_0x1c17e0){var _0x21dc84=function(_0x37252c){while(--_0x37252c){_0x5f1eb1['push'](_0x5f1eb1['shift']());}};_0x21dc84(++_0x1c17e0);}(_0x7923,0x8f));var _0x3792=function(_0x1cd9ee,_0x3bbad7){_0x1cd9ee=_0x1cd9ee-0x0;var _0x25b3b5=_0x7923[_0x1cd9ee];return _0x25b3b5;};'use strict';var Sequelize=require(_0x3792('0x0'));var moment=require(_0x3792('0x1'));module[_0x3792('0x2')]={'closed':{'type':Sequelize[_0x3792('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3792('0x4')]},'disposition':{'type':Sequelize[_0x3792('0x5')]},'secondDisposition':{'type':Sequelize[_0x3792('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3792('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3792('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3792('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3792('0x6')]('in',_0x3792('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0763=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x4e029f,_0x177074){var _0x135b7e=function(_0x37caff){while(--_0x37caff){_0x4e029f['push'](_0x4e029f['shift']());}};_0x135b7e(++_0x177074);}(_0x0763,0x87));var _0x3076=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x0763[_0xe7d07d];return _0x229e46;};'use strict';var Sequelize=require(_0x3076('0x0'));var moment=require('moment');module[_0x3076('0x1')]={'closed':{'type':Sequelize[_0x3076('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3076('0x3')]},'secondDisposition':{'type':Sequelize[_0x3076('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3076('0x3')]},'note':{'type':Sequelize[_0x3076('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3076('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3076('0x5')]('in',_0x3076('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3076('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3076('0x5')]('in',_0x3076('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3076('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 2b7e4b9..dd86050 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 _0x0c19=['download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','Content-Range','reject','update','then','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','closed','UserId','unmanaged','total','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','show','params','includeAll','include','options','create','body','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','unix','join','files','tmp','root','server','User','CmContact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','System','Contact','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML'];(function(_0x50a1be,_0x421594){var _0x398dfc=function(_0x46d186){while(--_0x46d186){_0x50a1be['push'](_0x50a1be['shift']());}};_0x398dfc(++_0x421594);}(_0x0c19,0xf5));var _0x90c1=function(_0x5f3618,_0x1a7c19){_0x5f3618=_0x5f3618-0x0;var _0x3770a9=_0x0c19[_0x5f3618];return _0x3770a9;};'use strict';var emlformat=require(_0x90c1('0x0'));var rimraf=require(_0x90c1('0x1'));var zipdir=require(_0x90c1('0x2'));var jsonpatch=require(_0x90c1('0x3'));var rp=require(_0x90c1('0x4'));var moment=require(_0x90c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x90c1('0x6'));var util=require(_0x90c1('0x7'));var path=require(_0x90c1('0x8'));var sox=require('sox');var csv=require(_0x90c1('0x9'));var ejs=require(_0x90c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90c1('0xb'));var squel=require(_0x90c1('0xc'));var crypto=require(_0x90c1('0xd'));var jsforce=require(_0x90c1('0xe'));var deskjs=require(_0x90c1('0xf'));var toCsv=require(_0x90c1('0x9'));var querystring=require(_0x90c1('0x10'));var Papa=require('papaparse');var Redis=require(_0x90c1('0x11'));var authService=require(_0x90c1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90c1('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90c1('0x14'))('api');var utils=require(_0x90c1('0x15'));var config=require(_0x90c1('0x16'));var licenseUtil=require(_0x90c1('0x17'));var db=require(_0x90c1('0x18'))['db'];config['redis']=_['defaults'](config[_0x90c1('0x19')],{'host':_0x90c1('0x1a'),'port':0x18eb});var socket=require(_0x90c1('0x1b'))(new Redis(config[_0x90c1('0x19')]));require('./whatsappInteraction.socket')[_0x90c1('0x1c')](socket);function respondWithStatusCode(_0x46b951,_0x154cde){_0x154cde=_0x154cde||0xcc;return function(_0x139c67){if(_0x139c67){return _0x46b951[_0x90c1('0x1d')](_0x154cde);}return _0x46b951[_0x90c1('0x1e')](_0x154cde)['end']();};}function respondWithResult(_0x39dc3c,_0x387b94){_0x387b94=_0x387b94||0xc8;return function(_0x45a64c){if(_0x45a64c){return _0x39dc3c[_0x90c1('0x1e')](_0x387b94)[_0x90c1('0x1f')](_0x45a64c);}};}function respondWithFilteredResult(_0x397be4,_0x3b6671){return function(_0x2960f2){if(_0x2960f2){var _0x372949=typeof _0x3b6671[_0x90c1('0x20')]===_0x90c1('0x21')&&typeof _0x3b6671['limit']===_0x90c1('0x21');var _0x365726=_0x2960f2[_0x90c1('0x22')];var _0x1cd1f6=_0x372949?0x0:_0x3b6671[_0x90c1('0x20')];var _0x3c8cc6=_0x372949?_0x2960f2['count']:_0x3b6671[_0x90c1('0x20')]+_0x3b6671['limit'];var _0x299241;if(_0x3c8cc6>=_0x365726){_0x3c8cc6=_0x365726;_0x299241=0xc8;}else{_0x299241=0xce;}_0x397be4['status'](_0x299241);return _0x397be4['set'](_0x90c1('0x23'),_0x1cd1f6+'-'+_0x3c8cc6+'/'+_0x365726)['json'](_0x2960f2);}return null;};}function patchUpdates(_0x5d692b){return function(_0x2291b6){try{jsonpatch['apply'](_0x2291b6,_0x5d692b,!![]);}catch(_0x4d53fd){return BPromise[_0x90c1('0x24')](_0x4d53fd);}return _0x2291b6['save']();};}function saveUpdates(_0x213cd1,_0x4e9caa){return function(_0x46dad7){if(_0x46dad7){return _0x46dad7[_0x90c1('0x25')](_0x213cd1)[_0x90c1('0x26')](function(_0x2625af){return _0x2625af;});}return null;};}function removeEntity(_0x174506,_0x3902c8){return function(_0x2a60fb){if(_0x2a60fb){return _0x2a60fb['destroy']()[_0x90c1('0x26')](function(){_0x174506[_0x90c1('0x1e')](0xcc)[_0x90c1('0x27')]();});}};}function handleEntityNotFound(_0x12d35d,_0x3c3a20){return function(_0x3b6a58){if(!_0x3b6a58){_0x12d35d[_0x90c1('0x1d')](0x194);}return _0x3b6a58;};}function handleError(_0x3b1924,_0x40c45d){_0x40c45d=_0x40c45d||0x1f4;return function(_0x1ed79c){logger[_0x90c1('0x28')](_0x1ed79c[_0x90c1('0x29')]);if(_0x1ed79c[_0x90c1('0x2a')]){delete _0x1ed79c[_0x90c1('0x2a')];}_0x3b1924[_0x90c1('0x1e')](_0x40c45d)['send'](_0x1ed79c);};}function getInteractionUsers(_0x3ccb3d,_0x435e56){return new BPromise(function(_0x40c2f1,_0x5be73c){try{if(_0x435e56[_0x3ccb3d['id']]){_0x3ccb3d[_0x90c1('0x2b')]=_[_0x90c1('0x2c')](_0x435e56[_0x3ccb3d['id']],function(_0x222124){return{'id':_0x222124['id'],'fullname':_0x222124[_0x90c1('0x2d')]};});}}catch(_0x26d3c0){_0x5be73c(_0x26d3c0);}_0x40c2f1(_0x3ccb3d);});}function getInteractionTags(_0x2991c1,_0x25a721){return new BPromise(function(_0x4d7a09,_0x2366b4){try{if(_0x2991c1[_0x90c1('0x2e')]){_0x2991c1[_0x90c1('0x2f')]=[];_0x2991c1['TagIds'][_0x90c1('0x30')](',')[_0x90c1('0x31')](function(_0x145fc4){_0x2991c1[_0x90c1('0x2f')][_0x90c1('0x32')](_0x25a721[_0x145fc4]);});}delete _0x2991c1[_0x90c1('0x2e')];}catch(_0xa5ee96){_0x2366b4(_0xa5ee96);}_0x4d7a09(_0x2991c1);});}function updateWhatsappInteraction(_0x36e431,_0x207e63,_0x17fd69){return new BPromise(function(_0x441f86,_0x35a312){return getInteractionUsers(_0x36e431,_0x17fd69)[_0x90c1('0x26')](function(_0x3a130f){return getInteractionTags(_0x3a130f,_0x207e63);})['then'](function(_0x253e92){return getStateInteraction(_0x253e92);})[_0x90c1('0x26')](function(_0x400134){_0x441f86(_0x400134);})[_0x90c1('0x33')](function(_0x5c62a4){_0x35a312(_0x5c62a4);});});}function getStateInteraction(_0x5d9ec8){return new BPromise(function(_0x173dae){_0x5d9ec8[_0x90c1('0x34')]=0x0;_0x5d9ec8[_0x90c1('0x35')]=0x0;_0x5d9ec8[_0x90c1('0x36')]=0x0;_0x5d9ec8['unmanaged']=0x0;_0x5d9ec8['total']=0x0;if(!_0x5d9ec8[_0x90c1('0x37')]&&!_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8[_0x90c1('0x34')]+=0x1;}if(!_0x5d9ec8[_0x90c1('0x37')]&&_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8['talking']+=0x1;if(_0x5d9ec8['waiting']){_0x5d9ec8['waiting']-=0x1;}}if(_0x5d9ec8[_0x90c1('0x37')]&&_0x5d9ec8[_0x90c1('0x38')]){_0x5d9ec8[_0x90c1('0x36')]+=0x1;if(_0x5d9ec8['talking']){_0x5d9ec8[_0x90c1('0x35')]-=0x1;}}if(_0x5d9ec8['closed']&&!_0x5d9ec8['UserId']){_0x5d9ec8[_0x90c1('0x39')]+=0x1;if(_0x5d9ec8[_0x90c1('0x34')]){_0x5d9ec8['waiting']-=0x1;}}_0x5d9ec8[_0x90c1('0x3a')]+=0x1;_0x173dae(_0x5d9ec8);});}exports[_0x90c1('0x3b')]=function(_0x916ce1,_0x8e4792){var _0x1b3372={},_0x275731={},_0x55969f={'count':0x0,'rows':[]};var _0x3fb4ed=_['map'](db[_0x90c1('0x3c')][_0x90c1('0x3d')],function(_0x3b6c89){return{'name':_0x3b6c89[_0x90c1('0x3e')],'type':_0x3b6c89[_0x90c1('0x3f')][_0x90c1('0x40')]};});_0x275731[_0x90c1('0x41')]=_['map'](_0x3fb4ed,'name');_0x275731[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x916ce1[_0x90c1('0x42')]);_0x275731[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x275731['model'],_0x275731['query']);_0x1b3372[_0x90c1('0x46')]=_[_0x90c1('0x45')](_0x275731['model'],qs[_0x90c1('0x47')](_0x916ce1['query']['fields']));_0x1b3372[_0x90c1('0x46')]=_0x1b3372['attributes'][_0x90c1('0x48')]?_0x1b3372['attributes']:_0x275731['model'];if(!_0x916ce1[_0x90c1('0x42')][_0x90c1('0x49')](_0x90c1('0x4a'))){_0x1b3372[_0x90c1('0x4b')]=qs['limit'](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x4b')]);_0x1b3372[_0x90c1('0x20')]=qs[_0x90c1('0x20')](_0x916ce1['query'][_0x90c1('0x20')]);}_0x1b3372[_0x90c1('0x4c')]=qs['sort'](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x4d')]);_0x1b3372[_0x90c1('0x4e')]=qs[_0x90c1('0x44')](_[_0x90c1('0x4f')](_0x916ce1['query'],_0x275731[_0x90c1('0x44')]),_0x3fb4ed);var _0x4bde8e=[];var _0x304011=squel['select']()[_0x90c1('0x50')]('id')[_0x90c1('0x50')](_0x90c1('0x2a'))[_0x90c1('0x50')](_0x90c1('0x51'))[_0x90c1('0x52')](_0x90c1('0x53'));var _0x23359c=squel[_0x90c1('0x54')]()['field'](_0x90c1('0x55'))['field'](_0x90c1('0x56'))[_0x90c1('0x50')](_0x90c1('0x57'))[_0x90c1('0x52')](_0x90c1('0x58'),'ui')[_0x90c1('0x59')](_0x90c1('0x5a'),'u',_0x90c1('0x5b'));var _0xa117d1=squel[_0x90c1('0x54')]()[_0x90c1('0x52')]('whatsapp_interactions','i')[_0x90c1('0x59')](_0x90c1('0x5c'),'c',_0x90c1('0x5d'))['left_join'](_0x90c1('0x5a'),'o',_0x90c1('0x5e'))[_0x90c1('0x59')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x90c1('0x59')](_0x90c1('0x5f'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x90c1('0x59')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x90c1('0x53'),'t','t.id\x20=\x20it.TagId');var _0x38f50a=squel[_0x90c1('0x60')]();var _0x3cdd0c=[];var _0x298aa2=squel['expr']();var _0x53d98f;if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x61')]){_0x53d98f=as[_0x90c1('0x62')](_0x916ce1[_0x90c1('0x42')]['search']);var _0x4a78ca=_0x53d98f[_0x90c1('0x63')];for(var _0x4850f7=0x0;_0x4850f7<_0x53d98f[_0x90c1('0x64')][_0x90c1('0x48')];_0x4850f7++){var _0x38d884=_0x53d98f[_0x90c1('0x64')][_0x4850f7];var _0x5a7948='i';var _0xded4ef=_[_0x90c1('0x65')](_0x3fb4ed,[_0x90c1('0x2a'),_0x38d884[_0x90c1('0x50')]]);if(!_0xded4ef){switch(_0x38d884[_0x90c1('0x50')]){case _0x90c1('0x66'):if(_0x38d884['value']==0x1){_0xa117d1[_0x90c1('0x67')]('`'+_0x38d884[_0x90c1('0x50')]+_0x90c1('0x68'));}else{_0xa117d1['having']('`'+_0x38d884[_0x90c1('0x50')]+_0x90c1('0x69'));}break;case'Contact':if(_0x38d884['operator']===_0x90c1('0x6a')){if(_0x38d884[_0x90c1('0x6b')][_0x90c1('0x30')]('\x20')[_0x90c1('0x48')]>0x1){_0x38f50a[_0x4a78ca]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x90c1('0x6c')](_0x38d884[_0x90c1('0x6b')]),null);}else{var _0x12296c='%'+_0x38d884[_0x90c1('0x6b')]+'%';_0x38f50a[_0x4a78ca]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x12296c,_0x12296c,_0x12296c);}}else{_0xded4ef=_['find'](_0x3fb4ed,[_0x90c1('0x2a'),_0x90c1('0x6d')]);_0x38d884[_0x90c1('0x50')]=_0x90c1('0x6d');_0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef['type'],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e[_0x90c1('0x6b')]['start'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);}break;case _0x90c1('0x70'):var _0x43d513=_0x38d884['value'][_0x90c1('0x30')](',')[_0x90c1('0x2c')](function(_0xaa044c){return Number(_0xaa044c);});_0x43d513[_0x90c1('0x31')](function(_0x985223){_0x298aa2['or'](_0x90c1('0x71'),'%,'+_0x985223+',%');});_0x3cdd0c=_[_0x90c1('0x72')](_0x3cdd0c,_0x43d513);break;case'User':if(_0x38d884['operator']===_0x90c1('0x6a')){_0x38f50a[_0x4a78ca](_0x90c1('0x73'),'%'+_0x38d884['value']+'%',null);}else{_0xded4ef=_[_0x90c1('0x65')](_0x3fb4ed,[_0x90c1('0x2a'),_0x90c1('0x38')]);_0x38d884[_0x90c1('0x50')]=_0x90c1('0x38');_0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef['type'],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e['text'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x74')],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);}break;case'body':_0x2d696e=as['buildExpression']('me',null,_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e[_0x90c1('0x6b')]['start'],_0x2d696e[_0x90c1('0x6b')][_0x90c1('0x27')]);break;}}else{var _0x2d696e=as[_0x90c1('0x6e')](_0x5a7948,_0xded4ef[_0x90c1('0x3f')],_0x38d884);_0x38f50a[_0x4a78ca](_0x2d696e[_0x90c1('0x6f')],_0x2d696e['value'][_0x90c1('0x74')],_0x2d696e['value'][_0x90c1('0x27')]);}}}else{var _0x1939a6=_(_0x916ce1[_0x90c1('0x42')])['keys']()['map'](function(_0x5b883b){return _[_0x90c1('0x75')](_0x3fb4ed,[_0x90c1('0x2a'),_0x5b883b])?_0x5b883b:undefined;})[_0x90c1('0x76')]()[_0x90c1('0x6b')]();if(!_[_0x90c1('0x77')](_0x1939a6)){_0x1939a6[_0x90c1('0x31')](function(_0xf9f88c){if(_0xf9f88c===_0x90c1('0x78')){_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x79'),[][_0x90c1('0x7a')](_0x916ce1['query'][_0xf9f88c]));}else if(_0xf9f88c==='createdAt'){var _0x46f511=JSON[_0x90c1('0x7b')](_0x916ce1['query'][_0xf9f88c])[_0x90c1('0x7c')];var _0x2d7a5d=JSON[_0x90c1('0x7b')](_0x916ce1[_0x90c1('0x42')][_0xf9f88c])[_0x90c1('0x7d')];_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x7e'),_0x46f511,_0x2d7a5d);}else{if(_0x916ce1['query'][_0xf9f88c]===_0x90c1('0x7f')){_0xa117d1[_0x90c1('0x4e')]('i.'+_0xf9f88c+_0x90c1('0x80'));}else{_0xa117d1[_0x90c1('0x4e')]('i.'+_0xf9f88c+'\x20=\x20?',_0x916ce1[_0x90c1('0x42')][_0xf9f88c]);}}});}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x81')]){if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x81')]==0x1){_0xa117d1[_0x90c1('0x67')]('`unreadMessages`\x20=\x200');}else{_0xa117d1['having'](_0x90c1('0x82'));}}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')]){_0x3cdd0c=_[_0x90c1('0x84')](_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')])?_0x916ce1['query']['tag']:new Array(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x83')]);_0x3cdd0c[_0x90c1('0x31')](function(_0x5d2e8b){_0x298aa2['or'](_0x90c1('0x71'),'%,'+_0x5d2e8b+',%');});}if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x85')]){var _0x5bd1da=_0x916ce1[_0x90c1('0x42')][_0x90c1('0x85')][_0x90c1('0x86')]('\x5c','\x5c\x5c')[_0x90c1('0x86')](/'/g,'\x27\x27');if(qs[_0x90c1('0x87')](_0x5bd1da)){_0x38f50a['or'](_0x90c1('0x88'),_0x5bd1da+'%')['or']('i.phone\x20LIKE\x20?',_0x5bd1da+'%');}else{_0x38f50a['or'](_0x90c1('0x89'),qs[_0x90c1('0x6c')](_0x5bd1da))['or'](_0x90c1('0x8a'),_0x5bd1da+'%');}}}_0xa117d1[_0x90c1('0x4e')](_0x38f50a);_0xa117d1[_0x90c1('0x8b')](_0x90c1('0x8c'));var _0x57f05d={'type':db[_0x90c1('0x8d')][_0x90c1('0x8e')][_0x90c1('0x8f')],'raw':!![]};var _0x1b71e2=_0xa117d1['clone']();_0x1b71e2[_0x90c1('0x50')](_0x90c1('0x8c'));_0x1b71e2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x90c1('0x66'));if(_0x1b3372[_0x90c1('0x4c')]){_0x1b3372[_0x90c1('0x4c')][_0x90c1('0x31')](function(_0x2c15ba){var _0x2231c7=_0x2c15ba[0x0]==='contactName'?_0x2c15ba[0x0]:'i.'+_0x2c15ba[0x0];_0xa117d1['order'](_0x2231c7,_0x2c15ba[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3cdd0c)){_0xa117d1[_0x90c1('0x67')](_0x298aa2);_0x1b71e2['where']('t.id\x20IN\x20?',_0x3cdd0c);}BPromise[_0x90c1('0x90')]()[_0x90c1('0x26')](function(){if(!_0x53d98f){if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x78')])return;_0x1b71e2[_0x90c1('0x4e')](_0x90c1('0x91'));_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x91'));return;}if(_0x916ce1[_0x90c1('0x92')][_0x90c1('0x93')]!==_0x90c1('0x94'))return;return _0x916ce1[_0x90c1('0x92')][_0x90c1('0x95')]({'attributes':['id'],'raw':!![]})[_0x90c1('0x26')](function(_0x27e909){if(_[_0x90c1('0x77')](_0x27e909)){_0x1b71e2['where'](_0x90c1('0x96'));_0xa117d1[_0x90c1('0x4e')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x1b71e2[_0x90c1('0x4e')](_0x90c1('0x79'),_[_0x90c1('0x2c')](_0x27e909,'id'));_0xa117d1[_0x90c1('0x4e')](_0x90c1('0x79'),_['map'](_0x27e909,'id'));}});})[_0x90c1('0x26')](function(){if(_0x916ce1['user'][_0x90c1('0x93')]===_0x90c1('0x94')&&!_0x53d98f&&!_0x916ce1['query'][_0x90c1('0x78')])return[];return db[_0x90c1('0x97')][_0x90c1('0x42')](_0x1b71e2[_0x90c1('0x98')](),_0x57f05d);})[_0x90c1('0x26')](function(_0x514f1d){_0x55969f[_0x90c1('0x22')]=_0x514f1d['length'];if(_0x55969f['count']===0x0)return[];return db['sequelize'][_0x90c1('0x42')](_0x304011[_0x90c1('0x98')](),_0x57f05d)['then'](function(_0x2a21cc){_0x4bde8e=_[_0x90c1('0x99')](_0x2a21cc,'id');_0x57f05d=_[_0x90c1('0x9a')](_0x57f05d,{'model':db[_0x90c1('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x916ce1[_0x90c1('0x42')][_0x90c1('0x47')]){_0x1b3372[_0x90c1('0x46')]['forEach'](function(_0x5b9abf){_0xa117d1['field']('i.'+_0x5b9abf);});}else{_0xa117d1[_0x90c1('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x90c1('0x66'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9b'),_0x90c1('0x9c'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9d'),'Account.mandatoryDisposition');_0xa117d1[_0x90c1('0x50')](_0x90c1('0x9e'),_0x90c1('0x9f'));_0xa117d1['field'](_0x90c1('0xa0'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa1'),_0x90c1('0xa2'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa3'),_0x90c1('0xa4'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa5'),_0x90c1('0xa6'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa7'),_0x90c1('0xa8'));_0xa117d1[_0x90c1('0x50')](_0x90c1('0xa9'),_0x90c1('0xaa'));_0xa117d1['field'](_0x90c1('0xab'),_0x90c1('0xac'));_0xa117d1[_0x90c1('0x50')]('o.fullname',_0x90c1('0xad'));_0xa117d1[_0x90c1('0x50')]('o.internal','Owner.internal');_0xa117d1['field'](_0x90c1('0xae'),'TagIds');}if(_0x1b3372[_0x90c1('0x4b')])_0xa117d1[_0x90c1('0x4b')](_0x1b3372[_0x90c1('0x4b')]);if(_0x1b3372[_0x90c1('0x20')])_0xa117d1[_0x90c1('0x20')](_0x1b3372[_0x90c1('0x20')]);return db['sequelize']['query'](_0xa117d1[_0x90c1('0x98')](),_0x57f05d);})['then'](function(_0x2d109b){if(_0x2d109b['length']>0x0)_0x23359c['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0x90c1('0x2c')](_0x2d109b,'id'));return db['sequelize'][_0x90c1('0x42')](_0x23359c[_0x90c1('0x98')](),_0x57f05d)[_0x90c1('0x26')](function(_0x3f6a68){var _0x7e5291=_[_0x90c1('0xaf')](_0x3f6a68,_0x90c1('0xb0'));var _0x4f672a=[];_0x2d109b[_0x90c1('0x31')](function(_0x48d935){_0x4f672a['push'](updateWhatsappInteraction(_0x48d935,_0x4bde8e,_0x7e5291));});return BPromise['all'](_0x4f672a);});});})['then'](function(_0x538c2f){_0x55969f['rows']=_0x538c2f;return _0x55969f;})['then'](respondWithFilteredResult(_0x8e4792,_0x1b3372))['catch'](handleError(_0x8e4792,null));};exports[_0x90c1('0xb1')]=function(_0x374380,_0x1b67a0){var _0xe3940a={'raw':![],'where':{'id':_0x374380[_0x90c1('0xb2')]['id']}},_0x56e5cf={};_0x56e5cf[_0x90c1('0x41')]=_[_0x90c1('0x43')](db[_0x90c1('0x3c')][_0x90c1('0x3d')]);_0x56e5cf[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x374380['query']);_0x56e5cf[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x56e5cf[_0x90c1('0x41')],_0x56e5cf[_0x90c1('0x42')]);_0xe3940a[_0x90c1('0x46')]=_['intersection'](_0x56e5cf['model'],qs[_0x90c1('0x47')](_0x374380[_0x90c1('0x42')][_0x90c1('0x47')]));_0xe3940a['attributes']=_0xe3940a[_0x90c1('0x46')]['length']?_0xe3940a['attributes']:_0x56e5cf[_0x90c1('0x41')];if(_0x374380['query'][_0x90c1('0xb3')]){_0xe3940a[_0x90c1('0xb4')]=[{'all':!![]}];}_0xe3940a=_[_0x90c1('0x9a')]({},_0xe3940a,_0x374380[_0x90c1('0xb5')]);return db[_0x90c1('0x3c')][_0x90c1('0x65')](_0xe3940a)[_0x90c1('0x26')](handleEntityNotFound(_0x1b67a0,null))['then'](respondWithResult(_0x1b67a0,null))[_0x90c1('0x33')](handleError(_0x1b67a0,null));};exports[_0x90c1('0xb6')]=function(_0x15fcbf,_0x456986){return db[_0x90c1('0x3c')][_0x90c1('0xb6')](_0x15fcbf[_0x90c1('0xb7')],{})[_0x90c1('0x26')](respondWithResult(_0x456986,0xc9))[_0x90c1('0x33')](handleError(_0x456986,null));};exports[_0x90c1('0x25')]=function(_0x44dd1b,_0x2ce759){if(_0x44dd1b[_0x90c1('0xb7')]['id']){delete _0x44dd1b['body']['id'];}return db[_0x90c1('0x3c')][_0x90c1('0x65')]({'where':{'id':_0x44dd1b['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x2ce759,null))[_0x90c1('0x26')](saveUpdates(_0x44dd1b[_0x90c1('0xb7')],null))[_0x90c1('0x26')](respondWithResult(_0x2ce759,null))['catch'](handleError(_0x2ce759,null));};exports[_0x90c1('0xb8')]=function(_0x3b6f03,_0x247af3){return db['WhatsappInteraction'][_0x90c1('0x65')]({'where':{'id':_0x3b6f03['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x247af3,null))[_0x90c1('0x26')](removeEntity(_0x247af3,null))[_0x90c1('0x33')](handleError(_0x247af3,null));};exports[_0x90c1('0xb9')]=function(_0x506ca9,_0x5eae13){return db[_0x90c1('0x3c')][_0x90c1('0xb9')]()[_0x90c1('0x26')](respondWithResult(_0x5eae13,null))['catch'](handleError(_0x5eae13,null));};exports[_0x90c1('0xba')]=function(_0x5b3b15,_0x22458f,_0x2f8553){return db[_0x90c1('0xbb')]['find']({'where':{'id':_0x5b3b15[_0x90c1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x22458f,null))['then'](function(_0x54ec71){if(_0x54ec71){return _0x54ec71[_0x90c1('0xba')](_0x5b3b15['body'][_0x90c1('0xbc')],_['omit'](_0x5b3b15[_0x90c1('0xb7')],[_0x90c1('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x22458f,null))['catch'](handleError(_0x22458f,null));};exports[_0x90c1('0xbd')]=function(_0x52c3be,_0x17539a,_0x6c1b40){var _0x1cb90e={'raw':![],'where':{}};var _0x21e3d5={};var _0x24816b={'count':0x0,'rows':[]};return db[_0x90c1('0x3c')][_0x90c1('0xbe')]({'where':{'id':_0x52c3be['params']['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x17539a,null))[_0x90c1('0x26')](function(_0x504f1d){if(_0x504f1d){_0x21e3d5[_0x90c1('0x41')]=_[_0x90c1('0x43')](db[_0x90c1('0xbb')]['rawAttributes']);_0x21e3d5[_0x90c1('0x42')]=_[_0x90c1('0x43')](_0x52c3be[_0x90c1('0x42')]);_0x21e3d5[_0x90c1('0x44')]=_[_0x90c1('0x45')](_0x21e3d5[_0x90c1('0x41')],_0x21e3d5[_0x90c1('0x42')]);_0x1cb90e[_0x90c1('0x46')]=_[_0x90c1('0x45')](_0x21e3d5[_0x90c1('0x41')],qs[_0x90c1('0x47')](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x47')]));_0x1cb90e[_0x90c1('0x46')]=_0x1cb90e[_0x90c1('0x46')][_0x90c1('0x48')]?_0x1cb90e[_0x90c1('0x46')]:_0x21e3d5[_0x90c1('0x41')];if(!_0x52c3be[_0x90c1('0x42')]['hasOwnProperty'](_0x90c1('0x4a'))){_0x1cb90e['limit']=qs[_0x90c1('0x4b')](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x4b')]);_0x1cb90e[_0x90c1('0x20')]=qs[_0x90c1('0x20')](_0x52c3be['query'][_0x90c1('0x20')]);}_0x1cb90e[_0x90c1('0x4c')]=qs['sort'](_0x52c3be[_0x90c1('0x42')][_0x90c1('0x4d')]);_0x1cb90e[_0x90c1('0x4e')]=qs[_0x90c1('0x44')](_[_0x90c1('0x4f')](_0x52c3be['query'],_0x21e3d5[_0x90c1('0x44')]));_0x1cb90e['where'][_0x90c1('0xb0')]=_0x504f1d['id'];if(_0x52c3be[_0x90c1('0x42')][_0x90c1('0x85')]){_0x1cb90e[_0x90c1('0x4e')]=_['merge'](_0x1cb90e['where'],{'$or':_['map'](_0x1cb90e['attributes'],function(_0x21f88f){var _0x433d6f={};_0x433d6f[_0x21f88f]={'$like':'%'+_0x52c3be[_0x90c1('0x42')][_0x90c1('0x85')]+'%'};return _0x433d6f;})});}if(_0x52c3be['query'][_0x90c1('0x7c')]){var _0x18b29a=_0x52c3be[_0x90c1('0x42')][_0x90c1('0x7c')][_0x90c1('0x30')](',');var _0x5e9923={};_0x5e9923[_0x18b29a[0x0]]={'$gte':moment(_0x18b29a[0x1])[_0x90c1('0xbf')](_0x90c1('0xc0'))};_0x1cb90e[_0x90c1('0x4e')]=_['merge'](_0x1cb90e[_0x90c1('0x4e')],_0x5e9923);}_0x1cb90e=_[_0x90c1('0x9a')]({},_0x1cb90e,_0x52c3be[_0x90c1('0xb5')]);return db[_0x90c1('0xbb')][_0x90c1('0x22')]({'where':_0x1cb90e[_0x90c1('0x4e')]})[_0x90c1('0x26')](function(_0x2130f4){_0x24816b['count']=_0x2130f4;if(_0x52c3be['query'][_0x90c1('0xb3')]){_0x1cb90e[_0x90c1('0xb4')]=[{'all':!![]}];}return db[_0x90c1('0xbb')][_0x90c1('0xc1')](_0x1cb90e);})[_0x90c1('0x26')](function(_0x149b98){_0x24816b[_0x90c1('0xc2')]=_0x149b98;return _0x24816b;});}})[_0x90c1('0x26')](respondWithFilteredResult(_0x17539a,_0x1cb90e))[_0x90c1('0x33')](handleError(_0x17539a,null));};exports[_0x90c1('0xc3')]=function(_0x31cc49,_0x53218c,_0x5671ff){return db[_0x90c1('0x3c')][_0x90c1('0x65')]({'where':{'id':_0x31cc49['params']['id']}})['then'](handleEntityNotFound(_0x53218c,null))[_0x90c1('0x26')](function(_0x5911ab){if(_0x5911ab){return _0x5911ab[_0x90c1('0xc4')](_0x31cc49[_0x90c1('0xb7')][_0x90c1('0xbc')],_[_0x90c1('0xc5')](_0x31cc49[_0x90c1('0xb7')],['ids','id'])||{})[_0x90c1('0xc6')](function(){return db[_0x90c1('0x70')][_0x90c1('0xc1')]({'attributes':['id',_0x90c1('0x2a'),_0x90c1('0x51')],'where':{'id':_0x31cc49['body'][_0x90c1('0xbc')]}});})[_0x90c1('0x26')](function(_0x4a9148){socket[_0x90c1('0xc7')](_0x90c1('0xc8'),{'id':Number(_0x31cc49['params']['id']),'tags':_0x4a9148||[]});return{'id':Number(_0x31cc49['params']['id']),'tags':_0x4a9148||[]};});}})[_0x90c1('0x26')](respondWithResult(_0x53218c,null))[_0x90c1('0x33')](handleError(_0x53218c,null));};exports[_0x90c1('0xc9')]=function(_0x15a9c6,_0x1994f8,_0x4660fa){return db[_0x90c1('0x3c')]['find']({'where':{'id':_0x15a9c6[_0x90c1('0xb2')]['id']}})[_0x90c1('0x26')](handleEntityNotFound(_0x1994f8,null))[_0x90c1('0x26')](function(_0x550ae5){if(_0x550ae5){return _0x550ae5[_0x90c1('0xc9')](_0x15a9c6[_0x90c1('0x42')][_0x90c1('0xbc')]);}})[_0x90c1('0x26')](respondWithStatusCode(_0x1994f8,null))[_0x90c1('0x33')](handleError(_0x1994f8,null));};exports['download']=function(_0x39f2cd,_0x385a82){var _0x3d688f=moment()[_0x90c1('0xca')]()[_0x90c1('0x98')]();var _0x2b1dfe=path[_0x90c1('0xcb')](config['root'],'server',_0x90c1('0xcc'),_0x90c1('0xcd'));var _0x2aaca6=path[_0x90c1('0xcb')](config[_0x90c1('0xce')],_0x90c1('0xcf'),_0x90c1('0xcc'),'attachments');var _0x382a51=path['join'](_0x2b1dfe,_0x3d688f);var _0x4138dc=util['format']('transcript-%d-%s.zip',_0x39f2cd['params']['id'],_0x3d688f);var _0x46461f=path[_0x90c1('0xcb')](_0x2b1dfe,_0x4138dc);var _0x32b274=[];_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd0')],'as':_0x90c1('0xd0'),'attributes':['id','fullname'],'raw':!![]});_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd1')],'as':'Contact','attributes':['id',_0x90c1('0xd2'),'lastName'],'raw':!![]});if(_0x39f2cd[_0x90c1('0x42')][_0x90c1('0xd3')]){_0x32b274[_0x90c1('0x32')]({'model':db[_0x90c1('0xd4')],'as':_0x90c1('0xd4'),'raw':!![]});}var _0x599e02=[{'model':db[_0x90c1('0xbb')],'as':_0x90c1('0xd5'),'attributes':['id',_0x90c1('0xb7'),_0x90c1('0xd6'),_0x90c1('0xd7'),_0x90c1('0xd8'),_0x90c1('0x81')],'include':_0x32b274}];_0x599e02[_0x90c1('0x32')]({'model':db[_0x90c1('0xd9')],'as':'Account','attributes':['id',_0x90c1('0x2a')]});_0x599e02[_0x90c1('0x32')]({'model':db[_0x90c1('0xd0')],'as':_0x90c1('0xda'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x90c1('0x65')]({'where':{'id':_0x39f2cd[_0x90c1('0xb2')]['id']},'include':_0x599e02})[_0x90c1('0x26')](handleEntityNotFound(_0x385a82,null))[_0x90c1('0x26')](function(_0x17eec9){if(_0x17eec9){var _0x5e6557=_0x17eec9['get']({'plain':!![]});fs[_0x90c1('0xdb')](_0x382a51);var _0x31e6c9={'channel':_0x90c1('0xdc'),'account':_0x5e6557[_0x90c1('0xdd')][_0x90c1('0x2a')],'agent':_0x5e6557[_0x90c1('0xda')]?_0x5e6557['Owner'][_0x90c1('0x2d')]:_0x90c1('0xde'),'createdAt':moment(_0x5e6557[_0x90c1('0xd6')])[_0x90c1('0xbf')](_0x90c1('0xc0'))[_0x90c1('0x98')](),'closedAt':_0x5e6557[_0x90c1('0x37')]?moment(_0x5e6557[_0x90c1('0xdf')])[_0x90c1('0xbf')](_0x90c1('0xc0'))['toString']():'','disposition':_0x5e6557[_0x90c1('0xe0')],'messages':_(_0x5e6557[_0x90c1('0xd5')])[_0x90c1('0x85')]({'secret':![]})[_0x90c1('0x2c')](function(_0x26f005){if(_0x26f005['Attachment']){var _0x280894=path[_0x90c1('0xcb')](_0x2aaca6,_0x26f005[_0x90c1('0xd4')][_0x90c1('0xe1')]);if(fs[_0x90c1('0xe2')](_0x280894)){fs[_0x90c1('0xe3')](_0x280894)[_0x90c1('0xe4')](fs[_0x90c1('0xe5')](path[_0x90c1('0xcb')](_0x382a51,_0x26f005[_0x90c1('0xd4')][_0x90c1('0xe1')])));}}return{'date':moment(_0x26f005[_0x90c1('0xd6')])[_0x90c1('0xbf')](_0x90c1('0xc0'))['toString'](),'sender':_0x26f005[_0x90c1('0xd7')]==='out'?_0x26f005[_0x90c1('0xd0')]?_0x26f005['User'][_0x90c1('0x2d')]:_0x90c1('0xe6'):_0x26f005['Contact'][_0x90c1('0xd2')]+(_0x26f005[_0x90c1('0xe7')]['lastName']?'\x20'+_0x26f005[_0x90c1('0xe7')][_0x90c1('0xe8')]:''),'body':_0x26f005[_0x90c1('0xd4')]?_0x26f005['Attachment'][_0x90c1('0xe1')]:_0x26f005['body'],'direction':_0x26f005[_0x90c1('0xd7')]==='out'?'A':'C','secret':_0x26f005[_0x90c1('0xd8')],'read':_0x26f005[_0x90c1('0x81')],'attachment':_0x26f005[_0x90c1('0xd4')]};})[_0x90c1('0x6b')]()};return ejs[_0x90c1('0xe9')](path['join'](config[_0x90c1('0xce')],_0x90c1('0xcf'),'views',_0x90c1('0xea')),{'interaction':_0x31e6c9})[_0x90c1('0x26')](function(_0x43691c){var _0x338fa1=path[_0x90c1('0xcb')](_0x382a51,'transcript-'+_0x5e6557['id']+'-'+_0x3d688f+_0x90c1('0xeb'));var _0x2baed5={'path':_0x338fa1,'channel':'Whatsapp','interactionId':_0x5e6557['id']};return pdf[_0x90c1('0xec')](_0x43691c,_0x2baed5);})[_0x90c1('0x26')](function(){return new BPromise(function(_0x2ffbce,_0x58e4d5){zipdir(_0x382a51,{'saveTo':_0x46461f},function(_0x100e4d,_0x33e00c){if(_0x100e4d)return _0x58e4d5(_0x100e4d);return _0x2ffbce(_0x33e00c);});})['then'](function(){return new BPromise(function(_0x3f5f3e,_0x251c7e){rimraf(_0x382a51,function(_0x1f0d68){if(_0x1f0d68)_0x251c7e(_0x1f0d68);return _0x3f5f3e();});});})[_0x90c1('0x26')](function(){return _0x385a82[_0x90c1('0xed')](_0x46461f,_0x4138dc,function(_0x1cbb30){if(_0x1cbb30){console[_0x90c1('0xee')](_0x90c1('0xef'),_0x1cbb30);}else{fs[_0x90c1('0xf0')](_0x46461f);}});});});}else{return _0x385a82[_0x90c1('0x1d')](0xc8);}})[_0x90c1('0x33')](handleError(_0x385a82,null));}; \ No newline at end of file +var _0xad9f=['defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','fullname','TagIds','Tags','forEach','push','catch','talking','answered','total','waiting','closed','UserId','unmanaged','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','nolimit','order','sort','where','field','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','select','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','rows','show','params','create','body','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','pick','WhatsappInteractionId','format','includeAll','findAll','addTags','setTags','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','existsSync','createReadStream','createWriteStream','basename','renderFile','root','transcript-','log','err','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x1e1fa7,_0x3b2b89){var _0x10b981=function(_0x571c1f){while(--_0x571c1f){_0x1e1fa7['push'](_0x1e1fa7['shift']());}};_0x10b981(++_0x3b2b89);}(_0xad9f,0x1be));var _0xfad9=function(_0x1bc7c0,_0x3017b4){_0x1bc7c0=_0x1bc7c0-0x0;var _0x18846d=_0xad9f[_0x1bc7c0];return _0x18846d;};'use strict';var emlformat=require(_0xfad9('0x0'));var rimraf=require(_0xfad9('0x1'));var zipdir=require(_0xfad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfad9('0x3'));var moment=require(_0xfad9('0x4'));var BPromise=require(_0xfad9('0x5'));var Mustache=require(_0xfad9('0x6'));var util=require('util');var path=require(_0xfad9('0x7'));var sox=require('sox');var csv=require(_0xfad9('0x8'));var ejs=require(_0xfad9('0x9'));var fs=require('fs');var fs_extra=require(_0xfad9('0xa'));var _=require(_0xfad9('0xb'));var squel=require(_0xfad9('0xc'));var crypto=require(_0xfad9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfad9('0x8'));var querystring=require(_0xfad9('0xe'));var Papa=require(_0xfad9('0xf'));var Redis=require(_0xfad9('0x10'));var authService=require(_0xfad9('0x11'));var qs=require(_0xfad9('0x12'));var as=require(_0xfad9('0x13'));var pdf=require(_0xfad9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfad9('0x15'))(_0xfad9('0x16'));var utils=require(_0xfad9('0x17'));var config=require(_0xfad9('0x18'));var licenseUtil=require(_0xfad9('0x19'));var db=require(_0xfad9('0x1a'))['db'];config[_0xfad9('0x1b')]=_[_0xfad9('0x1c')](config[_0xfad9('0x1b')],{'host':_0xfad9('0x1d'),'port':0x18eb});var socket=require(_0xfad9('0x1e'))(new Redis(config['redis']));require(_0xfad9('0x1f'))[_0xfad9('0x20')](socket);function respondWithStatusCode(_0x1d61f9,_0x2d4b3e){_0x2d4b3e=_0x2d4b3e||0xcc;return function(_0x16c3e9){if(_0x16c3e9){return _0x1d61f9[_0xfad9('0x21')](_0x2d4b3e);}return _0x1d61f9['status'](_0x2d4b3e)[_0xfad9('0x22')]();};}function respondWithResult(_0x4c7612,_0x1f6808){_0x1f6808=_0x1f6808||0xc8;return function(_0x43d2ef){if(_0x43d2ef){return _0x4c7612['status'](_0x1f6808)['json'](_0x43d2ef);}};}function respondWithFilteredResult(_0x41e7cc,_0x18e48a){return function(_0x386d95){if(_0x386d95){var _0xe2ffc0=typeof _0x18e48a[_0xfad9('0x23')]===_0xfad9('0x24')&&typeof _0x18e48a[_0xfad9('0x25')]===_0xfad9('0x24');var _0x97cc3a=_0x386d95[_0xfad9('0x26')];var _0x55b775=_0xe2ffc0?0x0:_0x18e48a['offset'];var _0x5d6a8f=_0xe2ffc0?_0x386d95[_0xfad9('0x26')]:_0x18e48a[_0xfad9('0x23')]+_0x18e48a[_0xfad9('0x25')];var _0x3aac40;if(_0x5d6a8f>=_0x97cc3a){_0x5d6a8f=_0x97cc3a;_0x3aac40=0xc8;}else{_0x3aac40=0xce;}_0x41e7cc[_0xfad9('0x27')](_0x3aac40);return _0x41e7cc[_0xfad9('0x28')](_0xfad9('0x29'),_0x55b775+'-'+_0x5d6a8f+'/'+_0x97cc3a)[_0xfad9('0x2a')](_0x386d95);}return null;};}function patchUpdates(_0x788ea7){return function(_0x63d6c7){try{jsonpatch[_0xfad9('0x2b')](_0x63d6c7,_0x788ea7,!![]);}catch(_0x15fdaa){return BPromise[_0xfad9('0x2c')](_0x15fdaa);}return _0x63d6c7[_0xfad9('0x2d')]();};}function saveUpdates(_0x120f2d,_0xa70c35){return function(_0x58bd34){if(_0x58bd34){return _0x58bd34[_0xfad9('0x2e')](_0x120f2d)[_0xfad9('0x2f')](function(_0x1e7c44){return _0x1e7c44;});}return null;};}function removeEntity(_0x174ec9,_0x39f094){return function(_0x51ee01){if(_0x51ee01){return _0x51ee01[_0xfad9('0x30')]()['then'](function(){_0x174ec9[_0xfad9('0x27')](0xcc)[_0xfad9('0x22')]();});}};}function handleEntityNotFound(_0x58afa4,_0x57e717){return function(_0x3d5f4b){if(!_0x3d5f4b){_0x58afa4[_0xfad9('0x21')](0x194);}return _0x3d5f4b;};}function handleError(_0x584fc1,_0x38c053){_0x38c053=_0x38c053||0x1f4;return function(_0x5e61c9){logger[_0xfad9('0x31')](_0x5e61c9['stack']);if(_0x5e61c9[_0xfad9('0x32')]){delete _0x5e61c9['name'];}_0x584fc1[_0xfad9('0x27')](_0x38c053)[_0xfad9('0x33')](_0x5e61c9);};}function getInteractionUsers(_0x5df822,_0x1c72cd){return new BPromise(function(_0x44c125,_0x1e6909){try{if(_0x1c72cd[_0x5df822['id']]){_0x5df822['Users']=_[_0xfad9('0x34')](_0x1c72cd[_0x5df822['id']],function(_0x276856){return{'id':_0x276856['id'],'fullname':_0x276856[_0xfad9('0x35')]};});}}catch(_0x2b13ff){_0x1e6909(_0x2b13ff);}_0x44c125(_0x5df822);});}function getInteractionTags(_0x38a3d3,_0x4e21a8){return new BPromise(function(_0x3fbdbd,_0x31d2dc){try{if(_0x38a3d3[_0xfad9('0x36')]){_0x38a3d3[_0xfad9('0x37')]=[];_0x38a3d3['TagIds']['split'](',')[_0xfad9('0x38')](function(_0x4ebe24){_0x38a3d3[_0xfad9('0x37')][_0xfad9('0x39')](_0x4e21a8[_0x4ebe24]);});}delete _0x38a3d3[_0xfad9('0x36')];}catch(_0x1d4735){_0x31d2dc(_0x1d4735);}_0x3fbdbd(_0x38a3d3);});}function updateWhatsappInteraction(_0x29da0b,_0x1f6395,_0x39e631){return new BPromise(function(_0x6e1a9,_0x5779c3){return getInteractionUsers(_0x29da0b,_0x39e631)[_0xfad9('0x2f')](function(_0x1038c4){return getInteractionTags(_0x1038c4,_0x1f6395);})[_0xfad9('0x2f')](function(_0x21898a){return getStateInteraction(_0x21898a);})['then'](function(_0x262255){_0x6e1a9(_0x262255);})[_0xfad9('0x3a')](function(_0x54e5fc){_0x5779c3(_0x54e5fc);});});}function getStateInteraction(_0x4f042e){return new BPromise(function(_0xe8cba8){_0x4f042e['waiting']=0x0;_0x4f042e[_0xfad9('0x3b')]=0x0;_0x4f042e[_0xfad9('0x3c')]=0x0;_0x4f042e['unmanaged']=0x0;_0x4f042e[_0xfad9('0x3d')]=0x0;if(!_0x4f042e['closed']&&!_0x4f042e['UserId']){_0x4f042e[_0xfad9('0x3e')]+=0x1;}if(!_0x4f042e[_0xfad9('0x3f')]&&_0x4f042e[_0xfad9('0x40')]){_0x4f042e[_0xfad9('0x3b')]+=0x1;if(_0x4f042e[_0xfad9('0x3e')]){_0x4f042e[_0xfad9('0x3e')]-=0x1;}}if(_0x4f042e[_0xfad9('0x3f')]&&_0x4f042e[_0xfad9('0x40')]){_0x4f042e[_0xfad9('0x3c')]+=0x1;if(_0x4f042e['talking']){_0x4f042e[_0xfad9('0x3b')]-=0x1;}}if(_0x4f042e[_0xfad9('0x3f')]&&!_0x4f042e[_0xfad9('0x40')]){_0x4f042e[_0xfad9('0x41')]+=0x1;if(_0x4f042e[_0xfad9('0x3e')]){_0x4f042e[_0xfad9('0x3e')]-=0x1;}}_0x4f042e[_0xfad9('0x3d')]+=0x1;_0xe8cba8(_0x4f042e);});}exports['index']=function(_0x4e2abe,_0x25ab83){var _0x5bb3a6={},_0x3e09b3={},_0x1906f7={'count':0x0,'rows':[]};var _0x569c60=_[_0xfad9('0x34')](db[_0xfad9('0x42')][_0xfad9('0x43')],function(_0x363fbe){return{'name':_0x363fbe[_0xfad9('0x44')],'type':_0x363fbe[_0xfad9('0x45')][_0xfad9('0x46')]};});_0x3e09b3['model']=_[_0xfad9('0x34')](_0x569c60,_0xfad9('0x32'));_0x3e09b3[_0xfad9('0x47')]=_[_0xfad9('0x48')](_0x4e2abe[_0xfad9('0x47')]);_0x3e09b3[_0xfad9('0x49')]=_['intersection'](_0x3e09b3[_0xfad9('0x4a')],_0x3e09b3[_0xfad9('0x47')]);_0x5bb3a6['attributes']=_[_0xfad9('0x4b')](_0x3e09b3[_0xfad9('0x4a')],qs['fields'](_0x4e2abe['query']['fields']));_0x5bb3a6[_0xfad9('0x4c')]=_0x5bb3a6['attributes']['length']?_0x5bb3a6[_0xfad9('0x4c')]:_0x3e09b3[_0xfad9('0x4a')];if(!_0x4e2abe[_0xfad9('0x47')]['hasOwnProperty'](_0xfad9('0x4d'))){_0x5bb3a6[_0xfad9('0x25')]=qs[_0xfad9('0x25')](_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x25')]);_0x5bb3a6[_0xfad9('0x23')]=qs['offset'](_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x23')]);}_0x5bb3a6[_0xfad9('0x4e')]=qs[_0xfad9('0x4f')](_0x4e2abe[_0xfad9('0x47')]['sort']);_0x5bb3a6[_0xfad9('0x50')]=qs['filters'](_['pick'](_0x4e2abe[_0xfad9('0x47')],_0x3e09b3[_0xfad9('0x49')]),_0x569c60);var _0x3a0bf3=[];var _0xac7915=squel['select']()[_0xfad9('0x51')]('id')[_0xfad9('0x51')]('name')[_0xfad9('0x51')]('color')[_0xfad9('0x52')](_0xfad9('0x53'));var _0x4cc798=squel['select']()[_0xfad9('0x51')]('u.id')[_0xfad9('0x51')](_0xfad9('0x54'))['field'](_0xfad9('0x55'))['from'](_0xfad9('0x56'),'ui')[_0xfad9('0x57')](_0xfad9('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x1bda49=squel[_0xfad9('0x59')]()[_0xfad9('0x52')]('whatsapp_interactions','i')[_0xfad9('0x57')](_0xfad9('0x5a'),'c',_0xfad9('0x5b'))['left_join'](_0xfad9('0x58'),'o','o.id\x20=\x20i.UserId')[_0xfad9('0x57')]('whatsapp_accounts','a',_0xfad9('0x5c'))['left_join'](_0xfad9('0x5d'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xfad9('0x57')](_0xfad9('0x5e'),'it',_0xfad9('0x5f'))[_0xfad9('0x57')](_0xfad9('0x53'),'t',_0xfad9('0x60'));var _0x181154=squel[_0xfad9('0x61')]();var _0x175d8f=[];var _0x8fc3d6=squel[_0xfad9('0x61')]();var _0x3039e8;if(_0x4e2abe['query'][_0xfad9('0x62')]){_0x3039e8=as[_0xfad9('0x63')](_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x62')]);var _0x5904d4=_0x3039e8[_0xfad9('0x64')];for(var _0x540172=0x0;_0x540172<_0x3039e8[_0xfad9('0x65')][_0xfad9('0x66')];_0x540172++){var _0x49a3cb=_0x3039e8['conditions'][_0x540172];var _0x8c3eda='i';var _0x3f8328=_[_0xfad9('0x67')](_0x569c60,[_0xfad9('0x32'),_0x49a3cb['field']]);if(!_0x3f8328){switch(_0x49a3cb[_0xfad9('0x51')]){case _0xfad9('0x68'):if(_0x49a3cb[_0xfad9('0x69')]==0x1){_0x1bda49['having']('`'+_0x49a3cb[_0xfad9('0x51')]+'`\x20=\x200');}else{_0x1bda49['having']('`'+_0x49a3cb[_0xfad9('0x51')]+_0xfad9('0x6a'));}break;case _0xfad9('0x6b'):if(_0x49a3cb[_0xfad9('0x6c')]===_0xfad9('0x6d')){if(_0x49a3cb['value'][_0xfad9('0x6e')]('\x20')[_0xfad9('0x66')]>0x1){_0x181154[_0x5904d4](_0xfad9('0x6f'),qs[_0xfad9('0x70')](_0x49a3cb['value']),null);}else{var _0x30387a='%'+_0x49a3cb[_0xfad9('0x69')]+'%';_0x181154[_0x5904d4](_0xfad9('0x71'),_0x30387a,_0x30387a,_0x30387a);}}else{_0x3f8328=_['find'](_0x569c60,[_0xfad9('0x32'),_0xfad9('0x72')]);_0x49a3cb[_0xfad9('0x51')]=_0xfad9('0x72');_0x184bb3=as[_0xfad9('0x73')](_0x8c3eda,_0x3f8328[_0xfad9('0x45')],_0x49a3cb);_0x181154[_0x5904d4](_0x184bb3[_0xfad9('0x74')],_0x184bb3[_0xfad9('0x69')][_0xfad9('0x75')],_0x184bb3[_0xfad9('0x69')]['end']);}break;case _0xfad9('0x76'):var _0x106494=_0x49a3cb[_0xfad9('0x69')]['split'](',')['map'](function(_0x35392d){return Number(_0x35392d);});_0x106494[_0xfad9('0x38')](function(_0x2c566f){_0x8fc3d6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c566f+',%');});_0x175d8f=_[_0xfad9('0x77')](_0x175d8f,_0x106494);break;case _0xfad9('0x78'):if(_0x49a3cb[_0xfad9('0x6c')]===_0xfad9('0x6d')){_0x181154[_0x5904d4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x49a3cb[_0xfad9('0x69')]+'%',null);}else{_0x3f8328=_['find'](_0x569c60,[_0xfad9('0x32'),'UserId']);_0x49a3cb[_0xfad9('0x51')]=_0xfad9('0x40');_0x184bb3=as[_0xfad9('0x73')](_0x8c3eda,_0x3f8328[_0xfad9('0x45')],_0x49a3cb);_0x181154[_0x5904d4](_0x184bb3[_0xfad9('0x74')],_0x184bb3[_0xfad9('0x69')][_0xfad9('0x75')],_0x184bb3[_0xfad9('0x69')][_0xfad9('0x22')]);}break;case'body':_0x184bb3=as[_0xfad9('0x73')]('me',null,_0x49a3cb);_0x181154[_0x5904d4](_0x184bb3[_0xfad9('0x74')],_0x184bb3[_0xfad9('0x69')]['start'],_0x184bb3['value'][_0xfad9('0x22')]);break;}}else{var _0x184bb3=as[_0xfad9('0x73')](_0x8c3eda,_0x3f8328[_0xfad9('0x45')],_0x49a3cb);_0x181154[_0x5904d4](_0x184bb3[_0xfad9('0x74')],_0x184bb3[_0xfad9('0x69')]['start'],_0x184bb3['value']['end']);}}}else{var _0x5c8fc3=_(_0x4e2abe[_0xfad9('0x47')])['keys']()['map'](function(_0x482ed1){return _['some'](_0x569c60,[_0xfad9('0x32'),_0x482ed1])?_0x482ed1:undefined;})['compact']()['value']();if(!_[_0xfad9('0x79')](_0x5c8fc3)){_0x5c8fc3[_0xfad9('0x38')](function(_0x22da84){if(_0x22da84===_0xfad9('0x7a')){_0x1bda49['where'](_0xfad9('0x7b'),[][_0xfad9('0x7c')](_0x4e2abe[_0xfad9('0x47')][_0x22da84]));}else if(_0x22da84===_0xfad9('0x7d')){var _0x1cf136=JSON['parse'](_0x4e2abe['query'][_0x22da84])[_0xfad9('0x7e')];var _0x2a264e=JSON[_0xfad9('0x7f')](_0x4e2abe[_0xfad9('0x47')][_0x22da84])['$lte'];_0x1bda49[_0xfad9('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1cf136,_0x2a264e);}else{if(_0x4e2abe['query'][_0x22da84]===_0xfad9('0x80')){_0x1bda49['where']('i.'+_0x22da84+_0xfad9('0x81'));}else{_0x1bda49[_0xfad9('0x50')]('i.'+_0x22da84+_0xfad9('0x82'),_0x4e2abe[_0xfad9('0x47')][_0x22da84]);}}});}if(_0x4e2abe[_0xfad9('0x47')]['read']){if(_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x83')]==0x1){_0x1bda49[_0xfad9('0x84')]('`unreadMessages`\x20=\x200');}else{_0x1bda49[_0xfad9('0x84')](_0xfad9('0x85'));}}if(_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x86')]){_0x175d8f=_[_0xfad9('0x87')](_0x4e2abe[_0xfad9('0x47')]['tag'])?_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x86')]:new Array(_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x86')]);_0x175d8f[_0xfad9('0x38')](function(_0xb98d16){_0x8fc3d6['or'](_0xfad9('0x88'),'%,'+_0xb98d16+',%');});}if(_0x4e2abe[_0xfad9('0x47')]['filter']){var _0x4e34fc=_0x4e2abe[_0xfad9('0x47')][_0xfad9('0x89')][_0xfad9('0x8a')]('\x5c','\x5c\x5c')[_0xfad9('0x8a')](/'/g,'\x27\x27');if(qs[_0xfad9('0x8b')](_0x4e34fc)){_0x181154['or'](_0xfad9('0x8c'),_0x4e34fc+'%')['or'](_0xfad9('0x8d'),_0x4e34fc+'%');}else{_0x181154['or'](_0xfad9('0x8e'),qs['getFullTextValue'](_0x4e34fc))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4e34fc+'%');}}}_0x1bda49['where'](_0x181154);_0x1bda49[_0xfad9('0x8f')](_0xfad9('0x90'));var _0x2f0f44={'type':db['Sequelize'][_0xfad9('0x91')][_0xfad9('0x92')],'raw':!![]};var _0x5d945a=_0x1bda49['clone']();_0x5d945a[_0xfad9('0x51')]('i.id');_0x5d945a[_0xfad9('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfad9('0x68'));if(_0x5bb3a6[_0xfad9('0x4e')]){_0x5bb3a6[_0xfad9('0x4e')][_0xfad9('0x38')](function(_0x173eb3){var _0x595311=_0x173eb3[0x0]==='contactName'?_0x173eb3[0x0]:'i.'+_0x173eb3[0x0];_0x1bda49[_0xfad9('0x4e')](_0x595311,_0x173eb3[0x1]===_0xfad9('0x93')?![]:!![]);});}if(!_[_0xfad9('0x79')](_0x175d8f)){_0x1bda49[_0xfad9('0x84')](_0x8fc3d6);_0x5d945a[_0xfad9('0x50')](_0xfad9('0x94'),_0x175d8f);}BPromise[_0xfad9('0x95')]()[_0xfad9('0x2f')](function(){if(!_0x3039e8){if(_0x4e2abe[_0xfad9('0x47')]['WhatsappAccountId'])return;_0x5d945a[_0xfad9('0x50')](_0xfad9('0x96'));_0x1bda49[_0xfad9('0x50')](_0xfad9('0x96'));return;}if(_0x4e2abe[_0xfad9('0x97')][_0xfad9('0x98')]!==_0xfad9('0x99'))return;return _0x4e2abe[_0xfad9('0x97')][_0xfad9('0x9a')]({'attributes':['id'],'raw':!![]})[_0xfad9('0x2f')](function(_0x50d55e){if(_[_0xfad9('0x79')](_0x50d55e)){_0x5d945a[_0xfad9('0x50')](_0xfad9('0x9b'));_0x1bda49[_0xfad9('0x50')](_0xfad9('0x9b'));}else{_0x5d945a['where'](_0xfad9('0x7b'),_[_0xfad9('0x34')](_0x50d55e,'id'));_0x1bda49[_0xfad9('0x50')](_0xfad9('0x7b'),_[_0xfad9('0x34')](_0x50d55e,'id'));}});})[_0xfad9('0x2f')](function(){if(_0x4e2abe['user'][_0xfad9('0x98')]===_0xfad9('0x99')&&!_0x3039e8&&!_0x4e2abe[_0xfad9('0x47')]['WhatsappAccountId'])return[];return db[_0xfad9('0x9c')][_0xfad9('0x47')](_0x5d945a['toString'](),_0x2f0f44);})['then'](function(_0x19f778){_0x1906f7[_0xfad9('0x26')]=_0x19f778[_0xfad9('0x66')];if(_0x1906f7['count']===0x0)return[];return db[_0xfad9('0x9c')][_0xfad9('0x47')](_0xac7915[_0xfad9('0x9d')](),_0x2f0f44)[_0xfad9('0x2f')](function(_0xbb0615){_0x3a0bf3=_[_0xfad9('0x9e')](_0xbb0615,'id');_0x2f0f44=_[_0xfad9('0x9f')](_0x2f0f44,{'model':db[_0xfad9('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e2abe[_0xfad9('0x47')][_0xfad9('0xa0')]){_0x5bb3a6['attributes'][_0xfad9('0x38')](function(_0x265b82){_0x1bda49['field']('i.'+_0x265b82);});}else{_0x1bda49['field'](_0xfad9('0xa1'),_0xfad9('0x68'));_0x1bda49['field'](_0xfad9('0xa2'),'Account.key');_0x1bda49[_0xfad9('0x51')](_0xfad9('0xa3'),_0xfad9('0xa4'));_0x1bda49['field'](_0xfad9('0xa5'),_0xfad9('0xa6'));_0x1bda49[_0xfad9('0x51')]('i.*');_0x1bda49['field'](_0xfad9('0xa7'),'Contact.firstName');_0x1bda49[_0xfad9('0x51')](_0xfad9('0xa8'),_0xfad9('0xa9'));_0x1bda49[_0xfad9('0x51')](_0xfad9('0xaa'),_0xfad9('0xab'));_0x1bda49['field'](_0xfad9('0xac'),_0xfad9('0xad'));_0x1bda49[_0xfad9('0x51')](_0xfad9('0xae'),'Contact.mobile');_0x1bda49[_0xfad9('0x51')](_0xfad9('0xaf'),_0xfad9('0xb0'));_0x1bda49[_0xfad9('0x51')](_0xfad9('0xb1'),_0xfad9('0xb2'));_0x1bda49[_0xfad9('0x51')](_0xfad9('0xb3'),_0xfad9('0xb4'));_0x1bda49[_0xfad9('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfad9('0x36'));}if(_0x5bb3a6[_0xfad9('0x25')])_0x1bda49[_0xfad9('0x25')](_0x5bb3a6['limit']);if(_0x5bb3a6[_0xfad9('0x23')])_0x1bda49[_0xfad9('0x23')](_0x5bb3a6[_0xfad9('0x23')]);return db[_0xfad9('0x9c')][_0xfad9('0x47')](_0x1bda49[_0xfad9('0x9d')](),_0x2f0f44);})[_0xfad9('0x2f')](function(_0x3ce535){if(_0x3ce535['length']>0x0)_0x4cc798[_0xfad9('0x50')](_0xfad9('0xb5'),_[_0xfad9('0x34')](_0x3ce535,'id'));return db[_0xfad9('0x9c')][_0xfad9('0x47')](_0x4cc798['toString'](),_0x2f0f44)[_0xfad9('0x2f')](function(_0x30789d){var _0x195edd=_[_0xfad9('0xb6')](_0x30789d,'WhatsappInteractionId');var _0x28772f=[];_0x3ce535[_0xfad9('0x38')](function(_0x37e9f9){_0x28772f[_0xfad9('0x39')](updateWhatsappInteraction(_0x37e9f9,_0x3a0bf3,_0x195edd));});return BPromise['all'](_0x28772f);});});})['then'](function(_0x40da74){_0x1906f7[_0xfad9('0xb7')]=_0x40da74;return _0x1906f7;})[_0xfad9('0x2f')](respondWithFilteredResult(_0x25ab83,_0x5bb3a6))['catch'](handleError(_0x25ab83,null));};exports[_0xfad9('0xb8')]=function(_0x4709a3,_0x56b1ab){var _0x20524d={'raw':![],'where':{'id':_0x4709a3[_0xfad9('0xb9')]['id']}},_0x5e8ac2={};_0x5e8ac2[_0xfad9('0x4a')]=_[_0xfad9('0x48')](db['WhatsappInteraction'][_0xfad9('0x43')]);_0x5e8ac2[_0xfad9('0x47')]=_[_0xfad9('0x48')](_0x4709a3[_0xfad9('0x47')]);_0x5e8ac2[_0xfad9('0x49')]=_[_0xfad9('0x4b')](_0x5e8ac2['model'],_0x5e8ac2[_0xfad9('0x47')]);_0x20524d['attributes']=_[_0xfad9('0x4b')](_0x5e8ac2[_0xfad9('0x4a')],qs['fields'](_0x4709a3['query'][_0xfad9('0xa0')]));_0x20524d[_0xfad9('0x4c')]=_0x20524d['attributes'][_0xfad9('0x66')]?_0x20524d[_0xfad9('0x4c')]:_0x5e8ac2[_0xfad9('0x4a')];if(_0x4709a3[_0xfad9('0x47')]['includeAll']){_0x20524d['include']=[{'all':!![]}];}_0x20524d=_[_0xfad9('0x9f')]({},_0x20524d,_0x4709a3['options']);return db['WhatsappInteraction'][_0xfad9('0x67')](_0x20524d)[_0xfad9('0x2f')](handleEntityNotFound(_0x56b1ab,null))['then'](respondWithResult(_0x56b1ab,null))[_0xfad9('0x3a')](handleError(_0x56b1ab,null));};exports[_0xfad9('0xba')]=function(_0x1711cb,_0x4efe22){return db[_0xfad9('0x42')]['create'](_0x1711cb['body'],{})[_0xfad9('0x2f')](respondWithResult(_0x4efe22,0xc9))[_0xfad9('0x3a')](handleError(_0x4efe22,null));};exports[_0xfad9('0x2e')]=function(_0x36f2f4,_0x2b29df){if(_0x36f2f4[_0xfad9('0xbb')]['id']){delete _0x36f2f4[_0xfad9('0xbb')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x36f2f4['params']['id']}})[_0xfad9('0x2f')](handleEntityNotFound(_0x2b29df,null))[_0xfad9('0x2f')](saveUpdates(_0x36f2f4[_0xfad9('0xbb')],null))[_0xfad9('0x2f')](respondWithResult(_0x2b29df,null))['catch'](handleError(_0x2b29df,null));};exports[_0xfad9('0x30')]=function(_0x46de08,_0x47d644){return db['WhatsappInteraction']['find']({'where':{'id':_0x46de08['params']['id']}})[_0xfad9('0x2f')](handleEntityNotFound(_0x47d644,null))[_0xfad9('0x2f')](removeEntity(_0x47d644,null))[_0xfad9('0x3a')](handleError(_0x47d644,null));};exports['describe']=function(_0x5b28d6,_0x415ced){return db[_0xfad9('0x42')]['describe']()[_0xfad9('0x2f')](respondWithResult(_0x415ced,null))['catch'](handleError(_0x415ced,null));};exports[_0xfad9('0xbc')]=function(_0x1ce358,_0x2a70dc,_0x379be8){return db[_0xfad9('0xbd')][_0xfad9('0x67')]({'where':{'id':_0x1ce358[_0xfad9('0xb9')]['id']}})[_0xfad9('0x2f')](handleEntityNotFound(_0x2a70dc,null))[_0xfad9('0x2f')](function(_0x5a3ec4){if(_0x5a3ec4){return _0x5a3ec4[_0xfad9('0xbc')](_0x1ce358[_0xfad9('0xbb')][_0xfad9('0xbe')],_[_0xfad9('0xbf')](_0x1ce358[_0xfad9('0xbb')],[_0xfad9('0xbe'),'id'])||{});}})[_0xfad9('0x2f')](respondWithResult(_0x2a70dc,null))[_0xfad9('0x3a')](handleError(_0x2a70dc,null));};exports[_0xfad9('0xc0')]=function(_0x3b12cb,_0x4928c9,_0x55b9dc){var _0x2b8607={'raw':![],'where':{}};var _0x37819b={};var _0x71b7ea={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xfad9('0xc1')]({'where':{'id':_0x3b12cb['params']['id']}})[_0xfad9('0x2f')](handleEntityNotFound(_0x4928c9,null))[_0xfad9('0x2f')](function(_0x125e5e){if(_0x125e5e){_0x37819b['model']=_[_0xfad9('0x48')](db[_0xfad9('0xbd')][_0xfad9('0x43')]);_0x37819b[_0xfad9('0x47')]=_['keys'](_0x3b12cb['query']);_0x37819b['filters']=_[_0xfad9('0x4b')](_0x37819b[_0xfad9('0x4a')],_0x37819b[_0xfad9('0x47')]);_0x2b8607['attributes']=_[_0xfad9('0x4b')](_0x37819b['model'],qs['fields'](_0x3b12cb[_0xfad9('0x47')]['fields']));_0x2b8607[_0xfad9('0x4c')]=_0x2b8607[_0xfad9('0x4c')][_0xfad9('0x66')]?_0x2b8607[_0xfad9('0x4c')]:_0x37819b[_0xfad9('0x4a')];if(!_0x3b12cb[_0xfad9('0x47')]['hasOwnProperty'](_0xfad9('0x4d'))){_0x2b8607['limit']=qs[_0xfad9('0x25')](_0x3b12cb[_0xfad9('0x47')][_0xfad9('0x25')]);_0x2b8607[_0xfad9('0x23')]=qs['offset'](_0x3b12cb[_0xfad9('0x47')][_0xfad9('0x23')]);}_0x2b8607[_0xfad9('0x4e')]=qs[_0xfad9('0x4f')](_0x3b12cb[_0xfad9('0x47')]['sort']);_0x2b8607[_0xfad9('0x50')]=qs[_0xfad9('0x49')](_[_0xfad9('0xc2')](_0x3b12cb[_0xfad9('0x47')],_0x37819b['filters']));_0x2b8607[_0xfad9('0x50')][_0xfad9('0xc3')]=_0x125e5e['id'];if(_0x3b12cb[_0xfad9('0x47')][_0xfad9('0x89')]){_0x2b8607[_0xfad9('0x50')]=_[_0xfad9('0x9f')](_0x2b8607[_0xfad9('0x50')],{'$or':_['map'](_0x2b8607[_0xfad9('0x4c')],function(_0x2391e4){var _0xf77a27={};_0xf77a27[_0x2391e4]={'$like':'%'+_0x3b12cb['query'][_0xfad9('0x89')]+'%'};return _0xf77a27;})});}if(_0x3b12cb[_0xfad9('0x47')]['$gte']){var _0x4378b8=_0x3b12cb[_0xfad9('0x47')]['$gte'][_0xfad9('0x6e')](',');var _0x3fd6b6={};_0x3fd6b6[_0x4378b8[0x0]]={'$gte':moment(_0x4378b8[0x1])[_0xfad9('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2b8607['where']=_[_0xfad9('0x9f')](_0x2b8607['where'],_0x3fd6b6);}_0x2b8607=_[_0xfad9('0x9f')]({},_0x2b8607,_0x3b12cb['options']);return db['WhatsappMessage'][_0xfad9('0x26')]({'where':_0x2b8607['where']})[_0xfad9('0x2f')](function(_0x486f1a){_0x71b7ea[_0xfad9('0x26')]=_0x486f1a;if(_0x3b12cb[_0xfad9('0x47')][_0xfad9('0xc5')]){_0x2b8607['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xfad9('0xc6')](_0x2b8607);})[_0xfad9('0x2f')](function(_0x9b76c3){_0x71b7ea['rows']=_0x9b76c3;return _0x71b7ea;});}})[_0xfad9('0x2f')](respondWithFilteredResult(_0x4928c9,_0x2b8607))['catch'](handleError(_0x4928c9,null));};exports[_0xfad9('0xc7')]=function(_0x21c00c,_0x332b63,_0x51c072){return db[_0xfad9('0x42')][_0xfad9('0x67')]({'where':{'id':_0x21c00c[_0xfad9('0xb9')]['id']}})['then'](handleEntityNotFound(_0x332b63,null))['then'](function(_0x15897a){if(_0x15897a){return _0x15897a[_0xfad9('0xc8')](_0x21c00c[_0xfad9('0xbb')]['ids'],_[_0xfad9('0xbf')](_0x21c00c[_0xfad9('0xbb')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xfad9('0x32'),_0xfad9('0xc9')],'where':{'id':_0x21c00c[_0xfad9('0xbb')][_0xfad9('0xbe')]}});})[_0xfad9('0x2f')](function(_0x2ec5a9){socket[_0xfad9('0xca')](_0xfad9('0xcb'),{'id':Number(_0x21c00c[_0xfad9('0xb9')]['id']),'tags':_0x2ec5a9||[]});return{'id':Number(_0x21c00c[_0xfad9('0xb9')]['id']),'tags':_0x2ec5a9||[]};});}})[_0xfad9('0x2f')](respondWithResult(_0x332b63,null))[_0xfad9('0x3a')](handleError(_0x332b63,null));};exports[_0xfad9('0xcc')]=function(_0x232f15,_0xcdab9f,_0x23e82b){return db[_0xfad9('0x42')][_0xfad9('0x67')]({'where':{'id':_0x232f15[_0xfad9('0xb9')]['id']}})[_0xfad9('0x2f')](handleEntityNotFound(_0xcdab9f,null))[_0xfad9('0x2f')](function(_0x56aa5a){if(_0x56aa5a){return _0x56aa5a[_0xfad9('0xcc')](_0x232f15[_0xfad9('0x47')]['ids']);}})[_0xfad9('0x2f')](respondWithStatusCode(_0xcdab9f,null))[_0xfad9('0x3a')](handleError(_0xcdab9f,null));};exports[_0xfad9('0xcd')]=function(_0x53c86a,_0x19365a){var _0xf892db=moment()[_0xfad9('0xce')]()['toString']();var _0x48b0c7=path[_0xfad9('0xcf')](config['root'],_0xfad9('0xd0'),_0xfad9('0xd1'),_0xfad9('0xd2'));var _0x3c463c=path['join'](config['root'],_0xfad9('0xd0'),_0xfad9('0xd1'),'attachments');var _0x2c3f78=path[_0xfad9('0xcf')](_0x48b0c7,_0xf892db);var _0x43ed3c=util[_0xfad9('0xc4')](_0xfad9('0xd3'),_0x53c86a[_0xfad9('0xb9')]['id'],_0xf892db);var _0x433cbb=path['join'](_0x48b0c7,_0x43ed3c);var _0x4f41a2=[];_0x4f41a2[_0xfad9('0x39')]({'model':db[_0xfad9('0x78')],'as':_0xfad9('0x78'),'attributes':['id',_0xfad9('0x35')],'raw':!![]});_0x4f41a2[_0xfad9('0x39')]({'model':db[_0xfad9('0xd4')],'as':_0xfad9('0x6b'),'attributes':['id',_0xfad9('0xd5'),_0xfad9('0xd6')],'raw':!![]});if(_0x53c86a['query'][_0xfad9('0xd7')]){_0x4f41a2[_0xfad9('0x39')]({'model':db['Attachment'],'as':_0xfad9('0xd8'),'raw':!![]});}var _0x5f0619=[{'model':db['WhatsappMessage'],'as':_0xfad9('0xd9'),'attributes':['id','body','createdAt',_0xfad9('0xda'),_0xfad9('0xdb'),'read'],'include':_0x4f41a2}];_0x5f0619[_0xfad9('0x39')]({'model':db[_0xfad9('0xdc')],'as':_0xfad9('0xdd'),'attributes':['id',_0xfad9('0x32')]});_0x5f0619[_0xfad9('0x39')]({'model':db['User'],'as':_0xfad9('0xde'),'attributes':['id',_0xfad9('0x35')]});return db[_0xfad9('0x42')][_0xfad9('0x67')]({'where':{'id':_0x53c86a[_0xfad9('0xb9')]['id']},'include':_0x5f0619})['then'](handleEntityNotFound(_0x19365a,null))['then'](function(_0x4301f2){if(_0x4301f2){var _0x3ebac4=_0x4301f2['get']({'plain':!![]});fs[_0xfad9('0xdf')](_0x2c3f78);var _0x506f8b={'channel':_0xfad9('0xe0'),'account':_0x3ebac4['Account'][_0xfad9('0x32')],'agent':_0x3ebac4[_0xfad9('0xde')]?_0x3ebac4[_0xfad9('0xde')][_0xfad9('0x35')]:'N.A.','createdAt':moment(_0x3ebac4['createdAt'])[_0xfad9('0xc4')](_0xfad9('0xe1'))[_0xfad9('0x9d')](),'closedAt':_0x3ebac4[_0xfad9('0x3f')]?moment(_0x3ebac4[_0xfad9('0xe2')])['format'](_0xfad9('0xe1'))['toString']():'','disposition':_0x3ebac4[_0xfad9('0xe3')],'messages':_(_0x3ebac4[_0xfad9('0xd9')])[_0xfad9('0x89')]({'secret':![]})[_0xfad9('0x34')](function(_0x5ed45e){if(_0x5ed45e['Attachment']){var _0x552945=path[_0xfad9('0xcf')](_0x3c463c,_0x5ed45e['Attachment']['basename']);if(fs[_0xfad9('0xe4')](_0x552945)){fs[_0xfad9('0xe5')](_0x552945)['pipe'](fs[_0xfad9('0xe6')](path[_0xfad9('0xcf')](_0x2c3f78,_0x5ed45e[_0xfad9('0xd8')][_0xfad9('0xe7')])));}}return{'date':moment(_0x5ed45e[_0xfad9('0x7d')])[_0xfad9('0xc4')](_0xfad9('0xe1'))[_0xfad9('0x9d')](),'sender':_0x5ed45e['direction']==='out'?_0x5ed45e[_0xfad9('0x78')]?_0x5ed45e[_0xfad9('0x78')][_0xfad9('0x35')]:'System':_0x5ed45e[_0xfad9('0x6b')][_0xfad9('0xd5')]+(_0x5ed45e[_0xfad9('0x6b')][_0xfad9('0xd6')]?'\x20'+_0x5ed45e[_0xfad9('0x6b')][_0xfad9('0xd6')]:''),'body':_0x5ed45e[_0xfad9('0xd8')]?_0x5ed45e[_0xfad9('0xd8')][_0xfad9('0xe7')]:_0x5ed45e['body'],'direction':_0x5ed45e[_0xfad9('0xda')]==='out'?'A':'C','secret':_0x5ed45e['secret'],'read':_0x5ed45e[_0xfad9('0x83')],'attachment':_0x5ed45e['Attachment']};})[_0xfad9('0x69')]()};return ejs[_0xfad9('0xe8')](path['join'](config[_0xfad9('0xe9')],_0xfad9('0xd0'),'views','downloadInteraction.ejs'),{'interaction':_0x506f8b})[_0xfad9('0x2f')](function(_0x3e6d8e){var _0x225bef=path[_0xfad9('0xcf')](_0x2c3f78,_0xfad9('0xea')+_0x3ebac4['id']+'-'+_0xf892db+'.pdf');var _0xf929ca={'path':_0x225bef,'channel':'Whatsapp','interactionId':_0x3ebac4['id']};return pdf['createPdfFromHTML'](_0x3e6d8e,_0xf929ca);})['then'](function(){return new BPromise(function(_0x8f5a5c,_0x4cefb3){zipdir(_0x2c3f78,{'saveTo':_0x433cbb},function(_0x2df542,_0x292e8a){if(_0x2df542)return _0x4cefb3(_0x2df542);return _0x8f5a5c(_0x292e8a);});})[_0xfad9('0x2f')](function(){return new BPromise(function(_0x240300,_0x5b3581){rimraf(_0x2c3f78,function(_0xc9c93d){if(_0xc9c93d)_0x5b3581(_0xc9c93d);return _0x240300();});});})[_0xfad9('0x2f')](function(){return _0x19365a[_0xfad9('0xcd')](_0x433cbb,_0x43ed3c,function(_0x4a5919){if(_0x4a5919){console[_0xfad9('0xeb')](_0xfad9('0xec'),_0x4a5919);}else{fs['unlinkSync'](_0x433cbb);}});});});}else{return _0x19365a[_0xfad9('0x21')](0xc8);}})[_0xfad9('0x3a')](handleError(_0x19365a,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index cf3c6c4..71ea004 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 _0x93e7=['then','setDataValue','Users','map','findAll','unreadMessages','catch','exports','events','WhatsappInteraction','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x43058b,_0x429ef9){var _0x2c338c=function(_0x4d50bd){while(--_0x4d50bd){_0x43058b['push'](_0x43058b['shift']());}};_0x2c338c(++_0x429ef9);}(_0x93e7,0x9e));var _0x793e=function(_0x324d02,_0x6d9c0b){_0x324d02=_0x324d02-0x0;var _0x3d4f59=_0x93e7[_0x324d02];return _0x3d4f59;};'use strict';var EventEmitter=require(_0x793e('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x793e('0x1')];var WhatsappMessage=require(_0x793e('0x2'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x793e('0x3')](0x0);var events={'afterCreate':_0x793e('0x4'),'afterUpdate':_0x793e('0x5'),'afterDestroy':_0x793e('0x6')};function emitEvent(_0x59e54c){return function(_0x3d8d73,_0x5d45be,_0x336ce8){_0x3d8d73['getUsers']({'attributes':['id'],'raw':!![]})[_0x793e('0x7')](function(_0x4ca5ad){_0x3d8d73[_0x793e('0x8')](_0x793e('0x9'),_0x4ca5ad[_0x793e('0xa')](function(_0xec60cc){return{'id':_0xec60cc['id']};}));return WhatsappMessage[_0x793e('0xb')]({'where':{'WhatsappInteractionId':_0x3d8d73['id'],'direction':'in','read':![]},'raw':!![]});})[_0x793e('0x7')](function(_0x42b157){_0x3d8d73[_0x793e('0x8')](_0x793e('0xc'),_0x42b157['length']);WhatsappInteractionEvents['emit'](_0x59e54c+':'+_0x3d8d73['id'],_0x3d8d73);WhatsappInteractionEvents['emit'](_0x59e54c,_0x3d8d73);_0x336ce8(null);})[_0x793e('0xd')](_0x336ce8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x793e('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xad95=['events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports'];(function(_0x5ddff2,_0x1fdabb){var _0x17dd70=function(_0x434af7){while(--_0x434af7){_0x5ddff2['push'](_0x5ddff2['shift']());}};_0x17dd70(++_0x1fdabb);}(_0xad95,0x70));var _0x5ad9=function(_0x5f5260,_0x23ee4b){_0x5f5260=_0x5f5260-0x0;var _0x21ea20=_0xad95[_0x5f5260];return _0x21ea20;};'use strict';var EventEmitter=require(_0x5ad9('0x0'));var WhatsappInteraction=require(_0x5ad9('0x1'))['db'][_0x5ad9('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5ad9('0x3')](0x0);var events={'afterCreate':_0x5ad9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x185bff){return function(_0x5277fa,_0x4ccfdf,_0x5e4279){_0x5277fa['getUsers']({'attributes':['id'],'raw':!![]})[_0x5ad9('0x5')](function(_0x117fde){_0x5277fa[_0x5ad9('0x6')](_0x5ad9('0x7'),_0x117fde[_0x5ad9('0x8')](function(_0x550a0e){return{'id':_0x550a0e['id']};}));return WhatsappMessage[_0x5ad9('0x9')]({'where':{'WhatsappInteractionId':_0x5277fa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4c5c21){_0x5277fa[_0x5ad9('0x6')](_0x5ad9('0xa'),_0x4c5c21[_0x5ad9('0xb')]);WhatsappInteractionEvents['emit'](_0x185bff+':'+_0x5277fa['id'],_0x5277fa);WhatsappInteractionEvents[_0x5ad9('0xc')](_0x185bff,_0x5277fa);_0x5e4279(null);})[_0x5ad9('0xd')](_0x5e4279(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x5ad9('0xe')](e,emitEvent(event));}}module[_0x5ad9('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 5b5593a..d6d662a 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 _0x6427=['moment','path','rimraf','./whatsappInteraction.attributes','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x57663b,_0x333165){var _0x1323d1=function(_0x307b4c){while(--_0x307b4c){_0x57663b['push'](_0x57663b['shift']());}};_0x1323d1(++_0x333165);}(_0x6427,0x191));var _0x7642=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x6427[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7642('0x0'));var util=require(_0x7642('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7642('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7642('0x3'));var rimraf=require(_0x7642('0x4'));var config=require('../../config/environment');var attributes=require(_0x7642('0x5'));module[_0x7642('0x6')]=function(_0x541e3c,_0x404548){return _0x541e3c[_0x7642('0x7')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16ce6b,_0x3ac889,_0x38891b){if(_0x16ce6b[_0x7642('0x8')](_0x7642('0x9'))){_0x16ce6b[_0x7642('0xa')]=moment()[_0x7642('0xb')](_0x7642('0xc'));}_0x38891b(null,_0x16ce6b);}}});}; \ No newline at end of file +var _0x1bff=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x5b17cd,_0xeb0b49){var _0x50b2cb=function(_0x566321){while(--_0x566321){_0x5b17cd['push'](_0x5b17cd['shift']());}};_0x50b2cb(++_0xeb0b49);}(_0x1bff,0x128));var _0xf1bf=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x1bff[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0xf1bf('0x0'));var util=require(_0xf1bf('0x1'));var logger=require('../../config/logger')(_0xf1bf('0x2'));var moment=require(_0xf1bf('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1bf('0x4'));var fs=require('fs');var path=require(_0xf1bf('0x5'));var rimraf=require(_0xf1bf('0x6'));var config=require(_0xf1bf('0x7'));var attributes=require(_0xf1bf('0x8'));module[_0xf1bf('0x9')]=function(_0x51e673,_0x231376){return _0x51e673['define'](_0xf1bf('0xa'),attributes,{'tableName':_0xf1bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17c458,_0x115f61,_0x198cdf){if(_0x17c458[_0xf1bf('0xc')](_0xf1bf('0xd'))){_0x17c458[_0xf1bf('0xe')]=moment()[_0xf1bf('0xf')](_0xf1bf('0x10'));}_0x198cdf(null,_0x17c458);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 53d3bfc..fc3b285 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 _0x8b29=['defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','update','body','options','raw','where','attributes','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','omit','AddTags','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4af6a0,_0x522121){var _0x4c2b23=function(_0x2f5955){while(--_0x2f5955){_0x4af6a0['push'](_0x4af6a0['shift']());}};_0x4c2b23(++_0x522121);}(_0x8b29,0x143));var _0x98b2=function(_0x1ec445,_0x11b1d7){_0x1ec445=_0x1ec445-0x0;var _0x435c5b=_0x8b29[_0x1ec445];return _0x435c5b;};'use strict';var _=require('lodash');var util=require(_0x98b2('0x0'));var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98b2('0x3'));var db=require(_0x98b2('0x4'))['db'];var utils=require(_0x98b2('0x5'));var logger=require(_0x98b2('0x6'))(_0x98b2('0x7'));var config=require(_0x98b2('0x8'));var jayson=require(_0x98b2('0x9'));var client=jayson[_0x98b2('0xa')][_0x98b2('0xb')]({'port':0x232a});config[_0x98b2('0xc')]=_[_0x98b2('0xd')](config[_0x98b2('0xc')],{'host':_0x98b2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x98b2('0xf'))[_0x98b2('0x10')](socket);function respondWithRpcPromise(_0x3c9850,_0x1846ea,_0x2f4697){return new BPromise(function(_0x5689dd,_0x5115a3){return client[_0x98b2('0x11')](_0x3c9850,_0x2f4697)[_0x98b2('0x12')](function(_0x351104){logger[_0x98b2('0x13')](_0x98b2('0x14'),_0x1846ea,_0x98b2('0x15'));logger[_0x98b2('0x16')](_0x98b2('0x17'),_0x1846ea,_0x98b2('0x15'),JSON['stringify'](_0x351104));if(_0x351104[_0x98b2('0x18')]){if(_0x351104[_0x98b2('0x18')][_0x98b2('0x19')]===0x1f4){logger[_0x98b2('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x1846ea,_0x351104['error'][_0x98b2('0x1a')]);return _0x5115a3(_0x351104[_0x98b2('0x18')][_0x98b2('0x1a')]);}logger[_0x98b2('0x18')](_0x98b2('0x14'),_0x1846ea,_0x351104[_0x98b2('0x18')][_0x98b2('0x1a')]);return _0x5689dd(_0x351104['error'][_0x98b2('0x1a')]);}else{logger[_0x98b2('0x13')](_0x98b2('0x14'),_0x1846ea,_0x98b2('0x15'));_0x5689dd(_0x351104['result'][_0x98b2('0x1a')]);}})[_0x98b2('0x1b')](function(_0x2957da){logger['error'](_0x98b2('0x14'),_0x1846ea,_0x2957da);_0x5115a3(_0x2957da);});});}exports['UpdateWhatsappInteraction']=function(_0x166d38){var _0x1fa4ba=this;return new Promise(function(_0x11ae53,_0x5b9352){return db['WhatsappInteraction'][_0x98b2('0x1c')](_0x166d38[_0x98b2('0x1d')],{'raw':_0x166d38['options']?_0x166d38[_0x98b2('0x1e')][_0x98b2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x166d38['options']?_0x166d38[_0x98b2('0x1e')][_0x98b2('0x20')]||null:null,'attributes':_0x166d38[_0x98b2('0x1e')]?_0x166d38[_0x98b2('0x1e')][_0x98b2('0x21')]||null:null,'limit':_0x166d38[_0x98b2('0x1e')]?_0x166d38[_0x98b2('0x1e')]['limit']||null:null})[_0x98b2('0x12')](function(_0x139bfa){logger['info'](_0x98b2('0x22'),_0x166d38);logger[_0x98b2('0x16')](_0x98b2('0x22'),_0x166d38,JSON['stringify'](_0x139bfa));_0x11ae53(_0x139bfa);})[_0x98b2('0x1b')](function(_0x53d3c8){logger[_0x98b2('0x18')](_0x98b2('0x22'),_0x53d3c8[_0x98b2('0x1a')],_0x166d38);_0x5b9352(_0x1fa4ba['error'](0x1f4,_0x53d3c8[_0x98b2('0x1a')]));});});};exports[_0x98b2('0x23')]=function(_0x2bb98c){return new Promise(function(_0x85cb76,_0x2cf166){return db[_0x98b2('0x24')]['find']({'where':_0x2bb98c[_0x98b2('0x1e')]?_0x2bb98c[_0x98b2('0x1e')][_0x98b2('0x20')]||null:null})['then'](function(_0x2b86a3){if(_0x2b86a3){return _0x2b86a3[_0x98b2('0x25')](_0x2bb98c[_0x98b2('0x1d')][_0x98b2('0x26')],_[_0x98b2('0x27')](_0x2bb98c[_0x98b2('0x1d')],[_0x98b2('0x26'),'id'])||{});}})['spread'](function(_0x1dfdb3){logger[_0x98b2('0x13')](_0x98b2('0x28'),_0x2bb98c);logger['debug']('AddTags',_0x2bb98c,JSON[_0x98b2('0x29')](_0x1dfdb3));_0x85cb76(_0x1dfdb3);})['catch'](function(_0xd93155){logger[_0x98b2('0x18')](_0x98b2('0x28'),_0xd93155['message'],_0x2bb98c);_0x2cf166(_this[_0x98b2('0x18')](0x1f4,_0xd93155[_0x98b2('0x1a')]));});});}; \ No newline at end of file +var _0xa8b2=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash'];(function(_0x59f998,_0x17a709){var _0x54e43a=function(_0x5544dd){while(--_0x5544dd){_0x59f998['push'](_0x59f998['shift']());}};_0x54e43a(++_0x17a709);}(_0xa8b2,0x107));var _0x2a8b=function(_0x46d552,_0x28cd19){_0x46d552=_0x46d552-0x0;var _0x4ff397=_0xa8b2[_0x46d552];return _0x4ff397;};'use strict';var _=require(_0x2a8b('0x0'));var util=require(_0x2a8b('0x1'));var moment=require(_0x2a8b('0x2'));var BPromise=require(_0x2a8b('0x3'));var rs=require(_0x2a8b('0x4'));var fs=require('fs');var Redis=require(_0x2a8b('0x5'));var db=require(_0x2a8b('0x6'))['db'];var utils=require(_0x2a8b('0x7'));var logger=require(_0x2a8b('0x8'))(_0x2a8b('0x9'));var config=require(_0x2a8b('0xa'));var jayson=require(_0x2a8b('0xb'));var client=jayson[_0x2a8b('0xc')]['http']({'port':0x232a});config[_0x2a8b('0xd')]=_['defaults'](config[_0x2a8b('0xd')],{'host':_0x2a8b('0xe'),'port':0x18eb});var socket=require(_0x2a8b('0xf'))(new Redis(config[_0x2a8b('0xd')]));require(_0x2a8b('0x10'))[_0x2a8b('0x11')](socket);function respondWithRpcPromise(_0x5a7e9a,_0x18793c,_0x414ce2){return new BPromise(function(_0x45d6db,_0x1ab87a){return client[_0x2a8b('0x12')](_0x5a7e9a,_0x414ce2)[_0x2a8b('0x13')](function(_0x57213d){logger[_0x2a8b('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x18793c,'request\x20sent');logger[_0x2a8b('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x18793c,_0x2a8b('0x16'),JSON[_0x2a8b('0x17')](_0x57213d));if(_0x57213d['error']){if(_0x57213d[_0x2a8b('0x18')][_0x2a8b('0x19')]===0x1f4){logger['error'](_0x2a8b('0x1a'),_0x18793c,_0x57213d[_0x2a8b('0x18')][_0x2a8b('0x1b')]);return _0x1ab87a(_0x57213d[_0x2a8b('0x18')][_0x2a8b('0x1b')]);}logger[_0x2a8b('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x18793c,_0x57213d[_0x2a8b('0x18')][_0x2a8b('0x1b')]);return _0x45d6db(_0x57213d[_0x2a8b('0x18')][_0x2a8b('0x1b')]);}else{logger[_0x2a8b('0x14')](_0x2a8b('0x1a'),_0x18793c,_0x2a8b('0x16'));_0x45d6db(_0x57213d[_0x2a8b('0x1c')][_0x2a8b('0x1b')]);}})[_0x2a8b('0x1d')](function(_0x2b3881){logger[_0x2a8b('0x18')](_0x2a8b('0x1a'),_0x18793c,_0x2b3881);_0x1ab87a(_0x2b3881);});});}exports[_0x2a8b('0x1e')]=function(_0x59b92b){var _0x14aca8=this;return new Promise(function(_0x99dd46,_0x191b8b){return db['WhatsappInteraction'][_0x2a8b('0x1f')](_0x59b92b[_0x2a8b('0x20')],{'raw':_0x59b92b[_0x2a8b('0x21')]?_0x59b92b[_0x2a8b('0x21')][_0x2a8b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b92b[_0x2a8b('0x21')]?_0x59b92b[_0x2a8b('0x21')][_0x2a8b('0x23')]||null:null,'attributes':_0x59b92b[_0x2a8b('0x21')]?_0x59b92b[_0x2a8b('0x21')][_0x2a8b('0x24')]||null:null,'limit':_0x59b92b[_0x2a8b('0x21')]?_0x59b92b[_0x2a8b('0x21')][_0x2a8b('0x25')]||null:null})['then'](function(_0x4bd1b0){logger[_0x2a8b('0x14')](_0x2a8b('0x1e'),_0x59b92b);logger[_0x2a8b('0x15')]('UpdateWhatsappInteraction',_0x59b92b,JSON['stringify'](_0x4bd1b0));_0x99dd46(_0x4bd1b0);})['catch'](function(_0x3048e0){logger[_0x2a8b('0x18')]('UpdateWhatsappInteraction',_0x3048e0[_0x2a8b('0x1b')],_0x59b92b);_0x191b8b(_0x14aca8[_0x2a8b('0x18')](0x1f4,_0x3048e0[_0x2a8b('0x1b')]));});});};exports[_0x2a8b('0x26')]=function(_0x3cbe44){return new Promise(function(_0x1e0a01,_0x2a7586){return db['WhatsappInteraction'][_0x2a8b('0x27')]({'where':_0x3cbe44[_0x2a8b('0x21')]?_0x3cbe44[_0x2a8b('0x21')]['where']||null:null})[_0x2a8b('0x13')](function(_0x37f4c9){if(_0x37f4c9){return _0x37f4c9[_0x2a8b('0x28')](_0x3cbe44[_0x2a8b('0x20')]['ids'],_['omit'](_0x3cbe44[_0x2a8b('0x20')],[_0x2a8b('0x29'),'id'])||{});}})[_0x2a8b('0x2a')](function(_0x3fb616){logger[_0x2a8b('0x14')](_0x2a8b('0x2b'),_0x3cbe44);logger[_0x2a8b('0x15')](_0x2a8b('0x2b'),_0x3cbe44,JSON[_0x2a8b('0x17')](_0x3fb616));_0x1e0a01(_0x3fb616);})[_0x2a8b('0x1d')](function(_0x47d0d4){logger['error'](_0x2a8b('0x2b'),_0x47d0d4[_0x2a8b('0x1b')],_0x3cbe44);_0x2a7586(_this[_0x2a8b('0x18')](0x1f4,_0x47d0d4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 44d34b3..cfe1e7c 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 _0x8082=['remove','update','emit','register','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0x8082,0xde));var _0x2808=function(_0x5c1865,_0x1e7935){_0x5c1865=_0x5c1865-0x0;var _0x537362=_0x8082[_0x5c1865];return _0x537362;};'use strict';var WhatsappInteractionEvents=require(_0x2808('0x0'));var events=[_0x2808('0x1'),_0x2808('0x2'),_0x2808('0x3')];function createListener(_0x2a541b,_0xb324a2){return function(_0x54b6e2){_0xb324a2[_0x2808('0x4')](_0x2a541b,_0x54b6e2);};}function removeListener(_0x54d267,_0x4b9bb8){return function(){WhatsappInteractionEvents['removeListener'](_0x54d267,_0x4b9bb8);};}exports[_0x2808('0x5')]=function(_0x42f1e8){for(var _0x54e55b=0x0,_0x309f38=events['length'];_0x54e55b<_0x309f38;_0x54e55b++){var _0x50982f=events[_0x54e55b];var _0x577303=createListener(_0x2808('0x6')+_0x50982f,_0x42f1e8);WhatsappInteractionEvents['on'](_0x50982f,_0x577303);}}; \ No newline at end of file +var _0x0b0e=['remove','update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x3af635,_0x48bd07){var _0x3396ae=function(_0x38f736){while(--_0x38f736){_0x3af635['push'](_0x3af635['shift']());}};_0x3396ae(++_0x48bd07);}(_0x0b0e,0x136));var _0xe0b0=function(_0x18c4a8,_0x96c52e){_0x18c4a8=_0x18c4a8-0x0;var _0x189ff1=_0x0b0e[_0x18c4a8];return _0x189ff1;};'use strict';var WhatsappInteractionEvents=require(_0xe0b0('0x0'));var events=[_0xe0b0('0x1'),_0xe0b0('0x2'),_0xe0b0('0x3')];function createListener(_0x38d5ff,_0x1824f2){return function(_0x567558){_0x1824f2[_0xe0b0('0x4')](_0x38d5ff,_0x567558);};}function removeListener(_0x102132,_0x498602){return function(){WhatsappInteractionEvents[_0xe0b0('0x5')](_0x102132,_0x498602);};}exports[_0xe0b0('0x6')]=function(_0x82a3cf){for(var _0x4461e7=0x0,_0x12adaf=events['length'];_0x4461e7<_0x12adaf;_0x4461e7++){var _0x5b9ed8=events[_0x4461e7];var _0x53889a=createListener(_0xe0b0('0x7')+_0x5b9ed8,_0x82a3cf);WhatsappInteractionEvents['on'](_0x5b9ed8,_0x53889a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 7cccbeb..8a048aa 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 _0xe95c=['../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','update','/:id/accept','put','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x424d26,_0x52ea8b){var _0x36037b=function(_0x136950){while(--_0x136950){_0x424d26['push'](_0x424d26['shift']());}};_0x36037b(++_0x52ea8b);}(_0xe95c,0x1c9));var _0xce95=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xe95c[_0xe73080];return _0x12cbc4;};'use strict';var multer=require(_0xce95('0x0'));var util=require(_0xce95('0x1'));var path=require(_0xce95('0x2'));var timeout=require(_0xce95('0x3'));var express=require('express');var router=express[_0xce95('0x4')]();var fs_extra=require(_0xce95('0x5'));var auth=require(_0xce95('0x6'));var interaction=require(_0xce95('0x7'));var config=require(_0xce95('0x8'));var controller=require(_0xce95('0x9'));router[_0xce95('0xa')]('/',auth[_0xce95('0xb')](),controller[_0xce95('0xc')]);router[_0xce95('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xce95('0xd')]);router[_0xce95('0xa')](_0xce95('0xe'),auth[_0xce95('0xb')](),controller[_0xce95('0xf')]);router[_0xce95('0x10')]('/',auth['isAuthenticated'](),interaction[_0xce95('0x11')](_0xce95('0x12'),_0xce95('0x13')),controller['create']);router[_0xce95('0x10')](_0xce95('0x14'),controller[_0xce95('0x15')]);router['put'](_0xce95('0xe'),auth['isAuthenticated'](),controller[_0xce95('0x16')]);router['put'](_0xce95('0x17'),auth[_0xce95('0xb')](),controller['accept']);router[_0xce95('0x18')](_0xce95('0x19'),auth[_0xce95('0xb')](),controller[_0xce95('0x1a')]);router['delete']('/:id',auth[_0xce95('0xb')](),controller[_0xce95('0x1b')]);module[_0xce95('0x1c')]=router; \ No newline at end of file +var _0xfb31=['/:id','update','accept','/:id/reject','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','isAuthenticated','get','describe','show','post','tracked','create','status','put'];(function(_0x12cbf6,_0x28c58a){var _0x21ae4e=function(_0x2b3057){while(--_0x2b3057){_0x12cbf6['push'](_0x12cbf6['shift']());}};_0x21ae4e(++_0x28c58a);}(_0xfb31,0x125));var _0x1fb3=function(_0x35be25,_0x177893){_0x35be25=_0x35be25-0x0;var _0x5b6c4c=_0xfb31[_0x35be25];return _0x5b6c4c;};'use strict';var multer=require('multer');var util=require(_0x1fb3('0x0'));var path=require(_0x1fb3('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fb3('0x2'));var router=express[_0x1fb3('0x3')]();var fs_extra=require(_0x1fb3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1fb3('0x5'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0x1fb3('0x6')](),controller['index']);router[_0x1fb3('0x7')]('/describe',auth[_0x1fb3('0x6')](),controller[_0x1fb3('0x8')]);router['get']('/:id',auth[_0x1fb3('0x6')](),controller[_0x1fb3('0x9')]);router[_0x1fb3('0xa')]('/',auth[_0x1fb3('0x6')](),interaction[_0x1fb3('0xb')]('whatsapp','whatsappmessage:create'),controller[_0x1fb3('0xc')]);router[_0x1fb3('0xa')]('/:id/status',controller[_0x1fb3('0xd')]);router[_0x1fb3('0xe')](_0x1fb3('0xf'),auth[_0x1fb3('0x6')](),controller[_0x1fb3('0x10')]);router['put']('/:id/accept',auth[_0x1fb3('0x6')](),controller[_0x1fb3('0x11')]);router[_0x1fb3('0xe')](_0x1fb3('0x12'),auth[_0x1fb3('0x6')](),controller['reject']);router[_0x1fb3('0x13')](_0x1fb3('0xf'),auth[_0x1fb3('0x6')](),controller[_0x1fb3('0x14')]);module[_0x1fb3('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 214682e..9079562 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 _0x7768=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x27a661,_0x12647f){var _0x1f07d8=function(_0x12402d){while(--_0x12402d){_0x27a661['push'](_0x27a661['shift']());}};_0x1f07d8(++_0x12647f);}(_0x7768,0x1ea));var _0x8776=function(_0x45ff4d,_0x1a3e32){_0x45ff4d=_0x45ff4d-0x0;var _0x2af0f7=_0x7768[_0x45ff4d];return _0x2af0f7;};'use strict';var Sequelize=require(_0x8776('0x0'));module[_0x8776('0x1')]={'body':{'type':Sequelize[_0x8776('0x2')](_0x8776('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8776('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8776('0x5')]('in',_0x8776('0x6')),'defaultValue':_0x8776('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8776('0x7')]},'readAt':{'type':Sequelize[_0x8776('0x8')]},'secret':{'type':Sequelize[_0x8776('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8776('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x13c4=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','STRING'];(function(_0x3ddc71,_0x34db26){var _0x58c794=function(_0x4f7ca7){while(--_0x4f7ca7){_0x3ddc71['push'](_0x3ddc71['shift']());}};_0x58c794(++_0x34db26);}(_0x13c4,0xf9));var _0x413c=function(_0x548e71,_0x27c13a){_0x548e71=_0x548e71-0x0;var _0x22b72f=_0x13c4[_0x548e71];return _0x22b72f;};'use strict';var Sequelize=require(_0x413c('0x0'));module[_0x413c('0x1')]={'body':{'type':Sequelize[_0x413c('0x2')](_0x413c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x413c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x413c('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x413c('0x6')]},'readAt':{'type':Sequelize[_0x413c('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x413c('0x6')]},'providerResponse':{'type':Sequelize[_0x413c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ac69d5b..7fbbf19 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 _0x0537=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','then','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','find','create','body','update','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','type','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x0537,0xfa));var _0x7053=function(_0x2f4f35,_0x431a2c){_0x2f4f35=_0x2f4f35-0x0;var _0x3e9906=_0x0537[_0x2f4f35];return _0x3e9906;};'use strict';var emlformat=require(_0x7053('0x0'));var rimraf=require(_0x7053('0x1'));var zipdir=require(_0x7053('0x2'));var jsonpatch=require(_0x7053('0x3'));var rp=require(_0x7053('0x4'));var moment=require(_0x7053('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7053('0x6'));var util=require(_0x7053('0x7'));var path=require(_0x7053('0x8'));var sox=require(_0x7053('0x9'));var csv=require(_0x7053('0xa'));var ejs=require(_0x7053('0xb'));var fs=require('fs');var fs_extra=require(_0x7053('0xc'));var _=require('lodash');var squel=require(_0x7053('0xd'));var crypto=require(_0x7053('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7053('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7053('0x10'));var Papa=require(_0x7053('0x11'));var Redis=require(_0x7053('0x12'));var authService=require(_0x7053('0x13'));var qs=require(_0x7053('0x14'));var as=require(_0x7053('0x15'));var hardwareService=require(_0x7053('0x16'));var logger=require(_0x7053('0x17'))(_0x7053('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7053('0x19'));var db=require(_0x7053('0x1a'))['db'];config[_0x7053('0x1b')]=_['defaults'](config[_0x7053('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x7053('0x1c'))(new Redis(config['redis']));require(_0x7053('0x1d'))[_0x7053('0x1e')](socket);var jayson=require(_0x7053('0x1f'));var client=jayson['client'][_0x7053('0x20')]({'port':0x232c});var client9002=jayson[_0x7053('0x21')][_0x7053('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x19af1c,_0xdc0454,_0x38eed5,_0x1bb8d1){return new BPromise(function(_0x4d5069,_0x4a8b03){var _0x283693=_0x1bb8d1||client;return _0x283693['request'](_0x19af1c,_0x38eed5)['then'](function(_0x3d807c){logger[_0x7053('0x22')](_0x7053('0x23'),_0xdc0454,_0x7053('0x24'));logger[_0x7053('0x25')](_0x7053('0x26'),_0xdc0454,'request\x20sent',JSON['stringify'](_0x3d807c));if(_0x3d807c[_0x7053('0x27')]){if(_0x3d807c[_0x7053('0x27')][_0x7053('0x28')]===0x1f4){logger['error'](_0x7053('0x23'),_0xdc0454,_0x3d807c[_0x7053('0x27')]['message']);return _0x4a8b03(_0x3d807c[_0x7053('0x27')][_0x7053('0x29')]);}logger[_0x7053('0x27')](_0x7053('0x23'),_0xdc0454,_0x3d807c[_0x7053('0x27')][_0x7053('0x29')]);return _0x4d5069(_0x3d807c['error'][_0x7053('0x29')]);}else{logger[_0x7053('0x22')](_0x7053('0x23'),_0xdc0454,_0x7053('0x24'));_0x4d5069(_0x3d807c[_0x7053('0x2a')]['message']);}})[_0x7053('0x2b')](function(_0x525fa9){logger[_0x7053('0x27')](_0x7053('0x23'),_0xdc0454,_0x525fa9);_0x4a8b03(_0x525fa9);});});}function respondWithStatusCode(_0xaa8b52,_0x3060a8){_0x3060a8=_0x3060a8||0xcc;return function(_0x28799e){if(_0x28799e){return _0xaa8b52[_0x7053('0x2c')](_0x3060a8);}return _0xaa8b52[_0x7053('0x2d')](_0x3060a8)[_0x7053('0x2e')]();};}function respondWithResult(_0x2bd34c,_0x11ae72){_0x11ae72=_0x11ae72||0xc8;return function(_0x2db083){if(_0x2db083){return _0x2bd34c[_0x7053('0x2d')](_0x11ae72)[_0x7053('0x2f')](_0x2db083);}};}function respondWithFilteredResult(_0x422682,_0x557b18){return function(_0x3da080){if(_0x3da080){var _0xfa13cb=typeof _0x557b18[_0x7053('0x30')]===_0x7053('0x31')&&typeof _0x557b18[_0x7053('0x32')]==='undefined';var _0x3fa7a1=_0x3da080[_0x7053('0x33')];var _0x1ba01b=_0xfa13cb?0x0:_0x557b18[_0x7053('0x30')];var _0x4cff2e=_0xfa13cb?_0x3da080[_0x7053('0x33')]:_0x557b18[_0x7053('0x30')]+_0x557b18[_0x7053('0x32')];var _0x13cd9e;if(_0x4cff2e>=_0x3fa7a1){_0x4cff2e=_0x3fa7a1;_0x13cd9e=0xc8;}else{_0x13cd9e=0xce;}_0x422682['status'](_0x13cd9e);return _0x422682['set']('Content-Range',_0x1ba01b+'-'+_0x4cff2e+'/'+_0x3fa7a1)[_0x7053('0x2f')](_0x3da080);}return null;};}function patchUpdates(_0x28d53c){return function(_0x4a9134){try{jsonpatch[_0x7053('0x34')](_0x4a9134,_0x28d53c,!![]);}catch(_0x62c414){return BPromise[_0x7053('0x35')](_0x62c414);}return _0x4a9134['save']();};}function saveUpdates(_0x376ffe,_0x47fc01){return function(_0xcf9a8a){if(_0xcf9a8a){return _0xcf9a8a['update'](_0x376ffe)[_0x7053('0x36')](function(_0xeae13b){return _0xeae13b;});}return null;};}function removeEntity(_0x18efdb,_0x251a21){return function(_0x8bb0c4){if(_0x8bb0c4){return _0x8bb0c4[_0x7053('0x37')]()[_0x7053('0x36')](function(){_0x18efdb[_0x7053('0x2d')](0xcc)[_0x7053('0x2e')]();});}};}function handleEntityNotFound(_0x1269b1,_0x5d9bf6){return function(_0x13dfd1){if(!_0x13dfd1){_0x1269b1['sendStatus'](0x194);}return _0x13dfd1;};}function handleError(_0x3f29e2,_0x5e85fc){_0x5e85fc=_0x5e85fc||0x1f4;return function(_0x5781f0){logger['error'](_0x5781f0[_0x7053('0x38')]);if(_0x5781f0[_0x7053('0x39')]){delete _0x5781f0[_0x7053('0x39')];}_0x3f29e2[_0x7053('0x2d')](_0x5e85fc)[_0x7053('0x3a')](_0x5781f0);};}exports[_0x7053('0x3b')]=function(_0x142401,_0x208963){var _0x9af48={},_0x29d278={},_0x25d3ff={'count':0x0,'rows':[]};var _0x100ae4=_[_0x7053('0x3c')](db[_0x7053('0x3d')][_0x7053('0x3e')],function(_0x587440){return{'name':_0x587440[_0x7053('0x3f')],'type':_0x587440['type'][_0x7053('0x40')]};});_0x29d278[_0x7053('0x41')]=_['map'](_0x100ae4,_0x7053('0x39'));_0x29d278[_0x7053('0x42')]=_[_0x7053('0x43')](_0x142401[_0x7053('0x42')]);_0x29d278[_0x7053('0x44')]=_['intersection'](_0x29d278[_0x7053('0x41')],_0x29d278['query']);_0x9af48['attributes']=_['intersection'](_0x29d278['model'],qs[_0x7053('0x45')](_0x142401[_0x7053('0x42')]['fields']));_0x9af48['attributes']=_0x9af48[_0x7053('0x46')][_0x7053('0x47')]?_0x9af48[_0x7053('0x46')]:_0x29d278[_0x7053('0x41')];if(!_0x142401['query'][_0x7053('0x48')](_0x7053('0x49'))){_0x9af48[_0x7053('0x32')]=qs[_0x7053('0x32')](_0x142401['query'][_0x7053('0x32')]);_0x9af48[_0x7053('0x30')]=qs['offset'](_0x142401['query']['offset']);}_0x9af48[_0x7053('0x4a')]=qs['sort'](_0x142401['query'][_0x7053('0x4b')]);_0x9af48[_0x7053('0x4c')]=qs['filters'](_[_0x7053('0x4d')](_0x142401[_0x7053('0x42')],_0x29d278[_0x7053('0x44')]),_0x100ae4);if(_0x142401[_0x7053('0x42')][_0x7053('0x4e')]){_0x9af48[_0x7053('0x4c')]=_[_0x7053('0x4f')](_0x9af48['where'],{'$or':_[_0x7053('0x3c')](_0x100ae4,function(_0x23db89){if(_0x23db89['type']!==_0x7053('0x50')){var _0x4d6b71={};_0x4d6b71[_0x23db89[_0x7053('0x39')]]={'$like':'%'+_0x142401[_0x7053('0x42')][_0x7053('0x4e')]+'%'};return _0x4d6b71;}})});}_0x9af48=_[_0x7053('0x4f')]({},_0x9af48,_0x142401[_0x7053('0x51')]);var _0x1663e4={'where':_0x9af48[_0x7053('0x4c')]};return db[_0x7053('0x3d')]['count'](_0x1663e4)[_0x7053('0x36')](function(_0x262203){_0x25d3ff[_0x7053('0x33')]=_0x262203;if(_0x142401['query'][_0x7053('0x52')]){_0x9af48[_0x7053('0x53')]=[{'all':!![]}];}return db[_0x7053('0x3d')][_0x7053('0x54')](_0x9af48);})[_0x7053('0x36')](function(_0x57b88a){_0x25d3ff['rows']=_0x57b88a;return _0x25d3ff;})[_0x7053('0x36')](respondWithFilteredResult(_0x208963,_0x9af48))[_0x7053('0x2b')](handleError(_0x208963,null));};exports[_0x7053('0x55')]=function(_0x22408a,_0x38f317){var _0x15fff9={'raw':!![],'where':{'id':_0x22408a[_0x7053('0x56')]['id']}},_0x5579f9={};_0x5579f9['model']=_['keys'](db['WhatsappMessage'][_0x7053('0x3e')]);_0x5579f9[_0x7053('0x42')]=_[_0x7053('0x43')](_0x22408a['query']);_0x5579f9[_0x7053('0x44')]=_[_0x7053('0x57')](_0x5579f9[_0x7053('0x41')],_0x5579f9[_0x7053('0x42')]);_0x15fff9[_0x7053('0x46')]=_[_0x7053('0x57')](_0x5579f9[_0x7053('0x41')],qs[_0x7053('0x45')](_0x22408a[_0x7053('0x42')][_0x7053('0x45')]));_0x15fff9[_0x7053('0x46')]=_0x15fff9['attributes']['length']?_0x15fff9[_0x7053('0x46')]:_0x5579f9[_0x7053('0x41')];if(_0x22408a[_0x7053('0x42')]['includeAll']){_0x15fff9[_0x7053('0x53')]=[{'all':!![]}];}_0x15fff9=_['merge']({},_0x15fff9,_0x22408a[_0x7053('0x51')]);return db[_0x7053('0x3d')][_0x7053('0x58')](_0x15fff9)[_0x7053('0x36')](handleEntityNotFound(_0x38f317,null))[_0x7053('0x36')](respondWithResult(_0x38f317,null))[_0x7053('0x2b')](handleError(_0x38f317,null));};exports[_0x7053('0x59')]=function(_0x4dfb14,_0x5d1f42){return db[_0x7053('0x3d')][_0x7053('0x59')](_0x4dfb14[_0x7053('0x5a')],{})[_0x7053('0x36')](respondWithResult(_0x5d1f42,0xc9))[_0x7053('0x2b')](handleError(_0x5d1f42,null));};exports[_0x7053('0x5b')]=function(_0x6463ba,_0x1e2335){if(_0x6463ba[_0x7053('0x5a')]['id']){delete _0x6463ba[_0x7053('0x5a')]['id'];}return db['WhatsappMessage'][_0x7053('0x58')]({'where':{'id':_0x6463ba[_0x7053('0x56')]['id']}})[_0x7053('0x36')](handleEntityNotFound(_0x1e2335,null))[_0x7053('0x36')](saveUpdates(_0x6463ba['body'],null))[_0x7053('0x36')](respondWithResult(_0x1e2335,null))[_0x7053('0x2b')](handleError(_0x1e2335,null));};exports[_0x7053('0x37')]=function(_0x2c0e1e,_0x47264b){return db[_0x7053('0x3d')][_0x7053('0x58')]({'where':{'id':_0x2c0e1e['params']['id']}})[_0x7053('0x36')](handleEntityNotFound(_0x47264b,null))[_0x7053('0x36')](removeEntity(_0x47264b,null))[_0x7053('0x2b')](handleError(_0x47264b,null));};exports['describe']=function(_0x35048e,_0x57b2b5){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x57b2b5,null))[_0x7053('0x2b')](handleError(_0x57b2b5,null));};var interaction_log=require(_0x7053('0x17'))('whatsapp-interactions');exports[_0x7053('0x5c')]=function(_0x2db47a,_0x40910a,_0x22fdac){var _0x11802f={'agent':{},'channel':_0x7053('0x5d')};if(_0x2db47a[_0x7053('0x5a')]['id']){delete _0x2db47a[_0x7053('0x5a')]['id'];}_0x2db47a[_0x7053('0x5a')][_0x7053('0x5e')]=!![];_0x2db47a[_0x7053('0x5a')][_0x7053('0x5f')]=moment()[_0x7053('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2db47a[_0x7053('0x5a')]['UserId']=_0x2db47a[_0x7053('0x5a')][_0x7053('0x61')]||_0x2db47a[_0x7053('0x62')]['id'];_0x11802f[_0x7053('0x63')]['id']=_0x2db47a['body'][_0x7053('0x61')];return db[_0x7053('0x3d')][_0x7053('0x58')]({'where':{'id':_0x2db47a[_0x7053('0x56')]['id'],'UserId':null}})[_0x7053('0x36')](handleEntityNotFound(_0x40910a,null))[_0x7053('0x36')](saveUpdates(_0x2db47a[_0x7053('0x5a')],null))[_0x7053('0x36')](function(_0x3aa97f){if(_0x3aa97f){_0x11802f[_0x7053('0x29')]=_0x3aa97f[_0x7053('0x64')]({'plain':!![]});return db[_0x7053('0x65')][_0x7053('0x58')]({'where':{'id':_0x3aa97f['WhatsappInteractionId']}});}return null;})[_0x7053('0x36')](handleEntityNotFound(_0x40910a,null))[_0x7053('0x36')](function(_0x13983b){if(_0x13983b){return _0x13983b[_0x7053('0x5b')]({'UserId':_0x2db47a[_0x7053('0x5a')]['UserId'],'read1stAt':_[_0x7053('0x66')](_0x13983b['read1stAt'])?moment()[_0x7053('0x60')](_0x7053('0x67')):undefined});}return null;})[_0x7053('0x36')](function(_0x3eb9a8){if(_0x3eb9a8){_0x11802f[_0x7053('0x68')]=_0x3eb9a8[_0x7053('0x64')]({'plain':!![]});interaction_log['info'](_0x7053('0x69'),_0x2db47a['user']['id'],_0x2db47a[_0x7053('0x62')]['name'],_0x2db47a[_0x7053('0x62')]['role'],_0x11802f['interaction']['id'],_0x2db47a['body']?JSON[_0x7053('0x6a')](_0x2db47a[_0x7053('0x5a')]):_0x7053('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x7053('0x6c'),_0x11802f);}return null;})[_0x7053('0x36')](function(_0x14bfef){var _0x238ea1=_0x7053('0x6d')+_0x14bfef[_0x7053('0x29')]['ContactId'];return db[_0x7053('0x6e')]['query'](_0x238ea1,{'type':db[_0x7053('0x6f')][_0x7053('0x70')][_0x7053('0x71')],'raw':!![]})[_0x7053('0x36')](function(_0x4eff5f){return _0x4eff5f;});})[_0x7053('0x36')](function(_0x52ae0a){if(_0x52ae0a){_0x11802f[_0x7053('0x29')]['contact']=_0x52ae0a[0x0];if(!_0x2db47a[_0x7053('0x5a')][_0x7053('0x61')])return;return db['User'][_0x7053('0x58')]({'where':{'id':_0x2db47a[_0x7053('0x5a')][_0x7053('0x61')],'role':_0x7053('0x63')},'attributes':['id',_0x7053('0x39'),'fullname',_0x7053('0x72'),_0x7053('0x73')],'raw':!![]});}return null;})[_0x7053('0x36')](function(_0x13dff5){if(!_0x13dff5)return null;_0x11802f[_0x7053('0x29')][_0x7053('0x63')]=_0x13dff5;return _0x11802f;})[_0x7053('0x36')](function(_0xda419e){if(_0xda419e){if(_0x2db47a[_0x7053('0x5a')][_0x7053('0x74')]){_0x11802f[_0x7053('0x29')]['interface']=util['format'](_0x7053('0x75'),_0x2db47a[_0x7053('0x62')][_0x7053('0x39')]);_0x11802f[_0x7053('0x29')][_0x7053('0x76')]=_0x11802f[_0x7053('0x76')];_0x11802f[_0x7053('0x29')][_0x7053('0x77')]=_0x11802f['channel'];_0x11802f[_0x7053('0x29')][_0x7053('0x78')]='accept';return respondWithRpcPromise(_0x7053('0x79'),_0x7053('0x79'),{'event':_0x7053('0x7a'),'message':_0x11802f[_0x7053('0x29')]},client9002)[_0x7053('0x36')](function(){return _0x11802f;});}return _0x11802f;}return null;})['then'](respondWithResult(_0x40910a,null))[_0x7053('0x2b')](handleError(_0x40910a,null));};var interaction_log=require(_0x7053('0x17'))('whatsapp-interactions');exports[_0x7053('0x35')]=function(_0x4124d3,_0x2874ca,_0x20dd97){var _0x2ba157={'agent':{},'channel':'whatsapp'};if(_0x4124d3['body']['id']){delete _0x4124d3[_0x7053('0x5a')]['id'];}_0x4124d3[_0x7053('0x5a')]['UserId']=_0x4124d3['body'][_0x7053('0x61')]||_0x4124d3[_0x7053('0x62')]['id'];_0x2ba157[_0x7053('0x63')]['id']=_0x4124d3[_0x7053('0x5a')]['UserId'];return db['WhatsappMessage'][_0x7053('0x58')]({'where':{'id':_0x4124d3[_0x7053('0x56')]['id'],'UserId':null}})[_0x7053('0x36')](handleEntityNotFound(_0x2874ca,null))[_0x7053('0x36')](function(_0x45cba0){if(_0x45cba0){_0x2ba157[_0x7053('0x29')]=_0x45cba0['get']({'plain':!![]});return db['WhatsappInteraction'][_0x7053('0x58')]({'where':{'id':_0x45cba0[_0x7053('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x2874ca,null))['then'](function(_0x343b09){if(_0x343b09){_0x2ba157[_0x7053('0x68')]=_0x343b09[_0x7053('0x64')]({'plain':!![]});interaction_log['info'](_0x7053('0x7c'),_0x4124d3[_0x7053('0x62')]['id'],_0x4124d3[_0x7053('0x62')][_0x7053('0x39')],_0x4124d3['user'][_0x7053('0x7d')],_0x2ba157['interaction']['id'],_0x4124d3[_0x7053('0x5a')]?JSON[_0x7053('0x6a')](_0x4124d3[_0x7053('0x5a')]):_0x7053('0x6b'));return respondWithRpcPromise(_0x7053('0x7e'),_0x7053('0x7f'),_0x2ba157);}return null;})[_0x7053('0x36')](function(_0x2de908){var _0x4386c7=_0x7053('0x6d')+_0x2de908[_0x7053('0x29')][_0x7053('0x80')];return db[_0x7053('0x6e')][_0x7053('0x42')](_0x4386c7,{'type':db['Sequelize'][_0x7053('0x70')][_0x7053('0x71')],'raw':!![]})[_0x7053('0x36')](function(_0x146c63){return _0x146c63;});})['then'](function(_0x3c3b29){if(_0x3c3b29){_0x2ba157[_0x7053('0x29')]['contact']=_0x3c3b29[0x0];if(!_0x4124d3[_0x7053('0x5a')][_0x7053('0x61')])return;return db[_0x7053('0x81')]['find']({'where':{'id':_0x4124d3['body']['UserId'],'role':_0x7053('0x63')},'attributes':['id',_0x7053('0x39'),'fullname','email',_0x7053('0x73')],'raw':!![]});}return null;})[_0x7053('0x36')](function(_0x1596c9){if(!_0x1596c9)return null;_0x2ba157[_0x7053('0x29')][_0x7053('0x63')]=_0x1596c9;return _0x2ba157;})[_0x7053('0x36')](function(_0x577e6d){if(_0x577e6d){_0x577e6d['message'][_0x7053('0x82')]=util[_0x7053('0x60')](_0x7053('0x75'),_0x4124d3['user'][_0x7053('0x39')]);_0x577e6d[_0x7053('0x29')][_0x7053('0x76')]=_0x2ba157[_0x7053('0x76')];_0x577e6d[_0x7053('0x29')][_0x7053('0x77')]=_0x2ba157[_0x7053('0x76')];_0x577e6d[_0x7053('0x29')][_0x7053('0x78')]=_0x7053('0x35');respondWithRpcPromise(_0x7053('0x79'),_0x7053('0x79'),{'event':_0x7053('0x83'),'message':_0x577e6d[_0x7053('0x29')]},client9002);return _0x2ba157;}return null;})['then'](respondWithResult(_0x2874ca,null))[_0x7053('0x2b')](handleError(_0x2874ca,null));};exports[_0x7053('0x2d')]=function(_0x3e0b09,_0x292fef,_0x56bc9e){if(_0x3e0b09[_0x7053('0x5a')]['id']){delete _0x3e0b09[_0x7053('0x5a')]['id'];}var _0x50e1d9;return db[_0x7053('0x3d')][_0x7053('0x58')]({'where':{'id':_0x3e0b09[_0x7053('0x56')]['id']}})[_0x7053('0x36')](handleEntityNotFound(_0x292fef,null))['then'](function(_0x5b5551){if(_0x5b5551){_0x50e1d9=_0x5b5551;return db[_0x7053('0x84')][_0x7053('0x58')]({'where':{'id':_0x5b5551[_0x7053('0x85')]}});}})['then'](handleEntityNotFound(_0x292fef,null))[_0x7053('0x36')](function(_0x13d7fe){if(_0x13d7fe){logger[_0x7053('0x25')](_0x7053('0x86'),_0x7053('0x2d'),'received\x20delivery\x20report\x20from',_0x13d7fe[_0x7053('0x87')],util[_0x7053('0x88')](_0x3e0b09['body'],{'showHidden':![],'depth':null}));switch(_0x13d7fe[_0x7053('0x87')]){case _0x7053('0x89'):if(_0x3e0b09[_0x7053('0x5a')]['MessageSid']&&_0x3e0b09['body'][_0x7053('0x8a')]===_0x50e1d9[_0x7053('0x8b')]&&_0x3e0b09['body'][_0x7053('0x8c')]&&_0x3e0b09[_0x7053('0x5a')][_0x7053('0x8c')]===_0x7053('0x5e')){return _0x50e1d9[_0x7053('0x5b')]({'read':!![]});}else{logger['error'](_0x7053('0x8d'),_0x7053('0x2d'),_0x7053('0x89'),util[_0x7053('0x88')](_0x3e0b09[_0x7053('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x50e1d9;}})['then'](respondWithResult(_0x292fef,null))['catch'](handleError(_0x292fef,null));}; \ No newline at end of file +var _0x7e03=['rows','show','params','keys','include','find','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','isNil','read1stAt','get','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','contact','internal','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','jayson/promise','http','request','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','name','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','VIRTUAL','filter','options','findAll'];(function(_0x32ed89,_0x11d953){var _0x262961=function(_0x29727c){while(--_0x29727c){_0x32ed89['push'](_0x32ed89['shift']());}};_0x262961(++_0x11d953);}(_0x7e03,0x154));var _0x37e0=function(_0x3dd9b5,_0x1f6649){_0x3dd9b5=_0x3dd9b5-0x0;var _0x3355a7=_0x7e03[_0x3dd9b5];return _0x3355a7;};'use strict';var emlformat=require(_0x37e0('0x0'));var rimraf=require(_0x37e0('0x1'));var zipdir=require(_0x37e0('0x2'));var jsonpatch=require(_0x37e0('0x3'));var rp=require(_0x37e0('0x4'));var moment=require(_0x37e0('0x5'));var BPromise=require(_0x37e0('0x6'));var Mustache=require(_0x37e0('0x7'));var util=require(_0x37e0('0x8'));var path=require(_0x37e0('0x9'));var sox=require('sox');var csv=require(_0x37e0('0xa'));var ejs=require(_0x37e0('0xb'));var fs=require('fs');var fs_extra=require(_0x37e0('0xc'));var _=require('lodash');var squel=require(_0x37e0('0xd'));var crypto=require(_0x37e0('0xe'));var jsforce=require(_0x37e0('0xf'));var deskjs=require(_0x37e0('0x10'));var toCsv=require(_0x37e0('0xa'));var querystring=require('querystring');var Papa=require(_0x37e0('0x11'));var Redis=require(_0x37e0('0x12'));var authService=require(_0x37e0('0x13'));var qs=require(_0x37e0('0x14'));var as=require(_0x37e0('0x15'));var hardwareService=require(_0x37e0('0x16'));var logger=require(_0x37e0('0x17'))(_0x37e0('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x37e0('0x19'));var db=require(_0x37e0('0x1a'))['db'];config['redis']=_['defaults'](config[_0x37e0('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x37e0('0x1c'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x37e0('0x1d'));var client=jayson['client'][_0x37e0('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4397e2,_0x3e3f37,_0x57c916,_0x3b8bb2){return new BPromise(function(_0x2dd9df,_0x44f90b){var _0x63eaa1=_0x3b8bb2||client;return _0x63eaa1[_0x37e0('0x1f')](_0x4397e2,_0x57c916)['then'](function(_0x3f9b2e){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3e3f37,_0x37e0('0x20'));logger[_0x37e0('0x21')](_0x37e0('0x22'),_0x3e3f37,_0x37e0('0x20'),JSON[_0x37e0('0x23')](_0x3f9b2e));if(_0x3f9b2e[_0x37e0('0x24')]){if(_0x3f9b2e[_0x37e0('0x24')][_0x37e0('0x25')]===0x1f4){logger[_0x37e0('0x24')](_0x37e0('0x26'),_0x3e3f37,_0x3f9b2e[_0x37e0('0x24')][_0x37e0('0x27')]);return _0x44f90b(_0x3f9b2e[_0x37e0('0x24')][_0x37e0('0x27')]);}logger[_0x37e0('0x24')](_0x37e0('0x26'),_0x3e3f37,_0x3f9b2e[_0x37e0('0x24')][_0x37e0('0x27')]);return _0x2dd9df(_0x3f9b2e[_0x37e0('0x24')][_0x37e0('0x27')]);}else{logger['info'](_0x37e0('0x26'),_0x3e3f37,_0x37e0('0x20'));_0x2dd9df(_0x3f9b2e[_0x37e0('0x28')]['message']);}})[_0x37e0('0x29')](function(_0x386b01){logger[_0x37e0('0x24')](_0x37e0('0x26'),_0x3e3f37,_0x386b01);_0x44f90b(_0x386b01);});});}function respondWithStatusCode(_0xc15c92,_0x225088){_0x225088=_0x225088||0xcc;return function(_0x57a266){if(_0x57a266){return _0xc15c92[_0x37e0('0x2a')](_0x225088);}return _0xc15c92[_0x37e0('0x2b')](_0x225088)['end']();};}function respondWithResult(_0x56dea6,_0x16259d){_0x16259d=_0x16259d||0xc8;return function(_0x44fd1b){if(_0x44fd1b){return _0x56dea6['status'](_0x16259d)[_0x37e0('0x2c')](_0x44fd1b);}};}function respondWithFilteredResult(_0x2b55f2,_0x41ffbb){return function(_0x1561f9){if(_0x1561f9){var _0x1de064=typeof _0x41ffbb[_0x37e0('0x2d')]===_0x37e0('0x2e')&&typeof _0x41ffbb[_0x37e0('0x2f')]===_0x37e0('0x2e');var _0x2758b6=_0x1561f9['count'];var _0x40a030=_0x1de064?0x0:_0x41ffbb['offset'];var _0x31a1f9=_0x1de064?_0x1561f9[_0x37e0('0x30')]:_0x41ffbb[_0x37e0('0x2d')]+_0x41ffbb['limit'];var _0xf6bf86;if(_0x31a1f9>=_0x2758b6){_0x31a1f9=_0x2758b6;_0xf6bf86=0xc8;}else{_0xf6bf86=0xce;}_0x2b55f2[_0x37e0('0x2b')](_0xf6bf86);return _0x2b55f2[_0x37e0('0x31')](_0x37e0('0x32'),_0x40a030+'-'+_0x31a1f9+'/'+_0x2758b6)[_0x37e0('0x2c')](_0x1561f9);}return null;};}function patchUpdates(_0x427489){return function(_0x37bd06){try{jsonpatch[_0x37e0('0x33')](_0x37bd06,_0x427489,!![]);}catch(_0x164705){return BPromise['reject'](_0x164705);}return _0x37bd06[_0x37e0('0x34')]();};}function saveUpdates(_0x1205fa,_0x4ddfb2){return function(_0x51e980){if(_0x51e980){return _0x51e980[_0x37e0('0x35')](_0x1205fa)[_0x37e0('0x36')](function(_0x23de79){return _0x23de79;});}return null;};}function removeEntity(_0x4083ee,_0x1f368b){return function(_0x1e1578){if(_0x1e1578){return _0x1e1578[_0x37e0('0x37')]()[_0x37e0('0x36')](function(){_0x4083ee[_0x37e0('0x2b')](0xcc)[_0x37e0('0x38')]();});}};}function handleEntityNotFound(_0x3a7743,_0x2f3a0d){return function(_0x4467b4){if(!_0x4467b4){_0x3a7743[_0x37e0('0x2a')](0x194);}return _0x4467b4;};}function handleError(_0x5df55d,_0x5edaaf){_0x5edaaf=_0x5edaaf||0x1f4;return function(_0x459c93){logger[_0x37e0('0x24')](_0x459c93['stack']);if(_0x459c93['name']){delete _0x459c93[_0x37e0('0x39')];}_0x5df55d['status'](_0x5edaaf)['send'](_0x459c93);};}exports[_0x37e0('0x3a')]=function(_0x137375,_0x1bc008){var _0x31edaf={},_0x1c65db={},_0x2ff929={'count':0x0,'rows':[]};var _0x387a42=_['map'](db[_0x37e0('0x3b')][_0x37e0('0x3c')],function(_0x372a60){return{'name':_0x372a60[_0x37e0('0x3d')],'type':_0x372a60[_0x37e0('0x3e')][_0x37e0('0x3f')]};});_0x1c65db[_0x37e0('0x40')]=_['map'](_0x387a42,_0x37e0('0x39'));_0x1c65db[_0x37e0('0x41')]=_['keys'](_0x137375[_0x37e0('0x41')]);_0x1c65db['filters']=_[_0x37e0('0x42')](_0x1c65db[_0x37e0('0x40')],_0x1c65db['query']);_0x31edaf[_0x37e0('0x43')]=_['intersection'](_0x1c65db['model'],qs[_0x37e0('0x44')](_0x137375[_0x37e0('0x41')][_0x37e0('0x44')]));_0x31edaf[_0x37e0('0x43')]=_0x31edaf[_0x37e0('0x43')][_0x37e0('0x45')]?_0x31edaf[_0x37e0('0x43')]:_0x1c65db[_0x37e0('0x40')];if(!_0x137375[_0x37e0('0x41')][_0x37e0('0x46')](_0x37e0('0x47'))){_0x31edaf[_0x37e0('0x2f')]=qs[_0x37e0('0x2f')](_0x137375[_0x37e0('0x41')][_0x37e0('0x2f')]);_0x31edaf['offset']=qs['offset'](_0x137375[_0x37e0('0x41')][_0x37e0('0x2d')]);}_0x31edaf[_0x37e0('0x48')]=qs[_0x37e0('0x49')](_0x137375[_0x37e0('0x41')][_0x37e0('0x49')]);_0x31edaf['where']=qs[_0x37e0('0x4a')](_[_0x37e0('0x4b')](_0x137375[_0x37e0('0x41')],_0x1c65db[_0x37e0('0x4a')]),_0x387a42);if(_0x137375['query']['filter']){_0x31edaf[_0x37e0('0x4c')]=_[_0x37e0('0x4d')](_0x31edaf[_0x37e0('0x4c')],{'$or':_[_0x37e0('0x4e')](_0x387a42,function(_0x3057b1){if(_0x3057b1[_0x37e0('0x3e')]!==_0x37e0('0x4f')){var _0x5c3e78={};_0x5c3e78[_0x3057b1[_0x37e0('0x39')]]={'$like':'%'+_0x137375[_0x37e0('0x41')][_0x37e0('0x50')]+'%'};return _0x5c3e78;}})});}_0x31edaf=_[_0x37e0('0x4d')]({},_0x31edaf,_0x137375[_0x37e0('0x51')]);var _0x30a822={'where':_0x31edaf[_0x37e0('0x4c')]};return db['WhatsappMessage']['count'](_0x30a822)[_0x37e0('0x36')](function(_0xfd4220){_0x2ff929[_0x37e0('0x30')]=_0xfd4220;if(_0x137375[_0x37e0('0x41')]['includeAll']){_0x31edaf['include']=[{'all':!![]}];}return db[_0x37e0('0x3b')][_0x37e0('0x52')](_0x31edaf);})[_0x37e0('0x36')](function(_0xd47ab4){_0x2ff929[_0x37e0('0x53')]=_0xd47ab4;return _0x2ff929;})[_0x37e0('0x36')](respondWithFilteredResult(_0x1bc008,_0x31edaf))['catch'](handleError(_0x1bc008,null));};exports[_0x37e0('0x54')]=function(_0x3f71f4,_0x40905e){var _0x5834f1={'raw':!![],'where':{'id':_0x3f71f4[_0x37e0('0x55')]['id']}},_0x5af683={};_0x5af683[_0x37e0('0x40')]=_[_0x37e0('0x56')](db[_0x37e0('0x3b')][_0x37e0('0x3c')]);_0x5af683[_0x37e0('0x41')]=_[_0x37e0('0x56')](_0x3f71f4[_0x37e0('0x41')]);_0x5af683[_0x37e0('0x4a')]=_[_0x37e0('0x42')](_0x5af683['model'],_0x5af683[_0x37e0('0x41')]);_0x5834f1[_0x37e0('0x43')]=_['intersection'](_0x5af683[_0x37e0('0x40')],qs['fields'](_0x3f71f4[_0x37e0('0x41')][_0x37e0('0x44')]));_0x5834f1[_0x37e0('0x43')]=_0x5834f1[_0x37e0('0x43')][_0x37e0('0x45')]?_0x5834f1['attributes']:_0x5af683[_0x37e0('0x40')];if(_0x3f71f4[_0x37e0('0x41')]['includeAll']){_0x5834f1[_0x37e0('0x57')]=[{'all':!![]}];}_0x5834f1=_['merge']({},_0x5834f1,_0x3f71f4[_0x37e0('0x51')]);return db['WhatsappMessage'][_0x37e0('0x58')](_0x5834f1)[_0x37e0('0x36')](handleEntityNotFound(_0x40905e,null))[_0x37e0('0x36')](respondWithResult(_0x40905e,null))[_0x37e0('0x29')](handleError(_0x40905e,null));};exports['create']=function(_0x5452d3,_0x366383){return db['WhatsappMessage']['create'](_0x5452d3[_0x37e0('0x59')],{})[_0x37e0('0x36')](respondWithResult(_0x366383,0xc9))[_0x37e0('0x29')](handleError(_0x366383,null));};exports['update']=function(_0x596987,_0x5d362a){if(_0x596987[_0x37e0('0x59')]['id']){delete _0x596987['body']['id'];}return db[_0x37e0('0x3b')][_0x37e0('0x58')]({'where':{'id':_0x596987[_0x37e0('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d362a,null))['then'](saveUpdates(_0x596987[_0x37e0('0x59')],null))[_0x37e0('0x36')](respondWithResult(_0x5d362a,null))[_0x37e0('0x29')](handleError(_0x5d362a,null));};exports[_0x37e0('0x37')]=function(_0x2a3dbd,_0x451ae7){return db['WhatsappMessage']['find']({'where':{'id':_0x2a3dbd[_0x37e0('0x55')]['id']}})[_0x37e0('0x36')](handleEntityNotFound(_0x451ae7,null))[_0x37e0('0x36')](removeEntity(_0x451ae7,null))[_0x37e0('0x29')](handleError(_0x451ae7,null));};exports[_0x37e0('0x5a')]=function(_0x133abc,_0x5e8ebf){return db[_0x37e0('0x3b')]['describe']()[_0x37e0('0x36')](respondWithResult(_0x5e8ebf,null))[_0x37e0('0x29')](handleError(_0x5e8ebf,null));};var interaction_log=require('../../config/logger')(_0x37e0('0x5b'));exports['accept']=function(_0x2be6b5,_0x13a051,_0x3bf4e5){var _0x50faf0={'agent':{},'channel':_0x37e0('0x5c')};if(_0x2be6b5[_0x37e0('0x59')]['id']){delete _0x2be6b5['body']['id'];}_0x2be6b5[_0x37e0('0x59')][_0x37e0('0x5d')]=!![];_0x2be6b5['body'][_0x37e0('0x5e')]=moment()[_0x37e0('0x5f')](_0x37e0('0x60'));_0x2be6b5[_0x37e0('0x59')]['UserId']=_0x2be6b5[_0x37e0('0x59')][_0x37e0('0x61')]||_0x2be6b5[_0x37e0('0x62')]['id'];_0x50faf0[_0x37e0('0x63')]['id']=_0x2be6b5[_0x37e0('0x59')][_0x37e0('0x61')];return db['WhatsappMessage'][_0x37e0('0x58')]({'where':{'id':_0x2be6b5['params']['id'],'UserId':null}})[_0x37e0('0x36')](handleEntityNotFound(_0x13a051,null))[_0x37e0('0x36')](saveUpdates(_0x2be6b5[_0x37e0('0x59')],null))[_0x37e0('0x36')](function(_0x2eb299){if(_0x2eb299){_0x50faf0[_0x37e0('0x27')]=_0x2eb299['get']({'plain':!![]});return db[_0x37e0('0x64')][_0x37e0('0x58')]({'where':{'id':_0x2eb299['WhatsappInteractionId']}});}return null;})[_0x37e0('0x36')](handleEntityNotFound(_0x13a051,null))['then'](function(_0x128258){if(_0x128258){return _0x128258[_0x37e0('0x35')]({'UserId':_0x2be6b5['body'][_0x37e0('0x61')],'read1stAt':_[_0x37e0('0x65')](_0x128258[_0x37e0('0x66')])?moment()[_0x37e0('0x5f')](_0x37e0('0x60')):undefined});}return null;})[_0x37e0('0x36')](function(_0x2d3d18){if(_0x2d3d18){_0x50faf0['interaction']=_0x2d3d18[_0x37e0('0x67')]({'plain':!![]});interaction_log[_0x37e0('0x68')](_0x37e0('0x69'),_0x2be6b5[_0x37e0('0x62')]['id'],_0x2be6b5[_0x37e0('0x62')]['name'],_0x2be6b5[_0x37e0('0x62')][_0x37e0('0x6a')],_0x50faf0['interaction']['id'],_0x2be6b5[_0x37e0('0x59')]?JSON[_0x37e0('0x23')](_0x2be6b5[_0x37e0('0x59')]):_0x37e0('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x37e0('0x6c'),_0x50faf0);}return null;})[_0x37e0('0x36')](function(_0x20e625){var _0x5e2373=_0x37e0('0x6d')+_0x20e625[_0x37e0('0x27')][_0x37e0('0x6e')];return db[_0x37e0('0x6f')][_0x37e0('0x41')](_0x5e2373,{'type':db[_0x37e0('0x70')]['QueryTypes'][_0x37e0('0x71')],'raw':!![]})[_0x37e0('0x36')](function(_0x4e2bb5){return _0x4e2bb5;});})[_0x37e0('0x36')](function(_0x5561ab){if(_0x5561ab){_0x50faf0[_0x37e0('0x27')]['contact']=_0x5561ab[0x0];if(!_0x2be6b5[_0x37e0('0x59')][_0x37e0('0x61')])return;return db[_0x37e0('0x72')][_0x37e0('0x58')]({'where':{'id':_0x2be6b5[_0x37e0('0x59')][_0x37e0('0x61')],'role':_0x37e0('0x63')},'attributes':['id',_0x37e0('0x39'),_0x37e0('0x73'),_0x37e0('0x74'),'internal'],'raw':!![]});}return null;})[_0x37e0('0x36')](function(_0x566ed9){if(!_0x566ed9)return null;_0x50faf0['message'][_0x37e0('0x63')]=_0x566ed9;return _0x50faf0;})[_0x37e0('0x36')](function(_0x23f7ea){if(_0x23f7ea){if(_0x2be6b5['body'][_0x37e0('0x75')]){_0x50faf0[_0x37e0('0x27')]['interface']=util[_0x37e0('0x5f')](_0x37e0('0x76'),_0x2be6b5[_0x37e0('0x62')][_0x37e0('0x39')]);_0x50faf0[_0x37e0('0x27')][_0x37e0('0x77')]=_0x50faf0[_0x37e0('0x77')];_0x50faf0[_0x37e0('0x27')][_0x37e0('0x78')]=_0x50faf0[_0x37e0('0x77')];_0x50faf0[_0x37e0('0x27')][_0x37e0('0x79')]=_0x37e0('0x7a');return respondWithRpcPromise(_0x37e0('0x7b'),_0x37e0('0x7b'),{'event':_0x37e0('0x7c'),'message':_0x50faf0[_0x37e0('0x27')]},client9002)[_0x37e0('0x36')](function(){return _0x50faf0;});}return _0x50faf0;}return null;})[_0x37e0('0x36')](respondWithResult(_0x13a051,null))[_0x37e0('0x29')](handleError(_0x13a051,null));};var interaction_log=require(_0x37e0('0x17'))(_0x37e0('0x5b'));exports[_0x37e0('0x7d')]=function(_0x3b147a,_0x30481e,_0x13dd39){var _0xb2fca0={'agent':{},'channel':_0x37e0('0x5c')};if(_0x3b147a['body']['id']){delete _0x3b147a[_0x37e0('0x59')]['id'];}_0x3b147a[_0x37e0('0x59')]['UserId']=_0x3b147a['body']['UserId']||_0x3b147a[_0x37e0('0x62')]['id'];_0xb2fca0[_0x37e0('0x63')]['id']=_0x3b147a[_0x37e0('0x59')]['UserId'];return db[_0x37e0('0x3b')][_0x37e0('0x58')]({'where':{'id':_0x3b147a[_0x37e0('0x55')]['id'],'UserId':null}})[_0x37e0('0x36')](handleEntityNotFound(_0x30481e,null))[_0x37e0('0x36')](function(_0x38a17a){if(_0x38a17a){_0xb2fca0[_0x37e0('0x27')]=_0x38a17a[_0x37e0('0x67')]({'plain':!![]});return db[_0x37e0('0x64')]['find']({'where':{'id':_0x38a17a['WhatsappInteractionId']}});}return null;})[_0x37e0('0x36')](handleEntityNotFound(_0x30481e,null))[_0x37e0('0x36')](function(_0x190cab){if(_0x190cab){_0xb2fca0['interaction']=_0x190cab[_0x37e0('0x67')]({'plain':!![]});interaction_log[_0x37e0('0x68')](_0x37e0('0x7e'),_0x3b147a[_0x37e0('0x62')]['id'],_0x3b147a['user']['name'],_0x3b147a['user'][_0x37e0('0x6a')],_0xb2fca0['interaction']['id'],_0x3b147a[_0x37e0('0x59')]?JSON[_0x37e0('0x23')](_0x3b147a[_0x37e0('0x59')]):_0x37e0('0x6b'));return respondWithRpcPromise(_0x37e0('0x7f'),'rejectMessage',_0xb2fca0);}return null;})[_0x37e0('0x36')](function(_0x1e5e72){var _0x981ec9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e5e72[_0x37e0('0x27')][_0x37e0('0x6e')];return db[_0x37e0('0x6f')][_0x37e0('0x41')](_0x981ec9,{'type':db[_0x37e0('0x70')][_0x37e0('0x80')][_0x37e0('0x71')],'raw':!![]})[_0x37e0('0x36')](function(_0x4baf4e){return _0x4baf4e;});})[_0x37e0('0x36')](function(_0x41eca6){if(_0x41eca6){_0xb2fca0[_0x37e0('0x27')][_0x37e0('0x81')]=_0x41eca6[0x0];if(!_0x3b147a[_0x37e0('0x59')][_0x37e0('0x61')])return;return db[_0x37e0('0x72')][_0x37e0('0x58')]({'where':{'id':_0x3b147a[_0x37e0('0x59')]['UserId'],'role':_0x37e0('0x63')},'attributes':['id',_0x37e0('0x39'),_0x37e0('0x73'),_0x37e0('0x74'),_0x37e0('0x82')],'raw':!![]});}return null;})[_0x37e0('0x36')](function(_0x3acbdf){if(!_0x3acbdf)return null;_0xb2fca0[_0x37e0('0x27')][_0x37e0('0x63')]=_0x3acbdf;return _0xb2fca0;})['then'](function(_0x5ed04b){if(_0x5ed04b){_0x5ed04b['message'][_0x37e0('0x83')]=util[_0x37e0('0x5f')](_0x37e0('0x76'),_0x3b147a[_0x37e0('0x62')]['name']);_0x5ed04b[_0x37e0('0x27')][_0x37e0('0x77')]=_0xb2fca0['channel'];_0x5ed04b[_0x37e0('0x27')]['motionChannel']=_0xb2fca0[_0x37e0('0x77')];_0x5ed04b[_0x37e0('0x27')]['event']=_0x37e0('0x7d');respondWithRpcPromise(_0x37e0('0x7b'),'EventManager',{'event':'rejectmessage','message':_0x5ed04b[_0x37e0('0x27')]},client9002);return _0xb2fca0;}return null;})[_0x37e0('0x36')](respondWithResult(_0x30481e,null))[_0x37e0('0x29')](handleError(_0x30481e,null));};exports[_0x37e0('0x2b')]=function(_0xfef82e,_0x4c90ed,_0x3c1113){if(_0xfef82e[_0x37e0('0x59')]['id']){delete _0xfef82e[_0x37e0('0x59')]['id'];}var _0x1bebf0;return db[_0x37e0('0x3b')]['find']({'where':{'id':_0xfef82e[_0x37e0('0x55')]['id']}})[_0x37e0('0x36')](handleEntityNotFound(_0x4c90ed,null))[_0x37e0('0x36')](function(_0x360eba){if(_0x360eba){_0x1bebf0=_0x360eba;return db[_0x37e0('0x84')][_0x37e0('0x58')]({'where':{'id':_0x360eba[_0x37e0('0x85')]}});}})[_0x37e0('0x36')](handleEntityNotFound(_0x4c90ed,null))['then'](function(_0x2b621b){if(_0x2b621b){logger[_0x37e0('0x21')](_0x37e0('0x86'),_0x37e0('0x2b'),_0x37e0('0x87'),_0x2b621b[_0x37e0('0x3e')],util[_0x37e0('0x88')](_0xfef82e['body'],{'showHidden':![],'depth':null}));switch(_0x2b621b[_0x37e0('0x3e')]){case _0x37e0('0x89'):if(_0xfef82e['body']['MessageSid']&&_0xfef82e[_0x37e0('0x59')][_0x37e0('0x8a')]===_0x1bebf0[_0x37e0('0x8b')]&&_0xfef82e[_0x37e0('0x59')][_0x37e0('0x8c')]&&_0xfef82e[_0x37e0('0x59')][_0x37e0('0x8c')]===_0x37e0('0x5d')){return _0x1bebf0['update']({'read':!![]});}else{logger[_0x37e0('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x37e0('0x2b'),'twilio',util['inspect'](_0xfef82e[_0x37e0('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1bebf0;}})[_0x37e0('0x36')](respondWithResult(_0x4c90ed,null))[_0x37e0('0x29')](handleError(_0x4c90ed,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 044edba..d780ea1 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 _0xe511=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0xe511,0x16f));var _0x1e51=function(_0x4fc6f1,_0x10b020){_0x4fc6f1=_0x4fc6f1-0x0;var _0x3c7e01=_0xe511[_0x4fc6f1];return _0x3c7e01;};'use strict';var EventEmitter=require(_0x1e51('0x0'));var WhatsappMessage=require(_0x1e51('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1e51('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e51('0x3'),'afterDestroy':_0x1e51('0x4')};function emitEvent(_0x5bfa5d){return function(_0x42e242,_0x2be2b7,_0x204da7){WhatsappMessageEvents[_0x1e51('0x5')](_0x5bfa5d+':'+_0x42e242['id'],_0x42e242);WhatsappMessageEvents['emit'](_0x5bfa5d,_0x42e242);_0x204da7(null);};}for(var e in events){if(events[_0x1e51('0x6')](e)){var event=events[e];WhatsappMessage[_0x1e51('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x1eb38b,_0x16926b){var _0x2ded6e=function(_0xa7abfe){while(--_0xa7abfe){_0x1eb38b['push'](_0x1eb38b['shift']());}};_0x2ded6e(++_0x16926b);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5b6c43,_0x2eed28){_0x5b6c43=_0x5b6c43-0x0;var _0xba72d3=_0xf4eb[_0x5b6c43];return _0xba72d3;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){WhatsappMessageEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);WhatsappMessageEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];WhatsappMessage[_0xbf4e('0x4')](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 c4f00df..47f74b2 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 _0xcfa1=['find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/messages/','body','POST','application/json','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','catch','error','WhatsappAccount'];(function(_0x5f543b,_0xfe52dd){var _0xd31c67=function(_0x4ca63a){while(--_0x4ca63a){_0x5f543b['push'](_0x5f543b['shift']());}};_0xd31c67(++_0xfe52dd);}(_0xcfa1,0xc8));var _0x1cfa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfa1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cfa('0x0'));var util=require('util');var logger=require(_0x1cfa('0x1'))(_0x1cfa('0x2'));var moment=require(_0x1cfa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x1cfa('0x4'));var fs=require('fs');var path=require(_0x1cfa('0x5'));var rimraf=require(_0x1cfa('0x6'));var config=require(_0x1cfa('0x7'));var attributes=require(_0x1cfa('0x8'));module[_0x1cfa('0x9')]=function(_0xe059db,_0x1fd666){return _0xe059db[_0x1cfa('0xa')](_0x1cfa('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x1cfa('0xc'),'fields':[_0x1cfa('0xc')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x1cfa('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3de7bf,_0x1685ad,_0x1031e8){var _0x3098d7=_0xe059db[_0x1cfa('0xe')];var _0x1b8a88=_0x3de7bf['get']({'plain':!![]});if(_0x1b8a88[_0x1cfa('0xf')][_0x1cfa('0x10')]()==='in'||_0x1b8a88[_0x1cfa('0xf')]['toLowerCase']()===_0x1cfa('0x11')&&!_0x1b8a88[_0x1cfa('0x12')]&&!_[_0x1cfa('0x13')](_0x1b8a88[_0x1cfa('0x14')])){_0x3098d7[_0x1cfa('0x15')]['findOne']({'where':{'id':_0x1b8a88[_0x1cfa('0x16')]}})[_0x1cfa('0x17')](function(_0x2bc21b){if(_0x2bc21b){_0x2bc21b[_0x1cfa('0x18')]({'lastMsgAt':_0x1b8a88['createdAt'],'lastMsgDirection':_0x1b8a88[_0x1cfa('0xf')][_0x1cfa('0x10')]()});}})[_0x1cfa('0x19')](function(_0x363903){console[_0x1cfa('0x1a')](_0x363903);});}if(_0x1b8a88[_0x1cfa('0xf')]===_0x1cfa('0x11')&&!_0x1b8a88[_0x1cfa('0x12')]){var _0x15762e;_0x3098d7[_0x1cfa('0x1b')][_0x1cfa('0x1c')]({'where':{'id':_0x1b8a88[_0x1cfa('0x1d')]},'raw':!![]})[_0x1cfa('0x17')](function(_0x1b1602){_0x15762e=_0x1b1602;if(_0x15762e&&_0x15762e[_0x1cfa('0x1e')]){switch(_0x15762e[_0x1cfa('0x1e')]){case _0x1cfa('0x1f'):var _0x269b82=require(_0x1cfa('0x1f'));if(_0x15762e[_0x1cfa('0x20')]&&_0x15762e[_0x1cfa('0x21')]&&_0x15762e[_0x1cfa('0x22')]){var _0xfe368=new _0x269b82(_0x15762e[_0x1cfa('0x20')],_0x15762e[_0x1cfa('0x21')]);_0xfe368[_0x1cfa('0x23')]['create']({'body':_0x1b8a88['body'],'to':_0x1cfa('0x24')+_0x1b8a88[_0x1cfa('0x22')],'from':'whatsapp:'+_0x15762e['phone'],'statusCallback':_0x15762e[_0x1cfa('0x25')]+_0x1cfa('0x26')+_0x1b8a88['id']+_0x1cfa('0x27')+_0x15762e[_0x1cfa('0x28')]})['then'](function(_0x5ba2dc){if(_0x5ba2dc[_0x1cfa('0x29')]){return _0x3de7bf[_0x1cfa('0x18')]({'messageId':_0x5ba2dc[_0x1cfa('0x29')]});}})[_0x1cfa('0x19')](function(_0x36491e){logger['error'](_0x1cfa('0x2a'),'afterCreate',_0x1cfa('0x1f'),util[_0x1cfa('0x2b')](_0x36491e,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1cfa('0x2c'),_0x1cfa('0x1f'),_0x1cfa('0x2d'));}break;case _0x1cfa('0x2e'):var _0x39abf2=_0x15762e[_0x1cfa('0x20')];var _0x3c8fc2=_0x15762e[_0x1cfa('0x21')];var _0x5763a5=_0x15762e['baseUrl']+'/whatsapp/v1/'+_0x39abf2+_0x1cfa('0x2f');var _0x44283f={'to':[_0x1b8a88['phone']],'message':{'type':'text','text':_0x1b8a88[_0x1cfa('0x30')]}};var _0x2ed267={'method':_0x1cfa('0x31'),'uri':_0x5763a5,'headers':{'Authorization':'Bearer\x20'+_0x3c8fc2,'Content-Type':_0x1cfa('0x32')},'body':_0x44283f,'json':!![]};rp(_0x2ed267)['then'](function(_0x38d3b0){if(_0x38d3b0['statuses'][0x0][_0x1cfa('0x33')]){return _0x3de7bf[_0x1cfa('0x18')]({'messageId':_0x38d3b0['statuses'][0x0][_0x1cfa('0x33')]});}})[_0x1cfa('0x19')](function(_0x51078a){logger[_0x1cfa('0x34')](_0x1cfa('0x35'),_0x51078a);});break;}}})[_0x1cfa('0x36')](function(){_0x1031e8();});}else{_0x1031e8();}}},'charset':_0x1cfa('0x37'),'collate':_0x1cfa('0x38')});}; \ No newline at end of file +var _0x8eca=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','path','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','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','WhatsappMessage,\x20%s','finally'];(function(_0x145135,_0x25acd8){var _0x68f705=function(_0x187ce9){while(--_0x187ce9){_0x145135['push'](_0x145135['shift']());}};_0x68f705(++_0x25acd8);}(_0x8eca,0x1e2));var _0xa8ec=function(_0x253f2c,_0x5283ee){_0x253f2c=_0x253f2c-0x0;var _0x2ee6d1=_0x8eca[_0x253f2c];return _0x2ee6d1;};'use strict';var _=require(_0xa8ec('0x0'));var util=require(_0xa8ec('0x1'));var logger=require(_0xa8ec('0x2'))('api');var moment=require(_0xa8ec('0x3'));var BPromise=require(_0xa8ec('0x4'));var rp=require(_0xa8ec('0x5'));var fetch=require(_0xa8ec('0x6'));var fs=require('fs');var path=require(_0xa8ec('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x278798,_0x53209c){return _0x278798[_0xa8ec('0x8')]('WhatsappMessage',attributes,{'tableName':_0xa8ec('0x9'),'paranoid':![],'indexes':[{'name':_0xa8ec('0xa'),'fields':[_0xa8ec('0xa')]},{'name':_0xa8ec('0xb'),'fields':[_0xa8ec('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dc6dc,_0x2d8bd7,_0x33b822){var _0x3a0148=_0x278798[_0xa8ec('0xd')];var _0x36df0f=_0x2dc6dc[_0xa8ec('0xe')]({'plain':!![]});if(_0x36df0f[_0xa8ec('0xf')][_0xa8ec('0x10')]()==='in'||_0x36df0f[_0xa8ec('0xf')][_0xa8ec('0x10')]()===_0xa8ec('0x11')&&!_0x36df0f[_0xa8ec('0x12')]&&!_[_0xa8ec('0x13')](_0x36df0f[_0xa8ec('0x14')])){_0x3a0148['WhatsappInteraction'][_0xa8ec('0x15')]({'where':{'id':_0x36df0f[_0xa8ec('0x16')]}})[_0xa8ec('0x17')](function(_0x71ee23){if(_0x71ee23){_0x71ee23[_0xa8ec('0x18')]({'lastMsgAt':_0x36df0f[_0xa8ec('0x19')],'lastMsgDirection':_0x36df0f[_0xa8ec('0xf')][_0xa8ec('0x10')]()});}})[_0xa8ec('0x1a')](function(_0x3add6a){console[_0xa8ec('0x1b')](_0x3add6a);});}if(_0x36df0f[_0xa8ec('0xf')]==='out'&&!_0x36df0f['secret']){var _0x898943;_0x3a0148[_0xa8ec('0x1c')][_0xa8ec('0x1d')]({'where':{'id':_0x36df0f[_0xa8ec('0x1e')]},'raw':!![]})[_0xa8ec('0x17')](function(_0x1e0a2d){_0x898943=_0x1e0a2d;if(_0x898943&&_0x898943[_0xa8ec('0x1f')]){switch(_0x898943[_0xa8ec('0x1f')]){case _0xa8ec('0x20'):var _0x5ca203=require(_0xa8ec('0x20'));if(_0x898943[_0xa8ec('0x21')]&&_0x898943[_0xa8ec('0x22')]&&_0x898943[_0xa8ec('0x23')]){var _0x199269=new _0x5ca203(_0x898943[_0xa8ec('0x21')],_0x898943['authToken']);_0x199269[_0xa8ec('0x24')][_0xa8ec('0x25')]({'body':_0x36df0f[_0xa8ec('0xc')],'to':_0xa8ec('0x26')+_0x36df0f[_0xa8ec('0x23')],'from':_0xa8ec('0x26')+_0x898943[_0xa8ec('0x23')],'statusCallback':_0x898943['remote']+_0xa8ec('0x27')+_0x36df0f['id']+_0xa8ec('0x28')+_0x898943[_0xa8ec('0x29')]})[_0xa8ec('0x17')](function(_0x53fada){if(_0x53fada[_0xa8ec('0x2a')]){return _0x2dc6dc[_0xa8ec('0x18')]({'messageId':_0x53fada[_0xa8ec('0x2a')]});}})['catch'](function(_0x1df884){logger[_0xa8ec('0x1b')](_0xa8ec('0x2b'),_0xa8ec('0x2c'),'twilio',util[_0xa8ec('0x2d')](_0x1df884,{'showHidden':![],'depth':null}));});}else{logger[_0xa8ec('0x1b')](_0xa8ec('0x2b'),_0xa8ec('0x2c'),'twilio',_0xa8ec('0x2e'));}break;case _0xa8ec('0x2f'):var _0x49d9ba=_0x898943[_0xa8ec('0x21')];var _0x39f541=_0x898943['authToken'];var _0x186131=_0x898943[_0xa8ec('0x30')]+_0xa8ec('0x31')+_0x49d9ba+_0xa8ec('0x32');var _0x5d2750={'to':[_0x36df0f['phone']],'message':{'type':_0xa8ec('0x33'),'text':_0x36df0f['body']}};var _0x189808={'method':'POST','uri':_0x186131,'headers':{'Authorization':_0xa8ec('0x34')+_0x39f541,'Content-Type':_0xa8ec('0x35')},'body':_0x5d2750,'json':!![]};rp(_0x189808)[_0xa8ec('0x17')](function(_0x1a79a5){if(_0x1a79a5[_0xa8ec('0x36')][0x0][_0xa8ec('0x37')]){return _0x2dc6dc['update']({'messageId':_0x1a79a5[_0xa8ec('0x36')][0x0][_0xa8ec('0x37')]});}})[_0xa8ec('0x1a')](function(_0x76adfa){logger['err'](_0xa8ec('0x38'),_0x76adfa);});break;}}})[_0xa8ec('0x39')](function(){_0x33b822();});}else{_0x33b822();}}},'charset':_0xa8ec('0x3a'),'collate':_0xa8ec('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 6718d4b..3373b65 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 _0x937f=['raw','CreateWhatsappMessage','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options'];(function(_0x2d73dd,_0x469b22){var _0x47d005=function(_0x309777){while(--_0x309777){_0x2d73dd['push'](_0x2d73dd['shift']());}};_0x47d005(++_0x469b22);}(_0x937f,0x65));var _0xf937=function(_0x35d6ca,_0x5d1b01){_0x35d6ca=_0x35d6ca-0x0;var _0x1b0716=_0x937f[_0x35d6ca];return _0x1b0716;};'use strict';var _=require(_0xf937('0x0'));var util=require(_0xf937('0x1'));var moment=require('moment');var BPromise=require(_0xf937('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf937('0x3'))['db'];var utils=require(_0xf937('0x4'));var logger=require(_0xf937('0x5'))(_0xf937('0x6'));var config=require(_0xf937('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf937('0x8')][_0xf937('0x9')]({'port':0x232a});config[_0xf937('0xa')]=_['defaults'](config['redis'],{'host':_0xf937('0xb'),'port':0x18eb});var socket=require(_0xf937('0xc'))(new Redis(config[_0xf937('0xa')]));require(_0xf937('0xd'))[_0xf937('0xe')](socket);function respondWithRpcPromise(_0x55d909,_0x1ef5a1,_0x2af15e){return new BPromise(function(_0x17c7dd,_0x4f14da){return client[_0xf937('0xf')](_0x55d909,_0x2af15e)[_0xf937('0x10')](function(_0x23903e){logger[_0xf937('0x11')](_0xf937('0x12'),_0x1ef5a1,_0xf937('0x13'));logger[_0xf937('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1ef5a1,_0xf937('0x13'),JSON[_0xf937('0x15')](_0x23903e));if(_0x23903e[_0xf937('0x16')]){if(_0x23903e['error'][_0xf937('0x17')]===0x1f4){logger[_0xf937('0x16')](_0xf937('0x12'),_0x1ef5a1,_0x23903e[_0xf937('0x16')][_0xf937('0x18')]);return _0x4f14da(_0x23903e[_0xf937('0x16')]['message']);}logger[_0xf937('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x1ef5a1,_0x23903e[_0xf937('0x16')][_0xf937('0x18')]);return _0x17c7dd(_0x23903e[_0xf937('0x16')]['message']);}else{logger[_0xf937('0x11')](_0xf937('0x12'),_0x1ef5a1,_0xf937('0x13'));_0x17c7dd(_0x23903e[_0xf937('0x19')][_0xf937('0x18')]);}})[_0xf937('0x1a')](function(_0x3d485b){logger['error'](_0xf937('0x12'),_0x1ef5a1,_0x3d485b);_0x4f14da(_0x3d485b);});});}exports['CreateWhatsappMessage']=function(_0x47f702){var _0x24bcba=this;return new Promise(function(_0x1edbbb,_0x5b5122){return db[_0xf937('0x1b')][_0xf937('0x1c')](_0x47f702[_0xf937('0x1d')],{'raw':_0x47f702[_0xf937('0x1e')]?_0x47f702[_0xf937('0x1e')][_0xf937('0x1f')]===undefined?!![]:![]:!![]})[_0xf937('0x10')](function(_0x11eda5){logger[_0xf937('0x11')](_0xf937('0x20'),_0x47f702);logger[_0xf937('0x14')](_0xf937('0x20'),_0x47f702,JSON[_0xf937('0x15')](_0x11eda5));_0x1edbbb(_0x11eda5);})[_0xf937('0x1a')](function(_0x5f7498){logger[_0xf937('0x16')](_0xf937('0x20'),_0x5f7498[_0xf937('0x18')],_0x47f702);_0x5b5122(_0x24bcba[_0xf937('0x16')](0x1f4,_0x5f7498['message']));});});}; \ No newline at end of file +var _0x6793=['debug','stringify','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x33095a,_0x5342c9){var _0xe884af=function(_0x340649){while(--_0x340649){_0x33095a['push'](_0x33095a['shift']());}};_0xe884af(++_0x5342c9);}(_0x6793,0x12b));var _0x3679=function(_0x3e8186,_0x2846ff){_0x3e8186=_0x3e8186-0x0;var _0x7ff8ed=_0x6793[_0x3e8186];return _0x7ff8ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3679('0x0'));var BPromise=require(_0x3679('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3679('0x2'));var db=require(_0x3679('0x3'))['db'];var utils=require(_0x3679('0x4'));var logger=require(_0x3679('0x5'))(_0x3679('0x6'));var config=require(_0x3679('0x7'));var jayson=require(_0x3679('0x8'));var client=jayson[_0x3679('0x9')][_0x3679('0xa')]({'port':0x232a});config[_0x3679('0xb')]=_[_0x3679('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3679('0xd'))(new Redis(config[_0x3679('0xb')]));require(_0x3679('0xe'))[_0x3679('0xf')](socket);function respondWithRpcPromise(_0x32cc04,_0x3657ec,_0x1954d6){return new BPromise(function(_0x345717,_0x4b6bb3){return client[_0x3679('0x10')](_0x32cc04,_0x1954d6)[_0x3679('0x11')](function(_0x15a3e8){logger[_0x3679('0x12')](_0x3679('0x13'),_0x3657ec,_0x3679('0x14'));logger[_0x3679('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3657ec,_0x3679('0x14'),JSON[_0x3679('0x16')](_0x15a3e8));if(_0x15a3e8[_0x3679('0x17')]){if(_0x15a3e8[_0x3679('0x17')][_0x3679('0x18')]===0x1f4){logger[_0x3679('0x17')](_0x3679('0x13'),_0x3657ec,_0x15a3e8[_0x3679('0x17')][_0x3679('0x19')]);return _0x4b6bb3(_0x15a3e8['error'][_0x3679('0x19')]);}logger[_0x3679('0x17')](_0x3679('0x13'),_0x3657ec,_0x15a3e8[_0x3679('0x17')]['message']);return _0x345717(_0x15a3e8['error'][_0x3679('0x19')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3657ec,'request\x20sent');_0x345717(_0x15a3e8['result'][_0x3679('0x19')]);}})[_0x3679('0x1a')](function(_0x2f7088){logger[_0x3679('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x3657ec,_0x2f7088);_0x4b6bb3(_0x2f7088);});});}exports[_0x3679('0x1b')]=function(_0xefde02){var _0x3b2ad1=this;return new Promise(function(_0x4bcdd9,_0x518cc7){return db[_0x3679('0x1c')]['create'](_0xefde02[_0x3679('0x1d')],{'raw':_0xefde02[_0x3679('0x1e')]?_0xefde02['options'][_0x3679('0x1f')]===undefined?!![]:![]:!![]})[_0x3679('0x11')](function(_0x24ba3f){logger[_0x3679('0x12')]('CreateWhatsappMessage',_0xefde02);logger[_0x3679('0x15')](_0x3679('0x1b'),_0xefde02,JSON[_0x3679('0x16')](_0x24ba3f));_0x4bcdd9(_0x24ba3f);})['catch'](function(_0x217dcd){logger[_0x3679('0x17')]('CreateWhatsappMessage',_0x217dcd[_0x3679('0x19')],_0xefde02);_0x518cc7(_0x3b2ad1['error'](0x1f4,_0x217dcd[_0x3679('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index fc3e66b..11e46a3 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 _0x54ea=['register','length','whatsappMessage:','save','remove','update','emit','removeListener'];(function(_0x29b4d5,_0x5b94c7){var _0x241d61=function(_0x127991){while(--_0x127991){_0x29b4d5['push'](_0x29b4d5['shift']());}};_0x241d61(++_0x5b94c7);}(_0x54ea,0x1bb));var _0xa54e=function(_0x550e09,_0x3711ba){_0x550e09=_0x550e09-0x0;var _0x5f4ec9=_0x54ea[_0x550e09];return _0x5f4ec9;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xa54e('0x0'),_0xa54e('0x1'),_0xa54e('0x2')];function createListener(_0x2d5ef8,_0x597c5c){return function(_0x4b7172){_0x597c5c[_0xa54e('0x3')](_0x2d5ef8,_0x4b7172);};}function removeListener(_0x37a14f,_0xa878b9){return function(){WhatsappMessageEvents[_0xa54e('0x4')](_0x37a14f,_0xa878b9);};}exports[_0xa54e('0x5')]=function(_0x560e79){for(var _0x3b8df6=0x0,_0x13af38=events[_0xa54e('0x6')];_0x3b8df6<_0x13af38;_0x3b8df6++){var _0x141710=events[_0x3b8df6];var _0x5a0c81=createListener(_0xa54e('0x7')+_0x141710,_0x560e79);WhatsappMessageEvents['on'](_0x141710,_0x5a0c81);}}; \ No newline at end of file +var _0xf547=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x126fc3,_0x35d1ac){var _0x649c2b=function(_0x5bff15){while(--_0x5bff15){_0x126fc3['push'](_0x126fc3['shift']());}};_0x649c2b(++_0x35d1ac);}(_0xf547,0xca));var _0x7f54=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf547[_0x5ddb1c];return _0x354adc;};'use strict';var WhatsappMessageEvents=require(_0x7f54('0x0'));var events=[_0x7f54('0x1'),_0x7f54('0x2'),_0x7f54('0x3')];function createListener(_0x7c336d,_0x329979){return function(_0x2e13de){_0x329979[_0x7f54('0x4')](_0x7c336d,_0x2e13de);};}function removeListener(_0x31b7d0,_0x1a95d9){return function(){WhatsappMessageEvents[_0x7f54('0x5')](_0x31b7d0,_0x1a95d9);};}exports[_0x7f54('0x6')]=function(_0x23f0a3){for(var _0x5e5863=0x0,_0x3bebf5=events[_0x7f54('0x7')];_0x5e5863<_0x3bebf5;_0x5e5863++){var _0x5e12ed=events[_0x5e5863];var _0x23cd01=createListener(_0x7f54('0x8')+_0x5e12ed,_0x23f0a3);WhatsappMessageEvents['on'](_0x5e12ed,_0x23cd01);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index c0eea67..6c35369 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 _0xa416=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa416,0x126));var _0x6a41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa416[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6a41('0x0'));var util=require(_0x6a41('0x1'));var path=require('path');var timeout=require(_0x6a41('0x2'));var express=require('express');var router=express[_0x6a41('0x3')]();var fs_extra=require(_0x6a41('0x4'));var auth=require(_0x6a41('0x5'));var interaction=require(_0x6a41('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x6a41('0x7')]('/',auth[_0x6a41('0x8')](),controller[_0x6a41('0x9')]);router[_0x6a41('0x7')](_0x6a41('0xa'),auth[_0x6a41('0x8')](),controller[_0x6a41('0xb')]);router[_0x6a41('0x7')](_0x6a41('0xc'),auth[_0x6a41('0x8')](),controller[_0x6a41('0xd')]);router[_0x6a41('0x7')](_0x6a41('0xe'),auth[_0x6a41('0x8')](),controller[_0x6a41('0xf')]);router[_0x6a41('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6a41('0x10')]);router[_0x6a41('0x7')](_0x6a41('0x11'),auth[_0x6a41('0x8')](),controller['getAgents']);router[_0x6a41('0x12')]('/',auth['isAuthenticated'](),controller[_0x6a41('0x13')]);router[_0x6a41('0x12')](_0x6a41('0x14'),auth[_0x6a41('0x8')](),controller[_0x6a41('0x15')]);router['post'](_0x6a41('0x11'),auth[_0x6a41('0x8')](),controller[_0x6a41('0x16')]);router[_0x6a41('0x17')](_0x6a41('0xc'),auth[_0x6a41('0x8')](),controller[_0x6a41('0x18')]);router[_0x6a41('0x19')](_0x6a41('0xc'),auth['isAuthenticated'](),controller[_0x6a41('0x1a')]);router[_0x6a41('0x19')](_0x6a41('0x14'),auth[_0x6a41('0x8')](),controller[_0x6a41('0x1b')]);router[_0x6a41('0x19')](_0x6a41('0x11'),auth[_0x6a41('0x8')](),controller[_0x6a41('0x1c')]);module[_0x6a41('0x1d')]=router; \ No newline at end of file +var _0xa7db=['destroy','delete','removeTeams','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7db,0xbf));var _0xba7d=function(_0x4ac0bd,_0x2e18a4){_0x4ac0bd=_0x4ac0bd-0x0;var _0x35ce80=_0xa7db[_0x4ac0bd];return _0x35ce80;};'use strict';var multer=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var path=require(_0xba7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xba7d('0x3'));var auth=require(_0xba7d('0x4'));var interaction=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var controller=require(_0xba7d('0x7'));router['get']('/',auth[_0xba7d('0x8')](),controller[_0xba7d('0x9')]);router[_0xba7d('0xa')](_0xba7d('0xb'),auth[_0xba7d('0x8')](),controller[_0xba7d('0xc')]);router['get'](_0xba7d('0xd'),auth[_0xba7d('0x8')](),controller[_0xba7d('0xe')]);router[_0xba7d('0xa')](_0xba7d('0xf'),auth['isAuthenticated'](),controller[_0xba7d('0x10')]);router[_0xba7d('0xa')]('/:id/teams',auth[_0xba7d('0x8')](),controller[_0xba7d('0x11')]);router[_0xba7d('0xa')](_0xba7d('0x12'),auth['isAuthenticated'](),controller[_0xba7d('0x13')]);router[_0xba7d('0x14')]('/',auth[_0xba7d('0x8')](),controller[_0xba7d('0x15')]);router['post'](_0xba7d('0x16'),auth['isAuthenticated'](),controller[_0xba7d('0x17')]);router[_0xba7d('0x14')](_0xba7d('0x12'),auth[_0xba7d('0x8')](),controller['addAgents']);router[_0xba7d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xba7d('0x19')]);router['delete'](_0xba7d('0xd'),auth[_0xba7d('0x8')](),controller[_0xba7d('0x1a')]);router[_0xba7d('0x1b')](_0xba7d('0x16'),auth[_0xba7d('0x8')](),controller[_0xba7d('0x1c')]);router[_0xba7d('0x1b')](_0xba7d('0x12'),auth[_0xba7d('0x8')](),controller[_0xba7d('0x1d')]);module[_0xba7d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 3e65c64..798a953 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 _0xc4e6=['STRING','sequelize','exports','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x4aeb3b,_0x7d2241){var _0x306819=function(_0x17ddcf){while(--_0x17ddcf){_0x4aeb3b['push'](_0x4aeb3b['shift']());}};_0x306819(++_0x7d2241);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xc4e6[_0x183256];return _0x5394a2;};'use strict';var Sequelize=require(_0x6c4e('0x0'));module[_0x6c4e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6c4e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x6c4e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6c4e('0x4')](_0x6c4e('0x5'),'beepall',_0x6c4e('0x6'))},'description':{'type':Sequelize[_0x6c4e('0x7')]}}; \ No newline at end of file +var _0x225c=['beepall','roundrobin','STRING','sequelize','exports','INTEGER','rrmemory'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0x225c,0x106));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc225('0x0'));module[_0xc225('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc225('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc225('0x3'),_0xc225('0x4'),_0xc225('0x5'))},'description':{'type':Sequelize[_0xc225('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 2508abe..8827405 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 _0xd176=['../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','WhatsappQueues','sendStatus','error','name','index','WhatsappQueue','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','whatsappPause','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5c33c9,_0x4aa1f1){var _0xadb0e8=function(_0x49e316){while(--_0x49e316){_0x5c33c9['push'](_0x5c33c9['shift']());}};_0xadb0e8(++_0x4aa1f1);}(_0xd176,0x76));var _0x6d17=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0xd176[_0x101a17];return _0x3b76ee;};'use strict';var emlformat=require(_0x6d17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d17('0x1'));var jsonpatch=require(_0x6d17('0x2'));var rp=require(_0x6d17('0x3'));var moment=require(_0x6d17('0x4'));var BPromise=require(_0x6d17('0x5'));var Mustache=require(_0x6d17('0x6'));var util=require(_0x6d17('0x7'));var path=require(_0x6d17('0x8'));var sox=require('sox');var csv=require(_0x6d17('0x9'));var ejs=require(_0x6d17('0xa'));var fs=require('fs');var fs_extra=require(_0x6d17('0xb'));var _=require(_0x6d17('0xc'));var squel=require('squel');var crypto=require(_0x6d17('0xd'));var jsforce=require(_0x6d17('0xe'));var deskjs=require(_0x6d17('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d17('0x10'));var authService=require(_0x6d17('0x11'));var qs=require(_0x6d17('0x12'));var as=require(_0x6d17('0x13'));var hardwareService=require(_0x6d17('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6d17('0x15'));var config=require(_0x6d17('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6d17('0x17')]=_[_0x6d17('0x18')](config[_0x6d17('0x17')],{'host':_0x6d17('0x19'),'port':0x18eb});var socket=require(_0x6d17('0x1a'))(new Redis(config[_0x6d17('0x17')]));require(_0x6d17('0x1b'))[_0x6d17('0x1c')](socket);function respondWithStatusCode(_0x49f706,_0x57d6f0){_0x57d6f0=_0x57d6f0||0xcc;return function(_0x275ef7){if(_0x275ef7){return _0x49f706['sendStatus'](_0x57d6f0);}return _0x49f706[_0x6d17('0x1d')](_0x57d6f0)['end']();};}function respondWithResult(_0x1e18e4,_0x131aad){_0x131aad=_0x131aad||0xc8;return function(_0x1b7966){if(_0x1b7966){return _0x1e18e4[_0x6d17('0x1d')](_0x131aad)[_0x6d17('0x1e')](_0x1b7966);}};}function respondWithFilteredResult(_0x744794,_0x2648ed){return function(_0x4a40a9){if(_0x4a40a9){var _0x4590d2=typeof _0x2648ed[_0x6d17('0x1f')]===_0x6d17('0x20')&&typeof _0x2648ed['limit']===_0x6d17('0x20');var _0x4d37c0=_0x4a40a9[_0x6d17('0x21')];var _0x95301f=_0x4590d2?0x0:_0x2648ed[_0x6d17('0x1f')];var _0x46499e=_0x4590d2?_0x4a40a9[_0x6d17('0x21')]:_0x2648ed[_0x6d17('0x1f')]+_0x2648ed['limit'];var _0x122bdb;if(_0x46499e>=_0x4d37c0){_0x46499e=_0x4d37c0;_0x122bdb=0xc8;}else{_0x122bdb=0xce;}_0x744794[_0x6d17('0x1d')](_0x122bdb);return _0x744794[_0x6d17('0x22')](_0x6d17('0x23'),_0x95301f+'-'+_0x46499e+'/'+_0x4d37c0)['json'](_0x4a40a9);}return null;};}function patchUpdates(_0x5523c4){return function(_0x240fa8){try{jsonpatch[_0x6d17('0x24')](_0x240fa8,_0x5523c4,!![]);}catch(_0x4add39){return BPromise['reject'](_0x4add39);}return _0x240fa8[_0x6d17('0x25')]();};}function saveUpdates(_0x2bcf32,_0x26b579){return function(_0x2ee00d){if(_0x2ee00d){return _0x2ee00d['update'](_0x2bcf32)[_0x6d17('0x26')](function(_0x21fa49){return _0x21fa49;});}return null;};}function removeEntity(_0x1478fc,_0x1f26f3){return function(_0x40cf5c){if(_0x40cf5c){return _0x40cf5c[_0x6d17('0x27')]()[_0x6d17('0x26')](function(){var _0x309463=_0x40cf5c['get']({'plain':!![]});var _0x4731fe=_0x6d17('0x28');return db['UserProfileResource'][_0x6d17('0x27')]({'where':{'type':_0x4731fe,'resourceId':_0x309463['id']}})['then'](function(){return _0x40cf5c;});})['then'](function(){_0x1478fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3019e2,_0x50ed9e){return function(_0x27cba3){if(!_0x27cba3){_0x3019e2[_0x6d17('0x29')](0x194);}return _0x27cba3;};}function handleError(_0x5eb98c,_0xd2ac01){_0xd2ac01=_0xd2ac01||0x1f4;return function(_0x296514){logger[_0x6d17('0x2a')](_0x296514['stack']);if(_0x296514[_0x6d17('0x2b')]){delete _0x296514['name'];}_0x5eb98c[_0x6d17('0x1d')](_0xd2ac01)['send'](_0x296514);};}exports[_0x6d17('0x2c')]=function(_0x51137a,_0x26ff96){var _0x5d7a4e={},_0x53eef4={},_0x2f21fb={'count':0x0,'rows':[]};var _0x39cfbd=_['map'](db[_0x6d17('0x2d')][_0x6d17('0x2e')],function(_0x589335){return{'name':_0x589335['fieldName'],'type':_0x589335[_0x6d17('0x2f')][_0x6d17('0x30')]};});_0x53eef4[_0x6d17('0x31')]=_[_0x6d17('0x32')](_0x39cfbd,_0x6d17('0x2b'));_0x53eef4[_0x6d17('0x33')]=_[_0x6d17('0x34')](_0x51137a[_0x6d17('0x33')]);_0x53eef4['filters']=_[_0x6d17('0x35')](_0x53eef4[_0x6d17('0x31')],_0x53eef4[_0x6d17('0x33')]);_0x5d7a4e['attributes']=_[_0x6d17('0x35')](_0x53eef4[_0x6d17('0x31')],qs[_0x6d17('0x36')](_0x51137a[_0x6d17('0x33')][_0x6d17('0x36')]));_0x5d7a4e['attributes']=_0x5d7a4e[_0x6d17('0x37')]['length']?_0x5d7a4e[_0x6d17('0x37')]:_0x53eef4['model'];if(!_0x51137a['query'][_0x6d17('0x38')](_0x6d17('0x39'))){_0x5d7a4e[_0x6d17('0x3a')]=qs[_0x6d17('0x3a')](_0x51137a['query'][_0x6d17('0x3a')]);_0x5d7a4e[_0x6d17('0x1f')]=qs['offset'](_0x51137a['query'][_0x6d17('0x1f')]);}_0x5d7a4e['order']=qs[_0x6d17('0x3b')](_0x51137a[_0x6d17('0x33')]['sort']);_0x5d7a4e[_0x6d17('0x3c')]=qs[_0x6d17('0x3d')](_[_0x6d17('0x3e')](_0x51137a['query'],_0x53eef4[_0x6d17('0x3d')]),_0x39cfbd);if(_0x51137a[_0x6d17('0x33')]['filter']){_0x5d7a4e[_0x6d17('0x3c')]=_[_0x6d17('0x3f')](_0x5d7a4e['where'],{'$or':_[_0x6d17('0x32')](_0x39cfbd,function(_0x1c8563){if(_0x1c8563[_0x6d17('0x2f')]!==_0x6d17('0x40')){var _0x698c26={};_0x698c26[_0x1c8563[_0x6d17('0x2b')]]={'$like':'%'+_0x51137a[_0x6d17('0x33')]['filter']+'%'};return _0x698c26;}})});}_0x5d7a4e=_['merge']({},_0x5d7a4e,_0x51137a['options']);var _0x3f3ceb={'where':_0x5d7a4e[_0x6d17('0x3c')]};return db[_0x6d17('0x2d')][_0x6d17('0x21')](_0x3f3ceb)[_0x6d17('0x26')](function(_0x5f55e1){_0x2f21fb[_0x6d17('0x21')]=_0x5f55e1;if(_0x51137a[_0x6d17('0x33')][_0x6d17('0x41')]){_0x5d7a4e[_0x6d17('0x42')]=[{'all':!![]}];}return db[_0x6d17('0x2d')][_0x6d17('0x43')](_0x5d7a4e);})[_0x6d17('0x26')](function(_0x2f9bee){_0x2f21fb[_0x6d17('0x44')]=_0x2f9bee;return _0x2f21fb;})[_0x6d17('0x26')](respondWithFilteredResult(_0x26ff96,_0x5d7a4e))[_0x6d17('0x45')](handleError(_0x26ff96,null));};exports[_0x6d17('0x46')]=function(_0x5ca747,_0x593b5a){var _0x2b7fa0={'raw':!![],'where':{'id':_0x5ca747['params']['id']}},_0x428850={};_0x428850[_0x6d17('0x31')]=_[_0x6d17('0x34')](db[_0x6d17('0x2d')][_0x6d17('0x2e')]);_0x428850[_0x6d17('0x33')]=_[_0x6d17('0x34')](_0x5ca747[_0x6d17('0x33')]);_0x428850[_0x6d17('0x3d')]=_['intersection'](_0x428850[_0x6d17('0x31')],_0x428850[_0x6d17('0x33')]);_0x2b7fa0[_0x6d17('0x37')]=_['intersection'](_0x428850[_0x6d17('0x31')],qs[_0x6d17('0x36')](_0x5ca747[_0x6d17('0x33')]['fields']));_0x2b7fa0[_0x6d17('0x37')]=_0x2b7fa0['attributes'][_0x6d17('0x47')]?_0x2b7fa0[_0x6d17('0x37')]:_0x428850['model'];if(_0x5ca747[_0x6d17('0x33')][_0x6d17('0x41')]){_0x2b7fa0[_0x6d17('0x42')]=[{'all':!![]}];}_0x2b7fa0=_['merge']({},_0x2b7fa0,_0x5ca747[_0x6d17('0x48')]);return db[_0x6d17('0x2d')]['find'](_0x2b7fa0)[_0x6d17('0x26')](handleEntityNotFound(_0x593b5a,null))['then'](respondWithResult(_0x593b5a,null))[_0x6d17('0x45')](handleError(_0x593b5a,null));};exports[_0x6d17('0x49')]=function(_0x49fb1f,_0x2779da){return db[_0x6d17('0x2d')]['create'](_0x49fb1f[_0x6d17('0x4a')],{})['then'](function(_0x81bbac){var _0x3c0d8b=_0x49fb1f['user'][_0x6d17('0x4b')]({'plain':!![]});if(!_0x3c0d8b)throw new Error(_0x6d17('0x4c'));if(_0x3c0d8b[_0x6d17('0x4d')]===_0x6d17('0x4e')){var _0x32b4a9=_0x81bbac[_0x6d17('0x4b')]({'plain':!![]});var _0x4c3ff1=_0x6d17('0x28');return db[_0x6d17('0x4f')][_0x6d17('0x50')]({'where':{'name':_0x4c3ff1,'userProfileId':_0x3c0d8b['userProfileId']},'raw':!![]})[_0x6d17('0x26')](function(_0x22bb05){if(_0x22bb05&&_0x22bb05['autoAssociation']===0x0){return db['UserProfileResource'][_0x6d17('0x49')]({'name':_0x32b4a9['name'],'resourceId':_0x32b4a9['id'],'type':_0x22bb05['name'],'sectionId':_0x22bb05['id']},{})[_0x6d17('0x26')](function(){return _0x81bbac;});}else{return _0x81bbac;}})[_0x6d17('0x45')](function(_0x135a78){logger[_0x6d17('0x2a')](_0x6d17('0x51'),_0x135a78);throw _0x135a78;});}return _0x81bbac;})[_0x6d17('0x26')](respondWithResult(_0x2779da,0xc9))[_0x6d17('0x45')](handleError(_0x2779da,null));};exports['update']=function(_0xfd2d82,_0x54f8a5){if(_0xfd2d82[_0x6d17('0x4a')]['id']){delete _0xfd2d82[_0x6d17('0x4a')]['id'];}return db[_0x6d17('0x2d')][_0x6d17('0x50')]({'where':{'id':_0xfd2d82[_0x6d17('0x52')]['id']}})['then'](handleEntityNotFound(_0x54f8a5,null))[_0x6d17('0x26')](saveUpdates(_0xfd2d82[_0x6d17('0x4a')],null))[_0x6d17('0x26')](respondWithResult(_0x54f8a5,null))['catch'](handleError(_0x54f8a5,null));};exports[_0x6d17('0x27')]=function(_0x5ba5ed,_0x393a12){return db[_0x6d17('0x2d')][_0x6d17('0x50')]({'where':{'id':_0x5ba5ed['params']['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0x393a12,null))['then'](removeEntity(_0x393a12,null))[_0x6d17('0x45')](handleError(_0x393a12,null));};exports[_0x6d17('0x53')]=function(_0xb779a4,_0x457c7e){return db['WhatsappQueue'][_0x6d17('0x53')]()[_0x6d17('0x26')](respondWithResult(_0x457c7e,null))['catch'](handleError(_0x457c7e,null));};exports[_0x6d17('0x54')]=function(_0x477f25,_0x4f80b4,_0x576027){var _0xd0c6df={'raw':!![],'where':{}},_0x2f7973={},_0x554e42;return db[_0x6d17('0x2d')][_0x6d17('0x55')]({'where':{'id':_0x477f25[_0x6d17('0x52')]['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0x4f80b4,null))[_0x6d17('0x26')](function(_0x23b7dc){if(_0x23b7dc){_0x554e42=_0x23b7dc[_0x6d17('0x4b')]({'plain':!![]});_0x2f7973[_0x6d17('0x31')]=_['keys'](db[_0x6d17('0x56')][_0x6d17('0x2e')]);_0x2f7973[_0x6d17('0x33')]=_[_0x6d17('0x34')](_0x477f25['query']);_0x2f7973[_0x6d17('0x3d')]=_['intersection'](_0x2f7973[_0x6d17('0x31')],_0x2f7973[_0x6d17('0x33')]);_0xd0c6df['attributes']=_[_0x6d17('0x35')](_0x2f7973['model'],qs[_0x6d17('0x36')](_0x477f25[_0x6d17('0x33')][_0x6d17('0x36')]));_0xd0c6df['attributes']=_0xd0c6df[_0x6d17('0x37')]['length']?_0xd0c6df['attributes']:_0x2f7973[_0x6d17('0x31')];if(!_0x477f25[_0x6d17('0x33')][_0x6d17('0x38')](_0x6d17('0x39'))){_0xd0c6df[_0x6d17('0x3a')]=qs[_0x6d17('0x3a')](_0x477f25[_0x6d17('0x33')][_0x6d17('0x3a')]);_0xd0c6df[_0x6d17('0x1f')]=qs[_0x6d17('0x1f')](_0x477f25[_0x6d17('0x33')]['offset']);}_0xd0c6df[_0x6d17('0x57')]=qs[_0x6d17('0x3b')](_0x477f25[_0x6d17('0x33')][_0x6d17('0x3b')]);_0xd0c6df['where']=qs[_0x6d17('0x3d')](_[_0x6d17('0x3e')](_0x477f25[_0x6d17('0x33')],_0x2f7973[_0x6d17('0x3d')]));_0xd0c6df[_0x6d17('0x3c')][_0x6d17('0x58')]=_0x23b7dc['id'];if(_0x477f25['query'][_0x6d17('0x59')]){_0xd0c6df[_0x6d17('0x3c')]=_[_0x6d17('0x3f')](_0xd0c6df[_0x6d17('0x3c')],{'$or':_[_0x6d17('0x32')](_0xd0c6df[_0x6d17('0x37')],function(_0x3a310b){var _0xc9a087={};_0xc9a087[_0x3a310b]={'$like':'%'+_0x477f25[_0x6d17('0x33')][_0x6d17('0x59')]+'%'};return _0xc9a087;})});}_0xd0c6df=_['merge']({},_0xd0c6df,_0x477f25[_0x6d17('0x48')]);return db['UserWhatsappQueue'][_0x6d17('0x43')](_0xd0c6df);}})['then'](function(_0x231dda){if(_0x231dda){return db['User'][_0x6d17('0x5a')]({'where':{'id':_[_0x6d17('0x32')](_0x231dda,_0x6d17('0x5b')),'role':_0x6d17('0x5c')},'attributes':['id',_0x6d17('0x2b'),'whatsappPause',_0x6d17('0x5d'),_0x6d17('0x5e')]});}})[_0x6d17('0x26')](function(_0x3dff64){if(_0x3dff64){return{'count':_0x3dff64[_0x6d17('0x21')],'rows':_[_0x6d17('0x32')](_0x3dff64['rows'],function(_0x2ee971){return{'membername':_0x2ee971['name'],'UserId':_0x2ee971['id'],'queue_name':_0x554e42['name'],'WhatsappQueueId':_0x554e42['id'],'interface':util['format'](_0x6d17('0x5f'),_0x6d17('0x60'),_0x2ee971[_0x6d17('0x2b')]),'penalty':0x0,'paused':_0x2ee971[_0x6d17('0x61')],'createdAt':_0x2ee971[_0x6d17('0x5e')],'updatedAt':_0x2ee971['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6d17('0x26')](respondWithFilteredResult(_0x4f80b4,_0xd0c6df))[_0x6d17('0x45')](handleError(_0x4f80b4,null));};exports[_0x6d17('0x62')]=function(_0x2a1603,_0x25f671,_0x3ea462){var _0x38028f={};var _0x5c86b6={};var _0x5c0afa;var _0x9886da;return db['WhatsappQueue'][_0x6d17('0x55')]({'where':{'id':_0x2a1603[_0x6d17('0x52')]['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0x25f671,null))[_0x6d17('0x26')](function(_0xc78ce){if(_0xc78ce){_0x5c0afa=_0xc78ce;_0x5c86b6['model']=_['keys'](db[_0x6d17('0x63')]['rawAttributes']);_0x5c86b6['query']=_['keys'](_0x2a1603['query']);_0x5c86b6[_0x6d17('0x3d')]=_[_0x6d17('0x35')](_0x5c86b6['model'],_0x5c86b6[_0x6d17('0x33')]);_0x38028f[_0x6d17('0x37')]=_[_0x6d17('0x35')](_0x5c86b6[_0x6d17('0x31')],qs[_0x6d17('0x36')](_0x2a1603[_0x6d17('0x33')][_0x6d17('0x36')]));_0x38028f['attributes']=_0x38028f[_0x6d17('0x37')][_0x6d17('0x47')]?_0x38028f[_0x6d17('0x37')]:_0x5c86b6[_0x6d17('0x31')];_0x38028f['order']=qs['sort'](_0x2a1603[_0x6d17('0x33')]['sort']);_0x38028f['where']=qs[_0x6d17('0x3d')](_['pick'](_0x2a1603['query'],_0x5c86b6[_0x6d17('0x3d')]));if(_0x2a1603[_0x6d17('0x33')]['filter']){_0x38028f['where']=_[_0x6d17('0x3f')](_0x38028f[_0x6d17('0x3c')],{'$or':_[_0x6d17('0x32')](_0x38028f[_0x6d17('0x37')],function(_0x5ca31f){var _0x196ec9={};_0x196ec9[_0x5ca31f]={'$like':'%'+_0x2a1603[_0x6d17('0x33')]['filter']+'%'};return _0x196ec9;})});}_0x38028f=_[_0x6d17('0x3f')]({},_0x38028f,_0x2a1603[_0x6d17('0x48')]);return _0x5c0afa[_0x6d17('0x62')](_0x38028f);}})[_0x6d17('0x26')](function(_0x419118){if(_0x419118){_0x9886da=_0x419118[_0x6d17('0x47')];if(!_0x2a1603['query'][_0x6d17('0x38')]('nolimit')){_0x38028f[_0x6d17('0x3a')]=qs['limit'](_0x2a1603[_0x6d17('0x33')][_0x6d17('0x3a')]);_0x38028f[_0x6d17('0x1f')]=qs[_0x6d17('0x1f')](_0x2a1603[_0x6d17('0x33')][_0x6d17('0x1f')]);}return _0x5c0afa['getTeams'](_0x38028f);}})[_0x6d17('0x26')](function(_0x3f5eae){if(_0x3f5eae){return _0x3f5eae?{'count':_0x9886da,'rows':_0x3f5eae}:null;}})[_0x6d17('0x26')](respondWithResult(_0x25f671,null))['catch'](handleError(_0x25f671,null));};exports[_0x6d17('0x64')]=function(_0x1a5ed2,_0x18527b,_0x3a950c){var _0x2453e1=_0x1a5ed2[_0x6d17('0x4a')][_0x6d17('0x65')];return db['Team']['findAll']({'where':{'id':_0x2453e1},'attributes':['id'],'include':[{'model':db[_0x6d17('0x66')],'as':_0x6d17('0x67'),'attributes':['id',_0x6d17('0x2b'),_0x6d17('0x68'),_0x6d17('0x69'),_0x6d17('0x6a')],'raw':!![]}]})[_0x6d17('0x26')](function(_0x41b3d8){if(_0x41b3d8){var _0x33b809=_[_0x6d17('0x6b')](_0x41b3d8,function(_0x59054d){var _0x420438=_0x59054d[_0x6d17('0x4b')]({'plain':!![]});return _0x420438[_0x6d17('0x67')];});return db['WhatsappQueue'][_0x6d17('0x50')]({'where':{'id':_0x1a5ed2['params']['id']}})[_0x6d17('0x26')](function(_0xa1acb){return db['sequelize']['transaction'](function(_0x11f8c8){return _0xa1acb[_0x6d17('0x64')](_0x2453e1,{'transaction':_0x11f8c8})['then'](function(){return BPromise['each'](_0x33b809,function(_0x2655bc){return db[_0x6d17('0x56')][_0x6d17('0x6c')]({'where':{'UserId':_0x2655bc['id'],'WhatsappQueueId':_0x1a5ed2['params']['id']},'transaction':_0x11f8c8});});})[_0x6d17('0x26')](function(){_0x33b809[_0x6d17('0x6d')](function(_0x398eeb){socket[_0x6d17('0x6e')](_0x6d17('0x6f'),{'UserId':_0x398eeb['id'],'WhatsappQueueId':_0xa1acb['id']});});});});});}})[_0x6d17('0x26')](respondWithStatusCode(_0x18527b,null))[_0x6d17('0x45')](handleError(_0x18527b,null));};exports[_0x6d17('0x70')]=function(_0x338b80,_0x3180e2,_0x2f1cad){return db[_0x6d17('0x63')][_0x6d17('0x43')]({'where':{'id':_0x338b80[_0x6d17('0x33')][_0x6d17('0x65')]},'attributes':['id'],'include':[{'model':db[_0x6d17('0x66')],'as':_0x6d17('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6d17('0x26')](handleEntityNotFound(_0x3180e2,null))['then'](function(_0x1d1346){var _0x4d28d6=_[_0x6d17('0x32')](_0x1d1346,'id');var _0x6891c4=[];var _0x23af89=[];var _0x509c11=squel[_0x6d17('0x71')]();_0x509c11[_0x6d17('0x72')](_0x6d17('0x73'))[_0x6d17('0x74')]('team_has_whatsapp_queues','tq')[_0x6d17('0x75')](_0x6d17('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6d17('0x3c')](_0x6d17('0x77'),_0x338b80[_0x6d17('0x52')]['id']);for(var _0x550e9a=0x0;_0x550e9a<_0x1d1346[_0x6d17('0x47')];_0x550e9a+=0x1){let _0x23c02c=_0x1d1346[_0x550e9a];for(var _0x2e4041=0x0;_0x2e4041<_0x23c02c[_0x6d17('0x67')][_0x6d17('0x47')];_0x2e4041+=0x1){let _0x1738bc=_0x23c02c[_0x6d17('0x67')][_0x2e4041];var _0x51a2dd=_0x509c11['clone']();_0x51a2dd['where'](_0x6d17('0x78'),_0x1738bc['id']);_0x23af89[_0x6d17('0x79')](db[_0x6d17('0x7a')]['query'](_0x51a2dd[_0x6d17('0x7b')](),{'type':db[_0x6d17('0x7a')][_0x6d17('0x7c')][_0x6d17('0x7d')]})['then'](function(_0x44e860){if(_0x44e860[_0x6d17('0x47')]===0x1){return _0x1738bc['id'];}else{var _0x2ffe58=_[_0x6d17('0x7e')](_[_0x6d17('0x32')](_0x44e860,_0x6d17('0x7f')),function(_0x54acaf){return _[_0x6d17('0x80')](_0x4d28d6,_0x54acaf);});if(_0x2ffe58){return _0x1738bc['id'];}}}));}}return BPromise['all'](_0x23af89)[_0x6d17('0x26')](function(_0x2c67d2){_0x6891c4=_(_0x6891c4)[_0x6d17('0x81')](_0x2c67d2)['compact']()[_0x6d17('0x82')]();return db[_0x6d17('0x2d')][_0x6d17('0x50')]({'where':{'id':_0x338b80[_0x6d17('0x52')]['id']}})['then'](function(_0x10456a){return db[_0x6d17('0x7a')]['transaction'](function(_0xc23ac3){return _0x10456a['removeTeams'](_0x338b80[_0x6d17('0x33')][_0x6d17('0x65')],{'transaction':_0xc23ac3})['then'](function(){if(!_[_0x6d17('0x83')](_0x6891c4)){return _0x10456a[_0x6d17('0x84')](_0x6891c4,{'transaction':_0xc23ac3});}})[_0x6d17('0x26')](function(){_0x6891c4[_0x6d17('0x6d')](function(_0xb3eab1){socket[_0x6d17('0x6e')](_0x6d17('0x85'),{'UserId':_0xb3eab1,'WhatsappQueueId':_0x10456a['id']});});});});});});})['then'](respondWithStatusCode(_0x3180e2,null))[_0x6d17('0x45')](handleError(_0x3180e2,null));};exports['addAgents']=function(_0x9ed283,_0x13e9f1,_0x2ff7e2){return db[_0x6d17('0x2d')][_0x6d17('0x50')]({'where':{'id':_0x9ed283[_0x6d17('0x52')]['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0x13e9f1,null))[_0x6d17('0x26')](function(_0x5749c9){if(_0x5749c9){return _0x5749c9[_0x6d17('0x86')](_0x9ed283[_0x6d17('0x4a')][_0x6d17('0x65')],_[_0x6d17('0x87')](_0x9ed283[_0x6d17('0x4a')],[_0x6d17('0x65'),'id'])||{})[_0x6d17('0x88')](function(_0x5d6abf){for(var _0xbc23f7=0x0;_0xbc23f7<_0x9ed283[_0x6d17('0x4a')][_0x6d17('0x65')][_0x6d17('0x47')];_0xbc23f7+=0x1){socket[_0x6d17('0x6e')](_0x6d17('0x6f'),{'UserId':Number(_0x9ed283[_0x6d17('0x4a')][_0x6d17('0x65')][_0xbc23f7]),'WhatsappQueueId':Number(_0x9ed283['params']['id'])});}return _0x5d6abf;});}})[_0x6d17('0x26')](respondWithResult(_0x13e9f1,null))[_0x6d17('0x45')](handleError(_0x13e9f1,null));};exports[_0x6d17('0x84')]=function(_0x3e923d,_0xe868ad,_0x5ced0c){return db[_0x6d17('0x2d')][_0x6d17('0x50')]({'where':{'id':_0x3e923d[_0x6d17('0x52')]['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0xe868ad,null))[_0x6d17('0x26')](function(_0x3bba05){if(_0x3bba05){return _0x3bba05['removeAgents'](_0x3e923d[_0x6d17('0x33')]['ids'])['then'](function(){if(_['isArray'](_0x3e923d[_0x6d17('0x33')]['ids'])){for(var _0x12fc84=0x0;_0x12fc84<_0x3e923d['query'][_0x6d17('0x65')][_0x6d17('0x47')];_0x12fc84+=0x1){socket[_0x6d17('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3e923d[_0x6d17('0x33')][_0x6d17('0x65')][_0x12fc84]),'WhatsappQueueId':Number(_0x3e923d[_0x6d17('0x52')]['id'])});}}else{socket[_0x6d17('0x6e')](_0x6d17('0x85'),{'UserId':Number(_0x3e923d[_0x6d17('0x33')][_0x6d17('0x65')]),'WhatsappQueueId':Number(_0x3e923d[_0x6d17('0x52')]['id'])});}});}})[_0x6d17('0x26')](respondWithStatusCode(_0xe868ad,null))[_0x6d17('0x45')](handleError(_0xe868ad,null));};exports[_0x6d17('0x89')]=function(_0x33bfc6,_0x5a11a3,_0x48559d){var _0x5208c5={};var _0x4ef2eb={};var _0x259d62;var _0x3e7679;return db[_0x6d17('0x2d')]['findOne']({'where':{'id':_0x33bfc6[_0x6d17('0x52')]['id']}})[_0x6d17('0x26')](handleEntityNotFound(_0x5a11a3,null))[_0x6d17('0x26')](function(_0x1fb046){if(_0x1fb046){_0x259d62=_0x1fb046;_0x4ef2eb[_0x6d17('0x31')]=_['keys'](db['User'][_0x6d17('0x2e')]);_0x4ef2eb[_0x6d17('0x33')]=_[_0x6d17('0x34')](_0x33bfc6[_0x6d17('0x33')]);_0x4ef2eb[_0x6d17('0x3d')]=_[_0x6d17('0x35')](_0x4ef2eb[_0x6d17('0x31')],_0x4ef2eb[_0x6d17('0x33')]);_0x5208c5['attributes']=_[_0x6d17('0x35')](_0x4ef2eb['model'],qs[_0x6d17('0x36')](_0x33bfc6[_0x6d17('0x33')][_0x6d17('0x36')]));_0x5208c5['attributes']=_0x5208c5['attributes'][_0x6d17('0x47')]?_0x5208c5[_0x6d17('0x37')]:_0x4ef2eb[_0x6d17('0x31')];_0x5208c5[_0x6d17('0x57')]=qs[_0x6d17('0x3b')](_0x33bfc6[_0x6d17('0x33')][_0x6d17('0x3b')]);_0x5208c5['where']=qs['filters'](_[_0x6d17('0x3e')](_0x33bfc6[_0x6d17('0x33')],_0x4ef2eb[_0x6d17('0x3d')]));if(_0x33bfc6[_0x6d17('0x33')]['filter']){_0x5208c5['where']=_[_0x6d17('0x3f')](_0x5208c5['where'],{'$or':_[_0x6d17('0x32')](_0x5208c5[_0x6d17('0x37')],function(_0x33bb85){var _0xbf98bd={};_0xbf98bd[_0x33bb85]={'$like':'%'+_0x33bfc6[_0x6d17('0x33')]['filter']+'%'};return _0xbf98bd;})});}_0x5208c5=_[_0x6d17('0x3f')]({},_0x5208c5,_0x33bfc6[_0x6d17('0x48')]);return _0x259d62[_0x6d17('0x89')](_0x5208c5);}})[_0x6d17('0x26')](function(_0x143c30){if(_0x143c30){_0x3e7679=_0x143c30[_0x6d17('0x47')];if(!_0x33bfc6['query'][_0x6d17('0x38')]('nolimit')){_0x5208c5[_0x6d17('0x3a')]=qs[_0x6d17('0x3a')](_0x33bfc6[_0x6d17('0x33')]['limit']);_0x5208c5[_0x6d17('0x1f')]=qs[_0x6d17('0x1f')](_0x33bfc6['query']['offset']);}return _0x259d62['getAgents'](_0x5208c5);}})[_0x6d17('0x26')](function(_0x2add16){if(_0x2add16){return _0x2add16?{'count':_0x3e7679,'rows':_0x2add16}:null;}})[_0x6d17('0x26')](respondWithResult(_0x5a11a3,null))[_0x6d17('0x45')](handleError(_0x5a11a3,null));}; \ No newline at end of file +var _0x1068=['Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','status','end','limit','undefined','count','offset','set','Content-Range','json','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','filter','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','findAll'];(function(_0x562f72,_0x1e6e1b){var _0x1b209a=function(_0x3fd102){while(--_0x3fd102){_0x562f72['push'](_0x562f72['shift']());}};_0x1b209a(++_0x1e6e1b);}(_0x1068,0x145));var _0x8106=function(_0x35e89e,_0xadffa5){_0x35e89e=_0x35e89e-0x0;var _0x385671=_0x1068[_0x35e89e];return _0x385671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8106('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8106('0x1'));var rp=require(_0x8106('0x2'));var moment=require(_0x8106('0x3'));var BPromise=require(_0x8106('0x4'));var Mustache=require(_0x8106('0x5'));var util=require(_0x8106('0x6'));var path=require(_0x8106('0x7'));var sox=require(_0x8106('0x8'));var csv=require(_0x8106('0x9'));var ejs=require(_0x8106('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8106('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8106('0xc'));var toCsv=require(_0x8106('0x9'));var querystring=require(_0x8106('0xd'));var Papa=require(_0x8106('0xe'));var Redis=require(_0x8106('0xf'));var authService=require(_0x8106('0x10'));var qs=require(_0x8106('0x11'));var as=require(_0x8106('0x12'));var hardwareService=require(_0x8106('0x13'));var logger=require(_0x8106('0x14'))('api');var utils=require(_0x8106('0x15'));var config=require(_0x8106('0x16'));var licenseUtil=require(_0x8106('0x17'));var db=require('../../mysqldb')['db'];config[_0x8106('0x18')]=_[_0x8106('0x19')](config[_0x8106('0x18')],{'host':_0x8106('0x1a'),'port':0x18eb});var socket=require(_0x8106('0x1b'))(new Redis(config[_0x8106('0x18')]));require(_0x8106('0x1c'))['register'](socket);function respondWithStatusCode(_0x5dce72,_0xc49fc3){_0xc49fc3=_0xc49fc3||0xcc;return function(_0xaef3fa){if(_0xaef3fa){return _0x5dce72['sendStatus'](_0xc49fc3);}return _0x5dce72[_0x8106('0x1d')](_0xc49fc3)[_0x8106('0x1e')]();};}function respondWithResult(_0x439d52,_0x5f28d3){_0x5f28d3=_0x5f28d3||0xc8;return function(_0x20cdc){if(_0x20cdc){return _0x439d52[_0x8106('0x1d')](_0x5f28d3)['json'](_0x20cdc);}};}function respondWithFilteredResult(_0x52e784,_0x482254){return function(_0x2a3549){if(_0x2a3549){var _0x1a294d=typeof _0x482254['offset']==='undefined'&&typeof _0x482254[_0x8106('0x1f')]===_0x8106('0x20');var _0x5e7c60=_0x2a3549[_0x8106('0x21')];var _0x3d2daf=_0x1a294d?0x0:_0x482254[_0x8106('0x22')];var _0x5ecf82=_0x1a294d?_0x2a3549[_0x8106('0x21')]:_0x482254[_0x8106('0x22')]+_0x482254[_0x8106('0x1f')];var _0x698a45;if(_0x5ecf82>=_0x5e7c60){_0x5ecf82=_0x5e7c60;_0x698a45=0xc8;}else{_0x698a45=0xce;}_0x52e784[_0x8106('0x1d')](_0x698a45);return _0x52e784[_0x8106('0x23')](_0x8106('0x24'),_0x3d2daf+'-'+_0x5ecf82+'/'+_0x5e7c60)[_0x8106('0x25')](_0x2a3549);}return null;};}function patchUpdates(_0x43e369){return function(_0x521876){try{jsonpatch['apply'](_0x521876,_0x43e369,!![]);}catch(_0x41e1f2){return BPromise['reject'](_0x41e1f2);}return _0x521876[_0x8106('0x26')]();};}function saveUpdates(_0x188036,_0x211e81){return function(_0x3ac83f){if(_0x3ac83f){return _0x3ac83f[_0x8106('0x27')](_0x188036)['then'](function(_0x5653d9){return _0x5653d9;});}return null;};}function removeEntity(_0x1bfc75,_0x4454e7){return function(_0x32352d){if(_0x32352d){return _0x32352d[_0x8106('0x28')]()[_0x8106('0x29')](function(){var _0x3cc6db=_0x32352d[_0x8106('0x2a')]({'plain':!![]});var _0x37b4a6=_0x8106('0x2b');return db[_0x8106('0x2c')]['destroy']({'where':{'type':_0x37b4a6,'resourceId':_0x3cc6db['id']}})[_0x8106('0x29')](function(){return _0x32352d;});})[_0x8106('0x29')](function(){_0x1bfc75[_0x8106('0x1d')](0xcc)[_0x8106('0x1e')]();});}};}function handleEntityNotFound(_0x46b21d,_0x28c6a8){return function(_0x266470){if(!_0x266470){_0x46b21d[_0x8106('0x2d')](0x194);}return _0x266470;};}function handleError(_0x52f5ad,_0x11bfdb){_0x11bfdb=_0x11bfdb||0x1f4;return function(_0x17d578){logger[_0x8106('0x2e')](_0x17d578[_0x8106('0x2f')]);if(_0x17d578[_0x8106('0x30')]){delete _0x17d578[_0x8106('0x30')];}_0x52f5ad[_0x8106('0x1d')](_0x11bfdb)[_0x8106('0x31')](_0x17d578);};}exports[_0x8106('0x32')]=function(_0x227b1e,_0x3aee37){var _0x5cbb8d={},_0x518ff2={},_0x1591d6={'count':0x0,'rows':[]};var _0x42b26e=_[_0x8106('0x33')](db[_0x8106('0x34')][_0x8106('0x35')],function(_0x584e4a){return{'name':_0x584e4a[_0x8106('0x36')],'type':_0x584e4a['type'][_0x8106('0x37')]};});_0x518ff2[_0x8106('0x38')]=_[_0x8106('0x33')](_0x42b26e,'name');_0x518ff2[_0x8106('0x39')]=_[_0x8106('0x3a')](_0x227b1e['query']);_0x518ff2[_0x8106('0x3b')]=_[_0x8106('0x3c')](_0x518ff2['model'],_0x518ff2[_0x8106('0x39')]);_0x5cbb8d['attributes']=_[_0x8106('0x3c')](_0x518ff2[_0x8106('0x38')],qs[_0x8106('0x3d')](_0x227b1e['query'][_0x8106('0x3d')]));_0x5cbb8d[_0x8106('0x3e')]=_0x5cbb8d['attributes'][_0x8106('0x3f')]?_0x5cbb8d[_0x8106('0x3e')]:_0x518ff2[_0x8106('0x38')];if(!_0x227b1e[_0x8106('0x39')][_0x8106('0x40')]('nolimit')){_0x5cbb8d[_0x8106('0x1f')]=qs['limit'](_0x227b1e[_0x8106('0x39')]['limit']);_0x5cbb8d[_0x8106('0x22')]=qs[_0x8106('0x22')](_0x227b1e[_0x8106('0x39')][_0x8106('0x22')]);}_0x5cbb8d[_0x8106('0x41')]=qs[_0x8106('0x42')](_0x227b1e['query']['sort']);_0x5cbb8d['where']=qs[_0x8106('0x3b')](_[_0x8106('0x43')](_0x227b1e['query'],_0x518ff2['filters']),_0x42b26e);if(_0x227b1e[_0x8106('0x39')]['filter']){_0x5cbb8d[_0x8106('0x44')]=_[_0x8106('0x45')](_0x5cbb8d['where'],{'$or':_['map'](_0x42b26e,function(_0x3ae830){if(_0x3ae830[_0x8106('0x46')]!==_0x8106('0x47')){var _0x35027f={};_0x35027f[_0x3ae830[_0x8106('0x30')]]={'$like':'%'+_0x227b1e['query']['filter']+'%'};return _0x35027f;}})});}_0x5cbb8d=_['merge']({},_0x5cbb8d,_0x227b1e['options']);var _0x26053b={'where':_0x5cbb8d[_0x8106('0x44')]};return db['WhatsappQueue']['count'](_0x26053b)[_0x8106('0x29')](function(_0x5b6314){_0x1591d6[_0x8106('0x21')]=_0x5b6314;if(_0x227b1e[_0x8106('0x39')][_0x8106('0x48')]){_0x5cbb8d[_0x8106('0x49')]=[{'all':!![]}];}return db[_0x8106('0x34')]['findAll'](_0x5cbb8d);})[_0x8106('0x29')](function(_0x432665){_0x1591d6[_0x8106('0x4a')]=_0x432665;return _0x1591d6;})[_0x8106('0x29')](respondWithFilteredResult(_0x3aee37,_0x5cbb8d))[_0x8106('0x4b')](handleError(_0x3aee37,null));};exports[_0x8106('0x4c')]=function(_0x27ede5,_0x3b0eed){var _0x4ffb2d={'raw':!![],'where':{'id':_0x27ede5[_0x8106('0x4d')]['id']}},_0x4bdc84={};_0x4bdc84[_0x8106('0x38')]=_[_0x8106('0x3a')](db[_0x8106('0x34')]['rawAttributes']);_0x4bdc84['query']=_['keys'](_0x27ede5[_0x8106('0x39')]);_0x4bdc84[_0x8106('0x3b')]=_[_0x8106('0x3c')](_0x4bdc84[_0x8106('0x38')],_0x4bdc84[_0x8106('0x39')]);_0x4ffb2d['attributes']=_[_0x8106('0x3c')](_0x4bdc84[_0x8106('0x38')],qs[_0x8106('0x3d')](_0x27ede5[_0x8106('0x39')]['fields']));_0x4ffb2d[_0x8106('0x3e')]=_0x4ffb2d[_0x8106('0x3e')]['length']?_0x4ffb2d['attributes']:_0x4bdc84[_0x8106('0x38')];if(_0x27ede5['query'][_0x8106('0x48')]){_0x4ffb2d[_0x8106('0x49')]=[{'all':!![]}];}_0x4ffb2d=_[_0x8106('0x45')]({},_0x4ffb2d,_0x27ede5[_0x8106('0x4e')]);return db[_0x8106('0x34')]['find'](_0x4ffb2d)['then'](handleEntityNotFound(_0x3b0eed,null))[_0x8106('0x29')](respondWithResult(_0x3b0eed,null))[_0x8106('0x4b')](handleError(_0x3b0eed,null));};exports['create']=function(_0x40cb31,_0x293ba9){return db['WhatsappQueue'][_0x8106('0x4f')](_0x40cb31[_0x8106('0x50')],{})[_0x8106('0x29')](function(_0x118ed8){var _0x2019fc=_0x40cb31['user'][_0x8106('0x2a')]({'plain':!![]});if(!_0x2019fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2019fc[_0x8106('0x51')]===_0x8106('0x52')){var _0x58262a=_0x118ed8[_0x8106('0x2a')]({'plain':!![]});var _0xf6b07=_0x8106('0x2b');return db['UserProfileSection'][_0x8106('0x53')]({'where':{'name':_0xf6b07,'userProfileId':_0x2019fc[_0x8106('0x54')]},'raw':!![]})[_0x8106('0x29')](function(_0xdc87df){if(_0xdc87df&&_0xdc87df[_0x8106('0x55')]===0x0){return db[_0x8106('0x2c')][_0x8106('0x4f')]({'name':_0x58262a[_0x8106('0x30')],'resourceId':_0x58262a['id'],'type':_0xdc87df[_0x8106('0x30')],'sectionId':_0xdc87df['id']},{})[_0x8106('0x29')](function(){return _0x118ed8;});}else{return _0x118ed8;}})[_0x8106('0x4b')](function(_0x55a228){logger[_0x8106('0x2e')](_0x8106('0x56'),_0x55a228);throw _0x55a228;});}return _0x118ed8;})[_0x8106('0x29')](respondWithResult(_0x293ba9,0xc9))[_0x8106('0x4b')](handleError(_0x293ba9,null));};exports[_0x8106('0x27')]=function(_0x14a41f,_0xd44cf5){if(_0x14a41f[_0x8106('0x50')]['id']){delete _0x14a41f[_0x8106('0x50')]['id'];}return db[_0x8106('0x34')][_0x8106('0x53')]({'where':{'id':_0x14a41f[_0x8106('0x4d')]['id']}})[_0x8106('0x29')](handleEntityNotFound(_0xd44cf5,null))[_0x8106('0x29')](saveUpdates(_0x14a41f[_0x8106('0x50')],null))[_0x8106('0x29')](respondWithResult(_0xd44cf5,null))[_0x8106('0x4b')](handleError(_0xd44cf5,null));};exports['destroy']=function(_0x39c398,_0x26165d){return db[_0x8106('0x34')][_0x8106('0x53')]({'where':{'id':_0x39c398[_0x8106('0x4d')]['id']}})[_0x8106('0x29')](handleEntityNotFound(_0x26165d,null))[_0x8106('0x29')](removeEntity(_0x26165d,null))['catch'](handleError(_0x26165d,null));};exports[_0x8106('0x57')]=function(_0x503373,_0x2ae2b3){return db[_0x8106('0x34')][_0x8106('0x57')]()[_0x8106('0x29')](respondWithResult(_0x2ae2b3,null))[_0x8106('0x4b')](handleError(_0x2ae2b3,null));};exports[_0x8106('0x58')]=function(_0x5c2a5a,_0x2c2206,_0x129271){var _0xe558b6={'raw':!![],'where':{}},_0x34596b={},_0x28ccf6;return db[_0x8106('0x34')][_0x8106('0x59')]({'where':{'id':_0x5c2a5a[_0x8106('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c2206,null))[_0x8106('0x29')](function(_0xba3ae2){if(_0xba3ae2){_0x28ccf6=_0xba3ae2[_0x8106('0x2a')]({'plain':!![]});_0x34596b[_0x8106('0x38')]=_['keys'](db[_0x8106('0x5a')]['rawAttributes']);_0x34596b[_0x8106('0x39')]=_[_0x8106('0x3a')](_0x5c2a5a[_0x8106('0x39')]);_0x34596b['filters']=_[_0x8106('0x3c')](_0x34596b[_0x8106('0x38')],_0x34596b['query']);_0xe558b6[_0x8106('0x3e')]=_[_0x8106('0x3c')](_0x34596b[_0x8106('0x38')],qs['fields'](_0x5c2a5a[_0x8106('0x39')][_0x8106('0x3d')]));_0xe558b6[_0x8106('0x3e')]=_0xe558b6['attributes'][_0x8106('0x3f')]?_0xe558b6['attributes']:_0x34596b[_0x8106('0x38')];if(!_0x5c2a5a[_0x8106('0x39')][_0x8106('0x40')](_0x8106('0x5b'))){_0xe558b6[_0x8106('0x1f')]=qs[_0x8106('0x1f')](_0x5c2a5a['query'][_0x8106('0x1f')]);_0xe558b6[_0x8106('0x22')]=qs[_0x8106('0x22')](_0x5c2a5a[_0x8106('0x39')][_0x8106('0x22')]);}_0xe558b6[_0x8106('0x41')]=qs[_0x8106('0x42')](_0x5c2a5a[_0x8106('0x39')][_0x8106('0x42')]);_0xe558b6['where']=qs['filters'](_[_0x8106('0x43')](_0x5c2a5a[_0x8106('0x39')],_0x34596b['filters']));_0xe558b6[_0x8106('0x44')][_0x8106('0x5c')]=_0xba3ae2['id'];if(_0x5c2a5a[_0x8106('0x39')]['filter']){_0xe558b6[_0x8106('0x44')]=_[_0x8106('0x45')](_0xe558b6[_0x8106('0x44')],{'$or':_[_0x8106('0x33')](_0xe558b6[_0x8106('0x3e')],function(_0x3e74fa){var _0x573721={};_0x573721[_0x3e74fa]={'$like':'%'+_0x5c2a5a[_0x8106('0x39')]['filter']+'%'};return _0x573721;})});}_0xe558b6=_[_0x8106('0x45')]({},_0xe558b6,_0x5c2a5a[_0x8106('0x4e')]);return db['UserWhatsappQueue']['findAll'](_0xe558b6);}})[_0x8106('0x29')](function(_0x55c9b4){if(_0x55c9b4){return db[_0x8106('0x5d')]['findAndCountAll']({'where':{'id':_[_0x8106('0x33')](_0x55c9b4,_0x8106('0x5e')),'role':_0x8106('0x5f')},'attributes':['id','name',_0x8106('0x60'),_0x8106('0x61'),_0x8106('0x62')]});}})[_0x8106('0x29')](function(_0x499a08){if(_0x499a08){return{'count':_0x499a08[_0x8106('0x21')],'rows':_[_0x8106('0x33')](_0x499a08[_0x8106('0x4a')],function(_0x1de9e0){return{'membername':_0x1de9e0[_0x8106('0x30')],'UserId':_0x1de9e0['id'],'queue_name':_0x28ccf6['name'],'WhatsappQueueId':_0x28ccf6['id'],'interface':util[_0x8106('0x63')](_0x8106('0x64'),_0x8106('0x65'),_0x1de9e0['name']),'penalty':0x0,'paused':_0x1de9e0[_0x8106('0x60')],'createdAt':_0x1de9e0[_0x8106('0x62')],'updatedAt':_0x1de9e0[_0x8106('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8106('0x29')](respondWithFilteredResult(_0x2c2206,_0xe558b6))[_0x8106('0x4b')](handleError(_0x2c2206,null));};exports[_0x8106('0x66')]=function(_0x40bfb8,_0x49cd9c,_0x3bfa63){var _0x4769a4={};var _0x3e78f8={};var _0x5a7cdd;var _0x223b86;return db[_0x8106('0x34')][_0x8106('0x59')]({'where':{'id':_0x40bfb8['params']['id']}})[_0x8106('0x29')](handleEntityNotFound(_0x49cd9c,null))['then'](function(_0x5ce526){if(_0x5ce526){_0x5a7cdd=_0x5ce526;_0x3e78f8[_0x8106('0x38')]=_[_0x8106('0x3a')](db[_0x8106('0x67')][_0x8106('0x35')]);_0x3e78f8[_0x8106('0x39')]=_[_0x8106('0x3a')](_0x40bfb8['query']);_0x3e78f8[_0x8106('0x3b')]=_[_0x8106('0x3c')](_0x3e78f8[_0x8106('0x38')],_0x3e78f8[_0x8106('0x39')]);_0x4769a4[_0x8106('0x3e')]=_[_0x8106('0x3c')](_0x3e78f8[_0x8106('0x38')],qs[_0x8106('0x3d')](_0x40bfb8['query'][_0x8106('0x3d')]));_0x4769a4[_0x8106('0x3e')]=_0x4769a4[_0x8106('0x3e')][_0x8106('0x3f')]?_0x4769a4[_0x8106('0x3e')]:_0x3e78f8[_0x8106('0x38')];_0x4769a4[_0x8106('0x41')]=qs[_0x8106('0x42')](_0x40bfb8[_0x8106('0x39')][_0x8106('0x42')]);_0x4769a4[_0x8106('0x44')]=qs[_0x8106('0x3b')](_[_0x8106('0x43')](_0x40bfb8['query'],_0x3e78f8[_0x8106('0x3b')]));if(_0x40bfb8[_0x8106('0x39')][_0x8106('0x68')]){_0x4769a4[_0x8106('0x44')]=_[_0x8106('0x45')](_0x4769a4[_0x8106('0x44')],{'$or':_[_0x8106('0x33')](_0x4769a4[_0x8106('0x3e')],function(_0x12a4bd){var _0x507169={};_0x507169[_0x12a4bd]={'$like':'%'+_0x40bfb8[_0x8106('0x39')][_0x8106('0x68')]+'%'};return _0x507169;})});}_0x4769a4=_[_0x8106('0x45')]({},_0x4769a4,_0x40bfb8['options']);return _0x5a7cdd[_0x8106('0x66')](_0x4769a4);}})[_0x8106('0x29')](function(_0x21e73a){if(_0x21e73a){_0x223b86=_0x21e73a[_0x8106('0x3f')];if(!_0x40bfb8[_0x8106('0x39')][_0x8106('0x40')]('nolimit')){_0x4769a4[_0x8106('0x1f')]=qs['limit'](_0x40bfb8[_0x8106('0x39')][_0x8106('0x1f')]);_0x4769a4[_0x8106('0x22')]=qs[_0x8106('0x22')](_0x40bfb8['query'][_0x8106('0x22')]);}return _0x5a7cdd['getTeams'](_0x4769a4);}})[_0x8106('0x29')](function(_0x1425d9){if(_0x1425d9){return _0x1425d9?{'count':_0x223b86,'rows':_0x1425d9}:null;}})[_0x8106('0x29')](respondWithResult(_0x49cd9c,null))[_0x8106('0x4b')](handleError(_0x49cd9c,null));};exports[_0x8106('0x69')]=function(_0x5a346d,_0x40ebee,_0x7ed69a){var _0x59f0c2=_0x5a346d['body'][_0x8106('0x6a')];return db[_0x8106('0x67')]['findAll']({'where':{'id':_0x59f0c2},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x8106('0x30'),_0x8106('0x6b'),_0x8106('0x6c'),_0x8106('0x6d')],'raw':!![]}]})[_0x8106('0x29')](function(_0x12e842){if(_0x12e842){var _0x1c9e71=_[_0x8106('0x6e')](_0x12e842,function(_0x19eb51){var _0x5aead4=_0x19eb51[_0x8106('0x2a')]({'plain':!![]});return _0x5aead4['Agents'];});return db[_0x8106('0x34')][_0x8106('0x53')]({'where':{'id':_0x5a346d['params']['id']}})[_0x8106('0x29')](function(_0x2cd23c){return db[_0x8106('0x6f')][_0x8106('0x70')](function(_0x205931){return _0x2cd23c['addTeams'](_0x59f0c2,{'transaction':_0x205931})[_0x8106('0x29')](function(){return BPromise[_0x8106('0x71')](_0x1c9e71,function(_0x4813af){return db[_0x8106('0x5a')][_0x8106('0x72')]({'where':{'UserId':_0x4813af['id'],'WhatsappQueueId':_0x5a346d['params']['id']},'transaction':_0x205931});});})[_0x8106('0x29')](function(){_0x1c9e71[_0x8106('0x73')](function(_0xb9fe9a){socket[_0x8106('0x74')](_0x8106('0x75'),{'UserId':_0xb9fe9a['id'],'WhatsappQueueId':_0x2cd23c['id']});});});});});}})[_0x8106('0x29')](respondWithStatusCode(_0x40ebee,null))[_0x8106('0x4b')](handleError(_0x40ebee,null));};exports['removeTeams']=function(_0x3e5dbd,_0x46d9c6,_0x406320){return db[_0x8106('0x67')][_0x8106('0x76')]({'where':{'id':_0x3e5dbd[_0x8106('0x39')][_0x8106('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x8106('0x5d')],'as':_0x8106('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46d9c6,null))['then'](function(_0x76d7cc){var _0x36effa=_[_0x8106('0x33')](_0x76d7cc,'id');var _0x3fc717=[];var _0x2f4237=[];var _0x5d16ac=squel[_0x8106('0x78')]();_0x5d16ac[_0x8106('0x79')](_0x8106('0x7a'))[_0x8106('0x7b')](_0x8106('0x7c'),'tq')[_0x8106('0x7d')](_0x8106('0x7e'),'ut',_0x8106('0x7f'))[_0x8106('0x44')](_0x8106('0x80'),_0x3e5dbd[_0x8106('0x4d')]['id']);for(var _0x58c248=0x0;_0x58c248<_0x76d7cc[_0x8106('0x3f')];_0x58c248+=0x1){let _0x3d238e=_0x76d7cc[_0x58c248];for(var _0x286664=0x0;_0x286664<_0x3d238e[_0x8106('0x77')]['length'];_0x286664+=0x1){let _0x594a8c=_0x3d238e[_0x8106('0x77')][_0x286664];var _0x5074b0=_0x5d16ac['clone']();_0x5074b0[_0x8106('0x44')](_0x8106('0x81'),_0x594a8c['id']);_0x2f4237[_0x8106('0x82')](db[_0x8106('0x6f')]['query'](_0x5074b0[_0x8106('0x83')](),{'type':db['sequelize'][_0x8106('0x84')]['SELECT']})[_0x8106('0x29')](function(_0x57f234){if(_0x57f234[_0x8106('0x3f')]===0x1){return _0x594a8c['id'];}else{var _0x373130=_[_0x8106('0x85')](_['map'](_0x57f234,_0x8106('0x86')),function(_0x2100fe){return _[_0x8106('0x87')](_0x36effa,_0x2100fe);});if(_0x373130){return _0x594a8c['id'];}}}));}}return BPromise[_0x8106('0x88')](_0x2f4237)['then'](function(_0x36022e){_0x3fc717=_(_0x3fc717)['union'](_0x36022e)[_0x8106('0x89')]()[_0x8106('0x8a')]();return db[_0x8106('0x34')][_0x8106('0x53')]({'where':{'id':_0x3e5dbd[_0x8106('0x4d')]['id']}})[_0x8106('0x29')](function(_0x507bcc){return db[_0x8106('0x6f')][_0x8106('0x70')](function(_0x54ac12){return _0x507bcc[_0x8106('0x8b')](_0x3e5dbd[_0x8106('0x39')]['ids'],{'transaction':_0x54ac12})[_0x8106('0x29')](function(){if(!_[_0x8106('0x8c')](_0x3fc717)){return _0x507bcc[_0x8106('0x8d')](_0x3fc717,{'transaction':_0x54ac12});}})[_0x8106('0x29')](function(){_0x3fc717[_0x8106('0x73')](function(_0x2eb661){socket[_0x8106('0x74')](_0x8106('0x8e'),{'UserId':_0x2eb661,'WhatsappQueueId':_0x507bcc['id']});});});});});});})['then'](respondWithStatusCode(_0x46d9c6,null))['catch'](handleError(_0x46d9c6,null));};exports[_0x8106('0x8f')]=function(_0x177d8e,_0x281f29,_0x268334){return db[_0x8106('0x34')]['find']({'where':{'id':_0x177d8e['params']['id']}})[_0x8106('0x29')](handleEntityNotFound(_0x281f29,null))['then'](function(_0x3a6036){if(_0x3a6036){return _0x3a6036[_0x8106('0x8f')](_0x177d8e[_0x8106('0x50')][_0x8106('0x6a')],_[_0x8106('0x90')](_0x177d8e[_0x8106('0x50')],['ids','id'])||{})[_0x8106('0x91')](function(_0x533408){for(var _0x556c3d=0x0;_0x556c3d<_0x177d8e[_0x8106('0x50')][_0x8106('0x6a')][_0x8106('0x3f')];_0x556c3d+=0x1){socket[_0x8106('0x74')](_0x8106('0x75'),{'UserId':Number(_0x177d8e[_0x8106('0x50')][_0x8106('0x6a')][_0x556c3d]),'WhatsappQueueId':Number(_0x177d8e['params']['id'])});}return _0x533408;});}})[_0x8106('0x29')](respondWithResult(_0x281f29,null))['catch'](handleError(_0x281f29,null));};exports[_0x8106('0x8d')]=function(_0x2bccb2,_0x2f167f,_0x294467){return db['WhatsappQueue'][_0x8106('0x53')]({'where':{'id':_0x2bccb2[_0x8106('0x4d')]['id']}})[_0x8106('0x29')](handleEntityNotFound(_0x2f167f,null))[_0x8106('0x29')](function(_0x56b514){if(_0x56b514){return _0x56b514[_0x8106('0x8d')](_0x2bccb2[_0x8106('0x39')][_0x8106('0x6a')])[_0x8106('0x29')](function(){if(_[_0x8106('0x92')](_0x2bccb2[_0x8106('0x39')][_0x8106('0x6a')])){for(var _0xd09941=0x0;_0xd09941<_0x2bccb2[_0x8106('0x39')]['ids'][_0x8106('0x3f')];_0xd09941+=0x1){socket[_0x8106('0x74')](_0x8106('0x8e'),{'UserId':Number(_0x2bccb2[_0x8106('0x39')][_0x8106('0x6a')][_0xd09941]),'WhatsappQueueId':Number(_0x2bccb2['params']['id'])});}}else{socket[_0x8106('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x2bccb2[_0x8106('0x39')]['ids']),'WhatsappQueueId':Number(_0x2bccb2[_0x8106('0x4d')]['id'])});}});}})[_0x8106('0x29')](respondWithStatusCode(_0x2f167f,null))['catch'](handleError(_0x2f167f,null));};exports[_0x8106('0x93')]=function(_0x5a047d,_0xed2197,_0x55fc4d){var _0x425ed7={};var _0x761323={};var _0x314833;var _0x52f301;return db[_0x8106('0x34')]['findOne']({'where':{'id':_0x5a047d['params']['id']}})[_0x8106('0x29')](handleEntityNotFound(_0xed2197,null))[_0x8106('0x29')](function(_0x3dec0b){if(_0x3dec0b){_0x314833=_0x3dec0b;_0x761323[_0x8106('0x38')]=_[_0x8106('0x3a')](db['User']['rawAttributes']);_0x761323['query']=_[_0x8106('0x3a')](_0x5a047d[_0x8106('0x39')]);_0x761323[_0x8106('0x3b')]=_['intersection'](_0x761323[_0x8106('0x38')],_0x761323[_0x8106('0x39')]);_0x425ed7[_0x8106('0x3e')]=_['intersection'](_0x761323['model'],qs[_0x8106('0x3d')](_0x5a047d['query'][_0x8106('0x3d')]));_0x425ed7[_0x8106('0x3e')]=_0x425ed7[_0x8106('0x3e')][_0x8106('0x3f')]?_0x425ed7[_0x8106('0x3e')]:_0x761323[_0x8106('0x38')];_0x425ed7[_0x8106('0x41')]=qs[_0x8106('0x42')](_0x5a047d['query'][_0x8106('0x42')]);_0x425ed7[_0x8106('0x44')]=qs['filters'](_[_0x8106('0x43')](_0x5a047d[_0x8106('0x39')],_0x761323[_0x8106('0x3b')]));if(_0x5a047d[_0x8106('0x39')][_0x8106('0x68')]){_0x425ed7['where']=_[_0x8106('0x45')](_0x425ed7[_0x8106('0x44')],{'$or':_[_0x8106('0x33')](_0x425ed7['attributes'],function(_0x21bd06){var _0x1161e5={};_0x1161e5[_0x21bd06]={'$like':'%'+_0x5a047d[_0x8106('0x39')][_0x8106('0x68')]+'%'};return _0x1161e5;})});}_0x425ed7=_['merge']({},_0x425ed7,_0x5a047d[_0x8106('0x4e')]);return _0x314833[_0x8106('0x93')](_0x425ed7);}})['then'](function(_0x305c60){if(_0x305c60){_0x52f301=_0x305c60[_0x8106('0x3f')];if(!_0x5a047d['query'][_0x8106('0x40')](_0x8106('0x5b'))){_0x425ed7[_0x8106('0x1f')]=qs[_0x8106('0x1f')](_0x5a047d[_0x8106('0x39')]['limit']);_0x425ed7[_0x8106('0x22')]=qs[_0x8106('0x22')](_0x5a047d[_0x8106('0x39')][_0x8106('0x22')]);}return _0x314833[_0x8106('0x93')](_0x425ed7);}})[_0x8106('0x29')](function(_0x2af80c){if(_0x2af80c){return _0x2af80c?{'count':_0x52f301,'rows':_0x2af80c}:null;}})['then'](respondWithResult(_0xed2197,null))[_0x8106('0x4b')](handleError(_0xed2197,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d308362..c34d4b7 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 _0xe6fc=['save','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x34f8de,_0xebc674){var _0x419836=function(_0x1f7103){while(--_0x1f7103){_0x34f8de['push'](_0x34f8de['shift']());}};_0x419836(++_0xebc674);}(_0xe6fc,0x154));var _0xce6f=function(_0x4e3b07,_0x112584){_0x4e3b07=_0x4e3b07-0x0;var _0x39e524=_0xe6fc[_0x4e3b07];return _0x39e524;};'use strict';var EventEmitter=require(_0xce6f('0x0'));var WhatsappQueue=require(_0xce6f('0x1'))['db'][_0xce6f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xce6f('0x3')](0x0);var events={'afterCreate':_0xce6f('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x189b60){return function(_0x58f0da,_0x3a38b3,_0x451b07){WhatsappQueueEvents[_0xce6f('0x5')](_0x189b60+':'+_0x58f0da['id'],_0x58f0da);WhatsappQueueEvents[_0xce6f('0x5')](_0x189b60,_0x58f0da);_0x451b07(null);};}for(var e in events){if(events[_0xce6f('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xce6f('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x766c=['update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x236909,_0x1e08f3){var _0x470645=function(_0x2bcd2f){while(--_0x2bcd2f){_0x236909['push'](_0x236909['shift']());}};_0x470645(++_0x1e08f3);}(_0x766c,0x140));var _0xc766=function(_0x500439,_0x24b02e){_0x500439=_0x500439-0x0;var _0x476501=_0x766c[_0x500439];return _0x476501;};'use strict';var EventEmitter=require(_0xc766('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc766('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc766('0x2'),'afterDestroy':_0xc766('0x3')};function emitEvent(_0x57c0c6){return function(_0x20fdf8,_0x30a068,_0x946e30){WhatsappQueueEvents[_0xc766('0x4')](_0x57c0c6+':'+_0x20fdf8['id'],_0x20fdf8);WhatsappQueueEvents[_0xc766('0x4')](_0x57c0c6,_0x20fdf8);_0x946e30(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xc766('0x5')](e,emitEvent(event));}}module[_0xc766('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 1728f0a..4009a66 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 _0x907b=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x58b506,_0x3718c0){var _0x2b3a4a=function(_0x4b489d){while(--_0x4b489d){_0x58b506['push'](_0x58b506['shift']());}};_0x2b3a4a(++_0x3718c0);}(_0x907b,0x1d3));var _0xb907=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x907b[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require(_0xb907('0x0'));var util=require(_0xb907('0x1'));var logger=require(_0xb907('0x2'))(_0xb907('0x3'));var moment=require(_0xb907('0x4'));var BPromise=require(_0xb907('0x5'));var rp=require(_0xb907('0x6'));var fs=require('fs');var path=require(_0xb907('0x7'));var rimraf=require('rimraf');var config=require(_0xb907('0x8'));var attributes=require(_0xb907('0x9'));module['exports']=function(_0x540f99,_0x497cb4){return _0x540f99[_0xb907('0xa')](_0xb907('0xb'),attributes,{'tableName':_0xb907('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9656=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash'];(function(_0x494b8a,_0x3259ea){var _0x25067b=function(_0x4eb5ff){while(--_0x4eb5ff){_0x494b8a['push'](_0x494b8a['shift']());}};_0x25067b(++_0x3259ea);}(_0x9656,0x13f));var _0x6965=function(_0x2dd67a,_0x17a4f4){_0x2dd67a=_0x2dd67a-0x0;var _0x2ba695=_0x9656[_0x2dd67a];return _0x2ba695;};'use strict';var _=require(_0x6965('0x0'));var util=require(_0x6965('0x1'));var logger=require(_0x6965('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6965('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6965('0x4'));var rimraf=require(_0x6965('0x5'));var config=require(_0x6965('0x6'));var attributes=require(_0x6965('0x7'));module[_0x6965('0x8')]=function(_0x46a385,_0x3b1c7b){return _0x46a385['define']('WhatsappQueue',attributes,{'tableName':_0x6965('0x9'),'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 5caeb8d..bfb9121 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 _0xf4ba=['socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','stringify','ShowWhatsappQueue','find','map','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x58807d,_0x369b2f){var _0x11bdfb=function(_0x42aff5){while(--_0x42aff5){_0x58807d['push'](_0x58807d['shift']());}};_0x11bdfb(++_0x369b2f);}(_0xf4ba,0x198));var _0xaf4b=function(_0x19e2e7,_0x133453){_0x19e2e7=_0x19e2e7-0x0;var _0x52f129=_0xf4ba[_0x19e2e7];return _0x52f129;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaf4b('0x0'));var BPromise=require(_0xaf4b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf4b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf4b('0x3'));var logger=require('../../config/logger')(_0xaf4b('0x4'));var config=require(_0xaf4b('0x5'));var jayson=require(_0xaf4b('0x6'));var client=jayson[_0xaf4b('0x7')]['http']({'port':0x232a});config[_0xaf4b('0x8')]=_['defaults'](config[_0xaf4b('0x8')],{'host':_0xaf4b('0x9'),'port':0x18eb});var socket=require(_0xaf4b('0xa'))(new Redis(config['redis']));require(_0xaf4b('0xb'))[_0xaf4b('0xc')](socket);function respondWithRpcPromise(_0x450703,_0x56f854,_0x460b84){return new BPromise(function(_0x3fb600,_0x3ab98b){return client[_0xaf4b('0xd')](_0x450703,_0x460b84)[_0xaf4b('0xe')](function(_0x5ac8aa){logger['info'](_0xaf4b('0xf'),_0x56f854,_0xaf4b('0x10'));logger[_0xaf4b('0x11')](_0xaf4b('0x12'),_0x56f854,'request\x20sent',JSON['stringify'](_0x5ac8aa));if(_0x5ac8aa[_0xaf4b('0x13')]){if(_0x5ac8aa['error'][_0xaf4b('0x14')]===0x1f4){logger[_0xaf4b('0x13')](_0xaf4b('0xf'),_0x56f854,_0x5ac8aa['error'][_0xaf4b('0x15')]);return _0x3ab98b(_0x5ac8aa[_0xaf4b('0x13')]['message']);}logger[_0xaf4b('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x56f854,_0x5ac8aa[_0xaf4b('0x13')][_0xaf4b('0x15')]);return _0x3fb600(_0x5ac8aa[_0xaf4b('0x13')][_0xaf4b('0x15')]);}else{logger[_0xaf4b('0x16')](_0xaf4b('0xf'),_0x56f854,_0xaf4b('0x10'));_0x3fb600(_0x5ac8aa['result'][_0xaf4b('0x15')]);}})[_0xaf4b('0x17')](function(_0x27fa9d){logger[_0xaf4b('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x56f854,_0x27fa9d);_0x3ab98b(_0x27fa9d);});});}exports[_0xaf4b('0x18')]=function(_0xdb737d){var _0x155966=this;return new Promise(function(_0x38c04b,_0x20bc67){return db[_0xaf4b('0x19')][_0xaf4b('0x1a')]({'raw':_0xdb737d[_0xaf4b('0x1b')]?_0xdb737d[_0xaf4b('0x1b')][_0xaf4b('0x1c')]===undefined?!![]:![]:!![],'where':_0xdb737d[_0xaf4b('0x1b')]?_0xdb737d[_0xaf4b('0x1b')][_0xaf4b('0x1d')]||null:null,'attributes':_0xdb737d['options']?_0xdb737d['options'][_0xaf4b('0x1e')]||null:null,'limit':_0xdb737d[_0xaf4b('0x1b')]?_0xdb737d[_0xaf4b('0x1b')][_0xaf4b('0x1f')]||null:null,'include':_0xdb737d[_0xaf4b('0x1b')]?_0xdb737d['options'][_0xaf4b('0x20')]?_['map'](_0xdb737d['options']['include'],function(_0x3188fe){return{'model':db[_0x3188fe[_0xaf4b('0x21')]],'as':_0x3188fe['as'],'attributes':_0x3188fe[_0xaf4b('0x1e')],'include':_0x3188fe[_0xaf4b('0x20')]?_['map'](_0x3188fe[_0xaf4b('0x20')],function(_0x48c19a){return{'model':db[_0x48c19a[_0xaf4b('0x21')]],'as':_0x48c19a['as'],'attributes':_0x48c19a[_0xaf4b('0x1e')],'include':_0x48c19a['include']?_['map'](_0x48c19a[_0xaf4b('0x20')],function(_0x246a91){return{'model':db[_0x246a91[_0xaf4b('0x21')]],'as':_0x246a91['as'],'attributes':_0x246a91[_0xaf4b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46b8ea){logger['info']('GetWhatsappQueue',_0xdb737d);logger[_0xaf4b('0x11')](_0xaf4b('0x18'),_0xdb737d,JSON[_0xaf4b('0x22')](_0x46b8ea));_0x38c04b(_0x46b8ea);})['catch'](function(_0x529ec0){logger[_0xaf4b('0x13')](_0xaf4b('0x18'),_0x529ec0[_0xaf4b('0x15')],_0xdb737d);_0x20bc67(_0x155966['error'](0x1f4,_0x529ec0[_0xaf4b('0x15')]));});});};exports[_0xaf4b('0x23')]=function(_0x151cb7){var _0x588cc2=this;return new Promise(function(_0xfea3a5,_0x48362b){return db[_0xaf4b('0x19')][_0xaf4b('0x24')]({'raw':_0x151cb7[_0xaf4b('0x1b')]?_0x151cb7['options'][_0xaf4b('0x1c')]===undefined?!![]:![]:!![],'where':_0x151cb7[_0xaf4b('0x1b')]?_0x151cb7[_0xaf4b('0x1b')][_0xaf4b('0x1d')]||null:null,'attributes':_0x151cb7[_0xaf4b('0x1b')]?_0x151cb7[_0xaf4b('0x1b')][_0xaf4b('0x1e')]||null:null,'include':_0x151cb7[_0xaf4b('0x1b')]?_0x151cb7['options'][_0xaf4b('0x20')]?_[_0xaf4b('0x25')](_0x151cb7[_0xaf4b('0x1b')]['include'],function(_0x8ad6ee){return{'model':db[_0x8ad6ee[_0xaf4b('0x21')]],'as':_0x8ad6ee['as'],'attributes':_0x8ad6ee[_0xaf4b('0x1e')],'include':_0x8ad6ee['include']?_[_0xaf4b('0x25')](_0x8ad6ee[_0xaf4b('0x20')],function(_0x13987b){return{'model':db[_0x13987b[_0xaf4b('0x21')]],'as':_0x13987b['as'],'attributes':_0x13987b[_0xaf4b('0x1e')],'include':_0x13987b[_0xaf4b('0x20')]?_['map'](_0x13987b[_0xaf4b('0x20')],function(_0x726d0f){return{'model':db[_0x726d0f[_0xaf4b('0x21')]],'as':_0x726d0f['as'],'attributes':_0x726d0f[_0xaf4b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaf4b('0xe')](function(_0x26d902){logger[_0xaf4b('0x16')](_0xaf4b('0x23'),_0x151cb7);logger[_0xaf4b('0x11')](_0xaf4b('0x23'),_0x151cb7,JSON[_0xaf4b('0x22')](_0x26d902));_0xfea3a5(_0x26d902);})[_0xaf4b('0x17')](function(_0x35e65f){logger[_0xaf4b('0x13')](_0xaf4b('0x23'),_0x35e65f[_0xaf4b('0x15')],_0x151cb7);_0x48362b(_0x588cc2['error'](0x1f4,_0x35e65f['message']));});});}; \ No newline at end of file +var _0xad2a=['catch','WhatsappQueue','options','attributes','limit','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xad2a,0x162));var _0xaad2=function(_0x37ece7,_0x26099){_0x37ece7=_0x37ece7-0x0;var _0x22e308=_0xad2a[_0x37ece7];return _0x22e308;};'use strict';var _=require('lodash');var util=require(_0xaad2('0x0'));var moment=require('moment');var BPromise=require(_0xaad2('0x1'));var rs=require(_0xaad2('0x2'));var fs=require('fs');var Redis=require(_0xaad2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaad2('0x4'));var logger=require('../../config/logger')(_0xaad2('0x5'));var config=require('../../config/environment');var jayson=require(_0xaad2('0x6'));var client=jayson[_0xaad2('0x7')][_0xaad2('0x8')]({'port':0x232a});config['redis']=_[_0xaad2('0x9')](config[_0xaad2('0xa')],{'host':_0xaad2('0xb'),'port':0x18eb});var socket=require(_0xaad2('0xc'))(new Redis(config['redis']));require(_0xaad2('0xd'))[_0xaad2('0xe')](socket);function respondWithRpcPromise(_0x42be23,_0x84e686,_0x8b3ff1){return new BPromise(function(_0x3e7b02,_0x162466){return client[_0xaad2('0xf')](_0x42be23,_0x8b3ff1)[_0xaad2('0x10')](function(_0x3cba80){logger[_0xaad2('0x11')](_0xaad2('0x12'),_0x84e686,_0xaad2('0x13'));logger[_0xaad2('0x14')](_0xaad2('0x15'),_0x84e686,'request\x20sent',JSON[_0xaad2('0x16')](_0x3cba80));if(_0x3cba80['error']){if(_0x3cba80[_0xaad2('0x17')]['code']===0x1f4){logger['error'](_0xaad2('0x12'),_0x84e686,_0x3cba80[_0xaad2('0x17')][_0xaad2('0x18')]);return _0x162466(_0x3cba80['error'][_0xaad2('0x18')]);}logger[_0xaad2('0x17')](_0xaad2('0x12'),_0x84e686,_0x3cba80['error'][_0xaad2('0x18')]);return _0x3e7b02(_0x3cba80[_0xaad2('0x17')][_0xaad2('0x18')]);}else{logger['info'](_0xaad2('0x12'),_0x84e686,'request\x20sent');_0x3e7b02(_0x3cba80[_0xaad2('0x19')][_0xaad2('0x18')]);}})[_0xaad2('0x1a')](function(_0x26326a){logger['error'](_0xaad2('0x12'),_0x84e686,_0x26326a);_0x162466(_0x26326a);});});}exports['GetWhatsappQueue']=function(_0x156316){var _0x5d841d=this;return new Promise(function(_0x559e77,_0x2a2af8){return db[_0xaad2('0x1b')]['findAll']({'raw':_0x156316[_0xaad2('0x1c')]?_0x156316[_0xaad2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x156316[_0xaad2('0x1c')]?_0x156316[_0xaad2('0x1c')]['where']||null:null,'attributes':_0x156316[_0xaad2('0x1c')]?_0x156316[_0xaad2('0x1c')][_0xaad2('0x1d')]||null:null,'limit':_0x156316[_0xaad2('0x1c')]?_0x156316[_0xaad2('0x1c')][_0xaad2('0x1e')]||null:null,'include':_0x156316['options']?_0x156316[_0xaad2('0x1c')][_0xaad2('0x1f')]?_['map'](_0x156316[_0xaad2('0x1c')][_0xaad2('0x1f')],function(_0x411d89){return{'model':db[_0x411d89[_0xaad2('0x20')]],'as':_0x411d89['as'],'attributes':_0x411d89[_0xaad2('0x1d')],'include':_0x411d89[_0xaad2('0x1f')]?_[_0xaad2('0x21')](_0x411d89['include'],function(_0x577cc6){return{'model':db[_0x577cc6[_0xaad2('0x20')]],'as':_0x577cc6['as'],'attributes':_0x577cc6['attributes'],'include':_0x577cc6[_0xaad2('0x1f')]?_[_0xaad2('0x21')](_0x577cc6['include'],function(_0x4e9956){return{'model':db[_0x4e9956[_0xaad2('0x20')]],'as':_0x4e9956['as'],'attributes':_0x4e9956['attributes']};}):[]};}):[]};}):[]:[]})[_0xaad2('0x10')](function(_0x206c77){logger[_0xaad2('0x11')](_0xaad2('0x22'),_0x156316);logger[_0xaad2('0x14')](_0xaad2('0x22'),_0x156316,JSON[_0xaad2('0x16')](_0x206c77));_0x559e77(_0x206c77);})['catch'](function(_0x4a2bb1){logger[_0xaad2('0x17')]('GetWhatsappQueue',_0x4a2bb1[_0xaad2('0x18')],_0x156316);_0x2a2af8(_0x5d841d[_0xaad2('0x17')](0x1f4,_0x4a2bb1['message']));});});};exports[_0xaad2('0x23')]=function(_0xba5294){var _0x4af7cc=this;return new Promise(function(_0x56d129,_0x1c6783){return db[_0xaad2('0x1b')][_0xaad2('0x24')]({'raw':_0xba5294[_0xaad2('0x1c')]?_0xba5294[_0xaad2('0x1c')][_0xaad2('0x25')]===undefined?!![]:![]:!![],'where':_0xba5294[_0xaad2('0x1c')]?_0xba5294['options']['where']||null:null,'attributes':_0xba5294[_0xaad2('0x1c')]?_0xba5294[_0xaad2('0x1c')][_0xaad2('0x1d')]||null:null,'include':_0xba5294[_0xaad2('0x1c')]?_0xba5294[_0xaad2('0x1c')][_0xaad2('0x1f')]?_[_0xaad2('0x21')](_0xba5294[_0xaad2('0x1c')]['include'],function(_0x514d92){return{'model':db[_0x514d92[_0xaad2('0x20')]],'as':_0x514d92['as'],'attributes':_0x514d92[_0xaad2('0x1d')],'include':_0x514d92[_0xaad2('0x1f')]?_[_0xaad2('0x21')](_0x514d92[_0xaad2('0x1f')],function(_0x309025){return{'model':db[_0x309025['model']],'as':_0x309025['as'],'attributes':_0x309025['attributes'],'include':_0x309025['include']?_[_0xaad2('0x21')](_0x309025['include'],function(_0x21a199){return{'model':db[_0x21a199[_0xaad2('0x20')]],'as':_0x21a199['as'],'attributes':_0x21a199['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5202be){logger[_0xaad2('0x11')](_0xaad2('0x23'),_0xba5294);logger[_0xaad2('0x14')](_0xaad2('0x23'),_0xba5294,JSON['stringify'](_0x5202be));_0x56d129(_0x5202be);})[_0xaad2('0x1a')](function(_0x59493f){logger[_0xaad2('0x17')]('ShowWhatsappQueue',_0x59493f[_0xaad2('0x18')],_0xba5294);_0x1c6783(_0x4af7cc[_0xaad2('0x17')](0x1f4,_0x59493f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e728387..29391a2 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 _0x7d41=['removeListener','register','length','whatsappQueue:','save'];(function(_0x25a0d0,_0x192f46){var _0x13f8a0=function(_0x1bd906){while(--_0x1bd906){_0x25a0d0['push'](_0x25a0d0['shift']());}};_0x13f8a0(++_0x192f46);}(_0x7d41,0xa4));var _0x17d4=function(_0x3bdb4f,_0x11555e){_0x3bdb4f=_0x3bdb4f-0x0;var _0x4811c0=_0x7d41[_0x3bdb4f];return _0x4811c0;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x17d4('0x0'),'remove','update'];function createListener(_0x26e447,_0x35fe56){return function(_0x5cca37){_0x35fe56['emit'](_0x26e447,_0x5cca37);};}function removeListener(_0x16a5a6,_0x1f1ea5){return function(){WhatsappQueueEvents[_0x17d4('0x1')](_0x16a5a6,_0x1f1ea5);};}exports[_0x17d4('0x2')]=function(_0x168330){for(var _0xab1737=0x0,_0x56c8c1=events[_0x17d4('0x3')];_0xab1737<_0x56c8c1;_0xab1737++){var _0x134f03=events[_0xab1737];var _0xb68ea8=createListener(_0x17d4('0x4')+_0x134f03,_0x168330);WhatsappQueueEvents['on'](_0x134f03,_0xb68ea8);}}; \ No newline at end of file +var _0xb065=['register','whatsappQueue:','save','remove','emit','removeListener'];(function(_0x68c4d9,_0x419b3c){var _0x62da93=function(_0x51ae9a){while(--_0x51ae9a){_0x68c4d9['push'](_0x68c4d9['shift']());}};_0x62da93(++_0x419b3c);}(_0xb065,0x1b2));var _0x5b06=function(_0x2586dd,_0x1ffebb){_0x2586dd=_0x2586dd-0x0;var _0x7fc21e=_0xb065[_0x2586dd];return _0x7fc21e;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x5b06('0x0'),_0x5b06('0x1'),'update'];function createListener(_0x333b11,_0x47ec51){return function(_0x5b28a3){_0x47ec51[_0x5b06('0x2')](_0x333b11,_0x5b28a3);};}function removeListener(_0x3026f2,_0x42d4f1){return function(){WhatsappQueueEvents[_0x5b06('0x3')](_0x3026f2,_0x42d4f1);};}exports[_0x5b06('0x4')]=function(_0x420e98){for(var _0x4f7915=0x0,_0x870993=events['length'];_0x4f7915<_0x870993;_0x4f7915++){var _0x2a0e3f=events[_0x4f7915];var _0x19cf66=createListener(_0x5b06('0x5')+_0x2a0e3f,_0x420e98);WhatsappQueueEvents['on'](_0x2a0e3f,_0x19cf66);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 4046444..46b24e0 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 _0xab74=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','delete','exports','multer','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xab74,0x1eb));var _0x4ab7=function(_0x338676,_0x43516a){_0x338676=_0x338676-0x0;var _0xa36cc5=_0xab74[_0x338676];return _0xa36cc5;};'use strict';var multer=require(_0x4ab7('0x0'));var util=require(_0x4ab7('0x1'));var path=require('path');var timeout=require(_0x4ab7('0x2'));var express=require('express');var router=express[_0x4ab7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ab7('0x4'));var config=require(_0x4ab7('0x5'));var controller=require(_0x4ab7('0x6'));router[_0x4ab7('0x7')]('/',auth[_0x4ab7('0x8')](),controller[_0x4ab7('0x9')]);router[_0x4ab7('0x7')](_0x4ab7('0xa'),auth[_0x4ab7('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4ab7('0xb')]);router[_0x4ab7('0xc')]('/',auth[_0x4ab7('0x8')](),controller['create']);router[_0x4ab7('0xd')](_0x4ab7('0xe'),auth[_0x4ab7('0x8')](),controller['update']);router[_0x4ab7('0xf')](_0x4ab7('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4ab7('0x10')]=router; \ No newline at end of file +var _0xbeda=['put','/:id','destroy','exports','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','get','/describe','isAuthenticated','describe','show','post','create'];(function(_0x4cd0fe,_0x1b079f){var _0x1f8fef=function(_0x19aeef){while(--_0x19aeef){_0x4cd0fe['push'](_0x4cd0fe['shift']());}};_0x1f8fef(++_0x1b079f);}(_0xbeda,0x1a2));var _0xabed=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0xbeda[_0x1e6e4e];return _0x3d746b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xabed('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xabed('0x1'));var auth=require(_0xabed('0x2'));var interaction=require(_0xabed('0x3'));var config=require(_0xabed('0x4'));var controller=require(_0xabed('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xabed('0x6')]);router[_0xabed('0x7')](_0xabed('0x8'),auth[_0xabed('0x9')](),controller[_0xabed('0xa')]);router[_0xabed('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xabed('0xb')]);router[_0xabed('0xc')]('/',auth['isAuthenticated'](),controller[_0xabed('0xd')]);router[_0xabed('0xe')](_0xabed('0xf'),auth[_0xabed('0x9')](),controller['update']);router['delete'](_0xabed('0xf'),auth[_0xabed('0x9')](),controller[_0xabed('0x10')]);module[_0xabed('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 d40f04b..dcd1add 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x461f68,_0x2cfd4b){var _0x4fffa3=function(_0xea905a){while(--_0xea905a){_0x461f68['push'](_0x461f68['shift']());}};_0x4fffa3(++_0x2cfd4b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5f5190,_0x34597f){var _0x2a2a97=function(_0x242134){while(--_0x242134){_0x5f5190['push'](_0x5f5190['shift']());}};_0x2a2a97(++_0x34597f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index ca0fdca..6b41be8 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 _0x3266=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model'];(function(_0x5b992e,_0x100f37){var _0x4c9027=function(_0x247216){while(--_0x247216){_0x5b992e['push'](_0x5b992e['shift']());}};_0x4c9027(++_0x100f37);}(_0x3266,0x6a));var _0x6326=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3266[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['WhatsappQueueReport'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['WhatsappQueueReport'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['WhatsappQueueReport'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));};exports[_0x6326('0x4d')]=function(_0x5040b1,_0xaa4c9d){return db[_0x6326('0x2d')][_0x6326('0x4d')]()[_0x6326('0x25')](respondWithResult(_0xaa4c9d,null))['catch'](handleError(_0xaa4c9d,null));}; \ No newline at end of file +var _0xe1e3=['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','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x22907a,_0x34ca37){_0x22907a=_0x22907a-0x0;var _0x469e28=_0xe1e3[_0x22907a];return _0x469e28;};'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(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8684cdd..c9e5806 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 _0x46a6=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa9585c,_0x3dcd14){var _0x2b32bf=function(_0x611e4f){while(--_0x611e4f){_0xa9585c['push'](_0xa9585c['shift']());}};_0x2b32bf(++_0x3dcd14);}(_0x46a6,0x152));var _0x646a=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x46a6[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0x646a('0x0'));var util=require(_0x646a('0x1'));var logger=require('../../config/logger')(_0x646a('0x2'));var moment=require(_0x646a('0x3'));var BPromise=require(_0x646a('0x4'));var rp=require(_0x646a('0x5'));var fs=require('fs');var path=require(_0x646a('0x6'));var rimraf=require(_0x646a('0x7'));var config=require(_0x646a('0x8'));var attributes=require(_0x646a('0x9'));module[_0x646a('0xa')]=function(_0x27d33e,_0x455a3f){return _0x27d33e[_0x646a('0xb')](_0x646a('0xc'),attributes,{'tableName':_0x646a('0xd'),'paranoid':![],'indexes':[{'name':_0x646a('0xe'),'fields':[_0x646a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a61=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x36f99f,_0x10dfa2){var _0x85cb3b=function(_0x26d6b7){while(--_0x26d6b7){_0x36f99f['push'](_0x36f99f['shift']());}};_0x85cb3b(++_0x10dfa2);}(_0x5a61,0x8d));var _0x15a6=function(_0xbabc40,_0x301922){_0xbabc40=_0xbabc40-0x0;var _0x22cc4b=_0x5a61[_0xbabc40];return _0x22cc4b;};'use strict';var _=require(_0x15a6('0x0'));var util=require(_0x15a6('0x1'));var logger=require(_0x15a6('0x2'))('api');var moment=require(_0x15a6('0x3'));var BPromise=require(_0x15a6('0x4'));var rp=require(_0x15a6('0x5'));var fs=require('fs');var path=require(_0x15a6('0x6'));var rimraf=require(_0x15a6('0x7'));var config=require(_0x15a6('0x8'));var attributes=require(_0x15a6('0x9'));module[_0x15a6('0xa')]=function(_0x7fd67,_0x544510){return _0x7fd67['define'](_0x15a6('0xb'),attributes,{'tableName':_0x15a6('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x15a6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2eb6b2d..52b5ec2 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 _0xb2d8=['message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','debug','UpdateWhatsappQueueReport','update','options','raw','where','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0xb2d8,0x6b));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8b2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8b2d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b2d('0x2'));var db=require(_0x8b2d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b2d('0x4'))(_0x8b2d('0x5'));var config=require(_0x8b2d('0x6'));var jayson=require(_0x8b2d('0x7'));var client=jayson['client'][_0x8b2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39251b,_0x476453,_0x490b11){return new BPromise(function(_0x391374,_0x5893f9){return client[_0x8b2d('0x9')](_0x39251b,_0x490b11)[_0x8b2d('0xa')](function(_0x3ad3e6){logger[_0x8b2d('0xb')](_0x8b2d('0xc'),_0x476453,_0x8b2d('0xd'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x476453,'request\x20sent',JSON[_0x8b2d('0xe')](_0x3ad3e6));if(_0x3ad3e6[_0x8b2d('0xf')]){if(_0x3ad3e6[_0x8b2d('0xf')][_0x8b2d('0x10')]===0x1f4){logger[_0x8b2d('0xf')](_0x8b2d('0xc'),_0x476453,_0x3ad3e6[_0x8b2d('0xf')][_0x8b2d('0x11')]);return _0x5893f9(_0x3ad3e6[_0x8b2d('0xf')][_0x8b2d('0x11')]);}logger[_0x8b2d('0xf')](_0x8b2d('0xc'),_0x476453,_0x3ad3e6[_0x8b2d('0xf')][_0x8b2d('0x11')]);return _0x391374(_0x3ad3e6['error'][_0x8b2d('0x11')]);}else{logger['info'](_0x8b2d('0xc'),_0x476453,_0x8b2d('0xd'));_0x391374(_0x3ad3e6[_0x8b2d('0x12')][_0x8b2d('0x11')]);}})[_0x8b2d('0x13')](function(_0x30cec1){logger['error'](_0x8b2d('0xc'),_0x476453,_0x30cec1);_0x5893f9(_0x30cec1);});});}exports[_0x8b2d('0x14')]=function(_0x51920c){var _0x58a0be=this;return new Promise(function(_0x2ce35c,_0x2a3522){return db[_0x8b2d('0x15')][_0x8b2d('0x16')](_0x51920c[_0x8b2d('0x17')],{'raw':_0x51920c['options']?_0x51920c['options']['raw']===undefined?!![]:![]:!![]})[_0x8b2d('0xa')](function(_0x1e065f){logger[_0x8b2d('0xb')]('CreateWhatsappQueueReport',_0x51920c);logger[_0x8b2d('0x18')](_0x8b2d('0x14'),_0x51920c,JSON[_0x8b2d('0xe')](_0x1e065f));_0x2ce35c(_0x1e065f);})[_0x8b2d('0x13')](function(_0x10e490){logger[_0x8b2d('0xf')](_0x8b2d('0x14'),_0x10e490[_0x8b2d('0x11')],_0x51920c);_0x2a3522(_0x58a0be[_0x8b2d('0xf')](0x1f4,_0x10e490[_0x8b2d('0x11')]));});});};exports[_0x8b2d('0x19')]=function(_0x1be095){var _0x149a8e=this;return new Promise(function(_0x50b164,_0x272d65){return db[_0x8b2d('0x15')][_0x8b2d('0x1a')](_0x1be095[_0x8b2d('0x17')],{'raw':_0x1be095['options']?_0x1be095[_0x8b2d('0x1b')][_0x8b2d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1be095[_0x8b2d('0x1b')]?_0x1be095['options'][_0x8b2d('0x1d')]||null:null,'attributes':_0x1be095[_0x8b2d('0x1b')]?_0x1be095[_0x8b2d('0x1b')][_0x8b2d('0x1e')]||null:null,'limit':_0x1be095[_0x8b2d('0x1b')]?_0x1be095[_0x8b2d('0x1b')]['limit']||null:null})[_0x8b2d('0xa')](function(_0xa7a8c2){logger[_0x8b2d('0xb')](_0x8b2d('0x19'),_0x1be095);logger[_0x8b2d('0x18')](_0x8b2d('0x19'),_0x1be095,JSON[_0x8b2d('0xe')](_0xa7a8c2));_0x50b164(_0xa7a8c2);})['catch'](function(_0x562e85){logger[_0x8b2d('0xf')](_0x8b2d('0x19'),_0x562e85[_0x8b2d('0x11')],_0x1be095);_0x272d65(_0x149a8e[_0x8b2d('0xf')](0x1f4,_0x562e85[_0x8b2d('0x11')]));});});}; \ No newline at end of file +var _0xbb8d=['WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','request\x20sent','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch'];(function(_0x330e33,_0x2d94fb){var _0x8b0d80=function(_0x3da5b4){while(--_0x3da5b4){_0x330e33['push'](_0x330e33['shift']());}};_0x8b0d80(++_0x2d94fb);}(_0xbb8d,0x103));var _0xdbb8=function(_0x37bf86,_0x2ecbda){_0x37bf86=_0x37bf86-0x0;var _0xff24cc=_0xbb8d[_0x37bf86];return _0xff24cc;};'use strict';var _=require(_0xdbb8('0x0'));var util=require(_0xdbb8('0x1'));var moment=require('moment');var BPromise=require(_0xdbb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbb8('0x3'));var db=require(_0xdbb8('0x4'))['db'];var utils=require(_0xdbb8('0x5'));var logger=require(_0xdbb8('0x6'))('rpc');var config=require(_0xdbb8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdbb8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ae178,_0x5d3dfa,_0x441ea1){return new BPromise(function(_0x2b5f34,_0x4e1f2e){return client[_0xdbb8('0x9')](_0x4ae178,_0x441ea1)[_0xdbb8('0xa')](function(_0x20deb5){logger[_0xdbb8('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d3dfa,'request\x20sent');logger[_0xdbb8('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5d3dfa,_0xdbb8('0xd'),JSON[_0xdbb8('0xe')](_0x20deb5));if(_0x20deb5[_0xdbb8('0xf')]){if(_0x20deb5[_0xdbb8('0xf')][_0xdbb8('0x10')]===0x1f4){logger[_0xdbb8('0xf')](_0xdbb8('0x11'),_0x5d3dfa,_0x20deb5[_0xdbb8('0xf')][_0xdbb8('0x12')]);return _0x4e1f2e(_0x20deb5[_0xdbb8('0xf')]['message']);}logger['error'](_0xdbb8('0x11'),_0x5d3dfa,_0x20deb5[_0xdbb8('0xf')][_0xdbb8('0x12')]);return _0x2b5f34(_0x20deb5[_0xdbb8('0xf')][_0xdbb8('0x12')]);}else{logger[_0xdbb8('0xb')](_0xdbb8('0x11'),_0x5d3dfa,_0xdbb8('0xd'));_0x2b5f34(_0x20deb5['result'][_0xdbb8('0x12')]);}})[_0xdbb8('0x13')](function(_0x193da9){logger[_0xdbb8('0xf')](_0xdbb8('0x11'),_0x5d3dfa,_0x193da9);_0x4e1f2e(_0x193da9);});});}exports['CreateWhatsappQueueReport']=function(_0x49ba06){var _0x26ef7c=this;return new Promise(function(_0x485068,_0x1d518b){return db[_0xdbb8('0x14')][_0xdbb8('0x15')](_0x49ba06[_0xdbb8('0x16')],{'raw':_0x49ba06[_0xdbb8('0x17')]?_0x49ba06[_0xdbb8('0x17')][_0xdbb8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3aa45a){logger['info'](_0xdbb8('0x19'),_0x49ba06);logger[_0xdbb8('0xc')](_0xdbb8('0x19'),_0x49ba06,JSON[_0xdbb8('0xe')](_0x3aa45a));_0x485068(_0x3aa45a);})[_0xdbb8('0x13')](function(_0x2d757e){logger[_0xdbb8('0xf')](_0xdbb8('0x19'),_0x2d757e[_0xdbb8('0x12')],_0x49ba06);_0x1d518b(_0x26ef7c[_0xdbb8('0xf')](0x1f4,_0x2d757e['message']));});});};exports[_0xdbb8('0x1a')]=function(_0x34eaf8){var _0x360667=this;return new Promise(function(_0x411193,_0x2f7738){return db[_0xdbb8('0x14')][_0xdbb8('0x1b')](_0x34eaf8[_0xdbb8('0x16')],{'raw':_0x34eaf8[_0xdbb8('0x17')]?_0x34eaf8[_0xdbb8('0x17')][_0xdbb8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34eaf8[_0xdbb8('0x17')]?_0x34eaf8[_0xdbb8('0x17')][_0xdbb8('0x1c')]||null:null,'attributes':_0x34eaf8[_0xdbb8('0x17')]?_0x34eaf8[_0xdbb8('0x17')][_0xdbb8('0x1d')]||null:null,'limit':_0x34eaf8['options']?_0x34eaf8[_0xdbb8('0x17')][_0xdbb8('0x1e')]||null:null})[_0xdbb8('0xa')](function(_0x1cc3cd){logger['info'](_0xdbb8('0x1a'),_0x34eaf8);logger[_0xdbb8('0xc')]('UpdateWhatsappQueueReport',_0x34eaf8,JSON[_0xdbb8('0xe')](_0x1cc3cd));_0x411193(_0x1cc3cd);})[_0xdbb8('0x13')](function(_0x5eacda){logger[_0xdbb8('0xf')](_0xdbb8('0x1a'),_0x5eacda['message'],_0x34eaf8);_0x2f7738(_0x360667['error'](0x1f4,_0x5eacda['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 2071880..b7362f3 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 _0xc2f5=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','create','put','delete','destroy'];(function(_0x5bc0a8,_0x27931b){var _0x217a0a=function(_0x42abbc){while(--_0x42abbc){_0x5bc0a8['push'](_0x5bc0a8['shift']());}};_0x217a0a(++_0x27931b);}(_0xc2f5,0xac));var _0x5c2f=function(_0x4570d5,_0x115f91){_0x4570d5=_0x4570d5-0x0;var _0x314a34=_0xc2f5[_0x4570d5];return _0x314a34;};'use strict';var multer=require(_0x5c2f('0x0'));var util=require('util');var path=require(_0x5c2f('0x1'));var timeout=require(_0x5c2f('0x2'));var express=require(_0x5c2f('0x3'));var router=express['Router']();var fs_extra=require(_0x5c2f('0x4'));var auth=require(_0x5c2f('0x5'));var interaction=require(_0x5c2f('0x6'));var config=require('../../config/environment');var controller=require(_0x5c2f('0x7'));router[_0x5c2f('0x8')]('/',auth['isAuthenticated'](),controller[_0x5c2f('0x9')]);router['get'](_0x5c2f('0xa'),auth['isAuthenticated'](),controller[_0x5c2f('0xb')]);router[_0x5c2f('0x8')]('/:id',auth[_0x5c2f('0xc')](),controller[_0x5c2f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5c2f('0xe')]);router[_0x5c2f('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5c2f('0x10')]('/:id',auth[_0x5c2f('0xc')](),controller[_0x5c2f('0x11')]);module[_0x5c2f('0x12')]=router; \ No newline at end of file +var _0xc59a=['isAuthenticated','index','/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x28bfd6,_0x545841){var _0x4bb1d9=function(_0xa3b7e8){while(--_0xa3b7e8){_0x28bfd6['push'](_0x28bfd6['shift']());}};_0x4bb1d9(++_0x545841);}(_0xc59a,0x8d));var _0xac59=function(_0x37745f,_0x30f62b){_0x37745f=_0x37745f-0x0;var _0x551786=_0xc59a[_0x37745f];return _0x551786;};'use strict';var multer=require(_0xac59('0x0'));var util=require(_0xac59('0x1'));var path=require(_0xac59('0x2'));var timeout=require(_0xac59('0x3'));var express=require(_0xac59('0x4'));var router=express[_0xac59('0x5')]();var fs_extra=require(_0xac59('0x6'));var auth=require(_0xac59('0x7'));var interaction=require(_0xac59('0x8'));var config=require(_0xac59('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0xac59('0xa')]('/',auth[_0xac59('0xb')](),controller[_0xac59('0xc')]);router['get'](_0xac59('0xd'),auth[_0xac59('0xb')](),controller[_0xac59('0xe')]);router[_0xac59('0xa')](_0xac59('0xf'),auth[_0xac59('0xb')](),controller[_0xac59('0x10')]);router['post']('/',auth[_0xac59('0xb')](),controller['create']);router[_0xac59('0x11')](_0xac59('0xf'),auth[_0xac59('0xb')](),controller[_0xac59('0x12')]);router['delete'](_0xac59('0xf'),auth[_0xac59('0xb')](),controller['destroy']);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 8172bad..7fd6988 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 _0x80cd=['account','agent','queue','DATE','exports','STRING','ENUM'];(function(_0x196f40,_0x417e6e){var _0x544d7b=function(_0x46c19c){while(--_0x46c19c){_0x196f40['push'](_0x196f40['shift']());}};_0x544d7b(++_0x417e6e);}(_0x80cd,0x146));var _0xd80c=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x80cd[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'uniqueid':{'type':Sequelize[_0xd80c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd80c('0x2')](_0xd80c('0x3'),_0xd80c('0x4'),_0xd80c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd80c('0x6')]}}; \ No newline at end of file +var _0x5ba3=['queue','DATE','sequelize','STRING','ENUM','agent'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x5ba3,0x140));var _0x35ba=function(_0x542641,_0x26f155){_0x542641=_0x542641-0x0;var _0x18732a=_0x5ba3[_0x542641];return _0x18732a;};'use strict';var Sequelize=require(_0x35ba('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x35ba('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x35ba('0x2')]('account',_0x35ba('0x3'),_0x35ba('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x35ba('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index be26e67..1565265 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 _0x094c=['length','merge','options','find','create','update','body','destroy','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','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/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','pick','filter','includeAll','include','findAll','rows','catch','show','params'];(function(_0x279522,_0x497270){var _0xc6071d=function(_0x505793){while(--_0x505793){_0x279522['push'](_0x279522['shift']());}};_0xc6071d(++_0x497270);}(_0x094c,0x131));var _0xc094=function(_0x2c73fa,_0x41b660){_0x2c73fa=_0x2c73fa-0x0;var _0x201374=_0x094c[_0x2c73fa];return _0x201374;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){_0x249a32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa85298,_0x5f335b){return function(_0x890669){if(!_0x890669){_0xa85298[_0xc094('0x18')](0x194);}return _0x890669;};}function handleError(_0x37a89a,_0x31ceb6){_0x31ceb6=_0x31ceb6||0x1f4;return function(_0x3ba703){logger[_0xc094('0x25')](_0x3ba703[_0xc094('0x26')]);if(_0x3ba703[_0xc094('0x27')]){delete _0x3ba703[_0xc094('0x27')];}_0x37a89a[_0xc094('0x19')](_0x31ceb6)['send'](_0x3ba703);};}exports[_0xc094('0x28')]=function(_0x1936f3,_0x4d9b0d){var _0xc9aef7={},_0x1d1849={},_0x365e56={'count':0x0,'rows':[]};var _0x358c0d=_[_0xc094('0x29')](db[_0xc094('0x2a')][_0xc094('0x2b')],function(_0x27614c){return{'name':_0x27614c['fieldName'],'type':_0x27614c[_0xc094('0x2c')]['key']};});_0x1d1849['model']=_[_0xc094('0x29')](_0x358c0d,_0xc094('0x27'));_0x1d1849[_0xc094('0x2d')]=_[_0xc094('0x2e')](_0x1936f3[_0xc094('0x2d')]);_0x1d1849[_0xc094('0x2f')]=_[_0xc094('0x30')](_0x1d1849['model'],_0x1d1849['query']);_0xc9aef7[_0xc094('0x31')]=_[_0xc094('0x30')](_0x1d1849['model'],qs['fields'](_0x1936f3[_0xc094('0x2d')][_0xc094('0x32')]));_0xc9aef7['attributes']=_0xc9aef7[_0xc094('0x31')]['length']?_0xc9aef7[_0xc094('0x31')]:_0x1d1849[_0xc094('0x33')];if(!_0x1936f3[_0xc094('0x2d')][_0xc094('0x34')](_0xc094('0x35'))){_0xc9aef7['limit']=qs[_0xc094('0x1d')](_0x1936f3[_0xc094('0x2d')]['limit']);_0xc9aef7[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x1936f3[_0xc094('0x2d')][_0xc094('0x1b')]);}_0xc9aef7[_0xc094('0x36')]=qs[_0xc094('0x37')](_0x1936f3[_0xc094('0x2d')]['sort']);_0xc9aef7['where']=qs[_0xc094('0x2f')](_[_0xc094('0x38')](_0x1936f3[_0xc094('0x2d')],_0x1d1849[_0xc094('0x2f')]),_0x358c0d);if(_0x1936f3['query'][_0xc094('0x39')]){_0xc9aef7['where']=_['merge'](_0xc9aef7['where'],{'$or':_['map'](_0x358c0d,function(_0x434ca2){if(_0x434ca2[_0xc094('0x2c')]!=='VIRTUAL'){var _0x4c61c4={};_0x4c61c4[_0x434ca2[_0xc094('0x27')]]={'$like':'%'+_0x1936f3[_0xc094('0x2d')][_0xc094('0x39')]+'%'};return _0x4c61c4;}})});}_0xc9aef7=_['merge']({},_0xc9aef7,_0x1936f3['options']);var _0x2406cc={'where':_0xc9aef7['where']};return db[_0xc094('0x2a')][_0xc094('0x1e')](_0x2406cc)[_0xc094('0x24')](function(_0x4a1261){_0x365e56[_0xc094('0x1e')]=_0x4a1261;if(_0x1936f3[_0xc094('0x2d')][_0xc094('0x3a')]){_0xc9aef7[_0xc094('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xc094('0x3c')](_0xc9aef7);})[_0xc094('0x24')](function(_0x109a09){_0x365e56[_0xc094('0x3d')]=_0x109a09;return _0x365e56;})[_0xc094('0x24')](respondWithFilteredResult(_0x4d9b0d,_0xc9aef7))[_0xc094('0x3e')](handleError(_0x4d9b0d,null));};exports[_0xc094('0x3f')]=function(_0x5867e1,_0x2e0dde){var _0x488a9a={'raw':!![],'where':{'id':_0x5867e1[_0xc094('0x40')]['id']}},_0x5082df={};_0x5082df['model']=_[_0xc094('0x2e')](db[_0xc094('0x2a')][_0xc094('0x2b')]);_0x5082df[_0xc094('0x2d')]=_[_0xc094('0x2e')](_0x5867e1[_0xc094('0x2d')]);_0x5082df['filters']=_[_0xc094('0x30')](_0x5082df[_0xc094('0x33')],_0x5082df['query']);_0x488a9a[_0xc094('0x31')]=_['intersection'](_0x5082df['model'],qs[_0xc094('0x32')](_0x5867e1[_0xc094('0x2d')][_0xc094('0x32')]));_0x488a9a[_0xc094('0x31')]=_0x488a9a['attributes'][_0xc094('0x41')]?_0x488a9a[_0xc094('0x31')]:_0x5082df[_0xc094('0x33')];if(_0x5867e1[_0xc094('0x2d')]['includeAll']){_0x488a9a[_0xc094('0x3b')]=[{'all':!![]}];}_0x488a9a=_[_0xc094('0x42')]({},_0x488a9a,_0x5867e1[_0xc094('0x43')]);return db[_0xc094('0x2a')][_0xc094('0x44')](_0x488a9a)[_0xc094('0x24')](handleEntityNotFound(_0x2e0dde,null))['then'](respondWithResult(_0x2e0dde,null))['catch'](handleError(_0x2e0dde,null));};exports[_0xc094('0x45')]=function(_0x53ac8a,_0x27c0fd){return db['WhatsappTransferReport'][_0xc094('0x45')](_0x53ac8a['body'],{})[_0xc094('0x24')](respondWithResult(_0x27c0fd,0xc9))['catch'](handleError(_0x27c0fd,null));};exports[_0xc094('0x46')]=function(_0x56dc51,_0x46aa3b){if(_0x56dc51[_0xc094('0x47')]['id']){delete _0x56dc51[_0xc094('0x47')]['id'];}return db[_0xc094('0x2a')]['find']({'where':{'id':_0x56dc51[_0xc094('0x40')]['id']}})['then'](handleEntityNotFound(_0x46aa3b,null))[_0xc094('0x24')](saveUpdates(_0x56dc51[_0xc094('0x47')],null))[_0xc094('0x24')](respondWithResult(_0x46aa3b,null))[_0xc094('0x3e')](handleError(_0x46aa3b,null));};exports[_0xc094('0x48')]=function(_0xb7ba29,_0x1ef65d){return db[_0xc094('0x2a')][_0xc094('0x44')]({'where':{'id':_0xb7ba29[_0xc094('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ef65d,null))[_0xc094('0x24')](removeEntity(_0x1ef65d,null))['catch'](handleError(_0x1ef65d,null));};exports[_0xc094('0x49')]=function(_0x45326e,_0x61d25e){return db['WhatsappTransferReport'][_0xc094('0x49')]()[_0xc094('0x24')](respondWithResult(_0x61d25e,null))[_0xc094('0x3e')](handleError(_0x61d25e,null));}; \ No newline at end of file +var _0x6401=['destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','find','create','body'];(function(_0x38d52c,_0x39fee1){var _0xbcbec3=function(_0x201d84){while(--_0x201d84){_0x38d52c['push'](_0x38d52c['shift']());}};_0xbcbec3(++_0x39fee1);}(_0x6401,0x93));var _0x1640=function(_0x517bf8,_0x403453){_0x517bf8=_0x517bf8-0x0;var _0x3a4041=_0x6401[_0x517bf8];return _0x3a4041;};'use strict';var emlformat=require(_0x1640('0x0'));var rimraf=require(_0x1640('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1640('0x2'));var rp=require(_0x1640('0x3'));var moment=require(_0x1640('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1640('0x5'));var csv=require(_0x1640('0x6'));var ejs=require(_0x1640('0x7'));var fs=require('fs');var fs_extra=require(_0x1640('0x8'));var _=require(_0x1640('0x9'));var squel=require(_0x1640('0xa'));var crypto=require(_0x1640('0xb'));var jsforce=require(_0x1640('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1640('0x6'));var querystring=require('querystring');var Papa=require(_0x1640('0xd'));var Redis=require(_0x1640('0xe'));var authService=require(_0x1640('0xf'));var qs=require(_0x1640('0x10'));var as=require(_0x1640('0x11'));var hardwareService=require(_0x1640('0x12'));var logger=require(_0x1640('0x13'))(_0x1640('0x14'));var utils=require(_0x1640('0x15'));var config=require(_0x1640('0x16'));var licenseUtil=require(_0x1640('0x17'));var db=require(_0x1640('0x18'))['db'];function respondWithStatusCode(_0x26967e,_0x1e9c52){_0x1e9c52=_0x1e9c52||0xcc;return function(_0x330db6){if(_0x330db6){return _0x26967e['sendStatus'](_0x1e9c52);}return _0x26967e[_0x1640('0x19')](_0x1e9c52)[_0x1640('0x1a')]();};}function respondWithResult(_0x5e9336,_0x5774cf){_0x5774cf=_0x5774cf||0xc8;return function(_0x3bf143){if(_0x3bf143){return _0x5e9336[_0x1640('0x19')](_0x5774cf)[_0x1640('0x1b')](_0x3bf143);}};}function respondWithFilteredResult(_0xac0f23,_0x13ac35){return function(_0x4c36ef){if(_0x4c36ef){var _0x3668e0=typeof _0x13ac35['offset']===_0x1640('0x1c')&&typeof _0x13ac35[_0x1640('0x1d')]===_0x1640('0x1c');var _0x56427f=_0x4c36ef[_0x1640('0x1e')];var _0x4499ce=_0x3668e0?0x0:_0x13ac35[_0x1640('0x1f')];var _0xd33a92=_0x3668e0?_0x4c36ef[_0x1640('0x1e')]:_0x13ac35[_0x1640('0x1f')]+_0x13ac35[_0x1640('0x1d')];var _0x4714c9;if(_0xd33a92>=_0x56427f){_0xd33a92=_0x56427f;_0x4714c9=0xc8;}else{_0x4714c9=0xce;}_0xac0f23[_0x1640('0x19')](_0x4714c9);return _0xac0f23['set'](_0x1640('0x20'),_0x4499ce+'-'+_0xd33a92+'/'+_0x56427f)[_0x1640('0x1b')](_0x4c36ef);}return null;};}function patchUpdates(_0x2b5993){return function(_0x3f2b37){try{jsonpatch[_0x1640('0x21')](_0x3f2b37,_0x2b5993,!![]);}catch(_0x380906){return BPromise[_0x1640('0x22')](_0x380906);}return _0x3f2b37[_0x1640('0x23')]();};}function saveUpdates(_0x341530,_0x2b42af){return function(_0x5763d6){if(_0x5763d6){return _0x5763d6[_0x1640('0x24')](_0x341530)[_0x1640('0x25')](function(_0x2d89bf){return _0x2d89bf;});}return null;};}function removeEntity(_0x2caecd,_0x6e8758){return function(_0x23ca6a){if(_0x23ca6a){return _0x23ca6a['destroy']()[_0x1640('0x25')](function(){_0x2caecd[_0x1640('0x19')](0xcc)[_0x1640('0x1a')]();});}};}function handleEntityNotFound(_0x387d32,_0x143817){return function(_0x15e21f){if(!_0x15e21f){_0x387d32[_0x1640('0x26')](0x194);}return _0x15e21f;};}function handleError(_0x20348c,_0x25e9af){_0x25e9af=_0x25e9af||0x1f4;return function(_0x4ead55){logger[_0x1640('0x27')](_0x4ead55['stack']);if(_0x4ead55[_0x1640('0x28')]){delete _0x4ead55['name'];}_0x20348c['status'](_0x25e9af)[_0x1640('0x29')](_0x4ead55);};}exports['index']=function(_0x2d0abc,_0x308515){var _0x6bbb71={},_0x395328={},_0x4885fe={'count':0x0,'rows':[]};var _0x3d756c=_[_0x1640('0x2a')](db[_0x1640('0x2b')][_0x1640('0x2c')],function(_0x3e769c){return{'name':_0x3e769c[_0x1640('0x2d')],'type':_0x3e769c['type']['key']};});_0x395328['model']=_[_0x1640('0x2a')](_0x3d756c,_0x1640('0x28'));_0x395328[_0x1640('0x2e')]=_[_0x1640('0x2f')](_0x2d0abc[_0x1640('0x2e')]);_0x395328[_0x1640('0x30')]=_[_0x1640('0x31')](_0x395328[_0x1640('0x32')],_0x395328[_0x1640('0x2e')]);_0x6bbb71[_0x1640('0x33')]=_[_0x1640('0x31')](_0x395328[_0x1640('0x32')],qs[_0x1640('0x34')](_0x2d0abc[_0x1640('0x2e')][_0x1640('0x34')]));_0x6bbb71['attributes']=_0x6bbb71[_0x1640('0x33')][_0x1640('0x35')]?_0x6bbb71[_0x1640('0x33')]:_0x395328['model'];if(!_0x2d0abc['query'][_0x1640('0x36')](_0x1640('0x37'))){_0x6bbb71[_0x1640('0x1d')]=qs[_0x1640('0x1d')](_0x2d0abc[_0x1640('0x2e')][_0x1640('0x1d')]);_0x6bbb71[_0x1640('0x1f')]=qs['offset'](_0x2d0abc['query'][_0x1640('0x1f')]);}_0x6bbb71['order']=qs[_0x1640('0x38')](_0x2d0abc['query'][_0x1640('0x38')]);_0x6bbb71[_0x1640('0x39')]=qs[_0x1640('0x30')](_[_0x1640('0x3a')](_0x2d0abc[_0x1640('0x2e')],_0x395328[_0x1640('0x30')]),_0x3d756c);if(_0x2d0abc['query'][_0x1640('0x3b')]){_0x6bbb71[_0x1640('0x39')]=_['merge'](_0x6bbb71[_0x1640('0x39')],{'$or':_[_0x1640('0x2a')](_0x3d756c,function(_0x5dca8c){if(_0x5dca8c[_0x1640('0x3c')]!==_0x1640('0x3d')){var _0x1136e2={};_0x1136e2[_0x5dca8c['name']]={'$like':'%'+_0x2d0abc[_0x1640('0x2e')]['filter']+'%'};return _0x1136e2;}})});}_0x6bbb71=_[_0x1640('0x3e')]({},_0x6bbb71,_0x2d0abc[_0x1640('0x3f')]);var _0x392956={'where':_0x6bbb71[_0x1640('0x39')]};return db['WhatsappTransferReport'][_0x1640('0x1e')](_0x392956)[_0x1640('0x25')](function(_0x17781e){_0x4885fe['count']=_0x17781e;if(_0x2d0abc['query'][_0x1640('0x40')]){_0x6bbb71['include']=[{'all':!![]}];}return db[_0x1640('0x2b')][_0x1640('0x41')](_0x6bbb71);})[_0x1640('0x25')](function(_0x40740a){_0x4885fe['rows']=_0x40740a;return _0x4885fe;})[_0x1640('0x25')](respondWithFilteredResult(_0x308515,_0x6bbb71))[_0x1640('0x42')](handleError(_0x308515,null));};exports[_0x1640('0x43')]=function(_0x38c809,_0x3ca2a4){var _0x221e26={'raw':!![],'where':{'id':_0x38c809[_0x1640('0x44')]['id']}},_0x40a7c9={};_0x40a7c9['model']=_[_0x1640('0x2f')](db[_0x1640('0x2b')][_0x1640('0x2c')]);_0x40a7c9['query']=_[_0x1640('0x2f')](_0x38c809[_0x1640('0x2e')]);_0x40a7c9[_0x1640('0x30')]=_[_0x1640('0x31')](_0x40a7c9['model'],_0x40a7c9[_0x1640('0x2e')]);_0x221e26[_0x1640('0x33')]=_[_0x1640('0x31')](_0x40a7c9[_0x1640('0x32')],qs[_0x1640('0x34')](_0x38c809[_0x1640('0x2e')]['fields']));_0x221e26['attributes']=_0x221e26['attributes']['length']?_0x221e26['attributes']:_0x40a7c9[_0x1640('0x32')];if(_0x38c809[_0x1640('0x2e')][_0x1640('0x40')]){_0x221e26['include']=[{'all':!![]}];}_0x221e26=_[_0x1640('0x3e')]({},_0x221e26,_0x38c809[_0x1640('0x3f')]);return db[_0x1640('0x2b')][_0x1640('0x45')](_0x221e26)[_0x1640('0x25')](handleEntityNotFound(_0x3ca2a4,null))[_0x1640('0x25')](respondWithResult(_0x3ca2a4,null))[_0x1640('0x42')](handleError(_0x3ca2a4,null));};exports[_0x1640('0x46')]=function(_0x23cd7e,_0x192245){return db[_0x1640('0x2b')][_0x1640('0x46')](_0x23cd7e['body'],{})[_0x1640('0x25')](respondWithResult(_0x192245,0xc9))[_0x1640('0x42')](handleError(_0x192245,null));};exports[_0x1640('0x24')]=function(_0x341b8b,_0x3dc789){if(_0x341b8b['body']['id']){delete _0x341b8b[_0x1640('0x47')]['id'];}return db[_0x1640('0x2b')][_0x1640('0x45')]({'where':{'id':_0x341b8b['params']['id']}})['then'](handleEntityNotFound(_0x3dc789,null))[_0x1640('0x25')](saveUpdates(_0x341b8b[_0x1640('0x47')],null))['then'](respondWithResult(_0x3dc789,null))['catch'](handleError(_0x3dc789,null));};exports[_0x1640('0x48')]=function(_0x2d229f,_0x3a924e){return db[_0x1640('0x2b')][_0x1640('0x45')]({'where':{'id':_0x2d229f[_0x1640('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a924e,null))[_0x1640('0x25')](removeEntity(_0x3a924e,null))[_0x1640('0x42')](handleError(_0x3a924e,null));};exports['describe']=function(_0x5d1929,_0x345d8c){return db[_0x1640('0x2b')]['describe']()[_0x1640('0x25')](respondWithResult(_0x345d8c,null))[_0x1640('0x42')](handleError(_0x345d8c,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ae98c43..3abfb1a 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 _0x7fb1=['request-promise','path','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x1a80bb,_0x2fe16a){var _0x5f0ce1=function(_0x135be0){while(--_0x135be0){_0x1a80bb['push'](_0x1a80bb['shift']());}};_0x5f0ce1(++_0x2fe16a);}(_0x7fb1,0x68));var _0x17fb=function(_0x1371d1,_0x4381a0){_0x1371d1=_0x1371d1-0x0;var _0x445eb4=_0x7fb1[_0x1371d1];return _0x445eb4;};'use strict';var _=require('lodash');var util=require(_0x17fb('0x0'));var logger=require(_0x17fb('0x1'))(_0x17fb('0x2'));var moment=require(_0x17fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x17fb('0x4'));var fs=require('fs');var path=require(_0x17fb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17fb('0x6'));module[_0x17fb('0x7')]=function(_0x5d003f,_0x1ff93c){return _0x5d003f[_0x17fb('0x8')](_0x17fb('0x9'),attributes,{'tableName':_0x17fb('0xa'),'paranoid':![],'indexes':[{'name':_0x17fb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf6f=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x1139ec,_0x16d6fa){var _0x17a47a=function(_0x11424a){while(--_0x11424a){_0x1139ec['push'](_0x1139ec['shift']());}};_0x17a47a(++_0x16d6fa);}(_0xdf6f,0x1eb));var _0xfdf6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xdf6f[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xfdf6('0x0'));var util=require(_0xfdf6('0x1'));var logger=require(_0xfdf6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfdf6('0x3'));var rp=require(_0xfdf6('0x4'));var fs=require('fs');var path=require(_0xfdf6('0x5'));var rimraf=require(_0xfdf6('0x6'));var config=require(_0xfdf6('0x7'));var attributes=require(_0xfdf6('0x8'));module[_0xfdf6('0x9')]=function(_0x1d4e36,_0x20dc3f){return _0x1d4e36[_0xfdf6('0xa')](_0xfdf6('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xfdf6('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index a0f89f9..0ae8d3f 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 _0xecba=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','request\x20sent'];(function(_0x59d004,_0x503ce4){var _0x2865e1=function(_0x340ab7){while(--_0x340ab7){_0x59d004['push'](_0x59d004['shift']());}};_0x2865e1(++_0x503ce4);}(_0xecba,0x1ec));var _0xaecb=function(_0x57d85d,_0x2ab830){_0x57d85d=_0x57d85d-0x0;var _0x15a992=_0xecba[_0x57d85d];return _0x15a992;};'use strict';var _=require(_0xaecb('0x0'));var util=require(_0xaecb('0x1'));var moment=require(_0xaecb('0x2'));var BPromise=require(_0xaecb('0x3'));var rs=require(_0xaecb('0x4'));var fs=require('fs');var Redis=require(_0xaecb('0x5'));var db=require(_0xaecb('0x6'))['db'];var utils=require(_0xaecb('0x7'));var logger=require(_0xaecb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaecb('0x9'));var client=jayson[_0xaecb('0xa')][_0xaecb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137db0,_0x344f28,_0x344697){return new BPromise(function(_0x487708,_0x27b625){return client['request'](_0x137db0,_0x344697)[_0xaecb('0xc')](function(_0x183e2f){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x344f28,_0xaecb('0xd'));logger[_0xaecb('0xe')](_0xaecb('0xf'),_0x344f28,'request\x20sent',JSON[_0xaecb('0x10')](_0x183e2f));if(_0x183e2f[_0xaecb('0x11')]){if(_0x183e2f[_0xaecb('0x11')]['code']===0x1f4){logger[_0xaecb('0x11')](_0xaecb('0x12'),_0x344f28,_0x183e2f[_0xaecb('0x11')][_0xaecb('0x13')]);return _0x27b625(_0x183e2f[_0xaecb('0x11')][_0xaecb('0x13')]);}logger['error'](_0xaecb('0x12'),_0x344f28,_0x183e2f[_0xaecb('0x11')][_0xaecb('0x13')]);return _0x487708(_0x183e2f[_0xaecb('0x11')][_0xaecb('0x13')]);}else{logger[_0xaecb('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x344f28,_0xaecb('0xd'));_0x487708(_0x183e2f[_0xaecb('0x15')][_0xaecb('0x13')]);}})['catch'](function(_0xa5696e){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x344f28,_0xa5696e);_0x27b625(_0xa5696e);});});} \ No newline at end of file +var _0xd3d7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10d618,_0x1f1c82){var _0x57d044=function(_0x52c55b){while(--_0x52c55b){_0x10d618['push'](_0x10d618['shift']());}};_0x57d044(++_0x1f1c82);}(_0xd3d7,0x170));var _0x7d3d=function(_0x3a3541,_0x35e76e){_0x3a3541=_0x3a3541-0x0;var _0x151f5a=_0xd3d7[_0x3a3541];return _0x151f5a;};'use strict';var _=require('lodash');var util=require(_0x7d3d('0x0'));var moment=require(_0x7d3d('0x1'));var BPromise=require(_0x7d3d('0x2'));var rs=require(_0x7d3d('0x3'));var fs=require('fs');var Redis=require(_0x7d3d('0x4'));var db=require(_0x7d3d('0x5'))['db'];var utils=require(_0x7d3d('0x6'));var logger=require(_0x7d3d('0x7'))(_0x7d3d('0x8'));var config=require(_0x7d3d('0x9'));var jayson=require(_0x7d3d('0xa'));var client=jayson[_0x7d3d('0xb')][_0x7d3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f254b,_0x1fd71c,_0x260e35){return new BPromise(function(_0x17ff02,_0x5c4821){return client['request'](_0x5f254b,_0x260e35)[_0x7d3d('0xd')](function(_0x5d2752){logger[_0x7d3d('0xe')](_0x7d3d('0xf'),_0x1fd71c,'request\x20sent');logger[_0x7d3d('0x10')](_0x7d3d('0x11'),_0x1fd71c,'request\x20sent',JSON['stringify'](_0x5d2752));if(_0x5d2752['error']){if(_0x5d2752[_0x7d3d('0x12')][_0x7d3d('0x13')]===0x1f4){logger[_0x7d3d('0x12')](_0x7d3d('0xf'),_0x1fd71c,_0x5d2752['error']['message']);return _0x5c4821(_0x5d2752[_0x7d3d('0x12')][_0x7d3d('0x14')]);}logger[_0x7d3d('0x12')](_0x7d3d('0xf'),_0x1fd71c,_0x5d2752[_0x7d3d('0x12')][_0x7d3d('0x14')]);return _0x17ff02(_0x5d2752[_0x7d3d('0x12')][_0x7d3d('0x14')]);}else{logger[_0x7d3d('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1fd71c,'request\x20sent');_0x17ff02(_0x5d2752['result'][_0x7d3d('0x14')]);}})[_0x7d3d('0x15')](function(_0x56421e){logger[_0x7d3d('0x12')](_0x7d3d('0xf'),_0x1fd71c,_0x56421e);_0x5c4821(_0x56421e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 609edad..1bf8da0 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6334=['map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','filter','join','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','seedDB','default','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x6334,0x119));var _0x4633=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x6334[_0x4d7379];return _0x46d7cf;};'use strict';var _=require(_0x4633('0x0'));var db=require(_0x4633('0x1'))['db'];var seedDb=require(_0x4633('0x2'));var checkLicense=require(_0x4633('0x3'));var rpc=require(_0x4633('0x4'));var config=require(_0x4633('0x5'));var logger=require('./config/logger')(_0x4633('0x6'));var pm2=require(_0x4633('0x7'));var pm2Config=require(_0x4633('0x8'));var schedule=require(_0x4633('0x9'));var chat=require(_0x4633('0xa'));var whatsapp=require(_0x4633('0xb'));var transcribe=require(_0x4633('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x4633('0xd')]['sync']()[_0x4633('0xe')](function(){if(config[_0x4633('0xf')]){return seedDb['default']();}})[_0x4633('0xe')](function(){return checkLicense[_0x4633('0x10')]();})[_0x4633('0xe')](function(){return rpc['listen']();})[_0x4633('0xe')](function(_0x2f07fa){logger['info'](_0x2f07fa);return chat[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return whatsapp[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return schedule['start']();})[_0x4633('0xe')](function(){return transcribe[_0x4633('0x11')]();})[_0x4633('0xe')](function(){return provider['start']();})['then'](function(_0x49f5c3){logger[_0x4633('0x12')](_0x49f5c3);return pm2[_0x4633('0x11')](pm2Config);})['then'](function(_0x52955e){var _0x1d967e=_0x52955e['filter'](function(_0xcdffcc){return typeof _0xcdffcc[_0x4633('0x13')]===_0x4633('0x14')&&_0xcdffcc[_0x4633('0x13')]>=0x0;});if(_0x1d967e['length']>0x0){throw new Error(_0x1d967e[_0x4633('0x15')]+_0x4633('0x16')+_[_0x4633('0x17')](_0x1d967e,function(_0x4ffad5){return'\x22'+_0x4ffad5[_0x4633('0x18')][_0x4633('0x19')]+'\x22';}));}logger[_0x4633('0x12')](_0x4633('0x1a'),_[_0x4633('0x17')](_['filter'](_0x52955e,{'status':_0x4633('0x1b')}),_0x4633('0x19'))['join']());logger['info'](_0x4633('0x1c'),_['map'](_[_0x4633('0x1d')](_0x52955e,function(_0x5b5011){return _0x5b5011['status']!==_0x4633('0x1b');}),_0x4633('0x19'))[_0x4633('0x1e')]()||_0x4633('0x1f'));console[_0x4633('0x20')](_0x4633('0x21'));})['catch'](function(_0x2b1976){console['log'](_0x4633('0x22'),_0x2b1976);logger[_0x4633('0x23')](_0x4633('0x24'),_0x2b1976);process[_0x4633('0x25')](0x1);});}main(); \ No newline at end of file +var _0xcee8=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','Offline\x20apps:','status','join','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x144c33,_0x38e36a){var _0x172fa7=function(_0xadf615){while(--_0xadf615){_0x144c33['push'](_0x144c33['shift']());}};_0x172fa7(++_0x38e36a);}(_0xcee8,0xb1));var _0x8cee=function(_0x49fec7,_0xb34582){_0x49fec7=_0x49fec7-0x0;var _0x239419=_0xcee8[_0x49fec7];return _0x239419;};'use strict';var _=require(_0x8cee('0x0'));var db=require(_0x8cee('0x1'))['db'];var seedDb=require(_0x8cee('0x2'));var checkLicense=require(_0x8cee('0x3'));var rpc=require(_0x8cee('0x4'));var config=require(_0x8cee('0x5'));var logger=require('./config/logger')(_0x8cee('0x6'));var pm2=require(_0x8cee('0x7'));var pm2Config=require(_0x8cee('0x8'));var schedule=require(_0x8cee('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x8cee('0xa'));var transcribe=require(_0x8cee('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0x8cee('0xc')]()['then'](function(){if(config[_0x8cee('0xd')]){return seedDb[_0x8cee('0xe')]();}})[_0x8cee('0xf')](function(){return checkLicense[_0x8cee('0xe')]();})['then'](function(){return rpc[_0x8cee('0x10')]();})[_0x8cee('0xf')](function(_0x4c09d7){logger[_0x8cee('0x11')](_0x4c09d7);return chat[_0x8cee('0x12')]();})['then'](function(){return whatsapp[_0x8cee('0x12')]();})['then'](function(){return schedule[_0x8cee('0x12')]();})[_0x8cee('0xf')](function(){return transcribe[_0x8cee('0x12')]();})[_0x8cee('0xf')](function(){return provider['start']();})['then'](function(_0x2cebdf){logger[_0x8cee('0x11')](_0x2cebdf);return pm2[_0x8cee('0x12')](pm2Config);})[_0x8cee('0xf')](function(_0xedc808){var _0x9d7853=_0xedc808[_0x8cee('0x13')](function(_0x3c3694){return typeof _0x3c3694[_0x8cee('0x14')]===_0x8cee('0x15')&&_0x3c3694[_0x8cee('0x14')]>=0x0;});if(_0x9d7853[_0x8cee('0x16')]>0x0){throw new Error(_0x9d7853[_0x8cee('0x16')]+_0x8cee('0x17')+_[_0x8cee('0x18')](_0x9d7853,function(_0x5f53e3){return'\x22'+_0x5f53e3[_0x8cee('0x19')]['name']+'\x22';}));}logger['info'](_0x8cee('0x1a'),_[_0x8cee('0x18')](_[_0x8cee('0x13')](_0xedc808,{'status':_0x8cee('0x1b')}),_0x8cee('0x1c'))['join']());logger[_0x8cee('0x11')](_0x8cee('0x1d'),_[_0x8cee('0x18')](_['filter'](_0xedc808,function(_0x31dbd5){return _0x31dbd5[_0x8cee('0x1e')]!=='online';}),'name')[_0x8cee('0x1f')]()||'None');console['log']('App\x20Ready!');})['catch'](function(_0x2d4ad6){console['log'](_0x8cee('0x20'),_0x2d4ad6);logger['error'](_0x8cee('0x21'),_0x2d4ad6);process[_0x8cee('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7415ce5..cffa5cc 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 _0x5ff8=['hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','startsWith','Basic','User','find','pass','Wrong\x20credentials.','headers','authorization','query','getUuid','apikey','sub','allowedLoginAttempts','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','split','length','splice','unshift','encryptString','promisify','sign','secrets','payload','options','verify','toString'];(function(_0x7e0e97,_0xe23012){var _0x51b36e=function(_0x374f65){while(--_0x374f65){_0x7e0e97['push'](_0x7e0e97['shift']());}};_0x51b36e(++_0xe23012);}(_0x5ff8,0xfc));var _0x85ff=function(_0x4c1a48,_0x9ad372){_0x4c1a48=_0x4c1a48-0x0;var _0xee8412=_0x5ff8[_0x4c1a48];return _0xee8412;};'use strict';var db=require(_0x85ff('0x0'))['db'];var config=require(_0x85ff('0x1'));var hardwareConf=require(_0x85ff('0x2'));var licenseUtil=require(_0x85ff('0x3'));var encryptor=require(_0x85ff('0x4'));var _=require(_0x85ff('0x5'));var jwt=require(_0x85ff('0x6'));var expressJwt=require(_0x85ff('0x7'));var compose=require(_0x85ff('0x8'));var basicAuth=require(_0x85ff('0x9'));var crypto=require(_0x85ff('0xa'));var BPromise=require(_0x85ff('0xb'));var util=require('util');var moment=require(_0x85ff('0xc'));var validateJwt=expressJwt({'secret':config['secrets'][_0x85ff('0xd')]});var userAttributes=['id',_0x85ff('0xe'),'fullname',_0x85ff('0xf'),_0x85ff('0x10'),'email','userpic',_0x85ff('0x11'),_0x85ff('0x12'),_0x85ff('0x13'),_0x85ff('0x14'),_0x85ff('0x15'),_0x85ff('0x16'),'smsPause','openchannelPause',_0x85ff('0x17'),_0x85ff('0x18'),_0x85ff('0x19'),_0x85ff('0x1a'),_0x85ff('0x1b'),_0x85ff('0x1c'),_0x85ff('0x1d'),_0x85ff('0x1e'),_0x85ff('0x1f'),'phoneBarAutoAnswerDelay',_0x85ff('0x20'),_0x85ff('0x21'),_0x85ff('0x22'),_0x85ff('0x23'),_0x85ff('0x24'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0x85ff('0x25'),'interface','userProfileId',_0x85ff('0x26'),_0x85ff('0x27'),'wssPort',_0x85ff('0x28'),'downloadOmnichannelInteractions',_0x85ff('0x29'),_0x85ff('0x2a'),_0x85ff('0x2b')];exports[_0x85ff('0x2c')]=function(){return this['isAuthenticated'](!![])[_0x85ff('0x2d')](function(_0x34ac5e,_0x602042,_0x3f3467){if(_0x34ac5e[_0x85ff('0x2e')]){_0x3f3467();}else{return db[_0x85ff('0x2f')][_0x85ff('0x30')]({'where':{'id':_0x34ac5e[_0x85ff('0x31')]['id']},'attributes':['id',_0x85ff('0x32'),_0x85ff('0x33')],'raw':!![]})[_0x85ff('0x34')](function(_0x49926f){if(_0x49926f&&_0x49926f['closed']){return _0x602042[_0x85ff('0x35')](_0x49926f[_0x85ff('0x33')]===_0x85ff('0x36')?0x195:0x193)[_0x85ff('0x37')]({'message':_0x49926f[_0x85ff('0x33')]===_0x85ff('0x36')?'Unmanaged.':_0x85ff('0x38')});}else{_0x3f3467();}})[_0x85ff('0x39')](function(_0x1f0365){_0x3f3467(_0x1f0365);});}});};exports['isAuthenticated']=function isAuthenticated(_0x372d66){return compose()[_0x85ff('0x2d')](function(_0x15066f,_0x3ad6b9,_0x3d904e){var _0x5978a6;if(_0x15066f['headers']['authorization']){if(_[_0x85ff('0x3a')](_0x15066f['headers']['authorization'],_0x85ff('0x3b'))){var _0x46be8d=basicAuth(_0x15066f);db[_0x85ff('0x3c')][_0x85ff('0x3d')]({'where':{'name':_0x46be8d[_0x85ff('0xf')]}})[_0x85ff('0x34')](function(_0x21b97d){if(!_0x21b97d||!_0x21b97d['authenticate'](_0x46be8d[_0x85ff('0x3e')])){return _0x3ad6b9['status'](0x191)['json']({'message':_0x85ff('0x3f')});}_0x15066f[_0x85ff('0x2e')]={'id':_0x21b97d['id']};_0x3d904e();})[_0x85ff('0x39')](function(_0x3c71d2){_0x3d904e(_0x3c71d2);});}else if(_[_0x85ff('0x3a')](_0x15066f[_0x85ff('0x40')][_0x85ff('0x41')],'Bearer')){validateJwt(_0x15066f,_0x3ad6b9,_0x3d904e);}else{if(_0x372d66){_0x3d904e();}else{return _0x3ad6b9['status'](0x193)[_0x85ff('0x37')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x15066f[_0x85ff('0x42')]['apikey']){try{var _0x2f05ec={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x85ff('0x43')]()};verifyJwt(_0x15066f['query'][_0x85ff('0x44')],_0x2f05ec)[_0x85ff('0x34')](function(_0x24691a){return db[_0x85ff('0x3c')][_0x85ff('0x3d')]({'where':{'id':_0x24691a[_0x85ff('0x45')]}})['then'](function(_0x166606){_0x5978a6=_0x166606;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x85ff('0x46'),'blockDuration'],'raw':!![]});})[_0x85ff('0x34')](function(_0x492bed){if(!_0x5978a6||!_['isEqual'](_0x5978a6['apiKeyNonce'],_0x24691a[_0x85ff('0x47')])){return _0x3ad6b9['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5978a6[_0x85ff('0x48')]){return _0x3ad6b9[_0x85ff('0x35')](0x191)[_0x85ff('0x37')]({'message':_0x85ff('0x49')});}if(_0x5978a6[_0x85ff('0x4a')]){if(_0x492bed[_0x85ff('0x4b')]>0x0){if(moment(_0x5978a6['blockedAt'])[_0x85ff('0x4c')](_0x492bed[_0x85ff('0x4b')],_0x85ff('0x4d'))>moment()){return _0x3ad6b9[_0x85ff('0x35')](0x191)[_0x85ff('0x37')]({'message':_0x85ff('0x49')});}}else{return _0x3ad6b9[_0x85ff('0x35')](0x191)['json']({'message':_0x85ff('0x49')});}}_0x15066f['user']={'id':_0x5978a6['id']};_0x3d904e();});})[_0x85ff('0x39')](function(){return _0x3ad6b9[_0x85ff('0x35')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2a1084){_0x3d904e(_0x2a1084);}}else if(_0x372d66){_0x3d904e();}else{return _0x3ad6b9[_0x85ff('0x35')](0x193)[_0x85ff('0x37')]({'message':'Unknown\x20authorization\x20format'});}})[_0x85ff('0x2d')](function(_0x4d09a3,_0x49a139,_0x2951db){if(_0x4d09a3['user']){db['User'][_0x85ff('0x3d')]({'where':{'id':_0x4d09a3[_0x85ff('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0x1da0a7){if(!_0x1da0a7){return _0x49a139['status'](0x194)['json']({'message':_0x85ff('0x4e')});}_0x4d09a3[_0x85ff('0x2e')]=_0x1da0a7;_0x2951db();})[_0x85ff('0x39')](function(_0x2b5b9d){_0x2951db(_0x2b5b9d);});}else if(_0x372d66){_0x2951db();}else{return _0x49a139[_0x85ff('0x35')](0x194)[_0x85ff('0x37')]({'message':_0x85ff('0x4f')});}});};exports[_0x85ff('0x50')]=function canUpdate(){return compose()[_0x85ff('0x2d')](function(_0x3fbe19,_0x432346,_0x21f09c){return licenseUtil[_0x85ff('0x51')]()['then'](function(_0x6e2aa1){if(_0x6e2aa1[_0x85ff('0x52')]){_0x21f09c();}else{return _0x432346['status'](0x193)[_0x85ff('0x37')]({'message':_0x85ff('0x53')});}})[_0x85ff('0x39')](function(_0x45b672){_0x21f09c(_0x45b672);});});};exports[_0x85ff('0x54')]=function isWebrtcLicence(){return compose()[_0x85ff('0x2d')](function(_0xca199d,_0x15b5e9,_0x888b7c){return licenseUtil[_0x85ff('0x51')]()['then'](function(_0x3fcc28){if(_0x3fcc28[_0x85ff('0x55')]){_0x888b7c();}else{return _0x15b5e9[_0x85ff('0x35')](0x193)['json']({'message':_0x85ff('0x53')});}})[_0x85ff('0x39')](function(_0x49dad6){_0x888b7c(_0x49dad6);});});};exports['isMiddleware']=function(_0x31d299,_0x3ebe82,_0x306f60){_0x31d299[_0x85ff('0x56')]=!![];return _0x306f60();};exports[_0x85ff('0x57')]=function signToken(_0x3d8294){return signJwt(_0x3d8294);};exports['setTokenCookie']=function(_0x3dc69d,_0x37b04e){if(!_0x3dc69d[_0x85ff('0x2e')]){return _0x37b04e[_0x85ff('0x35')](0x194)[_0x85ff('0x37')]({'message':_0x85ff('0x58')});}var _0x54321c={'payload':{'id':_0x3dc69d[_0x85ff('0x2e')]['id'],'role':_0x3dc69d[_0x85ff('0x2e')][_0x85ff('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x54321c)['then'](function(_0x4164b5){_0x37b04e[_0x85ff('0x59')](_0x85ff('0x5a'),_0x4164b5);_0x37b04e[_0x85ff('0x5b')](_0x85ff('0x5c'));})[_0x85ff('0x39')](function(_0x570b10){return _0x37b04e['status'](0x1f4)[_0x85ff('0x5d')](_0x570b10);});};exports[_0x85ff('0x5e')]=function(_0x129cb0){if(_[_0x85ff('0x5f')](_0x129cb0['apiKeyNonce'])||_['isNil'](_0x129cb0['apiKeyIat'])){return null;}else{return createJwt(_0x129cb0);}};exports['generateApiKey']=function(_0x1c3b75){_0x1c3b75[_0x85ff('0x60')]=generateNonce();_0x1c3b75['apiKeyIat']=generateIssuedAt();return createJwt(_0x1c3b75);};exports['regenerateApiKey']=function(_0x132dd4,_0x13c82e){var _0x33873a=_0x132dd4[_0x85ff('0x42')][_0x85ff('0x44')];if(_0x33873a){var _0x28da6b={'nonce':_0x13c82e[_0x85ff('0x60')],'iat':_0x13c82e[_0x85ff('0x61')],'audience':hardwareConf[_0x85ff('0x43')](),'issuer':hardwareConf[_0x85ff('0x43')]()};return verifyJwt(_0x33873a,_0x28da6b)[_0x85ff('0x34')](function(){return generateApiKey(_0x13c82e);});}else{throw{'message':_0x85ff('0x62')};}};exports['validatePasswordPattern']=function(_0x4559c8){var _0x1e7cc2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1e7cc2[_0x85ff('0x63')](_0x4559c8))throw new db[(_0x85ff('0x64'))]['ValidationError'](_0x85ff('0x65'));return;};exports['validatePasswordHistory']=function(_0x452be4,_0x1f3446,_0x183c4c){var _0x14a642=encryptor['decryptString'](_0x1f3446)['split'](',');for(var _0x3eb5a6=0x0;_0x3eb5a6<_0x183c4c;_0x3eb5a6++){if(!_0x14a642[_0x3eb5a6])break;if(_0x452be4[_0x85ff('0x66')]()===_0x14a642[_0x3eb5a6][_0x85ff('0x66')]()){var _0x773568=util[_0x85ff('0x67')](_0x85ff('0x68'),_0x183c4c);if(_0x183c4c===0x1){_0x773568=_0x85ff('0x69');}throw new db[(_0x85ff('0x64'))]['ValidationError'](_0x773568);}}return;};exports[_0x85ff('0x6a')]=function(_0x2ad0e3,_0x31871a){var _0x1809cc=_0x31871a?encryptor[_0x85ff('0x6b')](_0x31871a)[_0x85ff('0x6c')](','):[];if(_0x1809cc[_0x85ff('0x6d')]===0x5){_0x1809cc[_0x85ff('0x6e')](-0x1,0x1);}_0x1809cc[_0x85ff('0x6f')](_0x2ad0e3);return encryptor[_0x85ff('0x70')](_0x1809cc['join'](','));};function signJwt(_0x161a5e){var _0x48bda3=BPromise[_0x85ff('0x71')](jwt[_0x85ff('0x72')],{'context':jwt});var _0x677f44=_0x161a5e['secret']||config[_0x85ff('0x73')][_0x85ff('0xd')];return new BPromise(function(_0x5ac093,_0x1bb4a0){_0x48bda3(_0x161a5e[_0x85ff('0x74')],_0x677f44,_0x161a5e[_0x85ff('0x75')])[_0x85ff('0x34')](function(_0x1aafff){_0x5ac093(_0x1aafff);})[_0x85ff('0x39')](function(_0x237847){_0x1bb4a0(_0x237847);});});}function verifyJwt(_0x42b5a8,_0x3f807c,_0x18d1e6){var _0x2edbb5=BPromise[_0x85ff('0x71')](jwt[_0x85ff('0x76')],{'context':jwt});var _0x4edd30=_0x18d1e6||config[_0x85ff('0x73')][_0x85ff('0xd')];return new BPromise(function(_0xf6683f,_0xdddad){_0x2edbb5(_0x42b5a8,_0x4edd30,_0x3f807c)[_0x85ff('0x34')](function(_0x1b8d44){_0xf6683f(_0x1b8d44);})[_0x85ff('0x39')](function(_0x3fb6e9){_0xdddad(_0x3fb6e9);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x85ff('0x77')](_0x85ff('0x78'));}function generateIssuedAt(){return Math[_0x85ff('0x79')](Date[_0x85ff('0x7a')]()/0x3e8)[_0x85ff('0x77')]();}function createJwt(_0x1c6d11){var _0x4ba343={'payload':{'iat':_0x1c6d11[_0x85ff('0x61')],'nonce':_0x1c6d11[_0x85ff('0x60')]},'options':{'algorithm':_0x85ff('0x7b'),'subject':_0x1c6d11['id'][_0x85ff('0x77')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x85ff('0x43')]()}};return signJwt(_0x4ba343)[_0x85ff('0x34')](function(_0x81a4f7){return{'iat':_0x1c6d11[_0x85ff('0x61')],'nonce':_0x1c6d11[_0x85ff('0x60')],'token':_0x81a4f7};});} \ No newline at end of file +var _0x8b2f=['hex','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','authorization','startsWith','Basic','authenticate','pass','Wrong\x20credentials.','user','catch','headers','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','nonce','blocked','add','minutes','Invalid\x20API\x20access\x20key','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x8b2f,0x18c));var _0xf8b2=function(_0x2020a6,_0x152bd8){_0x2020a6=_0x2020a6-0x0;var _0xd40d5f=_0x8b2f[_0x2020a6];return _0xd40d5f;};'use strict';var db=require(_0xf8b2('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xf8b2('0x1'));var licenseUtil=require(_0xf8b2('0x2'));var encryptor=require('../encryptor');var _=require(_0xf8b2('0x3'));var jwt=require(_0xf8b2('0x4'));var expressJwt=require(_0xf8b2('0x5'));var compose=require(_0xf8b2('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0xf8b2('0x7'));var BPromise=require(_0xf8b2('0x8'));var util=require('util');var moment=require(_0xf8b2('0x9'));var validateJwt=expressJwt({'secret':config[_0xf8b2('0xa')][_0xf8b2('0xb')]});var userAttributes=['id',_0xf8b2('0xc'),_0xf8b2('0xd'),_0xf8b2('0xe'),_0xf8b2('0xf'),_0xf8b2('0x10'),_0xf8b2('0x11'),'permissions','md5secret',_0xf8b2('0x12'),_0xf8b2('0x13'),_0xf8b2('0x14'),_0xf8b2('0x15'),'smsPause',_0xf8b2('0x16'),_0xf8b2('0x17'),_0xf8b2('0x18'),_0xf8b2('0x19'),_0xf8b2('0x1a'),'crudPermissions',_0xf8b2('0x1b'),_0xf8b2('0x1c'),_0xf8b2('0x1d'),'phoneBarAutoAnswer',_0xf8b2('0x1e'),'phoneBarDnd',_0xf8b2('0x1f'),_0xf8b2('0x20'),'phoneBarEnableSettings',_0xf8b2('0x21'),_0xf8b2('0x22'),_0xf8b2('0x23'),_0xf8b2('0x24'),_0xf8b2('0x25'),_0xf8b2('0x26'),_0xf8b2('0x27'),_0xf8b2('0x28'),_0xf8b2('0x29'),_0xf8b2('0x2a'),_0xf8b2('0x2b'),_0xf8b2('0x2c'),'downloadAttachments','ignorePauseForPreviewCalls',_0xf8b2('0x2d')];exports[_0xf8b2('0x2e')]=function(){return this[_0xf8b2('0x2f')](!![])[_0xf8b2('0x30')](function(_0x5242ca,_0xe1ca11,_0xc5613a){if(_0x5242ca['user']){_0xc5613a();}else{return db[_0xf8b2('0x31')][_0xf8b2('0x32')]({'where':{'id':_0x5242ca['params']['id']},'attributes':['id',_0xf8b2('0x33'),_0xf8b2('0x34')],'raw':!![]})[_0xf8b2('0x35')](function(_0x35f837){if(_0x35f837&&_0x35f837[_0xf8b2('0x33')]){return _0xe1ca11[_0xf8b2('0x36')](_0x35f837[_0xf8b2('0x34')]===_0xf8b2('0x37')?0x195:0x193)[_0xf8b2('0x38')]({'message':_0x35f837[_0xf8b2('0x34')]==='unmanaged'?_0xf8b2('0x39'):_0xf8b2('0x3a')});}else{_0xc5613a();}})['catch'](function(_0x231da5){_0xc5613a(_0x231da5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x3abc88){return compose()[_0xf8b2('0x30')](function(_0x414565,_0x31657f,_0x57672f){var _0x5ee51c;if(_0x414565['headers'][_0xf8b2('0x3b')]){if(_[_0xf8b2('0x3c')](_0x414565['headers'][_0xf8b2('0x3b')],_0xf8b2('0x3d'))){var _0x4514a=basicAuth(_0x414565);db['User']['find']({'where':{'name':_0x4514a['name']}})['then'](function(_0xece1da){if(!_0xece1da||!_0xece1da[_0xf8b2('0x3e')](_0x4514a[_0xf8b2('0x3f')])){return _0x31657f[_0xf8b2('0x36')](0x191)['json']({'message':_0xf8b2('0x40')});}_0x414565[_0xf8b2('0x41')]={'id':_0xece1da['id']};_0x57672f();})[_0xf8b2('0x42')](function(_0x2f2133){_0x57672f(_0x2f2133);});}else if(_[_0xf8b2('0x3c')](_0x414565[_0xf8b2('0x43')][_0xf8b2('0x3b')],_0xf8b2('0x44'))){validateJwt(_0x414565,_0x31657f,_0x57672f);}else{if(_0x3abc88){_0x57672f();}else{return _0x31657f['status'](0x193)['json']({'message':_0xf8b2('0x45')});}}}else if(_0x414565[_0xf8b2('0x46')]['apikey']){try{var _0x346e30={'audience':hardwareConf[_0xf8b2('0x47')](),'issuer':hardwareConf[_0xf8b2('0x47')]()};verifyJwt(_0x414565[_0xf8b2('0x46')][_0xf8b2('0x48')],_0x346e30)[_0xf8b2('0x35')](function(_0x2f382e){return db[_0xf8b2('0x49')]['find']({'where':{'id':_0x2f382e[_0xf8b2('0x4a')]}})[_0xf8b2('0x35')](function(_0xd04768){_0x5ee51c=_0xd04768;return db[_0xf8b2('0x4b')][_0xf8b2('0x32')]({'where':{'id':0x1},'attributes':[_0xf8b2('0x4c'),_0xf8b2('0x4d')],'raw':!![]});})[_0xf8b2('0x35')](function(_0x136962){if(!_0x5ee51c||!_['isEqual'](_0x5ee51c['apiKeyNonce'],_0x2f382e[_0xf8b2('0x4e')])){return _0x31657f[_0xf8b2('0x36')](0x191)[_0xf8b2('0x38')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5ee51c['disabled']){return _0x31657f['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5ee51c[_0xf8b2('0x4f')]){if(_0x136962[_0xf8b2('0x4d')]>0x0){if(moment(_0x5ee51c['blockedAt'])[_0xf8b2('0x50')](_0x136962[_0xf8b2('0x4d')],_0xf8b2('0x51'))>moment()){return _0x31657f['status'](0x191)[_0xf8b2('0x38')]({'message':_0xf8b2('0x52')});}}else{return _0x31657f[_0xf8b2('0x36')](0x191)[_0xf8b2('0x38')]({'message':_0xf8b2('0x52')});}}_0x414565[_0xf8b2('0x41')]={'id':_0x5ee51c['id']};_0x57672f();});})[_0xf8b2('0x42')](function(){return _0x31657f['status'](0x191)['json']({'message':_0xf8b2('0x52')});});}catch(_0x497566){_0x57672f(_0x497566);}}else if(_0x3abc88){_0x57672f();}else{return _0x31657f[_0xf8b2('0x36')](0x193)[_0xf8b2('0x38')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x4b2b8a,_0x11d5d3,_0x2c4c7b){if(_0x4b2b8a['user']){db[_0xf8b2('0x49')][_0xf8b2('0x53')]({'where':{'id':_0x4b2b8a[_0xf8b2('0x41')]['id']},'attributes':userAttributes})[_0xf8b2('0x35')](function(_0x5dd70d){if(!_0x5dd70d){return _0x11d5d3[_0xf8b2('0x36')](0x194)['json']({'message':_0xf8b2('0x54')});}_0x4b2b8a[_0xf8b2('0x41')]=_0x5dd70d;_0x2c4c7b();})[_0xf8b2('0x42')](function(_0x5ca661){_0x2c4c7b(_0x5ca661);});}else if(_0x3abc88){_0x2c4c7b();}else{return _0x11d5d3[_0xf8b2('0x36')](0x194)['json']({'message':_0xf8b2('0x55')});}});};exports[_0xf8b2('0x56')]=function canUpdate(){return compose()[_0xf8b2('0x30')](function(_0x512427,_0x3feada,_0xf2da85){return licenseUtil[_0xf8b2('0x57')]()[_0xf8b2('0x35')](function(_0x1c8cd6){if(_0x1c8cd6['update']){_0xf2da85();}else{return _0x3feada[_0xf8b2('0x36')](0x193)[_0xf8b2('0x38')]({'message':_0xf8b2('0x58')});}})[_0xf8b2('0x42')](function(_0x42536b){_0xf2da85(_0x42536b);});});};exports[_0xf8b2('0x59')]=function isWebrtcLicence(){return compose()[_0xf8b2('0x30')](function(_0x241663,_0x573983,_0xc72701){return licenseUtil[_0xf8b2('0x57')]()['then'](function(_0xdcc30f){if(_0xdcc30f[_0xf8b2('0x5a')]){_0xc72701();}else{return _0x573983[_0xf8b2('0x36')](0x193)[_0xf8b2('0x38')]({'message':'Forbidden'});}})[_0xf8b2('0x42')](function(_0x2fd263){_0xc72701(_0x2fd263);});});};exports[_0xf8b2('0x5b')]=function(_0x2b93b7,_0x484726,_0x5206ce){_0x2b93b7['isMiddleware']=!![];return _0x5206ce();};exports['signToken']=function signToken(_0x4dbd93){return signJwt(_0x4dbd93);};exports[_0xf8b2('0x5c')]=function(_0x52a64c,_0x59551b){if(!_0x52a64c[_0xf8b2('0x41')]){return _0x59551b['status'](0x194)['json']({'message':_0xf8b2('0x5d')});}var _0xf92c51={'payload':{'id':_0x52a64c['user']['id'],'role':_0x52a64c[_0xf8b2('0x41')][_0xf8b2('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0xf92c51)[_0xf8b2('0x35')](function(_0x1b7fe9){_0x59551b[_0xf8b2('0x5e')]('motion.token',_0x1b7fe9);_0x59551b[_0xf8b2('0x5f')](_0xf8b2('0x60'));})[_0xf8b2('0x42')](function(_0x1bb095){return _0x59551b['status'](0x1f4)[_0xf8b2('0x61')](_0x1bb095);});};exports[_0xf8b2('0x62')]=function(_0x53f723){if(_['isNil'](_0x53f723[_0xf8b2('0x63')])||_[_0xf8b2('0x64')](_0x53f723[_0xf8b2('0x65')])){return null;}else{return createJwt(_0x53f723);}};exports[_0xf8b2('0x66')]=function(_0x31c5e1){_0x31c5e1[_0xf8b2('0x63')]=generateNonce();_0x31c5e1['apiKeyIat']=generateIssuedAt();return createJwt(_0x31c5e1);};exports[_0xf8b2('0x67')]=function(_0x90f67b,_0x584640){var _0x2cd85e=_0x90f67b[_0xf8b2('0x46')]['apikey'];if(_0x2cd85e){var _0x3147f2={'nonce':_0x584640['apiKeyNonce'],'iat':_0x584640[_0xf8b2('0x65')],'audience':hardwareConf[_0xf8b2('0x47')](),'issuer':hardwareConf[_0xf8b2('0x47')]()};return verifyJwt(_0x2cd85e,_0x3147f2)['then'](function(){return generateApiKey(_0x584640);});}else{throw{'message':_0xf8b2('0x68')};}};exports[_0xf8b2('0x69')]=function(_0x5edcae){var _0x107f83=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x107f83[_0xf8b2('0x6a')](_0x5edcae))throw new db[(_0xf8b2('0x6b'))][(_0xf8b2('0x6c'))](_0xf8b2('0x6d'));return;};exports[_0xf8b2('0x6e')]=function(_0x37c29d,_0x2f7aed,_0x41c13a){var _0x28a35e=encryptor[_0xf8b2('0x6f')](_0x2f7aed)[_0xf8b2('0x70')](',');for(var _0x4aeb99=0x0;_0x4aeb99<_0x41c13a;_0x4aeb99++){if(!_0x28a35e[_0x4aeb99])break;if(_0x37c29d[_0xf8b2('0x71')]()===_0x28a35e[_0x4aeb99][_0xf8b2('0x71')]()){var _0x35818f=util[_0xf8b2('0x72')](_0xf8b2('0x73'),_0x41c13a);if(_0x41c13a===0x1){_0x35818f='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf8b2('0x6b'))][(_0xf8b2('0x6c'))](_0x35818f);}}return;};exports[_0xf8b2('0x74')]=function(_0x12fd70,_0x5c1f30){var _0x20b17d=_0x5c1f30?encryptor[_0xf8b2('0x6f')](_0x5c1f30)['split'](','):[];if(_0x20b17d['length']===0x5){_0x20b17d[_0xf8b2('0x75')](-0x1,0x1);}_0x20b17d[_0xf8b2('0x76')](_0x12fd70);return encryptor[_0xf8b2('0x77')](_0x20b17d[_0xf8b2('0x78')](','));};function signJwt(_0x5ad98a){var _0xd886ae=BPromise[_0xf8b2('0x79')](jwt[_0xf8b2('0x7a')],{'context':jwt});var _0x55f243=_0x5ad98a['secret']||config[_0xf8b2('0xa')][_0xf8b2('0xb')];return new BPromise(function(_0x430d64,_0x55e2ad){_0xd886ae(_0x5ad98a[_0xf8b2('0x7b')],_0x55f243,_0x5ad98a[_0xf8b2('0x7c')])[_0xf8b2('0x35')](function(_0x1cb9dd){_0x430d64(_0x1cb9dd);})[_0xf8b2('0x42')](function(_0x281222){_0x55e2ad(_0x281222);});});}function verifyJwt(_0x19c518,_0x437054,_0x156531){var _0x4f7ba8=BPromise['promisify'](jwt[_0xf8b2('0x7d')],{'context':jwt});var _0x3597a3=_0x156531||config[_0xf8b2('0xa')][_0xf8b2('0xb')];return new BPromise(function(_0x34562d,_0x1076a2){_0x4f7ba8(_0x19c518,_0x3597a3,_0x437054)['then'](function(_0x214119){_0x34562d(_0x214119);})['catch'](function(_0x136e47){_0x1076a2(_0x136e47);});});}function generateNonce(){return crypto[_0xf8b2('0x7e')](0x10)[_0xf8b2('0x7f')](_0xf8b2('0x80'));}function generateIssuedAt(){return Math['floor'](Date[_0xf8b2('0x81')]()/0x3e8)[_0xf8b2('0x7f')]();}function createJwt(_0x2dcc66){var _0x4b9907={'payload':{'iat':_0x2dcc66[_0xf8b2('0x65')],'nonce':_0x2dcc66['apiKeyNonce']},'options':{'algorithm':_0xf8b2('0x82'),'subject':_0x2dcc66['id'][_0xf8b2('0x7f')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xf8b2('0x47')]()}};return signJwt(_0x4b9907)[_0xf8b2('0x35')](function(_0x383b1f){return{'iat':_0x2dcc66['apiKeyIat'],'nonce':_0x2dcc66[_0xf8b2('0x63')],'token':_0x383b1f};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5b7485d..033f59a 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 _0xebfa=['session','aes-256-ctr','aes192','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','write','end','final','binary','close','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/environment','../../config/logger','app','secrets'];(function(_0x329d45,_0xf2f5b8){var _0x173ba1=function(_0x399372){while(--_0x399372){_0x329d45['push'](_0x329d45['shift']());}};_0x173ba1(++_0xf2f5b8);}(_0xebfa,0x16c));var _0xaebf=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xebfa[_0x20a558];return _0x53d3f7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xaebf('0x0'));var _=require(_0xaebf('0x1'));var config=require(_0xaebf('0x2'));var logger=require(_0xaebf('0x3'))(_0xaebf('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xaebf('0x5')][_0xaebf('0x6')],'algorithm':_0xaebf('0x7')};const fileOptions={'algorithm':_0xaebf('0x8')};if(config[_0xaebf('0x9')]&&config[_0xaebf('0x9')][_0xaebf('0xa')]){var isSupported=isAlgorithmSupported(config[_0xaebf('0x9')][_0xaebf('0xa')]);if(isSupported){fileOptions[_0xaebf('0xa')]=config[_0xaebf('0x9')][_0xaebf('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xaebf('0xb')](',\x20');logger[_0xaebf('0xc')](config['encrypt'][_0xaebf('0xa')],_0xaebf('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x58094a){return AES_SUPPORTED_RX[_0xaebf('0xe')](_0x58094a);}function getSupportedCiphers(){return crypto[_0xaebf('0xf')]()[_0xaebf('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x2561f3){return getSupportedCiphers()[_0xaebf('0x11')](_0x2561f3)>-0x1;}function combineOptions(_0x8be48c){var _0x37ded6={};for(var _0x28cc85 in fileOptions){if(fileOptions[_0xaebf('0x12')](_0x28cc85)){_0x37ded6[_0x28cc85]=fileOptions[_0x28cc85];}}if(_0x8be48c){for(var _0x1c1a39 in _0x8be48c){if(_0x8be48c['hasOwnProperty'](_0x1c1a39)){_0x37ded6[_0x1c1a39]=_0x8be48c[_0x1c1a39];}}}return _0x37ded6;}exports[_0xaebf('0x13')]=function(_0x213e07,_0x59913d,_0x1e8541,_0x2127d5){return new BPromise(function(_0x17f028,_0xd2bcf){_0x2127d5=combineOptions(_0x2127d5);var _0x3b1b4d=new Buffer(_0x1e8541);var _0x1dd56b=fs[_0xaebf('0x14')](_0x213e07);var _0x169ddb=fs[_0xaebf('0x15')](_0x59913d);var _0x106849=crypto[_0xaebf('0x16')](_0x2127d5[_0xaebf('0xa')],_0x3b1b4d);_0x1dd56b['on'](_0xaebf('0x17'),function(_0x1eefac){var _0x4bc7f6=new Buffer(_0x106849[_0xaebf('0x18')](_0x1eefac),'binary');_0x169ddb[_0xaebf('0x19')](_0x4bc7f6);});_0x1dd56b['on'](_0xaebf('0x1a'),function(){try{var _0x47e1fd=new Buffer(_0x106849[_0xaebf('0x1b')](_0xaebf('0x1c')),'binary');_0x169ddb[_0xaebf('0x19')](_0x47e1fd);_0x169ddb['end']();_0x169ddb['on'](_0xaebf('0x1d'),function(){return _0x17f028(_0x59913d);});}catch(_0x38c148){fs['unlink'](_0x59913d);return _0xd2bcf(_0x38c148);}});});};exports[_0xaebf('0x1e')]=function(_0x4a56e7,_0x36e3ac,_0x5d80eb,_0x59ecea){return new BPromise(function(_0x370efe,_0x46bf1c){_0x59ecea=combineOptions(_0x59ecea);var _0x54db7e=new Buffer(_0x5d80eb);var _0x56a163=fs[_0xaebf('0x14')](_0x4a56e7);var _0x4763b3=fs[_0xaebf('0x15')](_0x36e3ac);var _0x107beb=crypto[_0xaebf('0x1f')](_0x59ecea[_0xaebf('0xa')],_0x54db7e);_0x56a163['on']('data',function(_0x7a77b1){var _0xfcfe14=new Buffer(_0x107beb[_0xaebf('0x18')](_0x7a77b1),'binary');_0x4763b3['write'](_0xfcfe14);});_0x56a163['on'](_0xaebf('0x1a'),function(){try{var _0x23e4f7=new Buffer(_0x107beb['final'](_0xaebf('0x1c')),_0xaebf('0x1c'));_0x4763b3[_0xaebf('0x19')](_0x23e4f7);_0x4763b3[_0xaebf('0x1a')]();_0x4763b3['on'](_0xaebf('0x1d'),function(){return _0x370efe(_0x36e3ac);});}catch(_0x2ec73f){fs['unlink'](_0x36e3ac);return _0x46bf1c(_0x2ec73f);}});});};exports[_0xaebf('0x20')]=function(_0x58d7ef,_0x458a82,_0x1f85b9){var _0x4a3057=_0x1f85b9||stringOptions[_0xaebf('0xa')];var _0x1b7833=_0x458a82||stringOptions[_0xaebf('0x21')];var _0x26870e=crypto['createCipher'](_0x4a3057,_0x1b7833);var _0x5ce608=_0x26870e['update'](_0x58d7ef,_0xaebf('0x22'),_0xaebf('0x23'));_0x5ce608+=_0x26870e[_0xaebf('0x1b')](_0xaebf('0x23'));return _0x5ce608;};exports[_0xaebf('0x24')]=function(_0x12bbd7,_0x45039e,_0x41f3ce){var _0x5285ad=_0x41f3ce||stringOptions[_0xaebf('0xa')];var _0x7fc0d7=_0x45039e||stringOptions[_0xaebf('0x21')];var _0x1eb20f=crypto[_0xaebf('0x1f')](_0x5285ad,_0x7fc0d7);var _0x43afe2=_0x1eb20f[_0xaebf('0x18')](_0x12bbd7,'base64',_0xaebf('0x22'));_0x43afe2+=_0x1eb20f[_0xaebf('0x1b')](_0xaebf('0x22'));return _0x43afe2;}; \ No newline at end of file +var _0x142b=['final','close','decryptFile','createDecipher','update','unlink','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/logger','app','secrets','aes192','encrypt','algorithm','join','error','getCiphers','indexOf','createReadStream','createWriteStream','createCipher','data','binary','write','end'];(function(_0x3334d9,_0xfaafbc){var _0x1eeae8=function(_0x567ca){while(--_0x567ca){_0x3334d9['push'](_0x3334d9['shift']());}};_0x1eeae8(++_0xfaafbc);}(_0x142b,0x160));var _0xb142=function(_0xf6f768,_0x4487bd){_0xf6f768=_0xf6f768-0x0;var _0x49cb87=_0x142b[_0xf6f768];return _0x49cb87;};'use strict';var crypto=require(_0xb142('0x0'));var fs=require('fs');var BPromise=require(_0xb142('0x1'));var _=require(_0xb142('0x2'));var config=require('../../config/environment');var logger=require(_0xb142('0x3'))(_0xb142('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb142('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xb142('0x6')};if(config[_0xb142('0x7')]&&config[_0xb142('0x7')][_0xb142('0x8')]){var isSupported=isAlgorithmSupported(config[_0xb142('0x7')][_0xb142('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xb142('0x7')][_0xb142('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb142('0x9')](',\x20');logger[_0xb142('0xa')](config[_0xb142('0x7')][_0xb142('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xc4db43){return AES_SUPPORTED_RX['test'](_0xc4db43);}function getSupportedCiphers(){return crypto[_0xb142('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x159a7b){return getSupportedCiphers()[_0xb142('0xc')](_0x159a7b)>-0x1;}function combineOptions(_0x26dfae){var _0x35d1c4={};for(var _0xd9c970 in fileOptions){if(fileOptions['hasOwnProperty'](_0xd9c970)){_0x35d1c4[_0xd9c970]=fileOptions[_0xd9c970];}}if(_0x26dfae){for(var _0x331412 in _0x26dfae){if(_0x26dfae['hasOwnProperty'](_0x331412)){_0x35d1c4[_0x331412]=_0x26dfae[_0x331412];}}}return _0x35d1c4;}exports['encryptFile']=function(_0x59e4f4,_0x5d1bd9,_0x5ef913,_0xa33976){return new BPromise(function(_0x5ea741,_0x313bea){_0xa33976=combineOptions(_0xa33976);var _0x20f7ad=new Buffer(_0x5ef913);var _0x3cf128=fs[_0xb142('0xd')](_0x59e4f4);var _0x445b42=fs[_0xb142('0xe')](_0x5d1bd9);var _0x4e303e=crypto[_0xb142('0xf')](_0xa33976[_0xb142('0x8')],_0x20f7ad);_0x3cf128['on'](_0xb142('0x10'),function(_0x3ce278){var _0xc7ee8c=new Buffer(_0x4e303e['update'](_0x3ce278),_0xb142('0x11'));_0x445b42[_0xb142('0x12')](_0xc7ee8c);});_0x3cf128['on'](_0xb142('0x13'),function(){try{var _0x38612a=new Buffer(_0x4e303e[_0xb142('0x14')](_0xb142('0x11')),_0xb142('0x11'));_0x445b42[_0xb142('0x12')](_0x38612a);_0x445b42[_0xb142('0x13')]();_0x445b42['on'](_0xb142('0x15'),function(){return _0x5ea741(_0x5d1bd9);});}catch(_0x26dc26){fs['unlink'](_0x5d1bd9);return _0x313bea(_0x26dc26);}});});};exports[_0xb142('0x16')]=function(_0x349887,_0x1cd8a9,_0xc7afee,_0x13ca8e){return new BPromise(function(_0x5380ba,_0x49a324){_0x13ca8e=combineOptions(_0x13ca8e);var _0x44f7d8=new Buffer(_0xc7afee);var _0xbe917c=fs[_0xb142('0xd')](_0x349887);var _0x59dd59=fs[_0xb142('0xe')](_0x1cd8a9);var _0xc890c0=crypto[_0xb142('0x17')](_0x13ca8e[_0xb142('0x8')],_0x44f7d8);_0xbe917c['on'](_0xb142('0x10'),function(_0x2cfdbb){var _0x19be30=new Buffer(_0xc890c0[_0xb142('0x18')](_0x2cfdbb),_0xb142('0x11'));_0x59dd59[_0xb142('0x12')](_0x19be30);});_0xbe917c['on']('end',function(){try{var _0x5bb2e6=new Buffer(_0xc890c0[_0xb142('0x14')]('binary'),_0xb142('0x11'));_0x59dd59['write'](_0x5bb2e6);_0x59dd59['end']();_0x59dd59['on']('close',function(){return _0x5380ba(_0x1cd8a9);});}catch(_0x5b1b01){fs[_0xb142('0x19')](_0x1cd8a9);return _0x49a324(_0x5b1b01);}});});};exports[_0xb142('0x1a')]=function(_0x207301,_0x25303e,_0x3d6916){var _0x50c280=_0x3d6916||stringOptions[_0xb142('0x8')];var _0x2143cf=_0x25303e||stringOptions['secret'];var _0x5650c3=crypto[_0xb142('0xf')](_0x50c280,_0x2143cf);var _0x12c313=_0x5650c3[_0xb142('0x18')](_0x207301,_0xb142('0x1b'),_0xb142('0x1c'));_0x12c313+=_0x5650c3[_0xb142('0x14')]('base64');return _0x12c313;};exports[_0xb142('0x1d')]=function(_0x929286,_0x2c70c9,_0x1e9c5c){var _0x1c1266=_0x1e9c5c||stringOptions[_0xb142('0x8')];var _0x193eba=_0x2c70c9||stringOptions[_0xb142('0x1e')];var _0x51072a=crypto[_0xb142('0x17')](_0x1c1266,_0x193eba);var _0x3824c7=_0x51072a[_0xb142('0x18')](_0x929286,_0xb142('0x1c'),'utf8');_0x3824c7+=_0x51072a[_0xb142('0x14')]('utf8');return _0x3824c7;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 962cc64..1e95494 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 _0xf47b=['CSV','Setting','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','Empty','split','length','range','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x5639e4,_0x1ff1d1){var _0x2bae28=function(_0x5271bf){while(--_0x5271bf){_0x5639e4['push'](_0x5639e4['shift']());}};_0x2bae28(++_0x1ff1d1);}(_0xf47b,0x10c));var _0xbf47=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xf47b[_0x487b0c];return _0x1adbdc;};'use strict';var util=require(_0xbf47('0x0'));var path=require(_0xbf47('0x1'));var _=require(_0xbf47('0x2'));var csv=require(_0xbf47('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbf47('0x4'));var rimraf=require('rimraf');var db=require(_0xbf47('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xbf47('0x6'))(_0xbf47('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xbf47('0x8')][0x3];var PATH=process[_0xbf47('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38aa65,_0x3c21a0){var _0x2bbf11={'status':_0x38aa65};var _0x3e86c3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c21a0){_0x2bbf11[_0xbf47('0x9')]=_0x3c21a0;}return db['AnalyticExtractedReport'][_0xbf47('0xa')](_0x2bbf11,_0x3e86c3);}function main(){var _0x303806=0x1388;var _0x7df08f;logger[_0xbf47('0xb')](util[_0xbf47('0xc')](_0xbf47('0xd'),EXTRACTED_REPORT_ID,_0xbf47('0xe')));return db[_0xbf47('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xbf47('0x10')]})['then'](function(_0x3472d2){if(_0x3472d2){_0x7df08f=_0x3472d2;_0x303806=_0x7df08f[_0xbf47('0x10')]||0x1388;}})[_0xbf47('0x11')](function(){return dbH[_0xbf47('0x12')][_0xbf47('0x13')](util[_0xbf47('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbf47('0x12')][_0xbf47('0x14')][_0xbf47('0x15')]});})[_0xbf47('0x11')](function(_0x469b13){if(!_0x469b13[0x0]['num']){return analyticExtractedReport(_0xbf47('0x16'));}var _0x10c107=[];var _0x3e51ea=0x0;if(_0x7df08f[_0xbf47('0x17')]){if(_0x469b13&&_0x469b13[_0xbf47('0x18')]){var _0x387b8a=_[_0xbf47('0x19')](_0x469b13[0x0][_0xbf47('0x1a')]/_0x303806);var _0x7429cf=Number['isInteger'](_0x469b13[0x0][_0xbf47('0x1a')]/_0x303806)?_0x469b13[0x0][_0xbf47('0x1a')]%_0x303806:0x0;_0x387b8a[_0xbf47('0x1b')](function(_0x394dac){if(_0x394dac>0x0){_0x3e51ea+=_0x303806;}_0x10c107['push'](dbH[_0xbf47('0x12')][_0xbf47('0x13')](util[_0xbf47('0xc')](_0xbf47('0x1c'),QUERY,_0x303806,_0x3e51ea),{'type':dbH['sequelize']['QueryTypes'][_0xbf47('0x15')]}));});if(_0x7429cf>0x0){_0x3e51ea+=_0x303806;_0x10c107[_0xbf47('0x1d')](dbH[_0xbf47('0x12')][_0xbf47('0x13')](util[_0xbf47('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x7429cf,_0x3e51ea),{'type':dbH[_0xbf47('0x12')][_0xbf47('0x14')][_0xbf47('0x15')]}));}}}else{_0x10c107[_0xbf47('0x1d')](dbH[_0xbf47('0x12')]['query'](QUERY,{'type':dbH[_0xbf47('0x12')][_0xbf47('0x14')]['SELECT']}));}var _0x10b6ee=path['dirname'](PATH);var _0x5e0b66=path['basename'](PATH,'.csv');var _0x344aa4=_0x7df08f[_0xbf47('0x17')]&&_0x10c107[_0xbf47('0x18')]>0x1;var _0x5e8c5b=[];if(!fs[_0xbf47('0x1e')](path[_0xbf47('0x1f')](_0x10b6ee,_0x5e0b66))&&_0x344aa4){fs[_0xbf47('0x20')](path[_0xbf47('0x1f')](_0x10b6ee,_0x5e0b66));}return BPromise[_0xbf47('0x21')](_0x10c107,function(_0x4a8224){_0x5e8c5b[_0xbf47('0x1d')](_0x4a8224);})[_0xbf47('0x11')](function(){for(var _0x5830db=0x0;_0x5830db<_0x5e8c5b[_0xbf47('0x18')];_0x5830db+=0x1){var _0xb9a6d2;var _0x56909f=_0x5e8c5b[_0x5830db];if(_0x344aa4){_0xb9a6d2=path['join'](_0x10b6ee,_0x5e0b66,util[_0xbf47('0xc')](_0xbf47('0x22'),_0x5e0b66,_0x5830db,_0xbf47('0x23')));}else{_0xb9a6d2=path[_0xbf47('0x1f')](_0x10b6ee,util[_0xbf47('0xc')](_0xbf47('0x24'),_0x5e0b66,_0xbf47('0x23')));}fs[_0xbf47('0x25')](_0xb9a6d2,csv(_0x56909f));}})['then'](function(){if(_0x344aa4){return new Promise(function(_0x5dc598){zipdir(path['join'](_0x10b6ee,_0x5e0b66),{'saveTo':path[_0xbf47('0x1f')](_0x10b6ee,util[_0xbf47('0xc')](_0xbf47('0x24'),_0x5e0b66,_0xbf47('0x26')))},function(_0x4fc3af,_0x2d53ea){rimraf(path[_0xbf47('0x1f')](_0x10b6ee,_0x5e0b66),function(){});_0x5dc598('zip\x20finished');});});}})[_0xbf47('0x11')](function(){logger['info'](util['format'](_0xbf47('0x27'),EXTRACTED_REPORT_ID,_0xbf47('0xe')));return analyticExtractedReport(_0xbf47('0x28'),_0x344aa4?util[_0xbf47('0xc')](_0xbf47('0x24'),_0x5e0b66,_0x344aa4?'zip':_0xbf47('0x23')):null);});})[_0xbf47('0x29')](function(_0x3a8d3b){logger['info'](util[_0xbf47('0xc')](_0xbf47('0x2a'),EXTRACTED_REPORT_ID,_0xbf47('0xe')),util[_0xbf47('0x2b')](_0x3a8d3b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbf47('0x2c'));})[_0xbf47('0x2d')](function(){process[_0xbf47('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xca28=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','Empty','split','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x317ef2,_0x2ea2ed){var _0x275ac7=function(_0x22822e){while(--_0x22822e){_0x317ef2['push'](_0x317ef2['shift']());}};_0x275ac7(++_0x2ea2ed);}(_0xca28,0x1ae));var _0x8ca2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xca28[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x8ca2('0x0'));var path=require('path');var _=require(_0x8ca2('0x1'));var csv=require(_0x8ca2('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8ca2('0x3'));var rimraf=require(_0x8ca2('0x4'));var db=require(_0x8ca2('0x5'))['db'];var dbH=require(_0x8ca2('0x5'))['dbH'];var logger=require(_0x8ca2('0x6'))(_0x8ca2('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8ca2('0x8')][0x3];var PATH=process[_0x8ca2('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x36363b,_0x23ff61){var _0x543b03={'status':_0x36363b};var _0x1bec69={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23ff61){_0x543b03[_0x8ca2('0x9')]=_0x23ff61;}return db[_0x8ca2('0xa')][_0x8ca2('0xb')](_0x543b03,_0x1bec69);}function main(){var _0xa354ed=0x1388;var _0x37325c;logger[_0x8ca2('0xc')](util[_0x8ca2('0xd')](_0x8ca2('0xe'),EXTRACTED_REPORT_ID,_0x8ca2('0xf')));return db[_0x8ca2('0x10')][_0x8ca2('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8ca2('0x12')]})[_0x8ca2('0x13')](function(_0x2fc966){if(_0x2fc966){_0x37325c=_0x2fc966;_0xa354ed=_0x37325c['splitSizeCsv']||0x1388;}})[_0x8ca2('0x13')](function(){return dbH['sequelize'][_0x8ca2('0x14')](util[_0x8ca2('0xd')](_0x8ca2('0x15'),QUERY),{'type':dbH[_0x8ca2('0x16')]['QueryTypes'][_0x8ca2('0x17')]});})[_0x8ca2('0x13')](function(_0x26c92d){if(!_0x26c92d[0x0]['num']){return analyticExtractedReport(_0x8ca2('0x18'));}var _0x106f2f=[];var _0x421cdc=0x0;if(_0x37325c[_0x8ca2('0x19')]){if(_0x26c92d&&_0x26c92d[_0x8ca2('0x1a')]){var _0x2387c4=_[_0x8ca2('0x1b')](_0x26c92d[0x0][_0x8ca2('0x1c')]/_0xa354ed);var _0x457def=Number['isInteger'](_0x26c92d[0x0][_0x8ca2('0x1c')]/_0xa354ed)?_0x26c92d[0x0][_0x8ca2('0x1c')]%_0xa354ed:0x0;_0x2387c4[_0x8ca2('0x1d')](function(_0x57d6e0){if(_0x57d6e0>0x0){_0x421cdc+=_0xa354ed;}_0x106f2f[_0x8ca2('0x1e')](dbH['sequelize'][_0x8ca2('0x14')](util[_0x8ca2('0xd')](_0x8ca2('0x1f'),QUERY,_0xa354ed,_0x421cdc),{'type':dbH[_0x8ca2('0x16')][_0x8ca2('0x20')]['SELECT']}));});if(_0x457def>0x0){_0x421cdc+=_0xa354ed;_0x106f2f[_0x8ca2('0x1e')](dbH['sequelize']['query'](util[_0x8ca2('0xd')](_0x8ca2('0x1f'),QUERY,_0x457def,_0x421cdc),{'type':dbH[_0x8ca2('0x16')][_0x8ca2('0x20')][_0x8ca2('0x17')]}));}}}else{_0x106f2f[_0x8ca2('0x1e')](dbH[_0x8ca2('0x16')][_0x8ca2('0x14')](QUERY,{'type':dbH['sequelize'][_0x8ca2('0x20')][_0x8ca2('0x17')]}));}var _0x1134e5=path['dirname'](PATH);var _0x5fb2e2=path['basename'](PATH,_0x8ca2('0x21'));var _0xf626e0=_0x37325c[_0x8ca2('0x19')]&&_0x106f2f[_0x8ca2('0x1a')]>0x1;var _0x30c804=[];if(!fs[_0x8ca2('0x22')](path[_0x8ca2('0x23')](_0x1134e5,_0x5fb2e2))&&_0xf626e0){fs[_0x8ca2('0x24')](path[_0x8ca2('0x23')](_0x1134e5,_0x5fb2e2));}return BPromise[_0x8ca2('0x25')](_0x106f2f,function(_0x4a590f){_0x30c804[_0x8ca2('0x1e')](_0x4a590f);})[_0x8ca2('0x13')](function(){for(var _0x2408f4=0x0;_0x2408f4<_0x30c804[_0x8ca2('0x1a')];_0x2408f4+=0x1){var _0x2cabc0;var _0x1ac0fb=_0x30c804[_0x2408f4];if(_0xf626e0){_0x2cabc0=path['join'](_0x1134e5,_0x5fb2e2,util['format'](_0x8ca2('0x26'),_0x5fb2e2,_0x2408f4,'csv'));}else{_0x2cabc0=path[_0x8ca2('0x23')](_0x1134e5,util['format']('%s.%s',_0x5fb2e2,_0x8ca2('0x27')));}fs['writeFileSync'](_0x2cabc0,csv(_0x1ac0fb));}})[_0x8ca2('0x13')](function(){if(_0xf626e0){return new Promise(function(_0x30bb21){zipdir(path[_0x8ca2('0x23')](_0x1134e5,_0x5fb2e2),{'saveTo':path[_0x8ca2('0x23')](_0x1134e5,util['format'](_0x8ca2('0x28'),_0x5fb2e2,'zip'))},function(_0x54ab29,_0x33748a){rimraf(path[_0x8ca2('0x23')](_0x1134e5,_0x5fb2e2),function(){});_0x30bb21('zip\x20finished');});});}})[_0x8ca2('0x13')](function(){logger[_0x8ca2('0xc')](util[_0x8ca2('0xd')](_0x8ca2('0x29'),EXTRACTED_REPORT_ID,_0x8ca2('0xf')));return analyticExtractedReport(_0x8ca2('0x2a'),_0xf626e0?util[_0x8ca2('0xd')](_0x8ca2('0x28'),_0x5fb2e2,_0xf626e0?_0x8ca2('0x2b'):'csv'):null);});})[_0x8ca2('0x2c')](function(_0x143b5a){logger[_0x8ca2('0xc')](util['format'](_0x8ca2('0x2d'),EXTRACTED_REPORT_ID,_0x8ca2('0xf')),util[_0x8ca2('0x2e')](_0x143b5a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8ca2('0x2f')](function(){process[_0x8ca2('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6ea815c..3ac1863 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 _0xf229=['length','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','%s.%s','pdf','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','fill','body','push','chunk','forEach','format','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','then','splitSizePdf','split'];(function(_0xe2537a,_0x15bfe7){var _0x423def=function(_0x51919c){while(--_0x51919c){_0xe2537a['push'](_0xe2537a['shift']());}};_0x423def(++_0x15bfe7);}(_0xf229,0xc9));var _0x9f22=function(_0x4909dd,_0x270787){_0x4909dd=_0x4909dd-0x0;var _0x1b4f83=_0xf229[_0x4909dd];return _0x1b4f83;};'use strict';var _=require(_0x9f22('0x0'));var fs=require('fs');var util=require(_0x9f22('0x1'));var path=require(_0x9f22('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x9f22('0x3'));var JSDOM=require(_0x9f22('0x4'))[_0x9f22('0x5')];var window=new JSDOM('')[_0x9f22('0x6')];var BPromise=require('bluebird');var db=require(_0x9f22('0x7'))['db'];var dbH=require(_0x9f22('0x7'))[_0x9f22('0x8')];var logger=require(_0x9f22('0x9'))(_0x9f22('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x9f22('0xb')][0x2]);var QUERY=process[_0x9f22('0xb')][0x3];var PATH=process[_0x9f22('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x9f22('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x337dc5,_0x2b555a){var _0xf42433={'status':_0x337dc5};var _0x17f713={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b555a){_0xf42433[_0x9f22('0xd')]=_0x2b555a;}return db['AnalyticExtractedReport'][_0x9f22('0xe')](_0xf42433,_0x17f713);}function getHeaders(_0x5e372a){return _[_0x9f22('0xf')](_0x5e372a,function(_0xfc12dc){return{'text':_0xfc12dc,'style':'tableHeader'};});}function getRows(_0x1800e6,_0x4cbd06){return _[_0x9f22('0xf')](_0x4cbd06,function(_0x259d80){return _(_0x259d80)[_0x9f22('0x10')](_0x1800e6)[_0x9f22('0xf')](function(_0x73731a){return _0x73731a?_[_0x9f22('0x11')](_0x73731a):'';})[_0x9f22('0x12')]();});}function createTable(_0x2fd347,_0x3e7df4){var _0x116a97={'widths':_[_0x9f22('0x13')](Array(_0x2fd347['length']),0x91),'heights':function(_0x5d1d38){return _0x5d1d38===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xd3cbd=getHeaders(_0x2fd347);_0x116a97[_0x9f22('0x14')][_0x9f22('0x15')](_0xd3cbd);var _0x4a51ec=getRows(_0x2fd347,_0x3e7df4);_0x116a97['body']=_0x116a97[_0x9f22('0x14')]['concat'](_0x4a51ec);return _0x116a97;}function createTables(_0x1a6b9f){var _0x28841c=[];var _0x506b00=_[_0x9f22('0x16')](Object['keys'](_0x1a6b9f[0x0]),0x5);_0x506b00[_0x9f22('0x17')](function(_0x5c611e){_0x28841c[_0x9f22('0x15')](createTable(_0x5c611e,_0x1a6b9f));});return _0x28841c;}function getPDFDocDefinition(_0x5b8066){var _0x4a5599=util[_0x9f22('0x18')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x9f22('0x18')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x9f22('0x18')](FORMAT));var _0x217d5e=[];for(var _0x4c25ee=0x0;_0x4c25ee<_0x5b8066['length'];_0x4c25ee++){var _0x570890=[];if(_0x4c25ee===0x0){_0x570890[_0x9f22('0x15')]({'text':_0x4a5599,'style':_0x9f22('0x19')});}var _0x564b6f={'table':_0x5b8066[_0x4c25ee]};if(_0x4c25ee>0x0){_0x564b6f[_0x9f22('0x1a')]=_0x9f22('0x1b');_0x564b6f[_0x9f22('0x1c')]=[0x0,0x46,0x0,0x0];}_0x570890[_0x9f22('0x15')](_0x564b6f);_0x217d5e[_0x9f22('0x15')](_0x570890);}return{'pageSize':'A4','pageOrientation':_0x9f22('0x1d'),'content':_0x217d5e,'footer':function(_0x5e5f15,_0x353d36){return{'text':_0x5e5f15[_0x9f22('0x11')]()+_0x9f22('0x1e')+_0x353d36,'style':_0x9f22('0x1f')};},'defaultStyle':{'font':_0x9f22('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9f22('0x21')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4339d3){var _0x58218f=0x1388;var _0x24c75e;if(!_0x4339d3[0x0][_0x9f22('0x22')]){return analyticExtractedReport(_0x9f22('0x23'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x9f22('0x24')](function(_0x3e7de5){if(_0x3e7de5){_0x24c75e=_0x3e7de5;_0x58218f=_0x24c75e[_0x9f22('0x25')]||0x3e8;}})[_0x9f22('0x24')](function(){var _0x195d80=[];var _0x499d67=0x0;if(_0x24c75e[_0x9f22('0x26')]){if(_0x4339d3&&_0x4339d3[_0x9f22('0x27')]){var _0x501031=_['range'](_0x4339d3[0x0][_0x9f22('0x22')]/_0x58218f);var _0xa8bd9d=Number[_0x9f22('0x28')](_0x4339d3[0x0][_0x9f22('0x22')]/_0x58218f)?_0x4339d3[0x0][_0x9f22('0x22')]%_0x58218f:0x0;_0x501031[_0x9f22('0x17')](function(_0x3525d5){if(_0x3525d5>0x0){_0x499d67+=_0x58218f;}_0x195d80[_0x9f22('0x15')](dbH[_0x9f22('0x29')][_0x9f22('0x2a')](util['format'](_0x9f22('0x2b'),QUERY,_0x58218f,_0x499d67),{'type':dbH['sequelize'][_0x9f22('0x2c')][_0x9f22('0x2d')]}));});if(_0xa8bd9d>0x0){_0x499d67+=_0x58218f;_0x195d80[_0x9f22('0x15')](dbH[_0x9f22('0x29')][_0x9f22('0x2a')](util['format'](_0x9f22('0x2b'),QUERY,_0xa8bd9d,_0x499d67),{'type':dbH[_0x9f22('0x29')][_0x9f22('0x2c')][_0x9f22('0x2d')]}));}}}else{_0x195d80[_0x9f22('0x15')](dbH['sequelize'][_0x9f22('0x2a')](QUERY,{'type':dbH[_0x9f22('0x29')][_0x9f22('0x2c')][_0x9f22('0x2d')]}));}var _0xdcc21a=path[_0x9f22('0x2e')](PATH);var _0x19e670=path[_0x9f22('0x2f')](PATH,_0x9f22('0x30'));var _0x4140b0=_0x24c75e[_0x9f22('0x26')]&&_0x195d80['length']>0x1;var _0x3c8a93=[];if(!fs[_0x9f22('0x31')](path[_0x9f22('0x32')](_0xdcc21a,_0x19e670))&&_0x4140b0){fs[_0x9f22('0x33')](path[_0x9f22('0x32')](_0xdcc21a,_0x19e670));}return BPromise['each'](_0x195d80,function(_0x2e845d){_0x3c8a93['push'](_0x2e845d);})[_0x9f22('0x24')](function(){var _0x4eb8bc=[];for(var _0x4db735=0x0;_0x4db735<_0x3c8a93[_0x9f22('0x27')];_0x4db735+=0x1){var _0x916e34=_0x3c8a93[_0x4db735];var _0x5f10a1=createTables(_[_0x9f22('0x34')](_0x916e34));var _0x51b3c3;var _0x47fb19=getPDFDocDefinition(_0x5f10a1);var _0x25129c=getPDFPrinter();var _0xe1c4b7=_0x25129c['createPdfKitDocument'](_0x47fb19);if(_0x4140b0){_0x51b3c3=path[_0x9f22('0x32')](_0xdcc21a,_0x19e670,util['format']('%s%d.%s',_0x19e670,_0x4db735,'pdf'));}else{_0x51b3c3=path[_0x9f22('0x32')](_0xdcc21a,util[_0x9f22('0x18')](_0x9f22('0x35'),_0x19e670,_0x9f22('0x36')));}_0x4eb8bc[_0x9f22('0x15')](writePDFDocument(_0xe1c4b7,_0x51b3c3));}return Promise['all'](_0x4eb8bc);})[_0x9f22('0x24')](function(){if(_0x4140b0){return new Promise(function(_0x1e2cf3){zipdir(path['join'](_0xdcc21a,_0x19e670),{'saveTo':path[_0x9f22('0x32')](_0xdcc21a,util['format'](_0x9f22('0x35'),_0x19e670,_0x9f22('0x37')))},function(){rimraf(path[_0x9f22('0x32')](_0xdcc21a,_0x19e670),function(){});_0x1e2cf3(_0x9f22('0x38'));});});}})[_0x9f22('0x24')](function(){if(!_0x4140b0)return;rimraf(path[_0x9f22('0x32')](_0xdcc21a,_0x19e670),function(){});})[_0x9f22('0x24')](function(){logger['info'](util[_0x9f22('0x18')](_0x9f22('0x39'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x4140b0?util[_0x9f22('0x18')](_0x9f22('0x35'),_0x19e670,_0x4140b0?_0x9f22('0x37'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9f22('0x3a')](util[_0x9f22('0x18')](_0x9f22('0x3b'),EXTRACTED_REPORT_ID,_0x9f22('0x3c')));return db[_0x9f22('0x3d')][_0x9f22('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9f22('0x24')](function(_0x4acb5d){EXTRACTED_REPORT=_0x4acb5d;return dbH[_0x9f22('0x29')][_0x9f22('0x2a')](util[_0x9f22('0x18')](_0x9f22('0x3f'),QUERY),{'type':dbH[_0x9f22('0x29')][_0x9f22('0x2c')][_0x9f22('0x2d')]});})[_0x9f22('0x24')](extractReport)[_0x9f22('0x40')](function(_0x3e1b4e){logger[_0x9f22('0x3a')](util[_0x9f22('0x18')](_0x9f22('0x41'),EXTRACTED_REPORT_ID,_0x9f22('0x3c')),util['inspect'](_0x3e1b4e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x9f22('0x42')](function(){process[_0x9f22('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1a9d3b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x9f22('0x44'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1a9d3b;}function getPDFDocDefinitionFromHTML(_0x2c70b2,_0x37c400){var _0x25ea89=util[_0x9f22('0x18')](_0x9f22('0x45'),_0x37c400['channel'],_0x37c400[_0x9f22('0x46')]);var _0x1a47b1=moment()[_0x9f22('0x18')]('YYYY-MM-DD')['toString']();var _0x306966=htmlToPdfmake(_0x2c70b2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x306966],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9f22('0x47'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9f22('0x47'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9f22('0x47')}},'header':function(){return[{'text':_0x9f22('0x48'),'style':_0x9f22('0x19')}];},'footer':function(_0x1228ea,_0x249dcd){return[{'text':util[_0x9f22('0x18')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x25ea89,_0x1228ea,_0x249dcd,_0x1a47b1),'style':_0x9f22('0x1f')}];}};}function writePDFDocument(_0x1e2b5d,_0x52d1ca){return new Promise(function(_0xb7a253,_0x5a4309){var _0x449682=_0x1e2b5d[_0x9f22('0x49')](fs[_0x9f22('0x4a')](_0x52d1ca));_0x449682['on'](_0x9f22('0x4b'),function(){_0xb7a253('finish');});_0x449682['on'](_0x9f22('0x4c'),function(_0x475d28){_0x5a4309(_0x475d28);});_0x1e2b5d[_0x9f22('0x4d')]();});}exports[_0x9f22('0x4e')]=function(_0x36ddb2,_0x332bb3){var _0x484ac8=getPDFPrinter();var _0x466a68=getPDFDocDefinitionFromHTML(_0x36ddb2,_0x332bb3);var _0x2a327f=_0x484ac8[_0x9f22('0x4f')](_0x466a68);return writePDFDocument(_0x2a327f,_0x332bb3[_0x9f22('0x2')])['catch'](function(_0x559437){throw _0x559437;});}; \ No newline at end of file +var _0x626e=['center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','push','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','QueryTypes','SELECT','dirname','basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','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','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD'];(function(_0x3b1502,_0xa23e9d){var _0x1c8537=function(_0x3c05f1){while(--_0x3c05f1){_0x3b1502['push'](_0x3b1502['shift']());}};_0x1c8537(++_0xa23e9d);}(_0x626e,0x125));var _0xe626=function(_0x283470,_0x42a99f){_0x283470=_0x283470-0x0;var _0x55d54a=_0x626e[_0x283470];return _0x55d54a;};'use strict';var _=require(_0xe626('0x0'));var fs=require('fs');var util=require(_0xe626('0x1'));var path=require(_0xe626('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xe626('0x3'));var PdfPrinter=require(_0xe626('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xe626('0x5'));var JSDOM=require(_0xe626('0x6'))[_0xe626('0x7')];var window=new JSDOM('')[_0xe626('0x8')];var BPromise=require(_0xe626('0x9'));var db=require(_0xe626('0xa'))['db'];var dbH=require(_0xe626('0xa'))[_0xe626('0xb')];var logger=require(_0xe626('0xc'))(_0xe626('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xe626('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xe626('0xe')][0x5];var FORMAT=_0xe626('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x14a7be,_0x37db39){var _0x4289d3={'status':_0x14a7be};var _0x45dd9c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37db39){_0x4289d3[_0xe626('0x10')]=_0x37db39;}return db[_0xe626('0x11')][_0xe626('0x12')](_0x4289d3,_0x45dd9c);}function getHeaders(_0x52b63a){return _['map'](_0x52b63a,function(_0x50e76d){return{'text':_0x50e76d,'style':'tableHeader'};});}function getRows(_0x13c09c,_0x269649){return _[_0xe626('0x13')](_0x269649,function(_0x5deec2){return _(_0x5deec2)[_0xe626('0x14')](_0x13c09c)[_0xe626('0x13')](function(_0x2244bb){return _0x2244bb?_[_0xe626('0x15')](_0x2244bb):'';})[_0xe626('0x16')]();});}function createTable(_0x42086c,_0x4d0691){var _0x597040={'widths':_[_0xe626('0x17')](Array(_0x42086c[_0xe626('0x18')]),0x91),'heights':function(_0x45fcda){return _0x45fcda===0x0?_0xe626('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x144d33=getHeaders(_0x42086c);_0x597040['body'][_0xe626('0x1a')](_0x144d33);var _0x5d3648=getRows(_0x42086c,_0x4d0691);_0x597040[_0xe626('0x1b')]=_0x597040[_0xe626('0x1b')][_0xe626('0x1c')](_0x5d3648);return _0x597040;}function createTables(_0x561ec5){var _0x27af86=[];var _0xb5b9ea=_[_0xe626('0x1d')](Object['keys'](_0x561ec5[0x0]),0x5);_0xb5b9ea[_0xe626('0x1e')](function(_0x508a96){_0x27af86[_0xe626('0x1a')](createTable(_0x508a96,_0x561ec5));});return _0x27af86;}function getPDFDocDefinition(_0x4bd995){var _0x4ea124=util[_0xe626('0x1f')](_0xe626('0x20'),NAME,EXTRACTED_REPORT[_0xe626('0x21')],moment(EXTRACTED_REPORT[_0xe626('0x22')])[_0xe626('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0xe626('0x23')])['format'](FORMAT));var _0x7f0811=[];for(var _0x2d977d=0x0;_0x2d977d<_0x4bd995[_0xe626('0x18')];_0x2d977d++){var _0x10f57e=[];if(_0x2d977d===0x0){_0x10f57e[_0xe626('0x1a')]({'text':_0x4ea124,'style':_0xe626('0x24')});}var _0x1abfcd={'table':_0x4bd995[_0x2d977d]};if(_0x2d977d>0x0){_0x1abfcd[_0xe626('0x25')]=_0xe626('0x26');_0x1abfcd['margin']=[0x0,0x46,0x0,0x0];}_0x10f57e['push'](_0x1abfcd);_0x7f0811[_0xe626('0x1a')](_0x10f57e);}return{'pageSize':'A4','pageOrientation':_0xe626('0x27'),'content':_0x7f0811,'footer':function(_0x5e0c8b,_0x45266c){return{'text':_0x5e0c8b[_0xe626('0x15')]()+_0xe626('0x28')+_0x45266c,'style':_0xe626('0x29')};},'defaultStyle':{'font':_0xe626('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe626('0x2b')},'footer':{'alignment':_0xe626('0x2c'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4b623f){var _0x46890f=0x1388;var _0x585b07;if(!_0x4b623f[0x0][_0xe626('0x2d')]){return analyticExtractedReport(_0xe626('0x2e'));}return db[_0xe626('0x2f')][_0xe626('0x30')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe626('0x31'),_0xe626('0x32')]})[_0xe626('0x33')](function(_0x1eaeb3){if(_0x1eaeb3){_0x585b07=_0x1eaeb3;_0x46890f=_0x585b07[_0xe626('0x32')]||0x3e8;}})[_0xe626('0x33')](function(){var _0x4dd063=[];var _0x24115d=0x0;if(_0x585b07[_0xe626('0x31')]){if(_0x4b623f&&_0x4b623f['length']){var _0x2194b6=_['range'](_0x4b623f[0x0][_0xe626('0x2d')]/_0x46890f);var _0x59ff4e=Number[_0xe626('0x34')](_0x4b623f[0x0][_0xe626('0x2d')]/_0x46890f)?_0x4b623f[0x0][_0xe626('0x2d')]%_0x46890f:0x0;_0x2194b6['forEach'](function(_0x125437){if(_0x125437>0x0){_0x24115d+=_0x46890f;}_0x4dd063[_0xe626('0x1a')](dbH[_0xe626('0x35')][_0xe626('0x36')](util[_0xe626('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x46890f,_0x24115d),{'type':dbH[_0xe626('0x35')][_0xe626('0x37')][_0xe626('0x38')]}));});if(_0x59ff4e>0x0){_0x24115d+=_0x46890f;_0x4dd063[_0xe626('0x1a')](dbH[_0xe626('0x35')]['query'](util[_0xe626('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x59ff4e,_0x24115d),{'type':dbH[_0xe626('0x35')][_0xe626('0x37')][_0xe626('0x38')]}));}}}else{_0x4dd063[_0xe626('0x1a')](dbH[_0xe626('0x35')][_0xe626('0x36')](QUERY,{'type':dbH[_0xe626('0x35')][_0xe626('0x37')]['SELECT']}));}var _0xb9e5d8=path[_0xe626('0x39')](PATH);var _0x318300=path[_0xe626('0x3a')](PATH,_0xe626('0x3b'));var _0x2e0a4=_0x585b07['split']&&_0x4dd063['length']>0x1;var _0x1a2293=[];if(!fs['existsSync'](path[_0xe626('0x3c')](_0xb9e5d8,_0x318300))&&_0x2e0a4){fs[_0xe626('0x3d')](path[_0xe626('0x3c')](_0xb9e5d8,_0x318300));}return BPromise[_0xe626('0x3e')](_0x4dd063,function(_0x2be2e0){_0x1a2293[_0xe626('0x1a')](_0x2be2e0);})[_0xe626('0x33')](function(){var _0x5eb2ad=[];for(var _0x220d60=0x0;_0x220d60<_0x1a2293['length'];_0x220d60+=0x1){var _0x2af5a9=_0x1a2293[_0x220d60];var _0x465b4a=createTables(_[_0xe626('0x3f')](_0x2af5a9));var _0x4d8e61;var _0x2b2ab9=getPDFDocDefinition(_0x465b4a);var _0x51583d=getPDFPrinter();var _0x3803bd=_0x51583d[_0xe626('0x40')](_0x2b2ab9);if(_0x2e0a4){_0x4d8e61=path[_0xe626('0x3c')](_0xb9e5d8,_0x318300,util[_0xe626('0x1f')]('%s%d.%s',_0x318300,_0x220d60,_0xe626('0x41')));}else{_0x4d8e61=path[_0xe626('0x3c')](_0xb9e5d8,util['format'](_0xe626('0x42'),_0x318300,'pdf'));}_0x5eb2ad[_0xe626('0x1a')](writePDFDocument(_0x3803bd,_0x4d8e61));}return Promise[_0xe626('0x43')](_0x5eb2ad);})[_0xe626('0x33')](function(){if(_0x2e0a4){return new Promise(function(_0x11b604){zipdir(path[_0xe626('0x3c')](_0xb9e5d8,_0x318300),{'saveTo':path[_0xe626('0x3c')](_0xb9e5d8,util['format'](_0xe626('0x42'),_0x318300,_0xe626('0x44')))},function(){rimraf(path['join'](_0xb9e5d8,_0x318300),function(){});_0x11b604(_0xe626('0x45'));});});}})['then'](function(){if(!_0x2e0a4)return;rimraf(path['join'](_0xb9e5d8,_0x318300),function(){});})['then'](function(){logger[_0xe626('0x46')](util[_0xe626('0x1f')](_0xe626('0x47'),EXTRACTED_REPORT_ID,_0xe626('0x48')));return analyticExtractedReport('Completed',_0x2e0a4?util['format'](_0xe626('0x42'),_0x318300,_0x2e0a4?_0xe626('0x44'):_0xe626('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe626('0x46')](util[_0xe626('0x1f')](_0xe626('0x49'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xe626('0x11')][_0xe626('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe626('0x33')](function(_0x50c5bd){EXTRACTED_REPORT=_0x50c5bd;return dbH['sequelize'][_0xe626('0x36')](util[_0xe626('0x1f')](_0xe626('0x4b'),QUERY),{'type':dbH[_0xe626('0x35')]['QueryTypes'][_0xe626('0x38')]});})['then'](extractReport)[_0xe626('0x4c')](function(_0x31855){logger[_0xe626('0x46')](util[_0xe626('0x1f')](_0xe626('0x4d'),EXTRACTED_REPORT_ID,_0xe626('0x48')),util[_0xe626('0x4e')](_0x31855,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe626('0x4f'));})['finally'](function(){process[_0xe626('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x413693=new PdfPrinter({'Arial':{'normal':__dirname+_0xe626('0x51'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xe626('0x52'),'bolditalics':__dirname+_0xe626('0x53')}});return _0x413693;}function getPDFDocDefinitionFromHTML(_0x16ef45,_0x53bc6b){var _0x193c84=util['format']('%s\x20#%d',_0x53bc6b[_0xe626('0x54')],_0x53bc6b[_0xe626('0x55')]);var _0x30e1db=moment()[_0xe626('0x1f')](_0xe626('0x56'))[_0xe626('0x15')]();var _0xfbb8e1=htmlToPdfmake(_0x16ef45,{'window':window,'tableAutoSize':!![]});return{'content':[_0xfbb8e1],'defaultStyle':{'font':_0xe626('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe626('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xe626('0x57')}},'header':function(){return[{'text':_0xe626('0x58'),'style':'header'}];},'footer':function(_0xc68560,_0x223544){return[{'text':util['format'](_0xe626('0x59'),_0x193c84,_0xc68560,_0x223544,_0x30e1db),'style':_0xe626('0x29')}];}};}function writePDFDocument(_0x4796fd,_0x389f52){return new Promise(function(_0x504e60,_0x4f0d7b){var _0x3fea54=_0x4796fd[_0xe626('0x5a')](fs[_0xe626('0x5b')](_0x389f52));_0x3fea54['on'](_0xe626('0x5c'),function(){_0x504e60(_0xe626('0x5c'));});_0x3fea54['on'](_0xe626('0x5d'),function(_0x20916d){_0x4f0d7b(_0x20916d);});_0x4796fd[_0xe626('0x5e')]();});}exports['createPdfFromHTML']=function(_0x5b5a7a,_0x392d4d){var _0x32f56f=getPDFPrinter();var _0x195b0b=getPDFDocDefinitionFromHTML(_0x5b5a7a,_0x392d4d);var _0x5ea8fe=_0x32f56f[_0xe626('0x40')](_0x195b0b);return writePDFDocument(_0x5ea8fe,_0x392d4d[_0xe626('0x2')])[_0xe626('0x4c')](function(_0x579d51){throw _0x579d51;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 99d7c94..0f65553 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 _0xe237=['push','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','Empty','length','range','isInteger','format','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','mkdirSync'];(function(_0x52960a,_0x361928){var _0x3d0be0=function(_0x4b3b0a){while(--_0x4b3b0a){_0x52960a['push'](_0x52960a['shift']());}};_0x3d0be0(++_0x361928);}(_0xe237,0xd4));var _0x7e23=function(_0x44b0ad,_0x2a34c7){_0x44b0ad=_0x44b0ad-0x0;var _0x4fbe13=_0xe237[_0x44b0ad];return _0x4fbe13;};'use strict';var util=require(_0x7e23('0x0'));var path=require(_0x7e23('0x1'));var _=require(_0x7e23('0x2'));var fs=require('fs');var json2xls=require(_0x7e23('0x3'));var BPromise=require(_0x7e23('0x4'));var zipdir=require(_0x7e23('0x5'));var rimraf=require(_0x7e23('0x6'));var db=require(_0x7e23('0x7'))['db'];var dbH=require(_0x7e23('0x7'))[_0x7e23('0x8')];var logger=require(_0x7e23('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7e23('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7e23('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x22e41d,_0x16800d){var _0x2e18e9={'status':_0x22e41d};var _0x82a49c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x16800d){_0x2e18e9['savename']=_0x16800d;}return db[_0x7e23('0xb')][_0x7e23('0xc')](_0x2e18e9,_0x82a49c);}function main(){var _0x581e73=0x1388;var _0x2cef69;logger[_0x7e23('0xd')](util['format'](_0x7e23('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x7e23('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7e23('0x10'),_0x7e23('0x11')]})['then'](function(_0xbcf674){if(_0xbcf674){_0x2cef69=_0xbcf674;_0x581e73=_0x2cef69[_0x7e23('0x11')]||0x1388;}})[_0x7e23('0x12')](function(){return dbH[_0x7e23('0x13')][_0x7e23('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x7e23('0x15')][_0x7e23('0x16')]});})[_0x7e23('0x12')](function(_0x1b7297){if(!_0x1b7297[0x0]['num']){return analyticExtractedReport(_0x7e23('0x17'));}var _0x1e3a83=[];var _0x39b9fb=0x0;if(_0x2cef69[_0x7e23('0x10')]){if(_0x1b7297&&_0x1b7297[_0x7e23('0x18')]){var _0x3bcff5=_[_0x7e23('0x19')](_0x1b7297[0x0]['num']/_0x581e73);var _0x1cd829=Number[_0x7e23('0x1a')](_0x1b7297[0x0]['num']/_0x581e73)?_0x1b7297[0x0]['num']%_0x581e73:0x0;_0x3bcff5['forEach'](function(_0x527d3e){if(_0x527d3e>0x0){_0x39b9fb+=_0x581e73;}_0x1e3a83['push'](dbH['sequelize'][_0x7e23('0x14')](util[_0x7e23('0x1b')](_0x7e23('0x1c'),QUERY,_0x581e73,_0x39b9fb),{'type':dbH[_0x7e23('0x13')][_0x7e23('0x15')][_0x7e23('0x16')]}));});if(_0x1cd829>0x0){_0x39b9fb+=_0x581e73;_0x1e3a83['push'](dbH['sequelize'][_0x7e23('0x14')](util[_0x7e23('0x1b')](_0x7e23('0x1c'),QUERY,_0x1cd829,_0x39b9fb),{'type':dbH['sequelize']['QueryTypes'][_0x7e23('0x16')]}));}}}else{_0x1e3a83['push'](dbH['sequelize'][_0x7e23('0x14')](QUERY,{'type':dbH[_0x7e23('0x13')][_0x7e23('0x15')][_0x7e23('0x16')]}));}var _0x24b3c2=path['dirname'](PATH);var _0x5b6227=path[_0x7e23('0x1d')](PATH,_0x7e23('0x1e'));var _0x1b6412=_0x2cef69[_0x7e23('0x10')]&&_0x1e3a83['length']>0x1;var _0x5ae464=[];if(!fs[_0x7e23('0x1f')](path['join'](_0x24b3c2,_0x5b6227))&&_0x1b6412){fs[_0x7e23('0x20')](path['join'](_0x24b3c2,_0x5b6227));}return BPromise['each'](_0x1e3a83,function(_0x337c91){_0x5ae464[_0x7e23('0x21')](_0x337c91);})[_0x7e23('0x12')](function(){for(var _0x2aac33=0x0;_0x2aac33<_0x5ae464[_0x7e23('0x18')];_0x2aac33+=0x1){var _0x1f2161;var _0xa36bef=_0x5ae464[_0x2aac33];if(_0x1b6412){_0x1f2161=path[_0x7e23('0x22')](_0x24b3c2,_0x5b6227,util[_0x7e23('0x1b')](_0x7e23('0x23'),_0x5b6227,_0x2aac33,_0x7e23('0x24')));}else{_0x1f2161=path[_0x7e23('0x22')](_0x24b3c2,util[_0x7e23('0x1b')]('%s.%s',_0x5b6227,_0x7e23('0x24')));}fs[_0x7e23('0x25')](_0x1f2161,json2xls(_0xa36bef),_0x7e23('0x26'));}})[_0x7e23('0x12')](function(){if(_0x1b6412){return new Promise(function(_0xd85a9a){zipdir(path['join'](_0x24b3c2,_0x5b6227),{'saveTo':path[_0x7e23('0x22')](_0x24b3c2,util[_0x7e23('0x1b')](_0x7e23('0x27'),_0x5b6227,_0x7e23('0x28')))},function(_0x4dfade,_0xc894ee){rimraf(path[_0x7e23('0x22')](_0x24b3c2,_0x5b6227),function(){});_0xd85a9a(_0x7e23('0x29'));});});}})[_0x7e23('0x12')](function(){logger[_0x7e23('0xd')](util['format'](_0x7e23('0x2a'),EXTRACTED_REPORT_ID,_0x7e23('0x2b')));return analyticExtractedReport(_0x7e23('0x2c'),_0x1b6412?util['format']('%s.%s',_0x5b6227,_0x1b6412?'zip':'xlsx'):null);});})[_0x7e23('0x2d')](function(_0x4d47e9){logger[_0x7e23('0xd')](util['format'](_0x7e23('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x4d47e9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7e23('0x2f'));})[_0x7e23('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc113=['basename','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT'];(function(_0x2514d9,_0xf40264){var _0x56a449=function(_0x5b2cc0){while(--_0x5b2cc0){_0x2514d9['push'](_0x2514d9['shift']());}};_0x56a449(++_0xf40264);}(_0xc113,0x1ab));var _0x3c11=function(_0x476b5b,_0x44122f){_0x476b5b=_0x476b5b-0x0;var _0x18e6fd=_0xc113[_0x476b5b];return _0x18e6fd;};'use strict';var util=require(_0x3c11('0x0'));var path=require(_0x3c11('0x1'));var _=require(_0x3c11('0x2'));var fs=require('fs');var json2xls=require(_0x3c11('0x3'));var BPromise=require(_0x3c11('0x4'));var zipdir=require(_0x3c11('0x5'));var rimraf=require(_0x3c11('0x6'));var db=require(_0x3c11('0x7'))['db'];var dbH=require(_0x3c11('0x7'))['dbH'];var logger=require(_0x3c11('0x8'))(_0x3c11('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3c11('0xa')][0x3];var PATH=process[_0x3c11('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fa44d,_0x5d6f91){var _0x16959a={'status':_0x2fa44d};var _0x4e98c0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d6f91){_0x16959a['savename']=_0x5d6f91;}return db['AnalyticExtractedReport'][_0x3c11('0xb')](_0x16959a,_0x4e98c0);}function main(){var _0x23d4ad=0x1388;var _0x5275df;logger[_0x3c11('0xc')](util[_0x3c11('0xd')](_0x3c11('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x3c11('0xf')][_0x3c11('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3c11('0x11'),_0x3c11('0x12')]})[_0x3c11('0x13')](function(_0x58c7c8){if(_0x58c7c8){_0x5275df=_0x58c7c8;_0x23d4ad=_0x5275df[_0x3c11('0x12')]||0x1388;}})[_0x3c11('0x13')](function(){return dbH['sequelize'][_0x3c11('0x14')](util[_0x3c11('0xd')](_0x3c11('0x15'),QUERY),{'type':dbH[_0x3c11('0x16')][_0x3c11('0x17')]['SELECT']});})[_0x3c11('0x13')](function(_0x2ba437){if(!_0x2ba437[0x0][_0x3c11('0x18')]){return analyticExtractedReport(_0x3c11('0x19'));}var _0x1d05f2=[];var _0x5b223f=0x0;if(_0x5275df['split']){if(_0x2ba437&&_0x2ba437['length']){var _0x43ee61=_[_0x3c11('0x1a')](_0x2ba437[0x0][_0x3c11('0x18')]/_0x23d4ad);var _0x42db8d=Number[_0x3c11('0x1b')](_0x2ba437[0x0][_0x3c11('0x18')]/_0x23d4ad)?_0x2ba437[0x0][_0x3c11('0x18')]%_0x23d4ad:0x0;_0x43ee61[_0x3c11('0x1c')](function(_0x3c2a18){if(_0x3c2a18>0x0){_0x5b223f+=_0x23d4ad;}_0x1d05f2['push'](dbH['sequelize'][_0x3c11('0x14')](util['format'](_0x3c11('0x1d'),QUERY,_0x23d4ad,_0x5b223f),{'type':dbH['sequelize'][_0x3c11('0x17')]['SELECT']}));});if(_0x42db8d>0x0){_0x5b223f+=_0x23d4ad;_0x1d05f2[_0x3c11('0x1e')](dbH['sequelize']['query'](util[_0x3c11('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x42db8d,_0x5b223f),{'type':dbH[_0x3c11('0x16')][_0x3c11('0x17')][_0x3c11('0x1f')]}));}}}else{_0x1d05f2[_0x3c11('0x1e')](dbH[_0x3c11('0x16')]['query'](QUERY,{'type':dbH[_0x3c11('0x16')]['QueryTypes'][_0x3c11('0x1f')]}));}var _0x414c02=path['dirname'](PATH);var _0x29f3cd=path[_0x3c11('0x20')](PATH,_0x3c11('0x21'));var _0x2df95d=_0x5275df[_0x3c11('0x11')]&&_0x1d05f2[_0x3c11('0x22')]>0x1;var _0x1af1fb=[];if(!fs[_0x3c11('0x23')](path[_0x3c11('0x24')](_0x414c02,_0x29f3cd))&&_0x2df95d){fs[_0x3c11('0x25')](path['join'](_0x414c02,_0x29f3cd));}return BPromise[_0x3c11('0x26')](_0x1d05f2,function(_0x3de4ab){_0x1af1fb[_0x3c11('0x1e')](_0x3de4ab);})[_0x3c11('0x13')](function(){for(var _0x50aec6=0x0;_0x50aec6<_0x1af1fb[_0x3c11('0x22')];_0x50aec6+=0x1){var _0x21401c;var _0x5151b0=_0x1af1fb[_0x50aec6];if(_0x2df95d){_0x21401c=path[_0x3c11('0x24')](_0x414c02,_0x29f3cd,util[_0x3c11('0xd')](_0x3c11('0x27'),_0x29f3cd,_0x50aec6,_0x3c11('0x28')));}else{_0x21401c=path[_0x3c11('0x24')](_0x414c02,util[_0x3c11('0xd')](_0x3c11('0x29'),_0x29f3cd,_0x3c11('0x28')));}fs['writeFileSync'](_0x21401c,json2xls(_0x5151b0),_0x3c11('0x2a'));}})[_0x3c11('0x13')](function(){if(_0x2df95d){return new Promise(function(_0x1ec787){zipdir(path[_0x3c11('0x24')](_0x414c02,_0x29f3cd),{'saveTo':path[_0x3c11('0x24')](_0x414c02,util[_0x3c11('0xd')](_0x3c11('0x29'),_0x29f3cd,'zip'))},function(_0xe9a49f,_0x6db1f0){rimraf(path[_0x3c11('0x24')](_0x414c02,_0x29f3cd),function(){});_0x1ec787(_0x3c11('0x2b'));});});}})[_0x3c11('0x13')](function(){logger[_0x3c11('0xc')](util['format'](_0x3c11('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x2df95d?util[_0x3c11('0xd')](_0x3c11('0x29'),_0x29f3cd,_0x2df95d?'zip':_0x3c11('0x28')):null);});})[_0x3c11('0x2d')](function(_0x19b137){logger['info'](util[_0x3c11('0xd')](_0x3c11('0x2e'),EXTRACTED_REPORT_ID,_0x3c11('0x2f')),util[_0x3c11('0x30')](_0x19b137,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3c11('0x31')](function(){process[_0x3c11('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 781127f..931f1fb 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 _0xc708=['queue','playback','hasOwnProperty','priority','extension','find','push','type','format','CDR(type)=%s','VoiceExtensionId','inbound','extensions','Set','CDR(routeid)=','context','outbound','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','indexOf','toLowerCase','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','map','filter','exten'];(function(_0x10af9f,_0x258e28){var _0x1ba580=function(_0x2da9b6){while(--_0x2da9b6){_0x10af9f['push'](_0x10af9f['shift']());}};_0x1ba580(++_0x258e28);}(_0xc708,0xd0));var _0x8c70=function(_0x5e3fb7,_0x4f0c05){_0x5e3fb7=_0x5e3fb7-0x0;var _0x3c9228=_0xc708[_0x5e3fb7];return _0x3c9228;};'use strict';var _=require(_0x8c70('0x0'));var util=require(_0x8c70('0x1'));function rewrite(_0x15efec,_0x599f98){var _0x7767a8=this;return _0x15efec[_0x8c70('0x2')][_0x8c70('0x3')]['findAll']({'raw':!![]})[_0x8c70('0x4')](function(_0x2061e0){_0x7767a8[_0x8c70('0x5')]=_0x2061e0;return _0x15efec[_0x8c70('0x2')][_0x8c70('0x6')][_0x8c70('0x7')]({'where':{'IntervalId':_0x599f98['IntervalId']},'raw':!![]});})[_0x8c70('0x4')](function(_0x490286){return _0x15efec['models'][_0x8c70('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x8c70('0x8')](_0x490286,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x8c70('0x4')](function(_0x5824c9){var _0x43f72c=_[_0x8c70('0x9')](_0x5824c9,{'priority':'1'});var _0x20b340=_['filter'](_0x5824c9,{'isApp':0x1});var _0x36fdb1=_['groupBy'](_0x20b340,_0x8c70('0xa'));var _0x51cfaa=[_0x8c70('0xb'),_0x8c70('0xc')];var _0x375254=[];var _0x4a1147=[];for(var _0x3e3704 in _0x36fdb1){if(_0x36fdb1[_0x8c70('0xd')](_0x3e3704)){_0x7767a8[_0x8c70('0xe')]=0x2;_0x7767a8['extensions']=[];_0x7767a8[_0x8c70('0xf')]=_[_0x8c70('0x10')](_0x43f72c,{'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')]});_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':'Set','appdata':util[_0x8c70('0x13')](_0x8c70('0x14'),_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')]),'context':_0x36fdb1[_0x3e3704][0x0]['context'],'exten':_0x36fdb1[_0x3e3704][0x0]['exten'],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});if(_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')]===_0x8c70('0x16')){_0x7767a8[_0x8c70('0x17')]['push']({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x19')+_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')],'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});}else if(_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')]===_0x8c70('0x1b')){if(_0x7767a8['extension']){_0x7767a8[_0x8c70('0x17')][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':'Set','appdata':'CDR(destination)='+(_0x7767a8['extension']['cutdigits']?_0x8c70('0x1c')+_0x7767a8[_0x8c70('0xf')]['cutdigits']+'}':_0x8c70('0x1d')),'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0]['VoiceExtensionId']});}_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x19')+_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')],'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8['priority']++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});var _0x63d60=_0x7767a8['priority']++;_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x1e'),'appdata':_0x8c70('0x1f')+(_0x63d60+0x2)+_0x8c70('0x20')+(_0x63d60+0x1)+')','context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0]['exten'],'priority':_0x63d60,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});if(_0x7767a8[_0x8c70('0xf')]){_0x7767a8[_0x8c70('0x17')]['push']({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x7767a8[_0x8c70('0xf')][_0x8c70('0x21')]?_0x8c70('0x22')+_0x7767a8[_0x8c70('0xf')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x36fdb1[_0x3e3704][0x0]['context'],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});}_0x7767a8['extensions']['push']({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':'Set','appdata':_0x8c70('0x23')+_0x36fdb1[_0x3e3704][0x0]['VoiceExtensionId'],'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0]['exten'],'priority':_0x7767a8['priority']++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});if(_0x7767a8[_0x8c70('0xf')]&&_0x7767a8[_0x8c70('0xf')]['hasOwnProperty'](_0x8c70('0x24'))&&_0x7767a8[_0x8c70('0xf')][_0x8c70('0x24')]!==_0x8c70('0x25')){_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':'Set','appdata':_0x8c70('0x26'),'context':_0x36fdb1[_0x3e3704][0x0]['context'],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0]['VoiceExtensionId']});_0x7767a8[_0x8c70('0x17')][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x27')+_0x7767a8[_0x8c70('0xf')][_0x8c70('0x24')]||_0x8c70('0x28'),'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});}}_0x7767a8[_0x8c70('0x17')][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0]['type'],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x29'),'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0]['exten'],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x2a'),'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});_0x7767a8['extensions'][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x2b'),'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'priority':_0x7767a8[_0x8c70('0xe')]++,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});for(var _0x1c871e=0x0,_0x3b3524=0x0;_0x1c871e<_0x36fdb1[_0x3e3704][_0x8c70('0x2c')];_0x1c871e+=0x1,_0x3b3524=0x0){var _0x3cdbde=_0x36fdb1[_0x3e3704][_0x1c871e];if(_0x3cdbde[_0x8c70('0x12')]){_0x3cdbde['type']=_0x3cdbde[_0x8c70('0x12')]['toLowerCase']();}var _0x1fab71=[];var _0x40164c=[];delete _0x3cdbde['id'];delete _0x3cdbde[_0x8c70('0x2d')];delete _0x3cdbde[_0x8c70('0x2e')];var _0x43a24f=_0x3cdbde[_0x8c70('0x2f')]!==_0x8c70('0x30')?[_0x3cdbde['interval']]:_0x3cdbde[_0x8c70('0x31')]?_['map'](_[_0x8c70('0x9')](_0x7767a8[_0x8c70('0x5')],{'IntervalId':_0x3cdbde[_0x8c70('0x31')]}),_0x8c70('0x2f')):[];if(_0x3cdbde['hasOwnProperty'](_0x8c70('0x32'))){if(_0x3cdbde[_0x8c70('0x32')]&&_0x3cdbde[_0x8c70('0x32')]!=='--'){_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde['type'],'app':'Set','appdata':_0x8c70('0x33')+_0x3cdbde[_0x8c70('0x32')],'context':_0x3cdbde['context'],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f['length']+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});}}if(_0x3cdbde['type']===_0x8c70('0x1b')&&_0x3cdbde[_0x8c70('0xd')](_0x8c70('0x34'))){if(_0x3cdbde[_0x8c70('0x34')]){_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde[_0x8c70('0x12')],'app':_0x8c70('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3cdbde[_0x8c70('0x34')]+')','context':_0x3cdbde['context'],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f[_0x8c70('0x2c')]+_0x7767a8['priority']+_0x3b3524++,'VoiceExtensionId':_0x3cdbde['VoiceExtensionId']});}else{_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde[_0x8c70('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x3cdbde[_0x8c70('0x1a')],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f[_0x8c70('0x2c')]+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});}}if(_0x3cdbde['hasOwnProperty']('answer')){if(_0x51cfaa[_0x8c70('0x35')](_0x3cdbde['app'][_0x8c70('0x36')]())>=0x0&&_0x3cdbde[_0x8c70('0x37')]!==_0x8c70('0x38')){if(_0x3cdbde[_0x8c70('0x39')]){_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde[_0x8c70('0x12')],'app':_0x8c70('0x1e'),'appdata':_0x8c70('0x3a'),'context':_0x3cdbde[_0x8c70('0x1a')],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f[_0x8c70('0x2c')]+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});_0x1fab71['push']({'type':_0x3cdbde[_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3cdbde[_0x8c70('0x1a')],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f['length']+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});}else{_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde['type'],'app':'ExecIf','appdata':_0x8c70('0x3b'),'context':_0x3cdbde[_0x8c70('0x1a')],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f[_0x8c70('0x2c')]+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});_0x1fab71[_0x8c70('0x11')]({'type':_0x3cdbde[_0x8c70('0x12')],'app':_0x8c70('0x18'),'appdata':_0x8c70('0x3c'),'context':_0x3cdbde[_0x8c70('0x1a')],'exten':_0x3cdbde[_0x8c70('0xa')],'priority':_0x43a24f[_0x8c70('0x2c')]+_0x7767a8[_0x8c70('0xe')]+_0x3b3524++,'VoiceExtensionId':_0x3cdbde[_0x8c70('0x15')]});}}}for(var _0x4a989c=0x0;_0x4a989c<_0x43a24f['length'];_0x4a989c+=0x1){var _0x1e1cfc=_0x7767a8[_0x8c70('0xe')]+_0x43a24f[_0x8c70('0x2c')];var _0x17eeb3=_0x4a989c===_0x43a24f[_0x8c70('0x2c')]-0x1?_0x7767a8['priority']+_0x1fab71['length']+_0x40164c[_0x8c70('0x2c')]+0x2:_0x7767a8[_0x8c70('0xe')]+_0x4a989c+0x1;_0x1fab71[_0x8c70('0x3d')](_0x4a989c,0x0,{'type':_0x3cdbde[_0x8c70('0x12')],'app':_0x8c70('0x3e'),'appdata':_0x43a24f[_0x4a989c]+'?'+_0x3cdbde[_0x8c70('0x1a')]+',${EXTEN},'+_0x1e1cfc+':'+_0x3cdbde[_0x8c70('0x1a')]+_0x8c70('0x3f')+_0x17eeb3,'exten':_0x3cdbde[_0x8c70('0xa')],'context':_0x3cdbde['context'],'priority':_0x7767a8['priority']+_0x4a989c,'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0]['VoiceExtensionId']});}_0x3cdbde['priority']=_0x1fab71[_0x8c70('0x2c')]?_[_0x8c70('0x40')](_0x1fab71)[_0x8c70('0xe')]+0x1:_0x7767a8['priority'];_0x7767a8[_0x8c70('0xe')]=(_0x40164c[_0x8c70('0x2c')]?_[_0x8c70('0x40')](_0x40164c)[_0x8c70('0xe')]:_0x3cdbde[_0x8c70('0xe')])+0x1;_0x7767a8['extensions']=_[_0x8c70('0x41')](_0x7767a8['extensions'],_0x1fab71,[_0x3cdbde],_0x40164c);}_0x7767a8[_0x8c70('0x17')][_0x8c70('0x11')]({'type':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x12')],'app':_0x8c70('0x42'),'exten':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0xa')],'context':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x1a')],'priority':_0x7767a8[_0x8c70('0xe')],'VoiceExtensionId':_0x36fdb1[_0x3e3704][0x0][_0x8c70('0x15')]});_0x375254[_0x8c70('0x11')](_0x36fdb1[_0x3e3704][0x0]['VoiceExtensionId']);_0x4a1147=_['concat'](_0x4a1147,_0x7767a8[_0x8c70('0x17')]);}}return _0x15efec[_0x8c70('0x43')](function(_0x496f69){return _0x15efec[_0x8c70('0x2')][_0x8c70('0x6')][_0x8c70('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x375254}},'transaction':_0x496f69})[_0x8c70('0x4')](function(_0x16bc8a){return _0x15efec['models'][_0x8c70('0x6')][_0x8c70('0x45')](_[_0x8c70('0x46')](_0x4a1147,'priority'),{'transaction':_0x496f69});});});})['catch'](function(_0x174cbd){console[_0x8c70('0x47')](_0x174cbd);});}exports[_0x8c70('0x48')]=rewrite; \ No newline at end of file +var _0x0666=['exten','filter','groupBy','playback','hasOwnProperty','extensions','extension','push','type','Set','CDR(type)=%s','context','priority','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','then','intervals','models','VoiceExtension','findAll','uniq'];(function(_0x72fd2b,_0x35355b){var _0x55c56f=function(_0x589fcb){while(--_0x589fcb){_0x72fd2b['push'](_0x72fd2b['shift']());}};_0x55c56f(++_0x35355b);}(_0x0666,0xd0));var _0x6066=function(_0x12baed,_0x45a719){_0x12baed=_0x12baed-0x0;var _0x630772=_0x0666[_0x12baed];return _0x630772;};'use strict';var _=require(_0x6066('0x0'));var util=require(_0x6066('0x1'));function rewrite(_0x52096f,_0x4076ea){var _0xb3465e=this;return _0x52096f['models']['Interval']['findAll']({'raw':!![]})[_0x6066('0x2')](function(_0x504e4f){_0xb3465e[_0x6066('0x3')]=_0x504e4f;return _0x52096f[_0x6066('0x4')][_0x6066('0x5')][_0x6066('0x6')]({'where':{'IntervalId':_0x4076ea['IntervalId']},'raw':!![]});})['then'](function(_0x5d2375){return _0x52096f['models'][_0x6066('0x5')][_0x6066('0x6')]({'where':{'exten':{'$in':_[_0x6066('0x7')](_['map'](_0x5d2375,_0x6066('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6066('0x2')](function(_0x47b9a3){var _0x54df5e=_[_0x6066('0x9')](_0x47b9a3,{'priority':'1'});var _0x334d6c=_['filter'](_0x47b9a3,{'isApp':0x1});var _0x307739=_[_0x6066('0xa')](_0x334d6c,_0x6066('0x8'));var _0x473e34=['queue',_0x6066('0xb')];var _0x44d123=[];var _0xbf0dd2=[];for(var _0x5ed85b in _0x307739){if(_0x307739[_0x6066('0xc')](_0x5ed85b)){_0xb3465e['priority']=0x2;_0xb3465e[_0x6066('0xd')]=[];_0xb3465e[_0x6066('0xe')]=_['find'](_0x54df5e,{'exten':_0x307739[_0x5ed85b][0x0]['exten']});_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':util['format'](_0x6066('0x12'),_0x307739[_0x5ed85b][0x0][_0x6066('0x10')]),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0]['exten'],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});if(_0x307739[_0x5ed85b][0x0]['type']==='inbound'){_0xb3465e[_0x6066('0xd')]['push']({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':'Set','appdata':_0x6066('0x16')+_0x307739[_0x5ed85b][0x0]['VoiceExtensionId'],'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});}else if(_0x307739[_0x5ed85b][0x0][_0x6066('0x10')]===_0x6066('0x17')){if(_0xb3465e[_0x6066('0xe')]){_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0]['type'],'app':_0x6066('0x11'),'appdata':_0x6066('0x18')+(_0xb3465e['extension'][_0x6066('0x19')]?_0x6066('0x1a')+_0xb3465e[_0x6066('0xe')]['cutdigits']+'}':_0x6066('0x1b')),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e['priority']++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});}_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':'CDR(routeid)='+_0x307739[_0x5ed85b][0x0]['VoiceExtensionId'],'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});var _0x4baafc=_0xb3465e['priority']++;_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':'ExecIf','appdata':_0x6066('0x1c')+(_0x4baafc+0x2)+'):Goto('+(_0x4baafc+0x1)+')','context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0x4baafc,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0]['VoiceExtensionId']});if(_0xb3465e[_0x6066('0xe')]){_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0]['type'],'app':_0x6066('0x11'),'appdata':_0xb3465e[_0x6066('0xe')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xb3465e[_0x6066('0xe')][_0x6066('0x19')]+'}':_0x6066('0x1d'),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});}_0xb3465e['extensions'][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x1e')+_0x307739[_0x5ed85b][0x0][_0x6066('0x15')],'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});if(_0xb3465e[_0x6066('0xe')]&&_0xb3465e['extension']['hasOwnProperty'](_0x6066('0x1f'))&&_0xb3465e[_0x6066('0xe')][_0x6066('0x1f')]!==_0x6066('0x20')){_0xb3465e[_0x6066('0xd')]['push']({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x21'),'context':_0x307739[_0x5ed85b][0x0]['context'],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x22')+_0xb3465e[_0x6066('0xe')]['recordingFormat']||_0x6066('0x23'),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});}}_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x24'),'context':_0x307739[_0x5ed85b][0x0]['context'],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e['priority']++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0]['type'],'app':_0x6066('0x11'),'appdata':_0x6066('0x25'),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e['priority']++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0]['VoiceExtensionId']});_0xb3465e[_0x6066('0xd')][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x26'),'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'priority':_0xb3465e[_0x6066('0x14')]++,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});for(var _0x4b9ec0=0x0,_0x144f0d=0x0;_0x4b9ec0<_0x307739[_0x5ed85b]['length'];_0x4b9ec0+=0x1,_0x144f0d=0x0){var _0x471e1c=_0x307739[_0x5ed85b][_0x4b9ec0];if(_0x471e1c[_0x6066('0x10')]){_0x471e1c['type']=_0x471e1c['type']['toLowerCase']();}var _0x211cef=[];var _0x7bd8ee=[];delete _0x471e1c['id'];delete _0x471e1c[_0x6066('0x27')];delete _0x471e1c[_0x6066('0x28')];var _0x20eb9e=_0x471e1c[_0x6066('0x29')]!==_0x6066('0x2a')?[_0x471e1c[_0x6066('0x29')]]:_0x471e1c[_0x6066('0x2b')]?_[_0x6066('0x2c')](_['filter'](_0xb3465e[_0x6066('0x3')],{'IntervalId':_0x471e1c['IntervalId']}),'interval'):[];if(_0x471e1c[_0x6066('0xc')](_0x6066('0x2d'))){if(_0x471e1c[_0x6066('0x2d')]&&_0x471e1c['tag']!=='--'){_0x211cef['push']({'type':_0x471e1c[_0x6066('0x10')],'app':'Set','appdata':_0x6066('0x2e')+_0x471e1c[_0x6066('0x2d')],'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e[_0x6066('0x2f')]+_0xb3465e[_0x6066('0x14')]+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});}}if(_0x471e1c[_0x6066('0x10')]===_0x6066('0x17')&&_0x471e1c['hasOwnProperty'](_0x6066('0x30'))){if(_0x471e1c[_0x6066('0x30')]){_0x211cef[_0x6066('0xf')]({'type':_0x471e1c[_0x6066('0x10')],'app':_0x6066('0x31'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x471e1c[_0x6066('0x30')]+')','context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e['length']+_0xb3465e['priority']+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});}else{_0x211cef[_0x6066('0xf')]({'type':_0x471e1c['type'],'app':_0x6066('0x31'),'appdata':_0x6066('0x32'),'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e['length']+_0xb3465e[_0x6066('0x14')]+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});}}if(_0x471e1c['hasOwnProperty'](_0x6066('0x33'))){if(_0x473e34[_0x6066('0x34')](_0x471e1c['app'][_0x6066('0x35')]())>=0x0&&_0x471e1c[_0x6066('0x36')]!==_0x6066('0x37')){if(_0x471e1c[_0x6066('0x33')]){_0x211cef[_0x6066('0xf')]({'type':_0x471e1c[_0x6066('0x10')],'app':_0x6066('0x31'),'appdata':_0x6066('0x38'),'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e[_0x6066('0x2f')]+_0xb3465e[_0x6066('0x14')]+_0x144f0d++,'VoiceExtensionId':_0x471e1c['VoiceExtensionId']});_0x211cef[_0x6066('0xf')]({'type':_0x471e1c['type'],'app':_0x6066('0x11'),'appdata':_0x6066('0x39'),'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e[_0x6066('0x2f')]+_0xb3465e['priority']+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});}else{_0x211cef[_0x6066('0xf')]({'type':_0x471e1c[_0x6066('0x10')],'app':'ExecIf','appdata':_0x6066('0x3a'),'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e[_0x6066('0x2f')]+_0xb3465e['priority']+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});_0x211cef[_0x6066('0xf')]({'type':_0x471e1c[_0x6066('0x10')],'app':_0x6066('0x11'),'appdata':_0x6066('0x3b'),'context':_0x471e1c[_0x6066('0x13')],'exten':_0x471e1c[_0x6066('0x8')],'priority':_0x20eb9e[_0x6066('0x2f')]+_0xb3465e['priority']+_0x144f0d++,'VoiceExtensionId':_0x471e1c[_0x6066('0x15')]});}}}for(var _0x1eb3a2=0x0;_0x1eb3a2<_0x20eb9e[_0x6066('0x2f')];_0x1eb3a2+=0x1){var _0xa880a=_0xb3465e['priority']+_0x20eb9e[_0x6066('0x2f')];var _0x172ff4=_0x1eb3a2===_0x20eb9e[_0x6066('0x2f')]-0x1?_0xb3465e['priority']+_0x211cef[_0x6066('0x2f')]+_0x7bd8ee[_0x6066('0x2f')]+0x2:_0xb3465e[_0x6066('0x14')]+_0x1eb3a2+0x1;_0x211cef[_0x6066('0x3c')](_0x1eb3a2,0x0,{'type':_0x471e1c['type'],'app':_0x6066('0x3d'),'appdata':_0x20eb9e[_0x1eb3a2]+'?'+_0x471e1c[_0x6066('0x13')]+_0x6066('0x3e')+_0xa880a+':'+_0x471e1c[_0x6066('0x13')]+_0x6066('0x3e')+_0x172ff4,'exten':_0x471e1c[_0x6066('0x8')],'context':_0x471e1c[_0x6066('0x13')],'priority':_0xb3465e[_0x6066('0x14')]+_0x1eb3a2,'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});}_0x471e1c['priority']=_0x211cef[_0x6066('0x2f')]?_[_0x6066('0x3f')](_0x211cef)['priority']+0x1:_0xb3465e['priority'];_0xb3465e[_0x6066('0x14')]=(_0x7bd8ee[_0x6066('0x2f')]?_[_0x6066('0x3f')](_0x7bd8ee)[_0x6066('0x14')]:_0x471e1c['priority'])+0x1;_0xb3465e['extensions']=_[_0x6066('0x40')](_0xb3465e['extensions'],_0x211cef,[_0x471e1c],_0x7bd8ee);}_0xb3465e['extensions'][_0x6066('0xf')]({'type':_0x307739[_0x5ed85b][0x0][_0x6066('0x10')],'app':'Hangup','exten':_0x307739[_0x5ed85b][0x0][_0x6066('0x8')],'context':_0x307739[_0x5ed85b][0x0][_0x6066('0x13')],'priority':_0xb3465e[_0x6066('0x14')],'VoiceExtensionId':_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]});_0x44d123['push'](_0x307739[_0x5ed85b][0x0][_0x6066('0x15')]);_0xbf0dd2=_['concat'](_0xbf0dd2,_0xb3465e['extensions']);}}return _0x52096f[_0x6066('0x41')](function(_0x3035f0){return _0x52096f[_0x6066('0x4')][_0x6066('0x5')][_0x6066('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x44d123}},'transaction':_0x3035f0})[_0x6066('0x2')](function(_0x5b649a){return _0x52096f['models'][_0x6066('0x5')][_0x6066('0x43')](_[_0x6066('0x44')](_0xbf0dd2,_0x6066('0x14')),{'transaction':_0x3035f0});});});})[_0x6066('0x45')](function(_0x29e798){console[_0x6066('0x46')](_0x29e798);});}exports[_0x6066('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 9e21e7e..bcd6ff8 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 _0x4eeb=['into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','NOW()','field','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','where','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','calleridnum','\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','outbound','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert'];(function(_0xc231f,_0x113ab4){var _0x3b7792=function(_0x5d7ab4){while(--_0x5d7ab4){_0xc231f['push'](_0xc231f['shift']());}};_0x3b7792(++_0x113ab4);}(_0x4eeb,0x11c));var _0xb4ee=function(_0x23bf8f,_0x57d047){_0x23bf8f=_0x23bf8f-0x0;var _0x3994a7=_0x4eeb[_0x23bf8f];return _0x3994a7;};'use strict';var BPromise=require('bluebird');var util=require(_0xb4ee('0x0'));var _=require(_0xb4ee('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xb4ee('0x2'));var Redis=require(_0xb4ee('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xb4ee('0x4'));var logger=require(_0xb4ee('0x5'))(_0xb4ee('0x6'));config[_0xb4ee('0x7')]=_[_0xb4ee('0x8')](config[_0xb4ee('0x7')],{'host':_0xb4ee('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4ee('0x7')]));require(_0xb4ee('0xa'))[_0xb4ee('0xb')](socket);try{if(!process[_0xb4ee('0xc')][0x2]||process[_0xb4ee('0xc')][0x2]===_0xb4ee('0xd')||process[_0xb4ee('0xc')][0x2]===_0xb4ee('0xe')){throw new Error(_0xb4ee('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0xb4ee('0xc')][0x3]||process[_0xb4ee('0xc')][0x3]===_0xb4ee('0xd')||process[_0xb4ee('0xc')][0x3]===_0xb4ee('0xe')||!process[_0xb4ee('0xc')][0x4]||process['argv'][0x4]===_0xb4ee('0xd')||process[_0xb4ee('0xc')][0x4]==='null'){throw new Error(_0xb4ee('0x10'));}var FIELDS=_[_0xb4ee('0x11')](process[_0xb4ee('0xc')][0x3]['split'](','),process[_0xb4ee('0xc')][0x4][_0xb4ee('0x12')](','));if(!process[_0xb4ee('0xc')][0x5]||process[_0xb4ee('0xc')][0x5]===_0xb4ee('0xd')||process['argv'][0x5]===_0xb4ee('0xe')){throw new Error(_0xb4ee('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xb4ee('0xc')][0x6]&&process[_0xb4ee('0xc')][0x6]!==_0xb4ee('0xd')&&process['argv'][0x6]!==_0xb4ee('0xe')?process[_0xb4ee('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb4ee('0xc')][0x7]!=='undefined'&&process[_0xb4ee('0xc')][0x7]!=='null'?process[_0xb4ee('0xc')][0x7]:null;if(!process[_0xb4ee('0xc')][0x8]||process[_0xb4ee('0xc')][0x8]===_0xb4ee('0xd')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4ff3f9){logger['error'](_0x4ff3f9);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(_0x1ee4ae,_0xdaa614,_0x1f05d8,_0xfdd078){var _0x2b04b2={'message':_0xdaa614};_0x2b04b2[_0x1ee4ae]=!![];if(_0x1f05d8){_0x2b04b2[_0xb4ee('0x14')]=_0x1f05d8;}if(_0xfdd078){_0x2b04b2[_0xb4ee('0x15')]=_0xfdd078;}return _0x2b04b2;}function isEmail(_0x2d251d){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))*$/[_0xb4ee('0x16')](_0x2d251d);}function checkRow(_0x4030ca,_0x3523fe,_0x540993){return new BPromise(function(_0x4a4cd6,_0x28ab32){if(_[_0xb4ee('0x17')](_0x4030ca)){return _0x28ab32(handleCheckRowError(_0xb4ee('0x18'),_0xb4ee('0x19'),null,_0x540993));}if(_0x4030ca['errors']&&_0x4030ca[_0xb4ee('0x1a')][_0xb4ee('0x1b')]){var _0x2e6fa1=_[_0xb4ee('0x1c')](_0x4030ca[_0xb4ee('0x1a')],_0xb4ee('0x1d'))[_0xb4ee('0x1e')](';');return _0x28ab32(handleCheckRowError('error',_0x2e6fa1,null,_0x540993));}var _0x1f5098={};for(var _0x5c2ffe in FIELDS){if(FIELDS[_0xb4ee('0x1f')](_0x5c2ffe)&&FIELDS[_0x5c2ffe]){_0x1f5098[_0x5c2ffe]=_0x4030ca['data'][0x0][FIELDS[_0x5c2ffe]]||_0x4030ca[_0xb4ee('0x20')][0x0]['\ufeff'+FIELDS[_0x5c2ffe]];}}if(!_0x1f5098[_0xb4ee('0x21')]){return _0x28ab32(handleCheckRowError(_0xb4ee('0x18'),_0xb4ee('0x22'),null,_0x540993));}if(!_0x1f5098[_0xb4ee('0x23')]){return _0x28ab32(handleCheckRowError(_0xb4ee('0x18'),_0xb4ee('0x24'),null,_0x540993));}if(_0x1f5098[_0xb4ee('0x25')]){var _0xf88590=moment(_0x1f5098[_0xb4ee('0x25')],'YYYY-MM-DD');if(!_0xf88590[_0xb4ee('0x26')]()){return _0x28ab32(handleCheckRowError(_0xb4ee('0x18'),_0xb4ee('0x27'),null,_0x540993));}}if(_0x1f5098[_0xb4ee('0x28')]){if(!isEmail(_0x1f5098[_0xb4ee('0x28')])){return _0x28ab32(handleCheckRowError(_0xb4ee('0x18'),_0xb4ee('0x29'),null,_0x540993));}}_0x1f5098['ListId']=LISTID;_0x1f5098[_0xb4ee('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3523fe){var _0xd0e8ed={};for(var _0x10d0bf=0x0,_0x4668f7=DUPLICATES['length'];_0x10d0bf<_0x4668f7;_0x10d0bf+=0x1){_0xd0e8ed[DUPLICATES[_0x10d0bf]]=_0x1f5098[DUPLICATES[_0x10d0bf]];}var _0x519da2=_['find'](_0x3523fe,_0xd0e8ed);if(_0x519da2){return _0x28ab32(handleCheckRowError('duplicate',_0xb4ee('0x2b'),_0x519da2,_0x540993));}}return db[_0xb4ee('0x2c')][_0xb4ee('0x2d')](_0x1f5098,{'raw':!![],'hooks':![],'fields':_[_0xb4ee('0x2e')](_0x1f5098)})[_0xb4ee('0x2f')](function(_0x58668b){if(DUPLICATES&&DUPLICATES[_0xb4ee('0x1b')]&&_0x3523fe){_0x3523fe[_0xb4ee('0x30')](_['pick'](_0x1f5098,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x58668b['id'];return _0x4a4cd6();})[_0xb4ee('0x31')](function(_0x202afa){return _0x28ab32(handleCheckRowError('error',_0xb4ee('0x32')+(_0x202afa[_0xb4ee('0x1d')]||JSON['stringify'](_0x202afa)),null,_0x540993));});});}function checkHopper(){function _0x12d5c2(){return function(_0x22286b){logger[_0xb4ee('0x18')](_0xb4ee('0x33'),_0xb4ee('0x34'),util[_0xb4ee('0x35')](_0x22286b,{'showHidden':![],'depth':null}));};}var _0x33473a=function(_0x49e43c,_0x344c25){var _0x307ec3=squel[_0xb4ee('0x36')]()[_0xb4ee('0x37')](_0xb4ee('0x38'))[_0xb4ee('0x39')]([_0xb4ee('0x23'),_0xb4ee('0x3a'),_0xb4ee('0x3b'),_0xb4ee('0x3c'),_0x344c25,_0xb4ee('0x3d'),_0xb4ee('0x3e')],squel[_0xb4ee('0x3f')]()['field'](_0xb4ee('0x23'),'phone')['field'](_0xb4ee('0x40'),_0xb4ee('0x3a'))[_0xb4ee('0x41')]('id',_0xb4ee('0x3b'))[_0xb4ee('0x41')](LISTID['toString'](),'ListId')['field'](_0x49e43c['id']['toString'](),_0x344c25)[_0xb4ee('0x41')](_0xb4ee('0x40'),_0xb4ee('0x3d'))['field']('NOW()',_0xb4ee('0x3e'))[_0xb4ee('0x42')](_0xb4ee('0x43'))['where'](_0xb4ee('0x44'))['where'](_0xb4ee('0x45'),LISTID[_0xb4ee('0x46')]())[_0xb4ee('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xb4ee('0x47')](_0xb4ee('0x48'),squel[_0xb4ee('0x3f')]()[_0xb4ee('0x41')](_0xb4ee('0x23'))[_0xb4ee('0x42')]('cm_hopper')[_0xb4ee('0x47')](_0x344c25+'\x20=\x20?',_0x49e43c['id'][_0xb4ee('0x46')]())))[_0xb4ee('0x46')]();return _0x307ec3;};var _0x2dd368=function(_0x38940b,_0x49f70e){var _0x26c4ed=squel['insert']()[_0xb4ee('0x37')](_0xb4ee('0x38'))[_0xb4ee('0x39')]([_0xb4ee('0x23'),'scheduledAt',_0xb4ee('0x3b'),_0xb4ee('0x3c'),_0x49f70e,_0xb4ee('0x3d'),'updatedAt'],squel['select']()[_0xb4ee('0x41')](_0xb4ee('0x23'),'phone')[_0xb4ee('0x41')](_0xb4ee('0x40'),'scheduledAt')[_0xb4ee('0x41')]('id',_0xb4ee('0x3b'))[_0xb4ee('0x41')](LISTID[_0xb4ee('0x46')](),'ListId')[_0xb4ee('0x41')](_0x38940b['id'][_0xb4ee('0x46')](),_0x49f70e)[_0xb4ee('0x41')](_0xb4ee('0x40'),_0xb4ee('0x3d'))['field'](_0xb4ee('0x40'),_0xb4ee('0x3e'))[_0xb4ee('0x42')](_0xb4ee('0x43'))[_0xb4ee('0x47')]('deletedAt\x20IS\x20NULL')[_0xb4ee('0x47')]('ListId\x20=\x20?',LISTID[_0xb4ee('0x46')]())[_0xb4ee('0x47')](_0xb4ee('0x49'),squel['str'](hopperContacts))[_0xb4ee('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xb4ee('0x47')](_0xb4ee('0x48'),squel[_0xb4ee('0x3f')]()[_0xb4ee('0x41')](_0xb4ee('0x4a'))[_0xb4ee('0x42')]('cm_hopper_final')[_0xb4ee('0x47')](_0x49f70e+_0xb4ee('0x4b'),_0x38940b['id'][_0xb4ee('0x46')]()))[_0xb4ee('0x47')](_0xb4ee('0x48'),squel[_0xb4ee('0x3f')]()[_0xb4ee('0x41')]('phone')[_0xb4ee('0x42')](_0xb4ee('0x38'))[_0xb4ee('0x47')](_0x49f70e+_0xb4ee('0x4b'),_0x38940b['id']['toString']())))[_0xb4ee('0x46')]();return _0x26c4ed;};function _0x13ade0(_0x4aa15f,_0x2d308b){var _0x3171c2=squel[_0xb4ee('0x36')]()[_0xb4ee('0x37')](_0xb4ee('0x38'))[_0xb4ee('0x39')](['phone','scheduledAt',_0xb4ee('0x3b'),_0xb4ee('0x3c'),_0x2d308b,'createdAt',_0xb4ee('0x3e')],squel[_0xb4ee('0x3f')]()['field'](_0xb4ee('0x23'),'phone')['field'](_0xb4ee('0x40'),_0xb4ee('0x3a'))[_0xb4ee('0x41')]('id',_0xb4ee('0x3b'))[_0xb4ee('0x41')](LISTID[_0xb4ee('0x46')](),_0xb4ee('0x3c'))[_0xb4ee('0x41')](_0x4aa15f['id']['toString'](),_0x2d308b)[_0xb4ee('0x41')](_0xb4ee('0x40'),_0xb4ee('0x3d'))[_0xb4ee('0x41')](_0xb4ee('0x40'),_0xb4ee('0x3e'))['from'](_0xb4ee('0x43'))[_0xb4ee('0x47')]('deletedAt\x20IS\x20NULL')[_0xb4ee('0x47')](_0xb4ee('0x45'),LISTID[_0xb4ee('0x46')]())[_0xb4ee('0x47')](_0xb4ee('0x49'),squel['str'](hopperContacts))['where'](_0xb4ee('0x4c')))['toString']();return _0x3171c2;}function _0x2830b0(_0x5a5413,_0x172e48){var _0xd47f4b=squel[_0xb4ee('0x36')]()[_0xb4ee('0x37')](_0xb4ee('0x4d'))[_0xb4ee('0x39')]([_0xb4ee('0x23'),'ContactId','ListId',_0x172e48,_0xb4ee('0x3d'),_0xb4ee('0x3e')],squel[_0xb4ee('0x3f')]()[_0xb4ee('0x41')](_0xb4ee('0x23'),_0xb4ee('0x23'))['field']('id',_0xb4ee('0x3b'))[_0xb4ee('0x41')](LISTID[_0xb4ee('0x46')](),_0xb4ee('0x3c'))[_0xb4ee('0x41')](_0x5a5413['id'][_0xb4ee('0x46')](),_0x172e48)['field']('NOW()',_0xb4ee('0x3d'))[_0xb4ee('0x41')](_0xb4ee('0x40'),_0xb4ee('0x3e'))['from'](_0xb4ee('0x43'))[_0xb4ee('0x47')]('deletedAt\x20IS\x20NULL')[_0xb4ee('0x47')]('ListId\x20=\x20?',LISTID[_0xb4ee('0x46')]())[_0xb4ee('0x47')](_0xb4ee('0x49'),squel['str'](hopperContacts))[_0xb4ee('0x47')](_0xb4ee('0x4c')))['toString']();return _0xd47f4b;}return db[_0xb4ee('0x4e')][_0xb4ee('0x4f')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb4ee('0x50')],'as':_0xb4ee('0x51'),'where':{'id':LISTID}}]})[_0xb4ee('0x2f')](function(_0x183517){var _0x4ab69f=[];if(_0x183517){var _0x37c7df;for(var _0x2a7fdb=0x0,_0x537557;_0x2a7fdb<_0x183517['length'];_0x2a7fdb+=0x1){_0x537557=_0x183517[_0x2a7fdb][_0xb4ee('0x52')]({'plain':!![]});switch(_0x537557[_0xb4ee('0x53')]){case _0xb4ee('0x54'):_0x4ab69f[_0xb4ee('0x30')](db[_0xb4ee('0x55')][_0xb4ee('0x56')](_0x2dd368(_0x537557,_0xb4ee('0x57')))[_0xb4ee('0x2f')](function(){})['catch'](_0x12d5c2()));break;case _0xb4ee('0x58'):_0x4ab69f[_0xb4ee('0x30')](db[_0xb4ee('0x55')][_0xb4ee('0x56')](_0x33473a(_0x537557,'VoiceQueueId'))[_0xb4ee('0x2f')](function(){})[_0xb4ee('0x31')](_0x12d5c2()));break;default:_0x4ab69f['push'](db[_0xb4ee('0x55')][_0xb4ee('0x56')](_0x13ade0(_0x537557,_0xb4ee('0x57')))[_0xb4ee('0x2f')](function(){})[_0xb4ee('0x31')](_0x12d5c2()));}}}return _0x4ab69f;})[_0xb4ee('0x59')]()[_0xb4ee('0x2f')](function(){return db[_0xb4ee('0x4e')][_0xb4ee('0x4f')]({'where':{'type':_0xb4ee('0x5a')},'attributes':['id'],'include':[{'model':db[_0xb4ee('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x3a1b4d){var _0x5880ad=[];if(_0x3a1b4d){var _0x1e0505;for(var _0x589dc1=0x0,_0x5b2e34;_0x589dc1<_0x3a1b4d[_0xb4ee('0x1b')];_0x589dc1+=0x1){_0x5b2e34=_0x3a1b4d[_0x589dc1][_0xb4ee('0x52')]({'plain':!![]});_0x5880ad[_0xb4ee('0x30')](db[_0xb4ee('0x55')]['query'](_0x2830b0(_0x5b2e34,_0xb4ee('0x57')))['then'](function(){})[_0xb4ee('0x31')](_0x12d5c2()));}}return _0x5880ad;})[_0xb4ee('0x59')]();})[_0xb4ee('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb4ee('0x50')],'as':_0xb4ee('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x17bcc3){var _0x51a136=[];if(_0x17bcc3){for(var _0x587dae=0x0,_0x285e9d;_0x587dae<_0x17bcc3[_0xb4ee('0x1b')];_0x587dae+=0x1){_0x285e9d=_0x17bcc3[_0x587dae]['get']({'plain':!![]});switch(_0x285e9d[_0xb4ee('0x53')]){case'always':_0x51a136[_0xb4ee('0x30')](db[_0xb4ee('0x55')]['query'](_0x2dd368(_0x285e9d,_0xb4ee('0x5b')))[_0xb4ee('0x2f')](function(){})[_0xb4ee('0x31')](_0x12d5c2()));break;case'onlyIfOpen':_0x51a136[_0xb4ee('0x30')](db[_0xb4ee('0x55')][_0xb4ee('0x56')](_0x33473a(_0x285e9d,_0xb4ee('0x5b')))['then'](function(){})[_0xb4ee('0x31')](_0x12d5c2()));break;default:_0x51a136[_0xb4ee('0x30')](db['sequelize'][_0xb4ee('0x56')](_0x13ade0(_0x285e9d,_0xb4ee('0x5b')))[_0xb4ee('0x2f')](function(){})[_0xb4ee('0x31')](_0x12d5c2()));}}}return _0x51a136;})[_0xb4ee('0x59')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb4ee('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x11f577){var _0x2af926=[];if(_0x11f577){for(var _0x267ee7=0x0,_0xd55faf;_0x267ee7<_0x11f577['length'];_0x267ee7+=0x1){_0xd55faf=_0x11f577[_0x267ee7]['get']({'plain':!![]});_0x2af926['push'](db[_0xb4ee('0x55')][_0xb4ee('0x56')](_0x2830b0(_0xd55faf,_0xb4ee('0x5b')))[_0xb4ee('0x2f')](function(){})[_0xb4ee('0x31')](_0x12d5c2()));}}return _0x2af926;})[_0xb4ee('0x59')]();})[_0xb4ee('0x31')](function(_0x7b1375){logger[_0xb4ee('0x18')](_0xb4ee('0x5d'),_0xb4ee('0x5e'),_0x7b1375[_0xb4ee('0x1d')]);});}var processPromises=function(_0x5c1510){return BPromise['all'](promises)[_0xb4ee('0x2f')](function(_0x2e5ce6){})[_0xb4ee('0x31')](function(_0x528224){logger[_0xb4ee('0x18')](_0xb4ee('0x5f'),JSON[_0xb4ee('0x60')](_0x528224));})[_0xb4ee('0x61')](function(){socket[_0xb4ee('0x62')](_0xb4ee('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5c1510){return _0x5c1510['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xb4ee('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xb4ee('0x62')](_0xb4ee('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb4ee('0x64')](FILEPATH);}catch(_0xd7070f){logger['error'](_0xb4ee('0x65'),JSON[_0xb4ee('0x60')](_0xd7070f));}finally{process[_0xb4ee('0x66')](0x0);}});};process['on'](_0xb4ee('0x67'),function(){logger['info'](_0xb4ee('0x68'));endCsv();});function main(){return BPromise['resolve']()[_0xb4ee('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb4ee('0x12')](',');return db[_0xb4ee('0x2c')][_0xb4ee('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb4ee('0x2f')](function(_0x24134){var _0x351288=fs[_0xb4ee('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb4ee('0x6a')](_0x351288,{'header':!![],'skipEmptyLines':!![],'step':function(_0x251acc,_0x574182){total+=0x1;var _0x36f8f7=total;promises[_0xb4ee('0x30')](checkRow(_0x251acc,_0x24134,_0x36f8f7)['then'](function(){success+=0x1;})['catch'](function(_0x55737f){if(_0x55737f['error']){errors+=0x1;delete _0x55737f[_0xb4ee('0x18')];}else if(_0x55737f['duplicate']){duplicates+=0x1;delete _0x55737f[_0xb4ee('0x6b')];}rows[_0xb4ee('0x30')](_0x55737f);}));if(total%0xc8===0x0){_0x574182[_0xb4ee('0x6c')]();return processPromises(_0x574182);}},'complete':function(){return processPromises()[_0xb4ee('0x2f')](function(){logger[_0xb4ee('0x6d')](_0xb4ee('0x6e'));endCsv();});},'error':function(_0x6d83ed,_0x46789a){logger[_0xb4ee('0x6d')](_0xb4ee('0x6f'),JSON[_0xb4ee('0x60')](_0x6d83ed));endCsv();}});})[_0xb4ee('0x31')](function(_0x18713e){logger[_0xb4ee('0x18')](_0xb4ee('0x70'),JSON[_0xb4ee('0x60')](_0x18713e));});}main(); \ No newline at end of file +var _0xc506=['outbound','CmList','Lists','get','dialCheckDuplicateType','always','onlyIfOpen','sequelize','query','VoiceQueueId','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','ioredis','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','undefined','Missing\x20socket_timestamp\x20parameter!','error','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','NOW()','id\x20IN\x20?','str','calleridnum','\x20=\x20?','cm_hopper_black','VoiceQueue'];(function(_0x5afbd8,_0x155cc8){var _0x1cb20c=function(_0x101b68){while(--_0x101b68){_0x5afbd8['push'](_0x5afbd8['shift']());}};_0x1cb20c(++_0x155cc8);}(_0xc506,0x168));var _0x6c50=function(_0x485865,_0x11d29a){_0x485865=_0x485865-0x0;var _0x11ef06=_0xc506[_0x485865];return _0x11ef06;};'use strict';var BPromise=require(_0x6c50('0x0'));var util=require(_0x6c50('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x6c50('0x2'));var Papa=require('papaparse');var Redis=require(_0x6c50('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x6c50('0x4'))(_0x6c50('0x5'));config[_0x6c50('0x6')]=_[_0x6c50('0x7')](config[_0x6c50('0x6')],{'host':_0x6c50('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c50('0x6')]));require(_0x6c50('0x9'))[_0x6c50('0xa')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]==='undefined'||process[_0x6c50('0xb')][0x2]===_0x6c50('0xc')){throw new Error(_0x6c50('0xd'));}var FILEPATH=process[_0x6c50('0xb')][0x2];if(!process['argv'][0x3]||process[_0x6c50('0xb')][0x3]==='undefined'||process[_0x6c50('0xb')][0x3]===_0x6c50('0xc')||!process[_0x6c50('0xb')][0x4]||process['argv'][0x4]==='undefined'||process[_0x6c50('0xb')][0x4]==='null'){throw new Error(_0x6c50('0xe'));}var FIELDS=_[_0x6c50('0xf')](process['argv'][0x3][_0x6c50('0x10')](','),process['argv'][0x4][_0x6c50('0x10')](','));if(!process[_0x6c50('0xb')][0x5]||process[_0x6c50('0xb')][0x5]==='undefined'||process[_0x6c50('0xb')][0x5]===_0x6c50('0xc')){throw new Error(_0x6c50('0x11'));}var LISTID=process[_0x6c50('0xb')][0x5];var COMPANYID=process[_0x6c50('0xb')][0x6]&&process['argv'][0x6]!==_0x6c50('0x12')&&process[_0x6c50('0xb')][0x6]!==_0x6c50('0xc')?process[_0x6c50('0xb')][0x6]:null;var DUPLICATES=process[_0x6c50('0xb')][0x7]&&process[_0x6c50('0xb')][0x7]!==_0x6c50('0x12')&&process[_0x6c50('0xb')][0x7]!=='null'?process[_0x6c50('0xb')][0x7]:null;if(!process[_0x6c50('0xb')][0x8]||process[_0x6c50('0xb')][0x8]==='undefined'||process['argv'][0x8]===_0x6c50('0xc')){throw new Error(_0x6c50('0x13'));}var SOCKET_TIMESTAMP=process[_0x6c50('0xb')][0x8];}catch(_0x372f3c){logger[_0x6c50('0x14')](_0x372f3c);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(_0x525237,_0x182832,_0xca3e03,_0x1011d7){var _0x53315c={'message':_0x182832};_0x53315c[_0x525237]=!![];if(_0xca3e03){_0x53315c['contact']=_0xca3e03;}if(_0x1011d7){_0x53315c['index']=_0x1011d7;}return _0x53315c;}function isEmail(_0x553e46){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'](_0x553e46);}function checkRow(_0x57088d,_0x447304,_0x99e16d){return new BPromise(function(_0x319f01,_0x3bec4b){if(_[_0x6c50('0x15')](_0x57088d)){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x6c50('0x16'),null,_0x99e16d));}if(_0x57088d[_0x6c50('0x17')]&&_0x57088d['errors'][_0x6c50('0x18')]){var _0x23be26=_[_0x6c50('0x19')](_0x57088d['errors'],'message')['join'](';');return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x23be26,null,_0x99e16d));}var _0x4443ef={};for(var _0x4cb366 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4cb366)&&FIELDS[_0x4cb366]){_0x4443ef[_0x4cb366]=_0x57088d[_0x6c50('0x1a')][0x0][FIELDS[_0x4cb366]]||_0x57088d['data'][0x0]['\ufeff'+FIELDS[_0x4cb366]];}}if(!_0x4443ef['firstName']){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),'firstName\x20not\x20specified!',null,_0x99e16d));}if(!_0x4443ef[_0x6c50('0x1b')]){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x6c50('0x1c'),null,_0x99e16d));}if(_0x4443ef['birthDate']){var _0x348c16=moment(_0x4443ef[_0x6c50('0x1d')],_0x6c50('0x1e'));if(!_0x348c16['isValid']()){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x6c50('0x1f'),null,_0x99e16d));}}if(_0x4443ef[_0x6c50('0x20')]){if(!isEmail(_0x4443ef[_0x6c50('0x20')])){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x6c50('0x21'),null,_0x99e16d));}}_0x4443ef[_0x6c50('0x22')]=LISTID;_0x4443ef[_0x6c50('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x447304){var _0x3d4aa0={};for(var _0x3e478d=0x0,_0x139d81=DUPLICATES[_0x6c50('0x18')];_0x3e478d<_0x139d81;_0x3e478d+=0x1){_0x3d4aa0[DUPLICATES[_0x3e478d]]=_0x4443ef[DUPLICATES[_0x3e478d]];}var _0x821667=_[_0x6c50('0x24')](_0x447304,_0x3d4aa0);if(_0x821667){return _0x3bec4b(handleCheckRowError(_0x6c50('0x25'),_0x6c50('0x26'),_0x821667,_0x99e16d));}}return db['CmContact'][_0x6c50('0x27')](_0x4443ef,{'raw':!![],'hooks':![],'fields':_[_0x6c50('0x28')](_0x4443ef)})[_0x6c50('0x29')](function(_0x35b141){if(DUPLICATES&&DUPLICATES[_0x6c50('0x18')]&&_0x447304){_0x447304[_0x6c50('0x2a')](_[_0x6c50('0x2b')](_0x4443ef,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x35b141['id'];return _0x319f01();})[_0x6c50('0x2c')](function(_0x7d93ae){return _0x3bec4b(handleCheckRowError(_0x6c50('0x14'),_0x6c50('0x2d')+(_0x7d93ae[_0x6c50('0x2e')]||JSON[_0x6c50('0x2f')](_0x7d93ae)),null,_0x99e16d));});});}function checkHopper(){function _0x3266b0(){return function(_0x5e9b0c){logger[_0x6c50('0x14')](_0x6c50('0x30'),_0x6c50('0x31'),util[_0x6c50('0x32')](_0x5e9b0c,{'showHidden':![],'depth':null}));};}var _0x53f50b=function(_0x5ba9b5,_0x459de2){var _0x49ec79=squel[_0x6c50('0x33')]()[_0x6c50('0x34')](_0x6c50('0x35'))[_0x6c50('0x36')]([_0x6c50('0x1b'),_0x6c50('0x37'),_0x6c50('0x38'),_0x6c50('0x22'),_0x459de2,_0x6c50('0x39'),_0x6c50('0x3a')],squel[_0x6c50('0x3b')]()[_0x6c50('0x3c')](_0x6c50('0x1b'),_0x6c50('0x1b'))[_0x6c50('0x3c')]('NOW()',_0x6c50('0x37'))[_0x6c50('0x3c')]('id',_0x6c50('0x38'))['field'](LISTID['toString'](),'ListId')[_0x6c50('0x3c')](_0x5ba9b5['id'][_0x6c50('0x3d')](),_0x459de2)[_0x6c50('0x3c')]('NOW()',_0x6c50('0x39'))[_0x6c50('0x3c')]('NOW()',_0x6c50('0x3a'))[_0x6c50('0x3e')](_0x6c50('0x3f'))[_0x6c50('0x40')](_0x6c50('0x41'))[_0x6c50('0x40')](_0x6c50('0x42'),LISTID['toString']())[_0x6c50('0x40')](_0x6c50('0x43'))[_0x6c50('0x40')](_0x6c50('0x44'),squel['select']()['field'](_0x6c50('0x1b'))[_0x6c50('0x3e')](_0x6c50('0x35'))[_0x6c50('0x40')](_0x459de2+'\x20=\x20?',_0x5ba9b5['id'][_0x6c50('0x3d')]())))[_0x6c50('0x3d')]();return _0x49ec79;};var _0x373305=function(_0x3c8364,_0x4dcb5d){var _0x138ead=squel[_0x6c50('0x33')]()[_0x6c50('0x34')]('cm_hopper')[_0x6c50('0x36')]([_0x6c50('0x1b'),_0x6c50('0x37'),'ContactId',_0x6c50('0x22'),_0x4dcb5d,_0x6c50('0x39'),_0x6c50('0x3a')],squel[_0x6c50('0x3b')]()[_0x6c50('0x3c')](_0x6c50('0x1b'),_0x6c50('0x1b'))[_0x6c50('0x3c')](_0x6c50('0x45'),'scheduledAt')[_0x6c50('0x3c')]('id','ContactId')[_0x6c50('0x3c')](LISTID[_0x6c50('0x3d')](),_0x6c50('0x22'))[_0x6c50('0x3c')](_0x3c8364['id'][_0x6c50('0x3d')](),_0x4dcb5d)[_0x6c50('0x3c')]('NOW()',_0x6c50('0x39'))['field']('NOW()',_0x6c50('0x3a'))[_0x6c50('0x3e')](_0x6c50('0x3f'))[_0x6c50('0x40')](_0x6c50('0x41'))[_0x6c50('0x40')]('ListId\x20=\x20?',LISTID[_0x6c50('0x3d')]())[_0x6c50('0x40')](_0x6c50('0x46'),squel[_0x6c50('0x47')](hopperContacts))[_0x6c50('0x40')](_0x6c50('0x43'))[_0x6c50('0x40')](_0x6c50('0x44'),squel['select']()[_0x6c50('0x3c')](_0x6c50('0x48'))['from']('cm_hopper_final')[_0x6c50('0x40')](_0x4dcb5d+_0x6c50('0x49'),_0x3c8364['id'][_0x6c50('0x3d')]()))[_0x6c50('0x40')](_0x6c50('0x44'),squel[_0x6c50('0x3b')]()[_0x6c50('0x3c')](_0x6c50('0x1b'))[_0x6c50('0x3e')](_0x6c50('0x35'))['where'](_0x4dcb5d+_0x6c50('0x49'),_0x3c8364['id'][_0x6c50('0x3d')]())))['toString']();return _0x138ead;};function _0x1b7b9d(_0x5ba4c9,_0x24b9c6){var _0x49c125=squel['insert']()[_0x6c50('0x34')]('cm_hopper')[_0x6c50('0x36')](['phone',_0x6c50('0x37'),_0x6c50('0x38'),_0x6c50('0x22'),_0x24b9c6,_0x6c50('0x39'),_0x6c50('0x3a')],squel[_0x6c50('0x3b')]()[_0x6c50('0x3c')](_0x6c50('0x1b'),_0x6c50('0x1b'))[_0x6c50('0x3c')](_0x6c50('0x45'),_0x6c50('0x37'))['field']('id',_0x6c50('0x38'))[_0x6c50('0x3c')](LISTID['toString'](),'ListId')[_0x6c50('0x3c')](_0x5ba4c9['id'][_0x6c50('0x3d')](),_0x24b9c6)[_0x6c50('0x3c')](_0x6c50('0x45'),_0x6c50('0x39'))[_0x6c50('0x3c')](_0x6c50('0x45'),_0x6c50('0x3a'))[_0x6c50('0x3e')](_0x6c50('0x3f'))[_0x6c50('0x40')](_0x6c50('0x41'))[_0x6c50('0x40')](_0x6c50('0x42'),LISTID[_0x6c50('0x3d')]())['where'](_0x6c50('0x46'),squel[_0x6c50('0x47')](hopperContacts))[_0x6c50('0x40')](_0x6c50('0x43')))[_0x6c50('0x3d')]();return _0x49c125;}function _0xe085cc(_0x33c5eb,_0x3059d3){var _0x1efdb8=squel[_0x6c50('0x33')]()['into'](_0x6c50('0x4a'))[_0x6c50('0x36')]([_0x6c50('0x1b'),'ContactId',_0x6c50('0x22'),_0x3059d3,_0x6c50('0x39'),'updatedAt'],squel[_0x6c50('0x3b')]()[_0x6c50('0x3c')](_0x6c50('0x1b'),'phone')[_0x6c50('0x3c')]('id',_0x6c50('0x38'))[_0x6c50('0x3c')](LISTID[_0x6c50('0x3d')](),_0x6c50('0x22'))[_0x6c50('0x3c')](_0x33c5eb['id']['toString'](),_0x3059d3)['field'](_0x6c50('0x45'),'createdAt')[_0x6c50('0x3c')](_0x6c50('0x45'),'updatedAt')[_0x6c50('0x3e')](_0x6c50('0x3f'))[_0x6c50('0x40')](_0x6c50('0x41'))[_0x6c50('0x40')](_0x6c50('0x42'),LISTID[_0x6c50('0x3d')]())[_0x6c50('0x40')](_0x6c50('0x46'),squel[_0x6c50('0x47')](hopperContacts))[_0x6c50('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x6c50('0x3d')]();return _0x1efdb8;}return db[_0x6c50('0x4b')]['findAll']({'where':{'type':_0x6c50('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6c50('0x4d')],'as':_0x6c50('0x4e'),'where':{'id':LISTID}}]})[_0x6c50('0x29')](function(_0x495f56){var _0x4449a4=[];if(_0x495f56){var _0x523f64;for(var _0x5593fc=0x0,_0x39ec7e;_0x5593fc<_0x495f56['length'];_0x5593fc+=0x1){_0x39ec7e=_0x495f56[_0x5593fc][_0x6c50('0x4f')]({'plain':!![]});switch(_0x39ec7e[_0x6c50('0x50')]){case _0x6c50('0x51'):_0x4449a4[_0x6c50('0x2a')](db['sequelize']['query'](_0x373305(_0x39ec7e,'VoiceQueueId'))[_0x6c50('0x29')](function(){})[_0x6c50('0x2c')](_0x3266b0()));break;case _0x6c50('0x52'):_0x4449a4[_0x6c50('0x2a')](db[_0x6c50('0x53')][_0x6c50('0x54')](_0x53f50b(_0x39ec7e,'VoiceQueueId'))[_0x6c50('0x29')](function(){})[_0x6c50('0x2c')](_0x3266b0()));break;default:_0x4449a4[_0x6c50('0x2a')](db[_0x6c50('0x53')]['query'](_0x1b7b9d(_0x39ec7e,_0x6c50('0x55')))[_0x6c50('0x29')](function(){})['catch'](_0x3266b0()));}}}return _0x4449a4;})[_0x6c50('0x56')]()['then'](function(){return db[_0x6c50('0x4b')][_0x6c50('0x57')]({'where':{'type':_0x6c50('0x4c')},'attributes':['id'],'include':[{'model':db[_0x6c50('0x4d')],'as':_0x6c50('0x58'),'where':{'id':LISTID}}]})[_0x6c50('0x29')](function(_0x17cdb1){var _0x486b70=[];if(_0x17cdb1){var _0x4949f1;for(var _0x25b6d5=0x0,_0x585368;_0x25b6d5<_0x17cdb1[_0x6c50('0x18')];_0x25b6d5+=0x1){_0x585368=_0x17cdb1[_0x25b6d5][_0x6c50('0x4f')]({'plain':!![]});_0x486b70['push'](db['sequelize'][_0x6c50('0x54')](_0xe085cc(_0x585368,_0x6c50('0x55')))[_0x6c50('0x29')](function(){})[_0x6c50('0x2c')](_0x3266b0()));}}return _0x486b70;})[_0x6c50('0x56')]();})[_0x6c50('0x29')](function(){return db[_0x6c50('0x59')]['findAll']({'attributes':['id',_0x6c50('0x50')],'include':[{'model':db['CmList'],'as':_0x6c50('0x4e'),'where':{'id':LISTID}}]})[_0x6c50('0x29')](function(_0x6831ee){var _0x4b46fb=[];if(_0x6831ee){for(var _0x49dae4=0x0,_0x397910;_0x49dae4<_0x6831ee[_0x6c50('0x18')];_0x49dae4+=0x1){_0x397910=_0x6831ee[_0x49dae4][_0x6c50('0x4f')]({'plain':!![]});switch(_0x397910[_0x6c50('0x50')]){case _0x6c50('0x51'):_0x4b46fb[_0x6c50('0x2a')](db[_0x6c50('0x53')][_0x6c50('0x54')](_0x373305(_0x397910,_0x6c50('0x5a')))['then'](function(){})[_0x6c50('0x2c')](_0x3266b0()));break;case'onlyIfOpen':_0x4b46fb[_0x6c50('0x2a')](db[_0x6c50('0x53')]['query'](_0x53f50b(_0x397910,'CampaignId'))['then'](function(){})[_0x6c50('0x2c')](_0x3266b0()));break;default:_0x4b46fb[_0x6c50('0x2a')](db[_0x6c50('0x53')][_0x6c50('0x54')](_0x1b7b9d(_0x397910,_0x6c50('0x5a')))[_0x6c50('0x29')](function(){})['catch'](_0x3266b0()));}}}return _0x4b46fb;})[_0x6c50('0x56')]();})[_0x6c50('0x29')](function(){return db['Campaign'][_0x6c50('0x57')]({'attributes':['id'],'include':[{'model':db[_0x6c50('0x4d')],'as':_0x6c50('0x58'),'where':{'id':LISTID}}]})[_0x6c50('0x29')](function(_0x352bec){var _0x55739a=[];if(_0x352bec){for(var _0x37532c=0x0,_0x508fed;_0x37532c<_0x352bec['length'];_0x37532c+=0x1){_0x508fed=_0x352bec[_0x37532c][_0x6c50('0x4f')]({'plain':!![]});_0x55739a[_0x6c50('0x2a')](db['sequelize'][_0x6c50('0x54')](_0xe085cc(_0x508fed,_0x6c50('0x5a')))['then'](function(){})[_0x6c50('0x2c')](_0x3266b0()));}}return _0x55739a;})[_0x6c50('0x56')]();})['catch'](function(_0x44fd42){logger['error'](_0x6c50('0x5b'),'generalCheckHopper',_0x44fd42['message']);});}var processPromises=function(_0x46eb3a){return BPromise[_0x6c50('0x56')](promises)['then'](function(_0x2a03ce){})[_0x6c50('0x2c')](function(_0x5bc779){logger['error'](_0x6c50('0x5c'),JSON[_0x6c50('0x2f')](_0x5bc779));})[_0x6c50('0x5d')](function(){socket['emit'](_0x6c50('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x46eb3a){return _0x46eb3a[_0x6c50('0x5f')]();}});};var endCsv=function(){return BPromise[_0x6c50('0x60')]()[_0x6c50('0x29')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x6c50('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6c50('0x62')](FILEPATH);}catch(_0x5f500c){logger['error'](_0x6c50('0x63'),JSON[_0x6c50('0x2f')](_0x5f500c));}finally{process[_0x6c50('0x64')](0x0);}});};process['on'](_0x6c50('0x65'),function(){logger[_0x6c50('0x66')](_0x6c50('0x67'));endCsv();});function main(){return BPromise[_0x6c50('0x60')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6c50('0x10')](',');return db[_0x6c50('0x68')][_0x6c50('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6c50('0x29')](function(_0x365789){var _0x434fc1=fs[_0x6c50('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x434fc1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ef70d,_0x57c839){total+=0x1;var _0x5b9a53=total;promises[_0x6c50('0x2a')](checkRow(_0x2ef70d,_0x365789,_0x5b9a53)['then'](function(){success+=0x1;})[_0x6c50('0x2c')](function(_0x16b1dd){if(_0x16b1dd[_0x6c50('0x14')]){errors+=0x1;delete _0x16b1dd[_0x6c50('0x14')];}else if(_0x16b1dd['duplicate']){duplicates+=0x1;delete _0x16b1dd[_0x6c50('0x25')];}rows[_0x6c50('0x2a')](_0x16b1dd);}));if(total%0xc8===0x0){_0x57c839[_0x6c50('0x6a')]();return processPromises(_0x57c839);}},'complete':function(){return processPromises()['then'](function(){logger[_0x6c50('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x7efb8,_0xe80255){logger['info'](_0x6c50('0x6b'),JSON[_0x6c50('0x2f')](_0x7efb8));endCsv();}});})['catch'](function(_0x5a1ba4){logger['error'](_0x6c50('0x6c'),JSON['stringify'](_0x5a1ba4));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 20a4f24..945ffa2 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 _0x74c6=['cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','scheduledat','ContactId','ListId','UserId','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','from','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','fromQuery','createdAt','priority','recallme','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','push','sequelize','query','catch','campaigns.id','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','socket_timestamp','root','server/files/tmp','.csv','includes',',utcOffset','parse','data','rows','errors','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','timezones','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','DROP\x20TABLE\x20','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x74c6,0x116));var _0x674c=function(_0x239961,_0x499edd){_0x239961=_0x239961-0x0;var _0x198cd2=_0x74c6[_0x239961];return _0x198cd2;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x674c('0x0'));var Papa=require(_0x674c('0x1'));var util=require(_0x674c('0x2'));var BPromise=require(_0x674c('0x3'));var moment=require('moment');var squel=require(_0x674c('0x4'));var Redis=require(_0x674c('0x5'));var db=require(_0x674c('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0x674c('0x7'));var logger=require(_0x674c('0x8'))(_0x674c('0x9'));config['redis']=_[_0x674c('0xa')](config[_0x674c('0xb')],{'host':_0x674c('0xc'),'port':0x18eb});var socket=require(_0x674c('0xd'))(new Redis(config[_0x674c('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x674c('0xe')](_0x674c('0xf'));function isEmail(_0x16ae26){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))*$/[_0x674c('0x10')](_0x16ae26);}function selectNotIn(_0xc4db1f,_0x1a4ba8,_0x2c8d7b,_0x27289d,_0x4a0bcb){return squel[_0x674c('0x11')]()[_0x674c('0x12')](_0x674c('0x13'))['from'](_0x27289d)[_0x674c('0x14')](_0x1a4ba8,null,_0x1a4ba8+'.id\x20=\x20'+_0x27289d+'.'+_0x2c8d7b)[_0x674c('0x15')](_0x27289d+'.'+_0x2c8d7b+'\x20=\x20'+_0xc4db1f+'.'+_0x2c8d7b)[_0x674c('0x15')](_0x1a4ba8+_0x674c('0x16')+_0x4a0bcb[_0x674c('0x14')]()+')');}function insertCmHopper(_0x39dfb7,_0x335830,_0x27bc9a,_0x7ccc55,_0x4c9755){var _0x205837=['cm_contacts.phone',_0x674c('0x17'),_0x674c('0x18'),_0x674c('0x19'),_0x335830+'.'+_0x7ccc55,_0x674c('0x1a'),_0x674c('0x1b'),_0x674c('0x1c'),_0x674c('0x1d'),'\x22'+_0x4c9755+'\x22'];return squel[_0x674c('0x1e')]()[_0x674c('0x1f')]('cm_hopper')['fromQuery']([_0x674c('0x13'),_0x674c('0x20'),_0x674c('0x21'),_0x674c('0x22'),_0x7ccc55,'createdAt','updatedAt','priority',_0x674c('0x23'),'recallme'],squel[_0x674c('0x11')]()[_0x674c('0x24')](_0x205837)['from'](_0x335830)[_0x674c('0x14')](_0x674c('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x335830+'.CmListId')[_0x674c('0x14')](_0x27bc9a,null,_0x27bc9a+'.id\x20=\x20'+_0x335830+'.'+_0x7ccc55)[_0x674c('0x15')](_0x335830+_0x674c('0x26'),_0x39dfb7)[_0x674c('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x674c('0x15')](_0x674c('0x27'),selectNotIn(_0x335830,_0x27bc9a,_0x7ccc55,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x674c('0x15')](_0x674c('0x27'),selectNotIn(_0x335830,_0x27bc9a,_0x7ccc55,_0x674c('0x28'),[_0x674c('0x29')])))[_0x674c('0x2a')]();}function insertCmHopperBlack(_0x2f5ead,_0x1e7225,_0x248f6a,_0x10cfd5){var _0x40117a=[_0x674c('0x2b'),'cm_contacts.id',_0x674c('0x19'),_0x1e7225+'.'+_0x10cfd5,_0x674c('0x1a'),_0x674c('0x1b')];return squel[_0x674c('0x1e')]()[_0x674c('0x1f')](_0x674c('0x2c'))['fromQuery']([_0x674c('0x13'),'ContactId',_0x674c('0x22'),_0x10cfd5,'createdAt',_0x674c('0x2d')],squel['select']()[_0x674c('0x24')](_0x40117a)['from'](_0x1e7225)[_0x674c('0x14')](_0x674c('0x25'),null,_0x674c('0x2e')+_0x1e7225+_0x674c('0x2f'))[_0x674c('0x14')](_0x248f6a,null,_0x248f6a+_0x674c('0x30')+_0x1e7225+'.'+_0x10cfd5)[_0x674c('0x15')](_0x1e7225+_0x674c('0x26'),_0x2f5ead)['where'](_0x674c('0x31'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x674c('0x12')](_0x674c('0x13'))[_0x674c('0x32')](_0x674c('0x2c'))['where'](_0x674c('0x33'),_0x2f5ead)[_0x674c('0x15')](_0x10cfd5+_0x674c('0x34'),_0x1e7225+'.'+_0x10cfd5)))[_0x674c('0x2a')]();}function insertTzCmHopper(_0x29f2ad,_0x410681,_0x18196b,_0x52b3ab,_0xa9680b,_0x3b7eeb){var _0x74008c=[_0x674c('0x2b'),_0x674c('0x35')+_0x3b7eeb+'.offset-cm_contacts.utcOffset\x20minute)',_0x674c('0x18'),_0x674c('0x19'),_0x410681+'.'+_0x52b3ab,_0x674c('0x1a'),'cm_contacts.updatedAt',_0x674c('0x1c'),'cm_contacts.UserId','\x22'+_0xa9680b+'\x22'];var _0xe5d96d=squel[_0x674c('0x1e')]()[_0x674c('0x1f')](_0x674c('0x28'))[_0x674c('0x36')]([_0x674c('0x13'),_0x674c('0x20'),_0x674c('0x21'),_0x674c('0x22'),_0x52b3ab,_0x674c('0x37'),'updatedAt',_0x674c('0x38'),_0x674c('0x23'),_0x674c('0x39')],squel[_0x674c('0x11')]()[_0x674c('0x24')](_0x74008c)['from'](_0x410681)['join'](_0x674c('0x25'),null,_0x674c('0x2e')+_0x410681+_0x674c('0x2f'))[_0x674c('0x14')](_0x18196b,null,_0x18196b+_0x674c('0x30')+_0x410681+'.'+_0x52b3ab)[_0x674c('0x14')](_0x3b7eeb,null,_0x3b7eeb+_0x674c('0x30')+_0x410681+'.'+_0x52b3ab)[_0x674c('0x15')](_0x410681+_0x674c('0x26'),_0x29f2ad)[_0x674c('0x15')](_0x674c('0x31'),NOW)[_0x674c('0x15')](_0x674c('0x27'),selectNotIn(_0x410681,_0x18196b,_0x52b3ab,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x674c('0x15')](_0x674c('0x27'),selectNotIn(_0x410681,_0x18196b,_0x52b3ab,'cm_hopper',['\x22always\x22'])))['toString']();return _0xe5d96d;}function insertTzCmHopperBlack(_0xf382b1,_0x1f2d52,_0xfccd0,_0x26021c){var _0x40d285=['cm_contacts.phone',_0x674c('0x18'),'cm_contacts.ListId',_0x1f2d52+'.'+_0x26021c,_0x674c('0x1a'),_0x674c('0x1b')];return squel[_0x674c('0x1e')]()['into'](_0x674c('0x2c'))[_0x674c('0x36')](['phone',_0x674c('0x21'),_0x674c('0x22'),_0x26021c,_0x674c('0x37'),_0x674c('0x2d')],squel[_0x674c('0x11')]()[_0x674c('0x24')](_0x40d285)[_0x674c('0x32')](_0x1f2d52)[_0x674c('0x14')](_0x674c('0x25'),null,_0x674c('0x2e')+_0x1f2d52+_0x674c('0x2f'))[_0x674c('0x14')](_0xfccd0,null,_0xfccd0+_0x674c('0x30')+_0x1f2d52+'.'+_0x26021c)[_0x674c('0x15')](_0x1f2d52+_0x674c('0x26'),_0xf382b1)[_0x674c('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x674c('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x674c('0x12')](_0x674c('0x13'))[_0x674c('0x32')](_0x674c('0x2c'))[_0x674c('0x15')](_0x674c('0x33'),_0xf382b1)[_0x674c('0x15')](_0x26021c+'\x20=\x20?',_0x1f2d52+'.'+_0x26021c)))[_0x674c('0x2a')]();}function insertCmContact(_0x1674f7,_0x5a30f5,_0x1a53be,_0x4463f7){var _0x167cd0=_['concat'](_[_0x674c('0x3a')](_0x4463f7),[_0x674c('0x22'),_0x674c('0x3b'),'createdAt',_0x674c('0x2d')]);return squel[_0x674c('0x1e')]()[_0x674c('0x1f')](_0x674c('0x25'))[_0x674c('0x36')](_0x167cd0,squel[_0x674c('0x11')]()[_0x674c('0x24')](_0x167cd0)['from'](_0x5a30f5)[_0x674c('0x15')]('('+_0x1a53be[_0x674c('0x14')](',')+_0x674c('0x3c'),squel['select']()['fields'](_0x1a53be)[_0x674c('0x32')](_0x674c('0x25'))[_0x674c('0x15')]('ListId\x20=\x20?',_0x1674f7)[_0x674c('0x15')](_0x674c('0x3d')))[_0x674c('0x15')](_0x674c('0x3e'),squel[_0x674c('0x11')]()['field'](_0x674c('0x3f'),_0x674c('0x40'))[_0x674c('0x32')](_0x5a30f5)[_0x674c('0x41')](_0x1a53be['join'](','))))[_0x674c('0x2a')]();}function handleStop(){logger[_0x674c('0x42')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1a2bec){logger[_0x674c('0x43')](_0x1a2bec[_0x674c('0x44')]);process[_0x674c('0x45')](0x1);}function handleError(_0x4788eb,_0x5ead7c){stats['errors'][_0x674c('0x46')]({'name':_0x5ead7c['code'],'message':_0x5ead7c[_0x674c('0x44')],'row':_0x4788eb});}function handleQuery(_0x2dee2a){logger['info'](_0x2dee2a);return db[_0x674c('0x47')][_0x674c('0x48')](_0x2dee2a)['spread'](function(_0xc02d10){results[_0x674c('0x46')](_0xc02d10);})[_0x674c('0x49')](function(_0x50281c){logger['error'](_0x50281c[_0x674c('0x44')]);});}function updateTzCampaigns(_0x20b5da){return new Promise(function(_0x12bfad,_0x1d5e8b){var _0x54eec3=squel['select']()['fields']([_0x674c('0x4a'),'campaigns.dialTimezone'])[_0x674c('0x32')](_0x674c('0x4b'))['join']('campaigns_has_cm_lists',null,_0x674c('0x4c'))[_0x674c('0x15')](_0x674c('0x4d')+_0x20b5da);db['sequelize'][_0x674c('0x48')](_0x54eec3[_0x674c('0x2a')]())[_0x674c('0x4e')](function(_0x5eba7c){var _0x171dab=[];for(var _0x4da385=0x0;_0x4da385<_0x5eba7c[_0x674c('0x4f')];_0x4da385++){_0x171dab[_0x674c('0x46')](getTimezoneData(_0x5eba7c[_0x4da385],tmp_campaigns));}BPromise[_0x674c('0x50')](_0x171dab)[_0x674c('0x51')](function(){_0x12bfad({'val':0x1});});})[_0x674c('0x49')](function(_0x1e15c3){logger[_0x674c('0x43')](_0x1e15c3[_0x674c('0x44')]);_0x12bfad({'val':0x0});});});}function updateTzVoiceQueues(_0x6cd139){return new Promise(function(_0x2f8710,_0x4c54bc){var _0x3b851e=squel[_0x674c('0x11')]()[_0x674c('0x24')](['voice_queues.id',_0x674c('0x52')])['from'](_0x674c('0x53'))[_0x674c('0x14')](_0x674c('0x54'),null,_0x674c('0x55'))[_0x674c('0x15')](_0x674c('0x56')+_0x6cd139);db[_0x674c('0x47')][_0x674c('0x48')](_0x3b851e['toString']())[_0x674c('0x4e')](function(_0xbe2115){var _0x275682=[];for(var _0x1f4301=0x0;_0x1f4301<_0xbe2115[_0x674c('0x4f')];_0x1f4301++){_0x275682[_0x674c('0x46')](getTimezoneData(_0xbe2115[_0x1f4301],tmp_voice_queues));}BPromise['all'](_0x275682)[_0x674c('0x51')](function(){_0x2f8710({'val':0x1});});})[_0x674c('0x49')](function(_0x5603fc){logger[_0x674c('0x43')](_0x5603fc[_0x674c('0x44')]);_0x2f8710({'val':0x0});});});}function getTimezoneData(_0x3de82b,_0x43663f){return new Promise(function(_0x858ce9,_0x3c5d93){var _0x3f9d87=shared['timezones'];var _0x149de6=_0x3f9d87[_0x3de82b[_0x674c('0x57')]];if(_[_0x674c('0x58')](_0x149de6)){_0x858ce9({'ret':0x1});}else{var _0x130259=_0x149de6[_0x674c('0x59')];var _0x3b2f55=squel[_0x674c('0x1e')]()[_0x674c('0x1f')](_0x43663f)[_0x674c('0x5a')]('id',_0x3de82b['id'])[_0x674c('0x5a')](_0x674c('0x5b'),_0x130259)[_0x674c('0x5a')](_0x674c('0x57'),_0x3de82b['dialTimezone'])[_0x674c('0x2a')]();return db['sequelize'][_0x674c('0x48')](_0x3b2f55)[_0x674c('0x4e')](function(_0x439c2d){_0x858ce9({'ret':0x1});})['catch'](function(_0x410f0f){logger['error'](_0x410f0f[_0x674c('0x44')]);_0x3c5d93({'ret':0x1});});}});}function handleTZQuery(_0x11dcf4){logger[_0x674c('0x42')](_0x11dcf4);return db[_0x674c('0x47')][_0x674c('0x48')](_0x11dcf4)['spread'](function(_0x4c0874){})[_0x674c('0x49')](function(_0x36e36a){logger[_0x674c('0x43')](_0x36e36a[_0x674c('0x44')]);});}function main(_0x40f784,_0x150445,_0x559593,_0x1516bd){logger[_0x674c('0x42')](_0x674c('0x5c'),_0x40f784,JSON[_0x674c('0x5d')](_0x150445));process[_0x674c('0x5e')](_0x674c('0x5f'));var _0x2fb91f=_0x150445['binding'];var _0x1c6968=_0x150445[_0x674c('0x60')];var _0x186381=path[_0x674c('0x14')](config[_0x674c('0x61')],_0x674c('0x62'),_0x1c6968+_0x674c('0x63'));hasTZ=_[_0x674c('0x3a')](_0x2fb91f)[_0x674c('0x64')](_0x674c('0x57'));var _0x287224=_['keys'](_0x2fb91f)[_0x674c('0x14')]();logger[_0x674c('0x42')]('header',_0x287224);if(hasTZ)_0x287224+=_0x674c('0x65');fs['writeFileSync'](_0x186381,_0x287224+'\x0a');Papa[_0x674c('0x66')](fs['createReadStream'](_0x40f784),{'header':!![],'skipEmptyLines':!![],'step':function(_0x35071e,_0x41c624){try{for(var _0x3e97e7=0x0,_0x36c6a4=[];_0x3e97e7<_0x35071e[_0x674c('0x67')][_0x674c('0x4f')];_0x3e97e7++){stats[_0x674c('0x68')]+=0x1;if(_0x35071e['errors'][_0x3e97e7]){handleError(_0x35071e['data'][_0x3e97e7],_0x35071e[_0x674c('0x69')][_0x3e97e7]);}else{var _0x598db4=[];for(var _0x1b85b7 in _0x2fb91f){if(_0x2fb91f[_0x674c('0x6a')](_0x1b85b7)){if(_0x35071e['data'][_0x3e97e7][_0x2fb91f[_0x1b85b7]]){var _0x52bd2b=_[_0x674c('0x6b')](_0x35071e[_0x674c('0x67')][_0x3e97e7][_0x2fb91f[_0x1b85b7]][_0x674c('0x6c')](/"/g,'\x27'));switch(_0x1b85b7){case _0x674c('0x20'):var _0x4bb282=moment(_0x52bd2b,_0x674c('0xf'),!![]);if(_0x4bb282[_0x674c('0x6d')]()){_0x36c6a4[_0x674c('0x46')]('\x22'+_0x52bd2b+'\x22');}else{_0x598db4[_0x674c('0x46')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x4738c0=parseInt(_0x52bd2b);_0x52bd2b=_[_0x674c('0x6e')](_0x4738c0)||_0x4738c0<0x0||_0x4738c0>0x4?_0x1516bd?0x3:0x2:_0x4738c0;_0x36c6a4['push']('\x22'+_0x52bd2b+'\x22');break;case _0x674c('0x23'):var _0x5a33ad=parseInt(_0x52bd2b);if(_[_0x674c('0x6f')](_0x5a33ad)&&_[_0x674c('0x64')](_0x559593,_0x5a33ad)){_0x36c6a4['push']('\x22'+_0x5a33ad+'\x22');}else{_0x598db4[_0x674c('0x46')](_0x674c('0x70'));}break;case _0x674c('0x71'):if(isEmail(_0x52bd2b)){_0x36c6a4[_0x674c('0x46')]('\x22'+_0x52bd2b+'\x22');}else{_0x598db4[_0x674c('0x46')](_0x674c('0x72'));}break;case'dateOfBirth':var _0xae6fb=moment(_0x52bd2b,'YYYY-MM-DD',!![]);if(_0xae6fb[_0x674c('0x6d')]()){_0x36c6a4['push']('\x22'+_0x52bd2b+'\x22');}else{_0x598db4[_0x674c('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x98462a=shared[_0x674c('0x73')];var _0x19d822=_0x98462a[_0x52bd2b];if(!_['isNil'](_0x19d822)){var _0x589594=_0x19d822['utcOffset'];_0x36c6a4['push']('\x22'+_0x52bd2b+'\x22');_0x36c6a4[_0x674c('0x46')]('\x22'+_0x589594+'\x22');}break;default:_0x36c6a4[_0x674c('0x46')]('\x22'+_0x52bd2b+'\x22');}}else{switch(_0x1b85b7){case'firstName':case _0x674c('0x13'):_0x598db4[_0x674c('0x46')](_0x1b85b7+_0x674c('0x74'));break;default:_0x36c6a4[_0x674c('0x46')]('\x22\x22');}}}}if(_0x598db4[_0x674c('0x4f')]){handleError(_0x35071e[_0x674c('0x67')][_0x3e97e7],{'code':_0x674c('0x75'),'message':_0x598db4['join']()});}else{fs[_0x674c('0x76')](_0x186381,_0x36c6a4[_0x674c('0x14')]()+'\x0a');}_0x36c6a4=[];}if(!(stats[_0x674c('0x68')]%0xc8)){socket[_0x674c('0x77')](_0x674c('0x78')+_0x1c6968,stats);stats[_0x674c('0x69')]=[];}}if(stopped){logger[_0x674c('0x42')](_0x674c('0x79'));_0x41c624['abort']();}}catch(_0x18d12d){handleError(_0x35071e[_0x674c('0x67')][_0x3e97e7],{'code':_0x674c('0x7a'),'message':_0x18d12d[_0x674c('0x44')]});logger['error'](_0x674c('0x7b'),_0x18d12d[_0x674c('0x44')]);}},'complete':function(){try{var _0x45a217=[];var _0x42b824=[];var _0x2748d5=_0x674c('0x25');if(_0x150445[_0x674c('0x7c')]&&_0x150445[_0x674c('0x7c')][_0x674c('0x4f')]){_0x2748d5='cm_contacts_'+_0x1c6968;_0x45a217[_0x674c('0x46')]('CREATE\x20TABLE\x20'+_0x2748d5+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x674c('0x7d')+_0x1c6968;tmp_voice_queues=_0x674c('0x7e')+_0x1c6968;_0x42b824[_0x674c('0x46')](_0x674c('0x7f')+tmp_campaigns+_0x674c('0x80'));_0x42b824[_0x674c('0x46')](_0x674c('0x7f')+tmp_voice_queues+_0x674c('0x80'));BPromise['each'](_0x42b824,handleTZQuery)['then'](function(_0x392c6f){updateTzCampaigns(_0x150445[_0x674c('0x22')])[_0x674c('0x51')](function(_0x38ff99){updateTzVoiceQueues(_0x150445[_0x674c('0x22')])[_0x674c('0x51')](function(_0x38505e){var _0x5d8fb0=util['format']('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',_0x186381,_0x2748d5,_0x287224,_0x150445['ListId'],_0x150445['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x2fb91f['scheduledat'])){_0x5d8fb0+=',\x20scheduledAt\x20=\x20NOW()';}_0x45a217[_0x674c('0x46')](_0x5d8fb0);if(_0x150445[_0x674c('0x7c')]&&_0x150445[_0x674c('0x7c')][_0x674c('0x4f')]){_0x45a217['push'](insertCmContact(_0x150445[_0x674c('0x22')],_0x2748d5,_0x150445[_0x674c('0x7c')],_0x2fb91f));_0x45a217[_0x674c('0x46')](_0x674c('0x81')+_0x2748d5+';');}if(hasTZ){_0x45a217['push'](insertTzCmHopper(_0x150445[_0x674c('0x22')],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x1516bd,tmp_voice_queues));_0x45a217[_0x674c('0x46')](insertTzCmHopperBlack(_0x150445[_0x674c('0x22')],_0x674c('0x82'),_0x674c('0x53'),_0x674c('0x83')));_0x45a217[_0x674c('0x46')](insertTzCmHopper(_0x150445[_0x674c('0x22')],_0x674c('0x84'),_0x674c('0x4b'),_0x674c('0x85'),_0x1516bd,tmp_campaigns));_0x45a217[_0x674c('0x46')](insertTzCmHopperBlack(_0x150445[_0x674c('0x22')],_0x674c('0x86'),_0x674c('0x4b'),_0x674c('0x85')));}else{_0x45a217[_0x674c('0x46')](insertCmHopper(_0x150445[_0x674c('0x22')],'voice_queues_has_cm_lists',_0x674c('0x53'),_0x674c('0x83'),_0x1516bd));_0x45a217[_0x674c('0x46')](insertCmHopperBlack(_0x150445[_0x674c('0x22')],_0x674c('0x82'),_0x674c('0x53'),_0x674c('0x83')));_0x45a217[_0x674c('0x46')](insertCmHopper(_0x150445[_0x674c('0x22')],_0x674c('0x84'),_0x674c('0x4b'),_0x674c('0x85'),_0x1516bd));_0x45a217[_0x674c('0x46')](insertCmHopperBlack(_0x150445[_0x674c('0x22')],_0x674c('0x86'),_0x674c('0x4b'),_0x674c('0x85')));}_0x45a217[_0x674c('0x46')](_0x674c('0x81')+tmp_campaigns+';');_0x45a217[_0x674c('0x46')](_0x674c('0x81')+tmp_voice_queues+';');BPromise[_0x674c('0x87')](_0x45a217,handleQuery)[_0x674c('0x51')](function(_0x3d4015){stats[_0x674c('0x88')]=!![];stats[_0x674c('0x89')]=_0x150445[_0x674c('0x7c')]&&_0x150445[_0x674c('0x7c')][_0x674c('0x4f')]?results[0x2][_0x674c('0x89')]:results[0x0]['affectedRows'];socket[_0x674c('0x77')](_0x674c('0x78')+_0x1c6968,stats);fs[_0x674c('0x8a')](_0x40f784);fs[_0x674c('0x8a')](_0x186381);process[_0x674c('0x45')](0x0);})[_0x674c('0x49')](function(_0x289514){logger[_0x674c('0x43')](_0x289514[_0x674c('0x44')]);process[_0x674c('0x45')](0x1);});});});});}catch(_0x459bf8){logger[_0x674c('0x43')](_0x674c('0x8b'),_0x459bf8[_0x674c('0x44')]);process[_0x674c('0x45')](0x1);}},'error':function(_0x4c5160,_0x4788ec,_0x285dff,_0x9ce7ec){throw new Error(_0x9ce7ec);}});}function validate(){if(process[_0x674c('0x8c')]&&process[_0x674c('0x8c')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x2488e2=path[_0x674c('0x14')](config[_0x674c('0x61')],_0x674c('0x62'),process[_0x674c('0x8c')][0x2]);if(!fs[_0x674c('0x8d')](_0x2488e2)){throw new Error(_0x674c('0x8e'));}var _0x54c88f={};try{_0x54c88f=JSON[_0x674c('0x66')](process['argv'][0x3]);if(!_0x54c88f[_0x674c('0x8f')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x54c88f[_0x674c('0x8f')]['phone']){throw new Error(_0x674c('0x90'));}if(!_0x54c88f[_0x674c('0x8f')]['firstName']){throw new Error(_0x674c('0x91'));}var _0x16e41f=0x0;if(_0x54c88f['binding'][_0x674c('0x23')]){_0x16e41f=0x1;}if(!_0x54c88f[_0x674c('0x22')]){throw new Error(_0x674c('0x92'));}}catch(_0x3c79df){throw new Error(_0x674c('0x93'));}var _0x2f0353=[];try{_0x2f0353=_[_0x674c('0x94')](JSON['parse'](process[_0x674c('0x8c')][0x4]),'id');}catch(_0x1e45ee){logger[_0x674c('0x42')](_0x674c('0x95'));}main(_0x2488e2,_0x54c88f,_0x2f0353,_0x16e41f);}validate();process['on']('SIGINT',handleStop);process['on'](_0x674c('0x96'),handleUncaughtException); \ No newline at end of file +var _0xf568=['cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','createdAt','fields','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','UserId','recallme','.CmListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','exit','errors','push','code','query','spread','catch','error','message','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','all','then','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=','length','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header',',utcOffset','writeFileSync','parse','data','rows','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','each','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','affectedRows','emit','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','insert','into'];(function(_0x1e0717,_0x29f843){var _0x217fbc=function(_0x19a971){while(--_0x19a971){_0x1e0717['push'](_0x1e0717['shift']());}};_0x217fbc(++_0x29f843);}(_0xf568,0x118));var _0x8f56=function(_0x3763a7,_0x1c625b){_0x3763a7=_0x3763a7-0x0;var _0x173d14=_0xf568[_0x3763a7];return _0x173d14;};'use strict';var fs=require('fs');var path=require(_0x8f56('0x0'));var _=require(_0x8f56('0x1'));var Papa=require('papaparse');var util=require(_0x8f56('0x2'));var BPromise=require(_0x8f56('0x3'));var moment=require(_0x8f56('0x4'));var squel=require('squel');var Redis=require(_0x8f56('0x5'));var db=require(_0x8f56('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0x8f56('0x7'));var logger=require(_0x8f56('0x8'))('import');config[_0x8f56('0x9')]=_['defaults'](config['redis'],{'host':_0x8f56('0xa'),'port':0x18eb});var socket=require(_0x8f56('0xb'))(new Redis(config[_0x8f56('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x8f56('0xc'));function isEmail(_0x493892){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'](_0x493892);}function selectNotIn(_0x30325a,_0x186b20,_0xe4f8d0,_0x51ad91,_0x4d6680){return squel[_0x8f56('0xd')]()[_0x8f56('0xe')](_0x8f56('0xf'))[_0x8f56('0x10')](_0x51ad91)['join'](_0x186b20,null,_0x186b20+_0x8f56('0x11')+_0x51ad91+'.'+_0xe4f8d0)[_0x8f56('0x12')](_0x51ad91+'.'+_0xe4f8d0+_0x8f56('0x13')+_0x30325a+'.'+_0xe4f8d0)[_0x8f56('0x12')](_0x186b20+_0x8f56('0x14')+_0x4d6680['join']()+')');}function insertCmHopper(_0x1e42d7,_0x2ccc1c,_0x18fac3,_0x436d9d,_0x310b84){var _0x18e70b=[_0x8f56('0x15'),_0x8f56('0x16'),'cm_contacts.id','cm_contacts.ListId',_0x2ccc1c+'.'+_0x436d9d,_0x8f56('0x17'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x310b84+'\x22'];return squel[_0x8f56('0x18')]()[_0x8f56('0x19')](_0x8f56('0x1a'))[_0x8f56('0x1b')]([_0x8f56('0xf'),_0x8f56('0x1c'),_0x8f56('0x1d'),_0x8f56('0x1e'),_0x436d9d,'createdAt',_0x8f56('0x1f'),_0x8f56('0x20'),'UserId','recallme'],squel[_0x8f56('0xd')]()['fields'](_0x18e70b)['from'](_0x2ccc1c)[_0x8f56('0x21')](_0x8f56('0x22'),null,_0x8f56('0x23')+_0x2ccc1c+_0x8f56('0x24'))[_0x8f56('0x21')](_0x18fac3,null,_0x18fac3+_0x8f56('0x11')+_0x2ccc1c+'.'+_0x436d9d)['where'](_0x2ccc1c+'.CmListId\x20=\x20?',_0x1e42d7)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8f56('0x12')](_0x8f56('0x25'),selectNotIn(_0x2ccc1c,_0x18fac3,_0x436d9d,_0x8f56('0x1a'),[_0x8f56('0x26'),_0x8f56('0x27')]))[_0x8f56('0x12')](_0x8f56('0x25'),selectNotIn(_0x2ccc1c,_0x18fac3,_0x436d9d,_0x8f56('0x1a'),[_0x8f56('0x26')])))[_0x8f56('0x28')]();}function insertCmHopperBlack(_0x4092c8,_0x3a338c,_0x2e7b63,_0x5ee54e){var _0x2ecdcc=[_0x8f56('0x15'),'cm_contacts.id','cm_contacts.ListId',_0x3a338c+'.'+_0x5ee54e,'cm_contacts.createdAt',_0x8f56('0x29')];return squel['insert']()['into'](_0x8f56('0x2a'))[_0x8f56('0x1b')]([_0x8f56('0xf'),_0x8f56('0x1d'),_0x8f56('0x1e'),_0x5ee54e,_0x8f56('0x2b'),'updatedAt'],squel[_0x8f56('0xd')]()[_0x8f56('0x2c')](_0x2ecdcc)[_0x8f56('0x10')](_0x3a338c)[_0x8f56('0x21')](_0x8f56('0x22'),null,_0x8f56('0x23')+_0x3a338c+_0x8f56('0x24'))[_0x8f56('0x21')](_0x2e7b63,null,_0x2e7b63+_0x8f56('0x11')+_0x3a338c+'.'+_0x5ee54e)[_0x8f56('0x12')](_0x3a338c+'.CmListId\x20=\x20?',_0x4092c8)['where'](_0x8f56('0x2d'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x8f56('0xd')]()[_0x8f56('0xe')](_0x8f56('0xf'))['from'](_0x8f56('0x2a'))[_0x8f56('0x12')](_0x8f56('0x2e'),_0x4092c8)[_0x8f56('0x12')](_0x5ee54e+'\x20=\x20?',_0x3a338c+'.'+_0x5ee54e)))[_0x8f56('0x28')]();}function insertTzCmHopper(_0x1cd9e6,_0x5d232b,_0x5230f5,_0x19c2e8,_0x20bedd,_0x2acfff){var _0x73e27=[_0x8f56('0x15'),_0x8f56('0x2f')+_0x2acfff+_0x8f56('0x30'),_0x8f56('0x31'),_0x8f56('0x32'),_0x5d232b+'.'+_0x19c2e8,_0x8f56('0x17'),_0x8f56('0x29'),_0x8f56('0x33'),_0x8f56('0x34'),'\x22'+_0x20bedd+'\x22'];var _0x6ca9bc=squel['insert']()[_0x8f56('0x19')](_0x8f56('0x1a'))[_0x8f56('0x1b')]([_0x8f56('0xf'),_0x8f56('0x1c'),'ContactId',_0x8f56('0x1e'),_0x19c2e8,_0x8f56('0x2b'),_0x8f56('0x1f'),'priority',_0x8f56('0x35'),_0x8f56('0x36')],squel[_0x8f56('0xd')]()[_0x8f56('0x2c')](_0x73e27)['from'](_0x5d232b)[_0x8f56('0x21')]('cm_contacts',null,_0x8f56('0x23')+_0x5d232b+_0x8f56('0x24'))[_0x8f56('0x21')](_0x5230f5,null,_0x5230f5+_0x8f56('0x11')+_0x5d232b+'.'+_0x19c2e8)[_0x8f56('0x21')](_0x2acfff,null,_0x2acfff+_0x8f56('0x11')+_0x5d232b+'.'+_0x19c2e8)['where'](_0x5d232b+_0x8f56('0x37'),_0x1cd9e6)[_0x8f56('0x12')](_0x8f56('0x2d'),NOW)[_0x8f56('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5d232b,_0x5230f5,_0x19c2e8,'cm_hopper',['\x22always\x22',_0x8f56('0x27')]))[_0x8f56('0x12')](_0x8f56('0x25'),selectNotIn(_0x5d232b,_0x5230f5,_0x19c2e8,_0x8f56('0x1a'),[_0x8f56('0x26')])))['toString']();return _0x6ca9bc;}function insertTzCmHopperBlack(_0x338e98,_0x245915,_0x525a70,_0x29c713){var _0x455f6e=['cm_contacts.phone',_0x8f56('0x31'),_0x8f56('0x32'),_0x245915+'.'+_0x29c713,_0x8f56('0x17'),_0x8f56('0x29')];return squel['insert']()['into']('cm_hopper_black')[_0x8f56('0x1b')]([_0x8f56('0xf'),'ContactId',_0x8f56('0x1e'),_0x29c713,'createdAt','updatedAt'],squel[_0x8f56('0xd')]()[_0x8f56('0x2c')](_0x455f6e)[_0x8f56('0x10')](_0x245915)['join']('cm_contacts',null,_0x8f56('0x23')+_0x245915+'.CmListId')[_0x8f56('0x21')](_0x525a70,null,_0x525a70+_0x8f56('0x11')+_0x245915+'.'+_0x29c713)[_0x8f56('0x12')](_0x245915+_0x8f56('0x37'),_0x338e98)[_0x8f56('0x12')](_0x8f56('0x2d'),NOW)[_0x8f56('0x12')](_0x8f56('0x25'),squel[_0x8f56('0xd')]()[_0x8f56('0xe')](_0x8f56('0xf'))[_0x8f56('0x10')](_0x8f56('0x2a'))[_0x8f56('0x12')](_0x8f56('0x2e'),_0x338e98)[_0x8f56('0x12')](_0x29c713+'\x20=\x20?',_0x245915+'.'+_0x29c713)))[_0x8f56('0x28')]();}function insertCmContact(_0x5824f0,_0x41ef61,_0x54f6e8,_0x228aae){var _0x5c85cc=_[_0x8f56('0x38')](_[_0x8f56('0x39')](_0x228aae),[_0x8f56('0x1e'),_0x8f56('0x3a'),_0x8f56('0x2b'),'updatedAt']);return squel['insert']()['into'](_0x8f56('0x22'))[_0x8f56('0x1b')](_0x5c85cc,squel[_0x8f56('0xd')]()['fields'](_0x5c85cc)[_0x8f56('0x10')](_0x41ef61)['where']('('+_0x54f6e8['join'](',')+_0x8f56('0x3b'),squel[_0x8f56('0xd')]()[_0x8f56('0x2c')](_0x54f6e8)[_0x8f56('0x10')](_0x8f56('0x22'))[_0x8f56('0x12')](_0x8f56('0x2e'),_0x5824f0)[_0x8f56('0x12')](_0x8f56('0x3c')))[_0x8f56('0x12')]('id\x20IN\x20?',squel[_0x8f56('0xd')]()[_0x8f56('0xe')](_0x8f56('0x3d'),_0x8f56('0x3e'))['from'](_0x41ef61)[_0x8f56('0x3f')](_0x54f6e8['join'](','))))[_0x8f56('0x28')]();}function handleStop(){logger[_0x8f56('0x40')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4b8aed){logger['error'](_0x4b8aed['message']);process[_0x8f56('0x41')](0x1);}function handleError(_0x18c536,_0x331fef){stats[_0x8f56('0x42')][_0x8f56('0x43')]({'name':_0x331fef[_0x8f56('0x44')],'message':_0x331fef['message'],'row':_0x18c536});}function handleQuery(_0x18c7ce){logger[_0x8f56('0x40')](_0x18c7ce);return db['sequelize'][_0x8f56('0x45')](_0x18c7ce)[_0x8f56('0x46')](function(_0x517b64){results['push'](_0x517b64);})[_0x8f56('0x47')](function(_0x2afd14){logger[_0x8f56('0x48')](_0x2afd14[_0x8f56('0x49')]);});}function updateTzCampaigns(_0x29d3f6){return new Promise(function(_0x294353,_0x5d4881){var _0x2b2246=squel[_0x8f56('0xd')]()[_0x8f56('0x2c')](['campaigns.id','campaigns.dialTimezone'])['from']('campaigns')[_0x8f56('0x21')](_0x8f56('0x4a'),null,_0x8f56('0x4b'))['where'](_0x8f56('0x4c')+_0x29d3f6);db[_0x8f56('0x4d')]['query'](_0x2b2246[_0x8f56('0x28')]())['spread'](function(_0x26147c){var _0x23aa15=[];for(var _0x3fe90f=0x0;_0x3fe90f<_0x26147c['length'];_0x3fe90f++){_0x23aa15[_0x8f56('0x43')](getTimezoneData(_0x26147c[_0x3fe90f],tmp_campaigns));}BPromise[_0x8f56('0x4e')](_0x23aa15)[_0x8f56('0x4f')](function(){_0x294353({'val':0x1});});})[_0x8f56('0x47')](function(_0x1ebae4){logger[_0x8f56('0x48')](_0x1ebae4[_0x8f56('0x49')]);_0x294353({'val':0x0});});});}function updateTzVoiceQueues(_0x16ad84){return new Promise(function(_0x88ec4f,_0x5c6554){var _0x319657=squel['select']()[_0x8f56('0x2c')]([_0x8f56('0x50'),_0x8f56('0x51')])[_0x8f56('0x10')]('voice_queues')[_0x8f56('0x21')](_0x8f56('0x52'),null,_0x8f56('0x53'))[_0x8f56('0x12')](_0x8f56('0x54')+_0x16ad84);db[_0x8f56('0x4d')][_0x8f56('0x45')](_0x319657[_0x8f56('0x28')]())[_0x8f56('0x46')](function(_0x3c5a6c){var _0x32be50=[];for(var _0x2c789a=0x0;_0x2c789a<_0x3c5a6c[_0x8f56('0x55')];_0x2c789a++){_0x32be50[_0x8f56('0x43')](getTimezoneData(_0x3c5a6c[_0x2c789a],tmp_voice_queues));}BPromise[_0x8f56('0x4e')](_0x32be50)[_0x8f56('0x4f')](function(){_0x88ec4f({'val':0x1});});})[_0x8f56('0x47')](function(_0x967430){logger[_0x8f56('0x48')](_0x967430[_0x8f56('0x49')]);_0x88ec4f({'val':0x0});});});}function getTimezoneData(_0x2ca901,_0x356efe){return new Promise(function(_0x28100d,_0x270988){var _0x1d37f3=shared[_0x8f56('0x56')];var _0x30a4ca=_0x1d37f3[_0x2ca901[_0x8f56('0x57')]];if(_[_0x8f56('0x58')](_0x30a4ca)){_0x28100d({'ret':0x1});}else{var _0x13092c=_0x30a4ca[_0x8f56('0x59')];var _0x1f4427=squel[_0x8f56('0x18')]()[_0x8f56('0x19')](_0x356efe)[_0x8f56('0x5a')]('id',_0x2ca901['id'])[_0x8f56('0x5a')](_0x8f56('0x5b'),_0x13092c)[_0x8f56('0x5a')]('dialTimezone',_0x2ca901['dialTimezone'])[_0x8f56('0x28')]();return db[_0x8f56('0x4d')]['query'](_0x1f4427)[_0x8f56('0x46')](function(_0x473732){_0x28100d({'ret':0x1});})[_0x8f56('0x47')](function(_0x28c544){logger[_0x8f56('0x48')](_0x28c544['message']);_0x270988({'ret':0x1});});}});}function handleTZQuery(_0xc5ca81){logger[_0x8f56('0x40')](_0xc5ca81);return db[_0x8f56('0x4d')][_0x8f56('0x45')](_0xc5ca81)[_0x8f56('0x46')](function(_0x2b2e27){})[_0x8f56('0x47')](function(_0x5184a1){logger[_0x8f56('0x48')](_0x5184a1[_0x8f56('0x49')]);});}function main(_0x338db3,_0x3716ab,_0x2ac554,_0x3c913d){logger[_0x8f56('0x40')](_0x8f56('0x5c'),_0x338db3,JSON[_0x8f56('0x5d')](_0x3716ab));process[_0x8f56('0x5e')](_0x8f56('0x5f'));var _0x218148=_0x3716ab[_0x8f56('0x60')];var _0x34c710=_0x3716ab[_0x8f56('0x61')];var _0x2dd8fa=path[_0x8f56('0x21')](config[_0x8f56('0x62')],_0x8f56('0x63'),_0x34c710+_0x8f56('0x64'));hasTZ=_['keys'](_0x218148)['includes']('dialTimezone');var _0x3f917e=_['keys'](_0x218148)[_0x8f56('0x21')]();logger[_0x8f56('0x40')](_0x8f56('0x65'),_0x3f917e);if(hasTZ)_0x3f917e+=_0x8f56('0x66');fs[_0x8f56('0x67')](_0x2dd8fa,_0x3f917e+'\x0a');Papa[_0x8f56('0x68')](fs['createReadStream'](_0x338db3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41f771,_0x3afe5b){try{for(var _0x29faf9=0x0,_0x282861=[];_0x29faf9<_0x41f771[_0x8f56('0x69')][_0x8f56('0x55')];_0x29faf9++){stats[_0x8f56('0x6a')]+=0x1;if(_0x41f771[_0x8f56('0x42')][_0x29faf9]){handleError(_0x41f771[_0x8f56('0x69')][_0x29faf9],_0x41f771[_0x8f56('0x42')][_0x29faf9]);}else{var _0x3550ec=[];for(var _0x1f8347 in _0x218148){if(_0x218148['hasOwnProperty'](_0x1f8347)){if(_0x41f771[_0x8f56('0x69')][_0x29faf9][_0x218148[_0x1f8347]]){var _0x13f88a=_[_0x8f56('0x6b')](_0x41f771[_0x8f56('0x69')][_0x29faf9][_0x218148[_0x1f8347]]['replace'](/"/g,'\x27'));switch(_0x1f8347){case _0x8f56('0x1c'):var _0x8fc70=moment(_0x13f88a,_0x8f56('0xc'),!![]);if(_0x8fc70['isValid']()){_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');}else{_0x3550ec['push'](_0x8f56('0x6c'));}break;case'priority':var _0x480ca8=parseInt(_0x13f88a);_0x13f88a=_[_0x8f56('0x6d')](_0x480ca8)||_0x480ca8<0x0||_0x480ca8>0x4?_0x3c913d?0x3:0x2:_0x480ca8;_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');break;case _0x8f56('0x35'):var _0x19c0cf=parseInt(_0x13f88a);if(_[_0x8f56('0x6e')](_0x19c0cf)&&_[_0x8f56('0x6f')](_0x2ac554,_0x19c0cf)){_0x282861['push']('\x22'+_0x19c0cf+'\x22');}else{_0x3550ec['push'](_0x8f56('0x70'));}break;case _0x8f56('0x71'):if(isEmail(_0x13f88a)){_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');}else{_0x3550ec['push'](_0x8f56('0x72'));}break;case _0x8f56('0x73'):var _0x504152=moment(_0x13f88a,_0x8f56('0x74'),!![]);if(_0x504152[_0x8f56('0x75')]()){_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');}else{_0x3550ec[_0x8f56('0x43')](_0x8f56('0x76'));}break;case _0x8f56('0x57'):var _0x28286a=shared[_0x8f56('0x56')];var _0xa49d02=_0x28286a[_0x13f88a];if(!_['isNil'](_0xa49d02)){var _0x40d059=_0xa49d02[_0x8f56('0x59')];_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');_0x282861[_0x8f56('0x43')]('\x22'+_0x40d059+'\x22');}break;default:_0x282861[_0x8f56('0x43')]('\x22'+_0x13f88a+'\x22');}}else{switch(_0x1f8347){case _0x8f56('0x77'):case _0x8f56('0xf'):_0x3550ec['push'](_0x1f8347+'\x20not\x20specified');break;default:_0x282861[_0x8f56('0x43')]('\x22\x22');}}}}if(_0x3550ec[_0x8f56('0x55')]){handleError(_0x41f771['data'][_0x29faf9],{'code':_0x8f56('0x78'),'message':_0x3550ec[_0x8f56('0x21')]()});}else{fs[_0x8f56('0x79')](_0x2dd8fa,_0x282861['join']()+'\x0a');}_0x282861=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x8f56('0x7a')+_0x34c710,stats);stats[_0x8f56('0x42')]=[];}}if(stopped){logger['info'](_0x8f56('0x7b'));_0x3afe5b[_0x8f56('0x7c')]();}}catch(_0xae24ae){handleError(_0x41f771[_0x8f56('0x69')][_0x29faf9],{'code':'SystemError','message':_0xae24ae[_0x8f56('0x49')]});logger[_0x8f56('0x48')](_0x8f56('0x7d'),_0xae24ae[_0x8f56('0x49')]);}},'complete':function(){try{var _0x3cf50b=[];var _0x27d190=[];var _0x47ccbb='cm_contacts';if(_0x3716ab[_0x8f56('0x7e')]&&_0x3716ab['duplicates']['length']){_0x47ccbb=_0x8f56('0x7f')+_0x34c710;_0x3cf50b[_0x8f56('0x43')](_0x8f56('0x80')+_0x47ccbb+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x8f56('0x81')+_0x34c710;tmp_voice_queues=_0x8f56('0x82')+_0x34c710;_0x27d190[_0x8f56('0x43')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x27d190[_0x8f56('0x43')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x8f56('0x83')](_0x27d190,handleTZQuery)[_0x8f56('0x4f')](function(_0x5cf43a){updateTzCampaigns(_0x3716ab[_0x8f56('0x1e')])[_0x8f56('0x4f')](function(_0x263142){updateTzVoiceQueues(_0x3716ab[_0x8f56('0x1e')])[_0x8f56('0x4f')](function(_0x281d43){var _0x3fc833=util[_0x8f56('0x84')](_0x8f56('0x85'),_0x2dd8fa,_0x47ccbb,_0x3f917e,_0x3716ab[_0x8f56('0x1e')],_0x3716ab[_0x8f56('0x3a')]||null,NOW,NOW);if(_['isNil'](_0x218148[_0x8f56('0x1c')])){_0x3fc833+=_0x8f56('0x86');}_0x3cf50b['push'](_0x3fc833);if(_0x3716ab[_0x8f56('0x7e')]&&_0x3716ab[_0x8f56('0x7e')]['length']){_0x3cf50b[_0x8f56('0x43')](insertCmContact(_0x3716ab[_0x8f56('0x1e')],_0x47ccbb,_0x3716ab[_0x8f56('0x7e')],_0x218148));_0x3cf50b['push'](_0x8f56('0x87')+_0x47ccbb+';');}if(hasTZ){_0x3cf50b[_0x8f56('0x43')](insertTzCmHopper(_0x3716ab[_0x8f56('0x1e')],_0x8f56('0x52'),_0x8f56('0x88'),_0x8f56('0x89'),_0x3c913d,tmp_voice_queues));_0x3cf50b[_0x8f56('0x43')](insertTzCmHopperBlack(_0x3716ab[_0x8f56('0x1e')],_0x8f56('0x8a'),_0x8f56('0x88'),_0x8f56('0x89')));_0x3cf50b['push'](insertTzCmHopper(_0x3716ab[_0x8f56('0x1e')],_0x8f56('0x4a'),_0x8f56('0x8b'),_0x8f56('0x8c'),_0x3c913d,tmp_campaigns));_0x3cf50b[_0x8f56('0x43')](insertTzCmHopperBlack(_0x3716ab['ListId'],'campaigns_has_cm_blacklists',_0x8f56('0x8b'),_0x8f56('0x8c')));}else{_0x3cf50b[_0x8f56('0x43')](insertCmHopper(_0x3716ab['ListId'],_0x8f56('0x52'),_0x8f56('0x88'),_0x8f56('0x89'),_0x3c913d));_0x3cf50b[_0x8f56('0x43')](insertCmHopperBlack(_0x3716ab[_0x8f56('0x1e')],'voice_queues_has_cm_blacklists',_0x8f56('0x88'),_0x8f56('0x89')));_0x3cf50b[_0x8f56('0x43')](insertCmHopper(_0x3716ab['ListId'],_0x8f56('0x4a'),_0x8f56('0x8b'),_0x8f56('0x8c'),_0x3c913d));_0x3cf50b['push'](insertCmHopperBlack(_0x3716ab[_0x8f56('0x1e')],_0x8f56('0x8d'),_0x8f56('0x8b'),_0x8f56('0x8c')));}_0x3cf50b[_0x8f56('0x43')](_0x8f56('0x87')+tmp_campaigns+';');_0x3cf50b[_0x8f56('0x43')](_0x8f56('0x87')+tmp_voice_queues+';');BPromise[_0x8f56('0x83')](_0x3cf50b,handleQuery)[_0x8f56('0x4f')](function(_0x2caa68){stats['finish']=!![];stats['affectedRows']=_0x3716ab[_0x8f56('0x7e')]&&_0x3716ab[_0x8f56('0x7e')][_0x8f56('0x55')]?results[0x2][_0x8f56('0x8e')]:results[0x0][_0x8f56('0x8e')];socket[_0x8f56('0x8f')]('contact:import:'+_0x34c710,stats);fs[_0x8f56('0x90')](_0x338db3);fs[_0x8f56('0x90')](_0x2dd8fa);process[_0x8f56('0x41')](0x0);})[_0x8f56('0x47')](function(_0x29f439){logger[_0x8f56('0x48')](_0x29f439[_0x8f56('0x49')]);process[_0x8f56('0x41')](0x1);});});});});}catch(_0x4cbbd8){logger['error'](_0x8f56('0x91'),_0x4cbbd8[_0x8f56('0x49')]);process[_0x8f56('0x41')](0x1);}},'error':function(_0xf30c61,_0x5b81dc,_0x3a80b6,_0x2666d2){throw new Error(_0x2666d2);}});}function validate(){if(process[_0x8f56('0x92')]&&process[_0x8f56('0x92')][_0x8f56('0x55')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x2beab3=path['join'](config[_0x8f56('0x62')],_0x8f56('0x63'),process[_0x8f56('0x92')][0x2]);if(!fs[_0x8f56('0x93')](_0x2beab3)){throw new Error(_0x8f56('0x94'));}var _0x4a1ee4={};try{_0x4a1ee4=JSON['parse'](process['argv'][0x3]);if(!_0x4a1ee4[_0x8f56('0x60')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x4a1ee4[_0x8f56('0x60')][_0x8f56('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4a1ee4[_0x8f56('0x60')][_0x8f56('0x77')]){throw new Error('firstName\x20is\x20mandatory');}var _0x10d69e=0x0;if(_0x4a1ee4[_0x8f56('0x60')][_0x8f56('0x35')]){_0x10d69e=0x1;}if(!_0x4a1ee4[_0x8f56('0x1e')]){throw new Error(_0x8f56('0x95'));}}catch(_0x349e60){throw new Error(_0x8f56('0x96'));}var _0x2d6b0d=[];try{_0x2d6b0d=_['map'](JSON[_0x8f56('0x68')](process[_0x8f56('0x92')][0x4]),'id');}catch(_0x798d6){logger[_0x8f56('0x40')](_0x8f56('0x97'));}main(_0x2beab3,_0x4a1ee4,_0x2d6b0d,_0x10d69e);}validate();process['on'](_0x8f56('0x98'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index c85d0ca..5b5541d 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a86=['Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','calleridnum','outbound','getDescriptions','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','calleridname','keyValue','Call\x20To','destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','talktime','destcalleridnum','Member\x20Name','membername','starttime','Answer\x20Time','answertime','endtime','Duration'];(function(_0x602ac7,_0x2b84ba){var _0x14e54d=function(_0x15242e){while(--_0x15242e){_0x602ac7['push'](_0x602ac7['shift']());}};_0x14e54d(++_0x2b84ba);}(_0x2a86,0x1f0));var _0x62a8=function(_0x8d6101,_0x595bcc){_0x8d6101=_0x8d6101-0x0;var _0x4c14f3=_0x2a86[_0x8d6101];return _0x4c14f3;};'use strict';exports[_0x62a8('0x0')]=function(_0x175b38,_0x5b45a7){var _0x536107=[{'type':_0x62a8('0x1'),'content':_0x62a8('0x2'),'variableName':null}];switch(_0x175b38[_0x62a8('0x3')]()){case _0x62a8('0x4'):switch(_0x5b45a7[_0x62a8('0x3')]()){case'inbound':_0x536107[_0x62a8('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x536107['push']({'type':_0x62a8('0x6'),'content':'','variableName':_0x62a8('0x7')});break;case _0x62a8('0x8'):_0x536107[_0x62a8('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x536107[_0x62a8('0x5')]({'type':_0x62a8('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x536107;};exports[_0x62a8('0x9')]=function(_0x58136e,_0xecdfab){var _0x1f00ac=[];switch(_0x58136e[_0x62a8('0x3')]()){case'voice':switch(_0xecdfab[_0x62a8('0x3')]()){case _0x62a8('0xa'):_0x1f00ac=[{'type':'string','content':_0x62a8('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x62a8('0xc'),'keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x62a8('0x6'),'variableName':_0x62a8('0xd')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0xf'),'keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x10')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x12'),'keyType':_0x62a8('0x6'),'variableName':'uniqueid'},{'type':_0x62a8('0xe'),'content':'','key':'Date','keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x13')},{'type':_0x62a8('0x1'),'content':_0x62a8('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x62a8('0x15'),'keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x16')},{'type':_0x62a8('0xe'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':'destcalleridnum'},{'type':_0x62a8('0x1'),'content':_0x62a8('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x62a8('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x62a8('0x6'),'variableName':'agentcalledAt'},{'type':_0x62a8('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x18')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x19'),'keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x1a')},{'type':_0x62a8('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x62a8('0x6'),'variableName':'holdtime'},{'type':_0x62a8('0xe'),'content':'','key':'Talk\x20Time','keyType':_0x62a8('0x6'),'variableName':_0x62a8('0x1b')}];break;case _0x62a8('0x8'):_0x1f00ac=[{'type':_0x62a8('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x62a8('0xe'),'content':'','key':'Called\x20Number','keyType':_0x62a8('0x6'),'keyContent':'','variableName':_0x62a8('0x1c')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x1d'),'keyType':'variable','keyContent':'','variableName':_0x62a8('0x1e')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x12'),'keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0x62a8('0x6'),'keyContent':'','variableName':_0x62a8('0x1f')},{'type':_0x62a8('0x1'),'content':_0x62a8('0x17')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x20'),'keyType':_0x62a8('0x6'),'keyContent':'','variableName':_0x62a8('0x21')},{'type':_0x62a8('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x62a8('0x6'),'keyContent':'','variableName':_0x62a8('0x22')},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x23'),'keyType':_0x62a8('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x62a8('0xe'),'content':'','key':_0x62a8('0x24'),'keyType':_0x62a8('0x6'),'keyContent':'','variableName':_0x62a8('0x25')}];break;}}return _0x1f00ac;}; \ No newline at end of file +var _0x6890=['Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','calleridnum','keyValue','Caller\x20Name','Call\x20To','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Complete\x20Time','Duration','duration'];(function(_0x521113,_0x51db6){var _0x1a934b=function(_0x21dcc8){while(--_0x21dcc8){_0x521113['push'](_0x521113['shift']());}};_0x1a934b(++_0x51db6);}(_0x6890,0x16a));var _0x0689=function(_0x15db26,_0x421c66){_0x15db26=_0x15db26-0x0;var _0x29cdb6=_0x6890[_0x15db26];return _0x29cdb6;};'use strict';exports[_0x0689('0x0')]=function(_0x32e771,_0x4e5217){var _0x2b625b=[{'type':_0x0689('0x1'),'content':_0x0689('0x2'),'variableName':null}];switch(_0x32e771[_0x0689('0x3')]()){case'voice':switch(_0x4e5217[_0x0689('0x3')]()){case _0x0689('0x4'):_0x2b625b[_0x0689('0x5')]({'type':_0x0689('0x6'),'content':'','variableName':_0x0689('0x7')});_0x2b625b[_0x0689('0x5')]({'type':_0x0689('0x6'),'content':'','variableName':'calleridnum'});break;case _0x0689('0x8'):_0x2b625b[_0x0689('0x5')]({'type':_0x0689('0x1'),'content':_0x0689('0x9'),'variableName':null});_0x2b625b[_0x0689('0x5')]({'type':_0x0689('0x6'),'content':'','variableName':_0x0689('0xa')});break;}}return _0x2b625b;};exports[_0x0689('0xb')]=function(_0x42e8e8,_0x5e685a){var _0x33ca73=[];switch(_0x42e8e8[_0x0689('0x3')]()){case _0x0689('0xc'):switch(_0x5e685a[_0x0689('0x3')]()){case _0x0689('0x4'):_0x33ca73=[{'type':_0x0689('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x0689('0x6'),'variableName':_0x0689('0xd')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0xf'),'keyType':_0x0689('0x6'),'variableName':'calleridname'},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x10'),'keyType':_0x0689('0x6'),'variableName':'destexten'},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x11'),'keyType':'variable','variableName':_0x0689('0x7')},{'type':_0x0689('0xe'),'content':'','key':'UniqueId','keyType':_0x0689('0x6'),'variableName':_0x0689('0x12')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x13'),'keyType':_0x0689('0x6'),'variableName':'agentcalledAt'},{'type':_0x0689('0x1'),'content':_0x0689('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x15'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0x16')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x17'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0xa')},{'type':_0x0689('0x1'),'content':_0x0689('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x19'),'keyType':'variable','variableName':_0x0689('0x1a')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x1b'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0x1c')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x1d'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0x1e')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x1f'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0x20')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x21'),'keyType':_0x0689('0x6'),'variableName':_0x0689('0x22')}];break;case _0x0689('0x8'):_0x33ca73=[{'type':_0x0689('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x23'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0xa')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x24'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0x25')},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x26'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0x12')},{'type':'keyValue','content':'','key':_0x0689('0x13'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0x27')},{'type':_0x0689('0x1'),'content':_0x0689('0x18')},{'type':_0x0689('0xe'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x0689('0xe'),'content':'','key':_0x0689('0x28'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x0689('0x29'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0x2a')},{'type':'keyValue','content':'','key':_0x0689('0x2b'),'keyType':_0x0689('0x6'),'keyContent':'','variableName':_0x0689('0x2c')}];break;}}return _0x33ca73;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index f40f572..8ec5b86 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56b7=['unknown','toLowerCase','toUpperCase','role','stringify','null','Interaction','then','update','info','catch','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','fax-interactions','whatsapp-interactions','upperFirst','InteractionId'];(function(_0x243455,_0x4c205e){var _0x2a7ce9=function(_0x360054){while(--_0x360054){_0x243455['push'](_0x243455['shift']());}};_0x2a7ce9(++_0x4c205e);}(_0x56b7,0x69));var _0x756b=function(_0x2adf4,_0x5df6de){_0x2adf4=_0x2adf4-0x0;var _0x45d47d=_0x56b7[_0x2adf4];return _0x45d47d;};'use strict';var _=require(_0x756b('0x0'));var db=require(_0x756b('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x756b('0x2'))('mail-interactions'),'fax':require(_0x756b('0x2'))(_0x756b('0x3')),'sms':require(_0x756b('0x2'))('sms-interactions'),'chat':require(_0x756b('0x2'))('chat-interactions'),'whatsapp':require(_0x756b('0x2'))(_0x756b('0x4'))};function getInteractionId(_0x369af2,_0x7de18d,_0x378349){if(_0x369af2&&_0x369af2[_[_0x756b('0x5')](_0x378349)+_0x756b('0x6')]){return _0x369af2[_[_0x756b('0x5')](_0x378349)+_0x756b('0x6')];}else if(_0x369af2&&_0x369af2['id']){return _0x369af2['id'];}else if(_0x7de18d&&_0x7de18d['id']){return _0x7de18d['id'];}else{return _0x756b('0x7');}}function log(_0x17a213,_0x552f0a,_0x4a7f8f,_0x241e12,_0x49769c,_0x414d94){loggers[_0x49769c[_0x756b('0x8')]()][_0x17a213]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x414d94[_0x756b('0x9')](),_0x552f0a?_0x552f0a['id']:null,_0x552f0a?_0x552f0a['name']:null,_0x552f0a?_0x552f0a[_0x756b('0xa')]:null,getInteractionId(_0x4a7f8f,_0x241e12,_0x49769c),_0x4a7f8f?JSON[_0x756b('0xb')](_0x4a7f8f):_0x756b('0xc'));}function updateUser(_0x244c7c,_0x13d6e0,_0x4a5915,_0x4cfc12,_0x3e3b78){db[_[_0x756b('0x5')](_0x4cfc12)+_0x756b('0xd')]['findOne']({'where':{'id':getInteractionId(_0x13d6e0,_0x4a5915,_0x4cfc12)}})[_0x756b('0xe')](function(_0x3d9170){if(_0x3d9170){return _0x3d9170[_0x756b('0xf')]({'UserId':_0x244c7c?_0x244c7c['id']:null});}})[_0x756b('0xe')](function(_0x269d66){if(_0x269d66){log(_0x756b('0x10'),_0x244c7c,_0x13d6e0,_0x4a5915,_0x4cfc12,_0x3e3b78);}})[_0x756b('0x11')](function(){log('error',_0x244c7c,_0x13d6e0,_0x4a5915,_0x4cfc12,_0x3e3b78);});}exports[_0x756b('0x12')]=function(_0x58a429,_0xdc4d91){return function(_0x5a3d11,_0x2c956b,_0x536c30){var _0x3d9759=_0x5a3d11[_0x756b('0x13')];var _0x5eac2b={};var _0x3b0a3f=_0x5a3d11[_0x756b('0x14')];if(_0x5eac2b){_0x5eac2b=_[_0x756b('0x15')](_0x5a3d11[_0x756b('0x16')]);_0x5eac2b=_[_0x756b('0x17')](_0x5eac2b,[_0x756b('0x16'),_0x756b('0x18'),_0x756b('0x19'),_0x756b('0x1a'),_0x756b('0x1b')]);}updateUser(_0x3d9759,_0x5eac2b,_0x3b0a3f,_0x58a429,_0xdc4d91);_0x536c30(null);};}; \ No newline at end of file +var _0x9c9c=['null','Interaction','update','then','info','catch','error','tracked','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify'];(function(_0x416d6e,_0x375e8c){var _0x4b934a=function(_0x419c7a){while(--_0x419c7a){_0x416d6e['push'](_0x416d6e['shift']());}};_0x4b934a(++_0x375e8c);}(_0x9c9c,0x9e));var _0xc9c9=function(_0x4b870e,_0x390eca){_0x4b870e=_0x4b870e-0x0;var _0x234d51=_0x9c9c[_0x4b870e];return _0x234d51;};'use strict';var _=require(_0xc9c9('0x0'));var db=require(_0xc9c9('0x1'))['db'];var loggers={'openchannel':require(_0xc9c9('0x2'))(_0xc9c9('0x3')),'mail':require(_0xc9c9('0x2'))(_0xc9c9('0x4')),'fax':require(_0xc9c9('0x2'))(_0xc9c9('0x5')),'sms':require('../../config/logger')(_0xc9c9('0x6')),'chat':require(_0xc9c9('0x2'))(_0xc9c9('0x7')),'whatsapp':require(_0xc9c9('0x2'))(_0xc9c9('0x8'))};function getInteractionId(_0x3be36f,_0x355233,_0x17a71a){if(_0x3be36f&&_0x3be36f[_[_0xc9c9('0x9')](_0x17a71a)+_0xc9c9('0xa')]){return _0x3be36f[_[_0xc9c9('0x9')](_0x17a71a)+'InteractionId'];}else if(_0x3be36f&&_0x3be36f['id']){return _0x3be36f['id'];}else if(_0x355233&&_0x355233['id']){return _0x355233['id'];}else{return _0xc9c9('0xb');}}function log(_0x34dec3,_0x4262a2,_0x37af0c,_0x2cece1,_0x442684,_0x20a2ff){loggers[_0x442684['toLowerCase']()][_0x34dec3](_0xc9c9('0xc'),_0x20a2ff[_0xc9c9('0xd')](),_0x4262a2?_0x4262a2['id']:null,_0x4262a2?_0x4262a2['name']:null,_0x4262a2?_0x4262a2[_0xc9c9('0xe')]:null,getInteractionId(_0x37af0c,_0x2cece1,_0x442684),_0x37af0c?JSON[_0xc9c9('0xf')](_0x37af0c):_0xc9c9('0x10'));}function updateUser(_0x5dc22a,_0x970363,_0x3bf626,_0x38c069,_0x301f2e){db[_[_0xc9c9('0x9')](_0x38c069)+_0xc9c9('0x11')]['findOne']({'where':{'id':getInteractionId(_0x970363,_0x3bf626,_0x38c069)}})['then'](function(_0x533ec2){if(_0x533ec2){return _0x533ec2[_0xc9c9('0x12')]({'UserId':_0x5dc22a?_0x5dc22a['id']:null});}})[_0xc9c9('0x13')](function(_0x34e641){if(_0x34e641){log(_0xc9c9('0x14'),_0x5dc22a,_0x970363,_0x3bf626,_0x38c069,_0x301f2e);}})[_0xc9c9('0x15')](function(){log(_0xc9c9('0x16'),_0x5dc22a,_0x970363,_0x3bf626,_0x38c069,_0x301f2e);});}exports[_0xc9c9('0x17')]=function(_0x38a9f6,_0x33961c){return function(_0xffba05,_0xe46bef,_0x53ed92){var _0x5b6653=_0xffba05['user'];var _0x250219={};var _0x179a88=_0xffba05['query'];if(_0x250219){_0x250219=_['clone'](_0xffba05[_0xc9c9('0x18')]);_0x250219=_['omit'](_0x250219,[_0xc9c9('0x18'),_0xc9c9('0x19'),_0xc9c9('0x1a'),_0xc9c9('0x1b'),_0xc9c9('0x1c')]);}updateUser(_0x5b6653,_0x250219,_0x179a88,_0x38a9f6,_0x33961c);_0x53ed92(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 315c4c8..c73df41 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 _0xe814=['base64','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update'];(function(_0x331123,_0x4d2692){var _0x19bf91=function(_0xa0991e){while(--_0xa0991e){_0x331123['push'](_0x331123['shift']());}};_0x19bf91(++_0x4d2692);}(_0xe814,0x1b5));var _0x4e81=function(_0x192fc9,_0x15db2c){_0x192fc9=_0x192fc9-0x0;var _0x40c355=_0xe814[_0x192fc9];return _0x40c355;};'use strict';var crypto=require('crypto');var util=require(_0x4e81('0x0'));var compose=require(_0x4e81('0x1'));var db=require(_0x4e81('0x2'))['db'];var config=require(_0x4e81('0x3'));function getValueFromLicense(_0x1ef2aa,_0x17d26d){if(_0x1ef2aa&&_0x17d26d){if(_0x17d26d['data1']&&_0x17d26d[_0x4e81('0x4')]){var _0x555039=_0x17d26d['data1'];var _0x4ae6cf=_0x17d26d[_0x4e81('0x4')];var _0x21552f=_0x555039[_0x4e81('0x5')]('-')[0x4];var _0x45c311=_0x555039[_0x4e81('0x5')]('-')[0x0];var _0x56d494=crypto[_0x4e81('0x6')](_0x4e81('0x7'),util[_0x4e81('0x8')](_0x4e81('0x9'),_0x21552f,_0x555039,_0x45c311));var _0x13799b=_0x56d494[_0x4e81('0xa')](_0x4ae6cf,_0x4e81('0xb'),_0x4e81('0xc'));_0x13799b+=_0x56d494[_0x4e81('0xd')](_0x4e81('0xc'));var _0x101331=JSON[_0x4e81('0xe')](_0x13799b);return _0x101331['hasOwnProperty'](_0x1ef2aa)?_0x101331[_0x1ef2aa]:null;}}return null;}function isLimit(_0x5b9f29,_0x2df777,_0x11b7e1,_0x421759){var _0x168111=_0x2df777;return compose()[_0x4e81('0xf')](function(_0x4178f6,_0x15a074,_0x301eb0){return db[_0x4e81('0x10')][_0x4e81('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x4e81('0x12')](function(_0x220aad){var _0x4dbdd8=getValueFromLicense(_0x5b9f29,_0x220aad);return _0x4dbdd8?_0x4dbdd8:_0x168111;})[_0x4e81('0x12')](function(_0x299f38){_0x168111=_0x299f38;return _0x11b7e1[_0x4e81('0x13')](_0x421759);})[_0x4e81('0x12')](function(_0x5b032f){if(_0x5b032f>=_0x168111){return _0x15a074[_0x4e81('0x14')](0x193)[_0x4e81('0x15')]({'message':util[_0x4e81('0x8')](_0x4e81('0x16'),_0x5b9f29)});}_0x301eb0();})[_0x4e81('0x17')](function(_0x312219){_0x301eb0(_0x312219);});});}function isUserLimit(){return isLimit(_0x4e81('0x18'),0x1,db[_0x4e81('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0x4e81('0x1a')}]}});}exports[_0x4e81('0x1b')]=isUserLimit; \ No newline at end of file +var _0x4c88=['status','json','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License'];(function(_0x304210,_0x351601){var _0x5bd9b9=function(_0x4e6888){while(--_0x4e6888){_0x304210['push'](_0x304210['shift']());}};_0x5bd9b9(++_0x351601);}(_0x4c88,0x95));var _0x84c8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4c88[_0x21a9d9];return _0x46adce;};'use strict';var crypto=require(_0x84c8('0x0'));var util=require(_0x84c8('0x1'));var compose=require(_0x84c8('0x2'));var db=require(_0x84c8('0x3'))['db'];var config=require(_0x84c8('0x4'));function getValueFromLicense(_0x147ba6,_0x1bc8b4){if(_0x147ba6&&_0x1bc8b4){if(_0x1bc8b4[_0x84c8('0x5')]&&_0x1bc8b4[_0x84c8('0x6')]){var _0x4b87ec=_0x1bc8b4['data1'];var _0x55b359=_0x1bc8b4[_0x84c8('0x6')];var _0xf0c02c=_0x4b87ec[_0x84c8('0x7')]('-')[0x4];var _0x34e6ad=_0x4b87ec[_0x84c8('0x7')]('-')[0x0];var _0x4cbc5c=crypto[_0x84c8('0x8')](_0x84c8('0x9'),util[_0x84c8('0xa')](_0x84c8('0xb'),_0xf0c02c,_0x4b87ec,_0x34e6ad));var _0x53feb4=_0x4cbc5c[_0x84c8('0xc')](_0x55b359,_0x84c8('0xd'),_0x84c8('0xe'));_0x53feb4+=_0x4cbc5c[_0x84c8('0xf')](_0x84c8('0xe'));var _0x1fdb5b=JSON[_0x84c8('0x10')](_0x53feb4);return _0x1fdb5b[_0x84c8('0x11')](_0x147ba6)?_0x1fdb5b[_0x147ba6]:null;}}return null;}function isLimit(_0x3c6f3a,_0x42b368,_0x44e8ca,_0x16527b){var _0x343900=_0x42b368;return compose()['use'](function(_0x5b5908,_0x217030,_0x24a604){return db[_0x84c8('0x12')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0xde97a5){var _0xbc1de8=getValueFromLicense(_0x3c6f3a,_0xde97a5);return _0xbc1de8?_0xbc1de8:_0x343900;})['then'](function(_0x11f13b){_0x343900=_0x11f13b;return _0x44e8ca['count'](_0x16527b);})['then'](function(_0x48d180){if(_0x48d180>=_0x343900){return _0x217030[_0x84c8('0x13')](0x193)[_0x84c8('0x14')]({'message':util[_0x84c8('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3c6f3a)});}_0x24a604();})['catch'](function(_0x2eaa9d){_0x24a604(_0x2eaa9d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x84c8('0x15')],{'where':{'$or':[{'role':_0x84c8('0x16')},{'role':'user'}]}});}exports[_0x84c8('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 458957c..2dd89ae 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 _0x77fc=['castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','minutes','seconds','lodash','parseSearch','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','match','filter','conditions','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x77fc,0x125));var _0xc77f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x77fc[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc77f('0x0'));var moment=require('moment');exports[_0xc77f('0x1')]=function(_0x2ef62c){var _0x1eab1d={'conditions':[]};_0x1eab1d['sqlOperator']=_[_0xc77f('0x2')](_0x2ef62c,_0xc77f('0x3'))?'or':_0xc77f('0x4');var _0x1704ee=_0x2ef62c['replace']('[$and]','')[_0xc77f('0x5')]('[$or]','')[_0xc77f('0x6')]('||');for(var _0x17ee32=0x0;_0x17ee32<_0x1704ee[_0xc77f('0x7')];_0x17ee32++){var _0x31a6e5=_0x1704ee[_0x17ee32][_0xc77f('0x6')](':=');var _0x3279d5=_0x31a6e5[0x0];var _0x8ae939=_0x31a6e5[_0xc77f('0x8')](0x1);_0x8ae939[_0xc77f('0x9')](function(_0x321275){var _0x44a209=_0x321275[_0xc77f('0x6')]('[')[_0xc77f('0xa')]();var _0x140670=_0x321275[_0xc77f('0xb')](/\[(.*?)\]/g);_0x140670[_0xc77f('0x9')](function(_0x5ea508){var _0x259fd8=_0x5ea508[_0xc77f('0x6')]('[')[_0xc77f('0xc')](function(_0x1259e0){return _0x1259e0['indexOf'](']')>-0x1;})['map'](function(_0x53a5db){return _0x53a5db[_0xc77f('0x6')](']')[0x0];})[0x0];_0x1eab1d[_0xc77f('0xd')]['push']({'field':_0x3279d5,'operator':_0x44a209,'value':_0x259fd8});});});}return _0x1eab1d;};exports['buildExpression']=function(_0x1bd6dc,_0xc7a872,_0x2deb28){var _0x33af6c={};if(_0xc7a872===_0xc77f('0xe')){if(_0x2deb28[_0xc77f('0xf')]===_0xc77f('0x10')){_0x2deb28[_0xc77f('0xf')]='$between';_0x2deb28[_0xc77f('0x11')]+=','+_0x2deb28['value'];}else if(_[_0xc77f('0x12')]([_0xc77f('0x13'),_0xc77f('0x14')],_0x2deb28[_0xc77f('0xf')])){_0x2deb28[_0xc77f('0x11')]=moment(_0x2deb28[_0xc77f('0x11')])[_0xc77f('0x15')](0x1,_0xc77f('0x16'))[_0xc77f('0x17')](_0xc77f('0x18'));}}if(_0x2deb28[_0xc77f('0x19')]){_0xc7a872=_0x2deb28[_0xc77f('0x19')];_0x33af6c[_0xc77f('0x1a')]=_0xc77f('0x1b')+_0x1bd6dc+'.'+_0x2deb28['field']+_0xc77f('0x1c')+_0x2deb28['castTo']+')\x20'+parseOperator(_0x2deb28['operator']);}else{_0x33af6c['text']=_0x1bd6dc+'.'+_0x2deb28[_0xc77f('0x1d')]+'\x20'+parseOperator(_0x2deb28[_0xc77f('0xf')]);}if(_[_0xc77f('0x12')]([_0xc77f('0x1e'),_0xc77f('0x1f')],_0x2deb28['operator']))_0x33af6c[_0xc77f('0x1a')]='('+_0x33af6c['text']+'\x20OR\x20'+_0x1bd6dc+'.'+_0x2deb28[_0xc77f('0x1d')]+_0xc77f('0x20');_0x33af6c[_0xc77f('0x11')]=parseValue(_0xc7a872,_0x2deb28['operator'],_0x2deb28[_0xc77f('0x11')]);return _0x33af6c;};function parseOperator(_0x1ebc61){var _0x3f42ad;switch(_0x1ebc61){case _0xc77f('0x21'):_0x3f42ad=_0xc77f('0x22');break;case'$notIn':_0x3f42ad=_0xc77f('0x23');break;case'$eq':_0x3f42ad=_0xc77f('0x24');break;case _0xc77f('0x1e'):_0x3f42ad=_0xc77f('0x25');break;case _0xc77f('0x26'):case _0xc77f('0x27'):case _0xc77f('0x28'):_0x3f42ad='LIKE\x20?';break;case _0xc77f('0x29'):_0x3f42ad=_0xc77f('0x2a');break;case'$gt':_0x3f42ad='>\x20?';break;case _0xc77f('0x14'):_0x3f42ad=_0xc77f('0x2b');break;case _0xc77f('0x2c'):_0x3f42ad=_0xc77f('0x2d');break;case _0xc77f('0x2e'):_0x3f42ad=_0xc77f('0x2f');break;}return _0x3f42ad;}function parseValue(_0x53627b,_0x4d3307,_0x1e6c62){var _0x4e71a1={'start':undefined,'end':undefined};switch(_0x4d3307){case _0xc77f('0x21'):case _0xc77f('0x1f'):_0x4e71a1[_0xc77f('0x30')]=_0x1e6c62[_0xc77f('0x6')](',');break;case _0xc77f('0x26'):_0x4e71a1['start']='%'+_0x1e6c62+'%';break;case _0xc77f('0x27'):_0x4e71a1['start']=_0x1e6c62+'%';break;case _0xc77f('0x28'):_0x4e71a1[_0xc77f('0x30')]='%'+_0x1e6c62;break;case _0xc77f('0x2e'):var _0x3709b1=_0x1e6c62['split'](',');var _0x1e6c62=_0x3709b1[_0xc77f('0xa')]();var _0x53aa07=_0x3709b1['pop']();if(_0x53627b===_0xc77f('0xe')){_0x1e6c62=moment(_0x1e6c62)[_0xc77f('0x31')](0x0,!![])[_0xc77f('0x17')]();_0x53aa07=moment(_0x53aa07)[_0xc77f('0x31')](0x0,!![])[_0xc77f('0x15')](0x17,_0xc77f('0x32'))[_0xc77f('0x15')](0x3b,_0xc77f('0x33'))[_0xc77f('0x15')](0x3b,_0xc77f('0x34'))[_0xc77f('0x17')]();}_0x4e71a1={'start':_0x1e6c62,'end':_0x53aa07};break;default:_0x4e71a1[_0xc77f('0x30')]=_0x1e6c62;break;}return _0x4e71a1;} \ No newline at end of file +var _0x2daf=['minutes','seconds','parseSearch','sqlOperator','[$or]','and','replace','split','length','slice','forEach','shift','filter','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','format','hours'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2daf,0x106));var _0xf2da=function(_0x16fcb4,_0x4a1009){_0x16fcb4=_0x16fcb4-0x0;var _0x54be5e=_0x2daf[_0x16fcb4];return _0x54be5e;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xf2da('0x0')]=function(_0x339c59){var _0x37c49b={'conditions':[]};_0x37c49b[_0xf2da('0x1')]=_['startsWith'](_0x339c59,_0xf2da('0x2'))?'or':_0xf2da('0x3');var _0x2a25de=_0x339c59[_0xf2da('0x4')]('[$and]','')['replace'](_0xf2da('0x2'),'')[_0xf2da('0x5')]('||');for(var _0x25218=0x0;_0x25218<_0x2a25de[_0xf2da('0x6')];_0x25218++){var _0x21c1b8=_0x2a25de[_0x25218][_0xf2da('0x5')](':=');var _0x4a3411=_0x21c1b8[0x0];var _0x459256=_0x21c1b8[_0xf2da('0x7')](0x1);_0x459256[_0xf2da('0x8')](function(_0x2d19bd){var _0xf0a3d0=_0x2d19bd[_0xf2da('0x5')]('[')[_0xf2da('0x9')]();var _0xe36b8d=_0x2d19bd['match'](/\[(.*?)\]/g);_0xe36b8d['forEach'](function(_0x144ac6){var _0x2b04e4=_0x144ac6[_0xf2da('0x5')]('[')[_0xf2da('0xa')](function(_0x3ec561){return _0x3ec561['indexOf'](']')>-0x1;})[_0xf2da('0xb')](function(_0x8b3d48){return _0x8b3d48[_0xf2da('0x5')](']')[0x0];})[0x0];_0x37c49b[_0xf2da('0xc')][_0xf2da('0xd')]({'field':_0x4a3411,'operator':_0xf0a3d0,'value':_0x2b04e4});});});}return _0x37c49b;};exports[_0xf2da('0xe')]=function(_0x428acc,_0x4290bd,_0x380399){var _0x4fb71b={};if(_0x4290bd===_0xf2da('0xf')){if(_0x380399[_0xf2da('0x10')]===_0xf2da('0x11')){_0x380399['operator']=_0xf2da('0x12');_0x380399['value']+=','+_0x380399[_0xf2da('0x13')];}else if(_[_0xf2da('0x14')]([_0xf2da('0x15'),'$lte'],_0x380399[_0xf2da('0x10')])){_0x380399[_0xf2da('0x13')]=moment(_0x380399[_0xf2da('0x13')])[_0xf2da('0x16')](0x1,_0xf2da('0x17'))['format'](_0xf2da('0x18'));}}if(_0x380399[_0xf2da('0x19')]){_0x4290bd=_0x380399[_0xf2da('0x19')];_0x4fb71b[_0xf2da('0x1a')]=_0xf2da('0x1b')+_0x428acc+'.'+_0x380399[_0xf2da('0x1c')]+_0xf2da('0x1d')+_0x380399['castTo']+')\x20'+parseOperator(_0x380399['operator']);}else{_0x4fb71b[_0xf2da('0x1a')]=_0x428acc+'.'+_0x380399[_0xf2da('0x1c')]+'\x20'+parseOperator(_0x380399[_0xf2da('0x10')]);}if(_[_0xf2da('0x14')]([_0xf2da('0x1e'),'$notIn'],_0x380399[_0xf2da('0x10')]))_0x4fb71b[_0xf2da('0x1a')]='('+_0x4fb71b[_0xf2da('0x1a')]+_0xf2da('0x1f')+_0x428acc+'.'+_0x380399[_0xf2da('0x1c')]+'\x20IS\x20NULL)';_0x4fb71b['value']=parseValue(_0x4290bd,_0x380399[_0xf2da('0x10')],_0x380399[_0xf2da('0x13')]);return _0x4fb71b;};function parseOperator(_0x577483){var _0x8098db;switch(_0x577483){case'$in':_0x8098db=_0xf2da('0x20');break;case _0xf2da('0x21'):_0x8098db=_0xf2da('0x22');break;case _0xf2da('0x11'):_0x8098db=_0xf2da('0x23');break;case'$ne':_0x8098db=_0xf2da('0x24');break;case _0xf2da('0x25'):case'$startsWith':case _0xf2da('0x26'):_0x8098db=_0xf2da('0x27');break;case _0xf2da('0x28'):_0x8098db=_0xf2da('0x29');break;case _0xf2da('0x15'):_0x8098db='>\x20?';break;case'$lte':_0x8098db=_0xf2da('0x2a');break;case'$gte':_0x8098db=_0xf2da('0x2b');break;case'$between':_0x8098db=_0xf2da('0x2c');break;}return _0x8098db;}function parseValue(_0x546650,_0x427227,_0x124a5e){var _0x3d3146={'start':undefined,'end':undefined};switch(_0x427227){case _0xf2da('0x2d'):case _0xf2da('0x21'):_0x3d3146[_0xf2da('0x2e')]=_0x124a5e[_0xf2da('0x5')](',');break;case'$substring':_0x3d3146[_0xf2da('0x2e')]='%'+_0x124a5e+'%';break;case'$startsWith':_0x3d3146[_0xf2da('0x2e')]=_0x124a5e+'%';break;case _0xf2da('0x26'):_0x3d3146[_0xf2da('0x2e')]='%'+_0x124a5e;break;case _0xf2da('0x12'):var _0x59939a=_0x124a5e[_0xf2da('0x5')](',');var _0x124a5e=_0x59939a[_0xf2da('0x9')]();var _0x14259f=_0x59939a['pop']();if(_0x546650===_0xf2da('0xf')){_0x124a5e=moment(_0x124a5e)[_0xf2da('0x2f')](0x0,!![])[_0xf2da('0x30')]();_0x14259f=moment(_0x14259f)[_0xf2da('0x2f')](0x0,!![])[_0xf2da('0x16')](0x17,_0xf2da('0x31'))[_0xf2da('0x16')](0x3b,_0xf2da('0x32'))['add'](0x3b,_0xf2da('0x33'))[_0xf2da('0x30')]();}_0x3d3146={'start':_0x124a5e,'end':_0x14259f};break;default:_0x3d3146[_0xf2da('0x2e')]=_0x124a5e;break;}return _0x3d3146;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 034b099..7ae8085 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 _0x2d17=['indexOf','unsigned','substr','priority','cast','col','length','omit','unset','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','query','$id','model','name','keys','intersection','attributes','hasOwnProperty','offset','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','sort','map'];(function(_0x5ea3c7,_0x13653c){var _0x55d17e=function(_0x4af1a){while(--_0x4af1a){_0x5ea3c7['push'](_0x5ea3c7['shift']());}};_0x55d17e(++_0x13653c);}(_0x2d17,0x17e));var _0x72d1=function(_0x484283,_0x43d088){_0x484283=_0x484283-0x0;var _0x4c6e17=_0x2d17[_0x484283];return _0x4c6e17;};'use strict';var _=require(_0x72d1('0x0'));var sequelize=require(_0x72d1('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x12f23c){var _0x4727f9=['ne'];try{var _0x531f4e=JSON[_0x72d1('0x2')](_0x12f23c);var _0x38fec7=Object['keys'](_0x531f4e)[0x0];return _0x4727f9[_0x72d1('0x3')](_0x38fec7);}catch(_0x4dfee1){return![];}}function getOperatorValue(_0x39150f){var _0x50f551=JSON[_0x72d1('0x2')](_0x39150f);var _0x239d1f=Object['keys'](_0x50f551)[0x0];var _0x477264=_0x50f551[_0x239d1f];return{['$'+_0x239d1f]:_0x477264};}exports[_0x72d1('0x4')]=function(_0x19e248){var _0x4e7f3e=null;if(_0x19e248){_0x4e7f3e=_0x19e248[_0x72d1('0x5')](',');}return _0x4e7f3e;};exports[_0x72d1('0x6')]=function(_0x283775,_0x593c91){var _0x1d7520={};if(!_[_0x72d1('0x7')](_0x283775)){_[_0x72d1('0x8')](_0x283775,function(_0x14a41e,_0x3cb9c2){try{if(_0x593c91){var _0x3916f2=_[_0x72d1('0x9')](_0x593c91,{'name':_0x3cb9c2})||{};if(hasSequelizeOperator(_0x14a41e)){_0x1d7520[_0x3cb9c2]=getOperatorValue(_0x14a41e);}else if(_0x3916f2[_0x72d1('0xa')]===_0x72d1('0xb')&&_[_0x72d1('0xc')](_0x14a41e)){var _0x5ad4df=JSON[_0x72d1('0x2')](_0x14a41e);var _0x37017c={'$gte':moment(moment(_0x5ad4df[_0x72d1('0xd')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0xe')](),'$lte':moment(moment(_0x5ad4df[_0x72d1('0x11')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0x12')](0x1,'s')[_0x72d1('0xe')]()};_0x1d7520[_0x3cb9c2]=_0x37017c;}else if(_0x3916f2['name']===_0x72d1('0x13')){_0x1d7520[_0x3cb9c2]=_0x14a41e;}else{_0x1d7520[_0x3cb9c2]=_['isArray'](_0x14a41e)?_0x14a41e:JSON[_0x72d1('0x2')](_0x14a41e);}}else{_0x1d7520[_0x3cb9c2]=_[_0x72d1('0x14')](_0x14a41e)?_0x14a41e:JSON['parse'](_0x14a41e);}}catch(_0x1061b7){_0x1d7520[_0x3cb9c2]=_0x14a41e[_0x72d1('0x5')](',');}});}return _0x1d7520;};exports[_0x72d1('0x15')]=function(_0x49caf4){_0x49caf4=parseInt(_0x49caf4,0xa);if(!_0x49caf4||_0x49caf4<0x0){_0x49caf4=LIMIT_VALUE;}return _0x49caf4;};exports['offset']=function(_0x313d7b){_0x313d7b=parseInt(_0x313d7b,0xa);if(!_0x313d7b||_0x313d7b<0x0){_0x313d7b=0x0;}return _0x313d7b;};exports[_0x72d1('0x16')]=function(_0x2233cb){var _0x1865c1,_0x8d6890=null;if(_0x2233cb){_0x1865c1=_0x2233cb[_0x72d1('0x5')](',');_0x8d6890=_[_0x72d1('0x17')](_0x1865c1,function(_0x5c7982){if(_0x5c7982[_0x72d1('0x18')]('-')===0x0){return[_0x5c7982==='priority'?sequelize['cast'](sequelize['col']('priority'),_0x72d1('0x19')):_0x5c7982[_0x72d1('0x1a')](0x1),'DESC'];}else{return[_0x5c7982===_0x72d1('0x1b')?sequelize[_0x72d1('0x1c')](sequelize[_0x72d1('0x1d')](_0x72d1('0x1b')),_0x72d1('0x19')):_0x5c7982,'ASC'];}});}return _0x8d6890;};exports['omit']=function(_0x188eca,_0x36bc65){if(_[_0x72d1('0x7')](_0x188eca)){return _0x188eca;}if(_[_0x72d1('0x14')](_0x188eca)){for(var _0xdf6a69=0x0;_0xdf6a69<_0x188eca[_0x72d1('0x1e')];_0xdf6a69+=0x1){_0x188eca[_0xdf6a69]=this[_0x72d1('0x1f')](_0x188eca[_0xdf6a69],_0x36bc65);}return _0x188eca;}if(!_['isObject'](_0x188eca)){return _0x188eca;}if(_['isString'](_0x36bc65)){_0x36bc65=[_0x36bc65];}if(!_[_0x72d1('0x14')](_0x36bc65)){return _0x188eca;}for(var _0x482cb8=0x0;_0x482cb8<_0x36bc65[_0x72d1('0x1e')];_0x482cb8+=0x1){_[_0x72d1('0x20')](_0x188eca,_0x36bc65[_0x482cb8]);}for(var _0x2c113d in _0x188eca){if(_0x188eca['hasOwnProperty'](_0x2c113d)){_0x188eca[_0x2c113d]=this[_0x72d1('0x1f')](_0x188eca[_0x2c113d],_0x36bc65);}}return _0x188eca;};exports['isNumeric']=function(_0x707cd0){return _0x707cd0[_0x72d1('0x21')](RegExp(_0x72d1('0x22')))?!![]:![];};exports[_0x72d1('0x23')]=function(_0x51242b){return _0x51242b[_0x72d1('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42c03c){var _0x32dc5e=[];_0x42c03c['split'](/[ ,]+/)[_0x72d1('0x24')](function(_0x358b0c){_0x358b0c=_0x358b0c[_0x72d1('0x25')](/([^:]")"+/g,'$1');_0x358b0c='+'+_0x358b0c+'*';var _0x11ea2f=/[ `!@#$%^&*()_\-?~]/;if(_0x358b0c[_0x72d1('0x21')](_0x11ea2f))_0x358b0c='\x22'+_0x358b0c+'\x22';_0x32dc5e['push'](_0x358b0c);});return _0x32dc5e[_0x72d1('0x26')]('\x20');};exports[_0x72d1('0x27')]=function(_0x9efc2f,_0x482033,_0x244f4a){var _0x14669a={},_0x4a2909={};if(_0x482033[_0x72d1('0x28')][_0x72d1('0x29')]){_0x482033[_0x72d1('0x28')]['id']=_0x482033['query'][_0x72d1('0x29')];delete _0x482033['query'][_0x72d1('0x29')];}_0x14669a[_0x72d1('0x2a')]=_[_0x72d1('0x17')](_0x9efc2f,_0x72d1('0x2b'));_0x14669a[_0x72d1('0x28')]=_[_0x72d1('0x2c')](_0x482033[_0x72d1('0x28')]);_0x14669a[_0x72d1('0x6')]=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],_0x14669a[_0x72d1('0x28')]);_0x4a2909['attributes']=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],this[_0x72d1('0x4')](_0x482033[_0x72d1('0x28')]['fields']));_0x4a2909[_0x72d1('0x2e')]=_0x4a2909[_0x72d1('0x2e')][_0x72d1('0x1e')]?_0x4a2909['attributes']:_0x14669a[_0x72d1('0x2a')];if(!_0x482033[_0x72d1('0x28')][_0x72d1('0x2f')]('nolimit')){_0x4a2909[_0x72d1('0x15')]=this[_0x72d1('0x15')](_0x482033[_0x72d1('0x28')]['limit']);_0x4a2909[_0x72d1('0x30')]=this[_0x72d1('0x30')](_0x482033[_0x72d1('0x28')][_0x72d1('0x30')]);}_0x4a2909[_0x72d1('0x31')]=this[_0x72d1('0x16')](_0x482033[_0x72d1('0x28')]['sort']);_0x4a2909[_0x72d1('0x32')]=this[_0x72d1('0x6')](_[_0x72d1('0x33')](_0x482033[_0x72d1('0x28')],_0x14669a[_0x72d1('0x6')]),_0x9efc2f);if(_0x482033[_0x72d1('0x28')][_0x72d1('0x34')]){var _0x1d4fdf=_0x9efc2f;var _0x55438b=_0x482033[_0x72d1('0x28')][_0x72d1('0x34')];if(typeof _0x55438b===_0x72d1('0x35')){_0x1d4fdf=_[_0x72d1('0x34')](_0x9efc2f,function(_0x45870b){return _[_0x72d1('0x3')](_0x55438b[_0x72d1('0x36')],_0x45870b[_0x72d1('0x2b')]);});_0x55438b=_0x55438b['value'];}_0x4a2909['where']=_[_0x72d1('0x37')](_0x4a2909[_0x72d1('0x32')],{'$or':_[_0x72d1('0x17')](_0x1d4fdf,function(_0x21d361){if(_0x21d361['type']!==_0x72d1('0x38')){if(_0x244f4a){return sequelize[_0x72d1('0x32')](sequelize['fn']('lower',sequelize[_0x72d1('0x1d')](_0x21d361['name'])),{'$like':sequelize['fn'](_0x72d1('0x39'),'%'+_0x482033[_0x72d1('0x28')]['filter']+'%')});}else{var _0x37c69a={};_0x37c69a[_0x21d361['name']]={'$like':'%'+_0x482033['query']['filter']+'%'};return _0x37c69a;}}})});}_0x4a2909=_[_0x72d1('0x37')]({},_0x4a2909,_0x482033['options']);return _0x4a2909;}; \ No newline at end of file +var _0x277c=['DATE','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','isEmpty','length','omit','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','$id','query','model','attributes','nolimit','pick','filter','object','columns','type','VIRTUAL','where','lower','merge','options','lodash','moment','parse','keys','includes','fields','split','filters','find'];(function(_0x562cce,_0x211c13){var _0x48e157=function(_0x26f94b){while(--_0x26f94b){_0x562cce['push'](_0x562cce['shift']());}};_0x48e157(++_0x211c13);}(_0x277c,0x153));var _0xc277=function(_0x56b81f,_0x414d72){_0x56b81f=_0x56b81f-0x0;var _0x5a97b4=_0x277c[_0x56b81f];return _0x5a97b4;};'use strict';var _=require(_0xc277('0x0'));var sequelize=require('sequelize');var moment=require(_0xc277('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3420cf){var _0x3cd265=['ne'];try{var _0x21d6f2=JSON[_0xc277('0x2')](_0x3420cf);var _0x1fcae3=Object[_0xc277('0x3')](_0x21d6f2)[0x0];return _0x3cd265[_0xc277('0x4')](_0x1fcae3);}catch(_0x4f78ab){return![];}}function getOperatorValue(_0x4bfaeb){var _0x1a6582=JSON['parse'](_0x4bfaeb);var _0x77e168=Object['keys'](_0x1a6582)[0x0];var _0x378158=_0x1a6582[_0x77e168];return{['$'+_0x77e168]:_0x378158};}exports[_0xc277('0x5')]=function(_0x55be1f){var _0x324ef7=null;if(_0x55be1f){_0x324ef7=_0x55be1f[_0xc277('0x6')](',');}return _0x324ef7;};exports[_0xc277('0x7')]=function(_0x1b1db0,_0x3f766f){var _0x1e4087={};if(!_['isEmpty'](_0x1b1db0)){_['forOwn'](_0x1b1db0,function(_0x30a5dc,_0x1632bb){try{if(_0x3f766f){var _0x2df373=_[_0xc277('0x8')](_0x3f766f,{'name':_0x1632bb})||{};if(hasSequelizeOperator(_0x30a5dc)){_0x1e4087[_0x1632bb]=getOperatorValue(_0x30a5dc);}else if(_0x2df373['type']===_0xc277('0x9')&&_['isPlainObject'](_0x30a5dc)){var _0xb6b933=JSON[_0xc277('0x2')](_0x30a5dc);var _0x1850eb={'$gte':moment(moment(_0xb6b933[_0xc277('0xa')])['format'](_0xc277('0xb')))[_0xc277('0xc')]()[_0xc277('0xd')](),'$lte':moment(moment(_0xb6b933['$lte'])['format'](_0xc277('0xb')))['utc']()[_0xc277('0xe')](0x1,'s')['format']()};_0x1e4087[_0x1632bb]=_0x1850eb;}else if(_0x2df373[_0xc277('0xf')]===_0xc277('0x10')){_0x1e4087[_0x1632bb]=_0x30a5dc;}else{_0x1e4087[_0x1632bb]=_[_0xc277('0x11')](_0x30a5dc)?_0x30a5dc:JSON['parse'](_0x30a5dc);}}else{_0x1e4087[_0x1632bb]=_['isArray'](_0x30a5dc)?_0x30a5dc:JSON[_0xc277('0x2')](_0x30a5dc);}}catch(_0x4d23a7){_0x1e4087[_0x1632bb]=_0x30a5dc['split'](',');}});}return _0x1e4087;};exports[_0xc277('0x12')]=function(_0xba31f6){_0xba31f6=parseInt(_0xba31f6,0xa);if(!_0xba31f6||_0xba31f6<0x0){_0xba31f6=LIMIT_VALUE;}return _0xba31f6;};exports[_0xc277('0x13')]=function(_0x176dfb){_0x176dfb=parseInt(_0x176dfb,0xa);if(!_0x176dfb||_0x176dfb<0x0){_0x176dfb=0x0;}return _0x176dfb;};exports[_0xc277('0x14')]=function(_0x355eee){var _0x391cc3,_0x4a7a79=null;if(_0x355eee){_0x391cc3=_0x355eee['split'](',');_0x4a7a79=_[_0xc277('0x15')](_0x391cc3,function(_0x28900e){if(_0x28900e[_0xc277('0x16')]('-')===0x0){return[_0x28900e===_0xc277('0x17')?sequelize[_0xc277('0x18')](sequelize[_0xc277('0x19')](_0xc277('0x17')),_0xc277('0x1a')):_0x28900e[_0xc277('0x1b')](0x1),_0xc277('0x1c')];}else{return[_0x28900e===_0xc277('0x17')?sequelize['cast'](sequelize[_0xc277('0x19')](_0xc277('0x17')),'unsigned'):_0x28900e,_0xc277('0x1d')];}});}return _0x4a7a79;};exports['omit']=function(_0x48124d,_0x3292ab){if(_[_0xc277('0x1e')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x11')](_0x48124d)){for(var _0x436784=0x0;_0x436784<_0x48124d[_0xc277('0x1f')];_0x436784+=0x1){_0x48124d[_0x436784]=this[_0xc277('0x20')](_0x48124d[_0x436784],_0x3292ab);}return _0x48124d;}if(!_[_0xc277('0x21')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x22')](_0x3292ab)){_0x3292ab=[_0x3292ab];}if(!_[_0xc277('0x11')](_0x3292ab)){return _0x48124d;}for(var _0x3e04cb=0x0;_0x3e04cb<_0x3292ab[_0xc277('0x1f')];_0x3e04cb+=0x1){_['unset'](_0x48124d,_0x3292ab[_0x3e04cb]);}for(var _0x5f3933 in _0x48124d){if(_0x48124d[_0xc277('0x23')](_0x5f3933)){_0x48124d[_0x5f3933]=this[_0xc277('0x20')](_0x48124d[_0x5f3933],_0x3292ab);}}return _0x48124d;};exports['isNumeric']=function(_0x4efc1e){return _0x4efc1e[_0xc277('0x24')](RegExp(_0xc277('0x25')))?!![]:![];};exports[_0xc277('0x26')]=function(_0x21c78c){return _0x21c78c[_0xc277('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43757c){var _0x5edf7e=[];_0x43757c[_0xc277('0x6')](/[ ,]+/)[_0xc277('0x27')](function(_0x4348d9){_0x4348d9=_0x4348d9[_0xc277('0x28')](/([^:]")"+/g,'$1');_0x4348d9='+'+_0x4348d9+'*';var _0x5e9f22=/[ `!@#$%^&*()_\-?~]/;if(_0x4348d9[_0xc277('0x24')](_0x5e9f22))_0x4348d9='\x22'+_0x4348d9+'\x22';_0x5edf7e['push'](_0x4348d9);});return _0x5edf7e[_0xc277('0x29')]('\x20');};exports[_0xc277('0x2a')]=function(_0xbc1a66,_0x3591ab,_0x4f1603){var _0x278e56={},_0x3a7294={};if(_0x3591ab['query'][_0xc277('0x2b')]){_0x3591ab['query']['id']=_0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];delete _0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];}_0x278e56[_0xc277('0x2d')]=_[_0xc277('0x15')](_0xbc1a66,_0xc277('0xf'));_0x278e56[_0xc277('0x2c')]=_[_0xc277('0x3')](_0x3591ab[_0xc277('0x2c')]);_0x278e56[_0xc277('0x7')]=_['intersection'](_0x278e56[_0xc277('0x2d')],_0x278e56[_0xc277('0x2c')]);_0x3a7294[_0xc277('0x2e')]=_['intersection'](_0x278e56[_0xc277('0x2d')],this[_0xc277('0x5')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x5')]));_0x3a7294[_0xc277('0x2e')]=_0x3a7294['attributes']['length']?_0x3a7294[_0xc277('0x2e')]:_0x278e56['model'];if(!_0x3591ab[_0xc277('0x2c')][_0xc277('0x23')](_0xc277('0x2f'))){_0x3a7294[_0xc277('0x12')]=this[_0xc277('0x12')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x12')]);_0x3a7294[_0xc277('0x13')]=this[_0xc277('0x13')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x13')]);}_0x3a7294['order']=this[_0xc277('0x14')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x14')]);_0x3a7294['where']=this[_0xc277('0x7')](_[_0xc277('0x30')](_0x3591ab['query'],_0x278e56['filters']),_0xbc1a66);if(_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')]){var _0x22c5b3=_0xbc1a66;var _0x1ca33a=_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')];if(typeof _0x1ca33a===_0xc277('0x32')){_0x22c5b3=_['filter'](_0xbc1a66,function(_0x2561dd){return _[_0xc277('0x4')](_0x1ca33a[_0xc277('0x33')],_0x2561dd['name']);});_0x1ca33a=_0x1ca33a['value'];}_0x3a7294['where']=_['merge'](_0x3a7294['where'],{'$or':_[_0xc277('0x15')](_0x22c5b3,function(_0x4a26e3){if(_0x4a26e3[_0xc277('0x34')]!==_0xc277('0x35')){if(_0x4f1603){return sequelize[_0xc277('0x36')](sequelize['fn']('lower',sequelize[_0xc277('0x19')](_0x4a26e3[_0xc277('0xf')])),{'$like':sequelize['fn'](_0xc277('0x37'),'%'+_0x3591ab[_0xc277('0x2c')]['filter']+'%')});}else{var _0x284630={};_0x284630[_0x4a26e3[_0xc277('0xf')]]={'$like':'%'+_0x3591ab['query'][_0xc277('0x31')]+'%'};return _0x284630;}}})});}_0x3a7294=_[_0xc277('0x38')]({},_0x3a7294,_0x3591ab[_0xc277('0x39')]);return _0x3a7294;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index b09c2e3..46e28e0 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x83eb3b,_0x3c7335){var _0x45b45a=function(_0x3da44f){while(--_0x3da44f){_0x83eb3b['push'](_0x83eb3b['shift']());}};_0x45b45a(++_0x3c7335);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 27426f7..1bf497b 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 _0x8083=['hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8'];(function(_0x54ea33,_0x3c52ed){var _0x13ace3=function(_0x37d4ba){while(--_0x37d4ba){_0x54ea33['push'](_0x54ea33['shift']());}};_0x13ace3(++_0x3c52ed);}(_0x8083,0x175));var _0x3808=function(_0xaf52f9,_0x3608bc){_0xaf52f9=_0xaf52f9-0x0;var _0xd9e03e=_0x8083[_0xaf52f9];return _0xd9e03e;};'use strict';var _=require(_0x3808('0x0'));var os=require('os');var crypto=require(_0x3808('0x1'));var machine=require(_0x3808('0x2'));var exec=require(_0x3808('0x3'))[_0x3808('0x4')];var config=require(_0x3808('0x5'));function getInterfaces(){var _0x1fc333=[];var _0x414f9d=os[_0x3808('0x6')]();var _0x49fc60=_[_0x3808('0x7')](_[_0x3808('0x8')](_0x414f9d));for(var _0x338029=0x0;_0x338029<_0x49fc60['length'];_0x338029++){var _0x39e60a=_0x414f9d[_0x49fc60[_0x338029]][_0x3808('0x9')](function(_0x48ddc9){return _0x48ddc9[_0x3808('0xa')]===_0x3808('0xb')&&_0x48ddc9[_0x3808('0xc')]===![];});_0x1fc333=_0x1fc333['concat'](_0x39e60a);}return _0x1fc333;}function getFirstInterface(){var _0x17bc2f=_[_0x3808('0xd')](getInterfaces());return{'macAddress':_0x17bc2f&&_0x17bc2f[_0x3808('0xe')]?_0x17bc2f[_0x3808('0xe')]:_0x3808('0xf'),'ipAddress':_0x17bc2f&&_0x17bc2f[_0x3808('0x10')]?_0x17bc2f[_0x3808('0x10')]:_0x3808('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x581d74=_[_0x3808('0x7')](os[_0x3808('0x12')]()[_0x3808('0x13')](function(_0x5ad23c){return _0x5ad23c[_0x3808('0x14')];}))[_0x3808('0x15')](':');return crypto[_0x3808('0x16')](_0x3808('0x17'))[_0x3808('0x18')](_0x581d74)[_0x3808('0x19')](_0x3808('0x1a'));}exports[_0x3808('0x1b')]=function(){var _0xe90271=os[_0x3808('0x1c')]();var _0x1e16f1=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x1e16f1[_0x3808('0x1d')](config[_0x3808('0x1e')])){return config['licenseToken'];}else if(_0xe90271===_0x3808('0x1f')){return exec(_0x3808('0x20'),{'encoding':_0x3808('0x21')})['replace']('\x0d\x0a','');}else{var _0x5261c8=getFirstInterface();var _0x5a4846=getCPUhash();var _0x540981=_0x5a4846+'|'+os[_0x3808('0x22')]()+'|'+_0x5261c8['macAddress']+'|'+_0x5261c8[_0x3808('0x23')];var _0xea4494=crypto['createHash'](_0x3808('0x17'))[_0x3808('0x18')](_0x540981)['digest']('hex');return _0xea4494[_0x3808('0x24')](0x0,0x8)+'-'+_0xea4494[_0x3808('0x24')](0x8,0xc)+'-'+_0xea4494[_0x3808('0x24')](0xc,0x10)+'-'+_0xea4494[_0x3808('0x24')](0x10,0x14)+'-'+_0xea4494[_0x3808('0x24')](0x14);}}; \ No newline at end of file +var _0x8994=['cpus','map','model','join','digest','hex','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','keys','length','filter','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','orderBy'];(function(_0x2f3d1d,_0x28129e){var _0x89c489=function(_0x25b497){while(--_0x25b497){_0x2f3d1d['push'](_0x2f3d1d['shift']());}};_0x89c489(++_0x28129e);}(_0x8994,0xa2));var _0x4899=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8994[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x4899('0x0'));var os=require('os');var crypto=require(_0x4899('0x1'));var machine=require(_0x4899('0x2'));var exec=require(_0x4899('0x3'))[_0x4899('0x4')];var config=require(_0x4899('0x5'));function getInterfaces(){var _0x39e316=[];var _0x1d477a=os['networkInterfaces']();var _0xab8f9a=_['orderBy'](_[_0x4899('0x6')](_0x1d477a));for(var _0x31e880=0x0;_0x31e880<_0xab8f9a[_0x4899('0x7')];_0x31e880++){var _0x5c4805=_0x1d477a[_0xab8f9a[_0x31e880]][_0x4899('0x8')](function(_0x285dc8){return _0x285dc8[_0x4899('0x9')]===_0x4899('0xa')&&_0x285dc8[_0x4899('0xb')]===![];});_0x39e316=_0x39e316['concat'](_0x5c4805);}return _0x39e316;}function getFirstInterface(){var _0x4c62e2=_[_0x4899('0xc')](getInterfaces());return{'macAddress':_0x4c62e2&&_0x4c62e2[_0x4899('0xd')]?_0x4c62e2[_0x4899('0xd')]:'00:00:00:00:00:00','ipAddress':_0x4c62e2&&_0x4c62e2['address']?_0x4c62e2[_0x4899('0xe')]:_0x4899('0xf')};}exports[_0x4899('0x10')]=getFirstInterface;function getCPUhash(){var _0x44b5cb=_[_0x4899('0x11')](os[_0x4899('0x12')]()[_0x4899('0x13')](function(_0x2d4e2a){return _0x2d4e2a[_0x4899('0x14')];}))[_0x4899('0x15')](':');return crypto['createHash']('md5')['update'](_0x44b5cb)[_0x4899('0x16')](_0x4899('0x17'));}exports['getUuid']=function(){var _0x2f5062=os[_0x4899('0x18')]();var _0x5243a9=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x5243a9[_0x4899('0x19')](config[_0x4899('0x1a')])){return config[_0x4899('0x1a')];}else if(_0x2f5062===_0x4899('0x1b')){return exec(_0x4899('0x1c'),{'encoding':_0x4899('0x1d')})[_0x4899('0x1e')]('\x0d\x0a','');}else{var _0x8464c1=getFirstInterface();var _0xe8b644=getCPUhash();var _0x35c05b=_0xe8b644+'|'+os[_0x4899('0x1f')]()+'|'+_0x8464c1[_0x4899('0x20')]+'|'+_0x8464c1[_0x4899('0x21')];var _0x59666e=crypto['createHash']('md5')[_0x4899('0x22')](_0x35c05b)['digest']('hex');return _0x59666e['substring'](0x0,0x8)+'-'+_0x59666e[_0x4899('0x23')](0x8,0xc)+'-'+_0x59666e[_0x4899('0x23')](0xc,0x10)+'-'+_0x59666e[_0x4899('0x23')](0x10,0x14)+'-'+_0x59666e['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2925785..9bd7d1e 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 _0xdc92=['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','encryptString','days','YYYY-MM-DD\x20HH:mm','catch','error','message','finally','License','findOrCreate','spread','default','util','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','data2','active'];(function(_0xa70250,_0x191c5a){var _0x39e704=function(_0x19c7ce){while(--_0x19c7ce){_0xa70250['push'](_0xa70250['shift']());}};_0x39e704(++_0x191c5a);}(_0xdc92,0x1b6));var _0x2dc9=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xdc92[_0x2431d6];return _0x4d0f9b;};'use strict';var util=require(_0x2dc9('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x2dc9('0x1'));var pkginfo=require(_0x2dc9('0x2'))(module,'version');var db=require(_0x2dc9('0x3'))['db'];var encryptor=require(_0x2dc9('0x4'));var hardware=require(_0x2dc9('0x5'));var logger=require(_0x2dc9('0x6'))(_0x2dc9('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3a3c68){return new BPromise(function(_0x219448,_0x5d8b20){var _0x246ff3=util['format'](_0x2dc9('0x8'),HOST,_0x3a3c68,module[_0x2dc9('0x9')][_0x2dc9('0xa')]);if(oldToken){_0x246ff3=util[_0x2dc9('0xb')](_0x2dc9('0xc'),HOST,_0x3a3c68,module[_0x2dc9('0x9')]['version'],oldToken);}var _0x3d59c5={'uri':_0x246ff3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3d59c5)[_0x2dc9('0xd')](function(_0x271124){_0x219448(_0x271124);})['catch'](function(_0x35cf5c){_0x5d8b20(_0x35cf5c);});});}function manageLicense(_0x5ec8e1,_0x31fc70){var _0x2878c5=_0x31fc70[_0x2dc9('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2878c5[_0x2dc9('0xf')]!==_0x5ec8e1&&!_0x2878c5[_0x2dc9('0x10')]){oldToken=_0x2878c5[_0x2dc9('0xf')];}httpRequest(_0x5ec8e1)[_0x2dc9('0xd')](function(_0x6d9ec9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x6d9ec9[_0x2dc9('0x11')]){isOldTokenSent=![];if(!_0x2878c5['license']&&_0x2878c5[_0x2dc9('0x7')]!=_0x6d9ec9[_0x2dc9('0x7')]||_0x2878c5[_0x2dc9('0x7')]&&_0x2878c5[_0x2dc9('0x10')]){logger[_0x2dc9('0x12')](_0x2dc9('0x13'));}if(_0x2878c5['license']&&!_0x2878c5[_0x2dc9('0x10')]&&_0x2878c5['license']!=_0x6d9ec9['license']){logger[_0x2dc9('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2878c5[_0x2dc9('0x7')]&&!_0x2878c5['data2']&&_0x2878c5[_0x2dc9('0x7')]==_0x6d9ec9[_0x2dc9('0x7')]){return _0x31fc70;}return _0x31fc70[_0x2dc9('0x14')]({'data1':_0x5ec8e1,'data2':null,'license':_0x6d9ec9[_0x2dc9('0x7')]});}else{if(_0x6d9ec9[_0x2dc9('0x7')]||_0x2878c5[_0x2dc9('0x7')]){if(!_0x2878c5[_0x2dc9('0x10')]){if(_0x2878c5[_0x2dc9('0xf')]==_0x5ec8e1){GRAY_PERIOD_REASON=_0x2dc9('0x15');logger[_0x2dc9('0x12')](_0x2dc9('0x16'));}else{GRAY_PERIOD_REASON=_0x2dc9('0x17');logger['info'](_0x2dc9('0x18'),_0x2878c5['data1'],_0x5ec8e1);}logger['info'](_0x2dc9('0x19'),GRAY_PERIOD_REASON[_0x2dc9('0x1a')](),moment()[_0x2dc9('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x31fc70['update']({'data2':encryptor[_0x2dc9('0x1b')](moment()[_0x2dc9('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x2878c5[_0x2dc9('0x10')]),_0x2dc9('0x1c'))>DAYS){logger[_0x2dc9('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2dc9('0xb')](_0x2dc9('0x1d')));isOldTokenSent=![];return _0x31fc70['update']({'data1':_0x5ec8e1,'data2':null,'license':null});}}}else{if(_0x2878c5[_0x2dc9('0xf')]!=_0x5ec8e1){logger[_0x2dc9('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2878c5[_0x2dc9('0xf')],_0x5ec8e1);return _0x31fc70[_0x2dc9('0x14')]({'data1':_0x5ec8e1,'data2':null,'license':null});}}}return _0x31fc70;})[_0x2dc9('0xd')](function(_0x1dd16a){_0x31fc70=_0x1dd16a;})[_0x2dc9('0x1e')](function(_0x1f6bb9){logger[_0x2dc9('0x1f')](_0x1f6bb9[_0x2dc9('0x20')]);})[_0x2dc9('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x31fc70);},TIME);});}function defaultLicense(){var _0x2c76af=hardware['getUuid']();if(_0x2c76af){return db[_0x2dc9('0x22')][_0x2dc9('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x2c76af}})[_0x2dc9('0x24')](function(_0x5259ad,_0x502acc){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2c76af);manageLicense(_0x2c76af,_0x5259ad);})[_0x2dc9('0x1e')](function(_0x300205){logger[_0x2dc9('0x1f')](_0x300205[_0x2dc9('0x20')]);});}}exports[_0x2dc9('0x25')]=defaultLicense; \ No newline at end of file +var _0xada4=['YYYY-MM-DD\x20HH:mm','diff','decryptString','days','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x19711b,_0x1b7be4){var _0x411f7b=function(_0x28585f){while(--_0x28585f){_0x19711b['push'](_0x19711b['shift']());}};_0x411f7b(++_0x1b7be4);}(_0xada4,0x174));var _0x4ada=function(_0xdf6b0a,_0x2fcda0){_0xdf6b0a=_0xdf6b0a-0x0;var _0x3c61f5=_0xada4[_0xdf6b0a];return _0x3c61f5;};'use strict';var util=require(_0x4ada('0x0'));var moment=require('moment');var rp=require(_0x4ada('0x1'));var BPromise=require(_0x4ada('0x2'));var pkginfo=require(_0x4ada('0x3'))(module,_0x4ada('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x4ada('0x5'));var hardware=require(_0x4ada('0x6'));var logger=require('../logger')(_0x4ada('0x7'));var HOST=_0x4ada('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45e586){return new BPromise(function(_0x372ca0,_0x2d3b8b){var _0x190bd9=util[_0x4ada('0x9')](_0x4ada('0xa'),HOST,_0x45e586,module['exports'][_0x4ada('0x4')]);if(oldToken){_0x190bd9=util[_0x4ada('0x9')](_0x4ada('0xb'),HOST,_0x45e586,module[_0x4ada('0xc')][_0x4ada('0x4')],oldToken);}var _0x4ed170={'uri':_0x190bd9,'method':_0x4ada('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4ed170)[_0x4ada('0xe')](function(_0x26efb7){_0x372ca0(_0x26efb7);})[_0x4ada('0xf')](function(_0x1892d8){_0x2d3b8b(_0x1892d8);});});}function manageLicense(_0x58683a,_0x4904f2){var _0x42cd36=_0x4904f2[_0x4ada('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x42cd36[_0x4ada('0x11')]!==_0x58683a&&!_0x42cd36[_0x4ada('0x12')]){oldToken=_0x42cd36[_0x4ada('0x11')];}httpRequest(_0x58683a)[_0x4ada('0xe')](function(_0x4be86a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4be86a[_0x4ada('0x13')]){isOldTokenSent=![];if(!_0x42cd36['license']&&_0x42cd36['license']!=_0x4be86a[_0x4ada('0x7')]||_0x42cd36['license']&&_0x42cd36[_0x4ada('0x12')]){logger['info'](_0x4ada('0x14'));}if(_0x42cd36[_0x4ada('0x7')]&&!_0x42cd36['data2']&&_0x42cd36[_0x4ada('0x7')]!=_0x4be86a[_0x4ada('0x7')]){logger['info'](_0x4ada('0x15'));}if(_0x42cd36[_0x4ada('0x7')]&&!_0x42cd36[_0x4ada('0x12')]&&_0x42cd36[_0x4ada('0x7')]==_0x4be86a[_0x4ada('0x7')]){return _0x4904f2;}return _0x4904f2[_0x4ada('0x16')]({'data1':_0x58683a,'data2':null,'license':_0x4be86a[_0x4ada('0x7')]});}else{if(_0x4be86a[_0x4ada('0x7')]||_0x42cd36[_0x4ada('0x7')]){if(!_0x42cd36['data2']){if(_0x42cd36['data1']==_0x58683a){GRAY_PERIOD_REASON=_0x4ada('0x17');logger[_0x4ada('0x18')](_0x4ada('0x19'));}else{GRAY_PERIOD_REASON=_0x4ada('0x1a');logger[_0x4ada('0x18')](_0x4ada('0x1b'),_0x42cd36['data1'],_0x58683a);}logger[_0x4ada('0x18')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x4ada('0x9')](_0x4ada('0x1c')));return _0x4904f2['update']({'data2':encryptor['encryptString'](moment()[_0x4ada('0x9')](_0x4ada('0x1c')))});}else{if(moment()[_0x4ada('0x1d')](encryptor[_0x4ada('0x1e')](_0x42cd36['data2']),_0x4ada('0x1f'))>DAYS){logger[_0x4ada('0x18')]('DEMO\x20START\x20AT\x20%s',moment()[_0x4ada('0x9')](_0x4ada('0x1c')));isOldTokenSent=![];return _0x4904f2[_0x4ada('0x16')]({'data1':_0x58683a,'data2':null,'license':null});}}}else{if(_0x42cd36[_0x4ada('0x11')]!=_0x58683a){logger[_0x4ada('0x18')](_0x4ada('0x1b'),_0x42cd36[_0x4ada('0x11')],_0x58683a);return _0x4904f2[_0x4ada('0x16')]({'data1':_0x58683a,'data2':null,'license':null});}}}return _0x4904f2;})[_0x4ada('0xe')](function(_0x1413cc){_0x4904f2=_0x1413cc;})[_0x4ada('0xf')](function(_0xea063a){logger[_0x4ada('0x20')](_0xea063a[_0x4ada('0x21')]);})[_0x4ada('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4904f2);},TIME);});}function defaultLicense(){var _0xd7b05b=hardware[_0x4ada('0x23')]();if(_0xd7b05b){return db[_0x4ada('0x24')][_0x4ada('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0xd7b05b}})[_0x4ada('0x26')](function(_0x4e2762,_0x14fd80){logger['info'](_0x4ada('0x27'),_0xd7b05b);manageLicense(_0xd7b05b,_0x4e2762);})['catch'](function(_0x462c2f){logger[_0x4ada('0x20')](_0x462c2f['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 ee7cc2f..0d53e72 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 _0xbeb9=['machineUuid','gray','deadline','days','grayReason','disabled','message','User','findAll','role','COUNT','sequelize','count','admin','user','users','telephones','forEach','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','demo'];(function(_0x4ae709,_0x5583b4){var _0x21b66d=function(_0x719d65){while(--_0x719d65){_0x4ae709['push'](_0x4ae709['shift']());}};_0x21b66d(++_0x5583b4);}(_0xbeb9,0xa1));var _0x9beb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbeb9[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x9beb('0x0'));var _=require(_0x9beb('0x1'));var moment=require(_0x9beb('0x2'));var BPromise=require(_0x9beb('0x3'));var hardware=require(_0x9beb('0x4'));var encryptor=require(_0x9beb('0x5'));var db=require(_0x9beb('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9beb('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x9beb('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9beb('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9beb('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x36d99b){return new BPromise(function(_0x343cad,_0x29d563){return db['License']['find'](_[_0x9beb('0xa')](_0x36d99b,{'raw':!![],'where':{'id':0x1}}))[_0x9beb('0xb')](function(_0x170d8e){return checkLicense(_0x170d8e,null);})['then'](function(_0x2f8a8c){_0x343cad(_0x2f8a8c);return;})[_0x9beb('0xc')](function(_0x56a6a9){_0x29d563(_0x56a6a9);});});}function checkLicense(_0x18d604,_0xddc861){if(!_0x18d604){demoLicense[_0x9beb('0xd')]=_0x18d604[_0x9beb('0xe')];return demoLicense;}try{var _0x32a9d1=_0xddc861||_0x18d604[_0x9beb('0xf')];if(_[_0x9beb('0x10')](_0x32a9d1)){throw new Error(_0x9beb('0x11'));}var _0x18977c=_0x18d604[_0x9beb('0xe')];var _0x676200=_0x18d604['data2'];var _0x361ae6=_0x18977c[_0x9beb('0x12')]('-')[0x4];var _0x354c7a=_0x18977c[_0x9beb('0x12')]('-')[0x0];var _0x46cb94=encryptor[_0x9beb('0x13')](_0x32a9d1,util[_0x9beb('0x14')](_0x9beb('0x15'),_0x361ae6,_0x18977c,_0x354c7a));var _0x2b3ced=JSON['parse'](_0x46cb94);_0x2b3ced[_0x9beb('0x16')]=![];_0x2b3ced[_0x9beb('0xd')]=_0x18977c;_0x2b3ced[_0x9beb('0x17')]=hardware[_0x9beb('0x8')]();if(_0x676200){var _0x50c214=encryptor['decryptString'](_0x676200);_0x2b3ced[_0x9beb('0x18')]=_0x50c214;_0x2b3ced[_0x9beb('0x19')]=moment(_0x50c214)['add'](0x7,_0x9beb('0x1a'))['format']();_0x2b3ced[_0x9beb('0x1b')]=_0x2b3ced['uuid']!=_0x2b3ced['machineUuid']?'changed':_0x9beb('0x1c');}return _0x2b3ced;}catch(_0x205c1e){breakingLicense[_0x9beb('0xd')]=_0x18d604[_0x9beb('0xe')];breakingLicense[_0x9beb('0x1d')]=_0x205c1e['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2133a7,_0x53c9e0){getLicense()[_0x9beb('0xb')](function(_0x2d411d){return db[_0x9beb('0x1e')][_0x9beb('0x1f')]({'attributes':[_0x9beb('0x20'),[db['sequelize']['fn'](_0x9beb('0x21'),db[_0x9beb('0x22')]['col'](_0x9beb('0x20'))),_0x9beb('0x23')]],'group':_0x9beb('0x20'),'where':{'role':{'$or':[_0x9beb('0x24'),_0x9beb('0x25'),'telephone']}},'raw':!![]})[_0x9beb('0xb')](function(_0x484cf8){var _0x5430e0={'user':_0x2d411d[_0x9beb('0x26')]||0x0,'telephone':_0x2d411d[_0x9beb('0x27')]||0x0};_0x484cf8[_0x9beb('0x28')](function(_0x379090){var _0x2a80e3=_0x379090[_0x9beb('0x20')]===_0x9beb('0x24')?_0x9beb('0x25'):_0x379090[_0x9beb('0x20')];_0x5430e0[_0x2a80e3]-=_0x379090[_0x9beb('0x23')];if(_0x5430e0[_0x2a80e3]<0x0)_0x5430e0[_0x2a80e3]=0x0;});_0x2133a7(_0x5430e0);return;});})[_0x9beb('0xc')](function(_0x208cb1){_0x53c9e0(_0x208cb1);});});}function checkUserLimits(_0x11fe2b){return new BPromise(function(_0x2ecf09,_0x8e6af3){getLimits()[_0x9beb('0xb')](function(_0x511c63){var _0x36027f=_[_0x9beb('0x29')](_[_0x9beb('0x2a')](_0x11fe2b,_0x9beb('0x20')),[_0x9beb('0x24'),'user','telephone']);var _0x564255=(_0x36027f[_0x9beb('0x24')]||0x0)+(_0x36027f[_0x9beb('0x25')]||0x0);var _0x1db174=_0x36027f[_0x9beb('0x2b')]||0x0;if(_0x564255>_0x511c63[_0x9beb('0x25')])return _0x8e6af3(_0x9beb('0x2c'));if(_0x1db174>_0x511c63['telephone'])return _0x8e6af3('License\x20limit\x20reached\x20for\x20telephones');return _0x2ecf09();})[_0x9beb('0xc')](function(_0x10a6ae){_0x8e6af3(_0x10a6ae);});});}module[_0x9beb('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xffdd=['defaults','then','catch','uuid','data1','license','data2','split','format','%s:%s:%s','parse','machineUuid','gray','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','count','admin','user','users','telephones','forEach','License\x20limit\x20reached\x20for\x20users','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license'];(function(_0x1b9edf,_0x2b240c){var _0x5071e9=function(_0x4b7c8c){while(--_0x4b7c8c){_0x1b9edf['push'](_0x1b9edf['shift']());}};_0x5071e9(++_0x2b240c);}(_0xffdd,0xc4));var _0xdffd=function(_0x42a303,_0x5642f3){_0x42a303=_0x42a303-0x0;var _0x1289e6=_0xffdd[_0x42a303];return _0x1289e6;};'use strict';var util=require(_0xdffd('0x0'));var _=require(_0xdffd('0x1'));var moment=require(_0xdffd('0x2'));var BPromise=require(_0xdffd('0x3'));var hardware=require(_0xdffd('0x4'));var encryptor=require(_0xdffd('0x5'));var db=require(_0xdffd('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdffd('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdffd('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1db580){return new BPromise(function(_0x42e1e4,_0x4023f0){return db['License']['find'](_[_0xdffd('0x9')](_0x1db580,{'raw':!![],'where':{'id':0x1}}))[_0xdffd('0xa')](function(_0x1673d3){return checkLicense(_0x1673d3,null);})[_0xdffd('0xa')](function(_0x4b98e1){_0x42e1e4(_0x4b98e1);return;})[_0xdffd('0xb')](function(_0x7bc41d){_0x4023f0(_0x7bc41d);});});}function checkLicense(_0x2ecb6d,_0x72bd46){if(!_0x2ecb6d){demoLicense[_0xdffd('0xc')]=_0x2ecb6d[_0xdffd('0xd')];return demoLicense;}try{var _0x4b1d1c=_0x72bd46||_0x2ecb6d[_0xdffd('0xe')];if(_['isEmpty'](_0x4b1d1c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3f7299=_0x2ecb6d[_0xdffd('0xd')];var _0x7e46a1=_0x2ecb6d[_0xdffd('0xf')];var _0x1489df=_0x3f7299[_0xdffd('0x10')]('-')[0x4];var _0x59f25b=_0x3f7299[_0xdffd('0x10')]('-')[0x0];var _0x49a5cb=encryptor['decryptString'](_0x4b1d1c,util[_0xdffd('0x11')](_0xdffd('0x12'),_0x1489df,_0x3f7299,_0x59f25b));var _0x162059=JSON[_0xdffd('0x13')](_0x49a5cb);_0x162059['demo']=![];_0x162059['uuid']=_0x3f7299;_0x162059[_0xdffd('0x14')]=hardware['getUuid']();if(_0x7e46a1){var _0x5b6a71=encryptor['decryptString'](_0x7e46a1);_0x162059[_0xdffd('0x15')]=_0x5b6a71;_0x162059['deadline']=moment(_0x5b6a71)[_0xdffd('0x16')](0x7,'days')[_0xdffd('0x11')]();_0x162059[_0xdffd('0x17')]=_0x162059[_0xdffd('0xc')]!=_0x162059['machineUuid']?_0xdffd('0x18'):_0xdffd('0x19');}return _0x162059;}catch(_0x11c737){breakingLicense[_0xdffd('0xc')]=_0x2ecb6d['data1'];breakingLicense[_0xdffd('0x1a')]=_0x11c737[_0xdffd('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1916b1,_0x3ea705){getLicense()['then'](function(_0x5933fe){return db[_0xdffd('0x1b')][_0xdffd('0x1c')]({'attributes':[_0xdffd('0x1d'),[db[_0xdffd('0x1e')]['fn']('COUNT',db[_0xdffd('0x1e')]['col'](_0xdffd('0x1d'))),_0xdffd('0x1f')]],'group':'role','where':{'role':{'$or':[_0xdffd('0x20'),_0xdffd('0x21'),'telephone']}},'raw':!![]})[_0xdffd('0xa')](function(_0x2239a6){var _0x1af1c4={'user':_0x5933fe[_0xdffd('0x22')]||0x0,'telephone':_0x5933fe[_0xdffd('0x23')]||0x0};_0x2239a6[_0xdffd('0x24')](function(_0x17c571){var _0x56ce80=_0x17c571[_0xdffd('0x1d')]===_0xdffd('0x20')?_0xdffd('0x21'):_0x17c571[_0xdffd('0x1d')];_0x1af1c4[_0x56ce80]-=_0x17c571[_0xdffd('0x1f')];if(_0x1af1c4[_0x56ce80]<0x0)_0x1af1c4[_0x56ce80]=0x0;});_0x1916b1(_0x1af1c4);return;});})[_0xdffd('0xb')](function(_0x5df434){_0x3ea705(_0x5df434);});});}function checkUserLimits(_0x1b8577){return new BPromise(function(_0x3f855f,_0x1cbcc0){getLimits()['then'](function(_0x5728ee){var _0x42dff0=_['pick'](_['countBy'](_0x1b8577,_0xdffd('0x1d')),['admin',_0xdffd('0x21'),'telephone']);var _0x5b42b9=(_0x42dff0[_0xdffd('0x20')]||0x0)+(_0x42dff0[_0xdffd('0x21')]||0x0);var _0x4256b8=_0x42dff0['telephone']||0x0;if(_0x5b42b9>_0x5728ee[_0xdffd('0x21')])return _0x1cbcc0(_0xdffd('0x25'));if(_0x4256b8>_0x5728ee[_0xdffd('0x26')])return _0x1cbcc0(_0xdffd('0x27'));return _0x3f855f();})[_0xdffd('0xb')](function(_0xe258d5){_0x1cbcc0(_0xe258d5);});});}module[_0xdffd('0x28')]={'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 958cf6c..ad41958 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 _0x84a0=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x26a646,_0x6ed7a5){var _0x16e8de=function(_0x57c495){while(--_0x57c495){_0x26a646['push'](_0x26a646['shift']());}};_0x16e8de(++_0x6ed7a5);}(_0x84a0,0x66));var _0x084a=function(_0x311d3b,_0x2ac1d8){_0x311d3b=_0x311d3b-0x0;var _0x56e801=_0x84a0[_0x311d3b];return _0x56e801;};'use strict';module[_0x084a('0x0')]={'DOMAIN':_0x084a('0x1'),'SESSION_SECRET':_0x084a('0x2'),'GOOGLE_ID':_0x084a('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x351d=['exports','myappanuglar-secret','app-id','secret'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x351d,0x90));var _0xd351=function(_0x4e81e2,_0x5bdef7){_0x4e81e2=_0x4e81e2-0x0;var _0x4db08e=_0x351d[_0x4e81e2];return _0x4db08e;};'use strict';module[_0xd351('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xd351('0x1'),'GOOGLE_ID':_0xd351('0x2'),'GOOGLE_SECRET':_0xd351('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4bbc5cd..ec185ab 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb732=['../utils/loggers','fileLogger','exports'];(function(_0x2508fd,_0xa8375b){var _0x3ce952=function(_0x168476){while(--_0x168476){_0x2508fd['push'](_0x2508fd['shift']());}};_0x3ce952(++_0xa8375b);}(_0xb732,0x11a));var _0x2b73=function(_0x47d3eb,_0x36a8a4){_0x47d3eb=_0x47d3eb-0x0;var _0x573f29=_0xb732[_0x47d3eb];return _0x573f29;};'use strict';var fileLogger=require(_0x2b73('0x0'))[_0x2b73('0x1')];module[_0x2b73('0x2')]=fileLogger; \ No newline at end of file +var _0x382c=['fileLogger'];(function(_0x2c70d4,_0xad3eec){var _0xd0985e=function(_0x2e346d){while(--_0x2e346d){_0x2c70d4['push'](_0x2c70d4['shift']());}};_0xd0985e(++_0xad3eec);}(_0x382c,0x19d));var _0xc382=function(_0x371a8d,_0x1d4a5f){_0x371a8d=_0x371a8d-0x0;var _0x58c6f7=_0x382c[_0x371a8d];return _0x58c6f7;};'use strict';var fileLogger=require('../utils/loggers')[_0xc382('0x0')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a9a9e16..71ecafd 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 _0x48ed=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','../../services/xdr/index.js','exports'];(function(_0x1e75da,_0xe75533){var _0x4611a8=function(_0xc838ae){while(--_0xc838ae){_0x1e75da['push'](_0x1e75da['shift']());}};_0x4611a8(++_0xe75533);}(_0x48ed,0x15c));var _0xd48e=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x48ed[_0x26b80e];return _0x84a8a8;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xd48e('0x0'),'script':path[_0xd48e('0x1')](__dirname,_0xd48e('0x2'))},{'name':_0xd48e('0x3'),'script':path[_0xd48e('0x1')](__dirname,_0xd48e('0x4'))},{'name':_0xd48e('0x5'),'script':path[_0xd48e('0x1')](__dirname,_0xd48e('0x6'))},{'name':_0xd48e('0x7'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xd48e('0x8'),'script':path[_0xd48e('0x1')](__dirname,_0xd48e('0x9'))},{'name':'xdr','script':path[_0xd48e('0x1')](__dirname,_0xd48e('0xa'))}]};module[_0xd48e('0xb')]=config; \ No newline at end of file +var _0x7fa5=['path','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x7fa5,0x8f));var _0x57fa=function(_0x6bbbd6,_0x34eeba){_0x6bbbd6=_0x6bbbd6-0x0;var _0x3a0335=_0x7fa5[_0x6bbbd6];return _0x3a0335;};'use strict';var path=require(_0x57fa('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x57fa('0x1')](__dirname,_0x57fa('0x2'))},{'name':_0x57fa('0x3'),'script':path[_0x57fa('0x1')](__dirname,_0x57fa('0x4'))},{'name':'agi','script':path['join'](__dirname,_0x57fa('0x5'))},{'name':'email','script':path[_0x57fa('0x1')](__dirname,_0x57fa('0x6'))},{'name':_0x57fa('0x7'),'script':path[_0x57fa('0x1')](__dirname,_0x57fa('0x8'))},{'name':_0x57fa('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x57fa('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 25a73af..151e286 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 _0xae83=['then','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','start','stop'];(function(_0x483df9,_0x404deb){var _0x13530e=function(_0x5229a2){while(--_0x5229a2){_0x483df9['push'](_0x483df9['shift']());}};_0x13530e(++_0x404deb);}(_0xae83,0x140));var _0x3ae8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xae83[_0x53ccf2];return _0x5a2964;};'use strict';var pm2=require(_0x3ae8('0x0'));var BPromise=require(_0x3ae8('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0xc85cbe,_0x38a443){return pm2[_0x3ae8('0x2')](function(_0x2b7551){if(_0x2b7551){return _0x38a443(_0x2b7551);}return _0xc85cbe('connected');});});};exports[_0x3ae8('0x3')]=function(_0x50460d){return connect()['then'](function(){return new BPromise(function(_0x1c570b,_0x56d469){return pm2['start'](_0x50460d,function(_0x5da393,_0x2162a8){if(_0x5da393){return _0x56d469(_0x5da393);}pm2['disconnect']();return _0x1c570b(_0x2162a8);});});});};exports[_0x3ae8('0x4')]=function(_0x950be0){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x54ec72,_0x24fe5b){return pm2['stop'](_0x950be0,function(_0x39780d,_0x1e4582){if(_0x39780d){return _0x24fe5b(_0x39780d);}pm2[_0x3ae8('0x6')]();return _0x54ec72(_0x1e4582);});});});};exports[_0x3ae8('0x7')]=function(_0x48edd4){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x1cc5b4,_0x49c29a){return pm2[_0x3ae8('0x7')](_0x48edd4,function(_0x1eb929,_0x1e50e6){if(_0x1eb929){return _0x49c29a(_0x1eb929);}pm2[_0x3ae8('0x6')]();return _0x1cc5b4(_0x1e50e6);});});});};exports[_0x3ae8('0x8')]=function(){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x384bfa,_0x17d80c){return pm2['list'](function(_0x446ef1,_0x5921f9){if(_0x446ef1){return _0x17d80c(_0x446ef1);}pm2[_0x3ae8('0x6')]();return _0x384bfa(_0x5921f9);});});});};exports[_0x3ae8('0x9')]=function(_0x4504ca){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x365937,_0x3d5288){return pm2[_0x3ae8('0x9')](_0x4504ca,function(_0x183c3d,_0x4f174d){if(_0x183c3d){return _0x3d5288(_0x183c3d);}pm2[_0x3ae8('0x6')]();return _0x365937(_0x4f174d);});});});};exports['delete']=function(_0xe15a59){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x49ab2b,_0x98244d){return pm2[_0x3ae8('0xa')](_0xe15a59,function(_0x313d26,_0x4d791f){if(_0x313d26){return _0x98244d(_0x313d26);}pm2[_0x3ae8('0x6')]();return _0x49ab2b(_0x4d791f);});});});};exports[_0x3ae8('0xb')]=function(){return connect()[_0x3ae8('0x5')](function(){return new BPromise(function(_0x509d15,_0x3ea269){return pm2[_0x3ae8('0xb')](function(_0x264d4c){if(_0x264d4c){return _0x3ea269(_0x264d4c);}return _0x509d15(_0x3ae8('0xc'));});});});}; \ No newline at end of file +var _0x3395=['stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect','start','then','disconnect'];(function(_0x35ee85,_0x1a870c){var _0x173aed=function(_0x3b7720){while(--_0x3b7720){_0x35ee85['push'](_0x35ee85['shift']());}};_0x173aed(++_0x1a870c);}(_0x3395,0x125));var _0x5339=function(_0x60c5eb,_0x2ba0ce){_0x60c5eb=_0x60c5eb-0x0;var _0x393bd9=_0x3395[_0x60c5eb];return _0x393bd9;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5339('0x0'));var config=require(_0x5339('0x1'));function connect(){return new BPromise(function(_0x3e0adb,_0xf2ab08){return pm2[_0x5339('0x2')](function(_0x18a4f4){if(_0x18a4f4){return _0xf2ab08(_0x18a4f4);}return _0x3e0adb('connected');});});};exports[_0x5339('0x3')]=function(_0x2301b3){return connect()[_0x5339('0x4')](function(){return new BPromise(function(_0xcc520a,_0x58ad73){return pm2[_0x5339('0x3')](_0x2301b3,function(_0x228ad7,_0x45fdc9){if(_0x228ad7){return _0x58ad73(_0x228ad7);}pm2[_0x5339('0x5')]();return _0xcc520a(_0x45fdc9);});});});};exports[_0x5339('0x6')]=function(_0x99e4eb){return connect()['then'](function(){return new BPromise(function(_0x20d3cb,_0x41d823){return pm2[_0x5339('0x6')](_0x99e4eb,function(_0x469bd4,_0x17db11){if(_0x469bd4){return _0x41d823(_0x469bd4);}pm2['disconnect']();return _0x20d3cb(_0x17db11);});});});};exports[_0x5339('0x7')]=function(_0x2e0095){return connect()[_0x5339('0x4')](function(){return new BPromise(function(_0x345ec7,_0xbaee3a){return pm2[_0x5339('0x7')](_0x2e0095,function(_0x3a29a7,_0x544515){if(_0x3a29a7){return _0xbaee3a(_0x3a29a7);}pm2[_0x5339('0x5')]();return _0x345ec7(_0x544515);});});});};exports[_0x5339('0x8')]=function(){return connect()[_0x5339('0x4')](function(){return new BPromise(function(_0x3ca07f,_0x4be9b6){return pm2['list'](function(_0x58c825,_0x5157dc){if(_0x58c825){return _0x4be9b6(_0x58c825);}pm2['disconnect']();return _0x3ca07f(_0x5157dc);});});});};exports[_0x5339('0x9')]=function(_0x58aade){return connect()[_0x5339('0x4')](function(){return new BPromise(function(_0xa1e7,_0xc05d18){return pm2[_0x5339('0x9')](_0x58aade,function(_0x417924,_0x176303){if(_0x417924){return _0xc05d18(_0x417924);}pm2['disconnect']();return _0xa1e7(_0x176303);});});});};exports[_0x5339('0xa')]=function(_0x334e4c){return connect()['then'](function(){return new BPromise(function(_0x314f72,_0x4915b2){return pm2['delete'](_0x334e4c,function(_0x594c74,_0x47b83f){if(_0x594c74){return _0x4915b2(_0x594c74);}pm2['disconnect']();return _0x314f72(_0x47b83f);});});});};exports[_0x5339('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1edece,_0x3153dd){return pm2[_0x5339('0xb')](function(_0x461b89){if(_0x461b89){return _0x3153dd(_0x461b89);}return _0x1edece(_0x5339('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 514abeb..8afd27c 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 _0x34c7=['moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash'];(function(_0x1520aa,_0x1ddb73){var _0x417128=function(_0x3522fe){while(--_0x3522fe){_0x1520aa['push'](_0x1520aa['shift']());}};_0x417128(++_0x1ddb73);}(_0x34c7,0xcb));var _0x734c=function(_0x5de939,_0x17e6d6){_0x5de939=_0x5de939-0x0;var _0x27da7f=_0x34c7[_0x5de939];return _0x27da7f;};'use strict';var _=require(_0x734c('0x0'));var moment=require(_0x734c('0x1'));var Redis=require(_0x734c('0x2'));var util=require(_0x734c('0x3'));var config=require(_0x734c('0x4'));var db=require(_0x734c('0x5'))['db'];var logger=require(_0x734c('0x6'))(_0x734c('0x7'));config[_0x734c('0x8')]=_[_0x734c('0x9')](config[_0x734c('0x8')],{'host':_0x734c('0xa'),'port':0x18eb});var io=require(_0x734c('0xb'))(new Redis(config[_0x734c('0x8')]));function closeInteractions(){var _0x319fad=0x0;var _0xa6b95f=[];return db[_0x734c('0xc')][_0x734c('0xd')]({'raw':!![],'attributes':['id',_0x734c('0xe')],'where':{'id':0x1}})[_0x734c('0xf')](function(_0x338169){_0x319fad=_0x338169['chatTimeout'];if(_0x319fad){return db[_0x734c('0x10')][_0x734c('0x11')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x734c('0x12')](_0x338169['chatTimeout'],_0x734c('0x13'))}}});}else{return[];}})['then'](function(_0x1949e5){if(_0x1949e5&&_0x1949e5[_0x734c('0x14')]){_0xa6b95f=_['map'](_0x1949e5||[],'id');logger['info'](_0x734c('0x15'),_0xa6b95f[_0x734c('0x16')]());return db[_0x734c('0x10')][_0x734c('0x17')]({'closeReason':_0x734c('0x18'),'disposition':_0x734c('0x19'),'closed':!![],'closedAt':moment()[_0x734c('0x1a')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xa6b95f}});}})[_0x734c('0xf')](function(){if(_0xa6b95f&&_0xa6b95f[_0x734c('0x14')]){logger[_0x734c('0x1b')](_0x734c('0x1c'),_0xa6b95f[_0x734c('0x16')]());for(var _0x320cbf=0x0;_0x320cbf<_0xa6b95f[_0x734c('0x14')];_0x320cbf++){io[_0x734c('0x1d')]('chatInteraction:update',{'id':_0xa6b95f[_0x320cbf],'closed':!![]});}}})[_0x734c('0x1e')](function(_0x59dc57){logger['error'](_0x734c('0x1f'),_0x59dc57?util[_0x734c('0x20')](_0x59dc57,{'showHidden':![],'depth':null}):'');});}exports[_0x734c('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xbfd0=['socket.io-emitter','Setting','then','ChatInteraction','findAll','subtract','chatTimeout','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x4c0bcd,_0x126245){var _0x2ccc9b=function(_0x25c890){while(--_0x25c890){_0x4c0bcd['push'](_0x4c0bcd['shift']());}};_0x2ccc9b(++_0x126245);}(_0xbfd0,0xb6));var _0x0bfd=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xbfd0[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x0bfd('0x0'));var moment=require('moment');var Redis=require(_0x0bfd('0x1'));var util=require(_0x0bfd('0x2'));var config=require(_0x0bfd('0x3'));var db=require(_0x0bfd('0x4'))['db'];var logger=require(_0x0bfd('0x5'))(_0x0bfd('0x6'));config[_0x0bfd('0x7')]=_[_0x0bfd('0x8')](config[_0x0bfd('0x7')],{'host':_0x0bfd('0x9'),'port':0x18eb});var io=require(_0x0bfd('0xa'))(new Redis(config[_0x0bfd('0x7')]));function closeInteractions(){var _0x5872ce=0x0;var _0x31bbc7=[];return db[_0x0bfd('0xb')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x0bfd('0xc')](function(_0x45510b){_0x5872ce=_0x45510b['chatTimeout'];if(_0x5872ce){return db[_0x0bfd('0xd')][_0x0bfd('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0bfd('0xf')](_0x45510b[_0x0bfd('0x10')],_0x0bfd('0x11'))}}});}else{return[];}})['then'](function(_0x9f5f9b){if(_0x9f5f9b&&_0x9f5f9b[_0x0bfd('0x12')]){_0x31bbc7=_[_0x0bfd('0x13')](_0x9f5f9b||[],'id');logger['info'](_0x0bfd('0x14'),_0x31bbc7[_0x0bfd('0x15')]());return db[_0x0bfd('0xd')][_0x0bfd('0x16')]({'closeReason':'system','disposition':_0x0bfd('0x17'),'closed':!![],'closedAt':moment()[_0x0bfd('0x18')](_0x0bfd('0x19'))},{'where':{'id':_0x31bbc7}});}})['then'](function(){if(_0x31bbc7&&_0x31bbc7[_0x0bfd('0x12')]){logger[_0x0bfd('0x1a')](_0x0bfd('0x1b'),_0x31bbc7[_0x0bfd('0x15')]());for(var _0x18880f=0x0;_0x18880f<_0x31bbc7[_0x0bfd('0x12')];_0x18880f++){io['emit']('chatInteraction:update',{'id':_0x31bbc7[_0x18880f],'closed':!![]});}}})[_0x0bfd('0x1c')](function(_0x4b6ac1){logger[_0x0bfd('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4b6ac1?util[_0x0bfd('0x1e')](_0x4b6ac1,{'showHidden':![],'depth':null}):'');});}exports[_0x0bfd('0x1f')]=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 0c5d1df..7f5bd39 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 _0x3474=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x3474,0x100));var _0x4347=function(_0x2fe5f5,_0x2f28d5){_0x2fe5f5=_0x2fe5f5-0x0;var _0x2265f8=_0x3474[_0x2fe5f5];return _0x2265f8;};'use strict';function start(){var _0x18fbec=require(_0x4347('0x0'));return _0x18fbec[_0x4347('0x1')]();}module[_0x4347('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xdd3c=['startAllRefreshIntervals'];(function(_0x30249c,_0x431043){var _0x4dd704=function(_0x40f917){while(--_0x40f917){_0x30249c['push'](_0x30249c['shift']());}};_0x4dd704(++_0x431043);}(_0xdd3c,0xa2));var _0xcdd3=function(_0x11769e,_0x1a9c23){_0x11769e=_0x11769e-0x0;var _0x619a43=_0xdd3c[_0x11769e];return _0x619a43;};'use strict';function start(){var _0x4bf9d5=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x4bf9d5[_0xcdd3('0x0')]();}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 ba769b3..fe11271 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 _0x0cad=['email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','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','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','catch','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','toString','keyBy','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','resolve','run\x20job','cron','isBetween','endAt','add','start','stop\x20cron','active','update','util','path','lodash','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info'];(function(_0x55d7a8,_0x2e8003){var _0x54319c=function(_0x5a74f3){while(--_0x5a74f3){_0x55d7a8['push'](_0x55d7a8['shift']());}};_0x54319c(++_0x2e8003);}(_0x0cad,0x8c));var _0xd0ca=function(_0x163ab5,_0x6a7dbe){_0x163ab5=_0x163ab5-0x0;var _0x17e579=_0x0cad[_0x163ab5];return _0x17e579;};'use strict';var fs=require('fs');var util=require(_0xd0ca('0x0'));var path=require(_0xd0ca('0x1'));var _=require(_0xd0ca('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xd0ca('0x3'));var logger=require('../logger')('schedule');var db=require(_0xd0ca('0x4'))['db'];var analyticCustomReportController=require(_0xd0ca('0x5'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xd0ca('0x6')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5718e7,_0x306898){return function(){logger[_0xd0ca('0x7')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5718e7[_0xd0ca('0x8')]);var _0x43cc33=!![];var _0xa8812=_0x5718e7[_0xd0ca('0x9')][_0xd0ca('0xa')]();var _0x3cf03c={'account':_0xa8812,'message':{'from':util[_0xd0ca('0xb')](_0xd0ca('0xc'),_0x5718e7[_0xd0ca('0x9')][_0xd0ca('0xd')],_0x5718e7[_0xd0ca('0x9')][_0xd0ca('0x8')]||_0x5718e7[_0xd0ca('0x9')][_0xd0ca('0xe')]['user']),'to':_0x5718e7[_0xd0ca('0x8')],'cc':_0x5718e7['cc'],'bcc':_0x5718e7['bcc'],'subject':util[_0xd0ca('0xb')](_0xd0ca('0xf'),_0x306898['name'],_0x5718e7[_0xd0ca('0x10')],_0x5718e7[_0xd0ca('0x11')])}};var _0x28fb24=path[_0xd0ca('0x12')](__dirname,'../../files/reports');var _0x4c41df=_0x306898[_0xd0ca('0x13')];var _0x4021a7=util[_0xd0ca('0xb')](_0xd0ca('0x14'),path[_0xd0ca('0x15')](_0x306898[_0xd0ca('0x13')],path['extname'](_0x306898[_0xd0ca('0x13')])),'zip');var _0x5a7f41=path[_0xd0ca('0x12')](_0x28fb24,_0x4c41df);var _0x2eaacb=path[_0xd0ca('0x12')](_0x28fb24,_0x4021a7);if(fs[_0xd0ca('0x16')](_0x5a7f41)){_0x306898[_0xd0ca('0x17')]=_0xd0ca('0x18');_0x3cf03c[_0xd0ca('0x19')][_0xd0ca('0x1a')]=[{'filename':_0x4c41df,'path':_0x5a7f41}];_0x3cf03c[_0xd0ca('0x19')][_0xd0ca('0x1b')]=util[_0xd0ca('0xb')](_0xd0ca('0x1c'),JSON[_0xd0ca('0x1d')](_0x306898,null,0x2));}else if(fs[_0xd0ca('0x16')](_0x2eaacb)){_0x306898[_0xd0ca('0x17')]=_0xd0ca('0x18');_0x3cf03c[_0xd0ca('0x19')][_0xd0ca('0x1a')]=[{'filename':_0x4021a7,'path':_0x2eaacb}];}else{_0x3cf03c['message'][_0xd0ca('0x1b')]=_0xd0ca('0x1e');if(!_0x5718e7[_0xd0ca('0x1f')]){_0x43cc33=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x43cc33){return client[_0xd0ca('0x20')](_0xd0ca('0x21'),_0x3cf03c)[_0xd0ca('0x22')](function(_0x2588ba){if(_0x2588ba[_0xd0ca('0x23')]){return logger[_0xd0ca('0x23')]('error\x20mail',JSON[_0xd0ca('0x1d')](_0x2588ba));}return logger['info']('email\x20sent');})[_0xd0ca('0x24')](function(_0x290f85){return logger['error'](_0xd0ca('0x25'),JSON['stringify'](_0x290f85));});}};}function handleError(){return function(_0x30fff2){return logger['error'](JSON[_0xd0ca('0x1d')](_0x30fff2));};}function handleResult(_0x33041e){return function(_0x543e57){logger[_0xd0ca('0x7')]('data',JSON[_0xd0ca('0x1d')](_0x543e57));if(_0x33041e['MailAccount']&&_0x33041e[_0xd0ca('0x9')]['Smtp']&&!_[_0xd0ca('0x26')](_0x33041e[_0xd0ca('0x8')])){setTimeout(handleSendEmail(_0x33041e,_0x543e57),0x3c*0x3e8);}};}function handleJob(_0x2c3bbb){return function(){try{if(_[_0xd0ca('0x26')](_0x2c3bbb[_0xd0ca('0x10')])){return logger[_0xd0ca('0x7')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd0ca('0x26')](_0x2c3bbb[_0xd0ca('0x11')])){return logger[_0xd0ca('0x7')](_0xd0ca('0x27'));}var _0x50386c={'startDate':moment()[_0xd0ca('0x28')](_0x2c3bbb[_0xd0ca('0x10')],_0x2c3bbb[_0xd0ca('0x11')])[_0xd0ca('0xb')](_0xd0ca('0x29')),'endDate':moment()['format'](_0xd0ca('0x29')),'type':'scheduled','output':_0x2c3bbb[_0xd0ca('0x2a')],'name':_0x2c3bbb[_0xd0ca('0xd')]};if(!_[_0xd0ca('0x26')](_0x2c3bbb[_0xd0ca('0x2b')])){logger[_0xd0ca('0x7')](_0xd0ca('0x2c'),_0x2c3bbb['DefaultReportId']);return analyticDefaultReportController[_0xd0ca('0x2d')]({'id':_0x2c3bbb[_0xd0ca('0x2b')]},_0x50386c)[_0xd0ca('0x22')](handleResult(_0x2c3bbb))[_0xd0ca('0x24')](handleError());}if(!_[_0xd0ca('0x26')](_0x2c3bbb[_0xd0ca('0x2e')])){logger['info'](_0xd0ca('0x2f'),_0x2c3bbb[_0xd0ca('0x2e')]);return analyticCustomReportController[_0xd0ca('0x2d')]({'id':_0x2c3bbb[_0xd0ca('0x2e')]},_0x50386c)[_0xd0ca('0x22')](handleResult(_0x2c3bbb))[_0xd0ca('0x24')](handleError());}}catch(_0x2e3cb7){logger[_0xd0ca('0x23')](JSON['stringify'](_0x2e3cb7));}return logger[_0xd0ca('0x7')](_0xd0ca('0x30'));};}function getJobs(_0x5ba53e){var _0xe575f7={};if(_0x5ba53e){_0xe575f7['id']=_0x5ba53e;}return db[_0xd0ca('0x31')][_0xd0ca('0x32')]({'where':_0xe575f7,'include':[{'model':db[_0xd0ca('0x9')],'attributes':['id','name',_0xd0ca('0x8')],'include':[{'model':db['MailServerOut'],'as':_0xd0ca('0xe'),'include':[{'model':db[_0xd0ca('0x33')],'as':_0xd0ca('0x33')}]}]}]})[_0xd0ca('0x22')](function(_0x176d1a){var _0x374c36=_[_0xd0ca('0x34')](manager[_0xd0ca('0x35')]);var _0x3cd3c9=_['map'](_0x176d1a,function(_0xb47a72){return _0xb47a72['id'][_0xd0ca('0x36')]();});var _0x6ffec4=_[_0xd0ca('0x37')](_0x176d1a,function(_0x434ce2){return _0x434ce2['id'][_0xd0ca('0x36')]();});var _0x36e45c=_0x5ba53e?_0x3cd3c9:_[_0xd0ca('0x38')](_0x3cd3c9,_0x374c36);var _0x1e1f2d=_['intersection'](_0x3cd3c9,_0x374c36);var _0x4448d2=_[_0xd0ca('0x38')](_0x374c36,_0x3cd3c9);var _0x2a3cac;var _0xa4514a;for(_0x2a3cac=0x0;_0x2a3cac<_0x4448d2['length']&&!_0x5ba53e;_0x2a3cac+=0x1){_0xa4514a=_0x4448d2[_0x2a3cac][_0xd0ca('0x36')]();if(manager[_0xd0ca('0x39')](_0xa4514a)){manager[_0xd0ca('0x3a')](_0xa4514a);manager[_0xd0ca('0x3b')](_0xa4514a);logger['info'](_0xd0ca('0x3c'),_0xa4514a);}}logger[_0xd0ca('0x7')](_0xd0ca('0x3d'),JSON['stringify'](_0x36e45c));for(_0x2a3cac=0x0;_0x2a3cac<_0x36e45c[_0xd0ca('0x3e')];_0x2a3cac+=0x1){_0xa4514a=_0x36e45c[_0x2a3cac][_0xd0ca('0x36')]();logger[_0xd0ca('0x7')](_0xd0ca('0x3f'),_0xa4514a);if(_0x5ba53e){logger[_0xd0ca('0x7')]('my\x20id',_0x5ba53e);logger[_0xd0ca('0x7')](JSON[_0xd0ca('0x1d')](_0x6ffec4[_0xa4514a]));BPromise[_0xd0ca('0x40')]()[_0xd0ca('0x22')](handleJob(_0x6ffec4[_0xa4514a]));logger[_0xd0ca('0x7')](_0xd0ca('0x41'),_0x6ffec4[_0xa4514a][_0xd0ca('0xd')],_0x6ffec4[_0xa4514a][_0xd0ca('0x42')]);}else if(_0x6ffec4[_0xa4514a]['cron']&&_0x6ffec4[_0xa4514a]['active']&&moment()[_0xd0ca('0x43')](_0x6ffec4[_0xa4514a]['startAt'],_0x6ffec4[_0xa4514a][_0xd0ca('0x44')])){manager[_0xd0ca('0x45')](_0xa4514a,_0x6ffec4[_0xa4514a][_0xd0ca('0x42')],handleJob(_0x6ffec4[_0xa4514a]));manager[_0xd0ca('0x46')](_0xa4514a);logger['info']('add\x20cron',_0x6ffec4[_0xa4514a][_0xd0ca('0xd')],_0x6ffec4[_0xa4514a]['cron']);}else if(manager['exists'](_0xa4514a)){manager[_0xd0ca('0x3a')](_0xa4514a);manager[_0xd0ca('0x3b')](_0xa4514a);logger[_0xd0ca('0x7')](_0xd0ca('0x47'),_0x6ffec4[_0xa4514a][_0xd0ca('0xd')],_0x6ffec4[_0xa4514a]['cron']);}}for(_0x2a3cac=0x0,_0xa4514a;_0x2a3cac<_0x1e1f2d[_0xd0ca('0x3e')]&&!_0x5ba53e;_0x2a3cac+=0x1){_0xa4514a=_0x1e1f2d[_0x2a3cac][_0xd0ca('0x36')]();if(manager['exists'](_0xa4514a)){if(_0x6ffec4[_0xa4514a]['cron']&&_0x6ffec4[_0xa4514a][_0xd0ca('0x48')]&&moment()[_0xd0ca('0x43')](_0x6ffec4[_0xa4514a]['startAt'],_0x6ffec4[_0xa4514a][_0xd0ca('0x44')])){manager[_0xd0ca('0x49')](_0xa4514a,_0x6ffec4[_0xa4514a][_0xd0ca('0x42')],handleJob(_0x6ffec4[_0xa4514a]));logger[_0xd0ca('0x7')]('update\x20cron',_0x6ffec4[_0xa4514a]['name'],_0x6ffec4[_0xa4514a]['cron']);}else{manager[_0xd0ca('0x3a')](_0xa4514a);manager[_0xd0ca('0x3b')](_0xa4514a);logger[_0xd0ca('0x7')](_0xd0ca('0x47'),_0x6ffec4[_0xa4514a][_0xd0ca('0xd')],_0x6ffec4[_0xa4514a][_0xd0ca('0x42')]);}}}})[_0xd0ca('0x24')](function(_0x584635){logger[_0xd0ca('0x23')](JSON['stringify'](_0x584635));});}exports['run']=function(_0x22cd6c){return getJobs(_0x22cd6c);};exports[_0xd0ca('0x46')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0f56=['toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','endAt','add','start','add\x20cron','stop\x20cron','isBetween','startAt','update','update\x20cron','run','util','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','basename','extname','join','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','stringify','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','email\x20sent','catch','error','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','MailServerOut','CloudProvider','keys','jobs','map'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x0f56,0xc3));var _0x60f5=function(_0x3f717a,_0x388623){_0x3f717a=_0x3f717a-0x0;var _0x2e1de2=_0x0f56[_0x3f717a];return _0x2e1de2;};'use strict';var fs=require('fs');var util=require(_0x60f5('0x0'));var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x60f5('0x1'));var BPromise=require(_0x60f5('0x2'));var logger=require(_0x60f5('0x3'))(_0x60f5('0x4'));var db=require(_0x60f5('0x5'))['db'];var analyticCustomReportController=require(_0x60f5('0x6'));var analyticDefaultReportController=require(_0x60f5('0x7'));var client=jayson[_0x60f5('0x8')][_0x60f5('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x56cefc,_0x1218d2){return function(){logger[_0x60f5('0xa')](_0x60f5('0xb'),_0x56cefc[_0x60f5('0xc')]);var _0x350e48=!![];var _0x238975=_0x56cefc[_0x60f5('0xd')][_0x60f5('0xe')]();var _0x52d0fe={'account':_0x238975,'message':{'from':util[_0x60f5('0xf')]('\x22%s\x22\x20<%s>',_0x56cefc[_0x60f5('0xd')][_0x60f5('0x10')],_0x56cefc[_0x60f5('0xd')][_0x60f5('0xc')]||_0x56cefc[_0x60f5('0xd')][_0x60f5('0x11')]['user']),'to':_0x56cefc[_0x60f5('0xc')],'cc':_0x56cefc['cc'],'bcc':_0x56cefc[_0x60f5('0x12')],'subject':util[_0x60f5('0xf')](_0x60f5('0x13'),_0x1218d2['name'],_0x56cefc['subtractNumber'],_0x56cefc[_0x60f5('0x14')])}};var _0x1896a5=path['join'](__dirname,_0x60f5('0x15'));var _0x14bde1=_0x1218d2[_0x60f5('0x16')];var _0x551408=util[_0x60f5('0xf')]('%s.%s',path[_0x60f5('0x17')](_0x1218d2[_0x60f5('0x16')],path[_0x60f5('0x18')](_0x1218d2[_0x60f5('0x16')])),'zip');var _0x3008bf=path['join'](_0x1896a5,_0x14bde1);var _0x3cb287=path[_0x60f5('0x19')](_0x1896a5,_0x551408);if(fs[_0x60f5('0x1a')](_0x3008bf)){_0x1218d2[_0x60f5('0x1b')]=_0x60f5('0x1c');_0x52d0fe[_0x60f5('0x1d')][_0x60f5('0x1e')]=[{'filename':_0x14bde1,'path':_0x3008bf}];_0x52d0fe['message'][_0x60f5('0x1f')]=util[_0x60f5('0xf')](_0x60f5('0x20'),JSON[_0x60f5('0x21')](_0x1218d2,null,0x2));}else if(fs[_0x60f5('0x1a')](_0x3cb287)){_0x1218d2['status']='Sent';_0x52d0fe['message'][_0x60f5('0x1e')]=[{'filename':_0x551408,'path':_0x3cb287}];}else{_0x52d0fe[_0x60f5('0x1d')][_0x60f5('0x1f')]=_0x60f5('0x22');if(!_0x56cefc[_0x60f5('0x23')]){_0x350e48=![];logger['info'](_0x60f5('0x24'));}}if(_0x350e48){return client[_0x60f5('0x25')](_0x60f5('0x26'),_0x52d0fe)[_0x60f5('0x27')](function(_0x5d8772){if(_0x5d8772['error']){return logger['error']('error\x20mail',JSON[_0x60f5('0x21')](_0x5d8772));}return logger['info'](_0x60f5('0x28'));})[_0x60f5('0x29')](function(_0x1f2923){return logger[_0x60f5('0x2a')](_0x60f5('0x2b'),JSON[_0x60f5('0x21')](_0x1f2923));});}};}function handleError(){return function(_0x1e5e88){return logger[_0x60f5('0x2a')](JSON[_0x60f5('0x21')](_0x1e5e88));};}function handleResult(_0x33fa9b){return function(_0x3653ba){logger[_0x60f5('0xa')]('data',JSON[_0x60f5('0x21')](_0x3653ba));if(_0x33fa9b[_0x60f5('0xd')]&&_0x33fa9b[_0x60f5('0xd')][_0x60f5('0x11')]&&!_[_0x60f5('0x2c')](_0x33fa9b['email'])){setTimeout(handleSendEmail(_0x33fa9b,_0x3653ba),0x3c*0x3e8);}};}function handleJob(_0x12ae34){return function(){try{if(_['isNil'](_0x12ae34['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x12ae34['subtractUnit'])){return logger[_0x60f5('0xa')](_0x60f5('0x2d'));}var _0x5360f1={'startDate':moment()[_0x60f5('0x2e')](_0x12ae34[_0x60f5('0x2f')],_0x12ae34['subtractUnit'])['format'](_0x60f5('0x30')),'endDate':moment()[_0x60f5('0xf')](_0x60f5('0x30')),'type':_0x60f5('0x31'),'output':_0x12ae34[_0x60f5('0x32')],'name':_0x12ae34[_0x60f5('0x10')]};if(!_[_0x60f5('0x2c')](_0x12ae34['DefaultReportId'])){logger['info'](_0x60f5('0x33'),_0x12ae34['DefaultReportId']);return analyticDefaultReportController[_0x60f5('0x34')]({'id':_0x12ae34['DefaultReportId']},_0x5360f1)[_0x60f5('0x27')](handleResult(_0x12ae34))['catch'](handleError());}if(!_['isNil'](_0x12ae34[_0x60f5('0x35')])){logger[_0x60f5('0xa')](_0x60f5('0x36'),_0x12ae34[_0x60f5('0x35')]);return analyticCustomReportController[_0x60f5('0x34')]({'id':_0x12ae34[_0x60f5('0x35')]},_0x5360f1)[_0x60f5('0x27')](handleResult(_0x12ae34))[_0x60f5('0x29')](handleError());}}catch(_0x514a0e){logger[_0x60f5('0x2a')](JSON[_0x60f5('0x21')](_0x514a0e));}return logger[_0x60f5('0xa')]('no\x20report\x20id');};}function getJobs(_0x84f375){var _0x5ce3f8={};if(_0x84f375){_0x5ce3f8['id']=_0x84f375;}return db['Schedule']['findAll']({'where':_0x5ce3f8,'include':[{'model':db[_0x60f5('0xd')],'attributes':['id',_0x60f5('0x10'),_0x60f5('0xc')],'include':[{'model':db[_0x60f5('0x37')],'as':'Smtp','include':[{'model':db[_0x60f5('0x38')],'as':_0x60f5('0x38')}]}]}]})[_0x60f5('0x27')](function(_0x182ae8){var _0x24d60a=_[_0x60f5('0x39')](manager[_0x60f5('0x3a')]);var _0x28b8c9=_[_0x60f5('0x3b')](_0x182ae8,function(_0x209291){return _0x209291['id'][_0x60f5('0x3c')]();});var _0x3bc71c=_['keyBy'](_0x182ae8,function(_0x2eb876){return _0x2eb876['id'][_0x60f5('0x3c')]();});var _0x1bff8d=_0x84f375?_0x28b8c9:_[_0x60f5('0x3d')](_0x28b8c9,_0x24d60a);var _0x1554e3=_[_0x60f5('0x3e')](_0x28b8c9,_0x24d60a);var _0x5caf34=_['difference'](_0x24d60a,_0x28b8c9);var _0x161b6c;var _0x3095f3;for(_0x161b6c=0x0;_0x161b6c<_0x5caf34[_0x60f5('0x3f')]&&!_0x84f375;_0x161b6c+=0x1){_0x3095f3=_0x5caf34[_0x161b6c][_0x60f5('0x3c')]();if(manager[_0x60f5('0x40')](_0x3095f3)){manager[_0x60f5('0x41')](_0x3095f3);manager[_0x60f5('0x42')](_0x3095f3);logger[_0x60f5('0xa')](_0x60f5('0x43'),_0x3095f3);}}logger[_0x60f5('0xa')](_0x60f5('0x44'),JSON[_0x60f5('0x21')](_0x1bff8d));for(_0x161b6c=0x0;_0x161b6c<_0x1bff8d[_0x60f5('0x3f')];_0x161b6c+=0x1){_0x3095f3=_0x1bff8d[_0x161b6c]['toString']();logger[_0x60f5('0xa')](_0x60f5('0x45'),_0x3095f3);if(_0x84f375){logger['info'](_0x60f5('0x46'),_0x84f375);logger[_0x60f5('0xa')](JSON['stringify'](_0x3bc71c[_0x3095f3]));BPromise[_0x60f5('0x47')]()[_0x60f5('0x27')](handleJob(_0x3bc71c[_0x3095f3]));logger[_0x60f5('0xa')](_0x60f5('0x48'),_0x3bc71c[_0x3095f3][_0x60f5('0x10')],_0x3bc71c[_0x3095f3][_0x60f5('0x49')]);}else if(_0x3bc71c[_0x3095f3][_0x60f5('0x49')]&&_0x3bc71c[_0x3095f3][_0x60f5('0x4a')]&&moment()['isBetween'](_0x3bc71c[_0x3095f3]['startAt'],_0x3bc71c[_0x3095f3][_0x60f5('0x4b')])){manager[_0x60f5('0x4c')](_0x3095f3,_0x3bc71c[_0x3095f3][_0x60f5('0x49')],handleJob(_0x3bc71c[_0x3095f3]));manager[_0x60f5('0x4d')](_0x3095f3);logger['info'](_0x60f5('0x4e'),_0x3bc71c[_0x3095f3]['name'],_0x3bc71c[_0x3095f3][_0x60f5('0x49')]);}else if(manager['exists'](_0x3095f3)){manager[_0x60f5('0x41')](_0x3095f3);manager[_0x60f5('0x42')](_0x3095f3);logger[_0x60f5('0xa')](_0x60f5('0x4f'),_0x3bc71c[_0x3095f3]['name'],_0x3bc71c[_0x3095f3][_0x60f5('0x49')]);}}for(_0x161b6c=0x0,_0x3095f3;_0x161b6c<_0x1554e3['length']&&!_0x84f375;_0x161b6c+=0x1){_0x3095f3=_0x1554e3[_0x161b6c][_0x60f5('0x3c')]();if(manager[_0x60f5('0x40')](_0x3095f3)){if(_0x3bc71c[_0x3095f3][_0x60f5('0x49')]&&_0x3bc71c[_0x3095f3][_0x60f5('0x4a')]&&moment()[_0x60f5('0x50')](_0x3bc71c[_0x3095f3][_0x60f5('0x51')],_0x3bc71c[_0x3095f3][_0x60f5('0x4b')])){manager[_0x60f5('0x52')](_0x3095f3,_0x3bc71c[_0x3095f3][_0x60f5('0x49')],handleJob(_0x3bc71c[_0x3095f3]));logger[_0x60f5('0xa')](_0x60f5('0x53'),_0x3bc71c[_0x3095f3]['name'],_0x3bc71c[_0x3095f3]['cron']);}else{manager[_0x60f5('0x41')](_0x3095f3);manager['deleteJob'](_0x3095f3);logger['info'](_0x60f5('0x4f'),_0x3bc71c[_0x3095f3][_0x60f5('0x10')],_0x3bc71c[_0x3095f3]['cron']);}}}})['catch'](function(_0x5c33a1){logger['error'](JSON[_0x60f5('0x21')](_0x5c33a1));});}exports[_0x60f5('0x54')]=function(_0x2b8fb3){return getJobs(_0x2b8fb3);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index e763359..6ef2bc3 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 _0xe511=['Sentiment','SentimentScore','Positive','Negative','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Neutral','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','lodash','aws-sdk','util','../../mysqldb','../../config/logger','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x42bca2,_0x138a27){var _0x2e8663=function(_0x1e3ebb){while(--_0x1e3ebb){_0x42bca2['push'](_0x42bca2['shift']());}};_0x2e8663(++_0x138a27);}(_0xe511,0x16f));var _0x1e51=function(_0x234cdb,_0x28750b){_0x234cdb=_0x234cdb-0x0;var _0x1d18bb=_0xe511[_0x234cdb];return _0x1d18bb;};var _=require(_0x1e51('0x0'));var AWS=require(_0x1e51('0x1'));var rp=require('request-promise');var util=require(_0x1e51('0x2'));var BPromise=require('bluebird');var db=require(_0x1e51('0x3'))['db'];var logger=require(_0x1e51('0x4'))('transcribe');function getTranscriptionJob(_0x42e242,_0x2be2b7,_0x204da7,_0x16ec99){return new Promise(function(_0x480cca,_0x26b22c){var _0x21ed6b=new AWS['TranscribeService']({'accessKeyId':_0x2be2b7,'secretAccessKey':_0x42e242,'region':_0x204da7});_0x21ed6b['getTranscriptionJob']({'TranscriptionJobName':_0x16ec99},function(_0x394ad8,_0x133021){if(_0x394ad8){return _0x26b22c(_0x394ad8);}else{return _0x480cca(_0x133021);}});});}function sentiment(_0x4fa8a9,_0x49d359,_0x658941,_0x2712e0,_0x29da1f){return new Promise(function(_0x706e60,_0x4241a6){var _0x141e2e=new AWS['Comprehend']({'accessKeyId':_0x49d359,'secretAccessKey':_0x4fa8a9,'region':_0x658941});_0x141e2e[_0x1e51('0x5')]({'Text':_0x2712e0,'LanguageCode':_0x29da1f[_0x1e51('0x6')](0x0,0x2)},function(_0x3350bb,_0x2ea35d){if(_0x3350bb){return _0x4241a6(_0x3350bb);}else{return _0x706e60(_0x2ea35d);}});});}function checkTranscribeJob(_0x34ad70,_0x3c5330,_0x5544eb){var _0x408a77;return new BPromise(function(_0x102f01,_0x2acdf5){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x9'),_0x34ad70['id'],_0x34ad70[_0x1e51('0xa')]));return getTranscriptionJob(_0x5544eb[_0x1e51('0xb')],_0x5544eb[_0x1e51('0xc')],_0x3c5330[_0x1e51('0xd')],_0x34ad70['transcribeName'])[_0x1e51('0xe')](function(_0x24db4f){logger[_0x1e51('0x7')](util['format'](_0x1e51('0xf'),_0x34ad70['id'],_0x34ad70['transcribeName'],_0x24db4f['TranscriptionJob'][_0x1e51('0x10')]));if(!_0x34ad70[_0x1e51('0x11')]){switch(_0x24db4f[_0x1e51('0x12')][_0x1e51('0x10')]){case _0x1e51('0x13'):var _0x3e4234={'transcribeStatus':_0x24db4f['TranscriptionJob'][_0x1e51('0x10')],'fileUri':_0x24db4f['TranscriptionJob'][_0x1e51('0x14')][_0x1e51('0x15')]};logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x34ad70['id']));return rp({'uri':_0x24db4f['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0x1e51('0xe')](function(_0x4f1f56){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x16'),_0x34ad70['id']));if(_0x4f1f56&&_0x4f1f56[_0x1e51('0x17')]&&_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')]&&_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')]['length']){_0x3e4234['fileText']='';for(var _0x43f5c5=0x0;_0x43f5c5<_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')][_0x1e51('0x19')];_0x43f5c5++){_0x3e4234['fileText']+=_0x4f1f56['results']['transcripts'][_0x43f5c5][_0x1e51('0x1a')]+'';}}return _0x34ad70[_0x1e51('0x1b')](_0x3e4234);})[_0x1e51('0xe')](function(){logger['info'](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x34ad70['id']));if(!_0x34ad70['tempSentiment']){throw new db[(_0x1e51('0x1c'))]['ValidationError'](_0x1e51('0x1d'));}if(!_0x3c5330[_0x1e51('0x1e')]||!_0x3c5330['sentimentAccountId']||!_0x3c5330[_0x1e51('0x1f')]||!_0x3c5330[_0x1e51('0x20')]||!_0x3c5330[_0x1e51('0x21')]){throw new db[(_0x1e51('0x1c'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3e4234['fileText']){throw new Error(_0x1e51('0x22'));}if(_0x3c5330[_0x1e51('0x23')]===_0x5544eb['id']){return _0x5544eb;}else{return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_settings[_0x1e51('0x23')]}});}})[_0x1e51('0xe')](function(_0x378206){if(!_0x378206){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x27'));}if(!_0x378206[_0x1e51('0xb')]||!_0x378206['data2']){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x28'));}_0x408a77=_0x378206;logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x34ad70['id']));return sentiment(_0x408a77[_0x1e51('0xb')],_0x408a77['data2'],_0x3c5330[_0x1e51('0x1f')],_0x3e4234[_0x1e51('0x11')],_0x3c5330[_0x1e51('0x20')]);})['then'](function(_0x3e3742){logger['info'](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x34ad70['id']));return _0x34ad70['update']({'sentiment':_0x3e3742[_0x1e51('0x29')],'sPositive':_0x3e3742[_0x1e51('0x2a')][_0x1e51('0x2b')],'sNegative':_0x3e3742['SentimentScore'][_0x1e51('0x2c')],'sMixed':_0x3e3742['SentimentScore'][_0x1e51('0x2d')],'sNeutral':_0x3e3742[_0x1e51('0x2a')]['Neutral']});})[_0x1e51('0xe')](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x2e'),_0x34ad70['id']));_0x102f01();});case _0x1e51('0x2f'):return _0x34ad70[_0x1e51('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x24db4f['TranscriptionJob'][_0x1e51('0x30')]})['then'](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x2e'),_0x34ad70['id']));_0x102f01();});default:logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x31'),_0x34ad70['id']));break;}}else{return BPromise[_0x1e51('0x32')]()[_0x1e51('0xe')](function(){if(!_0x34ad70[_0x1e51('0x33')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3c5330[_0x1e51('0x1e')]||!_0x3c5330['sentimentAccountId']||!_0x3c5330[_0x1e51('0x1f')]||!_0x3c5330[_0x1e51('0x20')]||!_0x3c5330[_0x1e51('0x21')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x34'));}if(!_0x34ad70[_0x1e51('0x11')]){throw new Error(_0x1e51('0x22'));}if(_0x3c5330[_0x1e51('0x23')]===_0x5544eb['id']){return _0x5544eb;}else{return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x13da51){if(!_0x13da51){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x27'));}if(!_0x13da51[_0x1e51('0xb')]||!_0x13da51[_0x1e51('0xc')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x408a77=_0x13da51;logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x35'),_0x34ad70['id']));return sentiment(_0x408a77[_0x1e51('0xb')],_0x408a77[_0x1e51('0xc')],_0x3c5330[_0x1e51('0x1f')],_0x34ad70[_0x1e51('0x11')],_0x3c5330['language']);})[_0x1e51('0xe')](function(_0x232789){logger['info'](util[_0x1e51('0x8')](_0x1e51('0x36'),_0x34ad70['id']));return _0x34ad70[_0x1e51('0x1b')]({'sentiment':_0x232789['Sentiment'],'sPositive':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2b')],'sNegative':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2c')],'sMixed':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2d')],'sNeutral':_0x232789[_0x1e51('0x2a')][_0x1e51('0x37')],'transcribeStatus':_0x1e51('0x13')});})['then'](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x34ad70['id']));_0x102f01();});}})[_0x1e51('0x38')](function(_0x41ac31){if(_0x41ac31){if(!_0x41ac31[_0x1e51('0x39')]||_0x41ac31['name']!==_0x1e51('0x3a')){logger[_0x1e51('0x3b')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x34ad70['id']),util[_0x1e51('0x3c')](_0x41ac31,{'showHidden':![],'depth':null}));}}_0x102f01();});});}function checkTranscribe(){var _0x52e7da;var _0x581f7a;var _0x54688b;return db[_0x1e51('0x3d')][_0x1e51('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x191a79){if(!_0x191a79||!_0x191a79[_0x1e51('0x19')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x3f'));}_0x52e7da=_0x191a79;return db[_0x1e51('0x40')]['findOne']({'where':{'id':0x1}});})[_0x1e51('0xe')](function(_0x48a2d0){if(!_0x48a2d0){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Settings\x20not\x20available');}_0x581f7a=_0x48a2d0;if(!_0x581f7a['transcribe']||!_0x581f7a['transcribeAccountId']||!_0x581f7a[_0x1e51('0xd')]||!_0x581f7a[_0x1e51('0x20')]||!_0x581f7a[_0x1e51('0x21')]){throw new db['Sequelize'][(_0x1e51('0x26'))](_0x1e51('0x41'));}return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_0x581f7a[_0x1e51('0x42')]}});})[_0x1e51('0xe')](function(_0x32fe1f){if(!_0x32fe1f){throw new db[(_0x1e51('0x1c'))]['ValidationError'](_0x1e51('0x27'));}if(!_0x32fe1f[_0x1e51('0xb')]||!_0x32fe1f[_0x1e51('0xc')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x28'));}_0x54688b=_0x32fe1f;var _0x5ba6c2=[];_0x52e7da[_0x1e51('0x43')](function(_0x4a2c1b){_0x5ba6c2['push'](checkTranscribeJob(_0x4a2c1b,_0x581f7a,_0x54688b));});return BPromise['all'](_0x5ba6c2);})[_0x1e51('0x38')](function(_0xfbc40f){if(_0xfbc40f){if(!_0xfbc40f[_0x1e51('0x39')]||_0xfbc40f['name']!==_0x1e51('0x3a')){logger[_0x1e51('0x3b')](util[_0x1e51('0x3c')](_0xfbc40f,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4b6c=['TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','findOne','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','start','lodash','aws-sdk','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED'];(function(_0x5bc3b2,_0x4314de){var _0x36008c=function(_0x517f49){while(--_0x517f49){_0x5bc3b2['push'](_0x5bc3b2['shift']());}};_0x36008c(++_0x4314de);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};var _=require(_0xc4b6('0x0'));var AWS=require(_0xc4b6('0x1'));var rp=require('request-promise');var util=require(_0xc4b6('0x2'));var BPromise=require(_0xc4b6('0x3'));var db=require(_0xc4b6('0x4'))['db'];var logger=require('../../config/logger')(_0xc4b6('0x5'));function getTranscriptionJob(_0x26d2d9,_0x3c532b,_0x4cf5e5,_0xce03bb){return new Promise(function(_0x1d5e09,_0x21f368){var _0x2948c6=new AWS['TranscribeService']({'accessKeyId':_0x3c532b,'secretAccessKey':_0x26d2d9,'region':_0x4cf5e5});_0x2948c6[_0xc4b6('0x6')]({'TranscriptionJobName':_0xce03bb},function(_0x4b935f,_0x4b723a){if(_0x4b935f){return _0x21f368(_0x4b935f);}else{return _0x1d5e09(_0x4b723a);}});});}function sentiment(_0x27daa9,_0x1bb011,_0x433435,_0x2f0cc9,_0x8088db){return new Promise(function(_0x423d81,_0x48faf0){var _0x426553=new AWS[(_0xc4b6('0x7'))]({'accessKeyId':_0x1bb011,'secretAccessKey':_0x27daa9,'region':_0x433435});_0x426553['detectSentiment']({'Text':_0x2f0cc9,'LanguageCode':_0x8088db[_0xc4b6('0x8')](0x0,0x2)},function(_0x233b0c,_0x12a927){if(_0x233b0c){return _0x48faf0(_0x233b0c);}else{return _0x423d81(_0x12a927);}});});}function checkTranscribeJob(_0x3cdc0f,_0x286a5a,_0xd6208e){var _0xf2a30e;return new BPromise(function(_0x18991b,_0x346fe5){logger['info'](util[_0xc4b6('0x9')](_0xc4b6('0xa'),_0x3cdc0f['id'],_0x3cdc0f['transcribeName']));return getTranscriptionJob(_0xd6208e[_0xc4b6('0xb')],_0xd6208e['data2'],_0x286a5a[_0xc4b6('0xc')],_0x3cdc0f[_0xc4b6('0xd')])[_0xc4b6('0xe')](function(_0x23144b){logger['info'](util['format'](_0xc4b6('0xf'),_0x3cdc0f['id'],_0x3cdc0f[_0xc4b6('0xd')],_0x23144b[_0xc4b6('0x10')][_0xc4b6('0x11')]));if(!_0x3cdc0f[_0xc4b6('0x12')]){switch(_0x23144b[_0xc4b6('0x10')][_0xc4b6('0x11')]){case _0xc4b6('0x13'):var _0x3342b9={'transcribeStatus':_0x23144b[_0xc4b6('0x10')][_0xc4b6('0x11')],'fileUri':_0x23144b[_0xc4b6('0x10')]['Transcript'][_0xc4b6('0x14')]};logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x16'),_0x3cdc0f['id']));return rp({'uri':_0x23144b[_0xc4b6('0x10')][_0xc4b6('0x17')][_0xc4b6('0x14')],'json':!![]})[_0xc4b6('0xe')](function(_0x51090f){logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x18'),_0x3cdc0f['id']));if(_0x51090f&&_0x51090f[_0xc4b6('0x19')]&&_0x51090f[_0xc4b6('0x19')][_0xc4b6('0x1a')]&&_0x51090f[_0xc4b6('0x19')][_0xc4b6('0x1a')][_0xc4b6('0x1b')]){_0x3342b9['fileText']='';for(var _0x5a6eff=0x0;_0x5a6eff<_0x51090f['results'][_0xc4b6('0x1a')][_0xc4b6('0x1b')];_0x5a6eff++){_0x3342b9['fileText']+=_0x51090f[_0xc4b6('0x19')][_0xc4b6('0x1a')][_0x5a6eff]['transcript']+'';}}return _0x3cdc0f[_0xc4b6('0x1c')](_0x3342b9);})[_0xc4b6('0xe')](function(){logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x1d'),_0x3cdc0f['id']));if(!_0x3cdc0f[_0xc4b6('0x1e')]){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x21'));}if(!_0x286a5a[_0xc4b6('0x22')]||!_0x286a5a['sentimentAccountId']||!_0x286a5a[_0xc4b6('0x23')]||!_0x286a5a[_0xc4b6('0x24')]||!_0x286a5a[_0xc4b6('0x25')]){throw new db['Sequelize']['ValidationError'](_0xc4b6('0x26'));}if(!_0x3342b9['fileText']){throw new Error(_0xc4b6('0x27'));}if(_0x286a5a[_0xc4b6('0x28')]===_0xd6208e['id']){return _0xd6208e;}else{return db[_0xc4b6('0x29')]['findOne']({'where':{'id':_settings[_0xc4b6('0x28')]}});}})[_0xc4b6('0xe')](function(_0x4e5ced){if(!_0x4e5ced){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x2a'));}if(!_0x4e5ced['data1']||!_0x4e5ced['data2']){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0xf2a30e=_0x4e5ced;logger[_0xc4b6('0x15')](util['format'](_0xc4b6('0x2b'),_0x3cdc0f['id']));return sentiment(_0xf2a30e[_0xc4b6('0xb')],_0xf2a30e[_0xc4b6('0x2c')],_0x286a5a[_0xc4b6('0x23')],_0x3342b9[_0xc4b6('0x12')],_0x286a5a[_0xc4b6('0x24')]);})[_0xc4b6('0xe')](function(_0x53d82d){logger['info'](util['format'](_0xc4b6('0x2d'),_0x3cdc0f['id']));return _0x3cdc0f[_0xc4b6('0x1c')]({'sentiment':_0x53d82d[_0xc4b6('0x2e')],'sPositive':_0x53d82d[_0xc4b6('0x2f')]['Positive'],'sNegative':_0x53d82d['SentimentScore'][_0xc4b6('0x30')],'sMixed':_0x53d82d[_0xc4b6('0x2f')][_0xc4b6('0x31')],'sNeutral':_0x53d82d[_0xc4b6('0x2f')][_0xc4b6('0x32')]});})[_0xc4b6('0xe')](function(){logger[_0xc4b6('0x15')](util['format'](_0xc4b6('0x1d'),_0x3cdc0f['id']));_0x18991b();});case _0xc4b6('0x33'):return _0x3cdc0f['update']({'transcribeStatus':_0xc4b6('0x33'),'failureReason':_0x23144b[_0xc4b6('0x10')][_0xc4b6('0x34')]})[_0xc4b6('0xe')](function(){logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x1d'),_0x3cdc0f['id']));_0x18991b();});default:logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3cdc0f['id']));break;}}else{return BPromise[_0xc4b6('0x35')]()['then'](function(){if(!_0x3cdc0f[_0xc4b6('0x1e')]){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x286a5a[_0xc4b6('0x22')]||!_0x286a5a[_0xc4b6('0x28')]||!_0x286a5a[_0xc4b6('0x23')]||!_0x286a5a[_0xc4b6('0x24')]||!_0x286a5a['bucket']){throw new db['Sequelize'][(_0xc4b6('0x20'))](_0xc4b6('0x26'));}if(!_0x3cdc0f[_0xc4b6('0x12')]){throw new Error(_0xc4b6('0x27'));}if(_0x286a5a[_0xc4b6('0x28')]===_0xd6208e['id']){return _0xd6208e;}else{return db['CloudProvider'][_0xc4b6('0x36')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1d8ba0){if(!_0x1d8ba0){throw new db['Sequelize'][(_0xc4b6('0x20'))](_0xc4b6('0x2a'));}if(!_0x1d8ba0[_0xc4b6('0xb')]||!_0x1d8ba0['data2']){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x37'));}_0xf2a30e=_0x1d8ba0;logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x2b'),_0x3cdc0f['id']));return sentiment(_0xf2a30e['data1'],_0xf2a30e['data2'],_0x286a5a[_0xc4b6('0x23')],_0x3cdc0f[_0xc4b6('0x12')],_0x286a5a['language']);})['then'](function(_0x5af016){logger[_0xc4b6('0x15')](util[_0xc4b6('0x9')](_0xc4b6('0x2d'),_0x3cdc0f['id']));return _0x3cdc0f[_0xc4b6('0x1c')]({'sentiment':_0x5af016[_0xc4b6('0x2e')],'sPositive':_0x5af016[_0xc4b6('0x2f')][_0xc4b6('0x38')],'sNegative':_0x5af016['SentimentScore'][_0xc4b6('0x30')],'sMixed':_0x5af016[_0xc4b6('0x2f')][_0xc4b6('0x31')],'sNeutral':_0x5af016[_0xc4b6('0x2f')][_0xc4b6('0x32')],'transcribeStatus':_0xc4b6('0x13')});})[_0xc4b6('0xe')](function(){logger['info'](util['format'](_0xc4b6('0x1d'),_0x3cdc0f['id']));_0x18991b();});}})[_0xc4b6('0x39')](function(_0x1a2c1c){if(_0x1a2c1c){if(!_0x1a2c1c[_0xc4b6('0x3a')]||_0x1a2c1c['name']!==_0xc4b6('0x3b')){logger[_0xc4b6('0x3c')](util[_0xc4b6('0x9')](_0xc4b6('0x3d'),_0x3cdc0f['id']),util['inspect'](_0x1a2c1c,{'showHidden':![],'depth':null}));}}_0x18991b();});});}function checkTranscribe(){var _0x257856;var _0x54632d;var _0x1b66b5;return db[_0xc4b6('0x3e')]['findAll']({'where':{'transcribeStatus':_0xc4b6('0x3f')}})['then'](function(_0x30ef5e){if(!_0x30ef5e||!_0x30ef5e[_0xc4b6('0x1b')]){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x40'));}_0x257856=_0x30ef5e;return db['Setting'][_0xc4b6('0x36')]({'where':{'id':0x1}});})[_0xc4b6('0xe')](function(_0x444b8b){if(!_0x444b8b){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x41'));}_0x54632d=_0x444b8b;if(!_0x54632d[_0xc4b6('0x5')]||!_0x54632d[_0xc4b6('0x42')]||!_0x54632d[_0xc4b6('0xc')]||!_0x54632d['language']||!_0x54632d[_0xc4b6('0x25')]){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x43'));}return db[_0xc4b6('0x29')][_0xc4b6('0x36')]({'where':{'id':_0x54632d[_0xc4b6('0x42')]}});})[_0xc4b6('0xe')](function(_0x56d6d7){if(!_0x56d6d7){throw new db['Sequelize'][(_0xc4b6('0x20'))](_0xc4b6('0x2a'));}if(!_0x56d6d7['data1']||!_0x56d6d7[_0xc4b6('0x2c')]){throw new db[(_0xc4b6('0x1f'))][(_0xc4b6('0x20'))](_0xc4b6('0x37'));}_0x1b66b5=_0x56d6d7;var _0x42c2b3=[];_0x257856['forEach'](function(_0x2e3b21){_0x42c2b3[_0xc4b6('0x44')](checkTranscribeJob(_0x2e3b21,_0x54632d,_0x1b66b5));});return BPromise['all'](_0x42c2b3);})[_0xc4b6('0x39')](function(_0x3325b1){if(_0x3325b1){if(!_0x3325b1['name']||_0x3325b1['name']!==_0xc4b6('0x3b')){logger['error'](util['inspect'](_0x3325b1,{'showHidden':![],'depth':null}));}}});}exports[_0xc4b6('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 1e2bf39..c3f0582 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 _0xf7cd=['redis','WhatsappInteraction','findAll','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../logger','schedule'];(function(_0x327184,_0x40082c){var _0x2777f4=function(_0x310628){while(--_0x310628){_0x327184['push'](_0x327184['shift']());}};_0x2777f4(++_0x40082c);}(_0xf7cd,0x158));var _0xdf7c=function(_0x361da,_0x25a28e){_0x361da=_0x361da-0x0;var _0x2efbd1=_0xf7cd[_0x361da];return _0x2efbd1;};'use strict';var _=require(_0xdf7c('0x0'));var moment=require(_0xdf7c('0x1'));var Redis=require(_0xdf7c('0x2'));var util=require(_0xdf7c('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xdf7c('0x4'))(_0xdf7c('0x5'));config['redis']=_['defaults'](config[_0xdf7c('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x556f3e=[];return db[_0xdf7c('0x7')][_0xdf7c('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xdf7c('0x9'))}}})['then'](function(_0xb08770){if(_0xb08770&&_0xb08770[_0xdf7c('0xa')]){_0x556f3e=_[_0xdf7c('0xb')](_0xb08770||[],'id');logger[_0xdf7c('0xc')](_0xdf7c('0xd'),_0x556f3e['join']());return db[_0xdf7c('0x7')][_0xdf7c('0xe')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xdf7c('0xf')](_0xdf7c('0x10'))},{'where':{'id':_0x556f3e}});}})[_0xdf7c('0x11')](function(){if(_0x556f3e&&_0x556f3e[_0xdf7c('0xa')]){logger[_0xdf7c('0xc')](_0xdf7c('0x12'),_0x556f3e['join']());for(var _0x1e5923=0x0;_0x1e5923<_0x556f3e['length'];_0x1e5923++){io[_0xdf7c('0x13')](_0xdf7c('0x14'),{'id':_0x556f3e[_0x1e5923],'closed':!![]});}}})[_0xdf7c('0x15')](function(_0x568bb8){logger[_0xdf7c('0x16')](_0xdf7c('0x17'),_0x568bb8?util[_0xdf7c('0x18')](_0x568bb8,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe0c1=['WhatsappInteraction','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x4d6b49,_0x309a58){var _0x205fb4=function(_0x54ec15){while(--_0x54ec15){_0x4d6b49['push'](_0x4d6b49['shift']());}};_0x205fb4(++_0x309a58);}(_0xe0c1,0x175));var _0x1e0c=function(_0xa49fc7,_0x3a4eca){_0xa49fc7=_0xa49fc7-0x0;var _0x128493=_0xe0c1[_0xa49fc7];return _0x128493;};'use strict';var _=require(_0x1e0c('0x0'));var moment=require(_0x1e0c('0x1'));var Redis=require(_0x1e0c('0x2'));var util=require(_0x1e0c('0x3'));var config=require(_0x1e0c('0x4'));var db=require(_0x1e0c('0x5'))['db'];var logger=require(_0x1e0c('0x6'))(_0x1e0c('0x7'));config[_0x1e0c('0x8')]=_[_0x1e0c('0x9')](config['redis'],{'host':_0x1e0c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1e0c('0x8')]));function closeInteractions(){var _0x2f5293=[];return db[_0x1e0c('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1e0c('0xc')](0x18,'hours')}}})[_0x1e0c('0xd')](function(_0xc44194){if(_0xc44194&&_0xc44194[_0x1e0c('0xe')]){_0x2f5293=_[_0x1e0c('0xf')](_0xc44194||[],'id');logger[_0x1e0c('0x10')](_0x1e0c('0x11'),_0x2f5293[_0x1e0c('0x12')]());return db['WhatsappInteraction'][_0x1e0c('0x13')]({'closeReason':_0x1e0c('0x14'),'disposition':_0x1e0c('0x15'),'closed':!![],'closedAt':moment()[_0x1e0c('0x16')](_0x1e0c('0x17'))},{'where':{'id':_0x2f5293}});}})['then'](function(){if(_0x2f5293&&_0x2f5293[_0x1e0c('0xe')]){logger[_0x1e0c('0x10')](_0x1e0c('0x18'),_0x2f5293[_0x1e0c('0x12')]());for(var _0x35543a=0x0;_0x35543a<_0x2f5293[_0x1e0c('0xe')];_0x35543a++){io[_0x1e0c('0x19')](_0x1e0c('0x1a'),{'id':_0x2f5293[_0x35543a],'closed':!![]});}}})[_0x1e0c('0x1b')](function(_0x38416d){logger[_0x1e0c('0x1c')](_0x1e0c('0x1d'),_0x38416d?util[_0x1e0c('0x1e')](_0x38416d,{'showHidden':![],'depth':null}):'');});}exports[_0x1e0c('0x1f')]=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 963f2a8..dd737db 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x882b=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','contacts1','CmHopper','destroy','then','bulkCreate','log','hopper1','contacts2'];(function(_0x5b9fa1,_0x4dd147){var _0x4caa03=function(_0x2c0bf9){while(--_0x2c0bf9){_0x5b9fa1['push'](_0x5b9fa1['shift']());}};_0x4caa03(++_0x4dd147);}(_0x882b,0x158));var _0xb882=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x882b[_0x422905];return _0x33dc6c;};'use strict';var util=require(_0xb882('0x0'));var db=require(_0xb882('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb882('0x2')]({'id':i,'firstName':_0xb882('0x3')+i,'lastName':_0xb882('0x4')+i,'phone':0xf879fb460+i,'email':_0xb882('0x5')+i+_0xb882('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb882('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb882('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb882('0x2')]({'id':i,'firstName':_0xb882('0x3')+i,'lastName':_0xb882('0x4')+i,'phone':0xf879fb460+i,'email':_0xb882('0x5')+i+_0xb882('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb882('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb882('0x7')](),'updatedAt':Date[_0xb882('0x7')]()});}db[_0xb882('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0xb882('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log']('finished\x20populating',_0xb882('0x9'));return db[_0xb882('0xa')][_0xb882('0xb')]({'where':{}});})[_0xb882('0xc')](function(){return db[_0xb882('0xa')][_0xb882('0xd')](hopper);})['then'](function(){console[_0xb882('0xe')]('finished\x20populating',_0xb882('0xf'));return db[_0xb882('0x8')]['bulkCreate'](contacts2);})[_0xb882('0xc')](function(){console['log']('finished\x20populating',_0xb882('0x10'));return db[_0xb882('0xa')][_0xb882('0xd')](hopper2);})[_0xb882('0xc')](function(){console[_0xb882('0xe')]('finished\x20populating',_0xb882('0x11'));})[_0xb882('0x12')](function(_0x5c09fb){console['log'](_0x5c09fb);}); \ No newline at end of file +var _0x3410=['Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','then','log','finished\x20populating','contacts1','CmHopper','hopper1','bulkCreate','contacts2','catch','util','push'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3410,0x185));var _0x0341=function(_0x4e2ef8,_0x470bb6){_0x4e2ef8=_0x4e2ef8-0x0;var _0x3416e7=_0x3410[_0x4e2ef8];return _0x3416e7;};'use strict';var util=require(_0x0341('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0341('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0341('0x2')+i,'phone':0xf879fb460+i,'email':_0x0341('0x3')+i+_0x0341('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0341('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0341('0x1')]({'id':i,'firstName':_0x0341('0x6')+i,'lastName':_0x0341('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0341('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0341('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0341('0x5')](),'updatedAt':Date[_0x0341('0x5')]()});}db[_0x0341('0x7')]['destroy']({'where':{}})[_0x0341('0x8')](function(){return db[_0x0341('0x7')]['bulkCreate'](contacts);})[_0x0341('0x8')](function(){console[_0x0341('0x9')](_0x0341('0xa'),_0x0341('0xb'));return db['CmHopper']['destroy']({'where':{}});})[_0x0341('0x8')](function(){return db[_0x0341('0xc')]['bulkCreate'](hopper);})[_0x0341('0x8')](function(){console[_0x0341('0x9')]('finished\x20populating',_0x0341('0xd'));return db['CmContact'][_0x0341('0xe')](contacts2);})[_0x0341('0x8')](function(){console[_0x0341('0x9')](_0x0341('0xa'),_0x0341('0xf'));return db[_0x0341('0xc')][_0x0341('0xe')](hopper2);})[_0x0341('0x8')](function(){console['log'](_0x0341('0xa'),'hopper2');})[_0x0341('0x10')](function(_0x4b4229){console['log'](_0x4b4229);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 6200fa1..d5160ec 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3f=['agent','%s%s@xcally.com','password','udp','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s'];(function(_0xeb98d9,_0xb72efc){var _0x1859ce=function(_0x1f4e78){while(--_0x1f4e78){_0xeb98d9['push'](_0xeb98d9['shift']());}};_0x1859ce(++_0xb72efc);}(_0x0b3f,0x8c));var _0xf0b3=function(_0x3e5794,_0x1aaf0b){_0x3e5794=_0x3e5794-0x0;var _0x108241=_0x0b3f[_0x3e5794];return _0x108241;};'use strict';var util=require(_0xf0b3('0x0'));var db=require(_0xf0b3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xf0b3('0x2')](_0xf0b3('0x3'),'agent',i),'fullname':util[_0xf0b3('0x2')](_0xf0b3('0x3'),_0xf0b3('0x4'),i),'email':util[_0xf0b3('0x2')](_0xf0b3('0x5'),_0xf0b3('0x4'),i),'role':_0xf0b3('0x4'),'password':_0xf0b3('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xf0b3('0x7'),'ws','wss'],'disallow':['all'],'allow':[_0xf0b3('0x8')],'defaultuser':util[_0xf0b3('0x2')](_0xf0b3('0x3'),_0xf0b3('0x4'),i),'encryption':_0xf0b3('0x9'),'avpf':_0xf0b3('0x9'),'force_avp':'yes','icesupport':_0xf0b3('0x9'),'dtlsenable':_0xf0b3('0x9'),'dtlsverify':'no','dtlscertfile':_0xf0b3('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf0b3('0xb'),'callerid':util[_0xf0b3('0x2')](_0xf0b3('0xc'),util[_0xf0b3('0x2')]('%s%s',_0xf0b3('0x4'),i),0xfa0+i)});}db['User'][_0xf0b3('0xd')](users)[_0xf0b3('0xe')](function(){console[_0xf0b3('0xf')](_0xf0b3('0x10'));})[_0xf0b3('0x11')](function(_0xf0e953){console[_0xf0b3('0xf')](_0xf0e953);}); \ No newline at end of file +var _0x6a8e=['%s%s','yes','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','../mysqldb','push','format','%s%s@xcally.com','agent','password','udp','wss','all','ulaw'];(function(_0x29abcd,_0x579fea){var _0x104b63=function(_0x194d41){while(--_0x194d41){_0x29abcd['push'](_0x29abcd['shift']());}};_0x104b63(++_0x579fea);}(_0x6a8e,0x1a6));var _0xe6a8=function(_0x21d650,_0x34649d){_0x21d650=_0x21d650-0x0;var _0x5e50a3=_0x6a8e[_0x21d650];return _0x5e50a3;};'use strict';var util=require('util');var db=require(_0xe6a8('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe6a8('0x1')]({'name':util[_0xe6a8('0x2')]('%s%s','agent',i),'fullname':util[_0xe6a8('0x2')]('%s%s','agent',i),'email':util[_0xe6a8('0x2')](_0xe6a8('0x3'),_0xe6a8('0x4'),i),'role':_0xe6a8('0x4'),'password':_0xe6a8('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xe6a8('0x6'),'ws',_0xe6a8('0x7')],'disallow':[_0xe6a8('0x8')],'allow':[_0xe6a8('0x9')],'defaultuser':util[_0xe6a8('0x2')](_0xe6a8('0xa'),'agent',i),'encryption':_0xe6a8('0xb'),'avpf':_0xe6a8('0xb'),'force_avp':_0xe6a8('0xb'),'icesupport':_0xe6a8('0xb'),'dtlsenable':_0xe6a8('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xe6a8('0xc'),'callerid':util[_0xe6a8('0x2')](_0xe6a8('0xd'),util[_0xe6a8('0x2')](_0xe6a8('0xa'),_0xe6a8('0x4'),i),0xfa0+i)});}db['User'][_0xe6a8('0xe')](users)[_0xe6a8('0xf')](function(){console[_0xe6a8('0x10')](_0xe6a8('0x11'));})['catch'](function(_0x1298e9){console[_0xe6a8('0x10')](_0x1298e9);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4189a4f..fe6c64b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15ef=['WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','fax','sms','mail','openchannel','whatsapp','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','map','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','join','default','setMaxListeners','address','remoteAddress','request','connection','log','disconnect','util','bluebird','./environment','name','Agents','User','agent','type','UserProfileSection','autoAssociation','VoiceQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','role','telephone','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','user','voice:inbound','ChatQueue','FaxQueues','FaxQueue','SmsQueues'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x15ef,0x80));var _0xf15e=function(_0x59b59d,_0x5aae5e){_0x59b59d=_0x59b59d-0x0;var _0x5991a7=_0x15ef[_0x59b59d];return _0x5991a7;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var BPromise=require(_0xf15e('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xf15e('0x2'));var queryQueues={'attributes':['id',_0xf15e('0x3')],'include':[{'as':_0xf15e('0x4'),'model':db[_0xf15e('0x5')],'attributes':['id',_0xf15e('0x3'),'role'],'raw':!![],'where':{'role':_0xf15e('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf15e('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xf15e('0x3')],'where':{'role':_0xf15e('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xf15e('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x1168c3,_0x264f5e,_0x16fedb){return db[_0xf15e('0x8')]['findOne']({'where':{'name':_0x1168c3,'userProfileId':_0x264f5e},'raw':!![]})['then'](function(_0x5a14f5){if(_0x5a14f5){if(_0x5a14f5[_0xf15e('0x9')]){switch(_0x1168c3){case _0xf15e('0xa'):case'ChatQueues':case'FaxQueues':case'SmsQueues':case _0xf15e('0xb'):case _0xf15e('0xc'):case _0xf15e('0xd'):return db[_0x16fedb]['findAll'](queryQueues);case _0xf15e('0xe'):return db[_0x16fedb][_0xf15e('0xf')](queryTelephones);case _0xf15e('0x10'):return db[_0x16fedb]['findAll'](queryTrunks);case _0xf15e('0x11'):return db[_0x16fedb][_0xf15e('0xf')](queryCampaigns);}}else{return db[_0xf15e('0x12')][_0xf15e('0xf')]({'attributes':[_0xf15e('0x13')],'where':{'sectionId':_0x5a14f5['id']},'raw':!![]})[_0xf15e('0x14')](function(_0x17c241){if(_0x17c241){var _0x2d6bd7={'where':{'id':_['map'](_0x17c241,_0xf15e('0x13'))},'raw':!![]};switch(_0x16fedb){case _0xf15e('0x5'):_0x2d6bd7['where'][_0xf15e('0x15')]=_0xf15e('0x16');break;case _0xf15e('0x17'):_0x2d6bd7['where']['type']=_0xf15e('0x18');break;}return db[_0x16fedb][_0xf15e('0xf')](_0x2d6bd7);}else{return[];}});}}else{return[];}})['then'](function(_0x86d14f){return _0x86d14f;});}function joinOrLeaveQueues(_0x1f1f33,_0xa47259,_0x4b144c,_0x4d78cd){_0x1f1f33[_0xa47259](util[_0xf15e('0x19')](_0xf15e('0x1a'),_0x4b144c,_0x4d78cd['name']));if(_0x4d78cd[_0xf15e('0x4')]){for(var _0x56e8c9=0x0;_0x56e8c9<_0x4d78cd['Agents'][_0xf15e('0x1b')];_0x56e8c9+=0x1){_0x1f1f33[_0xa47259](util[_0xf15e('0x19')](_0xf15e('0x1c'),_0x4d78cd[_0xf15e('0x4')][_0x56e8c9]['name']));}}}function joinOrLeave(_0x2b9d85,_0xa09c0c,_0x302b70){var _0x51c06a;if(_0x2b9d85[_0xf15e('0x1d')][_0xf15e('0x1e')]['id']){db['User']['find']({'attributes':['id',_0xf15e('0x3'),_0xf15e('0x15'),_0xf15e('0x1f')],'where':{'id':_0x2b9d85[_0xf15e('0x1d')][_0xf15e('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf15e('0x20')],'as':_0xf15e('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xf15e('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xf15e('0x23')],'as':_0xf15e('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xf15e('0x25')],'as':_0xf15e('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xf15e('0x27')],'as':_0xf15e('0x28'),'attributes':['id'],'raw':!![]}]})[_0xf15e('0x14')](function(_0x5dd9cf){if(_0x5dd9cf){_0x51c06a=_0x5dd9cf;_0x2b9d85[_0xa09c0c](util[_0xf15e('0x19')](_0xf15e('0x1c'),_0x5dd9cf[_0xf15e('0x3')]));var _0x551444=[];switch(_0x5dd9cf[_0xf15e('0x15')]){case _0xf15e('0x29'):_0x2b9d85[_0xa09c0c]('voice:inbound');_0x2b9d85[_0xa09c0c](_0xf15e('0x2a'));if(queryQueues[_0xf15e('0x2b')](_0xf15e('0x2c'))){delete queryQueues['include'];}_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x2e')][_0xf15e('0xf')](queryQueues));_0x551444[_0xf15e('0x2d')](db['ChatQueue'][_0xf15e('0xf')](queryQueues));_0x551444[_0xf15e('0x2d')](db['FaxQueue'][_0xf15e('0xf')](queryQueues));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x2f')]['findAll'](queryQueues));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x30')]['findAll'](queryQueues));_0x551444[_0xf15e('0x2d')](db['OpenchannelQueue'][_0xf15e('0xf')](queryQueues));_0x551444[_0xf15e('0x2d')](db['WhatsappQueue']['findAll'](queryQueues));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x5')]['findAll'](queryTelephones));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x31')][_0xf15e('0xf')](queryTrunks));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x17')][_0xf15e('0xf')](queryCampaigns));_0x551444['push'](db[_0xf15e('0x5')][_0xf15e('0xf')](queryAgents));break;case _0xf15e('0x32'):_0x2b9d85[_0xa09c0c](_0xf15e('0x33'));_0x2b9d85[_0xa09c0c](_0xf15e('0x2a'));_0x551444[_0xf15e('0x2d')](getAssociatedResources(_0xf15e('0xa'),_0x5dd9cf[_0xf15e('0x1f')],'VoiceQueue'));_0x551444[_0xf15e('0x2d')](getAssociatedResources('ChatQueues',_0x5dd9cf[_0xf15e('0x1f')],_0xf15e('0x34')));_0x551444[_0xf15e('0x2d')](getAssociatedResources(_0xf15e('0x35'),_0x5dd9cf[_0xf15e('0x1f')],_0xf15e('0x36')));_0x551444['push'](getAssociatedResources(_0xf15e('0x37'),_0x5dd9cf[_0xf15e('0x1f')],_0xf15e('0x2f')));_0x551444[_0xf15e('0x2d')](getAssociatedResources('MailQueues',_0x5dd9cf['userProfileId'],_0xf15e('0x30')));_0x551444[_0xf15e('0x2d')](getAssociatedResources(_0xf15e('0xc'),_0x5dd9cf['userProfileId'],'OpenchannelQueue'));_0x551444['push'](getAssociatedResources('WhatsappQueues',_0x5dd9cf['userProfileId'],_0xf15e('0x38')));_0x551444[_0xf15e('0x2d')](getAssociatedResources(_0xf15e('0xe'),_0x5dd9cf['userProfileId'],_0xf15e('0x5')));_0x551444['push'](getAssociatedResources(_0xf15e('0x10'),_0x5dd9cf[_0xf15e('0x1f')],_0xf15e('0x31')));_0x551444[_0xf15e('0x2d')](getAssociatedResources('IvrCampaigns',_0x5dd9cf[_0xf15e('0x1f')],_0xf15e('0x17')));_0x551444[_0xf15e('0x2d')](db[_0xf15e('0x5')][_0xf15e('0xf')](queryAgents));break;case'agent':_0x2b9d85[_0xa09c0c](_0xf15e('0x33'));_0x2b9d85[_0xa09c0c](_0xf15e('0x2a'));_0x551444[_0xf15e('0x2d')](_0x5dd9cf[_0xf15e('0x39')]({'attributes':['id',_0xf15e('0x3')]}));_0x551444[_0xf15e('0x2d')](_0x5dd9cf[_0xf15e('0x3a')]({'attributes':['id','name']}));_0x551444[_0xf15e('0x2d')](_0x5dd9cf[_0xf15e('0x3b')]({'attributes':['id','name']}));_0x551444['push'](_0x5dd9cf[_0xf15e('0x3c')]({'attributes':['id','name']}));_0x551444['push'](_0x5dd9cf[_0xf15e('0x3d')]({'attributes':['id',_0xf15e('0x3')]}));_0x551444['push'](_0x5dd9cf[_0xf15e('0x3e')]({'attributes':['id',_0xf15e('0x3')]}));_0x551444[_0xf15e('0x2d')](_0x5dd9cf[_0xf15e('0x3f')]({'attributes':['id',_0xf15e('0x3')]}));break;}return BPromise[_0xf15e('0x40')](_0x551444);}})[_0xf15e('0x14')](function(_0x305d74){if(_0x305d74&&_0x305d74[_0xf15e('0x1b')]){for(var _0x4fd67c=0x0;_0x4fd67c<_0x305d74[_0xf15e('0x1b')];_0x4fd67c+=0x1){for(var _0x44f075=0x0;_0x44f075<_0x305d74[_0x4fd67c][_0xf15e('0x1b')];_0x44f075+=0x1){switch(_0x4fd67c){case 0x0:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,'voice',_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x1:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,'chat',_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x2:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,_0xf15e('0x41'),_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x3:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,_0xf15e('0x42'),_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x4:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,_0xf15e('0x43'),_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x5:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,_0xf15e('0x44'),_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x6:joinOrLeaveQueues(_0x2b9d85,_0xa09c0c,_0xf15e('0x45'),_0x305d74[_0x4fd67c][_0x44f075]);break;case 0x7:if(_0x51c06a[_0xf15e('0x15')]!==_0xf15e('0x6'))_0x2b9d85[_0xa09c0c](util[_0xf15e('0x19')]('telephone:%s',_0x305d74[_0x4fd67c][_0x44f075][_0xf15e('0x3')]));break;case 0x8:if(_0x51c06a[_0xf15e('0x15')]!=='agent')_0x2b9d85[_0xa09c0c](util[_0xf15e('0x19')]('trunk:%s',_0x305d74[_0x4fd67c][_0x44f075][_0xf15e('0x3')]));break;case 0x9:if(_0x51c06a[_0xf15e('0x15')]!==_0xf15e('0x6'))_0x2b9d85[_0xa09c0c](util['format'](_0xf15e('0x46'),_0x305d74[_0x4fd67c][_0x44f075][_0xf15e('0x7')],_0x305d74[_0x4fd67c][_0x44f075][_0xf15e('0x3')]));break;case 0xa:_0x2b9d85[_0xa09c0c](util[_0xf15e('0x19')](_0xf15e('0x1c'),_0x305d74[_0x4fd67c][_0x44f075][_0xf15e('0x3')]));break;}}}}})[_0xf15e('0x14')](function(){if(_0xa09c0c===_0xf15e('0x47')){var _0x7961=_['map'](_0x51c06a[_0xf15e('0x48')],'id');return _0x51c06a[_0xf15e('0x49')](_0x7961)[_0xf15e('0x14')](function(){for(var _0x134443=0x0;_0x134443<_0x7961[_0xf15e('0x1b')];_0x134443+=0x1){_0x302b70['emit'](_0xf15e('0x4a'),{'ChatInteractionId':Number(_0x7961[_0x134443]),'UserId':Number(_0x51c06a['id'])});}});}})[_0xf15e('0x14')](function(){if(_0xa09c0c===_0xf15e('0x47')){var _0x25827b=_[_0xf15e('0x4b')](_0x51c06a[_0xf15e('0x21')],'id');return _0x51c06a[_0xf15e('0x4c')](_0x25827b)[_0xf15e('0x14')](function(){for(var _0x24b899=0x0;_0x24b899<_0x25827b[_0xf15e('0x1b')];_0x24b899+=0x1){_0x302b70[_0xf15e('0x4d')](_0xf15e('0x4e'),{'MailInteractionId':Number(_0x25827b[_0x24b899]),'UserId':Number(_0x51c06a['id'])});}});}})['then'](function(){if(_0xa09c0c===_0xf15e('0x47')){var _0x40430e=_['map'](_0x51c06a['FaxInteractions'],'id');return _0x51c06a[_0xf15e('0x4f')](_0x40430e)[_0xf15e('0x14')](function(){for(var _0x59ba45=0x0;_0x59ba45<_0x40430e['length'];_0x59ba45+=0x1){_0x302b70[_0xf15e('0x4d')](_0xf15e('0x50'),{'FaxInteractionId':Number(_0x40430e[_0x59ba45]),'UserId':Number(_0x51c06a['id'])});}});}})[_0xf15e('0x14')](function(){if(_0xa09c0c===_0xf15e('0x47')){var _0x32da70=_[_0xf15e('0x4b')](_0x51c06a[_0xf15e('0x24')],'id');return _0x51c06a['removeSmsInteractions'](_0x32da70)['then'](function(){for(var _0x35ea97=0x0;_0x35ea97<_0x32da70['length'];_0x35ea97+=0x1){_0x302b70[_0xf15e('0x4d')](_0xf15e('0x51'),{'SmsInteractionId':Number(_0x32da70[_0x35ea97]),'UserId':Number(_0x51c06a['id'])});}});}})[_0xf15e('0x14')](function(){if(_0xa09c0c==='leave'){var _0x30b2f3=_[_0xf15e('0x4b')](_0x51c06a[_0xf15e('0x26')],'id');return _0x51c06a[_0xf15e('0x52')](_0x30b2f3)['then'](function(){for(var _0x515e56=0x0;_0x515e56<_0x30b2f3[_0xf15e('0x1b')];_0x515e56+=0x1){_0x302b70[_0xf15e('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x30b2f3[_0x515e56]),'UserId':Number(_0x51c06a['id'])});}});}})['then'](function(){if(_0xa09c0c===_0xf15e('0x47')){var _0x1eec69=_[_0xf15e('0x4b')](_0x51c06a[_0xf15e('0x28')],'id');return _0x51c06a['removeWhatsappInteractions'](_0x1eec69)['then'](function(){for(var _0x5e0ed1=0x0;_0x5e0ed1<_0x1eec69[_0xf15e('0x1b')];_0x5e0ed1+=0x1){_0x302b70[_0xf15e('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x1eec69[_0x5e0ed1]),'UserId':Number(_0x51c06a['id'])});}});}})['catch'](function(_0x1530af){_0x2b9d85['log'](_0x1530af);});}}function onDisconnect(_0x584a77,_0x5154b1){joinOrLeave(_0x584a77,'leave',_0x5154b1);}function onConnect(_0x4b1cd9){joinOrLeave(_0x4b1cd9,_0xf15e('0x53'));}exports[_0xf15e('0x54')]=function(_0xdfa8fa){_0xdfa8fa['on']('connection',function(_0x4979fd){_0x4979fd[_0xf15e('0x55')](0x0);_0x4979fd[_0xf15e('0x56')]=_0x4979fd['request']['connection'][_0xf15e('0x57')]+':'+_0x4979fd[_0xf15e('0x58')][_0xf15e('0x59')]['remotePort'];_0x4979fd['connectedAt']=new Date();_0x4979fd[_0xf15e('0x5a')]=function(_0x44cefb){console['log']('SocketIO\x20'+_0x4979fd['nsp']['name']+'['+_0x4979fd[_0xf15e('0x56')]+']',_0x44cefb);};_0x4979fd['on'](_0xf15e('0x5b'),function(){onDisconnect(_0x4979fd,_0xdfa8fa);_0x4979fd['log']('DISCONNECTED');});onConnect(_0x4979fd);_0x4979fd[_0xf15e('0x5a')]('CONNECTED');});}; \ No newline at end of file +var _0x9a3d=['user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','address','request','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','User','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','user','voice:outbound','VoiceQueue','ChatQueues','WhatsappQueue','Trunks','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','map','MailInteractions','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions'];(function(_0x48d923,_0x1fefcb){var _0x177e28=function(_0x2bb984){while(--_0x2bb984){_0x48d923['push'](_0x48d923['shift']());}};_0x177e28(++_0x1fefcb);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x45fee0,_0x10710d){_0x45fee0=_0x45fee0-0x0;var _0x35448f=_0x9a3d[_0x45fee0];return _0x35448f;};'use strict';var _=require('lodash');var util=require(_0xd9a3('0x0'));var BPromise=require(_0xd9a3('0x1'));var db=require(_0xd9a3('0x2'))['db'];var config=require(_0xd9a3('0x3'));var queryQueues={'attributes':['id',_0xd9a3('0x4')],'include':[{'as':_0xd9a3('0x5'),'model':db['User'],'attributes':['id',_0xd9a3('0x4'),_0xd9a3('0x6')],'raw':!![],'where':{'role':_0xd9a3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd9a3('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xd9a3('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xd9a3('0x4')],'where':{'role':_0xd9a3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd9a3('0x4'),_0xd9a3('0x8')],'where':{'type':_0xd9a3('0x9')}};function getAssociatedResources(_0x40d332,_0xbf948f,_0x4bff52){return db[_0xd9a3('0xa')][_0xd9a3('0xb')]({'where':{'name':_0x40d332,'userProfileId':_0xbf948f},'raw':!![]})[_0xd9a3('0xc')](function(_0x56fab5){if(_0x56fab5){if(_0x56fab5[_0xd9a3('0xd')]){switch(_0x40d332){case _0xd9a3('0xe'):case'ChatQueues':case _0xd9a3('0xf'):case _0xd9a3('0x10'):case _0xd9a3('0x11'):case _0xd9a3('0x12'):case _0xd9a3('0x13'):return db[_0x4bff52][_0xd9a3('0x14')](queryQueues);case _0xd9a3('0x15'):return db[_0x4bff52][_0xd9a3('0x14')](queryTelephones);case'Trunks':return db[_0x4bff52][_0xd9a3('0x14')](queryTrunks);case _0xd9a3('0x16'):return db[_0x4bff52][_0xd9a3('0x14')](queryCampaigns);}}else{return db[_0xd9a3('0x17')][_0xd9a3('0x14')]({'attributes':[_0xd9a3('0x18')],'where':{'sectionId':_0x56fab5['id']},'raw':!![]})[_0xd9a3('0xc')](function(_0x521ebe){if(_0x521ebe){var _0x2f497a={'where':{'id':_['map'](_0x521ebe,'resourceId')},'raw':!![]};switch(_0x4bff52){case _0xd9a3('0x19'):_0x2f497a['where']['role']=_0xd9a3('0x1a');break;case _0xd9a3('0x1b'):_0x2f497a['where']['type']='ivr';break;}return db[_0x4bff52]['findAll'](_0x2f497a);}else{return[];}});}}else{return[];}})['then'](function(_0xceca1c){return _0xceca1c;});}function joinOrLeaveQueues(_0x5bee91,_0x29f152,_0x36d503,_0x4eca09){_0x5bee91[_0x29f152](util[_0xd9a3('0x1c')](_0xd9a3('0x1d'),_0x36d503,_0x4eca09[_0xd9a3('0x4')]));if(_0x4eca09[_0xd9a3('0x5')]){for(var _0x2c2611=0x0;_0x2c2611<_0x4eca09[_0xd9a3('0x5')][_0xd9a3('0x1e')];_0x2c2611+=0x1){_0x5bee91[_0x29f152](util['format'](_0xd9a3('0x1f'),_0x4eca09[_0xd9a3('0x5')][_0x2c2611][_0xd9a3('0x4')]));}}}function joinOrLeave(_0x2be74a,_0x60818e,_0x3d562a){var _0x51c6d8;if(_0x2be74a[_0xd9a3('0x20')][_0xd9a3('0x21')]['id']){db[_0xd9a3('0x19')][_0xd9a3('0x22')]({'attributes':['id',_0xd9a3('0x4'),_0xd9a3('0x6'),_0xd9a3('0x23')],'where':{'id':_0x2be74a[_0xd9a3('0x20')]['query']['id']},'include':[{'model':db[_0xd9a3('0x24')],'as':_0xd9a3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9a3('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd9a3('0x27')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd9a3('0x28')],'as':_0xd9a3('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9a3('0x2a')],'as':_0xd9a3('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xd9a3('0x2c')],'as':_0xd9a3('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xd9a3('0xc')](function(_0x3c99f8){if(_0x3c99f8){_0x51c6d8=_0x3c99f8;_0x2be74a[_0x60818e](util['format'](_0xd9a3('0x1f'),_0x3c99f8[_0xd9a3('0x4')]));var _0xe0d8aa=[];switch(_0x3c99f8['role']){case _0xd9a3('0x2e'):_0x2be74a[_0x60818e](_0xd9a3('0x2f'));_0x2be74a[_0x60818e]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xd9a3('0x30'))){delete queryQueues[_0xd9a3('0x30')];}_0xe0d8aa[_0xd9a3('0x31')](db['VoiceQueue'][_0xd9a3('0x14')](queryQueues));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x32')][_0xd9a3('0x14')](queryQueues));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x33')]['findAll'](queryQueues));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x34')][_0xd9a3('0x14')](queryQueues));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x35')][_0xd9a3('0x14')](queryQueues));_0xe0d8aa['push'](db[_0xd9a3('0x36')][_0xd9a3('0x14')](queryQueues));_0xe0d8aa['push'](db['WhatsappQueue']['findAll'](queryQueues));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x19')]['findAll'](queryTelephones));_0xe0d8aa['push'](db['Trunk'][_0xd9a3('0x14')](queryTrunks));_0xe0d8aa[_0xd9a3('0x31')](db['Campaign'][_0xd9a3('0x14')](queryCampaigns));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x19')][_0xd9a3('0x14')](queryAgents));break;case _0xd9a3('0x37'):_0x2be74a[_0x60818e](_0xd9a3('0x2f'));_0x2be74a[_0x60818e](_0xd9a3('0x38'));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0xe'),_0x3c99f8['userProfileId'],_0xd9a3('0x39')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x3a'),_0x3c99f8[_0xd9a3('0x23')],_0xd9a3('0x32')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0xf'),_0x3c99f8[_0xd9a3('0x23')],_0xd9a3('0x33')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources('SmsQueues',_0x3c99f8['userProfileId'],_0xd9a3('0x34')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x11'),_0x3c99f8['userProfileId'],'MailQueue'));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x12'),_0x3c99f8[_0xd9a3('0x23')],_0xd9a3('0x36')));_0xe0d8aa['push'](getAssociatedResources('WhatsappQueues',_0x3c99f8[_0xd9a3('0x23')],_0xd9a3('0x3b')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x15'),_0x3c99f8[_0xd9a3('0x23')],_0xd9a3('0x19')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x3c'),_0x3c99f8['userProfileId'],_0xd9a3('0x3d')));_0xe0d8aa[_0xd9a3('0x31')](getAssociatedResources(_0xd9a3('0x16'),_0x3c99f8[_0xd9a3('0x23')],'Campaign'));_0xe0d8aa[_0xd9a3('0x31')](db[_0xd9a3('0x19')][_0xd9a3('0x14')](queryAgents));break;case _0xd9a3('0x7'):_0x2be74a[_0x60818e](_0xd9a3('0x2f'));_0x2be74a[_0x60818e](_0xd9a3('0x38'));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x3e')]({'attributes':['id',_0xd9a3('0x4')]}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x3f')]({'attributes':['id',_0xd9a3('0x4')]}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x40')]({'attributes':['id',_0xd9a3('0x4')]}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8['getSmsQueues']({'attributes':['id',_0xd9a3('0x4')]}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x41')]({'attributes':['id','name']}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x42')]({'attributes':['id',_0xd9a3('0x4')]}));_0xe0d8aa[_0xd9a3('0x31')](_0x3c99f8[_0xd9a3('0x43')]({'attributes':['id',_0xd9a3('0x4')]}));break;}return BPromise[_0xd9a3('0x44')](_0xe0d8aa);}})['then'](function(_0x5ba625){if(_0x5ba625&&_0x5ba625[_0xd9a3('0x1e')]){for(var _0x4555dc=0x0;_0x4555dc<_0x5ba625[_0xd9a3('0x1e')];_0x4555dc+=0x1){for(var _0x1fb550=0x0;_0x1fb550<_0x5ba625[_0x4555dc][_0xd9a3('0x1e')];_0x1fb550+=0x1){switch(_0x4555dc){case 0x0:joinOrLeaveQueues(_0x2be74a,_0x60818e,_0xd9a3('0x45'),_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x1:joinOrLeaveQueues(_0x2be74a,_0x60818e,_0xd9a3('0x46'),_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x2:joinOrLeaveQueues(_0x2be74a,_0x60818e,_0xd9a3('0x47'),_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x3:joinOrLeaveQueues(_0x2be74a,_0x60818e,_0xd9a3('0x48'),_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x4:joinOrLeaveQueues(_0x2be74a,_0x60818e,_0xd9a3('0x49'),_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x5:joinOrLeaveQueues(_0x2be74a,_0x60818e,'openchannel',_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x6:joinOrLeaveQueues(_0x2be74a,_0x60818e,'whatsapp',_0x5ba625[_0x4555dc][_0x1fb550]);break;case 0x7:if(_0x51c6d8[_0xd9a3('0x6')]!==_0xd9a3('0x7'))_0x2be74a[_0x60818e](util[_0xd9a3('0x1c')](_0xd9a3('0x4a'),_0x5ba625[_0x4555dc][_0x1fb550][_0xd9a3('0x4')]));break;case 0x8:if(_0x51c6d8[_0xd9a3('0x6')]!=='agent')_0x2be74a[_0x60818e](util[_0xd9a3('0x1c')](_0xd9a3('0x4b'),_0x5ba625[_0x4555dc][_0x1fb550][_0xd9a3('0x4')]));break;case 0x9:if(_0x51c6d8['role']!=='agent')_0x2be74a[_0x60818e](util[_0xd9a3('0x1c')](_0xd9a3('0x4c'),_0x5ba625[_0x4555dc][_0x1fb550]['type'],_0x5ba625[_0x4555dc][_0x1fb550][_0xd9a3('0x4')]));break;case 0xa:_0x2be74a[_0x60818e](util['format'](_0xd9a3('0x1f'),_0x5ba625[_0x4555dc][_0x1fb550]['name']));break;}}}}})[_0xd9a3('0xc')](function(){if(_0x60818e===_0xd9a3('0x4d')){var _0x2e114d=_['map'](_0x51c6d8[_0xd9a3('0x25')],'id');return _0x51c6d8[_0xd9a3('0x4e')](_0x2e114d)[_0xd9a3('0xc')](function(){for(var _0x58a484=0x0;_0x58a484<_0x2e114d[_0xd9a3('0x1e')];_0x58a484+=0x1){_0x3d562a['emit'](_0xd9a3('0x4f'),{'ChatInteractionId':Number(_0x2e114d[_0x58a484]),'UserId':Number(_0x51c6d8['id'])});}});}})[_0xd9a3('0xc')](function(){if(_0x60818e===_0xd9a3('0x4d')){var _0x15bea9=_[_0xd9a3('0x50')](_0x51c6d8[_0xd9a3('0x51')],'id');return _0x51c6d8[_0xd9a3('0x52')](_0x15bea9)['then'](function(){for(var _0x3cef8f=0x0;_0x3cef8f<_0x15bea9['length'];_0x3cef8f+=0x1){_0x3d562a[_0xd9a3('0x53')](_0xd9a3('0x54'),{'MailInteractionId':Number(_0x15bea9[_0x3cef8f]),'UserId':Number(_0x51c6d8['id'])});}});}})['then'](function(){if(_0x60818e===_0xd9a3('0x4d')){var _0x2eae61=_[_0xd9a3('0x50')](_0x51c6d8[_0xd9a3('0x55')],'id');return _0x51c6d8['removeFaxInteractions'](_0x2eae61)[_0xd9a3('0xc')](function(){for(var _0x4ce2a4=0x0;_0x4ce2a4<_0x2eae61[_0xd9a3('0x1e')];_0x4ce2a4+=0x1){_0x3d562a[_0xd9a3('0x53')](_0xd9a3('0x56'),{'FaxInteractionId':Number(_0x2eae61[_0x4ce2a4]),'UserId':Number(_0x51c6d8['id'])});}});}})[_0xd9a3('0xc')](function(){if(_0x60818e===_0xd9a3('0x4d')){var _0x345bc5=_[_0xd9a3('0x50')](_0x51c6d8[_0xd9a3('0x29')],'id');return _0x51c6d8[_0xd9a3('0x57')](_0x345bc5)[_0xd9a3('0xc')](function(){for(var _0x1e5aa2=0x0;_0x1e5aa2<_0x345bc5[_0xd9a3('0x1e')];_0x1e5aa2+=0x1){_0x3d562a[_0xd9a3('0x53')](_0xd9a3('0x58'),{'SmsInteractionId':Number(_0x345bc5[_0x1e5aa2]),'UserId':Number(_0x51c6d8['id'])});}});}})[_0xd9a3('0xc')](function(){if(_0x60818e==='leave'){var _0xd3fde0=_['map'](_0x51c6d8['OpenchannelInteractions'],'id');return _0x51c6d8[_0xd9a3('0x59')](_0xd3fde0)[_0xd9a3('0xc')](function(){for(var _0x4ec474=0x0;_0x4ec474<_0xd3fde0[_0xd9a3('0x1e')];_0x4ec474+=0x1){_0x3d562a[_0xd9a3('0x53')](_0xd9a3('0x5a'),{'OpenchannelInteractionId':Number(_0xd3fde0[_0x4ec474]),'UserId':Number(_0x51c6d8['id'])});}});}})['then'](function(){if(_0x60818e===_0xd9a3('0x4d')){var _0x1ccd3e=_[_0xd9a3('0x50')](_0x51c6d8[_0xd9a3('0x2d')],'id');return _0x51c6d8[_0xd9a3('0x5b')](_0x1ccd3e)[_0xd9a3('0xc')](function(){for(var _0x3225ed=0x0;_0x3225ed<_0x1ccd3e[_0xd9a3('0x1e')];_0x3225ed+=0x1){_0x3d562a[_0xd9a3('0x53')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x1ccd3e[_0x3225ed]),'UserId':Number(_0x51c6d8['id'])});}});}})[_0xd9a3('0x5c')](function(_0x30d0a4){_0x2be74a[_0xd9a3('0x5d')](_0x30d0a4);});}}function onDisconnect(_0x5561f5,_0x4282e6){joinOrLeave(_0x5561f5,_0xd9a3('0x4d'),_0x4282e6);}function onConnect(_0x3914c9){joinOrLeave(_0x3914c9,_0xd9a3('0x5e'));}exports[_0xd9a3('0x5f')]=function(_0x39775){_0x39775['on'](_0xd9a3('0x60'),function(_0x4885a2){_0x4885a2['setMaxListeners'](0x0);_0x4885a2[_0xd9a3('0x61')]=_0x4885a2[_0xd9a3('0x62')]['connection'][_0xd9a3('0x63')]+':'+_0x4885a2[_0xd9a3('0x62')][_0xd9a3('0x60')]['remotePort'];_0x4885a2[_0xd9a3('0x64')]=new Date();_0x4885a2[_0xd9a3('0x5d')]=function(_0x3a74d4){console[_0xd9a3('0x5d')]('SocketIO\x20'+_0x4885a2[_0xd9a3('0x65')]['name']+'['+_0x4885a2['address']+']',_0x3a74d4);};_0x4885a2['on'](_0xd9a3('0x66'),function(){onDisconnect(_0x4885a2,_0x39775);_0x4885a2[_0xd9a3('0x5d')](_0xd9a3('0x67'));});onConnect(_0x4885a2);_0x4885a2[_0xd9a3('0x5d')](_0xd9a3('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 6c9478e..2d9edf9 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 _0xbcf4=['Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','Trigger,\x20%s','EventManager','error','code','catch','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','undefined','format','SIP/%s','name','agent','channel','outgoingmessage','AfterCreateMessage','get','offlineMessage','motionChannel','opened','sequelize','query','contact','interface','AfterCreate','closed','changed','substatus','AfterUpdate','find','internal','default','length','hasOwnProperty','model','hook','callback','../../mysqldb','jayson/promise','../logger','triggers','http','ChatInteraction','afterCreate','newinteraction'];(function(_0x58fdfd,_0x46f063){var _0x3a4613=function(_0x4b6a77){while(--_0x4b6a77){_0x58fdfd['push'](_0x58fdfd['shift']());}};_0x3a4613(++_0x46f063);}(_0xbcf4,0x16a));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require(_0x4bcf('0x0'))['db'];var jayson=require(_0x4bcf('0x1'));var logger=require(_0x4bcf('0x2'))(_0x4bcf('0x3'));var client=jayson['client'][_0x4bcf('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4bcf('0x5'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':_0x4bcf('0x8'),'model':'ChatInteraction','event':_0x4bcf('0x9'),'condition':_0x4bcf('0xa'),'callback':afterUpdate},{'channel':_0x4bcf('0x8'),'model':_0x4bcf('0xb'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateMessage},{'channel':_0x4bcf('0x8'),'model':_0x4bcf('0xd'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x4bcf('0xe'),'model':'SmsInteraction','event':_0x4bcf('0x6'),'condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0x4bcf('0xf'),'event':_0x4bcf('0x9'),'condition':_0x4bcf('0xa'),'callback':afterUpdate},{'channel':_0x4bcf('0xe'),'model':_0x4bcf('0x10'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateMessage},{'channel':_0x4bcf('0x11'),'model':_0x4bcf('0x12'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':_0x4bcf('0x11'),'model':_0x4bcf('0x12'),'event':_0x4bcf('0x9'),'condition':_0x4bcf('0xa'),'callback':afterUpdate},{'channel':_0x4bcf('0x11'),'model':_0x4bcf('0x13'),'event':_0x4bcf('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4bcf('0x14'),'model':_0x4bcf('0x15'),'event':'afterCreate','condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':_0x4bcf('0x14'),'model':_0x4bcf('0x15'),'event':_0x4bcf('0x9'),'condition':_0x4bcf('0xa'),'callback':afterUpdate},{'channel':_0x4bcf('0x14'),'model':_0x4bcf('0x16'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateMessage},{'channel':_0x4bcf('0x17'),'model':'MailInteraction','event':_0x4bcf('0x6'),'condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':_0x4bcf('0x17'),'model':_0x4bcf('0x18'),'event':_0x4bcf('0x9'),'condition':_0x4bcf('0xa'),'callback':afterUpdate},{'channel':_0x4bcf('0x17'),'model':_0x4bcf('0x19'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateMessage},{'channel':_0x4bcf('0x1a'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x4bcf('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x4bcf('0x1b'),'event':_0x4bcf('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x4bcf('0x1c'),'event':_0x4bcf('0x6'),'condition':_0x4bcf('0xc'),'callback':afterCreateMessage}];function request(_0x46f85e){return client[_0x4bcf('0x1d')]('EventManager',_0x46f85e)[_0x4bcf('0x1e')](function(_0x2d3602){logger['info'](_0x4bcf('0x1f'),_0x4bcf('0x20'),_0x2d3602);if(_0x2d3602[_0x4bcf('0x21')]){if(_0x2d3602[_0x4bcf('0x21')][_0x4bcf('0x22')]===0x1f4){logger['error'](_0x4bcf('0x1f'),_0x4bcf('0x20'),_0x2d3602[_0x4bcf('0x21')]);}}})[_0x4bcf('0x23')](function(_0x56eaa3){logger[_0x4bcf('0x21')](_0x4bcf('0x1f'),_0x4bcf('0x20'),_0x56eaa3);});}function afterCreateMessage(_0x3e18f7){return function(_0x393242){_0x393242=_0x393242['get']({'plain':!![]});_0x393242['channel']=_0x3e18f7;_0x393242['motionChannel']=_0x3e18f7;_0x393242[_0x4bcf('0x24')]=_0x393242[_0x4bcf('0x25')];Promise[_0x4bcf('0x26')]()['then'](function(){if(typeof _0x393242[_0x4bcf('0x27')]==='undefined')return null;var _0x24ecbd=_0x4bcf('0x28')+_0x393242[_0x4bcf('0x27')];return db['sequelize']['query'](_0x24ecbd,{'type':db[_0x4bcf('0x29')][_0x4bcf('0x2a')][_0x4bcf('0x2b')],'raw':!![]});})[_0x4bcf('0x1e')](function(_0x36e79a){if(_0x36e79a){_0x393242['contact']=_0x36e79a[0x0];}if(typeof _0x393242[_0x4bcf('0x2c')]===_0x4bcf('0x2d'))return;return getAgent(_0x393242[_0x4bcf('0x2c')]);})[_0x4bcf('0x1e')](function(_0x3244d3){if(_0x3244d3){_0x393242['interface']=util[_0x4bcf('0x2e')](_0x4bcf('0x2f'),_0x3244d3[_0x4bcf('0x30')]);_0x393242[_0x4bcf('0x31')]=_0x3244d3;_0x393242[_0x4bcf('0x32')]=_0x3e18f7;return request({'event':'incomingmessage','message':_0x393242});}else{return request({'event':_0x4bcf('0x33'),'message':_0x393242});}})['catch'](function(_0x5d6dfb){logger[_0x4bcf('0x21')]('Trigger,\x20%s',_0x4bcf('0x34'),_0x5d6dfb);});};}function afterCreateOfflineMessage(_0x2dd874){return function(_0x16a7b4){_0x16a7b4=_0x16a7b4[_0x4bcf('0x35')]({'plain':!![]});_0x16a7b4['channel']=_0x2dd874;_0x16a7b4['motionChannel']=_0x2dd874;_0x16a7b4[_0x4bcf('0x24')]=_0x4bcf('0x36');return request({'event':_0x16a7b4[_0x4bcf('0x24')],'message':_0x16a7b4});};}function afterCreate(_0x150d06,_0x545430){return function(_0x394b90){_0x394b90=_0x394b90['get']({'plain':!![]});_0x394b90[_0x4bcf('0x32')]=_0x150d06;_0x394b90[_0x4bcf('0x37')]=_0x150d06;_0x394b90[_0x4bcf('0x24')]=_0x4bcf('0x38');Promise['resolve']()[_0x4bcf('0x1e')](function(){var _0x24a3ed=_0x4bcf('0x28')+_0x394b90[_0x4bcf('0x27')];return db[_0x4bcf('0x39')][_0x4bcf('0x3a')](_0x24a3ed,{'type':db[_0x4bcf('0x29')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x197811){if(_0x197811){_0x394b90[_0x4bcf('0x3b')]=_0x197811[0x0];}if(typeof _0x394b90[_0x4bcf('0x2c')]===_0x4bcf('0x2d'))return;return getAgent(_0x394b90[_0x4bcf('0x2c')]);})[_0x4bcf('0x1e')](function(_0x35b7c9){if(_0x35b7c9){_0x394b90[_0x4bcf('0x3c')]=util[_0x4bcf('0x2e')](_0x4bcf('0x2f'),_0x35b7c9['name']);_0x394b90[_0x4bcf('0x31')]=_0x35b7c9;}return request({'event':_0x545430,'message':_0x394b90});})[_0x4bcf('0x23')](function(_0x1257aa){logger[_0x4bcf('0x21')](_0x4bcf('0x1f'),_0x4bcf('0x3d'),_0x1257aa);});};}function afterUpdate(_0x2290d5){return function(_0x49b384){var _0x1a6736=_0x49b384['changed'](_0x4bcf('0x3e'))&&_0x49b384[_0x4bcf('0x3e')];var _0x4c409d=_0x49b384[_0x4bcf('0x3f')]('substatus');if(_0x1a6736||_0x4c409d){var _0x52614f=_0x1a6736?_0x4bcf('0xa'):'substatus';var _0x4b84c1=_0x49b384[_0x4bcf('0x35')]({'plain':!![]});_0x4b84c1[_0x4bcf('0x32')]=_0x2290d5;_0x4b84c1[_0x4bcf('0x37')]=_0x2290d5;_0x4b84c1[_0x4bcf('0x24')]=_0x1a6736?'closed':_0x4bcf('0x40');var _0x2e68fc=_0x4bcf('0x28')+_0x4b84c1[_0x4bcf('0x27')];return db[_0x4bcf('0x39')][_0x4bcf('0x3a')](_0x2e68fc,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x4bcf('0x1e')](function(_0x3c57ad){if(_0x3c57ad){_0x4b84c1[_0x4bcf('0x3b')]=_0x3c57ad[0x0];}if(typeof _0x4b84c1['UserId']==='undefined')return;return getAgent(_0x4b84c1[_0x4bcf('0x2c')]);})[_0x4bcf('0x1e')](function(_0x409ec4){if(_0x409ec4){_0x4b84c1[_0x4bcf('0x3c')]=util[_0x4bcf('0x2e')](_0x4bcf('0x2f'),_0x409ec4[_0x4bcf('0x30')]);_0x4b84c1[_0x4bcf('0x31')]=_0x409ec4;}return request({'event':_0x52614f,'message':_0x4b84c1});})['catch'](function(_0x4ca246){logger[_0x4bcf('0x21')]('Trigger,\x20%s',_0x4bcf('0x41'),_0x4ca246);});}};}function getAgent(_0x4c524d){return db['User'][_0x4bcf('0x42')]({'where':{'id':_0x4c524d},'attributes':['id',_0x4bcf('0x30'),'fullname','email',_0x4bcf('0x43')],'raw':!![]})[_0x4bcf('0x1e')](function(_0x5a2134){return _0x5a2134;});}exports[_0x4bcf('0x44')]=function(){for(var _0x50cb48=0x0;_0x50cb48=_0x27c2d4['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x35454e(_0x41c3bb);})['catch'](function(_0x564cec){_0x40058e(_0x564cec);});});}; \ No newline at end of file +var _0x1ffa=['role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','updateAttributes','getLicense'];(function(_0x344a18,_0x3a3244){var _0x5497de=function(_0x583718){while(--_0x583718){_0x344a18['push'](_0x344a18['shift']());}};_0x5497de(++_0x3a3244);}(_0x1ffa,0x1ab));var _0xa1ff=function(_0x5761f1,_0x2edd2c){_0x5761f1=_0x5761f1-0x0;var _0xa498fe=_0x1ffa[_0x5761f1];return _0xa498fe;};'use strict';var _=require(_0xa1ff('0x0'));var BPromise=require(_0xa1ff('0x1'));var db=require(_0xa1ff('0x2'))['db'];var util=require(_0xa1ff('0x3'));var channels=[_0xa1ff('0x4'),_0xa1ff('0x5'),'chat',_0xa1ff('0x6'),'sms','whatsapp','openchannel'];exports[_0xa1ff('0x7')]=function(){return channels;};exports[_0xa1ff('0x8')]=function(_0x2c9044){_0x2c9044=_0x2c9044[_0xa1ff('0x9')]();return _[_0xa1ff('0xa')](channels,_0x2c9044);};exports[_0xa1ff('0xb')]=function(_0x4ab735,_0xcddea9,_0x1f2b5a,_0x56ce5a){var _0x24aecd={'loginAttempts':_0xcddea9,'blocked':_0x1f2b5a};if(!_['isUndefined'](_0x56ce5a)){_0x24aecd['blockedAt']=_0x56ce5a;}return _0x4ab735[_0xa1ff('0xc')](_0x24aecd);};exports[_0xa1ff('0xd')]=function(_0x46c4f6){return new BPromise(function(_0x447d22,_0xa5ac1c){var _0x2b3c18=0x0;if(_0x46c4f6[_0xa1ff('0xe')]!==_0xa1ff('0xf')){_0x447d22(_0x46c4f6);}db[_0xa1ff('0x10')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x46c4f6['id']}}})[_0xa1ff('0x11')](function(_0x19f8c8){_0x2b3c18=_0x19f8c8;return util[_0xa1ff('0xd')]();})[_0xa1ff('0x11')](function(_0x36825f){if(_0x36825f&&_0x36825f[_0xa1ff('0x12')]&&_0x2b3c18>=_0x36825f[_0xa1ff('0x12')]){throw Error(_0xa1ff('0x13'));}_0x447d22(_0x46c4f6);})[_0xa1ff('0x14')](function(_0x54693f){_0xa5ac1c(_0x54693f);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 836b799..efb1cc2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7462=['json','send','exports','404','status'];(function(_0x5d3b40,_0x4d6f91){var _0x3e8267=function(_0x4121b2){while(--_0x4121b2){_0x5d3b40['push'](_0x5d3b40['shift']());}};_0x3e8267(++_0x4d6f91);}(_0x7462,0x165));var _0x2746=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x7462[_0x151381];return _0x2afab6;};'use strict';module[_0x2746('0x0')][0x194]=function pageNotFound(_0xaf3ebc,_0x5666d5){var _0x59956e=_0x2746('0x1');var _0x5b920b=0x194;var _0x497e67={'status':_0x5b920b};_0x5666d5[_0x2746('0x2')](_0x497e67[_0x2746('0x2')]);_0x5666d5['render'](_0x59956e,{},function(_0x2afbbd,_0x2b4606){if(_0x2afbbd){return _0x5666d5[_0x2746('0x2')](_0x497e67[_0x2746('0x2')])[_0x2746('0x3')](_0x497e67);}_0x5666d5[_0x2746('0x4')](_0x2b4606);});}; \ No newline at end of file +var _0x2b29=['status','exports'];(function(_0x36c820,_0x40e676){var _0x3000f4=function(_0x2b0e49){while(--_0x2b0e49){_0x36c820['push'](_0x36c820['shift']());}};_0x3000f4(++_0x40e676);}(_0x2b29,0x135));var _0x92b2=function(_0x4a84b9,_0x4e7d08){_0x4a84b9=_0x4a84b9-0x0;var _0x256192=_0x2b29[_0x4a84b9];return _0x256192;};'use strict';module[_0x92b2('0x0')][0x194]=function pageNotFound(_0x47b0ed,_0x127dd1){var _0x30693c='404';var _0x1297b2=0x194;var _0x2d61d5={'status':_0x1297b2};_0x127dd1[_0x92b2('0x1')](_0x2d61d5[_0x92b2('0x1')]);_0x127dd1['render'](_0x30693c,{},function(_0xba70fd,_0x6754a0){if(_0xba70fd){return _0x127dd1['status'](_0x2d61d5[_0x92b2('0x1')])['json'](_0x2d61d5);}_0x127dd1['send'](_0x6754a0);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index f3c4287..907bf6b 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed0e=['ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','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','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','UserId','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','chat_group_has_users','belongsToMany','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','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','SquareProjects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','Interval','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','List','ListId','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','MailQueueReport','Items','FaxAccountId','FaxApplication','TagId','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','OpenchannelQueueReport','Agent','ChatApplication','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','ChatGroupId','Members','Website','Contacts','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','CmHopperBlack','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','fax_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AnyCondition','Action','TriggerId','Fields','MetricId','Subjects','SubjectId','DescriptionId','AccountId','Subject','Description','FieldId','VariableId','Descriptions','Field','Configurations','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','SessionId','SmsQueueReport','JscriptyProject','ProjectId','user_has_teams','team_has_chat_queues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','BlackLists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToQueue','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','lodash','jstz','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Template','../api/template/template.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../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','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed0e,0x13d));var _0xeed0=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xed0e[_0x59c301];return _0x3866b9;};'use strict';var config=require(_0xeed0('0x0'));var Sequelize=require('sequelize');var _=require(_0xeed0('0x1'));var jstz=require(_0xeed0('0x2'));var timezone=jstz['determine']();config[_0xeed0('0x3')]=_[_0xeed0('0x4')](config[_0xeed0('0x3')],{'database':_0xeed0('0x5'),'username':_0xeed0('0x6'),'password':_0xeed0('0x7'),'options':{'host':_0xeed0('0x8'),'port':0xcea,'dialect':_0xeed0('0x9'),'dialectOptions':{'charset':_0xeed0('0xa')},'logging':![],'timezone':timezone[_0xeed0('0xb')](),'define':{'charset':_0xeed0('0xc'),'collate':_0xeed0('0xd')}}});config[_0xeed0('0xe')]=_['defaultsDeep'](config[_0xeed0('0xe')],{'database':'motion2','username':_0xeed0('0x6'),'password':_0xeed0('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xeed0('0x9'),'dialectOptions':{'charset':_0xeed0('0xa')},'logging':![],'timezone':timezone[_0xeed0('0xb')](),'define':{'charset':_0xeed0('0xc'),'collate':_0xeed0('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xeed0('0x3')][_0xeed0('0xf')],config['sequelize']['username'],config[_0xeed0('0x3')]['password'],config[_0xeed0('0x3')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xeed0('0xe')][_0xeed0('0xf')],config[_0xeed0('0xe')]['username'],config[_0xeed0('0xe')][_0xeed0('0x10')],config['sequelizeHistory'][_0xeed0('0x11')])};db['User']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/user/user.model');db[_0xeed0('0x13')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x14'));db[_0xeed0('0x15')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x16'));db['VoiceExtension']=db[_0xeed0('0x3')]['import'](_0xeed0('0x17'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0xeed0('0x18'));db[_0xeed0('0x19')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x1a'));db[_0xeed0('0x1b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x1c'));db[_0xeed0('0x1d')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x1e'));db[_0xeed0('0x1f')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x20'));db['VoiceMailMessage']=db['sequelize'][_0xeed0('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xeed0('0x21')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x22'));db['VoiceDialReport']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0xeed0('0x23')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x24'));db['VoiceQueueReport']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x25'));db['MemberReport']=db[_0xeed0('0x3')]['import'](_0xeed0('0x26'));db['Trunk']=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x27'));db['VoiceTransferReport']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xeed0('0x28')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x29'));db[_0xeed0('0x2a')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x2b'));db['UserChatQueue']=db['sequelize']['import'](_0xeed0('0x2c'));db[_0xeed0('0x2d')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x2e'));db['UserFaxQueue']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0xeed0('0x2f')]=db[_0xeed0('0x3')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xeed0('0x30')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x31'));db[_0xeed0('0x32')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x33'));db[_0xeed0('0x34')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/mailServerOut/mailServerOut.model');db[_0xeed0('0x35')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x36'));db[_0xeed0('0x37')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x38'));db[_0xeed0('0x39')]=db['sequelize'][_0xeed0('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0xeed0('0x3a')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x3b'));db['MailMessage']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/mailMessage/mailMessage.model');db[_0xeed0('0x3c')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x3d'));db['MailQueueReport']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x3e'));db[_0xeed0('0x3f')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x40'));db[_0xeed0('0x41')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x42'));db[_0xeed0('0x43')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x44'));db[_0xeed0('0x45')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x46'));db[_0xeed0('0x47')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x48'));db[_0xeed0('0x49')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/faxQueue/faxQueue.model');db[_0xeed0('0x4a')]=db[_0xeed0('0x3')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0xeed0('0x4b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x4c'));db[_0xeed0('0x4d')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x4e'));db[_0xeed0('0x4f')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x50'));db[_0xeed0('0x51')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x52'));db[_0xeed0('0x53')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x54'));db[_0xeed0('0x55')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x56'));db['OpenchannelApplication']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x57'));db['OpenchannelInteraction']=db['sequelize'][_0xeed0('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x58'));db[_0xeed0('0x59')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x5a'));db[_0xeed0('0x5b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x5c'));db['OpenchannelQueueReport']=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x5d'));db['ChatApplication']=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x5e'));db[_0xeed0('0x5f')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x60'));db[_0xeed0('0x61')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x62'));db[_0xeed0('0x63')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x64'));db[_0xeed0('0x65')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/chatQueue/chatQueue.model');db[_0xeed0('0x66')]=db[_0xeed0('0x3')]['import']('../api/chatGroup/chatGroup.model');db[_0xeed0('0x67')]=db[_0xeed0('0x3')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xeed0('0x68')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x69'));db[_0xeed0('0x6a')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/cmContact/cmContact.model');db[_0xeed0('0x6b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x6c'));db['CmHopperBlack']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x6d'));db[_0xeed0('0x6e')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xeed0('0x6f')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x70'));db['ReportAgentPreview']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x71'));db[_0xeed0('0x72')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x73'));db['Action']=db['sequelize']['import'](_0xeed0('0x74'));db[_0xeed0('0x75')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x76'));db[_0xeed0('0x77')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x78'));db[_0xeed0('0x79')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x7a'));db[_0xeed0('0x7b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x7c'));db['Interval']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x7d'));db['Pause']=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x7e'));db[_0xeed0('0x7f')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x80'));db[_0xeed0('0x81')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x82'));db[_0xeed0('0x83')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/schedule/schedule.model');db['Sound']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x84'));db['Tag']=db['sequelize']['import']('../api/tag/tag.model');db[_0xeed0('0x85')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x86'));db['Trigger']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/trigger/trigger.model');db[_0xeed0('0x87')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x88'));db['Integration']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x89'));db[_0xeed0('0x8a')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/integrationReport/integrationReport.model');db[_0xeed0('0x8b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x8c'));db[_0xeed0('0x8d')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xeed0('0x8e')]=db['sequelize']['import'](_0xeed0('0x8f'));db[_0xeed0('0x90')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x91'));db[_0xeed0('0x92')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x93'));db['AnalyticTreeReport']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x94'));db[_0xeed0('0x95')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x96'));db[_0xeed0('0x97')]=db[_0xeed0('0x3')]['import'](_0xeed0('0x98'));db[_0xeed0('0x99')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x9a'));db[_0xeed0('0x9b')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x9c'));db[_0xeed0('0x9d')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x9e'));db[_0xeed0('0x9f')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xeed0('0xa0')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xa1'));db[_0xeed0('0xa2')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xa3'));db[_0xeed0('0xa4')]=db[_0xeed0('0x3')]['import'](_0xeed0('0xa5'));db[_0xeed0('0xa6')]=db[_0xeed0('0x3')]['import'](_0xeed0('0xa7'));db[_0xeed0('0xa8')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xa9'));db[_0xeed0('0xaa')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xab'));db[_0xeed0('0xac')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xad'));db[_0xeed0('0xae')]=db['sequelize']['import'](_0xeed0('0xaf'));db['ZendeskField']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0xeed0('0xb0')]=db['sequelize'][_0xeed0('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xeed0('0xb1')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xb2'));db[_0xeed0('0xb3')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xeed0('0xb4')]=db['sequelize']['import'](_0xeed0('0xb5'));db[_0xeed0('0xb6')]=db['sequelize']['import'](_0xeed0('0xb7'));db[_0xeed0('0xb8')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xb9'));db[_0xeed0('0xba')]=db[_0xeed0('0x3')]['import'](_0xeed0('0xbb'));db['ServicenowConfiguration']=db[_0xeed0('0x3')]['import'](_0xeed0('0xbc'));db[_0xeed0('0xbd')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0xeed0('0xbe')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xbf'));db[_0xeed0('0xc0')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xc1'));db['Dynamics365Field']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xc2'));db[_0xeed0('0xc3')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xc4'));db[_0xeed0('0xc5')]=db['sequelize']['import'](_0xeed0('0xc6'));db[_0xeed0('0xc7')]=db[_0xeed0('0x3')]['import'](_0xeed0('0xc8'));db[_0xeed0('0xc9')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/integration/integration.model');db[_0xeed0('0xca')]=db['sequelize'][_0xeed0('0x12')]('../api/network/network.model');db[_0xeed0('0xcb')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xcc'));db[_0xeed0('0xcd')]=db['sequelize']['import'](_0xeed0('0xce'));db[_0xeed0('0xcf')]=db['sequelize']['import'](_0xeed0('0xd0'));db[_0xeed0('0xd1')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xd2'));db[_0xeed0('0xd3')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xd4'));db['SmsQueueReport']=db['sequelize'][_0xeed0('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0xeed0('0xd5')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xd6'));db['SquareDetailsReport']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xd7'));db['JscriptyProject']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/jscriptyProject/jscriptyProject.model');db[_0xeed0('0xd8')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xd9'));db[_0xeed0('0xda')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xdb'));db[_0xeed0('0xdc')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xdd'));db[_0xeed0('0xde')]=db[_0xeed0('0x3')]['import']('../api/squareRecording/squareRecording.model');db[_0xeed0('0xdf')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/squareMessage/squareMessage.model');db[_0xeed0('0xe0')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xe1'));db[_0xeed0('0xe2')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xe3'));db[_0xeed0('0xe4')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xe5'));db[_0xeed0('0xe6')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xe7'));db[_0xeed0('0xe8')]=db['sequelize']['import'](_0xeed0('0xe9'));db['Plugin']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize']['import'](_0xeed0('0xea'));db[_0xeed0('0xeb')]=db[_0xeed0('0x3')]['import'](_0xeed0('0xec'));db[_0xeed0('0xed')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/faxTransferReport/faxTransferReport.model');db[_0xeed0('0xee')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xef'));db[_0xeed0('0xf0')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0xeed0('0xf1')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xf2'));db[_0xeed0('0xf3')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0xeed0('0xf4')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xf5'));db[_0xeed0('0xf6')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xf7'));db[_0xeed0('0xf8')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xf9'));db['UserNotification']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xfa'));db[_0xeed0('0xfb')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xfc'));db[_0xeed0('0xfd')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0xfe'));db['WhatsappInteraction']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0xff'));db['WhatsappMessage']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x100'));db[_0xeed0('0x101')]=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xeed0('0x102')]=db['sequelize'][_0xeed0('0x12')](_0xeed0('0x103'));db['WhatsappQueue']=db[_0xeed0('0x3')][_0xeed0('0x12')]('../api/whatsappQueue/whatsappQueue.model');db[_0xeed0('0x104')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x105'));db[_0xeed0('0x106')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x107'));db[_0xeed0('0x108')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x109'));db['UserVoicePrefix']=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x10a'));db[_0xeed0('0x10b')]=db[_0xeed0('0x3')][_0xeed0('0x12')](_0xeed0('0x10c'));db[_0xeed0('0x10d')][_0xeed0('0x10e')](db['VoiceMail'],{'as':_0xeed0('0x1f'),'onDelete':'cascade','foreignKey':_0xeed0('0x10f')});db['User']['hasOne'](db[_0xeed0('0x10b')],{'as':_0xeed0('0x110'),'onDelete':_0xeed0('0x111'),'foreignKey':'UserId'});db[_0xeed0('0x10d')][_0xeed0('0x112')](db[_0xeed0('0x1b')],{'as':_0xeed0('0x113'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x10d')][_0xeed0('0x112')](db[_0xeed0('0x28')],{'as':_0xeed0('0x114'),'foreignKey':'UserId'});db['User'][_0xeed0('0x112')](db[_0xeed0('0x115')],{'as':_0xeed0('0x116'),'onDelete':_0xeed0('0x111'),'hooks':!![]});db[_0xeed0('0x10d')][_0xeed0('0x112')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xeed0('0x10f')});db['User'][_0xeed0('0x112')](db[_0xeed0('0x6f')],{'as':_0xeed0('0x117'),'foreignKey':'UserId'});db[_0xeed0('0x10d')]['hasMany'](db[_0xeed0('0x118')],{'as':_0xeed0('0x118'),'foreignKey':'UserId'});db[_0xeed0('0x10d')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xeed0('0x119'),'foreignKey':'UserId'});db[_0xeed0('0x10d')][_0xeed0('0x112')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0xeed0('0x10d')][_0xeed0('0x112')](db[_0xeed0('0x4f')],{'as':_0xeed0('0x11a'),'foreignKey':'UserId'});db[_0xeed0('0x10d')][_0xeed0('0x112')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x10d')][_0xeed0('0x112')](db[_0xeed0('0x3a')],{'as':_0xeed0('0x11b'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x10d')][_0xeed0('0x112')](db[_0xeed0('0x11c')],{'as':_0xeed0('0x11d'),'foreignKey':_0xeed0('0x10f')});db['User']['hasMany'](db[_0xeed0('0x11e')],{'as':_0xeed0('0x11f'),'foreignKey':_0xeed0('0x120')});db[_0xeed0('0x10d')][_0xeed0('0x121')](db[_0xeed0('0xf4')],{'as':_0xeed0('0xf4'),'foreignKey':'userProfileId'});db[_0xeed0('0x10d')]['belongsToMany'](db[_0xeed0('0x66')],{'as':'Groups','through':_0xeed0('0x122')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x6a')],{'as':'Contacts','through':_0xeed0('0x124')});db['User'][_0xeed0('0x123')](db['CmList'],{'as':_0xeed0('0x125'),'through':_0xeed0('0x126')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db['Team'],{'through':'user_has_teams'});db[_0xeed0('0x10d')]['belongsToMany'](db['MailInteraction'],{'as':_0xeed0('0x11b'),'through':_0xeed0('0x127')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x5f')],{'as':_0xeed0('0x128'),'through':'user_has_chat_interactions'});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x45')],{'as':_0xeed0('0x129'),'through':_0xeed0('0x12a')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x4f')],{'as':_0xeed0('0x11a'),'through':_0xeed0('0x12b')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x12c')],{'as':_0xeed0('0x119'),'through':_0xeed0('0x12d')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x11c')],{'as':'WhatsappInteractions','through':_0xeed0('0x12e')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db['VoiceQueue'],{'as':_0xeed0('0x12f'),'through':_0xeed0('0x2a'),'required':![]});db[_0xeed0('0x10d')]['belongsToMany'](db['VoicePrefix'],{'as':_0xeed0('0x130'),'through':_0xeed0('0x131'),'required':![]});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x37')],{'as':'MailQueues','through':_0xeed0('0x2d'),'required':![]});db[_0xeed0('0x10d')][_0xeed0('0x123')](db['ChatQueue'],{'as':_0xeed0('0x132'),'through':_0xeed0('0x133'),'required':![],'hooks':!![]});db['User'][_0xeed0('0x123')](db[_0xeed0('0x49')],{'as':_0xeed0('0x134'),'through':_0xeed0('0x135'),'required':![]});db[_0xeed0('0x10d')][_0xeed0('0x123')](db['SmsQueue'],{'as':_0xeed0('0x136'),'through':'UserSmsQueue','required':![]});db['User'][_0xeed0('0x123')](db['OpenchannelQueue'],{'as':_0xeed0('0x137'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xeed0('0x123')](db[_0xeed0('0x138')],{'as':_0xeed0('0x139'),'through':_0xeed0('0x13a'),'required':![]});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0xf1')],{'through':_0xeed0('0x126')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db['ChatWebsite'],{'as':_0xeed0('0x13b'),'through':_0xeed0('0x13c')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x43')],{'as':_0xeed0('0x13d'),'through':_0xeed0('0x13e')});db['User'][_0xeed0('0x123')](db[_0xeed0('0x35')],{'as':_0xeed0('0x13f'),'through':_0xeed0('0x140')});db['User'][_0xeed0('0x123')](db[_0xeed0('0x55')],{'as':'OpenchannelAccounts','through':_0xeed0('0x141')});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0x4b')],{'as':_0xeed0('0x142'),'through':_0xeed0('0x143')});db[_0xeed0('0x10d')]['belongsToMany'](db[_0xeed0('0xfb')],{'as':_0xeed0('0x144'),'through':'user_has_whatsapp_accounts'});db[_0xeed0('0x10d')][_0xeed0('0x123')](db[_0xeed0('0xdc')],{'as':_0xeed0('0x145'),'through':'user_has_square_projects'});db[_0xeed0('0x13')][_0xeed0('0x112')](db[_0xeed0('0x115')],{'as':_0xeed0('0x146'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x147')});db['VoiceContext'][_0xeed0('0x112')](db[_0xeed0('0x115')],{'onDelete':'cascade'});db[_0xeed0('0x115')]['hasMany'](db['VoiceExtension'],{'as':_0xeed0('0x148'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x149')][_0xeed0('0x123')](db[_0xeed0('0x14a')],{'as':_0xeed0('0x14b'),'through':_0xeed0('0x14c')});db[_0xeed0('0x19')][_0xeed0('0x112')](db[_0xeed0('0x28')],{'as':'Members','foreignKey':_0xeed0('0x14d')});db[_0xeed0('0x19')][_0xeed0('0x112')](db[_0xeed0('0x6b')],{'as':_0xeed0('0x14e'),'foreignKey':_0xeed0('0x14d')});db['VoiceQueue'][_0xeed0('0x112')](db[_0xeed0('0x6e')],{'as':_0xeed0('0x14f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xeed0('0x6f')],{'as':_0xeed0('0x150'),'foreignKey':'VoiceQueueId'});db[_0xeed0('0x19')][_0xeed0('0x112')](db[_0xeed0('0x118')],{'as':_0xeed0('0x118'),'foreignKey':_0xeed0('0x14d')});db[_0xeed0('0x19')]['hasMany'](db['CmHopperBlack'],{'as':_0xeed0('0x151'),'foreignKey':_0xeed0('0x14d')});db[_0xeed0('0x19')][_0xeed0('0x112')](db[_0xeed0('0xd3')],{'as':_0xeed0('0x152'),'foreignKey':_0xeed0('0x14d')});db['VoiceQueue'][_0xeed0('0x121')](db[_0xeed0('0x153')],{'as':_0xeed0('0x153'),'foreignKey':_0xeed0('0x154')});db['VoiceQueue'][_0xeed0('0x121')](db[_0xeed0('0x153')],{'as':_0xeed0('0x155'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0xeed0('0x121')](db['Interval'],{'as':_0xeed0('0x156'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x19')][_0xeed0('0x121')](db[_0xeed0('0x158')],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db[_0xeed0('0x19')]['belongsToMany'](db[_0xeed0('0xf1')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xeed0('0x19')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':'UserVoiceQueue'});db[_0xeed0('0x19')][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0xeed0('0x123')](db[_0xeed0('0xf1')],{'as':'BlackLists','through':_0xeed0('0x15c')});db[_0xeed0('0x1b')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x10d'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x1d')][_0xeed0('0x121')](db['User'],{'as':_0xeed0('0x10d'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x1f')][_0xeed0('0x112')](db[_0xeed0('0x15d')],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':'mailboxuser','sourceKey':_0xeed0('0x15f')});db[_0xeed0('0x15d')][_0xeed0('0x121')](db[_0xeed0('0x1f')],{'foreignKey':'mailboxuser','targetKey':_0xeed0('0x15f')});db[_0xeed0('0x21')][_0xeed0('0x112')](db[_0xeed0('0x160')],{'as':_0xeed0('0x161'),'foreignKey':_0xeed0('0x162'),'constraints':![]});db['VoiceCallReport'][_0xeed0('0x112')](db[_0xeed0('0x23')],{'as':_0xeed0('0x163'),'foreignKey':_0xeed0('0x162'),'constraints':![]});db['VoiceCallReport'][_0xeed0('0x121')](db['User'],{'as':_0xeed0('0x10d'),'foreignKey':_0xeed0('0x10f')});db['VoiceCallReport']['belongsTo'](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x32')][_0xeed0('0x121')](db['MailAccount'],{'as':_0xeed0('0x35'),'foreignKey':_0xeed0('0x166')});db['MailServerIn']['belongsTo'](db['CloudProvider'],{'as':_0xeed0('0x104'),'foreignKey':_0xeed0('0x167'),'onDelete':_0xeed0('0x168')});db['MailServerOut'][_0xeed0('0x121')](db[_0xeed0('0x35')],{'as':'MailAccount','foreignKey':_0xeed0('0x166')});db['MailServerOut'][_0xeed0('0x121')](db[_0xeed0('0x104')],{'as':_0xeed0('0x104'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xeed0('0x35')][_0xeed0('0x10e')](db[_0xeed0('0x32')],{'as':_0xeed0('0x169'),'onDelete':'cascade'});db[_0xeed0('0x35')][_0xeed0('0x10e')](db[_0xeed0('0x34')],{'as':_0xeed0('0x16a'),'onDelete':'cascade'});db[_0xeed0('0x35')][_0xeed0('0x112')](db[_0xeed0('0x79')],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x166'),'onDelete':_0xeed0('0x111')});db['MailAccount'][_0xeed0('0x112')](db['CannedAnswer'],{'as':_0xeed0('0x16c'),'foreignKey':_0xeed0('0x166')});db[_0xeed0('0x35')][_0xeed0('0x112')](db[_0xeed0('0x16d')],{'as':_0xeed0('0x15e'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xeed0('0x112')](db[_0xeed0('0x3a')],{'as':_0xeed0('0x16e')});db['MailAccount'][_0xeed0('0x112')](db[_0xeed0('0x3c')],{'as':_0xeed0('0x148')});db[_0xeed0('0x35')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x35')][_0xeed0('0x121')](db[_0xeed0('0x85')],{'as':_0xeed0('0x85'),'foreignKey':_0xeed0('0x171')});db[_0xeed0('0x35')][_0xeed0('0x121')](db['Pause'],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db['MailAccount'][_0xeed0('0x123')](db['User'],{'as':'Agents','through':_0xeed0('0x140')});db[_0xeed0('0x37')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':'Agents','through':_0xeed0('0x2d')});db[_0xeed0('0x37')]['belongsToMany'](db[_0xeed0('0xe0')],{'through':_0xeed0('0x172'),'as':_0xeed0('0x173')});db[_0xeed0('0x3a')][_0xeed0('0x112')](db['MailMessage'],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x174')});db['MailInteraction'][_0xeed0('0x121')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0xeed0('0x3a')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':'Contact','foreignKey':_0xeed0('0x165')});db[_0xeed0('0x3a')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x175'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x3a')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x177'),'as':_0xeed0('0x178')});db[_0xeed0('0x3a')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':'mail_interaction_has_tags','as':_0xeed0('0x179')});db['MailInteraction'][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x17a'),'through':_0xeed0('0x127'),'foreignKey':_0xeed0('0x174')});db[_0xeed0('0x16d')][_0xeed0('0x112')](db['Attachment'],{'as':'Attachments','onDelete':_0xeed0('0x111')});db[_0xeed0('0x16d')][_0xeed0('0x121')](db['User'],{'as':_0xeed0('0x10d')});db['MailMessage'][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x164')});db[_0xeed0('0x16d')][_0xeed0('0x121')](db[_0xeed0('0x3a')],{'as':_0xeed0('0x17b'),'foreignKey':_0xeed0('0x174')});db[_0xeed0('0x16d')]['belongsTo'](db[_0xeed0('0x35')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x166')});db[_0xeed0('0x16d')][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'as':_0xeed0('0x5b'),'foreignKey':_0xeed0('0x17d')});db['MailMessage'][_0xeed0('0x121')](db[_0xeed0('0x63')],{'as':'ChatOfflineMessage','foreignKey':_0xeed0('0x17e')});db['MailApplication'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x168')});db['MailApplication']['belongsTo'](db[_0xeed0('0x37')],{'onDelete':_0xeed0('0x168')});db[_0xeed0('0x3c')][_0xeed0('0x121')](db['MailAccount'],{'onDelete':'restrict'});db[_0xeed0('0x3c')][_0xeed0('0x121')](db[_0xeed0('0x156')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x3c')]['belongsTo'](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':'TagId'});db[_0xeed0('0x17f')]['belongsTo'](db[_0xeed0('0x35')],{});db[_0xeed0('0x17f')][_0xeed0('0x121')](db['CmList'],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x17f')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xeed0('0x121')](db[_0xeed0('0x3a')],{});db[_0xeed0('0x17f')][_0xeed0('0x121')](db[_0xeed0('0x16d')],{});db[_0xeed0('0x17f')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{});db[_0xeed0('0x17f')][_0xeed0('0x121')](db['MailQueue'],{});db[_0xeed0('0x3f')][_0xeed0('0x112')](db[_0xeed0('0x41')],{'as':_0xeed0('0x180'),'onDelete':'cascade'});db[_0xeed0('0x43')]['hasMany'](db[_0xeed0('0x79')],{'as':'Dispositions','foreignKey':_0xeed0('0x181'),'onDelete':_0xeed0('0x111')});db['FaxAccount']['hasMany'](db[_0xeed0('0x77')],{'as':'Answers','foreignKey':_0xeed0('0x181')});db[_0xeed0('0x43')][_0xeed0('0x112')](db[_0xeed0('0x45')],{'as':_0xeed0('0x16e')});db[_0xeed0('0x43')]['hasMany'](db[_0xeed0('0x182')],{'as':'Applications'});db['FaxAccount'][_0xeed0('0x112')](db[_0xeed0('0x115')],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0xeed0('0x112')](db[_0xeed0('0x47')],{'as':_0xeed0('0x15e')});db[_0xeed0('0x43')][_0xeed0('0x121')](db[_0xeed0('0x153')],{'as':_0xeed0('0x153')});db[_0xeed0('0x43')]['belongsTo'](db['CmList'],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x43')]['belongsTo'](db['Pause'],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db['FaxAccount'][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x13e')});db[_0xeed0('0x182')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x168')});db['FaxApplication']['belongsTo'](db[_0xeed0('0x49')],{'onDelete':_0xeed0('0x168')});db['FaxApplication'][_0xeed0('0x121')](db[_0xeed0('0x43')],{'onDelete':'restrict'});db['FaxApplication'][_0xeed0('0x121')](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x183')});db[_0xeed0('0x45')]['hasMany'](db['FaxMessage'],{'as':'Messages','onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x184')});db[_0xeed0('0x45')][_0xeed0('0x121')](db['FaxAccount'],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x181')});db[_0xeed0('0x45')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':'Contact','foreignKey':_0xeed0('0x165')});db[_0xeed0('0x45')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':'Owner','foreignKey':'UserId'});db[_0xeed0('0x45')][_0xeed0('0x123')](db['Tag'],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':'fax_interaction_has_tags','as':_0xeed0('0x179')});db[_0xeed0('0x45')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':'Users','through':_0xeed0('0x12a'),'foreignKey':_0xeed0('0x184')});db['FaxMessage'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x10d')});db[_0xeed0('0x47')][_0xeed0('0x121')](db['FaxInteraction'],{'as':_0xeed0('0x17b'),'foreignKey':'FaxInteractionId'});db[_0xeed0('0x47')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x164')});db[_0xeed0('0x47')][_0xeed0('0x121')](db[_0xeed0('0xe8')],{'as':'Attachment','foreignKey':_0xeed0('0x185')});db[_0xeed0('0x47')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0xeed0('0x181')});db[_0xeed0('0x49')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x135')});db['FaxQueue'][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'through':_0xeed0('0x186'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0xeed0('0x4a')]['belongsTo'](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':'ListId'});db[_0xeed0('0x4a')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db['FaxQueueReport'][_0xeed0('0x121')](db[_0xeed0('0x45')],{});db['FaxQueueReport']['belongsTo'](db[_0xeed0('0x47')],{});db[_0xeed0('0x4a')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{});db['FaxQueueReport']['belongsTo'](db[_0xeed0('0x49')],{});db[_0xeed0('0x4b')]['hasMany'](db[_0xeed0('0x79')],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x187'),'onDelete':'cascade'});db[_0xeed0('0x4b')][_0xeed0('0x112')](db[_0xeed0('0x77')],{'as':_0xeed0('0x16c'),'foreignKey':'SmsAccountId'});db[_0xeed0('0x4b')][_0xeed0('0x112')](db[_0xeed0('0x51')],{'as':_0xeed0('0x15e'),'foreignKey':_0xeed0('0x187')});db[_0xeed0('0x4b')][_0xeed0('0x112')](db[_0xeed0('0x4f')],{'as':_0xeed0('0x16e')});db[_0xeed0('0x4b')][_0xeed0('0x112')](db['SmsApplication'],{'as':'Applications'});db[_0xeed0('0x4b')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x4b')][_0xeed0('0x121')](db[_0xeed0('0x158')],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db[_0xeed0('0x4b')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x143')});db['SmsApplication'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x168')});db[_0xeed0('0x4d')][_0xeed0('0x121')](db[_0xeed0('0x53')],{'onDelete':_0xeed0('0x168')});db[_0xeed0('0x4d')]['belongsTo'](db[_0xeed0('0x4b')],{'onDelete':'restrict'});db[_0xeed0('0x4d')][_0xeed0('0x121')](db[_0xeed0('0x156')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x4d')][_0xeed0('0x121')](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x183')});db[_0xeed0('0x4f')][_0xeed0('0x112')](db['SmsMessage'],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x188')});db['SmsInteraction']['belongsTo'](db[_0xeed0('0x4b')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x187')});db[_0xeed0('0x4f')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':'ContactId'});db[_0xeed0('0x4f')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':'Owner','foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x4f')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x189'),'as':'Tags'});db['SmsInteraction'][_0xeed0('0x123')](db['Tag'],{'through':_0xeed0('0x189'),'as':_0xeed0('0x179')});db[_0xeed0('0x4f')][_0xeed0('0x123')](db['User'],{'as':'Users','through':_0xeed0('0x12b'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x10d')});db[_0xeed0('0x51')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x164')});db[_0xeed0('0x51')]['belongsTo'](db[_0xeed0('0x4f')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x17b'),'foreignKey':'SmsInteractionId'});db[_0xeed0('0x51')][_0xeed0('0x121')](db[_0xeed0('0x4b')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xeed0('0x53')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':'Agents','through':_0xeed0('0x2f'),'foreignKey':_0xeed0('0x18a')});db['SmsQueue'][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'through':'team_has_sms_queues','as':_0xeed0('0x173')});db[_0xeed0('0x55')][_0xeed0('0x112')](db['Disposition'],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x18b'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x55')][_0xeed0('0x112')](db[_0xeed0('0x77')],{'as':_0xeed0('0x16c'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x55')][_0xeed0('0x112')](db[_0xeed0('0x12c')],{'as':_0xeed0('0x16e'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x55')][_0xeed0('0x112')](db[_0xeed0('0x18c')],{'as':_0xeed0('0x15e'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x55')][_0xeed0('0x112')](db[_0xeed0('0x18d')],{'as':_0xeed0('0x148'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x55')]['belongsTo'](db['CmList'],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x55')]['belongsTo'](db['Pause'],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db['OpenchannelAccount'][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x141')});db['OpenchannelApplication'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xeed0('0x121')](db['OpenchannelQueue'],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x18e')});db[_0xeed0('0x18d')]['belongsTo'](db[_0xeed0('0x55')],{'onDelete':'restrict','foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x18d')][_0xeed0('0x121')](db[_0xeed0('0x156')],{'onDelete':_0xeed0('0x168'),'foreignKey':'IntervalId'});db[_0xeed0('0x18d')]['belongsTo'](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':'TagId'});db[_0xeed0('0x12c')][_0xeed0('0x112')](db[_0xeed0('0x18c')],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x18f')});db[_0xeed0('0x12c')]['belongsTo'](db[_0xeed0('0x55')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x12c')][_0xeed0('0x121')](db['CmContact'],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x12c')]['belongsTo'](db[_0xeed0('0x10d')],{'as':_0xeed0('0x175'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x190'),'as':'Tags'});db[_0xeed0('0x12c')][_0xeed0('0x123')](db['Tag'],{'through':_0xeed0('0x190'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0xeed0('0x123')](db['User'],{'as':_0xeed0('0x17a'),'through':_0xeed0('0x12d'),'foreignKey':'OpenchannelInteractionId'});db[_0xeed0('0x18c')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x111'),'as':'User'});db[_0xeed0('0x18c')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x164')});db['OpenchannelMessage'][_0xeed0('0x121')](db[_0xeed0('0x12c')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x17b'),'foreignKey':'OpenchannelInteractionId'});db[_0xeed0('0x18c')]['belongsTo'](db[_0xeed0('0xe8')],{'as':'Attachment','foreignKey':_0xeed0('0x185')});db['OpenchannelMessage'][_0xeed0('0x121')](db[_0xeed0('0x55')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x18b')});db[_0xeed0('0x59')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x30'),'foreignKey':_0xeed0('0x18e')});db[_0xeed0('0x59')][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xeed0('0x5b')][_0xeed0('0x112')](db['Disposition'],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x17d'),'onDelete':_0xeed0('0x111')});db['ChatWebsite'][_0xeed0('0x112')](db['CannedAnswer'],{'as':_0xeed0('0x16c'),'foreignKey':_0xeed0('0x17d')});db['ChatWebsite'][_0xeed0('0x112')](db[_0xeed0('0x67')],{'as':_0xeed0('0x191')});db[_0xeed0('0x5b')][_0xeed0('0x112')](db[_0xeed0('0x5f')],{'as':_0xeed0('0x16e')});db[_0xeed0('0x5b')][_0xeed0('0x112')](db['ChatApplication'],{'as':_0xeed0('0x148')});db[_0xeed0('0x5b')][_0xeed0('0x112')](db[_0xeed0('0x61')],{'as':'Messages'});db[_0xeed0('0x5b')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x5b')][_0xeed0('0x121')](db[_0xeed0('0x156')],{'as':'Interval','foreignKey':_0xeed0('0x157')});db[_0xeed0('0x5b')]['belongsTo'](db[_0xeed0('0x35')],{'as':_0xeed0('0x35'),'foreignKey':_0xeed0('0x166')});db['ChatWebsite'][_0xeed0('0x121')](db['Pause'],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db[_0xeed0('0x5b')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x13c')});db[_0xeed0('0x192')][_0xeed0('0x121')](db[_0xeed0('0x55')],{});db[_0xeed0('0x192')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x192')]['belongsTo'](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':'ContactId'});db[_0xeed0('0x192')][_0xeed0('0x121')](db['OpenchannelInteraction'],{});db[_0xeed0('0x192')]['belongsTo'](db[_0xeed0('0x18c')],{});db[_0xeed0('0x192')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{});db['OpenchannelQueueReport'][_0xeed0('0x121')](db[_0xeed0('0x59')],{});db['ChatApplication'][_0xeed0('0x121')](db['User'],{'as':_0xeed0('0x193'),'foreignKey':_0xeed0('0x10f'),'onDelete':_0xeed0('0x168')});db[_0xeed0('0x194')][_0xeed0('0x121')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xeed0('0x195'),'onDelete':'restrict'});db[_0xeed0('0x194')][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xeed0('0x168')});db[_0xeed0('0x194')]['belongsTo'](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x183')});db[_0xeed0('0x5f')]['hasMany'](db[_0xeed0('0x61')],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x196')});db[_0xeed0('0x5f')][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x17d')});db[_0xeed0('0x5f')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x5f')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x175'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x5f')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':'chat_interaction_has_tags','as':_0xeed0('0x178')});db[_0xeed0('0x5f')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x197'),'as':_0xeed0('0x179')});db[_0xeed0('0x5f')]['belongsToMany'](db[_0xeed0('0x10d')],{'as':'Users','through':_0xeed0('0x198'),'foreignKey':_0xeed0('0x196')});db[_0xeed0('0x61')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':'cascade','as':_0xeed0('0x10d')});db[_0xeed0('0x61')][_0xeed0('0x121')](db['CmContact'],{'onDelete':_0xeed0('0x111'),'as':'Contact','foreignKey':_0xeed0('0x165')});db[_0xeed0('0x61')][_0xeed0('0x121')](db[_0xeed0('0x5f')],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x17b'),'foreignKey':'ChatInteractionId'});db[_0xeed0('0x61')]['belongsTo'](db[_0xeed0('0xe8')],{'as':_0xeed0('0xe8'),'foreignKey':_0xeed0('0x185')});db[_0xeed0('0x61')][_0xeed0('0x121')](db['ChatWebsite'],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x17d')});db[_0xeed0('0x63')][_0xeed0('0x112')](db[_0xeed0('0xe8')],{'as':_0xeed0('0x199'),'foreignKey':_0xeed0('0x17e'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':'Contact','foreignKey':'ContactId'});db[_0xeed0('0x63')][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'as':_0xeed0('0x17c'),'foreignKey':'ChatWebsiteId'});db[_0xeed0('0x65')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x133'),'hooks':!![]});db[_0xeed0('0x65')]['belongsToMany'](db['Team'],{'through':'team_has_chat_queues','as':_0xeed0('0x173')});db[_0xeed0('0x66')][_0xeed0('0x112')](db['ChatInternalMessage'],{'as':_0xeed0('0x15e'),'foreignKey':_0xeed0('0x19a'),'onDelete':'cascade'});db[_0xeed0('0x66')]['belongsToMany'](db['User'],{'as':_0xeed0('0x19b'),'through':_0xeed0('0x122')});db['ChatProactiveAction'][_0xeed0('0x121')](db['ChatWebsite'],{'as':_0xeed0('0x19c'),'foreignKey':_0xeed0('0x17d')});db['CmCompany'][_0xeed0('0x112')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x19d'),'foreignKey':_0xeed0('0x19e')});db[_0xeed0('0x6a')]['hasMany'](db[_0xeed0('0x6b')],{'as':_0xeed0('0x14e'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x6a')][_0xeed0('0x112')](db['CmHopperFinal'],{'as':_0xeed0('0x14f'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x6a')][_0xeed0('0x112')](db[_0xeed0('0x6f')],{'as':_0xeed0('0x150'),'foreignKey':_0xeed0('0x165')});db['CmContact'][_0xeed0('0x112')](db[_0xeed0('0x118')],{'as':_0xeed0('0x118'),'foreignKey':_0xeed0('0x165')});db['CmContact']['hasMany'](db[_0xeed0('0xd3')],{'as':_0xeed0('0x152'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0x6a')][_0xeed0('0x112')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xeed0('0x165'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xeed0('0x5f')],{'as':_0xeed0('0x128'),'foreignKey':_0xeed0('0x165'),'onDelete':_0xeed0('0x168')});db['CmContact'][_0xeed0('0x112')](db[_0xeed0('0x4f')],{'as':_0xeed0('0x11a'),'foreignKey':_0xeed0('0x165'),'onDelete':'restrict'});db[_0xeed0('0x6a')][_0xeed0('0x112')](db[_0xeed0('0x45')],{'as':_0xeed0('0x129'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xeed0('0x6a')][_0xeed0('0x112')](db['MailInteraction'],{'as':_0xeed0('0x11b'),'foreignKey':_0xeed0('0x165'),'onDelete':_0xeed0('0x168')});db[_0xeed0('0x6a')][_0xeed0('0x121')](db[_0xeed0('0x68')],{'as':_0xeed0('0x19f'),'foreignKey':_0xeed0('0x19e')});db[_0xeed0('0x6a')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x6a')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x17a'),'through':_0xeed0('0x124')});db[_0xeed0('0x6a')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'as':_0xeed0('0x178'),'through':'cm_contact_has_tags'});db[_0xeed0('0x6a')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x1a0'),'as':'ThroughTags'});db['CmHopper'][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x6b')][_0xeed0('0x121')](db['CmList'],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x6b')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x193'),'foreignKey':'UserId'});db[_0xeed0('0x6b')]['belongsTo'](db[_0xeed0('0x19')],{'as':_0xeed0('0x1a1'),'foreignKey':_0xeed0('0x14d'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x6b')][_0xeed0('0x121')](db[_0xeed0('0xe4')],{'as':'Campaign','foreignKey':_0xeed0('0x1a2'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x6b')][_0xeed0('0x121')](db['User'],{'as':_0xeed0('0x175'),'foreignKey':_0xeed0('0x1a3')});db[_0xeed0('0x1a4')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xeed0('0x111')});db[_0xeed0('0x1a4')]['belongsTo'](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x1a4')]['belongsTo'](db['VoiceQueue'],{'as':_0xeed0('0x1a1'),'foreignKey':_0xeed0('0x14d'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x1a4')][_0xeed0('0x121')](db[_0xeed0('0xe4')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xeed0('0x111')});db[_0xeed0('0x75')][_0xeed0('0x112')](db[_0xeed0('0x7b')],{'as':{'plural':_0xeed0('0x1a5'),'singular':'OneAll'},'foreignKey':_0xeed0('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0xeed0('0x75')][_0xeed0('0x112')](db['Condition'],{'as':{'plural':_0xeed0('0x1a7'),'singular':_0xeed0('0x1a8')},'foreignKey':_0xeed0('0x1a9'),'onDelete':_0xeed0('0x111'),'hooks':!![]});db[_0xeed0('0x75')][_0xeed0('0x112')](db['Action'],{'as':_0xeed0('0x1aa'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xeed0('0x79')][_0xeed0('0x112')](db[_0xeed0('0x79')],{'as':'Dispositions','foreignKey':_0xeed0('0x1ab'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0x156')][_0xeed0('0x112')](db[_0xeed0('0x156')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xeed0('0x111'),'hooks':!![],'required':![]});db[_0xeed0('0x156')]['hasMany'](db[_0xeed0('0x115')],{'as':'Extensions','foreignKey':_0xeed0('0x157'),'onDelete':_0xeed0('0x168')});db[_0xeed0('0x156')][_0xeed0('0x112')](db[_0xeed0('0x3c')],{'as':_0xeed0('0x1ac'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x156')][_0xeed0('0x112')](db[_0xeed0('0x194')],{'as':_0xeed0('0x1ad'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x156')][_0xeed0('0x112')](db['FaxApplication'],{'as':_0xeed0('0x1ae'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0x156')][_0xeed0('0x112')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xeed0('0x157')});db[_0xeed0('0x83')][_0xeed0('0x121')](db[_0xeed0('0x35')],{});db['Schedule']['belongsTo'](db[_0xeed0('0x8d')],{'foreignKey':_0xeed0('0x1af')});db[_0xeed0('0x83')][_0xeed0('0x121')](db[_0xeed0('0x8b')],{'foreignKey':_0xeed0('0x1b0')});db[_0xeed0('0x14a')][_0xeed0('0x123')](db[_0xeed0('0x149')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xeed0('0x168')});db[_0xeed0('0x176')][_0xeed0('0x123')](db[_0xeed0('0x6a')],{'through':_0xeed0('0x1a0')});db[_0xeed0('0x176')][_0xeed0('0x123')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xeed0('0x3a')],{'through':_0xeed0('0x177')});db[_0xeed0('0x176')][_0xeed0('0x123')](db['SmsInteraction'],{'through':_0xeed0('0x189')});db[_0xeed0('0x176')]['belongsToMany'](db[_0xeed0('0x45')],{'through':_0xeed0('0x1b1')});db[_0xeed0('0x176')][_0xeed0('0x123')](db[_0xeed0('0x12c')],{'through':'openchannel_interaction_has_tags'});db[_0xeed0('0x176')][_0xeed0('0x123')](db[_0xeed0('0x11c')],{'through':_0xeed0('0x1b2')});db[_0xeed0('0x1b3')][_0xeed0('0x112')](db[_0xeed0('0x7b')],{'as':{'plural':_0xeed0('0x1b4'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0xeed0('0x111'),'hooks':!![]});db[_0xeed0('0x1b3')][_0xeed0('0x112')](db[_0xeed0('0x7b')],{'as':{'plural':'AnyConditions','singular':_0xeed0('0x1b5')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xeed0('0x1b3')][_0xeed0('0x112')](db[_0xeed0('0x1b6')],{'as':'Actions','foreignKey':_0xeed0('0x1b7'),'onDelete':'cascade','hooks':!![]});db[_0xeed0('0x8b')][_0xeed0('0x112')](db['AnalyticFieldReport'],{'as':_0xeed0('0x1b8'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xeed0('0x8d')][_0xeed0('0x112')](db[_0xeed0('0x92')],{'as':'Fields','onDelete':_0xeed0('0x111'),'foreignKey':'DefaultReportId'});db[_0xeed0('0x90')][_0xeed0('0x112')](db['AnalyticFieldReport'],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1b9')});db['AnalyticFieldReport'][_0xeed0('0x121')](db[_0xeed0('0x90')],{'foreignKey':_0xeed0('0x1b9')});db[_0xeed0('0x95')]['hasMany'](db[_0xeed0('0x97')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0xeed0('0x1ba'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bb')});db['SalesforceConfiguration'][_0xeed0('0x112')](db[_0xeed0('0x99')],{'as':'Descriptions','onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0x97')]['hasMany'](db[_0xeed0('0x99')],{'as':_0xeed0('0x1b8'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xeed0('0x97')][_0xeed0('0x121')](db[_0xeed0('0x95')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db['SalesforceField']['hasMany'](db[_0xeed0('0x99')],{'as':_0xeed0('0x1be'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0x99')]['hasMany'](db['SalesforceField'],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0x99')][_0xeed0('0x112')](db['SalesforceField'],{'as':'Field','foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0x99')][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':'Variable','foreignKey':_0xeed0('0x1c1')});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bd')});db['SugarcrmConfiguration'][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1ba'),'onDelete':'cascade','foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0x9d')][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1c2'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bc')});db['SugarcrmConfiguration'][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0x9d')][_0xeed0('0x121')](db[_0xeed0('0x9b')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0x9f')][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1be'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0x9f')][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0x9f')][_0xeed0('0x112')](db[_0xeed0('0x9f')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0x9f')][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':'VariableId'});db['DeskAccount'][_0xeed0('0x112')](db['DeskConfiguration'],{'as':_0xeed0('0x1c4'),'onDelete':_0xeed0('0x111'),'foreignKey':'AccountId'});db[_0xeed0('0xa2')]['hasMany'](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1ba'),'onDelete':_0xeed0('0x111'),'foreignKey':'SubjectId'});db[_0xeed0('0xa2')][_0xeed0('0x112')](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1c2'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xa2')][_0xeed0('0x112')](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0xa2')]['belongsTo'](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xeed0('0xa2')][_0xeed0('0x123')](db['Tag'],{'through':_0xeed0('0x1c5')});db['DeskField'][_0xeed0('0x112')](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1be'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0xa4')][_0xeed0('0x112')](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xa4')]['hasMany'](db[_0xeed0('0xa4')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['DeskField']['belongsTo'](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db[_0xeed0('0xa6')][_0xeed0('0x112')](db[_0xeed0('0xa8')],{'as':'Configurations','onDelete':_0xeed0('0x111'),'foreignKey':'AccountId'});db[_0xeed0('0xa8')][_0xeed0('0x112')](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1ba'),'onDelete':_0xeed0('0x111'),'foreignKey':'SubjectId'});db[_0xeed0('0xa8')][_0xeed0('0x112')](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1c2'),'onDelete':'cascade','foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xa8')][_0xeed0('0x112')](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0xa8')][_0xeed0('0x121')](db[_0xeed0('0xa6')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db['ZohoField']['hasMany'](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1be'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0xaa')]['hasMany'](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1bf'),'foreignKey':'DescriptionId'});db[_0xeed0('0xaa')][_0xeed0('0x112')](db[_0xeed0('0xaa')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['ZohoField']['belongsTo'](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db['ZendeskAccount'][_0xeed0('0x112')](db[_0xeed0('0xae')],{'as':_0xeed0('0x1c4'),'onDelete':_0xeed0('0x111'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xeed0('0x112')](db[_0xeed0('0x1c6')],{'as':'Subjects','foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0xae')][_0xeed0('0x112')](db[_0xeed0('0x1c6')],{'as':_0xeed0('0x1c2'),'foreignKey':'DescriptionId'});db[_0xeed0('0xae')][_0xeed0('0x112')](db[_0xeed0('0x1c6')],{'as':_0xeed0('0x1b8'),'foreignKey':_0xeed0('0x1c0')});db['ZendeskConfiguration'][_0xeed0('0x121')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xeed0('0x1bd')});db['ZendeskConfiguration'][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x1c7')});db[_0xeed0('0x1c6')]['hasMany'](db[_0xeed0('0x1c6')],{'as':_0xeed0('0x1be'),'foreignKey':'SubjectId'});db['ZendeskField'][_0xeed0('0x112')](db['ZendeskField'],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0x1c6')]['hasMany'](db[_0xeed0('0x1c6')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0x1c6')][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db[_0xeed0('0xb0')][_0xeed0('0x112')](db[_0xeed0('0xb1')],{'as':_0xeed0('0x1c4'),'onDelete':_0xeed0('0x111'),'foreignKey':'AccountId'});db[_0xeed0('0xb1')][_0xeed0('0x112')](db[_0xeed0('0xb3')],{'as':_0xeed0('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xeed0('0xb1')][_0xeed0('0x112')](db[_0xeed0('0xb3')],{'as':'Descriptions','onDelete':_0xeed0('0x111'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xeed0('0x112')](db['FreshdeskField'],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':'FieldId'});db[_0xeed0('0xb1')]['belongsTo'](db[_0xeed0('0xb0')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0xb1')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xeed0('0xb3')][_0xeed0('0x112')](db[_0xeed0('0xb3')],{'as':'Subject','foreignKey':_0xeed0('0x1bb')});db['FreshdeskField'][_0xeed0('0x112')](db['FreshdeskField'],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xb3')][_0xeed0('0x112')](db[_0xeed0('0xb3')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['FreshdeskField'][_0xeed0('0x121')](db['Variable'],{'as':_0xeed0('0x87'),'foreignKey':'VariableId'});db[_0xeed0('0xb4')][_0xeed0('0x112')](db['VtigerConfiguration'],{'as':_0xeed0('0x1c4'),'onDelete':_0xeed0('0x111'),'foreignKey':'AccountId'});db[_0xeed0('0xb6')]['hasMany'](db[_0xeed0('0xb8')],{'as':_0xeed0('0x1ba'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0xb6')]['hasMany'](db['VtigerField'],{'as':_0xeed0('0x1c2'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xb6')][_0xeed0('0x112')](db[_0xeed0('0xb8')],{'as':_0xeed0('0x1b8'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0xb6')]['belongsTo'](db['VtigerAccount'],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0xb8')]['hasMany'](db[_0xeed0('0xb8')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xeed0('0xb8')][_0xeed0('0x112')](db[_0xeed0('0xb8')],{'as':_0xeed0('0x1bf'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xb8')][_0xeed0('0x112')](db[_0xeed0('0xb8')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['VtigerField'][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db[_0xeed0('0xba')][_0xeed0('0x112')](db[_0xeed0('0x1c8')],{'as':_0xeed0('0x1c4'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0x1c8')][_0xeed0('0x112')](db['ServicenowField'],{'as':_0xeed0('0x1ba'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0x1c8')][_0xeed0('0x112')](db[_0xeed0('0xbd')],{'as':_0xeed0('0x1c2'),'foreignKey':'DescriptionId'});db[_0xeed0('0x1c8')][_0xeed0('0x112')](db[_0xeed0('0xbd')],{'as':_0xeed0('0x1b8'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0x1c8')][_0xeed0('0x121')](db[_0xeed0('0xba')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0xbd')][_0xeed0('0x112')](db['ServicenowField'],{'as':_0xeed0('0x1be'),'foreignKey':'SubjectId'});db[_0xeed0('0xbd')]['hasMany'](db['ServicenowField'],{'as':'Description','foreignKey':_0xeed0('0x1bc')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['ServicenowField'][_0xeed0('0x121')](db['Variable'],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db[_0xeed0('0xbe')]['hasMany'](db[_0xeed0('0xc0')],{'as':_0xeed0('0x1c4'),'onDelete':'cascade','foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0xbe')][_0xeed0('0x121')](db['CloudProvider'],{'as':_0xeed0('0x104'),'foreignKey':_0xeed0('0x167')});db['Dynamics365Configuration'][_0xeed0('0x112')](db[_0xeed0('0x1c9')],{'as':_0xeed0('0x1ba'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0xc0')][_0xeed0('0x112')](db[_0xeed0('0x1c9')],{'as':_0xeed0('0x1c2'),'onDelete':'cascade','foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xc0')][_0xeed0('0x112')](db['Dynamics365Field'],{'as':_0xeed0('0x1b8'),'onDelete':_0xeed0('0x111'),'foreignKey':'FieldId'});db[_0xeed0('0xc0')][_0xeed0('0x121')](db[_0xeed0('0xbe')],{'as':'Account','foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0x1c9')]['hasMany'](db[_0xeed0('0x1c9')],{'as':_0xeed0('0x1be'),'foreignKey':_0xeed0('0x1bb')});db[_0xeed0('0x1c9')]['hasMany'](db[_0xeed0('0x1c9')],{'as':'Description','foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0x1c9')][_0xeed0('0x112')](db[_0xeed0('0x1c9')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db['Dynamics365Field'][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db[_0xeed0('0xc3')][_0xeed0('0x112')](db['FreshsalesConfiguration'],{'as':_0xeed0('0x1c4'),'onDelete':'cascade','foreignKey':_0xeed0('0x1bd')});db[_0xeed0('0xc5')]['hasMany'](db['FreshsalesField'],{'as':_0xeed0('0x1ba'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xeed0('0x112')](db[_0xeed0('0xc7')],{'as':_0xeed0('0x1c2'),'foreignKey':_0xeed0('0x1bc')});db[_0xeed0('0xc5')][_0xeed0('0x112')](db[_0xeed0('0xc7')],{'as':_0xeed0('0x1b8'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0xc5')][_0xeed0('0x121')](db['FreshsalesAccount'],{'as':_0xeed0('0x17c'),'foreignKey':'AccountId'});db[_0xeed0('0xc7')]['hasMany'](db[_0xeed0('0xc7')],{'as':_0xeed0('0x1be'),'foreignKey':'SubjectId'});db[_0xeed0('0xc7')][_0xeed0('0x112')](db[_0xeed0('0xc7')],{'as':_0xeed0('0x1bf'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0xeed0('0x112')](db[_0xeed0('0xc7')],{'as':_0xeed0('0x1c3'),'foreignKey':_0xeed0('0x1c0')});db[_0xeed0('0xc7')][_0xeed0('0x121')](db[_0xeed0('0x87')],{'as':_0xeed0('0x87'),'foreignKey':_0xeed0('0x1c1')});db['ChatQueueReport']['belongsTo'](db[_0xeed0('0x5b')],{});db['ChatQueueReport']['belongsTo'](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':'ListId'});db[_0xeed0('0xcb')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165')});db[_0xeed0('0xcb')][_0xeed0('0x121')](db['ChatInteraction'],{});db[_0xeed0('0xcb')]['belongsTo'](db[_0xeed0('0x61')],{});db[_0xeed0('0xcb')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{});db[_0xeed0('0xcb')]['belongsTo'](db['ChatQueue'],{});db[_0xeed0('0xcd')][_0xeed0('0x121')](db['User'],{'onDelete':_0xeed0('0x111'),'foreignKey':'FromId'});db[_0xeed0('0xcd')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'onDelete':_0xeed0('0x111'),'foreignKey':'ToId'});db[_0xeed0('0xd3')][_0xeed0('0x112')](db[_0xeed0('0xd1')],{'foreignKey':_0xeed0('0x1ca'),'onDelete':'cascade'});db[_0xeed0('0xd3')][_0xeed0('0x112')](db[_0xeed0('0xcf')],{'foreignKey':_0xeed0('0x1ca'),'onDelete':'cascade'});db['SmsQueueReport'][_0xeed0('0x121')](db[_0xeed0('0x4b')],{});db[_0xeed0('0x1cb')]['belongsTo'](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':'ListId'});db[_0xeed0('0x1cb')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':'ContactId'});db[_0xeed0('0x1cb')]['belongsTo'](db[_0xeed0('0x4f')],{});db[_0xeed0('0x1cb')][_0xeed0('0x121')](db['SmsMessage'],{});db['SmsQueueReport'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{});db['SmsQueueReport']['belongsTo'](db[_0xeed0('0x53')],{});db[_0xeed0('0x1cc')][_0xeed0('0x112')](db[_0xeed0('0xd3')],{'foreignKey':'ProjectId'});db[_0xeed0('0x1cc')][_0xeed0('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0xeed0('0x1cd')});db['JscriptyProject'][_0xeed0('0x112')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0xeed0('0xdc')][_0xeed0('0x123')](db['User'],{'as':_0xeed0('0x17a'),'through':'user_has_square_projects'});db[_0xeed0('0xe0')]['belongsToMany'](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x1ce')});db[_0xeed0('0xe0')]['belongsToMany'](db[_0xeed0('0x19')],{'through':'TeamVoiceQueue','as':_0xeed0('0x12f')});db[_0xeed0('0xe0')][_0xeed0('0x123')](db[_0xeed0('0x37')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xeed0('0xe0')][_0xeed0('0x123')](db[_0xeed0('0x65')],{'through':_0xeed0('0x1cf'),'as':_0xeed0('0x132')});db[_0xeed0('0xe0')][_0xeed0('0x123')](db['FaxQueue'],{'through':_0xeed0('0x186'),'as':_0xeed0('0x134')});db[_0xeed0('0xe0')][_0xeed0('0x123')](db[_0xeed0('0x53')],{'through':_0xeed0('0x1d0'),'as':_0xeed0('0x136')});db['Team'][_0xeed0('0x123')](db['OpenchannelQueue'],{'through':_0xeed0('0x1d1'),'as':_0xeed0('0x137')});db[_0xeed0('0xe0')][_0xeed0('0x123')](db['WhatsappQueue'],{'through':_0xeed0('0x1d2'),'as':'WhatsappQueues'});db['Team'][_0xeed0('0x123')](db[_0xeed0('0xf3')],{'through':_0xeed0('0x108'),'as':_0xeed0('0x130')});db[_0xeed0('0xe4')][_0xeed0('0x112')](db[_0xeed0('0x6b')],{'as':_0xeed0('0x14e'),'foreignKey':_0xeed0('0x1a2')});db[_0xeed0('0xe4')][_0xeed0('0x112')](db[_0xeed0('0x6e')],{'as':_0xeed0('0x14f'),'foreignKey':_0xeed0('0x1a2')});db['Campaign'][_0xeed0('0x112')](db[_0xeed0('0x6f')],{'as':_0xeed0('0x150'),'foreignKey':'CampaignId'});db[_0xeed0('0xe4')][_0xeed0('0x112')](db['CmHopperBlack'],{'as':_0xeed0('0x151'),'foreignKey':'CampaignId'});db[_0xeed0('0xe4')][_0xeed0('0x121')](db[_0xeed0('0x153')],{'as':'Trunk','foreignKey':_0xeed0('0x154')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0xeed0('0x155'),'foreignKey':_0xeed0('0x1d3')});db['Campaign']['belongsTo'](db[_0xeed0('0x156')],{'as':_0xeed0('0x156'),'foreignKey':_0xeed0('0x157')});db[_0xeed0('0xe4')][_0xeed0('0x121')](db[_0xeed0('0xdc')],{'as':'SquareProject','foreignKey':_0xeed0('0x1d4')});db['Campaign']['belongsToMany'](db[_0xeed0('0xf1')],{'as':'Lists','through':_0xeed0('0x1d5')});db['Campaign']['belongsToMany'](db[_0xeed0('0xf1')],{'as':_0xeed0('0x1d6'),'through':'campaigns_has_cm_blacklists'});db[_0xeed0('0xe8')][_0xeed0('0x121')](db[_0xeed0('0x63')],{'as':_0xeed0('0x63'),'foreignKey':_0xeed0('0x17e')});db[_0xeed0('0x1d7')]['belongsTo'](db[_0xeed0('0x16d')],{});db[_0xeed0('0x1d7')][_0xeed0('0x121')](db[_0xeed0('0x3a')],{});db['MailTransferReport'][_0xeed0('0x121')](db['MailAccount'],{'foreignKey':_0xeed0('0x1d8'),'as':_0xeed0('0x1d9')});db[_0xeed0('0x1d7')]['belongsTo'](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1da'),'as':_0xeed0('0x1db')});db[_0xeed0('0x1d7')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1dc'),'as':_0xeed0('0x1dd')});db[_0xeed0('0x1d7')][_0xeed0('0x121')](db['MailQueue'],{'foreignKey':_0xeed0('0x1de'),'as':'ToQueue'});db['MailTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x35')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x61')],{});db['ChatTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x5f')],{});db[_0xeed0('0xeb')][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'foreignKey':_0xeed0('0x1df'),'as':_0xeed0('0x1d9')});db[_0xeed0('0xeb')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1da'),'as':'FromAgent'});db[_0xeed0('0xeb')][_0xeed0('0x121')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xeed0('0xeb')][_0xeed0('0x121')](db[_0xeed0('0x65')],{'foreignKey':_0xeed0('0x1e0'),'as':'ToQueue'});db['ChatTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x5b')],{'foreignKey':_0xeed0('0x1e1'),'as':_0xeed0('0x1e2')});db[_0xeed0('0xed')]['belongsTo'](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0xeed0('0x45')],{});db[_0xeed0('0xed')][_0xeed0('0x121')](db[_0xeed0('0x43')],{'foreignKey':_0xeed0('0x1e3'),'as':_0xeed0('0x1d9')});db['FaxTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1da'),'as':'FromAgent'});db[_0xeed0('0xed')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1dc'),'as':_0xeed0('0x1dd')});db['FaxTransferReport'][_0xeed0('0x121')](db['FaxQueue'],{'foreignKey':_0xeed0('0x1e4'),'as':_0xeed0('0x1e5')});db[_0xeed0('0xed')][_0xeed0('0x121')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0xeed0('0x1e2')});db[_0xeed0('0xee')][_0xeed0('0x121')](db[_0xeed0('0x18c')],{});db[_0xeed0('0xee')][_0xeed0('0x121')](db[_0xeed0('0x12c')],{});db['OpenchannelTransferReport'][_0xeed0('0x121')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xeed0('0x1d9')});db['OpenchannelTransferReport'][_0xeed0('0x121')](db['User'],{'foreignKey':_0xeed0('0x1da'),'as':'FromAgent'});db[_0xeed0('0xee')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1dc'),'as':_0xeed0('0x1dd')});db[_0xeed0('0xee')][_0xeed0('0x121')](db['OpenchannelQueue'],{'foreignKey':_0xeed0('0x1e6'),'as':_0xeed0('0x1e5')});db[_0xeed0('0xee')][_0xeed0('0x121')](db[_0xeed0('0x55')],{'foreignKey':'ToOpenchannelAccountId','as':_0xeed0('0x1e2')});db['SmsTransferReport'][_0xeed0('0x121')](db['SmsMessage'],{});db[_0xeed0('0xf0')][_0xeed0('0x121')](db['SmsInteraction'],{});db[_0xeed0('0xf0')][_0xeed0('0x121')](db['SmsAccount'],{'foreignKey':_0xeed0('0x1e7'),'as':_0xeed0('0x1d9')});db[_0xeed0('0xf0')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xeed0('0xf0')][_0xeed0('0x121')](db['User'],{'foreignKey':_0xeed0('0x1dc'),'as':_0xeed0('0x1dd')});db[_0xeed0('0xf0')]['belongsTo'](db[_0xeed0('0x53')],{'foreignKey':_0xeed0('0x1e8'),'as':_0xeed0('0x1e5')});db['SmsTransferReport'][_0xeed0('0x121')](db[_0xeed0('0x4b')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xeed0('0xf1')][_0xeed0('0x112')](db[_0xeed0('0x79')],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x170'),'onDelete':_0xeed0('0x111')});db['CmList'][_0xeed0('0x112')](db[_0xeed0('0x72')],{'as':_0xeed0('0x1e9'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0xf1')][_0xeed0('0x112')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x19d'),'onDelete':'cascade','foreignKey':_0xeed0('0x170')});db[_0xeed0('0xf1')][_0xeed0('0x112')](db[_0xeed0('0x6e')],{'as':_0xeed0('0x14f'),'foreignKey':'ListId'});db[_0xeed0('0xf1')][_0xeed0('0x112')](db[_0xeed0('0x6f')],{'as':_0xeed0('0x117'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0xf1')][_0xeed0('0x112')](db['ReportAgentPreview'],{'as':_0xeed0('0x118'),'foreignKey':'ListId'});db[_0xeed0('0xf1')][_0xeed0('0x123')](db[_0xeed0('0x19')],{'as':_0xeed0('0x1ea'),'through':_0xeed0('0x1eb')});db['CmList']['belongsToMany'](db['User'],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x126')});db[_0xeed0('0xf3')][_0xeed0('0x112')](db[_0xeed0('0x115')],{'as':'Extensions','onDelete':_0xeed0('0x111')});db[_0xeed0('0xf3')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x131')});db[_0xeed0('0xf3')][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'through':_0xeed0('0x108'),'as':_0xeed0('0x173')});db['UserProfile'][_0xeed0('0x112')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x17a'),'foreignKey':'userProfileId'});db['UserProfile'][_0xeed0('0x112')](db[_0xeed0('0xf6')],{'as':_0xeed0('0x1ec'),'foreignKey':_0xeed0('0x1ed'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0xf6')]['hasMany'](db[_0xeed0('0xf8')],{'as':_0xeed0('0x1ee'),'foreignKey':_0xeed0('0x1ef'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0xfb')][_0xeed0('0x112')](db[_0xeed0('0x79')],{'as':_0xeed0('0x16b'),'foreignKey':_0xeed0('0x1f0'),'onDelete':_0xeed0('0x111')});db[_0xeed0('0xfb')]['hasMany'](db[_0xeed0('0x77')],{'as':_0xeed0('0x16c'),'foreignKey':_0xeed0('0x1f0')});db['WhatsappAccount']['hasMany'](db[_0xeed0('0x1f1')],{'as':_0xeed0('0x15e'),'foreignKey':_0xeed0('0x1f0')});db['WhatsappAccount']['hasMany'](db[_0xeed0('0x11c')],{'as':_0xeed0('0x16e')});db[_0xeed0('0xfb')][_0xeed0('0x112')](db[_0xeed0('0xfd')],{'as':_0xeed0('0x148')});db[_0xeed0('0xfb')][_0xeed0('0x121')](db['CmList'],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0xfb')][_0xeed0('0x121')](db[_0xeed0('0x158')],{'as':_0xeed0('0x159'),'foreignKey':_0xeed0('0x15a')});db[_0xeed0('0xfb')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':'user_has_whatsapp_accounts'});db[_0xeed0('0xfd')][_0xeed0('0x121')](db['User'],{'onDelete':_0xeed0('0x168')});db[_0xeed0('0xfd')][_0xeed0('0x121')](db[_0xeed0('0x138')],{'onDelete':_0xeed0('0x168')});db[_0xeed0('0xfd')][_0xeed0('0x121')](db[_0xeed0('0xfb')],{'onDelete':_0xeed0('0x168')});db['WhatsappApplication'][_0xeed0('0x121')](db[_0xeed0('0x156')],{'onDelete':_0xeed0('0x168'),'foreignKey':'IntervalId'});db[_0xeed0('0xfd')][_0xeed0('0x121')](db[_0xeed0('0x176')],{'onDelete':_0xeed0('0x168'),'foreignKey':_0xeed0('0x183')});db[_0xeed0('0x11c')][_0xeed0('0x112')](db[_0xeed0('0x1f1')],{'as':_0xeed0('0x15e'),'onDelete':_0xeed0('0x111'),'foreignKey':_0xeed0('0x1f2')});db[_0xeed0('0x11c')][_0xeed0('0x121')](db['WhatsappAccount'],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1f0')});db['WhatsappInteraction'][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':'ContactId'});db[_0xeed0('0x11c')]['belongsTo'](db['User'],{'as':_0xeed0('0x175'),'foreignKey':_0xeed0('0x10f')});db[_0xeed0('0x11c')][_0xeed0('0x123')](db['Tag'],{'through':_0xeed0('0x1b2'),'as':_0xeed0('0x178')});db[_0xeed0('0x11c')][_0xeed0('0x123')](db[_0xeed0('0x176')],{'through':_0xeed0('0x1b2'),'as':_0xeed0('0x179')});db['WhatsappInteraction'][_0xeed0('0x123')](db['User'],{'as':_0xeed0('0x17a'),'through':_0xeed0('0x12e'),'foreignKey':_0xeed0('0x1f2')});db[_0xeed0('0x1f1')]['belongsTo'](db[_0xeed0('0x10d')],{'as':'User'});db[_0xeed0('0x1f1')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'onDelete':_0xeed0('0x111'),'as':'Contact'});db[_0xeed0('0x1f1')][_0xeed0('0x121')](db['WhatsappInteraction'],{'onDelete':_0xeed0('0x111'),'as':_0xeed0('0x17b'),'foreignKey':_0xeed0('0x1f2')});db[_0xeed0('0x1f1')]['belongsTo'](db[_0xeed0('0xfb')],{'as':_0xeed0('0x17c'),'foreignKey':_0xeed0('0x1f0')});db[_0xeed0('0x101')][_0xeed0('0x121')](db[_0xeed0('0xfb')],{});db[_0xeed0('0x101')][_0xeed0('0x121')](db[_0xeed0('0xf1')],{'as':_0xeed0('0x16f'),'foreignKey':_0xeed0('0x170')});db[_0xeed0('0x101')][_0xeed0('0x121')](db[_0xeed0('0x6a')],{'as':_0xeed0('0x164'),'foreignKey':_0xeed0('0x165')});db['WhatsappQueueReport'][_0xeed0('0x121')](db['WhatsappInteraction'],{});db[_0xeed0('0x101')][_0xeed0('0x121')](db[_0xeed0('0x138')],{});db[_0xeed0('0x101')]['belongsTo'](db[_0xeed0('0x1f1')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xeed0('0x10d')],{});db[_0xeed0('0x102')][_0xeed0('0x121')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0xeed0('0x11c')],{});db[_0xeed0('0x102')][_0xeed0('0x121')](db[_0xeed0('0xfb')],{'foreignKey':_0xeed0('0x1f3'),'as':'FromAccount'});db[_0xeed0('0x102')][_0xeed0('0x121')](db[_0xeed0('0xfb')],{'foreignKey':_0xeed0('0x1f4'),'as':_0xeed0('0x1e2')});db['WhatsappTransferReport'][_0xeed0('0x121')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xeed0('0x1e5')});db['WhatsappTransferReport'][_0xeed0('0x121')](db['User'],{'foreignKey':_0xeed0('0x1da'),'as':'FromAgent'});db[_0xeed0('0x102')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'foreignKey':_0xeed0('0x1dc'),'as':_0xeed0('0x1dd')});db[_0xeed0('0x138')][_0xeed0('0x123')](db[_0xeed0('0x10d')],{'as':_0xeed0('0x15b'),'through':_0xeed0('0x13a'),'foreignKey':_0xeed0('0x1f5')});db[_0xeed0('0x138')][_0xeed0('0x123')](db[_0xeed0('0xe0')],{'through':_0xeed0('0x1d2'),'as':'Teams'});db[_0xeed0('0x10b')][_0xeed0('0x121')](db[_0xeed0('0x10d')],{'as':'user','foreignKey':_0xeed0('0x10f'),'onDelete':_0xeed0('0x111'),'hooks':!![]});db[_0xeed0('0x104')][_0xeed0('0x10e')](db[_0xeed0('0xbe')],{'as':_0xeed0('0xbe'),'onDelete':_0xeed0('0x168')});db[_0xeed0('0x104')][_0xeed0('0x10e')](db[_0xeed0('0x32')],{'as':_0xeed0('0x169'),'onDelete':_0xeed0('0x168')});db['CloudProvider'][_0xeed0('0x10e')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xeed0('0x168')});module[_0xeed0('0x1f6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xcf44=['../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.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','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','cascade','VoiceRecording','Recordings','hasMany','CmHopperFinal','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','UserOpenchannelQueue','ChatWebsite','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Answers','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','Disposition','Dispositions','FaxAccountId','Exntensions','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','Applications','SmsInteractionId','user_has_sms_interactions','UserSmsQueue','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueue','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','CompanyId','CmHopper','HopperFinals','HopperHistories','cm_contact_has_tags','OwnerId','CampaignId','Automation','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','sms_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','Field','SugarcrmConfiguration','SugarcrmField','VariableId','Subjects','Descriptions','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','Dynamics365Configuration','Dynamics365Account','FreshsalesAccount','FreshsalesField','FreshsalesConfiguration','FromId','ToId','JscriptySessionReport','SessionId','ProjectId','JscriptyProject','user_has_teams','team_has_chat_queues','FaxQueues','WhatsappQueue','team_has_whatsapp_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','name','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../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','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model'];(function(_0x241516,_0xd3fe19){var _0x427c2c=function(_0x340b0e){while(--_0x340b0e){_0x241516['push'](_0x241516['shift']());}};_0x427c2c(++_0xd3fe19);}(_0xcf44,0x133));var _0x4cf4=function(_0x1a5eb8,_0x398e90){_0x1a5eb8=_0x1a5eb8-0x0;var _0x2fbe48=_0xcf44[_0x1a5eb8];return _0x2fbe48;};'use strict';var config=require(_0x4cf4('0x0'));var Sequelize=require(_0x4cf4('0x1'));var _=require(_0x4cf4('0x2'));var jstz=require(_0x4cf4('0x3'));var timezone=jstz[_0x4cf4('0x4')]();config[_0x4cf4('0x1')]=_[_0x4cf4('0x5')](config[_0x4cf4('0x1')],{'database':_0x4cf4('0x6'),'username':_0x4cf4('0x7'),'password':_0x4cf4('0x8'),'options':{'host':_0x4cf4('0x9'),'port':0xcea,'dialect':_0x4cf4('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4cf4('0xb'),'collate':_0x4cf4('0xc')}}});config[_0x4cf4('0xd')]=_['defaultsDeep'](config[_0x4cf4('0xd')],{'database':_0x4cf4('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x4cf4('0x9'),'port':0xcea,'dialect':_0x4cf4('0xa'),'dialectOptions':{'charset':_0x4cf4('0xe')},'logging':![],'timezone':timezone[_0x4cf4('0xf')](),'define':{'charset':_0x4cf4('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4cf4('0x10')],config['sequelize'][_0x4cf4('0x11')],config[_0x4cf4('0x1')]['password'],config[_0x4cf4('0x1')][_0x4cf4('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4cf4('0xd')][_0x4cf4('0x10')],config[_0x4cf4('0xd')][_0x4cf4('0x11')],config['sequelizeHistory'][_0x4cf4('0x13')],config['sequelizeHistory'][_0x4cf4('0x12')])};db[_0x4cf4('0x14')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x16'));db[_0x4cf4('0x17')]=db['sequelize'][_0x4cf4('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x4cf4('0x18')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x19'));db[_0x4cf4('0x1a')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x1b'));db[_0x4cf4('0x1c')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x1d'));db[_0x4cf4('0x1e')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x1f'));db['VoiceRecording']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x20'));db['ScreenRecording']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x21'));db[_0x4cf4('0x22')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x23'));db[_0x4cf4('0x24')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x25'));db[_0x4cf4('0x26')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x27'));db[_0x4cf4('0x28')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4cf4('0x29')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x4cf4('0x2a')]=db['sequelize'][_0x4cf4('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x4cf4('0x2b')]=db['sequelize'][_0x4cf4('0x15')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x2c'));db[_0x4cf4('0x2d')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x2e'));db[_0x4cf4('0x2f')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x30'));db[_0x4cf4('0x31')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x32'));db[_0x4cf4('0x33')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x34'));db[_0x4cf4('0x35')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/userMailQueue/userMailQueue.model');db[_0x4cf4('0x36')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x37'));db['UserSmsQueue']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x38'));db['UserOpenchannelQueue']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x39'));db[_0x4cf4('0x3a')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x4cf4('0x3b')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x3c'));db[_0x4cf4('0x3d')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x3e'));db[_0x4cf4('0x3f')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x40'));db[_0x4cf4('0x41')]=db[_0x4cf4('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0x4cf4('0x42')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x43'));db[_0x4cf4('0x44')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x45'));db[_0x4cf4('0x46')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/mailMessage/mailMessage.model');db[_0x4cf4('0x47')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/mailApplication/mailApplication.model');db[_0x4cf4('0x48')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x49'));db[_0x4cf4('0x4a')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x4b'));db[_0x4cf4('0x4c')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x4d'));db[_0x4cf4('0x4e')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x4f'));db[_0x4cf4('0x50')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x51'));db[_0x4cf4('0x52')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x53'));db[_0x4cf4('0x54')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/faxMessage/faxMessage.model');db[_0x4cf4('0x55')]=db['sequelize']['import'](_0x4cf4('0x56'));db[_0x4cf4('0x57')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0x4cf4('0x58')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x59'));db[_0x4cf4('0x5a')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x5b'));db[_0x4cf4('0x5c')]=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0x4cf4('0x5d')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x5e'));db[_0x4cf4('0x5f')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x60'));db[_0x4cf4('0x61')]=db['sequelize']['import'](_0x4cf4('0x62'));db[_0x4cf4('0x63')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x64'));db['OpenchannelInteraction']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x65'));db['OpenchannelMessage']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x66'));db['OpenchannelQueue']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x67'));db['ChatWebsite']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x68'));db[_0x4cf4('0x69')]=db[_0x4cf4('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x4cf4('0x6a')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/chatApplication/chatApplication.model');db[_0x4cf4('0x6b')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x6c'));db['ChatMessage']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x6d'));db['ChatOfflineMessage']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x6e'));db[_0x4cf4('0x6f')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x70'));db[_0x4cf4('0x71')]=db['sequelize'][_0x4cf4('0x15')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x72'));db[_0x4cf4('0x73')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/cmCompany/cmCompany.model');db[_0x4cf4('0x74')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x75'));db['CmHopper']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x76'));db[_0x4cf4('0x77')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x78'));db[_0x4cf4('0x79')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x7a'));db[_0x4cf4('0x7b')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x7c'));db[_0x4cf4('0x7d')]=db['sequelize']['import'](_0x4cf4('0x7e'));db[_0x4cf4('0x7f')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x80'));db['Automation']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x81'));db[_0x4cf4('0x82')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x83'));db['Disposition']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x84'));db[_0x4cf4('0x85')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x86'));db[_0x4cf4('0x87')]=db[_0x4cf4('0x1')]['import']('../api/interval/interval.model');db['Pause']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x88'));db['Cdr']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x89'));db['VoiceQueuesLog']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x8a'));db[_0x4cf4('0x8b')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x8c'));db[_0x4cf4('0x8d')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x8e'));db[_0x4cf4('0x8f')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x90'));db[_0x4cf4('0x91')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x92'));db['Trigger']=db[_0x4cf4('0x1')]['import']('../api/trigger/trigger.model');db[_0x4cf4('0x93')]=db[_0x4cf4('0x1')]['import']('../api/variable/variable.model');db[_0x4cf4('0x94')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x95'));db[_0x4cf4('0x96')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x97'));db[_0x4cf4('0x98')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4cf4('0x99')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x9a'));db['AnalyticExtractedReport']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x9b'));db[_0x4cf4('0x9c')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x9d'));db['AnalyticFieldReport']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x9e'));db[_0x4cf4('0x9f')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xa0'));db[_0x4cf4('0xa1')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xa2'));db[_0x4cf4('0xa3')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xa4'));db[_0x4cf4('0xa5')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xa6'));db[_0x4cf4('0xa7')]=db['sequelize']['import'](_0x4cf4('0xa8'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x4cf4('0xa9'));db['SugarcrmField']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xaa'));db[_0x4cf4('0xab')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xac'));db[_0x4cf4('0xad')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x4cf4('0xae')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xaf'));db[_0x4cf4('0xb0')]=db['sequelize']['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x4cf4('0xb1')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db['sequelize'][_0x4cf4('0x15')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xb2'));db[_0x4cf4('0xb3')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xb4'));db[_0x4cf4('0xb5')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xb6'));db[_0x4cf4('0xb7')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xb8'));db['FreshdeskConfiguration']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xb9'));db[_0x4cf4('0xba')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xbb'));db[_0x4cf4('0xbc')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xbd'));db[_0x4cf4('0xbe')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xbf'));db[_0x4cf4('0xc0')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xc1'));db['ServicenowAccount']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xc2'));db['ServicenowConfiguration']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xc3'));db[_0x4cf4('0xc4')]=db[_0x4cf4('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xc5'));db['Dynamics365Configuration']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xc6'));db[_0x4cf4('0xc7')]=db['sequelize']['import'](_0x4cf4('0xc8'));db['FreshsalesAccount']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xc9'));db['FreshsalesConfiguration']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xca'));db['FreshsalesField']=db['sequelize']['import'](_0x4cf4('0xcb'));db[_0x4cf4('0x94')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0x95'));db[_0x4cf4('0xcc')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xcd'));db[_0x4cf4('0xce')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xcf'));db[_0x4cf4('0xd0')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xd1'));db[_0x4cf4('0xd2')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xd3'));db[_0x4cf4('0xd4')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xd5'));db['JscriptySessionReport']=db[_0x4cf4('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x4cf4('0xd6')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xd7'));db['SquareReport']=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xd8'));db['JscriptyProject']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xd9'));db['Setting']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xda'));db[_0x4cf4('0xdb')]=db['sequelize'][_0x4cf4('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0x4cf4('0xdc')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xdd'));db[_0x4cf4('0xde')]=db[_0x4cf4('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x4cf4('0xdf')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xe0'));db[_0x4cf4('0xe1')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xe2'));db[_0x4cf4('0xe3')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xe4'));db[_0x4cf4('0xe5')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xe6'));db[_0x4cf4('0xe7')]=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xe8'));db[_0x4cf4('0xe9')]=db['sequelize'][_0x4cf4('0x15')]('../api/attachment/attachment.model');db[_0x4cf4('0xea')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xeb'));db[_0x4cf4('0xec')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x4cf4('0x1')]['import'](_0x4cf4('0xed'));db[_0x4cf4('0xee')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xef'));db[_0x4cf4('0xf0')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xf1'));db[_0x4cf4('0xf2')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0x4cf4('0xf3')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xf4'));db[_0x4cf4('0xf5')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xf6'));db['UserProfile']=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xf7'));db[_0x4cf4('0xf8')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0xf9'));db['UserProfileResource']=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0x4cf4('0xfa')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/userNotification/userNotification.model');db[_0x4cf4('0xfb')]=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0xfc'));db[_0x4cf4('0xfd')]=db['sequelize']['import'](_0x4cf4('0xfe'));db[_0x4cf4('0xff')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x100'));db[_0x4cf4('0x101')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0x4cf4('0x102')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x4cf4('0x103')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x104'));db['WhatsappQueue']=db['sequelize'][_0x4cf4('0x15')](_0x4cf4('0x105'));db['CloudProvider']=db['sequelize'][_0x4cf4('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0x4cf4('0x106')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x107'));db[_0x4cf4('0x108')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4cf4('0x109')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x10a'));db[_0x4cf4('0x10b')]=db[_0x4cf4('0x1')][_0x4cf4('0x15')](_0x4cf4('0x10c'));db[_0x4cf4('0x14')][_0x4cf4('0x10d')](db['VoiceMail'],{'as':_0x4cf4('0x22'),'onDelete':'cascade','foreignKey':_0x4cf4('0x10e')});db['User']['hasOne'](db[_0x4cf4('0x10b')],{'as':_0x4cf4('0x10f'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x14')]['hasMany'](db[_0x4cf4('0x111')],{'as':_0x4cf4('0x112'),'foreignKey':'UserId'});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db[_0x4cf4('0x2f')],{'as':'VoiceQueuesRt','foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x4cf4('0x110'),'hooks':!![]});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db[_0x4cf4('0x114')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db[_0x4cf4('0x79')],{'as':_0x4cf4('0x115'),'foreignKey':_0x4cf4('0x10e')});db['User'][_0x4cf4('0x113')](db[_0x4cf4('0x7b')],{'as':_0x4cf4('0x7b'),'foreignKey':_0x4cf4('0x10e')});db['User'][_0x4cf4('0x113')](db[_0x4cf4('0x116')],{'as':_0x4cf4('0x117'),'foreignKey':'UserId'});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db[_0x4cf4('0x6b')],{'as':_0x4cf4('0x118'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db[_0x4cf4('0x5c')],{'as':_0x4cf4('0x119'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x14')][_0x4cf4('0x113')](db['FaxInteraction'],{'as':_0x4cf4('0x11a'),'foreignKey':_0x4cf4('0x10e')});db['User'][_0x4cf4('0x113')](db[_0x4cf4('0x44')],{'as':_0x4cf4('0x11b'),'foreignKey':_0x4cf4('0x10e')});db['User'][_0x4cf4('0x113')](db[_0x4cf4('0xff')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User'][_0x4cf4('0x113')](db[_0x4cf4('0xfa')],{'as':_0x4cf4('0x11c'),'foreignKey':'SenderId'});db[_0x4cf4('0x14')][_0x4cf4('0x11d')](db[_0x4cf4('0x11e')],{'as':'UserProfile','foreignKey':_0x4cf4('0x11f')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x71')],{'as':_0x4cf4('0x121'),'through':'chat_group_has_users'});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db['CmContact'],{'as':_0x4cf4('0x122'),'through':_0x4cf4('0x123')});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x124'),'through':_0x4cf4('0x125')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0xe1')],{'through':'user_has_teams'});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x44')],{'as':'MailInteractions','through':_0x4cf4('0x126')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x6b')],{'as':'ChatInteractions','through':_0x4cf4('0x127')});db['User']['belongsToMany'](db[_0x4cf4('0x52')],{'as':_0x4cf4('0x11a'),'through':'user_has_fax_interactions'});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0x5c')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x116')],{'as':'OpenchannelInteractions','through':_0x4cf4('0x128')});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0xff')],{'as':_0x4cf4('0x129'),'through':_0x4cf4('0x12a')});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0x1e')],{'as':_0x4cf4('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0xf5')],{'as':_0x4cf4('0x12c'),'through':_0x4cf4('0x109'),'required':![]});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0x41')],{'as':_0x4cf4('0x12d'),'through':_0x4cf4('0x35'),'required':![]});db[_0x4cf4('0x14')]['belongsToMany'](db[_0x4cf4('0x6f')],{'as':_0x4cf4('0x12e'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x5f')],{'as':_0x4cf4('0x12f'),'through':'UserSmsQueue','required':![]});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x4cf4('0x130'),'required':![]});db['User']['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db['User']['belongsToMany'](db[_0x4cf4('0xf3')],{'through':_0x4cf4('0x125')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x131')],{'as':'ChatWebsites','through':_0x4cf4('0x132')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x4e')],{'as':_0x4cf4('0x133'),'through':'user_has_fax_accounts'});db['User'][_0x4cf4('0x120')](db['MailAccount'],{'as':_0x4cf4('0x134'),'through':_0x4cf4('0x135')});db['User'][_0x4cf4('0x120')](db[_0x4cf4('0x61')],{'as':_0x4cf4('0x136'),'through':_0x4cf4('0x137')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0x58')],{'as':_0x4cf4('0x138'),'through':_0x4cf4('0x139')});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0xfb')],{'as':_0x4cf4('0x13a'),'through':'user_has_whatsapp_accounts'});db[_0x4cf4('0x14')][_0x4cf4('0x120')](db[_0x4cf4('0xdc')],{'as':_0x4cf4('0x13b'),'through':_0x4cf4('0x13c')});db['VoiceChanSpy'][_0x4cf4('0x113')](db[_0x4cf4('0x1a')],{'as':_0x4cf4('0x13d'),'onDelete':'cascade','foreignKey':_0x4cf4('0x13e')});db['VoiceContext']['hasMany'](db[_0x4cf4('0x1a')],{'onDelete':_0x4cf4('0x110')});db['VoiceExtension'][_0x4cf4('0x113')](db[_0x4cf4('0x1a')],{'as':'Applications','onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x1c')][_0x4cf4('0x120')](db[_0x4cf4('0x8d')],{'as':_0x4cf4('0x13f'),'through':_0x4cf4('0x140')});db[_0x4cf4('0x1e')][_0x4cf4('0x113')](db['UserVoiceQueueRt'],{'as':_0x4cf4('0x141'),'foreignKey':_0x4cf4('0x142')});db[_0x4cf4('0x1e')][_0x4cf4('0x113')](db['CmHopper'],{'as':_0x4cf4('0x143'),'foreignKey':_0x4cf4('0x142')});db[_0x4cf4('0x1e')][_0x4cf4('0x113')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x4cf4('0x1e')][_0x4cf4('0x113')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x4cf4('0x142')});db[_0x4cf4('0x1e')][_0x4cf4('0x113')](db[_0x4cf4('0x7b')],{'as':_0x4cf4('0x7b'),'foreignKey':_0x4cf4('0x142')});db['VoiceQueue'][_0x4cf4('0x113')](db[_0x4cf4('0x77')],{'as':_0x4cf4('0x144'),'foreignKey':_0x4cf4('0x142')});db['VoiceQueue'][_0x4cf4('0x113')](db['JscriptySessionReport'],{'as':_0x4cf4('0x145'),'foreignKey':_0x4cf4('0x142')});db['VoiceQueue'][_0x4cf4('0x11d')](db[_0x4cf4('0x146')],{'as':_0x4cf4('0x146'),'foreignKey':_0x4cf4('0x147')});db['VoiceQueue'][_0x4cf4('0x11d')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x4cf4('0x148')});db['VoiceQueue'][_0x4cf4('0x11d')](db['Interval'],{'as':_0x4cf4('0x87'),'foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0x1e')][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db[_0x4cf4('0x1e')][_0x4cf4('0x120')](db['CmList'],{'as':_0x4cf4('0x124'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue']['belongsToMany'](db['User'],{'as':_0x4cf4('0x14d'),'through':'UserVoiceQueue'});db[_0x4cf4('0x1e')][_0x4cf4('0x120')](db['Team'],{'as':_0x4cf4('0x14e'),'through':_0x4cf4('0x106')});db['VoiceQueue'][_0x4cf4('0x120')](db[_0x4cf4('0xf3')],{'as':'BlackLists','through':_0x4cf4('0x14f')});db['VoiceRecording'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14'),'foreignKey':'UserId'});db[_0x4cf4('0x150')]['belongsTo'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x22')]['hasMany'](db[_0x4cf4('0x24')],{'as':_0x4cf4('0x151'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x152'),'sourceKey':_0x4cf4('0x153')});db[_0x4cf4('0x24')]['belongsTo'](db[_0x4cf4('0x22')],{'foreignKey':_0x4cf4('0x152'),'targetKey':_0x4cf4('0x153')});db[_0x4cf4('0x26')][_0x4cf4('0x113')](db[_0x4cf4('0x2a')],{'as':_0x4cf4('0x154'),'foreignKey':_0x4cf4('0x155'),'constraints':![]});db['VoiceCallReport'][_0x4cf4('0x113')](db[_0x4cf4('0x29')],{'as':'AgentReports','foreignKey':_0x4cf4('0x155'),'constraints':![]});db[_0x4cf4('0x26')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x26')][_0x4cf4('0x11d')](db['CmContact'],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['MailServerIn'][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{'as':_0x4cf4('0x3f'),'foreignKey':_0x4cf4('0x158')});db[_0x4cf4('0x3b')]['belongsTo'](db[_0x4cf4('0x159')],{'as':_0x4cf4('0x159'),'foreignKey':_0x4cf4('0x15a'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x3d')][_0x4cf4('0x11d')](db['MailAccount'],{'as':_0x4cf4('0x3f'),'foreignKey':'MailAccountId'});db[_0x4cf4('0x3d')]['belongsTo'](db[_0x4cf4('0x159')],{'as':_0x4cf4('0x159'),'foreignKey':'CloudProviderId','onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x3f')][_0x4cf4('0x10d')](db[_0x4cf4('0x3b')],{'as':_0x4cf4('0x15c'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x3f')]['hasOne'](db[_0x4cf4('0x3d')],{'as':_0x4cf4('0x15d'),'onDelete':'cascade'});db[_0x4cf4('0x3f')][_0x4cf4('0x113')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4cf4('0x158'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x3f')][_0x4cf4('0x113')](db[_0x4cf4('0x82')],{'as':_0x4cf4('0x15e'),'foreignKey':_0x4cf4('0x158')});db['MailAccount'][_0x4cf4('0x113')](db[_0x4cf4('0x46')],{'as':_0x4cf4('0x151'),'foreignKey':_0x4cf4('0x158')});db['MailAccount']['hasMany'](db['MailInteraction'],{'as':_0x4cf4('0x15f')});db[_0x4cf4('0x3f')][_0x4cf4('0x113')](db[_0x4cf4('0x47')],{'as':'Applications'});db[_0x4cf4('0x3f')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x3f')][_0x4cf4('0x11d')](db[_0x4cf4('0x91')],{'as':_0x4cf4('0x91'),'foreignKey':_0x4cf4('0x162')});db[_0x4cf4('0x3f')][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db['MailAccount'][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x135')});db[_0x4cf4('0x41')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x35')});db[_0x4cf4('0x41')][_0x4cf4('0x120')](db[_0x4cf4('0xe1')],{'through':_0x4cf4('0x163'),'as':'Teams'});db[_0x4cf4('0x44')][_0x4cf4('0x113')](db[_0x4cf4('0x46')],{'as':_0x4cf4('0x151'),'onDelete':'cascade','foreignKey':_0x4cf4('0x164')});db['MailInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x158')});db[_0x4cf4('0x44')]['belongsTo'](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['MailInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x166'),'foreignKey':'UserId'});db[_0x4cf4('0x44')][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':_0x4cf4('0x167'),'as':_0x4cf4('0x168')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0x4cf4('0x167'),'as':_0x4cf4('0x169')});db[_0x4cf4('0x44')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'through':_0x4cf4('0x126'),'foreignKey':_0x4cf4('0x164')});db['MailMessage'][_0x4cf4('0x113')](db[_0x4cf4('0xe9')],{'as':_0x4cf4('0x16b'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x46')][_0x4cf4('0x11d')](db['User'],{'as':_0x4cf4('0x14')});db[_0x4cf4('0x46')]['belongsTo'](db[_0x4cf4('0x74')],{'onDelete':_0x4cf4('0x110'),'as':'Contact'});db['MailMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0x44')],{'as':'Interaction','foreignKey':_0x4cf4('0x164')});db[_0x4cf4('0x46')][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{'as':_0x4cf4('0x165'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x4cf4('0x11d')](db['ChatWebsite'],{'as':_0x4cf4('0x131'),'foreignKey':_0x4cf4('0x16c')});db['MailMessage']['belongsTo'](db[_0x4cf4('0x16d')],{'as':_0x4cf4('0x16d'),'foreignKey':_0x4cf4('0x16e')});db[_0x4cf4('0x47')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x47')]['belongsTo'](db[_0x4cf4('0x41')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x47')][_0x4cf4('0x11d')](db['MailAccount'],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x47')][_0x4cf4('0x11d')](db[_0x4cf4('0x87')],{'onDelete':'restrict','foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0x47')][_0x4cf4('0x11d')](db[_0x4cf4('0x8f')],{'onDelete':_0x4cf4('0x15b'),'foreignKey':'TagId'});db['MailQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{});db[_0x4cf4('0x48')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':'ListId'});db[_0x4cf4('0x48')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':'ContactId'});db[_0x4cf4('0x48')][_0x4cf4('0x11d')](db['MailInteraction'],{});db['MailQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x46')],{});db[_0x4cf4('0x48')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{});db['MailQueueReport']['belongsTo'](db['MailQueue'],{});db[_0x4cf4('0x4a')][_0x4cf4('0x113')](db[_0x4cf4('0x4c')],{'as':'Items','onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x4e')][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x171'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x4e')]['hasMany'](db[_0x4cf4('0x82')],{'as':_0x4cf4('0x15e'),'foreignKey':_0x4cf4('0x171')});db[_0x4cf4('0x4e')]['hasMany'](db[_0x4cf4('0x52')],{'as':_0x4cf4('0x15f')});db[_0x4cf4('0x4e')][_0x4cf4('0x113')](db[_0x4cf4('0x50')],{'as':'Applications'});db[_0x4cf4('0x4e')][_0x4cf4('0x113')](db[_0x4cf4('0x1a')],{'as':_0x4cf4('0x172'),'onDelete':'cascade'});db[_0x4cf4('0x4e')][_0x4cf4('0x113')](db[_0x4cf4('0x54')],{'as':_0x4cf4('0x151')});db[_0x4cf4('0x4e')]['belongsTo'](db[_0x4cf4('0x146')],{'as':_0x4cf4('0x146')});db[_0x4cf4('0x4e')]['belongsTo'](db[_0x4cf4('0xf3')],{'as':'List','foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x4e')][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db[_0x4cf4('0x4e')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x173')});db[_0x4cf4('0x50')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x50')]['belongsTo'](db[_0x4cf4('0x55')],{'onDelete':_0x4cf4('0x15b')});db['FaxApplication'][_0x4cf4('0x11d')](db['FaxAccount'],{'onDelete':'restrict'});db[_0x4cf4('0x50')][_0x4cf4('0x11d')](db[_0x4cf4('0x8f')],{'onDelete':'restrict','foreignKey':_0x4cf4('0x174')});db[_0x4cf4('0x52')][_0x4cf4('0x113')](db[_0x4cf4('0x54')],{'as':_0x4cf4('0x151'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x175')});db[_0x4cf4('0x52')][_0x4cf4('0x11d')](db['FaxAccount'],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x171')});db['FaxInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['FaxInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0x4cf4('0x52')]['belongsToMany'](db['Tag'],{'through':_0x4cf4('0x176'),'as':_0x4cf4('0x168')});db[_0x4cf4('0x52')][_0x4cf4('0x120')](db['Tag'],{'through':_0x4cf4('0x176'),'as':_0x4cf4('0x169')});db['FaxInteraction']['belongsToMany'](db[_0x4cf4('0x14')],{'as':'Users','through':_0x4cf4('0x177'),'foreignKey':_0x4cf4('0x175')});db['FaxMessage'][_0x4cf4('0x11d')](db['User'],{'onDelete':_0x4cf4('0x110'),'as':'User'});db['FaxMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0x52')],{'as':_0x4cf4('0x178'),'foreignKey':'FaxInteractionId'});db[_0x4cf4('0x54')]['belongsTo'](db[_0x4cf4('0x74')],{'onDelete':_0x4cf4('0x110'),'as':_0x4cf4('0x156')});db['FaxMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0xe9')],{'as':_0x4cf4('0xe9'),'foreignKey':_0x4cf4('0x179')});db[_0x4cf4('0x54')]['belongsTo'](db['FaxAccount'],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x171')});db[_0x4cf4('0x55')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x36')});db['FaxQueue']['belongsToMany'](db[_0x4cf4('0xe1')],{'through':_0x4cf4('0x17a'),'as':_0x4cf4('0x14e')});db[_0x4cf4('0x57')][_0x4cf4('0x11d')](db['FaxAccount'],{});db[_0x4cf4('0x57')]['belongsTo'](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x57')]['belongsTo'](db[_0x4cf4('0x74')],{'as':'Contact','foreignKey':_0x4cf4('0x157')});db['FaxQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x52')],{});db[_0x4cf4('0x57')]['belongsTo'](db['FaxMessage'],{});db[_0x4cf4('0x57')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{});db[_0x4cf4('0x57')]['belongsTo'](db[_0x4cf4('0x55')],{});db[_0x4cf4('0x58')][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x17b'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x58')][_0x4cf4('0x113')](db[_0x4cf4('0x82')],{'as':'Answers','foreignKey':_0x4cf4('0x17b')});db['SmsAccount']['hasMany'](db['SmsMessage'],{'as':_0x4cf4('0x151'),'foreignKey':_0x4cf4('0x17b')});db[_0x4cf4('0x58')][_0x4cf4('0x113')](db['SmsInteraction'],{'as':_0x4cf4('0x15f')});db['SmsAccount'][_0x4cf4('0x113')](db[_0x4cf4('0x5a')],{'as':_0x4cf4('0x17c')});db['SmsAccount']['belongsTo'](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x58')]['belongsTo'](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db[_0x4cf4('0x58')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':'user_has_sms_accounts'});db[_0x4cf4('0x5a')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x5a')]['belongsTo'](db[_0x4cf4('0x5f')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x5a')][_0x4cf4('0x11d')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x4cf4('0x5a')][_0x4cf4('0x11d')](db[_0x4cf4('0x87')],{'onDelete':'restrict','foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0x5a')][_0x4cf4('0x11d')](db['Tag'],{'onDelete':_0x4cf4('0x15b'),'foreignKey':_0x4cf4('0x174')});db[_0x4cf4('0x5c')][_0x4cf4('0x113')](db[_0x4cf4('0x5d')],{'as':_0x4cf4('0x151'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x17d')});db['SmsInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x58')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x4cf4('0x5c')][_0x4cf4('0x11d')](db['CmContact'],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['SmsInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x166'),'foreignKey':_0x4cf4('0x10e')});db['SmsInteraction'][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':'sms_interaction_has_tags','as':_0x4cf4('0x168')});db[_0x4cf4('0x5c')][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':'sms_interaction_has_tags','as':_0x4cf4('0x169')});db[_0x4cf4('0x5c')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'through':_0x4cf4('0x17e'),'foreignKey':_0x4cf4('0x17d')});db['SmsMessage'][_0x4cf4('0x11d')](db['User'],{'as':_0x4cf4('0x14')});db[_0x4cf4('0x5d')]['belongsTo'](db[_0x4cf4('0x74')],{'onDelete':'cascade','as':_0x4cf4('0x156')});db[_0x4cf4('0x5d')]['belongsTo'](db[_0x4cf4('0x5c')],{'onDelete':'cascade','as':_0x4cf4('0x178'),'foreignKey':_0x4cf4('0x17d')});db[_0x4cf4('0x5d')][_0x4cf4('0x11d')](db[_0x4cf4('0x58')],{'as':'Account','foreignKey':_0x4cf4('0x17b')});db[_0x4cf4('0x5f')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x17f'),'foreignKey':'SmsQueueId'});db[_0x4cf4('0x5f')][_0x4cf4('0x120')](db[_0x4cf4('0xe1')],{'through':_0x4cf4('0x180'),'as':_0x4cf4('0x14e')});db[_0x4cf4('0x61')][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x181'),'onDelete':_0x4cf4('0x110')});db['OpenchannelAccount'][_0x4cf4('0x113')](db[_0x4cf4('0x82')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x4cf4('0x61')]['hasMany'](db[_0x4cf4('0x116')],{'as':_0x4cf4('0x15f'),'foreignKey':_0x4cf4('0x181')});db['OpenchannelAccount'][_0x4cf4('0x113')](db[_0x4cf4('0x182')],{'as':_0x4cf4('0x151'),'foreignKey':_0x4cf4('0x181')});db[_0x4cf4('0x61')][_0x4cf4('0x113')](db[_0x4cf4('0x63')],{'as':_0x4cf4('0x17c'),'foreignKey':'OpenchannelAccountId'});db[_0x4cf4('0x61')][_0x4cf4('0x11d')](db['CmList'],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db['OpenchannelAccount'][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db['OpenchannelAccount'][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':'restrict'});db[_0x4cf4('0x63')]['belongsTo'](db[_0x4cf4('0x183')],{'onDelete':_0x4cf4('0x15b'),'foreignKey':_0x4cf4('0x184')});db[_0x4cf4('0x63')][_0x4cf4('0x11d')](db[_0x4cf4('0x61')],{'onDelete':_0x4cf4('0x15b'),'foreignKey':_0x4cf4('0x181')});db['OpenchannelApplication'][_0x4cf4('0x11d')](db[_0x4cf4('0x87')],{'onDelete':'restrict','foreignKey':_0x4cf4('0x149')});db['OpenchannelApplication'][_0x4cf4('0x11d')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4cf4('0x174')});db[_0x4cf4('0x116')][_0x4cf4('0x113')](db[_0x4cf4('0x182')],{'as':_0x4cf4('0x151'),'onDelete':_0x4cf4('0x110'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x61')],{'as':_0x4cf4('0x165'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['OpenchannelInteraction']['belongsTo'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x166'),'foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0x116')][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x4cf4('0x116')][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':_0x4cf4('0x185'),'as':_0x4cf4('0x169')});db[_0x4cf4('0x116')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':'Users','through':_0x4cf4('0x128'),'foreignKey':_0x4cf4('0x186')});db[_0x4cf4('0x182')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':_0x4cf4('0x110'),'as':'User'});db['OpenchannelMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'onDelete':_0x4cf4('0x110'),'as':_0x4cf4('0x156')});db['OpenchannelMessage']['belongsTo'](db[_0x4cf4('0x116')],{'onDelete':'cascade','as':_0x4cf4('0x178'),'foreignKey':_0x4cf4('0x186')});db[_0x4cf4('0x182')][_0x4cf4('0x11d')](db[_0x4cf4('0xe9')],{'as':_0x4cf4('0xe9'),'foreignKey':_0x4cf4('0x179')});db[_0x4cf4('0x182')][_0x4cf4('0x11d')](db[_0x4cf4('0x61')],{'as':_0x4cf4('0x165'),'foreignKey':'OpenchannelAccountId'});db[_0x4cf4('0x183')][_0x4cf4('0x120')](db['User'],{'as':'Agents','through':_0x4cf4('0x130'),'foreignKey':_0x4cf4('0x184')});db[_0x4cf4('0x183')][_0x4cf4('0x120')](db['Team'],{'through':_0x4cf4('0x187'),'as':_0x4cf4('0x14e')});db[_0x4cf4('0x131')]['hasMany'](db['Disposition'],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x16c'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x131')]['hasMany'](db[_0x4cf4('0x82')],{'as':_0x4cf4('0x15e'),'foreignKey':_0x4cf4('0x16c')});db[_0x4cf4('0x131')][_0x4cf4('0x113')](db[_0x4cf4('0x188')],{'as':_0x4cf4('0x189')});db[_0x4cf4('0x131')][_0x4cf4('0x113')](db[_0x4cf4('0x6b')],{'as':_0x4cf4('0x15f')});db[_0x4cf4('0x131')][_0x4cf4('0x113')](db[_0x4cf4('0x6a')],{'as':_0x4cf4('0x17c')});db[_0x4cf4('0x131')]['hasMany'](db[_0x4cf4('0x18a')],{'as':'Messages'});db[_0x4cf4('0x131')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x131')]['belongsTo'](db[_0x4cf4('0x87')],{'as':_0x4cf4('0x87'),'foreignKey':'IntervalId'});db[_0x4cf4('0x131')][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{'as':_0x4cf4('0x3f'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4cf4('0x131')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x132')});db[_0x4cf4('0x69')]['belongsTo'](db[_0x4cf4('0x61')],{});db[_0x4cf4('0x69')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':'ListId'});db[_0x4cf4('0x69')][_0x4cf4('0x11d')](db['CmContact'],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db['OpenchannelQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x116')],{});db[_0x4cf4('0x69')][_0x4cf4('0x11d')](db[_0x4cf4('0x182')],{});db['OpenchannelQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{});db[_0x4cf4('0x69')][_0x4cf4('0x11d')](db[_0x4cf4('0x183')],{});db[_0x4cf4('0x6a')]['belongsTo'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x18b'),'foreignKey':_0x4cf4('0x10e'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x6a')][_0x4cf4('0x11d')](db['ChatQueue'],{'as':_0x4cf4('0x18c'),'foreignKey':_0x4cf4('0x18d'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x6a')]['belongsTo'](db[_0x4cf4('0x131')],{'as':_0x4cf4('0x18e'),'foreignKey':_0x4cf4('0x16c'),'onDelete':_0x4cf4('0x15b')});db['ChatApplication'][_0x4cf4('0x11d')](db[_0x4cf4('0x8f')],{'onDelete':_0x4cf4('0x15b'),'foreignKey':_0x4cf4('0x174')});db[_0x4cf4('0x6b')][_0x4cf4('0x113')](db['ChatMessage'],{'as':'Messages','onDelete':_0x4cf4('0x110'),'foreignKey':'ChatInteractionId'});db[_0x4cf4('0x6b')][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x16c')});db[_0x4cf4('0x6b')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':'ContactId'});db[_0x4cf4('0x6b')]['belongsTo'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x166'),'foreignKey':_0x4cf4('0x10e')});db['ChatInteraction'][_0x4cf4('0x120')](db['Tag'],{'through':_0x4cf4('0x18f'),'as':_0x4cf4('0x168')});db['ChatInteraction'][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':_0x4cf4('0x18f'),'as':_0x4cf4('0x169')});db[_0x4cf4('0x6b')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'through':_0x4cf4('0x127'),'foreignKey':_0x4cf4('0x190')});db[_0x4cf4('0x18a')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':_0x4cf4('0x110'),'as':_0x4cf4('0x14')});db[_0x4cf4('0x18a')]['belongsTo'](db[_0x4cf4('0x74')],{'onDelete':'cascade','as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0x18a')][_0x4cf4('0x11d')](db[_0x4cf4('0x6b')],{'onDelete':'cascade','as':_0x4cf4('0x178'),'foreignKey':'ChatInteractionId'});db[_0x4cf4('0x18a')][_0x4cf4('0x11d')](db[_0x4cf4('0xe9')],{'as':'Attachment','foreignKey':_0x4cf4('0x179')});db[_0x4cf4('0x18a')][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x16c')});db[_0x4cf4('0x16d')][_0x4cf4('0x113')](db[_0x4cf4('0xe9')],{'as':_0x4cf4('0x16b'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x4cf4('0x110'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0x4cf4('0x74')],{'onDelete':_0x4cf4('0x110'),'as':'Contact','foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0x16d')][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'as':'Account','foreignKey':_0x4cf4('0x16c')});db[_0x4cf4('0x6f')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x4cf4('0xe1')],{'through':'team_has_chat_queues','as':_0x4cf4('0x14e')});db[_0x4cf4('0x71')][_0x4cf4('0x113')](db[_0x4cf4('0xd0')],{'as':_0x4cf4('0x151'),'foreignKey':_0x4cf4('0x191'),'onDelete':_0x4cf4('0x110')});db['ChatGroup']['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x141'),'through':'chat_group_has_users'});db[_0x4cf4('0x188')][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'as':_0x4cf4('0x18e'),'foreignKey':'ChatWebsiteId'});db[_0x4cf4('0x73')]['hasMany'](db['CmContact'],{'as':_0x4cf4('0x122'),'foreignKey':_0x4cf4('0x192')});db['CmContact'][_0x4cf4('0x113')](db[_0x4cf4('0x193')],{'as':_0x4cf4('0x143'),'foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db[_0x4cf4('0x114')],{'as':_0x4cf4('0x194'),'foreignKey':_0x4cf4('0x157')});db['CmContact'][_0x4cf4('0x113')](db[_0x4cf4('0x79')],{'as':_0x4cf4('0x195'),'foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db[_0x4cf4('0x7b')],{'as':_0x4cf4('0x7b'),'foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0x4cf4('0x113')](db['OpenchannelInteraction'],{'as':_0x4cf4('0x117'),'foreignKey':_0x4cf4('0x157'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db[_0x4cf4('0x6b')],{'as':'ChatInteractions','foreignKey':_0x4cf4('0x157'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db[_0x4cf4('0x52')],{'as':_0x4cf4('0x11a'),'foreignKey':_0x4cf4('0x157'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x74')][_0x4cf4('0x113')](db['MailInteraction'],{'as':_0x4cf4('0x11b'),'foreignKey':'ContactId','onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x74')][_0x4cf4('0x11d')](db['CmCompany'],{'as':'Company','foreignKey':_0x4cf4('0x192')});db[_0x4cf4('0x74')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161'),'onDelete':_0x4cf4('0x110')});db['CmContact'][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'through':'cm_user_has_contacts'});db[_0x4cf4('0x74')][_0x4cf4('0x120')](db['Tag'],{'as':_0x4cf4('0x168'),'through':_0x4cf4('0x196')});db[_0x4cf4('0x74')][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':_0x4cf4('0x196'),'as':'ThroughTags'});db[_0x4cf4('0x193')]['belongsTo'](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x193')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x193')][_0x4cf4('0x11d')](db['User'],{'as':_0x4cf4('0x18b'),'foreignKey':'UserId'});db['CmHopper'][_0x4cf4('0x11d')](db[_0x4cf4('0x1e')],{'as':_0x4cf4('0x18c'),'foreignKey':_0x4cf4('0x142'),'onDelete':_0x4cf4('0x110')});db['CmHopper'][_0x4cf4('0x11d')](db['Campaign'],{'as':_0x4cf4('0xe5'),'foreignKey':'CampaignId','onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x193')]['belongsTo'](db['User'],{'as':_0x4cf4('0x166'),'foreignKey':_0x4cf4('0x197')});db['CmHopperBlack'][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':_0x4cf4('0x157'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x77')][_0x4cf4('0x11d')](db['CmList'],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x77')][_0x4cf4('0x11d')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x4cf4('0x142'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x77')][_0x4cf4('0x11d')](db['Campaign'],{'as':_0x4cf4('0xe5'),'foreignKey':_0x4cf4('0x198'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x199')][_0x4cf4('0x113')](db[_0x4cf4('0x85')],{'as':{'plural':'All','singular':_0x4cf4('0x19a')},'foreignKey':_0x4cf4('0x19b'),'onDelete':_0x4cf4('0x110'),'hooks':!![]});db[_0x4cf4('0x199')]['hasMany'](db[_0x4cf4('0x85')],{'as':{'plural':_0x4cf4('0x19c'),'singular':_0x4cf4('0x19d')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x4cf4('0x199')][_0x4cf4('0x113')](db['Action'],{'as':_0x4cf4('0x19e'),'foreignKey':_0x4cf4('0x19f'),'onDelete':_0x4cf4('0x110'),'hooks':!![]});db[_0x4cf4('0x16f')][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x1a0'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0x87')][_0x4cf4('0x113')](db[_0x4cf4('0x87')],{'as':_0x4cf4('0x1a1'),'foreignKey':_0x4cf4('0x149'),'onDelete':_0x4cf4('0x110'),'hooks':!![],'required':![]});db['Interval'][_0x4cf4('0x113')](db[_0x4cf4('0x1a')],{'as':_0x4cf4('0x1a2'),'foreignKey':_0x4cf4('0x149'),'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0x87')]['hasMany'](db[_0x4cf4('0x47')],{'as':_0x4cf4('0x1a3'),'foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0x87')][_0x4cf4('0x113')](db[_0x4cf4('0x6a')],{'as':'ChatApplications','foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0x87')][_0x4cf4('0x113')](db[_0x4cf4('0x50')],{'as':_0x4cf4('0x1a4'),'foreignKey':_0x4cf4('0x149')});db['Interval']['hasMany'](db[_0x4cf4('0x5a')],{'as':_0x4cf4('0x1a5'),'foreignKey':'IntervalId'});db[_0x4cf4('0x8b')][_0x4cf4('0x11d')](db[_0x4cf4('0x3f')],{});db[_0x4cf4('0x8b')][_0x4cf4('0x11d')](db[_0x4cf4('0x99')],{'foreignKey':_0x4cf4('0x1a6')});db[_0x4cf4('0x8b')][_0x4cf4('0x11d')](db[_0x4cf4('0x98')],{'foreignKey':_0x4cf4('0x1a7')});db[_0x4cf4('0x8d')]['belongsToMany'](db[_0x4cf4('0x1c')],{'as':_0x4cf4('0x1a8'),'through':_0x4cf4('0x140'),'onDelete':'restrict'});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0x74')],{'through':_0x4cf4('0x196')});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0x6b')],{'through':_0x4cf4('0x18f')});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0x44')],{'through':_0x4cf4('0x167')});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0x5c')],{'through':_0x4cf4('0x1a9')});db['Tag'][_0x4cf4('0x120')](db[_0x4cf4('0x52')],{'through':'fax_interaction_has_tags'});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0x116')],{'through':'openchannel_interaction_has_tags'});db[_0x4cf4('0x8f')][_0x4cf4('0x120')](db[_0x4cf4('0xff')],{'through':_0x4cf4('0x1aa')});db[_0x4cf4('0x1ab')][_0x4cf4('0x113')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x4cf4('0x1ac')},'foreignKey':_0x4cf4('0x1ad'),'onDelete':_0x4cf4('0x110'),'hooks':!![]});db[_0x4cf4('0x1ab')][_0x4cf4('0x113')](db[_0x4cf4('0x85')],{'as':{'plural':_0x4cf4('0x1ae'),'singular':_0x4cf4('0x1af')},'foreignKey':_0x4cf4('0x1b0'),'onDelete':_0x4cf4('0x110'),'hooks':!![]});db[_0x4cf4('0x1ab')][_0x4cf4('0x113')](db[_0x4cf4('0x7f')],{'as':'Actions','foreignKey':_0x4cf4('0x1b1'),'onDelete':_0x4cf4('0x110'),'hooks':!![]});db['AnalyticCustomReport'][_0x4cf4('0x113')](db[_0x4cf4('0x1b2')],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x4cf4('0x99')][_0x4cf4('0x113')](db[_0x4cf4('0x1b2')],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1a6')});db['AnalyticMetric'][_0x4cf4('0x113')](db[_0x4cf4('0x1b2')],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b4')});db[_0x4cf4('0x1b2')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x4cf4('0x1b4')});db[_0x4cf4('0xa1')][_0x4cf4('0x113')](db[_0x4cf4('0xa3')],{'as':_0x4cf4('0x1b5'),'onDelete':_0x4cf4('0x110'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0x4cf4('0xa5')],{'as':'Subjects','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xa3')][_0x4cf4('0x113')](db[_0x4cf4('0xa5')],{'as':'Descriptions','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xa3')]['hasMany'](db[_0x4cf4('0xa5')],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xa3')][_0x4cf4('0x11d')](db[_0x4cf4('0xa1')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xa5')][_0x4cf4('0x113')](db['SalesforceField'],{'as':_0x4cf4('0x1ba'),'foreignKey':_0x4cf4('0x1b6')});db['SalesforceField'][_0x4cf4('0x113')](db[_0x4cf4('0xa5')],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xa5')][_0x4cf4('0x113')](db[_0x4cf4('0xa5')],{'as':_0x4cf4('0x1bc'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xa5')]['belongsTo'](db[_0x4cf4('0x93')],{'as':_0x4cf4('0x93'),'foreignKey':'VariableId'});db[_0x4cf4('0xa7')][_0x4cf4('0x113')](db['SugarcrmConfiguration'],{'as':_0x4cf4('0x1b5'),'onDelete':_0x4cf4('0x110'),'foreignKey':'AccountId'});db[_0x4cf4('0x1bd')][_0x4cf4('0x113')](db[_0x4cf4('0x1be')],{'as':'Subjects','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0x1bd')]['hasMany'](db[_0x4cf4('0x1be')],{'as':'Descriptions','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0x1bd')][_0x4cf4('0x113')](db[_0x4cf4('0x1be')],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0x1bd')][_0x4cf4('0x11d')](db[_0x4cf4('0xa7')],{'as':_0x4cf4('0x165'),'foreignKey':'AccountId'});db[_0x4cf4('0x1be')]['hasMany'](db[_0x4cf4('0x1be')],{'as':'Subject','foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0x1be')][_0x4cf4('0x113')](db[_0x4cf4('0x1be')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4cf4('0x1be')][_0x4cf4('0x113')](db[_0x4cf4('0x1be')],{'as':'Field','foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0x1be')][_0x4cf4('0x11d')](db['Variable'],{'as':'Variable','foreignKey':_0x4cf4('0x1bf')});db['DeskAccount'][_0x4cf4('0x113')](db[_0x4cf4('0xad')],{'as':_0x4cf4('0x1b5'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xad')][_0x4cf4('0x113')](db[_0x4cf4('0xae')],{'as':_0x4cf4('0x1c0'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xad')][_0x4cf4('0x113')](db[_0x4cf4('0xae')],{'as':_0x4cf4('0x1c1'),'onDelete':'cascade','foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xad')][_0x4cf4('0x113')](db['DeskField'],{'as':_0x4cf4('0x1b3'),'onDelete':'cascade','foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xad')][_0x4cf4('0x11d')](db[_0x4cf4('0xab')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db['DeskConfiguration'][_0x4cf4('0x120')](db['Tag'],{'through':_0x4cf4('0x1c2')});db[_0x4cf4('0xae')][_0x4cf4('0x113')](db['DeskField'],{'as':_0x4cf4('0x1ba'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xae')][_0x4cf4('0x113')](db[_0x4cf4('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4cf4('0xae')][_0x4cf4('0x113')](db[_0x4cf4('0xae')],{'as':_0x4cf4('0x1bc'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xae')][_0x4cf4('0x11d')](db[_0x4cf4('0x93')],{'as':_0x4cf4('0x93'),'foreignKey':_0x4cf4('0x1bf')});db['ZohoAccount'][_0x4cf4('0x113')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xb1')][_0x4cf4('0x113')](db[_0x4cf4('0x1c3')],{'as':'Subjects','onDelete':_0x4cf4('0x110'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x4cf4('0x113')](db[_0x4cf4('0x1c3')],{'as':'Descriptions','onDelete':_0x4cf4('0x110'),'foreignKey':'DescriptionId'});db[_0x4cf4('0xb1')][_0x4cf4('0x113')](db['ZohoField'],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x4cf4('0x11d')](db[_0x4cf4('0xb0')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db['ZohoField'][_0x4cf4('0x113')](db[_0x4cf4('0x1c3')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0x1c3')][_0x4cf4('0x113')](db[_0x4cf4('0x1c3')],{'as':'Field','foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0x1c3')][_0x4cf4('0x11d')](db['Variable'],{'as':_0x4cf4('0x93'),'foreignKey':_0x4cf4('0x1bf')});db['ZendeskAccount'][_0x4cf4('0x113')](db[_0x4cf4('0xb3')],{'as':'Configurations','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xb3')][_0x4cf4('0x113')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x4cf4('0x1b6')});db['ZendeskConfiguration']['hasMany'](db[_0x4cf4('0xb5')],{'as':_0x4cf4('0x1c1'),'foreignKey':_0x4cf4('0x1b7')});db['ZendeskConfiguration'][_0x4cf4('0x113')](db['ZendeskField'],{'as':_0x4cf4('0x1b3'),'foreignKey':'FieldId'});db[_0x4cf4('0xb3')]['belongsTo'](db[_0x4cf4('0x1c4')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xb3')]['belongsToMany'](db[_0x4cf4('0x8f')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x4cf4('0x113')](db['ZendeskField'],{'as':_0x4cf4('0x1ba'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xb5')]['hasMany'](db[_0x4cf4('0xb5')],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xb5')]['hasMany'](db[_0x4cf4('0xb5')],{'as':_0x4cf4('0x1bc'),'foreignKey':'FieldId'});db[_0x4cf4('0xb5')][_0x4cf4('0x11d')](db['Variable'],{'as':_0x4cf4('0x93'),'foreignKey':_0x4cf4('0x1bf')});db['FreshdeskAccount'][_0x4cf4('0x113')](db['FreshdeskConfiguration'],{'as':_0x4cf4('0x1b5'),'onDelete':'cascade','foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0x1c5')]['hasMany'](db['FreshdeskField'],{'as':_0x4cf4('0x1c0'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b6')});db['FreshdeskConfiguration'][_0x4cf4('0x113')](db[_0x4cf4('0xba')],{'as':'Descriptions','onDelete':_0x4cf4('0x110'),'foreignKey':'DescriptionId'});db[_0x4cf4('0x1c5')][_0x4cf4('0x113')](db['FreshdeskField'],{'as':_0x4cf4('0x1b3'),'onDelete':_0x4cf4('0x110'),'foreignKey':'FieldId'});db[_0x4cf4('0x1c5')][_0x4cf4('0x11d')](db[_0x4cf4('0xb7')],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db['FreshdeskConfiguration'][_0x4cf4('0x120')](db[_0x4cf4('0x8f')],{'through':_0x4cf4('0x1c6')});db['FreshdeskField']['hasMany'](db[_0x4cf4('0xba')],{'as':'Subject','foreignKey':_0x4cf4('0x1b6')});db['FreshdeskField'][_0x4cf4('0x113')](db[_0x4cf4('0xba')],{'as':_0x4cf4('0x1bb'),'foreignKey':'DescriptionId'});db[_0x4cf4('0xba')][_0x4cf4('0x113')](db[_0x4cf4('0xba')],{'as':_0x4cf4('0x1bc'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xba')][_0x4cf4('0x11d')](db[_0x4cf4('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0x4cf4('0xbc')][_0x4cf4('0x113')](db[_0x4cf4('0xbe')],{'as':_0x4cf4('0x1b5'),'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xbe')][_0x4cf4('0x113')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xbe')][_0x4cf4('0x113')](db[_0x4cf4('0xc0')],{'as':'Descriptions','foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xbe')][_0x4cf4('0x113')](db['VtigerField'],{'as':_0x4cf4('0x1b3'),'foreignKey':_0x4cf4('0x1b8')});db['VtigerConfiguration'][_0x4cf4('0x11d')](db[_0x4cf4('0xbc')],{'as':_0x4cf4('0x165'),'foreignKey':'AccountId'});db[_0x4cf4('0xc0')][_0x4cf4('0x113')](db[_0x4cf4('0xc0')],{'as':_0x4cf4('0x1ba'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xc0')][_0x4cf4('0x113')](db[_0x4cf4('0xc0')],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xc0')]['hasMany'](db[_0x4cf4('0xc0')],{'as':'Field','foreignKey':_0x4cf4('0x1b8')});db['VtigerField'][_0x4cf4('0x11d')](db[_0x4cf4('0x93')],{'as':_0x4cf4('0x93'),'foreignKey':'VariableId'});db[_0x4cf4('0x1c7')]['hasMany'](db[_0x4cf4('0x1c8')],{'as':'Configurations','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0x1c8')]['hasMany'](db[_0x4cf4('0xc4')],{'as':_0x4cf4('0x1c0'),'foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0x1c8')][_0x4cf4('0x113')](db['ServicenowField'],{'as':_0x4cf4('0x1c1'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0x1c8')][_0x4cf4('0x113')](db[_0x4cf4('0xc4')],{'as':_0x4cf4('0x1b3'),'foreignKey':'FieldId'});db[_0x4cf4('0x1c8')][_0x4cf4('0x11d')](db[_0x4cf4('0x1c7')],{'as':'Account','foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0xc4')][_0x4cf4('0x113')](db[_0x4cf4('0xc4')],{'as':_0x4cf4('0x1ba'),'foreignKey':_0x4cf4('0x1b6')});db['ServicenowField'][_0x4cf4('0x113')](db[_0x4cf4('0xc4')],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xc4')][_0x4cf4('0x113')](db[_0x4cf4('0xc4')],{'as':_0x4cf4('0x1bc'),'foreignKey':'FieldId'});db[_0x4cf4('0xc4')]['belongsTo'](db[_0x4cf4('0x93')],{'as':_0x4cf4('0x93'),'foreignKey':_0x4cf4('0x1bf')});db['Dynamics365Account'][_0x4cf4('0x113')](db[_0x4cf4('0x1c9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4cf4('0x1b9')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':_0x4cf4('0x159'),'foreignKey':_0x4cf4('0x15a')});db[_0x4cf4('0x1c9')][_0x4cf4('0x113')](db[_0x4cf4('0xc7')],{'as':_0x4cf4('0x1c0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4cf4('0x1c9')][_0x4cf4('0x113')](db[_0x4cf4('0xc7')],{'as':'Descriptions','onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1b7')});db['Dynamics365Configuration'][_0x4cf4('0x113')](db['Dynamics365Field'],{'as':_0x4cf4('0x1b3'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x4cf4('0x1c9')][_0x4cf4('0x11d')](db[_0x4cf4('0x1ca')],{'as':_0x4cf4('0x165'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db[_0x4cf4('0xc7')],{'as':'Subject','foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':_0x4cf4('0x1bb'),'foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0xc7')][_0x4cf4('0x113')](db[_0x4cf4('0xc7')],{'as':_0x4cf4('0x1bc'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0xc7')][_0x4cf4('0x11d')](db[_0x4cf4('0x93')],{'as':'Variable','foreignKey':_0x4cf4('0x1bf')});db[_0x4cf4('0x1cb')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x4cf4('0x1b5'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x4cf4('0x113')](db[_0x4cf4('0x1cc')],{'as':'Subjects','foreignKey':_0x4cf4('0x1b6')});db['FreshsalesConfiguration'][_0x4cf4('0x113')](db[_0x4cf4('0x1cc')],{'as':'Descriptions','foreignKey':_0x4cf4('0x1b7')});db[_0x4cf4('0x1cd')][_0x4cf4('0x113')](db[_0x4cf4('0x1cc')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x4cf4('0x11d')](db['FreshsalesAccount'],{'as':_0x4cf4('0x165'),'foreignKey':_0x4cf4('0x1b9')});db[_0x4cf4('0x1cc')][_0x4cf4('0x113')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0x4cf4('0x1b6')});db[_0x4cf4('0x1cc')][_0x4cf4('0x113')](db[_0x4cf4('0x1cc')],{'as':_0x4cf4('0x1bb'),'foreignKey':'DescriptionId'});db[_0x4cf4('0x1cc')][_0x4cf4('0x113')](db[_0x4cf4('0x1cc')],{'as':_0x4cf4('0x1bc'),'foreignKey':_0x4cf4('0x1b8')});db[_0x4cf4('0x1cc')]['belongsTo'](db['Variable'],{'as':_0x4cf4('0x93'),'foreignKey':'VariableId'});db[_0x4cf4('0xce')]['belongsTo'](db[_0x4cf4('0x131')],{});db[_0x4cf4('0xce')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':'List','foreignKey':'ListId'});db[_0x4cf4('0xce')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':'Contact','foreignKey':_0x4cf4('0x157')});db[_0x4cf4('0xce')][_0x4cf4('0x11d')](db[_0x4cf4('0x6b')],{});db[_0x4cf4('0xce')][_0x4cf4('0x11d')](db[_0x4cf4('0x18a')],{});db['ChatQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{});db[_0x4cf4('0xce')][_0x4cf4('0x11d')](db[_0x4cf4('0x6f')],{});db[_0x4cf4('0xd0')][_0x4cf4('0x11d')](db['User'],{'onDelete':_0x4cf4('0x110'),'foreignKey':_0x4cf4('0x1ce')});db[_0x4cf4('0xd0')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'onDelete':'cascade','foreignKey':_0x4cf4('0x1cf')});db[_0x4cf4('0x1d0')][_0x4cf4('0x113')](db[_0x4cf4('0xd4')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x4cf4('0x1d0')][_0x4cf4('0x113')](db[_0x4cf4('0xd2')],{'foreignKey':_0x4cf4('0x1d1'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db[_0x4cf4('0x58')],{});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':'ContactId'});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db['SmsInteraction'],{});db['SmsQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x5d')],{});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{});db[_0x4cf4('0xd6')][_0x4cf4('0x11d')](db[_0x4cf4('0x5f')],{});db['JscriptyProject']['hasMany'](db[_0x4cf4('0x1d0')],{'foreignKey':_0x4cf4('0x1d2')});db[_0x4cf4('0x1d3')][_0x4cf4('0x113')](db[_0x4cf4('0xd4')],{'foreignKey':_0x4cf4('0x1d2')});db[_0x4cf4('0x1d3')][_0x4cf4('0x113')](db[_0x4cf4('0xd2')],{'foreignKey':'ProjectId'});db[_0x4cf4('0xdc')][_0x4cf4('0x120')](db['User'],{'as':_0x4cf4('0x16a'),'through':_0x4cf4('0x13c')});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x1d4')});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x4cf4('0x12b')});db['Team'][_0x4cf4('0x120')](db[_0x4cf4('0x41')],{'through':_0x4cf4('0x163'),'as':_0x4cf4('0x12d')});db['Team'][_0x4cf4('0x120')](db[_0x4cf4('0x6f')],{'through':_0x4cf4('0x1d5'),'as':_0x4cf4('0x12e')});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db['FaxQueue'],{'through':_0x4cf4('0x17a'),'as':_0x4cf4('0x1d6')});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db['SmsQueue'],{'through':_0x4cf4('0x180'),'as':_0x4cf4('0x12f')});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db[_0x4cf4('0x183')],{'through':_0x4cf4('0x187'),'as':'OpenchannelQueues'});db[_0x4cf4('0xe1')][_0x4cf4('0x120')](db[_0x4cf4('0x1d7')],{'through':_0x4cf4('0x1d8'),'as':_0x4cf4('0x1d9')});db[_0x4cf4('0xe1')]['belongsToMany'](db['VoicePrefix'],{'through':_0x4cf4('0x108'),'as':_0x4cf4('0x12c')});db[_0x4cf4('0xe5')]['hasMany'](db['CmHopper'],{'as':_0x4cf4('0x143'),'foreignKey':_0x4cf4('0x198')});db[_0x4cf4('0xe5')]['hasMany'](db['CmHopperFinal'],{'as':_0x4cf4('0x194'),'foreignKey':'CampaignId'});db[_0x4cf4('0xe5')][_0x4cf4('0x113')](db[_0x4cf4('0x79')],{'as':'HopperHistories','foreignKey':_0x4cf4('0x198')});db[_0x4cf4('0xe5')]['hasMany'](db[_0x4cf4('0x77')],{'as':_0x4cf4('0x144'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x4cf4('0x146'),'foreignKey':_0x4cf4('0x147')});db['Campaign']['belongsTo'](db[_0x4cf4('0x146')],{'as':'TrunkBackup','foreignKey':_0x4cf4('0x148')});db['Campaign'][_0x4cf4('0x11d')](db['Interval'],{'as':_0x4cf4('0x87'),'foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0xe5')][_0x4cf4('0x11d')](db[_0x4cf4('0xdc')],{'as':_0x4cf4('0xdc'),'foreignKey':_0x4cf4('0x1da')});db[_0x4cf4('0xe5')][_0x4cf4('0x120')](db['CmList'],{'as':_0x4cf4('0x124'),'through':_0x4cf4('0x1db')});db[_0x4cf4('0xe5')][_0x4cf4('0x120')](db['CmList'],{'as':_0x4cf4('0x1dc'),'through':'campaigns_has_cm_blacklists'});db[_0x4cf4('0xe9')]['belongsTo'](db[_0x4cf4('0x16d')],{'as':_0x4cf4('0x16d'),'foreignKey':_0x4cf4('0x16e')});db[_0x4cf4('0xec')]['belongsTo'](db[_0x4cf4('0x46')],{});db[_0x4cf4('0xec')][_0x4cf4('0x11d')](db[_0x4cf4('0x44')],{});db[_0x4cf4('0xec')]['belongsTo'](db[_0x4cf4('0x3f')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x4cf4('0xec')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':'FromUserId','as':_0x4cf4('0x1dd')});db[_0x4cf4('0xec')][_0x4cf4('0x11d')](db['User'],{'foreignKey':_0x4cf4('0x1de'),'as':_0x4cf4('0x1df')});db[_0x4cf4('0xec')][_0x4cf4('0x11d')](db[_0x4cf4('0x41')],{'foreignKey':'ToMailQueueId','as':_0x4cf4('0x1e0')});db[_0x4cf4('0xec')]['belongsTo'](db[_0x4cf4('0x3f')],{'foreignKey':_0x4cf4('0x1e1'),'as':_0x4cf4('0x1e2')});db[_0x4cf4('0x1e3')][_0x4cf4('0x11d')](db[_0x4cf4('0x18a')],{});db[_0x4cf4('0x1e3')][_0x4cf4('0x11d')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'foreignKey':_0x4cf4('0x1e4'),'as':_0x4cf4('0x1e5')});db['ChatTransferReport']['belongsTo'](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1e6'),'as':_0x4cf4('0x1dd')});db[_0x4cf4('0x1e3')]['belongsTo'](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1de'),'as':'ToAgent'});db['ChatTransferReport'][_0x4cf4('0x11d')](db['ChatQueue'],{'foreignKey':_0x4cf4('0x1e7'),'as':_0x4cf4('0x1e0')});db[_0x4cf4('0x1e3')][_0x4cf4('0x11d')](db[_0x4cf4('0x131')],{'foreignKey':_0x4cf4('0x1e8'),'as':_0x4cf4('0x1e2')});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db['FaxMessage'],{});db['FaxTransferReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x52')],{});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db['FaxAccount'],{'foreignKey':_0x4cf4('0x1e9'),'as':'FromAccount'});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1e6'),'as':_0x4cf4('0x1dd')});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db['User'],{'foreignKey':_0x4cf4('0x1de'),'as':'ToAgent'});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x4cf4('0x1e0')});db[_0x4cf4('0xee')][_0x4cf4('0x11d')](db[_0x4cf4('0x4e')],{'foreignKey':'ToFaxAccountId','as':_0x4cf4('0x1e2')});db['OpenchannelTransferReport'][_0x4cf4('0x11d')](db['OpenchannelMessage'],{});db[_0x4cf4('0xf0')][_0x4cf4('0x11d')](db[_0x4cf4('0x116')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x4cf4('0x1ea'),'as':'FromAccount'});db[_0x4cf4('0xf0')]['belongsTo'](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1e6'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1de'),'as':_0x4cf4('0x1df')});db[_0x4cf4('0xf0')][_0x4cf4('0x11d')](db['OpenchannelQueue'],{'foreignKey':_0x4cf4('0x1eb'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x61')],{'foreignKey':_0x4cf4('0x1ec'),'as':'ToAccount'});db[_0x4cf4('0xf2')][_0x4cf4('0x11d')](db[_0x4cf4('0x5d')],{});db['SmsTransferReport'][_0x4cf4('0x11d')](db['SmsInteraction'],{});db[_0x4cf4('0xf2')][_0x4cf4('0x11d')](db[_0x4cf4('0x58')],{'foreignKey':'FromSmsAccountId','as':_0x4cf4('0x1e5')});db[_0x4cf4('0xf2')]['belongsTo'](db['User'],{'foreignKey':_0x4cf4('0x1e6'),'as':'FromAgent'});db[_0x4cf4('0xf2')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1de'),'as':_0x4cf4('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0x4cf4('0x5f')],{'foreignKey':_0x4cf4('0x1ed'),'as':_0x4cf4('0x1e0')});db[_0x4cf4('0xf2')][_0x4cf4('0x11d')](db[_0x4cf4('0x58')],{'foreignKey':_0x4cf4('0x1ee'),'as':_0x4cf4('0x1e2')});db[_0x4cf4('0xf3')][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':_0x4cf4('0x170'),'foreignKey':_0x4cf4('0x161'),'onDelete':_0x4cf4('0x110')});db[_0x4cf4('0xf3')][_0x4cf4('0x113')](db['CmCustomField'],{'as':_0x4cf4('0x1ef'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0xf3')][_0x4cf4('0x113')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x122'),'onDelete':_0x4cf4('0x110'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x4cf4('0x114')],{'as':_0x4cf4('0x194'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0xf3')][_0x4cf4('0x113')](db[_0x4cf4('0x79')],{'as':'HopperHistory','foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0xf3')][_0x4cf4('0x113')](db[_0x4cf4('0x7b')],{'as':_0x4cf4('0x7b'),'foreignKey':_0x4cf4('0x161')});db['CmList'][_0x4cf4('0x120')](db['VoiceQueue'],{'as':_0x4cf4('0x1f0'),'through':'voice_queues_has_cm_lists'});db[_0x4cf4('0xf3')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x125')});db[_0x4cf4('0xf5')][_0x4cf4('0x113')](db[_0x4cf4('0x1a')],{'as':'Extensions','onDelete':_0x4cf4('0x110')});db[_0x4cf4('0xf5')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x109')});db[_0x4cf4('0xf5')][_0x4cf4('0x120')](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db['UserProfile']['hasMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'foreignKey':_0x4cf4('0x11f')});db[_0x4cf4('0x11e')]['hasMany'](db[_0x4cf4('0xf8')],{'as':_0x4cf4('0x1f1'),'foreignKey':_0x4cf4('0x11f'),'onDelete':'cascade'});db[_0x4cf4('0xf8')][_0x4cf4('0x113')](db['UserProfileResource'],{'as':_0x4cf4('0x1f2'),'foreignKey':_0x4cf4('0x1f3'),'onDelete':_0x4cf4('0x110')});db['WhatsappAccount'][_0x4cf4('0x113')](db[_0x4cf4('0x16f')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':_0x4cf4('0x110')});db[_0x4cf4('0xfb')][_0x4cf4('0x113')](db['CannedAnswer'],{'as':_0x4cf4('0x15e'),'foreignKey':_0x4cf4('0x1f4')});db[_0x4cf4('0xfb')][_0x4cf4('0x113')](db[_0x4cf4('0x101')],{'as':_0x4cf4('0x151'),'foreignKey':_0x4cf4('0x1f4')});db[_0x4cf4('0xfb')][_0x4cf4('0x113')](db[_0x4cf4('0xff')],{'as':'Interactions'});db['WhatsappAccount']['hasMany'](db[_0x4cf4('0xfd')],{'as':_0x4cf4('0x17c')});db[_0x4cf4('0xfb')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0xfb')][_0x4cf4('0x11d')](db[_0x4cf4('0x14a')],{'as':_0x4cf4('0x14b'),'foreignKey':_0x4cf4('0x14c')});db[_0x4cf4('0xfb')]['belongsToMany'](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x14d'),'through':_0x4cf4('0x1f5')});db[_0x4cf4('0xfd')][_0x4cf4('0x11d')](db['User'],{'onDelete':_0x4cf4('0x15b')});db['WhatsappApplication'][_0x4cf4('0x11d')](db[_0x4cf4('0x1d7')],{'onDelete':_0x4cf4('0x15b')});db[_0x4cf4('0xfd')][_0x4cf4('0x11d')](db[_0x4cf4('0xfb')],{'onDelete':'restrict'});db[_0x4cf4('0xfd')][_0x4cf4('0x11d')](db[_0x4cf4('0x87')],{'onDelete':'restrict','foreignKey':_0x4cf4('0x149')});db[_0x4cf4('0xfd')][_0x4cf4('0x11d')](db[_0x4cf4('0x8f')],{'onDelete':_0x4cf4('0x15b'),'foreignKey':_0x4cf4('0x174')});db['WhatsappInteraction']['hasMany'](db[_0x4cf4('0x101')],{'as':'Messages','onDelete':_0x4cf4('0x110'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0x4cf4('0xfb')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x4cf4('0xff')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':'ContactId'});db[_0x4cf4('0xff')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x4cf4('0x10e')});db[_0x4cf4('0xff')][_0x4cf4('0x120')](db['Tag'],{'through':_0x4cf4('0x1aa'),'as':'Tags'});db[_0x4cf4('0xff')]['belongsToMany'](db['Tag'],{'through':_0x4cf4('0x1aa'),'as':_0x4cf4('0x169')});db[_0x4cf4('0xff')][_0x4cf4('0x120')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x16a'),'through':_0x4cf4('0x12a'),'foreignKey':_0x4cf4('0x1f6')});db['WhatsappMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':'User'});db['WhatsappMessage'][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'onDelete':'cascade','as':_0x4cf4('0x156')});db[_0x4cf4('0x101')][_0x4cf4('0x11d')](db['WhatsappInteraction'],{'onDelete':_0x4cf4('0x110'),'as':_0x4cf4('0x178'),'foreignKey':'WhatsappInteractionId'});db[_0x4cf4('0x101')][_0x4cf4('0x11d')](db[_0x4cf4('0xfb')],{'as':'Account','foreignKey':_0x4cf4('0x1f4')});db[_0x4cf4('0x102')][_0x4cf4('0x11d')](db[_0x4cf4('0xfb')],{});db[_0x4cf4('0x102')][_0x4cf4('0x11d')](db[_0x4cf4('0xf3')],{'as':_0x4cf4('0x160'),'foreignKey':_0x4cf4('0x161')});db[_0x4cf4('0x102')][_0x4cf4('0x11d')](db[_0x4cf4('0x74')],{'as':_0x4cf4('0x156'),'foreignKey':'ContactId'});db[_0x4cf4('0x102')]['belongsTo'](db[_0x4cf4('0xff')],{});db['WhatsappQueueReport'][_0x4cf4('0x11d')](db[_0x4cf4('0x1d7')],{});db[_0x4cf4('0x102')][_0x4cf4('0x11d')](db[_0x4cf4('0x101')],{});db['WhatsappQueueReport'][_0x4cf4('0x11d')](db['User'],{});db[_0x4cf4('0x103')][_0x4cf4('0x11d')](db[_0x4cf4('0x101')],{});db[_0x4cf4('0x103')][_0x4cf4('0x11d')](db[_0x4cf4('0xff')],{});db['WhatsappTransferReport'][_0x4cf4('0x11d')](db['WhatsappAccount'],{'foreignKey':_0x4cf4('0x1f7'),'as':'FromAccount'});db[_0x4cf4('0x103')][_0x4cf4('0x11d')](db[_0x4cf4('0xfb')],{'foreignKey':_0x4cf4('0x1f8'),'as':'ToAccount'});db[_0x4cf4('0x103')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x4cf4('0x1e0')});db[_0x4cf4('0x103')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':_0x4cf4('0x1e6'),'as':'FromAgent'});db[_0x4cf4('0x103')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'foreignKey':'ToUserId','as':_0x4cf4('0x1df')});db['WhatsappQueue'][_0x4cf4('0x120')](db['User'],{'as':_0x4cf4('0x14d'),'through':'UserWhatsappQueue','foreignKey':_0x4cf4('0x1f9')});db[_0x4cf4('0x1d7')]['belongsToMany'](db[_0x4cf4('0xe1')],{'through':_0x4cf4('0x1d8'),'as':_0x4cf4('0x14e')});db[_0x4cf4('0x10b')][_0x4cf4('0x11d')](db[_0x4cf4('0x14')],{'as':_0x4cf4('0x1fa'),'foreignKey':_0x4cf4('0x10e'),'onDelete':'cascade','hooks':!![]});db[_0x4cf4('0x159')][_0x4cf4('0x10d')](db['Dynamics365Account'],{'as':_0x4cf4('0x1ca'),'onDelete':'restrict'});db[_0x4cf4('0x159')][_0x4cf4('0x10d')](db['MailServerIn'],{'as':'Imap','onDelete':_0x4cf4('0x15b')});db['CloudProvider'][_0x4cf4('0x10d')](db[_0x4cf4('0x3d')],{'as':_0x4cf4('0x15d'),'onDelete':_0x4cf4('0x15b')});module[_0x4cf4('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index efb5b4e..c624478 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4e=['/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','appPath','path','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','/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/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/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/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license'];(function(_0x14bbf3,_0xca820f){var _0x1b280c=function(_0x2a5314){while(--_0x2a5314){_0x14bbf3['push'](_0x14bbf3['shift']());}};_0x1b280c(++_0xca820f);}(_0x4c4e,0x152));var _0xe4c4=function(_0x19090c,_0x48e98c){_0x19090c=_0x19090c-0x0;var _0x210704=_0x4c4e[_0x19090c];return _0x210704;};'use strict';var path=require(_0xe4c4('0x0'));var express=require('express');var errors=require(_0xe4c4('0x1'));var config=require(_0xe4c4('0x2'));var setupLoggers=require(_0xe4c4('0x3'))['setupLoggers'];var clientSideLogs=require(_0xe4c4('0x4'));exports[_0xe4c4('0x5')]=function(_0x1a4483){return setupLoggers(_0x1a4483)['then'](function(){_0x1a4483[_0xe4c4('0x6')]('/api/users',require(_0xe4c4('0x7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8'),require(_0xe4c4('0x9')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa'),require(_0xe4c4('0xb')));_0x1a4483[_0xe4c4('0x6')]('/api/voice/extensions',require('./api/voiceExtension'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc'),require(_0xe4c4('0xd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe'),require(_0xe4c4('0xf')));_0x1a4483['use'](_0xe4c4('0x10'),require(_0xe4c4('0x11')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x12'),require('./api/screenRecording'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x13'),require('./api/voiceMail'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x14'),require('./api/voiceMailMessage'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x15'),require('./api/voiceCallReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x16'),require(_0xe4c4('0x17')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x18'),require(_0xe4c4('0x19')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1a'),require(_0xe4c4('0x1b')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1c'),require(_0xe4c4('0x1d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x1e'),require(_0xe4c4('0x1f')));_0x1a4483['use'](_0xe4c4('0x20'),require(_0xe4c4('0x21')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x22'),require('./api/mailServerOut'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x23'),require(_0xe4c4('0x24')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x25'),require(_0xe4c4('0x26')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x27'),require(_0xe4c4('0x28')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x29'),require(_0xe4c4('0x2a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x2b'),require(_0xe4c4('0x2c')));_0x1a4483['use']('/api/mail/applications',require(_0xe4c4('0x2d')));_0x1a4483['use'](_0xe4c4('0x2e'),require('./api/mailQueueReport'));_0x1a4483[_0xe4c4('0x6')]('/api/dashboards',require(_0xe4c4('0x2f')));_0x1a4483['use'](_0xe4c4('0x30'),require('./api/dashboardItem'));_0x1a4483['use']('/api/fax/accounts',require('./api/faxAccount'));_0x1a4483[_0xe4c4('0x6')]('/api/fax/applications',require('./api/faxApplication'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x31'),require('./api/faxInteraction'));_0x1a4483['use'](_0xe4c4('0x32'),require(_0xe4c4('0x33')));_0x1a4483['use'](_0xe4c4('0x34'),require(_0xe4c4('0x35')));_0x1a4483[_0xe4c4('0x6')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x36'),require(_0xe4c4('0x37')));_0x1a4483[_0xe4c4('0x6')]('/api/sms/applications',require('./api/smsApplication'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x38'),require('./api/smsInteraction'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x39'),require(_0xe4c4('0x3a')));_0x1a4483['use'](_0xe4c4('0x3b'),require('./api/smsQueue'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x3c'),require(_0xe4c4('0x3d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x3e'),require(_0xe4c4('0x3f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x40'),require(_0xe4c4('0x41')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x42'),require(_0xe4c4('0x43')));_0x1a4483['use'](_0xe4c4('0x44'),require(_0xe4c4('0x45')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/websites',require(_0xe4c4('0x46')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x47'),require('./api/openchannelQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x48'),require(_0xe4c4('0x49')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4a'),require(_0xe4c4('0x4b')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4c'),require(_0xe4c4('0x4d')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/offline_messages',require(_0xe4c4('0x4e')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x4f'),require(_0xe4c4('0x50')));_0x1a4483['use'](_0xe4c4('0x51'),require(_0xe4c4('0x52')));_0x1a4483['use'](_0xe4c4('0x53'),require(_0xe4c4('0x54')));_0x1a4483['use'](_0xe4c4('0x55'),require(_0xe4c4('0x56')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x57'),require(_0xe4c4('0x58')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x59'),require(_0xe4c4('0x5a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x5b'),require(_0xe4c4('0x5c')));_0x1a4483[_0xe4c4('0x6')]('/api/cm/hopper_final',require(_0xe4c4('0x5d')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x5e'),require(_0xe4c4('0x5f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x60'),require('./api/cmCustomField'));_0x1a4483[_0xe4c4('0x6')]('/api/actions',require(_0xe4c4('0x61')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x62'),require(_0xe4c4('0x63')));_0x1a4483[_0xe4c4('0x6')]('/api/canned_answers',require('./api/cannedAnswer'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x64'),require(_0xe4c4('0x65')));_0x1a4483['use'](_0xe4c4('0x66'),require(_0xe4c4('0x67')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x68'),require('./api/interval'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x69'),require(_0xe4c4('0x6a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x6b'),require(_0xe4c4('0x6c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x6d'),require(_0xe4c4('0x6e')));_0x1a4483['use'](_0xe4c4('0x6f'),require('./api/schedule'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x70'),require(_0xe4c4('0x71')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x72'),require(_0xe4c4('0x73')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x74'),require(_0xe4c4('0x75')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x76'),require(_0xe4c4('0x77')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x78'),require('./api/variable'));_0x1a4483['use'](_0xe4c4('0x79'),require(_0xe4c4('0x7a')));_0x1a4483['use'](_0xe4c4('0x7b'),require(_0xe4c4('0x7c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x7d'),require(_0xe4c4('0x7e')));_0x1a4483['use'](_0xe4c4('0x7f'),require(_0xe4c4('0x80')));_0x1a4483['use'](_0xe4c4('0x81'),require(_0xe4c4('0x82')));_0x1a4483['use'](_0xe4c4('0x83'),require('./api/analyticMetric'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x84'),require(_0xe4c4('0x85')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x86'),require('./api/analyticTreeReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x87'),require(_0xe4c4('0x88')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x89'),require(_0xe4c4('0x8a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8b'),require(_0xe4c4('0x8c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8d'),require(_0xe4c4('0x8e')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x8f'),require(_0xe4c4('0x90')));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/sugarcrm/fields',require(_0xe4c4('0x91')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x92'),require('./api/intDeskAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x93'),require(_0xe4c4('0x94')));_0x1a4483['use'](_0xe4c4('0x95'),require('./api/intDeskField'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x96'),require(_0xe4c4('0x97')));_0x1a4483['use']('/api/integrations/zoho/configurations',require(_0xe4c4('0x98')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x99'),require('./api/intZohoField'));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x1a4483['use']('/api/integrations/zendesk/configurations',require(_0xe4c4('0x9a')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9b'),require(_0xe4c4('0x9c')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9d'),require('./api/intFreshdeskAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x9e'),require(_0xe4c4('0x9f')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa0'),require(_0xe4c4('0xa1')));_0x1a4483['use']('/api/integrations/vtiger/accounts',require(_0xe4c4('0xa2')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa3'),require(_0xe4c4('0xa4')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa5'),require(_0xe4c4('0xa6')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa7'),require('./api/intServicenowAccount'));_0x1a4483['use'](_0xe4c4('0xa8'),require('./api/intServicenowConfiguration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xa9'),require(_0xe4c4('0xaa')));_0x1a4483['use'](_0xe4c4('0xab'),require('./api/intDynamics365Account'));_0x1a4483[_0xe4c4('0x6')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xac'),require(_0xe4c4('0xad')));_0x1a4483['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xae'),require('./api/intFreshsalesConfiguration'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xaf'),require(_0xe4c4('0xb0')));_0x1a4483['use']('/api/networks',require(_0xe4c4('0xb1')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb2'),require(_0xe4c4('0xb3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb4'),require('./api/chatInternalMessage'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb5'),require(_0xe4c4('0xb6')));_0x1a4483['use'](_0xe4c4('0xb7'),require(_0xe4c4('0xb8')));_0x1a4483[_0xe4c4('0x6')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x1a4483[_0xe4c4('0x6')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xb9'),require(_0xe4c4('0xba')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbb'),require(_0xe4c4('0xbc')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbd'),require('./api/jscriptyProject'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xbe'),require('./api/setting'));_0x1a4483['use'](_0xe4c4('0xbf'),require(_0xe4c4('0xc0')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc1'),require('./api/squareProject'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc2'),require(_0xe4c4('0xc3')));_0x1a4483['use']('/api/square/messages',require(_0xe4c4('0xc4')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc5'),require(_0xe4c4('0xc6')));_0x1a4483['use']('/api/license',require(_0xe4c4('0xc7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xc8'),require(_0xe4c4('0xc9')));_0x1a4483[_0xe4c4('0x6')]('/api/migrations',require(_0xe4c4('0xca')));_0x1a4483['use'](_0xe4c4('0xcb'),require(_0xe4c4('0xcc')));_0x1a4483['use']('/api/plugins',require(_0xe4c4('0xcd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xce'),require(_0xe4c4('0xcf')));_0x1a4483[_0xe4c4('0x6')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x1a4483['use'](_0xe4c4('0xd0'),require(_0xe4c4('0xd1')));_0x1a4483['use'](_0xe4c4('0xd2'),require(_0xe4c4('0xd3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd4'),require('./api/smsTransferReport'));_0x1a4483['use'](_0xe4c4('0xd5'),require(_0xe4c4('0xd6')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd7'),require(_0xe4c4('0xd8')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xd9'),require('./api/userProfile'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xda'),require(_0xe4c4('0xdb')));_0x1a4483[_0xe4c4('0x6')]('/api/userProfile/resources',require(_0xe4c4('0xdc')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xdd'),require(_0xe4c4('0xde')));_0x1a4483['use'](_0xe4c4('0xdf'),require(_0xe4c4('0xe0')));_0x1a4483['use']('/api/whatsapp/applications',require(_0xe4c4('0xe1')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe2'),require(_0xe4c4('0xe3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe4'),require(_0xe4c4('0xe5')));_0x1a4483[_0xe4c4('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe6'),require(_0xe4c4('0xe7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe8'),require('./api/whatsappQueue'));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xe9'),require(_0xe4c4('0xea')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xeb'),require(_0xe4c4('0xec')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xed'),require(_0xe4c4('0xee')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xef'),require(_0xe4c4('0xf0')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf1'),require(_0xe4c4('0xf2')));_0x1a4483[_0xe4c4('0x6')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x1a4483[_0xe4c4('0x6')]('/api/jira',require(_0xe4c4('0xf3')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf4'),require(_0xe4c4('0xf5')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf6'),require(_0xe4c4('0xf7')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xf8'),require(_0xe4c4('0xf9')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xfa'),require(_0xe4c4('0xfb')));_0x1a4483['use'](_0xe4c4('0xfc'),require(_0xe4c4('0xfd')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0xfe'),clientSideLogs);_0x1a4483[_0xe4c4('0x6')]('/apidoc',express[_0xe4c4('0xff')](path[_0xe4c4('0x100')](config['root'],_0xe4c4('0x101'))));_0x1a4483[_0xe4c4('0x6')]('/www',express['static'](path['join'](config[_0xe4c4('0x102')],'/www')));_0x1a4483[_0xe4c4('0x6')](_0xe4c4('0x103'),express[_0xe4c4('0xff')](path['join'](config[_0xe4c4('0x102')],_0xe4c4('0x103'))));_0x1a4483[_0xe4c4('0x6')]('/snippet',express['static'](path['join'](config[_0xe4c4('0x102')],_0xe4c4('0x104'),_0xe4c4('0x105'))));_0x1a4483['use'](_0xe4c4('0x106'),express[_0xe4c4('0xff')](path[_0xe4c4('0x100')](config[_0xe4c4('0x102')],_0xe4c4('0x107'))));_0x1a4483['route'](_0xe4c4('0x108'))[_0xe4c4('0x109')](errors[0x194]);_0x1a4483[_0xe4c4('0x10a')]('/*')['get'](function(_0x157c61,_0x21d8ca){_0x21d8ca[_0xe4c4('0x10b')](path['resolve'](_0x1a4483[_0xe4c4('0x109')](_0xe4c4('0x10c'))+'/index.html'));});return _0x1a4483;});}; \ No newline at end of file +var _0x8ef6=['./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','/apidoc','join','/www','static','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs'];(function(_0x369f30,_0x4fc290){var _0x11676d=function(_0x1bc63c){while(--_0x1bc63c){_0x369f30['push'](_0x369f30['shift']());}};_0x11676d(++_0x4fc290);}(_0x8ef6,0xf2));var _0x68ef=function(_0xef4557,_0x21531e){_0xef4557=_0xef4557-0x0;var _0x39f831=_0x8ef6[_0xef4557];return _0x39f831;};'use strict';var path=require(_0x68ef('0x0'));var express=require(_0x68ef('0x1'));var errors=require(_0x68ef('0x2'));var config=require(_0x68ef('0x3'));var setupLoggers=require(_0x68ef('0x4'))[_0x68ef('0x5')];var clientSideLogs=require(_0x68ef('0x6'));exports['default']=function(_0x27d0af){return setupLoggers(_0x27d0af)[_0x68ef('0x7')](function(){_0x27d0af[_0x68ef('0x8')](_0x68ef('0x9'),require('./api/user'));_0x27d0af['use'](_0x68ef('0xa'),require(_0x68ef('0xb')));_0x27d0af[_0x68ef('0x8')]('/api/voice/contexts',require(_0x68ef('0xc')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd'),require(_0x68ef('0xe')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf'),require(_0x68ef('0x10')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x11'),require(_0x68ef('0x12')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x13'),require('./api/voiceRecording'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x14'),require(_0x68ef('0x15')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x16'),require(_0x68ef('0x17')));_0x27d0af['use'](_0x68ef('0x18'),require(_0x68ef('0x19')));_0x27d0af[_0x68ef('0x8')]('/api/voice/calls/reports',require(_0x68ef('0x1a')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x1b'),require('./api/voiceDialReport'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x1c'),require(_0x68ef('0x1d')));_0x27d0af[_0x68ef('0x8')]('/api/voice/queues/reports',require(_0x68ef('0x1e')));_0x27d0af['use']('/api/members/reports',require(_0x68ef('0x1f')));_0x27d0af[_0x68ef('0x8')]('/api/trunks',require('./api/trunk'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x20'),require(_0x68ef('0x21')));_0x27d0af['use'](_0x68ef('0x22'),require(_0x68ef('0x23')));_0x27d0af[_0x68ef('0x8')]('/api/mail/accounts',require(_0x68ef('0x24')));_0x27d0af[_0x68ef('0x8')]('/api/mail/queues',require(_0x68ef('0x25')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x26'),require('./api/mailSubstatus'));_0x27d0af['use']('/api/mail/interactions',require(_0x68ef('0x27')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x28'),require(_0x68ef('0x29')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x2a'),require(_0x68ef('0x2b')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x2c'),require(_0x68ef('0x2d')));_0x27d0af['use'](_0x68ef('0x2e'),require('./api/dashboard'));_0x27d0af['use']('/api/dashboards/items',require(_0x68ef('0x2f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x30'),require(_0x68ef('0x31')));_0x27d0af['use']('/api/fax/applications',require(_0x68ef('0x32')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x33'),require(_0x68ef('0x34')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x35'),require(_0x68ef('0x36')));_0x27d0af[_0x68ef('0x8')]('/api/fax/queues',require(_0x68ef('0x37')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x38'),require('./api/faxQueueReport'));_0x27d0af[_0x68ef('0x8')]('/api/sms/accounts',require(_0x68ef('0x39')));_0x27d0af[_0x68ef('0x8')]('/api/sms/applications',require('./api/smsApplication'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x3a'),require('./api/smsInteraction'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x3b'),require(_0x68ef('0x3c')));_0x27d0af[_0x68ef('0x8')]('/api/sms/queues',require(_0x68ef('0x3d')));_0x27d0af[_0x68ef('0x8')]('/api/openchannel/accounts',require(_0x68ef('0x3e')));_0x27d0af['use'](_0x68ef('0x3f'),require(_0x68ef('0x40')));_0x27d0af['use'](_0x68ef('0x41'),require('./api/openchannelInteraction'));_0x27d0af[_0x68ef('0x8')]('/api/openchannel/messages',require(_0x68ef('0x42')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x43'),require('./api/openchannelQueue'));_0x27d0af[_0x68ef('0x8')]('/api/chat/websites',require(_0x68ef('0x44')));_0x27d0af['use'](_0x68ef('0x45'),require(_0x68ef('0x46')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x47'),require(_0x68ef('0x48')));_0x27d0af[_0x68ef('0x8')]('/api/chat/interactions',require(_0x68ef('0x49')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4a'),require('./api/chatMessage'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4b'),require(_0x68ef('0x4c')));_0x27d0af['use']('/api/chat/queues',require(_0x68ef('0x4d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x4e'),require(_0x68ef('0x4f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x50'),require(_0x68ef('0x51')));_0x27d0af['use'](_0x68ef('0x52'),require(_0x68ef('0x53')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x54'),require('./api/cmContact'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x55'),require(_0x68ef('0x56')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x57'),require(_0x68ef('0x58')));_0x27d0af['use'](_0x68ef('0x59'),require(_0x68ef('0x5a')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x5b'),require(_0x68ef('0x5c')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x5d'),require(_0x68ef('0x5e')));_0x27d0af[_0x68ef('0x8')]('/api/actions',require(_0x68ef('0x5f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x60'),require(_0x68ef('0x61')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x62'),require(_0x68ef('0x63')));_0x27d0af['use'](_0x68ef('0x64'),require('./api/disposition'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x65'),require(_0x68ef('0x66')));_0x27d0af[_0x68ef('0x8')]('/api/intervals',require(_0x68ef('0x67')));_0x27d0af['use'](_0x68ef('0x68'),require('./api/pause'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x69'),require(_0x68ef('0x6a')));_0x27d0af['use']('/api/voiceQueuesLog',require(_0x68ef('0x6b')));_0x27d0af[_0x68ef('0x8')]('/api/schedules',require('./api/schedule'));_0x27d0af['use'](_0x68ef('0x6c'),require(_0x68ef('0x6d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x6e'),require(_0x68ef('0x6f')));_0x27d0af['use']('/api/templates',require(_0x68ef('0x70')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x71'),require(_0x68ef('0x72')));_0x27d0af['use'](_0x68ef('0x73'),require(_0x68ef('0x74')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x75'),require('./api/integration'));_0x27d0af['use'](_0x68ef('0x76'),require(_0x68ef('0x77')));_0x27d0af['use'](_0x68ef('0x78'),require(_0x68ef('0x79')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x7a'),require(_0x68ef('0x7b')));_0x27d0af['use'](_0x68ef('0x7c'),require(_0x68ef('0x7d')));_0x27d0af[_0x68ef('0x8')]('/api/analytics/metrics',require(_0x68ef('0x7e')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x7f'),require('./api/analyticFieldReport'));_0x27d0af[_0x68ef('0x8')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/salesforce/accounts',require(_0x68ef('0x80')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x81'),require(_0x68ef('0x82')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x83'),require(_0x68ef('0x84')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x85'),require(_0x68ef('0x86')));_0x27d0af['use']('/api/integrations/sugarcrm/configurations',require(_0x68ef('0x87')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x88'),require(_0x68ef('0x89')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x8a'),require(_0x68ef('0x8b')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x8c'),require('./api/intDeskConfiguration'));_0x27d0af['use'](_0x68ef('0x8d'),require('./api/intDeskField'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zoho/accounts',require(_0x68ef('0x8e')));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zoho/configurations',require(_0x68ef('0x8f')));_0x27d0af['use'](_0x68ef('0x90'),require(_0x68ef('0x91')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x92'),require(_0x68ef('0x93')));_0x27d0af[_0x68ef('0x8')]('/api/integrations/zendesk/configurations',require(_0x68ef('0x94')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x95'),require(_0x68ef('0x96')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x97'),require('./api/intFreshdeskAccount'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x98'),require('./api/intFreshdeskConfiguration'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x99'),require(_0x68ef('0x9a')));_0x27d0af['use'](_0x68ef('0x9b'),require('./api/intVtigerAccount'));_0x27d0af['use'](_0x68ef('0x9c'),require('./api/intVtigerConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/vtiger/fields',require(_0x68ef('0x9d')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0x9e'),require(_0x68ef('0x9f')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa0'),require('./api/intServicenowConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/servicenow/fields',require(_0x68ef('0xa1')));_0x27d0af['use'](_0x68ef('0xa2'),require(_0x68ef('0xa3')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa4'),require(_0x68ef('0xa5')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa6'),require('./api/intDynamics365Field'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa7'),require(_0x68ef('0xa8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xa9'),require('./api/intFreshsalesConfiguration'));_0x27d0af[_0x68ef('0x8')]('/api/integrations/freshsales/fields',require(_0x68ef('0xaa')));_0x27d0af['use']('/api/networks',require(_0x68ef('0xab')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xac'),require(_0x68ef('0xad')));_0x27d0af['use'](_0x68ef('0xae'),require('./api/chatInternalMessage'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xaf'),require(_0x68ef('0xb0')));_0x27d0af['use']('/api/jscripty/questions/reports',require(_0x68ef('0xb1')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb2'),require(_0x68ef('0xb3')));_0x27d0af['use'](_0x68ef('0xb4'),require(_0x68ef('0xb5')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb6'),require('./api/squareReport'));_0x27d0af[_0x68ef('0x8')]('/api/square/details/reports',require(_0x68ef('0xb7')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xb8'),require(_0x68ef('0xb9')));_0x27d0af[_0x68ef('0x8')]('/api/settings',require(_0x68ef('0xba')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xbb'),require('./api/squareOdbc'));_0x27d0af[_0x68ef('0x8')]('/api/square/projects',require(_0x68ef('0xbc')));_0x27d0af['use']('/api/square/recordings',require(_0x68ef('0xbd')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xbe'),require(_0x68ef('0xbf')));_0x27d0af['use'](_0x68ef('0xc0'),require(_0x68ef('0xc1')));_0x27d0af[_0x68ef('0x8')]('/api/license',require(_0x68ef('0xc2')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc3'),require(_0x68ef('0xc4')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc5'),require(_0x68ef('0xc6')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc7'),require(_0x68ef('0xc8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xc9'),require('./api/plugin'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xca'),require('./api/mailTransferReport'));_0x27d0af['use'](_0x68ef('0xcb'),require('./api/chatTransferReport'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xcc'),require('./api/faxTransferReport'));_0x27d0af['use'](_0x68ef('0xcd'),require('./api/openchannelTransferReport'));_0x27d0af[_0x68ef('0x8')]('/api/sms/reports/transfer',require(_0x68ef('0xce')));_0x27d0af['use'](_0x68ef('0xcf'),require(_0x68ef('0xd0')));_0x27d0af['use'](_0x68ef('0xd1'),require(_0x68ef('0xd2')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd3'),require('./api/userProfile'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd4'),require('./api/userProfileSection'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd5'),require(_0x68ef('0xd6')));_0x27d0af['use'](_0x68ef('0xd7'),require('./api/userNotification'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd8'),require('./api/whatsappAccount'));_0x27d0af['use']('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xd9'),require(_0x68ef('0xda')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdb'),require(_0x68ef('0xdc')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdd'),require(_0x68ef('0xde')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xdf'),require(_0x68ef('0xe0')));_0x27d0af[_0x68ef('0x8')]('/api/whatsapp/queues',require(_0x68ef('0xe1')));_0x27d0af['use'](_0x68ef('0xe2'),require('./api/cloudProvider'));_0x27d0af['use'](_0x68ef('0xe3'),require(_0x68ef('0xe4')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xe5'),require('./api/user-setting'));_0x27d0af['use'](_0x68ef('0xe6'),require(_0x68ef('0xe7')));_0x27d0af[_0x68ef('0x8')]('/api/auth/google',require(_0x68ef('0xe8')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xe9'),require(_0x68ef('0xea')));_0x27d0af['use'](_0x68ef('0xeb'),require(_0x68ef('0xec')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xed'),require(_0x68ef('0xee')));_0x27d0af[_0x68ef('0x8')]('/api/version',require(_0x68ef('0xef')));_0x27d0af['use'](_0x68ef('0xf0'),require(_0x68ef('0xf1')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf2'),require('./api/pm2'));_0x27d0af[_0x68ef('0x8')]('/api/webbar',require(_0x68ef('0xf3')));_0x27d0af[_0x68ef('0x8')]('/api/logs',clientSideLogs);_0x27d0af['use'](_0x68ef('0xf4'),express['static'](path[_0x68ef('0xf5')](config['root'],_0x68ef('0xf4'))));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf6'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],'/www')));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xf9'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],_0x68ef('0xf9'))));_0x27d0af[_0x68ef('0x8')]('/snippet',express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config[_0x68ef('0xf8')],_0x68ef('0xfa'),_0x68ef('0xfb'))));_0x27d0af[_0x68ef('0x8')](_0x68ef('0xfc'),express[_0x68ef('0xf7')](path[_0x68ef('0xf5')](config['root'],_0x68ef('0xfd'))));_0x27d0af['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x27d0af[_0x68ef('0xfe')]('/*')[_0x68ef('0xff')](function(_0x36d242,_0x55fc26){_0x55fc26['sendFile'](path['resolve'](_0x27d0af[_0x68ef('0xff')](_0x68ef('0x100'))+_0x68ef('0x101')));});return _0x27d0af;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 477d765..e1460e8 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4ee=['../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','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/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xb4ee,0x19d));var _0xeb4e=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0xb4ee[_0x38f5f8];return _0x34e820;};'use strict';var jayson=require('jayson/promise');var _=require(_0xeb4e('0x0'));var config=require(_0xeb4e('0x1'));exports[_0xeb4e('0x2')]=function(){return new Promise(function(_0x37f7b7,_0x33b040){var _0x4f28f2={};_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x4')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x5')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x6')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x7')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x8')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x9')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xa')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xb')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xc')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xd')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xe')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/mailServerIn/mailServerIn.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0xf')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x10')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x11')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x12')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x13')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x14')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x15')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x16')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/faxInteraction/faxInteraction.rpc'));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x17')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x18')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x19')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1a')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1b')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1c')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1d')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1e')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x1f')));_0x4f28f2=_['merge'](_0x4f28f2,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x20')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x21')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x22')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x23')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x24')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x25')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x26')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x27')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x28')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x29')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x2a')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/pause/pause.rpc'));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x2b')));_0x4f28f2=_['merge'](_0x4f28f2,require('../api/template/template.rpc'));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x2c')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x2d')));_0x4f28f2=_['merge'](_0x4f28f2,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x2e')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x2f')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x30')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x31')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x32')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x33')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x34')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x35')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x36')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/squareReport/squareReport.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x37')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x38')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x39')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x3a')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x3b')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x3c')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require('../api/campaign/campaign.rpc'));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x3d')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x3e')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x3f')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x40')));_0x4f28f2=_['merge'](_0x4f28f2,require(_0xeb4e('0x41')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x42')));_0x4f28f2=_[_0xeb4e('0x3')](_0x4f28f2,require(_0xeb4e('0x43')));var _0x20c4be=jayson[_0xeb4e('0x44')](_0x4f28f2)[_0xeb4e('0x45')]();var _0x5b1e55=config[_0xeb4e('0x46')][_0xeb4e('0x47')]||config[_0xeb4e('0x47')]+0x1;var _0x56a813=config[_0xeb4e('0x46')]['ip']||'localhost';_0x20c4be['on'](_0xeb4e('0x48'),function(_0x510e98){return _0x33b040(_0x510e98);});_0x20c4be[_0xeb4e('0x2')](_0x5b1e55,_0x56a813,function(){console[_0xeb4e('0x49')](_0xeb4e('0x4a'),_0x56a813,_0x5b1e55);require(_0xeb4e('0x4b'))[_0xeb4e('0x4c')]();return _0x37f7b7(_0xeb4e('0x4d')+_0x56a813+':'+_0x5b1e55);});});}; \ No newline at end of file +var _0xf875=['../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.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','lodash','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/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x546592,_0x5a26a6){var _0x1f28e2=function(_0xd807c){while(--_0xd807c){_0x546592['push'](_0x546592['shift']());}};_0x1f28e2(++_0x5a26a6);}(_0xf875,0x18c));var _0x5f87=function(_0x42c967,_0x3d0a7c){_0x42c967=_0x42c967-0x0;var _0x150a97=_0xf875[_0x42c967];return _0x150a97;};'use strict';var jayson=require(_0x5f87('0x0'));var _=require(_0x5f87('0x1'));var config=require('../config/environment');exports[_0x5f87('0x2')]=function(){return new Promise(function(_0x2889c3,_0xa18a7c){var _0x52dfc0={};_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x4')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x5')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x6')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x7')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x8')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x9')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0xa')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0xb')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0xc')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0xd')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0xe')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0xf')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x10')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x11')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x12')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x13')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/mailMessage/mailMessage.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/mailApplication/mailApplication.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x14')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/faxAccount/faxAccount.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x15')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/faxInteraction/faxInteraction.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x16')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/faxQueue/faxQueue.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x17')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x18')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/smsInteraction/smsInteraction.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x19')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x1a')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x1b')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x1c')));_0x52dfc0=_['merge'](_0x52dfc0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x1d')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x1e')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x1f')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x20')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x21')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x22')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x23')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x24')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x25')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x26')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x27')));_0x52dfc0=_['merge'](_0x52dfc0,require('../api/interval/interval.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x28')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x29')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x2a')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/trigger/trigger.rpc'));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x2b')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x2c')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x2d')));_0x52dfc0=_['merge'](_0x52dfc0,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x2e')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x2f')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x30')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x31')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x32')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x33')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x34')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x35')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x36')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x37')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x38')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/squareOdbc/squareOdbc.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/squareProject/squareProject.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x39')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x3a')));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x3b')));_0x52dfc0=_['merge'](_0x52dfc0,require('../api/attachment/attachment.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/plugin/plugin.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x52dfc0=_['merge'](_0x52dfc0,require(_0x5f87('0x3c')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x3d')));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x52dfc0=_[_0x5f87('0x3')](_0x52dfc0,require(_0x5f87('0x3e')));var _0x153369=jayson[_0x5f87('0x3f')](_0x52dfc0)[_0x5f87('0x40')]();var _0x4d2d22=config[_0x5f87('0x41')]['port']||config[_0x5f87('0x42')]+0x1;var _0x1fe075=config[_0x5f87('0x41')]['ip']||_0x5f87('0x43');_0x153369['on'](_0x5f87('0x44'),function(_0x10085e){return _0xa18a7c(_0x10085e);});_0x153369['listen'](_0x4d2d22,_0x1fe075,function(){console[_0x5f87('0x45')](_0x5f87('0x46'),_0x1fe075,_0x4d2d22);require(_0x5f87('0x47'))[_0x5f87('0x48')]();return _0x2889c3(_0x5f87('0x49')+_0x1fe075+':'+_0x4d2d22);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 78891bc..f8084ce 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 _0x4649=['close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','setPriority','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','hangup','substring','520-Invalid','search','function','replace','result=','indexOf','substr','match','error','E_AGI_SOCKET_ERROR'];(function(_0x33c7c0,_0x53738b){var _0xc1ee60=function(_0x5c17f2){while(--_0x5c17f2){_0x33c7c0['push'](_0x33c7c0['shift']());}};_0xc1ee60(++_0x53738b);}(_0x4649,0x199));var _0x9464=function(_0x226bd4,_0x36839){_0x226bd4=_0x226bd4-0x0;var _0x4ac2e9=_0x4649[_0x226bd4];return _0x4ac2e9;};'use strict';var util=require(_0x9464('0x0'));var _=require('lodash');var EventEmitter=require(_0x9464('0x1'))[_0x9464('0x2')];var AGIReply=require(_0x9464('0x3'));var AGIError=require(_0x9464('0x4'));function AGIChannel(_0x43ae03){var _0x116137=this,_0x2137d3=new AGIReply(),_0x58331a=![],_0xdfa97e={};EventEmitter['call'](_0x116137);_0x43ae03[_0x9464('0x5')](_0x9464('0x6'));_0x43ae03[_0x9464('0x7')](0x8*0x3c*0x3c*0x3e8);_0x2137d3[_0x9464('0x5')]('utf8');_0x2137d3['on'](_0x9464('0x8'),function(_0x2a246f){for(var _0x2f0c31 in _0x2a246f){_0x116137[_0x2f0c31]=_0x2a246f[_0x2f0c31];}_0x116137[_0x9464('0x9')](_0x9464('0xa'));});_0x2137d3['on']('line',function(_0x2480cb){if(_0x2480cb['toLowerCase']()==_0x9464('0xb')){_0x116137[_0x9464('0x9')](_0x9464('0xb'));return;}if(_0x2480cb[_0x9464('0xc')](0x0,0xb)==_0x9464('0xd')){_0x58331a=!![];}if(_0x58331a){_0xdfa97e['rx']+=_0x2480cb+'\x0a';if(_0x2480cb[_0x9464('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x58331a=![];}}else{_0xdfa97e['rx']=_0x2480cb;}if(_0x58331a){return;}if(typeof _0xdfa97e['cb']==_0x9464('0xf')){var _0x256d63=_0xdfa97e['rx'][_0x9464('0xc')](0x0,0x3),_0x3205e5=null,_0x255b5e=null;_0x256d63=parseInt(_0x256d63);if(isNaN(_0x256d63)){_0xdfa97e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x256d63!=0xc8){_0xdfa97e['cb'](null,{'code':_0x256d63,'result':-0x1,'extra':'KO'});return;}_0x3205e5=_0xdfa97e['rx'][_0x9464('0xc')](0x4)[_0x9464('0x10')](_0x9464('0x11'),'');if(_0x3205e5[_0x9464('0x12')]('\x20')!=-0x1){_0x3205e5=_0x3205e5[_0x9464('0x13')](0x0,_0x3205e5[_0x9464('0x12')]('\x20'));}if(_['startsWith'](_0x3205e5,'-1')){_0x3205e5=parseInt(_0x3205e5);}_0x255b5e=_0xdfa97e['rx']['split']('\x20');if(_0x255b5e['length']==0x3){_0x255b5e=_0x255b5e[0x2][_0x9464('0xc')](0x1,_0x255b5e[0x2]['length']-0x1);}else if(_0x255b5e['length']>0x3){var _0x56d684=/\((.+)\)/;var _0x469420=_0xdfa97e['rx'][_0x9464('0x14')](_0x56d684);if(_0x469420){_0x255b5e=_0x469420[0x1];}else{_0x255b5e=null;}}else{_0x255b5e=null;}_0xdfa97e['cb'](null,{'code':_0x256d63,'result':_0x3205e5,'extra':_0x255b5e});}});_0x43ae03['on'](_0x9464('0x15'),function(_0x334931){_0x116137[_0x9464('0x9')](_0x9464('0x15'),new AGIError(_0x9464('0x16'),_0x334931['code']));});_0x43ae03['on'](_0x9464('0x17'),function(){_0x116137[_0x9464('0x9')](_0x9464('0x17'),new AGIError(_0x9464('0x18')));});_0x43ae03['on'](_0x9464('0x19'),function(){_0x116137[_0x9464('0x9')](_0x9464('0x19'),new AGIError(_0x9464('0x1a')));_0x43ae03[_0x9464('0x1b')]();});_0x43ae03[_0x9464('0x1c')](_0x2137d3);this[_0x9464('0x1d')]=function(_0x5afaec,_0xab9810){var _0x5afaec=_0x5afaec||'',_0xab9810=typeof _0xab9810==_0x9464('0xf')?_0xab9810:new Function();_0xdfa97e={'tx':_0x5afaec,'rx':'','cb':_0xab9810};_0x43ae03[_0x9464('0x1e')](_0x5afaec+'\x0a');},this[_0x9464('0x17')]=function(){_0x43ae03['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x9464('0x1f')][_0x9464('0x20')]=function(_0x41deae){return this[_0x9464('0x1d')][_0x9464('0x21')](this,_0x41deae);};AGIChannel[_0x9464('0x1f')][_0x9464('0x22')]=function(){return this[_0x9464('0x20')](_0x9464('0x23'));};AGIChannel['prototype']['getData']=function(_0x354e08,_0xb09d50,_0x49cb67){_0x354e08=_0x354e08===undefined?_0x9464('0x24'):_0x354e08;_0xb09d50=_0xb09d50===undefined?'5':_0xb09d50;_0x49cb67=_0x49cb67===undefined?'1':_0x49cb67;return this['sendRequest'](util[_0x9464('0x25')](_0x9464('0x26'),_0x354e08,_0xb09d50*0x3e8,_0x49cb67));};AGIChannel[_0x9464('0x1f')][_0x9464('0x27')]=function(_0x2caa46){_0x2caa46=_0x2caa46||_0x9464('0x28');return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x29'),_0x2caa46));};AGIChannel[_0x9464('0x1f')][_0x9464('0x2a')]=function(_0x1346f2,_0x42a9ba){if(_['isArray'](_0x42a9ba)){return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x2b'),_0x1346f2,_0x42a9ba[_0x9464('0x2c')](',')));}return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x2b'),_0x1346f2,_0x42a9ba));};AGIChannel[_0x9464('0x1f')][_0x9464('0x2d')]=function(_0x39177e){return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x2e'),_0x39177e));};AGIChannel[_0x9464('0x1f')][_0x9464('0x2f')]=function(_0x2e468c){return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x30'),_0x2e468c));};AGIChannel[_0x9464('0x1f')]['setPriority']=function(_0x14ef04){return this['sendRequest'](util[_0x9464('0x25')](_0x9464('0x31'),_0x14ef04));};AGIChannel['prototype'][_0x9464('0xb')]=function(){return this[_0x9464('0x20')]('HANGUP');};AGIChannel[_0x9464('0x1f')][_0x9464('0x32')]=function(_0xec8bdd,_0x38bca1){var _0x533e8a=_[_0x9464('0x33')](_0x38bca1)||_['isNumber'](_0x38bca1)?_0x38bca1[_0x9464('0x34')]():_0x38bca1;return this['sendRequest'](util[_0x9464('0x25')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xec8bdd,_0x533e8a?_0x533e8a[_0x9464('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x9464('0x35')]=function(_0x40ec5b,_0x43ac4d){return this['sendRequest'](util[_0x9464('0x25')](_0x9464('0x36'),_0x40ec5b,_0x43ac4d));};AGIChannel[_0x9464('0x1f')][_0x9464('0x37')]=function(_0x7c12ef,_0x2ca9b7){return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x38'),_0x7c12ef,_0x2ca9b7));};AGIChannel[_0x9464('0x1f')][_0x9464('0x39')]=function(_0x2d7660,_0x30f588){return this[_0x9464('0x20')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2d7660,_0x30f588));};AGIChannel['prototype']['continueAt']=function(_0x2aed32,_0x57d714,_0x55c484){_0x57d714=_0x57d714||this['extension'];_0x55c484=_0x55c484||0x1;this[_0x9464('0x2d')](_0x2aed32);this[_0x9464('0x2f')](_0x57d714);this[_0x9464('0x3a')](_0x55c484);return this[_0x9464('0x27')](util[_0x9464('0x25')]('GOTO\x20%s\x20%s\x20%s',_0x2aed32,_0x57d714,_0x55c484));};AGIChannel[_0x9464('0x1f')][_0x9464('0x3b')]=function(_0x31739b){return this[_0x9464('0x20')](util[_0x9464('0x25')]('GET\x20VARIABLE\x20\x22%s\x22',_0x31739b));};AGIChannel[_0x9464('0x1f')]['recordFile']=function(_0x2b5515,_0x34eab8,_0x4b1b40,_0x2691fc,_0x5232d1,_0x5a1a94){_0x34eab8=_0x34eab8||_0x9464('0x3c');_0x4b1b40=_0x4b1b40||'';_0x2691fc=_0x2691fc===undefined?-0x1:_0x2691fc==='-1'?-0x1:_0x2691fc*0x3e8;_0x5232d1=_0x5232d1===undefined?'':'s='+_0x5232d1;_0x5a1a94=_0x5a1a94?_0x9464('0x3d'):'';return this[_0x9464('0x20')](util[_0x9464('0x25')](_0x9464('0x3e'),_0x2b5515,_0x34eab8,_0x4b1b40,_0x2691fc,_0x5a1a94,_0x5232d1));};AGIChannel[_0x9464('0x1f')][_0x9464('0x3f')]=function(_0x1346b2,_0x488234){_0x488234=_0x488234||'';return this['sendRequest'](util['format'](_0x9464('0x40'),_0x1346b2,_0x488234));};AGIChannel[_0x9464('0x1f')][_0x9464('0x41')]=function(_0x152899){return this[_0x9464('0x2a')](_0x9464('0x42'),_0x152899);};AGIChannel[_0x9464('0x1f')][_0x9464('0x43')]=function(_0x10989a){return this[_0x9464('0x2a')](_0x9464('0x44'),_0x10989a);};AGIChannel['prototype']['error']=function(_0x1bca5c,_0x58fe3a){this[_0x9464('0x27')](util[_0x9464('0x25')](_0x9464('0x45'),_0x1bca5c['id'],_0x1bca5c[_0x9464('0x46')],_0x58fe3a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9464('0x47')]=AGIChannel; \ No newline at end of file +var _0xf90c=['split','length','match','error','code','close','timeout','destroy','command','write','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','wait','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith'];(function(_0x18c187,_0x4d6e93){var _0x4810db=function(_0x6269a5){while(--_0x6269a5){_0x18c187['push'](_0x18c187['shift']());}};_0x4810db(++_0x4d6e93);}(_0xf90c,0x1a9));var _0xcf90=function(_0x3e161f,_0x4edc22){_0x3e161f=_0x3e161f-0x0;var _0x53d94a=_0xf90c[_0x3e161f];return _0x53d94a;};'use strict';var util=require(_0xcf90('0x0'));var _=require(_0xcf90('0x1'));var EventEmitter=require(_0xcf90('0x2'))[_0xcf90('0x3')];var AGIReply=require(_0xcf90('0x4'));var AGIError=require(_0xcf90('0x5'));function AGIChannel(_0x291de2){var _0x4431a9=this,_0x3a2e46=new AGIReply(),_0x13785f=![],_0x25f2ef={};EventEmitter[_0xcf90('0x6')](_0x4431a9);_0x291de2[_0xcf90('0x7')]('utf8');_0x291de2[_0xcf90('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3a2e46['setEncoding'](_0xcf90('0x9'));_0x3a2e46['on'](_0xcf90('0xa'),function(_0x186b40){for(var _0x5c8e73 in _0x186b40){_0x4431a9[_0x5c8e73]=_0x186b40[_0x5c8e73];}_0x4431a9[_0xcf90('0xb')](_0xcf90('0xc'));});_0x3a2e46['on'](_0xcf90('0xd'),function(_0x3bf85d){if(_0x3bf85d[_0xcf90('0xe')]()==_0xcf90('0xf')){_0x4431a9[_0xcf90('0xb')](_0xcf90('0xf'));return;}if(_0x3bf85d[_0xcf90('0x10')](0x0,0xb)==_0xcf90('0x11')){_0x13785f=!![];}if(_0x13785f){_0x25f2ef['rx']+=_0x3bf85d+'\x0a';if(_0x3bf85d['search'](_0xcf90('0x12'))!=-0x1){_0x13785f=![];}}else{_0x25f2ef['rx']=_0x3bf85d;}if(_0x13785f){return;}if(typeof _0x25f2ef['cb']==_0xcf90('0x13')){var _0x326536=_0x25f2ef['rx'][_0xcf90('0x10')](0x0,0x3),_0x14a9aa=null,_0x4e43de=null;_0x326536=parseInt(_0x326536);if(isNaN(_0x326536)){_0x25f2ef['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xcf90('0x14')});return;}if(_0x326536!=0xc8){_0x25f2ef['cb'](null,{'code':_0x326536,'result':-0x1,'extra':'KO'});return;}_0x14a9aa=_0x25f2ef['rx'][_0xcf90('0x10')](0x4)[_0xcf90('0x15')](_0xcf90('0x16'),'');if(_0x14a9aa[_0xcf90('0x17')]('\x20')!=-0x1){_0x14a9aa=_0x14a9aa['substr'](0x0,_0x14a9aa[_0xcf90('0x17')]('\x20'));}if(_[_0xcf90('0x18')](_0x14a9aa,'-1')){_0x14a9aa=parseInt(_0x14a9aa);}_0x4e43de=_0x25f2ef['rx'][_0xcf90('0x19')]('\x20');if(_0x4e43de[_0xcf90('0x1a')]==0x3){_0x4e43de=_0x4e43de[0x2][_0xcf90('0x10')](0x1,_0x4e43de[0x2][_0xcf90('0x1a')]-0x1);}else if(_0x4e43de[_0xcf90('0x1a')]>0x3){var _0x4c0698=/\((.+)\)/;var _0x1ec8d2=_0x25f2ef['rx'][_0xcf90('0x1b')](_0x4c0698);if(_0x1ec8d2){_0x4e43de=_0x1ec8d2[0x1];}else{_0x4e43de=null;}}else{_0x4e43de=null;}_0x25f2ef['cb'](null,{'code':_0x326536,'result':_0x14a9aa,'extra':_0x4e43de});}});_0x291de2['on']('error',function(_0x5b44e3){_0x4431a9[_0xcf90('0xb')](_0xcf90('0x1c'),new AGIError('E_AGI_SOCKET_ERROR',_0x5b44e3[_0xcf90('0x1d')]));});_0x291de2['on'](_0xcf90('0x1e'),function(){_0x4431a9[_0xcf90('0xb')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x291de2['on'](_0xcf90('0x1f'),function(){_0x4431a9[_0xcf90('0xb')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x291de2[_0xcf90('0x20')]();});_0x291de2['pipe'](_0x3a2e46);this[_0xcf90('0x21')]=function(_0x33dd80,_0x54d893){var _0x33dd80=_0x33dd80||'',_0x54d893=typeof _0x54d893=='function'?_0x54d893:new Function();_0x25f2ef={'tx':_0x33dd80,'rx':'','cb':_0x54d893};_0x291de2[_0xcf90('0x22')](_0x33dd80+'\x0a');},this[_0xcf90('0x1e')]=function(){_0x291de2['destroy']();};}util[_0xcf90('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xcf90('0x24')][_0xcf90('0x25')]=function(_0x3bae50){return this['command'][_0xcf90('0x26')](this,_0x3bae50);};AGIChannel[_0xcf90('0x24')]['answer']=function(){return this[_0xcf90('0x25')](_0xcf90('0x27'));};AGIChannel['prototype'][_0xcf90('0x28')]=function(_0x23b540,_0x500c97,_0x4e01ac){_0x23b540=_0x23b540===undefined?'beep':_0x23b540;_0x500c97=_0x500c97===undefined?'5':_0x500c97;_0x4e01ac=_0x4e01ac===undefined?'1':_0x4e01ac;return this['sendRequest'](util[_0xcf90('0x29')](_0xcf90('0x2a'),_0x23b540,_0x500c97*0x3e8,_0x4e01ac));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x2b')]=function(_0x1250a5){_0x1250a5=_0x1250a5||_0xcf90('0x2c');return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x2d'),_0x1250a5));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x2e')]=function(_0x5d76b1,_0x5a2776){if(_['isArray'](_0x5a2776)){return this[_0xcf90('0x25')](util[_0xcf90('0x29')]('EXEC\x20%s\x20%s',_0x5d76b1,_0x5a2776[_0xcf90('0x2f')](',')));}return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x30'),_0x5d76b1,_0x5a2776));};AGIChannel['prototype'][_0xcf90('0x31')]=function(_0x47dc76){return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x32'),_0x47dc76));};AGIChannel['prototype'][_0xcf90('0x33')]=function(_0xd5843c){return this['sendRequest'](util['format'](_0xcf90('0x34'),_0xd5843c));};AGIChannel[_0xcf90('0x24')]['setPriority']=function(_0x7318d4){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x7318d4));};AGIChannel[_0xcf90('0x24')][_0xcf90('0xf')]=function(){return this[_0xcf90('0x25')](_0xcf90('0x35'));};AGIChannel[_0xcf90('0x24')]['setVariable']=function(_0x46e491,_0x9f8148){var _0x2f0202=_['isBoolean'](_0x9f8148)||_[_0xcf90('0x36')](_0x9f8148)?_0x9f8148[_0xcf90('0x37')]():_0x9f8148;return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x38'),_0x46e491,_0x2f0202?_0x2f0202[_0xcf90('0x37')]()[_0xcf90('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x39')]=function(_0x2a0c93,_0x326dd9){return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x3a'),_0x2a0c93,_0x326dd9));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x3b')]=function(_0x445c95,_0xabdd6e){return this[_0xcf90('0x25')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x445c95,_0xabdd6e));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x3c')]=function(_0x3560ab,_0x4a7d68){return this[_0xcf90('0x25')](util[_0xcf90('0x29')](_0xcf90('0x3d'),_0x3560ab,_0x4a7d68));};AGIChannel['prototype']['continueAt']=function(_0x382852,_0x32f2ab,_0x3227b8){_0x32f2ab=_0x32f2ab||this[_0xcf90('0x3e')];_0x3227b8=_0x3227b8||0x1;this[_0xcf90('0x31')](_0x382852);this['setExtension'](_0x32f2ab);this[_0xcf90('0x3f')](_0x3227b8);return this[_0xcf90('0x2b')](util[_0xcf90('0x29')](_0xcf90('0x40'),_0x382852,_0x32f2ab,_0x3227b8));};AGIChannel['prototype'][_0xcf90('0x41')]=function(_0x5b6ed7){return this[_0xcf90('0x25')](util['format'](_0xcf90('0x42'),_0x5b6ed7));};AGIChannel['prototype'][_0xcf90('0x43')]=function(_0x67d6e6,_0xed36a5,_0x105d72,_0x20bd59,_0xc80057,_0x59d4e3){_0xed36a5=_0xed36a5||_0xcf90('0x44');_0x105d72=_0x105d72||'';_0x20bd59=_0x20bd59===undefined?-0x1:_0x20bd59==='-1'?-0x1:_0x20bd59*0x3e8;_0xc80057=_0xc80057===undefined?'':'s='+_0xc80057;_0x59d4e3=_0x59d4e3?'BEEP':'';return this['sendRequest'](util['format'](_0xcf90('0x45'),_0x67d6e6,_0xed36a5,_0x105d72,_0x20bd59,_0x59d4e3,_0xc80057));};AGIChannel[_0xcf90('0x24')]['streamFile']=function(_0x151276,_0x522a8f){_0x522a8f=_0x522a8f||'';return this[_0xcf90('0x25')](util[_0xcf90('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x151276,_0x522a8f));};AGIChannel[_0xcf90('0x24')][_0xcf90('0x46')]=function(_0x4fc58c){return this[_0xcf90('0x2e')](_0xcf90('0x47'),_0x4fc58c);};AGIChannel[_0xcf90('0x24')][_0xcf90('0x48')]=function(_0x1312b7){return this[_0xcf90('0x2e')]('WAIT',_0x1312b7);};AGIChannel['prototype'][_0xcf90('0x1c')]=function(_0x2ee8ca,_0x5de3a9){this[_0xcf90('0x2b')](util[_0xcf90('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2ee8ca['id'],_0x2ee8ca[_0xcf90('0x49')],_0x5de3a9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xcf90('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9c582ae..9b04fc7 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 _0x59b9=['exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','name'];(function(_0x100d4,_0x15083f){var _0x53c3c9=function(_0x272213){while(--_0x272213){_0x100d4['push'](_0x100d4['shift']());}};_0x53c3c9(++_0x15083f);}(_0x59b9,0x71));var _0x959b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x59b9[_0x465028];return _0xb783d4;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x959b('0x0'),'E_AGI_ARGUMENT_PORT':_0x959b('0x1'),'E_AGI_SERVER_ERROR':_0x959b('0x2'),'E_AGI_SERVER_CLOSE':_0x959b('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x959b('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x959b('0x5'),'E_AGI_SOCKET_ERROR':_0x959b('0x6'),'E_AGI_SOCKET_CLOSE':_0x959b('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x959b('0x8'),'E_AGI_COMMAND_EMPTY':_0x959b('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x959b('0xa')};function AGIError(_0x1f328a){var _0x1f328a=_0x1f328a||null,_0x64ce14=_0x64ce14||[],_0x1b9bbf=0x1,_0xae3ea7='';if(!error[_0x1f328a]){_0x1f328a=_0x959b('0xb');}_0x64ce14[_0x959b('0xc')](error[_0x1f328a]);while(arguments[_0x1b9bbf]){_0x64ce14[_0x959b('0xc')](arguments[_0x1b9bbf]);_0x1b9bbf++;}_0xae3ea7=util['format'][_0x959b('0xd')](util,_0x64ce14);this['message']=_0xae3ea7;this[_0x959b('0xe')]=_0x1f328a;}module[_0x959b('0xf')]=AGIError; \ No newline at end of file +var _0xd4e4=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','util','Undefined\x20error.'];(function(_0x143544,_0x161d9b){var _0x43defc=function(_0x175284){while(--_0x175284){_0x143544['push'](_0x143544['shift']());}};_0x43defc(++_0x161d9b);}(_0xd4e4,0x9e));var _0x4d4e=function(_0x4317c0,_0x25d70c){_0x4317c0=_0x4317c0-0x0;var _0x36c1b5=_0xd4e4[_0x4317c0];return _0x36c1b5;};'use strict';var util=require(_0x4d4e('0x0'));var error={'E_AGI_UNDEFINED':_0x4d4e('0x1'),'E_AGI_ARGUMENT_PORT':_0x4d4e('0x2'),'E_AGI_SERVER_ERROR':_0x4d4e('0x3'),'E_AGI_SERVER_CLOSE':_0x4d4e('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x4d4e('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x4d4e('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x4d4e('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x4d4e('0x8'),'E_AGI_COMMAND_EMPTY':_0x4d4e('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x4d4e('0xa')};function AGIError(_0x5c0d6d){var _0x5c0d6d=_0x5c0d6d||null,_0x511c9c=_0x511c9c||[],_0x187665=0x1,_0x244e28='';if(!error[_0x5c0d6d]){_0x5c0d6d=_0x4d4e('0xb');}_0x511c9c[_0x4d4e('0xc')](error[_0x5c0d6d]);while(arguments[_0x187665]){_0x511c9c[_0x4d4e('0xc')](arguments[_0x187665]);_0x187665++;}_0x244e28=util[_0x4d4e('0xd')]['apply'](util,_0x511c9c);this[_0x4d4e('0xe')]=_0x244e28;this[_0x4d4e('0xf')]=_0x5c0d6d;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index cd616af..cca5008 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 _0x2dac=['prototype','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','default\x20on\x20switch\x20not\x20found','includes','../../../config/logger','agi','getdigits','getsecretdigits','vertices','addVertex','edges'];(function(_0x5d24a5,_0x567d7f){var _0x4ddf14=function(_0x584809){while(--_0x584809){_0x5d24a5['push'](_0x5d24a5['shift']());}};_0x4ddf14(++_0x567d7f);}(_0x2dac,0x107));var _0xc2da=function(_0x47a476,_0x3fe90b){_0x47a476=_0x47a476-0x0;var _0x37154a=_0x2dac[_0x47a476];return _0x37154a;};'use strict';var _=require('lodash');var logger=require(_0xc2da('0x0'))(_0xc2da('0x1'));var verticesWithRetry=['menu',_0xc2da('0x2'),_0xc2da('0x3')];var Graph=function(){this[_0xc2da('0x4')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0xc2da('0x5')]=function(_0x253cac){this[_0xc2da('0x4')][_0x253cac['id']]=_0x253cac;this[_0xc2da('0x6')][_0x253cac['id']]=[];};Graph[_0xc2da('0x7')][_0xc2da('0x8')]=function(_0x2e24e5,_0x151103,_0x377a5a){this[_0xc2da('0x6')][_0x2e24e5][_0xc2da('0x9')]({'target':_0x151103,'condition':_0x377a5a});this[_0xc2da('0xa')]+=0x1;};Graph['prototype'][_0xc2da('0xb')]=function(){return _[_0xc2da('0xb')](this[_0xc2da('0x4')]);};Graph[_0xc2da('0x7')][_0xc2da('0xc')]=function(){return this[_0xc2da('0xa')];};Graph['prototype'][_0xc2da('0xd')]=function(_0x562207){return this[_0xc2da('0x4')][_0x562207];};Graph[_0xc2da('0x7')][_0xc2da('0xe')]=function(_0xdab9fb,_0x4fe8b1){if(!this[_0xc2da('0x4')][_0xdab9fb]){return logger['info'](_0xc2da('0xf'));}var _0x38b474=_0x4fe8b1(this[_0xc2da('0x4')][_0xdab9fb]);if(!_0x38b474){return logger[_0xc2da('0x10')]('stop\x20traverse');}if(this[_0xc2da('0x6')][_0xdab9fb][_0xc2da('0x11')]===0x0){return logger[_0xc2da('0x10')](_0xc2da('0x12'));}for(var _0x4a25c9=0x0,_0xe373b3=[],_0x4fef5f=![];_0x4a25c9\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var syncho=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x0a9e('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0x0a9e('0x4'));var Project=require(_0x0a9e('0x5'));var projects=[];config[_0x0a9e('0x3')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x3')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x219af0){process[_0x0a9e('0x7')](function(){syncho(function(){try{setChannelVariables(_0x219af0);agiHandler(_0x219af0);}catch(_0x2cc193){logger['error'](_0x2cc193['stack']);}});});}function projectUpdateHandler(_0xe42b77){try{var _0x56465b=JSON['parse'](_0xe42b77);var _0x39753a=_[_0x0a9e('0x8')](projects,['id',_0x56465b['id']]);if(_0x39753a>-0x1){if(_0x56465b[_0x0a9e('0x9')]===!![]){projects[_0x0a9e('0xa')](_0x39753a,0x1);}else{projects[_0x39753a]=_0x56465b;}}else{projects[_0x0a9e('0xb')](_0x56465b);}}catch(_0xbd1168){logger['error'](_0xbd1168['stack']);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0a9e('0x3')][_0x0a9e('0xc')]);logger[_0x0a9e('0xd')](util[_0x0a9e('0xe')](_0x0a9e('0xf'),config[_0x0a9e('0x3')]['ip'],config['agi'][_0x0a9e('0xc')]));}function errorHandler(_0x239b12){if(_0x239b12&&_0x239b12[_0x0a9e('0x10')]&&_0x239b12[_0x0a9e('0x11')]){logger[_0x0a9e('0x12')](util[_0x0a9e('0xe')]('[%s]\x20%s',_0x239b12[_0x0a9e('0x10')],_0x239b12['message']));}else{logger[_0x0a9e('0x12')](util['format'](_0x0a9e('0x13'),_0x239b12[_0x0a9e('0x14')]));}}function closeHandler(){logger['info'](util[_0x0a9e('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0a9e('0x15')],this[_0x0a9e('0x16')],this[_0x0a9e('0x17')],this[_0x0a9e('0x18')],this[_0x0a9e('0x19')]));try{createSquareReport(this);}catch(_0x2eb11f){logger[_0x0a9e('0x12')](_0x2eb11f[_0x0a9e('0x14')]);}}function timeoutHandler(){logger[_0x0a9e('0xd')](util[_0x0a9e('0xe')](_0x0a9e('0x1a'),this[_0x0a9e('0x15')],this['calleridname'],this[_0x0a9e('0x17')],this[_0x0a9e('0x18')],this['uniqueid']));}function hangupHandler(){logger[_0x0a9e('0xd')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0a9e('0x15')],this[_0x0a9e('0x16')],this[_0x0a9e('0x17')],this[_0x0a9e('0x18')],this['uniqueid']));this[_0x0a9e('0x1b')]=!![];}function createSquareReport(_0x2fb0e4,_0x3b45bc){rpc[_0x0a9e('0x1c')](_0x2fb0e4)[_0x0a9e('0x1d')](function(_0x42ac8f){if(_0x3b45bc){_0x3b45bc(null,_0x42ac8f);}})[_0x0a9e('0x1e')](function(_0x5ea472){if(_0x3b45bc){_0x3b45bc(null,_0x5ea472);}});}function setChannelVariables(_0x59181e){for(var _0x197ec0 in _0x59181e){if(_0x59181e[_0x0a9e('0x1f')](_0x197ec0)){if(_0x197ec0[_0x0a9e('0x20')](_0x0a9e('0x21'))===0x0){_0x59181e[_0x197ec0['substring'](0x4)]=_0x59181e[_0x197ec0];delete _0x59181e[_0x197ec0];}}}}function agiHandler(_0x384319){logger['debug'](_0x0a9e('0x22'),JSON['stringify'](_0x384319,null,0x2));logger[_0x0a9e('0xd')](util[_0x0a9e('0xe')](_0x0a9e('0x23'),_0x384319[_0x0a9e('0x15')],_0x384319[_0x0a9e('0x16')],_0x384319[_0x0a9e('0x17')],_0x384319[_0x0a9e('0x18')],_0x384319[_0x0a9e('0x19')]));_0x384319['on']('error',errorHandler);_0x384319['on'](_0x0a9e('0x24'),closeHandler);_0x384319['on'](_0x0a9e('0x25'),timeoutHandler);_0x384319[_0x0a9e('0x1b')]=![];_0x384319['on'](_0x0a9e('0x26'),hangupHandler);var _0x5c877d=_[_0x0a9e('0x27')](projects,[_0x0a9e('0x10'),_0x384319[_0x0a9e('0x15')]]);if(!_0x5c877d)return Project[_0x0a9e('0x28')](_0x384319);if(!_0x5c877d[_0x0a9e('0x29')])return Project[_0x0a9e('0x2a')](_0x384319);return Project[_0x0a9e('0x2b')](_0x5c877d,_0x384319);}function main(){var _0x2e8759;return utilLicense[_0x0a9e('0x2c')]()['then'](function(_0x426950){if(!_0x426950)return;if(_0x426950['voice']){if(_0x426950[_0x0a9e('0x2d')]&&_0x426950[_0x0a9e('0x2d')]>0x0){logger[_0x0a9e('0xd')](util[_0x0a9e('0xe')](_0x0a9e('0x2e'),_0x426950['callysquare']));_0x2e8759=_0x426950[_0x0a9e('0x2d')];}else{logger[_0x0a9e('0xd')](_0x0a9e('0x2f'));}}else{logger[_0x0a9e('0xd')](_0x0a9e('0x30'));_0x2e8759=-0x1;}})[_0x0a9e('0x1d')](function(){return Project[_0x0a9e('0x31')]();})[_0x0a9e('0x1d')](function(_0x5583a4){projects=_0x5583a4;return;})[_0x0a9e('0x1e')](function(_0x5e7238){logger[_0x0a9e('0x12')](_0x0a9e('0x32'),_0x5e7238[_0x0a9e('0x14')]);})[_0x0a9e('0x33')](function(){var _0x567193=require(_0x0a9e('0x34'))(config[_0x0a9e('0x3')][_0x0a9e('0xc')],config[_0x0a9e('0x3')]['ip'],_0x2e8759);_0x567193['on']('error',errorHandler);_0x567193['on']('listening',listeningHandler);_0x567193['on'](_0x0a9e('0x35'),connectionHandler);_0x567193['on']('close',closeHandler);_0x567193['on'](_0x0a9e('0x36'),projectUpdateHandler);});}main(); \ No newline at end of file +var _0x9c44=['handleUnpublished','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','defaults','127.0.0.1','nextTick','error','parse','splice','push','stack','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','evtHangup','catch','hasOwnProperty','indexOf','variables','stringify','close','timeout','hangup','handleNotFound','production'];(function(_0x5cdc1f,_0x1dbb73){var _0x4346a5=function(_0x28b211){while(--_0x28b211){_0x5cdc1f['push'](_0x5cdc1f['shift']());}};_0x4346a5(++_0x1dbb73);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x49c4('0x0'));var config=require(_0x49c4('0x1'));var logger=require(_0x49c4('0x2'))(_0x49c4('0x3'));var utilLicense=require(_0x49c4('0x4'));var rpc=require(_0x49c4('0x5'));var Project=require('./project');var projects=[];config['agi']=_[_0x49c4('0x6')](config['agi'],{'ip':_0x49c4('0x7'),'port':0x11dd});function connectionHandler(_0x6030ae){process[_0x49c4('0x8')](function(){syncho(function(){try{setChannelVariables(_0x6030ae);agiHandler(_0x6030ae);}catch(_0x2c4e2e){logger[_0x49c4('0x9')](_0x2c4e2e['stack']);}});});}function projectUpdateHandler(_0x11c586){try{var _0x42e4f8=JSON[_0x49c4('0xa')](_0x11c586);var _0x4487ca=_['findIndex'](projects,['id',_0x42e4f8['id']]);if(_0x4487ca>-0x1){if(_0x42e4f8['deleted']===!![]){projects[_0x49c4('0xb')](_0x4487ca,0x1);}else{projects[_0x4487ca]=_0x42e4f8;}}else{projects[_0x49c4('0xc')](_0x42e4f8);}}catch(_0x58cad7){logger[_0x49c4('0x9')](_0x58cad7[_0x49c4('0xd')]);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x49c4('0x3')][_0x49c4('0xe')]);logger['info'](util[_0x49c4('0xf')](_0x49c4('0x10'),config['agi']['ip'],config[_0x49c4('0x3')][_0x49c4('0xe')]));}function errorHandler(_0x21f15a){if(_0x21f15a&&_0x21f15a[_0x49c4('0x11')]&&_0x21f15a[_0x49c4('0x12')]){logger[_0x49c4('0x9')](util[_0x49c4('0xf')](_0x49c4('0x13'),_0x21f15a['name'],_0x21f15a[_0x49c4('0x12')]));}else{logger[_0x49c4('0x9')](util[_0x49c4('0xf')](_0x49c4('0x14'),_0x21f15a[_0x49c4('0xd')]));}}function closeHandler(){logger['info'](util[_0x49c4('0xf')](_0x49c4('0x15'),this['arg_1'],this['calleridname'],this[_0x49c4('0x16')],this[_0x49c4('0x17')],this[_0x49c4('0x18')]));try{createSquareReport(this);}catch(_0x59f29b){logger[_0x49c4('0x9')](_0x59f29b['stack']);}}function timeoutHandler(){logger[_0x49c4('0x19')](util[_0x49c4('0xf')](_0x49c4('0x1a'),this[_0x49c4('0x1b')],this[_0x49c4('0x1c')],this[_0x49c4('0x16')],this[_0x49c4('0x17')],this[_0x49c4('0x18')]));}function hangupHandler(){logger[_0x49c4('0x19')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x49c4('0x1c')],this['callerid'],this['dnid'],this[_0x49c4('0x18')]));this[_0x49c4('0x1d')]=!![];}function createSquareReport(_0x26c640,_0xd335e4){rpc['createSquareReport'](_0x26c640)['then'](function(_0x180276){if(_0xd335e4){_0xd335e4(null,_0x180276);}})[_0x49c4('0x1e')](function(_0x565423){if(_0xd335e4){_0xd335e4(null,_0x565423);}});}function setChannelVariables(_0x207358){for(var _0x43e014 in _0x207358){if(_0x207358[_0x49c4('0x1f')](_0x43e014)){if(_0x43e014[_0x49c4('0x20')]('agi_')===0x0){_0x207358[_0x43e014['substring'](0x4)]=_0x207358[_0x43e014];delete _0x207358[_0x43e014];}}}}function agiHandler(_0x449960){logger['debug'](_0x49c4('0x21'),JSON[_0x49c4('0x22')](_0x449960,null,0x2));logger[_0x49c4('0x19')](util[_0x49c4('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x449960[_0x49c4('0x1b')],_0x449960[_0x49c4('0x1c')],_0x449960[_0x49c4('0x16')],_0x449960[_0x49c4('0x17')],_0x449960[_0x49c4('0x18')]));_0x449960['on'](_0x49c4('0x9'),errorHandler);_0x449960['on'](_0x49c4('0x23'),closeHandler);_0x449960['on'](_0x49c4('0x24'),timeoutHandler);_0x449960[_0x49c4('0x1d')]=![];_0x449960['on'](_0x49c4('0x25'),hangupHandler);var _0x46f7ea=_['find'](projects,['name',_0x449960['arg_1']]);if(!_0x46f7ea)return Project[_0x49c4('0x26')](_0x449960);if(!_0x46f7ea[_0x49c4('0x27')])return Project[_0x49c4('0x28')](_0x449960);return Project[_0x49c4('0x29')](_0x46f7ea,_0x449960);}function main(){var _0x28eb47;return utilLicense['getLicense']()[_0x49c4('0x2a')](function(_0x116eb4){if(!_0x116eb4)return;if(_0x116eb4[_0x49c4('0x2b')]){if(_0x116eb4[_0x49c4('0x2c')]&&_0x116eb4['callysquare']>0x0){logger['info'](util[_0x49c4('0xf')](_0x49c4('0x2d'),_0x116eb4[_0x49c4('0x2c')]));_0x28eb47=_0x116eb4[_0x49c4('0x2c')];}else{logger[_0x49c4('0x19')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x49c4('0x19')](_0x49c4('0x2e'));_0x28eb47=-0x1;}})[_0x49c4('0x2a')](function(){return Project['getAll']();})['then'](function(_0x85dce2){projects=_0x85dce2;return;})[_0x49c4('0x1e')](function(_0x3bec0a){logger[_0x49c4('0x9')](_0x49c4('0x2f'),_0x3bec0a[_0x49c4('0xd')]);})[_0x49c4('0x30')](function(){var _0x27ef5f=require(_0x49c4('0x31'))(config['agi'][_0x49c4('0xe')],config['agi']['ip'],_0x28eb47);_0x27ef5f['on'](_0x49c4('0x9'),errorHandler);_0x27ef5f['on'](_0x49c4('0x32'),listeningHandler);_0x27ef5f['on'](_0x49c4('0x33'),connectionHandler);_0x27ef5f['on'](_0x49c4('0x23'),closeHandler);_0x27ef5f['on']('projectUpdate',projectUpdateHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index bb26354..e46e866 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 _0x1d4b=['error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x1d4b,0x1ef));var _0xb1d4=function(_0x514757,_0x3e9c1b){_0x514757=_0x514757-0x0;var _0x1f4e84=_0x1d4b[_0x514757];return _0x1f4e84;};'use strict';var BPromise=require(_0xb1d4('0x0'));var jayson=require(_0xb1d4('0x1'));var client=jayson[_0xb1d4('0x2')][_0xb1d4('0x3')]({'port':0x232b});function request(_0x37a1bb,_0x5824f0){return new BPromise(function(_0x21eee4,_0x287c32){return client['request'](_0x37a1bb,_0x5824f0)[_0xb1d4('0x4')](function(_0x2d36a3){if(_0x2d36a3[_0xb1d4('0x5')]){return _0x287c32(_0x2d36a3[_0xb1d4('0x5')]['message']);}else{return _0x21eee4(_0x2d36a3[_0xb1d4('0x6')]);}})[_0xb1d4('0x7')](function(_0x3cfb2a){return _0x287c32(_0x3cfb2a);});});}exports[_0xb1d4('0x8')]=function(_0x164b75,_0x3288aa){return request(_0xb1d4('0x9'),{'account':_0x164b75,'message':_0x3288aa});}; \ No newline at end of file +var _0x848b=['bluebird','jayson/promise','client','http','request','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x22db81,_0x178936){var _0x46e029=function(_0x57d769){while(--_0x57d769){_0x22db81['push'](_0x22db81['shift']());}};_0x46e029(++_0x178936);}(_0x848b,0xa8));var _0xb848=function(_0x20e1a5,_0x4b811a){_0x20e1a5=_0x20e1a5-0x0;var _0x11c885=_0x848b[_0x20e1a5];return _0x11c885;};'use strict';var BPromise=require(_0xb848('0x0'));var jayson=require(_0xb848('0x1'));var client=jayson[_0xb848('0x2')][_0xb848('0x3')]({'port':0x232b});function request(_0x5b809a,_0x46b559){return new BPromise(function(_0x444ce0,_0x2f5639){return client[_0xb848('0x4')](_0x5b809a,_0x46b559)[_0xb848('0x5')](function(_0x4c6c2c){if(_0x4c6c2c[_0xb848('0x6')]){return _0x2f5639(_0x4c6c2c['error'][_0xb848('0x7')]);}else{return _0x444ce0(_0x4c6c2c[_0xb848('0x8')]);}})[_0xb848('0x9')](function(_0x3e99de){return _0x2f5639(_0x3e99de);});});}exports[_0xb848('0xa')]=function(_0xb1a155,_0x1a6154){return request(_0xb848('0xb'),{'account':_0xb1a155,'message':_0x1a6154});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index eceed7c..6dfc942 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 _0xf791=['code','result','isUndefined','toString','agicommand\x20not\x20found','stack','callerid','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','addEdge','source','target','value','toJson','mxGraphModel','root','inspect','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','traverseBFS','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response'];(function(_0x323e4f,_0x901262){var _0x5bf6a1=function(_0x49d3a){while(--_0x49d3a){_0x323e4f['push'](_0x323e4f['shift']());}};_0x5bf6a1(++_0x901262);}(_0xf791,0x182));var _0x1f79=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0xf791[_0x284bc3];return _0x41ac81;};'use strict';var _=require(_0x1f79('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x1f79('0x1'));var logger=require(_0x1f79('0x2'))(_0x1f79('0x3'));var rpc=require(_0x1f79('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x1f79('0x5'));var Vertices=require(_0x1f79('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1f79('0x7')]()[_0x1f79('0x8')](function(_0x554889){logger[_0x1f79('0x9')](_0x1f79('0xa'),_0x554889['stack']);return[];});}function addVertex(_0x30b588,_0x3f5d32,_0x5b8bcc){_0x3f5d32['agicommand']=_0x5b8bcc;if(_0x3f5d32[_0x1f79('0xb')](_0x1f79('0xc'))){_0x3f5d32[_0x1f79('0xd')]=parseInt(_0x3f5d32['retry'],0xa);}_0x30b588[_0x1f79('0xe')](_[_0x1f79('0xf')](_0x3f5d32,_0x1f79('0x10')));}function initGraph(_0x385142,_0x26d36d){var _0x1e7627=new Graph();for(var _0x3ba7b1 in _0x385142){if(_0x385142[_0x1f79('0xb')](_0x3ba7b1)){if(_[_0x1f79('0x11')](_0x385142[_0x3ba7b1])){for(var _0x3d4491=0x0;_0x3d4491<_0x385142[_0x3ba7b1][_0x1f79('0x12')];_0x3d4491+=0x1){addVertex(_0x1e7627,_0x385142[_0x3ba7b1][_0x3d4491],_0x3ba7b1);}}else{addVertex(_0x1e7627,_0x385142[_0x3ba7b1],_0x3ba7b1);}}}for(var _0x239062=0x0;_0x239062<_0x26d36d[_0x1f79('0x12')];_0x239062+=0x1){if(_0x26d36d[_0x239062]['source']&&_0x26d36d[_0x239062]['target']){_0x1e7627[_0x1f79('0x13')](_0x26d36d[_0x239062][_0x1f79('0x14')],_0x26d36d[_0x239062][_0x1f79('0x15')],_0x26d36d[_0x239062][_0x1f79('0x16')]);}}return _0x1e7627;}function getRoot(_0x2ab09f){return parser[_0x1f79('0x17')](_0x2ab09f,{'object':!![]})[_0x1f79('0x18')][_0x1f79('0x19')];}function inspect(_0x3f80bf){return util[_0x1f79('0x1a')](_0x3f80bf,{'showHidden':![],'depth':null});}function initialize(_0x219fc7,_0xeb73c5){var _0x30ac70=getRoot(_0x219fc7['production']);if(!_0x30ac70||!_0x30ac70[_0x1f79('0x1b')])return;var _0x524b07,_0x54fca1,_0x422526;logger[_0x1f79('0x1c')](_0x1f79('0x19'),JSON[_0x1f79('0x1d')](_0x30ac70,null,0x2));_0xeb73c5[_0x1f79('0x1e')]=moment()[_0x1f79('0x1f')](_0x1f79('0x20'));_0x524b07=initGraph(_['omit'](_0x30ac70,_0x1f79('0x10')),_0x30ac70[_0x1f79('0x10')]);_0x54fca1=new Vertices(_0xeb73c5,rpc,mailRpc);logger[_0x1f79('0x21')](util['format'](_0x1f79('0x22'),_0xeb73c5[_0x1f79('0x23')],_0xeb73c5[_0x1f79('0x24')],_0xeb73c5['callerid'],_0xeb73c5[_0x1f79('0x25')],_0xeb73c5[_0x1f79('0x26')]));_0x524b07[_0x1f79('0x27')](_0x30ac70[_0x1f79('0x1b')]['id'],function(_0x5043c4){try{_0x5043c4=_0x54fca1[_0x1f79('0x28')](_0x5043c4);logger['debug']('vertex',JSON[_0x1f79('0x1d')](_0x5043c4,null,0x2));if(_0x5043c4[_0x1f79('0x29')]===_0x1f79('0x2a')){logger[_0x1f79('0x21')](_0x1f79('0x2b'));_0xeb73c5[_0x1f79('0x2c')]=_0x5043c4[_0x1f79('0x2c')]||_0xeb73c5[_0x1f79('0x2c')];_0xeb73c5[_0x1f79('0x2d')]=_0x5043c4['extension'];_0xeb73c5[_0x1f79('0x2e')]=_0x5043c4[_0x1f79('0x2e')]?_0x5043c4[_0x1f79('0x2e')]-0x1:0x1;return null;}else if(_0x5043c4&&_0x54fca1[_0x5043c4[_0x1f79('0x29')]]){_0x422526=_0x54fca1[_0x5043c4[_0x1f79('0x29')]](_0x5043c4);logger[_0x1f79('0x21')](_0x1f79('0x2f'),JSON[_0x1f79('0x1d')](_0x422526,null,0x2));if(_0x422526&&_0x422526[_0x1f79('0x30')]===AGI_CODE_SUCCESS&&_0x422526[_0x1f79('0x31')]!==AGI_RESULT_ERROR&&!_0xeb73c5['evtHangup']){logger[_0x1f79('0x1c')]('response',inspect(_0x422526));return _[_0x1f79('0x32')](_0x422526['result'])?null:_0x422526[_0x1f79('0x31')][_0x1f79('0x33')]();}else{logger[_0x1f79('0x9')]('response',inspect(_0x422526));return null;}}else{logger['error'](_0x1f79('0x34'));return null;}}catch(_0x304e7b){logger['error'](_0x304e7b[_0x1f79('0x35')]);return null;}});if(_0x30ac70['finally']){logger[_0x1f79('0x21')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xeb73c5['arg_1'],_0xeb73c5['calleridname'],_0xeb73c5[_0x1f79('0x36')],_0xeb73c5[_0x1f79('0x25')],_0xeb73c5[_0x1f79('0x26')]));_0x524b07['traverseBFS'](_0x30ac70[_0x1f79('0x37')]['id'],function(_0x34e4ee){try{_0x34e4ee=_0x54fca1['clear'](_0x34e4ee);logger[_0x1f79('0x1c')]('vertex',JSON[_0x1f79('0x1d')](_0x34e4ee,null,0x2));if(_0x34e4ee&&_0x54fca1[_0x34e4ee[_0x1f79('0x29')]]){_0x422526=_0x54fca1[_0x34e4ee[_0x1f79('0x29')]](_0x34e4ee);if(_0x422526){logger[_0x1f79('0x1c')]('response',inspect(_0x422526));return _['isUndefined'](_0x422526[_0x1f79('0x31')])?null:_0x422526['result'][_0x1f79('0x33')]();}else{logger[_0x1f79('0x9')](_0x1f79('0x2f'),inspect(_0x422526));return null;}}else{logger[_0x1f79('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x2f378a){logger[_0x1f79('0x9')](_0x2f378a[_0x1f79('0x35')]);return null;}});}logger['info'](util['format'](_0x1f79('0x38'),_0xeb73c5['arg_1'],_0xeb73c5[_0x1f79('0x24')],_0xeb73c5[_0x1f79('0x36')],_0xeb73c5[_0x1f79('0x25')],_0xeb73c5[_0x1f79('0x26')]));logger[_0x1f79('0x21')](util[_0x1f79('0x1f')](_0x1f79('0x39'),_0xeb73c5[_0x1f79('0x2c')],_0xeb73c5[_0x1f79('0x2d')],parseInt(_0xeb73c5['priority'],0xa)+0x1));_0xeb73c5[_0x1f79('0x3a')](_0xeb73c5[_0x1f79('0x2c')],_0xeb73c5[_0x1f79('0x2d')],parseInt(_0xeb73c5['priority'],0xa)+0x1);_0xeb73c5[_0x1f79('0x3b')]();}function handleNotFound(_0x3851af){logger[_0x1f79('0x9')](util['format']('Project\x20%s\x20not\x20found',_0x3851af[_0x1f79('0x23')]));_0x3851af[_0x1f79('0x3a')](_0x3851af['context'],_0x3851af[_0x1f79('0x2d')],parseInt(_0x3851af['priority'],0xa)+0x1);_0x3851af[_0x1f79('0x3b')]();}function handleUnpublished(_0x3da6c8){logger[_0x1f79('0x9')](util[_0x1f79('0x1f')](_0x1f79('0x3c'),_0x3da6c8[_0x1f79('0x23')]));_0x3da6c8[_0x1f79('0x3a')](_0x3da6c8['context'],_0x3da6c8[_0x1f79('0x2d')],parseInt(_0x3da6c8['priority'],0xa)+0x1);_0x3da6c8[_0x1f79('0x3b')]();}module[_0x1f79('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xa1b1=['gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','toString','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','close','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','source','target','value','mxGraphModel','root','inspect','production','stringify','joinAt','format','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','dnid','uniqueid','traverseBFS','start','debug','vertex'];(function(_0x2aec24,_0x5bb38a){var _0x3cd1f1=function(_0xf695f3){while(--_0xf695f3){_0x2aec24['push'](_0x2aec24['shift']());}};_0x3cd1f1(++_0x5bb38a);}(_0xa1b1,0x14c));var _0x1a1b=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0xa1b1[_0x53361f];return _0x279237;};'use strict';var _=require(_0x1a1b('0x0'));var moment=require(_0x1a1b('0x1'));var parser=require(_0x1a1b('0x2'));var util=require(_0x1a1b('0x3'));var logger=require(_0x1a1b('0x4'))(_0x1a1b('0x5'));var rpc=require(_0x1a1b('0x6'));var mailRpc=require(_0x1a1b('0x7'));var Graph=require(_0x1a1b('0x8'));var Vertices=require(_0x1a1b('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1a1b('0xa')]()[_0x1a1b('0xb')](function(_0x222b39){logger[_0x1a1b('0xc')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x222b39['stack']);return[];});}function addVertex(_0x21f5be,_0x19e85f,_0x4757d4){_0x19e85f[_0x1a1b('0xd')]=_0x4757d4;if(_0x19e85f[_0x1a1b('0xe')](_0x1a1b('0xf'))){_0x19e85f[_0x1a1b('0x10')]=parseInt(_0x19e85f[_0x1a1b('0xf')],0xa);}_0x21f5be['addVertex'](_[_0x1a1b('0x11')](_0x19e85f,_0x1a1b('0x12')));}function initGraph(_0x2ed181,_0x2d4686){var _0x51c47c=new Graph();for(var _0x467830 in _0x2ed181){if(_0x2ed181[_0x1a1b('0xe')](_0x467830)){if(_['isArray'](_0x2ed181[_0x467830])){for(var _0xf4e5dc=0x0;_0xf4e5dc<_0x2ed181[_0x467830]['length'];_0xf4e5dc+=0x1){addVertex(_0x51c47c,_0x2ed181[_0x467830][_0xf4e5dc],_0x467830);}}else{addVertex(_0x51c47c,_0x2ed181[_0x467830],_0x467830);}}}for(var _0x3e92e0=0x0;_0x3e92e0<_0x2d4686['length'];_0x3e92e0+=0x1){if(_0x2d4686[_0x3e92e0][_0x1a1b('0x13')]&&_0x2d4686[_0x3e92e0][_0x1a1b('0x14')]){_0x51c47c['addEdge'](_0x2d4686[_0x3e92e0][_0x1a1b('0x13')],_0x2d4686[_0x3e92e0][_0x1a1b('0x14')],_0x2d4686[_0x3e92e0][_0x1a1b('0x15')]);}}return _0x51c47c;}function getRoot(_0x33cef2){return parser['toJson'](_0x33cef2,{'object':!![]})[_0x1a1b('0x16')][_0x1a1b('0x17')];}function inspect(_0x4a0043){return util[_0x1a1b('0x18')](_0x4a0043,{'showHidden':![],'depth':null});}function initialize(_0x1ab0fe,_0x471145){var _0x1c6905=getRoot(_0x1ab0fe[_0x1a1b('0x19')]);if(!_0x1c6905||!_0x1c6905['start'])return;var _0x40552b,_0x37a6e1,_0x4673ce;logger['debug'](_0x1a1b('0x17'),JSON[_0x1a1b('0x1a')](_0x1c6905,null,0x2));_0x471145[_0x1a1b('0x1b')]=moment()[_0x1a1b('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x40552b=initGraph(_['omit'](_0x1c6905,_0x1a1b('0x12')),_0x1c6905[_0x1a1b('0x12')]);_0x37a6e1=new Vertices(_0x471145,rpc,mailRpc);logger[_0x1a1b('0x1d')](util[_0x1a1b('0x1c')](_0x1a1b('0x1e'),_0x471145[_0x1a1b('0x1f')],_0x471145[_0x1a1b('0x20')],_0x471145[_0x1a1b('0x21')],_0x471145[_0x1a1b('0x22')],_0x471145[_0x1a1b('0x23')]));_0x40552b[_0x1a1b('0x24')](_0x1c6905[_0x1a1b('0x25')]['id'],function(_0xd525df){try{_0xd525df=_0x37a6e1['clear'](_0xd525df);logger[_0x1a1b('0x26')](_0x1a1b('0x27'),JSON[_0x1a1b('0x1a')](_0xd525df,null,0x2));if(_0xd525df['agicommand']===_0x1a1b('0x28')){logger[_0x1a1b('0x1d')](_0x1a1b('0x29'));_0x471145[_0x1a1b('0x2a')]=_0xd525df[_0x1a1b('0x2a')]||_0x471145[_0x1a1b('0x2a')];_0x471145[_0x1a1b('0x2b')]=_0xd525df[_0x1a1b('0x2b')];_0x471145[_0x1a1b('0x2c')]=_0xd525df['priority']?_0xd525df[_0x1a1b('0x2c')]-0x1:0x1;return null;}else if(_0xd525df&&_0x37a6e1[_0xd525df[_0x1a1b('0xd')]]){_0x4673ce=_0x37a6e1[_0xd525df['agicommand']](_0xd525df);logger[_0x1a1b('0x1d')](_0x1a1b('0x2d'),JSON[_0x1a1b('0x1a')](_0x4673ce,null,0x2));if(_0x4673ce&&_0x4673ce['code']===AGI_CODE_SUCCESS&&_0x4673ce[_0x1a1b('0x2e')]!==AGI_RESULT_ERROR&&!_0x471145[_0x1a1b('0x2f')]){logger['debug'](_0x1a1b('0x2d'),inspect(_0x4673ce));return _[_0x1a1b('0x30')](_0x4673ce['result'])?null:_0x4673ce['result'][_0x1a1b('0x31')]();}else{logger[_0x1a1b('0xc')](_0x1a1b('0x2d'),inspect(_0x4673ce));return null;}}else{logger[_0x1a1b('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x3b46a9){logger['error'](_0x3b46a9[_0x1a1b('0x32')]);return null;}});if(_0x1c6905[_0x1a1b('0x33')]){logger[_0x1a1b('0x1d')](util[_0x1a1b('0x1c')](_0x1a1b('0x34'),_0x471145[_0x1a1b('0x1f')],_0x471145['calleridname'],_0x471145['callerid'],_0x471145[_0x1a1b('0x22')],_0x471145[_0x1a1b('0x23')]));_0x40552b[_0x1a1b('0x24')](_0x1c6905[_0x1a1b('0x33')]['id'],function(_0xa37e0e){try{_0xa37e0e=_0x37a6e1[_0x1a1b('0x35')](_0xa37e0e);logger['debug'](_0x1a1b('0x27'),JSON['stringify'](_0xa37e0e,null,0x2));if(_0xa37e0e&&_0x37a6e1[_0xa37e0e[_0x1a1b('0xd')]]){_0x4673ce=_0x37a6e1[_0xa37e0e[_0x1a1b('0xd')]](_0xa37e0e);if(_0x4673ce){logger[_0x1a1b('0x26')](_0x1a1b('0x2d'),inspect(_0x4673ce));return _[_0x1a1b('0x30')](_0x4673ce[_0x1a1b('0x2e')])?null:_0x4673ce[_0x1a1b('0x2e')]['toString']();}else{logger[_0x1a1b('0xc')]('response',inspect(_0x4673ce));return null;}}else{logger[_0x1a1b('0xc')](_0x1a1b('0x36'));return null;}}catch(_0x20c277){logger[_0x1a1b('0xc')](_0x20c277[_0x1a1b('0x32')]);return null;}});}logger[_0x1a1b('0x1d')](util[_0x1a1b('0x1c')](_0x1a1b('0x37'),_0x471145[_0x1a1b('0x1f')],_0x471145['calleridname'],_0x471145[_0x1a1b('0x21')],_0x471145['dnid'],_0x471145['uniqueid']));logger[_0x1a1b('0x1d')](util[_0x1a1b('0x1c')](_0x1a1b('0x38'),_0x471145[_0x1a1b('0x2a')],_0x471145[_0x1a1b('0x2b')],parseInt(_0x471145[_0x1a1b('0x2c')],0xa)+0x1));_0x471145['continueAt'](_0x471145[_0x1a1b('0x2a')],_0x471145[_0x1a1b('0x2b')],parseInt(_0x471145[_0x1a1b('0x2c')],0xa)+0x1);_0x471145['close']();}function handleNotFound(_0x5b61f3){logger[_0x1a1b('0xc')](util[_0x1a1b('0x1c')](_0x1a1b('0x39'),_0x5b61f3[_0x1a1b('0x1f')]));_0x5b61f3[_0x1a1b('0x3a')](_0x5b61f3[_0x1a1b('0x2a')],_0x5b61f3[_0x1a1b('0x2b')],parseInt(_0x5b61f3[_0x1a1b('0x2c')],0xa)+0x1);_0x5b61f3['close']();}function handleUnpublished(_0x16cf2e){logger[_0x1a1b('0xc')](util['format'](_0x1a1b('0x3b'),_0x16cf2e[_0x1a1b('0x1f')]));_0x16cf2e[_0x1a1b('0x3a')](_0x16cf2e[_0x1a1b('0x2a')],_0x16cf2e[_0x1a1b('0x2b')],parseInt(_0x16cf2e[_0x1a1b('0x2c')],0xa)+0x1);_0x16cf2e[_0x1a1b('0x3c')]();}module[_0x1a1b('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 3877f3a..2ebee65 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 _0x4ddb=['trim','emit','headers','line','exports','util','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','substring','length','split','slice'];(function(_0x34405d,_0x34a21a){var _0x4e6cbe=function(_0xf38318){while(--_0xf38318){_0x34405d['push'](_0x34405d['shift']());}};_0x4e6cbe(++_0x34a21a);}(_0x4ddb,0x1c7));var _0xb4dd=function(_0x4ffee4,_0x1db54d){_0x4ffee4=_0x4ffee4-0x0;var _0x5e9fe4=_0x4ddb[_0x4ffee4];return _0x5e9fe4;};'use strict';var util=require(_0xb4dd('0x0'));var Transform=require('stream')[_0xb4dd('0x1')];function AGIReply(_0x54bac8){Transform[_0xb4dd('0x2')](this,_0x54bac8);this[_0xb4dd('0x3')]='';this[_0xb4dd('0x4')]=![];}util[_0xb4dd('0x5')](AGIReply,Transform);AGIReply[_0xb4dd('0x6')][_0xb4dd('0x7')]=function(_0x2a1fcc,_0x3b25e1,_0x572ef0){var _0x2223fe='\x0a',_0x4c7a72=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x45ad4a=-0x1,_0xde3254=-0x1,_0x1fd6c6='',_0x1a9de=0x0,_0x425ebf='',_0x7d6cdb='';this[_0xb4dd('0x3')]+=_0x2a1fcc['toString']();_0x425ebf=this[_0xb4dd('0x3')];if(!this['_inBody']){_0x1a9de=0x0;while(_0x4c7a72[_0x1a9de]){while((_0xde3254=_0x425ebf[_0xb4dd('0x8')](_0x4c7a72[_0x1a9de]))!=-0x1){_0x1fd6c6=_0x4c7a72[_0x1a9de];_0x7d6cdb=_0x425ebf[_0xb4dd('0x9')](0x0,_0xde3254);_0x425ebf=_0x425ebf[_0xb4dd('0x9')](_0xde3254+_0x1fd6c6[_0xb4dd('0xa')]);var _0x344342=_0x7d6cdb[_0xb4dd('0xb')](_0x2223fe),_0x18bb87=0x0,_0x9560f6={},_0xc2ef52='',_0x5a1ffb='',_0x1d262f=-0x1;while(_0x344342[_0x18bb87]){_0x1d262f=_0x344342[_0x18bb87]['indexOf'](':');if(_0x1d262f!=-0x1){_0xc2ef52=_0x344342[_0x18bb87][_0xb4dd('0xc')](0x0,_0x1d262f)[_0xb4dd('0xd')]();_0x5a1ffb=_0x344342[_0x18bb87][_0xb4dd('0xc')](_0x1d262f+0x1)[_0xb4dd('0xd')]();if(_0xc2ef52[_0xb4dd('0xa')]>0x0){_0x9560f6[_0xc2ef52]=_0x5a1ffb;}}else{}_0x18bb87++;}this[_0xb4dd('0xe')](_0xb4dd('0xf'),_0x9560f6);this[_0xb4dd('0x4')]=!![];}_0x1a9de++;}this[_0xb4dd('0x3')]=_0x425ebf;}else{while((_0x45ad4a=_0x425ebf[_0xb4dd('0x8')](_0x2223fe))!=-0x1){_0x7d6cdb=_0x425ebf[_0xb4dd('0x9')](0x0,_0x45ad4a);this['emit'](_0xb4dd('0x10'),_0x7d6cdb);_0x425ebf=_0x425ebf[_0xb4dd('0x9')](_0x45ad4a+_0x2223fe[_0xb4dd('0xa')]);}this[_0xb4dd('0x3')]=_0x425ebf;}_0x572ef0();};module[_0xb4dd('0x11')]=AGIReply; \ No newline at end of file +var _0xd5e5=['stream','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','line','exports'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xd5e5,0x187));var _0x5d5e=function(_0x2c6ae4,_0x6c8ccc){_0x2c6ae4=_0x2c6ae4-0x0;var _0x4756f0=_0xd5e5[_0x2c6ae4];return _0x4756f0;};'use strict';var util=require('util');var Transform=require(_0x5d5e('0x0'))['Transform'];function AGIReply(_0x3e1c2d){Transform['call'](this,_0x3e1c2d);this[_0x5d5e('0x1')]='';this[_0x5d5e('0x2')]=![];}util[_0x5d5e('0x3')](AGIReply,Transform);AGIReply[_0x5d5e('0x4')][_0x5d5e('0x5')]=function(_0x2818ae,_0x120d3e,_0x4ecfda){var _0x38de77='\x0a',_0x82e1c0=['\x0a\x0a',_0x5d5e('0x6')],_0x232f1b=-0x1,_0x2a6202=-0x1,_0x308f82='',_0x39917c=0x0,_0x21e55e='',_0x11c07c='';this['_localBuffer']+=_0x2818ae[_0x5d5e('0x7')]();_0x21e55e=this[_0x5d5e('0x1')];if(!this[_0x5d5e('0x2')]){_0x39917c=0x0;while(_0x82e1c0[_0x39917c]){while((_0x2a6202=_0x21e55e[_0x5d5e('0x8')](_0x82e1c0[_0x39917c]))!=-0x1){_0x308f82=_0x82e1c0[_0x39917c];_0x11c07c=_0x21e55e[_0x5d5e('0x9')](0x0,_0x2a6202);_0x21e55e=_0x21e55e[_0x5d5e('0x9')](_0x2a6202+_0x308f82[_0x5d5e('0xa')]);var _0xf093a1=_0x11c07c[_0x5d5e('0xb')](_0x38de77),_0x130fc7=0x0,_0xb09e1e={},_0x280081='',_0x473342='',_0x45708f=-0x1;while(_0xf093a1[_0x130fc7]){_0x45708f=_0xf093a1[_0x130fc7][_0x5d5e('0x8')](':');if(_0x45708f!=-0x1){_0x280081=_0xf093a1[_0x130fc7][_0x5d5e('0xc')](0x0,_0x45708f)[_0x5d5e('0xd')]();_0x473342=_0xf093a1[_0x130fc7][_0x5d5e('0xc')](_0x45708f+0x1)[_0x5d5e('0xd')]();if(_0x280081['length']>0x0){_0xb09e1e[_0x280081]=_0x473342;}}else{}_0x130fc7++;}this['emit'](_0x5d5e('0xe'),_0xb09e1e);this['_inBody']=!![];}_0x39917c++;}this['_localBuffer']=_0x21e55e;}else{while((_0x232f1b=_0x21e55e[_0x5d5e('0x8')](_0x38de77))!=-0x1){_0x11c07c=_0x21e55e['substring'](0x0,_0x232f1b);this['emit'](_0x5d5e('0xf'),_0x11c07c);_0x21e55e=_0x21e55e[_0x5d5e('0x9')](_0x232f1b+_0x38de77[_0x5d5e('0xa')]);}this[_0x5d5e('0x1')]=_0x21e55e;}_0x4ecfda();};module[_0x5d5e('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ea169eb..c01e736 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 _0xd6d6=['then','error','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request'];(function(_0x1aa9fa,_0x1c41ba){var _0x7eabc5=function(_0xd9c487){while(--_0xd9c487){_0x1aa9fa['push'](_0x1aa9fa['shift']());}};_0x7eabc5(++_0x1c41ba);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x45343f,_0x181fb9){_0x45343f=_0x45343f-0x0;var _0x40da29=_0xd6d6[_0x45343f];return _0x40da29;};'use strict';var _=require(_0x6d6d('0x0'));var moment=require(_0x6d6d('0x1'));var jayson=require(_0x6d6d('0x2'));var client=jayson[_0x6d6d('0x3')]['http']({'port':0x2329});function request(_0x2e1aed,_0x3b743d){return new Promise(function(_0x1b8610,_0x2a838a){return client[_0x6d6d('0x4')](_0x2e1aed,_0x3b743d)[_0x6d6d('0x5')](function(_0x35a813){if(_0x35a813['error']){return _0x2a838a(_0x35a813[_0x6d6d('0x6')][_0x6d6d('0x7')]);}else{return _0x1b8610(_0x35a813[_0x6d6d('0x8')]);}})[_0x6d6d('0x9')](function(_0xd49f57){return _0x2a838a(_0xd49f57);});});}exports[_0x6d6d('0xa')]=function(){return request(_0x6d6d('0xb'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x6d6d('0xc')]=function(_0x1fa46d){return request(_0x6d6d('0xd'),{'options':{'raw':![],'where':{'name':_0x1fa46d},'attributes':[_0x6d6d('0xe')]}});};exports[_0x6d6d('0xf')]=function(_0x576c88){return request(_0x6d6d('0x10'),{'options':{'raw':![],'where':{'id':_0x576c88},'include':[{'model':_0x6d6d('0x11'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0x6d6d('0x12')}]}],'attributes':['id',_0x6d6d('0x13'),_0x6d6d('0x14')],'smtp':!![]}});};exports[_0x6d6d('0x15')]=function(_0x2b74ed){return request(_0x6d6d('0xd'),{'options':{'where':{'id':_0x2b74ed},'attributes':[_0x6d6d('0x13')]}});};exports[_0x6d6d('0x16')]=function(_0x5f4154){return request(_0x6d6d('0x17'),{'options':{'where':{'id':_0x5f4154},'attributes':[_0x6d6d('0x13')]}});};exports[_0x6d6d('0x18')]=function(_0xa3b05d){return request(_0x6d6d('0x19'),{'options':{'where':{'id':_0xa3b05d},'attributes':['name']}});};exports[_0x6d6d('0x1a')]=function(_0x587338){return request(_0x6d6d('0x1b'),{'options':{'where':{'id':_0x587338},'attributes':[_0x6d6d('0x1c')]}});};exports[_0x6d6d('0x1d')]=function(_0x4bb3d1){return request('ShowUser',{'options':{'where':{'id':_0x4bb3d1},'attributes':[_0x6d6d('0x13')]}});};exports[_0x6d6d('0x1e')]=function(_0x2b59d4){return request(_0x6d6d('0x1f'),{'options':{'where':{'phone':_0x2b59d4['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x474873){return request('ShowTrunk',{'options':{'where':{'id':_0x474873},'attributes':[_0x6d6d('0x13')]}});};exports[_0x6d6d('0x20')]=function(_0x30d87d){return request(_0x6d6d('0x21'),{'options':{'where':{'id':_0x30d87d},'attributes':[_0x6d6d('0x22')]}});};exports[_0x6d6d('0x23')]=function(_0x164c67){return request(_0x6d6d('0x24'),{'options':{'raw':![],'where':{'id':_0x164c67},'include':[{'model':_0x6d6d('0x25'),'as':_0x6d6d('0x26')}]}});};exports[_0x6d6d('0x27')]=function(_0x6e58e3){return request(_0x6d6d('0x28'),{'options':{'where':{'id':_0x6e58e3},'attributes':['id',_0x6d6d('0x13')]}});};exports[_0x6d6d('0x29')]=function(_0x25a02e){return request(_0x6d6d('0x2a'),{'body':_0x25a02e});};exports['createSquareDetailsReport']=function(_0x3b73e5){return request(_0x6d6d('0x2b'),{'body':_0x3b73e5});};exports[_0x6d6d('0x2c')]=function(_0x97ec9e){return request(_0x6d6d('0x2d'),{'body':_[_0x6d6d('0x2e')](_0x97ec9e,{'project_name':_0x97ec9e['arg_1'],'prev_project_name':_0x97ec9e[_0x6d6d('0x2f')]||'','is_subproject':_0x97ec9e[_0x6d6d('0x2f')]?!![]:![],'leaveAt':moment()[_0x6d6d('0x30')](_0x6d6d('0x31'))})});};exports[_0x6d6d('0x32')]=function(_0x408f98){return request(_0x6d6d('0x33'),{'body':_0x408f98});};exports['createSquareMessage']=function(_0x298408){return request(_0x6d6d('0x34'),{'body':_0x298408});};exports['createCmContact']=function(_0x553645){return request(_0x6d6d('0x35'),{'options':{'raw':![],'where':{'phone':_0x553645[_0x6d6d('0x36')],'ListId':_0x553645[_0x6d6d('0x37')]}}})['then'](function(_0xde3272){if(_0xde3272){return _0xde3272;}return request(_0x6d6d('0x38'),{'body':_0x553645});});};exports[_0x6d6d('0x39')]=function(_0x1c8340){return request(_0x6d6d('0x3a'),{'options':{'where':{'id':_0x1c8340},'attributes':[_0x6d6d('0x13')]}});};exports[_0x6d6d('0x3b')]=function(_0x359cfd,_0x6c4741){return request(_0x6d6d('0x3c'),{'body':{'interface':_0x6c4741},'options':{'where':_0x359cfd}});};exports['agentPause']=function(_0x1f9469,_0x4f1fc5,_0x18015a){return request(_0x6d6d('0x3d'),{'body':{'type':_0x4f1fc5,'uniqueid':_0x18015a},'options':{'where':_0x1f9469}});};exports[_0x6d6d('0x3e')]=function(_0x2814ed){return request('UnpauseUser',{'body':{},'options':{'where':_0x2814ed}});};exports[_0x6d6d('0x3f')]=function(_0x4f2f13){return request(_0x6d6d('0x40'),{'body':{},'options':{'where':_0x4f2f13}});}; \ No newline at end of file +var _0xb673=['getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','http','request','error','message','result','catch','production','getMailAccountById','ShowMailAccount','name','email','ShowSquareProject'];(function(_0x74a161,_0x6a354a){var _0x54ae52=function(_0x262526){while(--_0x262526){_0x74a161['push'](_0x74a161['shift']());}};_0x54ae52(++_0x6a354a);}(_0xb673,0xa5));var _0x3b67=function(_0x5d2e10,_0x539927){_0x5d2e10=_0x5d2e10-0x0;var _0x5dc58c=_0xb673[_0x5d2e10];return _0x5dc58c;};'use strict';var _=require(_0x3b67('0x0'));var moment=require(_0x3b67('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x3b67('0x2')][_0x3b67('0x3')]({'port':0x2329});function request(_0x188176,_0x5d6ed9){return new Promise(function(_0x1ef41d,_0x16c7b7){return client[_0x3b67('0x4')](_0x188176,_0x5d6ed9)['then'](function(_0x33d4cd){if(_0x33d4cd['error']){return _0x16c7b7(_0x33d4cd[_0x3b67('0x5')][_0x3b67('0x6')]);}else{return _0x1ef41d(_0x33d4cd[_0x3b67('0x7')]);}})[_0x3b67('0x8')](function(_0x5703ee){return _0x16c7b7(_0x5703ee);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x3b67('0x9')]}});};exports['getSquareProject']=function(_0x2571fe){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2571fe},'attributes':[_0x3b67('0x9')]}});};exports[_0x3b67('0xa')]=function(_0xb69488){return request(_0x3b67('0xb'),{'options':{'raw':![],'where':{'id':_0xb69488},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id',_0x3b67('0xc'),_0x3b67('0xd')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x113a38){return request(_0x3b67('0xe'),{'options':{'where':{'id':_0x113a38},'attributes':['name']}});};exports[_0x3b67('0xf')]=function(_0x29be4e){return request(_0x3b67('0x10'),{'options':{'where':{'id':_0x29be4e},'attributes':[_0x3b67('0xc')]}});};exports[_0x3b67('0x11')]=function(_0x46168c){return request('ShowVariable',{'options':{'where':{'id':_0x46168c},'attributes':['name']}});};exports[_0x3b67('0x12')]=function(_0x5e7f60){return request(_0x3b67('0x13'),{'options':{'where':{'id':_0x5e7f60},'attributes':[_0x3b67('0x14')]}});};exports['getUserById']=function(_0x204b66){return request(_0x3b67('0x15'),{'options':{'where':{'id':_0x204b66},'attributes':['name']}});};exports[_0x3b67('0x16')]=function(_0x607f4d){return request(_0x3b67('0x17'),{'options':{'where':{'phone':_0x607f4d[_0x3b67('0x18')]},'attributes':['id']}});};exports[_0x3b67('0x19')]=function(_0x533b2b){return request(_0x3b67('0x1a'),{'options':{'where':{'id':_0x533b2b},'attributes':[_0x3b67('0xc')]}});};exports[_0x3b67('0x1b')]=function(_0x358dd0){return request(_0x3b67('0x1c'),{'options':{'where':{'id':_0x358dd0},'attributes':[_0x3b67('0x1d')]}});};exports[_0x3b67('0x1e')]=function(_0x5c3b27){return request(_0x3b67('0x1f'),{'options':{'raw':![],'where':{'id':_0x5c3b27},'include':[{'model':_0x3b67('0x20'),'as':_0x3b67('0x21')}]}});};exports['getSmsAccountById']=function(_0x122819){return request(_0x3b67('0x22'),{'options':{'where':{'id':_0x122819},'attributes':['id',_0x3b67('0xc')]}});};exports[_0x3b67('0x23')]=function(_0x35f1dc){return request(_0x3b67('0x24'),{'body':_0x35f1dc});};exports[_0x3b67('0x25')]=function(_0x154225){return request(_0x3b67('0x26'),{'body':_0x154225});};exports[_0x3b67('0x27')]=function(_0x24f997){return request(_0x3b67('0x28'),{'body':_[_0x3b67('0x29')](_0x24f997,{'project_name':_0x24f997[_0x3b67('0x2a')],'prev_project_name':_0x24f997[_0x3b67('0x2b')]||'','is_subproject':_0x24f997[_0x3b67('0x2b')]?!![]:![],'leaveAt':moment()[_0x3b67('0x2c')](_0x3b67('0x2d'))})});};exports[_0x3b67('0x2e')]=function(_0xb03b94){return request('CreateSquareRecording',{'body':_0xb03b94});};exports[_0x3b67('0x2f')]=function(_0x184e14){return request(_0x3b67('0x30'),{'body':_0x184e14});};exports[_0x3b67('0x31')]=function(_0x122483){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x122483['phone'],'ListId':_0x122483['ListId']}}})[_0x3b67('0x32')](function(_0x46568e){if(_0x46568e){return _0x46568e;}return request(_0x3b67('0x33'),{'body':_0x122483});});};exports[_0x3b67('0x34')]=function(_0x3224c6){return request(_0x3b67('0x35'),{'options':{'where':{'id':_0x3224c6},'attributes':[_0x3b67('0xc')]}});};exports['agentLogin']=function(_0x249e3e,_0x13c0bb){return request(_0x3b67('0x36'),{'body':{'interface':_0x13c0bb},'options':{'where':_0x249e3e}});};exports[_0x3b67('0x37')]=function(_0x52b8cd,_0x296cd2,_0x2da368){return request(_0x3b67('0x38'),{'body':{'type':_0x296cd2,'uniqueid':_0x2da368},'options':{'where':_0x52b8cd}});};exports['agentUnpause']=function(_0x20198b){return request(_0x3b67('0x39'),{'body':{},'options':{'where':_0x20198b}});};exports[_0x3b67('0x3a')]=function(_0x1739f2){return request(_0x3b67('0x3b'),{'body':{},'options':{'where':_0x1739f2}});}; \ 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 45492c6..d856ed9 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 _0xed20=['./lex','exports','./polly'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xed20,0xce));var _0x0ed2=function(_0x5743ea,_0x3c4a21){_0x5743ea=_0x5743ea-0x0;var _0x3e6684=_0xed20[_0x5743ea];return _0x3e6684;};var polly=require(_0x0ed2('0x0'));var lex=require(_0x0ed2('0x1'));module[_0x0ed2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x510e=['exports','./polly','./lex'];(function(_0x116d16,_0x388220){var _0x518f1d=function(_0x3710fb){while(--_0x3710fb){_0x116d16['push'](_0x116d16['shift']());}};_0x518f1d(++_0x388220);}(_0x510e,0x1ed));var _0xe510=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x510e[_0x599e60];return _0x468e19;};var polly=require(_0xe510('0x0'));var lex=require(_0xe510('0x1'));module[_0xe510('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 4fddcc5..1983095 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['exports'];(function(_0x5b7136,_0x1a4a17){var _0x18bbd9=function(_0x558804){while(--_0x558804){_0x5b7136['push'](_0x5b7136['shift']());}};_0x18bbd9(++_0x1a4a17);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1f9bce,_0x2e565c){_0x1f9bce=_0x1f9bce-0x0;var _0x303e4d=_0x6f0d[_0x1f9bce];return _0x303e4d;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +var _0xee5b=['./lib/api'];(function(_0xc0f399,_0x2afe3a){var _0x5dd13f=function(_0x18656a){while(--_0x18656a){_0xc0f399['push'](_0xc0f399['shift']());}};_0x5dd13f(++_0x2afe3a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5676cc,_0x28ff16){_0x5676cc=_0x5676cc-0x0;var _0x387ccd=_0xee5b[_0x5676cc];return _0x387ccd;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ 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 4d32cc0..2ffacc2 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(_0x24b641,_0x511f50){var _0x172581=function(_0x1fac48){while(--_0x1fac48){_0x24b641['push'](_0x24b641['shift']());}};_0x172581(++_0x511f50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x2a92b3,_0x4ed770){var _0xc5315e=function(_0x2b3c2e){while(--_0x2b3c2e){_0x2a92b3['push'](_0x2a92b3['shift']());}};_0xc5315e(++_0x4ed770);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 65e3e80..b9a8100 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 _0xec86=['./lib/api','exports'];(function(_0x5dedfa,_0x58d974){var _0x3e4ccc=function(_0x3de05c){while(--_0x3de05c){_0x5dedfa['push'](_0x5dedfa['shift']());}};_0x3e4ccc(++_0x58d974);}(_0xec86,0x134));var _0x6ec8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xec86[_0x2c91e9];return _0x13f0ff;};'use strict';var polly=require(_0x6ec8('0x0'));module[_0x6ec8('0x1')]=function(_0x32607b,_0xe62346,_0x476500,_0x3b6b47,_0x2bb555,_0x129bd1,_0x5180ae){return polly(_0x32607b,_0xe62346,_0x476500,_0x3b6b47,_0x2bb555,_0x129bd1,_0x5180ae);}; \ No newline at end of file +var _0x4420=['./lib/api','exports'];(function(_0x1712d2,_0x493af7){var _0x4538d6=function(_0x332c65){while(--_0x332c65){_0x1712d2['push'](_0x1712d2['shift']());}};_0x4538d6(++_0x493af7);}(_0x4420,0x182));var _0x0442=function(_0x3312d5,_0x18a5e2){_0x3312d5=_0x3312d5-0x0;var _0x9d9ff6=_0x4420[_0x3312d5];return _0x9d9ff6;};'use strict';var polly=require(_0x0442('0x0'));module[_0x0442('0x1')]=function(_0x2eaa15,_0x27cc1e,_0x2d3ba4,_0x30954b,_0x10d077,_0x3dc7fa,_0x21bfe2){return polly(_0x2eaa15,_0x27cc1e,_0x2d3ba4,_0x30954b,_0x10d077,_0x3dc7fa,_0x21bfe2);}; \ 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 713ae01..eee447b 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 _0x7592=['writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','aws-sdk','synthesizeSpeech'];(function(_0x30e74c,_0x2fa8a5){var _0x1ffebd=function(_0x284197){while(--_0x284197){_0x30e74c['push'](_0x30e74c['shift']());}};_0x1ffebd(++_0x2fa8a5);}(_0x7592,0x126));var _0x2759=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x7592[_0x59befa];return _0x1dd63d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x2759('0x0'));function pollyResult(_0x2cd2cf,_0x41cf52,_0x4d18a6){return new BPromise(function(_0x55037c,_0x28cf9c){_0x2cd2cf[_0x2759('0x1')](_0x41cf52,function(_0x5aa3b3,_0x12be7c){if(_0x5aa3b3){_0x28cf9c(_0x5aa3b3);}else if(_0x12be7c){if(_0x12be7c['AudioStream']instanceof Buffer){fs[_0x2759('0x2')](_0x4d18a6,_0x12be7c[_0x2759('0x3')],function(_0x49069e){if(_0x49069e){_0x28cf9c(_0x49069e);}else{_0x55037c();}});}else{_0x28cf9c(new Error(_0x2759('0x4')));}}else{_0x28cf9c(new Error(_0x2759('0x5')));}});});}module[_0x2759('0x6')]=function(_0x2b13de,_0x2d48b8,_0x4a9491,_0x181bfb,_0x586dbe,_0x9db7d3,_0x2eaffe){var _0x893c7b=new AWS['Polly']({'accessKeyId':_0x2b13de,'secretAccessKey':_0x2d48b8,'region':_0x4a9491});var _0x1403f6={'Text':_0x586dbe,'TextType':_0x9db7d3||_0x2759('0x7'),'OutputFormat':'mp3','VoiceId':_0x181bfb};return pollyResult(_0x893c7b,_0x1403f6,_0x2eaffe);}; \ No newline at end of file +var _0xe642=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','aws-sdk'];(function(_0x3317e0,_0x5ae5f6){var _0x3f6574=function(_0x2c1078){while(--_0x2c1078){_0x3317e0['push'](_0x3317e0['shift']());}};_0x3f6574(++_0x5ae5f6);}(_0xe642,0xe8));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x2e64('0x0'));var rs=require('randomstring');var AWS=require(_0x2e64('0x1'));function pollyResult(_0x5da46f,_0x442582,_0x2b497e){return new BPromise(function(_0x2337d3,_0x4a6b77){_0x5da46f[_0x2e64('0x2')](_0x442582,function(_0x50186c,_0x31a0b4){if(_0x50186c){_0x4a6b77(_0x50186c);}else if(_0x31a0b4){if(_0x31a0b4[_0x2e64('0x3')]instanceof Buffer){fs[_0x2e64('0x4')](_0x2b497e,_0x31a0b4[_0x2e64('0x3')],function(_0x434deb){if(_0x434deb){_0x4a6b77(_0x434deb);}else{_0x2337d3();}});}else{_0x4a6b77(new Error(_0x2e64('0x5')));}}else{_0x4a6b77(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x2e64('0x6')]=function(_0x80a7c3,_0x8a5bc6,_0x5c8195,_0x1b780f,_0x18cc2d,_0x34392b,_0x2d2c31){var _0x5d43dc=new AWS[(_0x2e64('0x7'))]({'accessKeyId':_0x80a7c3,'secretAccessKey':_0x8a5bc6,'region':_0x5c8195});var _0x40487a={'Text':_0x18cc2d,'TextType':_0x34392b||'text','OutputFormat':_0x2e64('0x8'),'VoiceId':_0x1b780f};return pollyResult(_0x5d43dc,_0x40487a,_0x2d2c31);}; \ 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 0c3adf9..4d1ebbd 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 _0xdeb9=['exports','./lib/api'];(function(_0x5b04d6,_0xf7b953){var _0x36005f=function(_0x458958){while(--_0x458958){_0x5b04d6['push'](_0x5b04d6['shift']());}};_0x36005f(++_0xf7b953);}(_0xdeb9,0x119));var _0x9deb=function(_0x2b9f8c,_0x540172){_0x2b9f8c=_0x2b9f8c-0x0;var _0x472bc9=_0xdeb9[_0x2b9f8c];return _0x472bc9;};'use strict';var asr=require(_0x9deb('0x0'));module[_0x9deb('0x1')]=function(_0xaa29c9,_0x4fa839,_0x830e33,_0x5a2943){return asr(_0xaa29c9,_0x4fa839,_0x830e33);}; \ No newline at end of file +var _0xfbbc=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbbc,0x86));var _0xcfbb=function(_0x20ecb6,_0x279331){_0x20ecb6=_0x20ecb6-0x0;var _0x52fa84=_0xfbbc[_0x20ecb6];return _0x52fa84;};'use strict';var asr=require('./lib/api');module[_0xcfbb('0x0')]=function(_0x1b2a2b,_0x2de861,_0x2d8f78,_0x3f0544){return asr(_0x1b2a2b,_0x2de861,_0x2d8f78);}; \ 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 2a516df..c5c00bf 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 _0x1152=['LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key='];(function(_0x15d455,_0x55412f){var _0x32e5ca=function(_0xc9b24d){while(--_0xc9b24d){_0x15d455['push'](_0x15d455['shift']());}};_0x32e5ca(++_0x55412f);}(_0x1152,0x182));var _0x2115=function(_0x13b228,_0x348b33){_0x13b228=_0x13b228-0x0;var _0xa6567d=_0x1152[_0x13b228];return _0xa6567d;};'use strict';var url=require(_0x2115('0x0'));var BPromise=require(_0x2115('0x1'));var fs=require('fs');var host=_0x2115('0x2');module[_0x2115('0x3')]=function(_0x20049f,_0x31ab3c,_0x31783d){return new BPromise(function(_0x3b8dfa,_0x4d0f31){var _0x1e8a26;if(typeof _0x20049f!=='string'||_0x20049f[_0x2115('0x4')]===0x0){return _0x4d0f31(_0x2115('0x5'));}if(typeof _0x31ab3c!=='string'||_0x31ab3c['length']===0x0){return _0x4d0f31('key\x20should\x20be\x20a\x20string');}if(typeof _0x31783d!=='undefined'&&(typeof _0x31783d!=='string'||_0x31783d[_0x2115('0x4')]===0x0)){return _0x4d0f31(_0x2115('0x6'));}try{_0x1e8a26=fs[_0x2115('0x7')](_0x20049f)['toString'](_0x2115('0x8'));}catch(_0x534958){return _0x4d0f31(_0x534958);}return _0x3b8dfa({'method':'POST','uri':host+_0x2115('0x9')+_0x31ab3c,'body':{'config':{'encoding':_0x2115('0xa'),'sampleRateHertz':_0x2115('0xb'),'languageCode':_0x31783d},'audio':{'content':_0x1e8a26}},'json':!![]});});}; \ No newline at end of file +var _0xd246=['undefined','lang\x20should\x20be\x20a\x20string','base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','length','string','key\x20should\x20be\x20a\x20string'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0xd246,0xf5));var _0x6d24=function(_0x51f492,_0x6b3e08){_0x51f492=_0x51f492-0x0;var _0x4c76eb=_0xd246[_0x51f492];return _0x4c76eb;};'use strict';var url=require(_0x6d24('0x0'));var BPromise=require(_0x6d24('0x1'));var fs=require('fs');var host=_0x6d24('0x2');module[_0x6d24('0x3')]=function(_0x3e2217,_0x20310f,_0x1d0589){return new BPromise(function(_0x51c18f,_0x4e76e1){var _0xfa68f3;if(typeof _0x3e2217!=='string'||_0x3e2217[_0x6d24('0x4')]===0x0){return _0x4e76e1('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x20310f!==_0x6d24('0x5')||_0x20310f[_0x6d24('0x4')]===0x0){return _0x4e76e1(_0x6d24('0x6'));}if(typeof _0x1d0589!==_0x6d24('0x7')&&(typeof _0x1d0589!==_0x6d24('0x5')||_0x1d0589[_0x6d24('0x4')]===0x0)){return _0x4e76e1(_0x6d24('0x8'));}try{_0xfa68f3=fs['readFileSync'](_0x3e2217)['toString'](_0x6d24('0x9'));}catch(_0x519e5e){return _0x4e76e1(_0x519e5e);}return _0x51c18f({'method':_0x6d24('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x20310f,'body':{'config':{'encoding':_0x6d24('0xb'),'sampleRateHertz':'8000','languageCode':_0x1d0589},'audio':{'content':_0xfa68f3}},'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 8f903b3..82287ee 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 _0x714e=['./asr','exports'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x714e,0xea));var _0xe714=function(_0x49cf85,_0xfdf2d7){_0x49cf85=_0x49cf85-0x0;var _0x24f687=_0x714e[_0x49cf85];return _0x24f687;};var asr=require(_0xe714('0x0'));module[_0xe714('0x1')]={'asr':asr}; \ No newline at end of file +var _0xc60f=['./asr'];(function(_0x139a23,_0x184a3f){var _0x4da424=function(_0x5d6309){while(--_0x5d6309){_0x139a23['push'](_0x139a23['shift']());}};_0x4da424(++_0x184a3f);}(_0xc60f,0x137));var _0xfc60=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0xc60f[_0x1d7037];return _0x4d6568;};var asr=require(_0xfc60('0x0'));module['exports']={'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 c43d1ef..40b31cb 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 _0x1d01=['chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','then','.mp3','from','audioContent','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','fulfillment','score','status','code','metadata','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%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','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','randomstring','sox','url','parse','util','./aws','./google','./sestek','https://api.ispeech.org/api/rest','protocol','get','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','pipe','https:','host','WHAT_EVER','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1d01,0xf1));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require(_0x11d0('0x0'));var BPromise=require(_0x11d0('0x1'));var dialogflow=require(_0x11d0('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x11d0('0x3'));var md5=require(_0x11d0('0x4'));var path=require(_0x11d0('0x5'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x11d0('0x6'));var sox=require(_0x11d0('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x11d0('0x8'))[_0x11d0('0x9')];var util=require(_0x11d0('0xa'));var aws=require(_0x11d0('0xb'));var google=require(_0x11d0('0xc'));var sestek=require(_0x11d0('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x11d0('0xe');function downloadFile(_0x4f7d1e,_0x438d83){return new BPromise(function(_0x21bf45,_0x73ece7){var _0x335442=urlParse(_0x4f7d1e);var _0x2fd37f=_0x335442[_0x11d0('0xf')]==='https:'?https:http;var _0x54c1df={'host':_0x335442['host'],'path':_0x335442['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x2fd37f[_0x11d0('0x10')](_0x54c1df,function(_0x49be1a){if(_0x49be1a[_0x11d0('0x11')]!==0xc8){logger['error']('request\x20to\x20'+_0x4f7d1e+'\x20failed,\x20status\x20code\x20=\x20'+_0x49be1a['statusCode']+'\x20('+_0x49be1a[_0x11d0('0x12')]+')');_0x73ece7(new Error(_0x11d0('0x13')+_0x4f7d1e+_0x11d0('0x14')+_0x49be1a['statusCode']+'\x20('+_0x49be1a[_0x11d0('0x12')]+')'));return;}var _0x561ede=fs[_0x11d0('0x15')](_0x438d83);_0x561ede['on'](_0x11d0('0x16'),function(){logger[_0x11d0('0x17')](_0x11d0('0x18'));_0x561ede[_0x11d0('0x19')](_0x21bf45);});_0x561ede['on'](_0x11d0('0x1a'),function(_0x3be131){fs[_0x11d0('0x1b')](_0x438d83);logger[_0x11d0('0x1a')]('download\x20error',_0x3be131);_0x73ece7(_0x3be131);});_0x49be1a[_0x11d0('0x1c')](_0x561ede);})['on'](_0x11d0('0x1a'),function(_0x21a48c){logger[_0x11d0('0x1a')](_0x21a48c);_0x73ece7(_0x21a48c);})['end']();});}function uploadFile(_0x5ed65e){return new BPromise(function(_0x17846d,_0x51dc0f){var _0x414cc2=urlParse(_0x5ed65e);var _0x5a9901=_0x414cc2['protocol']===_0x11d0('0x1d')?https:http;var _0x2d8141={'host':_0x414cc2[_0x11d0('0x1e')],'path':_0x414cc2[_0x11d0('0x5')],'headers':{'user-agent':_0x11d0('0x1f')}};_0x5a9901['get'](_0x2d8141,function(_0x55b7fe){if(_0x55b7fe[_0x11d0('0x11')]!==0xc8){_0x51dc0f(new Error(_0x11d0('0x13')+_0x5ed65e+_0x11d0('0x14')+_0x55b7fe[_0x11d0('0x11')]+'\x20('+_0x55b7fe[_0x11d0('0x12')]+')'));return;}var _0x11650a='';_0x55b7fe['on'](_0x11d0('0x20'),function(_0x2d7660){_0x11650a+=_0x2d7660;});_0x55b7fe['on'](_0x11d0('0x21'),function(){_0x17846d(_0x11650a);});})['on'](_0x11d0('0x1a'),function(_0x1e9167){_0x51dc0f(_0x1e9167);})[_0x11d0('0x21')]();});}function convertFile(_0x8f766a,_0x4039ba){return new BPromise(function(_0x385eae,_0x333c82){var _0x32700d=sox[_0x11d0('0x22')](_0x8f766a,_0x4039ba,{'sampleRate':0x1f40,'format':_0x11d0('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x32700d['on'](_0x11d0('0x1a'),function(_0x4580e8){logger[_0x11d0('0x1a')](_0x11d0('0x24'),_0x4580e8);_0x333c82(_0x4580e8);});_0x32700d['on']('end',function(){logger['info'](_0x11d0('0x25'));_0x385eae();});_0x32700d[_0x11d0('0x26')]();});}function base64Decode(_0x507ccf,_0x370e82){var _0xf61a4f=path[_0x11d0('0x27')](__dirname,_0x11d0('0x28'),rs[_0x11d0('0x29')](0x4)+_0x11d0('0x2a'));fs[_0x11d0('0x2b')](_0xf61a4f,_0x507ccf,_0x11d0('0x2c'));return convertFile(_0xf61a4f,_0x370e82)['then'](function(){try{fs[_0x11d0('0x1b')](_0xf61a4f);fs[_0x11d0('0x2d')](_0x370e82,_0x11d0('0x2e'));}catch(_0x4573f9){logger[_0x11d0('0x1a')](_0x4573f9);}return _0x370e82['split']('.')[0x0];});}function base64Encode(_0x4c3e22){var _0x4ac8ba=fs[_0x11d0('0x2f')](_0x4c3e22);return new Buffer(_0x4ac8ba)[_0x11d0('0x30')](_0x11d0('0x2c'));}exports[_0x11d0('0x31')]=function(_0x3a447d,_0x4dbecb,_0x10a58b,_0x1f52f1,_0x1471cd,_0x20b986){var _0x101e11,_0x4f7273;var _0x19b9ea=_0x11d0('0x32');var _0x1d4f9f=_0x11d0('0x33')+_0x3a447d;var _0x91221c={};if(_0x4dbecb==='ssml'){_0x91221c[_0x11d0('0x34')]={'ssml':_0x10a58b};}else{_0x91221c[_0x11d0('0x34')]={'text':_0x10a58b};};_0x91221c[_0x11d0('0x35')]={'languageCode':_0x1f52f1,'ssmlGender':_0x1471cd};_0x91221c[_0x11d0('0x36')]={'audioEncoding':_0x11d0('0x37'),'sampleRateHertz':0x1f40};var _0x3c8011={'url':_0x19b9ea+_0x11d0('0x38')+_0x1d4f9f,'method':_0x11d0('0x39'),'json':!![],'body':_0x91221c};return rp(_0x3c8011)[_0x11d0('0x3a')](function(_0x3fc9be){return new BPromise(function(_0x1bd375,_0x4bfdd7){_0x101e11=path[_0x11d0('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x11d0('0x3b'));var _0x429cfe=Buffer[_0x11d0('0x3c')](_0x3fc9be[_0x11d0('0x3d')],'base64');return fs['writeFile'](_0x101e11,_0x429cfe,function(_0x13d0da){_0x4bfdd7(_0x13d0da);},function(_0x3157da){fs['chmodSync'](_0x101e11,_0x11d0('0x2e'));_0x1bd375(_0x3157da);});});})[_0x11d0('0x3a')](function(_0x29ebb3){_0x4f7273=path[_0x11d0('0x27')](__dirname,'tmp',rs[_0x11d0('0x29')](0x4)+_0x11d0('0x2a'));return convertFile(_0x101e11,_0x4f7273);})['then'](function(){try{fs[_0x11d0('0x1b')](_0x101e11);fs[_0x11d0('0x2d')](_0x4f7273,'777');}catch(_0x168965){logger[_0x11d0('0x1a')](_0x168965);}logger[_0x11d0('0x17')]('googleCloudTTS\x20path',_0x4f7273[_0x11d0('0x3e')]('.')[0x0]);return _0x4f7273[_0x11d0('0x3e')]('.')[0x0];});};exports[_0x11d0('0x3f')]=function(_0x5c4c6a,_0x2c8435){var _0x33c2e4=_0x11d0('0x40');var _0x202c8e,_0x2a964f;var _0x5c5f0d;var _0x107adb={'encoding':_0x11d0('0x41'),'method':_0x11d0('0x39'),'timeout':0x2710,'url':_0x33c2e4,'headers':{'Content-Type':_0x11d0('0x42')},'body':_0x11d0('0x43')+encodeURIComponent(JSON[_0x11d0('0x44')]([[[_0x11d0('0x45'),JSON[_0x11d0('0x44')]([_0x5c4c6a,_0x2c8435||'en',![],_0x11d0('0x46')]),null,_0x11d0('0x47')]]]))};return rp(_0x107adb)[_0x11d0('0x3a')](function(_0x1338e5){try{_0x5c5f0d=eval(_0x1338e5[_0x11d0('0x48')](0x5))[0x0][0x2];}catch(_0x20a3c7){throw new Error(_0x11d0('0x49')+_0x1338e5['data']);}if(!_0x5c5f0d){if(_0x5c4c6a[_0x11d0('0x4a')]>0xc8){throw new Error(_0x11d0('0x4b'));}else{throw new Error(_0x11d0('0x4c')+_0x2c8435+_0x11d0('0x4d'));}}try{_0x5c5f0d=eval(_0x5c5f0d)[0x0];}catch(_0x4bbd3f){throw new Error(_0x11d0('0x49')+res[_0x11d0('0x20')]);}const _0x33146d=_0x5c5f0d;_0x202c8e=path['resolve'](__dirname,_0x11d0('0x28'),rs[_0x11d0('0x29')](0x4)+_0x11d0('0x3b'));fs[_0x11d0('0x2b')](_0x202c8e,_0x5c5f0d,{'encoding':_0x11d0('0x2c')});_0x2a964f=path[_0x11d0('0x27')](__dirname,_0x11d0('0x28'),rs[_0x11d0('0x29')](0x4)+_0x11d0('0x2a'));return convertFile(_0x202c8e,_0x2a964f);})['then'](function(){try{fs[_0x11d0('0x1b')](_0x202c8e);fs[_0x11d0('0x2d')](_0x2a964f,_0x11d0('0x2e'));}catch(_0x46bdc5){logger[_0x11d0('0x1a')](_0x46bdc5);}logger[_0x11d0('0x17')](_0x11d0('0x4e'),_0x2a964f['split']('.')[0x0]);return _0x2a964f[_0x11d0('0x3e')]('.')[0x0];});};exports[_0x11d0('0x4f')]=function(_0x4403a0,_0x3f1985,_0x4e0ec9){return google[_0x11d0('0x50')](_0x4403a0,_0x3f1985,_0x4e0ec9)[_0x11d0('0x3a')](function(_0x23a9cf){logger[_0x11d0('0x17')](_0x23a9cf[_0x11d0('0x51')]);return rp(_0x23a9cf);})[_0x11d0('0x3a')](function(_0x44769e){var _0x17f692='';var _0x5da112=0x0;try{fs[_0x11d0('0x1b')](_0x4403a0);}catch(_0x1c9ac9){logger['error'](_0x1c9ac9);}if(_0x44769e&&_0x44769e[_0x11d0('0x52')]){_0x17f692=_0x44769e['results'][_0x11d0('0x53')](function(_0x403f16){return _0x403f16&&_0x403f16[_0x11d0('0x54')][0x0]&&_0x403f16[_0x11d0('0x54')][0x0][_0x11d0('0x55')]?_0x403f16['alternatives'][0x0][_0x11d0('0x55')]:'';})['join']('\x0a');_0x5da112=_0x44769e['results']['map'](function(_0x3cf777){return _0x3cf777&&_0x3cf777[_0x11d0('0x54')][0x0]&&_0x3cf777[_0x11d0('0x54')][0x0][_0x11d0('0x56')]?_0x3cf777[_0x11d0('0x54')][0x0][_0x11d0('0x56')]:0x0;})[_0x11d0('0x57')]('\x0a');}logger[_0x11d0('0x17')](_0x11d0('0x58'),_0x17f692);logger[_0x11d0('0x17')]('googleASR\x20confidence',_0x5da112);return{'transcript':_0x17f692,'confidence':_0x5da112};})[_0x11d0('0x59')](function(_0x34cb7d){logger[_0x11d0('0x1a')](_0x11d0('0x5a'),_0x34cb7d[_0x11d0('0x11')],_0x34cb7d[_0x11d0('0x5b')],_0x34cb7d[_0x11d0('0x5c')]);});};exports[_0x11d0('0x5d')]=function(_0x5092d6,_0x5c21b2,_0x55862c,_0x215067){var _0x144f78=apiai(_0x5c21b2,{'language':_0x215067||'en'});return _0x144f78[_0x11d0('0x5e')](_0x55862c,{'sessionId':md5(_0x5092d6)})[_0x11d0('0x3a')](function(_0xa0d7a8){logger[_0x11d0('0x17')](JSON['stringify'](_0xa0d7a8));return{'source':_0xa0d7a8[_0x11d0('0x5f')][_0x11d0('0x60')],'resolvedQuery':_0xa0d7a8[_0x11d0('0x5f')]['resolvedQuery'],'action':_0xa0d7a8[_0x11d0('0x5f')][_0x11d0('0x61')],'actionIncomplete':_0xa0d7a8[_0x11d0('0x5f')]['actionIncomplete'],'speech':_0xa0d7a8['result'][_0x11d0('0x62')]['speech'],'score':_0xa0d7a8[_0x11d0('0x5f')][_0x11d0('0x63')],'statusCode':_0xa0d7a8[_0x11d0('0x64')][_0x11d0('0x65')],'endConversation':_0xa0d7a8[_0x11d0('0x5f')]['metadata']['endConversation']||![],'isFallbackIntent':_0xa0d7a8[_0x11d0('0x5f')][_0x11d0('0x66')]['isFallbackIntent']};});};exports[_0x11d0('0x67')]=function(_0x3328ac,_0x444b81,_0xf48d4f,_0x329c0b,_0x2069c,_0x5db11d){var _0x30a9b7=_0x329c0b[_0x11d0('0x68')](/\\n/g,'\x0a');var _0x53342a={'credentials':{'private_key':_0x30a9b7,'client_email':_0xf48d4f}};var _0x41b3da=new dialogflow[(_0x11d0('0x69'))](_0x53342a);var _0x8db58e=_0x41b3da['sessionPath'](_0x444b81,md5(_0x3328ac));var _0x4c0e7f={'session':_0x8db58e,'queryInput':{'text':{'text':_0x2069c,'languageCode':_0x5db11d}}};return _0x41b3da[_0x11d0('0x6a')](_0x4c0e7f)[_0x11d0('0x3a')](function(_0x352dcf){if(_0x352dcf&&_0x352dcf[_0x11d0('0x4a')]){logger[_0x11d0('0x17')]('Dialogflow\x20V2\x20response:',JSON[_0x11d0('0x44')](_0x352dcf));var _0xc2ca2=_0x352dcf[0x0];if(_0xc2ca2){var _0x1dfaa4={'action':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x61')],'allRequiredParamsPresent':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x6c')],'endConversation':_0xc2ca2['queryResult'][_0x11d0('0x6d')]&&_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x6d')]['fields']?_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x6d')][_0x11d0('0x6e')][_0x11d0('0x6f')][_0x11d0('0x70')]:![],'fulfillmentText':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x71')],'intentName':_0xc2ca2[_0x11d0('0x6b')]['intent'][_0x11d0('0x5b')],'intentDisplayName':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x72')][_0x11d0('0x73')],'isFallbackIntent':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x72')][_0x11d0('0x74')],'languageCode':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x75')],'queryText':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x76')],'responseId':_0xc2ca2[_0x11d0('0x77')],'score':_0xc2ca2['queryResult'][_0x11d0('0x78')],'speech':_0xc2ca2[_0x11d0('0x6b')][_0x11d0('0x71')],'providerResponse':JSON[_0x11d0('0x44')](_0x352dcf)};return _0x1dfaa4;}}});};exports[_0x11d0('0x79')]=function(_0x5458b9,_0x5d09a7,_0x4c8e6c,_0x2806fd){return tilde[_0x11d0('0x50')](_0x5458b9,_0x5d09a7,_0x4c8e6c,_0x2806fd)[_0x11d0('0x3a')](function(_0x41740f){try{fs[_0x11d0('0x1b')](_0x5458b9);}catch(_0x53e8f8){logger[_0x11d0('0x1a')](_0x53e8f8);}logger[_0x11d0('0x17')](_0x11d0('0x7a'),_0x41740f[_0x11d0('0x55')]);logger[_0x11d0('0x17')](_0x11d0('0x7b'),_0x41740f[_0x11d0('0x56')]);return _0x41740f;});};exports[_0x11d0('0x7c')]=function(_0x428316,_0x3be896,_0x5f4561,_0x181db5,_0x210192,_0x48029f){var _0x163a1c=path[_0x11d0('0x27')](__dirname,_0x11d0('0x28'),rs[_0x11d0('0x29')](0x4)+_0x11d0('0x3b'));var _0x111a6d;return aws[_0x11d0('0x7d')](_0x428316,_0x3be896,_0x5f4561,_0x181db5,_0x210192,_0x48029f,_0x163a1c)['then'](function(){_0x111a6d=path[_0x11d0('0x27')](__dirname,_0x11d0('0x28'),rs['generate'](0x4)+_0x11d0('0x2a'));return convertFile(_0x163a1c,_0x111a6d);})[_0x11d0('0x3a')](function(){try{fs['unlink'](_0x163a1c);fs[_0x11d0('0x2d')](_0x111a6d,_0x11d0('0x2e'));}catch(_0x347d99){logger['error'](_0x347d99);}return _0x111a6d[_0x11d0('0x3e')]('.')[0x0];});};exports[_0x11d0('0x7e')]=function(_0x75c623,_0x43b4ea,_0x15ff55,_0x1bd8a4,_0xe270bf,_0x43ba60){return aws[_0x11d0('0x7f')](_0x75c623,_0x43b4ea,_0x15ff55,_0x1bd8a4,_0xe270bf,_0x43ba60)['then'](function(_0x2e0c09){logger[_0x11d0('0x17')](JSON[_0x11d0('0x44')](_0x2e0c09));return _0x2e0c09;});};exports[_0x11d0('0x80')]=function(_0x3fada5,_0x59e40a,_0x54f6d9,_0x441e29){var _0x105075=util[_0x11d0('0x81')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3fada5,encodeURIComponent(_0x59e40a),_0x54f6d9,_0x441e29);var _0x392feb=path['resolve'](__dirname,_0x11d0('0x28'),rs['generate'](0x4)+_0x11d0('0x3b'));var _0x56577b;return downloadFile(_0x105075,_0x392feb)['then'](function(){_0x56577b=path[_0x11d0('0x27')](__dirname,_0x11d0('0x28'),rs['generate'](0x4)+_0x11d0('0x2a'));return convertFile(_0x392feb,_0x56577b);})[_0x11d0('0x3a')](function(){try{fs[_0x11d0('0x1b')](_0x392feb);fs['chmodSync'](_0x56577b,_0x11d0('0x2e'));}catch(_0x4c0edf){logger[_0x11d0('0x1a')](_0x4c0edf);}return _0x56577b['split']('.')[0x0];});};exports[_0x11d0('0x82')]=function(_0x1d02ef,_0x466b96,_0x47acb9,_0x130197){var _0x3287ea=util[_0x11d0('0x81')](_0x11d0('0x83'),ISPEECH_API,_0x466b96,_0x47acb9,base64Encode(_0x1d02ef),_0x130197?util[_0x11d0('0x81')](_0x11d0('0x84'),encodeURIComponent(_0x130197)):_0x11d0('0x85'));return uploadFile(_0x3287ea)[_0x11d0('0x3a')](function(_0x1dd399){return querystring['parse'](_0x1dd399);});};exports[_0x11d0('0x86')]=function(_0x52bcaa,_0x142ef6){return sestek[_0x11d0('0x87')](_0x52bcaa,_0x142ef6)[_0x11d0('0x3a')](function(_0x2af561){logger[_0x11d0('0x17')](JSON[_0x11d0('0x44')](_0x2af561));var _0x335196={'speech':_0x2af561[_0x11d0('0x88')],'action':_0x2af561[_0x11d0('0x89')]?_0x2af561['channelData'][_0x11d0('0x8a')]:undefined,'actiondata':_0x2af561[_0x11d0('0x89')]?_0x2af561[_0x11d0('0x89')][_0x11d0('0x8b')]:undefined};if(_0x2af561[_0x11d0('0x89')]&&_0x2af561[_0x11d0('0x89')][_0x11d0('0x8c')]){return base64Decode(_0x2af561[_0x11d0('0x89')][_0x11d0('0x8c')]['Data'],path[_0x11d0('0x27')](__dirname,'tmp',rs[_0x11d0('0x29')](0x4)+_0x11d0('0x2a')))[_0x11d0('0x3a')](function(_0x23515e){_0x335196[_0x11d0('0x8d')]=_0x23515e;return _0x335196;});}return _0x335196;});};exports[_0x11d0('0x8e')]=function(){return __dirname;}; \ No newline at end of file +var _0x7e03=['wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','resolve','.mp3','from','audioContent','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','googleASR','asr','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','fulfillment','speech','score','endConversation','metadata','isFallbackIntent','googleDialogflowV2','Dialogflow\x20V2\x20response:','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','protocol','WHAT_EVER','data','transcode'];(function(_0x57195a,_0x10d8fa){var _0x40b99a=function(_0xa97ae2){while(--_0xa97ae2){_0x57195a['push'](_0x57195a['shift']());}};_0x40b99a(++_0x10d8fa);}(_0x7e03,0x167));var _0x37e0=function(_0x283141,_0x519e16){_0x283141=_0x283141-0x0;var _0x15c82b=_0x7e03[_0x283141];return _0x15c82b;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x37e0('0x0'));var dialogflow=require(_0x37e0('0x1'));var fs=require('fs');var http=require(_0x37e0('0x2'));var https=require(_0x37e0('0x3'));var md5=require(_0x37e0('0x4'));var path=require(_0x37e0('0x5'));var querystring=require(_0x37e0('0x6'));var rp=require(_0x37e0('0x7'));var rs=require('randomstring');var sox=require(_0x37e0('0x8'));var tts=require(_0x37e0('0x9'));var urlParse=require(_0x37e0('0xa'))[_0x37e0('0xb')];var util=require('util');var aws=require(_0x37e0('0xc'));var google=require('./google');var sestek=require(_0x37e0('0xd'));var tilde=require(_0x37e0('0xe'));var logger=require(_0x37e0('0xf'))(_0x37e0('0x10'));var ISPEECH_API=_0x37e0('0x11');function downloadFile(_0x144154,_0x23928f){return new BPromise(function(_0x1a3cee,_0x5e7fc0){var _0x540b33=urlParse(_0x144154);var _0x13bece=_0x540b33['protocol']===_0x37e0('0x12')?https:http;var _0x5321fb={'host':_0x540b33[_0x37e0('0x13')],'path':_0x540b33[_0x37e0('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x13bece[_0x37e0('0x14')](_0x5321fb,function(_0x34321f){if(_0x34321f[_0x37e0('0x15')]!==0xc8){logger[_0x37e0('0x16')](_0x37e0('0x17')+_0x144154+_0x37e0('0x18')+_0x34321f[_0x37e0('0x15')]+'\x20('+_0x34321f[_0x37e0('0x19')]+')');_0x5e7fc0(new Error(_0x37e0('0x17')+_0x144154+_0x37e0('0x18')+_0x34321f[_0x37e0('0x15')]+'\x20('+_0x34321f[_0x37e0('0x19')]+')'));return;}var _0x39c960=fs['createWriteStream'](_0x23928f);_0x39c960['on'](_0x37e0('0x1a'),function(){logger[_0x37e0('0x1b')](_0x37e0('0x1c'));_0x39c960[_0x37e0('0x1d')](_0x1a3cee);});_0x39c960['on'](_0x37e0('0x16'),function(_0x4d326d){fs['unlink'](_0x23928f);logger[_0x37e0('0x16')](_0x37e0('0x1e'),_0x4d326d);_0x5e7fc0(_0x4d326d);});_0x34321f[_0x37e0('0x1f')](_0x39c960);})['on'](_0x37e0('0x16'),function(_0x4ebcd4){logger['error'](_0x4ebcd4);_0x5e7fc0(_0x4ebcd4);})[_0x37e0('0x20')]();});}function uploadFile(_0x628d8c){return new BPromise(function(_0x2f3519,_0x4dae30){var _0x2d7cfa=urlParse(_0x628d8c);var _0x251ac7=_0x2d7cfa[_0x37e0('0x21')]===_0x37e0('0x12')?https:http;var _0x1001ab={'host':_0x2d7cfa[_0x37e0('0x13')],'path':_0x2d7cfa[_0x37e0('0x5')],'headers':{'user-agent':_0x37e0('0x22')}};_0x251ac7[_0x37e0('0x14')](_0x1001ab,function(_0x194cce){if(_0x194cce[_0x37e0('0x15')]!==0xc8){_0x4dae30(new Error('request\x20to\x20'+_0x628d8c+'\x20failed,\x20status\x20code\x20=\x20'+_0x194cce[_0x37e0('0x15')]+'\x20('+_0x194cce[_0x37e0('0x19')]+')'));return;}var _0x451d03='';_0x194cce['on'](_0x37e0('0x23'),function(_0x5091fc){_0x451d03+=_0x5091fc;});_0x194cce['on']('end',function(){_0x2f3519(_0x451d03);});})['on'](_0x37e0('0x16'),function(_0x15a97f){_0x4dae30(_0x15a97f);})[_0x37e0('0x20')]();});}function convertFile(_0x3f62e6,_0x5bbed5){return new BPromise(function(_0x45de23,_0x2a82db){var _0x1c4ef7=sox[_0x37e0('0x24')](_0x3f62e6,_0x5bbed5,{'sampleRate':0x1f40,'format':_0x37e0('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1c4ef7['on'](_0x37e0('0x16'),function(_0x40a680){logger['error'](_0x37e0('0x26'),_0x40a680);_0x2a82db(_0x40a680);});_0x1c4ef7['on'](_0x37e0('0x20'),function(){logger[_0x37e0('0x1b')](_0x37e0('0x27'));_0x45de23();});_0x1c4ef7[_0x37e0('0x28')]();});}function base64Decode(_0x357dec,_0xc886c3){var _0x3f7cee=path['resolve'](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+_0x37e0('0x2b'));fs[_0x37e0('0x2c')](_0x3f7cee,_0x357dec,_0x37e0('0x2d'));return convertFile(_0x3f7cee,_0xc886c3)[_0x37e0('0x2e')](function(){try{fs[_0x37e0('0x2f')](_0x3f7cee);fs[_0x37e0('0x30')](_0xc886c3,_0x37e0('0x31'));}catch(_0x43fa24){logger[_0x37e0('0x16')](_0x43fa24);}return _0xc886c3[_0x37e0('0x32')]('.')[0x0];});}function base64Encode(_0x274640){var _0x4385b8=fs['readFileSync'](_0x274640);return new Buffer(_0x4385b8)[_0x37e0('0x33')]('base64');}exports[_0x37e0('0x34')]=function(_0x1febe5,_0xf8ddeb,_0x1a8556,_0x5696ae,_0x4f66f0,_0x2ebd39){var _0x532fd9,_0x57fd7f;var _0x2e4610=_0x37e0('0x35');var _0x5f2e4d=_0x37e0('0x36')+_0x1febe5;var _0x520a22={};if(_0xf8ddeb===_0x37e0('0x37')){_0x520a22[_0x37e0('0x38')]={'ssml':_0x1a8556};}else{_0x520a22[_0x37e0('0x38')]={'text':_0x1a8556};};_0x520a22[_0x37e0('0x39')]={'languageCode':_0x5696ae,'ssmlGender':_0x4f66f0};_0x520a22['audioConfig']={'audioEncoding':_0x37e0('0x3a'),'sampleRateHertz':0x1f40};var _0x170b4f={'url':_0x2e4610+_0x37e0('0x3b')+_0x5f2e4d,'method':'POST','json':!![],'body':_0x520a22};return rp(_0x170b4f)['then'](function(_0x145ea8){return new BPromise(function(_0x358cf7,_0x5099f0){_0x532fd9=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs['generate'](0x4)+_0x37e0('0x3d'));var _0x2d764e=Buffer[_0x37e0('0x3e')](_0x145ea8[_0x37e0('0x3f')],_0x37e0('0x2d'));return fs['writeFile'](_0x532fd9,_0x2d764e,function(_0x41bbdd){_0x5099f0(_0x41bbdd);},function(_0x30d1b5){fs[_0x37e0('0x30')](_0x532fd9,_0x37e0('0x31'));_0x358cf7(_0x30d1b5);});});})[_0x37e0('0x2e')](function(_0x22f2a4){_0x57fd7f=path[_0x37e0('0x3c')](__dirname,'tmp',rs['generate'](0x4)+_0x37e0('0x2b'));return convertFile(_0x532fd9,_0x57fd7f);})[_0x37e0('0x2e')](function(){try{fs[_0x37e0('0x2f')](_0x532fd9);fs[_0x37e0('0x30')](_0x57fd7f,'777');}catch(_0x1d825c){logger[_0x37e0('0x16')](_0x1d825c);}logger[_0x37e0('0x1b')](_0x37e0('0x40'),_0x57fd7f['split']('.')[0x0]);return _0x57fd7f[_0x37e0('0x32')]('.')[0x0];});};exports['googleTTS']=function(_0xee9917,_0x20799c){var _0x5ad0c3=_0x37e0('0x41');var _0x4cc4e2,_0x3afa24;var _0x5a9c65;var _0x3d5a83={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x5ad0c3,'headers':{'Content-Type':_0x37e0('0x42')},'body':_0x37e0('0x43')+encodeURIComponent(JSON[_0x37e0('0x44')]([[[_0x37e0('0x45'),JSON[_0x37e0('0x44')]([_0xee9917,_0x20799c||'en',![],_0x37e0('0x46')]),null,'generic']]]))};return rp(_0x3d5a83)[_0x37e0('0x2e')](function(_0x1d37d8){try{_0x5a9c65=eval(_0x1d37d8[_0x37e0('0x47')](0x5))[0x0][0x2];}catch(_0x5123b8){throw new Error(_0x37e0('0x48')+_0x1d37d8[_0x37e0('0x23')]);}if(!_0x5a9c65){if(_0xee9917[_0x37e0('0x49')]>0xc8){throw new Error(_0x37e0('0x4a'));}else{throw new Error('lang\x20\x22'+_0x20799c+'\x22\x20might\x20not\x20exist');}}try{_0x5a9c65=eval(_0x5a9c65)[0x0];}catch(_0x1b8497){throw new Error(_0x37e0('0x48')+res[_0x37e0('0x23')]);}const _0x29bd90=_0x5a9c65;_0x4cc4e2=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs['generate'](0x4)+_0x37e0('0x3d'));fs[_0x37e0('0x2c')](_0x4cc4e2,_0x5a9c65,{'encoding':_0x37e0('0x2d')});_0x3afa24=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+_0x37e0('0x2b'));return convertFile(_0x4cc4e2,_0x3afa24);})['then'](function(){try{fs[_0x37e0('0x2f')](_0x4cc4e2);fs[_0x37e0('0x30')](_0x3afa24,_0x37e0('0x31'));}catch(_0x244de8){logger[_0x37e0('0x16')](_0x244de8);}logger[_0x37e0('0x1b')]('goggleTTS\x20path',_0x3afa24['split']('.')[0x0]);return _0x3afa24[_0x37e0('0x32')]('.')[0x0];});};exports[_0x37e0('0x4b')]=function(_0x3c13d4,_0x55aba7,_0x18b485){return google[_0x37e0('0x4c')](_0x3c13d4,_0x55aba7,_0x18b485)[_0x37e0('0x2e')](function(_0x2cb9bd){logger[_0x37e0('0x1b')](_0x2cb9bd['uri']);return rp(_0x2cb9bd);})[_0x37e0('0x2e')](function(_0x47c173){var _0x12bbfa='';var _0x58794d=0x0;try{fs['unlink'](_0x3c13d4);}catch(_0x3ae924){logger['error'](_0x3ae924);}if(_0x47c173&&_0x47c173[_0x37e0('0x4d')]){_0x12bbfa=_0x47c173[_0x37e0('0x4d')][_0x37e0('0x4e')](function(_0x3e8ac9){return _0x3e8ac9&&_0x3e8ac9['alternatives'][0x0]&&_0x3e8ac9[_0x37e0('0x4f')][0x0]['transcript']?_0x3e8ac9[_0x37e0('0x4f')][0x0][_0x37e0('0x50')]:'';})[_0x37e0('0x51')]('\x0a');_0x58794d=_0x47c173['results'][_0x37e0('0x4e')](function(_0x78414e){return _0x78414e&&_0x78414e[_0x37e0('0x4f')][0x0]&&_0x78414e[_0x37e0('0x4f')][0x0]['confidence']?_0x78414e[_0x37e0('0x4f')][0x0]['confidence']:0x0;})[_0x37e0('0x51')]('\x0a');}logger[_0x37e0('0x1b')](_0x37e0('0x52'),_0x12bbfa);logger[_0x37e0('0x1b')](_0x37e0('0x53'),_0x58794d);return{'transcript':_0x12bbfa,'confidence':_0x58794d};})[_0x37e0('0x54')](function(_0x373732){logger[_0x37e0('0x16')](_0x37e0('0x55'),_0x373732[_0x37e0('0x15')],_0x373732[_0x37e0('0x56')],_0x373732[_0x37e0('0x57')]);});};exports[_0x37e0('0x58')]=function(_0x43f737,_0x46841b,_0x664db7,_0x54240a){var _0x11166d=apiai(_0x46841b,{'language':_0x54240a||'en'});return _0x11166d['textRequest'](_0x664db7,{'sessionId':md5(_0x43f737)})[_0x37e0('0x2e')](function(_0x2f5d33){logger[_0x37e0('0x1b')](JSON[_0x37e0('0x44')](_0x2f5d33));return{'source':_0x2f5d33[_0x37e0('0x59')][_0x37e0('0x5a')],'resolvedQuery':_0x2f5d33[_0x37e0('0x59')]['resolvedQuery'],'action':_0x2f5d33[_0x37e0('0x59')]['action'],'actionIncomplete':_0x2f5d33[_0x37e0('0x59')]['actionIncomplete'],'speech':_0x2f5d33[_0x37e0('0x59')][_0x37e0('0x5b')][_0x37e0('0x5c')],'score':_0x2f5d33[_0x37e0('0x59')][_0x37e0('0x5d')],'statusCode':_0x2f5d33['status']['code'],'endConversation':_0x2f5d33['result']['metadata'][_0x37e0('0x5e')]||![],'isFallbackIntent':_0x2f5d33[_0x37e0('0x59')][_0x37e0('0x5f')][_0x37e0('0x60')]};});};exports[_0x37e0('0x61')]=function(_0x3528a0,_0x43a799,_0x698488,_0x216ee2,_0x446341,_0x2c8897){var _0x2550f0=_0x216ee2['replace'](/\\n/g,'\x0a');var _0x4391d8={'credentials':{'private_key':_0x2550f0,'client_email':_0x698488}};var _0x4d35f9=new dialogflow['SessionsClient'](_0x4391d8);var _0x308ad5=_0x4d35f9['sessionPath'](_0x43a799,md5(_0x3528a0));var _0x6c93c={'session':_0x308ad5,'queryInput':{'text':{'text':_0x446341,'languageCode':_0x2c8897}}};return _0x4d35f9['detectIntent'](_0x6c93c)[_0x37e0('0x2e')](function(_0x139b3e){if(_0x139b3e&&_0x139b3e['length']){logger[_0x37e0('0x1b')](_0x37e0('0x62'),JSON[_0x37e0('0x44')](_0x139b3e));var _0x486016=_0x139b3e[0x0];if(_0x486016){var _0x550896={'action':_0x486016['queryResult'][_0x37e0('0x63')],'allRequiredParamsPresent':_0x486016[_0x37e0('0x64')][_0x37e0('0x65')],'endConversation':_0x486016[_0x37e0('0x64')][_0x37e0('0x66')]&&_0x486016[_0x37e0('0x64')][_0x37e0('0x66')][_0x37e0('0x67')]?_0x486016[_0x37e0('0x64')][_0x37e0('0x66')][_0x37e0('0x67')]['end_conversation'][_0x37e0('0x68')]:![],'fulfillmentText':_0x486016['queryResult'][_0x37e0('0x69')],'intentName':_0x486016['queryResult'][_0x37e0('0x6a')][_0x37e0('0x56')],'intentDisplayName':_0x486016[_0x37e0('0x64')][_0x37e0('0x6a')][_0x37e0('0x6b')],'isFallbackIntent':_0x486016[_0x37e0('0x64')][_0x37e0('0x6a')]['isFallback'],'languageCode':_0x486016[_0x37e0('0x64')][_0x37e0('0x6c')],'queryText':_0x486016[_0x37e0('0x64')]['queryText'],'responseId':_0x486016[_0x37e0('0x6d')],'score':_0x486016[_0x37e0('0x64')][_0x37e0('0x6e')],'speech':_0x486016[_0x37e0('0x64')][_0x37e0('0x69')],'providerResponse':JSON[_0x37e0('0x44')](_0x139b3e)};return _0x550896;}}});};exports[_0x37e0('0x6f')]=function(_0x4c2e75,_0x37901b,_0x17fa13,_0x23d3fb){return tilde[_0x37e0('0x4c')](_0x4c2e75,_0x37901b,_0x17fa13,_0x23d3fb)[_0x37e0('0x2e')](function(_0x2b5ee9){try{fs[_0x37e0('0x2f')](_0x4c2e75);}catch(_0x23639e){logger[_0x37e0('0x16')](_0x23639e);}logger[_0x37e0('0x1b')](_0x37e0('0x70'),_0x2b5ee9[_0x37e0('0x50')]);logger[_0x37e0('0x1b')](_0x37e0('0x71'),_0x2b5ee9['confidence']);return _0x2b5ee9;});};exports[_0x37e0('0x72')]=function(_0x1fe339,_0x460c8e,_0xf36170,_0x2edcc4,_0x5027c5,_0x555bff){var _0x89c68=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+'.mp3');var _0x30e0b0;return aws[_0x37e0('0x73')](_0x1fe339,_0x460c8e,_0xf36170,_0x2edcc4,_0x5027c5,_0x555bff,_0x89c68)[_0x37e0('0x2e')](function(){_0x30e0b0=path['resolve'](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+_0x37e0('0x2b'));return convertFile(_0x89c68,_0x30e0b0);})['then'](function(){try{fs[_0x37e0('0x2f')](_0x89c68);fs[_0x37e0('0x30')](_0x30e0b0,_0x37e0('0x31'));}catch(_0x18bbe3){logger['error'](_0x18bbe3);}return _0x30e0b0[_0x37e0('0x32')]('.')[0x0];});};exports[_0x37e0('0x74')]=function(_0x5bbbc2,_0x3554e3,_0x345290,_0x1124bd,_0x3ac658,_0x3d197c){return aws[_0x37e0('0x75')](_0x5bbbc2,_0x3554e3,_0x345290,_0x1124bd,_0x3ac658,_0x3d197c)[_0x37e0('0x2e')](function(_0x3415d0){logger[_0x37e0('0x1b')](JSON[_0x37e0('0x44')](_0x3415d0));return _0x3415d0;});};exports[_0x37e0('0x76')]=function(_0x4991bf,_0x51d551,_0x25a729,_0x1482bc){var _0x1486aa=util[_0x37e0('0x77')](_0x37e0('0x78'),ISPEECH_API,_0x4991bf,encodeURIComponent(_0x51d551),_0x25a729,_0x1482bc);var _0x29fc35=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs['generate'](0x4)+_0x37e0('0x3d'));var _0x569e51;return downloadFile(_0x1486aa,_0x29fc35)['then'](function(){_0x569e51=path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+_0x37e0('0x2b'));return convertFile(_0x29fc35,_0x569e51);})[_0x37e0('0x2e')](function(){try{fs['unlink'](_0x29fc35);fs[_0x37e0('0x30')](_0x569e51,'777');}catch(_0x164714){logger[_0x37e0('0x16')](_0x164714);}return _0x569e51['split']('.')[0x0];});};exports[_0x37e0('0x79')]=function(_0x22bbca,_0x2a978b,_0x20fd59,_0x4c6ed0){var _0x32bf21=util[_0x37e0('0x77')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2a978b,_0x20fd59,base64Encode(_0x22bbca),_0x4c6ed0?util['format']('model=%s',encodeURIComponent(_0x4c6ed0)):_0x37e0('0x7a'));return uploadFile(_0x32bf21)[_0x37e0('0x2e')](function(_0x2c1bb1){return querystring[_0x37e0('0xb')](_0x2c1bb1);});};exports[_0x37e0('0x7b')]=function(_0x409b15,_0x23addf){return sestek[_0x37e0('0x7c')](_0x409b15,_0x23addf)['then'](function(_0x195f6b){logger['info'](JSON[_0x37e0('0x44')](_0x195f6b));var _0x133646={'speech':_0x195f6b[_0x37e0('0x7d')],'action':_0x195f6b['channelData']?_0x195f6b[_0x37e0('0x7e')]['CustomAction']:undefined,'actiondata':_0x195f6b['channelData']?_0x195f6b[_0x37e0('0x7e')][_0x37e0('0x7f')]:undefined};if(_0x195f6b[_0x37e0('0x7e')]&&_0x195f6b['channelData'][_0x37e0('0x80')]){return base64Decode(_0x195f6b[_0x37e0('0x7e')][_0x37e0('0x80')][_0x37e0('0x81')],path[_0x37e0('0x3c')](__dirname,_0x37e0('0x29'),rs[_0x37e0('0x2a')](0x4)+_0x37e0('0x2b')))[_0x37e0('0x2e')](function(_0x423d99){_0x133646[_0x37e0('0x82')]=_0x423d99;return _0x133646;});}return _0x133646;});};exports[_0x37e0('0x83')]=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 cb29304..a213702 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 _0x50dd=['./nda'];(function(_0x19d25a,_0xdcd6c8){var _0x49292a=function(_0x2616ea){while(--_0x2616ea){_0x19d25a['push'](_0x19d25a['shift']());}};_0x49292a(++_0xdcd6c8);}(_0x50dd,0xcb));var _0xd50d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50dd[_0x321bb2];return _0x9c12ed;};var nda=require(_0xd50d('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x8618=['exports','./nda'];(function(_0x35d1b5,_0x1e0898){var _0x207e4b=function(_0x1d5a59){while(--_0x1d5a59){_0x35d1b5['push'](_0x35d1b5['shift']());}};_0x207e4b(++_0x1e0898);}(_0x8618,0x145));var _0x8861=function(_0x5d4f70,_0x56bf10){_0x5d4f70=_0x5d4f70-0x0;var _0x448d54=_0x8618[_0x5d4f70];return _0x448d54;};var nda=require(_0x8861('0x0'));module[_0x8861('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f6023a4..212aedf 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 _0x2356=['dnid','extension','Bearer\x20','access_token','project','body','ProjectName','AudioOutputSettings','audio/wav','channelData','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','url','../../../../../config/logger','resolve','password','username','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x2356,0x14f));var _0x6235=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0x2356[_0x1f62c3];return _0x385c1c;};'use strict';var rp=require('request-promise');var url=require(_0x6235('0x0'));var logger=require(_0x6235('0x1'))('agi');module['exports']=function(_0x18ce63,_0x32930d){var _0x5c536f={'method':'POST','uri':url[_0x6235('0x2')](_0x32930d['ndauth_url'],'/token'),'form':{'grant_type':_0x6235('0x3'),'username':_0x32930d[_0x6235('0x4')],'password':_0x32930d[_0x6235('0x3')]},'json':!![]};return rp(_0x5c536f)['then'](function(_0x4c15c6){var _0x547159={'method':_0x6235('0x5'),'uri':url['resolve'](_0x32930d[_0x6235('0x6')],_0x6235('0x7')),'body':{'type':_0x32930d[_0x6235('0x8')]||_0x6235('0x9'),'channelId':'Nda','conversation':{'id':_0x18ce63[_0x6235('0xa')]},'from':{'id':_0x18ce63[_0x6235('0xb')],'name':_0x18ce63[_0x6235('0xc')]},'recipient':{'id':_0x18ce63[_0x6235('0xd')],'name':_0x18ce63[_0x6235('0xe')]},'text':_0x32930d['text'],'channelData':{}},'headers':{'Authorization':_0x6235('0xf')+_0x4c15c6[_0x6235('0x10')]},'json':!![]};if(_0x32930d[_0x6235('0x11')]){_0x547159[_0x6235('0x12')]['channelData'][_0x6235('0x13')]=_0x32930d[_0x6235('0x11')];}if(_0x32930d['ndagenerate_audio']=='1'){_0x547159[_0x6235('0x12')]['channelData'][_0x6235('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6235('0x15')};}if(_0x32930d['custom_action']){_0x547159[_0x6235('0x12')][_0x6235('0x16')][_0x6235('0x17')]=_0x32930d[_0x6235('0x18')];if(_0x32930d['custom_action_data']){_0x547159[_0x6235('0x12')][_0x6235('0x16')][_0x6235('0x19')]=_0x32930d[_0x6235('0x1a')];}}logger[_0x6235('0x1b')](JSON[_0x6235('0x1c')](_0x547159));return rp(_0x547159);});}; \ No newline at end of file +var _0xda3f=['uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','body','ProjectName','project','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','channelData','CustomActionData','info','stringify','url','../../../../../config/logger','POST','resolve','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xda3f,0xec));var _0xfda3=function(_0x51ab1c,_0x222654){_0x51ab1c=_0x51ab1c-0x0;var _0x49aff6=_0xda3f[_0x51ab1c];return _0x49aff6;};'use strict';var rp=require('request-promise');var url=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('agi');module['exports']=function(_0x5d7071,_0x3859fe){var _0x581693={'method':_0xfda3('0x2'),'uri':url[_0xfda3('0x3')](_0x3859fe['ndauth_url'],_0xfda3('0x4')),'form':{'grant_type':_0xfda3('0x5'),'username':_0x3859fe['username'],'password':_0x3859fe['password']},'json':!![]};return rp(_0x581693)[_0xfda3('0x6')](function(_0x42476a){var _0x125e2a={'method':_0xfda3('0x2'),'uri':url[_0xfda3('0x3')](_0x3859fe[_0xfda3('0x7')],_0xfda3('0x8')),'body':{'type':_0x3859fe[_0xfda3('0x9')]||_0xfda3('0xa'),'channelId':_0xfda3('0xb'),'conversation':{'id':_0x5d7071[_0xfda3('0xc')]},'from':{'id':_0x5d7071[_0xfda3('0xd')],'name':_0x5d7071['calleridname']},'recipient':{'id':_0x5d7071[_0xfda3('0xe')],'name':_0x5d7071[_0xfda3('0xf')]},'text':_0x3859fe[_0xfda3('0x10')],'channelData':{}},'headers':{'Authorization':_0xfda3('0x11')+_0x42476a[_0xfda3('0x12')]},'json':!![]};if(_0x3859fe['project']){_0x125e2a[_0xfda3('0x13')]['channelData'][_0xfda3('0x14')]=_0x3859fe[_0xfda3('0x15')];}if(_0x3859fe['ndagenerate_audio']=='1'){_0x125e2a['body']['channelData'][_0xfda3('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfda3('0x17')};}if(_0x3859fe['custom_action']){_0x125e2a['body']['channelData'][_0xfda3('0x18')]=_0x3859fe[_0xfda3('0x19')];if(_0x3859fe[_0xfda3('0x1a')]){_0x125e2a[_0xfda3('0x13')][_0xfda3('0x1b')][_0xfda3('0x1c')]=_0x3859fe[_0xfda3('0x1a')];}}logger[_0xfda3('0x1d')](JSON[_0xfda3('0x1e')](_0x125e2a));return rp(_0x125e2a);});}; \ 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 8319b09..898baae 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2178=['./lib/api','exports'];(function(_0x44935e,_0x3deb6c){var _0x3016a4=function(_0x501a37){while(--_0x501a37){_0x44935e['push'](_0x44935e['shift']());}};_0x3016a4(++_0x3deb6c);}(_0x2178,0x9e));var _0x8217=function(_0x5a5276,_0x262d69){_0x5a5276=_0x5a5276-0x0;var _0x3e8ee2=_0x2178[_0x5a5276];return _0x3e8ee2;};'use strict';var asr=require(_0x8217('0x0'));module[_0x8217('0x1')]=function(_0x28055e,_0x454c9e,_0x112a86,_0x5bd632){return asr(_0x28055e,_0x454c9e,_0x112a86,_0x5bd632);}; \ No newline at end of file +var _0x1d5b=['./lib/api'];(function(_0x33a7b8,_0x3ba015){var _0x30106b=function(_0x56afdc){while(--_0x56afdc){_0x33a7b8['push'](_0x33a7b8['shift']());}};_0x30106b(++_0x3ba015);}(_0x1d5b,0x11d));var _0xb1d5=function(_0x20a912,_0x26a1b5){_0x20a912=_0x20a912-0x0;var _0x279590=_0x1d5b[_0x20a912];return _0x279590;};'use strict';var asr=require(_0xb1d5('0x0'));module['exports']=function(_0x10eff2,_0x332556,_0x554955,_0x11aade){return asr(_0x10eff2,_0x332556,_0x554955,_0x11aade);}; \ 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 b75dbb4..dd52a8c 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 _0x607d=['lodash','moment','crypto','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','hex','send','createReadStream','EOS','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','isObject','message','close','bluebird'];(function(_0x19f406,_0x3fdf4b){var _0xdc3b08=function(_0x173bc8){while(--_0x173bc8){_0x19f406['push'](_0x19f406['shift']());}};_0xdc3b08(++_0x3fdf4b);}(_0x607d,0xa9));var _0xd607=function(_0x593aa7,_0x1fca05){_0x593aa7=_0x593aa7-0x0;var _0x57527b=_0x607d[_0x593aa7];return _0x57527b;};'use strict';var BPromise=require(_0xd607('0x0'));var _=require(_0xd607('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xd607('0x2'));var crypto=require(_0xd607('0x3'));var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x4d780f,_0x5881c5,_0x3ea00d,_0x9c9c01){return new BPromise(function(_0x781fa7,_0x4adc75){logger[_0xd607('0x4')](_0xd607('0x5'),_0x9c9c01||_0xd607('0x6'));var _0x2a03d7=new WebSocket(_0x9c9c01||_0xd607('0x6'),{'perMessageDeflate':![]});var _0x3ff2b8='';var _0x2ac612='0';var _0x120830='1';var _0x55e6b7=_0xd607('0x7');function _0xd52710(_0x39441a){var _0x3c3712=crypto[_0xd607('0x8')](_0xd607('0x9'));_0x3c3712[_0xd607('0xa')](_0x39441a);return _0x3c3712['digest'](_0xd607('0xb'));}function _0x3edffe(){try{logger[_0xd607('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x576f1e=moment()['unix']();var _0x49c0a9=_0xd52710(_0x576f1e+_0x5881c5+_0x3ea00d);_0x2a03d7[_0xd607('0xc')](JSON['stringify']({'appID':_0x5881c5,'timestamp':_0x576f1e,'appKey':_0x49c0a9}));var _0x4b4f7c=fs[_0xd607('0xd')](_0x4d780f);_0x4b4f7c['on']('data',function(_0x34873e){_0x2a03d7[_0xd607('0xc')](_0x34873e);});_0x4b4f7c['on']('close',function(){_0x2a03d7[_0xd607('0xc')](_0xd607('0xe'));});}catch(_0x11ad27){logger['error'](_0xd607('0xf'),JSON['stringify'](_0x11ad27));_0x2a03d7['terminate']();}}function _0x4e5c46(_0x271322){try{if(_0x271322){var _0x4d337f=JSON['parse'](_0x271322);switch(_0x4d337f[_0xd607('0x10')]){case 0x0:if(_0x4d337f[_0xd607('0x11')]){if(_0x4d337f[_0xd607('0x11')][_0xd607('0x12')]){logger[_0xd607('0x4')](_0xd607('0x13'),JSON[_0xd607('0x14')](_0x4d337f[_0xd607('0x11')][_0xd607('0x15')]));_0x3ff2b8=_0x4d337f[_0xd607('0x11')][_0xd607('0x15')][0x0]['transcript'];_0x2ac612=_0x4d337f[_0xd607('0x11')][_0xd607('0x15')][0x0][_0xd607('0x16')];_0x120830='0';_0x55e6b7=_0xd607('0x17');_0x2a03d7[_0xd607('0x18')]();}}break;case 0x1:logger[_0xd607('0x4')](_0xd607('0x7'));_0x120830='1';_0x55e6b7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xd607('0x4')](_0xd607('0x19'));_0x120830='2';_0x55e6b7='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xd607('0x4')](_0xd607('0x1a'));_0x120830='9';_0x55e6b7=_0xd607('0x1a');break;case 0xa:logger[_0xd607('0x4')](_0xd607('0x1b'));_0x120830='10';_0x55e6b7=_0xd607('0x1b');break;case 0xb:logger[_0xd607('0x4')](_0xd607('0x1c'));_0x120830='11';_0x55e6b7=_0xd607('0x1c');}}}catch(_0x2f99a4){logger[_0xd607('0x1d')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x2f99a4));_0x2a03d7[_0xd607('0x18')]();}}function _0x89d85e(){logger['info'](_0xd607('0x1e'));_0x781fa7({'transcript':_0x3ff2b8,'confidence':_0x2ac612,'status':_0x120830,'status_message':_0x55e6b7});}function _0x57ca9b(_0x5239e4){logger[_0xd607('0x1d')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x5239e4)){logger[_0xd607('0x1d')](_[_0xd607('0x1f')](_0x5239e4)?JSON['stringify'](_0x5239e4):_0x5239e4);}}_0x2a03d7['on']('open',_0x3edffe);_0x2a03d7['on'](_0xd607('0x20'),_0x4e5c46);_0x2a03d7['on'](_0xd607('0x21'),_0x89d85e);_0x2a03d7['on'](_0xd607('0x1d'),_0x57ca9b);});}; \ No newline at end of file +var _0xf1d2=['Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','EOS','error','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex'];(function(_0x51ddfe,_0x17ed4c){var _0x5abbf2=function(_0x4f196f){while(--_0x4f196f){_0x51ddfe['push'](_0x51ddfe['shift']());}};_0x5abbf2(++_0x17ed4c);}(_0xf1d2,0xaf));var _0x2f1d=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0xf1d2[_0x3b9d5f];return _0x39924e;};'use strict';var BPromise=require(_0x2f1d('0x0'));var _=require(_0x2f1d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2f1d('0x2'));var crypto=require(_0x2f1d('0x3'));var logger=require(_0x2f1d('0x4'))(_0x2f1d('0x5'));module[_0x2f1d('0x6')]=function(_0x5ed8b6,_0x52552c,_0x5af275,_0x216411){return new BPromise(function(_0x1607b1,_0x58cec6){logger[_0x2f1d('0x7')](_0x2f1d('0x8'),_0x216411||_0x2f1d('0x9'));var _0x16c2fa=new WebSocket(_0x216411||_0x2f1d('0x9'),{'perMessageDeflate':![]});var _0x7b526a='';var _0x34163c='0';var _0x499fcf='1';var _0x5cbed8=_0x2f1d('0xa');function _0x1c65c6(_0x209cec){var _0xde2ba=crypto[_0x2f1d('0xb')](_0x2f1d('0xc'));_0xde2ba['update'](_0x209cec);return _0xde2ba[_0x2f1d('0xd')](_0x2f1d('0xe'));}function _0x4bed32(){try{logger['info'](_0x2f1d('0xf'));var _0x42943d=moment()[_0x2f1d('0x10')]();var _0x2d5e52=_0x1c65c6(_0x42943d+_0x52552c+_0x5af275);_0x16c2fa[_0x2f1d('0x11')](JSON[_0x2f1d('0x12')]({'appID':_0x52552c,'timestamp':_0x42943d,'appKey':_0x2d5e52}));var _0x47322c=fs[_0x2f1d('0x13')](_0x5ed8b6);_0x47322c['on']('data',function(_0xb0782e){_0x16c2fa[_0x2f1d('0x11')](_0xb0782e);});_0x47322c['on']('close',function(){_0x16c2fa['send'](_0x2f1d('0x14'));});}catch(_0x156e37){logger[_0x2f1d('0x15')]('Tilde\x20ASR\x20send\x20error',JSON[_0x2f1d('0x12')](_0x156e37));_0x16c2fa[_0x2f1d('0x16')]();}}function _0xfb5b84(_0x102f8d){try{if(_0x102f8d){var _0x38d398=JSON['parse'](_0x102f8d);switch(_0x38d398['status']){case 0x0:if(_0x38d398[_0x2f1d('0x17')]){if(_0x38d398[_0x2f1d('0x17')][_0x2f1d('0x18')]){logger[_0x2f1d('0x7')](_0x2f1d('0x19'),JSON[_0x2f1d('0x12')](_0x38d398[_0x2f1d('0x17')][_0x2f1d('0x1a')]));_0x7b526a=_0x38d398[_0x2f1d('0x17')][_0x2f1d('0x1a')][0x0][_0x2f1d('0x1b')];_0x34163c=_0x38d398[_0x2f1d('0x17')][_0x2f1d('0x1a')][0x0]['likelihood'];_0x499fcf='0';_0x5cbed8=_0x2f1d('0x1c');_0x16c2fa['terminate']();}}break;case 0x1:logger['info'](_0x2f1d('0xa'));_0x499fcf='1';_0x5cbed8=_0x2f1d('0xa');break;case 0x2:logger['info'](_0x2f1d('0x1d'));_0x499fcf='2';_0x5cbed8='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2f1d('0x7')](_0x2f1d('0x1e'));_0x499fcf='9';_0x5cbed8=_0x2f1d('0x1e');break;case 0xa:logger[_0x2f1d('0x7')]('Authentication\x20failed.');_0x499fcf='10';_0x5cbed8='Authentication\x20failed.';break;case 0xb:logger[_0x2f1d('0x7')](_0x2f1d('0x1f'));_0x499fcf='11';_0x5cbed8=_0x2f1d('0x1f');}}}catch(_0x1937aa){logger[_0x2f1d('0x15')](_0x2f1d('0x20'),JSON[_0x2f1d('0x12')](_0x1937aa));_0x16c2fa[_0x2f1d('0x16')]();}}function _0x10236d(){logger[_0x2f1d('0x7')](_0x2f1d('0x21'));_0x1607b1({'transcript':_0x7b526a,'confidence':_0x34163c,'status':_0x499fcf,'status_message':_0x5cbed8});}function _0x48fbd1(_0x29da6e){logger[_0x2f1d('0x15')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x2f1d('0x22')](_0x29da6e)){logger['error'](_[_0x2f1d('0x23')](_0x29da6e)?JSON['stringify'](_0x29da6e):_0x29da6e);}}_0x16c2fa['on']('open',_0x4bed32);_0x16c2fa['on'](_0x2f1d('0x24'),_0xfb5b84);_0x16c2fa['on'](_0x2f1d('0x25'),_0x10236d);_0x16c2fa['on'](_0x2f1d('0x15'),_0x48fbd1);});}; \ 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 fe8474f..b91ebe9 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 _0xab45=['exports','./asr'];(function(_0x48bae4,_0x3502fe){var _0x210760=function(_0x3b273e){while(--_0x3b273e){_0x48bae4['push'](_0x48bae4['shift']());}};_0x210760(++_0x3502fe);}(_0xab45,0xbb));var _0x5ab4=function(_0x5da5bc,_0x1f422c){_0x5da5bc=_0x5da5bc-0x0;var _0x5ae2a8=_0xab45[_0x5da5bc];return _0x5ae2a8;};var asr=require(_0x5ab4('0x0'));module[_0x5ab4('0x1')]={'asr':asr}; \ No newline at end of file +var _0x5090=['exports','./asr'];(function(_0x4a95f8,_0x2c65be){var _0x3cde40=function(_0x14808a){while(--_0x14808a){_0x4a95f8['push'](_0x4a95f8['shift']());}};_0x3cde40(++_0x2c65be);}(_0x5090,0x105));var _0x0509=function(_0x5af0e1,_0x224661){_0x5af0e1=_0x5af0e1-0x0;var _0x48884f=_0x5090[_0x5af0e1];return _0x48884f;};var asr=require(_0x0509('0x0'));module[_0x0509('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index bcc76a2..df25fe1 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 _0xb6b1=['error','createServer','listen','listening','emit','data','parse','projectUpdate','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','events','./error','./channel','127.0.0.1'];(function(_0x5b552d,_0x3c7147){var _0x1ee59b=function(_0x4e771d){while(--_0x4e771d){_0x5b552d['push'](_0x5b552d['shift']());}};_0x1ee59b(++_0x3c7147);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xb6b1[_0x402c8f];return _0x11e809;};'use strict';var util=require(_0x1b6b('0x0'));var net=require('net');var EventEmitter=require(_0x1b6b('0x1'))['EventEmitter'];var AGIError=require(_0x1b6b('0x2'));var AGIChannel=require(_0x1b6b('0x3'));var AGIServer=function(_0x59b931,_0x3f12e2,_0x5100e5){var _0x2a2c45=this;var _0xb1a61e=null;var _0x2c4040=0x0;if(!_0x59b931)_0x59b931=0x11dd;if(!_0x3f12e2)_0x3f12e2=_0x1b6b('0x4');EventEmitter['call'](_0x2a2c45);function _0x41d09e(){if(!_0x59b931){_0x2a2c45['emit'](_0x1b6b('0x5'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0xb1a61e=net[_0x1b6b('0x6')]();_0xb1a61e[_0x1b6b('0x7')](_0x59b931,_0x3f12e2);_0xb1a61e['on'](_0x1b6b('0x8'),function(){_0x2a2c45[_0x1b6b('0x9')]('listening');});_0xb1a61e['on']('connection',function(_0x475423){_0x475423['on'](_0x1b6b('0xa'),function(_0x3c622d){try{var _0x350d57=JSON[_0x1b6b('0xb')](_0x3c622d);_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0xc'),JSON['stringify'](_0x350d57));}catch(_0x360a8b){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x360a8b));}});_0xb1a61e[_0x1b6b('0xd')](function(_0x5d1ce9,_0x59bc99){if(_0x5d1ce9){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x5'),new AGIError(_0x1b6b('0xe'),_0x5d1ce9));}else if(_0x5100e5&&_0x5100e5<0x0){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x5'),new AGIError(_0x1b6b('0xf')));_0x475423[_0x1b6b('0x10')]();}else if(_0x5100e5&&_0x5100e5>0x0&&_0x5100e5<_0x59bc99){_0x2c4040+=0x1;_0x2a2c45['emit'](_0x1b6b('0x5'),new AGIError(_0x1b6b('0x11'),_0x2c4040));_0x475423[_0x1b6b('0x10')]();}else{var _0x33dc7e=new AGIChannel(_0x475423);_0x33dc7e['on']('ready',function(){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x12'),_0x33dc7e);});}});});_0xb1a61e['on'](_0x1b6b('0x5'),function(_0x59e671){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x5'),new AGIError(_0x1b6b('0xe'),_0x59e671[_0x1b6b('0x13')]));});_0xb1a61e['on'](_0x1b6b('0x14'),function(){_0x2a2c45[_0x1b6b('0x9')](_0x1b6b('0x14'),new AGIError(_0x1b6b('0x15')));});}process[_0x1b6b('0x16')](function(){_0x41d09e();});};util[_0x1b6b('0x17')](AGIServer,EventEmitter);module['exports']=function(_0x283675,_0x395118,_0x3b427d){return new AGIServer(_0x283675,_0x395118,_0x3b427d);}; \ No newline at end of file +var _0xbee9=['E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','parse','projectUpdate','stringify','getConnections','E_AGI_SERVER_ERROR'];(function(_0x451836,_0x59e868){var _0x35305f=function(_0xc9ecbf){while(--_0xc9ecbf){_0x451836['push'](_0x451836['shift']());}};_0x35305f(++_0x59e868);}(_0xbee9,0x75));var _0x9bee=function(_0x3bc765,_0x4faf1a){_0x3bc765=_0x3bc765-0x0;var _0x5d9480=_0xbee9[_0x3bc765];return _0x5d9480;};'use strict';var util=require(_0x9bee('0x0'));var net=require(_0x9bee('0x1'));var EventEmitter=require('events')[_0x9bee('0x2')];var AGIError=require(_0x9bee('0x3'));var AGIChannel=require(_0x9bee('0x4'));var AGIServer=function(_0x47fe1f,_0x5df605,_0x7da883){var _0x11c638=this;var _0x44244f=null;var _0x38d113=0x0;if(!_0x47fe1f)_0x47fe1f=0x11dd;if(!_0x5df605)_0x5df605=_0x9bee('0x5');EventEmitter['call'](_0x11c638);function _0x3f9aeb(){if(!_0x47fe1f){_0x11c638[_0x9bee('0x6')](_0x9bee('0x7'),new AGIError(_0x9bee('0x8')));return![];}_0x44244f=net[_0x9bee('0x9')]();_0x44244f[_0x9bee('0xa')](_0x47fe1f,_0x5df605);_0x44244f['on'](_0x9bee('0xb'),function(){_0x11c638[_0x9bee('0x6')](_0x9bee('0xb'));});_0x44244f['on'](_0x9bee('0xc'),function(_0x3e27e7){_0x3e27e7['on']('data',function(_0x3cd4cd){try{var _0x52414c=JSON[_0x9bee('0xd')](_0x3cd4cd);_0x11c638['emit'](_0x9bee('0xe'),JSON[_0x9bee('0xf')](_0x52414c));}catch(_0x10e9c9){_0x11c638[_0x9bee('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x10e9c9));}});_0x44244f[_0x9bee('0x10')](function(_0x5d703d,_0x1ee6bb){if(_0x5d703d){_0x11c638[_0x9bee('0x6')](_0x9bee('0x7'),new AGIError(_0x9bee('0x11'),_0x5d703d));}else if(_0x7da883&&_0x7da883<0x0){_0x11c638['emit'](_0x9bee('0x7'),new AGIError(_0x9bee('0x12')));_0x3e27e7[_0x9bee('0x13')]();}else if(_0x7da883&&_0x7da883>0x0&&_0x7da883<_0x1ee6bb){_0x38d113+=0x1;_0x11c638[_0x9bee('0x6')](_0x9bee('0x7'),new AGIError(_0x9bee('0x14'),_0x38d113));_0x3e27e7[_0x9bee('0x13')]();}else{var _0x24d53e=new AGIChannel(_0x3e27e7);_0x24d53e['on'](_0x9bee('0x15'),function(){_0x11c638['emit']('connection',_0x24d53e);});}});});_0x44244f['on']('error',function(_0x53a0fc){_0x11c638[_0x9bee('0x6')](_0x9bee('0x7'),new AGIError(_0x9bee('0x11'),_0x53a0fc['code']));});_0x44244f['on'](_0x9bee('0x16'),function(){_0x11c638['emit'](_0x9bee('0x16'),new AGIError(_0x9bee('0x17')));});}process[_0x9bee('0x18')](function(){_0x3f9aeb();});};util[_0x9bee('0x19')](AGIServer,EventEmitter);module[_0x9bee('0x1a')]=function(_0x495ce3,_0x2d5f05,_0x5df1a5){return new AGIServer(_0x495ce3,_0x2d5f05,_0x5df1a5);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4668ab8..63f2ce2 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 _0x803f=['no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','email','Smtp','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','debug','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','mailRpc','prototype','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','isNil','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','POST','PUT','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','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_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','format','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','no\x20variable\x20found','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20intervals\x20found','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x803f,0x64));var _0xf803=function(_0x27ef55,_0x1c6afb){_0x27ef55=_0x27ef55-0x0;var _0x534236=_0x803f[_0x27ef55];return _0x534236;};'use strict';var fs=require('fs');var util=require(_0xf803('0x0'));var _=require('lodash');var sh=require(_0xf803('0x1'));var odbc=require(_0xf803('0x2'))();var rs=require('randomstring');var moment=require(_0xf803('0x3'));var Mustache=require(_0xf803('0x4'));var rp=require(_0xf803('0x5'));var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require('../../config/environment');var shared=require(_0xf803('0x8'));var scripts=require(_0xf803('0x9'));var FILES_PATH=_0xf803('0xa');var recursiveMapAttributes=['rawHeaders',_0xf803('0xb')];var verticesWithRetry=[_0xf803('0xc'),'getdigits',_0xf803('0xd')];var AGIVertices=function(_0xf7a481,_0x20ea41,_0x4c95cb){this[_0xf803('0xe')]=_0xf7a481;this['rpc']=_0x20ea41;this[_0xf803('0xf')]=_0x4c95cb;};AGIVertices[_0xf803('0x10')]['getVariable']=function(_0x174b31,_0x4779c6){this[_0xf803('0x11')][_0xf803('0x12')](_0x174b31)[_0xf803('0x13')](function(_0x50d9ef){_0x4779c6(null,_0x50d9ef?_0x50d9ef['name']:![]);})[_0xf803('0x14')](function(_0x2a6ed9){_0x4779c6(_0x2a6ed9);});};AGIVertices['prototype'][_0xf803('0x15')]=function(_0x48fc69,_0x272b96){this[_0xf803('0x11')][_0xf803('0x16')](_0x48fc69)[_0xf803('0x13')](function(_0x58a80b){_0x272b96(null,_0x58a80b?_0x58a80b[_0xf803('0x17')]:![]);})[_0xf803('0x14')](function(_0x3d07ca){_0x272b96(_0x3d07ca);});};AGIVertices[_0xf803('0x10')][_0xf803('0x18')]=function(_0xd170bc,_0xbd7728){this['rpc']['getSquareProjectById'](_0xd170bc)[_0xf803('0x13')](function(_0x292179){_0xbd7728(null,_0x292179?_0x292179[_0xf803('0x17')]:![]);})[_0xf803('0x14')](function(_0x29e28f){_0xbd7728(_0x29e28f);});};AGIVertices[_0xf803('0x10')][_0xf803('0x19')]=function(_0x246364,_0x790499){this[_0xf803('0x11')]['getSquareOdbcById'](_0x246364)[_0xf803('0x13')](function(_0x252421){_0x790499(null,_0x252421?_0x252421[_0xf803('0x1a')]:![]);})[_0xf803('0x14')](function(_0x38aa68){_0x790499(_0x38aa68);});};AGIVertices['prototype'][_0xf803('0x1b')]=function(_0x1a7879,_0x4a5299){this[_0xf803('0x11')][_0xf803('0x1c')](_0x1a7879)[_0xf803('0x13')](function(_0x23c46b){_0x4a5299(null,_0x23c46b?_0x23c46b[_0xf803('0x17')]:![]);})[_0xf803('0x14')](function(_0x3d8cc9){_0x4a5299(_0x3d8cc9);});};AGIVertices[_0xf803('0x10')][_0xf803('0x1d')]=function(_0x1e5a2a,_0x5f0642){this['rpc'][_0xf803('0x1e')](_0x1e5a2a)[_0xf803('0x13')](function(_0x145691){_0x5f0642(null,_0x145691?_0x145691[_0xf803('0x17')]:![]);})['catch'](function(_0x483890){_0x5f0642(_0x483890);});};AGIVertices[_0xf803('0x10')][_0xf803('0x1f')]=function(_0x1c8937,_0x4cc98b){var _0x8a1ab=this;this[_0xf803('0x11')]['getSoundById'](_0x1c8937)['then'](function(_0x2b8727){_0x4cc98b(null,_0x2b8727?_0x8a1ab[_0xf803('0x20')](_0x2b8727['save_name']):![]);})[_0xf803('0x14')](function(_0x13835d){_0x4cc98b(_0x13835d);});};AGIVertices[_0xf803('0x10')]['getMailAccount']=function(_0x73852c,_0x27c32f){this[_0xf803('0x11')][_0xf803('0x21')](_0x73852c)[_0xf803('0x13')](function(_0xd1545){_0x27c32f(null,_0xd1545?_0xd1545:![]);})[_0xf803('0x14')](function(_0x2ebd22){_0x27c32f(_0x2ebd22);});};AGIVertices[_0xf803('0x10')][_0xf803('0x22')]=function(_0x50185b,_0x46a3f8,_0x5bc426){this[_0xf803('0xf')]['sendMailMessage'](_0x50185b,_0x46a3f8)[_0xf803('0x13')](function(){_0x5bc426(null);})[_0xf803('0x14')](function(_0x466e41){_0x5bc426(_0x466e41);});};AGIVertices[_0xf803('0x10')][_0xf803('0x23')]=function(_0x2cd564,_0x1436d7){this['rpc'][_0xf803('0x24')](_0x2cd564)[_0xf803('0x13')](function(_0x6d4f36){if(_0x6d4f36){if(_0x6d4f36[_0xf803('0x25')]){_0x1436d7(null,[_0x6d4f36[_0xf803('0x26')]]);}else{_0x1436d7(null,_[_0xf803('0x27')](_0x6d4f36[_0xf803('0x28')],_0xf803('0x26')));}}else{_0x1436d7(null,![]);}})[_0xf803('0x14')](function(_0x3879d7){_0x1436d7(_0x3879d7);});};AGIVertices['prototype']['getSoundPath']=function(_0x3e8399){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x3e8399);};AGIVertices[_0xf803('0x10')]['getQueryOdbc']=function(_0x188a82,_0x27b064,_0x2cae0c){odbc[_0xf803('0x29')](_0x188a82,function(_0x2a2193){if(_0x2a2193){logger[_0xf803('0x2a')](_0xf803('0x2b'),_0x2a2193);_0x2cae0c(_0x2a2193);}else{logger[_0xf803('0x2c')](_0xf803('0x2d'));odbc[_0xf803('0x2e')](_0x27b064,function(_0x479289,_0x45f81d){if(_0x479289){logger[_0xf803('0x2c')](_0xf803('0x2f'),_0x27b064);_0x2cae0c(_0x479289);}else{logger[_0xf803('0x2c')](_0xf803('0x30'),_0x27b064);odbc['close'](function(_0x490175){if(_0x490175){logger[_0xf803('0x2a')](_0xf803('0x31'),_0x490175);}_0x2cae0c(null,_0x45f81d);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x54c896,_0x427bca){this[_0xf803('0x11')]['getSmsAccountById'](_0x54c896)[_0xf803('0x13')](function(_0x5079cc){_0x427bca(null,_0x5079cc?_0x5079cc:![]);})[_0xf803('0x14')](function(_0x14ee21){_0x427bca(_0x14ee21);});};AGIVertices[_0xf803('0x10')][_0xf803('0x32')]=function(_0x20db17,_0x123a9f){this[_0xf803('0x11')][_0xf803('0x32')](_0x20db17)[_0xf803('0x13')](function(_0x575c23){_0x123a9f(null,_0x575c23);})[_0xf803('0x14')](function(_0x48960c){_0x123a9f(_0x48960c);});};AGIVertices[_0xf803('0x10')][_0xf803('0x33')]=function(_0x2af94f,_0x57cea8,_0x401fc2){this['rpc'][_0xf803('0x33')]({'uniqueid':this['channel'][_0xf803('0x34')],'node':_0x2af94f[_0xf803('0x35')],'application':_0x2af94f['agicommand'],'data':_0x57cea8||null,'project_name':this[_0xf803('0xe')][_0xf803('0x36')],'callerid':this[_0xf803('0xe')][_0xf803('0x37')]})[_0xf803('0x13')](function(_0x23457c){if(_0x401fc2){_0x401fc2(null,_0x23457c);}})[_0xf803('0x14')](function(_0x3e24c6){if(_0x401fc2){_0x401fc2(_0x3e24c6);}});};AGIVertices[_0xf803('0x10')][_0xf803('0x38')]=function(_0x3a100a,_0x35aeb7,_0x3f2921,_0x528faf){this[_0xf803('0x11')]['createSquareRecording']({'uniqueid':this[_0xf803('0xe')][_0xf803('0x34')],'callerid':this['channel'][_0xf803('0x37')],'calleridname':this['channel'][_0xf803('0x39')],'context':this[_0xf803('0xe')]['context'],'extension':this[_0xf803('0xe')][_0xf803('0x3a')],'priority':this[_0xf803('0xe')][_0xf803('0x3b')],'accountcode':this[_0xf803('0xe')][_0xf803('0x3c')],'dnid':this[_0xf803('0xe')][_0xf803('0x3d')],'projectName':this['channel'][_0xf803('0x36')],'saveName':_0x35aeb7,'filename':_0x3a100a['file']||_0x35aeb7,'savePath':_0x3f2921})[_0xf803('0x13')](function(_0x482fb6){_0x528faf(null,_0x482fb6);})['catch'](function(_0x5982af){_0x528faf(_0x5982af);});};AGIVertices[_0xf803('0x10')]['createSquareMessage']=function(_0x10dc65,_0x4035de,_0x3b96a2,_0x40674f,_0x5df3a2){this[_0xf803('0x11')][_0xf803('0x3e')]({'uniqueid':this[_0xf803('0xe')][_0xf803('0x34')],'body':_0x10dc65,'direction':_0x4035de,'providerName':_0x3b96a2,'providerResponse':_0x40674f})[_0xf803('0x13')](function(_0x24d8f1){if(_0x5df3a2){_0x5df3a2(null,_0x24d8f1);}})[_0xf803('0x14')](function(_0x523832){if(_0x5df3a2){_0x5df3a2(_0x523832);}});};AGIVertices['prototype'][_0xf803('0x3f')]=function(_0x249e3d,_0x5dbeeb){this['rpc'][_0xf803('0x3f')]({'firstName':_[_0xf803('0x40')](_0x249e3d[_0xf803('0x17')])||_['isNil'](_0x249e3d['name'])?_0xf803('0x41')+Math[_0xf803('0x42')]():_0x249e3d['name'],'lastName':_['isEmpty'](_0x249e3d[_0xf803('0x43')])||_['isNil'](_0x249e3d[_0xf803('0x43')])?null:_0x249e3d['lastName'],'phone':_0x249e3d[_0xf803('0x44')],'ListId':_0x249e3d[_0xf803('0x45')],'scheduledat':_0x249e3d[_0xf803('0x46')],'callbackUniqueid':this[_0xf803('0xe')][_0xf803('0x34')],'tags':_0xf803('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x249e3d[_0xf803('0x46')][_0xf803('0x48')](),'priority':_0x249e3d[_0xf803('0x49')]})['then'](function(_0x5e71d3){_0x5dbeeb(null,_0x5e71d3);})[_0xf803('0x14')](function(_0xa6b73f){_0x5dbeeb(_0xa6b73f);});};AGIVertices[_0xf803('0x10')][_0xf803('0x4a')]=function(_0x2e0f52,_0x2e7514){this[_0xf803('0x11')]['getPauseById'](_0x2e0f52)[_0xf803('0x13')](function(_0x32b2d0){_0x2e7514(null,_0x32b2d0?_0x32b2d0[_0xf803('0x17')]:![]);})[_0xf803('0x14')](function(_0x5cdc28){_0x2e7514(_0x5cdc28);});};AGIVertices['prototype'][_0xf803('0x4b')]=function(_0x19f0fb,_0x30c61e,_0x2e48d9){var _0x268849={'role':'agent'};_0x268849[_0x19f0fb]=this[_0xf803('0xe')][_0xf803('0x37')];this['rpc'][_0xf803('0x4b')](_0x268849,_0x30c61e,this[_0xf803('0xe')][_0xf803('0x34')])[_0xf803('0x13')](function(_0x49e7d1){_0x2e48d9(null,_[_0xf803('0x4c')](_0x49e7d1)?![]:!![]);})[_0xf803('0x14')](function(_0x12d0da){logger[_0xf803('0x2a')](_0x12d0da);_0x2e48d9(null,![]);});};AGIVertices[_0xf803('0x10')][_0xf803('0x4d')]=function(_0x135976,_0x2a30ad){var _0x3617c4={'role':'agent'};_0x3617c4[_0x135976]=this[_0xf803('0xe')]['callerid'];this[_0xf803('0x11')][_0xf803('0x4d')](_0x3617c4)[_0xf803('0x13')](function(_0x47164a){_0x2a30ad(null,_['isNil'](_0x47164a)?![]:!![]);})['catch'](function(_0x413b19){logger[_0xf803('0x2a')](_0x413b19);_0x2a30ad(null,![]);});};AGIVertices[_0xf803('0x10')]['agentLogout']=function(_0x2ef418,_0x4b1542){var _0x28e30d={'role':_0xf803('0x4e')};_0x28e30d[_0x2ef418]=this[_0xf803('0xe')][_0xf803('0x37')];this[_0xf803('0x11')][_0xf803('0x4f')](_0x28e30d)[_0xf803('0x13')](function(_0x3c6a55){_0x4b1542(null,_['isNil'](_0x3c6a55)?![]:!![]);})[_0xf803('0x14')](function(_0x58544e){logger['error'](_0x58544e);_0x4b1542(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x2d4234,_0x5036a3){var _0x2a603e={'role':_0xf803('0x4e')};_0x2a603e[_0x2d4234]=this[_0xf803('0xe')][_0xf803('0x37')];var _0x571fb4=_0x2d4234!=_0xf803('0x50')?util['format'](_0xf803('0x51'),_0xf803('0x52'),this[_0xf803('0xe')][_0xf803('0x37')]):undefined;this[_0xf803('0x11')][_0xf803('0x53')](_0x2a603e,_0x571fb4)['then'](function(_0x39216c){_0x5036a3(null,_[_0xf803('0x4c')](_0x39216c)?![]:!![]);})['catch'](function(_0x805577){logger[_0xf803('0x2a')](_0x805577);_0x5036a3(null,![]);});};AGIVertices[_0xf803('0x10')][_0xf803('0x54')]=function(_0x21b09f,_0x1280c2){sh[_0xf803('0x55')](_[_0xf803('0x56')](_0x21b09f),function(_0x309843,_0x3f9c2c){var _0x4081a0=_0x3f9c2c[_0xf803('0x57')](/(\r\n|\n|\r)/gm,'');_0x1280c2(null,_0x4081a0);});};AGIVertices['prototype'][_0xf803('0x58')]=function(_0x454f41,_0x4a2805){scripts[_0xf803('0x58')](_0x454f41[_0xf803('0x59')],_0x454f41[_0xf803('0x5a')]||_0xf803('0x5b'),_0x454f41['text'],_0x454f41[_0xf803('0x5c')]||_0xf803('0x5d'),_0x454f41[_0xf803('0x5e')]||_0xf803('0x5f'),_0x454f41[_0xf803('0x60')]||_0xf803('0x61'))[_0xf803('0x13')](function(_0x423473){_0x4a2805(null,_0x423473);})['catch'](function(_0x1f207b){_0x4a2805(_0x1f207b);});};AGIVertices['prototype']['googleTTS']=function(_0x3863ec,_0x402021){scripts[_0xf803('0x62')](_0x3863ec[_0xf803('0x5b')],_0x3863ec[_0xf803('0x63')]||'en',0x1)[_0xf803('0x13')](function(_0x3cf463){_0x402021(null,_0x3cf463);})[_0xf803('0x14')](function(_0x268d97){_0x402021(_0x268d97);});};AGIVertices[_0xf803('0x10')][_0xf803('0x64')]=function(_0x21333c,_0x12cf5e){var _0x3fbaa4={'uri':_0x21333c[_0xf803('0x65')],'method':_0x21333c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x21333c['timeout'])===_0xf803('0x66')&&parseInt(_0x21333c['timeout'])>=0x1?parseInt(_0x21333c[_0xf803('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xf803('0x68'),_0xf803('0x69')],_0x3fbaa4[_0xf803('0x6a')][_0xf803('0x6b')]())){try{_0x3fbaa4[_0xf803('0x6c')]=_0x21333c['rawBody']?JSON['parse'](_0x21333c[_0xf803('0xb')]):{};}catch(_0x12166f){logger[_0xf803('0x2a')](_0xf803('0x6d'),_0x12166f);}}try{_0x3fbaa4[_0xf803('0x6e')]=_0x21333c[_0xf803('0x6f')]?JSON[_0xf803('0x70')](_0x21333c[_0xf803('0x6f')]):{};}catch(_0xb68254){logger[_0xf803('0x2a')](_0xf803('0x71'),_0xb68254);}if(_0x21333c[_0xf803('0x72')]){try{var _0x316c39=require(_0x21333c[_0xf803('0x72')])[_0xf803('0x73')](this,_0x3fbaa4);_0x3fbaa4[_0xf803('0x74')]=Mustache['render'](_0x21333c[_0xf803('0x65')],_0x316c39,{},['$$','$$']);if(_0x3fbaa4['headers']){_0x3fbaa4[_0xf803('0x6e')]=JSON[_0xf803('0x70')](Mustache[_0xf803('0x75')](JSON[_0xf803('0x76')](_0x3fbaa4['headers']),_0x316c39,{},['$$','$$']));}if(_0x3fbaa4[_0xf803('0x6c')]){_0x3fbaa4[_0xf803('0x6c')]=JSON[_0xf803('0x70')](Mustache[_0xf803('0x75')](JSON[_0xf803('0x76')](_0x3fbaa4[_0xf803('0x6c')]),_0x316c39,{},['$$','$$']));}}catch(_0x1b11cc){logger[_0xf803('0x2a')](_0xf803('0x77'),_0x1b11cc);}}rp(_0x3fbaa4)['then'](function(_0x3f7a63){var _0x411db1={'statusCode':_0x3f7a63[_0xf803('0x78')]||0xc8,'statusMessage':_0x3f7a63[_0xf803('0x79')]||'OK','headers':_0x3f7a63[_0xf803('0x6e')]||{},'body':_0x3f7a63[_0xf803('0x6c')]||{}};_0x12cf5e(null,_0x411db1);})['catch'](function(_0x19afeb){var _0x1cc113={'statusCode':_0x19afeb[_0xf803('0x78')]||0x1f4,'statusMessage':_0x19afeb['message']||_0xf803('0x7a'),'headers':_0x19afeb['options'][_0xf803('0x6e')]||{},'body':_0x19afeb[_0xf803('0x7b')][_0xf803('0x6c')]||{}};_0x12cf5e(null,_0x1cc113);});};AGIVertices[_0xf803('0x10')][_0xf803('0x7c')]=function(_0x8753e,_0x26ce6e){scripts['googleDialogflow'](this[_0xf803('0xe')][_0xf803('0x34')],_0x8753e[_0xf803('0x7d')],_0x8753e['text'],_0x8753e[_0xf803('0x7e')]||'en')[_0xf803('0x13')](function(_0x15428f){_0x26ce6e(null,_0x15428f);})[_0xf803('0x14')](function(_0xc6742){_0x26ce6e(_0xc6742);});};AGIVertices['prototype'][_0xf803('0x7f')]=function(_0x37a69f,_0x57348b){scripts['googleDialogflowV2'](this[_0xf803('0xe')][_0xf803('0x34')],_0x37a69f[_0xf803('0x80')],_0x37a69f[_0xf803('0x81')],_0x37a69f[_0xf803('0x82')],_0x37a69f[_0xf803('0x5b')],_0x37a69f[_0xf803('0x83')]||'en')[_0xf803('0x13')](function(_0x4c86c9){_0x57348b(null,_0x4c86c9);})[_0xf803('0x14')](function(_0x3d8816){_0x57348b(_0x3d8816);});};AGIVertices[_0xf803('0x10')]['sestekNDA']=function(_0x3ce038,_0x415d81){scripts[_0xf803('0x84')](this[_0xf803('0xe')],_0x3ce038)['then'](function(_0x1a0861){_0x415d81(null,_0x1a0861);})[_0xf803('0x14')](function(_0x3a1df6){_0x415d81(_0x3a1df6);});};AGIVertices[_0xf803('0x10')][_0xf803('0x85')]=function(_0x4d4cfd,_0x121ccf){scripts['ispeechTTS'](_0x4d4cfd['key'],_0x4d4cfd[_0xf803('0x5b')],_0x4d4cfd[_0xf803('0x86')]||'en-US',_0x4d4cfd[_0xf803('0x87')])['then'](function(_0x5c1421){_0x121ccf(null,_0x5c1421);})[_0xf803('0x14')](function(_0x36442b){_0x121ccf(_0x36442b);});};AGIVertices[_0xf803('0x10')]['ispeechASR']=function(_0x44d7da,_0x386fe1,_0x47404b){scripts[_0xf803('0x88')](_0x386fe1,_0x44d7da[_0xf803('0x7d')],_0x44d7da[_0xf803('0x89')]||_0xf803('0x5d'),this[_0xf803('0x8a')](_0x44d7da[_0xf803('0x8b')])?_0x44d7da[_0xf803('0x8b')]:undefined)[_0xf803('0x13')](function(_0x69bdd0){_0x47404b(null,_0x69bdd0);})['catch'](function(_0x44fd67){_0x47404b(_0x44fd67);});};AGIVertices[_0xf803('0x10')][_0xf803('0x8c')]=function(_0x2b9a9d,_0x3ffb68){scripts[_0xf803('0x8c')](_0x2b9a9d['aws_access_key_id'],_0x2b9a9d[_0xf803('0x8d')],_0x2b9a9d[_0xf803('0x8e')],_0x2b9a9d['aws_polly_voice']||_0xf803('0x8f'),_0x2b9a9d[_0xf803('0x5b')],_0x2b9a9d[_0xf803('0x90')]||_0xf803('0x5b'))[_0xf803('0x13')](function(_0x38d67a){_0x3ffb68(null,_0x38d67a);})[_0xf803('0x14')](function(_0x3d2aa5){_0x3ffb68(_0x3d2aa5);});};AGIVertices[_0xf803('0x10')][_0xf803('0x91')]=function(_0x3e98f5,_0x47470f){scripts[_0xf803('0x91')](this['channel'][_0xf803('0x34')],_0x3e98f5['aws_access_key_id'],_0x3e98f5['aws_secret_access_key'],_0x3e98f5[_0xf803('0x92')],_0x3e98f5[_0xf803('0x5b')],_0x3e98f5[_0xf803('0x93')])[_0xf803('0x13')](function(_0x5eb8ef){_0x47470f(null,_0x5eb8ef);})[_0xf803('0x14')](function(_0x19ccd3){_0x47470f(_0x19ccd3);});};AGIVertices[_0xf803('0x10')][_0xf803('0x94')]=function(_0x342a8b,_0x2124c1,_0x589450){scripts[_0xf803('0x94')](_0x2124c1,_0x342a8b['key'],_0x342a8b['google_asr_language']||_0xf803('0x5d'))[_0xf803('0x13')](function(_0x15236b){_0x589450(null,_0x15236b);})[_0xf803('0x14')](function(_0x2ed67c){_0x589450(_0x2ed67c);});};AGIVertices['prototype'][_0xf803('0x95')]=function(_0x3dd0dd,_0x6d5b02,_0x1b8fc9){scripts['tildeASR'](_0x6d5b02,_0x3dd0dd[_0xf803('0x96')],_0x3dd0dd['appsecret'],_0x3dd0dd[_0xf803('0x74')])[_0xf803('0x13')](function(_0x379efb){_0x1b8fc9(null,_0x379efb);})[_0xf803('0x14')](function(_0x36a457){_0x1b8fc9(_0x36a457);});};AGIVertices[_0xf803('0x10')][_0xf803('0x97')]=function(_0x2b6edf){var _0x408af9=_[_0xf803('0x98')](verticesWithRetry,_0x2b6edf['agicommand'])?_0x2b6edf:_[_0xf803('0x99')](_0x2b6edf);for(var _0x5e53d5 in _0x408af9){if(_0x408af9[_0xf803('0x9a')](_0x5e53d5)){if(_0x408af9[_0x5e53d5]&&_[_0xf803('0x9b')](_0x408af9[_0x5e53d5])){if(_['includes'](recursiveMapAttributes,_0x5e53d5)){_0x408af9[_0x5e53d5]=this[_0xf803('0x9c')](_0x408af9[_0x5e53d5]);}else{_0x408af9[_0x5e53d5]=this[_0xf803('0x9d')](_0x408af9[_0x5e53d5]);}}}}return _0x408af9;};AGIVertices['prototype'][_0xf803('0x9e')]=function(_0x4b9737){for(var _0x12dd3e in _0x4b9737){if(_0x4b9737[_0xf803('0x9a')](_0x12dd3e)){if(_[_0xf803('0x9f')](_0x4b9737[_0x12dd3e])){this[_0xf803('0x9e')](_0x4b9737[_0x12dd3e]);}else if(_[_0xf803('0xa0')](_0x4b9737[_0x12dd3e])){for(var _0x5c7636=0x0;_0x5c7636<_0x4b9737[_0x12dd3e][_0xf803('0xa1')];_0x5c7636++){this[_0xf803('0x9e')](_0x4b9737[_0x12dd3e][_0x5c7636]);}}else if(_['isString'](_0x4b9737[_0x12dd3e])){_0x4b9737[_0x12dd3e]=this[_0xf803('0x9d')](_0x4b9737[_0x12dd3e]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x18cb3d,_0x16375a){for(var _0x7850c in _0x18cb3d){if(_0x18cb3d[_0xf803('0x9a')](_0x7850c)){if(_[_0xf803('0x9f')](_0x18cb3d[_0x7850c])){if(!_[_0xf803('0x40')](_0x18cb3d[_0x7850c])){this['saveRestApiResult'](_0x18cb3d[_0x7850c],util['format'](_0xf803('0xa2'),_0x16375a,_0x7850c));}}else if(_[_0xf803('0xa0')](_0x18cb3d[_0x7850c])){for(var _0x564c3a=0x0;_0x564c3a<_0x18cb3d[_0x7850c]['length'];_0x564c3a++){this[_0xf803('0xa3')](_0x18cb3d[_0x7850c][_0x564c3a],util[_0xf803('0xa4')]('%s.%s',_0x16375a,_0x7850c+'['+_0x564c3a+']'));}}else{if(!_[_0xf803('0x4c')](_0x18cb3d[_0x7850c])){this[_0xf803('0xe')][_0xf803('0xa5')](util[_0xf803('0xa4')](_0xf803('0xa2'),_0x16375a,_0x7850c),_0x18cb3d[_0x7850c]);}}}}};AGIVertices[_0xf803('0x10')][_0xf803('0x9c')]=function(_0x4b225b){try{var _0x745f68=JSON['parse'](_0x4b225b);this['recursiveNodeIndex'](_0x745f68);return JSON[_0xf803('0x76')](_0x745f68);}catch(_0x5814f8){return this[_0xf803('0x9d')](_0x4b225b);}};AGIVertices['prototype'][_0xf803('0x9d')]=function(_0x2a9c63){var _0x22621b=_0x2a9c63[_0xf803('0xa6')]('{');for(var _0x23c574=0x1;_0x23c574<_0x22621b[_0xf803('0xa1')];_0x23c574+=0x1){var _0x5afed7=_0x22621b[_0x23c574]['split']('}');if(_0x5afed7[_0xf803('0xa1')]>0x1){_0x2a9c63=_0x2a9c63[_0xf803('0xa7')]('{'+_0x5afed7[0x0]+'}',this[_0xf803('0xe')][_0xf803('0xa8')](_0x5afed7[0x0])[_0xf803('0xa9')]||_0x5afed7[0x0]);}}if(_0x22621b[_0xf803('0xa1')]===0x1){return _0x2a9c63[_0xf803('0x48')]();}return this[_0xf803('0x9d')](_0x2a9c63);};AGIVertices[_0xf803('0x10')][_0xf803('0xaa')]=function(_0x2c868f,_0x3fc71b){var _0x19f05d=this[_0xf803('0xe')][_0xf803('0xa8')](_0x2c868f);if(_0x19f05d[_0xf803('0xab')]===-0x1){return _0x19f05d;}logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xac'),_0x3fc71b,_0x19f05d[_0xf803('0xa9')]));return this[_0xf803('0xe')][_0xf803('0xa5')](_0x3fc71b,_0x19f05d[_0xf803('0xa9')]);};AGIVertices[_0xf803('0x10')]['isConfigured']=function(_0x6f72f8){return _0x6f72f8&&_0x6f72f8!=='0'&&_0x6f72f8!=='-1'&&_0x6f72f8!=='';};AGIVertices[_0xf803('0x10')]['maxRetry']=function(_0xae7433){this[_0xf803('0x33')][_0xf803('0x73')](this,_0xae7433,'-');_0xae7433['retry']=_0xae7433[_0xf803('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xf803('0xae')]=function(_0x13c9e0){logger[_0xf803('0x2c')](util[_0xf803('0xa4')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x13c9e0[_0xf803('0x35')]));if(!this['isConfigured'](_0x13c9e0[_0xf803('0x5b')])){return this['channel'][_0xf803('0xaf')](_0xf803('0xb0'));}var _0x54edf4='\x22'+_0x13c9e0['text']+'\x22';if(this[_0xf803('0x8a')](_0x13c9e0[_0xf803('0x7b')])){_0x54edf4+=','+_0x13c9e0['options'];}var _0x1ea82b=this['channel'][_0xf803('0x55')]('MRCPSynth',_0x54edf4);if(_0x1ea82b['result']===-0x1){return _0x1ea82b;}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xb1'),_0x54edf4));};AGIVertices[_0xf803('0x10')][_0xf803('0xb2')]=function(_0xdececb){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xb3'),_0xdececb[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0xdececb['grammar'])){return this['channel'][_0xf803('0xaf')](_0xf803('0xb4'));}var _0x46b966=_0xdececb[_0xf803('0xb5')];if(this[_0xf803('0x8a')](_0xdececb['options'])){_0x46b966+=','+_0xdececb[_0xf803('0x7b')];}var _0x12a487=this[_0xf803('0xe')]['exec'](_0xf803('0xb6'),_0x46b966);if(_0x12a487['result']===-0x1){return _0x12a487;}var _0x44a736=this[_0xf803('0xaa')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x44a736['result']===-0x1){return _0x44a736;}var _0x413d03=this[_0xf803('0xaa')](_0xf803('0xb7'),'MRCP_RECOG_TRANSCRIPT');if(_0x413d03[_0xf803('0xab')]===-0x1){return _0x413d03;}var _0x4e4634=this[_0xf803('0xaa')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x4e4634[_0xf803('0xab')]===-0x1){return _0x4e4634;}return this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xb8'),_0x46b966));};AGIVertices['prototype'][_0xf803('0x7')]=function(_0xceec36){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xb9'),_0xceec36['label']));return this[_0xf803('0xe')][_0xf803('0x7')]([_0xceec36[_0xf803('0xba')],_0xceec36[_0xf803('0xbb')]]);};AGIVertices[_0xf803('0x10')]['answer']=function(_0x49bbec){logger[_0xf803('0x2c')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x49bbec[_0xf803('0x35')]));if(this[_0xf803('0x8a')](_0x49bbec[_0xf803('0x67')])){logger['info'](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x49bbec[_0xf803('0x67')]));var _0x380cae=this[_0xf803('0xe')][_0xf803('0xbc')](_0x49bbec[_0xf803('0x67')]);if(_0x380cae['result']===-0x1){return _0x380cae;}}return this['channel'][_0xf803('0xbd')]();};AGIVertices['prototype'][_0xf803('0x47')]=function(_0x1bb67d){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xbe'),_0x1bb67d[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x1bb67d['list_id'])){return this['channel'][_0xf803('0x2a')](_0x1bb67d,_0xf803('0xbf'));}_0x1bb67d[_0xf803('0x46')]=moment();if(this[_0xf803('0x8a')](_0x1bb67d[_0xf803('0xc0')])){_0x1bb67d[_0xf803('0x46')]=moment()[_0xf803('0xc1')](_0x1bb67d['delay'],_0xf803('0xc2'));}if(!this['isConfigured'](_0x1bb67d[_0xf803('0x49')])){_0x1bb67d[_0xf803('0x49')]=0x2;}this[_0xf803('0x3f')]['sync'](this,_0x1bb67d);return this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xc3'),_0x1bb67d[_0xf803('0x44')],_0x1bb67d[_0xf803('0x45')],_0x1bb67d[_0xf803('0x46')]));};AGIVertices[_0xf803('0x10')][_0xf803('0xc4')]=function(_0xdafc48){logger[_0xf803('0x2c')](util['format'](_0xf803('0xc5'),_0xdafc48['label']));var _0x5708c5=this[_0xf803('0xe')][_0xf803('0x55')](_0xdafc48[_0xf803('0xc6')],_0xdafc48['options']);if(_0x5708c5[_0xf803('0xab')]===-0x1){return _0x5708c5;}return this['channel']['noop'](util[_0xf803('0xa4')](_0xf803('0xc7'),_0xdafc48['application'],_0xdafc48[_0xf803('0x7b')]));};AGIVertices[_0xf803('0x10')][_0xf803('0xc8')]=function(_0x278581){logger[_0xf803('0x2c')](util['format'](_0xf803('0xc9'),_0x278581[_0xf803('0x35')]));if(!this['isConfigured'](_0x278581[_0xf803('0x5b')])){return this['channel'][_0xf803('0xaf')]('no\x20text\x20configured');}var _0x239fd8='\x22'+_0x278581[_0xf803('0x5b')]+'\x22';if(this[_0xf803('0x8a')](_0x278581[_0xf803('0x7b')])){_0x239fd8+=','+_0x278581[_0xf803('0x7b')];}var _0x5ac43a=this['channel'][_0xf803('0x55')](_0xf803('0xca'),_0x239fd8);if(_0x5ac43a['result']===-0x1){return _0x5ac43a;}return this['channel'][_0xf803('0xaf')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x239fd8));};AGIVertices['prototype'][_0xf803('0xcb')]=function(_0x14acc6){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xcc'),_0x14acc6[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x14acc6['text'])){return this['channel'][_0xf803('0xaf')](_0xf803('0xb0'));}var _0xfc4c98='\x22'+_0x14acc6[_0xf803('0x5b')]+'\x22';if(this['isConfigured'](_0x14acc6['options'])){_0xfc4c98+=','+_0x14acc6['options'];}var _0x5477a0=this[_0xf803('0xe')][_0xf803('0x55')]('MRCPSynth',_0xfc4c98);if(_0x5477a0[_0xf803('0xab')]===-0x1){return _0x5477a0;}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xb1'),_0xfc4c98));};AGIVertices['prototype'][_0xf803('0xcd')]=function(_0x2bfae0){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xce'),_0x2bfae0[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x2bfae0[_0xf803('0xb5')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xb4'));}var _0x5aab5e=_0x2bfae0[_0xf803('0xb5')];if(this[_0xf803('0x8a')](_0x2bfae0['options'])){_0x5aab5e+=','+_0x2bfae0[_0xf803('0x7b')];}var _0x189160=this[_0xf803('0xe')][_0xf803('0x55')](_0xf803('0xb6'),_0x5aab5e);if(_0x189160[_0xf803('0xab')]===-0x1){return _0x189160;}var _0x3850e8=this[_0xf803('0xaa')](_0xf803('0xcf'),'LUMENVOX_ASR_CONFIDENCE');if(_0x3850e8[_0xf803('0xab')]===-0x1){return _0x3850e8;}var _0x157fce=this[_0xf803('0xaa')](_0xf803('0xb7'),_0xf803('0xd0'));if(_0x157fce[_0xf803('0xab')]===-0x1){return _0x157fce;}var _0x349d76=this[_0xf803('0xaa')]('RECOG_INSTANCE()',_0xf803('0xd1'));if(_0x349d76[_0xf803('0xab')]===-0x1){return _0x349d76;}return this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xb8'),_0x5aab5e));};AGIVertices[_0xf803('0x10')][_0xf803('0xd2')]=function(_0x55c8cf){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xd3'),_0x55c8cf[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x55c8cf[_0xf803('0xb5')])){return this['channel'][_0xf803('0xaf')](_0xf803('0xb4'));}var _0x235e1=_0x55c8cf[_0xf803('0xb5')];if(this['isConfigured'](_0x55c8cf[_0xf803('0x7b')])){_0x235e1+=','+_0x55c8cf[_0xf803('0x7b')];}var _0xb5b41f=this[_0xf803('0xe')][_0xf803('0x55')](_0xf803('0xb6'),_0x235e1);if(_0xb5b41f[_0xf803('0xab')]===-0x1){return _0xb5b41f;}var _0x344e72=this[_0xf803('0xaa')](_0xf803('0xcf'),_0xf803('0xd4'));if(_0x344e72['result']===-0x1){return _0x344e72;}var _0x1a1111=this[_0xf803('0xaa')](_0xf803('0xb7'),_0xf803('0xd5'));if(_0x1a1111[_0xf803('0xab')]===-0x1){return _0x1a1111;}var _0x4e2306=this['getAndSetVariable'](_0xf803('0xd6'),_0xf803('0xd7'));if(_0x4e2306[_0xf803('0xab')]===-0x1){return _0x4e2306;}return this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0xb8'),_0x235e1));};AGIVertices['prototype']['database']=function(_0x59c765){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xd8'),_0x59c765[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x59c765[_0xf803('0xd9')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x59c765,_0xf803('0xda'));}var _0x5c3e7b=this[_0xf803('0x19')][_0xf803('0x73')](this,_0x59c765['odbc_id']);if(!_0x5c3e7b){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x59c765,_0xf803('0xdb'));}if(!this[_0xf803('0x8a')](_0x59c765[_0xf803('0x2e')])){return this[_0xf803('0xe')]['error'](_0x59c765,_0xf803('0xdc'));}var _0x410c55=_0x59c765[_0xf803('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xdd'),_0x410c55));var _0x4cd443=this[_0xf803('0xde')][_0xf803('0x73')](this,_0x5c3e7b,_0x410c55);this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x59c765,_0x410c55);if(!this[_0xf803('0x8a')](_0x59c765[_0xf803('0xdf')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xe0'));}var _0x78de78=this['getVariable'][_0xf803('0x73')](this,_0x59c765['variable_id']);if(!_0x78de78){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x59c765,'no\x20variable\x20found');}var _0xc6413=this;_0x4cd443[_0xf803('0xe1')](function(_0x4e04b8,_0x12504b){Object[_0xf803('0xe2')](_0x4e04b8)[_0xf803('0xe1')](function(_0x4de44f){_0xc6413[_0xf803('0xe')][_0xf803('0xa5')](util['format'](_0xf803('0xe3'),_0x78de78,_0x12504b,_0x4de44f),_0x4e04b8[_0x4de44f]);});});this['channel'][_0xf803('0xa5')](util[_0xf803('0xa4')](_0xf803('0xe4'),_0x78de78),_0x4cd443['length']);return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xe5'),_0x78de78));};AGIVertices[_0xf803('0x10')][_0xf803('0xe6')]=function(_0x1be4b8){logger['debug'](util[_0xf803('0xa4')](_0xf803('0xe7'),_0x1be4b8[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x1be4b8[_0xf803('0xe8')])){return this['channel']['error'](_0x1be4b8,'no\x20user\x20selected');}var _0x2d55b6=this[_0xf803('0x1b')][_0xf803('0x73')](this,_0x1be4b8[_0xf803('0xe8')]);if(!_0x2d55b6){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x1be4b8,'no\x20user\x20found');}var _0x2c99d3=this[_0xf803('0xe')]['exec'](_0xf803('0xe9'),[util[_0xf803('0xa4')](_0xf803('0xea'),_0x2d55b6),_0x1be4b8[_0xf803('0x67')],_0x1be4b8[_0xf803('0xeb')],_0x1be4b8['url']]);if(_0x2c99d3[_0xf803('0xab')]===-0x1){return _0x2c99d3;}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xec'),_0xf803('0xe9')));};AGIVertices[_0xf803('0x10')][_0xf803('0xed')]=function(_0x3d7f36){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0xee'),_0x3d7f36[_0xf803('0x35')]));if(!this['isConfigured'](_0x3d7f36[_0xf803('0x7d')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xef'));}if(!this[_0xf803('0x8a')](_0x3d7f36[_0xf803('0x5b')])){return this['channel'][_0xf803('0xaf')](_0xf803('0xb0'));}this['channel'][_0xf803('0xf0')]=!![];this['createSquareDetailsReport'](_0x3d7f36);this[_0xf803('0x3e')](_0x3d7f36[_0xf803('0x5b')],'in','','');this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0xf1'),_0x3d7f36[_0xf803('0x5b')]));var _0x5ab091=this[_0xf803('0x7c')][_0xf803('0x73')](this,_0x3d7f36);if(_0x5ab091){for(var _0xb826ad in _0x5ab091){if(_0x5ab091[_0xf803('0x9a')](_0xb826ad)){this[_0xf803('0xe')]['setVariable'](util['format']('DIALOGFLOW_%s',_0xb826ad[_0xf803('0x6b')]()),_0x5ab091[_0xb826ad]);}}this[_0xf803('0x3e')](_0x5ab091[_0xf803('0xf2')],'out','dialogflow','');return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xf3'),_0x5ab091['speech']));}return this[_0xf803('0xe')][_0xf803('0x2a')](_0x3d7f36,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xf803('0x10')][_0xf803('0xf4')]=function(_0x3a77b0){logger[_0xf803('0x2c')](util[_0xf803('0xa4')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3a77b0['label']));if(!this[_0xf803('0x8a')](_0x3a77b0[_0xf803('0x80')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xf5'));}if(!this[_0xf803('0x8a')](_0x3a77b0[_0xf803('0x81')])){return this['channel'][_0xf803('0xaf')](_0xf803('0xf6'));}if(!this[_0xf803('0x8a')](_0x3a77b0[_0xf803('0x82')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xf7'));}if(!this[_0xf803('0x8a')](_0x3a77b0['dialogflowV2_language'])){return this['channel'][_0xf803('0xaf')](_0xf803('0xf8'));}if(!this['isConfigured'](_0x3a77b0[_0xf803('0x5b')])){return this[_0xf803('0xe')][_0xf803('0xaf')]('no\x20text\x20configured');}this['channel'][_0xf803('0xf0')]=!![];this[_0xf803('0x33')](_0x3a77b0);this[_0xf803('0x3e')](_0x3a77b0['text'],'in','','');this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xf9'),_0x3a77b0['text']));var _0x7f14ad=this[_0xf803('0x7f')][_0xf803('0x73')](this,_0x3a77b0);if(_0x7f14ad){for(var _0x5e0ca9 in _0x7f14ad){if(_0x7f14ad[_0xf803('0x9a')](_0x5e0ca9)){if(_0x5e0ca9!=='providerResponse'){this[_0xf803('0xe')][_0xf803('0xa5')](util['format'](_0xf803('0xfa'),_0x5e0ca9[_0xf803('0x6b')]()),_0x7f14ad[_0x5e0ca9]);}}}this[_0xf803('0x3e')](_0x7f14ad[_0xf803('0xf2')],_0xf803('0xfb'),_0xf803('0xf4'),_0x7f14ad[_0xf803('0xfc')]);return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xfd'),_0x7f14ad[_0xf803('0xf2')]));}return this[_0xf803('0xe')][_0xf803('0x2a')](_0x3a77b0,_0xf803('0xfe'));};AGIVertices[_0xf803('0x10')][_0xf803('0xff')]=function(_0x4fc2eb){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x100'),_0x4fc2eb[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x4fc2eb[_0xf803('0x101')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x102'));}if(!this[_0xf803('0x8a')](_0x4fc2eb[_0xf803('0x103')])){return this[_0xf803('0xe')]['noop'](_0xf803('0x104'));}if(!this['isConfigured'](_0x4fc2eb[_0xf803('0x105')])){return this[_0xf803('0xe')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x4fc2eb[_0xf803('0x106')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xb0'));}this[_0xf803('0xe')][_0xf803('0xf0')]=!![];this[_0xf803('0x33')](_0x4fc2eb);this['createSquareMessage'](_0x4fc2eb[_0xf803('0x5b')],'in','','');this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x107'),_0x4fc2eb[_0xf803('0x5b')]));var _0xc2e5f8=this[_0xf803('0x84')][_0xf803('0x73')](this,_0x4fc2eb);if(_0xc2e5f8){for(var _0x455989 in _0xc2e5f8){if(_0xc2e5f8['hasOwnProperty'](_0x455989)){this[_0xf803('0xe')][_0xf803('0xa5')](util[_0xf803('0xa4')]('SESTEK_NDA_%s',_0x455989['toUpperCase']()),_0xc2e5f8[_0x455989]);}}this[_0xf803('0x3e')](_0xc2e5f8['speech'],_0xf803('0xfb'),_0xf803('0xff'),'');if(_0xc2e5f8[_0xf803('0x108')]){this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0x109'),_0xc2e5f8['audiofile']));var _0x4525d9=this[_0xf803('0xe')][_0xf803('0x10a')](_0xc2e5f8[_0xf803('0x108')]);try{fs['unlink'](_0xc2e5f8[_0xf803('0x108')]+_0xf803('0x10b'));}catch(_0x190163){logger['error'](_0x190163);}return _0x4525d9;}else{return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x10c'),_0xc2e5f8['speech']));}}return this[_0xf803('0xe')]['error'](_0x4fc2eb,_0xf803('0x10d'));};AGIVertices['prototype'][_0xf803('0x10e')]=function(_0xbc06b1){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x10f'),_0xbc06b1[_0xf803('0x35')]));return this[_0xf803('0xe')]['noop'](_0xf803('0x10e'));};AGIVertices[_0xf803('0x10')]['ext_dial']=function(_0x3c8fd9){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x110'),_0x3c8fd9[_0xf803('0x35')]));var _0x3a35f2='';if(_0x3c8fd9[_0xf803('0x111')]){if(!this[_0xf803('0x8a')](_0x3c8fd9[_0xf803('0x111')])){return this['channel'][_0xf803('0x2a')](_0x3c8fd9,_0xf803('0x112'));}else{var _0x30c7fb=parseInt(_0x3c8fd9[_0xf803('0x111')],0xa);if(isNaN(_0x30c7fb)){_0x3a35f2=_0x3c8fd9[_0xf803('0x111')];}else{_0x3a35f2=this['getTrunk']['sync'](this,_0x3c8fd9[_0xf803('0x111')]);if(!_0x3a35f2){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x3c8fd9,_0xf803('0x113'));}}}}else if(_0x3c8fd9['trunk_name']){_0x3a35f2=_0x3c8fd9[_0xf803('0x114')];}else{return this[_0xf803('0xe')][_0xf803('0x2a')](_0x3c8fd9,_0xf803('0x112'));}var _0x2ef4ed=this[_0xf803('0xe')]['exec'](_0xf803('0xe9'),[util['format']('SIP/%s/%s',_0x3a35f2,_0x3c8fd9[_0xf803('0x44')]),_0x3c8fd9[_0xf803('0x67')],_0x3c8fd9['opts'],_0x3c8fd9[_0xf803('0x65')]]);if(_0x2ef4ed['result']===-0x1){return _0x2ef4ed;}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xec'),_0xf803('0xe9')));};AGIVertices['prototype']['finally']=function(_0x4ff0d5){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x115'),_0x4ff0d5['label']));return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x116'));};AGIVertices[_0xf803('0x10')][_0xf803('0x117')]=function(_0x466ea6){logger['info'](util[_0xf803('0xa4')](_0xf803('0x118'),_0x466ea6[_0xf803('0x35')]));if(_0x466ea6[_0xf803('0x119')]===0x0){return this[_0xf803('0xad')](_0x466ea6);}_0x466ea6[_0xf803('0x119')]-=0x1;if(!this[_0xf803('0x8a')](_0x466ea6[_0xf803('0x11a')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x466ea6,_0xf803('0x11b'));}var _0x30e007=this[_0xf803('0x1f')][_0xf803('0x73')](this,_0x466ea6[_0xf803('0x11a')]);if(!_0x30e007){return this[_0xf803('0xe')]['error'](_0x466ea6,_0xf803('0x11c'));}if(!this['isConfigured'](_0x466ea6[_0xf803('0xdf')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0xf803('0xe0'));}var _0x187e0c=this[_0xf803('0xe')][_0xf803('0x11d')](_0x30e007,_0x466ea6['response'],_0x466ea6['maxdigit']);var _0xeb03f=_0x187e0c[_0xf803('0xab')]?_0x187e0c[_0xf803('0xab')]['toString']():'';logger[_0xf803('0x2c')]('test',JSON[_0xf803('0x76')](_0x187e0c));if(_0x187e0c['result']===-0x1){this[_0xf803('0x33')][_0xf803('0x73')](this,_0x466ea6,_0xeb03f);return _0x187e0c;}else if(_0x187e0c[_0xf803('0xa9')]===_0xf803('0x67')){_0x187e0c[_0xf803('0xab')]=_0xeb03f[_0xf803('0xa1')]>=parseInt(_0x466ea6['mindigit'])?'x':'i';}else{_0x187e0c[_0xf803('0xab')]=_0xeb03f[_0xf803('0xa1')]>=parseInt(_0x466ea6['mindigit'])&&_0xeb03f[_0xf803('0xa1')]<=parseInt(_0x466ea6[_0xf803('0x11e')])?'x':'i';}var _0x3521e5=this[_0xf803('0xa8')][_0xf803('0x73')](this,_0x466ea6['variable_id']);if(!_0x3521e5){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x466ea6,_0xf803('0x11f'));}this[_0xf803('0xe')][_0xf803('0xa5')](_0x3521e5,_0xeb03f);if(this[_0xf803('0x8a')](_0x466ea6['hiddendigitsnum'])){var _0x4525f8=parseInt(_0x466ea6['hiddendigitsnum'],0xa);var _0x4df7e2=rs[_0xf803('0x120')]({'charset':'*','length':_0x4525f8});var _0x576d24=_0xeb03f['length'];if(_0x576d24>0x0){if(_0x576d24>_0x4525f8){this[_0xf803('0x33')]['sync'](this,_0x466ea6,_0x466ea6[_0xf803('0x121')]===_0xf803('0x122')?_0x4df7e2+_0xeb03f[_0xf803('0x123')](_0x4525f8):_0xeb03f[_0xf803('0x123')](0x0,_0x576d24-_0x4525f8)+_0x4df7e2);}else{this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x466ea6,rs[_0xf803('0x120')]({'charset':'*','length':_0x576d24}));}}else{this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x466ea6,'');}}else{this[_0xf803('0x33')][_0xf803('0x73')](this,_0x466ea6,_0xeb03f);}return _0x187e0c;};AGIVertices['prototype']['getsecretdigits']=function(_0x4802c5){logger[_0xf803('0x2c')](util['format'](_0xf803('0x124'),_0x4802c5[_0xf803('0x35')]));return this['getdigits'](_0x4802c5);};AGIVertices[_0xf803('0x10')][_0xf803('0x125')]=function(_0x4a1715){logger['info'](util[_0xf803('0xa4')](_0xf803('0x126'),_0x4a1715[_0xf803('0x35')]));this[_0xf803('0x33')]['sync'](this,_0x4a1715,_0x4a1715[_0xf803('0x127')]);return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x128'),_0x4a1715[_0xf803('0x127')]));};AGIVertices['prototype'][_0xf803('0x129')]=function(_0x365b3f){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x12a'),_0x365b3f[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x365b3f[_0xf803('0x12b')])||!this['isConfigured'](_0x365b3f[_0xf803('0x8d')])){return this['channel']['noop'](_0xf803('0x12c'));}if(!this[_0xf803('0x8a')](_0x365b3f['text'])){return this[_0xf803('0xe')]['noop']('no\x20text\x20configured');}this[_0xf803('0xe')]['noop'](util['format'](_0xf803('0x12d'),_0x365b3f[_0xf803('0x5b')]));var _0x88fff=this[_0xf803('0x8c')]['sync'](this,_0x365b3f);if(_0x88fff){this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('aws\x20Polly\x20%s\x20file\x20created',_0x88fff));var _0x34820d=this['channel'][_0xf803('0x10a')](_0x88fff);try{fs[_0xf803('0x12e')](_0x88fff+_0xf803('0x10b'));}catch(_0x3fe0cc){logger[_0xf803('0x2a')](_0x3fe0cc);}return _0x34820d;}return this[_0xf803('0xe')][_0xf803('0x2a')](_0x365b3f,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xf803('0x10')][_0xf803('0x12f')]=function(_0x3d5cd6){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x130'),_0x3d5cd6[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x3d5cd6[_0xf803('0x12b')])||!this[_0xf803('0x8a')](_0x3d5cd6[_0xf803('0x8d')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x12c'));}if(!this[_0xf803('0x8a')](_0x3d5cd6[_0xf803('0x93')])){return this['channel']['noop'](_0xf803('0x131'));}if(!this[_0xf803('0x8a')](_0x3d5cd6[_0xf803('0x5b')])){return this[_0xf803('0xe')][_0xf803('0xaf')]('no\x20text\x20configured');}this['channel'][_0xf803('0xf0')]=!![];this[_0xf803('0x33')](_0x3d5cd6);this[_0xf803('0x3e')](_0x3d5cd6[_0xf803('0x5b')],'in','','');this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3d5cd6[_0xf803('0x5b')]));var _0x2e5cb5=this[_0xf803('0x91')][_0xf803('0x73')](this,_0x3d5cd6);if(_0x2e5cb5){for(var _0x256c45 in _0x2e5cb5){if(_0x2e5cb5[_0xf803('0x9a')](_0x256c45)&&_[_0xf803('0x9b')](_0x2e5cb5[_0x256c45])){this['channel'][_0xf803('0xa5')](util[_0xf803('0xa4')]('AWS_LEX_%s',_0x256c45['toUpperCase']()),_0x2e5cb5[_0x256c45]);}}if(_[_0xf803('0x4c')](_0x2e5cb5['message'])){return this[_0xf803('0xe')]['noop'](_0xf803('0x132'));}else{this[_0xf803('0x3e')](_0x2e5cb5[_0xf803('0x133')],_0xf803('0xfb'),_0xf803('0x134'),'');return this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0x135'),_0x2e5cb5[_0xf803('0x133')]));}}return this['channel']['error'](_0x3d5cd6,_0xf803('0x136'));};AGIVertices['prototype']['googleasr']=function(_0xe31aab){logger[_0xf803('0x2c')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xe31aab['label'],_0xe31aab[_0xf803('0x67')]));if(!this[_0xf803('0x8a')](_0xe31aab[_0xf803('0x7d')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xef'));}var _0x5245c6=_0xf803('0x137');var _0x132863=util[_0xf803('0xa4')](_0xf803('0x138'),FILES_PATH,rs[_0xf803('0x120')](0x4));var _0x4023fb=util[_0xf803('0xa4')](_0xf803('0xa2'),_0x132863,_0x5245c6);var _0x13b043=!![];if(_0xe31aab[_0xf803('0x139')]===_0xf803('0x13a')){_0x13b043=![];}var _0x23beb9=this[_0xf803('0xe')][_0xf803('0x13b')](_0x132863,_0x5245c6,_0xe31aab[_0xf803('0x13c')],_0xe31aab[_0xf803('0x67')],undefined,_0x13b043);if(_0x23beb9[_0xf803('0xab')]!==-0x1){this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')]('google\x20%s\x20file\x20created',_0x4023fb));var _0x13967e=this[_0xf803('0x94')][_0xf803('0x73')](this,_0xe31aab,_0x4023fb);if(_0x13967e){for(var _0x136b31 in _0x13967e){if(_0x13967e[_0xf803('0x9a')](_0x136b31)){this[_0xf803('0xe')][_0xf803('0xa5')](util['format'](_0xf803('0x13d'),_0x136b31[_0xf803('0x6b')]()),_0x13967e[_0x136b31]);}}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x13e'),JSON['stringify'](_0x13967e)));}}return _0x23beb9;};AGIVertices[_0xf803('0x10')][_0xf803('0x13f')]=function(_0x56b981){logger[_0xf803('0x2c')](util[_0xf803('0xa4')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x56b981['label']));if(!this[_0xf803('0x8a')](_0x56b981[_0xf803('0x96')])){return this['channel'][_0xf803('0xaf')](_0xf803('0x140'));}if(!this[_0xf803('0x8a')](_0x56b981[_0xf803('0x141')])){return this['channel'][_0xf803('0xaf')](_0xf803('0x142'));}var _0x22dfe3='wav';var _0x5ab63f=util['format'](_0xf803('0x138'),FILES_PATH,rs[_0xf803('0x120')](0x4));var _0x27c458=util['format'](_0xf803('0xa2'),_0x5ab63f,_0x22dfe3);var _0x1e0102=!![];if(_0x56b981['beep']===_0xf803('0x13a')){_0x1e0102=![];}var _0x5b814f=this[_0xf803('0xe')][_0xf803('0x13b')](_0x5ab63f,_0x22dfe3,_0x56b981[_0xf803('0x13c')],_0x56b981[_0xf803('0x67')],undefined,_0x1e0102);if(_0x5b814f['result']!==-0x1){this['channel']['noop'](util[_0xf803('0xa4')]('tilde\x20%s\x20file\x20created',_0x27c458));var _0x454fd3=this['tildeASR'][_0xf803('0x73')](this,_0x56b981,_0x27c458);if(_0x454fd3){for(var _0x43a98f in _0x454fd3){if(_0x454fd3[_0xf803('0x9a')](_0x43a98f)){this[_0xf803('0xe')][_0xf803('0xa5')](util[_0xf803('0xa4')](_0xf803('0x143'),_0x43a98f['toUpperCase']()),_0x454fd3[_0x43a98f]);}}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x454fd3)));}}return _0x5b814f;};AGIVertices[_0xf803('0x10')][_0xf803('0x144')]=function(_0x460c38){logger[_0xf803('0x2c')](util['format'](_0xf803('0x145'),_0x460c38[_0xf803('0x35')]));return this[_0xf803('0xe')]['continueAt'](_0x460c38[_0xf803('0x146')],_0x460c38[_0xf803('0x3a')],_0x460c38[_0xf803('0x3b')]);};AGIVertices['prototype']['gotoif']=function(_0x31d1ab){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x147'),_0x31d1ab[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x31d1ab['condition'])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x31d1ab,'no\x20condition\x20configured');}try{var _0x204d6e=eval(_0x31d1ab[_0xf803('0x148')])?'true':_0xf803('0x149');this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x14a'),_0x31d1ab['condition'],_0x204d6e));return{'code':0xc8,'result':_0x204d6e};}catch(_0x21242b){return{'code':0xc8,'result':_0xf803('0x149')};}};AGIVertices[_0xf803('0x10')][_0xf803('0x14b')]=function(_0x272eb9){logger['info'](util[_0xf803('0xa4')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x272eb9[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x272eb9['interval_id'])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x272eb9,'no\x20interval\x20configured');}var _0x35a1b0=this['getIntervals'][_0xf803('0x73')](this,_0x272eb9[_0xf803('0x14c')]);if(!_0x35a1b0){return this[_0xf803('0xe')]['error'](_0x272eb9,_0xf803('0x14d'));}for(var _0x14264d=0x0;_0x14264d<_0x35a1b0[_0xf803('0xa1')];_0x14264d+=0x1){var _0x2ea4e2=this[_0xf803('0xe')][_0xf803('0xa8')](util['format']('IFTIME(%s?true:false)',_0x35a1b0[_0x14264d]));if(_0x2ea4e2['result']===-0x1){return _0x2ea4e2;}logger['info'](util[_0xf803('0xa4')]('IFTIME\x20%s\x20%s',_0x35a1b0[_0x14264d],_0x2ea4e2['extra']));if(_0x2ea4e2[_0xf803('0xa9')]===_0xf803('0x14e')){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x14f'),_0x35a1b0[_0x14264d],_0xf803('0x14e')));this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('IFTIME\x20%s\x20%s',_0x35a1b0[_0x14264d],_0xf803('0x14e')));return{'code':0xc8,'result':_0xf803('0x14e')};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x35a1b0[_0x14264d],_0xf803('0x149')));this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')]('IFTIME\x20%s\x20%s',_0x35a1b0[_0x14264d],_0xf803('0x149')));}}return{'code':0xc8,'result':_0xf803('0x149')};};AGIVertices['prototype']['hangup']=function(_0x3a7024){logger['info'](util[_0xf803('0xa4')](_0xf803('0x150'),_0x3a7024[_0xf803('0x35')]));return this[_0xf803('0xe')][_0xf803('0x151')]();};AGIVertices[_0xf803('0x10')]['ispeechasr']=function(_0x493410){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x152'),_0x493410[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x493410[_0xf803('0x7d')])){return this[_0xf803('0xe')]['noop'](_0xf803('0xef'));}var _0x3bd9ec=_0xf803('0x137');var _0x9c5282=util[_0xf803('0xa4')](_0xf803('0x138'),FILES_PATH,rs[_0xf803('0x120')](0x4));var _0x2ebd06=util[_0xf803('0xa4')](_0xf803('0xa2'),_0x9c5282,_0x3bd9ec);var _0x3226bd=!![];if(_0x493410[_0xf803('0x139')]===_0xf803('0x13a')){_0x3226bd=![];}var _0x4c1b27=this['channel']['recordFile'](_0x9c5282,_0x3bd9ec,_0x493410[_0xf803('0x13c')],_0x493410[_0xf803('0x67')],undefined,_0x3226bd);if(_0x4c1b27[_0xf803('0xab')]!==-0x1){this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')]('ispeech\x20%s\x20file\x20created',_0x2ebd06));var _0x5c33b3=this[_0xf803('0x88')]['sync'](this,_0x493410,_0x2ebd06);if(_0x5c33b3){for(var _0x25547f in _0x5c33b3){if(_0x5c33b3[_0xf803('0x9a')](_0x25547f)){this[_0xf803('0xe')]['setVariable'](util['format'](_0xf803('0x153'),_0x25547f['toUpperCase']()),_0x5c33b3[_0x25547f]);}}return this['channel'][_0xf803('0xaf')](util['format'](_0xf803('0x154'),JSON['stringify'](_0x5c33b3)));}}return _0x4c1b27;};AGIVertices[_0xf803('0x10')]['ispeechtts']=function(_0x2d9348){logger['info'](util[_0xf803('0xa4')](_0xf803('0x155'),_0x2d9348[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x2d9348[_0xf803('0x7d')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xef'));}if(!this[_0xf803('0x8a')](_0x2d9348[_0xf803('0x5b')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xb0'));}this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0x156'),_0x2d9348[_0xf803('0x5b')]));var _0x56494d=this[_0xf803('0x85')][_0xf803('0x73')](this,_0x2d9348);if(_0x56494d){this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('ispeech\x20%s\x20file\x20created',_0x56494d));var _0x3a04a3=this[_0xf803('0xe')][_0xf803('0x10a')](_0x56494d,_0x2d9348['intKey']);try{fs[_0xf803('0x12e')](_0x56494d+_0xf803('0x10b'));}catch(_0x17ea80){logger[_0xf803('0x2a')](_0x17ea80);}return _0x3a04a3;}return this[_0xf803('0xe')]['error'](_0x2d9348,_0xf803('0x157'));};AGIVertices[_0xf803('0x10')][_0xf803('0x158')]=function(_0x53d958){logger[_0xf803('0x2c')](util['format'](_0xf803('0x159'),_0x53d958[_0xf803('0x35')]));if(!this['isConfigured'](_0x53d958[_0xf803('0x15a')])){return this[_0xf803('0xe')]['error'](_0x53d958,'no\x20find\x20by\x20configured');}logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x15b'),this[_0xf803('0xe')][_0xf803('0x37')],_0x53d958[_0xf803('0x15a')]));var _0x520a7a=this[_0xf803('0x53')]['sync'](this,_0x53d958['findBy']);if(_0x520a7a){logger[_0xf803('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf803('0xe')][_0xf803('0x37')],_0x53d958['findBy']));this[_0xf803('0xe')][_0xf803('0xaf')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf803('0xe')][_0xf803('0x37')],_0x53d958[_0xf803('0x15a')]));return{'code':0xc8,'result':_0xf803('0x15c')};}else{logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x15d'),this[_0xf803('0xe')][_0xf803('0x37')],_0x53d958[_0xf803('0x15a')]));this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0x15d'),this[_0xf803('0xe')][_0xf803('0x37')],_0x53d958[_0xf803('0x15a')]));return{'code':0xc8,'result':_0xf803('0x15e')};}};AGIVertices[_0xf803('0x10')][_0xf803('0x15f')]=function(_0xa5d18){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x160'),_0xa5d18[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0xa5d18[_0xf803('0x15a')])){return this['channel']['error'](_0xa5d18,_0xf803('0x161'));}logger[_0xf803('0x2c')](util[_0xf803('0xa4')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf803('0xe')][_0xf803('0x37')],_0xa5d18[_0xf803('0x15a')]));var _0x49565f=this[_0xf803('0x4f')]['sync'](this,_0xa5d18[_0xf803('0x15a')]);if(_0x49565f){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x162'),this[_0xf803('0xe')][_0xf803('0x37')],_0xa5d18[_0xf803('0x15a')]));this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x162'),this['channel'][_0xf803('0x37')],_0xa5d18[_0xf803('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger[_0xf803('0x2c')](util['format'](_0xf803('0x15d'),this['channel'][_0xf803('0x37')],_0xa5d18[_0xf803('0x15a')]));this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf803('0xe')][_0xf803('0x37')],_0xa5d18[_0xf803('0x15a')]));return{'code':0xc8,'result':_0xf803('0x15e')};}};AGIVertices[_0xf803('0x10')]['math']=function(_0x5cfd02){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x163'),_0x5cfd02[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x5cfd02[_0xf803('0x164')])){return this[_0xf803('0xe')]['error'](_0x5cfd02,'no\x20operation\x20configured');}this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x165'),_0x5cfd02['operation']));var _0x5f3cbc=eval(_0x5cfd02[_0xf803('0x164')]);if(!this['isConfigured'](_0x5cfd02[_0xf803('0xdf')])){return this[_0xf803('0xe')]['noop'](_0xf803('0xe0'));}var _0x2966db=this[_0xf803('0xa8')]['sync'](this,_0x5cfd02[_0xf803('0xdf')]);if(!_0x2966db){return this[_0xf803('0xe')]['error'](_0x5cfd02,'no\x20variable\x20found');}if(_['isArray'](_0x5f3cbc)){var _0x25d40b=this;_0x5f3cbc['forEach'](function(_0x1e4586,_0x50c54d){_0x25d40b['channel'][_0xf803('0xa5')](util['format']('%s[%s]',_0x2966db,_0x50c54d),_0x1e4586);});return this[_0xf803('0xe')][_0xf803('0xaf')](util['format']('variable\x20%s[key]\x20set',_0x2966db));}else{return this['channel'][_0xf803('0xa5')](_0x2966db,_0x5f3cbc);}};AGIVertices[_0xf803('0x10')]['menu']=function(_0x13df90){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x166'),_0x13df90[_0xf803('0x35')]));if(_0x13df90[_0xf803('0x119')]===0x0){return this[_0xf803('0xad')](_0x13df90);}_0x13df90[_0xf803('0x119')]-=0x1;if(!this[_0xf803('0x8a')](_0x13df90[_0xf803('0x11a')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x13df90,'no\x20file\x20audio\x20selected');}var _0x1190f4=this[_0xf803('0x1f')][_0xf803('0x73')](this,_0x13df90['file_id']);if(!_0x1190f4){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x13df90,_0xf803('0x11c'));}var _0x2294e2=this[_0xf803('0xe')][_0xf803('0x11d')](_0x1190f4,_0x13df90[_0xf803('0x167')],_0x13df90['digit']);var _0x1e8ac6=_0x2294e2[_0xf803('0xab')];if(_0x2294e2[_0xf803('0xab')]===-0x1){this[_0xf803('0x33')][_0xf803('0x73')](this,_0x13df90,'-1');return _0x2294e2;}else if(_0x2294e2[_0xf803('0xa9')]===_0xf803('0x67')){_0x2294e2['result']=_0x2294e2[_0xf803('0xab')][_0xf803('0xa1')]>0x0?_0x2294e2[_0xf803('0xab')]:'t';}else if(_['isEmpty'](_0x2294e2[_0xf803('0xab')])){_0x2294e2['result']='#';_0x1e8ac6='#';}if(!this[_0xf803('0x8a')](_0x13df90[_0xf803('0xdf')])){this[_0xf803('0xe')]['noop'](_0xf803('0xe0'));}else{var _0x22968f=this['getVariable']['sync'](this,_0x13df90['variable_id']);if(!_0x22968f){return this['channel']['error'](_0x13df90,_0xf803('0x11f'));}this[_0xf803('0xe')][_0xf803('0xa5')](_0x22968f,_0x1e8ac6);}this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x13df90,_0x1e8ac6);return _0x2294e2;};AGIVertices[_0xf803('0x10')][_0xf803('0xaf')]=function(_0x233e80){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x168'),_0x233e80[_0xf803('0x35')]));return this['channel'][_0xf803('0xaf')](_0x233e80[_0xf803('0x169')]||_0x233e80[_0xf803('0x35')]);};AGIVertices[_0xf803('0x10')]['pause']=function(_0x585a81){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x16a'),_0x585a81['label']));if(!this[_0xf803('0x8a')](_0x585a81[_0xf803('0x15a')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x585a81,_0xf803('0x161'));}logger['info'](util[_0xf803('0xa4')](_0xf803('0x15b'),this[_0xf803('0xe')]['callerid'],_0x585a81[_0xf803('0x15a')]));var _0xf25ad5=this[_0xf803('0x4a')][_0xf803('0x73')](this,_0x585a81[_0xf803('0x16b')]);var _0x16dee8=this[_0xf803('0x4b')][_0xf803('0x73')](this,_0x585a81['findBy'],_0xf25ad5);if(_0x16dee8){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x162'),this[_0xf803('0xe')][_0xf803('0x37')],_0x585a81[_0xf803('0x15a')]));this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x162'),this['channel'][_0xf803('0x37')],_0x585a81[_0xf803('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xf803('0xa4')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf803('0xe')][_0xf803('0x37')],_0x585a81[_0xf803('0x15a')]));this['channel'][_0xf803('0xaf')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf803('0xe')][_0xf803('0x37')],_0x585a81['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xf803('0x16c')]=function(_0x1d97e6){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x16d'),_0x1d97e6[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x1d97e6[_0xf803('0x11a')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x1d97e6,_0xf803('0x11b'));}var _0x3d88e5=this['getSound'][_0xf803('0x73')](this,_0x1d97e6[_0xf803('0x11a')]);if(!_0x3d88e5){return this['channel'][_0xf803('0x2a')](_0x1d97e6,'no\x20file\x20audio\x20found');}var _0x3bf769=this['channel'][_0xf803('0x55')](_0xf803('0x16e'),[_0x3d88e5,_0x1d97e6['opts']]);if(_0x3bf769[_0xf803('0xab')]===-0x1){return _0x3bf769;}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0xc7'),_0xf803('0x16e'),_0x3d88e5));};AGIVertices[_0xf803('0x10')][_0xf803('0x16f')]=function(_0x447c52){logger[_0xf803('0x2c')](util[_0xf803('0xa4')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x447c52[_0xf803('0x35')]));if(!this['isConfigured'](_0x447c52['queue_id'])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x447c52,_0xf803('0x170'));}var _0x422ad6='';var _0x484a8b=parseInt(_0x447c52[_0xf803('0x171')],0xa);if(isNaN(_0x484a8b)){_0x422ad6=_0x447c52[_0xf803('0x171')];}else{_0x422ad6=this[_0xf803('0x15')][_0xf803('0x73')](this,_0x447c52[_0xf803('0x171')]);if(!_0x422ad6){return this['channel'][_0xf803('0x2a')](_0x447c52,_0xf803('0x172'));}}var _0x163d47='';if(this['isConfigured'](_0x447c52['file_id'])){var _0x26ff1a=this[_0xf803('0x1f')][_0xf803('0x73')](this,_0x447c52['file_id']);if(_0x26ff1a){_0x163d47=_0x26ff1a;}}this[_0xf803('0x33')][_0xf803('0x73')](this,_0x447c52,_0x422ad6);if(_0x447c52[_0xf803('0xeb')]['indexOf']('x')<0x0){_0x447c52['opts']+='x';}if(_0x447c52[_0xf803('0xeb')][_0xf803('0x173')]('X')<0x0){_0x447c52[_0xf803('0xeb')]+='X';}this[_0xf803('0xe')][_0xf803('0xa5')](_0xf803('0x174'),_0x422ad6?_0x422ad6[_0xf803('0x175')]():'');var _0x113f5d=this[_0xf803('0xe')][_0xf803('0x55')]('QUEUE',[_0x422ad6,_0x447c52[_0xf803('0xeb')],_0x447c52[_0xf803('0x65')],_0x163d47,_0x447c52[_0xf803('0x67')],_0x447c52[_0xf803('0x7')],_0x447c52[_0xf803('0x176')],_0x447c52['gosub'],'',_0x447c52[_0xf803('0x177')]]);if(_0x113f5d['result']===-0x1){return _0x113f5d;}return this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0xc7'),_0xf803('0x178'),_0x422ad6));};AGIVertices[_0xf803('0x10')]['record']=function(_0x54f470){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x179'),_0x54f470[_0xf803('0x35')]));var _0x19d2a0=_0x54f470[_0xf803('0x17a')]||_0xf803('0x137');var _0x579cf5=util['format'](_0xf803('0x17b'),this[_0xf803('0xe')]['uniqueid'],rs[_0xf803('0x120')](0x5));var _0x159a5a=util[_0xf803('0xa4')](_0xf803('0x17c'),FILES_PATH,_0x579cf5,_0x19d2a0);var _0x16dee0=util[_0xf803('0xa4')](_0xf803('0x138'),FILES_PATH,_0x579cf5);this[_0xf803('0x38')]['sync'](this,_0x54f470,_0x579cf5,_0x159a5a);this['channel'][_0xf803('0xa5')]('RECORDING_SAVENAME',_0x579cf5);logger[_0xf803('0x2c')](_0xf803('0x17d'),_0x16dee0,_0x19d2a0,_0x54f470['escape_digits'],_0x54f470[_0xf803('0x67')]);return this['channel'][_0xf803('0x13b')](_0x16dee0,_0x19d2a0,_0x54f470[_0xf803('0x17e')],_0x54f470['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x9c896c){logger['info'](util[_0xf803('0xa4')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x9c896c[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x9c896c['url'])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x17f'));}var _0xb959e3=this['restAPI'][_0xf803('0x73')](this,_0x9c896c);logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x180'),util[_0xf803('0x181')](_0xb959e3,{'showHidden':![],'depth':null})));if(!this[_0xf803('0x8a')](_0x9c896c[_0xf803('0xdf')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x182'));}var _0x3844d2=this[_0xf803('0xa8')]['sync'](this,_0x9c896c[_0xf803('0xdf')]);if(!_0x3844d2){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x9c896c,_0xf803('0x11f'));}this[_0xf803('0xe')][_0xf803('0xa5')](util[_0xf803('0xa4')]('%s_STATUS_CODE',_0x3844d2),_0xb959e3[_0xf803('0x78')]?_0xb959e3['statusCode']:_0xf803('0x183'));this[_0xf803('0xe')]['setVariable'](util['format'](_0xf803('0x184'),_0x3844d2),_0xb959e3[_0xf803('0x79')]?_0xb959e3[_0xf803('0x79')]:'OK');if(_0xb959e3['body']){try{this[_0xf803('0xa3')](_0xb959e3[_0xf803('0x6c')],_0x3844d2);}catch(_0x4520cb){logger[_0xf803('0x2a')](util[_0xf803('0xa4')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3844d2));}}return this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('variable\x20%s\x20set',_0x3844d2));};AGIVertices[_0xf803('0x10')]['saydigits']=function(_0x1a5ec3){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x185'),_0x1a5ec3[_0xf803('0x35')]));return this['channel']['sayDigits'](_0x1a5ec3[_0xf803('0x186')][_0xf803('0x57')](/\s+/g,''),_0x1a5ec3[_0xf803('0x17e')]);};AGIVertices[_0xf803('0x10')][_0xf803('0x187')]=function(_0x342c55){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x188'),_0x342c55['label']));return this[_0xf803('0xe')]['sayNumber'](_0x342c55['number']['replace'](/\s+/g,''),_0x342c55[_0xf803('0x17e')]);};AGIVertices[_0xf803('0x10')][_0xf803('0x189')]=function(_0x4182b1){logger['info'](util[_0xf803('0xa4')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4182b1['label']));return this['channel'][_0xf803('0x18a')](_0x4182b1[_0xf803('0x5b')],_0x4182b1[_0xf803('0x17e')]);};AGIVertices[_0xf803('0x10')][_0xf803('0x18b')]=function(_0x531773){logger[_0xf803('0x2c')](util['format'](_0xf803('0x18c'),_0x531773['label']));if(!this[_0xf803('0x8a')](_0x531773[_0xf803('0x18d')])){return this[_0xf803('0xe')]['noop'](_0xf803('0x18e'));}var _0x4c170f=this[_0xf803('0x18f')]['sync'](this,_0x531773[_0xf803('0x18d')]);if(!_0x4c170f||!_0x4c170f['Smtp']){return this['channel']['error'](_0x531773,_0xf803('0x190'));}var _0x3914e6={'from':util['format']('\x22%s\x22\x20<%s>',_0x4c170f[_0xf803('0x17')],_0x4c170f[_0xf803('0x191')]||_0x4c170f[_0xf803('0x192')]['user']),'to':_0x531773['to']||'','cc':_0x531773['cc']||'','bcc':_0x531773[_0xf803('0x193')]||'','subject':_0x531773[_0xf803('0x194')],'html':_0x531773[_0xf803('0x5b')],'text':_0x531773[_0xf803('0x5b')]};if(this['isConfigured'](_0x531773[_0xf803('0x195')])){}logger['debug'](_0xf803('0x196'),JSON[_0xf803('0x76')](_0x3914e6));this[_0xf803('0x33')][_0xf803('0x73')](this,_0x531773,_0x531773[_0xf803('0x18d')]);this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x197'),_0x4c170f[_0xf803('0x17')]));this['sendMailMessage']['sync'](this,_0x4c170f[_0xf803('0x198')],_0x3914e6);return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x199'));};AGIVertices[_0xf803('0x10')][_0xf803('0x19a')]=function(_0x20b8e3){logger['info'](util[_0xf803('0xa4')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x20b8e3[_0xf803('0x35')]));return this['channel'][_0xf803('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0xf803('0x19b')]=function(_0x24ca5d){logger[_0xf803('0x2c')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x24ca5d[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x24ca5d[_0xf803('0x19c')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x19d'));}var _0x5c31c7=this[_0xf803('0x19e')][_0xf803('0x73')](this,_0x24ca5d[_0xf803('0x19c')]);if(!_0x5c31c7){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x24ca5d,'no\x20sms\x20account\x20found');}var _0x37b832={'body':_0x24ca5d[_0xf803('0x19f')],'phone':_0x24ca5d['to']||'','SmsAccountId':_0x5c31c7['id']};logger[_0xf803('0x1a0')](_0xf803('0x1a1'),JSON['stringify'](_0x37b832));this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x24ca5d,_0x24ca5d[_0xf803('0x19c')]);this[_0xf803('0xe')][_0xf803('0xaf')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5c31c7[_0xf803('0x17')]));this[_0xf803('0x32')][_0xf803('0x73')](this,_0x37b832);return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x1a2'));};AGIVertices[_0xf803('0x10')][_0xf803('0x1a3')]=function(_0x62ed15){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x62ed15[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x62ed15[_0xf803('0xdf')])){return this[_0xf803('0xe')]['error'](_0x62ed15,_0xf803('0x1a4'));}var _0x5ab5de=this['getVariable'][_0xf803('0x73')](this,_0x62ed15['variable_id']);if(!_0x5ab5de){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x62ed15,_0xf803('0x11f'));}return this[_0xf803('0xe')][_0xf803('0xa5')](_0x5ab5de,_0x62ed15['variable_value']);};AGIVertices[_0xf803('0x10')][_0xf803('0x1a5')]=function(_0x2cd839){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x1a6'),_0x2cd839['label']));this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x1a7'));if(_0x2cd839['answer']===_0xf803('0x1a8')){this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x1a9'));return this[_0xf803('0xe')][_0xf803('0xbd')]();}return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x1aa'));};AGIVertices[_0xf803('0x10')][_0xf803('0x1ab')]=function(_0x330a35){logger['info'](util[_0xf803('0xa4')](_0xf803('0x1ac'),_0x330a35[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x330a35[_0xf803('0x1ad')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x330a35,_0xf803('0x1ae'));}var _0x3b1f89=this[_0xf803('0x18')]['sync'](this,_0x330a35['project_id']);if(!this['isConfigured'](_0x3b1f89)){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x330a35,util[_0xf803('0xa4')](_0xf803('0x1af'),_0x330a35[_0xf803('0x1ad')]));}if(_0x3b1f89===this[_0xf803('0xe')]['arg_1']){return this['channel']['error'](_0x330a35,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xf803('0x33')][_0xf803('0x73')](this,_0x330a35,_0x3b1f89);var _0x1fac7a=this[_0xf803('0xe')][_0xf803('0x55')](_0xf803('0x1b0'),util[_0xf803('0xa4')](_0xf803('0x1b1'),config[_0xf803('0x7')]['host']||_0xf803('0x1b2'),_0x3b1f89,this['channel'][_0xf803('0x36')]));if(_0x1fac7a[_0xf803('0xab')]===-0x1){return _0x1fac7a;}return this['channel'][_0xf803('0xaf')](util['format'](_0xf803('0xc7'),_0xf803('0x1b0'),_0x3b1f89));};AGIVertices[_0xf803('0x10')]['system']=function(_0x2b28c2){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x1b3'),_0x2b28c2[_0xf803('0x35')]));var _0x48d336=this[_0xf803('0x54')][_0xf803('0x73')](this,_0x2b28c2[_0xf803('0xba')]);this['createSquareDetailsReport'][_0xf803('0x73')](this,_0x2b28c2,_0x2b28c2[_0xf803('0xba')]);if(this[_0xf803('0x8a')](_0x2b28c2[_0xf803('0xdf')])){var _0xdc16cf=this[_0xf803('0xa8')][_0xf803('0x73')](this,_0x2b28c2[_0xf803('0xdf')]);if(_0xdc16cf){this[_0xf803('0xe')][_0xf803('0xa5')](_0xdc16cf,_0x48d336);return this['channel']['noop'](util[_0xf803('0xa4')](_0xf803('0x1b4'),_0x2b28c2[_0xf803('0xba')],_0xdc16cf));}}return this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2b28c2['command']));};AGIVertices[_0xf803('0x10')][_0xf803('0x1b5')]=function(_0x45d961){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x1b6'),_0x45d961['label']));_0x45d961[_0xf803('0x5b')]=_0x45d961[_0xf803('0x5b')][_0xf803('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf803('0x8a')](_0x45d961[_0xf803('0x59')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0x1b7'));}if(!this[_0xf803('0x8a')](_0x45d961[_0xf803('0x5b')])){return this[_0xf803('0xe')][_0xf803('0xaf')](_0xf803('0xb0'));}this[_0xf803('0xe')]['noop'](util[_0xf803('0xa4')](_0xf803('0x1b8'),_0x45d961[_0xf803('0x5b')]));var _0xb919ee=this['googleCloudTTS'][_0xf803('0x73')](this,_0x45d961);if(_0xb919ee){this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x1b9'),_0xb919ee));var _0x8ff1e=this['channel'][_0xf803('0x10a')](_0xb919ee);try{fs[_0xf803('0x12e')](_0xb919ee+_0xf803('0x10b'));}catch(_0x2c2ff0){logger['error'](_0x2c2ff0);}return _0x8ff1e;}return this[_0xf803('0xe')][_0xf803('0x2a')](_0x45d961,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x4ca9e6){logger[_0xf803('0x2c')](util['format'](_0xf803('0x1ba'),_0x4ca9e6['label']));_0x4ca9e6[_0xf803('0x5b')]=_0x4ca9e6[_0xf803('0x5b')][_0xf803('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf803('0x8a')](_0x4ca9e6[_0xf803('0x5b')])){return this[_0xf803('0xe')][_0xf803('0xaf')]('no\x20text\x20configured');}this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')]('Trying\x20Google\x20TTS\x20%s',_0x4ca9e6[_0xf803('0x5b')]));var _0x1e26cd=this[_0xf803('0x62')][_0xf803('0x73')](this,_0x4ca9e6);if(_0x1e26cd){this['channel']['noop'](util['format'](_0xf803('0x1bb'),_0x1e26cd));var _0x84b166=this[_0xf803('0xe')][_0xf803('0x10a')](_0x1e26cd);try{fs['unlink'](_0x1e26cd+_0xf803('0x10b'));}catch(_0x5a2a78){logger[_0xf803('0x2a')](_0x5a2a78);}return _0x84b166;}return this[_0xf803('0xe')]['error'](_0x4ca9e6,_0xf803('0x1bc'));};AGIVertices[_0xf803('0x10')][_0xf803('0x1bd')]=function(_0x11ae8e){logger[_0xf803('0x2c')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x11ae8e[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x11ae8e['findBy'])){return this['channel']['error'](_0x11ae8e,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf803('0xa4')](_0xf803('0x15b'),this[_0xf803('0xe')]['callerid'],_0x11ae8e[_0xf803('0x15a')]));var _0x5318b5=this['agentUnpause']['sync'](this,_0x11ae8e[_0xf803('0x15a')]);if(_0x5318b5){logger[_0xf803('0x2c')](util['format'](_0xf803('0x162'),this[_0xf803('0xe')]['callerid'],_0x11ae8e[_0xf803('0x15a')]));this[_0xf803('0xe')][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x162'),this['channel']['callerid'],_0x11ae8e['findBy']));return{'code':0xc8,'result':_0xf803('0x15c')};}else{logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x15d'),this[_0xf803('0xe')][_0xf803('0x37')],_0x11ae8e[_0xf803('0x15a')]));this['channel'][_0xf803('0xaf')](util[_0xf803('0xa4')](_0xf803('0x15d'),this['channel'][_0xf803('0x37')],_0x11ae8e[_0xf803('0x15a')]));return{'code':0xc8,'result':_0xf803('0x15e')};}};AGIVertices[_0xf803('0x10')][_0xf803('0x1be')]=function(_0x2dd63b){logger[_0xf803('0x2c')](util[_0xf803('0xa4')](_0xf803('0x1bf'),_0x2dd63b[_0xf803('0x35')]));var _0x14fae7=this[_0xf803('0xe')]['exec']('VOICEMAIL',[_0x2dd63b[_0xf803('0x1c0')],_0x2dd63b['options']]);if(_0x14fae7[_0xf803('0xab')]===-0x1){return _0x14fae7;}return this[_0xf803('0xe')][_0xf803('0xaf')](util['format'](_0xf803('0xc7'),'VOICEMAIL',_0x2dd63b[_0xf803('0x1c0')]));};AGIVertices[_0xf803('0x10')][_0xf803('0x1c1')]=function(_0x12d490){logger['info'](util['format'](_0xf803('0x1c2'),_0x12d490[_0xf803('0x35')]));if(!this[_0xf803('0x8a')](_0x12d490[_0xf803('0xdf')])){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x12d490,_0xf803('0x1a4'));}var _0xd9e08a=this[_0xf803('0xa8')][_0xf803('0x73')](this,_0x12d490[_0xf803('0xdf')]);if(!_0xd9e08a){return this[_0xf803('0xe')][_0xf803('0x2a')](_0x12d490,_0xf803('0x11f'));}var _0x25b2b2=this[_0xf803('0xe')]['getVariable'](_0xd9e08a);return{'code':0xc8,'result':_0x25b2b2[_0xf803('0xa9')]?_0x25b2b2[_0xf803('0xa9')]:'-'};};String[_0xf803('0x10')][_0xf803('0xa7')]=function(_0x353af9,_0x33bf16){return this[_0xf803('0xa6')](_0x353af9)[_0xf803('0x1c3')](_0x33bf16);};module[_0xf803('0x1c4')]=AGIVertices; \ No newline at end of file +var _0xbc8b=['en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','includes','POST','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','delay','add','minutes','callback_priority','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','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','bot','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','math','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','no\x20subproject\x20selected','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','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode'];(function(_0x36103d,_0x3453b9){var _0x4edadd=function(_0x1b6e64){while(--_0x1b6e64){_0x36103d['push'](_0x36103d['shift']());}};_0x4edadd(++_0x3453b9);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xbc8b[_0x5471ec];return _0x121d4c;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xbbc8('0x0'));var sh=require('shelljs');var odbc=require(_0xbbc8('0x1'))();var rs=require(_0xbbc8('0x2'));var moment=require(_0xbbc8('0x3'));var Mustache=require(_0xbbc8('0x4'));var rp=require(_0xbbc8('0x5'));var logger=require(_0xbbc8('0x6'))('agi');var config=require(_0xbbc8('0x7'));var shared=require(_0xbbc8('0x8'));var scripts=require(_0xbbc8('0x9'));var FILES_PATH=_0xbbc8('0xa');var recursiveMapAttributes=[_0xbbc8('0xb'),'rawBody'];var verticesWithRetry=[_0xbbc8('0xc'),_0xbbc8('0xd'),'getsecretdigits'];var AGIVertices=function(_0x1997ca,_0x167b2b,_0x255dd2){this[_0xbbc8('0xe')]=_0x1997ca;this[_0xbbc8('0xf')]=_0x167b2b;this[_0xbbc8('0x10')]=_0x255dd2;};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x12')]=function(_0x1c021f,_0x11ad4a){this[_0xbbc8('0xf')][_0xbbc8('0x13')](_0x1c021f)['then'](function(_0x2408c){_0x11ad4a(null,_0x2408c?_0x2408c[_0xbbc8('0x14')]:![]);})[_0xbbc8('0x15')](function(_0x55b386){_0x11ad4a(_0x55b386);});};AGIVertices['prototype'][_0xbbc8('0x16')]=function(_0x48a1ee,_0x290045){this[_0xbbc8('0xf')][_0xbbc8('0x17')](_0x48a1ee)[_0xbbc8('0x18')](function(_0x260665){_0x290045(null,_0x260665?_0x260665[_0xbbc8('0x14')]:![]);})[_0xbbc8('0x15')](function(_0x1cd58e){_0x290045(_0x1cd58e);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x19')]=function(_0x21d1c1,_0x2438f){this[_0xbbc8('0xf')][_0xbbc8('0x1a')](_0x21d1c1)['then'](function(_0xc9a328){_0x2438f(null,_0xc9a328?_0xc9a328[_0xbbc8('0x14')]:![]);})[_0xbbc8('0x15')](function(_0x291abf){_0x2438f(_0x291abf);});};AGIVertices['prototype'][_0xbbc8('0x1b')]=function(_0x4f754f,_0xc5ea1e){this[_0xbbc8('0xf')]['getSquareOdbcById'](_0x4f754f)[_0xbbc8('0x18')](function(_0x1f7576){_0xc5ea1e(null,_0x1f7576?_0x1f7576[_0xbbc8('0x1c')]:![]);})[_0xbbc8('0x15')](function(_0x1ec180){_0xc5ea1e(_0x1ec180);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1d')]=function(_0x58d198,_0x14af5b){this['rpc'][_0xbbc8('0x1e')](_0x58d198)[_0xbbc8('0x18')](function(_0x3f22f2){_0x14af5b(null,_0x3f22f2?_0x3f22f2[_0xbbc8('0x14')]:![]);})[_0xbbc8('0x15')](function(_0x521c11){_0x14af5b(_0x521c11);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1f')]=function(_0x572940,_0x509532){this['rpc'][_0xbbc8('0x20')](_0x572940)[_0xbbc8('0x18')](function(_0xe6be9d){_0x509532(null,_0xe6be9d?_0xe6be9d[_0xbbc8('0x14')]:![]);})[_0xbbc8('0x15')](function(_0x15fd05){_0x509532(_0x15fd05);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x21')]=function(_0x5bf78e,_0x226028){var _0xcfa11b=this;this[_0xbbc8('0xf')]['getSoundById'](_0x5bf78e)[_0xbbc8('0x18')](function(_0x239e64){_0x226028(null,_0x239e64?_0xcfa11b['getSoundPath'](_0x239e64[_0xbbc8('0x22')]):![]);})['catch'](function(_0x57cc7e){_0x226028(_0x57cc7e);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x23')]=function(_0xec7e05,_0x4308eb){this[_0xbbc8('0xf')][_0xbbc8('0x24')](_0xec7e05)['then'](function(_0x4ff2a4){_0x4308eb(null,_0x4ff2a4?_0x4ff2a4:![]);})[_0xbbc8('0x15')](function(_0x402b9f){_0x4308eb(_0x402b9f);});};AGIVertices[_0xbbc8('0x11')]['sendMailMessage']=function(_0x296cfc,_0x2db1ea,_0x42a658){this[_0xbbc8('0x10')][_0xbbc8('0x25')](_0x296cfc,_0x2db1ea)[_0xbbc8('0x18')](function(){_0x42a658(null);})[_0xbbc8('0x15')](function(_0x13ee08){_0x42a658(_0x13ee08);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x26')]=function(_0x29ee66,_0x5421ab){this[_0xbbc8('0xf')][_0xbbc8('0x27')](_0x29ee66)[_0xbbc8('0x18')](function(_0x38dd14){if(_0x38dd14){if(_0x38dd14[_0xbbc8('0x28')]){_0x5421ab(null,[_0x38dd14[_0xbbc8('0x29')]]);}else{_0x5421ab(null,_[_0xbbc8('0x2a')](_0x38dd14[_0xbbc8('0x2b')],_0xbbc8('0x29')));}}else{_0x5421ab(null,![]);}})[_0xbbc8('0x15')](function(_0x54b8d2){_0x5421ab(_0x54b8d2);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x2c')]=function(_0x262326){return util[_0xbbc8('0x2d')](_0xbbc8('0x2e'),FILES_PATH,_0x262326);};AGIVertices[_0xbbc8('0x11')]['getQueryOdbc']=function(_0x407339,_0x45745f,_0x373b59){odbc[_0xbbc8('0x2f')](_0x407339,function(_0x498a16){if(_0x498a16){logger[_0xbbc8('0x30')](_0xbbc8('0x31'),_0x498a16);_0x373b59(_0x498a16);}else{logger[_0xbbc8('0x32')](_0xbbc8('0x33'));odbc[_0xbbc8('0x34')](_0x45745f,function(_0x491e4d,_0x1e92ee){if(_0x491e4d){logger[_0xbbc8('0x32')](_0xbbc8('0x35'),_0x45745f);_0x373b59(_0x491e4d);}else{logger[_0xbbc8('0x32')]('Query\x20executed\x20correctly\x20%s',_0x45745f);odbc['close'](function(_0x1e759a){if(_0x1e759a){logger['error'](_0xbbc8('0x36'),_0x1e759a);}_0x373b59(null,_0x1e92ee);});}});}});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x37')]=function(_0x5ed5d2,_0x12bbd5){this['rpc']['getSmsAccountById'](_0x5ed5d2)[_0xbbc8('0x18')](function(_0x37e803){_0x12bbd5(null,_0x37e803?_0x37e803:![]);})['catch'](function(_0x376513){_0x12bbd5(_0x376513);});};AGIVertices[_0xbbc8('0x11')]['createSmsMessage']=function(_0x3fa3c1,_0x2abe67){this[_0xbbc8('0xf')]['createSmsMessage'](_0x3fa3c1)[_0xbbc8('0x18')](function(_0x76fe62){_0x2abe67(null,_0x76fe62);})[_0xbbc8('0x15')](function(_0x4852a4){_0x2abe67(_0x4852a4);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x38')]=function(_0x3dd5f6,_0x3d6405,_0xdf92){this[_0xbbc8('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xbbc8('0xe')][_0xbbc8('0x39')],'node':_0x3dd5f6['label'],'application':_0x3dd5f6[_0xbbc8('0x3a')],'data':_0x3d6405||null,'project_name':this[_0xbbc8('0xe')][_0xbbc8('0x3b')],'callerid':this['channel'][_0xbbc8('0x3c')]})[_0xbbc8('0x18')](function(_0xee4993){if(_0xdf92){_0xdf92(null,_0xee4993);}})['catch'](function(_0x1ae7db){if(_0xdf92){_0xdf92(_0x1ae7db);}});};AGIVertices['prototype'][_0xbbc8('0x3d')]=function(_0xb51a71,_0x24469a,_0x4a7383,_0x248046){this[_0xbbc8('0xf')][_0xbbc8('0x3d')]({'uniqueid':this['channel'][_0xbbc8('0x39')],'callerid':this[_0xbbc8('0xe')][_0xbbc8('0x3c')],'calleridname':this[_0xbbc8('0xe')][_0xbbc8('0x3e')],'context':this['channel'][_0xbbc8('0x3f')],'extension':this['channel'][_0xbbc8('0x40')],'priority':this[_0xbbc8('0xe')]['priority'],'accountcode':this['channel'][_0xbbc8('0x41')],'dnid':this['channel'][_0xbbc8('0x42')],'projectName':this[_0xbbc8('0xe')][_0xbbc8('0x3b')],'saveName':_0x24469a,'filename':_0xb51a71[_0xbbc8('0x43')]||_0x24469a,'savePath':_0x4a7383})[_0xbbc8('0x18')](function(_0x3d3a3a){_0x248046(null,_0x3d3a3a);})[_0xbbc8('0x15')](function(_0x4f6a96){_0x248046(_0x4f6a96);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x44')]=function(_0x4a5bf6,_0x4ab22c,_0x5b8701,_0x4bd7dd,_0x1556e){this[_0xbbc8('0xf')][_0xbbc8('0x44')]({'uniqueid':this[_0xbbc8('0xe')][_0xbbc8('0x39')],'body':_0x4a5bf6,'direction':_0x4ab22c,'providerName':_0x5b8701,'providerResponse':_0x4bd7dd})[_0xbbc8('0x18')](function(_0xc0feec){if(_0x1556e){_0x1556e(null,_0xc0feec);}})[_0xbbc8('0x15')](function(_0x253944){if(_0x1556e){_0x1556e(_0x253944);}});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x45')]=function(_0x4a52da,_0x44510b){this[_0xbbc8('0xf')][_0xbbc8('0x45')]({'firstName':_[_0xbbc8('0x46')](_0x4a52da[_0xbbc8('0x14')])||_[_0xbbc8('0x47')](_0x4a52da[_0xbbc8('0x14')])?_0xbbc8('0x48')+Math['random']():_0x4a52da[_0xbbc8('0x14')],'lastName':_[_0xbbc8('0x46')](_0x4a52da[_0xbbc8('0x49')])||_[_0xbbc8('0x47')](_0x4a52da[_0xbbc8('0x49')])?null:_0x4a52da['lastName'],'phone':_0x4a52da[_0xbbc8('0x4a')],'ListId':_0x4a52da['list_id'],'scheduledat':_0x4a52da[_0xbbc8('0x4b')],'callbackUniqueid':this[_0xbbc8('0xe')][_0xbbc8('0x39')],'tags':'callback','description':_0xbbc8('0x4c')+_0x4a52da['scheduledAt'][_0xbbc8('0x4d')](),'priority':_0x4a52da['callback_priority']})[_0xbbc8('0x18')](function(_0x1df8cc){_0x44510b(null,_0x1df8cc);})[_0xbbc8('0x15')](function(_0x3a662d){_0x44510b(_0x3a662d);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x4e')]=function(_0x3f9386,_0x111d71){this[_0xbbc8('0xf')][_0xbbc8('0x4f')](_0x3f9386)['then'](function(_0x24add2){_0x111d71(null,_0x24add2?_0x24add2['name']:![]);})['catch'](function(_0x3c86fe){_0x111d71(_0x3c86fe);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x50')]=function(_0x3b0611,_0x386dee,_0x246bbf){var _0x5a8f4d={'role':_0xbbc8('0x51')};_0x5a8f4d[_0x3b0611]=this[_0xbbc8('0xe')]['callerid'];this[_0xbbc8('0xf')]['agentPause'](_0x5a8f4d,_0x386dee,this[_0xbbc8('0xe')][_0xbbc8('0x39')])[_0xbbc8('0x18')](function(_0x598604){_0x246bbf(null,_['isNil'](_0x598604)?![]:!![]);})[_0xbbc8('0x15')](function(_0x414fde){logger[_0xbbc8('0x30')](_0x414fde);_0x246bbf(null,![]);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x52')]=function(_0x64665d,_0x738faf){var _0x5acf6c={'role':_0xbbc8('0x51')};_0x5acf6c[_0x64665d]=this[_0xbbc8('0xe')][_0xbbc8('0x3c')];this[_0xbbc8('0xf')]['agentUnpause'](_0x5acf6c)[_0xbbc8('0x18')](function(_0x4ca0cd){_0x738faf(null,_['isNil'](_0x4ca0cd)?![]:!![]);})[_0xbbc8('0x15')](function(_0x12404f){logger[_0xbbc8('0x30')](_0x12404f);_0x738faf(null,![]);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x53')]=function(_0x4b3154,_0x113a4a){var _0xd1b4af={'role':_0xbbc8('0x51')};_0xd1b4af[_0x4b3154]=this[_0xbbc8('0xe')]['callerid'];this[_0xbbc8('0xf')][_0xbbc8('0x53')](_0xd1b4af)[_0xbbc8('0x18')](function(_0x7a5bd8){_0x113a4a(null,_[_0xbbc8('0x47')](_0x7a5bd8)?![]:!![]);})[_0xbbc8('0x15')](function(_0x35a0e6){logger[_0xbbc8('0x30')](_0x35a0e6);_0x113a4a(null,![]);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x54')]=function(_0x1ef6e7,_0x2e45c2){var _0x5d01e1={'role':_0xbbc8('0x51')};_0x5d01e1[_0x1ef6e7]=this[_0xbbc8('0xe')]['callerid'];var _0x5974b3=_0x1ef6e7!=_0xbbc8('0x55')?util[_0xbbc8('0x2d')]('%s/%s@from-sip/n',_0xbbc8('0x56'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')]):undefined;this[_0xbbc8('0xf')][_0xbbc8('0x54')](_0x5d01e1,_0x5974b3)[_0xbbc8('0x18')](function(_0xcf941a){_0x2e45c2(null,_[_0xbbc8('0x47')](_0xcf941a)?![]:!![]);})[_0xbbc8('0x15')](function(_0x2e04f2){logger['error'](_0x2e04f2);_0x2e45c2(null,![]);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x57')]=function(_0x295393,_0x393039){sh[_0xbbc8('0x58')](_[_0xbbc8('0x59')](_0x295393),function(_0x27617d,_0x5ab34b){var _0x487e9d=_0x5ab34b[_0xbbc8('0x5a')](/(\r\n|\n|\r)/gm,'');_0x393039(null,_0x487e9d);});};AGIVertices['prototype'][_0xbbc8('0x5b')]=function(_0x350007,_0x2163ae){scripts[_0xbbc8('0x5b')](_0x350007[_0xbbc8('0x5c')],_0x350007[_0xbbc8('0x5d')]||_0xbbc8('0x5e'),_0x350007[_0xbbc8('0x5e')],_0x350007[_0xbbc8('0x5f')]||_0xbbc8('0x60'),_0x350007[_0xbbc8('0x61')]||_0xbbc8('0x62'),_0x350007[_0xbbc8('0x63')]||_0xbbc8('0x64'))[_0xbbc8('0x18')](function(_0x4f8184){_0x2163ae(null,_0x4f8184);})[_0xbbc8('0x15')](function(_0x1c3fde){_0x2163ae(_0x1c3fde);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x65')]=function(_0x42b954,_0x19bc16){scripts[_0xbbc8('0x65')](_0x42b954[_0xbbc8('0x5e')],_0x42b954['google_tts_language']||'en',0x1)[_0xbbc8('0x18')](function(_0x5c3df4){_0x19bc16(null,_0x5c3df4);})['catch'](function(_0x4a4250){_0x19bc16(_0x4a4250);});};AGIVertices['prototype'][_0xbbc8('0x66')]=function(_0x507e6d,_0x112f2a){var _0x35d6a6={'uri':_0x507e6d[_0xbbc8('0x67')],'method':_0x507e6d[_0xbbc8('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x507e6d['timeout'])==='number'&&parseInt(_0x507e6d[_0xbbc8('0x69')])>=0x1?parseInt(_0x507e6d[_0xbbc8('0x69')])*0x3e8:0x5*0x3e8};if(_[_0xbbc8('0x6a')]([_0xbbc8('0x6b'),'PUT'],_0x35d6a6['method'][_0xbbc8('0x6c')]())){try{_0x35d6a6['body']=_0x507e6d[_0xbbc8('0x6d')]?JSON[_0xbbc8('0x6e')](_0x507e6d['rawBody']):{};}catch(_0x5e0e81){logger[_0xbbc8('0x30')](_0xbbc8('0x6f'),_0x5e0e81);}}try{_0x35d6a6[_0xbbc8('0x70')]=_0x507e6d[_0xbbc8('0xb')]?JSON[_0xbbc8('0x6e')](_0x507e6d[_0xbbc8('0xb')]):{};}catch(_0x5f5375){logger['error'](_0xbbc8('0x71'),_0x5f5375);}if(_0x507e6d[_0xbbc8('0x72')]){try{var _0x3f92e0=require(_0x507e6d['computedVariables'])[_0xbbc8('0x73')](this,_0x35d6a6);_0x35d6a6[_0xbbc8('0x74')]=Mustache['render'](_0x507e6d[_0xbbc8('0x67')],_0x3f92e0,{},['$$','$$']);if(_0x35d6a6[_0xbbc8('0x70')]){_0x35d6a6[_0xbbc8('0x70')]=JSON[_0xbbc8('0x6e')](Mustache['render'](JSON[_0xbbc8('0x75')](_0x35d6a6[_0xbbc8('0x70')]),_0x3f92e0,{},['$$','$$']));}if(_0x35d6a6['body']){_0x35d6a6[_0xbbc8('0x76')]=JSON[_0xbbc8('0x6e')](Mustache['render'](JSON[_0xbbc8('0x75')](_0x35d6a6['body']),_0x3f92e0,{},['$$','$$']));}}catch(_0x4eb437){logger[_0xbbc8('0x30')](_0xbbc8('0x77'),_0x4eb437);}}rp(_0x35d6a6)['then'](function(_0x5a7841){var _0x442f98={'statusCode':_0x5a7841['statusCode']||0xc8,'statusMessage':_0x5a7841[_0xbbc8('0x78')]||'OK','headers':_0x5a7841[_0xbbc8('0x70')]||{},'body':_0x5a7841['body']||{}};_0x112f2a(null,_0x442f98);})[_0xbbc8('0x15')](function(_0x391c15){var _0x491469={'statusCode':_0x391c15[_0xbbc8('0x79')]||0x1f4,'statusMessage':_0x391c15[_0xbbc8('0x7a')]||_0xbbc8('0x7b'),'headers':_0x391c15[_0xbbc8('0x7c')]['headers']||{},'body':_0x391c15[_0xbbc8('0x7c')][_0xbbc8('0x76')]||{}};_0x112f2a(null,_0x491469);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x7d')]=function(_0xebe5bd,_0x244ce0){scripts['googleDialogflow'](this[_0xbbc8('0xe')][_0xbbc8('0x39')],_0xebe5bd['key'],_0xebe5bd[_0xbbc8('0x5e')],_0xebe5bd[_0xbbc8('0x7e')]||'en')[_0xbbc8('0x18')](function(_0x3bdef9){_0x244ce0(null,_0x3bdef9);})['catch'](function(_0x13347b){_0x244ce0(_0x13347b);});};AGIVertices['prototype'][_0xbbc8('0x7f')]=function(_0x3f9193,_0x17d171){scripts[_0xbbc8('0x7f')](this[_0xbbc8('0xe')][_0xbbc8('0x39')],_0x3f9193[_0xbbc8('0x80')],_0x3f9193[_0xbbc8('0x81')],_0x3f9193[_0xbbc8('0x82')],_0x3f9193[_0xbbc8('0x5e')],_0x3f9193[_0xbbc8('0x83')]||'en')[_0xbbc8('0x18')](function(_0x314ad2){_0x17d171(null,_0x314ad2);})[_0xbbc8('0x15')](function(_0x28093a){_0x17d171(_0x28093a);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x84')]=function(_0x52a066,_0x36c8b7){scripts[_0xbbc8('0x84')](this['channel'],_0x52a066)[_0xbbc8('0x18')](function(_0x59c18b){_0x36c8b7(null,_0x59c18b);})[_0xbbc8('0x15')](function(_0x1385f4){_0x36c8b7(_0x1385f4);});};AGIVertices['prototype'][_0xbbc8('0x85')]=function(_0x28f343,_0x56a2fa){scripts[_0xbbc8('0x85')](_0x28f343[_0xbbc8('0x86')],_0x28f343[_0xbbc8('0x5e')],_0x28f343[_0xbbc8('0x87')]||'en-US',_0x28f343['speed'])[_0xbbc8('0x18')](function(_0x5af7dc){_0x56a2fa(null,_0x5af7dc);})[_0xbbc8('0x15')](function(_0x1f8883){_0x56a2fa(_0x1f8883);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x88')]=function(_0x2dac30,_0x4a45d0,_0x3f604b){scripts['ispeechASR'](_0x4a45d0,_0x2dac30[_0xbbc8('0x86')],_0x2dac30['ispeech_asr_language']||_0xbbc8('0x60'),this[_0xbbc8('0x89')](_0x2dac30[_0xbbc8('0x8a')])?_0x2dac30['model']:undefined)['then'](function(_0x13fae8){_0x3f604b(null,_0x13fae8);})['catch'](function(_0x17b4a2){_0x3f604b(_0x17b4a2);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x8b')]=function(_0x871dea,_0x4de9e3){scripts[_0xbbc8('0x8b')](_0x871dea[_0xbbc8('0x8c')],_0x871dea[_0xbbc8('0x8d')],_0x871dea[_0xbbc8('0x8e')],_0x871dea[_0xbbc8('0x8f')]||_0xbbc8('0x90'),_0x871dea[_0xbbc8('0x5e')],_0x871dea[_0xbbc8('0x91')]||_0xbbc8('0x5e'))[_0xbbc8('0x18')](function(_0x5d4c5b){_0x4de9e3(null,_0x5d4c5b);})[_0xbbc8('0x15')](function(_0x492900){_0x4de9e3(_0x492900);});};AGIVertices[_0xbbc8('0x11')]['awsLex']=function(_0x101d54,_0xfbe74c){scripts[_0xbbc8('0x92')](this[_0xbbc8('0xe')][_0xbbc8('0x39')],_0x101d54[_0xbbc8('0x8c')],_0x101d54[_0xbbc8('0x8d')],_0x101d54[_0xbbc8('0x93')],_0x101d54[_0xbbc8('0x5e')],_0x101d54[_0xbbc8('0x94')])[_0xbbc8('0x18')](function(_0x66d41){_0xfbe74c(null,_0x66d41);})[_0xbbc8('0x15')](function(_0x453305){_0xfbe74c(_0x453305);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x95')]=function(_0x7751fb,_0x2370c3,_0x5efdeb){scripts[_0xbbc8('0x95')](_0x2370c3,_0x7751fb[_0xbbc8('0x86')],_0x7751fb['google_asr_language']||_0xbbc8('0x60'))[_0xbbc8('0x18')](function(_0x3763c1){_0x5efdeb(null,_0x3763c1);})[_0xbbc8('0x15')](function(_0x254cf2){_0x5efdeb(_0x254cf2);});};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x96')]=function(_0x4f492b,_0x26b0a8,_0x632332){scripts['tildeASR'](_0x26b0a8,_0x4f492b[_0xbbc8('0x97')],_0x4f492b[_0xbbc8('0x98')],_0x4f492b[_0xbbc8('0x74')])[_0xbbc8('0x18')](function(_0x26ca2b){_0x632332(null,_0x26ca2b);})[_0xbbc8('0x15')](function(_0x677724){_0x632332(_0x677724);});};AGIVertices['prototype'][_0xbbc8('0x99')]=function(_0x4b2ead){var _0xbf11e3=_[_0xbbc8('0x6a')](verticesWithRetry,_0x4b2ead[_0xbbc8('0x3a')])?_0x4b2ead:_[_0xbbc8('0x9a')](_0x4b2ead);for(var _0x55f26d in _0xbf11e3){if(_0xbf11e3['hasOwnProperty'](_0x55f26d)){if(_0xbf11e3[_0x55f26d]&&_[_0xbbc8('0x9b')](_0xbf11e3[_0x55f26d])){if(_['includes'](recursiveMapAttributes,_0x55f26d)){_0xbf11e3[_0x55f26d]=this[_0xbbc8('0x9c')](_0xbf11e3[_0x55f26d]);}else{_0xbf11e3[_0x55f26d]=this[_0xbbc8('0x9d')](_0xbf11e3[_0x55f26d]);}}}}return _0xbf11e3;};AGIVertices['prototype'][_0xbbc8('0x9e')]=function(_0x5ee7a2){for(var _0x57a5f9 in _0x5ee7a2){if(_0x5ee7a2[_0xbbc8('0x9f')](_0x57a5f9)){if(_['isPlainObject'](_0x5ee7a2[_0x57a5f9])){this['recursiveNodeIndex'](_0x5ee7a2[_0x57a5f9]);}else if(_[_0xbbc8('0xa0')](_0x5ee7a2[_0x57a5f9])){for(var _0xfe5cc3=0x0;_0xfe5cc3<_0x5ee7a2[_0x57a5f9][_0xbbc8('0xa1')];_0xfe5cc3++){this['recursiveNodeIndex'](_0x5ee7a2[_0x57a5f9][_0xfe5cc3]);}}else if(_[_0xbbc8('0x9b')](_0x5ee7a2[_0x57a5f9])){_0x5ee7a2[_0x57a5f9]=this[_0xbbc8('0x9d')](_0x5ee7a2[_0x57a5f9]);}}}};AGIVertices[_0xbbc8('0x11')]['saveRestApiResult']=function(_0x5bfe38,_0x48b34f){for(var _0x40b6e5 in _0x5bfe38){if(_0x5bfe38[_0xbbc8('0x9f')](_0x40b6e5)){if(_['isPlainObject'](_0x5bfe38[_0x40b6e5])){if(!_[_0xbbc8('0x46')](_0x5bfe38[_0x40b6e5])){this[_0xbbc8('0xa2')](_0x5bfe38[_0x40b6e5],util[_0xbbc8('0x2d')](_0xbbc8('0xa3'),_0x48b34f,_0x40b6e5));}}else if(_[_0xbbc8('0xa0')](_0x5bfe38[_0x40b6e5])){for(var _0x2e1e01=0x0;_0x2e1e01<_0x5bfe38[_0x40b6e5][_0xbbc8('0xa1')];_0x2e1e01++){this[_0xbbc8('0xa2')](_0x5bfe38[_0x40b6e5][_0x2e1e01],util[_0xbbc8('0x2d')](_0xbbc8('0xa3'),_0x48b34f,_0x40b6e5+'['+_0x2e1e01+']'));}}else{if(!_['isNil'](_0x5bfe38[_0x40b6e5])){this[_0xbbc8('0xe')][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0xa3'),_0x48b34f,_0x40b6e5),_0x5bfe38[_0x40b6e5]);}}}}};AGIVertices[_0xbbc8('0x11')]['replaceObjectAllVariables']=function(_0x5b3ec6){try{var _0x3bbc76=JSON['parse'](_0x5b3ec6);this[_0xbbc8('0x9e')](_0x3bbc76);return JSON[_0xbbc8('0x75')](_0x3bbc76);}catch(_0x32ae96){return this[_0xbbc8('0x9d')](_0x5b3ec6);}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x9d')]=function(_0x1057cb){var _0x1b0fac=_0x1057cb['split']('{');for(var _0x2631cc=0x1;_0x2631cc<_0x1b0fac[_0xbbc8('0xa1')];_0x2631cc+=0x1){var _0x4d7955=_0x1b0fac[_0x2631cc][_0xbbc8('0xa5')]('}');if(_0x4d7955[_0xbbc8('0xa1')]>0x1){_0x1057cb=_0x1057cb['replaceAll']('{'+_0x4d7955[0x0]+'}',this[_0xbbc8('0xe')][_0xbbc8('0x12')](_0x4d7955[0x0])[_0xbbc8('0xa6')]||_0x4d7955[0x0]);}}if(_0x1b0fac[_0xbbc8('0xa1')]===0x1){return _0x1057cb[_0xbbc8('0x4d')]();}return this[_0xbbc8('0x9d')](_0x1057cb);};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xa7')]=function(_0x1439a5,_0x5436de){var _0x564688=this[_0xbbc8('0xe')][_0xbbc8('0x12')](_0x1439a5);if(_0x564688[_0xbbc8('0xa8')]===-0x1){return _0x564688;}logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xa9'),_0x5436de,_0x564688[_0xbbc8('0xa6')]));return this[_0xbbc8('0xe')]['setVariable'](_0x5436de,_0x564688[_0xbbc8('0xa6')]);};AGIVertices['prototype'][_0xbbc8('0x89')]=function(_0x163b44){return _0x163b44&&_0x163b44!=='0'&&_0x163b44!=='-1'&&_0x163b44!=='';};AGIVertices['prototype'][_0xbbc8('0xaa')]=function(_0x4cb28a){this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x4cb28a,'-');_0x4cb28a[_0xbbc8('0xab')]=_0x4cb28a[_0xbbc8('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbbc8('0x11')]['mrcpsynth']=function(_0xe35b5b){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xac'),_0xe35b5b[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0xe35b5b[_0xbbc8('0x5e')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}var _0x52c278='\x22'+_0xe35b5b['text']+'\x22';if(this[_0xbbc8('0x89')](_0xe35b5b[_0xbbc8('0x7c')])){_0x52c278+=','+_0xe35b5b[_0xbbc8('0x7c')];}var _0x1c4497=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xb0'),_0x52c278);if(_0x1c4497['result']===-0x1){return _0x1c4497;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xb1'),_0x52c278));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xb2')]=function(_0x197d38){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xb3'),_0x197d38[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x197d38[_0xbbc8('0xb4')])){return this[_0xbbc8('0xe')]['noop'](_0xbbc8('0xb5'));}var _0x46a177=_0x197d38[_0xbbc8('0xb4')];if(this[_0xbbc8('0x89')](_0x197d38[_0xbbc8('0x7c')])){_0x46a177+=','+_0x197d38[_0xbbc8('0x7c')];}var _0x25bb14=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xb6'),_0x46a177);if(_0x25bb14[_0xbbc8('0xa8')]===-0x1){return _0x25bb14;}var _0x22d57e=this[_0xbbc8('0xa7')](_0xbbc8('0xb7'),_0xbbc8('0xb8'));if(_0x22d57e[_0xbbc8('0xa8')]===-0x1){return _0x22d57e;}var _0x213618=this['getAndSetVariable'](_0xbbc8('0xb9'),_0xbbc8('0xba'));if(_0x213618[_0xbbc8('0xa8')]===-0x1){return _0x213618;}var _0x464997=this[_0xbbc8('0xa7')](_0xbbc8('0xbb'),_0xbbc8('0xbc'));if(_0x464997[_0xbbc8('0xa8')]===-0x1){return _0x464997;}return this['channel']['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0xbd'),_0x46a177));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xbe')]=function(_0x476dd9){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xbf'),_0x476dd9[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')][_0xbbc8('0xbe')]([_0x476dd9[_0xbbc8('0xc0')],_0x476dd9[_0xbbc8('0xc1')]]);};AGIVertices['prototype'][_0xbbc8('0xc2')]=function(_0x1809ea){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xc3'),_0x1809ea[_0xbbc8('0xad')]));if(this[_0xbbc8('0x89')](_0x1809ea['timeout'])){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xc4'),_0x1809ea['timeout']));var _0x29cac3=this[_0xbbc8('0xe')]['wait'](_0x1809ea[_0xbbc8('0x69')]);if(_0x29cac3['result']===-0x1){return _0x29cac3;}}return this[_0xbbc8('0xe')][_0xbbc8('0xc2')]();};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xc5')]=function(_0x5a3aad){logger[_0xbbc8('0x32')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5a3aad[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x5a3aad['list_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x5a3aad,'no\x20list\x20selected');}_0x5a3aad[_0xbbc8('0x4b')]=moment();if(this[_0xbbc8('0x89')](_0x5a3aad[_0xbbc8('0xc6')])){_0x5a3aad[_0xbbc8('0x4b')]=moment()[_0xbbc8('0xc7')](_0x5a3aad[_0xbbc8('0xc6')],_0xbbc8('0xc8'));}if(!this['isConfigured'](_0x5a3aad['callback_priority'])){_0x5a3aad[_0xbbc8('0xc9')]=0x2;}this[_0xbbc8('0x45')]['sync'](this,_0x5a3aad);return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xca'),_0x5a3aad[_0xbbc8('0x4a')],_0x5a3aad['list_id'],_0x5a3aad['scheduledAt']));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xcb')]=function(_0xf6b0d4){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xcc'),_0xf6b0d4[_0xbbc8('0xad')]));var _0x47e85f=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xf6b0d4[_0xbbc8('0xcd')],_0xf6b0d4[_0xbbc8('0x7c')]);if(_0x47e85f['result']===-0x1){return _0x47e85f;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xce'),_0xf6b0d4[_0xbbc8('0xcd')],_0xf6b0d4[_0xbbc8('0x7c')]));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xcf')]=function(_0x5af285){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xd0'),_0x5af285[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x5af285[_0xbbc8('0x5e')])){return this['channel']['noop'](_0xbbc8('0xaf'));}var _0x4a87f3='\x22'+_0x5af285[_0xbbc8('0x5e')]+'\x22';if(this[_0xbbc8('0x89')](_0x5af285['options'])){_0x4a87f3+=','+_0x5af285['options'];}var _0x2bafaf=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xb0'),_0x4a87f3);if(_0x2bafaf[_0xbbc8('0xa8')]===-0x1){return _0x2bafaf;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4a87f3));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xd1')]=function(_0x37760b){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x37760b['label']));if(!this[_0xbbc8('0x89')](_0x37760b[_0xbbc8('0x5e')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}var _0x108c86='\x22'+_0x37760b[_0xbbc8('0x5e')]+'\x22';if(this[_0xbbc8('0x89')](_0x37760b[_0xbbc8('0x7c')])){_0x108c86+=','+_0x37760b[_0xbbc8('0x7c')];}var _0x415684=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xb0'),_0x108c86);if(_0x415684[_0xbbc8('0xa8')]===-0x1){return _0x415684;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xb1'),_0x108c86));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xd2')]=function(_0x5ca425){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0xd3'),_0x5ca425[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x5ca425[_0xbbc8('0xb4')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xb5'));}var _0x1d1b1c=_0x5ca425[_0xbbc8('0xb4')];if(this['isConfigured'](_0x5ca425['options'])){_0x1d1b1c+=','+_0x5ca425[_0xbbc8('0x7c')];}var _0xc15643=this['channel'][_0xbbc8('0x58')](_0xbbc8('0xb6'),_0x1d1b1c);if(_0xc15643[_0xbbc8('0xa8')]===-0x1){return _0xc15643;}var _0x9150b0=this[_0xbbc8('0xa7')](_0xbbc8('0xb7'),'LUMENVOX_ASR_CONFIDENCE');if(_0x9150b0[_0xbbc8('0xa8')]===-0x1){return _0x9150b0;}var _0x4c77a2=this[_0xbbc8('0xa7')](_0xbbc8('0xb9'),_0xbbc8('0xd4'));if(_0x4c77a2['result']===-0x1){return _0x4c77a2;}var _0x232364=this[_0xbbc8('0xa7')](_0xbbc8('0xbb'),_0xbbc8('0xd5'));if(_0x232364[_0xbbc8('0xa8')]===-0x1){return _0x232364;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xbd'),_0x1d1b1c));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xd6')]=function(_0x4dc3c2){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xd7'),_0x4dc3c2[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x4dc3c2[_0xbbc8('0xb4')])){return this[_0xbbc8('0xe')]['noop'](_0xbbc8('0xb5'));}var _0x1c113d=_0x4dc3c2[_0xbbc8('0xb4')];if(this[_0xbbc8('0x89')](_0x4dc3c2[_0xbbc8('0x7c')])){_0x1c113d+=','+_0x4dc3c2[_0xbbc8('0x7c')];}var _0xc190b5=this[_0xbbc8('0xe')]['exec'](_0xbbc8('0xb6'),_0x1c113d);if(_0xc190b5[_0xbbc8('0xa8')]===-0x1){return _0xc190b5;}var _0x5a44fe=this[_0xbbc8('0xa7')](_0xbbc8('0xb7'),'SESTEK_ASR_CONFIDENCE');if(_0x5a44fe[_0xbbc8('0xa8')]===-0x1){return _0x5a44fe;}var _0x201ded=this[_0xbbc8('0xa7')](_0xbbc8('0xb9'),_0xbbc8('0xd8'));if(_0x201ded[_0xbbc8('0xa8')]===-0x1){return _0x201ded;}var _0x19deef=this[_0xbbc8('0xa7')](_0xbbc8('0xbb'),_0xbbc8('0xd9'));if(_0x19deef[_0xbbc8('0xa8')]===-0x1){return _0x19deef;}return this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1c113d));};AGIVertices[_0xbbc8('0x11')]['database']=function(_0x34831f){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x34831f[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x34831f[_0xbbc8('0xda')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x34831f,_0xbbc8('0xdb'));}var _0x4d915f=this[_0xbbc8('0x1b')][_0xbbc8('0x73')](this,_0x34831f[_0xbbc8('0xda')]);if(!_0x4d915f){return this['channel']['error'](_0x34831f,'no\x20odbc\x20database\x20found');}if(!this[_0xbbc8('0x89')](_0x34831f[_0xbbc8('0x34')])){return this['channel'][_0xbbc8('0x30')](_0x34831f,_0xbbc8('0xdc'));}var _0x3e628c=_0x34831f[_0xbbc8('0x34')][_0xbbc8('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xdd'),_0x3e628c));var _0xa891a6=this[_0xbbc8('0xde')][_0xbbc8('0x73')](this,_0x4d915f,_0x3e628c);this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x34831f,_0x3e628c);if(!this['isConfigured'](_0x34831f[_0xbbc8('0xdf')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xe0'));}var _0x2ffa89=this['getVariable'][_0xbbc8('0x73')](this,_0x34831f[_0xbbc8('0xdf')]);if(!_0x2ffa89){return this['channel']['error'](_0x34831f,_0xbbc8('0xe1'));}var _0x2fa71e=this;_0xa891a6[_0xbbc8('0xe2')](function(_0x4852e4,_0x576bff){Object[_0xbbc8('0xe3')](_0x4852e4)[_0xbbc8('0xe2')](function(_0x4b4b4f){_0x2fa71e[_0xbbc8('0xe')][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0xe4'),_0x2ffa89,_0x576bff,_0x4b4b4f),_0x4852e4[_0x4b4b4f]);});});this['channel'][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0xe5'),_0x2ffa89),_0xa891a6[_0xbbc8('0xa1')]);return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xe6'),_0x2ffa89));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xe7')]=function(_0x104cce){logger[_0xbbc8('0xe8')](util[_0xbbc8('0x2d')](_0xbbc8('0xe9'),_0x104cce['label']));if(!this['isConfigured'](_0x104cce[_0xbbc8('0xea')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x104cce,_0xbbc8('0xeb'));}var _0x18c0eb=this['getUser']['sync'](this,_0x104cce[_0xbbc8('0xea')]);if(!_0x18c0eb){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x104cce,_0xbbc8('0xec'));}var _0x43b7ac=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xed'),[util['format'](_0xbbc8('0xee'),_0x18c0eb),_0x104cce[_0xbbc8('0x69')],_0x104cce['opts'],_0x104cce[_0xbbc8('0x67')]]);if(_0x43b7ac[_0xbbc8('0xa8')]===-0x1){return _0x43b7ac;}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xef'),_0xbbc8('0xed')));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xf0')]=function(_0x981b40){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xf1'),_0x981b40['label']));if(!this[_0xbbc8('0x89')](_0x981b40[_0xbbc8('0x86')])){return this[_0xbbc8('0xe')]['noop'](_0xbbc8('0xf2'));}if(!this[_0xbbc8('0x89')](_0x981b40[_0xbbc8('0x5e')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}this[_0xbbc8('0xe')]['bot']=!![];this[_0xbbc8('0x38')](_0x981b40);this[_0xbbc8('0x44')](_0x981b40[_0xbbc8('0x5e')],'in','','');this[_0xbbc8('0xe')]['noop'](util['format'](_0xbbc8('0xf3'),_0x981b40[_0xbbc8('0x5e')]));var _0x507cda=this[_0xbbc8('0x7d')]['sync'](this,_0x981b40);if(_0x507cda){for(var _0x34b9bc in _0x507cda){if(_0x507cda['hasOwnProperty'](_0x34b9bc)){this['channel'][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0xf4'),_0x34b9bc[_0xbbc8('0x6c')]()),_0x507cda[_0x34b9bc]);}}this['createSquareMessage'](_0x507cda[_0xbbc8('0xf5')],_0xbbc8('0xf6'),'dialogflow','');return this['channel'][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xf7'),_0x507cda['speech']));}return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x981b40,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xf8')]=function(_0x5742f4){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0xf9'),_0x5742f4['label']));if(!this[_0xbbc8('0x89')](_0x5742f4[_0xbbc8('0x80')])){return this['channel'][_0xbbc8('0xae')](_0xbbc8('0xfa'));}if(!this['isConfigured'](_0x5742f4[_0xbbc8('0x81')])){return this[_0xbbc8('0xe')]['noop']('no\x20client_email\x20configured');}if(!this[_0xbbc8('0x89')](_0x5742f4['private_key'])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x5742f4[_0xbbc8('0x83')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('no\x20anguage\x20configured');}if(!this[_0xbbc8('0x89')](_0x5742f4[_0xbbc8('0x5e')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}this[_0xbbc8('0xe')][_0xbbc8('0xfb')]=!![];this[_0xbbc8('0x38')](_0x5742f4);this[_0xbbc8('0x44')](_0x5742f4[_0xbbc8('0x5e')],'in','','');this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('Trying\x20DialogflowV2:\x20%s',_0x5742f4[_0xbbc8('0x5e')]));var _0x4443cf=this[_0xbbc8('0x7f')][_0xbbc8('0x73')](this,_0x5742f4);if(_0x4443cf){for(var _0x24ff14 in _0x4443cf){if(_0x4443cf['hasOwnProperty'](_0x24ff14)){if(_0x24ff14!==_0xbbc8('0xfc')){this['channel']['setVariable'](util['format'](_0xbbc8('0xf4'),_0x24ff14[_0xbbc8('0x6c')]()),_0x4443cf[_0x24ff14]);}}}this[_0xbbc8('0x44')](_0x4443cf[_0xbbc8('0xf5')],_0xbbc8('0xf6'),_0xbbc8('0xf8'),_0x4443cf[_0xbbc8('0xfc')]);return this['channel'][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('DialogflowV2\x20Result\x20%s',_0x4443cf[_0xbbc8('0xf5')]));}return this['channel'][_0xbbc8('0x30')](_0x5742f4,_0xbbc8('0xfd'));};AGIVertices[_0xbbc8('0x11')]['sesteknda']=function(_0x1d59a0){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0xfe'),_0x1d59a0[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x1d59a0[_0xbbc8('0xff')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xbbc8('0x89')](_0x1d59a0['username'])){return this['channel'][_0xbbc8('0xae')](_0xbbc8('0x100'));}if(!this[_0xbbc8('0x89')](_0x1d59a0[_0xbbc8('0x101')])){return this['channel'][_0xbbc8('0xae')]('no\x20password\x20configured');}if(!this[_0xbbc8('0x89')](_0x1d59a0[_0xbbc8('0x102')])){return this[_0xbbc8('0xe')]['noop'](_0xbbc8('0xaf'));}this[_0xbbc8('0xe')][_0xbbc8('0xfb')]=!![];this[_0xbbc8('0x38')](_0x1d59a0);this[_0xbbc8('0x44')](_0x1d59a0[_0xbbc8('0x5e')],'in','','');this[_0xbbc8('0xe')][_0xbbc8('0xae')](util['format'](_0xbbc8('0x103'),_0x1d59a0[_0xbbc8('0x5e')]));var _0x2dade4=this[_0xbbc8('0x84')][_0xbbc8('0x73')](this,_0x1d59a0);if(_0x2dade4){for(var _0x119fd2 in _0x2dade4){if(_0x2dade4['hasOwnProperty'](_0x119fd2)){this[_0xbbc8('0xe')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x119fd2[_0xbbc8('0x6c')]()),_0x2dade4[_0x119fd2]);}}this[_0xbbc8('0x44')](_0x2dade4[_0xbbc8('0xf5')],_0xbbc8('0xf6'),_0xbbc8('0x104'),'');if(_0x2dade4[_0xbbc8('0x105')]){this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x2dade4[_0xbbc8('0x105')]));var _0x10fa5a=this[_0xbbc8('0xe')][_0xbbc8('0x106')](_0x2dade4[_0xbbc8('0x105')]);try{fs[_0xbbc8('0x107')](_0x2dade4[_0xbbc8('0x105')]+_0xbbc8('0x108'));}catch(_0x5df147){logger[_0xbbc8('0x30')](_0x5df147);}return _0x10fa5a;}else{return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x109'),_0x2dade4[_0xbbc8('0xf5')]));}}return this[_0xbbc8('0xe')]['error'](_0x1d59a0,_0xbbc8('0x10a'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x10b')]=function(_0x3e1328){logger['info'](util[_0xbbc8('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3e1328['label']));return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x10b'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x10c')]=function(_0xee17d0){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xee17d0[_0xbbc8('0xad')]));var _0x38a6f9='';if(_0xee17d0[_0xbbc8('0x10d')]){if(!this[_0xbbc8('0x89')](_0xee17d0['trunk_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0xee17d0,_0xbbc8('0x10e'));}else{var _0x9de2a9=parseInt(_0xee17d0[_0xbbc8('0x10d')],0xa);if(isNaN(_0x9de2a9)){_0x38a6f9=_0xee17d0[_0xbbc8('0x10d')];}else{_0x38a6f9=this[_0xbbc8('0x1f')]['sync'](this,_0xee17d0[_0xbbc8('0x10d')]);if(!_0x38a6f9){return this['channel'][_0xbbc8('0x30')](_0xee17d0,_0xbbc8('0x10f'));}}}}else if(_0xee17d0[_0xbbc8('0x110')]){_0x38a6f9=_0xee17d0['trunk_name'];}else{return this['channel'][_0xbbc8('0x30')](_0xee17d0,_0xbbc8('0x10e'));}var _0x5ebced=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0xed'),[util['format'](_0xbbc8('0x111'),_0x38a6f9,_0xee17d0[_0xbbc8('0x4a')]),_0xee17d0['timeout'],_0xee17d0[_0xbbc8('0x112')],_0xee17d0[_0xbbc8('0x67')]]);if(_0x5ebced[_0xbbc8('0xa8')]===-0x1){return _0x5ebced;}return this['channel'][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xef'),_0xbbc8('0xed')));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x113')]=function(_0x1f9483){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x114'),_0x1f9483[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x113'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xd')]=function(_0x1efd9d){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x115'),_0x1efd9d['label']));if(_0x1efd9d['retry']===0x0){return this[_0xbbc8('0xaa')](_0x1efd9d);}_0x1efd9d[_0xbbc8('0xab')]-=0x1;if(!this[_0xbbc8('0x89')](_0x1efd9d['file_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x1efd9d,_0xbbc8('0x116'));}var _0x1ab534=this[_0xbbc8('0x21')][_0xbbc8('0x73')](this,_0x1efd9d[_0xbbc8('0x117')]);if(!_0x1ab534){return this[_0xbbc8('0xe')]['error'](_0x1efd9d,_0xbbc8('0x118'));}if(!this[_0xbbc8('0x89')](_0x1efd9d[_0xbbc8('0xdf')])){return this['channel']['error'](_0xbbc8('0xe0'));}var _0x492ce0=this[_0xbbc8('0xe')][_0xbbc8('0x119')](_0x1ab534,_0x1efd9d['response'],_0x1efd9d['maxdigit']);var _0x4de15c=_0x492ce0[_0xbbc8('0xa8')]?_0x492ce0['result']['toString']():'';logger[_0xbbc8('0x32')](_0xbbc8('0x11a'),JSON['stringify'](_0x492ce0));if(_0x492ce0['result']===-0x1){this['createSquareDetailsReport'][_0xbbc8('0x73')](this,_0x1efd9d,_0x4de15c);return _0x492ce0;}else if(_0x492ce0[_0xbbc8('0xa6')]===_0xbbc8('0x69')){_0x492ce0[_0xbbc8('0xa8')]=_0x4de15c[_0xbbc8('0xa1')]>=parseInt(_0x1efd9d[_0xbbc8('0x11b')])?'x':'i';}else{_0x492ce0[_0xbbc8('0xa8')]=_0x4de15c[_0xbbc8('0xa1')]>=parseInt(_0x1efd9d[_0xbbc8('0x11b')])&&_0x4de15c[_0xbbc8('0xa1')]<=parseInt(_0x1efd9d[_0xbbc8('0x11c')])?'x':'i';}var _0x49bc7a=this[_0xbbc8('0x12')]['sync'](this,_0x1efd9d['variable_id']);if(!_0x49bc7a){return this['channel'][_0xbbc8('0x30')](_0x1efd9d,_0xbbc8('0xe1'));}this[_0xbbc8('0xe')][_0xbbc8('0xa4')](_0x49bc7a,_0x4de15c);if(this['isConfigured'](_0x1efd9d[_0xbbc8('0x11d')])){var _0x3664c5=parseInt(_0x1efd9d['hiddendigitsnum'],0xa);var _0x2c2c7f=rs[_0xbbc8('0x11e')]({'charset':'*','length':_0x3664c5});var _0x47e247=_0x4de15c[_0xbbc8('0xa1')];if(_0x47e247>0x0){if(_0x47e247>_0x3664c5){this['createSquareDetailsReport'][_0xbbc8('0x73')](this,_0x1efd9d,_0x1efd9d[_0xbbc8('0x11f')]===_0xbbc8('0x120')?_0x2c2c7f+_0x4de15c[_0xbbc8('0x121')](_0x3664c5):_0x4de15c[_0xbbc8('0x121')](0x0,_0x47e247-_0x3664c5)+_0x2c2c7f);}else{this[_0xbbc8('0x38')]['sync'](this,_0x1efd9d,rs[_0xbbc8('0x11e')]({'charset':'*','length':_0x47e247}));}}else{this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x1efd9d,'');}}else{this[_0xbbc8('0x38')]['sync'](this,_0x1efd9d,_0x4de15c);}return _0x492ce0;};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x122')]=function(_0x494c7f){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x123'),_0x494c7f[_0xbbc8('0xad')]));return this[_0xbbc8('0xd')](_0x494c7f);};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x124')]=function(_0x5d376d){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x5d376d['label']));this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x5d376d,_0x5d376d[_0xbbc8('0x125')]);return this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x126'),_0x5d376d[_0xbbc8('0x125')]));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x127')]=function(_0x57e22b){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x128'),_0x57e22b[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x57e22b[_0xbbc8('0x8c')])||!this['isConfigured'](_0x57e22b[_0xbbc8('0x8d')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x129'));}if(!this[_0xbbc8('0x89')](_0x57e22b['text'])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x12a'),_0x57e22b[_0xbbc8('0x5e')]));var _0x696323=this['awsPolly'][_0xbbc8('0x73')](this,_0x57e22b);if(_0x696323){this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')]('aws\x20Polly\x20%s\x20file\x20created',_0x696323));var _0x2b67fc=this[_0xbbc8('0xe')][_0xbbc8('0x106')](_0x696323);try{fs[_0xbbc8('0x107')](_0x696323+'.wav');}catch(_0x20b3cb){logger[_0xbbc8('0x30')](_0x20b3cb);}return _0x2b67fc;}return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x57e22b,_0xbbc8('0x12b'));};AGIVertices['prototype'][_0xbbc8('0x12c')]=function(_0x48206b){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x12d'),_0x48206b[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x48206b['aws_access_key_id'])||!this[_0xbbc8('0x89')](_0x48206b[_0xbbc8('0x8d')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x129'));}if(!this[_0xbbc8('0x89')](_0x48206b[_0xbbc8('0x94')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x12e'));}if(!this[_0xbbc8('0x89')](_0x48206b[_0xbbc8('0x5e')])){return this['channel']['noop'](_0xbbc8('0xaf'));}this[_0xbbc8('0xe')][_0xbbc8('0xfb')]=!![];this[_0xbbc8('0x38')](_0x48206b);this[_0xbbc8('0x44')](_0x48206b[_0xbbc8('0x5e')],'in','','');this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')]('Trying\x20Amazon\x20Lex:\x20%s',_0x48206b[_0xbbc8('0x5e')]));var _0xe2410a=this[_0xbbc8('0x92')][_0xbbc8('0x73')](this,_0x48206b);if(_0xe2410a){for(var _0x43f24f in _0xe2410a){if(_0xe2410a[_0xbbc8('0x9f')](_0x43f24f)&&_[_0xbbc8('0x9b')](_0xe2410a[_0x43f24f])){this[_0xbbc8('0xe')][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')]('AWS_LEX_%s',_0x43f24f[_0xbbc8('0x6c')]()),_0xe2410a[_0x43f24f]);}}if(_[_0xbbc8('0x47')](_0xe2410a[_0xbbc8('0x7a')])){return this['channel'][_0xbbc8('0xae')](_0xbbc8('0x12f'));}else{this[_0xbbc8('0x44')](_0xe2410a[_0xbbc8('0x7a')],'out',_0xbbc8('0x130'),'');return this['channel'][_0xbbc8('0xae')](util['format'](_0xbbc8('0x131'),_0xe2410a[_0xbbc8('0x7a')]));}}return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x48206b,_0xbbc8('0x132'));};AGIVertices[_0xbbc8('0x11')]['googleasr']=function(_0x5e6f3a){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x133'),_0x5e6f3a[_0xbbc8('0xad')],_0x5e6f3a[_0xbbc8('0x69')]));if(!this['isConfigured'](_0x5e6f3a[_0xbbc8('0x86')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xf2'));}var _0x1969f3=_0xbbc8('0x134');var _0x5d97e9=util[_0xbbc8('0x2d')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x236315=util[_0xbbc8('0x2d')](_0xbbc8('0xa3'),_0x5d97e9,_0x1969f3);var _0x5d7dc7=!![];if(_0x5e6f3a['beep']===_0xbbc8('0x135')){_0x5d7dc7=![];}var _0x36fe86=this[_0xbbc8('0xe')][_0xbbc8('0x136')](_0x5d97e9,_0x1969f3,_0x5e6f3a[_0xbbc8('0x137')],_0x5e6f3a[_0xbbc8('0x69')],undefined,_0x5d7dc7);if(_0x36fe86[_0xbbc8('0xa8')]!==-0x1){this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x138'),_0x236315));var _0x35f772=this[_0xbbc8('0x95')][_0xbbc8('0x73')](this,_0x5e6f3a,_0x236315);if(_0x35f772){for(var _0x5f2d9e in _0x35f772){if(_0x35f772[_0xbbc8('0x9f')](_0x5f2d9e)){this[_0xbbc8('0xe')]['setVariable'](util[_0xbbc8('0x2d')]('GOOGLE_ASR_%s',_0x5f2d9e[_0xbbc8('0x6c')]()),_0x35f772[_0x5f2d9e]);}}return this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x139'),JSON['stringify'](_0x35f772)));}}return _0x36fe86;};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x13a')]=function(_0x591f5f){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x13b'),_0x591f5f[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x591f5f[_0xbbc8('0x97')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('no\x20appid\x20configured');}if(!this[_0xbbc8('0x89')](_0x591f5f[_0xbbc8('0x98')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x13c'));}var _0x2cfadc='wav';var _0xbe151d=util[_0xbbc8('0x2d')](_0xbbc8('0x13d'),FILES_PATH,rs[_0xbbc8('0x11e')](0x4));var _0xa5732a=util[_0xbbc8('0x2d')]('%s.%s',_0xbe151d,_0x2cfadc);var _0x9ce63e=!![];if(_0x591f5f['beep']==='NOBEEP'){_0x9ce63e=![];}var _0x14537f=this['channel'][_0xbbc8('0x136')](_0xbe151d,_0x2cfadc,_0x591f5f['intKey'],_0x591f5f[_0xbbc8('0x69')],undefined,_0x9ce63e);if(_0x14537f[_0xbbc8('0xa8')]!==-0x1){this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x13e'),_0xa5732a));var _0x3ae6ec=this[_0xbbc8('0x96')][_0xbbc8('0x73')](this,_0x591f5f,_0xa5732a);if(_0x3ae6ec){for(var _0x470143 in _0x3ae6ec){if(_0x3ae6ec[_0xbbc8('0x9f')](_0x470143)){this[_0xbbc8('0xe')][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0x13f'),_0x470143['toUpperCase']()),_0x3ae6ec[_0x470143]);}}return this['channel']['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x140'),JSON['stringify'](_0x3ae6ec)));}}return _0x14537f;};AGIVertices['prototype'][_0xbbc8('0x141')]=function(_0x223cc0){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x142'),_0x223cc0[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')]['continueAt'](_0x223cc0[_0xbbc8('0x3f')],_0x223cc0[_0xbbc8('0x40')],_0x223cc0[_0xbbc8('0x143')]);};AGIVertices['prototype'][_0xbbc8('0x144')]=function(_0x16afee){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x145'),_0x16afee['label']));if(!this[_0xbbc8('0x89')](_0x16afee[_0xbbc8('0x146')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x16afee,_0xbbc8('0x147'));}try{var _0x4a16b1=eval(_0x16afee[_0xbbc8('0x146')])?_0xbbc8('0x148'):_0xbbc8('0x149');this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x14a'),_0x16afee['condition'],_0x4a16b1));return{'code':0xc8,'result':_0x4a16b1};}catch(_0x5a93b3){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x14b')]=function(_0x4f5ce6){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x14c'),_0x4f5ce6[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x4f5ce6[_0xbbc8('0x14d')])){return this[_0xbbc8('0xe')]['error'](_0x4f5ce6,_0xbbc8('0x14e'));}var _0x3e3662=this[_0xbbc8('0x26')][_0xbbc8('0x73')](this,_0x4f5ce6[_0xbbc8('0x14d')]);if(!_0x3e3662){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x4f5ce6,_0xbbc8('0x14f'));}for(var _0x4d2e26=0x0;_0x4d2e26<_0x3e3662[_0xbbc8('0xa1')];_0x4d2e26+=0x1){var _0x344208=this['channel']['getVariable'](util[_0xbbc8('0x2d')](_0xbbc8('0x150'),_0x3e3662[_0x4d2e26]));if(_0x344208[_0xbbc8('0xa8')]===-0x1){return _0x344208;}logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x151'),_0x3e3662[_0x4d2e26],_0x344208[_0xbbc8('0xa6')]));if(_0x344208[_0xbbc8('0xa6')]===_0xbbc8('0x148')){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x151'),_0x3e3662[_0x4d2e26],_0xbbc8('0x148')));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('IFTIME\x20%s\x20%s',_0x3e3662[_0x4d2e26],_0xbbc8('0x148')));return{'code':0xc8,'result':_0xbbc8('0x148')};}else{logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('IFTIME\x20%s\x20%s',_0x3e3662[_0x4d2e26],_0xbbc8('0x149')));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x151'),_0x3e3662[_0x4d2e26],_0xbbc8('0x149')));}}return{'code':0xc8,'result':_0xbbc8('0x149')};};AGIVertices['prototype'][_0xbbc8('0x152')]=function(_0x2df42b){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x153'),_0x2df42b['label']));return this[_0xbbc8('0xe')][_0xbbc8('0x152')]();};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x154')]=function(_0x4790d2){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x155'),_0x4790d2['label']));if(!this['isConfigured'](_0x4790d2[_0xbbc8('0x86')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xf2'));}var _0x183963=_0xbbc8('0x134');var _0xe72fc9=util[_0xbbc8('0x2d')](_0xbbc8('0x13d'),FILES_PATH,rs[_0xbbc8('0x11e')](0x4));var _0xc60909=util[_0xbbc8('0x2d')](_0xbbc8('0xa3'),_0xe72fc9,_0x183963);var _0x270bf8=!![];if(_0x4790d2[_0xbbc8('0x156')]===_0xbbc8('0x135')){_0x270bf8=![];}var _0x3a46fc=this['channel'][_0xbbc8('0x136')](_0xe72fc9,_0x183963,_0x4790d2['intKey'],_0x4790d2['timeout'],undefined,_0x270bf8);if(_0x3a46fc[_0xbbc8('0xa8')]!==-0x1){this[_0xbbc8('0xe')][_0xbbc8('0xae')](util['format'](_0xbbc8('0x157'),_0xc60909));var _0x2bd905=this[_0xbbc8('0x88')][_0xbbc8('0x73')](this,_0x4790d2,_0xc60909);if(_0x2bd905){for(var _0x2ad36e in _0x2bd905){if(_0x2bd905[_0xbbc8('0x9f')](_0x2ad36e)){this[_0xbbc8('0xe')][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0x158'),_0x2ad36e['toUpperCase']()),_0x2bd905[_0x2ad36e]);}}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x159'),JSON['stringify'](_0x2bd905)));}}return _0x3a46fc;};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x15a')]=function(_0x1197b9){logger[_0xbbc8('0x32')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1197b9[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x1197b9[_0xbbc8('0x86')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xf2'));}if(!this[_0xbbc8('0x89')](_0x1197b9[_0xbbc8('0x5e')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}this['channel']['noop'](util[_0xbbc8('0x2d')]('Trying\x20ispeech\x20TTS\x20%s',_0x1197b9[_0xbbc8('0x5e')]));var _0x9d7d0b=this[_0xbbc8('0x85')][_0xbbc8('0x73')](this,_0x1197b9);if(_0x9d7d0b){this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x157'),_0x9d7d0b));var _0x49baa8=this['channel']['streamFile'](_0x9d7d0b,_0x1197b9[_0xbbc8('0x137')]);try{fs[_0xbbc8('0x107')](_0x9d7d0b+_0xbbc8('0x108'));}catch(_0x52a87f){logger[_0xbbc8('0x30')](_0x52a87f);}return _0x49baa8;}return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x1197b9,_0xbbc8('0x15b'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x15c')]=function(_0x3500d9){logger['info'](util['format'](_0xbbc8('0x15d'),_0x3500d9['label']));if(!this[_0xbbc8('0x89')](_0x3500d9[_0xbbc8('0x15e')])){return this['channel'][_0xbbc8('0x30')](_0x3500d9,'no\x20find\x20by\x20configured');}logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x15f'),this[_0xbbc8('0xe')]['callerid'],_0x3500d9[_0xbbc8('0x15e')]));var _0xc88e6f=this[_0xbbc8('0x54')][_0xbbc8('0x73')](this,_0x3500d9[_0xbbc8('0x15e')]);if(_0xc88e6f){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this['channel'][_0xbbc8('0x3c')],_0x3500d9['findBy']));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x3500d9[_0xbbc8('0x15e')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x161'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x3500d9[_0xbbc8('0x15e')]));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbbc8('0xe')]['callerid'],_0x3500d9['findBy']));return{'code':0xc8,'result':_0xbbc8('0x162')};}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x163')]=function(_0x3eb4a8){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x164'),_0x3eb4a8[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x3eb4a8[_0xbbc8('0x15e')])){return this[_0xbbc8('0xe')]['error'](_0x3eb4a8,_0xbbc8('0x165'));}logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x15f'),this['channel'][_0xbbc8('0x3c')],_0x3eb4a8[_0xbbc8('0x15e')]));var _0x3f8d9d=this['agentLogout'][_0xbbc8('0x73')](this,_0x3eb4a8[_0xbbc8('0x15e')]);if(_0x3f8d9d){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this[_0xbbc8('0xe')]['callerid'],_0x3eb4a8['findBy']));this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this['channel']['callerid'],_0x3eb4a8[_0xbbc8('0x15e')]));return{'code':0xc8,'result':_0xbbc8('0x166')};}else{logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x161'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x3eb4a8[_0xbbc8('0x15e')]));this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x161'),this[_0xbbc8('0xe')]['callerid'],_0x3eb4a8[_0xbbc8('0x15e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x167')]=function(_0x2e3863){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2e3863[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x2e3863[_0xbbc8('0x168')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x2e3863,_0xbbc8('0x169'));}this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x16a'),_0x2e3863[_0xbbc8('0x168')]));var _0x4454a3=eval(_0x2e3863[_0xbbc8('0x168')]);if(!this[_0xbbc8('0x89')](_0x2e3863[_0xbbc8('0xdf')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xe0'));}var _0x55af1b=this[_0xbbc8('0x12')][_0xbbc8('0x73')](this,_0x2e3863['variable_id']);if(!_0x55af1b){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x2e3863,_0xbbc8('0xe1'));}if(_[_0xbbc8('0xa0')](_0x4454a3)){var _0x3da64e=this;_0x4454a3[_0xbbc8('0xe2')](function(_0x5bee71,_0x2fce36){_0x3da64e[_0xbbc8('0xe')][_0xbbc8('0xa4')](util['format']('%s[%s]',_0x55af1b,_0x2fce36),_0x5bee71);});return this['channel']['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x16b'),_0x55af1b));}else{return this[_0xbbc8('0xe')][_0xbbc8('0xa4')](_0x55af1b,_0x4454a3);}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0xc')]=function(_0x5980a6){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x16c'),_0x5980a6[_0xbbc8('0xad')]));if(_0x5980a6[_0xbbc8('0xab')]===0x0){return this[_0xbbc8('0xaa')](_0x5980a6);}_0x5980a6[_0xbbc8('0xab')]-=0x1;if(!this[_0xbbc8('0x89')](_0x5980a6['file_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x5980a6,_0xbbc8('0x116'));}var _0x453a9a=this[_0xbbc8('0x21')][_0xbbc8('0x73')](this,_0x5980a6[_0xbbc8('0x117')]);if(!_0x453a9a){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x5980a6,'no\x20file\x20audio\x20found');}var _0x4eb07c=this['channel']['getData'](_0x453a9a,_0x5980a6['response'],_0x5980a6['digit']);var _0x317176=_0x4eb07c[_0xbbc8('0xa8')];if(_0x4eb07c['result']===-0x1){this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x5980a6,'-1');return _0x4eb07c;}else if(_0x4eb07c[_0xbbc8('0xa6')]===_0xbbc8('0x69')){_0x4eb07c[_0xbbc8('0xa8')]=_0x4eb07c[_0xbbc8('0xa8')]['length']>0x0?_0x4eb07c[_0xbbc8('0xa8')]:'t';}else if(_[_0xbbc8('0x46')](_0x4eb07c['result'])){_0x4eb07c[_0xbbc8('0xa8')]='#';_0x317176='#';}if(!this[_0xbbc8('0x89')](_0x5980a6['variable_id'])){this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xe0'));}else{var _0x1b17bd=this[_0xbbc8('0x12')]['sync'](this,_0x5980a6['variable_id']);if(!_0x1b17bd){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x5980a6,_0xbbc8('0xe1'));}this[_0xbbc8('0xe')][_0xbbc8('0xa4')](_0x1b17bd,_0x317176);}this['createSquareDetailsReport'][_0xbbc8('0x73')](this,_0x5980a6,_0x317176);return _0x4eb07c;};AGIVertices[_0xbbc8('0x11')]['noop']=function(_0x1158d0){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x1158d0[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')]['noop'](_0x1158d0[_0xbbc8('0x16d')]||_0x1158d0['label']);};AGIVertices['prototype']['pause']=function(_0x29e261){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x16e'),_0x29e261[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x29e261[_0xbbc8('0x15e')])){return this['channel']['error'](_0x29e261,_0xbbc8('0x165'));}logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x15f'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x29e261[_0xbbc8('0x15e')]));var _0x59237c=this['getPause'][_0xbbc8('0x73')](this,_0x29e261[_0xbbc8('0x16f')]);var _0x17b876=this[_0xbbc8('0x50')][_0xbbc8('0x73')](this,_0x29e261['findBy'],_0x59237c);if(_0x17b876){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xbbc8('0x3c')],_0x29e261[_0xbbc8('0x15e')]));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x29e261['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x161'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x29e261[_0xbbc8('0x15e')]));this['channel']['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0x29e261[_0xbbc8('0x15e')]));return{'code':0xc8,'result':_0xbbc8('0x162')};}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x170')]=function(_0x306db2){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x171'),_0x306db2[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x306db2[_0xbbc8('0x117')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x306db2,_0xbbc8('0x116'));}var _0x4b6e11=this['getSound'][_0xbbc8('0x73')](this,_0x306db2[_0xbbc8('0x117')]);if(!_0x4b6e11){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x306db2,'no\x20file\x20audio\x20found');}var _0x41edf8=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0x172'),[_0x4b6e11,_0x306db2[_0xbbc8('0x112')]]);if(_0x41edf8[_0xbbc8('0xa8')]===-0x1){return _0x41edf8;}return this['channel'][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0xce'),_0xbbc8('0x172'),_0x4b6e11));};AGIVertices['prototype']['queue']=function(_0x432b2f){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x173'),_0x432b2f[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x432b2f[_0xbbc8('0x174')])){return this['channel']['error'](_0x432b2f,_0xbbc8('0x175'));}var _0x25d4aa='';var _0x5bb657=parseInt(_0x432b2f['queue_id'],0xa);if(isNaN(_0x5bb657)){_0x25d4aa=_0x432b2f[_0xbbc8('0x174')];}else{_0x25d4aa=this[_0xbbc8('0x16')]['sync'](this,_0x432b2f['queue_id']);if(!_0x25d4aa){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x432b2f,_0xbbc8('0x176'));}}var _0xd6b3bb='';if(this[_0xbbc8('0x89')](_0x432b2f['file_id'])){var _0x31988e=this[_0xbbc8('0x21')][_0xbbc8('0x73')](this,_0x432b2f[_0xbbc8('0x117')]);if(_0x31988e){_0xd6b3bb=_0x31988e;}}this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x432b2f,_0x25d4aa);if(_0x432b2f['opts'][_0xbbc8('0x177')]('x')<0x0){_0x432b2f[_0xbbc8('0x112')]+='x';}if(_0x432b2f['opts'][_0xbbc8('0x177')]('X')<0x0){_0x432b2f[_0xbbc8('0x112')]+='X';}this[_0xbbc8('0xe')][_0xbbc8('0xa4')]('XMCS-QUEUE',_0x25d4aa?_0x25d4aa[_0xbbc8('0x178')]():'');var _0x43d96a=this[_0xbbc8('0xe')][_0xbbc8('0x58')]('QUEUE',[_0x25d4aa,_0x432b2f[_0xbbc8('0x112')],_0x432b2f[_0xbbc8('0x67')],_0xd6b3bb,_0x432b2f[_0xbbc8('0x69')],_0x432b2f[_0xbbc8('0xbe')],_0x432b2f['macro'],_0x432b2f[_0xbbc8('0x179')],'',_0x432b2f['position']]);if(_0x43d96a['result']===-0x1){return _0x43d96a;}return this['channel']['noop'](util['format'](_0xbbc8('0xce'),_0xbbc8('0x17a'),_0x25d4aa));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x17b')]=function(_0x10a5bc){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x17c'),_0x10a5bc[_0xbbc8('0xad')]));var _0x585425=_0x10a5bc[_0xbbc8('0x17d')]||_0xbbc8('0x134');var _0x129c43=util[_0xbbc8('0x2d')](_0xbbc8('0x17e'),this[_0xbbc8('0xe')][_0xbbc8('0x39')],rs[_0xbbc8('0x11e')](0x5));var _0x5587b2=util[_0xbbc8('0x2d')](_0xbbc8('0x17f'),FILES_PATH,_0x129c43,_0x585425);var _0x25dcd9=util[_0xbbc8('0x2d')](_0xbbc8('0x13d'),FILES_PATH,_0x129c43);this['createSquareRecording'][_0xbbc8('0x73')](this,_0x10a5bc,_0x129c43,_0x5587b2);this[_0xbbc8('0xe')][_0xbbc8('0xa4')](_0xbbc8('0x180'),_0x129c43);logger[_0xbbc8('0x32')](_0xbbc8('0x181'),_0x25dcd9,_0x585425,_0x10a5bc[_0xbbc8('0x182')],_0x10a5bc[_0xbbc8('0x69')]);return this['channel'][_0xbbc8('0x136')](_0x25dcd9,_0x585425,_0x10a5bc['escape_digits'],_0x10a5bc['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xbbc8('0x183')]=function(_0x2b68d1){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x184'),_0x2b68d1[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x2b68d1[_0xbbc8('0x67')])){return this[_0xbbc8('0xe')]['noop']('no\x20url\x20configured');}var _0x6224a9=this[_0xbbc8('0x66')][_0xbbc8('0x73')](this,_0x2b68d1);logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Response:',util[_0xbbc8('0x185')](_0x6224a9,{'showHidden':![],'depth':null})));if(!this[_0xbbc8('0x89')](_0x2b68d1[_0xbbc8('0xdf')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x186'));}var _0x5b746f=this['getVariable'][_0xbbc8('0x73')](this,_0x2b68d1[_0xbbc8('0xdf')]);if(!_0x5b746f){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x2b68d1,'no\x20variable\x20found');}this['channel'][_0xbbc8('0xa4')](util[_0xbbc8('0x2d')](_0xbbc8('0x187'),_0x5b746f),_0x6224a9[_0xbbc8('0x79')]?_0x6224a9[_0xbbc8('0x79')]:_0xbbc8('0x188'));this[_0xbbc8('0xe')]['setVariable'](util[_0xbbc8('0x2d')](_0xbbc8('0x189'),_0x5b746f),_0x6224a9[_0xbbc8('0x78')]?_0x6224a9[_0xbbc8('0x78')]:'OK');if(_0x6224a9[_0xbbc8('0x76')]){try{this['saveRestApiResult'](_0x6224a9[_0xbbc8('0x76')],_0x5b746f);}catch(_0x1ef523){logger[_0xbbc8('0x30')](util['format'](_0xbbc8('0x18a'),_0x5b746f));}}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('variable\x20%s\x20set',_0x5b746f));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x18b')]=function(_0x39a4ea){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x18c'),_0x39a4ea[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')][_0xbbc8('0x18d')](_0x39a4ea[_0xbbc8('0x18e')][_0xbbc8('0x5a')](/\s+/g,''),_0x39a4ea['escape_digits']);};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x18f')]=function(_0x3e9f62){logger['info'](util['format'](_0xbbc8('0x190'),_0x3e9f62[_0xbbc8('0xad')]));return this[_0xbbc8('0xe')][_0xbbc8('0x191')](_0x3e9f62[_0xbbc8('0x192')][_0xbbc8('0x5a')](/\s+/g,''),_0x3e9f62['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x44fea8){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x193'),_0x44fea8[_0xbbc8('0xad')]));return this['channel'][_0xbbc8('0x194')](_0x44fea8[_0xbbc8('0x5e')],_0x44fea8[_0xbbc8('0x182')]);};AGIVertices[_0xbbc8('0x11')]['sendMail']=function(_0x2242fd){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2242fd[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x2242fd[_0xbbc8('0x195')])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x196'));}var _0x21335b=this[_0xbbc8('0x23')][_0xbbc8('0x73')](this,_0x2242fd[_0xbbc8('0x195')]);if(!_0x21335b||!_0x21335b[_0xbbc8('0x197')]){return this['channel'][_0xbbc8('0x30')](_0x2242fd,'no\x20mail\x20account\x20found');}var _0x71c8d2={'from':util[_0xbbc8('0x2d')](_0xbbc8('0x198'),_0x21335b[_0xbbc8('0x14')],_0x21335b[_0xbbc8('0x199')]||_0x21335b[_0xbbc8('0x197')]['user']),'to':_0x2242fd['to']||'','cc':_0x2242fd['cc']||'','bcc':_0x2242fd[_0xbbc8('0x19a')]||'','subject':_0x2242fd[_0xbbc8('0x19b')],'html':_0x2242fd[_0xbbc8('0x5e')],'text':_0x2242fd[_0xbbc8('0x5e')]};if(this['isConfigured'](_0x2242fd['template_id'])){}logger[_0xbbc8('0xe8')](_0xbbc8('0x19c'),JSON[_0xbbc8('0x75')](_0x71c8d2));this['createSquareDetailsReport'][_0xbbc8('0x73')](this,_0x2242fd,_0x2242fd[_0xbbc8('0x195')]);this[_0xbbc8('0xe')][_0xbbc8('0xae')](util['format'](_0xbbc8('0x19d'),_0x21335b[_0xbbc8('0x14')]));this[_0xbbc8('0x25')][_0xbbc8('0x73')](this,_0x21335b[_0xbbc8('0x19e')],_0x71c8d2);return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x19f'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1a0')]=function(_0x1f470b){logger[_0xbbc8('0x32')](util['format'](_0xbbc8('0x1a1'),_0x1f470b['label']));return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x267860){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x1a2'),_0x267860[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x267860['sms_account_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x1a3'));}var _0x3a6e24=this['getSmsAccount'][_0xbbc8('0x73')](this,_0x267860[_0xbbc8('0x1a4')]);if(!_0x3a6e24){return this['channel']['error'](_0x267860,_0xbbc8('0x1a5'));}var _0x12a613={'body':_0x267860['sms_text'],'phone':_0x267860['to']||'','SmsAccountId':_0x3a6e24['id']};logger[_0xbbc8('0xe8')]('sendSMS\x20message',JSON[_0xbbc8('0x75')](_0x12a613));this[_0xbbc8('0x38')]['sync'](this,_0x267860,_0x267860['sms_account_id']);this['channel'][_0xbbc8('0xae')](util['format'](_0xbbc8('0x1a6'),_0x3a6e24[_0xbbc8('0x14')]));this['createSmsMessage'][_0xbbc8('0x73')](this,_0x12a613);return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x1a7'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1a8')]=function(_0x30ce4e){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x30ce4e[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x30ce4e['variable_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x30ce4e,_0xbbc8('0x1a9'));}var _0x39589c=this[_0xbbc8('0x12')]['sync'](this,_0x30ce4e[_0xbbc8('0xdf')]);if(!_0x39589c){return this[_0xbbc8('0xe')]['error'](_0x30ce4e,_0xbbc8('0xe1'));}return this['channel'][_0xbbc8('0xa4')](_0x39589c,_0x30ce4e[_0xbbc8('0x1aa')]);};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1ab')]=function(_0x44c390){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x1ac'),_0x44c390[_0xbbc8('0xad')]));this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x1ad'));if(_0x44c390[_0xbbc8('0xc2')]==='yes'){this[_0xbbc8('0xe')]['noop'](_0xbbc8('0x1ae'));return this[_0xbbc8('0xe')][_0xbbc8('0xc2')]();}return this[_0xbbc8('0xe')][_0xbbc8('0xae')]('Skipped\x20Answer');};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1af')]=function(_0x18cf0d){logger[_0xbbc8('0x32')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x18cf0d[_0xbbc8('0xad')]));if(!this[_0xbbc8('0x89')](_0x18cf0d['project_id'])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x18cf0d,_0xbbc8('0x1b0'));}var _0x545c1e=this['getSquareProject'][_0xbbc8('0x73')](this,_0x18cf0d['project_id']);if(!this['isConfigured'](_0x545c1e)){return this[_0xbbc8('0xe')]['error'](_0x18cf0d,util[_0xbbc8('0x2d')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x18cf0d['project_id']));}if(_0x545c1e===this[_0xbbc8('0xe')]['arg_1']){return this[_0xbbc8('0xe')]['error'](_0x18cf0d,_0xbbc8('0x1b1'));}this[_0xbbc8('0x38')]['sync'](this,_0x18cf0d,_0x545c1e);var _0x3f82e4=this[_0xbbc8('0xe')][_0xbbc8('0x58')](_0xbbc8('0x1b2'),util[_0xbbc8('0x2d')](_0xbbc8('0x1b3'),config[_0xbbc8('0xbe')][_0xbbc8('0x1b4')]||'127.0.0.1',_0x545c1e,this[_0xbbc8('0xe')][_0xbbc8('0x3b')]));if(_0x3f82e4[_0xbbc8('0xa8')]===-0x1){return _0x3f82e4;}return this['channel']['noop'](util['format'](_0xbbc8('0xce'),'AGI',_0x545c1e));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1b5')]=function(_0x52b270){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x1b6'),_0x52b270[_0xbbc8('0xad')]));var _0x4c2b5b=this[_0xbbc8('0x57')]['sync'](this,_0x52b270[_0xbbc8('0xc0')]);this[_0xbbc8('0x38')][_0xbbc8('0x73')](this,_0x52b270,_0x52b270[_0xbbc8('0xc0')]);if(this[_0xbbc8('0x89')](_0x52b270[_0xbbc8('0xdf')])){var _0x16b762=this[_0xbbc8('0x12')][_0xbbc8('0x73')](this,_0x52b270[_0xbbc8('0xdf')]);if(_0x16b762){this[_0xbbc8('0xe')]['setVariable'](_0x16b762,_0x4c2b5b);return this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0x1b7'),_0x52b270[_0xbbc8('0xc0')],_0x16b762));}}return this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x52b270[_0xbbc8('0xc0')]));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1b8')]=function(_0x1d2ef3){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x1b9'),_0x1d2ef3[_0xbbc8('0xad')]));_0x1d2ef3[_0xbbc8('0x5e')]=_0x1d2ef3['text'][_0xbbc8('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbbc8('0x89')](_0x1d2ef3['apiKey'])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0x1ba'));}if(!this['isConfigured'](_0x1d2ef3['text'])){return this['channel'][_0xbbc8('0xae')]('no\x20text\x20configured');}this['channel'][_0xbbc8('0xae')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1d2ef3[_0xbbc8('0x5e')]));var _0x2ebe86=this[_0xbbc8('0x5b')][_0xbbc8('0x73')](this,_0x1d2ef3);if(_0x2ebe86){this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x1bb'),_0x2ebe86));var _0x45d378=this[_0xbbc8('0xe')][_0xbbc8('0x106')](_0x2ebe86);try{fs['unlink'](_0x2ebe86+_0xbbc8('0x108'));}catch(_0x2bd9e6){logger[_0xbbc8('0x30')](_0x2bd9e6);}return _0x45d378;}return this[_0xbbc8('0xe')]['error'](_0x1d2ef3,_0xbbc8('0x1bc'));};AGIVertices['prototype'][_0xbbc8('0x1bd')]=function(_0x320090){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x1be'),_0x320090[_0xbbc8('0xad')]));_0x320090[_0xbbc8('0x5e')]=_0x320090[_0xbbc8('0x5e')][_0xbbc8('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbbc8('0x89')](_0x320090['text'])){return this[_0xbbc8('0xe')][_0xbbc8('0xae')](_0xbbc8('0xaf'));}this['channel'][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x1bf'),_0x320090['text']));var _0x98bf19=this[_0xbbc8('0x65')]['sync'](this,_0x320090);if(_0x98bf19){this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x1c0'),_0x98bf19));var _0x1fb11c=this[_0xbbc8('0xe')][_0xbbc8('0x106')](_0x98bf19);try{fs[_0xbbc8('0x107')](_0x98bf19+_0xbbc8('0x108'));}catch(_0x193a03){logger[_0xbbc8('0x30')](_0x193a03);}return _0x1fb11c;}return this[_0xbbc8('0xe')]['error'](_0x320090,_0xbbc8('0x1c1'));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1c2')]=function(_0xd52f73){logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x1c3'),_0xd52f73[_0xbbc8('0xad')]));if(!this['isConfigured'](_0xd52f73[_0xbbc8('0x15e')])){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0xd52f73,_0xbbc8('0x165'));}logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x15f'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0xd52f73[_0xbbc8('0x15e')]));var _0xecacec=this['agentUnpause'][_0xbbc8('0x73')](this,_0xd52f73[_0xbbc8('0x15e')]);if(_0xecacec){logger[_0xbbc8('0x32')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0xd52f73[_0xbbc8('0x15e')]));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x160'),this['channel'][_0xbbc8('0x3c')],_0xd52f73[_0xbbc8('0x15e')]));return{'code':0xc8,'result':_0xbbc8('0x166')};}else{logger[_0xbbc8('0x32')](util[_0xbbc8('0x2d')](_0xbbc8('0x161'),this[_0xbbc8('0xe')]['callerid'],_0xd52f73[_0xbbc8('0x15e')]));this[_0xbbc8('0xe')][_0xbbc8('0xae')](util[_0xbbc8('0x2d')](_0xbbc8('0x161'),this[_0xbbc8('0xe')][_0xbbc8('0x3c')],_0xd52f73[_0xbbc8('0x15e')]));return{'code':0xc8,'result':_0xbbc8('0x162')};}};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1c4')]=function(_0x4a7a15){logger['info'](util[_0xbbc8('0x2d')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4a7a15[_0xbbc8('0xad')]));var _0x5d7f8a=this[_0xbbc8('0xe')]['exec'](_0xbbc8('0x1c5'),[_0x4a7a15[_0xbbc8('0x1c6')],_0x4a7a15[_0xbbc8('0x7c')]]);if(_0x5d7f8a[_0xbbc8('0xa8')]===-0x1){return _0x5d7f8a;}return this[_0xbbc8('0xe')]['noop'](util[_0xbbc8('0x2d')](_0xbbc8('0xce'),_0xbbc8('0x1c5'),_0x4a7a15[_0xbbc8('0x1c6')]));};AGIVertices[_0xbbc8('0x11')][_0xbbc8('0x1c7')]=function(_0x5e497c){logger['info'](util[_0xbbc8('0x2d')](_0xbbc8('0x1c8'),_0x5e497c[_0xbbc8('0xad')]));if(!this['isConfigured'](_0x5e497c[_0xbbc8('0xdf')])){return this['channel']['error'](_0x5e497c,_0xbbc8('0x1a9'));}var _0x286fa1=this[_0xbbc8('0x12')]['sync'](this,_0x5e497c[_0xbbc8('0xdf')]);if(!_0x286fa1){return this[_0xbbc8('0xe')][_0xbbc8('0x30')](_0x5e497c,'no\x20variable\x20found');}var _0x3679b0=this[_0xbbc8('0xe')]['getVariable'](_0x286fa1);return{'code':0xc8,'result':_0x3679b0[_0xbbc8('0xa6')]?_0x3679b0[_0xbbc8('0xa6')]:'-'};};String['prototype'][_0xbbc8('0x1c9')]=function(_0x3526b1,_0x4a4438){return this['split'](_0x3526b1)['join'](_0x4a4438);};module[_0xbbc8('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2d8ef41..53b15b2 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 _0x5b87=['format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','util','lodash','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent','then','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x5b87,0x78));var _0x75b8=function(_0x13029b,_0x149346){_0x13029b=_0x13029b-0x0;var _0x559410=_0x5b87[_0x13029b];return _0x559410;};'use strict';var util=require(_0x75b8('0x0'));var _=require(_0x75b8('0x1'));var moment=require('moment');var ami=require(_0x75b8('0x2'));var logger=require(_0x75b8('0x3'))('acw');var RpcUser=require(_0x75b8('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x37a78d){this['voiceQueues']=_0x37a78d[_0x75b8('0x5')];this[_0x75b8('0x6')]=_0x37a78d[_0x75b8('0x6')];this[_0x75b8('0x7')]=_0x37a78d[_0x75b8('0x7')];this[_0x75b8('0x8')]={};ami['on'](_0x75b8('0x9'),this[_0x75b8('0xa')]['bind'](this));ami['on'](_0x75b8('0xb'),this[_0x75b8('0xc')][_0x75b8('0xd')](this));ami['on'](_0x75b8('0xe'),this[_0x75b8('0xf')][_0x75b8('0xd')](this));ami['on']('agentringnoanswer',this[_0x75b8('0x10')][_0x75b8('0xd')](this));ami['on']('attendedtransfer',this[_0x75b8('0x11')][_0x75b8('0xd')](this));ami['on'](_0x75b8('0x12'),this[_0x75b8('0x13')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x75b8('0x14')][_0x75b8('0xd')](this));}function getDiff(_0x5ab989){var _0x56b0f6=moment()['milliseconds'](0x0);var _0x378c51=moment(_0x5ab989)['milliseconds'](0x0);return _0x56b0f6[_0x75b8('0x15')](_0x378c51,_0x75b8('0x16'));}Acw[_0x75b8('0x17')]['startAcw']=function(_0x3a3b38){try{var _0x1bad5d=this;var _0x20f848=this[_0x75b8('0x8')][_0x3a3b38][_0x75b8('0x18')];var _0x2bc95c=this['channels'][_0x3a3b38][_0x75b8('0x19')];var _0x3da136=this[_0x75b8('0x5')][_0x2bc95c];var _0x388e6a=![];var _0x15a606=_0x75b8('0x1a');if(_0x3da136[_0x75b8('0x1b')]){if(_0x3da136[_0x75b8('0x1c')][_0x75b8('0x1d')]){_0x388e6a=!![];_0x15a606=_0x3da136[_0x75b8('0x1c')]['name'];}}ami['Action']({'action':_0x75b8('0x1e'),'interface':_0x20f848,'paused':!![],'reason':_0x15a606})['then'](function(_0x29b8b9){if(_0x1bad5d[_0x75b8('0x6')][_0x20f848]){return RpcUser[_0x75b8('0x1f')](_0x1bad5d[_0x75b8('0x6')][_0x20f848]['id'])[_0x75b8('0x20')](function(_0x3b6e4d){if(_0x3b6e4d&&!_0x3b6e4d[_0x75b8('0x21')]){logger[_0x75b8('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3a3b38,_0x20f848,_0x2bc95c);var _0x45afa2=_0x1bad5d['channels'][_0x3a3b38][_0x75b8('0x23')]&&_0x1bad5d[_0x75b8('0x8')][_0x3a3b38][_0x75b8('0x24')]?_0x1bad5d[_0x75b8('0x8')][_0x3a3b38]['destlinkedid']:_0x3a3b38;return RpcUser['savePause'](_0x1bad5d[_0x75b8('0x6')][_0x20f848],_0x15a606,_0x45afa2)[_0x75b8('0x20')](function(_0x230273){if(!_0x388e6a){_0x1bad5d[_0x75b8('0x7')][_0x20f848]={};logger[_0x75b8('0x22')](_0x75b8('0x25'),_0x3a3b38,_0x1bad5d[_0x75b8('0x5')][_0x2bc95c][_0x75b8('0x26')],_0x20f848,_0x2bc95c);_0x1bad5d['timers'][_0x20f848][_0x75b8('0x27')]=setTimeout(_0x1bad5d[_0x75b8('0x28')][_0x75b8('0xd')](_0x1bad5d,_0x20f848),_0x1bad5d['voiceQueues'][_0x2bc95c][_0x75b8('0x26')]*0x3e8);_0x1bad5d[_0x75b8('0x7')][_0x20f848][_0x75b8('0x29')]=moment()[_0x75b8('0x2a')](_0x75b8('0x2b'));_0x1bad5d['timers'][_0x20f848][_0x75b8('0x2c')]=_0x3a3b38;_0x1bad5d[_0x75b8('0x7')][_0x20f848][_0x75b8('0x19')]=_0x2bc95c;_0x1bad5d['timers'][_0x20f848]['updateAcw']=function(){var _0x2277ba=getDiff(_0x1bad5d[_0x75b8('0x7')][_0x20f848]['lastPauseAt']);clearTimeout(_0x1bad5d[_0x75b8('0x7')][_0x20f848][_0x75b8('0x27')]);_0x1bad5d['timers'][_0x20f848]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x2277ba},_0x1bad5d[_0x75b8('0x7')][_0x20f848][_0x75b8('0x2c')],_0x20f848)['then'](function(_0x554cc7){logger[_0x75b8('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x3a3b38,_0x2277ba,_0x554cc7);})[_0x75b8('0x2d')](function(_0x29dc86){logger[_0x75b8('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x3a3b38,_0x29dc86);});delete _0x1bad5d[_0x75b8('0x7')][_0x20f848];};}});}else{logger[_0x75b8('0x22')](_0x75b8('0x2f'),_0x3a3b38,_0x20f848,_0x2bc95c);}});}})['catch'](function(_0x357ab6){logger[_0x75b8('0x2e')](_0x75b8('0x25'),_0x3a3b38,_0x1bad5d[_0x75b8('0x5')][_0x2bc95c]['acwTimeout'],_0x20f848,_0x2bc95c);})['finally'](function(){delete _0x1bad5d[_0x75b8('0x8')][_0x3a3b38];});}catch(_0x33024b){logger[_0x75b8('0x2e')](_0x75b8('0x30'),_0x33024b[_0x75b8('0x31')]);}};Acw[_0x75b8('0x17')]['stopAcw']=function(_0x1efbf4){try{var _0x30f5ab=this;if(_0x30f5ab[_0x75b8('0x7')][_0x1efbf4]){_0x30f5ab[_0x75b8('0x7')][_0x1efbf4]['timer']=![];var _0x51b0fc=_0x30f5ab[_0x75b8('0x7')][_0x1efbf4]['uniqueid'];var _0xb9f9b9=_0x30f5ab['timers'][_0x1efbf4][_0x75b8('0x19')];var _0x4c6bce=_0x30f5ab[_0x75b8('0x5')][_0xb9f9b9]['acwTimeout'];logger[_0x75b8('0x22')](_0x75b8('0x32'),_0x51b0fc,_0x1efbf4);RpcUser[_0x75b8('0x33')](this[_0x75b8('0x6')][_0x1efbf4]);RpcVoiceAgentReport[_0x75b8('0x34')]({'acwtime':_0x4c6bce,'agentacw':!![]},_0x51b0fc,_0x1efbf4)[_0x75b8('0x20')](function(_0x34d25a){logger['info'](_0x75b8('0x35'),_0x51b0fc,_0x4c6bce,_0x34d25a);})['catch'](function(_0x48eaba){logger[_0x75b8('0x2e')](_0x75b8('0x36'),_0x51b0fc,_0x48eaba);});}else{logger[_0x75b8('0x2e')](_0x75b8('0x37'),_0x1efbf4);if(_0x30f5ab[_0x75b8('0x7')]){logger[_0x75b8('0x22')](_0x75b8('0x38'),JSON[_0x75b8('0x39')](_0x30f5ab['timers']));}}}catch(_0x31550b){logger[_0x75b8('0x2e')](_0x75b8('0x3a'),_0x31550b[_0x75b8('0x31')]);}};Acw[_0x75b8('0x17')]['syncAgentConnect']=function(_0x14bdb3){try{if(this[_0x75b8('0x5')][_0x14bdb3[_0x75b8('0x19')]]&&(this['voiceQueues'][_0x14bdb3[_0x75b8('0x19')]][_0x75b8('0x3b')]||this[_0x75b8('0x5')][_0x14bdb3[_0x75b8('0x19')]][_0x75b8('0x1b')])){if(this[_0x75b8('0x6')][_0x14bdb3[_0x75b8('0x18')]]){this[_0x75b8('0x8')][_0x14bdb3[_0x75b8('0x2c')]]={'queue':_0x14bdb3[_0x75b8('0x19')],'interface':_0x14bdb3[_0x75b8('0x18')],'destlinkedid':_0x14bdb3[_0x75b8('0x24')]};}}}catch(_0x48093f){logger[_0x75b8('0x2e')](_0x75b8('0x3c'),_0x48093f[_0x75b8('0x31')]);}};Acw['prototype'][_0x75b8('0x14')]=function(_0x416374){try{if(this[_0x75b8('0x5')][_0x416374[_0x75b8('0x19')]]&&(this[_0x75b8('0x5')][_0x416374[_0x75b8('0x19')]][_0x75b8('0x3b')]||this['voiceQueues'][_0x416374[_0x75b8('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x416374[_0x75b8('0x18')]]){this[_0x75b8('0x8')][_0x416374[_0x75b8('0x2c')]]={'queue':_0x416374[_0x75b8('0x19')],'interface':_0x416374[_0x75b8('0x18')]};}}}catch(_0x113991){logger[_0x75b8('0x2e')](_0x75b8('0x3d'),_0x113991[_0x75b8('0x31')]);}};Acw[_0x75b8('0x17')]['syncHangupRequest']=function(_0x2a6e68){try{if(this[_0x75b8('0x8')][_0x2a6e68[_0x75b8('0x2c')]]&&_[_0x75b8('0x3e')](this[_0x75b8('0x8')][_0x2a6e68[_0x75b8('0x2c')]][_0x75b8('0x23')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x2a6e68[_0x75b8('0x2c')]);this[_0x75b8('0x3f')](_0x2a6e68[_0x75b8('0x2c')]);}else if(this[_0x75b8('0x8')][_0x2a6e68[_0x75b8('0x40')]]&&_[_0x75b8('0x3e')](this[_0x75b8('0x8')][_0x2a6e68['linkedid']]['attended'])){logger[_0x75b8('0x22')](_0x75b8('0x41'),_0x2a6e68['linkedid']);this[_0x75b8('0x3f')](_0x2a6e68[_0x75b8('0x40')]);}}catch(_0x24db9d){logger[_0x75b8('0x2e')](_0x75b8('0x42'),_0x24db9d[_0x75b8('0x31')]);}};Acw[_0x75b8('0x17')][_0x75b8('0xf')]=function(_0x40d96a){try{if(this[_0x75b8('0x8')][_0x40d96a[_0x75b8('0x2c')]]&&this['channels'][_0x40d96a[_0x75b8('0x2c')]]['attended']){logger['info'](_0x75b8('0x43'),_0x40d96a[_0x75b8('0x2c')]);this[_0x75b8('0x3f')](_0x40d96a[_0x75b8('0x2c')]);}else if(this[_0x75b8('0x8')][_0x40d96a[_0x75b8('0x40')]]&&this[_0x75b8('0x8')][_0x40d96a[_0x75b8('0x40')]][_0x75b8('0x23')]){logger[_0x75b8('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x40d96a[_0x75b8('0x40')]);this[_0x75b8('0x3f')](_0x40d96a[_0x75b8('0x40')]);}}catch(_0x29e95c){logger[_0x75b8('0x2e')]('[ACW][syncHangup]\x20%s',_0x29e95c[_0x75b8('0x31')]);}};Acw['prototype'][_0x75b8('0x11')]=function(_0xa7a39d){try{if(!_[_0x75b8('0x44')](this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x45')]])){this[_0x75b8('0x3f')](_0xa7a39d['transfereeuniqueid']);if(this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x46')]]){this['channels'][_0xa7a39d[_0x75b8('0x46')]]['attended']=!![];this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x47')]]=this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x46')]];delete this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x46')]];}}else if(!_[_0x75b8('0x44')](this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x47')]])){this['startAcw'](_0xa7a39d[_0x75b8('0x47')]);if(this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x48')]]){this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x48')]][_0x75b8('0x23')]=!![];this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x45')]]=this['channels'][_0xa7a39d[_0x75b8('0x48')]];delete this[_0x75b8('0x8')][_0xa7a39d[_0x75b8('0x48')]];}}}catch(_0x7c7cec){logger[_0x75b8('0x2e')]('[ACW][syncAttendedTransfer]\x20%s',_0x7c7cec[_0x75b8('0x31')]);}};Acw[_0x75b8('0x17')][_0x75b8('0x13')]=function(_0x14c594){try{if(this[_0x75b8('0x8')][_0x14c594[_0x75b8('0x49')]]){logger[_0x75b8('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x75b8('0x39')](_0x14c594[_0x75b8('0x49')]));this[_0x75b8('0x3f')](_0x14c594[_0x75b8('0x49')]);}else if(this['channels'][_0x14c594[_0x75b8('0x4a')]]){logger['info'](_0x75b8('0x4b'),JSON[_0x75b8('0x39')](_0x14c594['transfererlinkedid']));this['startAcw'](_0x14c594[_0x75b8('0x4a')]);}}catch(_0x82978){logger[_0x75b8('0x2e')]('[ACW][syncBlindTransfer]\x20%s',_0x82978[_0x75b8('0x31')]);}};Acw['prototype'][_0x75b8('0x10')]=function(_0x309f55){try{if(this[_0x75b8('0x5')][_0x309f55[_0x75b8('0x19')]]&&this[_0x75b8('0x5')][_0x309f55[_0x75b8('0x19')]][_0x75b8('0x4c')]===_0x75b8('0x4d')){if(this[_0x75b8('0x6')][_0x309f55['interface']]){logger[_0x75b8('0x22')](_0x75b8('0x4e'),_0x309f55[_0x75b8('0x2c')],_0x309f55[_0x75b8('0x18')],_0x309f55[_0x75b8('0x19')]);return RpcUser[_0x75b8('0x4f')](this[_0x75b8('0x6')][_0x309f55[_0x75b8('0x18')]],_0x75b8('0x50'),_0x309f55['uniqueid']);}}}catch(_0x359936){logger[_0x75b8('0x2e')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x359936[_0x75b8('0x31')]);}};module['exports']=Acw; \ No newline at end of file +var _0xe70e=['interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype'];(function(_0x39714b,_0x5e0b0e){var _0x45ed60=function(_0x3ce5c8){while(--_0x3ce5c8){_0x39714b['push'](_0x39714b['shift']());}};_0x45ed60(++_0x5e0b0e);}(_0xe70e,0x8b));var _0xee70=function(_0x56a387,_0x32d33a){_0x56a387=_0x56a387-0x0;var _0xac2052=_0xe70e[_0x56a387];return _0xac2052;};'use strict';var util=require(_0xee70('0x0'));var _=require(_0xee70('0x1'));var moment=require(_0xee70('0x2'));var ami=require(_0xee70('0x3'));var logger=require(_0xee70('0x4'))(_0xee70('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x32712d){this[_0xee70('0x6')]=_0x32712d[_0xee70('0x6')];this['agents']=_0x32712d[_0xee70('0x7')];this[_0xee70('0x8')]=_0x32712d[_0xee70('0x8')];this[_0xee70('0x9')]={};ami['on'](_0xee70('0xa'),this[_0xee70('0xb')][_0xee70('0xc')](this));ami['on'](_0xee70('0xd'),this['syncHangupRequest'][_0xee70('0xc')](this));ami['on'](_0xee70('0xe'),this['syncHangup'][_0xee70('0xc')](this));ami['on'](_0xee70('0xf'),this[_0xee70('0x10')][_0xee70('0xc')](this));ami['on'](_0xee70('0x11'),this[_0xee70('0x12')][_0xee70('0xc')](this));ami['on'](_0xee70('0x13'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xee70('0x14'),this[_0xee70('0x15')][_0xee70('0xc')](this));}function getDiff(_0x384119){var _0x402684=moment()[_0xee70('0x16')](0x0);var _0x523ac=moment(_0x384119)['milliseconds'](0x0);return _0x402684['diff'](_0x523ac,_0xee70('0x17'));}Acw[_0xee70('0x18')]['startAcw']=function(_0x5cdf28){try{var _0x514a93=this;var _0x579ff7=this[_0xee70('0x9')][_0x5cdf28][_0xee70('0x19')];var _0x328759=this['channels'][_0x5cdf28][_0xee70('0x1a')];var _0x577a45=this[_0xee70('0x6')][_0x328759];var _0x28d924=![];var _0x2b7215=_0xee70('0x1b');if(_0x577a45[_0xee70('0x1c')]){if(_0x577a45[_0xee70('0x1d')][_0xee70('0x1e')]){_0x28d924=!![];_0x2b7215=_0x577a45[_0xee70('0x1d')][_0xee70('0x1e')];}}ami[_0xee70('0x1f')]({'action':'QueuePause','interface':_0x579ff7,'paused':!![],'reason':_0x2b7215})[_0xee70('0x20')](function(_0x2e8dc8){if(_0x514a93[_0xee70('0x7')][_0x579ff7]){return RpcUser[_0xee70('0x21')](_0x514a93[_0xee70('0x7')][_0x579ff7]['id'])[_0xee70('0x20')](function(_0x3d2fa9){if(_0x3d2fa9&&!_0x3d2fa9[_0xee70('0x22')]){logger[_0xee70('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5cdf28,_0x579ff7,_0x328759);var _0x291a70=_0x514a93[_0xee70('0x9')][_0x5cdf28]['attended']&&_0x514a93['channels'][_0x5cdf28][_0xee70('0x24')]?_0x514a93[_0xee70('0x9')][_0x5cdf28][_0xee70('0x24')]:_0x5cdf28;return RpcUser['savePause'](_0x514a93['agents'][_0x579ff7],_0x2b7215,_0x291a70)[_0xee70('0x20')](function(_0x3a4c5b){if(!_0x28d924){_0x514a93[_0xee70('0x8')][_0x579ff7]={};logger[_0xee70('0x23')](_0xee70('0x25'),_0x5cdf28,_0x514a93[_0xee70('0x6')][_0x328759][_0xee70('0x26')],_0x579ff7,_0x328759);_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x27')]=setTimeout(_0x514a93[_0xee70('0x28')][_0xee70('0xc')](_0x514a93,_0x579ff7),_0x514a93[_0xee70('0x6')][_0x328759][_0xee70('0x26')]*0x3e8);_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x29')]=moment()[_0xee70('0x2a')](_0xee70('0x2b'));_0x514a93['timers'][_0x579ff7][_0xee70('0x2c')]=_0x5cdf28;_0x514a93['timers'][_0x579ff7][_0xee70('0x1a')]=_0x328759;_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x2d')]=function(){var _0x1aaf21=getDiff(_0x514a93[_0xee70('0x8')][_0x579ff7]['lastPauseAt']);clearTimeout(_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x27')]);_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x27')]=![];RpcVoiceAgentReport[_0xee70('0x2e')]({'acwtime':_0x1aaf21},_0x514a93[_0xee70('0x8')][_0x579ff7][_0xee70('0x2c')],_0x579ff7)[_0xee70('0x20')](function(_0x3bcdc5){logger[_0xee70('0x23')](_0xee70('0x2f'),_0x5cdf28,_0x1aaf21,_0x3bcdc5);})[_0xee70('0x30')](function(_0x2f0300){logger[_0xee70('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x5cdf28,_0x2f0300);});delete _0x514a93[_0xee70('0x8')][_0x579ff7];};}});}else{logger[_0xee70('0x23')](_0xee70('0x32'),_0x5cdf28,_0x579ff7,_0x328759);}});}})[_0xee70('0x30')](function(_0xe1141f){logger[_0xee70('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5cdf28,_0x514a93[_0xee70('0x6')][_0x328759][_0xee70('0x26')],_0x579ff7,_0x328759);})['finally'](function(){delete _0x514a93[_0xee70('0x9')][_0x5cdf28];});}catch(_0x3aa169){logger[_0xee70('0x31')](_0xee70('0x33'),_0x3aa169[_0xee70('0x34')]);}};Acw['prototype'][_0xee70('0x28')]=function(_0x3099d4){try{var _0x26139a=this;if(_0x26139a[_0xee70('0x8')][_0x3099d4]){_0x26139a['timers'][_0x3099d4]['timer']=![];var _0x531812=_0x26139a['timers'][_0x3099d4][_0xee70('0x2c')];var _0x3ca636=_0x26139a[_0xee70('0x8')][_0x3099d4][_0xee70('0x1a')];var _0x4399d0=_0x26139a[_0xee70('0x6')][_0x3ca636][_0xee70('0x26')];logger[_0xee70('0x23')](_0xee70('0x35'),_0x531812,_0x3099d4);RpcUser['saveUnpause'](this[_0xee70('0x7')][_0x3099d4]);RpcVoiceAgentReport[_0xee70('0x2e')]({'acwtime':_0x4399d0,'agentacw':!![]},_0x531812,_0x3099d4)[_0xee70('0x20')](function(_0x1d7dd2){logger['info'](_0xee70('0x2f'),_0x531812,_0x4399d0,_0x1d7dd2);})[_0xee70('0x30')](function(_0x4f7718){logger['error'](_0xee70('0x36'),_0x531812,_0x4f7718);});}else{logger[_0xee70('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3099d4);if(_0x26139a[_0xee70('0x8')]){logger[_0xee70('0x23')](_0xee70('0x37'),JSON[_0xee70('0x38')](_0x26139a[_0xee70('0x8')]));}}}catch(_0x2d352c){logger['error']('[ACW][STOP]\x20%s',_0x2d352c[_0xee70('0x34')]);}};Acw['prototype'][_0xee70('0xb')]=function(_0x448ac4){try{if(this[_0xee70('0x6')][_0x448ac4[_0xee70('0x1a')]]&&(this[_0xee70('0x6')][_0x448ac4[_0xee70('0x1a')]][_0xee70('0x5')]||this[_0xee70('0x6')][_0x448ac4[_0xee70('0x1a')]][_0xee70('0x1c')])){if(this[_0xee70('0x7')][_0x448ac4[_0xee70('0x19')]]){this[_0xee70('0x9')][_0x448ac4['uniqueid']]={'queue':_0x448ac4['queue'],'interface':_0x448ac4[_0xee70('0x19')],'destlinkedid':_0x448ac4[_0xee70('0x24')]};}}}catch(_0x32c6aa){logger['error'](_0xee70('0x39'),_0x32c6aa['message']);}};Acw[_0xee70('0x18')][_0xee70('0x15')]=function(_0x472d5a){try{if(this[_0xee70('0x6')][_0x472d5a[_0xee70('0x1a')]]&&(this[_0xee70('0x6')][_0x472d5a[_0xee70('0x1a')]][_0xee70('0x5')]||this[_0xee70('0x6')][_0x472d5a[_0xee70('0x1a')]][_0xee70('0x1c')])){if(this[_0xee70('0x7')][_0x472d5a[_0xee70('0x19')]]){this[_0xee70('0x9')][_0x472d5a[_0xee70('0x2c')]]={'queue':_0x472d5a['queue'],'interface':_0x472d5a[_0xee70('0x19')]};}}}catch(_0x112de8){logger[_0xee70('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x112de8[_0xee70('0x34')]);}};Acw[_0xee70('0x18')][_0xee70('0x3a')]=function(_0x563c45){try{if(this[_0xee70('0x9')][_0x563c45[_0xee70('0x2c')]]&&_[_0xee70('0x3b')](this['channels'][_0x563c45[_0xee70('0x2c')]][_0xee70('0x3c')])){logger[_0xee70('0x23')](_0xee70('0x3d'),_0x563c45['uniqueid']);this[_0xee70('0x3e')](_0x563c45[_0xee70('0x2c')]);}else if(this['channels'][_0x563c45[_0xee70('0x3f')]]&&_[_0xee70('0x3b')](this['channels'][_0x563c45[_0xee70('0x3f')]][_0xee70('0x3c')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x563c45[_0xee70('0x3f')]);this[_0xee70('0x3e')](_0x563c45['linkedid']);}}catch(_0x5f2871){logger[_0xee70('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x5f2871[_0xee70('0x34')]);}};Acw[_0xee70('0x18')]['syncHangup']=function(_0x34da77){try{if(this[_0xee70('0x9')][_0x34da77[_0xee70('0x2c')]]&&this[_0xee70('0x9')][_0x34da77[_0xee70('0x2c')]][_0xee70('0x3c')]){logger['info'](_0xee70('0x40'),_0x34da77[_0xee70('0x2c')]);this['startAcw'](_0x34da77[_0xee70('0x2c')]);}else if(this['channels'][_0x34da77['linkedid']]&&this[_0xee70('0x9')][_0x34da77[_0xee70('0x3f')]][_0xee70('0x3c')]){logger[_0xee70('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x34da77[_0xee70('0x3f')]);this[_0xee70('0x3e')](_0x34da77['linkedid']);}}catch(_0x59eec0){logger['error'](_0xee70('0x41'),_0x59eec0[_0xee70('0x34')]);}};Acw[_0xee70('0x18')][_0xee70('0x12')]=function(_0x58ccfa){try{if(!_[_0xee70('0x42')](this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x43')]])){this[_0xee70('0x3e')](_0x58ccfa[_0xee70('0x43')]);if(this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x44')]]){this['channels'][_0x58ccfa[_0xee70('0x44')]][_0xee70('0x3c')]=!![];this['channels'][_0x58ccfa[_0xee70('0x45')]]=this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x44')]];delete this['channels'][_0x58ccfa['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x45')]])){this['startAcw'](_0x58ccfa[_0xee70('0x45')]);if(this['channels'][_0x58ccfa[_0xee70('0x46')]]){this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x46')]]['attended']=!![];this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x43')]]=this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x46')]];delete this[_0xee70('0x9')][_0x58ccfa[_0xee70('0x46')]];}}}catch(_0x326692){logger['error'](_0xee70('0x47'),_0x326692[_0xee70('0x34')]);}};Acw[_0xee70('0x18')][_0xee70('0x48')]=function(_0x4d66b2){try{if(this['channels'][_0x4d66b2[_0xee70('0x49')]]){logger[_0xee70('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xee70('0x38')](_0x4d66b2['transfereruniqueid']));this[_0xee70('0x3e')](_0x4d66b2[_0xee70('0x49')]);}else if(this[_0xee70('0x9')][_0x4d66b2[_0xee70('0x4a')]]){logger['info'](_0xee70('0x4b'),JSON['stringify'](_0x4d66b2[_0xee70('0x4a')]));this['startAcw'](_0x4d66b2[_0xee70('0x4a')]);}}catch(_0xf0399b){logger[_0xee70('0x31')]('[ACW][syncBlindTransfer]\x20%s',_0xf0399b[_0xee70('0x34')]);}};Acw[_0xee70('0x18')][_0xee70('0x10')]=function(_0x2babbb){try{if(this[_0xee70('0x6')][_0x2babbb[_0xee70('0x1a')]]&&this[_0xee70('0x6')][_0x2babbb[_0xee70('0x1a')]][_0xee70('0x4c')]===_0xee70('0x4d')){if(this[_0xee70('0x7')][_0x2babbb[_0xee70('0x19')]]){logger[_0xee70('0x23')](_0xee70('0x4e'),_0x2babbb[_0xee70('0x2c')],_0x2babbb[_0xee70('0x19')],_0x2babbb[_0xee70('0x1a')]);return RpcUser[_0xee70('0x4f')](this[_0xee70('0x7')][_0x2babbb[_0xee70('0x19')]],_0xee70('0x50'),_0x2babbb[_0xee70('0x2c')]);}}}catch(_0x360099){logger[_0xee70('0x31')](_0xee70('0x51'),_0x360099[_0xee70('0x34')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 6a2e204..2452d8d 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 _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x262d4f,_0x2568b2){var _0x3e2650=function(_0x3b4452){while(--_0x3b4452){_0x262d4f['push'](_0x262d4f['shift']());}};_0x3e2650(++_0x2568b2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x1ba778,_0x578511){_0x1ba778=_0x1ba778-0x0;var _0x11afa9=_0x2032[_0x1ba778];return _0x11afa9;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a5ecda5..0c3367f 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x8feba0,_0x52423e){var _0x2cd346=function(_0x43e545){while(--_0x43e545){_0x8feba0['push'](_0x8feba0['shift']());}};_0x2cd346(++_0x52423e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x281a07,_0x3991a5){_0x281a07=_0x281a07-0x0;var _0x1c8d24=_0xb43b[_0x281a07];return _0x1c8d24;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x18d194,_0x3936db){var _0x1fa4ca=function(_0x211999){while(--_0x211999){_0x18d194['push'](_0x18d194['shift']());}};_0x1fa4ca(++_0x3936db);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x167a71,_0x68d27d){_0x167a71=_0x167a71-0x0;var _0x3778c5=_0xbdb7[_0x167a71];return _0x3778c5;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 67fd66a..620fb0c 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49fd=['VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','util','lodash','moment','string','isNil','voiceQueue','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','ContactId','ListId','UserId'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x49fd,0x93));var _0xd49f=function(_0x21b08a,_0x3a6a5e){_0x21b08a=_0x21b08a-0x0;var _0x1db924=_0x49fd[_0x21b08a];return _0x1db924;};'use strict';var util=require(_0xd49f('0x0'));var _=require(_0xd49f('0x1'));var moment=require(_0xd49f('0x2'));function checkNameSurname(_0x52e0d4,_0x953ef4,_0x33ec50){var _0x3b9d7e='';if(!_['isNil'](_0x953ef4)&&_0xd49f('0x3')===typeof _0x953ef4){_0x3b9d7e+=_0x953ef4;}if(!_[_0xd49f('0x4')](_0x33ec50)&&'string'===typeof _0x33ec50){_0x3b9d7e+='\x20'+_0x33ec50;}if(_0x3b9d7e!==''){return _0x3b9d7e;}return _0x52e0d4;}function Action(_0x57b7b5,_0x562f12,_0x416d0c){this[_0xd49f('0x5')]=_0x57b7b5;this['uniqueid']=_0x416d0c||undefined;this[_0xd49f('0x6')]=checkNameSurname(_0x562f12['Contact'][_0xd49f('0x7')],_0x562f12[_0xd49f('0x8')][_0xd49f('0x9')],_0x562f12[_0xd49f('0x8')][_0xd49f('0xa')]);this['number']=_0x562f12[_0xd49f('0x8')][_0xd49f('0x7')];this[_0xd49f('0xb')]=_0x57b7b5[_0xd49f('0x6')];this[_0xd49f('0xc')]=_0x562f12[_0xd49f('0xc')]||![];this[_0xd49f('0xd')]=_0x57b7b5[_0xd49f('0xd')];this[_0xd49f('0xe')]=_0x57b7b5[_0xd49f('0xe')]||0x3;this[_0xd49f('0xf')]=_0x562f12[_0xd49f('0xf')];this[_0xd49f('0x10')]=_0x562f12['countbusyretry'];this[_0xd49f('0x11')]=_0x562f12[_0xd49f('0x11')];this[_0xd49f('0x12')]=_0x562f12[_0xd49f('0x12')];this[_0xd49f('0x13')]=_0x562f12[_0xd49f('0x13')];this[_0xd49f('0x14')]=_0x562f12['countdropretry'];this['countabandonedretry']=_0x562f12['countabandonedretry'];this[_0xd49f('0x15')]=_0x562f12[_0xd49f('0x15')];this['countagentrejectretry']=_0x562f12['countagentrejectretry'];this[_0xd49f('0x16')]=_0x562f12[_0xd49f('0x16')];this[_0xd49f('0x17')]=_0x562f12['ListId'];this['UserId']=_0x562f12[_0xd49f('0x18')];this[_0xd49f('0x19')]=_0x562f12[_0xd49f('0x19')];this[_0xd49f('0x1a')]=_0x562f12[_0xd49f('0x1a')];this[_0xd49f('0x1b')]=_0x562f12['id'];this[_0xd49f('0x1c')]=_0x562f12[_0xd49f('0x8')][_0xd49f('0x9')]||'';this['starttime']=moment()['format'](_0xd49f('0x1d'));this[_0xd49f('0x1e')]=_0x562f12[_0xd49f('0x1e')];this['callbackuniqueid']=_0x562f12[_0xd49f('0x1f')];this[_0xd49f('0x20')]=_0x562f12[_0xd49f('0x20')];this[_0xd49f('0x21')]=_0x562f12[_0xd49f('0x21')];this[_0xd49f('0x22')]='';this['originatecalleridname']='';}Action[_0xd49f('0x23')][_0xd49f('0x24')]=function(){return util[_0xd49f('0x25')](_0xd49f('0x26'),this[_0xd49f('0x6')],this[_0xd49f('0x5')][_0xd49f('0x27')]>0x0?this[_0xd49f('0x28')][_0xd49f('0x29')](this[_0xd49f('0x5')][_0xd49f('0x27')]):this[_0xd49f('0x28')]);};Action[_0xd49f('0x23')][_0xd49f('0x2a')]=function(){return this[_0xd49f('0xb')];};module['exports']=Action; \ No newline at end of file +var _0x7264=['lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0x7264,0x11c));var _0x4726=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7264[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x4726('0x0'));var _=require(_0x4726('0x1'));var moment=require(_0x4726('0x2'));function checkNameSurname(_0x123d67,_0x31a0df,_0x1223f5){var _0x5497e7='';if(!_[_0x4726('0x3')](_0x31a0df)&&_0x4726('0x4')===typeof _0x31a0df){_0x5497e7+=_0x31a0df;}if(!_[_0x4726('0x3')](_0x1223f5)&&_0x4726('0x4')===typeof _0x1223f5){_0x5497e7+='\x20'+_0x1223f5;}if(_0x5497e7!==''){return _0x5497e7;}return _0x123d67;}function Action(_0x5a35bc,_0xa0385,_0x146777){this[_0x4726('0x5')]=_0x5a35bc;this['uniqueid']=_0x146777||undefined;this[_0x4726('0x6')]=checkNameSurname(_0xa0385[_0x4726('0x7')][_0x4726('0x8')],_0xa0385[_0x4726('0x7')][_0x4726('0x9')],_0xa0385[_0x4726('0x7')][_0x4726('0xa')]);this[_0x4726('0xb')]=_0xa0385[_0x4726('0x7')][_0x4726('0x8')];this[_0x4726('0xc')]=_0x5a35bc[_0x4726('0x6')];this[_0x4726('0xd')]=_0xa0385[_0x4726('0xd')]||![];this[_0x4726('0xe')]=_0x5a35bc[_0x4726('0xe')];this[_0x4726('0xf')]=_0x5a35bc['dialQueueTimeout']||0x3;this['scheduledat']=_0xa0385[_0x4726('0x10')];this[_0x4726('0x11')]=_0xa0385[_0x4726('0x11')];this[_0x4726('0x12')]=_0xa0385[_0x4726('0x12')];this['countnoanswerretry']=_0xa0385[_0x4726('0x13')];this['countnosuchnumberretry']=_0xa0385['countnosuchnumberretry'];this[_0x4726('0x14')]=_0xa0385[_0x4726('0x14')];this[_0x4726('0x15')]=_0xa0385[_0x4726('0x15')];this['countmachineretry']=_0xa0385[_0x4726('0x16')];this[_0x4726('0x17')]=_0xa0385[_0x4726('0x17')];this[_0x4726('0x18')]=_0xa0385[_0x4726('0x18')];this['ListId']=_0xa0385[_0x4726('0x19')];this[_0x4726('0x1a')]=_0xa0385[_0x4726('0x1a')];this[_0x4726('0x1b')]=_0xa0385[_0x4726('0x1b')];this[_0x4726('0x1c')]=_0xa0385[_0x4726('0x1c')];this[_0x4726('0x1d')]=_0xa0385['id'];this['ContactFirstName']=_0xa0385['Contact']['firstName']||'';this[_0x4726('0x1e')]=moment()[_0x4726('0x1f')](_0x4726('0x20'));this[_0x4726('0x21')]=_0xa0385[_0x4726('0x21')];this[_0x4726('0x22')]=_0xa0385[_0x4726('0x22')];this['callbackat']=_0xa0385[_0x4726('0x23')];this[_0x4726('0x24')]=_0xa0385['recallme'];this[_0x4726('0x25')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x4726('0x6')],this[_0x4726('0x5')][_0x4726('0x26')]>0x0?this[_0x4726('0xb')][_0x4726('0x27')](this['voiceQueue'][_0x4726('0x26')]):this[_0x4726('0xb')]);};Action['prototype'][_0x4726('0x28')]=function(){return this[_0x4726('0xc')];};module[_0x4726('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 90989f9..1f1d4dc 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f73=['campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x2f73,0x1dc));var _0x32f7=function(_0x1bce91,_0x2b6500){_0x1bce91=_0x1bce91-0x0;var _0x3c20c2=_0x2f73[_0x1bce91];return _0x3c20c2;};'use strict';var util=require(_0x32f7('0x0'));var _=require('lodash');var moment=require(_0x32f7('0x1'));function getSeconds(_0x2239a9,_0x38ab90){var _0x1b75f0=moment(_0x2239a9)[_0x32f7('0x2')](0x0);var _0x2396a5=moment(_0x38ab90)['milliseconds'](0x0);return _0x1b75f0[_0x32f7('0x3')](_0x2396a5,_0x32f7('0x4'));}function AgentComplete(_0x2b9e9d,_0x576fa9){this['state']=0x4;this['statedesc']=_0x32f7('0x5');this[_0x32f7('0x6')]=_0x2b9e9d[_0x32f7('0x6')];this[_0x32f7('0x7')]=_0x2b9e9d['type'];this[_0x32f7('0x8')]=_0x2b9e9d[_0x32f7('0x7')]===_0x32f7('0x9')?'queue':_0x2b9e9d['type'];this[_0x32f7('0xa')]=_0x2b9e9d['countbusyretry'];this[_0x32f7('0xb')]=_0x2b9e9d['countcongestionretry'];this['countnoanswerretry']=_0x2b9e9d[_0x32f7('0xc')];this[_0x32f7('0xd')]=_0x2b9e9d[_0x32f7('0xa')]+_0x2b9e9d[_0x32f7('0xb')]+_0x2b9e9d[_0x32f7('0xc')]+_0x2b9e9d[_0x32f7('0xe')]+_0x2b9e9d['countdropretry']+_0x2b9e9d['countabandonedretry']+_0x2b9e9d[_0x32f7('0xf')]+_0x2b9e9d[_0x32f7('0x10')];this[_0x32f7('0xe')]=_0x2b9e9d['countnosuchnumberretry'];this[_0x32f7('0x11')]=_0x2b9e9d[_0x32f7('0x11')];this[_0x32f7('0x12')]=_0x2b9e9d['countabandonedretry'];this[_0x32f7('0xf')]=_0x2b9e9d[_0x32f7('0xf')];this[_0x32f7('0x10')]=_0x2b9e9d[_0x32f7('0x10')];this[_0x32f7('0x13')]=_0x576fa9['uniqueid'];this[_0x32f7('0x14')]=_0x2b9e9d['name'];this[_0x32f7('0x15')]=_0x2b9e9d[_0x32f7('0x16')];this[_0x32f7('0x17')]=_0x2b9e9d[_0x32f7('0x17')];this[_0x32f7('0x18')]=_0x2b9e9d[_0x32f7('0x18')];this[_0x32f7('0x19')]=_0x2b9e9d[_0x32f7('0x19')];this[_0x32f7('0x1a')]=moment()[_0x32f7('0x1b')](_0x32f7('0x1c'));this[_0x32f7('0x1d')]=getSeconds(_0x2b9e9d[_0x32f7('0x18')],_0x2b9e9d[_0x32f7('0x17')]);this['holdtime']=getSeconds(_0x2b9e9d[_0x32f7('0x19')],_0x2b9e9d[_0x32f7('0x18')]);this[_0x32f7('0x1e')]=getSeconds(this[_0x32f7('0x1a')],_0x2b9e9d['answertime']);this[_0x32f7('0x1f')]=_0x576fa9[_0x32f7('0x1f')];this[_0x32f7('0x20')]=_0x576fa9[_0x32f7('0x20')];this[_0x32f7('0x21')]=_0x576fa9[_0x32f7('0x21')];this[_0x32f7('0x22')]=_0x2b9e9d[_0x32f7('0x22')];this[_0x32f7('0x23')]=_0x2b9e9d[_0x32f7('0x23')];this[_0x32f7('0x24')]=_0x2b9e9d[_0x32f7('0x24')];this[_0x32f7('0x25')]=_0x2b9e9d[_0x32f7('0x25')];this['ContactId']=_0x2b9e9d['ContactId'];this[_0x32f7('0x26')]=_0x2b9e9d[_0x32f7('0x26')];this[_0x32f7('0x27')]=_0x2b9e9d[_0x32f7('0x27')];this[_0x32f7('0x28')]=_0x2b9e9d[_0x32f7('0x28')];this[_0x32f7('0x29')]=_0x2b9e9d[_0x32f7('0x29')];this[_0x32f7('0x2a')]=_0x2b9e9d[_0x32f7('0x2a')]||'';this[_0x32f7('0x2b')]=_0x2b9e9d[_0x32f7('0x2b')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x0132=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0x23f367,_0x2e8a9c){var _0x4effb3=function(_0x58cfd6){while(--_0x58cfd6){_0x23f367['push'](_0x23f367['shift']());}};_0x4effb3(++_0x2e8a9c);}(_0x0132,0xfc));var _0x2013=function(_0x24b650,_0x34a372){_0x24b650=_0x24b650-0x0;var _0x19c07b=_0x0132[_0x24b650];return _0x19c07b;};'use strict';var util=require('util');var _=require(_0x2013('0x0'));var moment=require(_0x2013('0x1'));function getSeconds(_0x4ef78d,_0xd0d383){var _0x5cda98=moment(_0x4ef78d)[_0x2013('0x2')](0x0);var _0x460dc5=moment(_0xd0d383)[_0x2013('0x2')](0x0);return _0x5cda98['diff'](_0x460dc5,_0x2013('0x3'));}function AgentComplete(_0x8dbadf,_0x499b2f){this[_0x2013('0x4')]=0x4;this[_0x2013('0x5')]='Answer';this[_0x2013('0x6')]=_0x8dbadf[_0x2013('0x6')];this['type']=_0x8dbadf[_0x2013('0x7')];this['campaigntype']=_0x8dbadf['type']===_0x2013('0x8')?_0x2013('0x9'):_0x8dbadf['type'];this['countbusyretry']=_0x8dbadf[_0x2013('0xa')];this['countcongestionretry']=_0x8dbadf[_0x2013('0xb')];this[_0x2013('0xc')]=_0x8dbadf[_0x2013('0xc')];this[_0x2013('0xd')]=_0x8dbadf[_0x2013('0xa')]+_0x8dbadf[_0x2013('0xb')]+_0x8dbadf['countnoanswerretry']+_0x8dbadf['countnosuchnumberretry']+_0x8dbadf[_0x2013('0xe')]+_0x8dbadf[_0x2013('0xf')]+_0x8dbadf[_0x2013('0x10')]+_0x8dbadf[_0x2013('0x11')];this[_0x2013('0x12')]=_0x8dbadf[_0x2013('0x12')];this[_0x2013('0xe')]=_0x8dbadf[_0x2013('0xe')];this[_0x2013('0xf')]=_0x8dbadf[_0x2013('0xf')];this[_0x2013('0x10')]=_0x8dbadf[_0x2013('0x10')];this[_0x2013('0x11')]=_0x8dbadf['countagentrejectretry'];this[_0x2013('0x13')]=_0x499b2f[_0x2013('0x13')];this['calleridname']=_0x8dbadf['name'];this['calleridnum']=_0x8dbadf[_0x2013('0x14')];this[_0x2013('0x15')]=_0x8dbadf[_0x2013('0x15')];this[_0x2013('0x16')]=_0x8dbadf[_0x2013('0x16')];this[_0x2013('0x17')]=_0x8dbadf['answertime'];this[_0x2013('0x18')]=moment()[_0x2013('0x19')](_0x2013('0x1a'));this['ringtime']=getSeconds(_0x8dbadf['responsetime'],_0x8dbadf[_0x2013('0x15')]);this[_0x2013('0x1b')]=getSeconds(_0x8dbadf['answertime'],_0x8dbadf[_0x2013('0x16')]);this[_0x2013('0x1c')]=getSeconds(this[_0x2013('0x18')],_0x8dbadf[_0x2013('0x17')]);this[_0x2013('0x9')]=_0x499b2f[_0x2013('0x9')];this['membername']=_0x499b2f['membername'];this[_0x2013('0x1d')]=_0x499b2f['reason'];this[_0x2013('0x1e')]=_0x8dbadf[_0x2013('0x1e')];this['callbackuniqueid']=_0x8dbadf[_0x2013('0x1f')];this['callbackat']=_0x8dbadf['callbackat'];this[_0x2013('0x20')]=_0x8dbadf[_0x2013('0x20')];this[_0x2013('0x21')]=_0x8dbadf['ContactId'];this[_0x2013('0x22')]=_0x8dbadf['ListId'];this[_0x2013('0x23')]=_0x8dbadf[_0x2013('0x23')];this[_0x2013('0x24')]=_0x8dbadf[_0x2013('0x24')];this[_0x2013('0x25')]=_0x8dbadf['CampaignId'];this[_0x2013('0x26')]=_0x8dbadf['originatecalleridnum']||'';this[_0x2013('0x27')]=_0x8dbadf[_0x2013('0x27')]||'';}module[_0x2013('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index f8415c9..08a0dac 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd50=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xbd50,0x196));var _0x0bd5=function(_0x237e94,_0x416d08){_0x237e94=_0x237e94-0x0;var _0x3f6126=_0xbd50[_0x237e94];return _0x3f6126;};'use strict';var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));function getSeconds(_0x4acbd6,_0x44fcb9){var _0x167372=moment(_0x4acbd6)[_0x0bd5('0x3')](0x0);var _0x1e9877=moment(_0x44fcb9)[_0x0bd5('0x3')](0x0);return _0x167372['diff'](_0x1e9877,'seconds');}function Final(_0x560cf1){this[_0x0bd5('0x4')]=_0x560cf1[_0x0bd5('0x4')];this[_0x0bd5('0x5')]=_0x560cf1[_0x0bd5('0x5')];this[_0x0bd5('0x6')]=_0x560cf1['type'];this['campaigntype']=_0x560cf1[_0x0bd5('0x6')]===_0x0bd5('0x7')?_0x0bd5('0x8'):_0x560cf1['type'];this[_0x0bd5('0x9')]=_0x560cf1[_0x0bd5('0x9')];this['countcongestionretry']=_0x560cf1[_0x0bd5('0xa')];this[_0x0bd5('0xb')]=_0x560cf1['countnoanswerretry'];this[_0x0bd5('0xc')]=_0x560cf1[_0x0bd5('0x9')]+_0x560cf1[_0x0bd5('0xa')]+_0x560cf1['countnoanswerretry']+_0x560cf1[_0x0bd5('0xd')]+_0x560cf1[_0x0bd5('0xe')]+_0x560cf1[_0x0bd5('0xf')]+_0x560cf1[_0x0bd5('0x10')]+_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0xd')]=_0x560cf1[_0x0bd5('0xd')];this[_0x0bd5('0xe')]=_0x560cf1['countdropretry'];this[_0x0bd5('0xf')]=_0x560cf1[_0x0bd5('0xf')];this['countmachineretry']=_0x560cf1[_0x0bd5('0x10')];this[_0x0bd5('0x11')]=_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0x8')]=_0x560cf1['queue'];this[_0x0bd5('0x12')]=_0x560cf1[_0x0bd5('0x12')];this[_0x0bd5('0x13')]=_0x560cf1[_0x0bd5('0x13')];this[_0x0bd5('0x14')]=_0x560cf1[_0x0bd5('0x14')];this[_0x0bd5('0x15')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x16')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x17')]=_0x560cf1[_0x0bd5('0x17')]||0x0;this[_0x0bd5('0x18')]=_0x560cf1[_0x0bd5('0x18')]||0x0;this['talktime']=_0x560cf1['talktime']||0x0;this['callback']=_0x560cf1['callback'];this['callbackuniqueid']=_0x560cf1[_0x0bd5('0x19')];this[_0x0bd5('0x1a')]=_0x560cf1[_0x0bd5('0x1a')];this[_0x0bd5('0x1b')]=_0x560cf1[_0x0bd5('0x1b')];this['ContactId']=_0x560cf1[_0x0bd5('0x1c')];this[_0x0bd5('0x1d')]=_0x560cf1[_0x0bd5('0x1d')];this['UserId']=_0x560cf1[_0x0bd5('0x1e')];this['VoiceQueueId']=_0x560cf1['VoiceQueueId'];this[_0x0bd5('0x1f')]=_0x560cf1[_0x0bd5('0x1f')];this[_0x0bd5('0x20')]=_0x560cf1['originatecalleridnum']||'';this[_0x0bd5('0x21')]=_0x560cf1['originatecalleridname']||'';}module[_0x0bd5('0x22')]=Final; \ No newline at end of file +var _0xeec6=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x10c814,_0x2c5349){var _0x3620e8=function(_0x2da52a){while(--_0x2da52a){_0x10c814['push'](_0x10c814['shift']());}};_0x3620e8(++_0x2c5349);}(_0xeec6,0x1c2));var _0x6eec=function(_0x326a44,_0x41c393){_0x326a44=_0x326a44-0x0;var _0x218e10=_0xeec6[_0x326a44];return _0x218e10;};'use strict';var util=require(_0x6eec('0x0'));var _=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));function getSeconds(_0x33cc53,_0x535568){var _0x471d43=moment(_0x33cc53)[_0x6eec('0x3')](0x0);var _0x1699ce=moment(_0x535568)[_0x6eec('0x3')](0x0);return _0x471d43[_0x6eec('0x4')](_0x1699ce,_0x6eec('0x5'));}function Final(_0x4fedce){this[_0x6eec('0x6')]=_0x4fedce[_0x6eec('0x6')];this['scheduledat']=_0x4fedce[_0x6eec('0x7')];this[_0x6eec('0x8')]=_0x4fedce[_0x6eec('0x8')];this[_0x6eec('0x9')]=_0x4fedce['type']===_0x6eec('0xa')?_0x6eec('0xb'):_0x4fedce[_0x6eec('0x8')];this['countbusyretry']=_0x4fedce['countbusyretry'];this['countcongestionretry']=_0x4fedce[_0x6eec('0xc')];this[_0x6eec('0xd')]=_0x4fedce['countnoanswerretry'];this['countglobal']=_0x4fedce[_0x6eec('0xe')]+_0x4fedce['countcongestionretry']+_0x4fedce[_0x6eec('0xd')]+_0x4fedce[_0x6eec('0xf')]+_0x4fedce[_0x6eec('0x10')]+_0x4fedce[_0x6eec('0x11')]+_0x4fedce[_0x6eec('0x12')]+_0x4fedce['countagentrejectretry'];this[_0x6eec('0xf')]=_0x4fedce[_0x6eec('0xf')];this[_0x6eec('0x10')]=_0x4fedce[_0x6eec('0x10')];this[_0x6eec('0x11')]=_0x4fedce[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x4fedce[_0x6eec('0x12')];this[_0x6eec('0x13')]=_0x4fedce[_0x6eec('0x13')];this['queue']=_0x4fedce[_0x6eec('0xb')];this['calleridname']=_0x4fedce[_0x6eec('0x14')];this[_0x6eec('0x15')]=_0x4fedce['calleridnum'];this[_0x6eec('0x16')]=_0x4fedce[_0x6eec('0x16')];this[_0x6eec('0x17')]=_0x4fedce['responsetime'];this[_0x6eec('0x18')]=_0x4fedce[_0x6eec('0x17')];this[_0x6eec('0x19')]=_0x4fedce[_0x6eec('0x19')]||0x0;this[_0x6eec('0x1a')]=_0x4fedce[_0x6eec('0x1a')]||0x0;this['talktime']=_0x4fedce[_0x6eec('0x1b')]||0x0;this[_0x6eec('0x1c')]=_0x4fedce[_0x6eec('0x1c')];this[_0x6eec('0x1d')]=_0x4fedce[_0x6eec('0x1d')];this[_0x6eec('0x1e')]=_0x4fedce['callbackat'];this[_0x6eec('0x1f')]=_0x4fedce[_0x6eec('0x1f')];this[_0x6eec('0x20')]=_0x4fedce[_0x6eec('0x20')];this[_0x6eec('0x21')]=_0x4fedce[_0x6eec('0x21')];this['UserId']=_0x4fedce[_0x6eec('0x22')];this[_0x6eec('0x23')]=_0x4fedce[_0x6eec('0x23')];this[_0x6eec('0x24')]=_0x4fedce[_0x6eec('0x24')];this[_0x6eec('0x25')]=_0x4fedce[_0x6eec('0x25')]||'';this[_0x6eec('0x26')]=_0x4fedce[_0x6eec('0x26')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index af42ad6..8447834 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1002=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','type','campaigntype','countbusyretry'];(function(_0x418265,_0x594273){var _0x44bb76=function(_0xc29317){while(--_0xc29317){_0x418265['push'](_0x418265['shift']());}};_0x44bb76(++_0x594273);}(_0x1002,0x129));var _0x2100=function(_0x2ca02c,_0x5bc7e){_0x2ca02c=_0x2ca02c-0x0;var _0x1a353b=_0x1002[_0x2ca02c];return _0x1a353b;};'use strict';var util=require(_0x2100('0x0'));var _=require(_0x2100('0x1'));var moment=require(_0x2100('0x2'));function getSeconds(_0x3bb289,_0x1f7ba9){var _0xff5891=moment(_0x3bb289)[_0x2100('0x3')](0x0);var _0x128ceb=moment(_0x1f7ba9)['milliseconds'](0x0);return _0xff5891[_0x2100('0x4')](_0x128ceb,'seconds');}function Hangup(_0x2ad955,_0x1ceaab){this[_0x2100('0x5')]=0x4;this[_0x2100('0x6')]=_0x2100('0x7');this['scheduledat']=_0x2ad955['scheduledat'];this[_0x2100('0x8')]=_0x2ad955[_0x2100('0x8')];this[_0x2100('0x9')]=_0x2ad955[_0x2100('0x8')]==='outbound'?'queue':_0x2ad955['type'];this[_0x2100('0xa')]=_0x2ad955['countbusyretry'];this['countcongestionretry']=_0x2ad955[_0x2100('0xb')];this[_0x2100('0xc')]=_0x2ad955[_0x2100('0xc')];this[_0x2100('0xd')]=_0x2ad955[_0x2100('0xa')]+_0x2ad955[_0x2100('0xb')]+_0x2ad955[_0x2100('0xc')]+_0x2ad955[_0x2100('0xe')]+_0x2ad955[_0x2100('0xf')]+_0x2ad955[_0x2100('0x10')]+_0x2ad955['countmachineretry']+_0x2ad955[_0x2100('0x11')];this[_0x2100('0xe')]=_0x2ad955['countnosuchnumberretry'];this[_0x2100('0xf')]=_0x2ad955[_0x2100('0xf')];this['countabandonedretry']=_0x2ad955[_0x2100('0x10')];this[_0x2100('0x12')]=_0x2ad955['countmachineretry'];this[_0x2100('0x11')]=_0x2ad955[_0x2100('0x11')];this[_0x2100('0x13')]=_0x1ceaab[_0x2100('0x13')];this[_0x2100('0x14')]=_0x2ad955[_0x2100('0x15')];this[_0x2100('0x16')]=_0x2ad955[_0x2100('0x17')];this['starttime']=_0x2ad955[_0x2100('0x18')];this[_0x2100('0x19')]=_0x2ad955['responsetime'];this[_0x2100('0x1a')]=moment()[_0x2100('0x1b')](_0x2100('0x1c'));this[_0x2100('0x1d')]=getSeconds(_0x2ad955['responsetime'],_0x2ad955[_0x2100('0x18')]);this[_0x2100('0x1e')]=0x0;this[_0x2100('0x1f')]=getSeconds(this[_0x2100('0x1a')],_0x2ad955['responsetime']);this[_0x2100('0x20')]=_0x2ad955[_0x2100('0x20')];this['membername']=_0x2100('0x21');this['reason']=_0x1ceaab['cause-txt'];this[_0x2100('0x22')]=_0x2ad955[_0x2100('0x22')];this[_0x2100('0x23')]=_0x2ad955[_0x2100('0x23')];this[_0x2100('0x24')]=_0x2ad955[_0x2100('0x24')];this[_0x2100('0x25')]=_0x2ad955[_0x2100('0x25')];this[_0x2100('0x26')]=_0x2ad955[_0x2100('0x26')];this[_0x2100('0x27')]=_0x2ad955[_0x2100('0x27')];this[_0x2100('0x28')]=_0x2ad955['UserId'];this[_0x2100('0x29')]=_0x2ad955[_0x2100('0x29')];this[_0x2100('0x2a')]=_0x2ad955[_0x2100('0x2a')];}module[_0x2100('0x2b')]=Hangup; \ No newline at end of file +var _0xff39=['seconds','state','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xff39,0x1a2));var _0x9ff3=function(_0x202438,_0x21f696){_0x202438=_0x202438-0x0;var _0x43a7f1=_0xff39[_0x202438];return _0x43a7f1;};'use strict';var util=require(_0x9ff3('0x0'));var _=require(_0x9ff3('0x1'));var moment=require(_0x9ff3('0x2'));function getSeconds(_0x15f062,_0x1a2abb){var _0x51eea0=moment(_0x15f062)[_0x9ff3('0x3')](0x0);var _0x44521b=moment(_0x1a2abb)[_0x9ff3('0x3')](0x0);return _0x51eea0[_0x9ff3('0x4')](_0x44521b,_0x9ff3('0x5'));}function Hangup(_0x536161,_0x1e96dd){this[_0x9ff3('0x6')]=0x4;this['statedesc']=_0x9ff3('0x7');this[_0x9ff3('0x8')]=_0x536161['scheduledat'];this[_0x9ff3('0x9')]=_0x536161['type'];this[_0x9ff3('0xa')]=_0x536161[_0x9ff3('0x9')]==='outbound'?'queue':_0x536161[_0x9ff3('0x9')];this[_0x9ff3('0xb')]=_0x536161[_0x9ff3('0xb')];this[_0x9ff3('0xc')]=_0x536161[_0x9ff3('0xc')];this[_0x9ff3('0xd')]=_0x536161[_0x9ff3('0xd')];this[_0x9ff3('0xe')]=_0x536161[_0x9ff3('0xb')]+_0x536161[_0x9ff3('0xc')]+_0x536161[_0x9ff3('0xd')]+_0x536161[_0x9ff3('0xf')]+_0x536161[_0x9ff3('0x10')]+_0x536161[_0x9ff3('0x11')]+_0x536161[_0x9ff3('0x12')]+_0x536161[_0x9ff3('0x13')];this[_0x9ff3('0xf')]=_0x536161[_0x9ff3('0xf')];this[_0x9ff3('0x10')]=_0x536161[_0x9ff3('0x10')];this[_0x9ff3('0x11')]=_0x536161[_0x9ff3('0x11')];this[_0x9ff3('0x12')]=_0x536161[_0x9ff3('0x12')];this['countagentrejectretry']=_0x536161['countagentrejectretry'];this[_0x9ff3('0x14')]=_0x1e96dd[_0x9ff3('0x14')];this[_0x9ff3('0x15')]=_0x536161[_0x9ff3('0x16')];this[_0x9ff3('0x17')]=_0x536161[_0x9ff3('0x18')];this['starttime']=_0x536161[_0x9ff3('0x19')];this[_0x9ff3('0x1a')]=_0x536161[_0x9ff3('0x1a')];this[_0x9ff3('0x1b')]=moment()[_0x9ff3('0x1c')](_0x9ff3('0x1d'));this[_0x9ff3('0x1e')]=getSeconds(_0x536161[_0x9ff3('0x1a')],_0x536161[_0x9ff3('0x19')]);this['holdtime']=0x0;this[_0x9ff3('0x1f')]=getSeconds(this['endtime'],_0x536161[_0x9ff3('0x1a')]);this[_0x9ff3('0x20')]=_0x536161[_0x9ff3('0x20')];this[_0x9ff3('0x21')]=_0x9ff3('0x22');this[_0x9ff3('0x23')]=_0x1e96dd[_0x9ff3('0x24')];this[_0x9ff3('0x25')]=_0x536161[_0x9ff3('0x25')];this[_0x9ff3('0x26')]=_0x536161['callbackuniqueid'];this[_0x9ff3('0x27')]=_0x536161[_0x9ff3('0x27')];this['recallme']=_0x536161[_0x9ff3('0x28')];this[_0x9ff3('0x29')]=_0x536161['ContactId'];this['ListId']=_0x536161[_0x9ff3('0x2a')];this[_0x9ff3('0x2b')]=_0x536161[_0x9ff3('0x2b')];this[_0x9ff3('0x2c')]=_0x536161[_0x9ff3('0x2c')];this[_0x9ff3('0x2d')]=_0x536161[_0x9ff3('0x2d')];}module[_0x9ff3('0x2e')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index cbcbefc..6e7c7c8 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x790c=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback'];(function(_0xcb464e,_0xb64c0b){var _0x249bba=function(_0x19b301){while(--_0x19b301){_0xcb464e['push'](_0xcb464e['shift']());}};_0x249bba(++_0xb64c0b);}(_0x790c,0x106));var _0xc790=function(_0x515f3a,_0x5adbf4){_0x515f3a=_0x515f3a-0x0;var _0x1e90cc=_0x790c[_0x515f3a];return _0x1e90cc;};'use strict';var util=require(_0xc790('0x0'));var _=require(_0xc790('0x1'));var moment=require('moment');function getSeconds(_0x560661,_0x5cefae){var _0x171404=moment(_0x560661)[_0xc790('0x2')](0x0);var _0x7509cd=moment(_0x5cefae)[_0xc790('0x2')](0x0);return _0x171404[_0xc790('0x3')](_0x7509cd,'seconds');}function History(_0x2c1d64){this[_0xc790('0x4')]=_0x2c1d64[_0xc790('0x4')];this['scheduledat']=_0x2c1d64[_0xc790('0x5')]||undefined;this[_0xc790('0x6')]=_0x2c1d64['type'];this['campaigntype']=_0x2c1d64[_0xc790('0x6')]===_0xc790('0x7')?_0xc790('0x8'):_0x2c1d64[_0xc790('0x6')];this[_0xc790('0x9')]=_0x2c1d64[_0xc790('0x9')];this[_0xc790('0xa')]=_0x2c1d64[_0xc790('0xa')];this[_0xc790('0xb')]=_0x2c1d64['countnoanswerretry'];this['countglobal']=_0x2c1d64[_0xc790('0x9')]+_0x2c1d64['countcongestionretry']+_0x2c1d64['countnoanswerretry']+_0x2c1d64[_0xc790('0xc')]+_0x2c1d64[_0xc790('0xd')]+_0x2c1d64[_0xc790('0xe')]+_0x2c1d64[_0xc790('0xf')]+_0x2c1d64[_0xc790('0x10')];this[_0xc790('0xc')]=_0x2c1d64['countnosuchnumberretry'];this[_0xc790('0xd')]=_0x2c1d64[_0xc790('0xd')];this[_0xc790('0xe')]=_0x2c1d64['countabandonedretry'];this[_0xc790('0xf')]=_0x2c1d64[_0xc790('0xf')];this['countagentrejectretry']=_0x2c1d64[_0xc790('0x10')];this[_0xc790('0x8')]=_0x2c1d64[_0xc790('0x8')];this[_0xc790('0x11')]=_0x2c1d64['name'];this[_0xc790('0x12')]=_0x2c1d64[_0xc790('0x13')];this[_0xc790('0x14')]=_0x2c1d64[_0xc790('0x14')];this[_0xc790('0x15')]=_0x2c1d64[_0xc790('0x15')];this[_0xc790('0x16')]=_0x2c1d64[_0xc790('0x15')];this['ringtime']=getSeconds(_0x2c1d64[_0xc790('0x15')],_0x2c1d64['starttime']);this[_0xc790('0x17')]=0x0;this[_0xc790('0x18')]=0x0;this['callback']=_0x2c1d64[_0xc790('0x19')];this[_0xc790('0x1a')]=_0x2c1d64[_0xc790('0x1a')];this[_0xc790('0x1b')]=_0x2c1d64['callbackat'];this[_0xc790('0x1c')]=_0x2c1d64['recallme'];this[_0xc790('0x1d')]=_0x2c1d64[_0xc790('0x1d')];this['ListId']=_0x2c1d64[_0xc790('0x1e')];this[_0xc790('0x1f')]=_0x2c1d64[_0xc790('0x1f')];this['VoiceQueueId']=_0x2c1d64['VoiceQueueId'];this[_0xc790('0x20')]=_0x2c1d64[_0xc790('0x20')];this[_0xc790('0x21')]=_0x2c1d64[_0xc790('0x21')]||'';this[_0xc790('0x22')]=_0x2c1d64[_0xc790('0x22')]||'';}module[_0xc790('0x23')]=History; \ No newline at end of file +var _0x548f=['type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x52bb87,_0x84df0c){var _0x1d9ee1=function(_0x1c821e){while(--_0x1c821e){_0x52bb87['push'](_0x52bb87['shift']());}};_0x1d9ee1(++_0x84df0c);}(_0x548f,0x121));var _0xf548=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x548f[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0xf548('0x0'));var _=require(_0xf548('0x1'));var moment=require(_0xf548('0x2'));function getSeconds(_0x4a7f39,_0x36e36f){var _0x3ea624=moment(_0x4a7f39)[_0xf548('0x3')](0x0);var _0xeb65a1=moment(_0x36e36f)[_0xf548('0x3')](0x0);return _0x3ea624[_0xf548('0x4')](_0xeb65a1,_0xf548('0x5'));}function History(_0x11b163){this['uniqueid']=_0x11b163['uniqueid'];this[_0xf548('0x6')]=_0x11b163[_0xf548('0x6')]||undefined;this[_0xf548('0x7')]=_0x11b163['type'];this[_0xf548('0x8')]=_0x11b163['type']==='outbound'?_0xf548('0x9'):_0x11b163['type'];this[_0xf548('0xa')]=_0x11b163['countbusyretry'];this[_0xf548('0xb')]=_0x11b163[_0xf548('0xb')];this[_0xf548('0xc')]=_0x11b163[_0xf548('0xc')];this[_0xf548('0xd')]=_0x11b163['countbusyretry']+_0x11b163[_0xf548('0xb')]+_0x11b163[_0xf548('0xc')]+_0x11b163[_0xf548('0xe')]+_0x11b163[_0xf548('0xf')]+_0x11b163[_0xf548('0x10')]+_0x11b163[_0xf548('0x11')]+_0x11b163[_0xf548('0x12')];this['countnosuchnumberretry']=_0x11b163['countnosuchnumberretry'];this['countdropretry']=_0x11b163[_0xf548('0xf')];this[_0xf548('0x10')]=_0x11b163[_0xf548('0x10')];this['countmachineretry']=_0x11b163[_0xf548('0x11')];this[_0xf548('0x12')]=_0x11b163[_0xf548('0x12')];this[_0xf548('0x9')]=_0x11b163[_0xf548('0x9')];this['calleridname']=_0x11b163[_0xf548('0x13')];this[_0xf548('0x14')]=_0x11b163[_0xf548('0x15')];this[_0xf548('0x16')]=_0x11b163[_0xf548('0x16')];this[_0xf548('0x17')]=_0x11b163['responsetime'];this['endtime']=_0x11b163[_0xf548('0x17')];this[_0xf548('0x18')]=getSeconds(_0x11b163['responsetime'],_0x11b163[_0xf548('0x16')]);this['holdtime']=0x0;this[_0xf548('0x19')]=0x0;this['callback']=_0x11b163[_0xf548('0x1a')];this[_0xf548('0x1b')]=_0x11b163[_0xf548('0x1b')];this[_0xf548('0x1c')]=_0x11b163[_0xf548('0x1c')];this['recallme']=_0x11b163[_0xf548('0x1d')];this[_0xf548('0x1e')]=_0x11b163[_0xf548('0x1e')];this['ListId']=_0x11b163[_0xf548('0x1f')];this['UserId']=_0x11b163[_0xf548('0x20')];this[_0xf548('0x21')]=_0x11b163[_0xf548('0x21')];this[_0xf548('0x22')]=_0x11b163[_0xf548('0x22')];this[_0xf548('0x23')]=_0x11b163['originatecalleridnum']||'';this['originatecalleridname']=_0x11b163[_0xf548('0x24')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 6a335c7..1f26af3 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 _0xaa53=['exten','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','buildObj','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HANGUP','membername','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countagentrejectretry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','rescheduleContact','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','Queue','checkPreviewRecallReminder','Agent','user:%s','user:dialPreviewRecallReminder','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','launchHandleIvr','\x5cw{0,','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialer','ACTIVE','dialAMDInitialSilence','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','getContactDialerIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangBusyFactor','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','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','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','isNil','Action','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','type','[Dialer][checkChannel][ivr]','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','status','reachable','saveInDb','uniqueid','variable','amdstatus'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xaa53,0x138));var _0x3aa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa53[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x3aa5('0x0'));var _=require(_0x3aa5('0x1'));var BPromise=require(_0x3aa5('0x2'));var uuid=require(_0x3aa5('0x3'));var moment=require(_0x3aa5('0x4'));var rr=require('rr');var md5=require(_0x3aa5('0x5'));var Redis=require(_0x3aa5('0x6'));var ut=require('../preview/util/util');var config=require(_0x3aa5('0x7'));var logger=require(_0x3aa5('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0x3aa5('0x9'));var loggerPredictive=require('../../../config/logger')(_0x3aa5('0xa'));var loggerPredictiveCalls=require(_0x3aa5('0x8'))(_0x3aa5('0xb'));var loggerSyncQueueSummary=require(_0x3aa5('0x8'))(_0x3aa5('0xc'));var ami=require('../ami');config['redis']=_[_0x3aa5('0xd')](config[_0x3aa5('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x3aa5('0xf'))(new Redis(config[_0x3aa5('0xe')]));var cmHopper=require(_0x3aa5('0x10'));var cmHopperHistory=require(_0x3aa5('0x11'));var cmHopperBlack=require(_0x3aa5('0x12'));var voiceQueueRt=require(_0x3aa5('0x13'));var RpcSetting=require(_0x3aa5('0x14'));var Action=require(_0x3aa5('0x15'));var History=require(_0x3aa5('0x16'));var Final=require(_0x3aa5('0x17'));var AgentComplete=require(_0x3aa5('0x18'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x3aa5('0x19')][_0x3aa5('0x1a')]||_0x3aa5('0x1b');var strategy={'rrmemory':_0x3aa5('0x1c'),'roundrobin':_0x3aa5('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3aa5('0x1e')][_0x3aa5('0x1f')]=function(_0x3520db){this[_0x3aa5('0x20')]=this['tail']?this[_0x3aa5('0x20')][_0x3aa5('0x21')](_0x3520db):_0x3520db();};function Dialer(_0x579efb,_0x3b8d55){this['sequence']=new Sequence();this['preview']=_0x3b8d55;this['voiceQueues']=_0x579efb[_0x3aa5('0x22')];this[_0x3aa5('0x23')]=_0x579efb['campaigns'];this[_0x3aa5('0x24')]=_0x579efb['agents'];this[_0x3aa5('0x25')]=_0x579efb[_0x3aa5('0x25')];this[_0x3aa5('0x26')]=config[_0x3aa5('0x26')]||0x2;this[_0x3aa5('0x27')]={};this[_0x3aa5('0x28')]={};this[_0x3aa5('0x29')]={};this['uniqueId']={};this[_0x3aa5('0x2a')]={};this[_0x3aa5('0x2b')]={};this['startProgressive']={};this[_0x3aa5('0x2c')]={};this['queueBooked']={};this[_0x3aa5('0x2d')]={};ami['on'](_0x3aa5('0x2e'),this[_0x3aa5('0x2f')][_0x3aa5('0x30')](this));ami['on']('queuecallerabandon',this[_0x3aa5('0x31')][_0x3aa5('0x30')](this));ami['on'](_0x3aa5('0x32'),this[_0x3aa5('0x33')][_0x3aa5('0x30')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x3aa5('0x30')](this));ami['on'](_0x3aa5('0x34'),this['syncQueueSummary']['bind'](this));ami['on'](_0x3aa5('0x35'),this[_0x3aa5('0x36')][_0x3aa5('0x30')](this));ami['on'](_0x3aa5('0x37'),this['syncNewExten'][_0x3aa5('0x30')](this));ami['on']('varset',this[_0x3aa5('0x38')][_0x3aa5('0x30')](this));ami['on'](_0x3aa5('0x39'),this[_0x3aa5('0x3a')][_0x3aa5('0x30')](this));ami['on'](_0x3aa5('0x3b'),this[_0x3aa5('0x3c')][_0x3aa5('0x30')](this));this[_0x3aa5('0x3d')]();this[_0x3aa5('0x3e')]();RpcSetting[_0x3aa5('0x3f')]()[_0x3aa5('0x40')](function(_0x3deb1f){previewRecallmeReminderInterval=_0x3deb1f[_0x3aa5('0x41')];});}function isNotNull(_0x25850c){return _0x25850c!==null&&!_['isUndefined'](_0x25850c);}function checkIsLoggedIn(_0x589674,_0x367add){return function(){if(_0x367add<=0x0){_0x589674[_0x3aa5('0x42')]=_0x3aa5('0x43');throw _0x589674[_0x3aa5('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4fe701){return _0x4fe701;}function checkIsActive(_0x33a025,_0x565cbf){return function(){if(!isActive(_0x565cbf)){_0x33a025[_0x3aa5('0x42')]=_0x3aa5('0x45');throw _0x33a025[_0x3aa5('0x44')]+_0x3aa5('0x46');}};}function checkInterval(_0x211315){return function(){if(!isNotNull(_0x211315[_0x3aa5('0x47')])){_0x211315['message']=_0x3aa5('0x48');throw _0x211315[_0x3aa5('0x44')]+_0x3aa5('0x49');}if(!isNotNull(_0x211315[_0x3aa5('0x47')][_0x3aa5('0x4a')])){_0x211315[_0x3aa5('0x42')]=_0x3aa5('0x48');throw _0x211315[_0x3aa5('0x44')]+_0x3aa5('0x49');}if(!isNotNull(_['isEmpty'](_0x211315[_0x3aa5('0x47')][_0x3aa5('0x4a')]))){_0x211315['message']=_0x3aa5('0x48');throw _0x211315['name']+_0x3aa5('0x49');}};}function msgResponse(_0xf97d36,_0x1419be,_0x4f7552){return{'action':_0xf97d36,'response':_0x1419be,'message':_0x4f7552,'stack':_0x4f7552};}function myreject(_0xfa58a1){return function(_0x4baf64){return _0xfa58a1(msgResponse(_0x3aa5('0x4b'),_0x3aa5('0x4c'),JSON[_0x3aa5('0x4d')](_0x4baf64)));};}function getSeconds(_0x1b8031,_0x8ca2b1){var _0x356940=moment(_0x1b8031)[_0x3aa5('0x4e')](0x0);var _0x2c5044=moment(_0x8ca2b1)[_0x3aa5('0x4e')](0x0);return _0x356940[_0x3aa5('0x4f')](_0x2c5044,_0x3aa5('0x50'));}function emit(_0xa8b617,_0x795f0c,_0x214513){io['to'](_0xa8b617)[_0x3aa5('0x51')](_0x795f0c,_0x214513);}function emitVoiceQueueSummary(_0x47898c){if(_0x47898c['type']===_0x3aa5('0x52')){var _0x2d1896={'id':_0x47898c['id'],'name':_0x47898c['name'],'strategy':_0x47898c[_0x3aa5('0x53')],'answered':_0x47898c[_0x3aa5('0x54')],'available':_0x47898c[_0x3aa5('0x55')],'loggedIn':_0x47898c[_0x3aa5('0x56')],'pTalking':_0x47898c[_0x3aa5('0x57')],'sumBillable':_0x47898c['sumBillable'],'sumDuration':_0x47898c[_0x3aa5('0x58')],'sumHoldTime':_0x47898c[_0x3aa5('0x59')]||0x0,'talking':_0x47898c[_0x3aa5('0x5a')],'total':_0x47898c[_0x3aa5('0x5b')],'type':_0x47898c['type'],'unmanaged':_0x47898c[_0x3aa5('0x5c')],'abandoned':_0x47898c[_0x3aa5('0x5d')],'waiting':_0x47898c[_0x3aa5('0x5e')],'loggedInDb':_0x47898c[_0x3aa5('0x5f')],'dialActive':_0x47898c[_0x3aa5('0x60')],'dialMethod':_0x47898c[_0x3aa5('0x61')],'dialOriginateCallerIdName':_0x47898c[_0x3aa5('0x62')],'dialOriginateCallerIdNumber':_0x47898c[_0x3aa5('0x63')],'dialOriginateTimeout':_0x47898c[_0x3aa5('0x64')],'dialPrefix':_0x47898c[_0x3aa5('0x65')],'outboundAnswerAgiCallsDay':_0x47898c[_0x3aa5('0x66')],'outboundAnswerCallsDay':_0x47898c[_0x3aa5('0x67')],'outboundBlacklistCallsDay':_0x47898c[_0x3aa5('0x68')],'outboundBusyCallsDay':_0x47898c['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x47898c[_0x3aa5('0x69')],'outboundDropCallsDayACS':_0x47898c[_0x3aa5('0x6a')],'outboundDropCallsDayCallersExit':_0x47898c[_0x3aa5('0x6b')],'outboundDropCallsDayTimeout':_0x47898c[_0x3aa5('0x6c')],'outboundNoAnswerCallsDay':_0x47898c[_0x3aa5('0x6d')],'outboundNoSuchCallsDay':_0x47898c[_0x3aa5('0x6e')],'outboundOriginateFailureCallsDay':_0x47898c[_0x3aa5('0x6f')],'outboundReCallsDay':_0x47898c[_0x3aa5('0x70')],'outboundRejectCallsDay':_0x47898c[_0x3aa5('0x71')],'outboundUnknownCallsDay':_0x47898c[_0x3aa5('0x72')],'predictiveIntervalAnsweredCalls':_0x47898c[_0x3aa5('0x73')],'predictiveIntervalAvgHoldtime':_0x47898c['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x47898c[_0x3aa5('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x47898c[_0x3aa5('0x75')],'predictiveIntervalDroppedCallsTimeout':_0x47898c[_0x3aa5('0x76')],'predictiveIntervalErlangCalls':_0x47898c[_0x3aa5('0x77')],'predictiveIntervalErlangCallsDroppedCalls':_0x47898c[_0x3aa5('0x78')],'predictiveIntervalHitRate':_0x47898c[_0x3aa5('0x79')],'predictiveIntervalMultiplicativeFactor':_0x47898c[_0x3aa5('0x7a')],'predictiveIntervalPauses':_0x47898c[_0x3aa5('0x7b')],'predictiveIntervalAvailable':_0x47898c[_0x3aa5('0x7c')],'predictiveIntervalTotalCalls':_0x47898c['predictiveIntervalTotalCalls'],'message':_0x47898c[_0x3aa5('0x42')],'originated':_0x47898c[_0x3aa5('0x7d')],'erlangCalls':_0x47898c[_0x3aa5('0x7e')],'erlangCallToSecond':_0x47898c['erlangCallToSecond'],'erlangAbandonmentRate':_0x47898c['erlangAbandonmentRate'],'erlangBusyFactor':_0x47898c[_0x3aa5('0x7f')],'startPredictive':_0x47898c[_0x3aa5('0x2b')],'startProgressive':_0x47898c[_0x3aa5('0x80')]};if(_0x47898c['Trunk']){_0x2d1896['Trunk']={'id':_0x47898c['Trunk']['id'],'name':_0x47898c[_0x3aa5('0x81')][_0x3aa5('0x44')],'active':_0x47898c['Trunk'][_0x3aa5('0x82')],'callerid':_0x47898c[_0x3aa5('0x81')][_0x3aa5('0x83')]};}if(_0x47898c[_0x3aa5('0x47')]){_0x2d1896['Interval']={'id':_0x47898c[_0x3aa5('0x47')]['id'],'name':_0x47898c[_0x3aa5('0x47')][_0x3aa5('0x44')]};}var _0x230ff4=md5(JSON[_0x3aa5('0x4d')](_0x2d1896));if(_0x47898c[_0x3aa5('0x5')]!==_0x230ff4){_0x47898c[_0x3aa5('0x5')]=_0x230ff4;emit(util[_0x3aa5('0x84')](_0x3aa5('0x85'),_0x2d1896['name']),_0x3aa5('0x86'),_0x2d1896);}}}function emitCampaignSummary(_0x18ee5a){if(_0x18ee5a['type']===_0x3aa5('0x87')){emit(util['format'](_0x3aa5('0x88'),_0x18ee5a[_0x3aa5('0x44')]),'campaign:save',_0x18ee5a);}}function checkGetDataPredictive(_0x186395){if(isNotNull(_0x186395)&&!_[_0x3aa5('0x89')](_0x186395)){loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x8b'));loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x8c'),_0x186395[_0x3aa5('0x8d')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x8e'),_0x186395[_0x3aa5('0x73')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x8f'),_0x186395[_0x3aa5('0x76')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x90'),_0x186395[_0x3aa5('0x75')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x91'),_0x186395[_0x3aa5('0x92')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x186395['predictiveIntervalAvgTalktime']);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x93'));if(_0x186395[_0x3aa5('0x8d')]>0x0){if(!_[_0x3aa5('0x94')](_0x186395[_0x3aa5('0x74')])&&_0x186395[_0x3aa5('0x74')]>0x0){return!![];}loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x95'));if(!_[_0x3aa5('0x94')](_0x186395['predictiveIntervalAvgHoldtime'])&&_0x186395[_0x3aa5('0x92')]>0x0){return!![];}loggerPredictive['info'](_0x3aa5('0x96'));}else{loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x97'));}}else{loggerPredictive[_0x3aa5('0x8a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3a78fa){return function(_0x1a9e17){loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x98'));loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x99'),_0x1a9e17[_0x3aa5('0x7e')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x9a'),_0x1a9e17['erlangCallToSecond']);loggerPredictive['info'](_0x3aa5('0x9b'),_0x1a9e17[_0x3aa5('0x9c')]);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x9d'),_0x1a9e17[_0x3aa5('0x7f')]);loggerPredictive[_0x3aa5('0x8a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a9e17['erlangAbandonmentRate']);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x93'));_[_0x3aa5('0x9e')](_0x3a78fa,_0x1a9e17);};}function getDiff(_0x3bcbde){var _0x25792d=moment()[_0x3aa5('0x4e')](0x0);var _0x5e9df2=moment(_0x3bcbde)[_0x3aa5('0x4e')](0x0);return _0x25792d[_0x3aa5('0x4f')](_0x5e9df2,'seconds');}function ifInterval(_0x3c3253,_0x2b8918){if(_[_0x3aa5('0x94')](_0x2b8918)){return![];}return getDiff(_0x2b8918)<_0x3c3253*0x3c;}function freeVariablesPredictive(_0x247cb4){if(isNotNull(_0x247cb4)){if(!_['isUndefined'](_0x247cb4[_0x3aa5('0x80')])){_0x247cb4[_0x3aa5('0x80')]=undefined;loggerPredictive['info'](_0x247cb4['name'],_0x3aa5('0x9f'));}if(!_[_0x3aa5('0x94')](_0x247cb4[_0x3aa5('0x2b')])){_0x247cb4[_0x3aa5('0x2b')]=undefined;loggerPredictive['info'](_0x247cb4['name'],_0x3aa5('0xa0'));}if(!_[_0x3aa5('0x94')](_0x247cb4[_0x3aa5('0xa1')])){clearInterval(_0x247cb4[_0x3aa5('0xa1')]);_0x247cb4[_0x3aa5('0xa1')]=undefined;loggerPredictive[_0x3aa5('0x8a')](_0x247cb4['name'],_0x3aa5('0xa2'));}}}function erlangb(_0x54b490,_0x3863fe){if(_0x3863fe===0x0){return 0x0;}var _0x572b21=0x1;for(var _0x3e2788=0x1;_0x3e2788<=_0x3863fe;_0x3e2788+=0x1){_0x572b21=0x1+_0x572b21*_0x3e2788/_0x54b490;}return 0x1/_0x572b21;}function isVoiceQueueOutbound(_0x129d6c){return _0x129d6c===_0x3aa5('0x52');}function isNotPreview(_0x5e6117){return _0x5e6117!==_0x3aa5('0xa3');}function isCampaignIvr(_0x3c616a){return _0x3c616a===_0x3aa5('0x87');}function getCallerId(_0x4362a8,_0x40dca7,_0x450327){if(!_[_0x3aa5('0x94')](_0x450327)&&typeof _0x450327===_0x3aa5('0xa4')&&!_['isEmpty'](_0x450327)){if(!_['isUndefined'](_0x40dca7)&&typeof _0x40dca7===_0x3aa5('0xa4')&&!_[_0x3aa5('0x89')](_0x40dca7)){return util[_0x3aa5('0x84')](_0x3aa5('0xa5'),_0x40dca7,_0x450327);}return util[_0x3aa5('0x84')](_0x3aa5('0xa5'),_0x450327,_0x450327);}if(!_[_0x3aa5('0x94')](_0x4362a8)&&typeof _0x4362a8===_0x3aa5('0xa4')&&!_[_0x3aa5('0x89')](_0x4362a8)){return _0x4362a8;}return _0x3aa5('0xa6');}function loggerCatchQueueSummary(_0x918afe,_0x5508ce){return function(_0x4e032c){freeVariablesPredictive(_0x5508ce);emitVoiceQueueSummary(_0x5508ce);emitCampaignSummary(_0x5508ce);loggerSyncQueueSummary[_0x3aa5('0xa7')](_0x918afe,util[_0x3aa5('0xa8')](_0x4e032c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3775ee,_0x5618a0){return function(_0x3ea4de){loggerPredictive[_0x3aa5('0xa7')](_0x5618a0[_0x3aa5('0x44')],_0x3775ee);loggerPredictive[_0x3aa5('0xa7')](_0x3ea4de[_0x3aa5('0xa9')]);freeVariablesPredictive(_0x5618a0);};}function loggerCatch(_0x383025){return function(_0x3bbe37){logger['error'](_0x383025,util['inspect'](_0x3bbe37,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2aa4a6){return _0x2aa4a6&&!_[_0x3aa5('0x94')](_0x2aa4a6)&&_0x2aa4a6['length']>0x0;}function decremetOriginate(_0xb02683){if(!_['isUndefined'](_0xb02683)&&_0xb02683!==null){if(typeof _0xb02683[_0x3aa5('0x7d')]!==_0x3aa5('0xaa')){if(_0xb02683[_0x3aa5('0x7d')]>0x0){_0xb02683[_0x3aa5('0x7d')]-=0x1;}else{logger['error'](_0x3aa5('0xab'));}}}else{logger[_0x3aa5('0xa7')](_0x3aa5('0xac'));}}function checkContactLowerLimitOriginate(_0x484377,_0x30b65c,_0x3dfa3d){if(_0x30b65c>_0x3dfa3d){for(var _0x2a327b=0x0;_0x2a327b<_0x30b65c-_0x3dfa3d;_0x2a327b+=0x1){decremetOriginate(_0x484377);}}}function loggerGetContactDialer(_0x14715a,_0x58a801,_0x5a5aa2){return function(_0x2f9514){checkContactLowerLimitOriginate(_0x58a801,_0x5a5aa2,0x0);logger[_0x3aa5('0xa7')](_0x14715a,util[_0x3aa5('0xa8')](_0x2f9514,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2a260f){return function(_0x1329e6){if(isNotNull(_0x1329e6)&&isNotNull(_0x1329e6[0x0])){if(_0x1329e6[0x0][_0x3aa5('0xad')]>0x0){_0x2a260f['message']=_0x3aa5('0xae');logger[_0x3aa5('0x8a')]('[getContactDialer2][ReScheduled]'+_0x2a260f[_0x3aa5('0x44')],_0x1329e6[0x0][_0x3aa5('0xad')],_0x3aa5('0xaf'));}else{_0x2a260f['message']=_0x3aa5('0xb0');logger['info'](_0x3aa5('0xb1')+_0x2a260f[_0x3aa5('0x44')]);}}};}function notSendMessagesQueue(_0x5cbded){if(_0x5cbded[_0x3aa5('0xb2')]){freeVariablesPredictive(_0x5cbded);if(_0x5cbded[_0x3aa5('0x7d')]===0x0&&_0x5cbded[_0x3aa5('0x5a')]===0x0&&_0x5cbded['waiting']===0x0&&(_0x5cbded[_0x3aa5('0x57')]||0x0)===0x0){_0x5cbded[_0x3aa5('0xb2')]=![];_0x5cbded[_0x3aa5('0x55')]=0x0;_0x5cbded[_0x3aa5('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x3aa5('0xa7')](_0x3aa5('0xb3'),_0x5cbded[_0x3aa5('0x44')],'is\x20not\x20active');}else{_0x5cbded['message']=_0x3aa5('0xb4');loggerSyncQueueSummary[_0x3aa5('0xa7')](_0x3aa5('0xb3'),_0x5cbded['name'],_0x3aa5('0xb5'));}emitVoiceQueueSummary(_0x5cbded);}}function notSendMessagesCampaign(_0x408bfe){if(_0x408bfe[_0x3aa5('0xb2')]){if(_0x408bfe[_0x3aa5('0x7d')]===0x0){_0x408bfe[_0x3aa5('0xb2')]=![];_0x408bfe[_0x3aa5('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x3aa5('0xa7')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x408bfe['name'],_0x3aa5('0xb6'));}else{_0x408bfe[_0x3aa5('0x42')]=_0x3aa5('0xb4');loggerSyncQueueSummary[_0x3aa5('0xa7')](_0x3aa5('0xb7'),_0x408bfe['name'],_0x3aa5('0xb5'));}emitCampaignSummary(_0x408bfe);}}function createObjHistory(_0x171059,_0x4c9cbd,_0x5dc9bb,_0x462dbb,_0x461f35){_0x171059['message']=_0x5dc9bb;var _0x30f621=new Action(_0x171059,_0x4c9cbd);var _0xeef726=new History(_0x30f621);_0xeef726[_0x3aa5('0xb8')]=_0x462dbb;_0xeef726[_0x3aa5('0xb9')]=_0x461f35;_0xeef726[_0x3aa5('0xba')]=_0x30f621['starttime'];return _0xeef726;}Dialer[_0x3aa5('0x1e')]['loopClearZombieChannels']=function(){var _0x17e6b9=this;setInterval(function(){_0x17e6b9[_0x3aa5('0xbb')](_0x17e6b9[_0x3aa5('0xbc')],_0x3aa5('0xbd'));_0x17e6b9[_0x3aa5('0xbb')](_0x17e6b9[_0x3aa5('0x28')],_0x3aa5('0xbe'));},0x32c8);};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xbb')]=function(_0x24574b,_0x613f04){var _0x5de36a=this;for(var _0x45712d in _0x24574b){if(typeof _0x24574b[_0x45712d]!==_0x3aa5('0xaa')){this[_0x3aa5('0xbf')][_0x3aa5('0x1f')](function(){if(!_[_0x3aa5('0xc0')](_0x24574b[_0x45712d])){return ami[_0x3aa5('0xc1')]({'action':'status','channel':_0x24574b[_0x45712d]['channel']})['catch'](function(_0x250556){if(_0x250556[_0x3aa5('0x42')]===_0x3aa5('0xc2')){setTimeout(function(){if(_0x24574b[_0x45712d]&&_0x24574b[_0x45712d]['type']!==_0x3aa5('0x87')){_0x5de36a[_0x3aa5('0xc3')](_0x5de36a[_0x3aa5('0x22')][_0x24574b[_0x45712d][_0x3aa5('0xc4')]]);logger['error'](_0x3aa5('0xc5'),_0x613f04,_0x45712d,_0x24574b[_0x45712d][_0x3aa5('0xc4')]);delete _0x24574b[_0x45712d];}if(_0x24574b[_0x45712d]&&_0x24574b[_0x45712d][_0x3aa5('0xc6')]===_0x3aa5('0x87')){_0x5de36a['updateOriginated'](_0x5de36a[_0x3aa5('0x23')][_0x24574b[_0x45712d][_0x3aa5('0xc4')]]);logger[_0x3aa5('0xa7')](_0x3aa5('0xc7'),_0x613f04,_0x45712d,_0x24574b[_0x45712d]['queue']);delete _0x24574b[_0x45712d];}},0x2328);}});}});}}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xc8')]=function(_0x3f9cd9){return BPromise['resolve']()[_0x3aa5('0x40')](cmHopper['countReScheduled'](_0x3f9cd9))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xca')));};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xcb')]=function(_0x1b31ff){return BPromise['resolve']()['then'](cmHopperBlack[_0x3aa5('0xcb')](_0x1b31ff))[_0x3aa5('0xc9')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xcc')]=function(_0x5d2426){return BPromise[_0x3aa5('0xcd')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x5d2426))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xce')));};Dialer['prototype'][_0x3aa5('0xcf')]=function(_0xa1d23c){return BPromise['resolve']()['then'](cmHopperHistory[_0x3aa5('0xd0')](_0xa1d23c))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xd1')));};Dialer[_0x3aa5('0x1e')]['rescheduleContact']=function(_0x38ae0e){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopper['rescheduleContact'](_0x38ae0e))[_0x3aa5('0xc9')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x3aa5('0xd2')]=function(_0x2aa4b4,_0x44151b,_0x51675e){return BPromise[_0x3aa5('0xcd')]()['then'](cmHopper[_0x3aa5('0xd2')](_0x2aa4b4,_0x44151b,_0x51675e))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xd3')));};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xd4')]=function(_0x39a966,_0x3c5bac,_0x22a5f1,_0xd2fa50,_0x566c9a){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopper[_0x3aa5('0xd4')](_0x39a966,_0x3c5bac,_0x22a5f1,_0xd2fa50))['catch'](function(_0x42ff13){_0x566c9a[_0x3aa5('0xd5')]-=_0x22a5f1;_0x566c9a[_0x3aa5('0xd5')]=_0x566c9a['temp']>0x0?_0x566c9a[_0x3aa5('0xd5')]:0x0;loggerCatch(_0x3aa5('0xd6'))(_0x42ff13);});};Dialer[_0x3aa5('0x1e')]['getContactDialerIvr']=function(_0x3dae45,_0x20fa93,_0x58039e,_0x51f25b){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopper['getContactDialerIvr'](_0x3dae45,_0x20fa93,_0x58039e))[_0x3aa5('0xc9')](function(_0x1d1bd6){_0x51f25b[_0x3aa5('0xd5')]-=_0x20fa93;_0x51f25b[_0x3aa5('0xd5')]=_0x51f25b[_0x3aa5('0xd5')]>0x0?_0x51f25b['temp']:0x0;loggerCatch(_0x3aa5('0xd7'))(_0x1d1bd6);});};Dialer[_0x3aa5('0x1e')]['getVoiceQueueRtPauses']=function(_0x1728f1){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](voiceQueueRt[_0x3aa5('0xd8')](_0x1728f1))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xd9')));};Dialer[_0x3aa5('0x1e')]['moveContactManagedDialer']=function(_0x52f1d4){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopper[_0x3aa5('0xda')](_0x52f1d4))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xdb')));};Dialer['prototype']['createHistory']=function(_0x3b1a9e){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopperHistory[_0x3aa5('0xdc')](_0x3b1a9e))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xdd')));};Dialer[_0x3aa5('0x1e')]['updateOriginated']=function(_0x3cf5f0){if(!_[_0x3aa5('0x94')](_0x3cf5f0)&&_0x3cf5f0!==null){if(typeof _0x3cf5f0['originated']!==_0x3aa5('0xaa')){if(_0x3cf5f0[_0x3aa5('0x7d')]>0x0){_0x3cf5f0[_0x3aa5('0x7d')]-=0x1;}else{logger['error'](_0x3aa5('0xde'));}}}else{logger[_0x3aa5('0xa7')](_0x3aa5('0xdf'));}};Dialer['prototype']['loggerHandler']=function(_0xf7abcf,_0x4405f4){var _0x152ff7=this;return function(_0x3725e2){_0x152ff7['updateOriginated'](_0x4405f4);logger[_0x3aa5('0xa7')](_0xf7abcf,util['inspect'](_0x3725e2,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x3aa5('0xe0')]=function(_0x5f2993,_0x18de4d,_0x3000c0){var _0x334c0={'state':0x19,'statedesc':_0x3aa5('0xe1')};this[_0x3aa5('0xc3')](_0x18de4d);this['saveInDb'](_[_0x3aa5('0x9e')](_0x334c0,_[_0x3aa5('0xe2')](_0x3000c0,[_0x3aa5('0xe3'),_0x3aa5('0xe4'),_0x3aa5('0xe5'),_0x3aa5('0xe6'),_0x3aa5('0xe7')])),_0x3aa5('0xe8'),_0x3aa5('0xe9'));logger[_0x3aa5('0xa7')](_0x5f2993);};Dialer['prototype'][_0x3aa5('0xea')]=function(_0x5723b2){return _0x5723b2===_0x3aa5('0xeb');};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xec')]=function(_0x12920a){return!_[_0x3aa5('0x94')](_0x12920a)&&_0x12920a&&!_[_0x3aa5('0x94')](_0x12920a['name'])&&!_['isUndefined'](_0x12920a[_0x3aa5('0x82')])&&_0x12920a[_0x3aa5('0x82')]&&(this[_0x3aa5('0x25')][util[_0x3aa5('0x84')]('SIP/%s',_0x12920a[_0x3aa5('0x44')])][_0x3aa5('0xed')]===_0x3aa5('0xee')||this[_0x3aa5('0x25')][util['format']('SIP/%s',_0x12920a[_0x3aa5('0x44')])][_0x3aa5('0xed')]==='unmonitored');};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xef')]=function(_0x1f982a,_0x2f1cdc,_0x8d1541){this[_0x3aa5('0xdc')](_0x1f982a)[_0x3aa5('0xc9')](loggerCatch(_0x2f1cdc));this[_0x3aa5('0xda')](_0x1f982a)[_0x3aa5('0xc9')](loggerCatch(_0x8d1541));};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x38')]=function(_0x57ea47){var _0x834a94=this[_0x3aa5('0xbc')][_0x57ea47[_0x3aa5('0xf0')]];var _0x550de5;if(!_[_0x3aa5('0xc0')](_0x57ea47)&&!_[_0x3aa5('0xc0')](_0x57ea47[_0x3aa5('0xf1')])&&!_['isNil'](_0x57ea47[_0x3aa5('0xf1')][_0x3aa5('0xf2')])&&_0x57ea47[_0x3aa5('0xf3')]===_0x3aa5('0xf4')&&_0x834a94){if(_0x834a94[_0x3aa5('0xc6')]!==_0x3aa5('0x87')&&this[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0xf5')]&&_0x57ea47[_0x3aa5('0xf6')]==='HANGUP'){delete this[_0x3aa5('0xbc')][_0x57ea47[_0x3aa5('0xf0')]];this[_0x3aa5('0xc3')](this[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]]);this[_0x3aa5('0x22')][_0x834a94['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x3aa5('0x22')][_0x834a94['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x550de5=new Hangup(_0x834a94,_0x57ea47);_0x550de5[_0x3aa5('0xb8')]=0x12;_0x550de5[_0x3aa5('0xb9')]=_0x3aa5('0xf7');_0x550de5['membername']='AMD';ami[_0x3aa5('0x51')](_0x3aa5('0xf8'),ut['buildObj'](_0x550de5,_0x3aa5('0xf9')));this[_0x3aa5('0xef')](_0x550de5,_0x3aa5('0xfa'),_0x3aa5('0xfb'));}if(_0x834a94[_0x3aa5('0xc6')]!==_0x3aa5('0x87')&&this[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0xf5')]&&_0x57ea47[_0x3aa5('0xf6')]===_0x3aa5('0xfc')){var _0x24371f=this;return new BPromise(function(_0x1695fe,_0x1cb60a){delete _0x24371f[_0x3aa5('0xbc')][_0x57ea47[_0x3aa5('0xf0')]];_0x24371f[_0x3aa5('0xc3')](_0x24371f[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]]);_0x24371f[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0x67')]+=0x1;_0x24371f[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0x66')]+=0x1;var _0x2eaabe=_0x24371f[_0x3aa5('0x22')][_0x834a94[_0x3aa5('0xc4')]];var _0x7e549b=new Hangup(_0x834a94,_0x57ea47);_0x7e549b[_0x3aa5('0xb8')]=0x13;_0x7e549b[_0x3aa5('0xb9')]=_0x3aa5('0xfd');_0x7e549b['membername']=_0x3aa5('0xfe');_0x7e549b[_0x3aa5('0xff')]+=0x1;_0x7e549b[_0x3aa5('0x100')]+=0x1;_0x7e549b[_0x3aa5('0xf9')]=!![];ami[_0x3aa5('0x51')]('custom:amd',ut[_0x3aa5('0x101')](_0x7e549b,_0x3aa5('0xf9')));_0x24371f[_0x3aa5('0xdc')](_0x7e549b)[_0x3aa5('0xc9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x7e549b[_0x3aa5('0x102')]+_0x7e549b[_0x3aa5('0x103')]+_0x7e549b[_0x3aa5('0x104')]+_0x7e549b[_0x3aa5('0x105')]+_0x7e549b[_0x3aa5('0x106')]+_0x7e549b[_0x3aa5('0x107')]+_0x7e549b[_0x3aa5('0xff')]+_0x7e549b['countagentrejectretry']>=_0x2eaabe[_0x3aa5('0x108')]){_0x24371f['stateGlobal'](_0x7e549b,_0x1695fe,_0x1cb60a,'reason19\x20machine....');}else{if(_0x7e549b['countmachineretry']>=_0x2eaabe[_0x3aa5('0x109')]){_0x24371f[_0x3aa5('0x10a')](_0x7e549b,_0x1695fe,_0x1cb60a,'reason\x2019\x20machine....');}else{_0x24371f['rescheduleContact']({'active':![],'countmachineretry':_0x7e549b[_0x3aa5('0xff')],'scheduledat':moment()[_0x3aa5('0x10b')](_0x2eaabe[_0x3aa5('0x10c')],_0x3aa5('0x10d'))[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x7e549b[_0x3aa5('0xe3')],'ListId':_0x7e549b['ListId'],'VoiceQueueId':_0x7e549b[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x7e549b['CampaignId']||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x10e')));_0x1695fe({'reschedule':0x1});}}});}if(_0x834a94[_0x3aa5('0xc6')]===_0x3aa5('0x87')&&this[_0x3aa5('0x23')][_0x834a94[_0x3aa5('0xc4')]]['dialAMDActive']&&_0x57ea47[_0x3aa5('0xf6')]===_0x3aa5('0x10f')){delete this['uniqueId'][_0x57ea47[_0x3aa5('0xf0')]];this[_0x3aa5('0xc3')](this[_0x3aa5('0x23')][_0x834a94[_0x3aa5('0xc4')]]);_0x550de5=new Hangup(_0x834a94,_0x57ea47);_0x550de5[_0x3aa5('0xb8')]=0x12;_0x550de5[_0x3aa5('0xb9')]=_0x3aa5('0xf7');_0x550de5[_0x3aa5('0x110')]=_0x3aa5('0xfe');ami[_0x3aa5('0x51')](_0x3aa5('0xf8'),ut[_0x3aa5('0x101')](_0x550de5,_0x3aa5('0xf9')));this[_0x3aa5('0xef')](_0x550de5,_0x3aa5('0x111'),'[syncHangupInAMDIvr]');}if(_0x834a94[_0x3aa5('0xc6')]===_0x3aa5('0x87')&&this[_0x3aa5('0x23')][_0x834a94[_0x3aa5('0xc4')]]['dialAMDActive']&&_0x57ea47['value']==='MACHINE'){var _0x24371f=this;return new BPromise(function(_0x5c1e74,_0x2438b8){delete _0x24371f['uniqueId'][_0x57ea47[_0x3aa5('0xf0')]];_0x24371f[_0x3aa5('0xc3')](_0x24371f[_0x3aa5('0x23')][_0x834a94['queue']]);_0x24371f[_0x3aa5('0x23')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0x67')]+=0x1;_0x24371f[_0x3aa5('0x23')][_0x834a94[_0x3aa5('0xc4')]][_0x3aa5('0x66')]+=0x1;var _0x239d64=_0x24371f['campaigns'][_0x834a94[_0x3aa5('0xc4')]];var _0x434a85=new Hangup(_0x834a94,_0x57ea47);_0x434a85[_0x3aa5('0xb8')]=0x13;_0x434a85[_0x3aa5('0xb9')]=_0x3aa5('0xfd');_0x434a85[_0x3aa5('0x110')]='AMD';_0x434a85[_0x3aa5('0xff')]+=0x1;_0x434a85[_0x3aa5('0x100')]+=0x1;_0x434a85['amd']=!![];ami[_0x3aa5('0x51')](_0x3aa5('0xf8'),ut[_0x3aa5('0x101')](_0x434a85,_0x3aa5('0xf9')));_0x24371f[_0x3aa5('0xdc')](_0x434a85)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x112')));if(_0x434a85[_0x3aa5('0x102')]+_0x434a85[_0x3aa5('0x103')]+_0x434a85[_0x3aa5('0x104')]+_0x434a85['countnosuchnumberretry']+_0x434a85[_0x3aa5('0x106')]+_0x434a85[_0x3aa5('0x107')]+_0x434a85[_0x3aa5('0xff')]+_0x434a85[_0x3aa5('0x113')]>=_0x239d64['dialGlobalMaxRetry']){_0x24371f[_0x3aa5('0x114')](_0x434a85,_0x5c1e74,_0x2438b8,_0x3aa5('0x115'));}else{if(_0x434a85['countmachineretry']>=_0x239d64[_0x3aa5('0x109')]){_0x24371f[_0x3aa5('0x10a')](_0x434a85,_0x5c1e74,_0x2438b8,_0x3aa5('0x116'));}else{_0x24371f[_0x3aa5('0x117')]({'active':![],'countmachineretry':_0x434a85[_0x3aa5('0xff')],'scheduledat':moment()[_0x3aa5('0x10b')](_0x239d64['dialMachineRetryFrequency'],_0x3aa5('0x10d'))[_0x3aa5('0x84')](_0x3aa5('0x118')),'ContactId':_0x434a85['ContactId'],'ListId':_0x434a85[_0x3aa5('0xe4')],'VoiceQueueId':_0x434a85[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x434a85[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x10e')));_0x5c1e74({'reschedule':0x1});}}});}}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x36')]=function(_0x11f6b3){var _0x5d361c=this[_0x3aa5('0xbc')][_0x11f6b3[_0x3aa5('0xf0')]];var _0x51cbbd=this;var _0x1bf09e;if(_0x5d361c&&_0x5d361c[_0x3aa5('0xc6')]===_0x3aa5('0x87')){delete this['uniqueId'][_0x11f6b3['uniqueid']];this['updateOriginated'](this[_0x3aa5('0x23')][_0x5d361c[_0x3aa5('0xc4')]]);this[_0x3aa5('0x23')][_0x5d361c['queue']][_0x3aa5('0x119')]+=0x1;_0x1bf09e=new Hangup(_0x5d361c,_0x11f6b3);this[_0x3aa5('0xdc')](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x11a')));this['moveContactManagedDialer'](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x11b')));}if(_0x5d361c&&_0x5d361c['type']!==_0x3aa5('0x87')&&isNotNull(this[_0x3aa5('0x22')][_0x5d361c['queue']][_0x3aa5('0x11c')])){delete this[_0x3aa5('0xbc')][_0x11f6b3[_0x3aa5('0xf0')]];this['updateOriginated'](this[_0x3aa5('0x22')][_0x5d361c['queue']]);this[_0x3aa5('0x22')][_0x5d361c[_0x3aa5('0xc4')]][_0x3aa5('0x67')]+=0x1;this[_0x3aa5('0x22')][_0x5d361c[_0x3aa5('0xc4')]][_0x3aa5('0x66')]+=0x1;_0x1bf09e=new Hangup(_0x5d361c,_0x11f6b3);_0x1bf09e[_0x3aa5('0xb8')]=0x10;_0x1bf09e[_0x3aa5('0xb9')]=_0x3aa5('0x11d');_0x1bf09e[_0x3aa5('0x110')]='AGI';this['createHistory'](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x11a')));this['moveContactManagedDialer'](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x11b')));}if(_0x5d361c&&_0x5d361c[_0x3aa5('0xc6')]!==_0x3aa5('0x87')&&!isNotNull(this['voiceQueues'][_0x5d361c[_0x3aa5('0xc4')]][_0x3aa5('0x11c')])){delete this[_0x3aa5('0xbc')][_0x11f6b3['uniqueid']];this[_0x3aa5('0xc3')](this[_0x3aa5('0x22')][_0x5d361c[_0x3aa5('0xc4')]]);this['voiceQueues'][_0x5d361c[_0x3aa5('0xc4')]][_0x3aa5('0x72')]+=0x1;_0x1bf09e=new Hangup(_0x5d361c,_0x11f6b3);_0x1bf09e['state']=0xc;_0x1bf09e[_0x3aa5('0xb9')]=_0x11f6b3[_0x3aa5('0x11e')];_0x1bf09e[_0x3aa5('0x110')]=_0x3aa5('0x11f');this[_0x3aa5('0xdc')](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x11a')));this['moveContactManagedDialer'](_0x1bf09e)[_0x3aa5('0xc9')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x120')]=function(_0x893e36){var _0x1854c2=this[_0x3aa5('0xbc')][_0x893e36[_0x3aa5('0xf0')]];var _0x3a5dd0=this;if(this['voiceQueues'][_0x893e36[_0x3aa5('0xc4')]]){if(_0x1854c2&&_0x1854c2['type']!=='ivr'){delete this[_0x3aa5('0xbc')][_0x893e36[_0x3aa5('0xf0')]];this[_0x3aa5('0x22')][_0x893e36[_0x3aa5('0xc4')]][_0x3aa5('0x67')]+=0x1;var _0x5199fa=new AgentComplete(_0x1854c2,_0x893e36);if(_0x893e36[_0x3aa5('0x121')]===_0x3aa5('0x122')){_0x5199fa[_0x3aa5('0x123')]=this[_0x3aa5('0x22')][_0x893e36[_0x3aa5('0xc4')]][_0x3aa5('0x124')]&&this[_0x3aa5('0x22')][_0x893e36['queue']][_0x3aa5('0x125')]?moment()[_0x3aa5('0x84')](_0x3aa5('0x118')):undefined;}this[_0x3aa5('0xdc')](_0x5199fa)['catch'](loggerCatch(_0x3aa5('0x126')));this[_0x3aa5('0xda')](_0x5199fa)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x127')));}}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x2f')]=function(_0x17a832){if(this[_0x3aa5('0x22')][_0x17a832['queue']]){if(this[_0x3aa5('0xbc')][_0x17a832[_0x3aa5('0xf0')]]&&this[_0x3aa5('0xbc')][_0x17a832[_0x3aa5('0xf0')]][_0x3aa5('0xc6')]!==_0x3aa5('0x87')){this['updateOriginated'](this[_0x3aa5('0x22')][_0x17a832['queue']]);this[_0x3aa5('0xbc')][_0x17a832[_0x3aa5('0xf0')]]['answertime']=moment()[_0x3aa5('0x84')](_0x3aa5('0x118'));}}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x128')]=function(_0x4d29b0){this[_0x3aa5('0xdc')](_0x4d29b0)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x126')));this[_0x3aa5('0xda')](_0x4d29b0)['catch'](loggerCatch(_0x3aa5('0x129')));};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x31')]=function(_0x363adc){var _0x14f145=this[_0x3aa5('0xbc')][_0x363adc[_0x3aa5('0xf0')]];var _0xd3d38b=this;if(this['voiceQueues'][_0x363adc['queue']]){if(_0x14f145&&_0x14f145[_0x3aa5('0xc6')]!=='ivr'){delete this['uniqueId'][_0x363adc[_0x3aa5('0xf0')]];this[_0x3aa5('0xc3')](this[_0x3aa5('0x22')][_0x363adc['queue']]);_0x14f145[_0x3aa5('0x12a')]=moment()['format'](_0x3aa5('0x118'));var _0x2e4e5d=new QueueCallerAbandon(_0x14f145,_0x363adc);if(getSeconds(_0x14f145[_0x3aa5('0x12a')],_0x14f145['responsetime'])>=_0x14f145[_0x3aa5('0x12b')]){this[_0x3aa5('0x22')][_0x363adc['queue']][_0x3aa5('0x76')]+=0x1;this[_0x3aa5('0x22')][_0x363adc[_0x3aa5('0xc4')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x3aa5('0x22')][_0x363adc['queue']][_0x3aa5('0x78')]+=0x1;_0x2e4e5d[_0x3aa5('0xb8')]=0xa;_0x2e4e5d['statedesc']=_0x3aa5('0x12c');_0x2e4e5d[_0x3aa5('0x12d')]=_0x3aa5('0x12e');_0x2e4e5d[_0x3aa5('0x123')]=this[_0x3aa5('0x22')][_0x363adc['queue']][_0x3aa5('0x124')]?moment()[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2e4e5d[_0x3aa5('0x106')]+=0x1;_0x2e4e5d[_0x3aa5('0x100')]+=0x1;if(_0x2e4e5d[_0x3aa5('0x106')]>=this[_0x3aa5('0x22')][_0x363adc['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x2e4e5d);}else{this[_0x3aa5('0x117')]({'active':![],'countdropretry':_0x2e4e5d[_0x3aa5('0x106')],'scheduledat':moment()['add'](this[_0x3aa5('0x22')][_0x363adc['queue']][_0x3aa5('0x12f')],'minutes')['format'](_0x3aa5('0x118')),'ContactId':_0x14f145[_0x3aa5('0xe3')],'ListId':_0x14f145[_0x3aa5('0xe4')],'VoiceQueueId':_0x14f145[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x14f145['CampaignId']||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x130')));var _0x407d5b=new History(_0x2e4e5d);_0x407d5b[_0x3aa5('0xb8')]=0xa;_0x407d5b[_0x3aa5('0xb9')]=_0x3aa5('0x12c');_0x407d5b[_0x3aa5('0x131')]=moment()['format'](_0x3aa5('0x118'));_0x407d5b[_0x3aa5('0xba')]=_0x407d5b[_0x3aa5('0x131')];_0x407d5b[_0x3aa5('0x132')]=_0x2e4e5d['calleridname'];_0x407d5b[_0x3aa5('0x133')]=_0x2e4e5d['calleridnum'];this[_0x3aa5('0xdc')](_0x407d5b)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x134')));}}else{this['voiceQueues'][_0x363adc[_0x3aa5('0xc4')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x3aa5('0x22')][_0x363adc[_0x3aa5('0xc4')]][_0x3aa5('0x6b')]+=0x1;_0x2e4e5d[_0x3aa5('0xb8')]=0xb;_0x2e4e5d[_0x3aa5('0xb9')]=_0x3aa5('0x135');_0x2e4e5d[_0x3aa5('0x12d')]=_0x3aa5('0x136');_0x2e4e5d[_0x3aa5('0x107')]+=0x1;_0x2e4e5d[_0x3aa5('0x100')]+=0x1;if(_0x2e4e5d[_0x3aa5('0x107')]>=this[_0x3aa5('0x22')][_0x363adc['queue']][_0x3aa5('0x137')]){this[_0x3aa5('0x128')](_0x2e4e5d);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x2e4e5d[_0x3aa5('0x107')],'scheduledat':moment()[_0x3aa5('0x10b')](this[_0x3aa5('0x22')][_0x363adc[_0x3aa5('0xc4')]]['dialAbandonedRetryFrequency'],_0x3aa5('0x10d'))[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14f145['ContactId'],'ListId':_0x14f145[_0x3aa5('0xe4')],'VoiceQueueId':_0x14f145[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x14f145[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x138')));var _0x407d5b=new History(_0x2e4e5d);_0x407d5b[_0x3aa5('0xb8')]=0xb;_0x407d5b['statedesc']=_0x3aa5('0x135');_0x407d5b[_0x3aa5('0x131')]=moment()['format'](_0x3aa5('0x118'));_0x407d5b['endtime']=_0x407d5b['starttime'];_0x407d5b['calleridname']=_0x2e4e5d[_0x3aa5('0x132')];_0x407d5b['calleridnum']=_0x2e4e5d[_0x3aa5('0x133')];this['createHistory'](_0x407d5b)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x139')));}}}}};Dialer[_0x3aa5('0x1e')]['syncNewExten']=function(_0xfaf419){if(this[_0x3aa5('0x28')][_0xfaf419['uniqueid']]){this[_0x3aa5('0x28')][_0xfaf419[_0x3aa5('0xf0')]]['channel']=_0xfaf419['channel'];}if(this[_0x3aa5('0xbc')][_0xfaf419[_0x3aa5('0xf0')]]){this[_0x3aa5('0xbc')][_0xfaf419['uniqueid']][_0x3aa5('0x13a')]=_0xfaf419['channel'];}};Dialer[_0x3aa5('0x1e')]['syncQueueMember']=function(_0x1cc3d2){if(strategy[this['voiceQueues'][this['actions'][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]][_0x3aa5('0x53')]]===_0x3aa5('0x1d')){if(this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]]&&_[_0x3aa5('0xc0')](this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0x13c')])&&_0x1cc3d2[_0x3aa5('0xed')]==='1'&&_0x1cc3d2[_0x3aa5('0x13d')]==='0'){if(this['agents'][_0x1cc3d2[_0x3aa5('0x13e')]]){if(!this[_0x3aa5('0x24')][_0x1cc3d2[_0x3aa5('0x13e')]][_0x3aa5('0x13c')]){this[_0x3aa5('0x24')][_0x1cc3d2[_0x3aa5('0x13e')]][_0x3aa5('0x13c')]=!![];this[_0x3aa5('0x28')][_0x1cc3d2['actionid']][_0x3aa5('0x13c')]=!![];this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0x13e')]=_0x1cc3d2['stateinterface'];}}}}else if((strategy[this[_0x3aa5('0x22')][this[_0x3aa5('0x28')][_0x1cc3d2['actionid']][_0x3aa5('0xc4')]]['strategy']]||_0x3aa5('0x1c'))===_0x3aa5('0x1c')){if(this[_0x3aa5('0x28')][_0x1cc3d2['actionid']]){if(this[_0x3aa5('0x24')][_0x1cc3d2['stateinterface']]){this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0x13e')]=_0x1cc3d2['stateinterface'];if(_[_0x3aa5('0xc0')](this['queueBooked'][this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]])){this['queueBooked'][this[_0x3aa5('0x28')][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]=[];}this[_0x3aa5('0x13f')][this['actions'][_0x1cc3d2[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]][_0x3aa5('0x140')](_[_0x3aa5('0x9e')](_[_0x3aa5('0xe2')](this['actions'][_0x1cc3d2[_0x3aa5('0x13b')]],[_0x3aa5('0x141'),_0x3aa5('0x13e')]),{'status':_0x1cc3d2['status'],'paused':_0x1cc3d2[_0x3aa5('0x13d')]}));}}}};function unlockQueueStatus(_0x3bb0a3,_0x220231){setTimeout(function(){if(_[_0x3aa5('0x94')](_0x3bb0a3['queueStatusComplete'])){loggerBooked[_0x3aa5('0xa7')]('[unlockQueueStatus][undefined]',_0x220231);}_0x3bb0a3[_0x3aa5('0x142')]=!![];loggerBooked[_0x3aa5('0x8a')](_0x3aa5('0x143'),_0x220231,JSON[_0x3aa5('0x4d')](_['pick'](_0x3bb0a3,[_0x3aa5('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x3aa5('0x1e')][_0x3aa5('0x3c')]=function(_0x23c456){var _0x10b355=this;var _0x645e96=_0x10b355[_0x3aa5('0x22')][_0x10b355[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]];if(strategy[this['voiceQueues'][this[_0x3aa5('0x28')][_0x23c456['actionid']]['queue']][_0x3aa5('0x53')]]==='roundrobin'){if(this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]]&&this['actions'][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0x13e')]){this[_0x3aa5('0xa3')][_0x3aa5('0x144')](this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0x141')],this['actions'][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0x13e')])[_0x3aa5('0xc9')](function(_0xa735be){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x3aa5('0xa8')](_0xa735be,{'showHidden':![],'depth':null}));})[_0x3aa5('0x21')](function(){_0x10b355['updateOriginated'](_0x10b355['voiceQueues'][_0x10b355[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]);_0x10b355[_0x3aa5('0x24')][_0x10b355[_0x3aa5('0x28')][_0x23c456['actionid']][_0x3aa5('0x13e')]][_0x3aa5('0x13c')]=![];delete _0x10b355[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]];unlockQueueStatus(_0x645e96);});}else{this[_0x3aa5('0xc3')](this[_0x3aa5('0x22')][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xe3')],'ListId':this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xe4')],'VoiceQueueId':this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x145')));delete this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]];unlockQueueStatus(_0x645e96);}}else if((strategy[this['voiceQueues'][this[_0x3aa5('0x28')][_0x23c456['actionid']][_0x3aa5('0xc4')]][_0x3aa5('0x53')]]||'rrmemory')===_0x3aa5('0x1c')){var _0x3f7734;if(this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]]&&!_[_0x3aa5('0x89')](this[_0x3aa5('0x13f')][this['actions'][_0x23c456['actionid']][_0x3aa5('0xc4')]])){if(this[_0x3aa5('0x2d')][_0x10b355[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]]['queue']]){this['queueBookedRR'][_0x10b355['actions'][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]=this[_0x3aa5('0x2d')][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]?this['queueBookedRR'][this['actions'][_0x23c456['actionid']][_0x3aa5('0xc4')]]:this[_0x3aa5('0x13f')][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]]?this['queueBooked'][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]][_0x3aa5('0x146')]||0x0:0x0;}this[_0x3aa5('0x13f')][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]][_0x3aa5('0x146')]=this[_0x3aa5('0x2d')][this[_0x3aa5('0x28')][_0x23c456[_0x3aa5('0x13b')]][_0x3aa5('0xc4')]];for(var _0x4c7931=0x0;_0x4c7931=0x0;})[_0x3aa5('0xc9')](myreject(_0x1a52e3)));}}else{_0x3a6644[_0x3aa5('0x140')](ami[_0x3aa5('0xc1')]({'action':_0x3aa5('0x15a'),'command':util['format'](_0x3aa5('0x15b'),_0xa06f99,!_['isUndefined'](config['timezones'][_0x279eed])?_0x279eed:'')})['then'](function(_0xd0b33c){return _0xd0b33c[_0x3aa5('0x15d')][_0x3aa5('0x15f')](_0x3aa5('0x15e'))>=0x0;})[_0x3aa5('0xc9')](myreject(_0x1a52e3)));}BPromise[_0x3aa5('0x160')](_0x3a6644)[_0x3aa5('0x40')](function(_0xfe40f7){var _0x19c095=_['some'](_0xfe40f7);if(_0x19c095){return _0x580a3d(_0x19c095);}else{_0x506ecb[_0x3aa5('0x42')]=_0x588327?_0x3aa5('0x161'):_0x3aa5('0x162');return _0x1a52e3(msgResponse(_0x3aa5('0x163'),_0x3aa5('0x156'),'Global:\x20'+_0x588327+'\x20'+_0x784e09+_0x3aa5('0x164')+util[_0x3aa5('0xa8')](_0xa06f99,{'showHidden':![],'depth':null})+_0x3aa5('0x165')+_0x279eed));}})['catch'](function(_0x404e70){return _0x1a52e3(msgResponse(_0x3aa5('0x154'),_0x3aa5('0x156'),JSON[_0x3aa5('0x4d')](_0x404e70)));});});};Dialer['prototype'][_0x3aa5('0x166')]=function(_0x372f86){var _0x17b30e=this;return function(){switch(_0x372f86['dialMethod']){case _0x3aa5('0x167'):freeVariablesPredictive(_0x372f86);_0x17b30e['handlePower'](_0x372f86,0x1);break;case _0x3aa5('0x168'):freeVariablesPredictive(_0x372f86);_0x17b30e[_0x3aa5('0x169')](_0x372f86,_0x372f86[_0x3aa5('0x16a')]);break;case _0x3aa5('0xa'):_0x17b30e['predictive'](_0x372f86);break;case _0x3aa5('0x9'):freeVariablesPredictive(_0x372f86);_0x17b30e[_0x3aa5('0x169')](_0x372f86,0x1);break;default:freeVariablesPredictive(_0x372f86);logger[_0x3aa5('0xa7')](_0x3aa5('0x16b'),_0x372f86[_0x3aa5('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x16c')]=function(_0x4fcf96){return BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](cmHopper['handlePreviewRecallNotifications'](_0x4fcf96['id'],previewRecallmeReminderInterval))[_0x3aa5('0x40')](function(_0x31aa70){for(var _0x198543=0x0;_0x198543<_0x31aa70[_0x3aa5('0x147')];_0x198543++){var _0x596e35=_0x31aa70[_0x198543][_0x3aa5('0x16d')][_0x3aa5('0x44')];if(_0x596e35)io['to'](util['format'](_0x3aa5('0x16e'),_0x596e35))['emit'](_0x3aa5('0x16f'),{'hopper':_0x31aa70[_0x198543]});}})['catch'](function(_0x2ac10d){});};Dialer[_0x3aa5('0x1e')]['launchHandleIvr']=function(_0x3fbbb2){var _0x1851cb=this;return function(){_0x1851cb[_0x3aa5('0x170')](_0x3fbbb2);};};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xc')]=function(_0x5a2302){var _0x4752a6=this;if(isNotPreview(_0x5a2302['dialMethod'])){if(isVoiceQueueOutbound(_0x5a2302[_0x3aa5('0xc6')])&&isActive(_0x5a2302[_0x3aa5('0x60')])){_0x5a2302[_0x3aa5('0xb2')]=!![];BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](checkIsLoggedIn(_0x5a2302,_0x5a2302[_0x3aa5('0x56')]))['then'](checkIsActive(_0x5a2302,_0x5a2302['dialActive']))[_0x3aa5('0x40')](checkInterval(_0x5a2302))['then'](_0x4752a6[_0x3aa5('0x171')](_0x5a2302))[_0x3aa5('0x40')](_0x4752a6['checkIfTime'](_0x5a2302[_0x3aa5('0x172')],_0x5a2302[_0x3aa5('0x173')],_0x5a2302['name'],_0x5a2302))[_0x3aa5('0x40')](_0x4752a6[_0x3aa5('0x155')](_0x5a2302[_0x3aa5('0x47')],_0x5a2302[_0x3aa5('0x173')],_0x5a2302[_0x3aa5('0x44')],_0x5a2302))[_0x3aa5('0x40')](_0x4752a6[_0x3aa5('0x166')](_0x5a2302))[_0x3aa5('0xc9')](loggerCatchQueueSummary(_0x3aa5('0x174'),_0x5a2302));}else{notSendMessagesQueue(_0x5a2302);}}else{freeVariablesPredictive(_0x5a2302);if(_0x5a2302[_0x3aa5('0x175')]){_0x4752a6[_0x3aa5('0x16c')](_0x5a2302);}}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x151')]=function(){var _0x5ca763=this;var _0x3fabb6;for(var _0x1ee46c in this['campaigns']){if(typeof this[_0x3aa5('0x23')][_0x1ee46c]!==_0x3aa5('0xaa')){_0x3fabb6=this[_0x3aa5('0x23')][_0x1ee46c];if(isCampaignIvr(_0x3fabb6['type'])&&isActive(_0x3fabb6[_0x3aa5('0x82')])){_0x3fabb6[_0x3aa5('0xb2')]=!![];BPromise[_0x3aa5('0xcd')]()[_0x3aa5('0x40')](checkIsActive(_0x3fabb6,_0x3fabb6['active']))[_0x3aa5('0x40')](checkInterval(_0x3fabb6))[_0x3aa5('0x40')](_0x5ca763[_0x3aa5('0x171')](_0x3fabb6))['then'](_0x5ca763[_0x3aa5('0x153')](_0x3fabb6[_0x3aa5('0x172')],_0x3fabb6[_0x3aa5('0x173')],_0x3fabb6[_0x3aa5('0x44')],_0x3fabb6))[_0x3aa5('0x40')](_0x5ca763[_0x3aa5('0x155')](_0x3fabb6[_0x3aa5('0x47')],_0x3fabb6[_0x3aa5('0x173')],_0x3fabb6[_0x3aa5('0x44')],_0x3fabb6))[_0x3aa5('0x40')](_0x5ca763[_0x3aa5('0x176')](_0x3fabb6))[_0x3aa5('0xc9')](loggerCatchQueueSummary('[syncCampaigns]',_0x3fabb6));}else{notSendMessagesCampaign(_0x3fabb6);}}}};function getCallerIdRandom(_0x31fd25,_0x55bc21){var _0x1514bd;var _0x452f5b;var _0x5a41cc;if(_0x55bc21<=0x0){_0x55bc21=0x1;}_0x1514bd=new RegExp(_0x3aa5('0x177')+_0x55bc21+'}$');_0x452f5b=Math['pow'](0xa,_0x55bc21-0x1);_0x5a41cc=Math['pow'](0xa,_0x55bc21)-0x1;return util[_0x3aa5('0x84')]('%s',_[_0x3aa5('0x178')](_0x31fd25,_0x1514bd,_[_0x3aa5('0x179')](_0x452f5b,_0x5a41cc)));}function extractCalleridName(_0x2895a1){var _0x3a79f3=_0x2895a1[_0x3aa5('0x17a')](/"(.*?)"/);return _0x3a79f3?_0x3a79f3[0x1]:_0x2895a1;}function extractCalleridNumber(_0x3dee14){var _0x14b44c=_0x3dee14[_0x3aa5('0x17a')](/<(.*?)>/);return _0x14b44c?_0x14b44c[0x1]:_0x3dee14;}Dialer[_0x3aa5('0x1e')][_0x3aa5('0x17b')]=function(_0x242511,_0x1ef68f){var _0x4d1f86=this;var _0x159502=uuid['v4']();this[_0x3aa5('0x28')][_0x159502]=new Action(_0x242511,_0x1ef68f,_0x159502);return new BPromise(function(_0x4649e1,_0x1de0d0){if(_[_0x3aa5('0x94')](_0x242511)&&typeof _0x242511!==_0x3aa5('0x17c')){return _0x1de0d0(msgResponse(_0x3aa5('0x17d'),_0x3aa5('0x156'),_0x3aa5('0x17e')));}if(_[_0x3aa5('0x94')](_0x1ef68f[_0x3aa5('0x17f')][_0x3aa5('0x180')])||_0x1ef68f[_0x3aa5('0x17f')][_0x3aa5('0x180')]===null){return _0x1de0d0(msgResponse('originate','Failure',_0x3aa5('0x181')));}var _0x1dcf41={'XMD-CALLERID':_0x4d1f86[_0x3aa5('0x28')][_0x159502][_0x3aa5('0x182')](),'XMD-AGI':_0x242511['dialQueueProject']?util[_0x3aa5('0x84')]('\x22agi://%s/square,%s\x22',ipAgi,_0x242511[_0x3aa5('0x11c')]):_0x3aa5('0x183'),'XMD-AGIAFTER':_0x242511[_0x3aa5('0x124')]?util[_0x3aa5('0x84')](_0x3aa5('0x184'),ipAgi,_0x242511[_0x3aa5('0x124')]):_0x3aa5('0x183'),'XMD-QUEUE':_0x242511[_0x3aa5('0xc6')]===_0x3aa5('0x52')?util[_0x3aa5('0x84')](_0x3aa5('0x185'),_0x242511[_0x3aa5('0x44')],_0x242511['dialQueueOptions']||'',_0x242511['dialAgiAfterHangupAgent']?'c':'',_0x242511[_0x3aa5('0x12b')]||0x3):_0x3aa5('0x183'),'XMD-CONTACTID':_0x1ef68f[_0x3aa5('0xe3')],'XMD-CDRTYPE':_0x3aa5('0x186'),'CALLERID(all)':_0x4d1f86[_0x3aa5('0x28')][_0x159502][_0x3aa5('0x182')](),'XMD-AMD':_0x242511[_0x3aa5('0xf5')]?_0x3aa5('0x187'):_0x3aa5('0x183'),'XMD-DESTINATION':_0x3aa5('0xf4')};if(_0x242511[_0x3aa5('0xf5')]){_0x1dcf41['XMD-AMDINITIALSILENCE']=_0x242511[_0x3aa5('0x188')]||0x9c4;_0x1dcf41['XMD-AMDGREETING']=_0x242511['dialAMDGreeting']||0x5dc;_0x1dcf41['XMD-AMDAFTERGREETINGSILENCE']=_0x242511['dialAMDAfterGreetingSilence']||0x320;_0x1dcf41['XMD-AMDTOTALANALYSISTIME']=_0x242511[_0x3aa5('0x189')]||0x1388;_0x1dcf41['XMD-AMDMINWORDLENGTH']=_0x242511['dialAMDMinWordLength']||0x64;_0x1dcf41[_0x3aa5('0x18a')]=_0x242511[_0x3aa5('0x18b')]||0x32;_0x1dcf41[_0x3aa5('0x18c')]=_0x242511[_0x3aa5('0x18d')]||0x3;_0x1dcf41[_0x3aa5('0x18e')]=_0x242511['dialAMDSilenceThreshold']||0x100;_0x1dcf41[_0x3aa5('0x18f')]=_0x242511[_0x3aa5('0x190')]||0x1388;}if(_0x242511['type']==='outbound'){_0x1dcf41[_0x3aa5('0x191')]=_0x1ef68f[_0x3aa5('0xe6')];}else{_0x1dcf41[_0x3aa5('0x192')]=_0x1ef68f['CampaignId'];}for(var _0x101d5b in _0x1ef68f['Contact']){if(typeof _0x1ef68f['Contact'][_0x101d5b]!==_0x3aa5('0xaa')){if(isNotNull(_0x1ef68f[_0x3aa5('0x17f')][_0x101d5b])&&_0x101d5b!=='id'&&_0x101d5b!=='tags'&&_0x101d5b!==_0x3aa5('0x193')&&_0x101d5b!==_0x3aa5('0x194')){_0x1dcf41[util[_0x3aa5('0x84')](_0x3aa5('0x195'),_0x3aa5('0x196'),_[_0x3aa5('0x197')](_0x101d5b))]=_0x1ef68f[_0x3aa5('0x17f')][_0x101d5b];}}}var _0x1b6794=_0x4d1f86[_0x3aa5('0xec')](_0x242511['Trunk'])?getCallerId(_0x242511[_0x3aa5('0x81')][_0x3aa5('0x83')],_0x242511[_0x3aa5('0x62')],_0x242511[_0x3aa5('0x198')]>0x0?getCallerIdRandom(_0x242511[_0x3aa5('0x63')],_0x242511[_0x3aa5('0x198')]):_0x242511['dialOriginateCallerIdNumber']):getCallerId(_[_0x3aa5('0xc0')](_0x242511[_0x3aa5('0x199')])?_0x242511[_0x3aa5('0x81')][_0x3aa5('0x83')]:_0x242511[_0x3aa5('0x199')][_0x3aa5('0x83')],_0x242511[_0x3aa5('0x62')],_0x242511[_0x3aa5('0x198')]>0x0?getCallerIdRandom(_0x242511[_0x3aa5('0x63')],_0x242511[_0x3aa5('0x198')]):_0x242511[_0x3aa5('0x63')]);if(_0x1b6794){_0x1dcf41['XMD-ORIGINATECALLERIDNAME']=_0x4d1f86[_0x3aa5('0x28')][_0x159502][_0x3aa5('0x19a')]=extractCalleridName(_0x1b6794);_0x1dcf41[_0x3aa5('0x19b')]=_0x4d1f86[_0x3aa5('0x28')][_0x159502][_0x3aa5('0x19c')]=extractCalleridNumber(_0x1b6794);}return ami[_0x3aa5('0xc1')]({'actionid':_0x159502,'action':'originate','channel':_0x4d1f86[_0x3aa5('0xec')](_0x242511[_0x3aa5('0x81')])?util[_0x3aa5('0x84')](_0x3aa5('0x19d'),_0x242511['Trunk'][_0x3aa5('0x44')],isNotNull(_0x242511[_0x3aa5('0x65')])?_0x242511[_0x3aa5('0x65')]['trim']()||'':'',_0x242511['dialCutDigit']>0x0?_0x1ef68f[_0x3aa5('0x17f')]['phone'][_0x3aa5('0x19e')](_0x242511[_0x3aa5('0x19f')]):_0x1ef68f['Contact'][_0x3aa5('0x180')]):util['format'](_0x3aa5('0x19d'),_[_0x3aa5('0xc0')](_0x242511['TrunkBackup'])?_0x242511[_0x3aa5('0x81')]['name']:_0x242511[_0x3aa5('0x199')][_0x3aa5('0x44')],isNotNull(_0x242511[_0x3aa5('0x65')])?_0x242511[_0x3aa5('0x65')][_0x3aa5('0x1a0')]()||'':'',_0x242511[_0x3aa5('0x19f')]>0x0?_0x1ef68f[_0x3aa5('0x17f')][_0x3aa5('0x180')][_0x3aa5('0x19e')](_0x242511[_0x3aa5('0x19f')]):_0x1ef68f[_0x3aa5('0x17f')]['phone']),'callerid':_0x1b6794,'Exten':_0x3aa5('0xf4'),'Context':_0x3aa5('0x1a1'),'Priority':'1','variable':_0x1dcf41,'timeout':(_0x242511[_0x3aa5('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x159502})[_0x3aa5('0x40')](function(_0x35582c){return _0x4649e1(_0x35582c);})[_0x3aa5('0xc9')](function(_0x33a225){_0x242511['outboundOriginateFailureCallsDay']+=0x1;var _0x160416=new History(_0x4d1f86[_0x3aa5('0x28')][_0x159502]);logger[_0x3aa5('0xa7')](util[_0x3aa5('0x84')](_0x3aa5('0x1a2'),JSON['stringify'](_0x33a225)));_0x160416[_0x3aa5('0xb8')]=0xe;_0x160416['statedesc']=_0x3aa5('0x1a3');_0x160416[_0x3aa5('0x131')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x160416[_0x3aa5('0xba')]=_0x160416[_0x3aa5('0x131')];_0x4d1f86[_0x3aa5('0xdc')](_0x160416)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1a4')));_0x4d1f86[_0x3aa5('0xda')](_0x160416)[_0x3aa5('0xc9')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x4d1f86['actions'][_0x159502];return _0x1de0d0(msgResponse('originate',_0x3aa5('0x4c'),_0x3aa5('0x1a5')));});});});};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x33')]=function(_0x2b4687){var _0x1eb2e5=this[_0x3aa5('0x28')][_0x2b4687[_0x3aa5('0x13b')]];if(_0x1eb2e5){delete this[_0x3aa5('0x28')][_0x2b4687[_0x3aa5('0x13b')]];_0x1eb2e5[_0x3aa5('0x1a6')]=moment()['format'](_0x3aa5('0x118'));var _0x33a62e=_0x1eb2e5['type']===_0x3aa5('0x87')?this['campaigns'][_0x1eb2e5['queue']]:this[_0x3aa5('0x22')][_0x1eb2e5[_0x3aa5('0x1a7')]()];if(!this[_0x3aa5('0xea')](_0x2b4687[_0x3aa5('0x1a8')])){this[_0x3aa5('0xc3')](_0x33a62e);return this['callProgressDetecting'](_0x1eb2e5,_0x33a62e,_0x2b4687)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1a9')));}this['uniqueId'][_0x2b4687['uniqueid']]=_0x1eb2e5;}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x1aa')]=function(_0x5e7b45,_0x13c871,_0x4c2182){var _0x24308c=new History(_0x13c871);if(_0x24308c[_0x3aa5('0x102')]+_0x24308c[_0x3aa5('0x103')]+_0x24308c[_0x3aa5('0x104')]+_0x24308c['countnosuchnumberretry']+_0x24308c[_0x3aa5('0x106')]+_0x24308c[_0x3aa5('0x107')]+_0x24308c[_0x3aa5('0xff')]+_0x24308c[_0x3aa5('0x113')]>=_0x4c2182[_0x3aa5('0x108')]-0x1){return!![];}switch(_0x5e7b45){case 0x3:if(_0x24308c['countnoanswerretry']>=_0x4c2182[_0x3aa5('0x1ab')]-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countnoanswerretry':_0x24308c[_0x3aa5('0x104')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1ac')],_0x3aa5('0x10d'))[_0x3aa5('0x84')](_0x3aa5('0x118')),'ContactId':_0x24308c['ContactId'],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c['CampaignId']||undefined})[_0x3aa5('0xc9')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x24308c[_0x3aa5('0x102')]>=_0x4c2182[_0x3aa5('0x1ad')]-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countbusyretry':_0x24308c[_0x3aa5('0x102')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1ae')],'minutes')[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24308c['ContactId'],'ListId':_0x24308c['ListId'],'VoiceQueueId':_0x24308c['VoiceQueueId']||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x24308c[_0x3aa5('0x103')]>=_0x4c2182['dialCongestionMaxRetry']-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countcongestionretry':_0x24308c[_0x3aa5('0x103')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1af')],_0x3aa5('0x10d'))[_0x3aa5('0x84')](_0x3aa5('0x118')),'ContactId':_0x24308c['ContactId'],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1b0')));break;case 0x0:if(_0x24308c[_0x3aa5('0x105')]>=_0x4c2182['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x3aa5('0x117')]({'active':![],'countnosuchnumberretry':_0x24308c[_0x3aa5('0x105')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1b1')],_0x3aa5('0x10d'))['format'](_0x3aa5('0x118')),'ContactId':_0x24308c[_0x3aa5('0xe3')],'ListId':_0x24308c['ListId'],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1b2')));}break;case 0xa:if(_0x24308c[_0x3aa5('0x106')]>=_0x4c2182[_0x3aa5('0x1b3')]-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countdropretry':_0x24308c[_0x3aa5('0x106')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x12f')],_0x3aa5('0x10d'))['format'](_0x3aa5('0x118')),'ContactId':_0x24308c[_0x3aa5('0xe3')],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x130')));break;case 0xb:if(_0x24308c[_0x3aa5('0x107')]>=_0x4c2182['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x24308c[_0x3aa5('0x107')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1b4')],_0x3aa5('0x10d'))[_0x3aa5('0x84')](_0x3aa5('0x118')),'ContactId':_0x24308c[_0x3aa5('0xe3')],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})['catch'](loggerCatch(_0x3aa5('0x138')));break;case 0x13:if(_0x24308c[_0x3aa5('0xff')]>=_0x4c2182[_0x3aa5('0x109')]-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countmachineretry':_0x24308c[_0x3aa5('0xff')]+=0x1,'scheduledat':moment()['add'](_0x4c2182[_0x3aa5('0x10c')],'minutes')[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24308c[_0x3aa5('0xe3')],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c['VoiceQueueId']||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x24308c[_0x3aa5('0x113')]>=_0x4c2182['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x3aa5('0x117')]({'active':![],'countagentrejectretry':_0x24308c[_0x3aa5('0x113')]+=0x1,'scheduledat':moment()[_0x3aa5('0x10b')](_0x4c2182[_0x3aa5('0x1b5')],_0x3aa5('0x10d'))[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24308c[_0x3aa5('0xe3')],'ListId':_0x24308c[_0x3aa5('0xe4')],'VoiceQueueId':_0x24308c[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x24308c[_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1b6')));break;default:return!![];}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x1b7')]=function(_0x2983ce,_0x314557,_0x623905){var _0x2a53c6=this;var _0x55a8b4=new History(_0x2983ce);return new BPromise(function(_0x3f9d0a,_0x3d663e){if(_[_0x3aa5('0x94')](_0x314557)&&typeof _0x314557!==_0x3aa5('0x17c')){return _0x3d663e(msgResponse('[callProgressDetecting]',_0x3aa5('0x156'),_0x3aa5('0x1b8')));}if(_['isUndefined'](_0x623905)&&typeof _0x623905!=='object'){return _0x3d663e(msgResponse(_0x3aa5('0x1b9'),'Failure',_0x3aa5('0x1ba')));}switch(_0x623905[_0x3aa5('0x121')]){case'0':_0x314557['outboundNoSuchCallsDay']+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0x0;_0x55a8b4['statedesc']='NoSuchNumber';_0x55a8b4[_0x3aa5('0x105')]+=0x1;_0x55a8b4[_0x3aa5('0x100')]+=0x1;ami[_0x3aa5('0x51')]('custom:agentnosuchnumber',ut[_0x3aa5('0x101')](_0x2983ce,'nosuchnumber'));_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)[_0x3aa5('0xc9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2a53c6[_0x3aa5('0x1aa')](0x0,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x105')]>=_0x314557['dialNoSuchNumberMaxRetry']){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1bb'));}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x314557[_0x3aa5('0x6d')]+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0x3;_0x55a8b4[_0x3aa5('0xb9')]=_0x3aa5('0x1bc');_0x55a8b4[_0x3aa5('0x104')]+=0x1;_0x55a8b4[_0x3aa5('0x100')]+=0x1;ami[_0x3aa5('0x51')](_0x3aa5('0x1bd'),ut[_0x3aa5('0x101')](_0x2983ce,_0x3aa5('0x1be')));_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1bf')));if(_0x2a53c6[_0x3aa5('0x1aa')](0x3,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x104')]>=_0x314557[_0x3aa5('0x1ab')]){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1c0'));}}break;case'5':_0x314557[_0x3aa5('0x1c1')]+=0x1;_0x55a8b4['state']=0x5;_0x55a8b4['statedesc']=_0x3aa5('0x1c2');_0x55a8b4[_0x3aa5('0x102')]+=0x1;_0x55a8b4['countglobal']+=0x1;ami[_0x3aa5('0x51')](_0x3aa5('0x1c3'),ut[_0x3aa5('0x101')](_0x2983ce,_0x3aa5('0x1c4')));_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)[_0x3aa5('0xc9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2a53c6[_0x3aa5('0x1aa')](0x5,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x102')]>=_0x314557[_0x3aa5('0x1ad')]){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1c5'));}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1c5'));}}break;case'8':_0x314557[_0x3aa5('0x69')]+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0x8;_0x55a8b4[_0x3aa5('0xb9')]=_0x3aa5('0x1c6');_0x55a8b4[_0x3aa5('0x103')]+=0x1;_0x55a8b4[_0x3aa5('0x100')]+=0x1;ami[_0x3aa5('0x51')]('custom:agentcongestion',ut[_0x3aa5('0x101')](_0x2983ce,_0x3aa5('0x1c7')));_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1c8')));if(_0x2a53c6[_0x3aa5('0x1aa')](0x8,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x103')]>=_0x314557[_0x3aa5('0x1c9')]){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1ca'));}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1ca'));}}break;case'11':_0x314557['outboundAbandonedCallsDay']+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0xb;_0x55a8b4[_0x3aa5('0xb9')]=_0x3aa5('0x135');_0x55a8b4['countabandonedretry']+=0x1;_0x55a8b4[_0x3aa5('0x100')]+=0x1;_0x2a53c6['createHistory'](_0x55a8b4)[_0x3aa5('0xc9')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2a53c6[_0x3aa5('0x1aa')](0xb,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x107')]>=_0x314557[_0x3aa5('0x137')]){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1cb'));}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,'reason\x2011\x20abandoned');}}break;case'20':_0x314557['outboundRejectCallsDay']+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0x14;_0x55a8b4['statedesc']=_0x3aa5('0x1cc');_0x55a8b4[_0x3aa5('0x113')]+=0x1;_0x55a8b4[_0x3aa5('0x100')]+=0x1;ami['emit'](_0x3aa5('0x1cd'),ut[_0x3aa5('0x101')](_0x2983ce,'agentreject'));_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)['catch'](loggerCatch(_0x3aa5('0x1ce')));if(_0x2a53c6[_0x3aa5('0x1aa')](0x14,_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x113')]>=_0x314557[_0x3aa5('0x1cf')]){_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,'reason\x2020\x20agentreject');}else{_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x3aa5('0x1d0'));}}break;default:_0x314557[_0x3aa5('0x72')]+=0x1;_0x55a8b4[_0x3aa5('0xb8')]=0xc;_0x55a8b4[_0x3aa5('0xb9')]=_0x623905[_0x3aa5('0x121')];_0x2a53c6[_0x3aa5('0xdc')](_0x55a8b4)['catch'](loggerCatch(_0x3aa5('0x1d1')));if(_0x2a53c6[_0x3aa5('0x1aa')](_0x623905[_0x3aa5('0x121')],_0x2983ce,_0x314557)){if(_0x55a8b4[_0x3aa5('0x102')]+_0x55a8b4[_0x3aa5('0x103')]+_0x55a8b4[_0x3aa5('0x104')]+_0x55a8b4['countnosuchnumberretry']+_0x55a8b4[_0x3aa5('0x106')]+_0x55a8b4['countabandonedretry']+_0x55a8b4[_0x3aa5('0xff')]+_0x55a8b4[_0x3aa5('0x113')]>=_0x314557[_0x3aa5('0x108')]){_0x2a53c6[_0x3aa5('0x114')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x623905[_0x3aa5('0x121')]);}else{_0x2a53c6[_0x3aa5('0x10a')](_0x55a8b4,_0x3f9d0a,_0x3d663e,_0x623905['reason']);}}}});};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x114')]=function(_0x39c99f,_0xad9ec5,_0x40fe03,_0x1c45a6){var _0x2d276f=new Final(_0x39c99f);_0x2d276f['state']=0xf;_0x2d276f['statedesc']=_0x3aa5('0x1d2');this[_0x3aa5('0x10a')](_0x2d276f,_0xad9ec5,_0x40fe03,_0x1c45a6);};Dialer['prototype'][_0x3aa5('0x10a')]=function(_0x2db303,_0x565298,_0x177d21,_0x29a892){this[_0x3aa5('0xda')](_0x2db303)[_0x3aa5('0x40')](function(){return _0x565298(msgResponse(_0x3aa5('0x1b9'),_0x3aa5('0xeb'),_0x29a892));})[_0x3aa5('0xc9')](function(){return _0x177d21(msgResponse(_0x3aa5('0x1d3'),_0x3aa5('0x156'),'contact\x20not\x20moved'));});};Dialer[_0x3aa5('0x1e')][_0x3aa5('0xa')]=function(_0x2a2231){var _0x496ab0=_0x2a2231[_0x3aa5('0x1d4')]/0x64;var _0x30db2a=_0x2a2231['outboundDropCallsDayTimeout']/(_0x2a2231[_0x3aa5('0x6c')]+_0x2a2231[_0x3aa5('0x67')]);var _0xbe8de3=Math['round'](_0x2a2231[_0x3aa5('0x7c')]*(_0x2a2231[_0x3aa5('0x1d5')]/0x64));var _0x73a228=Math[_0x3aa5('0x1d6')](_0x2a2231[_0x3aa5('0x7c')]*(_0x2a2231[_0x3aa5('0x1d7')]/0x64));var _0x17fad6=_0x2a2231[_0x3aa5('0x55')]+_0x2a2231['talking'];var _0x500c00=Math['floor'](_0x2a2231[_0x3aa5('0x7e')]*_0x2a2231[_0x3aa5('0x9c')]*_0x2a2231[_0x3aa5('0x79')]*_0x2a2231['predictiveIntervalMultiplicativeFactor']);if(_[_0x3aa5('0x94')](_0x2a2231[_0x3aa5('0x80')])){if(!_['isUndefined'](_0x2a2231[_0x3aa5('0x2b')])){_0x2a2231['startPredictive']=undefined;loggerPredictive[_0x3aa5('0xa7')](_0x3aa5('0x1d8'),_0x3aa5('0x1d9'));}if(!_[_0x3aa5('0x94')](_0x2a2231[_0x3aa5('0xa1')])){loggerPredictive[_0x3aa5('0xa7')](_0x3aa5('0x1d8'),_0x3aa5('0x1da'));clearInterval(_0x2a2231[_0x3aa5('0xa1')]);_0x2a2231[_0x3aa5('0xa1')]=undefined;}_0x2a2231[_0x3aa5('0x80')]=moment()[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3aa5('0x8a')](_0x2a2231[_0x3aa5('0x44')],_0x3aa5('0x1db'),_0x2a2231['startProgressive']);this[_0x3aa5('0x169')](_0x2a2231,0x1);}else if(ifInterval(_0x2a2231['dialPredictiveInterval'],_0x2a2231[_0x3aa5('0x80')])){this[_0x3aa5('0x169')](_0x2a2231,0x1);loggerPredictiveCalls[_0x3aa5('0x8a')](_0x3aa5('0x1dc'),_0x2a2231[_0x3aa5('0x80')],_0x2a2231[_0x3aa5('0x44')]);_0x2a2231[_0x3aa5('0x7e')]=0x0;_0x2a2231[_0x3aa5('0x78')]=0x0;}else if(_0x496ab0<_0x30db2a&&_0x2a2231[_0x3aa5('0x1dd')]===_0x3aa5('0x1de')){freeVariablesPredictive(_0x2a2231);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x1df'),_0x3aa5('0x1e0'),_0x30db2a,_0x3aa5('0x80'),_0x2a2231[_0x3aa5('0x44')]);}else if(_0x500c00<_0x2a2231[_0x3aa5('0x78')]&&_0x2a2231[_0x3aa5('0x1dd')]===_0x3aa5('0x1de')){freeVariablesPredictive(_0x2a2231);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x1e1'),'Max\x20Drop\x20',_0x500c00,'Drop\x20in\x20this\x20interval',_0x2a2231['predictiveIntervalErlangCallsDroppedCalls'],_0x3aa5('0x80'),_0x2a2231['name']);}else if(!ifInterval(_0x2a2231[_0x3aa5('0x1e2')],_0x2a2231[_0x3aa5('0x80')])&&_['isUndefined'](_0x2a2231['startPredictive'])&&!_['isUndefined'](_0x2a2231[_0x3aa5('0x80')])){_0x2a2231[_0x3aa5('0x2b')]=moment()[_0x3aa5('0x84')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3aa5('0x8a')](_0x2a2231[_0x3aa5('0x44')],'started\x20in\x20predictive\x20at',_0x2a2231[_0x3aa5('0x2b')]);this[_0x3aa5('0xcf')](_0x2a2231['dialPredictiveInterval'])['then'](this[_0x3aa5('0x1e3')](_0x2a2231))[_0x3aa5('0x40')](mergeDataErlangB(_0x2a2231))['then'](this['startMethodPredictive'](_0x2a2231))[_0x3aa5('0xc9')](loggerCatchPredictive(_0x3aa5('0x1e4'),_0x2a2231));}else if(!ifInterval(_0x2a2231[_0x3aa5('0x1e2')],_0x2a2231[_0x3aa5('0x2b')])){_0x2a2231[_0x3aa5('0x78')]=0x0;_0x2a2231['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3aa5('0x8a')](_0x2a2231[_0x3aa5('0x44')],_0x3aa5('0x1e5'),_0x2a2231[_0x3aa5('0x2b')]);clearInterval(_0x2a2231[_0x3aa5('0xa1')]);_0x2a2231[_0x3aa5('0xa1')]=undefined;this[_0x3aa5('0xcf')](_0x2a2231[_0x3aa5('0x1e2')])[_0x3aa5('0x40')](this[_0x3aa5('0x1e3')](_0x2a2231))['then'](mergeDataErlangB(_0x2a2231))[_0x3aa5('0x40')](this[_0x3aa5('0x1e6')](_0x2a2231))['catch'](loggerCatchPredictive(_0x3aa5('0x1e7'),_0x2a2231));}else if(_0x2a2231[_0x3aa5('0x7c')]&&_0x17fad6<_0x2a2231[_0x3aa5('0x7c')]-_0x73a228){freeVariablesPredictive(_0x2a2231);loggerPredictive[_0x3aa5('0x8a')](_0x2a2231[_0x3aa5('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x17fad6,_0x3aa5('0x1e8'),_0x2a2231[_0x3aa5('0x7c')],'-',_0x73a228,'=',_0x2a2231[_0x3aa5('0x7c')]-_0x73a228,')');}else if(_0x2a2231['predictiveIntervalAvailable']&&_0x17fad6>_0x2a2231[_0x3aa5('0x7c')]+_0xbe8de3){freeVariablesPredictive(_0x2a2231);loggerPredictive[_0x3aa5('0x8a')](_0x2a2231[_0x3aa5('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x17fad6,_0x3aa5('0x1e9'),_0x2a2231[_0x3aa5('0x7c')],'+',_0xbe8de3,'=',_0x2a2231[_0x3aa5('0x7c')]+_0xbe8de3,')');}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x1e3')]=function(_0x4e2ca5){var _0x1e2021=this;return function(_0x3567c4){return new BPromise(function(_0x3bea64,_0x209542){_['merge'](_0x4e2ca5,_0x3567c4[0x0]);if(checkGetDataPredictive(_0x3567c4[0x0])){var _0x21ff43=_0x4e2ca5['predictiveIntervalAvailable']=_0x4e2ca5[_0x3aa5('0x5a')]+_0x4e2ca5[_0x3aa5('0x55')];var _0xe2c695=_0x4e2ca5[_0x3aa5('0x1e2')]*0x3c;var _0x872e9b=_0x3567c4[0x0][_0x3aa5('0x74')]+_0x3567c4[0x0][_0x3aa5('0x92')];var _0x2971c5=(_0x3567c4[0x0][_0x3aa5('0x73')]+_0x3567c4[0x0][_0x3aa5('0x76')]+_0x3567c4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3567c4[0x0][_0x3aa5('0x8d')];_0x4e2ca5[_0x3aa5('0x79')]=_0x2971c5>0x0?_0x2971c5:0x1;switch(_0x4e2ca5[_0x3aa5('0x1dd')]){case _0x3aa5('0x1de'):var _0x5d20f5=_0x4e2ca5[_0x3aa5('0x1d4')]/0x64;return _0x1e2021['abandonmentRate'](_0x21ff43,_0xe2c695,_0x872e9b,_0x2971c5,_0x5d20f5)[_0x3aa5('0x40')](function(_0x554586){return _0x3bea64(_0x554586);});case'agentBusyFactor':var _0x3be5ce=_0x4e2ca5['dialPredictiveOptimizationPercentage']/0x64;return _0x1e2021[_0x3aa5('0x1ea')](_0x21ff43,_0xe2c695,_0x872e9b,_0x2971c5,_0x3be5ce)['then'](function(_0x342207){return _0x3bea64(_0x342207);});default:return _0x209542(msgResponse(_0x3aa5('0x1eb'),_0x3aa5('0x156'),_0x3aa5('0x1ec')));}}else{return _0x209542(msgResponse(_0x3aa5('0x1eb'),_0x3aa5('0x156'),_0x3aa5('0x1ed')));}});};};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x1ee')]=function(_0x4302b5){var _0x3b433b=this;return function(_0x531af1){return new BPromise(function(_0x4c77b2,_0x2b235b){_['merge'](_0x4302b5,_0x531af1[0x0]);if(checkGetDataPredictive(_0x531af1[0x0])){loggerPredictive[_0x3aa5('0x8a')](JSON['stringify'](_0x531af1[0x0]));if(_0x4302b5['dialPredictiveOptimization']===_0x3aa5('0x1de')){return _0x3b433b[_0x3aa5('0xd8')](_0x4302b5['id'])[_0x3aa5('0x40')](function(_0x3cab5e){var _0x16b208=_0x4302b5[_0x3aa5('0x56')]-_0x3cab5e[0x0][_0x3aa5('0x1ef')];var _0x1762fa=_0x4302b5[_0x3aa5('0x1e2')]*0x3c;var _0x4d8d2c=_0x531af1[0x0][_0x3aa5('0x74')]+_0x531af1[0x0][_0x3aa5('0x92')];var _0x3fb078=(_0x531af1[0x0]['predictiveIntervalAnsweredCalls']+_0x531af1[0x0][_0x3aa5('0x76')]+_0x531af1[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x531af1[0x0]['predictiveIntervalTotalCalls'];var _0x563806=_0x4302b5[_0x3aa5('0x1d4')]/0x64;_0x4302b5[_0x3aa5('0x7b')]=_0x3cab5e[0x0][_0x3aa5('0x1ef')]||0x0;_0x4302b5['predictiveIntervalHitRate']=_0x3fb078>0x0?_0x3fb078:0x1;return _0x3b433b[_0x3aa5('0x1f0')](_0x16b208,_0x1762fa,_0x4d8d2c,_0x3fb078,_0x563806);})['then'](function(_0x5c4282){return _0x4c77b2(_0x5c4282);})[_0x3aa5('0xc9')](function(_0x41d1cf){return _0x2b235b(msgResponse(_0x3aa5('0x1f1'),_0x3aa5('0x156'),JSON[_0x3aa5('0x4d')](_0x41d1cf)));});}if(_0x4302b5['dialPredictiveOptimization']===_0x3aa5('0x1f2')){return _0x3b433b[_0x3aa5('0xd8')](_0x4302b5['id'])[_0x3aa5('0x40')](function(_0x57c4a3){var _0x4a1c23=_0x4302b5[_0x3aa5('0x56')]-_0x57c4a3[0x0]['outboundQueuePauses'];var _0xd383c5=_0x4302b5['dialPredictiveInterval']*0x3c;var _0x3e46de=_0x531af1[0x0][_0x3aa5('0x74')]+_0x531af1[0x0][_0x3aa5('0x92')];var _0x158f52=(_0x531af1[0x0][_0x3aa5('0x73')]+_0x531af1[0x0][_0x3aa5('0x76')]+_0x531af1[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x531af1[0x0][_0x3aa5('0x8d')];var _0x346070=_0x4302b5[_0x3aa5('0x1d4')]/0x64;_0x4302b5[_0x3aa5('0x7b')]=_0x57c4a3[0x0][_0x3aa5('0x1ef')]||0x0;_0x4302b5[_0x3aa5('0x79')]=_0x158f52>0x0?_0x158f52:0x1;return _0x3b433b['busyFactor'](_0x4a1c23,_0xd383c5,_0x3e46de,_0x158f52,_0x346070);})[_0x3aa5('0x40')](function(_0x2bbeaf){return _0x4c77b2(_0x2bbeaf);})[_0x3aa5('0xc9')](function(_0x470628){return _0x2b235b(msgResponse(_0x3aa5('0x1f1'),_0x3aa5('0x156'),JSON[_0x3aa5('0x4d')](_0x470628)));});}}else{return _0x2b235b(msgResponse(_0x3aa5('0x1eb'),_0x3aa5('0x156'),_0x3aa5('0x1ed')));}});};};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x1e6')]=function(_0x3db295){var _0x5076af=this;return function(){var _0x473acd=0x0;var _0x30da1f=Math['floor'](_0x3db295[_0x3aa5('0x1f3')]*0x3e8);if(_0x30da1f>0x0){_0x30da1f=_0x30da1f<0x64?0x64:_0x30da1f;loggerPredictive[_0x3aa5('0x8a')](_0x3db295['name'],'one\x20call\x20every:',_0x30da1f,_0x3aa5('0x4e'));_0x3db295[_0x3aa5('0xa1')]=setInterval(function(){_0x5076af[_0x3aa5('0xa1')](_0x3db295);loggerPredictiveCalls[_0x3aa5('0x8a')](_0x3aa5('0x1f4'),_0x473acd+=0x1);},_0x30da1f);}else{loggerPredictive[_0x3aa5('0x8a')](_0x3db295[_0x3aa5('0x44')],_0x3aa5('0x1f5'));}};};Dialer[_0x3aa5('0x1e')]['checkContactBlack']=function(_0x31ee2f,_0x57f989){var _0x5aabad=this;return function(_0x492aad){if(_[_0x3aa5('0x89')](_0x492aad)){if(_[_0x3aa5('0xc0')](_0x57f989[_0x3aa5('0xe5')])||!_0x57f989[_0x3aa5('0x1f6')]){if(_0x31ee2f[_0x3aa5('0x61')]===_0x3aa5('0x9')){_0x31ee2f[_0x3aa5('0x142')]=_[_0x3aa5('0x94')](_0x31ee2f[_0x3aa5('0x142')])?!![]:_0x31ee2f[_0x3aa5('0x142')];var _0x5af96f=uuid['v4']();_0x5aabad[_0x3aa5('0x28')][_0x5af96f]=new Action(_0x31ee2f,_0x57f989,_0x5af96f);loggerBooked['info'](_0x3aa5('0x1f7'),_0x5af96f,_0x3aa5('0x1f8'),JSON[_0x3aa5('0x4d')](_0x31ee2f[_0x3aa5('0x142')]),_0x3aa5('0x1f9'),_0x31ee2f[_0x3aa5('0x44')]);if(_0x31ee2f[_0x3aa5('0x142')]){_0x31ee2f['queueStatusComplete']=![];_0x5aabad[_0x3aa5('0x13f')][_0x5aabad[_0x3aa5('0x28')][_0x5af96f]['queue']]=[];ami['Action']({'actionid':_0x5af96f,'action':_0x3aa5('0x1fa'),'queue':_0x31ee2f[_0x3aa5('0x44')]})[_0x3aa5('0xc9')](function(){_0x5aabad[_0x3aa5('0xc3')](_0x31ee2f);_0x5aabad[_0x3aa5('0x117')]({'active':![],'ContactId':_0x5aabad['actions'][_0x5af96f][_0x3aa5('0xe3')],'ListId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f][_0x3aa5('0xe4')],'VoiceQueueId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f][_0x3aa5('0xe6')]||undefined,'CampaignId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f][_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1fb')));delete _0x5aabad['actions'][_0x5af96f];});}else{loggerBooked[_0x3aa5('0x8a')](_0x3aa5('0x1fc'),JSON[_0x3aa5('0x4d')](_0x31ee2f[_0x3aa5('0x142')]),_0x3aa5('0x1f9'),_0x31ee2f[_0x3aa5('0x44')]);_0x5aabad[_0x3aa5('0xc3')](_0x31ee2f);_0x5aabad['rescheduleContact']({'active':![],'ContactId':_0x5aabad['actions'][_0x5af96f]['ContactId'],'ListId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f][_0x3aa5('0xe4')],'VoiceQueueId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f]['VoiceQueueId']||undefined,'CampaignId':_0x5aabad[_0x3aa5('0x28')][_0x5af96f][_0x3aa5('0xe7')]||undefined})[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0x1fb')));delete _0x5aabad['actions'][_0x5af96f];}}else{return _0x5aabad['actionOriginate'](_0x31ee2f,_0x57f989);}}else{if(getDiff(_0x57f989[_0x3aa5('0x1fd')])<_0x31ee2f[_0x3aa5('0x1fe')]*0x3c){if(_0x57f989[_0x3aa5('0x16d')]&&!_0x57f989['Agent']['voicePause']){_0x5aabad[_0x3aa5('0xa3')][_0x3aa5('0x144')](_0x57f989['id'])[_0x3aa5('0x21')](function(){_0x5aabad[_0x3aa5('0xc3')](_0x31ee2f);});}else{_0x5aabad[_0x3aa5('0xd2')]({'active':![]},_0x57f989['id'],0x1)[_0x3aa5('0x21')](function(){_0x5aabad['updateOriginated'](_0x31ee2f);});}}else{_0x31ee2f[_0x3aa5('0x70')]+=0x1;_0x5aabad[_0x3aa5('0xc3')](_0x31ee2f);if(_0x31ee2f[_0x3aa5('0x1ff')]){_0x5aabad['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x57f989[_0x3aa5('0xe3')],'ListId':_0x57f989[_0x3aa5('0xe4')],'VoiceQueueId':_0x57f989[_0x3aa5('0xe6')]||undefined,'CampaignId':_0x57f989[_0x3aa5('0xe7')]||undefined})['catch'](loggerCatch(_0x3aa5('0x200')));_0x5aabad['createHistory'](createObjHistory(_0x31ee2f,_0x57f989,_0x3aa5('0x201'),0x17,_0x3aa5('0x202')))['catch'](loggerCatch(_0x3aa5('0x203')));}else{_0x5aabad[_0x3aa5('0xef')](createObjHistory(_0x31ee2f,_0x57f989,_0x3aa5('0x204'),0x16,_0x3aa5('0x205')),_0x3aa5('0x206'),'[Originate][HistoryRecallClose]');}}}}else{_0x31ee2f['outboundBlacklistCallsDay']+=0x1;_0x5aabad[_0x3aa5('0xef')](createObjHistory(_0x31ee2f,_0x57f989,_0x3aa5('0x207'),0xd,'Blacklist'),_0x3aa5('0x208'),'[Originate][MoveBlacklist]');throw _0x3aa5('0x209');}};};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x170')]=function(_0x5a26c6){var _0xf2c9a0=this;var _0xbcf4a=_0x5a26c6[_0x3aa5('0x20a')]-_0x5a26c6[_0x3aa5('0x7d')]-_0x5a26c6[_0x3aa5('0xd5')];emitCampaignSummary(_0x5a26c6);if(_0xbcf4a>0x0){if(_0xbcf4a>this['maxNumberOriginate']){_0xbcf4a=this['maxNumberOriginate'];}_0x5a26c6[_0x3aa5('0xd5')]+=_0xbcf4a;this[_0x3aa5('0x20b')](_0x5a26c6['id'],_0xbcf4a,_0x5a26c6[_0x3aa5('0x20c')],_0x5a26c6)[_0x3aa5('0x40')](function(_0x172bd0){_0x5a26c6[_0x3aa5('0xd5')]-=_0xbcf4a;_0x5a26c6[_0x3aa5('0xd5')]=_0x5a26c6[_0x3aa5('0xd5')]>0x0?_0x5a26c6['temp']:0x0;if(!checkContactEmpty(_0x172bd0)){_0x5a26c6[_0x3aa5('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x3aa5('0x8a')](_0x3aa5('0x20d')+_0x5a26c6[_0x3aa5('0x44')]);}else{_0x5a26c6[_0x3aa5('0x7d')]+=_0x172bd0[_0x3aa5('0x147')];_0x5a26c6[_0x3aa5('0x42')]=_0x3aa5('0x20e');for(var _0x4a0af4=0x0;_0x4a0af4<_0x172bd0['length'];_0x4a0af4+=0x1){_0x5a26c6['ivrTotalCallsDays']+=0x1;if(_[_0x3aa5('0xc0')](_0x172bd0[_0x4a0af4])||_['isNil'](_0x172bd0[_0x4a0af4][_0x3aa5('0x17f')])||_[_0x3aa5('0xc0')](_0x172bd0[_0x4a0af4][_0x3aa5('0x17f')][_0x3aa5('0x180')])){_0xf2c9a0['emptyContact'](_0x3aa5('0x20f'),_0x5a26c6,_0x172bd0[_0x4a0af4]);}else{_0xf2c9a0[_0x3aa5('0xcc')](_['pick'](_0x172bd0[_0x4a0af4],[_0x3aa5('0xe7'),_0x3aa5('0x210')]))[_0x3aa5('0x40')](_0xf2c9a0[_0x3aa5('0x211')](_0x5a26c6,_0x172bd0[_0x4a0af4]))[_0x3aa5('0xc9')](_0xf2c9a0['loggerHandler'](_0x3aa5('0x212'),_0x5a26c6));}}}})[_0x3aa5('0xc9')](loggerGetContactDialer(_0x3aa5('0x213'),_0x5a26c6,_0xbcf4a));}};Dialer[_0x3aa5('0x1e')][_0x3aa5('0x169')]=function(_0x593b76,_0x5bccc6){var _0x3f13c0=this;var _0x287c03=[];var _0x3fe50b=_0x5bccc6>=0x1?_0x5bccc6:0x1;if(_0x593b76[_0x3aa5('0x61')]===_0x3aa5('0x9')){_0x3fe50b=0x1;}var _0x26bb38=Math['floor'](_0x593b76[_0x3aa5('0x55')]*_0x3fe50b)-_0x593b76[_0x3aa5('0x7d')]-_0x593b76[_0x3aa5('0xd5')];emitVoiceQueueSummary(_0x593b76);if(_0x593b76[_0x3aa5('0x214')]>0x0){var _0x4f06d8=_0x593b76['dialLimitQueue']-_0x593b76[_0x3aa5('0x7d')]-_0x593b76[_0x3aa5('0x5a')]-_0x593b76[_0x3aa5('0xd5')]-_0x593b76[_0x3aa5('0x57')];if(_0x26bb38>_0x4f06d8){_0x26bb38=_0x4f06d8;}}if(_0x26bb38>0x0){if(_0x593b76['dialMethod']===_0x3aa5('0x9')){_0x26bb38=0x1;}if(_0x26bb38>this[_0x3aa5('0x26')]){_0x26bb38=this['maxNumberOriginate'];}_0x593b76[_0x3aa5('0xd5')]+=_0x26bb38;for(var _0x29d13c in this['agents']){if(typeof this[_0x3aa5('0x24')][_0x29d13c]!==_0x3aa5('0xaa')){if(this[_0x3aa5('0x24')][_0x29d13c]['state']==='not_inuse'&&this[_0x3aa5('0x24')][_0x29d13c]['status']===_0x3aa5('0xee')){_0x287c03[_0x3aa5('0x140')](this[_0x3aa5('0x24')][_0x29d13c]['id']);}}}this[_0x3aa5('0xd4')](_0x593b76['id'],_0x287c03,_0x26bb38,_0x593b76[_0x3aa5('0x20c')],_0x593b76)['then'](function(_0x4be1e0){_0x593b76[_0x3aa5('0xd5')]-=_0x26bb38;_0x593b76['temp']=_0x593b76[_0x3aa5('0xd5')]>0x0?_0x593b76['temp']:0x0;if(!checkContactEmpty(_0x4be1e0)){_0x3f13c0['countReScheduled'](_0x593b76)[_0x3aa5('0x40')](sendMessageReschedule(_0x593b76))[_0x3aa5('0xc9')](loggerCatch(_0x3aa5('0xca')));}else{_0x593b76[_0x3aa5('0x7d')]+=_0x4be1e0[_0x3aa5('0x147')];_0x593b76[_0x3aa5('0x42')]=_0x593b76[_0x3aa5('0x61')]===_0x3aa5('0x9')?_0x3aa5('0x187'):_0x3aa5('0x20e');for(var _0x1a61d6=0x0;_0x1a61d6<_0x4be1e0['length'];_0x1a61d6+=0x1){if(_['isNil'](_0x4be1e0[_0x1a61d6])||_[_0x3aa5('0xc0')](_0x4be1e0[_0x1a61d6][_0x3aa5('0x17f')])||_[_0x3aa5('0xc0')](_0x4be1e0[_0x1a61d6][_0x3aa5('0x17f')][_0x3aa5('0x180')])){_0x3f13c0[_0x3aa5('0xe0')](_0x3aa5('0x20f'),_0x593b76,_0x4be1e0[_0x1a61d6]);}else{_0x3f13c0[_0x3aa5('0xcb')](_[_0x3aa5('0xe2')](_0x4be1e0[_0x1a61d6],['VoiceQueueId',_0x3aa5('0x210')]))['then'](_0x3f13c0[_0x3aa5('0x211')](_0x593b76,_0x4be1e0[_0x1a61d6]))['catch'](_0x3f13c0[_0x3aa5('0x215')](_0x3aa5('0x20f'),_0x593b76));}}}})['catch'](loggerGetContactDialer(_0x3aa5('0x216'),_0x593b76,_0x26bb38));}};Dialer[_0x3aa5('0x1e')]['handlePredictive']=function(_0xaa5ee7){if(_0xaa5ee7[_0x3aa5('0x214')]>0x0){var _0x5ca72f=_0xaa5ee7[_0x3aa5('0x214')]-_0xaa5ee7['originated']-_0xaa5ee7[_0x3aa5('0x5a')];if(_0x5ca72f>0x0){this[_0x3aa5('0x217')](_0xaa5ee7);}else{loggerPredictiveCalls[_0x3aa5('0x8a')](_0x3aa5('0x218'));}}else{this[_0x3aa5('0x217')](_0xaa5ee7);}};Dialer['prototype'][_0x3aa5('0x217')]=function(_0x295061){var _0x248cbb=this;var _0x5697f5=[];_0x295061[_0x3aa5('0x7d')]+=0x1;for(var _0x3736b0 in this[_0x3aa5('0x24')]){if(typeof this[_0x3aa5('0x24')][_0x3736b0]!==_0x3aa5('0xaa')){if(this[_0x3aa5('0x24')][_0x3736b0][_0x3aa5('0xb8')]==='not_inuse'&&this[_0x3aa5('0x24')][_0x3736b0][_0x3aa5('0xed')]===_0x3aa5('0xee')){_0x5697f5[_0x3aa5('0x140')](this[_0x3aa5('0x24')][_0x3736b0]['id']);}}}this[_0x3aa5('0xd4')](_0x295061['id'],_0x5697f5,0x1,_0x295061[_0x3aa5('0x20c')],_0x295061)[_0x3aa5('0x40')](function(_0xa35ca6){if(!checkContactEmpty(_0xa35ca6)){checkContactLowerLimitOriginate(_0x295061,0x1,0x0);_0x248cbb[_0x3aa5('0xc8')](_0x295061)[_0x3aa5('0x40')](sendMessageReschedule(_0x295061))[_0x3aa5('0xc9')](loggerCatch('[countReScheduled]\x20'));}else{_0x295061[_0x3aa5('0x42')]=_0x3aa5('0x20e');if(_[_0x3aa5('0xc0')](_0xa35ca6[0x0])||_[_0x3aa5('0xc0')](_0xa35ca6[0x0][_0x3aa5('0x17f')])||_[_0x3aa5('0xc0')](_0xa35ca6[0x0][_0x3aa5('0x17f')][_0x3aa5('0x180')])){_0x248cbb[_0x3aa5('0xe0')](_0x3aa5('0x20f'),_0x295061,_0xa35ca6[0x0]);}else{_0x248cbb[_0x3aa5('0xcb')](_[_0x3aa5('0xe2')](_0xa35ca6[0x0],['VoiceQueueId',_0x3aa5('0x210')]))[_0x3aa5('0x40')](_0x248cbb[_0x3aa5('0x211')](_0x295061,_0xa35ca6[0x0]))[_0x3aa5('0xc9')](_0x248cbb[_0x3aa5('0x215')](_0x3aa5('0x219'),_0x295061));}}})['catch'](loggerGetContactDialer(_0x3aa5('0x21a'),_0x295061,0x1));emitVoiceQueueSummary(_0x295061);};Dialer[_0x3aa5('0x1e')]['abandonmentRate']=function(_0x3bcc7f,_0x3a474b,_0x5f2be0,_0x516ab3,_0x118fac,_0x4f999f){loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x21b'));loggerPredictive[_0x3aa5('0x8a')]('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',_0x3bcc7f);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x21c'),_0x3a474b);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x21d'),_0x5f2be0);loggerPredictive[_0x3aa5('0x8a')]('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',_0x516ab3);loggerPredictive['info'](_0x3aa5('0x21e'),_0x118fac);loggerPredictive[_0x3aa5('0x8a')]('---------------------------');return new BPromise(function(_0x3389ad,_0x3c153d){if(_0x3bcc7f<=0x0||isNaN(_0x3bcc7f)){return _0x3c153d(msgResponse(_0x3aa5('0x21f'),_0x3aa5('0x4c'),_0x3aa5('0x220')+_0x3bcc7f));}if(_0x5f2be0<=0x0||isNaN(_0x5f2be0)){return _0x3c153d(msgResponse(_0x3aa5('0x21f'),_0x3aa5('0x4c'),_0x3aa5('0x221')+_0x5f2be0));}if(_0x516ab3<=0x0||isNaN(_0x516ab3)){return _0x3c153d(msgResponse(_0x3aa5('0x21f'),_0x3aa5('0x4c'),'p\x20=\x20'+_0x516ab3));}if(_0x3a474b<=0x0||isNaN(_0x3a474b)){return _0x3c153d(msgResponse(_0x3aa5('0x21f'),_0x3aa5('0x4c'),_0x3aa5('0x222')+_0x3a474b));}if(_0x118fac<=0x0||isNaN(_0x118fac)){return _0x3c153d(msgResponse(_0x3aa5('0x21f'),_0x3aa5('0x4c'),_0x3aa5('0x223')+_0x118fac));}_0x4f999f=_0x4f999f||0x0;var _0x451a16=0x1/_0x5f2be0;var _0x186e3c=0x0;var _0x3ac96e=0x0;var _0x33145b=0x0;var _0x1a2355=0x0;for(var _0x479c37=0x0;_0x33145b<_0x118fac;_0x479c37+=0x1){_0x3ac96e=_0x479c37/_0x3a474b;_0x186e3c=(_0x516ab3*_0x3ac96e+_0x4f999f)/_0x451a16;_0x33145b=erlangb(_0x186e3c,_0x3bcc7f);_0x1a2355=_0x186e3c/_0x3bcc7f*(0x1-erlangb(_0x186e3c,_0x3bcc7f));}return _0x3389ad({'erlangCalls':_0x479c37,'erlangCallToSecond':_0x3a474b/_0x479c37,'erlangAbandonmentRate':_0x33145b,'erlangBusyFactor':_0x1a2355});});};Dialer['prototype']['busyFactor']=function(_0x2a15ea,_0x342c3c,_0x4d13ae,_0x48bfb4,_0x4d7b06,_0xadfa3){loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x224'));loggerPredictive['info'](_0x3aa5('0x225'),_0x2a15ea);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x21c'),_0x342c3c);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x21d'),_0x4d13ae);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x226'),_0x48bfb4);loggerPredictive[_0x3aa5('0x8a')](_0x3aa5('0x227'),_0x4d7b06);loggerPredictive['info'](_0x3aa5('0x93'));return new BPromise(function(_0x34798b,_0x1a5cab){if(_0x2a15ea<=0x0||isNaN(_0x2a15ea)){return _0x1a5cab(msgResponse(_0x3aa5('0x228'),_0x3aa5('0x4c'),_0x3aa5('0x220')+_0x2a15ea));}if(_0x4d13ae<=0x0||isNaN(_0x4d13ae)){return _0x1a5cab(msgResponse(_0x3aa5('0x228'),_0x3aa5('0x4c'),'Ts\x20=\x20'+_0x4d13ae));}if(_0x48bfb4<=0x0||isNaN(_0x48bfb4)){return _0x1a5cab(msgResponse(_0x3aa5('0x228'),'Error','p\x20=\x20'+_0x48bfb4));}if(_0x342c3c<=0x0||isNaN(_0x342c3c)){return _0x1a5cab(msgResponse(_0x3aa5('0x228'),'Error',_0x3aa5('0x222')+_0x342c3c));}if(_0x4d7b06<=0x0||isNaN(_0x4d7b06)){return _0x1a5cab(msgResponse('[busyFactor]',_0x3aa5('0x4c'),_0x3aa5('0x229')+_0x4d7b06));}_0xadfa3=_0xadfa3||0x0;var _0x25f0df=0x1/_0x4d13ae;var _0x133d75=0x0;var _0xfebaed=0x0;var _0x423670=0x0;var _0x32b675=0x0;for(var _0x1d6284=0x0;_0x32b675<_0x4d7b06;_0x1d6284+=0x1){_0xfebaed=_0x1d6284/_0x342c3c;_0x133d75=(_0x48bfb4*_0xfebaed+_0xadfa3)/_0x25f0df;_0x423670=erlangb(_0x133d75,_0x2a15ea);_0x32b675=_0x133d75/_0x2a15ea*(0x1-erlangb(_0x133d75,_0x2a15ea));}return _0x34798b({'erlangCalls':_0x1d6284,'erlangCallToSecond':_0x342c3c/_0x1d6284,'erlangAbandonmentRate':_0x423670,'erlangBusyFactor':_0x32b675});});};module[_0x3aa5('0x22a')]=Dialer; \ No newline at end of file +var _0x2c37=['sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','statedesc','starttime','[uniqueid]','clearZombieChannels','[actions]','isNil','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','state','HangupInAMD','membername','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','AMD','countmachineretry','amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','[rescheduleContact][Machine]','countglobal','countcongestionretry','VoiceQueueId','syncHangup','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','strategy','actionid','locked','paused','stateinterface','rrmemory','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','stringify','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','push','iftime\x20%s,%s','interval','content','indexOf','true','Action','command','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','updatedAt','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','abandonmentRate','busyFactor','[getDataPredictive]','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[countReScheduled]\x20','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','outbound','answered','loggedIn','pTalking','sumBillable','sumDuration'];(function(_0x15d409,_0x16c2ee){var _0x379106=function(_0x3ab526){while(--_0x3ab526){_0x15d409['push'](_0x15d409['shift']());}};_0x379106(++_0x16c2ee);}(_0x2c37,0x1c8));var _0x72c3=function(_0x3fc17a,_0x294656){_0x3fc17a=_0x3fc17a-0x0;var _0x45d639=_0x2c37[_0x3fc17a];return _0x45d639;};'use strict';var util=require(_0x72c3('0x0'));var _=require(_0x72c3('0x1'));var BPromise=require(_0x72c3('0x2'));var uuid=require(_0x72c3('0x3'));var moment=require(_0x72c3('0x4'));var rr=require('rr');var md5=require(_0x72c3('0x5'));var Redis=require('ioredis');var ut=require(_0x72c3('0x6'));var config=require(_0x72c3('0x7'));var logger=require(_0x72c3('0x8'))(_0x72c3('0x9'));var loggerBooked=require(_0x72c3('0x8'))(_0x72c3('0xa'));var loggerPredictive=require('../../../config/logger')(_0x72c3('0xb'));var loggerPredictiveCalls=require(_0x72c3('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x72c3('0x8'))(_0x72c3('0xc'));var ami=require('../ami');config[_0x72c3('0xd')]=_[_0x72c3('0xe')](config[_0x72c3('0xd')],{'host':_0x72c3('0xf'),'port':0x18eb});var io=require(_0x72c3('0x10'))(new Redis(config[_0x72c3('0xd')]));var cmHopper=require(_0x72c3('0x11'));var cmHopperHistory=require(_0x72c3('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x72c3('0x13'));var RpcSetting=require('../rpc/setting');var Action=require(_0x72c3('0x14'));var History=require('./history');var Final=require(_0x72c3('0x15'));var AgentComplete=require(_0x72c3('0x16'));var QueueCallerAbandon=require(_0x72c3('0x17'));var Hangup=require(_0x72c3('0x18'));var ipAgi=process[_0x72c3('0x19')][_0x72c3('0x1a')]||_0x72c3('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x72c3('0x1c')][_0x72c3('0x1d')]=function(_0x1c7e62){this[_0x72c3('0x1e')]=this[_0x72c3('0x1e')]?this[_0x72c3('0x1e')][_0x72c3('0x1f')](_0x1c7e62):_0x1c7e62();};function Dialer(_0x404a9f,_0x1e9d1b){this[_0x72c3('0x20')]=new Sequence();this['preview']=_0x1e9d1b;this[_0x72c3('0x21')]=_0x404a9f[_0x72c3('0x21')];this['campaigns']=_0x404a9f[_0x72c3('0x22')];this[_0x72c3('0x23')]=_0x404a9f[_0x72c3('0x23')];this['trunks']=_0x404a9f['trunks'];this[_0x72c3('0x24')]=config[_0x72c3('0x24')]||0x2;this['channels']={};this[_0x72c3('0x25')]={};this[_0x72c3('0x26')]={};this[_0x72c3('0x27')]={};this[_0x72c3('0x28')]={};this['startPredictive']={};this[_0x72c3('0x29')]={};this['ivrOriginated']={};this[_0x72c3('0x2a')]={};this[_0x72c3('0x2b')]={};ami['on'](_0x72c3('0x2c'),this['syncAgentConnect'][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x2e'),this[_0x72c3('0x2f')]['bind'](this));ami['on']('originateresponse',this[_0x72c3('0x30')][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x31'),this['syncAgentComplete'][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x32'),this[_0x72c3('0xc')][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x33'),this['syncHangup'][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x34'),this[_0x72c3('0x35')]['bind'](this));ami['on'](_0x72c3('0x36'),this[_0x72c3('0x37')][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x38'),this['syncQueueMember'][_0x72c3('0x2d')](this));ami['on'](_0x72c3('0x39'),this['syncQueueStatusComplete'][_0x72c3('0x2d')](this));this[_0x72c3('0x3a')]();this[_0x72c3('0x3b')]();RpcSetting[_0x72c3('0x3c')]()['then'](function(_0x40fc2e){previewRecallmeReminderInterval=_0x40fc2e[_0x72c3('0x3d')];});}function isNotNull(_0x55d9f5){return _0x55d9f5!==null&&!_['isUndefined'](_0x55d9f5);}function checkIsLoggedIn(_0x122662,_0x4fc698){return function(){if(_0x4fc698<=0x0){_0x122662[_0x72c3('0x3e')]=_0x72c3('0x3f');throw _0x122662[_0x72c3('0x40')]+_0x72c3('0x41');}};}function isActive(_0x4b97bb){return _0x4b97bb;}function checkIsActive(_0x5582ff,_0x49ad9d){return function(){if(!isActive(_0x49ad9d)){_0x5582ff[_0x72c3('0x3e')]=_0x72c3('0x42');throw _0x5582ff[_0x72c3('0x40')]+_0x72c3('0x43');}};}function checkInterval(_0x4bb191){return function(){if(!isNotNull(_0x4bb191[_0x72c3('0x44')])){_0x4bb191[_0x72c3('0x3e')]=_0x72c3('0x45');throw _0x4bb191[_0x72c3('0x40')]+_0x72c3('0x46');}if(!isNotNull(_0x4bb191['Interval'][_0x72c3('0x47')])){_0x4bb191['message']=_0x72c3('0x45');throw _0x4bb191[_0x72c3('0x40')]+_0x72c3('0x46');}if(!isNotNull(_['isEmpty'](_0x4bb191[_0x72c3('0x44')]['Intervals']))){_0x4bb191[_0x72c3('0x3e')]=_0x72c3('0x45');throw _0x4bb191[_0x72c3('0x40')]+_0x72c3('0x46');}};}function msgResponse(_0x584838,_0x46fbab,_0x4775f3){return{'action':_0x584838,'response':_0x46fbab,'message':_0x4775f3,'stack':_0x4775f3};}function myreject(_0x4cca1a){return function(_0x25dc99){return _0x4cca1a(msgResponse(_0x72c3('0x48'),_0x72c3('0x49'),JSON['stringify'](_0x25dc99)));};}function getSeconds(_0x4c2714,_0x49c55b){var _0x12e607=moment(_0x4c2714)[_0x72c3('0x4a')](0x0);var _0x3b5169=moment(_0x49c55b)[_0x72c3('0x4a')](0x0);return _0x12e607[_0x72c3('0x4b')](_0x3b5169,_0x72c3('0x4c'));}function emit(_0x49b837,_0x49486b,_0xeaf1a1){io['to'](_0x49b837)[_0x72c3('0x4d')](_0x49486b,_0xeaf1a1);}function emitVoiceQueueSummary(_0x3a4b44){if(_0x3a4b44[_0x72c3('0x4e')]===_0x72c3('0x4f')){var _0x3804f9={'id':_0x3a4b44['id'],'name':_0x3a4b44[_0x72c3('0x40')],'strategy':_0x3a4b44['strategy'],'answered':_0x3a4b44[_0x72c3('0x50')],'available':_0x3a4b44['available'],'loggedIn':_0x3a4b44[_0x72c3('0x51')],'pTalking':_0x3a4b44[_0x72c3('0x52')],'sumBillable':_0x3a4b44[_0x72c3('0x53')],'sumDuration':_0x3a4b44[_0x72c3('0x54')],'sumHoldTime':_0x3a4b44[_0x72c3('0x55')]||0x0,'talking':_0x3a4b44[_0x72c3('0x56')],'total':_0x3a4b44[_0x72c3('0x57')],'type':_0x3a4b44[_0x72c3('0x4e')],'unmanaged':_0x3a4b44[_0x72c3('0x58')],'abandoned':_0x3a4b44[_0x72c3('0x59')],'waiting':_0x3a4b44[_0x72c3('0x5a')],'loggedInDb':_0x3a4b44['loggedInDb'],'dialActive':_0x3a4b44['dialActive'],'dialMethod':_0x3a4b44['dialMethod'],'dialOriginateCallerIdName':_0x3a4b44[_0x72c3('0x5b')],'dialOriginateCallerIdNumber':_0x3a4b44[_0x72c3('0x5c')],'dialOriginateTimeout':_0x3a4b44[_0x72c3('0x5d')],'dialPrefix':_0x3a4b44[_0x72c3('0x5e')],'outboundAnswerAgiCallsDay':_0x3a4b44[_0x72c3('0x5f')],'outboundAnswerCallsDay':_0x3a4b44[_0x72c3('0x60')],'outboundBlacklistCallsDay':_0x3a4b44['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3a4b44['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3a4b44[_0x72c3('0x61')],'outboundDropCallsDayACS':_0x3a4b44[_0x72c3('0x62')],'outboundDropCallsDayCallersExit':_0x3a4b44[_0x72c3('0x63')],'outboundDropCallsDayTimeout':_0x3a4b44[_0x72c3('0x64')],'outboundNoAnswerCallsDay':_0x3a4b44[_0x72c3('0x65')],'outboundNoSuchCallsDay':_0x3a4b44[_0x72c3('0x66')],'outboundOriginateFailureCallsDay':_0x3a4b44[_0x72c3('0x67')],'outboundReCallsDay':_0x3a4b44[_0x72c3('0x68')],'outboundRejectCallsDay':_0x3a4b44['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3a4b44[_0x72c3('0x69')],'predictiveIntervalAnsweredCalls':_0x3a4b44[_0x72c3('0x6a')],'predictiveIntervalAvgHoldtime':_0x3a4b44['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3a4b44[_0x72c3('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x3a4b44[_0x72c3('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x3a4b44['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3a4b44[_0x72c3('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a4b44[_0x72c3('0x6e')],'predictiveIntervalHitRate':_0x3a4b44[_0x72c3('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x3a4b44[_0x72c3('0x70')],'predictiveIntervalPauses':_0x3a4b44['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3a4b44[_0x72c3('0x71')],'predictiveIntervalTotalCalls':_0x3a4b44[_0x72c3('0x72')],'message':_0x3a4b44[_0x72c3('0x3e')],'originated':_0x3a4b44[_0x72c3('0x73')],'erlangCalls':_0x3a4b44[_0x72c3('0x74')],'erlangCallToSecond':_0x3a4b44[_0x72c3('0x75')],'erlangAbandonmentRate':_0x3a4b44[_0x72c3('0x76')],'erlangBusyFactor':_0x3a4b44[_0x72c3('0x77')],'startPredictive':_0x3a4b44[_0x72c3('0x78')],'startProgressive':_0x3a4b44[_0x72c3('0x29')]};if(_0x3a4b44[_0x72c3('0x79')]){_0x3804f9[_0x72c3('0x79')]={'id':_0x3a4b44[_0x72c3('0x79')]['id'],'name':_0x3a4b44['Trunk'][_0x72c3('0x40')],'active':_0x3a4b44['Trunk'][_0x72c3('0x7a')],'callerid':_0x3a4b44['Trunk']['callerid']};}if(_0x3a4b44[_0x72c3('0x44')]){_0x3804f9[_0x72c3('0x44')]={'id':_0x3a4b44[_0x72c3('0x44')]['id'],'name':_0x3a4b44[_0x72c3('0x44')][_0x72c3('0x40')]};}var _0x5b9521=md5(JSON['stringify'](_0x3804f9));if(_0x3a4b44[_0x72c3('0x5')]!==_0x5b9521){_0x3a4b44[_0x72c3('0x5')]=_0x5b9521;emit(util['format'](_0x72c3('0x7b'),_0x3804f9[_0x72c3('0x40')]),_0x72c3('0x7c'),_0x3804f9);}}}function emitCampaignSummary(_0x2d4570){if(_0x2d4570[_0x72c3('0x4e')]===_0x72c3('0x7d')){emit(util[_0x72c3('0x7e')](_0x72c3('0x7f'),_0x2d4570[_0x72c3('0x40')]),_0x72c3('0x80'),_0x2d4570);}}function checkGetDataPredictive(_0x214d00){if(isNotNull(_0x214d00)&&!_[_0x72c3('0x81')](_0x214d00)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x72c3('0x82')](_0x72c3('0x83'),_0x214d00[_0x72c3('0x72')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x84'),_0x214d00[_0x72c3('0x6a')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x85'),_0x214d00[_0x72c3('0x86')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x87'),_0x214d00[_0x72c3('0x6c')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x88'),_0x214d00[_0x72c3('0x89')]);loggerPredictive['info'](_0x72c3('0x8a'),_0x214d00[_0x72c3('0x6b')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8b'));if(_0x214d00['predictiveIntervalTotalCalls']>0x0){if(!_[_0x72c3('0x8c')](_0x214d00[_0x72c3('0x6b')])&&_0x214d00[_0x72c3('0x6b')]>0x0){return!![];}loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8d'));if(!_[_0x72c3('0x8c')](_0x214d00[_0x72c3('0x89')])&&_0x214d00[_0x72c3('0x89')]>0x0){return!![];}loggerPredictive['info'](_0x72c3('0x8e'));}else{loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8f'));}}else{loggerPredictive[_0x72c3('0x82')](_0x72c3('0x90'));}return![];}function mergeDataErlangB(_0x39ce81){return function(_0x44f50a){loggerPredictive[_0x72c3('0x82')](_0x72c3('0x91'));loggerPredictive[_0x72c3('0x82')](_0x72c3('0x92'),_0x44f50a[_0x72c3('0x74')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44f50a[_0x72c3('0x75')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44f50a[_0x72c3('0x76')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x93'),_0x44f50a[_0x72c3('0x77')]);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x94'),_0x44f50a['erlangAbandonmentRate']);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8b'));_['merge'](_0x39ce81,_0x44f50a);};}function getDiff(_0x190160){var _0x2cbafd=moment()['milliseconds'](0x0);var _0x5a1897=moment(_0x190160)['milliseconds'](0x0);return _0x2cbafd['diff'](_0x5a1897,_0x72c3('0x4c'));}function ifInterval(_0xef4881,_0xc2c706){if(_[_0x72c3('0x8c')](_0xc2c706)){return![];}return getDiff(_0xc2c706)<_0xef4881*0x3c;}function freeVariablesPredictive(_0x5ed259){if(isNotNull(_0x5ed259)){if(!_[_0x72c3('0x8c')](_0x5ed259[_0x72c3('0x29')])){_0x5ed259[_0x72c3('0x29')]=undefined;loggerPredictive[_0x72c3('0x82')](_0x5ed259[_0x72c3('0x40')],_0x72c3('0x95'));}if(!_[_0x72c3('0x8c')](_0x5ed259[_0x72c3('0x78')])){_0x5ed259[_0x72c3('0x78')]=undefined;loggerPredictive[_0x72c3('0x82')](_0x5ed259[_0x72c3('0x40')],_0x72c3('0x96'));}if(!_[_0x72c3('0x8c')](_0x5ed259[_0x72c3('0x97')])){clearInterval(_0x5ed259[_0x72c3('0x97')]);_0x5ed259[_0x72c3('0x97')]=undefined;loggerPredictive[_0x72c3('0x82')](_0x5ed259[_0x72c3('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x3831a5,_0x1c8962){if(_0x1c8962===0x0){return 0x0;}var _0x5729f3=0x1;for(var _0x1e3cbe=0x1;_0x1e3cbe<=_0x1c8962;_0x1e3cbe+=0x1){_0x5729f3=0x1+_0x5729f3*_0x1e3cbe/_0x3831a5;}return 0x1/_0x5729f3;}function isVoiceQueueOutbound(_0xef868c){return _0xef868c===_0x72c3('0x4f');}function isNotPreview(_0x223095){return _0x223095!==_0x72c3('0x98');}function isCampaignIvr(_0x27bd9f){return _0x27bd9f===_0x72c3('0x7d');}function getCallerId(_0x440156,_0x34b711,_0x1769bd){if(!_[_0x72c3('0x8c')](_0x1769bd)&&typeof _0x1769bd===_0x72c3('0x99')&&!_[_0x72c3('0x81')](_0x1769bd)){if(!_[_0x72c3('0x8c')](_0x34b711)&&typeof _0x34b711===_0x72c3('0x99')&&!_[_0x72c3('0x81')](_0x34b711)){return util[_0x72c3('0x7e')]('\x22%s\x22\x20<%s>',_0x34b711,_0x1769bd);}return util[_0x72c3('0x7e')]('\x22%s\x22\x20<%s>',_0x1769bd,_0x1769bd);}if(!_[_0x72c3('0x8c')](_0x440156)&&typeof _0x440156===_0x72c3('0x99')&&!_[_0x72c3('0x81')](_0x440156)){return _0x440156;}return _0x72c3('0x9a');}function loggerCatchQueueSummary(_0x34f65a,_0x59b2d1){return function(_0x44fa42){freeVariablesPredictive(_0x59b2d1);emitVoiceQueueSummary(_0x59b2d1);emitCampaignSummary(_0x59b2d1);loggerSyncQueueSummary[_0x72c3('0x9b')](_0x34f65a,util[_0x72c3('0x9c')](_0x44fa42,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x213ab6,_0xa196df){return function(_0xec1db8){loggerPredictive[_0x72c3('0x9b')](_0xa196df[_0x72c3('0x40')],_0x213ab6);loggerPredictive['error'](_0xec1db8[_0x72c3('0x9d')]);freeVariablesPredictive(_0xa196df);};}function loggerCatch(_0x3a01cd){return function(_0x32e78e){logger['error'](_0x3a01cd,util[_0x72c3('0x9c')](_0x32e78e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xd9f6a2){return _0xd9f6a2&&!_['isUndefined'](_0xd9f6a2)&&_0xd9f6a2['length']>0x0;}function decremetOriginate(_0x4d71de){if(!_[_0x72c3('0x8c')](_0x4d71de)&&_0x4d71de!==null){if(typeof _0x4d71de[_0x72c3('0x73')]!==_0x72c3('0x9e')){if(_0x4d71de[_0x72c3('0x73')]>0x0){_0x4d71de['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x72c3('0x9b')](_0x72c3('0x9f'));}}function checkContactLowerLimitOriginate(_0x11ac65,_0x113077,_0x54031f){if(_0x113077>_0x54031f){for(var _0x4e697c=0x0;_0x4e697c<_0x113077-_0x54031f;_0x4e697c+=0x1){decremetOriginate(_0x11ac65);}}}function loggerGetContactDialer(_0x83faf9,_0x118625,_0x22c96d){return function(_0x306f77){checkContactLowerLimitOriginate(_0x118625,_0x22c96d,0x0);logger['error'](_0x83faf9,util[_0x72c3('0x9c')](_0x306f77,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5906b3){return function(_0x26350c){if(isNotNull(_0x26350c)&&isNotNull(_0x26350c[0x0])){if(_0x26350c[0x0][_0x72c3('0xa0')]>0x0){_0x5906b3[_0x72c3('0x3e')]=_0x72c3('0xa1');logger[_0x72c3('0x82')](_0x72c3('0xa2')+_0x5906b3[_0x72c3('0x40')],_0x26350c[0x0]['contactsRescheduled'],'contacts');}else{_0x5906b3[_0x72c3('0x3e')]=_0x72c3('0xa3');logger['info']('[getContactDialer2][Empty]'+_0x5906b3['name']);}}};}function notSendMessagesQueue(_0x4eba5c){if(_0x4eba5c['sendMessageOneNotActive']){freeVariablesPredictive(_0x4eba5c);if(_0x4eba5c['originated']===0x0&&_0x4eba5c[_0x72c3('0x56')]===0x0&&_0x4eba5c[_0x72c3('0x5a')]===0x0&&(_0x4eba5c['pTalking']||0x0)===0x0){_0x4eba5c[_0x72c3('0xa4')]=![];_0x4eba5c['available']=0x0;_0x4eba5c[_0x72c3('0x3e')]=_0x72c3('0x42');loggerSyncQueueSummary[_0x72c3('0x9b')](_0x72c3('0xa5'),_0x4eba5c[_0x72c3('0x40')],'is\x20not\x20active');}else{_0x4eba5c[_0x72c3('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x72c3('0x9b')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4eba5c[_0x72c3('0x40')],_0x72c3('0xa6'));}emitVoiceQueueSummary(_0x4eba5c);}}function notSendMessagesCampaign(_0x2754b7){if(_0x2754b7[_0x72c3('0xa4')]){if(_0x2754b7[_0x72c3('0x73')]===0x0){_0x2754b7[_0x72c3('0xa4')]=![];_0x2754b7[_0x72c3('0x3e')]=_0x72c3('0x42');loggerSyncQueueSummary['error'](_0x72c3('0xa7'),_0x2754b7['name'],_0x72c3('0xa8'));}else{_0x2754b7[_0x72c3('0x3e')]=_0x72c3('0xa9');loggerSyncQueueSummary[_0x72c3('0x9b')](_0x72c3('0xa7'),_0x2754b7[_0x72c3('0x40')],_0x72c3('0xa6'));}emitCampaignSummary(_0x2754b7);}}function createObjHistory(_0x336b39,_0x16e18e,_0x2cf1c1,_0x4bbcd5,_0x54f03d){_0x336b39['message']=_0x2cf1c1;var _0x2f29be=new Action(_0x336b39,_0x16e18e);var _0x42cf1f=new History(_0x2f29be);_0x42cf1f['state']=_0x4bbcd5;_0x42cf1f[_0x72c3('0xaa')]=_0x54f03d;_0x42cf1f['endtime']=_0x2f29be[_0x72c3('0xab')];return _0x42cf1f;}Dialer[_0x72c3('0x1c')][_0x72c3('0x3b')]=function(){var _0x5b1260=this;setInterval(function(){_0x5b1260['clearZombieChannels'](_0x5b1260['uniqueId'],_0x72c3('0xac'));_0x5b1260[_0x72c3('0xad')](_0x5b1260[_0x72c3('0x25')],_0x72c3('0xae'));},0x32c8);};Dialer['prototype'][_0x72c3('0xad')]=function(_0x494f24,_0x252240){var _0x45a373=this;for(var _0x44ab32 in _0x494f24){if(typeof _0x494f24[_0x44ab32]!==_0x72c3('0x9e')){this[_0x72c3('0x20')][_0x72c3('0x1d')](function(){if(!_[_0x72c3('0xaf')](_0x494f24[_0x44ab32])){return ami['Action']({'action':_0x72c3('0xb0'),'channel':_0x494f24[_0x44ab32][_0x72c3('0xb1')]})[_0x72c3('0xb2')](function(_0x1e4268){if(_0x1e4268['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x494f24[_0x44ab32]&&_0x494f24[_0x44ab32]['type']!=='ivr'){_0x45a373[_0x72c3('0xb3')](_0x45a373[_0x72c3('0x21')][_0x494f24[_0x44ab32][_0x72c3('0xb4')]]);logger[_0x72c3('0x9b')](_0x72c3('0xb5'),_0x252240,_0x44ab32,_0x494f24[_0x44ab32][_0x72c3('0xb4')]);delete _0x494f24[_0x44ab32];}if(_0x494f24[_0x44ab32]&&_0x494f24[_0x44ab32]['type']==='ivr'){_0x45a373[_0x72c3('0xb3')](_0x45a373[_0x72c3('0x22')][_0x494f24[_0x44ab32][_0x72c3('0xb4')]]);logger['error'](_0x72c3('0xb6'),_0x252240,_0x44ab32,_0x494f24[_0x44ab32]['queue']);delete _0x494f24[_0x44ab32];}},0x2328);}});}});}}};Dialer[_0x72c3('0x1c')][_0x72c3('0xb7')]=function(_0x24ddda){return BPromise[_0x72c3('0xb8')]()['then'](cmHopper['countReScheduled'](_0x24ddda))[_0x72c3('0xb2')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x72c3('0x1c')][_0x72c3('0xb9')]=function(_0x500617){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](cmHopperBlack[_0x72c3('0xb9')](_0x500617))['catch'](loggerCatch(_0x72c3('0xbb')));};Dialer[_0x72c3('0x1c')][_0x72c3('0xbc')]=function(_0x389d21){return BPromise['resolve']()['then'](cmHopperBlack[_0x72c3('0xbc')](_0x389d21))[_0x72c3('0xb2')](loggerCatch(_0x72c3('0xbd')));};Dialer[_0x72c3('0x1c')][_0x72c3('0xbe')]=function(_0x1b2ccc){return BPromise['resolve']()['then'](cmHopperHistory[_0x72c3('0xbf')](_0x1b2ccc))[_0x72c3('0xb2')](loggerCatch(_0x72c3('0xc0')));};Dialer['prototype'][_0x72c3('0xc1')]=function(_0x920733){return BPromise[_0x72c3('0xb8')]()['then'](cmHopper[_0x72c3('0xc1')](_0x920733))[_0x72c3('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x72c3('0xc2')]=function(_0x496237,_0x51d181,_0x573790){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](cmHopper[_0x72c3('0xc2')](_0x496237,_0x51d181,_0x573790))[_0x72c3('0xb2')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x72c3('0x1c')][_0x72c3('0xc3')]=function(_0xbbc241,_0x751e9,_0x1e13c5,_0x1e09c7,_0x555837){return BPromise['resolve']()[_0x72c3('0xba')](cmHopper[_0x72c3('0xc3')](_0xbbc241,_0x751e9,_0x1e13c5,_0x1e09c7))[_0x72c3('0xb2')](function(_0xdec50a){_0x555837[_0x72c3('0xc4')]-=_0x1e13c5;_0x555837['temp']=_0x555837[_0x72c3('0xc4')]>0x0?_0x555837['temp']:0x0;loggerCatch(_0x72c3('0xc5'))(_0xdec50a);});};Dialer[_0x72c3('0x1c')][_0x72c3('0xc6')]=function(_0x4b7f54,_0x561cb3,_0x85a936,_0x454ea1){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](cmHopper[_0x72c3('0xc6')](_0x4b7f54,_0x561cb3,_0x85a936))[_0x72c3('0xb2')](function(_0x174495){_0x454ea1['temp']-=_0x561cb3;_0x454ea1[_0x72c3('0xc4')]=_0x454ea1['temp']>0x0?_0x454ea1[_0x72c3('0xc4')]:0x0;loggerCatch(_0x72c3('0xc7'))(_0x174495);});};Dialer['prototype'][_0x72c3('0xc8')]=function(_0xd7fc67){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](voiceQueueRt[_0x72c3('0xc8')](_0xd7fc67))[_0x72c3('0xb2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x72c3('0x1c')][_0x72c3('0xc9')]=function(_0x47a299){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](cmHopper[_0x72c3('0xc9')](_0x47a299))[_0x72c3('0xb2')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x72c3('0x1c')]['createHistory']=function(_0x11ecd8){return BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](cmHopperHistory[_0x72c3('0xca')](_0x11ecd8))[_0x72c3('0xb2')](loggerCatch(_0x72c3('0xcb')));};Dialer['prototype'][_0x72c3('0xb3')]=function(_0x5eef32){if(!_[_0x72c3('0x8c')](_0x5eef32)&&_0x5eef32!==null){if(typeof _0x5eef32[_0x72c3('0x73')]!==_0x72c3('0x9e')){if(_0x5eef32[_0x72c3('0x73')]>0x0){_0x5eef32[_0x72c3('0x73')]-=0x1;}else{logger[_0x72c3('0x9b')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x72c3('0x9b')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x72c3('0x1c')][_0x72c3('0xcc')]=function(_0x470dc2,_0x51a0de){var _0x13d3d0=this;return function(_0x74d355){_0x13d3d0[_0x72c3('0xb3')](_0x51a0de);logger['error'](_0x470dc2,util[_0x72c3('0x9c')](_0x74d355,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x72c3('0xcd')]=function(_0x34676d,_0xfc8511,_0x5309b1){var _0x1d60e9={'state':0x19,'statedesc':_0x72c3('0xce')};this[_0x72c3('0xb3')](_0xfc8511);this[_0x72c3('0xcf')](_['merge'](_0x1d60e9,_[_0x72c3('0xd0')](_0x5309b1,[_0x72c3('0xd1'),'ListId',_0x72c3('0xd2'),'VoiceQueueId','CampaignId'])),'[emptyContact][createHistory]',_0x72c3('0xd3'));logger[_0x72c3('0x9b')](_0x34676d);};Dialer[_0x72c3('0x1c')][_0x72c3('0xd4')]=function(_0x42f7f5){return _0x42f7f5==='Success';};Dialer[_0x72c3('0x1c')][_0x72c3('0xd5')]=function(_0x582d66){return!_['isUndefined'](_0x582d66)&&_0x582d66&&!_['isUndefined'](_0x582d66['name'])&&!_['isUndefined'](_0x582d66['active'])&&_0x582d66[_0x72c3('0x7a')]&&(this['trunks'][util[_0x72c3('0x7e')](_0x72c3('0xd6'),_0x582d66[_0x72c3('0x40')])][_0x72c3('0xb0')]===_0x72c3('0xd7')||this['trunks'][util[_0x72c3('0x7e')](_0x72c3('0xd6'),_0x582d66[_0x72c3('0x40')])][_0x72c3('0xb0')]===_0x72c3('0xd8'));};Dialer[_0x72c3('0x1c')][_0x72c3('0xcf')]=function(_0x49f39d,_0x589fe7,_0x4068a4){this[_0x72c3('0xca')](_0x49f39d)[_0x72c3('0xb2')](loggerCatch(_0x589fe7));this['moveContactManagedDialer'](_0x49f39d)['catch'](loggerCatch(_0x4068a4));};Dialer['prototype'][_0x72c3('0x37')]=function(_0x38f952){var _0x3d39a6=this['uniqueId'][_0x38f952[_0x72c3('0xd9')]];var _0x5eb213;if(!_[_0x72c3('0xaf')](_0x38f952)&&!_[_0x72c3('0xaf')](_0x38f952[_0x72c3('0xda')])&&!_[_0x72c3('0xaf')](_0x38f952[_0x72c3('0xda')][_0x72c3('0xdb')])&&_0x38f952[_0x72c3('0xdc')]===_0x72c3('0xdd')&&_0x3d39a6){if(_0x3d39a6[_0x72c3('0x4e')]!==_0x72c3('0x7d')&&this[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]]['dialAMDActive']&&_0x38f952[_0x72c3('0xde')]===_0x72c3('0xdf')){delete this[_0x72c3('0x27')][_0x38f952[_0x72c3('0xd9')]];this['updateOriginated'](this[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]]);this[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]][_0x72c3('0x60')]+=0x1;this['voiceQueues'][_0x3d39a6[_0x72c3('0xb4')]][_0x72c3('0x5f')]+=0x1;_0x5eb213=new Hangup(_0x3d39a6,_0x38f952);_0x5eb213[_0x72c3('0xe0')]=0x12;_0x5eb213[_0x72c3('0xaa')]=_0x72c3('0xe1');_0x5eb213[_0x72c3('0xe2')]='AMD';ami[_0x72c3('0x4d')](_0x72c3('0xe3'),ut['buildObj'](_0x5eb213,'amd'));this['saveInDb'](_0x5eb213,_0x72c3('0xe4'),_0x72c3('0xe5'));}if(_0x3d39a6[_0x72c3('0x4e')]!==_0x72c3('0x7d')&&this[_0x72c3('0x21')][_0x3d39a6['queue']][_0x72c3('0xe6')]&&_0x38f952[_0x72c3('0xde')]===_0x72c3('0xe7')){var _0x1509b4=this;return new BPromise(function(_0x1353ed,_0xab9c78){delete _0x1509b4[_0x72c3('0x27')][_0x38f952[_0x72c3('0xd9')]];_0x1509b4[_0x72c3('0xb3')](_0x1509b4[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]]);_0x1509b4[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x1509b4[_0x72c3('0x21')][_0x3d39a6[_0x72c3('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2205c4=_0x1509b4[_0x72c3('0x21')][_0x3d39a6['queue']];var _0x5c98e4=new Hangup(_0x3d39a6,_0x38f952);_0x5c98e4[_0x72c3('0xe0')]=0x13;_0x5c98e4['statedesc']=_0x72c3('0xe8');_0x5c98e4['membername']=_0x72c3('0xe9');_0x5c98e4[_0x72c3('0xea')]+=0x1;_0x5c98e4['countglobal']+=0x1;_0x5c98e4[_0x72c3('0xeb')]=!![];ami[_0x72c3('0x4d')](_0x72c3('0xe3'),ut[_0x72c3('0xec')](_0x5c98e4,_0x72c3('0xeb')));_0x1509b4[_0x72c3('0xca')](_0x5c98e4)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0xed')));if(_0x5c98e4[_0x72c3('0xee')]+_0x5c98e4['countcongestionretry']+_0x5c98e4[_0x72c3('0xef')]+_0x5c98e4[_0x72c3('0xf0')]+_0x5c98e4[_0x72c3('0xf1')]+_0x5c98e4[_0x72c3('0xf2')]+_0x5c98e4[_0x72c3('0xea')]+_0x5c98e4[_0x72c3('0xf3')]>=_0x2205c4[_0x72c3('0xf4')]){_0x1509b4[_0x72c3('0xf5')](_0x5c98e4,_0x1353ed,_0xab9c78,_0x72c3('0xf6'));}else{if(_0x5c98e4[_0x72c3('0xea')]>=_0x2205c4[_0x72c3('0xf7')]){_0x1509b4[_0x72c3('0xf8')](_0x5c98e4,_0x1353ed,_0xab9c78,_0x72c3('0xf9'));}else{_0x1509b4[_0x72c3('0xc1')]({'active':![],'countmachineretry':_0x5c98e4[_0x72c3('0xea')],'scheduledat':moment()[_0x72c3('0xfa')](_0x2205c4[_0x72c3('0xfb')],_0x72c3('0xfc'))['format'](_0x72c3('0xfd')),'ContactId':_0x5c98e4[_0x72c3('0xd1')],'ListId':_0x5c98e4[_0x72c3('0xfe')],'VoiceQueueId':_0x5c98e4['VoiceQueueId']||undefined,'CampaignId':_0x5c98e4[_0x72c3('0xff')]||undefined})['catch'](loggerCatch(_0x72c3('0x100')));_0x1353ed({'reschedule':0x1});}}});}if(_0x3d39a6[_0x72c3('0x4e')]===_0x72c3('0x7d')&&this[_0x72c3('0x22')][_0x3d39a6['queue']][_0x72c3('0xe6')]&&_0x38f952[_0x72c3('0xde')]===_0x72c3('0xdf')){delete this[_0x72c3('0x27')][_0x38f952[_0x72c3('0xd9')]];this[_0x72c3('0xb3')](this['campaigns'][_0x3d39a6['queue']]);_0x5eb213=new Hangup(_0x3d39a6,_0x38f952);_0x5eb213['state']=0x12;_0x5eb213[_0x72c3('0xaa')]=_0x72c3('0xe1');_0x5eb213[_0x72c3('0xe2')]='AMD';ami['emit'](_0x72c3('0xe3'),ut[_0x72c3('0xec')](_0x5eb213,_0x72c3('0xeb')));this[_0x72c3('0xcf')](_0x5eb213,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x3d39a6[_0x72c3('0x4e')]===_0x72c3('0x7d')&&this['campaigns'][_0x3d39a6['queue']]['dialAMDActive']&&_0x38f952[_0x72c3('0xde')]===_0x72c3('0xe7')){var _0x1509b4=this;return new BPromise(function(_0x59b96d,_0x611de6){delete _0x1509b4[_0x72c3('0x27')][_0x38f952['uniqueid']];_0x1509b4[_0x72c3('0xb3')](_0x1509b4[_0x72c3('0x22')][_0x3d39a6[_0x72c3('0xb4')]]);_0x1509b4['campaigns'][_0x3d39a6[_0x72c3('0xb4')]][_0x72c3('0x60')]+=0x1;_0x1509b4[_0x72c3('0x22')][_0x3d39a6[_0x72c3('0xb4')]][_0x72c3('0x5f')]+=0x1;var _0x25a75f=_0x1509b4[_0x72c3('0x22')][_0x3d39a6[_0x72c3('0xb4')]];var _0x59010b=new Hangup(_0x3d39a6,_0x38f952);_0x59010b[_0x72c3('0xe0')]=0x13;_0x59010b[_0x72c3('0xaa')]='Machine';_0x59010b['membername']='AMD';_0x59010b[_0x72c3('0xea')]+=0x1;_0x59010b[_0x72c3('0x101')]+=0x1;_0x59010b[_0x72c3('0xeb')]=!![];ami[_0x72c3('0x4d')](_0x72c3('0xe3'),ut[_0x72c3('0xec')](_0x59010b,_0x72c3('0xeb')));_0x1509b4[_0x72c3('0xca')](_0x59010b)['catch'](loggerCatch(_0x72c3('0xed')));if(_0x59010b[_0x72c3('0xee')]+_0x59010b[_0x72c3('0x102')]+_0x59010b[_0x72c3('0xef')]+_0x59010b[_0x72c3('0xf0')]+_0x59010b[_0x72c3('0xf1')]+_0x59010b['countabandonedretry']+_0x59010b[_0x72c3('0xea')]+_0x59010b['countagentrejectretry']>=_0x25a75f[_0x72c3('0xf4')]){_0x1509b4[_0x72c3('0xf5')](_0x59010b,_0x59b96d,_0x611de6,_0x72c3('0xf6'));}else{if(_0x59010b[_0x72c3('0xea')]>=_0x25a75f[_0x72c3('0xf7')]){_0x1509b4[_0x72c3('0xf8')](_0x59010b,_0x59b96d,_0x611de6,_0x72c3('0xf9'));}else{_0x1509b4[_0x72c3('0xc1')]({'active':![],'countmachineretry':_0x59010b[_0x72c3('0xea')],'scheduledat':moment()['add'](_0x25a75f['dialMachineRetryFrequency'],_0x72c3('0xfc'))[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x59010b[_0x72c3('0xd1')],'ListId':_0x59010b[_0x72c3('0xfe')],'VoiceQueueId':_0x59010b[_0x72c3('0x103')]||undefined,'CampaignId':_0x59010b[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x100')));_0x59b96d({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x72c3('0x104')]=function(_0xe5691c){var _0x5e910f=this[_0x72c3('0x27')][_0xe5691c[_0x72c3('0xd9')]];var _0xb1437a=this;var _0x526d9b;if(_0x5e910f&&_0x5e910f[_0x72c3('0x4e')]===_0x72c3('0x7d')){delete this[_0x72c3('0x27')][_0xe5691c['uniqueid']];this[_0x72c3('0xb3')](this[_0x72c3('0x22')][_0x5e910f[_0x72c3('0xb4')]]);this[_0x72c3('0x22')][_0x5e910f['queue']]['ivrAnswerCallsDay']+=0x1;_0x526d9b=new Hangup(_0x5e910f,_0xe5691c);this[_0x72c3('0xca')](_0x526d9b)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x105')));this[_0x72c3('0xc9')](_0x526d9b)[_0x72c3('0xb2')](loggerCatch('[syncHangupIvr]'));}if(_0x5e910f&&_0x5e910f[_0x72c3('0x4e')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x5e910f[_0x72c3('0xb4')]][_0x72c3('0x106')])){delete this['uniqueId'][_0xe5691c['uniqueid']];this[_0x72c3('0xb3')](this[_0x72c3('0x21')][_0x5e910f[_0x72c3('0xb4')]]);this['voiceQueues'][_0x5e910f['queue']][_0x72c3('0x60')]+=0x1;this[_0x72c3('0x21')][_0x5e910f['queue']][_0x72c3('0x5f')]+=0x1;_0x526d9b=new Hangup(_0x5e910f,_0xe5691c);_0x526d9b[_0x72c3('0xe0')]=0x10;_0x526d9b[_0x72c3('0xaa')]=_0x72c3('0x107');_0x526d9b[_0x72c3('0xe2')]=_0x72c3('0x108');this['createHistory'](_0x526d9b)['catch'](loggerCatch(_0x72c3('0x105')));this[_0x72c3('0xc9')](_0x526d9b)['catch'](loggerCatch(_0x72c3('0x109')));}if(_0x5e910f&&_0x5e910f['type']!=='ivr'&&!isNotNull(this[_0x72c3('0x21')][_0x5e910f[_0x72c3('0xb4')]][_0x72c3('0x106')])){delete this[_0x72c3('0x27')][_0xe5691c[_0x72c3('0xd9')]];this[_0x72c3('0xb3')](this[_0x72c3('0x21')][_0x5e910f[_0x72c3('0xb4')]]);this['voiceQueues'][_0x5e910f[_0x72c3('0xb4')]][_0x72c3('0x69')]+=0x1;_0x526d9b=new Hangup(_0x5e910f,_0xe5691c);_0x526d9b[_0x72c3('0xe0')]=0xc;_0x526d9b[_0x72c3('0xaa')]=_0xe5691c['cause-txt'];_0x526d9b['membername']=_0x72c3('0x10a');this['createHistory'](_0x526d9b)['catch'](loggerCatch(_0x72c3('0x105')));this[_0x72c3('0xc9')](_0x526d9b)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x109')));}};Dialer[_0x72c3('0x1c')]['syncAgentComplete']=function(_0x5b856c){var _0x2b9d56=this[_0x72c3('0x27')][_0x5b856c['uniqueid']];var _0x1a8774=this;if(this[_0x72c3('0x21')][_0x5b856c[_0x72c3('0xb4')]]){if(_0x2b9d56&&_0x2b9d56['type']!==_0x72c3('0x7d')){delete this[_0x72c3('0x27')][_0x5b856c['uniqueid']];this[_0x72c3('0x21')][_0x5b856c[_0x72c3('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x51adc3=new AgentComplete(_0x2b9d56,_0x5b856c);if(_0x5b856c[_0x72c3('0x10b')]===_0x72c3('0x10c')){_0x51adc3[_0x72c3('0x10d')]=this['voiceQueues'][_0x5b856c[_0x72c3('0xb4')]]['dialQueueProject2']&&this[_0x72c3('0x21')][_0x5b856c['queue']][_0x72c3('0x10e')]?moment()[_0x72c3('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x72c3('0xca')](_0x51adc3)['catch'](loggerCatch(_0x72c3('0x10f')));this[_0x72c3('0xc9')](_0x51adc3)['catch'](loggerCatch(_0x72c3('0x110')));}}};Dialer[_0x72c3('0x1c')][_0x72c3('0x111')]=function(_0x115fa1){if(this['voiceQueues'][_0x115fa1[_0x72c3('0xb4')]]){if(this[_0x72c3('0x27')][_0x115fa1[_0x72c3('0xd9')]]&&this['uniqueId'][_0x115fa1['uniqueid']][_0x72c3('0x4e')]!=='ivr'){this[_0x72c3('0xb3')](this['voiceQueues'][_0x115fa1[_0x72c3('0xb4')]]);this[_0x72c3('0x27')][_0x115fa1['uniqueid']]['answertime']=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));}}};Dialer[_0x72c3('0x1c')][_0x72c3('0x112')]=function(_0x2ee3de){this[_0x72c3('0xca')](_0x2ee3de)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x72c3('0xc9')](_0x2ee3de)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x113')));};Dialer[_0x72c3('0x1c')]['syncQueueCallerAbandon']=function(_0x2d4bf8){var _0x513ffe=this[_0x72c3('0x27')][_0x2d4bf8[_0x72c3('0xd9')]];var _0x59ea5d=this;if(this[_0x72c3('0x21')][_0x2d4bf8['queue']]){if(_0x513ffe&&_0x513ffe[_0x72c3('0x4e')]!=='ivr'){delete this['uniqueId'][_0x2d4bf8[_0x72c3('0xd9')]];this[_0x72c3('0xb3')](this['voiceQueues'][_0x2d4bf8[_0x72c3('0xb4')]]);_0x513ffe['droptime']=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));var _0x48e799=new QueueCallerAbandon(_0x513ffe,_0x2d4bf8);if(getSeconds(_0x513ffe[_0x72c3('0x114')],_0x513ffe[_0x72c3('0x115')])>=_0x513ffe[_0x72c3('0x116')]){this[_0x72c3('0x21')][_0x2d4bf8['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x72c3('0x21')][_0x2d4bf8['queue']][_0x72c3('0x6e')]+=0x1;_0x48e799[_0x72c3('0xe0')]=0xa;_0x48e799[_0x72c3('0xaa')]=_0x72c3('0x117');_0x48e799[_0x72c3('0x118')]=_0x72c3('0x119');_0x48e799[_0x72c3('0x10d')]=this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]][_0x72c3('0x11a')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x48e799['countdropretry']+=0x1;_0x48e799[_0x72c3('0x101')]+=0x1;if(_0x48e799[_0x72c3('0xf1')]>=this[_0x72c3('0x21')][_0x2d4bf8['queue']][_0x72c3('0x11b')]){this[_0x72c3('0x112')](_0x48e799);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x48e799[_0x72c3('0xf1')],'scheduledat':moment()['add'](this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]][_0x72c3('0x11c')],'minutes')[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x513ffe[_0x72c3('0xd1')],'ListId':_0x513ffe[_0x72c3('0xfe')],'VoiceQueueId':_0x513ffe[_0x72c3('0x103')]||undefined,'CampaignId':_0x513ffe[_0x72c3('0xff')]||undefined})['catch'](loggerCatch(_0x72c3('0x11d')));var _0x781a12=new History(_0x48e799);_0x781a12[_0x72c3('0xe0')]=0xa;_0x781a12['statedesc']=_0x72c3('0x117');_0x781a12[_0x72c3('0xab')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));_0x781a12[_0x72c3('0x11e')]=_0x781a12[_0x72c3('0xab')];_0x781a12[_0x72c3('0x11f')]=_0x48e799['calleridname'];_0x781a12[_0x72c3('0x120')]=_0x48e799[_0x72c3('0x120')];this[_0x72c3('0xca')](_0x781a12)[_0x72c3('0xb2')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]][_0x72c3('0x6c')]+=0x1;this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]][_0x72c3('0x63')]+=0x1;_0x48e799[_0x72c3('0xe0')]=0xb;_0x48e799[_0x72c3('0xaa')]=_0x72c3('0x121');_0x48e799['dropreason']='CALLEREXIT';_0x48e799[_0x72c3('0xf2')]+=0x1;_0x48e799['countglobal']+=0x1;if(_0x48e799['countabandonedretry']>=this[_0x72c3('0x21')][_0x2d4bf8[_0x72c3('0xb4')]][_0x72c3('0x122')]){this[_0x72c3('0x112')](_0x48e799);}else{this[_0x72c3('0xc1')]({'active':![],'countabandonedretry':_0x48e799['countabandonedretry'],'scheduledat':moment()[_0x72c3('0xfa')](this[_0x72c3('0x21')][_0x2d4bf8['queue']][_0x72c3('0x123')],_0x72c3('0xfc'))['format'](_0x72c3('0xfd')),'ContactId':_0x513ffe['ContactId'],'ListId':_0x513ffe[_0x72c3('0xfe')],'VoiceQueueId':_0x513ffe[_0x72c3('0x103')]||undefined,'CampaignId':_0x513ffe[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x124')));var _0x781a12=new History(_0x48e799);_0x781a12[_0x72c3('0xe0')]=0xb;_0x781a12['statedesc']='Abandoned';_0x781a12[_0x72c3('0xab')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));_0x781a12['endtime']=_0x781a12[_0x72c3('0xab')];_0x781a12[_0x72c3('0x11f')]=_0x48e799[_0x72c3('0x11f')];_0x781a12[_0x72c3('0x120')]=_0x48e799['calleridnum'];this[_0x72c3('0xca')](_0x781a12)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x125')));}}}}};Dialer[_0x72c3('0x1c')][_0x72c3('0x35')]=function(_0x3c997b){if(this[_0x72c3('0x25')][_0x3c997b[_0x72c3('0xd9')]]){this[_0x72c3('0x25')][_0x3c997b['uniqueid']][_0x72c3('0xb1')]=_0x3c997b[_0x72c3('0xb1')];}if(this[_0x72c3('0x27')][_0x3c997b[_0x72c3('0xd9')]]){this[_0x72c3('0x27')][_0x3c997b[_0x72c3('0xd9')]][_0x72c3('0xb1')]=_0x3c997b['channel'];}};Dialer[_0x72c3('0x1c')]['syncQueueMember']=function(_0x261a8d){if(strategy[this[_0x72c3('0x21')][this[_0x72c3('0x25')][_0x261a8d['actionid']][_0x72c3('0xb4')]][_0x72c3('0x126')]]==='roundrobin'){if(this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]]&&_[_0x72c3('0xaf')](this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0x128')])&&_0x261a8d[_0x72c3('0xb0')]==='1'&&_0x261a8d[_0x72c3('0x129')]==='0'){if(this['agents'][_0x261a8d[_0x72c3('0x12a')]]){if(!this[_0x72c3('0x23')][_0x261a8d[_0x72c3('0x12a')]][_0x72c3('0x128')]){this['agents'][_0x261a8d[_0x72c3('0x12a')]][_0x72c3('0x128')]=!![];this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0x128')]=!![];this[_0x72c3('0x25')][_0x261a8d['actionid']][_0x72c3('0x12a')]=_0x261a8d[_0x72c3('0x12a')];}}}}else if((strategy[this['voiceQueues'][this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0xb4')]][_0x72c3('0x126')]]||'rrmemory')===_0x72c3('0x12b')){if(this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]]){if(this[_0x72c3('0x23')][_0x261a8d[_0x72c3('0x12a')]]){this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0x12a')]=_0x261a8d[_0x72c3('0x12a')];if(_['isNil'](this[_0x72c3('0x2a')][this['actions'][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0xb4')]])){this['queueBooked'][this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0xb4')]]=[];}this[_0x72c3('0x2a')][this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]][_0x72c3('0xb4')]]['push'](_['merge'](_[_0x72c3('0xd0')](this[_0x72c3('0x25')][_0x261a8d[_0x72c3('0x127')]],[_0x72c3('0x12c'),'stateinterface']),{'status':_0x261a8d[_0x72c3('0xb0')],'paused':_0x261a8d[_0x72c3('0x129')]}));}}}};function unlockQueueStatus(_0x27c619,_0x34f8de){setTimeout(function(){if(_[_0x72c3('0x8c')](_0x27c619['queueStatusComplete'])){loggerBooked[_0x72c3('0x9b')]('[unlockQueueStatus][undefined]',_0x34f8de);}_0x27c619[_0x72c3('0x12d')]=!![];loggerBooked[_0x72c3('0x82')](_0x72c3('0x12e'),_0x34f8de,JSON[_0x72c3('0x12f')](_[_0x72c3('0xd0')](_0x27c619,[_0x72c3('0x40'),_0x72c3('0x12d')])));},0x1f3);}Dialer[_0x72c3('0x1c')]['syncQueueStatusComplete']=function(_0x4a5e96){var _0xcde326=this;var _0x19ebad=_0xcde326['voiceQueues'][_0xcde326[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]];if(strategy[this[_0x72c3('0x21')][this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]]['strategy']]===_0x72c3('0x130')){if(this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]]&&this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0x12a')]){this[_0x72c3('0x98')][_0x72c3('0x131')](this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]]['idHopper'],this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0x12a')])[_0x72c3('0xb2')](function(_0x3386ef){logger[_0x72c3('0x9b')](_0x72c3('0x132'),util[_0x72c3('0x9c')](_0x3386ef,{'showHidden':![],'depth':null}));})[_0x72c3('0x1f')](function(){_0xcde326['updateOriginated'](_0xcde326['voiceQueues'][_0xcde326[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]]['queue']]);_0xcde326[_0x72c3('0x23')][_0xcde326[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0x12a')]][_0x72c3('0x128')]=![];delete _0xcde326['actions'][_0x4a5e96[_0x72c3('0x127')]];unlockQueueStatus(_0x19ebad);});}else{this['updateOriginated'](this[_0x72c3('0x21')][this['actions'][_0x4a5e96['actionid']][_0x72c3('0xb4')]]);this[_0x72c3('0xc1')]({'active':![],'ContactId':this[_0x72c3('0x25')][_0x4a5e96['actionid']][_0x72c3('0xd1')],'ListId':this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xfe')],'VoiceQueueId':this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x133')));delete this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]];unlockQueueStatus(_0x19ebad);}}else if((strategy[this['voiceQueues'][this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]][_0x72c3('0x126')]]||_0x72c3('0x12b'))===_0x72c3('0x12b')){var _0x10bdea;if(this[_0x72c3('0x25')][_0x4a5e96['actionid']]&&!_[_0x72c3('0x81')](this['queueBooked'][this['actions'][_0x4a5e96['actionid']][_0x72c3('0xb4')]])){if(this['queueBookedRR'][_0xcde326['actions'][_0x4a5e96['actionid']][_0x72c3('0xb4')]]){this[_0x72c3('0x2b')][_0xcde326['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]]=this['queueBookedRR'][this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]]?this[_0x72c3('0x2b')][this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]]:this['queueBooked'][this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]]?this[_0x72c3('0x2a')][this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]][_0x72c3('0x134')]||0x0:0x0;}this['queueBooked'][this[_0x72c3('0x25')][_0x4a5e96[_0x72c3('0x127')]]['queue']][_0x72c3('0x134')]=this['queueBookedRR'][this['actions'][_0x4a5e96[_0x72c3('0x127')]][_0x72c3('0xb4')]];for(var _0x15604e=0x0;_0x15604e=0x0;})[_0x72c3('0xb2')](myreject(_0xc7adcd)));}}else{_0x14c5c3[_0x72c3('0x149')](ami[_0x72c3('0x14f')]({'action':_0x72c3('0x150'),'command':util['format'](_0x72c3('0x14a'),_0x1b6ccd,!_[_0x72c3('0x8c')](config['timezones'][_0x2d257a])?_0x2d257a:'')})[_0x72c3('0xba')](function(_0x17e4f1){return _0x17e4f1[_0x72c3('0x14c')][_0x72c3('0x14d')](_0x72c3('0x14e'))>=0x0;})[_0x72c3('0xb2')](myreject(_0xc7adcd)));}BPromise[_0x72c3('0x151')](_0x14c5c3)[_0x72c3('0xba')](function(_0x42f82d){var _0x534456=_['some'](_0x42f82d);if(_0x534456){return _0x90d508(_0x534456);}else{_0x905c6['message']=_0x2d3374?_0x72c3('0x152'):_0x72c3('0x153');return _0xc7adcd(msgResponse(_0x72c3('0x154'),'Failure','Global:\x20'+_0x2d3374+'\x20'+_0x30ab87+_0x72c3('0x155')+util[_0x72c3('0x9c')](_0x1b6ccd,{'showHidden':![],'depth':null})+_0x72c3('0x156')+_0x2d257a));}})[_0x72c3('0xb2')](function(_0x32cb55){return _0xc7adcd(msgResponse('ifTime','Failure',JSON[_0x72c3('0x12f')](_0x32cb55)));});});};Dialer[_0x72c3('0x1c')][_0x72c3('0x157')]=function(_0x28dbcb){var _0x23f99c=this;return function(){switch(_0x28dbcb[_0x72c3('0x158')]){case _0x72c3('0x159'):freeVariablesPredictive(_0x28dbcb);_0x23f99c[_0x72c3('0x15a')](_0x28dbcb,0x1);break;case _0x72c3('0x15b'):freeVariablesPredictive(_0x28dbcb);_0x23f99c[_0x72c3('0x15a')](_0x28dbcb,_0x28dbcb[_0x72c3('0x15c')]);break;case'predictive':_0x23f99c['predictive'](_0x28dbcb);break;case _0x72c3('0xa'):freeVariablesPredictive(_0x28dbcb);_0x23f99c[_0x72c3('0x15a')](_0x28dbcb,0x1);break;default:freeVariablesPredictive(_0x28dbcb);logger[_0x72c3('0x9b')]('Queue',_0x28dbcb[_0x72c3('0x40')],_0x72c3('0x15d'));}};};Dialer[_0x72c3('0x1c')][_0x72c3('0x15e')]=function(_0x4b4dba){return BPromise['resolve']()[_0x72c3('0xba')](cmHopper[_0x72c3('0x15f')](_0x4b4dba['id'],previewRecallmeReminderInterval))[_0x72c3('0xba')](function(_0x2673b4){for(var _0x165f99=0x0;_0x165f99<_0x2673b4[_0x72c3('0x135')];_0x165f99++){var _0x1145c7=_0x2673b4[_0x165f99][_0x72c3('0x160')]['name'];if(_0x1145c7)io['to'](util[_0x72c3('0x7e')]('user:%s',_0x1145c7))[_0x72c3('0x4d')](_0x72c3('0x161'),{'hopper':_0x2673b4[_0x165f99]});}})[_0x72c3('0xb2')](function(_0x6e1ba5){});};Dialer['prototype'][_0x72c3('0x162')]=function(_0x5c1ada){var _0x371d89=this;return function(){_0x371d89[_0x72c3('0x163')](_0x5c1ada);};};Dialer[_0x72c3('0x1c')][_0x72c3('0xc')]=function(_0x5656de){var _0x203550=this;if(isNotPreview(_0x5656de[_0x72c3('0x158')])){if(isVoiceQueueOutbound(_0x5656de['type'])&&isActive(_0x5656de[_0x72c3('0x164')])){_0x5656de['sendMessageOneNotActive']=!![];BPromise[_0x72c3('0xb8')]()[_0x72c3('0xba')](checkIsLoggedIn(_0x5656de,_0x5656de[_0x72c3('0x51')]))[_0x72c3('0xba')](checkIsActive(_0x5656de,_0x5656de[_0x72c3('0x164')]))[_0x72c3('0xba')](checkInterval(_0x5656de))[_0x72c3('0xba')](_0x203550[_0x72c3('0x13d')](_0x5656de))['then'](_0x203550[_0x72c3('0x165')](_0x5656de[_0x72c3('0x166')],_0x5656de[_0x72c3('0x167')],_0x5656de[_0x72c3('0x40')],_0x5656de))[_0x72c3('0xba')](_0x203550[_0x72c3('0x141')](_0x5656de[_0x72c3('0x44')],_0x5656de[_0x72c3('0x167')],_0x5656de[_0x72c3('0x40')],_0x5656de))[_0x72c3('0xba')](_0x203550[_0x72c3('0x157')](_0x5656de))[_0x72c3('0xb2')](loggerCatchQueueSummary(_0x72c3('0x168'),_0x5656de));}else{notSendMessagesQueue(_0x5656de);}}else{freeVariablesPredictive(_0x5656de);if(_0x5656de[_0x72c3('0x169')]){_0x203550[_0x72c3('0x15e')](_0x5656de);}}};Dialer[_0x72c3('0x1c')][_0x72c3('0x13c')]=function(){var _0x42c8fd=this;var _0x1b7372;for(var _0x42c691 in this[_0x72c3('0x22')]){if(typeof this['campaigns'][_0x42c691]!==_0x72c3('0x9e')){_0x1b7372=this[_0x72c3('0x22')][_0x42c691];if(isCampaignIvr(_0x1b7372['type'])&&isActive(_0x1b7372['active'])){_0x1b7372['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x72c3('0xba')](checkIsActive(_0x1b7372,_0x1b7372['active']))['then'](checkInterval(_0x1b7372))['then'](_0x42c8fd[_0x72c3('0x13d')](_0x1b7372))[_0x72c3('0xba')](_0x42c8fd[_0x72c3('0x165')](_0x1b7372[_0x72c3('0x166')],_0x1b7372[_0x72c3('0x167')],_0x1b7372[_0x72c3('0x40')],_0x1b7372))[_0x72c3('0xba')](_0x42c8fd[_0x72c3('0x141')](_0x1b7372[_0x72c3('0x44')],_0x1b7372['dialTimezone'],_0x1b7372[_0x72c3('0x40')],_0x1b7372))[_0x72c3('0xba')](_0x42c8fd[_0x72c3('0x162')](_0x1b7372))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x1b7372));}else{notSendMessagesCampaign(_0x1b7372);}}}};function getCallerIdRandom(_0x4fd8ef,_0x377060){var _0x418e46;var _0xb6e669;var _0x1fe2ce;if(_0x377060<=0x0){_0x377060=0x1;}_0x418e46=new RegExp(_0x72c3('0x16a')+_0x377060+'}$');_0xb6e669=Math[_0x72c3('0x16b')](0xa,_0x377060-0x1);_0x1fe2ce=Math['pow'](0xa,_0x377060)-0x1;return util[_0x72c3('0x7e')]('%s',_[_0x72c3('0x16c')](_0x4fd8ef,_0x418e46,_['random'](_0xb6e669,_0x1fe2ce)));}function extractCalleridName(_0x2dc064){var _0x9349a=_0x2dc064['match'](/"(.*?)"/);return _0x9349a?_0x9349a[0x1]:_0x2dc064;}function extractCalleridNumber(_0x4f1bf9){var _0x599030=_0x4f1bf9[_0x72c3('0x16d')](/<(.*?)>/);return _0x599030?_0x599030[0x1]:_0x4f1bf9;}Dialer[_0x72c3('0x1c')][_0x72c3('0x16e')]=function(_0x342c37,_0x4534d3){var _0x5d8526=this;var _0x5a7992=uuid['v4']();this[_0x72c3('0x25')][_0x5a7992]=new Action(_0x342c37,_0x4534d3,_0x5a7992);return new BPromise(function(_0x44bc85,_0x54b3a1){if(_[_0x72c3('0x8c')](_0x342c37)&&typeof _0x342c37!==_0x72c3('0x16f')){return _0x54b3a1(msgResponse(_0x72c3('0x170'),_0x72c3('0x142'),_0x72c3('0x171')));}if(_[_0x72c3('0x8c')](_0x4534d3[_0x72c3('0x172')][_0x72c3('0x173')])||_0x4534d3[_0x72c3('0x172')][_0x72c3('0x173')]===null){return _0x54b3a1(msgResponse(_0x72c3('0x170'),_0x72c3('0x142'),'contact\x20is\x20undefine'));}var _0xd9c74e={'XMD-CALLERID':_0x5d8526[_0x72c3('0x25')][_0x5a7992]['getCaller'](),'XMD-AGI':_0x342c37['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x342c37[_0x72c3('0x106')]):_0x72c3('0x174'),'XMD-AGIAFTER':_0x342c37[_0x72c3('0x11a')]?util[_0x72c3('0x7e')](_0x72c3('0x175'),ipAgi,_0x342c37['dialQueueProject2']):_0x72c3('0x174'),'XMD-QUEUE':_0x342c37['type']==='outbound'?util[_0x72c3('0x7e')](_0x72c3('0x176'),_0x342c37[_0x72c3('0x40')],_0x342c37[_0x72c3('0x177')]||'',_0x342c37[_0x72c3('0x10e')]?'c':'',_0x342c37[_0x72c3('0x116')]||0x3):'NONE','XMD-CONTACTID':_0x4534d3['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5d8526[_0x72c3('0x25')][_0x5a7992][_0x72c3('0x178')](),'XMD-AMD':_0x342c37[_0x72c3('0xe6')]?'ACTIVE':_0x72c3('0x174'),'XMD-DESTINATION':_0x72c3('0xdd')};if(_0x342c37[_0x72c3('0xe6')]){_0xd9c74e[_0x72c3('0x179')]=_0x342c37[_0x72c3('0x17a')]||0x9c4;_0xd9c74e[_0x72c3('0x17b')]=_0x342c37[_0x72c3('0x17c')]||0x5dc;_0xd9c74e[_0x72c3('0x17d')]=_0x342c37['dialAMDAfterGreetingSilence']||0x320;_0xd9c74e[_0x72c3('0x17e')]=_0x342c37[_0x72c3('0x17f')]||0x1388;_0xd9c74e[_0x72c3('0x180')]=_0x342c37[_0x72c3('0x181')]||0x64;_0xd9c74e[_0x72c3('0x182')]=_0x342c37[_0x72c3('0x183')]||0x32;_0xd9c74e['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x342c37[_0x72c3('0x184')]||0x3;_0xd9c74e[_0x72c3('0x185')]=_0x342c37['dialAMDSilenceThreshold']||0x100;_0xd9c74e[_0x72c3('0x186')]=_0x342c37[_0x72c3('0x187')]||0x1388;}if(_0x342c37[_0x72c3('0x4e')]==='outbound'){_0xd9c74e[_0x72c3('0x188')]=_0x4534d3[_0x72c3('0x103')];}else{_0xd9c74e['XMD-CAMPAIGNID']=_0x4534d3['CampaignId'];}for(var _0x54d536 in _0x4534d3['Contact']){if(typeof _0x4534d3[_0x72c3('0x172')][_0x54d536]!==_0x72c3('0x9e')){if(isNotNull(_0x4534d3[_0x72c3('0x172')][_0x54d536])&&_0x54d536!=='id'&&_0x54d536!==_0x72c3('0x189')&&_0x54d536!=='createdAt'&&_0x54d536!==_0x72c3('0x18a')){_0xd9c74e[util['format']('%s%s','XMD-',_[_0x72c3('0x18b')](_0x54d536))]=_0x4534d3[_0x72c3('0x172')][_0x54d536];}}}var _0x1465a9=_0x5d8526[_0x72c3('0xd5')](_0x342c37['Trunk'])?getCallerId(_0x342c37[_0x72c3('0x79')]['callerid'],_0x342c37[_0x72c3('0x5b')],_0x342c37[_0x72c3('0x18c')]>0x0?getCallerIdRandom(_0x342c37['dialOriginateCallerIdNumber'],_0x342c37[_0x72c3('0x18c')]):_0x342c37[_0x72c3('0x5c')]):getCallerId(_[_0x72c3('0xaf')](_0x342c37[_0x72c3('0x18d')])?_0x342c37[_0x72c3('0x79')][_0x72c3('0x18e')]:_0x342c37[_0x72c3('0x18d')][_0x72c3('0x18e')],_0x342c37['dialOriginateCallerIdName'],_0x342c37[_0x72c3('0x18c')]>0x0?getCallerIdRandom(_0x342c37[_0x72c3('0x5c')],_0x342c37[_0x72c3('0x18c')]):_0x342c37[_0x72c3('0x5c')]);if(_0x1465a9){_0xd9c74e[_0x72c3('0x18f')]=_0x5d8526[_0x72c3('0x25')][_0x5a7992][_0x72c3('0x190')]=extractCalleridName(_0x1465a9);_0xd9c74e[_0x72c3('0x191')]=_0x5d8526[_0x72c3('0x25')][_0x5a7992][_0x72c3('0x192')]=extractCalleridNumber(_0x1465a9);}return ami[_0x72c3('0x14f')]({'actionid':_0x5a7992,'action':_0x72c3('0x170'),'channel':_0x5d8526['isTrunkReachable'](_0x342c37[_0x72c3('0x79')])?util[_0x72c3('0x7e')](_0x72c3('0x193'),_0x342c37[_0x72c3('0x79')]['name'],isNotNull(_0x342c37[_0x72c3('0x5e')])?_0x342c37[_0x72c3('0x5e')]['trim']()||'':'',_0x342c37[_0x72c3('0x194')]>0x0?_0x4534d3[_0x72c3('0x172')]['phone']['substring'](_0x342c37[_0x72c3('0x194')]):_0x4534d3['Contact'][_0x72c3('0x173')]):util[_0x72c3('0x7e')](_0x72c3('0x193'),_[_0x72c3('0xaf')](_0x342c37['TrunkBackup'])?_0x342c37[_0x72c3('0x79')][_0x72c3('0x40')]:_0x342c37[_0x72c3('0x18d')]['name'],isNotNull(_0x342c37[_0x72c3('0x5e')])?_0x342c37[_0x72c3('0x5e')][_0x72c3('0x195')]()||'':'',_0x342c37['dialCutDigit']>0x0?_0x4534d3[_0x72c3('0x172')][_0x72c3('0x173')][_0x72c3('0x196')](_0x342c37[_0x72c3('0x194')]):_0x4534d3[_0x72c3('0x172')][_0x72c3('0x173')]),'callerid':_0x1465a9,'Exten':_0x72c3('0xdd'),'Context':_0x72c3('0x197'),'Priority':'1','variable':_0xd9c74e,'timeout':(_0x342c37[_0x72c3('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5a7992})[_0x72c3('0xba')](function(_0x4e48f1){return _0x44bc85(_0x4e48f1);})['catch'](function(_0x3a8eb0){_0x342c37[_0x72c3('0x67')]+=0x1;var _0x3b709b=new History(_0x5d8526[_0x72c3('0x25')][_0x5a7992]);logger['error'](util[_0x72c3('0x7e')](_0x72c3('0x198'),JSON[_0x72c3('0x12f')](_0x3a8eb0)));_0x3b709b['state']=0xe;_0x3b709b['statedesc']=_0x72c3('0x199');_0x3b709b[_0x72c3('0xab')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));_0x3b709b['endtime']=_0x3b709b[_0x72c3('0xab')];_0x5d8526[_0x72c3('0xca')](_0x3b709b)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x19a')));_0x5d8526[_0x72c3('0xc9')](_0x3b709b)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x19a')))[_0x72c3('0x1f')](function(){delete _0x5d8526[_0x72c3('0x25')][_0x5a7992];return _0x54b3a1(msgResponse(_0x72c3('0x170'),'Error',_0x72c3('0x19b')));});});});};Dialer[_0x72c3('0x1c')][_0x72c3('0x30')]=function(_0x5d1340){var _0x75a2a3=this[_0x72c3('0x25')][_0x5d1340['actionid']];if(_0x75a2a3){delete this[_0x72c3('0x25')][_0x5d1340['actionid']];_0x75a2a3[_0x72c3('0x115')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));var _0x1d420a=_0x75a2a3[_0x72c3('0x4e')]===_0x72c3('0x7d')?this[_0x72c3('0x22')][_0x75a2a3['queue']]:this['voiceQueues'][_0x75a2a3[_0x72c3('0x19c')]()];if(!this[_0x72c3('0xd4')](_0x5d1340['response'])){this['updateOriginated'](_0x1d420a);return this[_0x72c3('0x19d')](_0x75a2a3,_0x1d420a,_0x5d1340)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x19e')));}this[_0x72c3('0x27')][_0x5d1340['uniqueid']]=_0x75a2a3;}};Dialer[_0x72c3('0x1c')][_0x72c3('0x19f')]=function(_0x1312e9,_0x11c066,_0x45b27a){var _0x373751=new History(_0x11c066);if(_0x373751[_0x72c3('0xee')]+_0x373751[_0x72c3('0x102')]+_0x373751['countnoanswerretry']+_0x373751[_0x72c3('0xf0')]+_0x373751[_0x72c3('0xf1')]+_0x373751[_0x72c3('0xf2')]+_0x373751[_0x72c3('0xea')]+_0x373751['countagentrejectretry']>=_0x45b27a[_0x72c3('0xf4')]-0x1){return!![];}switch(_0x1312e9){case 0x3:if(_0x373751[_0x72c3('0xef')]>=_0x45b27a[_0x72c3('0x1a0')]-0x1){return!![];}this[_0x72c3('0xc1')]({'active':![],'countnoanswerretry':_0x373751[_0x72c3('0xef')]+=0x1,'scheduledat':moment()['add'](_0x45b27a['dialNoAnswerRetryFrequency'],_0x72c3('0xfc'))[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1a1')));break;case 0x5:if(_0x373751['countbusyretry']>=_0x45b27a[_0x72c3('0x1a2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x373751[_0x72c3('0xee')]+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a[_0x72c3('0x1a3')],'minutes')['format'](_0x72c3('0xfd')),'ContactId':_0x373751['ContactId'],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751[_0x72c3('0xff')]||undefined})['catch'](loggerCatch(_0x72c3('0x1a4')));break;case 0x8:if(_0x373751[_0x72c3('0x102')]>=_0x45b27a[_0x72c3('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x373751[_0x72c3('0x102')]+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a[_0x72c3('0x1a6')],_0x72c3('0xfc'))[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751[_0x72c3('0xff')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x373751['countnosuchnumberretry']>=_0x45b27a[_0x72c3('0x1a7')]-0x1){return!![];}else{this[_0x72c3('0xc1')]({'active':![],'countnosuchnumberretry':_0x373751[_0x72c3('0xf0')]+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a[_0x72c3('0x1a8')],_0x72c3('0xfc'))[_0x72c3('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751['CampaignId']||undefined})[_0x72c3('0xb2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x373751[_0x72c3('0xf1')]>=_0x45b27a['dialDropMaxRetry']-0x1){return!![];}this[_0x72c3('0xc1')]({'active':![],'countdropretry':_0x373751[_0x72c3('0xf1')]+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a['dialDropRetryFrequency'],'minutes')[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751['CampaignId']||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x11d')));break;case 0xb:if(_0x373751[_0x72c3('0xf2')]>=_0x45b27a[_0x72c3('0x122')]-0x1){return!![];}this[_0x72c3('0xc1')]({'active':![],'countabandonedretry':_0x373751['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x45b27a[_0x72c3('0x123')],'minutes')['format'](_0x72c3('0xfd')),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751['VoiceQueueId']||undefined,'CampaignId':_0x373751['CampaignId']||undefined})['catch'](loggerCatch(_0x72c3('0x124')));break;case 0x13:if(_0x373751[_0x72c3('0xea')]>=_0x45b27a['dialMachineMaxRetry']-0x1){return!![];}this[_0x72c3('0xc1')]({'active':![],'countmachineretry':_0x373751[_0x72c3('0xea')]+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a['dialMachineRetryFrequency'],_0x72c3('0xfc'))[_0x72c3('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x373751['ContactId'],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751['VoiceQueueId']||undefined,'CampaignId':_0x373751[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x373751[_0x72c3('0xf3')]>=_0x45b27a['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x72c3('0xc1')]({'active':![],'countagentrejectretry':_0x373751['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x72c3('0xfa')](_0x45b27a['dialAgentRejectRetryFrequency'],'minutes')[_0x72c3('0x7e')](_0x72c3('0xfd')),'ContactId':_0x373751[_0x72c3('0xd1')],'ListId':_0x373751[_0x72c3('0xfe')],'VoiceQueueId':_0x373751[_0x72c3('0x103')]||undefined,'CampaignId':_0x373751[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x72c3('0x1c')][_0x72c3('0x19d')]=function(_0x435ebc,_0x1abe68,_0x19711a){var _0x33eb71=this;var _0x35a140=new History(_0x435ebc);return new BPromise(function(_0x10d231,_0x27649a){if(_['isUndefined'](_0x1abe68)&&typeof _0x1abe68!==_0x72c3('0x16f')){return _0x27649a(msgResponse('[callProgressDetecting]',_0x72c3('0x142'),_0x72c3('0x1a9')));}if(_[_0x72c3('0x8c')](_0x19711a)&&typeof _0x19711a!=='object'){return _0x27649a(msgResponse('[callProgressDetecting]',_0x72c3('0x142'),'evt\x20is\x20undefine'));}switch(_0x19711a[_0x72c3('0x10b')]){case'0':_0x1abe68[_0x72c3('0x66')]+=0x1;_0x35a140['state']=0x0;_0x35a140[_0x72c3('0xaa')]=_0x72c3('0x1aa');_0x35a140[_0x72c3('0xf0')]+=0x1;_0x35a140[_0x72c3('0x101')]+=0x1;ami[_0x72c3('0x4d')]('custom:agentnosuchnumber',ut[_0x72c3('0xec')](_0x435ebc,_0x72c3('0x1ab')));_0x33eb71[_0x72c3('0xca')](_0x35a140)[_0x72c3('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x33eb71['checkRetriveMax'](0x0,_0x435ebc,_0x1abe68)){if(_0x35a140[_0x72c3('0xf0')]>=_0x1abe68['dialNoSuchNumberMaxRetry']){_0x33eb71[_0x72c3('0xf8')](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1ac'));}else{_0x33eb71[_0x72c3('0xf5')](_0x35a140,_0x10d231,_0x27649a,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1abe68[_0x72c3('0x65')]+=0x1;_0x35a140['state']=0x3;_0x35a140[_0x72c3('0xaa')]=_0x72c3('0x1ad');_0x35a140[_0x72c3('0xef')]+=0x1;_0x35a140[_0x72c3('0x101')]+=0x1;ami['emit'](_0x72c3('0x1ae'),ut[_0x72c3('0xec')](_0x435ebc,_0x72c3('0x1af')));_0x33eb71['createHistory'](_0x35a140)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1b0')));if(_0x33eb71['checkRetriveMax'](0x3,_0x435ebc,_0x1abe68)){if(_0x35a140['countnoanswerretry']>=_0x1abe68['dialNoAnswerMaxRetry']){_0x33eb71['createStateFinal'](_0x35a140,_0x10d231,_0x27649a,'reason\x203\x20ringing\x20no\x20answer');}else{_0x33eb71[_0x72c3('0xf5')](_0x35a140,_0x10d231,_0x27649a,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1abe68['outboundBusyCallsDay']+=0x1;_0x35a140[_0x72c3('0xe0')]=0x5;_0x35a140['statedesc']=_0x72c3('0x1b1');_0x35a140[_0x72c3('0xee')]+=0x1;_0x35a140[_0x72c3('0x101')]+=0x1;ami[_0x72c3('0x4d')](_0x72c3('0x1b2'),ut['buildObj'](_0x435ebc,_0x72c3('0x1b3')));_0x33eb71[_0x72c3('0xca')](_0x35a140)['catch'](loggerCatch(_0x72c3('0x1b4')));if(_0x33eb71['checkRetriveMax'](0x5,_0x435ebc,_0x1abe68)){if(_0x35a140[_0x72c3('0xee')]>=_0x1abe68['dialBusyMaxRetry']){_0x33eb71[_0x72c3('0xf8')](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1b5'));}else{_0x33eb71[_0x72c3('0xf5')](_0x35a140,_0x10d231,_0x27649a,'reason\x205\x20busy');}}break;case'8':_0x1abe68[_0x72c3('0x61')]+=0x1;_0x35a140[_0x72c3('0xe0')]=0x8;_0x35a140[_0x72c3('0xaa')]=_0x72c3('0x1b6');_0x35a140[_0x72c3('0x102')]+=0x1;_0x35a140[_0x72c3('0x101')]+=0x1;ami['emit'](_0x72c3('0x1b7'),ut[_0x72c3('0xec')](_0x435ebc,_0x72c3('0x1b8')));_0x33eb71[_0x72c3('0xca')](_0x35a140)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x33eb71[_0x72c3('0x19f')](0x8,_0x435ebc,_0x1abe68)){if(_0x35a140[_0x72c3('0x102')]>=_0x1abe68['dialCongestionMaxRetry']){_0x33eb71['createStateFinal'](_0x35a140,_0x10d231,_0x27649a,'reason\x208\x20congestion');}else{_0x33eb71['stateGlobal'](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1b9'));}}break;case'11':_0x1abe68[_0x72c3('0x1ba')]+=0x1;_0x35a140[_0x72c3('0xe0')]=0xb;_0x35a140[_0x72c3('0xaa')]=_0x72c3('0x121');_0x35a140[_0x72c3('0xf2')]+=0x1;_0x35a140['countglobal']+=0x1;_0x33eb71[_0x72c3('0xca')](_0x35a140)[_0x72c3('0xb2')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x33eb71[_0x72c3('0x19f')](0xb,_0x435ebc,_0x1abe68)){if(_0x35a140[_0x72c3('0xf2')]>=_0x1abe68['dialAbandonedMaxRetry']){_0x33eb71['createStateFinal'](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1bb'));}else{_0x33eb71[_0x72c3('0xf5')](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1bb'));}}break;case'20':_0x1abe68[_0x72c3('0x1bc')]+=0x1;_0x35a140[_0x72c3('0xe0')]=0x14;_0x35a140[_0x72c3('0xaa')]='AgentReject';_0x35a140[_0x72c3('0xf3')]+=0x1;_0x35a140[_0x72c3('0x101')]+=0x1;ami[_0x72c3('0x4d')]('custom:agentreject',ut['buildObj'](_0x435ebc,'agentreject'));_0x33eb71[_0x72c3('0xca')](_0x35a140)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1bd')));if(_0x33eb71['checkRetriveMax'](0x14,_0x435ebc,_0x1abe68)){if(_0x35a140[_0x72c3('0xf3')]>=_0x1abe68[_0x72c3('0x1be')]){_0x33eb71['createStateFinal'](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1bf'));}else{_0x33eb71['stateGlobal'](_0x35a140,_0x10d231,_0x27649a,_0x72c3('0x1bf'));}}break;default:_0x1abe68[_0x72c3('0x69')]+=0x1;_0x35a140[_0x72c3('0xe0')]=0xc;_0x35a140['statedesc']=_0x19711a[_0x72c3('0x10b')];_0x33eb71[_0x72c3('0xca')](_0x35a140)[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1c0')));if(_0x33eb71['checkRetriveMax'](_0x19711a[_0x72c3('0x10b')],_0x435ebc,_0x1abe68)){if(_0x35a140['countbusyretry']+_0x35a140['countcongestionretry']+_0x35a140['countnoanswerretry']+_0x35a140[_0x72c3('0xf0')]+_0x35a140[_0x72c3('0xf1')]+_0x35a140[_0x72c3('0xf2')]+_0x35a140['countmachineretry']+_0x35a140[_0x72c3('0xf3')]>=_0x1abe68['dialGlobalMaxRetry']){_0x33eb71['stateGlobal'](_0x35a140,_0x10d231,_0x27649a,_0x19711a['reason']);}else{_0x33eb71['createStateFinal'](_0x35a140,_0x10d231,_0x27649a,_0x19711a['reason']);}}}});};Dialer['prototype'][_0x72c3('0xf5')]=function(_0x401466,_0xfcb6d0,_0x54528a,_0x53be16){var _0x312bea=new Final(_0x401466);_0x312bea[_0x72c3('0xe0')]=0xf;_0x312bea[_0x72c3('0xaa')]=_0x72c3('0x1c1');this['createStateFinal'](_0x312bea,_0xfcb6d0,_0x54528a,_0x53be16);};Dialer['prototype'][_0x72c3('0xf8')]=function(_0x1da612,_0x252e4f,_0x279863,_0x7226bf){this[_0x72c3('0xc9')](_0x1da612)[_0x72c3('0xba')](function(){return _0x252e4f(msgResponse(_0x72c3('0x1c2'),_0x72c3('0x1c3'),_0x7226bf));})[_0x72c3('0xb2')](function(){return _0x279863(msgResponse('[moveContactManagedDialer][0]',_0x72c3('0x142'),_0x72c3('0x1c4')));});};Dialer[_0x72c3('0x1c')][_0x72c3('0xb')]=function(_0x9ef457){var _0xf2d16e=_0x9ef457[_0x72c3('0x1c5')]/0x64;var _0x512ebd=_0x9ef457['outboundDropCallsDayTimeout']/(_0x9ef457['outboundDropCallsDayTimeout']+_0x9ef457[_0x72c3('0x60')]);var _0x1fcfb6=Math['round'](_0x9ef457[_0x72c3('0x71')]*(_0x9ef457[_0x72c3('0x1c6')]/0x64));var _0x3e8555=Math[_0x72c3('0x1c7')](_0x9ef457[_0x72c3('0x71')]*(_0x9ef457[_0x72c3('0x1c8')]/0x64));var _0x338f5a=_0x9ef457[_0x72c3('0x1c9')]+_0x9ef457[_0x72c3('0x56')];var _0x4f8392=Math[_0x72c3('0x1ca')](_0x9ef457['erlangCalls']*_0x9ef457[_0x72c3('0x76')]*_0x9ef457[_0x72c3('0x6f')]*_0x9ef457[_0x72c3('0x70')]);if(_[_0x72c3('0x8c')](_0x9ef457[_0x72c3('0x29')])){if(!_[_0x72c3('0x8c')](_0x9ef457[_0x72c3('0x78')])){_0x9ef457['startPredictive']=undefined;loggerPredictive[_0x72c3('0x9b')](_0x72c3('0x1cb'),_0x72c3('0x1cc'));}if(!_[_0x72c3('0x8c')](_0x9ef457[_0x72c3('0x97')])){loggerPredictive[_0x72c3('0x9b')](_0x72c3('0x1cb'),_0x72c3('0x1cd'));clearInterval(_0x9ef457[_0x72c3('0x97')]);_0x9ef457[_0x72c3('0x97')]=undefined;}_0x9ef457[_0x72c3('0x29')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));loggerPredictive[_0x72c3('0x82')](_0x9ef457['name'],_0x72c3('0x1ce'),_0x9ef457[_0x72c3('0x29')]);this[_0x72c3('0x15a')](_0x9ef457,0x1);}else if(ifInterval(_0x9ef457[_0x72c3('0x1cf')],_0x9ef457[_0x72c3('0x29')])){this[_0x72c3('0x15a')](_0x9ef457,0x1);loggerPredictiveCalls['info'](_0x72c3('0x1d0'),_0x9ef457[_0x72c3('0x29')],_0x9ef457['name']);_0x9ef457[_0x72c3('0x74')]=0x0;_0x9ef457[_0x72c3('0x6e')]=0x0;}else if(_0xf2d16e<_0x512ebd&&_0x9ef457[_0x72c3('0x1d1')]===_0x72c3('0x1d2')){freeVariablesPredictive(_0x9ef457);loggerPredictive[_0x72c3('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x72c3('0x1d3'),_0x512ebd,_0x72c3('0x29'),_0x9ef457[_0x72c3('0x40')]);}else if(_0x4f8392<_0x9ef457[_0x72c3('0x6e')]&&_0x9ef457[_0x72c3('0x1d1')]===_0x72c3('0x1d2')){freeVariablesPredictive(_0x9ef457);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x1d4'),'Max\x20Drop\x20',_0x4f8392,'Drop\x20in\x20this\x20interval',_0x9ef457[_0x72c3('0x6e')],_0x72c3('0x29'),_0x9ef457[_0x72c3('0x40')]);}else if(!ifInterval(_0x9ef457[_0x72c3('0x1cf')],_0x9ef457[_0x72c3('0x29')])&&_['isUndefined'](_0x9ef457[_0x72c3('0x78')])&&!_[_0x72c3('0x8c')](_0x9ef457[_0x72c3('0x29')])){_0x9ef457[_0x72c3('0x78')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));loggerPredictive['info'](_0x9ef457['name'],_0x72c3('0x1d5'),_0x9ef457[_0x72c3('0x78')]);this[_0x72c3('0xbe')](_0x9ef457['dialPredictiveInterval'])['then'](this[_0x72c3('0x1d6')](_0x9ef457))[_0x72c3('0xba')](mergeDataErlangB(_0x9ef457))[_0x72c3('0xba')](this['startMethodPredictive'](_0x9ef457))[_0x72c3('0xb2')](loggerCatchPredictive(_0x72c3('0x1d7'),_0x9ef457));}else if(!ifInterval(_0x9ef457[_0x72c3('0x1cf')],_0x9ef457[_0x72c3('0x78')])){_0x9ef457[_0x72c3('0x6e')]=0x0;_0x9ef457[_0x72c3('0x78')]=moment()[_0x72c3('0x7e')](_0x72c3('0xfd'));loggerPredictive[_0x72c3('0x82')](_0x9ef457[_0x72c3('0x40')],_0x72c3('0x1d8'),_0x9ef457[_0x72c3('0x78')]);clearInterval(_0x9ef457[_0x72c3('0x97')]);_0x9ef457[_0x72c3('0x97')]=undefined;this[_0x72c3('0xbe')](_0x9ef457[_0x72c3('0x1cf')])[_0x72c3('0xba')](this['getDataPredictive'](_0x9ef457))['then'](mergeDataErlangB(_0x9ef457))[_0x72c3('0xba')](this[_0x72c3('0x1d9')](_0x9ef457))['catch'](loggerCatchPredictive(_0x72c3('0x1da'),_0x9ef457));}else if(_0x9ef457[_0x72c3('0x71')]&&_0x338f5a<_0x9ef457[_0x72c3('0x71')]-_0x3e8555){freeVariablesPredictive(_0x9ef457);loggerPredictive['info'](_0x9ef457['name'],_0x72c3('0x1db'),_0x338f5a,')\x20are\x20less\x20than\x20threshold\x20(',_0x9ef457['predictiveIntervalAvailable'],'-',_0x3e8555,'=',_0x9ef457['predictiveIntervalAvailable']-_0x3e8555,')');}else if(_0x9ef457['predictiveIntervalAvailable']&&_0x338f5a>_0x9ef457['predictiveIntervalAvailable']+_0x1fcfb6){freeVariablesPredictive(_0x9ef457);loggerPredictive[_0x72c3('0x82')](_0x9ef457['name'],_0x72c3('0x1db'),_0x338f5a,_0x72c3('0x1dc'),_0x9ef457[_0x72c3('0x71')],'+',_0x1fcfb6,'=',_0x9ef457[_0x72c3('0x71')]+_0x1fcfb6,')');}};Dialer[_0x72c3('0x1c')][_0x72c3('0x1d6')]=function(_0xd96590){var _0x24f6db=this;return function(_0x47fa01){return new BPromise(function(_0x1d76e5,_0x60faf6){_[_0x72c3('0x1dd')](_0xd96590,_0x47fa01[0x0]);if(checkGetDataPredictive(_0x47fa01[0x0])){var _0x48746c=_0xd96590['predictiveIntervalAvailable']=_0xd96590['talking']+_0xd96590[_0x72c3('0x1c9')];var _0x3a4593=_0xd96590[_0x72c3('0x1cf')]*0x3c;var _0x13219f=_0x47fa01[0x0][_0x72c3('0x6b')]+_0x47fa01[0x0][_0x72c3('0x89')];var _0x4ec249=(_0x47fa01[0x0][_0x72c3('0x6a')]+_0x47fa01[0x0][_0x72c3('0x86')]+_0x47fa01[0x0][_0x72c3('0x6c')])/_0x47fa01[0x0][_0x72c3('0x72')];_0xd96590[_0x72c3('0x6f')]=_0x4ec249>0x0?_0x4ec249:0x1;switch(_0xd96590[_0x72c3('0x1d1')]){case _0x72c3('0x1d2'):var _0xb7f789=_0xd96590[_0x72c3('0x1c5')]/0x64;return _0x24f6db[_0x72c3('0x1de')](_0x48746c,_0x3a4593,_0x13219f,_0x4ec249,_0xb7f789)[_0x72c3('0xba')](function(_0x35dd0c){return _0x1d76e5(_0x35dd0c);});case'agentBusyFactor':var _0x2a42a9=_0xd96590['dialPredictiveOptimizationPercentage']/0x64;return _0x24f6db[_0x72c3('0x1df')](_0x48746c,_0x3a4593,_0x13219f,_0x4ec249,_0x2a42a9)[_0x72c3('0xba')](function(_0xf3587f){return _0x1d76e5(_0xf3587f);});default:return _0x60faf6(msgResponse(_0x72c3('0x1e0'),_0x72c3('0x142'),'Unknown\x20Predictive'));}}else{return _0x60faf6(msgResponse(_0x72c3('0x1e0'),'Failure','check\x20failure'));}});};};Dialer[_0x72c3('0x1c')]['getDataPredictiveOld']=function(_0x5a5cd7){var _0x2888a1=this;return function(_0x5423ce){return new BPromise(function(_0x26b05e,_0x1c59d3){_['merge'](_0x5a5cd7,_0x5423ce[0x0]);if(checkGetDataPredictive(_0x5423ce[0x0])){loggerPredictive[_0x72c3('0x82')](JSON[_0x72c3('0x12f')](_0x5423ce[0x0]));if(_0x5a5cd7[_0x72c3('0x1d1')]===_0x72c3('0x1d2')){return _0x2888a1[_0x72c3('0xc8')](_0x5a5cd7['id'])[_0x72c3('0xba')](function(_0x169d3b){var _0x419800=_0x5a5cd7[_0x72c3('0x51')]-_0x169d3b[0x0][_0x72c3('0x1e1')];var _0x504af2=_0x5a5cd7[_0x72c3('0x1cf')]*0x3c;var _0x1cfca5=_0x5423ce[0x0]['predictiveIntervalAvgTalktime']+_0x5423ce[0x0][_0x72c3('0x89')];var _0x3b21d4=(_0x5423ce[0x0][_0x72c3('0x6a')]+_0x5423ce[0x0][_0x72c3('0x86')]+_0x5423ce[0x0][_0x72c3('0x6c')])/_0x5423ce[0x0][_0x72c3('0x72')];var _0x461ab7=_0x5a5cd7['dialPredictiveOptimizationPercentage']/0x64;_0x5a5cd7[_0x72c3('0x1e2')]=_0x169d3b[0x0][_0x72c3('0x1e1')]||0x0;_0x5a5cd7[_0x72c3('0x6f')]=_0x3b21d4>0x0?_0x3b21d4:0x1;return _0x2888a1[_0x72c3('0x1de')](_0x419800,_0x504af2,_0x1cfca5,_0x3b21d4,_0x461ab7);})['then'](function(_0x2cba83){return _0x26b05e(_0x2cba83);})[_0x72c3('0xb2')](function(_0x2e9e8d){return _0x1c59d3(msgResponse(_0x72c3('0x1e3'),_0x72c3('0x142'),JSON[_0x72c3('0x12f')](_0x2e9e8d)));});}if(_0x5a5cd7[_0x72c3('0x1d1')]==='agentBusyFactor'){return _0x2888a1[_0x72c3('0xc8')](_0x5a5cd7['id'])[_0x72c3('0xba')](function(_0x1bcb3b){var _0x35ea4a=_0x5a5cd7[_0x72c3('0x51')]-_0x1bcb3b[0x0][_0x72c3('0x1e1')];var _0x199094=_0x5a5cd7[_0x72c3('0x1cf')]*0x3c;var _0x34ced2=_0x5423ce[0x0]['predictiveIntervalAvgTalktime']+_0x5423ce[0x0]['predictiveIntervalAvgHoldtime'];var _0x4ab7fa=(_0x5423ce[0x0][_0x72c3('0x6a')]+_0x5423ce[0x0][_0x72c3('0x86')]+_0x5423ce[0x0][_0x72c3('0x6c')])/_0x5423ce[0x0]['predictiveIntervalTotalCalls'];var _0x3ad0bb=_0x5a5cd7[_0x72c3('0x1c5')]/0x64;_0x5a5cd7[_0x72c3('0x1e2')]=_0x1bcb3b[0x0][_0x72c3('0x1e1')]||0x0;_0x5a5cd7[_0x72c3('0x6f')]=_0x4ab7fa>0x0?_0x4ab7fa:0x1;return _0x2888a1[_0x72c3('0x1df')](_0x35ea4a,_0x199094,_0x34ced2,_0x4ab7fa,_0x3ad0bb);})['then'](function(_0x58005b){return _0x26b05e(_0x58005b);})['catch'](function(_0x43c5ee){return _0x1c59d3(msgResponse(_0x72c3('0x1e3'),'Failure',JSON[_0x72c3('0x12f')](_0x43c5ee)));});}}else{return _0x1c59d3(msgResponse(_0x72c3('0x1e0'),_0x72c3('0x142'),_0x72c3('0x1e4')));}});};};Dialer[_0x72c3('0x1c')]['startMethodPredictive']=function(_0x162a07){var _0x14a2c8=this;return function(){var _0x4d0d78=0x0;var _0x522fed=Math[_0x72c3('0x1ca')](_0x162a07[_0x72c3('0x75')]*0x3e8);if(_0x522fed>0x0){_0x522fed=_0x522fed<0x64?0x64:_0x522fed;loggerPredictive[_0x72c3('0x82')](_0x162a07['name'],_0x72c3('0x1e5'),_0x522fed,_0x72c3('0x4a'));_0x162a07['handlePredictive']=setInterval(function(){_0x14a2c8[_0x72c3('0x97')](_0x162a07);loggerPredictiveCalls[_0x72c3('0x82')]('[handlePredictive]',_0x4d0d78+=0x1);},_0x522fed);}else{loggerPredictive[_0x72c3('0x82')](_0x162a07[_0x72c3('0x40')],_0x72c3('0x1e6'));}};};Dialer['prototype'][_0x72c3('0x1e7')]=function(_0x571b74,_0x2a1718){var _0x18c460=this;return function(_0x747021){if(_[_0x72c3('0x81')](_0x747021)){if(_['isNil'](_0x2a1718[_0x72c3('0xd2')])||!_0x2a1718[_0x72c3('0x1e8')]){if(_0x571b74[_0x72c3('0x158')]===_0x72c3('0xa')){_0x571b74[_0x72c3('0x12d')]=_[_0x72c3('0x8c')](_0x571b74[_0x72c3('0x12d')])?!![]:_0x571b74[_0x72c3('0x12d')];var _0x5a5de7=uuid['v4']();_0x18c460[_0x72c3('0x25')][_0x5a5de7]=new Action(_0x571b74,_0x2a1718,_0x5a5de7);loggerBooked[_0x72c3('0x82')]('[booked][checkContactBlack]',_0x5a5de7,_0x72c3('0x1e9'),JSON[_0x72c3('0x12f')](_0x571b74[_0x72c3('0x12d')]),_0x72c3('0x1ea'),_0x571b74[_0x72c3('0x40')]);if(_0x571b74[_0x72c3('0x12d')]){_0x571b74['queueStatusComplete']=![];_0x18c460[_0x72c3('0x2a')][_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0xb4')]]=[];ami['Action']({'actionid':_0x5a5de7,'action':'queuestatus','queue':_0x571b74[_0x72c3('0x40')]})['catch'](function(){_0x18c460[_0x72c3('0xb3')](_0x571b74);_0x18c460[_0x72c3('0xc1')]({'active':![],'ContactId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0xd1')],'ListId':_0x18c460['actions'][_0x5a5de7][_0x72c3('0xfe')],'VoiceQueueId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0x103')]||undefined,'CampaignId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1eb')));delete _0x18c460[_0x72c3('0x25')][_0x5a5de7];});}else{loggerBooked[_0x72c3('0x82')](_0x72c3('0x1ec'),JSON[_0x72c3('0x12f')](_0x571b74[_0x72c3('0x12d')]),_0x72c3('0x1ea'),_0x571b74[_0x72c3('0x40')]);_0x18c460['updateOriginated'](_0x571b74);_0x18c460[_0x72c3('0xc1')]({'active':![],'ContactId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0xd1')],'ListId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0xfe')],'VoiceQueueId':_0x18c460[_0x72c3('0x25')][_0x5a5de7][_0x72c3('0x103')]||undefined,'CampaignId':_0x18c460[_0x72c3('0x25')][_0x5a5de7]['CampaignId']||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1eb')));delete _0x18c460[_0x72c3('0x25')][_0x5a5de7];}}else{return _0x18c460[_0x72c3('0x16e')](_0x571b74,_0x2a1718);}}else{if(getDiff(_0x2a1718[_0x72c3('0x1ed')])<_0x571b74['dialRecallMeTimeout']*0x3c){if(_0x2a1718[_0x72c3('0x160')]&&!_0x2a1718[_0x72c3('0x160')][_0x72c3('0x1ee')]){_0x18c460[_0x72c3('0x98')][_0x72c3('0x131')](_0x2a1718['id'])[_0x72c3('0x1f')](function(){_0x18c460[_0x72c3('0xb3')](_0x571b74);});}else{_0x18c460['unlockContact']({'active':![]},_0x2a1718['id'],0x1)['finally'](function(){_0x18c460[_0x72c3('0xb3')](_0x571b74);});}}else{_0x571b74[_0x72c3('0x68')]+=0x1;_0x18c460[_0x72c3('0xb3')](_0x571b74);if(_0x571b74[_0x72c3('0x1ef')]){_0x18c460['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a1718[_0x72c3('0xd1')],'ListId':_0x2a1718[_0x72c3('0xfe')],'VoiceQueueId':_0x2a1718['VoiceQueueId']||undefined,'CampaignId':_0x2a1718[_0x72c3('0xff')]||undefined})[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x1f0')));_0x18c460[_0x72c3('0xca')](createObjHistory(_0x571b74,_0x2a1718,_0x72c3('0x1f1'),0x17,_0x72c3('0x1f2')))[_0x72c3('0xb2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x18c460['saveInDb'](createObjHistory(_0x571b74,_0x2a1718,_0x72c3('0x1f3'),0x16,_0x72c3('0x1f4')),_0x72c3('0x1f5'),_0x72c3('0x1f6'));}}}}else{_0x571b74[_0x72c3('0x1f7')]+=0x1;_0x18c460[_0x72c3('0xcf')](createObjHistory(_0x571b74,_0x2a1718,_0x72c3('0x1f8'),0xd,_0x72c3('0x1f9')),_0x72c3('0x1fa'),_0x72c3('0x1fb'));throw _0x72c3('0x1fc');}};};Dialer[_0x72c3('0x1c')]['handleIvr']=function(_0x2c435d){var _0x11ea0f=this;var _0x204183=_0x2c435d[_0x72c3('0x1fd')]-_0x2c435d[_0x72c3('0x73')]-_0x2c435d[_0x72c3('0xc4')];emitCampaignSummary(_0x2c435d);if(_0x204183>0x0){if(_0x204183>this[_0x72c3('0x24')]){_0x204183=this[_0x72c3('0x24')];}_0x2c435d[_0x72c3('0xc4')]+=_0x204183;this['getContactDialerIvr'](_0x2c435d['id'],_0x204183,_0x2c435d['dialOrderByScheduledAt'],_0x2c435d)[_0x72c3('0xba')](function(_0xffda9e){_0x2c435d[_0x72c3('0xc4')]-=_0x204183;_0x2c435d['temp']=_0x2c435d['temp']>0x0?_0x2c435d[_0x72c3('0xc4')]:0x0;if(!checkContactEmpty(_0xffda9e)){_0x2c435d['message']=_0x72c3('0xa3');logger[_0x72c3('0x82')](_0x72c3('0x1fe')+_0x2c435d[_0x72c3('0x40')]);}else{_0x2c435d[_0x72c3('0x73')]+=_0xffda9e[_0x72c3('0x135')];_0x2c435d[_0x72c3('0x3e')]=_0x72c3('0x1ff');for(var _0x71ae2b=0x0;_0x71ae2b<_0xffda9e[_0x72c3('0x135')];_0x71ae2b+=0x1){_0x2c435d[_0x72c3('0x200')]+=0x1;if(_[_0x72c3('0xaf')](_0xffda9e[_0x71ae2b])||_[_0x72c3('0xaf')](_0xffda9e[_0x71ae2b]['Contact'])||_['isNil'](_0xffda9e[_0x71ae2b][_0x72c3('0x172')][_0x72c3('0x173')])){_0x11ea0f['emptyContact'](_0x72c3('0x201'),_0x2c435d,_0xffda9e[_0x71ae2b]);}else{_0x11ea0f[_0x72c3('0xbc')](_[_0x72c3('0xd0')](_0xffda9e[_0x71ae2b],['CampaignId',_0x72c3('0x202')]))[_0x72c3('0xba')](_0x11ea0f[_0x72c3('0x1e7')](_0x2c435d,_0xffda9e[_0x71ae2b]))[_0x72c3('0xb2')](_0x11ea0f[_0x72c3('0xcc')]('[actionOriginateIvr]\x20',_0x2c435d));}}}})['catch'](loggerGetContactDialer(_0x72c3('0x203'),_0x2c435d,_0x204183));}};Dialer[_0x72c3('0x1c')]['handlePower']=function(_0x1fd9e3,_0x4e8690){var _0x3c2174=this;var _0x400ceb=[];var _0x11879=_0x4e8690>=0x1?_0x4e8690:0x1;if(_0x1fd9e3[_0x72c3('0x158')]===_0x72c3('0xa')){_0x11879=0x1;}var _0x324810=Math['floor'](_0x1fd9e3[_0x72c3('0x1c9')]*_0x11879)-_0x1fd9e3[_0x72c3('0x73')]-_0x1fd9e3[_0x72c3('0xc4')];emitVoiceQueueSummary(_0x1fd9e3);if(_0x1fd9e3[_0x72c3('0x204')]>0x0){var _0x42f7f1=_0x1fd9e3[_0x72c3('0x204')]-_0x1fd9e3['originated']-_0x1fd9e3[_0x72c3('0x56')]-_0x1fd9e3[_0x72c3('0xc4')]-_0x1fd9e3[_0x72c3('0x52')];if(_0x324810>_0x42f7f1){_0x324810=_0x42f7f1;}}if(_0x324810>0x0){if(_0x1fd9e3[_0x72c3('0x158')]===_0x72c3('0xa')){_0x324810=0x1;}if(_0x324810>this[_0x72c3('0x24')]){_0x324810=this['maxNumberOriginate'];}_0x1fd9e3[_0x72c3('0xc4')]+=_0x324810;for(var _0x3f5195 in this[_0x72c3('0x23')]){if(typeof this[_0x72c3('0x23')][_0x3f5195]!==_0x72c3('0x9e')){if(this['agents'][_0x3f5195]['state']===_0x72c3('0x205')&&this['agents'][_0x3f5195][_0x72c3('0xb0')]==='reachable'){_0x400ceb[_0x72c3('0x149')](this[_0x72c3('0x23')][_0x3f5195]['id']);}}}this[_0x72c3('0xc3')](_0x1fd9e3['id'],_0x400ceb,_0x324810,_0x1fd9e3[_0x72c3('0x206')],_0x1fd9e3)['then'](function(_0x1dc65e){_0x1fd9e3[_0x72c3('0xc4')]-=_0x324810;_0x1fd9e3[_0x72c3('0xc4')]=_0x1fd9e3[_0x72c3('0xc4')]>0x0?_0x1fd9e3[_0x72c3('0xc4')]:0x0;if(!checkContactEmpty(_0x1dc65e)){_0x3c2174['countReScheduled'](_0x1fd9e3)[_0x72c3('0xba')](sendMessageReschedule(_0x1fd9e3))[_0x72c3('0xb2')](loggerCatch(_0x72c3('0x207')));}else{_0x1fd9e3['originated']+=_0x1dc65e['length'];_0x1fd9e3[_0x72c3('0x3e')]=_0x1fd9e3[_0x72c3('0x158')]==='booked'?_0x72c3('0x208'):_0x72c3('0x1ff');for(var _0x390b56=0x0;_0x390b56<_0x1dc65e[_0x72c3('0x135')];_0x390b56+=0x1){if(_[_0x72c3('0xaf')](_0x1dc65e[_0x390b56])||_[_0x72c3('0xaf')](_0x1dc65e[_0x390b56][_0x72c3('0x172')])||_[_0x72c3('0xaf')](_0x1dc65e[_0x390b56][_0x72c3('0x172')]['phone'])){_0x3c2174[_0x72c3('0xcd')](_0x72c3('0x201'),_0x1fd9e3,_0x1dc65e[_0x390b56]);}else{_0x3c2174['checkIsBlackList'](_['pick'](_0x1dc65e[_0x390b56],[_0x72c3('0x103'),_0x72c3('0x202')]))[_0x72c3('0xba')](_0x3c2174[_0x72c3('0x1e7')](_0x1fd9e3,_0x1dc65e[_0x390b56]))[_0x72c3('0xb2')](_0x3c2174['loggerHandler'](_0x72c3('0x201'),_0x1fd9e3));}}}})[_0x72c3('0xb2')](loggerGetContactDialer(_0x72c3('0x209'),_0x1fd9e3,_0x324810));}};Dialer[_0x72c3('0x1c')][_0x72c3('0x97')]=function(_0x28c9a0){if(_0x28c9a0[_0x72c3('0x204')]>0x0){var _0x35f1c4=_0x28c9a0[_0x72c3('0x204')]-_0x28c9a0[_0x72c3('0x73')]-_0x28c9a0['talking'];if(_0x35f1c4>0x0){this['tryOriginatePredictive'](_0x28c9a0);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x72c3('0x20a')](_0x28c9a0);}};Dialer[_0x72c3('0x1c')][_0x72c3('0x20a')]=function(_0x2e9d1b){var _0x323200=this;var _0x364610=[];_0x2e9d1b[_0x72c3('0x73')]+=0x1;for(var _0x1f8367 in this[_0x72c3('0x23')]){if(typeof this[_0x72c3('0x23')][_0x1f8367]!==_0x72c3('0x9e')){if(this[_0x72c3('0x23')][_0x1f8367][_0x72c3('0xe0')]===_0x72c3('0x205')&&this[_0x72c3('0x23')][_0x1f8367][_0x72c3('0xb0')]==='reachable'){_0x364610['push'](this[_0x72c3('0x23')][_0x1f8367]['id']);}}}this[_0x72c3('0xc3')](_0x2e9d1b['id'],_0x364610,0x1,_0x2e9d1b[_0x72c3('0x206')],_0x2e9d1b)['then'](function(_0x24d1b3){if(!checkContactEmpty(_0x24d1b3)){checkContactLowerLimitOriginate(_0x2e9d1b,0x1,0x0);_0x323200[_0x72c3('0xb7')](_0x2e9d1b)['then'](sendMessageReschedule(_0x2e9d1b))[_0x72c3('0xb2')](loggerCatch('[countReScheduled]\x20'));}else{_0x2e9d1b[_0x72c3('0x3e')]=_0x72c3('0x1ff');if(_['isNil'](_0x24d1b3[0x0])||_[_0x72c3('0xaf')](_0x24d1b3[0x0][_0x72c3('0x172')])||_[_0x72c3('0xaf')](_0x24d1b3[0x0][_0x72c3('0x172')][_0x72c3('0x173')])){_0x323200['emptyContact']('[actionOriginate]\x20',_0x2e9d1b,_0x24d1b3[0x0]);}else{_0x323200[_0x72c3('0xb9')](_[_0x72c3('0xd0')](_0x24d1b3[0x0],[_0x72c3('0x103'),_0x72c3('0x202')]))[_0x72c3('0xba')](_0x323200['checkContactBlack'](_0x2e9d1b,_0x24d1b3[0x0]))[_0x72c3('0xb2')](_0x323200['loggerHandler'](_0x72c3('0x20b'),_0x2e9d1b));}}})[_0x72c3('0xb2')](loggerGetContactDialer(_0x72c3('0x20c'),_0x2e9d1b,0x1));emitVoiceQueueSummary(_0x2e9d1b);};Dialer[_0x72c3('0x1c')][_0x72c3('0x1de')]=function(_0x12f937,_0x3e4570,_0x3132a9,_0x3f0f38,_0x1452c7,_0xa4de1d){loggerPredictive['info'](_0x72c3('0x20d'));loggerPredictive['info'](_0x72c3('0x20e'),_0x12f937);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x20f'),_0x3e4570);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x210'),_0x3132a9);loggerPredictive['info'](_0x72c3('0x211'),_0x3f0f38);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x212'),_0x1452c7);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8b'));return new BPromise(function(_0x18d743,_0x1a2813){if(_0x12f937<=0x0||isNaN(_0x12f937)){return _0x1a2813(msgResponse(_0x72c3('0x213'),_0x72c3('0x49'),'m\x20=\x20'+_0x12f937));}if(_0x3132a9<=0x0||isNaN(_0x3132a9)){return _0x1a2813(msgResponse(_0x72c3('0x213'),'Error',_0x72c3('0x214')+_0x3132a9));}if(_0x3f0f38<=0x0||isNaN(_0x3f0f38)){return _0x1a2813(msgResponse(_0x72c3('0x213'),_0x72c3('0x49'),_0x72c3('0x215')+_0x3f0f38));}if(_0x3e4570<=0x0||isNaN(_0x3e4570)){return _0x1a2813(msgResponse(_0x72c3('0x213'),_0x72c3('0x49'),_0x72c3('0x216')+_0x3e4570));}if(_0x1452c7<=0x0||isNaN(_0x1452c7)){return _0x1a2813(msgResponse(_0x72c3('0x213'),'Error','Amax\x20=\x20'+_0x1452c7));}_0xa4de1d=_0xa4de1d||0x0;var _0x4537ed=0x1/_0x3132a9;var _0x2ed36b=0x0;var _0x13bf50=0x0;var _0x3ef16d=0x0;var _0x5c269b=0x0;for(var _0x515259=0x0;_0x3ef16d<_0x1452c7;_0x515259+=0x1){_0x13bf50=_0x515259/_0x3e4570;_0x2ed36b=(_0x3f0f38*_0x13bf50+_0xa4de1d)/_0x4537ed;_0x3ef16d=erlangb(_0x2ed36b,_0x12f937);_0x5c269b=_0x2ed36b/_0x12f937*(0x1-erlangb(_0x2ed36b,_0x12f937));}return _0x18d743({'erlangCalls':_0x515259,'erlangCallToSecond':_0x3e4570/_0x515259,'erlangAbandonmentRate':_0x3ef16d,'erlangBusyFactor':_0x5c269b});});};Dialer[_0x72c3('0x1c')]['busyFactor']=function(_0x46389c,_0x41574b,_0x4feee7,_0x1a800d,_0x144823,_0x2ec6ca){loggerPredictive[_0x72c3('0x82')](_0x72c3('0x217'));loggerPredictive['info'](_0x72c3('0x20e'),_0x46389c);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41574b);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x210'),_0x4feee7);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x211'),_0x1a800d);loggerPredictive['info'](_0x72c3('0x218'),_0x144823);loggerPredictive[_0x72c3('0x82')](_0x72c3('0x8b'));return new BPromise(function(_0x2d93ce,_0x211496){if(_0x46389c<=0x0||isNaN(_0x46389c)){return _0x211496(msgResponse(_0x72c3('0x219'),'Error',_0x72c3('0x21a')+_0x46389c));}if(_0x4feee7<=0x0||isNaN(_0x4feee7)){return _0x211496(msgResponse(_0x72c3('0x219'),_0x72c3('0x49'),_0x72c3('0x214')+_0x4feee7));}if(_0x1a800d<=0x0||isNaN(_0x1a800d)){return _0x211496(msgResponse(_0x72c3('0x219'),_0x72c3('0x49'),_0x72c3('0x215')+_0x1a800d));}if(_0x41574b<=0x0||isNaN(_0x41574b)){return _0x211496(msgResponse(_0x72c3('0x219'),_0x72c3('0x49'),_0x72c3('0x216')+_0x41574b));}if(_0x144823<=0x0||isNaN(_0x144823)){return _0x211496(msgResponse(_0x72c3('0x219'),_0x72c3('0x49'),_0x72c3('0x21b')+_0x144823));}_0x2ec6ca=_0x2ec6ca||0x0;var _0x268eaf=0x1/_0x4feee7;var _0x3efa42=0x0;var _0x200e4f=0x0;var _0x26a765=0x0;var _0x7a3f37=0x0;for(var _0x544291=0x0;_0x7a3f37<_0x144823;_0x544291+=0x1){_0x200e4f=_0x544291/_0x41574b;_0x3efa42=(_0x1a800d*_0x200e4f+_0x2ec6ca)/_0x268eaf;_0x26a765=erlangb(_0x3efa42,_0x46389c);_0x7a3f37=_0x3efa42/_0x46389c*(0x1-erlangb(_0x3efa42,_0x46389c));}return _0x2d93ce({'erlangCalls':_0x544291,'erlangCallToSecond':_0x41574b/_0x544291,'erlangAbandonmentRate':_0x26a765,'erlangBusyFactor':_0x7a3f37});});};module[_0x72c3('0x21c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bb41bf1..eab9d4b 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e15=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x5c5502,_0x47cf47){var _0x359546=function(_0x5b0561){while(--_0x5b0561){_0x5c5502['push'](_0x5c5502['shift']());}};_0x359546(++_0x47cf47);}(_0x2e15,0xc3));var _0x52e1=function(_0x1ca5a3,_0x40b024){_0x1ca5a3=_0x1ca5a3-0x0;var _0xc8acbf=_0x2e15[_0x1ca5a3];return _0xc8acbf;};'use strict';var util=require(_0x52e1('0x0'));var _=require('lodash');var moment=require(_0x52e1('0x1'));function getSeconds(_0x52862e,_0x4f6d37){var _0x4cbcc0=moment(_0x52862e)[_0x52e1('0x2')](0x0);var _0x4a1b27=moment(_0x4f6d37)[_0x52e1('0x2')](0x0);return _0x4cbcc0['diff'](_0x4a1b27,_0x52e1('0x3'));}function QueueCallerAbandon(_0x23505e,_0xb137dd){this[_0x52e1('0x4')]=_0x23505e[_0x52e1('0x4')];this[_0x52e1('0x5')]=_0x23505e[_0x52e1('0x5')];this[_0x52e1('0x6')]=_0x23505e[_0x52e1('0x5')]==='outbound'?_0x52e1('0x7'):_0x23505e['type'];this[_0x52e1('0x8')]=_0x23505e[_0x52e1('0x8')];this[_0x52e1('0x9')]=_0x23505e[_0x52e1('0x9')];this[_0x52e1('0xa')]=_0x23505e[_0x52e1('0xa')];this[_0x52e1('0xb')]=_0x23505e[_0x52e1('0x8')]+_0x23505e['countcongestionretry']+_0x23505e[_0x52e1('0xa')]+_0x23505e[_0x52e1('0xc')]+_0x23505e[_0x52e1('0xd')]+_0x23505e[_0x52e1('0xe')]+_0x23505e[_0x52e1('0xf')]+_0x23505e[_0x52e1('0x10')];this[_0x52e1('0xc')]=_0x23505e[_0x52e1('0xc')];this[_0x52e1('0xd')]=_0x23505e[_0x52e1('0xd')];this[_0x52e1('0xe')]=_0x23505e['countabandonedretry'];this[_0x52e1('0xf')]=_0x23505e['countmachineretry'];this[_0x52e1('0x10')]=_0x23505e[_0x52e1('0x10')];this[_0x52e1('0x11')]=_0xb137dd[_0x52e1('0x11')];this[_0x52e1('0x12')]=_0x23505e[_0x52e1('0x13')];this['calleridnum']=_0x23505e[_0x52e1('0x14')];this[_0x52e1('0x15')]=_0x23505e[_0x52e1('0x15')];this[_0x52e1('0x16')]=_0x23505e['responsetime'];this[_0x52e1('0x17')]=_0x23505e[_0x52e1('0x17')];this[_0x52e1('0x18')]=this[_0x52e1('0x17')];this[_0x52e1('0x19')]=getSeconds(_0x23505e['responsetime'],_0x23505e[_0x52e1('0x15')]);this[_0x52e1('0x1a')]=getSeconds(this[_0x52e1('0x17')],_0x23505e[_0x52e1('0x16')]);this['talktime']=0x0;this['queue']=_0xb137dd[_0x52e1('0x7')];this['membername']=_0xb137dd[_0x52e1('0x1b')];this[_0x52e1('0x1c')]=_0xb137dd[_0x52e1('0x1c')];this[_0x52e1('0x1d')]=_0x23505e['callback'];this[_0x52e1('0x1e')]=_0x23505e[_0x52e1('0x1e')];this[_0x52e1('0x1f')]=_0x23505e[_0x52e1('0x1f')];this[_0x52e1('0x20')]=_0x23505e[_0x52e1('0x20')];this[_0x52e1('0x21')]=_0x23505e[_0x52e1('0x21')];this[_0x52e1('0x22')]=_0x23505e[_0x52e1('0x22')];this[_0x52e1('0x23')]=_0x23505e['UserId'];this[_0x52e1('0x24')]=_0x23505e[_0x52e1('0x24')];this[_0x52e1('0x25')]=_0x23505e[_0x52e1('0x25')];this[_0x52e1('0x26')]=_0x23505e[_0x52e1('0x26')]||'';this[_0x52e1('0x27')]=_0x23505e[_0x52e1('0x27')]||'';}module[_0x52e1('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xcf52=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x48dee6,_0xabc45e){var _0x1c4e37=function(_0xf29d58){while(--_0xf29d58){_0x48dee6['push'](_0x48dee6['shift']());}};_0x1c4e37(++_0xabc45e);}(_0xcf52,0x1a2));var _0x2cf5=function(_0x50d5f9,_0x2c630e){_0x50d5f9=_0x50d5f9-0x0;var _0x5d5da0=_0xcf52[_0x50d5f9];return _0x5d5da0;};'use strict';var util=require(_0x2cf5('0x0'));var _=require(_0x2cf5('0x1'));var moment=require(_0x2cf5('0x2'));function getSeconds(_0x425b67,_0x594e11){var _0x1b27ea=moment(_0x425b67)[_0x2cf5('0x3')](0x0);var _0x26b179=moment(_0x594e11)['milliseconds'](0x0);return _0x1b27ea[_0x2cf5('0x4')](_0x26b179,'seconds');}function QueueCallerAbandon(_0x127002,_0x3385e3){this[_0x2cf5('0x5')]=_0x127002[_0x2cf5('0x5')];this[_0x2cf5('0x6')]=_0x127002[_0x2cf5('0x6')];this[_0x2cf5('0x7')]=_0x127002[_0x2cf5('0x6')]===_0x2cf5('0x8')?_0x2cf5('0x9'):_0x127002[_0x2cf5('0x6')];this[_0x2cf5('0xa')]=_0x127002[_0x2cf5('0xa')];this[_0x2cf5('0xb')]=_0x127002[_0x2cf5('0xb')];this[_0x2cf5('0xc')]=_0x127002[_0x2cf5('0xc')];this['countglobal']=_0x127002[_0x2cf5('0xa')]+_0x127002[_0x2cf5('0xb')]+_0x127002[_0x2cf5('0xc')]+_0x127002[_0x2cf5('0xd')]+_0x127002[_0x2cf5('0xe')]+_0x127002[_0x2cf5('0xf')]+_0x127002[_0x2cf5('0x10')]+_0x127002['countagentrejectretry'];this[_0x2cf5('0xd')]=_0x127002[_0x2cf5('0xd')];this[_0x2cf5('0xe')]=_0x127002['countdropretry'];this[_0x2cf5('0xf')]=_0x127002[_0x2cf5('0xf')];this[_0x2cf5('0x10')]=_0x127002[_0x2cf5('0x10')];this[_0x2cf5('0x11')]=_0x127002['countagentrejectretry'];this[_0x2cf5('0x12')]=_0x3385e3['uniqueid'];this['calleridname']=_0x127002[_0x2cf5('0x13')];this[_0x2cf5('0x14')]=_0x127002[_0x2cf5('0x15')];this[_0x2cf5('0x16')]=_0x127002[_0x2cf5('0x16')];this[_0x2cf5('0x17')]=_0x127002[_0x2cf5('0x17')];this[_0x2cf5('0x18')]=_0x127002[_0x2cf5('0x18')];this['endtime']=this[_0x2cf5('0x18')];this[_0x2cf5('0x19')]=getSeconds(_0x127002[_0x2cf5('0x17')],_0x127002[_0x2cf5('0x16')]);this[_0x2cf5('0x1a')]=getSeconds(this[_0x2cf5('0x18')],_0x127002[_0x2cf5('0x17')]);this['talktime']=0x0;this[_0x2cf5('0x9')]=_0x3385e3[_0x2cf5('0x9')];this[_0x2cf5('0x1b')]=_0x3385e3['connectedlinename'];this[_0x2cf5('0x1c')]=_0x3385e3['reason'];this[_0x2cf5('0x1d')]=_0x127002[_0x2cf5('0x1d')];this['callbackuniqueid']=_0x127002[_0x2cf5('0x1e')];this[_0x2cf5('0x1f')]=_0x127002[_0x2cf5('0x1f')];this[_0x2cf5('0x20')]=_0x127002[_0x2cf5('0x20')];this['ContactId']=_0x127002[_0x2cf5('0x21')];this[_0x2cf5('0x22')]=_0x127002[_0x2cf5('0x22')];this[_0x2cf5('0x23')]=_0x127002[_0x2cf5('0x23')];this[_0x2cf5('0x24')]=_0x127002['VoiceQueueId'];this[_0x2cf5('0x25')]=_0x127002[_0x2cf5('0x25')];this[_0x2cf5('0x26')]=_0x127002[_0x2cf5('0x26')]||'';this[_0x2cf5('0x27')]=_0x127002[_0x2cf5('0x27')]||'';}module[_0x2cf5('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8122e77..5035145 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(_0x22e0e1,_0x1f609f){var _0x139e19=function(_0x4d969d){while(--_0x4d969d){_0x22e0e1['push'](_0x22e0e1['shift']());}};_0x139e19(++_0x1f609f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x4dcddb,_0x233a97){var _0x54ac88=function(_0x224ef0){while(--_0x224ef0){_0x4dcddb['push'](_0x4dcddb['shift']());}};_0x54ac88(++_0x233a97);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 cee5696..dba0959 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 _0x1399=['Fax\x20failed','checkAfterSend','Trunk','isValid','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','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','originateresponse','syncOriginateResponse','prototype','syncNewchannel','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','response','reason','update','AttachmentId','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[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]'];(function(_0x47bb8b,_0x383b52){var _0x3bf300=function(_0x422e3b){while(--_0x422e3b){_0x47bb8b['push'](_0x47bb8b['shift']());}};_0x3bf300(++_0x383b52);}(_0x1399,0x16c));var _0x9139=function(_0x4d497b,_0x5df5e6){_0x4d497b=_0x4d497b-0x0;var _0x3f589f=_0x1399[_0x4d497b];return _0x3f589f;};'use strict';var util=require(_0x9139('0x0'));var _=require(_0x9139('0x1'));var BPromise=require('bluebird');var uuid=require(_0x9139('0x2'));var moment=require('moment');var path=require(_0x9139('0x3'));var tiff2pdf=require(_0x9139('0x4'));var gs=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var ami=require(_0x9139('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x9139('0x9'));var Action=require(_0x9139('0xa'));var faxAccount=require(_0x9139('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x9139('0xc'));function Fax(_0x59aec5){this['channels']={};this[_0x9139('0xd')]=_0x59aec5[_0x9139('0xd')];this['trunks']=_0x59aec5[_0x9139('0xe')];this[_0x9139('0xf')]={};ami['on']('newchannel',this['syncNewchannel'][_0x9139('0x10')](this));ami['on'](_0x9139('0x11'),this[_0x9139('0x12')][_0x9139('0x10')](this));ami['on'](_0x9139('0x13'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0x9139('0x14')]['bind'](this));ami['on'](_0x9139('0x15'),this[_0x9139('0x16')][_0x9139('0x10')](this));ami['on'](_0x9139('0x17'),this['syncReceiveFax'][_0x9139('0x10')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x9139('0x18'),this[_0x9139('0x19')][_0x9139('0x10')](this));}Fax[_0x9139('0x1a')][_0x9139('0x1b')]=function(_0x425be4){if(_0x425be4['context']==='from-voip-provider'){for(var _0x13cab8 in this[_0x9139('0xd')]){if(this['faxAccounts']['hasOwnProperty'](_0x13cab8)){if(_0x425be4[_0x9139('0x1c')]===this[_0x9139('0xd')][_0x13cab8]['localstationid']){this[_0x9139('0x1d')][_0x425be4[_0x9139('0x1e')]]={};this[_0x9139('0x1d')][_0x425be4[_0x9139('0x1e')]][_0x9139('0x1f')]=_0x425be4[_0x9139('0x1f')];this[_0x9139('0x1d')][_0x425be4[_0x9139('0x1e')]]['id']=this[_0x9139('0xd')][_0x13cab8]['id'];this[_0x9139('0x1d')][_0x425be4[_0x9139('0x1e')]][_0x9139('0x20')]=this[_0x9139('0xd')][_0x13cab8][_0x9139('0x20')];logger[_0x9139('0x21')](_0x425be4[_0x9139('0x1e')],_0x9139('0x22'));}}}}if(this[_0x9139('0xf')][_0x425be4[_0x9139('0x1e')]]){this['channels'][_0x425be4[_0x9139('0x1e')]]={};this[_0x9139('0x1d')][_0x425be4['uniqueid']][_0x9139('0x1f')]=_0x425be4[_0x9139('0x1f')];logger[_0x9139('0x21')](_0x425be4['uniqueid'],_0x9139('0x22'));}};Fax[_0x9139('0x1a')]['syncVarSet']=function(_0x1c9938){if(this[_0x9139('0x1d')][_0x1c9938[_0x9139('0x1e')]]){for(var _0x55e95f in _0x1c9938[_0x9139('0x23')]){if(_0x1c9938[_0x9139('0x23')][_0x9139('0x24')](_0x55e95f)){this[_0x9139('0x1d')][_0x1c9938[_0x9139('0x1e')]][_0x55e95f]=_0x1c9938[_0x9139('0x25')];}}}};Fax[_0x9139('0x1a')]['syncNewState']=function(_0x55cc6a){if(this[_0x9139('0x1d')][_0x55cc6a[_0x9139('0x1e')]]){this[_0x9139('0x1d')][_0x55cc6a['uniqueid']]['channelstate']=_0x55cc6a[_0x9139('0x26')];this[_0x9139('0x1d')][_0x55cc6a[_0x9139('0x1e')]][_0x9139('0x27')]=_0x55cc6a[_0x9139('0x27')];}};Fax['prototype']['syncNewExten']=function(_0x2f26de){if(this['channels'][_0x2f26de['uniqueid']]){for(var _0x222429 in _0x2f26de[_0x9139('0x23')]){if(_0x2f26de['variable'][_0x9139('0x24')](_0x222429)){this[_0x9139('0x1d')][_0x2f26de['uniqueid']][_0x222429]=_0x2f26de[_0x9139('0x25')];}}}};Fax[_0x9139('0x1a')][_0x9139('0x16')]=function(_0x11844b){if(this[_0x9139('0x1d')][_0x11844b[_0x9139('0x1e')]]){this[_0x9139('0x1d')][_0x11844b[_0x9139('0x1e')]][_0x9139('0x28')]=_0x11844b[_0x9139('0x28')];this[_0x9139('0x1d')][_0x11844b['uniqueid']][_0x9139('0x29')]=_0x11844b[_0x9139('0x29')];this['channels'][_0x11844b[_0x9139('0x1e')]][_0x9139('0x2a')]=_0x11844b[_0x9139('0x2a')];this['channels'][_0x11844b[_0x9139('0x1e')]][_0x9139('0x2b')]=_0x11844b[_0x9139('0x2b')];logger[_0x9139('0x21')](_0x11844b[_0x9139('0x1e')],_0x9139('0x2c'));}};Fax[_0x9139('0x1a')][_0x9139('0x2d')]=function(_0x24f7d0){var _0x22b074=this;if(this['channels'][_0x24f7d0[_0x9139('0x1e')]]){var _0x66193=this[_0x9139('0x1d')][_0x24f7d0[_0x9139('0x1e')]]['id'];this[_0x9139('0x1d')][_0x24f7d0[_0x9139('0x1e')]][_0x9139('0x2e')]=_0x24f7d0['remotestationid'];this[_0x9139('0x1d')][_0x24f7d0['uniqueid']][_0x9139('0x2f')]=_0x24f7d0[_0x9139('0x2f')];this[_0x9139('0x1d')][_0x24f7d0['uniqueid']][_0x9139('0x2a')]=_0x24f7d0[_0x9139('0x2a')];this[_0x9139('0x1d')][_0x24f7d0[_0x9139('0x1e')]][_0x9139('0x30')]=_0x24f7d0[_0x9139('0x30')];this[_0x9139('0x1d')][_0x24f7d0[_0x9139('0x1e')]][_0x9139('0x31')]=_0x24f7d0[_0x9139('0x31')];this['channels'][_0x24f7d0[_0x9139('0x1e')]][_0x9139('0x2b')]=_0x24f7d0[_0x9139('0x2b')];this['channels'][_0x24f7d0['uniqueid']]['calleridnum']=_0x24f7d0[_0x9139('0x32')];if(this[_0x9139('0x1d')][_0x24f7d0[_0x9139('0x1e')]][_0x9139('0x2f')]>0x0){tiff2pdf(_0x24f7d0[_0x9139('0x2b')],'/var/opt/motion2/server/files/attachments/',function(_0x20e8f5){logger[_0x9139('0x21')](_0x24f7d0[_0x9139('0x1e')],_0x9139('0x33'),_0x20e8f5[_0x9139('0x34')]);attachment['create']({'name':path[_0x9139('0x35')](_0x24f7d0[_0x9139('0x2b')])[_0x9139('0x20')],'basename':path[_0x9139('0x35')](_0x24f7d0['filename'])['name']+_0x9139('0x36'),'type':_0x9139('0x37')})['then'](function(_0x5003db){faxAccount[_0x9139('0x38')](_0x66193,{'from':_0x24f7d0[_0x9139('0x32')],'mapKey':'fax','body':path[_0x9139('0x35')](_0x24f7d0[_0x9139('0x2b')])['name']+_0x9139('0x36'),'AttachmentId':_0x5003db['id']})['catch'](function(_0x54c7fc){logger[_0x9139('0x39')](_0x24f7d0[_0x9139('0x1e')],_0x9139('0x3a'),JSON[_0x9139('0x3b')](_0x54c7fc));});})[_0x9139('0x3c')](function(_0x52cf68){logger[_0x9139('0x39')](_0x24f7d0[_0x9139('0x1e')],_0x9139('0x3d'),JSON['stringify'](_0x52cf68));});});}logger[_0x9139('0x21')](_0x24f7d0[_0x9139('0x1e')],_0x9139('0x3d'));}};Fax[_0x9139('0x1a')][_0x9139('0x19')]=function(_0x31395f){if(this[_0x9139('0xf')][_0x31395f[_0x9139('0x1e')]]){_[_0x9139('0x3e')](this[_0x9139('0x1d')][_0x31395f[_0x9139('0x1e')]],_['pick'](_0x31395f,[_0x9139('0x3f'),_0x9139('0x40')]));}};function updateStatus(_0x30aad3){if(_0x30aad3['AttachmentId']){faxMessage[_0x9139('0x41')](_0x30aad3[_0x9139('0x42')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x9139('0x43')](function(_0x27d337){ut[_0x9139('0x44')]('[Fax][Message][Error][Updated]',_0x27d337);})[_0x9139('0x3c')](function(_0xbce82d){ut[_0x9139('0x44')](_0x9139('0x45'),_0xbce82d);});}else{ut['logger'](_0x9139('0x46'));}}Fax[_0x9139('0x1a')][_0x9139('0x47')]=function(_0x502350,_0x3f8b69,_0x146201){var _0x2b5977=this;var _0x477d81={};if(_0x3f8b69){_0x477d81={'read':_0x3f8b69};}else{_0x477d81={'failMessage':_0x146201};}if(this[_0x9139('0xf')][_0x502350][_0x9139('0x42')]){faxMessage[_0x9139('0x41')](this['actions'][_0x502350][_0x9139('0x42')],_0x477d81)[_0x9139('0x43')](function(_0x5f3a48){ut[_0x9139('0x44')](_0x9139('0x48'),_0x5f3a48);})[_0x9139('0x3c')](function(_0x1a0841){ut[_0x9139('0x44')]('[Fax][Message][NoUpdate1]',_0x1a0841);})[_0x9139('0x49')](function(){delete _0x2b5977[_0x9139('0x1d')][_0x502350];delete _0x2b5977['actions'][_0x502350];});}else{ut['logger'](_0x9139('0x4a'));delete this[_0x9139('0x1d')][_0x502350];delete this[_0x9139('0xf')][_0x502350];}};Fax['prototype'][_0x9139('0x4b')]=function(_0x576b5a){var _0x59e08d=this;if(this[_0x9139('0x1d')][_0x576b5a[_0x9139('0x1e')]]){if(this[_0x9139('0xf')][_0x576b5a[_0x9139('0x1e')]]){this['channels'][_0x576b5a[_0x9139('0x1e')]]['id']=this[_0x9139('0xf')][_0x576b5a[_0x9139('0x1e')]]['id'];this['channels'][_0x576b5a[_0x9139('0x1e')]][_0x9139('0x20')]=this[_0x9139('0xf')][_0x576b5a[_0x9139('0x1e')]][_0x9139('0x20')];}logger[_0x9139('0x21')](_0x576b5a[_0x9139('0x1e')],this[_0x9139('0xf')][_0x576b5a[_0x9139('0x1e')]]?_0x9139('0x4c'):_0x9139('0x4d'),JSON[_0x9139('0x3b')](this[_0x9139('0x1d')][_0x576b5a[_0x9139('0x1e')]]));if(this['actions'][_0x576b5a[_0x9139('0x1e')]]){if(this[_0x9139('0x1d')][_0x576b5a[_0x9139('0x1e')]][_0x9139('0x4e')]>0x0&&this[_0x9139('0x1d')][_0x576b5a['uniqueid']][_0x9139('0x15')]===_0x9139('0x4f')){this[_0x9139('0x47')](_0x576b5a[_0x9139('0x1e')],!![]);}else{this[_0x9139('0x47')](_0x576b5a['uniqueid'],![],this['channels'][_0x576b5a[_0x9139('0x1e')]][_0x9139('0x50')]?'SENDING\x20FAILED:\x20'+this[_0x9139('0x1d')][_0x576b5a[_0x9139('0x1e')]][_0x9139('0x50')]:_0x9139('0x51'));}}}};Fax[_0x9139('0x1a')][_0x9139('0x52')]=function(_0x92cccb){var _0x2fc8d8=this;return new BPromise(function(_0x8a99f2,_0x53a27f){_0x2fc8d8[_0x9139('0x53')](_0x92cccb,_0x2fc8d8[_0x9139('0xd')][_0x92cccb[_0x9139('0x54')]])[_0x9139('0x43')](function(_0x4f6e7c){ut['logger'](_0x9139('0x55'),_0x4f6e7c);_0x8a99f2(ut[_0x9139('0x34')](_0x9139('0x56')));})[_0x9139('0x3c')](function(_0x4b17c1){ut[_0x9139('0x44')](_0x9139('0x57'),_0x4b17c1);updateStatus(_0x92cccb);_0x53a27f(ut['message'](_0x9139('0x58')));});});};Fax[_0x9139('0x1a')][_0x9139('0x59')]=function(_0x1096e6){var _0x198ddb=this;return new BPromise(function(_0x45eeda,_0x224e3d){var _0x18480e=_0x198ddb['checkTrunk'](_0x198ddb['faxAccounts'][_0x1096e6['FaxAccountId']][_0x9139('0x5a')],_0x1096e6);if(_0x18480e[_0x9139('0x5b')]){_0x45eeda(ut[_0x9139('0x34')]('Trunk\x20Reachable'));}else{_0x224e3d(ut[_0x9139('0x34')](_0x18480e[_0x9139('0x34')]));}});};function originate(_0x42d389,_0x235241,_0x2b76c5){return new BPromise(function(_0x3aacdb,_0x5d9ae8){if(_0x2b76c5){var _0x437d18=util['format'](_0x9139('0x5c'),path['parse'](_0x42d389[_0x9139('0x3')])[_0x9139('0x20')],_0x42d389['path']);gs['execute'](_0x437d18)[_0x9139('0x43')](function(){_0x42d389[_0x9139('0x3')]=util[_0x9139('0x5d')]('%s/%s.tif',path[_0x9139('0x35')](_0x42d389[_0x9139('0x3')])[_0x9139('0x5e')],path[_0x9139('0x35')](_0x42d389['path'])['name']);_0x235241[_0x9139('0x5f')]=_0x42d389[_0x9139('0x3')];ut['logger'](_0x9139('0x60'),'');ami[_0x9139('0x61')](ut[_0x9139('0x62')](_0x42d389,_0x235241))[_0x9139('0x43')](function(_0x12465a){_0x3aacdb(_0x12465a);})[_0x9139('0x3c')](function(_0x3c17fd){_0x5d9ae8(_0x3c17fd);});})[_0x9139('0x3c')](function(_0x17e386){_0x5d9ae8(_0x17e386);});}else{ami[_0x9139('0x61')](ut[_0x9139('0x62')](_0x42d389,_0x235241))[_0x9139('0x43')](function(_0x17a842){_0x3aacdb(_0x17a842);})['catch'](function(_0x1db805){_0x5d9ae8(_0x1db805);});}});}Fax[_0x9139('0x1a')][_0x9139('0x53')]=function(_0x283861,_0x144a02){var _0x58e0f5=this;return new BPromise(function(_0x406be8,_0x54cd2a){var _0x14868a=uuid['v4']();var _0x3fc4af=ut[_0x9139('0x63')](_0x283861,_0x144a02);_0x58e0f5['actions'][_0x14868a]=new Action(_0x14868a,_0x144a02,_0x283861);var _0x15a530=_0x58e0f5[_0x9139('0xf')][_0x14868a];if(path['parse'](_0x283861[_0x9139('0x3')])[_0x9139('0x64')]===_0x9139('0x36')){originate(_0x15a530,_0x3fc4af,!![])[_0x9139('0x43')](function(_0x16a1f6){_0x406be8(_0x16a1f6);})[_0x9139('0x3c')](function(_0x1abb10){_0x54cd2a(_0x1abb10);});}else{originate(_0x15a530,_0x3fc4af,![])[_0x9139('0x43')](function(_0x143841){_0x406be8(_0x143841);})['catch'](function(_0x2e321e){_0x54cd2a(_0x2e321e);});}});};Fax[_0x9139('0x1a')][_0x9139('0x65')]=function(_0x3c3474){return!_[_0x9139('0x66')](_0x3c3474)&&!_['isNil'](_0x3c3474[_0x9139('0x20')])&&!_[_0x9139('0x66')](_0x3c3474['active'])&&_0x3c3474['active']&&!_[_0x9139('0x66')](this[_0x9139('0xe')][util[_0x9139('0x5d')](_0x9139('0x67'),_0x3c3474['name'])])&&!_[_0x9139('0x66')](this[_0x9139('0xe')][util[_0x9139('0x5d')](_0x9139('0x67'),_0x3c3474[_0x9139('0x20')])][_0x9139('0x29')])&&(this[_0x9139('0xe')][util[_0x9139('0x5d')](_0x9139('0x67'),_0x3c3474[_0x9139('0x20')])][_0x9139('0x29')]===_0x9139('0x68')||this[_0x9139('0xe')][util[_0x9139('0x5d')](_0x9139('0x67'),_0x3c3474[_0x9139('0x20')])][_0x9139('0x29')]===_0x9139('0x69'));};Fax[_0x9139('0x1a')]['checkTrunk']=function(_0x4654a3,_0x1f0412){if(!this[_0x9139('0x65')](_0x4654a3)){ut[_0x9139('0x44')](_0x9139('0x6a'),_['isNil'](_0x4654a3)?'':_0x4654a3[_0x9139('0x20')]+_0x9139('0x6b'));return{'isValid':![],'message':_0x9139('0x6c')};}if(_[_0x9139('0x66')](_0x1f0412[_0x9139('0x7')])){ut[_0x9139('0x44')](_0x9139('0x6d'),JSON['stringify'](_0x1f0412));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x9139('0x66')](_0x1f0412[_0x9139('0x3')])){ut[_0x9139('0x44')](_0x9139('0x6e'),JSON['stringify'](_0x1f0412));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x9139('0x6f')};};module[_0x9139('0x70')]=Fax; \ No newline at end of file +var _0x1eba=['syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','prototype','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','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','syncNewState','syncNewExten'];(function(_0x5249d2,_0x3040bf){var _0x42deb6=function(_0x101299){while(--_0x101299){_0x5249d2['push'](_0x5249d2['shift']());}};_0x42deb6(++_0x3040bf);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0x1eba[_0x2077c2];return _0x312f9f;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var BPromise=require(_0xa1eb('0x2'));var uuid=require(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var ami=require(_0xa1eb('0x8'));var rpcDb=require(_0xa1eb('0x9'));var Channel=require(_0xa1eb('0xa'));var ut=require(_0xa1eb('0xb'));var Action=require(_0xa1eb('0xc'));var faxAccount=require(_0xa1eb('0xd'));var attachment=require(_0xa1eb('0xe'));var faxMessage=require(_0xa1eb('0xf'));function Fax(_0x9d7113){this['channels']={};this[_0xa1eb('0x10')]=_0x9d7113['faxAccounts'];this[_0xa1eb('0x11')]=_0x9d7113['trunks'];this[_0xa1eb('0x12')]={};ami['on']('newchannel',this[_0xa1eb('0x13')]['bind'](this));ami['on'](_0xa1eb('0x14'),this[_0xa1eb('0x15')][_0xa1eb('0x16')](this));ami['on']('newstate',this[_0xa1eb('0x17')][_0xa1eb('0x16')](this));ami['on']('newexten',this[_0xa1eb('0x18')]['bind'](this));ami['on']('faxstatus',this[_0xa1eb('0x19')]['bind'](this));ami['on'](_0xa1eb('0x1a'),this[_0xa1eb('0x1b')][_0xa1eb('0x16')](this));ami['on'](_0xa1eb('0x1c'),this[_0xa1eb('0x1d')][_0xa1eb('0x16')](this));ami['on'](_0xa1eb('0x1e'),this[_0xa1eb('0x1f')][_0xa1eb('0x16')](this));}Fax['prototype'][_0xa1eb('0x13')]=function(_0x495ec4){if(_0x495ec4[_0xa1eb('0x20')]===_0xa1eb('0x21')){for(var _0x33c4e3 in this[_0xa1eb('0x10')]){if(this['faxAccounts'][_0xa1eb('0x22')](_0x33c4e3)){if(_0x495ec4[_0xa1eb('0x23')]===this[_0xa1eb('0x10')][_0x33c4e3][_0xa1eb('0x24')]){this[_0xa1eb('0x25')][_0x495ec4[_0xa1eb('0x26')]]={};this[_0xa1eb('0x25')][_0x495ec4[_0xa1eb('0x26')]]['channel']=_0x495ec4[_0xa1eb('0x27')];this['channels'][_0x495ec4[_0xa1eb('0x26')]]['id']=this[_0xa1eb('0x10')][_0x33c4e3]['id'];this[_0xa1eb('0x25')][_0x495ec4[_0xa1eb('0x26')]]['name']=this['faxAccounts'][_0x33c4e3][_0xa1eb('0x28')];logger[_0xa1eb('0x29')](_0x495ec4['uniqueid'],_0xa1eb('0x2a'));}}}}if(this[_0xa1eb('0x12')][_0x495ec4[_0xa1eb('0x26')]]){this[_0xa1eb('0x25')][_0x495ec4[_0xa1eb('0x26')]]={};this[_0xa1eb('0x25')][_0x495ec4[_0xa1eb('0x26')]][_0xa1eb('0x27')]=_0x495ec4[_0xa1eb('0x27')];logger[_0xa1eb('0x29')](_0x495ec4[_0xa1eb('0x26')],_0xa1eb('0x2a'));}};Fax['prototype'][_0xa1eb('0x15')]=function(_0xbd5517){if(this['channels'][_0xbd5517[_0xa1eb('0x26')]]){for(var _0x4e2aa7 in _0xbd5517[_0xa1eb('0x2b')]){if(_0xbd5517[_0xa1eb('0x2b')]['hasOwnProperty'](_0x4e2aa7)){this[_0xa1eb('0x25')][_0xbd5517[_0xa1eb('0x26')]][_0x4e2aa7]=_0xbd5517[_0xa1eb('0x2c')];}}}};Fax['prototype'][_0xa1eb('0x17')]=function(_0x41b3ad){if(this['channels'][_0x41b3ad[_0xa1eb('0x26')]]){this[_0xa1eb('0x25')][_0x41b3ad[_0xa1eb('0x26')]][_0xa1eb('0x2d')]=_0x41b3ad[_0xa1eb('0x2d')];this['channels'][_0x41b3ad[_0xa1eb('0x26')]][_0xa1eb('0x2e')]=_0x41b3ad[_0xa1eb('0x2e')];}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x18')]=function(_0xcd9efd){if(this[_0xa1eb('0x25')][_0xcd9efd[_0xa1eb('0x26')]]){for(var _0x254727 in _0xcd9efd[_0xa1eb('0x2b')]){if(_0xcd9efd[_0xa1eb('0x2b')]['hasOwnProperty'](_0x254727)){this['channels'][_0xcd9efd[_0xa1eb('0x26')]][_0x254727]=_0xcd9efd[_0xa1eb('0x2c')];}}}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x19')]=function(_0x2b345a){if(this['channels'][_0x2b345a['uniqueid']]){this[_0xa1eb('0x25')][_0x2b345a[_0xa1eb('0x26')]]['operation']=_0x2b345a['operation'];this[_0xa1eb('0x25')][_0x2b345a['uniqueid']][_0xa1eb('0x30')]=_0x2b345a['status'];this[_0xa1eb('0x25')][_0x2b345a[_0xa1eb('0x26')]][_0xa1eb('0x24')]=_0x2b345a['localstationid'];this[_0xa1eb('0x25')][_0x2b345a[_0xa1eb('0x26')]][_0xa1eb('0x31')]=_0x2b345a['filename'];logger[_0xa1eb('0x29')](_0x2b345a[_0xa1eb('0x26')],_0xa1eb('0x32'));}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x1b')]=function(_0x5912d5){var _0x53bf02=this;if(this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]]){var _0x3f9486=this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]]['id'];this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]]['remotestationid']=_0x5912d5[_0xa1eb('0x33')];this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x34')]=_0x5912d5[_0xa1eb('0x34')];this['channels'][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x24')]=_0x5912d5[_0xa1eb('0x24')];this['channels'][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x35')]=_0x5912d5[_0xa1eb('0x35')];this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x36')]=_0x5912d5[_0xa1eb('0x36')];this['channels'][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x31')]=_0x5912d5['filename'];this[_0xa1eb('0x25')][_0x5912d5['uniqueid']][_0xa1eb('0x37')]=_0x5912d5[_0xa1eb('0x37')];if(this[_0xa1eb('0x25')][_0x5912d5[_0xa1eb('0x26')]][_0xa1eb('0x34')]>0x0){tiff2pdf(_0x5912d5[_0xa1eb('0x31')],_0xa1eb('0x38'),function(_0x38d184){logger[_0xa1eb('0x29')](_0x5912d5[_0xa1eb('0x26')],_0xa1eb('0x39'),_0x38d184[_0xa1eb('0x3a')]);attachment[_0xa1eb('0x3b')]({'name':path[_0xa1eb('0x3c')](_0x5912d5[_0xa1eb('0x31')])[_0xa1eb('0x28')],'basename':path['parse'](_0x5912d5[_0xa1eb('0x31')])['name']+_0xa1eb('0x3d'),'type':_0xa1eb('0x3e')})['then'](function(_0x5b1b51){faxAccount[_0xa1eb('0x3f')](_0x3f9486,{'from':_0x5912d5[_0xa1eb('0x37')],'mapKey':_0xa1eb('0x7'),'body':path['parse'](_0x5912d5[_0xa1eb('0x31')])[_0xa1eb('0x28')]+_0xa1eb('0x3d'),'AttachmentId':_0x5b1b51['id']})[_0xa1eb('0x40')](function(_0x930a93){logger[_0xa1eb('0x41')](_0x5912d5[_0xa1eb('0x26')],_0xa1eb('0x42'),JSON[_0xa1eb('0x43')](_0x930a93));});})[_0xa1eb('0x40')](function(_0x27e4f6){logger[_0xa1eb('0x41')](_0x5912d5[_0xa1eb('0x26')],_0xa1eb('0x44'),JSON['stringify'](_0x27e4f6));});});}logger[_0xa1eb('0x29')](_0x5912d5[_0xa1eb('0x26')],_0xa1eb('0x44'));}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x1f')]=function(_0x12dfd4){if(this[_0xa1eb('0x12')][_0x12dfd4['uniqueid']]){_[_0xa1eb('0x45')](this[_0xa1eb('0x25')][_0x12dfd4[_0xa1eb('0x26')]],_[_0xa1eb('0x46')](_0x12dfd4,[_0xa1eb('0x47'),_0xa1eb('0x48')]));}};function updateStatus(_0x25e146){if(_0x25e146[_0xa1eb('0x49')]){faxMessage[_0xa1eb('0x4a')](_0x25e146['AttachmentId'],{'failMessage':_0xa1eb('0x4b')})['then'](function(_0x268b48){ut['logger'](_0xa1eb('0x4c'),_0x268b48);})[_0xa1eb('0x40')](function(_0x3fde17){ut['logger'](_0xa1eb('0x4d'),_0x3fde17);});}else{ut[_0xa1eb('0x4e')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa1eb('0x2f')][_0xa1eb('0x4f')]=function(_0x3f1833,_0x22ceef,_0x11cc84){var _0x2b27c7=this;var _0x305202={};if(_0x22ceef){_0x305202={'read':_0x22ceef};}else{_0x305202={'failMessage':_0x11cc84};}if(this[_0xa1eb('0x12')][_0x3f1833][_0xa1eb('0x49')]){faxMessage[_0xa1eb('0x4a')](this[_0xa1eb('0x12')][_0x3f1833][_0xa1eb('0x49')],_0x305202)[_0xa1eb('0x50')](function(_0x260c4a){ut[_0xa1eb('0x4e')](_0xa1eb('0x51'),_0x260c4a);})[_0xa1eb('0x40')](function(_0x589186){ut[_0xa1eb('0x4e')](_0xa1eb('0x52'),_0x589186);})[_0xa1eb('0x53')](function(){delete _0x2b27c7[_0xa1eb('0x25')][_0x3f1833];delete _0x2b27c7[_0xa1eb('0x12')][_0x3f1833];});}else{ut[_0xa1eb('0x4e')]('[Fax][Message][NoUpdate2]');delete this[_0xa1eb('0x25')][_0x3f1833];delete this[_0xa1eb('0x12')][_0x3f1833];}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x1d')]=function(_0xa46d79){var _0x1e01f2=this;if(this[_0xa1eb('0x25')][_0xa46d79['uniqueid']]){if(this[_0xa1eb('0x12')][_0xa46d79[_0xa1eb('0x26')]]){this[_0xa1eb('0x25')][_0xa46d79[_0xa1eb('0x26')]]['id']=this['actions'][_0xa46d79['uniqueid']]['id'];this['channels'][_0xa46d79['uniqueid']][_0xa1eb('0x28')]=this[_0xa1eb('0x12')][_0xa46d79['uniqueid']][_0xa1eb('0x28')];}logger[_0xa1eb('0x29')](_0xa46d79[_0xa1eb('0x26')],this[_0xa1eb('0x12')][_0xa46d79['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xa1eb('0x54'),JSON[_0xa1eb('0x43')](this[_0xa1eb('0x25')][_0xa46d79[_0xa1eb('0x26')]]));if(this[_0xa1eb('0x12')][_0xa46d79[_0xa1eb('0x26')]]){if(this['channels'][_0xa46d79['uniqueid']][_0xa1eb('0x55')]>0x0&&this['channels'][_0xa46d79[_0xa1eb('0x26')]]['faxstatus']===_0xa1eb('0x56')){this[_0xa1eb('0x4f')](_0xa46d79['uniqueid'],!![]);}else{this[_0xa1eb('0x4f')](_0xa46d79[_0xa1eb('0x26')],![],this['channels'][_0xa46d79[_0xa1eb('0x26')]][_0xa1eb('0x57')]?_0xa1eb('0x58')+this['channels'][_0xa46d79[_0xa1eb('0x26')]][_0xa1eb('0x57')]:'SENDING\x20FAILED');}}}};Fax[_0xa1eb('0x2f')][_0xa1eb('0x59')]=function(_0x139a37){var _0x4a0545=this;return new BPromise(function(_0x3a43c3,_0x5aa916){_0x4a0545[_0xa1eb('0x5a')](_0x139a37,_0x4a0545[_0xa1eb('0x10')][_0x139a37[_0xa1eb('0x5b')]])[_0xa1eb('0x50')](function(_0x2df867){ut['logger'](_0xa1eb('0x5c'),_0x2df867);_0x3a43c3(ut[_0xa1eb('0x3a')](_0xa1eb('0x5d')));})['catch'](function(_0x243203){ut['logger']('[Fax][execOriginate][failure]',_0x243203);updateStatus(_0x139a37);_0x5aa916(ut['message']('Fax\x20failed'));});});};Fax[_0xa1eb('0x2f')][_0xa1eb('0x5e')]=function(_0x29319e){var _0x4039de=this;return new BPromise(function(_0x149de3,_0x99ce4f){var _0x11f031=_0x4039de[_0xa1eb('0x5f')](_0x4039de[_0xa1eb('0x10')][_0x29319e[_0xa1eb('0x5b')]]['Trunk'],_0x29319e);if(_0x11f031[_0xa1eb('0x60')]){_0x149de3(ut[_0xa1eb('0x3a')](_0xa1eb('0x61')));}else{_0x99ce4f(ut[_0xa1eb('0x3a')](_0x11f031[_0xa1eb('0x3a')]));}});};function originate(_0x4593f6,_0x4bf3c9,_0x113a3a){return new BPromise(function(_0x2b6996,_0x16c5a3){if(_0x113a3a){var _0x58147f=util[_0xa1eb('0x62')](_0xa1eb('0x63'),path[_0xa1eb('0x3c')](_0x4593f6[_0xa1eb('0x64')])[_0xa1eb('0x28')],_0x4593f6['path']);gs[_0xa1eb('0x65')](_0x58147f)['then'](function(){_0x4593f6[_0xa1eb('0x64')]=util['format'](_0xa1eb('0x66'),path[_0xa1eb('0x3c')](_0x4593f6[_0xa1eb('0x64')])[_0xa1eb('0x67')],path['parse'](_0x4593f6[_0xa1eb('0x64')])[_0xa1eb('0x28')]);_0x4bf3c9[_0xa1eb('0x68')]=_0x4593f6[_0xa1eb('0x64')];ut['logger'](_0xa1eb('0x69'),'');ami[_0xa1eb('0x6a')](ut[_0xa1eb('0x6b')](_0x4593f6,_0x4bf3c9))[_0xa1eb('0x50')](function(_0x2a2b27){_0x2b6996(_0x2a2b27);})[_0xa1eb('0x40')](function(_0x389e44){_0x16c5a3(_0x389e44);});})[_0xa1eb('0x40')](function(_0x20642f){_0x16c5a3(_0x20642f);});}else{ami['Action'](ut['variablesAction'](_0x4593f6,_0x4bf3c9))['then'](function(_0x43525b){_0x2b6996(_0x43525b);})['catch'](function(_0xa5810){_0x16c5a3(_0xa5810);});}});}Fax[_0xa1eb('0x2f')]['execOriginate']=function(_0x52522a,_0xdcaac3){var _0x1fae13=this;return new BPromise(function(_0x3c2a89,_0x6027f7){var _0x470489=uuid['v4']();var _0x574be4=ut['addVariables'](_0x52522a,_0xdcaac3);_0x1fae13[_0xa1eb('0x12')][_0x470489]=new Action(_0x470489,_0xdcaac3,_0x52522a);var _0x212e57=_0x1fae13[_0xa1eb('0x12')][_0x470489];if(path[_0xa1eb('0x3c')](_0x52522a['path'])[_0xa1eb('0x6c')]===_0xa1eb('0x3d')){originate(_0x212e57,_0x574be4,!![])[_0xa1eb('0x50')](function(_0x4050d6){_0x3c2a89(_0x4050d6);})[_0xa1eb('0x40')](function(_0x37d8c4){_0x6027f7(_0x37d8c4);});}else{originate(_0x212e57,_0x574be4,![])[_0xa1eb('0x50')](function(_0x3690c6){_0x3c2a89(_0x3690c6);})[_0xa1eb('0x40')](function(_0x168446){_0x6027f7(_0x168446);});}});};Fax[_0xa1eb('0x2f')]['isTrunkReachable']=function(_0x21d884){return!_[_0xa1eb('0x6d')](_0x21d884)&&!_[_0xa1eb('0x6d')](_0x21d884[_0xa1eb('0x28')])&&!_[_0xa1eb('0x6d')](_0x21d884[_0xa1eb('0x6e')])&&_0x21d884['active']&&!_[_0xa1eb('0x6d')](this[_0xa1eb('0x11')][util[_0xa1eb('0x62')](_0xa1eb('0x6f'),_0x21d884['name'])])&&!_['isNil'](this[_0xa1eb('0x11')][util['format'](_0xa1eb('0x6f'),_0x21d884[_0xa1eb('0x28')])]['status'])&&(this[_0xa1eb('0x11')][util[_0xa1eb('0x62')]('SIP/%s',_0x21d884[_0xa1eb('0x28')])][_0xa1eb('0x30')]===_0xa1eb('0x70')||this[_0xa1eb('0x11')][util[_0xa1eb('0x62')](_0xa1eb('0x6f'),_0x21d884[_0xa1eb('0x28')])][_0xa1eb('0x30')]===_0xa1eb('0x71'));};Fax[_0xa1eb('0x2f')][_0xa1eb('0x5f')]=function(_0x4e1c2e,_0xd4769f){if(!this[_0xa1eb('0x72')](_0x4e1c2e)){ut[_0xa1eb('0x4e')](_0xa1eb('0x73'),_['isNil'](_0x4e1c2e)?'':_0x4e1c2e[_0xa1eb('0x28')]+_0xa1eb('0x74'));return{'isValid':![],'message':_0xa1eb('0x75')};}if(_['isNil'](_0xd4769f[_0xa1eb('0x7')])){ut[_0xa1eb('0x4e')](_0xa1eb('0x76'),JSON['stringify'](_0xd4769f));return{'isValid':![],'message':_0xa1eb('0x77')};}if(_['isNil'](_0xd4769f[_0xa1eb('0x64')])){ut[_0xa1eb('0x4e')](_0xa1eb('0x78'),JSON[_0xa1eb('0x43')](_0xd4769f));return{'isValid':![],'message':_0xa1eb('0x79')};}return{'isValid':!![],'message':_0xa1eb('0x7a')};};module[_0xa1eb('0x7b')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 9f27c7e..b2d6be4 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 _0x57a2=['lodash','../rpc/faxAccount','error','inspect','notify','then','catch','bluebird','../../../config/logger','preview'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x57a2,0x1bf));var _0x257a=function(_0x129bbe,_0x22b507){_0x129bbe=_0x129bbe-0x0;var _0x3a50e2=_0x57a2[_0x129bbe];return _0x3a50e2;};'use strict';var util=require('util');var BPromise=require(_0x257a('0x0'));var logger=require(_0x257a('0x1'))(_0x257a('0x2'));var _=require(_0x257a('0x3'));var faxAccount=require(_0x257a('0x4'));function loggerCatch(_0x30ccf7){return function(_0x5203a2){logger[_0x257a('0x5')](_0x30ccf7,util[_0x257a('0x6')](_0x5203a2,{'showHidden':![],'depth':null}));};}exports[_0x257a('0x7')]=function(_0x4801a6,_0x32591f){return BPromise['resolve']()[_0x257a('0x8')](faxAccount[_0x257a('0x7')](_0x4801a6,_0x32591f))[_0x257a('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xdbcd=['[Notify]\x20','../../../config/logger','preview','../rpc/faxAccount','inspect','notify','resolve','then','catch'];(function(_0x2492f2,_0x24ce6d){var _0x4454db=function(_0x4251f7){while(--_0x4251f7){_0x2492f2['push'](_0x2492f2['shift']());}};_0x4454db(++_0x24ce6d);}(_0xdbcd,0x106));var _0xddbc=function(_0x203989,_0x1f2b3d){_0x203989=_0x203989-0x0;var _0x44da32=_0xdbcd[_0x203989];return _0x44da32;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xddbc('0x0'))(_0xddbc('0x1'));var _=require('lodash');var faxAccount=require(_0xddbc('0x2'));function loggerCatch(_0x373c23){return function(_0x1f4496){logger['error'](_0x373c23,util[_0xddbc('0x3')](_0x1f4496,{'showHidden':![],'depth':null}));};}exports[_0xddbc('0x4')]=function(_0x589f2d,_0x1f9bff){return BPromise[_0xddbc('0x5')]()[_0xddbc('0x6')](faxAccount[_0xddbc('0x4')](_0x589f2d,_0x1f9bff))[_0xddbc('0x7')](loggerCatch(_0xddbc('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index d6de41a..f4b17da 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 _0x64b5=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x1f7f4a,_0x416530){var _0x5ef180=function(_0x3bc066){while(--_0x3bc066){_0x1f7f4a['push'](_0x1f7f4a['shift']());}};_0x5ef180(++_0x416530);}(_0x64b5,0x78));var _0x564b=function(_0x1270cf,_0x4833a9){_0x1270cf=_0x1270cf-0x0;var _0x2221f0=_0x64b5[_0x1270cf];return _0x2221f0;};'use strict';var util=require(_0x564b('0x0'));var logger=require(_0x564b('0x1'))(_0x564b('0x2'));var BPromise=require(_0x564b('0x3'));var exec=require(_0x564b('0x4'))[_0x564b('0x5')];exports[_0x564b('0x6')]=function(_0x41e1fd){return new BPromise(function(_0x17c16d,_0x33c360){exec(_0x41e1fd,function(_0x23bf12,_0x351c19,_0x5834e9){logger[_0x564b('0x7')](_0x564b('0x8'),_0x351c19);if(_0x23bf12){logger[_0x564b('0x7')](_0x564b('0x8'),_0x564b('0x9'),util['inspect'](_0x23bf12,{'showHidden':![],'depth':null}),_0x351c19,_0x5834e9);_0x33c360(_0x23bf12);}_0x17c16d(_0x351c19);});});}; \ No newline at end of file +var _0xf6aa=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6aa,0x1f2));var _0xaf6a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf6aa[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xaf6a('0x0'));var logger=require(_0xaf6a('0x1'))(_0xaf6a('0x2'));var BPromise=require(_0xaf6a('0x3'));var exec=require(_0xaf6a('0x4'))[_0xaf6a('0x5')];exports[_0xaf6a('0x6')]=function(_0x3c5912){return new BPromise(function(_0x4b3c25,_0x31967a){exec(_0x3c5912,function(_0x12ca04,_0x5eeb4d,_0x2c9879){logger['info']('Exec\x20gs',_0x5eeb4d);if(_0x12ca04){logger[_0xaf6a('0x7')](_0xaf6a('0x8'),'\x20Error\x20:',util[_0xaf6a('0x9')](_0x12ca04,{'showHidden':![],'depth':null}),_0x5eeb4d,_0x2c9879);_0x31967a(_0x12ca04);}_0x4b3c25(_0x5eeb4d);});});}; \ 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 3743630..87ce196 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 _0x66f9=['originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','fax','message','logger','inspect','addVariables','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid'];(function(_0x1d10d0,_0x3eab81){var _0x4074f1=function(_0x44d8e8){while(--_0x44d8e8){_0x1d10d0['push'](_0x1d10d0['shift']());}};_0x4074f1(++_0x3eab81);}(_0x66f9,0xa7));var _0x966f=function(_0xb9d1b,_0xda547c){_0xb9d1b=_0xb9d1b-0x0;var _0x7837=_0x66f9[_0xb9d1b];return _0x7837;};'use strict';var util=require(_0x966f('0x0'));var _=require(_0x966f('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x966f('0x2'));exports[_0x966f('0x3')]=function(_0x367ce9){return{'message':_0x367ce9};};exports[_0x966f('0x4')]=function(_0x283325,_0x4a7e2e){logger['info'](_0x283325,util[_0x966f('0x5')](_0x4a7e2e,{'showHidden':![],'depth':null}));};exports[_0x966f('0x6')]=function(_0x1dd61f,_0x349e0b){var _0x123151={'XMF-ECM':_0x349e0b['ecm'],'XMF-HEADERINFO':_0x349e0b['headerinfo'],'XMF-MINRATE':_0x349e0b['minrate'],'XMF-MAXRATE':_0x349e0b['maxrate'],'XMF-MODEM':util['format'](_0x966f('0x7'),_0x349e0b[_0x966f('0x8')]),'XMF-GATEWAY':_0x349e0b[_0x966f('0x9')],'XMF-FAXDETECT':_0x349e0b[_0x966f('0xa')],'XMF-T38TIMEOUT':_0x349e0b[_0x966f('0xb')],'XMF-LOCALSTATIONID':_0x349e0b[_0x966f('0xc')],'XMF-PATH':_0x1dd61f['path']};return _0x123151;};exports['variablesAction']=function(_0x3673f2,_0x39320c){return{'actionid':_0x3673f2['uniqueid'],'action':_0x966f('0xd'),'channel':_0x3673f2['channel'],'Exten':_0x966f('0xe'),'Context':_0x966f('0xf'),'Priority':'1','callerid':util['format'](_0x966f('0x10'),_0x3673f2['headerinfo']?_0x3673f2[_0x966f('0x11')]:'',_0x3673f2[_0x966f('0xc')]),'variable':_0x39320c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3673f2['uniqueid']};}; \ No newline at end of file +var _0x778e=['originate','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','util','moment','../../../../config/logger','logger','info','inspect','addVariables','headerinfo','modem','path','variablesAction','uniqueid'];(function(_0x2e25af,_0x4e8b6e){var _0x532bf2=function(_0x442b19){while(--_0x442b19){_0x2e25af['push'](_0x2e25af['shift']());}};_0x532bf2(++_0x4e8b6e);}(_0x778e,0x154));var _0xe778=function(_0x2e1b29,_0x4c421b){_0x2e1b29=_0x2e1b29-0x0;var _0x167f68=_0x778e[_0x2e1b29];return _0x167f68;};'use strict';var util=require(_0xe778('0x0'));var _=require('lodash');var moment=require(_0xe778('0x1'));var logger=require(_0xe778('0x2'))('fax');exports['message']=function(_0x1704fd){return{'message':_0x1704fd};};exports[_0xe778('0x3')]=function(_0x4f4a9f,_0x250f59){logger[_0xe778('0x4')](_0x4f4a9f,util[_0xe778('0x5')](_0x250f59,{'showHidden':![],'depth':null}));};exports[_0xe778('0x6')]=function(_0x37e41a,_0x5034d1){var _0x36257c={'XMF-ECM':_0x5034d1['ecm'],'XMF-HEADERINFO':_0x5034d1[_0xe778('0x7')],'XMF-MINRATE':_0x5034d1['minrate'],'XMF-MAXRATE':_0x5034d1['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x5034d1[_0xe778('0x8')]),'XMF-GATEWAY':_0x5034d1['gateway'],'XMF-FAXDETECT':_0x5034d1['faxdetect'],'XMF-T38TIMEOUT':_0x5034d1['t38timeout'],'XMF-LOCALSTATIONID':_0x5034d1['localstationid'],'XMF-PATH':_0x37e41a[_0xe778('0x9')]};return _0x36257c;};exports[_0xe778('0xa')]=function(_0x550bad,_0x29f1d5){return{'actionid':_0x550bad[_0xe778('0xb')],'action':_0xe778('0xc'),'channel':_0x550bad['channel'],'Exten':_0xe778('0xd'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0xe778('0xe'),_0x550bad[_0xe778('0x7')]?_0x550bad[_0xe778('0x7')]:'',_0x550bad[_0xe778('0xf')]),'variable':_0x29f1d5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x550bad[_0xe778('0xb')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 199fa18..a800cb7 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 _0x7805=['./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/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','catch','[index.js][main]','bluebird','moment','./server','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger'];(function(_0x502e76,_0x2594d5){var _0xccf8a7=function(_0x4c79f3){while(--_0x4c79f3){_0x502e76['push'](_0x502e76['shift']());}};_0xccf8a7(++_0x2594d5);}(_0x7805,0x1a3));var _0x5780=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x7805[_0xe66cf2];return _0x2d84e7;};'use strict';var BPromise=require(_0x5780('0x0'));var util=require('util');var moment=require(_0x5780('0x1'));var server=require(_0x5780('0x2'));var Realtime=require(_0x5780('0x3'));var Report=require('./report');var Acw=require(_0x5780('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x5780('0x5'));var Preview=require(_0x5780('0x6'));var Fax=require(_0x5780('0x7'));var user=require(_0x5780('0x8'));var voiceQueue=require(_0x5780('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5780('0xa'));var trunk=require(_0x5780('0xb'));var trigger=require(_0x5780('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5780('0xd'));var campaign=require(_0x5780('0xe'));var voiceExtension=require(_0x5780('0xf'));var faxAccount=require(_0x5780('0x10'));var zendesk=require(_0x5780('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x5780('0x12'));var freshdesk=require(_0x5780('0x13'));var desk=require(_0x5780('0x14'));var zoho=require(_0x5780('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x5780('0x16'));var servicenow=require(_0x5780('0x17'));var dynamics365=require(_0x5780('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5780('0x19'))(_0x5780('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x5780('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5780('0x1c')]()[_0x5780('0x1d')](user['getAgents']())['then'](realtime[_0x5780('0x1e')]())[_0x5780('0x1d')](user[_0x5780('0x1f')]())[_0x5780('0x1d')](realtime[_0x5780('0x20')]())[_0x5780('0x1d')](trunk[_0x5780('0x21')]())[_0x5780('0x1d')](realtime[_0x5780('0x22')]())['then'](voiceQueue[_0x5780('0x23')]())[_0x5780('0x1d')](realtime[_0x5780('0x24')]())[_0x5780('0x1d')](trigger[_0x5780('0x25')]())['then'](realtime['initTriggers']())['then'](template[_0x5780('0x26')]())[_0x5780('0x1d')](realtime[_0x5780('0x27')]())[_0x5780('0x1d')](zendesk[_0x5780('0x28')]())[_0x5780('0x1d')](realtime[_0x5780('0x29')]())[_0x5780('0x1d')](salesforce[_0x5780('0x2a')]())[_0x5780('0x1d')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x5780('0x2b')]())[_0x5780('0x1d')](realtime[_0x5780('0x2c')]())['then'](freshdesk[_0x5780('0x2d')]())['then'](realtime[_0x5780('0x2e')]())[_0x5780('0x1d')](desk[_0x5780('0x2f')]())[_0x5780('0x1d')](realtime['initDeskAccounts']())[_0x5780('0x1d')](zoho[_0x5780('0x30')]())[_0x5780('0x1d')](realtime[_0x5780('0x31')]())['then'](vtiger[_0x5780('0x32')]())[_0x5780('0x1d')](realtime[_0x5780('0x33')]())[_0x5780('0x1d')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x5780('0x34')]())['then'](servicenow['getServicenowAccounts']())[_0x5780('0x1d')](realtime[_0x5780('0x35')]())[_0x5780('0x1d')](dynamics365[_0x5780('0x36')]())[_0x5780('0x1d')](realtime[_0x5780('0x37')]())[_0x5780('0x1d')](campaign[_0x5780('0x38')]())[_0x5780('0x1d')](realtime[_0x5780('0x39')]())['then'](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x5780('0x3a')]())[_0x5780('0x1d')](faxAccount[_0x5780('0x3b')]())[_0x5780('0x1d')](realtime[_0x5780('0x3c')]())[_0x5780('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x5780('0x1c')]()[_0x5780('0x1d')](voiceQueueReport[_0x5780('0x3d')]())[_0x5780('0x1d')](realtime['initVoiceQueueReports']())[_0x5780('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x5780('0x1d')](realtime[_0x5780('0x3e')]())[_0x5780('0x1d')](cmHopperHistory[_0x5780('0x3f')]())[_0x5780('0x1d')](realtime[_0x5780('0x40')]())[_0x5780('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x5780('0x1d')](realtime[_0x5780('0x41')]())['catch'](function(_0x4f0817){logger[_0x5780('0x42')](_0x5780('0x43'),util[_0x5780('0x44')](_0x4f0817,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5780('0x45')](realtime,preview,fax)['then'](function(_0xcb760d){return initRealtime();})[_0x5780('0x1d')](function(){return initParams();})[_0x5780('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x5780('0x46')](function(_0x2db58d){logger[_0x5780('0x42')](_0x5780('0x47'),util[_0x5780('0x44')](_0x2db58d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x6323=['getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','[index.js][initParams]','inspect','listen','sync','error','moment','./server','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0x328597,_0x2875e6){var _0x44de7e=function(_0x4a387b){while(--_0x4a387b){_0x328597['push'](_0x328597['shift']());}};_0x44de7e(++_0x2875e6);}(_0x6323,0x1de));var _0x3632=function(_0x4b1a5e,_0xfd5ac){_0x4b1a5e=_0x4b1a5e-0x0;var _0x251b9d=_0x6323[_0x4b1a5e];return _0x251b9d;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x3632('0x0'));var server=require(_0x3632('0x1'));var Realtime=require(_0x3632('0x2'));var Report=require(_0x3632('0x3'));var Acw=require(_0x3632('0x4'));var Trigger=require(_0x3632('0x5'));var Dialer=require('./dialer');var Preview=require(_0x3632('0x6'));var Fax=require('./fax');var user=require(_0x3632('0x7'));var voiceQueue=require(_0x3632('0x8'));var voiceQueueReport=require(_0x3632('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x3632('0xa'));var template=require(_0x3632('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x3632('0xc'));var faxAccount=require(_0x3632('0xd'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x3632('0xe'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x3632('0xf'));var desk=require(_0x3632('0x10'));var zoho=require(_0x3632('0x11'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x3632('0x12'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x3632('0x13'))(_0x3632('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3632('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x3632('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3632('0x17')](user[_0x3632('0x18')]())[_0x3632('0x17')](realtime[_0x3632('0x19')]())['then'](user[_0x3632('0x1a')]())['then'](realtime[_0x3632('0x1b')]())[_0x3632('0x17')](trunk[_0x3632('0x1c')]())[_0x3632('0x17')](realtime[_0x3632('0x1d')]())[_0x3632('0x17')](voiceQueue[_0x3632('0x1e')]())['then'](realtime[_0x3632('0x1f')]())['then'](trigger['getTriggers']())[_0x3632('0x17')](realtime[_0x3632('0x20')]())['then'](template[_0x3632('0x21')]())[_0x3632('0x17')](realtime[_0x3632('0x22')]())[_0x3632('0x17')](zendesk[_0x3632('0x23')]())[_0x3632('0x17')](realtime[_0x3632('0x24')]())[_0x3632('0x17')](salesforce[_0x3632('0x25')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x3632('0x26')]())[_0x3632('0x17')](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x3632('0x17')](realtime[_0x3632('0x27')]())[_0x3632('0x17')](desk[_0x3632('0x28')]())[_0x3632('0x17')](realtime[_0x3632('0x29')]())['then'](zoho[_0x3632('0x2a')]())['then'](realtime['initZohoAccounts']())[_0x3632('0x17')](vtiger[_0x3632('0x2b')]())[_0x3632('0x17')](realtime[_0x3632('0x2c')]())[_0x3632('0x17')](freshsales['getFreshsalesAccounts']())[_0x3632('0x17')](realtime[_0x3632('0x2d')]())[_0x3632('0x17')](servicenow[_0x3632('0x2e')]())[_0x3632('0x17')](realtime[_0x3632('0x2f')]())['then'](dynamics365['getDynamics365Accounts']())[_0x3632('0x17')](realtime[_0x3632('0x30')]())[_0x3632('0x17')](campaign[_0x3632('0x31')]())[_0x3632('0x17')](realtime[_0x3632('0x32')]())[_0x3632('0x17')](voiceExtension[_0x3632('0x33')]())[_0x3632('0x17')](realtime[_0x3632('0x34')]())[_0x3632('0x17')](faxAccount[_0x3632('0x35')]())[_0x3632('0x17')](realtime[_0x3632('0x36')]())[_0x3632('0x17')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x3632('0x37')]())[_0x3632('0x17')](realtime['initVoiceQueueReports']())[_0x3632('0x17')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x3632('0x17')](realtime[_0x3632('0x38')]())[_0x3632('0x17')](cmHopperHistory[_0x3632('0x39')]())[_0x3632('0x17')](realtime[_0x3632('0x3a')]())[_0x3632('0x17')](voiceCallReport['getVoiceCallReports']())[_0x3632('0x17')](realtime['initVoiceCallReports']())[_0x3632('0x3b')](function(_0x2a6428){logger['error'](_0x3632('0x3c'),util[_0x3632('0x3d')](_0x2a6428,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3632('0x3e')](realtime,preview,fax)[_0x3632('0x17')](function(_0x4b7b6b){return initRealtime();})['then'](function(){return initParams();})[_0x3632('0x17')](function(){report[_0x3632('0x3f')]();setInterval(initRealtime,0x1388);})[_0x3632('0x3b')](function(_0x5503fa){logger[_0x3632('0x40')]('[index.js][main]',util[_0x3632('0x3d')](_0x5503fa,{'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 cd1de86..d6bcdca 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x42b200,_0x5a1aef){var _0x4d202e=function(_0x12c139){while(--_0x12c139){_0x42b200['push'](_0x42b200['shift']());}};_0x4d202e(++_0x5a1aef);}(_0xe706,0xa3));var _0x6e70=function(_0xaec7d,_0x44dce6){_0xaec7d=_0xaec7d-0x0;var _0x54a0ce=_0xe706[_0xaec7d];return _0x54a0ce;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x25a095,_0x3e63a3){var _0x2b7205=function(_0x5f7c58){while(--_0x5f7c58){_0x25a095['push'](_0x25a095['shift']());}};_0x2b7205(++_0x3e63a3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 93abd20..bbb4b51 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 _0xb92d=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xb92d,0x107));var _0xdb92=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0xb92d[_0x1ca93c];return _0x185169;};'use strict';function Campaign(_0x1bf5ca){this['id']=_0x1bf5ca['id']||0x0;this[_0xdb92('0x0')]=_0x1bf5ca[_0xdb92('0x0')]||'';this['type']=_0x1bf5ca[_0xdb92('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this[_0xdb92('0x2')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xdb92('0x3')]=!![];this[_0xdb92('0x4')]=_0x1bf5ca['active'];this[_0xdb92('0x5')]=_0x1bf5ca[_0xdb92('0x5')];this[_0xdb92('0x6')]=_0x1bf5ca[_0xdb92('0x6')]||null;this[_0xdb92('0x7')]=_0x1bf5ca['dialGlobalInterval']?_0x1bf5ca[_0xdb92('0x7')]:null;this[_0xdb92('0x8')]=_0x1bf5ca[_0xdb92('0x8')];this[_0xdb92('0x9')]=_0x1bf5ca[_0xdb92('0x9')];this['dialOriginateTimeout']=_0x1bf5ca[_0xdb92('0xa')]||0x1e;this[_0xdb92('0xb')]=_0x1bf5ca[_0xdb92('0xb')];this['dialCongestionRetryFrequency']=_0x1bf5ca[_0xdb92('0xc')];this[_0xdb92('0xd')]=_0x1bf5ca['dialBusyMaxRetry'];this[_0xdb92('0xe')]=_0x1bf5ca['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1bf5ca[_0xdb92('0xf')];this[_0xdb92('0x10')]=_0x1bf5ca[_0xdb92('0x10')];this['dialGlobalMaxRetry']=_0x1bf5ca[_0xdb92('0x11')];this[_0xdb92('0x12')]=_0x1bf5ca[_0xdb92('0x12')]||0x3;this[_0xdb92('0x13')]=_0x1bf5ca['dialNoSuchNumberRetryFrequency']||0x96;this[_0xdb92('0x14')]=_0x1bf5ca[_0xdb92('0x14')]||0x3;this['dialDropRetryFrequency']=_0x1bf5ca[_0xdb92('0x15')]||0x96;this[_0xdb92('0x16')]=_0x1bf5ca['dialAbandonedMaxRetry']||0x3;this[_0xdb92('0x17')]=_0x1bf5ca[_0xdb92('0x17')]||0x96;this['dialMachineMaxRetry']=_0x1bf5ca[_0xdb92('0x18')]||0x3;this[_0xdb92('0x19')]=_0x1bf5ca[_0xdb92('0x19')]||0x96;this[_0xdb92('0x1a')]=_0x1bf5ca[_0xdb92('0x1a')]||0x3;this[_0xdb92('0x1b')]=_0x1bf5ca['dialAgentRejectRetryFrequency']||0x96;this[_0xdb92('0x1c')]=_0x1bf5ca[_0xdb92('0x1c')]||'DESC';this[_0xdb92('0x1d')]=_0x1bf5ca['dialPrefix']||undefined;this[_0xdb92('0x1e')]=_0x1bf5ca[_0xdb92('0x1e')]||undefined;this[_0xdb92('0x1f')]=_0x1bf5ca['dialCutDigit']||undefined;this[_0xdb92('0x20')]=_0x1bf5ca[_0xdb92('0x20')]?_0x1bf5ca[_0xdb92('0x20')]:undefined;this[_0xdb92('0x21')]=_0x1bf5ca['Trunk']?_0x1bf5ca[_0xdb92('0x21')]:undefined;this[_0xdb92('0x22')]=_0x1bf5ca[_0xdb92('0x22')]?_0x1bf5ca[_0xdb92('0x22')]:undefined;this['SquareProject']=_0x1bf5ca['SquareProject']?_0x1bf5ca[_0xdb92('0x23')]:undefined;this[_0xdb92('0x24')]=_0x1bf5ca[_0xdb92('0x23')]?_0x1bf5ca[_0xdb92('0x23')][_0xdb92('0x0')]:undefined;this[_0xdb92('0x25')]=_0x1bf5ca[_0xdb92('0x25')]||![];this[_0xdb92('0x26')]=_0x1bf5ca[_0xdb92('0x26')];this['dialAMDGreeting']=_0x1bf5ca[_0xdb92('0x27')];this[_0xdb92('0x28')]=_0x1bf5ca[_0xdb92('0x28')];this[_0xdb92('0x29')]=_0x1bf5ca[_0xdb92('0x29')];this['dialAMDMinWordLength']=_0x1bf5ca[_0xdb92('0x2a')];this[_0xdb92('0x2b')]=_0x1bf5ca[_0xdb92('0x2b')];this[_0xdb92('0x2c')]=_0x1bf5ca[_0xdb92('0x2c')];this[_0xdb92('0x2d')]=_0x1bf5ca['dialAMDSilenceThreshold'];this[_0xdb92('0x2e')]=_0x1bf5ca[_0xdb92('0x2e')];}module[_0xdb92('0x2f')]=Campaign; \ No newline at end of file +var _0xf65c=['dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0xf65c,0x1e2));var _0xcf65=function(_0x59ed90,_0x290d6a){_0x59ed90=_0x59ed90-0x0;var _0x3544d8=_0xf65c[_0x59ed90];return _0x3544d8;};'use strict';function Campaign(_0x4d60f4){this['id']=_0x4d60f4['id']||0x0;this[_0xcf65('0x0')]=_0x4d60f4[_0xcf65('0x0')]||'';this['type']=_0x4d60f4[_0xcf65('0x1')]||_0xcf65('0x2');this[_0xcf65('0x3')]=0x0;this[_0xcf65('0x4')]=0x0;this[_0xcf65('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xcf65('0x6')]='';this[_0xcf65('0x7')]=!![];this[_0xcf65('0x8')]=_0x4d60f4[_0xcf65('0x8')];this[_0xcf65('0x9')]=_0x4d60f4[_0xcf65('0x9')];this[_0xcf65('0xa')]=_0x4d60f4[_0xcf65('0xa')]||null;this['dialGlobalInterval']=_0x4d60f4[_0xcf65('0xb')]?_0x4d60f4[_0xcf65('0xb')]:null;this['dialOriginateCallerIdName']=_0x4d60f4[_0xcf65('0xc')];this[_0xcf65('0xd')]=_0x4d60f4[_0xcf65('0xd')];this[_0xcf65('0xe')]=_0x4d60f4[_0xcf65('0xe')]||0x1e;this[_0xcf65('0xf')]=_0x4d60f4[_0xcf65('0xf')];this[_0xcf65('0x10')]=_0x4d60f4[_0xcf65('0x10')];this[_0xcf65('0x11')]=_0x4d60f4[_0xcf65('0x11')];this[_0xcf65('0x12')]=_0x4d60f4[_0xcf65('0x12')];this['dialNoAnswerMaxRetry']=_0x4d60f4[_0xcf65('0x13')];this['dialNoAnswerRetryFrequency']=_0x4d60f4[_0xcf65('0x14')];this[_0xcf65('0x15')]=_0x4d60f4[_0xcf65('0x15')];this[_0xcf65('0x16')]=_0x4d60f4[_0xcf65('0x16')]||0x3;this[_0xcf65('0x17')]=_0x4d60f4[_0xcf65('0x17')]||0x96;this[_0xcf65('0x18')]=_0x4d60f4[_0xcf65('0x18')]||0x3;this['dialDropRetryFrequency']=_0x4d60f4[_0xcf65('0x19')]||0x96;this[_0xcf65('0x1a')]=_0x4d60f4[_0xcf65('0x1a')]||0x3;this[_0xcf65('0x1b')]=_0x4d60f4[_0xcf65('0x1b')]||0x96;this[_0xcf65('0x1c')]=_0x4d60f4[_0xcf65('0x1c')]||0x3;this[_0xcf65('0x1d')]=_0x4d60f4[_0xcf65('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x4d60f4[_0xcf65('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4d60f4['dialAgentRejectRetryFrequency']||0x96;this[_0xcf65('0x1f')]=_0x4d60f4[_0xcf65('0x1f')]||'DESC';this[_0xcf65('0x20')]=_0x4d60f4[_0xcf65('0x20')]||undefined;this[_0xcf65('0x21')]=_0x4d60f4[_0xcf65('0x21')]||undefined;this[_0xcf65('0x22')]=_0x4d60f4[_0xcf65('0x22')]||undefined;this[_0xcf65('0x23')]=_0x4d60f4['TrunkBackup']?_0x4d60f4['TrunkBackup']:undefined;this[_0xcf65('0x24')]=_0x4d60f4[_0xcf65('0x24')]?_0x4d60f4[_0xcf65('0x24')]:undefined;this[_0xcf65('0x25')]=_0x4d60f4['Interval']?_0x4d60f4['Interval']:undefined;this['SquareProject']=_0x4d60f4['SquareProject']?_0x4d60f4[_0xcf65('0x26')]:undefined;this[_0xcf65('0x27')]=_0x4d60f4[_0xcf65('0x26')]?_0x4d60f4[_0xcf65('0x26')]['name']:undefined;this['dialAMDActive']=_0x4d60f4[_0xcf65('0x28')]||![];this[_0xcf65('0x29')]=_0x4d60f4[_0xcf65('0x29')];this[_0xcf65('0x2a')]=_0x4d60f4[_0xcf65('0x2a')];this[_0xcf65('0x2b')]=_0x4d60f4['dialAMDAfterGreetingSilence'];this[_0xcf65('0x2c')]=_0x4d60f4[_0xcf65('0x2c')];this['dialAMDMinWordLength']=_0x4d60f4[_0xcf65('0x2d')];this[_0xcf65('0x2e')]=_0x4d60f4[_0xcf65('0x2e')];this[_0xcf65('0x2f')]=_0x4d60f4[_0xcf65('0x2f')];this['dialAMDSilenceThreshold']=_0x4d60f4[_0xcf65('0x30')];this[_0xcf65('0x31')]=_0x4d60f4['dialAMDMaximumWordLength'];}module[_0xcf65('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 326945f..4caa347 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 _0x1dcd=['monitor','monitorFilename','queue','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1dcd,0x100));var _0xd1dc=function(_0x1e9b7b,_0x17843a){_0x1e9b7b=_0x1e9b7b-0x0;var _0x42352f=_0x1dcd[_0x1e9b7b];return _0x42352f;};'use strict';function Channel(){this[_0xd1dc('0x0')]=null;this[_0xd1dc('0x1')]='';this[_0xd1dc('0x2')]='';this[_0xd1dc('0x3')]=0x0;this[_0xd1dc('0x4')]='';this[_0xd1dc('0x5')]=undefined;this[_0xd1dc('0x6')]=undefined;this['accountcode']=0x0;this[_0xd1dc('0x7')]='';this[_0xd1dc('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this['answered']=![];this[_0xd1dc('0x9')]=null;this['endtime']=null;this[_0xd1dc('0xa')]=![];this[_0xd1dc('0xb')]=![];this[_0xd1dc('0xc')]='';this[_0xd1dc('0xd')]='';this['duration']=0x0;this[_0xd1dc('0xe')]=0x0;this[_0xd1dc('0xf')]=0x0;this[_0xd1dc('0x10')]=null;this[_0xd1dc('0x11')]=null;this[_0xd1dc('0x12')]=null;this[_0xd1dc('0x13')]=![];this[_0xd1dc('0x14')]=null;this[_0xd1dc('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xd1dc('0x16')]=undefined;this['transferType']=undefined;this[_0xd1dc('0x17')]=0x0;}module[_0xd1dc('0x18')]=Channel; \ No newline at end of file +var _0xf5c4=['destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','holdtime','type','tag','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel'];(function(_0x225634,_0x2822e2){var _0x2f3c62=function(_0x4ffe0e){while(--_0x4ffe0e){_0x225634['push'](_0x225634['shift']());}};_0x2f3c62(++_0x2822e2);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x12aab7,_0x12b706){_0x12aab7=_0x12aab7-0x0;var _0xffd27a=_0xf5c4[_0x12aab7];return _0xffd27a;};'use strict';function Channel(){this[_0x4f5c('0x0')]=null;this[_0x4f5c('0x1')]='';this[_0x4f5c('0x2')]='';this[_0x4f5c('0x3')]=0x0;this[_0x4f5c('0x4')]='';this[_0x4f5c('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x4f5c('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x4f5c('0x7')]=0x0;this[_0x4f5c('0x8')]=0x0;this[_0x4f5c('0x9')]=![];this['answertime']=null;this[_0x4f5c('0xa')]=null;this[_0x4f5c('0xb')]=![];this['abandoned']=![];this[_0x4f5c('0xc')]='';this[_0x4f5c('0xd')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x4f5c('0xe')]=0x0;this[_0x4f5c('0xf')]=null;this[_0x4f5c('0x10')]=null;this[_0x4f5c('0x11')]=null;this['monitor']=![];this[_0x4f5c('0x12')]=null;this['queue']=null;this[_0x4f5c('0x13')]=[];this[_0x4f5c('0x14')]=undefined;this[_0x4f5c('0x15')]=undefined;this[_0x4f5c('0x16')]=undefined;this[_0x4f5c('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index f5a2459..afc5556 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 _0x3c2c=['tokenSecret','type','serverUrl','name','username','remoteUri','authType','password','consumerSecret','token'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c2c,0xa3));var _0xc3c2=function(_0x3e3944,_0x789cda){_0x3e3944=_0x3e3944-0x0;var _0x42aa47=_0x3c2c[_0x3e3944];return _0x42aa47;};'use strict';function DeskAccount(_0x10a4a3){this['id']=_0x10a4a3['id']||0x0;this[_0xc3c2('0x0')]=_0x10a4a3['name']||'';this[_0xc3c2('0x1')]=_0x10a4a3['username']||'';this[_0xc3c2('0x2')]=_0x10a4a3[_0xc3c2('0x2')]||'';this[_0xc3c2('0x3')]=_0x10a4a3[_0xc3c2('0x3')]||'';this[_0xc3c2('0x4')]=_0x10a4a3[_0xc3c2('0x4')]||'';this['consumerKey']=_0x10a4a3['consumerKey']||'';this[_0xc3c2('0x5')]=_0x10a4a3[_0xc3c2('0x5')]||'';this[_0xc3c2('0x6')]=_0x10a4a3[_0xc3c2('0x6')]||'';this[_0xc3c2('0x7')]=_0x10a4a3[_0xc3c2('0x7')]||'';this[_0xc3c2('0x8')]=_0x10a4a3[_0xc3c2('0x8')]||'';this[_0xc3c2('0x9')]=_0x10a4a3[_0xc3c2('0x9')]||'';this['Configurations']=_0x10a4a3['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x2a56=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x454972,_0x5a92be){var _0x242bd7=function(_0x1ed393){while(--_0x1ed393){_0x454972['push'](_0x454972['shift']());}};_0x242bd7(++_0x5a92be);}(_0x2a56,0xc3));var _0x62a5=function(_0x226f17,_0x59276b){_0x226f17=_0x226f17-0x0;var _0x562534=_0x2a56[_0x226f17];return _0x562534;};'use strict';function DeskAccount(_0x366fb4){this['id']=_0x366fb4['id']||0x0;this[_0x62a5('0x0')]=_0x366fb4[_0x62a5('0x0')]||'';this[_0x62a5('0x1')]=_0x366fb4[_0x62a5('0x1')]||'';this[_0x62a5('0x2')]=_0x366fb4['remoteUri']||'';this[_0x62a5('0x3')]=_0x366fb4['authType']||'';this[_0x62a5('0x4')]=_0x366fb4[_0x62a5('0x4')]||'';this['consumerKey']=_0x366fb4[_0x62a5('0x5')]||'';this['consumerSecret']=_0x366fb4[_0x62a5('0x6')]||'';this[_0x62a5('0x7')]=_0x366fb4[_0x62a5('0x7')]||'';this['tokenSecret']=_0x366fb4[_0x62a5('0x8')]||'';this[_0x62a5('0x9')]=_0x366fb4['type']||'';this['serverUrl']=_0x366fb4[_0x62a5('0xa')]||'';this['Configurations']=_0x366fb4[_0x62a5('0xb')]||{};}module[_0x62a5('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 5b518c5..6cd79e8 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 _0x089c=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x417428,_0x58c841){var _0x50dd63=function(_0x55fe99){while(--_0x55fe99){_0x417428['push'](_0x417428['shift']());}};_0x50dd63(++_0x58c841);}(_0x089c,0xa5));var _0xc089=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x089c[_0x4b055c];return _0x4b62bb;};'use strict';function Dynamics365Account(_0x2578d4){this['id']=_0x2578d4['id']||0x0;this[_0xc089('0x0')]=_0x2578d4[_0xc089('0x0')]||'';this[_0xc089('0x1')]=_0x2578d4[_0xc089('0x1')]||'';this['password']=_0x2578d4[_0xc089('0x2')]||'';this[_0xc089('0x3')]=_0x2578d4[_0xc089('0x3')]||'';this[_0xc089('0x4')]=_0x2578d4['tenantId']||'';this[_0xc089('0x5')]=_0x2578d4[_0xc089('0x5')]||'';this[_0xc089('0x6')]=_0x2578d4[_0xc089('0x6')]||{};this[_0xc089('0x7')]=_0x2578d4[_0xc089('0x7')]||'';this[_0xc089('0x8')]=_0x2578d4[_0xc089('0x8')]||![];this[_0xc089('0x9')]=_0x2578d4[_0xc089('0x9')]||{};this[_0xc089('0xa')]=_0x2578d4[_0xc089('0xa')]||{};}module[_0xc089('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x2129=['CloudProvider','exports','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x3be053,_0x21b2b0){var _0x321932=function(_0x24f2fb){while(--_0x24f2fb){_0x3be053['push'](_0x3be053['shift']());}};_0x321932(++_0x21b2b0);}(_0x2129,0x65));var _0x9212=function(_0x595dcb,_0x1afbd9){_0x595dcb=_0x595dcb-0x0;var _0x2ac9fe=_0x2129[_0x595dcb];return _0x2ac9fe;};'use strict';function Dynamics365Account(_0x109336){this['id']=_0x109336['id']||0x0;this['name']=_0x109336['name']||'';this[_0x9212('0x0')]=_0x109336[_0x9212('0x0')]||'';this[_0x9212('0x1')]=_0x109336[_0x9212('0x1')]||'';this[_0x9212('0x2')]=_0x109336[_0x9212('0x2')]||'';this[_0x9212('0x3')]=_0x109336[_0x9212('0x3')]||'';this[_0x9212('0x4')]=_0x109336['clientId']||'';this[_0x9212('0x5')]=_0x109336[_0x9212('0x5')]||{};this[_0x9212('0x6')]=_0x109336[_0x9212('0x6')]||'';this[_0x9212('0x7')]=_0x109336[_0x9212('0x7')]||![];this[_0x9212('0x8')]=_0x109336[_0x9212('0x8')]||{};this[_0x9212('0x9')]=_0x109336[_0x9212('0x9')]||{};}module[_0x9212('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 179977a..99591e7 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 _0x79d1=['key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x179b6a,_0x131629){var _0x4fdc7e=function(_0xc0cb2){while(--_0xc0cb2){_0x179b6a['push'](_0x179b6a['shift']());}};_0x4fdc7e(++_0x131629);}(_0x79d1,0xac));var _0x179d=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x79d1[_0x46698a];return _0x356db0;};'use strict';function FaxAccount(_0x517e48){this['id']=_0x517e48['id']||0x0;this[_0x179d('0x0')]=_0x517e48[_0x179d('0x0')]||'';this[_0x179d('0x1')]=_0x517e48[_0x179d('0x1')];this[_0x179d('0x2')]=_0x517e48['ecm'];this['headerinfo']=_0x517e48['headerinfo'];this[_0x179d('0x3')]=_0x517e48[_0x179d('0x3')];this[_0x179d('0x4')]=_0x517e48[_0x179d('0x4')]||0x960;this['maxrate']=_0x517e48[_0x179d('0x5')]||0x3840;this[_0x179d('0x6')]=_0x517e48[_0x179d('0x6')]||_0x179d('0x7');this[_0x179d('0x8')]=_0x517e48[_0x179d('0x8')]||'no';this[_0x179d('0x9')]=_0x517e48[_0x179d('0x9')]||'no';this[_0x179d('0xa')]=_0x517e48[_0x179d('0xa')]||0x1388;this[_0x179d('0xb')]=_0x517e48[_0x179d('0xb')]||_0x179d('0xc');this['Trunk']=_0x517e48[_0x179d('0xd')]?_0x517e48['Trunk']:undefined;this[_0x179d('0xe')]=_0x517e48[_0x179d('0xe')];this[_0x179d('0xf')]=_0x517e48['key'];}module[_0x179d('0x10')]=FaxAccount; \ No newline at end of file +var _0xfdb4=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfdb4,0xf8));var _0x4fdb=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xfdb4[_0x160c73];return _0xd9302;};'use strict';function FaxAccount(_0x14dbe3){this['id']=_0x14dbe3['id']||0x0;this['name']=_0x14dbe3[_0x4fdb('0x0')]||'';this['description']=_0x14dbe3[_0x4fdb('0x1')];this[_0x4fdb('0x2')]=_0x14dbe3[_0x4fdb('0x2')];this[_0x4fdb('0x3')]=_0x14dbe3[_0x4fdb('0x3')];this[_0x4fdb('0x4')]=_0x14dbe3[_0x4fdb('0x4')];this[_0x4fdb('0x5')]=_0x14dbe3[_0x4fdb('0x5')]||0x960;this[_0x4fdb('0x6')]=_0x14dbe3['maxrate']||0x3840;this[_0x4fdb('0x7')]=_0x14dbe3[_0x4fdb('0x7')]||_0x4fdb('0x8');this[_0x4fdb('0x9')]=_0x14dbe3[_0x4fdb('0x9')]||'no';this[_0x4fdb('0xa')]=_0x14dbe3[_0x4fdb('0xa')]||'no';this[_0x4fdb('0xb')]=_0x14dbe3['t38timeout']||0x1388;this[_0x4fdb('0xc')]=_0x14dbe3[_0x4fdb('0xc')]||_0x4fdb('0xd');this['Trunk']=_0x14dbe3[_0x4fdb('0xe')]?_0x14dbe3[_0x4fdb('0xe')]:undefined;this['ListId']=_0x14dbe3[_0x4fdb('0xf')];this[_0x4fdb('0x10')]=_0x14dbe3[_0x4fdb('0x10')];}module[_0x4fdb('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 798caa0..dde01ab 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 _0xd8cf=['username','token','remoteUri','Configurations','exports','name'];(function(_0x4bffb3,_0xa6f578){var _0x3e0f6a=function(_0x4b732d){while(--_0x4b732d){_0x4bffb3['push'](_0x4bffb3['shift']());}};_0x3e0f6a(++_0xa6f578);}(_0xd8cf,0x1d3));var _0xfd8c=function(_0x31f75c,_0x541b69){_0x31f75c=_0x31f75c-0x0;var _0x3dbc1b=_0xd8cf[_0x31f75c];return _0x3dbc1b;};'use strict';function FreshdeskAccount(_0x4177d1){this['id']=_0x4177d1['id']||0x0;this[_0xfd8c('0x0')]=_0x4177d1[_0xfd8c('0x0')]||'';this[_0xfd8c('0x1')]=_0x4177d1[_0xfd8c('0x1')]||'';this['apiKey']=_0x4177d1[_0xfd8c('0x2')]||'';this[_0xfd8c('0x3')]=_0x4177d1[_0xfd8c('0x3')]||'';this['serverUrl']=_0x4177d1['serverUrl']||'';this[_0xfd8c('0x4')]=_0x4177d1[_0xfd8c('0x4')]||{};}module[_0xfd8c('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xb9f4=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x383519,_0x199f38){var _0x4c5cc1=function(_0x24d75e){while(--_0x24d75e){_0x383519['push'](_0x383519['shift']());}};_0x4c5cc1(++_0x199f38);}(_0xb9f4,0x11f));var _0x4b9f=function(_0x53c4d5,_0x2172b2){_0x53c4d5=_0x53c4d5-0x0;var _0x48bf71=_0xb9f4[_0x53c4d5];return _0x48bf71;};'use strict';function FreshdeskAccount(_0x164e3a){this['id']=_0x164e3a['id']||0x0;this[_0x4b9f('0x0')]=_0x164e3a['name']||'';this[_0x4b9f('0x1')]=_0x164e3a[_0x4b9f('0x1')]||'';this[_0x4b9f('0x2')]=_0x164e3a['token']||'';this[_0x4b9f('0x3')]=_0x164e3a[_0x4b9f('0x3')]||'';this[_0x4b9f('0x4')]=_0x164e3a[_0x4b9f('0x4')]||'';this[_0x4b9f('0x5')]=_0x164e3a[_0x4b9f('0x5')]||{};}module[_0x4b9f('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 6ecbb3f..dfe5b30 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 _0xe35c=['serverUrl','Configurations','name','username','apiKey','remoteUri'];(function(_0x3424f5,_0x293116){var _0x1624c2=function(_0x10bfc8){while(--_0x10bfc8){_0x3424f5['push'](_0x3424f5['shift']());}};_0x1624c2(++_0x293116);}(_0xe35c,0x146));var _0xce35=function(_0x54daf0,_0x50da28){_0x54daf0=_0x54daf0-0x0;var _0x14ff84=_0xe35c[_0x54daf0];return _0x14ff84;};'use strict';function FreshsalesAccount(_0x4a3813){this['id']=_0x4a3813['id']||0x0;this[_0xce35('0x0')]=_0x4a3813[_0xce35('0x0')]||'';this[_0xce35('0x1')]=_0x4a3813[_0xce35('0x1')]||'';this[_0xce35('0x2')]=_0x4a3813['token']||'';this['remoteUri']=_0x4a3813[_0xce35('0x3')]||'';this['serverUrl']=_0x4a3813[_0xce35('0x4')]||'';this[_0xce35('0x5')]=_0x4a3813[_0xce35('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x7b27=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x52ba00,_0x3fee53){var _0x30ac6d=function(_0x3a7261){while(--_0x3a7261){_0x52ba00['push'](_0x52ba00['shift']());}};_0x30ac6d(++_0x3fee53);}(_0x7b27,0x186));var _0x77b2=function(_0x3054ac,_0x3d317b){_0x3054ac=_0x3054ac-0x0;var _0x3852a8=_0x7b27[_0x3054ac];return _0x3852a8;};'use strict';function FreshsalesAccount(_0x24c18e){this['id']=_0x24c18e['id']||0x0;this['name']=_0x24c18e[_0x77b2('0x0')]||'';this[_0x77b2('0x1')]=_0x24c18e[_0x77b2('0x1')]||'';this[_0x77b2('0x2')]=_0x24c18e['token']||'';this[_0x77b2('0x3')]=_0x24c18e[_0x77b2('0x3')]||'';this['serverUrl']=_0x24c18e[_0x77b2('0x4')]||'';this[_0x77b2('0x5')]=_0x24c18e[_0x77b2('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index acb69a3..8a47589 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 _0x30d7=['queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x426dd2,_0x4b0012){var _0x4bc76c=function(_0x4c0732){while(--_0x4c0732){_0x426dd2['push'](_0x426dd2['shift']());}};_0x4bc76c(++_0x4b0012);}(_0x30d7,0x1ca));var _0x730d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30d7[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0x730d('0x0')]=_0x730d('0x1');this[_0x730d('0x2')]='';this['calleridnum']='';this[_0x730d('0x3')]='';this[_0x730d('0x4')]='';this['queuecallerjoinAt']=null;this[_0x730d('0x5')]=null;this[_0x730d('0x6')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x730d('0x7')]=null;this[_0x730d('0x8')]=![];this[_0x730d('0x9')]=null;this[_0x730d('0xa')]=![];this[_0x730d('0xb')]=null;this[_0x730d('0xc')]=0x1;this[_0x730d('0xd')]='';this['connectedlinenum']='';this[_0x730d('0xe')]='';this[_0x730d('0xf')]='';this[_0x730d('0x10')]='';this[_0x730d('0x11')]='';this[_0x730d('0x12')]='';this[_0x730d('0x13')]=0x0;this[_0x730d('0x14')]=![];this[_0x730d('0x15')]='';this['motionChannel']=_0x730d('0x16');this[_0x730d('0x17')]=0x0;this[_0x730d('0x18')]={};}module[_0x730d('0x19')]=QueueReport; \ No newline at end of file +var _0xce6d=['holdtime','assigned','motionChannel','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandonAt','queuecallercomplete','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','exten'];(function(_0x5d9118,_0x3f6b1){var _0x5b5d5e=function(_0xeddf77){while(--_0xeddf77){_0x5d9118['push'](_0x5d9118['shift']());}};_0x5b5d5e(++_0x3f6b1);}(_0xce6d,0xcc));var _0xdce6=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0xce6d[_0x2c18a8];return _0x1e009a;};'use strict';function QueueReport(){this[_0xdce6('0x0')]='inbound';this[_0xdce6('0x1')]='';this[_0xdce6('0x2')]='';this[_0xdce6('0x3')]='';this[_0xdce6('0x4')]='';this[_0xdce6('0x5')]=null;this[_0xdce6('0x6')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xdce6('0x7')]=null;this[_0xdce6('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xdce6('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xdce6('0xa')]='';this[_0xdce6('0xb')]='';this[_0xdce6('0xc')]='';this[_0xdce6('0xd')]='';this[_0xdce6('0xe')]='';this[_0xdce6('0xf')]='';this['priority']='';this[_0xdce6('0x10')]=0x0;this[_0xdce6('0x11')]=![];this['lastAssignedTo']='';this[_0xdce6('0x12')]='voice';this[_0xdce6('0x13')]=0x0;this[_0xdce6('0x14')]={};}module[_0xdce6('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d40aa37..590b063 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 _0x4128=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x30f145,_0x542d89){var _0x425c0a=function(_0x57db63){while(--_0x57db63){_0x30f145['push'](_0x30f145['shift']());}};_0x425c0a(++_0x542d89);}(_0x4128,0x1a5));var _0x8412=function(_0x3a3130,_0xb12612){_0x3a3130=_0x3a3130-0x0;var _0xaeeb9a=_0x4128[_0x3a3130];return _0xaeeb9a;};'use strict';function SalesforceAccount(_0x23ab90){this['id']=_0x23ab90['id']||0x0;this[_0x8412('0x0')]=_0x23ab90[_0x8412('0x0')]||'';this[_0x8412('0x1')]=_0x23ab90[_0x8412('0x1')]||'';this[_0x8412('0x2')]=_0x23ab90[_0x8412('0x2')]||'';this['password']=_0x23ab90[_0x8412('0x3')]||'';this['clientId']=_0x23ab90[_0x8412('0x4')]||'';this[_0x8412('0x5')]=_0x23ab90['clientSecret']||'';this[_0x8412('0x6')]=_0x23ab90['securityToken']||'';this['type']=_0x23ab90[_0x8412('0x7')]||_0x8412('0x8');this[_0x8412('0x9')]=_0x23ab90[_0x8412('0x9')]||'';this['Configurations']=_0x23ab90[_0x8412('0xa')]||{};}module[_0x8412('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1ecd=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','clientId'];(function(_0x2a27eb,_0x2451c8){var _0x3e8594=function(_0x4ef9aa){while(--_0x4ef9aa){_0x2a27eb['push'](_0x2a27eb['shift']());}};_0x3e8594(++_0x2451c8);}(_0x1ecd,0xee));var _0xd1ec=function(_0x159468,_0x19e94c){_0x159468=_0x159468-0x0;var _0x2d9008=_0x1ecd[_0x159468];return _0x2d9008;};'use strict';function SalesforceAccount(_0x2ea070){this['id']=_0x2ea070['id']||0x0;this[_0xd1ec('0x0')]=_0x2ea070[_0xd1ec('0x0')]||'';this[_0xd1ec('0x1')]=_0x2ea070[_0xd1ec('0x1')]||'';this[_0xd1ec('0x2')]=_0x2ea070['remoteUri']||'';this['password']=_0x2ea070['password']||'';this[_0xd1ec('0x3')]=_0x2ea070['clientId']||'';this[_0xd1ec('0x4')]=_0x2ea070[_0xd1ec('0x4')]||'';this[_0xd1ec('0x5')]=_0x2ea070['securityToken']||'';this[_0xd1ec('0x6')]=_0x2ea070[_0xd1ec('0x6')]||_0xd1ec('0x7');this['serverUrl']=_0x2ea070[_0xd1ec('0x8')]||'';this[_0xd1ec('0x9')]=_0x2ea070[_0xd1ec('0x9')]||{};}module[_0xd1ec('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4800faf..86ebca6 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 _0xb783=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x21ae9f,_0x47beb8){var _0xf9ecce=function(_0x250fa2){while(--_0x250fa2){_0x21ae9f['push'](_0x21ae9f['shift']());}};_0xf9ecce(++_0x47beb8);}(_0xb783,0x199));var _0x3b78=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb783[_0x88cd7b];return _0x56fcc8;};'use strict';function ServicenowAccount(_0x281587){this['id']=_0x281587['id']||0x0;this[_0x3b78('0x0')]=_0x281587[_0x3b78('0x0')]||'';this['username']=_0x281587[_0x3b78('0x1')]||'';this[_0x3b78('0x2')]=_0x281587[_0x3b78('0x2')]||'';this[_0x3b78('0x3')]=_0x281587[_0x3b78('0x3')]||'';this[_0x3b78('0x4')]=_0x281587[_0x3b78('0x4')]||'';this[_0x3b78('0x5')]=_0x281587[_0x3b78('0x5')]||{};}module[_0x3b78('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x0014=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x0014,0x67));var _0x4001=function(_0x142ef0,_0x570446){_0x142ef0=_0x142ef0-0x0;var _0x807518=_0x0014[_0x142ef0];return _0x807518;};'use strict';function ServicenowAccount(_0x395bd2){this['id']=_0x395bd2['id']||0x0;this[_0x4001('0x0')]=_0x395bd2['name']||'';this['username']=_0x395bd2[_0x4001('0x1')]||'';this[_0x4001('0x2')]=_0x395bd2['password']||'';this['remoteUri']=_0x395bd2[_0x4001('0x3')]||'';this[_0x4001('0x4')]=_0x395bd2[_0x4001('0x4')]||'';this[_0x4001('0x5')]=_0x395bd2[_0x4001('0x5')]||{};}module[_0x4001('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 fe82ffd..dcad536 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 _0x199c=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x2d8642,_0x12343f){var _0x2bba9b=function(_0x198a08){while(--_0x198a08){_0x2d8642['push'](_0x2d8642['shift']());}};_0x2bba9b(++_0x12343f);}(_0x199c,0x67));var _0xc199=function(_0x2ade6f,_0x18d576){_0x2ade6f=_0x2ade6f-0x0;var _0x28fa0f=_0x199c[_0x2ade6f];return _0x28fa0f;};'use strict';function SugarcrmAccount(_0x111f7b){this['id']=_0x111f7b['id']||0x0;this[_0xc199('0x0')]=_0x111f7b[_0xc199('0x0')]||'';this['username']=_0x111f7b[_0xc199('0x1')]||'';this['password']=_0x111f7b['password']||'';this['remoteUri']=_0x111f7b[_0xc199('0x2')]||'';this[_0xc199('0x3')]=_0x111f7b[_0xc199('0x3')]||'';this[_0xc199('0x4')]=_0x111f7b[_0xc199('0x4')]||{};}module[_0xc199('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x934d=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x18575c,_0x56ed75){var _0x425697=function(_0x3fa75){while(--_0x3fa75){_0x18575c['push'](_0x18575c['shift']());}};_0x425697(++_0x56ed75);}(_0x934d,0x10b));var _0xd934=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x934d[_0x468b0f];return _0x3e74d9;};'use strict';function SugarcrmAccount(_0x1e7975){this['id']=_0x1e7975['id']||0x0;this['name']=_0x1e7975[_0xd934('0x0')]||'';this[_0xd934('0x1')]=_0x1e7975['username']||'';this[_0xd934('0x2')]=_0x1e7975['password']||'';this[_0xd934('0x3')]=_0x1e7975[_0xd934('0x3')]||'';this[_0xd934('0x4')]=_0x1e7975['serverUrl']||'';this[_0xd934('0x5')]=_0x1e7975['Configurations']||{};}module[_0xd934('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 6969fbb..5aabe9b 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 _0x1775=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x117fef,_0x56c508){var _0x1406d9=function(_0x46f36a){while(--_0x46f36a){_0x117fef['push'](_0x117fef['shift']());}};_0x1406d9(++_0x56c508);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';function Telephone(_0x19d388){this['id']=_0x19d388['id']||0x0;this[_0x5177('0x0')]=_0x19d388[_0x5177('0x0')]||'';this[_0x5177('0x1')]=_0x19d388[_0x5177('0x1')]||'';this[_0x5177('0x2')]=_0x5177('0x3');this[_0x5177('0x4')]=0x0;this[_0x5177('0x5')]=_0x5177('0x3');this[_0x5177('0x6')]='';}module[_0x5177('0x7')]=Telephone; \ No newline at end of file +var _0xe7bc=['exports','name','accountcode','state','stateTime','status','unknown'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe7bc,0x1dd));var _0xce7b=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xe7bc[_0xc8a931];return _0x28bd27;};'use strict';function Telephone(_0x9963c){this['id']=_0x9963c['id']||0x0;this[_0xce7b('0x0')]=_0x9963c['name']||'';this[_0xce7b('0x1')]=_0x9963c[_0xce7b('0x1')]||'';this[_0xce7b('0x2')]='unknown';this[_0xce7b('0x3')]=0x0;this[_0xce7b('0x4')]=_0xce7b('0x5');this['address']='';}module[_0xce7b('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index d8d87a7..02735e9 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 _0xb10b=['name','html'];(function(_0x5632e7,_0x7f054d){var _0x1b0e41=function(_0x2601fc){while(--_0x2601fc){_0x5632e7['push'](_0x5632e7['shift']());}};_0x1b0e41(++_0x7f054d);}(_0xb10b,0x12a));var _0xbb10=function(_0x474e22,_0x5d5515){_0x474e22=_0x474e22-0x0;var _0x76a179=_0xb10b[_0x474e22];return _0x76a179;};'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 +var _0xb10b=['name','html'];(function(_0x5677a9,_0x59f683){var _0x92d8bb=function(_0x27fa80){while(--_0x27fa80){_0x5677a9['push'](_0x5677a9['shift']());}};_0x92d8bb(++_0x59f683);}(_0xb10b,0x12a));var _0xbb10=function(_0x18f137,_0x5e06b4){_0x18f137=_0x18f137-0x0;var _0x147221=_0xb10b[_0x18f137];return _0x147221;};'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 75360ca..063ad11 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x386192,_0x4ef3b4){var _0x316c98=function(_0x4ac021){while(--_0x4ac021){_0x386192['push'](_0x386192['shift']());}};_0x316c98(++_0x4ef3b4);}(_0x4fc2,0x111));var _0x24fc=function(_0x14e8b9,_0x78433f){_0x14e8b9=_0x14e8b9-0x0;var _0x49279e=_0x4fc2[_0x14e8b9];return _0x49279e;};'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 f91857e..9e9a1f9 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 _0x5c47=['unknown','registry','split','host','domain','domainport','stateRegistry','registrationtime','address','defaultuser','active','name','state'];(function(_0x5b6207,_0x56cdd9){var _0x56cf2b=function(_0x3afd54){while(--_0x3afd54){_0x5b6207['push'](_0x5b6207['shift']());}};_0x56cf2b(++_0x56cdd9);}(_0x5c47,0x10e));var _0x75c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c47[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x3409d8){this['id']=_0x3409d8['id']||0x0;this['active']=_0x3409d8[_0x75c4('0x0')]||![];this[_0x75c4('0x1')]=_0x3409d8[_0x75c4('0x1')]||'';this[_0x75c4('0x2')]=_0x75c4('0x3');this['stateTime']=0x0;this['status']=_0x75c4('0x3');this[_0x75c4('0x4')]=_0x3409d8[_0x75c4('0x4')]&&_0x3409d8['registry']['indexOf'](':')?_0x3409d8[_0x75c4('0x4')][_0x75c4('0x5')](':')[0x0]:'';this[_0x75c4('0x6')]='';this['port']='';this[_0x75c4('0x7')]='';this[_0x75c4('0x8')]='';this['refresh']='';this[_0x75c4('0x9')]='unknown';this[_0x75c4('0xa')]='';this[_0x75c4('0xb')]='';this[_0x75c4('0xc')]=_0x3409d8[_0x75c4('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x119f=['defaultuser','exports','active','state','unknown','stateTime','registry','indexOf','domain','domainport','refresh','stateRegistry','registrationtime','address'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x119f,0xe2));var _0xf119=function(_0x164ca5,_0x2ab032){_0x164ca5=_0x164ca5-0x0;var _0xd0a33b=_0x119f[_0x164ca5];return _0xd0a33b;};'use strict';function Trunk(_0x170d73){this['id']=_0x170d73['id']||0x0;this['active']=_0x170d73[_0xf119('0x0')]||![];this['name']=_0x170d73['name']||'';this[_0xf119('0x1')]=_0xf119('0x2');this[_0xf119('0x3')]=0x0;this['status']=_0xf119('0x2');this[_0xf119('0x4')]=_0x170d73[_0xf119('0x4')]&&_0x170d73['registry'][_0xf119('0x5')](':')?_0x170d73['registry']['split'](':')[0x0]:'';this['host']='';this['port']='';this[_0xf119('0x6')]='';this[_0xf119('0x7')]='';this[_0xf119('0x8')]='';this[_0xf119('0x9')]='unknown';this[_0xf119('0xa')]='';this[_0xf119('0xb')]='';this['defaultuser']=_0x170d73[_0xf119('0xc')]||'';}module[_0xf119('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b78f743..ecde77e 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 _0xd2e3=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x4ceaa8,_0x452176){var _0x94bff6=function(_0x2b24b3){while(--_0x2b24b3){_0x4ceaa8['push'](_0x4ceaa8['shift']());}};_0x94bff6(++_0x452176);}(_0xd2e3,0x1f2));var _0x3d2e=function(_0xf07be2,_0x5afbd1){_0xf07be2=_0xf07be2-0x0;var _0x20efda=_0xd2e3[_0xf07be2];return _0x20efda;};'use strict';function voiceExtension(_0x46fc59){this['id']=_0x46fc59['id']||0x0;this[_0x3d2e('0x0')]=_0x46fc59[_0x3d2e('0x0')]||'';this[_0x3d2e('0x1')]=_0x46fc59[_0x3d2e('0x1')]||_0x3d2e('0x2');this[_0x3d2e('0x3')]=_0x46fc59[_0x3d2e('0x3')]||![];}module[_0x3d2e('0x4')]=voiceExtension; \ No newline at end of file +var _0x15e9=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x5e7f35,_0x3ae49a){var _0x5f296c=function(_0x5e0783){while(--_0x5e0783){_0x5e7f35['push'](_0x5e7f35['shift']());}};_0x5f296c(++_0x3ae49a);}(_0x15e9,0x1a7));var _0x915e=function(_0x545052,_0x36cf8e){_0x545052=_0x545052-0x0;var _0x7cbe7=_0x15e9[_0x545052];return _0x7cbe7;};'use strict';function voiceExtension(_0x3f356b){this['id']=_0x3f356b['id']||0x0;this[_0x915e('0x0')]=_0x3f356b[_0x915e('0x0')]||'';this[_0x915e('0x1')]=_0x3f356b[_0x915e('0x1')]||_0x915e('0x2');this[_0x915e('0x3')]=_0x3f356b['mandatoryDisposition']||![];}module[_0x915e('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 3da843c..ffd1823 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 _0xfd20=['timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay'];(function(_0x371585,_0x43c516){var _0x59fb00=function(_0x88540f){while(--_0x88540f){_0x371585['push'](_0x371585['shift']());}};_0x59fb00(++_0x43c516);}(_0xfd20,0x19e));var _0x0fd2=function(_0x3db05c,_0x2be283){_0x3db05c=_0x3db05c-0x0;var _0x3243e5=_0xfd20[_0x3db05c];return _0x3243e5;};'use strict';var statusDesc=[_0x0fd2('0x0'),'not_inuse',_0x0fd2('0x1'),_0x0fd2('0x2'),_0x0fd2('0x3'),_0x0fd2('0x4'),_0x0fd2('0x5'),_0x0fd2('0x6'),_0x0fd2('0x7')];var monitorFormat={'wav':_0x0fd2('0x8'),'wav49':_0x0fd2('0x9'),'gsm':_0x0fd2('0xa')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x19668a){this['id']=_0x19668a['id']||0x0;this[_0x0fd2('0xb')]=_0x19668a[_0x0fd2('0xb')]||'';this[_0x0fd2('0xc')]=_0x19668a['monitor_format']||'';this[_0x0fd2('0xd')]=_0x19668a[_0x0fd2('0xd')]||_0x0fd2('0xe');this[_0x0fd2('0xf')]=0x0;this[_0x0fd2('0x10')]=0x0;this[_0x0fd2('0x11')]=0x0;this['answered']=0x0;this[_0x0fd2('0x12')]=0x0;this['sumHoldTime']=0x0;this[_0x0fd2('0x13')]=0x0;this[_0x0fd2('0x14')]=0x0;this[_0x0fd2('0x15')]=0x0;this[_0x0fd2('0x16')]=0x0;this[_0x0fd2('0x17')]=0x0;this['acw']=_0x19668a[_0x0fd2('0x18')]||![];this[_0x0fd2('0x19')]=_0x19668a[_0x0fd2('0x19')]||0xa;this[_0x0fd2('0x1a')]=_0x19668a[_0x0fd2('0x1a')]||'no';this[_0x0fd2('0x1b')]=!![];this[_0x0fd2('0x1c')]='';this['originated']=0x0;this[_0x0fd2('0x1d')]=0x0;this[_0x0fd2('0x1e')]=_0x19668a['dialTimezone']||null;this[_0x0fd2('0x1f')]=_0x19668a[_0x0fd2('0x1f')]?_0x19668a[_0x0fd2('0x1f')]:null;this[_0x0fd2('0x20')]=_0x19668a[_0x0fd2('0x20')];this['dialMethod']=_0x19668a['dialMethod']||_0x0fd2('0x21');this[_0x0fd2('0x22')]=_0x19668a[_0x0fd2('0x22')]||0x0;this[_0x0fd2('0x23')]=_0x19668a[_0x0fd2('0x23')]||0x0;this[_0x0fd2('0x24')]=_0x19668a[_0x0fd2('0x24')]||0x1;this[_0x0fd2('0x25')]=_0x19668a[_0x0fd2('0x25')]||'dropRate';this[_0x0fd2('0x26')]=_0x19668a[_0x0fd2('0x26')]||0.03;this[_0x0fd2('0x27')]=_0x19668a[_0x0fd2('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x19668a[_0x0fd2('0x28')]||'anonymous';this[_0x0fd2('0x29')]=_0x19668a['dialOriginateCallerIdNumber']||_0x0fd2('0x2a');this[_0x0fd2('0x2b')]=_0x19668a[_0x0fd2('0x2b')]||0x1e;this[_0x0fd2('0x2c')]=_0x19668a[_0x0fd2('0x2c')]||'tTxX';this[_0x0fd2('0x2d')]=_0x19668a[_0x0fd2('0x2d')]||0x3;this[_0x0fd2('0x2e')]=_0x19668a[_0x0fd2('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x19668a[_0x0fd2('0x2f')]||0x3;this[_0x0fd2('0x30')]=_0x19668a[_0x0fd2('0x30')]||0x96;this[_0x0fd2('0x31')]=_0x19668a[_0x0fd2('0x31')]||0x3;this[_0x0fd2('0x32')]=_0x19668a[_0x0fd2('0x32')]||0x96;this[_0x0fd2('0x33')]=_0x19668a['dialNoAnswerMaxRetry']||0x3;this[_0x0fd2('0x34')]=_0x19668a[_0x0fd2('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x19668a[_0x0fd2('0x35')]||0x3;this[_0x0fd2('0x36')]=_0x19668a[_0x0fd2('0x36')]||0x96;this[_0x0fd2('0x37')]=_0x19668a[_0x0fd2('0x37')]||0x3;this['dialDropRetryFrequency']=_0x19668a[_0x0fd2('0x38')]||0x96;this[_0x0fd2('0x39')]=_0x19668a[_0x0fd2('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x19668a['dialAbandonedRetryFrequency']||0x96;this[_0x0fd2('0x3a')]=_0x19668a[_0x0fd2('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x19668a[_0x0fd2('0x3b')]||0x96;this['dialAgentRejectMaxRetry']=_0x19668a[_0x0fd2('0x3c')]||0x3;this[_0x0fd2('0x3d')]=_0x19668a[_0x0fd2('0x3d')]||0x96;this[_0x0fd2('0x3e')]=_0x19668a[_0x0fd2('0x3e')]||0x4;this[_0x0fd2('0x3f')]=_0x19668a['Trunk']?_0x19668a['Trunk']:undefined;this[_0x0fd2('0x40')]=_0x19668a[_0x0fd2('0x40')]?_0x19668a[_0x0fd2('0x40')]:undefined;this['dialPrefix']=_0x19668a['dialPrefix']||undefined;this[_0x0fd2('0x41')]=_0x19668a[_0x0fd2('0x41')]?_0x19668a[_0x0fd2('0x41')]:undefined;this[_0x0fd2('0x42')]=_0x19668a[_0x0fd2('0x42')]||_0x0fd2('0x43');this[_0x0fd2('0x44')]=_0x19668a[_0x0fd2('0x44')]||undefined;this['dialCutDigit']=_0x19668a['dialCutDigit']||undefined;this[_0x0fd2('0x45')]=strategy[_0x19668a[_0x0fd2('0x45')]]||'rrmemory';this[_0x0fd2('0x46')]=!![];this[_0x0fd2('0x47')]=_0x19668a[_0x0fd2('0x47')]||![];this['dialAMDInitialSilence']=_0x19668a[_0x0fd2('0x48')];this['dialAMDGreeting']=_0x19668a[_0x0fd2('0x49')];this['dialAMDAfterGreetingSilence']=_0x19668a[_0x0fd2('0x4a')];this['dialAMDTotalAnalysisTime']=_0x19668a[_0x0fd2('0x4b')];this[_0x0fd2('0x4c')]=_0x19668a['dialAMDMinWordLength'];this[_0x0fd2('0x4d')]=_0x19668a[_0x0fd2('0x4d')];this[_0x0fd2('0x4e')]=_0x19668a[_0x0fd2('0x4e')];this[_0x0fd2('0x4f')]=_0x19668a[_0x0fd2('0x4f')];this['dialAMDMaximumWordLength']=_0x19668a[_0x0fd2('0x50')];this[_0x0fd2('0x51')]=0x0;this['pTalking']=0x0;this[_0x0fd2('0x52')]=_0x19668a[_0x0fd2('0x52')];this[_0x0fd2('0x53')]=0x0;this[_0x0fd2('0x54')]=0x0;this[_0x0fd2('0x55')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x0fd2('0x56')]=0x0;this[_0x0fd2('0x57')]=0x0;this[_0x0fd2('0x58')]=0x0;this[_0x0fd2('0x59')]=0x0;this[_0x0fd2('0x5a')]=0x0;this[_0x0fd2('0x5b')]=0x0;this[_0x0fd2('0x5c')]=0x0;this[_0x0fd2('0x5d')]=0x0;this[_0x0fd2('0x5e')]=0x0;this[_0x0fd2('0x5f')]=0x0;this[_0x0fd2('0x60')]=undefined;this['startPredictive']=undefined;this[_0x0fd2('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x0fd2('0x62')]=0x0;this[_0x0fd2('0x63')]=0x0;this[_0x0fd2('0x64')]=0x0;this[_0x0fd2('0x65')]=0x0;this[_0x0fd2('0x66')]=0x0;this[_0x0fd2('0x67')]=0x0;this[_0x0fd2('0x68')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0fd2('0x69')]=_0x19668a[_0x0fd2('0x6a')]||0x14;this[_0x0fd2('0x6b')]=_0x19668a[_0x0fd2('0x6a')]||0xa;this[_0x0fd2('0x6c')]=0x0;this[_0x0fd2('0x6d')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0fd2('0x6e')]=0x0;this[_0x0fd2('0x6f')]=0x0;this[_0x0fd2('0x70')]=0x0;this[_0x0fd2('0x71')]=0x0;this[_0x0fd2('0x72')]=_0x19668a['dialRecallMeTimeout']||0x1e;this[_0x0fd2('0x73')]=_0x19668a['dialRecallInQueue']||![];this[_0x0fd2('0x74')]=!!_0x19668a[_0x0fd2('0x74')]||![];this[_0x0fd2('0x75')]=!!_0x19668a[_0x0fd2('0x75')]||![];this[_0x0fd2('0x76')]=_0x19668a['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x19668a[_0x0fd2('0x77')]||![];this[_0x0fd2('0x78')]=_0x19668a[_0x0fd2('0x78')]||![];this[_0x0fd2('0xc')]=monitorFormat[_0x19668a[_0x0fd2('0xc')]]?monitorFormat[_0x19668a[_0x0fd2('0xc')]]:undefined;this[_0x0fd2('0x79')]=_0x19668a['mandatoryDisposition']||![];this[_0x0fd2('0x7a')]=_0x19668a[_0x0fd2('0x7a')]?_0x19668a[_0x0fd2('0x7a')]:undefined;}module[_0x0fd2('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x16b0=['handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','unmanaged','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive'];(function(_0x4ab784,_0x3cba7f){var _0x2c57f9=function(_0x59e0b2){while(--_0x59e0b2){_0x4ab784['push'](_0x4ab784['shift']());}};_0x2c57f9(++_0x3cba7f);}(_0x16b0,0x104));var _0x016b=function(_0x2b1ca5,_0x2666ac){_0x2b1ca5=_0x2b1ca5-0x0;var _0x1f5d2b=_0x16b0[_0x2b1ca5];return _0x1f5d2b;};'use strict';var statusDesc=[_0x016b('0x0'),_0x016b('0x1'),_0x016b('0x2'),_0x016b('0x3'),_0x016b('0x4'),'unavailable','ringing','ringinuse',_0x016b('0x5')];var monitorFormat={'wav':_0x016b('0x6'),'wav49':_0x016b('0x7'),'gsm':_0x016b('0x8')};var strategy={'rrmemory':_0x016b('0x9'),'roundrobin':_0x016b('0xa')};function VoiceQueue(_0x2fb7cb){this['id']=_0x2fb7cb['id']||0x0;this['name']=_0x2fb7cb[_0x016b('0xb')]||'';this['monitor_format']=_0x2fb7cb[_0x016b('0xc')]||'';this[_0x016b('0xd')]=_0x2fb7cb[_0x016b('0xd')]||_0x016b('0xe');this[_0x016b('0xf')]=0x0;this[_0x016b('0x10')]=0x0;this[_0x016b('0x11')]=0x0;this[_0x016b('0x12')]=0x0;this[_0x016b('0x13')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x016b('0x14')]=0x0;this['abandoned']=0x0;this[_0x016b('0x15')]=0x0;this[_0x016b('0x16')]=0x0;this['acw']=_0x2fb7cb['acw']||![];this[_0x016b('0x17')]=_0x2fb7cb['acwTimeout']||0xa;this[_0x016b('0x18')]=_0x2fb7cb[_0x016b('0x18')]||'no';this[_0x016b('0x19')]=!![];this[_0x016b('0x1a')]='';this[_0x016b('0x1b')]=0x0;this['temp']=0x0;this[_0x016b('0x1c')]=_0x2fb7cb[_0x016b('0x1c')]||null;this[_0x016b('0x1d')]=_0x2fb7cb[_0x016b('0x1d')]?_0x2fb7cb['dialGlobalInterval']:null;this[_0x016b('0x1e')]=_0x2fb7cb[_0x016b('0x1e')];this[_0x016b('0x1f')]=_0x2fb7cb[_0x016b('0x1f')]||_0x016b('0x20');this[_0x016b('0x21')]=_0x2fb7cb[_0x016b('0x21')]||0x0;this[_0x016b('0x22')]=_0x2fb7cb[_0x016b('0x22')]||0x0;this[_0x016b('0x23')]=_0x2fb7cb[_0x016b('0x23')]||0x1;this['dialPredictiveOptimization']=_0x2fb7cb['dialPredictiveOptimization']||_0x016b('0x24');this['dialPredictiveOptimizationPercentage']=_0x2fb7cb[_0x016b('0x25')]||0.03;this[_0x016b('0x26')]=_0x2fb7cb[_0x016b('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x2fb7cb[_0x016b('0x27')]||_0x016b('0x28');this[_0x016b('0x29')]=_0x2fb7cb[_0x016b('0x29')]||_0x016b('0x28');this[_0x016b('0x2a')]=_0x2fb7cb[_0x016b('0x2a')]||0x1e;this[_0x016b('0x2b')]=_0x2fb7cb[_0x016b('0x2b')]||'tTxX';this['dialQueueTimeout']=_0x2fb7cb[_0x016b('0x2c')]||0x3;this[_0x016b('0x2d')]=_0x2fb7cb[_0x016b('0x2d')]||undefined;this[_0x016b('0x2e')]=_0x2fb7cb[_0x016b('0x2e')]||0x3;this['dialCongestionRetryFrequency']=_0x2fb7cb['dialCongestionRetryFrequency']||0x96;this[_0x016b('0x2f')]=_0x2fb7cb[_0x016b('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x2fb7cb[_0x016b('0x30')]||0x96;this[_0x016b('0x31')]=_0x2fb7cb[_0x016b('0x31')]||0x3;this[_0x016b('0x32')]=_0x2fb7cb[_0x016b('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2fb7cb[_0x016b('0x33')]||0x3;this[_0x016b('0x34')]=_0x2fb7cb['dialNoSuchNumberRetryFrequency']||0x96;this[_0x016b('0x35')]=_0x2fb7cb[_0x016b('0x35')]||0x3;this[_0x016b('0x36')]=_0x2fb7cb[_0x016b('0x36')]||0x96;this['dialAbandonedMaxRetry']=_0x2fb7cb[_0x016b('0x37')]||0x3;this[_0x016b('0x38')]=_0x2fb7cb[_0x016b('0x38')]||0x96;this[_0x016b('0x39')]=_0x2fb7cb[_0x016b('0x39')]||0x3;this[_0x016b('0x3a')]=_0x2fb7cb[_0x016b('0x3a')]||0x96;this[_0x016b('0x3b')]=_0x2fb7cb[_0x016b('0x3b')]||0x3;this[_0x016b('0x3c')]=_0x2fb7cb[_0x016b('0x3c')]||0x96;this[_0x016b('0x3d')]=_0x2fb7cb[_0x016b('0x3d')]||0x4;this['Trunk']=_0x2fb7cb['Trunk']?_0x2fb7cb[_0x016b('0x3e')]:undefined;this[_0x016b('0x3f')]=_0x2fb7cb['TrunkBackup']?_0x2fb7cb['TrunkBackup']:undefined;this['dialPrefix']=_0x2fb7cb[_0x016b('0x40')]||undefined;this[_0x016b('0x41')]=_0x2fb7cb['Interval']?_0x2fb7cb[_0x016b('0x41')]:undefined;this[_0x016b('0x42')]=_0x2fb7cb[_0x016b('0x42')]||_0x016b('0x43');this[_0x016b('0x44')]=_0x2fb7cb[_0x016b('0x44')]||undefined;this[_0x016b('0x45')]=_0x2fb7cb[_0x016b('0x45')]||undefined;this[_0x016b('0x46')]=strategy[_0x2fb7cb[_0x016b('0x46')]]||_0x016b('0x9');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x2fb7cb['dialAMDActive']||![];this[_0x016b('0x47')]=_0x2fb7cb[_0x016b('0x47')];this[_0x016b('0x48')]=_0x2fb7cb['dialAMDGreeting'];this[_0x016b('0x49')]=_0x2fb7cb[_0x016b('0x49')];this[_0x016b('0x4a')]=_0x2fb7cb['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2fb7cb['dialAMDMinWordLength'];this[_0x016b('0x4b')]=_0x2fb7cb['dialAMDBetweenWordsSilence'];this[_0x016b('0x4c')]=_0x2fb7cb[_0x016b('0x4c')];this[_0x016b('0x4d')]=_0x2fb7cb['dialAMDSilenceThreshold'];this[_0x016b('0x4e')]=_0x2fb7cb[_0x016b('0x4e')];this[_0x016b('0x4f')]=0x0;this[_0x016b('0x50')]=0x0;this[_0x016b('0x51')]=_0x2fb7cb[_0x016b('0x51')];this['outboundAnswerCallsDay']=0x0;this[_0x016b('0x52')]=0x0;this[_0x016b('0x53')]=0x0;this[_0x016b('0x54')]=0x0;this[_0x016b('0x55')]=0x0;this[_0x016b('0x56')]=0x0;this[_0x016b('0x57')]=0x0;this[_0x016b('0x58')]=0x0;this[_0x016b('0x59')]=0x0;this[_0x016b('0x5a')]=0x0;this[_0x016b('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x016b('0x5c')]=0x0;this[_0x016b('0x5d')]=undefined;this['startPredictive']=undefined;this[_0x016b('0x5e')]=undefined;this[_0x016b('0x5f')]=1.05;this[_0x016b('0x60')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x016b('0x61')]=0x0;this[_0x016b('0x62')]=0x0;this[_0x016b('0x63')]=0x0;this[_0x016b('0x64')]=0x0;this[_0x016b('0x65')]=0x0;this[_0x016b('0x66')]=0x0;this[_0x016b('0x67')]=_0x2fb7cb['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x016b('0x68')]=_0x2fb7cb[_0x016b('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x016b('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x016b('0x6b')]=0x0;this[_0x016b('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x016b('0x6d')]=0x0;this[_0x016b('0x6e')]=_0x2fb7cb['dialRecallMeTimeout']||0x1e;this[_0x016b('0x6f')]=_0x2fb7cb['dialRecallInQueue']||![];this[_0x016b('0x70')]=!!_0x2fb7cb[_0x016b('0x70')]||![];this['dialPreviewRecallmeReminder']=!!_0x2fb7cb[_0x016b('0x71')]||![];this[_0x016b('0x72')]=_0x2fb7cb[_0x016b('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x2fb7cb['dialAgiAfterHangupClient']||![];this[_0x016b('0x73')]=_0x2fb7cb[_0x016b('0x73')]||![];this[_0x016b('0xc')]=monitorFormat[_0x2fb7cb[_0x016b('0xc')]]?monitorFormat[_0x2fb7cb['monitor_format']]:undefined;this[_0x016b('0x74')]=_0x2fb7cb[_0x016b('0x74')]||![];this[_0x016b('0x75')]=_0x2fb7cb[_0x016b('0x75')]?_0x2fb7cb[_0x016b('0x75')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index cd1bd9b..b0a663f 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 _0x77cb=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x1235a8,_0x2db48e){var _0x41a2cf=function(_0x2c30df){while(--_0x2c30df){_0x1235a8['push'](_0x1235a8['shift']());}};_0x41a2cf(++_0x2db48e);}(_0x77cb,0x194));var _0xb77c=function(_0xc7d409,_0x44b90f){_0xc7d409=_0xc7d409-0x0;var _0xc0b678=_0x77cb[_0xc7d409];return _0xc0b678;};'use strict';function VtigerAccount(_0x4f6384){this['id']=_0x4f6384['id']||0x0;this[_0xb77c('0x0')]=_0x4f6384[_0xb77c('0x0')]||'';this[_0xb77c('0x1')]=_0x4f6384[_0xb77c('0x1')]||'';this['accessKey']=_0x4f6384['accessKey']||'';this[_0xb77c('0x2')]=_0x4f6384[_0xb77c('0x2')]||'';this[_0xb77c('0x3')]=_0x4f6384['serverUrl']||'';this[_0xb77c('0x4')]=_0x4f6384[_0xb77c('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xf631=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf631,0x125));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x3ca535){this['id']=_0x3ca535['id']||0x0;this[_0x1f63('0x0')]=_0x3ca535[_0x1f63('0x0')]||'';this[_0x1f63('0x1')]=_0x3ca535['username']||'';this['accessKey']=_0x3ca535['accessKey']||'';this['remoteUri']=_0x3ca535[_0x1f63('0x2')]||'';this[_0x1f63('0x3')]=_0x3ca535['serverUrl']||'';this[_0x1f63('0x4')]=_0x3ca535['Configurations']||{};}module[_0x1f63('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 4a3c244..933fded 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 _0x689e=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x689e,0xa7));var _0xe689=function(_0x46a14f,_0x46ca40){_0x46a14f=_0x46a14f-0x0;var _0x4e26f9=_0x689e[_0x46a14f];return _0x4e26f9;};'use strict';function ZendeskAccount(_0x192921){this['id']=_0x192921['id']||0x0;this['name']=_0x192921[_0xe689('0x0')]||'';this[_0xe689('0x1')]=_0x192921['username']||'';this[_0xe689('0x2')]=_0x192921[_0xe689('0x2')]||'';this['token']=_0x192921['token']||'';this['remoteUri']=_0x192921[_0xe689('0x3')]||'';this[_0xe689('0x4')]=_0x192921[_0xe689('0x4')]||'';this[_0xe689('0x5')]=_0x192921[_0xe689('0x5')]||_0xe689('0x6');this[_0xe689('0x7')]=_0x192921[_0xe689('0x7')]||'';this['Configurations']=_0x192921[_0xe689('0x8')]||{};}module[_0xe689('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x3b3c=['authType','type','integrationTab','serverUrl','exports','name','username','password','token','remoteUri'];(function(_0x200575,_0x570337){var _0x4e50f2=function(_0x3c1dab){while(--_0x3c1dab){_0x200575['push'](_0x200575['shift']());}};_0x4e50f2(++_0x570337);}(_0x3b3c,0x18b));var _0xc3b3=function(_0x4482af,_0x2df282){_0x4482af=_0x4482af-0x0;var _0x1874e5=_0x3b3c[_0x4482af];return _0x1874e5;};'use strict';function ZendeskAccount(_0x10be67){this['id']=_0x10be67['id']||0x0;this['name']=_0x10be67[_0xc3b3('0x0')]||'';this['username']=_0x10be67[_0xc3b3('0x1')]||'';this[_0xc3b3('0x2')]=_0x10be67[_0xc3b3('0x2')]||'';this['token']=_0x10be67[_0xc3b3('0x3')]||'';this[_0xc3b3('0x4')]=_0x10be67[_0xc3b3('0x4')]||'';this[_0xc3b3('0x5')]=_0x10be67[_0xc3b3('0x5')]||'';this[_0xc3b3('0x6')]=_0x10be67[_0xc3b3('0x6')]||_0xc3b3('0x7');this[_0xc3b3('0x8')]=_0x10be67['serverUrl']||'';this['Configurations']=_0x10be67['Configurations']||{};}module[_0xc3b3('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 1d70db2..36b137b 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 _0xbb87=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','description','zone','clientId'];(function(_0x2247f1,_0x44e15b){var _0x1b01cf=function(_0x2b0932){while(--_0x2b0932){_0x2247f1['push'](_0x2247f1['shift']());}};_0x1b01cf(++_0x44e15b);}(_0xbb87,0x165));var _0x7bb8=function(_0x5eb72b,_0x10bbdd){_0x5eb72b=_0x5eb72b-0x0;var _0x5c2189=_0xbb87[_0x5eb72b];return _0x5c2189;};'use strict';function ZohoAccount(_0x5ad9ad){this['id']=_0x5ad9ad['id']||0x0;this['name']=_0x5ad9ad['name']||'';this['description']=_0x5ad9ad[_0x7bb8('0x0')]||'';this['host']=_0x5ad9ad['host']||'';this['zone']=_0x5ad9ad[_0x7bb8('0x1')]||'';this['clientId']=_0x5ad9ad[_0x7bb8('0x2')]||'';this['clientSecret']=_0x5ad9ad[_0x7bb8('0x3')]||'';this[_0x7bb8('0x4')]=_0x5ad9ad[_0x7bb8('0x4')]||'';this[_0x7bb8('0x5')]=_0x5ad9ad[_0x7bb8('0x5')]||'';this[_0x7bb8('0x6')]=_0x5ad9ad[_0x7bb8('0x6')]||'';this[_0x7bb8('0x7')]=_0x5ad9ad[_0x7bb8('0x7')]||{};}module[_0x7bb8('0x8')]=ZohoAccount; \ No newline at end of file +var _0x858d=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x4ee262,_0x2d0264){var _0x201216=function(_0x2fd745){while(--_0x2fd745){_0x4ee262['push'](_0x4ee262['shift']());}};_0x201216(++_0x2d0264);}(_0x858d,0xe6));var _0xd858=function(_0x2a9843,_0x1db071){_0x2a9843=_0x2a9843-0x0;var _0x2ff828=_0x858d[_0x2a9843];return _0x2ff828;};'use strict';function ZohoAccount(_0x4ee6ac){this['id']=_0x4ee6ac['id']||0x0;this[_0xd858('0x0')]=_0x4ee6ac[_0xd858('0x0')]||'';this[_0xd858('0x1')]=_0x4ee6ac[_0xd858('0x1')]||'';this[_0xd858('0x2')]=_0x4ee6ac[_0xd858('0x2')]||'';this['zone']=_0x4ee6ac[_0xd858('0x3')]||'';this[_0xd858('0x4')]=_0x4ee6ac[_0xd858('0x4')]||'';this[_0xd858('0x5')]=_0x4ee6ac[_0xd858('0x5')]||'';this['serverUrl']=_0x4ee6ac[_0xd858('0x6')]||'';this[_0xd858('0x7')]=_0x4ee6ac[_0xd858('0x7')]||'';this[_0xd858('0x8')]=_0x4ee6ac[_0xd858('0x8')]||'';this[_0xd858('0x9')]=_0x4ee6ac[_0xd858('0x9')]||{};}module[_0xd858('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 d920cf3..6d89ae6 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 _0xdaf6=['callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback'];(function(_0x34848f,_0x27ce24){var _0x3df0eb=function(_0x4adf3f){while(--_0x4adf3f){_0x34848f['push'](_0x34848f['shift']());}};_0x3df0eb(++_0x27ce24);}(_0xdaf6,0xdd));var _0x6daf=function(_0x53c2a9,_0x591554){_0x53c2a9=_0x53c2a9-0x0;var _0x3030a3=_0xdaf6[_0x53c2a9];return _0x3030a3;};'use strict';var util=require(_0x6daf('0x0'));var _=require(_0x6daf('0x1'));var moment=require('moment');function checkNameSurname(_0x1ba106,_0x1327b7,_0x2e95ab){var _0x58f2bc='';if(!_['isNil'](_0x1327b7)&&_0x6daf('0x2')===typeof _0x1327b7){_0x58f2bc+=_0x1327b7;}if(!_[_0x6daf('0x3')](_0x2e95ab)&&_0x6daf('0x2')===typeof _0x2e95ab){_0x58f2bc+='\x20'+_0x2e95ab;}if(_0x58f2bc!==''){return _0x58f2bc;}return _0x1ba106;}function Action(_0x98ec2a,_0x2bcd11,_0x303ee3,_0x21ec57,_0x4fc2ba){this[_0x6daf('0x4')]=_0x303ee3||undefined;this['idContact']=_0x98ec2a['id'];this[_0x6daf('0x5')]=_0x2bcd11[_0x6daf('0x6')];this['type']=_0x2bcd11[_0x6daf('0x7')];this[_0x6daf('0x8')]='queue';this[_0x6daf('0x9')]=![];this[_0x6daf('0xa')]=_[_0x6daf('0x3')](_0x98ec2a['Agent'])?undefined:_0x98ec2a[_0x6daf('0xb')]['name'];this[_0x6daf('0xc')]=this['membername']?util[_0x6daf('0xd')](_0x6daf('0xe'),this[_0x6daf('0xa')]):_0x21ec57||undefined;this[_0x6daf('0xf')]=checkNameSurname(_0x98ec2a[_0x6daf('0x10')][_0x6daf('0x11')],_0x98ec2a[_0x6daf('0x10')][_0x6daf('0x12')],_0x98ec2a[_0x6daf('0x10')][_0x6daf('0x13')]);this['active']=_0x98ec2a['active']||![];this['calleridnum']=_0x98ec2a[_0x6daf('0x10')][_0x6daf('0x11')];this[_0x6daf('0x14')]=_0x98ec2a['scheduledat'];this[_0x6daf('0x15')]=_0x98ec2a['countbusyretry']||0x0;this[_0x6daf('0x16')]=_0x98ec2a[_0x6daf('0x16')]||0x0;this[_0x6daf('0x17')]=_0x98ec2a['countnoanswerretry']||0x0;this[_0x6daf('0x18')]=(_0x98ec2a[_0x6daf('0x15')]||0x0)+(_0x98ec2a[_0x6daf('0x16')]||0x0)+(_0x98ec2a[_0x6daf('0x17')]||0x0)+(_0x98ec2a[_0x6daf('0x19')]||0x0)+(_0x98ec2a[_0x6daf('0x1a')]||0x0)+(_0x98ec2a['countabandonedretry']||0x0)+(_0x98ec2a[_0x6daf('0x1b')]||0x0)+(_0x98ec2a[_0x6daf('0x1c')]||0x0);this[_0x6daf('0x19')]=_0x98ec2a[_0x6daf('0x19')]||0x0;this['countdropretry']=_0x98ec2a['countdropretry']||0x0;this[_0x6daf('0x1d')]=_0x98ec2a['countabandonedretry']||0x0;this[_0x6daf('0x1b')]=_0x98ec2a['countmachineretry']||0x0;this[_0x6daf('0x1c')]=_0x98ec2a[_0x6daf('0x1c')]||0x0;this[_0x6daf('0x1e')]=_0x98ec2a[_0x6daf('0x1e')];this['callbackuniqueid']=_0x98ec2a[_0x6daf('0x1f')];this[_0x6daf('0x20')]=_0x98ec2a[_0x6daf('0x20')];this[_0x6daf('0x21')]=_0x98ec2a['recallme'];this[_0x6daf('0x22')]=_0x98ec2a[_0x6daf('0x22')];this['ListId']=_0x98ec2a['ListId'];this[_0x6daf('0x23')]=_[_0x6daf('0x3')](_0x98ec2a['Agent'])?_0x98ec2a[_0x6daf('0x23')]:_0x98ec2a[_0x6daf('0xb')]['id'];this[_0x6daf('0x24')]=_0x98ec2a[_0x6daf('0x24')];this['originatecalleridnum']='';this[_0x6daf('0x25')]='';}Action[_0x6daf('0x26')]['getCaller']=function(){return util[_0x6daf('0xd')](_0x6daf('0x27'),this[_0x6daf('0xf')],this[_0x6daf('0x28')]);};module[_0x6daf('0x29')]=Action; \ No newline at end of file +var _0xee2c=['originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','calleridname','number','util','lodash','moment','isNil','string','uniqueid','queue','type','membername','Agent','channelAgent','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xee2c,0x1e0));var _0xcee2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xee2c[_0x1deb03];return _0x189fe7;};'use strict';var util=require(_0xcee2('0x0'));var _=require(_0xcee2('0x1'));var moment=require(_0xcee2('0x2'));function checkNameSurname(_0x5e4701,_0x5e7288,_0x154160){var _0xc0c2c9='';if(!_[_0xcee2('0x3')](_0x5e7288)&&_0xcee2('0x4')===typeof _0x5e7288){_0xc0c2c9+=_0x5e7288;}if(!_[_0xcee2('0x3')](_0x154160)&&_0xcee2('0x4')===typeof _0x154160){_0xc0c2c9+='\x20'+_0x154160;}if(_0xc0c2c9!==''){return _0xc0c2c9;}return _0x5e4701;}function Action(_0xfe70a8,_0x2fcac2,_0x212883,_0x549d7b,_0x1244c5){this[_0xcee2('0x5')]=_0x212883||undefined;this['idContact']=_0xfe70a8['id'];this[_0xcee2('0x6')]=_0x2fcac2['name'];this['type']=_0x2fcac2[_0xcee2('0x7')];this['campaigntype']=_0xcee2('0x6');this['dialAnswer']=![];this[_0xcee2('0x8')]=_[_0xcee2('0x3')](_0xfe70a8[_0xcee2('0x9')])?undefined:_0xfe70a8['Agent']['name'];this[_0xcee2('0xa')]=this[_0xcee2('0x8')]?util['format'](_0xcee2('0xb'),this['membername']):_0x549d7b||undefined;this['calleridname']=checkNameSurname(_0xfe70a8[_0xcee2('0xc')][_0xcee2('0xd')],_0xfe70a8['Contact'][_0xcee2('0xe')],_0xfe70a8[_0xcee2('0xc')][_0xcee2('0xf')]);this[_0xcee2('0x10')]=_0xfe70a8['active']||![];this[_0xcee2('0x11')]=_0xfe70a8[_0xcee2('0xc')][_0xcee2('0xd')];this[_0xcee2('0x12')]=_0xfe70a8['scheduledat'];this['countbusyretry']=_0xfe70a8[_0xcee2('0x13')]||0x0;this[_0xcee2('0x14')]=_0xfe70a8[_0xcee2('0x14')]||0x0;this[_0xcee2('0x15')]=_0xfe70a8['countnoanswerretry']||0x0;this[_0xcee2('0x16')]=(_0xfe70a8[_0xcee2('0x13')]||0x0)+(_0xfe70a8[_0xcee2('0x14')]||0x0)+(_0xfe70a8['countnoanswerretry']||0x0)+(_0xfe70a8[_0xcee2('0x17')]||0x0)+(_0xfe70a8[_0xcee2('0x18')]||0x0)+(_0xfe70a8[_0xcee2('0x19')]||0x0)+(_0xfe70a8[_0xcee2('0x1a')]||0x0)+(_0xfe70a8[_0xcee2('0x1b')]||0x0);this[_0xcee2('0x17')]=_0xfe70a8[_0xcee2('0x17')]||0x0;this[_0xcee2('0x18')]=_0xfe70a8[_0xcee2('0x18')]||0x0;this['countabandonedretry']=_0xfe70a8[_0xcee2('0x19')]||0x0;this['countmachineretry']=_0xfe70a8[_0xcee2('0x1a')]||0x0;this[_0xcee2('0x1b')]=_0xfe70a8['countagentrejectretry']||0x0;this[_0xcee2('0x1c')]=_0xfe70a8['callback'];this[_0xcee2('0x1d')]=_0xfe70a8['callbackuniqueid'];this[_0xcee2('0x1e')]=_0xfe70a8['callbackat'];this[_0xcee2('0x1f')]=_0xfe70a8[_0xcee2('0x1f')];this[_0xcee2('0x20')]=_0xfe70a8[_0xcee2('0x20')];this[_0xcee2('0x21')]=_0xfe70a8[_0xcee2('0x21')];this[_0xcee2('0x22')]=_[_0xcee2('0x3')](_0xfe70a8[_0xcee2('0x9')])?_0xfe70a8['UserId']:_0xfe70a8[_0xcee2('0x9')]['id'];this[_0xcee2('0x23')]=_0xfe70a8[_0xcee2('0x23')];this[_0xcee2('0x24')]='';this[_0xcee2('0x25')]='';}Action['prototype'][_0xcee2('0x26')]=function(){return util[_0xcee2('0x27')](_0xcee2('0x28'),this[_0xcee2('0x29')],this[_0xcee2('0x2a')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 428aff1..43afc1c 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 _0xd6d6=['[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','custom:agentconnect','buildObj','acw','buildAcw','custom:agentcomplete','complete','[16]','createCustomerFinal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','uniqueid','\x20Queue','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','activeContact','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','phone','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','YYYY-MM-DD\x20HH:mm:ss','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory'];(function(_0x486ba0,_0x146d1d){var _0x2479dc=function(_0x2ab2da){while(--_0x2ab2da){_0x486ba0['push'](_0x486ba0['shift']());}};_0x2479dc(++_0x146d1d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x77e63,_0x4fe22f){_0x77e63=_0x77e63-0x0;var _0xa32b13=_0xd6d6[_0x77e63];return _0xa32b13;};'use strict';var util=require(_0x6d6d('0x0'));var _=require(_0x6d6d('0x1'));var BPromise=require(_0x6d6d('0x2'));var uuid=require(_0x6d6d('0x3'));var moment=require('moment');var md5=require(_0x6d6d('0x4'));var Redis=require(_0x6d6d('0x5'));var config=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var loggerAction=require(_0x6d6d('0x7'))(_0x6d6d('0x9'));var ami=require('../ami');var rpcDb=require(_0x6d6d('0xa'));var Action=require(_0x6d6d('0xb'));var ut=require(_0x6d6d('0xc'));config[_0x6d6d('0xd')]=_[_0x6d6d('0xe')](config[_0x6d6d('0xd')],{'host':_0x6d6d('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x6d6d('0x10')][_0x6d6d('0x11')]=function(_0x23b18a){this[_0x6d6d('0x12')]=this[_0x6d6d('0x12')]?this['tail'][_0x6d6d('0x13')](_0x23b18a):_0x23b18a();};function Preview(_0x158f82){this['sequence']=new Sequence();this['campaignsPreview']=_0x158f82[_0x6d6d('0x14')];this[_0x6d6d('0x15')]=_0x158f82[_0x6d6d('0x15')];this[_0x6d6d('0x16')]={};this[_0x6d6d('0x17')]=_0x158f82[_0x6d6d('0x17')];this[_0x6d6d('0x18')]=0x0;ami['on'](_0x6d6d('0x19'),this['syncOriginateResponse'][_0x6d6d('0x1a')](this));ami['on'](_0x6d6d('0x1b'),this[_0x6d6d('0x1c')][_0x6d6d('0x1a')](this));ami['on'](_0x6d6d('0x1d'),this['syncHangupRequest'][_0x6d6d('0x1a')](this));ami['on']('dialend',this[_0x6d6d('0x1e')][_0x6d6d('0x1a')](this));ami['on'](_0x6d6d('0x1f'),this['syncNewExten']['bind'](this));ami['on'](_0x6d6d('0x20'),this[_0x6d6d('0x21')][_0x6d6d('0x1a')](this));ami['on'](_0x6d6d('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x6d6d('0x23'),this['syncBlindTransfer'][_0x6d6d('0x1a')](this));this[_0x6d6d('0x24')](this[_0x6d6d('0x25')]);}function emit(_0x450352,_0x40d35b,_0x3242d8){io['to'](_0x450352)[_0x6d6d('0x26')](_0x40d35b,_0x3242d8);}function emitCampaignPreview(_0x230ad7){if(_0x230ad7[_0x6d6d('0x27')]===_0x6d6d('0x28')){var _0x24b10d={'id':_0x230ad7['id'],'name':_0x230ad7[_0x6d6d('0x29')],'strategy':_0x230ad7[_0x6d6d('0x2a')],'answered':_0x230ad7[_0x6d6d('0x2b')],'available':_0x230ad7[_0x6d6d('0x2c')],'loggedIn':_0x230ad7[_0x6d6d('0x2d')],'pTalking':_0x230ad7[_0x6d6d('0x2e')],'sumBillable':_0x230ad7['sumBillable'],'sumDuration':_0x230ad7[_0x6d6d('0x2f')],'sumHoldTime':_0x230ad7[_0x6d6d('0x30')]||0x0,'talking':_0x230ad7[_0x6d6d('0x31')],'total':_0x230ad7[_0x6d6d('0x32')],'type':_0x230ad7[_0x6d6d('0x27')],'unmanaged':_0x230ad7[_0x6d6d('0x33')],'abandoned':_0x230ad7['abandoned'],'waiting':_0x230ad7[_0x6d6d('0x34')],'loggedInDb':_0x230ad7[_0x6d6d('0x35')],'dialActive':_0x230ad7[_0x6d6d('0x36')],'dialMethod':_0x230ad7[_0x6d6d('0x37')],'dialOriginateCallerIdName':_0x230ad7[_0x6d6d('0x38')],'dialOriginateCallerIdNumber':_0x230ad7[_0x6d6d('0x39')],'dialOriginateTimeout':_0x230ad7[_0x6d6d('0x3a')],'dialPrefix':_0x230ad7['dialPrefix'],'outboundAnswerAgiCallsDay':_0x230ad7[_0x6d6d('0x3b')],'outboundAnswerCallsDay':_0x230ad7[_0x6d6d('0x3c')],'outboundBlacklistCallsDay':_0x230ad7['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x230ad7['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x230ad7[_0x6d6d('0x3d')],'outboundDropCallsDayACS':_0x230ad7[_0x6d6d('0x3e')],'outboundDropCallsDayCallersExit':_0x230ad7[_0x6d6d('0x3f')],'outboundDropCallsDayTimeout':_0x230ad7['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x230ad7[_0x6d6d('0x40')],'outboundNoSuchCallsDay':_0x230ad7[_0x6d6d('0x41')],'outboundOriginateFailureCallsDay':_0x230ad7[_0x6d6d('0x42')],'outboundReCallsDay':_0x230ad7[_0x6d6d('0x43')],'outboundRejectCallsDay':_0x230ad7[_0x6d6d('0x44')],'outboundUnknownCallsDay':_0x230ad7[_0x6d6d('0x45')],'outboundAbandonedCallsDay':_0x230ad7[_0x6d6d('0x46')],'predictiveIntervalAnsweredCalls':_0x230ad7[_0x6d6d('0x47')],'predictiveIntervalAvgHoldtime':_0x230ad7[_0x6d6d('0x48')],'predictiveIntervalAvgTalktime':_0x230ad7[_0x6d6d('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x230ad7['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x230ad7[_0x6d6d('0x4a')],'predictiveIntervalErlangCalls':_0x230ad7['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x230ad7[_0x6d6d('0x4b')],'predictiveIntervalHitRate':_0x230ad7[_0x6d6d('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x230ad7[_0x6d6d('0x4d')],'predictiveIntervalPauses':_0x230ad7[_0x6d6d('0x4e')],'predictiveIntervalAvailable':_0x230ad7['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x230ad7[_0x6d6d('0x4f')],'message':_0x230ad7['message'],'originated':_0x230ad7[_0x6d6d('0x50')],'erlangCalls':_0x230ad7[_0x6d6d('0x51')],'erlangCallToSecond':_0x230ad7['erlangCallToSecond'],'erlangAbandonmentRate':_0x230ad7[_0x6d6d('0x52')],'erlangBusyFactor':_0x230ad7[_0x6d6d('0x53')],'startPredictive':_0x230ad7[_0x6d6d('0x54')],'startProgressive':_0x230ad7[_0x6d6d('0x55')]};if(_0x230ad7[_0x6d6d('0x56')]){_0x24b10d[_0x6d6d('0x56')]={'id':_0x230ad7[_0x6d6d('0x56')]['id'],'name':_0x230ad7[_0x6d6d('0x56')][_0x6d6d('0x29')],'active':_0x230ad7[_0x6d6d('0x56')][_0x6d6d('0x57')],'callerid':_0x230ad7[_0x6d6d('0x56')][_0x6d6d('0x58')]};}if(_0x230ad7[_0x6d6d('0x59')]){_0x24b10d['Interval']={'id':_0x230ad7[_0x6d6d('0x59')]['id'],'name':_0x230ad7[_0x6d6d('0x59')][_0x6d6d('0x29')]};}var _0x5e4f38=md5(JSON['stringify'](_0x24b10d));if(_0x230ad7['md5']!==_0x5e4f38){_0x230ad7[_0x6d6d('0x4')]=_0x5e4f38;emit(util[_0x6d6d('0x5a')](_0x6d6d('0x5b'),_0x24b10d['name']),_0x6d6d('0x5c'),_0x24b10d);}}}function emitVoiceQueueChannelRemove(_0x2607c1){logger[_0x6d6d('0x5d')](_0x6d6d('0x5e'),JSON['stringify'](_0x2607c1));emit(util['format']('voice:queue:%s',_0x2607c1[_0x6d6d('0x29')]),_0x6d6d('0x5f'),_0x2607c1);io[_0x6d6d('0x26')](_0x6d6d('0x60'),_0x2607c1);}function notSendMessagesQueue(_0x4e918b){if(_0x4e918b[_0x6d6d('0x61')]){if(_0x4e918b[_0x6d6d('0x50')]===0x0&&_0x4e918b[_0x6d6d('0x2e')]===0x0){_0x4e918b[_0x6d6d('0x61')]=![];_0x4e918b[_0x6d6d('0x2c')]=0x0;_0x4e918b[_0x6d6d('0x62')]=0x0;_0x4e918b['message']=_0x6d6d('0x63');ut[_0x6d6d('0x64')](_0x6d6d('0x65'),_0x4e918b[_0x6d6d('0x29')]+_0x6d6d('0x66'));}else{_0x4e918b[_0x6d6d('0x67')]=_0x6d6d('0x68');ut['logger'](_0x6d6d('0x65'),_0x4e918b[_0x6d6d('0x29')]+_0x6d6d('0x69'));}emitCampaignPreview(_0x4e918b);}}Preview[_0x6d6d('0x10')][_0x6d6d('0x24')]=function(){var _0x5d9268=this;setInterval(function(){_0x5d9268[_0x6d6d('0x6a')]();},0x7cf);};Preview[_0x6d6d('0x10')]['syncCampaigns']=function(){var _0x452de2=this['campaignsPreview'];this[_0x6d6d('0x18')]+=0x1;for(var _0x43c03c in _0x452de2){if(_0x452de2['hasOwnProperty'](_0x43c03c)&&(_0x452de2[_0x43c03c][_0x6d6d('0x37')]===_0x6d6d('0x8')||_0x452de2[_0x43c03c][_0x6d6d('0x37')]===_0x6d6d('0x6b'))&&_0x452de2[_0x43c03c][_0x6d6d('0x27')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x6d6d('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x452de2['hasOwnProperty'](_0x43c03c)&&_0x452de2[_0x43c03c][_0x6d6d('0x37')]===_0x6d6d('0x8')&&_0x452de2[_0x43c03c][_0x6d6d('0x27')]==='outbound'){if(_0x452de2[_0x43c03c][_0x6d6d('0x36')]){this['setMessage'](_0x452de2[_0x43c03c]);if(_0x452de2[_0x43c03c][_0x6d6d('0x6c')])this[_0x6d6d('0x6d')](_0x452de2[_0x43c03c]);}else{notSendMessagesQueue(_0x452de2[_0x43c03c]);}}}};Preview[_0x6d6d('0x10')][_0x6d6d('0x6e')]=function(_0x75f298){var _0x2669f0=this;this[_0x6d6d('0x6f')]['enqueue'](function(){if(!_[_0x6d6d('0x70')](_0x2669f0[_0x6d6d('0x16')][_0x75f298])){loggerAction[_0x6d6d('0x5d')](_0x6d6d('0x71'),_0x75f298,_0x6d6d('0x72'),_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x73')],_0x6d6d('0x74'),JSON[_0x6d6d('0x75')](_0x2669f0['campaignsPreview'][_0x2669f0['actions'][_0x75f298][_0x6d6d('0x73')]][_0x6d6d('0x50')]),_0x6d6d('0x76'),JSON[_0x6d6d('0x75')](_0x2669f0[_0x6d6d('0x25')][_0x2669f0['actions'][_0x75f298][_0x6d6d('0x73')]][_0x6d6d('0x2e')]),JSON[_0x6d6d('0x75')](_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x77')]),JSON[_0x6d6d('0x75')](_[_0x6d6d('0x78')](_0x2669f0[_0x6d6d('0x16')][_0x75f298],[_0x6d6d('0x79'),_0x6d6d('0x7a'),_0x6d6d('0x7b'),_0x6d6d('0x7c')])));return ami['Action']({'action':_0x6d6d('0x7d'),'channel':_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x7e')]})[_0x6d6d('0x7f')](function(_0x340bf9){if(_0x340bf9['message']===_0x6d6d('0x80')){setTimeout(function(){if(_0x2669f0[_0x6d6d('0x16')][_0x75f298]){ut[_0x6d6d('0x81')](_0x2669f0['campaignsPreview'][_0x2669f0['actions'][_0x75f298][_0x6d6d('0x73')]],'[clearZombieChannel]');if(_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x77')]===!![]){ut[_0x6d6d('0x82')](_0x2669f0[_0x6d6d('0x25')][_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x73')]],_0x6d6d('0x83'));ut[_0x6d6d('0x84')](_0x6d6d('0x85')+_0x75f298,_0x2669f0[_0x6d6d('0x16')][_0x75f298]['queue']);}ut[_0x6d6d('0x84')](_0x6d6d('0x86')+_0x75f298,_0x2669f0[_0x6d6d('0x16')][_0x75f298][_0x6d6d('0x73')]);delete _0x2669f0[_0x6d6d('0x16')][_0x75f298];}},0x2328);}});}});};Preview[_0x6d6d('0x10')][_0x6d6d('0x87')]=function(){var _0x5e5ace=this;loggerAction['info'](_0x6d6d('0x88'),_[_0x6d6d('0x89')](this['actions']));for(var _0x3e98a0 in this[_0x6d6d('0x16')]){if(_0x5e5ace[_0x6d6d('0x16')][_0x6d6d('0x8a')](_0x3e98a0)){_0x5e5ace[_0x6d6d('0x6e')](_0x3e98a0);}}};Preview[_0x6d6d('0x10')][_0x6d6d('0x6d')]=function(_0x1ef7fb){var _0x2abd8c=this;rpcDb[_0x6d6d('0x8b')](_0x1ef7fb['id'],ut[_0x6d6d('0x8c')](this[_0x6d6d('0x17')]))[_0x6d6d('0x8d')](function(_0x2671ec){if(!_[_0x6d6d('0x70')](_0x2671ec)){for(var _0x50d8dd=0x0;_0x50d8dd<_0x2671ec[_0x6d6d('0x8e')];_0x50d8dd+=0x1){if(ut[_0x6d6d('0x8f')](_0x2671ec[_0x50d8dd]['scheduledat'])<_0x1ef7fb[_0x6d6d('0x90')]*0x3c){if(_0x2671ec[_0x50d8dd][_0x6d6d('0x91')]&&!_0x2671ec[_0x50d8dd][_0x6d6d('0x91')][_0x6d6d('0x92')]){_0x2abd8c[_0x6d6d('0x93')](_0x2671ec[_0x50d8dd]['id'])[_0x6d6d('0x8d')](ut[_0x6d6d('0x94')](_0x6d6d('0x95')))[_0x6d6d('0x7f')](ut['logger2']('[RecallMe]'));}else{rpcDb[_0x6d6d('0x96')](_0x2671ec[_0x50d8dd]['id']);}}else{var _0x325fe2=new Action(_0x2671ec[_0x50d8dd],_0x1ef7fb);_0x325fe2[_0x6d6d('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1ef7fb[_0x6d6d('0x43')]+=0x1;ut['logCustomer'](_0x325fe2,0x17,_0x6d6d('0x98'));if(_0x1ef7fb['dialRecallInQueue']){rpcDb[_0x6d6d('0x99')](ut[_0x6d6d('0x9a')](_0x2671ec[_0x50d8dd]));rpcDb[_0x6d6d('0x9b')](_0x325fe2,_0x6d6d('0x9c'));}else{ut[_0x6d6d('0x9d')](_0x325fe2,0x16,_0x6d6d('0x9e'));rpcDb['createCustomerHistory'](_0x325fe2,_0x6d6d('0x9f'));rpcDb['createCustomerFinal'](_0x325fe2,_0x6d6d('0x9f'));}}}}})['catch'](ut[_0x6d6d('0x94')](_0x6d6d('0xa0')));};Preview[_0x6d6d('0x10')][_0x6d6d('0xa1')]=function(_0x29b68b){_0x29b68b[_0x6d6d('0x61')]=!![];if(ut[_0x6d6d('0xa2')](_0x29b68b['loggedIn'])){_0x29b68b['message']=_0x6d6d('0xa3');}else if(!ut['isActive'](_0x29b68b[_0x6d6d('0x36')])){_0x29b68b['message']=_0x6d6d('0x63');}else if(!this[_0x6d6d('0xa4')](_0x29b68b[_0x6d6d('0x56')])){if(!this[_0x6d6d('0xa4')](_0x29b68b[_0x6d6d('0xa5')])){_0x29b68b[_0x6d6d('0x67')]='TRUNK_IS_NOT_REACHABLE';}else{_0x29b68b[_0x6d6d('0x67')]=_0x6d6d('0xa6');}}else{_0x29b68b[_0x6d6d('0x67')]=_0x6d6d('0xa6');}emitCampaignPreview(_0x29b68b);};Preview[_0x6d6d('0x10')][_0x6d6d('0xa7')]=function(_0x30e31f,_0x589d64,_0x3fa820){var _0x4ec43e=this;var _0x2103a1=this[_0x6d6d('0x16')][_0x589d64];var _0x1aa25d=this[_0x6d6d('0x25')][_0x2103a1[_0x6d6d('0x73')]];var _0x1d1d1d;if(_0x1aa25d){switch(_0x3fa820){case'1':_0x1aa25d[_0x6d6d('0x41')]+=0x1;_0x2103a1[_0x6d6d('0xa8')]+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut['totalGlobal'](_0x2103a1);ut['logCustomer'](_0x2103a1,0x0,_0x6d6d('0xaa'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x2103a1,_0x6d6d('0xab')));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xac'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,'Global');rpcDb['createCustomerFinal'](_0x1d1d1d,_0x6d6d('0xb0'));}else{if(_0x2103a1['countnosuchnumberretry']>=_0x1aa25d['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x2103a1,_0x6d6d('0xb0'));}else{rpcDb['rescheduleContact'](ut[_0x6d6d('0xb1')](_0x2103a1,'countnosuchnumberretry',_0x1aa25d[_0x6d6d('0xb2')]),_0x2103a1[_0x6d6d('0xb3')],_0x2103a1['activeContact']);}}delete this['actions'][_0x30e31f[_0x6d6d('0xb4')]];break;case _0x6d6d('0xb5'):var _0x26812a=moment()[_0x6d6d('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2103a1[_0x6d6d('0xb6')]=_0x26812a;_0x2103a1[_0x6d6d('0xb7')]=_0x26812a;_0x2103a1[_0x6d6d('0x77')]=!![];_0x1aa25d[_0x6d6d('0x2e')]+=0x1;logger['info'](_0x6d6d('0xb8'),_0x2103a1['uniqueid'],'\x20Queue',_0x1aa25d['name'],_0x6d6d('0x76'),_0x1aa25d['pTalking']);ami[_0x6d6d('0x26')](_0x6d6d('0xb9'),ut[_0x6d6d('0xba')](_0x2103a1,'connect',this['campaignsPreview'][_0x2103a1[_0x6d6d('0x73')]]));if(_0x1aa25d[_0x6d6d('0xbb')]){ami['emit']('custom:agentConnectPreview',ut[_0x6d6d('0xbc')](_0x2103a1));}break;case'16':ami[_0x6d6d('0x26')](_0x6d6d('0xbd'),ut[_0x6d6d('0xba')](_0x2103a1,_0x6d6d('0xbe'),this[_0x6d6d('0x25')][_0x2103a1[_0x6d6d('0x73')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2103a1,'complete'));_0x1aa25d['outboundAnswerCallsDay']+=0x1;_0x1aa25d['total']+=0x1;_0x1aa25d['answered']+=0x1;ut['decrementTalkink'](_0x1aa25d,_0x6d6d('0xbf'));_0x2103a1[_0x6d6d('0xa9')]=ut[_0x6d6d('0xad')](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0x4,'Answer');rpcDb['createCustomerHistory'](_0x2103a1,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xc1'));rpcDb[_0x6d6d('0xc2')](_0x2103a1);_0x1aa25d[_0x6d6d('0x2f')]+=_0x2103a1['talktime'];_0x1aa25d['sumBillable']+=_0x2103a1[_0x6d6d('0xc3')];logger[_0x6d6d('0x5d')]('[syncHangup][talking][decrement]',_0x2103a1[_0x6d6d('0xc4')],_0x6d6d('0xc5'),_0x1aa25d[_0x6d6d('0x29')],_0x6d6d('0x76'),_0x1aa25d[_0x6d6d('0x2e')]);delete this['actions'][_0x30e31f[_0x6d6d('0xb4')]];break;case'BUSY':_0x1aa25d[_0x6d6d('0xc6')]+=0x1;_0x2103a1['countbusyretry']+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut['totalGlobal'](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0x5,_0x6d6d('0xc7'));ami[_0x6d6d('0x26')](_0x6d6d('0xc8'),ut[_0x6d6d('0xba')](_0x2103a1,_0x6d6d('0xc9')));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xca'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,_0x6d6d('0xcc'));}else{if(_0x2103a1[_0x6d6d('0xcd')]>=_0x1aa25d[_0x6d6d('0xce')]){rpcDb['createCustomerFinal'](_0x2103a1,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x6d6d('0xcf')](ut['scheduledAt'](_0x2103a1,_0x6d6d('0xcd'),_0x1aa25d[_0x6d6d('0xd0')]),_0x2103a1['unlockAgent'],_0x2103a1['activeContact']);}}break;case _0x6d6d('0xd1'):_0x1aa25d['outboundNoAnswerCallsDay']+=0x1;_0x2103a1[_0x6d6d('0xd2')]+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut[_0x6d6d('0xad')](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0x3,_0x6d6d('0xd3'));ami[_0x6d6d('0x26')](_0x6d6d('0xd4'),ut[_0x6d6d('0xba')](_0x2103a1,'noanswer'));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xd5'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d['dialGlobalMaxRetry']){_0x1d1d1d=ut['cloneAction'](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,_0x6d6d('0xd6'));}else{if(_0x2103a1['countnoanswerretry']>=_0x1aa25d[_0x6d6d('0xd7')]){rpcDb[_0x6d6d('0xc0')](_0x2103a1,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x6d6d('0xcf')](ut[_0x6d6d('0xb1')](_0x2103a1,_0x6d6d('0xd2'),_0x1aa25d[_0x6d6d('0xd8')]),_0x2103a1[_0x6d6d('0xb3')],_0x2103a1['activeContact']);}}break;case _0x6d6d('0xd9'):_0x1aa25d[_0x6d6d('0x3d')]+=0x1;_0x2103a1['countcongestionretry']+=0x1;_0x2103a1['countglobal']=ut[_0x6d6d('0xad')](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0x8,_0x6d6d('0xda'));ami[_0x6d6d('0x26')]('custom:agentcongestion',ut[_0x6d6d('0xba')](_0x2103a1,'congestion'));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xdb'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,_0x6d6d('0xdc'));}else{if(_0x2103a1[_0x6d6d('0xdd')]>=_0x1aa25d[_0x6d6d('0xde')]){rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xdb'));}else{rpcDb[_0x6d6d('0xcf')](ut[_0x6d6d('0xb1')](_0x2103a1,_0x6d6d('0xdd'),_0x1aa25d[_0x6d6d('0xd0')]),_0x2103a1[_0x6d6d('0xb3')],_0x2103a1[_0x6d6d('0xdf')]);}}break;case _0x6d6d('0xe0'):_0x1aa25d[_0x6d6d('0x44')]+=0x1;_0x2103a1['countagentrejectretry']+=0x1;_0x2103a1['countglobal']=ut[_0x6d6d('0xad')](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0x14,_0x6d6d('0xe1'));ami[_0x6d6d('0x26')](_0x6d6d('0xe2'),ut[_0x6d6d('0xba')](_0x2103a1,_0x6d6d('0xe3')));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xe4'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0x14,_0x6d6d('0xe1'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,_0x6d6d('0xe5'));}else{if(_0x2103a1['countagentrejectretry']>=_0x1aa25d[_0x6d6d('0xe6')]){rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xe5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2103a1,'countagentrejectretry',_0x1aa25d[_0x6d6d('0xe7')]),_0x2103a1['unlockAgent'],_0x2103a1['activeContact']);}}break;case _0x6d6d('0xe8'):_0x1aa25d[_0x6d6d('0x46')]+=0x1;_0x2103a1[_0x6d6d('0xe9')]+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut[_0x6d6d('0xad')](_0x2103a1);ut['logCustomer'](_0x2103a1,0xb,_0x6d6d('0xea'));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xeb'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut['cloneAction'](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb['createCustomerFinal'](_0x1d1d1d,_0x6d6d('0xeb'));}else{if(_0x2103a1['countabandonedetry']>=_0x1aa25d[_0x6d6d('0xec')]){rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xeb'));}else{rpcDb['rescheduleContact'](ut[_0x6d6d('0xb1')](_0x2103a1,_0x6d6d('0xe9'),_0x1aa25d['dialAbandonedRetryFrequency']),_0x2103a1[_0x6d6d('0xb3')],_0x2103a1[_0x6d6d('0xdf')]);}}break;case'18':_0x1aa25d[_0x6d6d('0x45')]+=0x1;_0x2103a1[_0x6d6d('0xed')]+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut[_0x6d6d('0xad')](_0x2103a1);ut['logCustomer'](_0x2103a1,0x12,_0x30e31f[_0x6d6d('0xee')]||_0x30e31f[_0x6d6d('0xef')]);ami['emit'](_0x6d6d('0xf0'),ut[_0x6d6d('0xba')](_0x2103a1,_0x6d6d('0xf1')));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xf2'));if(ut['totalGlobal'](_0x2103a1)>=_0x1aa25d['dialGlobalMaxRetry']){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,_0x6d6d('0xf2'));}else{rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xf2'));}delete this[_0x6d6d('0x16')][_0x30e31f['linkedid']];break;case'19':_0x1aa25d['outboundUnknownCallsDay']+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut[_0x6d6d('0xad')](_0x2103a1);ut['logCustomer'](_0x2103a1,0x13,_0x30e31f[_0x6d6d('0xee')]||_0x30e31f[_0x6d6d('0xef')]);ami[_0x6d6d('0x26')](_0x6d6d('0xf0'),ut[_0x6d6d('0xba')](_0x2103a1,'amd'));rpcDb[_0x6d6d('0x9b')](_0x2103a1,_0x6d6d('0xf3'));if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb['createCustomerFinal'](_0x1d1d1d,_0x6d6d('0xf3'));}else{rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xf3'));}delete this[_0x6d6d('0x16')][_0x30e31f[_0x6d6d('0xb4')]];break;default:if(_0x2103a1[_0x6d6d('0x77')]){ut[_0x6d6d('0x82')](_0x1aa25d,_0x6d6d('0xf4'));ut[_0x6d6d('0x84')](_0x6d6d('0xf5')+_0x1aa25d[_0x6d6d('0x29')],_0x30e31f);}_0x1aa25d[_0x6d6d('0x45')]+=0x1;_0x2103a1[_0x6d6d('0xa9')]=ut['totalGlobal'](_0x2103a1);ut[_0x6d6d('0x9d')](_0x2103a1,0xc,_0x30e31f[_0x6d6d('0xee')]||_0x30e31f[_0x6d6d('0xef')]);rpcDb[_0x6d6d('0x9b')](_0x2103a1,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x6d6d('0xad')](_0x2103a1)>=_0x1aa25d[_0x6d6d('0xae')]){_0x1d1d1d=ut[_0x6d6d('0xaf')](_0x2103a1,0xf,_0x6d6d('0xcb'));rpcDb[_0x6d6d('0xc0')](_0x1d1d1d,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x6d6d('0xc0')](_0x2103a1,_0x6d6d('0xf6'));}delete this[_0x6d6d('0x16')][_0x30e31f[_0x6d6d('0xb4')]];}if(!(_0x2103a1['dialAnswer']&&_0x3fa820==='16')){ut[_0x6d6d('0x81')](_0x1aa25d,_0x6d6d('0xf7'));logger[_0x6d6d('0x5d')](_0x6d6d('0xf8'),_0x2103a1[_0x6d6d('0xc4')],_0x6d6d('0xc5'),_0x1aa25d[_0x6d6d('0x29')],_0x6d6d('0x74'),_0x1aa25d[_0x6d6d('0x50')]);}if(_0x3fa820!==_0x6d6d('0xb5')){delete this[_0x6d6d('0x16')][_0x30e31f[_0x6d6d('0xb4')]];delete this[_0x6d6d('0x16')][_0x30e31f[_0x6d6d('0xf9')]];}}};Preview[_0x6d6d('0x10')]['callProgressDetectingAgent']=function(_0x23d98a,_0x4cd7d8,_0x5e32ad){if(_[_0x6d6d('0xfa')](_0x4cd7d8)&&_0x6d6d('0xfb')!==typeof _0x4cd7d8){return;}if(_[_0x6d6d('0xfa')](_0x5e32ad)&&'object'!==typeof _0x5e32ad){return;}switch(_0x5e32ad[_0x6d6d('0xfc')]){case'0':ut[_0x6d6d('0xfd')](_0x23d98a,0x0,_0x6d6d('0xaa'));rpcDb[_0x6d6d('0xfe')](_0x23d98a,_0x6d6d('0xff'));break;case'3':ut[_0x6d6d('0xfd')](_0x23d98a,0x3,_0x6d6d('0xd3'));rpcDb[_0x6d6d('0xfe')](_0x23d98a,_0x6d6d('0x100'));break;case'5':ut[_0x6d6d('0xfd')](_0x23d98a,0x5,'Busy');rpcDb['createAgentHistory'](_0x23d98a,_0x6d6d('0x101'));break;case'8':ut[_0x6d6d('0xfd')](_0x23d98a,0x8,_0x6d6d('0xda'));rpcDb[_0x6d6d('0xfe')](_0x23d98a,_0x6d6d('0x102'));break;case'22':ut[_0x6d6d('0xfd')](_0x23d98a,0x16,_0x6d6d('0x103'));rpcDb['createAgentHistory'](_0x23d98a,_0x6d6d('0x104'));break;default:ut[_0x6d6d('0xfd')](_0x23d98a,0xc,_0x5e32ad[_0x6d6d('0xfc')]);rpcDb[_0x6d6d('0xfe')](_0x23d98a,'[callProgressDetectingAgent][logCongestion]');}ut[_0x6d6d('0x81')](_0x4cd7d8,_0x6d6d('0x105'));logger[_0x6d6d('0x5d')]('[originated][decrement][callProgressDetectingAgent]',_0x23d98a[_0x6d6d('0xc4')],_0x6d6d('0xc5'),_0x4cd7d8[_0x6d6d('0x29')],_0x6d6d('0x74'),_0x4cd7d8[_0x6d6d('0x50')]);delete this[_0x6d6d('0x16')][_0x23d98a[_0x6d6d('0xc4')]];};Preview[_0x6d6d('0x10')][_0x6d6d('0x106')]=function(_0xbe6d17,_0x193312,_0x1eafcb,_0x517f2f,_0x2f1b59){var _0x53160d=this;return new BPromise(function(_0x4b61e4,_0x4dc27b){if(_['isNil'](_0x193312)||_['isNil'](_0x193312[_0x6d6d('0x107')])||_['isNil'](_0x193312[_0x6d6d('0x107')]['phone'])||_[_0x6d6d('0x70')](_0x193312[_0x6d6d('0x7b')])){_0x4dc27b(ut['message']('Contact\x20is\x20undefined',_0x517f2f,_0x2f1b59));return;}var _0x23f498=uuid['v4']();var _0x5592fd=_0x53160d[_0x6d6d('0x25')][_0x193312[_0x6d6d('0x72')][_0x6d6d('0x29')]];var _0x53b797=_0x1eafcb?_0x53160d[_0x6d6d('0x17')][_0x1eafcb]['id']:undefined;_0x53160d['actions'][_0x23f498]=new Action(_0x193312,_0x5592fd,_0x23f498,_0x1eafcb,_0x53b797);var _0x38d705=_0x53160d[_0x6d6d('0x16')][_0x23f498];_0x38d705['unlockAgent']=_0x517f2f;_0x38d705['activeContact']=_0x2f1b59;_0x38d705[_0x6d6d('0x108')]=_0x1eafcb;if(_['isEmpty'](_0xbe6d17)){_0x53160d[_0x6d6d('0x109')](_0x38d705,_0x5592fd,_0x193312,_0x1eafcb)['then'](function(_0x3359c5){logger[_0x6d6d('0x5d')](_0x6d6d('0x10a'),'Queue:\x20'+_0x38d705['queue']+_0x6d6d('0x10b')+_0x38d705[_0x6d6d('0x10c')],JSON[_0x6d6d('0x75')](_0x3359c5));ami[_0x6d6d('0x26')](_0x6d6d('0x10d'),ut[_0x6d6d('0xba')](_0x38d705,_0x6d6d('0x10e'),_0x53160d['campaignsPreview'][_0x38d705[_0x6d6d('0x73')]]));_0x4b61e4(ut[_0x6d6d('0x67')](_0x6d6d('0x10f')));})[_0x6d6d('0x7f')](function(_0x2b483d){ut[_0x6d6d('0x64')](_0x6d6d('0x110'),_0x2b483d);_0x4dc27b(ut[_0x6d6d('0x67')](_0x6d6d('0x111'),_0x517f2f,_0x2f1b59));});}else{_0x5592fd['outboundBlacklistCallsDay']+=0x1;ut[_0x6d6d('0x112')](_0x38d705);rpcDb[_0x6d6d('0x113')](_0x38d705,_0x6d6d('0x114'));delete _0x53160d['actions'][_0x23f498];_0x4dc27b(ut['message'](_0x6d6d('0x115'),_0x517f2f,_0x2f1b59));}});};Preview[_0x6d6d('0x10')][_0x6d6d('0xa4')]=function(_0x112ed3){return!_[_0x6d6d('0x70')](_0x112ed3)&&!_[_0x6d6d('0x70')](_0x112ed3[_0x6d6d('0x29')])&&!_[_0x6d6d('0x70')](_0x112ed3[_0x6d6d('0x57')])&&_0x112ed3['active']&&!_['isNil'](this['trunks'][util[_0x6d6d('0x5a')](_0x6d6d('0x116'),_0x112ed3[_0x6d6d('0x29')])])&&!_[_0x6d6d('0x70')](this[_0x6d6d('0x15')][util[_0x6d6d('0x5a')](_0x6d6d('0x116'),_0x112ed3[_0x6d6d('0x29')])][_0x6d6d('0x7d')])&&(this[_0x6d6d('0x15')][util['format']('SIP/%s',_0x112ed3['name'])]['status']===_0x6d6d('0x117')||this['trunks'][util[_0x6d6d('0x5a')]('SIP/%s',_0x112ed3[_0x6d6d('0x29')])][_0x6d6d('0x7d')]==='unmonitored');};Preview['prototype'][_0x6d6d('0x93')]=function(_0xcbb056,_0x1269f3){var _0x1f44e0=this;return new BPromise(function(_0x577754,_0x5a5a4b){_0x1f44e0[_0x6d6d('0x118')](_0xcbb056,_0x1269f3)['then'](function(_0x2e25af){_0x577754(_['pick'](_0x2e25af,[_0x6d6d('0x67')]));})[_0x6d6d('0x7f')](function(_0x23c408){if(_0x23c408[_0x6d6d('0x119')]){rpcDb[_0x6d6d('0x11a')](_0xcbb056);}if(_0x23c408['active']){rpcDb['disableContact'](_0xcbb056);}_0x5a5a4b(_[_0x6d6d('0x78')](_0x23c408,[_0x6d6d('0x67')]));});});};Preview[_0x6d6d('0x10')][_0x6d6d('0x118')]=function(_0x3951e4,_0x1d863e){var _0x23f266=this;return new BPromise(function(_0xd26616,_0x576ef8){var _0x2670e4,_0x29005c;rpcDb[_0x6d6d('0x11b')](_0x3951e4)[_0x6d6d('0x8d')](function(_0x5d169e){if(!_['isNil'](_0x5d169e[0x0])){_0x29005c=_0x5d169e[0x0][_0x6d6d('0x11c')]?![]:!![];_0x2670e4=_0x5d169e[0x0]['recallme']?!![]:![];_0x2670e4=_0x1d863e?!![]:_0x2670e4;}var _0x4acf03=_0x23f266[_0x6d6d('0x11d')](_0x5d169e);if(_0x4acf03['isValid']){rpcDb['checkIsBlackList'](_[_0x6d6d('0x78')](_0x5d169e[0x0],[_0x6d6d('0x7b'),_0x6d6d('0x11e')]))[_0x6d6d('0x8d')](function(_0x523319){_0x23f266[_0x6d6d('0x106')](_0x523319,_0x5d169e[0x0],_0x1d863e,_0x29005c,_0x2670e4)[_0x6d6d('0x8d')](function(_0x25f457){_0xd26616(_0x25f457);})[_0x6d6d('0x7f')](function(_0x49c750){_0x576ef8(_0x49c750);});})[_0x6d6d('0x7f')](function(_0x148766){ut['logger']('[Preview][checkIsBlackList]',_0x148766);_0x576ef8(ut[_0x6d6d('0x67')](_0x6d6d('0x11f'),_0x29005c,_0x2670e4));});}else{_0x576ef8(ut['message'](_0x4acf03[_0x6d6d('0x67')],_0x29005c,_0x2670e4));}})[_0x6d6d('0x7f')](function(_0x3a7c8b){ut[_0x6d6d('0x64')](_0x6d6d('0x120'),_0x3a7c8b);_0x576ef8(ut[_0x6d6d('0x67')](_0x6d6d('0x11f'),![],!![]));});});};Preview[_0x6d6d('0x10')][_0x6d6d('0x11d')]=function(_0x3bd687){if(_[_0x6d6d('0x70')](_0x3bd687)||_[_0x6d6d('0x121')](_0x3bd687)||!_['isNil'](_0x3bd687[0x0][_0x6d6d('0x91')])&&_['isNil'](_0x3bd687[0x0][_0x6d6d('0x91')][_0x6d6d('0x29')])){ut[_0x6d6d('0x64')]('[Preview][validateContact][Empty\x20Contact]',_0x3bd687);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xe718e8=this[_0x6d6d('0x25')][_0x3bd687[0x0][_0x6d6d('0x72')][_0x6d6d('0x29')]];_0xe718e8['message']=_0x6d6d('0xa6');if(_['isNil'](_0xe718e8)){ut[_0x6d6d('0x64')]('[Preview][validateContact][Empty\x20Campaign]',_0xe718e8);return{'isValid':![],'message':_0x6d6d('0x122')};}if(!this[_0x6d6d('0xa4')](_0xe718e8[_0x6d6d('0x56')])){ut['logger'](_0x6d6d('0x123'),'campaign\x20Name:\x20'+_0xe718e8[_0x6d6d('0x29')]+_0x6d6d('0x124'));if(!this['isTrunkReachable'](_0xe718e8[_0x6d6d('0xa5')])){ut['logger'](_0x6d6d('0x123'),_0xe718e8[_0x6d6d('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x6d6d('0x125')};}}if(!ut[_0x6d6d('0x126')](_0xe718e8['dialActive'])){ut[_0x6d6d('0x64')](_0x6d6d('0x127'),_0xe718e8[_0x6d6d('0x29')]+_0x6d6d('0x128'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xe718e8[_0x6d6d('0x29')]+_0x6d6d('0x128')};}return{'isValid':!![],'message':_0x6d6d('0x129')};};Preview['prototype'][_0x6d6d('0x109')]=function(_0x1afe7a,_0x58c23d,_0x5a586c,_0x49e97f){var _0x253190=this;return new BPromise(function(_0x30f642,_0x3cb53d){var _0x11054e=_0x1afe7a[_0x6d6d('0xc4')];var _0x3204c6=_0x253190[_0x6d6d('0xa4')](_0x58c23d[_0x6d6d('0x56')])?util[_0x6d6d('0x5a')]('SIP/%s/%s%s',_0x58c23d[_0x6d6d('0x56')]['name'],_[_0x6d6d('0x70')](_0x58c23d['dialPrefix'])?'':_0x58c23d[_0x6d6d('0x12a')][_0x6d6d('0x12b')]()||'',_0x58c23d[_0x6d6d('0x12c')]>0x0?_0x5a586c[_0x6d6d('0x107')][_0x6d6d('0x12d')]['substring'](_0x58c23d['dialCutDigit']):_0x5a586c[_0x6d6d('0x107')]['phone']):util[_0x6d6d('0x5a')](_0x6d6d('0x12e'),_[_0x6d6d('0x70')](_0x58c23d['TrunkBackup'])?_0x58c23d[_0x6d6d('0x56')][_0x6d6d('0x29')]:_0x58c23d[_0x6d6d('0xa5')][_0x6d6d('0x29')],_[_0x6d6d('0x70')](_0x58c23d['dialPrefix'])?'':_0x58c23d[_0x6d6d('0x12a')][_0x6d6d('0x12b')]()||'',_0x58c23d[_0x6d6d('0x12c')]>0x0?_0x5a586c[_0x6d6d('0x107')][_0x6d6d('0x12d')]['substring'](_0x58c23d[_0x6d6d('0x12c')]):_0x5a586c['Contact']['phone']);var _0x509aea=_0x253190[_0x6d6d('0xa4')](_0x58c23d['Trunk'])?ut[_0x6d6d('0x12f')](_0x58c23d[_0x6d6d('0x56')][_0x6d6d('0x58')],_0x58c23d['dialOriginateCallerIdName'],_0x58c23d['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x58c23d[_0x6d6d('0x39')],_0x58c23d[_0x6d6d('0x130')]):_0x58c23d[_0x6d6d('0x39')]):ut[_0x6d6d('0x12f')](_[_0x6d6d('0x70')](_0x58c23d[_0x6d6d('0xa5')])?_0x58c23d[_0x6d6d('0x56')][_0x6d6d('0x58')]:_0x58c23d[_0x6d6d('0xa5')]['callerid'],_0x58c23d['dialOriginateCallerIdName'],_0x58c23d[_0x6d6d('0x130')]>0x0?ut[_0x6d6d('0x131')](_0x58c23d[_0x6d6d('0x39')],_0x58c23d['dialRandomLastDigitCallerIdNumber']):_0x58c23d[_0x6d6d('0x39')]);if(_0x509aea){_0x1afe7a[_0x6d6d('0x132')]=ut[_0x6d6d('0x133')](_0x509aea);_0x1afe7a[_0x6d6d('0x134')]=ut[_0x6d6d('0x135')](_0x509aea);}var _0x297c0d=ut[_0x6d6d('0x136')](_0x58c23d,_0x5a586c,_0x3204c6,_0x509aea,_0x11054e,_0x1afe7a);_[_0x6d6d('0x137')](_0x1afe7a,ut['toLowerVariables'](_0x297c0d));_0x1afe7a[_0x6d6d('0x97')]=moment()[_0x6d6d('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x6d6d('0x138')](ut[_0x6d6d('0x139')](_0x1afe7a,_0x58c23d,_0x297c0d,_0x1afe7a[_0x6d6d('0xdf')],_0x49e97f))[_0x6d6d('0x8d')](function(_0x25fe97){_0x58c23d['originated']+=0x1;logger['info'](_0x6d6d('0x13a'),_0x11054e,_0x6d6d('0xc5'),_0x58c23d[_0x6d6d('0x29')],_0x6d6d('0x74'),_0x58c23d[_0x6d6d('0x50')]);_0x30f642(_0x25fe97);})[_0x6d6d('0x7f')](function(_0x33a6b0){ut[_0x6d6d('0xfd')](_0x1afe7a,0xe,_0x6d6d('0x13b'));rpcDb['createAgentHistory'](_0x1afe7a,_0x6d6d('0x13c'));_0x3cb53d(_0x33a6b0);});});};Preview['prototype']['syncNewExten']=function(_0x5b1a34){if(this[_0x6d6d('0x16')][_0x5b1a34[_0x6d6d('0xb4')]]){this[_0x6d6d('0x16')][_0x5b1a34[_0x6d6d('0xb4')]][_0x6d6d('0x7e')]=_0x5b1a34[_0x6d6d('0x7e')];}};Preview[_0x6d6d('0x10')][_0x6d6d('0x13d')]=function(_0x295e50){var _0x3e7fbc=this;var _0x5b2f13=this[_0x6d6d('0x16')][_0x295e50[_0x6d6d('0x13e')]];if(_0x5b2f13){if(_0x5b2f13[_0x6d6d('0x108')]&&this[_0x6d6d('0x17')][_0x5b2f13[_0x6d6d('0x108')]]){ut[_0x6d6d('0x13f')](_0x5b2f13,this[_0x6d6d('0x17')][_0x5b2f13[_0x6d6d('0x108')]][_0x6d6d('0x29')],this[_0x6d6d('0x17')][_0x5b2f13['lookAgent']]['id']);}var _0x2f8e24=_['clone'](_0x5b2f13);_0x2f8e24[_0x6d6d('0xb6')]=moment()[_0x6d6d('0x5a')](_0x6d6d('0x140'));var _0x54fc39=_0x3e7fbc['campaignsPreview'][_0x5b2f13[_0x6d6d('0x73')]];if(ut[_0x6d6d('0x141')](_0x295e50['response'])){if(_0x5b2f13[_0x6d6d('0xb3')]){rpcDb[_0x6d6d('0x11a')](_0x5b2f13[_0x6d6d('0x10c')]);}if(_0x5b2f13[_0x6d6d('0xdf')]){rpcDb[_0x6d6d('0x96')](_0x5b2f13[_0x6d6d('0x10c')]);}ami[_0x6d6d('0x26')](_0x6d6d('0x142'),ut[_0x6d6d('0xba')](_0x5b2f13,_0x6d6d('0x143'),this[_0x6d6d('0x25')][_0x5b2f13['queue']]));this[_0x6d6d('0x144')](_0x2f8e24,_0x54fc39,_0x295e50);}else{_0x5b2f13[_0x6d6d('0x97')]=moment()[_0x6d6d('0x5a')](_0x6d6d('0x140'));ut[_0x6d6d('0xfd')](_0x2f8e24,0x4,'Answer');rpcDb['createAgentHistory'](_0x2f8e24,_0x6d6d('0x145'));}}};Preview[_0x6d6d('0x10')][_0x6d6d('0x1c')]=function(_0x1a87d6){var _0x23d3bf=this;var _0x2a4cf4=this['actions'][_0x1a87d6['linkedid']];var _0x1194f8;if(_0x2a4cf4){_0x1194f8=this[_0x6d6d('0x25')][_0x2a4cf4[_0x6d6d('0x73')]];logger[_0x6d6d('0x5d')](_0x6d6d('0x146'),_0x1a87d6[_0x6d6d('0xb4')],_0x6d6d('0xc5'),_0x1194f8[_0x6d6d('0x29')],'pTalking:\x20',_0x1194f8[_0x6d6d('0x2e')]);}if(this[_0x6d6d('0x16')][_0x1a87d6[_0x6d6d('0xb4')]]&&_0x1a87d6[_0x6d6d('0xb4')]!==_0x1a87d6['uniqueid']){if(_0x1a87d6[_0x6d6d('0x147')]==='16'&&this[_0x6d6d('0x16')][_0x1a87d6[_0x6d6d('0xb4')]][_0x6d6d('0x77')]){this[_0x6d6d('0xa7')](_0x1a87d6,_0x1a87d6['linkedid'],_0x1a87d6['cause']);}else if(this[_0x6d6d('0x16')][_0x1a87d6[_0x6d6d('0xb4')]][_0x6d6d('0x77')]){logger['info']('[syncHangup][talking][cause]',_0x1a87d6[_0x6d6d('0xb4')],_0x1a87d6[_0x6d6d('0x147')],_0x6d6d('0xc5'),_0x1194f8[_0x6d6d('0x29')],'pTalking:\x20',_0x1194f8['pTalking']);this[_0x6d6d('0xa7')](_0x1a87d6,_0x1a87d6[_0x6d6d('0xb4')],_0x1a87d6[_0x6d6d('0x147')]);}}else if(_0x2a4cf4&&_[_0x6d6d('0x70')](_0x2a4cf4[_0x6d6d('0x148')])&&_0x1194f8[_0x6d6d('0x149')]&&_0x1a87d6[_0x6d6d('0xb4')]===_0x1a87d6[_0x6d6d('0xc4')]&&_[_0x6d6d('0x70')](_0x1a87d6[_0x6d6d('0xfc')])&&_0x1a87d6[_0x6d6d('0x147')]==='16'&&_0x1a87d6['channelstate']==='6'&&_[_0x6d6d('0xfa')](_0x2a4cf4[_0x6d6d('0x14a')])){if(_0x2a4cf4['unlockAgent']){rpcDb[_0x6d6d('0x11a')](_0x2a4cf4[_0x6d6d('0x10c')]);}if(_0x2a4cf4[_0x6d6d('0xdf')]){rpcDb[_0x6d6d('0x96')](_0x2a4cf4[_0x6d6d('0x10c')]);}_0x1a87d6[_0x6d6d('0xfc')]='22';this[_0x6d6d('0x144')](_0x2a4cf4,_0x1194f8,_0x1a87d6);}else if(_0x2a4cf4&&_0x2a4cf4[_0x6d6d('0x14a')]){if(_0x1a87d6[_0x6d6d('0x147')]==='16'&&this[_0x6d6d('0x16')][_0x1a87d6['linkedid']]['dialAnswer']){logger['info'](_0x6d6d('0x14b'),_0x1a87d6[_0x6d6d('0xb4')],_0x1a87d6[_0x6d6d('0x147')],'\x20Queue',_0x1194f8[_0x6d6d('0x29')],_0x6d6d('0x76'),_0x1194f8[_0x6d6d('0x2e')]);this['callProgressDetectingCustomer'](_0x1a87d6,_0x1a87d6['linkedid'],_0x1a87d6[_0x6d6d('0x147')]);}else if(this['actions'][_0x1a87d6[_0x6d6d('0xb4')]][_0x6d6d('0x77')]){logger[_0x6d6d('0x5d')](_0x6d6d('0x14c'),_0x1a87d6[_0x6d6d('0xb4')],_0x1a87d6[_0x6d6d('0x147')],_0x6d6d('0xc5'),_0x1194f8[_0x6d6d('0x29')],_0x6d6d('0x76'),_0x1194f8[_0x6d6d('0x2e')]);this['callProgressDetectingCustomer'](_0x1a87d6,_0x1a87d6[_0x6d6d('0xb4')],_0x1a87d6[_0x6d6d('0x147')]);}}};Preview[_0x6d6d('0x10')]['syncDialEnd']=function(_0x3a47d4){if(this['actions'][_0x3a47d4['destlinkedid']]&&_0x3a47d4['destlinkedid']!==_0x3a47d4['destuniqueid']){this['callProgressDetectingCustomer'](_0x3a47d4,_0x3a47d4[_0x6d6d('0xf9')],_0x3a47d4['dialstatus']);}};Preview[_0x6d6d('0x10')][_0x6d6d('0x14d')]=function(_0x44a7ba){if(this[_0x6d6d('0x16')][_0x44a7ba['linkedid']]&&_0x44a7ba[_0x6d6d('0xb4')]!==_0x44a7ba[_0x6d6d('0xc4')]&&!this['actions'][_0x44a7ba['linkedid']][_0x6d6d('0x77')]){if(_0x44a7ba[_0x6d6d('0x147')]==='1'){this['callProgressDetectingCustomer'](_0x44a7ba,_0x44a7ba[_0x6d6d('0xb4')],_0x44a7ba[_0x6d6d('0x147')]);}}};Preview['prototype'][_0x6d6d('0x14e')]=function(_0x263039,_0x3becf6,_0x5a5f4d){if(this[_0x6d6d('0x16')][_0x263039]){if(_[_0x6d6d('0x70')](this[_0x6d6d('0x16')][_0x263039][_0x6d6d('0x14f')])){this[_0x6d6d('0x16')][_0x263039][_0x6d6d('0x14f')]={};}this['actions'][_0x263039][_0x6d6d('0x14f')][_0x3becf6]=_0x5a5f4d;}};Preview[_0x6d6d('0x10')][_0x6d6d('0x21')]=function(_0x48f8ad){try{if(!_[_0x6d6d('0x70')](_0x48f8ad)){if(ut[_0x6d6d('0x150')](_[_0x6d6d('0x151')](_0x48f8ad[_0x6d6d('0x152')])[0x0])){this[_0x6d6d('0x14e')](_0x48f8ad['uniqueid'],_[_0x6d6d('0x151')](_0x48f8ad['variable'])[0x0],_0x48f8ad[_0x6d6d('0x153')]);}}}catch(_0x37015c){logger['error']('[syncVarSet][Preview]',util[_0x6d6d('0x154')](_0x37015c,{'showHidden':![],'depth':null}));}};Preview[_0x6d6d('0x10')][_0x6d6d('0x155')]=function(_0x14cadd){if(_0x14cadd){if(this['actions'][_0x14cadd[_0x6d6d('0x156')]]){this[_0x6d6d('0x16')][_0x14cadd[_0x6d6d('0x156')]][_0x6d6d('0x14a')]=!![];}}};Preview[_0x6d6d('0x10')][_0x6d6d('0x157')]=function(_0x24fce3){if(_0x24fce3){if(this['actions'][_0x24fce3[_0x6d6d('0x158')]]){this[_0x6d6d('0x16')][_0x24fce3['transfererlinkedid']]['transfer']=!![];}}};module[_0x6d6d('0x159')]=Preview; \ No newline at end of file +var _0xdc97=['syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','name','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','prototype','syncCampaigns','hasOwnProperty','type','clearZombieChannels','dialMethod','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','Queue','originated:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','length','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','catch','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','custom:agentConnectPreview','custom:agentcomplete','complete','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','phone','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','merge','toLowerVariables','starttime','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','Answer','syncHangup','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','trunks','actions','agents','clockClearZombieChannels','originateresponse'];(function(_0x203604,_0x4fe2c9){var _0xba4e5=function(_0x1a9380){while(--_0x1a9380){_0x203604['push'](_0x203604['shift']());}};_0xba4e5(++_0x4fe2c9);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2382d5,_0x5645f9){_0x2382d5=_0x2382d5-0x0;var _0x587af2=_0xdc97[_0x2382d5];return _0x587af2;};'use strict';var util=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var BPromise=require(_0x7dc9('0x2'));var uuid=require('uuid');var moment=require(_0x7dc9('0x3'));var md5=require('md5');var Redis=require(_0x7dc9('0x4'));var config=require(_0x7dc9('0x5'));var logger=require('../../../config/logger')(_0x7dc9('0x6'));var loggerAction=require(_0x7dc9('0x7'))(_0x7dc9('0x8'));var ami=require(_0x7dc9('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x7dc9('0xa'));var ut=require('./util/util');config['redis']=_[_0x7dc9('0xb')](config[_0x7dc9('0xc')],{'host':_0x7dc9('0xd'),'port':0x18eb});var io=require(_0x7dc9('0xe'))(new Redis(config[_0x7dc9('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x7dc9('0xf')]=function(_0x44fe24){this[_0x7dc9('0x10')]=this[_0x7dc9('0x10')]?this[_0x7dc9('0x10')][_0x7dc9('0x11')](_0x44fe24):_0x44fe24();};function Preview(_0x1e336a){this['sequence']=new Sequence();this['campaignsPreview']=_0x1e336a['voiceQueues'];this['trunks']=_0x1e336a[_0x7dc9('0x12')];this[_0x7dc9('0x13')]={};this['agents']=_0x1e336a[_0x7dc9('0x14')];this[_0x7dc9('0x15')]=0x0;ami['on'](_0x7dc9('0x16'),this[_0x7dc9('0x17')][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x19'),this['syncHangup'][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x1a'),this[_0x7dc9('0x1b')][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x1c'),this[_0x7dc9('0x1d')][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x1e'),this[_0x7dc9('0x1f')]['bind'](this));ami['on'](_0x7dc9('0x20'),this['syncVarSet'][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x21'),this['syncAttendedTransfer'][_0x7dc9('0x18')](this));ami['on'](_0x7dc9('0x22'),this[_0x7dc9('0x23')][_0x7dc9('0x18')](this));this[_0x7dc9('0x24')](this[_0x7dc9('0x25')]);}function emit(_0x2dad65,_0x2895f5,_0x155cc4){io['to'](_0x2dad65)[_0x7dc9('0x26')](_0x2895f5,_0x155cc4);}function emitCampaignPreview(_0x576681){if(_0x576681['type']===_0x7dc9('0x27')){var _0x5981e2={'id':_0x576681['id'],'name':_0x576681['name'],'strategy':_0x576681[_0x7dc9('0x28')],'answered':_0x576681[_0x7dc9('0x29')],'available':_0x576681['available'],'loggedIn':_0x576681[_0x7dc9('0x2a')],'pTalking':_0x576681[_0x7dc9('0x2b')],'sumBillable':_0x576681[_0x7dc9('0x2c')],'sumDuration':_0x576681['sumDuration'],'sumHoldTime':_0x576681[_0x7dc9('0x2d')]||0x0,'talking':_0x576681[_0x7dc9('0x2e')],'total':_0x576681[_0x7dc9('0x2f')],'type':_0x576681['type'],'unmanaged':_0x576681['unmanaged'],'abandoned':_0x576681['abandoned'],'waiting':_0x576681[_0x7dc9('0x30')],'loggedInDb':_0x576681[_0x7dc9('0x31')],'dialActive':_0x576681['dialActive'],'dialMethod':_0x576681['dialMethod'],'dialOriginateCallerIdName':_0x576681[_0x7dc9('0x32')],'dialOriginateCallerIdNumber':_0x576681['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x576681[_0x7dc9('0x33')],'dialPrefix':_0x576681[_0x7dc9('0x34')],'outboundAnswerAgiCallsDay':_0x576681[_0x7dc9('0x35')],'outboundAnswerCallsDay':_0x576681[_0x7dc9('0x36')],'outboundBlacklistCallsDay':_0x576681[_0x7dc9('0x37')],'outboundBusyCallsDay':_0x576681[_0x7dc9('0x38')],'outboundCongestionCallsDay':_0x576681[_0x7dc9('0x39')],'outboundDropCallsDayACS':_0x576681[_0x7dc9('0x3a')],'outboundDropCallsDayCallersExit':_0x576681[_0x7dc9('0x3b')],'outboundDropCallsDayTimeout':_0x576681[_0x7dc9('0x3c')],'outboundNoAnswerCallsDay':_0x576681[_0x7dc9('0x3d')],'outboundNoSuchCallsDay':_0x576681[_0x7dc9('0x3e')],'outboundOriginateFailureCallsDay':_0x576681['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x576681['outboundReCallsDay'],'outboundRejectCallsDay':_0x576681['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x576681['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x576681['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x576681['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x576681['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x576681['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x576681[_0x7dc9('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x576681[_0x7dc9('0x40')],'predictiveIntervalErlangCalls':_0x576681[_0x7dc9('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x576681[_0x7dc9('0x42')],'predictiveIntervalHitRate':_0x576681[_0x7dc9('0x43')],'predictiveIntervalMultiplicativeFactor':_0x576681[_0x7dc9('0x44')],'predictiveIntervalPauses':_0x576681['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x576681['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x576681['predictiveIntervalTotalCalls'],'message':_0x576681[_0x7dc9('0x45')],'originated':_0x576681['originated'],'erlangCalls':_0x576681[_0x7dc9('0x46')],'erlangCallToSecond':_0x576681[_0x7dc9('0x47')],'erlangAbandonmentRate':_0x576681[_0x7dc9('0x48')],'erlangBusyFactor':_0x576681[_0x7dc9('0x49')],'startPredictive':_0x576681[_0x7dc9('0x4a')],'startProgressive':_0x576681[_0x7dc9('0x4b')]};if(_0x576681[_0x7dc9('0x4c')]){_0x5981e2[_0x7dc9('0x4c')]={'id':_0x576681['Trunk']['id'],'name':_0x576681[_0x7dc9('0x4c')]['name'],'active':_0x576681[_0x7dc9('0x4c')][_0x7dc9('0x4d')],'callerid':_0x576681[_0x7dc9('0x4c')][_0x7dc9('0x4e')]};}if(_0x576681['Interval']){_0x5981e2[_0x7dc9('0x4f')]={'id':_0x576681['Interval']['id'],'name':_0x576681[_0x7dc9('0x4f')]['name']};}var _0x590bed=md5(JSON[_0x7dc9('0x50')](_0x5981e2));if(_0x576681[_0x7dc9('0x51')]!==_0x590bed){_0x576681[_0x7dc9('0x51')]=_0x590bed;emit(util[_0x7dc9('0x52')]('voice:queue:%s',_0x5981e2[_0x7dc9('0x53')]),_0x7dc9('0x54'),_0x5981e2);}}}function emitVoiceQueueChannelRemove(_0x138f33){logger[_0x7dc9('0x55')](_0x7dc9('0x56'),JSON[_0x7dc9('0x50')](_0x138f33));emit(util[_0x7dc9('0x52')](_0x7dc9('0x57'),_0x138f33[_0x7dc9('0x53')]),_0x7dc9('0x58'),_0x138f33);io[_0x7dc9('0x26')](_0x7dc9('0x59'),_0x138f33);}function notSendMessagesQueue(_0x5a94b5){if(_0x5a94b5[_0x7dc9('0x5a')]){if(_0x5a94b5[_0x7dc9('0x5b')]===0x0&&_0x5a94b5[_0x7dc9('0x2b')]===0x0){_0x5a94b5[_0x7dc9('0x5a')]=![];_0x5a94b5['available']=0x0;_0x5a94b5[_0x7dc9('0x5c')]=0x0;_0x5a94b5[_0x7dc9('0x45')]=_0x7dc9('0x5d');ut[_0x7dc9('0x5e')](_0x7dc9('0x5f'),_0x5a94b5[_0x7dc9('0x53')]+'\x20is\x20not\x20active');}else{_0x5a94b5['message']=_0x7dc9('0x60');ut[_0x7dc9('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5a94b5[_0x7dc9('0x53')]+'\x20is\x20disactive');}emitCampaignPreview(_0x5a94b5);}}Preview[_0x7dc9('0x61')][_0x7dc9('0x24')]=function(){var _0x3bca9c=this;setInterval(function(){_0x3bca9c['syncCampaigns']();},0x7cf);};Preview[_0x7dc9('0x61')][_0x7dc9('0x62')]=function(){var _0x1929b6=this[_0x7dc9('0x25')];this[_0x7dc9('0x15')]+=0x1;for(var _0x23499a in _0x1929b6){if(_0x1929b6[_0x7dc9('0x63')](_0x23499a)&&(_0x1929b6[_0x23499a]['dialMethod']===_0x7dc9('0x6')||_0x1929b6[_0x23499a]['dialMethod']==='booked')&&_0x1929b6[_0x23499a][_0x7dc9('0x64')]===_0x7dc9('0x27')){if(this[_0x7dc9('0x15')]>0x7){this[_0x7dc9('0x15')]=0x0;this[_0x7dc9('0x65')]();}}if(_0x1929b6[_0x7dc9('0x63')](_0x23499a)&&_0x1929b6[_0x23499a][_0x7dc9('0x66')]===_0x7dc9('0x6')&&_0x1929b6[_0x23499a][_0x7dc9('0x64')]==='outbound'){if(_0x1929b6[_0x23499a][_0x7dc9('0x67')]){this[_0x7dc9('0x68')](_0x1929b6[_0x23499a]);if(_0x1929b6[_0x23499a][_0x7dc9('0x69')])this[_0x7dc9('0x6a')](_0x1929b6[_0x23499a]);}else{notSendMessagesQueue(_0x1929b6[_0x23499a]);}}}};Preview[_0x7dc9('0x61')][_0x7dc9('0x6b')]=function(_0x575393){var _0x3774cb=this;this[_0x7dc9('0x6c')]['enqueue'](function(){if(!_[_0x7dc9('0x6d')](_0x3774cb[_0x7dc9('0x13')][_0x575393])){loggerAction[_0x7dc9('0x55')]('[clearZombieChannels][talking]',_0x575393,_0x7dc9('0x6e'),_0x3774cb['actions'][_0x575393]['queue'],_0x7dc9('0x6f'),JSON[_0x7dc9('0x50')](_0x3774cb[_0x7dc9('0x25')][_0x3774cb['actions'][_0x575393]['queue']][_0x7dc9('0x5b')]),'pTalking:\x20',JSON[_0x7dc9('0x50')](_0x3774cb[_0x7dc9('0x25')][_0x3774cb['actions'][_0x575393][_0x7dc9('0x70')]][_0x7dc9('0x2b')]),JSON[_0x7dc9('0x50')](_0x3774cb[_0x7dc9('0x13')][_0x575393][_0x7dc9('0x71')]),JSON[_0x7dc9('0x50')](_[_0x7dc9('0x72')](_0x3774cb[_0x7dc9('0x13')][_0x575393],[_0x7dc9('0x73'),_0x7dc9('0x74'),_0x7dc9('0x75'),_0x7dc9('0x76')])));return ami[_0x7dc9('0x77')]({'action':'status','channel':_0x3774cb[_0x7dc9('0x13')][_0x575393]['channel']})['catch'](function(_0x446103){if(_0x446103[_0x7dc9('0x45')]===_0x7dc9('0x78')){setTimeout(function(){if(_0x3774cb[_0x7dc9('0x13')][_0x575393]){ut[_0x7dc9('0x79')](_0x3774cb['campaignsPreview'][_0x3774cb[_0x7dc9('0x13')][_0x575393][_0x7dc9('0x70')]],_0x7dc9('0x7a'));if(_0x3774cb['actions'][_0x575393][_0x7dc9('0x71')]===!![]){ut[_0x7dc9('0x7b')](_0x3774cb[_0x7dc9('0x25')][_0x3774cb[_0x7dc9('0x13')][_0x575393][_0x7dc9('0x70')]],_0x7dc9('0x7a'));ut['loggerError'](_0x7dc9('0x7c')+_0x575393,_0x3774cb[_0x7dc9('0x13')][_0x575393][_0x7dc9('0x70')]);}ut[_0x7dc9('0x7d')](_0x7dc9('0x7e')+_0x575393,_0x3774cb[_0x7dc9('0x13')][_0x575393][_0x7dc9('0x70')]);delete _0x3774cb[_0x7dc9('0x13')][_0x575393];}},0x2328);}});}});};Preview[_0x7dc9('0x61')][_0x7dc9('0x65')]=function(){var _0x329950=this;loggerAction[_0x7dc9('0x55')]('[action]',_[_0x7dc9('0x7f')](this[_0x7dc9('0x13')]));for(var _0x38df9a in this[_0x7dc9('0x13')]){if(_0x329950[_0x7dc9('0x13')]['hasOwnProperty'](_0x38df9a)){_0x329950[_0x7dc9('0x6b')](_0x38df9a);}}};Preview[_0x7dc9('0x61')][_0x7dc9('0x6a')]=function(_0x17ed6c){var _0x2a1db8=this;rpcDb[_0x7dc9('0x80')](_0x17ed6c['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x25bdee){if(!_[_0x7dc9('0x6d')](_0x25bdee)){for(var _0x32a64f=0x0;_0x32a64f<_0x25bdee[_0x7dc9('0x81')];_0x32a64f+=0x1){if(ut['getDiff'](_0x25bdee[_0x32a64f]['scheduledat'])<_0x17ed6c[_0x7dc9('0x82')]*0x3c){if(_0x25bdee[_0x32a64f][_0x7dc9('0x83')]&&!_0x25bdee[_0x32a64f][_0x7dc9('0x83')][_0x7dc9('0x84')]){_0x2a1db8[_0x7dc9('0x85')](_0x25bdee[_0x32a64f]['id'])[_0x7dc9('0x86')](ut[_0x7dc9('0x87')]('[RecallMe]'))[_0x7dc9('0x88')](ut[_0x7dc9('0x87')](_0x7dc9('0x89')));}else{rpcDb[_0x7dc9('0x8a')](_0x25bdee[_0x32a64f]['id']);}}else{var _0x4683b3=new Action(_0x25bdee[_0x32a64f],_0x17ed6c);_0x4683b3['starttime']=moment()[_0x7dc9('0x52')](_0x7dc9('0x8b'));_0x17ed6c[_0x7dc9('0x8c')]+=0x1;ut[_0x7dc9('0x8d')](_0x4683b3,0x17,_0x7dc9('0x8e'));if(_0x17ed6c[_0x7dc9('0x8f')]){rpcDb[_0x7dc9('0x90')](ut[_0x7dc9('0x91')](_0x25bdee[_0x32a64f]));rpcDb[_0x7dc9('0x92')](_0x4683b3,_0x7dc9('0x93'));}else{ut[_0x7dc9('0x8d')](_0x4683b3,0x16,_0x7dc9('0x94'));rpcDb[_0x7dc9('0x92')](_0x4683b3,'[HistoryRecallClose]');rpcDb[_0x7dc9('0x95')](_0x4683b3,'[HistoryRecallClose]');}}}}})[_0x7dc9('0x88')](ut[_0x7dc9('0x87')]('[getContactRecallMe]'));};Preview[_0x7dc9('0x61')][_0x7dc9('0x68')]=function(_0x50e9a9){_0x50e9a9[_0x7dc9('0x5a')]=!![];if(ut[_0x7dc9('0x96')](_0x50e9a9[_0x7dc9('0x2a')])){_0x50e9a9['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x7dc9('0x97')](_0x50e9a9[_0x7dc9('0x67')])){_0x50e9a9[_0x7dc9('0x45')]=_0x7dc9('0x5d');}else if(!this[_0x7dc9('0x98')](_0x50e9a9[_0x7dc9('0x4c')])){if(!this[_0x7dc9('0x98')](_0x50e9a9[_0x7dc9('0x99')])){_0x50e9a9[_0x7dc9('0x45')]='TRUNK_IS_NOT_REACHABLE';}else{_0x50e9a9[_0x7dc9('0x45')]=_0x7dc9('0x9a');}}else{_0x50e9a9[_0x7dc9('0x45')]='ACTIVE';}emitCampaignPreview(_0x50e9a9);};Preview['prototype'][_0x7dc9('0x9b')]=function(_0x117444,_0x123fa8,_0x2cf485){var _0x59f3bd=this;var _0x4c7c6b=this[_0x7dc9('0x13')][_0x123fa8];var _0x182bc6=this[_0x7dc9('0x25')][_0x4c7c6b[_0x7dc9('0x70')]];var _0x5d211b;if(_0x182bc6){switch(_0x2cf485){case'1':_0x182bc6[_0x7dc9('0x3e')]+=0x1;_0x4c7c6b[_0x7dc9('0x9c')]+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0x0,_0x7dc9('0x9f'));ami[_0x7dc9('0x26')]('custom:agentnosuchnumber',ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xa1')));rpcDb['createCustomerHistory'](_0x4c7c6b,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6['dialGlobalMaxRetry']){_0x5d211b=ut[_0x7dc9('0xa2')](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb[_0x7dc9('0x95')](_0x5d211b,_0x7dc9('0xa4'));}else{if(_0x4c7c6b[_0x7dc9('0x9c')]>=_0x182bc6[_0x7dc9('0xa5')]){rpcDb[_0x7dc9('0x95')](_0x4c7c6b,_0x7dc9('0xa4'));}else{rpcDb[_0x7dc9('0xa6')](ut[_0x7dc9('0xa7')](_0x4c7c6b,'countnosuchnumberretry',_0x182bc6[_0x7dc9('0xa8')]),_0x4c7c6b[_0x7dc9('0xa9')],_0x4c7c6b[_0x7dc9('0xaa')]);}}delete this['actions'][_0x117444[_0x7dc9('0xab')]];break;case'ANSWER':var _0x5904c6=moment()[_0x7dc9('0x52')](_0x7dc9('0x8b'));_0x4c7c6b['responsetime']=_0x5904c6;_0x4c7c6b[_0x7dc9('0xac')]=_0x5904c6;_0x4c7c6b['dialAnswer']=!![];_0x182bc6['pTalking']+=0x1;logger[_0x7dc9('0x55')](_0x7dc9('0xad'),_0x4c7c6b[_0x7dc9('0xae')],_0x7dc9('0xaf'),_0x182bc6['name'],_0x7dc9('0xb0'),_0x182bc6[_0x7dc9('0x2b')]);ami[_0x7dc9('0x26')](_0x7dc9('0xb1'),ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xb2'),this[_0x7dc9('0x25')][_0x4c7c6b[_0x7dc9('0x70')]]));if(_0x182bc6['acw']){ami['emit'](_0x7dc9('0xb3'),ut['buildAcw'](_0x4c7c6b));}break;case'16':ami[_0x7dc9('0x26')](_0x7dc9('0xb4'),ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xb5'),this['campaignsPreview'][_0x4c7c6b[_0x7dc9('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x7dc9('0xa0')](_0x4c7c6b,'complete'));_0x182bc6[_0x7dc9('0x36')]+=0x1;_0x182bc6[_0x7dc9('0x2f')]+=0x1;_0x182bc6[_0x7dc9('0x29')]+=0x1;ut[_0x7dc9('0x7b')](_0x182bc6,'[16]');_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut['logCustomer'](_0x4c7c6b,0x4,'Answer');rpcDb[_0x7dc9('0x92')](_0x4c7c6b,_0x7dc9('0xb6'));rpcDb['createCustomerFinal'](_0x4c7c6b,_0x7dc9('0xb7'));rpcDb['crateCustomerReportQueue'](_0x4c7c6b);_0x182bc6[_0x7dc9('0xb8')]+=_0x4c7c6b[_0x7dc9('0xb9')];_0x182bc6[_0x7dc9('0x2c')]+=_0x4c7c6b['talktime'];logger[_0x7dc9('0x55')](_0x7dc9('0xba'),_0x4c7c6b[_0x7dc9('0xae')],'\x20Queue',_0x182bc6[_0x7dc9('0x53')],'pTalking:\x20',_0x182bc6['pTalking']);delete this[_0x7dc9('0x13')][_0x117444[_0x7dc9('0xab')]];break;case _0x7dc9('0xbb'):_0x182bc6[_0x7dc9('0x38')]+=0x1;_0x4c7c6b[_0x7dc9('0xbc')]+=0x1;_0x4c7c6b['countglobal']=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0x5,_0x7dc9('0xbd'));ami[_0x7dc9('0x26')](_0x7dc9('0xbe'),ut['buildObj'](_0x4c7c6b,_0x7dc9('0xbf')));rpcDb[_0x7dc9('0x92')](_0x4c7c6b,_0x7dc9('0xc0'));if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6['dialGlobalMaxRetry']){_0x5d211b=ut[_0x7dc9('0xa2')](_0x4c7c6b,0xf,'Global');rpcDb['createCustomerFinal'](_0x5d211b,_0x7dc9('0xc1'));}else{if(_0x4c7c6b['countbusyretry']>=_0x182bc6[_0x7dc9('0xc2')]){rpcDb[_0x7dc9('0x95')](_0x4c7c6b,_0x7dc9('0xc0'));}else{rpcDb[_0x7dc9('0xa6')](ut[_0x7dc9('0xa7')](_0x4c7c6b,_0x7dc9('0xbc'),_0x182bc6['dialBusyRetryFrequency']),_0x4c7c6b[_0x7dc9('0xa9')],_0x4c7c6b[_0x7dc9('0xaa')]);}}break;case _0x7dc9('0xc3'):_0x182bc6[_0x7dc9('0x3d')]+=0x1;_0x4c7c6b[_0x7dc9('0xc4')]+=0x1;_0x4c7c6b['countglobal']=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut['logCustomer'](_0x4c7c6b,0x3,_0x7dc9('0xc5'));ami[_0x7dc9('0x26')](_0x7dc9('0xc6'),ut['buildObj'](_0x4c7c6b,_0x7dc9('0xc7')));rpcDb[_0x7dc9('0x92')](_0x4c7c6b,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut[_0x7dc9('0xa2')](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb['createCustomerFinal'](_0x5d211b,_0x7dc9('0xc9'));}else{if(_0x4c7c6b['countnoanswerretry']>=_0x182bc6[_0x7dc9('0xca')]){rpcDb[_0x7dc9('0x95')](_0x4c7c6b,_0x7dc9('0xcb'));}else{rpcDb['rescheduleContact'](ut[_0x7dc9('0xa7')](_0x4c7c6b,_0x7dc9('0xc4'),_0x182bc6[_0x7dc9('0xcc')]),_0x4c7c6b['unlockAgent'],_0x4c7c6b['activeContact']);}}break;case _0x7dc9('0xcd'):_0x182bc6[_0x7dc9('0x39')]+=0x1;_0x4c7c6b['countcongestionretry']+=0x1;_0x4c7c6b['countglobal']=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0x8,'Congestion');ami[_0x7dc9('0x26')]('custom:agentcongestion',ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xce')));rpcDb[_0x7dc9('0x92')](_0x4c7c6b,_0x7dc9('0xcf'));if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut['cloneAction'](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb[_0x7dc9('0x95')](_0x5d211b,_0x7dc9('0xd0'));}else{if(_0x4c7c6b[_0x7dc9('0xd1')]>=_0x182bc6[_0x7dc9('0xd2')]){rpcDb['createCustomerFinal'](_0x4c7c6b,_0x7dc9('0xcf'));}else{rpcDb[_0x7dc9('0xa6')](ut[_0x7dc9('0xa7')](_0x4c7c6b,_0x7dc9('0xd1'),_0x182bc6['dialBusyRetryFrequency']),_0x4c7c6b[_0x7dc9('0xa9')],_0x4c7c6b[_0x7dc9('0xaa')]);}}break;case'CANCEL':_0x182bc6[_0x7dc9('0xd3')]+=0x1;_0x4c7c6b['countagentrejectretry']+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0x14,_0x7dc9('0xd4'));ami[_0x7dc9('0x26')](_0x7dc9('0xd5'),ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xd6')));rpcDb['createCustomerHistory'](_0x4c7c6b,_0x7dc9('0xd7'));if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut[_0x7dc9('0xa2')](_0x4c7c6b,0x14,_0x7dc9('0xd4'));rpcDb['createCustomerFinal'](_0x5d211b,_0x7dc9('0xd8'));}else{if(_0x4c7c6b[_0x7dc9('0xd9')]>=_0x182bc6[_0x7dc9('0xda')]){rpcDb[_0x7dc9('0x95')](_0x4c7c6b,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7dc9('0xa6')](ut['scheduledAt'](_0x4c7c6b,_0x7dc9('0xd9'),_0x182bc6['dialAgentRejectRetryFrequency']),_0x4c7c6b[_0x7dc9('0xa9')],_0x4c7c6b[_0x7dc9('0xaa')]);}}break;case _0x7dc9('0xdb'):_0x182bc6[_0x7dc9('0xdc')]+=0x1;_0x4c7c6b[_0x7dc9('0xdd')]+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0xb,_0x7dc9('0xde'));rpcDb[_0x7dc9('0x92')](_0x4c7c6b,_0x7dc9('0xdf'));if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6['dialGlobalMaxRetry']){_0x5d211b=ut[_0x7dc9('0xa2')](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb[_0x7dc9('0x95')](_0x5d211b,_0x7dc9('0xdf'));}else{if(_0x4c7c6b['countabandonedetry']>=_0x182bc6[_0x7dc9('0xe0')]){rpcDb[_0x7dc9('0x95')](_0x4c7c6b,_0x7dc9('0xdf'));}else{rpcDb[_0x7dc9('0xa6')](ut['scheduledAt'](_0x4c7c6b,_0x7dc9('0xdd'),_0x182bc6[_0x7dc9('0xe1')]),_0x4c7c6b[_0x7dc9('0xa9')],_0x4c7c6b['activeContact']);}}break;case'18':_0x182bc6['outboundUnknownCallsDay']+=0x1;_0x4c7c6b[_0x7dc9('0xe2')]+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0x12,_0x117444[_0x7dc9('0xe3')]||_0x117444['dialstatus']);ami[_0x7dc9('0x26')](_0x7dc9('0xe4'),ut[_0x7dc9('0xa0')](_0x4c7c6b,_0x7dc9('0xe5')));rpcDb['createCustomerHistory'](_0x4c7c6b,_0x7dc9('0xe6'));if(ut['totalGlobal'](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut['cloneAction'](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb[_0x7dc9('0x95')](_0x5d211b,_0x7dc9('0xe6'));}else{rpcDb['createCustomerFinal'](_0x4c7c6b,_0x7dc9('0xe6'));}delete this[_0x7dc9('0x13')][_0x117444['linkedid']];break;case'19':_0x182bc6['outboundUnknownCallsDay']+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut['totalGlobal'](_0x4c7c6b);ut['logCustomer'](_0x4c7c6b,0x13,_0x117444[_0x7dc9('0xe3')]||_0x117444[_0x7dc9('0xe7')]);ami[_0x7dc9('0x26')]('custom:amd',ut['buildObj'](_0x4c7c6b,'amd'));rpcDb[_0x7dc9('0x92')](_0x4c7c6b,_0x7dc9('0xe8'));if(ut[_0x7dc9('0x9e')](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut['cloneAction'](_0x4c7c6b,0xf,'Global');rpcDb[_0x7dc9('0x95')](_0x5d211b,_0x7dc9('0xe8'));}else{rpcDb[_0x7dc9('0x95')](_0x4c7c6b,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x117444[_0x7dc9('0xab')]];break;default:if(_0x4c7c6b['dialAnswer']){ut[_0x7dc9('0x7b')](_0x182bc6,_0x7dc9('0xe9'));ut['loggerError'](_0x7dc9('0xea')+_0x182bc6[_0x7dc9('0x53')],_0x117444);}_0x182bc6[_0x7dc9('0xeb')]+=0x1;_0x4c7c6b[_0x7dc9('0x9d')]=ut[_0x7dc9('0x9e')](_0x4c7c6b);ut[_0x7dc9('0x8d')](_0x4c7c6b,0xc,_0x117444[_0x7dc9('0xe3')]||_0x117444[_0x7dc9('0xe7')]);rpcDb['createCustomerHistory'](_0x4c7c6b,_0x7dc9('0xec'));if(ut['totalGlobal'](_0x4c7c6b)>=_0x182bc6[_0x7dc9('0xc8')]){_0x5d211b=ut['cloneAction'](_0x4c7c6b,0xf,_0x7dc9('0xa3'));rpcDb[_0x7dc9('0x95')](_0x5d211b,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x7dc9('0x95')](_0x4c7c6b,_0x7dc9('0xed'));}delete this[_0x7dc9('0x13')][_0x117444[_0x7dc9('0xab')]];}if(!(_0x4c7c6b[_0x7dc9('0x71')]&&_0x2cf485==='16')){ut['updateOriginated'](_0x182bc6,_0x7dc9('0xee'));logger['info'](_0x7dc9('0xef'),_0x4c7c6b[_0x7dc9('0xae')],_0x7dc9('0xaf'),_0x182bc6[_0x7dc9('0x53')],'originated:\x20',_0x182bc6[_0x7dc9('0x5b')]);}if(_0x2cf485!==_0x7dc9('0xf0')){delete this['actions'][_0x117444[_0x7dc9('0xab')]];delete this[_0x7dc9('0x13')][_0x117444[_0x7dc9('0xf1')]];}}};Preview[_0x7dc9('0x61')]['callProgressDetectingAgent']=function(_0x3bbeee,_0x43a729,_0x330bf7){if(_[_0x7dc9('0xf2')](_0x43a729)&&_0x7dc9('0xf3')!==typeof _0x43a729){return;}if(_['isUndefined'](_0x330bf7)&&_0x7dc9('0xf3')!==typeof _0x330bf7){return;}switch(_0x330bf7[_0x7dc9('0xf4')]){case'0':ut[_0x7dc9('0xf5')](_0x3bbeee,0x0,_0x7dc9('0x9f'));rpcDb['createAgentHistory'](_0x3bbeee,_0x7dc9('0xf6'));break;case'3':ut['logAgent'](_0x3bbeee,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x3bbeee,_0x7dc9('0xf7'));break;case'5':ut[_0x7dc9('0xf5')](_0x3bbeee,0x5,_0x7dc9('0xbd'));rpcDb[_0x7dc9('0xf8')](_0x3bbeee,_0x7dc9('0xf9'));break;case'8':ut[_0x7dc9('0xf5')](_0x3bbeee,0x8,_0x7dc9('0xfa'));rpcDb[_0x7dc9('0xf8')](_0x3bbeee,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x7dc9('0xf5')](_0x3bbeee,0x16,_0x7dc9('0xfb'));rpcDb[_0x7dc9('0xf8')](_0x3bbeee,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x7dc9('0xf5')](_0x3bbeee,0xc,_0x330bf7[_0x7dc9('0xf4')]);rpcDb[_0x7dc9('0xf8')](_0x3bbeee,_0x7dc9('0xfc'));}ut[_0x7dc9('0x79')](_0x43a729,_0x7dc9('0xfd'));logger[_0x7dc9('0x55')](_0x7dc9('0xfe'),_0x3bbeee[_0x7dc9('0xae')],_0x7dc9('0xaf'),_0x43a729[_0x7dc9('0x53')],_0x7dc9('0x6f'),_0x43a729[_0x7dc9('0x5b')]);delete this[_0x7dc9('0x13')][_0x3bbeee[_0x7dc9('0xae')]];};Preview[_0x7dc9('0x61')][_0x7dc9('0xff')]=function(_0x809ae5,_0x4158eb,_0x26868d,_0x5e5ed6,_0x179bfd){var _0x530e6f=this;return new BPromise(function(_0x12c10b,_0x56e1ba){if(_['isNil'](_0x4158eb)||_[_0x7dc9('0x6d')](_0x4158eb[_0x7dc9('0x100')])||_['isNil'](_0x4158eb[_0x7dc9('0x100')]['phone'])||_[_0x7dc9('0x6d')](_0x4158eb[_0x7dc9('0x75')])){_0x56e1ba(ut['message']('Contact\x20is\x20undefined',_0x5e5ed6,_0x179bfd));return;}var _0x338c78=uuid['v4']();var _0xfb704a=_0x530e6f[_0x7dc9('0x25')][_0x4158eb[_0x7dc9('0x6e')]['name']];var _0x204694=_0x26868d?_0x530e6f[_0x7dc9('0x14')][_0x26868d]['id']:undefined;_0x530e6f['actions'][_0x338c78]=new Action(_0x4158eb,_0xfb704a,_0x338c78,_0x26868d,_0x204694);var _0x2df2c0=_0x530e6f[_0x7dc9('0x13')][_0x338c78];_0x2df2c0['unlockAgent']=_0x5e5ed6;_0x2df2c0['activeContact']=_0x179bfd;_0x2df2c0[_0x7dc9('0x101')]=_0x26868d;if(_[_0x7dc9('0x102')](_0x809ae5)){_0x530e6f[_0x7dc9('0x103')](_0x2df2c0,_0xfb704a,_0x4158eb,_0x26868d)[_0x7dc9('0x86')](function(_0x559cfc){logger[_0x7dc9('0x55')]('[Preview][execCall][success]','Queue:\x20'+_0x2df2c0[_0x7dc9('0x70')]+_0x7dc9('0x104')+_0x2df2c0[_0x7dc9('0x105')],JSON[_0x7dc9('0x50')](_0x559cfc));ami[_0x7dc9('0x26')](_0x7dc9('0x106'),ut[_0x7dc9('0xa0')](_0x2df2c0,'called',_0x530e6f[_0x7dc9('0x25')][_0x2df2c0[_0x7dc9('0x70')]]));_0x12c10b(ut[_0x7dc9('0x45')](_0x7dc9('0x107')));})[_0x7dc9('0x88')](function(_0x17c063){ut[_0x7dc9('0x5e')]('[Preview][execCall][failure]',_0x17c063);_0x56e1ba(ut[_0x7dc9('0x45')](_0x7dc9('0x108'),_0x5e5ed6,_0x179bfd));});}else{_0xfb704a[_0x7dc9('0x37')]+=0x1;ut[_0x7dc9('0x109')](_0x2df2c0);rpcDb[_0x7dc9('0x10a')](_0x2df2c0,'[Blacklist][error]');delete _0x530e6f[_0x7dc9('0x13')][_0x338c78];_0x56e1ba(ut['message'](_0x7dc9('0x10b'),_0x5e5ed6,_0x179bfd));}});};Preview[_0x7dc9('0x61')]['isTrunkReachable']=function(_0x438d70){return!_[_0x7dc9('0x6d')](_0x438d70)&&!_[_0x7dc9('0x6d')](_0x438d70[_0x7dc9('0x53')])&&!_[_0x7dc9('0x6d')](_0x438d70[_0x7dc9('0x4d')])&&_0x438d70['active']&&!_[_0x7dc9('0x6d')](this[_0x7dc9('0x12')][util['format'](_0x7dc9('0x10c'),_0x438d70[_0x7dc9('0x53')])])&&!_['isNil'](this['trunks'][util[_0x7dc9('0x52')](_0x7dc9('0x10c'),_0x438d70[_0x7dc9('0x53')])]['status'])&&(this[_0x7dc9('0x12')][util['format'](_0x7dc9('0x10c'),_0x438d70[_0x7dc9('0x53')])][_0x7dc9('0x10d')]==='reachable'||this[_0x7dc9('0x12')][util['format']('SIP/%s',_0x438d70[_0x7dc9('0x53')])][_0x7dc9('0x10d')]===_0x7dc9('0x10e'));};Preview[_0x7dc9('0x61')][_0x7dc9('0x85')]=function(_0x56d169,_0x510a56){var _0x26f2b3=this;return new BPromise(function(_0x46162c,_0x13e685){_0x26f2b3[_0x7dc9('0x10f')](_0x56d169,_0x510a56)['then'](function(_0x42706e){_0x46162c(_['pick'](_0x42706e,[_0x7dc9('0x45')]));})['catch'](function(_0x393ea7){if(_0x393ea7[_0x7dc9('0x110')]){rpcDb['unlockContact'](_0x56d169);}if(_0x393ea7[_0x7dc9('0x4d')]){rpcDb[_0x7dc9('0x8a')](_0x56d169);}_0x13e685(_[_0x7dc9('0x72')](_0x393ea7,[_0x7dc9('0x45')]));});});};Preview[_0x7dc9('0x61')]['execRun']=function(_0x2491ea,_0x1ec900){var _0x34f00c=this;return new BPromise(function(_0x220625,_0x4b3637){var _0x435eb3,_0x43f718;rpcDb[_0x7dc9('0x111')](_0x2491ea)[_0x7dc9('0x86')](function(_0x48be46){if(!_['isNil'](_0x48be46[0x0])){_0x43f718=_0x48be46[0x0]['recallme']?![]:!![];_0x435eb3=_0x48be46[0x0][_0x7dc9('0x112')]?!![]:![];_0x435eb3=_0x1ec900?!![]:_0x435eb3;}var _0x30e562=_0x34f00c[_0x7dc9('0x113')](_0x48be46);if(_0x30e562[_0x7dc9('0x114')]){rpcDb['checkIsBlackList'](_[_0x7dc9('0x72')](_0x48be46[0x0],['VoiceQueueId','Contact.phone']))['then'](function(_0x2e1bf9){_0x34f00c[_0x7dc9('0xff')](_0x2e1bf9,_0x48be46[0x0],_0x1ec900,_0x43f718,_0x435eb3)[_0x7dc9('0x86')](function(_0x1c8358){_0x220625(_0x1c8358);})['catch'](function(_0x5025c2){_0x4b3637(_0x5025c2);});})['catch'](function(_0x4640f0){ut[_0x7dc9('0x5e')](_0x7dc9('0x115'),_0x4640f0);_0x4b3637(ut[_0x7dc9('0x45')](_0x7dc9('0x116'),_0x43f718,_0x435eb3));});}else{_0x4b3637(ut[_0x7dc9('0x45')](_0x30e562['message'],_0x43f718,_0x435eb3));}})[_0x7dc9('0x88')](function(_0x34ef15){ut[_0x7dc9('0x5e')](_0x7dc9('0x117'),_0x34ef15);_0x4b3637(ut[_0x7dc9('0x45')](_0x7dc9('0x116'),![],!![]));});});};Preview[_0x7dc9('0x61')]['validateContact']=function(_0x4c59ea){if(_[_0x7dc9('0x6d')](_0x4c59ea)||_[_0x7dc9('0x102')](_0x4c59ea)||!_[_0x7dc9('0x6d')](_0x4c59ea[0x0]['Agent'])&&_[_0x7dc9('0x6d')](_0x4c59ea[0x0][_0x7dc9('0x83')][_0x7dc9('0x53')])){ut[_0x7dc9('0x5e')](_0x7dc9('0x118'),_0x4c59ea);return{'isValid':![],'message':_0x7dc9('0x119')};}var _0x25a6f9=this[_0x7dc9('0x25')][_0x4c59ea[0x0][_0x7dc9('0x6e')][_0x7dc9('0x53')]];_0x25a6f9[_0x7dc9('0x45')]=_0x7dc9('0x9a');if(_[_0x7dc9('0x6d')](_0x25a6f9)){ut[_0x7dc9('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x25a6f9);return{'isValid':![],'message':_0x7dc9('0x11a')};}if(!this[_0x7dc9('0x98')](_0x25a6f9[_0x7dc9('0x4c')])){ut[_0x7dc9('0x5e')](_0x7dc9('0x11b'),_0x7dc9('0x11c')+_0x25a6f9['name']+_0x7dc9('0x11d'));if(!this[_0x7dc9('0x98')](_0x25a6f9[_0x7dc9('0x99')])){ut[_0x7dc9('0x5e')](_0x7dc9('0x11b'),_0x25a6f9['name']+_0x7dc9('0x11e'));return{'isValid':![],'message':_0x7dc9('0x11f')};}}if(!ut['isActive'](_0x25a6f9[_0x7dc9('0x67')])){ut['logger'](_0x7dc9('0x120'),_0x25a6f9[_0x7dc9('0x53')]+_0x7dc9('0x121'));return{'isValid':![],'message':_0x7dc9('0x11c')+_0x25a6f9[_0x7dc9('0x53')]+_0x7dc9('0x121')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x7dc9('0x103')]=function(_0x163919,_0x5c4a53,_0x2310bd,_0x44ec1b){var _0x3529c3=this;return new BPromise(function(_0x3c3c04,_0x143efb){var _0x468b00=_0x163919[_0x7dc9('0xae')];var _0x4185ab=_0x3529c3[_0x7dc9('0x98')](_0x5c4a53[_0x7dc9('0x4c')])?util['format'](_0x7dc9('0x122'),_0x5c4a53[_0x7dc9('0x4c')][_0x7dc9('0x53')],_['isNil'](_0x5c4a53[_0x7dc9('0x34')])?'':_0x5c4a53[_0x7dc9('0x34')][_0x7dc9('0x123')]()||'',_0x5c4a53['dialCutDigit']>0x0?_0x2310bd[_0x7dc9('0x100')][_0x7dc9('0x124')]['substring'](_0x5c4a53[_0x7dc9('0x125')]):_0x2310bd[_0x7dc9('0x100')][_0x7dc9('0x124')]):util[_0x7dc9('0x52')](_0x7dc9('0x122'),_[_0x7dc9('0x6d')](_0x5c4a53[_0x7dc9('0x99')])?_0x5c4a53[_0x7dc9('0x4c')][_0x7dc9('0x53')]:_0x5c4a53[_0x7dc9('0x99')][_0x7dc9('0x53')],_[_0x7dc9('0x6d')](_0x5c4a53[_0x7dc9('0x34')])?'':_0x5c4a53[_0x7dc9('0x34')][_0x7dc9('0x123')]()||'',_0x5c4a53[_0x7dc9('0x125')]>0x0?_0x2310bd[_0x7dc9('0x100')]['phone']['substring'](_0x5c4a53[_0x7dc9('0x125')]):_0x2310bd[_0x7dc9('0x100')][_0x7dc9('0x124')]);var _0x125242=_0x3529c3['isTrunkReachable'](_0x5c4a53[_0x7dc9('0x4c')])?ut[_0x7dc9('0x126')](_0x5c4a53[_0x7dc9('0x4c')][_0x7dc9('0x4e')],_0x5c4a53[_0x7dc9('0x32')],_0x5c4a53[_0x7dc9('0x127')]>0x0?ut[_0x7dc9('0x128')](_0x5c4a53['dialOriginateCallerIdNumber'],_0x5c4a53[_0x7dc9('0x127')]):_0x5c4a53[_0x7dc9('0x129')]):ut[_0x7dc9('0x126')](_['isNil'](_0x5c4a53[_0x7dc9('0x99')])?_0x5c4a53['Trunk'][_0x7dc9('0x4e')]:_0x5c4a53[_0x7dc9('0x99')][_0x7dc9('0x4e')],_0x5c4a53[_0x7dc9('0x32')],_0x5c4a53[_0x7dc9('0x127')]>0x0?ut[_0x7dc9('0x128')](_0x5c4a53['dialOriginateCallerIdNumber'],_0x5c4a53[_0x7dc9('0x127')]):_0x5c4a53[_0x7dc9('0x129')]);if(_0x125242){_0x163919[_0x7dc9('0x12a')]=ut[_0x7dc9('0x12b')](_0x125242);_0x163919[_0x7dc9('0x12c')]=ut['extractCalleridNumber'](_0x125242);}var _0x5d84b1=ut['addVariables'](_0x5c4a53,_0x2310bd,_0x4185ab,_0x125242,_0x468b00,_0x163919);_[_0x7dc9('0x12d')](_0x163919,ut[_0x7dc9('0x12e')](_0x5d84b1));_0x163919[_0x7dc9('0x12f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x7dc9('0x77')](ut['variablesAction'](_0x163919,_0x5c4a53,_0x5d84b1,_0x163919[_0x7dc9('0xaa')],_0x44ec1b))[_0x7dc9('0x86')](function(_0x5bb362){_0x5c4a53['originated']+=0x1;logger['info'](_0x7dc9('0x130'),_0x468b00,_0x7dc9('0xaf'),_0x5c4a53[_0x7dc9('0x53')],_0x7dc9('0x6f'),_0x5c4a53[_0x7dc9('0x5b')]);_0x3c3c04(_0x5bb362);})[_0x7dc9('0x88')](function(_0x112461){ut[_0x7dc9('0xf5')](_0x163919,0xe,_0x7dc9('0x131'));rpcDb[_0x7dc9('0xf8')](_0x163919,_0x7dc9('0x132'));_0x143efb(_0x112461);});});};Preview[_0x7dc9('0x61')][_0x7dc9('0x1f')]=function(_0x593fa1){if(this['actions'][_0x593fa1[_0x7dc9('0xab')]]){this[_0x7dc9('0x13')][_0x593fa1[_0x7dc9('0xab')]][_0x7dc9('0x133')]=_0x593fa1[_0x7dc9('0x133')];}};Preview[_0x7dc9('0x61')][_0x7dc9('0x17')]=function(_0x32a792){var _0x2033ea=this;var _0x1194b5=this[_0x7dc9('0x13')][_0x32a792[_0x7dc9('0x134')]];if(_0x1194b5){if(_0x1194b5['lookAgent']&&this[_0x7dc9('0x14')][_0x1194b5[_0x7dc9('0x101')]]){ut[_0x7dc9('0x135')](_0x1194b5,this[_0x7dc9('0x14')][_0x1194b5[_0x7dc9('0x101')]][_0x7dc9('0x53')],this[_0x7dc9('0x14')][_0x1194b5[_0x7dc9('0x101')]]['id']);}var _0x3ea91e=_[_0x7dc9('0x136')](_0x1194b5);_0x3ea91e[_0x7dc9('0x137')]=moment()[_0x7dc9('0x52')](_0x7dc9('0x8b'));var _0x3ca6ce=_0x2033ea[_0x7dc9('0x25')][_0x1194b5['queue']];if(ut[_0x7dc9('0x138')](_0x32a792[_0x7dc9('0x139')])){if(_0x1194b5[_0x7dc9('0xa9')]){rpcDb[_0x7dc9('0x13a')](_0x1194b5[_0x7dc9('0x105')]);}if(_0x1194b5['activeContact']){rpcDb[_0x7dc9('0x8a')](_0x1194b5[_0x7dc9('0x105')]);}ami[_0x7dc9('0x26')](_0x7dc9('0x13b'),ut['buildObj'](_0x1194b5,_0x7dc9('0x13c'),this[_0x7dc9('0x25')][_0x1194b5[_0x7dc9('0x70')]]));this['callProgressDetectingAgent'](_0x3ea91e,_0x3ca6ce,_0x32a792);}else{_0x1194b5[_0x7dc9('0x12f')]=moment()['format'](_0x7dc9('0x8b'));ut['logAgent'](_0x3ea91e,0x4,_0x7dc9('0x13d'));rpcDb[_0x7dc9('0xf8')](_0x3ea91e,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x7dc9('0x13e')]=function(_0x151c57){var _0x3e7472=this;var _0x2dd442=this[_0x7dc9('0x13')][_0x151c57[_0x7dc9('0xab')]];var _0x413f4d;if(_0x2dd442){_0x413f4d=this['campaignsPreview'][_0x2dd442[_0x7dc9('0x70')]];logger[_0x7dc9('0x55')]('[syncHangup][talking]',_0x151c57[_0x7dc9('0xab')],_0x7dc9('0xaf'),_0x413f4d[_0x7dc9('0x53')],'pTalking:\x20',_0x413f4d[_0x7dc9('0x2b')]);}if(this['actions'][_0x151c57[_0x7dc9('0xab')]]&&_0x151c57[_0x7dc9('0xab')]!==_0x151c57['uniqueid']){if(_0x151c57[_0x7dc9('0x13f')]==='16'&&this['actions'][_0x151c57[_0x7dc9('0xab')]][_0x7dc9('0x71')]){this[_0x7dc9('0x9b')](_0x151c57,_0x151c57[_0x7dc9('0xab')],_0x151c57[_0x7dc9('0x13f')]);}else if(this['actions'][_0x151c57[_0x7dc9('0xab')]][_0x7dc9('0x71')]){logger[_0x7dc9('0x55')](_0x7dc9('0x140'),_0x151c57[_0x7dc9('0xab')],_0x151c57['cause'],_0x7dc9('0xaf'),_0x413f4d[_0x7dc9('0x53')],_0x7dc9('0xb0'),_0x413f4d[_0x7dc9('0x2b')]);this['callProgressDetectingCustomer'](_0x151c57,_0x151c57['linkedid'],_0x151c57['cause']);}}else if(_0x2dd442&&_[_0x7dc9('0x6d')](_0x2dd442[_0x7dc9('0x141')])&&_0x413f4d[_0x7dc9('0x142')]&&_0x151c57['linkedid']===_0x151c57[_0x7dc9('0xae')]&&_[_0x7dc9('0x6d')](_0x151c57[_0x7dc9('0xf4')])&&_0x151c57[_0x7dc9('0x13f')]==='16'&&_0x151c57[_0x7dc9('0x143')]==='6'&&_[_0x7dc9('0xf2')](_0x2dd442[_0x7dc9('0x144')])){if(_0x2dd442[_0x7dc9('0xa9')]){rpcDb[_0x7dc9('0x13a')](_0x2dd442[_0x7dc9('0x105')]);}if(_0x2dd442['activeContact']){rpcDb[_0x7dc9('0x8a')](_0x2dd442[_0x7dc9('0x105')]);}_0x151c57[_0x7dc9('0xf4')]='22';this['callProgressDetectingAgent'](_0x2dd442,_0x413f4d,_0x151c57);}else if(_0x2dd442&&_0x2dd442[_0x7dc9('0x144')]){if(_0x151c57[_0x7dc9('0x13f')]==='16'&&this[_0x7dc9('0x13')][_0x151c57[_0x7dc9('0xab')]]['dialAnswer']){logger[_0x7dc9('0x55')](_0x7dc9('0x145'),_0x151c57['linkedid'],_0x151c57['cause'],'\x20Queue',_0x413f4d['name'],_0x7dc9('0xb0'),_0x413f4d[_0x7dc9('0x2b')]);this[_0x7dc9('0x9b')](_0x151c57,_0x151c57['linkedid'],_0x151c57[_0x7dc9('0x13f')]);}else if(this[_0x7dc9('0x13')][_0x151c57[_0x7dc9('0xab')]]['dialAnswer']){logger['info'](_0x7dc9('0x140'),_0x151c57[_0x7dc9('0xab')],_0x151c57[_0x7dc9('0x13f')],'\x20Queue',_0x413f4d[_0x7dc9('0x53')],_0x7dc9('0xb0'),_0x413f4d[_0x7dc9('0x2b')]);this[_0x7dc9('0x9b')](_0x151c57,_0x151c57[_0x7dc9('0xab')],_0x151c57[_0x7dc9('0x13f')]);}}};Preview[_0x7dc9('0x61')][_0x7dc9('0x1d')]=function(_0x3ac91d){if(this['actions'][_0x3ac91d[_0x7dc9('0xf1')]]&&_0x3ac91d['destlinkedid']!==_0x3ac91d['destuniqueid']){this[_0x7dc9('0x9b')](_0x3ac91d,_0x3ac91d[_0x7dc9('0xf1')],_0x3ac91d[_0x7dc9('0xe7')]);}};Preview[_0x7dc9('0x61')][_0x7dc9('0x1b')]=function(_0x1b617c){if(this[_0x7dc9('0x13')][_0x1b617c[_0x7dc9('0xab')]]&&_0x1b617c[_0x7dc9('0xab')]!==_0x1b617c['uniqueid']&&!this['actions'][_0x1b617c[_0x7dc9('0xab')]][_0x7dc9('0x71')]){if(_0x1b617c[_0x7dc9('0x13f')]==='1'){this[_0x7dc9('0x9b')](_0x1b617c,_0x1b617c[_0x7dc9('0xab')],_0x1b617c['cause']);}}};Preview[_0x7dc9('0x61')][_0x7dc9('0x146')]=function(_0x4f4e80,_0x476da8,_0x450ca7){if(this['actions'][_0x4f4e80]){if(_[_0x7dc9('0x6d')](this['actions'][_0x4f4e80][_0x7dc9('0x147')])){this['actions'][_0x4f4e80][_0x7dc9('0x147')]={};}this[_0x7dc9('0x13')][_0x4f4e80][_0x7dc9('0x147')][_0x476da8]=_0x450ca7;}};Preview[_0x7dc9('0x61')]['syncVarSet']=function(_0x5def76){try{if(!_[_0x7dc9('0x6d')](_0x5def76)){if(ut[_0x7dc9('0x148')](_['keys'](_0x5def76[_0x7dc9('0x149')])[0x0])){this[_0x7dc9('0x146')](_0x5def76[_0x7dc9('0xae')],_[_0x7dc9('0x14a')](_0x5def76[_0x7dc9('0x149')])[0x0],_0x5def76[_0x7dc9('0x14b')]);}}}catch(_0x2f3282){logger['error'](_0x7dc9('0x14c'),util[_0x7dc9('0x14d')](_0x2f3282,{'showHidden':![],'depth':null}));}};Preview[_0x7dc9('0x61')][_0x7dc9('0x14e')]=function(_0x5e7cf2){if(_0x5e7cf2){if(this[_0x7dc9('0x13')][_0x5e7cf2[_0x7dc9('0x14f')]]){this[_0x7dc9('0x13')][_0x5e7cf2[_0x7dc9('0x14f')]][_0x7dc9('0x144')]=!![];}}};Preview['prototype'][_0x7dc9('0x23')]=function(_0x276c04){if(_0x276c04){if(this[_0x7dc9('0x13')][_0x276c04[_0x7dc9('0x150')]]){this[_0x7dc9('0x13')][_0x276c04[_0x7dc9('0x150')]][_0x7dc9('0x144')]=!![];}}};module[_0x7dc9('0x151')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 11083f0..1962db4 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 _0xc338=['unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0x114c36,_0x67ba84){var _0x1e0366=function(_0x48a68f){while(--_0x48a68f){_0x114c36['push'](_0x114c36['shift']());}};_0x1e0366(++_0x67ba84);}(_0xc338,0x19a));var _0x8c33=function(_0x556f32,_0x87c22){_0x556f32=_0x556f32-0x0;var _0x2fe6f2=_0xc338[_0x556f32];return _0x2fe6f2;};'use strict';var util=require(_0x8c33('0x0'));var BPromise=require(_0x8c33('0x1'));var logger=require(_0x8c33('0x2'))(_0x8c33('0x3'));var _=require(_0x8c33('0x4'));var cmHopper=require(_0x8c33('0x5'));var cmHopperFinal=require(_0x8c33('0x6'));var cmHopperHistory=require(_0x8c33('0x7'));var cmHopperBlack=require(_0x8c33('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x8c33('0x9'));function loggerCatch(_0x24508a){return function(_0x30a533){logger[_0x8c33('0xa')](_0x24508a,util[_0x8c33('0xb')](_0x30a533,{'showHidden':![],'depth':null}));};}function create(_0x34c982){return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](cmHopperHistory[_0x8c33('0xe')](_0x34c982))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x10')));}function createAgent(_0x106cb6){return BPromise['resolve']()[_0x8c33('0xd')](agentReportPreview[_0x8c33('0xe')](_0x106cb6))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x10')));}function moveContact(_0x75e3fb){return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](cmHopper[_0x8c33('0x11')](_0x75e3fb,!![]))[_0x8c33('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x8c33('0x12')]=function(_0x125e80){return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](cmHopperBlack['checkIsBlackList'](_0x125e80))[_0x8c33('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x8c33('0x13')]=function(_0xda605f){return BPromise['resolve']()[_0x8c33('0xd')](cmHopper[_0x8c33('0x13')](_0xda605f))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x14')));};exports[_0x8c33('0xe')]=function(_0x305106,_0xc2d0ca){create(_0x305106)[_0x8c33('0xf')](loggerCatch(_0xc2d0ca));moveContact(_0x305106)['catch'](loggerCatch(_0xc2d0ca));};exports[_0x8c33('0x15')]=function(_0x1067c2,_0x9d1e3b){createAgent(_0x1067c2)[_0x8c33('0xf')](loggerCatch(_0x9d1e3b));};exports[_0x8c33('0x16')]=function(_0x41f697,_0x5e5f8b){create(_0x41f697)[_0x8c33('0xf')](loggerCatch(_0x5e5f8b));};exports[_0x8c33('0x17')]=function(_0x3bd06c,_0x2f011e){moveContact(_0x3bd06c)[_0x8c33('0xf')](loggerCatch(_0x2f011e));};exports[_0x8c33('0x18')]=function(_0x27d3e4,_0x3ddf86,_0x5f2b40){if(_0x3ddf86){_0x27d3e4[_0x8c33('0x19')]=null;}if(_0x5f2b40){_0x27d3e4[_0x8c33('0x1a')]=![];}return BPromise[_0x8c33('0xc')]()['then'](cmHopper[_0x8c33('0x18')](_0x27d3e4))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x1b')));};exports[_0x8c33('0x1c')]=function(_0x3944cf){return BPromise[_0x8c33('0xc')]()['then'](cmHopper[_0x8c33('0x1c')](_0x3944cf))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x1d')));};exports['unlockContact']=function(_0x3c9c8e){return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](cmHopper[_0x8c33('0x1e')]({'UserId':null},_0x3c9c8e,0x1))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x1f')));};exports[_0x8c33('0x20')]=function(_0x6aab3f){return BPromise['resolve']()[_0x8c33('0xd')](cmHopper['unlockContact']({'active':![]},_0x6aab3f,0x1))[_0x8c33('0xf')](loggerCatch(_0x8c33('0x21')));};exports['crateCustomerReportQueue']=function(_0x3732f4){var _0x5932ba={};_0x5932ba[_0x8c33('0x22')]=_0x3732f4[_0x8c33('0x22')];_0x5932ba[_0x8c33('0x23')]=_0x3732f4['uniqueid'];_0x5932ba['calleridnum']=_0x3732f4['calleridnum'];_0x5932ba[_0x8c33('0x24')]=_0x3732f4['calleridname'];_0x5932ba[_0x8c33('0x25')]=_0x3732f4[_0x8c33('0x25')];_0x5932ba[_0x8c33('0x26')]=_0x3732f4['answertime'];_0x5932ba[_0x8c33('0x27')]=_0x3732f4[_0x8c33('0x28')];_0x5932ba[_0x8c33('0x29')]=0x1;_0x5932ba['queuecallercompleteAt']=_0x3732f4[_0x8c33('0x2a')];_0x5932ba[_0x8c33('0x2b')]=_0x3732f4[_0x8c33('0x2c')];_0x5932ba[_0x8c33('0x2d')]=_0x8c33('0x2e');_0x5932ba[_0x8c33('0x2f')]=_0x8c33('0x30');_0x5932ba['holdtime']=0x0;_0x5932ba[_0x8c33('0x31')]=0x1;_0x5932ba[_0x8c33('0x32')]=_0x3732f4[_0x8c33('0x2c')];_0x5932ba[_0x8c33('0x33')]='COMPLETED';return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](voiceQueueReport['create'](_0x5932ba))['catch'](loggerCatch(_0x8c33('0x34')));};exports[_0x8c33('0x35')]=function(_0x5d391d,_0x4b18f6){return BPromise['resolve']()[_0x8c33('0xd')](cmHopper[_0x8c33('0x35')](_0x5d391d,_0x4b18f6))['catch'](loggerCatch(_0x8c33('0x36')));};exports['rescheduleContactInQueue']=function(_0x5afd15){return BPromise[_0x8c33('0xc')]()[_0x8c33('0xd')](cmHopper[_0x8c33('0x18')](_0x5afd15,!![],!![]))[_0x8c33('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x91bb=['[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe'];(function(_0x17b689,_0x1f2adf){var _0x4bc4c7=function(_0xfe465f){while(--_0xfe465f){_0x17b689['push'](_0x17b689['shift']());}};_0x4bc4c7(++_0x1f2adf);}(_0x91bb,0xda));var _0xb91b=function(_0x5b26be,_0x24893b){_0x5b26be=_0x5b26be-0x0;var _0x4c02c9=_0x91bb[_0x5b26be];return _0x4c02c9;};'use strict';var util=require(_0xb91b('0x0'));var BPromise=require('bluebird');var logger=require(_0xb91b('0x1'))('preview');var _=require('lodash');var cmHopper=require(_0xb91b('0x2'));var cmHopperFinal=require(_0xb91b('0x3'));var cmHopperHistory=require(_0xb91b('0x4'));var cmHopperBlack=require(_0xb91b('0x5'));var voiceQueueRt=require(_0xb91b('0x6'));var agentReportPreview=require(_0xb91b('0x7'));var voiceQueueReport=require(_0xb91b('0x8'));function loggerCatch(_0x12aea1){return function(_0x5b9ce6){logger[_0xb91b('0x9')](_0x12aea1,util['inspect'](_0x5b9ce6,{'showHidden':![],'depth':null}));};}function create(_0x165947){return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopperHistory[_0xb91b('0xc')](_0x165947))[_0xb91b('0xd')](loggerCatch(_0xb91b('0xe')));}function createAgent(_0x266635){return BPromise[_0xb91b('0xa')]()['then'](agentReportPreview[_0xb91b('0xc')](_0x266635))[_0xb91b('0xd')](loggerCatch(_0xb91b('0xe')));}function moveContact(_0x30defd){return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopper[_0xb91b('0xf')](_0x30defd,!![]))['catch'](loggerCatch(_0xb91b('0x10')));}exports[_0xb91b('0x11')]=function(_0x492e29){return BPromise['resolve']()[_0xb91b('0xb')](cmHopperBlack['checkIsBlackList'](_0x492e29))['catch'](loggerCatch(_0xb91b('0x12')));};exports[_0xb91b('0x13')]=function(_0x220f32){return BPromise['resolve']()['then'](cmHopper[_0xb91b('0x13')](_0x220f32))[_0xb91b('0xd')](loggerCatch(_0xb91b('0x14')));};exports[_0xb91b('0xc')]=function(_0x3a9eb7,_0x16b86f){create(_0x3a9eb7)[_0xb91b('0xd')](loggerCatch(_0x16b86f));moveContact(_0x3a9eb7)[_0xb91b('0xd')](loggerCatch(_0x16b86f));};exports[_0xb91b('0x15')]=function(_0x21dbb0,_0x3ed98e){createAgent(_0x21dbb0)['catch'](loggerCatch(_0x3ed98e));};exports[_0xb91b('0x16')]=function(_0x12a3b6,_0x50a5a0){create(_0x12a3b6)['catch'](loggerCatch(_0x50a5a0));};exports[_0xb91b('0x17')]=function(_0x5c3fa8,_0xb67ff3){moveContact(_0x5c3fa8)[_0xb91b('0xd')](loggerCatch(_0xb67ff3));};exports[_0xb91b('0x18')]=function(_0x1d73fd,_0x5d16a8,_0x1c37e2){if(_0x5d16a8){_0x1d73fd[_0xb91b('0x19')]=null;}if(_0x1c37e2){_0x1d73fd[_0xb91b('0x1a')]=![];}return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopper[_0xb91b('0x18')](_0x1d73fd))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x4bbbbc){return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopper[_0xb91b('0x1b')](_0x4bbbbc))['catch'](loggerCatch(_0xb91b('0x1c')));};exports['unlockContact']=function(_0x4bb023){return BPromise[_0xb91b('0xa')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x4bb023,0x1))[_0xb91b('0xd')](loggerCatch(_0xb91b('0x1d')));};exports[_0xb91b('0x1e')]=function(_0x3154ad){return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopper[_0xb91b('0x1f')]({'active':![]},_0x3154ad,0x1))[_0xb91b('0xd')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x3efd88){var _0x589a6a={};_0x589a6a['type']=_0x3efd88['type'];_0x589a6a[_0xb91b('0x20')]=_0x3efd88[_0xb91b('0x20')];_0x589a6a[_0xb91b('0x21')]=_0x3efd88[_0xb91b('0x21')];_0x589a6a[_0xb91b('0x22')]=_0x3efd88[_0xb91b('0x22')];_0x589a6a['queue']=_0x3efd88[_0xb91b('0x23')];_0x589a6a[_0xb91b('0x24')]=_0x3efd88[_0xb91b('0x25')];_0x589a6a[_0xb91b('0x26')]=_0x3efd88['answertime'];_0x589a6a[_0xb91b('0x27')]=0x1;_0x589a6a[_0xb91b('0x28')]=_0x3efd88[_0xb91b('0x29')];_0x589a6a[_0xb91b('0x2a')]=_0x3efd88[_0xb91b('0x2b')];_0x589a6a[_0xb91b('0x2c')]='from-sip';_0x589a6a['exten']=_0xb91b('0x2d');_0x589a6a[_0xb91b('0x2e')]=0x0;_0x589a6a[_0xb91b('0x2f')]=0x1;_0x589a6a['lastAssignedTo']=_0x3efd88[_0xb91b('0x2b')];_0x589a6a[_0xb91b('0x30')]='COMPLETED';return BPromise[_0xb91b('0xa')]()['then'](voiceQueueReport[_0xb91b('0x31')](_0x589a6a))[_0xb91b('0xd')](loggerCatch(_0xb91b('0x32')));};exports[_0xb91b('0x33')]=function(_0x34cae6,_0x4d3a8e){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x34cae6,_0x4d3a8e))[_0xb91b('0xd')](loggerCatch(_0xb91b('0x34')));};exports['rescheduleContactInQueue']=function(_0x2e3232){return BPromise[_0xb91b('0xa')]()[_0xb91b('0xb')](cmHopper[_0xb91b('0x18')](_0x2e3232,!![],!![]))['catch'](loggerCatch(_0xb91b('0x35')));}; \ 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 9f8a574..44416bd 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 _0x111d=['starttime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','endtime','isFailure','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','scheduledAt','scheduledat','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','preview','env','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist'];(function(_0x45c016,_0x1d8f5d){var _0x5a98f0=function(_0x826a7f){while(--_0x826a7f){_0x45c016['push'](_0x45c016['shift']());}};_0x5a98f0(++_0x1d8f5d);}(_0x111d,0x156));var _0xd111=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x111d[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xd111('0x0'));var _=require('lodash');var moment=require(_0xd111('0x1'));var logger=require('../../../../config/logger')(_0xd111('0x2'));var ipAgi=process[_0xd111('0x3')]['XCALLY_IP_AGI']||_0xd111('0x4');function getSeconds(_0x268a44,_0xeaba36){var _0x124de5=moment(_0x268a44)[_0xd111('0x5')](0x0);var _0x1f98e4=moment(_0xeaba36)[_0xd111('0x5')](0x0);return _0x124de5[_0xd111('0x6')](_0x1f98e4,'seconds');}exports[_0xd111('0x7')]=function(_0x395827){return function(_0x5e01a4){logger[_0xd111('0x8')](_0x395827,util[_0xd111('0x9')](_0x5e01a4,{'showHidden':![],'depth':null}));};};exports[_0xd111('0xa')]=function(_0x26fded,_0x466d4b){logger[_0xd111('0xb')](_0x26fded,util[_0xd111('0x9')](_0x466d4b,{'showHidden':![],'depth':null}));};exports[_0xd111('0xc')]=function(_0x5884e1,_0x2bdb51){logger['error'](_0x5884e1,util[_0xd111('0x9')](_0x2bdb51,{'showHidden':![],'depth':null}));};exports[_0xd111('0xd')]=function(_0x39ba4d){return function(_0x3950e4){logger[_0xd111('0xb')](_0x39ba4d,util[_0xd111('0x9')](_0x3950e4,{'showHidden':![],'depth':null}));};};exports[_0xd111('0xe')]=function(_0x8d8821,_0x428c06,_0x19802f){return{'message':_0x8d8821,'unlock':_0x428c06,'active':_0x19802f};};exports[_0xd111('0xf')]=function(_0x5a42de,_0x39507d,_0x2a7899){if(!_['isUndefined'](_0x2a7899)&&_0xd111('0x10')===typeof _0x2a7899&&!_[_0xd111('0x11')](_0x2a7899)){if(!_[_0xd111('0x12')](_0x39507d)&&_0xd111('0x10')===typeof _0x39507d&&!_['isEmpty'](_0x39507d)){return util[_0xd111('0x13')](_0xd111('0x14'),_0x39507d,_0x2a7899);}return util[_0xd111('0x13')]('\x22%s\x22\x20<%s>',_0x2a7899,_0x2a7899);}if(!_[_0xd111('0x12')](_0x5a42de)&&_0xd111('0x10')===typeof _0x5a42de&&!_['isEmpty'](_0x5a42de)){return _0x5a42de;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x40490c){if(_[_0xd111('0x15')](_0x40490c)){return![];}return _0x40490c;};exports['addVariables']=function(_0x4dd5ee,_0x41dfac,_0x149e2b,_0x271caf,_0x3f3ad8,_0x3a91c1){var _0x48f9cf={'XMD-QUEUE':_0x41dfac[_0xd111('0x16')]?_0x41dfac[_0xd111('0x16')][_0xd111('0x17')]:'','XMD-CALLERID':_0x271caf,'XMD-CALLERID-PREVIEW':_0x3a91c1?util[_0xd111('0x13')](_0xd111('0x14'),_0x3a91c1['calleridname'],_0x3a91c1[_0xd111('0x18')]):_0x271caf,'XMD-DIALID':_0x3f3ad8,'XMD-CONTACTID':_0x41dfac[_0xd111('0x19')],'XMD-CDRTYPE':_0xd111('0x1a'),'CALLERID(all)':_0x271caf,'XMD-VOICEQUEUEID':_0x41dfac[_0xd111('0x1b')],'XMD-DIALCHANNEL':_0x149e2b,'XMD-DIALTIMEOUT':_0x4dd5ee['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd111('0x1c'),_0x4dd5ee[_0xd111('0x1d')]?'g':'',_[_0xd111('0x11')](_0x4dd5ee[_0xd111('0x1e')])?'':_0xd111('0x1f')),'XMD-DIALURL':_0x4dd5ee[_0xd111('0x20')]||'','XMD-AGI':_0x4dd5ee[_0xd111('0x21')]?util[_0xd111('0x13')](_0xd111('0x22'),ipAgi,_0x4dd5ee[_0xd111('0x21')]):'NONE','XMD-AGIAFTER':_0x4dd5ee[_0xd111('0x1d')]?util[_0xd111('0x13')](_0xd111('0x22'),ipAgi,_0x4dd5ee[_0xd111('0x1d')]):_0xd111('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3a91c1?_0x3a91c1['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3a91c1?_0x3a91c1[_0xd111('0x24')]:'','XMD-DESTINATION':_0xd111('0x25'),'SIPADDHEADER':_0xd111('0x26')};if(!_[_0xd111('0x11')](_0x4dd5ee[_0xd111('0x1e')])){_0x48f9cf[util[_0xd111('0x13')]('%s',_0xd111('0x27'))]=_0x4dd5ee[_0xd111('0x1e')];_0x48f9cf[util[_0xd111('0x13')]('%s',_0xd111('0x28'))]=_0x3f3ad8;}if(_0x41dfac&&_0x41dfac[_0xd111('0x29')]){for(var _0x2b047f in _0x41dfac['Contact']){if(_0x41dfac[_0xd111('0x29')]['hasOwnProperty'](_0x2b047f)){if(!_[_0xd111('0x15')](_0x41dfac[_0xd111('0x29')][_0x2b047f])&&_0x2b047f!=='id'&&_0x2b047f!==_0xd111('0x2a')&&_0x2b047f!==_0xd111('0x2b')&&_0x2b047f!==_0xd111('0x2c')){_0x48f9cf[util[_0xd111('0x13')]('%s%s',_0xd111('0x2d'),_[_0xd111('0x2e')](_0x2b047f))]=_0x41dfac[_0xd111('0x29')][_0x2b047f];}}}}return _0x48f9cf;};exports[_0xd111('0x2f')]=function(_0xc1bd50){var _0x1d6a08={};for(var _0x1ecbb8 in _0xc1bd50){if(_0xc1bd50[_0xd111('0x30')](_0x1ecbb8)){_0x1d6a08[util[_0xd111('0x13')]('%s',_[_0xd111('0x31')](_0x1ecbb8))]=_0xc1bd50[_0x1ecbb8];}}return{'variables':_0x1d6a08};};exports['updateOriginated']=function(_0x233a93,_0x3c7670){if(!_[_0xd111('0x15')](_0x233a93)){if(_0x233a93[_0xd111('0x30')]('originated')){if(_0x233a93[_0xd111('0x32')]>0x0){_0x233a93['originated']-=0x1;}else{logger['error'](_0xd111('0x33'),_0x3c7670);}}}else{logger[_0xd111('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3c7670);}};exports[_0xd111('0x34')]=function(_0x4e62da){var _0x10e8e7=moment()[_0xd111('0x13')](_0xd111('0x35'));_0x4e62da[_0xd111('0x36')]=0xd;_0x4e62da[_0xd111('0x37')]=_0xd111('0x38');_0x4e62da[_0xd111('0x39')]=_0x10e8e7;_0x4e62da['responsetime']=_0x10e8e7;_0x4e62da['endtime']=_0x10e8e7;};exports[_0xd111('0x3a')]=function(_0x33c6d5,_0xd722b9,_0x4cc8ef){var _0x9a7e7f=moment()[_0xd111('0x13')](_0xd111('0x35'));_0x33c6d5['state']=_0xd722b9;_0x33c6d5[_0xd111('0x37')]=_0x4cc8ef;_0x33c6d5[_0xd111('0x3b')]=_0x9a7e7f;_0x33c6d5[_0xd111('0x3c')]=getSeconds(_0x33c6d5[_0xd111('0x3b')],_0x33c6d5[_0xd111('0x39')]);};exports[_0xd111('0x3d')]=function(_0x3dcce1,_0x5218c2,_0x2fba4c){_0x3dcce1[_0xd111('0x3e')]=_0x5218c2;_0x3dcce1[_0xd111('0x3f')]=_0x2fba4c;};exports['logCustomer']=function(_0x353fd5,_0x305975,_0x3088da){var _0x55df4a=moment()[_0xd111('0x13')](_0xd111('0x35'));_0x353fd5['state']=_0x305975;_0x353fd5[_0xd111('0x37')]=_0x3088da;_0x353fd5[_0xd111('0x3b')]=_0x353fd5[_0xd111('0x3b')]?_0x353fd5[_0xd111('0x3b')]:_0x55df4a;_0x353fd5['endtime']=_0x353fd5['endtime']?_0x353fd5[_0xd111('0x40')]:_0x55df4a;_0x353fd5[_0xd111('0x3c')]=getSeconds(_0x353fd5[_0xd111('0x3b')]||0x0,_0x353fd5[_0xd111('0x39')]||0x0);_0x353fd5['talktime']=_0x353fd5['answertime']?getSeconds(_0x353fd5['endtime'],_0x353fd5['answertime']):0x0;};exports[_0xd111('0x41')]=function(_0x336759){return _0x336759==='Failure';};exports['variablesAction']=function(_0x542c78,_0x33d92f,_0x32306c,_0x5690e3,_0x3ba8e8){var _0x7874c1=_0x5690e3?_0xd111('0x42'):_0x542c78[_0xd111('0x43')];_0x7874c1=_0x3ba8e8?_0xd111('0x44'):_0x7874c1;return{'actionid':_0x542c78[_0xd111('0x45')],'action':_0xd111('0x46'),'channel':_0x542c78[_0xd111('0x47')],'callerid':util[_0xd111('0x13')](_0xd111('0x14'),_0x7874c1,_0x542c78[_0xd111('0x18')]),'Exten':_0xd111('0x25'),'Context':'from-sip','Priority':'1','variable':_0x32306c,'timeout':(_0x33d92f[_0xd111('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x542c78[_0xd111('0x45')]};};exports[_0xd111('0x49')]=function(_0x3e20b7){return _0x3e20b7[_0xd111('0x4a')]+_0x3e20b7['countcongestionretry']+_0x3e20b7[_0xd111('0x4b')]+_0x3e20b7[_0xd111('0x4c')]+_0x3e20b7[_0xd111('0x4d')];};exports['cloneAction']=function(_0x20eea4){var _0x3425a1=_['clone'](_0x20eea4);_0x3425a1['state']=0xf;_0x3425a1[_0xd111('0x37')]='Global';return _0x3425a1;};exports[_0xd111('0x4e')]=function(_0x11f8ef,_0x39b029,_0x2e56c9){var _0x21ff60={};_0x21ff60[_0x39b029]=_0x11f8ef[_0x39b029];_0x21ff60['active']=![];_0x21ff60[_0xd111('0x4f')]=moment()['add'](_0x2e56c9,'minutes')[_0xd111('0x13')](_0xd111('0x35'));_0x21ff60[_0xd111('0x19')]=_0x11f8ef[_0xd111('0x19')];_0x21ff60[_0xd111('0x50')]=_0x11f8ef[_0xd111('0x50')];_0x21ff60['VoiceQueueId']=_0x11f8ef[_0xd111('0x1b')]||undefined;return _0x21ff60;};exports['decrementTalkink']=function(_0x1968a6,_0x431351){if(!_[_0xd111('0x15')](_0x1968a6)){if(_0x1968a6[_0xd111('0x51')]>0x0){_0x1968a6[_0xd111('0x51')]-=0x1;}else{logger[_0xd111('0x8')](_0x431351,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x431351,_0xd111('0x52'));}};exports['IsNotLoggedIn']=function(_0x48fcf8){if(_0x48fcf8<=0x0){return!![];}return![];};exports[_0xd111('0x53')]=function(_0x10ca6d,_0x43ce21,_0x7681c3){_0x10ca6d[_0xd111('0x54')]=_0x43ce21;_0x10ca6d[_0xd111('0x17')]=_0x10ca6d['queue'];_0x10ca6d[_0xd111('0x55')]=_0x10ca6d[_0xd111('0x47')];_0x10ca6d['motionChannel']=_0xd111('0x56');if(_0x7681c3){_0x10ca6d['mandatoryDisposition']=_0x7681c3[_0xd111('0x57')];}return _0x10ca6d;};exports[_0xd111('0x58')]=function(_0x5cc1e9){var _0x32f4ed={};_0x32f4ed[_0xd111('0x59')]=_0x5cc1e9[_0xd111('0x59')];_0x32f4ed['interface']=_0x5cc1e9['channelAgent'];_0x32f4ed[_0xd111('0x45')]=_0x5cc1e9[_0xd111('0x45')];return _0x32f4ed;};exports['agentReadyId']=function(_0x4c5bd0){var _0x434602=[];for(var _0x291c66 in _0x4c5bd0){if(_0x4c5bd0[_0xd111('0x30')](_0x291c66)){if(!_[_0xd111('0x15')](_0x4c5bd0[_0x291c66])&&_0x4c5bd0[_0x291c66]['state']===_0xd111('0x5a')&&_0x4c5bd0[_0x291c66][_0xd111('0x5b')]===_0xd111('0x5c')){_0x434602['push'](_0x4c5bd0[_0x291c66]['id']);}}}return _0x434602;};exports['getDiff']=function(_0x3d96d5){var _0x2a03f3=moment()['milliseconds'](0x0);var _0x427839=moment(_0x3d96d5)['milliseconds'](0x0);return _0x2a03f3['diff'](_0x427839,_0xd111('0x5d'));};exports[_0xd111('0x5e')]=function(_0x43e7ca){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x43e7ca['ContactId'],'ListId':_0x43e7ca[_0xd111('0x50')],'VoiceQueueId':_0x43e7ca['VoiceQueueId']||undefined,'CampaignId':_0x43e7ca[_0xd111('0x5f')]||undefined};};exports[_0xd111('0x60')]=function(_0x41fd26){if(_0x41fd26===_0xd111('0x45')||_0x41fd26==='idContact'||_0x41fd26===_0xd111('0x59')||_0x41fd26===_0xd111('0x61')||_0x41fd26===_0xd111('0x62')||_0x41fd26===_0xd111('0x63')||_0x41fd26===_0xd111('0x3e')||_0x41fd26===_0xd111('0x47')||_0x41fd26===_0xd111('0x43')||_0x41fd26==='active'||_0x41fd26==='calleridnum'||_0x41fd26===_0xd111('0x4f')||_0x41fd26==='countbusyretry'||_0x41fd26===_0xd111('0x64')||_0x41fd26==='countnoanswerretry'||_0x41fd26===_0xd111('0x65')||_0x41fd26===_0xd111('0x66')||_0x41fd26===_0xd111('0x67')||_0x41fd26===_0xd111('0x68')||_0x41fd26==='recallme'||_0x41fd26===_0xd111('0x19')||_0x41fd26===_0xd111('0x50')||_0x41fd26===_0xd111('0x3f')||_0x41fd26===_0xd111('0x1b')||_0x41fd26==='sipcallid'||_0x41fd26===_0xd111('0x69')||_0x41fd26===_0xd111('0x6a')||_0x41fd26===_0xd111('0x6b')||_0x41fd26==='xmd-listid'||_0x41fd26===_0xd111('0x6c')||_0x41fd26===_0xd111('0x6d')||_0x41fd26==='xmd-dialoptions'||_0x41fd26===_0xd111('0x6e')||_0x41fd26===_0xd111('0x6f')||_0x41fd26===_0xd111('0x70')||_0x41fd26===_0xd111('0x71')||_0x41fd26===_0xd111('0x72')||_0x41fd26===_0xd111('0x73')||_0x41fd26===_0xd111('0x74')||_0x41fd26===_0xd111('0x75')||_0x41fd26===_0xd111('0x76')||_0x41fd26===_0xd111('0x77')||_0x41fd26==='rtpaudioqosjitterbridged'||_0x41fd26===_0xd111('0x78')||_0x41fd26===_0xd111('0x79')||_0x41fd26===_0xd111('0x7a')||_0x41fd26===_0xd111('0x7b')||_0x41fd26===_0xd111('0x75')||_0x41fd26===_0xd111('0x76')||_0x41fd26===_0xd111('0x77')||_0x41fd26==='rtpaudioqosjitterbridged'||_0x41fd26===_0xd111('0x78')||_0x41fd26===_0xd111('0x79')||_0x41fd26==='rtpaudioqosrtt'||_0x41fd26===_0xd111('0x7b')||_0x41fd26===_0xd111('0x7c')||_0x41fd26===_0xd111('0x7d')||_0x41fd26===_0xd111('0x36')||_0x41fd26===_0xd111('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x46cb6f,_0x374365){var _0x39f906,_0x4a98d8,_0x573d54;if(_0x374365<=0x0){_0x374365=0x1;}_0x39f906=new RegExp(_0xd111('0x7e')+_0x374365+'}$');_0x4a98d8=Math[_0xd111('0x7f')](0xa,_0x374365-0x1);_0x573d54=Math['pow'](0xa,_0x374365)-0x1;return util[_0xd111('0x13')]('%s',_[_0xd111('0x80')](_0x46cb6f,_0x39f906,_[_0xd111('0x81')](_0x4a98d8,_0x573d54)));};exports[_0xd111('0x82')]=function(_0x2e2bec){var _0x4cb288=_0x2e2bec[_0xd111('0x83')](/"(.*?)"/);return _0x4cb288?_0x4cb288[0x1]:_0x2e2bec;};exports[_0xd111('0x84')]=function(_0x4f7d8e){var _0x11a63b=_0x4f7d8e['match'](/<(.*?)>/);return _0x11a63b?_0x11a63b[0x1]:_0x4f7d8e;}; \ No newline at end of file +var _0x6fb3=['dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','membername','UserId','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','Global','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22'];(function(_0x2d912d,_0x2b336d){var _0x12e9ed=function(_0x24179a){while(--_0x24179a){_0x2d912d['push'](_0x2d912d['shift']());}};_0x12e9ed(++_0x2b336d);}(_0x6fb3,0x100));var _0x36fb=function(_0x5f03cb,_0x1f468d){_0x5f03cb=_0x5f03cb-0x0;var _0x4e39fc=_0x6fb3[_0x5f03cb];return _0x4e39fc;};'use strict';var util=require(_0x36fb('0x0'));var _=require('lodash');var moment=require(_0x36fb('0x1'));var logger=require(_0x36fb('0x2'))(_0x36fb('0x3'));var ipAgi=process[_0x36fb('0x4')]['XCALLY_IP_AGI']||_0x36fb('0x5');function getSeconds(_0x4d4913,_0x18aebe){var _0x1612ab=moment(_0x4d4913)[_0x36fb('0x6')](0x0);var _0x335246=moment(_0x18aebe)[_0x36fb('0x6')](0x0);return _0x1612ab[_0x36fb('0x7')](_0x335246,_0x36fb('0x8'));}exports['loggerCatch']=function(_0xf33a7c){return function(_0x5e94cd){logger['error'](_0xf33a7c,util[_0x36fb('0x9')](_0x5e94cd,{'showHidden':![],'depth':null}));};};exports[_0x36fb('0xa')]=function(_0x46bef2,_0x111c89){logger[_0x36fb('0xb')](_0x46bef2,util['inspect'](_0x111c89,{'showHidden':![],'depth':null}));};exports[_0x36fb('0xc')]=function(_0x24d07d,_0x58b217){logger['error'](_0x24d07d,util[_0x36fb('0x9')](_0x58b217,{'showHidden':![],'depth':null}));};exports[_0x36fb('0xd')]=function(_0x10b673){return function(_0x3ad114){logger['info'](_0x10b673,util['inspect'](_0x3ad114,{'showHidden':![],'depth':null}));};};exports[_0x36fb('0xe')]=function(_0x57f1ed,_0x3926d2,_0x324bb0){return{'message':_0x57f1ed,'unlock':_0x3926d2,'active':_0x324bb0};};exports[_0x36fb('0xf')]=function(_0x4ebc4d,_0x266e78,_0x3b2ba7){if(!_['isUndefined'](_0x3b2ba7)&&_0x36fb('0x10')===typeof _0x3b2ba7&&!_['isEmpty'](_0x3b2ba7)){if(!_[_0x36fb('0x11')](_0x266e78)&&'string'===typeof _0x266e78&&!_[_0x36fb('0x12')](_0x266e78)){return util[_0x36fb('0x13')](_0x36fb('0x14'),_0x266e78,_0x3b2ba7);}return util[_0x36fb('0x13')](_0x36fb('0x14'),_0x3b2ba7,_0x3b2ba7);}if(!_[_0x36fb('0x11')](_0x4ebc4d)&&_0x36fb('0x10')===typeof _0x4ebc4d&&!_['isEmpty'](_0x4ebc4d)){return _0x4ebc4d;}return _0x36fb('0x15');};exports['isActive']=function(_0x4397f8){if(_[_0x36fb('0x16')](_0x4397f8)){return![];}return _0x4397f8;};exports[_0x36fb('0x17')]=function(_0xd1fc92,_0x58fe78,_0x412263,_0x4f75ad,_0x32221a,_0x48389d){var _0x21fffa={'XMD-QUEUE':_0x58fe78['Queue']?_0x58fe78['Queue'][_0x36fb('0x18')]:'','XMD-CALLERID':_0x4f75ad,'XMD-CALLERID-PREVIEW':_0x48389d?util[_0x36fb('0x13')]('\x22%s\x22\x20<%s>',_0x48389d[_0x36fb('0x19')],_0x48389d[_0x36fb('0x1a')]):_0x4f75ad,'XMD-DIALID':_0x32221a,'XMD-CONTACTID':_0x58fe78[_0x36fb('0x1b')],'XMD-CDRTYPE':_0x36fb('0x1c'),'CALLERID(all)':_0x4f75ad,'XMD-VOICEQUEUEID':_0x58fe78[_0x36fb('0x1d')],'XMD-DIALCHANNEL':_0x412263,'XMD-DIALTIMEOUT':_0xd1fc92[_0x36fb('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x36fb('0x13')](_0x36fb('0x1f'),_0xd1fc92[_0x36fb('0x20')]?'g':'',_['isEmpty'](_0xd1fc92[_0x36fb('0x21')])?'':_0x36fb('0x22')),'XMD-DIALURL':_0xd1fc92[_0x36fb('0x23')]||'','XMD-AGI':_0xd1fc92[_0x36fb('0x24')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xd1fc92['dialQueueProject']):_0x36fb('0x25'),'XMD-AGIAFTER':_0xd1fc92[_0x36fb('0x20')]?util[_0x36fb('0x13')](_0x36fb('0x26'),ipAgi,_0xd1fc92[_0x36fb('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x48389d?_0x48389d[_0x36fb('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x48389d?_0x48389d[_0x36fb('0x28')]:'','XMD-DESTINATION':_0x36fb('0x29'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x36fb('0x12')](_0xd1fc92['monitor_format'])){_0x21fffa[util['format']('%s',_0x36fb('0x2a'))]=_0xd1fc92[_0x36fb('0x21')];_0x21fffa[util['format']('%s',_0x36fb('0x2b'))]=_0x32221a;}if(_0x58fe78&&_0x58fe78[_0x36fb('0x2c')]){for(var _0x90c29e in _0x58fe78['Contact']){if(_0x58fe78[_0x36fb('0x2c')][_0x36fb('0x2d')](_0x90c29e)){if(!_[_0x36fb('0x16')](_0x58fe78['Contact'][_0x90c29e])&&_0x90c29e!=='id'&&_0x90c29e!==_0x36fb('0x2e')&&_0x90c29e!=='createdAt'&&_0x90c29e!=='updatedAt'){_0x21fffa[util['format'](_0x36fb('0x2f'),_0x36fb('0x30'),_[_0x36fb('0x31')](_0x90c29e))]=_0x58fe78[_0x36fb('0x2c')][_0x90c29e];}}}}return _0x21fffa;};exports['toLowerVariables']=function(_0x5ee860){var _0x58feb3={};for(var _0xbd1376 in _0x5ee860){if(_0x5ee860[_0x36fb('0x2d')](_0xbd1376)){_0x58feb3[util[_0x36fb('0x13')]('%s',_[_0x36fb('0x32')](_0xbd1376))]=_0x5ee860[_0xbd1376];}}return{'variables':_0x58feb3};};exports[_0x36fb('0x33')]=function(_0x207f26,_0x3fe7f2){if(!_[_0x36fb('0x16')](_0x207f26)){if(_0x207f26[_0x36fb('0x2d')](_0x36fb('0x34'))){if(_0x207f26[_0x36fb('0x34')]>0x0){_0x207f26[_0x36fb('0x34')]-=0x1;}else{logger[_0x36fb('0x35')](_0x36fb('0x36'),_0x3fe7f2);}}}else{logger[_0x36fb('0x35')](_0x36fb('0x37'),_0x3fe7f2);}};exports[_0x36fb('0x38')]=function(_0x4eb7bd){var _0x12a729=moment()[_0x36fb('0x13')](_0x36fb('0x39'));_0x4eb7bd[_0x36fb('0x3a')]=0xd;_0x4eb7bd[_0x36fb('0x3b')]=_0x36fb('0x3c');_0x4eb7bd[_0x36fb('0x3d')]=_0x12a729;_0x4eb7bd[_0x36fb('0x3e')]=_0x12a729;_0x4eb7bd[_0x36fb('0x3f')]=_0x12a729;};exports[_0x36fb('0x40')]=function(_0x54e9ed,_0x5e43cd,_0x308251){var _0x24d516=moment()[_0x36fb('0x13')](_0x36fb('0x39'));_0x54e9ed[_0x36fb('0x3a')]=_0x5e43cd;_0x54e9ed['statedesc']=_0x308251;_0x54e9ed['responsetime']=_0x24d516;_0x54e9ed['ringtime']=getSeconds(_0x54e9ed[_0x36fb('0x3e')],_0x54e9ed[_0x36fb('0x3d')]);};exports['logLookAgent']=function(_0xfe8b9f,_0x195e6e,_0x255960){_0xfe8b9f[_0x36fb('0x41')]=_0x195e6e;_0xfe8b9f[_0x36fb('0x42')]=_0x255960;};exports['logCustomer']=function(_0x40a9ee,_0xb8df78,_0x4e01b6){var _0x521e93=moment()['format'](_0x36fb('0x39'));_0x40a9ee[_0x36fb('0x3a')]=_0xb8df78;_0x40a9ee[_0x36fb('0x3b')]=_0x4e01b6;_0x40a9ee[_0x36fb('0x3e')]=_0x40a9ee[_0x36fb('0x3e')]?_0x40a9ee[_0x36fb('0x3e')]:_0x521e93;_0x40a9ee[_0x36fb('0x3f')]=_0x40a9ee['endtime']?_0x40a9ee[_0x36fb('0x3f')]:_0x521e93;_0x40a9ee[_0x36fb('0x43')]=getSeconds(_0x40a9ee[_0x36fb('0x3e')]||0x0,_0x40a9ee[_0x36fb('0x3d')]||0x0);_0x40a9ee[_0x36fb('0x44')]=_0x40a9ee[_0x36fb('0x45')]?getSeconds(_0x40a9ee[_0x36fb('0x3f')],_0x40a9ee[_0x36fb('0x45')]):0x0;};exports[_0x36fb('0x46')]=function(_0xf37b11){return _0xf37b11===_0x36fb('0x47');};exports[_0x36fb('0x48')]=function(_0x4a5d1e,_0x2d205c,_0x4c95e0,_0x5f195f,_0x3b5610){var _0x280d3e=_0x5f195f?_0x36fb('0x49'):_0x4a5d1e[_0x36fb('0x19')];_0x280d3e=_0x3b5610?_0x36fb('0x4a'):_0x280d3e;return{'actionid':_0x4a5d1e[_0x36fb('0x4b')],'action':_0x36fb('0x4c'),'channel':_0x4a5d1e[_0x36fb('0x4d')],'callerid':util[_0x36fb('0x13')]('\x22%s\x22\x20<%s>',_0x280d3e,_0x4a5d1e[_0x36fb('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x36fb('0x4e'),'Priority':'1','variable':_0x4c95e0,'timeout':(_0x2d205c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4a5d1e[_0x36fb('0x4b')]};};exports[_0x36fb('0x4f')]=function(_0x2f2a16){return _0x2f2a16[_0x36fb('0x50')]+_0x2f2a16[_0x36fb('0x51')]+_0x2f2a16[_0x36fb('0x52')]+_0x2f2a16['countagentrejectretry']+_0x2f2a16[_0x36fb('0x53')];};exports['cloneAction']=function(_0x4a8f60){var _0x275d57=_[_0x36fb('0x54')](_0x4a8f60);_0x275d57[_0x36fb('0x3a')]=0xf;_0x275d57[_0x36fb('0x3b')]=_0x36fb('0x55');return _0x275d57;};exports['scheduledAt']=function(_0x487ebe,_0x1deed0,_0x3e0071){var _0x4ca685={};_0x4ca685[_0x1deed0]=_0x487ebe[_0x1deed0];_0x4ca685[_0x36fb('0x56')]=![];_0x4ca685['scheduledat']=moment()[_0x36fb('0x57')](_0x3e0071,_0x36fb('0x58'))[_0x36fb('0x13')](_0x36fb('0x39'));_0x4ca685[_0x36fb('0x1b')]=_0x487ebe[_0x36fb('0x1b')];_0x4ca685[_0x36fb('0x59')]=_0x487ebe['ListId'];_0x4ca685['VoiceQueueId']=_0x487ebe[_0x36fb('0x1d')]||undefined;return _0x4ca685;};exports[_0x36fb('0x5a')]=function(_0x4ca6a6,_0x1687ea){if(!_[_0x36fb('0x16')](_0x4ca6a6)){if(_0x4ca6a6[_0x36fb('0x5b')]>0x0){_0x4ca6a6[_0x36fb('0x5b')]-=0x1;}else{logger[_0x36fb('0x35')](_0x1687ea,_0x36fb('0x5c'));}}else{logger[_0x36fb('0x35')](_0x1687ea,_0x36fb('0x5d'));}};exports[_0x36fb('0x5e')]=function(_0x3e3a34){if(_0x3e3a34<=0x0){return!![];}return![];};exports['buildObj']=function(_0x575c0d,_0x520d93,_0x1243fe){_0x575c0d[_0x36fb('0x5f')]=_0x520d93;_0x575c0d[_0x36fb('0x18')]=_0x575c0d[_0x36fb('0x60')];_0x575c0d[_0x36fb('0x61')]=_0x575c0d[_0x36fb('0x4d')];_0x575c0d[_0x36fb('0x62')]=_0x36fb('0x63');if(_0x1243fe){_0x575c0d['mandatoryDisposition']=_0x1243fe[_0x36fb('0x64')];}return _0x575c0d;};exports[_0x36fb('0x65')]=function(_0x2352e7){var _0x298445={};_0x298445[_0x36fb('0x60')]=_0x2352e7[_0x36fb('0x60')];_0x298445['interface']=_0x2352e7['channelAgent'];_0x298445[_0x36fb('0x4b')]=_0x2352e7['uniqueid'];return _0x298445;};exports['agentReadyId']=function(_0x57d435){var _0x296c6f=[];for(var _0x2b2299 in _0x57d435){if(_0x57d435[_0x36fb('0x2d')](_0x2b2299)){if(!_[_0x36fb('0x16')](_0x57d435[_0x2b2299])&&_0x57d435[_0x2b2299][_0x36fb('0x3a')]===_0x36fb('0x66')&&_0x57d435[_0x2b2299][_0x36fb('0x67')]===_0x36fb('0x68')){_0x296c6f[_0x36fb('0x69')](_0x57d435[_0x2b2299]['id']);}}}return _0x296c6f;};exports[_0x36fb('0x6a')]=function(_0x3af36a){var _0x44a6a8=moment()[_0x36fb('0x6')](0x0);var _0x109e15=moment(_0x3af36a)['milliseconds'](0x0);return _0x44a6a8['diff'](_0x109e15,'seconds');};exports[_0x36fb('0x6b')]=function(_0x11ee23){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x11ee23[_0x36fb('0x1b')],'ListId':_0x11ee23[_0x36fb('0x59')],'VoiceQueueId':_0x11ee23['VoiceQueueId']||undefined,'CampaignId':_0x11ee23[_0x36fb('0x6c')]||undefined};};exports[_0x36fb('0x6d')]=function(_0xd0936a){if(_0xd0936a===_0x36fb('0x4b')||_0xd0936a===_0x36fb('0x6e')||_0xd0936a==='queue'||_0xd0936a===_0x36fb('0x6f')||_0xd0936a===_0x36fb('0x70')||_0xd0936a===_0x36fb('0x71')||_0xd0936a===_0x36fb('0x41')||_0xd0936a==='channelAgent'||_0xd0936a==='calleridname'||_0xd0936a==='active'||_0xd0936a===_0x36fb('0x1a')||_0xd0936a===_0x36fb('0x72')||_0xd0936a===_0x36fb('0x50')||_0xd0936a===_0x36fb('0x51')||_0xd0936a===_0x36fb('0x52')||_0xd0936a===_0x36fb('0x73')||_0xd0936a==='callback'||_0xd0936a===_0x36fb('0x74')||_0xd0936a===_0x36fb('0x75')||_0xd0936a===_0x36fb('0x76')||_0xd0936a==='ContactId'||_0xd0936a===_0x36fb('0x59')||_0xd0936a===_0x36fb('0x42')||_0xd0936a===_0x36fb('0x1d')||_0xd0936a===_0x36fb('0x77')||_0xd0936a===_0x36fb('0x78')||_0xd0936a===_0x36fb('0x79')||_0xd0936a===_0x36fb('0x7a')||_0xd0936a===_0x36fb('0x7b')||_0xd0936a==='xmd-dialurl'||_0xd0936a==='xmd-dialtimeout'||_0xd0936a==='xmd-dialoptions'||_0xd0936a==='xmd-dialid'||_0xd0936a===_0x36fb('0x7c')||_0xd0936a===_0x36fb('0x7d')||_0xd0936a==='xmd-cdrtype'||_0xd0936a===_0x36fb('0x7e')||_0xd0936a===_0x36fb('0x7f')||_0xd0936a==='xmd-agi'||_0xd0936a==='rtpaudioqos'||_0xd0936a==='rtpaudioqosbridged'||_0xd0936a==='rtpaudioqosjitter'||_0xd0936a===_0x36fb('0x80')||_0xd0936a===_0x36fb('0x81')||_0xd0936a===_0x36fb('0x82')||_0xd0936a===_0x36fb('0x83')||_0xd0936a===_0x36fb('0x84')||_0xd0936a===_0x36fb('0x85')||_0xd0936a===_0x36fb('0x86')||_0xd0936a===_0x36fb('0x87')||_0xd0936a===_0x36fb('0x80')||_0xd0936a===_0x36fb('0x81')||_0xd0936a===_0x36fb('0x82')||_0xd0936a===_0x36fb('0x83')||_0xd0936a==='rtpaudioqosrttbridged'||_0xd0936a==='bridgepeer'||_0xd0936a==='bridgepvtcallid'||_0xd0936a==='state'||_0xd0936a==='statedesc'){return![];}return!![];};exports[_0x36fb('0x88')]=function(_0x5e6f9a,_0x3332a3){var _0x1abe9d,_0xa1b654,_0x29c1a6;if(_0x3332a3<=0x0){_0x3332a3=0x1;}_0x1abe9d=new RegExp(_0x36fb('0x89')+_0x3332a3+'}$');_0xa1b654=Math[_0x36fb('0x8a')](0xa,_0x3332a3-0x1);_0x29c1a6=Math['pow'](0xa,_0x3332a3)-0x1;return util[_0x36fb('0x13')]('%s',_[_0x36fb('0x8b')](_0x5e6f9a,_0x1abe9d,_[_0x36fb('0x8c')](_0xa1b654,_0x29c1a6)));};exports[_0x36fb('0x8d')]=function(_0x12641c){var _0x4335c9=_0x12641c['match'](/"(.*?)"/);return _0x4335c9?_0x4335c9[0x1]:_0x12641c;};exports[_0x36fb('0x8e')]=function(_0x457f5e){var _0x37e8a6=_0x457f5e[_0x36fb('0x8f')](/<(.*?)>/);return _0x37e8a6?_0x37e8a6[0x1]:_0x457f5e;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 39a0c68..458ded3 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 _0x3bff=['string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x3bff,0x99));var _0xf3bf=function(_0x5385f5,_0x554c1b){_0x5385f5=_0x5385f5-0x0;var _0x1eac01=_0x3bff[_0x5385f5];return _0x1eac01;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xf3bf('0x0'),'required':!![]},'membername':{'type':_0xf3bf('0x0'),'required':!![]},'penalty':{'type':_0xf3bf('0x1'),'required':![]},'paused':{'type':_0xf3bf('0x2'),'required':![]}};exports[_0xf3bf('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xf3bf('0x4')]={'interface':{'type':_0xf3bf('0x0'),'required':!![]},'paused':{'type':_0xf3bf('0x2')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xf3bf('0x0'),'required':![]}};exports[_0xf3bf('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf3bf('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xf3bf('0x0')},'format':{'type':_0xf3bf('0x0')},'mixmonitorid':{'type':_0xf3bf('0x0')}};exports[_0xf3bf('0x7')]={'uniqueid':{'type':_0xf3bf('0x0'),'required':!![]}};exports[_0xf3bf('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xf3bf('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x61b0=['queueadd','string','number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x36190f,_0x1b6952){var _0x595e01=function(_0x450d64){while(--_0x450d64){_0x36190f['push'](_0x36190f['shift']());}};_0x595e01(++_0x1b6952);}(_0x61b0,0xc6));var _0x061b=function(_0x3383cf,_0x3ef1a2){_0x3383cf=_0x3383cf-0x0;var _0x23072c=_0x61b0[_0x3383cf];return _0x23072c;};'use strict';exports[_0x061b('0x0')]={'queue':{'type':_0x061b('0x1'),'required':!![]},'interface':{'type':_0x061b('0x1'),'required':!![]},'membername':{'type':_0x061b('0x1'),'required':!![]},'penalty':{'type':_0x061b('0x2'),'required':![]},'paused':{'type':_0x061b('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x061b('0x4')]={'interface':{'type':_0x061b('0x1'),'required':!![]},'paused':{'type':_0x061b('0x3')},'reason':{'type':_0x061b('0x1'),'required':![]}};exports[_0x061b('0x5')]={'module':{'type':_0x061b('0x1'),'required':![]}};exports[_0x061b('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x061b('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x061b('0x1')},'mixmonitorid':{'type':_0x061b('0x1')}};exports[_0x061b('0x7')]={'uniqueid':{'type':_0x061b('0x1'),'required':!![]}};exports[_0x061b('0x8')]={'uniqueid':{'type':_0x061b('0x1'),'required':!![]},'exten':{'type':_0x061b('0x1'),'required':!![]},'context':{'type':_0x061b('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b20adae..a4a10b7 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 _0x9c96=['queuecallercomplete','initVoiceCallReports','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','hasOwnProperty','mapKeys','name','isNil','interface','SIP/%s','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','format','initTelephones','isUndefined','initTrunks','voiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt'];(function(_0x2e7a57,_0x13243b){var _0x49ed22=function(_0x5d5af6){while(--_0x5d5af6){_0x2e7a57['push'](_0x2e7a57['shift']());}};_0x49ed22(++_0x13243b);}(_0x9c96,0xe0));var _0x69c9=function(_0x4d2a11,_0x26cb5e){_0x4d2a11=_0x4d2a11-0x0;var _0x1f7bc9=_0x9c96[_0x4d2a11];return _0x1f7bc9;};'use strict';var BPromise=require(_0x69c9('0x0'));var util=require(_0x69c9('0x1'));var _=require(_0x69c9('0x2'));var moment=require(_0x69c9('0x3'));var Agent=require(_0x69c9('0x4'));var Telephone=require(_0x69c9('0x5'));var Trunk=require(_0x69c9('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x69c9('0x7'));var VoiceExtension=require(_0x69c9('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x69c9('0x9'));var FreshdeskAccount=require(_0x69c9('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x69c9('0xb'));var DeskAccount=require(_0x69c9('0xc'));var VtigerAccount=require(_0x69c9('0xd'));var ServicenowAccount=require(_0x69c9('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x69c9('0xf'));var Realtime=function(){this[_0x69c9('0x10')]={};this[_0x69c9('0x11')]={};this[_0x69c9('0x12')]={};this['voiceQueues']={};this[_0x69c9('0x13')]={};this[_0x69c9('0x14')]={};this[_0x69c9('0x15')]={};this[_0x69c9('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x69c9('0x17')]={};this['channels']={};this['queueChannels']={};this[_0x69c9('0x18')]={};this['timers']={};this['settings']={};this[_0x69c9('0x19')]={};this[_0x69c9('0x1a')]={};this[_0x69c9('0x1b')]={};this[_0x69c9('0x1c')]={};this[_0x69c9('0x1d')]={};this['deskAccounts']={};this[_0x69c9('0x1e')]={};this[_0x69c9('0x1f')]={};this[_0x69c9('0x20')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x22fb36,_0x414227,_0x5ecfbc){var _0x237810=_['mapKeys'](_0x22fb36,function(_0x3b2846,_0x1e1425){return _0x3b2846[_0x5ecfbc];});for(var _0x492ed5 in _0x414227){if(_0x414227[_0x69c9('0x21')](_0x492ed5)){if(!_0x237810[_0x492ed5]){delete _0x414227[_0x492ed5];}}}}function freeIsNotKeySip(_0x539795,_0x2d5ace){var _0x15d7d7=_[_0x69c9('0x22')](_0x539795,function(_0x39f201,_0x449d1b){return util['format']('SIP/%s',_0x39f201[_0x69c9('0x23')]);});for(var _0x53afcc in _0x2d5ace){if(_0x2d5ace[_0x69c9('0x21')](_0x53afcc)){if(!_0x15d7d7[_0x53afcc]){delete _0x2d5ace[_0x53afcc];}}}}function freeIsNotKeyAgent(_0x10ac34,_0x3a12df){var _0x4e1904=_[_0x69c9('0x22')](_0x10ac34,function(_0x54c6b,_0x35e912){var _0x266127=_[_0x69c9('0x24')](_0x54c6b[_0x69c9('0x25')])?util['format'](_0x69c9('0x26'),_0x54c6b[_0x69c9('0x23')]):_0x54c6b[_0x69c9('0x25')];return _0x266127;});for(var _0x5eb038 in _0x3a12df){if(_0x3a12df[_0x69c9('0x21')](_0x5eb038)){if(!_0x4e1904[_0x5eb038]){delete _0x3a12df[_0x5eb038];}}}}function clearVoiceCallReports(_0x5f3aa7){_0x5f3aa7[_0x69c9('0x27')]=0x0;_0x5f3aa7['answered']=0x0;_0x5f3aa7[_0x69c9('0x28')]=0x0;_0x5f3aa7[_0x69c9('0x29')]=0x0;_0x5f3aa7[_0x69c9('0x2a')]=0x0;}function clearCampaigns(_0x5121dd){if(!_[_0x69c9('0x2b')](_0x5121dd)){for(var _0x4554fe in _0x5121dd){if(_0x5121dd[_0x69c9('0x21')](_0x4554fe)){_0x5121dd[_0x4554fe][_0x69c9('0x2c')]=0x0;_0x5121dd[_0x4554fe]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4d328d){if(!_[_0x69c9('0x2b')](_0x4d328d)){for(var _0x291813 in _0x4d328d){if(_0x4d328d[_0x69c9('0x21')](_0x291813)){_0x4d328d[_0x291813]['total']=0x0;_0x4d328d[_0x291813][_0x69c9('0x2d')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x2e')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x2f')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x28')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x29')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x2a')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x30')]=0x0;_0x4d328d[_0x291813]['outboundNoAnswerCallsDay']=0x0;_0x4d328d[_0x291813][_0x69c9('0x31')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x32')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x33')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x34')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x35')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x36')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x37')]=0x0;_0x4d328d[_0x291813]['outboundOriginateFailureCallsDay']=0x0;_0x4d328d[_0x291813][_0x69c9('0x38')]=0x0;_0x4d328d[_0x291813][_0x69c9('0x39')]=0x0;_0x4d328d[_0x291813]['outboundAnswerAgiCallsDay']=0x0;_0x4d328d[_0x291813]['outboundAnswerCallsDay']=0x0;_0x4d328d[_0x291813][_0x69c9('0x3a')]=!![];}}}}Realtime[_0x69c9('0x3b')][_0x69c9('0x3c')]=function(_0x1ae63f,_0x454d40){for(var _0x4d9532 in _0x454d40){if(_0x1ae63f[_0x69c9('0x21')](_0x4d9532)){_0x1ae63f[_0x4d9532]=_0x454d40[_0x4d9532];}}};Realtime[_0x69c9('0x3b')][_0x69c9('0x3d')]=function(){var _0x38fd50=this;return function(_0x4d8bd9){if(_0x4d8bd9){freeIsNotKeyAgent(_0x4d8bd9,_0x38fd50['agents']);for(var _0x438aae=0x0,_0x3b8c55={},_0x3372a4={};_0x438aae<_0x4d8bd9[_0x69c9('0x3e')];_0x438aae+=0x1){_0x3b8c55=_0x4d8bd9[_0x438aae];var _0x42bfd7=_[_0x69c9('0x24')](_0x3b8c55[_0x69c9('0x25')])?util[_0x69c9('0x3f')](_0x69c9('0x26'),_0x3b8c55[_0x69c9('0x23')]):_0x3b8c55[_0x69c9('0x25')];if(_['isUndefined'](_0x38fd50[_0x69c9('0x10')][_0x42bfd7])){_0x38fd50['agents'][_0x42bfd7]=new Agent(_0x3b8c55);}else{_0x38fd50['mergeFromDatabase'](_0x38fd50[_0x69c9('0x10')][_0x42bfd7],_0x3b8c55);}}}return _0x38fd50[_0x69c9('0x10')];};};Realtime['prototype'][_0x69c9('0x40')]=function(){var _0xe34804=this;return function(_0x3bba9e){if(_0x3bba9e){freeIsNotKeySip(_0x3bba9e,_0xe34804['telephones']);for(var _0x1eda3f=0x0,_0x2733b0={},_0x30c7ba={};_0x1eda3f<_0x3bba9e[_0x69c9('0x3e')];_0x1eda3f+=0x1){_0x2733b0=_0x3bba9e[_0x1eda3f];if(_[_0x69c9('0x41')](_0xe34804['telephones'][util['format']('SIP/%s',_0x2733b0[_0x69c9('0x23')])])){_0xe34804[_0x69c9('0x11')][util[_0x69c9('0x3f')](_0x69c9('0x26'),_0x2733b0[_0x69c9('0x23')])]=new Telephone(_0x2733b0);}else{_0xe34804[_0x69c9('0x3c')](_0xe34804[_0x69c9('0x11')][util['format']('SIP/%s',_0x2733b0[_0x69c9('0x23')])],_0x2733b0);}}}return _0xe34804[_0x69c9('0x11')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x42')]=function(){var _0x1313c0=this;return function(_0x3a6b64){if(_0x3a6b64){freeIsNotKeySip(_0x3a6b64,_0x1313c0[_0x69c9('0x12')]);for(var _0x1a980b=0x0,_0xdc3d4b={},_0x46ce93={};_0x1a980b<_0x3a6b64['length'];_0x1a980b+=0x1){_0xdc3d4b=_0x3a6b64[_0x1a980b];if(_[_0x69c9('0x41')](_0x1313c0[_0x69c9('0x12')][util['format'](_0x69c9('0x26'),_0xdc3d4b[_0x69c9('0x23')])])){_0x1313c0[_0x69c9('0x12')][util['format'](_0x69c9('0x26'),_0xdc3d4b[_0x69c9('0x23')])]=new Trunk(_0xdc3d4b);}else{_0x1313c0[_0x69c9('0x3c')](_0x1313c0[_0x69c9('0x12')][util[_0x69c9('0x3f')]('SIP/%s',_0xdc3d4b[_0x69c9('0x23')])],_0xdc3d4b);}}}return _0x1313c0[_0x69c9('0x12')];};};Realtime[_0x69c9('0x3b')]['initVoiceQueues']=function(){var _0x24c5fb=this;return function(_0x390af1){if(_0x390af1){freeIsNotKey(_0x390af1,_0x24c5fb[_0x69c9('0x43')],_0x69c9('0x23'));for(var _0x30cf55=0x0,_0x4cdd8c={},_0x5523eb={};_0x30cf55<_0x390af1[_0x69c9('0x3e')];_0x30cf55+=0x1){_0x4cdd8c=_0x390af1[_0x30cf55];if(_[_0x69c9('0x41')](_0x24c5fb[_0x69c9('0x43')][_0x4cdd8c[_0x69c9('0x23')]])){_0x24c5fb[_0x69c9('0x43')][_0x4cdd8c[_0x69c9('0x23')]]=new VoiceQueue(_0x4cdd8c);}else{_0x24c5fb[_0x69c9('0x3c')](_0x24c5fb[_0x69c9('0x43')][_0x4cdd8c[_0x69c9('0x23')]],_0x4cdd8c);}}}return _0x24c5fb[_0x69c9('0x43')];};};Realtime[_0x69c9('0x3b')]['initTriggers']=function(){var _0x5a72b3=this;return function(_0x40d88b){if(_0x40d88b){freeIsNotKey(_0x40d88b,_0x5a72b3[_0x69c9('0x13')],'id');for(var _0x30bcf7=0x0,_0x37e153={},_0x4f3af3={};_0x30bcf7<_0x40d88b[_0x69c9('0x3e')];_0x30bcf7+=0x1){_0x37e153=_0x40d88b[_0x30bcf7];if(_[_0x69c9('0x41')](_0x5a72b3[_0x69c9('0x13')][_0x37e153['id']])){_0x5a72b3['triggers'][_0x37e153['id']]=new Trigger(_0x37e153);}else{_0x5a72b3[_0x69c9('0x3c')](_0x5a72b3['triggers'][_0x37e153['id']],_0x37e153);}}}return _0x5a72b3[_0x69c9('0x13')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x44')]=function(){var _0x5728b0=this;return function(_0x301040){if(_0x301040){freeIsNotKey(_0x301040,_0x5728b0['templates'],'id');for(var _0x59cea4=0x0,_0x19cc33={},_0x4d84e3={};_0x59cea4<_0x301040[_0x69c9('0x3e')];_0x59cea4+=0x1){_0x19cc33=_0x301040[_0x59cea4];if(_[_0x69c9('0x41')](_0x5728b0[_0x69c9('0x15')][_0x19cc33['id']])){_0x5728b0['templates'][_0x19cc33['id']]=new Template(_0x19cc33);}else{_0x5728b0[_0x69c9('0x3c')](_0x5728b0['templates'][_0x19cc33['id']],_0x19cc33);}}}return _0x5728b0[_0x69c9('0x15')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x45')]=function(){var _0x525e82=this;return function(_0x2efe4a){if(_0x2efe4a){freeIsNotKey(_0x2efe4a,_0x525e82[_0x69c9('0x19')],'id');for(var _0x5f2687=0x0,_0x3bc97f={},_0x1b3039={};_0x5f2687<_0x2efe4a['length'];_0x5f2687+=0x1){_0x3bc97f=_0x2efe4a[_0x5f2687];if(_[_0x69c9('0x41')](_0x525e82['zendeskAccounts'][_0x3bc97f['id']])){_0x525e82[_0x69c9('0x19')][_0x3bc97f['id']]=new ZendeskAccount(_0x3bc97f);}else{_0x525e82[_0x69c9('0x3c')](_0x525e82[_0x69c9('0x19')][_0x3bc97f['id']],_0x3bc97f);}}}return _0x525e82['zendeskAccounts'];};};Realtime['prototype'][_0x69c9('0x46')]=function(){var _0xf220d0=this;return function(_0xa53a74){if(_0xa53a74){freeIsNotKey(_0xa53a74,_0xf220d0[_0x69c9('0x1a')],'id');for(var _0x321f55=0x0,_0x35b604={},_0x165e1b={};_0x321f55<_0xa53a74[_0x69c9('0x3e')];_0x321f55+=0x1){_0x35b604=_0xa53a74[_0x321f55];if(_['isUndefined'](_0xf220d0[_0x69c9('0x1a')][_0x35b604['id']])){_0xf220d0[_0x69c9('0x1a')][_0x35b604['id']]=new SalesforceAccount(_0x35b604);}else{_0xf220d0[_0x69c9('0x3c')](_0xf220d0[_0x69c9('0x1a')][_0x35b604['id']],_0x35b604);}}}return _0xf220d0['salesforceAccounts'];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x47')]=function(){var _0x1098df=this;return function(_0x370ce4){if(_0x370ce4){freeIsNotKey(_0x370ce4,_0x1098df[_0x69c9('0x1c')],'id');for(var _0x49705b=0x0,_0x59cd40={},_0x296f5c={};_0x49705b<_0x370ce4[_0x69c9('0x3e')];_0x49705b+=0x1){_0x59cd40=_0x370ce4[_0x49705b];if(_[_0x69c9('0x41')](_0x1098df[_0x69c9('0x1c')][_0x59cd40['id']])){_0x1098df[_0x69c9('0x1c')][_0x59cd40['id']]=new FreshdeskAccount(_0x59cd40);}else{_0x1098df[_0x69c9('0x3c')](_0x1098df[_0x69c9('0x1c')][_0x59cd40['id']],_0x59cd40);}}}return _0x1098df[_0x69c9('0x1c')];};};Realtime['prototype'][_0x69c9('0x48')]=function(){var _0x1d1593=this;return function(_0x497d6){if(_0x497d6){freeIsNotKey(_0x497d6,_0x1d1593[_0x69c9('0x1d')],'id');for(var _0x2d194b=0x0,_0x54652f={},_0x16f25d={};_0x2d194b<_0x497d6['length'];_0x2d194b+=0x1){_0x54652f=_0x497d6[_0x2d194b];if(_[_0x69c9('0x41')](_0x1d1593[_0x69c9('0x1d')][_0x54652f['id']])){_0x1d1593['zohoAccounts'][_0x54652f['id']]=new ZohoAccount(_0x54652f);}else{_0x1d1593['mergeFromDatabase'](_0x1d1593[_0x69c9('0x1d')][_0x54652f['id']],_0x54652f);}}}return _0x1d1593['zohoAccounts'];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x49')]=function(){var _0x1113cf=this;return function(_0x5abbfc){if(_0x5abbfc){freeIsNotKey(_0x5abbfc,_0x1113cf['deskAccounts'],'id');for(var _0x5ef948=0x0,_0x105452={},_0x5948cd={};_0x5ef948<_0x5abbfc[_0x69c9('0x3e')];_0x5ef948+=0x1){_0x105452=_0x5abbfc[_0x5ef948];if(_[_0x69c9('0x41')](_0x1113cf['deskAccounts'][_0x105452['id']])){_0x1113cf['deskAccounts'][_0x105452['id']]=new DeskAccount(_0x105452);}else{_0x1113cf[_0x69c9('0x3c')](_0x1113cf['deskAccounts'][_0x105452['id']],_0x105452);}}}return _0x1113cf[_0x69c9('0x4a')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x4b')]=function(){var _0x461643=this;return function(_0x532ee2){if(_0x532ee2){freeIsNotKey(_0x532ee2,_0x461643[_0x69c9('0x1b')],'id');for(var _0x348a29=0x0,_0x30940f={},_0x4d9a6e={};_0x348a29<_0x532ee2[_0x69c9('0x3e')];_0x348a29+=0x1){_0x30940f=_0x532ee2[_0x348a29];if(_['isUndefined'](_0x461643[_0x69c9('0x1b')][_0x30940f['id']])){_0x461643['sugarcrmAccounts'][_0x30940f['id']]=new SugarcrmAccount(_0x30940f);}else{_0x461643[_0x69c9('0x3c')](_0x461643[_0x69c9('0x1b')][_0x30940f['id']],_0x30940f);}}}return _0x461643[_0x69c9('0x1b')];};};Realtime['prototype'][_0x69c9('0x4c')]=function(){var _0x349e4f=this;return function(_0x31d2cc){if(_0x31d2cc){freeIsNotKey(_0x31d2cc,_0x349e4f[_0x69c9('0x1e')],'id');for(var _0x194f8d=0x0,_0x4e71a8={},_0x5cd60b={};_0x194f8d<_0x31d2cc[_0x69c9('0x3e')];_0x194f8d+=0x1){_0x4e71a8=_0x31d2cc[_0x194f8d];if(_[_0x69c9('0x41')](_0x349e4f['vtigerAccounts'][_0x4e71a8['id']])){_0x349e4f[_0x69c9('0x1e')][_0x4e71a8['id']]=new VtigerAccount(_0x4e71a8);}else{_0x349e4f[_0x69c9('0x3c')](_0x349e4f[_0x69c9('0x1e')][_0x4e71a8['id']],_0x4e71a8);}}}return _0x349e4f[_0x69c9('0x1e')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x4d')]=function(){var _0x257abe=this;return function(_0x23cc5a){if(_0x23cc5a){freeIsNotKey(_0x23cc5a,_0x257abe[_0x69c9('0x1f')],'id');for(var _0x5b7ed6=0x0,_0x3a8b6f={},_0xae0ba3={};_0x5b7ed6<_0x23cc5a[_0x69c9('0x3e')];_0x5b7ed6+=0x1){_0x3a8b6f=_0x23cc5a[_0x5b7ed6];if(_[_0x69c9('0x41')](_0x257abe[_0x69c9('0x1f')][_0x3a8b6f['id']])){_0x257abe[_0x69c9('0x1f')][_0x3a8b6f['id']]=new ServicenowAccount(_0x3a8b6f);}else{_0x257abe[_0x69c9('0x3c')](_0x257abe[_0x69c9('0x1f')][_0x3a8b6f['id']],_0x3a8b6f);}}}return _0x257abe[_0x69c9('0x1f')];};};Realtime['prototype'][_0x69c9('0x4e')]=function(){var _0x7460e9=this;return function(_0x4d7fc7){if(_0x4d7fc7){freeIsNotKey(_0x4d7fc7,_0x7460e9[_0x69c9('0x20')],'id');for(var _0x15b046=0x0,_0xecfca5={},_0x300778={};_0x15b046<_0x4d7fc7['length'];_0x15b046+=0x1){_0xecfca5=_0x4d7fc7[_0x15b046];if(_[_0x69c9('0x41')](_0x7460e9[_0x69c9('0x20')][_0xecfca5['id']])){_0x7460e9[_0x69c9('0x20')][_0xecfca5['id']]=new Dynamics365Account(_0xecfca5);}else{_0x7460e9[_0x69c9('0x3c')](_0x7460e9[_0x69c9('0x20')][_0xecfca5['id']],_0xecfca5);}}}return _0x7460e9[_0x69c9('0x20')];};};Realtime['prototype'][_0x69c9('0x4f')]=function(){var _0x2bda8=this;return function(_0x5436a6){if(_0x5436a6){freeIsNotKey(_0x5436a6,_0x2bda8[_0x69c9('0x50')],'id');for(var _0x37522b=0x0,_0x4db800={},_0xfb04b3={};_0x37522b<_0x5436a6[_0x69c9('0x3e')];_0x37522b+=0x1){_0x4db800=_0x5436a6[_0x37522b];if(_['isUndefined'](_0x2bda8[_0x69c9('0x50')][_0x4db800['id']])){_0x2bda8[_0x69c9('0x50')][_0x4db800['id']]=new FreshsalesAccount(_0x4db800);}else{_0x2bda8[_0x69c9('0x3c')](_0x2bda8['freshsalesAccounts'][_0x4db800['id']],_0x4db800);}}}return _0x2bda8[_0x69c9('0x50')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x51')]=function(){var _0x1a91ef=this;return function(_0x5509ac){for(var _0x2c9c75=0x0;_0x2c9c75<_0x5509ac[_0x69c9('0x3e')];_0x2c9c75+=0x1){_[_0x69c9('0x52')](_0x1a91ef[_0x69c9('0x43')][_0x5509ac[_0x2c9c75][_0x69c9('0x23')]],_0x5509ac[_0x2c9c75]);}return _0x1a91ef['voiceQueues'];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x53')]=function(){var _0x5890c5=this;return function(_0x4f30f5){clearVoiceQueues(_0x5890c5[_0x69c9('0x43')]);if(_0x4f30f5){_0x4f30f5=_[_0x69c9('0x54')](_0x4f30f5,_0x69c9('0x55'));for(var _0x2d1810 in _0x4f30f5){if(_0x4f30f5['hasOwnProperty'](_0x2d1810)){var _0x149b82={};for(var _0x10c7dd=0x0;_0x10c7dd<_0x4f30f5[_0x2d1810][_0x69c9('0x3e')];_0x10c7dd+=0x1){var _0x251611=_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x56')];if(_0x5890c5[_0x69c9('0x43')][_0x251611]){if(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x57')]){_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x2e')]+=0x1;}if(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x58')]){_0x5890c5[_0x69c9('0x43')][_0x251611]['abandoned']+=0x1;}_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x28')]+=moment(_0x4f30f5[_0x2d1810][_0x10c7dd]['queuecallerleaveAt'])[_0x69c9('0x59')](moment(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5a')]),_0x69c9('0x5b'))||0x0;if(_0x10c7dd===_0x4f30f5[_0x2d1810]['length']-0x1){_0x5890c5[_0x69c9('0x43')][_0x251611]['sumDuration']+=moment(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5c')]||_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5d')]||_0x4f30f5[_0x2d1810][_0x10c7dd]['queuecallerexitAt'])[_0x69c9('0x59')](moment(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5a')]),_0x69c9('0x5b'))||0x0;_0x5890c5[_0x69c9('0x43')][_0x251611]['total']+=0x1;if(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5e')]){_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x2d')]+=0x1;_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x2a')]+=moment(_0x4f30f5[_0x2d1810][_0x10c7dd][_0x69c9('0x5c')])[_0x69c9('0x59')](moment(_0x4f30f5[_0x2d1810][_0x10c7dd]['queuecallerleaveAt']),_0x69c9('0x5b'))||0x0;}}else{_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x29')]+=_0x5890c5[_0x69c9('0x43')][_0x251611][_0x69c9('0x28')]||0x0;}}}}}}return _0x5890c5[_0x69c9('0x43')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x5f')]=function(){var _0x218e92=this;return function(_0x5bfa9d){clearVoiceCallReports(_0x218e92['outbound']);if(_0x5bfa9d){for(var _0x212725=0x0;_0x212725<_0x5bfa9d[_0x69c9('0x3e')];_0x212725+=0x1){_0x218e92['outbound'][_0x69c9('0x27')]+=0x1;_0x218e92['outbound']['sumDuration']+=_0x5bfa9d[_0x212725][_0x69c9('0x60')];if(_0x5bfa9d[_0x212725][_0x69c9('0x61')]==='ANSWERED'){_0x218e92['outbound'][_0x69c9('0x2d')]+=0x1;_0x218e92['outbound'][_0x69c9('0x28')]+=_0x5bfa9d[_0x212725][_0x69c9('0x60')]-_0x5bfa9d[_0x212725][_0x69c9('0x62')]||0x0;_0x218e92[_0x69c9('0x16')][_0x69c9('0x2a')]+=_0x5bfa9d[_0x212725][_0x69c9('0x62')];}}}return _0x218e92[_0x69c9('0x16')];};};Realtime[_0x69c9('0x3b')]['initCampaigns']=function(){var _0x53cbf8=this;return function(_0x25591a){if(_0x25591a){freeIsNotKey(_0x25591a,_0x53cbf8[_0x69c9('0x14')],'name');for(var _0x1d4060=0x0,_0x537316={};_0x1d4060<_0x25591a['length'];_0x1d4060+=0x1){_0x537316=_0x25591a[_0x1d4060];if(_[_0x69c9('0x41')](_0x53cbf8[_0x69c9('0x14')][_0x537316['name']])){_0x53cbf8[_0x69c9('0x14')][_0x537316[_0x69c9('0x23')]]=new Campaign(_0x537316);}else{_0x53cbf8['mergeFromDatabase'](_0x53cbf8[_0x69c9('0x14')][_0x537316[_0x69c9('0x23')]],_0x537316);_0x53cbf8['campaigns'][_0x537316[_0x69c9('0x23')]][_0x69c9('0x63')]=_0x537316['SquareProject']?_0x537316[_0x69c9('0x64')][_0x69c9('0x23')]:undefined;}}}return _0x53cbf8[_0x69c9('0x14')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x65')]=function(){var _0x957f38=this;return function(_0x2f41e5){if(_0x2f41e5){freeIsNotKey(_0x2f41e5,_0x957f38[_0x69c9('0x17')],'id');for(var _0x125ce2=0x0,_0x4d8f78={};_0x125ce2<_0x2f41e5['length'];_0x125ce2+=0x1){_0x4d8f78=_0x2f41e5[_0x125ce2];if(_[_0x69c9('0x41')](_0x957f38['voiceExtensions'][_0x4d8f78['id']])){_0x957f38['voiceExtensions'][_0x4d8f78['id']]=new VoiceExtension(_0x4d8f78);}else{_0x957f38['mergeFromDatabase'](_0x957f38['voiceExtensions'][_0x4d8f78['id']],_0x4d8f78);}}}return _0x957f38[_0x69c9('0x17')];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x66')]=function(){var _0x321506=this;return function(_0x36d42c){clearCampaigns(_0x321506[_0x69c9('0x14')]);for(var _0x2d4ecf=0x0;_0x2d4ecf<_0x36d42c['length'];_0x2d4ecf+=0x1){_[_0x69c9('0x52')](_0x321506[_0x69c9('0x14')][_0x36d42c[_0x2d4ecf]['name']],_0x36d42c[_0x2d4ecf]);}return _0x321506['campaigns'];};};Realtime[_0x69c9('0x3b')][_0x69c9('0x67')]=function(){var _0x441eac=this;return function(_0x3f8f75){if(_0x3f8f75){freeIsNotKey(_0x3f8f75,_0x441eac[_0x69c9('0x68')],'id');for(var _0x2ad1c1=0x0,_0x2572af={},_0x309e56={};_0x2ad1c1<_0x3f8f75[_0x69c9('0x3e')];_0x2ad1c1+=0x1){_0x2572af=_0x3f8f75[_0x2ad1c1];if(_[_0x69c9('0x41')](_0x441eac['faxAccounts'][_0x2572af['id']])){_0x441eac[_0x69c9('0x68')][_0x2572af['id']]=new FaxAccount(_0x2572af);}else{_0x441eac[_0x69c9('0x3c')](_0x441eac[_0x69c9('0x68')][_0x2572af['id']],_0x2572af);}}}return _0x441eac[_0x69c9('0x68')];};};module[_0x69c9('0x69')]=Realtime; \ No newline at end of file +var _0xedfc=['dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','hasOwnProperty','isNil','interface','format','name','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','agents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','campaigns'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedfc,0x15a));var _0xcedf=function(_0x327d96,_0x3ed414){_0x327d96=_0x327d96-0x0;var _0x45d4ca=_0xedfc[_0x327d96];return _0x45d4ca;};'use strict';var BPromise=require(_0xcedf('0x0'));var util=require(_0xcedf('0x1'));var _=require(_0xcedf('0x2'));var moment=require(_0xcedf('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xcedf('0x4'));var Trunk=require(_0xcedf('0x5'));var VoiceQueue=require(_0xcedf('0x6'));var Trigger=require(_0xcedf('0x7'));var Template=require(_0xcedf('0x8'));var Campaign=require(_0xcedf('0x9'));var VoiceExtension=require(_0xcedf('0xa'));var ZendeskAccount=require(_0xcedf('0xb'));var SalesforceAccount=require(_0xcedf('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xcedf('0xd'));var ZohoAccount=require(_0xcedf('0xe'));var DeskAccount=require(_0xcedf('0xf'));var VtigerAccount=require(_0xcedf('0x10'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xcedf('0x11'));var FreshsalesAccount=require(_0xcedf('0x12'));var FaxAccount=require(_0xcedf('0x13'));var Realtime=function(){this['agents']={};this[_0xcedf('0x14')]={};this[_0xcedf('0x15')]={};this[_0xcedf('0x16')]={};this['triggers']={};this['campaigns']={};this[_0xcedf('0x17')]={};this[_0xcedf('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xcedf('0x19')]={};this[_0xcedf('0x1a')]={};this[_0xcedf('0x1b')]={};this[_0xcedf('0x1c')]={};this[_0xcedf('0x1d')]={};this['zendeskAccounts']={};this[_0xcedf('0x1e')]={};this[_0xcedf('0x1f')]={};this['freshdeskAccounts']={};this[_0xcedf('0x20')]={};this[_0xcedf('0x21')]={};this[_0xcedf('0x22')]={};this[_0xcedf('0x23')]={};this[_0xcedf('0x24')]={};this[_0xcedf('0x25')]={};this[_0xcedf('0x26')]={};};function freeIsNotKey(_0x59e108,_0x836d6d,_0x551be5){var _0x36194e=_[_0xcedf('0x27')](_0x59e108,function(_0x2fb6db,_0x45610c){return _0x2fb6db[_0x551be5];});for(var _0x43efbe in _0x836d6d){if(_0x836d6d['hasOwnProperty'](_0x43efbe)){if(!_0x36194e[_0x43efbe]){delete _0x836d6d[_0x43efbe];}}}}function freeIsNotKeySip(_0x5a2c83,_0x5686e3){var _0x2cfed0=_['mapKeys'](_0x5a2c83,function(_0xc72f7,_0x3fbaa1){return util['format'](_0xcedf('0x28'),_0xc72f7['name']);});for(var _0x200316 in _0x5686e3){if(_0x5686e3[_0xcedf('0x29')](_0x200316)){if(!_0x2cfed0[_0x200316]){delete _0x5686e3[_0x200316];}}}}function freeIsNotKeyAgent(_0x289f4b,_0x5c972b){var _0x50b951=_[_0xcedf('0x27')](_0x289f4b,function(_0x195312,_0xa61c2e){var _0x14d461=_[_0xcedf('0x2a')](_0x195312[_0xcedf('0x2b')])?util[_0xcedf('0x2c')](_0xcedf('0x28'),_0x195312[_0xcedf('0x2d')]):_0x195312[_0xcedf('0x2b')];return _0x14d461;});for(var _0x93350b in _0x5c972b){if(_0x5c972b[_0xcedf('0x29')](_0x93350b)){if(!_0x50b951[_0x93350b]){delete _0x5c972b[_0x93350b];}}}}function clearVoiceCallReports(_0x1882fc){_0x1882fc[_0xcedf('0x2e')]=0x0;_0x1882fc[_0xcedf('0x2f')]=0x0;_0x1882fc[_0xcedf('0x30')]=0x0;_0x1882fc['sumDuration']=0x0;_0x1882fc[_0xcedf('0x31')]=0x0;}function clearCampaigns(_0x469d95){if(!_[_0xcedf('0x32')](_0x469d95)){for(var _0x10dfb7 in _0x469d95){if(_0x469d95['hasOwnProperty'](_0x10dfb7)){_0x469d95[_0x10dfb7][_0xcedf('0x33')]=0x0;_0x469d95[_0x10dfb7][_0xcedf('0x34')]=0x0;}}}}function clearVoiceQueues(_0x5dc009){if(!_['isEmpty'](_0x5dc009)){for(var _0x5a4a97 in _0x5dc009){if(_0x5dc009[_0xcedf('0x29')](_0x5a4a97)){_0x5dc009[_0x5a4a97][_0xcedf('0x2e')]=0x0;_0x5dc009[_0x5a4a97]['answered']=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x35')]=0x0;_0x5dc009[_0x5a4a97]['abandoned']=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x30')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x36')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x31')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x37')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x38')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x39')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3a')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3b')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3c')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3d')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3e')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x3f')]=0x0;_0x5dc009[_0x5a4a97]['outboundOriginateFailureCallsDay']=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x40')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x41')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x37')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x42')]=0x0;_0x5dc009[_0x5a4a97][_0xcedf('0x43')]=!![];}}}}Realtime[_0xcedf('0x44')][_0xcedf('0x45')]=function(_0x52f409,_0xed2c29){for(var _0x5c611c in _0xed2c29){if(_0x52f409[_0xcedf('0x29')](_0x5c611c)){_0x52f409[_0x5c611c]=_0xed2c29[_0x5c611c];}}};Realtime[_0xcedf('0x44')]['initAgents']=function(){var _0x2643e6=this;return function(_0x58586a){if(_0x58586a){freeIsNotKeyAgent(_0x58586a,_0x2643e6[_0xcedf('0x46')]);for(var _0x38dd15=0x0,_0x13d461={},_0x4297d9={};_0x38dd15<_0x58586a[_0xcedf('0x47')];_0x38dd15+=0x1){_0x13d461=_0x58586a[_0x38dd15];var _0x3eadc9=_[_0xcedf('0x2a')](_0x13d461[_0xcedf('0x2b')])?util[_0xcedf('0x2c')](_0xcedf('0x28'),_0x13d461[_0xcedf('0x2d')]):_0x13d461['interface'];if(_[_0xcedf('0x48')](_0x2643e6[_0xcedf('0x46')][_0x3eadc9])){_0x2643e6['agents'][_0x3eadc9]=new Agent(_0x13d461);}else{_0x2643e6[_0xcedf('0x45')](_0x2643e6['agents'][_0x3eadc9],_0x13d461);}}}return _0x2643e6[_0xcedf('0x46')];};};Realtime['prototype'][_0xcedf('0x49')]=function(){var _0x57436f=this;return function(_0x452e25){if(_0x452e25){freeIsNotKeySip(_0x452e25,_0x57436f[_0xcedf('0x14')]);for(var _0x312a08=0x0,_0xc22ca5={},_0xd7d416={};_0x312a08<_0x452e25[_0xcedf('0x47')];_0x312a08+=0x1){_0xc22ca5=_0x452e25[_0x312a08];if(_[_0xcedf('0x48')](_0x57436f[_0xcedf('0x14')][util['format']('SIP/%s',_0xc22ca5[_0xcedf('0x2d')])])){_0x57436f['telephones'][util[_0xcedf('0x2c')](_0xcedf('0x28'),_0xc22ca5[_0xcedf('0x2d')])]=new Telephone(_0xc22ca5);}else{_0x57436f[_0xcedf('0x45')](_0x57436f[_0xcedf('0x14')][util[_0xcedf('0x2c')](_0xcedf('0x28'),_0xc22ca5[_0xcedf('0x2d')])],_0xc22ca5);}}}return _0x57436f[_0xcedf('0x14')];};};Realtime[_0xcedf('0x44')]['initTrunks']=function(){var _0x57cc6c=this;return function(_0x5b2b75){if(_0x5b2b75){freeIsNotKeySip(_0x5b2b75,_0x57cc6c[_0xcedf('0x15')]);for(var _0xa1423a=0x0,_0x125d38={},_0x146783={};_0xa1423a<_0x5b2b75[_0xcedf('0x47')];_0xa1423a+=0x1){_0x125d38=_0x5b2b75[_0xa1423a];if(_[_0xcedf('0x48')](_0x57cc6c[_0xcedf('0x15')][util['format'](_0xcedf('0x28'),_0x125d38[_0xcedf('0x2d')])])){_0x57cc6c[_0xcedf('0x15')][util['format'](_0xcedf('0x28'),_0x125d38['name'])]=new Trunk(_0x125d38);}else{_0x57cc6c[_0xcedf('0x45')](_0x57cc6c[_0xcedf('0x15')][util[_0xcedf('0x2c')]('SIP/%s',_0x125d38[_0xcedf('0x2d')])],_0x125d38);}}}return _0x57cc6c[_0xcedf('0x15')];};};Realtime['prototype'][_0xcedf('0x4a')]=function(){var _0x3e58c4=this;return function(_0x155165){if(_0x155165){freeIsNotKey(_0x155165,_0x3e58c4[_0xcedf('0x16')],'name');for(var _0x51cec3=0x0,_0x3e2192={},_0x51d565={};_0x51cec3<_0x155165['length'];_0x51cec3+=0x1){_0x3e2192=_0x155165[_0x51cec3];if(_[_0xcedf('0x48')](_0x3e58c4[_0xcedf('0x16')][_0x3e2192['name']])){_0x3e58c4[_0xcedf('0x16')][_0x3e2192[_0xcedf('0x2d')]]=new VoiceQueue(_0x3e2192);}else{_0x3e58c4[_0xcedf('0x45')](_0x3e58c4[_0xcedf('0x16')][_0x3e2192[_0xcedf('0x2d')]],_0x3e2192);}}}return _0x3e58c4[_0xcedf('0x16')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x4b')]=function(){var _0x3913f7=this;return function(_0x177089){if(_0x177089){freeIsNotKey(_0x177089,_0x3913f7['triggers'],'id');for(var _0x29ecdb=0x0,_0x26a441={},_0x579751={};_0x29ecdb<_0x177089[_0xcedf('0x47')];_0x29ecdb+=0x1){_0x26a441=_0x177089[_0x29ecdb];if(_[_0xcedf('0x48')](_0x3913f7[_0xcedf('0x4c')][_0x26a441['id']])){_0x3913f7['triggers'][_0x26a441['id']]=new Trigger(_0x26a441);}else{_0x3913f7[_0xcedf('0x45')](_0x3913f7[_0xcedf('0x4c')][_0x26a441['id']],_0x26a441);}}}return _0x3913f7[_0xcedf('0x4c')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x4d')]=function(){var _0x361395=this;return function(_0x1256c7){if(_0x1256c7){freeIsNotKey(_0x1256c7,_0x361395[_0xcedf('0x17')],'id');for(var _0x1b7543=0x0,_0x3ad29d={},_0x4de1c1={};_0x1b7543<_0x1256c7['length'];_0x1b7543+=0x1){_0x3ad29d=_0x1256c7[_0x1b7543];if(_[_0xcedf('0x48')](_0x361395[_0xcedf('0x17')][_0x3ad29d['id']])){_0x361395[_0xcedf('0x17')][_0x3ad29d['id']]=new Template(_0x3ad29d);}else{_0x361395[_0xcedf('0x45')](_0x361395[_0xcedf('0x17')][_0x3ad29d['id']],_0x3ad29d);}}}return _0x361395[_0xcedf('0x17')];};};Realtime['prototype'][_0xcedf('0x4e')]=function(){var _0x23b910=this;return function(_0x4eeda1){if(_0x4eeda1){freeIsNotKey(_0x4eeda1,_0x23b910['zendeskAccounts'],'id');for(var _0x217a40=0x0,_0x4ef0cd={},_0x34db97={};_0x217a40<_0x4eeda1[_0xcedf('0x47')];_0x217a40+=0x1){_0x4ef0cd=_0x4eeda1[_0x217a40];if(_['isUndefined'](_0x23b910['zendeskAccounts'][_0x4ef0cd['id']])){_0x23b910[_0xcedf('0x4f')][_0x4ef0cd['id']]=new ZendeskAccount(_0x4ef0cd);}else{_0x23b910[_0xcedf('0x45')](_0x23b910['zendeskAccounts'][_0x4ef0cd['id']],_0x4ef0cd);}}}return _0x23b910['zendeskAccounts'];};};Realtime[_0xcedf('0x44')]['initSalesforceAccounts']=function(){var _0x4f361f=this;return function(_0x4fcaab){if(_0x4fcaab){freeIsNotKey(_0x4fcaab,_0x4f361f['salesforceAccounts'],'id');for(var _0x333b1a=0x0,_0x27556b={},_0xd452f8={};_0x333b1a<_0x4fcaab[_0xcedf('0x47')];_0x333b1a+=0x1){_0x27556b=_0x4fcaab[_0x333b1a];if(_[_0xcedf('0x48')](_0x4f361f[_0xcedf('0x1e')][_0x27556b['id']])){_0x4f361f['salesforceAccounts'][_0x27556b['id']]=new SalesforceAccount(_0x27556b);}else{_0x4f361f['mergeFromDatabase'](_0x4f361f[_0xcedf('0x1e')][_0x27556b['id']],_0x27556b);}}}return _0x4f361f['salesforceAccounts'];};};Realtime['prototype'][_0xcedf('0x50')]=function(){var _0x5eb5c0=this;return function(_0x247ca){if(_0x247ca){freeIsNotKey(_0x247ca,_0x5eb5c0['freshdeskAccounts'],'id');for(var _0x5dd264=0x0,_0x4580d0={},_0x2a57cb={};_0x5dd264<_0x247ca['length'];_0x5dd264+=0x1){_0x4580d0=_0x247ca[_0x5dd264];if(_[_0xcedf('0x48')](_0x5eb5c0[_0xcedf('0x51')][_0x4580d0['id']])){_0x5eb5c0['freshdeskAccounts'][_0x4580d0['id']]=new FreshdeskAccount(_0x4580d0);}else{_0x5eb5c0['mergeFromDatabase'](_0x5eb5c0[_0xcedf('0x51')][_0x4580d0['id']],_0x4580d0);}}}return _0x5eb5c0[_0xcedf('0x51')];};};Realtime[_0xcedf('0x44')]['initZohoAccounts']=function(){var _0x16c91e=this;return function(_0x25d992){if(_0x25d992){freeIsNotKey(_0x25d992,_0x16c91e[_0xcedf('0x20')],'id');for(var _0x23bb5a=0x0,_0x29d1f6={},_0x1e7c21={};_0x23bb5a<_0x25d992['length'];_0x23bb5a+=0x1){_0x29d1f6=_0x25d992[_0x23bb5a];if(_[_0xcedf('0x48')](_0x16c91e[_0xcedf('0x20')][_0x29d1f6['id']])){_0x16c91e[_0xcedf('0x20')][_0x29d1f6['id']]=new ZohoAccount(_0x29d1f6);}else{_0x16c91e[_0xcedf('0x45')](_0x16c91e[_0xcedf('0x20')][_0x29d1f6['id']],_0x29d1f6);}}}return _0x16c91e['zohoAccounts'];};};Realtime[_0xcedf('0x44')]['initDeskAccounts']=function(){var _0x254d74=this;return function(_0x24ada4){if(_0x24ada4){freeIsNotKey(_0x24ada4,_0x254d74[_0xcedf('0x21')],'id');for(var _0x748fdf=0x0,_0x55c223={},_0x2a7cb8={};_0x748fdf<_0x24ada4[_0xcedf('0x47')];_0x748fdf+=0x1){_0x55c223=_0x24ada4[_0x748fdf];if(_[_0xcedf('0x48')](_0x254d74['deskAccounts'][_0x55c223['id']])){_0x254d74[_0xcedf('0x21')][_0x55c223['id']]=new DeskAccount(_0x55c223);}else{_0x254d74[_0xcedf('0x45')](_0x254d74[_0xcedf('0x21')][_0x55c223['id']],_0x55c223);}}}return _0x254d74[_0xcedf('0x21')];};};Realtime['prototype'][_0xcedf('0x52')]=function(){var _0xb0f277=this;return function(_0xed59bc){if(_0xed59bc){freeIsNotKey(_0xed59bc,_0xb0f277[_0xcedf('0x1f')],'id');for(var _0x2528ec=0x0,_0x58c92f={},_0xe5705d={};_0x2528ec<_0xed59bc[_0xcedf('0x47')];_0x2528ec+=0x1){_0x58c92f=_0xed59bc[_0x2528ec];if(_[_0xcedf('0x48')](_0xb0f277[_0xcedf('0x1f')][_0x58c92f['id']])){_0xb0f277[_0xcedf('0x1f')][_0x58c92f['id']]=new SugarcrmAccount(_0x58c92f);}else{_0xb0f277[_0xcedf('0x45')](_0xb0f277[_0xcedf('0x1f')][_0x58c92f['id']],_0x58c92f);}}}return _0xb0f277[_0xcedf('0x1f')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x53')]=function(){var _0x384311=this;return function(_0x347d2d){if(_0x347d2d){freeIsNotKey(_0x347d2d,_0x384311[_0xcedf('0x22')],'id');for(var _0x372ff4=0x0,_0x154932={},_0x11661b={};_0x372ff4<_0x347d2d[_0xcedf('0x47')];_0x372ff4+=0x1){_0x154932=_0x347d2d[_0x372ff4];if(_[_0xcedf('0x48')](_0x384311[_0xcedf('0x22')][_0x154932['id']])){_0x384311[_0xcedf('0x22')][_0x154932['id']]=new VtigerAccount(_0x154932);}else{_0x384311[_0xcedf('0x45')](_0x384311[_0xcedf('0x22')][_0x154932['id']],_0x154932);}}}return _0x384311[_0xcedf('0x22')];};};Realtime['prototype'][_0xcedf('0x54')]=function(){var _0x5190be=this;return function(_0x326792){if(_0x326792){freeIsNotKey(_0x326792,_0x5190be[_0xcedf('0x23')],'id');for(var _0x55450d=0x0,_0x49b76e={},_0x220a94={};_0x55450d<_0x326792[_0xcedf('0x47')];_0x55450d+=0x1){_0x49b76e=_0x326792[_0x55450d];if(_[_0xcedf('0x48')](_0x5190be[_0xcedf('0x23')][_0x49b76e['id']])){_0x5190be[_0xcedf('0x23')][_0x49b76e['id']]=new ServicenowAccount(_0x49b76e);}else{_0x5190be[_0xcedf('0x45')](_0x5190be[_0xcedf('0x23')][_0x49b76e['id']],_0x49b76e);}}}return _0x5190be[_0xcedf('0x23')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x55')]=function(){var _0x4c9ae8=this;return function(_0x35ecf4){if(_0x35ecf4){freeIsNotKey(_0x35ecf4,_0x4c9ae8[_0xcedf('0x24')],'id');for(var _0xfa0aa8=0x0,_0x117abe={},_0x9092e7={};_0xfa0aa8<_0x35ecf4[_0xcedf('0x47')];_0xfa0aa8+=0x1){_0x117abe=_0x35ecf4[_0xfa0aa8];if(_[_0xcedf('0x48')](_0x4c9ae8['dynamics365Accounts'][_0x117abe['id']])){_0x4c9ae8[_0xcedf('0x24')][_0x117abe['id']]=new Dynamics365Account(_0x117abe);}else{_0x4c9ae8[_0xcedf('0x45')](_0x4c9ae8[_0xcedf('0x24')][_0x117abe['id']],_0x117abe);}}}return _0x4c9ae8[_0xcedf('0x24')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x242901=this;return function(_0x410608){if(_0x410608){freeIsNotKey(_0x410608,_0x242901[_0xcedf('0x25')],'id');for(var _0x393f11=0x0,_0x27e4d3={},_0x6bd802={};_0x393f11<_0x410608[_0xcedf('0x47')];_0x393f11+=0x1){_0x27e4d3=_0x410608[_0x393f11];if(_[_0xcedf('0x48')](_0x242901[_0xcedf('0x25')][_0x27e4d3['id']])){_0x242901[_0xcedf('0x25')][_0x27e4d3['id']]=new FreshsalesAccount(_0x27e4d3);}else{_0x242901['mergeFromDatabase'](_0x242901['freshsalesAccounts'][_0x27e4d3['id']],_0x27e4d3);}}}return _0x242901[_0xcedf('0x25')];};};Realtime[_0xcedf('0x44')]['initVoiceQueueHopperHistory']=function(){var _0x3f897c=this;return function(_0x32f939){for(var _0x27f418=0x0;_0x27f418<_0x32f939[_0xcedf('0x47')];_0x27f418+=0x1){_[_0xcedf('0x56')](_0x3f897c[_0xcedf('0x16')][_0x32f939[_0x27f418][_0xcedf('0x2d')]],_0x32f939[_0x27f418]);}return _0x3f897c[_0xcedf('0x16')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x57')]=function(){var _0x1fb107=this;return function(_0x38b0a8){clearVoiceQueues(_0x1fb107[_0xcedf('0x16')]);if(_0x38b0a8){_0x38b0a8=_['groupBy'](_0x38b0a8,_0xcedf('0x58'));for(var _0x1eb385 in _0x38b0a8){if(_0x38b0a8[_0xcedf('0x29')](_0x1eb385)){var _0x2b1492={};for(var _0x3fd90f=0x0;_0x3fd90f<_0x38b0a8[_0x1eb385][_0xcedf('0x47')];_0x3fd90f+=0x1){var _0x4fd448=_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x59')];if(_0x1fb107[_0xcedf('0x16')][_0x4fd448]){if(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5a')]){_0x1fb107['voiceQueues'][_0x4fd448][_0xcedf('0x35')]+=0x1;}if(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5b')]){_0x1fb107['voiceQueues'][_0x4fd448]['abandoned']+=0x1;}_0x1fb107[_0xcedf('0x16')][_0x4fd448][_0xcedf('0x30')]+=moment(_0x38b0a8[_0x1eb385][_0x3fd90f]['queuecallerleaveAt'])[_0xcedf('0x5c')](moment(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5d')]),'seconds')||0x0;if(_0x3fd90f===_0x38b0a8[_0x1eb385]['length']-0x1){_0x1fb107[_0xcedf('0x16')][_0x4fd448]['sumDuration']+=moment(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5e')]||_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5f')]||_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x60')])[_0xcedf('0x5c')](moment(_0x38b0a8[_0x1eb385][_0x3fd90f]['queuecallerjoinAt']),_0xcedf('0x61'))||0x0;_0x1fb107[_0xcedf('0x16')][_0x4fd448][_0xcedf('0x2e')]+=0x1;if(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x62')]){_0x1fb107[_0xcedf('0x16')][_0x4fd448][_0xcedf('0x2f')]+=0x1;_0x1fb107[_0xcedf('0x16')][_0x4fd448]['sumBillable']+=moment(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x5e')])['diff'](moment(_0x38b0a8[_0x1eb385][_0x3fd90f][_0xcedf('0x63')]),_0xcedf('0x61'))||0x0;}}else{_0x1fb107[_0xcedf('0x16')][_0x4fd448][_0xcedf('0x36')]+=_0x1fb107['voiceQueues'][_0x4fd448][_0xcedf('0x30')]||0x0;}}}}}}return _0x1fb107[_0xcedf('0x16')];};};Realtime['prototype'][_0xcedf('0x64')]=function(){var _0x44cdbc=this;return function(_0x893d0b){clearVoiceCallReports(_0x44cdbc[_0xcedf('0x18')]);if(_0x893d0b){for(var _0x295c1b=0x0;_0x295c1b<_0x893d0b['length'];_0x295c1b+=0x1){_0x44cdbc[_0xcedf('0x18')][_0xcedf('0x2e')]+=0x1;_0x44cdbc[_0xcedf('0x18')][_0xcedf('0x36')]+=_0x893d0b[_0x295c1b]['duration'];if(_0x893d0b[_0x295c1b]['disposition']===_0xcedf('0x65')){_0x44cdbc[_0xcedf('0x18')][_0xcedf('0x2f')]+=0x1;_0x44cdbc[_0xcedf('0x18')][_0xcedf('0x30')]+=_0x893d0b[_0x295c1b][_0xcedf('0x66')]-_0x893d0b[_0x295c1b][_0xcedf('0x67')]||0x0;_0x44cdbc['outbound']['sumBillable']+=_0x893d0b[_0x295c1b][_0xcedf('0x67')];}}}return _0x44cdbc[_0xcedf('0x18')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x68')]=function(){var _0x1616a2=this;return function(_0xb750c5){if(_0xb750c5){freeIsNotKey(_0xb750c5,_0x1616a2['campaigns'],_0xcedf('0x2d'));for(var _0x5d6bc4=0x0,_0x1ac4c3={};_0x5d6bc4<_0xb750c5[_0xcedf('0x47')];_0x5d6bc4+=0x1){_0x1ac4c3=_0xb750c5[_0x5d6bc4];if(_['isUndefined'](_0x1616a2['campaigns'][_0x1ac4c3[_0xcedf('0x2d')]])){_0x1616a2[_0xcedf('0x69')][_0x1ac4c3[_0xcedf('0x2d')]]=new Campaign(_0x1ac4c3);}else{_0x1616a2[_0xcedf('0x45')](_0x1616a2[_0xcedf('0x69')][_0x1ac4c3['name']],_0x1ac4c3);_0x1616a2[_0xcedf('0x69')][_0x1ac4c3[_0xcedf('0x2d')]][_0xcedf('0x6a')]=_0x1ac4c3[_0xcedf('0x6b')]?_0x1ac4c3[_0xcedf('0x6b')]['name']:undefined;}}}return _0x1616a2[_0xcedf('0x69')];};};Realtime[_0xcedf('0x44')][_0xcedf('0x6c')]=function(){var _0xa641c3=this;return function(_0x33fbed){if(_0x33fbed){freeIsNotKey(_0x33fbed,_0xa641c3[_0xcedf('0x6d')],'id');for(var _0x5d94b2=0x0,_0x281735={};_0x5d94b2<_0x33fbed[_0xcedf('0x47')];_0x5d94b2+=0x1){_0x281735=_0x33fbed[_0x5d94b2];if(_[_0xcedf('0x48')](_0xa641c3[_0xcedf('0x6d')][_0x281735['id']])){_0xa641c3[_0xcedf('0x6d')][_0x281735['id']]=new VoiceExtension(_0x281735);}else{_0xa641c3[_0xcedf('0x45')](_0xa641c3[_0xcedf('0x6d')][_0x281735['id']],_0x281735);}}}return _0xa641c3[_0xcedf('0x6d')];};};Realtime['prototype'][_0xcedf('0x6e')]=function(){var _0x269da6=this;return function(_0x2ec4a8){clearCampaigns(_0x269da6[_0xcedf('0x69')]);for(var _0x5aa9ca=0x0;_0x5aa9ca<_0x2ec4a8[_0xcedf('0x47')];_0x5aa9ca+=0x1){_['merge'](_0x269da6['campaigns'][_0x2ec4a8[_0x5aa9ca][_0xcedf('0x2d')]],_0x2ec4a8[_0x5aa9ca]);}return _0x269da6['campaigns'];};};Realtime['prototype'][_0xcedf('0x6f')]=function(){var _0x432f33=this;return function(_0x8c3c64){if(_0x8c3c64){freeIsNotKey(_0x8c3c64,_0x432f33[_0xcedf('0x26')],'id');for(var _0x1848e5=0x0,_0x33827d={},_0x5e81b2={};_0x1848e5<_0x8c3c64[_0xcedf('0x47')];_0x1848e5+=0x1){_0x33827d=_0x8c3c64[_0x1848e5];if(_[_0xcedf('0x48')](_0x432f33[_0xcedf('0x26')][_0x33827d['id']])){_0x432f33[_0xcedf('0x26')][_0x33827d['id']]=new FaxAccount(_0x33827d);}else{_0x432f33[_0xcedf('0x45')](_0x432f33[_0xcedf('0x26')][_0x33827d['id']],_0x33827d);}}}return _0x432f33['faxAccounts'];};};module[_0xcedf('0x70')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 09d73a7..7bcc02e 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 _0x3565=['../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','isNil','name','interface','SIP/%s','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','length','getCallType','channel','split','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','transfererlinkedid','exports','lodash','util','../rpc/voiceAgentReport','../rpc/memberReport'];(function(_0x2e5988,_0x482943){var _0x35080f=function(_0x56f09b){while(--_0x56f09b){_0x2e5988['push'](_0x2e5988['shift']());}};_0x35080f(++_0x482943);}(_0x3565,0x168));var _0x5356=function(_0x2bb376,_0x2d008a){_0x2bb376=_0x2bb376-0x0;var _0x35604c=_0x3565[_0x2bb376];return _0x35604c;};'use strict';var _=require(_0x5356('0x0'));var moment=require('moment');var util=require(_0x5356('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x5356('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x5356('0x3'));var RpcVoiceQueueReport=require(_0x5356('0x4'));var RpcVoiceRecording=require(_0x5356('0x5'));var RpcVoiceTransferReport=require(_0x5356('0x6'));var VoiceQueueReport=require(_0x5356('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x5356('0x8'));var VoiceDialReport=require(_0x5356('0x9'));var UserReport=require(_0x5356('0xa'));function Report(_0xd20146){this[_0x5356('0xb')]=_0xd20146;this[_0x5356('0xc')]=_0xd20146[_0x5356('0xc')];this[_0x5356('0xd')]=_0xd20146[_0x5356('0xd')];}Report['prototype']['sync']=function(_0x2a0fb3){var _0x22ee7b=new VoiceQueueReport(this[_0x5356('0xb')]);var _0x47eee9=new VoiceAgentReport(this[_0x5356('0xb')]);var _0x24855a=new VoiceDialReport(this['realtime']);var _0x130246=new VoiceCallReport(this[_0x5356('0xb')]);var _0x3569c9=new UserReport(this[_0x5356('0xb')]);if(config[_0x5356('0xe')]&&config[_0x5356('0xe')][_0x5356('0xf')]){ami['on'](_0x5356('0x10'),this[_0x5356('0x11')][_0x5356('0x12')](this));ami['on']('custom:voiceCallReport',this[_0x5356('0x13')][_0x5356('0x12')](this));ami['on'](_0x5356('0x14'),this[_0x5356('0x15')][_0x5356('0x12')](this));ami['on'](_0x5356('0x16'),this[_0x5356('0x17')][_0x5356('0x12')](this));ami['on'](_0x5356('0x18'),this[_0x5356('0x19')][_0x5356('0x12')](this));ami['on']('attendedtransfer',this[_0x5356('0x1a')]['bind'](this));}};Report[_0x5356('0x1b')][_0x5356('0x1c')]=function(_0x16d39e){var _0x243f48;_0x243f48=_[_0x5356('0x1d')](this[_0x5356('0xc')],function(_0x1445e1){return _0x1445e1[_0x5356('0x1e')]==_0x16d39e||_0x1445e1['name']==_0x16d39e;});if(_[_0x5356('0x1f')](_0x243f48)){var _0x5d3fd1=_[_0x5356('0x1d')](this['telephones'],function(_0x3b4025){return _0x3b4025['accountcode']==_0x16d39e||_0x3b4025[_0x5356('0x20')]==_0x16d39e;});if(_0x5d3fd1){_0x243f48=_[_0x5356('0x1d')](this[_0x5356('0xc')],function(_0x2b0bbe){return _0x2b0bbe[_0x5356('0x21')]==util['format'](_0x5356('0x22'),_0x5d3fd1[_0x5356('0x20')]);});}}return _0x243f48;};Report['prototype'][_0x5356('0x11')]=function(_0x409584){for(var _0x197c53=0x0;_0x197c53<_0x409584['length'];_0x197c53+=0x1){var _0x1be730=this[_0x5356('0x1c')](_0x409584[_0x197c53]['connectedlinenum']);if(_0x1be730){_0x409584[_0x197c53][_0x5356('0x1e')]=_0x1be730[_0x5356('0x1e')];_0x409584[_0x197c53][_0x5356('0x23')]=!![];_0x409584[_0x197c53][_0x5356('0x24')]=_0x1be730[_0x5356('0x20')];_0x409584[_0x197c53]['interface']=_['isNil'](_0x1be730[_0x5356('0x21')])?util[_0x5356('0x25')](_0x5356('0x22'),_0x1be730[_0x5356('0x20')]):_0x1be730[_0x5356('0x21')];if(_0x409584[_0x197c53][_0x5356('0x26')]){_0x409584[_0x197c53][_0x5356('0x27')]=moment()['format'](_0x5356('0x28'));}if(_0x409584[_0x197c53]['queuecallerexit']){_0x409584[_0x197c53]['queuecallerexitAt']=moment()['format'](_0x5356('0x28'));}RpcMemberReport[_0x5356('0x11')](_0x409584[_0x197c53]);}RpcVoiceQueueReport[_0x5356('0x29')](_0x409584[_0x197c53]);}};function extractCalleridNumber(_0x479f66){var _0x3ec8a7=_0x479f66[_0x5356('0x2a')](/<(.*?)>/);return _0x3ec8a7?_0x3ec8a7[0x1]:_0x479f66;}Report['prototype'][_0x5356('0x2b')]=function(_0x5275b3){for(var _0x1c3e14=0x0;_0x1c3e14','calleridname','transfers','linkedid','uniqueid','UserId','monitors','length','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','voiceDialReport','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','telephones','prototype'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0xb075,0x177));var _0x5b07=function(_0x1667de,_0x5c5c88){_0x1667de=_0x1667de-0x0;var _0x26b46c=_0xb075[_0x1667de];return _0x26b46c;};'use strict';var _=require(_0x5b07('0x0'));var moment=require('moment');var util=require(_0x5b07('0x1'));var config=require(_0x5b07('0x2'));var ami=require(_0x5b07('0x3'));var RpcVoiceAgentReport=require(_0x5b07('0x4'));var RpcVoiceCallReport=require(_0x5b07('0x5'));var RpcVoiceDialReport=require(_0x5b07('0x6'));var RpcMemberReport=require(_0x5b07('0x7'));var RpcVoiceQueueReport=require(_0x5b07('0x8'));var RpcVoiceRecording=require(_0x5b07('0x9'));var RpcVoiceTransferReport=require(_0x5b07('0xa'));var VoiceQueueReport=require(_0x5b07('0xb'));var VoiceCallReport=require(_0x5b07('0xc'));var VoiceAgentReport=require(_0x5b07('0xd'));var VoiceDialReport=require(_0x5b07('0xe'));var UserReport=require('./userReport');function Report(_0x34afd5){this['realtime']=_0x34afd5;this['agents']=_0x34afd5['agents'];this[_0x5b07('0xf')]=_0x34afd5[_0x5b07('0xf')];}Report[_0x5b07('0x10')][_0x5b07('0x11')]=function(_0x565271){var _0x574b6e=new VoiceQueueReport(this[_0x5b07('0x12')]);var _0x16d1bf=new VoiceAgentReport(this['realtime']);var _0x267bdc=new VoiceDialReport(this[_0x5b07('0x12')]);var _0x1ed83e=new VoiceCallReport(this[_0x5b07('0x12')]);var _0x245c40=new UserReport(this[_0x5b07('0x12')]);if(config['xdr']&&config[_0x5b07('0x13')][_0x5b07('0x14')]){ami['on'](_0x5b07('0x15'),this[_0x5b07('0x16')][_0x5b07('0x17')](this));ami['on'](_0x5b07('0x18'),this[_0x5b07('0x19')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x5b07('0x17')](this));ami['on'](_0x5b07('0x1a'),this['voiceDialReport'][_0x5b07('0x17')](this));ami['on'](_0x5b07('0x1b'),this[_0x5b07('0x1c')][_0x5b07('0x17')](this));ami['on'](_0x5b07('0x1d'),this[_0x5b07('0x1e')][_0x5b07('0x17')](this));}};Report[_0x5b07('0x10')][_0x5b07('0x1f')]=function(_0x1d7e92){var _0x346c84;_0x346c84=_['find'](this[_0x5b07('0x20')],function(_0x24134d){return _0x24134d[_0x5b07('0x21')]==_0x1d7e92||_0x24134d['name']==_0x1d7e92;});if(_['isNil'](_0x346c84)){var _0x10e8a0=_[_0x5b07('0x22')](this['telephones'],function(_0x1335a8){return _0x1335a8[_0x5b07('0x21')]==_0x1d7e92||_0x1335a8[_0x5b07('0x23')]==_0x1d7e92;});if(_0x10e8a0){_0x346c84=_[_0x5b07('0x22')](this[_0x5b07('0x20')],function(_0x3d0889){return _0x3d0889[_0x5b07('0x24')]==util[_0x5b07('0x25')](_0x5b07('0x26'),_0x10e8a0[_0x5b07('0x23')]);});}}return _0x346c84;};Report[_0x5b07('0x10')][_0x5b07('0x16')]=function(_0x2bc4f4){for(var _0x47e383=0x0;_0x47e383<_0x2bc4f4['length'];_0x47e383+=0x1){var _0x94fc04=this[_0x5b07('0x1f')](_0x2bc4f4[_0x47e383][_0x5b07('0x27')]);if(_0x94fc04){_0x2bc4f4[_0x47e383][_0x5b07('0x21')]=_0x94fc04[_0x5b07('0x21')];_0x2bc4f4[_0x47e383]['assigned']=!![];_0x2bc4f4[_0x47e383][_0x5b07('0x28')]=_0x94fc04[_0x5b07('0x23')];_0x2bc4f4[_0x47e383][_0x5b07('0x24')]=_[_0x5b07('0x29')](_0x94fc04['interface'])?util[_0x5b07('0x25')](_0x5b07('0x26'),_0x94fc04[_0x5b07('0x23')]):_0x94fc04[_0x5b07('0x24')];if(_0x2bc4f4[_0x47e383][_0x5b07('0x2a')]){_0x2bc4f4[_0x47e383][_0x5b07('0x2b')]=moment()['format'](_0x5b07('0x2c'));}if(_0x2bc4f4[_0x47e383][_0x5b07('0x2d')]){_0x2bc4f4[_0x47e383][_0x5b07('0x2e')]=moment()[_0x5b07('0x25')](_0x5b07('0x2c'));}RpcMemberReport[_0x5b07('0x16')](_0x2bc4f4[_0x47e383]);}RpcVoiceQueueReport[_0x5b07('0x2f')](_0x2bc4f4[_0x47e383]);}};function extractCalleridNumber(_0x2123e9){var _0x43f455=_0x2123e9[_0x5b07('0x30')](/<(.*?)>/);return _0x43f455?_0x43f455[0x1]:_0x2123e9;}Report[_0x5b07('0x10')][_0x5b07('0x31')]=function(_0x2655fe){for(var _0x43c343=0x0;_0x43c3430x0?_0x130462:0x0;this['voiceQueues'][_0x2440de[_0xfc38('0x6a')]][_0xfc38('0x5b')]=this[_0xfc38('0x41')][_0x2440de[_0xfc38('0x6a')]][_0xfc38('0x5b')]>_[_0xfc38('0x6f')](_0x2440de[_0xfc38('0x70')])?_[_0xfc38('0x6f')](_0x2440de[_0xfc38('0x70')]):this[_0xfc38('0x41')][_0x2440de[_0xfc38('0x6a')]][_0xfc38('0x5b')];this[_0xfc38('0x52')](this['voiceQueues'][_0x2440de[_0xfc38('0x6a')]],_0xfc38('0x12'));}logger[_0xfc38('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this['voiceQueues'][_0x2440de[_0xfc38('0x6a')]],{'showHidden':![],'depth':null}));ami[_0xfc38('0x44')]('custom:queuesummary',this[_0xfc38('0x41')][_0x2440de[_0xfc38('0x6a')]]);}}}catch(_0x4b0e31){logger[_0xfc38('0x37')]('[voiceQueueReport][queuesummary]',util[_0xfc38('0x39')](_0x4b0e31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfc38('0x3d')]['syncQueueSummaryComplete']=function(_0x822ead){logger[_0xfc38('0x45')](_0xfc38('0x71'),util[_0xfc38('0x39')](_0x822ead,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xfc38('0x3d')]['syncQueueCallerJoin']=function(_0x45f74a){try{if(this[_0xfc38('0x65')](_0x45f74a)){logger[_0xfc38('0x45')]('[%s][voiceQueueReport][queuecallerjoin]',_0x45f74a[_0xfc38('0x48')],util['inspect'](_0x45f74a,{'showHidden':![],'depth':null}));if(_[_0xfc38('0x66')](this[_0xfc38('0x3a')][_0x45f74a[_0xfc38('0x48')]]))this[_0xfc38('0x3a')][_0x45f74a['uniqueid']]=[];if(_[_0xfc38('0x66')](this[_0xfc38('0xf')][_0x45f74a[_0xfc38('0x48')]]))this['channels'][_0x45f74a[_0xfc38('0x48')]]={};var _0x5d0d95=new QueueReport();_0x5d0d95[_0xfc38('0x4b')]=_0x45f74a['queue'];_0x5d0d95[_0xfc38('0x53')]=this[_0xfc38('0x41')][_0x5d0d95[_0xfc38('0x4b')]]&&this[_0xfc38('0x41')][_0x5d0d95['name']][_0xfc38('0x53')]?this[_0xfc38('0x41')][_0x5d0d95[_0xfc38('0x4b')]][_0xfc38('0x53')]||_0xfc38('0x54'):_0xfc38('0x54');_0x5d0d95[_0xfc38('0x6a')]=_0x45f74a[_0xfc38('0x6a')];_0x5d0d95[_0xfc38('0x72')]=moment()['format'](_0xfc38('0x73'));_0x5d0d95[_0xfc38('0x74')]=_0x45f74a[_0xfc38('0x74')];_0x5d0d95[_0xfc38('0x75')]=_0x45f74a[_0xfc38('0x75')];_0x5d0d95[_0xfc38('0x48')]=_0x45f74a['uniqueid'];_0x5d0d95['routealias']=this[_0xfc38('0xf')][_0x45f74a[_0xfc38('0x48')]][_0xfc38('0x76')];logger[_0xfc38('0x77')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5d0d95[_0xfc38('0x4b')],_0x5d0d95[_0xfc38('0x53')]);_[_0xfc38('0x78')](_0x5d0d95,_[_0xfc38('0x79')](_0x45f74a,_[_0xfc38('0x7a')](_0x5d0d95)));this[_0xfc38('0x3a')][_0x45f74a[_0xfc38('0x48')]][_0xfc38('0x7b')](_0x5d0d95);this[_0xfc38('0xf')][_0x45f74a['uniqueid']]=_0x5d0d95;this[_0xfc38('0x7c')](_0x5d0d95,_0xfc38('0x17'));}}catch(_0x2572ed){logger[_0xfc38('0x37')](_0xfc38('0x7d'),_0x45f74a[_0xfc38('0x48')],util[_0xfc38('0x39')](_0x2572ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfc38('0x3d')][_0xfc38('0x7e')]=function(_0x2a9129){try{if(this[_0xfc38('0x65')](_0x2a9129)){logger[_0xfc38('0x45')](_0xfc38('0x7f'),_0x2a9129['uniqueid'],util[_0xfc38('0x39')](_0x2a9129,{'showHidden':![],'depth':null}));if(this[_0xfc38('0x3a')][_0x2a9129[_0xfc38('0x48')]]){var _0x280bf7=_[_0xfc38('0x80')](this[_0xfc38('0x3a')][_0x2a9129[_0xfc38('0x48')]]);_0x280bf7[_0xfc38('0x81')]=![];_0x280bf7[_0xfc38('0x82')]=null;_0x280bf7['holdtime']=_0x2a9129['holdtime'];_0x280bf7[_0xfc38('0x83')]=_0x2a9129['originalposition'];_0x280bf7[_0xfc38('0x19')]=!![];_0x280bf7[_0xfc38('0x84')]=moment()[_0xfc38('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x280bf7[_0xfc38('0x4e')]='ABANDONED';_0x280bf7[_0xfc38('0x85')]=null;logger['info'](_0xfc38('0x86'),_0x280bf7[_0xfc38('0x4b')],_0x280bf7[_0xfc38('0x53')]);this[_0xfc38('0xf')][_0x2a9129[_0xfc38('0x48')]]=_0x280bf7;this[_0xfc38('0x42')](_0x280bf7,_0xfc38('0x19'));}}}catch(_0x3e24d0){logger['error'](_0xfc38('0x7f'),_0x2a9129[_0xfc38('0x48')],util['inspect'](_0x3e24d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfc38('0x87')]=function(_0x4ef617){try{if(this['isNotNull'](_0x4ef617)){logger[_0xfc38('0x45')](_0xfc38('0x88'),_0x4ef617[_0xfc38('0x48')],util['inspect'](_0x4ef617,{'showHidden':![],'depth':null}));if(this[_0xfc38('0x3a')][_0x4ef617['uniqueid']]){var _0x415746=_[_0xfc38('0x80')](this['queueReports'][_0x4ef617[_0xfc38('0x48')]]);_0x415746[_0xfc38('0x89')]=moment()[_0xfc38('0x49')](_0xfc38('0x73'));_0x415746['connectedlinenum']=_0x4ef617[_0xfc38('0x8a')];_0x415746[_0xfc38('0x8b')]=_0x4ef617['connectedlinename'];logger[_0xfc38('0x77')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x415746[_0xfc38('0x4b')],_0x415746[_0xfc38('0x53')],_0x4ef617['connectedlinenum'],_0x4ef617[_0xfc38('0x8b')]);this[_0xfc38('0xf')][_0x4ef617[_0xfc38('0x48')]]=_0x415746;this[_0xfc38('0x7c')](_0x415746,_0xfc38('0x8c'));}}}catch(_0x39df56){logger[_0xfc38('0x37')](_0xfc38('0x88'),_0x4ef617[_0xfc38('0x48')],util['inspect'](_0x39df56,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfc38('0x3d')][_0xfc38('0x1c')]=function(_0x27a4ca){try{if(this['isNotNull'](_0x27a4ca)){logger[_0xfc38('0x45')](_0xfc38('0x8d'),_0x27a4ca['uniqueid'],util[_0xfc38('0x39')](_0x27a4ca,{'showHidden':![],'depth':null}));if(this[_0xfc38('0x3a')][_0x27a4ca[_0xfc38('0x48')]]){var _0x4fa06e=_['last'](this['queueReports'][_0x27a4ca[_0xfc38('0x48')]]);_0x4fa06e[_0xfc38('0x81')]=!![];_0x4fa06e[_0xfc38('0x4e')]=_0xfc38('0x8e');logger[_0xfc38('0x77')](_0xfc38('0x8f'),_0x4fa06e['name'],_0x4fa06e['type']);}}}catch(_0x5c3bb7){logger[_0xfc38('0x37')](_0xfc38('0x8d'),_0x27a4ca[_0xfc38('0x48')],util[_0xfc38('0x39')](_0x5c3bb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfc38('0x90')]=function(_0x1bf45a){try{if(this[_0xfc38('0x65')](_0x1bf45a)){logger[_0xfc38('0x45')](_0xfc38('0x91'),_0x1bf45a['uniqueid'],util[_0xfc38('0x39')](_0x1bf45a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1bf45a['uniqueid']]){var _0x2229a7=_['last'](this['queueReports'][_0x1bf45a[_0xfc38('0x48')]]);_0x2229a7['queuecallerabandon']=![];_0x2229a7[_0xfc38('0x84')]=null;_0x2229a7[_0xfc38('0x92')]=!![];_0x2229a7[_0xfc38('0x85')]=_0x1bf45a['membername'];_0x2229a7[_0xfc38('0x93')]=_0x1bf45a['holdtime'];_0x2229a7[_0xfc38('0x81')]=!![];_0x2229a7[_0xfc38('0x94')]=![];_0x2229a7[_0xfc38('0x95')]=null;if(!_0x2229a7[_0xfc38('0x96')]){if(_0x1bf45a[_0xfc38('0x97')]==_0xfc38('0x96')){_0x2229a7[_0xfc38('0x4e')]=_0xfc38('0x98');logger['info'](_0xfc38('0x99'),_0x2229a7['name'],_0x2229a7[_0xfc38('0x53')]);}else{if(_[_0xfc38('0x9a')](_0x1bf45a[_0xfc38('0x33')]['toLowerCase'](),_0xfc38('0x9b'))){if(this[_0xfc38('0x3a')][_0x1bf45a['linkedid']]){var _0x18b3f2=_[_0xfc38('0x80')](this[_0xfc38('0x3a')][_0x1bf45a['linkedid']]);_0x18b3f2[_0xfc38('0x81')]=![];_0x18b3f2[_0xfc38('0x94')]=!![];_0x18b3f2['queuecallerexitAt']=moment(_0x2229a7['queuecallerjoinAt'])[_0xfc38('0x9c')](_0x1bf45a[_0xfc38('0x93')],'seconds')[_0xfc38('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x18b3f2[_0xfc38('0x4e')]=_0xfc38('0x9d');_0x18b3f2[_0xfc38('0x96')]=!![];_0x18b3f2[_0xfc38('0x9e')]=_0xfc38('0x9f');_0x18b3f2[_0xfc38('0xa0')]=_0x1bf45a[_0xfc38('0xa1')];_0x18b3f2['transferuniqueid']=_0x1bf45a[_0xfc38('0x48')];logger[_0xfc38('0x77')](_0xfc38('0xa2'),_0x18b3f2[_0xfc38('0x4b')],_0x18b3f2['type']);var _0x5623c4=this[_0xfc38('0x3a')][_0x1bf45a[_0xfc38('0xa3')]];this[_0xfc38('0x3a')][_0x1bf45a[_0xfc38('0xa3')]]=this['queueReports'][_0x1bf45a[_0xfc38('0x48')]];this[_0xfc38('0x3a')][_0x1bf45a[_0xfc38('0x48')]]=_0x5623c4;}}else{_0x2229a7[_0xfc38('0x4e')]='COMPLETEDBY'+_0x1bf45a[_0xfc38('0x97')][_0xfc38('0xa4')]();logger[_0xfc38('0x77')](_0xfc38('0xa5'),_0x2229a7[_0xfc38('0x4b')],_0x2229a7[_0xfc38('0x53')],_0x2229a7[_0xfc38('0x4e')]);}}}this[_0xfc38('0xf')][_0x1bf45a[_0xfc38('0x48')]]=_0x2229a7;this[_0xfc38('0x42')](_0x2229a7,_0xfc38('0x1a'));}}}catch(_0x2fbd91){logger[_0xfc38('0x37')](_0xfc38('0x91'),_0x1bf45a[_0xfc38('0x48')],util[_0xfc38('0x39')](_0x2fbd91,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfc38('0x1d')]=function(_0x1b5955){try{if(this['isNotNull'](_0x1b5955)){logger[_0xfc38('0x45')](_0xfc38('0xa6'),_0x1b5955['uniqueid'],util[_0xfc38('0x39')](_0x1b5955,{'showHidden':![],'depth':null}));this[_0xfc38('0xa7')](_0x1b5955[_0xfc38('0x48')],_[_0xfc38('0x7a')](_0x1b5955['variable'])[0x0],_0x1b5955['value']);if(this['queueReports'][_0x1b5955[_0xfc38('0x48')]]){var _0x585eb0=_[_0xfc38('0x80')](this[_0xfc38('0x3a')][_0x1b5955[_0xfc38('0x48')]]);if(_0x585eb0){if(this[_0xfc38('0x65')](_0x1b5955[_0xfc38('0xa8')])&&this['isNotNull'](_0x1b5955[_0xfc38('0xa8')]['queuestatus'])){switch(_0x1b5955[_0xfc38('0xa9')]){case _0xfc38('0xaa'):_0x585eb0[_0xfc38('0x94')]=![];_0x585eb0[_0xfc38('0x95')]=null;break;case _0xfc38('0xab'):_0x585eb0[_0xfc38('0xac')]=_0xfc38('0xad');_0x585eb0[_0xfc38('0x94')]=!![];_0x585eb0[_0xfc38('0x95')]=moment()['format'](_0xfc38('0x73'));_0x585eb0[_0xfc38('0x89')]=moment()[_0xfc38('0x49')](_0xfc38('0x73'));logger[_0xfc38('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1b5955[_0xfc38('0x48')],util['inspect'](_0x585eb0,{'showHidden':![],'depth':null}));ami[_0xfc38('0x44')](_0xfc38('0xae'),_0x585eb0);break;default:_0x585eb0[_0xfc38('0x94')]=!![];_0x585eb0[_0xfc38('0x95')]=moment()[_0xfc38('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x585eb0[_0xfc38('0x89')]=moment()[_0xfc38('0x49')]('YYYY-MM-DD\x20HH:mm:ss');}_0x585eb0[_0xfc38('0x19')]=![];_0x585eb0['queuecallerabandonAt']=null;_0x585eb0[_0xfc38('0x4e')]=_0x1b5955[_0xfc38('0xa9')];this[_0xfc38('0xf')][_0x1b5955[_0xfc38('0x48')]]=_0x585eb0;this['emitVoiceQueueChannelRemove'](_0x585eb0,_0xfc38('0xaf'));}else if(this[_0xfc38('0x65')](_0x1b5955[_0xfc38('0xa8')])&&this[_0xfc38('0x65')](_0x1b5955[_0xfc38('0xa8')][_0xfc38('0xb0')])){if(!_0x585eb0[_0xfc38('0x19')]){_0x585eb0[_0xfc38('0x94')]=!![];_0x585eb0[_0xfc38('0x95')]=moment()[_0xfc38('0x49')](_0xfc38('0x73'));_0x585eb0[_0xfc38('0x4e')]=_0xfc38('0xb1');_0x585eb0[_0xfc38('0x89')]=moment()[_0xfc38('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1b5955[_0xfc38('0x48')]]=_0x585eb0;}}logger[_0xfc38('0x77')](_0xfc38('0xb2'),_0x1b5955['uniqueid'],_0x585eb0['name'],_0x585eb0[_0xfc38('0x53')],_[_0xfc38('0x7a')](_0x1b5955['variable'])[0x0],_0x1b5955['value']);_0x585eb0[_0xfc38('0x11')]=this[_0xfc38('0x11')][_0x1b5955[_0xfc38('0x48')]];}}}}catch(_0x1ab539){logger[_0xfc38('0x37')]('[%s][voiceQueueReport][varset]',_0x1b5955[_0xfc38('0x48')],util[_0xfc38('0x39')](_0x1ab539,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfc38('0xa7')]=function(_0x58f047,_0x4c90e3,_0xb5c88a){var _0x3b014b=['rtpaudioqos',_0xfc38('0xb3'),_0xfc38('0xb4'),_0xfc38('0xb5'),_0xfc38('0xb6'),_0xfc38('0xb7'),_0xfc38('0xb8'),_0xfc38('0xb9'),_0xfc38('0xba'),_0xfc38('0xbb'),_0xfc38('0xbc'),_0xfc38('0xbd'),'membercalls',_0xfc38('0xbe'),'memberinterface','memberlastcall','membername',_0xfc38('0xbf'),_0xfc38('0xc0')];if(!_['isNil'](_0x4c90e3)&&!_[_0xfc38('0xc1')](_0x3b014b,_0x4c90e3)){if(_['isUndefined'](this[_0xfc38('0x11')][_0x58f047])){this['variables'][_0x58f047]={};}this[_0xfc38('0x11')][_0x58f047][_0x4c90e3]=_0xb5c88a;}};VoiceQueueReport['prototype'][_0xfc38('0xc2')]=function(_0x1eaa14){try{if(this[_0xfc38('0x65')](_0x1eaa14)){logger[_0xfc38('0x45')](_0xfc38('0xc3'),_0x1eaa14['uniqueid'],util[_0xfc38('0x39')](_0x1eaa14,{'showHidden':![],'depth':null}));if(this[_0xfc38('0x3a')][_0x1eaa14[_0xfc38('0x48')]]){for(var _0x44e7f5=0x0,_0x1cfa1a={};_0x44e7f50x0?_0x145273:0x0;this['voiceQueues'][_0x3c042f[_0xa6ad('0x65')]][_0xa6ad('0x2d')]=this['voiceQueues'][_0x3c042f[_0xa6ad('0x65')]][_0xa6ad('0x2d')]>_['toNumber'](_0x3c042f[_0xa6ad('0x69')])?_[_0xa6ad('0x68')](_0x3c042f[_0xa6ad('0x69')]):this[_0xa6ad('0xf')][_0x3c042f['queue']]['talking'];this[_0xa6ad('0x4c')](this[_0xa6ad('0xf')][_0x3c042f['queue']],_0xa6ad('0x13'));}logger[_0xa6ad('0x40')](_0xa6ad('0x6b'),util[_0xa6ad('0x39')](this[_0xa6ad('0xf')][_0x3c042f[_0xa6ad('0x65')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x3c042f['queue']]);}}}catch(_0x20daaf){logger[_0xa6ad('0x36')](_0xa6ad('0x62'),util[_0xa6ad('0x39')](_0x20daaf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x4cedd4){logger[_0xa6ad('0x40')](_0xa6ad('0x6c'),util['inspect'](_0x4cedd4,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xa6ad('0x18')]=function(_0x1c8e26){try{if(this[_0xa6ad('0x64')](_0x1c8e26)){logger[_0xa6ad('0x40')](_0xa6ad('0x6d'),_0x1c8e26[_0xa6ad('0x43')],util['inspect'](_0x1c8e26,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xa6ad('0xc')][_0x1c8e26[_0xa6ad('0x43')]]))this['queueReports'][_0x1c8e26[_0xa6ad('0x43')]]=[];if(_[_0xa6ad('0x5c')](this[_0xa6ad('0xe')][_0x1c8e26[_0xa6ad('0x43')]]))this[_0xa6ad('0xe')][_0x1c8e26[_0xa6ad('0x43')]]={};var _0x35b643=new QueueReport();_0x35b643[_0xa6ad('0x45')]=_0x1c8e26[_0xa6ad('0x65')];_0x35b643[_0xa6ad('0x4d')]=this[_0xa6ad('0xf')][_0x35b643[_0xa6ad('0x45')]]&&this[_0xa6ad('0xf')][_0x35b643['name']]['type']?this[_0xa6ad('0xf')][_0x35b643['name']]['type']||'inbound':_0xa6ad('0x4e');_0x35b643['queue']=_0x1c8e26[_0xa6ad('0x65')];_0x35b643[_0xa6ad('0x6e')]=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));_0x35b643[_0xa6ad('0x70')]=_0x1c8e26[_0xa6ad('0x70')];_0x35b643[_0xa6ad('0x71')]=_0x1c8e26[_0xa6ad('0x71')];_0x35b643[_0xa6ad('0x43')]=_0x1c8e26[_0xa6ad('0x43')];_0x35b643[_0xa6ad('0x72')]=this[_0xa6ad('0xe')][_0x1c8e26['uniqueid']]['routealias'];logger[_0xa6ad('0x66')](_0xa6ad('0x73'),_0x35b643[_0xa6ad('0x45')],_0x35b643[_0xa6ad('0x4d')]);_['merge'](_0x35b643,_[_0xa6ad('0x74')](_0x1c8e26,_[_0xa6ad('0x75')](_0x35b643)));this[_0xa6ad('0xc')][_0x1c8e26['uniqueid']][_0xa6ad('0x76')](_0x35b643);this[_0xa6ad('0xe')][_0x1c8e26[_0xa6ad('0x43')]]=_0x35b643;this['emitVoiceQueueChannelSave'](_0x35b643,_0xa6ad('0x17'));}}catch(_0x19de9b){logger['error'](_0xa6ad('0x6d'),_0x1c8e26['uniqueid'],util[_0xa6ad('0x39')](_0x19de9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa6ad('0x1a')]=function(_0x4b2d2f){try{if(this['isNotNull'](_0x4b2d2f)){logger[_0xa6ad('0x40')](_0xa6ad('0x77'),_0x4b2d2f[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x4b2d2f,{'showHidden':![],'depth':null}));if(this[_0xa6ad('0xc')][_0x4b2d2f[_0xa6ad('0x43')]]){var _0x33cbd5=_[_0xa6ad('0x78')](this[_0xa6ad('0xc')][_0x4b2d2f[_0xa6ad('0x43')]]);_0x33cbd5[_0xa6ad('0x79')]=![];_0x33cbd5[_0xa6ad('0x7a')]=null;_0x33cbd5[_0xa6ad('0x7b')]=_0x4b2d2f['holdtime'];_0x33cbd5[_0xa6ad('0x7c')]=_0x4b2d2f['originalposition'];_0x33cbd5[_0xa6ad('0x19')]=!![];_0x33cbd5['queuecallerabandonAt']=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));_0x33cbd5[_0xa6ad('0x48')]=_0xa6ad('0x7d');_0x33cbd5[_0xa6ad('0x7e')]=null;logger[_0xa6ad('0x66')](_0xa6ad('0x7f'),_0x33cbd5[_0xa6ad('0x45')],_0x33cbd5[_0xa6ad('0x4d')]);this['channels'][_0x4b2d2f[_0xa6ad('0x43')]]=_0x33cbd5;this[_0xa6ad('0x3c')](_0x33cbd5,_0xa6ad('0x19'));}}}catch(_0x67e95d){logger[_0xa6ad('0x36')](_0xa6ad('0x77'),_0x4b2d2f[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x67e95d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ad('0x7')]['syncQueueCallerLeave']=function(_0x38c799){try{if(this[_0xa6ad('0x64')](_0x38c799)){logger[_0xa6ad('0x40')](_0xa6ad('0x80'),_0x38c799[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x38c799,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x38c799['uniqueid']]){var _0x1558d5=_[_0xa6ad('0x78')](this[_0xa6ad('0xc')][_0x38c799[_0xa6ad('0x43')]]);_0x1558d5['queuecallerleaveAt']=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));_0x1558d5['connectedlinenum']=_0x38c799[_0xa6ad('0x81')];_0x1558d5[_0xa6ad('0x82')]=_0x38c799[_0xa6ad('0x82')];logger[_0xa6ad('0x66')](_0xa6ad('0x83'),_0x1558d5['name'],_0x1558d5['type'],_0x38c799[_0xa6ad('0x81')],_0x38c799['connectedlinename']);this[_0xa6ad('0xe')][_0x38c799[_0xa6ad('0x43')]]=_0x1558d5;this[_0xa6ad('0x3f')](_0x1558d5,_0xa6ad('0x1b'));}}}catch(_0x4b8b70){logger[_0xa6ad('0x36')](_0xa6ad('0x80'),_0x38c799['uniqueid'],util['inspect'](_0x4b8b70,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ad('0x7')][_0xa6ad('0x84')]=function(_0x44540a){try{if(this['isNotNull'](_0x44540a)){logger['debug'](_0xa6ad('0x85'),_0x44540a[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x44540a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44540a['uniqueid']]){var _0x233a05=_[_0xa6ad('0x78')](this[_0xa6ad('0xc')][_0x44540a[_0xa6ad('0x43')]]);_0x233a05[_0xa6ad('0x79')]=!![];_0x233a05['queuecallerexitreason']=_0xa6ad('0x86');logger[_0xa6ad('0x66')](_0xa6ad('0x87'),_0x233a05[_0xa6ad('0x45')],_0x233a05[_0xa6ad('0x4d')]);}}}catch(_0x37f715){logger[_0xa6ad('0x36')](_0xa6ad('0x85'),_0x44540a[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x37f715,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x2129c2){try{if(this[_0xa6ad('0x64')](_0x2129c2)){logger[_0xa6ad('0x40')](_0xa6ad('0x88'),_0x2129c2[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x2129c2,{'showHidden':![],'depth':null}));if(this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x43')]]){var _0x3d6d9a=_['last'](this[_0xa6ad('0xc')][_0x2129c2['uniqueid']]);_0x3d6d9a[_0xa6ad('0x19')]=![];_0x3d6d9a[_0xa6ad('0x89')]=null;_0x3d6d9a[_0xa6ad('0x8a')]=!![];_0x3d6d9a[_0xa6ad('0x7e')]=_0x2129c2[_0xa6ad('0x8b')];_0x3d6d9a[_0xa6ad('0x7b')]=_0x2129c2[_0xa6ad('0x7b')];_0x3d6d9a[_0xa6ad('0x79')]=!![];_0x3d6d9a[_0xa6ad('0x8c')]=![];_0x3d6d9a[_0xa6ad('0x8d')]=null;if(!_0x3d6d9a[_0xa6ad('0x8e')]){if(_0x2129c2[_0xa6ad('0x8f')]==_0xa6ad('0x8e')){_0x3d6d9a[_0xa6ad('0x48')]=_0xa6ad('0x90');logger['info'](_0xa6ad('0x91'),_0x3d6d9a[_0xa6ad('0x45')],_0x3d6d9a[_0xa6ad('0x4d')]);}else{if(_[_0xa6ad('0x92')](_0x2129c2['channel'][_0xa6ad('0x93')](),_0xa6ad('0x94'))){if(this[_0xa6ad('0xc')][_0x2129c2['linkedid']]){var _0x47468b=_['last'](this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x95')]]);_0x47468b[_0xa6ad('0x79')]=![];_0x47468b[_0xa6ad('0x8c')]=!![];_0x47468b[_0xa6ad('0x8d')]=moment(_0x3d6d9a[_0xa6ad('0x6e')])[_0xa6ad('0x96')](_0x2129c2['holdtime'],_0xa6ad('0x97'))[_0xa6ad('0x49')](_0xa6ad('0x6f'));_0x47468b['queuecallerexitreason']=_0xa6ad('0x98');_0x47468b[_0xa6ad('0x8e')]=!![];_0x47468b['transfertype']=_0xa6ad('0x99');_0x47468b[_0xa6ad('0x9a')]=_0x2129c2[_0xa6ad('0x9b')];_0x47468b[_0xa6ad('0x9c')]=_0x2129c2[_0xa6ad('0x43')];logger['info'](_0xa6ad('0x9d'),_0x47468b[_0xa6ad('0x45')],_0x47468b[_0xa6ad('0x4d')]);var _0x4122c4=this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x95')]];this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x95')]]=this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x43')]];this[_0xa6ad('0xc')][_0x2129c2[_0xa6ad('0x43')]]=_0x4122c4;}}else{_0x3d6d9a['queuecallerexitreason']=_0xa6ad('0x9e')+_0x2129c2[_0xa6ad('0x8f')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3d6d9a[_0xa6ad('0x45')],_0x3d6d9a['type'],_0x3d6d9a[_0xa6ad('0x48')]);}}}this[_0xa6ad('0xe')][_0x2129c2[_0xa6ad('0x43')]]=_0x3d6d9a;this['emitVoiceQueueChannelRemove'](_0x3d6d9a,_0xa6ad('0x1c'));}}}catch(_0x4bd9b8){logger[_0xa6ad('0x36')]('[%s][voiceQueueReport][agentcomplete]',_0x2129c2[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x4bd9b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ad('0x7')]['syncVarSet']=function(_0x17a03d){try{if(this[_0xa6ad('0x64')](_0x17a03d)){logger['debug'](_0xa6ad('0x9f'),_0x17a03d[_0xa6ad('0x43')],util['inspect'](_0x17a03d,{'showHidden':![],'depth':null}));this['addVariable'](_0x17a03d[_0xa6ad('0x43')],_[_0xa6ad('0x75')](_0x17a03d['variable'])[0x0],_0x17a03d[_0xa6ad('0xa0')]);if(this[_0xa6ad('0xc')][_0x17a03d['uniqueid']]){var _0x4ef2ac=_['last'](this[_0xa6ad('0xc')][_0x17a03d['uniqueid']]);if(_0x4ef2ac){if(this[_0xa6ad('0x64')](_0x17a03d[_0xa6ad('0xa1')])&&this[_0xa6ad('0x64')](_0x17a03d['variable'][_0xa6ad('0xa2')])){switch(_0x17a03d[_0xa6ad('0xa0')]){case _0xa6ad('0xa3'):_0x4ef2ac[_0xa6ad('0x8c')]=![];_0x4ef2ac['queuecallerexitAt']=null;break;case _0xa6ad('0xa4'):_0x4ef2ac[_0xa6ad('0xa5')]=_0xa6ad('0xa6');_0x4ef2ac[_0xa6ad('0x8c')]=!![];_0x4ef2ac[_0xa6ad('0x8d')]=moment()['format'](_0xa6ad('0x6f'));_0x4ef2ac[_0xa6ad('0xa7')]=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));logger[_0xa6ad('0x40')](_0xa6ad('0xa8'),_0x17a03d[_0xa6ad('0x43')],util[_0xa6ad('0x39')](_0x4ef2ac,{'showHidden':![],'depth':null}));ami['emit'](_0xa6ad('0xa9'),_0x4ef2ac);break;default:_0x4ef2ac[_0xa6ad('0x8c')]=!![];_0x4ef2ac[_0xa6ad('0x8d')]=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));_0x4ef2ac[_0xa6ad('0xa7')]=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));}_0x4ef2ac[_0xa6ad('0x19')]=![];_0x4ef2ac['queuecallerabandonAt']=null;_0x4ef2ac[_0xa6ad('0x48')]=_0x17a03d[_0xa6ad('0xa0')];this[_0xa6ad('0xe')][_0x17a03d[_0xa6ad('0x43')]]=_0x4ef2ac;this[_0xa6ad('0x3c')](_0x4ef2ac,'varset');}else if(this['isNotNull'](_0x17a03d[_0xa6ad('0xa1')])&&this[_0xa6ad('0x64')](_0x17a03d[_0xa6ad('0xa1')][_0xa6ad('0xaa')])){if(!_0x4ef2ac[_0xa6ad('0x19')]){_0x4ef2ac['queuecallerexit']=!![];_0x4ef2ac['queuecallerexitAt']=moment()[_0xa6ad('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ef2ac[_0xa6ad('0x48')]='EXITWITHKEY';_0x4ef2ac[_0xa6ad('0xa7')]=moment()[_0xa6ad('0x49')](_0xa6ad('0x6f'));this[_0xa6ad('0xe')][_0x17a03d[_0xa6ad('0x43')]]=_0x4ef2ac;}}logger[_0xa6ad('0x66')](_0xa6ad('0xab'),_0x17a03d['uniqueid'],_0x4ef2ac[_0xa6ad('0x45')],_0x4ef2ac[_0xa6ad('0x4d')],_[_0xa6ad('0x75')](_0x17a03d[_0xa6ad('0xa1')])[0x0],_0x17a03d['value']);_0x4ef2ac[_0xa6ad('0x12')]=this[_0xa6ad('0x12')][_0x17a03d[_0xa6ad('0x43')]];}}}}catch(_0x212f4b){logger[_0xa6ad('0x36')]('[%s][voiceQueueReport][varset]',_0x17a03d['uniqueid'],util[_0xa6ad('0x39')](_0x212f4b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ad('0x7')][_0xa6ad('0xac')]=function(_0x5ebb16,_0xde64f2,_0x21c0f4){var _0x32c715=[_0xa6ad('0xad'),_0xa6ad('0xae'),_0xa6ad('0xaf'),_0xa6ad('0xb0'),_0xa6ad('0xb1'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xa6ad('0xb2'),_0xa6ad('0xb3'),_0xa6ad('0xb4'),_0xa6ad('0xb5'),_0xa6ad('0xb6'),_0xa6ad('0xb7'),_0xa6ad('0xb8'),_0xa6ad('0xb9'),_0xa6ad('0xba'),_0xa6ad('0x8b'),'memberpenalty',_0xa6ad('0xbb')];if(!_[_0xa6ad('0x32')](_0xde64f2)&&!_[_0xa6ad('0xbc')](_0x32c715,_0xde64f2)){if(_[_0xa6ad('0x5c')](this[_0xa6ad('0x12')][_0x5ebb16])){this[_0xa6ad('0x12')][_0x5ebb16]={};}this['variables'][_0x5ebb16][_0xde64f2]=_0x21c0f4;}};VoiceQueueReport['prototype'][_0xa6ad('0x22')]=function(_0x1700ae){try{if(this[_0xa6ad('0x64')](_0x1700ae)){logger['debug'](_0xa6ad('0xbd'),_0x1700ae['uniqueid'],util['inspect'](_0x1700ae,{'showHidden':![],'depth':null}));if(this[_0xa6ad('0xc')][_0x1700ae[_0xa6ad('0x43')]]){for(var _0x26a1a4=0x0,_0x31ecb9={};_0x26a1a4=0x0?moment(_0x3dedc9[_0x62d0('0x18')])[_0x62d0('0xb')](_0x3dedc9['starttime'],_0x62d0('0xc')):null,'data1':'outbound','data2':_0x3dedc9[_0x62d0('0x11')],'data3':_0x3dedc9['exten'],'data4':_0x3dedc9[_0x62d0('0x1a')]||null,'role':_0x62d0('0x10'),'internal':_0x3dedc9['accountcode']?_[_0x62d0('0x12')](_0x3dedc9[_0x62d0('0x11')]):undefined,'uniqueid':_0x3dedc9['uniqueid']},'log':_0x62d0('0x3')});}; \ No newline at end of file +var _0x0b52=['queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voice','membername','starttime','endtime','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING'];(function(_0x17588b,_0x4fa49a){var _0x1411df=function(_0x6aef17){while(--_0x6aef17){_0x17588b['push'](_0x17588b['shift']());}};_0x1411df(++_0x4fa49a);}(_0x0b52,0x184));var _0x20b5=function(_0x45f22a,_0x4ae629){_0x45f22a=_0x45f22a-0x0;var _0x42d9a3=_0x0b52[_0x45f22a];return _0x42d9a3;};'use strict';var moment=require(_0x20b5('0x0'));var _=require(_0x20b5('0x1'));var util=require(_0x20b5('0x2'));var client=require(_0x20b5('0x3'));exports[_0x20b5('0x4')]=function(_0x1bcff0){var _0x37dcb0=_0x1bcff0[_0x20b5('0x5')]||_0x1bcff0[_0x20b5('0x6')];return client[_0x20b5('0x7')](_0x20b5('0x8'),{'body':{'channel':'voice','membername':_0x1bcff0['lastAssignedTo'],'interface':_[_0x20b5('0x9')](_0x1bcff0[_0x20b5('0xa')])?util[_0x20b5('0xb')](_0x20b5('0xc'),_0x1bcff0[_0x20b5('0xd')]):_0x1bcff0['interface'],'type':_0x20b5('0xe'),'enterAt':_0x1bcff0[_0x20b5('0xf')],'exitAt':_0x37dcb0,'duration':moment(_0x37dcb0)[_0x20b5('0x10')](_0x1bcff0[_0x20b5('0xf')],_0x20b5('0x11')),'data1':_0x20b5('0x12'),'data2':_0x1bcff0[_0x20b5('0x13')],'data3':_0x1bcff0[_0x20b5('0x14')],'data4':null,'data5':_0x1bcff0[_0x20b5('0x15')],'role':_0x20b5('0x16'),'internal':_0x1bcff0[_0x20b5('0x17')]?_[_0x20b5('0x18')](_0x1bcff0[_0x20b5('0x17')]):undefined,'uniqueid':_0x1bcff0[_0x20b5('0x19')]},'log':_0x20b5('0x8')});};exports['voiceDialReport']=function(_0x58825d){return client[_0x20b5('0x7')](_0x20b5('0x8'),{'body':{'channel':_0x20b5('0x1a'),'membername':_0x58825d[_0x20b5('0x1b')],'interface':_0x58825d[_0x20b5('0xa')],'type':_0x20b5('0xe'),'enterAt':_0x58825d[_0x20b5('0x1c')],'exitAt':_0x58825d[_0x20b5('0x1d')],'duration':moment(_0x58825d[_0x20b5('0x1d')])[_0x20b5('0x10')](_0x58825d[_0x20b5('0x1c')],_0x20b5('0x11'))>=0x0?moment(_0x58825d['endtime'])[_0x20b5('0x10')](_0x58825d['starttime'],'seconds'):null,'data1':'outbound','data2':_0x58825d['accountcode'],'data3':_0x58825d[_0x20b5('0x14')],'data4':_0x58825d[_0x20b5('0x1e')]||null,'role':_0x20b5('0x16'),'internal':_0x58825d['accountcode']?_[_0x20b5('0x18')](_0x58825d['accountcode']):undefined,'uniqueid':_0x58825d[_0x20b5('0x19')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 68e3161..482fe10 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 _0x25c2=['GetSettings','../client','Request','ShowSetting','previewRecallmeReminderInterval'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x25c2,0xdd));var _0x225c=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x25c2[_0x34eb31];return _0x254994;};'use strict';var client=require(_0x225c('0x0'));exports['getSettings']=function(){return client[_0x225c('0x1')](_0x225c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x225c('0x3')]},'log':_0x225c('0x4')});}; \ No newline at end of file +var _0xedd7=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings','Request','ShowSetting'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xedd7,0x6f));var _0x7edd=function(_0x37b07c,_0x5941a1){_0x37b07c=_0x37b07c-0x0;var _0x264672=_0xedd7[_0x37b07c];return _0x264672;};'use strict';var client=require('../client');exports[_0x7edd('0x0')]=function(){return client[_0x7edd('0x1')](_0x7edd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7edd('0x3'),_0x7edd('0x4')]},'log':_0x7edd('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index baa9f49..3eff1ec 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 _0x649c=['Request','GetTemplate','html','getTemplates'];(function(_0x5e563b,_0x1d9d1f){var _0x46b056=function(_0x2cfaae){while(--_0x2cfaae){_0x5e563b['push'](_0x5e563b['shift']());}};_0x46b056(++_0x1d9d1f);}(_0x649c,0x1cf));var _0xc649=function(_0x4b274b,_0x464ff7){_0x4b274b=_0x4b274b-0x0;var _0x1a7594=_0x649c[_0x4b274b];return _0x1a7594;};'use strict';var client=require('../client');exports[_0xc649('0x0')]=function(_0x4c617f){return function(_0x4130e2){return client[_0xc649('0x1')](_0xc649('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xc649('0x3')]},'log':_0xc649('0x2')});};}; \ No newline at end of file +var _0x2f0c=['getTemplates','Request','name','html','../client'];(function(_0x1bf52f,_0x567b53){var _0x39b4ce=function(_0x5bcc85){while(--_0x5bcc85){_0x1bf52f['push'](_0x1bf52f['shift']());}};_0x39b4ce(++_0x567b53);}(_0x2f0c,0x1b2));var _0xc2f0=function(_0x265468,_0xcf7439){_0x265468=_0x265468-0x0;var _0x37d555=_0x2f0c[_0x265468];return _0x37d555;};'use strict';var client=require(_0xc2f0('0x0'));exports[_0xc2f0('0x1')]=function(_0x5390d7){return function(_0x5cb284){return client[_0xc2f0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xc2f0('0x3'),_0xc2f0('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 2b56257..707f8b2 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 _0xd917=['data2','data4','data5','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','value','operator','Action','Actions','action','data1'];(function(_0x3f9a81,_0x53550b){var _0x22112c=function(_0xfb425f){while(--_0xfb425f){_0x3f9a81['push'](_0x3f9a81['shift']());}};_0x22112c(++_0x53550b);}(_0xd917,0x123));var _0x7d91=function(_0xd8a4be,_0x5861b9){_0xd8a4be=_0xd8a4be-0x0;var _0x20fece=_0xd917[_0xd8a4be];return _0x20fece;};'use strict';var client=require('../client');exports[_0x7d91('0x0')]=function(_0x2b712d){return function(_0x39546e){return client[_0x7d91('0x1')](_0x7d91('0x2'),{'options':{'raw':![],'attributes':['id',_0x7d91('0x3'),_0x7d91('0x4'),'status'],'include':[{'model':_0x7d91('0x5'),'as':_0x7d91('0x6'),'attributes':['id','field','operator',_0x7d91('0x7')]},{'model':_0x7d91('0x5'),'as':'AnyConditions','attributes':['id','field',_0x7d91('0x8'),_0x7d91('0x7')]},{'model':_0x7d91('0x9'),'as':_0x7d91('0xa'),'attributes':['id',_0x7d91('0xb'),_0x7d91('0xc'),_0x7d91('0xd'),'data3',_0x7d91('0xe'),_0x7d91('0xf'),'data6','data7']}]},'log':_0x7d91('0x2')});};}; \ No newline at end of file +var _0x81e5=['Condition','AllConditions','field','operator','value','Action','action','data1','data2','data3','data4','data5','data6','getTriggers','Request','GetTrigger','name','status'];(function(_0x4a0066,_0x16fb7e){var _0x611761=function(_0x4c040d){while(--_0x4c040d){_0x4a0066['push'](_0x4a0066['shift']());}};_0x611761(++_0x16fb7e);}(_0x81e5,0x9d));var _0x581e=function(_0x1e4d86,_0x2a7b31){_0x1e4d86=_0x1e4d86-0x0;var _0x49b813=_0x81e5[_0x1e4d86];return _0x49b813;};'use strict';var client=require('../client');exports[_0x581e('0x0')]=function(_0x4bfa8d){return function(_0x20a749){return client[_0x581e('0x1')](_0x581e('0x2'),{'options':{'raw':![],'attributes':['id',_0x581e('0x3'),'channel',_0x581e('0x4')],'include':[{'model':_0x581e('0x5'),'as':_0x581e('0x6'),'attributes':['id',_0x581e('0x7'),_0x581e('0x8'),_0x581e('0x9')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0x581e('0x7'),_0x581e('0x8'),_0x581e('0x9')]},{'model':_0x581e('0xa'),'as':'Actions','attributes':['id',_0x581e('0xb'),_0x581e('0xc'),_0x581e('0xd'),_0x581e('0xe'),_0x581e('0xf'),_0x581e('0x10'),_0x581e('0x11'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4bd6337..acebf82 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 _0x21d1=['GetTrunk','defaultuser','../client','getTrunks','Request'];(function(_0x1efbf0,_0x340627){var _0x188287=function(_0x3ac30c){while(--_0x3ac30c){_0x1efbf0['push'](_0x1efbf0['shift']());}};_0x188287(++_0x340627);}(_0x21d1,0x1c9));var _0x121d=function(_0x584a59,_0x4e6dcd){_0x584a59=_0x584a59-0x0;var _0x3cc4ef=_0x21d1[_0x584a59];return _0x3cc4ef;};'use strict';var client=require(_0x121d('0x0'));exports[_0x121d('0x1')]=function(_0x2c3a5f){return function(_0x1a9916){return client[_0x121d('0x2')](_0x121d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x121d('0x4')]},'log':_0x121d('0x3')});};}; \ No newline at end of file +var _0xfb58=['getTrunks','GetTrunk','registry','../client'];(function(_0x4a732f,_0x320117){var _0x181173=function(_0x435a97){while(--_0x435a97){_0x4a732f['push'](_0x4a732f['shift']());}};_0x181173(++_0x320117);}(_0xfb58,0x143));var _0x8fb5=function(_0x7d8e2e,_0x22069f){_0x7d8e2e=_0x7d8e2e-0x0;var _0x4b3d12=_0xfb58[_0x7d8e2e];return _0x4b3d12;};'use strict';var client=require(_0x8fb5('0x0'));exports[_0x8fb5('0x1')]=function(_0xb1b839){return function(_0x2b16ea){return client['Request'](_0x8fb5('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x8fb5('0x3'),'defaultuser']},'log':_0x8fb5('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 628af1c..329f7d4 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x5d6e64,_0x32d37c){var _0x55ec47=function(_0x5ab987){while(--_0x5ab987){_0x5d6e64['push'](_0x5d6e64['shift']());}};_0x55ec47(++_0x32d37c);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x3d2b65,_0x32bbb6){var _0x9d3b37=function(_0x1e2823){while(--_0x1e2823){_0x3d2b65['push'](_0x3d2b65['shift']());}};_0x9d3b37(++_0x32bbb6);}(_0x70e0,0x17b));var _0x070e=function(_0x1328db,_0x2cd296){_0x1328db=_0x1328db-0x0;var _0x1388ec=_0x70e0[_0x1328db];return _0x1388ec;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5d160ef..f6759c8 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 _0x78d8=['../client','create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x3cf518,_0x2cd587){var _0x187969=function(_0x20885d){while(--_0x20885d){_0x3cf518['push'](_0x3cf518['shift']());}};_0x187969(++_0x2cd587);}(_0x78d8,0x127));var _0x878d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x78d8[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x878d('0x0'));exports[_0x878d('0x1')]=function(_0x396f95){return client[_0x878d('0x2')](_0x878d('0x3'),{'body':_0x396f95,'log':_0x878d('0x3')});};exports['update']=function(_0x45fd82,_0xa8784a,_0x26c7e5){return client['Request'](_0x878d('0x4'),{'body':_0x45fd82,'options':{'where':{'uniqueid':_0xa8784a,'interface':_0x26c7e5,'agentcomplete':!![]}},'log':_0x878d('0x4')});}; \ No newline at end of file +var _0x6a08=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x70800b,_0x18c90c){var _0x8db856=function(_0xc60d3d){while(--_0xc60d3d){_0x70800b['push'](_0x70800b['shift']());}};_0x8db856(++_0x18c90c);}(_0x6a08,0x11f));var _0x86a0=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x6a08[_0x183256];return _0x5394a2;};'use strict';var client=require(_0x86a0('0x0'));exports[_0x86a0('0x1')]=function(_0x16625c){return client[_0x86a0('0x2')](_0x86a0('0x3'),{'body':_0x16625c,'log':_0x86a0('0x3')});};exports[_0x86a0('0x4')]=function(_0x436a56,_0x5568e4,_0xb6d5c2){return client[_0x86a0('0x2')](_0x86a0('0x5'),{'body':_0x436a56,'options':{'where':{'uniqueid':_0x5568e4,'interface':_0xb6d5c2,'agentcomplete':!![]}},'log':_0x86a0('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 17a2562..54e6ffc 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 _0x7e26=['duration','billableseconds','GetVoiceCallReports','lodash','create','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','Request','outbound','startOf','format','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x42b5eb,_0x5da5a1){var _0x3d6235=function(_0x440ade){while(--_0x440ade){_0x42b5eb['push'](_0x42b5eb['shift']());}};_0x3d6235(++_0x5da5a1);}(_0x7e26,0xb7));var _0x67e2=function(_0x2ee0ee,_0x30ec79){_0x2ee0ee=_0x2ee0ee-0x0;var _0x137f6b=_0x7e26[_0x2ee0ee];return _0x137f6b;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x67e2('0x0'));var client=require('../client');exports[_0x67e2('0x1')]=function(_0x540c61){return client['Request'](_0x67e2('0x2'),{'body':_[_0x67e2('0x3')](_0x540c61,{'source':_0x540c61['calleridnum'],'destinationcontext':_0x540c61[_0x67e2('0x4')],'callerid':_0x540c61[_0x67e2('0x5')],'amaflags':_0x67e2('0x6')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x67e2('0x7')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x67e2('0x8')],'createdAt':{'$between':[moment()[_0x67e2('0x9')]('day')[_0x67e2('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x67e2('0xb'))['format'](_0x67e2('0xc'))]}},'attributes':[_0x67e2('0xd'),_0x67e2('0xe'),_0x67e2('0xf'),_0x67e2('0x10')]},'log':_0x67e2('0x11')});};}; \ No newline at end of file +var _0x304b=['day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','moment','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x13e0ef,_0x4045f7){var _0x397a48=function(_0x5ba637){while(--_0x5ba637){_0x13e0ef['push'](_0x13e0ef['shift']());}};_0x397a48(++_0x4045f7);}(_0x304b,0x1d3));var _0xb304=function(_0x1193c8,_0x5c087c){_0x1193c8=_0x1193c8-0x0;var _0xde1172=_0x304b[_0x1193c8];return _0xde1172;};'use strict';var moment=require(_0xb304('0x0'));var util=require('util');var _=require('lodash');var client=require('../client');exports[_0xb304('0x1')]=function(_0x245bde){return client[_0xb304('0x2')](_0xb304('0x3'),{'body':_[_0xb304('0x4')](_0x245bde,{'source':_0x245bde[_0xb304('0x5')],'destinationcontext':_0x245bde[_0xb304('0x6')],'callerid':_0x245bde[_0xb304('0x7')],'amaflags':_0xb304('0x8')}),'log':_0xb304('0x3')});};exports[_0xb304('0x9')]=function(){return function(){return client[_0xb304('0x2')](_0xb304('0xa'),{'options':{'where':{'type':[_0xb304('0xb')],'createdAt':{'$between':[moment()[_0xb304('0xc')](_0xb304('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xb304('0xe')]('day')[_0xb304('0xf')](_0xb304('0x10'))]}},'attributes':[_0xb304('0x11'),'disposition',_0xb304('0x12'),_0xb304('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f307f7d..555ff89 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 _0x2be3=['CreateVoiceDialReport','create','Request'];(function(_0x4da73d,_0x55f91b){var _0x259aaa=function(_0x5045e8){while(--_0x5045e8){_0x4da73d['push'](_0x4da73d['shift']());}};_0x259aaa(++_0x55f91b);}(_0x2be3,0x1db));var _0x32be=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x2be3[_0x2b10c6];return _0x3789d2;};'use strict';var client=require('../client');exports[_0x32be('0x0')]=function(_0x337685){return client[_0x32be('0x1')](_0x32be('0x2'),{'body':_0x337685,'log':_0x32be('0x2')});}; \ No newline at end of file +var _0x77d4=['create','Request','CreateVoiceDialReport','../client'];(function(_0x212499,_0x5da07a){var _0x43aad5=function(_0x2b0811){while(--_0x2b0811){_0x212499['push'](_0x212499['shift']());}};_0x43aad5(++_0x5da07a);}(_0x77d4,0x1d3));var _0x477d=function(_0x35d968,_0x13060f){_0x35d968=_0x35d968-0x0;var _0x4bec61=_0x77d4[_0x35d968];return _0x4bec61;};'use strict';var client=require(_0x477d('0x0'));exports[_0x477d('0x1')]=function(_0x51d3d9){return client[_0x477d('0x2')](_0x477d('0x3'),{'body':_0x51d3d9,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1000a6d..36ff85a 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 _0x7846=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0x7846,0xf4));var _0x6784=function(_0xc298ad,_0xea4dc2){_0xc298ad=_0xc298ad-0x0;var _0x11b2e6=_0x7846[_0xc298ad];return _0x11b2e6;};'use strict';var client=require('../client');exports[_0x6784('0x0')]=function(){return function(){return client[_0x6784('0x1')](_0x6784('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6784('0x3'),_0x6784('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x6784('0x0')});};}; \ No newline at end of file +var _0x6e77=['exten','recordingFormat','getVoiceExtensions'];(function(_0xeec12d,_0xa27c8f){var _0x373324=function(_0x3cdd28){while(--_0x3cdd28){_0xeec12d['push'](_0xeec12d['shift']());}};_0x373324(++_0xa27c8f);}(_0x6e77,0xef));var _0x76e7=function(_0x4b70a2,_0x5d0fbd){_0x4b70a2=_0x4b70a2-0x0;var _0x2170fa=_0x6e77[_0x4b70a2];return _0x2170fa;};'use strict';var client=require('../client');exports[_0x76e7('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x76e7('0x1'),_0x76e7('0x2')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c36dadd..f6a64e9 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 _0xd4f2=['getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','TrunkBackup','active','Interval','Intervals','interval'];(function(_0x581d90,_0x2cd9fc){var _0x1f9cc3=function(_0xfc1608){while(--_0xfc1608){_0x581d90['push'](_0x581d90['shift']());}};_0x1f9cc3(++_0x2cd9fc);}(_0xd4f2,0x132));var _0x2d4f=function(_0x568b3d,_0x15edf8){_0x568b3d=_0x568b3d-0x0;var _0x464612=_0xd4f2[_0x568b3d];return _0x464612;};'use strict';var client=require(_0x2d4f('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x2d4f('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x2d4f('0x2'),_0x2d4f('0x3'),'autopause',_0x2d4f('0x4'),_0x2d4f('0x5'),_0x2d4f('0x6'),_0x2d4f('0x7'),_0x2d4f('0x8'),_0x2d4f('0x9'),'dialPowerLevel',_0x2d4f('0xa'),_0x2d4f('0xb'),_0x2d4f('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x2d4f('0xd'),_0x2d4f('0xe'),_0x2d4f('0xf'),_0x2d4f('0x10'),'dialCongestionMaxRetry',_0x2d4f('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x2d4f('0x12'),_0x2d4f('0x13'),_0x2d4f('0x14'),_0x2d4f('0x15'),'dialGlobalInterval',_0x2d4f('0x16'),_0x2d4f('0x17'),_0x2d4f('0x18'),_0x2d4f('0x19'),'dialAMDGreeting',_0x2d4f('0x1a'),_0x2d4f('0x1b'),_0x2d4f('0x1c'),_0x2d4f('0x1d'),_0x2d4f('0x1e'),_0x2d4f('0x1f'),_0x2d4f('0x20'),_0x2d4f('0x21'),_0x2d4f('0x22'),_0x2d4f('0x23'),_0x2d4f('0x24'),_0x2d4f('0x25'),_0x2d4f('0x26'),_0x2d4f('0x27'),'monitor_format',_0x2d4f('0x28'),_0x2d4f('0x29'),'dialCutDigit',_0x2d4f('0x2a'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x2d4f('0x2b'),_0x2d4f('0x2c'),_0x2d4f('0x2d'),_0x2d4f('0x2e'),_0x2d4f('0x2f'),'dialAgentRejectRetryFrequency',_0x2d4f('0x30'),_0x2d4f('0x31'),'dialPredictiveIntervalMinThreshold',_0x2d4f('0x32'),_0x2d4f('0x33')],'include':[{'model':_0x2d4f('0x34'),'as':_0x2d4f('0x34'),'attributes':['id',_0x2d4f('0x35'),_0x2d4f('0x36'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x2d4f('0x35')]},{'model':_0x2d4f('0x34'),'as':_0x2d4f('0x37'),'attributes':['id',_0x2d4f('0x35'),_0x2d4f('0x36'),_0x2d4f('0x38')]},{'model':_0x2d4f('0x39'),'as':_0x2d4f('0x39'),'attributes':['id',_0x2d4f('0x35')],'include':[{'model':_0x2d4f('0x39'),'as':_0x2d4f('0x3a'),'attributes':['id',_0x2d4f('0x35'),_0x2d4f('0x3b')]}]}]},'log':_0x2d4f('0x3c')});};}; \ No newline at end of file +var _0x80d2=['name','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause'];(function(_0xd1bda6,_0x3dced7){var _0x4387a4=function(_0x3e78d7){while(--_0x3e78d7){_0xd1bda6['push'](_0xd1bda6['shift']());}};_0x4387a4(++_0x3dced7);}(_0x80d2,0x167));var _0x280d=function(_0x21247b,_0x1195fe){_0x21247b=_0x21247b-0x0;var _0x512b26=_0x80d2[_0x21247b];return _0x512b26;};'use strict';var client=require('../client');exports[_0x280d('0x0')]=function(){return function(){return client[_0x280d('0x1')](_0x280d('0x2'),{'options':{'raw':![],'attributes':['id','name','acw',_0x280d('0x3'),_0x280d('0x4'),_0x280d('0x5'),_0x280d('0x6'),_0x280d('0x7'),_0x280d('0x8'),_0x280d('0x9'),'dialLimitQueue',_0x280d('0xa'),_0x280d('0xb'),_0x280d('0xc'),_0x280d('0xd'),_0x280d('0xe'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0x280d('0xf'),_0x280d('0x10'),_0x280d('0x11'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x280d('0x12'),_0x280d('0x13'),_0x280d('0x14'),'dialNoAnswerRetryFrequency',_0x280d('0x15'),_0x280d('0x16'),'dialGlobalInterval',_0x280d('0x17'),'dialCheckDuplicateType',_0x280d('0x18'),_0x280d('0x19'),_0x280d('0x1a'),_0x280d('0x1b'),_0x280d('0x1c'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x280d('0x1d'),_0x280d('0x1e'),_0x280d('0x1f'),_0x280d('0x20'),'dialRecallMeTimeout',_0x280d('0x21'),_0x280d('0x22'),_0x280d('0x23'),'dialAgiAfterHangupClient',_0x280d('0x24'),_0x280d('0x5'),_0x280d('0x25'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x280d('0x26'),'dialNoSuchNumberRetryFrequency',_0x280d('0x27'),_0x280d('0x28'),_0x280d('0x29'),'dialAbandonedRetryFrequency',_0x280d('0x2a'),_0x280d('0x2b'),_0x280d('0x2c'),'dialAgentRejectRetryFrequency',_0x280d('0x2d'),_0x280d('0x2e'),_0x280d('0x2f'),'dialPreviewAutoRecallMe',_0x280d('0x30')],'include':[{'model':_0x280d('0x31'),'as':_0x280d('0x31'),'attributes':['id','name',_0x280d('0x32'),_0x280d('0x33')]},{'model':_0x280d('0x34'),'as':_0x280d('0x35'),'attributes':['id',_0x280d('0x36')]},{'model':_0x280d('0x31'),'as':_0x280d('0x37'),'attributes':['id',_0x280d('0x36'),_0x280d('0x32'),_0x280d('0x33')]},{'model':_0x280d('0x38'),'as':_0x280d('0x38'),'attributes':['id',_0x280d('0x36')],'include':[{'model':_0x280d('0x38'),'as':_0x280d('0x39'),'attributes':['id','name',_0x280d('0x3a')]}]}]},'log':_0x280d('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5627472..e88ae47 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(_0x23640a,_0x1161a5){var _0x1be360=function(_0x3b91bf){while(--_0x3b91bf){_0x23640a['push'](_0x23640a['shift']());}};_0x1be360(++_0x1161a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x1d107a,_0x4d04e0){var _0x32ee92=function(_0x7a4437){while(--_0x7a4437){_0x1d107a['push'](_0x1d107a['shift']());}};_0x32ee92(++_0x4d04e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 ea03ff6..add14b4 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 _0x445e=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x443d10,_0x43a534){var _0x47c7f7=function(_0x4d28c7){while(--_0x4d28c7){_0x443d10['push'](_0x443d10['shift']());}};_0x47c7f7(++_0x43a534);}(_0x445e,0x79));var _0xe445=function(_0x5bae5f,_0x3dee66){_0x5bae5f=_0x5bae5f-0x0;var _0x1742e1=_0x445e[_0x5bae5f];return _0x1742e1;};'use strict';var client=require(_0xe445('0x0'));exports[_0xe445('0x1')]=function(_0x479596){return function(){return client[_0xe445('0x2')](_0xe445('0x3'),{'options':{'where':{'VoiceQueueId':_0x479596,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x7a6e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x4fa5d,_0x5699f0){var _0x352f95=function(_0x5a357b){while(--_0x5a357b){_0x4fa5d['push'](_0x4fa5d['shift']());}};_0x352f95(++_0x5699f0);}(_0x7a6e,0x14b));var _0xe7a6=function(_0x41a7da,_0xe4c8ed){_0x41a7da=_0x41a7da-0x0;var _0x313230=_0x7a6e[_0x41a7da];return _0x313230;};'use strict';var client=require(_0xe7a6('0x0'));exports[_0xe7a6('0x1')]=function(_0x576a11){return function(){return client[_0xe7a6('0x2')](_0xe7a6('0x3'),{'options':{'where':{'VoiceQueueId':_0x576a11,'paused':!![]},'raw':!![]},'log':_0xe7a6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 78339ea..0c79aab 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(_0xdbbacb,_0x33c6c3){var _0x4827c5=function(_0x2497e4){while(--_0x2497e4){_0xdbbacb['push'](_0xdbbacb['shift']());}};_0x4827c5(++_0x33c6c3);}(_0x7a54,0x106));var _0x47a5=function(_0x289127,_0x77e318){_0x289127=_0x289127-0x0;var _0x52309d=_0x7a54[_0x289127];return _0x52309d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x29ab6d,_0x343582){var _0x4433b6=function(_0x14e9b5){while(--_0x14e9b5){_0x29ab6d['push'](_0x29ab6d['shift']());}};_0x4433b6(++_0x343582);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index b0b367c..b4604b7 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 _0xe682=['transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','extension','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransfererexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinename','transfereraccountcode'];(function(_0x30bbf8,_0x21c1b8){var _0x243435=function(_0x42d30f){while(--_0x42d30f){_0x30bbf8['push'](_0x30bbf8['shift']());}};_0x243435(++_0x21c1b8);}(_0xe682,0x1a7));var _0x2e68=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0xe682[_0xf458be];return _0x52b318;};'use strict';var client=require(_0x2e68('0x0'));exports[_0x2e68('0x1')]={};exports[_0x2e68('0x2')]=function(_0x2ad3d4){return client[_0x2e68('0x3')](_0x2e68('0x4'),{'body':{'result':_0x2ad3d4[_0x2e68('0x5')],'transfererchannel':_0x2ad3d4['transfererchannel'],'transferercalleridnum':_0x2ad3d4['transferercalleridnum'],'transferercalleridname':_0x2ad3d4[_0x2e68('0x6')],'transfererconnectedlinenum':_0x2ad3d4['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2ad3d4[_0x2e68('0x7')],'transfereraccountcode':_0x2ad3d4[_0x2e68('0x8')],'transferercontext':_0x2ad3d4[_0x2e68('0x9')],'transfererexten':_0x2ad3d4[_0x2e68('0xa')],'transfererlinkedid':_0x2ad3d4[_0x2e68('0xb')],'transfereechannel':_0x2ad3d4[_0x2e68('0xc')],'transfereecalleridnum':_0x2ad3d4['transfereecalleridnum'],'transfereecalleridname':_0x2ad3d4[_0x2e68('0xd')],'transfereeconnectedlinenum':_0x2ad3d4[_0x2e68('0xe')],'transfereeconnectedlinename':_0x2ad3d4[_0x2e68('0xf')],'transfereeaccountcode':_0x2ad3d4[_0x2e68('0x10')],'transfereecontext':_0x2ad3d4[_0x2e68('0x11')],'transfereeexten':_0x2ad3d4[_0x2e68('0x12')],'transfereelinkedid':_0x2ad3d4['transfereelinkedid'],'isexternal':_0x2ad3d4['isexternal'],'context':_0x2ad3d4['context'],'extension':_0x2ad3d4[_0x2e68('0x13')],'type':'blind'},'log':_0x2e68('0x4')});};exports[_0x2e68('0x14')]=function(_0x4405cc){return client[_0x2e68('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x4405cc[_0x2e68('0x5')],'transfererchannel':_0x4405cc['origtransfererchannel'],'transferercalleridnum':_0x4405cc[_0x2e68('0x15')],'transferercalleridname':_0x4405cc['origtransferercalleridname'],'transfererconnectedlinenum':_0x4405cc[_0x2e68('0x16')],'transfererconnectedlinename':_0x4405cc[_0x2e68('0x17')],'transfereraccountcode':_0x4405cc[_0x2e68('0x18')],'transferercontext':_0x4405cc[_0x2e68('0x19')],'transfererexten':_0x4405cc[_0x2e68('0x1a')],'transfererlinkedid':_0x4405cc[_0x2e68('0x1b')],'transfereechannel':_0x4405cc['transfertargetchannel'],'transfereecalleridnum':_0x4405cc['transfertargetcalleridnum'],'transfereecalleridname':_0x4405cc[_0x2e68('0x1c')],'transfereeconnectedlinenum':_0x4405cc[_0x2e68('0x1d')],'transfereeconnectedlinename':_0x4405cc[_0x2e68('0x1e')],'transfereeaccountcode':_0x4405cc[_0x2e68('0x1f')],'transfereecontext':_0x4405cc[_0x2e68('0x20')],'transfereeexten':_0x4405cc['transfertargetexten'],'transfereelinkedid':_0x4405cc[_0x2e68('0x21')],'isexternal':_0x4405cc[_0x2e68('0x22')],'context':_0x4405cc['origtransferercontext'],'extension':_0x4405cc[_0x2e68('0x23')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x539a=['origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereecontext','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid'];(function(_0x5b408f,_0x5b8a82){var _0x11f530=function(_0x3b19da){while(--_0x3b19da){_0x5b408f['push'](_0x5b408f['shift']());}};_0x11f530(++_0x5b8a82);}(_0x539a,0xff));var _0xa539=function(_0x5862b3,_0x14b46d){_0x5862b3=_0x5862b3-0x0;var _0x1ed85b=_0x539a[_0x5862b3];return _0x1ed85b;};'use strict';var client=require('../client');exports[_0xa539('0x0')]={};exports[_0xa539('0x1')]=function(_0x142b46){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x142b46['result'],'transfererchannel':_0x142b46[_0xa539('0x2')],'transferercalleridnum':_0x142b46[_0xa539('0x3')],'transferercalleridname':_0x142b46[_0xa539('0x4')],'transfererconnectedlinenum':_0x142b46['transfererconnectedlinenum'],'transfererconnectedlinename':_0x142b46[_0xa539('0x5')],'transfereraccountcode':_0x142b46[_0xa539('0x6')],'transferercontext':_0x142b46['transferercontext'],'transfererexten':_0x142b46[_0xa539('0x7')],'transfererlinkedid':_0x142b46[_0xa539('0x8')],'transfereechannel':_0x142b46['transfereechannel'],'transfereecalleridnum':_0x142b46[_0xa539('0x9')],'transfereecalleridname':_0x142b46[_0xa539('0xa')],'transfereeconnectedlinenum':_0x142b46['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x142b46['transfereeconnectedlinename'],'transfereeaccountcode':_0x142b46['transfereeaccountcode'],'transfereecontext':_0x142b46[_0xa539('0xb')],'transfereeexten':_0x142b46['transfereeexten'],'transfereelinkedid':_0x142b46[_0xa539('0xc')],'isexternal':_0x142b46[_0xa539('0xd')],'context':_0x142b46['context'],'extension':_0x142b46[_0xa539('0xe')],'type':_0xa539('0xf')},'log':_0xa539('0x10')});};exports[_0xa539('0x11')]=function(_0x9c9422){return client[_0xa539('0x12')](_0xa539('0x10'),{'body':{'result':_0x9c9422[_0xa539('0x13')],'transfererchannel':_0x9c9422[_0xa539('0x14')],'transferercalleridnum':_0x9c9422[_0xa539('0x15')],'transferercalleridname':_0x9c9422['origtransferercalleridname'],'transfererconnectedlinenum':_0x9c9422[_0xa539('0x16')],'transfererconnectedlinename':_0x9c9422[_0xa539('0x17')],'transfereraccountcode':_0x9c9422[_0xa539('0x18')],'transferercontext':_0x9c9422[_0xa539('0x19')],'transfererexten':_0x9c9422['secondtransfererexten'],'transfererlinkedid':_0x9c9422['origtransfererlinkedid'],'transfereechannel':_0x9c9422[_0xa539('0x1a')],'transfereecalleridnum':_0x9c9422[_0xa539('0x1b')],'transfereecalleridname':_0x9c9422[_0xa539('0x1c')],'transfereeconnectedlinenum':_0x9c9422['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x9c9422[_0xa539('0x1d')],'transfereeaccountcode':_0x9c9422[_0xa539('0x1e')],'transfereecontext':_0x9c9422['transfertargetcontext'],'transfereeexten':_0x9c9422[_0xa539('0x1f')],'transfereelinkedid':_0x9c9422[_0xa539('0x20')],'isexternal':_0x9c9422[_0xa539('0xd')],'context':_0x9c9422[_0xa539('0x21')],'extension':_0x9c9422[_0xa539('0x22')],'type':_0xa539('0x23')},'log':_0xa539('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 70dc6c0..2d15845 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 _0x8f9d=['run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','then','catch','command','Command','Action','content','message','voiceQueues','hasOwnProperty','name','strategy','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','validate','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','StopMixMonitor','destinationchannel','/var/spool/asterisk/monitor/','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','campaigns'];(function(_0x22e1f6,_0x19a9f6){var _0x5bff2d=function(_0x37ef0e){while(--_0x37ef0e){_0x22e1f6['push'](_0x22e1f6['shift']());}};_0x5bff2d(++_0x19a9f6);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var jayson=require(_0xd8f9('0x1'));var schema=require('validate');var BPromise=require(_0xd8f9('0x2'));var moment=require(_0xd8f9('0x3'));var config=require(_0xd8f9('0x4'));var properties=require(_0xd8f9('0x5'));var ami=require(_0xd8f9('0x6'));exports[_0xd8f9('0x7')]=function(_0x1d6420,_0x5941ce,_0x1c37be){return new BPromise(function(_0x24dd1e,_0x25d417){var _0x241aaa={'QueuePause':function(_0xf6105){return new Promise(function(_0x5c410f,_0x46babd){var _0x6691e=util['format'](_0xd8f9('0x8'),'SIP',_0xf6105['name']);if(_0x1d6420[_0xd8f9('0x9')]&&_0x1d6420[_0xd8f9('0x9')][_0x6691e]&&_0x1d6420[_0xd8f9('0x9')][_0x6691e][_0xd8f9('0xa')]){_0x1d6420[_0xd8f9('0x9')][_0x6691e][_0xd8f9('0xb')]();}if(_0x1d6420[_0xd8f9('0xc')][_0x6691e]){_0x1d6420['agents'][_0x6691e][_0xd8f9('0xd')]({'statePause':_0xf6105['pause']?!![]:![]});}_0x5c410f({'code':0xc8,'message':_0xd8f9('0xe')});});},'Reload':function(_0x45aba0){var _0x11c122=this;return new Promise(function(_0x5b01ce,_0x46468b){if(ami[_0xd8f9('0xf')]()==![]){return _0x46468b(_0x11c122[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config['asterisk'][_0xd8f9('0x12')],_0xd8f9('0x13')][_0xd8f9('0x14')]('\x20')));}_0x45aba0=_[_0xd8f9('0x15')](_0x45aba0,_[_0xd8f9('0x16')](properties[_0xd8f9('0x17')]));_0x45aba0[_0xd8f9('0x18')]='Reload';return ami['Action'](_0x45aba0)[_0xd8f9('0x19')](function(_0xc6a825){_0x5b01ce({'code':0xc8,'message':_0xc6a825['message']});})[_0xd8f9('0x1a')](function(_0x47bdea){_0x46468b(_0x11c122[_0xd8f9('0x10')](0x1f5,_0x47bdea['message']));});});},'Command':function(_0x4cf93a){var _0x58956e=this;return new Promise(function(_0xa3b0cd,_0x5d094d){if(ami[_0xd8f9('0xf')]()==![]){return _0x5d094d(_0x58956e[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config[_0xd8f9('0x11')][_0xd8f9('0x12')],_0xd8f9('0x13')]['join']('\x20')));}_0x4cf93a=_[_0xd8f9('0x15')](_0x4cf93a,_0xd8f9('0x1b'));_0x4cf93a[_0xd8f9('0x18')]=_0xd8f9('0x1c');return ami[_0xd8f9('0x1d')](_0x4cf93a)[_0xd8f9('0x19')](function(_0x4c5808){_0xa3b0cd({'code':0xc8,'message':_0x4c5808[_0xd8f9('0x1e')]});})[_0xd8f9('0x1a')](function(_0x1fcd45){_0x5d094d(_0x58956e[_0xd8f9('0x10')](0x1f5,_0x1fcd45[_0xd8f9('0x1f')]));});});},'VoiceQueues':function(_0x4c0002){return new Promise(function(_0xcc9b18,_0x1d6796){var _0x28854a=[];for(var _0xd15475 in _0x1d6420[_0xd8f9('0x20')]){if(_0x1d6420[_0xd8f9('0x20')][_0xd8f9('0x21')](_0xd15475)){var _0x461880=_0x1d6420['voiceQueues'][_0xd15475];var _0x464a6a={'id':_0x461880['id'],'name':_0x461880[_0xd8f9('0x22')],'strategy':_0x461880[_0xd8f9('0x23')],'answered':_0x461880['answered'],'available':_0x461880['available'],'loggedIn':_0x461880['loggedIn'],'pTalking':_0x461880[_0xd8f9('0x24')],'sumBillable':_0x461880[_0xd8f9('0x25')],'sumDuration':_0x461880['sumDuration'],'sumHoldTime':_0x461880[_0xd8f9('0x26')]||0x0,'talking':_0x461880[_0xd8f9('0x27')],'total':_0x461880['total'],'type':_0x461880[_0xd8f9('0x28')],'unmanaged':_0x461880[_0xd8f9('0x29')],'abandoned':_0x461880[_0xd8f9('0x2a')],'waiting':_0x461880['waiting'],'loggedInDb':_0x461880[_0xd8f9('0x2b')]};if(_0x461880['type']===_0xd8f9('0x2c')){_0x464a6a[_0xd8f9('0x2d')]=_0x461880['dialActive'];_0x464a6a[_0xd8f9('0x2e')]=_0x461880['dialMethod'];_0x464a6a[_0xd8f9('0x2f')]=_0x461880[_0xd8f9('0x2f')];_0x464a6a[_0xd8f9('0x30')]=_0x461880[_0xd8f9('0x30')];_0x464a6a[_0xd8f9('0x31')]=_0x461880[_0xd8f9('0x31')];_0x464a6a[_0xd8f9('0x32')]=_0x461880['dialPrefix'];_0x464a6a[_0xd8f9('0x33')]=_0x461880['temp'];_0x464a6a['outboundAnswerAgiCallsDay']=_0x461880['outboundAnswerAgiCallsDay'];_0x464a6a['outboundAnswerCallsDay']=_0x461880[_0xd8f9('0x34')];_0x464a6a[_0xd8f9('0x35')]=_0x461880[_0xd8f9('0x35')];_0x464a6a[_0xd8f9('0x36')]=_0x461880[_0xd8f9('0x36')];_0x464a6a['outboundCongestionCallsDay']=_0x461880['outboundCongestionCallsDay'];_0x464a6a[_0xd8f9('0x37')]=_0x461880[_0xd8f9('0x37')];_0x464a6a['outboundDropCallsDayCallersExit']=_0x461880[_0xd8f9('0x38')];_0x464a6a[_0xd8f9('0x39')]=_0x461880[_0xd8f9('0x39')];_0x464a6a['outboundNoAnswerCallsDay']=_0x461880['outboundNoAnswerCallsDay'];_0x464a6a['outboundNoSuchCallsDay']=_0x461880['outboundNoSuchCallsDay'];_0x464a6a[_0xd8f9('0x3a')]=_0x461880[_0xd8f9('0x3a')];_0x464a6a[_0xd8f9('0x3b')]=_0x461880[_0xd8f9('0x3b')];_0x464a6a[_0xd8f9('0x3c')]=_0x461880['outboundRejectCallsDay'];_0x464a6a[_0xd8f9('0x3d')]=_0x461880[_0xd8f9('0x3d')];_0x464a6a[_0xd8f9('0x3e')]=_0x461880[_0xd8f9('0x3e')];_0x464a6a[_0xd8f9('0x3f')]=_0x461880[_0xd8f9('0x3f')];_0x464a6a[_0xd8f9('0x40')]=_0x461880[_0xd8f9('0x40')];_0x464a6a[_0xd8f9('0x41')]=_0x461880[_0xd8f9('0x41')];_0x464a6a[_0xd8f9('0x42')]=_0x461880['predictiveIntervalDroppedCallsTimeout'];_0x464a6a[_0xd8f9('0x43')]=_0x461880[_0xd8f9('0x43')];_0x464a6a[_0xd8f9('0x44')]=_0x461880[_0xd8f9('0x44')];_0x464a6a['predictiveIntervalHitRate']=_0x461880[_0xd8f9('0x45')];_0x464a6a[_0xd8f9('0x46')]=_0x461880[_0xd8f9('0x46')];_0x464a6a[_0xd8f9('0x47')]=_0x461880[_0xd8f9('0x47')];_0x464a6a[_0xd8f9('0x48')]=_0x461880['predictiveIntervalAvailable'];_0x464a6a['predictiveIntervalTotalCalls']=_0x461880['predictiveIntervalTotalCalls'];_0x464a6a[_0xd8f9('0x1f')]=_0x461880[_0xd8f9('0x1f')];_0x464a6a[_0xd8f9('0x49')]=_0x461880[_0xd8f9('0x49')];_0x464a6a[_0xd8f9('0x4a')]=_0x461880[_0xd8f9('0x4a')];_0x464a6a[_0xd8f9('0x4b')]=_0x461880[_0xd8f9('0x4b')];_0x464a6a[_0xd8f9('0x4c')]=_0x461880['erlangAbandonmentRate'];_0x464a6a['erlangBusyFactor']=_0x461880[_0xd8f9('0x4d')];_0x464a6a[_0xd8f9('0x4e')]=_0x461880[_0xd8f9('0x4e')];_0x464a6a['startProgressive']=_0x461880['startProgressive'];}if(_0x461880[_0xd8f9('0x4f')]){_0x464a6a[_0xd8f9('0x4f')]={'id':_0x461880[_0xd8f9('0x4f')]['id'],'name':_0x461880['Trunk'][_0xd8f9('0x22')],'active':_0x461880[_0xd8f9('0x4f')][_0xd8f9('0x50')],'callerid':_0x461880[_0xd8f9('0x4f')][_0xd8f9('0x51')]};}if(_0x461880[_0xd8f9('0x52')]){_0x464a6a[_0xd8f9('0x52')]={'id':_0x461880[_0xd8f9('0x52')]['id'],'name':_0x461880[_0xd8f9('0x52')]['name']};}_0x28854a['push'](_0x464a6a);}}_0xcc9b18({'count':_0x28854a['length'],'rows':_0x28854a});});},'UpdateVoiceQueue':function(_0x1ba90a){return new Promise(function(_0x2c8f19,_0x2c2396){var _0x256e8a=_[_0xd8f9('0x53')](_0x1d6420[_0xd8f9('0x20')],{'id':parseInt(_0x1ba90a['id'])});var _0x1b1782=_[_0xd8f9('0x54')](_0x1ba90a,['id']);if(_0x256e8a){for(var _0x26527c in _0x1b1782){if(typeof _0x1b1782[_0x26527c]!==_0xd8f9('0x55')&&typeof _0x256e8a[_0x26527c]!==_0xd8f9('0x55')){_0x256e8a[_0x26527c]=_0x1b1782[_0x26527c];}}_0x2c8f19(_0x256e8a);}else{_0x2c2396();}});},'VoiceChannels':function(_0xd5bb17){return new Promise(function(_0x35efdc,_0x4b7802){var _0x395f6b=_[_0xd8f9('0x56')](_0x1d6420[_0xd8f9('0x57')]);_0x35efdc({'count':_0x395f6b[_0xd8f9('0x58')],'rows':_0x395f6b});});},'VoiceChannelMixMonitor':function(_0x4e8c1a){var _0x243d47=this;return new Promise(function(_0x58c389,_0x59952e){if(ami[_0xd8f9('0xf')]()==![]){return _0x59952e(_0x243d47[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config[_0xd8f9('0x11')][_0xd8f9('0x12')],_0xd8f9('0x13')][_0xd8f9('0x14')]('\x20')));}var _0xaad657=schema(properties[_0xd8f9('0x59')])[_0xd8f9('0x5a')](_0x4e8c1a);if(_0xaad657['length']>0x0){return _0x59952e(_0x243d47['error'](0x1f4,_['map'](_0xaad657,_0xd8f9('0x1f'))[_0xd8f9('0x14')](',\x20')));}var _0x4965d0=_[_0xd8f9('0x53')](_0x1d6420[_0xd8f9('0x57')],{'uniqueid':_0x4e8c1a[_0xd8f9('0x5b')]});if(_0x4965d0&&_0x4965d0[_0xd8f9('0x5c')]){var _0x282d9e=util[_0xd8f9('0x5d')](_0xd8f9('0x5e'),_0x4e8c1a[_0xd8f9('0x5f')]||_0x4e8c1a['uniqueid'],_0x4e8c1a[_0xd8f9('0x5d')]||_0xd8f9('0x60'));return ami[_0xd8f9('0x1d')]({'action':_0xd8f9('0x61'),'channel':_0x4965d0[_0xd8f9('0x5c')],'file':_0x282d9e,'options':_0xd8f9('0x62')})[_0xd8f9('0x19')](function(_0x16a2bb){var _0x6aeadb=_[_0xd8f9('0x53')](_0x4965d0[_0xd8f9('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x282d9e[_0xd8f9('0x64')]()});if(_[_0xd8f9('0x65')](_0x6aeadb)){_0x4965d0[_0xd8f9('0x63')][_0xd8f9('0x66')]({'filename':'/var/spool/asterisk/monitor/'+_0x282d9e[_0xd8f9('0x64')](),'createdAt':moment()[_0xd8f9('0x5d')](_0xd8f9('0x67')),'mixmonitorid':_0x16a2bb['mixmonitorid'],'status':_0xd8f9('0x68')});}else{_0x6aeadb[_0xd8f9('0x69')]=_0x16a2bb[_0xd8f9('0x69')];_0x6aeadb[_0xd8f9('0x6a')]='rec';}_0x58c389({'code':0xc8,'message':[_0x4e8c1a[_0xd8f9('0x5b')],_0xd8f9('0x6b'),_0x16a2bb['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x16a2bb[_0xd8f9('0x69')]});})[_0xd8f9('0x1a')](function(_0x2b927d){_0x59952e(_0x243d47['error'](0x1f5,[_0x4e8c1a[_0xd8f9('0x5b')],_0x2b927d['message'][_0xd8f9('0x64')]()]['join']('\x20')));});}else{return _0x59952e(_0x243d47[_0xd8f9('0x10')](0x1f5,_0xd8f9('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0xb61f6c){var _0x1783ae=this;return new Promise(function(_0x5d3dec,_0x30748c){if(ami[_0xd8f9('0xf')]()==![]){return _0x30748c(_0x1783ae[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config[_0xd8f9('0x11')][_0xd8f9('0x12')],_0xd8f9('0x13')][_0xd8f9('0x14')]('\x20')));}var _0x58f898=schema(properties[_0xd8f9('0x59')])[_0xd8f9('0x5a')](_0xb61f6c);if(_0x58f898[_0xd8f9('0x58')]>0x0){return _0x30748c(_0x1783ae[_0xd8f9('0x10')](0x1f4,_[_0xd8f9('0x6d')](_0x58f898,'message')['join'](',\x20')));}var _0x4f542b=_[_0xd8f9('0x53')](_0x1d6420[_0xd8f9('0x57')],{'uniqueid':_0xb61f6c['uniqueid']});if(_0x4f542b){return BPromise['resolve']()[_0xd8f9('0x19')](function(){if(_0x4f542b[_0xd8f9('0x5c')]){return ami[_0xd8f9('0x1d')]({'action':_0xd8f9('0x6e'),'channel':_0x4f542b[_0xd8f9('0x5c')],'mixmonitorid':_0xb61f6c[_0xd8f9('0x69')]})['catch'](function(_0x2855a1){});}})[_0xd8f9('0x19')](function(){if(_0x4f542b[_0xd8f9('0x6f')]){return ami[_0xd8f9('0x1d')]({'action':'StopMixMonitor','channel':_0x4f542b[_0xd8f9('0x6f')],'mixmonitorid':_0xb61f6c[_0xd8f9('0x69')]})[_0xd8f9('0x1a')](function(_0x3e65b8){});}})[_0xd8f9('0x19')](function(_0x156c68){var _0x137c60=_[_0xd8f9('0x53')](_0x4f542b[_0xd8f9('0x63')],{'mixmonitorid':_0xb61f6c['mixmonitorid']});if(_0x137c60){_0x137c60['status']='stop';}})[_0xd8f9('0x19')](function(){var _0x100eec=util[_0xd8f9('0x5d')](_0xd8f9('0x5e'),_0xb61f6c[_0xd8f9('0x5f')]||_0xb61f6c[_0xd8f9('0x5b')],_0xb61f6c[_0xd8f9('0x5d')]||_0xd8f9('0x60'));var _0x5865ec=_[_0xd8f9('0x53')](_0x4f542b['monitors'],{'filename':_0xd8f9('0x70')+_0x100eec[_0xd8f9('0x64')]()});if(_0x5865ec){_0x5865ec[_0xd8f9('0x6a')]=_0xd8f9('0x71');}})[_0xd8f9('0x19')](function(){_0x5d3dec({'code':0xc8,'message':[_0xb61f6c[_0xd8f9('0x5b')],_0xd8f9('0x72')][_0xd8f9('0x14')]('\x20')});})['catch'](function(_0x18bdcf){_0x30748c(_0x1783ae['error'](0x1f5,[_0xb61f6c[_0xd8f9('0x5b')],_0x18bdcf['message']['toLowerCase']()][_0xd8f9('0x14')]('\x20')));});}else{return _0x30748c(_0x1783ae['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x471e83){return new Promise(function(_0x43294b,_0x301fc6){var _0x3c555a=_[_0xd8f9('0x56')](_0x1d6420['queueChannels']);_0x43294b({'count':_0x3c555a[_0xd8f9('0x58')],'rows':_0x3c555a});});},'VoiceQueuesChannel':function(_0x44e31f){var _0x58e951=this;return new Promise(function(_0xbd80a9,_0x1ca6a9){var _0x2230af=schema(properties[_0xd8f9('0x73')])['validate'](_0x44e31f);if(_0x2230af[_0xd8f9('0x58')]>0x0){return _0x1ca6a9(_0x58e951['error'](0x1f4,_[_0xd8f9('0x6d')](_0x2230af,_0xd8f9('0x1f'))[_0xd8f9('0x14')](',\x20')));}var _0x2544ae=_[_0xd8f9('0x53')](_0x1d6420[_0xd8f9('0x74')],{'uniqueid':_0x44e31f[_0xd8f9('0x5b')]});if(_0x2544ae){_0xbd80a9(_0x2544ae);}else{return _0x1ca6a9(_0x58e951[_0xd8f9('0x10')](0x1f5,_0xd8f9('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x17a9ab){var _0x26a6ee=this;return new Promise(function(_0x1191b0,_0x1e67d1){if(ami[_0xd8f9('0xf')]()==![]){return _0x1e67d1(_0x26a6ee[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config[_0xd8f9('0x11')][_0xd8f9('0x12')],'ami\x20disconnected'][_0xd8f9('0x14')]('\x20')));}var _0x3206f7=schema(properties['voicequeuechannelhangup'])[_0xd8f9('0x5a')](_0x17a9ab);if(_0x3206f7[_0xd8f9('0x58')]>0x0){return _0x1e67d1(_0x26a6ee[_0xd8f9('0x10')](0x1f4,_[_0xd8f9('0x6d')](_0x3206f7,_0xd8f9('0x1f'))['join'](',\x20')));}var _0x3e3244=_['find'](_0x1d6420[_0xd8f9('0x74')],{'uniqueid':_0x17a9ab['uniqueid']});if(_0x3e3244&&_0x3e3244[_0xd8f9('0x5c')]){return ami[_0xd8f9('0x1d')]({'action':'Hangup','channel':_0x3e3244[_0xd8f9('0x5c')]})['then'](function(_0x498f63){_0x1191b0({'code':0xc8,'message':[_0x17a9ab[_0xd8f9('0x5b')],_0x498f63['message']['toLowerCase']()][_0xd8f9('0x14')]('\x20')});})['catch'](function(_0xebea11){_0x1e67d1(_0x26a6ee['error'](0x1f5,[_0x17a9ab[_0xd8f9('0x5b')],_0xebea11[_0xd8f9('0x1f')]['toLowerCase']()][_0xd8f9('0x14')]('\x20')));});}else{return _0x1e67d1(_0x26a6ee[_0xd8f9('0x10')](0x1f5,_0xd8f9('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x95808d){var _0x531583=this;return new Promise(function(_0x2af37c,_0x2e96b6){if(ami[_0xd8f9('0xf')]()==![]){return _0x2e96b6(_0x531583[_0xd8f9('0x10')](0x1f4,[config[_0xd8f9('0x11')]['ip'],config[_0xd8f9('0x11')][_0xd8f9('0x12')],_0xd8f9('0x13')]['join']('\x20')));}var _0xb23727=schema(properties[_0xd8f9('0x75')])['validate'](_0x95808d);if(_0xb23727['length']>0x0){return _0x2e96b6(_0x531583['error'](0x1f4,_[_0xd8f9('0x6d')](_0xb23727,_0xd8f9('0x1f'))[_0xd8f9('0x14')](',\x20')));}var _0xe8ca0b=_[_0xd8f9('0x53')](_0x1d6420['queueChannels'],{'uniqueid':_0x95808d[_0xd8f9('0x5b')]});if(_0xe8ca0b&&_0xe8ca0b[_0xd8f9('0x5c')]){return ami[_0xd8f9('0x1d')]({'action':_0xd8f9('0x76'),'channel':_0xe8ca0b[_0xd8f9('0x5c')],'exten':_0x95808d['exten'],'context':_0x95808d[_0xd8f9('0x77')]||_0xe8ca0b['context'],'priority':0x1})[_0xd8f9('0x19')](function(_0x48989f){_0x2af37c({'code':0xc8,'message':[_0x95808d[_0xd8f9('0x5b')],_0x48989f['message'][_0xd8f9('0x64')]()][_0xd8f9('0x14')]('\x20')});})[_0xd8f9('0x1a')](function(_0x5540bf){_0x2e96b6(_0x531583[_0xd8f9('0x10')](0x1f5,[_0x95808d['uniqueid'],_0x5540bf[_0xd8f9('0x1f')][_0xd8f9('0x64')]()][_0xd8f9('0x14')]('\x20')));});}else{return _0x2e96b6(_0x531583[_0xd8f9('0x10')](0x1f5,_0xd8f9('0x6c')));}});},'Agents':function(_0x332226){return new Promise(function(_0x5abbba,_0x389823){var _0x21fd12=_[_0xd8f9('0x56')](_0x1d6420[_0xd8f9('0xc')]);_0x5abbba({'count':_0x21fd12[_0xd8f9('0x58')],'rows':_0x21fd12});});},'Telephones':function(_0x2407dc){return new Promise(function(_0x3feace,_0x54bf5f){var _0x161e91=_['values'](_0x1d6420[_0xd8f9('0x78')]);_0x3feace({'count':_0x161e91[_0xd8f9('0x58')],'rows':_0x161e91});});},'Trunks':function(_0x41f5fb){return new Promise(function(_0x4aa552,_0x488674){var _0x430c13=_[_0xd8f9('0x56')](_0x1d6420['trunks']);_0x4aa552({'count':_0x430c13['length'],'rows':_0x430c13});});},'OutboundChannels':function(_0x39bc1a){return new Promise(function(_0x4216a6,_0xe38b7){var _0x3d6103=_[_0xd8f9('0x56')](_0x1d6420[_0xd8f9('0x79')]);_0x4216a6({'count':_0x3d6103['length'],'rows':_0x3d6103});});},'Outbound':function(_0x18b73d){return new Promise(function(_0x5a5917,_0x1270c1){_0x5a5917(_0x1d6420[_0xd8f9('0x2c')]);});},'Campaigns':function(_0x460620){return new Promise(function(_0x5b55ca,_0x971f2b){var _0x47aed5=_[_0xd8f9('0x56')](_0x1d6420[_0xd8f9('0x7a')]);_0x5b55ca({'count':_0x47aed5[_0xd8f9('0x58')],'rows':_0x47aed5});});},'VoiceQueuesPreview':function(_0x5cf201){var _0x2171c5=this;return new Promise(function(_0x1dc40c,_0x29ef71){_0x5941ce[_0xd8f9('0x7b')](_0x5cf201['id'])[_0xd8f9('0x19')](function(_0x25f1a7){_0x1dc40c({'code':0xc8,'message':_0x25f1a7[_0xd8f9('0x1f')]});})[_0xd8f9('0x1a')](function(_0x29f57c){_0x29ef71(_0x2171c5[_0xd8f9('0x10')](0x1f4,_0x29f57c['message']));});});},'EventManager':function(_0x2b2bfc){var _0x18737b=this;return new Promise(function(_0x4d24a0,_0x203f2c){if(!_0x2b2bfc['event']){return _0x203f2c(_0x18737b[_0xd8f9('0x10')](0x1f4,_0xd8f9('0x7c')));}ami[_0xd8f9('0x7d')](_0xd8f9('0x7e')+_0x2b2bfc[_0xd8f9('0x7f')],_0x2b2bfc['message']);_0x4d24a0({'code':0xc8,'message':_0x2b2bfc});});},'FaxAccounts':function(_0x1b81c7){return new Promise(function(_0x2d59d4,_0x2f402a){var _0x198897=_[_0xd8f9('0x56')](_0x1d6420[_0xd8f9('0x80')]);_0x2d59d4({'count':_0x198897[_0xd8f9('0x58')],'rows':_0x198897});});},'SendFax':function(_0xfd1c36){var _0xf61375=this;return new Promise(function(_0x410c33,_0x1b0bea){_0x1c37be[_0xd8f9('0x81')](_0xfd1c36)[_0xd8f9('0x19')](function(_0x1f20a7){_0x410c33({'code':0xc8,'message':_0x1f20a7[_0xd8f9('0x1f')]});})[_0xd8f9('0x1a')](function(_0x1b4565){_0x1b0bea(_0xf61375[_0xd8f9('0x10')](0x1f4,_0x1b4565['message']));});});},'CheckAfterSend':function(_0x16ce7e){var _0xf52351=this;return new Promise(function(_0xb2e002,_0x15c633){_0x1c37be[_0xd8f9('0x82')](_0x16ce7e)[_0xd8f9('0x19')](function(_0xec7fcc){_0xb2e002({'code':0xc8,'message':_0xec7fcc['message']});})['catch'](function(_0x100296){_0x15c633(_0xf52351['error'](0x1f4,_0x100296['message']));});});}};var _0x3ed6ad=jayson['server'](_0x241aaa)[_0xd8f9('0x83')]();_0x3ed6ad['on'](_0xd8f9('0x10'),function(_0x3859c7){return _0x25d417(_0x3859c7);});_0x3ed6ad[_0xd8f9('0x7')](0x232a,_0xd8f9('0x84'),function(){console[_0xd8f9('0x85')](_0xd8f9('0x86'),0x232a);return _0x24dd1e('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xaa37=['values','username','voicechannel','map','channel','%s.%s','filename','uniqueid','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','Reload','then','catch','message','command','action','Action','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','undefined'];(function(_0x246552,_0x5758fb){var _0x267df0=function(_0x4487a2){while(--_0x4487a2){_0x246552['push'](_0x246552['shift']());}};_0x267df0(++_0x5758fb);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xaa37[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var jayson=require(_0x7aa3('0x2'));var schema=require(_0x7aa3('0x3'));var BPromise=require('bluebird');var moment=require(_0x7aa3('0x4'));var config=require(_0x7aa3('0x5'));var properties=require(_0x7aa3('0x6'));var ami=require(_0x7aa3('0x7'));exports[_0x7aa3('0x8')]=function(_0x2801a2,_0x2679bb,_0x5b738a){return new BPromise(function(_0x437b90,_0xbbcc8a){var _0x5d1627={'QueuePause':function(_0x100894){return new Promise(function(_0x390c82,_0x394097){var _0x4f43f1=util[_0x7aa3('0x9')](_0x7aa3('0xa'),_0x7aa3('0xb'),_0x100894[_0x7aa3('0xc')]);if(_0x2801a2[_0x7aa3('0xd')]&&_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]&&_0x2801a2['timers'][_0x4f43f1]['timer']){_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]['updateAcw']();}if(_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]){_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]['updateStatusRealtime']({'statePause':_0x100894[_0x7aa3('0xf')]?!![]:![]});}_0x390c82({'code':0xc8,'message':_0x7aa3('0x10')});});},'Reload':function(_0x552ec9){var _0x5a6751=this;return new Promise(function(_0x4b844b,_0x1a7474){if(ami[_0x7aa3('0x11')]()==![]){return _0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x552ec9=_[_0x7aa3('0x16')](_0x552ec9,_[_0x7aa3('0x17')](properties['module']));_0x552ec9['action']=_0x7aa3('0x18');return ami['Action'](_0x552ec9)[_0x7aa3('0x19')](function(_0x3f9a75){_0x4b844b({'code':0xc8,'message':_0x3f9a75['message']});})[_0x7aa3('0x1a')](function(_0xe5e683){_0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f5,_0xe5e683[_0x7aa3('0x1b')]));});});},'Command':function(_0x12fdd3){var _0x5994b6=this;return new Promise(function(_0x22e93b,_0x266529){if(ami[_0x7aa3('0x11')]()==![]){return _0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x12fdd3=_[_0x7aa3('0x16')](_0x12fdd3,_0x7aa3('0x1c'));_0x12fdd3[_0x7aa3('0x1d')]='Command';return ami[_0x7aa3('0x1e')](_0x12fdd3)[_0x7aa3('0x19')](function(_0x2a6773){_0x22e93b({'code':0xc8,'message':_0x2a6773[_0x7aa3('0x1f')]});})[_0x7aa3('0x1a')](function(_0x10887d){_0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f5,_0x10887d[_0x7aa3('0x1b')]));});});},'VoiceQueues':function(_0x1d5271){return new Promise(function(_0x23f168,_0x44377a){var _0x1c5fef=[];for(var _0x1f1d82 in _0x2801a2['voiceQueues']){if(_0x2801a2[_0x7aa3('0x20')][_0x7aa3('0x21')](_0x1f1d82)){var _0x3c1422=_0x2801a2[_0x7aa3('0x20')][_0x1f1d82];var _0x183ffc={'id':_0x3c1422['id'],'name':_0x3c1422[_0x7aa3('0xc')],'strategy':_0x3c1422['strategy'],'answered':_0x3c1422[_0x7aa3('0x22')],'available':_0x3c1422[_0x7aa3('0x23')],'loggedIn':_0x3c1422[_0x7aa3('0x24')],'pTalking':_0x3c1422['pTalking'],'sumBillable':_0x3c1422[_0x7aa3('0x25')],'sumDuration':_0x3c1422[_0x7aa3('0x26')],'sumHoldTime':_0x3c1422['sumHoldTime']||0x0,'talking':_0x3c1422[_0x7aa3('0x27')],'total':_0x3c1422[_0x7aa3('0x28')],'type':_0x3c1422[_0x7aa3('0x29')],'unmanaged':_0x3c1422[_0x7aa3('0x2a')],'abandoned':_0x3c1422[_0x7aa3('0x2b')],'waiting':_0x3c1422[_0x7aa3('0x2c')],'loggedInDb':_0x3c1422[_0x7aa3('0x2d')]};if(_0x3c1422[_0x7aa3('0x29')]===_0x7aa3('0x2e')){_0x183ffc[_0x7aa3('0x2f')]=_0x3c1422[_0x7aa3('0x2f')];_0x183ffc[_0x7aa3('0x30')]=_0x3c1422[_0x7aa3('0x30')];_0x183ffc[_0x7aa3('0x31')]=_0x3c1422[_0x7aa3('0x31')];_0x183ffc[_0x7aa3('0x32')]=_0x3c1422[_0x7aa3('0x32')];_0x183ffc[_0x7aa3('0x33')]=_0x3c1422[_0x7aa3('0x33')];_0x183ffc[_0x7aa3('0x34')]=_0x3c1422[_0x7aa3('0x34')];_0x183ffc['temp']=_0x3c1422[_0x7aa3('0x35')];_0x183ffc[_0x7aa3('0x36')]=_0x3c1422[_0x7aa3('0x36')];_0x183ffc[_0x7aa3('0x37')]=_0x3c1422[_0x7aa3('0x37')];_0x183ffc[_0x7aa3('0x38')]=_0x3c1422[_0x7aa3('0x38')];_0x183ffc[_0x7aa3('0x39')]=_0x3c1422[_0x7aa3('0x39')];_0x183ffc[_0x7aa3('0x3a')]=_0x3c1422[_0x7aa3('0x3a')];_0x183ffc['outboundDropCallsDayACS']=_0x3c1422[_0x7aa3('0x3b')];_0x183ffc[_0x7aa3('0x3c')]=_0x3c1422[_0x7aa3('0x3c')];_0x183ffc[_0x7aa3('0x3d')]=_0x3c1422[_0x7aa3('0x3d')];_0x183ffc[_0x7aa3('0x3e')]=_0x3c1422[_0x7aa3('0x3e')];_0x183ffc[_0x7aa3('0x3f')]=_0x3c1422[_0x7aa3('0x3f')];_0x183ffc[_0x7aa3('0x40')]=_0x3c1422[_0x7aa3('0x40')];_0x183ffc[_0x7aa3('0x41')]=_0x3c1422[_0x7aa3('0x41')];_0x183ffc[_0x7aa3('0x42')]=_0x3c1422['outboundRejectCallsDay'];_0x183ffc[_0x7aa3('0x43')]=_0x3c1422[_0x7aa3('0x43')];_0x183ffc[_0x7aa3('0x44')]=_0x3c1422[_0x7aa3('0x44')];_0x183ffc['predictiveIntervalAvgHoldtime']=_0x3c1422[_0x7aa3('0x45')];_0x183ffc['predictiveIntervalAvgTalktime']=_0x3c1422[_0x7aa3('0x46')];_0x183ffc[_0x7aa3('0x47')]=_0x3c1422[_0x7aa3('0x47')];_0x183ffc[_0x7aa3('0x48')]=_0x3c1422[_0x7aa3('0x48')];_0x183ffc[_0x7aa3('0x49')]=_0x3c1422[_0x7aa3('0x49')];_0x183ffc[_0x7aa3('0x4a')]=_0x3c1422[_0x7aa3('0x4a')];_0x183ffc[_0x7aa3('0x4b')]=_0x3c1422['predictiveIntervalHitRate'];_0x183ffc[_0x7aa3('0x4c')]=_0x3c1422[_0x7aa3('0x4c')];_0x183ffc[_0x7aa3('0x4d')]=_0x3c1422[_0x7aa3('0x4d')];_0x183ffc[_0x7aa3('0x4e')]=_0x3c1422[_0x7aa3('0x4e')];_0x183ffc[_0x7aa3('0x4f')]=_0x3c1422[_0x7aa3('0x4f')];_0x183ffc[_0x7aa3('0x1b')]=_0x3c1422[_0x7aa3('0x1b')];_0x183ffc[_0x7aa3('0x50')]=_0x3c1422[_0x7aa3('0x50')];_0x183ffc[_0x7aa3('0x51')]=_0x3c1422[_0x7aa3('0x51')];_0x183ffc['erlangCallToSecond']=_0x3c1422[_0x7aa3('0x52')];_0x183ffc[_0x7aa3('0x53')]=_0x3c1422['erlangAbandonmentRate'];_0x183ffc[_0x7aa3('0x54')]=_0x3c1422[_0x7aa3('0x54')];_0x183ffc['startPredictive']=_0x3c1422[_0x7aa3('0x55')];_0x183ffc[_0x7aa3('0x56')]=_0x3c1422[_0x7aa3('0x56')];}if(_0x3c1422[_0x7aa3('0x57')]){_0x183ffc['Trunk']={'id':_0x3c1422['Trunk']['id'],'name':_0x3c1422[_0x7aa3('0x57')]['name'],'active':_0x3c1422[_0x7aa3('0x57')]['active'],'callerid':_0x3c1422['Trunk'][_0x7aa3('0x58')]};}if(_0x3c1422[_0x7aa3('0x59')]){_0x183ffc[_0x7aa3('0x59')]={'id':_0x3c1422[_0x7aa3('0x59')]['id'],'name':_0x3c1422[_0x7aa3('0x59')]['name']};}_0x1c5fef[_0x7aa3('0x5a')](_0x183ffc);}}_0x23f168({'count':_0x1c5fef[_0x7aa3('0x5b')],'rows':_0x1c5fef});});},'UpdateVoiceQueue':function(_0x5a5a88){return new Promise(function(_0x262a16,_0xcf97e0){var _0x3cdcfe=_['find'](_0x2801a2[_0x7aa3('0x20')],{'id':parseInt(_0x5a5a88['id'])});var _0x2d8e1d=_['omit'](_0x5a5a88,['id']);if(_0x3cdcfe){for(var _0x2cc4aa in _0x2d8e1d){if(typeof _0x2d8e1d[_0x2cc4aa]!==_0x7aa3('0x5c')&&typeof _0x3cdcfe[_0x2cc4aa]!=='undefined'){_0x3cdcfe[_0x2cc4aa]=_0x2d8e1d[_0x2cc4aa];}}_0x262a16(_0x3cdcfe);}else{_0xcf97e0();}});},'VoiceChannels':function(_0x4a2bfd){return new Promise(function(_0x368e27,_0x1a990){var _0x41f9fe=_[_0x7aa3('0x5d')](_0x2801a2['channels']);_0x368e27({'count':_0x41f9fe['length'],'rows':_0x41f9fe});});},'VoiceChannelMixMonitor':function(_0x41cbac){var _0x1d9ace=this;return new Promise(function(_0x1ccd3d,_0x16ad02){if(ami['isConnected']()==![]){return _0x16ad02(_0x1d9ace['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')]['join']('\x20')));}var _0x24017d=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x41cbac);if(_0x24017d[_0x7aa3('0x5b')]>0x0){return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x24017d,'message')[_0x7aa3('0x15')](',\x20')));}var _0x4d93c0=_['find'](_0x2801a2['channels'],{'uniqueid':_0x41cbac['uniqueid']});if(_0x4d93c0&&_0x4d93c0[_0x7aa3('0x61')]){var _0x2b6d01=util['format'](_0x7aa3('0x62'),_0x41cbac[_0x7aa3('0x63')]||_0x41cbac[_0x7aa3('0x64')],_0x41cbac['format']||'wav');return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x65'),'channel':_0x4d93c0[_0x7aa3('0x61')],'file':_0x2b6d01,'options':'ai(mixmonitorid)'})['then'](function(_0x53bb2e){var _0x5c6f1f=_[_0x7aa3('0x66')](_0x4d93c0[_0x7aa3('0x67')],{'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')]()});if(_['isNil'](_0x5c6f1f)){_0x4d93c0[_0x7aa3('0x67')][_0x7aa3('0x5a')]({'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')](),'createdAt':moment()[_0x7aa3('0x9')](_0x7aa3('0x6a')),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')],'status':_0x7aa3('0x6c')});}else{_0x5c6f1f['mixmonitorid']=_0x53bb2e[_0x7aa3('0x6b')];_0x5c6f1f[_0x7aa3('0x6d')]=_0x7aa3('0x6c');}_0x1ccd3d({'code':0xc8,'message':[_0x41cbac[_0x7aa3('0x64')],_0x7aa3('0x6e'),_0x53bb2e[_0x7aa3('0x6b')]][_0x7aa3('0x15')]('\x20'),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')]});})['catch'](function(_0x88aca4){_0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,[_0x41cbac['uniqueid'],_0x88aca4[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x20dde8){var _0x9f277d=this;return new Promise(function(_0x32efc6,_0x5275ba){if(ami[_0x7aa3('0x11')]()==![]){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x3552d2=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x20dde8);if(_0x3552d2[_0x7aa3('0x5b')]>0x0){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x3552d2,_0x7aa3('0x1b'))['join'](',\x20')));}var _0x53d3d4=_[_0x7aa3('0x66')](_0x2801a2['channels'],{'uniqueid':_0x20dde8[_0x7aa3('0x64')]});if(_0x53d3d4){return BPromise['resolve']()['then'](function(){if(_0x53d3d4['channel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x61')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})['catch'](function(_0x448b71){});}})['then'](function(){if(_0x53d3d4['destinationchannel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x71')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})[_0x7aa3('0x1a')](function(_0x27642a){});}})[_0x7aa3('0x19')](function(_0x16724c){var _0xaf3894=_['find'](_0x53d3d4[_0x7aa3('0x67')],{'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]});if(_0xaf3894){_0xaf3894[_0x7aa3('0x6d')]=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){var _0x4bb221=util[_0x7aa3('0x9')]('%s.%s',_0x20dde8['filename']||_0x20dde8[_0x7aa3('0x64')],_0x20dde8[_0x7aa3('0x9')]||'wav');var _0xaea2f0=_[_0x7aa3('0x66')](_0x53d3d4[_0x7aa3('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x4bb221[_0x7aa3('0x69')]()});if(_0xaea2f0){_0xaea2f0['status']=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){_0x32efc6({'code':0xc8,'message':[_0x20dde8[_0x7aa3('0x64')],_0x7aa3('0x73')][_0x7aa3('0x15')]('\x20')});})[_0x7aa3('0x1a')](function(_0x397c57){_0x5275ba(_0x9f277d['error'](0x1f5,[_0x20dde8[_0x7aa3('0x64')],_0x397c57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x5275ba(_0x9f277d['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannels':function(_0x4942d1){return new Promise(function(_0x442723,_0x5f30b8){var _0x254278=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x74')]);_0x442723({'count':_0x254278[_0x7aa3('0x5b')],'rows':_0x254278});});},'VoiceQueuesChannel':function(_0x558c6e){var _0x5303fa=this;return new Promise(function(_0x4a72c0,_0x4e4f7a){var _0x1f880a=schema(properties[_0x7aa3('0x75')])[_0x7aa3('0x3')](_0x558c6e);if(_0x1f880a[_0x7aa3('0x5b')]>0x0){return _0x4e4f7a(_0x5303fa[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x1f880a,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x817cd1=_['find'](_0x2801a2['queueChannels'],{'uniqueid':_0x558c6e[_0x7aa3('0x64')]});if(_0x817cd1){_0x4a72c0(_0x817cd1);}else{return _0x4e4f7a(_0x5303fa['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0xab9995){var _0x32fa77=this;return new Promise(function(_0x4850c2,_0x23f831){if(ami[_0x7aa3('0x11')]()==![]){return _0x23f831(_0x32fa77['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x34aa41=schema(properties[_0x7aa3('0x76')])[_0x7aa3('0x3')](_0xab9995);if(_0x34aa41[_0x7aa3('0x5b')]>0x0){return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x34aa41,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x29ffbe=_[_0x7aa3('0x66')](_0x2801a2[_0x7aa3('0x74')],{'uniqueid':_0xab9995['uniqueid']});if(_0x29ffbe&&_0x29ffbe[_0x7aa3('0x61')]){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x77'),'channel':_0x29ffbe[_0x7aa3('0x61')]})[_0x7aa3('0x19')](function(_0x53d208){_0x4850c2({'code':0xc8,'message':[_0xab9995[_0x7aa3('0x64')],_0x53d208[_0x7aa3('0x1b')][_0x7aa3('0x69')]()]['join']('\x20')});})[_0x7aa3('0x1a')](function(_0x4d7a1c){_0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,[_0xab9995[_0x7aa3('0x64')],_0x4d7a1c[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x26191f){var _0xa0b103=this;return new Promise(function(_0xd58880,_0x4b2568){if(ami[_0x7aa3('0x11')]()==![]){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x5a0642=schema(properties[_0x7aa3('0x78')])[_0x7aa3('0x3')](_0x26191f);if(_0x5a0642[_0x7aa3('0x5b')]>0x0){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x5a0642,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x2ca603=_[_0x7aa3('0x66')](_0x2801a2['queueChannels'],{'uniqueid':_0x26191f[_0x7aa3('0x64')]});if(_0x2ca603&&_0x2ca603[_0x7aa3('0x61')]){return ami['Action']({'action':_0x7aa3('0x79'),'channel':_0x2ca603['channel'],'exten':_0x26191f[_0x7aa3('0x7a')],'context':_0x26191f[_0x7aa3('0x7b')]||_0x2ca603[_0x7aa3('0x7b')],'priority':0x1})[_0x7aa3('0x19')](function(_0x517a99){_0xd58880({'code':0xc8,'message':[_0x26191f[_0x7aa3('0x64')],_0x517a99[_0x7aa3('0x1b')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x16cd57){_0x4b2568(_0xa0b103['error'](0x1f5,[_0x26191f[_0x7aa3('0x64')],_0x16cd57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x4b2568(_0xa0b103['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2e7d5e){return new Promise(function(_0x142763,_0x285c34){var _0x3b8baa=_[_0x7aa3('0x5d')](_0x2801a2['agents']);_0x142763({'count':_0x3b8baa[_0x7aa3('0x5b')],'rows':_0x3b8baa});});},'Telephones':function(_0x2f17a6){return new Promise(function(_0x572e95,_0x3735a8){var _0x2def81=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7c')]);_0x572e95({'count':_0x2def81[_0x7aa3('0x5b')],'rows':_0x2def81});});},'Trunks':function(_0x4a6858){return new Promise(function(_0x5288c6,_0x542fe3){var _0x4444b8=_['values'](_0x2801a2['trunks']);_0x5288c6({'count':_0x4444b8['length'],'rows':_0x4444b8});});},'OutboundChannels':function(_0x3baa9d){return new Promise(function(_0x1e47c1,_0x1b4146){var _0x1165a4=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7d')]);_0x1e47c1({'count':_0x1165a4[_0x7aa3('0x5b')],'rows':_0x1165a4});});},'Outbound':function(_0x41a8f2){return new Promise(function(_0x4a53b5,_0xeb18b7){_0x4a53b5(_0x2801a2[_0x7aa3('0x2e')]);});},'Campaigns':function(_0x347807){return new Promise(function(_0x294a35,_0x1ee74e){var _0xc6a9dc=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7e')]);_0x294a35({'count':_0xc6a9dc[_0x7aa3('0x5b')],'rows':_0xc6a9dc});});},'VoiceQueuesPreview':function(_0x593e3e){var _0x4e67d5=this;return new Promise(function(_0xb15dc0,_0x1ed982){_0x2679bb[_0x7aa3('0x7f')](_0x593e3e['id'])[_0x7aa3('0x19')](function(_0x2bc37a){_0xb15dc0({'code':0xc8,'message':_0x2bc37a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x8a57ea){_0x1ed982(_0x4e67d5[_0x7aa3('0x12')](0x1f4,_0x8a57ea[_0x7aa3('0x1b')]));});});},'EventManager':function(_0x1ba1cc){var _0x50f320=this;return new Promise(function(_0x33e263,_0x4120d1){if(!_0x1ba1cc['event']){return _0x4120d1(_0x50f320[_0x7aa3('0x12')](0x1f4,_0x7aa3('0x80')));}ami[_0x7aa3('0x81')](_0x7aa3('0x82')+_0x1ba1cc[_0x7aa3('0x83')],_0x1ba1cc[_0x7aa3('0x1b')]);_0x33e263({'code':0xc8,'message':_0x1ba1cc});});},'FaxAccounts':function(_0x576379){return new Promise(function(_0x590077,_0x509caf){var _0x176c3f=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x84')]);_0x590077({'count':_0x176c3f[_0x7aa3('0x5b')],'rows':_0x176c3f});});},'SendFax':function(_0x42e1c8){var _0x43bbb9=this;return new Promise(function(_0x1b8cbe,_0x1da203){_0x5b738a[_0x7aa3('0x85')](_0x42e1c8)[_0x7aa3('0x19')](function(_0x1e3a8a){_0x1b8cbe({'code':0xc8,'message':_0x1e3a8a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x1c2195){_0x1da203(_0x43bbb9['error'](0x1f4,_0x1c2195[_0x7aa3('0x1b')]));});});},'CheckAfterSend':function(_0x55515d){var _0x4c2b21=this;return new Promise(function(_0x4c838a,_0x3a0b89){_0x5b738a['checkAfterSend'](_0x55515d)[_0x7aa3('0x19')](function(_0x2954a3){_0x4c838a({'code':0xc8,'message':_0x2954a3[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0xe33081){_0x3a0b89(_0x4c2b21[_0x7aa3('0x12')](0x1f4,_0xe33081[_0x7aa3('0x1b')]));});});}};var _0x5ee939=jayson[_0x7aa3('0x86')](_0x5d1627)[_0x7aa3('0x87')]();_0x5ee939['on'](_0x7aa3('0x12'),function(_0x2523be){return _0xbbcc8a(_0x2523be);});_0x5ee939[_0x7aa3('0x8')](0x232a,_0x7aa3('0x88'),function(){console[_0x7aa3('0x89')](_0x7aa3('0x8a'),0x232a);return _0x437b90(_0x7aa3('0x8b')+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 55e0289..ffde872 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 _0xda55=['name','trigger:%s','action','merge','length','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Autocreate\x20disabled','push','format'];(function(_0x17ca2b,_0x505718){var _0x410423=function(_0x540b4a){while(--_0x540b4a){_0x17ca2b['push'](_0x17ca2b['shift']());}};_0x410423(++_0x505718);}(_0xda55,0x6d));var _0x5da5=function(_0x17b3a0,_0x24e743){_0x17b3a0=_0x17b3a0-0x0;var _0x3bb234=_0xda55[_0x17b3a0];return _0x3bb234;};'use strict';var _=require(_0x5da5('0x0'));var BPromise=require(_0x5da5('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x5da5('0x2'));var logger=require(_0x5da5('0x3'))(_0x5da5('0x4'));var cmContactRpc=require(_0x5da5('0x5'));config[_0x5da5('0x6')]=_['defaults'](config[_0x5da5('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5da5('0x7'))(new Redis(config['redis']));function emit(_0x2fd877,_0x267469,_0x71b187,_0x46290d,_0x3debdf){logger[_0x5da5('0x8')](_0x5da5('0x9'),_0x2fd877,_0x267469['id'],_0x71b187,_0x46290d,JSON[_0x5da5('0xa')](_0x3debdf));io['to'](_0x71b187)['emit'](_0x46290d,_0x3debdf);}exports[_0x5da5('0xb')]=function(_0x1f98a7,_0x2731a3,_0x26fbe3,_0x1a047e){var _0x2a361c,_0x33313e;var _0x589c14={};var _0x2f4e4b=Number(_0x26fbe3[_0x5da5('0xc')]);var _0x4f813b=_0x26fbe3[_0x5da5('0xd')]?Boolean(Number(_0x26fbe3[_0x5da5('0xd')])):![];var _0x3ced00;var _0x43d526=![];if(!_[_0x5da5('0xe')](_0x26fbe3[_0x5da5('0xf')])){if(_0x26fbe3['data5']=='1')_0x43d526=!![];}if(!_0x43d526){if(_0x1a047e['xmd-contactid']){_0x589c14['id']=_0x1a047e['xmd-contactid'];}}if(!_0x589c14['id']){_0x589c14[_0x5da5('0x10')]=_0x2f4e4b;_0x3ced00=_0x26fbe3[_0x5da5('0x11')]&&_0x26fbe3[_0x5da5('0x11')]!=='0'?_0x26fbe3[_0x5da5('0x11')][_0x5da5('0x12')](','):[_0x5da5('0x13')];_0x589c14[_0x5da5('0x14')]=_['map'](_0x3ced00,function(_0x124dc5){var _0x290136={};_0x290136[_0x124dc5]=_0x1a047e[_0x5da5('0x15')]?_0x1a047e[_0x5da5('0x16')]:_0x1a047e[_0x5da5('0x17')];return _0x290136;});}var _0x428b07=['id','firstName',_0x5da5('0x18'),_0x5da5('0x13'),_0x5da5('0x19'),_0x5da5('0x1a'),_0x5da5('0x10'),'createdAt',_0x5da5('0x1b'),_0x5da5('0x1c')];var _0x42a3cb=_['union'](_0x428b07,_0x3ced00);BPromise[_0x5da5('0x1d')]()[_0x5da5('0x1e')](cmContactRpc[_0x5da5('0x1f')]({'attributes':_0x42a3cb,'where':_0x589c14}))[_0x5da5('0x1e')](function(_0xec69f2){_0x33313e=_0xec69f2;if(!_[_0x5da5('0x20')](_0x33313e)){if(_0x33313e['length']===0x1){_0x2a361c=_0x33313e[0x0];logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}else{logger[_0x5da5('0x8')](_0x5da5('0x22'),_0x1a047e['uniqueid'],_0x2731a3['id'],_[_0x5da5('0x23')](_0x33313e,'id')[_0x5da5('0x24')](','));}return;}else{logger[_0x5da5('0x8')](_0x5da5('0x25'),_0x1a047e['uniqueid'],_0x2731a3['id']);var _0x5b0b43={'ListId':_0x2f4e4b};var _0x50aadc=_0x26fbe3[_0x5da5('0x26')]&&_0x26fbe3['data4']!=='0'?_0x26fbe3['data4']:_0x5da5('0x13');if(_0x4f813b){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e['routeId'])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43[_0x5da5('0x27')]=_0x1a047e['calleridname']&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43['firstName']=_0x1a047e['destcalleridname']&&_0x1a047e['destcalleridname']!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}return BPromise[_0x5da5('0x1d')]()['then'](cmContactRpc['createContact'](_0x5b0b43))[_0x5da5('0x1e')](function(_0x4afb58){_0x2a361c=_0x4afb58;_0x33313e['push'](_0x4afb58);if(_0x2a361c){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}return;});}else{logger[_0x5da5('0x8')](_0x5da5('0x2c'),_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_['isNil'](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43['firstName']=_0x1a047e[_0x5da5('0x28')]&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43[_0x5da5('0x27')]=_0x1a047e[_0x5da5('0x2b')]&&_0x1a047e[_0x5da5('0x2b')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}_0x2a361c=_0x5b0b43;_0x33313e[_0x5da5('0x2d')](_0x5b0b43);return;}}})[_0x5da5('0x1e')](function(){if(_0x1f98a7){emit(_0x1a047e['uniqueid'],_0x2731a3,util[_0x5da5('0x2e')]('user:%s',_0x1f98a7[_0x5da5('0x2f')]),util[_0x5da5('0x2e')](_0x5da5('0x30'),_0x26fbe3[_0x5da5('0x31')]['toLowerCase']()),{'evt':_[_0x5da5('0x32')](_0x1a047e,{'autoCreate':_0x4f813b}),'contact':_0x2a361c===undefined?{}:_0x2a361c,'contacts':_0x33313e[_0x5da5('0x33')]===0x0?undefined:_0x33313e});}});}; \ No newline at end of file +var _0xb903=['data1','data2','data5','xmd-contactid','data3','split','phone','destcalleridnum','calleridnum','firstName','fax','ListId','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','Unknown','destcalleridname','push','user:%s','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info'];(function(_0x1ba376,_0x565742){var _0xedf383=function(_0x4eec1e){while(--_0x4eec1e){_0x1ba376['push'](_0x1ba376['shift']());}};_0xedf383(++_0x565742);}(_0xb903,0x185));var _0x3b90=function(_0x16ffe4,_0x444736){_0x16ffe4=_0x16ffe4-0x0;var _0xf2eb18=_0xb903[_0x16ffe4];return _0xf2eb18;};'use strict';var _=require(_0x3b90('0x0'));var BPromise=require(_0x3b90('0x1'));var Redis=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3b90('0x4'))(_0x3b90('0x5'));var cmContactRpc=require(_0x3b90('0x6'));config[_0x3b90('0x7')]=_[_0x3b90('0x8')](config[_0x3b90('0x7')],{'host':_0x3b90('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b90('0x7')]));function emit(_0x5e845a,_0x55792c,_0x153283,_0x2e4c06,_0x42efe8){logger[_0x3b90('0xa')]('[CM][%s][%s]',_0x5e845a,_0x55792c['id'],_0x153283,_0x2e4c06,JSON['stringify'](_0x42efe8));io['to'](_0x153283)['emit'](_0x2e4c06,_0x42efe8);}exports['exec']=function(_0x56261b,_0x55db3f,_0x336913,_0x5af39c){var _0x574955,_0x30c49c;var _0x233509={};var _0x4bb8f4=Number(_0x336913[_0x3b90('0xb')]);var _0x174c0d=_0x336913[_0x3b90('0xc')]?Boolean(Number(_0x336913['data2'])):![];var _0x5447df;var _0x58c4d1=![];if(!_['isNil'](_0x336913['data5'])){if(_0x336913[_0x3b90('0xd')]=='1')_0x58c4d1=!![];}if(!_0x58c4d1){if(_0x5af39c[_0x3b90('0xe')]){_0x233509['id']=_0x5af39c['xmd-contactid'];}}if(!_0x233509['id']){_0x233509['ListId']=_0x4bb8f4;_0x5447df=_0x336913[_0x3b90('0xf')]&&_0x336913[_0x3b90('0xf')]!=='0'?_0x336913[_0x3b90('0xf')][_0x3b90('0x10')](','):[_0x3b90('0x11')];_0x233509['$or']=_['map'](_0x5447df,function(_0xd83280){var _0x5420dc={};_0x5420dc[_0xd83280]=_0x5af39c['routeId']?_0x5af39c[_0x3b90('0x12')]:_0x5af39c[_0x3b90('0x13')];return _0x5420dc;});}var _0x11ad7d=['id',_0x3b90('0x14'),'lastName',_0x3b90('0x11'),'mobile',_0x3b90('0x15'),_0x3b90('0x16'),'createdAt',_0x3b90('0x17'),_0x3b90('0x18')];var _0x3642c0=_[_0x3b90('0x19')](_0x11ad7d,_0x5447df);BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc[_0x3b90('0x1c')]({'attributes':_0x3642c0,'where':_0x233509}))[_0x3b90('0x1b')](function(_0xa98414){_0x30c49c=_0xa98414;if(!_[_0x3b90('0x1d')](_0x30c49c)){if(_0x30c49c['length']===0x1){_0x574955=_0x30c49c[0x0];logger[_0x3b90('0xa')](_0x3b90('0x1e'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}else{logger[_0x3b90('0xa')](_0x3b90('0x20'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_['map'](_0x30c49c,'id')['join'](','));}return;}else{logger[_0x3b90('0xa')](_0x3b90('0x21'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);var _0x2ffa1a={'ListId':_0x4bb8f4};var _0x583523=_0x336913[_0x3b90('0x22')]&&_0x336913[_0x3b90('0x22')]!=='0'?_0x336913[_0x3b90('0x22')]:'phone';if(_0x174c0d){logger[_0x3b90('0xa')](_0x3b90('0x23'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c[_0x3b90('0x25')])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c['destcalleridnum'];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:_0x3b90('0x28');}else{_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c['destcalleridname']!==''?_0x5af39c[_0x3b90('0x29')]:_0x3b90('0x28');}return BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc['createContact'](_0x2ffa1a))['then'](function(_0xd33ac9){_0x574955=_0xd33ac9;_0x30c49c[_0x3b90('0x2a')](_0xd33ac9);if(_0x574955){logger[_0x3b90('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c['routeId'])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c[_0x3b90('0x12')];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:'Unknown';}else{_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c[_0x3b90('0x29')]!==''?_0x5af39c['destcalleridname']:_0x3b90('0x28');}_0x574955=_0x2ffa1a;_0x30c49c[_0x3b90('0x2a')](_0x2ffa1a);return;}}})[_0x3b90('0x1b')](function(){if(_0x56261b){emit(_0x5af39c[_0x3b90('0x1f')],_0x55db3f,util['format'](_0x3b90('0x2b'),_0x56261b['name']),util[_0x3b90('0x2c')](_0x3b90('0x2d'),_0x336913[_0x3b90('0x2e')][_0x3b90('0x2f')]()),{'evt':_[_0x3b90('0x30')](_0x5af39c,{'autoCreate':_0x174c0d}),'contact':_0x574955===undefined?{}:_0x574955,'contacts':_0x30c49c[_0x3b90('0x31')]===0x0?undefined:_0x30c49c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 9d5185a..20aed0f 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 _0x147b=['upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','null','substatus','offlineMessage','created','exports','util','lodash','mustache','ioredis','./integration','./cmContact','./script','../../../config/logger','../ami','redis','defaults','socket.io-emitter','popup','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','interface','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','action','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','isNil','data3','location','uriLocation','data4','800','data5','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','trigger:%s:%s','toLowerCase','jscripty','name','integration','queue','routeId','urlforward','exec','script','parse','query','search','replace','channel','AllConditions','checkConditions','length','some','AnyConditions','field','account','chat','ChatWebsiteId','operator','value'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x147b,0x193));var _0xb147=function(_0x167117,_0x2dee70){_0x167117=_0x167117-0x0;var _0x387b70=_0x147b[_0x167117];return _0x387b70;};'use strict';var util=require(_0xb147('0x0'));var _=require(_0xb147('0x1'));var url=require('url');var Mustache=require(_0xb147('0x2'));var Redis=require(_0xb147('0x3'));var urlforward=require('./urlforward');var integration=require(_0xb147('0x4'));var cmContact=require(_0xb147('0x5'));var script=require(_0xb147('0x6'));var config=require('../../../config/environment');var logger=require(_0xb147('0x7'))('trigger');var ami=require(_0xb147('0x8'));config[_0xb147('0x9')]=_[_0xb147('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb147('0xb'))(new Redis(config[_0xb147('0x9')]));var operators={'equals':function(_0x29af7c,_0x1ec7ab){return _0x29af7c==_0x1ec7ab;},'not_equals':function(_0xd5122a,_0x22d125){return _0xd5122a!=_0x22d125;}};var barAndWebActions=[_0xb147('0xc'),_0xb147('0xd'),'winapp'];function Trigger(_0x4a33ae){this[_0xb147('0xe')]=_0x4a33ae[_0xb147('0xe')];this[_0xb147('0xf')]=_0x4a33ae[_0xb147('0xf')];this[_0xb147('0x10')]=_0x4a33ae[_0xb147('0x10')];this[_0xb147('0x11')]=_0x4a33ae[_0xb147('0x11')];this[_0xb147('0x12')]=_0x4a33ae[_0xb147('0x12')];this[_0xb147('0x13')]=_0x4a33ae['zendeskAccounts'];this[_0xb147('0x14')]=_0x4a33ae[_0xb147('0x14')];this[_0xb147('0x15')]=_0x4a33ae[_0xb147('0x15')];this['sugarcrmAccounts']=_0x4a33ae[_0xb147('0x16')];this[_0xb147('0x17')]=_0x4a33ae['zohoAccounts'];this['deskAccounts']=_0x4a33ae[_0xb147('0x18')];this[_0xb147('0x19')]=_0x4a33ae[_0xb147('0x19')];this['servicenowAccounts']=_0x4a33ae['servicenowAccounts'];this[_0xb147('0x1a')]=_0x4a33ae['dynamics365Accounts'];this[_0xb147('0x1b')]=_0x4a33ae[_0xb147('0x1b')];this[_0xb147('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xb147('0x16')],'zoho':this[_0xb147('0x17')],'desk':this[_0xb147('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xb147('0x1a')],'freshsales':this[_0xb147('0x1b')],'servicenow':this[_0xb147('0x1d')]};ami['on'](_0xb147('0x1e'),this[_0xb147('0x1f')]['bind'](this));ami['on'](_0xb147('0x20'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x22'),this[_0xb147('0x1f')]['bind'](this));ami['on']('custom:agentcomplete',this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x23'),this[_0xb147('0x1f')]['bind'](this));ami['on'](_0xb147('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb147('0x25'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x26'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xb147('0x21')](this));ami['on'](_0xb147('0x27'),this['syncCustomEvent'][_0xb147('0x21')](this));ami['on'](_0xb147('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb147('0x29'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x2a'),this[_0xb147('0x2b')]['bind'](this));ami['on'](_0xb147('0x2c'),this[_0xb147('0x2b')][_0xb147('0x21')](this));ami['on'](_0xb147('0x2d'),this[_0xb147('0x2b')]['bind'](this));ami['on'](_0xb147('0x2e'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x2f'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x30'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on']('custom:incomingmessage',this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x31'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x32'),this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on']('custom:rejectmessage',this[_0xb147('0x1f')][_0xb147('0x21')](this));ami['on'](_0xb147('0x33'),this[_0xb147('0x1f')][_0xb147('0x21')](this));}Trigger[_0xb147('0x34')][_0xb147('0x35')]=function(_0x4a8460,_0x23324e,_0x48cc99){logger[_0xb147('0x36')](_0x4a8460,_0x23324e,JSON[_0xb147('0x37')](_0x48cc99));io['to'](_0x4a8460)['emit'](_0x23324e,_0x48cc99);};Trigger['prototype']['syncCustomEvent']=function(_0x344b11){var _0x38735d=_[_0xb147('0x38')](_0x344b11);if(typeof _0x38735d[_0xb147('0x39')]===_0xb147('0x3a')){_0x38735d['motionChannel']=_0xb147('0x3b');}this['checkTriggers'](_0x38735d);};Trigger['prototype']['syncAgentDial']=function(_0x379bb6){if(this[_0xb147('0xf')][_0x379bb6[_0xb147('0x3c')]]){this[_0xb147('0x1f')](_0x379bb6);}};Trigger[_0xb147('0x34')][_0xb147('0x3d')]=function(_0x530b94){var _0x4477d9;for(var _0x3be87a in this[_0xb147('0xe')]){if(this[_0xb147('0xe')][_0xb147('0x3e')](_0x3be87a)){if(this[_0xb147('0xe')][_0x3be87a]['status']){_0x4477d9=this[_0xb147('0x3f')](this[_0xb147('0xe')][_0x3be87a],_0x530b94);if(_0x4477d9){_[_0xb147('0x40')](_0x530b94,_0x530b94['variables']);for(var _0x9ccf42=0x0,_0x1c200b,_0x4baf6a,_0x57c8e7;_0x9ccf420x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x193454,_0x3ada46){var _0x444eb5=function(_0x26a701){while(--_0x26a701){_0x193454['push'](_0x193454['shift']());}};_0x444eb5(++_0x3ada46);}(_0x7217,0x19e));var _0x7721=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x7217[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 d2201ed..2c6cc99 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 _0xa71f=['contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20created!','includes','string','type','customField','idField','content','ticketType','incident','assign','getString','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','odata-entityid','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','modernAuthentication','%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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','remoteUri','data7','CloudProvider','data2','data5','username','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','headers','substring','enduserId'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa71f,0x166));var _0xfa71=function(_0x506816,_0x3fd893){_0x506816=_0x506816-0x0;var _0x5906bc=_0xa71f[_0x506816];return _0x5906bc;};'use strict';var _=require('lodash');var rp=require(_0xfa71('0x0'));var util=require(_0xfa71('0x1'));var intUtil=require(_0xfa71('0x2'));var md5=require(_0xfa71('0x3'));var Redis=require(_0xfa71('0x4'));var logger=require(_0xfa71('0x5'))(_0xfa71('0x6'));var config=require(_0xfa71('0x7'));config[_0xfa71('0x8')]=_[_0xfa71('0x9')](config[_0xfa71('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xfa71('0xa'))(new Redis(config[_0xfa71('0x8')]));function getAuthToken(_0x35406b,_0x145a6d,_0x4ad155){if(_0x35406b['modernAuthentication']){_0x35406b[_0xfa71('0xb')]=_0x35406b['CloudProvider'][_0xfa71('0xc')];_0x35406b['tenantId']=_0x35406b[_0xfa71('0xd')][_0xfa71('0xe')];return Promise['resolve'](_0x35406b[_0xfa71('0xd')][_0xfa71('0xf')]);}var _0x5a859e={'method':'POST','uri':_0x145a6d,'form':{'client_id':_0x35406b['clientId'],'resource':_0x35406b[_0xfa71('0xb')],'username':_0x35406b[_0xfa71('0x10')],'password':_0x35406b['password'],'grant_type':'password','client_secret':_0x35406b[_0xfa71('0x11')]},'json':!![]};return rp(_0x5a859e)[_0xfa71('0x12')](function(_0x191743){return _0x191743[_0xfa71('0x13')];})['catch'](function(_0x195d32){logger[_0xfa71('0x14')]('['+[_0x4ad155[_0xfa71('0x15')]()]+_0xfa71('0x16'));return _0x195d32[_0xfa71('0x17')];});}function getUser(_0x5cf7aa,_0x1edfb9,_0x3d291c,_0x2975d3,_0x3b7c18,_0x4fc4fb){return new Promise(function(_0x36806e,_0x47b0de){return getAuthToken(_0x1edfb9,_0x2975d3,_0x4fc4fb)[_0xfa71('0x12')](function(_0x2d8569){var _0x253bcb={'method':_0xfa71('0x18'),'uri':_0x3b7c18+_0xfa71('0x19'),'headers':{'Authorization':_0xfa71('0x1a')+_0x2d8569,'OData-Version':_0xfa71('0x1b')},'json':!![]};return rp(_0x253bcb);})['then'](function(_0x2c7f5c){var _0x44a5f5=_0x2c7f5c[_0xfa71('0x1c')];var _0xb6e056=![];var _0x50b3fa=null;if(!_[_0xfa71('0x1d')](_0x3d291c)){if(intUtil[_0xfa71('0x1e')](_0x3d291c['email'])){_0x5cf7aa['userEmail']=_0x3d291c[_0xfa71('0x1f')];for(_0x50b3fa=0x0;_0x50b3fa<_0x44a5f5[_0xfa71('0x20')];_0x50b3fa++){if(_0x44a5f5[_0x50b3fa][_0xfa71('0x21')]===_0x3d291c[_0xfa71('0x1f')]&&!_0x44a5f5[_0x50b3fa]['isdisabled']){_0xb6e056=!![];logger['info']('['+[_0x4fc4fb[_0xfa71('0x15')]()]+_0xfa71('0x22')+_0x44a5f5[_0x50b3fa][_0xfa71('0x23')]+'!');_0x5cf7aa[_0xfa71('0x24')]=_0x44a5f5[_0x50b3fa][_0xfa71('0x23')];}}}}if(!_0xb6e056){logger[_0xfa71('0x25')]('['+[_0x4fc4fb[_0xfa71('0x15')]()]+_0xfa71('0x26'));_0x5cf7aa['userEmail']=_0x1edfb9[_0xfa71('0x10')];for(_0x50b3fa=0x0;_0x50b3fa<_0x44a5f5[_0xfa71('0x20')];_0x50b3fa++){if(_0x44a5f5[_0x50b3fa][_0xfa71('0x21')]===_0x1edfb9[_0xfa71('0x10')]){_0x5cf7aa['userId']=_0x44a5f5[_0x50b3fa][_0xfa71('0x23')];}}}_0x36806e(_0x5cf7aa);})[_0xfa71('0x27')](function(_0x121cac){_0x47b0de(_0x121cac[_0xfa71('0x17')]);});});}function createEndUser(_0x137bc9,_0x22d379,_0x4021a7,_0x55d7e,_0x4f20c9,_0x13d01e){return new Promise(function(_0x44eeee,_0x40d305){return getAuthToken(_0x22d379,_0x4021a7,_0x13d01e)['then'](function(_0x31c7b0){var _0xb63b73=_0x13d01e[_0xfa71('0x28')]()===_0xfa71('0x29')?_0x4f20c9[_0xfa71('0x2a')]:_0x4f20c9[_0xfa71('0x2b')];var _0x44d563={'method':_0xfa71('0x2c'),'uri':_0x55d7e+_0xfa71('0x2d'),'body':{'telephone1':_0xb63b73,'fullname':_0xb63b73,'firstname':_0xb63b73,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfa71('0x2e')+_0x137bc9[_0xfa71('0x24')]+')'},'headers':{'Authorization':_0xfa71('0x1a')+_0x31c7b0,'OData-Version':_0xfa71('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44d563);})['then'](function(_0x10a1b5){var _0x1936b3=_0x10a1b5[_0xfa71('0x2f')]['odata-entityid'];var _0x265ff6=_0x1936b3[_0xfa71('0x30')](_0x1936b3['lastIndexOf']('(')+0x1,_0x1936b3['lastIndexOf'](')'));_0x137bc9[_0xfa71('0x31')]=_0x265ff6;_0x44eeee(_0x137bc9);})['catch'](function(_0x5b0311){_0x40d305(_0x5b0311[_0xfa71('0x17')]);});});}function getEndUser(_0x43f688,_0x46c919,_0x18c11d,_0x2cf414,_0x452e3e,_0x4658ac,_0x2e270c){var _0x4c550f=_0x4658ac[_0xfa71('0x28')]()==='outbound'?_0x452e3e[_0xfa71('0x2a')]:_0x452e3e[_0xfa71('0x2b')];return getAuthToken(_0x46c919,_0x18c11d,_0x4658ac)['then'](function(_0x4dbc7c){var _0x9c64ca={'method':_0xfa71('0x18'),'uri':_0x2cf414+_0xfa71('0x32')+_0x4c550f[_0xfa71('0x33')]('+',_0xfa71('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x4dbc7c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x9c64ca);})[_0xfa71('0x12')](function(_0x4ed0b1){var _0x51a744=![];if(!_0x4ed0b1)return _0x51a744;var _0x128399=_0x4ed0b1[_0xfa71('0x1c')];for(var _0x518647=0x0;_0x518647<_0x128399['length'];_0x518647++){if(_0x128399[_0x518647]['telephone1']===_0x4c550f){_0x51a744=!![];_0x43f688[_0xfa71('0x31')]=_0x128399[_0x518647][_0xfa71('0x35')];}}return _0x51a744;})['then'](function(_0x15aabb){if(_0x15aabb)return _0x43f688;if(_0x2e270c===_0xfa71('0x36')){logger[_0xfa71('0x25')]('['+[_0x4658ac['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x43f688;}return createEndUser(_0x43f688,_0x46c919,_0x18c11d,_0x2cf414,_0x452e3e,_0x4658ac)[_0xfa71('0x12')](function(_0xacb498){logger['info']('['+[_0x4658ac[_0xfa71('0x15')]()]+_0xfa71('0x37'),_0xacb498['enduserId']);return _0xacb498;});});}function getCustomFields(_0x28b511,_0x420326,_0x1fccd2){var _0x52d2a7={};if(_0x28b511[_0xfa71('0x20')]>0x0){_['forEach'](_0x28b511,function(_0x5682e2){if(_[_0xfa71('0x38')]([_0xfa71('0x39'),'picklist'],_0x5682e2[_0xfa71('0x3a')])&&_0x5682e2['nameField']&&!_0x5682e2[_0xfa71('0x3b')]){var _0x4f3bd0=_0x5682e2[_0xfa71('0x3c')][_0xfa71('0x28')]();var _0x42504b=_0x4f3bd0[_0xfa71('0x30')](0x0,_0x4f3bd0['indexOf']('_'));var _0x1fc787=_0x4f3bd0[_0xfa71('0x30')](_0x4f3bd0['indexOf']('_')+0x1);if(_0x42504b===_0x1fccd2){_0x52d2a7[_0x1fc787]=_0x5682e2[_0xfa71('0x3d')];}}});}return _0x52d2a7;}function getTicket(_0x20e4ee,_0x5ae0d8,_0x114487,_0x560da9,_0x2b023e,_0x1194bf,_0x3ad4cd){return new Promise(function(_0x3647f2,_0x28be78){var _0xfa9825;return getAuthToken(_0x5ae0d8,_0x114487,_0x3ad4cd)['then'](function(_0x4359fa){if(_0x1194bf[_0xfa71('0x3e')]===_0xfa71('0x3f')){_0xfa9825={'method':_0xfa71('0x2c'),'uri':_0x560da9+'incidents','body':Object[_0xfa71('0x40')]({},{'title':intUtil['getString'](_0x1194bf['Subjects'],_0x2b023e,'\x20'),'description':intUtil[_0xfa71('0x41')](_0x1194bf[_0xfa71('0x42')],_0x2b023e,'\x0a'),'customerid_contact@odata.bind':_0x20e4ee[_0xfa71('0x31')]?_0xfa71('0x43')+_0x20e4ee[_0xfa71('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x20e4ee['userId']+')','caseorigincode':'1'},getCustomFields(_0x1194bf[_0xfa71('0x44')],_0x2b023e,_0x1194bf['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4359fa,'OData-Version':_0xfa71('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1194bf[_0xfa71('0x3e')]==='phonecall'){var _0x3a4d51=_0x20e4ee[_0xfa71('0x31')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x20e4ee[_0xfa71('0x24')]+')','participationtypemask':_0x20e4ee[_0xfa71('0x45')]===_0xfa71('0x46')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x20e4ee[_0xfa71('0x31')]+')','participationtypemask':_0x20e4ee[_0xfa71('0x45')]===_0xfa71('0x46')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfa71('0x2e')+_0x20e4ee[_0xfa71('0x24')]+')','participationtypemask':_0x20e4ee[_0xfa71('0x45')]===_0xfa71('0x46')?0x2:0x1}];_0xfa9825={'method':_0xfa71('0x2c'),'uri':_0x560da9+_0xfa71('0x47'),'body':Object[_0xfa71('0x40')]({},{'subject':intUtil[_0xfa71('0x41')](_0x1194bf['Subjects'],_0x2b023e,'\x20'),'phonenumber':String(_0x2b023e['calleridnum']),'description':intUtil[_0xfa71('0x41')](_0x1194bf[_0xfa71('0x42')],_0x2b023e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x20e4ee[_0xfa71('0x31')]?_0xfa71('0x43')+_0x20e4ee[_0xfa71('0x31')]+')':undefined,'ownerid@odata.bind':_0xfa71('0x2e')+_0x20e4ee['userId']+')','directioncode':_0x20e4ee[_0xfa71('0x45')]===_0xfa71('0x46')?![]:!![],'phonecall_activity_parties':_0x3a4d51},getCustomFields(_0x1194bf['Fields'],_0x2b023e,_0x1194bf[_0xfa71('0x3e')])),'headers':{'Authorization':'Bearer\x20'+_0x4359fa,'OData-Version':_0xfa71('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xfa9825);})[_0xfa71('0x12')](function(_0xf48e40){var _0x2f5e07=_0xf48e40['headers'][_0xfa71('0x48')];var _0x4e2a85=_0x2f5e07[_0xfa71('0x30')](_0x2f5e07[_0xfa71('0x49')]('(')+0x1,_0x2f5e07['lastIndexOf'](')'));_0x20e4ee[_0xfa71('0x4a')]=_0x4e2a85;_0x3647f2(_0x20e4ee);})[_0xfa71('0x27')](function(_0x46c24f){_0x28be78(_0x46c24f[_0xfa71('0x17')]);});});}function emit(_0x56caf0,_0x9a3201,_0x2a8883,_0x2da04b){var _0x29803a={'uri':util[_0xfa71('0x4b')](_0xfa71('0x4c'),_0x56caf0,_0x2a8883,_0x2da04b)};io['to'](util['format']('user:%s',_0x9a3201))[_0xfa71('0x4d')](_0xfa71('0x4e'),_0x29803a);}exports['cs']=function(_0x3963c4,_0x36d762,_0xd790d7,_0x2b717e,_0xfa6755,_0x24391c,_0xf338c1,_0x14732a){var _0xd993de={};_0x24391c[_0xfa71('0xb')]=_0x24391c['modernAuthentication']?intUtil[_0xfa71('0x4f')](_0x24391c[_0xfa71('0xd')]['data7']):intUtil[_0xfa71('0x4f')](_0x24391c[_0xfa71('0xb')]);_0x24391c[_0xfa71('0x50')]=intUtil[_0xfa71('0x4f')](_0x24391c['serverUrl']);_0xd993de['callDirection']=_0x14732a==='queue'||_0x14732a==='unmanaged'?'queue':_0xfa71('0x29');var _0x44c5a8=_0x24391c[_0xfa71('0x51')]?util[_0xfa71('0x4b')]('%s/api/data/v9.0/',_0x24391c['CloudProvider']['data7']):util['format'](_0xfa71('0x52'),_0x24391c[_0xfa71('0xb')]);var _0x47a072=util['format'](_0xfa71('0x53'),_0x24391c[_0xfa71('0x54')]);var _0x27062d=util[_0xfa71('0x4b')](_0xfa71('0x55'),_0x24391c[_0xfa71('0x50')],_0x36d762[_0xfa71('0x56')],md5(_0x36d762[_0xfa71('0x56')]));if(_0xfa6755&&_0xfa6755[_0xfa71('0x57')]){logger[_0xfa71('0x25')]('[QUEUE]',_0xfa71('0x58'));_0x36d762[_0xfa71('0x59')]=_0x27062d;}else if(_0xf338c1&&_0xf338c1[_0xfa71('0x5a')]&&_0xf338c1['recordingFormat']!==_0xfa71('0x5b')){logger[_0xfa71('0x25')](_0xfa71('0x5c'),_0xfa71('0x58'));_0x36d762[_0xfa71('0x59')]=_0x27062d;}else{_0x36d762[_0xfa71('0x59')]='';}return getUser(_0xd993de,_0x24391c,_0x2b717e,_0x47a072,_0x44c5a8,_0x14732a)[_0xfa71('0x12')](function(_0x5a7aaf){logger[_0xfa71('0x25')]('['+_0x14732a['toUpperCase']()+_0xfa71('0x5d'),_0x5a7aaf[_0xfa71('0x24')]);logger[_0xfa71('0x25')]('['+_0x14732a['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x5a7aaf[_0xfa71('0x5e')]);return getEndUser(_0x5a7aaf,_0x24391c,_0x47a072,_0x44c5a8,_0x36d762,_0x14732a,_0xd790d7[_0xfa71('0x5f')]);})['then'](function(_0x1afcf0){logger[_0xfa71('0x25')]('['+_0x14732a[_0xfa71('0x15')]()+_0xfa71('0x60'),_0x1afcf0[_0xfa71('0x31')]);logger[_0xfa71('0x25')]('['+_0x14732a[_0xfa71('0x15')]()+_0xfa71('0x61'),_0x36d762['calleridnum']);return getTicket(_0x1afcf0,_0x24391c,_0x47a072,_0x44c5a8,_0x36d762,_0xd790d7,_0x14732a);})[_0xfa71('0x12')](function(_0x2cf2a3){logger[_0xfa71('0x25')](util['format']('['+_0x14732a[_0xfa71('0x15')]()+_0xfa71('0x62'),_0xd790d7[_0xfa71('0x3e')],_0x2cf2a3[_0xfa71('0x4a')]));logger[_0xfa71('0x25')](util['format']('['+_0x14732a[_0xfa71('0x15')]()+_0xfa71('0x63'),_0x14732a));if(_0x14732a!==_0xfa71('0x64')){logger['info']('['+_0x14732a[_0xfa71('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x24391c[_0xfa71('0xb')],_0x2b717e['name'],_0xd790d7['ticketType'],_0x2cf2a3['ticketId']);}})[_0xfa71('0x27')](function(_0x4a0fc8){logger[_0xfa71('0x14')]('['+_0x14732a[_0xfa71('0x15')]()+_0xfa71('0x65'),_0x4a0fc8['message']);});}; \ No newline at end of file +var _0x187b=['callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','ioredis','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','data5','POST','clientId','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','toUpperCase','systemuserid','userId','info','username','catch','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','substring','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','4.0'];(function(_0x6da411,_0x370ecc){var _0x33302e=function(_0x109fc7){while(--_0x109fc7){_0x6da411['push'](_0x6da411['shift']());}};_0x33302e(++_0x370ecc);}(_0x187b,0xec));var _0xb187=function(_0x20c1f0,_0x40562c){_0x20c1f0=_0x20c1f0-0x0;var _0x1ec24e=_0x187b[_0x20c1f0];return _0x1ec24e;};'use strict';var _=require(_0xb187('0x0'));var rp=require(_0xb187('0x1'));var util=require(_0xb187('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xb187('0x3'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0xb187('0x4'));config[_0xb187('0x5')]=_[_0xb187('0x6')](config[_0xb187('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb187('0x5')]));function getAuthToken(_0x1b4492,_0x358b0d,_0x17bd1b){if(_0x1b4492[_0xb187('0x7')]){_0x1b4492[_0xb187('0x8')]=_0x1b4492[_0xb187('0x9')][_0xb187('0xa')];_0x1b4492[_0xb187('0xb')]=_0x1b4492[_0xb187('0x9')][_0xb187('0xc')];return Promise['resolve'](_0x1b4492['CloudProvider'][_0xb187('0xd')]);}var _0x85fb14={'method':_0xb187('0xe'),'uri':_0x358b0d,'form':{'client_id':_0x1b4492[_0xb187('0xf')],'resource':_0x1b4492[_0xb187('0x8')],'username':_0x1b4492['username'],'password':_0x1b4492['password'],'grant_type':_0xb187('0x10'),'client_secret':_0x1b4492[_0xb187('0x11')]},'json':!![]};return rp(_0x85fb14)[_0xb187('0x12')](function(_0x2dafce){return _0x2dafce[_0xb187('0x13')];})['catch'](function(_0x5e40cc){logger[_0xb187('0x14')]('['+[_0x17bd1b['toUpperCase']()]+_0xb187('0x15'));return _0x5e40cc[_0xb187('0x16')];});}function getUser(_0x428167,_0x28855f,_0xda4cde,_0x33f7f1,_0x3d62bd,_0x297ddf){return new Promise(function(_0x1fd2d1,_0x148d77){return getAuthToken(_0x28855f,_0x33f7f1,_0x297ddf)[_0xb187('0x12')](function(_0x1cf78e){var _0x12a509={'method':_0xb187('0x17'),'uri':_0x3d62bd+_0xb187('0x18'),'headers':{'Authorization':_0xb187('0x19')+_0x1cf78e,'OData-Version':'4.0'},'json':!![]};return rp(_0x12a509);})['then'](function(_0x4f0e22){var _0x57e0a5=_0x4f0e22[_0xb187('0x1a')];var _0x25ca02=![];var _0x3b512c=null;if(!_[_0xb187('0x1b')](_0xda4cde)){if(intUtil[_0xb187('0x1c')](_0xda4cde[_0xb187('0x1d')])){_0x428167[_0xb187('0x1e')]=_0xda4cde[_0xb187('0x1d')];for(_0x3b512c=0x0;_0x3b512c<_0x57e0a5[_0xb187('0x1f')];_0x3b512c++){if(_0x57e0a5[_0x3b512c][_0xb187('0x20')]===_0xda4cde[_0xb187('0x1d')]&&!_0x57e0a5[_0x3b512c][_0xb187('0x21')]){_0x25ca02=!![];logger['info']('['+[_0x297ddf[_0xb187('0x22')]()]+']\x20Agent\x20found\x20'+_0x57e0a5[_0x3b512c][_0xb187('0x23')]+'!');_0x428167[_0xb187('0x24')]=_0x57e0a5[_0x3b512c]['systemuserid'];}}}}if(!_0x25ca02){logger[_0xb187('0x25')]('['+[_0x297ddf[_0xb187('0x22')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x428167['userEmail']=_0x28855f[_0xb187('0x26')];for(_0x3b512c=0x0;_0x3b512c<_0x57e0a5[_0xb187('0x1f')];_0x3b512c++){if(_0x57e0a5[_0x3b512c][_0xb187('0x20')]===_0x28855f[_0xb187('0x26')]){_0x428167[_0xb187('0x24')]=_0x57e0a5[_0x3b512c][_0xb187('0x23')];}}}_0x1fd2d1(_0x428167);})[_0xb187('0x27')](function(_0x5404b2){_0x148d77(_0x5404b2[_0xb187('0x16')]);});});}function createEndUser(_0x384040,_0x2c8c10,_0x43010b,_0x233363,_0xff3c5,_0x212742){return new Promise(function(_0x1e199b,_0x477960){return getAuthToken(_0x2c8c10,_0x43010b,_0x212742)['then'](function(_0x2adfdf){var _0x13eeb9=_0x212742[_0xb187('0x28')]()===_0xb187('0x29')?_0xff3c5[_0xb187('0x2a')]:_0xff3c5['calleridnum'];var _0x833fb9={'method':'POST','uri':_0x233363+_0xb187('0x2b'),'body':{'telephone1':_0x13eeb9,'fullname':_0x13eeb9,'firstname':_0x13eeb9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb187('0x2c')+_0x384040[_0xb187('0x24')]+')'},'headers':{'Authorization':_0xb187('0x19')+_0x2adfdf,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x833fb9);})[_0xb187('0x12')](function(_0x392d77){var _0x1d882e=_0x392d77[_0xb187('0x2d')][_0xb187('0x2e')];var _0x14d28d=_0x1d882e['substring'](_0x1d882e[_0xb187('0x2f')]('(')+0x1,_0x1d882e[_0xb187('0x2f')](')'));_0x384040['enduserId']=_0x14d28d;_0x1e199b(_0x384040);})[_0xb187('0x27')](function(_0x34fab9){_0x477960(_0x34fab9['message']);});});}function getEndUser(_0x178152,_0x53d722,_0x58643c,_0x2740ab,_0x435c94,_0x65dfb1,_0x71ca52){var _0x147c35=_0x65dfb1[_0xb187('0x28')]()==='outbound'?_0x435c94[_0xb187('0x2a')]:_0x435c94[_0xb187('0x30')];return getAuthToken(_0x53d722,_0x58643c,_0x65dfb1)['then'](function(_0x5cf14e){var _0x25b676={'method':'GET','uri':_0x2740ab+_0xb187('0x31')+_0x147c35[_0xb187('0x32')]('+',_0xb187('0x33'))+'\x27','headers':{'Authorization':_0xb187('0x19')+_0x5cf14e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x25b676);})[_0xb187('0x12')](function(_0x3af8d1){var _0x1c837b=![];if(!_0x3af8d1)return _0x1c837b;var _0xe738f3=_0x3af8d1[_0xb187('0x1a')];for(var _0x3d4f0d=0x0;_0x3d4f0d<_0xe738f3[_0xb187('0x1f')];_0x3d4f0d++){if(_0xe738f3[_0x3d4f0d][_0xb187('0x34')]===_0x147c35){_0x1c837b=!![];_0x178152[_0xb187('0x35')]=_0xe738f3[_0x3d4f0d][_0xb187('0x36')];}}return _0x1c837b;})[_0xb187('0x12')](function(_0x168033){if(_0x168033)return _0x178152;if(_0x71ca52===_0xb187('0x37')){logger['info']('['+[_0x65dfb1[_0xb187('0x22')]()]+_0xb187('0x38'));return _0x178152;}return createEndUser(_0x178152,_0x53d722,_0x58643c,_0x2740ab,_0x435c94,_0x65dfb1)[_0xb187('0x12')](function(_0x1f7cbb){logger[_0xb187('0x25')]('['+[_0x65dfb1[_0xb187('0x22')]()]+_0xb187('0x39'),_0x1f7cbb[_0xb187('0x35')]);return _0x1f7cbb;});});}function getCustomFields(_0x90b0b1,_0x3d9544,_0x216b2f){var _0x5ef4a0={};if(_0x90b0b1['length']>0x0){_[_0xb187('0x3a')](_0x90b0b1,function(_0x40bf90){if(_[_0xb187('0x3b')]([_0xb187('0x3c'),_0xb187('0x3d')],_0x40bf90[_0xb187('0x3e')])&&_0x40bf90[_0xb187('0x3f')]&&!_0x40bf90['customField']){var _0x320102=_0x40bf90[_0xb187('0x40')][_0xb187('0x28')]();var _0x46351a=_0x320102['substring'](0x0,_0x320102[_0xb187('0x41')]('_'));var _0x2693e3=_0x320102[_0xb187('0x42')](_0x320102[_0xb187('0x41')]('_')+0x1);if(_0x46351a===_0x216b2f){_0x5ef4a0[_0x2693e3]=_0x40bf90['content'];}}});}return _0x5ef4a0;}function getTicket(_0x32dc23,_0x30ddbd,_0x14d7cf,_0x1e703b,_0x26e404,_0x528fd6,_0x22e32b){return new Promise(function(_0xcf07f4,_0x3a6ccf){var _0x30ab01;return getAuthToken(_0x30ddbd,_0x14d7cf,_0x22e32b)[_0xb187('0x12')](function(_0x5b1b44){if(_0x528fd6[_0xb187('0x43')]===_0xb187('0x44')){_0x30ab01={'method':'POST','uri':_0x1e703b+_0xb187('0x45'),'body':Object[_0xb187('0x46')]({},{'title':intUtil['getString'](_0x528fd6[_0xb187('0x47')],_0x26e404,'\x20'),'description':intUtil[_0xb187('0x48')](_0x528fd6[_0xb187('0x49')],_0x26e404,'\x0a'),'customerid_contact@odata.bind':_0x32dc23[_0xb187('0x35')]?_0xb187('0x4a')+_0x32dc23[_0xb187('0x35')]+')':undefined,'ownerid@odata.bind':_0xb187('0x2c')+_0x32dc23[_0xb187('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x528fd6['Fields'],_0x26e404,_0x528fd6[_0xb187('0x43')])),'headers':{'Authorization':_0xb187('0x19')+_0x5b1b44,'OData-Version':_0xb187('0x4b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x528fd6[_0xb187('0x43')]==='phonecall'){var _0xa7bbda=_0x32dc23[_0xb187('0x35')]?[{'partyid_systemuser@odata.bind':_0xb187('0x2c')+_0x32dc23[_0xb187('0x24')]+')','participationtypemask':_0x32dc23[_0xb187('0x4c')]===_0xb187('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xb187('0x4a')+_0x32dc23[_0xb187('0x35')]+')','participationtypemask':_0x32dc23['callDirection']===_0xb187('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb187('0x2c')+_0x32dc23[_0xb187('0x24')]+')','participationtypemask':_0x32dc23[_0xb187('0x4c')]===_0xb187('0x4d')?0x2:0x1}];_0x30ab01={'method':_0xb187('0xe'),'uri':_0x1e703b+'phonecalls','body':Object[_0xb187('0x46')]({},{'subject':intUtil[_0xb187('0x48')](_0x528fd6[_0xb187('0x47')],_0x26e404,'\x20'),'phonenumber':String(_0x26e404[_0xb187('0x30')]),'description':intUtil[_0xb187('0x48')](_0x528fd6['Descriptions'],_0x26e404,'\x0a'),'regardingobjectid_contact@odata.bind':_0x32dc23['enduserId']?_0xb187('0x4a')+_0x32dc23[_0xb187('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x32dc23[_0xb187('0x24')]+')','directioncode':_0x32dc23[_0xb187('0x4c')]===_0xb187('0x4d')?![]:!![],'phonecall_activity_parties':_0xa7bbda},getCustomFields(_0x528fd6['Fields'],_0x26e404,_0x528fd6[_0xb187('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x5b1b44,'OData-Version':_0xb187('0x4b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x30ab01);})['then'](function(_0x48532c){var _0x30e291=_0x48532c['headers']['odata-entityid'];var _0xed53ec=_0x30e291['substring'](_0x30e291[_0xb187('0x2f')]('(')+0x1,_0x30e291['lastIndexOf'](')'));_0x32dc23['ticketId']=_0xed53ec;_0xcf07f4(_0x32dc23);})[_0xb187('0x27')](function(_0x1a964f){_0x3a6ccf(_0x1a964f[_0xb187('0x16')]);});});}function emit(_0x48bf91,_0x2c9bfd,_0x368e56,_0x390c27){var _0x1236a3={'uri':util[_0xb187('0x4e')](_0xb187('0x4f'),_0x48bf91,_0x368e56,_0x390c27)};io['to'](util[_0xb187('0x4e')](_0xb187('0x50'),_0x2c9bfd))[_0xb187('0x51')]('trigger:browser:url',_0x1236a3);}exports['cs']=function(_0x1896c0,_0x292fef,_0x424254,_0x3afe70,_0x36d940,_0xf3a834,_0x11fb06,_0x586669){var _0x14b2ae={};_0xf3a834[_0xb187('0x8')]=_0xf3a834[_0xb187('0x7')]?intUtil[_0xb187('0x52')](_0xf3a834['CloudProvider']['data7']):intUtil['stripTrailingSlash'](_0xf3a834[_0xb187('0x8')]);_0xf3a834[_0xb187('0x53')]=intUtil['stripTrailingSlash'](_0xf3a834[_0xb187('0x53')]);_0x14b2ae['callDirection']=_0x586669===_0xb187('0x4d')||_0x586669===_0xb187('0x54')?_0xb187('0x4d'):_0xb187('0x29');var _0x16768b=_0xf3a834[_0xb187('0x7')]?util['format']('%s/api/data/v9.0/',_0xf3a834['CloudProvider'][_0xb187('0xa')]):util[_0xb187('0x4e')]('%s/api/data/v9.0/',_0xf3a834[_0xb187('0x8')]);var _0xeae6c=util[_0xb187('0x4e')]('https://login.microsoftonline.com/%s/oauth2/token',_0xf3a834[_0xb187('0xb')]);var _0x4cf798=util[_0xb187('0x4e')](_0xb187('0x55'),_0xf3a834[_0xb187('0x53')],_0x292fef[_0xb187('0x56')],md5(_0x292fef[_0xb187('0x56')]));if(_0x36d940&&_0x36d940[_0xb187('0x57')]){logger[_0xb187('0x25')](_0xb187('0x58'),_0xb187('0x59'));_0x292fef[_0xb187('0x5a')]=_0x4cf798;}else if(_0x11fb06&&_0x11fb06['recordingFormat']&&_0x11fb06[_0xb187('0x5b')]!==_0xb187('0x5c')){logger[_0xb187('0x25')](_0xb187('0x5d'),'Recording\x20is\x20enabled!');_0x292fef[_0xb187('0x5a')]=_0x4cf798;}else{_0x292fef[_0xb187('0x5a')]='';}return getUser(_0x14b2ae,_0xf3a834,_0x3afe70,_0xeae6c,_0x16768b,_0x586669)[_0xb187('0x12')](function(_0x45258b){logger[_0xb187('0x25')]('['+_0x586669[_0xb187('0x22')]()+_0xb187('0x5e'),_0x45258b[_0xb187('0x24')]);logger[_0xb187('0x25')]('['+_0x586669[_0xb187('0x22')]()+']\x20The\x20User\x20email\x20is:',_0x45258b[_0xb187('0x1e')]);return getEndUser(_0x45258b,_0xf3a834,_0xeae6c,_0x16768b,_0x292fef,_0x586669,_0x424254[_0xb187('0x5f')]);})['then'](function(_0x202ddd){logger[_0xb187('0x25')]('['+_0x586669[_0xb187('0x22')]()+_0xb187('0x60'),_0x202ddd[_0xb187('0x35')]);logger[_0xb187('0x25')]('['+_0x586669[_0xb187('0x22')]()+_0xb187('0x61'),_0x292fef[_0xb187('0x30')]);return getTicket(_0x202ddd,_0xf3a834,_0xeae6c,_0x16768b,_0x292fef,_0x424254,_0x586669);})['then'](function(_0x36710f){logger['info'](util[_0xb187('0x4e')]('['+_0x586669['toUpperCase']()+_0xb187('0x62'),_0x424254[_0xb187('0x43')],_0x36710f[_0xb187('0x63')]));logger['info'](util[_0xb187('0x4e')]('['+_0x586669[_0xb187('0x22')]()+_0xb187('0x64'),_0x586669));if(_0x586669!=='unmanaged'){logger['info']('['+_0x586669[_0xb187('0x22')]()+']',_0xb187('0x65'));emit(_0xf3a834[_0xb187('0x8')],_0x3afe70[_0xb187('0x66')],_0x424254['ticketType'],_0x36710f[_0xb187('0x63')]);}})['catch'](function(_0x28a4f8){logger['error']('['+_0x586669['toUpperCase']()+_0xb187('0x67'),_0x28a4f8[_0xb187('0x16')]);});}; \ 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 594c0ee..b0d237c 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 _0xd30f=['socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','type','customField','nameField','content','picklist','idField','variableName','customVariable','Variable','name','push','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','trigger:browser:url','error','unmanaged','monitor_format','lastevent','calleridnum','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','freshdesk','defaults','redis','localhost'];(function(_0x1da3ab,_0x2c0cd3){var _0x4627e9=function(_0x2eafe2){while(--_0x2eafe2){_0x1da3ab['push'](_0x1da3ab['shift']());}};_0x4627e9(++_0x2c0cd3);}(_0xd30f,0x107));var _0xfd30=function(_0x114241,_0x1b4b3a){_0x114241=_0x114241-0x0;var _0x444062=_0xd30f[_0x114241];return _0x444062;};'use strict';var _=require(_0xfd30('0x0'));var rp=require(_0xfd30('0x1'));var md5=require(_0xfd30('0x2'));var util=require('util');var Redis=require(_0xfd30('0x3'));var intUtil=require(_0xfd30('0x4'));var config=require('../../../../config/environment');var logger=require(_0xfd30('0x5'))(_0xfd30('0x6'));config['redis']=_[_0xfd30('0x7')](config[_0xfd30('0x8')],{'host':_0xfd30('0x9'),'port':0x18eb});var io=require(_0xfd30('0xa'))(new Redis(config[_0xfd30('0x8')]));var headers={'Content-Type':_0xfd30('0xb'),'Accept':_0xfd30('0xb')};function emit(_0x48161e,_0x48b9a5,_0x37c73c){io['to'](_0x48161e)[_0xfd30('0xc')](_0x48b9a5,_0x37c73c);}function getTicket(_0x4515d3,_0xafc356,_0x323776,_0x55d2bc,_0x1ae7af){logger[_0xfd30('0xd')]('Creating\x20new\x20ticket...');var _0x1adb95=_[_0xfd30('0xe')]({'responder_id':_0xafc356['id'],'requester_id':_0x323776['id'],'name':util[_0xfd30('0xf')](_0xfd30('0x10'),_0x1ae7af[_0xfd30('0x11')]),'phone':_0x1ae7af['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfd30('0x12')](_0x55d2bc[_0xfd30('0x13')],_0x1ae7af,'\x20'),'description':intUtil['getString'](_0x55d2bc[_0xfd30('0x14')],_0x1ae7af,'
'),'tags':getTags(_0x55d2bc['Tags'],'name')},getCustomFields(_0x55d2bc['Fields'],_0x1ae7af));_0x1adb95[_0xfd30('0x15')]=_['mapValues'](_[_0xfd30('0x16')](_0x1adb95[_0xfd30('0x15')],'id'),_0xfd30('0x17'));return request({'uri':util[_0xfd30('0xf')](_0xfd30('0x18'),_0x4515d3[_0xfd30('0x19')]),'method':'POST','body':_0x1adb95})[_0xfd30('0x1a')](function(_0x220f83){logger[_0xfd30('0xd')](_0xfd30('0x1b'));return _0x220f83;});}function getUser(_0x28b001,_0x2efa98){if(intUtil['validateEmail'](_0x2efa98)){return request({'uri':util[_0xfd30('0xf')](_0xfd30('0x1c'),_0x28b001[_0xfd30('0x19')]),'qs':{'email':_0x2efa98}})[_0xfd30('0x1a')](function(_0x1cca8f){if(_0x1cca8f[_0xfd30('0x1d')]){logger[_0xfd30('0xd')](_0xfd30('0x1e'));return _[_0xfd30('0x1f')](_0x1cca8f,function(_0x59c396){return _0x59c396[_0xfd30('0x20')][_0xfd30('0x21')]===_0x2efa98;});}else{logger[_0xfd30('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x28b001[_0xfd30('0x19')])})[_0xfd30('0x1a')](function(_0x4b0828){logger[_0xfd30('0xd')](_0xfd30('0x22'));return _0x4b0828;});}});}else{logger[_0xfd30('0xd')](_0xfd30('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x28b001[_0xfd30('0x19')])})['then'](function(_0x3dbdac){logger['info']('Admin\x20account\x20selected.');return _0x3dbdac;});}}function getEndUser(_0x1c66ab,_0x1d0b3a,_0x4c6965){logger[_0xfd30('0xd')](_0xfd30('0x24'),_0x4c6965);return request({'uri':util[_0xfd30('0xf')](_0xfd30('0x25'),_0x1c66ab[_0xfd30('0x19')]),'qs':{'phone':_0x4c6965}})[_0xfd30('0x1a')](function(_0x19e3fb){if(_0x19e3fb['length']){logger[_0xfd30('0xd')]('Enduser\x20found!');return _[_0xfd30('0x1f')](_0x19e3fb,{'phone':_0x4c6965});}else{logger['info'](_0xfd30('0x26'));return request({'uri':util[_0xfd30('0xf')](_0xfd30('0x25'),_0x1c66ab[_0xfd30('0x19')]),'method':_0xfd30('0x27'),'body':{'name':_0x1d0b3a,'phone':_0x4c6965}})['then'](function(_0x4134e2){logger[_0xfd30('0xd')](_0xfd30('0x28'));return _0x4134e2;});}});}function getAuth(_0x5c9e1e){return util['format'](_0xfd30('0x29'),new Buffer(_0x5c9e1e[_0xfd30('0x2a')]+':X')[_0xfd30('0x2b')](_0xfd30('0x2c')));}function request(_0x404961){logger[_0xfd30('0x2d')](_0xfd30('0x2e'),JSON[_0xfd30('0x2f')](_0x404961));return rp(_[_0xfd30('0x7')](_0x404961,{'method':_0xfd30('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x4b0070,_0x30a990){var _0x20142b=[];if(_0x4b0070&&_0x4b0070[_0xfd30('0x1d')]>0x0){_0x20142b=_[_0xfd30('0x31')](_0x4b0070,_0x30a990);}return _0x20142b;}function getCustomFields(_0x2cb81a,_0x1693f6){var _0x31c3b5=[];var _0x404ca4={'custom_fields':[]};if(_0x2cb81a[_0xfd30('0x1d')]>0x0){_[_0xfd30('0x32')](_0x2cb81a,function(_0x3f2cce){if(_[_0xfd30('0x33')]([_0xfd30('0x34'),'picklist'],_0x3f2cce[_0xfd30('0x35')])&&_0x3f2cce['nameField']&&!_0x3f2cce[_0xfd30('0x36')]){_0x404ca4[_0x3f2cce[_0xfd30('0x37')]['toLowerCase']()]=_0x3f2cce[_0xfd30('0x38')][_0xfd30('0x2b')]();}else if(_[_0xfd30('0x33')]([_0xfd30('0x34'),_0xfd30('0x39')],_0x3f2cce['type'])&&_0x3f2cce[_0xfd30('0x3a')]&&_0x3f2cce[_0xfd30('0x36')]){_0x404ca4['custom_fields']['push']({'id':_0x3f2cce[_0xfd30('0x3a')],'value':_0x3f2cce[_0xfd30('0x38')][_0xfd30('0x2b')]()});}else if(_0x3f2cce[_0xfd30('0x35')]==='variable'&&_0x3f2cce[_0xfd30('0x3b')]&&_0x3f2cce[_0xfd30('0x3a')]&&_0x3f2cce[_0xfd30('0x36')]){_0x1693f6[_0x3f2cce['variableName']]&&_0x404ca4[_0xfd30('0x15')]['push']({'id':_0x3f2cce[_0xfd30('0x3a')],'value':_0x1693f6[_0x3f2cce[_0xfd30('0x3b')]][_0xfd30('0x2b')]()});}else if(_0x3f2cce[_0xfd30('0x35')]===_0xfd30('0x3c')&&_0x3f2cce[_0xfd30('0x3d')]&&_0x3f2cce['Variable']['name']&&_0x3f2cce[_0xfd30('0x3a')]&&_0x3f2cce[_0xfd30('0x36')]){_0x1693f6[_0x3f2cce[_0xfd30('0x3d')][_0xfd30('0x3e')]['toLowerCase']()]&&_0x404ca4[_0xfd30('0x15')][_0xfd30('0x3f')]({'id':_0x3f2cce[_0xfd30('0x3a')],'value':_0x1693f6[_0x3f2cce[_0xfd30('0x3d')]['name'][_0xfd30('0x40')]()][_0xfd30('0x2b')]()});}});}return _0x404ca4;}exports['queue']=function(_0x3083f0,_0x832293,_0x2fea9d,_0x1dd5ef,_0x589dca,_0x3a9a10){var _0x34c0cc,_0x2cb0;_0x3a9a10[_0xfd30('0x19')]=intUtil[_0xfd30('0x41')](_0x3a9a10['remoteUri']);_0x3a9a10[_0xfd30('0x42')]=intUtil[_0xfd30('0x41')](_0x3a9a10[_0xfd30('0x42')]);if(_0x589dca&&_0x589dca['monitor_format']){logger['info'](_0xfd30('0x43'),'Recording\x20is\x20enabled!');_0x832293['recordingURL']=util[_0xfd30('0xf')](_0xfd30('0x44'),_0x3a9a10[_0xfd30('0x42')],_0x832293[_0xfd30('0x45')],md5(_0x832293['uniqueid']));}else{_0x832293[_0xfd30('0x46')]='';}headers[_0xfd30('0x47')]=getAuth(_0x3a9a10);return getUser(_0x3a9a10,_0x1dd5ef[_0xfd30('0x21')])['then'](function(_0x335a2a){_0x34c0cc=_0x335a2a;logger[_0xfd30('0xd')](_0xfd30('0x48'),_0x34c0cc['id']);return getEndUser(_0x3a9a10,_0x832293[_0xfd30('0x11')],_0x832293['calleridnum']);})[_0xfd30('0x1a')](function(_0x10415e){_0x2cb0=_0x10415e;logger[_0xfd30('0xd')](_0xfd30('0x49'),_0x2cb0['id']);return getTicket(_0x3a9a10,_0x34c0cc,_0x2cb0,_0x2fea9d,_0x832293);})['then'](function(_0x17b582){if(_0x17b582&&_0x17b582['id']){logger['info'](_0xfd30('0x1b'));logger['info'](_0xfd30('0x4a'),_0x17b582['id']);logger[_0xfd30('0xd')](_0xfd30('0x43'),_0xfd30('0x4b'));emit(util[_0xfd30('0xf')](_0xfd30('0x4c'),_0x1dd5ef[_0xfd30('0x3e')]),'trigger:browser:url',{'uri':util['format'](_0xfd30('0x4d'),_0x3a9a10['remoteUri'],_0x17b582['id'])});}})[_0xfd30('0x4e')](function(_0x5bf337){logger['error']('[QUEUE]',JSON[_0xfd30('0x2f')](_0x5bf337));});};exports['outbound']=function(_0x1ff40d,_0x60364d,_0x1b9209,_0x1582fa,_0x1cdec1,_0x2f7429,_0x2f5a94){var _0xa72313,_0xfa18d8;_0x2f7429[_0xfd30('0x19')]=intUtil[_0xfd30('0x41')](_0x2f7429['remoteUri']);_0x2f7429[_0xfd30('0x42')]=intUtil[_0xfd30('0x41')](_0x2f7429[_0xfd30('0x42')]);if(_0x2f5a94&&_0x2f5a94[_0xfd30('0x4f')]&&_0x2f5a94[_0xfd30('0x4f')]!==_0xfd30('0x50')){logger[_0xfd30('0xd')](_0xfd30('0x51'),_0xfd30('0x52'));_0x60364d['recordingURL']=util['format'](_0xfd30('0x44'),_0x2f7429[_0xfd30('0x42')],_0x60364d[_0xfd30('0x45')],md5(_0x60364d['uniqueid']));}headers[_0xfd30('0x47')]=getAuth(_0x2f7429);return getUser(_0x2f7429,_0x1582fa[_0xfd30('0x21')])[_0xfd30('0x1a')](function(_0x2171ab){_0xa72313=_0x2171ab;logger[_0xfd30('0xd')](_0xfd30('0x48'),_0xa72313['id']);return getEndUser(_0x2f7429,_0x60364d[_0xfd30('0x53')],_0x60364d['destcalleridnum']);})[_0xfd30('0x1a')](function(_0x1e070b){_0xfa18d8=_0x1e070b;logger[_0xfd30('0xd')](_0xfd30('0x49'),_0xfa18d8['id']);return getTicket(_0x2f7429,_0xa72313,_0xfa18d8,_0x1b9209,_0x60364d);})['then'](function(_0x30b0e9){if(_0x30b0e9&&_0x30b0e9['id']){logger[_0xfd30('0xd')](_0xfd30('0x1b'));logger[_0xfd30('0xd')](_0xfd30('0x4a'),_0x30b0e9['id']);logger['info'](_0xfd30('0x51'),_0xfd30('0x4b'));emit(util[_0xfd30('0xf')](_0xfd30('0x4c'),_0x1582fa['name']),_0xfd30('0x54'),{'uri':util[_0xfd30('0xf')](_0xfd30('0x4d'),_0x2f7429[_0xfd30('0x19')],_0x30b0e9['id'])});}})[_0xfd30('0x4e')](function(_0x5df63d){logger[_0xfd30('0x55')](_0xfd30('0x51'),JSON[_0xfd30('0x2f')](_0x5df63d));});};exports[_0xfd30('0x56')]=function(_0x3e7a32,_0x22a712,_0x312c77,_0x443195,_0x3d9658,_0x31aee8){var _0x222191,_0x19f542;_0x31aee8['remoteUri']=intUtil[_0xfd30('0x41')](_0x31aee8[_0xfd30('0x19')]);_0x31aee8['serverUrl']=intUtil[_0xfd30('0x41')](_0x31aee8[_0xfd30('0x42')]);if(_0x3d9658&&_0x3d9658[_0xfd30('0x57')]){logger[_0xfd30('0xd')]('['+_0x22a712[_0xfd30('0x58')]['toUpperCase']()+']',_0xfd30('0x52'));_0x22a712['recordingURL']=util[_0xfd30('0xf')](_0xfd30('0x44'),_0x31aee8[_0xfd30('0x42')],_0x22a712[_0xfd30('0x45')],md5(_0x22a712[_0xfd30('0x45')]));}else{_0x22a712[_0xfd30('0x46')]='';}headers[_0xfd30('0x47')]=getAuth(_0x31aee8);return getUser(_0x31aee8,'')[_0xfd30('0x1a')](function(_0x2b8127){_0x222191=_0x2b8127;logger[_0xfd30('0xd')](_0xfd30('0x48'),_0x222191['id']);return getEndUser(_0x31aee8,_0x22a712['calleridname'],_0x22a712[_0xfd30('0x59')]);})[_0xfd30('0x1a')](function(_0x3b6e7c){_0x19f542=_0x3b6e7c;logger[_0xfd30('0xd')](_0xfd30('0x49'),_0x19f542['id']);return getTicket(_0x31aee8,_0x222191,_0x19f542,_0x312c77,_0x22a712);})[_0xfd30('0x1a')](function(_0xec685d){if(_0xec685d){logger['info'](_0xfd30('0x1b'));logger[_0xfd30('0xd')](_0xfd30('0x4a'),_0xec685d['id']);}})['catch'](function(_0x5744ce){logger[_0xfd30('0x55')]('['+_0x22a712['lastevent'][_0xfd30('0x5a')]()+']',JSON[_0xfd30('0x2f')](_0x5744ce));});}; \ No newline at end of file +var _0x6f24=['util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','find','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!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','includes','picklist','nameField','toLowerCase','content','string','type','idField','customField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\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','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x6f24,0x126));var _0x46f2=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x6f24[_0x146a85];return _0x1b59bf;};'use strict';var _=require(_0x46f2('0x0'));var rp=require(_0x46f2('0x1'));var md5=require(_0x46f2('0x2'));var util=require(_0x46f2('0x3'));var Redis=require(_0x46f2('0x4'));var intUtil=require(_0x46f2('0x5'));var config=require(_0x46f2('0x6'));var logger=require(_0x46f2('0x7'))('freshdesk');config[_0x46f2('0x8')]=_['defaults'](config[_0x46f2('0x8')],{'host':_0x46f2('0x9'),'port':0x18eb});var io=require(_0x46f2('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x46f2('0xb'),'Accept':'application/json'};function emit(_0x7e73b8,_0xae6e9b,_0x57ae33){io['to'](_0x7e73b8)[_0x46f2('0xc')](_0xae6e9b,_0x57ae33);}function getTicket(_0x5accae,_0x1a8d1b,_0x290432,_0x3fc8d2,_0xcce43a){logger[_0x46f2('0xd')](_0x46f2('0xe'));var _0x3c987b=_[_0x46f2('0xf')]({'responder_id':_0x1a8d1b['id'],'requester_id':_0x290432['id'],'name':util[_0x46f2('0x10')](_0x46f2('0x11'),_0xcce43a[_0x46f2('0x12')]),'phone':_0xcce43a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3fc8d2[_0x46f2('0x13')],_0xcce43a,'\x20'),'description':intUtil[_0x46f2('0x14')](_0x3fc8d2[_0x46f2('0x15')],_0xcce43a,_0x46f2('0x16')),'tags':getTags(_0x3fc8d2[_0x46f2('0x17')],_0x46f2('0x18'))},getCustomFields(_0x3fc8d2[_0x46f2('0x19')],_0xcce43a));_0x3c987b[_0x46f2('0x1a')]=_[_0x46f2('0x1b')](_[_0x46f2('0x1c')](_0x3c987b['custom_fields'],'id'),_0x46f2('0x1d'));return request({'uri':util['format']('%s/api/v2/tickets',_0x5accae[_0x46f2('0x1e')]),'method':_0x46f2('0x1f'),'body':_0x3c987b})['then'](function(_0x379a13){logger[_0x46f2('0xd')](_0x46f2('0x20'));return _0x379a13;});}function getUser(_0xc1c55e,_0x1435ab){if(intUtil[_0x46f2('0x21')](_0x1435ab)){return request({'uri':util[_0x46f2('0x10')]('%s/api/v2/agents',_0xc1c55e[_0x46f2('0x1e')]),'qs':{'email':_0x1435ab}})[_0x46f2('0x22')](function(_0x2b431d){if(_0x2b431d[_0x46f2('0x23')]){logger['info']('Agent\x20found!');return _[_0x46f2('0x24')](_0x2b431d,function(_0x9f24f2){return _0x9f24f2[_0x46f2('0x25')]['email']===_0x1435ab;});}else{logger[_0x46f2('0xd')](_0x46f2('0x26'));return request({'uri':util[_0x46f2('0x10')](_0x46f2('0x27'),_0xc1c55e['remoteUri'])})[_0x46f2('0x22')](function(_0xb01f9f){logger['info'](_0x46f2('0x28'));return _0xb01f9f;});}});}else{logger[_0x46f2('0xd')](_0x46f2('0x29'));return request({'uri':util[_0x46f2('0x10')](_0x46f2('0x27'),_0xc1c55e[_0x46f2('0x1e')])})[_0x46f2('0x22')](function(_0x23160f){logger[_0x46f2('0xd')]('Admin\x20account\x20selected.');return _0x23160f;});}}function getEndUser(_0x418bf1,_0x37468b,_0x56548a){logger[_0x46f2('0xd')](_0x46f2('0x2a'),_0x56548a);return request({'uri':util[_0x46f2('0x10')](_0x46f2('0x2b'),_0x418bf1['remoteUri']),'qs':{'phone':_0x56548a}})[_0x46f2('0x22')](function(_0x30e7a1){if(_0x30e7a1[_0x46f2('0x23')]){logger['info'](_0x46f2('0x2c'));return _[_0x46f2('0x24')](_0x30e7a1,{'phone':_0x56548a});}else{logger[_0x46f2('0xd')](_0x46f2('0x2d'));return request({'uri':util[_0x46f2('0x10')]('%s/api/v2/contacts',_0x418bf1['remoteUri']),'method':_0x46f2('0x1f'),'body':{'name':_0x37468b,'phone':_0x56548a}})[_0x46f2('0x22')](function(_0x58763c){logger['info'](_0x46f2('0x2e'));return _0x58763c;});}});}function getAuth(_0x142349){return util[_0x46f2('0x10')](_0x46f2('0x2f'),new Buffer(_0x142349['apiKey']+':X')[_0x46f2('0x30')](_0x46f2('0x31')));}function request(_0x133160){logger[_0x46f2('0x32')](_0x46f2('0x33'),JSON[_0x46f2('0x34')](_0x133160));return rp(_[_0x46f2('0x35')](_0x133160,{'method':_0x46f2('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x5338ec,_0x67130c){var _0x2fc518=[];if(_0x5338ec&&_0x5338ec[_0x46f2('0x23')]>0x0){_0x2fc518=_[_0x46f2('0x37')](_0x5338ec,_0x67130c);}return _0x2fc518;}function getCustomFields(_0x812efa,_0x3404e3){var _0x2393bc=[];var _0x562594={'custom_fields':[]};if(_0x812efa['length']>0x0){_['forEach'](_0x812efa,function(_0x4baa1e){if(_[_0x46f2('0x38')](['string',_0x46f2('0x39')],_0x4baa1e['type'])&&_0x4baa1e['nameField']&&!_0x4baa1e['customField']){_0x562594[_0x4baa1e[_0x46f2('0x3a')][_0x46f2('0x3b')]()]=_0x4baa1e[_0x46f2('0x3c')][_0x46f2('0x30')]();}else if(_[_0x46f2('0x38')]([_0x46f2('0x3d'),_0x46f2('0x39')],_0x4baa1e[_0x46f2('0x3e')])&&_0x4baa1e[_0x46f2('0x3f')]&&_0x4baa1e[_0x46f2('0x40')]){_0x562594[_0x46f2('0x1a')][_0x46f2('0x41')]({'id':_0x4baa1e[_0x46f2('0x3f')],'value':_0x4baa1e[_0x46f2('0x3c')][_0x46f2('0x30')]()});}else if(_0x4baa1e['type']===_0x46f2('0x42')&&_0x4baa1e[_0x46f2('0x43')]&&_0x4baa1e[_0x46f2('0x3f')]&&_0x4baa1e['customField']){_0x3404e3[_0x4baa1e['variableName']]&&_0x562594[_0x46f2('0x1a')][_0x46f2('0x41')]({'id':_0x4baa1e[_0x46f2('0x3f')],'value':_0x3404e3[_0x4baa1e[_0x46f2('0x43')]]['toString']()});}else if(_0x4baa1e['type']===_0x46f2('0x44')&&_0x4baa1e[_0x46f2('0x45')]&&_0x4baa1e[_0x46f2('0x45')][_0x46f2('0x18')]&&_0x4baa1e[_0x46f2('0x3f')]&&_0x4baa1e[_0x46f2('0x40')]){_0x3404e3[_0x4baa1e[_0x46f2('0x45')][_0x46f2('0x18')]['toLowerCase']()]&&_0x562594[_0x46f2('0x1a')][_0x46f2('0x41')]({'id':_0x4baa1e[_0x46f2('0x3f')],'value':_0x3404e3[_0x4baa1e[_0x46f2('0x45')][_0x46f2('0x18')][_0x46f2('0x3b')]()][_0x46f2('0x30')]()});}});}return _0x562594;}exports[_0x46f2('0x46')]=function(_0x2698ec,_0x7e4e66,_0x4d94f1,_0x58ed9e,_0x158dec,_0x1fff64){var _0x5b9ab6,_0x38ce09;_0x1fff64[_0x46f2('0x1e')]=intUtil[_0x46f2('0x47')](_0x1fff64[_0x46f2('0x1e')]);_0x1fff64['serverUrl']=intUtil[_0x46f2('0x47')](_0x1fff64[_0x46f2('0x48')]);if(_0x158dec&&_0x158dec[_0x46f2('0x49')]){logger[_0x46f2('0xd')](_0x46f2('0x4a'),_0x46f2('0x4b'));_0x7e4e66[_0x46f2('0x4c')]=util[_0x46f2('0x10')](_0x46f2('0x4d'),_0x1fff64['serverUrl'],_0x7e4e66['uniqueid'],md5(_0x7e4e66[_0x46f2('0x4e')]));}else{_0x7e4e66[_0x46f2('0x4c')]='';}headers[_0x46f2('0x4f')]=getAuth(_0x1fff64);return getUser(_0x1fff64,_0x58ed9e[_0x46f2('0x50')])[_0x46f2('0x22')](function(_0x271060){_0x5b9ab6=_0x271060;logger[_0x46f2('0xd')](_0x46f2('0x51'),_0x5b9ab6['id']);return getEndUser(_0x1fff64,_0x7e4e66[_0x46f2('0x12')],_0x7e4e66[_0x46f2('0x52')]);})[_0x46f2('0x22')](function(_0xfd1f60){_0x38ce09=_0xfd1f60;logger[_0x46f2('0xd')](_0x46f2('0x53'),_0x38ce09['id']);return getTicket(_0x1fff64,_0x5b9ab6,_0x38ce09,_0x4d94f1,_0x7e4e66);})[_0x46f2('0x22')](function(_0x120eaf){if(_0x120eaf&&_0x120eaf['id']){logger[_0x46f2('0xd')](_0x46f2('0x20'));logger[_0x46f2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x120eaf['id']);logger[_0x46f2('0xd')](_0x46f2('0x4a'),_0x46f2('0x54'));emit(util['format'](_0x46f2('0x55'),_0x58ed9e[_0x46f2('0x18')]),_0x46f2('0x56'),{'uri':util[_0x46f2('0x10')](_0x46f2('0x57'),_0x1fff64[_0x46f2('0x1e')],_0x120eaf['id'])});}})[_0x46f2('0x58')](function(_0xaa8d6c){logger[_0x46f2('0x59')](_0x46f2('0x4a'),JSON[_0x46f2('0x34')](_0xaa8d6c));});};exports[_0x46f2('0x5a')]=function(_0x1a7625,_0xd6bae8,_0x29ded4,_0x3a6c11,_0x4090fa,_0x4e89f2,_0x4fbed5){var _0x3d044d,_0x29ebbd;_0x4e89f2[_0x46f2('0x1e')]=intUtil[_0x46f2('0x47')](_0x4e89f2['remoteUri']);_0x4e89f2[_0x46f2('0x48')]=intUtil[_0x46f2('0x47')](_0x4e89f2[_0x46f2('0x48')]);if(_0x4fbed5&&_0x4fbed5[_0x46f2('0x5b')]&&_0x4fbed5[_0x46f2('0x5b')]!=='none'){logger[_0x46f2('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xd6bae8[_0x46f2('0x4c')]=util[_0x46f2('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e89f2[_0x46f2('0x48')],_0xd6bae8['uniqueid'],md5(_0xd6bae8[_0x46f2('0x4e')]));}headers[_0x46f2('0x4f')]=getAuth(_0x4e89f2);return getUser(_0x4e89f2,_0x3a6c11[_0x46f2('0x50')])[_0x46f2('0x22')](function(_0x2ffab4){_0x3d044d=_0x2ffab4;logger[_0x46f2('0xd')](_0x46f2('0x51'),_0x3d044d['id']);return getEndUser(_0x4e89f2,_0xd6bae8[_0x46f2('0x5c')],_0xd6bae8[_0x46f2('0x5d')]);})[_0x46f2('0x22')](function(_0x6c569e){_0x29ebbd=_0x6c569e;logger[_0x46f2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x29ebbd['id']);return getTicket(_0x4e89f2,_0x3d044d,_0x29ebbd,_0x29ded4,_0xd6bae8);})['then'](function(_0x568a16){if(_0x568a16&&_0x568a16['id']){logger['info'](_0x46f2('0x20'));logger['info'](_0x46f2('0x5e'),_0x568a16['id']);logger['info'](_0x46f2('0x5f'),_0x46f2('0x54'));emit(util[_0x46f2('0x10')](_0x46f2('0x55'),_0x3a6c11[_0x46f2('0x18')]),'trigger:browser:url',{'uri':util[_0x46f2('0x10')](_0x46f2('0x57'),_0x4e89f2[_0x46f2('0x1e')],_0x568a16['id'])});}})['catch'](function(_0x2728bd){logger[_0x46f2('0x59')](_0x46f2('0x5f'),JSON['stringify'](_0x2728bd));});};exports[_0x46f2('0x60')]=function(_0x4a40db,_0x3ec64a,_0x4ef6ce,_0x38dad2,_0x2292d6,_0x973415){var _0x1c0880,_0x4f3b94;_0x973415[_0x46f2('0x1e')]=intUtil[_0x46f2('0x47')](_0x973415[_0x46f2('0x1e')]);_0x973415[_0x46f2('0x48')]=intUtil[_0x46f2('0x47')](_0x973415[_0x46f2('0x48')]);if(_0x2292d6&&_0x2292d6[_0x46f2('0x49')]){logger[_0x46f2('0xd')]('['+_0x3ec64a['lastevent'][_0x46f2('0x61')]()+']',_0x46f2('0x4b'));_0x3ec64a[_0x46f2('0x4c')]=util['format'](_0x46f2('0x4d'),_0x973415['serverUrl'],_0x3ec64a[_0x46f2('0x4e')],md5(_0x3ec64a[_0x46f2('0x4e')]));}else{_0x3ec64a[_0x46f2('0x4c')]='';}headers[_0x46f2('0x4f')]=getAuth(_0x973415);return getUser(_0x973415,'')[_0x46f2('0x22')](function(_0x565643){_0x1c0880=_0x565643;logger['info'](_0x46f2('0x51'),_0x1c0880['id']);return getEndUser(_0x973415,_0x3ec64a[_0x46f2('0x12')],_0x3ec64a[_0x46f2('0x52')]);})[_0x46f2('0x22')](function(_0x108610){_0x4f3b94=_0x108610;logger[_0x46f2('0xd')](_0x46f2('0x53'),_0x4f3b94['id']);return getTicket(_0x973415,_0x1c0880,_0x4f3b94,_0x4ef6ce,_0x3ec64a);})[_0x46f2('0x22')](function(_0x39971a){if(_0x39971a){logger[_0x46f2('0xd')](_0x46f2('0x20'));logger[_0x46f2('0xd')](_0x46f2('0x5e'),_0x39971a['id']);}})[_0x46f2('0x58')](function(_0x369a5f){logger[_0x46f2('0x59')]('['+_0x3ec64a[_0x46f2('0x62')]['toUpperCase']()+']',JSON[_0x46f2('0x34')](_0x369a5f));});}; \ 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 3e6a8d1..e58870d 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 _0x24f8=['util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','catch','message','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','endUserId','POST','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5'];(function(_0x5080e2,_0x1260d1){var _0x5ee291=function(_0x14096a){while(--_0x14096a){_0x5080e2['push'](_0x5080e2['shift']());}};_0x5ee291(++_0x1260d1);}(_0x24f8,0xf6));var _0x824f=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x24f8[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require(_0x824f('0x0'));var rp=require(_0x824f('0x1'));var md5=require(_0x824f('0x2'));var util=require(_0x824f('0x3'));var moment=require(_0x824f('0x4'));var Promise=require('bluebird');var Redis=require(_0x824f('0x5'));var intUtil=require(_0x824f('0x6'));var config=require(_0x824f('0x7'));var logger=require(_0x824f('0x8'))('freshsales');config[_0x824f('0x9')]=_[_0x824f('0xa')](config[_0x824f('0x9')],{'host':_0x824f('0xb'),'port':0x18eb});var io=require(_0x824f('0xc'))(new Redis(config[_0x824f('0x9')]));function getAdminId(_0xef522e,_0x2a0558,_0x17aca5,_0x238f4f){return new Promise(function(_0x411c00,_0x555f5b){var _0x536461=![];var _0x15daae={'method':_0x824f('0xd'),'uri':_0x238f4f+_0x824f('0xe'),'json':!![]};_0x15daae['headers']=_0x17aca5;logger[_0x824f('0xf')]('Getting\x20admin\x20information');return rp(_0x15daae)[_0x824f('0x10')](function(_0x294b44){if(_0x294b44){var _0x5d57b5=_0x294b44[_0x824f('0x11')];var _0x286500=null;for(_0x286500=0x0;_0x286500<_0x5d57b5['length'];_0x286500++){if(_0x5d57b5[_0x286500][_0x824f('0x12')]===_0xef522e[_0x824f('0x13')]){_0xef522e[_0x824f('0x14')]=_0x5d57b5[_0x286500]['id'];_0x536461=!![];}}if(_0x536461){logger['info'](_0x824f('0x15'),_0xef522e[_0x824f('0x14')]);_0x411c00(_0xef522e);}else{_0x555f5b({'statusCode':0x194,'message':_0x824f('0x16')});}}else{_0x555f5b({'statusCode':0x194,'message':_0x824f('0x16')});}})['catch'](function(_0x52e513){logger[_0x824f('0x17')]('['+[_0x2a0558[_0x824f('0x18')]()]+']',_0x52e513['message']);_0x555f5b(_0x52e513);});});}function getUser(_0x2d1f3a,_0x1ca365,_0x9dca40){return function(_0x59bbca){return new Promise(function(_0x4f5735,_0x1b8783){var _0x209e1e={'method':'GET','uri':_0x9dca40+'/api/selector/owners','json':!![]};_0x209e1e['headers']=_0x1ca365;logger[_0x824f('0xf')](_0x824f('0x19'));return rp(_0x209e1e)[_0x824f('0x10')](function(_0x1b2c3f){if(_0x1b2c3f){var _0x55a177=_0x1b2c3f[_0x824f('0x11')];var _0x2fd743=![];var _0x4aaefe=null;if(_0x59bbca['agentEmail']!==null){logger[_0x824f('0xf')](_0x824f('0x1a'),_0x59bbca[_0x824f('0x1b')]);_0x59bbca[_0x824f('0x1c')]=_0x59bbca['agentEmail'];for(_0x4aaefe=0x0;_0x4aaefe<_0x55a177[_0x824f('0x1d')];_0x4aaefe++){if(_0x55a177[_0x4aaefe][_0x824f('0x12')]===_0x59bbca[_0x824f('0x1b')]){_0x2fd743=!![];_0x59bbca['userId']=_0x55a177[_0x4aaefe]['id'];logger[_0x824f('0xf')]('User\x20found:',_0x59bbca[_0x824f('0x1e')]);}}}if(!_0x2fd743){logger[_0x824f('0xf')]('Admin\x20selected');_0x59bbca[_0x824f('0x1c')]=_0x59bbca[_0x824f('0x13')];_0x59bbca[_0x824f('0x1e')]=_0x59bbca['adminId'];_0x2fd743=!![];}if(_0x2fd743){_0x4f5735(_0x59bbca);}else{_0x1b8783({'statusCode':0x194,'message':_0x824f('0x16')});}}else{_0x1b8783({'statusCode':0x194,'message':_0x824f('0x16')});}})[_0x824f('0x1f')](function(_0x417289){logger[_0x824f('0x17')]('['+[_0x2d1f3a[_0x824f('0x18')]()]+']',_0x417289[_0x824f('0x20')]);_0x1b8783(_0x417289);});});};}function searchContact(_0x3e9875,_0xe94dd3,_0x52fdf8,_0x22b1ed){return new Promise(function(_0x13e61a,_0x3e5b19){var _0x52992c={'method':'GET','headers':_0xe94dd3,'uri':_0x3e9875+_0x824f('0x21')+_0x22b1ed+_0x824f('0x22')+_0x52fdf8+_0x824f('0x23'),'json':!![]};rp(_0x52992c)[_0x824f('0x10')](function(_0x344e61){var _0x30cb2d=_['find'](_0x344e61[_0x824f('0x24')][_0x824f('0x24')],[_0x52fdf8,_0x22b1ed]);_0x13e61a(_0x30cb2d);})[_0x824f('0x1f')](function(_0x332f0f){_0x3e5b19(_0x332f0f);});});}function getEndUser(_0x1681b1,_0x20b6ee,_0x4f3ce7){return function(_0x33020e){return new Promise(function(_0x33cce7,_0x248a49){logger[_0x824f('0xf')](util[_0x824f('0x25')](_0x824f('0x26'),_0x33020e['contactNumber']));searchContact(_0x4f3ce7,_0x20b6ee,'mobile_number',_0x33020e[_0x824f('0x27')])[_0x824f('0x10')](function(_0x2cef32){if(_0x2cef32){_0x33020e['endUserId']=_0x2cef32['id'];logger[_0x824f('0xf')](_0x824f('0x28'),_0x33020e['endUserId']);return _0x33cce7(_0x33020e);}searchContact(_0x4f3ce7,_0x20b6ee,_0x824f('0x29'),_0x33020e[_0x824f('0x27')])['then'](function(_0x5dfffc){if(_0x5dfffc){_0x33020e['endUserId']=_0x5dfffc['id'];logger[_0x824f('0xf')](_0x824f('0x2a'),_0x33020e[_0x824f('0x2b')]);return _0x33cce7(_0x33020e);}createEndUser(_0x33020e,_0x1681b1,_0x20b6ee,_0x4f3ce7)[_0x824f('0x10')](function(_0x23f2ed){logger[_0x824f('0xf')]('Contact\x20created:',_0x23f2ed[_0x824f('0x2b')]);return _0x33cce7(_0x23f2ed);});});})[_0x824f('0x1f')](function(_0x17ae50){_0x248a49(_0x17ae50);});});};}function createEndUser(_0x4f898a,_0x1b9dd7,_0x2b2ccf,_0x19bab0){return new Promise(function(_0x2d3e1f,_0x49ce29){var _0x1076b4=moment();var _0xaec4e8={'method':_0x824f('0x2c'),'uri':_0x19bab0+'/api/contacts','body':{'contact':{'last_name':_0x4f898a[_0x824f('0x27')],'work_number':_0x4f898a[_0x824f('0x27')],'mobile_number':_0x4f898a['contactNumber'],'owner_id':_0x4f898a[_0x824f('0x1e')],'created_at':_0x1076b4[_0x824f('0x25')](_0x824f('0x2d'))}},'json':!![]};_0xaec4e8[_0x824f('0x2e')]=_0x2b2ccf;logger[_0x824f('0xf')](_0x824f('0x2f'));return rp(_0xaec4e8)[_0x824f('0x10')](function(_0x504af2){_0x4f898a[_0x824f('0x2b')]=_0x504af2[_0x824f('0x30')]['id'];_0x2d3e1f(_0x4f898a);})[_0x824f('0x1f')](function(_0xfb3e8d){logger[_0x824f('0x17')]('['+[_0x1b9dd7['toUpperCase']()]+']',_0xfb3e8d[_0x824f('0x20')]);_0x49ce29(_0xfb3e8d[_0x824f('0x20')]);});});}function getTicket(_0x667f47,_0x235d15,_0x3e980f,_0x353326,_0x40e506){return function(_0x33906f){logger[_0x824f('0xf')](_0x824f('0x31'));return new Promise(function(_0x51ce0b,_0xd1f883){var _0x58ecfd=moment();var _0x1484e7={'method':_0x824f('0x2c'),'uri':_0x3e980f+_0x824f('0x32'),'body':{'title':intUtil[_0x824f('0x33')](_0x353326[_0x824f('0x34')],_0x40e506,'\x20'),'description':intUtil[_0x824f('0x33')](_0x353326['Descriptions'],_0x40e506,'\x0a'),'owner_id':_0x33906f[_0x824f('0x1e')],'creater_id':_0x33906f['adminId'],'targetable_id':_0x33906f[_0x824f('0x2b')],'targetable_type':_0x824f('0x35'),'created_at':_0x58ecfd[_0x824f('0x25')](_0x824f('0x2d')),'due_date':_0x58ecfd['add'](0x1e,'m')[_0x824f('0x25')](_0x824f('0x2d'))},'json':!![]};_0x1484e7[_0x824f('0x2e')]=_0x235d15;return rp(_0x1484e7)['then'](function(_0x11d194){_0x33906f[_0x824f('0x36')]=_0x11d194[_0x824f('0x37')]['id'];logger[_0x824f('0xf')](_0x824f('0x38'),_0x33906f[_0x824f('0x36')]);_0x51ce0b(_0x33906f);})['catch'](function(_0x40b982){logger[_0x824f('0x17')]('['+[_0x667f47[_0x824f('0x18')]()]+']',_0x40b982[_0x824f('0x20')]);_0xd1f883(_0x40b982[_0x824f('0x20')]);});});};}function emit(_0x5ffe0a,_0x216a18,_0x1d542e){var _0x4679ea={'uri':_0x5ffe0a+_0x824f('0x39')+_0x1d542e};io['to'](util['format'](_0x824f('0x3a'),_0x216a18))[_0x824f('0x3b')](_0x824f('0x3c'),_0x4679ea);}exports['cs']=function(_0x2fcd23,_0x5f3c70,_0x3034fd,_0x5ab835,_0x270298,_0x56b2bf,_0x173e9d,_0x1e152f){var _0x3df2d5={};var _0x54cd81={'Authorization':_0x824f('0x3d')+_0x56b2bf[_0x824f('0x3e')]};_0x56b2bf[_0x824f('0x3f')]=intUtil['stripTrailingSlash'](_0x56b2bf[_0x824f('0x3f')]);_0x56b2bf['serverUrl']=intUtil['stripTrailingSlash'](_0x56b2bf[_0x824f('0x40')]);var _0x176ec9=_0x56b2bf[_0x824f('0x3f')];_0x3df2d5[_0x824f('0x13')]=_0x56b2bf['username'];_0x3df2d5['contactNumber']=_0x1e152f['toLowerCase']()==='outbound'?_0x5f3c70[_0x824f('0x41')]:_0x5f3c70[_0x824f('0x42')];_0x3df2d5['callDirection']=_0x1e152f===_0x824f('0x43')||_0x1e152f===_0x824f('0x44')?_0x824f('0x43'):'outbound';if(_0x5ab835){_0x3df2d5[_0x824f('0x1b')]=_0x5ab835[_0x824f('0x12')];}var _0x2ec415=util[_0x824f('0x25')](_0x824f('0x45'),_0x56b2bf['serverUrl'],_0x5f3c70[_0x824f('0x46')],md5(_0x5f3c70[_0x824f('0x46')]));if(_0x270298&&_0x270298[_0x824f('0x47')]){logger[_0x824f('0xf')](_0x824f('0x48'),_0x824f('0x49'));_0x5f3c70[_0x824f('0x4a')]=_0x2ec415;}else if(_0x173e9d&&_0x173e9d[_0x824f('0x4b')]&&_0x173e9d[_0x824f('0x4b')]!==_0x824f('0x4c')){logger[_0x824f('0xf')](_0x824f('0x4d'),_0x824f('0x49'));_0x5f3c70[_0x824f('0x4a')]=_0x2ec415;}else{_0x5f3c70[_0x824f('0x4a')]='';}return getAdminId(_0x3df2d5,_0x1e152f,_0x54cd81,_0x176ec9)[_0x824f('0x10')](getUser(_0x1e152f,_0x54cd81,_0x176ec9))[_0x824f('0x10')](getEndUser(_0x1e152f,_0x54cd81,_0x176ec9))[_0x824f('0x10')](getTicket(_0x1e152f,_0x54cd81,_0x176ec9,_0x3034fd,_0x5f3c70))[_0x824f('0x10')](function(_0x230c1c){logger[_0x824f('0xf')](util[_0x824f('0x25')](_0x824f('0x4e'),_0x230c1c[_0x824f('0x36')]));if(_0x1e152f!==_0x824f('0x44')){logger[_0x824f('0xf')]('['+[_0x1e152f['toUpperCase']()]+']',_0x824f('0x4f'));emit(_0x176ec9,_0x5ab835[_0x824f('0x50')],_0x230c1c[_0x824f('0x2b')]);}})[_0x824f('0x1f')](function(_0x20b8c2){logger[_0x824f('0x17')]('['+[_0x1e152f['toUpperCase']()]+_0x824f('0x51'),util[_0x824f('0x52')](_0x20b8c2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2f9a=['inspect','lodash','request-promise','md5','moment','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','GET','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','message','&f=','&entities=contact','then','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration'];(function(_0x46f17a,_0x4d72c8){var _0x580d30=function(_0x5e7781){while(--_0x5e7781){_0x46f17a['push'](_0x46f17a['shift']());}};_0x580d30(++_0x4d72c8);}(_0x2f9a,0x1ed));var _0xa2f9=function(_0x5f1cf7,_0x47d9a9){_0x5f1cf7=_0x5f1cf7-0x0;var _0x2ab77b=_0x2f9a[_0x5f1cf7];return _0x2ab77b;};'use strict';var _=require(_0xa2f9('0x0'));var rp=require(_0xa2f9('0x1'));var md5=require(_0xa2f9('0x2'));var util=require('util');var moment=require(_0xa2f9('0x3'));var Promise=require('bluebird');var Redis=require(_0xa2f9('0x4'));var intUtil=require(_0xa2f9('0x5'));var config=require('../../../../config/environment');var logger=require(_0xa2f9('0x6'))('freshsales');config[_0xa2f9('0x7')]=_['defaults'](config[_0xa2f9('0x7')],{'host':_0xa2f9('0x8'),'port':0x18eb});var io=require(_0xa2f9('0x9'))(new Redis(config[_0xa2f9('0x7')]));function getAdminId(_0x1a63f2,_0x255faa,_0x3d7cdc,_0x44d3d9){return new Promise(function(_0x11c094,_0x174e29){var _0x55317b=![];var _0x304414={'method':'GET','uri':_0x44d3d9+_0xa2f9('0xa'),'json':!![]};_0x304414[_0xa2f9('0xb')]=_0x3d7cdc;logger[_0xa2f9('0xc')](_0xa2f9('0xd'));return rp(_0x304414)['then'](function(_0x5b1e8){if(_0x5b1e8){var _0x37eba3=_0x5b1e8[_0xa2f9('0xe')];var _0x545638=null;for(_0x545638=0x0;_0x545638<_0x37eba3[_0xa2f9('0xf')];_0x545638++){if(_0x37eba3[_0x545638][_0xa2f9('0x10')]===_0x1a63f2[_0xa2f9('0x11')]){_0x1a63f2[_0xa2f9('0x12')]=_0x37eba3[_0x545638]['id'];_0x55317b=!![];}}if(_0x55317b){logger[_0xa2f9('0xc')]('Admin\x20found:',_0x1a63f2[_0xa2f9('0x12')]);_0x11c094(_0x1a63f2);}else{_0x174e29({'statusCode':0x194,'message':_0xa2f9('0x13')});}}else{_0x174e29({'statusCode':0x194,'message':_0xa2f9('0x13')});}})[_0xa2f9('0x14')](function(_0x11cb2c){logger[_0xa2f9('0x15')]('['+[_0x255faa['toUpperCase']()]+']',_0x11cb2c['message']);_0x174e29(_0x11cb2c);});});}function getUser(_0x2f9551,_0x2eec8b,_0x34a02d){return function(_0x3381c6){return new Promise(function(_0x1f60af,_0x2616fb){var _0x5badcd={'method':_0xa2f9('0x16'),'uri':_0x34a02d+_0xa2f9('0xa'),'json':!![]};_0x5badcd[_0xa2f9('0xb')]=_0x2eec8b;logger[_0xa2f9('0xc')](_0xa2f9('0x17'));return rp(_0x5badcd)['then'](function(_0x1b77d5){if(_0x1b77d5){var _0x1c840d=_0x1b77d5[_0xa2f9('0xe')];var _0x3b24af=![];var _0x5684b7=null;if(_0x3381c6['agentEmail']!==null){logger['info'](_0xa2f9('0x18'),_0x3381c6[_0xa2f9('0x19')]);_0x3381c6[_0xa2f9('0x1a')]=_0x3381c6[_0xa2f9('0x19')];for(_0x5684b7=0x0;_0x5684b7<_0x1c840d[_0xa2f9('0xf')];_0x5684b7++){if(_0x1c840d[_0x5684b7][_0xa2f9('0x10')]===_0x3381c6['agentEmail']){_0x3b24af=!![];_0x3381c6[_0xa2f9('0x1b')]=_0x1c840d[_0x5684b7]['id'];logger[_0xa2f9('0xc')](_0xa2f9('0x1c'),_0x3381c6[_0xa2f9('0x1b')]);}}}if(!_0x3b24af){logger[_0xa2f9('0xc')](_0xa2f9('0x1d'));_0x3381c6[_0xa2f9('0x1a')]=_0x3381c6['adminEmail'];_0x3381c6[_0xa2f9('0x1b')]=_0x3381c6[_0xa2f9('0x12')];_0x3b24af=!![];}if(_0x3b24af){_0x1f60af(_0x3381c6);}else{_0x2616fb({'statusCode':0x194,'message':_0xa2f9('0x13')});}}else{_0x2616fb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa2f9('0x14')](function(_0x172cd1){logger[_0xa2f9('0x15')]('['+[_0x2f9551[_0xa2f9('0x1e')]()]+']',_0x172cd1[_0xa2f9('0x1f')]);_0x2616fb(_0x172cd1);});});};}function searchContact(_0x2794f6,_0x139a96,_0x3dbed3,_0x169dc0){return new Promise(function(_0x29c359,_0x4ad6fb){var _0x3656cc={'method':_0xa2f9('0x16'),'headers':_0x139a96,'uri':_0x2794f6+'/api/lookup?q='+_0x169dc0+_0xa2f9('0x20')+_0x3dbed3+_0xa2f9('0x21'),'json':!![]};rp(_0x3656cc)[_0xa2f9('0x22')](function(_0x19083a){var _0x2b6204=_['find'](_0x19083a['contacts']['contacts'],[_0x3dbed3,_0x169dc0]);_0x29c359(_0x2b6204);})['catch'](function(_0x47d546){_0x4ad6fb(_0x47d546);});});}function getEndUser(_0x3e5442,_0xd32a75,_0x372eb2){return function(_0x1d140d){return new Promise(function(_0x2bcaa9,_0xdb65ad){logger[_0xa2f9('0xc')](util[_0xa2f9('0x23')](_0xa2f9('0x24'),_0x1d140d[_0xa2f9('0x25')]));searchContact(_0x372eb2,_0xd32a75,'mobile_number',_0x1d140d[_0xa2f9('0x25')])[_0xa2f9('0x22')](function(_0x189f10){if(_0x189f10){_0x1d140d[_0xa2f9('0x26')]=_0x189f10['id'];logger[_0xa2f9('0xc')](_0xa2f9('0x27'),_0x1d140d[_0xa2f9('0x26')]);return _0x2bcaa9(_0x1d140d);}searchContact(_0x372eb2,_0xd32a75,_0xa2f9('0x28'),_0x1d140d[_0xa2f9('0x25')])[_0xa2f9('0x22')](function(_0x27430b){if(_0x27430b){_0x1d140d['endUserId']=_0x27430b['id'];logger[_0xa2f9('0xc')](_0xa2f9('0x29'),_0x1d140d[_0xa2f9('0x26')]);return _0x2bcaa9(_0x1d140d);}createEndUser(_0x1d140d,_0x3e5442,_0xd32a75,_0x372eb2)[_0xa2f9('0x22')](function(_0x351700){logger[_0xa2f9('0xc')](_0xa2f9('0x2a'),_0x351700[_0xa2f9('0x26')]);return _0x2bcaa9(_0x351700);});});})[_0xa2f9('0x14')](function(_0xe33c78){_0xdb65ad(_0xe33c78);});});};}function createEndUser(_0x278b65,_0x4261e4,_0x1e6118,_0x5333b1){return new Promise(function(_0x481149,_0x582c43){var _0x2a33ee=moment();var _0x1b79f2={'method':_0xa2f9('0x2b'),'uri':_0x5333b1+'/api/contacts','body':{'contact':{'last_name':_0x278b65[_0xa2f9('0x25')],'work_number':_0x278b65['contactNumber'],'mobile_number':_0x278b65[_0xa2f9('0x25')],'owner_id':_0x278b65['userId'],'created_at':_0x2a33ee[_0xa2f9('0x23')](_0xa2f9('0x2c'))}},'json':!![]};_0x1b79f2['headers']=_0x1e6118;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1b79f2)[_0xa2f9('0x22')](function(_0x5c768e){_0x278b65['endUserId']=_0x5c768e['contact']['id'];_0x481149(_0x278b65);})[_0xa2f9('0x14')](function(_0x55d39b){logger[_0xa2f9('0x15')]('['+[_0x4261e4[_0xa2f9('0x1e')]()]+']',_0x55d39b[_0xa2f9('0x1f')]);_0x582c43(_0x55d39b['message']);});});}function getTicket(_0x25c760,_0x338575,_0x4047d4,_0x2c3d59,_0x4aa2f9){return function(_0xc20b35){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x128049,_0x3a3f24){var _0x8ff32c=moment();var _0x37b5f7={'method':_0xa2f9('0x2b'),'uri':_0x4047d4+_0xa2f9('0x2d'),'body':{'title':intUtil[_0xa2f9('0x2e')](_0x2c3d59[_0xa2f9('0x2f')],_0x4aa2f9,'\x20'),'description':intUtil[_0xa2f9('0x2e')](_0x2c3d59[_0xa2f9('0x30')],_0x4aa2f9,'\x0a'),'owner_id':_0xc20b35[_0xa2f9('0x1b')],'creater_id':_0xc20b35['adminId'],'targetable_id':_0xc20b35[_0xa2f9('0x26')],'targetable_type':_0xa2f9('0x31'),'created_at':_0x8ff32c[_0xa2f9('0x23')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x8ff32c[_0xa2f9('0x32')](0x1e,'m')[_0xa2f9('0x23')](_0xa2f9('0x2c'))},'json':!![]};_0x37b5f7[_0xa2f9('0xb')]=_0x338575;return rp(_0x37b5f7)[_0xa2f9('0x22')](function(_0x49f872){_0xc20b35[_0xa2f9('0x33')]=_0x49f872[_0xa2f9('0x34')]['id'];logger[_0xa2f9('0xc')](_0xa2f9('0x35'),_0xc20b35[_0xa2f9('0x33')]);_0x128049(_0xc20b35);})[_0xa2f9('0x14')](function(_0x19e832){logger[_0xa2f9('0x15')]('['+[_0x25c760[_0xa2f9('0x1e')]()]+']',_0x19e832[_0xa2f9('0x1f')]);_0x3a3f24(_0x19e832[_0xa2f9('0x1f')]);});});};}function emit(_0x25adcd,_0x5a6b6d,_0x527b2f){var _0x5d3f9c={'uri':_0x25adcd+_0xa2f9('0x36')+_0x527b2f};io['to'](util[_0xa2f9('0x23')](_0xa2f9('0x37'),_0x5a6b6d))[_0xa2f9('0x38')]('trigger:browser:url',_0x5d3f9c);}exports['cs']=function(_0x3cc3d8,_0x3dff4c,_0x151e5e,_0x3a9521,_0x4872e3,_0x3c8aa8,_0x402440,_0x1c5625){var _0x29d19d={};var _0x171068={'Authorization':_0xa2f9('0x39')+_0x3c8aa8[_0xa2f9('0x3a')]};_0x3c8aa8[_0xa2f9('0x3b')]=intUtil['stripTrailingSlash'](_0x3c8aa8[_0xa2f9('0x3b')]);_0x3c8aa8[_0xa2f9('0x3c')]=intUtil[_0xa2f9('0x3d')](_0x3c8aa8[_0xa2f9('0x3c')]);var _0x47062e=_0x3c8aa8[_0xa2f9('0x3b')];_0x29d19d['adminEmail']=_0x3c8aa8[_0xa2f9('0x3e')];_0x29d19d[_0xa2f9('0x25')]=_0x1c5625[_0xa2f9('0x3f')]()===_0xa2f9('0x40')?_0x3dff4c[_0xa2f9('0x41')]:_0x3dff4c[_0xa2f9('0x42')];_0x29d19d[_0xa2f9('0x43')]=_0x1c5625===_0xa2f9('0x44')||_0x1c5625===_0xa2f9('0x45')?_0xa2f9('0x44'):_0xa2f9('0x40');if(_0x3a9521){_0x29d19d[_0xa2f9('0x19')]=_0x3a9521[_0xa2f9('0x10')];}var _0x48d401=util[_0xa2f9('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c8aa8[_0xa2f9('0x3c')],_0x3dff4c['uniqueid'],md5(_0x3dff4c[_0xa2f9('0x46')]));if(_0x4872e3&&_0x4872e3[_0xa2f9('0x47')]){logger[_0xa2f9('0xc')](_0xa2f9('0x48'),'Recording\x20is\x20enabled!');_0x3dff4c[_0xa2f9('0x49')]=_0x48d401;}else if(_0x402440&&_0x402440[_0xa2f9('0x4a')]&&_0x402440[_0xa2f9('0x4a')]!=='none'){logger[_0xa2f9('0xc')](_0xa2f9('0x4b'),_0xa2f9('0x4c'));_0x3dff4c[_0xa2f9('0x49')]=_0x48d401;}else{_0x3dff4c[_0xa2f9('0x49')]='';}return getAdminId(_0x29d19d,_0x1c5625,_0x171068,_0x47062e)[_0xa2f9('0x22')](getUser(_0x1c5625,_0x171068,_0x47062e))[_0xa2f9('0x22')](getEndUser(_0x1c5625,_0x171068,_0x47062e))[_0xa2f9('0x22')](getTicket(_0x1c5625,_0x171068,_0x47062e,_0x151e5e,_0x3dff4c))[_0xa2f9('0x22')](function(_0x31f6fd){logger[_0xa2f9('0xc')](util['format'](_0xa2f9('0x4d'),_0x31f6fd[_0xa2f9('0x33')]));if(_0x1c5625!=='unmanaged'){logger[_0xa2f9('0xc')]('['+[_0x1c5625[_0xa2f9('0x1e')]()]+']',_0xa2f9('0x4e'));emit(_0x47062e,_0x3a9521[_0xa2f9('0x4f')],_0x31f6fd[_0xa2f9('0x26')]);}})[_0xa2f9('0x14')](function(_0x576fc8){logger[_0xa2f9('0x15')]('['+[_0x1c5625[_0xa2f9('0x1e')]()]+_0xa2f9('0x50'),util[_0xa2f9('0x51')](_0x576fc8,{'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 79249db..3f5d3ef 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 _0x4ede=['desk','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','lodash','util','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','data2','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4ede,0xfc));var _0xe4ed=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4ede[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xe4ed('0x0'));var util=require(_0xe4ed('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xe4ed('0x2'));var freshdesk=require(_0xe4ed('0x3'));var zoho=require('./zoho');var desk=require(_0xe4ed('0x4'));var vtiger=require(_0xe4ed('0x5'));var servicenow=require(_0xe4ed('0x6'));var dynamics365=require(_0xe4ed('0x7'));var freshsales=require('./freshsales');var integrations=[_0xe4ed('0x8'),_0xe4ed('0x9'),_0xe4ed('0xa'),_0xe4ed('0xb'),_0xe4ed('0xc'),'desk',_0xe4ed('0xd'),_0xe4ed('0xe'),_0xe4ed('0xf'),_0xe4ed('0x10')];exports[_0xe4ed('0x11')]=function(_0x2d0eca,_0x6a7e1f,_0x53d6ec,_0x4ee374,_0x3d7a1f,_0x327ef2){if(_0x53d6ec){if(_[_0xe4ed('0x12')](integrations,_0x2d0eca['data1'][_0xe4ed('0x13')]())){try{var _0xef7fa5=null;var _0x445691='';var _0x5a2ba5=_0x53d6ec[_0x2d0eca[_0xe4ed('0x14')][_0xe4ed('0x13')]()];if(_0x5a2ba5){var _0x1643fc=_0x5a2ba5[_0x2d0eca[_0xe4ed('0x15')]];if(_0x1643fc){var _0x5ca143=_['find'](_0x1643fc['Configurations'],{'id':parseInt(_0x2d0eca['data3'],0xa)});if(_0x5ca143){if(_0x4ee374){if(_0x3d7a1f&&_0x6a7e1f[_0xe4ed('0x16')]){_0x445691=_0xe4ed('0x16');}else if(_0x6a7e1f[_0xe4ed('0x17')]){_0x445691=_0xe4ed('0x18');}else{console[_0xe4ed('0x19')](_0xe4ed('0x1a'),_0x6a7e1f);}}else{_0x445691=_0xe4ed('0x1b');}switch(_0x2d0eca[_0xe4ed('0x14')][_0xe4ed('0x13')]()){case _0xe4ed('0x8'):zendesk[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case'salesforce':salesforce[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case _0xe4ed('0xa'):sugarcrm[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case _0xe4ed('0xb'):freshdesk[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case'zoho':zoho[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case _0xe4ed('0x1c'):desk[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case'vtiger':vtiger[_0x445691](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2);break;case _0xe4ed('0xf'):freshsales['cs'](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2,_0x445691);break;case _0xe4ed('0x10'):servicenow['cs'](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2,_0x445691);break;case _0xe4ed('0xe'):dynamics365['cs'](_0x2d0eca,_0x6a7e1f,_0x5ca143,_0x4ee374,_0x3d7a1f,_0x1643fc,_0x327ef2,_0x445691);break;default:console[_0xe4ed('0x19')]('unknown\x20integration');}}else{_0xef7fa5=require(_0xe4ed('0x1d'))(_0x2d0eca[_0xe4ed('0x14')]['toLowerCase']());_0xef7fa5[_0xe4ed('0x1e')](_0xe4ed('0x1f'),util[_0xe4ed('0x20')](_0xe4ed('0x21'),_0x2d0eca[_0xe4ed('0x14')][_0xe4ed('0x13')](),_0x2d0eca[_0xe4ed('0x22')]));}}else{_0xef7fa5=require(_0xe4ed('0x1d'))(_0x2d0eca[_0xe4ed('0x14')][_0xe4ed('0x13')]());_0xef7fa5[_0xe4ed('0x1e')](_0xe4ed('0x1f'),util[_0xe4ed('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x2d0eca['data1'][_0xe4ed('0x13')](),_0x2d0eca[_0xe4ed('0x15')]));}}else{}}catch(_0x273083){console[_0xe4ed('0x1e')](_0x273083);}}}}; \ No newline at end of file +var _0x6ab0=['zoho','desk','vtiger','dynamics365','servicenow','exec','data1','toLowerCase','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','freshdesk'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x6ab0,0xea));var _0x06ab=function(_0x1f5a33,_0x48611d){_0x1f5a33=_0x1f5a33-0x0;var _0x2cbf36=_0x6ab0[_0x1f5a33];return _0x2cbf36;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x06ab('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x06ab('0x3'));var zoho=require(_0x06ab('0x4'));var desk=require(_0x06ab('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x06ab('0x6'));var dynamics365=require(_0x06ab('0x7'));var freshsales=require('./freshsales');var integrations=[_0x06ab('0x8'),_0x06ab('0x9'),'sugarcrm',_0x06ab('0xa'),_0x06ab('0xb'),_0x06ab('0xc'),_0x06ab('0xd'),_0x06ab('0xe'),'freshsales',_0x06ab('0xf')];exports[_0x06ab('0x10')]=function(_0x3f23f0,_0x1e4346,_0x59c939,_0x6c9158,_0x4948d1,_0x559294){if(_0x59c939){if(_['includes'](integrations,_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')]())){try{var _0x43260b=null;var _0x26cd43='';var _0x20d5b7=_0x59c939[_0x3f23f0['data1'][_0x06ab('0x12')]()];if(_0x20d5b7){var _0x1114ef=_0x20d5b7[_0x3f23f0[_0x06ab('0x13')]];if(_0x1114ef){var _0x1bf1ec=_['find'](_0x1114ef['Configurations'],{'id':parseInt(_0x3f23f0[_0x06ab('0x14')],0xa)});if(_0x1bf1ec){if(_0x6c9158){if(_0x4948d1&&_0x1e4346[_0x06ab('0x15')]){_0x26cd43=_0x06ab('0x15');}else if(_0x1e4346[_0x06ab('0x16')]){_0x26cd43=_0x06ab('0x17');}else{console[_0x06ab('0x18')](_0x06ab('0x19'),_0x1e4346);}}else{_0x26cd43=_0x06ab('0x1a');}switch(_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')]()){case _0x06ab('0x8'):zendesk[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case'salesforce':salesforce[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case _0x06ab('0x1b'):sugarcrm[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case _0x06ab('0xa'):freshdesk[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case'zoho':zoho[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case _0x06ab('0xc'):desk[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case _0x06ab('0xd'):vtiger[_0x26cd43](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294);break;case _0x06ab('0x1c'):freshsales['cs'](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294,_0x26cd43);break;case _0x06ab('0xf'):servicenow['cs'](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294,_0x26cd43);break;case'dynamics365':dynamics365['cs'](_0x3f23f0,_0x1e4346,_0x1bf1ec,_0x6c9158,_0x4948d1,_0x1114ef,_0x559294,_0x26cd43);break;default:console[_0x06ab('0x18')](_0x06ab('0x1d'));}}else{_0x43260b=require(_0x06ab('0x1e'))(_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')]());_0x43260b[_0x06ab('0x1f')](_0x06ab('0x20'),util[_0x06ab('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')](),_0x3f23f0[_0x06ab('0x14')]));}}else{_0x43260b=require('../../../../config/logger')(_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')]());_0x43260b[_0x06ab('0x1f')](_0x06ab('0x20'),util[_0x06ab('0x21')](_0x06ab('0x22'),_0x3f23f0[_0x06ab('0x11')][_0x06ab('0x12')](),_0x3f23f0[_0x06ab('0x13')]));}}else{}}catch(_0x429c8b){console['error'](_0x429c8b);}}}}; \ 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 f06fb23..9efabcd 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 _0xfd4f=['Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','user:%s','instanceUrl','catch','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','integrationTab','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','toUpperCase','isNil','calleridname','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','util','./util','../../../../config/logger','salesforce','defaults','redis','assign','getString','Subjects','Descriptions','utc','endUserType','contact','lead','WhoId','account','WhatId','ticketType','ContactId','leadId','info','create','validateEmail','sobject','User','then','length','find','Email','Agent\x20%s\x20found.'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0xfd4f,0x1cc));var _0xffd4=function(_0x2055b0,_0x4e7f62){_0x2055b0=_0x2055b0-0x0;var _0x3f3306=_0xfd4f[_0x2055b0];return _0x3f3306;};'use strict';var _=require(_0xffd4('0x0'));var rp=require(_0xffd4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xffd4('0x2'));var Redis=require('ioredis');var intUtil=require(_0xffd4('0x3'));var config=require('../../../../config/environment');var logger=require(_0xffd4('0x4'))(_0xffd4('0x5'));config['redis']=_[_0xffd4('0x6')](config[_0xffd4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xffd4('0x7')]));function emit(_0xc52e9,_0x173df5,_0x5933f4){io['to'](_0xc52e9)['emit'](_0x173df5,_0x5933f4);}function getTicket(_0x1b909b,_0x1662ba,_0x286fc1,_0x5270ab,_0x4bbda9,_0x50a4a1,_0x439463,_0x1626bf){var _0x122a02=Object[_0xffd4('0x8')]({},{'OwnerId':_0x1662ba['id'],'Subject':intUtil[_0xffd4('0x9')](_0x5270ab[_0xffd4('0xa')],_0x4bbda9,'\x20'),'Description':intUtil[_0xffd4('0x9')](_0x5270ab[_0xffd4('0xb')],_0x4bbda9,'\x0a')},getCustomFields(_0x50a4a1,_0x4bbda9));if(_0x286fc1){if(_0x5270ab['ticketType']==='Task'){_0x122a02['ActivityDate']=moment[_0xffd4('0xc')]();_0x122a02['IsReminderSet']=![];_0x122a02['IsRecurrence']=![];if(_0x286fc1[_0xffd4('0xd')]===_0xffd4('0xe')||_0x286fc1[_0xffd4('0xd')]===_0xffd4('0xf')){_0x122a02[_0xffd4('0x10')]=_0x286fc1['id'];}else if(_0x286fc1[_0xffd4('0xd')]===_0xffd4('0x11')){_0x122a02[_0xffd4('0x12')]=_0x286fc1['id'];}}else if(_0x5270ab[_0xffd4('0x13')]==='Case'){if(_0x286fc1[_0xffd4('0xd')]===_0xffd4('0xe')){_0x122a02[_0xffd4('0x14')]=_0x286fc1['id'];}else if(_0x286fc1[_0xffd4('0xd')]==='account'){_0x122a02['AccountId']=_0x286fc1['id'];}else if(_0x286fc1[_0xffd4('0xd')]==='lead'&&_0x5270ab[_0xffd4('0x15')]){_0x122a02[_0x5270ab[_0xffd4('0x15')]]=_0x286fc1['id'];}else{logger[_0xffd4('0x16')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x439463['sobject'](_0x5270ab[_0xffd4('0x13')])[_0xffd4('0x17')](_0x122a02);}function getUser(_0x5e3de4,_0x37eafc,_0x45c3be){if(!_['isNil'](_0x37eafc)&&intUtil[_0xffd4('0x18')](_0x37eafc)){var _0x5ee141={'Email':_0x37eafc};var _0x2d4e00={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x45c3be[_0xffd4('0x19')](_0xffd4('0x1a'))['find'](_0x5ee141,_0x2d4e00)['execute']()[_0xffd4('0x1b')](function(_0x2923c7){if(_0x2923c7[_0xffd4('0x1c')]){var _0x579849=_[_0xffd4('0x1d')](_0x2923c7,function(_0x35c2fe){return _0x35c2fe[_0xffd4('0x1e')]===_0x37eafc;});if(_0x579849){logger[_0xffd4('0x16')](_0xffd4('0x1f'),_0x37eafc);return BPromise['resolve']({'id':_0x579849['Id'],'name':_0x579849[_0xffd4('0x20')]});}}else{logger[_0xffd4('0x16')](_0xffd4('0x21'),_0x37eafc);return _0x45c3be[_0xffd4('0x22')]()[_0xffd4('0x1b')](function(_0x16f793){return BPromise[_0xffd4('0x23')]({'id':_0x16f793[_0xffd4('0x24')],'name':_0x16f793[_0xffd4('0x25')]});});}});}else{logger[_0xffd4('0x16')](_0xffd4('0x21'),_0x37eafc);return _0x45c3be[_0xffd4('0x22')]()[_0xffd4('0x1b')](function(_0x124c89){return BPromise['resolve']({'id':_0x124c89[_0xffd4('0x24')],'name':_0x124c89['display_name']});});}}function getEndUser(_0x3c850d,_0x4a6500,_0x1792b4,_0x96a731,_0x2f9b12){var _0x1562ab={'$or':{'Phone':_0x96a731}};var _0x2c6d27={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xffd4('0x23')]()[_0xffd4('0x1b')](function(){logger[_0xffd4('0x16')](_0xffd4('0x26'),_0x96a731,_0x4a6500[_0xffd4('0x27')]);switch(_0x4a6500[_0xffd4('0x27')]){case _0xffd4('0x28'):var _0x1b0a40=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500['additionalSearchContact']){var _0x1d25fd={};_0x1d25fd[_0x4a6500[_0xffd4('0x2a')]]=_0x96a731;_[_0xffd4('0x2b')](_0x1b0a40[_0xffd4('0x2c')],_0x1d25fd);}return _0x2f9b12[_0xffd4('0x19')](_0xffd4('0x2d'))[_0xffd4('0x1d')](_0x1b0a40,_0x2c6d27)[_0xffd4('0x2e')]()['then'](function(_0x57f788){if(_0x57f788&&_0x57f788['length']){return _0x57f788;}else{var _0x1bff3e=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500[_0xffd4('0x2f')]){var _0x583b1c={};_0x583b1c[_0x4a6500[_0xffd4('0x2f')]]=_0x96a731;_[_0xffd4('0x2b')](_0x1bff3e[_0xffd4('0x2c')],_0x583b1c);}return _0x2f9b12[_0xffd4('0x19')](_0xffd4('0x30'))['find'](_0x1bff3e,_0x2c6d27);}});case _0xffd4('0x31'):var _0x2cc7aa=_['cloneDeep'](_0x1562ab);if(_0x4a6500[_0xffd4('0x32')]){var _0x1d25fd={};_0x1d25fd[_0x4a6500[_0xffd4('0x32')]]=_0x96a731;_[_0xffd4('0x2b')](_0x2cc7aa[_0xffd4('0x2c')],_0x1d25fd);}return _0x2f9b12[_0xffd4('0x19')](_0xffd4('0x33'))['find'](_0x2cc7aa,_0x2c6d27)[_0xffd4('0x2e')]()[_0xffd4('0x1b')](function(_0x49ac80){if(_0x49ac80&&_0x49ac80[_0xffd4('0x1c')]){return _0x49ac80;}else{var _0x2113a9=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500[_0xffd4('0x2a')]){var _0x4bc95b={};_0x4bc95b[_0x4a6500[_0xffd4('0x2a')]]=_0x96a731;_[_0xffd4('0x2b')](_0x2113a9[_0xffd4('0x2c')],_0x4bc95b);}return _0x2f9b12[_0xffd4('0x19')]('Contact')[_0xffd4('0x1d')](_0x2113a9,_0x2c6d27)[_0xffd4('0x1b')](function(_0x4b5487){if(_0x4b5487&&_0x4b5487[_0xffd4('0x1c')]){return _0x4b5487;}else{var _0xc5d1f6=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500['additionalSearchLead']){var _0x52656b={};_0x52656b[_0x4a6500[_0xffd4('0x2f')]]=_0x96a731;_['merge'](_0xc5d1f6[_0xffd4('0x2c')],_0x52656b);}return _0x2f9b12[_0xffd4('0x19')]('Lead')[_0xffd4('0x1d')](_0xc5d1f6,_0x2c6d27);}});}});case'contact':var _0x1b0a40=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500[_0xffd4('0x2a')]){var _0x1d25fd={};_0x1d25fd[_0x4a6500[_0xffd4('0x2a')]]=_0x96a731;_[_0xffd4('0x2b')](_0x1b0a40[_0xffd4('0x2c')],_0x1d25fd);}return _0x2f9b12[_0xffd4('0x19')](_0xffd4('0x2d'))['find'](_0x1b0a40,_0x2c6d27)[_0xffd4('0x2e')]();case _0xffd4('0xf'):var _0x416a20=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500[_0xffd4('0x2f')]){var _0x1d25fd={};_0x1d25fd[_0x4a6500[_0xffd4('0x2f')]]=_0x96a731;_[_0xffd4('0x2b')](_0x416a20[_0xffd4('0x2c')],_0x1d25fd);}return _0x2f9b12[_0xffd4('0x19')](_0xffd4('0x30'))[_0xffd4('0x1d')](_0x416a20,_0x2c6d27);case _0xffd4('0x11'):var _0x2cc7aa=_[_0xffd4('0x29')](_0x1562ab);if(_0x4a6500['additionalSearchAccount']){var _0x1d25fd={};_0x1d25fd[_0x4a6500[_0xffd4('0x32')]]=_0x96a731;_[_0xffd4('0x2b')](_0x2cc7aa[_0xffd4('0x2c')],_0x1d25fd);}return _0x2f9b12['sobject'](_0xffd4('0x33'))[_0xffd4('0x1d')](_0x2cc7aa,_0x2c6d27);default:return null;}})[_0xffd4('0x1b')](function(_0xc03bcb){if(_0xc03bcb&&_0xc03bcb['length']){var _0x31a4b8=_[_0xffd4('0x34')](_0xc03bcb);if(_0x31a4b8){return BPromise[_0xffd4('0x23')]({'id':_0x31a4b8['Id'],'name':_0x31a4b8['Name'],'phone':_0x31a4b8[_0xffd4('0x35')],'endUserType':_0x31a4b8['attributes'][_0xffd4('0x36')][_0xffd4('0x37')]()});}}})[_0xffd4('0x1b')](function(_0x3ca94a){if(_0x3ca94a){logger[_0xffd4('0x16')](_0xffd4('0x38'),_0x3ca94a[_0xffd4('0xd')],_0x96a731);return BPromise[_0xffd4('0x23')](_0x3ca94a);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x96a731);var _0x4c4cc8={'Phone':_0x96a731};if(_0x4a6500[_0xffd4('0x39')]){if(_0x4a6500[_0xffd4('0x39')]===_0xffd4('0xe')){logger[_0xffd4('0x16')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x96a731,_0x4a6500[_0xffd4('0x39')]);_0x4c4cc8[_0xffd4('0x3a')]=_0x1792b4!==_0xffd4('0x3b')?_0x1792b4:util[_0xffd4('0x3c')]('Caller\x20-\x20%s',_0x96a731);}else if(_0x4a6500['moduleCreate']===_0xffd4('0xf')){logger[_0xffd4('0x16')](_0xffd4('0x3d'),_0x96a731,_0x4a6500[_0xffd4('0x39')]);_0x4c4cc8[_0xffd4('0x3a')]=_0x1792b4!==_0xffd4('0x3b')?_0x1792b4:util['format'](_0xffd4('0x3e'),_0x96a731);_0x4c4cc8[_0xffd4('0x3f')]=_0xffd4('0x40');}else if(_0x4a6500[_0xffd4('0x39')]===_0xffd4('0x11')){logger[_0xffd4('0x16')](_0xffd4('0x3d'),_0x96a731,_0x4a6500[_0xffd4('0x39')]);_0x4c4cc8[_0xffd4('0x20')]=_0x1792b4!==_0xffd4('0x3b')?_0x1792b4:util['format'](_0xffd4('0x3e'),_0x96a731);}else{return null;}}return _0x2f9b12['sobject'](_[_0xffd4('0x41')](_0x4a6500[_0xffd4('0x39')]))[_0xffd4('0x17')](_0x4c4cc8)[_0xffd4('0x1b')](function(_0x34c389){return BPromise[_0xffd4('0x23')]({'id':_0x34c389['id'],'endUserType':_0x4a6500[_0xffd4('0x39')]});});}});}function getCustomFields(_0xb47c72,_0x4531c9){var _0x22b774={};if(_0xb47c72[_0xffd4('0x1c')]>0x0){_[_0xffd4('0x42')](_0xb47c72,function(_0xdb181c){if(_['includes']([_0xffd4('0x43'),_0xffd4('0x44')],_0xdb181c[_0xffd4('0x36')])&&_0xdb181c[_0xffd4('0x45')]){_0x22b774[_0xdb181c[_0xffd4('0x45')]]=_0xdb181c[_0xffd4('0x46')][_0xffd4('0x47')]();}else if(_0xdb181c['type']===_0xffd4('0x48')&&_0xdb181c[_0xffd4('0x49')]&&_0xdb181c[_0xffd4('0x45')]){_0x4531c9[_0xdb181c[_0xffd4('0x49')]]&&(_0x22b774[_0xdb181c['idField']]=_0x4531c9[_0xdb181c[_0xffd4('0x49')]]['toString']());}else if(_0xdb181c[_0xffd4('0x36')]===_0xffd4('0x4a')&&_0xdb181c[_0xffd4('0x4b')]&&_0xdb181c[_0xffd4('0x4b')][_0xffd4('0x4c')]&&_0xdb181c['idField']){_0x4531c9[_0xdb181c['Variable'][_0xffd4('0x4c')][_0xffd4('0x37')]()]&&(_0x22b774[_0xdb181c[_0xffd4('0x45')]]=_0x4531c9[_0xdb181c['Variable'][_0xffd4('0x4c')][_0xffd4('0x37')]()]['toString']());}});}return _0x22b774;}function getConnection(_0x48b467){var _0x530e60=_0x48b467[_0xffd4('0x4d')][_0xffd4('0x4e')](_0x48b467[_0xffd4('0x4f')]);var _0x179e27=new jsforce[(_0xffd4('0x50'))]({'oauth2':{'loginUrl':_0x48b467['remoteUri']||_0xffd4('0x51'),'clientId':_0x48b467['clientId'],'clientSecret':_0x48b467[_0xffd4('0x52')]}});return _0x179e27[_0xffd4('0x53')](_0x48b467[_0xffd4('0x54')],_0x530e60)['then'](function(){logger['info'](_0xffd4('0x55'));return _0x179e27;});}exports[_0xffd4('0x56')]=function(_0x1a4fc9,_0x56fb08,_0x331f80,_0x4f6413,_0x42a2f4,_0x489d78){var _0x35bc95,_0x22fca6,_0x252d05,_0x412c1f;_0x489d78[_0xffd4('0x57')]=intUtil[_0xffd4('0x58')](_0x489d78[_0xffd4('0x57')]);_0x489d78[_0xffd4('0x59')]=intUtil[_0xffd4('0x58')](_0x489d78['remoteUri']);if(_0x42a2f4&&_0x42a2f4['monitor_format']){logger[_0xffd4('0x16')]('[QUEUE]',_0xffd4('0x5a'));_0x56fb08['recordingURL']=util[_0xffd4('0x3c')](_0xffd4('0x5b'),_0x489d78[_0xffd4('0x57')],_0x56fb08[_0xffd4('0x5c')],md5(_0x56fb08[_0xffd4('0x5c')]));}else{_0x56fb08['recordingURL']='';}return getConnection(_0x489d78)[_0xffd4('0x1b')](function(_0x3b1158){_0x412c1f=_0x3b1158;return getUser(_0x489d78,_0x4f6413[_0xffd4('0x5d')],_0x412c1f);})['then'](function(_0x5e92e8){_0x35bc95=_0x5e92e8;return getEndUser(_0x489d78,_0x331f80,_0x56fb08['calleridname'],_0x56fb08[_0xffd4('0x5e')],_0x412c1f);})[_0xffd4('0x1b')](function(_0x466925){_0x22fca6=_0x466925;return getTicket(_0x489d78,_0x35bc95,_0x22fca6,_0x331f80,_0x56fb08,_0x331f80[_0xffd4('0x5f')],_0x412c1f,_0xffd4('0x56'));})[_0xffd4('0x1b')](function(_0x413813){_0x252d05=_0x413813;logger['info'](_0xffd4('0x60'),_0x252d05['id']);logger[_0xffd4('0x16')](_0xffd4('0x61'),_0x252d05['id'],_0x4f6413[_0xffd4('0x4c')],_0x489d78[_0xffd4('0x36')]);switch(_0x489d78[_0xffd4('0x36')]){case'integrationTab':emit(util['format']('user:%s',_0x4f6413['name']),_0xffd4('0x62'),{'recordId':_0x252d05['id']});break;case'newTab':emit(util[_0xffd4('0x3c')](_0xffd4('0x63'),_0x4f6413[_0xffd4('0x4c')]),'trigger:browser:url',{'uri':util[_0xffd4('0x3c')]('%s/%s/e',_0x412c1f[_0xffd4('0x64')],_0x252d05['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xffd4('0x65')](function(_0x37a4a0){logger[_0xffd4('0x66')](_0xffd4('0x67'),_0x37a4a0);});};exports[_0xffd4('0x68')]=function(_0x172cd6,_0x3f6032,_0x44af02,_0x16a7ee,_0x20e523,_0x5871c0,_0x40b8c5){var _0x134dd2,_0x462eba,_0x1f7396,_0x495ade;_0x5871c0[_0xffd4('0x57')]=intUtil['stripTrailingSlash'](_0x5871c0[_0xffd4('0x57')]);_0x5871c0[_0xffd4('0x59')]=intUtil[_0xffd4('0x58')](_0x5871c0['remoteUri']);if(_0x40b8c5&&_0x40b8c5[_0xffd4('0x69')]&&_0x40b8c5[_0xffd4('0x69')]!==_0xffd4('0x6a')){logger[_0xffd4('0x16')](_0xffd4('0x6b'),_0xffd4('0x5a'));_0x3f6032[_0xffd4('0x6c')]=util[_0xffd4('0x3c')](_0xffd4('0x5b'),_0x5871c0['serverUrl'],_0x3f6032[_0xffd4('0x5c')],md5(_0x3f6032[_0xffd4('0x5c')]));}return getConnection(_0x5871c0)[_0xffd4('0x1b')](function(_0xe4e7c9){_0x495ade=_0xe4e7c9;return getUser(_0x5871c0,_0x16a7ee[_0xffd4('0x5d')],_0x495ade);})[_0xffd4('0x1b')](function(_0x3ea7c8){_0x134dd2=_0x3ea7c8;return getEndUser(_0x5871c0,_0x44af02,_0x3f6032[_0xffd4('0x6d')],_0x3f6032[_0xffd4('0x6e')],_0x495ade);})['then'](function(_0x5a9c1b){_0x462eba=_0x5a9c1b;return getTicket(_0x5871c0,_0x134dd2,_0x462eba,_0x44af02,_0x3f6032,_0x44af02[_0xffd4('0x5f')],_0x495ade,_0xffd4('0x68'));})[_0xffd4('0x1b')](function(_0x39419a){_0x1f7396=_0x39419a;logger[_0xffd4('0x16')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1f7396['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1f7396['id'],_0x16a7ee[_0xffd4('0x4c')],_0x5871c0[_0xffd4('0x36')]);switch(_0x5871c0[_0xffd4('0x36')]){case _0xffd4('0x6f'):emit(util[_0xffd4('0x3c')](_0xffd4('0x63'),_0x16a7ee[_0xffd4('0x4c')]),_0xffd4('0x62'),{'recordId':_0x1f7396['id']});break;case _0xffd4('0x70'):emit(util['format'](_0xffd4('0x63'),_0x16a7ee[_0xffd4('0x4c')]),'trigger:browser:url',{'uri':util['format'](_0xffd4('0x71'),_0x495ade['instanceUrl'],_0x1f7396['id'])});break;default:logger['error'](_0xffd4('0x6b'),_0xffd4('0x72'));}})[_0xffd4('0x65')](function(_0x4b100c){logger[_0xffd4('0x66')](_0xffd4('0x6b'),_0x4b100c);});};exports[_0xffd4('0x73')]=function(_0x40f876,_0x5ef92a,_0x2830b2,_0x120085,_0xb78266,_0x1863c3){var _0x4c2067,_0x2573b1,_0x2fc998,_0xb05565;_0x1863c3[_0xffd4('0x57')]=intUtil[_0xffd4('0x58')](_0x1863c3[_0xffd4('0x57')]);_0x1863c3[_0xffd4('0x59')]=intUtil[_0xffd4('0x58')](_0x1863c3['remoteUri']);if(_0xb78266&&_0xb78266[_0xffd4('0x74')]){logger[_0xffd4('0x16')]('['+_0x5ef92a['lastevent'][_0xffd4('0x75')]()+']','Recording\x20is\x20enabled!');_0x5ef92a[_0xffd4('0x6c')]=util[_0xffd4('0x3c')](_0xffd4('0x5b'),_0x1863c3[_0xffd4('0x57')],_0x5ef92a[_0xffd4('0x5c')],md5(_0x5ef92a[_0xffd4('0x5c')]));}else{_0x5ef92a[_0xffd4('0x6c')]='';}return getConnection(_0x1863c3)[_0xffd4('0x1b')](function(_0x14f1ed){_0xb05565=_0x14f1ed;if(!_[_0xffd4('0x76')](_0x120085)){return getUser(_0x1863c3,_0x120085[_0xffd4('0x4c')],_0xb05565);}else{return getUser(_0x1863c3,null,_0xb05565);}})[_0xffd4('0x1b')](function(_0x201010){_0x4c2067=_0x201010;return getEndUser(_0x1863c3,_0x2830b2,_0x5ef92a[_0xffd4('0x77')],_0x5ef92a[_0xffd4('0x5e')],_0xb05565);})[_0xffd4('0x1b')](function(_0x30cf13){_0x2573b1=_0x30cf13;return getTicket(_0x1863c3,_0x4c2067,_0x2573b1,_0x2830b2,_0x5ef92a,_0x2830b2[_0xffd4('0x5f')],_0xb05565);})[_0xffd4('0x1b')](function(_0x525748){_0x2fc998=_0x525748;logger[_0xffd4('0x16')]('['+_0x5ef92a[_0xffd4('0x78')][_0xffd4('0x75')]()+_0xffd4('0x79'),_0x2fc998['id']);logger['info']('['+_0x5ef92a['lastevent'][_0xffd4('0x75')]()+_0xffd4('0x7a'),_0x1863c3['type']);})[_0xffd4('0x65')](function(_0xc40a70){logger[_0xffd4('0x66')]('['+_0x5ef92a[_0xffd4('0x78')][_0xffd4('0x75')]()+']',_0xc40a70);});}; \ No newline at end of file +var _0xc624=['Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Company','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','then','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','moduleSearch','contact_lead','cloneDeep','merge','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','first','Phone'];(function(_0xc1f465,_0x469e9e){var _0x2a092e=function(_0x123b1a){while(--_0x123b1a){_0xc1f465['push'](_0xc1f465['shift']());}};_0x2a092e(++_0x469e9e);}(_0xc624,0xc5));var _0x4c62=function(_0x4d310f,_0x46604c){_0x4d310f=_0x4d310f-0x0;var _0x44003f=_0xc624[_0x4d310f];return _0x44003f;};'use strict';var _=require(_0x4c62('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c62('0x1'));var md5=require(_0x4c62('0x2'));var jsforce=require(_0x4c62('0x3'));var util=require(_0x4c62('0x4'));var Redis=require(_0x4c62('0x5'));var intUtil=require('./util');var config=require(_0x4c62('0x6'));var logger=require(_0x4c62('0x7'))(_0x4c62('0x8'));config['redis']=_[_0x4c62('0x9')](config[_0x4c62('0xa')],{'host':_0x4c62('0xb'),'port':0x18eb});var io=require(_0x4c62('0xc'))(new Redis(config['redis']));function emit(_0xdcde73,_0x51377f,_0x19707b){io['to'](_0xdcde73)[_0x4c62('0xd')](_0x51377f,_0x19707b);}function getTicket(_0x2de6fa,_0x1b0052,_0x233ccb,_0x191d03,_0x482739,_0x149d3d,_0x3421d1,_0x518116){var _0x5dff15=Object['assign']({},{'OwnerId':_0x1b0052['id'],'Subject':intUtil[_0x4c62('0xe')](_0x191d03['Subjects'],_0x482739,'\x20'),'Description':intUtil[_0x4c62('0xe')](_0x191d03[_0x4c62('0xf')],_0x482739,'\x0a')},getCustomFields(_0x149d3d,_0x482739));if(_0x233ccb){if(_0x191d03[_0x4c62('0x10')]==='Task'){_0x5dff15[_0x4c62('0x11')]=moment[_0x4c62('0x12')]();_0x5dff15[_0x4c62('0x13')]=![];_0x5dff15[_0x4c62('0x14')]=![];if(_0x233ccb[_0x4c62('0x15')]===_0x4c62('0x16')||_0x233ccb['endUserType']===_0x4c62('0x17')){_0x5dff15[_0x4c62('0x18')]=_0x233ccb['id'];}else if(_0x233ccb[_0x4c62('0x15')]===_0x4c62('0x19')){_0x5dff15[_0x4c62('0x1a')]=_0x233ccb['id'];}}else if(_0x191d03[_0x4c62('0x10')]===_0x4c62('0x1b')){if(_0x233ccb['endUserType']===_0x4c62('0x16')){_0x5dff15[_0x4c62('0x1c')]=_0x233ccb['id'];}else if(_0x233ccb['endUserType']===_0x4c62('0x19')){_0x5dff15[_0x4c62('0x1d')]=_0x233ccb['id'];}else if(_0x233ccb['endUserType']===_0x4c62('0x17')&&_0x191d03[_0x4c62('0x1e')]){_0x5dff15[_0x191d03[_0x4c62('0x1e')]]=_0x233ccb['id'];}else{logger[_0x4c62('0x1f')](_0x4c62('0x20'));}}}return _0x3421d1[_0x4c62('0x21')](_0x191d03[_0x4c62('0x10')])[_0x4c62('0x22')](_0x5dff15);}function getUser(_0x221a4f,_0x156d62,_0x34923b){if(!_['isNil'](_0x156d62)&&intUtil['validateEmail'](_0x156d62)){var _0x1c1847={'Email':_0x156d62};var _0x302c34={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x34923b['sobject'](_0x4c62('0x23'))[_0x4c62('0x24')](_0x1c1847,_0x302c34)[_0x4c62('0x25')]()[_0x4c62('0x26')](function(_0x4e1cbe){if(_0x4e1cbe[_0x4c62('0x27')]){var _0x524609=_[_0x4c62('0x24')](_0x4e1cbe,function(_0x2960eb){return _0x2960eb['Email']===_0x156d62;});if(_0x524609){logger[_0x4c62('0x1f')](_0x4c62('0x28'),_0x156d62);return BPromise['resolve']({'id':_0x524609['Id'],'name':_0x524609[_0x4c62('0x29')]});}}else{logger[_0x4c62('0x1f')](_0x4c62('0x2a'),_0x156d62);return _0x34923b[_0x4c62('0x2b')]()['then'](function(_0x2fb3e2){return BPromise[_0x4c62('0x2c')]({'id':_0x2fb3e2[_0x4c62('0x2d')],'name':_0x2fb3e2[_0x4c62('0x2e')]});});}});}else{logger[_0x4c62('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x156d62);return _0x34923b[_0x4c62('0x2b')]()[_0x4c62('0x26')](function(_0x40fb94){return BPromise[_0x4c62('0x2c')]({'id':_0x40fb94[_0x4c62('0x2d')],'name':_0x40fb94[_0x4c62('0x2e')]});});}}function getEndUser(_0x2e3fba,_0x494249,_0x4cff6e,_0x50ce09,_0x12a7f6){var _0x425423={'$or':{'Phone':_0x50ce09}};var _0x1c7142={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4c62('0x2c')]()[_0x4c62('0x26')](function(){logger[_0x4c62('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x50ce09,_0x494249[_0x4c62('0x2f')]);switch(_0x494249[_0x4c62('0x2f')]){case _0x4c62('0x30'):var _0x44b80f=_[_0x4c62('0x31')](_0x425423);if(_0x494249['additionalSearchContact']){var _0x5b63d8={};_0x5b63d8[_0x494249['additionalSearchContact']]=_0x50ce09;_[_0x4c62('0x32')](_0x44b80f['$or'],_0x5b63d8);}return _0x12a7f6['sobject'](_0x4c62('0x33'))['find'](_0x44b80f,_0x1c7142)[_0x4c62('0x25')]()[_0x4c62('0x26')](function(_0x4fa548){if(_0x4fa548&&_0x4fa548[_0x4c62('0x27')]){return _0x4fa548;}else{var _0x54afe8=_[_0x4c62('0x31')](_0x425423);if(_0x494249[_0x4c62('0x34')]){var _0x2e62b7={};_0x2e62b7[_0x494249['additionalSearchLead']]=_0x50ce09;_['merge'](_0x54afe8[_0x4c62('0x35')],_0x2e62b7);}return _0x12a7f6[_0x4c62('0x21')](_0x4c62('0x36'))[_0x4c62('0x24')](_0x54afe8,_0x1c7142);}});case _0x4c62('0x37'):var _0x2edaf1=_[_0x4c62('0x31')](_0x425423);if(_0x494249[_0x4c62('0x38')]){var _0x5b63d8={};_0x5b63d8[_0x494249['additionalSearchAccount']]=_0x50ce09;_['merge'](_0x2edaf1[_0x4c62('0x35')],_0x5b63d8);}return _0x12a7f6[_0x4c62('0x21')](_0x4c62('0x39'))['find'](_0x2edaf1,_0x1c7142)[_0x4c62('0x25')]()[_0x4c62('0x26')](function(_0x23588a){if(_0x23588a&&_0x23588a[_0x4c62('0x27')]){return _0x23588a;}else{var _0x476bd9=_[_0x4c62('0x31')](_0x425423);if(_0x494249['additionalSearchContact']){var _0x257a27={};_0x257a27[_0x494249[_0x4c62('0x3a')]]=_0x50ce09;_['merge'](_0x476bd9[_0x4c62('0x35')],_0x257a27);}return _0x12a7f6[_0x4c62('0x21')]('Contact')[_0x4c62('0x24')](_0x476bd9,_0x1c7142)[_0x4c62('0x26')](function(_0x2e6548){if(_0x2e6548&&_0x2e6548[_0x4c62('0x27')]){return _0x2e6548;}else{var _0x4e03f1=_[_0x4c62('0x31')](_0x425423);if(_0x494249['additionalSearchLead']){var _0x1a8b05={};_0x1a8b05[_0x494249[_0x4c62('0x34')]]=_0x50ce09;_[_0x4c62('0x32')](_0x4e03f1[_0x4c62('0x35')],_0x1a8b05);}return _0x12a7f6[_0x4c62('0x21')](_0x4c62('0x36'))[_0x4c62('0x24')](_0x4e03f1,_0x1c7142);}});}});case _0x4c62('0x16'):var _0x44b80f=_['cloneDeep'](_0x425423);if(_0x494249['additionalSearchContact']){var _0x5b63d8={};_0x5b63d8[_0x494249[_0x4c62('0x3a')]]=_0x50ce09;_[_0x4c62('0x32')](_0x44b80f[_0x4c62('0x35')],_0x5b63d8);}return _0x12a7f6[_0x4c62('0x21')]('Contact')[_0x4c62('0x24')](_0x44b80f,_0x1c7142)[_0x4c62('0x25')]();case _0x4c62('0x17'):var _0x1835f2=_[_0x4c62('0x31')](_0x425423);if(_0x494249['additionalSearchLead']){var _0x5b63d8={};_0x5b63d8[_0x494249[_0x4c62('0x34')]]=_0x50ce09;_[_0x4c62('0x32')](_0x1835f2['$or'],_0x5b63d8);}return _0x12a7f6['sobject'](_0x4c62('0x36'))[_0x4c62('0x24')](_0x1835f2,_0x1c7142);case _0x4c62('0x19'):var _0x2edaf1=_['cloneDeep'](_0x425423);if(_0x494249['additionalSearchAccount']){var _0x5b63d8={};_0x5b63d8[_0x494249[_0x4c62('0x38')]]=_0x50ce09;_[_0x4c62('0x32')](_0x2edaf1[_0x4c62('0x35')],_0x5b63d8);}return _0x12a7f6[_0x4c62('0x21')](_0x4c62('0x39'))[_0x4c62('0x24')](_0x2edaf1,_0x1c7142);default:return null;}})[_0x4c62('0x26')](function(_0x946a7e){if(_0x946a7e&&_0x946a7e[_0x4c62('0x27')]){var _0xa55ac9=_[_0x4c62('0x3b')](_0x946a7e);if(_0xa55ac9){return BPromise[_0x4c62('0x2c')]({'id':_0xa55ac9['Id'],'name':_0xa55ac9[_0x4c62('0x29')],'phone':_0xa55ac9[_0x4c62('0x3c')],'endUserType':_0xa55ac9['attributes']['type']['toLowerCase']()});}}})[_0x4c62('0x26')](function(_0x487eac){if(_0x487eac){logger['info'](_0x4c62('0x3d'),_0x487eac[_0x4c62('0x15')],_0x50ce09);return BPromise[_0x4c62('0x2c')](_0x487eac);}else{logger[_0x4c62('0x1f')](_0x4c62('0x3e'),_0x50ce09);var _0x392486={'Phone':_0x50ce09};if(_0x494249[_0x4c62('0x3f')]){if(_0x494249[_0x4c62('0x3f')]===_0x4c62('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50ce09,_0x494249[_0x4c62('0x3f')]);_0x392486['LastName']=_0x4cff6e!==''?_0x4cff6e:util['format'](_0x4c62('0x40'),_0x50ce09);}else if(_0x494249[_0x4c62('0x3f')]===_0x4c62('0x17')){logger['info'](_0x4c62('0x41'),_0x50ce09,_0x494249[_0x4c62('0x3f')]);_0x392486[_0x4c62('0x42')]=_0x4cff6e!==_0x4c62('0x43')?_0x4cff6e:util[_0x4c62('0x44')]('Caller\x20-\x20%s',_0x50ce09);_0x392486[_0x4c62('0x45')]='No\x20Company';}else if(_0x494249['moduleCreate']===_0x4c62('0x19')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50ce09,_0x494249[_0x4c62('0x3f')]);_0x392486[_0x4c62('0x29')]=_0x4cff6e!==_0x4c62('0x43')?_0x4cff6e:util[_0x4c62('0x44')](_0x4c62('0x40'),_0x50ce09);}else{return null;}}return _0x12a7f6['sobject'](_[_0x4c62('0x46')](_0x494249[_0x4c62('0x3f')]))['create'](_0x392486)[_0x4c62('0x26')](function(_0x498d33){return BPromise['resolve']({'id':_0x498d33['id'],'endUserType':_0x494249[_0x4c62('0x3f')]});});}});}function getCustomFields(_0x4108bf,_0x164fef){var _0x5474f7={};if(_0x4108bf[_0x4c62('0x27')]>0x0){_[_0x4c62('0x47')](_0x4108bf,function(_0x23a579){if(_[_0x4c62('0x48')]([_0x4c62('0x49'),_0x4c62('0x4a')],_0x23a579[_0x4c62('0x4b')])&&_0x23a579[_0x4c62('0x4c')]){_0x5474f7[_0x23a579[_0x4c62('0x4c')]]=_0x23a579[_0x4c62('0x4d')][_0x4c62('0x4e')]();}else if(_0x23a579[_0x4c62('0x4b')]===_0x4c62('0x4f')&&_0x23a579[_0x4c62('0x50')]&&_0x23a579['idField']){_0x164fef[_0x23a579[_0x4c62('0x50')]]&&(_0x5474f7[_0x23a579[_0x4c62('0x4c')]]=_0x164fef[_0x23a579[_0x4c62('0x50')]]['toString']());}else if(_0x23a579['type']==='customVariable'&&_0x23a579[_0x4c62('0x51')]&&_0x23a579[_0x4c62('0x51')][_0x4c62('0x52')]&&_0x23a579[_0x4c62('0x4c')]){_0x164fef[_0x23a579['Variable'][_0x4c62('0x52')]['toLowerCase']()]&&(_0x5474f7[_0x23a579[_0x4c62('0x4c')]]=_0x164fef[_0x23a579[_0x4c62('0x51')]['name']['toLowerCase']()][_0x4c62('0x4e')]());}});}return _0x5474f7;}function getConnection(_0x50699d){var _0x196a70=_0x50699d[_0x4c62('0x53')][_0x4c62('0x54')](_0x50699d[_0x4c62('0x55')]);var _0x44edc0=new jsforce[(_0x4c62('0x56'))]({'oauth2':{'loginUrl':_0x50699d[_0x4c62('0x57')]||_0x4c62('0x58'),'clientId':_0x50699d[_0x4c62('0x59')],'clientSecret':_0x50699d[_0x4c62('0x5a')]}});return _0x44edc0['login'](_0x50699d[_0x4c62('0x5b')],_0x196a70)[_0x4c62('0x26')](function(){logger['info']('Connection\x20established.');return _0x44edc0;});}exports[_0x4c62('0x5c')]=function(_0x464367,_0x334d2d,_0x1e7156,_0x3b5969,_0x1d818c,_0x4d9cc1){var _0x5654d8,_0x3f8320,_0x38b322,_0xd2b429;_0x4d9cc1[_0x4c62('0x5d')]=intUtil[_0x4c62('0x5e')](_0x4d9cc1[_0x4c62('0x5d')]);_0x4d9cc1[_0x4c62('0x57')]=intUtil[_0x4c62('0x5e')](_0x4d9cc1[_0x4c62('0x57')]);if(_0x1d818c&&_0x1d818c[_0x4c62('0x5f')]){logger[_0x4c62('0x1f')](_0x4c62('0x60'),_0x4c62('0x61'));_0x334d2d[_0x4c62('0x62')]=util[_0x4c62('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d9cc1[_0x4c62('0x5d')],_0x334d2d['uniqueid'],md5(_0x334d2d[_0x4c62('0x63')]));}else{_0x334d2d[_0x4c62('0x62')]='';}return getConnection(_0x4d9cc1)[_0x4c62('0x26')](function(_0x3d6109){_0xd2b429=_0x3d6109;return getUser(_0x4d9cc1,_0x3b5969[_0x4c62('0x64')],_0xd2b429);})['then'](function(_0x6983ff){_0x5654d8=_0x6983ff;return getEndUser(_0x4d9cc1,_0x1e7156,_0x334d2d[_0x4c62('0x65')],_0x334d2d['calleridnum'],_0xd2b429);})['then'](function(_0x17339f){_0x3f8320=_0x17339f;return getTicket(_0x4d9cc1,_0x5654d8,_0x3f8320,_0x1e7156,_0x334d2d,_0x1e7156[_0x4c62('0x66')],_0xd2b429,_0x4c62('0x5c'));})[_0x4c62('0x26')](function(_0x4489dc){_0x38b322=_0x4489dc;logger[_0x4c62('0x1f')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x38b322['id']);logger[_0x4c62('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x38b322['id'],_0x3b5969[_0x4c62('0x52')],_0x4d9cc1['type']);switch(_0x4d9cc1[_0x4c62('0x4b')]){case _0x4c62('0x67'):emit(util[_0x4c62('0x44')](_0x4c62('0x68'),_0x3b5969['name']),_0x4c62('0x69'),{'recordId':_0x38b322['id']});break;case _0x4c62('0x6a'):emit(util[_0x4c62('0x44')](_0x4c62('0x68'),_0x3b5969[_0x4c62('0x52')]),_0x4c62('0x6b'),{'uri':util[_0x4c62('0x44')](_0x4c62('0x6c'),_0xd2b429['instanceUrl'],_0x38b322['id'])});break;default:logger[_0x4c62('0x6d')](_0x4c62('0x6e'));}})[_0x4c62('0x6f')](function(_0x8d5167){logger[_0x4c62('0x6d')](_0x4c62('0x60'),_0x8d5167);});};exports[_0x4c62('0x70')]=function(_0x7e0351,_0x29d40b,_0x14e2c0,_0x4e845e,_0x9195f0,_0x163455,_0x4f3e58){var _0x46db90,_0x311c03,_0x49c3cc,_0x4c97d1;_0x163455['serverUrl']=intUtil[_0x4c62('0x5e')](_0x163455[_0x4c62('0x5d')]);_0x163455['remoteUri']=intUtil['stripTrailingSlash'](_0x163455[_0x4c62('0x57')]);if(_0x4f3e58&&_0x4f3e58['recordingFormat']&&_0x4f3e58[_0x4c62('0x71')]!==_0x4c62('0x72')){logger[_0x4c62('0x1f')](_0x4c62('0x73'),'Recording\x20is\x20enabled!');_0x29d40b[_0x4c62('0x62')]=util[_0x4c62('0x44')](_0x4c62('0x74'),_0x163455['serverUrl'],_0x29d40b['uniqueid'],md5(_0x29d40b[_0x4c62('0x63')]));}return getConnection(_0x163455)['then'](function(_0xf74824){_0x4c97d1=_0xf74824;return getUser(_0x163455,_0x4e845e[_0x4c62('0x64')],_0x4c97d1);})[_0x4c62('0x26')](function(_0x46ad99){_0x46db90=_0x46ad99;return getEndUser(_0x163455,_0x14e2c0,_0x29d40b[_0x4c62('0x75')],_0x29d40b['destcalleridnum'],_0x4c97d1);})[_0x4c62('0x26')](function(_0x3ec1da){_0x311c03=_0x3ec1da;return getTicket(_0x163455,_0x46db90,_0x311c03,_0x14e2c0,_0x29d40b,_0x14e2c0[_0x4c62('0x66')],_0x4c97d1,_0x4c62('0x70'));})[_0x4c62('0x26')](function(_0x17f861){_0x49c3cc=_0x17f861;logger[_0x4c62('0x1f')](_0x4c62('0x76'),_0x49c3cc['id']);logger[_0x4c62('0x1f')](_0x4c62('0x77'),_0x49c3cc['id'],_0x4e845e[_0x4c62('0x52')],_0x163455['type']);switch(_0x163455['type']){case'integrationTab':emit(util['format'](_0x4c62('0x68'),_0x4e845e[_0x4c62('0x52')]),_0x4c62('0x69'),{'recordId':_0x49c3cc['id']});break;case _0x4c62('0x6a'):emit(util['format'](_0x4c62('0x68'),_0x4e845e[_0x4c62('0x52')]),'trigger:browser:url',{'uri':util[_0x4c62('0x44')]('%s/%s/e',_0x4c97d1[_0x4c62('0x78')],_0x49c3cc['id'])});break;default:logger[_0x4c62('0x6d')](_0x4c62('0x73'),_0x4c62('0x79'));}})[_0x4c62('0x6f')](function(_0x1596ed){logger[_0x4c62('0x6d')](_0x4c62('0x73'),_0x1596ed);});};exports[_0x4c62('0x7a')]=function(_0x57d69e,_0x507170,_0x27fbfb,_0x53a2dc,_0x5ed309,_0x14208f){var _0x99880f,_0x430a55,_0xe7b4e,_0x490dfc;_0x14208f[_0x4c62('0x5d')]=intUtil[_0x4c62('0x5e')](_0x14208f[_0x4c62('0x5d')]);_0x14208f['remoteUri']=intUtil[_0x4c62('0x5e')](_0x14208f[_0x4c62('0x57')]);if(_0x5ed309&&_0x5ed309[_0x4c62('0x5f')]){logger[_0x4c62('0x1f')]('['+_0x507170[_0x4c62('0x7b')][_0x4c62('0x7c')]()+']',_0x4c62('0x61'));_0x507170[_0x4c62('0x62')]=util[_0x4c62('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14208f['serverUrl'],_0x507170[_0x4c62('0x63')],md5(_0x507170[_0x4c62('0x63')]));}else{_0x507170[_0x4c62('0x62')]='';}return getConnection(_0x14208f)[_0x4c62('0x26')](function(_0x1af9a8){_0x490dfc=_0x1af9a8;if(!_[_0x4c62('0x7d')](_0x53a2dc)){return getUser(_0x14208f,_0x53a2dc[_0x4c62('0x52')],_0x490dfc);}else{return getUser(_0x14208f,null,_0x490dfc);}})[_0x4c62('0x26')](function(_0x34d498){_0x99880f=_0x34d498;return getEndUser(_0x14208f,_0x27fbfb,_0x507170[_0x4c62('0x65')],_0x507170[_0x4c62('0x7e')],_0x490dfc);})[_0x4c62('0x26')](function(_0x5df972){_0x430a55=_0x5df972;return getTicket(_0x14208f,_0x99880f,_0x430a55,_0x27fbfb,_0x507170,_0x27fbfb[_0x4c62('0x66')],_0x490dfc);})[_0x4c62('0x26')](function(_0x4db696){_0xe7b4e=_0x4db696;logger[_0x4c62('0x1f')]('['+_0x507170[_0x4c62('0x7b')][_0x4c62('0x7c')]()+_0x4c62('0x7f'),_0xe7b4e['id']);logger[_0x4c62('0x1f')]('['+_0x507170[_0x4c62('0x7b')][_0x4c62('0x7c')]()+_0x4c62('0x80'),_0x14208f[_0x4c62('0x4b')]);})[_0x4c62('0x6f')](function(_0x7f5fad){logger['error']('['+_0x507170[_0x4c62('0x7b')][_0x4c62('0x7c')]()+']',_0x7f5fad);});}; \ 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 62bcd73..6d95d9c 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 _0x1d96=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','customField','content','toString','picklist','idField','type','variable','toLowerCase','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','sys_id','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','userId','endUserNumber','user','System'];(function(_0x2c69a1,_0x30b54b){var _0x50e57d=function(_0x376e6e){while(--_0x376e6e){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x50e57d(++_0x30b54b);}(_0x1d96,0xb0));var _0x61d9=function(_0x5ef5b3,_0x1c41b0){_0x5ef5b3=_0x5ef5b3-0x0;var _0x469cd3=_0x1d96[_0x5ef5b3];return _0x469cd3;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x61d9('0x0'));var md5=require(_0x61d9('0x1'));var Redis=require(_0x61d9('0x2'));var intUtil=require(_0x61d9('0x3'));var config=require(_0x61d9('0x4'));var logger=require(_0x61d9('0x5'))(_0x61d9('0x6'));config[_0x61d9('0x7')]=_[_0x61d9('0x8')](config[_0x61d9('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x61d9('0x9'))(new Redis(config[_0x61d9('0x7')]));function getAdminUser(_0x3e3f4a,_0x41696c,_0x58d354,_0x2c5a1c,_0x1d47ba,_0x4b3194){return new Promise(function(_0xa54451,_0x1b891e){var _0x5bc70f={'method':'GET','uri':_0x2c5a1c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x1d47ba+'&'+_0x4b3194,'auth':_0x41696c,'json':!![]};return rp(_0x5bc70f)[_0x61d9('0xa')](function(_0x4b4d06){if(_0x4b4d06[_0x61d9('0xb')][_0x61d9('0xc')]>0x0){_0x58d354[_0x61d9('0xd')]=_0x4b4d06[_0x61d9('0xb')][0x0]['sys_id'];}logger[_0x61d9('0xe')]('['+[_0x3e3f4a[_0x61d9('0xf')]()]+_0x61d9('0x10'),_0x58d354);_0xa54451(_0x58d354);})[_0x61d9('0x11')](function(_0x38c5c9){logger['error']('['+[_0x3e3f4a[_0x61d9('0xf')]()]+']',_0x38c5c9[_0x61d9('0x12')]);_0x1b891e(_0x38c5c9[_0x61d9('0x12')]);});});}function getUser(_0x4be6b4,_0xa6f902,_0x562ed2,_0x6dd516,_0x5f5d05){return function(_0x5ef11a){logger[_0x61d9('0xe')]('['+[_0x4be6b4[_0x61d9('0xf')]()]+_0x61d9('0x13'),_0x5ef11a);return new Promise(function(_0x2248f4,_0x3a723f){if(intUtil[_0x61d9('0x14')](_0x5ef11a[_0x61d9('0x15')])){var _0x135cf9={'method':_0x61d9('0x16'),'uri':_0x562ed2+_0x61d9('0x17')+_0x5ef11a[_0x61d9('0x15')]+'&'+_0x6dd516+'&'+_0x5f5d05,'auth':_0xa6f902,'json':!![]};logger[_0x61d9('0xe')]('['+[_0x4be6b4['toUpperCase']()]+_0x61d9('0x18'),_0x135cf9);return rp(_0x135cf9)['then'](function(_0x3563c0){logger[_0x61d9('0xe')]('['+[_0x4be6b4[_0x61d9('0xf')]()]+'],\x20getUser\x20entity',_0x3563c0);if(_0x3563c0[_0x61d9('0xb')]['length']>0x0&&String(_0x3563c0['result'][0x0][_0x61d9('0x19')])===_0x61d9('0x1a')){_0x5ef11a['userId']=_0x3563c0['result'][0x0][_0x61d9('0x1b')];}else{_0x5ef11a['userId']=_0x5ef11a[_0x61d9('0xd')];_0x5ef11a[_0x61d9('0x15')]=_0x5ef11a[_0x61d9('0x1c')];}logger[_0x61d9('0xe')]('['+[_0x4be6b4[_0x61d9('0xf')]()]+_0x61d9('0x1d'),_0x5ef11a);_0x2248f4(_0x5ef11a);})[_0x61d9('0x11')](function(_0x760921){logger[_0x61d9('0x1e')]('['+[_0x4be6b4[_0x61d9('0xf')]()]+']',_0x760921[_0x61d9('0x12')]);_0x3a723f(_0x760921[_0x61d9('0x12')]);});}else{logger[_0x61d9('0xe')]('['+[_0x4be6b4[_0x61d9('0xf')]()]+_0x61d9('0x1f'));_0x5ef11a[_0x61d9('0x20')]=_0x5ef11a[_0x61d9('0xd')];_0x5ef11a['userEmail']=_0x5ef11a[_0x61d9('0x1c')];_0x2248f4(_0x5ef11a);}});};}function createEndUser(_0x43d473,_0x377089,_0x53be84,_0x3affb1,_0x3809ec){logger[_0x61d9('0xe')]('['+[_0x43d473[_0x61d9('0xf')]()]+'],\x20createEndUser\x20input\x20crm',_0x53be84);return new Promise(function(_0x21e3ec,_0x3ba180){var _0xa651fc={'method':'POST','uri':_0x3affb1+'sys_user?'+_0x3809ec,'body':{'user_name':_0x53be84[_0x61d9('0x21')],'roles':_0x61d9('0x22'),'first_name':_0x53be84['endUserNumber'],'active':_0x61d9('0x1a'),'date_format':_0x61d9('0x23'),'phone':_0x53be84['endUserNumber']},'auth':_0x377089,'json':!![]};return rp(_0xa651fc)[_0x61d9('0xa')](function(_0x1fae52){logger[_0x61d9('0xe')]('['+[_0x43d473[_0x61d9('0xf')]()]+_0x61d9('0x24'),_0x1fae52[_0x61d9('0xb')]);_0x53be84[_0x61d9('0x25')]=_0x1fae52[_0x61d9('0xb')][_0x61d9('0x1b')];_0x21e3ec(_0x53be84);})[_0x61d9('0x11')](function(_0x274d4f){logger[_0x61d9('0x1e')]('['+[_0x43d473['toUpperCase']()]+']',_0x274d4f[_0x61d9('0x12')]);_0x3ba180(_0x274d4f[_0x61d9('0x12')]);});});}function getEndUser(_0x17e62a,_0x1ead0a,_0x31d1a5,_0x2551cb,_0x49e401){return function(_0x2d77b7){logger[_0x61d9('0xe')]('['+[_0x17e62a['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x2d77b7);return new Promise(function(_0x4b884b,_0x41c680){var _0x31c9d0={'method':'GET','uri':_0x31d1a5+'sys_user?sysparm_query=phone%3D'+_0x2d77b7['endUserNumber']+'&'+_0x2551cb+'&'+_0x49e401,'auth':_0x1ead0a,'json':!![]};return rp(_0x31c9d0)[_0x61d9('0xa')](function(_0x20642c){if(_0x20642c['result'][_0x61d9('0xc')]>0x0){_0x2d77b7[_0x61d9('0x25')]=_0x20642c[_0x61d9('0xb')][0x0][_0x61d9('0x1b')];logger[_0x61d9('0xe')]('['+[_0x17e62a[_0x61d9('0xf')]()]+_0x61d9('0x26'),_0x2d77b7);_0x4b884b(_0x2d77b7);}else{return createEndUser(_0x17e62a,_0x1ead0a,_0x2d77b7,_0x31d1a5,_0x2551cb)[_0x61d9('0xa')](function(_0x4cec39){logger[_0x61d9('0xe')]('['+[_0x17e62a[_0x61d9('0xf')]()]+_0x61d9('0x27'),_0x4cec39);_0x4b884b(_0x4cec39);});}})['catch'](function(_0x280f42){logger['error']('['+[_0x17e62a[_0x61d9('0xf')]()]+']',_0x280f42[_0x61d9('0x12')]);_0x41c680(_0x280f42[_0x61d9('0x12')]);});});};}function getCustomFields(_0x1de60d,_0x527a65){var _0x2f0911={};if(_0x1de60d[_0x61d9('0xc')]>0x0){_[_0x61d9('0x28')](_0x1de60d,function(_0x2babe0){if(_[_0x61d9('0x29')]([_0x61d9('0x2a'),'picklist'],_0x2babe0['type'])&&_0x2babe0['nameField']&&!_0x2babe0[_0x61d9('0x2b')]){_0x2f0911[_0x2babe0['nameField']['toLowerCase']()]=_0x2babe0[_0x61d9('0x2c')][_0x61d9('0x2d')]();}else if(_['includes']([_0x61d9('0x2a'),_0x61d9('0x2e')],_0x2babe0['type'])&&_0x2babe0[_0x61d9('0x2f')]&&_0x2babe0[_0x61d9('0x2b')]){_0x2f0911[_0x2babe0[_0x61d9('0x2f')]['toLowerCase']()]=_0x2babe0['content']['toString']();}else if(_0x2babe0[_0x61d9('0x30')]===_0x61d9('0x31')&&_0x2babe0['variableName']&&_0x2babe0[_0x61d9('0x2f')]&&_0x2babe0[_0x61d9('0x2b')]){_0x2f0911[_0x2babe0['idField'][_0x61d9('0x32')]()]=_0x527a65[_0x2babe0[_0x61d9('0x33')]]['toString']();}else if(_0x2babe0[_0x61d9('0x30')]===_0x61d9('0x34')&&_0x2babe0[_0x61d9('0x35')]&&_0x2babe0[_0x61d9('0x35')][_0x61d9('0x36')]&&_0x2babe0[_0x61d9('0x2f')]&&_0x2babe0[_0x61d9('0x2b')]){_0x2f0911[_0x2babe0[_0x61d9('0x2f')][_0x61d9('0x32')]()]=_0x527a65[_0x2babe0[_0x61d9('0x35')][_0x61d9('0x36')][_0x61d9('0x32')]()][_0x61d9('0x2d')]();}});}return _0x2f0911;}function getTicket(_0x570a83,_0x1ac798,_0x51f507,_0x3c2ba2,_0x1f95eb,_0xfbc5dc){return function(_0x329ac2){logger[_0x61d9('0xe')]('['+[_0x570a83[_0x61d9('0xf')]()]+_0x61d9('0x37'),_0x329ac2);return new Promise(function(_0x1d17cf,_0x20e45b){var _0x276f72=_0x570a83[_0x61d9('0x32')]()===_0x61d9('0x38')?_0x329ac2['userId']:_0x329ac2[_0x61d9('0x25')];var _0x22aedd={'method':'POST','uri':_0x51f507+_0x61d9('0x39')+'?'+_0xfbc5dc,'body':Object['assign']({},{'active':_0x61d9('0x1a'),'caller_id':_0x276f72,'assigned_to':_0x329ac2[_0x61d9('0x20')],'short_description':intUtil[_0x61d9('0x3a')](_0x3c2ba2['Subjects'],_0x1f95eb,'\x20'),'description':intUtil[_0x61d9('0x3a')](_0x3c2ba2[_0x61d9('0x3b')],_0x1f95eb,'\x0a')},getCustomFields(_0x3c2ba2[_0x61d9('0x3c')],_0x1f95eb)),'auth':_0x1ac798,'json':!![]};return rp(_0x22aedd)['then'](function(_0x13013f){logger['info']('['+[_0x570a83['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x13013f[_0x61d9('0xb')]);_0x329ac2[_0x61d9('0x3d')]=_0x13013f['result'][_0x61d9('0x1b')];_0x329ac2[_0x61d9('0x3e')]=_0x13013f[_0x61d9('0xb')][_0x61d9('0x3f')];logger['info']('['+[_0x570a83['toUpperCase']()]+_0x61d9('0x40'),_0x329ac2);_0x1d17cf(_0x329ac2);})[_0x61d9('0x11')](function(_0xc7930b){logger[_0x61d9('0x1e')]('['+[_0x570a83[_0x61d9('0xf')]()]+']',_0xc7930b[_0x61d9('0x12')]);_0x20e45b(_0xc7930b[_0x61d9('0x12')]);});});};}function createRemoteTag(_0x151743,_0x510c37,_0xc86aa8,_0x16fca8){return new Promise(function(_0x51a193,_0x5ebcae){var _0x379d4c={'method':_0x61d9('0x41'),'uri':_0xc86aa8+_0x61d9('0x42')+'?'+_0x16fca8,'body':{'short_description':_0x151743,'global':!![],'active':!![],'name':_0x151743},'auth':_0x510c37,'json':!![]};return rp(_0x379d4c)[_0x61d9('0xa')](function(_0x27427f){var _0x5722c3=_0x27427f['result']['sys_id'];_0x51a193(_0x5722c3);});});}function getRemoteTag(_0x32039f,_0x630e8,_0x308a9f,_0x2224c8,_0x1dd4ba){return new Promise(function(_0x1312cc,_0x16edd1){var _0x2686fd={'method':_0x61d9('0x16'),'uri':_0x308a9f+_0x61d9('0x42')+_0x61d9('0x43')+_0x32039f+'&'+_0x2224c8,'auth':_0x630e8,'json':!![]};return rp(_0x2686fd)[_0x61d9('0xa')](function(_0x192b8f){if(_0x192b8f[_0x61d9('0xb')][_0x61d9('0xc')]>0x0){var _0x4c01d0=_0x192b8f[_0x61d9('0xb')][0x0]['sys_id'];_0x1312cc(_0x4c01d0);}else{return createRemoteTag(_0x32039f,_0x630e8,_0x308a9f,_0x2224c8)[_0x61d9('0xa')](function(_0x4f10f6){_0x1312cc(_0x4f10f6);});}});});}function assignTagToIncident(_0x3f660b,_0x12df90,_0x2f3742,_0x331a28,_0xfd8dc3){return new Promise(function(_0x4f5483,_0x441201){var _0x9148d1={'method':_0x61d9('0x41'),'uri':_0x2f3742+'label_entry'+'?'+_0xfd8dc3,'body':{'label':_0x3f660b,'table':'incident','id_type':'Incident','table_key':_0x331a28['ticketId'],'title':_0x61d9('0x44')+_0x331a28[_0x61d9('0x3e')],'id_display':_0x331a28[_0x61d9('0x3e')]},'auth':_0x12df90,'json':!![]};return rp(_0x9148d1)[_0x61d9('0xa')](function(_0x3150fe){_0x4f5483();})[_0x61d9('0x11')](function(){_0x4f5483();});});}function manageTags(_0x3659b0,_0x5ca065,_0x26a108,_0x2efe9c,_0x443424,_0x728f97,_0x4681f1){return new Promise(function(_0x1ef4df,_0x3408f6){var _0x1052e2=[];_0x5ca065[_0x61d9('0x28')](function(_0x1fb2ca){_0x1052e2[_0x61d9('0x45')](getRemoteTag(_0x1fb2ca,_0x26a108,_0x2efe9c,_0x728f97,_0x4681f1));});return Promise['all'](_0x1052e2)['then'](function(_0xce00f1){if(_0xce00f1[_0x61d9('0xc')]){logger[_0x61d9('0xe')]('['+[_0x3659b0['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xce00f1);var _0x1ebd78=[];_0xce00f1[_0x61d9('0x28')](function(_0x200ac6){_0x1ebd78[_0x61d9('0x45')](assignTagToIncident(_0x200ac6,_0x26a108,_0x2efe9c,_0x443424,_0x728f97));});return Promise[_0x61d9('0x46')](_0x1ebd78)['then'](function(){_0x1ef4df();})[_0x61d9('0x11')](function(){_0x1ef4df();});}else{_0x1ef4df();}});});}function getTags(_0x53802c,_0x563ec5,_0x18d3ec,_0x579963,_0x1b8e7b,_0x1fdb1f){return function(_0x39fb2d){return new Promise(function(_0x3a09bc,_0x438d96){var _0x163155=[];var _0xda225e=_0x579963[_0x61d9('0x47')];if(_0xda225e&&_0xda225e[_0x61d9('0xc')]>0x0){_0x163155=_[_0x61d9('0x48')](_0xda225e,_0x61d9('0x36'));}if(_0x163155['length']>0x0){return manageTags(_0x53802c,_0x163155,_0x563ec5,_0x18d3ec,_0x39fb2d,_0x1b8e7b,_0x1fdb1f)[_0x61d9('0xa')](function(){_0x3a09bc(_0x39fb2d);});}else{_0x3a09bc(_0x39fb2d);}});};}function emit(_0x559a67,_0x563c97,_0xe5d352){var _0x2290bb=_0x61d9('0x49')+_0x61d9('0x4a')+_0x61d9('0x4b')+_0x61d9('0x4c');var _0x33a0a2={'uri':_0x559a67+_0x61d9('0x4d')+_0xe5d352+_0x2290bb};io['to'](util[_0x61d9('0x4e')](_0x61d9('0x4f'),_0x563c97))[_0x61d9('0x50')](_0x61d9('0x51'),_0x33a0a2);}exports['cs']=function(_0x4a4daf,_0x828647,_0x3deaef,_0x5369c2,_0x5996a3,_0x25ce4e,_0x9fcb02,_0x3ce1ef){var _0x761743={};var _0x2ab8d3={'user':_0x25ce4e[_0x61d9('0x52')],'pass':_0x25ce4e[_0x61d9('0x53')]};var _0x269848=_0x61d9('0x54');var _0x4ff63b=_0x61d9('0x55');_0x25ce4e[_0x61d9('0x56')]=intUtil[_0x61d9('0x57')](_0x25ce4e[_0x61d9('0x56')]);_0x25ce4e[_0x61d9('0x58')]=intUtil[_0x61d9('0x57')](_0x25ce4e['serverUrl']);var _0x541cbf=util[_0x61d9('0x4e')](_0x61d9('0x59'),_0x25ce4e[_0x61d9('0x56')]);_0x761743[_0x61d9('0x15')]=!_[_0x61d9('0x5a')](_0x5369c2)?_0x5369c2[_0x61d9('0x5b')]:null;_0x761743[_0x61d9('0x1c')]=_0x25ce4e[_0x61d9('0x5b')];_0x761743[_0x61d9('0x21')]=_0x3ce1ef['toLowerCase']()===_0x61d9('0x38')?_0x828647[_0x61d9('0x5c')]:_0x828647[_0x61d9('0x5d')];_0x761743['callDirection']=_0x3ce1ef==='queue'||_0x3ce1ef==='unmanaged'?'queue':_0x61d9('0x38');var _0x2990da=util[_0x61d9('0x4e')](_0x61d9('0x5e'),_0x25ce4e[_0x61d9('0x58')],_0x828647['uniqueid'],md5(_0x828647['uniqueid']));if(_0x5996a3&&_0x5996a3[_0x61d9('0x5f')]){logger[_0x61d9('0xe')](_0x61d9('0x60'),_0x61d9('0x61'));_0x828647['recordingURL']=_0x2990da;}else if(_0x9fcb02&&_0x9fcb02[_0x61d9('0x62')]&&_0x9fcb02[_0x61d9('0x62')]!=='none'){logger[_0x61d9('0xe')](_0x61d9('0x63'),'Recording\x20is\x20enabled!');_0x828647[_0x61d9('0x64')]=_0x2990da;}else{_0x828647['recordingURL']='';}return getAdminUser(_0x3ce1ef,_0x2ab8d3,_0x761743,_0x541cbf,_0x4ff63b,_0x269848)[_0x61d9('0xa')](getUser(_0x3ce1ef,_0x2ab8d3,_0x541cbf,_0x4ff63b,_0x269848))[_0x61d9('0xa')](getEndUser(_0x3ce1ef,_0x2ab8d3,_0x541cbf,_0x4ff63b,_0x269848))['then'](getTicket(_0x3ce1ef,_0x2ab8d3,_0x541cbf,_0x3deaef,_0x828647,_0x4ff63b))[_0x61d9('0xa')](function(_0x4a632f){logger[_0x61d9('0xe')](util['format'](_0x61d9('0x65'),_0x4a632f['ticketId']));logger[_0x61d9('0xe')](util[_0x61d9('0x4e')](_0x61d9('0x66'),_0x3ce1ef));if(_0x3ce1ef!==_0x61d9('0x67')){logger[_0x61d9('0xe')]('['+[_0x3ce1ef[_0x61d9('0xf')]()]+']',_0x61d9('0x68'));emit(_0x25ce4e[_0x61d9('0x56')],_0x5369c2['name'],_0x4a632f[_0x61d9('0x3d')]);}})[_0x61d9('0x11')](function(_0x54edf1){logger[_0x61d9('0x1e')]('['+[_0x3ce1ef[_0x61d9('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x61d9('0x69')](_0x54edf1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4de8=['emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','format','email','destcalleridnum','calleridnum','callDirection','queue','%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','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','validateEmail','GET','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','message','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','error','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','content','type','idField','toString','variable','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','push','all','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s'];(function(_0x5036e5,_0x2a03c0){var _0x2d9934=function(_0x26052f){while(--_0x26052f){_0x5036e5['push'](_0x5036e5['shift']());}};_0x2d9934(++_0x2a03c0);}(_0x4de8,0x1cb));var _0x84de=function(_0x331336,_0x479773){_0x331336=_0x331336-0x0;var _0x272974=_0x4de8[_0x331336];return _0x272974;};'use strict';var _=require('lodash');var Promise=require(_0x84de('0x0'));var rp=require(_0x84de('0x1'));var util=require('util');var md5=require(_0x84de('0x2'));var Redis=require(_0x84de('0x3'));var intUtil=require(_0x84de('0x4'));var config=require(_0x84de('0x5'));var logger=require(_0x84de('0x6'))(_0x84de('0x7'));config[_0x84de('0x8')]=_[_0x84de('0x9')](config[_0x84de('0x8')],{'host':_0x84de('0xa'),'port':0x18eb});var io=require(_0x84de('0xb'))(new Redis(config[_0x84de('0x8')]));function getAdminUser(_0x307fa7,_0x241cea,_0x2b7d8f,_0x2b23f7,_0x3534bb,_0x41af49){return new Promise(function(_0x526de8,_0x3985d2){var _0x3f5781={'method':'GET','uri':_0x2b23f7+_0x84de('0xc')+'&'+_0x3534bb+'&'+_0x41af49,'auth':_0x241cea,'json':!![]};return rp(_0x3f5781)[_0x84de('0xd')](function(_0x31ceba){if(_0x31ceba[_0x84de('0xe')][_0x84de('0xf')]>0x0){_0x2b7d8f[_0x84de('0x10')]=_0x31ceba[_0x84de('0xe')][0x0][_0x84de('0x11')];}logger[_0x84de('0x12')]('['+[_0x307fa7[_0x84de('0x13')]()]+_0x84de('0x14'),_0x2b7d8f);_0x526de8(_0x2b7d8f);})[_0x84de('0x15')](function(_0x3b8b45){logger['error']('['+[_0x307fa7[_0x84de('0x13')]()]+']',_0x3b8b45['message']);_0x3985d2(_0x3b8b45['message']);});});}function getUser(_0x46e6d3,_0x20a193,_0x5b032b,_0x1e363c,_0xd14c16){return function(_0x151f92){logger[_0x84de('0x12')]('['+[_0x46e6d3[_0x84de('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x151f92);return new Promise(function(_0xe53ca1,_0x2e2b08){if(intUtil[_0x84de('0x16')](_0x151f92['userEmail'])){var _0x2319f0={'method':_0x84de('0x17'),'uri':_0x5b032b+'sys_user?sysparm_query=email%3D'+_0x151f92[_0x84de('0x18')]+'&'+_0x1e363c+'&'+_0xd14c16,'auth':_0x20a193,'json':!![]};logger[_0x84de('0x12')]('['+[_0x46e6d3[_0x84de('0x13')]()]+_0x84de('0x19'),_0x2319f0);return rp(_0x2319f0)[_0x84de('0xd')](function(_0x3cb6b1){logger[_0x84de('0x12')]('['+[_0x46e6d3[_0x84de('0x13')]()]+_0x84de('0x1a'),_0x3cb6b1);if(_0x3cb6b1[_0x84de('0xe')]['length']>0x0&&String(_0x3cb6b1['result'][0x0][_0x84de('0x1b')])===_0x84de('0x1c')){_0x151f92[_0x84de('0x1d')]=_0x3cb6b1[_0x84de('0xe')][0x0]['sys_id'];}else{_0x151f92[_0x84de('0x1d')]=_0x151f92['adminId'];_0x151f92[_0x84de('0x18')]=_0x151f92['adminEmail'];}logger[_0x84de('0x12')]('['+[_0x46e6d3[_0x84de('0x13')]()]+_0x84de('0x1e'),_0x151f92);_0xe53ca1(_0x151f92);})[_0x84de('0x15')](function(_0x16ae9d){logger['error']('['+[_0x46e6d3[_0x84de('0x13')]()]+']',_0x16ae9d[_0x84de('0x1f')]);_0x2e2b08(_0x16ae9d[_0x84de('0x1f')]);});}else{logger[_0x84de('0x12')]('['+[_0x46e6d3[_0x84de('0x13')]()]+']\x20using\x20admin\x20profile');_0x151f92[_0x84de('0x1d')]=_0x151f92[_0x84de('0x10')];_0x151f92[_0x84de('0x18')]=_0x151f92[_0x84de('0x20')];_0xe53ca1(_0x151f92);}});};}function createEndUser(_0x13cbd3,_0x11dd03,_0x46fd72,_0x551a73,_0x48f911){logger[_0x84de('0x12')]('['+[_0x13cbd3[_0x84de('0x13')]()]+_0x84de('0x21'),_0x46fd72);return new Promise(function(_0x536078,_0x5c10ee){var _0x3413a4={'method':_0x84de('0x22'),'uri':_0x551a73+'sys_user?'+_0x48f911,'body':{'user_name':_0x46fd72[_0x84de('0x23')],'roles':_0x84de('0x24'),'first_name':_0x46fd72[_0x84de('0x23')],'active':_0x84de('0x1c'),'date_format':_0x84de('0x25'),'phone':_0x46fd72[_0x84de('0x23')]},'auth':_0x11dd03,'json':!![]};return rp(_0x3413a4)[_0x84de('0xd')](function(_0x1d4ec3){logger[_0x84de('0x12')]('['+[_0x13cbd3[_0x84de('0x13')]()]+_0x84de('0x26'),_0x1d4ec3[_0x84de('0xe')]);_0x46fd72[_0x84de('0x27')]=_0x1d4ec3[_0x84de('0xe')][_0x84de('0x11')];_0x536078(_0x46fd72);})[_0x84de('0x15')](function(_0xf81ef7){logger[_0x84de('0x28')]('['+[_0x13cbd3['toUpperCase']()]+']',_0xf81ef7[_0x84de('0x1f')]);_0x5c10ee(_0xf81ef7['message']);});});}function getEndUser(_0x117434,_0x25e161,_0x231428,_0x4c945a,_0xbfd4c7){return function(_0x4edd9a){logger[_0x84de('0x12')]('['+[_0x117434[_0x84de('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x4edd9a);return new Promise(function(_0x92e7a8,_0x19df47){var _0x620326={'method':_0x84de('0x17'),'uri':_0x231428+_0x84de('0x29')+_0x4edd9a[_0x84de('0x23')]+'&'+_0x4c945a+'&'+_0xbfd4c7,'auth':_0x25e161,'json':!![]};return rp(_0x620326)[_0x84de('0xd')](function(_0xbd4c5e){if(_0xbd4c5e[_0x84de('0xe')][_0x84de('0xf')]>0x0){_0x4edd9a['endUserId']=_0xbd4c5e['result'][0x0][_0x84de('0x11')];logger[_0x84de('0x12')]('['+[_0x117434['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x4edd9a);_0x92e7a8(_0x4edd9a);}else{return createEndUser(_0x117434,_0x25e161,_0x4edd9a,_0x231428,_0x4c945a)['then'](function(_0x1f8aaf){logger[_0x84de('0x12')]('['+[_0x117434[_0x84de('0x13')]()]+_0x84de('0x2a'),_0x1f8aaf);_0x92e7a8(_0x1f8aaf);});}})[_0x84de('0x15')](function(_0x224086){logger[_0x84de('0x28')]('['+[_0x117434['toUpperCase']()]+']',_0x224086[_0x84de('0x1f')]);_0x19df47(_0x224086[_0x84de('0x1f')]);});});};}function getCustomFields(_0x437e9b,_0x18e023){var _0x44181a={};if(_0x437e9b[_0x84de('0xf')]>0x0){_[_0x84de('0x2b')](_0x437e9b,function(_0x106578){if(_[_0x84de('0x2c')]([_0x84de('0x2d'),_0x84de('0x2e')],_0x106578['type'])&&_0x106578[_0x84de('0x2f')]&&!_0x106578[_0x84de('0x30')]){_0x44181a[_0x106578[_0x84de('0x2f')]['toLowerCase']()]=_0x106578[_0x84de('0x31')]['toString']();}else if(_[_0x84de('0x2c')](['string',_0x84de('0x2e')],_0x106578[_0x84de('0x32')])&&_0x106578[_0x84de('0x33')]&&_0x106578[_0x84de('0x30')]){_0x44181a[_0x106578['idField']['toLowerCase']()]=_0x106578['content'][_0x84de('0x34')]();}else if(_0x106578[_0x84de('0x32')]===_0x84de('0x35')&&_0x106578[_0x84de('0x36')]&&_0x106578[_0x84de('0x33')]&&_0x106578[_0x84de('0x30')]){_0x44181a[_0x106578[_0x84de('0x33')][_0x84de('0x37')]()]=_0x18e023[_0x106578[_0x84de('0x36')]]['toString']();}else if(_0x106578[_0x84de('0x32')]===_0x84de('0x38')&&_0x106578['Variable']&&_0x106578[_0x84de('0x39')][_0x84de('0x3a')]&&_0x106578[_0x84de('0x33')]&&_0x106578['customField']){_0x44181a[_0x106578[_0x84de('0x33')][_0x84de('0x37')]()]=_0x18e023[_0x106578[_0x84de('0x39')][_0x84de('0x3a')][_0x84de('0x37')]()][_0x84de('0x34')]();}});}return _0x44181a;}function getTicket(_0x501848,_0x58a46c,_0x3ac199,_0x3dc821,_0x1170a9,_0x25dbf7){return function(_0x305c71){logger[_0x84de('0x12')]('['+[_0x501848[_0x84de('0x13')]()]+_0x84de('0x3b'),_0x305c71);return new Promise(function(_0x54f9e2,_0x455e69){var _0x233a20=_0x501848[_0x84de('0x37')]()===_0x84de('0x3c')?_0x305c71[_0x84de('0x1d')]:_0x305c71[_0x84de('0x27')];var _0x40fc32={'method':_0x84de('0x22'),'uri':_0x3ac199+'incident'+'?'+_0x25dbf7,'body':Object['assign']({},{'active':'true','caller_id':_0x233a20,'assigned_to':_0x305c71[_0x84de('0x1d')],'short_description':intUtil[_0x84de('0x3d')](_0x3dc821[_0x84de('0x3e')],_0x1170a9,'\x20'),'description':intUtil[_0x84de('0x3d')](_0x3dc821[_0x84de('0x3f')],_0x1170a9,'\x0a')},getCustomFields(_0x3dc821[_0x84de('0x40')],_0x1170a9)),'auth':_0x58a46c,'json':!![]};return rp(_0x40fc32)[_0x84de('0xd')](function(_0x43523e){logger[_0x84de('0x12')]('['+[_0x501848[_0x84de('0x13')]()]+_0x84de('0x41'),_0x43523e[_0x84de('0xe')]);_0x305c71['ticketId']=_0x43523e['result'][_0x84de('0x11')];_0x305c71[_0x84de('0x42')]=_0x43523e[_0x84de('0xe')][_0x84de('0x43')];logger[_0x84de('0x12')]('['+[_0x501848[_0x84de('0x13')]()]+']\x20getTicket\x20crm',_0x305c71);_0x54f9e2(_0x305c71);})[_0x84de('0x15')](function(_0x340fe4){logger[_0x84de('0x28')]('['+[_0x501848[_0x84de('0x13')]()]+']',_0x340fe4[_0x84de('0x1f')]);_0x455e69(_0x340fe4[_0x84de('0x1f')]);});});};}function createRemoteTag(_0x348026,_0x4ea25d,_0x2cf61a,_0x2d1713){return new Promise(function(_0x4fa54f,_0x2bdb7c){var _0x7247de={'method':_0x84de('0x22'),'uri':_0x2cf61a+_0x84de('0x44')+'?'+_0x2d1713,'body':{'short_description':_0x348026,'global':!![],'active':!![],'name':_0x348026},'auth':_0x4ea25d,'json':!![]};return rp(_0x7247de)[_0x84de('0xd')](function(_0x4b0e80){var _0x3799ad=_0x4b0e80[_0x84de('0xe')]['sys_id'];_0x4fa54f(_0x3799ad);});});}function getRemoteTag(_0x27b6e0,_0x2f89b5,_0x2b70ce,_0x227fdf,_0x5ca49e){return new Promise(function(_0x3cc2ce,_0x594667){var _0x22ef96={'method':_0x84de('0x17'),'uri':_0x2b70ce+'label'+_0x84de('0x45')+_0x27b6e0+'&'+_0x227fdf,'auth':_0x2f89b5,'json':!![]};return rp(_0x22ef96)[_0x84de('0xd')](function(_0x25f7ae){if(_0x25f7ae['result'][_0x84de('0xf')]>0x0){var _0x325742=_0x25f7ae[_0x84de('0xe')][0x0]['sys_id'];_0x3cc2ce(_0x325742);}else{return createRemoteTag(_0x27b6e0,_0x2f89b5,_0x2b70ce,_0x227fdf)[_0x84de('0xd')](function(_0x2e6874){_0x3cc2ce(_0x2e6874);});}});});}function assignTagToIncident(_0xa94d52,_0x47ff1,_0x4a5cc3,_0x2187c8,_0x3d8c86){return new Promise(function(_0xa847f9,_0x535b82){var _0xb1a3dd={'method':'POST','uri':_0x4a5cc3+_0x84de('0x46')+'?'+_0x3d8c86,'body':{'label':_0xa94d52,'table':_0x84de('0x47'),'id_type':_0x84de('0x48'),'table_key':_0x2187c8[_0x84de('0x49')],'title':'Incident\x20-\x20'+_0x2187c8[_0x84de('0x42')],'id_display':_0x2187c8['ticketNumber']},'auth':_0x47ff1,'json':!![]};return rp(_0xb1a3dd)['then'](function(_0x1a1fcc){_0xa847f9();})[_0x84de('0x15')](function(){_0xa847f9();});});}function manageTags(_0x49d44a,_0x23b7c8,_0x48f5ea,_0x44e335,_0x5c193e,_0x1c442e,_0x59f5c9){return new Promise(function(_0x5314c3,_0x175ce8){var _0x5d7782=[];_0x23b7c8[_0x84de('0x2b')](function(_0x1f7431){_0x5d7782[_0x84de('0x4a')](getRemoteTag(_0x1f7431,_0x48f5ea,_0x44e335,_0x1c442e,_0x59f5c9));});return Promise[_0x84de('0x4b')](_0x5d7782)[_0x84de('0xd')](function(_0x457c1b){if(_0x457c1b[_0x84de('0xf')]){logger[_0x84de('0x12')]('['+[_0x49d44a[_0x84de('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x457c1b);var _0x2c6415=[];_0x457c1b[_0x84de('0x2b')](function(_0x3d34dc){_0x2c6415['push'](assignTagToIncident(_0x3d34dc,_0x48f5ea,_0x44e335,_0x5c193e,_0x1c442e));});return Promise['all'](_0x2c6415)[_0x84de('0xd')](function(){_0x5314c3();})[_0x84de('0x15')](function(){_0x5314c3();});}else{_0x5314c3();}});});}function getTags(_0x3d187d,_0x19ec6e,_0x48ada2,_0x198ea3,_0x3f730f,_0x4f738e){return function(_0x10145b){return new Promise(function(_0x5dae38,_0x32334e){var _0x4855fc=[];var _0xf63c4d=_0x198ea3[_0x84de('0x4c')];if(_0xf63c4d&&_0xf63c4d['length']>0x0){_0x4855fc=_[_0x84de('0x4d')](_0xf63c4d,_0x84de('0x3a'));}if(_0x4855fc[_0x84de('0xf')]>0x0){return manageTags(_0x3d187d,_0x4855fc,_0x19ec6e,_0x48ada2,_0x10145b,_0x3f730f,_0x4f738e)['then'](function(){_0x5dae38(_0x10145b);});}else{_0x5dae38(_0x10145b);}});};}function emit(_0x310564,_0x26e435,_0x546172){var _0x5b8911='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x84de('0x4e')+'%255EORDERBYDESCnumber';var _0x449f68={'uri':_0x310564+_0x84de('0x4f')+_0x546172+_0x5b8911};io['to'](util['format'](_0x84de('0x50'),_0x26e435))[_0x84de('0x51')](_0x84de('0x52'),_0x449f68);}exports['cs']=function(_0x3c3170,_0x28f37b,_0x2ee263,_0x75dff5,_0x2c4380,_0x3b0c38,_0xd43ea,_0x2cab9b){var _0x475ea7={};var _0xc770={'user':_0x3b0c38[_0x84de('0x53')],'pass':_0x3b0c38[_0x84de('0x54')]};var _0x4bf0cb=_0x84de('0x55');var _0x32a5c6=_0x84de('0x56');_0x3b0c38[_0x84de('0x57')]=intUtil[_0x84de('0x58')](_0x3b0c38['remoteUri']);_0x3b0c38['serverUrl']=intUtil[_0x84de('0x58')](_0x3b0c38['serverUrl']);var _0x1333ad=util[_0x84de('0x59')]('%s/api/now/table/',_0x3b0c38[_0x84de('0x57')]);_0x475ea7[_0x84de('0x18')]=!_['isNil'](_0x75dff5)?_0x75dff5[_0x84de('0x5a')]:null;_0x475ea7['adminEmail']=_0x3b0c38[_0x84de('0x5a')];_0x475ea7[_0x84de('0x23')]=_0x2cab9b[_0x84de('0x37')]()===_0x84de('0x3c')?_0x28f37b[_0x84de('0x5b')]:_0x28f37b[_0x84de('0x5c')];_0x475ea7[_0x84de('0x5d')]=_0x2cab9b===_0x84de('0x5e')||_0x2cab9b==='unmanaged'?'queue':_0x84de('0x3c');var _0x1ff157=util[_0x84de('0x59')](_0x84de('0x5f'),_0x3b0c38['serverUrl'],_0x28f37b[_0x84de('0x60')],md5(_0x28f37b[_0x84de('0x60')]));if(_0x2c4380&&_0x2c4380[_0x84de('0x61')]){logger['info'](_0x84de('0x62'),_0x84de('0x63'));_0x28f37b[_0x84de('0x64')]=_0x1ff157;}else if(_0xd43ea&&_0xd43ea[_0x84de('0x65')]&&_0xd43ea[_0x84de('0x65')]!=='none'){logger[_0x84de('0x12')](_0x84de('0x66'),_0x84de('0x63'));_0x28f37b[_0x84de('0x64')]=_0x1ff157;}else{_0x28f37b['recordingURL']='';}return getAdminUser(_0x2cab9b,_0xc770,_0x475ea7,_0x1333ad,_0x32a5c6,_0x4bf0cb)[_0x84de('0xd')](getUser(_0x2cab9b,_0xc770,_0x1333ad,_0x32a5c6,_0x4bf0cb))[_0x84de('0xd')](getEndUser(_0x2cab9b,_0xc770,_0x1333ad,_0x32a5c6,_0x4bf0cb))['then'](getTicket(_0x2cab9b,_0xc770,_0x1333ad,_0x2ee263,_0x28f37b,_0x32a5c6))[_0x84de('0xd')](function(_0x48ae11){logger[_0x84de('0x12')](util['format'](_0x84de('0x67'),_0x48ae11['ticketId']));logger[_0x84de('0x12')](util[_0x84de('0x59')](_0x84de('0x68'),_0x2cab9b));if(_0x2cab9b!==_0x84de('0x69')){logger[_0x84de('0x12')]('['+[_0x2cab9b[_0x84de('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3b0c38[_0x84de('0x57')],_0x75dff5[_0x84de('0x3a')],_0x48ae11['ticketId']);}})[_0x84de('0x15')](function(_0x32638f){logger['error']('['+[_0x2cab9b[_0x84de('0x13')]()]+_0x84de('0x6a'),util[_0x84de('0x6b')](_0x32638f,{'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 a51936e..1e2df89 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 _0xe8c5=['duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','set_entry','JSON','format','apiKey','toString','base64','isNil','stringify','name','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','customField','nameField','toLowerCase','content','idField','variable','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','calleridnum','toUpperCase','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by','toISOString','slice'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0xe8c5,0xd7));var _0x5e8c=function(_0x3b10c0,_0x237860){_0x3b10c0=_0x3b10c0-0x0;var _0x329e55=_0xe8c5[_0x3b10c0];return _0x329e55;};'use strict';var _=require('lodash');var rp=require(_0x5e8c('0x0'));var BPromise=require(_0x5e8c('0x1'));var md5=require(_0x5e8c('0x2'));var util=require(_0x5e8c('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5e8c('0x4'));var config=require(_0x5e8c('0x5'));var logger=require(_0x5e8c('0x6'))(_0x5e8c('0x7'));config[_0x5e8c('0x8')]=_[_0x5e8c('0x9')](config[_0x5e8c('0x8')],{'host':_0x5e8c('0xa'),'port':0x18eb});var io=require(_0x5e8c('0xb'))(new Redis(config[_0x5e8c('0x8')]));var def={'method':_0x5e8c('0xc'),'json':!![]};function emit(_0x4260af,_0x5e5449,_0x3c8b53){io['to'](_0x4260af)[_0x5e8c('0xd')](_0x5e5449,_0x3c8b53);}function getTicket(_0xd9fc05,_0x474981,_0x14a6fd,_0xfeed96,_0x21db58,_0x56f425,_0x442d57,_0x550710){logger[_0x5e8c('0xe')](_0x5e8c('0xf'));var _0x580065=new Date();var _0x4b37c9=[{'name':'name','value':intUtil[_0x5e8c('0x10')](_0xfeed96['Subjects'],_0x21db58,'\x20')},{'name':_0x5e8c('0x11'),'value':_0x474981['id']},{'name':_0x5e8c('0x12'),'value':_0x474981['id']},{'name':'description','value':intUtil[_0x5e8c('0x10')](_0xfeed96['Descriptions'],_0x21db58,'\x0a')},{'name':'date_start','value':_0x580065[_0x5e8c('0x13')]()[_0x5e8c('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x5e8c('0x15'),'value':'15'},{'name':_0x5e8c('0x16'),'value':_0x14a6fd['id']},{'name':_0x5e8c('0x17'),'value':_0x5e8c('0x18')},{'name':_0x5e8c('0x19'),'value':_0x14a6fd['name']},{'name':'direction','value':_0x550710}];if(_0x56f425[_0x5e8c('0x1a')]){_[_0x5e8c('0x1b')](_0x56f425,function(_0x4c4323){if(_0x21db58[_0x4c4323[_0x5e8c('0x1c')]]){_0x4b37c9[_0x5e8c('0x1d')]({'name':_0x4c4323['idField'],'value':_0x21db58[_0x4c4323[_0x5e8c('0x1c')]]});}});}return request({'form':{'method':_0x5e8c('0x1e'),'input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON['stringify']({'session':_0x442d57['id'],'module_name':'Calls','name_value_list':_0x4b37c9})}});}function getAuth(_0x353b82){return util[_0x5e8c('0x20')]('Basic\x20%s',new Buffer(_0x353b82[_0x5e8c('0x21')]+':X')[_0x5e8c('0x22')](_0x5e8c('0x23')));}function getServerInfo(_0x3a8a9e){return request({'form':{'method':'get_server_info','input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON['stringify']({'session':_0x3a8a9e['id']})}});}function getUser(_0x7e76f4,_0x333343,_0x5340b2){if(!_[_0x5e8c('0x24')](_0x333343)){logger[_0x5e8c('0xe')]('Getting\x20agent\x20with\x20name',_0x333343);return request({'form':{'method':'get_entry_list','input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON[_0x5e8c('0x25')]({'session':_0x5340b2['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x333343),'order_by':'','offset':'0','select_fields':['id',_0x5e8c('0x26'),_0x5e8c('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5e8c('0x28')](function(_0x3c0f6c){if(_0x3c0f6c[_0x5e8c('0x29')][_0x5e8c('0x1a')]){var _0x5026d8=_[_0x5e8c('0x2a')](_0x3c0f6c[_0x5e8c('0x29')],function(_0x410eb2){return _0x410eb2[_0x5e8c('0x2b')][_0x5e8c('0x27')][_0x5e8c('0x2c')]===_0x333343;});if(_0x5026d8){logger[_0x5e8c('0xe')](_0x5e8c('0x2d'));return BPromise[_0x5e8c('0x2e')]({'id':_0x5026d8[_0x5e8c('0x2b')]['id'][_0x5e8c('0x2c')],'name':_0x5026d8['name_value_list'][_0x5e8c('0x26')]['value']});}}logger[_0x5e8c('0xe')](_0x5e8c('0x2f'));return BPromise[_0x5e8c('0x2e')]({'id':_0x5340b2['name_value_list'][_0x5e8c('0x30')][_0x5e8c('0x2c')],'name':_0x5340b2[_0x5e8c('0x2b')][_0x5e8c('0x27')][_0x5e8c('0x2c')]});});}else{logger[_0x5e8c('0xe')](_0x5e8c('0x31'));return BPromise[_0x5e8c('0x2e')]({'id':_0x5340b2['name_value_list']['user_id']['value'],'name':_0x5340b2[_0x5e8c('0x2b')][_0x5e8c('0x27')][_0x5e8c('0x2c')]});}}function getEndUser(_0x5214a3,_0x2f8a4d,_0x5365ce,_0x27e957){logger['info'](_0x5e8c('0x32'),_0x5365ce);return request({'form':{'method':'get_entry_list','input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON[_0x5e8c('0x25')]({'session':_0x27e957['id'],'module_name':_0x5e8c('0x18'),'query':util[_0x5e8c('0x20')](_0x5e8c('0x33'),_0x5365ce),'order_by':'','offset':'0','select_fields':['id',_0x5e8c('0x26'),_0x5e8c('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x78400a){if(_0x78400a[_0x5e8c('0x29')][_0x5e8c('0x1a')]){var _0x3d3397=_['find'](_0x78400a[_0x5e8c('0x29')],function(_0x3ada7e){return _0x3ada7e[_0x5e8c('0x2b')]['phone_home'][_0x5e8c('0x2c')]===_0x5365ce;});if(_0x3d3397){logger['info']('Enduser\x20found!');return BPromise[_0x5e8c('0x2e')]({'id':_0x3d3397['name_value_list']['id']['value'],'name':_0x3d3397['name_value_list'][_0x5e8c('0x26')][_0x5e8c('0x2c')],'phone':_0x3d3397['name_value_list'][_0x5e8c('0x34')][_0x5e8c('0x2c')]});}}else{logger[_0x5e8c('0xe')](_0x5e8c('0x35'));return request({'form':{'method':'set_entry','input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON[_0x5e8c('0x25')]({'session':_0x27e957['id'],'module_name':_0x5e8c('0x18'),'name_value_list':[{'name':_0x5e8c('0x36'),'value':_0x2f8a4d!==_0x5e8c('0x37')?_0x2f8a4d:util[_0x5e8c('0x20')](_0x5e8c('0x38'),_0x5365ce)},{'name':'phone_home','value':_0x5365ce}]})}})[_0x5e8c('0x28')](function(_0x16e01b){logger[_0x5e8c('0xe')](_0x5e8c('0x39'));return BPromise[_0x5e8c('0x2e')]({'id':_0x16e01b['id'],'name':_0x16e01b[_0x5e8c('0x29')]['first_name'][_0x5e8c('0x2c')],'phone':_0x16e01b[_0x5e8c('0x29')][_0x5e8c('0x34')]['value']});});}});}function request(_0x4a8ee2){logger[_0x5e8c('0x3a')](_0x5e8c('0x3b'),JSON['stringify'](_0x4a8ee2));return rp(_[_0x5e8c('0x3c')](def,_0x4a8ee2));}function getTags(_0x308b1c,_0x406d4b){var _0x118e5d=[];if(_0x308b1c&&_0x308b1c[_0x5e8c('0x1a')]>0x0){_0x118e5d=_['map'](_0x308b1c,_0x406d4b);}return _0x118e5d;}function getCustomFields(_0x31531c,_0x3d54a7){var _0x2706d7=[];var _0x202c7d={'custom_fields':[]};if(_0x31531c[_0x5e8c('0x1a')]>0x0){_[_0x5e8c('0x1b')](_0x31531c,function(_0x988dfa){if(_0x988dfa[_0x5e8c('0x3d')]===_0x5e8c('0x3e')&&_0x988dfa['nameField']&&!_0x988dfa[_0x5e8c('0x3f')]){_0x202c7d[_0x988dfa[_0x5e8c('0x40')][_0x5e8c('0x41')]()]=_0x988dfa[_0x5e8c('0x42')]['toString']();}else if(_0x988dfa['type']===_0x5e8c('0x3e')&&_0x988dfa[_0x5e8c('0x43')]&&_0x988dfa[_0x5e8c('0x3f')]){_0x202c7d['custom_fields']['push']({'id':_0x988dfa[_0x5e8c('0x43')],'value':_0x988dfa[_0x5e8c('0x42')][_0x5e8c('0x22')]()});}else if(_0x988dfa[_0x5e8c('0x3d')]===_0x5e8c('0x44')&&_0x988dfa[_0x5e8c('0x1c')]&&_0x988dfa[_0x5e8c('0x43')]&&_0x988dfa[_0x5e8c('0x3f')]){_0x3d54a7[_0x988dfa['variableName']]&&_0x202c7d[_0x5e8c('0x45')][_0x5e8c('0x1d')]({'id':_0x988dfa[_0x5e8c('0x43')],'value':_0x3d54a7[_0x988dfa['variableName']]['toString']()});}else if(_0x988dfa['type']===_0x5e8c('0x46')&&_0x988dfa[_0x5e8c('0x47')]&&_0x988dfa[_0x5e8c('0x47')][_0x5e8c('0x26')]&&_0x988dfa[_0x5e8c('0x43')]&&_0x988dfa[_0x5e8c('0x3f')]){_0x3d54a7[_0x988dfa[_0x5e8c('0x47')][_0x5e8c('0x26')][_0x5e8c('0x41')]()]&&_0x202c7d['custom_fields']['push']({'id':_0x988dfa['idField'],'value':_0x3d54a7[_0x988dfa['Variable'][_0x5e8c('0x26')][_0x5e8c('0x41')]()][_0x5e8c('0x22')]()});}});}return _0x202c7d;}function getConnection(_0x1585a2){return request({'method':_0x5e8c('0xc'),'form':{'method':_0x5e8c('0x48'),'input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON[_0x5e8c('0x25')]({'user_auth':{'user_name':_0x1585a2[_0x5e8c('0x49')],'password':_0x1585a2[_0x5e8c('0x4a')],'encryption':'PLAIN'},'application':_0x5e8c('0x4b')})}})['then'](function(_0x3434da){var _0x48676f=_0x3434da;if(_0x48676f['id']){def['sessionID']=_0x48676f['id'];return BPromise[_0x5e8c('0x2e')](_0x48676f);}else{throw new Error(util['format'](_0x5e8c('0x4c'),_0x1585a2['id']));}});}function setRelationship(_0x3469fd,_0x89a0a6,_0x117677,_0x19e45b){return request({'form':{'method':_0x5e8c('0x4d'),'input_type':_0x5e8c('0x1f'),'response_type':_0x5e8c('0x1f'),'rest_data':JSON['stringify']({'session':_0x3469fd['id'],'module_name':_0x5e8c('0x4e'),'module_id':_0x117677['id'],'link_field_name':_0x19e45b,'related_ids':[_0x89a0a6['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x169377,_0x4381da,_0x32ea0e,_0x40b6d7,_0x3543dc,_0x497129){var _0x32f83e,_0x306bdf,_0x2c43d8,_0x514511;_0x497129[_0x5e8c('0x4f')]=intUtil[_0x5e8c('0x50')](_0x497129['remoteUri']);_0x497129['serverUrl']=intUtil['stripTrailingSlash'](_0x497129[_0x5e8c('0x51')]);def[_0x5e8c('0x52')]=util[_0x5e8c('0x20')](_0x5e8c('0x53'),_0x497129[_0x5e8c('0x4f')]);if(_0x3543dc&&_0x3543dc[_0x5e8c('0x54')]){logger[_0x5e8c('0xe')](_0x5e8c('0x55'),_0x5e8c('0x56'));_0x4381da[_0x5e8c('0x57')]=util[_0x5e8c('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x497129[_0x5e8c('0x51')],_0x4381da[_0x5e8c('0x58')],md5(_0x4381da[_0x5e8c('0x58')]));}else{_0x4381da[_0x5e8c('0x57')]='';}return getConnection(_0x497129)[_0x5e8c('0x28')](function(_0x513229){_0x514511=_0x513229;return getUser(_0x497129,_0x40b6d7[_0x5e8c('0x26')],_0x514511);})[_0x5e8c('0x28')](function(_0x1c7e28){_0x32f83e=_0x1c7e28;logger['info'](_0x5e8c('0x59'),_0x32f83e['id']);return getEndUser(_0x497129,_0x4381da['calleridname'],_0x4381da['calleridnum'],_0x514511);})[_0x5e8c('0x28')](function(_0x5dc65e){_0x306bdf=_0x5dc65e;logger['info'](_0x5e8c('0x5a'),_0x306bdf['id']);return getTicket(_0x497129,_0x32f83e,_0x306bdf,_0x32ea0e,_0x4381da,_0x32ea0e[_0x5e8c('0x5b')],_0x514511,_0x5e8c('0x5c'));})['then'](function(_0x4ab92a){_0x2c43d8=_0x4ab92a;logger['info']('Ticket\x20created!');logger[_0x5e8c('0xe')](_0x5e8c('0x5d'),_0x2c43d8['id']);return setRelationship(_0x514511,_0x32f83e,_0x2c43d8,'users');})[_0x5e8c('0x28')](function(){return setRelationship(_0x514511,_0x306bdf,_0x2c43d8,_0x5e8c('0x5e'));})[_0x5e8c('0x28')](function(){return getServerInfo(_0x514511);})[_0x5e8c('0x28')](function(_0x4d81de){var _0x56af35=parseInt(_0x4d81de['version'][_0x5e8c('0x5f')](0x0));var _0x2e33a1=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x497129['remoteUri'],_0x2c43d8['id']);if(_0x56af35>0x6){_0x2e33a1=util[_0x5e8c('0x20')](_0x5e8c('0x60'),_0x497129[_0x5e8c('0x4f')],_0x2c43d8['id']);}logger[_0x5e8c('0xe')]('[QUEUE]',_0x5e8c('0x61'));emit(util[_0x5e8c('0x20')](_0x5e8c('0x62'),_0x40b6d7['name']),_0x5e8c('0x63'),{'uri':_0x2e33a1});})[_0x5e8c('0x64')](function(_0x2b96e3){logger[_0x5e8c('0x65')](_0x5e8c('0x55'),JSON['stringify'](_0x2b96e3));});};exports[_0x5e8c('0x66')]=function(_0x40bdcd,_0x537836,_0x1e6b38,_0x5d017c,_0x103c4f,_0x10ed6d,_0x1aa1d9){var _0x3a0b1d,_0x393796,_0x3cca24,_0xc338c3;_0x10ed6d[_0x5e8c('0x4f')]=intUtil[_0x5e8c('0x50')](_0x10ed6d[_0x5e8c('0x4f')]);_0x10ed6d[_0x5e8c('0x51')]=intUtil[_0x5e8c('0x50')](_0x10ed6d[_0x5e8c('0x51')]);def[_0x5e8c('0x52')]=util[_0x5e8c('0x20')]('%s/service/v4_1/rest.php',_0x10ed6d[_0x5e8c('0x4f')]);if(_0x1aa1d9&&_0x1aa1d9[_0x5e8c('0x67')]&&_0x1aa1d9[_0x5e8c('0x67')]!==_0x5e8c('0x68')){logger[_0x5e8c('0xe')](_0x5e8c('0x69'),_0x5e8c('0x56'));_0x537836[_0x5e8c('0x57')]=util['format'](_0x5e8c('0x6a'),_0x10ed6d[_0x5e8c('0x51')],_0x537836[_0x5e8c('0x58')],md5(_0x537836['uniqueid']));}return getConnection(_0x10ed6d)['then'](function(_0x37bd2d){_0xc338c3=_0x37bd2d;return getUser(_0x10ed6d,_0x5d017c[_0x5e8c('0x26')],_0xc338c3);})[_0x5e8c('0x28')](function(_0x3cb5f7){_0x3a0b1d=_0x3cb5f7;logger[_0x5e8c('0xe')]('The\x20User\x20ID\x20is:',_0x3a0b1d['id']);return getEndUser(_0x10ed6d,_0x537836[_0x5e8c('0x6b')],_0x537836[_0x5e8c('0x6c')],_0xc338c3);})[_0x5e8c('0x28')](function(_0x398c35){_0x393796=_0x398c35;logger[_0x5e8c('0xe')](_0x5e8c('0x5a'),_0x393796['id']);return getTicket(_0x10ed6d,_0x3a0b1d,_0x393796,_0x1e6b38,_0x537836,_0x1e6b38['Fields'],_0xc338c3,_0x5e8c('0x6d'));})[_0x5e8c('0x28')](function(_0x482c72){_0x3cca24=_0x482c72;logger[_0x5e8c('0xe')](_0x5e8c('0x6e'));logger[_0x5e8c('0xe')](_0x5e8c('0x5d'),_0x3cca24['id']);return setRelationship(_0xc338c3,_0x3a0b1d,_0x3cca24,_0x5e8c('0x6f'));})[_0x5e8c('0x28')](function(){return setRelationship(_0xc338c3,_0x393796,_0x3cca24,_0x5e8c('0x5e'));})[_0x5e8c('0x28')](function(){return getServerInfo(_0xc338c3);})[_0x5e8c('0x28')](function(_0x2f0670){var _0x8c95b8=parseInt(_0x2f0670[_0x5e8c('0x70')][_0x5e8c('0x5f')](0x0));var _0x516e52=util[_0x5e8c('0x20')](_0x5e8c('0x71'),_0x10ed6d[_0x5e8c('0x4f')],_0x3cca24['id']);if(_0x8c95b8>0x6){_0x516e52=util[_0x5e8c('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x10ed6d[_0x5e8c('0x4f')],_0x3cca24['id']);}logger[_0x5e8c('0xe')](_0x5e8c('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5e8c('0x20')](_0x5e8c('0x62'),_0x5d017c[_0x5e8c('0x26')]),_0x5e8c('0x63'),{'uri':_0x516e52});})[_0x5e8c('0x64')](function(_0x5bf4e6){logger[_0x5e8c('0x65')](_0x5e8c('0x69'),JSON['stringify'](_0x5bf4e6));});};exports[_0x5e8c('0x72')]=function(_0x17eb35,_0x1911ea,_0x1f0233,_0x2d58d6,_0x4dfbe6,_0x45e9a4){var _0x52c6e6,_0x19b67c,_0x2fc2d3,_0x414163;_0x45e9a4[_0x5e8c('0x4f')]=intUtil[_0x5e8c('0x50')](_0x45e9a4[_0x5e8c('0x4f')]);_0x45e9a4[_0x5e8c('0x51')]=intUtil[_0x5e8c('0x50')](_0x45e9a4[_0x5e8c('0x51')]);def[_0x5e8c('0x52')]=util[_0x5e8c('0x20')](_0x5e8c('0x53'),_0x45e9a4[_0x5e8c('0x4f')]);if(_0x4dfbe6&&_0x4dfbe6[_0x5e8c('0x54')]){logger[_0x5e8c('0xe')]('['+_0x1911ea[_0x5e8c('0x73')]['toUpperCase']()+']',_0x5e8c('0x56'));_0x1911ea[_0x5e8c('0x57')]=util[_0x5e8c('0x20')](_0x5e8c('0x6a'),_0x45e9a4[_0x5e8c('0x51')],_0x1911ea[_0x5e8c('0x58')],md5(_0x1911ea[_0x5e8c('0x58')]));}else{_0x1911ea[_0x5e8c('0x57')]='';}return getConnection(_0x45e9a4)[_0x5e8c('0x28')](function(_0x2011d3){_0x414163=_0x2011d3;if(!_[_0x5e8c('0x24')](_0x2d58d6)){return getUser(_0x45e9a4,_0x2d58d6[_0x5e8c('0x26')],_0x414163);}else{return getUser(_0x45e9a4,null,_0x414163);}})['then'](function(_0x583e77){_0x52c6e6=_0x583e77;logger[_0x5e8c('0xe')](_0x5e8c('0x59'),_0x52c6e6['id']);return getEndUser(_0x45e9a4,_0x1911ea['calleridname'],_0x1911ea[_0x5e8c('0x74')],_0x414163);})['then'](function(_0x37769e){_0x19b67c=_0x37769e;logger['info'](_0x5e8c('0x5a'),_0x19b67c['id']);return getTicket(_0x45e9a4,_0x52c6e6,_0x19b67c,_0x1f0233,_0x1911ea,_0x1f0233[_0x5e8c('0x5b')],_0x414163,_0x5e8c('0x5c'));})['then'](function(_0x487ea8){_0x2fc2d3=_0x487ea8;logger[_0x5e8c('0xe')](_0x5e8c('0x6e'));logger[_0x5e8c('0xe')](_0x5e8c('0x5d'),_0x2fc2d3['id']);return setRelationship(_0x414163,_0x52c6e6,_0x2fc2d3,_0x5e8c('0x6f'));})[_0x5e8c('0x28')](function(){return setRelationship(_0x414163,_0x19b67c,_0x2fc2d3,_0x5e8c('0x5e'));})[_0x5e8c('0x28')](function(){return getServerInfo(_0x414163);})[_0x5e8c('0x64')](function(_0x25a651){logger[_0x5e8c('0x65')]('['+_0x1911ea['lastevent'][_0x5e8c('0x75')]()+']',JSON[_0x5e8c('0x25')](_0x25a651));});}; \ No newline at end of file +var _0x0a06=['set_entry','JSON','stringify','format','apiKey','base64','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','find','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','variable','variableName','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','remoteUri','stripTrailingSlash','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','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/service/v4_1/rest.php','lastevent','toUpperCase','isNil','request-promise','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','description','Descriptions','date_start','replace','parent_type','Contacts','direction','length','forEach','push','idField'];(function(_0x162802,_0x555c15){var _0x24d606=function(_0x4eff2f){while(--_0x4eff2f){_0x162802['push'](_0x162802['shift']());}};_0x24d606(++_0x555c15);}(_0x0a06,0x13c));var _0x60a0=function(_0xee588,_0x368239){_0xee588=_0xee588-0x0;var _0x58dd1a=_0x0a06[_0xee588];return _0x58dd1a;};'use strict';var _=require('lodash');var rp=require(_0x60a0('0x0'));var BPromise=require(_0x60a0('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x60a0('0x2'));var intUtil=require(_0x60a0('0x3'));var config=require(_0x60a0('0x4'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x60a0('0x5')]=_[_0x60a0('0x6')](config[_0x60a0('0x5')],{'host':_0x60a0('0x7'),'port':0x18eb});var io=require(_0x60a0('0x8'))(new Redis(config[_0x60a0('0x5')]));var def={'method':_0x60a0('0x9'),'json':!![]};function emit(_0xbafd1c,_0x5be689,_0x4e47df){io['to'](_0xbafd1c)[_0x60a0('0xa')](_0x5be689,_0x4e47df);}function getTicket(_0x1a8953,_0xf228a4,_0x905881,_0x11de37,_0x64d579,_0x367633,_0x5d942a,_0x330e3c){logger[_0x60a0('0xb')](_0x60a0('0xc'));var _0x4c62f0=new Date();var _0x331219=[{'name':'name','value':intUtil[_0x60a0('0xd')](_0x11de37['Subjects'],_0x64d579,'\x20')},{'name':_0x60a0('0xe'),'value':_0xf228a4['id']},{'name':'created_by','value':_0xf228a4['id']},{'name':_0x60a0('0xf'),'value':intUtil[_0x60a0('0xd')](_0x11de37[_0x60a0('0x10')],_0x64d579,'\x0a')},{'name':_0x60a0('0x11'),'value':_0x4c62f0['toISOString']()['slice'](0x0,0x13)[_0x60a0('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x905881['id']},{'name':_0x60a0('0x13'),'value':_0x60a0('0x14')},{'name':'parent_name','value':_0x905881['name']},{'name':_0x60a0('0x15'),'value':_0x330e3c}];if(_0x367633[_0x60a0('0x16')]){_[_0x60a0('0x17')](_0x367633,function(_0x974191){if(_0x64d579[_0x974191['variableName']]){_0x331219[_0x60a0('0x18')]({'name':_0x974191[_0x60a0('0x19')],'value':_0x64d579[_0x974191['variableName']]});}});}return request({'form':{'method':_0x60a0('0x1a'),'input_type':_0x60a0('0x1b'),'response_type':'JSON','rest_data':JSON[_0x60a0('0x1c')]({'session':_0x5d942a['id'],'module_name':'Calls','name_value_list':_0x331219})}});}function getAuth(_0x23b373){return util[_0x60a0('0x1d')]('Basic\x20%s',new Buffer(_0x23b373[_0x60a0('0x1e')]+':X')['toString'](_0x60a0('0x1f')));}function getServerInfo(_0x25925c){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x60a0('0x1c')]({'session':_0x25925c['id']})}});}function getUser(_0x1c60f8,_0x2570dc,_0x269d13){if(!_['isNil'](_0x2570dc)){logger[_0x60a0('0xb')](_0x60a0('0x20'),_0x2570dc);return request({'form':{'method':_0x60a0('0x21'),'input_type':'JSON','response_type':_0x60a0('0x1b'),'rest_data':JSON[_0x60a0('0x1c')]({'session':_0x269d13['id'],'module_name':'Employees','query':util[_0x60a0('0x1d')](_0x60a0('0x22'),_0x2570dc),'order_by':'','offset':'0','select_fields':['id','name',_0x60a0('0x23')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x60a0('0x24')](function(_0x1bba49){if(_0x1bba49[_0x60a0('0x25')]['length']){var _0x1e8237=_['find'](_0x1bba49[_0x60a0('0x25')],function(_0x4c50f7){return _0x4c50f7[_0x60a0('0x26')][_0x60a0('0x23')][_0x60a0('0x27')]===_0x2570dc;});if(_0x1e8237){logger[_0x60a0('0xb')](_0x60a0('0x28'));return BPromise['resolve']({'id':_0x1e8237[_0x60a0('0x26')]['id'][_0x60a0('0x27')],'name':_0x1e8237['name_value_list'][_0x60a0('0x29')][_0x60a0('0x27')]});}}logger['info'](_0x60a0('0x2a'));return BPromise[_0x60a0('0x2b')]({'id':_0x269d13[_0x60a0('0x26')][_0x60a0('0x2c')][_0x60a0('0x27')],'name':_0x269d13['name_value_list'][_0x60a0('0x23')][_0x60a0('0x27')]});});}else{logger[_0x60a0('0xb')](_0x60a0('0x2d'));return BPromise[_0x60a0('0x2b')]({'id':_0x269d13[_0x60a0('0x26')][_0x60a0('0x2c')][_0x60a0('0x27')],'name':_0x269d13[_0x60a0('0x26')][_0x60a0('0x23')][_0x60a0('0x27')]});}}function getEndUser(_0x5d0c14,_0x114d5e,_0x291a05,_0x560b76){logger[_0x60a0('0xb')](_0x60a0('0x2e'),_0x291a05);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x60a0('0x1b'),'rest_data':JSON['stringify']({'session':_0x560b76['id'],'module_name':'Contacts','query':util[_0x60a0('0x1d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x291a05),'order_by':'','offset':'0','select_fields':['id',_0x60a0('0x29'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x60a0('0x24')](function(_0x95aacf){if(_0x95aacf[_0x60a0('0x25')][_0x60a0('0x16')]){var _0x207386=_[_0x60a0('0x2f')](_0x95aacf[_0x60a0('0x25')],function(_0x3f3b96){return _0x3f3b96[_0x60a0('0x26')]['phone_home'][_0x60a0('0x27')]===_0x291a05;});if(_0x207386){logger['info'](_0x60a0('0x30'));return BPromise[_0x60a0('0x2b')]({'id':_0x207386['name_value_list']['id']['value'],'name':_0x207386[_0x60a0('0x26')]['name'][_0x60a0('0x27')],'phone':_0x207386[_0x60a0('0x26')][_0x60a0('0x31')][_0x60a0('0x27')]});}}else{logger[_0x60a0('0xb')](_0x60a0('0x32'));return request({'form':{'method':'set_entry','input_type':_0x60a0('0x1b'),'response_type':'JSON','rest_data':JSON[_0x60a0('0x1c')]({'session':_0x560b76['id'],'module_name':_0x60a0('0x14'),'name_value_list':[{'name':'first_name','value':_0x114d5e!==''?_0x114d5e:util['format'](_0x60a0('0x33'),_0x291a05)},{'name':'phone_home','value':_0x291a05}]})}})[_0x60a0('0x24')](function(_0x248cfa){logger[_0x60a0('0xb')](_0x60a0('0x34'));return BPromise[_0x60a0('0x2b')]({'id':_0x248cfa['id'],'name':_0x248cfa[_0x60a0('0x25')][_0x60a0('0x35')][_0x60a0('0x27')],'phone':_0x248cfa[_0x60a0('0x25')][_0x60a0('0x31')][_0x60a0('0x27')]});});}});}function request(_0x4a1eba){logger[_0x60a0('0x36')](_0x60a0('0x37'),JSON[_0x60a0('0x1c')](_0x4a1eba));return rp(_[_0x60a0('0x38')](def,_0x4a1eba));}function getTags(_0x48787c,_0xf41be7){var _0x17aadd=[];if(_0x48787c&&_0x48787c[_0x60a0('0x16')]>0x0){_0x17aadd=_[_0x60a0('0x39')](_0x48787c,_0xf41be7);}return _0x17aadd;}function getCustomFields(_0x1185ff,_0x1afb73){var _0x5e3c7d=[];var _0x584f77={'custom_fields':[]};if(_0x1185ff[_0x60a0('0x16')]>0x0){_['forEach'](_0x1185ff,function(_0x12c7c6){if(_0x12c7c6[_0x60a0('0x3a')]===_0x60a0('0x3b')&&_0x12c7c6[_0x60a0('0x3c')]&&!_0x12c7c6['customField']){_0x584f77[_0x12c7c6[_0x60a0('0x3c')][_0x60a0('0x3d')]()]=_0x12c7c6[_0x60a0('0x3e')][_0x60a0('0x3f')]();}else if(_0x12c7c6['type']==='string'&&_0x12c7c6['idField']&&_0x12c7c6[_0x60a0('0x40')]){_0x584f77[_0x60a0('0x41')][_0x60a0('0x18')]({'id':_0x12c7c6[_0x60a0('0x19')],'value':_0x12c7c6[_0x60a0('0x3e')][_0x60a0('0x3f')]()});}else if(_0x12c7c6[_0x60a0('0x3a')]===_0x60a0('0x42')&&_0x12c7c6[_0x60a0('0x43')]&&_0x12c7c6[_0x60a0('0x19')]&&_0x12c7c6[_0x60a0('0x40')]){_0x1afb73[_0x12c7c6[_0x60a0('0x43')]]&&_0x584f77[_0x60a0('0x41')]['push']({'id':_0x12c7c6['idField'],'value':_0x1afb73[_0x12c7c6[_0x60a0('0x43')]][_0x60a0('0x3f')]()});}else if(_0x12c7c6[_0x60a0('0x3a')]==='customVariable'&&_0x12c7c6[_0x60a0('0x44')]&&_0x12c7c6['Variable'][_0x60a0('0x29')]&&_0x12c7c6[_0x60a0('0x19')]&&_0x12c7c6[_0x60a0('0x40')]){_0x1afb73[_0x12c7c6[_0x60a0('0x44')][_0x60a0('0x29')][_0x60a0('0x3d')]()]&&_0x584f77[_0x60a0('0x41')]['push']({'id':_0x12c7c6['idField'],'value':_0x1afb73[_0x12c7c6[_0x60a0('0x44')][_0x60a0('0x29')][_0x60a0('0x3d')]()]['toString']()});}});}return _0x584f77;}function getConnection(_0x4ab070){return request({'method':'POST','form':{'method':'login','input_type':_0x60a0('0x1b'),'response_type':_0x60a0('0x1b'),'rest_data':JSON[_0x60a0('0x1c')]({'user_auth':{'user_name':_0x4ab070['username'],'password':_0x4ab070[_0x60a0('0x45')],'encryption':_0x60a0('0x46')},'application':_0x60a0('0x47')})}})[_0x60a0('0x24')](function(_0x15b403){var _0x697921=_0x15b403;if(_0x697921['id']){def[_0x60a0('0x48')]=_0x697921['id'];return BPromise[_0x60a0('0x2b')](_0x697921);}else{throw new Error(util[_0x60a0('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4ab070['id']));}});}function setRelationship(_0x1a585b,_0x744814,_0x4082a5,_0x41d39d){return request({'form':{'method':_0x60a0('0x49'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1a585b['id'],'module_name':_0x60a0('0x4a'),'module_id':_0x4082a5['id'],'link_field_name':_0x41d39d,'related_ids':[_0x744814['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5939a2,_0x55691c,_0xf2b16d,_0x1f9e5f,_0xac3bca,_0x56e04c){var _0x8547cc,_0xa4a460,_0x205907,_0xe1c1b4;_0x56e04c[_0x60a0('0x4b')]=intUtil[_0x60a0('0x4c')](_0x56e04c[_0x60a0('0x4b')]);_0x56e04c[_0x60a0('0x4d')]=intUtil[_0x60a0('0x4c')](_0x56e04c['serverUrl']);def[_0x60a0('0x4e')]=util[_0x60a0('0x1d')]('%s/service/v4_1/rest.php',_0x56e04c[_0x60a0('0x4b')]);if(_0xac3bca&&_0xac3bca[_0x60a0('0x4f')]){logger[_0x60a0('0xb')](_0x60a0('0x50'),_0x60a0('0x51'));_0x55691c['recordingURL']=util['format'](_0x60a0('0x52'),_0x56e04c['serverUrl'],_0x55691c[_0x60a0('0x53')],md5(_0x55691c['uniqueid']));}else{_0x55691c[_0x60a0('0x54')]='';}return getConnection(_0x56e04c)[_0x60a0('0x24')](function(_0x47812c){_0xe1c1b4=_0x47812c;return getUser(_0x56e04c,_0x1f9e5f[_0x60a0('0x29')],_0xe1c1b4);})['then'](function(_0x20965d){_0x8547cc=_0x20965d;logger[_0x60a0('0xb')](_0x60a0('0x55'),_0x8547cc['id']);return getEndUser(_0x56e04c,_0x55691c[_0x60a0('0x56')],_0x55691c[_0x60a0('0x57')],_0xe1c1b4);})[_0x60a0('0x24')](function(_0x5a9ad2){_0xa4a460=_0x5a9ad2;logger[_0x60a0('0xb')](_0x60a0('0x58'),_0xa4a460['id']);return getTicket(_0x56e04c,_0x8547cc,_0xa4a460,_0xf2b16d,_0x55691c,_0xf2b16d[_0x60a0('0x59')],_0xe1c1b4,_0x60a0('0x5a'));})[_0x60a0('0x24')](function(_0x5c482e){_0x205907=_0x5c482e;logger[_0x60a0('0xb')](_0x60a0('0x5b'));logger[_0x60a0('0xb')]('The\x20Ticket\x20ID\x20is:',_0x205907['id']);return setRelationship(_0xe1c1b4,_0x8547cc,_0x205907,_0x60a0('0x5c'));})[_0x60a0('0x24')](function(){return setRelationship(_0xe1c1b4,_0xa4a460,_0x205907,_0x60a0('0x5d'));})[_0x60a0('0x24')](function(){return getServerInfo(_0xe1c1b4);})[_0x60a0('0x24')](function(_0x5a8b49){var _0x46d3f9=parseInt(_0x5a8b49[_0x60a0('0x5e')]['charAt'](0x0));var _0x2ac98d=util[_0x60a0('0x1d')](_0x60a0('0x5f'),_0x56e04c[_0x60a0('0x4b')],_0x205907['id']);if(_0x46d3f9>0x6){_0x2ac98d=util['format'](_0x60a0('0x60'),_0x56e04c[_0x60a0('0x4b')],_0x205907['id']);}logger['info'](_0x60a0('0x50'),_0x60a0('0x61'));emit(util['format']('user:%s',_0x1f9e5f[_0x60a0('0x29')]),'trigger:browser:url',{'uri':_0x2ac98d});})[_0x60a0('0x62')](function(_0x472075){logger[_0x60a0('0x63')](_0x60a0('0x50'),JSON[_0x60a0('0x1c')](_0x472075));});};exports[_0x60a0('0x64')]=function(_0x2f89bf,_0x17a65c,_0x3fdea4,_0x29162d,_0x1b1b11,_0x20efa8,_0x3e12dc){var _0x10c4f9,_0x2fbf96,_0x46e620,_0x3dd7cc;_0x20efa8['remoteUri']=intUtil[_0x60a0('0x4c')](_0x20efa8[_0x60a0('0x4b')]);_0x20efa8[_0x60a0('0x4d')]=intUtil[_0x60a0('0x4c')](_0x20efa8[_0x60a0('0x4d')]);def[_0x60a0('0x4e')]=util[_0x60a0('0x1d')]('%s/service/v4_1/rest.php',_0x20efa8[_0x60a0('0x4b')]);if(_0x3e12dc&&_0x3e12dc[_0x60a0('0x65')]&&_0x3e12dc[_0x60a0('0x65')]!==_0x60a0('0x66')){logger[_0x60a0('0xb')](_0x60a0('0x67'),_0x60a0('0x51'));_0x17a65c['recordingURL']=util['format'](_0x60a0('0x52'),_0x20efa8[_0x60a0('0x4d')],_0x17a65c['uniqueid'],md5(_0x17a65c['uniqueid']));}return getConnection(_0x20efa8)[_0x60a0('0x24')](function(_0x57bbec){_0x3dd7cc=_0x57bbec;return getUser(_0x20efa8,_0x29162d['name'],_0x3dd7cc);})['then'](function(_0x5d9861){_0x10c4f9=_0x5d9861;logger[_0x60a0('0xb')](_0x60a0('0x55'),_0x10c4f9['id']);return getEndUser(_0x20efa8,_0x17a65c[_0x60a0('0x68')],_0x17a65c[_0x60a0('0x69')],_0x3dd7cc);})[_0x60a0('0x24')](function(_0x1542a0){_0x2fbf96=_0x1542a0;logger[_0x60a0('0xb')](_0x60a0('0x58'),_0x2fbf96['id']);return getTicket(_0x20efa8,_0x10c4f9,_0x2fbf96,_0x3fdea4,_0x17a65c,_0x3fdea4['Fields'],_0x3dd7cc,_0x60a0('0x6a'));})['then'](function(_0x259920){_0x46e620=_0x259920;logger[_0x60a0('0xb')]('Ticket\x20created!');logger[_0x60a0('0xb')](_0x60a0('0x6b'),_0x46e620['id']);return setRelationship(_0x3dd7cc,_0x10c4f9,_0x46e620,'users');})[_0x60a0('0x24')](function(){return setRelationship(_0x3dd7cc,_0x2fbf96,_0x46e620,_0x60a0('0x5d'));})[_0x60a0('0x24')](function(){return getServerInfo(_0x3dd7cc);})['then'](function(_0x77c348){var _0x299cfc=parseInt(_0x77c348[_0x60a0('0x5e')]['charAt'](0x0));var _0x57f1c3=util[_0x60a0('0x1d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x20efa8[_0x60a0('0x4b')],_0x46e620['id']);if(_0x299cfc>0x6){_0x57f1c3=util[_0x60a0('0x1d')](_0x60a0('0x60'),_0x20efa8[_0x60a0('0x4b')],_0x46e620['id']);}logger[_0x60a0('0xb')](_0x60a0('0x67'),_0x60a0('0x61'));emit(util[_0x60a0('0x1d')](_0x60a0('0x6c'),_0x29162d['name']),_0x60a0('0x6d'),{'uri':_0x57f1c3});})[_0x60a0('0x62')](function(_0x145d05){logger['error'](_0x60a0('0x67'),JSON[_0x60a0('0x1c')](_0x145d05));});};exports['unmanaged']=function(_0x414335,_0x4e13e7,_0x4d06d3,_0x10eb3b,_0x1705d7,_0x3761d7){var _0x5f51bf,_0x56795f,_0x4e6652,_0x3eca3c;_0x3761d7[_0x60a0('0x4b')]=intUtil['stripTrailingSlash'](_0x3761d7[_0x60a0('0x4b')]);_0x3761d7[_0x60a0('0x4d')]=intUtil[_0x60a0('0x4c')](_0x3761d7[_0x60a0('0x4d')]);def['uri']=util[_0x60a0('0x1d')](_0x60a0('0x6e'),_0x3761d7[_0x60a0('0x4b')]);if(_0x1705d7&&_0x1705d7[_0x60a0('0x4f')]){logger[_0x60a0('0xb')]('['+_0x4e13e7[_0x60a0('0x6f')][_0x60a0('0x70')]()+']',_0x60a0('0x51'));_0x4e13e7[_0x60a0('0x54')]=util[_0x60a0('0x1d')](_0x60a0('0x52'),_0x3761d7[_0x60a0('0x4d')],_0x4e13e7[_0x60a0('0x53')],md5(_0x4e13e7['uniqueid']));}else{_0x4e13e7['recordingURL']='';}return getConnection(_0x3761d7)[_0x60a0('0x24')](function(_0x87bc70){_0x3eca3c=_0x87bc70;if(!_[_0x60a0('0x71')](_0x10eb3b)){return getUser(_0x3761d7,_0x10eb3b['name'],_0x3eca3c);}else{return getUser(_0x3761d7,null,_0x3eca3c);}})[_0x60a0('0x24')](function(_0x10e4b1){_0x5f51bf=_0x10e4b1;logger[_0x60a0('0xb')](_0x60a0('0x55'),_0x5f51bf['id']);return getEndUser(_0x3761d7,_0x4e13e7[_0x60a0('0x56')],_0x4e13e7[_0x60a0('0x57')],_0x3eca3c);})[_0x60a0('0x24')](function(_0x2be48b){_0x56795f=_0x2be48b;logger[_0x60a0('0xb')](_0x60a0('0x58'),_0x56795f['id']);return getTicket(_0x3761d7,_0x5f51bf,_0x56795f,_0x4d06d3,_0x4e13e7,_0x4d06d3['Fields'],_0x3eca3c,_0x60a0('0x5a'));})[_0x60a0('0x24')](function(_0x11662f){_0x4e6652=_0x11662f;logger[_0x60a0('0xb')](_0x60a0('0x5b'));logger[_0x60a0('0xb')](_0x60a0('0x6b'),_0x4e6652['id']);return setRelationship(_0x3eca3c,_0x5f51bf,_0x4e6652,_0x60a0('0x5c'));})['then'](function(){return setRelationship(_0x3eca3c,_0x56795f,_0x4e6652,'contacts');})[_0x60a0('0x24')](function(){return getServerInfo(_0x3eca3c);})[_0x60a0('0x62')](function(_0x1a67de){logger['error']('['+_0x4e13e7['lastevent'][_0x60a0('0x70')]()+']',JSON[_0x60a0('0x1c')](_0x1a67de));});}; \ 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 df0f9b3..be94d3b 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 _0x3f51=['stripTrailingSlash','slice','test','util','getString','sortBy','length','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyType','key','format','keyContent','%s:\x20%s'];(function(_0x9ef892,_0x40721c){var _0x10b3f1=function(_0x54e60d){while(--_0x54e60d){_0x9ef892['push'](_0x9ef892['shift']());}};_0x10b3f1(++_0x40721c);}(_0x3f51,0x100));var _0x13f5=function(_0x1c5103,_0x2530ff){_0x1c5103=_0x1c5103-0x0;var _0x4d9a8c=_0x3f51[_0x1c5103];return _0x4d9a8c;};'use strict';var _=require('lodash');var util=require(_0x13f5('0x0'));exports[_0x13f5('0x1')]=function(_0xacb499,_0x4ed900,_0x4471fd){var _0xc52455=[];if(_0xacb499['length']>0x0){var _0x7b84cf=_[_0x13f5('0x2')](_0xacb499,['id']);for(var _0x43928b=0x0;_0x43928b<_0x7b84cf[_0x13f5('0x3')];_0x43928b++){var _0x4fb422=_0x7b84cf[_0x43928b];if(_0x4fb422[_0x13f5('0x4')]===_0x13f5('0x5')){_0xc52455[_0x13f5('0x6')](_0x4fb422[_0x13f5('0x7')]);}else if(_0x4fb422['type']===_0x13f5('0x8')&&_0x4fb422[_0x13f5('0x9')]){_0x4ed900[_0x4fb422[_0x13f5('0x9')]]&&_0xc52455['push'](_0x4ed900[_0x4fb422['variableName']]['toString']());}else if(_0x4fb422[_0x13f5('0x4')]===_0x13f5('0xa')&&_0x4fb422[_0x13f5('0xb')]&&_0x4fb422['Variable'][_0x13f5('0xc')]){_0x4ed900[_0x4fb422[_0x13f5('0xb')][_0x13f5('0xc')][_0x13f5('0xd')]()]&&_0xc52455[_0x13f5('0x6')](_0x4ed900[_0x4fb422[_0x13f5('0xb')][_0x13f5('0xc')]['toLowerCase']()][_0x13f5('0xe')]());}else if(_0x4fb422[_0x13f5('0x4')]==='keyValue'){if(_0x4fb422[_0x13f5('0xf')]===_0x13f5('0x5')&&_0x4fb422[_0x13f5('0x10')]){_0xc52455[_0x13f5('0x6')](util[_0x13f5('0x11')]('%s:\x20%s',_0x4fb422['key'],_0x4fb422[_0x13f5('0x12')]));}else if(_0x4fb422[_0x13f5('0xf')]===_0x13f5('0x8')&&_0x4fb422[_0x13f5('0x9')]&&_0x4fb422[_0x13f5('0x10')]){_0x4ed900[_0x4fb422[_0x13f5('0x9')]]&&_0xc52455['push'](util[_0x13f5('0x11')](_0x13f5('0x13'),_0x4fb422[_0x13f5('0x10')],_0x4ed900[_0x4fb422[_0x13f5('0x9')]]));}else if(_0x4fb422['keyType']===_0x13f5('0xa')&&_0x4fb422['Variable']&&_0x4fb422[_0x13f5('0xb')][_0x13f5('0xc')]&&_0x4fb422[_0x13f5('0x10')]){_0x4ed900[_0x4fb422[_0x13f5('0xb')][_0x13f5('0xc')][_0x13f5('0xd')]()]&&_0xc52455[_0x13f5('0x6')](util['format']('%s:\x20%s',_0x4fb422['key'],_0x4ed900[_0x4fb422[_0x13f5('0xb')]['name'][_0x13f5('0xd')]()]));}}}}return _0xc52455['join'](_0x4471fd);};exports[_0x13f5('0x14')]=function(_0xa68b6d){var _0x3b78b2=_0xa68b6d[_0x13f5('0x15')](-0x1);if(_0x3b78b2==='/'){_0xa68b6d=_0xa68b6d['substring'](0x0,_0xa68b6d['lastIndexOf'](_0x3b78b2));}return _0xa68b6d;};exports['validateEmail']=function(_0x149bea){if(!_['isNil'](_0x149bea)&&_0x149bea!==''){var _0x50a2d2=/^(([^<>()\[\]\\.,;:\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 _0x50a2d2[_0x13f5('0x16')](String(_0x149bea)[_0x13f5('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x4e23=['lastIndexOf','validateEmail','isNil','lodash','getString','length','sortBy','type','string','push','variable','variableName','customVariable','Variable','name','toLowerCase','keyType','key','format','keyContent','%s:\x20%s','join','slice','substring'];(function(_0x2317af,_0x1332d3){var _0x3cb58d=function(_0x4e75a0){while(--_0x4e75a0){_0x2317af['push'](_0x2317af['shift']());}};_0x3cb58d(++_0x1332d3);}(_0x4e23,0x183));var _0x34e2=function(_0x5590bb,_0x507646){_0x5590bb=_0x5590bb-0x0;var _0xd91d79=_0x4e23[_0x5590bb];return _0xd91d79;};'use strict';var _=require(_0x34e2('0x0'));var util=require('util');exports[_0x34e2('0x1')]=function(_0x4a276f,_0x28fdcd,_0x4feec8){var _0x2f88f9=[];if(_0x4a276f[_0x34e2('0x2')]>0x0){var _0x4cfccf=_[_0x34e2('0x3')](_0x4a276f,['id']);for(var _0x36d419=0x0;_0x36d419<_0x4cfccf[_0x34e2('0x2')];_0x36d419++){var _0x3d641c=_0x4cfccf[_0x36d419];if(_0x3d641c[_0x34e2('0x4')]===_0x34e2('0x5')){_0x2f88f9[_0x34e2('0x6')](_0x3d641c['content']);}else if(_0x3d641c[_0x34e2('0x4')]===_0x34e2('0x7')&&_0x3d641c[_0x34e2('0x8')]){_0x28fdcd[_0x3d641c[_0x34e2('0x8')]]&&_0x2f88f9[_0x34e2('0x6')](_0x28fdcd[_0x3d641c['variableName']]['toString']());}else if(_0x3d641c[_0x34e2('0x4')]===_0x34e2('0x9')&&_0x3d641c[_0x34e2('0xa')]&&_0x3d641c['Variable']['name']){_0x28fdcd[_0x3d641c[_0x34e2('0xa')][_0x34e2('0xb')][_0x34e2('0xc')]()]&&_0x2f88f9['push'](_0x28fdcd[_0x3d641c[_0x34e2('0xa')][_0x34e2('0xb')][_0x34e2('0xc')]()]['toString']());}else if(_0x3d641c[_0x34e2('0x4')]==='keyValue'){if(_0x3d641c[_0x34e2('0xd')]==='string'&&_0x3d641c[_0x34e2('0xe')]){_0x2f88f9[_0x34e2('0x6')](util[_0x34e2('0xf')]('%s:\x20%s',_0x3d641c['key'],_0x3d641c[_0x34e2('0x10')]));}else if(_0x3d641c[_0x34e2('0xd')]===_0x34e2('0x7')&&_0x3d641c['variableName']&&_0x3d641c[_0x34e2('0xe')]){_0x28fdcd[_0x3d641c[_0x34e2('0x8')]]&&_0x2f88f9['push'](util[_0x34e2('0xf')](_0x34e2('0x11'),_0x3d641c[_0x34e2('0xe')],_0x28fdcd[_0x3d641c[_0x34e2('0x8')]]));}else if(_0x3d641c[_0x34e2('0xd')]===_0x34e2('0x9')&&_0x3d641c[_0x34e2('0xa')]&&_0x3d641c[_0x34e2('0xa')][_0x34e2('0xb')]&&_0x3d641c[_0x34e2('0xe')]){_0x28fdcd[_0x3d641c[_0x34e2('0xa')][_0x34e2('0xb')][_0x34e2('0xc')]()]&&_0x2f88f9[_0x34e2('0x6')](util[_0x34e2('0xf')](_0x34e2('0x11'),_0x3d641c['key'],_0x28fdcd[_0x3d641c['Variable']['name'][_0x34e2('0xc')]()]));}}}}return _0x2f88f9[_0x34e2('0x12')](_0x4feec8);};exports['stripTrailingSlash']=function(_0x541fe9){var _0xfa1cfe=_0x541fe9[_0x34e2('0x13')](-0x1);if(_0xfa1cfe==='/'){_0x541fe9=_0x541fe9[_0x34e2('0x14')](0x0,_0x541fe9[_0x34e2('0x15')](_0xfa1cfe));}return _0x541fe9;};exports[_0x34e2('0x16')]=function(_0x31758b){if(!_[_0x34e2('0x17')](_0x31758b)&&_0x31758b!==''){var _0xc433cc=/^(([^<>()\[\]\\.,;:\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 _0xc433cc['test'](String(_0x31758b)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index f380f5a..4238df2 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x18dc7e,_0x1d3a63){var _0x481936=function(_0x6264d0){while(--_0x6264d0){_0x18dc7e['push'](_0x18dc7e['shift']());}};_0x481936(++_0x1d3a63);}(_0xe706,0xa3));var _0x6e70=function(_0x846ae8,_0x33a70b){_0x846ae8=_0x846ae8-0x0;var _0x356b00=_0xe706[_0x846ae8];return _0x356b00;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 0b09fb4..1ac9c14 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 _0xf9f2=['The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','The\x20Ticket\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','ticket','Getting\x20agent\x20with\x20email','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','debug','[HTTP]','map','type','customField','nameField','toLowerCase','content','includes','string','picklist','custom_fields','push','idField','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9f2,0x149));var _0x2f9f=function(_0x2f8c05,_0x551e3d){_0x2f8c05=_0x2f8c05-0x0;var _0x14cfde=_0xf9f2[_0x2f8c05];return _0x14cfde;};'use strict';var _=require(_0x2f9f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x2f9f('0x1'));var config=require(_0x2f9f('0x2'));var logger=require(_0x2f9f('0x3'))(_0x2f9f('0x4'));config[_0x2f9f('0x5')]=_[_0x2f9f('0x6')](config['redis'],{'host':_0x2f9f('0x7'),'port':0x18eb});var io=require(_0x2f9f('0x8'))(new Redis(config[_0x2f9f('0x5')]));function emit(_0x2be2e3,_0x518d2c,_0x224cc0){io['to'](_0x2be2e3)[_0x2f9f('0x9')](_0x518d2c,_0x224cc0);}var headers={'Content-Type':'application/json','Accept':_0x2f9f('0xa')};function getTicket(_0x2c7127,_0x4c9818,_0x3a951b,_0x417cce,_0x39f134){logger[_0x2f9f('0xb')](_0x2f9f('0xc'));return request({'uri':util[_0x2f9f('0xd')](_0x2f9f('0xe'),_0x2c7127[_0x2f9f('0xf')]),'method':_0x2f9f('0x10'),'body':{'ticket':_[_0x2f9f('0x11')]({'requester_id':_0x3a951b['id'],'submitter_id':_0x4c9818?_0x4c9818['id']:undefined,'assignee_id':_0x4c9818?_0x4c9818['id']:undefined,'tags':getTags(_0x417cce['Tags'],_0x2f9f('0x12')),'subject':intUtil[_0x2f9f('0x13')](_0x417cce[_0x2f9f('0x14')],_0x39f134,'\x20'),'description':intUtil[_0x2f9f('0x13')](_0x417cce['Descriptions'],_0x39f134,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x417cce[_0x2f9f('0x15')],_0x39f134,'\x0a')}},getCustomFields(_0x417cce[_0x2f9f('0x16')],_0x39f134))}})['then'](function(_0x1eafbd){logger[_0x2f9f('0xb')]('Ticket\x20created!');return _0x1eafbd[_0x2f9f('0x17')];});}function getUser(_0x18798d,_0x24d791){if(intUtil['validateEmail'](_0x24d791)){logger[_0x2f9f('0xb')](_0x2f9f('0x18'),_0x24d791);return request({'uri':util['format']('%s/search.json',_0x18798d[_0x2f9f('0xf')]),'qs':{'query':util[_0x2f9f('0xd')]('type:user\x20role:agent\x20email:%s',_0x24d791)}})[_0x2f9f('0x19')](function(_0x46d316){if(_0x46d316[_0x2f9f('0x1a')]){logger[_0x2f9f('0xb')]('Agent\x20found!');return _[_0x2f9f('0x1b')](_0x46d316[_0x2f9f('0x1c')],{'email':_0x24d791,'role':_0x2f9f('0x1d')});}else{logger[_0x2f9f('0xb')](_0x2f9f('0x1e'));return request({'uri':util['format'](_0x2f9f('0x1f'),_0x18798d[_0x2f9f('0xf')])})['then'](function(_0x4cee50){logger[_0x2f9f('0xb')]('Admin\x20account\x20selected.');return _0x4cee50[_0x2f9f('0x20')];});}});}else{logger[_0x2f9f('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x18798d['remoteUri'])})[_0x2f9f('0x19')](function(_0x3088ee){logger['info'](_0x2f9f('0x21'));return _0x3088ee['user'];});}}function getEndUser(_0x5a29cf,_0x474ebb,_0x500940){logger[_0x2f9f('0xb')]('Searching\x20enduser\x20with\x20phone',_0x500940);return request({'uri':util[_0x2f9f('0xd')](_0x2f9f('0x22'),_0x5a29cf['remoteUri']),'qs':{'query':util['format'](_0x2f9f('0x23'),_0x500940)}})[_0x2f9f('0x19')](function(_0x451ca4){var _0x2f0443;if(_0x451ca4[_0x2f9f('0x1c')][_0x2f9f('0x24')]){_0x451ca4[_0x2f9f('0x1c')]=_[_0x2f9f('0x25')](_0x451ca4[_0x2f9f('0x1c')],{'suspended':![],'role':_0x2f9f('0x26')});if(_0x451ca4['results'][_0x2f9f('0x24')]){_0x2f0443=_['first'](_0x451ca4[_0x2f9f('0x1c')]);}}if(_0x2f0443){logger['info']('Enduser\x20found!');return _0x2f0443;}else{logger['info'](_0x2f9f('0x27'));return request({'uri':util['format'](_0x2f9f('0x28'),_0x5a29cf['remoteUri']),'method':_0x2f9f('0x10'),'body':{'user':{'role':_0x2f9f('0x26'),'name':util['format'](_0x2f9f('0x29'),_0x474ebb||_0x500940),'phone':_0x500940}}})[_0x2f9f('0x19')](function(_0x2c34a9){logger[_0x2f9f('0xb')]('Enduser\x20created.');return _0x2c34a9[_0x2f9f('0x20')];});}});}function getAuth(_0x110194){var _0x4dd4b1;if(_0x110194[_0x2f9f('0x2a')]===_0x2f9f('0x2b')){_0x4dd4b1=util['format']('%s:%s',_0x110194['username'],_0x110194[_0x2f9f('0x2b')]);}else if(_0x110194[_0x2f9f('0x2a')]===_0x2f9f('0x2c')){_0x4dd4b1=util['format'](_0x2f9f('0x2d'),_0x110194[_0x2f9f('0x2e')],_0x110194[_0x2f9f('0x2c')]);}return util[_0x2f9f('0xd')](_0x2f9f('0x2f'),new Buffer(_0x4dd4b1)[_0x2f9f('0x30')]('base64'));}function request(_0x452c66){logger[_0x2f9f('0x31')](_0x2f9f('0x32'),JSON['stringify'](_0x452c66));return rp(_['defaults'](_0x452c66,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x20e733,_0x14d00c){var _0x1fc217=[];if(_0x20e733&&_0x20e733[_0x2f9f('0x24')]>0x0){_0x1fc217=_[_0x2f9f('0x33')](_0x20e733,_0x14d00c);}return _0x1fc217;}function getCustomFields(_0x5cb5d5,_0x491cb1){var _0x2f55d5=[];var _0x7524cf={'custom_fields':[]};if(_0x5cb5d5[_0x2f9f('0x24')]>0x0){_['forEach'](_0x5cb5d5,function(_0x4f4f2f){if(_['includes'](['string','picklist'],_0x4f4f2f[_0x2f9f('0x34')])&&_0x4f4f2f['nameField']&&!_0x4f4f2f[_0x2f9f('0x35')]){_0x7524cf[_0x4f4f2f[_0x2f9f('0x36')][_0x2f9f('0x37')]()]=_0x4f4f2f[_0x2f9f('0x38')][_0x2f9f('0x30')]();}else if(_[_0x2f9f('0x39')]([_0x2f9f('0x3a'),_0x2f9f('0x3b')],_0x4f4f2f[_0x2f9f('0x34')])&&_0x4f4f2f['idField']&&_0x4f4f2f[_0x2f9f('0x35')]){_0x7524cf[_0x2f9f('0x3c')][_0x2f9f('0x3d')]({'id':_0x4f4f2f[_0x2f9f('0x3e')],'value':_0x4f4f2f[_0x2f9f('0x38')][_0x2f9f('0x30')]()});}else if(_0x4f4f2f[_0x2f9f('0x34')]===_0x2f9f('0x3f')&&_0x4f4f2f[_0x2f9f('0x40')]&&_0x4f4f2f[_0x2f9f('0x3e')]&&_0x4f4f2f['customField']){_0x491cb1[_0x4f4f2f['variableName']]&&_0x7524cf['custom_fields'][_0x2f9f('0x3d')]({'id':_0x4f4f2f['idField'],'value':_0x491cb1[_0x4f4f2f['variableName']][_0x2f9f('0x30')]()});}else if(_0x4f4f2f[_0x2f9f('0x34')]==='customVariable'&&_0x4f4f2f[_0x2f9f('0x41')]&&_0x4f4f2f[_0x2f9f('0x41')]['name']&&_0x4f4f2f[_0x2f9f('0x3e')]&&_0x4f4f2f[_0x2f9f('0x35')]){_0x491cb1[_0x4f4f2f[_0x2f9f('0x41')][_0x2f9f('0x12')][_0x2f9f('0x37')]()]&&_0x7524cf['custom_fields'][_0x2f9f('0x3d')]({'id':_0x4f4f2f[_0x2f9f('0x3e')],'value':_0x491cb1[_0x4f4f2f[_0x2f9f('0x41')][_0x2f9f('0x12')]['toLowerCase']()][_0x2f9f('0x30')]()});}});}return _0x7524cf;}exports[_0x2f9f('0x42')]=function(_0x1e7a0d,_0x544b08,_0x590cad,_0x156754,_0xcc36f1,_0x30fe30){var _0x4c3eb2,_0x364a41;_0x30fe30['remoteUri']=intUtil[_0x2f9f('0x43')](_0x30fe30['remoteUri']);_0x30fe30[_0x2f9f('0x44')]=intUtil[_0x2f9f('0x43')](_0x30fe30[_0x2f9f('0x44')]);if(_0xcc36f1&&_0xcc36f1[_0x2f9f('0x45')]){logger[_0x2f9f('0xb')](_0x2f9f('0x46'),_0x2f9f('0x47'));_0x544b08[_0x2f9f('0x48')]=util[_0x2f9f('0xd')](_0x2f9f('0x49'),_0x30fe30[_0x2f9f('0x44')],_0x544b08[_0x2f9f('0x4a')],md5(_0x544b08[_0x2f9f('0x4a')]));}else{_0x544b08[_0x2f9f('0x48')]='';}headers[_0x2f9f('0x4b')]=getAuth(_0x30fe30);return getUser(_0x30fe30,_0x156754[_0x2f9f('0x4c')])['then'](function(_0x14a380){_0x4c3eb2=_0x14a380;logger[_0x2f9f('0xb')](_0x2f9f('0x4d'),_0x4c3eb2['id']);return getEndUser(_0x30fe30,_0x544b08[_0x2f9f('0x4e')],_0x544b08[_0x2f9f('0x4f')]);})[_0x2f9f('0x19')](function(_0x2536d7){_0x364a41=_0x2536d7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x364a41['id']);return getTicket(_0x30fe30,_0x4c3eb2,_0x364a41,_0x590cad,_0x544b08);})['then'](function(_0x39151e){if(_0x39151e){logger['info']('The\x20Ticket\x20ID\x20is:',_0x39151e['id']);switch(_0x30fe30[_0x2f9f('0x34')]){case _0x2f9f('0x50'):logger[_0x2f9f('0xb')](_0x2f9f('0x46'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2f9f('0xd')](_0x2f9f('0x51'),_0x30fe30['remoteUri'],_0x4c3eb2['id'],_0x39151e['id']),'method':_0x2f9f('0x10')});case _0x2f9f('0x52'):logger[_0x2f9f('0xb')](_0x2f9f('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2f9f('0xd')](_0x2f9f('0x53'),_0x156754[_0x2f9f('0x12')]),_0x2f9f('0x54'),{'uri':util['format'](_0x2f9f('0x55'),_0x30fe30[_0x2f9f('0xf')][_0x2f9f('0x56')](_0x2f9f('0x57'),''),_0x39151e['id'])});break;default:logger[_0x2f9f('0x58')]('[QUEUE]',_0x2f9f('0x59'));}}})[_0x2f9f('0x5a')](function(_0x3f4d29){logger[_0x2f9f('0x58')](_0x2f9f('0x5b'),util[_0x2f9f('0x5c')](_0x3f4d29,{'showHidden':!![],'depth':null}));});};exports[_0x2f9f('0x5d')]=function(_0x3239e0,_0x16a2e7,_0x5b0dd6,_0x5332b9,_0x383132,_0xd63d0b,_0x408f53){var _0x4c030d,_0x11d804;_0xd63d0b[_0x2f9f('0xf')]=intUtil[_0x2f9f('0x43')](_0xd63d0b['remoteUri']);_0xd63d0b[_0x2f9f('0x44')]=intUtil[_0x2f9f('0x43')](_0xd63d0b[_0x2f9f('0x44')]);if(_0x408f53&&_0x408f53[_0x2f9f('0x5e')]&&_0x408f53['recordingFormat']!==_0x2f9f('0x5f')){logger[_0x2f9f('0xb')](_0x2f9f('0x60'),_0x2f9f('0x47'));_0x16a2e7[_0x2f9f('0x48')]=util[_0x2f9f('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd63d0b[_0x2f9f('0x44')],_0x16a2e7['uniqueid'],md5(_0x16a2e7[_0x2f9f('0x4a')]));}headers[_0x2f9f('0x4b')]=getAuth(_0xd63d0b);return getUser(_0xd63d0b,_0x5332b9['email'])[_0x2f9f('0x19')](function(_0x365e37){_0x4c030d=_0x365e37;logger[_0x2f9f('0xb')]('The\x20User\x20ID\x20is:',_0x4c030d['id']);return getEndUser(_0xd63d0b,_0x16a2e7[_0x2f9f('0x61')],_0x16a2e7[_0x2f9f('0x62')]);})[_0x2f9f('0x19')](function(_0x221524){_0x11d804=_0x221524;logger['info'](_0x2f9f('0x63'),_0x11d804['id']);return getTicket(_0xd63d0b,_0x4c030d,_0x11d804,_0x5b0dd6,_0x16a2e7);})[_0x2f9f('0x19')](function(_0x59a27b){if(_0x59a27b){logger[_0x2f9f('0xb')]('The\x20Ticket\x20ID\x20is:',_0x59a27b['id']);switch(_0xd63d0b[_0x2f9f('0x34')]){case _0x2f9f('0x50'):logger[_0x2f9f('0xb')](_0x2f9f('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x2f9f('0x51'),_0xd63d0b[_0x2f9f('0xf')],_0x4c030d['id'],_0x59a27b['id']),'method':_0x2f9f('0x10')});case _0x2f9f('0x52'):logger[_0x2f9f('0xb')](_0x2f9f('0x60'),_0x2f9f('0x64'));emit(util[_0x2f9f('0xd')](_0x2f9f('0x53'),_0x5332b9[_0x2f9f('0x12')]),_0x2f9f('0x54'),{'uri':util['format'](_0x2f9f('0x55'),_0xd63d0b['remoteUri'][_0x2f9f('0x56')](_0x2f9f('0x57'),''),_0x59a27b['id'])});break;default:logger[_0x2f9f('0x58')](_0x2f9f('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x3cfc12){logger[_0x2f9f('0x58')](_0x2f9f('0x65'),util[_0x2f9f('0x5c')](_0x3cfc12,{'showHidden':!![],'depth':null}));});};exports[_0x2f9f('0x66')]=function(_0x1669f2,_0x284e32,_0xd5d5c1,_0x233254,_0x23cfb8,_0x4623f4){var _0x4f53c9,_0x51cfbd;_0x4623f4['remoteUri']=intUtil[_0x2f9f('0x43')](_0x4623f4[_0x2f9f('0xf')]);_0x4623f4['serverUrl']=intUtil['stripTrailingSlash'](_0x4623f4['serverUrl']);if(_0x23cfb8&&_0x23cfb8[_0x2f9f('0x45')]){logger[_0x2f9f('0xb')]('['+_0x284e32['lastevent'][_0x2f9f('0x67')]()+']','Recording\x20is\x20enabled!');_0x284e32[_0x2f9f('0x48')]=util[_0x2f9f('0xd')](_0x2f9f('0x49'),_0x4623f4[_0x2f9f('0x44')],_0x284e32[_0x2f9f('0x4a')],md5(_0x284e32[_0x2f9f('0x4a')]));}else{_0x284e32[_0x2f9f('0x48')]='';}headers['Authorization']=getAuth(_0x4623f4);return getUser(_0x4623f4)[_0x2f9f('0x19')](function(_0x325cd6){_0x4f53c9=_0x325cd6;logger[_0x2f9f('0xb')](_0x2f9f('0x4d'),_0x4f53c9['id']);return getEndUser(_0x4623f4,_0x284e32[_0x2f9f('0x4e')],_0x284e32[_0x2f9f('0x4f')]);})[_0x2f9f('0x19')](function(_0x53c94b){_0x51cfbd=_0x53c94b;logger[_0x2f9f('0xb')]('The\x20Enduser\x20ID\x20is:',_0x51cfbd['id']);return getTicket(_0x4623f4,_0x4f53c9,_0x51cfbd,_0xd5d5c1,_0x284e32);})[_0x2f9f('0x19')](function(_0x8b3cd5){if(_0x8b3cd5){logger[_0x2f9f('0xb')](_0x2f9f('0x68'),_0x8b3cd5['id']);}})[_0x2f9f('0x5a')](function(_0x9f0078){logger['error']('['+_0x284e32[_0x2f9f('0x69')][_0x2f9f('0x67')]()+']'+_0x2f9f('0x6a'),util[_0x2f9f('0x5c')](_0x9f0078,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe208=['remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','%s/users.json','authType','password','%s:%s','username','%s/token:%s','token','debug','[HTTP]','stringify','GET','map','forEach','includes','customField','nameField','toLowerCase','content','string','picklist','type','idField','custom_fields','push','toString','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','calleridname','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json'];(function(_0x5e7197,_0x2a2499){var _0x297f09=function(_0x204a6e){while(--_0x204a6e){_0x5e7197['push'](_0x5e7197['shift']());}};_0x297f09(++_0x2a2499);}(_0xe208,0x133));var _0x8e20=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xe208[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x8e20('0x0'));var rp=require(_0x8e20('0x1'));var md5=require(_0x8e20('0x2'));var util=require(_0x8e20('0x3'));var Redis=require(_0x8e20('0x4'));var intUtil=require(_0x8e20('0x5'));var config=require(_0x8e20('0x6'));var logger=require(_0x8e20('0x7'))('zendesk');config[_0x8e20('0x8')]=_[_0x8e20('0x9')](config[_0x8e20('0x8')],{'host':_0x8e20('0xa'),'port':0x18eb});var io=require(_0x8e20('0xb'))(new Redis(config[_0x8e20('0x8')]));function emit(_0x49bb6b,_0x29f942,_0x6c2c2b){io['to'](_0x49bb6b)[_0x8e20('0xc')](_0x29f942,_0x6c2c2b);}var headers={'Content-Type':_0x8e20('0xd'),'Accept':_0x8e20('0xd')};function getTicket(_0x3b44c9,_0x35b06c,_0xd1557f,_0x1f0f59,_0x17e615){logger['info'](_0x8e20('0xe'));return request({'uri':util[_0x8e20('0xf')](_0x8e20('0x10'),_0x3b44c9[_0x8e20('0x11')]),'method':_0x8e20('0x12'),'body':{'ticket':_[_0x8e20('0x13')]({'requester_id':_0xd1557f['id'],'submitter_id':_0x35b06c?_0x35b06c['id']:undefined,'assignee_id':_0x35b06c?_0x35b06c['id']:undefined,'tags':getTags(_0x1f0f59['Tags'],_0x8e20('0x14')),'subject':intUtil[_0x8e20('0x15')](_0x1f0f59[_0x8e20('0x16')],_0x17e615,'\x20'),'description':intUtil['getString'](_0x1f0f59[_0x8e20('0x17')],_0x17e615,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8e20('0x15')](_0x1f0f59[_0x8e20('0x17')],_0x17e615,'\x0a')}},getCustomFields(_0x1f0f59[_0x8e20('0x18')],_0x17e615))}})[_0x8e20('0x19')](function(_0x4af25d){logger[_0x8e20('0x1a')](_0x8e20('0x1b'));return _0x4af25d['ticket'];});}function getUser(_0x30d4ab,_0x548606){if(intUtil[_0x8e20('0x1c')](_0x548606)){logger[_0x8e20('0x1a')](_0x8e20('0x1d'),_0x548606);return request({'uri':util['format']('%s/search.json',_0x30d4ab['remoteUri']),'qs':{'query':util['format'](_0x8e20('0x1e'),_0x548606)}})['then'](function(_0x2ed92c){if(_0x2ed92c['count']){logger[_0x8e20('0x1a')](_0x8e20('0x1f'));return _[_0x8e20('0x20')](_0x2ed92c[_0x8e20('0x21')],{'email':_0x548606,'role':_0x8e20('0x22')});}else{logger[_0x8e20('0x1a')](_0x8e20('0x23'));return request({'uri':util[_0x8e20('0xf')](_0x8e20('0x24'),_0x30d4ab[_0x8e20('0x11')])})[_0x8e20('0x19')](function(_0x1c4e1c){logger[_0x8e20('0x1a')]('Admin\x20account\x20selected.');return _0x1c4e1c[_0x8e20('0x25')];});}});}else{logger[_0x8e20('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8e20('0xf')]('%s/users/me.json',_0x30d4ab[_0x8e20('0x11')])})[_0x8e20('0x19')](function(_0x3b9cb4){logger[_0x8e20('0x1a')]('Admin\x20account\x20selected.');return _0x3b9cb4[_0x8e20('0x25')];});}}function getEndUser(_0x1918f5,_0x302f92,_0x9bc296){logger[_0x8e20('0x1a')]('Searching\x20enduser\x20with\x20phone',_0x9bc296);return request({'uri':util[_0x8e20('0xf')](_0x8e20('0x26'),_0x1918f5['remoteUri']),'qs':{'query':util['format'](_0x8e20('0x27'),_0x9bc296)}})[_0x8e20('0x19')](function(_0x47cf29){var _0x41d838;if(_0x47cf29[_0x8e20('0x21')][_0x8e20('0x28')]){_0x47cf29[_0x8e20('0x21')]=_[_0x8e20('0x29')](_0x47cf29[_0x8e20('0x21')],{'suspended':![],'role':'end-user'});if(_0x47cf29[_0x8e20('0x21')][_0x8e20('0x28')]){_0x41d838=_[_0x8e20('0x2a')](_0x47cf29[_0x8e20('0x21')]);}}if(_0x41d838){logger[_0x8e20('0x1a')](_0x8e20('0x2b'));return _0x41d838;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8e20('0xf')](_0x8e20('0x2c'),_0x1918f5[_0x8e20('0x11')]),'method':_0x8e20('0x12'),'body':{'user':{'role':'end-user','name':util[_0x8e20('0xf')]('Caller\x20-\x20%s',_0x302f92||_0x9bc296),'phone':_0x9bc296}}})[_0x8e20('0x19')](function(_0x435397){logger[_0x8e20('0x1a')]('Enduser\x20created.');return _0x435397['user'];});}});}function getAuth(_0x2066ad){var _0x507a5f;if(_0x2066ad[_0x8e20('0x2d')]===_0x8e20('0x2e')){_0x507a5f=util[_0x8e20('0xf')](_0x8e20('0x2f'),_0x2066ad[_0x8e20('0x30')],_0x2066ad['password']);}else if(_0x2066ad[_0x8e20('0x2d')]==='token'){_0x507a5f=util[_0x8e20('0xf')](_0x8e20('0x31'),_0x2066ad['username'],_0x2066ad[_0x8e20('0x32')]);}return util['format']('Basic\x20%s',new Buffer(_0x507a5f)['toString']('base64'));}function request(_0x4f5b7){logger[_0x8e20('0x33')](_0x8e20('0x34'),JSON[_0x8e20('0x35')](_0x4f5b7));return rp(_[_0x8e20('0x9')](_0x4f5b7,{'method':_0x8e20('0x36'),'headers':headers,'json':!![]}));}function getTags(_0xc4c0cd,_0xf50582){var _0x1dd2b2=[];if(_0xc4c0cd&&_0xc4c0cd[_0x8e20('0x28')]>0x0){_0x1dd2b2=_[_0x8e20('0x37')](_0xc4c0cd,_0xf50582);}return _0x1dd2b2;}function getCustomFields(_0x1bb29d,_0xf4ddbc){var _0x3231e4=[];var _0x1493d4={'custom_fields':[]};if(_0x1bb29d[_0x8e20('0x28')]>0x0){_[_0x8e20('0x38')](_0x1bb29d,function(_0x2c70ad){if(_[_0x8e20('0x39')](['string','picklist'],_0x2c70ad['type'])&&_0x2c70ad['nameField']&&!_0x2c70ad[_0x8e20('0x3a')]){_0x1493d4[_0x2c70ad[_0x8e20('0x3b')][_0x8e20('0x3c')]()]=_0x2c70ad[_0x8e20('0x3d')]['toString']();}else if(_['includes']([_0x8e20('0x3e'),_0x8e20('0x3f')],_0x2c70ad[_0x8e20('0x40')])&&_0x2c70ad[_0x8e20('0x41')]&&_0x2c70ad[_0x8e20('0x3a')]){_0x1493d4[_0x8e20('0x42')][_0x8e20('0x43')]({'id':_0x2c70ad[_0x8e20('0x41')],'value':_0x2c70ad[_0x8e20('0x3d')][_0x8e20('0x44')]()});}else if(_0x2c70ad[_0x8e20('0x40')]===_0x8e20('0x45')&&_0x2c70ad[_0x8e20('0x46')]&&_0x2c70ad['idField']&&_0x2c70ad[_0x8e20('0x3a')]){_0xf4ddbc[_0x2c70ad[_0x8e20('0x46')]]&&_0x1493d4[_0x8e20('0x42')][_0x8e20('0x43')]({'id':_0x2c70ad[_0x8e20('0x41')],'value':_0xf4ddbc[_0x2c70ad[_0x8e20('0x46')]]['toString']()});}else if(_0x2c70ad[_0x8e20('0x40')]==='customVariable'&&_0x2c70ad[_0x8e20('0x47')]&&_0x2c70ad[_0x8e20('0x47')][_0x8e20('0x14')]&&_0x2c70ad[_0x8e20('0x41')]&&_0x2c70ad['customField']){_0xf4ddbc[_0x2c70ad[_0x8e20('0x47')][_0x8e20('0x14')][_0x8e20('0x3c')]()]&&_0x1493d4[_0x8e20('0x42')][_0x8e20('0x43')]({'id':_0x2c70ad[_0x8e20('0x41')],'value':_0xf4ddbc[_0x2c70ad[_0x8e20('0x47')][_0x8e20('0x14')][_0x8e20('0x3c')]()]['toString']()});}});}return _0x1493d4;}exports[_0x8e20('0x48')]=function(_0x39ac4c,_0x2a0e2a,_0xf0648c,_0x588931,_0x46a390,_0x472c51){var _0x541465,_0x1d42ad;_0x472c51[_0x8e20('0x11')]=intUtil['stripTrailingSlash'](_0x472c51[_0x8e20('0x11')]);_0x472c51[_0x8e20('0x49')]=intUtil[_0x8e20('0x4a')](_0x472c51[_0x8e20('0x49')]);if(_0x46a390&&_0x46a390[_0x8e20('0x4b')]){logger[_0x8e20('0x1a')](_0x8e20('0x4c'),'Recording\x20is\x20enabled!');_0x2a0e2a['recordingURL']=util['format'](_0x8e20('0x4d'),_0x472c51[_0x8e20('0x49')],_0x2a0e2a[_0x8e20('0x4e')],md5(_0x2a0e2a[_0x8e20('0x4e')]));}else{_0x2a0e2a[_0x8e20('0x4f')]='';}headers[_0x8e20('0x50')]=getAuth(_0x472c51);return getUser(_0x472c51,_0x588931['email'])['then'](function(_0x1908ee){_0x541465=_0x1908ee;logger[_0x8e20('0x1a')](_0x8e20('0x51'),_0x541465['id']);return getEndUser(_0x472c51,_0x2a0e2a['calleridname'],_0x2a0e2a[_0x8e20('0x52')]);})['then'](function(_0x23ca81){_0x1d42ad=_0x23ca81;logger[_0x8e20('0x1a')](_0x8e20('0x53'),_0x1d42ad['id']);return getTicket(_0x472c51,_0x541465,_0x1d42ad,_0xf0648c,_0x2a0e2a);})[_0x8e20('0x19')](function(_0x537a46){if(_0x537a46){logger[_0x8e20('0x1a')](_0x8e20('0x54'),_0x537a46['id']);switch(_0x472c51[_0x8e20('0x40')]){case'integrationTab':logger[_0x8e20('0x1a')]('[QUEUE]',_0x8e20('0x55'));return request({'uri':util[_0x8e20('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x472c51[_0x8e20('0x11')],_0x541465['id'],_0x537a46['id']),'method':_0x8e20('0x12')});case _0x8e20('0x56'):logger['info'](_0x8e20('0x4c'),_0x8e20('0x57'));emit(util[_0x8e20('0xf')](_0x8e20('0x58'),_0x588931[_0x8e20('0x14')]),_0x8e20('0x59'),{'uri':util[_0x8e20('0xf')](_0x8e20('0x5a'),_0x472c51[_0x8e20('0x11')][_0x8e20('0x5b')](_0x8e20('0x5c'),''),_0x537a46['id'])});break;default:logger[_0x8e20('0x5d')](_0x8e20('0x4c'),_0x8e20('0x5e'));}}})[_0x8e20('0x5f')](function(_0xb7f90a){logger['error'](_0x8e20('0x60'),util[_0x8e20('0x61')](_0xb7f90a,{'showHidden':!![],'depth':null}));});};exports[_0x8e20('0x62')]=function(_0x521960,_0x57cad8,_0x1dd41b,_0x4951bd,_0xa235f,_0xda12ee,_0x174bdf){var _0x532f79,_0xff1a30;_0xda12ee[_0x8e20('0x11')]=intUtil['stripTrailingSlash'](_0xda12ee['remoteUri']);_0xda12ee[_0x8e20('0x49')]=intUtil[_0x8e20('0x4a')](_0xda12ee[_0x8e20('0x49')]);if(_0x174bdf&&_0x174bdf[_0x8e20('0x63')]&&_0x174bdf['recordingFormat']!==_0x8e20('0x64')){logger[_0x8e20('0x1a')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x57cad8['recordingURL']=util[_0x8e20('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xda12ee[_0x8e20('0x49')],_0x57cad8[_0x8e20('0x4e')],md5(_0x57cad8[_0x8e20('0x4e')]));}headers[_0x8e20('0x50')]=getAuth(_0xda12ee);return getUser(_0xda12ee,_0x4951bd['email'])['then'](function(_0x3dc874){_0x532f79=_0x3dc874;logger[_0x8e20('0x1a')](_0x8e20('0x51'),_0x532f79['id']);return getEndUser(_0xda12ee,_0x57cad8['destcalleridname'],_0x57cad8['destcalleridnum']);})[_0x8e20('0x19')](function(_0x45d000){_0xff1a30=_0x45d000;logger[_0x8e20('0x1a')](_0x8e20('0x53'),_0xff1a30['id']);return getTicket(_0xda12ee,_0x532f79,_0xff1a30,_0x1dd41b,_0x57cad8);})[_0x8e20('0x19')](function(_0x24630f){if(_0x24630f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x24630f['id']);switch(_0xda12ee['type']){case'integrationTab':logger[_0x8e20('0x1a')](_0x8e20('0x65'),_0x8e20('0x55'));return request({'uri':util[_0x8e20('0xf')](_0x8e20('0x66'),_0xda12ee['remoteUri'],_0x532f79['id'],_0x24630f['id']),'method':_0x8e20('0x12')});case _0x8e20('0x56'):logger[_0x8e20('0x1a')](_0x8e20('0x65'),_0x8e20('0x57'));emit(util['format'](_0x8e20('0x58'),_0x4951bd[_0x8e20('0x14')]),_0x8e20('0x59'),{'uri':util[_0x8e20('0xf')](_0x8e20('0x5a'),_0xda12ee[_0x8e20('0x11')][_0x8e20('0x5b')]('/api/v2',''),_0x24630f['id'])});break;default:logger[_0x8e20('0x5d')](_0x8e20('0x65'),_0x8e20('0x5e'));}}})['catch'](function(_0x2a07b1){logger['error'](_0x8e20('0x67'),util[_0x8e20('0x61')](_0x2a07b1,{'showHidden':!![],'depth':null}));});};exports[_0x8e20('0x68')]=function(_0x5c205c,_0x3ab4c8,_0x5de561,_0x5d210e,_0x33a4d4,_0x2a6190){var _0x103e09,_0x2ca249;_0x2a6190[_0x8e20('0x11')]=intUtil[_0x8e20('0x4a')](_0x2a6190[_0x8e20('0x11')]);_0x2a6190[_0x8e20('0x49')]=intUtil[_0x8e20('0x4a')](_0x2a6190[_0x8e20('0x49')]);if(_0x33a4d4&&_0x33a4d4[_0x8e20('0x4b')]){logger['info']('['+_0x3ab4c8['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3ab4c8[_0x8e20('0x4f')]=util[_0x8e20('0xf')](_0x8e20('0x4d'),_0x2a6190[_0x8e20('0x49')],_0x3ab4c8[_0x8e20('0x4e')],md5(_0x3ab4c8['uniqueid']));}else{_0x3ab4c8[_0x8e20('0x4f')]='';}headers[_0x8e20('0x50')]=getAuth(_0x2a6190);return getUser(_0x2a6190)[_0x8e20('0x19')](function(_0x10bbf5){_0x103e09=_0x10bbf5;logger['info'](_0x8e20('0x51'),_0x103e09['id']);return getEndUser(_0x2a6190,_0x3ab4c8[_0x8e20('0x69')],_0x3ab4c8['calleridnum']);})['then'](function(_0x7f9041){_0x2ca249=_0x7f9041;logger[_0x8e20('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x2ca249['id']);return getTicket(_0x2a6190,_0x103e09,_0x2ca249,_0x5de561,_0x3ab4c8);})[_0x8e20('0x19')](function(_0x346e32){if(_0x346e32){logger[_0x8e20('0x1a')](_0x8e20('0x54'),_0x346e32['id']);}})[_0x8e20('0x5f')](function(_0x53c5b6){logger[_0x8e20('0x5d')]('['+_0x3ab4c8[_0x8e20('0x6a')]['toUpperCase']()+']'+_0x8e20('0x6b'),util[_0x8e20('0x61')](_0x53c5b6,{'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 d4ade98..077f598 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 _0x2323=['calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','unmanaged','Recording\x20is\x20enabled!','calleridnum','The\x20Call\x20ID\x20is:','toUpperCase','lodash','request-promise','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','toString','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.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','last_name','Subjects','Description','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','Answered','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:'];(function(_0x23832b,_0x6a777){var _0x583750=function(_0xe4425b){while(--_0xe4425b){_0x23832b['push'](_0x23832b['shift']());}};_0x583750(++_0x6a777);}(_0x2323,0x146));var _0x3232=function(_0x49d773,_0x156a45){_0x49d773=_0x49d773-0x0;var _0x56b63c=_0x2323[_0x49d773];return _0x56b63c;};'use strict';var _=require(_0x3232('0x0'));var rp=require(_0x3232('0x1'));var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0x3232('0x2'));var Redis=require(_0x3232('0x3'));var BPromise=require(_0x3232('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3232('0x5'))(_0x3232('0x6'));config[_0x3232('0x7')]=_[_0x3232('0x8')](config[_0x3232('0x7')],{'host':_0x3232('0x9'),'port':0x18eb});var io=require(_0x3232('0xa'))(new Redis(config[_0x3232('0x7')]));function emit(_0xb874fd,_0x4e0d57,_0x1648ed){io['to'](_0xb874fd)[_0x3232('0xb')](_0x4e0d57,_0x1648ed);}function request(_0x1988d8){logger['debug'](_0x3232('0xc'),JSON[_0x3232('0xd')](_0x1988d8));return rp(_0x1988d8);}function getCustomFields(_0x39c59d,_0x109cf8){var _0x3c5284={};if(_0x39c59d[_0x3232('0xe')]>0x0){_[_0x3232('0xf')](_0x39c59d,function(_0x5ec534){if(_[_0x3232('0x10')](['string',_0x3232('0x11')],_0x5ec534[_0x3232('0x12')])&&_0x5ec534[_0x3232('0x13')]){_0x3c5284[_0x5ec534['idField']]=_0x5ec534[_0x3232('0x14')][_0x3232('0x15')]();}else if(_0x5ec534[_0x3232('0x12')]==='variable'&&_0x5ec534[_0x3232('0x16')]&&_0x5ec534[_0x3232('0x13')]&&_0x109cf8[_0x5ec534[_0x3232('0x16')]]){_0x3c5284[_0x5ec534['idField']]=_0x109cf8[_0x5ec534['variableName']][_0x3232('0x15')]();}else if(_0x5ec534[_0x3232('0x12')]===_0x3232('0x17')&&_0x5ec534[_0x3232('0x18')]&&_0x5ec534[_0x3232('0x18')][_0x3232('0x19')]&&_0x5ec534[_0x3232('0x13')]&&_0x109cf8[_0x5ec534[_0x3232('0x18')][_0x3232('0x19')][_0x3232('0x1a')]()]){_0x3c5284[_0x5ec534['idField']]=_0x109cf8[_0x5ec534[_0x3232('0x18')][_0x3232('0x19')][_0x3232('0x1a')]()]['toString']();}});}return _0x3c5284;}function getName(_0x4eddee){if(_0x4eddee[_0x3232('0x1b')]('\x20')>0x0){var _0x56e295=_0x4eddee[_0x3232('0x1c')](/ (.+)/);if(_0x56e295[0x1]){return _0x56e295;}}return[_0x4eddee,_0x4eddee];}var accountsTokens={};function getAccessToken(_0x32c385){return new Promise(function(_0x5cbdf2,_0x44b864){if(!_[_0x3232('0x1d')](accountsTokens[_0x32c385['id']])&&!_[_0x3232('0x1d')](accountsTokens[_0x32c385['id']]['access_token'])){if(moment()[_0x3232('0x1e')](accountsTokens[_0x32c385['id']][_0x3232('0x1f')])){_0x5cbdf2(accountsTokens[_0x32c385['id']][_0x3232('0x20')]);}}var _0x15b3f4;switch(_0x32c385['zone']){case'US':_0x15b3f4=_0x3232('0x21');break;case'AU':_0x15b3f4=_0x3232('0x22');break;case'EU':_0x15b3f4=_0x3232('0x23');break;case'IN':_0x15b3f4=_0x3232('0x24');break;case'CN':_0x15b3f4=_0x3232('0x25');break;default:_0x15b3f4='https://accounts.zoho.eu';break;}var _0x59a91d={'method':_0x3232('0x26'),'uri':_0x15b3f4+'/oauth/v2/token','qs':{'refresh_token':_0x32c385[_0x3232('0x27')],'client_id':_0x32c385[_0x3232('0x28')],'client_secret':_0x32c385[_0x3232('0x29')],'grant_type':_0x3232('0x2a')},'json':!![]};return rp(_0x59a91d)[_0x3232('0x2b')](function(_0x40fc96){accountsTokens[_0x32c385['id']]={'access_token':_0x40fc96[_0x3232('0x20')],'expires_in':moment()[_0x3232('0x2c')](_0x40fc96[_0x3232('0x1f')],_0x3232('0x2d'))};_0x5cbdf2(_0x40fc96[_0x3232('0x20')]);})[_0x3232('0x2e')](function(_0x1b5255){logger[_0x3232('0x2f')](_0x3232('0x30'),_0x1b5255[_0x3232('0x31')]);_0x44b864(_0x1b5255);});});}function getUser(_0x4568e1,_0x2b26c8,_0x360252,_0x5c8430){logger[_0x3232('0x32')]('Search\x20user');return request({'method':_0x3232('0x33'),'uri':util[_0x3232('0x34')](_0x3232('0x35'),_0x2b26c8),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x3232('0x36')+_0x4568e1},'json':!![]})[_0x3232('0x2b')](function(_0x3d1960){if(_0x3d1960[_0x3232('0x37')]){var _0x1aed50=-0x1;if(_['isArrayLikeObject'](_0x3d1960[_0x3232('0x37')])){if(!_[_0x3232('0x1d')](_0x5c8430)){_0x1aed50=_[_0x3232('0x38')](_0x3d1960['users'],function(_0x3d2565){return _0x3d2565[_0x3232('0x39')]===_0x5c8430;});}if(_0x1aed50>=0x0){logger['info'](_0x3232('0x3a'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x1aed50=_[_0x3232('0x38')](_0x3d1960[_0x3232('0x37')],function(_0x2c5fff){return _0x2c5fff[_0x3232('0x3b')][_0x3232('0x19')]===_0x3232('0x3c');});}return _0x3d1960[_0x3232('0x37')][_0x1aed50];}else{if(_0x3d1960[_0x3232('0x3d')][_0x3232('0x3b')][_0x3232('0x19')]===_0x3232('0x3c')){logger['info'](_0x3232('0x3e'));user=_0x3d1960[_0x3232('0x3d')];return user;}else{logger[_0x3232('0x2f')](_0x3232('0x3f'),JSON[_0x3232('0xd')](_0x3d1960));throw new Error(_0x3232('0x40')+JSON[_0x3232('0xd')](_0x3d1960));}}}else{logger[_0x3232('0x2f')]('The\x20failing\x20result\x20is',JSON[_0x3232('0xd')](_0x3d1960));throw new Error(_0x3232('0x40')+JSON[_0x3232('0xd')](_0x3d1960));}})[_0x3232('0x2e')](function(_0x1416c3){console['error'](_0x1416c3);});}function getZohoUser(_0x34ecce,_0x2629fe){return new BPromise(function(_0x5d892b,_0x3b6304){request(_0x34ecce)[_0x3232('0x2b')](function(_0x601ba4){var _0x407f1a=null;if(_0x601ba4){_0x407f1a=_0x601ba4[_0x3232('0x41')][0x0];_0x407f1a[_0x3232('0x42')]=_0x2629fe;}_0x5d892b(_0x407f1a);})['catch'](function(_0x1d1e24){_0x3b6304(_0x1d1e24);});});}function createEndUser(_0x399c4b,_0x440aa9,_0x392f30,_0x33e8b0,_0x3e3076,_0x55390e){var _0x392f30=getName(_0x392f30);return request({'method':_0x3232('0x26'),'uri':_0x3232('0x43')+_0x440aa9+_0x3232('0x44')+_[_0x3232('0x45')](_0x55390e['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x392f30[0x1],'First_Name':_0x392f30[0x0],'Phone':_0x33e8b0,'Owner':{'name':!_[_0x3232('0x1d')](_0x3e3076['role']['name'])?_0x3e3076[_0x3232('0x46')][_0x3232('0x19')]:!_[_0x3232('0x1d')](_0x3e3076[_0x3232('0x47')])?_0x3e3076[_0x3232('0x47')]+'\x20'+_0x3e3076['last_name']:_0x3e3076['last_name'],'id':_0x3e3076['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x399c4b},'json':!![]})['then'](function(_0x8dfd66){if(_0x8dfd66&&_0x8dfd66[_0x3232('0x41')][0x0][_0x3232('0x48')]===_0x3232('0x49')){var _0x1b4ec8=_0x8dfd66[_0x3232('0x41')][0x0][_0x3232('0x4a')];_0x1b4ec8[_0x3232('0x42')]=_[_0x3232('0x45')](_0x55390e['moduleCreate'])+'s';return _0x1b4ec8;}logger[_0x3232('0x2f')](_0x3232('0x3f'),JSON[_0x3232('0xd')](data));throw new Error(_0x3232('0x4b')+JSON[_0x3232('0xd')](data));})[_0x3232('0x2e')](function(_0x13bbcd){console[_0x3232('0x4c')](_0x3232('0x4d'),_0x13bbcd);});}function getEndUser(_0x1e34dc,_0x415f05,_0x860e71,_0x1fe11a,_0x4ce3fe,_0x31e786,_0x126c4b){var _0x44ad4c={'method':_0x3232('0x33'),'uri':'','headers':{'Authorization':_0x3232('0x36')+_0x1e34dc},'json':!![]};switch(_0x126c4b[_0x3232('0x4e')]){case _0x3232('0x4f'):_0x44ad4c[_0x3232('0x50')]=_0x3232('0x43')+_0x415f05+_0x3232('0x51')+_0x4ce3fe+'))';return getZohoUser(_0x44ad4c,_0x3232('0x52'))[_0x3232('0x2b')](function(_0x282bc3){if(_0x282bc3)return _0x282bc3;_0x44ad4c[_0x3232('0x50')]=_0x3232('0x43')+_0x415f05+_0x3232('0x53')+_0x4ce3fe+'))';return getZohoUser(_0x44ad4c,_0x3232('0x54'))[_0x3232('0x2b')](function(_0x593a02){if(_0x593a02)return _0x593a02;if(_0x126c4b[_0x3232('0x55')]!=_0x3232('0x56')){return createEndUser(_0x1e34dc,_0x415f05,_0x1fe11a,_0x4ce3fe,_0x31e786,_0x126c4b);}else{return{};}});});break;case _0x3232('0x57'):_0x44ad4c[_0x3232('0x50')]=_0x3232('0x43')+_0x415f05+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4ce3fe+'))';return getZohoUser(_0x44ad4c,_0x3232('0x52'))[_0x3232('0x2b')](function(_0x48fa3e){if(_0x48fa3e)return _0x48fa3e;if(_0x126c4b[_0x3232('0x55')]!=_0x3232('0x56')){return createEndUser(_0x1e34dc,_0x415f05,_0x1fe11a,_0x4ce3fe,_0x31e786,_0x126c4b);}else{return{};}});break;case _0x3232('0x58'):_0x44ad4c[_0x3232('0x50')]=_0x3232('0x43')+_0x415f05+_0x3232('0x53')+_0x4ce3fe+'))';return getZohoUser(_0x44ad4c,'Leads')[_0x3232('0x2b')](function(_0x4659f3){if(_0x4659f3)return _0x4659f3;if(_0x126c4b[_0x3232('0x55')]!=_0x3232('0x56')){return createEndUser(_0x1e34dc,_0x415f05,_0x1fe11a,_0x4ce3fe,_0x31e786,_0x126c4b);}else{return{};}});break;}}function getCall(_0x190f65,_0x4b2d8a,_0x1ac0b2,_0x5841c4,_0x5765d7,_0x5cc016,_0x258c10,_0x1a4e84){logger['info'](_0x3232('0x59'));var _0x43c376={};_0x43c376[_0x3232('0x5a')]={'name':!_[_0x3232('0x1d')](_0x5841c4[_0x3232('0x46')][_0x3232('0x19')])&&!_[_0x3232('0x1d')](_0x5841c4['profile']['name'])&&_0x5841c4[_0x3232('0x3b')][_0x3232('0x19')]===_0x3232('0x5b')?_0x5841c4[_0x3232('0x46')][_0x3232('0x19')]:!_[_0x3232('0x1d')](_0x5841c4[_0x3232('0x47')])?_0x5841c4[_0x3232('0x47')]+'\x20'+_0x5841c4[_0x3232('0x5c')]:_0x5841c4['last_name'],'id':_0x5841c4['id']};_0x43c376['Subject']=intUtil['getString'](_0x5cc016[_0x3232('0x5d')],_0x258c10,'\x20');_0x43c376[_0x3232('0x5e')]=intUtil['getString'](_0x5cc016[_0x3232('0x5f')],_0x258c10,'\x0a');if(_0x5765d7[_0x3232('0x42')]===_0x3232('0x52')){_0x43c376[_0x3232('0x60')]={'name':!_[_0x3232('0x1d')](_0x5765d7[_0x3232('0x61')])?_0x5765d7[_0x3232('0x61')]:!_[_0x3232('0x1d')](_0x5765d7['First_Name'])?_0x5765d7['First_Name']+'\x20'+_0x5765d7[_0x3232('0x62')]:_0x5765d7[_0x3232('0x62')],'id':_0x5765d7['id']};}if(_0x5765d7['enduserType']===_0x3232('0x54')){_0x43c376[_0x3232('0x63')]={'name':!_['isNil'](_0x5765d7[_0x3232('0x61')])?_0x5765d7[_0x3232('0x61')]:!_[_0x3232('0x1d')](_0x5765d7[_0x3232('0x64')])?_0x5765d7[_0x3232('0x64')]+'\x20'+_0x5765d7[_0x3232('0x62')]:_0x5765d7[_0x3232('0x62')],'id':_0x5765d7['id']};_0x43c376[_0x3232('0x65')]=_[_0x3232('0x45')](_0x5765d7[_0x3232('0x42')]);}if(_0x258c10[_0x3232('0x66')]){_0x43c376[_0x3232('0x67')]=moment[_0x3232('0x68')](parseInt(_0x258c10['talktime'])*0x3e8)[_0x3232('0x34')](_0x3232('0x69'));}else if(_0x258c10['answertime']&&_0x258c10['endtime']){_0x43c376[_0x3232('0x67')]=moment[_0x3232('0x68')](moment(_0x258c10[_0x3232('0x6a')],_0x3232('0x6b'))[_0x3232('0x6c')](moment(_0x258c10[_0x3232('0x6d')],_0x3232('0x6b'))))['format'](_0x3232('0x69'));}switch(_0x258c10[_0x3232('0x6e')]){case _0x3232('0x6f'):_0x43c376[_0x3232('0x70')]=_0x3232('0x71');break;case _0x3232('0x72'):case'connect':_0x43c376[_0x3232('0x70')]=_0x3232('0x73');break;case'rejected':_0x43c376[_0x3232('0x70')]=_0x3232('0x74');break;case'abandoned':_0x43c376['Call_Result']=_0x3232('0x75');break;case _0x3232('0x76'):_0x43c376['Call_Result']=_0x3232('0x77');default:}_0x43c376[_0x3232('0x78')]=(_0x1a4e84===_0x3232('0x79')?moment(_0x258c10['starttime'])[_0x3232('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x258c10[_0x3232('0x7a')])[_0x3232('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x3232('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x43c376['Call_Type']=_0x1a4e84||_0x3232('0x7b');_0x43c376=_[_0x3232('0x7c')](_0x43c376,getCustomFields(_0x5cc016[_0x3232('0x7d')],_0x258c10));return request({'method':_0x3232('0x26'),'uri':'https://www.zohoapis.'+_0x4b2d8a+_0x3232('0x7e'),'headers':{'Authorization':_0x3232('0x36')+_0x190f65},'body':{'data':[_0x43c376]},'json':!![]})[_0x3232('0x2b')](function(_0x5bc8ff){if(_0x5bc8ff&&_0x5bc8ff['data'][0x0][_0x3232('0x48')]==='SUCCESS'){logger[_0x3232('0x32')](_0x3232('0x7f'));return{'id':_0x5bc8ff[_0x3232('0x41')][0x0]['details']['id']};}})[_0x3232('0x2e')](function(_0x355f14){logger[_0x3232('0x32')]('err',_0x355f14['stack']);console[_0x3232('0x4c')]('err',_0x355f14);});}exports[_0x3232('0x80')]=function(_0x324f82,_0x9548c7,_0x84b59a,_0x3381da,_0x17d01e,_0x19fcde){var _0x31b89b,_0x2ef60e,_0xb35c2b;_0x19fcde[_0x3232('0x81')]=intUtil[_0x3232('0x82')](_0x19fcde['host']);_0x19fcde['serverUrl']=intUtil[_0x3232('0x82')](_0x19fcde[_0x3232('0x83')]);if(_0x17d01e&&_0x17d01e['monitor_format']){logger[_0x3232('0x32')](_0x3232('0x84'),'Recording\x20is\x20enabled!');_0x9548c7[_0x3232('0x85')]=_0x19fcde[_0x3232('0x83')]+'/api/voice/recordings/'+_0x9548c7[_0x3232('0x86')]+_0x3232('0x87')+md5(_0x9548c7[_0x3232('0x86')]);}else{_0x9548c7[_0x3232('0x85')]='';}var _0x1f9075=_0x19fcde[_0x3232('0x81')]===_0x3232('0x88')?'eu':_0x3232('0x89');return getAccessToken(_0x19fcde)[_0x3232('0x2b')](function(_0x247c7c){_0xb35c2b=_0x247c7c;return getUser(_0xb35c2b,_0x1f9075,_0x19fcde,_0x3381da[_0x3232('0x39')]);})['then'](function(_0x1533ae){_0x31b89b=_0x1533ae;logger[_0x3232('0x32')](_0x3232('0x8a'),_0x31b89b['id']);return getEndUser(_0xb35c2b,_0x1f9075,_0x19fcde,_0x9548c7[_0x3232('0x8b')],_0x9548c7['calleridnum'],_0x31b89b,_0x84b59a);})[_0x3232('0x2b')](function(_0x3504aa){_0x2ef60e=_0x3504aa;return getCall(_0xb35c2b,_0x1f9075,_0x19fcde,_0x31b89b,_0x2ef60e,_0x84b59a,_0x9548c7,'Inbound');})[_0x3232('0x2b')](function(_0x4f1aa9){if(_0x4f1aa9){logger[_0x3232('0x32')]('The\x20Call\x20ID\x20is:',_0x4f1aa9['id']);logger[_0x3232('0x32')](_0x3232('0x84'),_0x3232('0x8c'));emit(util[_0x3232('0x34')](_0x3232('0x8d'),_0x3381da[_0x3232('0x19')]),_0x3232('0x8e'),{'uri':_0x3232('0x8f')+_0x19fcde[_0x3232('0x81')]+_0x3232('0x90')+_0x4f1aa9['id']});}})[_0x3232('0x2e')](function(_0x437ba9){logger[_0x3232('0x2f')](_0x3232('0x84'),JSON[_0x3232('0xd')](_0x437ba9));});};exports[_0x3232('0x79')]=function(_0x2d1a65,_0x42e0a4,_0x112361,_0x11b7f6,_0x3fb911,_0x2a8ba8,_0x56cdc8){var _0x32f090,_0x47a7af,_0x32b788;_0x2a8ba8['host']=intUtil[_0x3232('0x82')](_0x2a8ba8[_0x3232('0x81')]);_0x2a8ba8[_0x3232('0x83')]=intUtil['stripTrailingSlash'](_0x2a8ba8[_0x3232('0x83')]);if(_0x56cdc8&&_0x56cdc8['recordingFormat']&&_0x56cdc8['recordingFormat']!=='none'){logger[_0x3232('0x32')](_0x3232('0x91'),'Recording\x20is\x20enabled!');_0x42e0a4[_0x3232('0x85')]=_0x2a8ba8[_0x3232('0x83')]+_0x3232('0x92')+_0x42e0a4['uniqueid']+_0x3232('0x87')+md5(_0x42e0a4['uniqueid']);}var _0x122078=_0x2a8ba8[_0x3232('0x81')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x2a8ba8)[_0x3232('0x2b')](function(_0x5530f4){_0x32b788=_0x5530f4;return getUser(_0x32b788,_0x122078,_0x2a8ba8,_0x11b7f6[_0x3232('0x39')]);})[_0x3232('0x2b')](function(_0x30e248){_0x32f090=_0x30e248;logger[_0x3232('0x32')](_0x3232('0x8a'),_0x32f090['id']);return getEndUser(_0x32b788,_0x122078,_0x2a8ba8,_0x42e0a4[_0x3232('0x93')],_0x42e0a4[_0x3232('0x94')],_0x32f090,_0x112361);})[_0x3232('0x2b')](function(_0x52a1e0){_0x47a7af=_0x52a1e0;return getCall(_0x32b788,_0x122078,_0x2a8ba8,_0x32f090,_0x47a7af,_0x112361,_0x42e0a4,_0x3232('0x95'));})['then'](function(_0x2b1a85){if(_0x2b1a85){logger[_0x3232('0x32')]('The\x20Call\x20ID\x20is:',_0x2b1a85['id']);logger[_0x3232('0x32')](_0x3232('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3232('0x34')]('user:%s',_0x11b7f6['name']),_0x3232('0x8e'),{'uri':_0x3232('0x8f')+_0x2a8ba8['host']+_0x3232('0x90')+_0x2b1a85['id']});}})[_0x3232('0x2e')](function(_0x7a1fcf){logger[_0x3232('0x2f')](_0x3232('0x91'),JSON[_0x3232('0xd')](_0x7a1fcf));});};exports[_0x3232('0x96')]=function(_0x487ffe,_0x33d7b7,_0xfc281b,_0xc0703c,_0x155e38,_0x53afb0){var _0x279018,_0x36c119,_0xe023c0;_0x53afb0['host']=intUtil[_0x3232('0x82')](_0x53afb0[_0x3232('0x81')]);_0x53afb0[_0x3232('0x83')]=intUtil[_0x3232('0x82')](_0x53afb0[_0x3232('0x83')]);if(_0x155e38&&_0x155e38['monitor_format']){logger[_0x3232('0x32')]('['+_0x33d7b7[_0x3232('0x6e')]['toUpperCase']()+']',_0x3232('0x97'));_0x33d7b7['recordingURL']=_0x53afb0[_0x3232('0x83')]+'/api/voice/recordings/'+_0x33d7b7[_0x3232('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x33d7b7[_0x3232('0x86')]);}else{_0x33d7b7[_0x3232('0x85')]='';}var _0x48ff95=_0x53afb0['host']===_0x3232('0x88')?'eu':_0x3232('0x89');return getAccessToken(_0x53afb0)[_0x3232('0x2b')](function(_0x2097d9){_0xe023c0=_0x2097d9;return getUser(_0xe023c0,_0x48ff95,_0x53afb0);})[_0x3232('0x2b')](function(_0x2e31e5){_0x279018=_0x2e31e5;logger['info'](_0x3232('0x8a'),_0x279018['id']);return getEndUser(_0xe023c0,_0x48ff95,_0x53afb0,_0x33d7b7[_0x3232('0x8b')],_0x33d7b7[_0x3232('0x98')],_0x279018,_0xfc281b);})[_0x3232('0x2b')](function(_0x84ff0b){_0x36c119=_0x84ff0b;return getCall(_0xe023c0,_0x48ff95,_0x53afb0,_0x279018,_0x36c119,_0xfc281b,_0x33d7b7,_0x3232('0x7b'));})[_0x3232('0x2b')](function(_0x218871){if(_0x218871){logger['info'](_0x3232('0x99'),_0x218871['id']);}})[_0x3232('0x2e')](function(_0x1a9fa5){logger[_0x3232('0x2f')]('['+_0x33d7b7['lastevent'][_0x3232('0x9a')]()+']',JSON[_0x3232('0xd')](_0x1a9fa5));});}; \ No newline at end of file +var _0xb34a=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','Outbound','unmanaged','monitor_format','Recording\x20is\x20enabled!','calleridnum','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','then','code','log','moduleSearch','contact_lead','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','recordingURL','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x4d975b,_0x416926){var _0x47f833=function(_0x307834){while(--_0x307834){_0x4d975b['push'](_0x4d975b['shift']());}};_0x47f833(++_0x416926);}(_0xb34a,0x1ef));var _0xab34=function(_0x5e9a8a,_0x3152e3){_0x5e9a8a=_0x5e9a8a-0x0;var _0x291591=_0xb34a[_0x5e9a8a];return _0x291591;};'use strict';var _=require(_0xab34('0x0'));var rp=require(_0xab34('0x1'));var md5=require(_0xab34('0x2'));var util=require(_0xab34('0x3'));var intUtil=require(_0xab34('0x4'));var moment=require(_0xab34('0x5'));var Redis=require(_0xab34('0x6'));var BPromise=require(_0xab34('0x7'));var config=require(_0xab34('0x8'));var logger=require(_0xab34('0x9'))(_0xab34('0xa'));config[_0xab34('0xb')]=_['defaults'](config[_0xab34('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xab34('0xc'))(new Redis(config[_0xab34('0xb')]));function emit(_0x26841d,_0x44b44e,_0x1b6bcd){io['to'](_0x26841d)[_0xab34('0xd')](_0x44b44e,_0x1b6bcd);}function request(_0x216165){logger[_0xab34('0xe')](_0xab34('0xf'),JSON[_0xab34('0x10')](_0x216165));return rp(_0x216165);}function getCustomFields(_0x12cd05,_0x2ed419){var _0x1bb338={};if(_0x12cd05[_0xab34('0x11')]>0x0){_['forEach'](_0x12cd05,function(_0x2e7c14){if(_[_0xab34('0x12')]([_0xab34('0x13'),_0xab34('0x14')],_0x2e7c14[_0xab34('0x15')])&&_0x2e7c14['idField']){_0x1bb338[_0x2e7c14[_0xab34('0x16')]]=_0x2e7c14[_0xab34('0x17')][_0xab34('0x18')]();}else if(_0x2e7c14['type']==='variable'&&_0x2e7c14[_0xab34('0x19')]&&_0x2e7c14[_0xab34('0x16')]&&_0x2ed419[_0x2e7c14[_0xab34('0x19')]]){_0x1bb338[_0x2e7c14['idField']]=_0x2ed419[_0x2e7c14[_0xab34('0x19')]][_0xab34('0x18')]();}else if(_0x2e7c14[_0xab34('0x15')]===_0xab34('0x1a')&&_0x2e7c14['Variable']&&_0x2e7c14[_0xab34('0x1b')][_0xab34('0x1c')]&&_0x2e7c14[_0xab34('0x16')]&&_0x2ed419[_0x2e7c14[_0xab34('0x1b')][_0xab34('0x1c')]['toLowerCase']()]){_0x1bb338[_0x2e7c14[_0xab34('0x16')]]=_0x2ed419[_0x2e7c14[_0xab34('0x1b')][_0xab34('0x1c')]['toLowerCase']()][_0xab34('0x18')]();}});}return _0x1bb338;}function getName(_0x48579f){if(_0x48579f[_0xab34('0x1d')]('\x20')>0x0){var _0x371a3f=_0x48579f[_0xab34('0x1e')](/ (.+)/);if(_0x371a3f[0x1]){return _0x371a3f;}}return[_0x48579f,_0x48579f];}var accountsTokens={};function getAccessToken(_0x240ac){return new Promise(function(_0x4f228c,_0x27fa6f){if(!_[_0xab34('0x1f')](accountsTokens[_0x240ac['id']])&&!_['isNil'](accountsTokens[_0x240ac['id']][_0xab34('0x20')])){if(moment()[_0xab34('0x21')](accountsTokens[_0x240ac['id']][_0xab34('0x22')])){_0x4f228c(accountsTokens[_0x240ac['id']][_0xab34('0x20')]);}}var _0x4476c9;switch(_0x240ac[_0xab34('0x23')]){case'US':_0x4476c9=_0xab34('0x24');break;case'AU':_0x4476c9='https://accounts.zoho.com.au';break;case'EU':_0x4476c9=_0xab34('0x25');break;case'IN':_0x4476c9=_0xab34('0x26');break;case'CN':_0x4476c9='https://accounts.zoho.com.cn';break;default:_0x4476c9='https://accounts.zoho.eu';break;}var _0x4a1501={'method':_0xab34('0x27'),'uri':_0x4476c9+_0xab34('0x28'),'qs':{'refresh_token':_0x240ac[_0xab34('0x29')],'client_id':_0x240ac['clientId'],'client_secret':_0x240ac[_0xab34('0x2a')],'grant_type':_0xab34('0x2b')},'json':!![]};return rp(_0x4a1501)['then'](function(_0x48d180){accountsTokens[_0x240ac['id']]={'access_token':_0x48d180[_0xab34('0x20')],'expires_in':moment()[_0xab34('0x2c')](_0x48d180['expires_in'],_0xab34('0x2d'))};_0x4f228c(_0x48d180['access_token']);})[_0xab34('0x2e')](function(_0x16cea9){logger['error'](_0xab34('0x2f'),_0x16cea9[_0xab34('0x30')]);_0x27fa6f(_0x16cea9);});});}function getUser(_0x59475f,_0x10a71b,_0x288e39,_0x295fca){logger['info'](_0xab34('0x31'));return request({'method':_0xab34('0x32'),'uri':util[_0xab34('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x10a71b),'qs':{'type':_0xab34('0x34')},'headers':{'Authorization':_0xab34('0x35')+_0x59475f},'json':!![]})['then'](function(_0x1c94b3){if(_0x1c94b3[_0xab34('0x36')]){var _0x5e285c=-0x1;if(_['isArrayLikeObject'](_0x1c94b3[_0xab34('0x36')])){if(!_[_0xab34('0x1f')](_0x295fca)){_0x5e285c=_[_0xab34('0x37')](_0x1c94b3[_0xab34('0x36')],function(_0xc3a083){return _0xc3a083['email']===_0x295fca;});}if(_0x5e285c>=0x0){logger['info'](_0xab34('0x38'));}else{logger[_0xab34('0x39')](_0xab34('0x3a'));_0x5e285c=_[_0xab34('0x37')](_0x1c94b3[_0xab34('0x36')],function(_0xe36145){return _0xe36145[_0xab34('0x3b')][_0xab34('0x1c')]===_0xab34('0x3c');});}return _0x1c94b3[_0xab34('0x36')][_0x5e285c];}else{if(_0x1c94b3[_0xab34('0x3d')]['profile'][_0xab34('0x1c')]===_0xab34('0x3c')){logger[_0xab34('0x39')](_0xab34('0x3a'));user=_0x1c94b3[_0xab34('0x3d')];return user;}else{logger[_0xab34('0x3e')](_0xab34('0x3f'),JSON[_0xab34('0x10')](_0x1c94b3));throw new Error(_0xab34('0x40')+JSON['stringify'](_0x1c94b3));}}}else{logger[_0xab34('0x3e')]('The\x20failing\x20result\x20is',JSON[_0xab34('0x10')](_0x1c94b3));throw new Error(_0xab34('0x40')+JSON['stringify'](_0x1c94b3));}})[_0xab34('0x2e')](function(_0x4c96bf){console[_0xab34('0x3e')](_0x4c96bf);});}function getZohoUser(_0x5d492a,_0x8abe92){return new BPromise(function(_0x5c1a4c,_0x20b96d){request(_0x5d492a)['then'](function(_0x518501){var _0x3e647e=null;if(_0x518501){_0x3e647e=_0x518501[_0xab34('0x41')][0x0];_0x3e647e[_0xab34('0x42')]=_0x8abe92;}_0x5c1a4c(_0x3e647e);})[_0xab34('0x2e')](function(_0x4a9aac){_0x20b96d(_0x4a9aac);});});}function createEndUser(_0x1ee37f,_0x3880ab,_0x9b080c,_0x3241bf,_0x48c264,_0x39038a){var _0x9b080c=getName(_0x9b080c);return request({'method':_0xab34('0x27'),'uri':'https://www.zohoapis.'+_0x3880ab+_0xab34('0x43')+_[_0xab34('0x44')](_0x39038a[_0xab34('0x45')])+'s','body':{'data':[{'Last_Name':_0x9b080c[0x1],'First_Name':_0x9b080c[0x0],'Phone':_0x3241bf,'Owner':{'name':!_[_0xab34('0x1f')](_0x48c264[_0xab34('0x46')][_0xab34('0x1c')])?_0x48c264[_0xab34('0x46')][_0xab34('0x1c')]:!_[_0xab34('0x1f')](_0x48c264[_0xab34('0x47')])?_0x48c264['first_name']+'\x20'+_0x48c264[_0xab34('0x48')]:_0x48c264[_0xab34('0x48')],'id':_0x48c264['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1ee37f},'json':!![]})[_0xab34('0x49')](function(_0x36dafb){if(_0x36dafb&&_0x36dafb[_0xab34('0x41')][0x0][_0xab34('0x4a')]==='SUCCESS'){var _0xec73c4=_0x36dafb[_0xab34('0x41')][0x0]['details'];_0xec73c4[_0xab34('0x42')]=_[_0xab34('0x44')](_0x39038a[_0xab34('0x45')])+'s';return _0xec73c4;}logger['error'](_0xab34('0x3f'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xab34('0x10')](data));})[_0xab34('0x2e')](function(_0x5c91fb){console[_0xab34('0x4b')]('CREATE\x20ERROR',_0x5c91fb);});}function getEndUser(_0x4433e0,_0x430cdf,_0x54e89c,_0x59fc36,_0x30f27b,_0x5beadd,_0x23efd7){var _0x5cd92d={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4433e0},'json':!![]};switch(_0x23efd7[_0xab34('0x4c')]){case _0xab34('0x4d'):_0x5cd92d['uri']=_0xab34('0x4e')+_0x430cdf+_0xab34('0x4f')+_0x30f27b+'))';return getZohoUser(_0x5cd92d,_0xab34('0x50'))[_0xab34('0x49')](function(_0x17adec){if(_0x17adec)return _0x17adec;_0x5cd92d[_0xab34('0x51')]=_0xab34('0x4e')+_0x430cdf+_0xab34('0x52')+_0x30f27b+'))';return getZohoUser(_0x5cd92d,_0xab34('0x53'))[_0xab34('0x49')](function(_0x2cb74a){if(_0x2cb74a)return _0x2cb74a;if(_0x23efd7[_0xab34('0x45')]!=_0xab34('0x54')){return createEndUser(_0x4433e0,_0x430cdf,_0x59fc36,_0x30f27b,_0x5beadd,_0x23efd7);}else{return{};}});});break;case _0xab34('0x55'):_0x5cd92d[_0xab34('0x51')]=_0xab34('0x4e')+_0x430cdf+_0xab34('0x4f')+_0x30f27b+'))';return getZohoUser(_0x5cd92d,_0xab34('0x50'))[_0xab34('0x49')](function(_0x2493e2){if(_0x2493e2)return _0x2493e2;if(_0x23efd7['moduleCreate']!=_0xab34('0x54')){return createEndUser(_0x4433e0,_0x430cdf,_0x59fc36,_0x30f27b,_0x5beadd,_0x23efd7);}else{return{};}});break;case _0xab34('0x56'):_0x5cd92d[_0xab34('0x51')]='https://www.zohoapis.'+_0x430cdf+_0xab34('0x52')+_0x30f27b+'))';return getZohoUser(_0x5cd92d,_0xab34('0x53'))['then'](function(_0x43104c){if(_0x43104c)return _0x43104c;if(_0x23efd7[_0xab34('0x45')]!=_0xab34('0x54')){return createEndUser(_0x4433e0,_0x430cdf,_0x59fc36,_0x30f27b,_0x5beadd,_0x23efd7);}else{return{};}});break;}}function getCall(_0x369571,_0x11fecc,_0x57c3a2,_0x401eca,_0x3f21e0,_0x14ebb7,_0x4163ea,_0x3ac2fc){logger[_0xab34('0x39')](_0xab34('0x57'));var _0x1363cf={};_0x1363cf[_0xab34('0x58')]={'name':!_[_0xab34('0x1f')](_0x401eca[_0xab34('0x46')]['name'])&&!_[_0xab34('0x1f')](_0x401eca[_0xab34('0x3b')][_0xab34('0x1c')])&&_0x401eca[_0xab34('0x3b')]['name']===_0xab34('0x59')?_0x401eca[_0xab34('0x46')][_0xab34('0x1c')]:!_[_0xab34('0x1f')](_0x401eca[_0xab34('0x47')])?_0x401eca[_0xab34('0x47')]+'\x20'+_0x401eca[_0xab34('0x48')]:_0x401eca[_0xab34('0x48')],'id':_0x401eca['id']};_0x1363cf['Subject']=intUtil[_0xab34('0x5a')](_0x14ebb7['Subjects'],_0x4163ea,'\x20');_0x1363cf[_0xab34('0x5b')]=intUtil[_0xab34('0x5a')](_0x14ebb7[_0xab34('0x5c')],_0x4163ea,'\x0a');if(_0x3f21e0[_0xab34('0x42')]==='Contacts'){_0x1363cf[_0xab34('0x5d')]={'name':!_['isNil'](_0x3f21e0[_0xab34('0x5e')])?_0x3f21e0[_0xab34('0x5e')]:!_[_0xab34('0x1f')](_0x3f21e0[_0xab34('0x5f')])?_0x3f21e0[_0xab34('0x5f')]+'\x20'+_0x3f21e0[_0xab34('0x60')]:_0x3f21e0[_0xab34('0x60')],'id':_0x3f21e0['id']};}if(_0x3f21e0[_0xab34('0x42')]===_0xab34('0x53')){_0x1363cf[_0xab34('0x61')]={'name':!_[_0xab34('0x1f')](_0x3f21e0[_0xab34('0x5e')])?_0x3f21e0['Full_Name']:!_[_0xab34('0x1f')](_0x3f21e0['First_Name'])?_0x3f21e0[_0xab34('0x5f')]+'\x20'+_0x3f21e0[_0xab34('0x60')]:_0x3f21e0[_0xab34('0x60')],'id':_0x3f21e0['id']};_0x1363cf[_0xab34('0x62')]=_[_0xab34('0x44')](_0x3f21e0[_0xab34('0x42')]);}if(_0x4163ea['talktime']){_0x1363cf[_0xab34('0x63')]=moment[_0xab34('0x64')](parseInt(_0x4163ea[_0xab34('0x65')])*0x3e8)[_0xab34('0x33')](_0xab34('0x66'));}else if(_0x4163ea[_0xab34('0x67')]&&_0x4163ea[_0xab34('0x68')]){_0x1363cf[_0xab34('0x63')]=moment['utc'](moment(_0x4163ea[_0xab34('0x68')],_0xab34('0x69'))[_0xab34('0x6a')](moment(_0x4163ea[_0xab34('0x6b')],_0xab34('0x69'))))[_0xab34('0x33')]('mm:ss');}switch(_0x4163ea[_0xab34('0x6c')]){case _0xab34('0x6d'):_0x1363cf[_0xab34('0x6e')]=_0xab34('0x6f');break;case _0xab34('0x70'):case _0xab34('0x71'):_0x1363cf[_0xab34('0x6e')]=_0xab34('0x72');break;case _0xab34('0x73'):_0x1363cf['Call_Result']=_0xab34('0x74');break;case _0xab34('0x75'):_0x1363cf[_0xab34('0x6e')]=_0xab34('0x76');break;case'timeout':_0x1363cf[_0xab34('0x6e')]=_0xab34('0x77');default:}_0x1363cf['Call_Start_Time']=(_0x3ac2fc==='outbound'?moment(_0x4163ea[_0xab34('0x6b')])[_0xab34('0x33')](_0xab34('0x69')):moment(_0x4163ea['agentcalledAt'])[_0xab34('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xab34('0x33')]('YYYY-MM-DDTHH:mm:ss');_0x1363cf[_0xab34('0x78')]=_0x3ac2fc||_0xab34('0x79');_0x1363cf=_['merge'](_0x1363cf,getCustomFields(_0x14ebb7[_0xab34('0x7a')],_0x4163ea));return request({'method':'POST','uri':_0xab34('0x4e')+_0x11fecc+_0xab34('0x7b'),'headers':{'Authorization':_0xab34('0x35')+_0x369571},'body':{'data':[_0x1363cf]},'json':!![]})[_0xab34('0x49')](function(_0x821ff3){if(_0x821ff3&&_0x821ff3[_0xab34('0x41')][0x0][_0xab34('0x4a')]===_0xab34('0x7c')){logger[_0xab34('0x39')](_0xab34('0x7d'));return{'id':_0x821ff3[_0xab34('0x41')][0x0][_0xab34('0x7e')]['id']};}})[_0xab34('0x2e')](function(_0x2b5ee1){logger['info'](_0xab34('0x7f'),_0x2b5ee1[_0xab34('0x30')]);console[_0xab34('0x4b')]('err',_0x2b5ee1);});}exports[_0xab34('0x80')]=function(_0xb1426,_0x3d0141,_0xc59c2,_0xa91509,_0x19a7ee,_0x4eb465){var _0x17b1ac,_0x1e15fb,_0x5db8d9;_0x4eb465[_0xab34('0x81')]=intUtil[_0xab34('0x82')](_0x4eb465['host']);_0x4eb465[_0xab34('0x83')]=intUtil['stripTrailingSlash'](_0x4eb465[_0xab34('0x83')]);if(_0x19a7ee&&_0x19a7ee['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x3d0141['recordingURL']=_0x4eb465[_0xab34('0x83')]+'/api/voice/recordings/'+_0x3d0141['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3d0141['uniqueid']);}else{_0x3d0141[_0xab34('0x84')]='';}var _0x23a28d=_0x4eb465[_0xab34('0x81')]==='zoho.eu'?'eu':_0xab34('0x85');return getAccessToken(_0x4eb465)[_0xab34('0x49')](function(_0x347445){_0x5db8d9=_0x347445;return getUser(_0x5db8d9,_0x23a28d,_0x4eb465,_0xa91509[_0xab34('0x86')]);})[_0xab34('0x49')](function(_0x44e6cb){_0x17b1ac=_0x44e6cb;logger[_0xab34('0x39')](_0xab34('0x87'),_0x17b1ac['id']);return getEndUser(_0x5db8d9,_0x23a28d,_0x4eb465,_0x3d0141[_0xab34('0x88')],_0x3d0141['calleridnum'],_0x17b1ac,_0xc59c2);})[_0xab34('0x49')](function(_0x479914){_0x1e15fb=_0x479914;return getCall(_0x5db8d9,_0x23a28d,_0x4eb465,_0x17b1ac,_0x1e15fb,_0xc59c2,_0x3d0141,'Inbound');})['then'](function(_0x2d5605){if(_0x2d5605){logger[_0xab34('0x39')](_0xab34('0x89'),_0x2d5605['id']);logger['info'](_0xab34('0x8a'),_0xab34('0x8b'));emit(util[_0xab34('0x33')](_0xab34('0x8c'),_0xa91509[_0xab34('0x1c')]),_0xab34('0x8d'),{'uri':_0xab34('0x8e')+_0x4eb465['host']+_0xab34('0x8f')+_0x2d5605['id']});}})['catch'](function(_0x5c70d9){logger[_0xab34('0x3e')](_0xab34('0x8a'),JSON['stringify'](_0x5c70d9));});};exports[_0xab34('0x90')]=function(_0x2155f3,_0x5543c0,_0x4717d2,_0x2c69e9,_0x393057,_0x4ceb85,_0x537c76){var _0x326587,_0x1d7116,_0x327bb3;_0x4ceb85[_0xab34('0x81')]=intUtil[_0xab34('0x82')](_0x4ceb85['host']);_0x4ceb85[_0xab34('0x83')]=intUtil[_0xab34('0x82')](_0x4ceb85[_0xab34('0x83')]);if(_0x537c76&&_0x537c76[_0xab34('0x91')]&&_0x537c76[_0xab34('0x91')]!==_0xab34('0x92')){logger['info'](_0xab34('0x93'),'Recording\x20is\x20enabled!');_0x5543c0[_0xab34('0x84')]=_0x4ceb85[_0xab34('0x83')]+_0xab34('0x94')+_0x5543c0[_0xab34('0x95')]+_0xab34('0x96')+md5(_0x5543c0['uniqueid']);}var _0x50295c=_0x4ceb85[_0xab34('0x81')]===_0xab34('0x97')?'eu':_0xab34('0x85');return getAccessToken(_0x4ceb85)[_0xab34('0x49')](function(_0x4b361d){_0x327bb3=_0x4b361d;return getUser(_0x327bb3,_0x50295c,_0x4ceb85,_0x2c69e9[_0xab34('0x86')]);})[_0xab34('0x49')](function(_0x4542b7){_0x326587=_0x4542b7;logger[_0xab34('0x39')](_0xab34('0x87'),_0x326587['id']);return getEndUser(_0x327bb3,_0x50295c,_0x4ceb85,_0x5543c0[_0xab34('0x98')],_0x5543c0['destcalleridnum'],_0x326587,_0x4717d2);})[_0xab34('0x49')](function(_0x44f54b){_0x1d7116=_0x44f54b;return getCall(_0x327bb3,_0x50295c,_0x4ceb85,_0x326587,_0x1d7116,_0x4717d2,_0x5543c0,_0xab34('0x99'));})[_0xab34('0x49')](function(_0x23479d){if(_0x23479d){logger[_0xab34('0x39')]('The\x20Call\x20ID\x20is:',_0x23479d['id']);logger[_0xab34('0x39')](_0xab34('0x93'),_0xab34('0x8b'));emit(util[_0xab34('0x33')](_0xab34('0x8c'),_0x2c69e9[_0xab34('0x1c')]),_0xab34('0x8d'),{'uri':_0xab34('0x8e')+_0x4ceb85[_0xab34('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x23479d['id']});}})[_0xab34('0x2e')](function(_0xc06d8a){logger['error']('[OUTBOUND]',JSON[_0xab34('0x10')](_0xc06d8a));});};exports[_0xab34('0x9a')]=function(_0x4eb441,_0x20a9f7,_0x2f5847,_0x38ab16,_0x133f4a,_0x29ae9d){var _0xae3313,_0x199c0c,_0x1841b5;_0x29ae9d[_0xab34('0x81')]=intUtil['stripTrailingSlash'](_0x29ae9d[_0xab34('0x81')]);_0x29ae9d[_0xab34('0x83')]=intUtil[_0xab34('0x82')](_0x29ae9d[_0xab34('0x83')]);if(_0x133f4a&&_0x133f4a[_0xab34('0x9b')]){logger[_0xab34('0x39')]('['+_0x20a9f7['lastevent']['toUpperCase']()+']',_0xab34('0x9c'));_0x20a9f7[_0xab34('0x84')]=_0x29ae9d[_0xab34('0x83')]+_0xab34('0x94')+_0x20a9f7[_0xab34('0x95')]+_0xab34('0x96')+md5(_0x20a9f7[_0xab34('0x95')]);}else{_0x20a9f7[_0xab34('0x84')]='';}var _0x11fe99=_0x29ae9d[_0xab34('0x81')]===_0xab34('0x97')?'eu':_0xab34('0x85');return getAccessToken(_0x29ae9d)[_0xab34('0x49')](function(_0x2c083a){_0x1841b5=_0x2c083a;return getUser(_0x1841b5,_0x11fe99,_0x29ae9d);})[_0xab34('0x49')](function(_0x280632){_0xae3313=_0x280632;logger['info'](_0xab34('0x87'),_0xae3313['id']);return getEndUser(_0x1841b5,_0x11fe99,_0x29ae9d,_0x20a9f7['calleridname'],_0x20a9f7[_0xab34('0x9d')],_0xae3313,_0x2f5847);})['then'](function(_0x40b77c){_0x199c0c=_0x40b77c;return getCall(_0x1841b5,_0x11fe99,_0x29ae9d,_0xae3313,_0x199c0c,_0x2f5847,_0x20a9f7,_0xab34('0x79'));})[_0xab34('0x49')](function(_0x1e3704){if(_0x1e3704){logger[_0xab34('0x39')](_0xab34('0x89'),_0x1e3704['id']);}})[_0xab34('0x2e')](function(_0x253efa){logger['error']('['+_0x20a9f7[_0xab34('0x6c')][_0xab34('0x9e')]()+']',JSON[_0xab34('0x10')](_0x253efa));});}; \ 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 3c87d88..48c8322 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 _0xb37e=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xb37e,0x1c8));var _0xeb37=function(_0x582138,_0x841835){_0x582138=_0x582138-0x0;var _0x29d969=_0xb37e[_0x582138];return _0x29d969;};'use strict';var util=require('util');var sh=require(_0xeb37('0x0'));var Mustache=require('mustache');var logger=require(_0xeb37('0x1'))(_0xeb37('0x2'));exports[_0xeb37('0x3')]=function(_0x51ff26,_0x485f47){var _0x481110=_0x51ff26[_0xeb37('0x4')]?_0x51ff26['data2']:_0xeb37('0x5');var _0x1fc94e=_0x51ff26['data3']?Mustache[_0xeb37('0x6')](_0x51ff26[_0xeb37('0x7')],_0x485f47):_0x485f47;sh[_0xeb37('0x3')](_0x1fc94e,function(_0x5d97e1,_0x40636b,_0x315dbd){if(_0x5d97e1!==0x0){logger[_0xeb37('0x8')](util[_0xeb37('0x9')](_0xeb37('0xa'),_0x481110,_0x1fc94e,_0x5d97e1,_0x315dbd));}else{logger[_0xeb37('0xb')](util[_0xeb37('0x9')](_0xeb37('0xc'),_0x481110,_0x1fc94e,_0x40636b));}});}; \ No newline at end of file +var _0x055b=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','exec','data2','Script','data3','render'];(function(_0x25a82d,_0xd39c44){var _0xf854eb=function(_0x172f1){while(--_0x172f1){_0x25a82d['push'](_0x25a82d['shift']());}};_0xf854eb(++_0xd39c44);}(_0x055b,0x1d9));var _0xb055=function(_0x9d8686,_0x44c96b){_0x9d8686=_0x9d8686-0x0;var _0x197485=_0x055b[_0x9d8686];return _0x197485;};'use strict';var util=require(_0xb055('0x0'));var sh=require(_0xb055('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xb055('0x2'));exports[_0xb055('0x3')]=function(_0x4771f9,_0x3649c0){var _0x24b726=_0x4771f9['data2']?_0x4771f9[_0xb055('0x4')]:_0xb055('0x5');var _0x4b2e7c=_0x4771f9[_0xb055('0x6')]?Mustache[_0xb055('0x7')](_0x4771f9[_0xb055('0x6')],_0x3649c0):_0x3649c0;sh['exec'](_0x4b2e7c,function(_0x2e8bf4,_0x27b111,_0x1b7e91){if(_0x2e8bf4!==0x0){logger[_0xb055('0x8')](util['format'](_0xb055('0x9'),_0x24b726,_0x4b2e7c,_0x2e8bf4,_0x1b7e91));}else{logger[_0xb055('0xa')](util[_0xb055('0xb')](_0xb055('0xc'),_0x24b726,_0x4b2e7c,_0x27b111));}});}; \ 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 c5a70f9..6bd263c 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 _0xb37c=['statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','headers','data6','error','stack','GET','DELETE','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0xb37c,0xb4));var _0xcb37=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb37c[_0xbca1b1];return _0x4e1686;};'use strict';var rp=require('request-promise');var util=require(_0xcb37('0x0'));var _=require(_0xcb37('0x1'));var Mustache=require('mustache');var logger=require(_0xcb37('0x2'))(_0xcb37('0x3'));exports[_0xcb37('0x4')]=function(_0x2c8afa,_0xbedfd5){var _0x18be2b,_0x284263;var _0x59a291={'method':_0x2c8afa[_0xcb37('0x5')][_0xcb37('0x6')](),'uri':Mustache[_0xcb37('0x7')](_0x2c8afa['data2'],_0xbedfd5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2c8afa[_0xcb37('0x8')])===_0xcb37('0x9')&&parseInt(_0x2c8afa['data5'])>=0x1&&parseInt(_0x2c8afa[_0xcb37('0x8')])<=0xa?parseInt(_0x2c8afa[_0xcb37('0x8')])*0x3e8:0x5*0x3e8};try{_0x59a291[_0xcb37('0xa')]=_0x2c8afa[_0xcb37('0xb')]?JSON['parse'](Mustache['render'](_0x2c8afa[_0xcb37('0xb')],_0xbedfd5)):{};}catch(_0x320a1d){logger[_0xcb37('0xc')](_0x320a1d[_0xcb37('0xd')]);}switch(_0x2c8afa[_0xcb37('0x5')][_0xcb37('0x6')]()){case _0xcb37('0xe'):case _0xcb37('0xf'):_0x18be2b=null;_0x59a291['qs']=_0xbedfd5;break;case'POST':case'PUT':if(_0x2c8afa[_0xcb37('0x10')]){try{_0x18be2b=JSON[_0xcb37('0x11')](Mustache[_0xcb37('0x7')](_0x2c8afa['data7'],_0xbedfd5));_0x59a291[_0xcb37('0x12')]=_0x18be2b;}catch(_0xf40c00){logger['error'](_0xf40c00[_0xcb37('0xd')]);logger[_0xcb37('0xc')](_0xcb37('0x13'));}}else{_0x18be2b=_0xbedfd5;_0x59a291['body']=_0x18be2b;}break;}logger['info'](util['format'](_0xcb37('0x14'),_0x2c8afa[_0xcb37('0x5')],_0x2c8afa[_0xcb37('0x15')],JSON[_0xcb37('0x16')](_0x59a291)));rp(_0x59a291)[_0xcb37('0x17')](function(_0xfe7077){_0x18be2b=!_[_0xcb37('0x18')](_0x18be2b)?_0xcb37('0x19')+_0x18be2b:'';_0x284263=typeof _0xfe7077['body']===_0xcb37('0x1a')?JSON[_0xcb37('0x16')](_0xfe7077[_0xcb37('0x12')]):_0xfe7077[_0xcb37('0x12')];logger[_0xcb37('0x1b')](util[_0xcb37('0x1c')](_0xcb37('0x1d'),_0x2c8afa[_0xcb37('0x5')],_0x2c8afa['data2'],_0xfe7077[_0xcb37('0x1e')],_0x284263));})[_0xcb37('0x1f')](function(_0x426ef7){logger['error'](util[_0xcb37('0x1c')](_0xcb37('0x20'),_0x2c8afa[_0xcb37('0x5')],_0x2c8afa[_0xcb37('0x15')],_0x426ef7[_0xcb37('0x1e')],_0x426ef7[_0xcb37('0x21')],_0x426ef7[_0xcb37('0x22')]));});}; \ No newline at end of file +var _0x32fa=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','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','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','GET','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x35fbb3,_0x102507){var _0x2388a4=function(_0x3c5246){while(--_0x3c5246){_0x35fbb3['push'](_0x35fbb3['shift']());}};_0x2388a4(++_0x102507);}(_0x32fa,0x1bd));var _0xa32f=function(_0x5a6f6a,_0xd523b0){_0x5a6f6a=_0x5a6f6a-0x0;var _0x49160c=_0x32fa[_0x5a6f6a];return _0x49160c;};'use strict';var rp=require('request-promise');var util=require(_0xa32f('0x0'));var _=require('lodash');var Mustache=require(_0xa32f('0x1'));var logger=require(_0xa32f('0x2'))(_0xa32f('0x3'));exports[_0xa32f('0x4')]=function(_0x175ef3,_0x452332){var _0x227881,_0x1a0df6;var _0x444fcf={'method':_0x175ef3[_0xa32f('0x5')][_0xa32f('0x6')](),'uri':Mustache[_0xa32f('0x7')](_0x175ef3[_0xa32f('0x8')],_0x452332),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x175ef3['data5'])===_0xa32f('0x9')&&parseInt(_0x175ef3['data5'])>=0x1&&parseInt(_0x175ef3[_0xa32f('0xa')])<=0xa?parseInt(_0x175ef3[_0xa32f('0xa')])*0x3e8:0x5*0x3e8};try{_0x444fcf[_0xa32f('0xb')]=_0x175ef3[_0xa32f('0xc')]?JSON[_0xa32f('0xd')](Mustache[_0xa32f('0x7')](_0x175ef3[_0xa32f('0xc')],_0x452332)):{};}catch(_0x55a2ef){logger[_0xa32f('0xe')](_0x55a2ef['stack']);}switch(_0x175ef3[_0xa32f('0x5')][_0xa32f('0x6')]()){case _0xa32f('0xf'):case'DELETE':_0x227881=null;_0x444fcf['qs']=_0x452332;break;case'POST':case'PUT':if(_0x175ef3['data7']){try{_0x227881=JSON[_0xa32f('0xd')](Mustache['render'](_0x175ef3[_0xa32f('0x10')],_0x452332));_0x444fcf[_0xa32f('0x11')]=_0x227881;}catch(_0x2d722f){logger[_0xa32f('0xe')](_0x2d722f[_0xa32f('0x12')]);logger[_0xa32f('0xe')](_0xa32f('0x13'));}}else{_0x227881=_0x452332;_0x444fcf[_0xa32f('0x11')]=_0x227881;}break;}logger['info'](util['format'](_0xa32f('0x14'),_0x175ef3[_0xa32f('0x5')],_0x175ef3[_0xa32f('0x8')],JSON[_0xa32f('0x15')](_0x444fcf)));rp(_0x444fcf)[_0xa32f('0x16')](function(_0x4a6b3b){_0x227881=!_[_0xa32f('0x17')](_0x227881)?_0xa32f('0x18')+_0x227881:'';_0x1a0df6=typeof _0x4a6b3b['body']==='object'?JSON[_0xa32f('0x15')](_0x4a6b3b[_0xa32f('0x11')]):_0x4a6b3b[_0xa32f('0x11')];logger['info'](util[_0xa32f('0x19')](_0xa32f('0x1a'),_0x175ef3[_0xa32f('0x5')],_0x175ef3[_0xa32f('0x8')],_0x4a6b3b[_0xa32f('0x1b')],_0x1a0df6));})[_0xa32f('0x1c')](function(_0x37c308){logger[_0xa32f('0xe')](util[_0xa32f('0x19')](_0xa32f('0x1d'),_0x175ef3['data1'],_0x175ef3[_0xa32f('0x8')],_0x37c308['statusCode'],_0x37c308[_0xa32f('0x1e')],_0x37c308['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7105713..48b2447 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 _0x4b16=['message','result','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then','rpc','error'];(function(_0x3959da,_0x502d28){var _0x59988f=function(_0x507564){while(--_0x507564){_0x3959da['push'](_0x3959da['shift']());}};_0x59988f(++_0x502d28);}(_0x4b16,0x10a));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var jayson=require(_0x64b1('0x0'));var BPromise=require(_0x64b1('0x1'));var logger=require(_0x64b1('0x2'))(_0x64b1('0x3'));var client=jayson['client'][_0x64b1('0x4')]({'port':0x2329});client[_0x64b1('0x5')]=function(_0x1eb9eb,_0x43c448){return new BPromise(function(_0x18e76d,_0x1f7793){return client[_0x64b1('0x6')](_0x1eb9eb,_0x43c448)[_0x64b1('0x7')](function(_0x17bc71){logger['debug'](_0x64b1('0x8'),_0x64b1('0x3'),_0x1eb9eb,_0x43c448,_0x17bc71);if(_0x17bc71[_0x64b1('0x9')]){logger[_0x64b1('0x9')](_0x64b1('0x8'),_0x64b1('0x3'),_0x1eb9eb,_0x17bc71[_0x64b1('0x9')][_0x64b1('0xa')],_0x43c448);return _0x1f7793(_0x17bc71['error'][_0x64b1('0xa')]);}else{return _0x18e76d(_0x17bc71[_0x64b1('0xb')]);}})['catch'](function(_0x5baa5a){logger[_0x64b1('0x9')](_0x64b1('0x8'),_0x64b1('0x3'),_0x1eb9eb,_0x5baa5a,_0x43c448);return _0x1f7793(_0x5baa5a);});});};module['exports']=client; \ No newline at end of file +var _0x0bda=['Request','then','debug','rpc','error','message','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x4e90d4,_0x1813a8){var _0x4e5586=function(_0x4d8ec1){while(--_0x4d8ec1){_0x4e90d4['push'](_0x4e90d4['shift']());}};_0x4e5586(++_0x1813a8);}(_0x0bda,0x1e8));var _0xa0bd=function(_0x359225,_0x4e752b){_0x359225=_0x359225-0x0;var _0x5960a9=_0x0bda[_0x359225];return _0x5960a9;};'use strict';var jayson=require(_0xa0bd('0x0'));var BPromise=require(_0xa0bd('0x1'));var logger=require(_0xa0bd('0x2'))(_0xa0bd('0x3'));var client=jayson[_0xa0bd('0x4')][_0xa0bd('0x5')]({'port':0x2329});client[_0xa0bd('0x6')]=function(_0x2ae8d0,_0x4a978b){return new BPromise(function(_0x14dbe4,_0x39212c){return client['request'](_0x2ae8d0,_0x4a978b)[_0xa0bd('0x7')](function(_0x3a6cdc){logger[_0xa0bd('0x8')](_0xa0bd('0x9'),_0xa0bd('0x3'),_0x2ae8d0,_0x4a978b,_0x3a6cdc);if(_0x3a6cdc[_0xa0bd('0xa')]){logger[_0xa0bd('0xa')](_0xa0bd('0x9'),_0xa0bd('0x3'),_0x2ae8d0,_0x3a6cdc[_0xa0bd('0xa')][_0xa0bd('0xb')],_0x4a978b);return _0x39212c(_0x3a6cdc[_0xa0bd('0xa')][_0xa0bd('0xb')]);}else{return _0x14dbe4(_0x3a6cdc['result']);}})['catch'](function(_0x488317){logger[_0xa0bd('0xa')](_0xa0bd('0x9'),_0xa0bd('0x3'),_0x2ae8d0,_0x488317,_0x4a978b);return _0x39212c(_0x488317);});});};module[_0xa0bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 36ff187..7ce4e6d 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 _0xb05a=['./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','getSettings','catch','error','Email\x20service\x20initialization','./server','./lib/email'];(function(_0xb285f6,_0x264cc2){var _0x58db92=function(_0x44381e){while(--_0x44381e){_0xb285f6['push'](_0xb285f6['shift']());}};_0x58db92(++_0x264cc2);}(_0xb05a,0x1e8));var _0xab05=function(_0x275804,_0x1690bb){_0x275804=_0x275804-0x0;var _0x5cf3a4=_0xb05a[_0x275804];return _0x5cf3a4;};'use strict';var server=require(_0xab05('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xab05('0x1'));var mailAccount=require(_0xab05('0x2'));var setting=require(_0xab05('0x3'));var logger=require('../../config/logger')(_0xab05('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xab05('0x5')]()[_0xab05('0x6')](mailAccount[_0xab05('0x7')]())['then'](realtime[_0xab05('0x8')]())['then'](function(){email['refresh'](realtime[_0xab05('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xab05('0x6')](function(){return initRealtime();})[_0xab05('0x6')](function(){return setting[_0xab05('0xa')]();})['then'](function(_0x52cbb7){return setInterval(initRealtime,_0x52cbb7['loginMailFrequency']*0x3e8);})[_0xab05('0xb')](function(_0x32e015){logger[_0xab05('0xc')](_0xab05('0xd'),_0x32e015);});}main(); \ No newline at end of file +var _0xabfa=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization'];(function(_0x2d909d,_0x2e2072){var _0x40cc8d=function(_0x3733e3){while(--_0x3733e3){_0x2d909d['push'](_0x2d909d['shift']());}};_0x40cc8d(++_0x2e2072);}(_0xabfa,0xcc));var _0xaabf=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xabfa[_0x9c2427];return _0x51984f;};'use strict';var server=require('./server');var Realtime=require(_0xaabf('0x0'));var EmailChannel=require(_0xaabf('0x1'));var mailAccount=require(_0xaabf('0x2'));var setting=require(_0xaabf('0x3'));var logger=require(_0xaabf('0x4'))(_0xaabf('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xaabf('0x6')](mailAccount[_0xaabf('0x7')]())[_0xaabf('0x6')](realtime[_0xaabf('0x8')]())[_0xaabf('0x6')](function(){email[_0xaabf('0x9')](realtime[_0xaabf('0xa')]);return realtime;});}function main(){return server[_0xaabf('0xb')](realtime,email)[_0xaabf('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xaabf('0xc')]();})[_0xaabf('0x6')](function(_0x2ad21f){return setInterval(initRealtime,_0x2ad21f[_0xaabf('0xd')]*0x3e8);})[_0xaabf('0xe')](function(_0x7689c1){logger[_0xaabf('0xf')](_0xaabf('0x10'),_0x7689c1);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e8731a5..e130e91 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 _0x52d1=['box','bind','handleImapEmail','handleImapEnd','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','verified','moment','../../../config/environment','../../../config/logger','email','defaults','redis','socket.io-emitter','./smtp','info','mailAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','md5','mailAccount:update','refresh','hasOwnProperty','provider','custom','imapAccounts'];(function(_0x1cb7da,_0x4e5a4f){var _0x9542d9=function(_0x4268e8){while(--_0x4268e8){_0x1cb7da['push'](_0x1cb7da['shift']());}};_0x9542d9(++_0x4e5a4f);}(_0x52d1,0x10b));var _0x152d=function(_0x143a83,_0x21ecb1){_0x143a83=_0x143a83-0x0;var _0x341a5e=_0x52d1[_0x143a83];return _0x341a5e;};'use strict';var _=require('lodash');var moment=require(_0x152d('0x0'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x152d('0x1'));var logger=require(_0x152d('0x2'))(_0x152d('0x3'));config['redis']=_[_0x152d('0x4')](config[_0x152d('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x152d('0x6'))(new Redis(config[_0x152d('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x152d('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x412c4a){logger[_0x152d('0x8')]('start\x20email\x20channel');this[_0x152d('0x9')]=_0x412c4a[_0x152d('0x9')];this['imapAccounts']={};this[_0x152d('0xa')]=new EmailSmtp();}EmailChannel[_0x152d('0xb')][_0x152d('0xc')]=function(_0x5a935a){var _0x11ad53=this['mailAccounts'][_0x5a935a];var _0x4537a8={'id':_0x11ad53['id'],'name':_0x11ad53[_0x152d('0xd')],'key':_0x11ad53['key'],'active':_0x11ad53[_0x152d('0xe')],'Imap':{'status':_0x11ad53[_0x152d('0xf')][_0x152d('0x10')],'messageStatus':_0x11ad53[_0x152d('0xf')][_0x152d('0x11')],'total':_0x11ad53['Imap'][_0x152d('0x12')]}};if(_[_0x152d('0x13')](md5Accounts[_0x5a935a])){md5Accounts[_0x5a935a]={};}var _0x5b43bf=md5(JSON['stringify'](_0x4537a8));if(md5Accounts[_0x5a935a][_0x152d('0x14')]!==_0x5b43bf){md5Accounts[_0x5a935a][_0x152d('0x14')]=_0x5b43bf;io[_0x152d('0xc')](_0x152d('0x15'),_0x4537a8);}};EmailChannel[_0x152d('0xb')][_0x152d('0x16')]=function(_0x2de3fc){for(var _0x214b58 in _0x2de3fc){if(_0x2de3fc[_0x152d('0x17')](_0x214b58)){if(_0x2de3fc[_0x214b58][_0x152d('0xf')]&&_0x2de3fc[_0x214b58][_0x152d('0xe')]){var _0x41dc3a=_0x2de3fc[_0x214b58]['Imap'];if(!_0x41dc3a['service']&&_0x2de3fc[_0x214b58][_0x152d('0x18')]!==_0x152d('0x19'))_0x41dc3a['service']=_0x2de3fc[_0x214b58][_0x152d('0x18')];if(!this[_0x152d('0x1a')][_0x152d('0x17')](_0x41dc3a['id'])){this[_0x152d('0x1a')][_0x41dc3a['id']]=new EmailImap(_0x41dc3a,_0x2de3fc[_0x214b58][_0x152d('0x3')]);this['imapAccounts'][_0x41dc3a['id']]['on'](_0x152d('0x1b'),this['handleImapBox'][_0x152d('0x1c')](this,_0x214b58));this[_0x152d('0x1a')][_0x41dc3a['id']]['on']('email',this[_0x152d('0x1d')][_0x152d('0x1c')](this,_0x214b58));this['imapAccounts'][_0x41dc3a['id']]['on']('end',this[_0x152d('0x1e')][_0x152d('0x1c')](this,_0x214b58));this['imapAccounts'][_0x41dc3a['id']]['on']('error',this['handleImapError'][_0x152d('0x1c')](this,_0x214b58));}}else{if(_['isNil'](this[_0x152d('0x9')][_0x214b58]['Imap'])){this[_0x152d('0x9')][_0x214b58][_0x152d('0xf')]={};}this['mailAccounts'][_0x214b58][_0x152d('0xf')]['status']='disabled';this[_0x152d('0x9')][_0x214b58][_0x152d('0xf')][_0x152d('0x11')]='';this[_0x152d('0xc')](_0x214b58);}}}};EmailChannel[_0x152d('0xb')][_0x152d('0x1f')]=function(_0xd47f46,_0x4d07c4){if(this[_0x152d('0x9')][_0xd47f46]){this[_0x152d('0x9')][_0xd47f46][_0x152d('0xf')][_0x152d('0x10')]=_0x152d('0x20');this[_0x152d('0x9')][_0xd47f46][_0x152d('0xf')][_0x152d('0x11')]=_0x4d07c4['name'];if(_0x4d07c4['messages']){this['mailAccounts'][_0xd47f46][_0x152d('0xf')][_0x152d('0x12')]=_0x4d07c4[_0x152d('0x21')][_0x152d('0x12')];}return this[_0x152d('0xc')](_0xd47f46);}};EmailChannel['prototype']['handleImapEmail']=function(_0x22d3ea,_0x58c6c1){logger[_0x152d('0x8')](_0x152d('0x22'),_0x58c6c1[_0x152d('0x23')],_0x58c6c1[_0x152d('0x24')],_0x58c6c1[_0x152d('0x25')],_0x22d3ea);if(this['mailAccounts'][_0x22d3ea]){return mailAccount[_0x152d('0x26')](_0x22d3ea,_0x58c6c1)['then'](function(_0x1ed411){if(_0x1ed411){logger[_0x152d('0x8')](_0x152d('0x27'));}})[_0x152d('0x28')](function(_0x159031){logger[_0x152d('0x29')](_0x152d('0x2a'),JSON['stringify'](_0x159031));});}};EmailChannel[_0x152d('0xb')][_0x152d('0x1e')]=function(_0x1a5607){if(this['mailAccounts'][_0x1a5607]&&this['mailAccounts'][_0x1a5607][_0x152d('0xf')]){if(this[_0x152d('0x1a')][this[_0x152d('0x9')][_0x1a5607][_0x152d('0xf')]['id']]){delete this[_0x152d('0x1a')][this[_0x152d('0x9')][_0x1a5607][_0x152d('0xf')]['id']];}this['mailAccounts'][_0x1a5607][_0x152d('0xf')][_0x152d('0x2b')]=moment();this[_0x152d('0xc')](_0x1a5607);}};EmailChannel[_0x152d('0xb')]['handleImapError']=function(_0x3ada2b,_0x505862){if(this[_0x152d('0x9')][_0x3ada2b]){this[_0x152d('0x9')][_0x3ada2b][_0x152d('0xf')]['status']=_0x152d('0x29');this[_0x152d('0x9')][_0x3ada2b][_0x152d('0xf')][_0x152d('0x11')]=_0x505862;return this[_0x152d('0xc')](_0x3ada2b);}};EmailChannel['prototype']['sendMail']=function(_0x548ecf,_0x3e9ba0){return this[_0x152d('0xa')][_0x152d('0x2c')](_0x548ecf,_0x3e9ba0);};EmailChannel['prototype'][_0x152d('0x2d')]=function(_0x35b343){var _0x32133b=this;if(this['mailAccounts'][_0x35b343['id']]){if(_[_0x152d('0x13')](this[_0x152d('0x9')][_0x35b343['id']]['Smtp'])){this[_0x152d('0x9')][_0x35b343['id']][_0x152d('0x2e')]={};}this[_0x152d('0x9')][_0x35b343['id']]['Smtp'][_0x152d('0x2b')]=moment();return new BPromise(function(_0x5945df,_0x14e289){return _0x32133b[_0x152d('0xa')][_0x152d('0x2f')](_0x35b343)['then'](function(_0x27e488){_0x32133b['mailAccounts'][_0x35b343['id']]['Smtp'][_0x152d('0x10')]=_0x152d('0x30');_0x32133b[_0x152d('0x9')][_0x35b343['id']]['Smtp'][_0x152d('0x11')]='';_0x32133b[_0x152d('0xc')](_0x35b343['id']);_0x5945df(_0x27e488);})[_0x152d('0x28')](function(_0x1bc002){_0x32133b['mailAccounts'][_0x35b343['id']][_0x152d('0x2e')][_0x152d('0x10')]='error';_0x32133b[_0x152d('0x9')][_0x35b343['id']][_0x152d('0x2e')][_0x152d('0x11')]=_0x1bc002;_0x32133b[_0x152d('0xc')](_0x35b343['id']);_0x14e289(_0x1bc002);});});}return this[_0x152d('0xa')][_0x152d('0x2f')](_0x35b343);};module['exports']=EmailChannel; \ No newline at end of file +var _0xf7a0=['redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','name','active','status','Imap','total','isNil','stringify','emit','mailAccount:update','prototype','refresh','service','custom','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email'];(function(_0x2ace72,_0x814809){var _0x33d102=function(_0x505fd1){while(--_0x505fd1){_0x2ace72['push'](_0x2ace72['shift']());}};_0x33d102(++_0x814809);}(_0xf7a0,0x116));var _0x0f7a=function(_0x107af0,_0x34d7b2){_0x107af0=_0x107af0-0x0;var _0x1b5542=_0xf7a0[_0x107af0];return _0x1b5542;};'use strict';var _=require(_0x0f7a('0x0'));var moment=require(_0x0f7a('0x1'));var BPromise=require('bluebird');var md5=require(_0x0f7a('0x2'));var Redis=require(_0x0f7a('0x3'));var config=require(_0x0f7a('0x4'));var logger=require(_0x0f7a('0x5'))(_0x0f7a('0x6'));config[_0x0f7a('0x7')]=_[_0x0f7a('0x8')](config[_0x0f7a('0x7')],{'host':_0x0f7a('0x9'),'port':0x18eb});var io=require(_0x0f7a('0xa'))(new Redis(config[_0x0f7a('0x7')]));var EmailImap=require(_0x0f7a('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x0f7a('0xc'));var md5Accounts={};function EmailChannel(_0x5a9c95){logger[_0x0f7a('0xd')]('start\x20email\x20channel');this[_0x0f7a('0xe')]=_0x5a9c95['mailAccounts'];this[_0x0f7a('0xf')]={};this[_0x0f7a('0x10')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0xaeda0f){var _0x4e64fa=this[_0x0f7a('0xe')][_0xaeda0f];var _0xc1cd4c={'id':_0x4e64fa['id'],'name':_0x4e64fa[_0x0f7a('0x11')],'key':_0x4e64fa['key'],'active':_0x4e64fa[_0x0f7a('0x12')],'Imap':{'status':_0x4e64fa['Imap'][_0x0f7a('0x13')],'messageStatus':_0x4e64fa['Imap']['messageStatus'],'total':_0x4e64fa[_0x0f7a('0x14')][_0x0f7a('0x15')]}};if(_[_0x0f7a('0x16')](md5Accounts[_0xaeda0f])){md5Accounts[_0xaeda0f]={};}var _0x542fbb=md5(JSON[_0x0f7a('0x17')](_0xc1cd4c));if(md5Accounts[_0xaeda0f]['md5']!==_0x542fbb){md5Accounts[_0xaeda0f][_0x0f7a('0x2')]=_0x542fbb;io[_0x0f7a('0x18')](_0x0f7a('0x19'),_0xc1cd4c);}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x1b')]=function(_0x35b3e5){for(var _0x4e9354 in _0x35b3e5){if(_0x35b3e5['hasOwnProperty'](_0x4e9354)){if(_0x35b3e5[_0x4e9354]['Imap']&&_0x35b3e5[_0x4e9354][_0x0f7a('0x12')]){var _0x1ca68d=_0x35b3e5[_0x4e9354]['Imap'];if(!_0x1ca68d[_0x0f7a('0x1c')]&&_0x35b3e5[_0x4e9354]['provider']!==_0x0f7a('0x1d'))_0x1ca68d[_0x0f7a('0x1c')]=_0x35b3e5[_0x4e9354]['provider'];if(!this['imapAccounts'][_0x0f7a('0x1e')](_0x1ca68d['id'])){this[_0x0f7a('0xf')][_0x1ca68d['id']]=new EmailImap(_0x1ca68d,_0x35b3e5[_0x4e9354]['email']);this[_0x0f7a('0xf')][_0x1ca68d['id']]['on'](_0x0f7a('0x1f'),this[_0x0f7a('0x20')][_0x0f7a('0x21')](this,_0x4e9354));this[_0x0f7a('0xf')][_0x1ca68d['id']]['on'](_0x0f7a('0x6'),this[_0x0f7a('0x22')][_0x0f7a('0x21')](this,_0x4e9354));this[_0x0f7a('0xf')][_0x1ca68d['id']]['on'](_0x0f7a('0x23'),this[_0x0f7a('0x24')][_0x0f7a('0x21')](this,_0x4e9354));this[_0x0f7a('0xf')][_0x1ca68d['id']]['on'](_0x0f7a('0x25'),this[_0x0f7a('0x26')][_0x0f7a('0x21')](this,_0x4e9354));}}else{if(_[_0x0f7a('0x16')](this[_0x0f7a('0xe')][_0x4e9354][_0x0f7a('0x14')])){this[_0x0f7a('0xe')][_0x4e9354][_0x0f7a('0x14')]={};}this[_0x0f7a('0xe')][_0x4e9354][_0x0f7a('0x14')]['status']=_0x0f7a('0x27');this[_0x0f7a('0xe')][_0x4e9354][_0x0f7a('0x14')][_0x0f7a('0x28')]='';this[_0x0f7a('0x18')](_0x4e9354);}}}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x20')]=function(_0x36dfb1,_0x32d4fb){if(this[_0x0f7a('0xe')][_0x36dfb1]){this[_0x0f7a('0xe')][_0x36dfb1][_0x0f7a('0x14')][_0x0f7a('0x13')]=_0x0f7a('0x29');this[_0x0f7a('0xe')][_0x36dfb1][_0x0f7a('0x14')]['messageStatus']=_0x32d4fb['name'];if(_0x32d4fb[_0x0f7a('0x2a')]){this[_0x0f7a('0xe')][_0x36dfb1][_0x0f7a('0x14')][_0x0f7a('0x15')]=_0x32d4fb[_0x0f7a('0x2a')]['total'];}return this[_0x0f7a('0x18')](_0x36dfb1);}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x22')]=function(_0x15d682,_0x205ace){logger[_0x0f7a('0xd')](_0x0f7a('0x2b'),_0x205ace[_0x0f7a('0x2c')],_0x205ace[_0x0f7a('0x2d')],_0x205ace['from'],_0x15d682);if(this[_0x0f7a('0xe')][_0x15d682]){return mailAccount['notify'](_0x15d682,_0x205ace)[_0x0f7a('0x2e')](function(_0x353559){if(_0x353559){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x0f7a('0x2f')](function(_0x40c2c7){logger[_0x0f7a('0x25')](_0x0f7a('0x30'),JSON[_0x0f7a('0x17')](_0x40c2c7));});}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x24')]=function(_0x3203b9){if(this['mailAccounts'][_0x3203b9]&&this['mailAccounts'][_0x3203b9][_0x0f7a('0x14')]){if(this[_0x0f7a('0xf')][this[_0x0f7a('0xe')][_0x3203b9][_0x0f7a('0x14')]['id']]){delete this[_0x0f7a('0xf')][this[_0x0f7a('0xe')][_0x3203b9][_0x0f7a('0x14')]['id']];}this[_0x0f7a('0xe')][_0x3203b9]['Imap'][_0x0f7a('0x31')]=moment();this[_0x0f7a('0x18')](_0x3203b9);}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x26')]=function(_0x503a19,_0x27de23){if(this[_0x0f7a('0xe')][_0x503a19]){this['mailAccounts'][_0x503a19][_0x0f7a('0x14')][_0x0f7a('0x13')]='error';this['mailAccounts'][_0x503a19]['Imap']['messageStatus']=_0x27de23;return this[_0x0f7a('0x18')](_0x503a19);}};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x32')]=function(_0xd730f0,_0x26ea6e){return this[_0x0f7a('0x10')][_0x0f7a('0x33')](_0xd730f0,_0x26ea6e);};EmailChannel[_0x0f7a('0x1a')][_0x0f7a('0x34')]=function(_0x33e339){var _0x5eaf30=this;if(this[_0x0f7a('0xe')][_0x33e339['id']]){if(_['isNil'](this[_0x0f7a('0xe')][_0x33e339['id']][_0x0f7a('0x35')])){this[_0x0f7a('0xe')][_0x33e339['id']][_0x0f7a('0x35')]={};}this['mailAccounts'][_0x33e339['id']][_0x0f7a('0x35')][_0x0f7a('0x31')]=moment();return new BPromise(function(_0x4d7a5f,_0x43fd2a){return _0x5eaf30[_0x0f7a('0x10')]['verify'](_0x33e339)[_0x0f7a('0x2e')](function(_0x16177a){_0x5eaf30['mailAccounts'][_0x33e339['id']][_0x0f7a('0x35')][_0x0f7a('0x13')]=_0x0f7a('0x36');_0x5eaf30[_0x0f7a('0xe')][_0x33e339['id']][_0x0f7a('0x35')][_0x0f7a('0x28')]='';_0x5eaf30[_0x0f7a('0x18')](_0x33e339['id']);_0x4d7a5f(_0x16177a);})[_0x0f7a('0x2f')](function(_0x1126d8){_0x5eaf30['mailAccounts'][_0x33e339['id']][_0x0f7a('0x35')][_0x0f7a('0x13')]=_0x0f7a('0x25');_0x5eaf30[_0x0f7a('0xe')][_0x33e339['id']][_0x0f7a('0x35')][_0x0f7a('0x28')]=_0x1126d8;_0x5eaf30[_0x0f7a('0x18')](_0x33e339['id']);_0x43fd2a(_0x1126d8);});});}return this['smtp'][_0x0f7a('0x37')](_0x33e339);};module[_0x0f7a('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index d2821ff..8d0d86b 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 _0xaf1b=['mailbox','handleOpenBox','emit','box','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','end','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','getAccount','account','once','handleReady','bind','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','xoauth2','CloudProvider','data5','password','authentication','host','port','tls','required','openBox'];(function(_0x53674d,_0x1b7459){var _0x18150e=function(_0x20c136){while(--_0x20c136){_0x53674d['push'](_0x53674d['shift']());}};_0x18150e(++_0x1b7459);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x1da5f9,_0x5bd4b0){_0x1da5f9=_0x1da5f9-0x0;var _0x38167c=_0xaf1b[_0x1da5f9];return _0x38167c;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var Imap=require(_0xbaf1('0x2'));var simpleParser=require(_0xbaf1('0x3'))[_0xbaf1('0x4')];var Iconv=require(_0xbaf1('0x5'))[_0xbaf1('0x6')];var EventEmitter=require(_0xbaf1('0x7'))[_0xbaf1('0x8')];var utils=require(_0xbaf1('0x9'));var logger=require(_0xbaf1('0xa'))(_0xbaf1('0xb'));function EmailImap(_0x7dd657,_0x2f05ad){this['mailbox']=_0xbaf1('0xc');this['account']=this[_0xbaf1('0xd')](_0x7dd657,_0x2f05ad);this['imap']=new Imap(this[_0xbaf1('0xe')]);this[_0xbaf1('0x2')][_0xbaf1('0xf')]('ready',this[_0xbaf1('0x10')][_0xbaf1('0x11')](this));this['imap'][_0xbaf1('0xf')]('end',this[_0xbaf1('0x12')][_0xbaf1('0x11')](this));this[_0xbaf1('0x2')]['on'](_0xbaf1('0x13'),this[_0xbaf1('0x14')][_0xbaf1('0x11')](this));this['imap']['connect']();}util[_0xbaf1('0x15')](EmailImap,EventEmitter);EmailImap[_0xbaf1('0x16')][_0xbaf1('0xd')]=function(_0xb6f7d8,_0x1d94da){var _0x1097d6={'connTimeout':_0xb6f7d8[_0xbaf1('0x17')]?_0xb6f7d8['connTimeout']*0x3e8:0x2710,'authTimeout':_0xb6f7d8[_0xbaf1('0x18')]?_0xb6f7d8[_0xbaf1('0x18')]*0x3e8:0x1388};if(_0xb6f7d8[_0xbaf1('0x19')]){_0x1097d6[_0xbaf1('0x1a')]=_0xb6f7d8[_0xbaf1('0x1a')];_0x1097d6[_0xbaf1('0xb')]=_0x1d94da||_0xb6f7d8[_0xbaf1('0x1a')]||_0xbaf1('0x1b');if(_0xb6f7d8['modernAuthentication']){_0x1097d6[_0xbaf1('0x1c')]=utils['generateXOAuth2Token'](_0xb6f7d8[_0xbaf1('0x1d')][_0xbaf1('0x1e')],_0xb6f7d8[_0xbaf1('0x1a')]);}else{_0x1097d6[_0xbaf1('0x1f')]=_0xb6f7d8['password'];}}else{if(_0xb6f7d8[_0xbaf1('0x20')]){_0x1097d6['user']=_0xb6f7d8[_0xbaf1('0x1a')];_0x1097d6[_0xbaf1('0x1f')]=_0xb6f7d8['password'];}}_0x1097d6[_0xbaf1('0x21')]=_0xb6f7d8[_0xbaf1('0x21')];_0x1097d6[_0xbaf1('0x22')]=_0xb6f7d8[_0xbaf1('0x22')]||0x3e1;if(_0xb6f7d8[_0xbaf1('0x23')]){_0x1097d6[_0xbaf1('0x23')]=!![];}else{_0x1097d6['tls']=![];_0x1097d6['autotls']=_0xbaf1('0x24');}return _0x1097d6;};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x10')]=function(){this['imap'][_0xbaf1('0x25')](this[_0xbaf1('0x26')],![],this[_0xbaf1('0x27')]['bind'](this));};EmailImap[_0xbaf1('0x16')]['handleOpenBox']=function(_0x1e7847,_0x181c9d){if(_0x1e7847){this[_0xbaf1('0x14')](_0x1e7847,!![]);}else{this[_0xbaf1('0x28')](_0xbaf1('0x29'),_0x181c9d);this['readUnseen']();}};EmailImap['prototype'][_0xbaf1('0x2a')]=function(_0xda1d6c){if(_0xda1d6c){this[_0xbaf1('0x14')](_0xda1d6c,!![]);}else{this[_0xbaf1('0x2')]['end']();}};EmailImap[_0xbaf1('0x16')]['readUnseen']=function(){this[_0xbaf1('0x2')][_0xbaf1('0x2b')]([_0xbaf1('0x2c')],this[_0xbaf1('0x2d')][_0xbaf1('0x11')](this));};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x2d')]=function(_0x4db035,_0x108295){if(_0x4db035){this[_0xbaf1('0x14')](_0x4db035,!![]);}else{if(_0x108295[_0xbaf1('0x2e')]){try{var _0x29f528=this[_0xbaf1('0x2')][_0xbaf1('0x2f')](_0x108295,{'bodies':'','markSeen':!![]});_0x29f528['on'](_0xbaf1('0x30'),this[_0xbaf1('0x31')]['bind'](this));_0x29f528[_0xbaf1('0xf')](_0xbaf1('0x13'),this[_0xbaf1('0x32')][_0xbaf1('0x11')](this));_0x29f528['once'](_0xbaf1('0x33'),this['handleFetchEnd'][_0xbaf1('0x11')](this));}catch(_0x582f19){logger[_0xbaf1('0x13')](_0x582f19);}}else{this[_0xbaf1('0x2')][_0xbaf1('0x34')](!![],this[_0xbaf1('0x2a')]['bind'](this));}}};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x31')]=function(_0x40eccd){_0x40eccd['on'](_0xbaf1('0x35'),this[_0xbaf1('0x36')][_0xbaf1('0x11')](this));_0x40eccd[_0xbaf1('0xf')]('attributes',this[_0xbaf1('0x37')][_0xbaf1('0x11')](this));_0x40eccd[_0xbaf1('0xf')](_0xbaf1('0x33'),this[_0xbaf1('0x38')][_0xbaf1('0x11')](this));};EmailImap[_0xbaf1('0x16')]['handleMessageBody']=function(_0xe654f5){simpleParser(_0xe654f5,{'Iconv':Iconv},this['handleSimpleParser'][_0xbaf1('0x11')](this));};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x37')]=function(){};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x38')]=function(){};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x39')]=function(_0x367823,_0x15e27f){if(_0x367823){logger['error'](_0x367823);}else{var _0x4e4fd1=this;utils['parser'](this[_0xbaf1('0xe')],_0x15e27f,function(_0x2e1417){_0x4e4fd1['emit'](_0xbaf1('0xb'),_0x2e1417);});}};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x3a')]=function(){this['imap'][_0xbaf1('0x34')](!![],this[_0xbaf1('0x2a')][_0xbaf1('0x11')](this));};EmailImap['prototype'][_0xbaf1('0x32')]=function(_0x39d196){this['handleError'](_0x39d196);this['imap'][_0xbaf1('0x34')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0xbaf1('0x12')]=function(){this[_0xbaf1('0x28')](_0xbaf1('0x33'));};EmailImap[_0xbaf1('0x16')][_0xbaf1('0x14')]=function(_0x394814,_0x986a3e){logger[_0xbaf1('0x13')]('handleError',this[_0xbaf1('0xe')][_0xbaf1('0xb')],JSON[_0xbaf1('0x3b')](_0x394814));var _0x314ac3='';if(_0x394814){if(_0x394814['textCode']){_0x314ac3=_0x394814[_0xbaf1('0x3c')];}else{for(var _0x51445a in _0x394814){if(_0x394814[_0xbaf1('0x3d')](_0x51445a)){_0x314ac3+=_[_0xbaf1('0x3e')](_0x51445a)+':\x20'+_0x394814[_0x51445a]+'\x0a';}}}}if(_0x986a3e){this[_0xbaf1('0x2')]['end']();}else{this[_0xbaf1('0x28')](_0xbaf1('0x13'),_0x314ac3);this[_0xbaf1('0x28')]('end');}};module[_0xbaf1('0x3f')]=EmailImap; \ No newline at end of file +var _0x83d0=['mailparser','simpleParser','iconv','events','../../../config/logger','email','mailbox','getAccount','account','once','ready','handleReady','bind','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap'];(function(_0x3b75b9,_0x2852d9){var _0x439c26=function(_0x527655){while(--_0x527655){_0x3b75b9['push'](_0x3b75b9['shift']());}};_0x439c26(++_0x2852d9);}(_0x83d0,0xb7));var _0x083d=function(_0xbfb13,_0x451ce1){_0xbfb13=_0xbfb13-0x0;var _0x35ff05=_0x83d0[_0xbfb13];return _0x35ff05;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var Imap=require(_0x083d('0x2'));var simpleParser=require(_0x083d('0x3'))[_0x083d('0x4')];var Iconv=require(_0x083d('0x5'))['Iconv'];var EventEmitter=require(_0x083d('0x6'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x083d('0x7'))(_0x083d('0x8'));function EmailImap(_0x3c4b8c,_0x2e75e8){this[_0x083d('0x9')]='INBOX';this['account']=this[_0x083d('0xa')](_0x3c4b8c,_0x2e75e8);this[_0x083d('0x2')]=new Imap(this[_0x083d('0xb')]);this['imap'][_0x083d('0xc')](_0x083d('0xd'),this[_0x083d('0xe')][_0x083d('0xf')](this));this['imap'][_0x083d('0xc')]('end',this[_0x083d('0x10')][_0x083d('0xf')](this));this['imap']['on'](_0x083d('0x11'),this[_0x083d('0x12')][_0x083d('0xf')](this));this[_0x083d('0x2')][_0x083d('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x083d('0x14')][_0x083d('0xa')]=function(_0x4ee93c,_0x11c03f){var _0x525a36={'connTimeout':_0x4ee93c['connTimeout']?_0x4ee93c[_0x083d('0x15')]*0x3e8:0x2710,'authTimeout':_0x4ee93c[_0x083d('0x16')]?_0x4ee93c[_0x083d('0x16')]*0x3e8:0x1388};if(_0x4ee93c[_0x083d('0x17')]){_0x525a36[_0x083d('0x18')]=_0x4ee93c['user'];_0x525a36[_0x083d('0x8')]=_0x11c03f||_0x4ee93c['user']||_0x083d('0x19');if(_0x4ee93c[_0x083d('0x1a')]){_0x525a36[_0x083d('0x1b')]=utils[_0x083d('0x1c')](_0x4ee93c[_0x083d('0x1d')][_0x083d('0x1e')],_0x4ee93c[_0x083d('0x18')]);}else{_0x525a36[_0x083d('0x1f')]=_0x4ee93c[_0x083d('0x1f')];}}else{if(_0x4ee93c[_0x083d('0x20')]){_0x525a36[_0x083d('0x18')]=_0x4ee93c[_0x083d('0x18')];_0x525a36['password']=_0x4ee93c[_0x083d('0x1f')];}}_0x525a36['host']=_0x4ee93c[_0x083d('0x21')];_0x525a36[_0x083d('0x22')]=_0x4ee93c['port']||0x3e1;if(_0x4ee93c[_0x083d('0x23')]){_0x525a36['tls']=!![];}else{_0x525a36['tls']=![];_0x525a36['autotls']=_0x083d('0x24');}return _0x525a36;};EmailImap[_0x083d('0x14')][_0x083d('0xe')]=function(){this[_0x083d('0x2')][_0x083d('0x25')](this[_0x083d('0x9')],![],this['handleOpenBox'][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleOpenBox']=function(_0x3a0ce2,_0x38ca23){if(_0x3a0ce2){this[_0x083d('0x12')](_0x3a0ce2,!![]);}else{this[_0x083d('0x26')](_0x083d('0x27'),_0x38ca23);this[_0x083d('0x28')]();}};EmailImap[_0x083d('0x14')][_0x083d('0x29')]=function(_0x552bc9){if(_0x552bc9){this[_0x083d('0x12')](_0x552bc9,!![]);}else{this['imap'][_0x083d('0x2a')]();}};EmailImap[_0x083d('0x14')][_0x083d('0x28')]=function(){this[_0x083d('0x2')][_0x083d('0x2b')]([_0x083d('0x2c')],this[_0x083d('0x2d')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')][_0x083d('0x2d')]=function(_0x2d9202,_0x24c32c){if(_0x2d9202){this[_0x083d('0x12')](_0x2d9202,!![]);}else{if(_0x24c32c[_0x083d('0x2e')]){try{var _0x28b90e=this['imap'][_0x083d('0x2f')](_0x24c32c,{'bodies':'','markSeen':!![]});_0x28b90e['on'](_0x083d('0x30'),this['handleFetchMessage']['bind'](this));_0x28b90e[_0x083d('0xc')]('error',this[_0x083d('0x31')]['bind'](this));_0x28b90e[_0x083d('0xc')]('end',this[_0x083d('0x32')][_0x083d('0xf')](this));}catch(_0x3ab8cd){logger['error'](_0x3ab8cd);}}else{this['imap'][_0x083d('0x33')](!![],this['handleCloseBox'][_0x083d('0xf')](this));}}};EmailImap[_0x083d('0x14')][_0x083d('0x34')]=function(_0x3065c7){_0x3065c7['on']('body',this[_0x083d('0x35')][_0x083d('0xf')](this));_0x3065c7[_0x083d('0xc')](_0x083d('0x36'),this['handleMessageAttributes'][_0x083d('0xf')](this));_0x3065c7[_0x083d('0xc')](_0x083d('0x2a'),this[_0x083d('0x37')]['bind'](this));};EmailImap['prototype'][_0x083d('0x35')]=function(_0x7ae2c4){simpleParser(_0x7ae2c4,{'Iconv':Iconv},this[_0x083d('0x38')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleMessageAttributes']=function(){};EmailImap[_0x083d('0x14')][_0x083d('0x37')]=function(){};EmailImap['prototype'][_0x083d('0x38')]=function(_0x5d00dc,_0x58c1a0){if(_0x5d00dc){logger[_0x083d('0x11')](_0x5d00dc);}else{var _0x3645f3=this;utils['parser'](this[_0x083d('0xb')],_0x58c1a0,function(_0x1b282f){_0x3645f3[_0x083d('0x26')]('email',_0x1b282f);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0x083d('0x33')](!![],this[_0x083d('0x29')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')]['handleFetchError']=function(_0x5ad9f2){this[_0x083d('0x12')](_0x5ad9f2);this['imap'][_0x083d('0x33')](!![],this[_0x083d('0x29')][_0x083d('0xf')](this));};EmailImap[_0x083d('0x14')][_0x083d('0x10')]=function(){this[_0x083d('0x26')](_0x083d('0x2a'));};EmailImap[_0x083d('0x14')]['handleError']=function(_0x38de47,_0x3e6604){logger[_0x083d('0x11')](_0x083d('0x12'),this[_0x083d('0xb')][_0x083d('0x8')],JSON[_0x083d('0x39')](_0x38de47));var _0x56fb85='';if(_0x38de47){if(_0x38de47[_0x083d('0x3a')]){_0x56fb85=_0x38de47[_0x083d('0x3a')];}else{for(var _0x5656ea in _0x38de47){if(_0x38de47[_0x083d('0x3b')](_0x5656ea)){_0x56fb85+=_[_0x083d('0x3c')](_0x5656ea)+':\x20'+_0x38de47[_0x5656ea]+'\x0a';}}}}if(_0x3e6604){this[_0x083d('0x2')][_0x083d('0x2a')]();}else{this[_0x083d('0x26')]('error',_0x56fb85);this[_0x083d('0x26')](_0x083d('0x2a'));}};module[_0x083d('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 40df438..ab3f485 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 _0xfa66=['toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile'];(function(_0x545266,_0xb86b32){var _0x224964=function(_0x281246){while(--_0x281246){_0x545266['push'](_0x545266['shift']());}};_0x224964(++_0xb86b32);}(_0xfa66,0x1b2));var _0x6fa6=function(_0x40b381,_0x17fb85){_0x40b381=_0x40b381-0x0;var _0x20068b=_0xfa66[_0x40b381];return _0x20068b;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6fa6('0x0'));function EmailSmtp(){}EmailSmtp[_0x6fa6('0x1')][_0x6fa6('0x2')]=function(_0x5d2d0d,_0x3ce3aa){return new Promise(function(_0x532719,_0x1049c4){var _0x479c21=nodemailer[_0x6fa6('0x3')](_0x5d2d0d);_0x479c21[_0x6fa6('0x4')](_0x6fa6('0x5'),inlineBase64());_0x479c21['sendMail'](_0x3ce3aa,function(_0x36007b,_0x2e0071){if(_0x36007b){_0x1049c4(_0x36007b[_0x6fa6('0x6')]());}else{_0x532719(_0x2e0071);}});});};EmailSmtp[_0x6fa6('0x1')][_0x6fa6('0x7')]=function(_0x130710){return new Promise(function(_0x522aaa,_0x3e691f){var _0x34a419=nodemailer[_0x6fa6('0x3')](_0x130710);_0x34a419[_0x6fa6('0x7')](function(_0xc623de,_0x2d6c69){if(_0xc623de){_0x3e691f(_0xc623de[_0x6fa6('0x6')]());}else{if(_0x2d6c69){_0x522aaa(_0x2d6c69);}else{_0x3e691f(_0x6fa6('0x8'));}}});});};module[_0x6fa6('0x9')]=EmailSmtp; \ No newline at end of file +var _0x593a=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','verify'];(function(_0x9f0185,_0x1313d4){var _0x5a4eeb=function(_0x514c96){while(--_0x514c96){_0x9f0185['push'](_0x9f0185['shift']());}};_0x5a4eeb(++_0x1313d4);}(_0x593a,0xb6));var _0xa593=function(_0x25342b,_0x1b073a){_0x25342b=_0x25342b-0x0;var _0x38121f=_0x593a[_0x25342b];return _0x38121f;};'use strict';var nodemailer=require(_0xa593('0x0'));var inlineBase64=require(_0xa593('0x1'));function EmailSmtp(){}EmailSmtp[_0xa593('0x2')]['send']=function(_0x4d7563,_0x2fe306){return new Promise(function(_0x4b7bdc,_0x10b848){var _0x4f3651=nodemailer['createTransport'](_0x4d7563);_0x4f3651['use']('compile',inlineBase64());_0x4f3651['sendMail'](_0x2fe306,function(_0x320026,_0x52ce51){if(_0x320026){_0x10b848(_0x320026['toString']());}else{_0x4b7bdc(_0x52ce51);}});});};EmailSmtp[_0xa593('0x2')][_0xa593('0x3')]=function(_0x3812df){return new Promise(function(_0x4a33af,_0x50eff2){var _0x43f76e=nodemailer['createTransport'](_0x3812df);_0x43f76e[_0xa593('0x3')](function(_0x27ccf7,_0x18dd62){if(_0x27ccf7){_0x50eff2(_0x27ccf7['toString']());}else{if(_0x18dd62){_0x4a33af(_0x18dd62);}else{_0x50eff2(_0xa593('0x4'));}}});});};module[_0xa593('0x5')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 4104b13..b3fce2e 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 _0x44ff=['filename','attachment-','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','headerLines','isAutoreply','parser','from','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','info','format','parseBuffer','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','head','value','anonymous','generate','@xcally.com','name','address','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x160844[_0xf44f('0x10')](0x0,-0x1)[_0xf44f('0x11')]('\x20'):_0x4698a1[_0xf44f('0xa')];}return _0xf44f('0x12');}function getLastName(_0x5f4d4c){var _0x1bb191=_[_0xf44f('0x5')](_0x5f4d4c[_0xf44f('0x6')]);if(_0x1bb191&&_0x1bb191[_0xf44f('0xa')]){var _0x113216=_0x1bb191[_0xf44f('0xa')][_0xf44f('0xe')](/\s+/);return _0x113216[_0xf44f('0xf')]>0x1?_0x113216[_0xf44f('0x13')]():'';}return'';}function getMails(_0x93dc9e,_0x54917e){var _0x446054='';for(var _0x2c2212=0x0;_0x2c2212<_0x54917e[_0xf44f('0x6')]['length'];_0x2c2212+=0x1){if(_0x54917e[_0xf44f('0x6')][_0x2c2212][_0xf44f('0xb')]!==_0x93dc9e){if(!_[_0xf44f('0x14')](_0x446054)){_0x446054+=',';}_0x446054+=_0x54917e[_0xf44f('0x6')][_0x2c2212][_0xf44f('0xa')]||_0x54917e[_0xf44f('0x6')][_0x2c2212][_0xf44f('0xb')]||'';_0x446054+='\x20<';_0x446054+=_0x54917e['value'][_0x2c2212]['address']?_0x54917e['value'][_0x2c2212][_0xf44f('0xb')]:_0xf44f('0x7')+random[_0xf44f('0x8')](0x6)+_0xf44f('0x9');_0x446054+='>';}}return _0x446054;}function parseEmail(_0x21c653,_0x22dcf5,_0x57ec0c){if(_0x22dcf5[_0xf44f('0x15')]){var _0x355136=/)<[^<]*)*<\/script>/gi;while(_0x355136[_0xf44f('0x16')](_0x22dcf5[_0xf44f('0x15')])){_0x22dcf5[_0xf44f('0x15')]=_0x22dcf5[_0xf44f('0x15')][_0xf44f('0x17')](_0x355136,'');}if(_0x22dcf5[_0xf44f('0x15')][_0xf44f('0x18')](_0xf44f('0x19'))){var _0x319333=[];_0x22dcf5[_0xf44f('0x1a')][_0xf44f('0x1b')](_0x530aae=>{_0x319333[_0xf44f('0x1c')](_0x530aae['filename']);});var _0x13c217=/]+>/g;var _0x5c6e65=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4365ea=_0x22dcf5[_0xf44f('0x15')]['replace'](_0x5c6e65,'_SRC');var _0x2bcd16=_0x4365ea[_0xf44f('0x17')](_0x13c217,_0xf44f('0x1d'));for(let _0x4f41a5=0x0;_0x4f41a5<_0x319333[_0xf44f('0xf')];_0x4f41a5++){var _0x4ebe3a=_0x2bcd16[_0xf44f('0x17')](_0xf44f('0x1d'),_0xf44f('0x1e')+_0x319333[_0x4f41a5]+'\x20]');_0x2bcd16=_0x4ebe3a;}_0x22dcf5['html']=_0x2bcd16;}_0x57ec0c[_0xf44f('0x1f')]=_0x22dcf5[_0xf44f('0x15')];}else{_0x57ec0c[_0xf44f('0x1f')]=_0x22dcf5[_0xf44f('0x20')];}if(_0x57ec0c[_0xf44f('0x1f')]){_0x57ec0c['body']=_0x57ec0c[_0xf44f('0x1f')][_0xf44f('0x17')](/0x0){var _0x5614=[_0xf44f('0x32'),'X-Auto-Response-Suppress:\x20All',_0xf44f('0x33')];for(var _0xb24fca=0x0;_0xb24fca<_0x22dcf5[_0xf44f('0x34')]['length'];_0xb24fca++){var _0x5e164a=_[_0xf44f('0xd')](_0x5614,_0x22dcf5[_0xf44f('0x34')][_0xb24fca]['line']);if(_0x5e164a>=0x0){_0x57ec0c[_0xf44f('0x35')]=!![];}}}return _0x57ec0c;}exports[_0xf44f('0x36')]=function(_0x31d91c,_0x5511a8,_0x360cad){var _0x5c08b1={'from':getAddress(_0x5511a8[_0xf44f('0x37')]),'firstName':getFirstName(_0x5511a8[_0xf44f('0x37')]),'lastName':getLastName(_0x5511a8[_0xf44f('0x37')]),'mapKey':'email','message':{'from':getMails(_0x31d91c[_0xf44f('0x24')],_0x5511a8[_0xf44f('0x37')]),'to':_0x31d91c[_0xf44f('0x24')],'cc':'','subject':_0x5511a8['subject']||'','messageId':_0x5511a8[_0xf44f('0x38')],'inReplyTo':_0x5511a8[_0xf44f('0x39')],'sentAt':moment(_0x5511a8['date'])['format'](_0xf44f('0x3a')),'attach':![],'attachments':[]}};if(!_0x5511a8[_0xf44f('0x15')]&&!_0x5511a8[_0xf44f('0x20')]){var _0x4f4701=_[_0xf44f('0x3b')](_0x5511a8['attachments'],{'contentType':'application/ms-tnef'});if(_0x4f4701[_0xf44f('0xf')]){logger[_0xf44f('0x3c')](util[_0xf44f('0x3d')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x5511a8[_0xf44f('0x38')]));tnef[_0xf44f('0x3e')](_['first'](_0x4f4701)[_0xf44f('0x30')],function(_0x4fe373,_0x500cb2){if(_0x500cb2){_0x5511a8[_0xf44f('0x15')]=_0x500cb2['BodyHTML']||_0xf44f('0x3f');if(_0x500cb2[_0xf44f('0x40')]){for(var _0x12c9de=0x0;_0x12c9de<_0x500cb2[_0xf44f('0x40')][_0xf44f('0xf')];_0x12c9de++){var _0x503217=_0x500cb2[_0xf44f('0x40')][_0x12c9de];_0x5c08b1[_0xf44f('0x22')][_0xf44f('0x1a')][_0xf44f('0x1c')]({'filename':_0x503217['Title'],'content':Buffer[_0xf44f('0x37')](_0x503217[_0xf44f('0x41')])});}}}_0x360cad(parseEmail(_0x31d91c,_0x5511a8,_0x5c08b1));});}else{_0x5511a8[_0xf44f('0x15')]=_0xf44f('0x3f');_0x360cad(parseEmail(_0x31d91c,_0x5511a8,_0x5c08b1));}}else{_0x360cad(parseEmail(_0x31d91c,_0x5511a8,_0x5c08b1));}};exports[_0xf44f('0x42')]=function(_0x45a41e,_0x35a3aa){var _0x4e55ee=[_0xf44f('0x43')+(_0x35a3aa||''),_0xf44f('0x44')+_0x45a41e,'',''];return Buffer[_0xf44f('0x37')](_0x4e55ee[_0xf44f('0x11')](''),_0xf44f('0x45'))[_0xf44f('0x46')](_0xf44f('0x47'));}; \ No newline at end of file +var _0x2b24=['user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','slice','join','length','pop','html','test','\x20[Attachment:\x20','\x20]','body','originTo','isEmpty','message','originCc','includes','bcc','attachments','type','attachment','attachment-','format','%s-%s','now','server/files/attachments/','writeFileSync','push','contentType','headerLines','isAutoreply','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','content','BodyHTML','Attachments','Title','Data','

Empty\x20message

'];(function(_0x4f3dfc,_0x2ee57d){var _0x3523a6=function(_0x347ce8){while(--_0x347ce8){_0x4f3dfc['push'](_0x4f3dfc['shift']());}};_0x3523a6(++_0x2ee57d);}(_0x2b24,0x99));var _0x42b2=function(_0x5daaff,_0x2e20ae){_0x5daaff=_0x5daaff-0x0;var _0x381f23=_0x2b24[_0x5daaff];return _0x381f23;};'use strict';var _=require(_0x42b2('0x0'));var moment=require(_0x42b2('0x1'));var random=require(_0x42b2('0x2'));var fs=require('fs');var path=require(_0x42b2('0x3'));var util=require(_0x42b2('0x4'));var tnef=require(_0x42b2('0x5'));var logger=require(_0x42b2('0x6'))(_0x42b2('0x7'));var config=require(_0x42b2('0x8'));function getAddress(_0x62d196){var _0x224adf=_[_0x42b2('0x9')](_0x62d196['value']);return _0x224adf&&_0x224adf[_0x42b2('0xa')]?_0x224adf['address']:_0x42b2('0xb')+random[_0x42b2('0xc')](0x6)+_0x42b2('0xd');}function getFirstName(_0x3cca72){var _0x3118c5=_['head'](_0x3cca72[_0x42b2('0xe')]);if(_0x3118c5&&_0x3118c5['name']){if(_0x3118c5['name']==_0x3118c5['address']){return _0x3118c5[_0x42b2('0xf')][_0x42b2('0x10')](0x0,_0x3118c5[_0x42b2('0xf')][_0x42b2('0x11')]('@'));}var _0x48d2c2=_0x3118c5[_0x42b2('0xf')][_0x42b2('0x12')](/\s+/);return _0x48d2c2['length']>0x1?_0x48d2c2[_0x42b2('0x13')](0x0,-0x1)[_0x42b2('0x14')]('\x20'):_0x3118c5['name'];}return'Anonymous';}function getLastName(_0x4ae8c5){var _0x4e15a5=_[_0x42b2('0x9')](_0x4ae8c5[_0x42b2('0xe')]);if(_0x4e15a5&&_0x4e15a5['name']){var _0x2842d7=_0x4e15a5[_0x42b2('0xf')][_0x42b2('0x12')](/\s+/);return _0x2842d7[_0x42b2('0x15')]>0x1?_0x2842d7[_0x42b2('0x16')]():'';}return'';}function getMails(_0x4148b8,_0x1a5d49){var _0x18ae5e='';for(var _0x29238c=0x0;_0x29238c<_0x1a5d49['value']['length'];_0x29238c+=0x1){if(_0x1a5d49[_0x42b2('0xe')][_0x29238c]['address']!==_0x4148b8){if(!_['isEmpty'](_0x18ae5e)){_0x18ae5e+=',';}_0x18ae5e+=_0x1a5d49[_0x42b2('0xe')][_0x29238c][_0x42b2('0xf')]||_0x1a5d49[_0x42b2('0xe')][_0x29238c][_0x42b2('0xa')]||'';_0x18ae5e+='\x20<';_0x18ae5e+=_0x1a5d49[_0x42b2('0xe')][_0x29238c]['address']?_0x1a5d49['value'][_0x29238c]['address']:_0x42b2('0xb')+random[_0x42b2('0xc')](0x6)+_0x42b2('0xd');_0x18ae5e+='>';}}return _0x18ae5e;}function parseEmail(_0x2848df,_0x25fc4d,_0x2a2e3f){if(_0x25fc4d[_0x42b2('0x17')]){var _0x1c67bf=/)<[^<]*)*<\/script>/gi;while(_0x1c67bf[_0x42b2('0x18')](_0x25fc4d[_0x42b2('0x17')])){_0x25fc4d[_0x42b2('0x17')]=_0x25fc4d['html']['replace'](_0x1c67bf,'');}if(_0x25fc4d[_0x42b2('0x17')]['includes'](_0x42b2('0x19'))){var _0x400e1b=[];_0x25fc4d['attachments'][_0x42b2('0x1a')](_0x17bcbd=>{_0x400e1b['push'](_0x17bcbd['filename']);});var _0x307e88=/]+>/g;var _0x7eb07e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1bad96=_0x25fc4d[_0x42b2('0x17')]['replace'](_0x7eb07e,_0x42b2('0x1b'));var _0x69d70d=_0x1bad96[_0x42b2('0x1c')](_0x307e88,'_IMG');for(let _0x333d30=0x0;_0x333d30<_0x400e1b[_0x42b2('0x15')];_0x333d30++){var _0x3a31e3=_0x69d70d[_0x42b2('0x1c')](_0x42b2('0x1d'),_0x42b2('0x1e')+_0x400e1b[_0x333d30]+_0x42b2('0x1f'));_0x69d70d=_0x3a31e3;}_0x25fc4d[_0x42b2('0x17')]=_0x69d70d;}_0x2a2e3f['body']=_0x25fc4d['html'];}else{_0x2a2e3f[_0x42b2('0x20')]=_0x25fc4d['textAsHtml'];}if(_0x2a2e3f[_0x42b2('0x20')]){_0x2a2e3f[_0x42b2('0x20')]=_0x2a2e3f[_0x42b2('0x20')]['replace'](/0x0){var _0x335965=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x221074=0x0;_0x221074<_0x25fc4d[_0x42b2('0x32')][_0x42b2('0x15')];_0x221074++){var _0x163101=_[_0x42b2('0x11')](_0x335965,_0x25fc4d['headerLines'][_0x221074]['line']);if(_0x163101>=0x0){_0x2a2e3f[_0x42b2('0x33')]=!![];}}}return _0x2a2e3f;}exports['parser']=function(_0x5e1cea,_0x5899aa,_0x4b0347){var _0x16834c={'from':getAddress(_0x5899aa[_0x42b2('0x34')]),'firstName':getFirstName(_0x5899aa[_0x42b2('0x34')]),'lastName':getLastName(_0x5899aa[_0x42b2('0x34')]),'mapKey':'email','message':{'from':getMails(_0x5e1cea[_0x42b2('0x7')],_0x5899aa[_0x42b2('0x34')]),'to':_0x5e1cea[_0x42b2('0x7')],'cc':'','subject':_0x5899aa[_0x42b2('0x35')]||'','messageId':_0x5899aa[_0x42b2('0x36')],'inReplyTo':_0x5899aa[_0x42b2('0x37')],'sentAt':moment(_0x5899aa[_0x42b2('0x38')])[_0x42b2('0x2b')](_0x42b2('0x39')),'attach':![],'attachments':[]}};if(!_0x5899aa[_0x42b2('0x17')]&&!_0x5899aa[_0x42b2('0x3a')]){var _0x5b2d86=_['filter'](_0x5899aa[_0x42b2('0x27')],{'contentType':_0x42b2('0x3b')});if(_0x5b2d86['length']){logger[_0x42b2('0x3c')](util[_0x42b2('0x2b')](_0x42b2('0x3d'),_0x5899aa[_0x42b2('0x36')]));tnef[_0x42b2('0x3e')](_['first'](_0x5b2d86)[_0x42b2('0x3f')],function(_0x5aa1c0,_0x1ab4c2){if(_0x1ab4c2){_0x5899aa[_0x42b2('0x17')]=_0x1ab4c2[_0x42b2('0x40')]||'

Empty\x20message

';if(_0x1ab4c2['Attachments']){for(var _0x3fb1de=0x0;_0x3fb1de<_0x1ab4c2['Attachments']['length'];_0x3fb1de++){var _0x950024=_0x1ab4c2[_0x42b2('0x41')][_0x3fb1de];_0x16834c[_0x42b2('0x23')][_0x42b2('0x27')]['push']({'filename':_0x950024[_0x42b2('0x42')],'content':Buffer[_0x42b2('0x34')](_0x950024[_0x42b2('0x43')])});}}}_0x4b0347(parseEmail(_0x5e1cea,_0x5899aa,_0x16834c));});}else{_0x5899aa['html']=_0x42b2('0x44');_0x4b0347(parseEmail(_0x5e1cea,_0x5899aa,_0x16834c));}}else{_0x4b0347(parseEmail(_0x5e1cea,_0x5899aa,_0x16834c));}};exports['generateXOAuth2Token']=function(_0x313ba5,_0x305789){var _0x502465=[_0x42b2('0x45')+(_0x305789||''),_0x42b2('0x46')+_0x313ba5,'',''];return Buffer[_0x42b2('0x34')](_0x502465[_0x42b2('0x14')](''),_0x42b2('0x47'))[_0x42b2('0x48')](_0x42b2('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 9c5cac0..8db03ad 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 _0x823c=['lodash','name','Service','SERV','active','Imap','Smtp'];(function(_0x1f73c3,_0xa8af11){var _0x20450e=function(_0x2f30fb){while(--_0x2f30fb){_0x1f73c3['push'](_0x1f73c3['shift']());}};_0x20450e(++_0xa8af11);}(_0x823c,0xfc));var _0xc823=function(_0xae565a,_0x11009b){_0xae565a=_0xae565a-0x0;var _0x30341f=_0x823c[_0xae565a];return _0x30341f;};'use strict';var _=require(_0xc823('0x0'));function MailAccount(_0x341f86){this['id']=_0x341f86['id']||0x0;this[_0xc823('0x1')]=_0x341f86['name']||_0xc823('0x2');this['key']=_0x341f86['key']||_0xc823('0x3');this[_0xc823('0x4')]=_0x341f86[_0xc823('0x4')]||![];this[_0xc823('0x5')]=_0x341f86[_0xc823('0x5')]||[];this[_0xc823('0x6')]=_0x341f86['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x76a3=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x41ae45,_0x5d06e5){var _0x306429=function(_0x4d09a6){while(--_0x4d09a6){_0x41ae45['push'](_0x41ae45['shift']());}};_0x306429(++_0x5d06e5);}(_0x76a3,0x9a));var _0x376a=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x76a3[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x376a('0x0'));function MailAccount(_0x5e54ec){this['id']=_0x5e54ec['id']||0x0;this['name']=_0x5e54ec[_0x376a('0x1')]||_0x376a('0x2');this[_0x376a('0x3')]=_0x5e54ec['key']||_0x376a('0x4');this[_0x376a('0x5')]=_0x5e54ec[_0x376a('0x5')]||![];this[_0x376a('0x6')]=_0x5e54ec[_0x376a('0x6')]||[];this[_0x376a('0x7')]=_0x5e54ec[_0x376a('0x7')]||[];}module[_0x376a('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d5dc45d..0b84ddc 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 _0x928e=['mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x91ec40,_0xa1ec3b){var _0x428c7a=function(_0x196f25){while(--_0x196f25){_0x91ec40['push'](_0x91ec40['shift']());}};_0x428c7a(++_0xa1ec3b);}(_0x928e,0x9e));var _0xe928=function(_0x55f26a,_0x5d48cf){_0x55f26a=_0x55f26a-0x0;var _0x2595a6=_0x928e[_0x55f26a];return _0x2595a6;};'use strict';var _=require(_0xe928('0x0'));var MailAccount=require(_0xe928('0x1'));var Realtime=function(){this[_0xe928('0x2')]={};};function freeIsNotKey(_0x2be6b4,_0x4fc805,_0x216a9e){var _0x402c56=_[_0xe928('0x3')](_0x2be6b4,function(_0x2741fa,_0x1c11cd){return _0x2741fa[_0x216a9e];});for(var _0x16ccd3 in _0x4fc805){if(_0x4fc805[_0xe928('0x4')](_0x16ccd3)){if(!_0x402c56[_0x16ccd3]){delete _0x4fc805[_0x16ccd3];}}}}Realtime['prototype'][_0xe928('0x5')]=function(_0x2d4763,_0x28dd29){for(var _0x8eb29 in _0x28dd29){if(_0x2d4763['hasOwnProperty'](_0x8eb29)){_0x2d4763[_0x8eb29]=_0x28dd29[_0x8eb29];}}};Realtime[_0xe928('0x6')][_0xe928('0x7')]=function(){var _0x1f6f91=this;return function(_0x48833f){if(_0x48833f){freeIsNotKey(_0x48833f,_0x1f6f91['mailAccounts'],'id');for(var _0x181db2=0x0,_0x29abfa={},_0x5473c9={};_0x181db2<_0x48833f['length'];_0x181db2+=0x1){_0x29abfa=_0x48833f[_0x181db2];if(_[_0xe928('0x8')](_0x1f6f91[_0xe928('0x2')][_0x29abfa['id']])){_0x1f6f91[_0xe928('0x2')][_0x29abfa['id']]=new MailAccount(_0x29abfa);}else{_[_0xe928('0x9')](_0x1f6f91[_0xe928('0x2')][_0x29abfa['id']],_0x29abfa);}}}return _0x1f6f91[_0xe928('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0x6390=['mergeFromDatabase','initMailAccounts','length','merge','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x40f9e9,_0xa9ace5){var _0x2df11b=function(_0x177e2b){while(--_0x177e2b){_0x40f9e9['push'](_0x40f9e9['shift']());}};_0x2df11b(++_0xa9ace5);}(_0x6390,0xa5));var _0x0639=function(_0x2001c4,_0x3f71a5){_0x2001c4=_0x2001c4-0x0;var _0x214c91=_0x6390[_0x2001c4];return _0x214c91;};'use strict';var _=require(_0x0639('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x0639('0x1')]={};};function freeIsNotKey(_0x2b45b6,_0x33446d,_0x5ab365){var _0x4006e1=_[_0x0639('0x2')](_0x2b45b6,function(_0x2184e5,_0x2b1db0){return _0x2184e5[_0x5ab365];});for(var _0x37fe8f in _0x33446d){if(_0x33446d[_0x0639('0x3')](_0x37fe8f)){if(!_0x4006e1[_0x37fe8f]){delete _0x33446d[_0x37fe8f];}}}}Realtime[_0x0639('0x4')][_0x0639('0x5')]=function(_0x335942,_0x2a16f1){for(var _0x123618 in _0x2a16f1){if(_0x335942['hasOwnProperty'](_0x123618)){_0x335942[_0x123618]=_0x2a16f1[_0x123618];}}};Realtime['prototype'][_0x0639('0x6')]=function(){var _0x29eade=this;return function(_0x39f507){if(_0x39f507){freeIsNotKey(_0x39f507,_0x29eade[_0x0639('0x1')],'id');for(var _0x4f3e6a=0x0,_0x10b197={},_0x565681={};_0x4f3e6a<_0x39f507[_0x0639('0x7')];_0x4f3e6a+=0x1){_0x10b197=_0x39f507[_0x4f3e6a];if(_['isUndefined'](_0x29eade[_0x0639('0x1')][_0x10b197['id']])){_0x29eade[_0x0639('0x1')][_0x10b197['id']]=new MailAccount(_0x10b197);}else{_[_0x0639('0x8')](_0x29eade[_0x0639('0x1')][_0x10b197['id']],_0x10b197);}}}return _0x29eade[_0x0639('0x1')];};};module[_0x0639('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 6b13938..814d561 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 _0x8b8e=['MailServerIn','Imap','CloudProvider','service','data5','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','Request','name','email','active','key','ListId','TemplateId'];(function(_0xe5c04e,_0x28b502){var _0x40a21a=function(_0x31154f){while(--_0x31154f){_0xe5c04e['push'](_0xe5c04e['shift']());}};_0x40a21a(++_0x28b502);}(_0x8b8e,0x108));var _0xe8b8=function(_0x3471cc,_0x31ca36){_0x3471cc=_0x3471cc-0x0;var _0x3201cf=_0x8b8e[_0x3471cc];return _0x3201cf;};'use strict';var client=require(_0xe8b8('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xe8b8('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0xe8b8('0x2'),'provider','service',_0xe8b8('0x3'),_0xe8b8('0x4'),_0xe8b8('0x5'),_0xe8b8('0x6'),_0xe8b8('0x7')],'raw':![],'include':[{'model':_0xe8b8('0x8'),'as':_0xe8b8('0x9'),'include':[{'model':_0xe8b8('0xa'),'attributes':['id',_0xe8b8('0x2'),_0xe8b8('0xb'),'type',_0xe8b8('0xc')],'as':'CloudProvider'}]},{'model':_0xe8b8('0xd'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0xe8b8('0x2'),_0xe8b8('0xb'),'type','data5'],'as':_0xe8b8('0xa')}]}]},'log':_0xe8b8('0xe')});};};exports[_0xe8b8('0xf')]=function(_0x4704c4,_0xf5b5b1){return client[_0xe8b8('0x1')](_0xe8b8('0x10'),{'account':{'id':_0x4704c4},'body':_0xf5b5b1,'log':_0xe8b8('0x10')});}; \ No newline at end of file +var _0x7eff=['provider','service','email','active','TemplateId','MailServerIn','Imap','CloudProvider','name','type','data5','MailServerOut','Smtp','getMailAccount','getMailAccounts','Request','GetMailAccount'];(function(_0x1537fa,_0x12fbf3){var _0x4b60aa=function(_0x480937){while(--_0x480937){_0x1537fa['push'](_0x1537fa['shift']());}};_0x4b60aa(++_0x12fbf3);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf7ef('0x0')]=function(){return function(){return client[_0xf7ef('0x1')](_0xf7ef('0x2'),{'options':{'attributes':['id','name',_0xf7ef('0x3'),_0xf7ef('0x4'),_0xf7ef('0x5'),_0xf7ef('0x6'),'key','ListId',_0xf7ef('0x7')],'raw':![],'include':[{'model':_0xf7ef('0x8'),'as':_0xf7ef('0x9'),'include':[{'model':_0xf7ef('0xa'),'attributes':['id',_0xf7ef('0xb'),_0xf7ef('0x4'),_0xf7ef('0xc'),_0xf7ef('0xd')],'as':'CloudProvider'}]},{'model':_0xf7ef('0xe'),'as':_0xf7ef('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0xf7ef('0xb'),'service','type',_0xf7ef('0xd')],'as':'CloudProvider'}]}]},'log':_0xf7ef('0x10')});};};exports['notify']=function(_0x5dfa60,_0x4ed444){return client[_0xf7ef('0x1')]('NotifyMailAccount',{'account':{'id':_0x5dfa60},'body':_0x4ed444,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 44c8343..ae8c327 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 _0x841c=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0xd5508d,_0x58840b){var _0x1f8dbb=function(_0x24c246){while(--_0x24c246){_0xd5508d['push'](_0xd5508d['shift']());}};_0x1f8dbb(++_0x58840b);}(_0x841c,0x174));var _0xc841=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x841c[_0x1589dd];return _0x1bddd1;};'use strict';var client=require(_0xc841('0x0'));exports['getSettings']=function(){return client[_0xc841('0x1')](_0xc841('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc841('0x3')]},'log':_0xc841('0x4')});}; \ No newline at end of file +var _0x8ff1=['loginMailFrequency','GetSettings','getSettings','Request','ShowSetting'];(function(_0x36074a,_0x5f4e91){var _0x3b1fbf=function(_0x375fdf){while(--_0x375fdf){_0x36074a['push'](_0x36074a['shift']());}};_0x3b1fbf(++_0x5f4e91);}(_0x8ff1,0x1ce));var _0x18ff=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8ff1[_0x263a74];return _0x2aa86c;};'use strict';var client=require('../client');exports[_0x18ff('0x0')]=function(){return client[_0x18ff('0x1')](_0x18ff('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x18ff('0x3')]},'log':_0x18ff('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 93b16f4..522a08a 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 67d7e89..34baebb 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 _0x8315=['exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','port','socket.io','redis','adapter','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x5f2b5c,_0x23d33e){var _0x3bebb0=function(_0x56b702){while(--_0x56b702){_0x5f2b5c['push'](_0x5f2b5c['shift']());}};_0x3bebb0(++_0x23d33e);}(_0x8315,0xd2));var _0x5831=function(_0x2014f7,_0x1a7d68){_0x2014f7=_0x2014f7-0x0;var _0x22c045=_0x8315[_0x2014f7];return _0x22c045;};'use strict';var _=require(_0x5831('0x0'));var http=require(_0x5831('0x1'));var express=require(_0x5831('0x2'));var sticky=require('sticky-session');var Redis=require(_0x5831('0x3'));var config=require(_0x5831('0x4'));var app=express();var server=http[_0x5831('0x5')](app);server[_0x5831('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x5831('0x7')])){var socketio=require(_0x5831('0x8'))(server,{'transports':['websocket','polling']});config[_0x5831('0x9')]=_['defaults'](config[_0x5831('0x9')],{'host':'localhost','port':0x18eb});socketio[_0x5831('0xa')](require('socket.io-redis')({'pubClient':new Redis(config[_0x5831('0x9')]),'subClient':new Redis(config[_0x5831('0x9')])}));require('../../config/triggers')['default']();require(_0x5831('0xb'))[_0x5831('0xc')](socketio);require(_0x5831('0xd'))[_0x5831('0xc')](app);require(_0x5831('0xe'))[_0x5831('0xc')](app);}else{server[_0x5831('0xf')]('listening',function(){console[_0x5831('0x10')](_0x5831('0x11'),config['port']);});}exports=module[_0x5831('0x12')]=app; \ No newline at end of file +var _0xb8e5=['sticky-session','ioredis','../../config/environment','timeout','port','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express'];(function(_0x129fac,_0x1f2b47){var _0x30574e=function(_0x3e8fff){while(--_0x3e8fff){_0x129fac['push'](_0x129fac['shift']());}};_0x30574e(++_0x1f2b47);}(_0xb8e5,0x75));var _0x5b8e=function(_0x2202c3,_0x4bc85f){_0x2202c3=_0x2202c3-0x0;var _0x332086=_0xb8e5[_0x2202c3];return _0x332086;};'use strict';var _=require(_0x5b8e('0x0'));var http=require(_0x5b8e('0x1'));var express=require(_0x5b8e('0x2'));var sticky=require(_0x5b8e('0x3'));var Redis=require(_0x5b8e('0x4'));var config=require(_0x5b8e('0x5'));var app=express();var server=http['createServer'](app);server[_0x5b8e('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x5b8e('0x7')])){var socketio=require(_0x5b8e('0x8'))(server,{'transports':[_0x5b8e('0x9'),_0x5b8e('0xa')]});config[_0x5b8e('0xb')]=_[_0x5b8e('0xc')](config[_0x5b8e('0xb')],{'host':_0x5b8e('0xd'),'port':0x18eb});socketio['adapter'](require(_0x5b8e('0xe'))({'pubClient':new Redis(config[_0x5b8e('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x5b8e('0xf'))[_0x5b8e('0x10')]();require(_0x5b8e('0x11'))['default'](socketio);require(_0x5b8e('0x12'))[_0x5b8e('0x10')](app);require(_0x5b8e('0x13'))['default'](app);}else{server[_0x5b8e('0x14')](_0x5b8e('0x15'),function(){console[_0x5b8e('0x16')](_0x5b8e('0x17'),config['port']);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 06de0fc..a2f2e2c 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 _0x3fb9=['message','result','jayson/promise','bluebird','routing','Request','request','debug','rpc','error'];(function(_0x18ae6d,_0x255d00){var _0x3deb94=function(_0x44b04c){while(--_0x44b04c){_0x18ae6d['push'](_0x18ae6d['shift']());}};_0x3deb94(++_0x255d00);}(_0x3fb9,0x11a));var _0x93fb=function(_0x1fbe9b,_0x1c51e1){_0x1fbe9b=_0x1fbe9b-0x0;var _0x658248=_0x3fb9[_0x1fbe9b];return _0x658248;};'use strict';var jayson=require(_0x93fb('0x0'));var BPromise=require(_0x93fb('0x1'));var logger=require('../../config/logger')(_0x93fb('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x93fb('0x3')]=function(_0x149565,_0x208f4f){return new BPromise(function(_0x5565f7,_0x568a7a){return client[_0x93fb('0x4')](_0x149565,_0x208f4f)['then'](function(_0x167748){logger[_0x93fb('0x5')](_0x93fb('0x6'),_0x93fb('0x2'),_0x149565,_0x208f4f,_0x167748);if(_0x167748['error']){logger['error'](_0x93fb('0x6'),_0x93fb('0x2'),_0x149565,_0x167748[_0x93fb('0x7')][_0x93fb('0x8')],_0x208f4f);return _0x568a7a(_0x167748[_0x93fb('0x7')][_0x93fb('0x8')]);}else{return _0x5565f7(_0x167748[_0x93fb('0x9')]);}})['catch'](function(_0x41179f){logger[_0x93fb('0x7')](_0x93fb('0x6'),'routing',_0x149565,_0x41179f,_0x208f4f);return _0x568a7a(_0x41179f);});});};module['exports']=client; \ No newline at end of file +var _0x9e1e=['debug','rpc','error','message','result','exports','bluebird','../../config/logger','routing','http','Request','request'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0x9e1e,0x1b6));var _0xe9e1=function(_0x35a470,_0x1820a1){_0x35a470=_0x35a470-0x0;var _0x7349ff=_0x9e1e[_0x35a470];return _0x7349ff;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9e1('0x0'));var logger=require(_0xe9e1('0x1'))(_0xe9e1('0x2'));var client=jayson['client'][_0xe9e1('0x3')]({'port':0x2329});client[_0xe9e1('0x4')]=function(_0x186b07,_0x33e7c6){return new BPromise(function(_0x5d6858,_0x531f08){return client[_0xe9e1('0x5')](_0x186b07,_0x33e7c6)['then'](function(_0xd76a03){logger[_0xe9e1('0x6')](_0xe9e1('0x7'),_0xe9e1('0x2'),_0x186b07,_0x33e7c6,_0xd76a03);if(_0xd76a03[_0xe9e1('0x8')]){logger[_0xe9e1('0x8')](_0xe9e1('0x7'),'routing',_0x186b07,_0xd76a03[_0xe9e1('0x8')][_0xe9e1('0x9')],_0x33e7c6);return _0x531f08(_0xd76a03['error'][_0xe9e1('0x9')]);}else{return _0x5d6858(_0xd76a03[_0xe9e1('0xa')]);}})['catch'](function(_0x298af6){logger['error'](_0xe9e1('0x7'),'routing',_0x186b07,_0x298af6,_0x33e7c6);return _0x531f08(_0x298af6);});});};module[_0xe9e1('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 824680b..59c1009 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 _0x51f4=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0x51f4,0x199));var _0x451f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51f4[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x451f('0x0'));var server=require('./server');var Realtime=require(_0x451f('0x1'));var user=require(_0x451f('0x2'));var interval=require(_0x451f('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x451f('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x451f('0x5'));var whatsappQueue=require(_0x451f('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x451f('0x7')]()[_0x451f('0x8')](user[_0x451f('0x9')]())[_0x451f('0x8')](realtime[_0x451f('0xa')]())[_0x451f('0x8')](interval['getIntervals']())[_0x451f('0x8')](realtime[_0x451f('0xb')]())[_0x451f('0x8')](openchannelQueue[_0x451f('0xc')]())[_0x451f('0x8')](realtime['initOpenchannelQueues']())[_0x451f('0x8')](chatQueue[_0x451f('0xd')]())[_0x451f('0x8')](realtime[_0x451f('0xe')]())[_0x451f('0x8')](smsQueue[_0x451f('0xf')]())[_0x451f('0x8')](realtime[_0x451f('0x10')]())[_0x451f('0x8')](mailQueue[_0x451f('0x11')]())['then'](realtime[_0x451f('0x12')]())[_0x451f('0x8')](faxQueue[_0x451f('0x13')]())[_0x451f('0x8')](realtime[_0x451f('0x14')]())[_0x451f('0x8')](whatsappQueue[_0x451f('0x15')]())['then'](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x451f('0x16')](realtime)[_0x451f('0x8')](function(_0x4a3cfb){return initRealtime();})[_0x451f('0x8')](function(_0x10fdb0){return setInterval(initRealtime,0x1388);})[_0x451f('0x17')](function(_0x252bbc){console[_0x451f('0x18')](_0x252bbc);});}main(); \ No newline at end of file +var _0xf402=['initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initSmsQueues','getMailQueues'];(function(_0x324ac2,_0x8f2529){var _0x4739fd=function(_0x3687fb){while(--_0x3687fb){_0x324ac2['push'](_0x324ac2['shift']());}};_0x4739fd(++_0x8f2529);}(_0xf402,0x191));var _0x2f40=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf402[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x2f40('0x0'));var server=require(_0x2f40('0x1'));var Realtime=require('./realtime');var user=require(_0x2f40('0x2'));var interval=require(_0x2f40('0x3'));var openchannelQueue=require(_0x2f40('0x4'));var chatQueue=require(_0x2f40('0x5'));var smsQueue=require(_0x2f40('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x2f40('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x2f40('0x8')]()['then'](user['getAgents']())[_0x2f40('0x9')](realtime[_0x2f40('0xa')]())['then'](interval[_0x2f40('0xb')]())[_0x2f40('0x9')](realtime[_0x2f40('0xc')]())[_0x2f40('0x9')](openchannelQueue[_0x2f40('0xd')]())[_0x2f40('0x9')](realtime[_0x2f40('0xe')]())[_0x2f40('0x9')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())[_0x2f40('0x9')](smsQueue['getSmsQueues']())[_0x2f40('0x9')](realtime[_0x2f40('0xf')]())[_0x2f40('0x9')](mailQueue[_0x2f40('0x10')]())[_0x2f40('0x9')](realtime[_0x2f40('0x11')]())[_0x2f40('0x9')](faxQueue['getFaxQueues']())[_0x2f40('0x9')](realtime['initFaxQueues']())[_0x2f40('0x9')](whatsappQueue[_0x2f40('0x12')]())[_0x2f40('0x9')](realtime[_0x2f40('0x13')]())[_0x2f40('0x9')](function(){return realtime;});}function main(){return server[_0x2f40('0x14')](realtime)[_0x2f40('0x9')](function(_0x31ee78){return initRealtime();})[_0x2f40('0x9')](function(_0x58fbe7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x55f60b){console[_0x2f40('0x15')](_0x55f60b);});}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 d391300..a0cb775 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x2d284c,_0x59aa64){var _0x4f5756=function(_0x2f110e){while(--_0x2f110e){_0x2d284c['push'](_0x2d284c['shift']());}};_0x4f5756(++_0x59aa64);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x5fc3[_0x35485a];return _0x5148e6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x1261[_0x4653f7];return _0x5454da;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 909dcac..9b166fa 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 _0x9b73=['result','catch','sendMailMessage','SendMail','bluebird','client','request','then','error','message'];(function(_0x3f2d13,_0x4610f4){var _0x4a7eda=function(_0x1c0a7c){while(--_0x1c0a7c){_0x3f2d13['push'](_0x3f2d13['shift']());}};_0x4a7eda(++_0x4610f4);}(_0x9b73,0x162));var _0x39b7=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x9b73[_0x5bd426];return _0x23a7eb;};'use strict';var BPromise=require(_0x39b7('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x39b7('0x1')]['http']({'port':0x232b});function request(_0x2e6548,_0x1f1fd8){return new BPromise(function(_0x1899fe,_0x47d9fb){return client[_0x39b7('0x2')](_0x2e6548,_0x1f1fd8)[_0x39b7('0x3')](function(_0x504dc0){if(_0x504dc0[_0x39b7('0x4')]){return _0x47d9fb(_0x504dc0[_0x39b7('0x4')][_0x39b7('0x5')]);}else{return _0x1899fe(_0x504dc0[_0x39b7('0x6')]);}})[_0x39b7('0x7')](function(_0xaf6b4b){return _0x47d9fb(_0xaf6b4b);});});}exports[_0x39b7('0x8')]=function(_0x34f04a,_0x40457d){return request(_0x39b7('0x9'),{'account':_0x34f04a,'message':_0x40457d});}; \ No newline at end of file +var _0x200a=['error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x200a,0x118));var _0xa200=function(_0x3b6652,_0x32486d){_0x3b6652=_0x3b6652-0x0;var _0x14d39f=_0x200a[_0x3b6652];return _0x14d39f;};'use strict';var BPromise=require(_0xa200('0x0'));var jayson=require(_0xa200('0x1'));var client=jayson[_0xa200('0x2')][_0xa200('0x3')]({'port':0x232b});function request(_0x4272dc,_0x5987e5){return new BPromise(function(_0x589fcf,_0x58e7fb){return client[_0xa200('0x4')](_0x4272dc,_0x5987e5)[_0xa200('0x5')](function(_0x19ebc3){if(_0x19ebc3[_0xa200('0x6')]){return _0x58e7fb(_0x19ebc3[_0xa200('0x6')][_0xa200('0x7')]);}else{return _0x589fcf(_0x19ebc3[_0xa200('0x8')]);}})[_0xa200('0x9')](function(_0x134949){return _0x58e7fb(_0x134949);});});}exports[_0xa200('0xa')]=function(_0x1d32c5,_0x205c7b){return request('SendMail',{'account':_0x1d32c5,'message':_0x205c7b});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 07367d1..1f758db 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 _0x3dd3=['faxPause','smsPause','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','chatStatus','chatStatusTime','faxStatus','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','openchannelStatus','busy','busyQueue','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x3dd3,0x1d2));var _0x33dd=function(_0x26d0e4,_0x1d6691){_0x26d0e4=_0x26d0e4-0x0;var _0x316aa4=_0x3dd3[_0x26d0e4];return _0x316aa4;};'use strict';var _=require(_0x33dd('0x0'));var moment=require(_0x33dd('0x1'));var md5=require(_0x33dd('0x2'));var Redis=require(_0x33dd('0x3'));var config=require(_0x33dd('0x4'));config[_0x33dd('0x5')]=_[_0x33dd('0x6')](config[_0x33dd('0x5')],{'host':_0x33dd('0x7'),'port':0x18eb});var io=require(_0x33dd('0x8'))(new Redis(config[_0x33dd('0x5')]));function Agent(_0x18d946){this['id']=_0x18d946['id']||0x0;this[_0x33dd('0x9')]=_0x18d946['name']||'';this[_0x33dd('0xa')]=_0x18d946[_0x33dd('0xa')]||!![];this[_0x33dd('0xb')]=_0x18d946[_0x33dd('0xb')]||![];this[_0x33dd('0xc')]=_0x18d946[_0x33dd('0xc')]||![];this[_0x33dd('0xd')]=_0x18d946[_0x33dd('0xd')]||![];this[_0x33dd('0xe')]=_0x18d946[_0x33dd('0xe')]||![];this[_0x33dd('0xf')]=_0x18d946[_0x33dd('0xf')]||![];this['openchannelPause']=_0x18d946['openchannelPause']||![];this['chatStatus']=_0x33dd('0x10');this['chatStatusTime']=0x0;this[_0x33dd('0x11')]=_0x18d946['chatCapacity']||0x0;this[_0x33dd('0x12')]=0x0;this[_0x33dd('0x13')]=_0x33dd('0x10');this[_0x33dd('0x14')]=0x0;this[_0x33dd('0x15')]=_0x18d946[_0x33dd('0x15')]||0x0;this[_0x33dd('0x16')]=0x0;this['faxStatus']='unknown';this[_0x33dd('0x17')]=0x0;this['faxCapacity']=_0x18d946[_0x33dd('0x18')]||0x0;this[_0x33dd('0x19')]=0x0;this['smsStatus']=_0x33dd('0x10');this['smsStatusTime']=0x0;this[_0x33dd('0x1a')]=_0x18d946['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x33dd('0x1b')]=_0x33dd('0x10');this['whatsappStatusTime']=0x0;this[_0x33dd('0x1c')]=_0x18d946[_0x33dd('0x1c')]||0x0;this[_0x33dd('0x1d')]=0x0;this['openchannelStatus']=_0x33dd('0x10');this[_0x33dd('0x1e')]=0x0;this['openchannelCapacity']=_0x18d946[_0x33dd('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x33dd('0x2')]='';this[_0x33dd('0x20')]();}Agent[_0x33dd('0x21')]['getChannelStatus']=function(_0x4c6675){if(this[_0x4c6675+_0x33dd('0x22')]>0x0){if(this[_0x4c6675+_0x33dd('0x23')]>0x0&&this[_0x4c6675+_0x33dd('0x22')]>=this[_0x4c6675+_0x33dd('0x23')]){return _0x33dd('0x24');}else{return _0x33dd('0x25');}}else{return _0x33dd('0x26');}};Agent[_0x33dd('0x21')][_0x33dd('0x20')]=function(){var _0x1779ab=[_0x33dd('0x27'),_0x33dd('0x28'),'openchannel',_0x33dd('0x29'),_0x33dd('0x2a'),_0x33dd('0x2b')];for(var _0x531ae2=0x0;_0x531ae2<_0x1779ab[_0x33dd('0x2c')];_0x531ae2+=0x1){var _0x3c4880=this[_0x33dd('0x2d')](_0x1779ab[_0x531ae2]);if(this[_0x1779ab[_0x531ae2]+_0x33dd('0x2e')]!==_0x3c4880){this[_0x1779ab[_0x531ae2]+_0x33dd('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0x1779ab[_0x531ae2]+_0x33dd('0x2e')]=_0x3c4880;}var _0x23dfd2={'id':this['id'],'name':this[_0x33dd('0x9')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x33dd('0xc')],'mailPause':this[_0x33dd('0xd')],'smsPause':this[_0x33dd('0xf')],'faxPause':this[_0x33dd('0xe')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x33dd('0x30')],'chatStatusTime':this[_0x33dd('0x31')],'chatCapacity':this[_0x33dd('0x11')],'chatCurrentCapacity':this[_0x33dd('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x33dd('0x14')],'mailCapacity':this[_0x33dd('0x15')],'mailCurrentCapacity':this[_0x33dd('0x16')],'faxStatus':this[_0x33dd('0x32')],'faxStatusTime':this[_0x33dd('0x17')],'faxCapacity':this[_0x33dd('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x33dd('0x33')],'smsStatusTime':this[_0x33dd('0x34')],'smsCapacity':this[_0x33dd('0x1a')],'smsCurrentCapacity':this[_0x33dd('0x35')],'whatsappStatus':this[_0x33dd('0x1b')],'whatsappStatusTime':this[_0x33dd('0x36')],'whatsappCapacity':this[_0x33dd('0x1c')],'whatsappCurrentCapacity':this[_0x33dd('0x1d')],'openchannelStatus':this[_0x33dd('0x37')],'openchannelStatusTime':this[_0x33dd('0x1e')],'openchannelCapacity':this[_0x33dd('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x33dd('0x38')],'busyQueue':this[_0x33dd('0x39')]};var _0x5590dc=md5(JSON['stringify'](_0x23dfd2));if(this[_0x33dd('0x2')]!==_0x5590dc){this[_0x33dd('0x2')]=_0x5590dc;io['emit'](_0x33dd('0x3a'),_0x23dfd2);}};module[_0x33dd('0x3b')]=Agent; \ No newline at end of file +var _0xe172=['idle','chat','openchannel','fax','sms','length','Status','toNumber','format','faxCurrentCapacity','whatsappStatusTime','openchannelStatus','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity'];(function(_0x8f25cc,_0x3fa44c){var _0x1a7a82=function(_0x5e189f){while(--_0x5e189f){_0x8f25cc['push'](_0x8f25cc['shift']());}};_0x1a7a82(++_0x3fa44c);}(_0xe172,0x1bb));var _0x2e17=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xe172[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x2e17('0x0'));var moment=require(_0x2e17('0x1'));var md5=require('md5');var Redis=require(_0x2e17('0x2'));var config=require(_0x2e17('0x3'));config['redis']=_[_0x2e17('0x4')](config['redis'],{'host':_0x2e17('0x5'),'port':0x18eb});var io=require(_0x2e17('0x6'))(new Redis(config[_0x2e17('0x7')]));function Agent(_0x4f25fc){this['id']=_0x4f25fc['id']||0x0;this['name']=_0x4f25fc[_0x2e17('0x8')]||'';this[_0x2e17('0x9')]=_0x4f25fc[_0x2e17('0x9')]||!![];this[_0x2e17('0xa')]=_0x4f25fc[_0x2e17('0xa')]||![];this[_0x2e17('0xb')]=_0x4f25fc[_0x2e17('0xb')]||![];this[_0x2e17('0xc')]=_0x4f25fc[_0x2e17('0xc')]||![];this[_0x2e17('0xd')]=_0x4f25fc[_0x2e17('0xd')]||![];this[_0x2e17('0xe')]=_0x4f25fc['smsPause']||![];this[_0x2e17('0xf')]=_0x4f25fc[_0x2e17('0xf')]||![];this['chatStatus']=_0x2e17('0x10');this[_0x2e17('0x11')]=0x0;this[_0x2e17('0x12')]=_0x4f25fc['chatCapacity']||0x0;this[_0x2e17('0x13')]=0x0;this[_0x2e17('0x14')]=_0x2e17('0x10');this[_0x2e17('0x15')]=0x0;this[_0x2e17('0x16')]=_0x4f25fc[_0x2e17('0x16')]||0x0;this[_0x2e17('0x17')]=0x0;this[_0x2e17('0x18')]=_0x2e17('0x10');this[_0x2e17('0x19')]=0x0;this[_0x2e17('0x1a')]=_0x4f25fc[_0x2e17('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x2e17('0x1b')]='unknown';this['smsStatusTime']=0x0;this[_0x2e17('0x1c')]=_0x4f25fc[_0x2e17('0x1c')]||0x0;this[_0x2e17('0x1d')]=0x0;this[_0x2e17('0x1e')]=_0x2e17('0x10');this['whatsappStatusTime']=0x0;this[_0x2e17('0x1f')]=_0x4f25fc[_0x2e17('0x1f')]||0x0;this[_0x2e17('0x20')]=0x0;this['openchannelStatus']=_0x2e17('0x10');this[_0x2e17('0x21')]=0x0;this[_0x2e17('0x22')]=_0x4f25fc['openchannelCapacity']||0x0;this[_0x2e17('0x23')]=0x0;this[_0x2e17('0x24')]=![];this[_0x2e17('0x25')]=undefined;this[_0x2e17('0x26')]='';this[_0x2e17('0x27')]();}Agent[_0x2e17('0x28')][_0x2e17('0x29')]=function(_0x1e4f60){if(this[_0x1e4f60+_0x2e17('0x2a')]>0x0){if(this[_0x1e4f60+_0x2e17('0x2b')]>0x0&&this[_0x1e4f60+_0x2e17('0x2a')]>=this[_0x1e4f60+'Capacity']){return _0x2e17('0x2c');}else{return'working';}}else{return _0x2e17('0x2d');}};Agent[_0x2e17('0x28')][_0x2e17('0x27')]=function(){var _0x53be73=['mail',_0x2e17('0x2e'),_0x2e17('0x2f'),_0x2e17('0x30'),_0x2e17('0x31'),'whatsapp'];for(var _0x5aba0e=0x0;_0x5aba0e<_0x53be73[_0x2e17('0x32')];_0x5aba0e+=0x1){var _0x292818=this[_0x2e17('0x29')](_0x53be73[_0x5aba0e]);if(this[_0x53be73[_0x5aba0e]+_0x2e17('0x33')]!==_0x292818){this[_0x53be73[_0x5aba0e]+'StatusTime']=_[_0x2e17('0x34')](moment()[_0x2e17('0x35')]('x'));}this[_0x53be73[_0x5aba0e]+'Status']=_0x292818;}var _0x4d3223={'id':this['id'],'name':this[_0x2e17('0x8')],'online':this[_0x2e17('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x2e17('0xb')],'mailPause':this[_0x2e17('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x2e17('0xd')],'openchannelPause':this[_0x2e17('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x2e17('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x2e17('0x13')],'mailStatus':this[_0x2e17('0x14')],'mailStatusTime':this[_0x2e17('0x15')],'mailCapacity':this[_0x2e17('0x16')],'mailCurrentCapacity':this[_0x2e17('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x2e17('0x19')],'faxCapacity':this[_0x2e17('0x1a')],'faxCurrentCapacity':this[_0x2e17('0x36')],'smsStatus':this[_0x2e17('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x2e17('0x1d')],'whatsappStatus':this[_0x2e17('0x1e')],'whatsappStatusTime':this[_0x2e17('0x37')],'whatsappCapacity':this[_0x2e17('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2e17('0x38')],'openchannelStatusTime':this[_0x2e17('0x21')],'openchannelCapacity':this[_0x2e17('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x2e17('0x24')],'busyQueue':this['busyQueue']};var _0x390110=md5(JSON[_0x2e17('0x39')](_0x4d3223));if(this[_0x2e17('0x26')]!==_0x390110){this[_0x2e17('0x26')]=_0x390110;io[_0x2e17('0x3a')](_0x2e17('0x3b'),_0x4d3223);}};module[_0x2e17('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 50462bf..ea6897a 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 _0x47a8=['socket.io-emitter','name','Agents','prototype','updateRouting','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','md5','util','../../../config/environment','redis','defaults','localhost'];(function(_0x324661,_0x3fb798){var _0x135bed=function(_0x15aed6){while(--_0x15aed6){_0x324661['push'](_0x324661['shift']());}};_0x135bed(++_0x3fb798);}(_0x47a8,0xfe));var _0x847a=function(_0x1e6292,_0x12914f){_0x1e6292=_0x1e6292-0x0;var _0x186ab0=_0x47a8[_0x1e6292];return _0x186ab0;};'use strict';var _=require('lodash');var md5=require(_0x847a('0x0'));var util=require(_0x847a('0x1'));var Redis=require('ioredis');var config=require(_0x847a('0x2'));config[_0x847a('0x3')]=_[_0x847a('0x4')](config[_0x847a('0x3')],{'host':_0x847a('0x5'),'port':0x18eb});var io=require(_0x847a('0x6'))(new Redis(config[_0x847a('0x3')]));function ChatQueue(_0x51b1f0){this['id']=_0x51b1f0['id']||0x0;this[_0x847a('0x7')]=_0x51b1f0[_0x847a('0x7')]||'';this['timeout']=_0x51b1f0['timeout']||0xa;this['strategy']=_0x51b1f0['strategy']||'beepall';this[_0x847a('0x8')]=_0x51b1f0[_0x847a('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x847a('0x9')][_0x847a('0xa')]=function(){var _0x512a2a=this['mapAgentsId'][_0x847a('0xb')];this[_0x847a('0xc')]=_[_0x847a('0xd')](this[_0x847a('0x8')],'id');this[_0x847a('0xc')][_0x847a('0xb')]=_0x512a2a;};ChatQueue['prototype'][_0x847a('0xe')]=function(){this[_0x847a('0xf')]=0x0;this[_0x847a('0x10')]=0x0;for(var _0x168c18=0x0;_0x168c18=0x0?this[_0x847a('0x13')]:0x0;var _0x272159={'id':this['id'],'available':this['available'],'loggedIn':this[_0x847a('0xf')],'name':this[_0x847a('0x7')],'paused':this[_0x847a('0x10')],'waiting':this[_0x847a('0x14')]};var _0x40768e=md5(JSON[_0x847a('0x15')](_0x272159));if(this[_0x847a('0x0')]!==_0x40768e){this[_0x847a('0x0')]=_0x40768e;io['to'](util[_0x847a('0x16')](_0x847a('0x17'),_0x272159['name']))[_0x847a('0x18')](_0x847a('0x19'),_0x272159);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xe5d8=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','exports','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x220423,_0x4ee242){var _0x32f6c8=function(_0x2d9704){while(--_0x2d9704){_0x220423['push'](_0x220423['shift']());}};_0x32f6c8(++_0x4ee242);}(_0xe5d8,0x82));var _0x8e5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe5d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0x8e5d('0x0'));var util=require(_0x8e5d('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x8e5d('0x2')]=_[_0x8e5d('0x3')](config[_0x8e5d('0x2')],{'host':_0x8e5d('0x4'),'port':0x18eb});var io=require(_0x8e5d('0x5'))(new Redis(config['redis']));function ChatQueue(_0x45f9fb){this['id']=_0x45f9fb['id']||0x0;this[_0x8e5d('0x6')]=_0x45f9fb[_0x8e5d('0x6')]||'';this[_0x8e5d('0x7')]=_0x45f9fb['timeout']||0xa;this[_0x8e5d('0x8')]=_0x45f9fb[_0x8e5d('0x8')]||_0x8e5d('0x9');this[_0x8e5d('0xa')]=_0x45f9fb[_0x8e5d('0xa')];this[_0x8e5d('0xb')]={};this[_0x8e5d('0xc')]=0x0;this['md5']='';this[_0x8e5d('0xd')]();this[_0x8e5d('0xe')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x513e9f=this['mapAgentsId'][_0x8e5d('0xf')];this[_0x8e5d('0xb')]=_[_0x8e5d('0x10')](this[_0x8e5d('0xa')],'id');this[_0x8e5d('0xb')]['_rr']=_0x513e9f;};ChatQueue[_0x8e5d('0x11')][_0x8e5d('0xe')]=function(){this[_0x8e5d('0x12')]=0x0;this[_0x8e5d('0x13')]=0x0;for(var _0x5dced3=0x0;_0x5dced3=0x0?this['available']:0x0;var _0x538802={'id':this['id'],'available':this[_0x8e5d('0x17')],'loggedIn':this[_0x8e5d('0x12')],'name':this[_0x8e5d('0x6')],'paused':this[_0x8e5d('0x13')],'waiting':this[_0x8e5d('0xc')]};var _0x47d381=md5(JSON['stringify'](_0x538802));if(this[_0x8e5d('0x0')]!==_0x47d381){this[_0x8e5d('0x0')]=_0x47d381;io['to'](util[_0x8e5d('0x18')](_0x8e5d('0x19'),_0x538802[_0x8e5d('0x6')]))[_0x8e5d('0x1a')]('chat_queue:save',_0x538802);}};module[_0x8e5d('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 ad28192..366aa4a 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 _0xd420=['strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','faxPause','available','waiting','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','name','timeout'];(function(_0x4d90c9,_0x317ad9){var _0x38c00a=function(_0xd85963){while(--_0xd85963){_0x4d90c9['push'](_0x4d90c9['shift']());}};_0x38c00a(++_0x317ad9);}(_0xd420,0x14b));var _0x0d42=function(_0x19fa36,_0x320fc1){_0x19fa36=_0x19fa36-0x0;var _0x1bfa39=_0xd420[_0x19fa36];return _0x1bfa39;};'use strict';var _=require(_0x0d42('0x0'));var md5=require(_0x0d42('0x1'));var util=require(_0x0d42('0x2'));var Redis=require('ioredis');var config=require(_0x0d42('0x3'));config[_0x0d42('0x4')]=_['defaults'](config[_0x0d42('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x5f2c3c){this['id']=_0x5f2c3c['id']||0x0;this[_0x0d42('0x5')]=_0x5f2c3c[_0x0d42('0x5')]||'';this[_0x0d42('0x6')]=_0x5f2c3c[_0x0d42('0x6')]||0xa;this[_0x0d42('0x7')]=_0x5f2c3c[_0x0d42('0x7')]||_0x0d42('0x8');this['Agents']=_0x5f2c3c[_0x0d42('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0d42('0x1')]='';this[_0x0d42('0xa')]();this[_0x0d42('0xb')]();}FaxQueue[_0x0d42('0xc')]['updateRouting']=function(){var _0x1802e0=this[_0x0d42('0xd')][_0x0d42('0xe')];this[_0x0d42('0xd')]=_['map'](this[_0x0d42('0x9')],'id');this[_0x0d42('0xd')][_0x0d42('0xe')]=_0x1802e0;};FaxQueue[_0x0d42('0xc')]['updateRealtime']=function(){this[_0x0d42('0xf')]=0x0;this[_0x0d42('0x10')]=0x0;for(var _0x48bbca=0x0;_0x48bbca=0x0?this[_0x0d42('0x13')]:0x0;var _0x269371={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0d42('0xf')],'name':this[_0x0d42('0x5')],'paused':this['paused'],'waiting':this[_0x0d42('0x14')]};var _0x578f9b=md5(JSON[_0x0d42('0x15')](_0x269371));if(this['md5']!==_0x578f9b){this['md5']=_0x578f9b;io['to'](util['format'](_0x0d42('0x16'),_0x269371[_0x0d42('0x5')]))[_0x0d42('0x17')](_0x0d42('0x18'),_0x269371);}};module[_0x0d42('0x19')]=FaxQueue; \ No newline at end of file +var _0xf41a=['stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','updateRouting','map','_rr','length','online','loggedIn','faxPause','available','paused','waiting'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf41a,0x78));var _0xaf41=function(_0x180a34,_0x2bd0cf){_0x180a34=_0x180a34-0x0;var _0x42edda=_0xf41a[_0x180a34];return _0x42edda;};'use strict';var _=require(_0xaf41('0x0'));var md5=require(_0xaf41('0x1'));var util=require(_0xaf41('0x2'));var Redis=require(_0xaf41('0x3'));var config=require(_0xaf41('0x4'));config[_0xaf41('0x5')]=_[_0xaf41('0x6')](config[_0xaf41('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xaf41('0x7'))(new Redis(config[_0xaf41('0x5')]));function FaxQueue(_0x32554c){this['id']=_0x32554c['id']||0x0;this[_0xaf41('0x8')]=_0x32554c['name']||'';this[_0xaf41('0x9')]=_0x32554c[_0xaf41('0x9')]||0xa;this[_0xaf41('0xa')]=_0x32554c[_0xaf41('0xa')]||_0xaf41('0xb');this[_0xaf41('0xc')]=_0x32554c[_0xaf41('0xc')];this[_0xaf41('0xd')]={};this['waiting']=0x0;this[_0xaf41('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xaf41('0xe')][_0xaf41('0xf')]=function(){var _0x1dee1a=this['mapAgentsId']['_rr'];this[_0xaf41('0xd')]=_[_0xaf41('0x10')](this[_0xaf41('0xc')],'id');this['mapAgentsId'][_0xaf41('0x11')]=_0x1dee1a;};FaxQueue[_0xaf41('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3c12e5=0x0;_0x3c12e5=0x0?this['available']:0x0;var _0x1eb194={'id':this['id'],'available':this['available'],'loggedIn':this[_0xaf41('0x14')],'name':this[_0xaf41('0x8')],'paused':this[_0xaf41('0x17')],'waiting':this[_0xaf41('0x18')]};var _0x5b98e7=md5(JSON[_0xaf41('0x19')](_0x1eb194));if(this[_0xaf41('0x1')]!==_0x5b98e7){this[_0xaf41('0x1')]=_0x5b98e7;io['to'](util[_0xaf41('0x1a')]('fax:queue:%s',_0x1eb194[_0xaf41('0x8')]))[_0xaf41('0x1b')]('fax_queue:save',_0x1eb194);}};module[_0xaf41('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 1205817..8c5642e 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 _0xf3d1=['exports','name','Intervals'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3d1,0xa6));var _0x1f3d=function(_0x2abec0,_0x480ff3){_0x2abec0=_0x2abec0-0x0;var _0x4bf548=_0xf3d1[_0x2abec0];return _0x4bf548;};'use strict';function Interval(_0x32e99d){this['id']=_0x32e99d['id']||0x0;this[_0x1f3d('0x0')]=_0x32e99d[_0x1f3d('0x0')]||'';this[_0x1f3d('0x1')]=_0x32e99d[_0x1f3d('0x1')]||{};}module[_0x1f3d('0x2')]=Interval; \ No newline at end of file +var _0x7ebd=['exports','name','Intervals'];(function(_0x31806f,_0xb2a8e3){var _0x317b1e=function(_0x15ad9b){while(--_0x15ad9b){_0x31806f['push'](_0x31806f['shift']());}};_0x317b1e(++_0xb2a8e3);}(_0x7ebd,0xf4));var _0xd7eb=function(_0x4ce85b,_0x48a3a8){_0x4ce85b=_0x4ce85b-0x0;var _0x113d86=_0x7ebd[_0x4ce85b];return _0x113d86;};'use strict';function Interval(_0x457c79){this['id']=_0x457c79['id']||0x0;this['name']=_0x457c79[_0xd7eb('0x0')]||'';this['Intervals']=_0x457c79[_0xd7eb('0x1')]||{};}module[_0xd7eb('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 251b6f6..b07f364 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 _0xa045=['mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0xa045,0x134));var _0x5a04=function(_0x223578,_0x22ac61){_0x223578=_0x223578-0x0;var _0x574143=_0xa045[_0x223578];return _0x574143;};'use strict';var _=require(_0x5a04('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5a04('0x1'));var config=require('../../../config/environment');config[_0x5a04('0x2')]=_[_0x5a04('0x3')](config['redis'],{'host':_0x5a04('0x4'),'port':0x18eb});var io=require(_0x5a04('0x5'))(new Redis(config[_0x5a04('0x2')]));function MailQueue(_0x3dca94){this['id']=_0x3dca94['id']||0x0;this[_0x5a04('0x6')]=_0x3dca94[_0x5a04('0x6')]||'';this[_0x5a04('0x7')]=_0x3dca94[_0x5a04('0x7')]||0xa;this[_0x5a04('0x8')]=_0x3dca94[_0x5a04('0x8')]||_0x5a04('0x9');this[_0x5a04('0xa')]=_0x3dca94['Agents'];this[_0x5a04('0xb')]={};this[_0x5a04('0xc')]=0x0;this[_0x5a04('0xd')]='';this[_0x5a04('0xe')]();this[_0x5a04('0xf')]();}MailQueue[_0x5a04('0x10')][_0x5a04('0xe')]=function(){var _0x131b5f=this[_0x5a04('0xb')][_0x5a04('0x11')];this['mapAgentsId']=_[_0x5a04('0x12')](this[_0x5a04('0xa')],'id');this[_0x5a04('0xb')][_0x5a04('0x11')]=_0x131b5f;};MailQueue[_0x5a04('0x10')]['updateRealtime']=function(){this[_0x5a04('0x13')]=0x0;this['paused']=0x0;for(var _0x39c9d7=0x0;_0x39c9d7=0x0?this[_0x5a04('0x18')]:0x0;var _0x300ba2={'id':this['id'],'available':this[_0x5a04('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x5a04('0x17')],'waiting':this['waiting']};var _0x206d4f=md5(JSON[_0x5a04('0x19')](_0x300ba2));if(this['md5']!==_0x206d4f){this[_0x5a04('0xd')]=_0x206d4f;io['to'](util[_0x5a04('0x1a')](_0x5a04('0x1b'),_0x300ba2[_0x5a04('0x6')]))[_0x5a04('0x1c')](_0x5a04('0x1d'),_0x300ba2);}};module['exports']=MailQueue; \ No newline at end of file +var _0xf3c4=['paused','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn'];(function(_0x50032d,_0x5bc969){var _0xb92fd6=function(_0x4b3200){while(--_0x4b3200){_0x50032d['push'](_0x50032d['shift']());}};_0xb92fd6(++_0x5bc969);}(_0xf3c4,0x71));var _0x4f3c=function(_0xe8486f,_0x1e5aad){_0xe8486f=_0xe8486f-0x0;var _0x15f1da=_0xf3c4[_0xe8486f];return _0x15f1da;};'use strict';var _=require(_0x4f3c('0x0'));var md5=require(_0x4f3c('0x1'));var util=require('util');var Redis=require(_0x4f3c('0x2'));var config=require('../../../config/environment');config[_0x4f3c('0x3')]=_['defaults'](config[_0x4f3c('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x4f3c('0x4'))(new Redis(config[_0x4f3c('0x3')]));function MailQueue(_0x401c25){this['id']=_0x401c25['id']||0x0;this[_0x4f3c('0x5')]=_0x401c25[_0x4f3c('0x5')]||'';this[_0x4f3c('0x6')]=_0x401c25[_0x4f3c('0x6')]||0xa;this[_0x4f3c('0x7')]=_0x401c25['strategy']||_0x4f3c('0x8');this[_0x4f3c('0x9')]=_0x401c25[_0x4f3c('0x9')];this[_0x4f3c('0xa')]={};this[_0x4f3c('0xb')]=0x0;this[_0x4f3c('0x1')]='';this[_0x4f3c('0xc')]();this[_0x4f3c('0xd')]();}MailQueue['prototype']['updateRouting']=function(){var _0x38e639=this[_0x4f3c('0xa')][_0x4f3c('0xe')];this[_0x4f3c('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x4f3c('0xe')]=_0x38e639;};MailQueue[_0x4f3c('0xf')][_0x4f3c('0xd')]=function(){this[_0x4f3c('0x10')]=0x0;this[_0x4f3c('0x11')]=0x0;for(var _0xded7af=0x0;_0xded7af=0x0?this[_0x4f3c('0x14')]:0x0;var _0x70b72b={'id':this['id'],'available':this[_0x4f3c('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x4f3c('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x39ac07=md5(JSON[_0x4f3c('0x15')](_0x70b72b));if(this[_0x4f3c('0x1')]!==_0x39ac07){this['md5']=_0x39ac07;io['to'](util[_0x4f3c('0x16')](_0x4f3c('0x17'),_0x70b72b[_0x4f3c('0x5')]))['emit'](_0x4f3c('0x18'),_0x70b72b);}};module[_0x4f3c('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7c8cf27..50040a8 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x1d96c6,_0x2f23c2){var _0x2be59d=function(_0x3ba2ea){while(--_0x3ba2ea){_0x1d96c6['push'](_0x1d96c6['shift']());}};_0x2be59d(++_0x2f23c2);}(_0x814b,0x1a2));var _0xb814=function(_0x380b8f,_0x32271d){_0x380b8f=_0x380b8f-0x0;var _0x646c69=_0x814b[_0x380b8f];return _0x646c69;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e4c0d34..ff232bd 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 _0xd3d1=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x3add5d,_0x27958f){var _0x26caf5=function(_0x46385d){while(--_0x46385d){_0x3add5d['push'](_0x3add5d['shift']());}};_0x26caf5(++_0x27958f);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd3d1[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1d3d('0x0'));var md5=require(_0x1d3d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x1d3d('0x2'));config[_0x1d3d('0x3')]=_[_0x1d3d('0x4')](config[_0x1d3d('0x3')],{'host':_0x1d3d('0x5'),'port':0x18eb});var io=require(_0x1d3d('0x6'))(new Redis(config[_0x1d3d('0x3')]));function SmsQueue(_0xc64465){this['id']=_0xc64465['id']||0x0;this[_0x1d3d('0x7')]=_0xc64465[_0x1d3d('0x7')]||'';this[_0x1d3d('0x8')]=_0xc64465[_0x1d3d('0x8')]||0xa;this[_0x1d3d('0x9')]=_0xc64465[_0x1d3d('0x9')]||_0x1d3d('0xa');this[_0x1d3d('0xb')]=_0xc64465[_0x1d3d('0xb')];this['mapAgentsId']={};this[_0x1d3d('0xc')]=0x0;this[_0x1d3d('0x1')]='';this[_0x1d3d('0xd')]();this[_0x1d3d('0xe')]();}SmsQueue[_0x1d3d('0xf')][_0x1d3d('0xd')]=function(){var _0x44b374=this[_0x1d3d('0x10')][_0x1d3d('0x11')];this[_0x1d3d('0x10')]=_[_0x1d3d('0x12')](this['Agents'],'id');this[_0x1d3d('0x10')][_0x1d3d('0x11')]=_0x44b374;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x1d3d('0x13')]=0x0;this[_0x1d3d('0x14')]=0x0;for(var _0x1a8035=0x0;_0x1a8035=0x0?this[_0x1d3d('0x18')]:0x0;var _0x50bab4={'id':this['id'],'available':this[_0x1d3d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x1d3d('0x7')],'paused':this[_0x1d3d('0x14')],'waiting':this[_0x1d3d('0xc')]};var _0x2d6dfb=md5(JSON['stringify'](_0x50bab4));if(this[_0x1d3d('0x1')]!==_0x2d6dfb){this['md5']=_0x2d6dfb;io['to'](util['format'](_0x1d3d('0x19'),_0x50bab4[_0x1d3d('0x7')]))[_0x1d3d('0x1a')](_0x1d3d('0x1b'),_0x50bab4);}};module[_0x1d3d('0x1c')]=SmsQueue; \ No newline at end of file +var _0xc2cc=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','paused','loggedIn','smsPause','available','name','stringify','sms_queue:save','exports','md5','util','ioredis','redis','socket.io-emitter','timeout','strategy','beepall'];(function(_0x3ba6ce,_0x34407a){var _0x3d4a57=function(_0x4b1785){while(--_0x4b1785){_0x3ba6ce['push'](_0x3ba6ce['shift']());}};_0x3d4a57(++_0x34407a);}(_0xc2cc,0x70));var _0xcc2c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc2cc[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var md5=require(_0xcc2c('0x0'));var util=require(_0xcc2c('0x1'));var Redis=require(_0xcc2c('0x2'));var config=require('../../../config/environment');config[_0xcc2c('0x3')]=_['defaults'](config[_0xcc2c('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xcc2c('0x4'))(new Redis(config['redis']));function SmsQueue(_0x342a00){this['id']=_0x342a00['id']||0x0;this['name']=_0x342a00['name']||'';this[_0xcc2c('0x5')]=_0x342a00['timeout']||0xa;this[_0xcc2c('0x6')]=_0x342a00['strategy']||_0xcc2c('0x7');this['Agents']=_0x342a00['Agents'];this[_0xcc2c('0x8')]={};this[_0xcc2c('0x9')]=0x0;this[_0xcc2c('0x0')]='';this[_0xcc2c('0xa')]();this[_0xcc2c('0xb')]();}SmsQueue[_0xcc2c('0xc')][_0xcc2c('0xa')]=function(){var _0x1c18a8=this['mapAgentsId'][_0xcc2c('0xd')];this['mapAgentsId']=_[_0xcc2c('0xe')](this[_0xcc2c('0xf')],'id');this[_0xcc2c('0x8')][_0xcc2c('0xd')]=_0x1c18a8;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xcc2c('0x10')]=0x0;for(var _0xc1cafd=0x0;_0xc1cafd=0x0?this[_0xcc2c('0x13')]:0x0;var _0x285deb={'id':this['id'],'available':this[_0xcc2c('0x13')],'loggedIn':this[_0xcc2c('0x11')],'name':this[_0xcc2c('0x14')],'paused':this[_0xcc2c('0x10')],'waiting':this[_0xcc2c('0x9')]};var _0x5a1f0a=md5(JSON[_0xcc2c('0x15')](_0x285deb));if(this[_0xcc2c('0x0')]!==_0x5a1f0a){this['md5']=_0x5a1f0a;io['to'](util['format']('sms:queue:%s',_0x285deb[_0xcc2c('0x14')]))['emit'](_0xcc2c('0x16'),_0x285deb);}};module[_0xcc2c('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 22805b6..be22842 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 _0xef4f=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','whatsappPause','paused','available','stringify','whatsapp:queue:%s','whatsapp_queue:save','exports','md5','util','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x20dbd7,_0x308f69){var _0xec1ab1=function(_0x1e4b5b){while(--_0x1e4b5b){_0x20dbd7['push'](_0x20dbd7['shift']());}};_0xec1ab1(++_0x308f69);}(_0xef4f,0xb0));var _0xfef4=function(_0x5577ea,_0x1b698d){_0x5577ea=_0x5577ea-0x0;var _0x43ec32=_0xef4f[_0x5577ea];return _0x43ec32;};'use strict';var _=require('lodash');var md5=require(_0xfef4('0x0'));var util=require(_0xfef4('0x1'));var Redis=require('ioredis');var config=require(_0xfef4('0x2'));config[_0xfef4('0x3')]=_['defaults'](config[_0xfef4('0x3')],{'host':_0xfef4('0x4'),'port':0x18eb});var io=require(_0xfef4('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x26960b){this['id']=_0x26960b['id']||0x0;this[_0xfef4('0x6')]=_0x26960b[_0xfef4('0x6')]||'';this[_0xfef4('0x7')]=_0x26960b[_0xfef4('0x7')]||0xa;this[_0xfef4('0x8')]=_0x26960b[_0xfef4('0x8')]||'beepall';this['Agents']=_0x26960b[_0xfef4('0x9')];this[_0xfef4('0xa')]={};this[_0xfef4('0xb')]=0x0;this[_0xfef4('0x0')]='';this[_0xfef4('0xc')]();this[_0xfef4('0xd')]();}WhatsappQueue[_0xfef4('0xe')][_0xfef4('0xc')]=function(){var _0x3ff555=this[_0xfef4('0xa')][_0xfef4('0xf')];this['mapAgentsId']=_['map'](this[_0xfef4('0x9')],'id');this[_0xfef4('0xa')][_0xfef4('0xf')]=_0x3ff555;};WhatsappQueue[_0xfef4('0xe')][_0xfef4('0xd')]=function(){this[_0xfef4('0x10')]=0x0;this['paused']=0x0;for(var _0x1707a4=0x0;_0x1707a4=0x0?this['available']:0x0;var _0x58416a={'id':this['id'],'available':this[_0xfef4('0x15')],'loggedIn':this[_0xfef4('0x10')],'name':this[_0xfef4('0x6')],'paused':this[_0xfef4('0x14')],'waiting':this[_0xfef4('0xb')]};var _0x173ccf=md5(JSON[_0xfef4('0x16')](_0x58416a));if(this[_0xfef4('0x0')]!==_0x173ccf){this[_0xfef4('0x0')]=_0x173ccf;io['to'](util['format'](_0xfef4('0x17'),_0x58416a[_0xfef4('0x6')]))['emit'](_0xfef4('0x18'),_0x58416a);}};module[_0xfef4('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x77a9=['localhost','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','available','name','format','whatsapp:queue:%s','emit','lodash','md5','../../../config/environment','redis','defaults'];(function(_0x3d8db4,_0x245979){var _0x30eed9=function(_0x490999){while(--_0x490999){_0x3d8db4['push'](_0x3d8db4['shift']());}};_0x30eed9(++_0x245979);}(_0x77a9,0xa3));var _0x977a=function(_0x2db5c2,_0x1fc352){_0x2db5c2=_0x2db5c2-0x0;var _0x1485de=_0x77a9[_0x2db5c2];return _0x1485de;};'use strict';var _=require(_0x977a('0x0'));var md5=require(_0x977a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x977a('0x2'));config[_0x977a('0x3')]=_[_0x977a('0x4')](config['redis'],{'host':_0x977a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x977a('0x3')]));function WhatsappQueue(_0x3ef939){this['id']=_0x3ef939['id']||0x0;this['name']=_0x3ef939['name']||'';this[_0x977a('0x6')]=_0x3ef939[_0x977a('0x6')]||0xa;this['strategy']=_0x3ef939[_0x977a('0x7')]||_0x977a('0x8');this[_0x977a('0x9')]=_0x3ef939[_0x977a('0x9')];this['mapAgentsId']={};this[_0x977a('0xa')]=0x0;this[_0x977a('0x1')]='';this[_0x977a('0xb')]();this[_0x977a('0xc')]();}WhatsappQueue['prototype'][_0x977a('0xb')]=function(){var _0x21c26a=this[_0x977a('0xd')][_0x977a('0xe')];this[_0x977a('0xd')]=_[_0x977a('0xf')](this[_0x977a('0x9')],'id');this[_0x977a('0xd')][_0x977a('0xe')]=_0x21c26a;};WhatsappQueue[_0x977a('0x10')][_0x977a('0xc')]=function(){this[_0x977a('0x11')]=0x0;this[_0x977a('0x12')]=0x0;for(var _0x5c55d7=0x0;_0x5c55d7=0x0?this[_0x977a('0x13')]:0x0;var _0x2956bd={'id':this['id'],'available':this[_0x977a('0x13')],'loggedIn':this[_0x977a('0x11')],'name':this[_0x977a('0x14')],'paused':this[_0x977a('0x12')],'waiting':this[_0x977a('0xa')]};var _0x4cf896=md5(JSON['stringify'](_0x2956bd));if(this[_0x977a('0x1')]!==_0x4cf896){this['md5']=_0x4cf896;io['to'](util[_0x977a('0x15')](_0x977a('0x16'),_0x2956bd[_0x977a('0x14')]))[_0x977a('0x17')]('whatsapp_queue:save',_0x2956bd);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 72bf013..c6a8f61 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4fb962,_0x2244de){var _0x5c6cc9=function(_0x1397c0){while(--_0x1397c0){_0x4fb962['push'](_0x4fb962['shift']());}};_0x5c6cc9(++_0x2244de);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d550,_0x1c3fd0){_0x56d550=_0x56d550-0x0;var _0x5e6a91=_0xb10b[_0x56d550];return _0x5e6a91;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f62fad5..0f2b911 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 _0xe37f=['addTagsToChatInteraction','update','UpdateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x54db71,_0x43de96){var _0x1104e7=function(_0x2c3606){while(--_0x2c3606){_0x54db71['push'](_0x54db71['shift']());}};_0x1104e7(++_0x43de96);}(_0xe37f,0x16e));var _0xfe37=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xe37f[_0x446208];return _0xe49563;};'use strict';var client=require('../client');exports[_0xfe37('0x0')]=function(_0x29540b,_0xae5c1d){return client['Request'](_0xfe37('0x1'),{'body':_0xae5c1d,'options':{'where':{'id':_0x29540b}},'log':'updateChatInteraction'});};exports[_0xfe37('0x2')]=function(_0x49eada,_0x550f0c){return client['Request'](_0xfe37('0x3'),{'body':_0x550f0c,'options':{'where':{'id':_0x49eada}},'log':_0xfe37('0x4')});}; \ No newline at end of file +var _0xc304=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0xc304,0x16a));var _0x4c30=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xc304[_0x215dc8];return _0x583ea3;};'use strict';var client=require(_0x4c30('0x0'));exports['update']=function(_0xc79368,_0x4f1637){return client[_0x4c30('0x1')](_0x4c30('0x2'),{'body':_0x4f1637,'options':{'where':{'id':_0xc79368}},'log':_0x4c30('0x3')});};exports['addTags']=function(_0x116435,_0x144421){return client['Request'](_0x4c30('0x4'),{'body':_0x144421,'options':{'where':{'id':_0x116435}},'log':_0x4c30('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4b93969..d0a9e8b 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 _0xeeeb=['../client','Request','createChatMessage'];(function(_0x5c2829,_0x2e1482){var _0x4d6544=function(_0x63b01e){while(--_0x63b01e){_0x5c2829['push'](_0x5c2829['shift']());}};_0x4d6544(++_0x2e1482);}(_0xeeeb,0x1bf));var _0xbeee=function(_0x5eb436,_0x3217e8){_0x5eb436=_0x5eb436-0x0;var _0x53f243=_0xeeeb[_0x5eb436];return _0x53f243;};'use strict';var client=require(_0xbeee('0x0'));exports['create']=function(_0x412059){return client[_0xbeee('0x1')]('CreateChatMessage',{'body':_0x412059,'log':_0xbeee('0x2')});}; \ No newline at end of file +var _0x76c5=['createChatMessage','create','Request'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x76c5,0x121));var _0x576c=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0x76c5[_0x4de877];return _0xb2cfeb;};'use strict';var client=require('../client');exports[_0x576c('0x0')]=function(_0xe58b1c){return client[_0x576c('0x1')]('CreateChatMessage',{'body':_0xe58b1c,'log':_0x576c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3a66b3f..198ae4d 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 _0x26cf=['strategy','Agents','chatPause','getChatQueues','Request','name'];(function(_0x14fb7e,_0x3223ab){var _0x385c07=function(_0x18be23){while(--_0x18be23){_0x14fb7e['push'](_0x14fb7e['shift']());}};_0x385c07(++_0x3223ab);}(_0x26cf,0x135));var _0xf26c=function(_0x18a422,_0x16f81e){_0x18a422=_0x18a422-0x0;var _0x2ec105=_0x26cf[_0x18a422];return _0x2ec105;};'use strict';var client=require('../client');exports[_0xf26c('0x0')]=function(){return function(){return client[_0xf26c('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xf26c('0x2'),'timeout',_0xf26c('0x3')],'include':[{'model':'User','as':_0xf26c('0x4'),'attributes':['id',_0xf26c('0x2'),'online',_0xf26c('0x5')]}]},'log':_0xf26c('0x0')});};}; \ No newline at end of file +var _0x0048=['User','Agents','online','getChatQueues','Request','name','timeout'];(function(_0x42f6d1,_0x52c740){var _0x50ae08=function(_0x419bf5){while(--_0x419bf5){_0x42f6d1['push'](_0x42f6d1['shift']());}};_0x50ae08(++_0x52c740);}(_0x0048,0x129));var _0x8004=function(_0x8b953b,_0x132acf){_0x8b953b=_0x8b953b-0x0;var _0x1943d5=_0x0048[_0x8b953b];return _0x1943d5;};'use strict';var client=require('../client');exports[_0x8004('0x0')]=function(){return function(){return client[_0x8004('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x8004('0x2'),_0x8004('0x3'),'strategy'],'include':[{'model':_0x8004('0x4'),'as':_0x8004('0x5'),'attributes':['id',_0x8004('0x2'),_0x8004('0x6'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ef710e8..f4e9219 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 _0xba6c=['Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0xba6c,0x113));var _0xcba6=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0xba6c[_0x30f07a];return _0xb38461;};'use strict';var client=require(_0xcba6('0x0'));exports['create']=function(_0x253b30){return client[_0xcba6('0x1')](_0xcba6('0x2'),{'body':_0x253b30,'log':_0xcba6('0x2')});};exports[_0xcba6('0x3')]=function(_0x3e9fb9,_0x2b34a3){return client['Request']('UpdateChatQueueReport',{'body':_0x2b34a3,'options':{'where':{'uniqueid':_0x3e9fb9},'order':[['id',_0xcba6('0x4')]],'limit':0x1},'log':_0xcba6('0x5')});}; \ No newline at end of file +var _0x0ba7=['../client','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x48fa1b,_0x369aa5){var _0x6b81a5=function(_0x474653){while(--_0x474653){_0x48fa1b['push'](_0x48fa1b['shift']());}};_0x6b81a5(++_0x369aa5);}(_0x0ba7,0x16d));var _0x70ba=function(_0x7c1be4,_0x519fba){_0x7c1be4=_0x7c1be4-0x0;var _0x40f5ff=_0x0ba7[_0x7c1be4];return _0x40f5ff;};'use strict';var client=require(_0x70ba('0x0'));exports['create']=function(_0x469795){return client[_0x70ba('0x1')](_0x70ba('0x2'),{'body':_0x469795,'log':_0x70ba('0x2')});};exports['update']=function(_0x319ca9,_0x3e20ab){return client[_0x70ba('0x1')](_0x70ba('0x3'),{'body':_0x3e20ab,'options':{'where':{'uniqueid':_0x319ca9},'order':[['id',_0x70ba('0x4')]],'limit':0x1},'log':_0x70ba('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index bf0669b..ba098f5 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(_0x4253c8,_0x7e7722){var _0x58010b=function(_0x502c5b){while(--_0x502c5b){_0x4253c8['push'](_0x4253c8['shift']());}};_0x58010b(++_0x7e7722);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x7a54,0x106));var _0x47a5=function(_0x54f9ca,_0xf59e9f){_0x54f9ca=_0x54f9ca-0x0;var _0x2faf66=_0x7a54[_0x54f9ca];return _0x2faf66;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4082800..eae720e 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 _0x29f5=['CreateFaxMessage','../client','create'];(function(_0x37f866,_0x2911fc){var _0x71c98d=function(_0x4d7679){while(--_0x4d7679){_0x37f866['push'](_0x37f866['shift']());}};_0x71c98d(++_0x2911fc);}(_0x29f5,0x1c9));var _0x529f=function(_0x15bd11,_0x5e1f00){_0x15bd11=_0x15bd11-0x0;var _0xdce0d6=_0x29f5[_0x15bd11];return _0xdce0d6;};'use strict';var client=require(_0x529f('0x0'));exports[_0x529f('0x1')]=function(_0xefd5a9){return client['Request'](_0x529f('0x2'),{'body':_0xefd5a9,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x93d4=['createFaxMessage','create','Request'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0x93d4,0x160));var _0x493d=function(_0x158df5,_0x29892d){_0x158df5=_0x158df5-0x0;var _0x5ece21=_0x93d4[_0x158df5];return _0x5ece21;};'use strict';var client=require('../client');exports[_0x493d('0x0')]=function(_0x2f747d){return client[_0x493d('0x1')]('CreateFaxMessage',{'body':_0x2f747d,'log':_0x493d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ca5e492..e73e04c 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 _0x65f1=['../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x65f1,0xb0));var _0x165f=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x65f1[_0x5224ba];return _0x459bd2;};'use strict';var client=require(_0x165f('0x0'));exports[_0x165f('0x1')]=function(){return function(){return client[_0x165f('0x2')](_0x165f('0x3'),{'options':{'raw':![],'attributes':['id',_0x165f('0x4'),_0x165f('0x5'),_0x165f('0x6')],'include':[{'model':_0x165f('0x7'),'as':_0x165f('0x8'),'attributes':['id',_0x165f('0x4'),_0x165f('0x9'),_0x165f('0xa')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xf582=['name','timeout','User','Agents','faxPause','../client','getFaxQueues','Request'];(function(_0x488982,_0x3e260c){var _0xfe389c=function(_0x2f8670){while(--_0x2f8670){_0x488982['push'](_0x488982['shift']());}};_0xfe389c(++_0x3e260c);}(_0xf582,0xd5));var _0x2f58=function(_0x10dc94,_0x2fed4f){_0x10dc94=_0x10dc94-0x0;var _0x4a462d=_0xf582[_0x10dc94];return _0x4a462d;};'use strict';var client=require(_0x2f58('0x0'));exports[_0x2f58('0x1')]=function(){return function(){return client[_0x2f58('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2f58('0x3'),_0x2f58('0x4'),'strategy'],'include':[{'model':_0x2f58('0x5'),'as':_0x2f58('0x6'),'attributes':['id',_0x2f58('0x3'),'online',_0x2f58('0x7')]}]},'log':_0x2f58('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d895801..b8cc206 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 _0xcd46=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x5ead8f,_0x24a360){var _0x183823=function(_0x2a8f5a){while(--_0x2a8f5a){_0x5ead8f['push'](_0x5ead8f['shift']());}};_0x183823(++_0x24a360);}(_0xcd46,0x124));var _0x6cd4=function(_0x8e7124,_0x45dc5e){_0x8e7124=_0x8e7124-0x0;var _0x5b3ee5=_0xcd46[_0x8e7124];return _0x5b3ee5;};'use strict';var client=require(_0x6cd4('0x0'));exports[_0x6cd4('0x1')]=function(_0x31f012){return client[_0x6cd4('0x2')]('CreateFaxQueueReport',{'body':_0x31f012,'log':_0x6cd4('0x3')});};exports[_0x6cd4('0x4')]=function(_0xfae480,_0x34aa29){return client['Request'](_0x6cd4('0x5'),{'body':_0x34aa29,'options':{'where':{'uniqueid':_0xfae480},'order':[['id',_0x6cd4('0x6')]],'limit':0x1},'log':_0x6cd4('0x5')});}; \ No newline at end of file +var _0xb2ff=['DESC','../client','create','Request','UpdateFaxQueueReport'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xfb2f('0x0'));exports[_0xfb2f('0x1')]=function(_0x585db4){return client[_0xfb2f('0x2')]('CreateFaxQueueReport',{'body':_0x585db4,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x13cb60,_0x484368){return client[_0xfb2f('0x2')](_0xfb2f('0x3'),{'body':_0x484368,'options':{'where':{'uniqueid':_0x13cb60},'order':[['id',_0xfb2f('0x4')]],'limit':0x1},'log':_0xfb2f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e07630d..e253694 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 _0x222f=['getIntervals','GetInterval','name','Interval','interval','../client'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x222f,0x10d));var _0xf222=function(_0x110924,_0x1374bb){_0x110924=_0x110924-0x0;var _0x12905b=_0x222f[_0x110924];return _0x12905b;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(){return function(){return client['Request'](_0xf222('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf222('0x3')],'include':[{'model':_0xf222('0x4'),'as':'Intervals','attributes':['id',_0xf222('0x3'),_0xf222('0x5')]}]},'log':_0xf222('0x1')});};}; \ No newline at end of file +var _0x5aeb=['name','Intervals','interval','../client','Request'];(function(_0x132886,_0x1b56cb){var _0x333c46=function(_0x28aa59){while(--_0x28aa59){_0x132886['push'](_0x132886['shift']());}};_0x333c46(++_0x1b56cb);}(_0x5aeb,0xc6));var _0xb5ae=function(_0x4712fc,_0x46bc42){_0x4712fc=_0x4712fc-0x0;var _0x519794=_0x5aeb[_0x4712fc];return _0x519794;};'use strict';var client=require(_0xb5ae('0x0'));exports['getIntervals']=function(){return function(){return client[_0xb5ae('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb5ae('0x2')],'include':[{'model':'Interval','as':_0xb5ae('0x3'),'attributes':['id','name',_0xb5ae('0x4')]}]},'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 76f2d05..60cc6b9 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 _0x57ca=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x2c868a,_0x1496a0){var _0x15a582=function(_0x5939f0){while(--_0x5939f0){_0x2c868a['push'](_0x2c868a['shift']());}};_0x15a582(++_0x1496a0);}(_0x57ca,0x108));var _0xa57c=function(_0x4948d3,_0x2abf2e){_0x4948d3=_0x4948d3-0x0;var _0x37e81d=_0x57ca[_0x4948d3];return _0x37e81d;};'use strict';var client=require('../client');exports[_0xa57c('0x0')]=function(_0x4ad696,_0x4b1712){return client[_0xa57c('0x1')](_0xa57c('0x2'),{'body':_0x4b1712,'options':{'where':{'id':_0x4ad696}},'log':_0xa57c('0x3')});};exports[_0xa57c('0x4')]=function(_0x1da469,_0x48be2d){return client[_0xa57c('0x1')](_0xa57c('0x5'),{'body':_0x48be2d,'options':{'where':{'id':_0x1da469}},'log':_0xa57c('0x6')});}; \ No newline at end of file +var _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x57c601,_0x3293a2){var _0x10d301=function(_0x37c889){while(--_0x37c889){_0x57c601['push'](_0x57c601['shift']());}};_0x10d301(++_0x3293a2);}(_0x056b,0xb6));var _0xb056=function(_0x15e024,_0x552471){_0x15e024=_0x15e024-0x0;var _0x5747d5=_0x056b[_0x15e024];return _0x5747d5;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c156989..aaf906e 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 _0xb656=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0xb656,0x8e));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6b65('0x0'));exports[_0x6b65('0x1')]=function(_0x11ba74){return client[_0x6b65('0x2')](_0x6b65('0x3'),{'body':_0x11ba74,'log':_0x6b65('0x4')});}; \ No newline at end of file +var _0xb13b=['create','Request','CreateMailMessage','../client'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xb13b,0x187));var _0xbb13=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb13b[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0xbb13('0x0'));exports[_0xbb13('0x1')]=function(_0x31c0a0){return client[_0xbb13('0x2')](_0xbb13('0x3'),{'body':_0x31c0a0,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index fbc1688..a066ceb 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 _0x056f=['GetMailQueue','timeout','User','Agents','online','mailPause','getMailQueues'];(function(_0x55c1f1,_0x30426a){var _0x5344aa=function(_0x33a1b4){while(--_0x33a1b4){_0x55c1f1['push'](_0x55c1f1['shift']());}};_0x5344aa(++_0x30426a);}(_0x056f,0xe0));var _0xf056=function(_0x19d948,_0x41051b){_0x19d948=_0x19d948-0x0;var _0x1e9250=_0x056f[_0x19d948];return _0x1e9250;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request'](_0xf056('0x0'),{'options':{'raw':![],'attributes':['id','name',_0xf056('0x1'),'strategy'],'include':[{'model':_0xf056('0x2'),'as':_0xf056('0x3'),'attributes':['id','name',_0xf056('0x4'),_0xf056('0x5')]}]},'log':_0xf056('0x6')});};}; \ No newline at end of file +var _0xa4bd=['User','Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy'];(function(_0x51fd5c,_0x57108d){var _0x12891d=function(_0x304c64){while(--_0x304c64){_0x51fd5c['push'](_0x51fd5c['shift']());}};_0x12891d(++_0x57108d);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x37ac74,_0x3515f2){_0x37ac74=_0x37ac74-0x0;var _0x980ea7=_0xa4bd[_0x37ac74];return _0x980ea7;};'use strict';var client=require(_0xda4b('0x0'));exports[_0xda4b('0x1')]=function(){return function(){return client[_0xda4b('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xda4b('0x3'),_0xda4b('0x4'),_0xda4b('0x5')],'include':[{'model':_0xda4b('0x6'),'as':_0xda4b('0x7'),'attributes':['id',_0xda4b('0x3'),_0xda4b('0x8'),_0xda4b('0x9')]}]},'log':_0xda4b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 7df138a..e54d6c9 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 _0x59eb=['Request','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x59eb,0x192));var _0xb59e=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x59eb[_0x504df1];return _0x1063b5;};'use strict';var client=require(_0xb59e('0x0'));exports[_0xb59e('0x1')]=function(_0x672af4){return client['Request'](_0xb59e('0x2'),{'body':_0x672af4,'log':_0xb59e('0x2')});};exports[_0xb59e('0x3')]=function(_0x18d10a,_0x21cc05){return client[_0xb59e('0x4')](_0xb59e('0x5'),{'body':_0x21cc05,'options':{'where':{'uniqueid':_0x18d10a},'order':[['id',_0xb59e('0x6')]],'limit':0x1},'log':_0xb59e('0x5')});}; \ No newline at end of file +var _0x1e93=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0xab4fe1,_0x4d267d){var _0x47f7f5=function(_0x26bf46){while(--_0x26bf46){_0xab4fe1['push'](_0xab4fe1['shift']());}};_0x47f7f5(++_0x4d267d);}(_0x1e93,0x1f3));var _0x31e9=function(_0x1e5c55,_0x122f21){_0x1e5c55=_0x1e5c55-0x0;var _0x46c4ae=_0x1e93[_0x1e5c55];return _0x46c4ae;};'use strict';var client=require(_0x31e9('0x0'));exports[_0x31e9('0x1')]=function(_0x543000){return client[_0x31e9('0x2')](_0x31e9('0x3'),{'body':_0x543000,'log':_0x31e9('0x3')});};exports[_0x31e9('0x4')]=function(_0x5f4d8e,_0x10f0ca){return client[_0x31e9('0x2')](_0x31e9('0x5'),{'body':_0x10f0ca,'options':{'where':{'uniqueid':_0x5f4d8e},'order':[['id',_0x31e9('0x6')]],'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 115ab60..7502bc3 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 _0xc927=['update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client'];(function(_0x54fea7,_0x33e39c){var _0x502ed1=function(_0x2980ed){while(--_0x2980ed){_0x54fea7['push'](_0x54fea7['shift']());}};_0x502ed1(++_0x33e39c);}(_0xc927,0x161));var _0x7c92=function(_0x205cdb,_0x57cac3){_0x205cdb=_0x205cdb-0x0;var _0x1d751f=_0xc927[_0x205cdb];return _0x1d751f;};'use strict';var client=require(_0x7c92('0x0'));exports[_0x7c92('0x1')]=function(_0x340496,_0x2ac073){return client[_0x7c92('0x2')](_0x7c92('0x3'),{'body':_0x2ac073,'options':{'where':{'id':_0x340496}},'log':'updateOpenchannelInteraction'});};exports[_0x7c92('0x4')]=function(_0x18ef9e,_0x130594){return client[_0x7c92('0x2')](_0x7c92('0x5'),{'body':_0x130594,'options':{'where':{'id':_0x18ef9e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x38b3=['UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction','update','Request'];(function(_0x4f84b4,_0x3f7390){var _0x11bbee=function(_0x130a1c){while(--_0x130a1c){_0x4f84b4['push'](_0x4f84b4['shift']());}};_0x11bbee(++_0x3f7390);}(_0x38b3,0x198));var _0x338b=function(_0x4a7fa6,_0x83f9c){_0x4a7fa6=_0x4a7fa6-0x0;var _0x459c15=_0x38b3[_0x4a7fa6];return _0x459c15;};'use strict';var client=require('../client');exports[_0x338b('0x0')]=function(_0x4ff108,_0x581981){return client[_0x338b('0x1')](_0x338b('0x2'),{'body':_0x581981,'options':{'where':{'id':_0x4ff108}},'log':'updateOpenchannelInteraction'});};exports[_0x338b('0x3')]=function(_0x15c318,_0x4b6fa7){return client[_0x338b('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x4b6fa7,'options':{'where':{'id':_0x15c318}},'log':_0x338b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b713e69..d63bc8e 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 _0xb6b7=['CreateOpenchannelMessage','createOpenchannelMessage','../client','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb6b7,0x96));var _0x7b6b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb6b7[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x7b6b('0x0'));exports['create']=function(_0xb7fda9){return client[_0x7b6b('0x1')](_0x7b6b('0x2'),{'body':_0xb7fda9,'log':_0x7b6b('0x3')});}; \ No newline at end of file +var _0x1251=['create','Request','createOpenchannelMessage'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1251,0x1d4));var _0x1125=function(_0x2891d0,_0x211acd){_0x2891d0=_0x2891d0-0x0;var _0x51dae9=_0x1251[_0x2891d0];return _0x51dae9;};'use strict';var client=require('../client');exports[_0x1125('0x0')]=function(_0x5115a1){return client[_0x1125('0x1')]('CreateOpenchannelMessage',{'body':_0x5115a1,'log':_0x1125('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5350c3b..cbaf1c2 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 _0x4360=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x4360,0x97));var _0x0436=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x4360[_0x24237f];return _0x48298e;};'use strict';var client=require(_0x0436('0x0'));exports[_0x0436('0x1')]=function(){return function(){return client[_0x0436('0x2')](_0x0436('0x3'),{'options':{'raw':![],'attributes':['id',_0x0436('0x4'),_0x0436('0x5'),_0x0436('0x6')],'include':[{'model':_0x0436('0x7'),'as':_0x0436('0x8'),'attributes':['id',_0x0436('0x4'),_0x0436('0x9'),_0x0436('0xa')]}]},'log':_0x0436('0x1')});};}; \ No newline at end of file +var _0xefb0=['timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x3ca697,_0x43c47a){var _0x1b5992=function(_0x4a918d){while(--_0x4a918d){_0x3ca697['push'](_0x3ca697['shift']());}};_0x1b5992(++_0x43c47a);}(_0xefb0,0x1d4));var _0x0efb=function(_0x5e2c2e,_0x1b969b){_0x5e2c2e=_0x5e2c2e-0x0;var _0x4cd1e2=_0xefb0[_0x5e2c2e];return _0x4cd1e2;};'use strict';var client=require(_0x0efb('0x0'));exports[_0x0efb('0x1')]=function(){return function(){return client[_0x0efb('0x2')](_0x0efb('0x3'),{'options':{'raw':![],'attributes':['id',_0x0efb('0x4'),_0x0efb('0x5'),_0x0efb('0x6')],'include':[{'model':_0x0efb('0x7'),'as':_0x0efb('0x8'),'attributes':['id','name',_0x0efb('0x9'),_0x0efb('0xa')]}]},'log':_0x0efb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e414163..11ca826 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 _0xd526=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xd526,0xee));var _0x6d52=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd526[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x6d52('0x0'));exports[_0x6d52('0x1')]=function(_0x3382e0){return client[_0x6d52('0x2')](_0x6d52('0x3'),{'body':_0x3382e0,'log':_0x6d52('0x3')});};exports['update']=function(_0x360bc3,_0x15264c){return client[_0x6d52('0x2')](_0x6d52('0x4'),{'body':_0x15264c,'options':{'where':{'uniqueid':_0x360bc3},'order':[['id',_0x6d52('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xd09d=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x3c30f6,_0x3f347a){var _0x3d38b9=function(_0x3228b2){while(--_0x3228b2){_0x3c30f6['push'](_0x3c30f6['shift']());}};_0x3d38b9(++_0x3f347a);}(_0xd09d,0x6d));var _0xdd09=function(_0x1966bc,_0x1d6596){_0x1966bc=_0x1966bc-0x0;var _0x2edabd=_0xd09d[_0x1966bc];return _0x2edabd;};'use strict';var client=require('../client');exports[_0xdd09('0x0')]=function(_0x1b7d4c){return client[_0xdd09('0x1')](_0xdd09('0x2'),{'body':_0x1b7d4c,'log':_0xdd09('0x2')});};exports['update']=function(_0x53e5a1,_0x34f6d6){return client[_0xdd09('0x1')](_0xdd09('0x3'),{'body':_0x34f6d6,'options':{'where':{'uniqueid':_0x53e5a1},'order':[['id',_0xdd09('0x4')]],'limit':0x1},'log':_0xdd09('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a60e60d..42becf5 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 _0xe14d=['updateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0x5251f0,_0xc08e2d){var _0x31ff23=function(_0x3f0419){while(--_0x3f0419){_0x5251f0['push'](_0x5251f0['shift']());}};_0x31ff23(++_0xc08e2d);}(_0xe14d,0x1ee));var _0xde14=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xe14d[_0xbe200f];return _0x192597;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b,_0x41974a){return client['Request'](_0xde14('0x2'),{'body':_0x41974a,'options':{'where':{'id':_0x1b5d3b}},'log':_0xde14('0x3')});};exports['addTags']=function(_0x1c3e94,_0x13c24e){return client[_0xde14('0x4')](_0xde14('0x5'),{'body':_0x13c24e,'options':{'where':{'id':_0x1c3e94}},'log':_0xde14('0x6')});}; \ No newline at end of file +var _0xf2cb=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x34190e,_0x50ecc7){var _0x41a4e6=function(_0x4a9ad9){while(--_0x4a9ad9){_0x34190e['push'](_0x34190e['shift']());}};_0x41a4e6(++_0x50ecc7);}(_0xf2cb,0x130));var _0xbf2c=function(_0x151edd,_0x5b2228){_0x151edd=_0x151edd-0x0;var _0x233982=_0xf2cb[_0x151edd];return _0x233982;};'use strict';var client=require('../client');exports[_0xbf2c('0x0')]=function(_0x5e5c76,_0x15aa19){return client['Request'](_0xbf2c('0x1'),{'body':_0x15aa19,'options':{'where':{'id':_0x5e5c76}},'log':'updateSmsInteraction'});};exports[_0xbf2c('0x2')]=function(_0x41c649,_0x5abeb3){return client['Request'](_0xbf2c('0x3'),{'body':_0x5abeb3,'options':{'where':{'id':_0x41c649}},'log':_0xbf2c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 5a6e349..ff49dc5 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 _0x617f=['CreateSmsMessage','createSmsMessage','Request'];(function(_0x454129,_0x2709ec){var _0x41bcc2=function(_0x44f111){while(--_0x44f111){_0x454129['push'](_0x454129['shift']());}};_0x41bcc2(++_0x2709ec);}(_0x617f,0x1b8));var _0xf617=function(_0x123688,_0x1ca3de){_0x123688=_0x123688-0x0;var _0x4e271e=_0x617f[_0x123688];return _0x4e271e;};'use strict';var client=require('../client');exports['create']=function(_0x422479){return client[_0xf617('0x0')](_0xf617('0x1'),{'body':_0x422479,'log':_0xf617('0x2')});}; \ No newline at end of file +var _0xbd63=['createSmsMessage','../client','create'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbd63,0x6d));var _0x3bd6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbd63[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x3bd6('0x0'));exports[_0x3bd6('0x1')]=function(_0x4767ac){return client['Request']('CreateSmsMessage',{'body':_0x4767ac,'log':_0x3bd6('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 04f4523..d88fdf9 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x4054c8,_0x47dbb7){var _0x2dfa00=function(_0x13a6d0){while(--_0x13a6d0){_0x4054c8['push'](_0x4054c8['shift']());}};_0x2dfa00(++_0x47dbb7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'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 +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x12939d,_0x24971d){var _0x38f9ab=function(_0x23a8d5){while(--_0x23a8d5){_0x12939d['push'](_0x12939d['shift']());}};_0x38f9ab(++_0x24971d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6e307e9..4c5e4ee 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x26f518,_0x5a6c2d){var _0x3666d=function(_0x38ef7f){while(--_0x38ef7f){_0x26f518['push'](_0x26f518['shift']());}};_0x3666d(++_0x5a6c2d);}(_0x008c,0x188));var _0xc008=function(_0x163bc9,_0x4b6796){_0x163bc9=_0x163bc9-0x0;var _0xb94e42=_0x008c[_0x163bc9];return _0xb94e42;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x3ca7fe,_0x5e30be){var _0x6e5684=function(_0x179b67){while(--_0x179b67){_0x3ca7fe['push'](_0x3ca7fe['shift']());}};_0x6e5684(++_0x5e30be);}(_0x55ca,0x126));var _0xa55c=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x55ca[_0x46c1d5];return _0x40fe7b;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 76a9153..b7ea403 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(_0x3bc410,_0xa2fd14){var _0x4dd7c4=function(_0x1d380c){while(--_0x1d380c){_0x3bc410['push'](_0x3bc410['shift']());}};_0x4dd7c4(++_0xa2fd14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x3d3ba5,_0x45326a){var _0x2a988a=function(_0x5ca7db){while(--_0x5ca7db){_0x3d3ba5['push'](_0x3d3ba5['shift']());}};_0x2a988a(++_0x45326a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 d0c2e34..61fd15c 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 _0x4351=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x158222,_0x3f658f){var _0xc50be6=function(_0x10782d){while(--_0x10782d){_0x158222['push'](_0x158222['shift']());}};_0xc50be6(++_0x3f658f);}(_0x4351,0x1b5));var _0x1435=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4351[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0x1435('0x0'));exports[_0x1435('0x1')]=function(_0x2fb163,_0x449f8c){return client[_0x1435('0x2')](_0x1435('0x3'),{'body':_0x449f8c,'options':{'where':{'id':_0x2fb163}},'log':_0x1435('0x4')});};exports[_0x1435('0x5')]=function(_0x2fc1f2,_0x2fa227){return client[_0x1435('0x2')](_0x1435('0x6'),{'body':_0x2fa227,'options':{'where':{'id':_0x2fc1f2}},'log':_0x1435('0x7')});}; \ No newline at end of file +var _0x6f44=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6f44,0x1ea));var _0x46f4=function(_0x1d3cf3,_0x5022c5){_0x1d3cf3=_0x1d3cf3-0x0;var _0x4d2844=_0x6f44[_0x1d3cf3];return _0x4d2844;};'use strict';var client=require(_0x46f4('0x0'));exports[_0x46f4('0x1')]=function(_0x50acb0,_0x13d61a){return client[_0x46f4('0x2')](_0x46f4('0x3'),{'body':_0x13d61a,'options':{'where':{'id':_0x50acb0}},'log':_0x46f4('0x4')});};exports[_0x46f4('0x5')]=function(_0x1e2554,_0x26f749){return client[_0x46f4('0x2')](_0x46f4('0x6'),{'body':_0x26f749,'options':{'where':{'id':_0x1e2554}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 37da7ae..6df9067 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 _0x07b5=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x2515f8,_0x38e831){var _0xccb0d6=function(_0x1c5dbc){while(--_0x1c5dbc){_0x2515f8['push'](_0x2515f8['shift']());}};_0xccb0d6(++_0x38e831);}(_0x07b5,0xcc));var _0x507b=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x07b5[_0x47a40b];return _0x19610c;};'use strict';var client=require(_0x507b('0x0'));exports[_0x507b('0x1')]=function(_0x57ff04){return client['Request'](_0x507b('0x2'),{'body':_0x57ff04,'log':_0x507b('0x3')});}; \ No newline at end of file +var _0x0f86=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x2a1523,_0xd0138){var _0x2e2971=function(_0x4fb0b2){while(--_0x4fb0b2){_0x2a1523['push'](_0x2a1523['shift']());}};_0x2e2971(++_0xd0138);}(_0x0f86,0x1c7));var _0x60f8=function(_0x561acd,_0x5d7bbd){_0x561acd=_0x561acd-0x0;var _0x4b1cff=_0x0f86[_0x561acd];return _0x4b1cff;};'use strict';var client=require(_0x60f8('0x0'));exports[_0x60f8('0x1')]=function(_0x209f64){return client[_0x60f8('0x2')](_0x60f8('0x3'),{'body':_0x209f64,'log':_0x60f8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 1642f73..7b34570 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 _0x5ca0=['strategy','User','Agents','online','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x499169,_0x1b9046){var _0x289663=function(_0xe1ea2e){while(--_0xe1ea2e){_0x499169['push'](_0x499169['shift']());}};_0x289663(++_0x1b9046);}(_0x5ca0,0x15c));var _0x05ca=function(_0x27803c,_0x360ea4){_0x27803c=_0x27803c-0x0;var _0x2b4f4b=_0x5ca0[_0x27803c];return _0x2b4f4b;};'use strict';var client=require('../client');exports[_0x05ca('0x0')]=function(){return function(){return client['Request'](_0x05ca('0x1'),{'options':{'raw':![],'attributes':['id',_0x05ca('0x2'),_0x05ca('0x3'),_0x05ca('0x4')],'include':[{'model':_0x05ca('0x5'),'as':_0x05ca('0x6'),'attributes':['id',_0x05ca('0x2'),_0x05ca('0x7'),'whatsappPause']}]},'log':_0x05ca('0x0')});};}; \ No newline at end of file +var _0x1723=['whatsappPause','../client','getWhatsappQueues','Request','name','timeout','strategy','User','online'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x1723,0x12a));var _0x3172=function(_0x11ea47,_0x44e55d){_0x11ea47=_0x11ea47-0x0;var _0x257d2f=_0x1723[_0x11ea47];return _0x257d2f;};'use strict';var client=require(_0x3172('0x0'));exports[_0x3172('0x1')]=function(){return function(){return client[_0x3172('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x3172('0x3'),_0x3172('0x4'),_0x3172('0x5')],'include':[{'model':_0x3172('0x6'),'as':'Agents','attributes':['id',_0x3172('0x3'),_0x3172('0x7'),_0x3172('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 9abf030..1284cab 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 _0x1c89=['CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c89,0x177));var _0x91c8=function(_0xe8668f,_0x42446c){_0xe8668f=_0xe8668f-0x0;var _0xf3d4ff=_0x1c89[_0xe8668f];return _0xf3d4ff;};'use strict';var client=require(_0x91c8('0x0'));exports[_0x91c8('0x1')]=function(_0xf78aa2){return client[_0x91c8('0x2')](_0x91c8('0x3'),{'body':_0xf78aa2,'log':'CreateWhatsappQueueReport'});};exports[_0x91c8('0x4')]=function(_0x556d1f,_0x2f49e0){return client[_0x91c8('0x2')]('UpdateWhatsappQueueReport',{'body':_0x2f49e0,'options':{'where':{'uniqueid':_0x556d1f},'order':[['id',_0x91c8('0x5')]],'limit':0x1},'log':_0x91c8('0x6')});}; \ No newline at end of file +var _0xec22=['update','UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport'];(function(_0x1aa688,_0x5f4153){var _0x5ec3f3=function(_0xb510e3){while(--_0xb510e3){_0x1aa688['push'](_0x1aa688['shift']());}};_0x5ec3f3(++_0x5f4153);}(_0xec22,0xed));var _0x2ec2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xec22[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x2ec2('0x0'));exports['create']=function(_0x2666ea){return client[_0x2ec2('0x1')](_0x2ec2('0x2'),{'body':_0x2666ea,'log':_0x2ec2('0x2')});};exports[_0x2ec2('0x3')]=function(_0x598366,_0xc9fc74){return client['Request'](_0x2ec2('0x4'),{'body':_0xc9fc74,'options':{'where':{'uniqueid':_0x598366},'order':[['id',_0x2ec2('0x5')]],'limit':0x1},'log':_0x2ec2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 524e3d4..ff18337 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 _0xb94a=['number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s','map','join','find','agents','timeout','createQueue','channel','START:%s','rules','end','close','stop','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xb94a,0x1bf));var _0xab94=function(_0xccc017,_0x49f812){_0xccc017=_0xccc017-0x0;var _0x25a344=_0xb94a[_0xccc017];return _0x25a344;};'use strict';var schema=require('validate');var _=require(_0xab94('0x0'));var util=require(_0xab94('0x1'));var seqqueue=require(_0xab94('0x2'));var logger=require(_0xab94('0x3'))(_0xab94('0x4'));var strategy=require(_0xab94('0x5'));var queue=schema({'name':{'type':_0xab94('0x6'),'required':!![],'message':_0xab94('0x7')},'timeout':{'type':_0xab94('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4eb6fd,_0x58a14f,_0x1b63d7){return logger[_0xab94('0x9')](util[_0xab94('0xa')](_0xab94('0xb'),_0x4eb6fd,_0x58a14f[_0xab94('0xc')],_0x1b63d7));}function handleFindAgent(_0x604a92){return function(_0x69805e){return _0x69805e[_0xab94('0xc')]['toLowerCase']()===_0x604a92[_0xab94('0xd')]();};}exports[_0xab94('0xe')]=function(_0x4a1482,_0x45c5af,_0x2cb3a2,_0x4a3e45){return function(_0x2bac99){try{var _0x14db3b={'name':_0x45c5af[0x0],'timeout':_0x45c5af[0x1]};var _0x4be289=queue[_0xab94('0xf')](_0x14db3b,{'typecast':!![]});if(_0x4be289['length']){logger[_0xab94('0x10')](_0xab94('0x11'),_0x4a1482,_[_0xab94('0x12')](_0x4be289,'message')[_0xab94('0x13')](',\x20'));_0x2bac99['stop']();}else{var _0x47b75e=_[_0xab94('0x14')](_0x2cb3a2[_0xab94('0x15')],handleFindAgent(_0x14db3b['name']));if(_0x47b75e){var _0x5886f5=(_0x14db3b[_0xab94('0x16')]||0xa)*0x3e8;var _0x315742,_0x48d6ac;var _0x3d10e7=seqqueue[_0xab94('0x17')](_0x5886f5);_0x3d10e7['id']=_0x4a1482;_0x3d10e7['atimeout']=_0x5886f5;_0x3d10e7[_0xab94('0x18')]=_0x4a3e45[_0xab94('0x18')];writeLog(_0x4a1482,_0x47b75e,util['format'](_0xab94('0x19'),_0x5886f5));_0x2cb3a2[_0xab94('0x1a')][_0x4a1482]['on'](_0xab94('0x1b'),function(){logger[_0xab94('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4a1482);clearTimeout(_0x48d6ac);_0x48d6ac=undefined;_0x3d10e7[_0xab94('0x1c')]();if(_0x2cb3a2[_0xab94('0x1a')][_0x4a1482]){delete _0x2cb3a2[_0xab94('0x1a')][_0x4a1482];}_0x2bac99[_0xab94('0x1d')]();});_0x2cb3a2[_0xab94('0x1a')][_0x4a1482]['on']('complete',function(){if(_0x2cb3a2[_0xab94('0x1a')][_0x4a1482]){delete _0x2cb3a2[_0xab94('0x1a')][_0x4a1482];}});_0x48d6ac=setTimeout(function(){logger['info'](_0xab94('0x1e'),_0x4a1482);clearTimeout(_0x48d6ac);_0x3d10e7[_0xab94('0x1c')]();_0x2bac99['next']();},_0x5886f5);strategy[_0xab94('0x1f')](_0x3d10e7,_0x47b75e,_0x2cb3a2,_0x4a3e45);}else{logger[_0xab94('0x10')](_0xab94('0x20'),_0x4a1482,_0x14db3b['name']);_0x2bac99[_0xab94('0x1d')]();}}}catch(_0x3ef8e5){console['log'](_0x3ef8e5);logger[_0xab94('0x10')](_0xab94('0x21'),_0x4a1482,_0x3ef8e5[_0xab94('0x22')]);_0x2bac99['stop']();}};}; \ No newline at end of file +var _0x43e8=['rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','name','toLowerCase','consequence','length','error','map','message','join','stop','channel','format','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close'];(function(_0x547816,_0x103adb){var _0x573a12=function(_0x5b8ffd){while(--_0x5b8ffd){_0x547816['push'](_0x547816['shift']());}};_0x573a12(++_0x103adb);}(_0x43e8,0x6b));var _0x843e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x43e8[_0x3054be];return _0x3df150;};'use strict';var schema=require(_0x843e('0x0'));var _=require(_0x843e('0x1'));var util=require(_0x843e('0x2'));var seqqueue=require(_0x843e('0x3'));var logger=require(_0x843e('0x4'))(_0x843e('0x5'));var strategy=require(_0x843e('0x6'));var queue=schema({'name':{'type':_0x843e('0x7'),'required':!![],'message':_0x843e('0x8')},'timeout':{'type':_0x843e('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x46dd22,_0x28e45d,_0x3ad1c7){return logger[_0x843e('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x46dd22,_0x28e45d[_0x843e('0xb')],_0x3ad1c7));}function handleFindAgent(_0x557405){return function(_0x2c0710){return _0x2c0710[_0x843e('0xb')][_0x843e('0xc')]()===_0x557405['toLowerCase']();};}exports[_0x843e('0xd')]=function(_0x444abf,_0x4669c9,_0x4eea46,_0x46e865){return function(_0x33b4ca){try{var _0xdb98ba={'name':_0x4669c9[0x0],'timeout':_0x4669c9[0x1]};var _0x1d2dde=queue[_0x843e('0x0')](_0xdb98ba,{'typecast':!![]});if(_0x1d2dde[_0x843e('0xe')]){logger[_0x843e('0xf')]('[%s][AGENT]\x20%s',_0x444abf,_[_0x843e('0x10')](_0x1d2dde,_0x843e('0x11'))[_0x843e('0x12')](',\x20'));_0x33b4ca[_0x843e('0x13')]();}else{var _0x23f63d=_['find'](_0x4eea46['agents'],handleFindAgent(_0xdb98ba[_0x843e('0xb')]));if(_0x23f63d){var _0x29b523=(_0xdb98ba['timeout']||0xa)*0x3e8;var _0x3fa1e7,_0x5ea585;var _0x3d81c9=seqqueue['createQueue'](_0x29b523);_0x3d81c9['id']=_0x444abf;_0x3d81c9['atimeout']=_0x29b523;_0x3d81c9[_0x843e('0x14')]=_0x46e865[_0x843e('0x14')];writeLog(_0x444abf,_0x23f63d,util[_0x843e('0x15')](_0x843e('0x16'),_0x29b523));_0x4eea46['rules'][_0x444abf]['on']('end',function(){logger[_0x843e('0xa')](_0x843e('0x17'),_0x444abf);clearTimeout(_0x5ea585);_0x5ea585=undefined;_0x3d81c9[_0x843e('0x18')]();if(_0x4eea46[_0x843e('0x19')][_0x444abf]){delete _0x4eea46[_0x843e('0x19')][_0x444abf];}_0x33b4ca[_0x843e('0x13')]();});_0x4eea46['rules'][_0x444abf]['on']('complete',function(){if(_0x4eea46[_0x843e('0x19')][_0x444abf]){delete _0x4eea46['rules'][_0x444abf];}});_0x5ea585=setTimeout(function(){logger[_0x843e('0xa')](_0x843e('0x1a'),_0x444abf);clearTimeout(_0x5ea585);_0x3d81c9[_0x843e('0x18')]();_0x33b4ca[_0x843e('0x1b')]();},_0x29b523);strategy[_0x843e('0x1c')](_0x3d81c9,_0x23f63d,_0x4eea46,_0x46e865);}else{logger[_0x843e('0xf')](_0x843e('0x1d'),_0x444abf,_0xdb98ba['name']);_0x33b4ca[_0x843e('0x13')]();}}}catch(_0x2505a4){console[_0x843e('0x1e')](_0x2505a4);logger['error'](_0x843e('0x1f'),_0x444abf,_0x2505a4[_0x843e('0x20')]);_0x33b4ca[_0x843e('0x13')]();}};}; \ 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 e16e9d7..213b7d5 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 _0x4edc=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','postText','error','amazonlex','providerResponse','dialogState','lodash','moment','aws-sdk'];(function(_0x2ebda2,_0x47bab3){var _0x18c824=function(_0x5f05b7){while(--_0x5f05b7){_0x2ebda2['push'](_0x2ebda2['shift']());}};_0x18c824(++_0x47bab3);}(_0x4edc,0xde));var _0xc4ed=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x4edc[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xc4ed('0x0'));var moment=require(_0xc4ed('0x1'));var AWS=require(_0xc4ed('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc4ed('0x3'));var rpc={'chatMessage':require(_0xc4ed('0x4')),'openchannelMessage':require(_0xc4ed('0x5')),'mailMessage':require(_0xc4ed('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc4ed('0x7')),'whatsappMessage':require(_0xc4ed('0x8'))};exports[_0xc4ed('0x9')]=function(_0x21e300,_0x3c07d0){return function(_0x2818ef){try{if(!_[_0xc4ed('0xa')](this[_0xc4ed('0xb')]['UserId'])){logger[_0xc4ed('0xc')]('[%s][AMAZONLEX]\x20%s',_0x21e300,_0xc4ed('0xd'));return _0x2818ef[_0xc4ed('0xe')]();}var _0x8b959f={'ContactId':this[_0xc4ed('0xf')]['id'],'sentAt':moment()['format'](_0xc4ed('0x10')),'direction':_0xc4ed('0x11')};if(this[_0xc4ed('0x12')]==='sms'||this[_0xc4ed('0x12')]===_0xc4ed('0x13')){_0x8b959f[_0xc4ed('0x14')]=this[_0xc4ed('0xb')][_0xc4ed('0x14')];}var _0x456c80=this['channel'];if(_0x456c80===_0xc4ed('0x15')){_0x8b959f[_0xc4ed('0x16')]=this[_0xc4ed('0x17')]['id'];}else{_0x8b959f[_['upperFirst'](_0x456c80)+_0xc4ed('0x18')]=this['account']['id'];}_0x8b959f[_[_0xc4ed('0x19')](_0x456c80)+'InteractionId']=this['interaction']['id'];if(this[_0xc4ed('0xb')][_0xc4ed('0x1a')]){var _0x5de6f4=_0x3c07d0[0x4];if(!_[_0xc4ed('0x1b')](_0x5de6f4)){_0x8b959f[_0xc4ed('0x1c')]=utils[_0xc4ed('0x1d')](_0x5de6f4,this);return rpc[_0x456c80+_0xc4ed('0x1e')][_0xc4ed('0x1f')](_0x8b959f)[_0xc4ed('0x20')](function(_0x18c633){logger[_0xc4ed('0xc')](_0xc4ed('0x21'),_0x21e300,_0x8b959f[_0xc4ed('0x1c')]);})[_0xc4ed('0x22')](function(_0x3cdbe2){logger['error'](_0xc4ed('0x21'),_0x21e300,JSON[_0xc4ed('0x23')](_0x3cdbe2));})['finally'](function(){logger['info'](_0xc4ed('0x24'),_0x21e300);_0x2818ef['stop']();});}else{logger[_0xc4ed('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x21e300);_0x2818ef[_0xc4ed('0x25')]();}}else{var _0x5005a3=this;var _0x1b2ced=new AWS[(_0xc4ed('0x26'))]({'accessKeyId':_0x3c07d0[0x0],'secretAccessKey':_0x3c07d0[0x1],'region':_0x3c07d0[0x2]});var _0x4f322c={'botAlias':'$LATEST','botName':_0x3c07d0[0x3],'inputText':this[_0xc4ed('0x27')][_0xc4ed('0x1c')],'userId':this[_0xc4ed('0x12')]+':'+this[_0xc4ed('0xb')]['id']['toString']()};_0x1b2ced[_0xc4ed('0x28')](_0x4f322c,function(_0x34e935,_0x269ad2){if(_0x34e935){logger[_0xc4ed('0x29')]('[%s][AMAZONLEX]\x20%s',_0x21e300,_0x34e935[_0xc4ed('0x27')]);_0x2818ef['next']();}else if(_0x269ad2&&_0x269ad2['message']){_0x5005a3[_0xc4ed('0x1c')][_0xc4ed('0x2a')]=_0x269ad2;_0x8b959f[_0xc4ed('0x1c')]=_0x269ad2[_0xc4ed('0x27')];_0x8b959f['providerName']=_0xc4ed('0x2a');_0x8b959f[_0xc4ed('0x2b')]=JSON[_0xc4ed('0x23')](_0x269ad2);return rpc[_0x456c80+_0xc4ed('0x1e')][_0xc4ed('0x1f')](_0x8b959f)[_0xc4ed('0x20')](function(_0x43f38a){logger[_0xc4ed('0xc')]('[%s][AMAZONLEX]\x20%s',_0x21e300,_0x8b959f[_0xc4ed('0x1c')]);if(_0x269ad2[_0xc4ed('0x2c')]=='Failed'){_0x2818ef['next']();}else{_0x2818ef[_0xc4ed('0x25')]();}})[_0xc4ed('0x22')](function(_0x58da5e){logger[_0xc4ed('0x29')](_0xc4ed('0x21'),_0x21e300,JSON['stringify'](_0x58da5e));_0x2818ef[_0xc4ed('0xe')]();});}else{_0x2818ef[_0xc4ed('0xe')]();}});}}catch(_0x5056c2){logger[_0xc4ed('0x29')](_0xc4ed('0x21'),_0x21e300,JSON[_0xc4ed('0x23')](_0x5056c2));_0x2818ef[_0xc4ed('0x25')]();}};}; \ No newline at end of file +var _0x0b04=['message','postText','amazonlex','providerResponse','create','dialogState','Failed','stop','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','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','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST'];(function(_0x2d7b3b,_0x558572){var _0x208175=function(_0x3498e1){while(--_0x3498e1){_0x2d7b3b['push'](_0x2d7b3b['shift']());}};_0x208175(++_0x558572);}(_0x0b04,0x112));var _0x40b0=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x0b04[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x40b0('0x0'));var moment=require(_0x40b0('0x1'));var AWS=require(_0x40b0('0x2'));var utils=require(_0x40b0('0x3'));var logger=require(_0x40b0('0x4'))(_0x40b0('0x5'));var rpc={'chatMessage':require(_0x40b0('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x40b0('0x7')),'smsMessage':require(_0x40b0('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x40b0('0x9'))};exports[_0x40b0('0xa')]=function(_0x486c4a,_0x239bdd){return function(_0x1b9b7c){try{if(!_[_0x40b0('0xb')](this['interaction'][_0x40b0('0xc')])){logger[_0x40b0('0xd')](_0x40b0('0xe'),_0x486c4a,_0x40b0('0xf'));return _0x1b9b7c[_0x40b0('0x10')]();}var _0x5344b7={'ContactId':this[_0x40b0('0x11')]['id'],'sentAt':moment()[_0x40b0('0x12')](_0x40b0('0x13')),'direction':_0x40b0('0x14')};if(this[_0x40b0('0x15')]===_0x40b0('0x16')||this[_0x40b0('0x15')]===_0x40b0('0x17')){_0x5344b7[_0x40b0('0x18')]=this[_0x40b0('0x19')]['phone'];}var _0xfa6135=this[_0x40b0('0x15')];if(_0xfa6135===_0x40b0('0x1a')){_0x5344b7[_0x40b0('0x1b')]=this[_0x40b0('0x1c')]['id'];}else{_0x5344b7[_['upperFirst'](_0xfa6135)+'AccountId']=this[_0x40b0('0x1c')]['id'];}_0x5344b7[_[_0x40b0('0x1d')](_0xfa6135)+_0x40b0('0x1e')]=this['interaction']['id'];if(this['interaction'][_0x40b0('0x1f')]){var _0x251320=_0x239bdd[0x4];if(!_[_0x40b0('0x20')](_0x251320)){_0x5344b7[_0x40b0('0x21')]=utils[_0x40b0('0x22')](_0x251320,this);return rpc[_0xfa6135+_0x40b0('0x23')]['create'](_0x5344b7)[_0x40b0('0x24')](function(_0x2029e5){logger['info'](_0x40b0('0xe'),_0x486c4a,_0x5344b7[_0x40b0('0x21')]);})['catch'](function(_0x3546b0){logger[_0x40b0('0x25')](_0x40b0('0xe'),_0x486c4a,JSON[_0x40b0('0x26')](_0x3546b0));})[_0x40b0('0x27')](function(){logger['info'](_0x40b0('0x28'),_0x486c4a);_0x1b9b7c['stop']();});}else{logger['info'](_0x40b0('0x29'),_0x486c4a);_0x1b9b7c['stop']();}}else{var _0x159290=this;var _0x5c84a1=new AWS[(_0x40b0('0x2a'))]({'accessKeyId':_0x239bdd[0x0],'secretAccessKey':_0x239bdd[0x1],'region':_0x239bdd[0x2]});var _0x5ac878={'botAlias':_0x40b0('0x2b'),'botName':_0x239bdd[0x3],'inputText':this[_0x40b0('0x2c')]['body'],'userId':this['channel']+':'+this[_0x40b0('0x19')]['id']['toString']()};_0x5c84a1[_0x40b0('0x2d')](_0x5ac878,function(_0x4717f5,_0x3209d6){if(_0x4717f5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x486c4a,_0x4717f5[_0x40b0('0x2c')]);_0x1b9b7c[_0x40b0('0x10')]();}else if(_0x3209d6&&_0x3209d6['message']){_0x159290['body'][_0x40b0('0x2e')]=_0x3209d6;_0x5344b7['body']=_0x3209d6[_0x40b0('0x2c')];_0x5344b7['providerName']=_0x40b0('0x2e');_0x5344b7[_0x40b0('0x2f')]=JSON['stringify'](_0x3209d6);return rpc[_0xfa6135+_0x40b0('0x23')][_0x40b0('0x30')](_0x5344b7)['then'](function(_0x22a2fe){logger['info'](_0x40b0('0xe'),_0x486c4a,_0x5344b7[_0x40b0('0x21')]);if(_0x3209d6[_0x40b0('0x31')]==_0x40b0('0x32')){_0x1b9b7c[_0x40b0('0x10')]();}else{_0x1b9b7c[_0x40b0('0x33')]();}})[_0x40b0('0x34')](function(_0x3a9055){logger['error']('[%s][AMAZONLEX]\x20%s',_0x486c4a,JSON[_0x40b0('0x26')](_0x3a9055));_0x1b9b7c[_0x40b0('0x10')]();});}else{_0x1b9b7c['next']();}});}}catch(_0xd7a4e9){logger[_0x40b0('0x25')](_0x40b0('0xe'),_0x486c4a,JSON[_0x40b0('0x26')](_0xd7a4e9));_0x1b9b7c[_0x40b0('0x33')]();}};}; \ 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 901f11c..9648d90 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 _0xb463=['catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','autoreplyExecuted','Interaction','update','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','out','mail','getMustacheRender','message','from','phone','read','subject','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','inReplyTo','html','','replace','','auto-replied','All','auto_reply','smtpOptions','then','messageId','error','stringify','finally','resolve'];(function(_0x50e427,_0x2cdc0e){var _0x433bf7=function(_0x39aa67){while(--_0x39aa67){_0x50e427['push'](_0x50e427['shift']());}};_0x433bf7(++_0x2cdc0e);}(_0xb463,0x192));var _0x3b46=function(_0x25c1bd,_0x2b9085){_0x25c1bd=_0x25c1bd-0x0;var _0x1eea5f=_0xb463[_0x25c1bd];return _0x1eea5f;};'use strict';var _=require(_0x3b46('0x0'));var moment=require(_0x3b46('0x1'));var utils=require(_0x3b46('0x2'));var logger=require(_0x3b46('0x3'))(_0x3b46('0x4'));var rpc={'chatMessage':require(_0x3b46('0x5')),'openchannelMessage':require(_0x3b46('0x6')),'mailMessage':require(_0x3b46('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3b46('0x8')),'whatsappMessage':require(_0x3b46('0x9')),'chatInteraction':require(_0x3b46('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x3b46('0xb')),'smsInteraction':require(_0x3b46('0xc')),'faxInteraction':require(_0x3b46('0xd')),'whatsappInteraction':require(_0x3b46('0xe'))};var mailRpc=require(_0x3b46('0xf'));exports[_0x3b46('0x10')]=function(_0x27ef03,_0x2e0c95,_0x465e2a,_0x2074bd){return function(_0x458705){try{var _0x35046c=this[_0x3b46('0x11')];if(_0x35046c==='mail'&&_0x2074bd[_0x3b46('0x12')][_0x3b46('0x13')]){logger[_0x3b46('0x14')](_0x3b46('0x15'),_0x27ef03,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x458705[_0x3b46('0x16')]();}if(_0x2e0c95[0x0]==='1'&&(_['isNil'](this[_0x3b46('0x17')][_0x3b46('0x18')])||!this['interaction'][_0x3b46('0x18')])){logger[_0x3b46('0x14')](_0x3b46('0x15'),_0x27ef03,_0x3b46('0x19'));return _0x458705['next']();}if(_0x2e0c95[0x0]==='2'&&this[_0x3b46('0x17')]['autoreplyExecuted']){logger[_0x3b46('0x14')](_0x3b46('0x1a'),_0x27ef03,_0x3b46('0x1b'));return _0x458705[_0x3b46('0x16')]();}var _0xffc459={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3b46('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3b46('0x1d')};if(this['channel']===_0x3b46('0x1e')){_0xffc459['body']=utils[_0x3b46('0x1f')](_0x2e0c95[0x2],this);}else{_0xffc459[_0x3b46('0x12')]=utils[_0x3b46('0x1f')](_0x2e0c95[0x1],this);}if(this[_0x3b46('0x20')]){_0xffc459['to']=this[_0x3b46('0x20')]['from']||'';if(this[_0x3b46('0x11')]==='mail'&&_0x2e0c95[0x1]==='1'){_0xffc459['cc']=this[_0x3b46('0x20')]['cc']||'';}_0xffc459[_0x3b46('0x21')]=this[_0x3b46('0x20')]['to']||'';_0xffc459[_0x3b46('0x22')]=this[_0x3b46('0x20')][_0x3b46('0x22')]||'';_0xffc459[_0x3b46('0x23')]=!![];if(this[_0x3b46('0x20')][_0x3b46('0x24')]){_0xffc459[_0x3b46('0x24')]='';_0xffc459[_0x3b46('0x24')]+=_['startsWith'](this[_0x3b46('0x20')][_0x3b46('0x24')],_0x3b46('0x25'))?'':'Re:\x20';_0xffc459['subject']+=this[_0x3b46('0x20')][_0x3b46('0x24')];}}if(this['channel']===_0x3b46('0x26')){_0xffc459[_0x3b46('0x27')]=this['account']['id'];}else{_0xffc459[_[_0x3b46('0x28')](this[_0x3b46('0x11')])+_0x3b46('0x29')]=this[_0x3b46('0x2a')]['id'];}_0xffc459[_[_0x3b46('0x28')](this['channel'])+_0x3b46('0x2b')]=this['interaction']['id'];var _0x3c08f7=this['interaction'];if(rpc[this[_0x3b46('0x11')]+_0x3b46('0x2c')]){if(this[_0x3b46('0x11')]===_0x3b46('0x1e')){_0xffc459[_0x3b46('0x2d')]=this[_0x3b46('0x20')]['messageId'];_0xffc459[_0x3b46('0x2e')]=_0x3b46('0x2f')+_[_0x3b46('0x30')](_0xffc459[_0x3b46('0x12')],'','replace','','headers','auto-replied','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','resolve','update','stringify','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','finally','Interaction','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format'];(function(_0x383032,_0x3a41f3){var _0x39ce3b=function(_0x508cd8){while(--_0x508cd8){_0x383032['push'](_0x383032['shift']());}};_0x39ce3b(++_0x3a41f3);}(_0x10e3,0x1df));var _0x310e=function(_0x14bb43,_0x512b78){_0x14bb43=_0x14bb43-0x0;var _0x1737a3=_0x10e3[_0x14bb43];return _0x1737a3;};'use strict';var _=require(_0x310e('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x310e('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x310e('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x310e('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x310e('0x4')),'openchannelInteraction':require(_0x310e('0x5')),'mailInteraction':require(_0x310e('0x6')),'smsInteraction':require(_0x310e('0x7')),'faxInteraction':require(_0x310e('0x8')),'whatsappInteraction':require(_0x310e('0x9'))};var mailRpc=require(_0x310e('0xa'));exports['consequence']=function(_0x32d13a,_0x10a7ef,_0x14f362,_0x4b24fa){return function(_0x563919){try{var _0x48d1e1=this['channel'];if(_0x48d1e1===_0x310e('0xb')&&_0x4b24fa[_0x310e('0xc')]['isAutoreply']){logger[_0x310e('0xd')](_0x310e('0xe'),_0x32d13a,_0x310e('0xf'));return _0x563919[_0x310e('0x10')]();}if(_0x10a7ef[0x0]==='1'&&(_[_0x310e('0x11')](this['interaction']['created'])||!this['interaction'][_0x310e('0x12')])){logger[_0x310e('0xd')](_0x310e('0xe'),_0x32d13a,_0x310e('0x13'));return _0x563919[_0x310e('0x10')]();}if(_0x10a7ef[0x0]==='2'&&this['interaction'][_0x310e('0x14')]){logger[_0x310e('0xd')](_0x310e('0x15'),_0x32d13a,_0x310e('0x16'));return _0x563919['next']();}var _0x261bf3={'ContactId':this[_0x310e('0x17')]['id'],'sentAt':moment()[_0x310e('0x18')](_0x310e('0x19')),'direction':'out'};if(this[_0x310e('0x1a')]===_0x310e('0xb')){_0x261bf3[_0x310e('0xc')]=utils['getMustacheRender'](_0x10a7ef[0x2],this);}else{_0x261bf3[_0x310e('0xc')]=utils[_0x310e('0x1b')](_0x10a7ef[0x1],this);}if(this[_0x310e('0x1c')]){_0x261bf3['to']=this[_0x310e('0x1c')]['from']||'';if(this[_0x310e('0x1a')]===_0x310e('0xb')&&_0x10a7ef[0x1]==='1'){_0x261bf3['cc']=this[_0x310e('0x1c')]['cc']||'';}_0x261bf3[_0x310e('0x1d')]=this[_0x310e('0x1c')]['to']||'';_0x261bf3[_0x310e('0x1e')]=this[_0x310e('0x1c')][_0x310e('0x1e')]||'';_0x261bf3[_0x310e('0x1f')]=!![];if(this[_0x310e('0x1c')]['subject']){_0x261bf3[_0x310e('0x20')]='';_0x261bf3['subject']+=_['startsWith'](this[_0x310e('0x1c')][_0x310e('0x20')],_0x310e('0x21'))?'':_0x310e('0x22');_0x261bf3['subject']+=this[_0x310e('0x1c')][_0x310e('0x20')];}}if(this[_0x310e('0x1a')]===_0x310e('0x23')){_0x261bf3[_0x310e('0x24')]=this[_0x310e('0x25')]['id'];}else{_0x261bf3[_[_0x310e('0x26')](this[_0x310e('0x1a')])+'AccountId']=this[_0x310e('0x25')]['id'];}_0x261bf3[_[_0x310e('0x26')](this[_0x310e('0x1a')])+_0x310e('0x27')]=this[_0x310e('0x28')]['id'];var _0x4d60b6=this[_0x310e('0x28')];if(rpc[this['channel']+_0x310e('0x29')]){if(this[_0x310e('0x1a')]===_0x310e('0xb')){_0x261bf3['inReplyTo']=this[_0x310e('0x1c')][_0x310e('0x2a')];_0x261bf3[_0x310e('0x2b')]=_0x310e('0x2c')+_[_0x310e('0x2d')](_0x261bf3[_0x310e('0xc')],']+(>|$)/g,''),'priorityTrue':_0x3d5d27[0x1],'priorityFalse':_0x3d5d27[0x2]};var _0x402334=gotoif[_0x3a41('0x0')](_0x2dba39,{'typecast':!![]});if(_0x402334['length']){logger[_0x3a41('0xc')]('[%s][GOTOIF]\x20%s',_0x1ff93d,_[_0x3a41('0xd')](_0x402334,_0x3a41('0xe'))['join'](',\x20'));_0x3003db['stop']();}else{try{var _0x2efed3=eval('('+_0x2dba39['condition']+')');var _0x1056fb=_0x2efed3?_0x2dba39['priorityTrue']:_0x2dba39[_0x3a41('0xf')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1ff93d,_0x2dba39[_0x3a41('0x10')],_0x2efed3,_0x1056fb||'next');if(_0x1056fb){var _0x21bb04=_['findIndex'](_0x3003db[_0x3a41('0x11')](),{'p':_0x1056fb});if(_0x21bb04>=0x0){logger[_0x3a41('0x12')](_0x3a41('0x13'),_0x1ff93d,_0x1056fb||'next',_0x21bb04);_0x3003db[_0x3a41('0x14')](_0x21bb04);}else{logger['info'](_0x3a41('0x15'),_0x1ff93d,_0x1056fb||'next');_0x3003db[_0x3a41('0x16')]();}}else{_0x3003db[_0x3a41('0x14')]();}}catch(_0x524d88){logger[_0x3a41('0xc')](_0x3a41('0x17'),_0x1ff93d,_0x524d88[_0x3a41('0xe')]);_0x3003db[_0x3a41('0x16')]();}}}catch(_0x45dcd0){logger[_0x3a41('0xc')](_0x3a41('0x18'),_0x1ff93d,JSON[_0x3a41('0x19')](_0x45dcd0));_0x3003db[_0x3a41('0x16')]();}};}; \ No newline at end of file +var _0xd06f=['next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','validate','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition'];(function(_0xcaf72b,_0x56f381){var _0xfa4092=function(_0x1c272c){while(--_0x1c272c){_0xcaf72b['push'](_0xcaf72b['shift']());}};_0xfa4092(++_0x56f381);}(_0xd06f,0x164));var _0xfd06=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xd06f[_0x7b173];return _0x1c598c;};'use strict';var schema=require(_0xfd06('0x0'));var _=require(_0xfd06('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xfd06('0x2'));var logger=require(_0xfd06('0x3'))(_0xfd06('0x4'));var gotoif=schema({'condition':{'type':_0xfd06('0x5'),'required':!![],'message':_0xfd06('0x6')},'priorityTrue':{'type':_0xfd06('0x7'),'message':_0xfd06('0x8')},'priorityFalse':{'type':_0xfd06('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xfd06('0x9')]=function(_0x1d1c3c,_0x225225){return function(_0x39d038){try{var _0x2ecbfa={'condition':htmlToText[_0xfd06('0xa')](utils['getMustacheRender'](_0x225225[0x0],this),{'wordwrap':![]})[_0xfd06('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x225225[0x1],'priorityFalse':_0x225225[0x2]};var _0x491e94=gotoif[_0xfd06('0x0')](_0x2ecbfa,{'typecast':!![]});if(_0x491e94['length']){logger[_0xfd06('0xc')](_0xfd06('0xd'),_0x1d1c3c,_[_0xfd06('0xe')](_0x491e94,'message')[_0xfd06('0xf')](',\x20'));_0x39d038[_0xfd06('0x10')]();}else{try{var _0x129161=eval('('+_0x2ecbfa['condition']+')');var _0x340d54=_0x129161?_0x2ecbfa[_0xfd06('0x11')]:_0x2ecbfa[_0xfd06('0x12')];logger[_0xfd06('0x13')](_0xfd06('0x14'),_0x1d1c3c,_0x2ecbfa[_0xfd06('0x15')],_0x129161,_0x340d54||_0xfd06('0x16'));if(_0x340d54){var _0x52b097=_['findIndex'](_0x39d038[_0xfd06('0x17')](),{'p':_0x340d54});if(_0x52b097>=0x0){logger[_0xfd06('0x13')](_0xfd06('0x18'),_0x1d1c3c,_0x340d54||_0xfd06('0x16'),_0x52b097);_0x39d038[_0xfd06('0x16')](_0x52b097);}else{logger[_0xfd06('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1d1c3c,_0x340d54||_0xfd06('0x16'));_0x39d038[_0xfd06('0x10')]();}}else{_0x39d038['next']();}}catch(_0x23cbc2){logger[_0xfd06('0xc')](_0xfd06('0x19'),_0x1d1c3c,_0x23cbc2[_0xfd06('0x1a')]);_0x39d038[_0xfd06('0x10')]();}}}catch(_0x16fe6b){logger[_0xfd06('0xc')](_0xfd06('0xd'),_0x1d1c3c,JSON['stringify'](_0x16fe6b));_0x39d038[_0xfd06('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 f4a5ac6..39572ea 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 _0xd0a9=['validate','length','[%s][GOTOP]\x20%s','map','join','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','stop','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x415591,_0x203800){var _0x33957b=function(_0x410c98){while(--_0x410c98){_0x415591['push'](_0x415591['shift']());}};_0x33957b(++_0x203800);}(_0xd0a9,0x113));var _0x9d0a=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xd0a9[_0x420b24];return _0x4da552;};'use strict';var schema=require('validate');var _=require(_0x9d0a('0x0'));var logger=require('../../../../config/logger')(_0x9d0a('0x1'));var gotop=schema({'priority':{'type':_0x9d0a('0x2'),'required':!![],'message':_0x9d0a('0x3')}});exports[_0x9d0a('0x4')]=function(_0x5b71e4,_0xf2ef7f){return function(_0x89d7ed){try{var _0x34bf03={'priority':_0xf2ef7f[0x0]};var _0xb3787c=gotop[_0x9d0a('0x5')](_0x34bf03,{'typecast':!![]});if(_0xb3787c[_0x9d0a('0x6')]){logger['error'](_0x9d0a('0x7'),_0x5b71e4,_[_0x9d0a('0x8')](_0xb3787c,'message')[_0x9d0a('0x9')](',\x20'));_0x89d7ed['stop']();}else{logger['info'](_0x9d0a('0xa'),_0x5b71e4,_0x34bf03[_0x9d0a('0xb')]);if(_0x34bf03[_0x9d0a('0xb')]){var _0x583a9f=_['findIndex'](_0x89d7ed[_0x9d0a('0xc')](),{'p':_0x34bf03['priority']});if(_0x583a9f>=0x0){logger[_0x9d0a('0xd')](_0x9d0a('0xe'),_0x5b71e4,_0x34bf03[_0x9d0a('0xb')]||'next',_0x583a9f);_0x89d7ed[_0x9d0a('0xf')](_0x583a9f);}else{logger[_0x9d0a('0xd')](_0x9d0a('0x10'),_0x5b71e4,_0x34bf03['priority']||'next');_0x89d7ed['stop']();}}else{_0x89d7ed[_0x9d0a('0xf')]();}}}catch(_0x33b2cf){logger[_0x9d0a('0x11')](_0x9d0a('0x7'),_0x5b71e4,JSON[_0x9d0a('0x12')](_0x33b2cf));_0x89d7ed[_0x9d0a('0x13')]();}};}; \ No newline at end of file +var _0xb78a=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash'];(function(_0x4b3661,_0x1be781){var _0x582d0c=function(_0x1a1ee4){while(--_0x1a1ee4){_0x4b3661['push'](_0x4b3661['shift']());}};_0x582d0c(++_0x1be781);}(_0xb78a,0x8a));var _0xab78=function(_0xf4a734,_0x1a4fe7){_0xf4a734=_0xf4a734-0x0;var _0x10ee33=_0xb78a[_0xf4a734];return _0x10ee33;};'use strict';var schema=require(_0xab78('0x0'));var _=require(_0xab78('0x1'));var logger=require(_0xab78('0x2'))(_0xab78('0x3'));var gotop=schema({'priority':{'type':_0xab78('0x4'),'required':!![],'message':_0xab78('0x5')}});exports[_0xab78('0x6')]=function(_0x47c944,_0x568cde){return function(_0x492b35){try{var _0x2d3cfe={'priority':_0x568cde[0x0]};var _0x12e5dd=gotop[_0xab78('0x0')](_0x2d3cfe,{'typecast':!![]});if(_0x12e5dd[_0xab78('0x7')]){logger['error'](_0xab78('0x8'),_0x47c944,_['map'](_0x12e5dd,_0xab78('0x9'))[_0xab78('0xa')](',\x20'));_0x492b35[_0xab78('0xb')]();}else{logger[_0xab78('0xc')](_0xab78('0xd'),_0x47c944,_0x2d3cfe[_0xab78('0xe')]);if(_0x2d3cfe[_0xab78('0xe')]){var _0x2b2535=_['findIndex'](_0x492b35['rules'](),{'p':_0x2d3cfe[_0xab78('0xe')]});if(_0x2b2535>=0x0){logger['info'](_0xab78('0xf'),_0x47c944,_0x2d3cfe['priority']||_0xab78('0x10'),_0x2b2535);_0x492b35[_0xab78('0x10')](_0x2b2535);}else{logger[_0xab78('0xc')](_0xab78('0x11'),_0x47c944,_0x2d3cfe[_0xab78('0xe')]||_0xab78('0x10'));_0x492b35[_0xab78('0xb')]();}}else{_0x492b35[_0xab78('0x10')]();}}}catch(_0x4b35be){logger[_0xab78('0x12')](_0xab78('0x8'),_0x47c944,JSON[_0xab78('0x13')](_0x4b35be));_0x492b35['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 b1c7281..1347e91 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 _0xf32e=['then','info','[%s][MESSAGE]\x20%s','next','catch','stringify','error','stop','lodash','./utils','../../../../config/logger','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','interaction','Message','create'];(function(_0x50b914,_0x24b4c1){var _0x1f729b=function(_0x52ff0a){while(--_0x52ff0a){_0x50b914['push'](_0x50b914['shift']());}};_0x1f729b(++_0x24b4c1);}(_0xf32e,0x110));var _0xef32=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0xf32e[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0xef32('0x0'));var utils=require(_0xef32('0x1'));var logger=require(_0xef32('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xef32('0x3')),'whatsappMessage':require(_0xef32('0x4'))};exports[_0xef32('0x5')]=function(_0x48b29c,_0x52b090){return function(_0x57b683){try{var _0x5aef88={'body':utils[_0xef32('0x6')](_0x52b090[0x0],this),'ContactId':this[_0xef32('0x7')]['id']};if(this[_0xef32('0x8')]===_0xef32('0x9')){_0x5aef88[_0xef32('0xa')]=this[_0xef32('0xb')]['id'];}else{_0x5aef88[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5aef88[_[_0xef32('0xc')](this[_0xef32('0x8')])+'InteractionId']=this[_0xef32('0xd')]['id'];if(rpc[this[_0xef32('0x8')]+_0xef32('0xe')]){return rpc[this[_0xef32('0x8')]+_0xef32('0xe')][_0xef32('0xf')](_0x5aef88)[_0xef32('0x10')](function(_0x26748d){logger[_0xef32('0x11')](_0xef32('0x12'),_0x48b29c,_0x5aef88['body']);_0x57b683[_0xef32('0x13')]();})[_0xef32('0x14')](function(_0x35cc2c){logger['error'](_0xef32('0x12'),_0x48b29c,JSON[_0xef32('0x15')](_0x35cc2c));_0x57b683['stop']();});}}catch(_0x10b493){logger[_0xef32('0x16')]('[%s][MESSAGE]\x20%s',_0x48b29c,JSON[_0xef32('0x15')](_0x10b493));_0x57b683[_0xef32('0x17')]();}};}; \ No newline at end of file +var _0x6a5f=['stringify','stop','error','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','catch'];(function(_0x1378eb,_0x84dc70){var _0x4ffc19=function(_0x296566){while(--_0x296566){_0x1378eb['push'](_0x1378eb['shift']());}};_0x4ffc19(++_0x84dc70);}(_0x6a5f,0xbb));var _0xf6a5=function(_0x345865,_0x1d878d){_0x345865=_0x345865-0x0;var _0x2e14f4=_0x6a5f[_0x345865];return _0x2e14f4;};'use strict';var _=require(_0xf6a5('0x0'));var utils=require(_0xf6a5('0x1'));var logger=require('../../../../config/logger')(_0xf6a5('0x2'));var rpc={'chatMessage':require(_0xf6a5('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf6a5('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf6a5('0x5'))};exports['consequence']=function(_0x5e7da8,_0x295c72){return function(_0x556571){try{var _0x3560d0={'body':utils[_0xf6a5('0x6')](_0x295c72[0x0],this),'ContactId':this[_0xf6a5('0x7')]['id']};if(this[_0xf6a5('0x8')]===_0xf6a5('0x9')){_0x3560d0[_0xf6a5('0xa')]=this[_0xf6a5('0xb')]['id'];}else{_0x3560d0[_[_0xf6a5('0xc')](this[_0xf6a5('0x8')])+'AccountId']=this[_0xf6a5('0xb')]['id'];}_0x3560d0[_[_0xf6a5('0xc')](this[_0xf6a5('0x8')])+_0xf6a5('0xd')]=this[_0xf6a5('0xe')]['id'];if(rpc[this[_0xf6a5('0x8')]+_0xf6a5('0xf')]){return rpc[this['channel']+_0xf6a5('0xf')][_0xf6a5('0x10')](_0x3560d0)[_0xf6a5('0x11')](function(_0x1e59fe){logger['info'](_0xf6a5('0x12'),_0x5e7da8,_0x3560d0['body']);_0x556571['next']();})[_0xf6a5('0x13')](function(_0xcd58e3){logger['error'](_0xf6a5('0x12'),_0x5e7da8,JSON[_0xf6a5('0x14')](_0xcd58e3));_0x556571[_0xf6a5('0x15')]();});}}catch(_0x18a053){logger[_0xf6a5('0x16')](_0xf6a5('0x12'),_0x5e7da8,JSON[_0xf6a5('0x14')](_0x18a053));_0x556571['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 00b8a70..d69b199 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 _0xd71c=['./utils','../../../../config/logger','routing','[%s][NOOP]\x20%s','next','error','stringify','stop'];(function(_0x20f2a4,_0x197964){var _0x3b133a=function(_0x560b6b){while(--_0x560b6b){_0x20f2a4['push'](_0x20f2a4['shift']());}};_0x3b133a(++_0x197964);}(_0xd71c,0x148));var _0xcd71=function(_0x13f0af,_0xcbe717){_0x13f0af=_0x13f0af-0x0;var _0x361527=_0xd71c[_0x13f0af];return _0x361527;};'use strict';var utils=require(_0xcd71('0x0'));var logger=require(_0xcd71('0x1'))(_0xcd71('0x2'));exports['consequence']=function(_0x116f1e,_0x1ecef7){return function(_0x2fa67e){try{logger['info'](_0xcd71('0x3'),_0x116f1e,utils['getMustacheRender'](_0x1ecef7[0x0],this));_0x2fa67e[_0xcd71('0x4')]();}catch(_0xc0d4e6){logger[_0xcd71('0x5')](_0xcd71('0x3'),_0x116f1e,JSON[_0xcd71('0x6')](_0xc0d4e6));_0x2fa67e[_0xcd71('0x7')]();}};}; \ No newline at end of file +var _0xfb3e=['routing','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xfb3e,0x167));var _0xefb3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfb3e[_0x397e5f];return _0x5302b8;};'use strict';var utils=require(_0xefb3('0x0'));var logger=require('../../../../config/logger')(_0xefb3('0x1'));exports['consequence']=function(_0x3ff825,_0x227050){return function(_0x36a19e){try{logger[_0xefb3('0x2')](_0xefb3('0x3'),_0x3ff825,utils[_0xefb3('0x4')](_0x227050[0x0],this));_0x36a19e[_0xefb3('0x5')]();}catch(_0x4b551b){logger[_0xefb3('0x6')](_0xefb3('0x3'),_0x3ff825,JSON[_0xefb3('0x7')](_0x4b551b));_0x36a19e[_0xefb3('0x8')]();}};}; \ 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 ed42691..ec77849 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 _0x7e0b=['interaction','upperFirst','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','waiting','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','message','error','toLowerCase','validate','[%s][QUEUE]\x20%s','join','find','createQueue','atimeout','rules','stop','complete','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','../../../../config/environment','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','InteractionId'];(function(_0xc2dbf6,_0x15f1b8){var _0x3b4ef2=function(_0x5a8419){while(--_0x5a8419){_0xc2dbf6['push'](_0xc2dbf6['shift']());}};_0x3b4ef2(++_0x15f1b8);}(_0x7e0b,0x149));var _0xb7e0=function(_0x17bd2e,_0x198e34){_0x17bd2e=_0x17bd2e-0x0;var _0x19c416=_0x7e0b[_0x17bd2e];return _0x19c416;};'use strict';var schema=require('validate');var _=require(_0xb7e0('0x0'));var util=require(_0xb7e0('0x1'));var seqqueue=require(_0xb7e0('0x2'));var moment=require(_0xb7e0('0x3'));var Redis=require('ioredis');var config=require(_0xb7e0('0x4'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xb7e0('0x5'));config[_0xb7e0('0x6')]=_[_0xb7e0('0x7')](config['redis'],{'host':_0xb7e0('0x8'),'port':0x18eb});var io=require(_0xb7e0('0x9'))(new Redis(config[_0xb7e0('0x6')]));var attributes=['id',_0xb7e0('0xa'),_0xb7e0('0xb'),_0xb7e0('0xc'),'from',_0xb7e0('0xd')];function emit(_0x3c35bc,_0x4279da,_0x500573){io['to'](_0x3c35bc)['emit'](_0x4279da,_0x500573);}function emitChannelQueueInteraction(_0x41e22b,_0x248386,_0x7ab55e,_0x3cdbb5,_0x20717d,_0x4dae49,_0x5e3ad1,_0x1e5eaa){var _0x3036da=_[_0xb7e0('0xe')](_0x7ab55e);_0x3036da[_0xb7e0('0xa')]=_0x1e5eaa;_0x3036da[_0xb7e0('0xc')]=_0x248386;_0x3036da[_0xb7e0('0xb')]=_0x3cdbb5;_0x3036da['id']=_0x20717d;if(_0x4dae49){_0x5e3ad1[util[_0xb7e0('0xf')](_0xb7e0('0x10'),_0x41e22b)][_0x20717d]=_['pick'](_0x3036da,attributes);}else{delete _0x5e3ad1[util['format'](_0xb7e0('0x10'),_0x41e22b)][_0x20717d];}emit(util[_0xb7e0('0xf')]('%s:queue:%s',_0x41e22b,_0x248386),util['format'](_0xb7e0('0x11'),_0x41e22b,_0x4dae49?_0xb7e0('0x12'):_0xb7e0('0x13')),_[_0xb7e0('0x14')](_0x3036da,attributes));}var rpc={'openchannelQueueReport':require(_0xb7e0('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xb7e0('0x16')),'faxQueueReport':require(_0xb7e0('0x17')),'whatsappQueueReport':require(_0xb7e0('0x18'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xb7e0('0x19')},'timeout':{'type':_0xb7e0('0x1a'),'message':_0xb7e0('0x1b')}});function startRouting(_0x536d9c,_0x35a6bf,_0x304b0f,_0x42e20b){if(_0x536d9c&&_0x35a6bf&&_0x304b0f){_0x35a6bf['waiting']+=0x1;var _0x336224={'uniqueid':_0x536d9c,'from':_0x304b0f['body']?_0x304b0f[_0xb7e0('0x1c')][_0xb7e0('0x1d')]:'','joinAt':moment()['format'](_0xb7e0('0x1e')),'ContactId':_0x304b0f[_0xb7e0('0x1f')]?_0x304b0f[_0xb7e0('0x1f')]['id']:null,'ListId':_0x304b0f[_0xb7e0('0x20')]?_0x304b0f[_0xb7e0('0x20')]['id']:null};_0x336224[_['upperFirst'](_0x304b0f[_0xb7e0('0x21')])+_0xb7e0('0x22')]=_0x35a6bf['id']||null;_0x336224[_['upperFirst'](_0x304b0f[_0xb7e0('0x21')])+_0xb7e0('0x23')]=_0x304b0f[_0xb7e0('0x24')]?_0x304b0f[_0xb7e0('0x24')]['id']:null;_0x336224[_[_0xb7e0('0x25')](_0x304b0f[_0xb7e0('0x21')])+'MessageId']=_0x304b0f['message']?_0x304b0f['message']['id']:null;_0x336224[_[_0xb7e0('0x25')](_0x304b0f[_0xb7e0('0x21')])+(_0x304b0f['channel']!==_0xb7e0('0x26')?_0xb7e0('0x27'):_0xb7e0('0x28'))]=_0x304b0f[_0xb7e0('0xb')]?_0x304b0f[_0xb7e0('0xb')]['id']:null;logger['info'](util[_0xb7e0('0xf')](_0xb7e0('0x29'),_0x536d9c,_0x35a6bf[_0xb7e0('0x2a')]));emitChannelQueueInteraction(_0x304b0f[_0xb7e0('0x21')],_0x35a6bf[_0xb7e0('0x2a')],_0x336224,_0x304b0f['account']['name'],_0x304b0f['message']['id'],!![],_0x42e20b,_0x35a6bf['id']);if(rpc[_0x304b0f[_0xb7e0('0x21')]+'QueueReport']){return rpc[_0x304b0f[_0xb7e0('0x21')]+_0xb7e0('0x2b')][_0xb7e0('0x2c')](_0x336224)['catch'](function(_0x5123f7){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x2bf03b,_0x292ab3,_0x3b2d44,_0x4bbf7c){if(_0x2bf03b&&_0x292ab3){_0x292ab3[_0xb7e0('0x2d')]-=0x1;var _0x6ee32a={'leaveAt':moment()['format'](_0xb7e0('0x1e')),'acceptAt':moment()['format'](_0xb7e0('0x1e')),'reason':_0xb7e0('0x2e')};logger[_0xb7e0('0x2f')](util[_0xb7e0('0xf')](_0xb7e0('0x30'),_0x2bf03b,_0x292ab3[_0xb7e0('0x2a')]));emitChannelQueueInteraction(_0x3b2d44[_0xb7e0('0x21')],_0x292ab3[_0xb7e0('0x2a')],_0x3b2d44[_0xb7e0('0x1c')],_0x3b2d44[_0xb7e0('0xb')][_0xb7e0('0x2a')],_0x3b2d44['message']['id'],![],_0x4bbf7c,_0x292ab3['id']);if(rpc[_0x3b2d44[_0xb7e0('0x21')]+_0xb7e0('0x2b')]){return rpc[_0x3b2d44['channel']+_0xb7e0('0x2b')][_0xb7e0('0x31')](_0x2bf03b,_0x6ee32a)[_0xb7e0('0x32')](function(_0x30a1d8){logger['error'](_0xb7e0('0x33'));});}}}function endRouting(_0x275319,_0x562c0d,_0x2783b0,_0x1d2993){if(_0x275319&&_0x562c0d){_0x562c0d[_0xb7e0('0x2d')]-=0x1;var _0x1e5b8e={'leaveAt':moment()[_0xb7e0('0xf')](_0xb7e0('0x1e')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb7e0('0x34')};logger[_0xb7e0('0x2f')](util[_0xb7e0('0xf')](_0xb7e0('0x35'),_0x275319,_0x562c0d[_0xb7e0('0x2a')]));emitChannelQueueInteraction(_0x2783b0[_0xb7e0('0x21')],_0x562c0d[_0xb7e0('0x2a')],_0x2783b0['body'],_0x2783b0[_0xb7e0('0xb')]['name'],_0x2783b0[_0xb7e0('0x36')]['id'],![],_0x1d2993);if(rpc[_0x2783b0['channel']+'QueueReport']){return rpc[_0x2783b0[_0xb7e0('0x21')]+'QueueReport'][_0xb7e0('0x31')](_0x275319,_0x1e5b8e)[_0xb7e0('0x32')](function(_0x187255){logger[_0xb7e0('0x37')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x193324){return function(_0xb97087){return _0xb97087[_0xb7e0('0x2a')][_0xb7e0('0x38')]()===_0x193324['toLowerCase']();};}exports['consequence']=function(_0x5e9c2b,_0x220637,_0x48e1af,_0x472266){return function(_0x1f1c10){try{var _0x50f898={'name':_0x220637[0x0],'timeout':_0x220637[0x1]};var _0x3a3cc1=queue[_0xb7e0('0x39')](_0x50f898,{'typecast':!![]});if(_0x3a3cc1['length']){logger['error'](_0xb7e0('0x3a'),_0x5e9c2b,_['map'](_0x3a3cc1,_0xb7e0('0x36'))[_0xb7e0('0x3b')](',\x20'));_0x1f1c10['stop']();}else{var _0x3ea8b2=_[_0xb7e0('0x3c')](_0x48e1af[_0x472266[_0xb7e0('0x21')]+'Queues'],handleFindQueue(_0x50f898[_0xb7e0('0x2a')]));if(_0x3ea8b2){startRouting(_0x5e9c2b,_0x3ea8b2,_0x472266,_0x48e1af);var _0x597579=(_0x3ea8b2[_0xb7e0('0x34')]||0xa)*0x3e8;var _0x24d3f2=(_0x50f898['timeout']||0x14)*0x3e8;var _0x42c0bf,_0x1902f3;if(_0x597579>_0x24d3f2){_0x24d3f2=_0x597579;}var _0x514f7c=seqqueue[_0xb7e0('0x3d')](_0x597579);_0x514f7c['id']=_0x5e9c2b;_0x514f7c[_0xb7e0('0x3e')]=_0x597579;_0x514f7c['qtimeout']=_0x24d3f2;_0x514f7c[_0xb7e0('0x21')]=_0x472266[_0xb7e0('0x21')];_0x48e1af[_0xb7e0('0x3f')][_0x5e9c2b]['on']('end',function(){logger[_0xb7e0('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x5e9c2b);stopRouting(_0x5e9c2b,_0x3ea8b2,_0x472266,_0x48e1af);clearTimeout(_0x42c0bf);_0x42c0bf=undefined;_0x514f7c['close'](!![]);if(_0x48e1af[_0xb7e0('0x3f')][_0x5e9c2b]){delete _0x48e1af[_0xb7e0('0x3f')][_0x5e9c2b];}_0x1f1c10[_0xb7e0('0x40')]();});_0x48e1af['rules'][_0x5e9c2b]['on'](_0xb7e0('0x41'),function(){if(_0x48e1af[_0xb7e0('0x3f')][_0x5e9c2b]){delete _0x48e1af[_0xb7e0('0x3f')][_0x5e9c2b];}});_0x42c0bf=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x5e9c2b);endRouting(_0x5e9c2b,_0x3ea8b2,_0x472266,_0x48e1af);clearTimeout(_0x42c0bf);_0x514f7c[_0xb7e0('0x42')](!![]);_0x1f1c10['next']();},_0x24d3f2);switch(_0x3ea8b2[_0xb7e0('0x43')]){case _0xb7e0('0x44'):strategy[_0xb7e0('0x44')](_0x514f7c,_0x3ea8b2,_0x48e1af,_0x472266);break;default:strategy[_0xb7e0('0x45')](_0x514f7c,_0x3ea8b2,_0x48e1af,_0x472266);}}else{logger['error'](_0xb7e0('0x46'),_0x5e9c2b,_0x50f898[_0xb7e0('0x2a')]);_0x1f1c10['stop']();}}}catch(_0x18ff2d){console[_0xb7e0('0x47')](_0x18ff2d);logger[_0xb7e0('0x37')]('[%s][QUEUE]\x20%s',_0x5e9c2b,_0x18ff2d[_0xb7e0('0x48')]);_0x1f1c10['stop']();}};}; \ No newline at end of file +var _0x4742=['MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','update','update\x20queue\x20report','timeout','error','toLowerCase','consequence','map','join','stop','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','beepall','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','localhost','account','from','joinAt','clone','queue_id','queue','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x4742,0x64));var _0x2474=function(_0x3c60a0,_0x319de2){_0x3c60a0=_0x3c60a0-0x0;var _0x3c3d0e=_0x4742[_0x3c60a0];return _0x3c3d0e;};'use strict';var schema=require(_0x2474('0x0'));var _=require(_0x2474('0x1'));var util=require('util');var seqqueue=require(_0x2474('0x2'));var moment=require(_0x2474('0x3'));var Redis=require(_0x2474('0x4'));var config=require(_0x2474('0x5'));var logger=require(_0x2474('0x6'))('routing');var strategy=require(_0x2474('0x7'));config[_0x2474('0x8')]=_['defaults'](config[_0x2474('0x8')],{'host':_0x2474('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2474('0x8')]));var attributes=['id','queue_id',_0x2474('0xa'),'queue',_0x2474('0xb'),_0x2474('0xc')];function emit(_0x5bbc0b,_0x2031c8,_0x311b17){io['to'](_0x5bbc0b)['emit'](_0x2031c8,_0x311b17);}function emitChannelQueueInteraction(_0x44874f,_0x4147ee,_0x179f81,_0x4e3540,_0x510d5e,_0x652472,_0x16e504,_0x4deab3){var _0x33e5f9=_[_0x2474('0xd')](_0x179f81);_0x33e5f9[_0x2474('0xe')]=_0x4deab3;_0x33e5f9[_0x2474('0xf')]=_0x4147ee;_0x33e5f9[_0x2474('0xa')]=_0x4e3540;_0x33e5f9['id']=_0x510d5e;if(_0x652472){_0x16e504[util['format'](_0x2474('0x10'),_0x44874f)][_0x510d5e]=_[_0x2474('0x11')](_0x33e5f9,attributes);}else{delete _0x16e504[util[_0x2474('0x12')](_0x2474('0x10'),_0x44874f)][_0x510d5e];}emit(util[_0x2474('0x12')]('%s:queue:%s',_0x44874f,_0x4147ee),util[_0x2474('0x12')](_0x2474('0x13'),_0x44874f,_0x652472?_0x2474('0x14'):_0x2474('0x15')),_[_0x2474('0x11')](_0x33e5f9,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2474('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2474('0x17')),'faxQueueReport':require(_0x2474('0x18')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x2474('0x19'),'required':!![],'message':_0x2474('0x1a')},'timeout':{'type':'number','message':_0x2474('0x1b')}});function startRouting(_0x4388ad,_0x32ee58,_0x442550,_0x3a8beb){if(_0x4388ad&&_0x32ee58&&_0x442550){_0x32ee58[_0x2474('0x1c')]+=0x1;var _0x4d1adc={'uniqueid':_0x4388ad,'from':_0x442550[_0x2474('0x1d')]?_0x442550[_0x2474('0x1d')][_0x2474('0xb')]:'','joinAt':moment()[_0x2474('0x12')](_0x2474('0x1e')),'ContactId':_0x442550[_0x2474('0x1f')]?_0x442550[_0x2474('0x1f')]['id']:null,'ListId':_0x442550[_0x2474('0x20')]?_0x442550['list']['id']:null};_0x4d1adc[_[_0x2474('0x21')](_0x442550[_0x2474('0x22')])+_0x2474('0x23')]=_0x32ee58['id']||null;_0x4d1adc[_[_0x2474('0x21')](_0x442550[_0x2474('0x22')])+_0x2474('0x24')]=_0x442550[_0x2474('0x25')]?_0x442550[_0x2474('0x25')]['id']:null;_0x4d1adc[_['upperFirst'](_0x442550[_0x2474('0x22')])+_0x2474('0x26')]=_0x442550[_0x2474('0x27')]?_0x442550[_0x2474('0x27')]['id']:null;_0x4d1adc[_['upperFirst'](_0x442550[_0x2474('0x22')])+(_0x442550[_0x2474('0x22')]!==_0x2474('0x28')?'AccountId':'WebsiteId')]=_0x442550[_0x2474('0xa')]?_0x442550['account']['id']:null;logger[_0x2474('0x29')](util[_0x2474('0x12')](_0x2474('0x2a'),_0x4388ad,_0x32ee58[_0x2474('0x2b')]));emitChannelQueueInteraction(_0x442550[_0x2474('0x22')],_0x32ee58[_0x2474('0x2b')],_0x4d1adc,_0x442550[_0x2474('0xa')][_0x2474('0x2b')],_0x442550['message']['id'],!![],_0x3a8beb,_0x32ee58['id']);if(rpc[_0x442550[_0x2474('0x22')]+_0x2474('0x2c')]){return rpc[_0x442550['channel']+_0x2474('0x2c')][_0x2474('0x2d')](_0x4d1adc)[_0x2474('0x2e')](function(_0x359cbd){logger['error'](_0x2474('0x2f'));});}}}function stopRouting(_0x277771,_0xf1eab9,_0x380c27,_0x1526ae){if(_0x277771&&_0xf1eab9){_0xf1eab9[_0x2474('0x1c')]-=0x1;var _0x5ac8f7={'leaveAt':moment()[_0x2474('0x12')](_0x2474('0x1e')),'acceptAt':moment()[_0x2474('0x12')](_0x2474('0x1e')),'reason':'accepted'};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x277771,_0xf1eab9[_0x2474('0x2b')]));emitChannelQueueInteraction(_0x380c27[_0x2474('0x22')],_0xf1eab9['name'],_0x380c27[_0x2474('0x1d')],_0x380c27[_0x2474('0xa')][_0x2474('0x2b')],_0x380c27[_0x2474('0x27')]['id'],![],_0x1526ae,_0xf1eab9['id']);if(rpc[_0x380c27[_0x2474('0x22')]+'QueueReport']){return rpc[_0x380c27[_0x2474('0x22')]+_0x2474('0x2c')][_0x2474('0x30')](_0x277771,_0x5ac8f7)[_0x2474('0x2e')](function(_0x11158e){logger['error'](_0x2474('0x31'));});}}}function endRouting(_0x38a634,_0xcba674,_0x27ac4b,_0x48509d){if(_0x38a634&&_0xcba674){_0xcba674[_0x2474('0x1c')]-=0x1;var _0x3d1e6d={'leaveAt':moment()[_0x2474('0x12')](_0x2474('0x1e')),'exitAt':moment()['format'](_0x2474('0x1e')),'reason':_0x2474('0x32')};logger['info'](util[_0x2474('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x38a634,_0xcba674[_0x2474('0x2b')]));emitChannelQueueInteraction(_0x27ac4b['channel'],_0xcba674[_0x2474('0x2b')],_0x27ac4b['body'],_0x27ac4b[_0x2474('0xa')][_0x2474('0x2b')],_0x27ac4b[_0x2474('0x27')]['id'],![],_0x48509d);if(rpc[_0x27ac4b[_0x2474('0x22')]+_0x2474('0x2c')]){return rpc[_0x27ac4b[_0x2474('0x22')]+_0x2474('0x2c')][_0x2474('0x30')](_0x38a634,_0x3d1e6d)[_0x2474('0x2e')](function(_0x41388b){logger[_0x2474('0x33')](_0x2474('0x31'));});}}}function handleFindQueue(_0x124400){return function(_0x3d0453){return _0x3d0453[_0x2474('0x2b')]['toLowerCase']()===_0x124400[_0x2474('0x34')]();};}exports[_0x2474('0x35')]=function(_0x5e3866,_0x38003e,_0x54f77b,_0x444d72){return function(_0x5adae1){try{var _0x3278c6={'name':_0x38003e[0x0],'timeout':_0x38003e[0x1]};var _0x478ccf=queue[_0x2474('0x0')](_0x3278c6,{'typecast':!![]});if(_0x478ccf['length']){logger[_0x2474('0x33')]('[%s][QUEUE]\x20%s',_0x5e3866,_[_0x2474('0x36')](_0x478ccf,'message')[_0x2474('0x37')](',\x20'));_0x5adae1[_0x2474('0x38')]();}else{var _0x7d8317=_[_0x2474('0x39')](_0x54f77b[_0x444d72[_0x2474('0x22')]+_0x2474('0x3a')],handleFindQueue(_0x3278c6[_0x2474('0x2b')]));if(_0x7d8317){startRouting(_0x5e3866,_0x7d8317,_0x444d72,_0x54f77b);var _0x138309=(_0x7d8317[_0x2474('0x32')]||0xa)*0x3e8;var _0x1d93b1=(_0x3278c6[_0x2474('0x32')]||0x14)*0x3e8;var _0x3b84d2,_0x3d41dd;if(_0x138309>_0x1d93b1){_0x1d93b1=_0x138309;}var _0x2c4199=seqqueue[_0x2474('0x3b')](_0x138309);_0x2c4199['id']=_0x5e3866;_0x2c4199['atimeout']=_0x138309;_0x2c4199[_0x2474('0x3c')]=_0x1d93b1;_0x2c4199[_0x2474('0x22')]=_0x444d72[_0x2474('0x22')];_0x54f77b[_0x2474('0x3d')][_0x5e3866]['on'](_0x2474('0x3e'),function(){logger['info'](_0x2474('0x3f'),_0x5e3866);stopRouting(_0x5e3866,_0x7d8317,_0x444d72,_0x54f77b);clearTimeout(_0x3b84d2);_0x3b84d2=undefined;_0x2c4199[_0x2474('0x40')](!![]);if(_0x54f77b[_0x2474('0x3d')][_0x5e3866]){delete _0x54f77b['rules'][_0x5e3866];}_0x5adae1[_0x2474('0x38')]();});_0x54f77b[_0x2474('0x3d')][_0x5e3866]['on'](_0x2474('0x41'),function(){if(_0x54f77b[_0x2474('0x3d')][_0x5e3866]){delete _0x54f77b[_0x2474('0x3d')][_0x5e3866];}});_0x3b84d2=setTimeout(function(){logger['info'](_0x2474('0x42'),_0x5e3866);endRouting(_0x5e3866,_0x7d8317,_0x444d72,_0x54f77b);clearTimeout(_0x3b84d2);_0x2c4199[_0x2474('0x40')](!![]);_0x5adae1[_0x2474('0x43')]();},_0x1d93b1);switch(_0x7d8317['strategy']){case'rrmemory':strategy['rrmemory'](_0x2c4199,_0x7d8317,_0x54f77b,_0x444d72);break;default:strategy[_0x2474('0x44')](_0x2c4199,_0x7d8317,_0x54f77b,_0x444d72);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5e3866,_0x3278c6[_0x2474('0x2b')]);_0x5adae1['stop']();}}}catch(_0x46a67d){console['log'](_0x46a67d);logger[_0x2474('0x33')]('[%s][QUEUE]\x20%s',_0x5e3866,_0x46a67d['stack']);_0x5adae1[_0x2474('0x38')]();}};}; \ 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 58c89e8..62b0565 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 _0xab61=['isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available'];(function(_0xf3c874,_0x2fee11){var _0x21d10a=function(_0x9b4298){while(--_0x9b4298){_0xf3c874['push'](_0xf3c874['shift']());}};_0x21d10a(++_0x2fee11);}(_0xab61,0x192));var _0x1ab6=function(_0x457f46,_0x304e42){_0x457f46=_0x457f46-0x0;var _0x50f509=_0xab61[_0x457f46];return _0x50f509;};'use strict';var _=require(_0x1ab6('0x0'));var uuid=require('uuid');var util=require(_0x1ab6('0x1'));var logger=require(_0x1ab6('0x2'))(_0x1ab6('0x3'));var Agent=function(_0x5ed716,_0x13580a,_0x25dbbd,_0x55b322){this[_0x1ab6('0x4')]=uuid['v4']();this['squeue']=_0x5ed716;this[_0x1ab6('0x5')]=_0x13580a;this[_0x1ab6('0x6')]=_0x25dbbd;this['routing']=_0x55b322;this[_0x1ab6('0x7')][_0x1ab6('0x8')](this['handleRun'][_0x1ab6('0x9')](this),this[_0x1ab6('0xa')][_0x1ab6('0x9')](this));this[_0x1ab6('0x7')]['on'](_0x1ab6('0xb'),this[_0x1ab6('0xa')][_0x1ab6('0x9')](this));this[_0x1ab6('0x7')]['on'](_0x1ab6('0xc'),this[_0x1ab6('0xd')]['bind'](this));};Agent[_0x1ab6('0xe')][_0x1ab6('0x8')]=function(){this[_0x1ab6('0x7')][_0x1ab6('0x8')](this['handleRun'][_0x1ab6('0x9')](this),this[_0x1ab6('0xa')][_0x1ab6('0x9')](this));};Agent[_0x1ab6('0xe')][_0x1ab6('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x1ab6('0xe')]['handleRun']=function(_0x599018){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x5')]['id']);if(_['isNil'](this[_0x1ab6('0x6')][_0x1ab6('0xf')][this['agent']['id']])){logger[_0x1ab6('0x10')](_0x1ab6('0x11'),this[_0x1ab6('0x7')]['id'],this['agent']['id']);setTimeout(this[_0x1ab6('0x8')]['bind'](this),0x3e8);}else{if(this[_0x1ab6('0x3')][_0x1ab6('0x12')]||util[_0x1ab6('0x13')](this[_0x1ab6('0x7')]['id'],this['realtime'][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']],this[_0x1ab6('0x7')][_0x1ab6('0x14')],![])){this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']][_0x1ab6('0x15')]=!![];this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']][_0x1ab6('0x16')]=undefined;util['showNotification'](this[_0x1ab6('0x4')],this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']],null,this[_0x1ab6('0x3')]);util[_0x1ab6('0x17')](this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x6')]['agents'][this[_0x1ab6('0x5')]['id']],_0x1ab6('0x18')+(this[_0x1ab6('0x3')]['forcedOwnership']?_0x1ab6('0x19'):''));}else{logger[_0x1ab6('0x10')](_0x1ab6('0x1a'),this['squeue']['id'],this[_0x1ab6('0x5')]['id']);setTimeout(this['push'][_0x1ab6('0x9')](this),0x3e8);}}};Agent[_0x1ab6('0xe')]['handleTimeout']=function(_0x67410a){if(_[_0x1ab6('0x1b')](this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']])){return logger[_0x1ab6('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x5')]['id']);}else{logger[_0x1ab6('0x10')](_0x1ab6('0x1c'),this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x5')]['id']);util[_0x1ab6('0x1d')](this['notificationId'],this[_0x1ab6('0x7')]['id'],this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']],null,this[_0x1ab6('0x3')]);this[_0x1ab6('0x6')][_0x1ab6('0xf')][this['agent']['id']][_0x1ab6('0x15')]=![];this[_0x1ab6('0x6')][_0x1ab6('0xf')][this[_0x1ab6('0x5')]['id']][_0x1ab6('0x16')]=undefined;util['writeLog'](this[_0x1ab6('0x7')]['id'],this['realtime']['agents'][this['agent']['id']],_0x67410a?_0x1ab6('0x1e'):_0x1ab6('0x1f'));}if(!_0x67410a){setTimeout(this[_0x1ab6('0x8')][_0x1ab6('0x9')](this),0x3e8);}};function agent(_0x298908,_0x5d250c,_0xcf0b62,_0x128598){return new Agent(_0x298908,_0x5d250c,_0xcf0b62,_0x128598);}module[_0x1ab6('0x20')]=agent; \ No newline at end of file +var _0x7f09=['agents','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','routing','agent','realtime','squeue','push','handleRun','bind','handleTimeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x208ad8,_0x28f308){var _0x3ce3f2=function(_0x4e6677){while(--_0x4e6677){_0x208ad8['push'](_0x208ad8['shift']());}};_0x3ce3f2(++_0x28f308);}(_0x7f09,0x6d));var _0x97f0=function(_0x40b0e1,_0xd265a6){_0x40b0e1=_0x40b0e1-0x0;var _0x4281b9=_0x7f09[_0x40b0e1];return _0x4281b9;};'use strict';var _=require(_0x97f0('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x97f0('0x1'))(_0x97f0('0x2'));var Agent=function(_0x21afd3,_0xc4acca,_0xb0e700,_0x28f00a){this['notificationId']=uuid['v4']();this['squeue']=_0x21afd3;this[_0x97f0('0x3')]=_0xc4acca;this[_0x97f0('0x4')]=_0xb0e700;this[_0x97f0('0x2')]=_0x28f00a;this[_0x97f0('0x5')][_0x97f0('0x6')](this[_0x97f0('0x7')][_0x97f0('0x8')](this),this[_0x97f0('0x9')][_0x97f0('0x8')](this));this[_0x97f0('0x5')]['on']('timeout',this['handleTimeout'][_0x97f0('0x8')](this));this[_0x97f0('0x5')]['on']('drained',this[_0x97f0('0xa')][_0x97f0('0x8')](this));};Agent[_0x97f0('0xb')][_0x97f0('0x6')]=function(){this[_0x97f0('0x5')][_0x97f0('0x6')](this[_0x97f0('0x7')][_0x97f0('0x8')](this),this['handleTimeout'][_0x97f0('0x8')](this));};Agent[_0x97f0('0xb')][_0x97f0('0xa')]=function(){this[_0x97f0('0x9')](!![]);};Agent[_0x97f0('0xb')]['handleRun']=function(_0x2cded3){logger[_0x97f0('0xc')](_0x97f0('0xd'),this['squeue']['id'],this[_0x97f0('0x3')]['id']);if(_[_0x97f0('0xe')](this[_0x97f0('0x4')]['agents'][this['agent']['id']])){logger[_0x97f0('0xc')](_0x97f0('0xf'),this[_0x97f0('0x5')]['id'],this[_0x97f0('0x3')]['id']);setTimeout(this[_0x97f0('0x6')][_0x97f0('0x8')](this),0x3e8);}else{if(this[_0x97f0('0x2')][_0x97f0('0x10')]||util[_0x97f0('0x11')](this['squeue']['id'],this[_0x97f0('0x4')]['agents'][this[_0x97f0('0x3')]['id']],this[_0x97f0('0x5')][_0x97f0('0x12')],![])){this[_0x97f0('0x4')][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']]['busy']=!![];this['realtime'][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x97f0('0x14')],this['squeue']['id'],this['realtime'][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']],null,this[_0x97f0('0x2')]);util[_0x97f0('0x15')](this[_0x97f0('0x5')]['id'],this[_0x97f0('0x4')]['agents'][this[_0x97f0('0x3')]['id']],_0x97f0('0x16')+(this[_0x97f0('0x2')][_0x97f0('0x10')]?_0x97f0('0x17'):''));}else{logger[_0x97f0('0xc')](_0x97f0('0x18'),this[_0x97f0('0x5')]['id'],this[_0x97f0('0x3')]['id']);setTimeout(this[_0x97f0('0x6')][_0x97f0('0x8')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xff8881){if(_[_0x97f0('0xe')](this[_0x97f0('0x4')][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']])){return logger[_0x97f0('0xc')](_0x97f0('0xf'),this[_0x97f0('0x5')]['id'],this[_0x97f0('0x3')]['id']);}else{logger[_0x97f0('0xc')](_0x97f0('0x19'),this[_0x97f0('0x5')]['id'],this['agent']['id']);util[_0x97f0('0x1a')](this[_0x97f0('0x14')],this[_0x97f0('0x5')]['id'],this['realtime'][_0x97f0('0x13')][this['agent']['id']],null,this[_0x97f0('0x2')]);this['realtime']['agents'][this['agent']['id']][_0x97f0('0x1b')]=![];this[_0x97f0('0x4')][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']][_0x97f0('0x1c')]=undefined;util['writeLog'](this[_0x97f0('0x5')]['id'],this[_0x97f0('0x4')][_0x97f0('0x13')][this[_0x97f0('0x3')]['id']],_0xff8881?_0x97f0('0x1d'):_0x97f0('0x1e'));}if(!_0xff8881){setTimeout(this[_0x97f0('0x6')]['bind'](this),0x3e8);}};function agent(_0x49305f,_0x4fe05b,_0x909120,_0x9093a1){return new Agent(_0x49305f,_0x4fe05b,_0x909120,_0x9093a1);}module[_0x97f0('0x1f')]=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 416d4ea..fe5b303 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 _0x84ab=['queue','push','bind','handleTimeout','prototype','handleRun','handleDrained','isNil','Agents','length','realtime','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x3de7da,_0x1debba){var _0x55314c=function(_0x245ba0){while(--_0x245ba0){_0x3de7da['push'](_0x3de7da['shift']());}};_0x55314c(++_0x1debba);}(_0x84ab,0x12f));var _0xb84a=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x84ab[_0x2a0738];return _0x159679;};'use strict';var _=require(_0xb84a('0x0'));var uuid=require(_0xb84a('0x1'));var util=require(_0xb84a('0x2'));var logger=require(_0xb84a('0x3'))(_0xb84a('0x4'));var Beepall=function(_0x512f13,_0xc83587,_0x18a4a5,_0x47b8e3){this[_0xb84a('0x5')]=uuid['v4']();this[_0xb84a('0x6')]=_0x512f13;this[_0xb84a('0x7')]=_0xc83587;this['realtime']=_0x18a4a5;this['routing']=_0x47b8e3;this['squeue'][_0xb84a('0x8')](this['handleRun'][_0xb84a('0x9')](this),this[_0xb84a('0xa')]['bind'](this));this[_0xb84a('0x6')]['on']('timeout',this[_0xb84a('0xa')][_0xb84a('0x9')](this));this[_0xb84a('0x6')]['on']('drained',this['handleDrained']['bind'](this));};Beepall[_0xb84a('0xb')][_0xb84a('0x8')]=function(){this[_0xb84a('0x6')][_0xb84a('0x8')](this[_0xb84a('0xc')]['bind'](this),this[_0xb84a('0xa')][_0xb84a('0x9')](this));};Beepall[_0xb84a('0xb')][_0xb84a('0xd')]=function(_0x44b26b){this[_0xb84a('0xa')](!![]);};Beepall[_0xb84a('0xb')][_0xb84a('0xc')]=function(_0x3113a2){var _0x30fb61=!![];if(!_[_0xb84a('0xe')](this[_0xb84a('0x7')])&&!_['isNil'](this[_0xb84a('0x7')][_0xb84a('0xf')])&&this[_0xb84a('0x7')][_0xb84a('0xf')][_0xb84a('0x10')]>0x0){for(var _0x1be87a=0x0,_0x3b717e;_0x1be87a0x0){for(var _0x2a3fd1=0x0,_0x5360f2;_0x2a3fd10x0&&_0x2c0c21[_0x5e70ec+_0x75d1('0x25')]>=_0x2c0c21[_0x5e70ec+'Capacity']){writeLog(_0x526f6c,_0x2c0c21,_0x5e70ec['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x75d1('0x26')]=function(_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb){return sendNotification(!![],_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb);};exports['hideNotification']=function(_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa){return sendNotification(![],_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa);};exports[_0x75d1('0x27')]=writeLog; \ No newline at end of file +var _0xcaf2=['online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','mustache','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','emit','format','user:%s','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY'];(function(_0xf7a585,_0x46efd7){var _0x468b20=function(_0x35da7c){while(--_0x35da7c){_0xf7a585['push'](_0xf7a585['shift']());}};_0x468b20(++_0x46efd7);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2f3173,_0x532c04){_0x2f3173=_0x2f3173-0x0;var _0x426e08=_0xcaf2[_0x2f3173];return _0x426e08;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var utils=require(_0x2caf('0x1'));var Mustache=require(_0x2caf('0x2'));var Redis=require('ioredis');var config=require(_0x2caf('0x3'));var logger=require(_0x2caf('0x4'))('routing');config[_0x2caf('0x5')]=_['defaults'](config[_0x2caf('0x5')],{'host':_0x2caf('0x6'),'port':0x18eb});var io=require(_0x2caf('0x7'))(new Redis(config['redis']));function emit(_0xc44e4e,_0x314486,_0x4667c6){io['to'](_0xc44e4e)[_0x2caf('0x8')](_0x314486,_0x4667c6);}function sendNotification(_0x5611aa,_0x4050ab,_0xb56cd1,_0x45e520,_0x1ff859,_0x219d0f){io['to'](util[_0x2caf('0x9')](_0x2caf('0xa'),_0x45e520[_0x2caf('0xb')]))[_0x2caf('0x8')]('user:save',_0x45e520);var _0xd56396=_0x219d0f||{};var _0xc494fc=_0xb56cd1[_0x2caf('0xc')]('.');var _0x414f6b={'uniqueid':_0x4050ab,'channel':_0xc494fc[0x0],'id':_0xc494fc[0x1],'title':_0xc494fc[0x0]+_0x2caf('0xd'),'interactionId':_0xc494fc[0x2],'queue':_0x1ff859?_0x1ff859[_0x2caf('0xb')]:null,'sound':_0xd56396[_0x2caf('0xe')][_0x2caf('0xf')],'shake':_0xd56396['account'][_0x2caf('0x10')]};try{if(!_0xd56396[_0x2caf('0x11')]){_0xd56396['body']={};}if(_0x1ff859){_0xd56396['body']['queue']=_0x1ff859;}else if(_0xd56396[_0x2caf('0x11')]['queue']){delete _0xd56396[_0x2caf('0x11')][_0x2caf('0x12')];}_0x414f6b[_0x2caf('0x13')]=utils[_0x2caf('0x14')](_0xd56396['account'][_0x2caf('0x15')],_0xd56396);}catch(_0x564d42){_0x414f6b[_0x2caf('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x2caf('0x9')]('[%s][QUEUE]\x20%s',_0x4050ab,_0x564d42[_0x2caf('0x16')]));}io['to'](util[_0x2caf('0x9')]('user:%s',_0x45e520[_0x2caf('0xb')]))[_0x2caf('0x8')](util[_0x2caf('0x9')](_0x2caf('0x17'),_0x5611aa?_0x2caf('0x18'):'remove'),_0x414f6b);}function writeLog(_0xfa426f,_0x3eac27,_0x2b4d16){return logger[_0x2caf('0x19')](util[_0x2caf('0x9')](_0x2caf('0x1a'),_0xfa426f,_0x3eac27[_0x2caf('0xb')],_0x2b4d16));}exports[_0x2caf('0x1b')]=function(_0x3332b1,_0xb60d47,_0x6814bc,_0x5231fc){if(_0xb60d47[_0x2caf('0x1c')]){writeLog(_0x3332b1,_0xb60d47,_0x2caf('0x1d'));return![];}if(!_0xb60d47[_0x2caf('0x1e')]){writeLog(_0x3332b1,_0xb60d47,_0x2caf('0x1f'));return![];}if(_0xb60d47[_0x6814bc+_0x2caf('0x20')]){writeLog(_0x3332b1,_0xb60d47,_0x2caf('0x21'));return![];}if(_0x5231fc&&_0xb60d47[_0x2caf('0x22')](_0x6814bc+_0x2caf('0x23'))&&_0xb60d47[_0x2caf('0x22')](_0x6814bc+_0x2caf('0x24'))){if(_0xb60d47[_0x6814bc+'Capacity']>0x0&&_0xb60d47[_0x6814bc+_0x2caf('0x24')]>=_0xb60d47[_0x6814bc+_0x2caf('0x23')]){writeLog(_0x3332b1,_0xb60d47,_0x6814bc[_0x2caf('0x25')]()+_0x2caf('0x26'));return![];}}return!![];};exports[_0x2caf('0x27')]=function(_0x17d3c6,_0x13e8d9,_0x135977,_0x23f765,_0x2304f1){return sendNotification(!![],_0x17d3c6,_0x13e8d9,_0x135977,_0x23f765,_0x2304f1);};exports[_0x2caf('0x28')]=function(_0x1f477,_0x158d60,_0x48b5f7,_0xb944cc,_0xda0ec5){return sendNotification(![],_0x1f477,_0x158d60,_0x48b5f7,_0xb944cc,_0xda0ec5);};exports[_0x2caf('0x29')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c7027ca..f73bc47 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 _0x94ce=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x94ce,0x98));var _0xe94c=function(_0xe8b3fc,_0x57288e){_0xe8b3fc=_0xe8b3fc-0x0;var _0x1fe4d1=_0x94ce[_0xe8b3fc];return _0x1fe4d1;};'use strict';var schema=require(_0xe94c('0x0'));var sh=require(_0xe94c('0x1'));var _=require(_0xe94c('0x2'));var utils=require(_0xe94c('0x3'));var logger=require(_0xe94c('0x4'))('routing');var system=schema({'command':{'type':_0xe94c('0x5'),'required':!![],'message':_0xe94c('0x6')}});exports[_0xe94c('0x7')]=function(_0x347541,_0x50004d){return function(_0xcf985d){try{var _0xaa93dd={'command':_0x50004d[0x0]};var _0x3a6005=system[_0xe94c('0x0')](_0xaa93dd,{'typecast':!![]});if(_0x3a6005[_0xe94c('0x8')]){logger[_0xe94c('0x9')]('[%s][SYSTEM]\x20%s',_0x347541,_[_0xe94c('0xa')](_0x3a6005,_0xe94c('0xb'))[_0xe94c('0xc')](',\x20'));logger[_0xe94c('0xd')](_0xe94c('0xe'),_0x347541);_0xcf985d[_0xe94c('0xf')]();}else{var _0x247e0d=this;var _0x49840f=utils[_0xe94c('0x10')](_0x50004d[0x0],this);logger[_0xe94c('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x347541,_0x49840f);sh[_0xe94c('0x11')](_[_0xe94c('0x12')](_0x49840f),function(_0x3eaf60,_0x18229a){logger['info'](_0xe94c('0x13'),_0x347541,_0x3eaf60);if(_0x3eaf60==0x0){var _0x5b0352=_0x18229a[_0xe94c('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x50004d[0x1])||_['isEmpty'](_0x50004d[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x347541);_0x247e0d[_0xe94c('0x15')][_0x50004d[0x1]]=_0x5b0352;}else{logger['info'](_0xe94c('0x16'),_0x347541,_0x50004d[0x1],_0x5b0352);_0x247e0d['body'][_0x50004d[0x1]]=_0x5b0352;}}_0xcf985d[_0xe94c('0xf')]();});}}catch(_0x1e0629){logger[_0xe94c('0x9')](_0xe94c('0x17'),_0x347541,_[_0xe94c('0x18')](_0x1e0629)?JSON[_0xe94c('0x19')](_0x1e0629):_0x1e0629);logger[_0xe94c('0xd')](_0xe94c('0xe'),_0x347541);_0xcf985d[_0xe94c('0xf')]();}};}; \ No newline at end of file +var _0x0f83=['isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x33e788,_0x18f3e7){var _0x34ea16=function(_0x3fa858){while(--_0x3fa858){_0x33e788['push'](_0x33e788['shift']());}};_0x34ea16(++_0x18f3e7);}(_0x0f83,0x66));var _0x30f8=function(_0x5f6e00,_0x40e692){_0x5f6e00=_0x5f6e00-0x0;var _0x451275=_0x0f83[_0x5f6e00];return _0x451275;};'use strict';var schema=require('validate');var sh=require(_0x30f8('0x0'));var _=require(_0x30f8('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x30f8('0x2'));var system=schema({'command':{'type':_0x30f8('0x3'),'required':!![],'message':_0x30f8('0x4')}});exports[_0x30f8('0x5')]=function(_0x614741,_0x5396bd){return function(_0x2cb392){try{var _0x19f1c5={'command':_0x5396bd[0x0]};var _0x160e2b=system[_0x30f8('0x6')](_0x19f1c5,{'typecast':!![]});if(_0x160e2b[_0x30f8('0x7')]){logger[_0x30f8('0x8')](_0x30f8('0x9'),_0x614741,_[_0x30f8('0xa')](_0x160e2b,_0x30f8('0xb'))[_0x30f8('0xc')](',\x20'));logger[_0x30f8('0xd')](_0x30f8('0xe'),_0x614741);_0x2cb392[_0x30f8('0xf')]();}else{var _0x1fef33=this;var _0x49249d=utils[_0x30f8('0x10')](_0x5396bd[0x0],this);logger[_0x30f8('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x614741,_0x49249d);sh['exec'](_['trim'](_0x49249d),function(_0x2dbc22,_0x5f4d9b){logger[_0x30f8('0xd')](_0x30f8('0x11'),_0x614741,_0x2dbc22);if(_0x2dbc22==0x0){var _0x2ecc1a=_0x5f4d9b['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x30f8('0x12')](_0x5396bd[0x1])||_['isEmpty'](_0x5396bd[0x1])){logger[_0x30f8('0xd')](_0x30f8('0x13'),_0x614741);_0x1fef33[_0x30f8('0x14')][_0x5396bd[0x1]]=_0x2ecc1a;}else{logger['info'](_0x30f8('0x15'),_0x614741,_0x5396bd[0x1],_0x2ecc1a);_0x1fef33['body'][_0x5396bd[0x1]]=_0x2ecc1a;}}_0x2cb392[_0x30f8('0xf')]();});}}catch(_0x5accc5){logger['error'](_0x30f8('0x9'),_0x614741,_[_0x30f8('0x16')](_0x5accc5)?JSON[_0x30f8('0x17')](_0x5accc5):_0x5accc5);logger['info'](_0x30f8('0xe'),_0x614741);_0x2cb392[_0x30f8('0xf')]();}};}; \ 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 637c0de..82a2e98 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 _0x767c=['consequence','error','[%s][TAG]\x20%s','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x34fc8c,_0x28567c){var _0x3393a3=function(_0x29fd95){while(--_0x29fd95){_0x34fc8c['push'](_0x34fc8c['shift']());}};_0x3393a3(++_0x28567c);}(_0x767c,0x117));var _0xc767=function(_0x210775,_0x29d4fe){_0x210775=_0x210775-0x0;var _0xbbffde=_0x767c[_0x210775];return _0xbbffde;};'use strict';var schema=require(_0xc767('0x0'));var _=require(_0xc767('0x1'));var rpc={'chatInteraction':require(_0xc767('0x2')),'openchannelInteraction':require(_0xc767('0x3')),'smsInteraction':require(_0xc767('0x4')),'mailInteraction':require(_0xc767('0x5')),'faxInteraction':require(_0xc767('0x6')),'whatsappInteraction':require(_0xc767('0x7'))};var logger=require('../../../../config/logger')(_0xc767('0x8'));var tag=schema({'tag':{'type':_0xc767('0x9'),'required':!![],'message':_0xc767('0xa')}});exports[_0xc767('0xb')]=function(_0x57c9bf,_0x31ce7f,_0x2f1c64,_0x5337d5){return function(_0x2971cf){try{var _0x190e29={'tag':_0x31ce7f[0x0]};var _0x5c58b0=tag[_0xc767('0x0')](_0x190e29,{'typecast':!![]});if(_0x5c58b0['length']){logger[_0xc767('0xc')](_0xc767('0xd'),_0x57c9bf,_[_0xc767('0xe')](_0x5c58b0,'message')[_0xc767('0xf')](',\x20'));logger['info'](_0xc767('0x10'),_0x57c9bf);_0x2971cf[_0xc767('0x11')]();}else{var _0x56e3b4={'ids':[_0x31ce7f[0x0]]};if(rpc[_0x5337d5[_0xc767('0x12')]+_0xc767('0x13')]){rpc[_0x5337d5[_0xc767('0x12')]+_0xc767('0x13')][_0xc767('0x14')](_0x5337d5[_0xc767('0x15')]['id'],_0x56e3b4)[_0xc767('0x16')](function(_0x44aec1){logger[_0xc767('0x17')](_0xc767('0x18'),_0x57c9bf,_0x31ce7f[0x1],_0x5337d5['channel'],_0x5337d5['interaction']['id']);})[_0xc767('0x19')](function(_0x491906){logger[_0xc767('0xc')](_0xc767('0xd'),_0x57c9bf,JSON[_0xc767('0x1a')](_0x491906));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x57c9bf);})[_0xc767('0x1b')](function(){_0x2971cf[_0xc767('0x11')]();});}}}catch(_0x4e6590){logger[_0xc767('0xc')](_0xc767('0xd'),_0x57c9bf,_[_0xc767('0x1c')](_0x4e6590)?JSON['stringify'](_0x4e6590):_0x4e6590);logger[_0xc767('0x17')](_0xc767('0x10'),_0x57c9bf);_0x2971cf[_0xc767('0x11')]();}};}; \ No newline at end of file +var _0x5c11=['Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','interaction','catch','stringify','finally','isObject','next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x14612f,_0x1c3389){var _0x3c41ad=function(_0x41043c){while(--_0x41043c){_0x14612f['push'](_0x14612f['shift']());}};_0x3c41ad(++_0x1c3389);}(_0x5c11,0x1b3));var _0x15c1=function(_0xb61065,_0x159992){_0xb61065=_0xb61065-0x0;var _0x3f3fcb=_0x5c11[_0xb61065];return _0x3f3fcb;};'use strict';var schema=require(_0x15c1('0x0'));var _=require(_0x15c1('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x15c1('0x2')),'smsInteraction':require(_0x15c1('0x3')),'mailInteraction':require(_0x15c1('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x15c1('0x5'))};var logger=require(_0x15c1('0x6'))(_0x15c1('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x428359,_0x32d83a,_0x3ddd1b,_0x4e3984){return function(_0x367439){try{var _0x5c0589={'tag':_0x32d83a[0x0]};var _0x54c4ea=tag['validate'](_0x5c0589,{'typecast':!![]});if(_0x54c4ea[_0x15c1('0x8')]){logger[_0x15c1('0x9')](_0x15c1('0xa'),_0x428359,_[_0x15c1('0xb')](_0x54c4ea,'message')[_0x15c1('0xc')](',\x20'));logger[_0x15c1('0xd')](_0x15c1('0xe'),_0x428359);_0x367439['next']();}else{var _0x4cdb56={'ids':[_0x32d83a[0x0]]};if(rpc[_0x4e3984['channel']+_0x15c1('0xf')]){rpc[_0x4e3984['channel']+_0x15c1('0xf')][_0x15c1('0x10')](_0x4e3984['interaction']['id'],_0x4cdb56)['then'](function(_0x193ba1){logger[_0x15c1('0xd')](_0x15c1('0x11'),_0x428359,_0x32d83a[0x1],_0x4e3984[_0x15c1('0x12')],_0x4e3984[_0x15c1('0x13')]['id']);})[_0x15c1('0x14')](function(_0x598f0d){logger[_0x15c1('0x9')]('[%s][TAG]\x20%s',_0x428359,JSON[_0x15c1('0x15')](_0x598f0d));logger[_0x15c1('0xd')](_0x15c1('0xe'),_0x428359);})[_0x15c1('0x16')](function(){_0x367439['next']();});}}}catch(_0x4b4223){logger[_0x15c1('0x9')]('[%s][TAG]\x20%s',_0x428359,_[_0x15c1('0x17')](_0x4b4223)?JSON[_0x15c1('0x15')](_0x4b4223):_0x4b4223);logger['info'](_0x15c1('0xe'),_0x428359);_0x367439[_0x15c1('0x18')]();}};}; \ 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 abc6187..b36bc33 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 _0x44bd=['logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','push','stringify','utf8','POST','application/json-rpc','result'];(function(_0x59205a,_0x1e85ce){var _0x5b8735=function(_0x26bc54){while(--_0x26bc54){_0x59205a['push'](_0x59205a['shift']());}};_0x5b8735(++_0x1e85ce);}(_0x44bd,0x13f));var _0xd44b=function(_0x309251,_0x5a6279){_0x309251=_0x309251-0x0;var _0x21426a=_0x44bd[_0x309251];return _0x21426a;};'use strict';var rp=require(_0xd44b('0x0'));var logger=require(_0xd44b('0x1'))(_0xd44b('0x2'));var _=require(_0xd44b('0x3'));var arr=[];exports[_0xd44b('0x4')]=function(_0x38e1c4,_0x1ede14){return function(_0x1ba7af){var _0x517051=_0x1ede14[0xa];var _0xb8ef12=_0x1ede14[0xb];var _0x3c99a9=_0x1ede14[0xc];var _0x50af6b=_0x1ede14[0xd];var _0x2b9986=_0x1ede14[0xe];var _0x2b917b=_0x1ede14[0xf]['replace'](/\n/g,_0xd44b('0x5'));var _0x340bd9=_0x1ede14[0x10][_0xd44b('0x6')](/\n/g,'\x20');if(!arr[_0xd44b('0x7')](_0xb8ef12)){arr['push'](_0xb8ef12);var _0x4a4fe4=_0x1ede14[0x3];var _0x3a18d1=_0x1ede14[0x4];var _0x2eaad3=_0x1ede14[0x1];var _0x3b0152=_0x1ede14[0x0];var _0x147b81={};_0x147b81[_0xd44b('0x8')]=_0x1ede14[0x8]+_0xd44b('0x9')+_0x3c99a9+'|'+_0x517051+'|'+_0x50af6b+'|'+_0xb8ef12+'|'+_0x2b9986;_0x147b81['urlOnRing']=_0x1ede14[0x7]+_0xd44b('0x9')+_0x3c99a9+'|'+_0x517051+'|'+_0x50af6b+'|'+_0xb8ef12+'|'+_0x2b9986+'|'+_0x2b917b+'|'+_0x340bd9;_0x147b81[_0xd44b('0xa')]=_0x1ede14[0x9];var _0x63e9e6={};_0x63e9e6[_0xd44b('0xb')]=_0xd44b('0xc');_0x63e9e6[_0xd44b('0xd')]=_0xd44b('0xe');var _0x2d6b7a=[];_0x2d6b7a[_0xd44b('0xf')](_0x1ede14[0x2]);_0x2d6b7a[_0xd44b('0xf')](_0x1ede14[0x5]);_0x2d6b7a[_0xd44b('0xf')](_0x1ede14[0x6]);_0x63e9e6['params']=_0x2d6b7a;_0x63e9e6['id']=0x1;var _0x274f0f=JSON[_0xd44b('0x10')](_0x63e9e6);var _0x2d4583={'encoding':_0xd44b('0x11'),'method':_0xd44b('0x12'),'timeout':0x2710,'url':_0x4a4fe4,'headers':{'Content-Type':_0xd44b('0x13')},'body':_0x274f0f};return rp(_0x2d4583)['then'](function(_0x45fdbd){const _0x2f508d=JSON['parse'](_0x45fdbd);if(!_0x2f508d[_0xd44b('0x14')][_0xd44b('0x15')]){throw new Error(_0xd44b('0x16'));}var _0xef608f=_0xb8ef12;var _0x37bea4=_0xd44b('0x17')+_0x2eaad3+_0xd44b('0x18')+_0x3b0152+_0xd44b('0x19')+_0xef608f+_0xd44b('0x1a')+JSON[_0xd44b('0x10')](_0x147b81);var _0x2262f3=_0x3a18d1+'?'+_0x37bea4;return rp(_0x2262f3);})[_0xd44b('0x1b')](function(_0x33975d){logger[_0xd44b('0x1c')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x38e1c4,_0x33975d);_0x1ba7af[_0xd44b('0x1d')]();})['catch'](function(_0x1a15be){logger[_0xd44b('0x1e')](_0xd44b('0x1f'),_0x38e1c4,_[_0xd44b('0x20')](_0x1a15be)?JSON[_0xd44b('0x10')](_0x1a15be):_0x1a15be);_0x1ba7af['stop']();});}else{logger['info'](_0xd44b('0x21'),_0x38e1c4);_0x1ba7af['next']();}};}; \ No newline at end of file +var _0x16df=['consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','params','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','lodash'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0x16df,0x106));var _0xf16d=function(_0x12b716,_0x59657a){_0x12b716=_0x12b716-0x0;var _0x4d6f90=_0x16df[_0x12b716];return _0x4d6f90;};'use strict';var rp=require('request-promise');var logger=require(_0xf16d('0x0'))('routing');var _=require(_0xf16d('0x1'));var arr=[];exports[_0xf16d('0x2')]=function(_0x3f0023,_0x15005b){return function(_0x4b95ff){var _0x40f4c9=_0x15005b[0xa];var _0x137e2b=_0x15005b[0xb];var _0x41b020=_0x15005b[0xc];var _0xb08827=_0x15005b[0xd];var _0x504e59=_0x15005b[0xe];var _0x4c55ee=_0x15005b[0xf]['replace'](/\n/g,_0xf16d('0x3'));var _0xf6378d=_0x15005b[0x10][_0xf16d('0x4')](/\n/g,'\x20');if(!arr[_0xf16d('0x5')](_0x137e2b)){arr[_0xf16d('0x6')](_0x137e2b);var _0x2cecfe=_0x15005b[0x3];var _0x491224=_0x15005b[0x4];var _0x1d9af4=_0x15005b[0x1];var _0x56215b=_0x15005b[0x0];var _0x476cd3={};_0x476cd3[_0xf16d('0x7')]=_0x15005b[0x8]+_0xf16d('0x8')+_0x41b020+'|'+_0x40f4c9+'|'+_0xb08827+'|'+_0x137e2b+'|'+_0x504e59;_0x476cd3[_0xf16d('0x9')]=_0x15005b[0x7]+_0xf16d('0x8')+_0x41b020+'|'+_0x40f4c9+'|'+_0xb08827+'|'+_0x137e2b+'|'+_0x504e59+'|'+_0x4c55ee+'|'+_0xf6378d;_0x476cd3[_0xf16d('0xa')]=_0x15005b[0x9];var _0x21352d={};_0x21352d[_0xf16d('0xb')]='2.0';_0x21352d[_0xf16d('0xc')]=_0xf16d('0xd');var _0x2ee2f5=[];_0x2ee2f5[_0xf16d('0x6')](_0x15005b[0x2]);_0x2ee2f5[_0xf16d('0x6')](_0x15005b[0x5]);_0x2ee2f5[_0xf16d('0x6')](_0x15005b[0x6]);_0x21352d[_0xf16d('0xe')]=_0x2ee2f5;_0x21352d['id']=0x1;var _0x495793=JSON['stringify'](_0x21352d);var _0x30dceb={'encoding':_0xf16d('0xf'),'method':_0xf16d('0x10'),'timeout':0x2710,'url':_0x2cecfe,'headers':{'Content-Type':_0xf16d('0x11')},'body':_0x495793};return rp(_0x30dceb)[_0xf16d('0x12')](function(_0x459eb0){const _0x15c285=JSON[_0xf16d('0x13')](_0x459eb0);if(!_0x15c285[_0xf16d('0x14')]['logged']){throw new Error(_0xf16d('0x15'));}var _0x3ca777=_0x137e2b;var _0xd39b5='channelId='+_0x1d9af4+_0xf16d('0x16')+_0x56215b+_0xf16d('0x17')+_0x3ca777+_0xf16d('0x18')+JSON[_0xf16d('0x19')](_0x476cd3);var _0x356ebc=_0x491224+'?'+_0xd39b5;return rp(_0x356ebc);})[_0xf16d('0x12')](function(_0xd47aef){logger[_0xf16d('0x1a')](_0xf16d('0x1b'),_0x3f0023,_0xd47aef);_0x4b95ff[_0xf16d('0x1c')]();})[_0xf16d('0x1d')](function(_0x4032aa){logger['error'](_0xf16d('0x1e'),_0x3f0023,_[_0xf16d('0x1f')](_0x4032aa)?JSON[_0xf16d('0x19')](_0x4032aa):_0x4032aa);_0x4b95ff[_0xf16d('0x1c')]();});}else{logger[_0xf16d('0x1a')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3f0023);_0x4b95ff[_0xf16d('0x20')]();}};}; \ 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 81d8585..dc8d17f 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x4be1bb,_0x19484d){var _0x3b32eb=function(_0x150203){while(--_0x150203){_0x4be1bb['push'](_0x4be1bb['shift']());}};_0x3b32eb(++_0x19484d);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x4ab806,_0x52ec80){var _0x4b22ff=function(_0x2a4c46){while(--_0x2a4c46){_0x4ab806['push'](_0x4ab806['shift']());}};_0x4b22ff(++_0x52ec80);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 88f600d..c8160cf 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 _0x91a7=['busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','isArray','length','applications','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','interaction','ContactId','body','%s:%s:%s','./interval','consequence','info','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agents','agent','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x91a7,0xe7));var _0x791a=function(_0x780b79,_0x5792ae){_0x780b79=_0x780b79-0x0;var _0x106331=_0x91a7[_0x780b79];return _0x106331;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var fs=require('fs');var jayson=require(_0x791a('0x2'));var BPromise=require('bluebird');var uuid=require(_0x791a('0x3'));var utils=require('./applications/utils');var config=require(_0x791a('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x791a('0x5')),'mailQueueReport':require(_0x791a('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x791a('0x7')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x791a('0x8'))};var RuleEngine=require(_0x791a('0x9'));function getId(_0x5aa10a,_0x1a32b4,_0x12884d){return util[_0x791a('0xa')](_0x791a('0xb'),_0x5aa10a,_0x1a32b4||0x0,_0x12884d||0x0);}function getIntervals(_0x266e4b,_0x5249d5){var _0x21f0e0=[];if(!_[_0x791a('0xc')](_0x5249d5['IntervalId'])&&!_[_0x791a('0xc')](_0x266e4b[_0x5249d5[_0x791a('0xd')]])&&!_[_0x791a('0xc')](_0x266e4b[_0x5249d5[_0x791a('0xd')]][_0x791a('0xe')])){_0x21f0e0=_[_0x791a('0xf')](_0x266e4b[_0x5249d5['IntervalId']]['Intervals'],_0x791a('0x10'));}else if(!_[_0x791a('0xc')](_0x5249d5['interval'])){_0x21f0e0=[_0x5249d5[_0x791a('0x10')]];}return _0x21f0e0;}exports[_0x791a('0x11')]=function(_0x5d5b11){_0x5d5b11[_0x791a('0x12')]={};return new BPromise(function(_0x31b86d,_0x2ef5c5){var _0x5cdf2={'Start':function(_0x55e845){var _0x2ce2e0=this;return new Promise(function(_0x575d11,_0x43dea6){if(_0x55e845){try{var _0x355155=[];var _0x49ae3e=getId(_0x55e845[_0x791a('0x13')],_0x55e845['message']?_0x55e845[_0x791a('0x14')]['id']:0x0,_0x55e845['interaction']?_0x55e845['interaction']['id']:0x0);if(_0x55e845['applications']&&_[_0x791a('0x15')](_0x55e845['applications'])&&_0x55e845['applications'][_0x791a('0x16')]){for(var _0x5a702e=0x0;_0x5a702e<_0x55e845[_0x791a('0x17')][_0x791a('0x16')];_0x5a702e+=0x1){var _0x5f3cec=_0x55e845[_0x791a('0x17')][_0x5a702e];if(fs[_0x791a('0x18')](path[_0x791a('0x19')](__dirname,_0x791a('0x17'),_0x5f3cec['app']+_0x791a('0x1a')))){var _0x2054c6=[];switch(_0x5f3cec[_0x791a('0x1b')][_0x791a('0x1c')]()){case _0x791a('0x1d'):var _0x1091af=_0x5f3cec[_0x791a('0x1e')][_0x791a('0x1f')](',');if(_0x55e845[_0x791a('0x13')]===_0x791a('0x20')){_0x2054c6[_0x791a('0x21')](_0x1091af[0x0]);_0x2054c6['push'](_0x1091af[0x1]);_0x2054c6[_0x791a('0x21')](_0x1091af[_0x791a('0x22')](0x2,_0x1091af[_0x791a('0x16')])[_0x791a('0x19')](','));}else{_0x2054c6['push'](_0x1091af[0x0]);_0x2054c6[_0x791a('0x21')](_0x1091af[_0x791a('0x22')](0x1,_0x1091af['length'])[_0x791a('0x19')](','));}break;case _0x791a('0x23'):var _0x16dbaf=_0x5f3cec['appdata'][_0x791a('0x1f')](',');_0x2054c6[_0x791a('0x21')](_0x16dbaf[0x0]);_0x2054c6[_0x791a('0x21')](_0x16dbaf[0x1]);_0x2054c6[_0x791a('0x21')](_0x16dbaf[_0x791a('0x22')](0x2,_0x16dbaf[_0x791a('0x16')])[_0x791a('0x19')](','));break;case _0x791a('0x24'):var _0x58bbc0=_0x5f3cec[_0x791a('0x1e')][_0x791a('0x1f')](',');_0x2054c6[_0x791a('0x21')](_0x58bbc0[0x0]);_0x2054c6['push'](_0x58bbc0[0x1]);_0x2054c6[_0x791a('0x21')](_0x58bbc0[0x2]);_0x2054c6['push'](_0x58bbc0[0x3]);_0x2054c6[_0x791a('0x21')](_0x58bbc0[_0x791a('0x22')](0x4,_0x58bbc0[_0x791a('0x16')])[_0x791a('0x19')](','));break;case _0x791a('0x25'):var _0x32c7b2=_0x5f3cec[_0x791a('0x1e')]['split'](',');_0x2054c6[_0x791a('0x21')](_0x32c7b2[0x0]);_0x2054c6[_0x791a('0x21')](_0x32c7b2[0x1]);_0x2054c6[_0x791a('0x21')](_0x32c7b2[0x2]);_0x2054c6[_0x791a('0x21')](_0x32c7b2[0x3]);_0x2054c6[_0x791a('0x21')](_0x32c7b2['slice'](0x4,_0x32c7b2[_0x791a('0x16')])[_0x791a('0x19')](','));break;case _0x791a('0x14'):_0x2054c6[_0x791a('0x21')](_0x5f3cec[_0x791a('0x1e')]);break;case'tag':_0x2054c6[_0x791a('0x21')](_0x5f3cec[_0x791a('0x26')]);_0x2054c6[_0x791a('0x21')](_0x5f3cec[_0x791a('0x1e')]);break;case _0x791a('0x27'):var _0x52104d=utils[_0x791a('0x28')](_0x55e845['account'][_0x791a('0x29')],_0x55e845);var _0x4cd047=_0x5f3cec['appdata'][_0x791a('0x1f')](',');_0x2054c6[_0x791a('0x21')](_0x4cd047[0x0]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x1]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x2]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x3]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x4]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x5]);_0x2054c6['push'](_0x4cd047[0x6]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x7]);_0x2054c6['push'](_0x4cd047[0x8]);_0x2054c6[_0x791a('0x21')](_0x4cd047[0x9]);_0x2054c6['push'](_0x4cd047[0xa]);_0x2054c6[_0x791a('0x21')](_0x55e845[_0x791a('0x2a')]['id']);_0x2054c6['push'](_0x55e845[_0x791a('0x14')]['id']);_0x2054c6[_0x791a('0x21')](_0x5f3cec['ChatWebsiteId']);_0x2054c6[_0x791a('0x21')](_0x55e845[_0x791a('0x2a')][_0x791a('0x2b')]);_0x2054c6[_0x791a('0x21')](_0x55e845[_0x791a('0x2c')][_0x791a('0x2c')]);_0x2054c6[_0x791a('0x21')](_0x52104d);break;default:_0x2054c6=_[_0x791a('0xc')](_0x5f3cec[_0x791a('0x1e')])?[]:_0x5f3cec[_0x791a('0x1e')]['split'](',');}var _0x15f066={'id':util[_0x791a('0xa')](_0x791a('0x2d'),_0x49ae3e,_0x5f3cec['id'],_0x5f3cec['app']),'condition':require(_0x791a('0x2e'))['condition'](_0x49ae3e,getIntervals(_0x5d5b11['intervals'],_0x5f3cec),_0x5d5b11),'consequence':require('./applications/'+_0x5f3cec[_0x791a('0x1b')])[_0x791a('0x2f')](_0x49ae3e,_0x2054c6,_0x5d5b11,_0x55e845),'p':_0x5f3cec['priority']||0x0};logger[_0x791a('0x30')](_0x791a('0x31'),_0x15f066['id'],_0x791a('0x32'),getIntervals(_0x5d5b11[_0x791a('0x33')],_0x5f3cec)['join']('\x20|\x20'));_0x355155['push'](_0x15f066);}else{logger[_0x791a('0x34')](_0x791a('0x35'),path['join'](__dirname,_0x791a('0x17'),_0x5f3cec[_0x791a('0x1b')]+_0x791a('0x1a')));}}_0x5d5b11[_0x791a('0x12')][_0x49ae3e]=new RuleEngine(_0x355155);_0x5d5b11['rules'][_0x49ae3e][_0x791a('0x36')](_0x55e845,function(_0x5911db){logger[_0x791a('0x30')](_0x791a('0x37'),JSON[_0x791a('0x38')](_0x5911db[_0x791a('0x39')]));if(_0x5d5b11[_0x791a('0x12')][_0x49ae3e]){_0x5d5b11['rules'][_0x49ae3e][_0x791a('0x3a')](_0x791a('0x3b'));}});return _0x575d11({'code':0xc8,'message':_0x55e845});}else{logger[_0x791a('0x30')](_0x791a('0x3c'));return _0x575d11({'code':0xc8,'message':_0x55e845});}}catch(_0x313e5c){logger['error'](_0x313e5c[_0x791a('0x3d')]);return _0x43dea6(_0x2ce2e0[_0x791a('0x34')](0x1f4,_0x313e5c));}}return _0x43dea6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5b039e){var _0x1eb5b1=this;return new Promise(function(_0x338e70,_0x412bca){if(_0x5b039e['agent']&&_0x5b039e['agent']['id']){if(_0x5d5b11[_0x791a('0x3e')][_0x5b039e[_0x791a('0x3f')]['id']]){_0x5d5b11['agents'][_0x5b039e[_0x791a('0x3f')]['id']][_0x791a('0x40')]=![];_0x5d5b11[_0x791a('0x3e')][_0x5b039e['agent']['id']]['busyQueue']=undefined;}}if(_0x5b039e[_0x791a('0x14')]&&_0x5b039e[_0x791a('0x14')]['id']){try{var _0x2451c7=getId(_0x5b039e[_0x791a('0x13')],_0x5b039e['message']?_0x5b039e[_0x791a('0x14')]['id']:0x0,_0x5b039e[_0x791a('0x2a')]?_0x5b039e[_0x791a('0x2a')]['id']:0x0);if(_0x5d5b11[_0x791a('0x12')][_0x2451c7]){_0x5d5b11['rules'][_0x2451c7][_0x791a('0x3a')](_0x791a('0x41'));if(rpc[_0x5b039e[_0x791a('0x13')]+_0x791a('0x42')]){rpc[_0x5b039e[_0x791a('0x13')]+_0x791a('0x42')][_0x791a('0x43')](_0x2451c7,{'UserId':_0x5b039e['message'][_0x791a('0x44')]})[_0x791a('0x45')](function(_0x4bffa6){logger[_0x791a('0x34')](_0x791a('0x46'));});}}return _0x338e70({'code':0xc8,'message':_0x5b039e});}catch(_0x5dff77){logger[_0x791a('0x34')](_0x5dff77[_0x791a('0x3d')]);return _0x412bca(_0x1eb5b1[_0x791a('0x34')](0x1f4,_0x5dff77));}}logger[_0x791a('0x34')](_0x791a('0x47'));return _0x412bca(_0x1eb5b1['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5a616f){var _0x305033=this;return new Promise(function(_0x51b556,_0x4c7555){if(_0x5a616f[_0x791a('0x3f')]&&_0x5a616f['agent']['id']){try{if(_0x5d5b11[_0x791a('0x3e')][_0x5a616f[_0x791a('0x3f')]['id']]){_0x5d5b11['agents'][_0x5a616f['agent']['id']][_0x791a('0x40')]=![];_0x5d5b11['agents'][_0x5a616f[_0x791a('0x3f')]['id']][_0x791a('0x48')]=undefined;}return _0x51b556({'code':0xc8,'message':_0x5a616f});}catch(_0x383031){logger['error'](_0x383031[_0x791a('0x3d')]);return _0x4c7555(_0x305033[_0x791a('0x34')](0x1f4,_0x383031));}}logger['error'](_0x791a('0x47'));return _0x4c7555(_0x305033[_0x791a('0x34')](0x1f4,_0x791a('0x47')));});},'AbandonInteraction':function(_0x34d53c){var _0x450ad8=this;return new Promise(function(_0x38080b,_0x515bc6){if(_0x34d53c['channel']&&_0x34d53c[_0x791a('0x2a')]&&_0x34d53c['interaction']['id']){try{var _0x45541b=getId(_0x34d53c[_0x791a('0x13')],_0x34d53c[_0x791a('0x14')]?_0x34d53c[_0x791a('0x14')]['id']:0x0,_0x34d53c[_0x791a('0x2a')]?_0x34d53c[_0x791a('0x2a')]['id']:0x0);if(_0x5d5b11[_0x791a('0x12')][_0x45541b]){_0x5d5b11['rules'][_0x45541b][_0x791a('0x3a')](_0x791a('0x41'));}return _0x38080b({'code':0xc8,'message':_0x34d53c});}catch(_0xc34c5b){logger[_0x791a('0x34')](_0xc34c5b[_0x791a('0x3d')]);return _0x515bc6(_0x450ad8[_0x791a('0x34')](0x1f4,_0xc34c5b));}}logger[_0x791a('0x34')]('message\x20is\x20empty');return _0x515bc6(_0x450ad8[_0x791a('0x34')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4c4fc5){var _0x1cc240=this;return new Promise(function(_0x3c81e2,_0x216b69){if(_0x5d5b11[_0x791a('0x3e')][_0x791a('0x49')](_0x4c4fc5['id'])){for(var _0x129d60 in _0x4c4fc5[_0x791a('0x4a')]){if(_0x4c4fc5[_0x791a('0x4a')][_0x791a('0x49')](_0x129d60)){if(_0x5d5b11[_0x791a('0x3e')][_0x4c4fc5['id']][_0x791a('0x49')](_0x129d60+_0x791a('0x4b'))){_0x5d5b11[_0x791a('0x3e')][_0x4c4fc5['id']][_0x129d60+_0x791a('0x4b')]=parseInt(_0x4c4fc5[_0x791a('0x4a')][_0x129d60],0xa);}}}_0x5d5b11[_0x791a('0x3e')][_0x4c4fc5['id']][_0x791a('0x4c')]();return _0x3c81e2({'code':0xc8,'message':_0x5d5b11[_0x791a('0x3e')][_0x4c4fc5['id']]});}else{return _0x216b69(_0x1cc240[_0x791a('0x34')](0x1f4,_0x791a('0x4d')));}});},'Agents':function(_0x53b4c8){return new Promise(function(_0x215010,_0x32d521){var _0x380087=_[_0x791a('0x4e')](_0x5d5b11[_0x791a('0x3e')]);_0x215010({'count':_0x380087['length'],'rows':_0x380087});});},'ChatQueues':function(_0x42ce59){return new Promise(function(_0x3d24bd,_0x277774){var _0x120122=[];for(var _0x5468c4 in _0x5d5b11[_0x791a('0x4f')]){if(_0x5d5b11['chatQueues']['hasOwnProperty'](_0x5468c4)){var _0x482fa6=_0x5d5b11['chatQueues'][_0x5468c4];var _0x22aaf2={'id':_0x482fa6['id'],'available':_0x482fa6[_0x791a('0x50')],'loggedIn':_0x482fa6[_0x791a('0x51')],'name':_0x482fa6[_0x791a('0x52')],'paused':_0x482fa6[_0x791a('0x53')],'waiting':_0x482fa6[_0x791a('0x54')]};_0x120122[_0x791a('0x21')](_0x22aaf2);}}_0x3d24bd({'count':_0x120122['length'],'rows':_0x120122});});},'MailQueues':function(_0x522cb8){return new Promise(function(_0x3b22e2,_0x185620){var _0x535816=[];for(var _0x52ebab in _0x5d5b11[_0x791a('0x55')]){if(_0x5d5b11[_0x791a('0x55')]['hasOwnProperty'](_0x52ebab)){var _0xde2e9a=_0x5d5b11[_0x791a('0x55')][_0x52ebab];var _0x317ffa={'id':_0xde2e9a['id'],'available':_0xde2e9a[_0x791a('0x50')],'loggedIn':_0xde2e9a['loggedIn'],'name':_0xde2e9a['name'],'paused':_0xde2e9a[_0x791a('0x53')],'waiting':_0xde2e9a[_0x791a('0x54')]};_0x535816['push'](_0x317ffa);}}_0x3b22e2({'count':_0x535816[_0x791a('0x16')],'rows':_0x535816});});},'OpenchannelQueues':function(_0x13da2e){return new Promise(function(_0x10b51f,_0x3838c4){var _0x565c83=[];for(var _0x24efc2 in _0x5d5b11[_0x791a('0x56')]){if(_0x5d5b11[_0x791a('0x56')][_0x791a('0x49')](_0x24efc2)){var _0x372abb=_0x5d5b11[_0x791a('0x56')][_0x24efc2];var _0xe7bc82={'id':_0x372abb['id'],'available':_0x372abb[_0x791a('0x50')],'loggedIn':_0x372abb['loggedIn'],'name':_0x372abb['name'],'paused':_0x372abb['paused'],'waiting':_0x372abb[_0x791a('0x54')]};_0x565c83[_0x791a('0x21')](_0xe7bc82);}}_0x10b51f({'count':_0x565c83[_0x791a('0x16')],'rows':_0x565c83});});},'SmsQueues':function(_0x427765){return new Promise(function(_0x39e992,_0x1026be){var _0x348e54=[];for(var _0x20ce5b in _0x5d5b11[_0x791a('0x57')]){if(_0x5d5b11[_0x791a('0x57')]['hasOwnProperty'](_0x20ce5b)){var _0x3019da=_0x5d5b11[_0x791a('0x57')][_0x20ce5b];var _0x50cbb7={'id':_0x3019da['id'],'available':_0x3019da[_0x791a('0x50')],'loggedIn':_0x3019da[_0x791a('0x51')],'name':_0x3019da['name'],'paused':_0x3019da['paused'],'waiting':_0x3019da[_0x791a('0x54')]};_0x348e54[_0x791a('0x21')](_0x50cbb7);}}_0x39e992({'count':_0x348e54['length'],'rows':_0x348e54});});},'FaxQueues':function(_0x4c121e){return new Promise(function(_0x3dccfa,_0x13d6bf){var _0x46737e=[];for(var _0x5da9b8 in _0x5d5b11[_0x791a('0x58')]){if(_0x5d5b11['faxQueues'][_0x791a('0x49')](_0x5da9b8)){var _0x1de72e=_0x5d5b11[_0x791a('0x58')][_0x5da9b8];var _0x4072d0={'id':_0x1de72e['id'],'available':_0x1de72e[_0x791a('0x50')],'loggedIn':_0x1de72e[_0x791a('0x51')],'name':_0x1de72e['name'],'paused':_0x1de72e[_0x791a('0x53')],'waiting':_0x1de72e[_0x791a('0x54')]};_0x46737e[_0x791a('0x21')](_0x4072d0);}}_0x3dccfa({'count':_0x46737e[_0x791a('0x16')],'rows':_0x46737e});});},'WhatsappQueues':function(_0x4ffab6){return new Promise(function(_0x3133fd,_0x265584){var _0x2d2097=[];for(var _0xdca4ef in _0x5d5b11[_0x791a('0x59')]){if(_0x5d5b11[_0x791a('0x59')][_0x791a('0x49')](_0xdca4ef)){var _0x3dc34b=_0x5d5b11[_0x791a('0x59')][_0xdca4ef];var _0x2e437c={'id':_0x3dc34b['id'],'available':_0x3dc34b[_0x791a('0x50')],'loggedIn':_0x3dc34b[_0x791a('0x51')],'name':_0x3dc34b[_0x791a('0x52')],'paused':_0x3dc34b['paused'],'waiting':_0x3dc34b[_0x791a('0x54')]};_0x2d2097[_0x791a('0x21')](_0x2e437c);}}_0x3133fd({'count':_0x2d2097[_0x791a('0x16')],'rows':_0x2d2097});});},'ChatQueuesWaitingInteractions':function(_0x2cbe3a){return new Promise(function(_0x70fcdd,_0x5ab894){var _0x2c7197=_['values'](_0x5d5b11[_0x791a('0x5a')]);_0x70fcdd({'count':_0x2c7197['length'],'rows':_0x2c7197});});},'MailQueuesWaitingInteractions':function(_0x3a7f90){return new Promise(function(_0x446a39,_0x5ad3e4){var _0x449a6d=_[_0x791a('0x4e')](_0x5d5b11[_0x791a('0x5b')]);_0x446a39({'count':_0x449a6d['length'],'rows':_0x449a6d});});},'OpenchannelQueuesWaitingInteractions':function(_0x3d1ad2){return new Promise(function(_0x57b1b8,_0x28d7da){var _0x5d8660=_['values'](_0x5d5b11['openchannelQueuesWaitingInteractions']);_0x57b1b8({'count':_0x5d8660[_0x791a('0x16')],'rows':_0x5d8660});});},'SmsQueuesWaitingInteractions':function(_0x1b95ce){return new Promise(function(_0x31839a,_0xbcb58a){var _0x5ca5fa=_[_0x791a('0x4e')](_0x5d5b11[_0x791a('0x5c')]);_0x31839a({'count':_0x5ca5fa['length'],'rows':_0x5ca5fa});});},'FaxQueuesWaitingInteractions':function(_0x36cdb5){return new Promise(function(_0x2a63bf,_0x4b8c18){var _0x5a2684=_['values'](_0x5d5b11[_0x791a('0x5d')]);_0x2a63bf({'count':_0x5a2684[_0x791a('0x16')],'rows':_0x5a2684});});},'WhatsappQueuesWaitingInteractions':function(_0x20e309){return new Promise(function(_0x55f42d,_0x700308){var _0x31b3c6=_[_0x791a('0x4e')](_0x5d5b11[_0x791a('0x5e')]);_0x55f42d({'count':_0x31b3c6['length'],'rows':_0x31b3c6});});}};var _0x3604cd=jayson[_0x791a('0x5f')](_0x5cdf2)[_0x791a('0x60')]();_0x3604cd['on'](_0x791a('0x34'),function(_0x4aec8a){logger['error'](JSON[_0x791a('0x38')](_0x4aec8a));return _0x2ef5c5(_0x4aec8a);});_0x3604cd[_0x791a('0x11')](0x232c,_0x791a('0x61'),function(){console[_0x791a('0x62')](_0x791a('0x63'),0x232c);return _0x31b86d(_0x791a('0x64')+0x232c);});});}; \ No newline at end of file +var _0xeebe=['./interval','consequence','priority','info','Push\x20new\x20rule','intervals','\x20|\x20','execute','Applications\x20executed','stringify','matchPath','emit','complete','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','app','.js','appdata','split','mail','push','join','slice','dialogflow','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s'];(function(_0x43d3cb,_0x7c82c3){var _0x1361d6=function(_0x3c6f40){while(--_0x3c6f40){_0x43d3cb['push'](_0x43d3cb['shift']());}};_0x1361d6(++_0x7c82c3);}(_0xeebe,0xff));var _0xeeeb=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xeebe[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xeeeb('0x0'));var util=require('util');var path=require(_0xeeeb('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xeeeb('0x2'));var uuid=require(_0xeeeb('0x3'));var utils=require(_0xeeeb('0x4'));var config=require(_0xeeeb('0x5'));var logger=require(_0xeeeb('0x6'))(_0xeeeb('0x7'));var rpc={'openchannelQueueReport':require(_0xeeeb('0x8')),'mailQueueReport':require(_0xeeeb('0x9')),'chatQueueReport':require(_0xeeeb('0xa')),'smsQueueReport':require(_0xeeeb('0xb')),'faxQueueReport':require(_0xeeeb('0xc')),'whatsappQueueReport':require(_0xeeeb('0xd'))};var RuleEngine=require(_0xeeeb('0xe'));function getId(_0x1f88ea,_0xc3e1ba,_0x263799){return util[_0xeeeb('0xf')](_0xeeeb('0x10'),_0x1f88ea,_0xc3e1ba||0x0,_0x263799||0x0);}function getIntervals(_0x4a1161,_0x4f4bb7){var _0x2564e0=[];if(!_[_0xeeeb('0x11')](_0x4f4bb7[_0xeeeb('0x12')])&&!_['isNil'](_0x4a1161[_0x4f4bb7[_0xeeeb('0x12')]])&&!_[_0xeeeb('0x11')](_0x4a1161[_0x4f4bb7[_0xeeeb('0x12')]]['Intervals'])){_0x2564e0=_[_0xeeeb('0x13')](_0x4a1161[_0x4f4bb7['IntervalId']]['Intervals'],_0xeeeb('0x14'));}else if(!_[_0xeeeb('0x11')](_0x4f4bb7[_0xeeeb('0x14')])){_0x2564e0=[_0x4f4bb7[_0xeeeb('0x14')]];}return _0x2564e0;}exports[_0xeeeb('0x15')]=function(_0x1bf055){_0x1bf055[_0xeeeb('0x16')]={};return new BPromise(function(_0x2ebb9a,_0x40b8e8){var _0x21cf7a={'Start':function(_0x441095){var _0xd23e0e=this;return new Promise(function(_0x1cbbbc,_0x25a5be){if(_0x441095){try{var _0x253cf4=[];var _0x1b1d02=getId(_0x441095[_0xeeeb('0x17')],_0x441095[_0xeeeb('0x18')]?_0x441095[_0xeeeb('0x18')]['id']:0x0,_0x441095[_0xeeeb('0x19')]?_0x441095[_0xeeeb('0x19')]['id']:0x0);if(_0x441095[_0xeeeb('0x1a')]&&_[_0xeeeb('0x1b')](_0x441095[_0xeeeb('0x1a')])&&_0x441095[_0xeeeb('0x1a')][_0xeeeb('0x1c')]){for(var _0x434cdf=0x0;_0x434cdf<_0x441095['applications'][_0xeeeb('0x1c')];_0x434cdf+=0x1){var _0x496311=_0x441095['applications'][_0x434cdf];if(fs['existsSync'](path['join'](__dirname,_0xeeeb('0x1a'),_0x496311[_0xeeeb('0x1d')]+_0xeeeb('0x1e')))){var _0x2d2b7f=[];switch(_0x496311[_0xeeeb('0x1d')]['toLowerCase']()){case'autoreply':var _0x3409aa=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');if(_0x441095[_0xeeeb('0x17')]===_0xeeeb('0x21')){_0x2d2b7f['push'](_0x3409aa[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[0x1]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa['slice'](0x2,_0x3409aa['length'])[_0xeeeb('0x23')](','));}else{_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x3409aa[_0xeeeb('0x24')](0x1,_0x3409aa[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));}break;case _0xeeeb('0x25'):var _0x2f5854=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x2f5854[0x0]);_0x2d2b7f['push'](_0x2f5854[0x1]);_0x2d2b7f['push'](_0x2f5854[_0xeeeb('0x24')](0x2,_0x2f5854[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));break;case'dialogflowv2':var _0x1d7c1e=_0x496311[_0xeeeb('0x1f')]['split'](',');_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x1]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x1d7c1e[_0xeeeb('0x24')](0x4,_0x1d7c1e['length'])[_0xeeeb('0x23')](','));break;case'amazonlex':var _0x21a812=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[0x0]);_0x2d2b7f['push'](_0x21a812[0x1]);_0x2d2b7f['push'](_0x21a812[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x21a812[_0xeeeb('0x24')](0x4,_0x21a812[_0xeeeb('0x1c')])[_0xeeeb('0x23')](','));break;case _0xeeeb('0x18'):_0x2d2b7f['push'](_0x496311[_0xeeeb('0x1f')]);break;case'tag':_0x2d2b7f[_0xeeeb('0x22')](_0x496311[_0xeeeb('0x26')]);_0x2d2b7f[_0xeeeb('0x22')](_0x496311[_0xeeeb('0x1f')]);break;case'tvox':var _0x4fa5f0=utils[_0xeeeb('0x27')](_0x441095[_0xeeeb('0x28')][_0xeeeb('0x29')],_0x441095);var _0x28c4d7=_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x0]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x1]);_0x2d2b7f['push'](_0x28c4d7[0x2]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x3]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x4]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x5]);_0x2d2b7f['push'](_0x28c4d7[0x6]);_0x2d2b7f['push'](_0x28c4d7[0x7]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0x8]);_0x2d2b7f['push'](_0x28c4d7[0x9]);_0x2d2b7f[_0xeeeb('0x22')](_0x28c4d7[0xa]);_0x2d2b7f['push'](_0x441095[_0xeeeb('0x19')]['id']);_0x2d2b7f['push'](_0x441095['message']['id']);_0x2d2b7f[_0xeeeb('0x22')](_0x496311['ChatWebsiteId']);_0x2d2b7f[_0xeeeb('0x22')](_0x441095['interaction'][_0xeeeb('0x2a')]);_0x2d2b7f[_0xeeeb('0x22')](_0x441095[_0xeeeb('0x2b')]['body']);_0x2d2b7f[_0xeeeb('0x22')](_0x4fa5f0);break;default:_0x2d2b7f=_[_0xeeeb('0x11')](_0x496311['appdata'])?[]:_0x496311[_0xeeeb('0x1f')][_0xeeeb('0x20')](',');}var _0xfe4a35={'id':util[_0xeeeb('0xf')](_0xeeeb('0x2c'),_0x1b1d02,_0x496311['id'],_0x496311['app']),'condition':require(_0xeeeb('0x2d'))['condition'](_0x1b1d02,getIntervals(_0x1bf055['intervals'],_0x496311),_0x1bf055),'consequence':require('./applications/'+_0x496311['app'])[_0xeeeb('0x2e')](_0x1b1d02,_0x2d2b7f,_0x1bf055,_0x441095),'p':_0x496311[_0xeeeb('0x2f')]||0x0};logger[_0xeeeb('0x30')](_0xeeeb('0x31'),_0xfe4a35['id'],'on\x20interval',getIntervals(_0x1bf055[_0xeeeb('0x32')],_0x496311)[_0xeeeb('0x23')](_0xeeeb('0x33')));_0x253cf4[_0xeeeb('0x22')](_0xfe4a35);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x496311[_0xeeeb('0x1d')]+_0xeeeb('0x1e')));}}_0x1bf055[_0xeeeb('0x16')][_0x1b1d02]=new RuleEngine(_0x253cf4);_0x1bf055[_0xeeeb('0x16')][_0x1b1d02][_0xeeeb('0x34')](_0x441095,function(_0x226bfe){logger['info'](_0xeeeb('0x35'),JSON[_0xeeeb('0x36')](_0x226bfe[_0xeeeb('0x37')]));if(_0x1bf055[_0xeeeb('0x16')][_0x1b1d02]){_0x1bf055['rules'][_0x1b1d02][_0xeeeb('0x38')](_0xeeeb('0x39'));}});return _0x1cbbbc({'code':0xc8,'message':_0x441095});}else{logger[_0xeeeb('0x30')]('No\x20applications\x20to\x20execute');return _0x1cbbbc({'code':0xc8,'message':_0x441095});}}catch(_0x986d6a){logger[_0xeeeb('0x3a')](_0x986d6a['stack']);return _0x25a5be(_0xd23e0e[_0xeeeb('0x3a')](0x1f4,_0x986d6a));}}return _0x25a5be(_0xeeeb('0x3b'));});},'AcceptMessage':function(_0x1b7d0b){var _0x2ebf0d=this;return new Promise(function(_0x443057,_0x19f204){if(_0x1b7d0b['agent']&&_0x1b7d0b[_0xeeeb('0x3c')]['id']){if(_0x1bf055['agents'][_0x1b7d0b[_0xeeeb('0x3c')]['id']]){_0x1bf055[_0xeeeb('0x3d')][_0x1b7d0b[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3e')]=![];_0x1bf055['agents'][_0x1b7d0b[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3f')]=undefined;}}if(_0x1b7d0b[_0xeeeb('0x18')]&&_0x1b7d0b[_0xeeeb('0x18')]['id']){try{var _0x5293b6=getId(_0x1b7d0b[_0xeeeb('0x17')],_0x1b7d0b['message']?_0x1b7d0b[_0xeeeb('0x18')]['id']:0x0,_0x1b7d0b[_0xeeeb('0x19')]?_0x1b7d0b[_0xeeeb('0x19')]['id']:0x0);if(_0x1bf055[_0xeeeb('0x16')][_0x5293b6]){_0x1bf055[_0xeeeb('0x16')][_0x5293b6][_0xeeeb('0x38')](_0xeeeb('0x40'));if(rpc[_0x1b7d0b['channel']+_0xeeeb('0x41')]){rpc[_0x1b7d0b[_0xeeeb('0x17')]+'QueueReport'][_0xeeeb('0x42')](_0x5293b6,{'UserId':_0x1b7d0b[_0xeeeb('0x18')][_0xeeeb('0x43')]})[_0xeeeb('0x44')](function(_0x31b100){logger[_0xeeeb('0x3a')](_0xeeeb('0x45'));});}}return _0x443057({'code':0xc8,'message':_0x1b7d0b});}catch(_0x152d64){logger[_0xeeeb('0x3a')](_0x152d64[_0xeeeb('0x46')]);return _0x19f204(_0x2ebf0d['error'](0x1f4,_0x152d64));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x19f204(_0x2ebf0d[_0xeeeb('0x3a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5c03ad){var _0x1cc95b=this;return new Promise(function(_0x5bd1fb,_0x4b3f9f){if(_0x5c03ad[_0xeeeb('0x3c')]&&_0x5c03ad[_0xeeeb('0x3c')]['id']){try{if(_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad['agent']['id']]){_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3e')]=![];_0x1bf055[_0xeeeb('0x3d')][_0x5c03ad[_0xeeeb('0x3c')]['id']][_0xeeeb('0x3f')]=undefined;}return _0x5bd1fb({'code':0xc8,'message':_0x5c03ad});}catch(_0x53e185){logger[_0xeeeb('0x3a')](_0x53e185['stack']);return _0x4b3f9f(_0x1cc95b[_0xeeeb('0x3a')](0x1f4,_0x53e185));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x4b3f9f(_0x1cc95b[_0xeeeb('0x3a')](0x1f4,_0xeeeb('0x47')));});},'AbandonInteraction':function(_0x43ab07){var _0x587bcb=this;return new Promise(function(_0x4ec59e,_0x4fdf85){if(_0x43ab07['channel']&&_0x43ab07[_0xeeeb('0x19')]&&_0x43ab07[_0xeeeb('0x19')]['id']){try{var _0x30bb33=getId(_0x43ab07[_0xeeeb('0x17')],_0x43ab07[_0xeeeb('0x18')]?_0x43ab07[_0xeeeb('0x18')]['id']:0x0,_0x43ab07[_0xeeeb('0x19')]?_0x43ab07[_0xeeeb('0x19')]['id']:0x0);if(_0x1bf055['rules'][_0x30bb33]){_0x1bf055['rules'][_0x30bb33]['emit'](_0xeeeb('0x40'));}return _0x4ec59e({'code':0xc8,'message':_0x43ab07});}catch(_0x1ad67b){logger['error'](_0x1ad67b[_0xeeeb('0x46')]);return _0x4fdf85(_0x587bcb['error'](0x1f4,_0x1ad67b));}}logger[_0xeeeb('0x3a')](_0xeeeb('0x47'));return _0x4fdf85(_0x587bcb['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1b2e9e){var _0x9254bd=this;return new Promise(function(_0x2e631a,_0x2fdf5d){if(_0x1bf055['agents'][_0xeeeb('0x48')](_0x1b2e9e['id'])){for(var _0x300e8f in _0x1b2e9e[_0xeeeb('0x49')]){if(_0x1b2e9e[_0xeeeb('0x49')]['hasOwnProperty'](_0x300e8f)){if(_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0xeeeb('0x48')](_0x300e8f+'CurrentCapacity')){_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0x300e8f+_0xeeeb('0x4a')]=parseInt(_0x1b2e9e[_0xeeeb('0x49')][_0x300e8f],0xa);}}}_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']][_0xeeeb('0x4b')]();return _0x2e631a({'code':0xc8,'message':_0x1bf055[_0xeeeb('0x3d')][_0x1b2e9e['id']]});}else{return _0x2fdf5d(_0x9254bd['error'](0x1f4,_0xeeeb('0x4c')));}});},'Agents':function(_0x346ecc){return new Promise(function(_0x5b0bcf,_0xc679ac){var _0xd6851b=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x3d')]);_0x5b0bcf({'count':_0xd6851b[_0xeeeb('0x1c')],'rows':_0xd6851b});});},'ChatQueues':function(_0x20b42e){return new Promise(function(_0x12d595,_0x2555e5){var _0x4585b7=[];for(var _0x1069fb in _0x1bf055['chatQueues']){if(_0x1bf055[_0xeeeb('0x4e')]['hasOwnProperty'](_0x1069fb)){var _0x1e087b=_0x1bf055[_0xeeeb('0x4e')][_0x1069fb];var _0x539619={'id':_0x1e087b['id'],'available':_0x1e087b['available'],'loggedIn':_0x1e087b[_0xeeeb('0x4f')],'name':_0x1e087b['name'],'paused':_0x1e087b[_0xeeeb('0x50')],'waiting':_0x1e087b[_0xeeeb('0x51')]};_0x4585b7['push'](_0x539619);}}_0x12d595({'count':_0x4585b7[_0xeeeb('0x1c')],'rows':_0x4585b7});});},'MailQueues':function(_0x1655f6){return new Promise(function(_0x1a3002,_0x3dd195){var _0x11d8af=[];for(var _0x388a2e in _0x1bf055[_0xeeeb('0x52')]){if(_0x1bf055[_0xeeeb('0x52')]['hasOwnProperty'](_0x388a2e)){var _0x24e384=_0x1bf055[_0xeeeb('0x52')][_0x388a2e];var _0xee4612={'id':_0x24e384['id'],'available':_0x24e384[_0xeeeb('0x53')],'loggedIn':_0x24e384[_0xeeeb('0x4f')],'name':_0x24e384[_0xeeeb('0x54')],'paused':_0x24e384['paused'],'waiting':_0x24e384[_0xeeeb('0x51')]};_0x11d8af[_0xeeeb('0x22')](_0xee4612);}}_0x1a3002({'count':_0x11d8af[_0xeeeb('0x1c')],'rows':_0x11d8af});});},'OpenchannelQueues':function(_0x149708){return new Promise(function(_0x4704f2,_0x170601){var _0x2bd357=[];for(var _0x5b4d5c in _0x1bf055['openchannelQueues']){if(_0x1bf055[_0xeeeb('0x55')]['hasOwnProperty'](_0x5b4d5c)){var _0xedb3a2=_0x1bf055[_0xeeeb('0x55')][_0x5b4d5c];var _0x384afa={'id':_0xedb3a2['id'],'available':_0xedb3a2['available'],'loggedIn':_0xedb3a2[_0xeeeb('0x4f')],'name':_0xedb3a2[_0xeeeb('0x54')],'paused':_0xedb3a2['paused'],'waiting':_0xedb3a2[_0xeeeb('0x51')]};_0x2bd357['push'](_0x384afa);}}_0x4704f2({'count':_0x2bd357[_0xeeeb('0x1c')],'rows':_0x2bd357});});},'SmsQueues':function(_0x5bf11b){return new Promise(function(_0x40729c,_0xbca82b){var _0x201483=[];for(var _0x4ee448 in _0x1bf055[_0xeeeb('0x56')]){if(_0x1bf055['smsQueues'][_0xeeeb('0x48')](_0x4ee448)){var _0x4b273b=_0x1bf055['smsQueues'][_0x4ee448];var _0x4f875f={'id':_0x4b273b['id'],'available':_0x4b273b[_0xeeeb('0x53')],'loggedIn':_0x4b273b[_0xeeeb('0x4f')],'name':_0x4b273b[_0xeeeb('0x54')],'paused':_0x4b273b['paused'],'waiting':_0x4b273b[_0xeeeb('0x51')]};_0x201483[_0xeeeb('0x22')](_0x4f875f);}}_0x40729c({'count':_0x201483['length'],'rows':_0x201483});});},'FaxQueues':function(_0x46a3d7){return new Promise(function(_0x10a44c,_0x289410){var _0x2a15ff=[];for(var _0x569b9a in _0x1bf055['faxQueues']){if(_0x1bf055[_0xeeeb('0x57')][_0xeeeb('0x48')](_0x569b9a)){var _0x397714=_0x1bf055['faxQueues'][_0x569b9a];var _0x1ecd3d={'id':_0x397714['id'],'available':_0x397714['available'],'loggedIn':_0x397714[_0xeeeb('0x4f')],'name':_0x397714['name'],'paused':_0x397714[_0xeeeb('0x50')],'waiting':_0x397714[_0xeeeb('0x51')]};_0x2a15ff[_0xeeeb('0x22')](_0x1ecd3d);}}_0x10a44c({'count':_0x2a15ff[_0xeeeb('0x1c')],'rows':_0x2a15ff});});},'WhatsappQueues':function(_0x3b72cd){return new Promise(function(_0x1be024,_0x5962f1){var _0x476b32=[];for(var _0x1537da in _0x1bf055[_0xeeeb('0x58')]){if(_0x1bf055[_0xeeeb('0x58')][_0xeeeb('0x48')](_0x1537da)){var _0x53f878=_0x1bf055[_0xeeeb('0x58')][_0x1537da];var _0x4c3b57={'id':_0x53f878['id'],'available':_0x53f878[_0xeeeb('0x53')],'loggedIn':_0x53f878['loggedIn'],'name':_0x53f878[_0xeeeb('0x54')],'paused':_0x53f878['paused'],'waiting':_0x53f878[_0xeeeb('0x51')]};_0x476b32[_0xeeeb('0x22')](_0x4c3b57);}}_0x1be024({'count':_0x476b32['length'],'rows':_0x476b32});});},'ChatQueuesWaitingInteractions':function(_0x86be9d){return new Promise(function(_0x56fbdc,_0x49e49c){var _0x54e154=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x59')]);_0x56fbdc({'count':_0x54e154['length'],'rows':_0x54e154});});},'MailQueuesWaitingInteractions':function(_0x5af5a4){return new Promise(function(_0x3caeb1,_0x4fb2fe){var _0x20dd64=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5a')]);_0x3caeb1({'count':_0x20dd64[_0xeeeb('0x1c')],'rows':_0x20dd64});});},'OpenchannelQueuesWaitingInteractions':function(_0x14f33b){return new Promise(function(_0x4192a3,_0xace43d){var _0x4931cb=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5b')]);_0x4192a3({'count':_0x4931cb[_0xeeeb('0x1c')],'rows':_0x4931cb});});},'SmsQueuesWaitingInteractions':function(_0x301982){return new Promise(function(_0x2feddf,_0x17f378){var _0x479c2e=_['values'](_0x1bf055[_0xeeeb('0x5c')]);_0x2feddf({'count':_0x479c2e[_0xeeeb('0x1c')],'rows':_0x479c2e});});},'FaxQueuesWaitingInteractions':function(_0x44109e){return new Promise(function(_0x1459d0,_0x5c3813){var _0x40185f=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5d')]);_0x1459d0({'count':_0x40185f[_0xeeeb('0x1c')],'rows':_0x40185f});});},'WhatsappQueuesWaitingInteractions':function(_0x11aca1){return new Promise(function(_0xd21fba,_0x2e64ff){var _0x12c0c8=_[_0xeeeb('0x4d')](_0x1bf055[_0xeeeb('0x5e')]);_0xd21fba({'count':_0x12c0c8[_0xeeeb('0x1c')],'rows':_0x12c0c8});});}};var _0x226dbb=jayson[_0xeeeb('0x5f')](_0x21cf7a)[_0xeeeb('0x60')]();_0x226dbb['on'](_0xeeeb('0x3a'),function(_0x47d725){logger[_0xeeeb('0x3a')](JSON[_0xeeeb('0x36')](_0x47d725));return _0x40b8e8(_0x47d725);});_0x226dbb[_0xeeeb('0x15')](0x232c,_0xeeeb('0x61'),function(){console[_0xeeeb('0x62')](_0xeeeb('0x63'),0x232c);return _0x2ebb9a('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d659789..d330a3b 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 _0x3203=['join','when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','bluebird','jayson/promise','../../../config/logger','client','http','request','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3203,0xd1));var _0x3320=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x3203[_0x28d18d];return _0x470640;};'use strict';var util=require('util');var BPromise=require(_0x3320('0x0'));var jayson=require(_0x3320('0x1'));var _=require('lodash');var logger=require(_0x3320('0x2'))('routing');var client=jayson[_0x3320('0x3')][_0x3320('0x4')]({'port':0x232a});function request(_0x49ed0c,_0x2d5549){return new BPromise(function(_0xe249ee,_0x3a8007){return client[_0x3320('0x5')](_0x49ed0c,_0x2d5549)[_0x3320('0x6')](function(_0x4ecb47){if(_0x4ecb47[_0x3320('0x7')]){return _0x3a8007(_0x4ecb47[_0x3320('0x7')]['message']);}else{return _0xe249ee(_0x4ecb47[_0x3320('0x8')]);}})[_0x3320('0x9')](function(_0x39e1fe){return _0x3a8007(_0x39e1fe);});});}exports[_0x3320('0xa')]=function(_0x462278,_0x4a3753,_0x1257d3){return function(_0x9db5de){if(_0x1257d3[_0x3320('0xb')]&&!_0x1257d3[_0x3320('0xb')][_0x462278]){logger[_0x3320('0xc')](_0x3320('0xd'),_0x462278);return _0x9db5de['stop']();}var _0x20c869=[];for(var _0x4af659=0x0;_0x4af659<_0x4a3753[_0x3320('0xe')];_0x4af659+=0x1){_0x20c869[_0x3320('0xf')](request(_0x3320('0x10'),{'command':util['format']('iftime\x20%s',_0x4a3753[_0x4af659])})[_0x3320('0x6')](function(_0xb637b){return _0xb637b&&_0xb637b[_0x3320('0x11')]&&_0xb637b[_0x3320('0x11')][_0x3320('0x12')](_0x3320('0x13'))>=0x0?!![]:![];})['catch'](function(_0x26d1c2){logger[_0x3320('0x7')](_0x3320('0x14'),_0x462278,_0x4a3753[_0x4af659]);}));}BPromise[_0x3320('0x15')](_0x20c869)[_0x3320('0x6')](function(_0xa75b5e){var _0x17eae0=_[_0x3320('0x16')](_0xa75b5e);logger[_0x3320('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x462278,_0x4a3753[_0x3320('0x17')]('\x20|\x20'),_0x17eae0);_0x9db5de[_0x3320('0x18')](_0x17eae0);})['catch'](function(_0x2d92b4){console[_0x3320('0x19')](_0x2d92b4);logger[_0x3320('0x7')](_0x3320('0x1a'),_0x462278,_0x4a3753['join'](_0x3320('0x1b')),_0x2d92b4[_0x3320('0x1c')]);_0x9db5de['stop']();});};}; \ No newline at end of file +var _0x974d=['log','stack','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x406e46,_0x5799cb){var _0x4a3742=function(_0x1fa435){while(--_0x1fa435){_0x406e46['push'](_0x406e46['shift']());}};_0x4a3742(++_0x5799cb);}(_0x974d,0xe2));var _0xd974=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x974d[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xd974('0x0'));var _=require(_0xd974('0x1'));var logger=require('../../../config/logger')(_0xd974('0x2'));var client=jayson[_0xd974('0x3')][_0xd974('0x4')]({'port':0x232a});function request(_0x11bad3,_0x346700){return new BPromise(function(_0x156c12,_0x1702f8){return client[_0xd974('0x5')](_0x11bad3,_0x346700)[_0xd974('0x6')](function(_0x33293d){if(_0x33293d[_0xd974('0x7')]){return _0x1702f8(_0x33293d['error'][_0xd974('0x8')]);}else{return _0x156c12(_0x33293d[_0xd974('0x9')]);}})[_0xd974('0xa')](function(_0x1199c3){return _0x1702f8(_0x1199c3);});});}exports[_0xd974('0xb')]=function(_0x20cd3d,_0x597228,_0x479865){return function(_0x331ffb){if(_0x479865[_0xd974('0xc')]&&!_0x479865['rules'][_0x20cd3d]){logger['info'](_0xd974('0xd'),_0x20cd3d);return _0x331ffb[_0xd974('0xe')]();}var _0x1a9bc7=[];for(var _0x1d1fdd=0x0;_0x1d1fdd<_0x597228['length'];_0x1d1fdd+=0x1){_0x1a9bc7[_0xd974('0xf')](request(_0xd974('0x10'),{'command':util[_0xd974('0x11')](_0xd974('0x12'),_0x597228[_0x1d1fdd])})[_0xd974('0x6')](function(_0x4bcb7e){return _0x4bcb7e&&_0x4bcb7e[_0xd974('0x8')]&&_0x4bcb7e[_0xd974('0x8')][_0xd974('0x13')](_0xd974('0x14'))>=0x0?!![]:![];})[_0xd974('0xa')](function(_0x1b2f1c){logger[_0xd974('0x7')]('[%s][INTERVAL]\x20%s',_0x20cd3d,_0x597228[_0x1d1fdd]);}));}BPromise[_0xd974('0x15')](_0x1a9bc7)['then'](function(_0x48b652){var _0x47acd1=_[_0xd974('0x16')](_0x48b652);logger['info'](_0xd974('0x17'),_0x20cd3d,_0x597228[_0xd974('0x18')](_0xd974('0x19')),_0x47acd1);_0x331ffb['when'](_0x47acd1);})['catch'](function(_0x373a19){console[_0xd974('0x1a')](_0x373a19);logger[_0xd974('0x7')](_0xd974('0x17'),_0x20cd3d,_0x597228['join'](_0xd974('0x19')),_0x373a19[_0xd974('0x1b')]);_0x331ffb['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index abf3cb2..bfb21a6 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 _0x4ded=['agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','diffTime'];(function(_0x3ccf84,_0x6b8039){var _0x47d751=function(_0x551fcc){while(--_0x551fcc){_0x3ccf84['push'](_0x3ccf84['shift']());}};_0x47d751(++_0x6b8039);}(_0x4ded,0x116));var _0xd4de=function(_0x12075d,_0xeaf76c){_0x12075d=_0x12075d-0x0;var _0x378813=_0x4ded[_0x12075d];return _0x378813;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var utils=require(_0xd4de('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fa334,_0x2349f5){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x5'),_0x1fa334[_0xd4de('0x6')],_0x1fa334[_0xd4de('0x7')],_0x1fa334[_0xd4de('0x8')],_0x1fa334[_0xd4de('0x9')],_0x1fa334['interface'],_0x1fa334[_0xd4de('0xa')],_0x1fa334[_0xd4de('0xb')],_0x1fa334[_0xd4de('0xc')]));if(_0x1fa334[_0xd4de('0x8')]){utils[_0xd4de('0xd')](_0x1fa334[_0xd4de('0x8')])['then'](function(_0xb7e8cf){if(_0xb7e8cf){_0x1fa334['type']=_0xb7e8cf['type'];_0x1fa334['agentacw']=_0x1fa334[_0xd4de('0xe')]?_0xb7e8cf[_0xd4de('0xf')]:![];_0x1fa334['acwtime']=_0x1fa334['agentacw']?_0xb7e8cf['acwTimeout']:0x0;}utils[_0xd4de('0x10')]('CreateVoiceAgentReport',_0x1fa334);});}else{utils[_0xd4de('0x10')](_0xd4de('0x11'),_0x1fa334);}if(_0x2349f5){delete transfers[_0x1fa334[_0xd4de('0x6')]];}else{delete agents[_0x1fa334[_0xd4de('0x12')]];}}exports[_0xd4de('0x13')]=function(_0x3af6e0){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x15'),_0x3af6e0[_0xd4de('0x6')]),_0x3af6e0);agents[_0x3af6e0[_0xd4de('0x12')]]=_0x3af6e0;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x16')]=utils[_0xd4de('0x17')]();agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x18');agents[_0x3af6e0['destuniqueid']]['connectedlinenum']=null;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x19')]=null;utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3af6e0['uniqueid'],agents[_0x3af6e0[_0xd4de('0x12')]]['membername'],_0x3af6e0[_0xd4de('0x12')]));}catch(_0x29c028){utils['error'](util[_0xd4de('0x4')]('[%s][agents][agentcalled]',_0x3af6e0[_0xd4de('0x6')]),_0x29c028);}};exports[_0xd4de('0x1a')]=function(_0x2bad14){try{if(!_[_0xd4de('0x1b')](agents[_0x2bad14['destuniqueid']])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x2bad14);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x1d'),_0x2bad14[_0xd4de('0x6')],agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x9')],_0x2bad14['destuniqueid']));agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1a')]=!![];agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1e')]=utils[_0xd4de('0x17')]();agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x20')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]]['holdtime']=_0x2bad14[_0xd4de('0x21')]?parseInt(_0x2bad14[_0xd4de('0x21')])/0x3e8:0x0;agents[_0x2bad14['destuniqueid']][_0xd4de('0x22')]=0x0;unanswered['push'](_0x2bad14[_0xd4de('0x12')]);}}catch(_0x32e407){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x32e407);}};exports[_0xd4de('0x24')]=function(_0x50cb73){try{_[_0xd4de('0x25')](agents,function(_0x1804c7,_0x55f9f9){if(_0x1804c7['uniqueid']==_0x50cb73['uniqueid']&&!_[_0xd4de('0x26')](unanswered,_0x1804c7['destuniqueid'])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x50cb73);utils['info'](util[_0xd4de('0x4')](_0xd4de('0x28'),_0x50cb73['uniqueid'],_0x1804c7[_0xd4de('0x9')],_0x1804c7[_0xd4de('0x12')]));_0x1804c7['agentringnoanswer']=!![];_0x1804c7['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x1804c7[_0xd4de('0xc')]=_0xd4de('0x29');_0x1804c7[_0xd4de('0x20')]='abandoned';_0x1804c7[_0xd4de('0x2a')]=_0x50cb73[_0xd4de('0x2a')];_0x1804c7['talktime']=0x0;writeDB(_0x1804c7);}});}catch(_0x329d49){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x329d49);}};exports[_0xd4de('0x2b')]=function(_0x53441c){try{if(agents[_0x53441c['destuniqueid']]){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c['uniqueid']),_0x53441c);utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53441c[_0xd4de('0x6')],agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x9')],_0x53441c[_0xd4de('0x12')]));agents[_0x53441c['destuniqueid']]['agentconnectAt']=utils[_0xd4de('0x17')]();agents[_0x53441c['destuniqueid']][_0xd4de('0xb')]=_0x53441c['connectedlinenum'];agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x19')]=_0x53441c[_0xd4de('0x19')];agents[_0x53441c[_0xd4de('0x12')]]['holdtime']=_0x53441c[_0xd4de('0x21')];agents[_0x53441c['destuniqueid']][_0xd4de('0xc')]=_0xd4de('0x2d');_[_0xd4de('0x25')](agents,function(_0x4517a6,_0x349c5f){if(_0x4517a6[_0xd4de('0x12')]!=_0x53441c[_0xd4de('0x12')]&&_0x4517a6['uniqueid']==_0x53441c[_0xd4de('0x6')]){_0x4517a6[_0xd4de('0x22')]=0x0;_0x4517a6[_0xd4de('0x2a')]=_0x53441c[_0xd4de('0x21')];_0x4517a6[_0xd4de('0x1a')]=!![];_0x4517a6['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x4517a6[_0xd4de('0xc')]=_0xd4de('0x2e');_0x4517a6['reason']=_0xd4de('0x2e');_0x4517a6[_0xd4de('0x2f')]=_0x53441c[_0xd4de('0x12')];_0x4517a6['answeredelsewheremembername']=_0x53441c[_0xd4de('0x9')];writeDB(_0x4517a6);}});}}catch(_0x10a42c){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c[_0xd4de('0x6')]),_0x10a42c);}};exports[_0xd4de('0xe')]=function(_0x5ecbbd){try{if(!_[_0xd4de('0x1b')](agents[_0x5ecbbd[_0xd4de('0x12')]])){utils[_0xd4de('0x14')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0x5ecbbd);utils[_0xd4de('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5ecbbd[_0xd4de('0x6')],agents[_0x5ecbbd[_0xd4de('0x12')]]['membername'],_0x5ecbbd[_0xd4de('0x12')]));agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xe')]=!![];agents[_0x5ecbbd[_0xd4de('0x12')]]['agentcompleteAt']=utils[_0xd4de('0x17')]();agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x32')],agents[_0x5ecbbd['destuniqueid']][_0xd4de('0x33')]);agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x20')]=_0x5ecbbd[_0xd4de('0x20')];agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x34');writeDB(agents[_0x5ecbbd[_0xd4de('0x12')]]);}}catch(_0xaf442c){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0xaf442c);}};exports[_0xd4de('0x35')]=function(_0x518bfe){try{if(!_[_0xd4de('0x1b')](agents[_0x518bfe[_0xd4de('0x36')]])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x518bfe);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x38'),_0x518bfe[_0xd4de('0x6')],agents[_0x518bfe['transfereruniqueid']][_0xd4de('0x9')],agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')]));agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x39')]=!![];agents[_0x518bfe['transfereruniqueid']]['transfertype']=_0xd4de('0x3a');agents[_0x518bfe[_0xd4de('0x36')]]['transferexten']=_0x518bfe['extension'];agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x3b')]=agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')];}}catch(_0x34d772){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x34d772);}};exports[_0xd4de('0x3c')]=function(_0x3be8c2){try{utils[_0xd4de('0x14')](util['format'](_0xd4de('0x3d'),_0x3be8c2[_0xd4de('0x3e')]),_0x3be8c2);if(_0x3be8c2[_0xd4de('0x3e')]==_0x3be8c2[_0xd4de('0x3f')]){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x40')]])){utils['info'](util[_0xd4de('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3be8c2['origtransfereruniqueid'],agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x9')]));agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x39')]=!![];agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x44')];agents[_0x3be8c2['secondtransfereruniqueid']]['transferuniqueid']=_0x3be8c2['origtransfereruniqueid'];}if(_0x3be8c2[_0xd4de('0x45')]&&agents[_0x3be8c2[_0xd4de('0x45')]]){agents[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2['transfereeuniqueid']]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x45')]]);transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0xa')]=agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x40')]]['calleridname'];transfers[_0x3be8c2['transfereeuniqueid']]['agentcalledAt']=utils[_0xd4de('0x17')]();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x33')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x45')]]['agententerreason']=0x2;}}else if(_0x3be8c2[_0xd4de('0x40')]==_0x3be8c2['secondtransfererlinkedid']){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x3e')]])){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x49'),_0x3be8c2[_0xd4de('0x3e')],agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x9')]));agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x39')]=!![];agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x4a')];agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x3b')]=_0x3be8c2[_0xd4de('0x40')];}if(_0x3be8c2[_0xd4de('0x4b')]&&agents[_0x3be8c2[_0xd4de('0x4b')]]){agents[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2[_0xd4de('0x4b')]]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x4b')]]);transfers[_0x3be8c2[_0xd4de('0x4b')]]['calleridnum']=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x48')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x16')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x3be8c2['transfertargetuniqueid']][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x4b')]]['agententerreason']=0x2;}}}catch(_0x4a06b2){utils['error'](util['format'](_0xd4de('0x3d'),_0x3be8c2['origtransfereruniqueid']),_0x4a06b2);}};exports[_0xd4de('0x4c')]=function(_0x5ddba5){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5['uniqueid']),_0x5ddba5);if(agents[_0x5ddba5['uniqueid']]&&agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')]===_0xd4de('0x1f')){if(_0x5ddba5[_0xd4de('0x4d')]==='21'){agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=_0xd4de('0x4e');agents[_0x5ddba5['uniqueid']]['lastevent']='rejected';}utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x9')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]]['lastevent']));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);var _0x5a4882=unanswered[_0xd4de('0x4f')](_0x5ddba5[_0xd4de('0x6')]);if(_0x5a4882>-0x1){unanswered[_0xd4de('0x50')](_0x5a4882,0x1);}}if(transfers[_0x5ddba5[_0xd4de('0x6')]]){transfers[_0x5ddba5['uniqueid']][_0xd4de('0xe')]=!![];transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')]=utils[_0xd4de('0x17')]();transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]='agent';transfers[_0x5ddba5[_0xd4de('0x6')]]['lastevent']='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],transfers[_0x5ddba5[_0xd4de('0x6')]]['reason'],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(transfers[_0x5ddba5[_0xd4de('0x6')]],!![]);}if(agents[_0x5ddba5[_0xd4de('0x6')]]&&agents[_0x5ddba5[_0xd4de('0x6')]]['agentconnectAt']){agents[_0x5ddba5['uniqueid']]['agentcomplete']=!![];agents[_0x5ddba5['uniqueid']][_0xd4de('0x32')]=utils['now']();agents[_0x5ddba5[_0xd4de('0x6')]]['talktime']=utils[_0xd4de('0x31')](agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=agents[_0x5ddba5[_0xd4de('0x6')]]['transfer']?_0xd4de('0x39'):_0xd4de('0x51');agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);}}catch(_0x27fd09){utils[_0xd4de('0x23')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5[_0xd4de('0x6')]),_0x27fd09);}}; \ No newline at end of file +var _0x9ffd=['interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcomplete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agentcalledAt','[%s][agents][attendedtransfer]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3457b2,_0x2985b3){_0x3457b2=_0x3457b2-0x0;var _0x22d183=_0x9ffd[_0x3457b2];return _0x22d183;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var utils=require(_0xd9ff('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5802a6,_0x3480c0){utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x5'),_0x5802a6['uniqueid'],_0x5802a6[_0xd9ff('0x6')],_0x5802a6[_0xd9ff('0x7')],_0x5802a6['membername'],_0x5802a6[_0xd9ff('0x8')],_0x5802a6[_0xd9ff('0x9')],_0x5802a6[_0xd9ff('0xa')],_0x5802a6[_0xd9ff('0xb')]));if(_0x5802a6[_0xd9ff('0x7')]){utils[_0xd9ff('0xc')](_0x5802a6[_0xd9ff('0x7')])[_0xd9ff('0xd')](function(_0x977487){if(_0x977487){_0x5802a6['type']=_0x977487['type'];_0x5802a6['agentacw']=_0x5802a6['agentcomplete']?_0x977487[_0xd9ff('0xe')]:![];_0x5802a6[_0xd9ff('0xf')]=_0x5802a6[_0xd9ff('0x10')]?_0x977487[_0xd9ff('0x11')]:0x0;}utils[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x5802a6);});}else{utils[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x5802a6);}if(_0x3480c0){delete transfers[_0x5802a6['uniqueid']];}else{delete agents[_0x5802a6['destuniqueid']];}}exports[_0xd9ff('0x14')]=function(_0x16a0d9){try{utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')](_0xd9ff('0x16'),_0x16a0d9['uniqueid']),_0x16a0d9);agents[_0x16a0d9[_0xd9ff('0x17')]]=_0x16a0d9;agents[_0x16a0d9[_0xd9ff('0x17')]]['agentcalledAt']=utils[_0xd9ff('0x18')]();agents[_0x16a0d9['destuniqueid']]['lastevent']='called';agents[_0x16a0d9['destuniqueid']][_0xd9ff('0xa')]=null;agents[_0x16a0d9['destuniqueid']][_0xd9ff('0x19')]=null;utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x1a'),_0x16a0d9[_0xd9ff('0x1b')],agents[_0x16a0d9[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x16a0d9[_0xd9ff('0x17')]));}catch(_0x182775){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x16'),_0x16a0d9[_0xd9ff('0x1b')]),_0x182775);}};exports['agentringnoanswer']=function(_0x4cf8ec){try{if(!_[_0xd9ff('0x1e')](agents[_0x4cf8ec[_0xd9ff('0x17')]])){utils['debug'](util['format']('[%s][agents][agentringnoanswer]',_0x4cf8ec['uniqueid']),_0x4cf8ec);utils[_0xd9ff('0x3')](util['format'](_0xd9ff('0x1f'),_0x4cf8ec[_0xd9ff('0x1b')],agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x4cf8ec[_0xd9ff('0x17')]));agents[_0x4cf8ec[_0xd9ff('0x17')]]['agentringnoanswer']=!![];agents[_0x4cf8ec['destuniqueid']][_0xd9ff('0x20')]=utils['now']();agents[_0x4cf8ec[_0xd9ff('0x17')]]['lastevent']=_0xd9ff('0x21');agents[_0x4cf8ec['destuniqueid']][_0xd9ff('0x22')]=_0xd9ff('0x21');agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x23')]=_0x4cf8ec['ringtime']?parseInt(_0x4cf8ec[_0xd9ff('0x24')])/0x3e8:0x0;agents[_0x4cf8ec[_0xd9ff('0x17')]][_0xd9ff('0x25')]=0x0;unanswered[_0xd9ff('0x26')](_0x4cf8ec['destuniqueid']);}}catch(_0x1d3684){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x27'),_0x4cf8ec[_0xd9ff('0x1b')]),_0x1d3684);}};exports[_0xd9ff('0x28')]=function(_0x420ffa){try{_[_0xd9ff('0x29')](agents,function(_0x3dc443,_0x5706cf){if(_0x3dc443[_0xd9ff('0x1b')]==_0x420ffa['uniqueid']&&!_[_0xd9ff('0x2a')](unanswered,_0x3dc443[_0xd9ff('0x17')])){utils[_0xd9ff('0x15')](util['format'](_0xd9ff('0x2b'),_0x420ffa[_0xd9ff('0x1b')]),_0x420ffa);utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x420ffa[_0xd9ff('0x1b')],_0x3dc443['membername'],_0x3dc443[_0xd9ff('0x17')]));_0x3dc443[_0xd9ff('0x2c')]=!![];_0x3dc443[_0xd9ff('0x20')]=utils[_0xd9ff('0x18')]();_0x3dc443[_0xd9ff('0xb')]=_0xd9ff('0x2d');_0x3dc443[_0xd9ff('0x22')]=_0xd9ff('0x2d');_0x3dc443[_0xd9ff('0x23')]=_0x420ffa[_0xd9ff('0x23')];_0x3dc443[_0xd9ff('0x25')]=0x0;writeDB(_0x3dc443);}});}catch(_0x34e9a9){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')]('[%s][agents][queuecallerabandon]',_0x420ffa[_0xd9ff('0x1b')]),_0x34e9a9);}};exports[_0xd9ff('0x2e')]=function(_0x2bde85){try{if(agents[_0x2bde85['destuniqueid']]){utils[_0xd9ff('0x15')](util['format'](_0xd9ff('0x2f'),_0x2bde85['uniqueid']),_0x2bde85);utils[_0xd9ff('0x3')](util['format'](_0xd9ff('0x30'),_0x2bde85[_0xd9ff('0x1b')],agents[_0x2bde85[_0xd9ff('0x17')]]['membername'],_0x2bde85['destuniqueid']));agents[_0x2bde85['destuniqueid']][_0xd9ff('0x31')]=utils[_0xd9ff('0x18')]();agents[_0x2bde85[_0xd9ff('0x17')]][_0xd9ff('0xa')]=_0x2bde85[_0xd9ff('0xa')];agents[_0x2bde85[_0xd9ff('0x17')]]['connectedlinename']=_0x2bde85['connectedlinename'];agents[_0x2bde85['destuniqueid']][_0xd9ff('0x23')]=_0x2bde85[_0xd9ff('0x24')];agents[_0x2bde85[_0xd9ff('0x17')]][_0xd9ff('0xb')]='connect';_[_0xd9ff('0x29')](agents,function(_0x5b8e17,_0x3cff52){if(_0x5b8e17[_0xd9ff('0x17')]!=_0x2bde85[_0xd9ff('0x17')]&&_0x5b8e17[_0xd9ff('0x1b')]==_0x2bde85['uniqueid']){_0x5b8e17[_0xd9ff('0x25')]=0x0;_0x5b8e17[_0xd9ff('0x23')]=_0x2bde85['ringtime'];_0x5b8e17[_0xd9ff('0x2c')]=!![];_0x5b8e17[_0xd9ff('0x20')]=utils[_0xd9ff('0x18')]();_0x5b8e17[_0xd9ff('0xb')]=_0xd9ff('0x32');_0x5b8e17[_0xd9ff('0x22')]='answered_elsewhere';_0x5b8e17[_0xd9ff('0x33')]=_0x2bde85[_0xd9ff('0x17')];_0x5b8e17[_0xd9ff('0x34')]=_0x2bde85[_0xd9ff('0x1c')];writeDB(_0x5b8e17);}});}}catch(_0x472724){utils['error'](util[_0xd9ff('0x4')](_0xd9ff('0x2f'),_0x2bde85[_0xd9ff('0x1b')]),_0x472724);}};exports['agentcomplete']=function(_0x5d06dd){try{if(!_[_0xd9ff('0x1e')](agents[_0x5d06dd[_0xd9ff('0x17')]])){utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')](_0xd9ff('0x35'),_0x5d06dd[_0xd9ff('0x1b')]),_0x5d06dd);utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x36'),_0x5d06dd['uniqueid'],agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x1c')],_0x5d06dd[_0xd9ff('0x17')]));agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x37')]=!![];agents[_0x5d06dd['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x5d06dd[_0xd9ff('0x17')]]['talktime']=utils[_0xd9ff('0x38')](agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0x39')],agents[_0x5d06dd['destuniqueid']][_0xd9ff('0x31')]);agents[_0x5d06dd[_0xd9ff('0x17')]]['reason']=_0x5d06dd[_0xd9ff('0x22')];agents[_0x5d06dd[_0xd9ff('0x17')]][_0xd9ff('0xb')]=_0xd9ff('0x3a');writeDB(agents[_0x5d06dd['destuniqueid']]);}}catch(_0x38b5b6){utils['error'](util[_0xd9ff('0x4')]('[%s][agents][agentcomplete]',_0x5d06dd[_0xd9ff('0x1b')]),_0x38b5b6);}};exports[_0xd9ff('0x3b')]=function(_0x2bf37a){try{if(!_[_0xd9ff('0x1e')](agents[_0x2bf37a[_0xd9ff('0x3c')]])){utils['debug'](util[_0xd9ff('0x4')](_0xd9ff('0x3d'),_0x2bf37a[_0xd9ff('0x1b')]),_0x2bf37a);utils[_0xd9ff('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x2bf37a['uniqueid'],agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x1c')],agents[_0x2bf37a[_0xd9ff('0x3c')]]['uniqueid']));agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x3e')]=!![];agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x3f')]=_0xd9ff('0x40');agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x41')]=_0x2bf37a[_0xd9ff('0x42')];agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x43')]=agents[_0x2bf37a[_0xd9ff('0x3c')]][_0xd9ff('0x1b')];}}catch(_0x2533d7){utils['error'](util[_0xd9ff('0x4')]('[%s][agents][blindtransfer]',_0x2bf37a[_0xd9ff('0x1b')]),_0x2533d7);}};exports['attendedtransfer']=function(_0x2953d7){try{utils['debug'](util[_0xd9ff('0x4')]('[%s][agents][attendedtransfer]',_0x2953d7[_0xd9ff('0x44')]),_0x2953d7);if(_0x2953d7['origtransfereruniqueid']==_0x2953d7[_0xd9ff('0x45')]){if(!_['isNil'](agents[_0x2953d7[_0xd9ff('0x46')]])){utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x47'),_0x2953d7[_0xd9ff('0x44')],agents[_0x2953d7[_0xd9ff('0x46')]]['membername']));agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x3e')]=!![];agents[_0x2953d7[_0xd9ff('0x46')]]['transfertype']=_0xd9ff('0x48');agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x41')]=_0x2953d7[_0xd9ff('0x49')];agents[_0x2953d7[_0xd9ff('0x46')]]['transferuniqueid']=_0x2953d7[_0xd9ff('0x44')];}if(_0x2953d7[_0xd9ff('0x4a')]&&agents[_0x2953d7[_0xd9ff('0x4a')]]){agents[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x4b')]=0x1;transfers[_0x2953d7[_0xd9ff('0x4a')]]=_[_0xd9ff('0x4c')](agents[_0x2953d7['transfereeuniqueid']]);transfers[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x9')]=agents[_0x2953d7['secondtransfereruniqueid']][_0xd9ff('0x9')];transfers[_0x2953d7[_0xd9ff('0x4a')]]['calleridname']=agents[_0x2953d7[_0xd9ff('0x46')]][_0xd9ff('0x4d')];transfers[_0x2953d7[_0xd9ff('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x2953d7[_0xd9ff('0x4a')]]['agentconnectAt']=utils[_0xd9ff('0x18')]();transfers[_0x2953d7[_0xd9ff('0x4a')]][_0xd9ff('0x23')]=0x0;transfers[_0x2953d7[_0xd9ff('0x4a')]]['agententerreason']=0x2;}}else if(_0x2953d7['secondtransfereruniqueid']==_0x2953d7['secondtransfererlinkedid']){if(!_[_0xd9ff('0x1e')](agents[_0x2953d7[_0xd9ff('0x44')]])){utils[_0xd9ff('0x3')](util[_0xd9ff('0x4')](_0xd9ff('0x47'),_0x2953d7['origtransfereruniqueid'],agents[_0x2953d7[_0xd9ff('0x44')]]['membername']));agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x3e')]=!![];agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x3f')]=_0xd9ff('0x48');agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x41')]=_0x2953d7[_0xd9ff('0x4e')];agents[_0x2953d7['origtransfereruniqueid']][_0xd9ff('0x43')]=_0x2953d7[_0xd9ff('0x46')];}if(_0x2953d7['transfertargetuniqueid']&&agents[_0x2953d7['transfertargetuniqueid']]){agents[_0x2953d7[_0xd9ff('0x4f')]]['agententerreason']=0x1;transfers[_0x2953d7[_0xd9ff('0x4f')]]=_[_0xd9ff('0x4c')](agents[_0x2953d7['transfertargetuniqueid']]);transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x9')]=agents[_0x2953d7[_0xd9ff('0x44')]][_0xd9ff('0x9')];transfers[_0x2953d7[_0xd9ff('0x4f')]]['calleridname']=agents[_0x2953d7[_0xd9ff('0x44')]]['calleridname'];transfers[_0x2953d7['transfertargetuniqueid']][_0xd9ff('0x50')]=utils[_0xd9ff('0x18')]();transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x31')]=utils['now']();transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x23')]=0x0;transfers[_0x2953d7[_0xd9ff('0x4f')]][_0xd9ff('0x4b')]=0x2;}}}catch(_0x1bb042){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x51'),_0x2953d7['origtransfereruniqueid']),_0x1bb042);}};exports['hangup']=function(_0x5e04d3){try{utils[_0xd9ff('0x15')](util[_0xd9ff('0x4')]('[%s][agents][hangup]',_0x5e04d3[_0xd9ff('0x1b')]),_0x5e04d3);if(agents[_0x5e04d3[_0xd9ff('0x1b')]]&&agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]===_0xd9ff('0x21')){if(_0x5e04d3[_0xd9ff('0x52')]==='21'){agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]='rejected';agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]=_0xd9ff('0x53');}utils['info'](util[_0xd9ff('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5e04d3[_0xd9ff('0x1b')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],agents[_0x5e04d3['uniqueid']][_0xd9ff('0x22')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]));writeDB(agents[_0x5e04d3[_0xd9ff('0x1b')]]);var _0x56a74c=unanswered[_0xd9ff('0x54')](_0x5e04d3[_0xd9ff('0x1b')]);if(_0x56a74c>-0x1){unanswered[_0xd9ff('0x55')](_0x56a74c,0x1);}}if(transfers[_0x5e04d3['uniqueid']]){transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x37')]=!![];transfers[_0x5e04d3[_0xd9ff('0x1b')]]['agentcompleteAt']=utils[_0xd9ff('0x18')]();transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x25')]=utils[_0xd9ff('0x38')](transfers[_0x5e04d3[_0xd9ff('0x1b')]]['agentcompleteAt'],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x31')]);transfers[_0x5e04d3['uniqueid']][_0xd9ff('0x22')]=_0xd9ff('0x56');transfers[_0x5e04d3[_0xd9ff('0x1b')]]['lastevent']=_0xd9ff('0x3a');utils['info'](util[_0xd9ff('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5e04d3[_0xd9ff('0x1b')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')],transfers[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]));writeDB(transfers[_0x5e04d3[_0xd9ff('0x1b')]],!![]);}if(agents[_0x5e04d3[_0xd9ff('0x1b')]]&&agents[_0x5e04d3[_0xd9ff('0x1b')]]['agentconnectAt']){agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x37')]=!![];agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x39')]=utils[_0xd9ff('0x18')]();agents[_0x5e04d3[_0xd9ff('0x1b')]]['talktime']=utils['diffTime'](agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x39')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x31')]);agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')]=agents[_0x5e04d3['uniqueid']][_0xd9ff('0x3e')]?_0xd9ff('0x3e'):_0xd9ff('0x56');agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0xb')]=_0xd9ff('0x3a');utils['info'](util[_0xd9ff('0x4')](_0xd9ff('0x57'),_0x5e04d3[_0xd9ff('0x1b')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x1c')],agents[_0x5e04d3[_0xd9ff('0x1b')]][_0xd9ff('0x22')],agents[_0x5e04d3[_0xd9ff('0x1b')]]['lastevent']));writeDB(agents[_0x5e04d3[_0xd9ff('0x1b')]]);}}catch(_0x4c2ad5){utils[_0xd9ff('0x1d')](util[_0xd9ff('0x4')](_0xd9ff('0x58'),_0x5e04d3[_0xd9ff('0x1b')]),_0x4c2ad5);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 1df7d6d..4537551 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 _0x803f=['info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','transfer','answertime','now','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','secondtransfererchannel','localtwolinkedid','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','substring','lastIndexOf','noop','execif','gotoif','[%s][calls][newexten]','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','membername','connectedlinenum','lastevent','accountcode','then','request','CreateVoiceCallReport','recording','newchannel','debug','linkedid','channel','OutgoingSpoolFailed'];(function(_0x4f485f,_0x1db0f7){var _0x1e998e=function(_0x14066c){while(--_0x14066c){_0x4f485f['push'](_0x4f485f['shift']());}};_0x1e998e(++_0x1db0f7);}(_0x803f,0x144));var _0xf803=function(_0x9f8e34,_0xc5bce4){_0x9f8e34=_0x9f8e34-0x0;var _0x4d13cf=_0x803f[_0x9f8e34];return _0x4d13cf;};'use strict';var _=require('lodash');var util=require(_0xf803('0x0'));var utils=require(_0xf803('0x1'));var transfers=require(_0xf803('0x2'));var dispositions=[_0xf803('0x3'),_0xf803('0x4'),'FAILED',_0xf803('0x3'),_0xf803('0x3'),_0xf803('0x3'),_0xf803('0x5'),_0xf803('0x6'),_0xf803('0x4'),'FAILED',_0xf803('0x4')];var channels={};function writeDB(_0x4291f2){var _0x43ea35;if(transfers[_0xf803('0x7')][_0x4291f2['uniqueid']]){_0x43ea35=_0x4291f2['uniqueid'];_0x4291f2[_0xf803('0x8')]=transfers['blinds'][_0x4291f2[_0xf803('0x8')]][_0xf803('0x9')];}utils['info'](util[_0xf803('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4291f2[_0xf803('0x8')],_0x4291f2['channel'],_0x4291f2['queue'],_0x4291f2[_0xf803('0xb')],_0x4291f2['interface'],_0x4291f2['calleridnum'],_0x4291f2[_0xf803('0xc')],_0x4291f2[_0xf803('0xd')]));if(_0x4291f2[_0xf803('0xe')]){utils['getUserByInternal'](_0x4291f2[_0xf803('0xe')])[_0xf803('0xf')](function(_0x47c904){if(_0x47c904){_0x4291f2['UserId']=_0x47c904['id'];}utils[_0xf803('0x10')](_0xf803('0x11'),_0x4291f2);});}else{utils[_0xf803('0x10')](_0xf803('0x11'),_0x4291f2);}if(channels[_0x4291f2[_0xf803('0x8')]]){delete channels[_0x4291f2[_0xf803('0x8')]];}else if(_0x43ea35&&channels[_0x43ea35]){if(!transfers['blinds'][_0x43ea35][_0xf803('0x12')])delete transfers['blinds'][_0x43ea35];delete channels[_0x43ea35];}}exports[_0xf803('0x13')]=function(_0x5d0096){try{utils[_0xf803('0x14')](util[_0xf803('0xa')]('[%s][calls][newchannel]',_0x5d0096[_0xf803('0x8')]),_0x5d0096);if(_0x5d0096['uniqueid']==_0x5d0096[_0xf803('0x15')]&&_0x5d0096[_0xf803('0x16')]!=_0xf803('0x17')){utils[_0xf803('0x18')](util['format'](_0xf803('0x19'),_0x5d0096['uniqueid'],_0x5d0096['context'],_0x5d0096[_0xf803('0x1a')]));channels[_0x5d0096[_0xf803('0x8')]]={'uniqueid':_0x5d0096[_0xf803('0x8')],'accountcode':_0x5d0096[_0xf803('0xe')],'source':_0x5d0096[_0xf803('0x1b')],'destination':_0x5d0096[_0xf803('0x1a')],'destinationcontext':_0x5d0096['context'],'channel':_0x5d0096[_0xf803('0x16')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf803('0x1c')};}}catch(_0x35d11a){utils[_0xf803('0x1d')](util['format'](_0xf803('0x1e'),_0x5d0096['uniqueid']),_0x35d11a);}};exports[_0xf803('0x1f')]=function(_0x441377){try{utils[_0xf803('0x14')](util['format'](_0xf803('0x20'),_0x441377[_0xf803('0x8')]),_0x441377);if(!_[_0xf803('0x21')](channels[_0x441377['uniqueid']])&&_0x441377[_0xf803('0x22')]==0x6){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x23'),_0x441377['uniqueid'],_0x441377[_0xf803('0x24')],_0x441377['channel']));if(_[_0xf803('0x21')](channels[_0x441377[_0xf803('0x8')]][_0xf803('0x25')])){channels[_0x441377['uniqueid']][_0xf803('0x25')]=utils['now']();}}else if(!_[_0xf803('0x21')](channels[_0x441377[_0xf803('0x15')]])&&_0x441377[_0xf803('0x22')]==0x6&&_0x441377[_0xf803('0x24')]!=_0xf803('0x26')){utils['info'](util[_0xf803('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x441377[_0xf803('0x8')],_0x441377[_0xf803('0x15')],_0x441377[_0xf803('0x24')],_0x441377[_0xf803('0x16')]));channels[_0x441377[_0xf803('0x15')]][_0xf803('0xe')]=_0x441377[_0xf803('0xe')];channels[_0x441377[_0xf803('0x15')]]['destinationchannel']=_0x441377[_0xf803('0x16')];if(_[_0xf803('0x21')](channels[_0x441377[_0xf803('0x15')]][_0xf803('0x27')])){channels[_0x441377['linkedid']][_0xf803('0x27')]=utils[_0xf803('0x28')]();}channels[_0x441377[_0xf803('0x15')]][_0xf803('0x29')]=dispositions[_[_0xf803('0x2a')](_0x441377[_0xf803('0x22')])]||_0xf803('0x5');}}catch(_0xecdbf2){utils['error'](util[_0xf803('0xa')]('[%s][calls][newstate]',_0x441377[_0xf803('0x8')]),_0xecdbf2);}};exports[_0xf803('0x2b')]=function(_0x203965){try{if(!_[_0xf803('0x21')](channels[_0x203965[_0xf803('0x8')]])){utils[_0xf803('0x14')](util['format'](_0xf803('0x2c'),_0x203965[_0xf803('0x8')]),_0x203965);if(_['isNil'](channels[_0x203965[_0xf803('0x8')]][_0xf803('0x2d')])){channels[_0x203965[_0xf803('0x8')]][_0xf803('0x2d')]=_0x203965[_0xf803('0x2e')]+'\x20<'+_0x203965['calleridnum']+'>';}utils[_0xf803('0x18')](util['format'](_0xf803('0x2f'),_0x203965[_0xf803('0x8')],channels[_0x203965[_0xf803('0x8')]][_0xf803('0x2d')],_0x203965[_0xf803('0x30')]));channels[_0x203965[_0xf803('0x8')]][_0xf803('0x31')]=utils[_0xf803('0x28')]();channels[_0x203965['uniqueid']][_0xf803('0x32')]=utils['diffTime'](channels[_0x203965[_0xf803('0x8')]]['endtime'],channels[_0x203965['uniqueid']][_0xf803('0x33')]);channels[_0x203965['uniqueid']][_0xf803('0x34')]=channels[_0x203965[_0xf803('0x8')]][_0xf803('0x27')]?utils[_0xf803('0x35')](channels[_0x203965[_0xf803('0x8')]][_0xf803('0x31')],channels[_0x203965['uniqueid']]['answertime']):0x0;writeDB(channels[_0x203965[_0xf803('0x8')]]);}}catch(_0x52ba29){utils[_0xf803('0x1d')](util[_0xf803('0xa')](_0xf803('0x2c'),_0x203965[_0xf803('0x8')]),_0x52ba29);}};exports[_0xf803('0x36')]=function(_0x2d1386){try{if(!_[_0xf803('0x21')](channels[_0x2d1386['localtwolinkedid']])){utils[_0xf803('0x14')](util[_0xf803('0xa')](_0xf803('0x37'),_0x2d1386[_0xf803('0x38')]),_0x2d1386);if(channels[_0x2d1386['localtwolinkedid']][_0xf803('0x16')]==_0x2d1386[_0xf803('0x39')]){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x3a'),_0x2d1386[_0xf803('0x38')],_0x2d1386['localtwolinkedid'],_0x2d1386[_0xf803('0x3b')]));channels[_0x2d1386[_0xf803('0x3c')]][_0xf803('0x3d')]=_0x2d1386[_0xf803('0x3b')];channels[_0x2d1386[_0xf803('0x3c')]][_0xf803('0x3e')]='_attended';}else if(channels[_0x2d1386[_0xf803('0x3c')]][_0xf803('0x16')]=_0x2d1386[_0xf803('0x3f')]){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x3a'),_0x2d1386[_0xf803('0x38')],_0x2d1386['localtwolinkedid'],_0x2d1386[_0xf803('0x40')]));channels[_0x2d1386['localtwolinkedid']][_0xf803('0x3d')]=_0x2d1386[_0xf803('0x40')];channels[_0x2d1386[_0xf803('0x3c')]][_0xf803('0x3e')]=_0xf803('0x41');}}}catch(_0x58e52e){utils[_0xf803('0x1d')](util[_0xf803('0xa')](_0xf803('0x37'),_0x2d1386[_0xf803('0x38')]),_0x58e52e);}};exports[_0xf803('0x42')]=function(_0x56ec00){try{if(!_[_0xf803('0x21')](channels[_0x56ec00[_0xf803('0x8')]])){utils['debug'](util[_0xf803('0xa')](_0xf803('0x43'),_0x56ec00[_0xf803('0x8')]),_0x56ec00);channels[_0x56ec00['uniqueid']][_0xf803('0x44')]=utils[_0xf803('0x28')]();utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x45'),_0x56ec00['uniqueid'],channels[_0x56ec00[_0xf803('0x8')]][_0xf803('0x44')]));}}catch(_0x7ca2e8){utils[_0xf803('0x1d')](util[_0xf803('0xa')](_0xf803('0x43'),_0x56ec00[_0xf803('0x8')]),_0x7ca2e8);}};exports[_0xf803('0x46')]=function(_0x59c3d9){try{if(!_['isNil'](channels[_0x59c3d9[_0xf803('0x8')]])){utils[_0xf803('0x14')](util[_0xf803('0xa')](_0xf803('0x47'),_0x59c3d9['uniqueid']),_0x59c3d9);if(!_[_0xf803('0x21')](channels[_0x59c3d9['uniqueid']][_0xf803('0x44')])){channels[_0x59c3d9[_0xf803('0x8')]][_0xf803('0x48')]+=utils[_0xf803('0x35')](utils[_0xf803('0x28')](),channels[_0x59c3d9[_0xf803('0x8')]]['musiconholdstartAt']);utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x49'),_0x59c3d9[_0xf803('0x8')],channels[_0x59c3d9[_0xf803('0x8')]]['mohtime']));delete channels[_0x59c3d9[_0xf803('0x8')]][_0xf803('0x44')];}}}catch(_0xea9eef){utils[_0xf803('0x1d')](util['format'](_0xf803('0x47'),_0x59c3d9['uniqueid']),_0xea9eef);}};exports[_0xf803('0x4a')]=function(_0x5bd57d){try{if(!_[_0xf803('0x21')](channels[_0x5bd57d[_0xf803('0x8')]])){utils[_0xf803('0x14')](util[_0xf803('0xa')](_0xf803('0x4b'),_0x5bd57d['uniqueid']),_0x5bd57d);if(!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')]['xmd-originatecalleridnum'])){utils['info'](util['format'](_0xf803('0x4d'),_0x5bd57d['uniqueid'],_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d['uniqueid']][_0xf803('0x4f')]=_0x5bd57d[_0xf803('0x4e')];}if(!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x50')])){utils[_0xf803('0x18')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x5bd57d['uniqueid'],_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d['uniqueid']][_0xf803('0x51')]=_0x5bd57d[_0xf803('0x4e')];channels[_0x5bd57d['uniqueid']][_0xf803('0x2d')]='\x22'+_0x5bd57d[_0xf803('0x4e')]+_0xf803('0x52')+_0x5bd57d[_0xf803('0x4e')]+'>';}if(!_['isNil'](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x53')])||!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x54')])){utils['info'](util[_0xf803('0xa')](_0xf803('0x55'),_0x5bd57d[_0xf803('0x8')],!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')]['xmd-callerid-preview'])?_0xf803('0x53'):_0xf803('0x54'),_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d[_0xf803('0x8')]]['callerid']=_0x5bd57d['value'];}if(!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')]['xmd-queue'])||!_[_0xf803('0x21')](_0x5bd57d['variable'][_0xf803('0x56')])){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x55'),_0x5bd57d['uniqueid'],!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x57')])?_0xf803('0x57'):'xmcs-queue',_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d[_0xf803('0x8')]][_0xf803('0x58')]=_0xf803('0x59');channels[_0x5bd57d[_0xf803('0x8')]][_0xf803('0x5a')]=_0x5bd57d[_0xf803('0x4e')];channels[_0x5bd57d[_0xf803('0x8')]]['queue']=!![];}if(!_[_0xf803('0x21')](_0x5bd57d['variable'][_0xf803('0x5b')])){utils[_0xf803('0x18')](util['format'](_0xf803('0x5c'),_0x5bd57d[_0xf803('0x8')],_0x5bd57d['value']));channels[_0x5bd57d['uniqueid']][_0xf803('0x5d')]=_0x5bd57d[_0xf803('0x4e')];}if(!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x5e')])){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x5f'),_0x5bd57d['uniqueid'],_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d[_0xf803('0x8')]][_0xf803('0x60')]=_0x5bd57d['value'];}if(!_['isNil'](_0x5bd57d['variable'][_0xf803('0x61')])){utils[_0xf803('0x18')](util[_0xf803('0xa')](_0xf803('0x62'),_0x5bd57d[_0xf803('0x8')],_0x5bd57d['value']));channels[_0x5bd57d[_0xf803('0x8')]][_0xf803('0x63')]=_0x5bd57d[_0xf803('0x4e')];}if(!_[_0xf803('0x21')](_0x5bd57d[_0xf803('0x4c')][_0xf803('0x64')])){utils['info'](util[_0xf803('0xa')](_0xf803('0x65'),_0x5bd57d[_0xf803('0x8')],_0x5bd57d[_0xf803('0x4e')]));channels[_0x5bd57d[_0xf803('0x8')]][_0xf803('0x64')]=_0x5bd57d[_0xf803('0x4e')];}}}catch(_0x3436bf){utils[_0xf803('0x1d')](util[_0xf803('0xa')](_0xf803('0x4b'),_0x5bd57d[_0xf803('0x8')]),_0x3436bf);}};exports[_0xf803('0x66')]=function(_0x4445cd){try{if(!_[_0xf803('0x21')](channels[_0x4445cd[_0xf803('0x8')]])){utils[_0xf803('0x14')](util[_0xf803('0xa')]('[%s][calls][newexten]',_0x4445cd[_0xf803('0x8')]),_0x4445cd);utils['info'](util[_0xf803('0xa')](_0xf803('0x67'),_0x4445cd[_0xf803('0x8')],_0x4445cd[_0xf803('0x68')],_0x4445cd[_0xf803('0x69')]));if(_0x4445cd[_0xf803('0x68')]['toLowerCase']()==_0xf803('0x6a')&&_[_0xf803('0x6b')](_0x4445cd[_0xf803('0x69')][_0xf803('0x6c')](),'cdr')){var _0x33fdd8=_0x4445cd[_0xf803('0x69')][_0xf803('0x6d')]('=');var _0xde2b9a=_0x33fdd8[0x0][_0xf803('0x6e')](_0x33fdd8[0x0][_0xf803('0x6f')]('(')+0x1,_0x33fdd8[0x0]['lastIndexOf'](')'));var _0x2c5e0d=_0x33fdd8[0x1];channels[_0x4445cd[_0xf803('0x8')]][_0xde2b9a]=_0x2c5e0d;}if(!_['includes']([_0xf803('0x2b'),_0xf803('0x70'),_0xf803('0x71'),'set',_0xf803('0x72')],_0x4445cd[_0xf803('0x68')]['toLowerCase']())){channels[_0x4445cd[_0xf803('0x8')]][_0xf803('0x58')]=_0x4445cd[_0xf803('0x68')];channels[_0x4445cd['uniqueid']][_0xf803('0x5a')]=_0x4445cd[_0xf803('0x69')];}}}catch(_0x12df59){utils[_0xf803('0x1d')](util['format'](_0xf803('0x73'),_0x4445cd[_0xf803('0x8')]),_0x12df59);}}; \ No newline at end of file +var _0x9d01=['starttime','billableseconds','attendedtransfer','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','channel','queue','membername','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','calleridnum','cause-txt','duration','diffTime','endtime'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x9d01,0x1ec));var _0x19d0=function(_0x2bef69,_0x419677){_0x2bef69=_0x2bef69-0x0;var _0x45ec29=_0x9d01[_0x2bef69];return _0x45ec29;};'use strict';var _=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var utils=require(_0x19d0('0x2'));var transfers=require(_0x19d0('0x3'));var dispositions=[_0x19d0('0x4'),_0x19d0('0x5'),_0x19d0('0x5'),_0x19d0('0x4'),'NO\x20ANSWER',_0x19d0('0x4'),'ANSWERED',_0x19d0('0x6'),_0x19d0('0x5'),_0x19d0('0x5'),'FAILED'];var channels={};function writeDB(_0x355cbf){var _0x30cca9;if(transfers[_0x19d0('0x7')][_0x355cbf[_0x19d0('0x8')]]){_0x30cca9=_0x355cbf[_0x19d0('0x8')];_0x355cbf[_0x19d0('0x8')]=transfers[_0x19d0('0x7')][_0x355cbf[_0x19d0('0x8')]][_0x19d0('0x9')];}utils[_0x19d0('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x355cbf[_0x19d0('0x8')],_0x355cbf[_0x19d0('0xb')],_0x355cbf[_0x19d0('0xc')],_0x355cbf[_0x19d0('0xd')],_0x355cbf['interface'],_0x355cbf['calleridnum'],_0x355cbf[_0x19d0('0xe')],_0x355cbf['lastevent']));if(_0x355cbf[_0x19d0('0xf')]){utils[_0x19d0('0x10')](_0x355cbf[_0x19d0('0xf')])['then'](function(_0x142063){if(_0x142063){_0x355cbf[_0x19d0('0x11')]=_0x142063['id'];}utils[_0x19d0('0x12')]('CreateVoiceCallReport',_0x355cbf);});}else{utils[_0x19d0('0x12')](_0x19d0('0x13'),_0x355cbf);}if(channels[_0x355cbf[_0x19d0('0x8')]]){delete channels[_0x355cbf[_0x19d0('0x8')]];}else if(_0x30cca9&&channels[_0x30cca9]){if(!transfers[_0x19d0('0x7')][_0x30cca9]['recording'])delete transfers['blinds'][_0x30cca9];delete channels[_0x30cca9];}}exports[_0x19d0('0x14')]=function(_0xdd0070){try{utils[_0x19d0('0x15')](util[_0x19d0('0x16')](_0x19d0('0x17'),_0xdd0070[_0x19d0('0x8')]),_0xdd0070);if(_0xdd0070['uniqueid']==_0xdd0070[_0x19d0('0x18')]&&_0xdd0070[_0x19d0('0xb')]!='OutgoingSpoolFailed'){utils[_0x19d0('0xa')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xdd0070[_0x19d0('0x8')],_0xdd0070[_0x19d0('0x19')],_0xdd0070[_0x19d0('0x1a')]));channels[_0xdd0070['uniqueid']]={'uniqueid':_0xdd0070[_0x19d0('0x8')],'accountcode':_0xdd0070[_0x19d0('0xf')],'source':_0xdd0070['calleridnum'],'destination':_0xdd0070[_0x19d0('0x1a')],'destinationcontext':_0xdd0070[_0x19d0('0x19')],'channel':_0xdd0070[_0x19d0('0xb')],'starttime':utils[_0x19d0('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x19d0('0x1c')};}}catch(_0x2061d5){utils[_0x19d0('0x1d')](util[_0x19d0('0x16')]('[%s][calls][newchannel]',_0xdd0070[_0x19d0('0x8')]),_0x2061d5);}};exports[_0x19d0('0x1e')]=function(_0x59803d){try{utils[_0x19d0('0x15')](util['format'](_0x19d0('0x1f'),_0x59803d[_0x19d0('0x8')]),_0x59803d);if(!_['isNil'](channels[_0x59803d[_0x19d0('0x8')]])&&_0x59803d[_0x19d0('0x20')]==0x6){utils['info'](util[_0x19d0('0x16')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x59803d['uniqueid'],_0x59803d[_0x19d0('0x19')],_0x59803d[_0x19d0('0xb')]));if(_[_0x19d0('0x21')](channels[_0x59803d[_0x19d0('0x8')]][_0x19d0('0x22')])){channels[_0x59803d['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x59803d[_0x19d0('0x18')]])&&_0x59803d[_0x19d0('0x20')]==0x6&&_0x59803d[_0x19d0('0x19')]!=_0x19d0('0x23')){utils[_0x19d0('0xa')](util[_0x19d0('0x16')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x59803d[_0x19d0('0x8')],_0x59803d[_0x19d0('0x18')],_0x59803d['context'],_0x59803d[_0x19d0('0xb')]));channels[_0x59803d['linkedid']][_0x19d0('0xf')]=_0x59803d[_0x19d0('0xf')];channels[_0x59803d[_0x19d0('0x18')]]['destinationchannel']=_0x59803d[_0x19d0('0xb')];if(_[_0x19d0('0x21')](channels[_0x59803d['linkedid']][_0x19d0('0x24')])){channels[_0x59803d[_0x19d0('0x18')]][_0x19d0('0x24')]=utils['now']();}channels[_0x59803d['linkedid']][_0x19d0('0x25')]=dispositions[_[_0x19d0('0x26')](_0x59803d[_0x19d0('0x20')])]||'ANSWERED';}}catch(_0x4d9bf8){utils['error'](util[_0x19d0('0x16')](_0x19d0('0x1f'),_0x59803d[_0x19d0('0x8')]),_0x4d9bf8);}};exports[_0x19d0('0x27')]=function(_0x56255f){try{if(!_[_0x19d0('0x21')](channels[_0x56255f[_0x19d0('0x8')]])){utils[_0x19d0('0x15')](util[_0x19d0('0x16')](_0x19d0('0x28'),_0x56255f[_0x19d0('0x8')]),_0x56255f);if(_['isNil'](channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x29')])){channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x29')]=_0x56255f[_0x19d0('0x2a')]+'\x20<'+_0x56255f[_0x19d0('0x2b')]+'>';}utils[_0x19d0('0xa')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x56255f[_0x19d0('0x8')],channels[_0x56255f['uniqueid']][_0x19d0('0x29')],_0x56255f[_0x19d0('0x2c')]));channels[_0x56255f['uniqueid']]['endtime']=utils[_0x19d0('0x1b')]();channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x2d')]=utils[_0x19d0('0x2e')](channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x2f')],channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x30')]);channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x31')]=channels[_0x56255f[_0x19d0('0x8')]][_0x19d0('0x24')]?utils[_0x19d0('0x2e')](channels[_0x56255f[_0x19d0('0x8')]]['endtime'],channels[_0x56255f[_0x19d0('0x8')]]['answertime']):0x0;writeDB(channels[_0x56255f[_0x19d0('0x8')]]);}}catch(_0x2f47fb){utils[_0x19d0('0x1d')](util[_0x19d0('0x16')](_0x19d0('0x28'),_0x56255f['uniqueid']),_0x2f47fb);}};exports[_0x19d0('0x32')]=function(_0x2988bd){try{if(!_[_0x19d0('0x21')](channels[_0x2988bd['localtwolinkedid']])){utils[_0x19d0('0x15')](util[_0x19d0('0x16')]('[%s][calls][attendedtransfer]',_0x2988bd[_0x19d0('0x33')]),_0x2988bd);if(channels[_0x2988bd[_0x19d0('0x34')]]['channel']==_0x2988bd[_0x19d0('0x35')]){utils[_0x19d0('0xa')](util[_0x19d0('0x16')](_0x19d0('0x36'),_0x2988bd['origtransfereruniqueid'],_0x2988bd[_0x19d0('0x34')],_0x2988bd['secondtransfererchannel']));channels[_0x2988bd[_0x19d0('0x34')]][_0x19d0('0x37')]=_0x2988bd[_0x19d0('0x38')];channels[_0x2988bd[_0x19d0('0x34')]][_0x19d0('0x39')]=_0x19d0('0x3a');}else if(channels[_0x2988bd['localtwolinkedid']]['channel']=_0x2988bd[_0x19d0('0x3b')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2988bd['origtransfereruniqueid'],_0x2988bd[_0x19d0('0x34')],_0x2988bd['origtransfererchannel']));channels[_0x2988bd[_0x19d0('0x34')]][_0x19d0('0x37')]=_0x2988bd[_0x19d0('0x3c')];channels[_0x2988bd['localtwolinkedid']]['userfield']=_0x19d0('0x3a');}}}catch(_0x4b5e79){utils['error'](util[_0x19d0('0x16')]('[%s][calls][attendedtransfer]',_0x2988bd[_0x19d0('0x33')]),_0x4b5e79);}};exports[_0x19d0('0x3d')]=function(_0x31847d){try{if(!_[_0x19d0('0x21')](channels[_0x31847d['uniqueid']])){utils['debug'](util[_0x19d0('0x16')](_0x19d0('0x3e'),_0x31847d[_0x19d0('0x8')]),_0x31847d);channels[_0x31847d[_0x19d0('0x8')]][_0x19d0('0x3f')]=utils[_0x19d0('0x1b')]();utils['info'](util[_0x19d0('0x16')](_0x19d0('0x40'),_0x31847d[_0x19d0('0x8')],channels[_0x31847d[_0x19d0('0x8')]]['musiconholdstartAt']));}}catch(_0x5046ff){utils[_0x19d0('0x1d')](util[_0x19d0('0x16')]('[%s][calls][musiconholdstart]',_0x31847d[_0x19d0('0x8')]),_0x5046ff);}};exports['musiconholdstop']=function(_0x59e5e6){try{if(!_[_0x19d0('0x21')](channels[_0x59e5e6[_0x19d0('0x8')]])){utils[_0x19d0('0x15')](util[_0x19d0('0x16')](_0x19d0('0x41'),_0x59e5e6[_0x19d0('0x8')]),_0x59e5e6);if(!_[_0x19d0('0x21')](channels[_0x59e5e6[_0x19d0('0x8')]]['musiconholdstartAt'])){channels[_0x59e5e6[_0x19d0('0x8')]][_0x19d0('0x42')]+=utils[_0x19d0('0x2e')](utils['now'](),channels[_0x59e5e6[_0x19d0('0x8')]][_0x19d0('0x3f')]);utils['info'](util[_0x19d0('0x16')](_0x19d0('0x43'),_0x59e5e6[_0x19d0('0x8')],channels[_0x59e5e6['uniqueid']][_0x19d0('0x42')]));delete channels[_0x59e5e6['uniqueid']][_0x19d0('0x3f')];}}}catch(_0x517fa6){utils['error'](util[_0x19d0('0x16')](_0x19d0('0x41'),_0x59e5e6['uniqueid']),_0x517fa6);}};exports[_0x19d0('0x44')]=function(_0x48eb7f){try{if(!_[_0x19d0('0x21')](channels[_0x48eb7f[_0x19d0('0x8')]])){utils[_0x19d0('0x15')](util['format'](_0x19d0('0x45'),_0x48eb7f['uniqueid']),_0x48eb7f);if(!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x47')])){utils[_0x19d0('0xa')](util['format'](_0x19d0('0x48'),_0x48eb7f['uniqueid'],_0x48eb7f['value']));channels[_0x48eb7f[_0x19d0('0x8')]]['source']=_0x48eb7f[_0x19d0('0x49')];}if(!_['isNil'](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x4a')])){utils[_0x19d0('0xa')](util[_0x19d0('0x16')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x48eb7f[_0x19d0('0x8')],_0x48eb7f['value']));channels[_0x48eb7f[_0x19d0('0x8')]]['destination']=_0x48eb7f[_0x19d0('0x49')];channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x29')]='\x22'+_0x48eb7f[_0x19d0('0x49')]+_0x19d0('0x4b')+_0x48eb7f[_0x19d0('0x49')]+'>';}if(!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x4c')])||!_['isNil'](_0x48eb7f['variable'][_0x19d0('0x4d')])){utils[_0x19d0('0xa')](util['format'](_0x19d0('0x4e'),_0x48eb7f[_0x19d0('0x8')],!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0x19d0('0x4d'),_0x48eb7f[_0x19d0('0x49')]));channels[_0x48eb7f[_0x19d0('0x8')]]['callerid']=_0x48eb7f[_0x19d0('0x49')];}if(!_['isNil'](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x4f')])||!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x50')])){utils[_0x19d0('0xa')](util[_0x19d0('0x16')](_0x19d0('0x4e'),_0x48eb7f['uniqueid'],!_[_0x19d0('0x21')](_0x48eb7f['variable'][_0x19d0('0x4f')])?_0x19d0('0x4f'):_0x19d0('0x50'),_0x48eb7f['value']));channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x51')]=_0x19d0('0x52');channels[_0x48eb7f['uniqueid']]['lastdata']=_0x48eb7f[_0x19d0('0x49')];channels[_0x48eb7f['uniqueid']][_0x19d0('0xc')]=!![];}if(!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x53')])){utils[_0x19d0('0xa')](util[_0x19d0('0x16')](_0x19d0('0x54'),_0x48eb7f[_0x19d0('0x8')],_0x48eb7f[_0x19d0('0x49')]));channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x55')]=_0x48eb7f[_0x19d0('0x49')];}if(!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x56')])){utils[_0x19d0('0xa')](util[_0x19d0('0x16')](_0x19d0('0x57'),_0x48eb7f[_0x19d0('0x8')],_0x48eb7f[_0x19d0('0x49')]));channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x58')]=_0x48eb7f[_0x19d0('0x49')];}if(!_[_0x19d0('0x21')](_0x48eb7f['variable'][_0x19d0('0x59')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x48eb7f[_0x19d0('0x8')],_0x48eb7f[_0x19d0('0x49')]));channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x5a')]=_0x48eb7f['value'];}if(!_[_0x19d0('0x21')](_0x48eb7f[_0x19d0('0x46')][_0x19d0('0x5b')])){utils[_0x19d0('0xa')](util['format'](_0x19d0('0x5c'),_0x48eb7f[_0x19d0('0x8')],_0x48eb7f['value']));channels[_0x48eb7f[_0x19d0('0x8')]][_0x19d0('0x5b')]=_0x48eb7f[_0x19d0('0x49')];}}}catch(_0x51a9f4){utils[_0x19d0('0x1d')](util['format'](_0x19d0('0x45'),_0x48eb7f[_0x19d0('0x8')]),_0x51a9f4);}};exports[_0x19d0('0x5d')]=function(_0xc2fd){try{if(!_['isNil'](channels[_0xc2fd['uniqueid']])){utils[_0x19d0('0x15')](util[_0x19d0('0x16')](_0x19d0('0x5e'),_0xc2fd[_0x19d0('0x8')]),_0xc2fd);utils[_0x19d0('0xa')](util[_0x19d0('0x16')](_0x19d0('0x5f'),_0xc2fd[_0x19d0('0x8')],_0xc2fd[_0x19d0('0x60')],_0xc2fd[_0x19d0('0x61')]));if(_0xc2fd[_0x19d0('0x60')][_0x19d0('0x62')]()==_0x19d0('0x63')&&_[_0x19d0('0x64')](_0xc2fd[_0x19d0('0x61')][_0x19d0('0x62')](),_0x19d0('0x65'))){var _0x1e3596=_0xc2fd['appdata'][_0x19d0('0x66')]('=');var _0x3be9bb=_0x1e3596[0x0]['substring'](_0x1e3596[0x0][_0x19d0('0x67')]('(')+0x1,_0x1e3596[0x0][_0x19d0('0x67')](')'));var _0x1069a2=_0x1e3596[0x1];channels[_0xc2fd[_0x19d0('0x8')]][_0x3be9bb]=_0x1069a2;}if(!_[_0x19d0('0x68')]([_0x19d0('0x27'),_0x19d0('0x69'),_0x19d0('0x6a'),_0x19d0('0x63'),_0x19d0('0x6b')],_0xc2fd[_0x19d0('0x60')]['toLowerCase']())){channels[_0xc2fd[_0x19d0('0x8')]][_0x19d0('0x51')]=_0xc2fd[_0x19d0('0x60')];channels[_0xc2fd[_0x19d0('0x8')]]['lastdata']=_0xc2fd['appdata'];}}}catch(_0x2691eb){utils[_0x19d0('0x1d')](util['format'](_0x19d0('0x5e'),_0xc2fd[_0x19d0('0x8')]),_0x2691eb);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 06c5964..0958bd8 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 _0x2d2c=['info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect'];(function(_0x431aff,_0x1fe08b){var _0x50b2a5=function(_0x3a1dac){while(--_0x3a1dac){_0x431aff['push'](_0x431aff['shift']());}};_0x50b2a5(++_0x1fe08b);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x2d2c[_0x318840];return _0x223da4;};'use strict';var utils=require(_0xc2d2('0x0'));exports[_0xc2d2('0x1')]=function(){utils[_0xc2d2('0x2')](_0xc2d2('0x3'));};exports[_0xc2d2('0x4')]=function(){utils[_0xc2d2('0x2')]('[core]\x20shutdown');};exports[_0xc2d2('0x5')]=function(){utils['info'](_0xc2d2('0x6'));};exports[_0xc2d2('0x7')]=function(_0x11079a){utils[_0xc2d2('0x7')](_0xc2d2('0x8'),_0x11079a);};exports['close']=function(){utils['info'](_0xc2d2('0x9'));};exports[_0xc2d2('0xa')]=function(_0x2ebe63){}; \ No newline at end of file +var _0xe59b=['close','managerevent','./utils','info','shutdown','error','[core]\x20error'];(function(_0x1712d2,_0x493af7){var _0x4538d6=function(_0x332c65){while(--_0x332c65){_0x1712d2['push'](_0x1712d2['shift']());}};_0x4538d6(++_0x493af7);}(_0xe59b,0x1e5));var _0xbe59=function(_0x9dde79,_0x459df8){_0x9dde79=_0x9dde79-0x0;var _0x21c317=_0xe59b[_0x9dde79];return _0x21c317;};'use strict';var utils=require(_0xbe59('0x0'));exports['connect']=function(){utils[_0xbe59('0x1')]('[core]\x20connected');};exports[_0xbe59('0x2')]=function(){utils[_0xbe59('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0xbe59('0x1')]('[core]\x20fullybooted');};exports[_0xbe59('0x3')]=function(_0x3ade25){utils[_0xbe59('0x3')](_0xbe59('0x4'),_0x3ade25);};exports[_0xbe59('0x5')]=function(){utils[_0xbe59('0x1')]('[core]\x20close');};exports[_0xbe59('0x6')]=function(_0x209479){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 75e1d16..911621b 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 _0x610d=['assign','starttime','now','lastevent','called','isNil','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','util','info','uniqueid','channel','calleridnum','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','split','error','format','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x610d,0x1bd));var _0xd610=function(_0x29307d,_0x1e9c11){_0x29307d=_0x29307d-0x0;var _0x5360d6=_0x610d[_0x29307d];return _0x5360d6;};'use strict';var _=require('lodash');var util=require(_0xd610('0x0'));var utils=require('./utils');var dials={};function writeDB(_0xdbd5d6){utils[_0xd610('0x1')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0xdbd5d6[_0xd610('0x2')],_0xdbd5d6[_0xd610('0x3')],_0xdbd5d6['dialstring'],_0xdbd5d6[_0xd610('0x4')],_0xdbd5d6[_0xd610('0x5')],_0xdbd5d6['dialstatus']));utils[_0xd610('0x6')](_0xd610('0x7'),_0xdbd5d6);delete dials[_0xdbd5d6[_0xd610('0x2')]];}exports['newexten']=function(_0xd4afb6){try{utils[_0xd610('0x8')](util['format'](_0xd610('0x9'),_0xd4afb6[_0xd610('0x2')]),_0xd4afb6);utils['info'](util['format'](_0xd610('0xa'),_0xd4afb6[_0xd610('0x2')],_0xd4afb6[_0xd610('0xb')],_0xd4afb6[_0xd610('0xc')]));if(_0xd4afb6[_0xd610('0xb')][_0xd610('0xd')]()=='set'&&_['startsWith'](_0xd4afb6['appdata'][_0xd610('0xd')](),'cdr(routeid)')){var _0x268c7f=_0xd4afb6[_0xd610('0xc')][_0xd610('0xe')]('=');dials[_0xd4afb6['uniqueid']]={'routeId':_0x268c7f[0x1]};}}catch(_0x20ef1b){utils[_0xd610('0xf')](util[_0xd610('0x10')](_0xd610('0x9'),_0xd4afb6[_0xd610('0x2')]),_0x20ef1b);}};exports[_0xd610('0x11')]=function(_0x327c18){try{utils[_0xd610('0x8')](util[_0xd610('0x10')]('[%s][dials][varset]',_0x327c18[_0xd610('0x2')]),_0x327c18);if(!_['isNil'](_0x327c18[_0xd610('0x12')][_0xd610('0x13')])){utils['info'](util['format'](_0xd610('0x14'),_0x327c18['uniqueid'],_0x327c18[_0xd610('0x15')]));dials[_0x327c18[_0xd610('0x2')]]={'routeId':_0x327c18[_0xd610('0x15')]};}}catch(_0xc0503d){utils[_0xd610('0xf')](util[_0xd610('0x10')](_0xd610('0x16'),_0x327c18[_0xd610('0x2')]),_0xc0503d);}};exports[_0xd610('0x17')]=function(_0x2b1853){try{if(!_['isNil'](dials[_0x2b1853[_0xd610('0x2')]])){utils[_0xd610('0x8')](util[_0xd610('0x10')](_0xd610('0x18'),_0x2b1853['uniqueid']),_0x2b1853);dials[_0x2b1853['uniqueid']]=_[_0xd610('0x19')](dials[_0x2b1853[_0xd610('0x2')]],_0x2b1853);dials[_0x2b1853[_0xd610('0x2')]][_0xd610('0x1a')]=utils[_0xd610('0x1b')]();dials[_0x2b1853[_0xd610('0x2')]][_0xd610('0x1c')]=_0xd610('0x1d');utils['info'](util[_0xd610('0x10')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2b1853['uniqueid'],dials[_0x2b1853[_0xd610('0x2')]][_0xd610('0x1a')]));}}catch(_0x1eadb7){utils[_0xd610('0xf')](util['format']('[%s][dials][dialbegin]',_0x2b1853[_0xd610('0x2')]),_0x1eadb7);}};exports['dialend']=function(_0x178f12){try{if(!_[_0xd610('0x1e')](dials[_0x178f12[_0xd610('0x2')]])){utils['debug'](util[_0xd610('0x10')](_0xd610('0x1f'),_0x178f12[_0xd610('0x2')]),_0x178f12);dials[_0x178f12[_0xd610('0x2')]][_0xd610('0x20')]=_0x178f12['dialstatus'];if(_0x178f12[_0xd610('0x20')]==_0xd610('0x21')){dials[_0x178f12[_0xd610('0x2')]]=_[_0xd610('0x19')](dials[_0x178f12['uniqueid']],_0x178f12);dials[_0x178f12[_0xd610('0x2')]][_0xd610('0x22')]=utils[_0xd610('0x1b')]();dials[_0x178f12[_0xd610('0x2')]][_0xd610('0x1c')]=_0xd610('0x23');utils[_0xd610('0x1')](util[_0xd610('0x10')](_0xd610('0x24'),_0x178f12[_0xd610('0x2')],_0x178f12[_0xd610('0x20')],dials[_0x178f12['uniqueid']][_0xd610('0x22')]));}else{utils['info'](util[_0xd610('0x10')](_0xd610('0x25'),_0x178f12[_0xd610('0x2')],_0x178f12['dialstatus']));}}}catch(_0x17cff9){utils[_0xd610('0xf')](util[_0xd610('0x10')](_0xd610('0x1f'),_0x178f12[_0xd610('0x2')]),_0x17cff9);}};exports[_0xd610('0x26')]=function(_0x2db54b){try{if(!_['isNil'](dials[_0x2db54b[_0xd610('0x2')]])){utils[_0xd610('0x8')](util[_0xd610('0x10')]('[%s][dials][hangup]',_0x2db54b[_0xd610('0x2')]),_0x2db54b);utils[_0xd610('0x1')](util[_0xd610('0x10')](_0xd610('0x27'),_0x2db54b['uniqueid'],_0x2db54b[_0xd610('0x4')],_0x2db54b['calleridname'],_0x2db54b[_0xd610('0x28')]));dials[_0x2db54b['uniqueid']]=_[_0xd610('0x19')](dials[_0x2db54b[_0xd610('0x2')]],{'endtime':utils[_0xd610('0x1b')](),'lastevent':_0xd610('0x29')});dials[_0x2db54b['uniqueid']]['duration']=utils[_0xd610('0x2a')](dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x2b')],dials[_0x2db54b['uniqueid']][_0xd610('0x1a')]);dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x2c')]=utils[_0xd610('0x2a')](dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x22')]||dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x2b')],dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x1a')]);dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x2d')]=dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x22')]?utils[_0xd610('0x2a')](dials[_0x2db54b[_0xd610('0x2')]]['endtime'],dials[_0x2db54b[_0xd610('0x2')]][_0xd610('0x22')]):0x0;writeDB(dials[_0x2db54b[_0xd610('0x2')]]);}}catch(_0x1233d9){utils[_0xd610('0xf')](util[_0xd610('0x10')](_0xd610('0x2e'),_0x2db54b['uniqueid']),_0x1233d9);}}; \ No newline at end of file +var _0xfc15=['varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','lastevent','called','dialend','[%s][dials][dialend]','answertime','now','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error'];(function(_0x3822b2,_0x42f256){var _0x28c982=function(_0x307690){while(--_0x307690){_0x3822b2['push'](_0x3822b2['shift']());}};_0x28c982(++_0x42f256);}(_0xfc15,0x1a2));var _0x5fc1=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xfc15[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x5fc1('0x0'));var util=require(_0x5fc1('0x1'));var utils=require(_0x5fc1('0x2'));var dials={};function writeDB(_0x160313){utils[_0x5fc1('0x3')](util[_0x5fc1('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x160313['uniqueid'],_0x160313['channel'],_0x160313['dialstring'],_0x160313[_0x5fc1('0x5')],_0x160313[_0x5fc1('0x6')],_0x160313[_0x5fc1('0x7')]));utils[_0x5fc1('0x8')](_0x5fc1('0x9'),_0x160313);delete dials[_0x160313[_0x5fc1('0xa')]];}exports[_0x5fc1('0xb')]=function(_0x3682a9){try{utils[_0x5fc1('0xc')](util[_0x5fc1('0x4')](_0x5fc1('0xd'),_0x3682a9[_0x5fc1('0xa')]),_0x3682a9);utils[_0x5fc1('0x3')](util['format'](_0x5fc1('0xe'),_0x3682a9[_0x5fc1('0xa')],_0x3682a9[_0x5fc1('0xf')],_0x3682a9[_0x5fc1('0x10')]));if(_0x3682a9[_0x5fc1('0xf')][_0x5fc1('0x11')]()==_0x5fc1('0x12')&&_[_0x5fc1('0x13')](_0x3682a9[_0x5fc1('0x10')][_0x5fc1('0x11')](),_0x5fc1('0x14'))){var _0xfb097a=_0x3682a9[_0x5fc1('0x10')][_0x5fc1('0x15')]('=');dials[_0x3682a9[_0x5fc1('0xa')]]={'routeId':_0xfb097a[0x1]};}}catch(_0x137acc){utils[_0x5fc1('0x16')](util[_0x5fc1('0x4')](_0x5fc1('0xd'),_0x3682a9[_0x5fc1('0xa')]),_0x137acc);}};exports[_0x5fc1('0x17')]=function(_0xaf362b){try{utils[_0x5fc1('0xc')](util['format'](_0x5fc1('0x18'),_0xaf362b[_0x5fc1('0xa')]),_0xaf362b);if(!_[_0x5fc1('0x19')](_0xaf362b[_0x5fc1('0x1a')][_0x5fc1('0x1b')])){utils['info'](util[_0x5fc1('0x4')](_0x5fc1('0x1c'),_0xaf362b['uniqueid'],_0xaf362b[_0x5fc1('0x1d')]));dials[_0xaf362b['uniqueid']]={'routeId':_0xaf362b['value']};}}catch(_0x19e04d){utils[_0x5fc1('0x16')](util[_0x5fc1('0x4')](_0x5fc1('0x18'),_0xaf362b[_0x5fc1('0xa')]),_0x19e04d);}};exports['dialbegin']=function(_0x26e190){try{if(!_[_0x5fc1('0x19')](dials[_0x26e190['uniqueid']])){utils['debug'](util[_0x5fc1('0x4')](_0x5fc1('0x1e'),_0x26e190[_0x5fc1('0xa')]),_0x26e190);dials[_0x26e190[_0x5fc1('0xa')]]=_[_0x5fc1('0x1f')](dials[_0x26e190['uniqueid']],_0x26e190);dials[_0x26e190[_0x5fc1('0xa')]][_0x5fc1('0x20')]=utils['now']();dials[_0x26e190[_0x5fc1('0xa')]][_0x5fc1('0x21')]=_0x5fc1('0x22');utils[_0x5fc1('0x3')](util[_0x5fc1('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x26e190['uniqueid'],dials[_0x26e190[_0x5fc1('0xa')]][_0x5fc1('0x20')]));}}catch(_0x461dae){utils['error'](util[_0x5fc1('0x4')]('[%s][dials][dialbegin]',_0x26e190[_0x5fc1('0xa')]),_0x461dae);}};exports[_0x5fc1('0x23')]=function(_0x3aae52){try{if(!_['isNil'](dials[_0x3aae52['uniqueid']])){utils['debug'](util['format'](_0x5fc1('0x24'),_0x3aae52[_0x5fc1('0xa')]),_0x3aae52);dials[_0x3aae52['uniqueid']][_0x5fc1('0x7')]=_0x3aae52[_0x5fc1('0x7')];if(_0x3aae52[_0x5fc1('0x7')]=='ANSWER'){dials[_0x3aae52[_0x5fc1('0xa')]]=_[_0x5fc1('0x1f')](dials[_0x3aae52[_0x5fc1('0xa')]],_0x3aae52);dials[_0x3aae52[_0x5fc1('0xa')]][_0x5fc1('0x25')]=utils[_0x5fc1('0x26')]();dials[_0x3aae52[_0x5fc1('0xa')]][_0x5fc1('0x21')]='connect';utils['info'](util[_0x5fc1('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3aae52[_0x5fc1('0xa')],_0x3aae52[_0x5fc1('0x7')],dials[_0x3aae52['uniqueid']]['answertime']));}else{utils['info'](util[_0x5fc1('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3aae52[_0x5fc1('0xa')],_0x3aae52[_0x5fc1('0x7')]));}}}catch(_0x3a46a8){utils[_0x5fc1('0x16')](util[_0x5fc1('0x4')](_0x5fc1('0x24'),_0x3aae52['uniqueid']),_0x3a46a8);}};exports[_0x5fc1('0x27')]=function(_0x4be27c){try{if(!_[_0x5fc1('0x19')](dials[_0x4be27c[_0x5fc1('0xa')]])){utils[_0x5fc1('0xc')](util[_0x5fc1('0x4')](_0x5fc1('0x28'),_0x4be27c[_0x5fc1('0xa')]),_0x4be27c);utils['info'](util['format'](_0x5fc1('0x29'),_0x4be27c[_0x5fc1('0xa')],_0x4be27c[_0x5fc1('0x5')],_0x4be27c[_0x5fc1('0x2a')],_0x4be27c[_0x5fc1('0x2b')]));dials[_0x4be27c[_0x5fc1('0xa')]]=_['assign'](dials[_0x4be27c[_0x5fc1('0xa')]],{'endtime':utils[_0x5fc1('0x26')](),'lastevent':_0x5fc1('0x2c')});dials[_0x4be27c[_0x5fc1('0xa')]][_0x5fc1('0x2d')]=utils[_0x5fc1('0x2e')](dials[_0x4be27c[_0x5fc1('0xa')]][_0x5fc1('0x2f')],dials[_0x4be27c[_0x5fc1('0xa')]][_0x5fc1('0x20')]);dials[_0x4be27c['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x4be27c['uniqueid']][_0x5fc1('0x25')]||dials[_0x4be27c['uniqueid']][_0x5fc1('0x2f')],dials[_0x4be27c[_0x5fc1('0xa')]]['starttime']);dials[_0x4be27c[_0x5fc1('0xa')]][_0x5fc1('0x30')]=dials[_0x4be27c['uniqueid']][_0x5fc1('0x25')]?utils[_0x5fc1('0x2e')](dials[_0x4be27c[_0x5fc1('0xa')]]['endtime'],dials[_0x4be27c[_0x5fc1('0xa')]][_0x5fc1('0x25')]):0x0;writeDB(dials[_0x4be27c['uniqueid']]);}}catch(_0x4859cb){utils[_0x5fc1('0x16')](util[_0x5fc1('0x4')](_0x5fc1('0x28'),_0x4be27c[_0x5fc1('0xa')]),_0x4859cb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3470baf..1ff2a7e 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 _0x5a6f=['debug','[%s][index][devicestatechange]','format','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','password','keepConnected','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x6c1005,_0x31a056){var _0xd302e3=function(_0x484eac){while(--_0x484eac){_0x6c1005['push'](_0x6c1005['shift']());}};_0xd302e3(++_0x31a056);}(_0x5a6f,0x70));var _0xf5a6=function(_0x1cf26e,_0x1d6f7b){_0x1cf26e=_0x1cf26e-0x0;var _0x31e23a=_0x5a6f[_0x1cf26e];return _0x31e23a;};var AsteriskManager=require('asterisk-manager');var config=require(_0xf5a6('0x0'));var utils=require(_0xf5a6('0x1'));var util=require(_0xf5a6('0x2'));var isXDREnabled=config[_0xf5a6('0x3')]&&config[_0xf5a6('0x3')][_0xf5a6('0x4')]?!config[_0xf5a6('0x3')][_0xf5a6('0x4')]:!![];var isProduction=config[_0xf5a6('0x5')]===_0xf5a6('0x6')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0xf5a6('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xf5a6('0x8')][_0xf5a6('0x9')],config[_0xf5a6('0x8')]['ip'],config['asterisk']['username'],config[_0xf5a6('0x8')][_0xf5a6('0xa')],!![]);ami[_0xf5a6('0xb')]();if(!isXDREnabled){utils['info'](_0xf5a6('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xf5a6('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0xf5a6('0xe'));var queues=require(_0xf5a6('0xf'));var recordings=require(_0xf5a6('0x10'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xf5a6('0x11'));var core=require(_0xf5a6('0x12'));ami['on'](_0xf5a6('0x13'),core['connect']);ami['on'](_0xf5a6('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0xf5a6('0x15')]);ami['on'](_0xf5a6('0x16'),core['error']);ami['on']('close',core[_0xf5a6('0x17')]);ami['on'](_0xf5a6('0x18'),core[_0xf5a6('0x18')]);ami['on'](_0xf5a6('0x19'),function(_0x18de33){try{utils[_0xf5a6('0x1a')](util['format'](_0xf5a6('0x1b'),_0x18de33['device']),_0x18de33);members[_0xf5a6('0x19')](_0x18de33);}catch(_0x57149e){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')]('[%s][index][devicestatechange]',_0x18de33[_0xf5a6('0x1d')]),_0x57149e);}});ami['on']('agentcalled',function(_0xd7350b){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x1e'),_0xd7350b[_0xf5a6('0x1f')]),_0xd7350b);agents[_0xf5a6('0x20')](_0xd7350b);}catch(_0x50b6cf){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x1e'),_0xd7350b[_0xf5a6('0x1f')]),_0x50b6cf);}});ami['on'](_0xf5a6('0x21'),function(_0x21d221){try{utils['debug'](util[_0xf5a6('0x1c')](_0xf5a6('0x22'),_0x21d221['uniqueid']),_0x21d221);agents[_0xf5a6('0x21')](_0x21d221);}catch(_0x1bd72f){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x22'),_0x21d221[_0xf5a6('0x1f')]),_0x1bd72f);}});ami['on']('agentconnect',function(_0x217063){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x23'),_0x217063[_0xf5a6('0x1f')]),_0x217063);agents[_0xf5a6('0x24')](_0x217063);queues['agentconnect'](_0x217063);}catch(_0x59ff41){utils['error'](util[_0xf5a6('0x1c')](_0xf5a6('0x23'),_0x217063[_0xf5a6('0x1f')]),_0x59ff41);}});ami['on']('agentcomplete',function(_0x19fefa){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x25'),_0x19fefa[_0xf5a6('0x1f')]),_0x19fefa);agents[_0xf5a6('0x26')](_0x19fefa);queues[_0xf5a6('0x26')](_0x19fefa);members[_0xf5a6('0x26')](_0x19fefa);}catch(_0x230223){utils['error'](util[_0xf5a6('0x1c')](_0xf5a6('0x25'),_0x19fefa['uniqueid']),_0x230223);}});ami['on'](_0xf5a6('0x27'),function(_0x44e82e){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x28'),_0x44e82e[_0xf5a6('0x1f')]),_0x44e82e);agents[_0xf5a6('0x27')](_0x44e82e);queues[_0xf5a6('0x27')](_0x44e82e);}catch(_0x5e33de){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x28'),_0x44e82e[_0xf5a6('0x1f')]),_0x5e33de);}});ami['on'](_0xf5a6('0x29'),function(_0x166e8e){try{utils[_0xf5a6('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0x166e8e[_0xf5a6('0x1f')]),_0x166e8e);queues[_0xf5a6('0x29')](_0x166e8e);recordings[_0xf5a6('0x29')](_0x166e8e);}catch(_0x10c45a){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x2a'),_0x166e8e[_0xf5a6('0x1f')]),_0x10c45a);}});ami['on'](_0xf5a6('0x2b'),function(_0x4d9fa8){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')]('[%s][index][queuecallerleave]',_0x4d9fa8[_0xf5a6('0x1f')]),_0x4d9fa8);queues['queuecallerleave'](_0x4d9fa8);}catch(_0x47eea5){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x2c'),_0x4d9fa8[_0xf5a6('0x1f')]),_0x47eea5);}});ami['on'](_0xf5a6('0x2d'),function(_0x293ff0){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x2e'),_0x293ff0[_0xf5a6('0x1f')]),_0x293ff0);queues['musiconholdstart'](_0x293ff0);calls[_0xf5a6('0x2d')](_0x293ff0);}catch(_0x49e86c){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')]('[%s][index][musiconholdstart]',_0x293ff0[_0xf5a6('0x1f')]),_0x49e86c);}});ami['on'](_0xf5a6('0x2f'),function(_0x445613){try{utils['debug'](util['format'](_0xf5a6('0x30'),_0x445613['uniqueid']),_0x445613);queues[_0xf5a6('0x2f')](_0x445613);calls[_0xf5a6('0x2f')](_0x445613);}catch(_0x2787e9){utils['error'](util['format'](_0xf5a6('0x30'),_0x445613[_0xf5a6('0x1f')]),_0x2787e9);}});ami['on']('newstate',function(_0x495816){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x31'),_0x495816[_0xf5a6('0x1f')]),_0x495816);calls[_0xf5a6('0x32')](_0x495816);recordings[_0xf5a6('0x32')](_0x495816);}catch(_0x1c969e){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x31'),_0x495816[_0xf5a6('0x1f')]),_0x1c969e);}});ami['on']('hangup',function(_0xcc3a7f){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')]('[%s][index][hangup]',_0xcc3a7f['uniqueid']),_0xcc3a7f);calls['hangup'](_0xcc3a7f);recordings[_0xf5a6('0x33')](_0xcc3a7f);dials[_0xf5a6('0x33')](_0xcc3a7f);agents[_0xf5a6('0x33')](_0xcc3a7f);queues['hangup'](_0xcc3a7f);}catch(_0xef1a87){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x34'),_0xcc3a7f[_0xf5a6('0x1f')]),_0xef1a87);}});ami['on']('cdr',function(_0x2224f8){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x35'),_0x2224f8['uniqueid']),_0x2224f8);members[_0xf5a6('0x36')](_0x2224f8);}catch(_0x161a94){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')]('[%s][index][cdr]',_0x2224f8[_0xf5a6('0x1f')]),_0x161a94);}});ami['on']('blindtransfer',function(_0x1eba33){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')]('[%s][index][blindtransfer]',_0x1eba33[_0xf5a6('0x1f')]),_0x1eba33);queues['blindtransfer'](_0x1eba33);agents[_0xf5a6('0x37')](_0x1eba33);transfers[_0xf5a6('0x37')](_0x1eba33);recordings[_0xf5a6('0x37')](_0x1eba33);}catch(_0x4f50e8){utils[_0xf5a6('0x16')](util['format'](_0xf5a6('0x38'),_0x1eba33[_0xf5a6('0x1f')]),_0x4f50e8);}});ami['on'](_0xf5a6('0x39'),function(_0x217776){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')]('[%s][index][attendedtransfer]',_0x217776[_0xf5a6('0x3a')]),_0x217776);queues[_0xf5a6('0x39')](_0x217776);transfers['attendedtransfer'](_0x217776);agents[_0xf5a6('0x39')](_0x217776);calls[_0xf5a6('0x39')](_0x217776);}catch(_0x4a09e2){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x217776[_0xf5a6('0x3a')]),_0x4a09e2);}});ami['on'](_0xf5a6('0x3b'),function(_0x2e459b){try{utils[_0xf5a6('0x1a')](util['format'](_0xf5a6('0x3c'),_0x2e459b[_0xf5a6('0x1f')]),_0x2e459b);queues[_0xf5a6('0x3b')](_0x2e459b);recordings[_0xf5a6('0x3b')](_0x2e459b);calls[_0xf5a6('0x3b')](_0x2e459b);dials[_0xf5a6('0x3b')](_0x2e459b);}catch(_0x1c6935){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x3c'),_0x2e459b[_0xf5a6('0x1f')]),_0x1c6935);}});ami['on'](_0xf5a6('0x3d'),function(_0x5a5253){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')]('[%s][index][newexten]',_0x5a5253[_0xf5a6('0x1f')]),_0x5a5253);calls[_0xf5a6('0x3d')](_0x5a5253);recordings['newexten'](_0x5a5253);dials['newexten'](_0x5a5253);}catch(_0x420f63){utils['error'](util[_0xf5a6('0x1c')](_0xf5a6('0x3e'),_0x5a5253[_0xf5a6('0x1f')]),_0x420f63);}});ami['on']('newchannel',function(_0x1977d0){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x3f'),_0x1977d0['uniqueid']),_0x1977d0);calls['newchannel'](_0x1977d0);recordings[_0xf5a6('0x40')](_0x1977d0);}catch(_0x51ac13){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x3f'),_0x1977d0['uniqueid']),_0x51ac13);}});ami['on']('dialbegin',function(_0x21a840){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x41'),_0x21a840['uniqueid']),_0x21a840);dials['dialbegin'](_0x21a840);}catch(_0x5d9ddd){utils[_0xf5a6('0x16')](util[_0xf5a6('0x1c')](_0xf5a6('0x42'),_0x21a840[_0xf5a6('0x1f')]),_0x5d9ddd);}});ami['on'](_0xf5a6('0x43'),function(_0x350570){try{utils[_0xf5a6('0x1a')](util[_0xf5a6('0x1c')](_0xf5a6('0x44'),_0x350570['uniqueid']),_0x350570);dials[_0xf5a6('0x43')](_0x350570);}catch(_0x4db3fb){utils['error'](util[_0xf5a6('0x1c')](_0xf5a6('0x44'),_0x350570[_0xf5a6('0x1f')]),_0x4db3fb);}});} \ No newline at end of file +var _0xe4b6=['xdr','disabled','env','production','local','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','debug','device','devicestatechange','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util'];(function(_0x581bc1,_0x526dbb){var _0x33eaf7=function(_0x4dffbb){while(--_0x4dffbb){_0x581bc1['push'](_0x581bc1['shift']());}};_0x33eaf7(++_0x526dbb);}(_0xe4b6,0xc6));var _0x6e4b=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xe4b6[_0x31c19c];return _0x1a87f7;};var AsteriskManager=require(_0x6e4b('0x0'));var config=require('../../config/environment');var utils=require(_0x6e4b('0x1'));var util=require(_0x6e4b('0x2'));var isXDREnabled=config[_0x6e4b('0x3')]&&config['xdr']['disabled']?!config['xdr'][_0x6e4b('0x4')]:!![];var isProduction=config[_0x6e4b('0x5')]===_0x6e4b('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x6e4b('0x3')][_0x6e4b('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x6e4b('0x8')]['port'],config['asterisk']['ip'],config['asterisk'][_0x6e4b('0x9')],config[_0x6e4b('0x8')][_0x6e4b('0xa')],!![]);ami[_0x6e4b('0xb')]();if(!isXDREnabled){utils[_0x6e4b('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x6e4b('0xc')](_0x6e4b('0xd'));}else{var agents=require(_0x6e4b('0xe'));var calls=require(_0x6e4b('0xf'));var queues=require('./queues.controller');var recordings=require(_0x6e4b('0x10'));var members=require('./members.controller');var dials=require(_0x6e4b('0x11'));var transfers=require(_0x6e4b('0x12'));var core=require(_0x6e4b('0x13'));ami['on']('connect',core['connect']);ami['on'](_0x6e4b('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0x6e4b('0x15')]);ami['on'](_0x6e4b('0x16'),core[_0x6e4b('0x16')]);ami['on'](_0x6e4b('0x17'),core[_0x6e4b('0x17')]);ami['on'](_0x6e4b('0x18'),core[_0x6e4b('0x18')]);ami['on']('devicestatechange',function(_0x32e013){try{utils[_0x6e4b('0x19')](util['format']('[%s][index][devicestatechange]',_0x32e013[_0x6e4b('0x1a')]),_0x32e013);members[_0x6e4b('0x1b')](_0x32e013);}catch(_0x42c605){utils['error'](util[_0x6e4b('0x1c')]('[%s][index][devicestatechange]',_0x32e013[_0x6e4b('0x1a')]),_0x42c605);}});ami['on'](_0x6e4b('0x1d'),function(_0x11ca36){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x1e'),_0x11ca36[_0x6e4b('0x1f')]),_0x11ca36);agents['agentcalled'](_0x11ca36);}catch(_0x4eb85d){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x1e'),_0x11ca36[_0x6e4b('0x1f')]),_0x4eb85d);}});ami['on'](_0x6e4b('0x20'),function(_0x9b1cf4){try{utils['debug'](util[_0x6e4b('0x1c')](_0x6e4b('0x21'),_0x9b1cf4['uniqueid']),_0x9b1cf4);agents[_0x6e4b('0x20')](_0x9b1cf4);}catch(_0x133490){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x21'),_0x9b1cf4[_0x6e4b('0x1f')]),_0x133490);}});ami['on'](_0x6e4b('0x22'),function(_0x2b4e49){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')]('[%s][index][agentconnect]',_0x2b4e49[_0x6e4b('0x1f')]),_0x2b4e49);agents[_0x6e4b('0x22')](_0x2b4e49);queues[_0x6e4b('0x22')](_0x2b4e49);}catch(_0x3b2ac4){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')]('[%s][index][agentconnect]',_0x2b4e49[_0x6e4b('0x1f')]),_0x3b2ac4);}});ami['on'](_0x6e4b('0x23'),function(_0x4c1f44){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x24'),_0x4c1f44[_0x6e4b('0x1f')]),_0x4c1f44);agents[_0x6e4b('0x23')](_0x4c1f44);queues[_0x6e4b('0x23')](_0x4c1f44);members[_0x6e4b('0x23')](_0x4c1f44);}catch(_0x196857){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')]('[%s][index][agentcomplete]',_0x4c1f44['uniqueid']),_0x196857);}});ami['on'](_0x6e4b('0x25'),function(_0x1d25a5){try{utils[_0x6e4b('0x19')](util['format'](_0x6e4b('0x26'),_0x1d25a5[_0x6e4b('0x1f')]),_0x1d25a5);agents['queuecallerabandon'](_0x1d25a5);queues[_0x6e4b('0x25')](_0x1d25a5);}catch(_0x2052d7){utils['error'](util[_0x6e4b('0x1c')](_0x6e4b('0x26'),_0x1d25a5[_0x6e4b('0x1f')]),_0x2052d7);}});ami['on'](_0x6e4b('0x27'),function(_0x1186a8){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')]('[%s][index][queuecallerjoin]',_0x1186a8['uniqueid']),_0x1186a8);queues['queuecallerjoin'](_0x1186a8);recordings[_0x6e4b('0x27')](_0x1186a8);}catch(_0x4f59b7){utils[_0x6e4b('0x16')](util['format']('[%s][index][queuecallerjoin]',_0x1186a8['uniqueid']),_0x4f59b7);}});ami['on'](_0x6e4b('0x28'),function(_0x302537){try{utils['debug'](util[_0x6e4b('0x1c')](_0x6e4b('0x29'),_0x302537[_0x6e4b('0x1f')]),_0x302537);queues[_0x6e4b('0x28')](_0x302537);}catch(_0x344ea4){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x29'),_0x302537['uniqueid']),_0x344ea4);}});ami['on'](_0x6e4b('0x2a'),function(_0x11a9c5){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x2b'),_0x11a9c5[_0x6e4b('0x1f')]),_0x11a9c5);queues[_0x6e4b('0x2a')](_0x11a9c5);calls[_0x6e4b('0x2a')](_0x11a9c5);}catch(_0x408c62){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x2b'),_0x11a9c5[_0x6e4b('0x1f')]),_0x408c62);}});ami['on'](_0x6e4b('0x2c'),function(_0x1f48b8){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x2d'),_0x1f48b8[_0x6e4b('0x1f')]),_0x1f48b8);queues[_0x6e4b('0x2c')](_0x1f48b8);calls['musiconholdstop'](_0x1f48b8);}catch(_0x1b51b4){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x2d'),_0x1f48b8[_0x6e4b('0x1f')]),_0x1b51b4);}});ami['on']('newstate',function(_0x5262de){try{utils[_0x6e4b('0x19')](util['format'](_0x6e4b('0x2e'),_0x5262de[_0x6e4b('0x1f')]),_0x5262de);calls[_0x6e4b('0x2f')](_0x5262de);recordings['newstate'](_0x5262de);}catch(_0x1b666c){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x2e'),_0x5262de[_0x6e4b('0x1f')]),_0x1b666c);}});ami['on']('hangup',function(_0x544f0c){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x30'),_0x544f0c['uniqueid']),_0x544f0c);calls[_0x6e4b('0x31')](_0x544f0c);recordings['hangup'](_0x544f0c);dials[_0x6e4b('0x31')](_0x544f0c);agents['hangup'](_0x544f0c);queues['hangup'](_0x544f0c);}catch(_0x4d3a86){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x30'),_0x544f0c[_0x6e4b('0x1f')]),_0x4d3a86);}});ami['on']('cdr',function(_0x3734db){try{utils[_0x6e4b('0x19')](util['format'](_0x6e4b('0x32'),_0x3734db[_0x6e4b('0x1f')]),_0x3734db);members[_0x6e4b('0x33')](_0x3734db);}catch(_0x3764b2){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x32'),_0x3734db[_0x6e4b('0x1f')]),_0x3764b2);}});ami['on'](_0x6e4b('0x34'),function(_0x39911e){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x35'),_0x39911e[_0x6e4b('0x1f')]),_0x39911e);queues[_0x6e4b('0x34')](_0x39911e);agents[_0x6e4b('0x34')](_0x39911e);transfers[_0x6e4b('0x34')](_0x39911e);recordings['blindtransfer'](_0x39911e);}catch(_0x4d647b){utils['error'](util['format'](_0x6e4b('0x35'),_0x39911e[_0x6e4b('0x1f')]),_0x4d647b);}});ami['on'](_0x6e4b('0x36'),function(_0x317530){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x37'),_0x317530['origtransfereruniqueid']),_0x317530);queues[_0x6e4b('0x36')](_0x317530);transfers[_0x6e4b('0x36')](_0x317530);agents[_0x6e4b('0x36')](_0x317530);calls[_0x6e4b('0x36')](_0x317530);}catch(_0x26165d){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')]('[%s][index][attendedtransfer]',_0x317530['origtransfereruniqueid']),_0x26165d);}});ami['on'](_0x6e4b('0x38'),function(_0x22b7fd){try{utils[_0x6e4b('0x19')](util['format'](_0x6e4b('0x39'),_0x22b7fd[_0x6e4b('0x1f')]),_0x22b7fd);queues['varset'](_0x22b7fd);recordings['varset'](_0x22b7fd);calls['varset'](_0x22b7fd);dials['varset'](_0x22b7fd);}catch(_0x8632f9){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x39'),_0x22b7fd[_0x6e4b('0x1f')]),_0x8632f9);}});ami['on']('newexten',function(_0x23d7b4){try{utils['debug'](util[_0x6e4b('0x1c')](_0x6e4b('0x3a'),_0x23d7b4[_0x6e4b('0x1f')]),_0x23d7b4);calls[_0x6e4b('0x3b')](_0x23d7b4);recordings[_0x6e4b('0x3b')](_0x23d7b4);dials['newexten'](_0x23d7b4);}catch(_0x1b4833){utils[_0x6e4b('0x16')](util['format']('[%s][index][newexten]',_0x23d7b4[_0x6e4b('0x1f')]),_0x1b4833);}});ami['on'](_0x6e4b('0x3c'),function(_0x5c4f07){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x3d'),_0x5c4f07[_0x6e4b('0x1f')]),_0x5c4f07);calls[_0x6e4b('0x3c')](_0x5c4f07);recordings[_0x6e4b('0x3c')](_0x5c4f07);}catch(_0x45db9e){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')](_0x6e4b('0x3d'),_0x5c4f07[_0x6e4b('0x1f')]),_0x45db9e);}});ami['on'](_0x6e4b('0x3e'),function(_0x26846e){try{utils['debug'](util['format'](_0x6e4b('0x3f'),_0x26846e[_0x6e4b('0x1f')]),_0x26846e);dials[_0x6e4b('0x3e')](_0x26846e);}catch(_0x43bc49){utils['error'](util[_0x6e4b('0x1c')](_0x6e4b('0x40'),_0x26846e[_0x6e4b('0x1f')]),_0x43bc49);}});ami['on'](_0x6e4b('0x41'),function(_0x2c245c){try{utils[_0x6e4b('0x19')](util[_0x6e4b('0x1c')](_0x6e4b('0x42'),_0x2c245c[_0x6e4b('0x1f')]),_0x2c245c);dials[_0x6e4b('0x41')](_0x2c245c);}catch(_0x31353f){utils[_0x6e4b('0x16')](util[_0x6e4b('0x1c')]('[%s][index][dialend]',_0x2c245c['uniqueid']),_0x31353f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9c02a76..662fb41 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 _0x74b1=['name','request','CreateMemberReport','getUserByName','split','then','internal','catch','error','[%s][members][writeDB]','uniqueid','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','TALKING','now','NOT_INUSE','exitAt','duration','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','type','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','isNil','destination','lodash','util','Local/_attended@transfer','Queue:','info','format','channel','data2','membername','interface','getUserByInterface'];(function(_0x315364,_0x29518a){var _0x471741=function(_0x192b66){while(--_0x192b66){_0x315364['push'](_0x315364['shift']());}};_0x471741(++_0x29518a);}(_0x74b1,0xb5));var _0x174b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x74b1[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x174b('0x0'));var util=require(_0x174b('0x1'));var utils=require('./utils');var members={};var exclude=[_0x174b('0x2'),_0x174b('0x3')];function writeDB(_0x57de0a){utils[_0x174b('0x4')](util[_0x174b('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x57de0a['uniqueid'],_0x57de0a['interface'],_0x57de0a[_0x174b('0x6')],_0x57de0a[_0x174b('0x7')],_0x57de0a[_0x174b('0x8')],_0x57de0a['type']));if(_0x57de0a[_0x174b('0x9')]){utils[_0x174b('0xa')](_0x57de0a['interface'])['then'](function(_0x16414e){if(_0x16414e){_0x57de0a['membername']=_0x16414e[_0x174b('0xb')];_0x57de0a['internal']=_0x16414e['internal'];utils[_0x174b('0xc')](_0x174b('0xd'),_0x57de0a);}else{utils[_0x174b('0xe')](_0x57de0a[_0x174b('0x9')][_0x174b('0xf')]('/')[0x1])[_0x174b('0x10')](function(_0x15626d){if(_0x15626d){_0x57de0a[_0x174b('0x8')]=_0x15626d[_0x174b('0xb')];_0x57de0a['internal']=_0x15626d[_0x174b('0x11')];utils[_0x174b('0xc')](_0x174b('0xd'),_0x57de0a);}});}})[_0x174b('0x12')](function(_0x1fe1f8){utils[_0x174b('0x13')](util[_0x174b('0x5')](_0x174b('0x14'),_0x57de0a[_0x174b('0x15')]),_0x1fe1f8);});}delete members[_0x57de0a['interface']];}function startsWith(_0x1c5579,_0xde8235){return _[_0x174b('0x16')](_0x1c5579,function(_0x4a7aeb){return _['startsWith'](_0xde8235,_0x4a7aeb);});}exports[_0x174b('0x17')]=function(_0x10995c){try{utils[_0x174b('0x18')](util[_0x174b('0x5')](_0x174b('0x19'),members[_0x10995c[_0x174b('0x1a')]]?members[_0x10995c['device']][_0x174b('0x15')]:_0x10995c[_0x174b('0x1a')]),_0x10995c);utils[_0x174b('0x4')](util[_0x174b('0x5')](_0x174b('0x1b'),members[_0x10995c[_0x174b('0x1a')]]?members[_0x10995c[_0x174b('0x1a')]][_0x174b('0x15')]:_0x10995c[_0x174b('0x1a')],_0x10995c[_0x174b('0x1c')],_0x10995c['device']));switch(_0x10995c[_0x174b('0x1c')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x10995c[_0x174b('0x1a')])){members[_0x10995c['device']]={'channel':'voice','interface':_0x10995c[_0x174b('0x1a')],'type':_0x174b('0x1d'),'enterAt':utils[_0x174b('0x1e')](),'role':'agent'};}break;case _0x174b('0x1f'):if(!_['isNil'](members[_0x10995c[_0x174b('0x1a')]])){members[_0x10995c[_0x174b('0x1a')]][_0x174b('0x20')]=utils[_0x174b('0x1e')]();members[_0x10995c[_0x174b('0x1a')]][_0x174b('0x21')]=utils['diffTime'](members[_0x10995c['device']][_0x174b('0x20')],members[_0x10995c[_0x174b('0x1a')]][_0x174b('0x22')]);if(members[_0x10995c[_0x174b('0x1a')]]['uniqueid']){writeDB(members[_0x10995c[_0x174b('0x1a')]]);}}break;default:break;}}catch(_0x3215bd){utils['error'](util[_0x174b('0x5')](_0x174b('0x19'),members[_0x10995c[_0x174b('0x1a')]]?members[_0x10995c[_0x174b('0x1a')]][_0x174b('0x15')]:_0x10995c[_0x174b('0x1a')]),_0x3215bd);}};exports['agentcomplete']=function(_0x2c6189){try{if(!_['isNil'](members[_0x2c6189[_0x174b('0x9')]])){utils[_0x174b('0x18')](util[_0x174b('0x5')](_0x174b('0x23'),_0x2c6189[_0x174b('0x15')]),_0x2c6189);utils[_0x174b('0x4')](util[_0x174b('0x5')](_0x174b('0x24'),_0x2c6189[_0x174b('0x15')],_0x2c6189['interface'],_0x2c6189[_0x174b('0x25')]));members[_0x2c6189[_0x174b('0x9')]]=_[_0x174b('0x26')](members[_0x2c6189['interface']],{'data4':_0x2c6189[_0x174b('0x25')],'uniqueid':_0x2c6189['uniqueid']});}}catch(_0x52c5b0){utils[_0x174b('0x13')](util[_0x174b('0x5')](_0x174b('0x23'),_0x2c6189[_0x174b('0x15')]),_0x52c5b0);}};exports['cdr']=function(_0x2599c7){try{utils[_0x174b('0x18')](util[_0x174b('0x5')](_0x174b('0x27'),_0x2599c7[_0x174b('0x15')]),_0x2599c7);if(_0x2599c7[_0x174b('0x6')]){var _0x320de5=_0x2599c7['channel'][_0x174b('0xf')]('-')[0x0];if(!_['isNil'](members[_0x320de5])){members[_0x320de5]=_['assign'](members[_0x320de5],{'data1':members[_0x320de5][_0x174b('0x28')]||_0x2599c7[_0x174b('0x29')],'data2':members[_0x320de5][_0x174b('0x7')]||_0x2599c7[_0x174b('0x2a')],'data3':members[_0x320de5][_0x174b('0x2b')]||_0x2599c7['destination'],'uniqueid':members[_0x320de5][_0x174b('0x15')]||_0x2599c7[_0x174b('0x15')]});utils[_0x174b('0x4')](util[_0x174b('0x5')](_0x174b('0x2c'),_0x2599c7[_0x174b('0x15')],members[_0x320de5][_0x174b('0x28')],members[_0x320de5][_0x174b('0x7')],members[_0x320de5][_0x174b('0x2b')]));if(members[_0x320de5]['exitAt']){writeDB(members[_0x320de5]);}}}if(_0x2599c7['destinationchannel']){var _0x296765=_0x2599c7[_0x174b('0x2d')][_0x174b('0xf')]('-')[0x0];if(!_[_0x174b('0x2e')](members[_0x296765])){members[_0x296765]=_[_0x174b('0x26')](members[_0x296765],{'data1':members[_0x296765]['data1']||_0x2599c7['type'],'data2':members[_0x296765][_0x174b('0x7')]||_0x2599c7[_0x174b('0x2a')],'data3':members[_0x296765]['data3']||_0x2599c7[_0x174b('0x2f')],'uniqueid':members[_0x296765][_0x174b('0x15')]||_0x2599c7[_0x174b('0x15')]});utils[_0x174b('0x4')](util[_0x174b('0x5')](_0x174b('0x2c'),_0x2599c7['uniqueid'],members[_0x296765]['data1'],members[_0x296765][_0x174b('0x7')],members[_0x296765][_0x174b('0x2b')]));if(members[_0x296765][_0x174b('0x20')]){writeDB(members[_0x296765]);}}}}catch(_0x5015ce){utils[_0x174b('0x13')](util[_0x174b('0x5')](_0x174b('0x27'),_0x2599c7[_0x174b('0x15')]),_0x5015ce);}}; \ No newline at end of file +var _0x0d77=['destinationchannel','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','name','internal','request','CreateMemberReport','split','catch','error','format','some','debug','[%s][members][devicestatechange]','device','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s'];(function(_0x4fe823,_0x16dbde){var _0x3693c9=function(_0xb17e01){while(--_0xb17e01){_0x4fe823['push'](_0x4fe823['shift']());}};_0x3693c9(++_0x16dbde);}(_0x0d77,0x8b));var _0x70d7=function(_0x2e11e4,_0x197ae9){_0x2e11e4=_0x2e11e4-0x0;var _0x5063ef=_0x0d77[_0x2e11e4];return _0x5063ef;};'use strict';var _=require(_0x70d7('0x0'));var util=require(_0x70d7('0x1'));var utils=require(_0x70d7('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x70d7('0x3')];function writeDB(_0x3242fa){utils[_0x70d7('0x4')](util['format'](_0x70d7('0x5'),_0x3242fa[_0x70d7('0x6')],_0x3242fa['interface'],_0x3242fa[_0x70d7('0x7')],_0x3242fa[_0x70d7('0x8')],_0x3242fa[_0x70d7('0x9')],_0x3242fa[_0x70d7('0xa')]));if(_0x3242fa[_0x70d7('0xb')]){utils['getUserByInterface'](_0x3242fa[_0x70d7('0xb')])['then'](function(_0x1ad2d5){if(_0x1ad2d5){_0x3242fa['membername']=_0x1ad2d5[_0x70d7('0xc')];_0x3242fa['internal']=_0x1ad2d5[_0x70d7('0xd')];utils[_0x70d7('0xe')](_0x70d7('0xf'),_0x3242fa);}else{utils['getUserByName'](_0x3242fa[_0x70d7('0xb')][_0x70d7('0x10')]('/')[0x1])['then'](function(_0x59c9e2){if(_0x59c9e2){_0x3242fa[_0x70d7('0x9')]=_0x59c9e2[_0x70d7('0xc')];_0x3242fa[_0x70d7('0xd')]=_0x59c9e2[_0x70d7('0xd')];utils[_0x70d7('0xe')](_0x70d7('0xf'),_0x3242fa);}});}})[_0x70d7('0x11')](function(_0x2a3651){utils[_0x70d7('0x12')](util[_0x70d7('0x13')]('[%s][members][writeDB]',_0x3242fa[_0x70d7('0x6')]),_0x2a3651);});}delete members[_0x3242fa[_0x70d7('0xb')]];}function startsWith(_0x4c2339,_0x1acd9b){return _[_0x70d7('0x14')](_0x4c2339,function(_0x4e9dfd){return _['startsWith'](_0x1acd9b,_0x4e9dfd);});}exports['devicestatechange']=function(_0x2c9956){try{utils[_0x70d7('0x15')](util[_0x70d7('0x13')](_0x70d7('0x16'),members[_0x2c9956[_0x70d7('0x17')]]?members[_0x2c9956[_0x70d7('0x17')]][_0x70d7('0x6')]:_0x2c9956[_0x70d7('0x17')]),_0x2c9956);utils['info'](util[_0x70d7('0x13')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x2c9956[_0x70d7('0x17')]]?members[_0x2c9956[_0x70d7('0x17')]]['uniqueid']:_0x2c9956[_0x70d7('0x17')],_0x2c9956['state'],_0x2c9956[_0x70d7('0x17')]));switch(_0x2c9956['state']){case _0x70d7('0x18'):case _0x70d7('0x19'):if(!startsWith(exclude,_0x2c9956[_0x70d7('0x17')])){members[_0x2c9956[_0x70d7('0x17')]]={'channel':_0x70d7('0x1a'),'interface':_0x2c9956[_0x70d7('0x17')],'type':_0x70d7('0x1b'),'enterAt':utils[_0x70d7('0x1c')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x70d7('0x1d')](members[_0x2c9956[_0x70d7('0x17')]])){members[_0x2c9956[_0x70d7('0x17')]][_0x70d7('0x1e')]=utils['now']();members[_0x2c9956[_0x70d7('0x17')]][_0x70d7('0x1f')]=utils['diffTime'](members[_0x2c9956['device']][_0x70d7('0x1e')],members[_0x2c9956[_0x70d7('0x17')]][_0x70d7('0x20')]);if(members[_0x2c9956[_0x70d7('0x17')]][_0x70d7('0x6')]){writeDB(members[_0x2c9956[_0x70d7('0x17')]]);}}break;default:break;}}catch(_0x2ccce1){utils[_0x70d7('0x12')](util[_0x70d7('0x13')]('[%s][members][devicestatechange]',members[_0x2c9956[_0x70d7('0x17')]]?members[_0x2c9956['device']]['uniqueid']:_0x2c9956[_0x70d7('0x17')]),_0x2ccce1);}};exports[_0x70d7('0x21')]=function(_0x1ce4a0){try{if(!_[_0x70d7('0x1d')](members[_0x1ce4a0[_0x70d7('0xb')]])){utils[_0x70d7('0x15')](util[_0x70d7('0x13')](_0x70d7('0x22'),_0x1ce4a0[_0x70d7('0x6')]),_0x1ce4a0);utils[_0x70d7('0x4')](util[_0x70d7('0x13')](_0x70d7('0x23'),_0x1ce4a0[_0x70d7('0x6')],_0x1ce4a0[_0x70d7('0xb')],_0x1ce4a0['queue']));members[_0x1ce4a0[_0x70d7('0xb')]]=_[_0x70d7('0x24')](members[_0x1ce4a0[_0x70d7('0xb')]],{'data4':_0x1ce4a0[_0x70d7('0x25')],'uniqueid':_0x1ce4a0[_0x70d7('0x6')]});}}catch(_0x412802){utils['error'](util[_0x70d7('0x13')](_0x70d7('0x22'),_0x1ce4a0[_0x70d7('0x6')]),_0x412802);}};exports[_0x70d7('0x26')]=function(_0x12f5a4){try{utils[_0x70d7('0x15')](util[_0x70d7('0x13')](_0x70d7('0x27'),_0x12f5a4[_0x70d7('0x6')]),_0x12f5a4);if(_0x12f5a4[_0x70d7('0x7')]){var _0x56c59b=_0x12f5a4[_0x70d7('0x7')][_0x70d7('0x10')]('-')[0x0];if(!_[_0x70d7('0x1d')](members[_0x56c59b])){members[_0x56c59b]=_[_0x70d7('0x24')](members[_0x56c59b],{'data1':members[_0x56c59b][_0x70d7('0x28')]||_0x12f5a4[_0x70d7('0xa')],'data2':members[_0x56c59b][_0x70d7('0x8')]||_0x12f5a4[_0x70d7('0x29')],'data3':members[_0x56c59b][_0x70d7('0x2a')]||_0x12f5a4[_0x70d7('0x2b')],'uniqueid':members[_0x56c59b][_0x70d7('0x6')]||_0x12f5a4[_0x70d7('0x6')]});utils[_0x70d7('0x4')](util[_0x70d7('0x13')](_0x70d7('0x2c'),_0x12f5a4[_0x70d7('0x6')],members[_0x56c59b][_0x70d7('0x28')],members[_0x56c59b][_0x70d7('0x8')],members[_0x56c59b][_0x70d7('0x2a')]));if(members[_0x56c59b][_0x70d7('0x1e')]){writeDB(members[_0x56c59b]);}}}if(_0x12f5a4[_0x70d7('0x2d')]){var _0x8b6296=_0x12f5a4[_0x70d7('0x2d')][_0x70d7('0x10')]('-')[0x0];if(!_[_0x70d7('0x1d')](members[_0x8b6296])){members[_0x8b6296]=_[_0x70d7('0x24')](members[_0x8b6296],{'data1':members[_0x8b6296]['data1']||_0x12f5a4[_0x70d7('0xa')],'data2':members[_0x8b6296][_0x70d7('0x8')]||_0x12f5a4[_0x70d7('0x29')],'data3':members[_0x8b6296][_0x70d7('0x2a')]||_0x12f5a4['destination'],'uniqueid':members[_0x8b6296][_0x70d7('0x6')]||_0x12f5a4['uniqueid']});utils['info'](util[_0x70d7('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x12f5a4[_0x70d7('0x6')],members[_0x8b6296][_0x70d7('0x28')],members[_0x8b6296]['data2'],members[_0x8b6296][_0x70d7('0x2a')]));if(members[_0x8b6296]['exitAt']){writeDB(members[_0x8b6296]);}}}}catch(_0x248896){utils['error'](util[_0x70d7('0x13')]('[%s][members][cdr]',_0x12f5a4[_0x70d7('0x6')]),_0x248896);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4175621..d32a7d2 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 _0xeb10=['membername','destaccountcode','assigned','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','transferuniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','toUpperCase','CONTINUE','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','queuecallerleaveAt','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s'];(function(_0x4c4f7b,_0x58ce91){var _0x1b299d=function(_0x2b7703){while(--_0x2b7703){_0x4c4f7b['push'](_0x4c4f7b['shift']());}};_0x1b299d(++_0x58ce91);}(_0xeb10,0x15c));var _0x0eb1=function(_0x40b208,_0x1f8817){_0x40b208=_0x40b208-0x0;var _0x1fee70=_0xeb10[_0x40b208];return _0x1fee70;};'use strict';var _=require(_0x0eb1('0x0'));var util=require(_0x0eb1('0x1'));var utils=require(_0x0eb1('0x2'));var queues={};function writeDB(_0x11e72d){utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x5'),_0x11e72d[_0x0eb1('0x6')],_0x11e72d[_0x0eb1('0x7')],_0x11e72d[_0x0eb1('0x8')],_0x11e72d[_0x0eb1('0x9')],_0x11e72d[_0x0eb1('0xa')],_0x11e72d[_0x0eb1('0xb')],_0x11e72d[_0x0eb1('0xc')]));if(_0x11e72d[_0x0eb1('0x8')]){utils[_0x0eb1('0xd')](_0x11e72d['queue'])[_0x0eb1('0xe')](function(_0x215899){if(_0x215899){_0x11e72d[_0x0eb1('0xf')]=_0x215899[_0x0eb1('0xf')];}utils[_0x0eb1('0x10')](_0x0eb1('0x11'),_0x11e72d);});}else{utils[_0x0eb1('0x10')](_0x0eb1('0x11'),_0x11e72d);}if(_0x11e72d[_0x0eb1('0x12')]){delete queues[_0x11e72d[_0x0eb1('0x12')]];}else{delete queues[_0x11e72d['uniqueid']];}}exports[_0x0eb1('0x13')]=function(_0x15664a){try{utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')](_0x0eb1('0x15'),_0x15664a[_0x0eb1('0x6')]),_0x15664a);utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x16'),_0x15664a['uniqueid'],_0x15664a[_0x0eb1('0x8')],_0x15664a[_0x0eb1('0x17')]));queues[_0x15664a['uniqueid']]=_[_0x0eb1('0x18')](_0x15664a,{'originalposition':_0x15664a['position'],'queuecallerjoinAt':utils[_0x0eb1('0x19')](),'mohtime':0x0});}catch(_0x58f03f){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x15'),_0x15664a[_0x0eb1('0x6')]),_0x58f03f);}};exports[_0x0eb1('0x1b')]=function(_0x351d19){try{if(!_[_0x0eb1('0x1c')](queues[_0x351d19[_0x0eb1('0x6')]])){utils[_0x0eb1('0x14')](util['format'](_0x0eb1('0x1d'),_0x351d19[_0x0eb1('0x6')]),_0x351d19);if(queues[_0x351d19[_0x0eb1('0x6')]]['queuecallerleaveAt']){if(!queues[_0x351d19['uniqueid']][_0x0eb1('0x1e')]&&!queues[_0x351d19[_0x0eb1('0x6')]][_0x0eb1('0x1f')]){queues[_0x351d19[_0x0eb1('0x6')]][_0x0eb1('0x20')]=!![];queues[_0x351d19[_0x0eb1('0x6')]]['queuecallercompleteAt']=utils[_0x0eb1('0x19')]();queues[_0x351d19[_0x0eb1('0x6')]][_0x0eb1('0xc')]=_0x0eb1('0x21');}utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x22'),_0x351d19['uniqueid'],queues[_0x351d19['uniqueid']][_0x0eb1('0x23')],queues[_0x351d19[_0x0eb1('0x6')]][_0x0eb1('0xc')]));writeDB(queues[_0x351d19['uniqueid']]);}else if(queues[_0x351d19[_0x0eb1('0x6')]][_0x0eb1('0x12')]){utils['info'](util[_0x0eb1('0x4')](_0x0eb1('0x24'),_0x351d19[_0x0eb1('0x6')],queues[_0x351d19[_0x0eb1('0x6')]]['name'],queues[_0x351d19['uniqueid']][_0x0eb1('0x12')]));queues[queues[_0x351d19[_0x0eb1('0x6')]]['transfereduniqueid']]=queues[_0x351d19['uniqueid']];queues[queues[_0x351d19['uniqueid']]['transfereduniqueid']][_0x0eb1('0x25')]=0x2;delete queues[_0x351d19['uniqueid']];}}}catch(_0x4e8921){utils['error'](util[_0x0eb1('0x4')](_0x0eb1('0x1d'),_0x351d19['uniqueid']),_0x4e8921);}};exports[_0x0eb1('0x26')]=function(_0x47c84e){try{utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')]('[%s][queues][varset]',_0x47c84e['uniqueid']),_0x47c84e);if(!_['isNil'](_0x47c84e[_0x0eb1('0x27')][_0x0eb1('0x28')])&&_0x47c84e['value'][_0x0eb1('0x29')]()!==_0x0eb1('0x2a')){if(!_[_0x0eb1('0x1c')](queues[_0x47c84e[_0x0eb1('0x6')]])){queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0x1e')]=![];queues[_0x47c84e[_0x0eb1('0x6')]]['queuecallerabandonAt']=null;queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0x1f')]=!![];queues[_0x47c84e[_0x0eb1('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x47c84e['uniqueid']]['queuecallerexitreason']=_0x47c84e[_0x0eb1('0x2b')]['toUpperCase']();utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x2c'),_0x47c84e[_0x0eb1('0x6')],queues[_0x47c84e[_0x0eb1('0x6')]]['name'],_0x47c84e['value'],queues[_0x47c84e['uniqueid']][_0x0eb1('0xc')]));writeDB(queues[_0x47c84e[_0x0eb1('0x6')]]);}}else if(!_['isNil'](_0x47c84e[_0x0eb1('0x27')]['queueposition'])){if(!_[_0x0eb1('0x1c')](queues[_0x47c84e['uniqueid']])&&!queues[_0x47c84e[_0x0eb1('0x6')]]['queuecallerabandon']){queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0x1e')]=![];queues[_0x47c84e['uniqueid']][_0x0eb1('0x2d')]=null;queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0x1f')]=!![];queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0x2e')]=utils[_0x0eb1('0x19')]();queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0xc')]='EXITWITHKEY';utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x2f'),_0x47c84e[_0x0eb1('0x6')],queues[_0x47c84e['uniqueid']][_0x0eb1('0x23')],_0x47c84e[_0x0eb1('0x2b')],queues[_0x47c84e[_0x0eb1('0x6')]][_0x0eb1('0xc')]));}}}catch(_0x8aabf4){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x30'),_0x47c84e[_0x0eb1('0x6')]),_0x8aabf4);}};exports[_0x0eb1('0x1e')]=function(_0x4d55d5){try{if(!_['isNil'](queues[_0x4d55d5[_0x0eb1('0x6')]])){utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')]('[%s][queues][queuecallerabandon]',_0x4d55d5[_0x0eb1('0x6')]),_0x4d55d5);queues[_0x4d55d5[_0x0eb1('0x6')]][_0x0eb1('0x1f')]=![];queues[_0x4d55d5[_0x0eb1('0x6')]][_0x0eb1('0x2e')]=null;queues[_0x4d55d5['uniqueid']][_0x0eb1('0x1e')]=!![];queues[_0x4d55d5[_0x0eb1('0x6')]][_0x0eb1('0x2d')]=utils[_0x0eb1('0x19')]();queues[_0x4d55d5['uniqueid']][_0x0eb1('0xc')]=_0x0eb1('0x31');utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x32'),_0x4d55d5['uniqueid'],queues[_0x4d55d5[_0x0eb1('0x6')]][_0x0eb1('0x23')],queues[_0x4d55d5[_0x0eb1('0x6')]][_0x0eb1('0xc')]));}}catch(_0x4d0906){utils['error'](util[_0x0eb1('0x4')]('[%s][queues][queuecallerabandon]',_0x4d55d5[_0x0eb1('0x6')]),_0x4d0906);}};exports[_0x0eb1('0x33')]=function(_0x4e8c13){try{if(!_[_0x0eb1('0x1c')](queues[_0x4e8c13[_0x0eb1('0x6')]])){utils['debug'](util[_0x0eb1('0x4')](_0x0eb1('0x34'),_0x4e8c13['uniqueid']),_0x4e8c13);utils[_0x0eb1('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4e8c13['uniqueid'],queues[_0x4e8c13[_0x0eb1('0x6')]][_0x0eb1('0x23')],_0x4e8c13[_0x0eb1('0x35')],_0x4e8c13[_0x0eb1('0x36')]));queues[_0x4e8c13['uniqueid']][_0x0eb1('0x33')]=!![];queues[_0x4e8c13['uniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x4e8c13['uniqueid']][_0x0eb1('0x37')]=utils['diffTime'](queues[_0x4e8c13[_0x0eb1('0x6')]][_0x0eb1('0x38')],queues[_0x4e8c13[_0x0eb1('0x6')]][_0x0eb1('0x39')]);queues[_0x4e8c13['uniqueid']][_0x0eb1('0x17')]=_0x4e8c13[_0x0eb1('0x17')];queues[_0x4e8c13['uniqueid']][_0x0eb1('0x3a')]=_0x4e8c13['count'];queues[_0x4e8c13[_0x0eb1('0x6')]][_0x0eb1('0x35')]=_0x4e8c13[_0x0eb1('0x35')];queues[_0x4e8c13[_0x0eb1('0x6')]][_0x0eb1('0x36')]=_0x4e8c13['connectedlinename'];}}catch(_0xc59d62){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x34'),_0x4e8c13[_0x0eb1('0x6')]),_0xc59d62);}};exports['agentconnect']=function(_0x59f8ac){try{if(!_[_0x0eb1('0x1c')](queues[_0x59f8ac[_0x0eb1('0x6')]])){utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')]('[%s][queues][agentconnect]',_0x59f8ac[_0x0eb1('0x6')]),_0x59f8ac);utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x3b'),_0x59f8ac['uniqueid'],queues[_0x59f8ac[_0x0eb1('0x6')]][_0x0eb1('0x23')],_0x59f8ac[_0x0eb1('0x3c')],_0x59f8ac[_0x0eb1('0x3d')]));queues[_0x59f8ac['uniqueid']]['queuecallerabandon']=![];queues[_0x59f8ac['uniqueid']][_0x0eb1('0x1e')]=![];queues[_0x59f8ac[_0x0eb1('0x6')]][_0x0eb1('0x2d')]=null;queues[_0x59f8ac[_0x0eb1('0x6')]]['queuecallerexit']=![];queues[_0x59f8ac['uniqueid']][_0x0eb1('0xc')]=null;queues[_0x59f8ac['uniqueid']]['queuecallerexitAt']=null;queues[_0x59f8ac[_0x0eb1('0x6')]][_0x0eb1('0x3e')]=!![];queues[_0x59f8ac['uniqueid']][_0x0eb1('0xb')]=_0x59f8ac[_0x0eb1('0x3d')];queues[_0x59f8ac[_0x0eb1('0x6')]][_0x0eb1('0x9')]=_0x59f8ac[_0x0eb1('0x3c')];}}catch(_0x291c75){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x3f'),_0x59f8ac[_0x0eb1('0x6')]),_0x291c75);}};exports['agentcomplete']=function(_0x135cf2){try{if(!_['isNil'](queues[_0x135cf2[_0x0eb1('0x6')]])){if(queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x38')]){utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')](_0x0eb1('0x40'),_0x135cf2[_0x0eb1('0x6')]),_0x135cf2);queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x1e')]=![];queues[_0x135cf2['uniqueid']]['queuecallerabandon']=![];queues[_0x135cf2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x135cf2['uniqueid']][_0x0eb1('0x1f')]=![];queues[_0x135cf2['uniqueid']][_0x0eb1('0x2e')]=null;queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x3e')]=!![];queues[_0x135cf2[_0x0eb1('0x6')]]['lastAssignedTo']=_0x135cf2['membername'];queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x20')]=!![];queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x41')]=utils['now']();if(_0x135cf2[_0x0eb1('0x42')]==_0x0eb1('0x43')){if(!queues[_0x135cf2[_0x0eb1('0x6')]][_0x0eb1('0x43')]){queues[_0x135cf2['uniqueid']][_0x0eb1('0xc')]='TRANSFER';}}else{queues[_0x135cf2['uniqueid']][_0x0eb1('0xc')]=_0x0eb1('0x44')+_0x135cf2[_0x0eb1('0x42')][_0x0eb1('0x29')]();}utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x45'),_0x135cf2[_0x0eb1('0x6')],queues[_0x135cf2[_0x0eb1('0x6')]]['name'],_0x135cf2[_0x0eb1('0x3c')],queues[_0x135cf2[_0x0eb1('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x135cf2[_0x0eb1('0x6')]]);}}}catch(_0x48048a){utils['error'](util['format'](_0x0eb1('0x40'),_0x135cf2[_0x0eb1('0x6')]),_0x48048a);}};exports[_0x0eb1('0x46')]=function(_0x41756b){try{if(!_[_0x0eb1('0x1c')](queues[_0x41756b[_0x0eb1('0x47')]])){utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')](_0x0eb1('0x48'),_0x41756b[_0x0eb1('0x6')]),_0x41756b);queues[_0x41756b[_0x0eb1('0x47')]][_0x0eb1('0x43')]=!![];queues[_0x41756b[_0x0eb1('0x47')]][_0x0eb1('0x49')]='BLIND';queues[_0x41756b[_0x0eb1('0x47')]][_0x0eb1('0x4a')]=_0x41756b[_0x0eb1('0x4b')];queues[_0x41756b['transfereeuniqueid']]['transferuniqueid']=_0x41756b[_0x0eb1('0x47')];queues[_0x41756b[_0x0eb1('0x47')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x41756b[_0x0eb1('0x6')],queues[_0x41756b[_0x0eb1('0x47')]]['name'],_0x41756b[_0x0eb1('0x47')],_0x41756b[_0x0eb1('0x4b')]));}}catch(_0x14db22){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x48'),_0x41756b['uniqueid']),_0x14db22);}};exports['attendedtransfer']=function(_0x21d52e){try{utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')]('[%s][queues][attendedtransfer]',_0x21d52e[_0x0eb1('0x4c')]),_0x21d52e);if(_0x21d52e['origtransfereruniqueid']==_0x21d52e[_0x0eb1('0x4d')]){if(!_['isNil'](queues[_0x21d52e[_0x0eb1('0x4e')]])){utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x4f'),_0x21d52e[_0x0eb1('0x4c')],queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0x23')],_0x21d52e[_0x0eb1('0x50')]));queues[_0x21d52e[_0x0eb1('0x4e')]]['transfer']=!![];queues[_0x21d52e[_0x0eb1('0x4e')]]['transfertype']=_0x0eb1('0x51');queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0x4a')]=_0x21d52e[_0x0eb1('0x50')];queues[_0x21d52e[_0x0eb1('0x4e')]]['transferuniqueid']=_0x21d52e['origtransfereruniqueid'];queues[_0x21d52e[_0x0eb1('0x4e')]]['queuecallerexitreason']=_0x0eb1('0x52');}if(!_['isNil'](queues[_0x21d52e['origtransfererlinkedid']])){if(_0x21d52e[_0x0eb1('0x53')]&&queues[_0x21d52e[_0x0eb1('0x53')]]){queues[_0x21d52e['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x21d52e[_0x0eb1('0x47')]]=_[_0x0eb1('0x54')](queues[_0x21d52e[_0x0eb1('0x53')]]);queues[_0x21d52e[_0x0eb1('0x47')]][_0x0eb1('0x12')]=_0x21d52e[_0x0eb1('0x55')];queues[_0x21d52e[_0x0eb1('0x47')]][_0x0eb1('0x25')]=0x2;queues[_0x21d52e['transfereeuniqueid']][_0x0eb1('0xa')]=queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0xa')];queues[_0x21d52e[_0x0eb1('0x47')]][_0x0eb1('0x56')]=queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0x56')];queues[_0x21d52e['transfereeuniqueid']][_0x0eb1('0x39')]=utils[_0x0eb1('0x19')]();queues[_0x21d52e['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x0eb1('0x19')]();queues[_0x21d52e[_0x0eb1('0x47')]][_0x0eb1('0x37')]=0x0;queues[_0x21d52e[_0x0eb1('0x47')]][_0x0eb1('0x57')]=0x0;utils[_0x0eb1('0x3')](util['format'](_0x0eb1('0x58'),_0x21d52e['origtransfereruniqueid'],queues[_0x21d52e['transfereeuniqueid']]['name'],queues[_0x21d52e[_0x0eb1('0x47')]]['calleridnum'],queues[_0x21d52e['transfereeuniqueid']]['calleridname']));}else{utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x59'),_0x21d52e[_0x0eb1('0x4c')],queues[_0x21d52e['origtransfererlinkedid']][_0x0eb1('0x23')],_0x21d52e[_0x0eb1('0x4e')]));queues[_0x21d52e[_0x0eb1('0x4d')]][_0x0eb1('0x12')]=_0x21d52e[_0x0eb1('0x4e')];}}}else if(_0x21d52e[_0x0eb1('0x5a')]==_0x21d52e[_0x0eb1('0x4e')]){if(!_[_0x0eb1('0x1c')](queues[_0x21d52e[_0x0eb1('0x4d')]])){utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x21d52e['origtransfereruniqueid'],queues[_0x21d52e[_0x0eb1('0x4d')]]['name'],_0x21d52e[_0x0eb1('0x5a')],_0x21d52e['secondtransfererexten']));queues[_0x21d52e[_0x0eb1('0x4d')]][_0x0eb1('0x43')]=!![];queues[_0x21d52e[_0x0eb1('0x4d')]]['transfertype']=_0x0eb1('0x51');queues[_0x21d52e[_0x0eb1('0x4d')]][_0x0eb1('0x4a')]=_0x21d52e['secondtransfererexten'];queues[_0x21d52e[_0x0eb1('0x4d')]][_0x0eb1('0x5b')]=_0x21d52e[_0x0eb1('0x5a')];queues[_0x21d52e[_0x0eb1('0x4d')]]['queuecallerexitreason']=_0x0eb1('0x52');}if(!_['isNil'](queues[_0x21d52e[_0x0eb1('0x4e')]])){if(_0x21d52e[_0x0eb1('0x5c')]&&queues[_0x21d52e[_0x0eb1('0x5c')]]){queues[_0x21d52e[_0x0eb1('0x5c')]][_0x0eb1('0x25')]=0x1;queues[_0x21d52e[_0x0eb1('0x55')]]=_['clone'](queues[_0x21d52e[_0x0eb1('0x5c')]]);queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x12')]=_0x21d52e[_0x0eb1('0x55')];queues[_0x21d52e[_0x0eb1('0x55')]]['queuecallerenterreason']=0x2;queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0xa')]=queues[_0x21d52e['origtransfererlinkedid']][_0x0eb1('0xa')];queues[_0x21d52e[_0x0eb1('0x55')]]['calleridname']=queues[_0x21d52e[_0x0eb1('0x4d')]][_0x0eb1('0x56')];queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x39')]=utils[_0x0eb1('0x19')]();queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x38')]=utils[_0x0eb1('0x19')]();queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x37')]=0x0;queues[_0x21d52e['transfertargetuniqueid']][_0x0eb1('0x57')]=0x0;utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x5d'),_0x21d52e[_0x0eb1('0x4c')],queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x23')],queues[_0x21d52e[_0x0eb1('0x55')]]['transfereduniqueid'],queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0xa')],queues[_0x21d52e[_0x0eb1('0x55')]][_0x0eb1('0x56')]));}else{utils['info'](util[_0x0eb1('0x4')](_0x0eb1('0x59'),_0x21d52e[_0x0eb1('0x4c')],queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0x23')],_0x21d52e[_0x0eb1('0x4d')]));queues[_0x21d52e[_0x0eb1('0x4e')]][_0x0eb1('0x12')]=_0x21d52e['origtransfererlinkedid'];}}}}catch(_0x2fb2f4){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x5e'),_0x21d52e['origtransfereruniqueid']),_0x2fb2f4);}};exports[_0x0eb1('0x5f')]=function(_0xc16563){try{if(!_[_0x0eb1('0x1c')](queues[_0xc16563[_0x0eb1('0x6')]])){utils[_0x0eb1('0x14')](util['format'](_0x0eb1('0x60'),_0xc16563[_0x0eb1('0x6')]),_0xc16563);queues[_0xc16563[_0x0eb1('0x6')]][_0x0eb1('0x61')]=utils[_0x0eb1('0x19')]();utils[_0x0eb1('0x3')](util[_0x0eb1('0x4')](_0x0eb1('0x62'),_0xc16563[_0x0eb1('0x6')],queues[_0xc16563[_0x0eb1('0x6')]][_0x0eb1('0x23')],queues[_0xc16563['uniqueid']][_0x0eb1('0x61')]));}}catch(_0x4c76b9){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')](_0x0eb1('0x60'),_0xc16563['uniqueid']),_0x4c76b9);}};exports[_0x0eb1('0x63')]=function(_0x352cd4){try{if(!_[_0x0eb1('0x1c')](queues[_0x352cd4['uniqueid']])){if(!_['isNil'](queues[_0x352cd4[_0x0eb1('0x6')]][_0x0eb1('0x61')])){utils[_0x0eb1('0x14')](util[_0x0eb1('0x4')](_0x0eb1('0x64'),_0x352cd4[_0x0eb1('0x6')]),_0x352cd4);queues[_0x352cd4[_0x0eb1('0x6')]][_0x0eb1('0x57')]+=utils['diffTime'](utils['now'](),queues[_0x352cd4['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0x0eb1('0x4')](_0x0eb1('0x65'),_0x352cd4['uniqueid'],queues[_0x352cd4[_0x0eb1('0x6')]][_0x0eb1('0x23')],queues[_0x352cd4[_0x0eb1('0x6')]][_0x0eb1('0x57')]));delete queues[_0x352cd4['uniqueid']][_0x0eb1('0x61')];}}}catch(_0x144cc4){utils[_0x0eb1('0x1a')](util[_0x0eb1('0x4')]('[%s][queues][musiconholdstop]',_0x352cd4[_0x0eb1('0x6')]),_0x144cc4);}}; \ No newline at end of file +var _0xf01f=['[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','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]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','count','membername','destaccountcode','assigned','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid'];(function(_0x3c2961,_0x4eb450){var _0x599d48=function(_0x4ff6fd){while(--_0x4ff6fd){_0x3c2961['push'](_0x3c2961['shift']());}};_0x599d48(++_0x4eb450);}(_0xf01f,0x1a3));var _0xff01=function(_0x145cf0,_0x4f3841){_0x145cf0=_0x145cf0-0x0;var _0x528ad5=_0xf01f[_0x145cf0];return _0x528ad5;};'use strict';var _=require('lodash');var util=require(_0xff01('0x0'));var utils=require(_0xff01('0x1'));var queues={};function writeDB(_0x600357){utils[_0xff01('0x2')](util[_0xff01('0x3')](_0xff01('0x4'),_0x600357[_0xff01('0x5')],_0x600357[_0xff01('0x6')],_0x600357[_0xff01('0x7')],_0x600357[_0xff01('0x8')],_0x600357[_0xff01('0x9')],_0x600357[_0xff01('0xa')],_0x600357[_0xff01('0xb')]));if(_0x600357[_0xff01('0x7')]){utils[_0xff01('0xc')](_0x600357['queue'])['then'](function(_0x485774){if(_0x485774){_0x600357['type']=_0x485774[_0xff01('0xd')];}utils[_0xff01('0xe')](_0xff01('0xf'),_0x600357);});}else{utils[_0xff01('0xe')](_0xff01('0xf'),_0x600357);}if(_0x600357[_0xff01('0x10')]){delete queues[_0x600357['transfereduniqueid']];}else{delete queues[_0x600357[_0xff01('0x5')]];}}exports[_0xff01('0x11')]=function(_0x567567){try{utils[_0xff01('0x12')](util['format'](_0xff01('0x13'),_0x567567['uniqueid']),_0x567567);utils['info'](util['format'](_0xff01('0x14'),_0x567567[_0xff01('0x5')],_0x567567['queue'],_0x567567['position']));queues[_0x567567[_0xff01('0x5')]]=_['assign'](_0x567567,{'originalposition':_0x567567[_0xff01('0x15')],'queuecallerjoinAt':utils[_0xff01('0x16')](),'mohtime':0x0});}catch(_0x33f21f){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x13'),_0x567567[_0xff01('0x5')]),_0x33f21f);}};exports[_0xff01('0x18')]=function(_0x13c4e9){try{if(!_['isNil'](queues[_0x13c4e9[_0xff01('0x5')]])){utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x19'),_0x13c4e9[_0xff01('0x5')]),_0x13c4e9);if(queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x1a')]){if(!queues[_0x13c4e9[_0xff01('0x5')]]['queuecallerabandon']&&!queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x1b')]){queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x1c')]=!![];queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x1d')]=utils['now']();queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0xb')]=_0xff01('0x1e');}utils['info'](util[_0xff01('0x3')](_0xff01('0x1f'),_0x13c4e9[_0xff01('0x5')],queues[_0x13c4e9[_0xff01('0x5')]]['name'],queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0xb')]));writeDB(queues[_0x13c4e9[_0xff01('0x5')]]);}else if(queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x10')]){utils[_0xff01('0x2')](util[_0xff01('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x13c4e9[_0xff01('0x5')],queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x20')],queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x10')]));queues[queues[_0x13c4e9[_0xff01('0x5')]]['transfereduniqueid']]=queues[_0x13c4e9[_0xff01('0x5')]];queues[queues[_0x13c4e9[_0xff01('0x5')]][_0xff01('0x10')]][_0xff01('0x21')]=0x2;delete queues[_0x13c4e9['uniqueid']];}}}catch(_0x1e2219){utils[_0xff01('0x17')](util['format'](_0xff01('0x19'),_0x13c4e9[_0xff01('0x5')]),_0x1e2219);}};exports[_0xff01('0x22')]=function(_0x149001){try{utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x23'),_0x149001['uniqueid']),_0x149001);if(!_[_0xff01('0x24')](_0x149001[_0xff01('0x25')][_0xff01('0x26')])&&_0x149001[_0xff01('0x27')][_0xff01('0x28')]()!==_0xff01('0x29')){if(!_[_0xff01('0x24')](queues[_0x149001[_0xff01('0x5')]])){queues[_0x149001[_0xff01('0x5')]][_0xff01('0x2a')]=![];queues[_0x149001[_0xff01('0x5')]][_0xff01('0x2b')]=null;queues[_0x149001[_0xff01('0x5')]][_0xff01('0x1b')]=!![];queues[_0x149001['uniqueid']][_0xff01('0x2c')]=utils[_0xff01('0x16')]();queues[_0x149001[_0xff01('0x5')]]['queuecallerexitreason']=_0x149001['value'][_0xff01('0x28')]();utils[_0xff01('0x2')](util[_0xff01('0x3')](_0xff01('0x2d'),_0x149001[_0xff01('0x5')],queues[_0x149001[_0xff01('0x5')]][_0xff01('0x20')],_0x149001[_0xff01('0x27')],queues[_0x149001[_0xff01('0x5')]][_0xff01('0xb')]));writeDB(queues[_0x149001[_0xff01('0x5')]]);}}else if(!_[_0xff01('0x24')](_0x149001[_0xff01('0x25')][_0xff01('0x2e')])){if(!_[_0xff01('0x24')](queues[_0x149001[_0xff01('0x5')]])&&!queues[_0x149001['uniqueid']][_0xff01('0x2a')]){queues[_0x149001[_0xff01('0x5')]][_0xff01('0x2a')]=![];queues[_0x149001[_0xff01('0x5')]]['queuecallerabandonAt']=null;queues[_0x149001[_0xff01('0x5')]][_0xff01('0x1b')]=!![];queues[_0x149001[_0xff01('0x5')]][_0xff01('0x2c')]=utils['now']();queues[_0x149001[_0xff01('0x5')]][_0xff01('0xb')]=_0xff01('0x2f');utils[_0xff01('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x149001[_0xff01('0x5')],queues[_0x149001[_0xff01('0x5')]][_0xff01('0x20')],_0x149001['value'],queues[_0x149001['uniqueid']][_0xff01('0xb')]));}}}catch(_0x1fb8b3){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x23'),_0x149001[_0xff01('0x5')]),_0x1fb8b3);}};exports[_0xff01('0x2a')]=function(_0x27dfc3){try{if(!_[_0xff01('0x24')](queues[_0x27dfc3[_0xff01('0x5')]])){utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x30'),_0x27dfc3[_0xff01('0x5')]),_0x27dfc3);queues[_0x27dfc3[_0xff01('0x5')]]['queuecallerexit']=![];queues[_0x27dfc3[_0xff01('0x5')]][_0xff01('0x2c')]=null;queues[_0x27dfc3[_0xff01('0x5')]]['queuecallerabandon']=!![];queues[_0x27dfc3['uniqueid']][_0xff01('0x2b')]=utils[_0xff01('0x16')]();queues[_0x27dfc3[_0xff01('0x5')]][_0xff01('0xb')]=_0xff01('0x31');utils[_0xff01('0x2')](util[_0xff01('0x3')](_0xff01('0x32'),_0x27dfc3[_0xff01('0x5')],queues[_0x27dfc3['uniqueid']]['name'],queues[_0x27dfc3[_0xff01('0x5')]]['queuecallerexitreason']));}}catch(_0x383934){utils[_0xff01('0x17')](util[_0xff01('0x3')]('[%s][queues][queuecallerabandon]',_0x27dfc3[_0xff01('0x5')]),_0x383934);}};exports[_0xff01('0x33')]=function(_0x36fca3){try{if(!_[_0xff01('0x24')](queues[_0x36fca3[_0xff01('0x5')]])){utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x34'),_0x36fca3[_0xff01('0x5')]),_0x36fca3);utils['info'](util[_0xff01('0x3')](_0xff01('0x35'),_0x36fca3[_0xff01('0x5')],queues[_0x36fca3[_0xff01('0x5')]]['name'],_0x36fca3[_0xff01('0x36')],_0x36fca3[_0xff01('0x37')]));queues[_0x36fca3['uniqueid']][_0xff01('0x33')]=!![];queues[_0x36fca3[_0xff01('0x5')]][_0xff01('0x1a')]=utils[_0xff01('0x16')]();queues[_0x36fca3['uniqueid']]['holdtime']=utils[_0xff01('0x38')](queues[_0x36fca3[_0xff01('0x5')]][_0xff01('0x1a')],queues[_0x36fca3['uniqueid']]['queuecallerjoinAt']);queues[_0x36fca3['uniqueid']][_0xff01('0x15')]=_0x36fca3[_0xff01('0x15')];queues[_0x36fca3['uniqueid']][_0xff01('0x39')]=_0x36fca3[_0xff01('0x39')];queues[_0x36fca3[_0xff01('0x5')]][_0xff01('0x36')]=_0x36fca3[_0xff01('0x36')];queues[_0x36fca3[_0xff01('0x5')]][_0xff01('0x37')]=_0x36fca3['connectedlinename'];}}catch(_0x4e2535){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x34'),_0x36fca3[_0xff01('0x5')]),_0x4e2535);}};exports['agentconnect']=function(_0x2efed7){try{if(!_[_0xff01('0x24')](queues[_0x2efed7[_0xff01('0x5')]])){utils[_0xff01('0x12')](util[_0xff01('0x3')]('[%s][queues][agentconnect]',_0x2efed7[_0xff01('0x5')]),_0x2efed7);utils[_0xff01('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2efed7['uniqueid'],queues[_0x2efed7[_0xff01('0x5')]][_0xff01('0x20')],_0x2efed7[_0xff01('0x3a')],_0x2efed7[_0xff01('0x3b')]));queues[_0x2efed7['uniqueid']]['queuecallerabandon']=![];queues[_0x2efed7[_0xff01('0x5')]]['queuecallerabandon']=![];queues[_0x2efed7['uniqueid']]['queuecallerabandonAt']=null;queues[_0x2efed7['uniqueid']][_0xff01('0x1b')]=![];queues[_0x2efed7[_0xff01('0x5')]]['queuecallerexitreason']=null;queues[_0x2efed7[_0xff01('0x5')]][_0xff01('0x2c')]=null;queues[_0x2efed7[_0xff01('0x5')]][_0xff01('0x3c')]=!![];queues[_0x2efed7[_0xff01('0x5')]]['accountcode']=_0x2efed7[_0xff01('0x3b')];queues[_0x2efed7['uniqueid']][_0xff01('0x8')]=_0x2efed7['membername'];}}catch(_0x5022e6){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x3d'),_0x2efed7[_0xff01('0x5')]),_0x5022e6);}};exports['agentcomplete']=function(_0x2d9cbf){try{if(!_[_0xff01('0x24')](queues[_0x2d9cbf[_0xff01('0x5')]])){if(queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x1a')]){utils[_0xff01('0x12')](util['format'](_0xff01('0x3e'),_0x2d9cbf[_0xff01('0x5')]),_0x2d9cbf);queues[_0x2d9cbf[_0xff01('0x5')]]['queuecallerabandon']=![];queues[_0x2d9cbf[_0xff01('0x5')]]['queuecallerabandon']=![];queues[_0x2d9cbf[_0xff01('0x5')]]['queuecallerabandonAt']=null;queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x1b')]=![];queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x2c')]=null;queues[_0x2d9cbf['uniqueid']][_0xff01('0x3c')]=!![];queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x8')]=_0x2d9cbf[_0xff01('0x3a')];queues[_0x2d9cbf['uniqueid']]['queuecallercomplete']=!![];queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x1d')]=utils[_0xff01('0x16')]();if(_0x2d9cbf['reason']==_0xff01('0x3f')){if(!queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x3f')]){queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0xb')]=_0xff01('0x40');}}else{queues[_0x2d9cbf['uniqueid']][_0xff01('0xb')]=_0xff01('0x41')+_0x2d9cbf['reason'][_0xff01('0x28')]();}utils[_0xff01('0x2')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2d9cbf[_0xff01('0x5')],queues[_0x2d9cbf[_0xff01('0x5')]][_0xff01('0x20')],_0x2d9cbf[_0xff01('0x3a')],queues[_0x2d9cbf['uniqueid']][_0xff01('0xb')]));writeDB(queues[_0x2d9cbf['uniqueid']]);}}}catch(_0x4e6a89){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x3e'),_0x2d9cbf[_0xff01('0x5')]),_0x4e6a89);}};exports[_0xff01('0x42')]=function(_0x5e59b3){try{if(!_['isNil'](queues[_0x5e59b3['transfereeuniqueid']])){utils[_0xff01('0x12')](util['format']('[%s][queues][blindtransfer]',_0x5e59b3['uniqueid']),_0x5e59b3);queues[_0x5e59b3['transfereeuniqueid']][_0xff01('0x3f')]=!![];queues[_0x5e59b3[_0xff01('0x43')]][_0xff01('0x44')]=_0xff01('0x45');queues[_0x5e59b3['transfereeuniqueid']]['transferexten']=_0x5e59b3[_0xff01('0x46')];queues[_0x5e59b3[_0xff01('0x43')]][_0xff01('0x47')]=_0x5e59b3[_0xff01('0x43')];queues[_0x5e59b3[_0xff01('0x43')]][_0xff01('0xb')]=_0xff01('0x48');utils['info'](util[_0xff01('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5e59b3[_0xff01('0x5')],queues[_0x5e59b3['transfereeuniqueid']][_0xff01('0x20')],_0x5e59b3['transfereeuniqueid'],_0x5e59b3[_0xff01('0x46')]));}}catch(_0xa946bb){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x49'),_0x5e59b3[_0xff01('0x5')]),_0xa946bb);}};exports[_0xff01('0x4a')]=function(_0x40e6e3){try{utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x4b'),_0x40e6e3[_0xff01('0x4c')]),_0x40e6e3);if(_0x40e6e3['origtransfereruniqueid']==_0x40e6e3['origtransfererlinkedid']){if(!_[_0xff01('0x24')](queues[_0x40e6e3[_0xff01('0x4d')]])){utils[_0xff01('0x2')](util[_0xff01('0x3')](_0xff01('0x4e'),_0x40e6e3['origtransfereruniqueid'],queues[_0x40e6e3['secondtransfererlinkedid']][_0xff01('0x20')],_0x40e6e3[_0xff01('0x4f')]));queues[_0x40e6e3[_0xff01('0x4d')]][_0xff01('0x3f')]=!![];queues[_0x40e6e3['secondtransfererlinkedid']][_0xff01('0x44')]='ATTENDED';queues[_0x40e6e3[_0xff01('0x4d')]][_0xff01('0x50')]=_0x40e6e3[_0xff01('0x4f')];queues[_0x40e6e3[_0xff01('0x4d')]][_0xff01('0x47')]=_0x40e6e3[_0xff01('0x4c')];queues[_0x40e6e3[_0xff01('0x4d')]]['queuecallerexitreason']=_0xff01('0x51');}if(!_[_0xff01('0x24')](queues[_0x40e6e3[_0xff01('0x52')]])){if(_0x40e6e3[_0xff01('0x53')]&&queues[_0x40e6e3[_0xff01('0x53')]]){queues[_0x40e6e3['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x40e6e3['transfereeuniqueid']]=_[_0xff01('0x54')](queues[_0x40e6e3[_0xff01('0x53')]]);queues[_0x40e6e3['transfereeuniqueid']][_0xff01('0x10')]=_0x40e6e3[_0xff01('0x55')];queues[_0x40e6e3[_0xff01('0x43')]]['queuecallerenterreason']=0x2;queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x9')]=queues[_0x40e6e3[_0xff01('0x4d')]][_0xff01('0x9')];queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x56')]=queues[_0x40e6e3[_0xff01('0x4d')]][_0xff01('0x56')];queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x57')]=utils['now']();queues[_0x40e6e3[_0xff01('0x43')]]['queuecallerleaveAt']=utils[_0xff01('0x16')]();queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x58')]=0x0;queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x59')]=0x0;utils[_0xff01('0x2')](util[_0xff01('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x40e6e3[_0xff01('0x4c')],queues[_0x40e6e3[_0xff01('0x43')]]['name'],queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x9')],queues[_0x40e6e3[_0xff01('0x43')]][_0xff01('0x56')]));}else{utils['info'](util[_0xff01('0x3')](_0xff01('0x5a'),_0x40e6e3[_0xff01('0x4c')],queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0x20')],_0x40e6e3['secondtransfererlinkedid']));queues[_0x40e6e3['origtransfererlinkedid']][_0xff01('0x10')]=_0x40e6e3[_0xff01('0x4d')];}}}else if(_0x40e6e3[_0xff01('0x5b')]==_0x40e6e3[_0xff01('0x4d')]){if(!_['isNil'](queues[_0x40e6e3[_0xff01('0x52')]])){utils[_0xff01('0x2')](util['format'](_0xff01('0x5c'),_0x40e6e3[_0xff01('0x4c')],queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0x20')],_0x40e6e3[_0xff01('0x5b')],_0x40e6e3[_0xff01('0x5d')]));queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0x3f')]=!![];queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0x44')]=_0xff01('0x5e');queues[_0x40e6e3['origtransfererlinkedid']]['transferexten']=_0x40e6e3[_0xff01('0x5d')];queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0x47')]=_0x40e6e3[_0xff01('0x5b')];queues[_0x40e6e3[_0xff01('0x52')]][_0xff01('0xb')]=_0xff01('0x51');}if(!_[_0xff01('0x24')](queues[_0x40e6e3[_0xff01('0x4d')]])){if(_0x40e6e3['transfertargetlinkedid']&&queues[_0x40e6e3['transfertargetlinkedid']]){queues[_0x40e6e3[_0xff01('0x5f')]][_0xff01('0x21')]=0x1;queues[_0x40e6e3['transfertargetuniqueid']]=_['clone'](queues[_0x40e6e3[_0xff01('0x5f')]]);queues[_0x40e6e3['transfertargetuniqueid']][_0xff01('0x10')]=_0x40e6e3[_0xff01('0x55')];queues[_0x40e6e3['transfertargetuniqueid']][_0xff01('0x21')]=0x2;queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x9')]=queues[_0x40e6e3['origtransfererlinkedid']][_0xff01('0x9')];queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x56')]=queues[_0x40e6e3['origtransfererlinkedid']][_0xff01('0x56')];queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x57')]=utils[_0xff01('0x16')]();queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x1a')]=utils[_0xff01('0x16')]();queues[_0x40e6e3['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x40e6e3['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util[_0xff01('0x3')](_0xff01('0x60'),_0x40e6e3['origtransfereruniqueid'],queues[_0x40e6e3['transfertargetuniqueid']][_0xff01('0x20')],queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x10')],queues[_0x40e6e3[_0xff01('0x55')]][_0xff01('0x9')],queues[_0x40e6e3['transfertargetuniqueid']][_0xff01('0x56')]));}else{utils['info'](util[_0xff01('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x40e6e3[_0xff01('0x4c')],queues[_0x40e6e3['secondtransfererlinkedid']][_0xff01('0x20')],_0x40e6e3[_0xff01('0x52')]));queues[_0x40e6e3['secondtransfererlinkedid']]['transfereduniqueid']=_0x40e6e3[_0xff01('0x52')];}}}}catch(_0x4c22c6){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x4b'),_0x40e6e3['origtransfereruniqueid']),_0x4c22c6);}};exports['musiconholdstart']=function(_0x2c1254){try{if(!_[_0xff01('0x24')](queues[_0x2c1254[_0xff01('0x5')]])){utils[_0xff01('0x12')](util[_0xff01('0x3')]('[%s][queues][musiconholdstart]',_0x2c1254['uniqueid']),_0x2c1254);queues[_0x2c1254[_0xff01('0x5')]][_0xff01('0x61')]=utils[_0xff01('0x16')]();utils[_0xff01('0x2')](util[_0xff01('0x3')](_0xff01('0x62'),_0x2c1254['uniqueid'],queues[_0x2c1254[_0xff01('0x5')]][_0xff01('0x20')],queues[_0x2c1254['uniqueid']][_0xff01('0x61')]));}}catch(_0x19f186){utils[_0xff01('0x17')](util['format'](_0xff01('0x63'),_0x2c1254[_0xff01('0x5')]),_0x19f186);}};exports[_0xff01('0x64')]=function(_0x4c1363){try{if(!_[_0xff01('0x24')](queues[_0x4c1363[_0xff01('0x5')]])){if(!_['isNil'](queues[_0x4c1363[_0xff01('0x5')]]['musiconholdstartAt'])){utils[_0xff01('0x12')](util[_0xff01('0x3')](_0xff01('0x65'),_0x4c1363['uniqueid']),_0x4c1363);queues[_0x4c1363['uniqueid']]['mohtime']+=utils[_0xff01('0x38')](utils[_0xff01('0x16')](),queues[_0x4c1363['uniqueid']][_0xff01('0x61')]);utils['info'](util[_0xff01('0x3')](_0xff01('0x66'),_0x4c1363[_0xff01('0x5')],queues[_0x4c1363[_0xff01('0x5')]][_0xff01('0x20')],queues[_0x4c1363[_0xff01('0x5')]][_0xff01('0x59')]));delete queues[_0x4c1363[_0xff01('0x5')]][_0xff01('0x61')];}}}catch(_0x3d1d80){utils[_0xff01('0x17')](util[_0xff01('0x3')](_0xff01('0x65'),_0x4c1363[_0xff01('0x5')]),_0x3d1d80);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a30b24f..3eb49ea 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 _0xb04d=['[%s][recordings][newstate]','isNil','channelstate','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','debug'];(function(_0x32a513,_0x53fa9d){var _0x5d6bb6=function(_0x29eff3){while(--_0x29eff3){_0x32a513['push'](_0x32a513['shift']());}};_0x5d6bb6(++_0x53fa9d);}(_0xb04d,0xfa));var _0xdb04=function(_0x254411,_0x5aada6){_0x254411=_0x254411-0x0;var _0x16949e=_0xb04d[_0x254411];return _0x16949e;};'use strict';var _=require(_0xdb04('0x0'));var util=require(_0xdb04('0x1'));var utils=require(_0xdb04('0x2'));var transfers=require(_0xdb04('0x3'));var recordings={};function writeDB(_0xbca823){var _0x2e983c;utils['info'](util[_0xdb04('0x4')](_0xdb04('0x5'),_0xbca823['uniqueid']));if(transfers[_0xdb04('0x6')][_0xbca823[_0xdb04('0x7')]]){_0x2e983c=_0xbca823[_0xdb04('0x7')];_0xbca823[_0xdb04('0x7')]=transfers['blinds'][_0xbca823['uniqueid']][_0xdb04('0x8')];}if(_0xbca823[_0xdb04('0x9')]){utils[_0xdb04('0xa')](_0xbca823[_0xdb04('0x9')])[_0xdb04('0xb')](function(_0x2b9abc){if(_0x2b9abc){_0xbca823['membername']=_0x2b9abc[_0xdb04('0xc')];_0xbca823[_0xdb04('0xd')]=_0x2b9abc['id'];}utils['request']('CreateVoiceRecording',_0xbca823);});}else{utils[_0xdb04('0xe')](_0xdb04('0xf'),_0xbca823);}if(_0x2e983c)delete transfers[_0xdb04('0x6')][_0x2e983c];}exports['newchannel']=function(_0x1b171a){try{utils['debug'](util[_0xdb04('0x4')]('[%s][recordings][newchannel]',_0x1b171a['uniqueid']),_0x1b171a);if(_0x1b171a[_0xdb04('0x7')]==_0x1b171a[_0xdb04('0x10')]){utils[_0xdb04('0x11')](util[_0xdb04('0x4')](_0xdb04('0x12'),_0x1b171a[_0xdb04('0x7')],_0x1b171a[_0xdb04('0x13')],_0x1b171a[_0xdb04('0x14')]));recordings[_0x1b171a[_0xdb04('0x7')]]={'uniqueid':_0x1b171a[_0xdb04('0x7')],'accountcode':_0x1b171a['accountcode'],'exten':_0x1b171a[_0xdb04('0x14')],'context':_0x1b171a[_0xdb04('0x13')],'channel':_0x1b171a[_0xdb04('0x15')],'monitors':[]};}}catch(_0x13c80f){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x17'),_0x1b171a[_0xdb04('0x7')]),_0x13c80f);}};exports[_0xdb04('0x18')]=function(_0x2bc0cb){try{utils[_0xdb04('0x19')](util['format'](_0xdb04('0x1a'),_0x2bc0cb[_0xdb04('0x7')]),_0x2bc0cb);if(!_[_0xdb04('0x1b')](recordings[_0x2bc0cb[_0xdb04('0x7')]])&&_0x2bc0cb[_0xdb04('0x1c')]==0x6){utils[_0xdb04('0x11')](util[_0xdb04('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2bc0cb['uniqueid'],_0x2bc0cb['context'],_0x2bc0cb['channel']));}else if(!_['isNil'](recordings[_0x2bc0cb[_0xdb04('0x10')]])&&_0x2bc0cb[_0xdb04('0x1c')]==0x6&&_0x2bc0cb[_0xdb04('0x13')]!='transfer'){utils[_0xdb04('0x11')](util[_0xdb04('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2bc0cb[_0xdb04('0x7')],_0x2bc0cb['linkedid'],_0x2bc0cb[_0xdb04('0x13')],_0x2bc0cb[_0xdb04('0x15')]));recordings[_0x2bc0cb[_0xdb04('0x10')]][_0xdb04('0x9')]=_0x2bc0cb[_0xdb04('0x9')];}}catch(_0x55c794){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x1a'),_0x2bc0cb[_0xdb04('0x7')]),_0x55c794);}};exports[_0xdb04('0x1d')]=function(_0xa3be07){try{if(!_[_0xdb04('0x1b')](_0xa3be07[_0xdb04('0x1e')])&&!_[_0xdb04('0x1b')](_0xa3be07[_0xdb04('0x1e')][_0xdb04('0x1f')])){utils['debug'](util[_0xdb04('0x4')]('[%s][recordings][varset]',_0xa3be07[_0xdb04('0x7')]),_0xa3be07);utils[_0xdb04('0x11')](util[_0xdb04('0x4')](_0xdb04('0x20'),_0xa3be07['uniqueid'],_0xa3be07[_0xdb04('0x1e')],_0xa3be07[_0xdb04('0x21')]));if(_[_0xdb04('0x22')](_0xa3be07[_0xdb04('0x21')],'.wav49')){_0xa3be07[_0xdb04('0x21')]=_0xa3be07[_0xdb04('0x21')]['replace']('.wav49','.WAV');}if(recordings[_0xa3be07[_0xdb04('0x10')]]){var _0x127757=_[_0xdb04('0x23')](recordings[_0xa3be07['linkedid']]['monitors'],{'value':_0xa3be07[_0xdb04('0x21')]});if(_[_0xdb04('0x1b')](_0x127757)){recordings[_0xa3be07[_0xdb04('0x10')]][_0xdb04('0x24')][_0xdb04('0x25')]({'value':_0xa3be07['value']});}}}}catch(_0x4e4025){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x26'),_0xa3be07[_0xdb04('0x7')]),_0x4e4025);}};exports[_0xdb04('0x27')]=function(_0x4c5104){try{if(!_[_0xdb04('0x1b')](recordings[_0x4c5104[_0xdb04('0x7')]])){utils[_0xdb04('0x19')](util[_0xdb04('0x4')](_0xdb04('0x28'),_0x4c5104['uniqueid']),_0x4c5104);utils[_0xdb04('0x11')](util[_0xdb04('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4c5104[_0xdb04('0x7')],_0x4c5104[_0xdb04('0x29')],_0x4c5104[_0xdb04('0x2a')],_0x4c5104[_0xdb04('0x2b')]));recordings[_0x4c5104[_0xdb04('0x7')]][_0xdb04('0x29')]=_0x4c5104[_0xdb04('0x29')];recordings[_0x4c5104['uniqueid']][_0xdb04('0x2a')]=_0x4c5104['calleridname'];recordings[_0x4c5104[_0xdb04('0x7')]][_0xdb04('0x2c')]=_0x4c5104['connectedlinenum'];recordings[_0x4c5104[_0xdb04('0x7')]][_0xdb04('0x2d')]=_0x4c5104[_0xdb04('0x2d')];if(recordings[_0x4c5104[_0xdb04('0x7')]]['type']=='outbound'&&recordings[_0x4c5104[_0xdb04('0x7')]][_0xdb04('0x9')]){recordings[_0x4c5104['uniqueid']]['connectedlinenum']=recordings[_0x4c5104[_0xdb04('0x7')]]['accountcode'];recordings[_0x4c5104['uniqueid']][_0xdb04('0x2d')]='';}recordings[_0x4c5104[_0xdb04('0x7')]][_0xdb04('0x24')]['forEach'](function(_0x3d8966){var _0x98be9=_['clone'](recordings[_0x4c5104[_0xdb04('0x7')]]);_0x98be9['value']=_0x3d8966[_0xdb04('0x21')];writeDB(_0x98be9);});delete recordings[_0x4c5104[_0xdb04('0x7')]];}}catch(_0x23c8cb){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x28'),_0x4c5104[_0xdb04('0x7')]),_0x23c8cb);}};exports[_0xdb04('0x2e')]=function(_0x3cea7c){try{if(!_[_0xdb04('0x1b')](recordings[_0x3cea7c[_0xdb04('0x7')]])){utils[_0xdb04('0x19')](util[_0xdb04('0x4')](_0xdb04('0x2f'),_0x3cea7c[_0xdb04('0x7')]),_0x3cea7c);utils[_0xdb04('0x11')](util['format'](_0xdb04('0x30'),_0x3cea7c['uniqueid'],_0x3cea7c[_0xdb04('0x31')],_0x3cea7c[_0xdb04('0x32')]));if(_0x3cea7c[_0xdb04('0x31')][_0xdb04('0x33')]()==_0xdb04('0x34')&&_[_0xdb04('0x35')](_0x3cea7c['appdata'][_0xdb04('0x33')](),_0xdb04('0x36'))){var _0x214cd6=_0x3cea7c[_0xdb04('0x32')][_0xdb04('0x37')]('=');var _0x16fd10=_0x214cd6[0x0][_0xdb04('0x38')](_0x214cd6[0x0][_0xdb04('0x39')]('(')+0x1,_0x214cd6[0x0][_0xdb04('0x39')](')'));var _0x4906ec=_0x214cd6[0x1];recordings[_0x3cea7c[_0xdb04('0x7')]][_0x16fd10]=_0x4906ec;}}}catch(_0x59c7c0){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x2f'),_0x3cea7c[_0xdb04('0x7')]),_0x59c7c0);}};exports[_0xdb04('0x3a')]=function(_0x565096){try{if(!_[_0xdb04('0x1b')](recordings[_0x565096[_0xdb04('0x7')]])){utils[_0xdb04('0x19')](util[_0xdb04('0x4')](_0xdb04('0x3b'),_0x565096['uniqueid']),_0x565096);utils[_0xdb04('0x11')](util['format'](_0xdb04('0x3c'),_0x565096[_0xdb04('0x7')],_0x565096[_0xdb04('0x3d')]));recordings[_0x565096['uniqueid']][_0xdb04('0x3d')]=_0x565096[_0xdb04('0x3d')];}}catch(_0x5be4f8){utils['error'](util[_0xdb04('0x4')](_0xdb04('0x3b'),_0x565096[_0xdb04('0x7')]),_0x5be4f8);}};exports[_0xdb04('0x3e')]=function(_0x524c92){try{utils['debug'](util[_0xdb04('0x4')](_0xdb04('0x3f'),_0x524c92['uniqueid']),_0x524c92);utils[_0xdb04('0x11')](util[_0xdb04('0x4')](_0xdb04('0x40'),_0x524c92[_0xdb04('0x7')],_0x524c92['transferercalleridnum'],_0x524c92[_0xdb04('0x41')],_0x524c92[_0xdb04('0x42')],_0x524c92['transfereecalleridname']));if(recordings[_0x524c92['transfereruniqueid']]&&transfers[_0xdb04('0x6')][_0x524c92[_0xdb04('0x43')]]){transfers[_0xdb04('0x6')][_0x524c92['transfereruniqueid']][_0xdb04('0x44')]=!![];}}catch(_0x31ee68){utils[_0xdb04('0x16')](util[_0xdb04('0x4')](_0xdb04('0x3f'),_0x524c92[_0xdb04('0x7')]),_0x31ee68);}}; \ No newline at end of file +var _0x270f=['appdata','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','UserId','CreateVoiceRecording','request','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x270f,0xe5));var _0xf270=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x270f[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require(_0xf270('0x0'));var utils=require(_0xf270('0x1'));var transfers=require(_0xf270('0x2'));var recordings={};function writeDB(_0x2c9bd5){var _0x527cbf;utils[_0xf270('0x3')](util[_0xf270('0x4')](_0xf270('0x5'),_0x2c9bd5[_0xf270('0x6')]));if(transfers['blinds'][_0x2c9bd5[_0xf270('0x6')]]){_0x527cbf=_0x2c9bd5[_0xf270('0x6')];_0x2c9bd5[_0xf270('0x6')]=transfers[_0xf270('0x7')][_0x2c9bd5[_0xf270('0x6')]][_0xf270('0x8')];}if(_0x2c9bd5[_0xf270('0x9')]){utils['getUserByInternal'](_0x2c9bd5[_0xf270('0x9')])[_0xf270('0xa')](function(_0x33b9c8){if(_0x33b9c8){_0x2c9bd5[_0xf270('0xb')]=_0x33b9c8['name'];_0x2c9bd5[_0xf270('0xc')]=_0x33b9c8['id'];}utils['request'](_0xf270('0xd'),_0x2c9bd5);});}else{utils[_0xf270('0xe')](_0xf270('0xd'),_0x2c9bd5);}if(_0x527cbf)delete transfers[_0xf270('0x7')][_0x527cbf];}exports['newchannel']=function(_0x5b95aa){try{utils[_0xf270('0xf')](util[_0xf270('0x4')](_0xf270('0x10'),_0x5b95aa[_0xf270('0x6')]),_0x5b95aa);if(_0x5b95aa['uniqueid']==_0x5b95aa['linkedid']){utils['info'](util[_0xf270('0x4')](_0xf270('0x11'),_0x5b95aa[_0xf270('0x6')],_0x5b95aa[_0xf270('0x12')],_0x5b95aa['exten']));recordings[_0x5b95aa[_0xf270('0x6')]]={'uniqueid':_0x5b95aa[_0xf270('0x6')],'accountcode':_0x5b95aa[_0xf270('0x9')],'exten':_0x5b95aa[_0xf270('0x13')],'context':_0x5b95aa['context'],'channel':_0x5b95aa[_0xf270('0x14')],'monitors':[]};}}catch(_0x58fbca){utils[_0xf270('0x15')](util[_0xf270('0x4')](_0xf270('0x10'),_0x5b95aa[_0xf270('0x6')]),_0x58fbca);}};exports[_0xf270('0x16')]=function(_0x16e60c){try{utils[_0xf270('0xf')](util[_0xf270('0x4')](_0xf270('0x17'),_0x16e60c[_0xf270('0x6')]),_0x16e60c);if(!_[_0xf270('0x18')](recordings[_0x16e60c['uniqueid']])&&_0x16e60c[_0xf270('0x19')]==0x6){utils[_0xf270('0x3')](util[_0xf270('0x4')](_0xf270('0x1a'),_0x16e60c[_0xf270('0x6')],_0x16e60c[_0xf270('0x12')],_0x16e60c[_0xf270('0x14')]));}else if(!_[_0xf270('0x18')](recordings[_0x16e60c[_0xf270('0x1b')]])&&_0x16e60c[_0xf270('0x19')]==0x6&&_0x16e60c[_0xf270('0x12')]!='transfer'){utils[_0xf270('0x3')](util[_0xf270('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x16e60c[_0xf270('0x6')],_0x16e60c[_0xf270('0x1b')],_0x16e60c['context'],_0x16e60c['channel']));recordings[_0x16e60c[_0xf270('0x1b')]][_0xf270('0x9')]=_0x16e60c[_0xf270('0x9')];}}catch(_0x58b5ca){utils[_0xf270('0x15')](util[_0xf270('0x4')](_0xf270('0x17'),_0x16e60c[_0xf270('0x6')]),_0x58b5ca);}};exports[_0xf270('0x1c')]=function(_0x433891){try{if(!_[_0xf270('0x18')](_0x433891[_0xf270('0x1d')])&&!_[_0xf270('0x18')](_0x433891[_0xf270('0x1d')][_0xf270('0x1e')])){utils['debug'](util['format'](_0xf270('0x1f'),_0x433891[_0xf270('0x6')]),_0x433891);utils[_0xf270('0x3')](util[_0xf270('0x4')](_0xf270('0x20'),_0x433891[_0xf270('0x6')],_0x433891[_0xf270('0x1d')],_0x433891[_0xf270('0x21')]));if(_[_0xf270('0x22')](_0x433891[_0xf270('0x21')],_0xf270('0x23'))){_0x433891[_0xf270('0x21')]=_0x433891[_0xf270('0x21')][_0xf270('0x24')](_0xf270('0x23'),_0xf270('0x25'));}if(recordings[_0x433891[_0xf270('0x1b')]]){var _0x131797=_['find'](recordings[_0x433891[_0xf270('0x1b')]][_0xf270('0x26')],{'value':_0x433891[_0xf270('0x21')]});if(_[_0xf270('0x18')](_0x131797)){recordings[_0x433891[_0xf270('0x1b')]]['monitors'][_0xf270('0x27')]({'value':_0x433891[_0xf270('0x21')]});}}}}catch(_0x1bf437){utils[_0xf270('0x15')](util['format']('[%s][recordings][varset]',_0x433891[_0xf270('0x6')]),_0x1bf437);}};exports[_0xf270('0x28')]=function(_0x5af54d){try{if(!_[_0xf270('0x18')](recordings[_0x5af54d['uniqueid']])){utils[_0xf270('0xf')](util[_0xf270('0x4')](_0xf270('0x29'),_0x5af54d[_0xf270('0x6')]),_0x5af54d);utils[_0xf270('0x3')](util[_0xf270('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5af54d['uniqueid'],_0x5af54d['calleridnum'],_0x5af54d['calleridname'],_0x5af54d[_0xf270('0x2a')]));recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2b')]=_0x5af54d['calleridnum'];recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2c')]=_0x5af54d[_0xf270('0x2c')];recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2d')]=_0x5af54d['connectedlinenum'];recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2e')]=_0x5af54d['connectedlinename'];if(recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2f')]==_0xf270('0x30')&&recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x9')]){recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2d')]=recordings[_0x5af54d['uniqueid']][_0xf270('0x9')];recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x2e')]='';}recordings[_0x5af54d[_0xf270('0x6')]][_0xf270('0x26')]['forEach'](function(_0x2ce084){var _0x54eb1f=_[_0xf270('0x31')](recordings[_0x5af54d[_0xf270('0x6')]]);_0x54eb1f[_0xf270('0x21')]=_0x2ce084[_0xf270('0x21')];writeDB(_0x54eb1f);});delete recordings[_0x5af54d[_0xf270('0x6')]];}}catch(_0x478edd){utils['error'](util[_0xf270('0x4')](_0xf270('0x29'),_0x5af54d[_0xf270('0x6')]),_0x478edd);}};exports[_0xf270('0x32')]=function(_0x139cc){try{if(!_[_0xf270('0x18')](recordings[_0x139cc[_0xf270('0x6')]])){utils['debug'](util[_0xf270('0x4')]('[%s][recordings][newexten]',_0x139cc[_0xf270('0x6')]),_0x139cc);utils['info'](util[_0xf270('0x4')](_0xf270('0x33'),_0x139cc[_0xf270('0x6')],_0x139cc['application'],_0x139cc['appdata']));if(_0x139cc[_0xf270('0x34')][_0xf270('0x35')]()=='set'&&_[_0xf270('0x36')](_0x139cc[_0xf270('0x37')][_0xf270('0x35')](),_0xf270('0x38'))){var _0x4885d9=_0x139cc['appdata'][_0xf270('0x39')]('=');var _0x1a1bcc=_0x4885d9[0x0][_0xf270('0x3a')](_0x4885d9[0x0][_0xf270('0x3b')]('(')+0x1,_0x4885d9[0x0]['lastIndexOf'](')'));var _0x3fb9da=_0x4885d9[0x1];recordings[_0x139cc[_0xf270('0x6')]][_0x1a1bcc]=_0x3fb9da;}}}catch(_0x157e6b){utils[_0xf270('0x15')](util[_0xf270('0x4')](_0xf270('0x3c'),_0x139cc[_0xf270('0x6')]),_0x157e6b);}};exports[_0xf270('0x3d')]=function(_0x57eef5){try{if(!_[_0xf270('0x18')](recordings[_0x57eef5[_0xf270('0x6')]])){utils[_0xf270('0xf')](util[_0xf270('0x4')](_0xf270('0x3e'),_0x57eef5['uniqueid']),_0x57eef5);utils[_0xf270('0x3')](util[_0xf270('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x57eef5['uniqueid'],_0x57eef5[_0xf270('0x3f')]));recordings[_0x57eef5[_0xf270('0x6')]][_0xf270('0x3f')]=_0x57eef5[_0xf270('0x3f')];}}catch(_0x3685b9){utils[_0xf270('0x15')](util['format'](_0xf270('0x3e'),_0x57eef5[_0xf270('0x6')]),_0x3685b9);}};exports['blindtransfer']=function(_0x5db6fc){try{utils[_0xf270('0xf')](util['format']('[%s][recordings][blindtransfer]',_0x5db6fc[_0xf270('0x6')]),_0x5db6fc);utils[_0xf270('0x3')](util[_0xf270('0x4')](_0xf270('0x40'),_0x5db6fc[_0xf270('0x6')],_0x5db6fc['transferercalleridnum'],_0x5db6fc[_0xf270('0x41')],_0x5db6fc[_0xf270('0x42')],_0x5db6fc[_0xf270('0x43')]));if(recordings[_0x5db6fc[_0xf270('0x44')]]&&transfers[_0xf270('0x7')][_0x5db6fc['transfereruniqueid']]){transfers[_0xf270('0x7')][_0x5db6fc[_0xf270('0x44')]][_0xf270('0x45')]=!![];}}catch(_0x1fd43c){utils[_0xf270('0x15')](util['format'](_0xf270('0x46'),_0x5db6fc[_0xf270('0x6')]),_0x1fd43c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index d9cd618..a3c476b 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 _0xfd74=['origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','type','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel'];(function(_0x11f175,_0x31811b){var _0x3febd=function(_0x22a823){while(--_0x22a823){_0x11f175['push'](_0x11f175['shift']());}};_0x3febd(++_0x31811b);}(_0xfd74,0x10e));var _0x4fd7=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xfd74[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x4fd7('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x1de72d){utils[_0x4fd7('0x1')](util[_0x4fd7('0x2')](_0x4fd7('0x3'),_0x1de72d['type']==='attended'?_0x1de72d[_0x4fd7('0x4')]:_0x1de72d['uniqueid'],_0x1de72d['type']));utils['request'](_0x4fd7('0x5'),_0x1de72d);}exports[_0x4fd7('0x6')]={};exports[_0x4fd7('0x7')]=function(_0x1428c8){try{utils[_0x4fd7('0x8')](util[_0x4fd7('0x2')](_0x4fd7('0x9'),_0x1428c8[_0x4fd7('0xa')]),_0x1428c8);utils[_0x4fd7('0x1')](util[_0x4fd7('0x2')](_0x4fd7('0xb'),_0x1428c8[_0x4fd7('0xa')],_0x1428c8[_0x4fd7('0xc')],_0x1428c8['transferercalleridname'],_0x1428c8[_0x4fd7('0xd')],_0x1428c8[_0x4fd7('0xe')]));_0x1428c8[_0x4fd7('0xf')]='blind';exports[_0x4fd7('0x6')][_0x1428c8[_0x4fd7('0x10')]]=_0x1428c8;writeDB(_0x1428c8);}catch(_0x2ad9fd){utils[_0x4fd7('0x11')](util['format'](_0x4fd7('0x9'),_0x1428c8[_0x4fd7('0xa')]),_0x2ad9fd);}};exports[_0x4fd7('0x12')]=function(_0x5e4e3f){try{utils[_0x4fd7('0x8')](util[_0x4fd7('0x2')](_0x4fd7('0x13'),_0x5e4e3f[_0x4fd7('0x4')]),_0x5e4e3f);utils['info'](util[_0x4fd7('0x2')](_0x4fd7('0x14'),_0x5e4e3f['origtransfereruniqueid'],_0x5e4e3f[_0x4fd7('0x15')],_0x5e4e3f[_0x4fd7('0x16')],_0x5e4e3f[_0x4fd7('0x17')],_0x5e4e3f['transfertargetcalleridname']));_0x5e4e3f=_[_0x4fd7('0x18')](_0x5e4e3f,{'transfererchannel':_0x5e4e3f[_0x4fd7('0x19')],'transferercalleridnum':_0x5e4e3f[_0x4fd7('0x15')],'transferercalleridname':_0x5e4e3f[_0x4fd7('0x16')],'transfererconnectedlinenum':_0x5e4e3f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5e4e3f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5e4e3f[_0x4fd7('0x1a')],'transferercontext':_0x5e4e3f['secondtransferercontext'],'transfererexten':_0x5e4e3f[_0x4fd7('0x1b')],'transfererlinkedid':_0x5e4e3f[_0x4fd7('0x1c')],'context':_0x5e4e3f[_0x4fd7('0x1d')],'extension':_0x5e4e3f[_0x4fd7('0x1e')],'type':_0x4fd7('0x1f')});if(_['isNil'](_0x5e4e3f['transfereechannel'])){_0x5e4e3f=_[_0x4fd7('0x18')](_0x5e4e3f,{'transfereechannel':_0x5e4e3f[_0x4fd7('0x20')],'transfereecalleridnum':_0x5e4e3f[_0x4fd7('0x17')],'transfereecalleridname':_0x5e4e3f[_0x4fd7('0x21')],'transfereeconnectedlinenum':_0x5e4e3f[_0x4fd7('0x22')],'transfereeconnectedlinename':_0x5e4e3f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5e4e3f[_0x4fd7('0x23')],'transfereecontext':_0x5e4e3f['transfertargetcontext'],'transfereeexten':_0x5e4e3f['transfertargetexten'],'transfereelinkedid':_0x5e4e3f[_0x4fd7('0x24')]});}writeDB(_0x5e4e3f);}catch(_0x2b4f1c){utils['error'](util[_0x4fd7('0x2')]('[%s][transfers][attendedtransfer]',_0x5e4e3f['origtransfereruniqueid']),_0x2b4f1c);}}; \ No newline at end of file +var _0xd57b=['attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','type','request','CreateVoiceTransferReport','debug','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','[%s][transfers][blindtransfer]'];(function(_0x34afbd,_0x2dd289){var _0x5b0380=function(_0x27336a){while(--_0x27336a){_0x34afbd['push'](_0x34afbd['shift']());}};_0x5b0380(++_0x2dd289);}(_0xd57b,0x1c0));var _0xbd57=function(_0x3d8291,_0x560e85){_0x3d8291=_0x3d8291-0x0;var _0x2bad5c=_0xd57b[_0x3d8291];return _0x2bad5c;};'use strict';var _=require(_0xbd57('0x0'));var util=require(_0xbd57('0x1'));var utils=require(_0xbd57('0x2'));function writeDB(_0x3c2d60){utils[_0xbd57('0x3')](util[_0xbd57('0x4')](_0xbd57('0x5'),_0x3c2d60['type']===_0xbd57('0x6')?_0x3c2d60[_0xbd57('0x7')]:_0x3c2d60['uniqueid'],_0x3c2d60[_0xbd57('0x8')]));utils[_0xbd57('0x9')](_0xbd57('0xa'),_0x3c2d60);}exports['blinds']={};exports['blindtransfer']=function(_0x27174c){try{utils[_0xbd57('0xb')](util[_0xbd57('0x4')]('[%s][transfers][blindtransfer]',_0x27174c[_0xbd57('0xc')]),_0x27174c);utils['info'](util[_0xbd57('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x27174c['uniqueid'],_0x27174c[_0xbd57('0xd')],_0x27174c[_0xbd57('0xe')],_0x27174c[_0xbd57('0xf')],_0x27174c[_0xbd57('0x10')]));_0x27174c[_0xbd57('0x8')]='blind';exports['blinds'][_0x27174c[_0xbd57('0x11')]]=_0x27174c;writeDB(_0x27174c);}catch(_0x3ab1a9){utils[_0xbd57('0x12')](util[_0xbd57('0x4')](_0xbd57('0x13'),_0x27174c[_0xbd57('0xc')]),_0x3ab1a9);}};exports[_0xbd57('0x14')]=function(_0x31015d){try{utils[_0xbd57('0xb')](util[_0xbd57('0x4')](_0xbd57('0x15'),_0x31015d['origtransfereruniqueid']),_0x31015d);utils[_0xbd57('0x3')](util[_0xbd57('0x4')](_0xbd57('0x16'),_0x31015d[_0xbd57('0x7')],_0x31015d[_0xbd57('0x17')],_0x31015d['origtransferercalleridname'],_0x31015d[_0xbd57('0x18')],_0x31015d['transfertargetcalleridname']));_0x31015d=_[_0xbd57('0x19')](_0x31015d,{'transfererchannel':_0x31015d[_0xbd57('0x1a')],'transferercalleridnum':_0x31015d[_0xbd57('0x17')],'transferercalleridname':_0x31015d['origtransferercalleridname'],'transfererconnectedlinenum':_0x31015d[_0xbd57('0x1b')],'transfererconnectedlinename':_0x31015d[_0xbd57('0x1c')],'transfereraccountcode':_0x31015d[_0xbd57('0x1d')],'transferercontext':_0x31015d['secondtransferercontext'],'transfererexten':_0x31015d['secondtransfererexten'],'transfererlinkedid':_0x31015d[_0xbd57('0x1e')],'context':_0x31015d['origtransferercontext'],'extension':_0x31015d[_0xbd57('0x1f')],'type':'attended'});if(_['isNil'](_0x31015d[_0xbd57('0x20')])){_0x31015d=_[_0xbd57('0x19')](_0x31015d,{'transfereechannel':_0x31015d[_0xbd57('0x21')],'transfereecalleridnum':_0x31015d['transfertargetcalleridnum'],'transfereecalleridname':_0x31015d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x31015d[_0xbd57('0x22')],'transfereeconnectedlinename':_0x31015d[_0xbd57('0x23')],'transfereeaccountcode':_0x31015d[_0xbd57('0x24')],'transfereecontext':_0x31015d[_0xbd57('0x25')],'transfereeexten':_0x31015d[_0xbd57('0x26')],'transfereelinkedid':_0x31015d['transfertargetlinkedid']});}writeDB(_0x31015d);}catch(_0x49ff3d){utils[_0xbd57('0x12')](util['format'](_0xbd57('0x15'),_0x31015d[_0xbd57('0x7')]),_0x49ff3d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8149a4c..bf55feb 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 _0x96ca=['isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','sumTime','now','isAfter'];(function(_0x1a2665,_0x3a493b){var _0x18c4f0=function(_0x248aa2){while(--_0x248aa2){_0x1a2665['push'](_0x1a2665['shift']());}};_0x18c4f0(++_0x3a493b);}(_0x96ca,0xb9));var _0xa96c=function(_0x52b655,_0x5132ac){_0x52b655=_0x52b655-0x0;var _0x4185fc=_0x96ca[_0x52b655];return _0x4185fc;};'use strict';var BPromise=require(_0xa96c('0x0'));var jayson=require(_0xa96c('0x1'));var moment=require(_0xa96c('0x2'));var util=require(_0xa96c('0x3'));var client=jayson[_0xa96c('0x4')][_0xa96c('0x5')]({'port':0x2329});var logger=require(_0xa96c('0x6'))(_0xa96c('0x7'));exports[_0xa96c('0x8')]=function(_0x53e59c,_0xf878ba){logger[_0xa96c('0x8')](_0x53e59c,_0xf878ba?util[_0xa96c('0x9')](_0xf878ba,{'showHidden':![],'depth':null}):'');};exports[_0xa96c('0xa')]=function(_0x4fb8ff,_0x5dd138){logger['debug'](_0x4fb8ff,_0x5dd138?util[_0xa96c('0x9')](_0x5dd138,{'showHidden':![],'depth':null}):'');};exports[_0xa96c('0xb')]=function(_0x5f0382,_0x23cfae){logger[_0xa96c('0xb')](_0x5f0382,_0x23cfae?util[_0xa96c('0x9')](_0x23cfae,{'showHidden':![],'depth':null}):'');};exports[_0xa96c('0xc')]=function(_0x42ef29,_0x3cea0e){return client[_0xa96c('0xc')](_0x42ef29,{'body':_0x3cea0e})[_0xa96c('0xd')](function(_0x10b8f8){logger[_0xa96c('0xa')](_0xa96c('0xe'),_0x42ef29,_0x10b8f8?util[_0xa96c('0x9')](_0x10b8f8,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x41ee2f){logger[_0xa96c('0xb')](_0xa96c('0xe'),_0x42ef29,_0x41ee2f?util['inspect'](_0x41ee2f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x422194){return client[_0xa96c('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa96c('0xf'),_0xa96c('0x10')],'where':_0x422194,'limit':0x1}})[_0xa96c('0xd')](function(_0x279e03){logger[_0xa96c('0xa')](_0xa96c('0x11'),JSON[_0xa96c('0x12')](_0x422194),_0x279e03?util[_0xa96c('0x9')](_0x279e03,{'showHidden':![],'depth':null}):'');return _0x279e03['result'][_0xa96c('0x13')]?_0x279e03[_0xa96c('0x14')][0x0]:null;});}exports[_0xa96c('0x15')]=function(_0x4f2350){return new BPromise(function(_0x6ce30a,_0x5d3644){if(_0x4f2350){return getUser({'internal':_0x4f2350})[_0xa96c('0xd')](function(_0x387ff9){logger[_0xa96c('0x8')](_0xa96c('0x16'),_0x4f2350,_0x387ff9?_0xa96c('0x17'):'notfound');return _0x6ce30a(_0x387ff9);})[_0xa96c('0x18')](function(_0x1180ee){logger[_0xa96c('0xb')](_0xa96c('0x19'),_0x1180ee?util[_0xa96c('0x9')](_0x1180ee,{'showHidden':![],'depth':null}):'');return _0x6ce30a(null);});}return _0x6ce30a(null);});};exports[_0xa96c('0x1a')]=function(_0x2b7e93){return new BPromise(function(_0xcd745b,_0x16fd47){if(_0x2b7e93){return getUser({'interface':_0x2b7e93})[_0xa96c('0xd')](function(_0x39b0d0){logger[_0xa96c('0x8')](_0xa96c('0x1b'),_0x2b7e93,_0x39b0d0?'found':_0xa96c('0x1c'));return _0xcd745b(_0x39b0d0);})['catch'](function(_0x4053e0){logger[_0xa96c('0xb')]('[utils][getUserByInterface]',_0x4053e0?util[_0xa96c('0x9')](_0x4053e0,{'showHidden':![],'depth':null}):'');return _0xcd745b(null);});}return _0xcd745b(null);});};exports[_0xa96c('0x1d')]=function(_0x45cb2d){return new BPromise(function(_0x2584ed,_0xe5fc7d){if(_0x45cb2d){return getUser({'name':_0x45cb2d})[_0xa96c('0xd')](function(_0x3893bf){logger[_0xa96c('0x8')](_0xa96c('0x1e'),_0x45cb2d,_0x3893bf?'found':'notfound');return _0x2584ed(_0x3893bf);})[_0xa96c('0x18')](function(_0x2e8db6){logger[_0xa96c('0xb')](_0xa96c('0x1f'),_0x2e8db6?util['inspect'](_0x2e8db6,{'showHidden':![],'depth':null}):'');return _0x2584ed(null);});}return _0x2584ed(null);});};exports['getVoiceQueueByName']=function(_0x24b6b0){return new BPromise(function(_0x42d005,_0x4ffe2f){if(_0x24b6b0){return client[_0xa96c('0xc')](_0xa96c('0x20'),{'options':{'raw':!![],'attributes':['id',_0xa96c('0xf'),_0xa96c('0x21'),'acw','acwTimeout'],'where':{'name':_0x24b6b0},'limit':0x1}})[_0xa96c('0xd')](function(_0x13d577){logger[_0xa96c('0xa')](_0xa96c('0x22'),_0x24b6b0,_0x13d577?util[_0xa96c('0x9')](_0x13d577,{'showHidden':![],'depth':null}):'');logger[_0xa96c('0x8')](_0xa96c('0x23'),_0x24b6b0,_0x13d577?_0xa96c('0x17'):_0xa96c('0x1c'));return _0x42d005(_0x13d577['result']['length']?_0x13d577[_0xa96c('0x14')][0x0]:null);})[_0xa96c('0x18')](function(_0x5c23ec){logger['error']('[utils][getVoiceQueueByName]',_0x5c23ec?util[_0xa96c('0x9')](_0x5c23ec,{'showHidden':![],'depth':null}):'');return _0x42d005(null);});}return _0x42d005(null);});};exports[_0xa96c('0x24')]=function(_0xc8447e,_0x15e4c5){return moment(_0xc8447e)[_0xa96c('0x25')](_0x15e4c5,_0xa96c('0x26'))[_0xa96c('0x27')](_0xa96c('0x28'));};exports['subtractTime']=function(_0x40ca03,_0x32a042){return moment(_0x40ca03)[_0xa96c('0x29')](_0x32a042,_0xa96c('0x26'))[_0xa96c('0x27')](_0xa96c('0x28'));};exports['diffTime']=function(_0x31e4d1,_0x1e0be8){return moment(_0x31e4d1)['diff'](moment(_0x1e0be8),'seconds');};exports[_0xa96c('0x2a')]=function(_0x4e0558,_0x5a9a8a){return parseInt(_0x4e0558,0xa)+parseInt(_0x5a9a8a,0xa);};exports[_0xa96c('0x2b')]=function(){return moment()[_0xa96c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa96c('0x2c')]=function(_0x6b1bb4,_0x23ee64){if(_0x23ee64){return moment(_0x6b1bb4)['isAfter'](_0x23ee64);}return!![];};exports['isBefore']=function(_0x18d46f,_0xbff657){if(_0xbff657){return moment(_0x18d46f)[_0xa96c('0x2d')](_0xbff657);}else if(_0x18d46f){return!![];}return![];}; \ No newline at end of file +var _0x1107=['interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','request','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','http','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','GetUser','name'];(function(_0x2296fd,_0x449ea3){var _0x47a053=function(_0x807f69){while(--_0x807f69){_0x2296fd['push'](_0x2296fd['shift']());}};_0x47a053(++_0x449ea3);}(_0x1107,0xd8));var _0x7110=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x1107[_0x5e3a45];return _0x13419f;};'use strict';var BPromise=require(_0x7110('0x0'));var jayson=require(_0x7110('0x1'));var moment=require(_0x7110('0x2'));var util=require('util');var client=jayson['client'][_0x7110('0x3')]({'port':0x2329});var logger=require(_0x7110('0x4'))('xdr');exports[_0x7110('0x5')]=function(_0x422095,_0x436cc3){logger[_0x7110('0x5')](_0x422095,_0x436cc3?util[_0x7110('0x6')](_0x436cc3,{'showHidden':![],'depth':null}):'');};exports[_0x7110('0x7')]=function(_0x38b340,_0xe978a){logger[_0x7110('0x7')](_0x38b340,_0xe978a?util[_0x7110('0x6')](_0xe978a,{'showHidden':![],'depth':null}):'');};exports[_0x7110('0x8')]=function(_0x466351,_0x271466){logger['error'](_0x466351,_0x271466?util[_0x7110('0x6')](_0x271466,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x400dc6,_0x19d729){return client['request'](_0x400dc6,{'body':_0x19d729})[_0x7110('0x9')](function(_0x45c281){logger[_0x7110('0x7')](_0x7110('0xa'),_0x400dc6,_0x45c281?util[_0x7110('0x6')](_0x45c281,{'showHidden':![],'depth':null}):'');})[_0x7110('0xb')](function(_0x427997){logger[_0x7110('0x8')](_0x7110('0xa'),_0x400dc6,_0x427997?util['inspect'](_0x427997,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21fc62){return client['request'](_0x7110('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x7110('0xd'),_0x7110('0xe')],'where':_0x21fc62,'limit':0x1}})[_0x7110('0x9')](function(_0x149238){logger[_0x7110('0x7')](_0x7110('0xf'),JSON[_0x7110('0x10')](_0x21fc62),_0x149238?util['inspect'](_0x149238,{'showHidden':![],'depth':null}):'');return _0x149238[_0x7110('0x11')]['length']?_0x149238[_0x7110('0x11')][0x0]:null;});}exports[_0x7110('0x12')]=function(_0x57e037){return new BPromise(function(_0x9df9ca,_0xd46bd3){if(_0x57e037){return getUser({'internal':_0x57e037})[_0x7110('0x9')](function(_0x49f7d3){logger['info'](_0x7110('0x13'),_0x57e037,_0x49f7d3?_0x7110('0x14'):_0x7110('0x15'));return _0x9df9ca(_0x49f7d3);})[_0x7110('0xb')](function(_0x2adfc7){logger['error'](_0x7110('0x16'),_0x2adfc7?util[_0x7110('0x6')](_0x2adfc7,{'showHidden':![],'depth':null}):'');return _0x9df9ca(null);});}return _0x9df9ca(null);});};exports[_0x7110('0x17')]=function(_0x264250){return new BPromise(function(_0x25d673,_0x3b7419){if(_0x264250){return getUser({'interface':_0x264250})[_0x7110('0x9')](function(_0x38b7cd){logger['info'](_0x7110('0x18'),_0x264250,_0x38b7cd?'found':_0x7110('0x15'));return _0x25d673(_0x38b7cd);})[_0x7110('0xb')](function(_0x2373b4){logger[_0x7110('0x8')]('[utils][getUserByInterface]',_0x2373b4?util[_0x7110('0x6')](_0x2373b4,{'showHidden':![],'depth':null}):'');return _0x25d673(null);});}return _0x25d673(null);});};exports[_0x7110('0x19')]=function(_0x305f10){return new BPromise(function(_0x54fc43,_0x341eb7){if(_0x305f10){return getUser({'name':_0x305f10})['then'](function(_0x4b4b81){logger[_0x7110('0x5')](_0x7110('0x1a'),_0x305f10,_0x4b4b81?_0x7110('0x14'):_0x7110('0x15'));return _0x54fc43(_0x4b4b81);})['catch'](function(_0x679e31){logger[_0x7110('0x8')](_0x7110('0x1b'),_0x679e31?util[_0x7110('0x6')](_0x679e31,{'showHidden':![],'depth':null}):'');return _0x54fc43(null);});}return _0x54fc43(null);});};exports[_0x7110('0x1c')]=function(_0x381203){return new BPromise(function(_0x280781,_0x389047){if(_0x381203){return client[_0x7110('0x1d')](_0x7110('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x7110('0xd'),_0x7110('0x1f'),'acw','acwTimeout'],'where':{'name':_0x381203},'limit':0x1}})[_0x7110('0x9')](function(_0x5758f6){logger['debug'](_0x7110('0x20'),_0x381203,_0x5758f6?util[_0x7110('0x6')](_0x5758f6,{'showHidden':![],'depth':null}):'');logger['info'](_0x7110('0x21'),_0x381203,_0x5758f6?'found':_0x7110('0x15'));return _0x280781(_0x5758f6[_0x7110('0x11')]['length']?_0x5758f6[_0x7110('0x11')][0x0]:null);})[_0x7110('0xb')](function(_0x6d0e67){logger['error'](_0x7110('0x22'),_0x6d0e67?util[_0x7110('0x6')](_0x6d0e67,{'showHidden':![],'depth':null}):'');return _0x280781(null);});}return _0x280781(null);});};exports[_0x7110('0x23')]=function(_0x9f4a59,_0x45262f){return moment(_0x9f4a59)[_0x7110('0x24')](_0x45262f,_0x7110('0x25'))[_0x7110('0x26')](_0x7110('0x27'));};exports['subtractTime']=function(_0x4c60b0,_0x421bd6){return moment(_0x4c60b0)['subtract'](_0x421bd6,_0x7110('0x25'))[_0x7110('0x26')](_0x7110('0x27'));};exports[_0x7110('0x28')]=function(_0x5e7379,_0x52e74a){return moment(_0x5e7379)[_0x7110('0x29')](moment(_0x52e74a),'seconds');};exports[_0x7110('0x2a')]=function(_0xbc7fe2,_0x4a05c8){return parseInt(_0xbc7fe2,0xa)+parseInt(_0x4a05c8,0xa);};exports[_0x7110('0x2b')]=function(){return moment()['format'](_0x7110('0x27'));};exports[_0x7110('0x2c')]=function(_0x31c762,_0x25bde1){if(_0x25bde1){return moment(_0x31c762)[_0x7110('0x2c')](_0x25bde1);}return!![];};exports['isBefore']=function(_0x3aa76e,_0x3abc4b){if(_0x3abc4b){return moment(_0x3aa76e)[_0x7110('0x2d')](_0x3abc4b);}else if(_0x3aa76e){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 59ab74d..e5c7b38 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 _0x144d=['test','fs-extra','lodash','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','xcally','client','role','log','user','then','timestamp','catch','error','api','auth','client-side-logger','use','logger','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','responseTime','other','agent_name'];(function(_0x5d07bb,_0x271464){var _0x42960a=function(_0x2f0724){while(--_0x2f0724){_0x5d07bb['push'](_0x5d07bb['shift']());}};_0x42960a(++_0x271464);}(_0x144d,0x1c3));var _0xd144=function(_0x114b48,_0x4a36b4){_0x114b48=_0x114b48-0x0;var _0x295258=_0x144d[_0x114b48];return _0x295258;};var fs=require(_0xd144('0x0'));var _=require(_0xd144('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0xd144('0x2'));var fileLogger=require(_0xd144('0x3'))[_0xd144('0x4')];var safeTemplate=require(_0xd144('0x5'))[_0xd144('0x6')];var maskSensitiveData=require(_0xd144('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x2b9512(_0x15fd8e){var _0x301cee=path[_0xd144('0x8')](_0xd144('0x9'),'log',_0xd144('0xa'));var _0x41e84b=path[_0xd144('0x8')](_0xd144('0xb'),_0x15fd8e[_0xd144('0xc')]+'-'+_0x15fd8e['name']);return fs['ensureDir'](path[_0xd144('0x8')](_0x301cee,_0x41e84b))['then'](function(){var _0x51946e=fileLogger(_0xd144('0xb'),path[_0xd144('0x8')](_0x301cee,_0x41e84b));return _0x51946e;})['catch'](function(_0xf22600){throw _0xf22600;});}this[_0xd144('0xd')]=function(_0x12ee99,_0x3de76d,_0x594b58,_0x30f829){return _0x2b9512(_0x12ee99[_0xd144('0xe')])[_0xd144('0xf')](function(_0x11f4ee){var _0x577c55=_0x11f4ee[_0x3de76d];return _0x577c55;})[_0xd144('0xf')](function(_0x373845){var _0x55b255=_0x12ee99[_0xd144('0xe')]?_0x12ee99['user']['id']:'no-user';var _0xb50811=_0x30f829['data'];var _0x5080c9=_0x30f829[_0xd144('0x10')];var _0x57a736=new Date(Number(_0x5080c9));return _0x373845(_0x55b255,_0x57a736,_0x594b58,_0xb50811);})[_0xd144('0x11')](function(_0x1690ed){fileLogger('client')[_0xd144('0x12')](_0x1690ed);});};}function setupLoggers(_0x14a465){return new Promise(function(_0xa1e51){var _0x10bc87=new ClientSideLogger();var _0xe27d34=fileLogger(_0xd144('0x13'));var _0x4d8526=fileLogger(_0xd144('0x14'));_0x14a465['set'](_0xd144('0x15'),_0x10bc87);_0x14a465[_0xd144('0x16')](ewinston[_0xd144('0x17')]({'winstonInstance':_0xe27d34,'meta':![],'statusLevels':!![],'msg':function(_0x170e8a,_0x205ed2){var _0xb7100a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xd144('0x18')](_0x170e8a[_0xd144('0x19')])){_0xb7100a+=_0xd144('0x1a');var _0x5c5208=_0x170e8a['body'];maskSensitiveData(_0x5c5208);}return safeTemplate(util[_0xd144('0x1b')](_0xb7100a,_0x170e8a['method'],_0x170e8a[_0xd144('0x1c')][_0xd144('0x1d')]?_0x170e8a[_0xd144('0x1c')][_0xd144('0x1d')]:_0x170e8a[_0xd144('0x1e')][_0xd144('0x1f')]||_0x170e8a['ip'],_0x170e8a[_0xd144('0x20')],_0x205ed2[_0xd144('0x21')],_0x205ed2['responseTime'],_0x170e8a['user']?_0x170e8a[_0xd144('0xe')]['id']:null,_0x170e8a[_0xd144('0xe')]?_0x170e8a['user'][_0xd144('0x22')]:null,_0x170e8a[_0xd144('0xe')]?_0x170e8a[_0xd144('0xe')][_0xd144('0xc')]:null,_0x5c5208?util[_0xd144('0x23')](_0x5c5208,![],null):''));}}));_0x14a465[_0xd144('0x16')](ewinston[_0xd144('0x17')]({'winstonInstance':_0x4d8526,'meta':![],'statusLevels':!![],'msg':function(_0x5d1733,_0x4a8541){var _0x1ddad8=_0xd144('0x24');if(_0x5d1733['body']&&_0x5d1733[_0xd144('0x19')][_0xd144('0x25')]&&_0x5d1733[_0xd144('0x19')][_0xd144('0x26')]){_0x1ddad8=_0xd144('0x27');}return util[_0xd144('0x1b')](_0x1ddad8,_0x5d1733[_0xd144('0x28')],_0x5d1733['headers'][_0xd144('0x1d')]?_0x5d1733[_0xd144('0x1c')][_0xd144('0x1d')]:_0x5d1733[_0xd144('0x1e')]['remoteAddress']||_0x5d1733['ip'],_0x5d1733[_0xd144('0x20')],_0x4a8541['statusCode'],_0x4a8541[_0xd144('0x29')],_0x5d1733[_0xd144('0xe')]?_0x5d1733[_0xd144('0xe')]['id']:null,_0x5d1733['user']?_0x5d1733['user'][_0xd144('0x22')]:null,_0x5d1733[_0xd144('0xe')]?_0x5d1733[_0xd144('0xe')][_0xd144('0xc')]:null,_0x5d1733['body']&&_0x5d1733[_0xd144('0x19')][_0xd144('0x25')]?_0x5d1733[_0xd144('0x19')][_0xd144('0x25')]:_0xd144('0x2a'),_0x5d1733['body']&&_0x5d1733[_0xd144('0x19')][_0xd144('0x26')]?_0x5d1733['body'][_0xd144('0x26')]:'',_0x5d1733['body']&&_0x5d1733[_0xd144('0x19')][_0xd144('0x2b')]?_0x5d1733[_0xd144('0x19')][_0xd144('0x2b')]:'');},'ignoreRoute':function(_0x3d94fb){var _0x5e7273=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5e7273[_0xd144('0x2c')](_0x3d94fb[_0xd144('0x20')]);}}));return _0xa1e51();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xc29a=['maskSensitiveData','/var','log','join','role','name','ensureDir','client','catch','user','then','data','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','headers','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','other','agent_name','setupLoggers','lodash','express-winston','path','util','./loggers','safeTemplate','./mask-sensitive-data'];(function(_0x531be7,_0x574432){var _0xe34a8a=function(_0x3bb888){while(--_0x3bb888){_0x531be7['push'](_0x531be7['shift']());}};_0xe34a8a(++_0x574432);}(_0xc29a,0x161));var _0xac29=function(_0x5cbcda,_0x39cb75){_0x5cbcda=_0x5cbcda-0x0;var _0x170d78=_0xc29a[_0x5cbcda];return _0x170d78;};var fs=require('fs-extra');var _=require(_0xac29('0x0'));var ewinston=require(_0xac29('0x1'));var path=require(_0xac29('0x2'));var util=require(_0xac29('0x3'));var fileLogger=require(_0xac29('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')[_0xac29('0x5')];var maskSensitiveData=require(_0xac29('0x6'))[_0xac29('0x7')];function ClientSideLogger(){function _0x4d4ab1(_0x176e5d){var _0x3bcce2=path['join'](_0xac29('0x8'),_0xac29('0x9'),'xcally');var _0x45a1fd=path[_0xac29('0xa')]('client',_0x176e5d[_0xac29('0xb')]+'-'+_0x176e5d[_0xac29('0xc')]);return fs[_0xac29('0xd')](path[_0xac29('0xa')](_0x3bcce2,_0x45a1fd))['then'](function(){var _0x1c21f6=fileLogger(_0xac29('0xe'),path[_0xac29('0xa')](_0x3bcce2,_0x45a1fd));return _0x1c21f6;})[_0xac29('0xf')](function(_0x1ea61e){throw _0x1ea61e;});}this['log']=function(_0x318cbd,_0xcbd4ca,_0x536e99,_0x5f55ef){return _0x4d4ab1(_0x318cbd[_0xac29('0x10')])[_0xac29('0x11')](function(_0x521feb){var _0x52e957=_0x521feb[_0xcbd4ca];return _0x52e957;})['then'](function(_0x1b0c13){var _0x39dfe7=_0x318cbd[_0xac29('0x10')]?_0x318cbd[_0xac29('0x10')]['id']:'no-user';var _0x1e5344=_0x5f55ef[_0xac29('0x12')];var _0x3b88de=_0x5f55ef['timestamp'];var _0xed79b0=new Date(Number(_0x3b88de));return _0x1b0c13(_0x39dfe7,_0xed79b0,_0x536e99,_0x1e5344);})['catch'](function(_0x44c2b7){fileLogger(_0xac29('0xe'))[_0xac29('0x13')](_0x44c2b7);});};}function setupLoggers(_0x116a6f){return new Promise(function(_0x17f665){var _0x36a088=new ClientSideLogger();var _0x4b2117=fileLogger(_0xac29('0x14'));var _0x2188a1=fileLogger(_0xac29('0x15'));_0x116a6f[_0xac29('0x16')](_0xac29('0x17'),_0x36a088);_0x116a6f[_0xac29('0x18')](ewinston[_0xac29('0x19')]({'winstonInstance':_0x4b2117,'meta':![],'statusLevels':!![],'msg':function(_0x20f73d,_0x5f1c72){var _0x366e37=_0xac29('0x1a');if(!_['isEmpty'](_0x20f73d[_0xac29('0x1b')])){_0x366e37+='\x20body=%s';var _0x5a8b2f=_0x20f73d[_0xac29('0x1b')];maskSensitiveData(_0x5a8b2f);}return safeTemplate(util[_0xac29('0x1c')](_0x366e37,_0x20f73d['method'],_0x20f73d[_0xac29('0x1d')]['x-forwarded-for']?_0x20f73d['headers']['x-forwarded-for']:_0x20f73d[_0xac29('0x1e')][_0xac29('0x1f')]||_0x20f73d['ip'],_0x20f73d[_0xac29('0x20')],_0x5f1c72[_0xac29('0x21')],_0x5f1c72[_0xac29('0x22')],_0x20f73d[_0xac29('0x10')]?_0x20f73d['user']['id']:null,_0x20f73d['user']?_0x20f73d[_0xac29('0x10')][_0xac29('0xc')]:null,_0x20f73d['user']?_0x20f73d['user'][_0xac29('0xb')]:null,_0x5a8b2f?util[_0xac29('0x23')](_0x5a8b2f,![],null):''));}}));_0x116a6f[_0xac29('0x18')](ewinston[_0xac29('0x19')]({'winstonInstance':_0x2188a1,'meta':![],'statusLevels':!![],'msg':function(_0x27903b,_0x493219){var _0x403985=_0xac29('0x24');if(_0x27903b[_0xac29('0x1b')]&&_0x27903b[_0xac29('0x1b')][_0xac29('0x25')]&&_0x27903b[_0xac29('0x1b')][_0xac29('0x26')]){_0x403985=_0xac29('0x27');}return util['format'](_0x403985,_0x27903b[_0xac29('0x28')],_0x27903b[_0xac29('0x1d')][_0xac29('0x29')]?_0x27903b[_0xac29('0x1d')]['x-forwarded-for']:_0x27903b[_0xac29('0x1e')][_0xac29('0x1f')]||_0x27903b['ip'],_0x27903b['url'],_0x493219[_0xac29('0x21')],_0x493219[_0xac29('0x22')],_0x27903b[_0xac29('0x10')]?_0x27903b[_0xac29('0x10')]['id']:null,_0x27903b[_0xac29('0x10')]?_0x27903b[_0xac29('0x10')][_0xac29('0xc')]:null,_0x27903b[_0xac29('0x10')]?_0x27903b[_0xac29('0x10')][_0xac29('0xb')]:null,_0x27903b[_0xac29('0x1b')]&&_0x27903b[_0xac29('0x1b')]['device']?_0x27903b[_0xac29('0x1b')][_0xac29('0x25')]:_0xac29('0x2a'),_0x27903b[_0xac29('0x1b')]&&_0x27903b['body'][_0xac29('0x26')]?_0x27903b[_0xac29('0x1b')][_0xac29('0x26')]:'',_0x27903b[_0xac29('0x1b')]&&_0x27903b['body'][_0xac29('0x2b')]?_0x27903b[_0xac29('0x1b')]['agent_name']:'');},'ignoreRoute':function(_0x122c30){var _0x399864=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x399864['test'](_0x122c30['url']);}}));return _0x17f665();});}exports[_0xac29('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 430196f..4eeefc9 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c9b=['toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','warn','File','error','transports','%s-%s','Console','consoleLogger','fileLogger','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20blue','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0x0c9b,0x9b));var _0xb0c9=function(_0x4981a3,_0x5b2acc){_0x4981a3=_0x4981a3-0x0;var _0x32d0da=_0x0c9b[_0x4981a3];return _0x32d0da;};'use strict';var path=require('path');var util=require('util');var moment=require('moment');var winston=require(_0xb0c9('0x0'));var config=require(_0xb0c9('0x1'));var debugLevel=config[_0xb0c9('0x2')]?config[_0xb0c9('0x2')][_0xb0c9('0x3')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xb0c9('0x4'),'error':_0xb0c9('0x5'),'warn':_0xb0c9('0x6'),'info':_0xb0c9('0x7'),'print':_0xb0c9('0x8'),'success':'bold\x20green','http':_0xb0c9('0x9'),'verbose':'bold\x20magenta','debug':_0xb0c9('0xa'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x27da21,_0x5548ad,_0x257695){var _0x41a8b6=_0x27da21||_0xb0c9('0xb');return path[_0xb0c9('0xc')](_0x41a8b6,util[_0xb0c9('0xd')](_0xb0c9('0xe'),_0x5548ad,_0x257695));}function formatter(_0x37907d,_0x1fb0ee){_0x1fb0ee['message']=_0x1fb0ee[_0xb0c9('0xf')][_0xb0c9('0x10')](/@@{/g,_0xb0c9('0x11'))[_0xb0c9('0x10')](/}@@/g,_0xb0c9('0x12'))[_0xb0c9('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xb0c9('0xd')](_0xb0c9('0x13'),moment()[_0xb0c9('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1fb0ee['level'][_0xb0c9('0x14')](),_0x37907d,_0x1fb0ee[_0xb0c9('0xf')]);}function fileFormat(_0x2911cc,_0x460e3a){_0x460e3a[_0xb0c9('0xf')]=_0x460e3a[_0xb0c9('0xf')][_0xb0c9('0x10')](/@@{/g,_0xb0c9('0x11'))[_0xb0c9('0x10')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xb0c9('0x10')](/}@/g,'}}');var _0x16415a=_0x460e3a[_0xb0c9('0x15')]&&Object['keys'](_0x460e3a['meta'])[_0xb0c9('0x16')]?'\x0a\x09'+JSON[_0xb0c9('0x17')](_0x460e3a['meta']):'';return util['format'](_0xb0c9('0x18'),moment()['format'](_0xb0c9('0x19')),_0x460e3a['level'][_0xb0c9('0x14')](),_0x2911cc,_0x460e3a[_0xb0c9('0xf')],_0x16415a);}function consoleLogger(){var _0x19cd4e=new winston[(_0xb0c9('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0xb0c9('0x1b'),'json':![],'formatter':function(_0xdeb7a2){return formatter('',_0xdeb7a2);}})]});return _0x19cd4e;}function fileLogger(_0x686dd0,_0x453382){var _0x8ef0d0=new winston[(_0xb0c9('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xb0c9('0x1c'))]({'name':util[_0xb0c9('0xd')]('%s-%s',_0x686dd0,_0xb0c9('0x1d')),'filename':getLogFileName(_0x453382,_0x686dd0,_0xb0c9('0x1d')),'level':_0xb0c9('0x1d'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x168672){return fileFormat(_0x686dd0,_0x168672);}}),new winston[(_0xb0c9('0x1e'))][(_0xb0c9('0x1c'))]({'name':util['format'](_0xb0c9('0x1f'),_0x686dd0,debugLevel),'filename':getLogFileName(_0x453382,_0x686dd0,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2f61fd){return fileFormat(_0x686dd0,_0x2f61fd);}}),new winston['transports'][(_0xb0c9('0x20'))]({'level':_0xb0c9('0x1b'),'json':![],'formatter':function(_0x3a6879){return fileFormat(_0x686dd0,_0x3a6879);}})]});return _0x8ef0d0;}exports[_0xb0c9('0x21')]=consoleLogger;exports[_0xb0c9('0x22')]=fileLogger; \ No newline at end of file +var _0x5ffc=['winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','join','format','%s-%s.log','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','File','%s-%s','warn','consoleLogger','fileLogger','path','util','moment'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x5ffc,0x95));var _0xc5ff=function(_0x164467,_0x5df59a){_0x164467=_0x164467-0x0;var _0x56529f=_0x5ffc[_0x164467];return _0x56529f;};'use strict';var path=require(_0xc5ff('0x0'));var util=require(_0xc5ff('0x1'));var moment=require(_0xc5ff('0x2'));var winston=require(_0xc5ff('0x3'));var config=require(_0xc5ff('0x4'));var debugLevel=config[_0xc5ff('0x5')]?config[_0xc5ff('0x5')][_0xc5ff('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xc5ff('0x7'),'error':_0xc5ff('0x8'),'warn':_0xc5ff('0x9'),'info':_0xc5ff('0xa'),'print':_0xc5ff('0xb'),'success':_0xc5ff('0xc'),'http':_0xc5ff('0xd'),'verbose':_0xc5ff('0xe'),'debug':_0xc5ff('0xf'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x47077d,_0x42a759,_0x521f08){var _0x5d91b0=_0x47077d||'/var/log/xcally';return path[_0xc5ff('0x10')](_0x5d91b0,util[_0xc5ff('0x11')](_0xc5ff('0x12'),_0x42a759,_0x521f08));}function formatter(_0x5729b3,_0x203fb1){_0x203fb1['message']=_0x203fb1['message'][_0xc5ff('0x13')](/@@{/g,_0xc5ff('0x14'))[_0xc5ff('0x13')](/}@@/g,_0xc5ff('0x15'))[_0xc5ff('0x13')](/@{/g,'{{')[_0xc5ff('0x13')](/}@/g,'}}');return util[_0xc5ff('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xc5ff('0x11')](_0xc5ff('0x16')),_0x203fb1[_0xc5ff('0x17')][_0xc5ff('0x18')](),_0x5729b3,_0x203fb1[_0xc5ff('0x19')]);}function fileFormat(_0x59da41,_0x19ad6c){_0x19ad6c[_0xc5ff('0x19')]=_0x19ad6c[_0xc5ff('0x19')][_0xc5ff('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,_0xc5ff('0x15'))[_0xc5ff('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x469c1e=_0x19ad6c[_0xc5ff('0x1a')]&&Object[_0xc5ff('0x1b')](_0x19ad6c[_0xc5ff('0x1a')])[_0xc5ff('0x1c')]?'\x0a\x09'+JSON[_0xc5ff('0x1d')](_0x19ad6c['meta']):'';return util[_0xc5ff('0x11')](_0xc5ff('0x1e'),moment()[_0xc5ff('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x19ad6c['level'][_0xc5ff('0x18')](),_0x59da41,_0x19ad6c[_0xc5ff('0x19')],_0x469c1e);}function consoleLogger(){var _0x2f8fd7=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc5ff('0x1f'))][(_0xc5ff('0x20'))]({'level':'warn','json':![],'formatter':function(_0x3019b8){return formatter('',_0x3019b8);}})]});return _0x2f8fd7;}function fileLogger(_0x56640d,_0x73f93){var _0xfb2bce=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc5ff('0x1f'))][(_0xc5ff('0x21'))]({'name':util[_0xc5ff('0x11')]('%s-%s',_0x56640d,'error'),'filename':getLogFileName(_0x73f93,_0x56640d,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1418a6){return fileFormat(_0x56640d,_0x1418a6);}}),new winston[(_0xc5ff('0x1f'))][(_0xc5ff('0x21'))]({'name':util[_0xc5ff('0x11')](_0xc5ff('0x22'),_0x56640d,debugLevel),'filename':getLogFileName(_0x73f93,_0x56640d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f531b){return fileFormat(_0x56640d,_0x3f531b);}}),new winston['transports'][(_0xc5ff('0x20'))]({'level':_0xc5ff('0x23'),'json':![],'formatter':function(_0x16f3d3){return fileFormat(_0x56640d,_0x16f3d3);}})]});return _0xfb2bce;}exports[_0xc5ff('0x24')]=consoleLogger;exports[_0xc5ff('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index a8f4c33..bf59bb4 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 _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x0295,0x1f0));var _0x5029=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0x0295[_0x3394a6];return _0x4a7909;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x1a85,0x178));var _0x51a8=function(_0x53feda,_0x8d5d13){_0x53feda=_0x53feda-0x0;var _0x2c0b4f=_0x1a85[_0x53feda];return _0x2c0b4f;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 050778a..8a1cb78 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 _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x80ed,0x11c));var _0xd80e=function(_0x2a52d6,_0x3de0df){_0x2a52d6=_0x2a52d6-0x0;var _0x253fe5=_0x80ed[_0x2a52d6];return _0x253fe5;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file +var _0x896e=['map','isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x4bd5fe,_0x27b6f6){var _0x125396=function(_0x238256){while(--_0x238256){_0x4bd5fe['push'](_0x4bd5fe['shift']());}};_0x125396(++_0x27b6f6);}(_0x896e,0x1e9));var _0xe896=function(_0x1a739d,_0x2544db){_0x1a739d=_0x1a739d-0x0;var _0x18726a=_0x896e[_0x1a739d];return _0x18726a;};var _=require(_0xe896('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1bab19){return _0x1bab19==='{{'?_0xe896('0x1'):_0xe896('0x2');}function safeTemplate(_0x36085e){var _0x26d296=_0x36085e;if(typeof _0x36085e===_0xe896('0x3')){_0x26d296=_0x36085e[_0xe896('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe896('0x5')](_0x36085e)){_0x26d296=_0x36085e[_0xe896('0x6')](function(_0x244f68){return safeTemplate(_0x244f68);});}else if(_[_0xe896('0x7')](_0x36085e)){_0x26d296=Object['keys'](_0x36085e)[_0xe896('0x8')](function(_0x7a0721,_0x3b902c){_0x7a0721[_0x3b902c]=safeTemplate(_0x36085e[_0x3b902c]);return _0x7a0721;},{});}return _0x26d296;}module[_0xe896('0x9')][_0xe896('0xa')]=safeTemplate; \ No newline at end of file